From: support Date: Tue, 29 Nov 2022 15:42:19 +0000 (+0000) Subject: Built motion from commit 28aaf68b.|2.6.24 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%201101license.mail?a=commitdiff_plain;h=da3c3c6c24f03150e10adaeeea1902fe50554849;p=motion2.git Built motion from commit 28aaf68b.|2.6.24 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6daa660..6cfe77c 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-29T15:11:42.884Z", + "time": "2022-11-29T15:32:56.203Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index ad26acd..405a1d2 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-29T15:11:42.884Z", + "time": "2022-11-29T15:32:56.203Z", "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 44eb8e8..1e19b70 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 _0xa24c=['contactManager','integration','motionbar','jscripty','urlForward','browser','bot','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','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x515903,_0x35aac3){var _0x542105=function(_0x25c927){while(--_0x25c927){_0x515903['push'](_0x515903['shift']());}};_0x542105(++_0x35aac3);}(_0xa24c,0x11d));var _0xca24=function(_0x6aae5a,_0x374f99){_0x6aae5a=_0x6aae5a-0x0;var _0x460b76=_0xa24c[_0x6aae5a];return _0x460b76;};'use strict';var Sequelize=require(_0xca24('0x0'));module[_0xca24('0x1')]={'name':{'type':Sequelize[_0xca24('0x2')],'get':function(_0x119724){return this[_0xca24('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xca24('0x4'),_0xca24('0x5'),_0xca24('0x6'),_0xca24('0x7'),_0xca24('0x8'),_0xca24('0x9'),_0xca24('0xa'),'script']],'msg':_0xca24('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xca24('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xca24('0xd')](0x1000),'comments':_0xca24('0xe')},'data5':{'type':Sequelize[_0xca24('0xd')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xca24('0xd')],'comments':_0xca24('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0xca24('0x10')}}; \ No newline at end of file +var _0xd1e2=['exports','action','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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]'];(function(_0x2851f2,_0x3d6113){var _0x4984db=function(_0x5c354f){while(--_0x5c354f){_0x2851f2['push'](_0x2851f2['shift']());}};_0x4984db(++_0x3d6113);}(_0xd1e2,0x1c2));var _0x2d1e=function(_0x9302c3,_0x43cf30){_0x9302c3=_0x9302c3-0x0;var _0x3a6d83=_0xd1e2[_0x9302c3];return _0x3a6d83;};'use strict';var Sequelize=require('sequelize');module[_0x2d1e('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38bff9){return this['getDataValue'](_0x2d1e('0x1'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x2d1e('0x2'),_0x2d1e('0x3'),_0x2d1e('0x4'),'jscripty',_0x2d1e('0x5'),_0x2d1e('0x6'),_0x2d1e('0x7'),_0x2d1e('0x8')]],'msg':_0x2d1e('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x2d1e('0xa')](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[_0x2d1e('0xa')](0x1000),'comment':_0x2d1e('0xb')},'data3':{'type':Sequelize[_0x2d1e('0xa')](0x1000),'comment':_0x2d1e('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x2d1e('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x2d1e('0xe')},'data6':{'type':Sequelize[_0x2d1e('0xa')],'comments':_0x2d1e('0xf')},'data7':{'type':Sequelize[_0x2d1e('0x10')],'comments':_0x2d1e('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index cca588a..1962703 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 _0x3ecf=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','json','limit','undefined','count','offset','status','set','apply','save','then','destroy','error','send','update','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3777f1,_0x1d654c){var _0x1f23d0=function(_0x270b67){while(--_0x270b67){_0x3777f1['push'](_0x3777f1['shift']());}};_0x1f23d0(++_0x1d654c);}(_0x3ecf,0xca));var _0xf3ec=function(_0x4219c1,_0x9b8e24){_0x4219c1=_0x4219c1-0x0;var _0x4b25a6=_0x3ecf[_0x4219c1];return _0x4b25a6;};'use strict';var emlformat=require(_0xf3ec('0x0'));var rimraf=require(_0xf3ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3ec('0x2'));var rp=require(_0xf3ec('0x3'));var moment=require(_0xf3ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf3ec('0x5'));var util=require(_0xf3ec('0x6'));var path=require(_0xf3ec('0x7'));var sox=require('sox');var csv=require(_0xf3ec('0x8'));var ejs=require(_0xf3ec('0x9'));var fs=require('fs');var fs_extra=require(_0xf3ec('0xa'));var _=require(_0xf3ec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf3ec('0xc'));var deskjs=require(_0xf3ec('0xd'));var toCsv=require(_0xf3ec('0x8'));var querystring=require(_0xf3ec('0xe'));var Papa=require('papaparse');var Redis=require(_0xf3ec('0xf'));var authService=require(_0xf3ec('0x10'));var qs=require(_0xf3ec('0x11'));var as=require(_0xf3ec('0x12'));var hardwareService=require(_0xf3ec('0x13'));var logger=require(_0xf3ec('0x14'))(_0xf3ec('0x15'));var utils=require('../../config/utils');var config=require(_0xf3ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3ec('0x17'))['db'];function respondWithStatusCode(_0x23dc07,_0x5a9fb3){_0x5a9fb3=_0x5a9fb3||0xcc;return function(_0x5326c2){if(_0x5326c2){return _0x23dc07['sendStatus'](_0x5a9fb3);}return _0x23dc07['status'](_0x5a9fb3)[_0xf3ec('0x18')]();};}function respondWithResult(_0x301eef,_0x49482b){_0x49482b=_0x49482b||0xc8;return function(_0x3df028){if(_0x3df028){return _0x301eef['status'](_0x49482b)[_0xf3ec('0x19')](_0x3df028);}};}function respondWithFilteredResult(_0x1866f5,_0x4c4aa1){return function(_0x5becfc){if(_0x5becfc){var _0x22ad7d=typeof _0x4c4aa1['offset']==='undefined'&&typeof _0x4c4aa1[_0xf3ec('0x1a')]===_0xf3ec('0x1b');var _0x1e1804=_0x5becfc[_0xf3ec('0x1c')];var _0xff91b5=_0x22ad7d?0x0:_0x4c4aa1[_0xf3ec('0x1d')];var _0x503b48=_0x22ad7d?_0x5becfc[_0xf3ec('0x1c')]:_0x4c4aa1[_0xf3ec('0x1d')]+_0x4c4aa1[_0xf3ec('0x1a')];var _0x415bb9;if(_0x503b48>=_0x1e1804){_0x503b48=_0x1e1804;_0x415bb9=0xc8;}else{_0x415bb9=0xce;}_0x1866f5[_0xf3ec('0x1e')](_0x415bb9);return _0x1866f5[_0xf3ec('0x1f')]('Content-Range',_0xff91b5+'-'+_0x503b48+'/'+_0x1e1804)['json'](_0x5becfc);}return null;};}function patchUpdates(_0x3a9df1){return function(_0x2924a1){try{jsonpatch[_0xf3ec('0x20')](_0x2924a1,_0x3a9df1,!![]);}catch(_0x2d0017){return BPromise['reject'](_0x2d0017);}return _0x2924a1[_0xf3ec('0x21')]();};}function saveUpdates(_0x5f3bd3,_0x7fcaaa){return function(_0x31662c){if(_0x31662c){return _0x31662c['update'](_0x5f3bd3)[_0xf3ec('0x22')](function(_0x50a2d9){return _0x50a2d9;});}return null;};}function removeEntity(_0x5ae5cf,_0x37ed62){return function(_0x172de3){if(_0x172de3){return _0x172de3[_0xf3ec('0x23')]()[_0xf3ec('0x22')](function(){_0x5ae5cf[_0xf3ec('0x1e')](0xcc)[_0xf3ec('0x18')]();});}};}function handleEntityNotFound(_0x41ab77,_0x1e2566){return function(_0x10bbcd){if(!_0x10bbcd){_0x41ab77['sendStatus'](0x194);}return _0x10bbcd;};}function handleError(_0x188aac,_0x1606df){_0x1606df=_0x1606df||0x1f4;return function(_0x51a2fb){logger[_0xf3ec('0x24')](_0x51a2fb['stack']);if(_0x51a2fb['name']){delete _0x51a2fb['name'];}_0x188aac[_0xf3ec('0x1e')](_0x1606df)[_0xf3ec('0x25')](_0x51a2fb);};}exports[_0xf3ec('0x26')]=function(_0x421247,_0x5283ed){if(_0x421247[_0xf3ec('0x27')]['id']){delete _0x421247[_0xf3ec('0x27')]['id'];}return db[_0xf3ec('0x28')][_0xf3ec('0x29')]({'where':{'id':_0x421247[_0xf3ec('0x2a')]['id']}})[_0xf3ec('0x22')](handleEntityNotFound(_0x5283ed,null))['then'](saveUpdates(_0x421247[_0xf3ec('0x27')],null))['then'](respondWithResult(_0x5283ed,null))[_0xf3ec('0x2b')](handleError(_0x5283ed,null));};exports['destroy']=function(_0x306452,_0x982008){return db['Action'][_0xf3ec('0x29')]({'where':{'id':_0x306452[_0xf3ec('0x2a')]['id']}})['then'](handleEntityNotFound(_0x982008,null))[_0xf3ec('0x22')](removeEntity(_0x982008,null))['catch'](handleError(_0x982008,null));}; \ No newline at end of file +var _0xff13=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','body','find','params','catch','Action'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xff13,0x1d4));var _0x3ff1=function(_0x1cf861,_0x22d87b){_0x1cf861=_0x1cf861-0x0;var _0x49e521=_0xff13[_0x1cf861];return _0x49e521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ff1('0x0'));var zipdir=require(_0x3ff1('0x1'));var jsonpatch=require(_0x3ff1('0x2'));var rp=require(_0x3ff1('0x3'));var moment=require(_0x3ff1('0x4'));var BPromise=require(_0x3ff1('0x5'));var Mustache=require(_0x3ff1('0x6'));var util=require(_0x3ff1('0x7'));var path=require(_0x3ff1('0x8'));var sox=require(_0x3ff1('0x9'));var csv=require(_0x3ff1('0xa'));var ejs=require(_0x3ff1('0xb'));var fs=require('fs');var fs_extra=require(_0x3ff1('0xc'));var _=require(_0x3ff1('0xd'));var squel=require(_0x3ff1('0xe'));var crypto=require(_0x3ff1('0xf'));var jsforce=require(_0x3ff1('0x10'));var deskjs=require(_0x3ff1('0x11'));var toCsv=require(_0x3ff1('0xa'));var querystring=require(_0x3ff1('0x12'));var Papa=require('papaparse');var Redis=require(_0x3ff1('0x13'));var authService=require(_0x3ff1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3ff1('0x15'));var hardwareService=require(_0x3ff1('0x16'));var logger=require(_0x3ff1('0x17'))(_0x3ff1('0x18'));var utils=require(_0x3ff1('0x19'));var config=require(_0x3ff1('0x1a'));var licenseUtil=require(_0x3ff1('0x1b'));var db=require(_0x3ff1('0x1c'))['db'];function respondWithStatusCode(_0x40f71c,_0x248c74){_0x248c74=_0x248c74||0xcc;return function(_0xf003e9){if(_0xf003e9){return _0x40f71c[_0x3ff1('0x1d')](_0x248c74);}return _0x40f71c[_0x3ff1('0x1e')](_0x248c74)['end']();};}function respondWithResult(_0x1d350b,_0x9b3f69){_0x9b3f69=_0x9b3f69||0xc8;return function(_0xb1b706){if(_0xb1b706){return _0x1d350b[_0x3ff1('0x1e')](_0x9b3f69)[_0x3ff1('0x1f')](_0xb1b706);}};}function respondWithFilteredResult(_0x46f417,_0x5e53b4){return function(_0x422bcb){if(_0x422bcb){var _0x27f240=typeof _0x5e53b4[_0x3ff1('0x20')]===_0x3ff1('0x21')&&typeof _0x5e53b4['limit']==='undefined';var _0x6bdd65=_0x422bcb['count'];var _0x294f3a=_0x27f240?0x0:_0x5e53b4['offset'];var _0x11193c=_0x27f240?_0x422bcb[_0x3ff1('0x22')]:_0x5e53b4[_0x3ff1('0x20')]+_0x5e53b4['limit'];var _0x22518a;if(_0x11193c>=_0x6bdd65){_0x11193c=_0x6bdd65;_0x22518a=0xc8;}else{_0x22518a=0xce;}_0x46f417['status'](_0x22518a);return _0x46f417[_0x3ff1('0x23')](_0x3ff1('0x24'),_0x294f3a+'-'+_0x11193c+'/'+_0x6bdd65)['json'](_0x422bcb);}return null;};}function patchUpdates(_0x30a06f){return function(_0x183a6c){try{jsonpatch[_0x3ff1('0x25')](_0x183a6c,_0x30a06f,!![]);}catch(_0x50fc7e){return BPromise['reject'](_0x50fc7e);}return _0x183a6c[_0x3ff1('0x26')]();};}function saveUpdates(_0x5596da,_0xb753ee){return function(_0x243ede){if(_0x243ede){return _0x243ede[_0x3ff1('0x27')](_0x5596da)[_0x3ff1('0x28')](function(_0x229884){return _0x229884;});}return null;};}function removeEntity(_0x5a5e35,_0x1c478c){return function(_0x3aa3a0){if(_0x3aa3a0){return _0x3aa3a0[_0x3ff1('0x29')]()[_0x3ff1('0x28')](function(){_0x5a5e35[_0x3ff1('0x1e')](0xcc)[_0x3ff1('0x2a')]();});}};}function handleEntityNotFound(_0x3c1e9f,_0xb7ec99){return function(_0x13041c){if(!_0x13041c){_0x3c1e9f[_0x3ff1('0x1d')](0x194);}return _0x13041c;};}function handleError(_0xeea754,_0x32eea1){_0x32eea1=_0x32eea1||0x1f4;return function(_0x20d925){logger[_0x3ff1('0x2b')](_0x20d925[_0x3ff1('0x2c')]);if(_0x20d925[_0x3ff1('0x2d')]){delete _0x20d925['name'];}_0xeea754[_0x3ff1('0x1e')](_0x32eea1)[_0x3ff1('0x2e')](_0x20d925);};}exports[_0x3ff1('0x27')]=function(_0x52f0a3,_0xc0fe77){if(_0x52f0a3[_0x3ff1('0x2f')]['id']){delete _0x52f0a3[_0x3ff1('0x2f')]['id'];}return db['Action'][_0x3ff1('0x30')]({'where':{'id':_0x52f0a3[_0x3ff1('0x31')]['id']}})[_0x3ff1('0x28')](handleEntityNotFound(_0xc0fe77,null))[_0x3ff1('0x28')](saveUpdates(_0x52f0a3[_0x3ff1('0x2f')],null))[_0x3ff1('0x28')](respondWithResult(_0xc0fe77,null))[_0x3ff1('0x32')](handleError(_0xc0fe77,null));};exports[_0x3ff1('0x29')]=function(_0x56d961,_0x3fb849){return db[_0x3ff1('0x33')][_0x3ff1('0x30')]({'where':{'id':_0x56d961[_0x3ff1('0x31')]['id']}})[_0x3ff1('0x28')](handleEntityNotFound(_0x3fb849,null))[_0x3ff1('0x28')](removeEntity(_0x3fb849,null))['catch'](handleError(_0x3fb849,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5a42c78..54f590b 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 _0x7ac7=['api','moment','request-promise','rimraf','./action.attributes','exports','lodash','../../config/logger'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x7ac7,0xf6));var _0x77ac=function(_0x502c75,_0x4741df){_0x502c75=_0x502c75-0x0;var _0x21da37=_0x7ac7[_0x502c75];return _0x21da37;};'use strict';var _=require(_0x77ac('0x0'));var util=require('util');var logger=require(_0x77ac('0x1'))(_0x77ac('0x2'));var moment=require(_0x77ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x77ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77ac('0x5'));var config=require('../../config/environment');var attributes=require(_0x77ac('0x6'));module[_0x77ac('0x7')]=function(_0x492a73,_0x4f5ef1){return _0x492a73['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45d2=['bluebird','request-promise','../../config/environment','define','Action','tools_actions','lodash','util','../../config/logger','api'];(function(_0x59f3d6,_0x4389ee){var _0x386933=function(_0x26dfb6){while(--_0x26dfb6){_0x59f3d6['push'](_0x59f3d6['shift']());}};_0x386933(++_0x4389ee);}(_0x45d2,0xec));var _0x245d=function(_0x1dc995,_0x5dd8f4){_0x1dc995=_0x1dc995-0x0;var _0x2cd006=_0x45d2[_0x1dc995];return _0x2cd006;};'use strict';var _=require(_0x245d('0x0'));var util=require(_0x245d('0x1'));var logger=require(_0x245d('0x2'))(_0x245d('0x3'));var moment=require('moment');var BPromise=require(_0x245d('0x4'));var rp=require(_0x245d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x245d('0x6'));var attributes=require('./action.attributes');module['exports']=function(_0x568f94,_0x46a727){return _0x568f94[_0x245d('0x7')](_0x245d('0x8'),attributes,{'tableName':_0x245d('0x9'),'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 f10bc77..65f1d78 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x814b,0x1a2));var _0xb814=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x814b[_0xef4cf0];return _0x497ad2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x15a634,_0x3e20d0){var _0x4c7d46=function(_0x10ef24){while(--_0x10ef24){_0x15a634['push'](_0x15a634['shift']());}};_0x4c7d46(++_0x3e20d0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0x7fbe[_0x21b74b];return _0x518cc6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 96ce4dc..97345f9 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 _0x0757=['isAuthenticated','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id'];(function(_0x3bcb39,_0x2e1bd0){var _0x158bc4=function(_0x5570d3){while(--_0x5570d3){_0x3bcb39['push'](_0x3bcb39['shift']());}};_0x158bc4(++_0x2e1bd0);}(_0x0757,0x7b));var _0x7075=function(_0x424900,_0x5565b8){_0x424900=_0x424900-0x0;var _0x32968d=_0x0757[_0x424900];return _0x32968d;};'use strict';var multer=require('multer');var util=require(_0x7075('0x0'));var path=require(_0x7075('0x1'));var timeout=require('connect-timeout');var express=require(_0x7075('0x2'));var router=express[_0x7075('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7075('0x4'));var interaction=require(_0x7075('0x5'));var config=require('../../config/environment');var controller=require(_0x7075('0x6'));router[_0x7075('0x7')](_0x7075('0x8'),auth[_0x7075('0x9')](),controller['update']);router['delete'](_0x7075('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x7075('0xa')]=router; \ No newline at end of file +var _0x0d35=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','update','delete','/:id','isAuthenticated','destroy'];(function(_0x43a84a,_0x6c500e){var _0x2ed43a=function(_0x8f88c3){while(--_0x8f88c3){_0x43a84a['push'](_0x43a84a['shift']());}};_0x2ed43a(++_0x6c500e);}(_0x0d35,0xb7));var _0x50d3=function(_0x14ab65,_0x8dc76a){_0x14ab65=_0x14ab65-0x0;var _0x556a6d=_0x0d35[_0x14ab65];return _0x556a6d;};'use strict';var multer=require(_0x50d3('0x0'));var util=require(_0x50d3('0x1'));var path=require('path');var timeout=require(_0x50d3('0x2'));var express=require(_0x50d3('0x3'));var router=express[_0x50d3('0x4')]();var fs_extra=require(_0x50d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x50d3('0x6'));var config=require(_0x50d3('0x7'));var controller=require('./action.controller');router['put']('/:id',auth['isAuthenticated'](),controller[_0x50d3('0x8')]);router[_0x50d3('0x9')](_0x50d3('0xa'),auth[_0x50d3('0xb')](),controller[_0x50d3('0xc')]);module[_0x50d3('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 a119143..6317e2e 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 _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0xaf4b6d,_0x59fa61){var _0x2b1d30=function(_0x525312){while(--_0x525312){_0xaf4b6d['push'](_0xaf4b6d['shift']());}};_0x2b1d30(++_0x59fa61);}(_0x5d17,0x114));var _0x75d1=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x5d17[_0x56f7e2];return _0x36240b;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x51be7f,_0xd159f3){var _0x58f88c=function(_0x29c5d7){while(--_0x29c5d7){_0x51be7f['push'](_0x51be7f['shift']());}};_0x58f88c(++_0xd159f3);}(_0x5fab,0x177));var _0xb5fa=function(_0x7440e0,_0x42d9b8){_0x7440e0=_0x7440e0-0x0;var _0x33ee99=_0x5fab[_0x7440e0];return _0x33ee99;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index c8782b7..f85c4ff 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 _0x4816=['UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20EMPTY','web','fullPath','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','output','../../files/reports','savename','countTable','COUNT(*)','runReport','COUNT(%s)','HOUR(%s)','debug','eml-format','rimraf','fast-json-patch','request-promise','moment','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3d9f76,_0x451d68){var _0x3860be=function(_0x281cfb){while(--_0x281cfb){_0x3d9f76['push'](_0x3d9f76['shift']());}};_0x3860be(++_0x451d68);}(_0x4816,0x127));var _0x6481=function(_0x3d7f7d,_0x5d57d7){_0x3d7f7d=_0x3d7f7d-0x0;var _0x59c78b=_0x4816[_0x3d7f7d];return _0x59c78b;};'use strict';var emlformat=require(_0x6481('0x0'));var rimraf=require(_0x6481('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6481('0x2'));var rp=require(_0x6481('0x3'));var moment=require(_0x6481('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6481('0x5'));var sox=require('sox');var csv=require(_0x6481('0x6'));var ejs=require(_0x6481('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6481('0x8'));var squel=require(_0x6481('0x9'));var crypto=require('crypto');var jsforce=require(_0x6481('0xa'));var deskjs=require(_0x6481('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6481('0xc'));var Papa=require(_0x6481('0xd'));var Redis=require(_0x6481('0xe'));var authService=require(_0x6481('0xf'));var qs=require(_0x6481('0x10'));var as=require(_0x6481('0x11'));var hardwareService=require(_0x6481('0x12'));var logger=require('../../config/logger')(_0x6481('0x13'));var utils=require('../../config/utils');var config=require(_0x6481('0x14'));var licenseUtil=require(_0x6481('0x15'));var db=require(_0x6481('0x16'))['db'];var dbH=require(_0x6481('0x16'))[_0x6481('0x17')];function respondWithStatusCode(_0x39a5fc,_0x349894){_0x349894=_0x349894||0xcc;return function(_0x1c23f0){if(_0x1c23f0){return _0x39a5fc[_0x6481('0x18')](_0x349894);}return _0x39a5fc['status'](_0x349894)[_0x6481('0x19')]();};}function respondWithResult(_0xdf1e91,_0xb52b85){_0xb52b85=_0xb52b85||0xc8;return function(_0x4ad9df){if(_0x4ad9df){return _0xdf1e91[_0x6481('0x1a')](_0xb52b85)['json'](_0x4ad9df);}};}function respondWithFilteredResult(_0x33f864,_0x1d27ea){return function(_0x16f25e){if(_0x16f25e){var _0x1ad4e7=typeof _0x1d27ea['offset']===_0x6481('0x1b')&&typeof _0x1d27ea['limit']===_0x6481('0x1b');var _0x3e99a6=_0x16f25e['count'];var _0x1b3e70=_0x1ad4e7?0x0:_0x1d27ea[_0x6481('0x1c')];var _0x53d449=_0x1ad4e7?_0x16f25e[_0x6481('0x1d')]:_0x1d27ea['offset']+_0x1d27ea[_0x6481('0x1e')];var _0x516bc8;if(_0x53d449>=_0x3e99a6){_0x53d449=_0x3e99a6;_0x516bc8=0xc8;}else{_0x516bc8=0xce;}_0x33f864[_0x6481('0x1a')](_0x516bc8);return _0x33f864[_0x6481('0x1f')](_0x6481('0x20'),_0x1b3e70+'-'+_0x53d449+'/'+_0x3e99a6)['json'](_0x16f25e);}return null;};}function patchUpdates(_0x265f63){return function(_0x328883){try{jsonpatch[_0x6481('0x21')](_0x328883,_0x265f63,!![]);}catch(_0x2682af){return BPromise[_0x6481('0x22')](_0x2682af);}return _0x328883[_0x6481('0x23')]();};}function saveUpdates(_0x58db0b,_0x12e44e){return function(_0x381e0){if(_0x381e0){return _0x381e0[_0x6481('0x24')](_0x58db0b)[_0x6481('0x25')](function(_0x221ed8){return _0x221ed8;});}return null;};}function removeEntity(_0x5e2e80,_0x55d343){return function(_0x115b5e){if(_0x115b5e){return _0x115b5e[_0x6481('0x26')]()[_0x6481('0x25')](function(){var _0x1c69c6=_0x115b5e['get']({'plain':!![]});var _0x2053d6='CustomReports';return db[_0x6481('0x27')]['destroy']({'where':{'type':_0x2053d6,'resourceId':_0x1c69c6['id']}})[_0x6481('0x25')](function(){return _0x115b5e;});})[_0x6481('0x25')](function(){_0x5e2e80[_0x6481('0x1a')](0xcc)[_0x6481('0x19')]();});}};}function handleEntityNotFound(_0x4ecd6f,_0x33a748){return function(_0x14178b){if(!_0x14178b){_0x4ecd6f[_0x6481('0x18')](0x194);}return _0x14178b;};}function handleError(_0x55d3d0,_0x199292){_0x199292=_0x199292||0x1f4;return function(_0x5cdfcc){logger[_0x6481('0x28')](_0x5cdfcc[_0x6481('0x29')]);if(_0x5cdfcc[_0x6481('0x2a')]){delete _0x5cdfcc[_0x6481('0x2a')];}_0x55d3d0[_0x6481('0x1a')](_0x199292)[_0x6481('0x2b')](_0x5cdfcc);};}exports['index']=function(_0x3fcd55,_0x3fb178){var _0x531179={},_0x3706f7={},_0x1ae510={'count':0x0,'rows':[]};var _0x824f21=_['map'](db[_0x6481('0x2c')][_0x6481('0x2d')],function(_0x376148){return{'name':_0x376148['fieldName'],'type':_0x376148[_0x6481('0x2e')][_0x6481('0x2f')]};});_0x3706f7[_0x6481('0x30')]=_[_0x6481('0x31')](_0x824f21,_0x6481('0x2a'));_0x3706f7[_0x6481('0x32')]=_[_0x6481('0x33')](_0x3fcd55[_0x6481('0x32')]);_0x3706f7[_0x6481('0x34')]=_[_0x6481('0x35')](_0x3706f7['model'],_0x3706f7['query']);_0x531179['attributes']=_[_0x6481('0x35')](_0x3706f7['model'],qs[_0x6481('0x36')](_0x3fcd55[_0x6481('0x32')][_0x6481('0x36')]));_0x531179[_0x6481('0x37')]=_0x531179[_0x6481('0x37')][_0x6481('0x38')]?_0x531179[_0x6481('0x37')]:_0x3706f7[_0x6481('0x30')];if(!_0x3fcd55[_0x6481('0x32')][_0x6481('0x39')]('nolimit')){_0x531179['limit']=qs[_0x6481('0x1e')](_0x3fcd55[_0x6481('0x32')][_0x6481('0x1e')]);_0x531179[_0x6481('0x1c')]=qs[_0x6481('0x1c')](_0x3fcd55[_0x6481('0x32')][_0x6481('0x1c')]);}_0x531179['order']=qs[_0x6481('0x3a')](_0x3fcd55[_0x6481('0x32')][_0x6481('0x3a')]);_0x531179[_0x6481('0x3b')]=qs[_0x6481('0x34')](_[_0x6481('0x3c')](_0x3fcd55['query'],_0x3706f7[_0x6481('0x34')]),_0x824f21);if(_0x3fcd55['query'][_0x6481('0x3d')]){_0x531179[_0x6481('0x3b')]=_['merge'](_0x531179[_0x6481('0x3b')],{'$or':_[_0x6481('0x31')](_0x824f21,function(_0x5888dc){if(_0x5888dc['type']!=='VIRTUAL'){var _0x5029f1={};_0x5029f1[_0x5888dc[_0x6481('0x2a')]]={'$like':'%'+_0x3fcd55[_0x6481('0x32')]['filter']+'%'};return _0x5029f1;}})});}_0x531179=_['merge']({},_0x531179,_0x3fcd55[_0x6481('0x3e')]);var _0x26f8cc={'where':_0x531179[_0x6481('0x3b')]};return db[_0x6481('0x2c')][_0x6481('0x1d')](_0x26f8cc)[_0x6481('0x25')](function(_0x3a0e4a){_0x1ae510[_0x6481('0x1d')]=_0x3a0e4a;if(_0x3fcd55[_0x6481('0x32')][_0x6481('0x3f')]){_0x531179[_0x6481('0x40')]=[{'all':!![]}];}return db[_0x6481('0x2c')][_0x6481('0x41')](_0x531179);})[_0x6481('0x25')](function(_0x19b687){_0x1ae510[_0x6481('0x42')]=_0x19b687;return _0x1ae510;})[_0x6481('0x25')](respondWithFilteredResult(_0x3fb178,_0x531179))[_0x6481('0x43')](handleError(_0x3fb178,null));};exports[_0x6481('0x44')]=function(_0x2fad19,_0x53809d){var _0x31f443={'raw':![],'where':{'id':_0x2fad19[_0x6481('0x45')]['id']}},_0x1e0928={};_0x1e0928['model']=_[_0x6481('0x33')](db['AnalyticCustomReport'][_0x6481('0x2d')]);_0x1e0928[_0x6481('0x32')]=_[_0x6481('0x33')](_0x2fad19['query']);_0x1e0928[_0x6481('0x34')]=_[_0x6481('0x35')](_0x1e0928[_0x6481('0x30')],_0x1e0928[_0x6481('0x32')]);_0x31f443[_0x6481('0x37')]=_[_0x6481('0x35')](_0x1e0928[_0x6481('0x30')],qs[_0x6481('0x36')](_0x2fad19[_0x6481('0x32')][_0x6481('0x36')]));_0x31f443[_0x6481('0x37')]=_0x31f443['attributes'][_0x6481('0x38')]?_0x31f443[_0x6481('0x37')]:_0x1e0928['model'];if(_0x2fad19['query']['includeAll']){_0x31f443[_0x6481('0x40')]=[{'all':!![]}];}_0x31f443=_[_0x6481('0x46')]({},_0x31f443,_0x2fad19[_0x6481('0x3e')]);return db[_0x6481('0x2c')][_0x6481('0x47')](_0x31f443)[_0x6481('0x25')](handleEntityNotFound(_0x53809d,null))[_0x6481('0x25')](respondWithResult(_0x53809d,null))['catch'](handleError(_0x53809d,null));};exports[_0x6481('0x48')]=function(_0x46d73d,_0x2b1bef){return db[_0x6481('0x2c')][_0x6481('0x48')](_0x46d73d[_0x6481('0x49')],{})[_0x6481('0x25')](function(_0x1c54e3){var _0x3735aa=_0x46d73d[_0x6481('0x4a')][_0x6481('0x4b')]({'plain':!![]});if(!_0x3735aa)throw new Error(_0x6481('0x4c'));if(_0x3735aa[_0x6481('0x4d')]===_0x6481('0x4a')){var _0x3fa694=_0x1c54e3[_0x6481('0x4b')]({'plain':!![]});var _0x133363=_0x6481('0x4e');return db[_0x6481('0x4f')]['find']({'where':{'name':_0x133363,'userProfileId':_0x3735aa[_0x6481('0x50')]},'raw':!![]})[_0x6481('0x25')](function(_0x19ff2a){if(_0x19ff2a&&_0x19ff2a['autoAssociation']===0x0){return db[_0x6481('0x27')][_0x6481('0x48')]({'name':_0x3fa694[_0x6481('0x2a')],'resourceId':_0x3fa694['id'],'type':_0x6481('0x51'),'sectionId':_0x19ff2a['id']},{})['then'](function(){return _0x1c54e3;});}else{return _0x1c54e3;}})[_0x6481('0x43')](function(_0x4a7d8f){logger['error'](_0x6481('0x52'),_0x4a7d8f);throw _0x4a7d8f;});}return _0x1c54e3;})[_0x6481('0x25')](respondWithResult(_0x2b1bef,0xc9))[_0x6481('0x43')](handleError(_0x2b1bef,null));};exports['update']=function(_0xd016dd,_0x2c0ad6){if(_0xd016dd['body']['id']){delete _0xd016dd['body']['id'];}return db[_0x6481('0x2c')][_0x6481('0x47')]({'where':{'id':_0xd016dd[_0x6481('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c0ad6,null))[_0x6481('0x25')](saveUpdates(_0xd016dd[_0x6481('0x49')],null))['then'](respondWithResult(_0x2c0ad6,null))['catch'](handleError(_0x2c0ad6,null));};exports[_0x6481('0x26')]=function(_0x482c59,_0x829f8e){return db[_0x6481('0x2c')][_0x6481('0x47')]({'where':{'id':_0x482c59['params']['id']}})[_0x6481('0x25')](handleEntityNotFound(_0x829f8e,null))[_0x6481('0x25')](removeEntity(_0x829f8e,null))[_0x6481('0x43')](handleError(_0x829f8e,null));};exports[_0x6481('0x53')]=function(_0x477fd6,_0x3cd906){var _0x3d92ab=0xa;var _0x601e4c=[_0x6481('0x54'),_0x6481('0x55'),_0x6481('0x56'),_0x6481('0x57')];var _0x3ccd2f={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6481('0x58'),'MAX':_0x6481('0x59'),'MIN':'MIN(%s)','AVG':_0x6481('0x5a'),'GROUP_CONCAT':_0x6481('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6481('0x5c')};var _0x28718e={'SEC_TO_TIME':_0x6481('0x5d'),'DATE':_0x6481('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x6481('0x5f'),'UNIX_TIMESTAMP':_0x6481('0x60')};var _0x249c0b=function(_0x73134d){return!_[_0x6481('0x61')]([_0x6481('0x62'),_0x6481('0x63'),_0x6481('0x64'),'IS\x20NOT\x20EMPTY'],_0x73134d);};var _0x440431=function(_0xab0fef){if(!_0xab0fef||!_0xab0fef[_0x6481('0x65')][_0x6481('0x38')]){return'';}for(var _0x4cc3b7='(',_0x417572=0x0;_0x417572<_0xab0fef['rules'][_0x6481('0x38')];_0x417572+=0x1){_0x417572>0x0&&(_0x4cc3b7+='\x20'+_0xab0fef[_0x6481('0x66')]+'\x20');_0x4cc3b7+=_0xab0fef[_0x6481('0x65')][_0x417572][_0x6481('0x67')]?_0x440431(_0xab0fef[_0x6481('0x65')][_0x417572][_0x6481('0x67')]):_0xab0fef['rules'][_0x417572]['field']+'\x20'+_0xab0fef[_0x6481('0x65')][_0x417572]['condition']+(_0x249c0b(_0xab0fef[_0x6481('0x65')][_0x417572][_0x6481('0x68')])?'\x20'+_0xab0fef[_0x6481('0x65')][_0x417572][_0x6481('0x69')]:'');}return _0x4cc3b7+')';};var _0x7d731b={'where':{'id':_0x477fd6[_0x6481('0x45')]['id']}},_0x41a675,_0x4f73e0,_0x2e4804,_0x7bfd0e,_0x1bd147;_0x7d731b=_[_0x6481('0x46')]({},_0x7d731b,_0x477fd6[_0x6481('0x3e')]);return db[_0x6481('0x2c')]['find'](_0x7d731b)[_0x6481('0x25')](function(_0x46860f){if(_0x46860f){_0x41a675=_0x46860f;return _0x46860f[_0x6481('0x6a')]();}return null;})[_0x6481('0x25')](function(_0x433cc2){if(_0x433cc2){if(!_0x433cc2[_0x6481('0x38')]){throw new db[(_0x6481('0x6b'))][(_0x6481('0x6c'))](_0x6481('0x6d'),0x193);}_0x4f73e0=_0x433cc2;return db[_0x6481('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x6481('0x25')](function(_0x1576be){if(_0x1576be){_0x2e4804=_[_0x6481('0x6f')](_0x1576be,'id');var _0x24743a;var _0x421310=squel[_0x6481('0x70')]();_0x421310[_0x6481('0x71')](_0x41a675[_0x6481('0x72')]);for(var _0x53396b=0x0;_0x53396b<_0x4f73e0[_0x6481('0x38')];_0x53396b+=0x1){_0x24743a=_0x4f73e0[_0x53396b][_0x6481('0x73')]?_0x2e4804[_0x4f73e0[_0x53396b][_0x6481('0x73')]][_0x6481('0x74')]:_0x4f73e0[_0x53396b][_0x6481('0x75')];_0x24743a=_0x4f73e0[_0x53396b][_0x6481('0x76')]?_[_0x6481('0x77')](_0x3ccd2f[_0x4f73e0[_0x53396b][_0x6481('0x76')]],'%s',_0x24743a):_0x24743a;_0x24743a=_0x4f73e0[_0x53396b][_0x6481('0x78')]?_[_0x6481('0x77')](_0x28718e[_0x4f73e0[_0x53396b][_0x6481('0x78')]],'%s',_0x24743a):_0x24743a;if(_0x4f73e0[_0x53396b][_0x6481('0x79')]){_0x421310[_0x6481('0x67')](_0x24743a);}_0x4f73e0[_0x53396b][_0x6481('0x7a')]&&_0x421310[_0x6481('0x7b')](_0x24743a,_0x4f73e0[_0x53396b][_0x6481('0x7a')]===_0x6481('0x7c')?![]:!![]);_0x421310[_0x6481('0x75')](_0x24743a,_0x4f73e0[_0x53396b][_0x6481('0x7d')]||_0x24743a);}if(_0x41a675[_0x6481('0x7e')]){_0x41a675[_0x6481('0x7e')]=JSON[_0x6481('0x7f')](_0x41a675[_0x6481('0x7e')]);for(var _0x14ae47=0x0;_0x14ae47<_0x41a675[_0x6481('0x7e')][_0x6481('0x38')];_0x14ae47+=0x1){if(_0x41a675[_0x6481('0x7e')][_0x14ae47][_0x6481('0x2e')]&&_[_0x6481('0x61')](_0x601e4c,_0x41a675[_0x6481('0x7e')][_0x14ae47][_0x6481('0x2e')])&&_0x41a675[_0x6481('0x7e')][_0x14ae47][_0x6481('0x80')]&&_0x41a675[_0x6481('0x7e')][_0x14ae47]['foreignTable']&&_0x41a675[_0x6481('0x7e')][_0x14ae47][_0x6481('0x81')]){_0x421310[_0x41a675[_0x6481('0x7e')][_0x14ae47][_0x6481('0x2e')]](_0x41a675['joins'][_0x14ae47][_0x6481('0x82')],null,util['format'](_0x6481('0x83'),_0x41a675[_0x6481('0x72')],_0x41a675['joins'][_0x14ae47]['parentKey'],_0x41a675[_0x6481('0x7e')][_0x14ae47][_0x6481('0x82')],_0x41a675[_0x6481('0x7e')][_0x14ae47][_0x6481('0x81')]));}}}if(_0x41a675[_0x6481('0x84')]){_0x41a675[_0x6481('0x84')]=JSON[_0x6481('0x7f')](_0x41a675[_0x6481('0x84')]);_0x421310[_0x6481('0x3b')](_0x440431(_0x41a675['conditions'][_0x6481('0x67')]));}_0x1bd147=_0x421310[_0x6481('0x85')]();_0x421310[_0x6481('0x1e')](_0x3d92ab);_0x421310[_0x6481('0x1c')](0x0);logger['debug'](_0x6481('0x86'),_0x421310[_0x6481('0x87')]());return dbH[_0x6481('0x88')][_0x6481('0x32')](_0x421310[_0x6481('0x87')](),{'type':dbH[_0x6481('0x88')][_0x6481('0x89')][_0x6481('0x8a')]});}})[_0x6481('0x25')](respondWithResult(_0x3cd906,null))[_0x6481('0x43')](handleError(_0x3cd906,null));};function runReport(_0x99e04a,_0x2d24d8,_0xfe790f){var _0x554dca=_0x2d24d8[_0x6481('0x2a')];var _0x28a69f=0xa;var _0x74b695=[_0x6481('0x54'),_0x6481('0x55'),_0x6481('0x56'),_0x6481('0x57')];var _0x345758={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6481('0x59'),'MIN':_0x6481('0x8b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6481('0x5b'),'GROUP_CONCAT ASC':_0x6481('0x8c'),'GROUP_CONCAT DESC':_0x6481('0x5c')};var _0x4643f9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6481('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x6481('0x5f'),'UNIX_TIMESTAMP':_0x6481('0x60')};var _0x9a2f8c=function(_0xe4a872){return!_['includes']([_0x6481('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x6481('0x8d')],_0xe4a872);};var _0x457d56=function(_0x352c8e){if(!_0x352c8e||!_0x352c8e[_0x6481('0x65')][_0x6481('0x38')]){return'';}for(var _0xde2450='(',_0x45a1d7=0x0;_0x45a1d7<_0x352c8e[_0x6481('0x65')]['length'];_0x45a1d7+=0x1){_0x45a1d7>0x0&&(_0xde2450+='\x20'+_0x352c8e[_0x6481('0x66')]+'\x20');_0xde2450+=_0x352c8e['rules'][_0x45a1d7][_0x6481('0x67')]?_0x457d56(_0x352c8e[_0x6481('0x65')][_0x45a1d7][_0x6481('0x67')]):_0x352c8e[_0x6481('0x65')][_0x45a1d7][_0x6481('0x75')]+'\x20'+_0x352c8e[_0x6481('0x65')][_0x45a1d7][_0x6481('0x68')]+(_0x9a2f8c(_0x352c8e['rules'][_0x45a1d7]['condition'])?'\x20'+_0x352c8e['rules'][_0x45a1d7]['value']:'');}return _0xde2450+')';};var _0x462c90={'where':{'id':_0x99e04a['id']}},_0x47d81d,_0x22e94c,_0x495ad1,_0x220f3d,_0x41d589;_0x462c90=_[_0x6481('0x46')]({},_0x462c90,_0xfe790f);return db['AnalyticCustomReport'][_0x6481('0x47')](_0x462c90)[_0x6481('0x25')](function(_0xbc0dfe){if(_0xbc0dfe){_0x47d81d=_0xbc0dfe;return _0xbc0dfe['getFields']();}return null;})[_0x6481('0x25')](function(_0x1678e7){if(_0x1678e7){if(!_0x1678e7['length']){throw new db['Sequelize'][(_0x6481('0x6c'))](_0x6481('0x6d'),0x193);}_0x22e94c=_0x1678e7;return db[_0x6481('0x6e')][_0x6481('0x41')]({'raw':!![]});}return null;})[_0x6481('0x25')](function(_0x32cb6e){if(_0x32cb6e){_0x495ad1=_['keyBy'](_0x32cb6e,'id');var _0x411047;var _0x2a36f7=squel[_0x6481('0x70')]();_0x2a36f7[_0x6481('0x71')](_0x47d81d['table']);for(var _0x131e9f=0x0;_0x131e9f<_0x22e94c[_0x6481('0x38')];_0x131e9f+=0x1){_0x411047=_0x22e94c[_0x131e9f][_0x6481('0x73')]?_0x495ad1[_0x22e94c[_0x131e9f][_0x6481('0x73')]][_0x6481('0x74')]:_0x22e94c[_0x131e9f]['field'];_0x411047=_0x22e94c[_0x131e9f][_0x6481('0x76')]?_['replace'](_0x345758[_0x22e94c[_0x131e9f][_0x6481('0x76')]],'%s',_0x411047):_0x411047;_0x411047=_0x22e94c[_0x131e9f][_0x6481('0x78')]?_['replace'](_0x4643f9[_0x22e94c[_0x131e9f][_0x6481('0x78')]],'%s',_0x411047):_0x411047;if(_0x22e94c[_0x131e9f]['groupBy']){_0x2a36f7['group'](_0x411047);}_0x22e94c[_0x131e9f][_0x6481('0x7a')]&&_0x2a36f7[_0x6481('0x7b')](_0x411047,_0x22e94c[_0x131e9f][_0x6481('0x7a')]===_0x6481('0x7c')?![]:!![]);_0x2a36f7[_0x6481('0x75')](_0x411047,_0x22e94c[_0x131e9f][_0x6481('0x7d')]||_0x411047);}if(_0x47d81d[_0x6481('0x7e')]){_0x47d81d[_0x6481('0x7e')]=JSON['parse'](_0x47d81d[_0x6481('0x7e')]);for(var _0x2f1620=0x0;_0x2f1620<_0x47d81d['joins'][_0x6481('0x38')];_0x2f1620+=0x1){if(_0x47d81d[_0x6481('0x7e')][_0x2f1620][_0x6481('0x2e')]&&_[_0x6481('0x61')](_0x74b695,_0x47d81d[_0x6481('0x7e')][_0x2f1620][_0x6481('0x2e')])&&_0x47d81d[_0x6481('0x7e')][_0x2f1620][_0x6481('0x80')]&&_0x47d81d[_0x6481('0x7e')][_0x2f1620]['foreignTable']&&_0x47d81d[_0x6481('0x7e')][_0x2f1620][_0x6481('0x81')]){_0x2a36f7[_0x47d81d['joins'][_0x2f1620][_0x6481('0x2e')]](_0x47d81d[_0x6481('0x7e')][_0x2f1620]['foreignTable'],null,util[_0x6481('0x78')](_0x6481('0x83'),_0x47d81d[_0x6481('0x72')],_0x47d81d[_0x6481('0x7e')][_0x2f1620][_0x6481('0x80')],_0x47d81d[_0x6481('0x7e')][_0x2f1620][_0x6481('0x82')],_0x47d81d[_0x6481('0x7e')][_0x2f1620]['foreignKey']));}}}if(_0x47d81d[_0x6481('0x84')]){_0x47d81d[_0x6481('0x84')]=JSON[_0x6481('0x7f')](_0x47d81d[_0x6481('0x84')]);_0x2a36f7['where'](_0x457d56(_0x47d81d[_0x6481('0x84')][_0x6481('0x67')]));}_0x41d589=_0x2a36f7[_0x6481('0x85')]();_0x2a36f7['limit'](_0x28a69f);_0x2a36f7[_0x6481('0x1c')](0x0);return;}})['then'](function(){if(_0x2d24d8['output']===_0x6481('0x8e')){return null;}var _0x3c97a5=_[_0x6481('0x46')](_0x2d24d8,{'name':_0x2d24d8[_0x6481('0x8f')]||_0x2d24d8[_0x6481('0x2a')]||_0x47d81d[_0x6481('0x2a')],'basename':_0x554dca,'savename':util[_0x6481('0x78')]('%s-%s.%s',_0x2d24d8[_0x6481('0x2a')]||_0x47d81d[_0x6481('0x2a')],require(_0x6481('0x90'))['generate'](0x4),_0x2d24d8['output']||_0x6481('0x91')),'reportId':_0x47d81d['id'],'reportType':_0x6481('0x92')});return db[_0x6481('0x93')][_0x6481('0x48')](_0x3c97a5,{'raw':!![]});})[_0x6481('0x25')](function(_0x4070b){if(_0x47d81d[_0x6481('0x72')]===_0x6481('0x94')){_0x41d589[_0x6481('0x3b')](_0x47d81d[_0x6481('0x72')]+_0x6481('0x95'),_0x2d24d8[_0x6481('0x96')],_0x2d24d8[_0x6481('0x97')]);}else{_0x41d589['where'](_0x47d81d['table']+_0x6481('0x98'),_0x2d24d8['startDate'],_0x2d24d8[_0x6481('0x97')]);}if(_0x4070b){logger[_0x6481('0x99')](_0x6481('0x9a'),_0x41d589[_0x6481('0x87')]());require(_0x6481('0x9b'))[_0x6481('0x9c')](path[_0x6481('0x54')](__dirname,_0x6481('0x9d'),_0x4070b[_0x6481('0x9e')]),[_0x4070b['id'],_0x41d589[_0x6481('0x87')](),path[_0x6481('0x54')](__dirname,_0x6481('0x9f'),_0x4070b[_0x6481('0xa0')]),_0x554dca]);return _0x4070b;}else{var _0x188831=squel[_0x6481('0x70')]();_0x188831['from']('('+_0x41d589[_0x6481('0x87')]()+')',_0x6481('0xa1'));_0x188831['field'](_0x6481('0xa2'),_0x6481('0x1d'));_0x41d589[_0x6481('0x1e')](_0x2d24d8[_0x6481('0x1e')]||_0x28a69f);_0x41d589[_0x6481('0x1c')](_0x2d24d8[_0x6481('0x1c')]||0x0);return dbH['sequelize'][_0x6481('0x32')](_0x188831[_0x6481('0x87')](),{'type':dbH['sequelize'][_0x6481('0x89')][_0x6481('0x8a')]})[_0x6481('0x25')](function(_0x790409){if(!_0x790409['length']){_0x220f3d=0x0;}else{_0x220f3d=_0x790409[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x41d589[_0x6481('0x87')](),{'type':dbH[_0x6481('0x88')][_0x6481('0x89')][_0x6481('0x8a')]});})['then'](function(_0xc2481c){return{'rows':_0xc2481c||[],'count':_0x220f3d};});}});}exports['run']=function(_0x5d9ed6,_0xbb3418){return runReport(_0x5d9ed6[_0x6481('0x45')],_0x5d9ed6['query'],_0x5d9ed6[_0x6481('0x3e')])[_0x6481('0x25')](respondWithResult(_0xbb3418,null))['catch'](handleError(_0xbb3418,null));};exports[_0x6481('0xa3')]=runReport;exports[_0x6481('0x32')]=function(_0x3bf7bd,_0x1dc9f6){var _0x33dd95=0xa;var _0xae3398=[_0x6481('0x54'),_0x6481('0x55'),_0x6481('0x56'),_0x6481('0x57')];var _0x208f58={'SUM':'SUM(%s)','COUNT':_0x6481('0xa4'),'COUNT DISTINCT':_0x6481('0x58'),'MAX':'MAX(%s)','MIN':_0x6481('0x8b'),'AVG':_0x6481('0x5a'),'GROUP_CONCAT':_0x6481('0x5b'),'GROUP_CONCAT ASC':_0x6481('0x8c'),'GROUP_CONCAT DESC':_0x6481('0x5c')};var _0x3d457f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x6481('0xa5'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1452a8=function(_0x4cbee2){return!_['includes']([_0x6481('0x62'),_0x6481('0x63'),'IS\x20EMPTY',_0x6481('0x8d')],_0x4cbee2);};var _0xa83b8b=function(_0x4f0b60){if(!_0x4f0b60||!_0x4f0b60[_0x6481('0x65')][_0x6481('0x38')]){return'';}for(var _0x501376='(',_0xdb80e3=0x0;_0xdb80e3<_0x4f0b60[_0x6481('0x65')][_0x6481('0x38')];_0xdb80e3+=0x1){_0xdb80e3>0x0&&(_0x501376+='\x20'+_0x4f0b60[_0x6481('0x66')]+'\x20');_0x501376+=_0x4f0b60['rules'][_0xdb80e3][_0x6481('0x67')]?_0xa83b8b(_0x4f0b60['rules'][_0xdb80e3]['group']):_0x4f0b60[_0x6481('0x65')][_0xdb80e3]['field']+'\x20'+_0x4f0b60[_0x6481('0x65')][_0xdb80e3][_0x6481('0x68')]+(_0x1452a8(_0x4f0b60[_0x6481('0x65')][_0xdb80e3][_0x6481('0x68')])?'\x20'+_0x4f0b60[_0x6481('0x65')][_0xdb80e3]['value']:'');}return _0x501376+')';};var _0x411495={'where':{'id':_0x3bf7bd[_0x6481('0x45')]['id']}},_0x200abb,_0x4ba323,_0x44edc4,_0x48b9d,_0x5e9cb4;_0x411495=_[_0x6481('0x46')]({},_0x411495,_0x3bf7bd[_0x6481('0x3e')]);return db[_0x6481('0x2c')][_0x6481('0x47')](_0x411495)['then'](function(_0x190a66){if(_0x190a66){_0x200abb=_0x190a66;return _0x190a66[_0x6481('0x6a')]();}return null;})[_0x6481('0x25')](function(_0x156774){if(_0x156774){if(!_0x156774[_0x6481('0x38')]){throw new db[(_0x6481('0x6b'))][(_0x6481('0x6c'))](_0x6481('0x6d'),0x193);}_0x4ba323=_0x156774;return db[_0x6481('0x6e')][_0x6481('0x41')]({'raw':!![]});}return null;})[_0x6481('0x25')](function(_0x1af1e4){if(_0x1af1e4){_0x44edc4=_[_0x6481('0x6f')](_0x1af1e4,'id');var _0x564224;var _0x3a17be=squel[_0x6481('0x70')]();_0x3a17be[_0x6481('0x71')](_0x200abb[_0x6481('0x72')]);for(var _0x192b33=0x0;_0x192b33<_0x4ba323[_0x6481('0x38')];_0x192b33+=0x1){_0x564224=_0x4ba323[_0x192b33][_0x6481('0x73')]?_0x44edc4[_0x4ba323[_0x192b33][_0x6481('0x73')]][_0x6481('0x74')]:_0x4ba323[_0x192b33][_0x6481('0x75')];_0x564224=_0x4ba323[_0x192b33]['function']?_[_0x6481('0x77')](_0x208f58[_0x4ba323[_0x192b33][_0x6481('0x76')]],'%s',_0x564224):_0x564224;_0x564224=_0x4ba323[_0x192b33]['format']?_[_0x6481('0x77')](_0x3d457f[_0x4ba323[_0x192b33][_0x6481('0x78')]],'%s',_0x564224):_0x564224;if(_0x4ba323[_0x192b33][_0x6481('0x79')]){_0x3a17be[_0x6481('0x67')](_0x564224);}_0x4ba323[_0x192b33][_0x6481('0x7a')]&&_0x3a17be['order'](_0x564224,_0x4ba323[_0x192b33][_0x6481('0x7a')]==='DESC'?![]:!![]);_0x3a17be[_0x6481('0x75')](_0x564224,_0x4ba323[_0x192b33][_0x6481('0x7d')]||_0x564224);}if(_0x200abb[_0x6481('0x7e')]){_0x200abb[_0x6481('0x7e')]=JSON[_0x6481('0x7f')](_0x200abb[_0x6481('0x7e')]);for(var _0x56800a=0x0;_0x56800a<_0x200abb[_0x6481('0x7e')][_0x6481('0x38')];_0x56800a+=0x1){if(_0x200abb['joins'][_0x56800a][_0x6481('0x2e')]&&_[_0x6481('0x61')](_0xae3398,_0x200abb[_0x6481('0x7e')][_0x56800a][_0x6481('0x2e')])&&_0x200abb[_0x6481('0x7e')][_0x56800a][_0x6481('0x80')]&&_0x200abb['joins'][_0x56800a][_0x6481('0x82')]&&_0x200abb[_0x6481('0x7e')][_0x56800a][_0x6481('0x81')]){_0x3a17be[_0x200abb[_0x6481('0x7e')][_0x56800a][_0x6481('0x2e')]](_0x200abb[_0x6481('0x7e')][_0x56800a][_0x6481('0x82')],null,util[_0x6481('0x78')](_0x6481('0x83'),_0x200abb['table'],_0x200abb[_0x6481('0x7e')][_0x56800a][_0x6481('0x80')],_0x200abb['joins'][_0x56800a][_0x6481('0x82')],_0x200abb[_0x6481('0x7e')][_0x56800a][_0x6481('0x81')]));}}}if(_0x200abb['conditions']){_0x200abb[_0x6481('0x84')]=JSON[_0x6481('0x7f')](_0x200abb['conditions']);_0x3a17be[_0x6481('0x3b')](_0xa83b8b(_0x200abb['conditions'][_0x6481('0x67')]));}_0x5e9cb4=_0x3a17be[_0x6481('0x85')]();_0x3a17be[_0x6481('0x1e')](_0x33dd95);_0x3a17be[_0x6481('0x1c')](0x0);logger[_0x6481('0xa6')]('Limited\x20Query:',_0x3a17be[_0x6481('0x87')]());return dbH[_0x6481('0x88')][_0x6481('0x32')](_0x3a17be['toString'](),{'type':dbH[_0x6481('0x88')][_0x6481('0x89')][_0x6481('0x8a')]});}})['then'](function(){return{'sql':_0x5e9cb4[_0x6481('0x87')]()};})[_0x6481('0x25')](respondWithResult(_0x1dc9f6,null))['catch'](handleError(_0x1dc9f6,null));}; \ No newline at end of file +var _0x85a2=['update','destroy','then','get','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','show','params','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','create','CustomReports','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','function','format','order','orderBy','DESC','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','Limited\x20Query:','toString','sequelize','SUM(%s)','MAX(%s)','HOUR(%s)','select','metric','replace','alias','clone','output','web','fullPath','randomstring','generate','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SELECT','IS\x20NOT\x20NULL','operator','ValidationErrorItem','groupBy','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','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','undefined','count','offset','limit','Content-Range','reject','save'];(function(_0xf3840d,_0x32c7ba){var _0x18d617=function(_0x363714){while(--_0x363714){_0xf3840d['push'](_0xf3840d['shift']());}};_0x18d617(++_0x32c7ba);}(_0x85a2,0x7c));var _0x285a=function(_0x1d991c,_0x38857f){_0x1d991c=_0x1d991c-0x0;var _0x424471=_0x85a2[_0x1d991c];return _0x424471;};'use strict';var emlformat=require(_0x285a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x285a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x285a('0x2'));var moment=require(_0x285a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x285a('0x4'));var util=require(_0x285a('0x5'));var path=require(_0x285a('0x6'));var sox=require(_0x285a('0x7'));var csv=require(_0x285a('0x8'));var ejs=require(_0x285a('0x9'));var fs=require('fs');var fs_extra=require(_0x285a('0xa'));var _=require('lodash');var squel=require(_0x285a('0xb'));var crypto=require(_0x285a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x285a('0xd'));var toCsv=require(_0x285a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x285a('0xe'));var authService=require(_0x285a('0xf'));var qs=require(_0x285a('0x10'));var as=require(_0x285a('0x11'));var hardwareService=require(_0x285a('0x12'));var logger=require(_0x285a('0x13'))(_0x285a('0x14'));var utils=require(_0x285a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x285a('0x16'));var db=require(_0x285a('0x17'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x125b47,_0x2dc8c5){_0x2dc8c5=_0x2dc8c5||0xcc;return function(_0x5ca77d){if(_0x5ca77d){return _0x125b47[_0x285a('0x18')](_0x2dc8c5);}return _0x125b47[_0x285a('0x19')](_0x2dc8c5)[_0x285a('0x1a')]();};}function respondWithResult(_0x259a7e,_0x2cf96f){_0x2cf96f=_0x2cf96f||0xc8;return function(_0x362204){if(_0x362204){return _0x259a7e[_0x285a('0x19')](_0x2cf96f)[_0x285a('0x1b')](_0x362204);}};}function respondWithFilteredResult(_0x28f2bc,_0x1174ee){return function(_0x1e82a8){if(_0x1e82a8){var _0x84743d=typeof _0x1174ee['offset']===_0x285a('0x1c')&&typeof _0x1174ee['limit']===_0x285a('0x1c');var _0x16e80b=_0x1e82a8[_0x285a('0x1d')];var _0x196572=_0x84743d?0x0:_0x1174ee[_0x285a('0x1e')];var _0x2e74b6=_0x84743d?_0x1e82a8[_0x285a('0x1d')]:_0x1174ee[_0x285a('0x1e')]+_0x1174ee[_0x285a('0x1f')];var _0x5c7215;if(_0x2e74b6>=_0x16e80b){_0x2e74b6=_0x16e80b;_0x5c7215=0xc8;}else{_0x5c7215=0xce;}_0x28f2bc[_0x285a('0x19')](_0x5c7215);return _0x28f2bc['set'](_0x285a('0x20'),_0x196572+'-'+_0x2e74b6+'/'+_0x16e80b)['json'](_0x1e82a8);}return null;};}function patchUpdates(_0x5022f0){return function(_0x37e943){try{jsonpatch['apply'](_0x37e943,_0x5022f0,!![]);}catch(_0x2f51c3){return BPromise[_0x285a('0x21')](_0x2f51c3);}return _0x37e943[_0x285a('0x22')]();};}function saveUpdates(_0x319ad8,_0x31b587){return function(_0x2d7be9){if(_0x2d7be9){return _0x2d7be9[_0x285a('0x23')](_0x319ad8)['then'](function(_0x52b596){return _0x52b596;});}return null;};}function removeEntity(_0x49ab9c,_0x2c2fbb){return function(_0x22a3d3){if(_0x22a3d3){return _0x22a3d3[_0x285a('0x24')]()[_0x285a('0x25')](function(){var _0x2b75d1=_0x22a3d3[_0x285a('0x26')]({'plain':!![]});var _0x1fcc60='CustomReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x1fcc60,'resourceId':_0x2b75d1['id']}})[_0x285a('0x25')](function(){return _0x22a3d3;});})[_0x285a('0x25')](function(){_0x49ab9c['status'](0xcc)[_0x285a('0x1a')]();});}};}function handleEntityNotFound(_0x2a6a5a,_0x204f29){return function(_0x102b0b){if(!_0x102b0b){_0x2a6a5a[_0x285a('0x18')](0x194);}return _0x102b0b;};}function handleError(_0x30fdd5,_0x4417e4){_0x4417e4=_0x4417e4||0x1f4;return function(_0x2ac956){logger[_0x285a('0x27')](_0x2ac956[_0x285a('0x28')]);if(_0x2ac956[_0x285a('0x29')]){delete _0x2ac956[_0x285a('0x29')];}_0x30fdd5[_0x285a('0x19')](_0x4417e4)[_0x285a('0x2a')](_0x2ac956);};}exports[_0x285a('0x2b')]=function(_0x4f858e,_0x1075e8){var _0x35ca0e={},_0x452a59={},_0x48dc9f={'count':0x0,'rows':[]};var _0x5c7c05=_[_0x285a('0x2c')](db[_0x285a('0x2d')]['rawAttributes'],function(_0x500958){return{'name':_0x500958[_0x285a('0x2e')],'type':_0x500958[_0x285a('0x2f')][_0x285a('0x30')]};});_0x452a59[_0x285a('0x31')]=_[_0x285a('0x2c')](_0x5c7c05,_0x285a('0x29'));_0x452a59[_0x285a('0x32')]=_[_0x285a('0x33')](_0x4f858e[_0x285a('0x32')]);_0x452a59[_0x285a('0x34')]=_['intersection'](_0x452a59['model'],_0x452a59['query']);_0x35ca0e['attributes']=_[_0x285a('0x35')](_0x452a59['model'],qs['fields'](_0x4f858e[_0x285a('0x32')][_0x285a('0x36')]));_0x35ca0e[_0x285a('0x37')]=_0x35ca0e[_0x285a('0x37')][_0x285a('0x38')]?_0x35ca0e['attributes']:_0x452a59[_0x285a('0x31')];if(!_0x4f858e[_0x285a('0x32')][_0x285a('0x39')](_0x285a('0x3a'))){_0x35ca0e[_0x285a('0x1f')]=qs['limit'](_0x4f858e[_0x285a('0x32')][_0x285a('0x1f')]);_0x35ca0e[_0x285a('0x1e')]=qs['offset'](_0x4f858e[_0x285a('0x32')][_0x285a('0x1e')]);}_0x35ca0e['order']=qs[_0x285a('0x3b')](_0x4f858e[_0x285a('0x32')][_0x285a('0x3b')]);_0x35ca0e[_0x285a('0x3c')]=qs['filters'](_[_0x285a('0x3d')](_0x4f858e[_0x285a('0x32')],_0x452a59[_0x285a('0x34')]),_0x5c7c05);if(_0x4f858e[_0x285a('0x32')]['filter']){_0x35ca0e[_0x285a('0x3c')]=_[_0x285a('0x3e')](_0x35ca0e['where'],{'$or':_[_0x285a('0x2c')](_0x5c7c05,function(_0x377168){if(_0x377168[_0x285a('0x2f')]!=='VIRTUAL'){var _0x5f54c0={};_0x5f54c0[_0x377168[_0x285a('0x29')]]={'$like':'%'+_0x4f858e['query'][_0x285a('0x3f')]+'%'};return _0x5f54c0;}})});}_0x35ca0e=_[_0x285a('0x3e')]({},_0x35ca0e,_0x4f858e[_0x285a('0x40')]);var _0x46dbb3={'where':_0x35ca0e[_0x285a('0x3c')]};return db[_0x285a('0x2d')][_0x285a('0x1d')](_0x46dbb3)[_0x285a('0x25')](function(_0x17e3c9){_0x48dc9f['count']=_0x17e3c9;if(_0x4f858e[_0x285a('0x32')][_0x285a('0x41')]){_0x35ca0e[_0x285a('0x42')]=[{'all':!![]}];}return db[_0x285a('0x2d')][_0x285a('0x43')](_0x35ca0e);})[_0x285a('0x25')](function(_0x825f1f){_0x48dc9f['rows']=_0x825f1f;return _0x48dc9f;})[_0x285a('0x25')](respondWithFilteredResult(_0x1075e8,_0x35ca0e))['catch'](handleError(_0x1075e8,null));};exports[_0x285a('0x44')]=function(_0x393f34,_0x14cad6){var _0x2ec527={'raw':![],'where':{'id':_0x393f34[_0x285a('0x45')]['id']}},_0x181435={};_0x181435['model']=_[_0x285a('0x33')](db[_0x285a('0x2d')]['rawAttributes']);_0x181435[_0x285a('0x32')]=_['keys'](_0x393f34[_0x285a('0x32')]);_0x181435[_0x285a('0x34')]=_['intersection'](_0x181435[_0x285a('0x31')],_0x181435['query']);_0x2ec527['attributes']=_[_0x285a('0x35')](_0x181435['model'],qs[_0x285a('0x36')](_0x393f34['query'][_0x285a('0x36')]));_0x2ec527['attributes']=_0x2ec527['attributes']['length']?_0x2ec527[_0x285a('0x37')]:_0x181435[_0x285a('0x31')];if(_0x393f34['query']['includeAll']){_0x2ec527[_0x285a('0x42')]=[{'all':!![]}];}_0x2ec527=_[_0x285a('0x3e')]({},_0x2ec527,_0x393f34[_0x285a('0x40')]);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x2ec527)[_0x285a('0x25')](handleEntityNotFound(_0x14cad6,null))['then'](respondWithResult(_0x14cad6,null))[_0x285a('0x47')](handleError(_0x14cad6,null));};exports['create']=function(_0x4ffcd7,_0x3a0693){return db[_0x285a('0x2d')]['create'](_0x4ffcd7[_0x285a('0x48')],{})[_0x285a('0x25')](function(_0x11f86b){var _0x2e6143=_0x4ffcd7['user'][_0x285a('0x26')]({'plain':!![]});if(!_0x2e6143)throw new Error(_0x285a('0x49'));if(_0x2e6143['role']==='user'){var _0x3b1af2=_0x11f86b[_0x285a('0x26')]({'plain':!![]});var _0x28247c='Reports';return db[_0x285a('0x4a')][_0x285a('0x46')]({'where':{'name':_0x28247c,'userProfileId':_0x2e6143['userProfileId']},'raw':!![]})[_0x285a('0x25')](function(_0x294f4b){if(_0x294f4b&&_0x294f4b[_0x285a('0x4b')]===0x0){return db[_0x285a('0x4c')][_0x285a('0x4d')]({'name':_0x3b1af2[_0x285a('0x29')],'resourceId':_0x3b1af2['id'],'type':_0x285a('0x4e'),'sectionId':_0x294f4b['id']},{})[_0x285a('0x25')](function(){return _0x11f86b;});}else{return _0x11f86b;}})[_0x285a('0x47')](function(_0x381088){logger[_0x285a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x381088);throw _0x381088;});}return _0x11f86b;})[_0x285a('0x25')](respondWithResult(_0x3a0693,0xc9))[_0x285a('0x47')](handleError(_0x3a0693,null));};exports['update']=function(_0xd52261,_0x5b04be){if(_0xd52261[_0x285a('0x48')]['id']){delete _0xd52261[_0x285a('0x48')]['id'];}return db[_0x285a('0x2d')][_0x285a('0x46')]({'where':{'id':_0xd52261[_0x285a('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b04be,null))['then'](saveUpdates(_0xd52261[_0x285a('0x48')],null))[_0x285a('0x25')](respondWithResult(_0x5b04be,null))[_0x285a('0x47')](handleError(_0x5b04be,null));};exports[_0x285a('0x24')]=function(_0x585df5,_0x338e01){return db[_0x285a('0x2d')][_0x285a('0x46')]({'where':{'id':_0x585df5[_0x285a('0x45')]['id']}})['then'](handleEntityNotFound(_0x338e01,null))[_0x285a('0x25')](removeEntity(_0x338e01,null))[_0x285a('0x47')](handleError(_0x338e01,null));};exports[_0x285a('0x4f')]=function(_0x5bc9d7,_0x27ef76){var _0x548fce=0xa;var _0x8a0779=[_0x285a('0x50'),_0x285a('0x51'),_0x285a('0x52'),_0x285a('0x53')];var _0x470a5c={'SUM':'SUM(%s)','COUNT':_0x285a('0x54'),'COUNT DISTINCT':_0x285a('0x55'),'MAX':'MAX(%s)','MIN':_0x285a('0x56'),'AVG':_0x285a('0x57'),'GROUP_CONCAT':_0x285a('0x58'),'GROUP_CONCAT ASC':_0x285a('0x59'),'GROUP_CONCAT DESC':_0x285a('0x5a')};var _0x256855={'SEC_TO_TIME':_0x285a('0x5b'),'DATE':_0x285a('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x285a('0x5d'),'UNIX_TIMESTAMP':_0x285a('0x5e')};var _0x4ee89f=function(_0x13ce1e){return!_[_0x285a('0x5f')]([_0x285a('0x60'),'IS\x20NOT\x20NULL',_0x285a('0x61'),_0x285a('0x62')],_0x13ce1e);};var _0x15439b=function(_0x4677e9){if(!_0x4677e9||!_0x4677e9['rules'][_0x285a('0x38')]){return'';}for(var _0x2775ec='(',_0x1c0f27=0x0;_0x1c0f27<_0x4677e9[_0x285a('0x63')]['length'];_0x1c0f27+=0x1){_0x1c0f27>0x0&&(_0x2775ec+='\x20'+_0x4677e9['operator']+'\x20');_0x2775ec+=_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x64')]?_0x15439b(_0x4677e9['rules'][_0x1c0f27][_0x285a('0x64')]):_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x65')]+'\x20'+_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x66')]+(_0x4ee89f(_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x66')])?'\x20'+_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x67')]:'');}return _0x2775ec+')';};var _0x9219f8={'where':{'id':_0x5bc9d7[_0x285a('0x45')]['id']}},_0x253b51,_0x416424,_0x12f1e1,_0x25f1dd,_0x137100;_0x9219f8=_['merge']({},_0x9219f8,_0x5bc9d7[_0x285a('0x40')]);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x9219f8)[_0x285a('0x25')](function(_0x5ac6e7){if(_0x5ac6e7){_0x253b51=_0x5ac6e7;return _0x5ac6e7[_0x285a('0x68')]();}return null;})[_0x285a('0x25')](function(_0xcc05d){if(_0xcc05d){if(!_0xcc05d[_0x285a('0x38')]){throw new db[(_0x285a('0x69'))]['ValidationErrorItem'](_0x285a('0x6a'),0x193);}_0x416424=_0xcc05d;return db[_0x285a('0x6b')][_0x285a('0x43')]({'raw':!![]});}return null;})[_0x285a('0x25')](function(_0x498056){if(_0x498056){_0x12f1e1=_[_0x285a('0x6c')](_0x498056,'id');var _0x4f9a0c;var _0x1dc316=squel['select']();_0x1dc316[_0x285a('0x6d')](_0x253b51[_0x285a('0x6e')]);for(var _0x14621e=0x0;_0x14621e<_0x416424['length'];_0x14621e+=0x1){_0x4f9a0c=_0x416424[_0x14621e][_0x285a('0x6f')]?_0x12f1e1[_0x416424[_0x14621e][_0x285a('0x6f')]]['metric']:_0x416424[_0x14621e]['field'];_0x4f9a0c=_0x416424[_0x14621e]['function']?_['replace'](_0x470a5c[_0x416424[_0x14621e][_0x285a('0x70')]],'%s',_0x4f9a0c):_0x4f9a0c;_0x4f9a0c=_0x416424[_0x14621e][_0x285a('0x71')]?_['replace'](_0x256855[_0x416424[_0x14621e][_0x285a('0x71')]],'%s',_0x4f9a0c):_0x4f9a0c;if(_0x416424[_0x14621e]['groupBy']){_0x1dc316[_0x285a('0x64')](_0x4f9a0c);}_0x416424[_0x14621e]['orderBy']&&_0x1dc316[_0x285a('0x72')](_0x4f9a0c,_0x416424[_0x14621e][_0x285a('0x73')]===_0x285a('0x74')?![]:!![]);_0x1dc316[_0x285a('0x65')](_0x4f9a0c,_0x416424[_0x14621e]['alias']||_0x4f9a0c);}if(_0x253b51[_0x285a('0x75')]){_0x253b51[_0x285a('0x75')]=JSON[_0x285a('0x76')](_0x253b51['joins']);for(var _0x58b7f4=0x0;_0x58b7f4<_0x253b51[_0x285a('0x75')]['length'];_0x58b7f4+=0x1){if(_0x253b51[_0x285a('0x75')][_0x58b7f4]['type']&&_[_0x285a('0x5f')](_0x8a0779,_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x2f')])&&_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x77')]&&_0x253b51['joins'][_0x58b7f4]['foreignTable']&&_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x78')]){_0x1dc316[_0x253b51['joins'][_0x58b7f4][_0x285a('0x2f')]](_0x253b51[_0x285a('0x75')][_0x58b7f4]['foreignTable'],null,util[_0x285a('0x71')](_0x285a('0x79'),_0x253b51[_0x285a('0x6e')],_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x77')],_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x7a')],_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x78')]));}}}if(_0x253b51['conditions']){_0x253b51[_0x285a('0x7b')]=JSON[_0x285a('0x76')](_0x253b51['conditions']);_0x1dc316['where'](_0x15439b(_0x253b51[_0x285a('0x7b')][_0x285a('0x64')]));}_0x137100=_0x1dc316['clone']();_0x1dc316[_0x285a('0x1f')](_0x548fce);_0x1dc316[_0x285a('0x1e')](0x0);logger['debug'](_0x285a('0x7c'),_0x1dc316[_0x285a('0x7d')]());return dbH[_0x285a('0x7e')][_0x285a('0x32')](_0x1dc316[_0x285a('0x7d')](),{'type':dbH[_0x285a('0x7e')]['QueryTypes']['SELECT']});}})[_0x285a('0x25')](respondWithResult(_0x27ef76,null))[_0x285a('0x47')](handleError(_0x27ef76,null));};function runReport(_0x1730f4,_0xf20c03,_0x3081ff){var _0x459471=_0xf20c03[_0x285a('0x29')];var _0x3f3b82=0xa;var _0x518078=[_0x285a('0x50'),_0x285a('0x51'),_0x285a('0x52'),'cross_join'];var _0x40cace={'SUM':_0x285a('0x7f'),'COUNT':_0x285a('0x54'),'COUNT DISTINCT':_0x285a('0x55'),'MAX':_0x285a('0x80'),'MIN':_0x285a('0x56'),'AVG':_0x285a('0x57'),'GROUP_CONCAT':_0x285a('0x58'),'GROUP_CONCAT ASC':_0x285a('0x59'),'GROUP_CONCAT DESC':_0x285a('0x5a')};var _0x5770f7={'SEC_TO_TIME':_0x285a('0x5b'),'DATE':_0x285a('0x5c'),'HOUR':_0x285a('0x81'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x285a('0x5e')};var _0x222faf=function(_0x1ad6cb){return!_[_0x285a('0x5f')]([_0x285a('0x60'),'IS\x20NOT\x20NULL',_0x285a('0x61'),_0x285a('0x62')],_0x1ad6cb);};var _0xe24089=function(_0x535f69){if(!_0x535f69||!_0x535f69[_0x285a('0x63')][_0x285a('0x38')]){return'';}for(var _0x60c847='(',_0x3332d5=0x0;_0x3332d5<_0x535f69['rules']['length'];_0x3332d5+=0x1){_0x3332d5>0x0&&(_0x60c847+='\x20'+_0x535f69['operator']+'\x20');_0x60c847+=_0x535f69[_0x285a('0x63')][_0x3332d5][_0x285a('0x64')]?_0xe24089(_0x535f69[_0x285a('0x63')][_0x3332d5]['group']):_0x535f69[_0x285a('0x63')][_0x3332d5][_0x285a('0x65')]+'\x20'+_0x535f69[_0x285a('0x63')][_0x3332d5][_0x285a('0x66')]+(_0x222faf(_0x535f69[_0x285a('0x63')][_0x3332d5]['condition'])?'\x20'+_0x535f69['rules'][_0x3332d5][_0x285a('0x67')]:'');}return _0x60c847+')';};var _0x1347c5={'where':{'id':_0x1730f4['id']}},_0x49ace8,_0x489edb,_0x182790,_0x26987e,_0x3db43c;_0x1347c5=_['merge']({},_0x1347c5,_0x3081ff);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x1347c5)['then'](function(_0x5eff47){if(_0x5eff47){_0x49ace8=_0x5eff47;return _0x5eff47[_0x285a('0x68')]();}return null;})[_0x285a('0x25')](function(_0xeb5070){if(_0xeb5070){if(!_0xeb5070[_0x285a('0x38')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x489edb=_0xeb5070;return db[_0x285a('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x52a617){if(_0x52a617){_0x182790=_[_0x285a('0x6c')](_0x52a617,'id');var _0x24dd84;var _0x5d15f9=squel[_0x285a('0x82')]();_0x5d15f9[_0x285a('0x6d')](_0x49ace8['table']);for(var _0x3913a5=0x0;_0x3913a5<_0x489edb['length'];_0x3913a5+=0x1){_0x24dd84=_0x489edb[_0x3913a5][_0x285a('0x6f')]?_0x182790[_0x489edb[_0x3913a5]['MetricId']][_0x285a('0x83')]:_0x489edb[_0x3913a5][_0x285a('0x65')];_0x24dd84=_0x489edb[_0x3913a5][_0x285a('0x70')]?_['replace'](_0x40cace[_0x489edb[_0x3913a5][_0x285a('0x70')]],'%s',_0x24dd84):_0x24dd84;_0x24dd84=_0x489edb[_0x3913a5]['format']?_[_0x285a('0x84')](_0x5770f7[_0x489edb[_0x3913a5][_0x285a('0x71')]],'%s',_0x24dd84):_0x24dd84;if(_0x489edb[_0x3913a5]['groupBy']){_0x5d15f9[_0x285a('0x64')](_0x24dd84);}_0x489edb[_0x3913a5][_0x285a('0x73')]&&_0x5d15f9['order'](_0x24dd84,_0x489edb[_0x3913a5][_0x285a('0x73')]===_0x285a('0x74')?![]:!![]);_0x5d15f9['field'](_0x24dd84,_0x489edb[_0x3913a5][_0x285a('0x85')]||_0x24dd84);}if(_0x49ace8[_0x285a('0x75')]){_0x49ace8[_0x285a('0x75')]=JSON[_0x285a('0x76')](_0x49ace8[_0x285a('0x75')]);for(var _0x37f1f6=0x0;_0x37f1f6<_0x49ace8[_0x285a('0x75')][_0x285a('0x38')];_0x37f1f6+=0x1){if(_0x49ace8[_0x285a('0x75')][_0x37f1f6]['type']&&_[_0x285a('0x5f')](_0x518078,_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x2f')])&&_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x77')]&&_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x7a')]&&_0x49ace8['joins'][_0x37f1f6]['foreignKey']){_0x5d15f9[_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x2f')]](_0x49ace8['joins'][_0x37f1f6][_0x285a('0x7a')],null,util[_0x285a('0x71')](_0x285a('0x79'),_0x49ace8['table'],_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x77')],_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x7a')],_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x78')]));}}}if(_0x49ace8[_0x285a('0x7b')]){_0x49ace8[_0x285a('0x7b')]=JSON[_0x285a('0x76')](_0x49ace8[_0x285a('0x7b')]);_0x5d15f9[_0x285a('0x3c')](_0xe24089(_0x49ace8[_0x285a('0x7b')]['group']));}_0x3db43c=_0x5d15f9[_0x285a('0x86')]();_0x5d15f9[_0x285a('0x1f')](_0x3f3b82);_0x5d15f9[_0x285a('0x1e')](0x0);return;}})[_0x285a('0x25')](function(){if(_0xf20c03[_0x285a('0x87')]===_0x285a('0x88')){return null;}var _0x31f904=_['merge'](_0xf20c03,{'name':_0xf20c03[_0x285a('0x89')]||_0xf20c03[_0x285a('0x29')]||_0x49ace8[_0x285a('0x29')],'basename':_0x459471,'savename':util[_0x285a('0x71')]('%s-%s.%s',_0xf20c03[_0x285a('0x29')]||_0x49ace8[_0x285a('0x29')],require(_0x285a('0x8a'))[_0x285a('0x8b')](0x4),_0xf20c03[_0x285a('0x87')]||'csv'),'reportId':_0x49ace8['id'],'reportType':'custom'});return db[_0x285a('0x8c')][_0x285a('0x4d')](_0x31f904,{'raw':!![]});})[_0x285a('0x25')](function(_0x30426d){if(_0x49ace8['table']===_0x285a('0x8d')){_0x3db43c[_0x285a('0x3c')](_0x49ace8[_0x285a('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xf20c03[_0x285a('0x8e')],_0xf20c03[_0x285a('0x8f')]);}else{_0x3db43c[_0x285a('0x3c')](_0x49ace8[_0x285a('0x6e')]+_0x285a('0x90'),_0xf20c03['startDate'],_0xf20c03[_0x285a('0x8f')]);}if(_0x30426d){logger[_0x285a('0x91')](_0x285a('0x92'),_0x3db43c[_0x285a('0x7d')]());require('child_process')[_0x285a('0x93')](path[_0x285a('0x50')](__dirname,_0x285a('0x94'),_0x30426d[_0x285a('0x87')]),[_0x30426d['id'],_0x3db43c['toString'](),path[_0x285a('0x50')](__dirname,_0x285a('0x95'),_0x30426d[_0x285a('0x96')]),_0x459471]);return _0x30426d;}else{var _0x54f788=squel[_0x285a('0x82')]();_0x54f788[_0x285a('0x6d')]('('+_0x3db43c[_0x285a('0x7d')]()+')',_0x285a('0x97'));_0x54f788[_0x285a('0x65')](_0x285a('0x98'),_0x285a('0x1d'));_0x3db43c['limit'](_0xf20c03['limit']||_0x3f3b82);_0x3db43c[_0x285a('0x1e')](_0xf20c03[_0x285a('0x1e')]||0x0);return dbH[_0x285a('0x7e')][_0x285a('0x32')](_0x54f788[_0x285a('0x7d')](),{'type':dbH['sequelize'][_0x285a('0x99')]['SELECT']})[_0x285a('0x25')](function(_0x42a165){if(!_0x42a165[_0x285a('0x38')]){_0x26987e=0x0;}else{_0x26987e=_0x42a165[0x0]['count']||0x0;}return dbH[_0x285a('0x7e')]['query'](_0x3db43c[_0x285a('0x7d')](),{'type':dbH['sequelize'][_0x285a('0x99')][_0x285a('0x9a')]});})['then'](function(_0x35d12a){return{'rows':_0x35d12a||[],'count':_0x26987e};});}});}exports['run']=function(_0x9e146e,_0x183438){return runReport(_0x9e146e['params'],_0x9e146e[_0x285a('0x32')],_0x9e146e[_0x285a('0x40')])[_0x285a('0x25')](respondWithResult(_0x183438,null))[_0x285a('0x47')](handleError(_0x183438,null));};exports['runReport']=runReport;exports['query']=function(_0x2cd2f9,_0x49d5ac){var _0x21391d=0xa;var _0x597f62=[_0x285a('0x50'),_0x285a('0x51'),_0x285a('0x52'),_0x285a('0x53')];var _0x26744d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x285a('0x55'),'MAX':_0x285a('0x80'),'MIN':_0x285a('0x56'),'AVG':_0x285a('0x57'),'GROUP_CONCAT':_0x285a('0x58'),'GROUP_CONCAT ASC':_0x285a('0x59'),'GROUP_CONCAT DESC':_0x285a('0x5a')};var _0x4a62d2={'SEC_TO_TIME':_0x285a('0x5b'),'DATE':_0x285a('0x5c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x285a('0x5e')};var _0x3dd2ce=function(_0x1d3888){return!_[_0x285a('0x5f')]([_0x285a('0x60'),_0x285a('0x9b'),_0x285a('0x61'),_0x285a('0x62')],_0x1d3888);};var _0x59f74d=function(_0x40bce5){if(!_0x40bce5||!_0x40bce5[_0x285a('0x63')][_0x285a('0x38')]){return'';}for(var _0x2a92c8='(',_0x5cc7d9=0x0;_0x5cc7d9<_0x40bce5[_0x285a('0x63')]['length'];_0x5cc7d9+=0x1){_0x5cc7d9>0x0&&(_0x2a92c8+='\x20'+_0x40bce5[_0x285a('0x9c')]+'\x20');_0x2a92c8+=_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x64')]?_0x59f74d(_0x40bce5['rules'][_0x5cc7d9][_0x285a('0x64')]):_0x40bce5['rules'][_0x5cc7d9][_0x285a('0x65')]+'\x20'+_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x66')]+(_0x3dd2ce(_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x66')])?'\x20'+_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x67')]:'');}return _0x2a92c8+')';};var _0x26d8ae={'where':{'id':_0x2cd2f9[_0x285a('0x45')]['id']}},_0x2436c4,_0x24114a,_0x387409,_0x32d3a4,_0x2b8a96;_0x26d8ae=_[_0x285a('0x3e')]({},_0x26d8ae,_0x2cd2f9['options']);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x26d8ae)[_0x285a('0x25')](function(_0x48d9fa){if(_0x48d9fa){_0x2436c4=_0x48d9fa;return _0x48d9fa[_0x285a('0x68')]();}return null;})['then'](function(_0x29921f){if(_0x29921f){if(!_0x29921f[_0x285a('0x38')]){throw new db[(_0x285a('0x69'))][(_0x285a('0x9d'))](_0x285a('0x6a'),0x193);}_0x24114a=_0x29921f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x285a('0x25')](function(_0x4b275b){if(_0x4b275b){_0x387409=_[_0x285a('0x6c')](_0x4b275b,'id');var _0x3e32d3;var _0x3028e4=squel[_0x285a('0x82')]();_0x3028e4['from'](_0x2436c4[_0x285a('0x6e')]);for(var _0xec620f=0x0;_0xec620f<_0x24114a['length'];_0xec620f+=0x1){_0x3e32d3=_0x24114a[_0xec620f][_0x285a('0x6f')]?_0x387409[_0x24114a[_0xec620f][_0x285a('0x6f')]]['metric']:_0x24114a[_0xec620f][_0x285a('0x65')];_0x3e32d3=_0x24114a[_0xec620f][_0x285a('0x70')]?_[_0x285a('0x84')](_0x26744d[_0x24114a[_0xec620f][_0x285a('0x70')]],'%s',_0x3e32d3):_0x3e32d3;_0x3e32d3=_0x24114a[_0xec620f][_0x285a('0x71')]?_[_0x285a('0x84')](_0x4a62d2[_0x24114a[_0xec620f][_0x285a('0x71')]],'%s',_0x3e32d3):_0x3e32d3;if(_0x24114a[_0xec620f][_0x285a('0x9e')]){_0x3028e4[_0x285a('0x64')](_0x3e32d3);}_0x24114a[_0xec620f]['orderBy']&&_0x3028e4['order'](_0x3e32d3,_0x24114a[_0xec620f]['orderBy']===_0x285a('0x74')?![]:!![]);_0x3028e4[_0x285a('0x65')](_0x3e32d3,_0x24114a[_0xec620f][_0x285a('0x85')]||_0x3e32d3);}if(_0x2436c4[_0x285a('0x75')]){_0x2436c4[_0x285a('0x75')]=JSON[_0x285a('0x76')](_0x2436c4[_0x285a('0x75')]);for(var _0x256599=0x0;_0x256599<_0x2436c4['joins']['length'];_0x256599+=0x1){if(_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x2f')]&&_[_0x285a('0x5f')](_0x597f62,_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x2f')])&&_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x77')]&&_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x7a')]&&_0x2436c4[_0x285a('0x75')][_0x256599]['foreignKey']){_0x3028e4[_0x2436c4['joins'][_0x256599][_0x285a('0x2f')]](_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x7a')],null,util[_0x285a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2436c4[_0x285a('0x6e')],_0x2436c4[_0x285a('0x75')][_0x256599]['parentKey'],_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x7a')],_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x78')]));}}}if(_0x2436c4[_0x285a('0x7b')]){_0x2436c4[_0x285a('0x7b')]=JSON[_0x285a('0x76')](_0x2436c4[_0x285a('0x7b')]);_0x3028e4[_0x285a('0x3c')](_0x59f74d(_0x2436c4[_0x285a('0x7b')]['group']));}_0x2b8a96=_0x3028e4['clone']();_0x3028e4[_0x285a('0x1f')](_0x21391d);_0x3028e4[_0x285a('0x1e')](0x0);logger['debug'](_0x285a('0x7c'),_0x3028e4[_0x285a('0x7d')]());return dbH['sequelize'][_0x285a('0x32')](_0x3028e4[_0x285a('0x7d')](),{'type':dbH[_0x285a('0x7e')][_0x285a('0x99')][_0x285a('0x9a')]});}})[_0x285a('0x25')](function(){return{'sql':_0x2b8a96[_0x285a('0x7d')]()};})[_0x285a('0x25')](respondWithResult(_0x49d5ac,null))['catch'](handleError(_0x49d5ac,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 154ad16..61c51cd 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 _0x31d0=['exports','AnalyticCustomReport','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x31d0,0x1c5));var _0x031d=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x31d0[_0x52e68e];return _0x3211a4;};'use strict';var _=require(_0x031d('0x0'));var util=require(_0x031d('0x1'));var logger=require(_0x031d('0x2'))('api');var moment=require(_0x031d('0x3'));var BPromise=require('bluebird');var rp=require(_0x031d('0x4'));var fs=require('fs');var path=require(_0x031d('0x5'));var rimraf=require(_0x031d('0x6'));var config=require(_0x031d('0x7'));var attributes=require(_0x031d('0x8'));module[_0x031d('0x9')]=function(_0x3f9c5a,_0xd726e8){return _0x3f9c5a['define'](_0x031d('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9607=['AnalyticCustomReport','analytics_custom_reports','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x274ac0,_0x3fe60b){var _0x2cf969=function(_0x1c8dcc){while(--_0x1c8dcc){_0x274ac0['push'](_0x274ac0['shift']());}};_0x2cf969(++_0x3fe60b);}(_0x9607,0x122));var _0x7960=function(_0x1e8e6e,_0x562d6c){_0x1e8e6e=_0x1e8e6e-0x0;var _0x53bff6=_0x9607[_0x1e8e6e];return _0x53bff6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7960('0x0'));var moment=require(_0x7960('0x1'));var BPromise=require(_0x7960('0x2'));var rp=require(_0x7960('0x3'));var fs=require('fs');var path=require(_0x7960('0x4'));var rimraf=require(_0x7960('0x5'));var config=require(_0x7960('0x6'));var attributes=require(_0x7960('0x7'));module[_0x7960('0x8')]=function(_0x1276cc,_0x100c49){return _0x1276cc[_0x7960('0x9')](_0x7960('0xa'),attributes,{'tableName':_0x7960('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 3434d5d..c3228be 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 _0x1a57=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x1a57,0x193));var _0x71a5=function(_0x10c291,_0x36b963){_0x10c291=_0x10c291-0x0;var _0xad8b79=_0x1a57[_0x10c291];return _0xad8b79;};'use strict';var _=require('lodash');var util=require(_0x71a5('0x0'));var moment=require('moment');var BPromise=require(_0x71a5('0x1'));var rs=require(_0x71a5('0x2'));var fs=require('fs');var Redis=require(_0x71a5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x71a5('0x4'));var logger=require(_0x71a5('0x5'))(_0x71a5('0x6'));var config=require(_0x71a5('0x7'));var jayson=require(_0x71a5('0x8'));var client=jayson['client'][_0x71a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3182ec,_0x4a20b1,_0x2ea1d3){return new BPromise(function(_0x443a8b,_0x29ee56){return client[_0x71a5('0xa')](_0x3182ec,_0x2ea1d3)[_0x71a5('0xb')](function(_0x2eb6a4){logger[_0x71a5('0xc')](_0x71a5('0xd'),_0x4a20b1,_0x71a5('0xe'));logger[_0x71a5('0xf')](_0x71a5('0x10'),_0x4a20b1,_0x71a5('0xe'),JSON['stringify'](_0x2eb6a4));if(_0x2eb6a4['error']){if(_0x2eb6a4[_0x71a5('0x11')][_0x71a5('0x12')]===0x1f4){logger[_0x71a5('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4a20b1,_0x2eb6a4[_0x71a5('0x11')][_0x71a5('0x13')]);return _0x29ee56(_0x2eb6a4[_0x71a5('0x11')][_0x71a5('0x13')]);}logger[_0x71a5('0x11')](_0x71a5('0xd'),_0x4a20b1,_0x2eb6a4[_0x71a5('0x11')]['message']);return _0x443a8b(_0x2eb6a4['error'][_0x71a5('0x13')]);}else{logger[_0x71a5('0xc')](_0x71a5('0xd'),_0x4a20b1,_0x71a5('0xe'));_0x443a8b(_0x2eb6a4[_0x71a5('0x14')][_0x71a5('0x13')]);}})[_0x71a5('0x15')](function(_0x2ed7d4){logger[_0x71a5('0x11')](_0x71a5('0xd'),_0x4a20b1,_0x2ed7d4);_0x29ee56(_0x2ed7d4);});});} \ No newline at end of file +var _0x5181=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5181,0x69));var _0x1518=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x5181[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x1518('0x0'));var util=require(_0x1518('0x1'));var moment=require(_0x1518('0x2'));var BPromise=require(_0x1518('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1518('0x4'))['db'];var utils=require(_0x1518('0x5'));var logger=require(_0x1518('0x6'))('rpc');var config=require(_0x1518('0x7'));var jayson=require(_0x1518('0x8'));var client=jayson[_0x1518('0x9')][_0x1518('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d609f,_0x56fa30,_0x25ad4d){return new BPromise(function(_0xb9f733,_0x4b31a3){return client[_0x1518('0xb')](_0x4d609f,_0x25ad4d)[_0x1518('0xc')](function(_0x3e6559){logger[_0x1518('0xd')](_0x1518('0xe'),_0x56fa30,_0x1518('0xf'));logger[_0x1518('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x56fa30,_0x1518('0xf'),JSON[_0x1518('0x11')](_0x3e6559));if(_0x3e6559['error']){if(_0x3e6559[_0x1518('0x12')][_0x1518('0x13')]===0x1f4){logger[_0x1518('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x56fa30,_0x3e6559[_0x1518('0x12')][_0x1518('0x14')]);return _0x4b31a3(_0x3e6559[_0x1518('0x12')][_0x1518('0x14')]);}logger[_0x1518('0x12')](_0x1518('0xe'),_0x56fa30,_0x3e6559[_0x1518('0x12')][_0x1518('0x14')]);return _0xb9f733(_0x3e6559[_0x1518('0x12')]['message']);}else{logger[_0x1518('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x56fa30,'request\x20sent');_0xb9f733(_0x3e6559[_0x1518('0x15')][_0x1518('0x14')]);}})[_0x1518('0x16')](function(_0x187530){logger[_0x1518('0x12')](_0x1518('0xe'),_0x56fa30,_0x187530);_0x4b31a3(_0x187530);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f28c4bc..7e39eb6 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 _0xc499=['./analyticCustomReport.controller','get','index','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x92a987,_0x4415b6){var _0x331f4c=function(_0x223e9d){while(--_0x223e9d){_0x92a987['push'](_0x92a987['shift']());}};_0x331f4c(++_0x4415b6);}(_0xc499,0xfb));var _0x9c49=function(_0x402845,_0x34addd){_0x402845=_0x402845-0x0;var _0x47fd8f=_0xc499[_0x402845];return _0x47fd8f;};'use strict';var multer=require(_0x9c49('0x0'));var util=require(_0x9c49('0x1'));var path=require(_0x9c49('0x2'));var timeout=require(_0x9c49('0x3'));var express=require(_0x9c49('0x4'));var router=express[_0x9c49('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9c49('0x6'));var interaction=require(_0x9c49('0x7'));var config=require(_0x9c49('0x8'));var controller=require(_0x9c49('0x9'));router[_0x9c49('0xa')]('/',auth['isAuthenticated'](),controller[_0x9c49('0xb')]);router['get']('/:id',auth[_0x9c49('0xc')](),controller[_0x9c49('0xd')]);router[_0x9c49('0xa')](_0x9c49('0xe'),auth[_0x9c49('0xc')](),controller['preview']);router['get'](_0x9c49('0xf'),auth[_0x9c49('0xc')](),controller[_0x9c49('0x10')]);router[_0x9c49('0xa')](_0x9c49('0x11'),auth[_0x9c49('0xc')](),controller[_0x9c49('0x12')]);router[_0x9c49('0x13')]('/',auth['isAuthenticated'](),controller[_0x9c49('0x14')]);router[_0x9c49('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9c49('0x16')]);router[_0x9c49('0x17')]('/:id',auth[_0x9c49('0xc')](),controller[_0x9c49('0x18')]);module[_0x9c49('0x19')]=router; \ No newline at end of file +var _0x6af9=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','query','post','create','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0xe3b618,_0x12f3c6){var _0x580c2c=function(_0x5e2ff7){while(--_0x5e2ff7){_0xe3b618['push'](_0xe3b618['shift']());}};_0x580c2c(++_0x12f3c6);}(_0x6af9,0x1dc));var _0x96af=function(_0x42d324,_0x53b865){_0x42d324=_0x42d324-0x0;var _0x5afd74=_0x6af9[_0x42d324];return _0x5afd74;};'use strict';var multer=require(_0x96af('0x0'));var util=require(_0x96af('0x1'));var path=require(_0x96af('0x2'));var timeout=require(_0x96af('0x3'));var express=require(_0x96af('0x4'));var router=express['Router']();var fs_extra=require(_0x96af('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x96af('0x6'));var config=require(_0x96af('0x7'));var controller=require(_0x96af('0x8'));router[_0x96af('0x9')]('/',auth[_0x96af('0xa')](),controller[_0x96af('0xb')]);router[_0x96af('0x9')](_0x96af('0xc'),auth['isAuthenticated'](),controller[_0x96af('0xd')]);router[_0x96af('0x9')](_0x96af('0xe'),auth[_0x96af('0xa')](),controller['preview']);router['get'](_0x96af('0xf'),auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth[_0x96af('0xa')](),controller[_0x96af('0x10')]);router[_0x96af('0x11')]('/',auth[_0x96af('0xa')](),controller[_0x96af('0x12')]);router[_0x96af('0x13')](_0x96af('0xc'),auth[_0x96af('0xa')](),controller['update']);router[_0x96af('0x14')]('/:id',auth[_0x96af('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 2637aa4..894dad7 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 _0x7fbe=['STRING','TEXT'];(function(_0x53c7a0,_0x41ece0){var _0x150d96=function(_0x1ba987){while(--_0x1ba987){_0x53c7a0['push'](_0x53c7a0['shift']());}};_0x150d96(++_0x41ece0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x7fbe[_0x51beba];return _0x167ee0;};'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 +var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x54058e,_0x3c7806){var _0x2c6ecc=function(_0x435e60){while(--_0x435e60){_0x54058e['push'](_0x54058e['shift']());}};_0x2c6ecc(++_0x3c7806);}(_0xabce,0x103));var _0xeabc=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xabce[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 07da631..e8e1af9 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 _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x44b346,_0xeb097d){_0x44b346=_0x44b346-0x0;var _0x1c2f2b=_0x687b[_0x44b346];return _0x1c2f2b;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file +var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x325be2,_0x4a3e19){var _0x54986c=function(_0x728dc3){while(--_0x728dc3){_0x325be2['push'](_0x325be2['shift']());}};_0x54986c(++_0x4a3e19);}(_0x814b,0x1a2));var _0xb814=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x814b[_0x4d8789];return _0x404e41;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index b4241e9..405ec19 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 _0xee70=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee70,0x15c));var _0x0ee7=function(_0x2b2c77,_0x53ac50){_0x2b2c77=_0x2b2c77-0x0;var _0x817a2a=_0xee70[_0x2b2c77];return _0x817a2a;};'use strict';var _=require(_0x0ee7('0x0'));var util=require(_0x0ee7('0x1'));var logger=require('../../config/logger')(_0x0ee7('0x2'));var moment=require(_0x0ee7('0x3'));var BPromise=require(_0x0ee7('0x4'));var rp=require(_0x0ee7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ee7('0x6'));var config=require(_0x0ee7('0x7'));var attributes=require(_0x0ee7('0x8'));module[_0x0ee7('0x9')]=function(_0x129b67,_0x5a8370){return _0x129b67[_0x0ee7('0xa')](_0x0ee7('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ae7=['rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','path'];(function(_0x1fa2e3,_0x2b920c){var _0x5d1d52=function(_0x545d14){while(--_0x545d14){_0x1fa2e3['push'](_0x1fa2e3['shift']());}};_0x5d1d52(++_0x2b920c);}(_0x4ae7,0xb9));var _0x74ae=function(_0x17e745,_0x48dde5){_0x17e745=_0x17e745-0x0;var _0x232624=_0x4ae7[_0x17e745];return _0x232624;};'use strict';var _=require(_0x74ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x74ae('0x1'));var moment=require(_0x74ae('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x74ae('0x3'));var rimraf=require(_0x74ae('0x4'));var config=require(_0x74ae('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x74ae('0x6')]=function(_0x2e8764,_0x56de93){return _0x2e8764['define'](_0x74ae('0x7'),attributes,{'tableName':_0x74ae('0x8'),'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 8756822..f94c4cf 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 _0xd5f0=['http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0xede1c0,_0xda457f){var _0x1a3ab8=function(_0x984fd8){while(--_0x984fd8){_0xede1c0['push'](_0xede1c0['shift']());}};_0x1a3ab8(++_0xda457f);}(_0xd5f0,0xbb));var _0x0d5f=function(_0x58b6b1,_0xdaf816){_0x58b6b1=_0x58b6b1-0x0;var _0x535c24=_0xd5f0[_0x58b6b1];return _0x535c24;};'use strict';var _=require(_0x0d5f('0x0'));var util=require(_0x0d5f('0x1'));var moment=require(_0x0d5f('0x2'));var BPromise=require(_0x0d5f('0x3'));var rs=require(_0x0d5f('0x4'));var fs=require('fs');var Redis=require(_0x0d5f('0x5'));var db=require(_0x0d5f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d5f('0x7'))(_0x0d5f('0x8'));var config=require('../../config/environment');var jayson=require(_0x0d5f('0x9'));var client=jayson[_0x0d5f('0xa')][_0x0d5f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ddb1a,_0x4f4d2f,_0x231910){return new BPromise(function(_0x42a890,_0x317b6b){return client[_0x0d5f('0xc')](_0x1ddb1a,_0x231910)['then'](function(_0x8167bf){logger[_0x0d5f('0xd')](_0x0d5f('0xe'),_0x4f4d2f,_0x0d5f('0xf'));logger[_0x0d5f('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4f4d2f,_0x0d5f('0xf'),JSON['stringify'](_0x8167bf));if(_0x8167bf[_0x0d5f('0x11')]){if(_0x8167bf['error'][_0x0d5f('0x12')]===0x1f4){logger[_0x0d5f('0x11')](_0x0d5f('0xe'),_0x4f4d2f,_0x8167bf[_0x0d5f('0x11')][_0x0d5f('0x13')]);return _0x317b6b(_0x8167bf[_0x0d5f('0x11')][_0x0d5f('0x13')]);}logger[_0x0d5f('0x11')](_0x0d5f('0xe'),_0x4f4d2f,_0x8167bf[_0x0d5f('0x11')]['message']);return _0x42a890(_0x8167bf[_0x0d5f('0x11')][_0x0d5f('0x13')]);}else{logger[_0x0d5f('0xd')](_0x0d5f('0xe'),_0x4f4d2f,_0x0d5f('0xf'));_0x42a890(_0x8167bf[_0x0d5f('0x14')][_0x0d5f('0x13')]);}})[_0x0d5f('0x15')](function(_0x182bcb){logger[_0x0d5f('0x11')](_0x0d5f('0xe'),_0x4f4d2f,_0x182bcb);_0x317b6b(_0x182bcb);});});} \ No newline at end of file +var _0x05f9=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x26bdfc,_0x461e39){var _0x4a387d=function(_0x3a1313){while(--_0x3a1313){_0x26bdfc['push'](_0x26bdfc['shift']());}};_0x4a387d(++_0x461e39);}(_0x05f9,0x67));var _0x905f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x05f9[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x905f('0x0'));var util=require(_0x905f('0x1'));var moment=require(_0x905f('0x2'));var BPromise=require('bluebird');var rs=require(_0x905f('0x3'));var fs=require('fs');var Redis=require(_0x905f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x905f('0x5'));var jayson=require(_0x905f('0x6'));var client=jayson[_0x905f('0x7')][_0x905f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2558e7,_0x114a8c,_0x1e25ed){return new BPromise(function(_0x16292c,_0x1ec41a){return client[_0x905f('0x9')](_0x2558e7,_0x1e25ed)[_0x905f('0xa')](function(_0x2a3752){logger[_0x905f('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x114a8c,'request\x20sent');logger['debug'](_0x905f('0xc'),_0x114a8c,_0x905f('0xd'),JSON[_0x905f('0xe')](_0x2a3752));if(_0x2a3752[_0x905f('0xf')]){if(_0x2a3752[_0x905f('0xf')]['code']===0x1f4){logger[_0x905f('0xf')](_0x905f('0x10'),_0x114a8c,_0x2a3752[_0x905f('0xf')]['message']);return _0x1ec41a(_0x2a3752[_0x905f('0xf')][_0x905f('0x11')]);}logger[_0x905f('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x114a8c,_0x2a3752[_0x905f('0xf')][_0x905f('0x11')]);return _0x16292c(_0x2a3752[_0x905f('0xf')]['message']);}else{logger['info'](_0x905f('0x10'),_0x114a8c,'request\x20sent');_0x16292c(_0x2a3752[_0x905f('0x12')][_0x905f('0x11')]);}})[_0x905f('0x13')](function(_0x5f4a11){logger[_0x905f('0xf')](_0x905f('0x10'),_0x114a8c,_0x5f4a11);_0x1ec41a(_0x5f4a11);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b40b4db..a8a5eb7 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 _0x662a=['/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0xcf10a,_0x51beb0){var _0x565339=function(_0x1ca892){while(--_0x1ca892){_0xcf10a['push'](_0xcf10a['shift']());}};_0x565339(++_0x51beb0);}(_0x662a,0xae));var _0xa662=function(_0x574b1e,_0x349e4c){_0x574b1e=_0x574b1e-0x0;var _0x51283c=_0x662a[_0x574b1e];return _0x51283c;};'use strict';var multer=require('multer');var util=require(_0xa662('0x0'));var path=require(_0xa662('0x1'));var timeout=require(_0xa662('0x2'));var express=require(_0xa662('0x3'));var router=express['Router']();var fs_extra=require(_0xa662('0x4'));var auth=require(_0xa662('0x5'));var interaction=require(_0xa662('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xa662('0x7')]('/',auth[_0xa662('0x8')](),controller[_0xa662('0x9')]);router[_0xa662('0x7')](_0xa662('0xa'),auth[_0xa662('0x8')](),controller[_0xa662('0xb')]);router[_0xa662('0x7')](_0xa662('0xc'),auth['isAuthenticated'](),controller[_0xa662('0xd')]);router['get'](_0xa662('0xe'),auth[_0xa662('0x8')](),controller[_0xa662('0xf')]);router['get'](_0xa662('0x10'),auth[_0xa662('0x8')](),controller['query']);router[_0xa662('0x11')]('/',auth[_0xa662('0x8')](),controller[_0xa662('0x12')]);router[_0xa662('0x13')](_0xa662('0xa'),auth[_0xa662('0x8')](),controller[_0xa662('0x14')]);router[_0xa662('0x15')]('/:id',auth[_0xa662('0x8')](),controller[_0xa662('0x16')]);module['exports']=router; \ No newline at end of file +var _0xc22b=['../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','preview','/:id/run','query','create','/:id','delete','destroy','exports','path','connect-timeout','Router','fs-extra'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xc22b,0x1c4));var _0xbc22=function(_0x5db69d,_0x1d693c){_0x5db69d=_0x5db69d-0x0;var _0x37edc0=_0xc22b[_0x5db69d];return _0x37edc0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc22('0x0'));var timeout=require(_0xbc22('0x1'));var express=require('express');var router=express[_0xbc22('0x2')]();var fs_extra=require(_0xbc22('0x3'));var auth=require(_0xbc22('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbc22('0x5'));var controller=require(_0xbc22('0x6'));router[_0xbc22('0x7')]('/',auth[_0xbc22('0x8')](),controller[_0xbc22('0x9')]);router[_0xbc22('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbc22('0xa')]);router[_0xbc22('0x7')]('/:id/preview',auth[_0xbc22('0x8')](),controller[_0xbc22('0xb')]);router[_0xbc22('0x7')](_0xbc22('0xc'),auth[_0xbc22('0x8')](),controller['run']);router[_0xbc22('0x7')]('/:id/query',auth['isAuthenticated'](),controller[_0xbc22('0xd')]);router['post']('/',auth[_0xbc22('0x8')](),controller[_0xbc22('0xe')]);router['put'](_0xbc22('0xf'),auth[_0xbc22('0x8')](),controller['update']);router[_0xbc22('0x10')](_0xbc22('0xf'),auth[_0xbc22('0x8')](),controller[_0xbc22('0x11')]);module[_0xbc22('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index d73e4cd..3187138 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 _0xc1ee=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','exports'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xc1ee,0xc0));var _0xec1e=function(_0x3a5fed,_0x5b05f3){_0x3a5fed=_0x3a5fed-0x0;var _0x51d380=_0xc1ee[_0x3a5fed];return _0x51d380;};'use strict';var Sequelize=require(_0xec1e('0x0'));var moment=require(_0xec1e('0x1'));module[_0xec1e('0x2')]={'name':{'type':Sequelize[_0xec1e('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xec1e('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xec1e('0x4')](_0xec1e('0x5'),_0xec1e('0x6'),_0xec1e('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xec1e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xec1e('0x8')]},'status':{'type':Sequelize[_0xec1e('0x3')],'defaultValue':_0xec1e('0x9')},'type':{'type':Sequelize[_0xec1e('0x4')](_0xec1e('0xa'),_0xec1e('0xb')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xec1e('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf981=['DATE','scheduled','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x2c56b1,_0x3da648){var _0x57da21=function(_0x30eb4a){while(--_0x30eb4a){_0x2c56b1['push'](_0x2c56b1['shift']());}};_0x57da21(++_0x3da648);}(_0xf981,0x19d));var _0x1f98=function(_0x370ed5,_0x1162cd){_0x370ed5=_0x370ed5-0x0;var _0x2a8e73=_0xf981[_0x370ed5];return _0x2a8e73;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1f98('0x0'));module[_0x1f98('0x1')]={'name':{'type':Sequelize[_0x1f98('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1f98('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1f98('0x3')](_0x1f98('0x4'),_0x1f98('0x5'),_0x1f98('0x6')),'allowNull':![],'defaultValue':_0x1f98('0x4')},'savename':{'type':Sequelize[_0x1f98('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1f98('0x7')]},'endDate':{'type':Sequelize[_0x1f98('0x7')]},'status':{'type':Sequelize[_0x1f98('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x1f98('0x3')]('manual',_0x1f98('0x8')),'allowNull':![],'defaultValue':_0x1f98('0x9')},'reportId':{'type':Sequelize[_0x1f98('0xa')](0xb)[_0x1f98('0xb')]},'reportType':{'type':Sequelize[_0x1f98('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 1c911ed..a0e6c55 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 _0x5e62=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','download','basename','output','existsSync','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','savename','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','catch','create','body','user'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x5e62,0x196));var _0x25e6=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x5e62[_0x231e16];return _0x570a7c;};'use strict';var emlformat=require(_0x25e6('0x0'));var rimraf=require(_0x25e6('0x1'));var zipdir=require(_0x25e6('0x2'));var jsonpatch=require(_0x25e6('0x3'));var rp=require(_0x25e6('0x4'));var moment=require(_0x25e6('0x5'));var BPromise=require(_0x25e6('0x6'));var Mustache=require(_0x25e6('0x7'));var util=require(_0x25e6('0x8'));var path=require(_0x25e6('0x9'));var sox=require(_0x25e6('0xa'));var csv=require('to-csv');var ejs=require(_0x25e6('0xb'));var fs=require('fs');var fs_extra=require(_0x25e6('0xc'));var _=require(_0x25e6('0xd'));var squel=require(_0x25e6('0xe'));var crypto=require('crypto');var jsforce=require(_0x25e6('0xf'));var deskjs=require(_0x25e6('0x10'));var toCsv=require(_0x25e6('0x11'));var querystring=require(_0x25e6('0x12'));var Papa=require(_0x25e6('0x13'));var Redis=require(_0x25e6('0x14'));var authService=require(_0x25e6('0x15'));var qs=require(_0x25e6('0x16'));var as=require(_0x25e6('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x25e6('0x18'));var utils=require(_0x25e6('0x19'));var config=require(_0x25e6('0x1a'));var licenseUtil=require(_0x25e6('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249a2c,_0x173787){_0x173787=_0x173787||0xcc;return function(_0x18d451){if(_0x18d451){return _0x249a2c[_0x25e6('0x1c')](_0x173787);}return _0x249a2c[_0x25e6('0x1d')](_0x173787)['end']();};}function respondWithResult(_0x528627,_0xdb2a86){_0xdb2a86=_0xdb2a86||0xc8;return function(_0x5580d6){if(_0x5580d6){return _0x528627['status'](_0xdb2a86)['json'](_0x5580d6);}};}function respondWithFilteredResult(_0xab79ee,_0x32a10c){return function(_0x1ed308){if(_0x1ed308){var _0x3c4dc4=typeof _0x32a10c[_0x25e6('0x1e')]===_0x25e6('0x1f')&&typeof _0x32a10c[_0x25e6('0x20')]==='undefined';var _0x50b60d=_0x1ed308['count'];var _0x4d10ba=_0x3c4dc4?0x0:_0x32a10c['offset'];var _0x454db5=_0x3c4dc4?_0x1ed308[_0x25e6('0x21')]:_0x32a10c[_0x25e6('0x1e')]+_0x32a10c['limit'];var _0x23c2cf;if(_0x454db5>=_0x50b60d){_0x454db5=_0x50b60d;_0x23c2cf=0xc8;}else{_0x23c2cf=0xce;}_0xab79ee[_0x25e6('0x1d')](_0x23c2cf);return _0xab79ee[_0x25e6('0x22')](_0x25e6('0x23'),_0x4d10ba+'-'+_0x454db5+'/'+_0x50b60d)[_0x25e6('0x24')](_0x1ed308);}return null;};}function patchUpdates(_0x7deb9a){return function(_0x571858){try{jsonpatch[_0x25e6('0x25')](_0x571858,_0x7deb9a,!![]);}catch(_0x4471e9){return BPromise['reject'](_0x4471e9);}return _0x571858['save']();};}function saveUpdates(_0x3fb077,_0x1b4a4d){return function(_0x588ebd){if(_0x588ebd){return _0x588ebd[_0x25e6('0x26')](_0x3fb077)[_0x25e6('0x27')](function(_0x4d1fbc){return _0x4d1fbc;});}return null;};}function removeEntity(_0xd9ce4b,_0x152917){return function(_0x2eea2c){if(_0x2eea2c){return _0x2eea2c[_0x25e6('0x28')]()[_0x25e6('0x27')](function(){var _0x35c16b=_0x2eea2c[_0x25e6('0x29')]({'plain':!![]});var _0x540aa4=_0x25e6('0x2a');return db[_0x25e6('0x2b')][_0x25e6('0x28')]({'where':{'type':_0x540aa4,'resourceId':_0x35c16b['id']}})[_0x25e6('0x27')](function(){return _0x2eea2c;});})[_0x25e6('0x27')](function(){_0xd9ce4b[_0x25e6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cdb40,_0x3c1c34){return function(_0x5dd5c0){if(!_0x5dd5c0){_0x2cdb40[_0x25e6('0x1c')](0x194);}return _0x5dd5c0;};}function handleError(_0x504f43,_0x3242bd){_0x3242bd=_0x3242bd||0x1f4;return function(_0x212a50){logger[_0x25e6('0x2c')](_0x212a50['stack']);if(_0x212a50[_0x25e6('0x2d')]){delete _0x212a50[_0x25e6('0x2d')];}_0x504f43['status'](_0x3242bd)[_0x25e6('0x2e')](_0x212a50);};}exports[_0x25e6('0x2f')]=function(_0x49b103,_0x29469a){var _0xaebb6e={},_0x416f38={},_0x1e88ea={'count':0x0,'rows':[]};var _0x4721dc=_[_0x25e6('0x30')](db[_0x25e6('0x31')]['rawAttributes'],function(_0x326583){return{'name':_0x326583[_0x25e6('0x32')],'type':_0x326583['type'][_0x25e6('0x33')]};});_0x416f38[_0x25e6('0x34')]=_[_0x25e6('0x30')](_0x4721dc,_0x25e6('0x2d'));_0x416f38[_0x25e6('0x35')]=_[_0x25e6('0x36')](_0x49b103[_0x25e6('0x35')]);_0x416f38[_0x25e6('0x37')]=_['intersection'](_0x416f38['model'],_0x416f38[_0x25e6('0x35')]);_0xaebb6e['attributes']=_[_0x25e6('0x38')](_0x416f38[_0x25e6('0x34')],qs[_0x25e6('0x39')](_0x49b103[_0x25e6('0x35')][_0x25e6('0x39')]));_0xaebb6e[_0x25e6('0x3a')]=_0xaebb6e['attributes'][_0x25e6('0x3b')]?_0xaebb6e[_0x25e6('0x3a')]:_0x416f38[_0x25e6('0x34')];if(!_0x49b103[_0x25e6('0x35')][_0x25e6('0x3c')]('nolimit')){_0xaebb6e[_0x25e6('0x20')]=qs[_0x25e6('0x20')](_0x49b103[_0x25e6('0x35')][_0x25e6('0x20')]);_0xaebb6e[_0x25e6('0x1e')]=qs[_0x25e6('0x1e')](_0x49b103[_0x25e6('0x35')][_0x25e6('0x1e')]);}_0xaebb6e[_0x25e6('0x3d')]=qs[_0x25e6('0x3e')](_0x49b103[_0x25e6('0x35')]['sort']);_0xaebb6e[_0x25e6('0x3f')]=qs[_0x25e6('0x37')](_[_0x25e6('0x40')](_0x49b103[_0x25e6('0x35')],_0x416f38['filters']),_0x4721dc);if(_0x49b103[_0x25e6('0x35')]['filter']){_0xaebb6e[_0x25e6('0x3f')]=_[_0x25e6('0x41')](_0xaebb6e[_0x25e6('0x3f')],{'$or':_[_0x25e6('0x30')](_0x4721dc,function(_0x3aceae){if(_0x3aceae[_0x25e6('0x42')]!==_0x25e6('0x43')){var _0x275247={};_0x275247[_0x3aceae[_0x25e6('0x2d')]]={'$like':'%'+_0x49b103[_0x25e6('0x35')]['filter']+'%'};return _0x275247;}})});}_0xaebb6e=_['merge']({},_0xaebb6e,_0x49b103['options']);var _0x312052={'where':_0xaebb6e['where']};return db[_0x25e6('0x31')][_0x25e6('0x21')](_0x312052)[_0x25e6('0x27')](function(_0x5a70e7){_0x1e88ea[_0x25e6('0x21')]=_0x5a70e7;if(_0x49b103[_0x25e6('0x35')][_0x25e6('0x44')]){_0xaebb6e[_0x25e6('0x45')]=[{'all':!![]}];}return db[_0x25e6('0x31')][_0x25e6('0x46')](_0xaebb6e);})['then'](function(_0x37790e){_0x1e88ea[_0x25e6('0x47')]=_0x37790e;return _0x1e88ea;})[_0x25e6('0x27')](respondWithFilteredResult(_0x29469a,_0xaebb6e))['catch'](handleError(_0x29469a,null));};exports[_0x25e6('0x48')]=function(_0x16b7c8,_0x29e9a2){var _0x3a4523={'raw':!![],'where':{'id':_0x16b7c8['params']['id']}},_0x14b3dc={};_0x14b3dc[_0x25e6('0x34')]=_['keys'](db[_0x25e6('0x31')][_0x25e6('0x49')]);_0x14b3dc[_0x25e6('0x35')]=_['keys'](_0x16b7c8[_0x25e6('0x35')]);_0x14b3dc[_0x25e6('0x37')]=_[_0x25e6('0x38')](_0x14b3dc['model'],_0x14b3dc[_0x25e6('0x35')]);_0x3a4523[_0x25e6('0x3a')]=_['intersection'](_0x14b3dc['model'],qs['fields'](_0x16b7c8[_0x25e6('0x35')]['fields']));_0x3a4523['attributes']=_0x3a4523[_0x25e6('0x3a')][_0x25e6('0x3b')]?_0x3a4523['attributes']:_0x14b3dc[_0x25e6('0x34')];if(_0x16b7c8['query'][_0x25e6('0x44')]){_0x3a4523[_0x25e6('0x45')]=[{'all':!![]}];}_0x3a4523=_[_0x25e6('0x41')]({},_0x3a4523,_0x16b7c8[_0x25e6('0x4a')]);return db[_0x25e6('0x31')]['find'](_0x3a4523)[_0x25e6('0x27')](handleEntityNotFound(_0x29e9a2,null))[_0x25e6('0x27')](respondWithResult(_0x29e9a2,null))[_0x25e6('0x4b')](handleError(_0x29e9a2,null));};exports[_0x25e6('0x4c')]=function(_0x3af71d,_0x327d8b){return db[_0x25e6('0x31')][_0x25e6('0x4c')](_0x3af71d[_0x25e6('0x4d')],{})[_0x25e6('0x27')](function(_0x194369){var _0x132b42=_0x3af71d[_0x25e6('0x4e')][_0x25e6('0x29')]({'plain':!![]});if(!_0x132b42)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x132b42[_0x25e6('0x4f')]===_0x25e6('0x4e')){var _0x5b9efc=_0x194369[_0x25e6('0x29')]({'plain':!![]});var _0x3551ce=_0x25e6('0x2a');return db[_0x25e6('0x50')]['find']({'where':{'name':_0x3551ce,'userProfileId':_0x132b42[_0x25e6('0x51')]},'raw':!![]})['then'](function(_0x1adb92){if(_0x1adb92&&_0x1adb92[_0x25e6('0x52')]===0x0){return db[_0x25e6('0x2b')][_0x25e6('0x4c')]({'name':_0x5b9efc['name'],'resourceId':_0x5b9efc['id'],'type':_0x1adb92['name'],'sectionId':_0x1adb92['id']},{})[_0x25e6('0x27')](function(){return _0x194369;});}else{return _0x194369;}})[_0x25e6('0x4b')](function(_0x502aed){logger['error'](_0x25e6('0x53'),_0x502aed);throw _0x502aed;});}return _0x194369;})['then'](respondWithResult(_0x327d8b,0xc9))[_0x25e6('0x4b')](handleError(_0x327d8b,null));};exports[_0x25e6('0x26')]=function(_0x22984d,_0x3e28b6){if(_0x22984d[_0x25e6('0x4d')]['id']){delete _0x22984d['body']['id'];}return db[_0x25e6('0x31')][_0x25e6('0x54')]({'where':{'id':_0x22984d[_0x25e6('0x55')]['id']}})[_0x25e6('0x27')](handleEntityNotFound(_0x3e28b6,null))[_0x25e6('0x27')](saveUpdates(_0x22984d[_0x25e6('0x4d')],null))[_0x25e6('0x27')](respondWithResult(_0x3e28b6,null))[_0x25e6('0x4b')](handleError(_0x3e28b6,null));};exports[_0x25e6('0x28')]=function(_0x4d21cf,_0x21bd5e){return db[_0x25e6('0x31')][_0x25e6('0x54')]({'where':{'id':_0x4d21cf[_0x25e6('0x55')]['id']}})[_0x25e6('0x27')](handleEntityNotFound(_0x21bd5e,null))[_0x25e6('0x27')](removeEntity(_0x21bd5e,null))[_0x25e6('0x4b')](handleError(_0x21bd5e,null));};exports[_0x25e6('0x56')]=function(_0x15a5a3,_0x532946,_0x42763b){return db[_0x25e6('0x31')][_0x25e6('0x54')]({'where':{'id':_0x15a5a3['params']['id']},'attributes':[_0x25e6('0x2d'),_0x25e6('0x57'),'savename',_0x25e6('0x58')],'raw':!![]})[_0x25e6('0x27')](handleEntityNotFound(_0x532946,null))['then'](function(_0x416efe){if(_0x416efe){if(!fs[_0x25e6('0x59')](path['join'](config[_0x25e6('0x5a')],'server/files/reports',_0x416efe['savename']))){throw new db[(_0x25e6('0x5b'))]['ValidationError'](_0x25e6('0x5c'));}if(_0x15a5a3[_0x25e6('0x35')][_0x25e6('0x5d')]){return _0x532946[_0x25e6('0x1c')](0xc8);}return _0x532946[_0x25e6('0x56')](path['join'](config['root'],_0x25e6('0x5e'),_0x416efe[_0x25e6('0x5f')]),util[_0x25e6('0x60')]('%s.%s',_0x416efe[_0x25e6('0x57')]||_0x416efe['name'],_0x416efe[_0x25e6('0x58')]['toLowerCase']()));}})[_0x25e6('0x4b')](handleError(_0x532946,null));}; \ No newline at end of file +var _0xc258=['jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','ExtractedReports','then','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','keys','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','output','existsSync','root','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','join','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x16a8c9,_0x4742ba){var _0x3b701a=function(_0x309e83){while(--_0x309e83){_0x16a8c9['push'](_0x16a8c9['shift']());}};_0x3b701a(++_0x4742ba);}(_0xc258,0x1e1));var _0x8c25=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc258[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x8c25('0x0'));var rimraf=require(_0x8c25('0x1'));var zipdir=require(_0x8c25('0x2'));var jsonpatch=require(_0x8c25('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8c25('0x4'));var Mustache=require(_0x8c25('0x5'));var util=require(_0x8c25('0x6'));var path=require(_0x8c25('0x7'));var sox=require(_0x8c25('0x8'));var csv=require(_0x8c25('0x9'));var ejs=require(_0x8c25('0xa'));var fs=require('fs');var fs_extra=require(_0x8c25('0xb'));var _=require('lodash');var squel=require(_0x8c25('0xc'));var crypto=require(_0x8c25('0xd'));var jsforce=require(_0x8c25('0xe'));var deskjs=require(_0x8c25('0xf'));var toCsv=require(_0x8c25('0x9'));var querystring=require(_0x8c25('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c25('0x11'));var as=require(_0x8c25('0x12'));var hardwareService=require(_0x8c25('0x13'));var logger=require(_0x8c25('0x14'))(_0x8c25('0x15'));var utils=require('../../config/utils');var config=require(_0x8c25('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c25('0x17'))['db'];function respondWithStatusCode(_0x50bdbd,_0x36061b){_0x36061b=_0x36061b||0xcc;return function(_0x5dcf83){if(_0x5dcf83){return _0x50bdbd[_0x8c25('0x18')](_0x36061b);}return _0x50bdbd[_0x8c25('0x19')](_0x36061b)[_0x8c25('0x1a')]();};}function respondWithResult(_0x86f8ed,_0x2b3a8a){_0x2b3a8a=_0x2b3a8a||0xc8;return function(_0x1d8484){if(_0x1d8484){return _0x86f8ed[_0x8c25('0x19')](_0x2b3a8a)[_0x8c25('0x1b')](_0x1d8484);}};}function respondWithFilteredResult(_0x5a88c9,_0x2149d4){return function(_0x5cba30){if(_0x5cba30){var _0x74b1d3=typeof _0x2149d4[_0x8c25('0x1c')]===_0x8c25('0x1d')&&typeof _0x2149d4[_0x8c25('0x1e')]===_0x8c25('0x1d');var _0x4b29b1=_0x5cba30['count'];var _0x3e3425=_0x74b1d3?0x0:_0x2149d4[_0x8c25('0x1c')];var _0x11c774=_0x74b1d3?_0x5cba30[_0x8c25('0x1f')]:_0x2149d4['offset']+_0x2149d4['limit'];var _0x55cffa;if(_0x11c774>=_0x4b29b1){_0x11c774=_0x4b29b1;_0x55cffa=0xc8;}else{_0x55cffa=0xce;}_0x5a88c9[_0x8c25('0x19')](_0x55cffa);return _0x5a88c9[_0x8c25('0x20')]('Content-Range',_0x3e3425+'-'+_0x11c774+'/'+_0x4b29b1)[_0x8c25('0x1b')](_0x5cba30);}return null;};}function patchUpdates(_0x168a09){return function(_0x1fd0bf){try{jsonpatch[_0x8c25('0x21')](_0x1fd0bf,_0x168a09,!![]);}catch(_0x301374){return BPromise[_0x8c25('0x22')](_0x301374);}return _0x1fd0bf[_0x8c25('0x23')]();};}function saveUpdates(_0x345db7,_0x2ca804){return function(_0x38402a){if(_0x38402a){return _0x38402a['update'](_0x345db7)['then'](function(_0x58c82d){return _0x58c82d;});}return null;};}function removeEntity(_0x24822b,_0x4deb6e){return function(_0x3d823c){if(_0x3d823c){return _0x3d823c[_0x8c25('0x24')]()['then'](function(){var _0x49f411=_0x3d823c['get']({'plain':!![]});var _0x52a1e1=_0x8c25('0x25');return db['UserProfileResource'][_0x8c25('0x24')]({'where':{'type':_0x52a1e1,'resourceId':_0x49f411['id']}})[_0x8c25('0x26')](function(){return _0x3d823c;});})[_0x8c25('0x26')](function(){_0x24822b[_0x8c25('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13692f,_0xfce54b){return function(_0x46021b){if(!_0x46021b){_0x13692f['sendStatus'](0x194);}return _0x46021b;};}function handleError(_0x2448c7,_0x541d6e){_0x541d6e=_0x541d6e||0x1f4;return function(_0x8fa0b3){logger[_0x8c25('0x27')](_0x8fa0b3[_0x8c25('0x28')]);if(_0x8fa0b3[_0x8c25('0x29')]){delete _0x8fa0b3[_0x8c25('0x29')];}_0x2448c7[_0x8c25('0x19')](_0x541d6e)[_0x8c25('0x2a')](_0x8fa0b3);};}exports[_0x8c25('0x2b')]=function(_0x2a08e8,_0x265c14){var _0x210425={},_0x35cfae={},_0x2608d3={'count':0x0,'rows':[]};var _0x1ac2a4=_[_0x8c25('0x2c')](db[_0x8c25('0x2d')][_0x8c25('0x2e')],function(_0x823f6){return{'name':_0x823f6[_0x8c25('0x2f')],'type':_0x823f6[_0x8c25('0x30')][_0x8c25('0x31')]};});_0x35cfae[_0x8c25('0x32')]=_['map'](_0x1ac2a4,'name');_0x35cfae[_0x8c25('0x33')]=_['keys'](_0x2a08e8['query']);_0x35cfae[_0x8c25('0x34')]=_[_0x8c25('0x35')](_0x35cfae['model'],_0x35cfae['query']);_0x210425[_0x8c25('0x36')]=_['intersection'](_0x35cfae[_0x8c25('0x32')],qs['fields'](_0x2a08e8[_0x8c25('0x33')][_0x8c25('0x37')]));_0x210425[_0x8c25('0x36')]=_0x210425[_0x8c25('0x36')]['length']?_0x210425[_0x8c25('0x36')]:_0x35cfae[_0x8c25('0x32')];if(!_0x2a08e8['query'][_0x8c25('0x38')](_0x8c25('0x39'))){_0x210425[_0x8c25('0x1e')]=qs['limit'](_0x2a08e8['query'][_0x8c25('0x1e')]);_0x210425[_0x8c25('0x1c')]=qs[_0x8c25('0x1c')](_0x2a08e8[_0x8c25('0x33')][_0x8c25('0x1c')]);}_0x210425[_0x8c25('0x3a')]=qs['sort'](_0x2a08e8[_0x8c25('0x33')]['sort']);_0x210425['where']=qs[_0x8c25('0x34')](_[_0x8c25('0x3b')](_0x2a08e8[_0x8c25('0x33')],_0x35cfae['filters']),_0x1ac2a4);if(_0x2a08e8[_0x8c25('0x33')]['filter']){_0x210425[_0x8c25('0x3c')]=_['merge'](_0x210425[_0x8c25('0x3c')],{'$or':_[_0x8c25('0x2c')](_0x1ac2a4,function(_0x298e4d){if(_0x298e4d[_0x8c25('0x30')]!==_0x8c25('0x3d')){var _0x30c151={};_0x30c151[_0x298e4d['name']]={'$like':'%'+_0x2a08e8[_0x8c25('0x33')][_0x8c25('0x3e')]+'%'};return _0x30c151;}})});}_0x210425=_[_0x8c25('0x3f')]({},_0x210425,_0x2a08e8[_0x8c25('0x40')]);var _0x4bb869={'where':_0x210425[_0x8c25('0x3c')]};return db[_0x8c25('0x2d')][_0x8c25('0x1f')](_0x4bb869)[_0x8c25('0x26')](function(_0x4e634e){_0x2608d3[_0x8c25('0x1f')]=_0x4e634e;if(_0x2a08e8['query'][_0x8c25('0x41')]){_0x210425['include']=[{'all':!![]}];}return db[_0x8c25('0x2d')][_0x8c25('0x42')](_0x210425);})['then'](function(_0x4ad1d8){_0x2608d3[_0x8c25('0x43')]=_0x4ad1d8;return _0x2608d3;})[_0x8c25('0x26')](respondWithFilteredResult(_0x265c14,_0x210425))['catch'](handleError(_0x265c14,null));};exports[_0x8c25('0x44')]=function(_0x3f055e,_0x3b5eb5){var _0x2d5454={'raw':!![],'where':{'id':_0x3f055e[_0x8c25('0x45')]['id']}},_0x2c4a3f={};_0x2c4a3f[_0x8c25('0x32')]=_['keys'](db['AnalyticExtractedReport'][_0x8c25('0x2e')]);_0x2c4a3f[_0x8c25('0x33')]=_[_0x8c25('0x46')](_0x3f055e[_0x8c25('0x33')]);_0x2c4a3f['filters']=_['intersection'](_0x2c4a3f['model'],_0x2c4a3f[_0x8c25('0x33')]);_0x2d5454[_0x8c25('0x36')]=_[_0x8c25('0x35')](_0x2c4a3f[_0x8c25('0x32')],qs[_0x8c25('0x37')](_0x3f055e[_0x8c25('0x33')][_0x8c25('0x37')]));_0x2d5454['attributes']=_0x2d5454[_0x8c25('0x36')][_0x8c25('0x47')]?_0x2d5454[_0x8c25('0x36')]:_0x2c4a3f[_0x8c25('0x32')];if(_0x3f055e[_0x8c25('0x33')]['includeAll']){_0x2d5454[_0x8c25('0x48')]=[{'all':!![]}];}_0x2d5454=_['merge']({},_0x2d5454,_0x3f055e[_0x8c25('0x40')]);return db[_0x8c25('0x2d')][_0x8c25('0x49')](_0x2d5454)[_0x8c25('0x26')](handleEntityNotFound(_0x3b5eb5,null))['then'](respondWithResult(_0x3b5eb5,null))[_0x8c25('0x4a')](handleError(_0x3b5eb5,null));};exports[_0x8c25('0x4b')]=function(_0x3b72fd,_0x3466ce){return db['AnalyticExtractedReport'][_0x8c25('0x4b')](_0x3b72fd[_0x8c25('0x4c')],{})[_0x8c25('0x26')](function(_0x3b01d0){var _0x28db0e=_0x3b72fd[_0x8c25('0x4d')][_0x8c25('0x4e')]({'plain':!![]});if(!_0x28db0e)throw new Error(_0x8c25('0x4f'));if(_0x28db0e[_0x8c25('0x50')]===_0x8c25('0x4d')){var _0x17f6ed=_0x3b01d0[_0x8c25('0x4e')]({'plain':!![]});var _0xca4c8d=_0x8c25('0x25');return db[_0x8c25('0x51')][_0x8c25('0x49')]({'where':{'name':_0xca4c8d,'userProfileId':_0x28db0e[_0x8c25('0x52')]},'raw':!![]})['then'](function(_0x509333){if(_0x509333&&_0x509333[_0x8c25('0x53')]===0x0){return db[_0x8c25('0x54')][_0x8c25('0x4b')]({'name':_0x17f6ed[_0x8c25('0x29')],'resourceId':_0x17f6ed['id'],'type':_0x509333['name'],'sectionId':_0x509333['id']},{})[_0x8c25('0x26')](function(){return _0x3b01d0;});}else{return _0x3b01d0;}})[_0x8c25('0x4a')](function(_0x50bfe2){logger['error'](_0x8c25('0x55'),_0x50bfe2);throw _0x50bfe2;});}return _0x3b01d0;})[_0x8c25('0x26')](respondWithResult(_0x3466ce,0xc9))[_0x8c25('0x4a')](handleError(_0x3466ce,null));};exports[_0x8c25('0x56')]=function(_0x1cd313,_0x247d87){if(_0x1cd313[_0x8c25('0x4c')]['id']){delete _0x1cd313[_0x8c25('0x4c')]['id'];}return db['AnalyticExtractedReport'][_0x8c25('0x49')]({'where':{'id':_0x1cd313['params']['id']}})[_0x8c25('0x26')](handleEntityNotFound(_0x247d87,null))[_0x8c25('0x26')](saveUpdates(_0x1cd313[_0x8c25('0x4c')],null))[_0x8c25('0x26')](respondWithResult(_0x247d87,null))[_0x8c25('0x4a')](handleError(_0x247d87,null));};exports[_0x8c25('0x24')]=function(_0x529f9b,_0x1df4e5){return db[_0x8c25('0x2d')][_0x8c25('0x49')]({'where':{'id':_0x529f9b[_0x8c25('0x45')]['id']}})['then'](handleEntityNotFound(_0x1df4e5,null))['then'](removeEntity(_0x1df4e5,null))[_0x8c25('0x4a')](handleError(_0x1df4e5,null));};exports[_0x8c25('0x57')]=function(_0xd89a48,_0x443925,_0x17f5cb){return db['AnalyticExtractedReport'][_0x8c25('0x49')]({'where':{'id':_0xd89a48['params']['id']},'attributes':['name',_0x8c25('0x58'),'savename',_0x8c25('0x59')],'raw':!![]})[_0x8c25('0x26')](handleEntityNotFound(_0x443925,null))[_0x8c25('0x26')](function(_0x26d539){if(_0x26d539){if(!fs[_0x8c25('0x5a')](path['join'](config[_0x8c25('0x5b')],'server/files/reports',_0x26d539[_0x8c25('0x5c')]))){throw new db['Sequelize'][(_0x8c25('0x5d'))](_0x8c25('0x5e'));}if(_0xd89a48[_0x8c25('0x33')]['exists']){return _0x443925[_0x8c25('0x18')](0xc8);}return _0x443925[_0x8c25('0x57')](path[_0x8c25('0x5f')](config[_0x8c25('0x5b')],_0x8c25('0x60'),_0x26d539[_0x8c25('0x5c')]),util[_0x8c25('0x61')](_0x8c25('0x62'),_0x26d539[_0x8c25('0x58')]||_0x26d539['name'],_0x26d539['output']['toLowerCase']()));}})['catch'](handleError(_0x443925,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 28dfe62..e836c7d 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 _0xe9a9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe9a9,0x15b));var _0x9e9a=function(_0x3622b0,_0x498b9c){_0x3622b0=_0x3622b0-0x0;var _0x30c01c=_0xe9a9[_0x3622b0];return _0x30c01c;};'use strict';var _=require(_0x9e9a('0x0'));var util=require(_0x9e9a('0x1'));var logger=require(_0x9e9a('0x2'))(_0x9e9a('0x3'));var moment=require(_0x9e9a('0x4'));var BPromise=require(_0x9e9a('0x5'));var rp=require(_0x9e9a('0x6'));var fs=require('fs');var path=require(_0x9e9a('0x7'));var rimraf=require(_0x9e9a('0x8'));var config=require(_0x9e9a('0x9'));var attributes=require('./analyticExtractedReport.attributes');module[_0x9e9a('0xa')]=function(_0x464177,_0x521239){return _0x464177['define'](_0x9e9a('0xb'),attributes,{'tableName':_0x9e9a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28be=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x7b3241,_0x2374ca){var _0x58ddbb=function(_0x48ab12){while(--_0x48ab12){_0x7b3241['push'](_0x7b3241['shift']());}};_0x58ddbb(++_0x2374ca);}(_0x28be,0x7a));var _0xe28b=function(_0x465906,_0x8686c6){_0x465906=_0x465906-0x0;var _0xc3f6ab=_0x28be[_0x465906];return _0xc3f6ab;};'use strict';var _=require(_0xe28b('0x0'));var util=require(_0xe28b('0x1'));var logger=require(_0xe28b('0x2'))('api');var moment=require(_0xe28b('0x3'));var BPromise=require(_0xe28b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe28b('0x5'));var rimraf=require('rimraf');var config=require(_0xe28b('0x6'));var attributes=require(_0xe28b('0x7'));module[_0xe28b('0x8')]=function(_0x90b71d,_0x2ccfdb){return _0x90b71d['define'](_0xe28b('0x9'),attributes,{'tableName':_0xe28b('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 279c9db..6a6bd54 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 _0x8032=['stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x35e94e,_0x5bbc6b){var _0x5e2cd0=function(_0x1bb93d){while(--_0x1bb93d){_0x35e94e['push'](_0x35e94e['shift']());}};_0x5e2cd0(++_0x5bbc6b);}(_0x8032,0xd9));var _0x2803=function(_0x2aba0e,_0x1872be){_0x2aba0e=_0x2aba0e-0x0;var _0x3f277e=_0x8032[_0x2aba0e];return _0x3f277e;};'use strict';var _=require(_0x2803('0x0'));var util=require(_0x2803('0x1'));var moment=require(_0x2803('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2803('0x3'));var db=require(_0x2803('0x4'))['db'];var utils=require(_0x2803('0x5'));var logger=require(_0x2803('0x6'))('rpc');var config=require(_0x2803('0x7'));var jayson=require(_0x2803('0x8'));var client=jayson[_0x2803('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x152b0a,_0x384a39,_0x597a1d){return new BPromise(function(_0x1b7ee5,_0x439d94){return client[_0x2803('0xa')](_0x152b0a,_0x597a1d)['then'](function(_0x5e60ba){logger['info'](_0x2803('0xb'),_0x384a39,'request\x20sent');logger['debug'](_0x2803('0xc'),_0x384a39,_0x2803('0xd'),JSON[_0x2803('0xe')](_0x5e60ba));if(_0x5e60ba[_0x2803('0xf')]){if(_0x5e60ba[_0x2803('0xf')][_0x2803('0x10')]===0x1f4){logger[_0x2803('0xf')](_0x2803('0xb'),_0x384a39,_0x5e60ba['error'][_0x2803('0x11')]);return _0x439d94(_0x5e60ba[_0x2803('0xf')][_0x2803('0x11')]);}logger[_0x2803('0xf')](_0x2803('0xb'),_0x384a39,_0x5e60ba[_0x2803('0xf')][_0x2803('0x11')]);return _0x1b7ee5(_0x5e60ba[_0x2803('0xf')][_0x2803('0x11')]);}else{logger[_0x2803('0x12')](_0x2803('0xb'),_0x384a39,'request\x20sent');_0x1b7ee5(_0x5e60ba[_0x2803('0x13')][_0x2803('0x11')]);}})[_0x2803('0x14')](function(_0x6cb891){logger[_0x2803('0xf')](_0x2803('0xb'),_0x384a39,_0x6cb891);_0x439d94(_0x6cb891);});});} \ No newline at end of file +var _0x6330=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x4a397d,_0x5bab1f){var _0x316571=function(_0xa6d65a){while(--_0xa6d65a){_0x4a397d['push'](_0x4a397d['shift']());}};_0x316571(++_0x5bab1f);}(_0x6330,0xcc));var _0x0633=function(_0x10756d,_0x2f324b){_0x10756d=_0x10756d-0x0;var _0x50f5cb=_0x6330[_0x10756d];return _0x50f5cb;};'use strict';var _=require(_0x0633('0x0'));var util=require(_0x0633('0x1'));var moment=require(_0x0633('0x2'));var BPromise=require(_0x0633('0x3'));var rs=require(_0x0633('0x4'));var fs=require('fs');var Redis=require(_0x0633('0x5'));var db=require(_0x0633('0x6'))['db'];var utils=require(_0x0633('0x7'));var logger=require(_0x0633('0x8'))(_0x0633('0x9'));var config=require(_0x0633('0xa'));var jayson=require(_0x0633('0xb'));var client=jayson[_0x0633('0xc')][_0x0633('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xf3fc02,_0x1a33de,_0xb41d0a){return new BPromise(function(_0x2e6b59,_0x58dae2){return client[_0x0633('0xe')](_0xf3fc02,_0xb41d0a)[_0x0633('0xf')](function(_0x277a43){logger[_0x0633('0x10')](_0x0633('0x11'),_0x1a33de,_0x0633('0x12'));logger[_0x0633('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1a33de,_0x0633('0x12'),JSON['stringify'](_0x277a43));if(_0x277a43['error']){if(_0x277a43[_0x0633('0x14')][_0x0633('0x15')]===0x1f4){logger[_0x0633('0x14')](_0x0633('0x11'),_0x1a33de,_0x277a43[_0x0633('0x14')]['message']);return _0x58dae2(_0x277a43[_0x0633('0x14')]['message']);}logger[_0x0633('0x14')](_0x0633('0x11'),_0x1a33de,_0x277a43[_0x0633('0x14')][_0x0633('0x16')]);return _0x2e6b59(_0x277a43[_0x0633('0x14')][_0x0633('0x16')]);}else{logger[_0x0633('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a33de,_0x0633('0x12'));_0x2e6b59(_0x277a43[_0x0633('0x17')][_0x0633('0x16')]);}})[_0x0633('0x18')](function(_0x4b7918){logger[_0x0633('0x14')](_0x0633('0x11'),_0x1a33de,_0x4b7918);_0x58dae2(_0x4b7918);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2433bc6..4e07944 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 _0x4f6b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','download','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','Router'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4f6b,0x12c));var _0xb4f6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4f6b[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0xb4f6('0x0'));var path=require(_0xb4f6('0x1'));var timeout=require(_0xb4f6('0x2'));var express=require('express');var router=express[_0xb4f6('0x3')]();var fs_extra=require(_0xb4f6('0x4'));var auth=require(_0xb4f6('0x5'));var interaction=require(_0xb4f6('0x6'));var config=require(_0xb4f6('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xb4f6('0x8')]('/',auth[_0xb4f6('0x9')](),controller['index']);router[_0xb4f6('0x8')]('/:id',auth[_0xb4f6('0x9')](),controller[_0xb4f6('0xa')]);router['get']('/:id/download',auth[_0xb4f6('0x9')](),controller[_0xb4f6('0xb')]);router[_0xb4f6('0xc')]('/',auth[_0xb4f6('0x9')](),controller[_0xb4f6('0xd')]);router[_0xb4f6('0xe')](_0xb4f6('0xf'),auth['isAuthenticated'](),controller[_0xb4f6('0x10')]);router[_0xb4f6('0x11')](_0xb4f6('0xf'),auth[_0xb4f6('0x9')](),controller['destroy']);module[_0xb4f6('0x12')]=router; \ No newline at end of file +var _0x0002=['Router','../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','create','put','destroy','exports','multer','path','connect-timeout'];(function(_0x3db78a,_0x164bc){var _0x13c245=function(_0x4294b9){while(--_0x4294b9){_0x3db78a['push'](_0x3db78a['shift']());}};_0x13c245(++_0x164bc);}(_0x0002,0x9d));var _0x2000=function(_0x22ddc2,_0x53c845){_0x22ddc2=_0x22ddc2-0x0;var _0x1ec24f=_0x0002[_0x22ddc2];return _0x1ec24f;};'use strict';var multer=require(_0x2000('0x0'));var util=require('util');var path=require(_0x2000('0x1'));var timeout=require(_0x2000('0x2'));var express=require('express');var router=express[_0x2000('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2000('0x4'));var config=require('../../config/environment');var controller=require(_0x2000('0x5'));router[_0x2000('0x6')]('/',auth['isAuthenticated'](),controller[_0x2000('0x7')]);router[_0x2000('0x6')](_0x2000('0x8'),auth[_0x2000('0x9')](),controller['show']);router['get'](_0x2000('0xa'),auth[_0x2000('0x9')](),controller['download']);router[_0x2000('0xb')]('/',auth[_0x2000('0x9')](),controller[_0x2000('0xc')]);router[_0x2000('0xd')](_0x2000('0x8'),auth[_0x2000('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2000('0xe')]);module[_0x2000('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 28fc08c..d37c322 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 _0xa448=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x5498d0,_0x4a2c4e){var _0x2ba2a3=function(_0x57870c){while(--_0x57870c){_0x5498d0['push'](_0x5498d0['shift']());}};_0x2ba2a3(++_0x4a2c4e);}(_0xa448,0x177));var _0x8a44=function(_0x4e194c,_0x1919a9){_0x4e194c=_0x4e194c-0x0;var _0x630ecd=_0xa448[_0x4e194c];return _0x630ecd;};'use strict';var Sequelize=require(_0x8a44('0x0'));module[_0x8a44('0x1')]={'field':{'type':Sequelize[_0x8a44('0x2')]},'alias':{'type':Sequelize[_0x8a44('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x8a44('0x3')]},'groupBy':{'type':Sequelize[_0x8a44('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc8fd=['STRING','BOOLEAN','sequelize'];(function(_0xa73752,_0x2081d4){var _0x5a9219=function(_0x438349){while(--_0x438349){_0xa73752['push'](_0xa73752['shift']());}};_0x5a9219(++_0x2081d4);}(_0xc8fd,0x65));var _0xdc8f=function(_0x201d46,_0x4f7e66){_0x201d46=_0x201d46-0x0;var _0x2c384d=_0xc8fd[_0x201d46];return _0x2c384d;};'use strict';var Sequelize=require(_0xdc8f('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdc8f('0x1')]},'function':{'type':Sequelize[_0xdc8f('0x1')]},'format':{'type':Sequelize[_0xdc8f('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdc8f('0x1')]},'custom':{'type':Sequelize[_0xdc8f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 9be034d..fcc6a58 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 _0xa178=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','reject','save','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','create','body','bulkCreate','find','params','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring'];(function(_0x387c66,_0x223bb0){var _0xc3cbaf=function(_0xd97f6f){while(--_0xd97f6f){_0x387c66['push'](_0x387c66['shift']());}};_0xc3cbaf(++_0x223bb0);}(_0xa178,0x1d6));var _0x8a17=function(_0x499c7b,_0x4fcea1){_0x499c7b=_0x499c7b-0x0;var _0x7f1953=_0xa178[_0x499c7b];return _0x7f1953;};'use strict';var emlformat=require(_0x8a17('0x0'));var rimraf=require(_0x8a17('0x1'));var zipdir=require(_0x8a17('0x2'));var jsonpatch=require(_0x8a17('0x3'));var rp=require(_0x8a17('0x4'));var moment=require(_0x8a17('0x5'));var BPromise=require(_0x8a17('0x6'));var Mustache=require('mustache');var util=require(_0x8a17('0x7'));var path=require(_0x8a17('0x8'));var sox=require(_0x8a17('0x9'));var csv=require(_0x8a17('0xa'));var ejs=require(_0x8a17('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a17('0xc'));var jsforce=require(_0x8a17('0xd'));var deskjs=require(_0x8a17('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8a17('0xf'));var Papa=require(_0x8a17('0x10'));var Redis=require(_0x8a17('0x11'));var authService=require(_0x8a17('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8a17('0x13'));var hardwareService=require(_0x8a17('0x14'));var logger=require('../../config/logger')(_0x8a17('0x15'));var utils=require(_0x8a17('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a17('0x17'))['db'];function respondWithStatusCode(_0x807334,_0x42370f){_0x42370f=_0x42370f||0xcc;return function(_0x3eb818){if(_0x3eb818){return _0x807334[_0x8a17('0x18')](_0x42370f);}return _0x807334[_0x8a17('0x19')](_0x42370f)['end']();};}function respondWithResult(_0x19a27c,_0x1e89ac){_0x1e89ac=_0x1e89ac||0xc8;return function(_0x1dfa6e){if(_0x1dfa6e){return _0x19a27c['status'](_0x1e89ac)[_0x8a17('0x1a')](_0x1dfa6e);}};}function respondWithFilteredResult(_0x1153b4,_0x9cd714){return function(_0x28f402){if(_0x28f402){var _0x1a1501=typeof _0x9cd714['offset']==='undefined'&&typeof _0x9cd714[_0x8a17('0x1b')]===_0x8a17('0x1c');var _0x417e9c=_0x28f402[_0x8a17('0x1d')];var _0x15d3a1=_0x1a1501?0x0:_0x9cd714[_0x8a17('0x1e')];var _0x10b653=_0x1a1501?_0x28f402[_0x8a17('0x1d')]:_0x9cd714['offset']+_0x9cd714[_0x8a17('0x1b')];var _0x3b403c;if(_0x10b653>=_0x417e9c){_0x10b653=_0x417e9c;_0x3b403c=0xc8;}else{_0x3b403c=0xce;}_0x1153b4[_0x8a17('0x19')](_0x3b403c);return _0x1153b4[_0x8a17('0x1f')]('Content-Range',_0x15d3a1+'-'+_0x10b653+'/'+_0x417e9c)[_0x8a17('0x1a')](_0x28f402);}return null;};}function patchUpdates(_0x1373a2){return function(_0x351329){try{jsonpatch['apply'](_0x351329,_0x1373a2,!![]);}catch(_0x44dbb8){return BPromise[_0x8a17('0x20')](_0x44dbb8);}return _0x351329[_0x8a17('0x21')]();};}function saveUpdates(_0x10a5cb,_0x2593a1){return function(_0x110e7a){if(_0x110e7a){return _0x110e7a[_0x8a17('0x22')](_0x10a5cb)[_0x8a17('0x23')](function(_0x936e06){return _0x936e06;});}return null;};}function removeEntity(_0x301cdb,_0x2a9d00){return function(_0x396fdf){if(_0x396fdf){return _0x396fdf['destroy']()[_0x8a17('0x23')](function(){_0x301cdb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2f2ab,_0x2cd2e0){return function(_0x4e19cb){if(!_0x4e19cb){_0xb2f2ab[_0x8a17('0x18')](0x194);}return _0x4e19cb;};}function handleError(_0x27fbaf,_0x26589e){_0x26589e=_0x26589e||0x1f4;return function(_0x5d064e){logger[_0x8a17('0x24')](_0x5d064e[_0x8a17('0x25')]);if(_0x5d064e[_0x8a17('0x26')]){delete _0x5d064e[_0x8a17('0x26')];}_0x27fbaf[_0x8a17('0x19')](_0x26589e)[_0x8a17('0x27')](_0x5d064e);};}exports[_0x8a17('0x28')]=function(_0x252717,_0x153869){var _0x109382={},_0x4235e2={},_0x4a81d1={'count':0x0,'rows':[]};var _0x43869b=_[_0x8a17('0x29')](db[_0x8a17('0x2a')][_0x8a17('0x2b')],function(_0xe6fb69){return{'name':_0xe6fb69[_0x8a17('0x2c')],'type':_0xe6fb69[_0x8a17('0x2d')][_0x8a17('0x2e')]};});_0x4235e2['model']=_[_0x8a17('0x29')](_0x43869b,'name');_0x4235e2[_0x8a17('0x2f')]=_['keys'](_0x252717['query']);_0x4235e2[_0x8a17('0x30')]=_[_0x8a17('0x31')](_0x4235e2[_0x8a17('0x32')],_0x4235e2[_0x8a17('0x2f')]);_0x109382['attributes']=_[_0x8a17('0x31')](_0x4235e2['model'],qs[_0x8a17('0x33')](_0x252717[_0x8a17('0x2f')][_0x8a17('0x33')]));_0x109382[_0x8a17('0x34')]=_0x109382[_0x8a17('0x34')][_0x8a17('0x35')]?_0x109382[_0x8a17('0x34')]:_0x4235e2[_0x8a17('0x32')];if(!_0x252717[_0x8a17('0x2f')][_0x8a17('0x36')](_0x8a17('0x37'))){_0x109382['limit']=qs[_0x8a17('0x1b')](_0x252717[_0x8a17('0x2f')][_0x8a17('0x1b')]);_0x109382[_0x8a17('0x1e')]=qs[_0x8a17('0x1e')](_0x252717[_0x8a17('0x2f')][_0x8a17('0x1e')]);}_0x109382[_0x8a17('0x38')]=qs[_0x8a17('0x39')](_0x252717[_0x8a17('0x2f')][_0x8a17('0x39')]);_0x109382['where']=qs[_0x8a17('0x30')](_[_0x8a17('0x3a')](_0x252717[_0x8a17('0x2f')],_0x4235e2[_0x8a17('0x30')]),_0x43869b);if(_0x252717[_0x8a17('0x2f')][_0x8a17('0x3b')]){_0x109382['where']=_[_0x8a17('0x3c')](_0x109382[_0x8a17('0x3d')],{'$or':_[_0x8a17('0x29')](_0x43869b,function(_0x156a5b){if(_0x156a5b[_0x8a17('0x2d')]!==_0x8a17('0x3e')){var _0x4e92fa={};_0x4e92fa[_0x156a5b[_0x8a17('0x26')]]={'$like':'%'+_0x252717['query'][_0x8a17('0x3b')]+'%'};return _0x4e92fa;}})});}_0x109382=_[_0x8a17('0x3c')]({},_0x109382,_0x252717[_0x8a17('0x3f')]);var _0x153e88={'where':_0x109382['where']};return db[_0x8a17('0x2a')][_0x8a17('0x1d')](_0x153e88)['then'](function(_0x4ea49f){_0x4a81d1['count']=_0x4ea49f;if(_0x252717['query'][_0x8a17('0x40')]){_0x109382[_0x8a17('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x8a17('0x42')](_0x109382);})[_0x8a17('0x23')](function(_0x18818a){_0x4a81d1[_0x8a17('0x43')]=_0x18818a;return _0x4a81d1;})[_0x8a17('0x23')](respondWithFilteredResult(_0x153869,_0x109382))[_0x8a17('0x44')](handleError(_0x153869,null));};exports['show']=function(_0x77957,_0x268df3){var _0x146f51={'raw':![],'where':{'id':_0x77957['params']['id']}},_0x26685a={};_0x26685a['model']=_[_0x8a17('0x45')](db[_0x8a17('0x2a')]['rawAttributes']);_0x26685a[_0x8a17('0x2f')]=_[_0x8a17('0x45')](_0x77957[_0x8a17('0x2f')]);_0x26685a[_0x8a17('0x30')]=_[_0x8a17('0x31')](_0x26685a['model'],_0x26685a['query']);_0x146f51[_0x8a17('0x34')]=_[_0x8a17('0x31')](_0x26685a[_0x8a17('0x32')],qs[_0x8a17('0x33')](_0x77957[_0x8a17('0x2f')][_0x8a17('0x33')]));_0x146f51[_0x8a17('0x34')]=_0x146f51[_0x8a17('0x34')][_0x8a17('0x35')]?_0x146f51[_0x8a17('0x34')]:_0x26685a['model'];if(_0x77957[_0x8a17('0x2f')][_0x8a17('0x40')]){_0x146f51[_0x8a17('0x41')]=[{'all':!![]}];}_0x146f51=_[_0x8a17('0x3c')]({},_0x146f51,_0x77957[_0x8a17('0x3f')]);return db[_0x8a17('0x2a')]['find'](_0x146f51)[_0x8a17('0x23')](handleEntityNotFound(_0x268df3,null))['then'](respondWithResult(_0x268df3,null))['catch'](handleError(_0x268df3,null));};exports[_0x8a17('0x46')]=function(_0x2c3155,_0x5d96e5){return db[_0x8a17('0x2a')][_0x8a17('0x46')](_0x2c3155[_0x8a17('0x47')],{})['then'](respondWithResult(_0x5d96e5,0xc9))['catch'](handleError(_0x5d96e5,null));};exports[_0x8a17('0x48')]=function(_0x1e0723,_0x4a6627){return db['AnalyticFieldReport']['bulkCreate'](_0x1e0723[_0x8a17('0x47')],{'raw':![],'individualHooks':!![]})[_0x8a17('0x23')](respondWithResult(_0x4a6627,0xc9))['catch'](handleError(_0x4a6627,null));};exports[_0x8a17('0x22')]=function(_0x161a79,_0x1e2ce8){if(_0x161a79[_0x8a17('0x47')]['id']){delete _0x161a79[_0x8a17('0x47')]['id'];}return db[_0x8a17('0x2a')][_0x8a17('0x49')]({'where':{'id':_0x161a79[_0x8a17('0x4a')]['id']}})[_0x8a17('0x23')](handleEntityNotFound(_0x1e2ce8,null))[_0x8a17('0x23')](saveUpdates(_0x161a79[_0x8a17('0x47')],null))[_0x8a17('0x23')](respondWithResult(_0x1e2ce8,null))['catch'](handleError(_0x1e2ce8,null));};exports[_0x8a17('0x4b')]=function(_0x24650e,_0x38809){return db[_0x8a17('0x2a')][_0x8a17('0x49')]({'where':{'id':_0x24650e[_0x8a17('0x4a')]['id']}})[_0x8a17('0x23')](handleEntityNotFound(_0x38809,null))['then'](removeEntity(_0x38809,null))[_0x8a17('0x44')](handleError(_0x38809,null));};exports[_0x8a17('0x4c')]=function(_0x509ec6,_0x43e46e){return db[_0x8a17('0x2a')]['destroy']({'where':{'id':_0x509ec6[_0x8a17('0x2f')][_0x8a17('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x8a17('0x23')](respondWithResult(_0x43e46e,0xcc))[_0x8a17('0x44')](handleError(_0x43e46e,null));};exports[_0x8a17('0x4e')]=function(_0x39f043,_0xcfc392,_0x312382){return db[_0x8a17('0x4f')]['findOne']({'where':{'id':_0x39f043[_0x8a17('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcfc392,null))[_0x8a17('0x23')](function(_0xc5bcb9){if(_0xc5bcb9){return db[_0x8a17('0x50')]['transaction'](function(_0x5db57c){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x39f043[_0x8a17('0x4a')]['id']},'transaction':_0x5db57c})[_0x8a17('0x23')](function(_0x23eaee){var _0x12d11d=_[_0x8a17('0x29')](_0x39f043[_0x8a17('0x47')],function(_0x352b12){delete _0x352b12['id'];_0x352b12['CustomReportId']=_0x39f043['params']['id'];return _0x352b12;});return db[_0x8a17('0x2a')]['bulkCreate'](_0x12d11d,{'transaction':_0x5db57c});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x39f043[_0x8a17('0x4a')]['id']}});});}})[_0x8a17('0x23')](respondWithResult(_0xcfc392,null))[_0x8a17('0x44')](handleError(_0xcfc392,null));}; \ No newline at end of file +var _0x87fa=['fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','transaction','rimraf','zip-dir'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x87fa,0xf4));var _0xa87f=function(_0x1f3f8e,_0x4e8ff4){_0x1f3f8e=_0x1f3f8e-0x0;var _0x6f696a=_0x87fa[_0x1f3f8e];return _0x6f696a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa87f('0x0'));var zipdir=require(_0xa87f('0x1'));var jsonpatch=require(_0xa87f('0x2'));var rp=require('request-promise');var moment=require(_0xa87f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa87f('0x4'));var util=require(_0xa87f('0x5'));var path=require(_0xa87f('0x6'));var sox=require(_0xa87f('0x7'));var csv=require(_0xa87f('0x8'));var ejs=require(_0xa87f('0x9'));var fs=require('fs');var fs_extra=require(_0xa87f('0xa'));var _=require(_0xa87f('0xb'));var squel=require(_0xa87f('0xc'));var crypto=require(_0xa87f('0xd'));var jsforce=require(_0xa87f('0xe'));var deskjs=require(_0xa87f('0xf'));var toCsv=require(_0xa87f('0x8'));var querystring=require('querystring');var Papa=require(_0xa87f('0x10'));var Redis=require('ioredis');var authService=require(_0xa87f('0x11'));var qs=require(_0xa87f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa87f('0x13'));var logger=require('../../config/logger')(_0xa87f('0x14'));var utils=require(_0xa87f('0x15'));var config=require(_0xa87f('0x16'));var licenseUtil=require(_0xa87f('0x17'));var db=require(_0xa87f('0x18'))['db'];function respondWithStatusCode(_0x27bbb9,_0x271554){_0x271554=_0x271554||0xcc;return function(_0x390d55){if(_0x390d55){return _0x27bbb9[_0xa87f('0x19')](_0x271554);}return _0x27bbb9[_0xa87f('0x1a')](_0x271554)[_0xa87f('0x1b')]();};}function respondWithResult(_0x57bb3b,_0x15a868){_0x15a868=_0x15a868||0xc8;return function(_0x46438e){if(_0x46438e){return _0x57bb3b[_0xa87f('0x1a')](_0x15a868)['json'](_0x46438e);}};}function respondWithFilteredResult(_0x4d537e,_0x521071){return function(_0x4d9fae){if(_0x4d9fae){var _0x2f686c=typeof _0x521071[_0xa87f('0x1c')]==='undefined'&&typeof _0x521071[_0xa87f('0x1d')]===_0xa87f('0x1e');var _0x158fad=_0x4d9fae[_0xa87f('0x1f')];var _0x2724c0=_0x2f686c?0x0:_0x521071[_0xa87f('0x1c')];var _0x268636=_0x2f686c?_0x4d9fae[_0xa87f('0x1f')]:_0x521071[_0xa87f('0x1c')]+_0x521071['limit'];var _0x33dc81;if(_0x268636>=_0x158fad){_0x268636=_0x158fad;_0x33dc81=0xc8;}else{_0x33dc81=0xce;}_0x4d537e['status'](_0x33dc81);return _0x4d537e[_0xa87f('0x20')](_0xa87f('0x21'),_0x2724c0+'-'+_0x268636+'/'+_0x158fad)[_0xa87f('0x22')](_0x4d9fae);}return null;};}function patchUpdates(_0x458d48){return function(_0x6484fd){try{jsonpatch[_0xa87f('0x23')](_0x6484fd,_0x458d48,!![]);}catch(_0x4300bf){return BPromise['reject'](_0x4300bf);}return _0x6484fd['save']();};}function saveUpdates(_0x108c93,_0xffd5bc){return function(_0x2caa87){if(_0x2caa87){return _0x2caa87[_0xa87f('0x24')](_0x108c93)[_0xa87f('0x25')](function(_0x5ca629){return _0x5ca629;});}return null;};}function removeEntity(_0x1eca22,_0x5bcc50){return function(_0xd454d5){if(_0xd454d5){return _0xd454d5[_0xa87f('0x26')]()[_0xa87f('0x25')](function(){_0x1eca22[_0xa87f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc79580,_0x209f10){return function(_0x20d851){if(!_0x20d851){_0xc79580[_0xa87f('0x19')](0x194);}return _0x20d851;};}function handleError(_0x337c5b,_0x3e314f){_0x3e314f=_0x3e314f||0x1f4;return function(_0x5b6b67){logger[_0xa87f('0x27')](_0x5b6b67[_0xa87f('0x28')]);if(_0x5b6b67[_0xa87f('0x29')]){delete _0x5b6b67[_0xa87f('0x29')];}_0x337c5b['status'](_0x3e314f)[_0xa87f('0x2a')](_0x5b6b67);};}exports['index']=function(_0x575695,_0x2f130c){var _0x2d728b={},_0x24d387={},_0x3a5757={'count':0x0,'rows':[]};var _0x31b073=_['map'](db[_0xa87f('0x2b')][_0xa87f('0x2c')],function(_0x3602fa){return{'name':_0x3602fa[_0xa87f('0x2d')],'type':_0x3602fa[_0xa87f('0x2e')][_0xa87f('0x2f')]};});_0x24d387[_0xa87f('0x30')]=_[_0xa87f('0x31')](_0x31b073,'name');_0x24d387[_0xa87f('0x32')]=_[_0xa87f('0x33')](_0x575695[_0xa87f('0x32')]);_0x24d387[_0xa87f('0x34')]=_[_0xa87f('0x35')](_0x24d387['model'],_0x24d387[_0xa87f('0x32')]);_0x2d728b[_0xa87f('0x36')]=_['intersection'](_0x24d387[_0xa87f('0x30')],qs['fields'](_0x575695[_0xa87f('0x32')][_0xa87f('0x37')]));_0x2d728b[_0xa87f('0x36')]=_0x2d728b['attributes'][_0xa87f('0x38')]?_0x2d728b['attributes']:_0x24d387['model'];if(!_0x575695[_0xa87f('0x32')][_0xa87f('0x39')](_0xa87f('0x3a'))){_0x2d728b['limit']=qs[_0xa87f('0x1d')](_0x575695[_0xa87f('0x32')]['limit']);_0x2d728b[_0xa87f('0x1c')]=qs[_0xa87f('0x1c')](_0x575695[_0xa87f('0x32')]['offset']);}_0x2d728b['order']=qs[_0xa87f('0x3b')](_0x575695['query'][_0xa87f('0x3b')]);_0x2d728b[_0xa87f('0x3c')]=qs['filters'](_[_0xa87f('0x3d')](_0x575695['query'],_0x24d387['filters']),_0x31b073);if(_0x575695[_0xa87f('0x32')][_0xa87f('0x3e')]){_0x2d728b[_0xa87f('0x3c')]=_[_0xa87f('0x3f')](_0x2d728b[_0xa87f('0x3c')],{'$or':_['map'](_0x31b073,function(_0x26d15d){if(_0x26d15d[_0xa87f('0x2e')]!==_0xa87f('0x40')){var _0x4c65a5={};_0x4c65a5[_0x26d15d[_0xa87f('0x29')]]={'$like':'%'+_0x575695[_0xa87f('0x32')][_0xa87f('0x3e')]+'%'};return _0x4c65a5;}})});}_0x2d728b=_['merge']({},_0x2d728b,_0x575695['options']);var _0x4adb9a={'where':_0x2d728b['where']};return db[_0xa87f('0x2b')][_0xa87f('0x1f')](_0x4adb9a)[_0xa87f('0x25')](function(_0x8912d7){_0x3a5757[_0xa87f('0x1f')]=_0x8912d7;if(_0x575695[_0xa87f('0x32')][_0xa87f('0x41')]){_0x2d728b['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa87f('0x42')](_0x2d728b);})['then'](function(_0x34cb1a){_0x3a5757[_0xa87f('0x43')]=_0x34cb1a;return _0x3a5757;})['then'](respondWithFilteredResult(_0x2f130c,_0x2d728b))[_0xa87f('0x44')](handleError(_0x2f130c,null));};exports[_0xa87f('0x45')]=function(_0x1c22fd,_0x807743){var _0x498ef2={'raw':![],'where':{'id':_0x1c22fd[_0xa87f('0x46')]['id']}},_0x17c17d={};_0x17c17d[_0xa87f('0x30')]=_[_0xa87f('0x33')](db[_0xa87f('0x2b')][_0xa87f('0x2c')]);_0x17c17d['query']=_[_0xa87f('0x33')](_0x1c22fd['query']);_0x17c17d['filters']=_[_0xa87f('0x35')](_0x17c17d[_0xa87f('0x30')],_0x17c17d[_0xa87f('0x32')]);_0x498ef2[_0xa87f('0x36')]=_[_0xa87f('0x35')](_0x17c17d['model'],qs[_0xa87f('0x37')](_0x1c22fd[_0xa87f('0x32')][_0xa87f('0x37')]));_0x498ef2[_0xa87f('0x36')]=_0x498ef2[_0xa87f('0x36')]['length']?_0x498ef2[_0xa87f('0x36')]:_0x17c17d[_0xa87f('0x30')];if(_0x1c22fd[_0xa87f('0x32')][_0xa87f('0x41')]){_0x498ef2[_0xa87f('0x47')]=[{'all':!![]}];}_0x498ef2=_[_0xa87f('0x3f')]({},_0x498ef2,_0x1c22fd[_0xa87f('0x48')]);return db[_0xa87f('0x2b')][_0xa87f('0x49')](_0x498ef2)['then'](handleEntityNotFound(_0x807743,null))[_0xa87f('0x25')](respondWithResult(_0x807743,null))[_0xa87f('0x44')](handleError(_0x807743,null));};exports[_0xa87f('0x4a')]=function(_0x5d6638,_0x1eca3a){return db[_0xa87f('0x2b')][_0xa87f('0x4a')](_0x5d6638[_0xa87f('0x4b')],{})[_0xa87f('0x25')](respondWithResult(_0x1eca3a,0xc9))['catch'](handleError(_0x1eca3a,null));};exports[_0xa87f('0x4c')]=function(_0x37571c,_0x2eb6e0){return db['AnalyticFieldReport'][_0xa87f('0x4c')](_0x37571c[_0xa87f('0x4b')],{'raw':![],'individualHooks':!![]})[_0xa87f('0x25')](respondWithResult(_0x2eb6e0,0xc9))[_0xa87f('0x44')](handleError(_0x2eb6e0,null));};exports[_0xa87f('0x24')]=function(_0x18ec58,_0x34f216){if(_0x18ec58[_0xa87f('0x4b')]['id']){delete _0x18ec58['body']['id'];}return db[_0xa87f('0x2b')][_0xa87f('0x49')]({'where':{'id':_0x18ec58[_0xa87f('0x46')]['id']}})[_0xa87f('0x25')](handleEntityNotFound(_0x34f216,null))[_0xa87f('0x25')](saveUpdates(_0x18ec58['body'],null))['then'](respondWithResult(_0x34f216,null))[_0xa87f('0x44')](handleError(_0x34f216,null));};exports[_0xa87f('0x26')]=function(_0x59063a,_0x4489fa){return db[_0xa87f('0x2b')]['find']({'where':{'id':_0x59063a[_0xa87f('0x46')]['id']}})[_0xa87f('0x25')](handleEntityNotFound(_0x4489fa,null))[_0xa87f('0x25')](removeEntity(_0x4489fa,null))[_0xa87f('0x44')](handleError(_0x4489fa,null));};exports[_0xa87f('0x4d')]=function(_0x44e608,_0x50eaef){return db[_0xa87f('0x2b')][_0xa87f('0x26')]({'where':{'id':_0x44e608['query'][_0xa87f('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xa87f('0x25')](respondWithResult(_0x50eaef,0xcc))[_0xa87f('0x44')](handleError(_0x50eaef,null));};exports[_0xa87f('0x4f')]=function(_0x3ba0af,_0x4aa14a,_0x26dec6){return db['AnalyticCustomReport'][_0xa87f('0x50')]({'where':{'id':_0x3ba0af['params']['id']}})['then'](handleEntityNotFound(_0x4aa14a,null))[_0xa87f('0x25')](function(_0x35c396){if(_0x35c396){return db['sequelize'][_0xa87f('0x51')](function(_0x5b5b0a){return db[_0xa87f('0x2b')][_0xa87f('0x26')]({'where':{'CustomReportId':_0x3ba0af['params']['id']},'transaction':_0x5b5b0a})[_0xa87f('0x25')](function(_0x203fd1){var _0x2d0804=_[_0xa87f('0x31')](_0x3ba0af[_0xa87f('0x4b')],function(_0x3e3c60){delete _0x3e3c60['id'];_0x3e3c60['CustomReportId']=_0x3ba0af['params']['id'];return _0x3e3c60;});return db['AnalyticFieldReport'][_0xa87f('0x4c')](_0x2d0804,{'transaction':_0x5b5b0a});});})[_0xa87f('0x25')](function(){return db[_0xa87f('0x2b')][_0xa87f('0x42')]({'where':{'CustomReportId':_0x3ba0af[_0xa87f('0x46')]['id']}});});}})[_0xa87f('0x25')](respondWithResult(_0x4aa14a,null))['catch'](handleError(_0x4aa14a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 04fafec..45c1c3f 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 _0x5563=['./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5df02f,_0x43fcb0){var _0x369634=function(_0xf9753d){while(--_0xf9753d){_0x5df02f['push'](_0x5df02f['shift']());}};_0x369634(++_0x43fcb0);}(_0x5563,0xb8));var _0x3556=function(_0x2ce022,_0x560790){_0x2ce022=_0x2ce022-0x0;var _0x29440d=_0x5563[_0x2ce022];return _0x29440d;};'use strict';var _=require(_0x3556('0x0'));var util=require(_0x3556('0x1'));var logger=require('../../config/logger')(_0x3556('0x2'));var moment=require(_0x3556('0x3'));var BPromise=require(_0x3556('0x4'));var rp=require(_0x3556('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3556('0x6'));var config=require(_0x3556('0x7'));var attributes=require(_0x3556('0x8'));module['exports']=function(_0x4b8661,_0x184827){return _0x4b8661[_0x3556('0x9')](_0x3556('0xa'),attributes,{'tableName':_0x3556('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe94c=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x2b3daa,_0xca962b){var _0x3be130=function(_0x2e323f){while(--_0x2e323f){_0x2b3daa['push'](_0x2b3daa['shift']());}};_0x3be130(++_0xca962b);}(_0xe94c,0x181));var _0xce94=function(_0x10aae4,_0x4778e7){_0x10aae4=_0x10aae4-0x0;var _0x5ec719=_0xe94c[_0x10aae4];return _0x5ec719;};'use strict';var _=require(_0xce94('0x0'));var util=require(_0xce94('0x1'));var logger=require(_0xce94('0x2'))(_0xce94('0x3'));var moment=require(_0xce94('0x4'));var BPromise=require('bluebird');var rp=require(_0xce94('0x5'));var fs=require('fs');var path=require(_0xce94('0x6'));var rimraf=require('rimraf');var config=require(_0xce94('0x7'));var attributes=require(_0xce94('0x8'));module[_0xce94('0x9')]=function(_0x1c66bc,_0x1f593c){return _0x1c66bc[_0xce94('0xa')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 bbc11ad..e58ab12 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 _0x6635=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d61f6,_0x49084c){var _0x428ecc=function(_0x7655d1){while(--_0x7655d1){_0x5d61f6['push'](_0x5d61f6['shift']());}};_0x428ecc(++_0x49084c);}(_0x6635,0xe5));var _0x5663=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x6635[_0x307d86];return _0x361745;};'use strict';var _=require(_0x5663('0x0'));var util=require(_0x5663('0x1'));var moment=require(_0x5663('0x2'));var BPromise=require(_0x5663('0x3'));var rs=require(_0x5663('0x4'));var fs=require('fs');var Redis=require(_0x5663('0x5'));var db=require(_0x5663('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5663('0x7'))(_0x5663('0x8'));var config=require(_0x5663('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5663('0xa')][_0x5663('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe0cc05,_0x1f0ba5,_0x40998e){return new BPromise(function(_0x5cf090,_0x39be39){return client[_0x5663('0xc')](_0xe0cc05,_0x40998e)[_0x5663('0xd')](function(_0x3975e4){logger[_0x5663('0xe')](_0x5663('0xf'),_0x1f0ba5,_0x5663('0x10'));logger[_0x5663('0x11')](_0x5663('0x12'),_0x1f0ba5,_0x5663('0x10'),JSON[_0x5663('0x13')](_0x3975e4));if(_0x3975e4[_0x5663('0x14')]){if(_0x3975e4['error'][_0x5663('0x15')]===0x1f4){logger[_0x5663('0x14')](_0x5663('0xf'),_0x1f0ba5,_0x3975e4[_0x5663('0x14')]['message']);return _0x39be39(_0x3975e4['error'][_0x5663('0x16')]);}logger[_0x5663('0x14')](_0x5663('0xf'),_0x1f0ba5,_0x3975e4[_0x5663('0x14')][_0x5663('0x16')]);return _0x5cf090(_0x3975e4['error'][_0x5663('0x16')]);}else{logger[_0x5663('0xe')](_0x5663('0xf'),_0x1f0ba5,_0x5663('0x10'));_0x5cf090(_0x3975e4[_0x5663('0x17')][_0x5663('0x16')]);}})[_0x5663('0x18')](function(_0x2a455a){logger['error'](_0x5663('0xf'),_0x1f0ba5,_0x2a455a);_0x39be39(_0x2a455a);});});} \ No newline at end of file +var _0xf242=['stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x4b4089,_0x3c1da8){var _0x3cbf9a=function(_0x5db149){while(--_0x5db149){_0x4b4089['push'](_0x4b4089['shift']());}};_0x3cbf9a(++_0x3c1da8);}(_0xf242,0x17b));var _0x2f24=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xf242[_0x2742db];return _0x18659e;};'use strict';var _=require(_0x2f24('0x0'));var util=require(_0x2f24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f24('0x2'));var fs=require('fs');var Redis=require(_0x2f24('0x3'));var db=require(_0x2f24('0x4'))['db'];var utils=require(_0x2f24('0x5'));var logger=require(_0x2f24('0x6'))(_0x2f24('0x7'));var config=require(_0x2f24('0x8'));var jayson=require(_0x2f24('0x9'));var client=jayson[_0x2f24('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49397f,_0x5e2da1,_0x1ce934){return new BPromise(function(_0x2846f0,_0x1cda04){return client['request'](_0x49397f,_0x1ce934)[_0x2f24('0xb')](function(_0x3351b1){logger[_0x2f24('0xc')](_0x2f24('0xd'),_0x5e2da1,_0x2f24('0xe'));logger[_0x2f24('0xf')](_0x2f24('0x10'),_0x5e2da1,_0x2f24('0xe'),JSON[_0x2f24('0x11')](_0x3351b1));if(_0x3351b1[_0x2f24('0x12')]){if(_0x3351b1[_0x2f24('0x12')][_0x2f24('0x13')]===0x1f4){logger[_0x2f24('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5e2da1,_0x3351b1['error'][_0x2f24('0x14')]);return _0x1cda04(_0x3351b1[_0x2f24('0x12')][_0x2f24('0x14')]);}logger[_0x2f24('0x12')](_0x2f24('0xd'),_0x5e2da1,_0x3351b1['error'][_0x2f24('0x14')]);return _0x2846f0(_0x3351b1[_0x2f24('0x12')]['message']);}else{logger[_0x2f24('0xc')](_0x2f24('0xd'),_0x5e2da1,_0x2f24('0xe'));_0x2846f0(_0x3351b1['result'][_0x2f24('0x14')]);}})[_0x2f24('0x15')](function(_0x5ad6a9){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5e2da1,_0x5ad6a9);_0x1cda04(_0x5ad6a9);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b3179f7..9b7cf74 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(_0x407879,_0x33e702){var _0x469241=function(_0x1de075){while(--_0x1de075){_0x407879['push'](_0x407879['shift']());}};_0x469241(++_0x33e702);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x165ffc,_0x3f9d50){var _0xe2cb59=function(_0x56877a){while(--_0x56877a){_0x165ffc['push'](_0x165ffc['shift']());}};_0xe2cb59(++_0x3f9d50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 92bff57..5e92d65 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 _0x5525=['exports','STRING','name','TEXT','sequelize'];(function(_0x11aa42,_0x1cbd80){var _0x3f6af1=function(_0x530892){while(--_0x530892){_0x11aa42['push'](_0x11aa42['shift']());}};_0x3f6af1(++_0x1cbd80);}(_0x5525,0xd1));var _0x5552=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5525[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x5552('0x0'));module[_0x5552('0x1')]={'name':{'type':Sequelize[_0x5552('0x2')],'allowNull':![],'unique':_0x5552('0x3')},'table':{'type':Sequelize[_0x5552('0x2')]},'metric':{'type':Sequelize[_0x5552('0x4')]},'description':{'type':Sequelize[_0x5552('0x2')]}}; \ No newline at end of file +var _0xc041=['sequelize','exports','name','TEXT','STRING'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0xc041,0x1ea));var _0x1c04=function(_0x2d9f8b,_0x1eca48){_0x2d9f8b=_0x2d9f8b-0x0;var _0x251209=_0xc041[_0x2d9f8b];return _0x251209;};'use strict';var Sequelize=require(_0x1c04('0x0'));module[_0x1c04('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1c04('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c04('0x3')]},'description':{'type':Sequelize[_0x1c04('0x4')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b65477c..b0ff88c 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','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','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x3c1615,_0x2c6238){var _0x3959c4=function(_0x38c61c){while(--_0x38c61c){_0x3c1615['push'](_0x3c1615['shift']());}};_0x3959c4(++_0x2c6238);}(_0x425d,0x1e0));var _0xd425=function(_0x591db7,_0x150445){_0x591db7=_0x591db7-0x0;var _0x4ad760=_0x425d[_0x591db7];return _0x4ad760;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file +var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x41709d,_0x16eb76){var _0x169a7b=function(_0xb6b286){while(--_0xb6b286){_0x41709d['push'](_0x41709d['shift']());}};_0x169a7b(++_0x16eb76);}(_0xa41a,0x6b));var _0xaa41=function(_0xc12adf,_0x155b20){_0xc12adf=_0xc12adf-0x0;var _0x59c398=_0xa41a[_0xc12adf];return _0x59c398;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 6377e1e..1cfdbd0 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 _0x00e0=['moment','request-promise','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x364092,_0x462cf7){var _0x1afcb4=function(_0x43569b){while(--_0x43569b){_0x364092['push'](_0x364092['shift']());}};_0x1afcb4(++_0x462cf7);}(_0x00e0,0x1e3));var _0x000e=function(_0x2d0cc0,_0xc8d13c){_0x2d0cc0=_0x2d0cc0-0x0;var _0x28fa7b=_0x00e0[_0x2d0cc0];return _0x28fa7b;};'use strict';var _=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var logger=require(_0x000e('0x2'))('api');var moment=require(_0x000e('0x3'));var BPromise=require('bluebird');var rp=require(_0x000e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x000e('0x5')]=function(_0x24c83e,_0x4850f7){return _0x24c83e[_0x000e('0x6')](_0x000e('0x7'),attributes,{'tableName':_0x000e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80c3=['define','AnalyticMetric','analytics_metrics','lodash','api','bluebird','request-promise','path','exports'];(function(_0x1fa06d,_0x4976b2){var _0x141b7f=function(_0x54f37f){while(--_0x54f37f){_0x1fa06d['push'](_0x1fa06d['shift']());}};_0x141b7f(++_0x4976b2);}(_0x80c3,0x18f));var _0x380c=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x80c3[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x380c('0x1'));var moment=require('moment');var BPromise=require(_0x380c('0x2'));var rp=require(_0x380c('0x3'));var fs=require('fs');var path=require(_0x380c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x380c('0x5')]=function(_0x595b66,_0x581c96){return _0x595b66[_0x380c('0x6')](_0x380c('0x7'),attributes,{'tableName':_0x380c('0x8'),'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 5586ad9..b5957d9 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 _0x3167=['code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ecdf2,_0xae699d){var _0x162a14=function(_0x15f7ad){while(--_0x15f7ad){_0x3ecdf2['push'](_0x3ecdf2['shift']());}};_0x162a14(++_0xae699d);}(_0x3167,0xf5));var _0x7316=function(_0x5906a5,_0x48af0a){_0x5906a5=_0x5906a5-0x0;var _0x1b9a31=_0x3167[_0x5906a5];return _0x1b9a31;};'use strict';var _=require(_0x7316('0x0'));var util=require('util');var moment=require(_0x7316('0x1'));var BPromise=require(_0x7316('0x2'));var rs=require(_0x7316('0x3'));var fs=require('fs');var Redis=require(_0x7316('0x4'));var db=require(_0x7316('0x5'))['db'];var utils=require(_0x7316('0x6'));var logger=require(_0x7316('0x7'))(_0x7316('0x8'));var config=require(_0x7316('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7316('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d496,_0x42aad7,_0x3664dc){return new BPromise(function(_0x407461,_0x5541e8){return client[_0x7316('0xb')](_0x10d496,_0x3664dc)['then'](function(_0x3ce94b){logger[_0x7316('0xc')](_0x7316('0xd'),_0x42aad7,_0x7316('0xe'));logger[_0x7316('0xf')](_0x7316('0x10'),_0x42aad7,_0x7316('0xe'),JSON[_0x7316('0x11')](_0x3ce94b));if(_0x3ce94b[_0x7316('0x12')]){if(_0x3ce94b[_0x7316('0x12')][_0x7316('0x13')]===0x1f4){logger[_0x7316('0x12')](_0x7316('0xd'),_0x42aad7,_0x3ce94b['error'][_0x7316('0x14')]);return _0x5541e8(_0x3ce94b[_0x7316('0x12')][_0x7316('0x14')]);}logger[_0x7316('0x12')](_0x7316('0xd'),_0x42aad7,_0x3ce94b[_0x7316('0x12')][_0x7316('0x14')]);return _0x407461(_0x3ce94b['error'][_0x7316('0x14')]);}else{logger[_0x7316('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x42aad7,_0x7316('0xe'));_0x407461(_0x3ce94b['result'][_0x7316('0x14')]);}})[_0x7316('0x15')](function(_0x2cbb14){logger[_0x7316('0x12')](_0x7316('0xd'),_0x42aad7,_0x2cbb14);_0x5541e8(_0x2cbb14);});});} \ No newline at end of file +var _0x9274=['then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1c8767,_0x291edb){var _0x170bc1=function(_0x557b87){while(--_0x557b87){_0x1c8767['push'](_0x1c8767['shift']());}};_0x170bc1(++_0x291edb);}(_0x9274,0x1e6));var _0x4927=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9274[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x4927('0x0'));var util=require(_0x4927('0x1'));var moment=require(_0x4927('0x2'));var BPromise=require(_0x4927('0x3'));var rs=require(_0x4927('0x4'));var fs=require('fs');var Redis=require(_0x4927('0x5'));var db=require(_0x4927('0x6'))['db'];var utils=require(_0x4927('0x7'));var logger=require(_0x4927('0x8'))(_0x4927('0x9'));var config=require(_0x4927('0xa'));var jayson=require(_0x4927('0xb'));var client=jayson[_0x4927('0xc')][_0x4927('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x276c16,_0x1a2e1a,_0x318e47){return new BPromise(function(_0xae5445,_0x5002a8){return client['request'](_0x276c16,_0x318e47)[_0x4927('0xe')](function(_0x4d3ba0){logger[_0x4927('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x1a2e1a,'request\x20sent');logger[_0x4927('0x10')](_0x4927('0x11'),_0x1a2e1a,_0x4927('0x12'),JSON['stringify'](_0x4d3ba0));if(_0x4d3ba0[_0x4927('0x13')]){if(_0x4d3ba0[_0x4927('0x13')][_0x4927('0x14')]===0x1f4){logger[_0x4927('0x13')](_0x4927('0x15'),_0x1a2e1a,_0x4d3ba0['error']['message']);return _0x5002a8(_0x4d3ba0[_0x4927('0x13')][_0x4927('0x16')]);}logger[_0x4927('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x1a2e1a,_0x4d3ba0[_0x4927('0x13')][_0x4927('0x16')]);return _0xae5445(_0x4d3ba0[_0x4927('0x13')][_0x4927('0x16')]);}else{logger[_0x4927('0xf')](_0x4927('0x15'),_0x1a2e1a,_0x4927('0x12'));_0xae5445(_0x4d3ba0[_0x4927('0x17')][_0x4927('0x16')]);}})[_0x4927('0x18')](function(_0x2f77bb){logger[_0x4927('0x13')](_0x4927('0x15'),_0x1a2e1a,_0x2f77bb);_0x5002a8(_0x2f77bb);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0880a6c..dbf3eda 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 _0x8832=['fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','create','put','/:id','update','multer','util','express','Router'];(function(_0x5e354a,_0x2fb96f){var _0x389903=function(_0x268e58){while(--_0x268e58){_0x5e354a['push'](_0x5e354a['shift']());}};_0x389903(++_0x2fb96f);}(_0x8832,0x1f4));var _0x2883=function(_0x2f194c,_0x1c005f){_0x2f194c=_0x2f194c-0x0;var _0x9039d2=_0x8832[_0x2f194c];return _0x9039d2;};'use strict';var multer=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2883('0x2'));var router=express[_0x2883('0x3')]();var fs_extra=require(_0x2883('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2883('0x5'));var config=require('../../config/environment');var controller=require(_0x2883('0x6'));router[_0x2883('0x7')]('/',auth[_0x2883('0x8')](),controller['index']);router[_0x2883('0x7')]('/:id',auth[_0x2883('0x8')](),controller[_0x2883('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2883('0xa')]);router[_0x2883('0xb')](_0x2883('0xc'),auth[_0x2883('0x8')](),controller[_0x2883('0xd')]);router['delete']('/:id',auth[_0x2883('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6aa7=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post','create','update','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6aa7,0x178));var _0x76aa=function(_0x41dd56,_0x1dc334){_0x41dd56=_0x41dd56-0x0;var _0x50483c=_0x6aa7[_0x41dd56];return _0x50483c;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xb')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xc')]);router['put'](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);module[_0x76aa('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0dde2ba..30985d2 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 _0x219b=['TEXT','exports'];(function(_0x8544b8,_0x1601b3){var _0x2598c8=function(_0x52ff2f){while(--_0x52ff2f){_0x8544b8['push'](_0x8544b8['shift']());}};_0x2598c8(++_0x1601b3);}(_0x219b,0x77));var _0xb219=function(_0x3034ce,_0x5318ad){_0x3034ce=_0x3034ce-0x0;var _0xfe0dc1=_0x219b[_0x3034ce];return _0xfe0dc1;};'use strict';var Sequelize=require('sequelize');module[_0xb219('0x0')]={'tree':{'type':Sequelize[_0xb219('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb205=['sequelize','exports','TEXT'];(function(_0x29d09e,_0x4c89ea){var _0x588601=function(_0x59a21e){while(--_0x59a21e){_0x29d09e['push'](_0x29d09e['shift']());}};_0x588601(++_0x4c89ea);}(_0xb205,0xcc));var _0x5b20=function(_0x3722ce,_0x47c628){_0x3722ce=_0x3722ce-0x0;var _0x28ab82=_0xb205[_0x3722ce];return _0x28ab82;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'tree':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 7bd97ff..73e2c1d 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 _0xc829=['body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','include','findAll','catch','show','params','includeAll','create'];(function(_0x5a037a,_0x44a3fc){var _0x28ff57=function(_0x13d49f){while(--_0x13d49f){_0x5a037a['push'](_0x5a037a['shift']());}};_0x28ff57(++_0x44a3fc);}(_0xc829,0x1d6));var _0x9c82=function(_0x370a45,_0x39764d){_0x370a45=_0x370a45-0x0;var _0x387651=_0xc829[_0x370a45];return _0x387651;};'use strict';var emlformat=require(_0x9c82('0x0'));var rimraf=require(_0x9c82('0x1'));var zipdir=require(_0x9c82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c82('0x3'));var moment=require(_0x9c82('0x4'));var BPromise=require(_0x9c82('0x5'));var Mustache=require(_0x9c82('0x6'));var util=require(_0x9c82('0x7'));var path=require('path');var sox=require(_0x9c82('0x8'));var csv=require(_0x9c82('0x9'));var ejs=require(_0x9c82('0xa'));var fs=require('fs');var fs_extra=require(_0x9c82('0xb'));var _=require(_0x9c82('0xc'));var squel=require(_0x9c82('0xd'));var crypto=require(_0x9c82('0xe'));var jsforce=require(_0x9c82('0xf'));var deskjs=require(_0x9c82('0x10'));var toCsv=require(_0x9c82('0x9'));var querystring=require('querystring');var Papa=require(_0x9c82('0x11'));var Redis=require(_0x9c82('0x12'));var authService=require(_0x9c82('0x13'));var qs=require(_0x9c82('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c82('0x15'));var logger=require('../../config/logger')(_0x9c82('0x16'));var utils=require(_0x9c82('0x17'));var config=require(_0x9c82('0x18'));var licenseUtil=require(_0x9c82('0x19'));var db=require(_0x9c82('0x1a'))['db'];function respondWithStatusCode(_0x3cf6c2,_0x52d5d3){_0x52d5d3=_0x52d5d3||0xcc;return function(_0x1dc158){if(_0x1dc158){return _0x3cf6c2[_0x9c82('0x1b')](_0x52d5d3);}return _0x3cf6c2[_0x9c82('0x1c')](_0x52d5d3)[_0x9c82('0x1d')]();};}function respondWithResult(_0x505b7a,_0x2fe981){_0x2fe981=_0x2fe981||0xc8;return function(_0x53f5e3){if(_0x53f5e3){return _0x505b7a[_0x9c82('0x1c')](_0x2fe981)[_0x9c82('0x1e')](_0x53f5e3);}};}function respondWithFilteredResult(_0x3c2f73,_0x102fde){return function(_0x1c97f3){if(_0x1c97f3){var _0x1b1198=typeof _0x102fde[_0x9c82('0x1f')]===_0x9c82('0x20')&&typeof _0x102fde['limit']===_0x9c82('0x20');var _0x11389e=_0x1c97f3[_0x9c82('0x21')];var _0x3c04cf=_0x1b1198?0x0:_0x102fde[_0x9c82('0x1f')];var _0x385bce=_0x1b1198?_0x1c97f3[_0x9c82('0x21')]:_0x102fde[_0x9c82('0x1f')]+_0x102fde[_0x9c82('0x22')];var _0x25d1c1;if(_0x385bce>=_0x11389e){_0x385bce=_0x11389e;_0x25d1c1=0xc8;}else{_0x25d1c1=0xce;}_0x3c2f73[_0x9c82('0x1c')](_0x25d1c1);return _0x3c2f73[_0x9c82('0x23')](_0x9c82('0x24'),_0x3c04cf+'-'+_0x385bce+'/'+_0x11389e)['json'](_0x1c97f3);}return null;};}function patchUpdates(_0xd9b3d7){return function(_0x427bd6){try{jsonpatch['apply'](_0x427bd6,_0xd9b3d7,!![]);}catch(_0x22fab5){return BPromise[_0x9c82('0x25')](_0x22fab5);}return _0x427bd6[_0x9c82('0x26')]();};}function saveUpdates(_0x3d6bcc,_0x5575dd){return function(_0x1c7edb){if(_0x1c7edb){return _0x1c7edb[_0x9c82('0x27')](_0x3d6bcc)[_0x9c82('0x28')](function(_0x50b147){return _0x50b147;});}return null;};}function removeEntity(_0x48efca,_0x54f9e7){return function(_0x4082b7){if(_0x4082b7){return _0x4082b7[_0x9c82('0x29')]()['then'](function(){_0x48efca[_0x9c82('0x1c')](0xcc)[_0x9c82('0x1d')]();});}};}function handleEntityNotFound(_0x16b299,_0x579fea){return function(_0x57b7a0){if(!_0x57b7a0){_0x16b299[_0x9c82('0x1b')](0x194);}return _0x57b7a0;};}function handleError(_0x402757,_0x41018c){_0x41018c=_0x41018c||0x1f4;return function(_0x563484){logger[_0x9c82('0x2a')](_0x563484['stack']);if(_0x563484[_0x9c82('0x2b')]){delete _0x563484['name'];}_0x402757[_0x9c82('0x1c')](_0x41018c)[_0x9c82('0x2c')](_0x563484);};}exports[_0x9c82('0x2d')]=function(_0x2b9401,_0xf4abfe){var _0x343b98={},_0x404140={},_0x1f1a06={'count':0x0,'rows':[]};var _0x39f638=_[_0x9c82('0x2e')](db['AnalyticTreeReport'][_0x9c82('0x2f')],function(_0x111a72){return{'name':_0x111a72[_0x9c82('0x30')],'type':_0x111a72[_0x9c82('0x31')]['key']};});_0x404140['model']=_[_0x9c82('0x2e')](_0x39f638,'name');_0x404140['query']=_[_0x9c82('0x32')](_0x2b9401[_0x9c82('0x33')]);_0x404140[_0x9c82('0x34')]=_['intersection'](_0x404140[_0x9c82('0x35')],_0x404140[_0x9c82('0x33')]);_0x343b98[_0x9c82('0x36')]=_[_0x9c82('0x37')](_0x404140[_0x9c82('0x35')],qs['fields'](_0x2b9401[_0x9c82('0x33')][_0x9c82('0x38')]));_0x343b98[_0x9c82('0x36')]=_0x343b98[_0x9c82('0x36')][_0x9c82('0x39')]?_0x343b98[_0x9c82('0x36')]:_0x404140['model'];if(!_0x2b9401[_0x9c82('0x33')][_0x9c82('0x3a')](_0x9c82('0x3b'))){_0x343b98['limit']=qs[_0x9c82('0x22')](_0x2b9401['query'][_0x9c82('0x22')]);_0x343b98[_0x9c82('0x1f')]=qs[_0x9c82('0x1f')](_0x2b9401[_0x9c82('0x33')][_0x9c82('0x1f')]);}_0x343b98[_0x9c82('0x3c')]=qs['sort'](_0x2b9401[_0x9c82('0x33')][_0x9c82('0x3d')]);_0x343b98[_0x9c82('0x3e')]=qs[_0x9c82('0x34')](_[_0x9c82('0x3f')](_0x2b9401[_0x9c82('0x33')],_0x404140['filters']),_0x39f638);if(_0x2b9401[_0x9c82('0x33')][_0x9c82('0x40')]){_0x343b98['where']=_[_0x9c82('0x41')](_0x343b98[_0x9c82('0x3e')],{'$or':_[_0x9c82('0x2e')](_0x39f638,function(_0x1120a9){if(_0x1120a9[_0x9c82('0x31')]!==_0x9c82('0x42')){var _0x1e5142={};_0x1e5142[_0x1120a9[_0x9c82('0x2b')]]={'$like':'%'+_0x2b9401[_0x9c82('0x33')][_0x9c82('0x40')]+'%'};return _0x1e5142;}})});}_0x343b98=_[_0x9c82('0x41')]({},_0x343b98,_0x2b9401[_0x9c82('0x43')]);var _0x24f638={'where':_0x343b98['where']};return db[_0x9c82('0x44')][_0x9c82('0x21')](_0x24f638)[_0x9c82('0x28')](function(_0x38cc8b){_0x1f1a06[_0x9c82('0x21')]=_0x38cc8b;if(_0x2b9401[_0x9c82('0x33')]['includeAll']){_0x343b98[_0x9c82('0x45')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x9c82('0x46')](_0x343b98);})[_0x9c82('0x28')](function(_0x521400){_0x1f1a06['rows']=_0x521400;return _0x1f1a06;})[_0x9c82('0x28')](respondWithFilteredResult(_0xf4abfe,_0x343b98))[_0x9c82('0x47')](handleError(_0xf4abfe,null));};exports[_0x9c82('0x48')]=function(_0x1d4726,_0x36fdb4){var _0x281310={'raw':!![],'where':{'id':_0x1d4726[_0x9c82('0x49')]['id']}},_0x54a253={};_0x54a253[_0x9c82('0x35')]=_[_0x9c82('0x32')](db[_0x9c82('0x44')][_0x9c82('0x2f')]);_0x54a253['query']=_['keys'](_0x1d4726[_0x9c82('0x33')]);_0x54a253[_0x9c82('0x34')]=_[_0x9c82('0x37')](_0x54a253[_0x9c82('0x35')],_0x54a253[_0x9c82('0x33')]);_0x281310[_0x9c82('0x36')]=_[_0x9c82('0x37')](_0x54a253[_0x9c82('0x35')],qs[_0x9c82('0x38')](_0x1d4726['query'][_0x9c82('0x38')]));_0x281310[_0x9c82('0x36')]=_0x281310[_0x9c82('0x36')][_0x9c82('0x39')]?_0x281310[_0x9c82('0x36')]:_0x54a253[_0x9c82('0x35')];if(_0x1d4726[_0x9c82('0x33')][_0x9c82('0x4a')]){_0x281310[_0x9c82('0x45')]=[{'all':!![]}];}_0x281310=_[_0x9c82('0x41')]({},_0x281310,_0x1d4726[_0x9c82('0x43')]);return db[_0x9c82('0x44')]['find'](_0x281310)['then'](handleEntityNotFound(_0x36fdb4,null))[_0x9c82('0x28')](respondWithResult(_0x36fdb4,null))['catch'](handleError(_0x36fdb4,null));};exports['create']=function(_0x41a325,_0x48a02b){return db[_0x9c82('0x44')][_0x9c82('0x4b')](_0x41a325['body'],{})[_0x9c82('0x28')](respondWithResult(_0x48a02b,0xc9))[_0x9c82('0x47')](handleError(_0x48a02b,null));};exports[_0x9c82('0x27')]=function(_0x18b185,_0x526170){if(_0x18b185[_0x9c82('0x4c')]['id']){delete _0x18b185[_0x9c82('0x4c')]['id'];}return db[_0x9c82('0x44')][_0x9c82('0x4d')]({'where':{'id':_0x18b185[_0x9c82('0x49')]['id']}})[_0x9c82('0x28')](handleEntityNotFound(_0x526170,null))[_0x9c82('0x28')](saveUpdates(_0x18b185[_0x9c82('0x4c')],null))['then'](respondWithResult(_0x526170,null))[_0x9c82('0x47')](handleError(_0x526170,null));};exports[_0x9c82('0x29')]=function(_0x56bf0e,_0x948574){return db[_0x9c82('0x44')][_0x9c82('0x4d')]({'where':{'id':_0x56bf0e[_0x9c82('0x49')]['id']}})[_0x9c82('0x28')](handleEntityNotFound(_0x948574,null))[_0x9c82('0x28')](removeEntity(_0x948574,null))[_0x9c82('0x47')](handleError(_0x948574,null));}; \ No newline at end of file +var _0x4622=['VIRTUAL','merge','includeAll','catch','show','params','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x4622,0x9b));var _0x2462=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x4622[_0x19159a];return _0xa677f4;};'use strict';var emlformat=require(_0x2462('0x0'));var rimraf=require(_0x2462('0x1'));var zipdir=require(_0x2462('0x2'));var jsonpatch=require(_0x2462('0x3'));var rp=require(_0x2462('0x4'));var moment=require('moment');var BPromise=require(_0x2462('0x5'));var Mustache=require(_0x2462('0x6'));var util=require('util');var path=require(_0x2462('0x7'));var sox=require('sox');var csv=require(_0x2462('0x8'));var ejs=require(_0x2462('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2462('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2462('0xb'));var deskjs=require(_0x2462('0xc'));var toCsv=require(_0x2462('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2462('0xd'));var qs=require(_0x2462('0xe'));var as=require(_0x2462('0xf'));var hardwareService=require(_0x2462('0x10'));var logger=require(_0x2462('0x11'))('api');var utils=require(_0x2462('0x12'));var config=require(_0x2462('0x13'));var licenseUtil=require(_0x2462('0x14'));var db=require(_0x2462('0x15'))['db'];function respondWithStatusCode(_0x2d9e50,_0x400727){_0x400727=_0x400727||0xcc;return function(_0x30138a){if(_0x30138a){return _0x2d9e50[_0x2462('0x16')](_0x400727);}return _0x2d9e50[_0x2462('0x17')](_0x400727)[_0x2462('0x18')]();};}function respondWithResult(_0x28c624,_0x3f4b74){_0x3f4b74=_0x3f4b74||0xc8;return function(_0xa67212){if(_0xa67212){return _0x28c624[_0x2462('0x17')](_0x3f4b74)['json'](_0xa67212);}};}function respondWithFilteredResult(_0x3c930e,_0x41da10){return function(_0x116736){if(_0x116736){var _0x2388f6=typeof _0x41da10[_0x2462('0x19')]===_0x2462('0x1a')&&typeof _0x41da10[_0x2462('0x1b')]===_0x2462('0x1a');var _0x5d60ee=_0x116736[_0x2462('0x1c')];var _0x420335=_0x2388f6?0x0:_0x41da10[_0x2462('0x19')];var _0x2368f5=_0x2388f6?_0x116736['count']:_0x41da10[_0x2462('0x19')]+_0x41da10[_0x2462('0x1b')];var _0x2eda25;if(_0x2368f5>=_0x5d60ee){_0x2368f5=_0x5d60ee;_0x2eda25=0xc8;}else{_0x2eda25=0xce;}_0x3c930e[_0x2462('0x17')](_0x2eda25);return _0x3c930e[_0x2462('0x1d')](_0x2462('0x1e'),_0x420335+'-'+_0x2368f5+'/'+_0x5d60ee)[_0x2462('0x1f')](_0x116736);}return null;};}function patchUpdates(_0x5c12d8){return function(_0x20a1e2){try{jsonpatch['apply'](_0x20a1e2,_0x5c12d8,!![]);}catch(_0x328fd6){return BPromise[_0x2462('0x20')](_0x328fd6);}return _0x20a1e2[_0x2462('0x21')]();};}function saveUpdates(_0xf51b34,_0x45820a){return function(_0x2e8b49){if(_0x2e8b49){return _0x2e8b49[_0x2462('0x22')](_0xf51b34)['then'](function(_0x5596d1){return _0x5596d1;});}return null;};}function removeEntity(_0x139e95,_0x528b82){return function(_0x28a81b){if(_0x28a81b){return _0x28a81b[_0x2462('0x23')]()[_0x2462('0x24')](function(){_0x139e95['status'](0xcc)[_0x2462('0x18')]();});}};}function handleEntityNotFound(_0x237be7,_0xde06e9){return function(_0xdb517c){if(!_0xdb517c){_0x237be7[_0x2462('0x16')](0x194);}return _0xdb517c;};}function handleError(_0x1b1b9a,_0x1d0f57){_0x1d0f57=_0x1d0f57||0x1f4;return function(_0x558eca){logger[_0x2462('0x25')](_0x558eca[_0x2462('0x26')]);if(_0x558eca[_0x2462('0x27')]){delete _0x558eca[_0x2462('0x27')];}_0x1b1b9a[_0x2462('0x17')](_0x1d0f57)[_0x2462('0x28')](_0x558eca);};}exports[_0x2462('0x29')]=function(_0x466e69,_0x1f378d){var _0xa979d7={},_0x25603c={},_0x4b7147={'count':0x0,'rows':[]};var _0x43318a=_[_0x2462('0x2a')](db[_0x2462('0x2b')][_0x2462('0x2c')],function(_0x12bb42){return{'name':_0x12bb42['fieldName'],'type':_0x12bb42[_0x2462('0x2d')][_0x2462('0x2e')]};});_0x25603c[_0x2462('0x2f')]=_['map'](_0x43318a,'name');_0x25603c['query']=_[_0x2462('0x30')](_0x466e69[_0x2462('0x31')]);_0x25603c[_0x2462('0x32')]=_[_0x2462('0x33')](_0x25603c[_0x2462('0x2f')],_0x25603c['query']);_0xa979d7['attributes']=_[_0x2462('0x33')](_0x25603c['model'],qs['fields'](_0x466e69[_0x2462('0x31')][_0x2462('0x34')]));_0xa979d7['attributes']=_0xa979d7[_0x2462('0x35')][_0x2462('0x36')]?_0xa979d7['attributes']:_0x25603c[_0x2462('0x2f')];if(!_0x466e69[_0x2462('0x31')][_0x2462('0x37')](_0x2462('0x38'))){_0xa979d7[_0x2462('0x1b')]=qs['limit'](_0x466e69['query']['limit']);_0xa979d7[_0x2462('0x19')]=qs['offset'](_0x466e69[_0x2462('0x31')]['offset']);}_0xa979d7['order']=qs[_0x2462('0x39')](_0x466e69[_0x2462('0x31')]['sort']);_0xa979d7[_0x2462('0x3a')]=qs[_0x2462('0x32')](_[_0x2462('0x3b')](_0x466e69[_0x2462('0x31')],_0x25603c[_0x2462('0x32')]),_0x43318a);if(_0x466e69[_0x2462('0x31')][_0x2462('0x3c')]){_0xa979d7[_0x2462('0x3a')]=_['merge'](_0xa979d7[_0x2462('0x3a')],{'$or':_[_0x2462('0x2a')](_0x43318a,function(_0x12ed7d){if(_0x12ed7d[_0x2462('0x2d')]!==_0x2462('0x3d')){var _0x2131c0={};_0x2131c0[_0x12ed7d[_0x2462('0x27')]]={'$like':'%'+_0x466e69[_0x2462('0x31')][_0x2462('0x3c')]+'%'};return _0x2131c0;}})});}_0xa979d7=_[_0x2462('0x3e')]({},_0xa979d7,_0x466e69['options']);var _0x2548e2={'where':_0xa979d7[_0x2462('0x3a')]};return db['AnalyticTreeReport']['count'](_0x2548e2)[_0x2462('0x24')](function(_0x4b4e0b){_0x4b7147['count']=_0x4b4e0b;if(_0x466e69[_0x2462('0x31')][_0x2462('0x3f')]){_0xa979d7['include']=[{'all':!![]}];}return db[_0x2462('0x2b')]['findAll'](_0xa979d7);})[_0x2462('0x24')](function(_0x29fb6c){_0x4b7147['rows']=_0x29fb6c;return _0x4b7147;})[_0x2462('0x24')](respondWithFilteredResult(_0x1f378d,_0xa979d7))[_0x2462('0x40')](handleError(_0x1f378d,null));};exports[_0x2462('0x41')]=function(_0x5b2a63,_0x5b2fd7){var _0x4194b1={'raw':!![],'where':{'id':_0x5b2a63[_0x2462('0x42')]['id']}},_0x4cdd5f={};_0x4cdd5f[_0x2462('0x2f')]=_[_0x2462('0x30')](db[_0x2462('0x2b')][_0x2462('0x2c')]);_0x4cdd5f[_0x2462('0x31')]=_['keys'](_0x5b2a63[_0x2462('0x31')]);_0x4cdd5f[_0x2462('0x32')]=_[_0x2462('0x33')](_0x4cdd5f[_0x2462('0x2f')],_0x4cdd5f[_0x2462('0x31')]);_0x4194b1[_0x2462('0x35')]=_[_0x2462('0x33')](_0x4cdd5f[_0x2462('0x2f')],qs[_0x2462('0x34')](_0x5b2a63['query'][_0x2462('0x34')]));_0x4194b1[_0x2462('0x35')]=_0x4194b1[_0x2462('0x35')][_0x2462('0x36')]?_0x4194b1[_0x2462('0x35')]:_0x4cdd5f['model'];if(_0x5b2a63[_0x2462('0x31')][_0x2462('0x3f')]){_0x4194b1[_0x2462('0x43')]=[{'all':!![]}];}_0x4194b1=_[_0x2462('0x3e')]({},_0x4194b1,_0x5b2a63[_0x2462('0x44')]);return db[_0x2462('0x2b')][_0x2462('0x45')](_0x4194b1)['then'](handleEntityNotFound(_0x5b2fd7,null))[_0x2462('0x24')](respondWithResult(_0x5b2fd7,null))[_0x2462('0x40')](handleError(_0x5b2fd7,null));};exports[_0x2462('0x46')]=function(_0x1ec094,_0x4da2ed){return db['AnalyticTreeReport'][_0x2462('0x46')](_0x1ec094[_0x2462('0x47')],{})[_0x2462('0x24')](respondWithResult(_0x4da2ed,0xc9))[_0x2462('0x40')](handleError(_0x4da2ed,null));};exports[_0x2462('0x22')]=function(_0x1a8624,_0x595178){if(_0x1a8624['body']['id']){delete _0x1a8624['body']['id'];}return db[_0x2462('0x2b')]['find']({'where':{'id':_0x1a8624[_0x2462('0x42')]['id']}})['then'](handleEntityNotFound(_0x595178,null))[_0x2462('0x24')](saveUpdates(_0x1a8624[_0x2462('0x47')],null))[_0x2462('0x24')](respondWithResult(_0x595178,null))[_0x2462('0x40')](handleError(_0x595178,null));};exports[_0x2462('0x23')]=function(_0x27de88,_0x6c4ead){return db[_0x2462('0x2b')][_0x2462('0x45')]({'where':{'id':_0x27de88[_0x2462('0x42')]['id']}})['then'](handleEntityNotFound(_0x6c4ead,null))[_0x2462('0x24')](removeEntity(_0x6c4ead,null))[_0x2462('0x40')](handleError(_0x6c4ead,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f5be27d..cec2df1 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 _0x6941=['analytics_report_trees','util','moment','bluebird','request-promise','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x368abe,_0x263c91){var _0x43a451=function(_0x11eaa0){while(--_0x11eaa0){_0x368abe['push'](_0x368abe['shift']());}};_0x43a451(++_0x263c91);}(_0x6941,0x9a));var _0x1694=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x6941[_0x29b609];return _0x54c952;};'use strict';var _=require('lodash');var util=require(_0x1694('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1694('0x1'));var BPromise=require(_0x1694('0x2'));var rp=require(_0x1694('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1694('0x4'));var attributes=require(_0x1694('0x5'));module['exports']=function(_0x45114a,_0x13ca71){return _0x45114a[_0x1694('0x6')](_0x1694('0x7'),attributes,{'tableName':_0x1694('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8100=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x8100,0x1bc));var _0x0810=function(_0x4aec26,_0x3e5180){_0x4aec26=_0x4aec26-0x0;var _0x2ce511=_0x8100[_0x4aec26];return _0x2ce511;};'use strict';var _=require(_0x0810('0x0'));var util=require(_0x0810('0x1'));var logger=require('../../config/logger')(_0x0810('0x2'));var moment=require(_0x0810('0x3'));var BPromise=require('bluebird');var rp=require(_0x0810('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0810('0x5'));var config=require(_0x0810('0x6'));var attributes=require(_0x0810('0x7'));module[_0x0810('0x8')]=function(_0x36f0c1,_0x5b0603){return _0x36f0c1[_0x0810('0x9')](_0x0810('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 819dae2..9dde2a4 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1351ab,_0x59b0e7){var _0x39d3e9=function(_0x3a5778){while(--_0x3a5778){_0x1351ab['push'](_0x1351ab['shift']());}};_0x39d3e9(++_0x59b0e7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x75c71e,_0x2455f8){_0x75c71e=_0x75c71e-0x0;var _0x1e6975=_0x5f2f[_0x75c71e];return _0x1e6975;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +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(_0x1b56e7,_0x3291e3){var _0x2347d4=function(_0x2f88f7){while(--_0x2f88f7){_0x1b56e7['push'](_0x1b56e7['shift']());}};_0x2347d4(++_0x3291e3);}(_0x2ef3,0xba));var _0x32ef=function(_0x446e62,_0x33bf0c){_0x446e62=_0x446e62-0x0;var _0x3c9b7b=_0x2ef3[_0x446e62];return _0x3c9b7b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 53b0ec8..3d06e41 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 _0xfd5a=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3a61e2,_0xd14b4c){var _0x36400e=function(_0x381afb){while(--_0x381afb){_0x3a61e2['push'](_0x3a61e2['shift']());}};_0x36400e(++_0xd14b4c);}(_0xfd5a,0x187));var _0xafd5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xfd5a[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xafd5('0x0'));var util=require(_0xafd5('0x1'));var path=require(_0xafd5('0x2'));var timeout=require(_0xafd5('0x3'));var express=require(_0xafd5('0x4'));var router=express['Router']();var fs_extra=require(_0xafd5('0x5'));var auth=require(_0xafd5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xafd5('0x7'));var controller=require(_0xafd5('0x8'));router[_0xafd5('0x9')]('/',auth[_0xafd5('0xa')](),controller[_0xafd5('0xb')]);router[_0xafd5('0x9')](_0xafd5('0xc'),auth[_0xafd5('0xa')](),controller[_0xafd5('0xd')]);router[_0xafd5('0xe')]('/',auth[_0xafd5('0xa')](),controller[_0xafd5('0xf')]);router[_0xafd5('0x10')](_0xafd5('0xc'),auth[_0xafd5('0xa')](),controller['update']);router['delete'](_0xafd5('0xc'),auth[_0xafd5('0xa')](),controller[_0xafd5('0x11')]);module[_0xafd5('0x12')]=router; \ No newline at end of file +var _0xceb9=['/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x41ad31,_0x4a24e3){var _0x54bf20=function(_0x1f1389){while(--_0x1f1389){_0x41ad31['push'](_0x41ad31['shift']());}};_0x54bf20(++_0x4a24e3);}(_0xceb9,0xd2));var _0x9ceb=function(_0x3c5ce6,_0x3a3a10){_0x3c5ce6=_0x3c5ce6-0x0;var _0x3d7430=_0xceb9[_0x3c5ce6];return _0x3d7430;};'use strict';var multer=require(_0x9ceb('0x0'));var util=require(_0x9ceb('0x1'));var path=require(_0x9ceb('0x2'));var timeout=require(_0x9ceb('0x3'));var express=require(_0x9ceb('0x4'));var router=express['Router']();var fs_extra=require(_0x9ceb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ceb('0x6'));var config=require(_0x9ceb('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x9ceb('0x8')]('/',auth[_0x9ceb('0x9')](),controller[_0x9ceb('0xa')]);router[_0x9ceb('0x8')](_0x9ceb('0xb'),auth[_0x9ceb('0x9')](),controller[_0x9ceb('0xc')]);router[_0x9ceb('0xd')]('/',auth[_0x9ceb('0x9')](),controller['create']);router[_0x9ceb('0xe')](_0x9ceb('0xb'),auth[_0x9ceb('0x9')](),controller[_0x9ceb('0xf')]);router['delete'](_0x9ceb('0xb'),auth[_0x9ceb('0x9')](),controller['destroy']);module[_0x9ceb('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e9d6a51..ed180f4 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 _0x07c3=['sequelize','exports','STRING'];(function(_0x4576b7,_0x50057b){var _0x3a81e0=function(_0x5e2814){while(--_0x5e2814){_0x4576b7['push'](_0x4576b7['shift']());}};_0x3a81e0(++_0x50057b);}(_0x07c3,0x1bf));var _0x307c=function(_0x5e8602,_0x2ce012){_0x5e8602=_0x5e8602-0x0;var _0x4434fb=_0x07c3[_0x5e8602];return _0x4434fb;};'use strict';var Sequelize=require(_0x307c('0x0'));module[_0x307c('0x1')]={'name':{'type':Sequelize[_0x307c('0x2')]},'basename':{'type':Sequelize[_0x307c('0x2')]},'type':{'type':Sequelize[_0x307c('0x2')]}}; \ No newline at end of file +var _0x35aa=['exports','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x35aa,0xbe));var _0xa35a=function(_0x59d32c,_0x306b7a){_0x59d32c=_0x59d32c-0x0;var _0x26e818=_0x35aa[_0x59d32c];return _0x26e818;};'use strict';var Sequelize=require('sequelize');module[_0xa35a('0x0')]={'name':{'type':Sequelize[_0xa35a('0x1')]},'basename':{'type':Sequelize[_0xa35a('0x1')]},'type':{'type':Sequelize[_0xa35a('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index ba3bfcb..f0a4aa1 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 _0x2a28=['rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','includeAll','find','clone','get','omit','body','createdAt','updatedAt','create','update','destroy','originalname','basename','file','filename','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','stack','name','send','index','map','Attachment'];(function(_0x54cd83,_0xfab969){var _0x479a08=function(_0x3ee6f4){while(--_0x3ee6f4){_0x54cd83['push'](_0x54cd83['shift']());}};_0x479a08(++_0xfab969);}(_0x2a28,0x87));var _0x82a2=function(_0x1bf876,_0x5e95bb){_0x1bf876=_0x1bf876-0x0;var _0x5706ef=_0x2a28[_0x1bf876];return _0x5706ef;};'use strict';var emlformat=require(_0x82a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x82a2('0x1'));var rp=require(_0x82a2('0x2'));var moment=require(_0x82a2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x82a2('0x4'));var util=require('util');var path=require(_0x82a2('0x5'));var sox=require(_0x82a2('0x6'));var csv=require(_0x82a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82a2('0x8'));var _=require(_0x82a2('0x9'));var squel=require(_0x82a2('0xa'));var crypto=require(_0x82a2('0xb'));var jsforce=require(_0x82a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x82a2('0x7'));var querystring=require(_0x82a2('0xd'));var Papa=require(_0x82a2('0xe'));var Redis=require(_0x82a2('0xf'));var authService=require(_0x82a2('0x10'));var qs=require(_0x82a2('0x11'));var as=require(_0x82a2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x82a2('0x13'));var utils=require(_0x82a2('0x14'));var config=require(_0x82a2('0x15'));var licenseUtil=require(_0x82a2('0x16'));var db=require(_0x82a2('0x17'))['db'];function respondWithStatusCode(_0x3510e2,_0x445c4a){_0x445c4a=_0x445c4a||0xcc;return function(_0x52864d){if(_0x52864d){return _0x3510e2[_0x82a2('0x18')](_0x445c4a);}return _0x3510e2[_0x82a2('0x19')](_0x445c4a)[_0x82a2('0x1a')]();};}function respondWithResult(_0x2d0c8b,_0x1d9623){_0x1d9623=_0x1d9623||0xc8;return function(_0x5bde45){if(_0x5bde45){return _0x2d0c8b[_0x82a2('0x19')](_0x1d9623)['json'](_0x5bde45);}};}function respondWithFilteredResult(_0x1f165f,_0x1dffc5){return function(_0x2d141e){if(_0x2d141e){var _0xf458f5=typeof _0x1dffc5[_0x82a2('0x1b')]===_0x82a2('0x1c')&&typeof _0x1dffc5['limit']==='undefined';var _0x5ad828=_0x2d141e[_0x82a2('0x1d')];var _0x4150e2=_0xf458f5?0x0:_0x1dffc5[_0x82a2('0x1b')];var _0x14930e=_0xf458f5?_0x2d141e[_0x82a2('0x1d')]:_0x1dffc5['offset']+_0x1dffc5[_0x82a2('0x1e')];var _0x5ee26f;if(_0x14930e>=_0x5ad828){_0x14930e=_0x5ad828;_0x5ee26f=0xc8;}else{_0x5ee26f=0xce;}_0x1f165f[_0x82a2('0x19')](_0x5ee26f);return _0x1f165f[_0x82a2('0x1f')](_0x82a2('0x20'),_0x4150e2+'-'+_0x14930e+'/'+_0x5ad828)[_0x82a2('0x21')](_0x2d141e);}return null;};}function patchUpdates(_0x568e37){return function(_0x4e2045){try{jsonpatch[_0x82a2('0x22')](_0x4e2045,_0x568e37,!![]);}catch(_0x1eb8e7){return BPromise[_0x82a2('0x23')](_0x1eb8e7);}return _0x4e2045['save']();};}function saveUpdates(_0x374c47,_0x1fd0df){return function(_0xc23d82){if(_0xc23d82){return _0xc23d82['update'](_0x374c47)[_0x82a2('0x24')](function(_0x4e59aa){return _0x4e59aa;});}return null;};}function removeEntity(_0x32d0df,_0x29134e){return function(_0x588ad5){if(_0x588ad5){return _0x588ad5['destroy']()[_0x82a2('0x24')](function(){_0x32d0df[_0x82a2('0x19')](0xcc)[_0x82a2('0x1a')]();});}};}function handleEntityNotFound(_0x13f37c,_0x524d34){return function(_0x21d965){if(!_0x21d965){_0x13f37c[_0x82a2('0x18')](0x194);}return _0x21d965;};}function handleError(_0x406ca7,_0x46b827){_0x46b827=_0x46b827||0x1f4;return function(_0x1402d3){logger['error'](_0x1402d3[_0x82a2('0x25')]);if(_0x1402d3[_0x82a2('0x26')]){delete _0x1402d3[_0x82a2('0x26')];}_0x406ca7[_0x82a2('0x19')](_0x46b827)[_0x82a2('0x27')](_0x1402d3);};}exports[_0x82a2('0x28')]=function(_0x440367,_0x1a8fcd){var _0x1fffed={},_0x1f5633={},_0x2aff3a={'count':0x0,'rows':[]};var _0x2ba71c=_[_0x82a2('0x29')](db[_0x82a2('0x2a')][_0x82a2('0x2b')],function(_0x2b824e){return{'name':_0x2b824e[_0x82a2('0x2c')],'type':_0x2b824e[_0x82a2('0x2d')]['key']};});_0x1f5633[_0x82a2('0x2e')]=_['map'](_0x2ba71c,_0x82a2('0x26'));_0x1f5633[_0x82a2('0x2f')]=_[_0x82a2('0x30')](_0x440367[_0x82a2('0x2f')]);_0x1f5633['filters']=_[_0x82a2('0x31')](_0x1f5633['model'],_0x1f5633['query']);_0x1fffed[_0x82a2('0x32')]=_['intersection'](_0x1f5633['model'],qs[_0x82a2('0x33')](_0x440367[_0x82a2('0x2f')]['fields']));_0x1fffed[_0x82a2('0x32')]=_0x1fffed[_0x82a2('0x32')][_0x82a2('0x34')]?_0x1fffed['attributes']:_0x1f5633[_0x82a2('0x2e')];if(!_0x440367[_0x82a2('0x2f')][_0x82a2('0x35')](_0x82a2('0x36'))){_0x1fffed[_0x82a2('0x1e')]=qs[_0x82a2('0x1e')](_0x440367['query'][_0x82a2('0x1e')]);_0x1fffed[_0x82a2('0x1b')]=qs['offset'](_0x440367[_0x82a2('0x2f')][_0x82a2('0x1b')]);}_0x1fffed[_0x82a2('0x37')]=qs[_0x82a2('0x38')](_0x440367[_0x82a2('0x2f')][_0x82a2('0x38')]);_0x1fffed[_0x82a2('0x39')]=qs[_0x82a2('0x3a')](_[_0x82a2('0x3b')](_0x440367[_0x82a2('0x2f')],_0x1f5633[_0x82a2('0x3a')]),_0x2ba71c);if(_0x440367[_0x82a2('0x2f')]['filter']){_0x1fffed[_0x82a2('0x39')]=_[_0x82a2('0x3c')](_0x1fffed[_0x82a2('0x39')],{'$or':_[_0x82a2('0x29')](_0x2ba71c,function(_0x3dd833){if(_0x3dd833[_0x82a2('0x2d')]!==_0x82a2('0x3d')){var _0x40c590={};_0x40c590[_0x3dd833['name']]={'$like':'%'+_0x440367[_0x82a2('0x2f')][_0x82a2('0x3e')]+'%'};return _0x40c590;}})});}_0x1fffed=_[_0x82a2('0x3c')]({},_0x1fffed,_0x440367[_0x82a2('0x3f')]);var _0x434351={'where':_0x1fffed[_0x82a2('0x39')]};return db['Attachment'][_0x82a2('0x1d')](_0x434351)[_0x82a2('0x24')](function(_0x30bcef){_0x2aff3a[_0x82a2('0x1d')]=_0x30bcef;if(_0x440367[_0x82a2('0x2f')]['includeAll']){_0x1fffed[_0x82a2('0x40')]=[{'all':!![]}];}return db[_0x82a2('0x2a')][_0x82a2('0x41')](_0x1fffed);})[_0x82a2('0x24')](function(_0x256043){_0x2aff3a['rows']=_0x256043;return _0x2aff3a;})['then'](respondWithFilteredResult(_0x1a8fcd,_0x1fffed))[_0x82a2('0x42')](handleError(_0x1a8fcd,null));};exports[_0x82a2('0x43')]=function(_0x4a7851,_0x305c74){var _0x37467c={'raw':!![],'where':{'id':_0x4a7851[_0x82a2('0x44')]['id']}},_0x48f9bd={};_0x48f9bd[_0x82a2('0x2e')]=_[_0x82a2('0x30')](db[_0x82a2('0x2a')][_0x82a2('0x2b')]);_0x48f9bd[_0x82a2('0x2f')]=_[_0x82a2('0x30')](_0x4a7851[_0x82a2('0x2f')]);_0x48f9bd[_0x82a2('0x3a')]=_[_0x82a2('0x31')](_0x48f9bd[_0x82a2('0x2e')],_0x48f9bd[_0x82a2('0x2f')]);_0x37467c[_0x82a2('0x32')]=_[_0x82a2('0x31')](_0x48f9bd[_0x82a2('0x2e')],qs[_0x82a2('0x33')](_0x4a7851[_0x82a2('0x2f')][_0x82a2('0x33')]));_0x37467c[_0x82a2('0x32')]=_0x37467c['attributes'][_0x82a2('0x34')]?_0x37467c[_0x82a2('0x32')]:_0x48f9bd[_0x82a2('0x2e')];if(_0x4a7851[_0x82a2('0x2f')][_0x82a2('0x45')]){_0x37467c[_0x82a2('0x40')]=[{'all':!![]}];}_0x37467c=_[_0x82a2('0x3c')]({},_0x37467c,_0x4a7851[_0x82a2('0x3f')]);return db[_0x82a2('0x2a')][_0x82a2('0x46')](_0x37467c)[_0x82a2('0x24')](handleEntityNotFound(_0x305c74,null))[_0x82a2('0x24')](respondWithResult(_0x305c74,null))[_0x82a2('0x42')](handleError(_0x305c74,null));};exports[_0x82a2('0x47')]=function(_0x5b56ac,_0x11c39e){var _0x2e9d5b={'where':{'id':_0x5b56ac[_0x82a2('0x44')]['id']}},_0x2fe2aa={};_0x2fe2aa[_0x82a2('0x2e')]=_[_0x82a2('0x30')](db[_0x82a2('0x2a')][_0x82a2('0x2b')]);_0x2e9d5b['attributes']=_['intersection'](_0x2fe2aa[_0x82a2('0x2e')],qs[_0x82a2('0x33')](_0x5b56ac[_0x82a2('0x2f')][_0x82a2('0x33')]));_0x2e9d5b[_0x82a2('0x32')]=_0x2e9d5b['attributes'][_0x82a2('0x34')]?_0x2e9d5b[_0x82a2('0x32')]:_0x2fe2aa[_0x82a2('0x2e')];if(_0x5b56ac[_0x82a2('0x2f')][_0x82a2('0x45')]){_0x2e9d5b[_0x82a2('0x40')]=[{'all':!![]}];}_0x2e9d5b=_[_0x82a2('0x3c')]({},_0x2e9d5b,_0x5b56ac['options']);return db[_0x82a2('0x2a')][_0x82a2('0x46')](_0x2e9d5b)[_0x82a2('0x24')](handleEntityNotFound(_0x11c39e,null))[_0x82a2('0x24')](function(_0x1590f7){if(_0x1590f7){var _0x562565=_0x1590f7[_0x82a2('0x48')]({'plain':!![]});_0x562565=qs[_0x82a2('0x49')](_0x562565,['id','createdAt','updatedAt']);_0x5b56ac[_0x82a2('0x4a')]=_[_0x82a2('0x49')](_0x5b56ac[_0x82a2('0x4a')],['id',_0x82a2('0x4b'),_0x82a2('0x4c')]);return db[_0x82a2('0x2a')][_0x82a2('0x4d')](_[_0x82a2('0x3c')](_0x562565,_0x5b56ac[_0x82a2('0x4a')]),{'include':_0x5b56ac[_0x82a2('0x2f')][_0x82a2('0x45')]?[{'all':!![]}]:undefined});}})[_0x82a2('0x24')](respondWithResult(_0x11c39e,0xc9))[_0x82a2('0x42')](handleError(_0x11c39e,null));};exports[_0x82a2('0x4e')]=function(_0x436b79,_0x55a431){if(_0x436b79[_0x82a2('0x4a')]['id']){delete _0x436b79[_0x82a2('0x4a')]['id'];}return db[_0x82a2('0x2a')][_0x82a2('0x46')]({'where':{'id':_0x436b79[_0x82a2('0x44')]['id']}})[_0x82a2('0x24')](handleEntityNotFound(_0x55a431,null))[_0x82a2('0x24')](saveUpdates(_0x436b79['body'],null))[_0x82a2('0x24')](respondWithResult(_0x55a431,null))[_0x82a2('0x42')](handleError(_0x55a431,null));};exports[_0x82a2('0x4f')]=function(_0x21efb1,_0x11d50c){return db['Attachment'][_0x82a2('0x46')]({'where':{'id':_0x21efb1[_0x82a2('0x44')]['id']}})[_0x82a2('0x24')](handleEntityNotFound(_0x11d50c,null))[_0x82a2('0x24')](removeEntity(_0x11d50c,null))['catch'](handleError(_0x11d50c,null));};exports[_0x82a2('0x4d')]=function(_0x3ca384,_0x45ec58,_0x81513a){_0x3ca384['body']['name']=_0x3ca384['file'][_0x82a2('0x50')];_0x3ca384[_0x82a2('0x4a')][_0x82a2('0x51')]=_0x3ca384[_0x82a2('0x52')][_0x82a2('0x53')];_0x3ca384[_0x82a2('0x4a')][_0x82a2('0x2d')]=_0x3ca384['file']['mimetype'];return db[_0x82a2('0x2a')][_0x82a2('0x4d')](_0x3ca384['body'])[_0x82a2('0x24')](respondWithResult(_0x45ec58,0xc9))[_0x82a2('0x42')](handleError(_0x45ec58,null));};exports[_0x82a2('0x54')]=function(_0xaf4344,_0xc7bb53,_0x37f064){return db[_0x82a2('0x2a')][_0x82a2('0x55')]({'where':{'id':_0xaf4344[_0x82a2('0x44')]['id']},'raw':!![]})[_0x82a2('0x24')](handleEntityNotFound(_0xc7bb53,null))['then'](function(_0x33ed49){if(_0x33ed49){var _0x330100=_0x33ed49[_0x82a2('0x56')]!==null;var _0xb3ba52=path['join'](config['root'],_0x82a2('0x57'));if(_0x330100){_0xb3ba52=path[_0x82a2('0x58')](_0xb3ba52,'offline-chat/');}var _0x1c1027=path['join'](_0xb3ba52,_0x33ed49[_0x82a2('0x51')]);return _0xc7bb53['download'](_0x1c1027);}})[_0x82a2('0x42')](handleError(_0xc7bb53,null));}; \ No newline at end of file +var _0x71c6=['omit','update','create','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','moment','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','Attachment','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','params','keys','length','find','clone','rawAttributes','get','createdAt','updatedAt','body'];(function(_0x1e2eec,_0x51b5ba){var _0x4b438b=function(_0x150105){while(--_0x150105){_0x1e2eec['push'](_0x1e2eec['shift']());}};_0x4b438b(++_0x51b5ba);}(_0x71c6,0x66));var _0x671c=function(_0xecac3a,_0x404efc){_0xecac3a=_0xecac3a-0x0;var _0x49c859=_0x71c6[_0xecac3a];return _0x49c859;};'use strict';var emlformat=require(_0x671c('0x0'));var rimraf=require(_0x671c('0x1'));var zipdir=require(_0x671c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x671c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x671c('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x671c('0x5'));var fs=require('fs');var fs_extra=require(_0x671c('0x6'));var _=require(_0x671c('0x7'));var squel=require(_0x671c('0x8'));var crypto=require(_0x671c('0x9'));var jsforce=require(_0x671c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x671c('0xb'));var Papa=require(_0x671c('0xc'));var Redis=require(_0x671c('0xd'));var authService=require(_0x671c('0xe'));var qs=require(_0x671c('0xf'));var as=require(_0x671c('0x10'));var hardwareService=require(_0x671c('0x11'));var logger=require('../../config/logger')(_0x671c('0x12'));var utils=require(_0x671c('0x13'));var config=require(_0x671c('0x14'));var licenseUtil=require(_0x671c('0x15'));var db=require(_0x671c('0x16'))['db'];function respondWithStatusCode(_0xb138dc,_0xc7b004){_0xc7b004=_0xc7b004||0xcc;return function(_0x8d55e3){if(_0x8d55e3){return _0xb138dc[_0x671c('0x17')](_0xc7b004);}return _0xb138dc['status'](_0xc7b004)[_0x671c('0x18')]();};}function respondWithResult(_0x1d69ca,_0x1e9cbe){_0x1e9cbe=_0x1e9cbe||0xc8;return function(_0x50b7d6){if(_0x50b7d6){return _0x1d69ca[_0x671c('0x19')](_0x1e9cbe)[_0x671c('0x1a')](_0x50b7d6);}};}function respondWithFilteredResult(_0x4c99d6,_0x14d2db){return function(_0x517080){if(_0x517080){var _0x113d18=typeof _0x14d2db[_0x671c('0x1b')]===_0x671c('0x1c')&&typeof _0x14d2db[_0x671c('0x1d')]===_0x671c('0x1c');var _0x5c2f2d=_0x517080['count'];var _0x5cb7e8=_0x113d18?0x0:_0x14d2db['offset'];var _0x4ec218=_0x113d18?_0x517080[_0x671c('0x1e')]:_0x14d2db[_0x671c('0x1b')]+_0x14d2db['limit'];var _0x51c43c;if(_0x4ec218>=_0x5c2f2d){_0x4ec218=_0x5c2f2d;_0x51c43c=0xc8;}else{_0x51c43c=0xce;}_0x4c99d6[_0x671c('0x19')](_0x51c43c);return _0x4c99d6[_0x671c('0x1f')](_0x671c('0x20'),_0x5cb7e8+'-'+_0x4ec218+'/'+_0x5c2f2d)[_0x671c('0x1a')](_0x517080);}return null;};}function patchUpdates(_0x5a02fa){return function(_0x3ae21d){try{jsonpatch[_0x671c('0x21')](_0x3ae21d,_0x5a02fa,!![]);}catch(_0x13cee8){return BPromise[_0x671c('0x22')](_0x13cee8);}return _0x3ae21d[_0x671c('0x23')]();};}function saveUpdates(_0x2a2dfd,_0x39059a){return function(_0x44590e){if(_0x44590e){return _0x44590e['update'](_0x2a2dfd)[_0x671c('0x24')](function(_0x5bc745){return _0x5bc745;});}return null;};}function removeEntity(_0xc6ed25,_0x23a15a){return function(_0x29f809){if(_0x29f809){return _0x29f809[_0x671c('0x25')]()['then'](function(){_0xc6ed25[_0x671c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5475f5,_0x1df127){return function(_0x1fafba){if(!_0x1fafba){_0x5475f5[_0x671c('0x17')](0x194);}return _0x1fafba;};}function handleError(_0x4ef922,_0x544e90){_0x544e90=_0x544e90||0x1f4;return function(_0x40ab74){logger[_0x671c('0x26')](_0x40ab74[_0x671c('0x27')]);if(_0x40ab74[_0x671c('0x28')]){delete _0x40ab74[_0x671c('0x28')];}_0x4ef922['status'](_0x544e90)[_0x671c('0x29')](_0x40ab74);};}exports[_0x671c('0x2a')]=function(_0x47e106,_0x58d8e1){var _0x1d0df1={},_0x342588={},_0x2779dc={'count':0x0,'rows':[]};var _0x1d9ea7=_[_0x671c('0x2b')](db[_0x671c('0x2c')]['rawAttributes'],function(_0x557200){return{'name':_0x557200['fieldName'],'type':_0x557200[_0x671c('0x2d')]['key']};});_0x342588['model']=_['map'](_0x1d9ea7,'name');_0x342588[_0x671c('0x2e')]=_['keys'](_0x47e106[_0x671c('0x2e')]);_0x342588[_0x671c('0x2f')]=_[_0x671c('0x30')](_0x342588['model'],_0x342588['query']);_0x1d0df1[_0x671c('0x31')]=_[_0x671c('0x30')](_0x342588[_0x671c('0x32')],qs[_0x671c('0x33')](_0x47e106[_0x671c('0x2e')][_0x671c('0x33')]));_0x1d0df1[_0x671c('0x31')]=_0x1d0df1[_0x671c('0x31')]['length']?_0x1d0df1[_0x671c('0x31')]:_0x342588[_0x671c('0x32')];if(!_0x47e106[_0x671c('0x2e')][_0x671c('0x34')](_0x671c('0x35'))){_0x1d0df1[_0x671c('0x1d')]=qs[_0x671c('0x1d')](_0x47e106[_0x671c('0x2e')][_0x671c('0x1d')]);_0x1d0df1['offset']=qs['offset'](_0x47e106[_0x671c('0x2e')][_0x671c('0x1b')]);}_0x1d0df1[_0x671c('0x36')]=qs[_0x671c('0x37')](_0x47e106[_0x671c('0x2e')]['sort']);_0x1d0df1[_0x671c('0x38')]=qs[_0x671c('0x2f')](_[_0x671c('0x39')](_0x47e106[_0x671c('0x2e')],_0x342588[_0x671c('0x2f')]),_0x1d9ea7);if(_0x47e106[_0x671c('0x2e')][_0x671c('0x3a')]){_0x1d0df1[_0x671c('0x38')]=_['merge'](_0x1d0df1['where'],{'$or':_[_0x671c('0x2b')](_0x1d9ea7,function(_0xe945b7){if(_0xe945b7[_0x671c('0x2d')]!=='VIRTUAL'){var _0x444274={};_0x444274[_0xe945b7[_0x671c('0x28')]]={'$like':'%'+_0x47e106[_0x671c('0x2e')][_0x671c('0x3a')]+'%'};return _0x444274;}})});}_0x1d0df1=_[_0x671c('0x3b')]({},_0x1d0df1,_0x47e106[_0x671c('0x3c')]);var _0x472635={'where':_0x1d0df1[_0x671c('0x38')]};return db[_0x671c('0x2c')]['count'](_0x472635)['then'](function(_0x32ac91){_0x2779dc[_0x671c('0x1e')]=_0x32ac91;if(_0x47e106[_0x671c('0x2e')][_0x671c('0x3d')]){_0x1d0df1[_0x671c('0x3e')]=[{'all':!![]}];}return db[_0x671c('0x2c')]['findAll'](_0x1d0df1);})[_0x671c('0x24')](function(_0x2cc8d5){_0x2779dc['rows']=_0x2cc8d5;return _0x2779dc;})[_0x671c('0x24')](respondWithFilteredResult(_0x58d8e1,_0x1d0df1))[_0x671c('0x3f')](handleError(_0x58d8e1,null));};exports['show']=function(_0x1b0feb,_0x1e3286){var _0x1957de={'raw':!![],'where':{'id':_0x1b0feb[_0x671c('0x40')]['id']}},_0x96935={};_0x96935[_0x671c('0x32')]=_[_0x671c('0x41')](db[_0x671c('0x2c')]['rawAttributes']);_0x96935[_0x671c('0x2e')]=_['keys'](_0x1b0feb['query']);_0x96935[_0x671c('0x2f')]=_['intersection'](_0x96935[_0x671c('0x32')],_0x96935[_0x671c('0x2e')]);_0x1957de[_0x671c('0x31')]=_[_0x671c('0x30')](_0x96935[_0x671c('0x32')],qs['fields'](_0x1b0feb[_0x671c('0x2e')]['fields']));_0x1957de['attributes']=_0x1957de[_0x671c('0x31')][_0x671c('0x42')]?_0x1957de[_0x671c('0x31')]:_0x96935[_0x671c('0x32')];if(_0x1b0feb[_0x671c('0x2e')][_0x671c('0x3d')]){_0x1957de[_0x671c('0x3e')]=[{'all':!![]}];}_0x1957de=_['merge']({},_0x1957de,_0x1b0feb[_0x671c('0x3c')]);return db[_0x671c('0x2c')][_0x671c('0x43')](_0x1957de)[_0x671c('0x24')](handleEntityNotFound(_0x1e3286,null))[_0x671c('0x24')](respondWithResult(_0x1e3286,null))['catch'](handleError(_0x1e3286,null));};exports[_0x671c('0x44')]=function(_0x5b31d1,_0x2bf936){var _0x2d07e4={'where':{'id':_0x5b31d1[_0x671c('0x40')]['id']}},_0x510956={};_0x510956[_0x671c('0x32')]=_['keys'](db[_0x671c('0x2c')][_0x671c('0x45')]);_0x2d07e4[_0x671c('0x31')]=_[_0x671c('0x30')](_0x510956['model'],qs[_0x671c('0x33')](_0x5b31d1[_0x671c('0x2e')][_0x671c('0x33')]));_0x2d07e4[_0x671c('0x31')]=_0x2d07e4[_0x671c('0x31')][_0x671c('0x42')]?_0x2d07e4[_0x671c('0x31')]:_0x510956['model'];if(_0x5b31d1[_0x671c('0x2e')][_0x671c('0x3d')]){_0x2d07e4[_0x671c('0x3e')]=[{'all':!![]}];}_0x2d07e4=_['merge']({},_0x2d07e4,_0x5b31d1[_0x671c('0x3c')]);return db[_0x671c('0x2c')][_0x671c('0x43')](_0x2d07e4)[_0x671c('0x24')](handleEntityNotFound(_0x2bf936,null))[_0x671c('0x24')](function(_0x188c4d){if(_0x188c4d){var _0x4aefa3=_0x188c4d[_0x671c('0x46')]({'plain':!![]});_0x4aefa3=qs['omit'](_0x4aefa3,['id',_0x671c('0x47'),_0x671c('0x48')]);_0x5b31d1[_0x671c('0x49')]=_[_0x671c('0x4a')](_0x5b31d1['body'],['id',_0x671c('0x47'),_0x671c('0x48')]);return db[_0x671c('0x2c')]['create'](_[_0x671c('0x3b')](_0x4aefa3,_0x5b31d1[_0x671c('0x49')]),{'include':_0x5b31d1['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x671c('0x24')](respondWithResult(_0x2bf936,0xc9))[_0x671c('0x3f')](handleError(_0x2bf936,null));};exports[_0x671c('0x4b')]=function(_0x52c679,_0x391152){if(_0x52c679[_0x671c('0x49')]['id']){delete _0x52c679[_0x671c('0x49')]['id'];}return db[_0x671c('0x2c')]['find']({'where':{'id':_0x52c679[_0x671c('0x40')]['id']}})['then'](handleEntityNotFound(_0x391152,null))[_0x671c('0x24')](saveUpdates(_0x52c679[_0x671c('0x49')],null))['then'](respondWithResult(_0x391152,null))[_0x671c('0x3f')](handleError(_0x391152,null));};exports['destroy']=function(_0x1ca720,_0x4b8273){return db[_0x671c('0x2c')]['find']({'where':{'id':_0x1ca720[_0x671c('0x40')]['id']}})[_0x671c('0x24')](handleEntityNotFound(_0x4b8273,null))['then'](removeEntity(_0x4b8273,null))[_0x671c('0x3f')](handleError(_0x4b8273,null));};exports[_0x671c('0x4c')]=function(_0x49d438,_0x1a7e2b,_0x3e6746){_0x49d438['body']['name']=_0x49d438[_0x671c('0x4d')][_0x671c('0x4e')];_0x49d438['body']['basename']=_0x49d438[_0x671c('0x4d')][_0x671c('0x4f')];_0x49d438['body'][_0x671c('0x2d')]=_0x49d438[_0x671c('0x4d')][_0x671c('0x50')];return db[_0x671c('0x2c')]['create'](_0x49d438[_0x671c('0x49')])[_0x671c('0x24')](respondWithResult(_0x1a7e2b,0xc9))['catch'](handleError(_0x1a7e2b,null));};exports['download']=function(_0x366deb,_0x233fd4,_0xf36002){return db[_0x671c('0x2c')][_0x671c('0x51')]({'where':{'id':_0x366deb[_0x671c('0x40')]['id']},'raw':!![]})[_0x671c('0x24')](handleEntityNotFound(_0x233fd4,null))[_0x671c('0x24')](function(_0xd00b2a){if(_0xd00b2a){var _0x55524d=_0xd00b2a[_0x671c('0x52')]!==null;var _0xe08f69=path[_0x671c('0x53')](config[_0x671c('0x54')],_0x671c('0x55'));if(_0x55524d){_0xe08f69=path['join'](_0xe08f69,_0x671c('0x56'));}var _0x43151f=path['join'](_0xe08f69,_0xd00b2a['basename']);return _0x233fd4[_0x671c('0x57')](_0x43151f);}})[_0x671c('0x3f')](handleError(_0x233fd4,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 1556795..387da38 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 _0x1239=['./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x502414,_0x550420){var _0x2c9221=function(_0x274164){while(--_0x274164){_0x502414['push'](_0x502414['shift']());}};_0x2c9221(++_0x550420);}(_0x1239,0x64));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9123('0x0'));var util=require(_0x9123('0x1'));var logger=require(_0x9123('0x2'))('api');var moment=require(_0x9123('0x3'));var BPromise=require('bluebird');var rp=require(_0x9123('0x4'));var fs=require('fs');var path=require(_0x9123('0x5'));var rimraf=require(_0x9123('0x6'));var config=require(_0x9123('0x7'));var attributes=require(_0x9123('0x8'));module[_0x9123('0x9')]=function(_0x2b7fa5,_0x1cee29){return _0x2b7fa5[_0x9123('0xa')]('Attachment',attributes,{'tableName':_0x9123('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x816d=['util','../../config/logger','moment','bluebird','path','exports','define','Attachment','attachments','lodash'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0x816d,0xd1));var _0xd816=function(_0x225493,_0x4a22eb){_0x225493=_0x225493-0x0;var _0x14fa6c=_0x816d[_0x225493];return _0x14fa6c;};'use strict';var _=require(_0xd816('0x0'));var util=require(_0xd816('0x1'));var logger=require(_0xd816('0x2'))('api');var moment=require(_0xd816('0x3'));var BPromise=require(_0xd816('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd816('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xd816('0x6')]=function(_0x35adcb,_0x47bcaf){return _0x35adcb[_0xd816('0x7')](_0xd816('0x8'),attributes,{'tableName':_0xd816('0x9'),'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 2b2da2e..c96e081 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 _0xb7fc=['then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','create','body','options','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2746de,_0x516418){var _0x37c401=function(_0x5f1360){while(--_0x5f1360){_0x2746de['push'](_0x2746de['shift']());}};_0x37c401(++_0x516418);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x419560,_0x16a92c){_0x419560=_0x419560-0x0;var _0x52a0a9=_0xb7fc[_0x419560];return _0x52a0a9;};'use strict';var _=require(_0xcb7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb7f('0x1'));var rs=require(_0xcb7f('0x2'));var fs=require('fs');var Redis=require(_0xcb7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb7f('0x4'))(_0xcb7f('0x5'));var config=require(_0xcb7f('0x6'));var jayson=require(_0xcb7f('0x7'));var client=jayson[_0xcb7f('0x8')][_0xcb7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5059ca,_0x226ba8,_0x31de8e){return new BPromise(function(_0x1f8ba3,_0x4dde1f){return client[_0xcb7f('0xa')](_0x5059ca,_0x31de8e)[_0xcb7f('0xb')](function(_0x4d8d72){logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,'request\x20sent');logger[_0xcb7f('0xe')](_0xcb7f('0xf'),_0x226ba8,_0xcb7f('0x10'),JSON[_0xcb7f('0x11')](_0x4d8d72));if(_0x4d8d72[_0xcb7f('0x12')]){if(_0x4d8d72['error']['code']===0x1f4){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x4dde1f(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x1f8ba3(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}else{logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,_0xcb7f('0x10'));_0x1f8ba3(_0x4d8d72[_0xcb7f('0x14')][_0xcb7f('0x13')]);}})[_0xcb7f('0x15')](function(_0x2c2799){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x2c2799);_0x4dde1f(_0x2c2799);});});}exports[_0xcb7f('0x16')]=function(_0x5d43b6){var _0x2430b3=this;return new Promise(function(_0x1d1d4c,_0x57274b){return db['Attachment'][_0xcb7f('0x17')](_0x5d43b6[_0xcb7f('0x18')],{'raw':_0x5d43b6[_0xcb7f('0x19')]?_0x5d43b6['options']['raw']===undefined?!![]:![]:!![]})[_0xcb7f('0xb')](function(_0x55614d){logger['info']('CreateAttachment',_0x5d43b6);logger[_0xcb7f('0xe')](_0xcb7f('0x16'),_0x5d43b6,JSON['stringify'](_0x55614d));_0x1d1d4c(_0x55614d);})[_0xcb7f('0x15')](function(_0x2a791f){logger[_0xcb7f('0x12')](_0xcb7f('0x16'),_0x2a791f[_0xcb7f('0x13')],_0x5d43b6);_0x57274b(_0x2430b3[_0xcb7f('0x12')](0x1f4,_0x2a791f['message']));});});}; \ No newline at end of file +var _0x684c=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateAttachment','Attachment','create','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var moment=require('moment');var BPromise=require(_0xc684('0x2'));var rs=require(_0xc684('0x3'));var fs=require('fs');var Redis=require(_0xc684('0x4'));var db=require(_0xc684('0x5'))['db'];var utils=require(_0xc684('0x6'));var logger=require('../../config/logger')(_0xc684('0x7'));var config=require(_0xc684('0x8'));var jayson=require(_0xc684('0x9'));var client=jayson[_0xc684('0xa')][_0xc684('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57a63c,_0x23bd1c,_0x1a96ea){return new BPromise(function(_0x146733,_0xccb771){return client[_0xc684('0xc')](_0x57a63c,_0x1a96ea)[_0xc684('0xd')](function(_0x3b3bc0){logger[_0xc684('0xe')](_0xc684('0xf'),_0x23bd1c,_0xc684('0x10'));logger[_0xc684('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x23bd1c,_0xc684('0x10'),JSON[_0xc684('0x12')](_0x3b3bc0));if(_0x3b3bc0[_0xc684('0x13')]){if(_0x3b3bc0[_0xc684('0x13')][_0xc684('0x14')]===0x1f4){logger[_0xc684('0x13')]('Attachment,\x20%s,\x20%s',_0x23bd1c,_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);return _0xccb771(_0x3b3bc0['error']['message']);}logger[_0xc684('0x13')](_0xc684('0xf'),_0x23bd1c,_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);return _0x146733(_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x23bd1c,_0xc684('0x10'));_0x146733(_0x3b3bc0['result']['message']);}})['catch'](function(_0x47a8eb){logger['error'](_0xc684('0xf'),_0x23bd1c,_0x47a8eb);_0xccb771(_0x47a8eb);});});}exports[_0xc684('0x16')]=function(_0x3b6f5e){var _0x1c1b4a=this;return new Promise(function(_0x1c3af5,_0x4a14a2){return db[_0xc684('0x17')][_0xc684('0x18')](_0x3b6f5e['body'],{'raw':_0x3b6f5e[_0xc684('0x19')]?_0x3b6f5e[_0xc684('0x19')][_0xc684('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x62c4e5){logger[_0xc684('0xe')](_0xc684('0x16'),_0x3b6f5e);logger[_0xc684('0x11')](_0xc684('0x16'),_0x3b6f5e,JSON['stringify'](_0x62c4e5));_0x1c3af5(_0x62c4e5);})[_0xc684('0x1b')](function(_0x39f39a){logger[_0xc684('0x13')]('CreateAttachment',_0x39f39a['message'],_0x3b6f5e);_0x4a14a2(_0x1c1b4a['error'](0x1f4,_0x39f39a[_0xc684('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 239a905..29b65ac 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(_0x2dd53e,_0x15371f){var _0x543ccd=function(_0x392919){while(--_0x392919){_0x2dd53e['push'](_0x2dd53e['shift']());}};_0x543ccd(++_0x15371f);}(_0xb10b,0x12a));var _0xbb10=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xb10b[_0x422905];return _0x33dc6c;};'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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index e49ee4d..b65a4a9 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 _0x1705=['disabled','blockedAt','online','admin','user','blocked','add','minutes','getLicense','catch','status','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','passport','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x1705,0x1b8));var _0x5170=function(_0x499d15,_0x5376c1){_0x499d15=_0x499d15-0x0;var _0x189291=_0x1705[_0x499d15];return _0x189291;};'use strict';var passport=require(_0x5170('0x0'));var LocalStrategy=require('passport-local')[_0x5170('0x1')];var moment=require(_0x5170('0x2'));var ActiveDirectory=require(_0x5170('0x3'));var BPromise=require(_0x5170('0x4'));var util=require(_0x5170('0x5'));var db=require(_0x5170('0x6'))['db'];var authService=require(_0x5170('0x7'));var utils=require(_0x5170('0x8'));var config=require(_0x5170('0x9'));var logger=require(_0x5170('0xa'))(_0x5170('0xb'));function isActiveDirectoryConfigured(_0x14678a){var _0x2fbb05=![];if(typeof _0x14678a[_0x5170('0xc')]!=='undefined'){_0x2fbb05=_0x14678a[_0x5170('0xc')]['baseDN']&&_0x14678a[_0x5170('0xc')]['url']&&_0x14678a[_0x5170('0xc')][_0x5170('0xd')];}return _0x2fbb05;}function adAuthenticate(_0x21a281,_0x338f9f,_0x4d9d12){return new BPromise(function(_0x37811c,_0x54b506){try{var _0x1664ea=new ActiveDirectory(_0x21a281);_0x1664ea[_0x5170('0xe')](_0x338f9f,_0x4d9d12,function(_0x2991a4,_0x307d12){if(_0x2991a4){logger['error'](_0x5170('0xf'),_0x338f9f,util[_0x5170('0x10')](_0x2991a4,{'showHidden':![],'depth':null}));_0x54b506(_0x5170('0x11'));}else if(!_0x307d12){logger['error'](_0x5170('0x12'),_0x338f9f);_0x54b506(_0x5170('0x11'));}else{_0x37811c(_0x307d12);}});}catch(_0x112be7){_0x54b506(_0x112be7);}});}function ActiveDirectoryAuthenticate(_0x1df199,_0x1eea31,_0x36cefa,_0x11d73c){var _0x587a62,_0x49fdfb;if(!isActiveDirectoryConfigured(config)){logger[_0x5170('0x13')](_0x5170('0x14'),_0x1eea31);return _0x11d73c(null,![],{'message':_0x5170('0x11')});}return db[_0x5170('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0x5170('0x16'),_0x5170('0x17')],'raw':!![]})[_0x5170('0x18')](function(_0x4fb627){_0x587a62=_0x4fb627;if(!_0x587a62[_0x5170('0x16')]){logger['error'](_0x5170('0x19'),_0x1eea31);throw new Error(_0x5170('0x11'));}return _0x1df199[_0x5170('0x1a')]({'attributes':['id',_0x5170('0x1b'),_0x5170('0x1c'),_0x5170('0x1d'),'role',_0x5170('0x1e'),'blocked',_0x5170('0x1f'),_0x5170('0x20')],'where':{'name':_0x1eea31,'role':{'$or':[_0x5170('0x21'),_0x5170('0x22'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x4adcb7){if(!_0x4adcb7||_0x4adcb7&&_0x4adcb7['name']!==_0x1eea31){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x49fdfb=_0x4adcb7;var _0x913b73=_0x49fdfb[_0x5170('0x1b')]+'@'+config[_0x5170('0xc')][_0x5170('0xd')];return adAuthenticate(config['activedirectory'],_0x913b73,_0x36cefa);})[_0x5170('0x18')](function(_0x512709){if(_0x49fdfb[_0x5170('0x1e')]){throw new Error(_0x5170('0x11'));}if(_0x587a62[_0x5170('0x17')]>0x0){if(_0x49fdfb[_0x5170('0x23')]){if(moment(_0x49fdfb[_0x5170('0x1f')])[_0x5170('0x24')](_0x587a62[_0x5170('0x17')],_0x5170('0x25'))>moment()){throw new Error(_0x5170('0x11'));}return utils['clearBlockUser'](_0x49fdfb,0x0,![],null)[_0x5170('0x18')](function(){return utils[_0x5170('0x26')](_0x49fdfb);})[_0x5170('0x18')](function(){return _0x11d73c(null,_0x49fdfb);});}else{return utils[_0x5170('0x26')](_0x49fdfb)[_0x5170('0x18')](function(){return _0x11d73c(null,_0x49fdfb);});}}else{return utils[_0x5170('0x26')](_0x49fdfb)['then'](function(){return _0x11d73c(null,_0x49fdfb);});}})[_0x5170('0x27')](function(_0x357e7e){return _0x11d73c(null,![],_0x357e7e);});}function handleError(_0x76694e,_0x3a7475,_0x229e57){return _0x76694e[_0x5170('0x28')](_0x3a7475||0x1f4)['send']({'message':_0x229e57?_0x229e57[_0x5170('0x29')]||_0x229e57:''});}exports['login']=function(_0x168f9f,_0x4f9f46,_0x5d9e19){passport[_0x5170('0xe')]('ad-login',function(_0x403b85,_0xbd0a4b,_0x1a3828){var _0x1a673a=_0x403b85||_0x1a3828;if(_0x1a673a){return handleError(_0x4f9f46,0x191,_0x1a673a);}if(!_0xbd0a4b){return handleError(_0x4f9f46,0x194,{'message':_0x5170('0x2a')});}else{var _0x44e239={'payload':{'id':_0xbd0a4b['id'],'role':_0xbd0a4b['role']},'options':{'expiresIn':0x15180}};return authService[_0x5170('0x2b')](_0x44e239)['then'](function(_0x303276){_0x4f9f46[_0x5170('0x2c')]({'id':_0xbd0a4b['id'],'token':_0x303276,'statusCall':'','isAlreadyLogged':_0xbd0a4b[_0x5170('0x20')]});});}})(_0x168f9f,_0x4f9f46,_0x5d9e19);};passport[_0x5170('0x2d')](_0x5170('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0x5170('0x1c')},function(_0x55f1e8,_0x5b37fc,_0x19f9f5){return ActiveDirectoryAuthenticate(db['User'],_0x55f1e8,_0x5b37fc,_0x19f9f5);})); \ No newline at end of file +var _0x8cf1=['Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','then','password','salt','role','blocked','blockedAt','online','admin','user','agent','name','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport-local'];(function(_0x2e9344,_0x459c45){var _0x4eccbc=function(_0x19e25b){while(--_0x19e25b){_0x2e9344['push'](_0x2e9344['shift']());}};_0x4eccbc(++_0x459c45);}(_0x8cf1,0xea));var _0x18cf=function(_0x27bba7,_0x1237bd){_0x27bba7=_0x27bba7-0x0;var _0x3066fe=_0x8cf1[_0x27bba7];return _0x3066fe;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x18cf('0x0'))[_0x18cf('0x1')];var moment=require(_0x18cf('0x2'));var ActiveDirectory=require(_0x18cf('0x3'));var BPromise=require(_0x18cf('0x4'));var util=require(_0x18cf('0x5'));var db=require(_0x18cf('0x6'))['db'];var authService=require(_0x18cf('0x7'));var utils=require('../../config/utils');var config=require(_0x18cf('0x8'));var logger=require('../../config/logger')(_0x18cf('0x9'));function isActiveDirectoryConfigured(_0x123a46){var _0x5aa828=![];if(typeof _0x123a46[_0x18cf('0xa')]!==_0x18cf('0xb')){_0x5aa828=_0x123a46[_0x18cf('0xa')][_0x18cf('0xc')]&&_0x123a46[_0x18cf('0xa')]['url']&&_0x123a46[_0x18cf('0xa')][_0x18cf('0xd')];}return _0x5aa828;}function adAuthenticate(_0x34fa6b,_0x343b21,_0x1935d3){return new BPromise(function(_0x1ae7f2,_0x2b69ed){try{var _0x107d6d=new ActiveDirectory(_0x34fa6b);_0x107d6d[_0x18cf('0xe')](_0x343b21,_0x1935d3,function(_0x2a56ad,_0x12ea77){if(_0x2a56ad){logger[_0x18cf('0xf')](_0x18cf('0x10'),_0x343b21,util[_0x18cf('0x11')](_0x2a56ad,{'showHidden':![],'depth':null}));_0x2b69ed(_0x18cf('0x12'));}else if(!_0x12ea77){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x343b21);_0x2b69ed(_0x18cf('0x12'));}else{_0x1ae7f2(_0x12ea77);}});}catch(_0x2a7937){_0x2b69ed(_0x2a7937);}});}function ActiveDirectoryAuthenticate(_0x3a23a6,_0x2ffa5e,_0x6d0e96,_0x25a0e2){var _0x46f165,_0xe03734;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x18cf('0x13'),_0x2ffa5e);return _0x25a0e2(null,![],{'message':_0x18cf('0x12')});}return db['Setting'][_0x18cf('0x14')]({'where':{'id':0x1},'attributes':[_0x18cf('0x15'),'blockDuration'],'raw':!![]})[_0x18cf('0x16')](function(_0x3366fe){_0x46f165=_0x3366fe;if(!_0x46f165[_0x18cf('0x15')]){logger[_0x18cf('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x2ffa5e);throw new Error(_0x18cf('0x12'));}return _0x3a23a6['findOne']({'attributes':['id','name',_0x18cf('0x17'),_0x18cf('0x18'),_0x18cf('0x19'),'disabled',_0x18cf('0x1a'),_0x18cf('0x1b'),_0x18cf('0x1c')],'where':{'name':_0x2ffa5e,'role':{'$or':[_0x18cf('0x1d'),_0x18cf('0x1e'),_0x18cf('0x1f')]},'adSsoEnabled':!![]}});})['then'](function(_0x4f6cde){if(!_0x4f6cde||_0x4f6cde&&_0x4f6cde[_0x18cf('0x20')]!==_0x2ffa5e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xe03734=_0x4f6cde;var _0x54e1d6=_0xe03734['name']+'@'+config[_0x18cf('0xa')][_0x18cf('0xd')];return adAuthenticate(config[_0x18cf('0xa')],_0x54e1d6,_0x6d0e96);})['then'](function(_0x698e8e){if(_0xe03734[_0x18cf('0x21')]){throw new Error(_0x18cf('0x12'));}if(_0x46f165[_0x18cf('0x22')]>0x0){if(_0xe03734[_0x18cf('0x1a')]){if(moment(_0xe03734[_0x18cf('0x1b')])[_0x18cf('0x23')](_0x46f165[_0x18cf('0x22')],_0x18cf('0x24'))>moment()){throw new Error(_0x18cf('0x12'));}return utils[_0x18cf('0x25')](_0xe03734,0x0,![],null)['then'](function(){return utils['getLicense'](_0xe03734);})['then'](function(){return _0x25a0e2(null,_0xe03734);});}else{return utils[_0x18cf('0x26')](_0xe03734)[_0x18cf('0x16')](function(){return _0x25a0e2(null,_0xe03734);});}}else{return utils['getLicense'](_0xe03734)['then'](function(){return _0x25a0e2(null,_0xe03734);});}})['catch'](function(_0x428e5d){return _0x25a0e2(null,![],_0x428e5d);});}function handleError(_0x39f85c,_0x51c8be,_0xef99ba){return _0x39f85c[_0x18cf('0x27')](_0x51c8be||0x1f4)['send']({'message':_0xef99ba?_0xef99ba[_0x18cf('0x28')]||_0xef99ba:''});}exports[_0x18cf('0x29')]=function(_0x122c26,_0x4aceb7,_0x3d2c5d){passport[_0x18cf('0xe')](_0x18cf('0x2a'),function(_0x23301b,_0x2f3758,_0x4f1373){var _0x167c9b=_0x23301b||_0x4f1373;if(_0x167c9b){return handleError(_0x4aceb7,0x191,_0x167c9b);}if(!_0x2f3758){return handleError(_0x4aceb7,0x194,{'message':_0x18cf('0x2b')});}else{var _0x1bf0bb={'payload':{'id':_0x2f3758['id'],'role':_0x2f3758[_0x18cf('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x18cf('0x2c')](_0x1bf0bb)[_0x18cf('0x16')](function(_0x4f5c9a){_0x4aceb7[_0x18cf('0x2d')]({'id':_0x2f3758['id'],'token':_0x4f5c9a,'statusCall':'','isAlreadyLogged':_0x2f3758[_0x18cf('0x1c')]});});}})(_0x122c26,_0x4aceb7,_0x3d2c5d);};passport[_0x18cf('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0x18cf('0x20'),'passwordField':_0x18cf('0x17')},function(_0x3aeb5c,_0x38d2ab,_0x520bcf){return ActiveDirectoryAuthenticate(db['User'],_0x3aeb5c,_0x38d2ab,_0x520bcf);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 6ba5f20..439c1c6 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 _0xd001=['./authActiveDirectory.controller','post','login','exports','express'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0xd001,0x1e4));var _0x1d00=function(_0x3e14c0,_0x3905e6){_0x3e14c0=_0x3e14c0-0x0;var _0x42c69a=_0xd001[_0x3e14c0];return _0x42c69a;};'use strict';var express=require(_0x1d00('0x0'));var router=express['Router']();var controller=require(_0x1d00('0x1'));router[_0x1d00('0x2')]('/',controller[_0x1d00('0x3')]);module[_0x1d00('0x4')]=router; \ No newline at end of file +var _0x8047=['Router','./authActiveDirectory.controller','post','exports','express'];(function(_0x5f3e62,_0x2fbb2a){var _0x2ea300=function(_0x5250a3){while(--_0x5250a3){_0x5f3e62['push'](_0x5f3e62['shift']());}};_0x2ea300(++_0x2fbb2a);}(_0x8047,0x17b));var _0x7804=function(_0x1c877f,_0x3f060c){_0x1c877f=_0x1c877f-0x0;var _0x3fe5db=_0x8047[_0x1c877f];return _0x3fe5db;};'use strict';var express=require(_0x7804('0x0'));var router=express[_0x7804('0x1')]();var controller=require(_0x7804('0x2'));router[_0x7804('0x3')]('/',controller['login']);module[_0x7804('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 aa9ffa2..18b7956 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(_0x3c5bad,_0x487b57){var _0xf02cb4=function(_0x103c13){while(--_0x103c13){_0x3c5bad['push'](_0x3c5bad['shift']());}};_0xf02cb4(++_0x487b57);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x2ec06f,_0x3bb56d){var _0x3a1c71=function(_0x5ca631){while(--_0x5ca631){_0x2ec06f['push'](_0x2ec06f['shift']());}};_0x3a1c71(++_0x3bb56d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index da3ea72..9343d5f 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 _0x4133=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x72c7ca,_0xdfcae7){var _0x59e818=function(_0x3e8856){while(--_0x3e8856){_0x72c7ca['push'](_0x72c7ca['shift']());}};_0x59e818(++_0xdfcae7);}(_0x4133,0x14a));var _0x3413=function(_0x42c809,_0x5860eb){_0x42c809=_0x42c809-0x0;var _0x37f369=_0x4133[_0x42c809];return _0x37f369;};'use strict';var express=require(_0x3413('0x0'));var passport=require(_0x3413('0x1'));var router=express[_0x3413('0x2')]();var controller=require(_0x3413('0x3'));var userController=require(_0x3413('0x4'));var authService=require(_0x3413('0x5'));router[_0x3413('0x6')]('/',controller[_0x3413('0x7')]);router[_0x3413('0x6')](_0x3413('0x8'),controller[_0x3413('0x9')],authService[_0x3413('0xa')],userController[_0x3413('0x7')],authService[_0x3413('0xb')]);module[_0x3413('0xc')]=router; \ No newline at end of file +var _0x1672=['passport','Router','../user/user.controller.js','../../components/auth/service','get','login','isMiddleware','setTokenCookie','exports','express'];(function(_0xc46b80,_0x34da46){var _0x4a7200=function(_0x27f7d6){while(--_0x27f7d6){_0xc46b80['push'](_0xc46b80['shift']());}};_0x4a7200(++_0x34da46);}(_0x1672,0x121));var _0x2167=function(_0x265eb0,_0x2db51e){_0x265eb0=_0x265eb0-0x0;var _0x1f679a=_0x1672[_0x265eb0];return _0x1f679a;};'use strict';var express=require(_0x2167('0x0'));var passport=require(_0x2167('0x1'));var router=express[_0x2167('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x2167('0x3'));var authService=require(_0x2167('0x4'));router[_0x2167('0x5')]('/',controller[_0x2167('0x6')]);router[_0x2167('0x5')]('/callback',controller['callback'],authService[_0x2167('0x7')],userController[_0x2167('0x6')],authService[_0x2167('0x8')]);module[_0x2167('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 13f89f5..c950d04 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 _0xcc80=['token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','util','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','client','http','Setting','blockDuration','then','findOne','name','role','disabled','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xcc80,0x190));var _0x0cc8=function(_0x5532f3,_0x269fe4){_0x5532f3=_0x5532f3-0x0;var _0x5000a0=_0xcc80[_0x5532f3];return _0x5000a0;};'use strict';var util=require(_0x0cc8('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x0cc8('0x1')];var jayson=require('jayson/promise');var _=require(_0x0cc8('0x2'));var rs=require('randomstring');var moment=require(_0x0cc8('0x3'));var db=require(_0x0cc8('0x4'))['db'];var authService=require(_0x0cc8('0x5'));var utils=require('../../config/utils');var client=jayson[_0x0cc8('0x6')][_0x0cc8('0x7')]({'port':0x232b});function localAuthenticate(_0x7a62a7,_0x1f8602,_0x1a9b89,_0x10c424){var _0x22b826,_0x33f959;return db[_0x0cc8('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0cc8('0x9')],'raw':!![]})[_0x0cc8('0xa')](function(_0x5e9713){_0x22b826=_0x5e9713;return _0x7a62a7[_0x0cc8('0xb')]({'attributes':['id',_0x0cc8('0xc'),'password','salt',_0x0cc8('0xd'),_0x0cc8('0xe'),_0x0cc8('0xf'),_0x0cc8('0x10'),_0x0cc8('0x11')],'where':{'name':_0x1f8602,'role':{'$or':[_0x0cc8('0x12'),_0x0cc8('0x13'),'agent']}}});})['then'](function(_0x11747e){if(!_0x11747e||_0x11747e&&_0x11747e[_0x0cc8('0xc')]!==_0x1f8602){throw new Error(_0x0cc8('0x14'));}else{_0x33f959=_0x11747e;return _0x33f959;}})[_0x0cc8('0xa')](function(){_0x33f959[_0x0cc8('0x15')](_0x1a9b89,function(_0x55fa26,_0x92a9fd){var _0x44ae35=_0x33f959[_0x0cc8('0x11')]+0x1;if(_0x55fa26){return _0x10c424(_0x55fa26);}else if(!_0x92a9fd){if(_0x33f959[_0x0cc8('0xe')]){return _0x10c424(null,![],{'message':_0x0cc8('0x14')});}else if(_0x22b826[_0x0cc8('0x16')]>0x0){if(_0x33f959[_0x0cc8('0xf')]){if(_0x22b826[_0x0cc8('0x9')]>0x0){if(moment(_0x33f959[_0x0cc8('0x10')])[_0x0cc8('0x17')](_0x22b826[_0x0cc8('0x9')],_0x0cc8('0x18'))>moment()){return _0x10c424(null,![],{'message':_0x0cc8('0x14')});}else{return utils['clearBlockUser'](_0x33f959,_0x44ae35,![],null)[_0x0cc8('0xa')](function(){return _0x10c424(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x10c424(null,![],{'message':_0x0cc8('0x14')});}}else{if(_0x44ae35>=_0x22b826[_0x0cc8('0x16')]){return utils['clearBlockUser'](_0x33f959,0x0,!![],moment())['then'](function(){return _0x10c424(null,![],{'message':_0x0cc8('0x14')});});}else{return utils[_0x0cc8('0x19')](_0x33f959,_0x44ae35,![],null)[_0x0cc8('0xa')](function(){return _0x10c424(null,![],{'message':_0x0cc8('0x14')});});}}}else{return _0x10c424(null,![],{'message':_0x0cc8('0x14')});}}else{if(_0x33f959['disabled']){return _0x10c424(null,![],{'message':_0x0cc8('0x14')});}else if(_0x22b826[_0x0cc8('0x16')]>0x0){if(_0x33f959[_0x0cc8('0xf')]){if(_0x22b826[_0x0cc8('0x9')]>0x0){if(moment(_0x33f959[_0x0cc8('0x10')])[_0x0cc8('0x17')](_0x22b826[_0x0cc8('0x9')],_0x0cc8('0x18'))>moment()){return _0x10c424(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x33f959,0x0,![],null)[_0x0cc8('0xa')](function(){return utils[_0x0cc8('0x1a')](_0x33f959);})[_0x0cc8('0xa')](function(){return _0x10c424(null,_0x33f959);});}}else{return _0x10c424(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0cc8('0x19')](_0x33f959,0x0,![],null)[_0x0cc8('0xa')](function(){return utils['getLicense'](_0x33f959);})[_0x0cc8('0xa')](function(){return _0x10c424(null,_0x33f959);})[_0x0cc8('0x1b')](function(_0x1464f6){return _0x10c424(null,![],_0x1464f6);});}}else{if(_0x33f959[_0x0cc8('0xf')]){return _0x10c424(null,![],{'message':_0x0cc8('0x14')});}else{return utils[_0x0cc8('0x1a')](_0x33f959)['then'](function(){return _0x10c424(null,_0x33f959);});}}}});})['catch'](function(_0x5b06e5){return _0x10c424(null,![],_0x5b06e5);});}function sendServiceMail(_0x19fb39){return db[_0x0cc8('0x1c')][_0x0cc8('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x0cc8('0xc'),_0x0cc8('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x0cc8('0x1f'),'include':[{'model':db[_0x0cc8('0x20')],'as':_0x0cc8('0x20')}]}]})['then'](function(_0x365ab6){if(!_0x365ab6){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xd661ec=_0x365ab6[_0x0cc8('0x21')]();var _0x316ffb={'account':_0xd661ec,'message':_[_0x0cc8('0x22')]({'from':util[_0x0cc8('0x23')]('\x22%s\x22\x20<%s>',_0x365ab6[_0x0cc8('0xc')],_0x365ab6[_0x0cc8('0x1e')]||_0x365ab6[_0x0cc8('0x1f')][_0x0cc8('0x13')])},_0x19fb39)};return client[_0x0cc8('0x24')](_0x0cc8('0x25'),_0x316ffb);})[_0x0cc8('0xa')](function(_0x1edcbc){if(_0x1edcbc[_0x0cc8('0x26')]){throw new Error(util[_0x0cc8('0x23')](_0x0cc8('0x27'),_0x1edcbc[_0x0cc8('0x26')]['message']||JSON[_0x0cc8('0x28')](_0x1edcbc['error'])));}return!![];});}function handleError(_0x243c3b,_0x150c93,_0xcbb52b){return _0x243c3b[_0x0cc8('0x29')](_0x150c93||0x1f4)[_0x0cc8('0x2a')]({'message':_0xcbb52b?_0xcbb52b[_0x0cc8('0x2b')]||_0xcbb52b:''});}exports[_0x0cc8('0x2c')]=function(_0x2c89df,_0x3e73a7,_0x34de09){passport['authenticate'](_0x0cc8('0x2d'),function(_0x348cb7,_0x26aabe,_0x2ef498){var _0x575411=_0x348cb7||_0x2ef498;if(_0x575411){return handleError(_0x3e73a7,0x191,_0x575411);}if(!_0x26aabe){return handleError(_0x3e73a7,0x194,{'message':_0x0cc8('0x2e')});}else{var _0x4932ba={'payload':{'id':_0x26aabe['id'],'role':_0x26aabe[_0x0cc8('0xd')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4932ba)[_0x0cc8('0xa')](function(_0x3a95e6){_0x3e73a7[_0x0cc8('0x2f')]({'id':_0x26aabe['id'],'token':_0x3a95e6,'statusCall':'','isAlreadyLogged':_0x26aabe[_0x0cc8('0x30')]});});}})(_0x2c89df,_0x3e73a7,_0x34de09);};exports[_0x0cc8('0x31')]=function(_0x42e887,_0xbd6bf1){if(!_0x42e887['body'][_0x0cc8('0x1e')]){return handleError(_0xbd6bf1,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1a1065=rs[_0x0cc8('0x32')]();_0x42e887[_0x0cc8('0x33')][_0x0cc8('0x1e')]=_0x42e887[_0x0cc8('0x33')][_0x0cc8('0x1e')][_0x0cc8('0x34')]()[_0x0cc8('0x35')]();var _0x4245f6;return db[_0x0cc8('0x8')][_0x0cc8('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0cc8('0x9')],'raw':!![]})['then'](function(_0x482e89){_0x4245f6=_0x482e89;return db[_0x0cc8('0x36')][_0x0cc8('0x1d')]({'where':{'email':_0x42e887[_0x0cc8('0x33')][_0x0cc8('0x1e')]}});})[_0x0cc8('0xa')](function(_0x1e7aea){if(!_0x1e7aea){throw new Error(_0x0cc8('0x37'));}if(_0x1e7aea[_0x0cc8('0xe')]){throw new Error(_0x0cc8('0x38'));}if(_0x1e7aea[_0x0cc8('0xf')]){if(moment(_0x1e7aea[_0x0cc8('0x10')])[_0x0cc8('0x17')](_0x4245f6[_0x0cc8('0x9')],_0x0cc8('0x18'))>moment()){throw new Error(_0x0cc8('0x39'));}else{_0x1e7aea['blocked']=![];_0x1e7aea[_0x0cc8('0x10')]=null;}}_0x1e7aea[_0x0cc8('0x3a')]=_0x1a1065;_0x1e7aea[_0x0cc8('0x3b')]=Date['now']()+0x36ee80;return _0x1e7aea[_0x0cc8('0x3c')]();})[_0x0cc8('0xa')](function(){return sendServiceMail({'to':_0x42e887['body'][_0x0cc8('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x0cc8('0x3d')+_0x0cc8('0x3e')+_0x42e887[_0x0cc8('0x3f')][_0x0cc8('0x40')]+'/reset/'+_0x1a1065+'\x0a\x0a'+_0x0cc8('0x41')});})['then'](function(){_0xbd6bf1[_0x0cc8('0x29')](0xc8)[_0x0cc8('0x2a')]({'message':_0x0cc8('0x42')});})['catch'](function(_0x4e6626){return handleError(_0xbd6bf1,0x1f4,_0x4e6626);});};exports[_0x0cc8('0x43')]=function(_0x2abc58,_0x229d61){return db[_0x0cc8('0x36')][_0x0cc8('0x1d')]({'where':{'resetPasswordToken':_0x2abc58['params'][_0x0cc8('0x44')],'resetPasswordExpires':{'$gt':Date[_0x0cc8('0x45')]()}}})[_0x0cc8('0xa')](function(_0x2477f3){if(!_0x2477f3){throw new Error(_0x0cc8('0x46'));}return db[_0x0cc8('0x8')][_0x0cc8('0xb')]({'attributes':['id',_0x0cc8('0x47'),_0x0cc8('0x48'),'passwordHistoryLimit']})[_0x0cc8('0xa')](function(_0xbcd221){if(_0xbcd221[_0x0cc8('0x47')])authService[_0x0cc8('0x49')](_0x2abc58[_0x0cc8('0x33')][_0x0cc8('0x4a')]);if(!_0xbcd221['enforcePasswordHistory']||!_0x2477f3[_0x0cc8('0x4b')])return _0x2477f3;authService[_0x0cc8('0x4c')](_0x2abc58[_0x0cc8('0x33')][_0x0cc8('0x4a')],_0x2477f3['previousPasswords'],_0xbcd221['passwordHistoryLimit']);return _0x2477f3;})[_0x0cc8('0xa')](function(){_0x2477f3[_0x0cc8('0x4a')]=_0x2abc58[_0x0cc8('0x33')]['password'];_0x2477f3[_0x0cc8('0x3a')]=null;_0x2477f3[_0x0cc8('0x3b')]=null;return _0x2477f3[_0x0cc8('0x3c')]();});})['then'](function(){_0x229d61[_0x0cc8('0x29')](0xc8)[_0x0cc8('0x2a')]({'message':_0x0cc8('0x4d')});})[_0x0cc8('0x1b')](function(_0x3826d1){return handleError(_0x229d61,0x1f4,_0x3826d1);});};passport['use'](_0x0cc8('0x2d'),new LocalStrategy({'usernameField':_0x0cc8('0xc'),'passwordField':_0x0cc8('0x4a')},function(_0x3a7023,_0x108d87,_0x3a73c6){return localAuthenticate(db[_0x0cc8('0x36')],_0x3a7023,_0x108d87,_0x3a73c6);})); \ No newline at end of file +var _0x961a=['message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','generate','body','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','local-login','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','http','findOne','then','password','salt','disabled','blocked','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x961a,0x1b3));var _0xa961=function(_0x3bd35b,_0x9fb5d9){_0x3bd35b=_0x3bd35b-0x0;var _0xde13d4=_0x961a[_0x3bd35b];return _0xde13d4;};'use strict';var util=require('util');var passport=require(_0xa961('0x0'));var LocalStrategy=require(_0xa961('0x1'))[_0xa961('0x2')];var jayson=require('jayson/promise');var _=require(_0xa961('0x3'));var rs=require(_0xa961('0x4'));var moment=require(_0xa961('0x5'));var db=require(_0xa961('0x6'))['db'];var authService=require(_0xa961('0x7'));var utils=require('../../config/utils');var client=jayson['client'][_0xa961('0x8')]({'port':0x232b});function localAuthenticate(_0x3cfbaa,_0x33257a,_0xe34040,_0x4f0de6){var _0x181739,_0x33cf41;return db['Setting'][_0xa961('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xa961('0xa')](function(_0x1a84f2){_0x181739=_0x1a84f2;return _0x3cfbaa['findOne']({'attributes':['id','name',_0xa961('0xb'),_0xa961('0xc'),'role',_0xa961('0xd'),_0xa961('0xe'),_0xa961('0xf'),'loginAttempts'],'where':{'name':_0x33257a,'role':{'$or':[_0xa961('0x10'),_0xa961('0x11'),_0xa961('0x12')]}}});})['then'](function(_0xaa4330){if(!_0xaa4330||_0xaa4330&&_0xaa4330[_0xa961('0x13')]!==_0x33257a){throw new Error(_0xa961('0x14'));}else{_0x33cf41=_0xaa4330;return _0x33cf41;}})[_0xa961('0xa')](function(){_0x33cf41['authenticate'](_0xe34040,function(_0x5ba0c6,_0x59e3ea){var _0x5cb97b=_0x33cf41['loginAttempts']+0x1;if(_0x5ba0c6){return _0x4f0de6(_0x5ba0c6);}else if(!_0x59e3ea){if(_0x33cf41[_0xa961('0xd')]){return _0x4f0de6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x181739[_0xa961('0x15')]>0x0){if(_0x33cf41[_0xa961('0xe')]){if(_0x181739[_0xa961('0x16')]>0x0){if(moment(_0x33cf41[_0xa961('0xf')])[_0xa961('0x17')](_0x181739[_0xa961('0x16')],_0xa961('0x18'))>moment()){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else{return utils[_0xa961('0x19')](_0x33cf41,_0x5cb97b,![],null)['then'](function(){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});});}}else{return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}}else{if(_0x5cb97b>=_0x181739[_0xa961('0x15')]){return utils[_0xa961('0x19')](_0x33cf41,0x0,!![],moment())[_0xa961('0xa')](function(){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});});}else{return utils[_0xa961('0x19')](_0x33cf41,_0x5cb97b,![],null)['then'](function(){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});});}}}else{return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}}else{if(_0x33cf41[_0xa961('0xd')]){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else if(_0x181739[_0xa961('0x15')]>0x0){if(_0x33cf41['blocked']){if(_0x181739[_0xa961('0x16')]>0x0){if(moment(_0x33cf41[_0xa961('0xf')])[_0xa961('0x17')](_0x181739[_0xa961('0x16')],_0xa961('0x18'))>moment()){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else{return utils['clearBlockUser'](_0x33cf41,0x0,![],null)[_0xa961('0xa')](function(){return utils[_0xa961('0x1a')](_0x33cf41);})[_0xa961('0xa')](function(){return _0x4f0de6(null,_0x33cf41);});}}else{return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}}else{return utils['clearBlockUser'](_0x33cf41,0x0,![],null)[_0xa961('0xa')](function(){return utils['getLicense'](_0x33cf41);})['then'](function(){return _0x4f0de6(null,_0x33cf41);})['catch'](function(_0x4511c4){return _0x4f0de6(null,![],_0x4511c4);});}}else{if(_0x33cf41['blocked']){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else{return utils[_0xa961('0x1a')](_0x33cf41)[_0xa961('0xa')](function(){return _0x4f0de6(null,_0x33cf41);});}}}});})['catch'](function(_0x59dec1){return _0x4f0de6(null,![],_0x59dec1);});}function sendServiceMail(_0x46989e){return db['MailAccount'][_0xa961('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xa961('0x13'),_0xa961('0x1c')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0xa961('0x1d')],'as':'CloudProvider'}]}]})[_0xa961('0xa')](function(_0x5b3ff9){if(!_0x5b3ff9){throw new Error(_0xa961('0x1e'));}var _0x542f91=_0x5b3ff9[_0xa961('0x1f')]();var _0x23115f={'account':_0x542f91,'message':_[_0xa961('0x20')]({'from':util[_0xa961('0x21')](_0xa961('0x22'),_0x5b3ff9['name'],_0x5b3ff9[_0xa961('0x1c')]||_0x5b3ff9[_0xa961('0x23')]['user'])},_0x46989e)};return client['request'](_0xa961('0x24'),_0x23115f);})[_0xa961('0xa')](function(_0x365246){if(_0x365246[_0xa961('0x25')]){throw new Error(util[_0xa961('0x21')](_0xa961('0x26'),_0x365246[_0xa961('0x25')][_0xa961('0x27')]||JSON[_0xa961('0x28')](_0x365246[_0xa961('0x25')])));}return!![];});}function handleError(_0x525f76,_0xf96cf1,_0x52015d){return _0x525f76[_0xa961('0x29')](_0xf96cf1||0x1f4)[_0xa961('0x2a')]({'message':_0x52015d?_0x52015d[_0xa961('0x27')]||_0x52015d:''});}exports[_0xa961('0x2b')]=function(_0x525153,_0x4a2ac5,_0x35fdbd){passport['authenticate']('local-login',function(_0x357483,_0x1cb51a,_0x170dbd){var _0x310e4c=_0x357483||_0x170dbd;if(_0x310e4c){return handleError(_0x4a2ac5,0x191,_0x310e4c);}if(!_0x1cb51a){return handleError(_0x4a2ac5,0x194,{'message':_0xa961('0x2c')});}else{var _0x553e92={'payload':{'id':_0x1cb51a['id'],'role':_0x1cb51a[_0xa961('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0xa961('0x2e')](_0x553e92)[_0xa961('0xa')](function(_0x5ef28b){_0x4a2ac5[_0xa961('0x2f')]({'id':_0x1cb51a['id'],'token':_0x5ef28b,'statusCall':'','isAlreadyLogged':_0x1cb51a[_0xa961('0x30')]});});}})(_0x525153,_0x4a2ac5,_0x35fdbd);};exports['forgot']=function(_0x59588a,_0x3d11eb){if(!_0x59588a['body'][_0xa961('0x1c')]){return handleError(_0x3d11eb,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2ce79f=rs[_0xa961('0x31')]();_0x59588a[_0xa961('0x32')]['email']=_0x59588a[_0xa961('0x32')][_0xa961('0x1c')][_0xa961('0x33')]()['toLowerCase']();var _0x1678af;return db[_0xa961('0x34')][_0xa961('0x9')]({'where':{'id':0x1},'attributes':[_0xa961('0x15'),_0xa961('0x16')],'raw':!![]})[_0xa961('0xa')](function(_0x298549){_0x1678af=_0x298549;return db[_0xa961('0x35')][_0xa961('0x1b')]({'where':{'email':_0x59588a['body'][_0xa961('0x1c')]}});})['then'](function(_0x525459){if(!_0x525459){throw new Error(_0xa961('0x36'));}if(_0x525459[_0xa961('0xd')]){throw new Error(_0xa961('0x37'));}if(_0x525459[_0xa961('0xe')]){if(moment(_0x525459[_0xa961('0xf')])['add'](_0x1678af[_0xa961('0x16')],'minutes')>moment()){throw new Error(_0xa961('0x38'));}else{_0x525459['blocked']=![];_0x525459[_0xa961('0xf')]=null;}}_0x525459[_0xa961('0x39')]=_0x2ce79f;_0x525459['resetPasswordExpires']=Date[_0xa961('0x3a')]()+0x36ee80;return _0x525459[_0xa961('0x3b')]();})[_0xa961('0xa')](function(){return sendServiceMail({'to':_0x59588a[_0xa961('0x32')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa961('0x3c')+_0xa961('0x3d')+_0xa961('0x3e')+_0x59588a[_0xa961('0x3f')][_0xa961('0x40')]+_0xa961('0x41')+_0x2ce79f+'\x0a\x0a'+_0xa961('0x42')});})[_0xa961('0xa')](function(){_0x3d11eb[_0xa961('0x29')](0xc8)[_0xa961('0x2a')]({'message':_0xa961('0x43')});})[_0xa961('0x44')](function(_0x3273d9){return handleError(_0x3d11eb,0x1f4,_0x3273d9);});};exports[_0xa961('0x45')]=function(_0xa614c5,_0x492241){return db['User'][_0xa961('0x1b')]({'where':{'resetPasswordToken':_0xa614c5['params'][_0xa961('0x46')],'resetPasswordExpires':{'$gt':Date[_0xa961('0x3a')]()}}})[_0xa961('0xa')](function(_0x3c1bb9){if(!_0x3c1bb9){throw new Error(_0xa961('0x47'));}return db[_0xa961('0x34')][_0xa961('0x9')]({'attributes':['id',_0xa961('0x48'),_0xa961('0x49'),_0xa961('0x4a')]})[_0xa961('0xa')](function(_0x5e09e9){if(_0x5e09e9[_0xa961('0x48')])authService['validatePasswordPattern'](_0xa614c5['body'][_0xa961('0xb')]);if(!_0x5e09e9[_0xa961('0x49')]||!_0x3c1bb9[_0xa961('0x4b')])return _0x3c1bb9;authService[_0xa961('0x4c')](_0xa614c5['body']['password'],_0x3c1bb9[_0xa961('0x4b')],_0x5e09e9[_0xa961('0x4a')]);return _0x3c1bb9;})['then'](function(){_0x3c1bb9[_0xa961('0xb')]=_0xa614c5['body'][_0xa961('0xb')];_0x3c1bb9[_0xa961('0x39')]=null;_0x3c1bb9[_0xa961('0x4d')]=null;return _0x3c1bb9[_0xa961('0x3b')]();});})[_0xa961('0xa')](function(){_0x492241[_0xa961('0x29')](0xc8)[_0xa961('0x2a')]({'message':'Password\x20reset!'});})[_0xa961('0x44')](function(_0xa06cf2){return handleError(_0x492241,0x1f4,_0xa06cf2);});};passport['use'](_0xa961('0x4e'),new LocalStrategy({'usernameField':_0xa961('0x13'),'passwordField':_0xa961('0xb')},function(_0x58232c,_0x25583a,_0x1518c6){return localAuthenticate(db[_0xa961('0x35')],_0x58232c,_0x25583a,_0x1518c6);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7f7bf11..09c0ba1 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 _0x19a2=['/forgot','forgot','reset','exports','express','./authLocal.controller','post'];(function(_0x585ed8,_0x3e44ac){var _0x9d5f3a=function(_0x2dd721){while(--_0x2dd721){_0x585ed8['push'](_0x585ed8['shift']());}};_0x9d5f3a(++_0x3e44ac);}(_0x19a2,0xa5));var _0x219a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x19a2[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x219a('0x0'));var router=express['Router']();var controller=require(_0x219a('0x1'));router[_0x219a('0x2')]('/',controller['login']);router[_0x219a('0x2')](_0x219a('0x3'),controller[_0x219a('0x4')]);router[_0x219a('0x2')]('/reset/:token',controller[_0x219a('0x5')]);module[_0x219a('0x6')]=router; \ No newline at end of file +var _0xcecd=['post','forgot','reset','Router','./authLocal.controller'];(function(_0x2f25c9,_0xabd53a){var _0x58c8f8=function(_0x5b45a4){while(--_0x5b45a4){_0x2f25c9['push'](_0x2f25c9['shift']());}};_0x58c8f8(++_0xabd53a);}(_0xcecd,0x1c5));var _0xdcec=function(_0x15138e,_0x5b963f){_0x15138e=_0x15138e-0x0;var _0x3e79bf=_0xcecd[_0x15138e];return _0x3e79bf;};'use strict';var express=require('express');var router=express[_0xdcec('0x0')]();var controller=require(_0xdcec('0x1'));router[_0xdcec('0x2')]('/',controller['login']);router[_0xdcec('0x2')]('/forgot',controller[_0xdcec('0x3')]);router['post']('/reset/:token',controller[_0xdcec('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index acdaade..264cec4 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 _0x1b7e=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x1b7e,0x1af));var _0xe1b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b7e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe1b7('0x0'));module['exports']={'name':{'type':Sequelize[_0xe1b7('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe1b7('0x1')]},'description':{'type':Sequelize[_0xe1b7('0x1')]},'status':{'type':Sequelize[_0xe1b7('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe1b7('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xe63e=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x277985,_0x4c1c1b){var _0x41f043=function(_0x1af7d5){while(--_0x1af7d5){_0x277985['push'](_0x277985['shift']());}};_0x41f043(++_0x4c1c1b);}(_0xe63e,0x117));var _0xee63=function(_0x4ca4b7,_0x9be8a0){_0x4ca4b7=_0x4ca4b7-0x0;var _0x50a6f3=_0xe63e[_0x4ca4b7];return _0x50a6f3;};'use strict';var Sequelize=require(_0xee63('0x0'));module[_0xee63('0x1')]={'name':{'type':Sequelize[_0xee63('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xee63('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xee63('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xee63('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 d4b3f17..c4e4487 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 _0xd0ce=['findOne','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','merge','options','Automation','includeAll','include','rows','catch','params','keys','find','create','body','addConditions','ids','omit','getConditions','order','filter','addActions','Action','getActions'];(function(_0x1f3527,_0x149c38){var _0x2eef9d=function(_0x39f04f){while(--_0x39f04f){_0x1f3527['push'](_0x1f3527['shift']());}};_0x2eef9d(++_0x149c38);}(_0xd0ce,0x13a));var _0xed0c=function(_0x2f35c5,_0x3268a6){_0x2f35c5=_0x2f35c5-0x0;var _0x2676d1=_0xd0ce[_0x2f35c5];return _0x2676d1;};'use strict';var emlformat=require(_0xed0c('0x0'));var rimraf=require(_0xed0c('0x1'));var zipdir=require(_0xed0c('0x2'));var jsonpatch=require(_0xed0c('0x3'));var rp=require('request-promise');var moment=require(_0xed0c('0x4'));var BPromise=require(_0xed0c('0x5'));var Mustache=require(_0xed0c('0x6'));var util=require(_0xed0c('0x7'));var path=require(_0xed0c('0x8'));var sox=require(_0xed0c('0x9'));var csv=require(_0xed0c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed0c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xed0c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed0c('0xd'));var authService=require(_0xed0c('0xe'));var qs=require(_0xed0c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed0c('0x10'));var logger=require('../../config/logger')(_0xed0c('0x11'));var utils=require('../../config/utils');var config=require(_0xed0c('0x12'));var licenseUtil=require(_0xed0c('0x13'));var db=require(_0xed0c('0x14'))['db'];function respondWithStatusCode(_0x530d8b,_0x1e2b93){_0x1e2b93=_0x1e2b93||0xcc;return function(_0x4fda5b){if(_0x4fda5b){return _0x530d8b['sendStatus'](_0x1e2b93);}return _0x530d8b[_0xed0c('0x15')](_0x1e2b93)[_0xed0c('0x16')]();};}function respondWithResult(_0x406d7f,_0x2ce9e1){_0x2ce9e1=_0x2ce9e1||0xc8;return function(_0x3ea8c6){if(_0x3ea8c6){return _0x406d7f[_0xed0c('0x15')](_0x2ce9e1)[_0xed0c('0x17')](_0x3ea8c6);}};}function respondWithFilteredResult(_0x363867,_0x36ab8b){return function(_0x9d3398){if(_0x9d3398){var _0x476e58=typeof _0x36ab8b[_0xed0c('0x18')]===_0xed0c('0x19')&&typeof _0x36ab8b[_0xed0c('0x1a')]===_0xed0c('0x19');var _0x108da9=_0x9d3398[_0xed0c('0x1b')];var _0x5d4709=_0x476e58?0x0:_0x36ab8b[_0xed0c('0x18')];var _0x147424=_0x476e58?_0x9d3398['count']:_0x36ab8b[_0xed0c('0x18')]+_0x36ab8b[_0xed0c('0x1a')];var _0x185e44;if(_0x147424>=_0x108da9){_0x147424=_0x108da9;_0x185e44=0xc8;}else{_0x185e44=0xce;}_0x363867['status'](_0x185e44);return _0x363867['set'](_0xed0c('0x1c'),_0x5d4709+'-'+_0x147424+'/'+_0x108da9)['json'](_0x9d3398);}return null;};}function patchUpdates(_0x3766af){return function(_0x2a5a15){try{jsonpatch[_0xed0c('0x1d')](_0x2a5a15,_0x3766af,!![]);}catch(_0x3e6056){return BPromise[_0xed0c('0x1e')](_0x3e6056);}return _0x2a5a15['save']();};}function saveUpdates(_0x105479,_0x425f92){return function(_0x3f1681){if(_0x3f1681){return _0x3f1681[_0xed0c('0x1f')](_0x105479)[_0xed0c('0x20')](function(_0x29dcbd){return _0x29dcbd;});}return null;};}function removeEntity(_0x4aad1a,_0x2a0a52){return function(_0x53ecf3){if(_0x53ecf3){return _0x53ecf3[_0xed0c('0x21')]()['then'](function(){_0x4aad1a[_0xed0c('0x15')](0xcc)[_0xed0c('0x16')]();});}};}function handleEntityNotFound(_0x4bc22b,_0x586bb5){return function(_0x230be1){if(!_0x230be1){_0x4bc22b['sendStatus'](0x194);}return _0x230be1;};}function handleError(_0x40c369,_0x1001cb){_0x1001cb=_0x1001cb||0x1f4;return function(_0x4a181d){logger['error'](_0x4a181d[_0xed0c('0x22')]);if(_0x4a181d[_0xed0c('0x23')]){delete _0x4a181d[_0xed0c('0x23')];}_0x40c369[_0xed0c('0x15')](_0x1001cb)[_0xed0c('0x24')](_0x4a181d);};}exports[_0xed0c('0x25')]=function(_0x60230c,_0x3c43aa){var _0x30f0d5={},_0x1a281e={},_0x155e25={'count':0x0,'rows':[]};var _0x3e329c=_[_0xed0c('0x26')](db['Automation'][_0xed0c('0x27')],function(_0x287654){return{'name':_0x287654[_0xed0c('0x28')],'type':_0x287654[_0xed0c('0x29')][_0xed0c('0x2a')]};});_0x1a281e[_0xed0c('0x2b')]=_[_0xed0c('0x26')](_0x3e329c,_0xed0c('0x23'));_0x1a281e[_0xed0c('0x2c')]=_['keys'](_0x60230c[_0xed0c('0x2c')]);_0x1a281e[_0xed0c('0x2d')]=_[_0xed0c('0x2e')](_0x1a281e[_0xed0c('0x2b')],_0x1a281e['query']);_0x30f0d5[_0xed0c('0x2f')]=_[_0xed0c('0x2e')](_0x1a281e['model'],qs[_0xed0c('0x30')](_0x60230c[_0xed0c('0x2c')][_0xed0c('0x30')]));_0x30f0d5[_0xed0c('0x2f')]=_0x30f0d5[_0xed0c('0x2f')][_0xed0c('0x31')]?_0x30f0d5['attributes']:_0x1a281e[_0xed0c('0x2b')];if(!_0x60230c[_0xed0c('0x2c')]['hasOwnProperty'](_0xed0c('0x32'))){_0x30f0d5[_0xed0c('0x1a')]=qs[_0xed0c('0x1a')](_0x60230c[_0xed0c('0x2c')][_0xed0c('0x1a')]);_0x30f0d5[_0xed0c('0x18')]=qs[_0xed0c('0x18')](_0x60230c[_0xed0c('0x2c')][_0xed0c('0x18')]);}_0x30f0d5['order']=qs['sort'](_0x60230c[_0xed0c('0x2c')][_0xed0c('0x33')]);_0x30f0d5[_0xed0c('0x34')]=qs[_0xed0c('0x2d')](_[_0xed0c('0x35')](_0x60230c['query'],_0x1a281e[_0xed0c('0x2d')]),_0x3e329c);if(_0x60230c[_0xed0c('0x2c')]['filter']){_0x30f0d5['where']=_['merge'](_0x30f0d5['where'],{'$or':_[_0xed0c('0x26')](_0x3e329c,function(_0x57cd0e){if(_0x57cd0e[_0xed0c('0x29')]!==_0xed0c('0x36')){var _0x367cb={};_0x367cb[_0x57cd0e['name']]={'$like':'%'+_0x60230c[_0xed0c('0x2c')]['filter']+'%'};return _0x367cb;}})});}_0x30f0d5=_[_0xed0c('0x37')]({},_0x30f0d5,_0x60230c[_0xed0c('0x38')]);var _0x54f106={'where':_0x30f0d5[_0xed0c('0x34')]};return db[_0xed0c('0x39')][_0xed0c('0x1b')](_0x54f106)['then'](function(_0x59e8bb){_0x155e25[_0xed0c('0x1b')]=_0x59e8bb;if(_0x60230c[_0xed0c('0x2c')][_0xed0c('0x3a')]){_0x30f0d5[_0xed0c('0x3b')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x30f0d5);})[_0xed0c('0x20')](function(_0xb33384){_0x155e25[_0xed0c('0x3c')]=_0xb33384;return _0x155e25;})[_0xed0c('0x20')](respondWithFilteredResult(_0x3c43aa,_0x30f0d5))[_0xed0c('0x3d')](handleError(_0x3c43aa,null));};exports['show']=function(_0x349356,_0x58d244){var _0x58d0f1={'raw':![],'where':{'id':_0x349356[_0xed0c('0x3e')]['id']}},_0x445803={};_0x445803[_0xed0c('0x2b')]=_[_0xed0c('0x3f')](db['Automation'][_0xed0c('0x27')]);_0x445803[_0xed0c('0x2c')]=_['keys'](_0x349356[_0xed0c('0x2c')]);_0x445803[_0xed0c('0x2d')]=_['intersection'](_0x445803['model'],_0x445803[_0xed0c('0x2c')]);_0x58d0f1[_0xed0c('0x2f')]=_['intersection'](_0x445803[_0xed0c('0x2b')],qs[_0xed0c('0x30')](_0x349356[_0xed0c('0x2c')][_0xed0c('0x30')]));_0x58d0f1[_0xed0c('0x2f')]=_0x58d0f1[_0xed0c('0x2f')][_0xed0c('0x31')]?_0x58d0f1[_0xed0c('0x2f')]:_0x445803[_0xed0c('0x2b')];if(_0x349356[_0xed0c('0x2c')][_0xed0c('0x3a')]){_0x58d0f1[_0xed0c('0x3b')]=[{'all':!![]}];}_0x58d0f1=_[_0xed0c('0x37')]({},_0x58d0f1,_0x349356[_0xed0c('0x38')]);return db[_0xed0c('0x39')][_0xed0c('0x40')](_0x58d0f1)['then'](handleEntityNotFound(_0x58d244,null))['then'](respondWithResult(_0x58d244,null))['catch'](handleError(_0x58d244,null));};exports[_0xed0c('0x41')]=function(_0x1de7c1,_0x4f627d){return db[_0xed0c('0x39')]['create'](_0x1de7c1[_0xed0c('0x42')],{})[_0xed0c('0x20')](respondWithResult(_0x4f627d,0xc9))[_0xed0c('0x3d')](handleError(_0x4f627d,null));};exports['update']=function(_0x327936,_0x57acf9){if(_0x327936['body']['id']){delete _0x327936['body']['id'];}return db['Automation']['find']({'where':{'id':_0x327936['params']['id']}})[_0xed0c('0x20')](handleEntityNotFound(_0x57acf9,null))[_0xed0c('0x20')](saveUpdates(_0x327936[_0xed0c('0x42')],null))[_0xed0c('0x20')](respondWithResult(_0x57acf9,null))[_0xed0c('0x3d')](handleError(_0x57acf9,null));};exports['destroy']=function(_0x357a3b,_0x1764fd){return db[_0xed0c('0x39')][_0xed0c('0x40')]({'where':{'id':_0x357a3b[_0xed0c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1764fd,null))['then'](removeEntity(_0x1764fd,null))[_0xed0c('0x3d')](handleError(_0x1764fd,null));};exports[_0xed0c('0x43')]=function(_0xf06243,_0xcc056d,_0x25fac6){return db['Condition'][_0xed0c('0x40')]({'where':{'id':_0xf06243[_0xed0c('0x3e')]['id']}})[_0xed0c('0x20')](handleEntityNotFound(_0xcc056d,null))['then'](function(_0x4a2cff){if(_0x4a2cff){return _0x4a2cff[_0xed0c('0x43')](_0xf06243[_0xed0c('0x42')][_0xed0c('0x44')],_[_0xed0c('0x45')](_0xf06243[_0xed0c('0x42')],['ids','id'])||{});}})[_0xed0c('0x20')](respondWithResult(_0xcc056d,null))['catch'](handleError(_0xcc056d,null));};exports[_0xed0c('0x46')]=function(_0x51dc05,_0x5487c6,_0x5bd532){var _0x2cb51c={};var _0x42d816={};var _0x4871ca;var _0x16284a;return db['Automation']['findOne']({'where':{'id':_0x51dc05['params']['id']}})[_0xed0c('0x20')](handleEntityNotFound(_0x5487c6,null))[_0xed0c('0x20')](function(_0x3c0514){if(_0x3c0514){_0x4871ca=_0x3c0514;_0x42d816[_0xed0c('0x2b')]=_[_0xed0c('0x3f')](db['Condition'][_0xed0c('0x27')]);_0x42d816[_0xed0c('0x2c')]=_[_0xed0c('0x3f')](_0x51dc05[_0xed0c('0x2c')]);_0x42d816['filters']=_[_0xed0c('0x2e')](_0x42d816[_0xed0c('0x2b')],_0x42d816['query']);_0x2cb51c[_0xed0c('0x2f')]=_[_0xed0c('0x2e')](_0x42d816[_0xed0c('0x2b')],qs[_0xed0c('0x30')](_0x51dc05['query'][_0xed0c('0x30')]));_0x2cb51c[_0xed0c('0x2f')]=_0x2cb51c[_0xed0c('0x2f')]['length']?_0x2cb51c[_0xed0c('0x2f')]:_0x42d816[_0xed0c('0x2b')];_0x2cb51c[_0xed0c('0x47')]=qs[_0xed0c('0x33')](_0x51dc05[_0xed0c('0x2c')]['sort']);_0x2cb51c[_0xed0c('0x34')]=qs['filters'](_['pick'](_0x51dc05['query'],_0x42d816[_0xed0c('0x2d')]));if(_0x51dc05[_0xed0c('0x2c')][_0xed0c('0x48')]){_0x2cb51c[_0xed0c('0x34')]=_[_0xed0c('0x37')](_0x2cb51c['where'],{'$or':_[_0xed0c('0x26')](_0x2cb51c['attributes'],function(_0x5dd1fe){var _0x169a6c={};_0x169a6c[_0x5dd1fe]={'$like':'%'+_0x51dc05['query'][_0xed0c('0x48')]+'%'};return _0x169a6c;})});}_0x2cb51c=_[_0xed0c('0x37')]({},_0x2cb51c,_0x51dc05['options']);return _0x4871ca[_0xed0c('0x46')](_0x2cb51c);}})[_0xed0c('0x20')](function(_0x6d65b){if(_0x6d65b){_0x16284a=_0x6d65b[_0xed0c('0x31')];if(!_0x51dc05['query']['hasOwnProperty'](_0xed0c('0x32'))){_0x2cb51c[_0xed0c('0x1a')]=qs['limit'](_0x51dc05['query'][_0xed0c('0x1a')]);_0x2cb51c[_0xed0c('0x18')]=qs['offset'](_0x51dc05[_0xed0c('0x2c')][_0xed0c('0x18')]);}return _0x4871ca[_0xed0c('0x46')](_0x2cb51c);}})[_0xed0c('0x20')](function(_0x59e0ce){if(_0x59e0ce){return _0x59e0ce?{'count':_0x16284a,'rows':_0x59e0ce}:null;}})['then'](respondWithResult(_0x5487c6,null))[_0xed0c('0x3d')](handleError(_0x5487c6,null));};exports[_0xed0c('0x49')]=function(_0x2c48d9,_0x1ce00a,_0x422e36){return db[_0xed0c('0x4a')]['find']({'where':{'id':_0x2c48d9[_0xed0c('0x3e')]['id']}})[_0xed0c('0x20')](handleEntityNotFound(_0x1ce00a,null))[_0xed0c('0x20')](function(_0x2cf303){if(_0x2cf303){return _0x2cf303[_0xed0c('0x49')](_0x2c48d9[_0xed0c('0x42')][_0xed0c('0x44')],_[_0xed0c('0x45')](_0x2c48d9[_0xed0c('0x42')],[_0xed0c('0x44'),'id'])||{});}})[_0xed0c('0x20')](respondWithResult(_0x1ce00a,null))[_0xed0c('0x3d')](handleError(_0x1ce00a,null));};exports[_0xed0c('0x4b')]=function(_0x28b3c9,_0x56135d,_0x265366){var _0x4b1913={};var _0x1174ac={};var _0x3cc66b;var _0x3bea8d;return db[_0xed0c('0x39')][_0xed0c('0x4c')]({'where':{'id':_0x28b3c9['params']['id']}})[_0xed0c('0x20')](handleEntityNotFound(_0x56135d,null))[_0xed0c('0x20')](function(_0x423e2e){if(_0x423e2e){_0x3cc66b=_0x423e2e;_0x1174ac[_0xed0c('0x2b')]=_['keys'](db[_0xed0c('0x4a')]['rawAttributes']);_0x1174ac[_0xed0c('0x2c')]=_[_0xed0c('0x3f')](_0x28b3c9['query']);_0x1174ac[_0xed0c('0x2d')]=_['intersection'](_0x1174ac[_0xed0c('0x2b')],_0x1174ac[_0xed0c('0x2c')]);_0x4b1913[_0xed0c('0x2f')]=_['intersection'](_0x1174ac[_0xed0c('0x2b')],qs[_0xed0c('0x30')](_0x28b3c9['query'][_0xed0c('0x30')]));_0x4b1913[_0xed0c('0x2f')]=_0x4b1913[_0xed0c('0x2f')][_0xed0c('0x31')]?_0x4b1913[_0xed0c('0x2f')]:_0x1174ac['model'];_0x4b1913[_0xed0c('0x47')]=qs[_0xed0c('0x33')](_0x28b3c9['query'][_0xed0c('0x33')]);_0x4b1913[_0xed0c('0x34')]=qs[_0xed0c('0x2d')](_[_0xed0c('0x35')](_0x28b3c9[_0xed0c('0x2c')],_0x1174ac['filters']));if(_0x28b3c9[_0xed0c('0x2c')][_0xed0c('0x48')]){_0x4b1913[_0xed0c('0x34')]=_[_0xed0c('0x37')](_0x4b1913[_0xed0c('0x34')],{'$or':_[_0xed0c('0x26')](_0x4b1913['attributes'],function(_0x2c786d){var _0x1472d8={};_0x1472d8[_0x2c786d]={'$like':'%'+_0x28b3c9[_0xed0c('0x2c')][_0xed0c('0x48')]+'%'};return _0x1472d8;})});}_0x4b1913=_[_0xed0c('0x37')]({},_0x4b1913,_0x28b3c9['options']);return _0x3cc66b['getActions'](_0x4b1913);}})[_0xed0c('0x20')](function(_0x54d7db){if(_0x54d7db){_0x3bea8d=_0x54d7db[_0xed0c('0x31')];if(!_0x28b3c9[_0xed0c('0x2c')][_0xed0c('0x4d')](_0xed0c('0x32'))){_0x4b1913[_0xed0c('0x1a')]=qs[_0xed0c('0x1a')](_0x28b3c9[_0xed0c('0x2c')][_0xed0c('0x1a')]);_0x4b1913[_0xed0c('0x18')]=qs['offset'](_0x28b3c9['query'][_0xed0c('0x18')]);}return _0x3cc66b['getActions'](_0x4b1913);}})['then'](function(_0x2c67ea){if(_0x2c67ea){return _0x2c67ea?{'count':_0x3bea8d,'rows':_0x2c67ea}:null;}})[_0xed0c('0x20')](respondWithResult(_0x56135d,null))['catch'](handleError(_0x56135d,null));}; \ No newline at end of file +var _0x48a7=['nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','catch','show','params','options','create','body','find','addConditions','ids','getConditions','findOne','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','Automation','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x48a7,0x111));var _0x748a=function(_0x4cf5f5,_0x218a3f){_0x4cf5f5=_0x4cf5f5-0x0;var _0x2d36a7=_0x48a7[_0x4cf5f5];return _0x2d36a7;};'use strict';var emlformat=require(_0x748a('0x0'));var rimraf=require(_0x748a('0x1'));var zipdir=require(_0x748a('0x2'));var jsonpatch=require(_0x748a('0x3'));var rp=require(_0x748a('0x4'));var moment=require('moment');var BPromise=require(_0x748a('0x5'));var Mustache=require(_0x748a('0x6'));var util=require(_0x748a('0x7'));var path=require(_0x748a('0x8'));var sox=require(_0x748a('0x9'));var csv=require('to-csv');var ejs=require(_0x748a('0xa'));var fs=require('fs');var fs_extra=require(_0x748a('0xb'));var _=require(_0x748a('0xc'));var squel=require(_0x748a('0xd'));var crypto=require(_0x748a('0xe'));var jsforce=require(_0x748a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x748a('0x10'));var querystring=require(_0x748a('0x11'));var Papa=require(_0x748a('0x12'));var Redis=require('ioredis');var authService=require(_0x748a('0x13'));var qs=require(_0x748a('0x14'));var as=require(_0x748a('0x15'));var hardwareService=require(_0x748a('0x16'));var logger=require(_0x748a('0x17'))(_0x748a('0x18'));var utils=require(_0x748a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x748a('0x1a'));var db=require(_0x748a('0x1b'))['db'];function respondWithStatusCode(_0x1e4b64,_0x554a24){_0x554a24=_0x554a24||0xcc;return function(_0x1dc72f){if(_0x1dc72f){return _0x1e4b64['sendStatus'](_0x554a24);}return _0x1e4b64[_0x748a('0x1c')](_0x554a24)[_0x748a('0x1d')]();};}function respondWithResult(_0x3189a6,_0xdf4bcf){_0xdf4bcf=_0xdf4bcf||0xc8;return function(_0x35da98){if(_0x35da98){return _0x3189a6[_0x748a('0x1c')](_0xdf4bcf)[_0x748a('0x1e')](_0x35da98);}};}function respondWithFilteredResult(_0x36da27,_0x546553){return function(_0x2a0b8e){if(_0x2a0b8e){var _0x278b2c=typeof _0x546553[_0x748a('0x1f')]===_0x748a('0x20')&&typeof _0x546553['limit']==='undefined';var _0x2dfa32=_0x2a0b8e[_0x748a('0x21')];var _0x37c1fd=_0x278b2c?0x0:_0x546553[_0x748a('0x1f')];var _0x1cfc87=_0x278b2c?_0x2a0b8e[_0x748a('0x21')]:_0x546553[_0x748a('0x1f')]+_0x546553[_0x748a('0x22')];var _0x272ba7;if(_0x1cfc87>=_0x2dfa32){_0x1cfc87=_0x2dfa32;_0x272ba7=0xc8;}else{_0x272ba7=0xce;}_0x36da27[_0x748a('0x1c')](_0x272ba7);return _0x36da27[_0x748a('0x23')](_0x748a('0x24'),_0x37c1fd+'-'+_0x1cfc87+'/'+_0x2dfa32)[_0x748a('0x1e')](_0x2a0b8e);}return null;};}function patchUpdates(_0xbc2600){return function(_0x34aa0d){try{jsonpatch[_0x748a('0x25')](_0x34aa0d,_0xbc2600,!![]);}catch(_0x278236){return BPromise[_0x748a('0x26')](_0x278236);}return _0x34aa0d['save']();};}function saveUpdates(_0x226ce3,_0x58ac5d){return function(_0x39521e){if(_0x39521e){return _0x39521e[_0x748a('0x27')](_0x226ce3)[_0x748a('0x28')](function(_0xea7328){return _0xea7328;});}return null;};}function removeEntity(_0x44b68d,_0x2bddb6){return function(_0x331c21){if(_0x331c21){return _0x331c21[_0x748a('0x29')]()[_0x748a('0x28')](function(){_0x44b68d[_0x748a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x187519,_0x33217e){return function(_0x19bd3d){if(!_0x19bd3d){_0x187519[_0x748a('0x2a')](0x194);}return _0x19bd3d;};}function handleError(_0x2880f0,_0x508345){_0x508345=_0x508345||0x1f4;return function(_0x367bca){logger['error'](_0x367bca['stack']);if(_0x367bca[_0x748a('0x2b')]){delete _0x367bca[_0x748a('0x2b')];}_0x2880f0['status'](_0x508345)[_0x748a('0x2c')](_0x367bca);};}exports['index']=function(_0x4914e5,_0x4c90d6){var _0x584e0f={},_0xc456e2={},_0x1dead4={'count':0x0,'rows':[]};var _0xa01140=_['map'](db[_0x748a('0x2d')][_0x748a('0x2e')],function(_0x350814){return{'name':_0x350814['fieldName'],'type':_0x350814[_0x748a('0x2f')][_0x748a('0x30')]};});_0xc456e2['model']=_[_0x748a('0x31')](_0xa01140,_0x748a('0x2b'));_0xc456e2[_0x748a('0x32')]=_[_0x748a('0x33')](_0x4914e5[_0x748a('0x32')]);_0xc456e2[_0x748a('0x34')]=_[_0x748a('0x35')](_0xc456e2['model'],_0xc456e2[_0x748a('0x32')]);_0x584e0f[_0x748a('0x36')]=_[_0x748a('0x35')](_0xc456e2['model'],qs[_0x748a('0x37')](_0x4914e5[_0x748a('0x32')][_0x748a('0x37')]));_0x584e0f[_0x748a('0x36')]=_0x584e0f[_0x748a('0x36')][_0x748a('0x38')]?_0x584e0f['attributes']:_0xc456e2[_0x748a('0x39')];if(!_0x4914e5['query'][_0x748a('0x3a')](_0x748a('0x3b'))){_0x584e0f[_0x748a('0x22')]=qs[_0x748a('0x22')](_0x4914e5[_0x748a('0x32')][_0x748a('0x22')]);_0x584e0f[_0x748a('0x1f')]=qs[_0x748a('0x1f')](_0x4914e5[_0x748a('0x32')][_0x748a('0x1f')]);}_0x584e0f[_0x748a('0x3c')]=qs[_0x748a('0x3d')](_0x4914e5[_0x748a('0x32')][_0x748a('0x3d')]);_0x584e0f['where']=qs[_0x748a('0x34')](_[_0x748a('0x3e')](_0x4914e5[_0x748a('0x32')],_0xc456e2[_0x748a('0x34')]),_0xa01140);if(_0x4914e5[_0x748a('0x32')][_0x748a('0x3f')]){_0x584e0f[_0x748a('0x40')]=_[_0x748a('0x41')](_0x584e0f[_0x748a('0x40')],{'$or':_[_0x748a('0x31')](_0xa01140,function(_0x45f1f4){if(_0x45f1f4[_0x748a('0x2f')]!=='VIRTUAL'){var _0x343d74={};_0x343d74[_0x45f1f4['name']]={'$like':'%'+_0x4914e5[_0x748a('0x32')]['filter']+'%'};return _0x343d74;}})});}_0x584e0f=_[_0x748a('0x41')]({},_0x584e0f,_0x4914e5['options']);var _0x446908={'where':_0x584e0f[_0x748a('0x40')]};return db[_0x748a('0x2d')][_0x748a('0x21')](_0x446908)[_0x748a('0x28')](function(_0x330f7b){_0x1dead4['count']=_0x330f7b;if(_0x4914e5[_0x748a('0x32')][_0x748a('0x42')]){_0x584e0f['include']=[{'all':!![]}];}return db[_0x748a('0x2d')][_0x748a('0x43')](_0x584e0f);})[_0x748a('0x28')](function(_0x41e6cf){_0x1dead4['rows']=_0x41e6cf;return _0x1dead4;})[_0x748a('0x28')](respondWithFilteredResult(_0x4c90d6,_0x584e0f))[_0x748a('0x44')](handleError(_0x4c90d6,null));};exports[_0x748a('0x45')]=function(_0x4f3860,_0x38d434){var _0xf0a875={'raw':![],'where':{'id':_0x4f3860[_0x748a('0x46')]['id']}},_0x28a66a={};_0x28a66a[_0x748a('0x39')]=_[_0x748a('0x33')](db[_0x748a('0x2d')][_0x748a('0x2e')]);_0x28a66a[_0x748a('0x32')]=_[_0x748a('0x33')](_0x4f3860['query']);_0x28a66a[_0x748a('0x34')]=_[_0x748a('0x35')](_0x28a66a['model'],_0x28a66a[_0x748a('0x32')]);_0xf0a875[_0x748a('0x36')]=_['intersection'](_0x28a66a[_0x748a('0x39')],qs[_0x748a('0x37')](_0x4f3860['query'][_0x748a('0x37')]));_0xf0a875['attributes']=_0xf0a875[_0x748a('0x36')][_0x748a('0x38')]?_0xf0a875[_0x748a('0x36')]:_0x28a66a[_0x748a('0x39')];if(_0x4f3860['query'][_0x748a('0x42')]){_0xf0a875['include']=[{'all':!![]}];}_0xf0a875=_[_0x748a('0x41')]({},_0xf0a875,_0x4f3860[_0x748a('0x47')]);return db[_0x748a('0x2d')]['find'](_0xf0a875)[_0x748a('0x28')](handleEntityNotFound(_0x38d434,null))[_0x748a('0x28')](respondWithResult(_0x38d434,null))['catch'](handleError(_0x38d434,null));};exports['create']=function(_0x8e62ea,_0x3e133a){return db[_0x748a('0x2d')][_0x748a('0x48')](_0x8e62ea[_0x748a('0x49')],{})[_0x748a('0x28')](respondWithResult(_0x3e133a,0xc9))[_0x748a('0x44')](handleError(_0x3e133a,null));};exports[_0x748a('0x27')]=function(_0x27530d,_0x346b5b){if(_0x27530d[_0x748a('0x49')]['id']){delete _0x27530d[_0x748a('0x49')]['id'];}return db[_0x748a('0x2d')][_0x748a('0x4a')]({'where':{'id':_0x27530d[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x346b5b,null))[_0x748a('0x28')](saveUpdates(_0x27530d[_0x748a('0x49')],null))[_0x748a('0x28')](respondWithResult(_0x346b5b,null))[_0x748a('0x44')](handleError(_0x346b5b,null));};exports[_0x748a('0x29')]=function(_0x509904,_0x33811a){return db[_0x748a('0x2d')]['find']({'where':{'id':_0x509904[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x33811a,null))[_0x748a('0x28')](removeEntity(_0x33811a,null))[_0x748a('0x44')](handleError(_0x33811a,null));};exports[_0x748a('0x4b')]=function(_0x2aa2b2,_0x34be4f,_0x3da4a8){return db['Condition'][_0x748a('0x4a')]({'where':{'id':_0x2aa2b2['params']['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x34be4f,null))[_0x748a('0x28')](function(_0x2ea180){if(_0x2ea180){return _0x2ea180[_0x748a('0x4b')](_0x2aa2b2['body'][_0x748a('0x4c')],_['omit'](_0x2aa2b2[_0x748a('0x49')],['ids','id'])||{});}})[_0x748a('0x28')](respondWithResult(_0x34be4f,null))[_0x748a('0x44')](handleError(_0x34be4f,null));};exports[_0x748a('0x4d')]=function(_0x1830db,_0x23320e,_0x48f86a){var _0x12d943={};var _0x192f7a={};var _0x120f98;var _0xbb9892;return db[_0x748a('0x2d')][_0x748a('0x4e')]({'where':{'id':_0x1830db[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x23320e,null))['then'](function(_0x145960){if(_0x145960){_0x120f98=_0x145960;_0x192f7a['model']=_[_0x748a('0x33')](db['Condition'][_0x748a('0x2e')]);_0x192f7a['query']=_[_0x748a('0x33')](_0x1830db[_0x748a('0x32')]);_0x192f7a[_0x748a('0x34')]=_[_0x748a('0x35')](_0x192f7a[_0x748a('0x39')],_0x192f7a['query']);_0x12d943['attributes']=_[_0x748a('0x35')](_0x192f7a[_0x748a('0x39')],qs[_0x748a('0x37')](_0x1830db[_0x748a('0x32')]['fields']));_0x12d943['attributes']=_0x12d943['attributes'][_0x748a('0x38')]?_0x12d943[_0x748a('0x36')]:_0x192f7a['model'];_0x12d943[_0x748a('0x3c')]=qs[_0x748a('0x3d')](_0x1830db[_0x748a('0x32')][_0x748a('0x3d')]);_0x12d943[_0x748a('0x40')]=qs[_0x748a('0x34')](_[_0x748a('0x3e')](_0x1830db['query'],_0x192f7a[_0x748a('0x34')]));if(_0x1830db[_0x748a('0x32')][_0x748a('0x3f')]){_0x12d943[_0x748a('0x40')]=_[_0x748a('0x41')](_0x12d943[_0x748a('0x40')],{'$or':_[_0x748a('0x31')](_0x12d943[_0x748a('0x36')],function(_0x36ee37){var _0x4b42d1={};_0x4b42d1[_0x36ee37]={'$like':'%'+_0x1830db[_0x748a('0x32')]['filter']+'%'};return _0x4b42d1;})});}_0x12d943=_[_0x748a('0x41')]({},_0x12d943,_0x1830db['options']);return _0x120f98['getConditions'](_0x12d943);}})[_0x748a('0x28')](function(_0x1e5152){if(_0x1e5152){_0xbb9892=_0x1e5152[_0x748a('0x38')];if(!_0x1830db['query'][_0x748a('0x3a')](_0x748a('0x3b'))){_0x12d943[_0x748a('0x22')]=qs[_0x748a('0x22')](_0x1830db[_0x748a('0x32')]['limit']);_0x12d943[_0x748a('0x1f')]=qs[_0x748a('0x1f')](_0x1830db[_0x748a('0x32')]['offset']);}return _0x120f98[_0x748a('0x4d')](_0x12d943);}})[_0x748a('0x28')](function(_0x39d12a){if(_0x39d12a){return _0x39d12a?{'count':_0xbb9892,'rows':_0x39d12a}:null;}})[_0x748a('0x28')](respondWithResult(_0x23320e,null))[_0x748a('0x44')](handleError(_0x23320e,null));};exports[_0x748a('0x4f')]=function(_0x24424c,_0x49c648,_0x5a37df){return db[_0x748a('0x50')][_0x748a('0x4a')]({'where':{'id':_0x24424c[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x49c648,null))[_0x748a('0x28')](function(_0x5646a3){if(_0x5646a3){return _0x5646a3['addActions'](_0x24424c['body'][_0x748a('0x4c')],_[_0x748a('0x51')](_0x24424c[_0x748a('0x49')],['ids','id'])||{});}})[_0x748a('0x28')](respondWithResult(_0x49c648,null))[_0x748a('0x44')](handleError(_0x49c648,null));};exports[_0x748a('0x52')]=function(_0xf3dcca,_0x216661,_0x5c6a3c){var _0x400ff5={};var _0x1ad9e9={};var _0xd5582d;var _0xfaaf44;return db['Automation'][_0x748a('0x4e')]({'where':{'id':_0xf3dcca[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x216661,null))['then'](function(_0x15c3e7){if(_0x15c3e7){_0xd5582d=_0x15c3e7;_0x1ad9e9[_0x748a('0x39')]=_[_0x748a('0x33')](db[_0x748a('0x50')][_0x748a('0x2e')]);_0x1ad9e9[_0x748a('0x32')]=_['keys'](_0xf3dcca['query']);_0x1ad9e9['filters']=_[_0x748a('0x35')](_0x1ad9e9[_0x748a('0x39')],_0x1ad9e9[_0x748a('0x32')]);_0x400ff5['attributes']=_[_0x748a('0x35')](_0x1ad9e9[_0x748a('0x39')],qs[_0x748a('0x37')](_0xf3dcca[_0x748a('0x32')][_0x748a('0x37')]));_0x400ff5[_0x748a('0x36')]=_0x400ff5['attributes']['length']?_0x400ff5['attributes']:_0x1ad9e9[_0x748a('0x39')];_0x400ff5[_0x748a('0x3c')]=qs[_0x748a('0x3d')](_0xf3dcca[_0x748a('0x32')]['sort']);_0x400ff5[_0x748a('0x40')]=qs[_0x748a('0x34')](_[_0x748a('0x3e')](_0xf3dcca[_0x748a('0x32')],_0x1ad9e9[_0x748a('0x34')]));if(_0xf3dcca[_0x748a('0x32')][_0x748a('0x3f')]){_0x400ff5[_0x748a('0x40')]=_['merge'](_0x400ff5['where'],{'$or':_[_0x748a('0x31')](_0x400ff5[_0x748a('0x36')],function(_0x95ce95){var _0xe505a1={};_0xe505a1[_0x95ce95]={'$like':'%'+_0xf3dcca['query']['filter']+'%'};return _0xe505a1;})});}_0x400ff5=_['merge']({},_0x400ff5,_0xf3dcca[_0x748a('0x47')]);return _0xd5582d['getActions'](_0x400ff5);}})[_0x748a('0x28')](function(_0x5d0f62){if(_0x5d0f62){_0xfaaf44=_0x5d0f62[_0x748a('0x38')];if(!_0xf3dcca['query'][_0x748a('0x3a')](_0x748a('0x3b'))){_0x400ff5['limit']=qs[_0x748a('0x22')](_0xf3dcca['query'][_0x748a('0x22')]);_0x400ff5['offset']=qs[_0x748a('0x1f')](_0xf3dcca[_0x748a('0x32')][_0x748a('0x1f')]);}return _0xd5582d[_0x748a('0x52')](_0x400ff5);}})[_0x748a('0x28')](function(_0x92d50f){if(_0x92d50f){return _0x92d50f?{'count':_0xfaaf44,'rows':_0x92d50f}:null;}})[_0x748a('0x28')](respondWithResult(_0x216661,null))[_0x748a('0x44')](handleError(_0x216661,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c7003c1..e47d315 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 _0x79d0=['rimraf','../../config/environment','exports','define','Automation','tools_automations','../../config/logger','api','moment','bluebird','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x79d0,0x119));var _0x079d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x79d0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x079d('0x0'))(_0x079d('0x1'));var moment=require(_0x079d('0x2'));var BPromise=require(_0x079d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x079d('0x4'));var rimraf=require(_0x079d('0x5'));var config=require(_0x079d('0x6'));var attributes=require('./automation.attributes');module[_0x079d('0x7')]=function(_0x8ddd10,_0x32fd3c){return _0x8ddd10[_0x079d('0x8')](_0x079d('0x9'),attributes,{'tableName':_0x079d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76ea=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','../../config/logger','api','moment'];(function(_0x5bc158,_0x20ba90){var _0x288d43=function(_0x4e1c7f){while(--_0x4e1c7f){_0x5bc158['push'](_0x5bc158['shift']());}};_0x288d43(++_0x20ba90);}(_0x76ea,0x8d));var _0xa76e=function(_0x4bf862,_0x29576f){_0x4bf862=_0x4bf862-0x0;var _0x3098ac=_0x76ea[_0x4bf862];return _0x3098ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa76e('0x0'))(_0xa76e('0x1'));var moment=require(_0xa76e('0x2'));var BPromise=require(_0xa76e('0x3'));var rp=require(_0xa76e('0x4'));var fs=require('fs');var path=require(_0xa76e('0x5'));var rimraf=require(_0xa76e('0x6'));var config=require('../../config/environment');var attributes=require(_0xa76e('0x7'));module[_0xa76e('0x8')]=function(_0x50b89c,_0x7c7d22){return _0x50b89c[_0xa76e('0x9')](_0xa76e('0xa'),attributes,{'tableName':_0xa76e('0xb'),'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 9acd0f8..f34e745 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 _0x17a7=['Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x39a71e,_0x128d6c){var _0x1d62fb=function(_0x5206a0){while(--_0x5206a0){_0x39a71e['push'](_0x39a71e['shift']());}};_0x1d62fb(++_0x128d6c);}(_0x17a7,0xc2));var _0x717a=function(_0x5d1936,_0xb360f){_0x5d1936=_0x5d1936-0x0;var _0x56f5bd=_0x17a7[_0x5d1936];return _0x56f5bd;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('Automation,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('Automation,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});} \ No newline at end of file +var _0xbcff=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xf230c7,_0x50fb7c){var _0x5a47f6=function(_0x4e5e5e){while(--_0x4e5e5e){_0xf230c7['push'](_0xf230c7['shift']());}};_0x5a47f6(++_0x50fb7c);}(_0xbcff,0x12e));var _0xfbcf=function(_0x286469,_0x370823){_0x286469=_0x286469-0x0;var _0x194ba3=_0xbcff[_0x286469];return _0x194ba3;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcf('0x3'));var fs=require('fs');var Redis=require(_0xfbcf('0x4'));var db=require(_0xfbcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbcf('0x6'))(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcf('0x9')][_0xfbcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b87de,_0x51ee67,_0x470fa8){return new BPromise(function(_0x520d5f,_0x1481ba){return client['request'](_0x4b87de,_0x470fa8)[_0xfbcf('0xb')](function(_0xc63f23){logger['info']('Automation,\x20%s,\x20%s',_0x51ee67,_0xfbcf('0xc'));logger[_0xfbcf('0xd')](_0xfbcf('0xe'),_0x51ee67,_0xfbcf('0xc'),JSON['stringify'](_0xc63f23));if(_0xc63f23[_0xfbcf('0xf')]){if(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x10')]===0x1f4){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x1481ba(_0xc63f23['error'][_0xfbcf('0x12')]);}logger['error'](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x520d5f(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);}else{logger[_0xfbcf('0x13')](_0xfbcf('0x11'),_0x51ee67,_0xfbcf('0xc'));_0x520d5f(_0xc63f23[_0xfbcf('0x14')]['message']);}})[_0xfbcf('0x15')](function(_0xdb7a6a){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xdb7a6a);_0x1481ba(_0xdb7a6a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f6085be..f4ec2fe 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 _0x2b67=['../../config/environment','./automation.controller','get','/:id','isAuthenticated','show','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x2b67,0xf3));var _0x72b6=function(_0x1b3b15,_0x166d63){_0x1b3b15=_0x1b3b15-0x0;var _0x19814c=_0x2b67[_0x1b3b15];return _0x19814c;};'use strict';var multer=require(_0x72b6('0x0'));var util=require(_0x72b6('0x1'));var path=require(_0x72b6('0x2'));var timeout=require(_0x72b6('0x3'));var express=require(_0x72b6('0x4'));var router=express[_0x72b6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x72b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x72b6('0x7'));var controller=require(_0x72b6('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x72b6('0x9')](_0x72b6('0xa'),auth[_0x72b6('0xb')](),controller[_0x72b6('0xc')]);router[_0x72b6('0x9')]('/:id/conditions',auth[_0x72b6('0xb')](),controller[_0x72b6('0xd')]);router['get']('/:id/actions',auth[_0x72b6('0xb')](),controller[_0x72b6('0xe')]);router[_0x72b6('0xf')]('/',auth[_0x72b6('0xb')](),controller[_0x72b6('0x10')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0x72b6('0x11')]);router[_0x72b6('0xf')](_0x72b6('0x12'),auth[_0x72b6('0xb')](),controller[_0x72b6('0x13')]);router[_0x72b6('0x14')](_0x72b6('0xa'),auth[_0x72b6('0xb')](),controller[_0x72b6('0x15')]);router[_0x72b6('0x16')](_0x72b6('0xa'),auth[_0x72b6('0xb')](),controller[_0x72b6('0x17')]);module[_0x72b6('0x18')]=router; \ No newline at end of file +var _0x2e35=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id/conditions','/:id/actions','getActions','create','post','addConditions','update','delete','/:id'];(function(_0x2a38cd,_0x10bb84){var _0x307ba4=function(_0x4a6597){while(--_0x4a6597){_0x2a38cd['push'](_0x2a38cd['shift']());}};_0x307ba4(++_0x10bb84);}(_0x2e35,0x1d0));var _0x52e3=function(_0x298760,_0x3c4245){_0x298760=_0x298760-0x0;var _0x31ef5e=_0x2e35[_0x298760];return _0x31ef5e;};'use strict';var multer=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var path=require(_0x52e3('0x2'));var timeout=require('connect-timeout');var express=require(_0x52e3('0x3'));var router=express[_0x52e3('0x4')]();var fs_extra=require(_0x52e3('0x5'));var auth=require(_0x52e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x52e3('0x7'));var controller=require(_0x52e3('0x8'));router[_0x52e3('0x9')]('/',auth[_0x52e3('0xa')](),controller['index']);router['get']('/:id',auth[_0x52e3('0xa')](),controller['show']);router['get'](_0x52e3('0xb'),auth[_0x52e3('0xa')](),controller['getConditions']);router[_0x52e3('0x9')](_0x52e3('0xc'),auth['isAuthenticated'](),controller[_0x52e3('0xd')]);router['post']('/',auth[_0x52e3('0xa')](),controller[_0x52e3('0xe')]);router[_0x52e3('0xf')]('/:id/conditions',auth[_0x52e3('0xa')](),controller[_0x52e3('0x10')]);router['post'](_0x52e3('0xc'),auth['isAuthenticated'](),controller['addActions']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x52e3('0x11')]);router[_0x52e3('0x12')](_0x52e3('0x13'),auth[_0x52e3('0xa')](),controller[_0x52e3('0x14')]);module[_0x52e3('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 9329860..dbc5f9a 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 _0xac67=['#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)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED'];(function(_0x4d9624,_0x195209){var _0x55f750=function(_0x47da52){while(--_0x47da52){_0x4d9624['push'](_0x4d9624['shift']());}};_0x55f750(++_0x195209);}(_0xac67,0x1d7));var _0x7ac6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xac67[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x7ac6('0x0'));module[_0x7ac6('0x1')]={'name':{'type':Sequelize[_0x7ac6('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7ac6('0x3')),'allowNull':![],'defaultValue':_0x7ac6('0x3')},'description':{'type':Sequelize[_0x7ac6('0x2')]},'active':{'type':Sequelize[_0x7ac6('0x4')],'defaultValue':0x0,'comment':_0x7ac6('0x5')},'limitCalls':{'type':Sequelize[_0x7ac6('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7ac6('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac6('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7ac6('0x6')](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac6('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7ac6('0x6')](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac6('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7ac6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7ac6('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7ac6('0x6')](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac6('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7ac6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7ac6('0x2')],'defaultValue':_0x7ac6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x7ac6('0x10')](_0x7ac6('0x11'),_0x7ac6('0x12'),_0x7ac6('0x13')),'defaultValue':_0x7ac6('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7ac6('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x7ac6('0x6')](0x9)[_0x7ac6('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7ac6('0x6')](0x9)[_0x7ac6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7ac6('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7ac6('0x6')](0x9)[_0x7ac6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7ac6('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7ac6('0x6')](0x9)[_0x7ac6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7ac6('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x7ac6('0x6')](0x9)[_0x7ac6('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7ac6('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7ac6('0x6')](0x9)[_0x7ac6('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7ac6('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7ac6('0x6')](0x9)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7ac6('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x7ac6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7ac6('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7ac6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x7ac6('0x10')](_0x7ac6('0x1c'),_0x7ac6('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x7ac6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ac6('0x1e')},'dialCutDigit':{'type':Sequelize[_0x7ac6('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ac6('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac6('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac6('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac6('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x7ac6('0x6')](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac6('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7ac6('0x6')](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac6('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac6('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac6('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7ac6('0x6')](0x3)[_0x7ac6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ac6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac6('0x27')}}; \ No newline at end of file +var _0x2ae7=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN'];(function(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0x2ae7,0xcb));var _0x72ae=function(_0x2cc2dc,_0x293524){_0x2cc2dc=_0x2cc2dc-0x0;var _0x300a95=_0x2ae7[_0x2cc2dc];return _0x300a95;};'use strict';var Sequelize=require(_0x72ae('0x0'));module[_0x72ae('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x72ae('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x72ae('0x3')](_0x72ae('0x4')),'allowNull':![],'defaultValue':_0x72ae('0x4')},'description':{'type':Sequelize[_0x72ae('0x5')]},'active':{'type':Sequelize[_0x72ae('0x6')],'defaultValue':0x0,'comment':_0x72ae('0x7')},'limitCalls':{'type':Sequelize[_0x72ae('0x8')](0x4)[_0x72ae('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x72ae('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x72ae('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x72ae('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x72ae('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x72ae('0x11')},'dialTimezone':{'type':Sequelize[_0x72ae('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x72ae('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x72ae('0x3')](_0x72ae('0x12'),_0x72ae('0x13'),_0x72ae('0x14')),'defaultValue':_0x72ae('0x12')},'dialAMDActive':{'type':Sequelize[_0x72ae('0x6')],'defaultValue':0x0,'comment':_0x72ae('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x72ae('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x72ae('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x72ae('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x72ae('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x72ae('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x72ae('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x72ae('0x1a'),'ASC'),'defaultValue':_0x72ae('0x1a')},'dialPrefix':{'type':Sequelize[_0x72ae('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x72ae('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'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 4d3bd35..764cf61 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 _0x30fc=['send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','Campaign','includeAll','findAll','rows','catch','show','params','length','include','find','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','ListId','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','undefined','limit','count','offset','set','Content-Range','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x30fc,0x64));var _0xc30f=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x30fc[_0x9d14e3];return _0x19bf32;};'use strict';var emlformat=require(_0xc30f('0x0'));var rimraf=require(_0xc30f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc30f('0x2'));var rp=require(_0xc30f('0x3'));var moment=require(_0xc30f('0x4'));var BPromise=require(_0xc30f('0x5'));var Mustache=require('mustache');var util=require(_0xc30f('0x6'));var path=require(_0xc30f('0x7'));var sox=require(_0xc30f('0x8'));var csv=require(_0xc30f('0x9'));var ejs=require(_0xc30f('0xa'));var fs=require('fs');var fs_extra=require(_0xc30f('0xb'));var _=require('lodash');var squel=require(_0xc30f('0xc'));var crypto=require(_0xc30f('0xd'));var jsforce=require(_0xc30f('0xe'));var deskjs=require(_0xc30f('0xf'));var toCsv=require(_0xc30f('0x9'));var querystring=require(_0xc30f('0x10'));var Papa=require(_0xc30f('0x11'));var Redis=require(_0xc30f('0x12'));var authService=require(_0xc30f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc30f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc30f('0x15'))(_0xc30f('0x16'));var utils=require(_0xc30f('0x17'));var config=require(_0xc30f('0x18'));var licenseUtil=require(_0xc30f('0x19'));var db=require(_0xc30f('0x1a'))['db'];function respondWithStatusCode(_0x4f6d18,_0x524998){_0x524998=_0x524998||0xcc;return function(_0x3bc956){if(_0x3bc956){return _0x4f6d18[_0xc30f('0x1b')](_0x524998);}return _0x4f6d18[_0xc30f('0x1c')](_0x524998)[_0xc30f('0x1d')]();};}function respondWithResult(_0x574679,_0xabfaa2){_0xabfaa2=_0xabfaa2||0xc8;return function(_0x3db4d1){if(_0x3db4d1){return _0x574679[_0xc30f('0x1c')](_0xabfaa2)[_0xc30f('0x1e')](_0x3db4d1);}};}function respondWithFilteredResult(_0x318f3e,_0x1b753d){return function(_0xdd5a56){if(_0xdd5a56){var _0x4fbdcd=typeof _0x1b753d['offset']===_0xc30f('0x1f')&&typeof _0x1b753d[_0xc30f('0x20')]===_0xc30f('0x1f');var _0x3f64dd=_0xdd5a56[_0xc30f('0x21')];var _0x220bb1=_0x4fbdcd?0x0:_0x1b753d['offset'];var _0x36883b=_0x4fbdcd?_0xdd5a56['count']:_0x1b753d[_0xc30f('0x22')]+_0x1b753d[_0xc30f('0x20')];var _0x1520f4;if(_0x36883b>=_0x3f64dd){_0x36883b=_0x3f64dd;_0x1520f4=0xc8;}else{_0x1520f4=0xce;}_0x318f3e[_0xc30f('0x1c')](_0x1520f4);return _0x318f3e[_0xc30f('0x23')](_0xc30f('0x24'),_0x220bb1+'-'+_0x36883b+'/'+_0x3f64dd)[_0xc30f('0x1e')](_0xdd5a56);}return null;};}function patchUpdates(_0x2136b8){return function(_0x2a4eb9){try{jsonpatch['apply'](_0x2a4eb9,_0x2136b8,!![]);}catch(_0x20f9c1){return BPromise[_0xc30f('0x25')](_0x20f9c1);}return _0x2a4eb9['save']();};}function saveUpdates(_0x218e5b,_0x19db62){return function(_0x2ac4a6){if(_0x2ac4a6){return _0x2ac4a6[_0xc30f('0x26')](_0x218e5b)[_0xc30f('0x27')](function(_0x321e92){return _0x321e92;});}return null;};}function removeEntity(_0xe555c2,_0x4e26b9){return function(_0x1e9805){if(_0x1e9805){return _0x1e9805['destroy']()[_0xc30f('0x27')](function(){var _0x50122e=_0x1e9805[_0xc30f('0x28')]({'plain':!![]});var _0x321d3a=_0xc30f('0x29');return db[_0xc30f('0x2a')][_0xc30f('0x2b')]({'where':{'type':_0x321d3a,'resourceId':_0x50122e['id']}})[_0xc30f('0x27')](function(){return _0x1e9805;});})[_0xc30f('0x27')](function(){_0xe555c2[_0xc30f('0x1c')](0xcc)[_0xc30f('0x1d')]();});}};}function handleEntityNotFound(_0x2893e2,_0x3bf154){return function(_0x1b7ed1){if(!_0x1b7ed1){_0x2893e2[_0xc30f('0x1b')](0x194);}return _0x1b7ed1;};}function handleError(_0x516dcf,_0x50a9d4){_0x50a9d4=_0x50a9d4||0x1f4;return function(_0x45c7ae){logger[_0xc30f('0x2c')](_0x45c7ae[_0xc30f('0x2d')]);if(_0x45c7ae[_0xc30f('0x2e')]){delete _0x45c7ae['name'];}_0x516dcf[_0xc30f('0x1c')](_0x50a9d4)[_0xc30f('0x2f')](_0x45c7ae);};}exports['index']=function(_0x4f4761,_0x3b9b7f){var _0x2059ac={},_0x465e16={},_0x2dbda6={'count':0x0,'rows':[]};var _0x3aad7a=_[_0xc30f('0x30')](db['Campaign'][_0xc30f('0x31')],function(_0x2fc922){return{'name':_0x2fc922[_0xc30f('0x32')],'type':_0x2fc922[_0xc30f('0x33')][_0xc30f('0x34')]};});_0x465e16[_0xc30f('0x35')]=_[_0xc30f('0x30')](_0x3aad7a,'name');_0x465e16['query']=_[_0xc30f('0x36')](_0x4f4761[_0xc30f('0x37')]);_0x465e16['filters']=_[_0xc30f('0x38')](_0x465e16['model'],_0x465e16['query']);_0x2059ac[_0xc30f('0x39')]=_['intersection'](_0x465e16['model'],qs[_0xc30f('0x3a')](_0x4f4761[_0xc30f('0x37')][_0xc30f('0x3a')]));_0x2059ac[_0xc30f('0x39')]=_0x2059ac['attributes']['length']?_0x2059ac[_0xc30f('0x39')]:_0x465e16[_0xc30f('0x35')];if(!_0x4f4761['query'][_0xc30f('0x3b')](_0xc30f('0x3c'))){_0x2059ac[_0xc30f('0x20')]=qs['limit'](_0x4f4761['query']['limit']);_0x2059ac[_0xc30f('0x22')]=qs[_0xc30f('0x22')](_0x4f4761[_0xc30f('0x37')][_0xc30f('0x22')]);}_0x2059ac[_0xc30f('0x3d')]=qs[_0xc30f('0x3e')](_0x4f4761[_0xc30f('0x37')][_0xc30f('0x3e')]);_0x2059ac[_0xc30f('0x3f')]=qs[_0xc30f('0x40')](_[_0xc30f('0x41')](_0x4f4761[_0xc30f('0x37')],_0x465e16['filters']),_0x3aad7a);if(_0x4f4761[_0xc30f('0x37')][_0xc30f('0x42')]){_0x2059ac[_0xc30f('0x3f')]=_[_0xc30f('0x43')](_0x2059ac[_0xc30f('0x3f')],{'$or':_['map'](_0x3aad7a,function(_0x3ea6b2){if(_0x3ea6b2[_0xc30f('0x33')]!=='VIRTUAL'){var _0x1b3765={};_0x1b3765[_0x3ea6b2[_0xc30f('0x2e')]]={'$like':'%'+_0x4f4761[_0xc30f('0x37')][_0xc30f('0x42')]+'%'};return _0x1b3765;}})});}_0x2059ac=_[_0xc30f('0x43')]({},_0x2059ac,_0x4f4761[_0xc30f('0x44')]);var _0x14236d={'where':_0x2059ac[_0xc30f('0x3f')]};return db[_0xc30f('0x45')][_0xc30f('0x21')](_0x14236d)[_0xc30f('0x27')](function(_0x1b17c4){_0x2dbda6['count']=_0x1b17c4;if(_0x4f4761[_0xc30f('0x37')][_0xc30f('0x46')]){_0x2059ac['include']=[{'all':!![]}];}return db[_0xc30f('0x45')][_0xc30f('0x47')](_0x2059ac);})[_0xc30f('0x27')](function(_0x29cdf7){_0x2dbda6[_0xc30f('0x48')]=_0x29cdf7;return _0x2dbda6;})['then'](respondWithFilteredResult(_0x3b9b7f,_0x2059ac))[_0xc30f('0x49')](handleError(_0x3b9b7f,null));};exports[_0xc30f('0x4a')]=function(_0x33ae6a,_0x4e4291){var _0x18d2bb={'raw':![],'where':{'id':_0x33ae6a[_0xc30f('0x4b')]['id']}},_0x2c395f={};_0x2c395f['model']=_[_0xc30f('0x36')](db[_0xc30f('0x45')][_0xc30f('0x31')]);_0x2c395f[_0xc30f('0x37')]=_[_0xc30f('0x36')](_0x33ae6a[_0xc30f('0x37')]);_0x2c395f['filters']=_[_0xc30f('0x38')](_0x2c395f['model'],_0x2c395f[_0xc30f('0x37')]);_0x18d2bb[_0xc30f('0x39')]=_[_0xc30f('0x38')](_0x2c395f[_0xc30f('0x35')],qs['fields'](_0x33ae6a['query'][_0xc30f('0x3a')]));_0x18d2bb[_0xc30f('0x39')]=_0x18d2bb[_0xc30f('0x39')][_0xc30f('0x4c')]?_0x18d2bb['attributes']:_0x2c395f[_0xc30f('0x35')];if(_0x33ae6a[_0xc30f('0x37')][_0xc30f('0x46')]){_0x18d2bb[_0xc30f('0x4d')]=[{'all':!![]}];}_0x18d2bb=_[_0xc30f('0x43')]({},_0x18d2bb,_0x33ae6a[_0xc30f('0x44')]);return db['Campaign'][_0xc30f('0x4e')](_0x18d2bb)[_0xc30f('0x27')](handleEntityNotFound(_0x4e4291,null))[_0xc30f('0x27')](respondWithResult(_0x4e4291,null))['catch'](handleError(_0x4e4291,null));};exports['create']=function(_0x23d9dc,_0xb72297){return db[_0xc30f('0x45')]['create'](_0x23d9dc[_0xc30f('0x4f')],{})[_0xc30f('0x27')](function(_0x46e2de){var _0x148cca=_0x23d9dc['user']['get']({'plain':!![]});if(!_0x148cca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x148cca[_0xc30f('0x50')]===_0xc30f('0x51')){var _0x3ddda2=_0x46e2de[_0xc30f('0x28')]({'plain':!![]});var _0x4bacd2=_0xc30f('0x29');return db[_0xc30f('0x52')]['find']({'where':{'name':_0x4bacd2,'userProfileId':_0x148cca[_0xc30f('0x53')]},'raw':!![]})[_0xc30f('0x27')](function(_0x3ee8f0){if(_0x3ee8f0&&_0x3ee8f0[_0xc30f('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x3ddda2[_0xc30f('0x2e')],'resourceId':_0x3ddda2['id'],'type':_0x3ee8f0['name'],'sectionId':_0x3ee8f0['id']},{})['then'](function(){return _0x46e2de;});}else{return _0x46e2de;}})[_0xc30f('0x49')](function(_0x20bc25){logger[_0xc30f('0x2c')](_0xc30f('0x55'),_0x20bc25);throw _0x20bc25;});}return _0x46e2de;})[_0xc30f('0x27')](respondWithResult(_0xb72297,0xc9))['catch'](handleError(_0xb72297,null));};exports[_0xc30f('0x56')]=function(_0x3abc0a,_0x3f25ec){var _0x5ec8f1={'where':{'id':_0x3abc0a[_0xc30f('0x4b')]['id']}},_0x3593a6={};_0x3593a6[_0xc30f('0x35')]=_[_0xc30f('0x36')](db[_0xc30f('0x45')]['rawAttributes']);_0x5ec8f1[_0xc30f('0x39')]=_['intersection'](_0x3593a6[_0xc30f('0x35')],qs[_0xc30f('0x3a')](_0x3abc0a[_0xc30f('0x37')][_0xc30f('0x3a')]));_0x5ec8f1[_0xc30f('0x39')]=_0x5ec8f1[_0xc30f('0x39')]['length']?_0x5ec8f1[_0xc30f('0x39')]:_0x3593a6['model'];if(_0x3abc0a[_0xc30f('0x37')][_0xc30f('0x46')]){_0x5ec8f1['include']=[{'all':!![]}];}_0x5ec8f1=_['merge']({},_0x5ec8f1,_0x3abc0a['options']);return db[_0xc30f('0x45')][_0xc30f('0x4e')](_0x5ec8f1)['then'](handleEntityNotFound(_0x3f25ec,null))[_0xc30f('0x27')](function(_0x22a1bf){if(_0x22a1bf){var _0x5cf393=_0x22a1bf[_0xc30f('0x28')]({'plain':!![]});_0x5cf393=qs[_0xc30f('0x57')](_0x5cf393,['id',_0xc30f('0x58'),_0xc30f('0x59')]);_0x3abc0a['body']=_['omit'](_0x3abc0a['body'],['id',_0xc30f('0x58'),_0xc30f('0x59')]);return db[_0xc30f('0x45')][_0xc30f('0x5a')](_['merge'](_0x5cf393,_0x3abc0a[_0xc30f('0x4f')]),{'include':_0x3abc0a[_0xc30f('0x37')][_0xc30f('0x46')]?[{'all':!![]}]:undefined})[_0xc30f('0x27')](function(_0x2295ff){var _0x24a9b5=_0x3abc0a[_0xc30f('0x51')][_0xc30f('0x28')]({'plain':!![]});if(!_0x24a9b5)throw new Error(_0xc30f('0x5b'));if(_0x24a9b5['role']===_0xc30f('0x51')){var _0x41217b=_0x2295ff[_0xc30f('0x28')]({'plain':!![]});var _0x27f852=_0xc30f('0x29');return db[_0xc30f('0x52')]['find']({'where':{'name':_0x27f852,'userProfileId':_0x24a9b5[_0xc30f('0x53')]},'raw':!![]})[_0xc30f('0x27')](function(_0x17afcf){if(_0x17afcf&&_0x17afcf[_0xc30f('0x54')]===0x0){return db['UserProfileResource'][_0xc30f('0x5a')]({'name':_0x41217b[_0xc30f('0x2e')],'resourceId':_0x41217b['id'],'type':_0x17afcf['name'],'sectionId':_0x17afcf['id']},{})[_0xc30f('0x27')](function(){return _0x2295ff;});}else{return _0x2295ff;}})['catch'](function(_0x164445){logger[_0xc30f('0x2c')](_0xc30f('0x55'),_0x164445);throw _0x164445;});}return _0x2295ff;});}})['then'](respondWithResult(_0x3f25ec,0xc9))[_0xc30f('0x49')](handleError(_0x3f25ec,null));};exports[_0xc30f('0x26')]=function(_0x270c67,_0x3b17fa){if(_0x270c67[_0xc30f('0x4f')]['id']){delete _0x270c67[_0xc30f('0x4f')]['id'];}return db['Campaign'][_0xc30f('0x4e')]({'where':{'id':_0x270c67[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x3b17fa,null))[_0xc30f('0x27')](saveUpdates(_0x270c67[_0xc30f('0x4f')],null))[_0xc30f('0x27')](respondWithResult(_0x3b17fa,null))[_0xc30f('0x49')](handleError(_0x3b17fa,null));};exports[_0xc30f('0x2b')]=function(_0x2efb38,_0x2ad720){return db[_0xc30f('0x45')][_0xc30f('0x4e')]({'where':{'id':_0x2efb38['params']['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x2ad720,null))[_0xc30f('0x27')](removeEntity(_0x2ad720,null))['catch'](handleError(_0x2ad720,null));};exports['getHoppers']=function(_0x58dec3,_0xadb25,_0x2a2a3c){var _0x89123c={'raw':!![],'where':{}};var _0x197a4f={};var _0x153e35={'count':0x0,'rows':[]};return db[_0xc30f('0x45')][_0xc30f('0x5c')]({'where':{'id':_0x58dec3[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0xadb25,null))[_0xc30f('0x27')](function(_0x4828dc){if(_0x4828dc){_0x197a4f[_0xc30f('0x35')]=_[_0xc30f('0x36')](db[_0xc30f('0x5d')][_0xc30f('0x31')]);_0x197a4f[_0xc30f('0x37')]=_[_0xc30f('0x36')](_0x58dec3[_0xc30f('0x37')]);_0x197a4f[_0xc30f('0x40')]=_['intersection'](_0x197a4f[_0xc30f('0x35')],_0x197a4f[_0xc30f('0x37')]);_0x89123c[_0xc30f('0x39')]=_['intersection'](_0x197a4f['model'],qs['fields'](_0x58dec3[_0xc30f('0x37')][_0xc30f('0x3a')]));_0x89123c[_0xc30f('0x39')]=_0x89123c[_0xc30f('0x39')]['length']?_0x89123c['attributes']:_0x197a4f[_0xc30f('0x35')];if(!_0x58dec3['query'][_0xc30f('0x3b')](_0xc30f('0x3c'))){_0x89123c[_0xc30f('0x20')]=qs[_0xc30f('0x20')](_0x58dec3[_0xc30f('0x37')]['limit']);_0x89123c[_0xc30f('0x22')]=qs[_0xc30f('0x22')](_0x58dec3[_0xc30f('0x37')][_0xc30f('0x22')]);}_0x89123c[_0xc30f('0x3d')]=qs[_0xc30f('0x3e')](_0x58dec3[_0xc30f('0x37')][_0xc30f('0x3e')]);_0x89123c[_0xc30f('0x3f')]=qs[_0xc30f('0x40')](_['pick'](_0x58dec3[_0xc30f('0x37')],_0x197a4f[_0xc30f('0x40')]));_0x89123c[_0xc30f('0x3f')][_0xc30f('0x5e')]=_0x4828dc['id'];if(_0x58dec3['query'][_0xc30f('0x42')]){_0x89123c[_0xc30f('0x3f')]=_['merge'](_0x89123c['where'],{'$or':_[_0xc30f('0x30')](_0x89123c[_0xc30f('0x39')],function(_0x4f2495){var _0xd56888={};_0xd56888[_0x4f2495]={'$like':'%'+_0x58dec3[_0xc30f('0x37')][_0xc30f('0x42')]+'%'};return _0xd56888;})});}_0x89123c=_[_0xc30f('0x43')]({},_0x89123c,_0x58dec3[_0xc30f('0x44')]);return db[_0xc30f('0x5d')][_0xc30f('0x21')]({'where':_0x89123c['where']})[_0xc30f('0x27')](function(_0x368cab){_0x153e35['count']=_0x368cab;if(_0x58dec3['query'][_0xc30f('0x46')]){_0x89123c[_0xc30f('0x4d')]=[{'all':!![]}];}return db[_0xc30f('0x5d')][_0xc30f('0x47')](_0x89123c);})[_0xc30f('0x27')](function(_0x1e462e){_0x153e35[_0xc30f('0x48')]=_0x1e462e;return _0x153e35;});}})[_0xc30f('0x27')](respondWithFilteredResult(_0xadb25,_0x89123c))[_0xc30f('0x49')](handleError(_0xadb25,null));};exports[_0xc30f('0x5f')]=function(_0x37c5e3,_0x1fe57f,_0x17caa8){var _0x42513f={'raw':!![],'where':{}};var _0xc870b8={};var _0xcb0646={'count':0x0,'rows':[]};return db['Campaign'][_0xc30f('0x5c')]({'where':{'id':_0x37c5e3[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x1fe57f,null))[_0xc30f('0x27')](function(_0x3c0f45){if(_0x3c0f45){_0xc870b8[_0xc30f('0x35')]=_[_0xc30f('0x36')](db[_0xc30f('0x60')][_0xc30f('0x31')]);_0xc870b8['query']=_[_0xc30f('0x36')](_0x37c5e3[_0xc30f('0x37')]);_0xc870b8[_0xc30f('0x40')]=_[_0xc30f('0x38')](_0xc870b8[_0xc30f('0x35')],_0xc870b8[_0xc30f('0x37')]);_0x42513f[_0xc30f('0x39')]=_[_0xc30f('0x38')](_0xc870b8['model'],qs['fields'](_0x37c5e3[_0xc30f('0x37')][_0xc30f('0x3a')]));_0x42513f[_0xc30f('0x39')]=_0x42513f[_0xc30f('0x39')][_0xc30f('0x4c')]?_0x42513f[_0xc30f('0x39')]:_0xc870b8['model'];if(!_0x37c5e3['query']['hasOwnProperty']('nolimit')){_0x42513f[_0xc30f('0x20')]=qs[_0xc30f('0x20')](_0x37c5e3['query'][_0xc30f('0x20')]);_0x42513f[_0xc30f('0x22')]=qs[_0xc30f('0x22')](_0x37c5e3[_0xc30f('0x37')][_0xc30f('0x22')]);}_0x42513f[_0xc30f('0x3d')]=qs[_0xc30f('0x3e')](_0x37c5e3[_0xc30f('0x37')][_0xc30f('0x3e')]);_0x42513f['where']=qs[_0xc30f('0x40')](_['pick'](_0x37c5e3[_0xc30f('0x37')],_0xc870b8['filters']));_0x42513f[_0xc30f('0x3f')][_0xc30f('0x5e')]=_0x3c0f45['id'];if(_0x37c5e3['query'][_0xc30f('0x42')]){_0x42513f[_0xc30f('0x3f')]=_[_0xc30f('0x43')](_0x42513f['where'],{'$or':_[_0xc30f('0x30')](_0x42513f['attributes'],function(_0x414fbe){var _0x57e826={};_0x57e826[_0x414fbe]={'$like':'%'+_0x37c5e3[_0xc30f('0x37')][_0xc30f('0x42')]+'%'};return _0x57e826;})});}_0x42513f=_[_0xc30f('0x43')]({},_0x42513f,_0x37c5e3[_0xc30f('0x44')]);return db[_0xc30f('0x60')]['count']({'where':_0x42513f[_0xc30f('0x3f')]})['then'](function(_0x2fc37b){_0xcb0646['count']=_0x2fc37b;if(_0x37c5e3[_0xc30f('0x37')][_0xc30f('0x46')]){_0x42513f[_0xc30f('0x4d')]=[{'all':!![]}];}return db[_0xc30f('0x60')]['findAll'](_0x42513f);})[_0xc30f('0x27')](function(_0x24d73b){_0xcb0646[_0xc30f('0x48')]=_0x24d73b;return _0xcb0646;});}})['then'](respondWithFilteredResult(_0x1fe57f,_0x42513f))['catch'](handleError(_0x1fe57f,null));};exports['getHopperFinals']=function(_0x4cd6bd,_0x35cc3e,_0x3c29c3){var _0x46b14a={'raw':!![],'where':{}};var _0x253137={};var _0x9cc161={'count':0x0,'rows':[]};return db[_0xc30f('0x45')][_0xc30f('0x5c')]({'where':{'id':_0x4cd6bd[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x35cc3e,null))[_0xc30f('0x27')](function(_0x1c5f65){if(_0x1c5f65){_0x253137[_0xc30f('0x35')]=_[_0xc30f('0x36')](db[_0xc30f('0x61')][_0xc30f('0x31')]);_0x253137['query']=_[_0xc30f('0x36')](_0x4cd6bd[_0xc30f('0x37')]);_0x253137[_0xc30f('0x40')]=_['intersection'](_0x253137[_0xc30f('0x35')],_0x253137[_0xc30f('0x37')]);_0x46b14a['attributes']=_[_0xc30f('0x38')](_0x253137[_0xc30f('0x35')],qs[_0xc30f('0x3a')](_0x4cd6bd[_0xc30f('0x37')][_0xc30f('0x3a')]));_0x46b14a[_0xc30f('0x39')]=_0x46b14a[_0xc30f('0x39')]['length']?_0x46b14a[_0xc30f('0x39')]:_0x253137[_0xc30f('0x35')];if(!_0x4cd6bd['query']['hasOwnProperty'](_0xc30f('0x3c'))){_0x46b14a[_0xc30f('0x20')]=qs[_0xc30f('0x20')](_0x4cd6bd['query']['limit']);_0x46b14a[_0xc30f('0x22')]=qs[_0xc30f('0x22')](_0x4cd6bd['query'][_0xc30f('0x22')]);}_0x46b14a[_0xc30f('0x3d')]=qs[_0xc30f('0x3e')](_0x4cd6bd[_0xc30f('0x37')]['sort']);_0x46b14a[_0xc30f('0x3f')]=qs[_0xc30f('0x40')](_[_0xc30f('0x41')](_0x4cd6bd[_0xc30f('0x37')],_0x253137[_0xc30f('0x40')]));_0x46b14a[_0xc30f('0x3f')][_0xc30f('0x5e')]=_0x1c5f65['id'];if(_0x4cd6bd['query'][_0xc30f('0x42')]){_0x46b14a['where']=_[_0xc30f('0x43')](_0x46b14a[_0xc30f('0x3f')],{'$or':_[_0xc30f('0x30')](_0x46b14a['attributes'],function(_0xdfb3fd){var _0x1f65fe={};_0x1f65fe[_0xdfb3fd]={'$like':'%'+_0x4cd6bd['query']['filter']+'%'};return _0x1f65fe;})});}_0x46b14a=_[_0xc30f('0x43')]({},_0x46b14a,_0x4cd6bd[_0xc30f('0x44')]);return db[_0xc30f('0x61')][_0xc30f('0x21')]({'where':_0x46b14a[_0xc30f('0x3f')]})[_0xc30f('0x27')](function(_0x37e1c2){_0x9cc161['count']=_0x37e1c2;if(_0x4cd6bd['query'][_0xc30f('0x46')]){_0x46b14a[_0xc30f('0x4d')]=[{'all':!![]}];}return db[_0xc30f('0x61')][_0xc30f('0x47')](_0x46b14a);})[_0xc30f('0x27')](function(_0x589387){_0x9cc161[_0xc30f('0x48')]=_0x589387;return _0x9cc161;});}})['then'](respondWithFilteredResult(_0x35cc3e,_0x46b14a))[_0xc30f('0x49')](handleError(_0x35cc3e,null));};exports[_0xc30f('0x62')]=function(_0x3f72c,_0x45eecf,_0x1e0037){var _0x4bbf80={'raw':!![],'where':{}};var _0x1b51bc={};var _0x17c5df={'count':0x0,'rows':[]};return db['Campaign'][_0xc30f('0x5c')]({'where':{'id':_0x3f72c[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x45eecf,null))['then'](function(_0x41d55a){if(_0x41d55a){_0x1b51bc[_0xc30f('0x35')]=_[_0xc30f('0x36')](db[_0xc30f('0x63')][_0xc30f('0x31')]);_0x1b51bc['query']=_[_0xc30f('0x36')](_0x3f72c[_0xc30f('0x37')]);_0x1b51bc[_0xc30f('0x40')]=_['intersection'](_0x1b51bc[_0xc30f('0x35')],_0x1b51bc[_0xc30f('0x37')]);_0x4bbf80[_0xc30f('0x39')]=_['intersection'](_0x1b51bc[_0xc30f('0x35')],qs[_0xc30f('0x3a')](_0x3f72c[_0xc30f('0x37')][_0xc30f('0x3a')]));_0x4bbf80[_0xc30f('0x39')]=_0x4bbf80[_0xc30f('0x39')][_0xc30f('0x4c')]?_0x4bbf80[_0xc30f('0x39')]:_0x1b51bc[_0xc30f('0x35')];if(!_0x3f72c['query'][_0xc30f('0x3b')](_0xc30f('0x3c'))){_0x4bbf80[_0xc30f('0x20')]=qs['limit'](_0x3f72c[_0xc30f('0x37')][_0xc30f('0x20')]);_0x4bbf80[_0xc30f('0x22')]=qs['offset'](_0x3f72c[_0xc30f('0x37')][_0xc30f('0x22')]);}_0x4bbf80['order']=qs[_0xc30f('0x3e')](_0x3f72c[_0xc30f('0x37')][_0xc30f('0x3e')]);_0x4bbf80[_0xc30f('0x3f')]=qs[_0xc30f('0x40')](_[_0xc30f('0x41')](_0x3f72c['query'],_0x1b51bc[_0xc30f('0x40')]));_0x4bbf80[_0xc30f('0x3f')][_0xc30f('0x5e')]=_0x41d55a['id'];if(_0x3f72c[_0xc30f('0x37')][_0xc30f('0x42')]){_0x4bbf80['where']=_[_0xc30f('0x43')](_0x4bbf80[_0xc30f('0x3f')],{'$or':_['map'](_0x4bbf80[_0xc30f('0x39')],function(_0x1d9118){var _0x33ae9a={};_0x33ae9a[_0x1d9118]={'$like':'%'+_0x3f72c[_0xc30f('0x37')][_0xc30f('0x42')]+'%'};return _0x33ae9a;})});}_0x4bbf80=_[_0xc30f('0x43')]({},_0x4bbf80,_0x3f72c[_0xc30f('0x44')]);return db[_0xc30f('0x63')]['count']({'where':_0x4bbf80['where']})[_0xc30f('0x27')](function(_0x47aedd){_0x17c5df[_0xc30f('0x21')]=_0x47aedd;if(_0x3f72c['query']['includeAll']){_0x4bbf80[_0xc30f('0x4d')]=[{'all':!![]}];}return db[_0xc30f('0x63')][_0xc30f('0x47')](_0x4bbf80);})[_0xc30f('0x27')](function(_0x42d4fb){_0x17c5df[_0xc30f('0x48')]=_0x42d4fb;return _0x17c5df;});}})[_0xc30f('0x27')](respondWithFilteredResult(_0x45eecf,_0x4bbf80))[_0xc30f('0x49')](handleError(_0x45eecf,null));};exports[_0xc30f('0x64')]=function(_0x539fdb,_0x3b92e9,_0x3c7c6d){var _0x2a4743={};var _0x541d8e={};var _0x1e405e;var _0x29ec8f;return db[_0xc30f('0x45')][_0xc30f('0x5c')]({'where':{'id':_0x539fdb[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x3b92e9,null))[_0xc30f('0x27')](function(_0x5d5cb3){if(_0x5d5cb3){_0x1e405e=_0x5d5cb3;_0x541d8e['model']=_[_0xc30f('0x36')](db[_0xc30f('0x65')][_0xc30f('0x31')]);_0x541d8e['query']=_[_0xc30f('0x36')](_0x539fdb[_0xc30f('0x37')]);_0x541d8e[_0xc30f('0x40')]=_[_0xc30f('0x38')](_0x541d8e['model'],_0x541d8e['query']);_0x2a4743[_0xc30f('0x39')]=_['intersection'](_0x541d8e['model'],qs[_0xc30f('0x3a')](_0x539fdb['query'][_0xc30f('0x3a')]));_0x2a4743[_0xc30f('0x39')]=_0x2a4743[_0xc30f('0x39')][_0xc30f('0x4c')]?_0x2a4743[_0xc30f('0x39')]:_0x541d8e[_0xc30f('0x35')];_0x2a4743[_0xc30f('0x3d')]=qs['sort'](_0x539fdb[_0xc30f('0x37')][_0xc30f('0x3e')]);_0x2a4743[_0xc30f('0x3f')]=qs['filters'](_[_0xc30f('0x41')](_0x539fdb[_0xc30f('0x37')],_0x541d8e[_0xc30f('0x40')]));if(_0x539fdb['query'][_0xc30f('0x42')]){_0x2a4743[_0xc30f('0x3f')]=_['merge'](_0x2a4743[_0xc30f('0x3f')],{'$or':_[_0xc30f('0x30')](_0x2a4743[_0xc30f('0x39')],function(_0x2ca2fd){var _0x43555d={};_0x43555d[_0x2ca2fd]={'$like':'%'+_0x539fdb[_0xc30f('0x37')][_0xc30f('0x42')]+'%'};return _0x43555d;})});}_0x2a4743=_[_0xc30f('0x43')]({},_0x2a4743,_0x539fdb['options']);return _0x1e405e[_0xc30f('0x64')](_0x2a4743);}})[_0xc30f('0x27')](function(_0x1e28d3){if(_0x1e28d3){_0x29ec8f=_0x1e28d3[_0xc30f('0x4c')];if(!_0x539fdb[_0xc30f('0x37')][_0xc30f('0x3b')](_0xc30f('0x3c'))){_0x2a4743[_0xc30f('0x20')]=qs[_0xc30f('0x20')](_0x539fdb[_0xc30f('0x37')][_0xc30f('0x20')]);_0x2a4743[_0xc30f('0x22')]=qs[_0xc30f('0x22')](_0x539fdb[_0xc30f('0x37')]['offset']);}return _0x1e405e[_0xc30f('0x64')](_0x2a4743);}})[_0xc30f('0x27')](function(_0x4cf4d2){if(_0x4cf4d2){return _0x4cf4d2?{'count':_0x29ec8f,'rows':_0x4cf4d2}:null;}})[_0xc30f('0x27')](respondWithResult(_0x3b92e9,null))[_0xc30f('0x49')](handleError(_0x3b92e9,null));};exports[_0xc30f('0x66')]=function(_0x372e69,_0x42d6c2,_0x57f434){var _0x5c49cf,_0x3c4afe;var _0x1724cb=[];var _0x2b62ea=moment()['format'](_0xc30f('0x67'));return db[_0xc30f('0x45')]['find']({'where':{'id':_0x372e69['params']['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x42d6c2,null))[_0xc30f('0x27')](function(_0x352ae7){if(_0x352ae7){_0x3c4afe=_0x352ae7;return _0x352ae7[_0xc30f('0x66')](_0x372e69[_0xc30f('0x4f')]['ids'],_['omit'](_0x372e69['body'],['ids','id'])||{});}return null;})[_0xc30f('0x68')](function(_0x2632a9){var _0x34d0d6;var _0x55a119;_0x5c49cf=_0x2632a9||[];var _0x11a367=[];if(_0x2632a9){for(var _0x3ed075=0x0;_0x3ed075<_0x2632a9['length'];_0x3ed075+=0x1){var _0x4ecca0=_0x2632a9[_0x3ed075][_0xc30f('0x28')]({'plain':!![]});_0x3c4afe[_0xc30f('0x69')]=_0x372e69[_0xc30f('0x4f')][_0xc30f('0x69')]?_0x372e69[_0xc30f('0x4f')]['dialCheckDuplicateType']:_0x3c4afe['dialCheckDuplicateType'];switch(_0x3c4afe[_0xc30f('0x69')]){case _0xc30f('0x6a'):_0x34d0d6=squel[_0xc30f('0x6b')]()['into']('cm_hopper')[_0xc30f('0x6c')]([_0xc30f('0x6d'),_0xc30f('0x6e'),_0xc30f('0x6f'),'ListId',_0xc30f('0x5e'),'createdAt','updatedAt'],squel[_0xc30f('0x70')]()[_0xc30f('0x71')](_0xc30f('0x6d'),'phone')['field'](_0xc30f('0x72'),'scheduledAt')['field']('id',_0xc30f('0x6f'))[_0xc30f('0x71')](_0x4ecca0[_0xc30f('0x73')][_0xc30f('0x74')](),'ListId')[_0xc30f('0x71')](_0x372e69['params']['id']['toString'](),_0xc30f('0x5e'))['field']('\x27'+_0x2b62ea+'\x27',_0xc30f('0x58'))[_0xc30f('0x71')]('\x27'+_0x2b62ea+'\x27',_0xc30f('0x59'))[_0xc30f('0x75')](_0xc30f('0x76'))[_0xc30f('0x3f')](_0xc30f('0x77'))['where']('ListId\x20=\x20?',_0x4ecca0[_0xc30f('0x73')]['toString']())['where'](_0xc30f('0x78'))[_0xc30f('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0xc30f('0x75')](_0xc30f('0x79'))[_0xc30f('0x3f')](_0xc30f('0x7a'),_0x372e69[_0xc30f('0x4b')]['id']['toString']()))[_0xc30f('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc30f('0x70')]()[_0xc30f('0x71')](_0xc30f('0x7b'))[_0xc30f('0x75')](_0xc30f('0x7c'))[_0xc30f('0x3f')](_0xc30f('0x7a'),_0x372e69[_0xc30f('0x4b')]['id'][_0xc30f('0x74')]())))[_0xc30f('0x74')]();break;case _0xc30f('0x7d'):_0x34d0d6=squel[_0xc30f('0x6b')]()[_0xc30f('0x7e')]('cm_hopper')[_0xc30f('0x6c')]([_0xc30f('0x6d'),_0xc30f('0x6e'),_0xc30f('0x6f'),_0xc30f('0x7f'),'CampaignId','createdAt','updatedAt'],squel[_0xc30f('0x70')]()[_0xc30f('0x71')]('phone',_0xc30f('0x6d'))[_0xc30f('0x71')]('NOW()','scheduledAt')['field']('id',_0xc30f('0x6f'))['field'](_0x4ecca0['CmListId']['toString'](),_0xc30f('0x7f'))[_0xc30f('0x71')](_0x372e69[_0xc30f('0x4b')]['id']['toString'](),'CampaignId')[_0xc30f('0x71')]('\x27'+_0x2b62ea+'\x27','createdAt')['field']('\x27'+_0x2b62ea+'\x27',_0xc30f('0x59'))[_0xc30f('0x75')](_0xc30f('0x76'))[_0xc30f('0x3f')](_0xc30f('0x77'))['where'](_0xc30f('0x80'),_0x4ecca0['CmListId'][_0xc30f('0x74')]())[_0xc30f('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xc30f('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xc30f('0x7b'))[_0xc30f('0x75')](_0xc30f('0x7c'))[_0xc30f('0x3f')](_0xc30f('0x7a'),_0x372e69[_0xc30f('0x4b')]['id'][_0xc30f('0x74')]())))[_0xc30f('0x74')]();break;default:_0x34d0d6=squel['insert']()[_0xc30f('0x7e')](_0xc30f('0x7c'))[_0xc30f('0x6c')]([_0xc30f('0x6d'),_0xc30f('0x6e'),_0xc30f('0x6f'),_0xc30f('0x7f'),_0xc30f('0x5e'),_0xc30f('0x58'),_0xc30f('0x59')],squel[_0xc30f('0x70')]()[_0xc30f('0x71')](_0xc30f('0x6d'),_0xc30f('0x6d'))['field']('NOW()',_0xc30f('0x6e'))[_0xc30f('0x71')]('id',_0xc30f('0x6f'))[_0xc30f('0x71')](_0x4ecca0[_0xc30f('0x73')][_0xc30f('0x74')](),_0xc30f('0x7f'))[_0xc30f('0x71')](_0x372e69['params']['id'][_0xc30f('0x74')](),'CampaignId')[_0xc30f('0x71')]('\x27'+_0x2b62ea+'\x27',_0xc30f('0x58'))[_0xc30f('0x71')]('\x27'+_0x2b62ea+'\x27',_0xc30f('0x59'))[_0xc30f('0x75')](_0xc30f('0x76'))[_0xc30f('0x3f')]('deletedAt\x20IS\x20NULL')[_0xc30f('0x3f')]('ListId\x20=\x20?',_0x4ecca0['CmListId']['toString']())[_0xc30f('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x55a119=squel[_0xc30f('0x6b')]()[_0xc30f('0x7e')](_0xc30f('0x81'))['fromQuery']([_0xc30f('0x82'),_0xc30f('0x6e'),_0xc30f('0x6d'),_0xc30f('0x83'),_0xc30f('0x58'),_0xc30f('0x59')],squel[_0xc30f('0x70')]()[_0xc30f('0x71')](_0xc30f('0x84'),'id')[_0xc30f('0x71')](_0xc30f('0x72'),_0xc30f('0x6e'))[_0xc30f('0x71')](_0xc30f('0x85'),_0xc30f('0x6d'))[_0xc30f('0x71')](_0xc30f('0x86'),_0xc30f('0x83'))['field']('\x27'+_0x2b62ea+'\x27',_0xc30f('0x58'))[_0xc30f('0x71')]('\x27'+_0x2b62ea+'\x27',_0xc30f('0x59'))['from'](_0xc30f('0x87'),'ci')['join']('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0xc30f('0x3f')](_0xc30f('0x88'),_0x4ecca0[_0xc30f('0x73')][_0xc30f('0x74')]())['where']('h.CampaignId=?',_0x372e69[_0xc30f('0x4b')]['id'][_0xc30f('0x74')]())[_0xc30f('0x3f')](_0xc30f('0x89'),_0x2b62ea))[_0xc30f('0x74')]();_0x11a367['push'](db[_0xc30f('0x8a')][_0xc30f('0x37')](_0x34d0d6));_0x1724cb[_0xc30f('0x8b')](db[_0xc30f('0x8a')][_0xc30f('0x37')](_0x55a119));}return BPromise['all'](_0x11a367);}})[_0xc30f('0x27')](function(){return BPromise[_0xc30f('0x8c')](_0x1724cb);})['then'](function(){return _0x5c49cf;})['then'](respondWithResult(_0x42d6c2,null))[_0xc30f('0x49')](handleError(_0x42d6c2,null));};exports[_0xc30f('0x8d')]=function(_0x5ec74c,_0x46b95b,_0x658b68){return db[_0xc30f('0x45')][_0xc30f('0x4e')]({'where':{'id':_0x5ec74c[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x46b95b,null))[_0xc30f('0x27')](function(_0x185913){if(_0x185913){return _0x185913[_0xc30f('0x8d')](_0x5ec74c[_0xc30f('0x37')][_0xc30f('0x8e')]);}})[_0xc30f('0x27')](function(_0x1b6cb5){if(_0x1b6cb5){return db[_0xc30f('0x5d')][_0xc30f('0x2b')]({'where':{'ListId':_0x5ec74c['query'][_0xc30f('0x8e')],'CampaignId':_0x5ec74c['params']['id']}})[_0xc30f('0x27')](function(){return _0x1b6cb5;});}})[_0xc30f('0x27')](respondWithStatusCode(_0x46b95b,null))[_0xc30f('0x49')](handleError(_0x46b95b,null));};exports[_0xc30f('0x8f')]=function(_0x5d2ece,_0x4ff957,_0x1f6063){var _0x4bfab5={};var _0x2eaadc={};var _0x3c9ca1;var _0xa998ac;return db[_0xc30f('0x45')]['findOne']({'where':{'id':_0x5d2ece['params']['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x4ff957,null))[_0xc30f('0x27')](function(_0x5baf5a){if(_0x5baf5a){_0x3c9ca1=_0x5baf5a;_0x2eaadc[_0xc30f('0x35')]=_[_0xc30f('0x36')](db[_0xc30f('0x65')][_0xc30f('0x31')]);_0x2eaadc[_0xc30f('0x37')]=_[_0xc30f('0x36')](_0x5d2ece[_0xc30f('0x37')]);_0x2eaadc['filters']=_[_0xc30f('0x38')](_0x2eaadc[_0xc30f('0x35')],_0x2eaadc['query']);_0x4bfab5['attributes']=_[_0xc30f('0x38')](_0x2eaadc[_0xc30f('0x35')],qs[_0xc30f('0x3a')](_0x5d2ece['query'][_0xc30f('0x3a')]));_0x4bfab5[_0xc30f('0x39')]=_0x4bfab5[_0xc30f('0x39')][_0xc30f('0x4c')]?_0x4bfab5['attributes']:_0x2eaadc[_0xc30f('0x35')];_0x4bfab5[_0xc30f('0x3d')]=qs[_0xc30f('0x3e')](_0x5d2ece[_0xc30f('0x37')]['sort']);_0x4bfab5['where']=qs['filters'](_[_0xc30f('0x41')](_0x5d2ece['query'],_0x2eaadc['filters']));if(_0x5d2ece['query'][_0xc30f('0x42')]){_0x4bfab5[_0xc30f('0x3f')]=_['merge'](_0x4bfab5[_0xc30f('0x3f')],{'$or':_[_0xc30f('0x30')](_0x4bfab5[_0xc30f('0x39')],function(_0x405f0e){var _0x580441={};_0x580441[_0x405f0e]={'$like':'%'+_0x5d2ece[_0xc30f('0x37')][_0xc30f('0x42')]+'%'};return _0x580441;})});}_0x4bfab5=_[_0xc30f('0x43')]({},_0x4bfab5,_0x5d2ece['options']);return _0x3c9ca1[_0xc30f('0x8f')](_0x4bfab5);}})[_0xc30f('0x27')](function(_0x596e66){if(_0x596e66){_0xa998ac=_0x596e66[_0xc30f('0x4c')];if(!_0x5d2ece[_0xc30f('0x37')][_0xc30f('0x3b')]('nolimit')){_0x4bfab5[_0xc30f('0x20')]=qs[_0xc30f('0x20')](_0x5d2ece[_0xc30f('0x37')]['limit']);_0x4bfab5['offset']=qs[_0xc30f('0x22')](_0x5d2ece[_0xc30f('0x37')][_0xc30f('0x22')]);}return _0x3c9ca1['getBlackLists'](_0x4bfab5);}})[_0xc30f('0x27')](function(_0x3db040){if(_0x3db040){return _0x3db040?{'count':_0xa998ac,'rows':_0x3db040}:null;}})['then'](respondWithResult(_0x4ff957,null))['catch'](handleError(_0x4ff957,null));};exports[_0xc30f('0x90')]=function(_0x5a75b4,_0x373c07,_0x1bb0b7){var _0xac420e,_0x402820;var _0x4310d1=[];var _0x566918=moment()['format'](_0xc30f('0x67'));return db['Campaign'][_0xc30f('0x4e')]({'where':{'id':_0x5a75b4[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0x373c07,null))[_0xc30f('0x27')](function(_0x1f9ed1){if(_0x1f9ed1){_0x402820=_0x1f9ed1;return _0x1f9ed1[_0xc30f('0x90')](_0x5a75b4[_0xc30f('0x4f')][_0xc30f('0x8e')],_[_0xc30f('0x57')](_0x5a75b4[_0xc30f('0x4f')],[_0xc30f('0x8e'),'id'])||{});}return null;})[_0xc30f('0x68')](function(_0x3a85e9){var _0xc4079d;var _0x3797b4;_0xac420e=_0x3a85e9||[];var _0x7d6706=[];if(_0x3a85e9){for(var _0x2c612c=0x0;_0x2c612c<_0x3a85e9[_0xc30f('0x4c')];_0x2c612c+=0x1){var _0x2b9294=_0x3a85e9[_0x2c612c][_0xc30f('0x28')]({'plain':!![]});_0xc4079d=squel[_0xc30f('0x6b')]()[_0xc30f('0x7e')](_0xc30f('0x91'))[_0xc30f('0x6c')](['phone',_0xc30f('0x6f'),'ListId',_0xc30f('0x5e'),_0xc30f('0x58'),_0xc30f('0x59')],squel[_0xc30f('0x70')]()[_0xc30f('0x71')]('phone',_0xc30f('0x6d'))[_0xc30f('0x71')]('id',_0xc30f('0x6f'))['field'](_0x2b9294[_0xc30f('0x73')]['toString'](),'ListId')[_0xc30f('0x71')](_0x5a75b4[_0xc30f('0x4b')]['id'][_0xc30f('0x74')](),_0xc30f('0x5e'))[_0xc30f('0x71')]('NOW()','createdAt')[_0xc30f('0x71')](_0xc30f('0x72'),_0xc30f('0x59'))[_0xc30f('0x75')](_0xc30f('0x76'))['where'](_0xc30f('0x77'))['where'](_0xc30f('0x80'),_0x2b9294[_0xc30f('0x73')][_0xc30f('0x74')]())[_0xc30f('0x3f')](_0xc30f('0x78')))[_0xc30f('0x74')]();_0x7d6706[_0xc30f('0x8b')](db[_0xc30f('0x8a')][_0xc30f('0x37')](_0xc4079d));}return BPromise['all'](_0x7d6706);}})['then'](function(){return _0xac420e;})[_0xc30f('0x27')](respondWithResult(_0x373c07,null))[_0xc30f('0x49')](handleError(_0x373c07,null));};exports['removeBlackLists']=function(_0x21c747,_0xf467ba,_0x15a455){return db[_0xc30f('0x45')]['find']({'where':{'id':_0x21c747[_0xc30f('0x4b')]['id']}})[_0xc30f('0x27')](handleEntityNotFound(_0xf467ba,null))[_0xc30f('0x27')](function(_0xe54221){if(_0xe54221){return _0xe54221[_0xc30f('0x92')](_0x21c747[_0xc30f('0x37')][_0xc30f('0x8e')]);}})['then'](function(_0x4f42ae){if(_0x4f42ae){return db['CmHopperBlack'][_0xc30f('0x2b')]({'where':{'ListId':_0x21c747[_0xc30f('0x37')][_0xc30f('0x8e')],'CampaignId':_0x21c747[_0xc30f('0x4b')]['id']}})['then'](function(){return _0x4f42ae;});}})[_0xc30f('0x27')](respondWithStatusCode(_0xf467ba,null))['catch'](handleError(_0xf467ba,null));}; \ No newline at end of file +var _0x7462=['clone','params','rawAttributes','omit','createdAt','updatedAt','UserProfileSection','UserProfileResource','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','select','field','phone','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','ListId','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','IvrCampaigns','destroy','then','end','error','index','map','Campaign','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xf61d62,_0x5e1ce1){var _0x1b8b00=function(_0x21dbba){while(--_0x21dbba){_0xf61d62['push'](_0xf61d62['shift']());}};_0x1b8b00(++_0x5e1ce1);}(_0x7462,0x165));var _0x2746=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x7462[_0x5a27e8];return _0x4e38f7;};'use strict';var emlformat=require(_0x2746('0x0'));var rimraf=require(_0x2746('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2746('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2746('0x3'));var util=require(_0x2746('0x4'));var path=require('path');var sox=require(_0x2746('0x5'));var csv=require(_0x2746('0x6'));var ejs=require(_0x2746('0x7'));var fs=require('fs');var fs_extra=require(_0x2746('0x8'));var _=require(_0x2746('0x9'));var squel=require(_0x2746('0xa'));var crypto=require(_0x2746('0xb'));var jsforce=require(_0x2746('0xc'));var deskjs=require(_0x2746('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2746('0xe'));var Papa=require(_0x2746('0xf'));var Redis=require('ioredis');var authService=require(_0x2746('0x10'));var qs=require(_0x2746('0x11'));var as=require(_0x2746('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2746('0x13'))(_0x2746('0x14'));var utils=require(_0x2746('0x15'));var config=require(_0x2746('0x16'));var licenseUtil=require(_0x2746('0x17'));var db=require(_0x2746('0x18'))['db'];function respondWithStatusCode(_0x51ddae,_0x126a1f){_0x126a1f=_0x126a1f||0xcc;return function(_0x10c17d){if(_0x10c17d){return _0x51ddae[_0x2746('0x19')](_0x126a1f);}return _0x51ddae[_0x2746('0x1a')](_0x126a1f)['end']();};}function respondWithResult(_0x57e57c,_0x251401){_0x251401=_0x251401||0xc8;return function(_0x38c1b3){if(_0x38c1b3){return _0x57e57c[_0x2746('0x1a')](_0x251401)[_0x2746('0x1b')](_0x38c1b3);}};}function respondWithFilteredResult(_0x52028f,_0x1abd61){return function(_0x1a1e02){if(_0x1a1e02){var _0x57edcd=typeof _0x1abd61['offset']===_0x2746('0x1c')&&typeof _0x1abd61[_0x2746('0x1d')]===_0x2746('0x1c');var _0x407d46=_0x1a1e02[_0x2746('0x1e')];var _0x232108=_0x57edcd?0x0:_0x1abd61[_0x2746('0x1f')];var _0x6102f3=_0x57edcd?_0x1a1e02[_0x2746('0x1e')]:_0x1abd61['offset']+_0x1abd61[_0x2746('0x1d')];var _0x5dde3b;if(_0x6102f3>=_0x407d46){_0x6102f3=_0x407d46;_0x5dde3b=0xc8;}else{_0x5dde3b=0xce;}_0x52028f[_0x2746('0x1a')](_0x5dde3b);return _0x52028f[_0x2746('0x20')](_0x2746('0x21'),_0x232108+'-'+_0x6102f3+'/'+_0x407d46)[_0x2746('0x1b')](_0x1a1e02);}return null;};}function patchUpdates(_0xa64e76){return function(_0x2cc260){try{jsonpatch[_0x2746('0x22')](_0x2cc260,_0xa64e76,!![]);}catch(_0x25233b){return BPromise[_0x2746('0x23')](_0x25233b);}return _0x2cc260['save']();};}function saveUpdates(_0x4acb70,_0x7390b3){return function(_0x101c47){if(_0x101c47){return _0x101c47[_0x2746('0x24')](_0x4acb70)['then'](function(_0x24b9c5){return _0x24b9c5;});}return null;};}function removeEntity(_0xf97651,_0x55fe95){return function(_0x2b4652){if(_0x2b4652){return _0x2b4652['destroy']()['then'](function(){var _0x5bc3c8=_0x2b4652['get']({'plain':!![]});var _0xe5a485=_0x2746('0x25');return db['UserProfileResource'][_0x2746('0x26')]({'where':{'type':_0xe5a485,'resourceId':_0x5bc3c8['id']}})['then'](function(){return _0x2b4652;});})[_0x2746('0x27')](function(){_0xf97651[_0x2746('0x1a')](0xcc)[_0x2746('0x28')]();});}};}function handleEntityNotFound(_0x31c9c3,_0x19017f){return function(_0x433526){if(!_0x433526){_0x31c9c3[_0x2746('0x19')](0x194);}return _0x433526;};}function handleError(_0x39b719,_0x5bb96e){_0x5bb96e=_0x5bb96e||0x1f4;return function(_0x102f58){logger[_0x2746('0x29')](_0x102f58['stack']);if(_0x102f58['name']){delete _0x102f58['name'];}_0x39b719['status'](_0x5bb96e)['send'](_0x102f58);};}exports[_0x2746('0x2a')]=function(_0x1305b8,_0x4b4e0f){var _0x51ee16={},_0x44e985={},_0x17f7bf={'count':0x0,'rows':[]};var _0x5d05a2=_[_0x2746('0x2b')](db[_0x2746('0x2c')]['rawAttributes'],function(_0xf7fb3c){return{'name':_0xf7fb3c['fieldName'],'type':_0xf7fb3c['type'][_0x2746('0x2d')]};});_0x44e985[_0x2746('0x2e')]=_[_0x2746('0x2b')](_0x5d05a2,_0x2746('0x2f'));_0x44e985['query']=_[_0x2746('0x30')](_0x1305b8[_0x2746('0x31')]);_0x44e985[_0x2746('0x32')]=_[_0x2746('0x33')](_0x44e985[_0x2746('0x2e')],_0x44e985[_0x2746('0x31')]);_0x51ee16[_0x2746('0x34')]=_[_0x2746('0x33')](_0x44e985['model'],qs[_0x2746('0x35')](_0x1305b8[_0x2746('0x31')][_0x2746('0x35')]));_0x51ee16[_0x2746('0x34')]=_0x51ee16[_0x2746('0x34')][_0x2746('0x36')]?_0x51ee16['attributes']:_0x44e985['model'];if(!_0x1305b8[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x51ee16[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x1305b8['query'][_0x2746('0x1d')]);_0x51ee16[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x1305b8[_0x2746('0x31')][_0x2746('0x1f')]);}_0x51ee16[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x1305b8[_0x2746('0x31')][_0x2746('0x3a')]);_0x51ee16[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x1305b8[_0x2746('0x31')],_0x44e985['filters']),_0x5d05a2);if(_0x1305b8[_0x2746('0x31')][_0x2746('0x3d')]){_0x51ee16[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x51ee16[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x5d05a2,function(_0xd683de){if(_0xd683de[_0x2746('0x3f')]!==_0x2746('0x40')){var _0x57ba44={};_0x57ba44[_0xd683de[_0x2746('0x2f')]]={'$like':'%'+_0x1305b8[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x57ba44;}})});}_0x51ee16=_[_0x2746('0x3e')]({},_0x51ee16,_0x1305b8['options']);var _0xca2a32={'where':_0x51ee16[_0x2746('0x3b')]};return db['Campaign'][_0x2746('0x1e')](_0xca2a32)[_0x2746('0x27')](function(_0x5ef41e){_0x17f7bf['count']=_0x5ef41e;if(_0x1305b8[_0x2746('0x31')]['includeAll']){_0x51ee16['include']=[{'all':!![]}];}return db[_0x2746('0x2c')][_0x2746('0x41')](_0x51ee16);})[_0x2746('0x27')](function(_0x3b5ea4){_0x17f7bf[_0x2746('0x42')]=_0x3b5ea4;return _0x17f7bf;})[_0x2746('0x27')](respondWithFilteredResult(_0x4b4e0f,_0x51ee16))[_0x2746('0x43')](handleError(_0x4b4e0f,null));};exports[_0x2746('0x44')]=function(_0x2132f6,_0x12f5bf){var _0x376c05={'raw':![],'where':{'id':_0x2132f6['params']['id']}},_0x44cb28={};_0x44cb28[_0x2746('0x2e')]=_['keys'](db[_0x2746('0x2c')]['rawAttributes']);_0x44cb28[_0x2746('0x31')]=_['keys'](_0x2132f6[_0x2746('0x31')]);_0x44cb28[_0x2746('0x32')]=_[_0x2746('0x33')](_0x44cb28[_0x2746('0x2e')],_0x44cb28[_0x2746('0x31')]);_0x376c05[_0x2746('0x34')]=_[_0x2746('0x33')](_0x44cb28[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x2132f6[_0x2746('0x31')]['fields']));_0x376c05[_0x2746('0x34')]=_0x376c05['attributes']['length']?_0x376c05[_0x2746('0x34')]:_0x44cb28[_0x2746('0x2e')];if(_0x2132f6[_0x2746('0x31')][_0x2746('0x45')]){_0x376c05[_0x2746('0x46')]=[{'all':!![]}];}_0x376c05=_[_0x2746('0x3e')]({},_0x376c05,_0x2132f6[_0x2746('0x47')]);return db['Campaign'][_0x2746('0x48')](_0x376c05)[_0x2746('0x27')](handleEntityNotFound(_0x12f5bf,null))[_0x2746('0x27')](respondWithResult(_0x12f5bf,null))[_0x2746('0x43')](handleError(_0x12f5bf,null));};exports[_0x2746('0x49')]=function(_0x57191d,_0xc3b3a0){return db['Campaign'][_0x2746('0x49')](_0x57191d[_0x2746('0x4a')],{})[_0x2746('0x27')](function(_0x444826){var _0x3b3359=_0x57191d[_0x2746('0x4b')][_0x2746('0x4c')]({'plain':!![]});if(!_0x3b3359)throw new Error(_0x2746('0x4d'));if(_0x3b3359[_0x2746('0x4e')]==='user'){var _0x5cdd91=_0x444826[_0x2746('0x4c')]({'plain':!![]});var _0x42d7a6=_0x2746('0x25');return db['UserProfileSection'][_0x2746('0x48')]({'where':{'name':_0x42d7a6,'userProfileId':_0x3b3359['userProfileId']},'raw':!![]})['then'](function(_0x2c3696){if(_0x2c3696&&_0x2c3696[_0x2746('0x4f')]===0x0){return db['UserProfileResource'][_0x2746('0x49')]({'name':_0x5cdd91['name'],'resourceId':_0x5cdd91['id'],'type':_0x2c3696[_0x2746('0x2f')],'sectionId':_0x2c3696['id']},{})['then'](function(){return _0x444826;});}else{return _0x444826;}})[_0x2746('0x43')](function(_0x5f20fd){logger[_0x2746('0x29')](_0x2746('0x50'),_0x5f20fd);throw _0x5f20fd;});}return _0x444826;})[_0x2746('0x27')](respondWithResult(_0xc3b3a0,0xc9))[_0x2746('0x43')](handleError(_0xc3b3a0,null));};exports[_0x2746('0x51')]=function(_0x460e51,_0x4b9174){var _0x2aa969={'where':{'id':_0x460e51[_0x2746('0x52')]['id']}},_0x1c2cc8={};_0x1c2cc8[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x2c')][_0x2746('0x53')]);_0x2aa969['attributes']=_[_0x2746('0x33')](_0x1c2cc8[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x460e51[_0x2746('0x31')][_0x2746('0x35')]));_0x2aa969[_0x2746('0x34')]=_0x2aa969[_0x2746('0x34')]['length']?_0x2aa969[_0x2746('0x34')]:_0x1c2cc8[_0x2746('0x2e')];if(_0x460e51[_0x2746('0x31')]['includeAll']){_0x2aa969[_0x2746('0x46')]=[{'all':!![]}];}_0x2aa969=_[_0x2746('0x3e')]({},_0x2aa969,_0x460e51[_0x2746('0x47')]);return db[_0x2746('0x2c')]['find'](_0x2aa969)[_0x2746('0x27')](handleEntityNotFound(_0x4b9174,null))[_0x2746('0x27')](function(_0x56fdca){if(_0x56fdca){var _0x18b604=_0x56fdca[_0x2746('0x4c')]({'plain':!![]});_0x18b604=qs[_0x2746('0x54')](_0x18b604,['id',_0x2746('0x55'),'updatedAt']);_0x460e51[_0x2746('0x4a')]=_[_0x2746('0x54')](_0x460e51[_0x2746('0x4a')],['id','createdAt',_0x2746('0x56')]);return db[_0x2746('0x2c')][_0x2746('0x49')](_[_0x2746('0x3e')](_0x18b604,_0x460e51[_0x2746('0x4a')]),{'include':_0x460e51[_0x2746('0x31')][_0x2746('0x45')]?[{'all':!![]}]:undefined})[_0x2746('0x27')](function(_0x5b455d){var _0xf4e61d=_0x460e51[_0x2746('0x4b')]['get']({'plain':!![]});if(!_0xf4e61d)throw new Error(_0x2746('0x4d'));if(_0xf4e61d[_0x2746('0x4e')]===_0x2746('0x4b')){var _0x58f359=_0x5b455d['get']({'plain':!![]});var _0x270a0c='IvrCampaigns';return db[_0x2746('0x57')][_0x2746('0x48')]({'where':{'name':_0x270a0c,'userProfileId':_0xf4e61d['userProfileId']},'raw':!![]})[_0x2746('0x27')](function(_0x45ce9c){if(_0x45ce9c&&_0x45ce9c['autoAssociation']===0x0){return db[_0x2746('0x58')][_0x2746('0x49')]({'name':_0x58f359[_0x2746('0x2f')],'resourceId':_0x58f359['id'],'type':_0x45ce9c[_0x2746('0x2f')],'sectionId':_0x45ce9c['id']},{})['then'](function(){return _0x5b455d;});}else{return _0x5b455d;}})[_0x2746('0x43')](function(_0x53bf3d){logger[_0x2746('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53bf3d);throw _0x53bf3d;});}return _0x5b455d;});}})['then'](respondWithResult(_0x4b9174,0xc9))['catch'](handleError(_0x4b9174,null));};exports[_0x2746('0x24')]=function(_0x471c90,_0x3d5c47){if(_0x471c90['body']['id']){delete _0x471c90[_0x2746('0x4a')]['id'];}return db['Campaign'][_0x2746('0x48')]({'where':{'id':_0x471c90[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x3d5c47,null))[_0x2746('0x27')](saveUpdates(_0x471c90[_0x2746('0x4a')],null))['then'](respondWithResult(_0x3d5c47,null))['catch'](handleError(_0x3d5c47,null));};exports[_0x2746('0x26')]=function(_0x1fa74f,_0x4c301c){return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x1fa74f[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x4c301c,null))[_0x2746('0x27')](removeEntity(_0x4c301c,null))[_0x2746('0x43')](handleError(_0x4c301c,null));};exports['getHoppers']=function(_0x26f6a1,_0x55b90f,_0x8d71bb){var _0x3aa455={'raw':!![],'where':{}};var _0x41bfeb={};var _0x538548={'count':0x0,'rows':[]};return db[_0x2746('0x2c')][_0x2746('0x59')]({'where':{'id':_0x26f6a1[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x55b90f,null))[_0x2746('0x27')](function(_0x454801){if(_0x454801){_0x41bfeb['model']=_[_0x2746('0x30')](db[_0x2746('0x5a')][_0x2746('0x53')]);_0x41bfeb['query']=_[_0x2746('0x30')](_0x26f6a1[_0x2746('0x31')]);_0x41bfeb['filters']=_[_0x2746('0x33')](_0x41bfeb[_0x2746('0x2e')],_0x41bfeb[_0x2746('0x31')]);_0x3aa455[_0x2746('0x34')]=_[_0x2746('0x33')](_0x41bfeb[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x26f6a1[_0x2746('0x31')][_0x2746('0x35')]));_0x3aa455[_0x2746('0x34')]=_0x3aa455[_0x2746('0x34')]['length']?_0x3aa455[_0x2746('0x34')]:_0x41bfeb[_0x2746('0x2e')];if(!_0x26f6a1[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x3aa455[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x26f6a1['query'][_0x2746('0x1d')]);_0x3aa455[_0x2746('0x1f')]=qs['offset'](_0x26f6a1[_0x2746('0x31')][_0x2746('0x1f')]);}_0x3aa455[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x26f6a1['query']['sort']);_0x3aa455['where']=qs[_0x2746('0x32')](_['pick'](_0x26f6a1['query'],_0x41bfeb[_0x2746('0x32')]));_0x3aa455[_0x2746('0x3b')][_0x2746('0x5b')]=_0x454801['id'];if(_0x26f6a1['query'][_0x2746('0x3d')]){_0x3aa455[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x3aa455[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x3aa455[_0x2746('0x34')],function(_0x41d1f5){var _0x4c1bb5={};_0x4c1bb5[_0x41d1f5]={'$like':'%'+_0x26f6a1['query'][_0x2746('0x3d')]+'%'};return _0x4c1bb5;})});}_0x3aa455=_[_0x2746('0x3e')]({},_0x3aa455,_0x26f6a1[_0x2746('0x47')]);return db[_0x2746('0x5a')][_0x2746('0x1e')]({'where':_0x3aa455[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x5b6436){_0x538548[_0x2746('0x1e')]=_0x5b6436;if(_0x26f6a1[_0x2746('0x31')][_0x2746('0x45')]){_0x3aa455[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5a')][_0x2746('0x41')](_0x3aa455);})[_0x2746('0x27')](function(_0x3db2ef){_0x538548[_0x2746('0x42')]=_0x3db2ef;return _0x538548;});}})[_0x2746('0x27')](respondWithFilteredResult(_0x55b90f,_0x3aa455))[_0x2746('0x43')](handleError(_0x55b90f,null));};exports[_0x2746('0x5c')]=function(_0x47b1ac,_0x12747f,_0x239cc5){var _0x4f4289={'raw':!![],'where':{}};var _0x54f4d0={};var _0x1868b3={'count':0x0,'rows':[]};return db[_0x2746('0x2c')][_0x2746('0x59')]({'where':{'id':_0x47b1ac[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x12747f,null))['then'](function(_0x2402f4){if(_0x2402f4){_0x54f4d0[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x5d')][_0x2746('0x53')]);_0x54f4d0[_0x2746('0x31')]=_['keys'](_0x47b1ac[_0x2746('0x31')]);_0x54f4d0[_0x2746('0x32')]=_['intersection'](_0x54f4d0[_0x2746('0x2e')],_0x54f4d0[_0x2746('0x31')]);_0x4f4289[_0x2746('0x34')]=_[_0x2746('0x33')](_0x54f4d0[_0x2746('0x2e')],qs['fields'](_0x47b1ac[_0x2746('0x31')][_0x2746('0x35')]));_0x4f4289[_0x2746('0x34')]=_0x4f4289['attributes'][_0x2746('0x36')]?_0x4f4289[_0x2746('0x34')]:_0x54f4d0[_0x2746('0x2e')];if(!_0x47b1ac[_0x2746('0x31')][_0x2746('0x37')]('nolimit')){_0x4f4289[_0x2746('0x1d')]=qs['limit'](_0x47b1ac[_0x2746('0x31')][_0x2746('0x1d')]);_0x4f4289[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x47b1ac[_0x2746('0x31')][_0x2746('0x1f')]);}_0x4f4289['order']=qs[_0x2746('0x3a')](_0x47b1ac['query']['sort']);_0x4f4289[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x47b1ac[_0x2746('0x31')],_0x54f4d0[_0x2746('0x32')]));_0x4f4289[_0x2746('0x3b')]['CampaignId']=_0x2402f4['id'];if(_0x47b1ac[_0x2746('0x31')][_0x2746('0x3d')]){_0x4f4289['where']=_[_0x2746('0x3e')](_0x4f4289[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x4f4289['attributes'],function(_0x8ccb24){var _0x283348={};_0x283348[_0x8ccb24]={'$like':'%'+_0x47b1ac[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x283348;})});}_0x4f4289=_[_0x2746('0x3e')]({},_0x4f4289,_0x47b1ac[_0x2746('0x47')]);return db[_0x2746('0x5d')]['count']({'where':_0x4f4289[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x4f5f62){_0x1868b3[_0x2746('0x1e')]=_0x4f5f62;if(_0x47b1ac[_0x2746('0x31')][_0x2746('0x45')]){_0x4f4289[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5d')][_0x2746('0x41')](_0x4f4289);})[_0x2746('0x27')](function(_0x460f4d){_0x1868b3['rows']=_0x460f4d;return _0x1868b3;});}})[_0x2746('0x27')](respondWithFilteredResult(_0x12747f,_0x4f4289))[_0x2746('0x43')](handleError(_0x12747f,null));};exports[_0x2746('0x5e')]=function(_0x39c55d,_0xe3d45b,_0x6d6be2){var _0xa7ddd7={'raw':!![],'where':{}};var _0x2182e4={};var _0x4f077e={'count':0x0,'rows':[]};return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x39c55d[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0xe3d45b,null))[_0x2746('0x27')](function(_0x21264e){if(_0x21264e){_0x2182e4[_0x2746('0x2e')]=_['keys'](db['CmHopperFinal'][_0x2746('0x53')]);_0x2182e4['query']=_[_0x2746('0x30')](_0x39c55d['query']);_0x2182e4['filters']=_[_0x2746('0x33')](_0x2182e4[_0x2746('0x2e')],_0x2182e4['query']);_0xa7ddd7[_0x2746('0x34')]=_['intersection'](_0x2182e4[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x39c55d[_0x2746('0x31')][_0x2746('0x35')]));_0xa7ddd7[_0x2746('0x34')]=_0xa7ddd7[_0x2746('0x34')][_0x2746('0x36')]?_0xa7ddd7[_0x2746('0x34')]:_0x2182e4[_0x2746('0x2e')];if(!_0x39c55d['query'][_0x2746('0x37')](_0x2746('0x38'))){_0xa7ddd7[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x39c55d['query'][_0x2746('0x1d')]);_0xa7ddd7[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x39c55d['query'][_0x2746('0x1f')]);}_0xa7ddd7[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x39c55d[_0x2746('0x31')][_0x2746('0x3a')]);_0xa7ddd7['where']=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x39c55d[_0x2746('0x31')],_0x2182e4['filters']));_0xa7ddd7[_0x2746('0x3b')]['CampaignId']=_0x21264e['id'];if(_0x39c55d[_0x2746('0x31')][_0x2746('0x3d')]){_0xa7ddd7[_0x2746('0x3b')]=_['merge'](_0xa7ddd7[_0x2746('0x3b')],{'$or':_['map'](_0xa7ddd7['attributes'],function(_0x4d4e35){var _0x23098b={};_0x23098b[_0x4d4e35]={'$like':'%'+_0x39c55d['query'][_0x2746('0x3d')]+'%'};return _0x23098b;})});}_0xa7ddd7=_[_0x2746('0x3e')]({},_0xa7ddd7,_0x39c55d[_0x2746('0x47')]);return db[_0x2746('0x5f')][_0x2746('0x1e')]({'where':_0xa7ddd7[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x197941){_0x4f077e[_0x2746('0x1e')]=_0x197941;if(_0x39c55d[_0x2746('0x31')][_0x2746('0x45')]){_0xa7ddd7[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5f')][_0x2746('0x41')](_0xa7ddd7);})[_0x2746('0x27')](function(_0x379087){_0x4f077e[_0x2746('0x42')]=_0x379087;return _0x4f077e;});}})[_0x2746('0x27')](respondWithFilteredResult(_0xe3d45b,_0xa7ddd7))['catch'](handleError(_0xe3d45b,null));};exports['getHopperBlacks']=function(_0x5684bf,_0x2030ed,_0x3ce8a1){var _0x4bc154={'raw':!![],'where':{}};var _0x41bc73={};var _0x47ca03={'count':0x0,'rows':[]};return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x5684bf[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x2030ed,null))[_0x2746('0x27')](function(_0x268936){if(_0x268936){_0x41bc73[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x60')][_0x2746('0x53')]);_0x41bc73['query']=_[_0x2746('0x30')](_0x5684bf[_0x2746('0x31')]);_0x41bc73[_0x2746('0x32')]=_[_0x2746('0x33')](_0x41bc73[_0x2746('0x2e')],_0x41bc73[_0x2746('0x31')]);_0x4bc154[_0x2746('0x34')]=_[_0x2746('0x33')](_0x41bc73['model'],qs[_0x2746('0x35')](_0x5684bf[_0x2746('0x31')][_0x2746('0x35')]));_0x4bc154[_0x2746('0x34')]=_0x4bc154[_0x2746('0x34')][_0x2746('0x36')]?_0x4bc154[_0x2746('0x34')]:_0x41bc73[_0x2746('0x2e')];if(!_0x5684bf[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x4bc154['limit']=qs[_0x2746('0x1d')](_0x5684bf[_0x2746('0x31')][_0x2746('0x1d')]);_0x4bc154[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x5684bf[_0x2746('0x31')][_0x2746('0x1f')]);}_0x4bc154[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x5684bf[_0x2746('0x31')][_0x2746('0x3a')]);_0x4bc154[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x5684bf['query'],_0x41bc73[_0x2746('0x32')]));_0x4bc154[_0x2746('0x3b')]['CampaignId']=_0x268936['id'];if(_0x5684bf['query']['filter']){_0x4bc154[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x4bc154[_0x2746('0x3b')],{'$or':_['map'](_0x4bc154[_0x2746('0x34')],function(_0x3732ed){var _0x47a2c9={};_0x47a2c9[_0x3732ed]={'$like':'%'+_0x5684bf[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x47a2c9;})});}_0x4bc154=_[_0x2746('0x3e')]({},_0x4bc154,_0x5684bf[_0x2746('0x47')]);return db[_0x2746('0x60')][_0x2746('0x1e')]({'where':_0x4bc154[_0x2746('0x3b')]})['then'](function(_0x343a2f){_0x47ca03[_0x2746('0x1e')]=_0x343a2f;if(_0x5684bf['query'][_0x2746('0x45')]){_0x4bc154[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x60')]['findAll'](_0x4bc154);})[_0x2746('0x27')](function(_0x416d47){_0x47ca03[_0x2746('0x42')]=_0x416d47;return _0x47ca03;});}})['then'](respondWithFilteredResult(_0x2030ed,_0x4bc154))['catch'](handleError(_0x2030ed,null));};exports[_0x2746('0x61')]=function(_0x4812da,_0x53bc21,_0x9b01a3){var _0x3e358e={};var _0x29b1e3={};var _0x1363f3;var _0x213e80;return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x4812da['params']['id']}})['then'](handleEntityNotFound(_0x53bc21,null))[_0x2746('0x27')](function(_0x25cf86){if(_0x25cf86){_0x1363f3=_0x25cf86;_0x29b1e3[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x62')][_0x2746('0x53')]);_0x29b1e3[_0x2746('0x31')]=_[_0x2746('0x30')](_0x4812da[_0x2746('0x31')]);_0x29b1e3[_0x2746('0x32')]=_[_0x2746('0x33')](_0x29b1e3[_0x2746('0x2e')],_0x29b1e3[_0x2746('0x31')]);_0x3e358e['attributes']=_[_0x2746('0x33')](_0x29b1e3[_0x2746('0x2e')],qs['fields'](_0x4812da[_0x2746('0x31')][_0x2746('0x35')]));_0x3e358e[_0x2746('0x34')]=_0x3e358e[_0x2746('0x34')]['length']?_0x3e358e['attributes']:_0x29b1e3['model'];_0x3e358e[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x4812da['query']['sort']);_0x3e358e['where']=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x4812da[_0x2746('0x31')],_0x29b1e3[_0x2746('0x32')]));if(_0x4812da[_0x2746('0x31')][_0x2746('0x3d')]){_0x3e358e[_0x2746('0x3b')]=_['merge'](_0x3e358e['where'],{'$or':_[_0x2746('0x2b')](_0x3e358e[_0x2746('0x34')],function(_0x576d07){var _0xe05ced={};_0xe05ced[_0x576d07]={'$like':'%'+_0x4812da[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0xe05ced;})});}_0x3e358e=_['merge']({},_0x3e358e,_0x4812da[_0x2746('0x47')]);return _0x1363f3[_0x2746('0x61')](_0x3e358e);}})['then'](function(_0x39f31e){if(_0x39f31e){_0x213e80=_0x39f31e[_0x2746('0x36')];if(!_0x4812da[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x3e358e[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x4812da[_0x2746('0x31')][_0x2746('0x1d')]);_0x3e358e[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x4812da[_0x2746('0x31')][_0x2746('0x1f')]);}return _0x1363f3[_0x2746('0x61')](_0x3e358e);}})['then'](function(_0x39eaa6){if(_0x39eaa6){return _0x39eaa6?{'count':_0x213e80,'rows':_0x39eaa6}:null;}})[_0x2746('0x27')](respondWithResult(_0x53bc21,null))[_0x2746('0x43')](handleError(_0x53bc21,null));};exports[_0x2746('0x63')]=function(_0x125b68,_0x56a140,_0x20849e){var _0x1bddea,_0x512478;var _0xd971ba=[];var _0x1c01a2=moment()[_0x2746('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x125b68[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x56a140,null))[_0x2746('0x27')](function(_0x134307){if(_0x134307){_0x512478=_0x134307;return _0x134307[_0x2746('0x63')](_0x125b68[_0x2746('0x4a')][_0x2746('0x65')],_[_0x2746('0x54')](_0x125b68[_0x2746('0x4a')],[_0x2746('0x65'),'id'])||{});}return null;})[_0x2746('0x66')](function(_0x3b636b){var _0x2f2217;var _0x8a877f;_0x1bddea=_0x3b636b||[];var _0x52cb5c=[];if(_0x3b636b){for(var _0x4d52b0=0x0;_0x4d52b0<_0x3b636b[_0x2746('0x36')];_0x4d52b0+=0x1){var _0x4761f2=_0x3b636b[_0x4d52b0][_0x2746('0x4c')]({'plain':!![]});_0x512478[_0x2746('0x67')]=_0x125b68[_0x2746('0x4a')]['dialCheckDuplicateType']?_0x125b68[_0x2746('0x4a')][_0x2746('0x67')]:_0x512478['dialCheckDuplicateType'];switch(_0x512478['dialCheckDuplicateType']){case _0x2746('0x68'):_0x2f2217=squel[_0x2746('0x69')]()[_0x2746('0x6a')](_0x2746('0x6b'))[_0x2746('0x6c')](['phone',_0x2746('0x6d'),'ContactId','ListId',_0x2746('0x5b'),_0x2746('0x55'),_0x2746('0x56')],squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x70'),_0x2746('0x70'))['field'](_0x2746('0x71'),_0x2746('0x6d'))[_0x2746('0x6f')]('id',_0x2746('0x72'))[_0x2746('0x6f')](_0x4761f2['CmListId'][_0x2746('0x73')](),'ListId')[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id']['toString'](),_0x2746('0x5b'))[_0x2746('0x6f')]('\x27'+_0x1c01a2+'\x27','createdAt')[_0x2746('0x6f')]('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))['from'](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')](_0x2746('0x76'),_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78'))[_0x2746('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2746('0x6e')]()['field'](_0x2746('0x79'))[_0x2746('0x7a')](_0x2746('0x7b'))[_0x2746('0x3b')](_0x2746('0x7c'),_0x125b68['params']['id']['toString']()))['where'](_0x2746('0x7d'),squel[_0x2746('0x6e')]()[_0x2746('0x6f')]('COALESCE(phone,\x27\x27)')[_0x2746('0x7a')](_0x2746('0x6b'))[_0x2746('0x3b')](_0x2746('0x7c'),_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')]())))['toString']();break;case'onlyIfOpen':_0x2f2217=squel[_0x2746('0x69')]()['into'](_0x2746('0x6b'))[_0x2746('0x6c')]([_0x2746('0x70'),_0x2746('0x6d'),_0x2746('0x72'),'ListId',_0x2746('0x5b'),'createdAt',_0x2746('0x56')],squel[_0x2746('0x6e')]()['field'](_0x2746('0x70'),_0x2746('0x70'))[_0x2746('0x6f')]('NOW()',_0x2746('0x6d'))[_0x2746('0x6f')]('id','ContactId')[_0x2746('0x6f')](_0x4761f2['CmListId'][_0x2746('0x73')](),_0x2746('0x7e'))[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))['field']('\x27'+_0x1c01a2+'\x27','createdAt')['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))[_0x2746('0x7a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x2746('0x3b')]('ListId\x20=\x20?',_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78'))['where'](_0x2746('0x7d'),squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x7f'))[_0x2746('0x7a')](_0x2746('0x6b'))[_0x2746('0x3b')]('CampaignId\x20=\x20?',_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')]())))[_0x2746('0x73')]();break;default:_0x2f2217=squel['insert']()['into'](_0x2746('0x6b'))['fromQuery'](['phone',_0x2746('0x6d'),'ContactId','ListId',_0x2746('0x5b'),'createdAt','updatedAt'],squel[_0x2746('0x6e')]()['field'](_0x2746('0x70'),_0x2746('0x70'))['field'](_0x2746('0x71'),'scheduledAt')[_0x2746('0x6f')]('id',_0x2746('0x72'))[_0x2746('0x6f')](_0x4761f2[_0x2746('0x77')][_0x2746('0x73')](),_0x2746('0x7e'))[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x55'))['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))[_0x2746('0x7a')](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')](_0x2746('0x76'),_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78')))[_0x2746('0x73')]();}_0x8a877f=squel['insert']()[_0x2746('0x6a')](_0x2746('0x80'))[_0x2746('0x6c')]([_0x2746('0x81'),'scheduledAt',_0x2746('0x70'),'OrderBy',_0x2746('0x55'),_0x2746('0x56')],squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x82'),'id')[_0x2746('0x6f')](_0x2746('0x71'),'scheduledAt')[_0x2746('0x6f')]('ci.item',_0x2746('0x70'))[_0x2746('0x6f')](_0x2746('0x83'),_0x2746('0x84'))['field']('\x27'+_0x1c01a2+'\x27','createdAt')['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))['from'](_0x2746('0x85'),'ci')[_0x2746('0x86')](_0x2746('0x6b'),'h',_0x2746('0x87'))[_0x2746('0x3b')]('h.ListId\x20=\x20?',_0x4761f2[_0x2746('0x77')]['toString']())[_0x2746('0x3b')](_0x2746('0x88'),_0x125b68['params']['id'][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x89'),_0x1c01a2))[_0x2746('0x73')]();_0x52cb5c[_0x2746('0x8a')](db[_0x2746('0x8b')]['query'](_0x2f2217));_0xd971ba['push'](db[_0x2746('0x8b')][_0x2746('0x31')](_0x8a877f));}return BPromise['all'](_0x52cb5c);}})[_0x2746('0x27')](function(){return BPromise[_0x2746('0x8c')](_0xd971ba);})[_0x2746('0x27')](function(){return _0x1bddea;})[_0x2746('0x27')](respondWithResult(_0x56a140,null))[_0x2746('0x43')](handleError(_0x56a140,null));};exports['removeLists']=function(_0x50d591,_0xf7895c,_0x10b3de){return db[_0x2746('0x2c')]['find']({'where':{'id':_0x50d591[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0xf7895c,null))[_0x2746('0x27')](function(_0x3985a1){if(_0x3985a1){return _0x3985a1[_0x2746('0x8d')](_0x50d591[_0x2746('0x31')]['ids']);}})[_0x2746('0x27')](function(_0x309013){if(_0x309013){return db['CmHopper'][_0x2746('0x26')]({'where':{'ListId':_0x50d591[_0x2746('0x31')][_0x2746('0x65')],'CampaignId':_0x50d591[_0x2746('0x52')]['id']}})[_0x2746('0x27')](function(){return _0x309013;});}})[_0x2746('0x27')](respondWithStatusCode(_0xf7895c,null))[_0x2746('0x43')](handleError(_0xf7895c,null));};exports[_0x2746('0x8e')]=function(_0x4d6e33,_0x5e63a4,_0x3e4e4f){var _0x31eeb8={};var _0x97430b={};var _0x3ffb83;var _0x3b3843;return db[_0x2746('0x2c')]['findOne']({'where':{'id':_0x4d6e33[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x5e63a4,null))[_0x2746('0x27')](function(_0x41acbc){if(_0x41acbc){_0x3ffb83=_0x41acbc;_0x97430b[_0x2746('0x2e')]=_['keys'](db[_0x2746('0x62')][_0x2746('0x53')]);_0x97430b[_0x2746('0x31')]=_[_0x2746('0x30')](_0x4d6e33[_0x2746('0x31')]);_0x97430b[_0x2746('0x32')]=_[_0x2746('0x33')](_0x97430b['model'],_0x97430b[_0x2746('0x31')]);_0x31eeb8[_0x2746('0x34')]=_[_0x2746('0x33')](_0x97430b['model'],qs['fields'](_0x4d6e33[_0x2746('0x31')]['fields']));_0x31eeb8[_0x2746('0x34')]=_0x31eeb8[_0x2746('0x34')][_0x2746('0x36')]?_0x31eeb8[_0x2746('0x34')]:_0x97430b[_0x2746('0x2e')];_0x31eeb8[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x3a')]);_0x31eeb8['where']=qs[_0x2746('0x32')](_['pick'](_0x4d6e33[_0x2746('0x31')],_0x97430b['filters']));if(_0x4d6e33[_0x2746('0x31')][_0x2746('0x3d')]){_0x31eeb8[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x31eeb8[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x31eeb8['attributes'],function(_0x49e4c9){var _0x160502={};_0x160502[_0x49e4c9]={'$like':'%'+_0x4d6e33[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x160502;})});}_0x31eeb8=_[_0x2746('0x3e')]({},_0x31eeb8,_0x4d6e33['options']);return _0x3ffb83[_0x2746('0x8e')](_0x31eeb8);}})[_0x2746('0x27')](function(_0x29d02f){if(_0x29d02f){_0x3b3843=_0x29d02f[_0x2746('0x36')];if(!_0x4d6e33[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x31eeb8[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x1d')]);_0x31eeb8[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x1f')]);}return _0x3ffb83[_0x2746('0x8e')](_0x31eeb8);}})[_0x2746('0x27')](function(_0x31ee8d){if(_0x31ee8d){return _0x31ee8d?{'count':_0x3b3843,'rows':_0x31ee8d}:null;}})[_0x2746('0x27')](respondWithResult(_0x5e63a4,null))[_0x2746('0x43')](handleError(_0x5e63a4,null));};exports[_0x2746('0x8f')]=function(_0x278e6d,_0x7ab7f8,_0x374078){var _0x1e2293,_0x190358;var _0x1c102f=[];var _0x4e54e8=moment()[_0x2746('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x278e6d[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x7ab7f8,null))['then'](function(_0x258fe0){if(_0x258fe0){_0x190358=_0x258fe0;return _0x258fe0[_0x2746('0x8f')](_0x278e6d[_0x2746('0x4a')]['ids'],_[_0x2746('0x54')](_0x278e6d[_0x2746('0x4a')],[_0x2746('0x65'),'id'])||{});}return null;})[_0x2746('0x66')](function(_0x51a7ed){var _0xfd070f;var _0x34d8f5;_0x1e2293=_0x51a7ed||[];var _0x469935=[];if(_0x51a7ed){for(var _0x487a6a=0x0;_0x487a6a<_0x51a7ed['length'];_0x487a6a+=0x1){var _0x29d7ea=_0x51a7ed[_0x487a6a][_0x2746('0x4c')]({'plain':!![]});_0xfd070f=squel[_0x2746('0x69')]()['into'](_0x2746('0x90'))[_0x2746('0x6c')]([_0x2746('0x70'),_0x2746('0x72'),_0x2746('0x7e'),_0x2746('0x5b'),_0x2746('0x55'),_0x2746('0x56')],squel['select']()['field'](_0x2746('0x70'),_0x2746('0x70'))[_0x2746('0x6f')]('id','ContactId')[_0x2746('0x6f')](_0x29d7ea[_0x2746('0x77')][_0x2746('0x73')](),'ListId')[_0x2746('0x6f')](_0x278e6d[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))[_0x2746('0x6f')](_0x2746('0x71'),'createdAt')[_0x2746('0x6f')]('NOW()','updatedAt')[_0x2746('0x7a')](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')]('ListId\x20=\x20?',_0x29d7ea[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x469935[_0x2746('0x8a')](db['sequelize']['query'](_0xfd070f));}return BPromise[_0x2746('0x8c')](_0x469935);}})[_0x2746('0x27')](function(){return _0x1e2293;})[_0x2746('0x27')](respondWithResult(_0x7ab7f8,null))[_0x2746('0x43')](handleError(_0x7ab7f8,null));};exports[_0x2746('0x91')]=function(_0x18473b,_0x2a8fc5,_0x5be077){return db['Campaign'][_0x2746('0x48')]({'where':{'id':_0x18473b['params']['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x2a8fc5,null))[_0x2746('0x27')](function(_0x5a086a){if(_0x5a086a){return _0x5a086a[_0x2746('0x91')](_0x18473b[_0x2746('0x31')]['ids']);}})[_0x2746('0x27')](function(_0x2c21e5){if(_0x2c21e5){return db[_0x2746('0x60')]['destroy']({'where':{'ListId':_0x18473b[_0x2746('0x31')][_0x2746('0x65')],'CampaignId':_0x18473b[_0x2746('0x52')]['id']}})[_0x2746('0x27')](function(){return _0x2c21e5;});}})[_0x2746('0x27')](respondWithStatusCode(_0x2a8fc5,null))['catch'](handleError(_0x2a8fc5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a714a17..9f824da 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(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0x7a54,0x106));var _0x47a5=function(_0xdad2db,_0x585323){_0xdad2db=_0xdad2db-0x0;var _0x1d4ea8=_0x7a54[_0xdad2db];return _0x1d4ea8;};'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(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 3713547..cec478a 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 _0x2917=['../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0xc43ce7,_0x1941ed){var _0x465faf=function(_0x1626f9){while(--_0x1626f9){_0xc43ce7['push'](_0xc43ce7['shift']());}};_0x465faf(++_0x1941ed);}(_0x2917,0x142));var _0x7291=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0x2917[_0x4370c7];return _0xce78a9;};'use strict';var _=require(_0x7291('0x0'));var util=require(_0x7291('0x1'));var moment=require(_0x7291('0x2'));var BPromise=require(_0x7291('0x3'));var rs=require(_0x7291('0x4'));var fs=require('fs');var Redis=require(_0x7291('0x5'));var db=require(_0x7291('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7291('0x7'));var config=require(_0x7291('0x8'));var jayson=require(_0x7291('0x9'));var client=jayson[_0x7291('0xa')][_0x7291('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x237997,_0x4609af,_0x1f0fd8){return new BPromise(function(_0x452fc5,_0xb013b3){return client[_0x7291('0xc')](_0x237997,_0x1f0fd8)[_0x7291('0xd')](function(_0x27f037){logger[_0x7291('0xe')](_0x7291('0xf'),_0x4609af,'request\x20sent');logger[_0x7291('0x10')](_0x7291('0x11'),_0x4609af,_0x7291('0x12'),JSON[_0x7291('0x13')](_0x27f037));if(_0x27f037[_0x7291('0x14')]){if(_0x27f037[_0x7291('0x14')]['code']===0x1f4){logger['error'](_0x7291('0xf'),_0x4609af,_0x27f037[_0x7291('0x14')][_0x7291('0x15')]);return _0xb013b3(_0x27f037[_0x7291('0x14')][_0x7291('0x15')]);}logger[_0x7291('0x14')](_0x7291('0xf'),_0x4609af,_0x27f037['error'][_0x7291('0x15')]);return _0x452fc5(_0x27f037[_0x7291('0x14')][_0x7291('0x15')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x4609af,_0x7291('0x12'));_0x452fc5(_0x27f037[_0x7291('0x16')][_0x7291('0x15')]);}})[_0x7291('0x17')](function(_0x427602){logger[_0x7291('0x14')]('Campaign,\x20%s,\x20%s',_0x4609af,_0x427602);_0xb013b3(_0x427602);});});}exports[_0x7291('0x18')]=function(_0x1680d2){var _0x9c2228=this;return new Promise(function(_0x4264ed,_0x1634c1){return db['Campaign'][_0x7291('0x19')]({'raw':_0x1680d2['options']?_0x1680d2[_0x7291('0x1a')][_0x7291('0x1b')]===undefined?!![]:![]:!![],'where':_0x1680d2[_0x7291('0x1a')]?_0x1680d2['options'][_0x7291('0x1c')]||null:null,'attributes':_0x1680d2['options']?_0x1680d2[_0x7291('0x1a')][_0x7291('0x1d')]||null:null,'limit':_0x1680d2['options']?_0x1680d2['options']['limit']||null:null,'include':_0x1680d2[_0x7291('0x1a')]?_0x1680d2['options'][_0x7291('0x1e')]?_[_0x7291('0x1f')](_0x1680d2['options'][_0x7291('0x1e')],function(_0x5c5970){return{'model':db[_0x5c5970[_0x7291('0x20')]],'as':_0x5c5970['as'],'attributes':_0x5c5970[_0x7291('0x1d')],'include':_0x5c5970['include']?_[_0x7291('0x1f')](_0x5c5970[_0x7291('0x1e')],function(_0x32169c){return{'model':db[_0x32169c[_0x7291('0x20')]],'as':_0x32169c['as'],'attributes':_0x32169c[_0x7291('0x1d')],'include':_0x32169c[_0x7291('0x1e')]?_[_0x7291('0x1f')](_0x32169c[_0x7291('0x1e')],function(_0x3fd1d2){return{'model':db[_0x3fd1d2['model']],'as':_0x3fd1d2['as'],'attributes':_0x3fd1d2[_0x7291('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7291('0xd')](function(_0x4e2efa){logger[_0x7291('0xe')](_0x7291('0x18'),_0x1680d2);logger['debug'](_0x7291('0x18'),_0x1680d2,JSON[_0x7291('0x13')](_0x4e2efa));_0x4264ed(_0x4e2efa);})['catch'](function(_0x31207c){logger[_0x7291('0x14')](_0x7291('0x18'),_0x31207c['message'],_0x1680d2);_0x1634c1(_0x9c2228[_0x7291('0x14')](0x1f4,_0x31207c['message']));});});}; \ No newline at end of file +var _0xbf3f=['stringify','lodash','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','Campaign','findAll','options','where','limit','include','map','model','attributes','GetCampaign','debug'];(function(_0x39dbc4,_0x29962c){var _0x4fd907=function(_0x1d1733){while(--_0x1d1733){_0x39dbc4['push'](_0x39dbc4['shift']());}};_0x4fd907(++_0x29962c);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfbf3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbf3('0x1'))['db'];var utils=require(_0xfbf3('0x2'));var logger=require(_0xfbf3('0x3'))('rpc');var config=require(_0xfbf3('0x4'));var jayson=require(_0xfbf3('0x5'));var client=jayson[_0xfbf3('0x6')][_0xfbf3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x218007,_0x154f23,_0x7bf395){return new BPromise(function(_0x58460f,_0x2c1143){return client[_0xfbf3('0x8')](_0x218007,_0x7bf395)[_0xfbf3('0x9')](function(_0xfed45a){logger[_0xfbf3('0xa')](_0xfbf3('0xb'),_0x154f23,_0xfbf3('0xc'));logger['debug'](_0xfbf3('0xd'),_0x154f23,_0xfbf3('0xc'),JSON['stringify'](_0xfed45a));if(_0xfed45a[_0xfbf3('0xe')]){if(_0xfed45a[_0xfbf3('0xe')][_0xfbf3('0xf')]===0x1f4){logger[_0xfbf3('0xe')]('Campaign,\x20%s,\x20%s',_0x154f23,_0xfed45a['error'][_0xfbf3('0x10')]);return _0x2c1143(_0xfed45a[_0xfbf3('0xe')][_0xfbf3('0x10')]);}logger[_0xfbf3('0xe')](_0xfbf3('0xb'),_0x154f23,_0xfed45a[_0xfbf3('0xe')][_0xfbf3('0x10')]);return _0x58460f(_0xfed45a[_0xfbf3('0xe')]['message']);}else{logger['info'](_0xfbf3('0xb'),_0x154f23,'request\x20sent');_0x58460f(_0xfed45a[_0xfbf3('0x11')][_0xfbf3('0x10')]);}})['catch'](function(_0x4118e4){logger[_0xfbf3('0xe')](_0xfbf3('0xb'),_0x154f23,_0x4118e4);_0x2c1143(_0x4118e4);});});}exports['GetCampaign']=function(_0x543b69){var _0x3936ee=this;return new Promise(function(_0x51af71,_0xbe46b6){return db[_0xfbf3('0x12')][_0xfbf3('0x13')]({'raw':_0x543b69[_0xfbf3('0x14')]?_0x543b69[_0xfbf3('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x543b69[_0xfbf3('0x14')]?_0x543b69[_0xfbf3('0x14')][_0xfbf3('0x15')]||null:null,'attributes':_0x543b69[_0xfbf3('0x14')]?_0x543b69[_0xfbf3('0x14')]['attributes']||null:null,'limit':_0x543b69['options']?_0x543b69['options'][_0xfbf3('0x16')]||null:null,'include':_0x543b69[_0xfbf3('0x14')]?_0x543b69['options'][_0xfbf3('0x17')]?_[_0xfbf3('0x18')](_0x543b69['options']['include'],function(_0x4f8175){return{'model':db[_0x4f8175[_0xfbf3('0x19')]],'as':_0x4f8175['as'],'attributes':_0x4f8175[_0xfbf3('0x1a')],'include':_0x4f8175[_0xfbf3('0x17')]?_['map'](_0x4f8175['include'],function(_0xf72528){return{'model':db[_0xf72528[_0xfbf3('0x19')]],'as':_0xf72528['as'],'attributes':_0xf72528[_0xfbf3('0x1a')],'include':_0xf72528['include']?_['map'](_0xf72528[_0xfbf3('0x17')],function(_0x5d6a07){return{'model':db[_0x5d6a07[_0xfbf3('0x19')]],'as':_0x5d6a07['as'],'attributes':_0x5d6a07[_0xfbf3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfbf3('0x9')](function(_0x368968){logger['info'](_0xfbf3('0x1b'),_0x543b69);logger[_0xfbf3('0x1c')](_0xfbf3('0x1b'),_0x543b69,JSON[_0xfbf3('0x1d')](_0x368968));_0x51af71(_0x368968);})['catch'](function(_0x2315ba){logger[_0xfbf3('0xe')](_0xfbf3('0x1b'),_0x2315ba[_0xfbf3('0x10')],_0x543b69);_0xbe46b6(_0x3936ee[_0xfbf3('0xe')](0x1f4,_0x2315ba[_0xfbf3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 1e7ec2b..501b736 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 _0x8b50=['delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','put','update'];(function(_0x1334d5,_0x3f368c){var _0x14146b=function(_0x5cb035){while(--_0x5cb035){_0x1334d5['push'](_0x1334d5['shift']());}};_0x14146b(++_0x3f368c);}(_0x8b50,0x13f));var _0x08b5=function(_0xa609be,_0x1857ff){_0xa609be=_0xa609be-0x0;var _0x2189a6=_0x8b50[_0xa609be];return _0x2189a6;};'use strict';var multer=require(_0x08b5('0x0'));var util=require(_0x08b5('0x1'));var path=require(_0x08b5('0x2'));var timeout=require(_0x08b5('0x3'));var express=require(_0x08b5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x08b5('0x5'));var interaction=require(_0x08b5('0x6'));var config=require(_0x08b5('0x7'));var controller=require(_0x08b5('0x8'));router[_0x08b5('0x9')]('/',auth[_0x08b5('0xa')](),controller[_0x08b5('0xb')]);router['get']('/:id',auth[_0x08b5('0xa')](),controller[_0x08b5('0xc')]);router[_0x08b5('0x9')](_0x08b5('0xd'),auth[_0x08b5('0xa')](),controller[_0x08b5('0xe')]);router[_0x08b5('0x9')]('/:id/hopper_histories',auth[_0x08b5('0xa')](),controller[_0x08b5('0xf')]);router['get'](_0x08b5('0x10'),auth[_0x08b5('0xa')](),controller[_0x08b5('0x11')]);router[_0x08b5('0x9')](_0x08b5('0x12'),auth[_0x08b5('0xa')](),controller[_0x08b5('0x13')]);router[_0x08b5('0x9')](_0x08b5('0x14'),auth[_0x08b5('0xa')](),controller[_0x08b5('0x15')]);router['get']('/:id/blacklists',auth[_0x08b5('0xa')](),controller[_0x08b5('0x16')]);router[_0x08b5('0x17')]('/',auth['isAuthenticated'](),controller[_0x08b5('0x18')]);router[_0x08b5('0x17')](_0x08b5('0x19'),auth[_0x08b5('0xa')](),controller[_0x08b5('0x1a')]);router[_0x08b5('0x17')](_0x08b5('0x14'),auth[_0x08b5('0xa')](),controller[_0x08b5('0x1b')]);router[_0x08b5('0x17')](_0x08b5('0x1c'),auth[_0x08b5('0xa')](),controller['addBlackLists']);router[_0x08b5('0x1d')]('/:id',auth[_0x08b5('0xa')](),controller[_0x08b5('0x1e')]);router[_0x08b5('0x1f')]('/:id',auth[_0x08b5('0xa')](),controller[_0x08b5('0x20')]);router[_0x08b5('0x1f')](_0x08b5('0x14'),auth[_0x08b5('0xa')](),controller[_0x08b5('0x21')]);router[_0x08b5('0x1f')](_0x08b5('0x1c'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x08b5('0x22')]=router; \ No newline at end of file +var _0x455f=['getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists'];(function(_0x2b498e,_0x1c3b10){var _0x2d7560=function(_0x45170d){while(--_0x45170d){_0x2b498e['push'](_0x2b498e['shift']());}};_0x2d7560(++_0x1c3b10);}(_0x455f,0x118));var _0xf455=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x455f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf455('0x0'));var util=require(_0xf455('0x1'));var path=require(_0xf455('0x2'));var timeout=require(_0xf455('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf455('0x4'));var auth=require(_0xf455('0x5'));var interaction=require(_0xf455('0x6'));var config=require('../../config/environment');var controller=require(_0xf455('0x7'));router[_0xf455('0x8')]('/',auth[_0xf455('0x9')](),controller[_0xf455('0xa')]);router[_0xf455('0x8')]('/:id',auth[_0xf455('0x9')](),controller[_0xf455('0xb')]);router[_0xf455('0x8')](_0xf455('0xc'),auth[_0xf455('0x9')](),controller['getHoppers']);router[_0xf455('0x8')]('/:id/hopper_histories',auth[_0xf455('0x9')](),controller[_0xf455('0xd')]);router[_0xf455('0x8')](_0xf455('0xe'),auth[_0xf455('0x9')](),controller['getHopperFinals']);router[_0xf455('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xf455('0xf')]);router[_0xf455('0x8')](_0xf455('0x10'),auth[_0xf455('0x9')](),controller[_0xf455('0x11')]);router[_0xf455('0x8')](_0xf455('0x12'),auth['isAuthenticated'](),controller[_0xf455('0x13')]);router[_0xf455('0x14')]('/',auth[_0xf455('0x9')](),controller[_0xf455('0x15')]);router['post'](_0xf455('0x16'),auth['isAuthenticated'](),controller[_0xf455('0x17')]);router[_0xf455('0x14')](_0xf455('0x10'),auth[_0xf455('0x9')](),controller[_0xf455('0x18')]);router[_0xf455('0x14')](_0xf455('0x12'),auth[_0xf455('0x9')](),controller[_0xf455('0x19')]);router[_0xf455('0x1a')](_0xf455('0x1b'),auth[_0xf455('0x9')](),controller[_0xf455('0x1c')]);router[_0xf455('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xf455('0x1e')]);router[_0xf455('0x1d')](_0xf455('0x10'),auth[_0xf455('0x9')](),controller[_0xf455('0x1f')]);router[_0xf455('0x1d')](_0xf455('0x12'),auth['isAuthenticated'](),controller[_0xf455('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index a24f8d2..6a42d3e 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 _0xe6c2=['medium','STRING','VIRTUAL','getDataValue','key','exports','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe6c2,0x15c));var _0x2e6c=function(_0x3ddce1,_0x10c834){_0x3ddce1=_0x3ddce1-0x0;var _0x5295b6=_0xe6c2[_0x3ddce1];return _0x5295b6;};'use strict';var Sequelize=require('sequelize');module[_0x2e6c('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2e6c('0x1')],'length':_0x2e6c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x2e6c('0x3')]},'name':{'type':Sequelize[_0x2e6c('0x4')],'get':function(){return this[_0x2e6c('0x5')](_0x2e6c('0x6'));}}}; \ No newline at end of file +var _0xd052=['VIRTUAL','exports','TEXT','medium'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd052,0x139));var _0x2d05=function(_0xd0b573,_0x3cbc25){_0xd0b573=_0xd0b573-0x0;var _0x1d31e0=_0xd052[_0xd0b573];return _0x1d31e0;};'use strict';var Sequelize=require('sequelize');module[_0x2d05('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2d05('0x1')],'length':_0x2d05('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2d05('0x3')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 0a3d11a..9e6980a 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 _0x9f70=['then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','where','merge','filter','options','include','findAll','rows','params','keys','includeAll','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy'];(function(_0x1fbdb5,_0xb55491){var _0x1cdc0a=function(_0x290930){while(--_0x290930){_0x1fbdb5['push'](_0x1fbdb5['shift']());}};_0x1cdc0a(++_0xb55491);}(_0x9f70,0x1dd));var _0x09f7=function(_0x5c53e7,_0x991fbf){_0x5c53e7=_0x5c53e7-0x0;var _0x21cb58=_0x9f70[_0x5c53e7];return _0x21cb58;};'use strict';var emlformat=require(_0x09f7('0x0'));var rimraf=require(_0x09f7('0x1'));var zipdir=require(_0x09f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x09f7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09f7('0x4'));var util=require(_0x09f7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x09f7('0x6'));var ejs=require(_0x09f7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x09f7('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x09f7('0x9'));var toCsv=require(_0x09f7('0x6'));var querystring=require(_0x09f7('0xa'));var Papa=require(_0x09f7('0xb'));var Redis=require(_0x09f7('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x09f7('0xd'));var as=require(_0x09f7('0xe'));var hardwareService=require(_0x09f7('0xf'));var logger=require(_0x09f7('0x10'))(_0x09f7('0x11'));var utils=require('../../config/utils');var config=require(_0x09f7('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x09f7('0x13'))['db'];function respondWithStatusCode(_0x5a64e0,_0x2b1a44){_0x2b1a44=_0x2b1a44||0xcc;return function(_0x2dd365){if(_0x2dd365){return _0x5a64e0[_0x09f7('0x14')](_0x2b1a44);}return _0x5a64e0['status'](_0x2b1a44)[_0x09f7('0x15')]();};}function respondWithResult(_0x112994,_0x302f56){_0x302f56=_0x302f56||0xc8;return function(_0x1c9ce7){if(_0x1c9ce7){return _0x112994[_0x09f7('0x16')](_0x302f56)['json'](_0x1c9ce7);}};}function respondWithFilteredResult(_0x4a2f51,_0x33285d){return function(_0x5d7b0c){if(_0x5d7b0c){var _0x13e48e=typeof _0x33285d[_0x09f7('0x17')]===_0x09f7('0x18')&&typeof _0x33285d[_0x09f7('0x19')]==='undefined';var _0x3fe889=_0x5d7b0c[_0x09f7('0x1a')];var _0x4e5b60=_0x13e48e?0x0:_0x33285d[_0x09f7('0x17')];var _0x47dea8=_0x13e48e?_0x5d7b0c['count']:_0x33285d[_0x09f7('0x17')]+_0x33285d[_0x09f7('0x19')];var _0x31a912;if(_0x47dea8>=_0x3fe889){_0x47dea8=_0x3fe889;_0x31a912=0xc8;}else{_0x31a912=0xce;}_0x4a2f51[_0x09f7('0x16')](_0x31a912);return _0x4a2f51[_0x09f7('0x1b')](_0x09f7('0x1c'),_0x4e5b60+'-'+_0x47dea8+'/'+_0x3fe889)['json'](_0x5d7b0c);}return null;};}function patchUpdates(_0x27b142){return function(_0x5a6f8b){try{jsonpatch[_0x09f7('0x1d')](_0x5a6f8b,_0x27b142,!![]);}catch(_0x8b5e21){return BPromise['reject'](_0x8b5e21);}return _0x5a6f8b[_0x09f7('0x1e')]();};}function saveUpdates(_0x13a026,_0x2b133b){return function(_0x308db4){if(_0x308db4){return _0x308db4[_0x09f7('0x1f')](_0x13a026)['then'](function(_0x59767c){return _0x59767c;});}return null;};}function removeEntity(_0x5b9235,_0x34bf69){return function(_0x33a0ea){if(_0x33a0ea){return _0x33a0ea[_0x09f7('0x20')]()[_0x09f7('0x21')](function(){var _0x508af3=_0x33a0ea[_0x09f7('0x22')]({'plain':!![]});var _0x430008=_0x09f7('0x23');return db[_0x09f7('0x24')][_0x09f7('0x20')]({'where':{'type':_0x430008,'resourceId':_0x508af3['id']}})[_0x09f7('0x21')](function(){return _0x33a0ea;});})[_0x09f7('0x21')](function(){_0x5b9235[_0x09f7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x200110,_0x25d54d){return function(_0x1d1e46){if(!_0x1d1e46){_0x200110[_0x09f7('0x14')](0x194);}return _0x1d1e46;};}function handleError(_0x36b862,_0x553bc5){_0x553bc5=_0x553bc5||0x1f4;return function(_0x4f95a3){logger[_0x09f7('0x25')](_0x4f95a3[_0x09f7('0x26')]);if(_0x4f95a3[_0x09f7('0x27')]){delete _0x4f95a3[_0x09f7('0x27')];}_0x36b862[_0x09f7('0x16')](_0x553bc5)[_0x09f7('0x28')](_0x4f95a3);};}exports[_0x09f7('0x29')]=function(_0x5972ac,_0x32e6a2){var _0x5b0496={},_0x160120={},_0x596850={'count':0x0,'rows':[]};var _0x5c8913=_['map'](db[_0x09f7('0x2a')][_0x09f7('0x2b')],function(_0x2acb76){return{'name':_0x2acb76[_0x09f7('0x2c')],'type':_0x2acb76[_0x09f7('0x2d')][_0x09f7('0x2e')]};});_0x160120['model']=_[_0x09f7('0x2f')](_0x5c8913,'name');_0x160120[_0x09f7('0x30')]=_['keys'](_0x5972ac[_0x09f7('0x30')]);_0x160120['filters']=_[_0x09f7('0x31')](_0x160120[_0x09f7('0x32')],_0x160120[_0x09f7('0x30')]);_0x5b0496[_0x09f7('0x33')]=_[_0x09f7('0x31')](_0x160120[_0x09f7('0x32')],qs[_0x09f7('0x34')](_0x5972ac[_0x09f7('0x30')]['fields']));_0x5b0496[_0x09f7('0x33')]=_0x5b0496['attributes'][_0x09f7('0x35')]?_0x5b0496[_0x09f7('0x33')]:_0x160120['model'];if(!_0x5972ac['query'][_0x09f7('0x36')](_0x09f7('0x37'))){_0x5b0496[_0x09f7('0x19')]=qs[_0x09f7('0x19')](_0x5972ac[_0x09f7('0x30')][_0x09f7('0x19')]);_0x5b0496[_0x09f7('0x17')]=qs[_0x09f7('0x17')](_0x5972ac['query']['offset']);}_0x5b0496['order']=qs[_0x09f7('0x38')](_0x5972ac[_0x09f7('0x30')]['sort']);_0x5b0496['where']=qs['filters'](_['pick'](_0x5972ac[_0x09f7('0x30')],_0x160120[_0x09f7('0x39')]),_0x5c8913);if(_0x5972ac[_0x09f7('0x30')]['filter']){_0x5b0496[_0x09f7('0x3a')]=_[_0x09f7('0x3b')](_0x5b0496[_0x09f7('0x3a')],{'$or':[{'key':{'$like':'%'+_0x5972ac[_0x09f7('0x30')][_0x09f7('0x3c')]+'%'}},{'value':{'$like':'%'+_0x5972ac['query']['filter']+'%'}}]});}_0x5b0496=_[_0x09f7('0x3b')]({},_0x5b0496,_0x5972ac[_0x09f7('0x3d')]);var _0x3ef153={'where':_0x5b0496[_0x09f7('0x3a')]};return db[_0x09f7('0x2a')]['count'](_0x3ef153)[_0x09f7('0x21')](function(_0x28b787){_0x596850['count']=_0x28b787;if(_0x5972ac[_0x09f7('0x30')]['includeAll']){_0x5b0496[_0x09f7('0x3e')]=[{'all':!![]}];}return db[_0x09f7('0x2a')][_0x09f7('0x3f')](_0x5b0496);})[_0x09f7('0x21')](function(_0x4eb7d8){_0x596850[_0x09f7('0x40')]=_0x4eb7d8;return _0x596850;})[_0x09f7('0x21')](respondWithFilteredResult(_0x32e6a2,_0x5b0496))['catch'](handleError(_0x32e6a2,null));};exports['show']=function(_0x841611,_0x12f313){var _0x576163={'raw':!![],'where':{'id':_0x841611[_0x09f7('0x41')]['id']}},_0x3f2871={};_0x3f2871[_0x09f7('0x32')]=_[_0x09f7('0x42')](db[_0x09f7('0x2a')][_0x09f7('0x2b')]);_0x3f2871['query']=_[_0x09f7('0x42')](_0x841611[_0x09f7('0x30')]);_0x3f2871['filters']=_[_0x09f7('0x31')](_0x3f2871[_0x09f7('0x32')],_0x3f2871[_0x09f7('0x30')]);_0x576163[_0x09f7('0x33')]=_[_0x09f7('0x31')](_0x3f2871[_0x09f7('0x32')],qs['fields'](_0x841611['query'][_0x09f7('0x34')]));_0x576163[_0x09f7('0x33')]=_0x576163[_0x09f7('0x33')][_0x09f7('0x35')]?_0x576163[_0x09f7('0x33')]:_0x3f2871['model'];if(_0x841611['query'][_0x09f7('0x43')]){_0x576163[_0x09f7('0x3e')]=[{'all':!![]}];}_0x576163=_[_0x09f7('0x3b')]({},_0x576163,_0x841611[_0x09f7('0x3d')]);return db[_0x09f7('0x2a')]['find'](_0x576163)[_0x09f7('0x21')](handleEntityNotFound(_0x12f313,null))[_0x09f7('0x21')](respondWithResult(_0x12f313,null))[_0x09f7('0x44')](handleError(_0x12f313,null));};exports[_0x09f7('0x1f')]=function(_0x457f0f,_0x48e35b){if(_0x457f0f[_0x09f7('0x45')]['id']){delete _0x457f0f[_0x09f7('0x45')]['id'];}return db[_0x09f7('0x2a')]['find']({'where':{'id':_0x457f0f['params']['id']}})[_0x09f7('0x21')](handleEntityNotFound(_0x48e35b,null))[_0x09f7('0x21')](saveUpdates(_0x457f0f[_0x09f7('0x45')],null))[_0x09f7('0x21')](respondWithResult(_0x48e35b,null))[_0x09f7('0x44')](handleError(_0x48e35b,null));};exports[_0x09f7('0x20')]=function(_0x24b699,_0x133aa8){return db[_0x09f7('0x2a')]['find']({'where':{'id':_0x24b699[_0x09f7('0x41')]['id']}})[_0x09f7('0x21')](handleEntityNotFound(_0x133aa8,null))[_0x09f7('0x21')](removeEntity(_0x133aa8,null))[_0x09f7('0x44')](handleError(_0x133aa8,null));};exports[_0x09f7('0x46')]=function(_0xcf7c9,_0x1b1581){var _0x214b0e={'key':_0xcf7c9[_0x09f7('0x45')][_0x09f7('0x2e')]};if(_0xcf7c9[_0x09f7('0x45')][_0x09f7('0x47')]){_0x214b0e['MailAccountId']=_0xcf7c9[_0x09f7('0x45')][_0x09f7('0x47')];}else if(_0xcf7c9[_0x09f7('0x45')][_0x09f7('0x48')]){_0x214b0e[_0x09f7('0x48')]=_0xcf7c9[_0x09f7('0x45')][_0x09f7('0x48')];}else if(_0xcf7c9[_0x09f7('0x45')][_0x09f7('0x49')]){_0x214b0e[_0x09f7('0x49')]=_0xcf7c9[_0x09f7('0x45')][_0x09f7('0x49')];}else if(_0xcf7c9[_0x09f7('0x45')]['ChatWebsiteId']){_0x214b0e[_0x09f7('0x4a')]=_0xcf7c9['body'][_0x09f7('0x4a')];}return db[_0x09f7('0x2a')][_0x09f7('0x4b')]({'where':_0x214b0e})[_0x09f7('0x21')](function(_0x4ea4d4){if(_0x4ea4d4){throw new db[(_0x09f7('0x4c'))][(_0x09f7('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0xcf7c9[_0x09f7('0x45')]);})[_0x09f7('0x21')](function(_0x23ee3f){var _0x763671=_0xcf7c9[_0x09f7('0x4e')]['get']({'plain':!![]});if(!_0x763671)throw new Error(_0x09f7('0x4f'));if(_0x763671[_0x09f7('0x50')]===_0x09f7('0x4e')){var _0x181266=_0x23ee3f[_0x09f7('0x22')]({'plain':!![]});return db[_0x09f7('0x51')][_0x09f7('0x4b')]({'where':{'name':_0x09f7('0x23'),'userProfileId':_0x763671[_0x09f7('0x52')]},'raw':!![]})[_0x09f7('0x21')](function(_0x1761bd){if(_0x1761bd&&_0x1761bd[_0x09f7('0x53')]===0x0){return db[_0x09f7('0x24')][_0x09f7('0x46')]({'name':_0x181266[_0x09f7('0x27')],'resourceId':_0x181266['id'],'type':_0x1761bd[_0x09f7('0x27')],'sectionId':_0x1761bd['id']},{})[_0x09f7('0x21')](function(){return _0x23ee3f;});}else{return _0x23ee3f;}})[_0x09f7('0x44')](function(_0x255872){logger[_0x09f7('0x25')](_0x09f7('0x54'),_0x255872);throw _0x255872;});}return _0x23ee3f;})[_0x09f7('0x21')](respondWithResult(_0x1b1581,0xc9))[_0x09f7('0x44')](handleError(_0x1b1581,null));}; \ No newline at end of file +var _0x29c8=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','CannedAnswers','UserProfileResource','end','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','body'];(function(_0x4a7f48,_0x142979){var _0x1e1b80=function(_0xcfcfde){while(--_0xcfcfde){_0x4a7f48['push'](_0x4a7f48['shift']());}};_0x1e1b80(++_0x142979);}(_0x29c8,0x120));var _0x829c=function(_0x1388c9,_0x911c0d){_0x1388c9=_0x1388c9-0x0;var _0x4ccef0=_0x29c8[_0x1388c9];return _0x4ccef0;};'use strict';var emlformat=require(_0x829c('0x0'));var rimraf=require(_0x829c('0x1'));var zipdir=require(_0x829c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x829c('0x3'));var moment=require(_0x829c('0x4'));var BPromise=require(_0x829c('0x5'));var Mustache=require(_0x829c('0x6'));var util=require(_0x829c('0x7'));var path=require(_0x829c('0x8'));var sox=require(_0x829c('0x9'));var csv=require(_0x829c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x829c('0xb'));var squel=require('squel');var crypto=require(_0x829c('0xc'));var jsforce=require(_0x829c('0xd'));var deskjs=require(_0x829c('0xe'));var toCsv=require(_0x829c('0xa'));var querystring=require(_0x829c('0xf'));var Papa=require(_0x829c('0x10'));var Redis=require(_0x829c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x829c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x829c('0x13'))(_0x829c('0x14'));var utils=require(_0x829c('0x15'));var config=require(_0x829c('0x16'));var licenseUtil=require(_0x829c('0x17'));var db=require(_0x829c('0x18'))['db'];function respondWithStatusCode(_0x11a019,_0x124c61){_0x124c61=_0x124c61||0xcc;return function(_0x58d73f){if(_0x58d73f){return _0x11a019[_0x829c('0x19')](_0x124c61);}return _0x11a019[_0x829c('0x1a')](_0x124c61)['end']();};}function respondWithResult(_0x2eb32e,_0x5acb9f){_0x5acb9f=_0x5acb9f||0xc8;return function(_0x53d534){if(_0x53d534){return _0x2eb32e[_0x829c('0x1a')](_0x5acb9f)[_0x829c('0x1b')](_0x53d534);}};}function respondWithFilteredResult(_0x2c60e0,_0x3d9e03){return function(_0x243dc1){if(_0x243dc1){var _0x8211a9=typeof _0x3d9e03['offset']===_0x829c('0x1c')&&typeof _0x3d9e03[_0x829c('0x1d')]===_0x829c('0x1c');var _0x4458ec=_0x243dc1[_0x829c('0x1e')];var _0x31b727=_0x8211a9?0x0:_0x3d9e03[_0x829c('0x1f')];var _0x3e3994=_0x8211a9?_0x243dc1[_0x829c('0x1e')]:_0x3d9e03[_0x829c('0x1f')]+_0x3d9e03['limit'];var _0x3576f3;if(_0x3e3994>=_0x4458ec){_0x3e3994=_0x4458ec;_0x3576f3=0xc8;}else{_0x3576f3=0xce;}_0x2c60e0['status'](_0x3576f3);return _0x2c60e0[_0x829c('0x20')](_0x829c('0x21'),_0x31b727+'-'+_0x3e3994+'/'+_0x4458ec)[_0x829c('0x1b')](_0x243dc1);}return null;};}function patchUpdates(_0x38a2b2){return function(_0x264909){try{jsonpatch[_0x829c('0x22')](_0x264909,_0x38a2b2,!![]);}catch(_0x152f7a){return BPromise['reject'](_0x152f7a);}return _0x264909[_0x829c('0x23')]();};}function saveUpdates(_0x4a727d,_0x3654e8){return function(_0x25bb50){if(_0x25bb50){return _0x25bb50[_0x829c('0x24')](_0x4a727d)[_0x829c('0x25')](function(_0x596baa){return _0x596baa;});}return null;};}function removeEntity(_0x2a04c3,_0x22663c){return function(_0x50f274){if(_0x50f274){return _0x50f274[_0x829c('0x26')]()['then'](function(){var _0x3d2533=_0x50f274['get']({'plain':!![]});var _0x22de81=_0x829c('0x27');return db[_0x829c('0x28')]['destroy']({'where':{'type':_0x22de81,'resourceId':_0x3d2533['id']}})[_0x829c('0x25')](function(){return _0x50f274;});})[_0x829c('0x25')](function(){_0x2a04c3['status'](0xcc)[_0x829c('0x29')]();});}};}function handleEntityNotFound(_0x43f598,_0x222bc9){return function(_0x1d0744){if(!_0x1d0744){_0x43f598[_0x829c('0x19')](0x194);}return _0x1d0744;};}function handleError(_0x264a1e,_0x76e71e){_0x76e71e=_0x76e71e||0x1f4;return function(_0x388547){logger['error'](_0x388547[_0x829c('0x2a')]);if(_0x388547[_0x829c('0x2b')]){delete _0x388547['name'];}_0x264a1e[_0x829c('0x1a')](_0x76e71e)[_0x829c('0x2c')](_0x388547);};}exports[_0x829c('0x2d')]=function(_0xea1565,_0x465ebd){var _0x471200={},_0x425964={},_0xad08f={'count':0x0,'rows':[]};var _0x155747=_[_0x829c('0x2e')](db[_0x829c('0x2f')][_0x829c('0x30')],function(_0x209548){return{'name':_0x209548['fieldName'],'type':_0x209548[_0x829c('0x31')][_0x829c('0x32')]};});_0x425964[_0x829c('0x33')]=_[_0x829c('0x2e')](_0x155747,'name');_0x425964[_0x829c('0x34')]=_[_0x829c('0x35')](_0xea1565['query']);_0x425964[_0x829c('0x36')]=_[_0x829c('0x37')](_0x425964[_0x829c('0x33')],_0x425964[_0x829c('0x34')]);_0x471200[_0x829c('0x38')]=_['intersection'](_0x425964[_0x829c('0x33')],qs[_0x829c('0x39')](_0xea1565[_0x829c('0x34')][_0x829c('0x39')]));_0x471200[_0x829c('0x38')]=_0x471200['attributes'][_0x829c('0x3a')]?_0x471200[_0x829c('0x38')]:_0x425964[_0x829c('0x33')];if(!_0xea1565['query'][_0x829c('0x3b')](_0x829c('0x3c'))){_0x471200['limit']=qs[_0x829c('0x1d')](_0xea1565['query'][_0x829c('0x1d')]);_0x471200[_0x829c('0x1f')]=qs[_0x829c('0x1f')](_0xea1565[_0x829c('0x34')][_0x829c('0x1f')]);}_0x471200[_0x829c('0x3d')]=qs[_0x829c('0x3e')](_0xea1565[_0x829c('0x34')][_0x829c('0x3e')]);_0x471200['where']=qs[_0x829c('0x36')](_[_0x829c('0x3f')](_0xea1565[_0x829c('0x34')],_0x425964[_0x829c('0x36')]),_0x155747);if(_0xea1565[_0x829c('0x34')][_0x829c('0x40')]){_0x471200[_0x829c('0x41')]=_[_0x829c('0x42')](_0x471200['where'],{'$or':[{'key':{'$like':'%'+_0xea1565[_0x829c('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0xea1565[_0x829c('0x34')][_0x829c('0x40')]+'%'}}]});}_0x471200=_[_0x829c('0x42')]({},_0x471200,_0xea1565[_0x829c('0x43')]);var _0x594b3e={'where':_0x471200[_0x829c('0x41')]};return db[_0x829c('0x2f')][_0x829c('0x1e')](_0x594b3e)['then'](function(_0x4ec086){_0xad08f[_0x829c('0x1e')]=_0x4ec086;if(_0xea1565[_0x829c('0x34')][_0x829c('0x44')]){_0x471200[_0x829c('0x45')]=[{'all':!![]}];}return db[_0x829c('0x2f')][_0x829c('0x46')](_0x471200);})[_0x829c('0x25')](function(_0x32f87b){_0xad08f[_0x829c('0x47')]=_0x32f87b;return _0xad08f;})[_0x829c('0x25')](respondWithFilteredResult(_0x465ebd,_0x471200))[_0x829c('0x48')](handleError(_0x465ebd,null));};exports['show']=function(_0x1b6524,_0xe60a){var _0x3f1698={'raw':!![],'where':{'id':_0x1b6524[_0x829c('0x49')]['id']}},_0x23c407={};_0x23c407['model']=_[_0x829c('0x35')](db[_0x829c('0x2f')][_0x829c('0x30')]);_0x23c407[_0x829c('0x34')]=_['keys'](_0x1b6524[_0x829c('0x34')]);_0x23c407['filters']=_['intersection'](_0x23c407[_0x829c('0x33')],_0x23c407[_0x829c('0x34')]);_0x3f1698[_0x829c('0x38')]=_[_0x829c('0x37')](_0x23c407[_0x829c('0x33')],qs[_0x829c('0x39')](_0x1b6524[_0x829c('0x34')]['fields']));_0x3f1698[_0x829c('0x38')]=_0x3f1698['attributes']['length']?_0x3f1698[_0x829c('0x38')]:_0x23c407[_0x829c('0x33')];if(_0x1b6524['query'][_0x829c('0x44')]){_0x3f1698[_0x829c('0x45')]=[{'all':!![]}];}_0x3f1698=_['merge']({},_0x3f1698,_0x1b6524[_0x829c('0x43')]);return db['CannedAnswer'][_0x829c('0x4a')](_0x3f1698)[_0x829c('0x25')](handleEntityNotFound(_0xe60a,null))[_0x829c('0x25')](respondWithResult(_0xe60a,null))['catch'](handleError(_0xe60a,null));};exports[_0x829c('0x24')]=function(_0xde80a2,_0x273275){if(_0xde80a2[_0x829c('0x4b')]['id']){delete _0xde80a2['body']['id'];}return db['CannedAnswer'][_0x829c('0x4a')]({'where':{'id':_0xde80a2[_0x829c('0x49')]['id']}})[_0x829c('0x25')](handleEntityNotFound(_0x273275,null))[_0x829c('0x25')](saveUpdates(_0xde80a2[_0x829c('0x4b')],null))[_0x829c('0x25')](respondWithResult(_0x273275,null))[_0x829c('0x48')](handleError(_0x273275,null));};exports['destroy']=function(_0x24240b,_0x33673e){return db['CannedAnswer'][_0x829c('0x4a')]({'where':{'id':_0x24240b['params']['id']}})[_0x829c('0x25')](handleEntityNotFound(_0x33673e,null))[_0x829c('0x25')](removeEntity(_0x33673e,null))['catch'](handleError(_0x33673e,null));};exports[_0x829c('0x4c')]=function(_0x542909,_0x119929){var _0xdd24c9={'key':_0x542909['body'][_0x829c('0x32')]};if(_0x542909[_0x829c('0x4b')][_0x829c('0x4d')]){_0xdd24c9[_0x829c('0x4d')]=_0x542909[_0x829c('0x4b')][_0x829c('0x4d')];}else if(_0x542909[_0x829c('0x4b')][_0x829c('0x4e')]){_0xdd24c9[_0x829c('0x4e')]=_0x542909['body'][_0x829c('0x4e')];}else if(_0x542909['body'][_0x829c('0x4f')]){_0xdd24c9[_0x829c('0x4f')]=_0x542909['body'][_0x829c('0x4f')];}else if(_0x542909[_0x829c('0x4b')][_0x829c('0x50')]){_0xdd24c9[_0x829c('0x50')]=_0x542909[_0x829c('0x4b')][_0x829c('0x50')];}return db['CannedAnswer']['find']({'where':_0xdd24c9})[_0x829c('0x25')](function(_0x536210){if(_0x536210){throw new db['Sequelize'][(_0x829c('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x829c('0x2f')]['create'](_0x542909[_0x829c('0x4b')]);})['then'](function(_0x5ea117){var _0xa13af1=_0x542909[_0x829c('0x52')][_0x829c('0x53')]({'plain':!![]});if(!_0xa13af1)throw new Error(_0x829c('0x54'));if(_0xa13af1[_0x829c('0x55')]==='user'){var _0x279a09=_0x5ea117[_0x829c('0x53')]({'plain':!![]});return db[_0x829c('0x56')][_0x829c('0x4a')]({'where':{'name':'CannedAnswers','userProfileId':_0xa13af1[_0x829c('0x57')]},'raw':!![]})[_0x829c('0x25')](function(_0x3da605){if(_0x3da605&&_0x3da605[_0x829c('0x58')]===0x0){return db[_0x829c('0x28')][_0x829c('0x4c')]({'name':_0x279a09[_0x829c('0x2b')],'resourceId':_0x279a09['id'],'type':_0x3da605[_0x829c('0x2b')],'sectionId':_0x3da605['id']},{})[_0x829c('0x25')](function(){return _0x5ea117;});}else{return _0x5ea117;}})[_0x829c('0x48')](function(_0x4b60b2){logger[_0x829c('0x59')](_0x829c('0x5a'),_0x4b60b2);throw _0x4b60b2;});}return _0x5ea117;})['then'](respondWithResult(_0x119929,0xc9))[_0x829c('0x48')](handleError(_0x119929,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 7e573ae..e514295 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 _0x7e3a=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','rimraf'];(function(_0xee949d,_0x1d5ef7){var _0x796849=function(_0x463cfb){while(--_0x463cfb){_0xee949d['push'](_0xee949d['shift']());}};_0x796849(++_0x1d5ef7);}(_0x7e3a,0xf6));var _0xa7e3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7e3a[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xa7e3('0x0'));var logger=require('../../config/logger')(_0xa7e3('0x1'));var moment=require(_0xa7e3('0x2'));var BPromise=require(_0xa7e3('0x3'));var rp=require(_0xa7e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7e3('0x5'));var config=require(_0xa7e3('0x6'));var attributes=require(_0xa7e3('0x7'));module[_0xa7e3('0x8')]=function(_0x2f62b1,_0x18291b){return _0x2f62b1['define'](_0xa7e3('0x9'),attributes,{'tableName':_0xa7e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa7e3('0xb')});}; \ No newline at end of file +var _0x5da6=['./cannedAnswer.attributes','CannedAnswer','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x6019a8,_0x4f6a11){var _0x3963f6=function(_0x5b9c30){while(--_0x5b9c30){_0x6019a8['push'](_0x6019a8['shift']());}};_0x3963f6(++_0x4f6a11);}(_0x5da6,0x1ec));var _0x65da=function(_0xd10919,_0x2d66ab){_0xd10919=_0xd10919-0x0;var _0x3e88f4=_0x5da6[_0xd10919];return _0x3e88f4;};'use strict';var _=require(_0x65da('0x0'));var util=require(_0x65da('0x1'));var logger=require(_0x65da('0x2'))('api');var moment=require(_0x65da('0x3'));var BPromise=require(_0x65da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65da('0x5'));var rimraf=require(_0x65da('0x6'));var config=require(_0x65da('0x7'));var attributes=require(_0x65da('0x8'));module['exports']=function(_0x520f64,_0x4cd132){return _0x520f64['define'](_0x65da('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 3812277..dda2f2d 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(_0x1bf121,_0x14412e){var _0x510bf8=function(_0x19ae5c){while(--_0x19ae5c){_0x1bf121['push'](_0x1bf121['shift']());}};_0x510bf8(++_0x14412e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x5d8b34,_0x21be74){var _0x2ec166=function(_0x91c5dd){while(--_0x91c5dd){_0x5d8b34['push'](_0x5d8b34['shift']());}};_0x2ec166(++_0x21be74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 9a1c386..1ec2858 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 _0x0ed9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x405300,_0x512d8c){var _0x3d0086=function(_0x3da8d0){while(--_0x3da8d0){_0x405300['push'](_0x405300['shift']());}};_0x3d0086(++_0x512d8c);}(_0x0ed9,0x101));var _0x90ed=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x0ed9[_0x3a3fcc];return _0xe16438;};'use strict';var multer=require('multer');var util=require(_0x90ed('0x0'));var path=require(_0x90ed('0x1'));var timeout=require(_0x90ed('0x2'));var express=require(_0x90ed('0x3'));var router=express[_0x90ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x90ed('0x5'));var interaction=require(_0x90ed('0x6'));var config=require(_0x90ed('0x7'));var controller=require(_0x90ed('0x8'));router[_0x90ed('0x9')]('/',auth['isAuthenticated'](),controller[_0x90ed('0xa')]);router[_0x90ed('0x9')](_0x90ed('0xb'),auth[_0x90ed('0xc')](),controller[_0x90ed('0xd')]);router['post']('/',auth[_0x90ed('0xc')](),controller[_0x90ed('0xe')]);router[_0x90ed('0xf')](_0x90ed('0xb'),auth[_0x90ed('0xc')](),controller[_0x90ed('0x10')]);router[_0x90ed('0x11')]('/:id',auth[_0x90ed('0xc')](),controller[_0x90ed('0x12')]);module[_0x90ed('0x13')]=router; \ No newline at end of file +var _0x3bca=['post','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x21404a,_0x4fffed){var _0x13ac55=function(_0x1448a5){while(--_0x1448a5){_0x21404a['push'](_0x21404a['shift']());}};_0x13ac55(++_0x4fffed);}(_0x3bca,0xea));var _0xa3bc=function(_0x49f27a,_0x210feb){_0x49f27a=_0x49f27a-0x0;var _0x4482dd=_0x3bca[_0x49f27a];return _0x4482dd;};'use strict';var multer=require(_0xa3bc('0x0'));var util=require(_0xa3bc('0x1'));var path=require('path');var timeout=require(_0xa3bc('0x2'));var express=require(_0xa3bc('0x3'));var router=express['Router']();var fs_extra=require(_0xa3bc('0x4'));var auth=require(_0xa3bc('0x5'));var interaction=require(_0xa3bc('0x6'));var config=require(_0xa3bc('0x7'));var controller=require('./cannedAnswer.controller');router[_0xa3bc('0x8')]('/',auth[_0xa3bc('0x9')](),controller[_0xa3bc('0xa')]);router[_0xa3bc('0x8')](_0xa3bc('0xb'),auth[_0xa3bc('0x9')](),controller[_0xa3bc('0xc')]);router[_0xa3bc('0xd')]('/',auth[_0xa3bc('0x9')](),controller[_0xa3bc('0xe')]);router[_0xa3bc('0xf')](_0xa3bc('0xb'),auth[_0xa3bc('0x9')](),controller[_0xa3bc('0x10')]);router['delete']('/:id',auth[_0xa3bc('0x9')](),controller[_0xa3bc('0x11')]);module[_0xa3bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9701a3a..78937cd 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 _0x7860=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1c6c86,_0x54cfb3){var _0x857764=function(_0x4f7eee){while(--_0x4f7eee){_0x1c6c86['push'](_0x1c6c86['shift']());}};_0x857764(++_0x54cfb3);}(_0x7860,0xe4));var _0x0786=function(_0x48e550,_0x38a701){_0x48e550=_0x48e550-0x0;var _0x34959f=_0x7860[_0x48e550];return _0x34959f;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x0786('0x0')],'allowNull':![],'defaultValue':_0x0786('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0786('0x2')]},'dst':{'type':Sequelize[_0x0786('0x2')]},'dcontext':{'type':Sequelize[_0x0786('0x2')]},'channel':{'type':Sequelize[_0x0786('0x2')]},'dstchannel':{'type':Sequelize[_0x0786('0x2')]},'lastapp':{'type':Sequelize[_0x0786('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0786('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0786('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0786('0x2')]},'userfield':{'type':Sequelize[_0x0786('0x2')]},'uniqueid':{'type':Sequelize[_0x0786('0x2')]},'linkedid':{'type':Sequelize[_0x0786('0x2')]},'sequence':{'type':Sequelize[_0x0786('0x2')]},'peeraccount':{'type':Sequelize[_0x0786('0x2')]},'type':{'type':Sequelize[_0x0786('0x2')]},'tag':{'type':Sequelize[_0x0786('0x2')]}}; \ No newline at end of file +var _0x6085=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x6085,0x15d));var _0x5608=function(_0x3845b1,_0x23a848){_0x3845b1=_0x3845b1-0x0;var _0x544ea6=_0x6085[_0x3845b1];return _0x544ea6;};'use strict';var Sequelize=require(_0x5608('0x0'));module[_0x5608('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5608('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x5608('0x3')]},'channel':{'type':Sequelize[_0x5608('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5608('0x3')]},'lastdata':{'type':Sequelize[_0x5608('0x3')]},'duration':{'type':Sequelize[_0x5608('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5608('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5608('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5608('0x3')]},'userfield':{'type':Sequelize[_0x5608('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5608('0x3')]},'sequence':{'type':Sequelize[_0x5608('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5608('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 214136d..b823de6 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 _0x6eed=['stack','name','index','map','Cdr','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','params','rawAttributes','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','end','error'];(function(_0x101638,_0x31d3ce){var _0x3bdb9b=function(_0x56097a){while(--_0x56097a){_0x101638['push'](_0x101638['shift']());}};_0x3bdb9b(++_0x31d3ce);}(_0x6eed,0xff));var _0xd6ee=function(_0xbd4eb7,_0x527b62){_0xbd4eb7=_0xbd4eb7-0x0;var _0x1bf52c=_0x6eed[_0xbd4eb7];return _0x1bf52c;};'use strict';var emlformat=require(_0xd6ee('0x0'));var rimraf=require(_0xd6ee('0x1'));var zipdir=require(_0xd6ee('0x2'));var jsonpatch=require(_0xd6ee('0x3'));var rp=require(_0xd6ee('0x4'));var moment=require('moment');var BPromise=require(_0xd6ee('0x5'));var Mustache=require(_0xd6ee('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd6ee('0x7'));var csv=require(_0xd6ee('0x8'));var ejs=require(_0xd6ee('0x9'));var fs=require('fs');var fs_extra=require(_0xd6ee('0xa'));var _=require(_0xd6ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6ee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6ee('0xd'));var Redis=require(_0xd6ee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd6ee('0xf'));var as=require(_0xd6ee('0x10'));var hardwareService=require(_0xd6ee('0x11'));var logger=require(_0xd6ee('0x12'))('api');var utils=require(_0xd6ee('0x13'));var config=require(_0xd6ee('0x14'));var licenseUtil=require(_0xd6ee('0x15'));var db=require(_0xd6ee('0x16'))['db'];function respondWithStatusCode(_0x268dd1,_0x3fd1df){_0x3fd1df=_0x3fd1df||0xcc;return function(_0x48be63){if(_0x48be63){return _0x268dd1[_0xd6ee('0x17')](_0x3fd1df);}return _0x268dd1[_0xd6ee('0x18')](_0x3fd1df)['end']();};}function respondWithResult(_0x369b4a,_0x15918d){_0x15918d=_0x15918d||0xc8;return function(_0x2bf3b2){if(_0x2bf3b2){return _0x369b4a[_0xd6ee('0x18')](_0x15918d)[_0xd6ee('0x19')](_0x2bf3b2);}};}function respondWithFilteredResult(_0xe66d0d,_0x49bafc){return function(_0x1c2e51){if(_0x1c2e51){var _0xb99b70=typeof _0x49bafc[_0xd6ee('0x1a')]==='undefined'&&typeof _0x49bafc[_0xd6ee('0x1b')]==='undefined';var _0x3a82bf=_0x1c2e51[_0xd6ee('0x1c')];var _0x81d533=_0xb99b70?0x0:_0x49bafc['offset'];var _0x8a2718=_0xb99b70?_0x1c2e51['count']:_0x49bafc[_0xd6ee('0x1a')]+_0x49bafc['limit'];var _0x31ae0f;if(_0x8a2718>=_0x3a82bf){_0x8a2718=_0x3a82bf;_0x31ae0f=0xc8;}else{_0x31ae0f=0xce;}_0xe66d0d[_0xd6ee('0x18')](_0x31ae0f);return _0xe66d0d[_0xd6ee('0x1d')](_0xd6ee('0x1e'),_0x81d533+'-'+_0x8a2718+'/'+_0x3a82bf)[_0xd6ee('0x19')](_0x1c2e51);}return null;};}function patchUpdates(_0x4b33f1){return function(_0xe2f8c4){try{jsonpatch['apply'](_0xe2f8c4,_0x4b33f1,!![]);}catch(_0x17e011){return BPromise[_0xd6ee('0x1f')](_0x17e011);}return _0xe2f8c4[_0xd6ee('0x20')]();};}function saveUpdates(_0x1abedc,_0xec9287){return function(_0x48e6ad){if(_0x48e6ad){return _0x48e6ad['update'](_0x1abedc)[_0xd6ee('0x21')](function(_0x511c18){return _0x511c18;});}return null;};}function removeEntity(_0x2bae66,_0x519373){return function(_0x391844){if(_0x391844){return _0x391844[_0xd6ee('0x22')]()[_0xd6ee('0x21')](function(){_0x2bae66[_0xd6ee('0x18')](0xcc)[_0xd6ee('0x23')]();});}};}function handleEntityNotFound(_0x5476f2,_0x4b1926){return function(_0x2f438c){if(!_0x2f438c){_0x5476f2[_0xd6ee('0x17')](0x194);}return _0x2f438c;};}function handleError(_0x4edb7d,_0x2c9b30){_0x2c9b30=_0x2c9b30||0x1f4;return function(_0xa1e700){logger[_0xd6ee('0x24')](_0xa1e700[_0xd6ee('0x25')]);if(_0xa1e700[_0xd6ee('0x26')]){delete _0xa1e700[_0xd6ee('0x26')];}_0x4edb7d[_0xd6ee('0x18')](_0x2c9b30)['send'](_0xa1e700);};}exports[_0xd6ee('0x27')]=function(_0x124ab7,_0x50b786){var _0x5bcdd6={},_0x1578b3={},_0x4580a7={'count':0x0,'rows':[]};var _0xddca=_[_0xd6ee('0x28')](db[_0xd6ee('0x29')]['rawAttributes'],function(_0x414015){return{'name':_0x414015[_0xd6ee('0x2a')],'type':_0x414015[_0xd6ee('0x2b')]['key']};});_0x1578b3[_0xd6ee('0x2c')]=_[_0xd6ee('0x28')](_0xddca,_0xd6ee('0x26'));_0x1578b3['query']=_[_0xd6ee('0x2d')](_0x124ab7[_0xd6ee('0x2e')]);_0x1578b3[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],_0x1578b3[_0xd6ee('0x2e')]);_0x5bcdd6['attributes']=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x124ab7[_0xd6ee('0x2e')]['fields']));_0x5bcdd6[_0xd6ee('0x32')]=_0x5bcdd6[_0xd6ee('0x32')][_0xd6ee('0x33')]?_0x5bcdd6['attributes']:_0x1578b3['model'];if(!_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x34')](_0xd6ee('0x35'))){_0x5bcdd6[_0xd6ee('0x1b')]=qs[_0xd6ee('0x1b')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1b')]);_0x5bcdd6[_0xd6ee('0x1a')]=qs[_0xd6ee('0x1a')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1a')]);}_0x5bcdd6[_0xd6ee('0x36')]=qs[_0xd6ee('0x37')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x37')]);_0x5bcdd6['where']=qs[_0xd6ee('0x2f')](_[_0xd6ee('0x38')](_0x124ab7[_0xd6ee('0x2e')],_0x1578b3['filters']),_0xddca);if(_0x124ab7['query']['filter']){_0x5bcdd6['where']=_[_0xd6ee('0x39')](_0x5bcdd6[_0xd6ee('0x3a')],{'$or':_[_0xd6ee('0x28')](_0xddca,function(_0x2a6d2f){if(_0x2a6d2f[_0xd6ee('0x2b')]!==_0xd6ee('0x3b')){var _0x2c975a={};_0x2c975a[_0x2a6d2f['name']]={'$like':'%'+_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x3c')]+'%'};return _0x2c975a;}})});}_0x5bcdd6=_[_0xd6ee('0x39')]({},_0x5bcdd6,_0x124ab7[_0xd6ee('0x3d')]);var _0x407748={'where':_0x5bcdd6[_0xd6ee('0x3a')]};return db[_0xd6ee('0x29')][_0xd6ee('0x1c')](_0x407748)[_0xd6ee('0x21')](function(_0x24a7cb){_0x4580a7['count']=_0x24a7cb;if(_0x124ab7['query']['includeAll']){_0x5bcdd6[_0xd6ee('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0xd6ee('0x3f')](_0x5bcdd6);})[_0xd6ee('0x21')](function(_0x96aa7f){_0x4580a7[_0xd6ee('0x40')]=_0x96aa7f;return _0x4580a7;})[_0xd6ee('0x21')](respondWithFilteredResult(_0x50b786,_0x5bcdd6))['catch'](handleError(_0x50b786,null));};exports['show']=function(_0x4db1e9,_0x557936){var _0x3337a1={'raw':!![],'where':{'id':_0x4db1e9[_0xd6ee('0x41')]['id']}},_0xf38fc4={};_0xf38fc4[_0xd6ee('0x2c')]=_[_0xd6ee('0x2d')](db[_0xd6ee('0x29')][_0xd6ee('0x42')]);_0xf38fc4[_0xd6ee('0x2e')]=_[_0xd6ee('0x2d')](_0x4db1e9['query']);_0xf38fc4[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0xf38fc4['model'],_0xf38fc4[_0xd6ee('0x2e')]);_0x3337a1['attributes']=_['intersection'](_0xf38fc4[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x4db1e9[_0xd6ee('0x2e')][_0xd6ee('0x31')]));_0x3337a1[_0xd6ee('0x32')]=_0x3337a1[_0xd6ee('0x32')]['length']?_0x3337a1['attributes']:_0xf38fc4[_0xd6ee('0x2c')];if(_0x4db1e9[_0xd6ee('0x2e')]['includeAll']){_0x3337a1[_0xd6ee('0x3e')]=[{'all':!![]}];}_0x3337a1=_['merge']({},_0x3337a1,_0x4db1e9[_0xd6ee('0x3d')]);return db[_0xd6ee('0x29')][_0xd6ee('0x43')](_0x3337a1)[_0xd6ee('0x21')](handleEntityNotFound(_0x557936,null))[_0xd6ee('0x21')](respondWithResult(_0x557936,null))[_0xd6ee('0x44')](handleError(_0x557936,null));};exports[_0xd6ee('0x45')]=function(_0x1b02c4,_0x37c3ba){return db[_0xd6ee('0x29')][_0xd6ee('0x45')](_0x1b02c4['body'],{})[_0xd6ee('0x21')](respondWithResult(_0x37c3ba,0xc9))[_0xd6ee('0x44')](handleError(_0x37c3ba,null));};exports[_0xd6ee('0x46')]=function(_0x360e34,_0x418680){if(_0x360e34[_0xd6ee('0x47')]['id']){delete _0x360e34[_0xd6ee('0x47')]['id'];}return db[_0xd6ee('0x29')][_0xd6ee('0x43')]({'where':{'id':_0x360e34[_0xd6ee('0x41')]['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x418680,null))[_0xd6ee('0x21')](saveUpdates(_0x360e34['body'],null))[_0xd6ee('0x21')](respondWithResult(_0x418680,null))[_0xd6ee('0x44')](handleError(_0x418680,null));};exports[_0xd6ee('0x22')]=function(_0x52dfd3,_0x2f1bef){return db['Cdr'][_0xd6ee('0x43')]({'where':{'id':_0x52dfd3['params']['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x2f1bef,null))[_0xd6ee('0x21')](removeEntity(_0x2f1bef,null))['catch'](handleError(_0x2f1bef,null));};exports[_0xd6ee('0x48')]=function(_0x164df4,_0xaef499){return db['Cdr'][_0xd6ee('0x48')]()[_0xd6ee('0x21')](respondWithResult(_0xaef499,null))['catch'](handleError(_0xaef499,null));}; \ No newline at end of file +var _0xca9e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','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','offset','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','fields','find','create','body','describe','eml-format','rimraf'];(function(_0x2c8687,_0x180052){var _0x12fabc=function(_0xbcbbb9){while(--_0xbcbbb9){_0x2c8687['push'](_0x2c8687['shift']());}};_0x12fabc(++_0x180052);}(_0xca9e,0x136));var _0xeca9=function(_0x183dce,_0x3a8024){_0x183dce=_0x183dce-0x0;var _0x4f391e=_0xca9e[_0x183dce];return _0x4f391e;};'use strict';var emlformat=require(_0xeca9('0x0'));var rimraf=require(_0xeca9('0x1'));var zipdir=require(_0xeca9('0x2'));var jsonpatch=require(_0xeca9('0x3'));var rp=require(_0xeca9('0x4'));var moment=require(_0xeca9('0x5'));var BPromise=require(_0xeca9('0x6'));var Mustache=require(_0xeca9('0x7'));var util=require(_0xeca9('0x8'));var path=require(_0xeca9('0x9'));var sox=require(_0xeca9('0xa'));var csv=require(_0xeca9('0xb'));var ejs=require(_0xeca9('0xc'));var fs=require('fs');var fs_extra=require(_0xeca9('0xd'));var _=require('lodash');var squel=require(_0xeca9('0xe'));var crypto=require(_0xeca9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeca9('0xb'));var querystring=require(_0xeca9('0x10'));var Papa=require(_0xeca9('0x11'));var Redis=require('ioredis');var authService=require(_0xeca9('0x12'));var qs=require(_0xeca9('0x13'));var as=require(_0xeca9('0x14'));var hardwareService=require(_0xeca9('0x15'));var logger=require(_0xeca9('0x16'))(_0xeca9('0x17'));var utils=require('../../config/utils');var config=require(_0xeca9('0x18'));var licenseUtil=require(_0xeca9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ca6f,_0x4b2ae1){_0x4b2ae1=_0x4b2ae1||0xcc;return function(_0x3c6cc7){if(_0x3c6cc7){return _0x27ca6f[_0xeca9('0x1a')](_0x4b2ae1);}return _0x27ca6f['status'](_0x4b2ae1)[_0xeca9('0x1b')]();};}function respondWithResult(_0x384ae2,_0x1ba9e9){_0x1ba9e9=_0x1ba9e9||0xc8;return function(_0x4d65ee){if(_0x4d65ee){return _0x384ae2[_0xeca9('0x1c')](_0x1ba9e9)[_0xeca9('0x1d')](_0x4d65ee);}};}function respondWithFilteredResult(_0x910814,_0x6e9fd4){return function(_0x551393){if(_0x551393){var _0x520411=typeof _0x6e9fd4[_0xeca9('0x1e')]===_0xeca9('0x1f')&&typeof _0x6e9fd4['limit']===_0xeca9('0x1f');var _0x11bf78=_0x551393['count'];var _0x517060=_0x520411?0x0:_0x6e9fd4['offset'];var _0x132008=_0x520411?_0x551393[_0xeca9('0x20')]:_0x6e9fd4[_0xeca9('0x1e')]+_0x6e9fd4['limit'];var _0xf1ef9f;if(_0x132008>=_0x11bf78){_0x132008=_0x11bf78;_0xf1ef9f=0xc8;}else{_0xf1ef9f=0xce;}_0x910814['status'](_0xf1ef9f);return _0x910814['set'](_0xeca9('0x21'),_0x517060+'-'+_0x132008+'/'+_0x11bf78)['json'](_0x551393);}return null;};}function patchUpdates(_0x31720b){return function(_0x1c4dd6){try{jsonpatch['apply'](_0x1c4dd6,_0x31720b,!![]);}catch(_0x5a2cca){return BPromise[_0xeca9('0x22')](_0x5a2cca);}return _0x1c4dd6['save']();};}function saveUpdates(_0x3647ed,_0x5279d0){return function(_0x3a3608){if(_0x3a3608){return _0x3a3608[_0xeca9('0x23')](_0x3647ed)[_0xeca9('0x24')](function(_0x5c3495){return _0x5c3495;});}return null;};}function removeEntity(_0x3fcfb8,_0x466883){return function(_0x515e63){if(_0x515e63){return _0x515e63[_0xeca9('0x25')]()[_0xeca9('0x24')](function(){_0x3fcfb8[_0xeca9('0x1c')](0xcc)[_0xeca9('0x1b')]();});}};}function handleEntityNotFound(_0x498f4a,_0x32699b){return function(_0x57e190){if(!_0x57e190){_0x498f4a[_0xeca9('0x1a')](0x194);}return _0x57e190;};}function handleError(_0x251ce4,_0x1702fb){_0x1702fb=_0x1702fb||0x1f4;return function(_0x3e41df){logger[_0xeca9('0x26')](_0x3e41df[_0xeca9('0x27')]);if(_0x3e41df[_0xeca9('0x28')]){delete _0x3e41df[_0xeca9('0x28')];}_0x251ce4[_0xeca9('0x1c')](_0x1702fb)[_0xeca9('0x29')](_0x3e41df);};}exports[_0xeca9('0x2a')]=function(_0x3b0aab,_0x424f7b){var _0x1436d0={},_0x8d9a8d={},_0x4910a3={'count':0x0,'rows':[]};var _0x4db3e2=_['map'](db[_0xeca9('0x2b')]['rawAttributes'],function(_0x2ca943){return{'name':_0x2ca943[_0xeca9('0x2c')],'type':_0x2ca943[_0xeca9('0x2d')][_0xeca9('0x2e')]};});_0x8d9a8d[_0xeca9('0x2f')]=_[_0xeca9('0x30')](_0x4db3e2,'name');_0x8d9a8d[_0xeca9('0x31')]=_['keys'](_0x3b0aab[_0xeca9('0x31')]);_0x8d9a8d[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x8d9a8d['model'],_0x8d9a8d[_0xeca9('0x31')]);_0x1436d0[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x8d9a8d[_0xeca9('0x2f')],qs['fields'](_0x3b0aab[_0xeca9('0x31')]['fields']));_0x1436d0[_0xeca9('0x34')]=_0x1436d0[_0xeca9('0x34')][_0xeca9('0x35')]?_0x1436d0[_0xeca9('0x34')]:_0x8d9a8d[_0xeca9('0x2f')];if(!_0x3b0aab[_0xeca9('0x31')]['hasOwnProperty'](_0xeca9('0x36'))){_0x1436d0[_0xeca9('0x37')]=qs[_0xeca9('0x37')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x37')]);_0x1436d0[_0xeca9('0x1e')]=qs[_0xeca9('0x1e')](_0x3b0aab['query'][_0xeca9('0x1e')]);}_0x1436d0[_0xeca9('0x38')]=qs[_0xeca9('0x39')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x39')]);_0x1436d0[_0xeca9('0x3a')]=qs['filters'](_[_0xeca9('0x3b')](_0x3b0aab['query'],_0x8d9a8d[_0xeca9('0x32')]),_0x4db3e2);if(_0x3b0aab['query'][_0xeca9('0x3c')]){_0x1436d0[_0xeca9('0x3a')]=_['merge'](_0x1436d0[_0xeca9('0x3a')],{'$or':_['map'](_0x4db3e2,function(_0x2a249b){if(_0x2a249b['type']!==_0xeca9('0x3d')){var _0x5aa0b1={};_0x5aa0b1[_0x2a249b[_0xeca9('0x28')]]={'$like':'%'+_0x3b0aab[_0xeca9('0x31')]['filter']+'%'};return _0x5aa0b1;}})});}_0x1436d0=_[_0xeca9('0x3e')]({},_0x1436d0,_0x3b0aab[_0xeca9('0x3f')]);var _0x4e8080={'where':_0x1436d0[_0xeca9('0x3a')]};return db[_0xeca9('0x2b')][_0xeca9('0x20')](_0x4e8080)[_0xeca9('0x24')](function(_0xb1f2fc){_0x4910a3[_0xeca9('0x20')]=_0xb1f2fc;if(_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x40')]){_0x1436d0[_0xeca9('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xeca9('0x42')](_0x1436d0);})[_0xeca9('0x24')](function(_0x15ef4e){_0x4910a3[_0xeca9('0x43')]=_0x15ef4e;return _0x4910a3;})[_0xeca9('0x24')](respondWithFilteredResult(_0x424f7b,_0x1436d0))[_0xeca9('0x44')](handleError(_0x424f7b,null));};exports[_0xeca9('0x45')]=function(_0x5cb0d1,_0x1d3338){var _0x388943={'raw':!![],'where':{'id':_0x5cb0d1[_0xeca9('0x46')]['id']}},_0x188ebc={};_0x188ebc[_0xeca9('0x2f')]=_['keys'](db[_0xeca9('0x2b')][_0xeca9('0x47')]);_0x188ebc[_0xeca9('0x31')]=_[_0xeca9('0x48')](_0x5cb0d1['query']);_0x188ebc[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x188ebc['model'],_0x188ebc[_0xeca9('0x31')]);_0x388943[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x188ebc[_0xeca9('0x2f')],qs[_0xeca9('0x49')](_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x49')]));_0x388943[_0xeca9('0x34')]=_0x388943[_0xeca9('0x34')][_0xeca9('0x35')]?_0x388943[_0xeca9('0x34')]:_0x188ebc[_0xeca9('0x2f')];if(_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x40')]){_0x388943[_0xeca9('0x41')]=[{'all':!![]}];}_0x388943=_['merge']({},_0x388943,_0x5cb0d1[_0xeca9('0x3f')]);return db[_0xeca9('0x2b')][_0xeca9('0x4a')](_0x388943)[_0xeca9('0x24')](handleEntityNotFound(_0x1d3338,null))['then'](respondWithResult(_0x1d3338,null))[_0xeca9('0x44')](handleError(_0x1d3338,null));};exports[_0xeca9('0x4b')]=function(_0x548fab,_0x5e6dc2){return db[_0xeca9('0x2b')][_0xeca9('0x4b')](_0x548fab[_0xeca9('0x4c')],{})[_0xeca9('0x24')](respondWithResult(_0x5e6dc2,0xc9))['catch'](handleError(_0x5e6dc2,null));};exports[_0xeca9('0x23')]=function(_0xa4faf9,_0x346c62){if(_0xa4faf9[_0xeca9('0x4c')]['id']){delete _0xa4faf9[_0xeca9('0x4c')]['id'];}return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0xa4faf9[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x346c62,null))['then'](saveUpdates(_0xa4faf9['body'],null))[_0xeca9('0x24')](respondWithResult(_0x346c62,null))[_0xeca9('0x44')](handleError(_0x346c62,null));};exports['destroy']=function(_0x283d2d,_0x315f54){return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0x283d2d[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x315f54,null))[_0xeca9('0x24')](removeEntity(_0x315f54,null))[_0xeca9('0x44')](handleError(_0x315f54,null));};exports[_0xeca9('0x4d')]=function(_0x56a212,_0x5cd84d){return db['Cdr']['describe']()[_0xeca9('0x24')](respondWithResult(_0x5cd84d,null))['catch'](handleError(_0x5cd84d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 16c3e19..6a7ff26 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xf54b2e,_0x4246a0){var _0x131926=function(_0x34330b){while(--_0x34330b){_0xf54b2e['push'](_0xf54b2e['shift']());}};_0x131926(++_0x4246a0);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x17dd9c,_0x53d048){var _0x6a6ee7=function(_0x16a52e){while(--_0x16a52e){_0x17dd9c['push'](_0x17dd9c['shift']());}};_0x6a6ee7(++_0x53d048);}(_0x7a54,0x106));var _0x47a5=function(_0x50bc84,_0x4370ef){_0x50bc84=_0x50bc84-0x0;var _0x1342ad=_0x7a54[_0x50bc84];return _0x1342ad;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f350f2f..b76e7f7 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 _0xbefd=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','Cdr,\x20%s,\x20%s'];(function(_0x3e1174,_0x3c20d9){var _0x1857a7=function(_0x1944ce){while(--_0x1944ce){_0x3e1174['push'](_0x3e1174['shift']());}};_0x1857a7(++_0x3c20d9);}(_0xbefd,0x1d3));var _0xdbef=function(_0x5de875,_0x432204){_0x5de875=_0x5de875-0x0;var _0x176800=_0xbefd[_0x5de875];return _0x176800;};'use strict';var _=require('lodash');var util=require(_0xdbef('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbef('0x1'));var db=require(_0xdbef('0x2'))['db'];var utils=require(_0xdbef('0x3'));var logger=require('../../config/logger')(_0xdbef('0x4'));var config=require(_0xdbef('0x5'));var jayson=require(_0xdbef('0x6'));var client=jayson[_0xdbef('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33ece5,_0x56ef92,_0x465f08){return new BPromise(function(_0x21d68f,_0x278dc8){return client['request'](_0x33ece5,_0x465f08)['then'](function(_0x3e7a23){logger['info'](_0xdbef('0x8'),_0x56ef92,_0xdbef('0x9'));logger[_0xdbef('0xa')](_0xdbef('0xb'),_0x56ef92,_0xdbef('0x9'),JSON[_0xdbef('0xc')](_0x3e7a23));if(_0x3e7a23['error']){if(_0x3e7a23[_0xdbef('0xd')][_0xdbef('0xe')]===0x1f4){logger['error'](_0xdbef('0x8'),_0x56ef92,_0x3e7a23[_0xdbef('0xd')]['message']);return _0x278dc8(_0x3e7a23[_0xdbef('0xd')]['message']);}logger[_0xdbef('0xd')](_0xdbef('0x8'),_0x56ef92,_0x3e7a23['error'][_0xdbef('0xf')]);return _0x21d68f(_0x3e7a23[_0xdbef('0xd')][_0xdbef('0xf')]);}else{logger['info'](_0xdbef('0x8'),_0x56ef92,_0xdbef('0x9'));_0x21d68f(_0x3e7a23[_0xdbef('0x10')][_0xdbef('0xf')]);}})['catch'](function(_0x2d917a){logger[_0xdbef('0xd')](_0xdbef('0x8'),_0x56ef92,_0x2d917a);_0x278dc8(_0x2d917a);});});} \ No newline at end of file +var _0x429d=['error','code','Cdr,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c853f,_0x8a009b){var _0x55b2be=function(_0x52f795){while(--_0x52f795){_0x1c853f['push'](_0x1c853f['shift']());}};_0x55b2be(++_0x8a009b);}(_0x429d,0x1bb));var _0xd429=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x429d[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd429('0x0'));var BPromise=require(_0xd429('0x1'));var rs=require(_0xd429('0x2'));var fs=require('fs');var Redis=require(_0xd429('0x3'));var db=require(_0xd429('0x4'))['db'];var utils=require(_0xd429('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd429('0x6'));var jayson=require(_0xd429('0x7'));var client=jayson[_0xd429('0x8')][_0xd429('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dc9f2,_0x4b429a,_0x1dc37e){return new BPromise(function(_0x5da8b8,_0x186e73){return client[_0xd429('0xa')](_0x3dc9f2,_0x1dc37e)[_0xd429('0xb')](function(_0x28d28c){logger[_0xd429('0xc')]('Cdr,\x20%s,\x20%s',_0x4b429a,_0xd429('0xd'));logger[_0xd429('0xe')](_0xd429('0xf'),_0x4b429a,_0xd429('0xd'),JSON[_0xd429('0x10')](_0x28d28c));if(_0x28d28c[_0xd429('0x11')]){if(_0x28d28c[_0xd429('0x11')][_0xd429('0x12')]===0x1f4){logger[_0xd429('0x11')](_0xd429('0x13'),_0x4b429a,_0x28d28c[_0xd429('0x11')][_0xd429('0x14')]);return _0x186e73(_0x28d28c[_0xd429('0x11')]['message']);}logger[_0xd429('0x11')](_0xd429('0x13'),_0x4b429a,_0x28d28c[_0xd429('0x11')][_0xd429('0x14')]);return _0x5da8b8(_0x28d28c[_0xd429('0x11')][_0xd429('0x14')]);}else{logger[_0xd429('0xc')](_0xd429('0x13'),_0x4b429a,_0xd429('0xd'));_0x5da8b8(_0x28d28c[_0xd429('0x15')][_0xd429('0x14')]);}})[_0xd429('0x16')](function(_0x208ff2){logger[_0xd429('0x11')](_0xd429('0x13'),_0x4b429a,_0x208ff2);_0x186e73(_0x208ff2);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index de99583..f4a12d8 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x1e8189,_0x482c1a){var _0x519ba9=function(_0x261937){while(--_0x261937){_0x1e8189['push'](_0x1e8189['shift']());}};_0x519ba9(++_0x482c1a);}(_0xb10b,0x12a));var _0xbb10=function(_0xd07790,_0x3db009){_0xd07790=_0xd07790-0x0;var _0x32f10e=_0xb10b[_0xd07790];return _0x32f10e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 1061a1d..e8926a1 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 _0xf1e4=['STRING','noop','TEXT','exports','INTEGER'];(function(_0x31db02,_0x330986){var _0x1b2e55=function(_0x121a87){while(--_0x121a87){_0x31db02['push'](_0x31db02['shift']());}};_0x1b2e55(++_0x330986);}(_0xf1e4,0x198));var _0x4f1e=function(_0x46e09b,_0x957550){_0x46e09b=_0x46e09b-0x0;var _0x528b85=_0xf1e4[_0x46e09b];return _0x528b85;};'use strict';var Sequelize=require('sequelize');module[_0x4f1e('0x0')]={'priority':{'type':Sequelize[_0x4f1e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4f1e('0x2')],'allowNull':![],'defaultValue':_0x4f1e('0x3')},'appdata':{'type':Sequelize[_0x4f1e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4f1e('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x9222=['INTEGER','noop','TEXT','*,*,*,*','sequelize'];(function(_0x365c90,_0x39daaf){var _0x1521e0=function(_0x10dba6){while(--_0x10dba6){_0x365c90['push'](_0x365c90['shift']());}};_0x1521e0(++_0x39daaf);}(_0x9222,0x144));var _0x2922=function(_0x5bd1a9,_0x4ceb96){_0x5bd1a9=_0x5bd1a9-0x0;var _0x5ba2cc=_0x9222[_0x5bd1a9];return _0x5ba2cc;};'use strict';var Sequelize=require(_0x2922('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2922('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2922('0x2')},'appdata':{'type':Sequelize[_0x2922('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2922('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 19db462..057d72a 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 _0xee5b=['../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','includeAll','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xee5b,0x1f4));var _0xbee5=function(_0x55485f,_0xd8b2ed){_0x55485f=_0x55485f-0x0;var _0x169cff=_0xee5b[_0x55485f];return _0x169cff;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];function respondWithStatusCode(_0xcef158,_0x48f771){_0x48f771=_0x48f771||0xcc;return function(_0x14e032){if(_0x14e032){return _0xcef158['sendStatus'](_0x48f771);}return _0xcef158[_0xbee5('0x17')](_0x48f771)[_0xbee5('0x18')]();};}function respondWithResult(_0x8a268f,_0x593ecb){_0x593ecb=_0x593ecb||0xc8;return function(_0x5092f2){if(_0x5092f2){return _0x8a268f[_0xbee5('0x17')](_0x593ecb)['json'](_0x5092f2);}};}function respondWithFilteredResult(_0x40afcb,_0x5426c9){return function(_0x1a24bd){if(_0x1a24bd){var _0x141878=typeof _0x5426c9[_0xbee5('0x19')]==='undefined'&&typeof _0x5426c9[_0xbee5('0x1a')]===_0xbee5('0x1b');var _0x5a0ae5=_0x1a24bd[_0xbee5('0x1c')];var _0x538460=_0x141878?0x0:_0x5426c9[_0xbee5('0x19')];var _0x3c3f4e=_0x141878?_0x1a24bd[_0xbee5('0x1c')]:_0x5426c9[_0xbee5('0x19')]+_0x5426c9[_0xbee5('0x1a')];var _0xa50ec9;if(_0x3c3f4e>=_0x5a0ae5){_0x3c3f4e=_0x5a0ae5;_0xa50ec9=0xc8;}else{_0xa50ec9=0xce;}_0x40afcb[_0xbee5('0x17')](_0xa50ec9);return _0x40afcb[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x538460+'-'+_0x3c3f4e+'/'+_0x5a0ae5)[_0xbee5('0x1f')](_0x1a24bd);}return null;};}function patchUpdates(_0x35d7d3){return function(_0x40a06){try{jsonpatch[_0xbee5('0x20')](_0x40a06,_0x35d7d3,!![]);}catch(_0x47af8e){return BPromise['reject'](_0x47af8e);}return _0x40a06[_0xbee5('0x21')]();};}function saveUpdates(_0x48bfb5,_0x205491){return function(_0x117cb3){if(_0x117cb3){return _0x117cb3[_0xbee5('0x22')](_0x48bfb5)[_0xbee5('0x23')](function(_0x3f23c5){return _0x3f23c5;});}return null;};}function removeEntity(_0xb665df,_0x359ccf){return function(_0x3cfa8d){if(_0x3cfa8d){return _0x3cfa8d[_0xbee5('0x24')]()['then'](function(){_0xb665df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x519473,_0x50d774){return function(_0x1af3de){if(!_0x1af3de){_0x519473[_0xbee5('0x25')](0x194);}return _0x1af3de;};}function handleError(_0x3b84c8,_0x28c74d){_0x28c74d=_0x28c74d||0x1f4;return function(_0x169042){logger[_0xbee5('0x26')](_0x169042[_0xbee5('0x27')]);if(_0x169042['name']){delete _0x169042[_0xbee5('0x28')];}_0x3b84c8[_0xbee5('0x17')](_0x28c74d)[_0xbee5('0x29')](_0x169042);};}exports[_0xbee5('0x2a')]=function(_0x1a8bcc,_0x5f0419){var _0x21b993={'raw':!![],'where':{'id':_0x1a8bcc[_0xbee5('0x2b')]['id']}},_0x15ffb1={};_0x15ffb1[_0xbee5('0x2c')]=_[_0xbee5('0x2d')](db[_0xbee5('0x2e')][_0xbee5('0x2f')]);_0x15ffb1[_0xbee5('0x30')]=_[_0xbee5('0x2d')](_0x1a8bcc['query']);_0x15ffb1[_0xbee5('0x31')]=_['intersection'](_0x15ffb1[_0xbee5('0x2c')],_0x15ffb1['query']);_0x21b993[_0xbee5('0x32')]=_['intersection'](_0x15ffb1[_0xbee5('0x2c')],qs['fields'](_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x33')]));_0x21b993[_0xbee5('0x32')]=_0x21b993[_0xbee5('0x32')]['length']?_0x21b993[_0xbee5('0x32')]:_0x15ffb1[_0xbee5('0x2c')];if(_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x34')]){_0x21b993['include']=[{'all':!![]}];}_0x21b993=_[_0xbee5('0x35')]({},_0x21b993,_0x1a8bcc[_0xbee5('0x36')]);return db[_0xbee5('0x2e')][_0xbee5('0x37')](_0x21b993)['then'](handleEntityNotFound(_0x5f0419,null))[_0xbee5('0x23')](respondWithResult(_0x5f0419,null))[_0xbee5('0x38')](handleError(_0x5f0419,null));};exports[_0xbee5('0x22')]=function(_0x33aaba,_0x52ecf1){if(_0x33aaba[_0xbee5('0x39')]['id']){delete _0x33aaba['body']['id'];}return db[_0xbee5('0x2e')]['find']({'where':{'id':_0x33aaba['params']['id']}})['then'](handleEntityNotFound(_0x52ecf1,null))[_0xbee5('0x23')](saveUpdates(_0x33aaba[_0xbee5('0x39')],null))[_0xbee5('0x23')](respondWithResult(_0x52ecf1,null))[_0xbee5('0x38')](handleError(_0x52ecf1,null));};exports[_0xbee5('0x24')]=function(_0x2b83d5,_0x37dfd3){return db[_0xbee5('0x2e')]['find']({'where':{'id':_0x2b83d5[_0xbee5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x37dfd3,null))[_0xbee5('0x23')](removeEntity(_0x37dfd3,null))[_0xbee5('0x38')](handleError(_0x37dfd3,null));}; \ No newline at end of file +var _0x9861=['status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','include','merge','find','catch','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus'];(function(_0x1964c7,_0x49ad27){var _0x284c96=function(_0x594977){while(--_0x594977){_0x1964c7['push'](_0x1964c7['shift']());}};_0x284c96(++_0x49ad27);}(_0x9861,0x176));var _0x1986=function(_0x366c68,_0x554017){_0x366c68=_0x366c68-0x0;var _0x1ff677=_0x9861[_0x366c68];return _0x1ff677;};'use strict';var emlformat=require(_0x1986('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1986('0x1'));var rp=require(_0x1986('0x2'));var moment=require(_0x1986('0x3'));var BPromise=require(_0x1986('0x4'));var Mustache=require(_0x1986('0x5'));var util=require(_0x1986('0x6'));var path=require('path');var sox=require(_0x1986('0x7'));var csv=require(_0x1986('0x8'));var ejs=require(_0x1986('0x9'));var fs=require('fs');var fs_extra=require(_0x1986('0xa'));var _=require(_0x1986('0xb'));var squel=require(_0x1986('0xc'));var crypto=require(_0x1986('0xd'));var jsforce=require(_0x1986('0xe'));var deskjs=require(_0x1986('0xf'));var toCsv=require(_0x1986('0x8'));var querystring=require('querystring');var Papa=require(_0x1986('0x10'));var Redis=require(_0x1986('0x11'));var authService=require(_0x1986('0x12'));var qs=require(_0x1986('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1986('0x14'));var logger=require(_0x1986('0x15'))('api');var utils=require(_0x1986('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1986('0x17'))['db'];function respondWithStatusCode(_0x1f49f6,_0xd87393){_0xd87393=_0xd87393||0xcc;return function(_0x2de9ba){if(_0x2de9ba){return _0x1f49f6[_0x1986('0x18')](_0xd87393);}return _0x1f49f6[_0x1986('0x19')](_0xd87393)[_0x1986('0x1a')]();};}function respondWithResult(_0x448717,_0x455e47){_0x455e47=_0x455e47||0xc8;return function(_0x3a8cca){if(_0x3a8cca){return _0x448717['status'](_0x455e47)['json'](_0x3a8cca);}};}function respondWithFilteredResult(_0x12984d,_0x3d0207){return function(_0x59228f){if(_0x59228f){var _0x3b4244=typeof _0x3d0207[_0x1986('0x1b')]===_0x1986('0x1c')&&typeof _0x3d0207[_0x1986('0x1d')]===_0x1986('0x1c');var _0x44fcf1=_0x59228f[_0x1986('0x1e')];var _0x15f7b9=_0x3b4244?0x0:_0x3d0207[_0x1986('0x1b')];var _0x7dec68=_0x3b4244?_0x59228f[_0x1986('0x1e')]:_0x3d0207[_0x1986('0x1b')]+_0x3d0207[_0x1986('0x1d')];var _0x2ecdf9;if(_0x7dec68>=_0x44fcf1){_0x7dec68=_0x44fcf1;_0x2ecdf9=0xc8;}else{_0x2ecdf9=0xce;}_0x12984d['status'](_0x2ecdf9);return _0x12984d[_0x1986('0x1f')](_0x1986('0x20'),_0x15f7b9+'-'+_0x7dec68+'/'+_0x44fcf1)['json'](_0x59228f);}return null;};}function patchUpdates(_0x3ab28e){return function(_0x693eb2){try{jsonpatch['apply'](_0x693eb2,_0x3ab28e,!![]);}catch(_0x569efa){return BPromise[_0x1986('0x21')](_0x569efa);}return _0x693eb2[_0x1986('0x22')]();};}function saveUpdates(_0x1450d5,_0x530aa1){return function(_0x3c7471){if(_0x3c7471){return _0x3c7471[_0x1986('0x23')](_0x1450d5)[_0x1986('0x24')](function(_0x4f6964){return _0x4f6964;});}return null;};}function removeEntity(_0x2e9bc9,_0xbde8e2){return function(_0x281989){if(_0x281989){return _0x281989[_0x1986('0x25')]()[_0x1986('0x24')](function(){_0x2e9bc9['status'](0xcc)[_0x1986('0x1a')]();});}};}function handleEntityNotFound(_0x518f3c,_0x19fd8a){return function(_0xe23114){if(!_0xe23114){_0x518f3c['sendStatus'](0x194);}return _0xe23114;};}function handleError(_0x2daf0f,_0x37094b){_0x37094b=_0x37094b||0x1f4;return function(_0x3b8f25){logger['error'](_0x3b8f25['stack']);if(_0x3b8f25[_0x1986('0x26')]){delete _0x3b8f25[_0x1986('0x26')];}_0x2daf0f['status'](_0x37094b)[_0x1986('0x27')](_0x3b8f25);};}exports[_0x1986('0x28')]=function(_0x1dcd2c,_0x455937){var _0x4d7ed1={'raw':!![],'where':{'id':_0x1dcd2c[_0x1986('0x29')]['id']}},_0x39796d={};_0x39796d[_0x1986('0x2a')]=_['keys'](db[_0x1986('0x2b')][_0x1986('0x2c')]);_0x39796d[_0x1986('0x2d')]=_[_0x1986('0x2e')](_0x1dcd2c[_0x1986('0x2d')]);_0x39796d[_0x1986('0x2f')]=_[_0x1986('0x30')](_0x39796d['model'],_0x39796d[_0x1986('0x2d')]);_0x4d7ed1[_0x1986('0x31')]=_[_0x1986('0x30')](_0x39796d['model'],qs[_0x1986('0x32')](_0x1dcd2c[_0x1986('0x2d')]['fields']));_0x4d7ed1['attributes']=_0x4d7ed1[_0x1986('0x31')][_0x1986('0x33')]?_0x4d7ed1[_0x1986('0x31')]:_0x39796d[_0x1986('0x2a')];if(_0x1dcd2c['query']['includeAll']){_0x4d7ed1[_0x1986('0x34')]=[{'all':!![]}];}_0x4d7ed1=_[_0x1986('0x35')]({},_0x4d7ed1,_0x1dcd2c['options']);return db['ChatApplication'][_0x1986('0x36')](_0x4d7ed1)[_0x1986('0x24')](handleEntityNotFound(_0x455937,null))['then'](respondWithResult(_0x455937,null))[_0x1986('0x37')](handleError(_0x455937,null));};exports[_0x1986('0x23')]=function(_0xe123c1,_0x1b287f){if(_0xe123c1['body']['id']){delete _0xe123c1[_0x1986('0x38')]['id'];}return db[_0x1986('0x2b')][_0x1986('0x36')]({'where':{'id':_0xe123c1['params']['id']}})['then'](handleEntityNotFound(_0x1b287f,null))[_0x1986('0x24')](saveUpdates(_0xe123c1['body'],null))[_0x1986('0x24')](respondWithResult(_0x1b287f,null))[_0x1986('0x37')](handleError(_0x1b287f,null));};exports[_0x1986('0x25')]=function(_0x290f5a,_0x5326af){return db[_0x1986('0x2b')][_0x1986('0x36')]({'where':{'id':_0x290f5a[_0x1986('0x29')]['id']}})[_0x1986('0x24')](handleEntityNotFound(_0x5326af,null))[_0x1986('0x24')](removeEntity(_0x5326af,null))[_0x1986('0x37')](handleError(_0x5326af,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 688a92b..e828b5b 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 _0x5665=['./chatApplication.attributes','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x5665,0x162));var _0x5566=function(_0xb85eb6,_0x3b6fe6){_0xb85eb6=_0xb85eb6-0x0;var _0x27c670=_0x5665[_0xb85eb6];return _0x27c670;};'use strict';var _=require(_0x5566('0x0'));var util=require('util');var logger=require(_0x5566('0x1'))('api');var moment=require(_0x5566('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5566('0x3'));var rimraf=require(_0x5566('0x4'));var config=require(_0x5566('0x5'));var attributes=require(_0x5566('0x6'));module['exports']=function(_0x1a6a13,_0x2394c6){return _0x1a6a13['define']('ChatApplication',attributes,{'tableName':_0x5566('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5566('0x8'),'collate':_0x5566('0x9')});}; \ No newline at end of file +var _0x7762=['define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','./chatApplication.attributes','exports'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x7762,0x1c6));var _0x2776=function(_0x5cd7a6,_0x59b9cf){_0x5cd7a6=_0x5cd7a6-0x0;var _0x1165b=_0x7762[_0x5cd7a6];return _0x1165b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2776('0x0'))('api');var moment=require(_0x2776('0x1'));var BPromise=require(_0x2776('0x2'));var rp=require(_0x2776('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2776('0x4'));module[_0x2776('0x5')]=function(_0x277e6c,_0x2fadf1){return _0x277e6c[_0x2776('0x6')](_0x2776('0x7'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2776('0x8'),'collate':_0x2776('0x9')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f4734f7..891a47e 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 _0x159b=['http','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x4491ad,_0x5ce111){var _0x293c5c=function(_0x55f677){while(--_0x55f677){_0x4491ad['push'](_0x4491ad['shift']());}};_0x293c5c(++_0x5ce111);}(_0x159b,0x99));var _0xb159=function(_0x3b4df0,_0xfaa86a){_0x3b4df0=_0x3b4df0-0x0;var _0x2ab009=_0x159b[_0x3b4df0];return _0x2ab009;};'use strict';var _=require(_0xb159('0x0'));var util=require(_0xb159('0x1'));var moment=require('moment');var BPromise=require(_0xb159('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb159('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb159('0x4'));var logger=require('../../config/logger')(_0xb159('0x5'));var config=require('../../config/environment');var jayson=require(_0xb159('0x6'));var client=jayson['client'][_0xb159('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5255a9,_0x1a5bca,_0x4874df){return new BPromise(function(_0x480432,_0x4961b5){return client[_0xb159('0x8')](_0x5255a9,_0x4874df)[_0xb159('0x9')](function(_0x4bc393){logger[_0xb159('0xa')]('ChatApplication,\x20%s,\x20%s',_0x1a5bca,_0xb159('0xb'));logger[_0xb159('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1a5bca,_0xb159('0xb'),JSON[_0xb159('0xd')](_0x4bc393));if(_0x4bc393[_0xb159('0xe')]){if(_0x4bc393['error'][_0xb159('0xf')]===0x1f4){logger[_0xb159('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1a5bca,_0x4bc393[_0xb159('0xe')][_0xb159('0x10')]);return _0x4961b5(_0x4bc393[_0xb159('0xe')][_0xb159('0x10')]);}logger[_0xb159('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1a5bca,_0x4bc393[_0xb159('0xe')][_0xb159('0x10')]);return _0x480432(_0x4bc393['error'][_0xb159('0x10')]);}else{logger[_0xb159('0xa')](_0xb159('0x11'),_0x1a5bca,_0xb159('0xb'));_0x480432(_0x4bc393[_0xb159('0x12')][_0xb159('0x10')]);}})[_0xb159('0x13')](function(_0x13e80d){logger[_0xb159('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1a5bca,_0x13e80d);_0x4961b5(_0x13e80d);});});} \ No newline at end of file +var _0x82e1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x21b6a1,_0x315bb2){var _0x41f387=function(_0x6a10bf){while(--_0x6a10bf){_0x21b6a1['push'](_0x21b6a1['shift']());}};_0x41f387(++_0x315bb2);}(_0x82e1,0x18b));var _0x182e=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x82e1[_0x3e2489];return _0x2254ce;};'use strict';var _=require(_0x182e('0x0'));var util=require(_0x182e('0x1'));var moment=require('moment');var BPromise=require(_0x182e('0x2'));var rs=require(_0x182e('0x3'));var fs=require('fs');var Redis=require(_0x182e('0x4'));var db=require(_0x182e('0x5'))['db'];var utils=require(_0x182e('0x6'));var logger=require(_0x182e('0x7'))('rpc');var config=require(_0x182e('0x8'));var jayson=require(_0x182e('0x9'));var client=jayson[_0x182e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45e6d1,_0x50994f,_0x4bcfb7){return new BPromise(function(_0x118a96,_0x4bda14){return client['request'](_0x45e6d1,_0x4bcfb7)[_0x182e('0xb')](function(_0x5140c6){logger['info'](_0x182e('0xc'),_0x50994f,_0x182e('0xd'));logger[_0x182e('0xe')](_0x182e('0xf'),_0x50994f,_0x182e('0xd'),JSON['stringify'](_0x5140c6));if(_0x5140c6[_0x182e('0x10')]){if(_0x5140c6['error'][_0x182e('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x50994f,_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);return _0x4bda14(_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);}logger[_0x182e('0x10')](_0x182e('0xc'),_0x50994f,_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);return _0x118a96(_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);}else{logger['info'](_0x182e('0xc'),_0x50994f,_0x182e('0xd'));_0x118a96(_0x5140c6[_0x182e('0x13')]['message']);}})[_0x182e('0x14')](function(_0x5189c4){logger[_0x182e('0x10')]('ChatApplication,\x20%s,\x20%s',_0x50994f,_0x5189c4);_0x4bda14(_0x5189c4);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 44dc47b..352d2da 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 _0x127a=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','put','isAuthenticated'];(function(_0x49948d,_0x4587e5){var _0x3585ea=function(_0x223223){while(--_0x223223){_0x49948d['push'](_0x49948d['shift']());}};_0x3585ea(++_0x4587e5);}(_0x127a,0x17d));var _0xa127=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x127a[_0x3e44fa];return _0x2a0aba;};'use strict';var multer=require(_0xa127('0x0'));var util=require(_0xa127('0x1'));var path=require(_0xa127('0x2'));var timeout=require(_0xa127('0x3'));var express=require(_0xa127('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa127('0x5'));var interaction=require(_0xa127('0x6'));var config=require('../../config/environment');var controller=require(_0xa127('0x7'));router['get'](_0xa127('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xa127('0x9')]('/:id',auth[_0xa127('0xa')](),controller['update']);router[_0xa127('0xb')](_0xa127('0x8'),auth['isAuthenticated'](),controller[_0xa127('0xc')]);module[_0xa127('0xd')]=router; \ No newline at end of file +var _0xa88f=['isAuthenticated','show','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./chatApplication.controller','get','/:id'];(function(_0x786480,_0x1e5b82){var _0x3500a3=function(_0x439ce5){while(--_0x439ce5){_0x786480['push'](_0x786480['shift']());}};_0x3500a3(++_0x1e5b82);}(_0xa88f,0x158));var _0xfa88=function(_0x1e657b,_0x5bde0a){_0x1e657b=_0x1e657b-0x0;var _0x4a425d=_0xa88f[_0x1e657b];return _0x4a425d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa88('0x0'));var timeout=require(_0xfa88('0x1'));var express=require(_0xfa88('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfa88('0x3'));var config=require('../../config/environment');var controller=require(_0xfa88('0x4'));router[_0xfa88('0x5')](_0xfa88('0x6'),auth[_0xfa88('0x7')](),controller[_0xfa88('0x8')]);router['put'](_0xfa88('0x6'),auth['isAuthenticated'](),controller[_0xfa88('0x9')]);router[_0xfa88('0xa')](_0xfa88('0x6'),auth[_0xfa88('0x7')](),controller[_0xfa88('0xb')]);module[_0xfa88('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 4451052..b85ad16 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 _0x1883=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x1883,0xab));var _0x3188=function(_0x10adf8,_0x42a49f){_0x10adf8=_0x10adf8-0x0;var _0x1b7379=_0x1883[_0x10adf8];return _0x1b7379;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'write':{'type':Sequelize[_0x3188('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd9ed=['BOOLEAN','sequelize','STRING'];(function(_0x1b692f,_0x4cc467){var _0xef0963=function(_0x5809b5){while(--_0x5809b5){_0x1b692f['push'](_0x1b692f['shift']());}};_0xef0963(++_0x4cc467);}(_0xd9ed,0x18a));var _0xdd9e=function(_0x2b398d,_0x3c67ed){_0x2b398d=_0x2b398d-0x0;var _0x2f68aa=_0xd9ed[_0x2b398d];return _0x2f68aa;};'use strict';var Sequelize=require(_0xdd9e('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd9e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdd9e('0x1')]},'write':{'type':Sequelize[_0xdd9e('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index d552449..60622ea 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 _0x6a26=['getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','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/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','ChatGroup','findAll','catch','show','length','options','find','create','body','update','params','describe','getUnread','user','addMembers','omit','findOne','User','sort','getMembers','removeMembers','addMessage','ChatGroupId'];(function(_0x3b4493,_0x106e71){var _0x28fc72=function(_0x1c6ec5){while(--_0x1c6ec5){_0x3b4493['push'](_0x3b4493['shift']());}};_0x28fc72(++_0x106e71);}(_0x6a26,0x192));var _0x66a2=function(_0x4f9fbc,_0x55f4e0){_0x4f9fbc=_0x4f9fbc-0x0;var _0xefbf6f=_0x6a26[_0x4f9fbc];return _0xefbf6f;};'use strict';var emlformat=require(_0x66a2('0x0'));var rimraf=require(_0x66a2('0x1'));var zipdir=require(_0x66a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66a2('0x3'));var moment=require(_0x66a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x66a2('0x5'));var util=require('util');var path=require(_0x66a2('0x6'));var sox=require('sox');var csv=require(_0x66a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66a2('0x8'));var _=require(_0x66a2('0x9'));var squel=require(_0x66a2('0xa'));var crypto=require(_0x66a2('0xb'));var jsforce=require(_0x66a2('0xc'));var deskjs=require(_0x66a2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x66a2('0xe'));var Redis=require(_0x66a2('0xf'));var authService=require(_0x66a2('0x10'));var qs=require(_0x66a2('0x11'));var as=require(_0x66a2('0x12'));var hardwareService=require(_0x66a2('0x13'));var logger=require(_0x66a2('0x14'))(_0x66a2('0x15'));var utils=require(_0x66a2('0x16'));var config=require(_0x66a2('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x66a2('0x18')]=_[_0x66a2('0x19')](config['redis'],{'host':_0x66a2('0x1a'),'port':0x18eb});var socket=require(_0x66a2('0x1b'))(new Redis(config['redis']));require(_0x66a2('0x1c'))[_0x66a2('0x1d')](socket);function respondWithStatusCode(_0x143f7e,_0x348876){_0x348876=_0x348876||0xcc;return function(_0x2c1198){if(_0x2c1198){return _0x143f7e[_0x66a2('0x1e')](_0x348876);}return _0x143f7e[_0x66a2('0x1f')](_0x348876)[_0x66a2('0x20')]();};}function respondWithResult(_0x3ed7bd,_0x42a3e6){_0x42a3e6=_0x42a3e6||0xc8;return function(_0x4d1d58){if(_0x4d1d58){return _0x3ed7bd[_0x66a2('0x1f')](_0x42a3e6)[_0x66a2('0x21')](_0x4d1d58);}};}function respondWithFilteredResult(_0x7a5ea0,_0x5511f3){return function(_0x70ed91){if(_0x70ed91){var _0x33ed50=typeof _0x5511f3[_0x66a2('0x22')]===_0x66a2('0x23')&&typeof _0x5511f3[_0x66a2('0x24')]===_0x66a2('0x23');var _0x5aeac6=_0x70ed91['count'];var _0x277131=_0x33ed50?0x0:_0x5511f3[_0x66a2('0x22')];var _0x1ae2e3=_0x33ed50?_0x70ed91[_0x66a2('0x25')]:_0x5511f3[_0x66a2('0x22')]+_0x5511f3['limit'];var _0x2396df;if(_0x1ae2e3>=_0x5aeac6){_0x1ae2e3=_0x5aeac6;_0x2396df=0xc8;}else{_0x2396df=0xce;}_0x7a5ea0[_0x66a2('0x1f')](_0x2396df);return _0x7a5ea0['set'](_0x66a2('0x26'),_0x277131+'-'+_0x1ae2e3+'/'+_0x5aeac6)[_0x66a2('0x21')](_0x70ed91);}return null;};}function patchUpdates(_0x217732){return function(_0x3f3d4b){try{jsonpatch[_0x66a2('0x27')](_0x3f3d4b,_0x217732,!![]);}catch(_0x50c0a3){return BPromise[_0x66a2('0x28')](_0x50c0a3);}return _0x3f3d4b[_0x66a2('0x29')]();};}function saveUpdates(_0x4743e0,_0x5c01c1){return function(_0x1c3497){if(_0x1c3497){return _0x1c3497['update'](_0x4743e0)['then'](function(_0x2fc4e3){return _0x2fc4e3;});}return null;};}function removeEntity(_0x319139,_0x3cbdbd){return function(_0x14b68d){if(_0x14b68d){return _0x14b68d[_0x66a2('0x2a')]()[_0x66a2('0x2b')](function(){_0x319139[_0x66a2('0x1f')](0xcc)[_0x66a2('0x20')]();});}};}function handleEntityNotFound(_0x17d55a,_0x35572f){return function(_0x5d7eb3){if(!_0x5d7eb3){_0x17d55a['sendStatus'](0x194);}return _0x5d7eb3;};}function handleError(_0x4a7701,_0x143512){_0x143512=_0x143512||0x1f4;return function(_0x588a47){logger[_0x66a2('0x2c')](_0x588a47['stack']);if(_0x588a47[_0x66a2('0x2d')]){delete _0x588a47[_0x66a2('0x2d')];}_0x4a7701[_0x66a2('0x1f')](_0x143512)[_0x66a2('0x2e')](_0x588a47);};}exports[_0x66a2('0x2f')]=function(_0x3a041a,_0x111a69){var _0x2d7ee2={},_0x7d79cc={},_0x10107f={'count':0x0,'rows':[]};var _0x40ff46=_[_0x66a2('0x30')](db['ChatGroup'][_0x66a2('0x31')],function(_0xb9d0c9){return{'name':_0xb9d0c9[_0x66a2('0x32')],'type':_0xb9d0c9[_0x66a2('0x33')][_0x66a2('0x34')]};});_0x7d79cc[_0x66a2('0x35')]=_['map'](_0x40ff46,_0x66a2('0x2d'));_0x7d79cc[_0x66a2('0x36')]=_[_0x66a2('0x37')](_0x3a041a['query']);_0x7d79cc[_0x66a2('0x38')]=_[_0x66a2('0x39')](_0x7d79cc[_0x66a2('0x35')],_0x7d79cc[_0x66a2('0x36')]);_0x2d7ee2['attributes']=_[_0x66a2('0x39')](_0x7d79cc[_0x66a2('0x35')],qs[_0x66a2('0x3a')](_0x3a041a[_0x66a2('0x36')]['fields']));_0x2d7ee2[_0x66a2('0x3b')]=_0x2d7ee2[_0x66a2('0x3b')]['length']?_0x2d7ee2['attributes']:_0x7d79cc[_0x66a2('0x35')];if(!_0x3a041a[_0x66a2('0x36')][_0x66a2('0x3c')](_0x66a2('0x3d'))){_0x2d7ee2[_0x66a2('0x24')]=qs[_0x66a2('0x24')](_0x3a041a[_0x66a2('0x36')][_0x66a2('0x24')]);_0x2d7ee2[_0x66a2('0x22')]=qs[_0x66a2('0x22')](_0x3a041a[_0x66a2('0x36')]['offset']);}_0x2d7ee2[_0x66a2('0x3e')]=qs['sort'](_0x3a041a[_0x66a2('0x36')]['sort']);_0x2d7ee2[_0x66a2('0x3f')]=qs['filters'](_[_0x66a2('0x40')](_0x3a041a[_0x66a2('0x36')],_0x7d79cc[_0x66a2('0x38')]),_0x40ff46);if(_0x3a041a[_0x66a2('0x36')][_0x66a2('0x41')]){_0x2d7ee2[_0x66a2('0x3f')]=_[_0x66a2('0x42')](_0x2d7ee2['where'],{'$or':_[_0x66a2('0x30')](_0x40ff46,function(_0x17894c){if(_0x17894c['type']!==_0x66a2('0x43')){var _0x1d28ab={};_0x1d28ab[_0x17894c[_0x66a2('0x2d')]]={'$like':'%'+_0x3a041a['query']['filter']+'%'};return _0x1d28ab;}})});}_0x2d7ee2=_[_0x66a2('0x42')]({},_0x2d7ee2,_0x3a041a['options']);var _0x1b8125={'where':_0x2d7ee2[_0x66a2('0x3f')]};return db['ChatGroup'][_0x66a2('0x25')](_0x1b8125)[_0x66a2('0x2b')](function(_0xd54987){_0x10107f[_0x66a2('0x25')]=_0xd54987;if(_0x3a041a[_0x66a2('0x36')][_0x66a2('0x44')]){_0x2d7ee2[_0x66a2('0x45')]=[{'all':!![]}];}return db[_0x66a2('0x46')][_0x66a2('0x47')](_0x2d7ee2);})[_0x66a2('0x2b')](function(_0x1f23bd){_0x10107f['rows']=_0x1f23bd;return _0x10107f;})[_0x66a2('0x2b')](respondWithFilteredResult(_0x111a69,_0x2d7ee2))[_0x66a2('0x48')](handleError(_0x111a69,null));};exports[_0x66a2('0x49')]=function(_0x48c473,_0x2aa92d){var _0x473878={'raw':!![],'where':{'id':_0x48c473['params']['id']}},_0x52b919={};_0x52b919[_0x66a2('0x35')]=_['keys'](db[_0x66a2('0x46')][_0x66a2('0x31')]);_0x52b919[_0x66a2('0x36')]=_[_0x66a2('0x37')](_0x48c473[_0x66a2('0x36')]);_0x52b919[_0x66a2('0x38')]=_[_0x66a2('0x39')](_0x52b919[_0x66a2('0x35')],_0x52b919[_0x66a2('0x36')]);_0x473878[_0x66a2('0x3b')]=_[_0x66a2('0x39')](_0x52b919['model'],qs[_0x66a2('0x3a')](_0x48c473[_0x66a2('0x36')][_0x66a2('0x3a')]));_0x473878[_0x66a2('0x3b')]=_0x473878[_0x66a2('0x3b')][_0x66a2('0x4a')]?_0x473878[_0x66a2('0x3b')]:_0x52b919[_0x66a2('0x35')];if(_0x48c473[_0x66a2('0x36')][_0x66a2('0x44')]){_0x473878[_0x66a2('0x45')]=[{'all':!![]}];}_0x473878=_[_0x66a2('0x42')]({},_0x473878,_0x48c473[_0x66a2('0x4b')]);return db['ChatGroup'][_0x66a2('0x4c')](_0x473878)['then'](handleEntityNotFound(_0x2aa92d,null))[_0x66a2('0x2b')](respondWithResult(_0x2aa92d,null))[_0x66a2('0x48')](handleError(_0x2aa92d,null));};exports[_0x66a2('0x4d')]=function(_0x21f21d,_0x52a420){return db[_0x66a2('0x46')][_0x66a2('0x4d')](_0x21f21d[_0x66a2('0x4e')],{})[_0x66a2('0x2b')](respondWithResult(_0x52a420,0xc9))[_0x66a2('0x48')](handleError(_0x52a420,null));};exports[_0x66a2('0x4f')]=function(_0x36bfad,_0x543b96){if(_0x36bfad[_0x66a2('0x4e')]['id']){delete _0x36bfad['body']['id'];}return db[_0x66a2('0x46')][_0x66a2('0x4c')]({'where':{'id':_0x36bfad[_0x66a2('0x50')]['id']}})['then'](handleEntityNotFound(_0x543b96,null))['then'](saveUpdates(_0x36bfad[_0x66a2('0x4e')],null))[_0x66a2('0x2b')](respondWithResult(_0x543b96,null))['catch'](handleError(_0x543b96,null));};exports[_0x66a2('0x2a')]=function(_0x1dd071,_0xdd786e){return db[_0x66a2('0x46')][_0x66a2('0x4c')]({'where':{'id':_0x1dd071['params']['id']}})[_0x66a2('0x2b')](handleEntityNotFound(_0xdd786e,null))[_0x66a2('0x2b')](removeEntity(_0xdd786e,null))[_0x66a2('0x48')](handleError(_0xdd786e,null));};exports['describe']=function(_0x2fb654,_0x28664c){return db[_0x66a2('0x46')][_0x66a2('0x51')]()[_0x66a2('0x2b')](respondWithResult(_0x28664c,null))[_0x66a2('0x48')](handleError(_0x28664c,null));};exports[_0x66a2('0x52')]=function(_0x596aa1,_0x1bd1d0,_0x882c97){return db['ChatInternalMessage'][_0x66a2('0x25')]({'where':{'ChatGroupId':_0x596aa1[_0x66a2('0x50')]['id'],'ToId':_0x596aa1[_0x66a2('0x53')]['id'],'read':![]}})[_0x66a2('0x2b')](function(_0x32f0cd){return{'id':_['toInteger'](_0x596aa1[_0x66a2('0x50')]['id']),'count':_0x32f0cd};})[_0x66a2('0x2b')](respondWithResult(_0x1bd1d0,null))[_0x66a2('0x48')](handleError(_0x1bd1d0,null));};exports['addMembers']=function(_0x4e7e87,_0x26cf6c,_0x1a830c){return db[_0x66a2('0x46')]['find']({'where':{'id':_0x4e7e87['params']['id']}})['then'](handleEntityNotFound(_0x26cf6c,null))['then'](function(_0x371f5e){if(_0x371f5e){return _0x371f5e[_0x66a2('0x54')](_0x4e7e87['body']['ids'],_[_0x66a2('0x55')](_0x4e7e87[_0x66a2('0x4e')],['ids','id'])||{});}})[_0x66a2('0x2b')](respondWithResult(_0x26cf6c,null))[_0x66a2('0x48')](handleError(_0x26cf6c,null));};exports['getMembers']=function(_0x580a33,_0x3c05d2,_0xfbe944){var _0xc7d8b1={};var _0x4db010={};var _0x5de55d;var _0x2cd45c;return db[_0x66a2('0x46')][_0x66a2('0x56')]({'where':{'id':_0x580a33[_0x66a2('0x50')]['id']}})[_0x66a2('0x2b')](handleEntityNotFound(_0x3c05d2,null))['then'](function(_0x4c28a0){if(_0x4c28a0){_0x5de55d=_0x4c28a0;_0x4db010['model']=_[_0x66a2('0x37')](db[_0x66a2('0x57')][_0x66a2('0x31')]);_0x4db010[_0x66a2('0x36')]=_[_0x66a2('0x37')](_0x580a33[_0x66a2('0x36')]);_0x4db010[_0x66a2('0x38')]=_[_0x66a2('0x39')](_0x4db010[_0x66a2('0x35')],_0x4db010[_0x66a2('0x36')]);_0xc7d8b1['attributes']=_[_0x66a2('0x39')](_0x4db010[_0x66a2('0x35')],qs[_0x66a2('0x3a')](_0x580a33[_0x66a2('0x36')][_0x66a2('0x3a')]));_0xc7d8b1[_0x66a2('0x3b')]=_0xc7d8b1['attributes'][_0x66a2('0x4a')]?_0xc7d8b1['attributes']:_0x4db010[_0x66a2('0x35')];_0xc7d8b1[_0x66a2('0x3e')]=qs[_0x66a2('0x58')](_0x580a33[_0x66a2('0x36')]['sort']);_0xc7d8b1[_0x66a2('0x3f')]=qs[_0x66a2('0x38')](_['pick'](_0x580a33[_0x66a2('0x36')],_0x4db010[_0x66a2('0x38')]));if(_0x580a33[_0x66a2('0x36')][_0x66a2('0x41')]){_0xc7d8b1['where']=_[_0x66a2('0x42')](_0xc7d8b1['where'],{'$or':_[_0x66a2('0x30')](_0xc7d8b1[_0x66a2('0x3b')],function(_0x21ea68){var _0x11db55={};_0x11db55[_0x21ea68]={'$like':'%'+_0x580a33[_0x66a2('0x36')][_0x66a2('0x41')]+'%'};return _0x11db55;})});}_0xc7d8b1=_[_0x66a2('0x42')]({},_0xc7d8b1,_0x580a33[_0x66a2('0x4b')]);return _0x5de55d[_0x66a2('0x59')](_0xc7d8b1);}})[_0x66a2('0x2b')](function(_0x261bb1){if(_0x261bb1){_0x2cd45c=_0x261bb1[_0x66a2('0x4a')];if(!_0x580a33['query']['hasOwnProperty'](_0x66a2('0x3d'))){_0xc7d8b1['limit']=qs[_0x66a2('0x24')](_0x580a33[_0x66a2('0x36')][_0x66a2('0x24')]);_0xc7d8b1['offset']=qs['offset'](_0x580a33['query'][_0x66a2('0x22')]);}return _0x5de55d[_0x66a2('0x59')](_0xc7d8b1);}})[_0x66a2('0x2b')](function(_0x2c583d){if(_0x2c583d){return _0x2c583d?{'count':_0x2cd45c,'rows':_0x2c583d}:null;}})[_0x66a2('0x2b')](respondWithResult(_0x3c05d2,null))[_0x66a2('0x48')](handleError(_0x3c05d2,null));};exports['removeMembers']=function(_0x4ed422,_0x2c3f9c,_0x596c6c){return db['ChatGroup'][_0x66a2('0x4c')]({'where':{'id':_0x4ed422['params']['id']}})['then'](handleEntityNotFound(_0x2c3f9c,null))['then'](function(_0x1fdd0a){if(_0x1fdd0a){return _0x1fdd0a[_0x66a2('0x5a')](_0x4ed422['query']['ids']);}})[_0x66a2('0x2b')](respondWithStatusCode(_0x2c3f9c,null))[_0x66a2('0x48')](handleError(_0x2c3f9c,null));};exports[_0x66a2('0x5b')]=function(_0x2220ae,_0xc590c8,_0x18feb5){if(_0x2220ae[_0x66a2('0x4e')]['id']){delete _0x2220ae[_0x66a2('0x4e')]['id'];}return db[_0x66a2('0x46')][_0x66a2('0x4c')]({'where':{'id':_0x2220ae[_0x66a2('0x50')]['id']}})[_0x66a2('0x2b')](handleEntityNotFound(_0xc590c8,null))[_0x66a2('0x2b')](function(_0x5e17c5){if(_0x5e17c5){_0x2220ae['body'][_0x66a2('0x5c')]=_0x5e17c5['id'];return db['ChatInternalMessage'][_0x66a2('0x4d')](_0x2220ae['body']);}})[_0x66a2('0x2b')](respondWithResult(_0xc590c8,null))[_0x66a2('0x48')](handleError(_0xc590c8,null));};exports[_0x66a2('0x5d')]=function(_0x3934d4,_0x4af9dd,_0x4cf431){var _0x4c03bb={};var _0x481d69={};var _0x26ae31;var _0x5303d8;return db['ChatGroup'][_0x66a2('0x56')]({'where':{'id':_0x3934d4[_0x66a2('0x50')]['id']}})[_0x66a2('0x2b')](handleEntityNotFound(_0x4af9dd,null))['then'](function(_0x11beb8){if(_0x11beb8){_0x26ae31=_0x11beb8;_0x481d69[_0x66a2('0x35')]=_[_0x66a2('0x37')](db[_0x66a2('0x5e')]['rawAttributes']);_0x481d69[_0x66a2('0x36')]=_[_0x66a2('0x37')](_0x3934d4[_0x66a2('0x36')]);_0x481d69[_0x66a2('0x38')]=_[_0x66a2('0x39')](_0x481d69[_0x66a2('0x35')],_0x481d69[_0x66a2('0x36')]);_0x4c03bb[_0x66a2('0x3b')]=_[_0x66a2('0x39')](_0x481d69[_0x66a2('0x35')],qs['fields'](_0x3934d4[_0x66a2('0x36')][_0x66a2('0x3a')]));_0x4c03bb[_0x66a2('0x3b')]=_0x4c03bb[_0x66a2('0x3b')][_0x66a2('0x4a')]?_0x4c03bb[_0x66a2('0x3b')]:_0x481d69[_0x66a2('0x35')];_0x4c03bb[_0x66a2('0x3e')]=qs[_0x66a2('0x58')](_0x3934d4[_0x66a2('0x36')][_0x66a2('0x58')]);_0x4c03bb[_0x66a2('0x3f')]=qs['filters'](_[_0x66a2('0x40')](_0x3934d4[_0x66a2('0x36')],_0x481d69[_0x66a2('0x38')]));if(_0x3934d4['query'][_0x66a2('0x41')]){_0x4c03bb[_0x66a2('0x3f')]=_[_0x66a2('0x42')](_0x4c03bb['where'],{'$or':_[_0x66a2('0x30')](_0x4c03bb['attributes'],function(_0x43e7b9){var _0x2815b5={};_0x2815b5[_0x43e7b9]={'$like':'%'+_0x3934d4['query']['filter']+'%'};return _0x2815b5;})});}if(_0x3934d4[_0x66a2('0x36')]['$gte']){var _0x559ad0=_0x3934d4['query'][_0x66a2('0x5f')][_0x66a2('0x60')](',');var _0x324bbc={};_0x324bbc[_0x559ad0[0x0]]={'$gte':moment(_0x559ad0[0x1])[_0x66a2('0x61')](_0x66a2('0x62'))};_0x4c03bb['where']=_[_0x66a2('0x42')](_0x4c03bb[_0x66a2('0x3f')],_0x324bbc);}_0x4c03bb=_[_0x66a2('0x42')]({},_0x4c03bb,_0x3934d4['options']);return _0x26ae31[_0x66a2('0x5d')](_0x4c03bb);}})[_0x66a2('0x2b')](function(_0x3cf932){if(_0x3cf932){_0x5303d8=_0x3cf932['length'];if(!_0x3934d4[_0x66a2('0x36')][_0x66a2('0x3c')]('nolimit')){_0x4c03bb[_0x66a2('0x24')]=qs[_0x66a2('0x24')](_0x3934d4[_0x66a2('0x36')][_0x66a2('0x24')]);_0x4c03bb['offset']=qs[_0x66a2('0x22')](_0x3934d4[_0x66a2('0x36')]['offset']);}return _0x26ae31['getMessages'](_0x4c03bb);}})['then'](function(_0x438506){if(_0x438506){return _0x438506?{'count':_0x5303d8,'rows':_0x438506}:null;}})['then'](respondWithResult(_0x4af9dd,null))[_0x66a2('0x48')](handleError(_0x4af9dd,null));}; \ No newline at end of file +var _0x8ac5=['json','offset','undefined','limit','count','set','reject','save','then','destroy','end','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','ChatInternalMessage','addMembers','ids','User','getMembers','nolimit','removeMembers','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status'];(function(_0x492287,_0x38d7e3){var _0x2b07c2=function(_0xa435f0){while(--_0xa435f0){_0x492287['push'](_0x492287['shift']());}};_0x2b07c2(++_0x38d7e3);}(_0x8ac5,0x163));var _0x58ac=function(_0x3c2212,_0x46c371){_0x3c2212=_0x3c2212-0x0;var _0x4d7bbf=_0x8ac5[_0x3c2212];return _0x4d7bbf;};'use strict';var emlformat=require(_0x58ac('0x0'));var rimraf=require(_0x58ac('0x1'));var zipdir=require(_0x58ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58ac('0x3'));var moment=require(_0x58ac('0x4'));var BPromise=require(_0x58ac('0x5'));var Mustache=require(_0x58ac('0x6'));var util=require('util');var path=require(_0x58ac('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x58ac('0x8'));var fs=require('fs');var fs_extra=require(_0x58ac('0x9'));var _=require(_0x58ac('0xa'));var squel=require(_0x58ac('0xb'));var crypto=require(_0x58ac('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x58ac('0xd'));var toCsv=require(_0x58ac('0xe'));var querystring=require(_0x58ac('0xf'));var Papa=require(_0x58ac('0x10'));var Redis=require(_0x58ac('0x11'));var authService=require(_0x58ac('0x12'));var qs=require(_0x58ac('0x13'));var as=require(_0x58ac('0x14'));var hardwareService=require(_0x58ac('0x15'));var logger=require(_0x58ac('0x16'))(_0x58ac('0x17'));var utils=require('../../config/utils');var config=require(_0x58ac('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x58ac('0x19'))['db'];config[_0x58ac('0x1a')]=_['defaults'](config['redis'],{'host':_0x58ac('0x1b'),'port':0x18eb});var socket=require(_0x58ac('0x1c'))(new Redis(config[_0x58ac('0x1a')]));require(_0x58ac('0x1d'))[_0x58ac('0x1e')](socket);function respondWithStatusCode(_0x1ede80,_0xf59e03){_0xf59e03=_0xf59e03||0xcc;return function(_0x932f38){if(_0x932f38){return _0x1ede80[_0x58ac('0x1f')](_0xf59e03);}return _0x1ede80['status'](_0xf59e03)['end']();};}function respondWithResult(_0x1cab2c,_0x5d4ec4){_0x5d4ec4=_0x5d4ec4||0xc8;return function(_0x38216b){if(_0x38216b){return _0x1cab2c[_0x58ac('0x20')](_0x5d4ec4)[_0x58ac('0x21')](_0x38216b);}};}function respondWithFilteredResult(_0x44f5ac,_0x2a7f93){return function(_0x34b3a8){if(_0x34b3a8){var _0x5d0a51=typeof _0x2a7f93[_0x58ac('0x22')]===_0x58ac('0x23')&&typeof _0x2a7f93[_0x58ac('0x24')]==='undefined';var _0x36482c=_0x34b3a8[_0x58ac('0x25')];var _0x2fcad5=_0x5d0a51?0x0:_0x2a7f93[_0x58ac('0x22')];var _0xaa96fe=_0x5d0a51?_0x34b3a8[_0x58ac('0x25')]:_0x2a7f93[_0x58ac('0x22')]+_0x2a7f93[_0x58ac('0x24')];var _0x9a6093;if(_0xaa96fe>=_0x36482c){_0xaa96fe=_0x36482c;_0x9a6093=0xc8;}else{_0x9a6093=0xce;}_0x44f5ac[_0x58ac('0x20')](_0x9a6093);return _0x44f5ac[_0x58ac('0x26')]('Content-Range',_0x2fcad5+'-'+_0xaa96fe+'/'+_0x36482c)['json'](_0x34b3a8);}return null;};}function patchUpdates(_0x3b34e3){return function(_0x2c0b40){try{jsonpatch['apply'](_0x2c0b40,_0x3b34e3,!![]);}catch(_0x37ebbe){return BPromise[_0x58ac('0x27')](_0x37ebbe);}return _0x2c0b40[_0x58ac('0x28')]();};}function saveUpdates(_0x342cae,_0x420ce8){return function(_0xd803b6){if(_0xd803b6){return _0xd803b6['update'](_0x342cae)[_0x58ac('0x29')](function(_0x306daa){return _0x306daa;});}return null;};}function removeEntity(_0x891e8b,_0x45fd88){return function(_0x31c9b5){if(_0x31c9b5){return _0x31c9b5[_0x58ac('0x2a')]()[_0x58ac('0x29')](function(){_0x891e8b[_0x58ac('0x20')](0xcc)[_0x58ac('0x2b')]();});}};}function handleEntityNotFound(_0x48abce,_0x330688){return function(_0x1c8521){if(!_0x1c8521){_0x48abce['sendStatus'](0x194);}return _0x1c8521;};}function handleError(_0x12c758,_0x2347ae){_0x2347ae=_0x2347ae||0x1f4;return function(_0x1617ae){logger[_0x58ac('0x2c')](_0x1617ae[_0x58ac('0x2d')]);if(_0x1617ae[_0x58ac('0x2e')]){delete _0x1617ae['name'];}_0x12c758[_0x58ac('0x20')](_0x2347ae)[_0x58ac('0x2f')](_0x1617ae);};}exports[_0x58ac('0x30')]=function(_0x191bcc,_0x274d1c){var _0x46d14b={},_0x28d120={},_0x3797f2={'count':0x0,'rows':[]};var _0x2b32c6=_['map'](db[_0x58ac('0x31')][_0x58ac('0x32')],function(_0x191c32){return{'name':_0x191c32[_0x58ac('0x33')],'type':_0x191c32['type'][_0x58ac('0x34')]};});_0x28d120[_0x58ac('0x35')]=_[_0x58ac('0x36')](_0x2b32c6,_0x58ac('0x2e'));_0x28d120[_0x58ac('0x37')]=_[_0x58ac('0x38')](_0x191bcc['query']);_0x28d120['filters']=_[_0x58ac('0x39')](_0x28d120[_0x58ac('0x35')],_0x28d120['query']);_0x46d14b[_0x58ac('0x3a')]=_[_0x58ac('0x39')](_0x28d120[_0x58ac('0x35')],qs[_0x58ac('0x3b')](_0x191bcc[_0x58ac('0x37')][_0x58ac('0x3b')]));_0x46d14b[_0x58ac('0x3a')]=_0x46d14b[_0x58ac('0x3a')][_0x58ac('0x3c')]?_0x46d14b[_0x58ac('0x3a')]:_0x28d120[_0x58ac('0x35')];if(!_0x191bcc[_0x58ac('0x37')][_0x58ac('0x3d')]('nolimit')){_0x46d14b[_0x58ac('0x24')]=qs[_0x58ac('0x24')](_0x191bcc['query'][_0x58ac('0x24')]);_0x46d14b[_0x58ac('0x22')]=qs[_0x58ac('0x22')](_0x191bcc[_0x58ac('0x37')][_0x58ac('0x22')]);}_0x46d14b[_0x58ac('0x3e')]=qs[_0x58ac('0x3f')](_0x191bcc[_0x58ac('0x37')][_0x58ac('0x3f')]);_0x46d14b['where']=qs['filters'](_[_0x58ac('0x40')](_0x191bcc[_0x58ac('0x37')],_0x28d120[_0x58ac('0x41')]),_0x2b32c6);if(_0x191bcc[_0x58ac('0x37')][_0x58ac('0x42')]){_0x46d14b['where']=_[_0x58ac('0x43')](_0x46d14b['where'],{'$or':_[_0x58ac('0x36')](_0x2b32c6,function(_0x50857b){if(_0x50857b[_0x58ac('0x44')]!==_0x58ac('0x45')){var _0x1d78a5={};_0x1d78a5[_0x50857b['name']]={'$like':'%'+_0x191bcc[_0x58ac('0x37')][_0x58ac('0x42')]+'%'};return _0x1d78a5;}})});}_0x46d14b=_[_0x58ac('0x43')]({},_0x46d14b,_0x191bcc[_0x58ac('0x46')]);var _0x5ef14d={'where':_0x46d14b[_0x58ac('0x47')]};return db[_0x58ac('0x31')]['count'](_0x5ef14d)[_0x58ac('0x29')](function(_0x24229f){_0x3797f2[_0x58ac('0x25')]=_0x24229f;if(_0x191bcc[_0x58ac('0x37')][_0x58ac('0x48')]){_0x46d14b[_0x58ac('0x49')]=[{'all':!![]}];}return db['ChatGroup'][_0x58ac('0x4a')](_0x46d14b);})[_0x58ac('0x29')](function(_0x18d1ee){_0x3797f2[_0x58ac('0x4b')]=_0x18d1ee;return _0x3797f2;})[_0x58ac('0x29')](respondWithFilteredResult(_0x274d1c,_0x46d14b))[_0x58ac('0x4c')](handleError(_0x274d1c,null));};exports[_0x58ac('0x4d')]=function(_0x395671,_0x1a88a6){var _0x3cdeec={'raw':!![],'where':{'id':_0x395671[_0x58ac('0x4e')]['id']}},_0x1ade63={};_0x1ade63[_0x58ac('0x35')]=_['keys'](db[_0x58ac('0x31')]['rawAttributes']);_0x1ade63['query']=_['keys'](_0x395671['query']);_0x1ade63[_0x58ac('0x41')]=_[_0x58ac('0x39')](_0x1ade63[_0x58ac('0x35')],_0x1ade63[_0x58ac('0x37')]);_0x3cdeec[_0x58ac('0x3a')]=_['intersection'](_0x1ade63[_0x58ac('0x35')],qs[_0x58ac('0x3b')](_0x395671[_0x58ac('0x37')]['fields']));_0x3cdeec[_0x58ac('0x3a')]=_0x3cdeec['attributes'][_0x58ac('0x3c')]?_0x3cdeec[_0x58ac('0x3a')]:_0x1ade63[_0x58ac('0x35')];if(_0x395671['query'][_0x58ac('0x48')]){_0x3cdeec['include']=[{'all':!![]}];}_0x3cdeec=_[_0x58ac('0x43')]({},_0x3cdeec,_0x395671[_0x58ac('0x46')]);return db[_0x58ac('0x31')][_0x58ac('0x4f')](_0x3cdeec)[_0x58ac('0x29')](handleEntityNotFound(_0x1a88a6,null))[_0x58ac('0x29')](respondWithResult(_0x1a88a6,null))[_0x58ac('0x4c')](handleError(_0x1a88a6,null));};exports[_0x58ac('0x50')]=function(_0x3b223b,_0x4863cf){return db['ChatGroup'][_0x58ac('0x50')](_0x3b223b[_0x58ac('0x51')],{})['then'](respondWithResult(_0x4863cf,0xc9))[_0x58ac('0x4c')](handleError(_0x4863cf,null));};exports[_0x58ac('0x52')]=function(_0x2f3f2f,_0x254964){if(_0x2f3f2f['body']['id']){delete _0x2f3f2f[_0x58ac('0x51')]['id'];}return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x2f3f2f['params']['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x254964,null))[_0x58ac('0x29')](saveUpdates(_0x2f3f2f[_0x58ac('0x51')],null))[_0x58ac('0x29')](respondWithResult(_0x254964,null))['catch'](handleError(_0x254964,null));};exports[_0x58ac('0x2a')]=function(_0xdbb969,_0xe6eb06){return db['ChatGroup'][_0x58ac('0x4f')]({'where':{'id':_0xdbb969[_0x58ac('0x4e')]['id']}})['then'](handleEntityNotFound(_0xe6eb06,null))['then'](removeEntity(_0xe6eb06,null))[_0x58ac('0x4c')](handleError(_0xe6eb06,null));};exports[_0x58ac('0x53')]=function(_0xed2f47,_0x2b791b){return db[_0x58ac('0x31')][_0x58ac('0x53')]()[_0x58ac('0x29')](respondWithResult(_0x2b791b,null))[_0x58ac('0x4c')](handleError(_0x2b791b,null));};exports['getUnread']=function(_0x27c08d,_0x2faf1f,_0x19da17){return db[_0x58ac('0x54')][_0x58ac('0x25')]({'where':{'ChatGroupId':_0x27c08d[_0x58ac('0x4e')]['id'],'ToId':_0x27c08d['user']['id'],'read':![]}})[_0x58ac('0x29')](function(_0x5aa160){return{'id':_['toInteger'](_0x27c08d['params']['id']),'count':_0x5aa160};})[_0x58ac('0x29')](respondWithResult(_0x2faf1f,null))[_0x58ac('0x4c')](handleError(_0x2faf1f,null));};exports[_0x58ac('0x55')]=function(_0x160bc2,_0x6f283,_0x28d2f3){return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x160bc2[_0x58ac('0x4e')]['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x6f283,null))[_0x58ac('0x29')](function(_0x544904){if(_0x544904){return _0x544904[_0x58ac('0x55')](_0x160bc2[_0x58ac('0x51')][_0x58ac('0x56')],_['omit'](_0x160bc2[_0x58ac('0x51')],['ids','id'])||{});}})[_0x58ac('0x29')](respondWithResult(_0x6f283,null))[_0x58ac('0x4c')](handleError(_0x6f283,null));};exports['getMembers']=function(_0x265de8,_0x3fb85a,_0xc0c292){var _0x956cd={};var _0x945532={};var _0x359b69;var _0x28d7af;return db[_0x58ac('0x31')]['findOne']({'where':{'id':_0x265de8['params']['id']}})['then'](handleEntityNotFound(_0x3fb85a,null))[_0x58ac('0x29')](function(_0x496ba1){if(_0x496ba1){_0x359b69=_0x496ba1;_0x945532[_0x58ac('0x35')]=_[_0x58ac('0x38')](db[_0x58ac('0x57')][_0x58ac('0x32')]);_0x945532[_0x58ac('0x37')]=_[_0x58ac('0x38')](_0x265de8[_0x58ac('0x37')]);_0x945532['filters']=_[_0x58ac('0x39')](_0x945532[_0x58ac('0x35')],_0x945532[_0x58ac('0x37')]);_0x956cd[_0x58ac('0x3a')]=_['intersection'](_0x945532['model'],qs[_0x58ac('0x3b')](_0x265de8[_0x58ac('0x37')]['fields']));_0x956cd[_0x58ac('0x3a')]=_0x956cd[_0x58ac('0x3a')][_0x58ac('0x3c')]?_0x956cd[_0x58ac('0x3a')]:_0x945532['model'];_0x956cd[_0x58ac('0x3e')]=qs[_0x58ac('0x3f')](_0x265de8['query'][_0x58ac('0x3f')]);_0x956cd[_0x58ac('0x47')]=qs[_0x58ac('0x41')](_[_0x58ac('0x40')](_0x265de8[_0x58ac('0x37')],_0x945532[_0x58ac('0x41')]));if(_0x265de8[_0x58ac('0x37')]['filter']){_0x956cd[_0x58ac('0x47')]=_[_0x58ac('0x43')](_0x956cd[_0x58ac('0x47')],{'$or':_[_0x58ac('0x36')](_0x956cd[_0x58ac('0x3a')],function(_0x348022){var _0x575e5d={};_0x575e5d[_0x348022]={'$like':'%'+_0x265de8[_0x58ac('0x37')][_0x58ac('0x42')]+'%'};return _0x575e5d;})});}_0x956cd=_[_0x58ac('0x43')]({},_0x956cd,_0x265de8[_0x58ac('0x46')]);return _0x359b69[_0x58ac('0x58')](_0x956cd);}})[_0x58ac('0x29')](function(_0x1b8018){if(_0x1b8018){_0x28d7af=_0x1b8018[_0x58ac('0x3c')];if(!_0x265de8['query'][_0x58ac('0x3d')](_0x58ac('0x59'))){_0x956cd[_0x58ac('0x24')]=qs[_0x58ac('0x24')](_0x265de8[_0x58ac('0x37')][_0x58ac('0x24')]);_0x956cd['offset']=qs[_0x58ac('0x22')](_0x265de8[_0x58ac('0x37')][_0x58ac('0x22')]);}return _0x359b69[_0x58ac('0x58')](_0x956cd);}})['then'](function(_0x3f18cd){if(_0x3f18cd){return _0x3f18cd?{'count':_0x28d7af,'rows':_0x3f18cd}:null;}})['then'](respondWithResult(_0x3fb85a,null))[_0x58ac('0x4c')](handleError(_0x3fb85a,null));};exports['removeMembers']=function(_0x59d3d2,_0x42431f,_0x5dc06e){return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x59d3d2['params']['id']}})['then'](handleEntityNotFound(_0x42431f,null))[_0x58ac('0x29')](function(_0x1e459d){if(_0x1e459d){return _0x1e459d[_0x58ac('0x5a')](_0x59d3d2['query']['ids']);}})[_0x58ac('0x29')](respondWithStatusCode(_0x42431f,null))['catch'](handleError(_0x42431f,null));};exports['addMessage']=function(_0x7babb9,_0x5ad54b,_0x39d17b){if(_0x7babb9[_0x58ac('0x51')]['id']){delete _0x7babb9[_0x58ac('0x51')]['id'];}return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x7babb9['params']['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x5ad54b,null))[_0x58ac('0x29')](function(_0x3c7fed){if(_0x3c7fed){_0x7babb9[_0x58ac('0x51')][_0x58ac('0x5b')]=_0x3c7fed['id'];return db[_0x58ac('0x54')][_0x58ac('0x50')](_0x7babb9['body']);}})[_0x58ac('0x29')](respondWithResult(_0x5ad54b,null))[_0x58ac('0x4c')](handleError(_0x5ad54b,null));};exports[_0x58ac('0x5c')]=function(_0x20c9b5,_0x35f0da,_0x216797){var _0x295402={};var _0x5de71e={};var _0x48f1b8;var _0x2191b7;return db['ChatGroup'][_0x58ac('0x5d')]({'where':{'id':_0x20c9b5[_0x58ac('0x4e')]['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x35f0da,null))[_0x58ac('0x29')](function(_0x1391e7){if(_0x1391e7){_0x48f1b8=_0x1391e7;_0x5de71e[_0x58ac('0x35')]=_[_0x58ac('0x38')](db[_0x58ac('0x54')][_0x58ac('0x32')]);_0x5de71e[_0x58ac('0x37')]=_[_0x58ac('0x38')](_0x20c9b5[_0x58ac('0x37')]);_0x5de71e[_0x58ac('0x41')]=_[_0x58ac('0x39')](_0x5de71e[_0x58ac('0x35')],_0x5de71e[_0x58ac('0x37')]);_0x295402[_0x58ac('0x3a')]=_['intersection'](_0x5de71e[_0x58ac('0x35')],qs[_0x58ac('0x3b')](_0x20c9b5[_0x58ac('0x37')]['fields']));_0x295402[_0x58ac('0x3a')]=_0x295402[_0x58ac('0x3a')][_0x58ac('0x3c')]?_0x295402['attributes']:_0x5de71e[_0x58ac('0x35')];_0x295402[_0x58ac('0x3e')]=qs[_0x58ac('0x3f')](_0x20c9b5[_0x58ac('0x37')]['sort']);_0x295402['where']=qs[_0x58ac('0x41')](_[_0x58ac('0x40')](_0x20c9b5['query'],_0x5de71e[_0x58ac('0x41')]));if(_0x20c9b5['query'][_0x58ac('0x42')]){_0x295402[_0x58ac('0x47')]=_[_0x58ac('0x43')](_0x295402['where'],{'$or':_[_0x58ac('0x36')](_0x295402[_0x58ac('0x3a')],function(_0x247f86){var _0x423041={};_0x423041[_0x247f86]={'$like':'%'+_0x20c9b5[_0x58ac('0x37')]['filter']+'%'};return _0x423041;})});}if(_0x20c9b5[_0x58ac('0x37')][_0x58ac('0x5e')]){var _0x4a978e=_0x20c9b5['query']['$gte']['split'](',');var _0x1e0ea9={};_0x1e0ea9[_0x4a978e[0x0]]={'$gte':moment(_0x4a978e[0x1])[_0x58ac('0x5f')](_0x58ac('0x60'))};_0x295402[_0x58ac('0x47')]=_[_0x58ac('0x43')](_0x295402[_0x58ac('0x47')],_0x1e0ea9);}_0x295402=_[_0x58ac('0x43')]({},_0x295402,_0x20c9b5[_0x58ac('0x46')]);return _0x48f1b8[_0x58ac('0x5c')](_0x295402);}})[_0x58ac('0x29')](function(_0x21c435){if(_0x21c435){_0x2191b7=_0x21c435[_0x58ac('0x3c')];if(!_0x20c9b5[_0x58ac('0x37')][_0x58ac('0x3d')](_0x58ac('0x59'))){_0x295402['limit']=qs[_0x58ac('0x24')](_0x20c9b5['query'][_0x58ac('0x24')]);_0x295402[_0x58ac('0x22')]=qs[_0x58ac('0x22')](_0x20c9b5[_0x58ac('0x37')][_0x58ac('0x22')]);}return _0x48f1b8[_0x58ac('0x5c')](_0x295402);}})[_0x58ac('0x29')](function(_0x49a4ee){if(_0x49a4ee){return _0x49a4ee?{'count':_0x2191b7,'rows':_0x49a4ee}:null;}})[_0x58ac('0x29')](respondWithResult(_0x35f0da,null))[_0x58ac('0x4c')](handleError(_0x35f0da,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index d1acb58..06761b2 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 _0x47a1=['events','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x586b44,_0x1832fe){var _0x51e0c9=function(_0x103d08){while(--_0x103d08){_0x586b44['push'](_0x586b44['shift']());}};_0x51e0c9(++_0x1832fe);}(_0x47a1,0xbd));var _0x147a=function(_0x38378c,_0x4e4fbf){_0x38378c=_0x38378c-0x0;var _0xd7ecc6=_0x47a1[_0x38378c];return _0xd7ecc6;};'use strict';var EventEmitter=require(_0x147a('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x147a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x147a('0x2'),'afterDestroy':_0x147a('0x3')};function emitEvent(_0x5e69bc){return function(_0xd80e93,_0x66a8e2,_0xc2071d){ChatGroupEvents[_0x147a('0x4')](_0x5e69bc+':'+_0xd80e93['id'],_0xd80e93);ChatGroupEvents[_0x147a('0x4')](_0x5e69bc,_0xd80e93);_0xc2071d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x147a('0x5')](e,emitEvent(event));}}module[_0x147a('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0xe75e=['setMaxListeners','emit','exports','events','../../mysqldb','ChatGroup'];(function(_0x5dd93c,_0x570ecc){var _0x4c3142=function(_0x34c6db){while(--_0x34c6db){_0x5dd93c['push'](_0x5dd93c['shift']());}};_0x4c3142(++_0x570ecc);}(_0xe75e,0x15f));var _0xee75=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xe75e[_0x2d126e];return _0xcb04d3;};'use strict';var EventEmitter=require(_0xee75('0x0'));var ChatGroup=require(_0xee75('0x1'))['db'][_0xee75('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xee75('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x22ca13){return function(_0x2abe19,_0x4a1a15,_0x373b8c){ChatGroupEvents[_0xee75('0x4')](_0x22ca13+':'+_0x2abe19['id'],_0x2abe19);ChatGroupEvents[_0xee75('0x4')](_0x22ca13,_0x2abe19);_0x373b8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xee75('0x5')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 69c4a77..b5d27c1 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 _0x27a0=['define','ChatGroup','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports'];(function(_0x522006,_0x12f9e1){var _0xfd57db=function(_0x3b8ef2){while(--_0x3b8ef2){_0x522006['push'](_0x522006['shift']());}};_0xfd57db(++_0x12f9e1);}(_0x27a0,0x86));var _0x027a=function(_0x5384b4,_0x22feaa){_0x5384b4=_0x5384b4-0x0;var _0x3ce12b=_0x27a0[_0x5384b4];return _0x3ce12b;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('0x4'));var rp=require(_0x027a('0x5'));var fs=require('fs');var path=require(_0x027a('0x6'));var rimraf=require('rimraf');var config=require(_0x027a('0x7'));var attributes=require(_0x027a('0x8'));module[_0x027a('0x9')]=function(_0x533759,_0x1985d1){return _0x533759[_0x027a('0xa')](_0x027a('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x490a=['../../config/environment','./chatGroup.attributes','exports','define','chat_groups','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x490a,0x1a7));var _0xa490=function(_0x5f5375,_0x117568){_0x5f5375=_0x5f5375-0x0;var _0x28e607=_0x490a[_0x5f5375];return _0x28e607;};'use strict';var _=require('lodash');var util=require(_0xa490('0x0'));var logger=require(_0xa490('0x1'))(_0xa490('0x2'));var moment=require(_0xa490('0x3'));var BPromise=require('bluebird');var rp=require(_0xa490('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa490('0x5'));var config=require(_0xa490('0x6'));var attributes=require(_0xa490('0x7'));module[_0xa490('0x8')]=function(_0x56667c,_0x5ebff7){return _0x56667c[_0xa490('0x9')]('ChatGroup',attributes,{'tableName':_0xa490('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 7340f9f..660ff1a 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 _0xf883=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then'];(function(_0x4d2494,_0x3b24a3){var _0x14ec7d=function(_0x410db4){while(--_0x410db4){_0x4d2494['push'](_0x4d2494['shift']());}};_0x14ec7d(++_0x3b24a3);}(_0xf883,0x177));var _0x3f88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf883[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3f88('0x0'));var util=require(_0x3f88('0x1'));var moment=require('moment');var BPromise=require(_0x3f88('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f88('0x3'));var db=require(_0x3f88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f88('0x5'))(_0x3f88('0x6'));var config=require(_0x3f88('0x7'));var jayson=require(_0x3f88('0x8'));var client=jayson[_0x3f88('0x9')][_0x3f88('0xa')]({'port':0x232a});config[_0x3f88('0xb')]=_['defaults'](config['redis'],{'host':_0x3f88('0xc'),'port':0x18eb});var socket=require(_0x3f88('0xd'))(new Redis(config[_0x3f88('0xb')]));require(_0x3f88('0xe'))['register'](socket);function respondWithRpcPromise(_0x32a355,_0x3c493c,_0x2dc5fd){return new BPromise(function(_0x49c818,_0x1bb7f2){return client[_0x3f88('0xf')](_0x32a355,_0x2dc5fd)[_0x3f88('0x10')](function(_0x2c4102){logger[_0x3f88('0x11')](_0x3f88('0x12'),_0x3c493c,_0x3f88('0x13'));logger[_0x3f88('0x14')](_0x3f88('0x15'),_0x3c493c,_0x3f88('0x13'),JSON[_0x3f88('0x16')](_0x2c4102));if(_0x2c4102[_0x3f88('0x17')]){if(_0x2c4102[_0x3f88('0x17')][_0x3f88('0x18')]===0x1f4){logger[_0x3f88('0x17')](_0x3f88('0x12'),_0x3c493c,_0x2c4102[_0x3f88('0x17')][_0x3f88('0x19')]);return _0x1bb7f2(_0x2c4102[_0x3f88('0x17')][_0x3f88('0x19')]);}logger['error'](_0x3f88('0x12'),_0x3c493c,_0x2c4102[_0x3f88('0x17')][_0x3f88('0x19')]);return _0x49c818(_0x2c4102[_0x3f88('0x17')]['message']);}else{logger['info'](_0x3f88('0x12'),_0x3c493c,_0x3f88('0x13'));_0x49c818(_0x2c4102[_0x3f88('0x1a')][_0x3f88('0x19')]);}})[_0x3f88('0x1b')](function(_0x1f6321){logger[_0x3f88('0x17')](_0x3f88('0x12'),_0x3c493c,_0x1f6321);_0x1bb7f2(_0x1f6321);});});} \ No newline at end of file +var _0xea09=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message','catch','moment'];(function(_0x33c280,_0x222473){var _0x59eb5d=function(_0x965d86){while(--_0x965d86){_0x33c280['push'](_0x33c280['shift']());}};_0x59eb5d(++_0x222473);}(_0xea09,0xd0));var _0x9ea0=function(_0x51981d,_0x656ba){_0x51981d=_0x51981d-0x0;var _0x33e3f8=_0xea09[_0x51981d];return _0x33e3f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9ea0('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ea0('0x1'))['db'];var utils=require(_0x9ea0('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x9ea0('0x3'));var jayson=require(_0x9ea0('0x4'));var client=jayson['client'][_0x9ea0('0x5')]({'port':0x232a});config[_0x9ea0('0x6')]=_[_0x9ea0('0x7')](config[_0x9ea0('0x6')],{'host':_0x9ea0('0x8'),'port':0x18eb});var socket=require(_0x9ea0('0x9'))(new Redis(config[_0x9ea0('0x6')]));require(_0x9ea0('0xa'))['register'](socket);function respondWithRpcPromise(_0x2e1a8a,_0x11e870,_0x30d408){return new BPromise(function(_0x1f9ea5,_0x2bfebe){return client['request'](_0x2e1a8a,_0x30d408)[_0x9ea0('0xb')](function(_0x296562){logger[_0x9ea0('0xc')]('ChatGroup,\x20%s,\x20%s',_0x11e870,_0x9ea0('0xd'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x11e870,_0x9ea0('0xd'),JSON['stringify'](_0x296562));if(_0x296562[_0x9ea0('0xe')]){if(_0x296562[_0x9ea0('0xe')][_0x9ea0('0xf')]===0x1f4){logger[_0x9ea0('0xe')](_0x9ea0('0x10'),_0x11e870,_0x296562[_0x9ea0('0xe')][_0x9ea0('0x11')]);return _0x2bfebe(_0x296562['error'][_0x9ea0('0x11')]);}logger[_0x9ea0('0xe')](_0x9ea0('0x10'),_0x11e870,_0x296562[_0x9ea0('0xe')][_0x9ea0('0x11')]);return _0x1f9ea5(_0x296562[_0x9ea0('0xe')][_0x9ea0('0x11')]);}else{logger['info'](_0x9ea0('0x10'),_0x11e870,'request\x20sent');_0x1f9ea5(_0x296562['result'][_0x9ea0('0x11')]);}})[_0x9ea0('0x12')](function(_0x3e463e){logger[_0x9ea0('0xe')](_0x9ea0('0x10'),_0x11e870,_0x3e463e);_0x2bfebe(_0x3e463e);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 2bf7d74..41f3b50 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 _0x2a5b=['chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x264db6,_0x577ea5){var _0x4760bc=function(_0x4d0bab){while(--_0x4d0bab){_0x264db6['push'](_0x264db6['shift']());}};_0x4760bc(++_0x577ea5);}(_0x2a5b,0x79));var _0xb2a5=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x2a5b[_0x2aecb2];return _0x3ebb80;};'use strict';var ChatGroupEvents=require(_0xb2a5('0x0'));var events=['save',_0xb2a5('0x1'),_0xb2a5('0x2')];function createListener(_0x4172f9,_0x5643d4){return function(_0x3901af){_0x5643d4[_0xb2a5('0x3')](_0x4172f9,_0x3901af);};}function removeListener(_0x2b1a02,_0x187559){return function(){ChatGroupEvents['removeListener'](_0x2b1a02,_0x187559);};}exports['register']=function(_0x37c9ed){for(var _0x4371fe=0x0,_0x19a8a=events['length'];_0x4371fe<_0x19a8a;_0x4371fe++){var _0x4afd8b=events[_0x4371fe];var _0x4ae87a=createListener(_0xb2a5('0x4')+_0x4afd8b,_0x37c9ed);ChatGroupEvents['on'](_0x4afd8b,_0x4ae87a);}}; \ No newline at end of file +var _0xf93b=['save','remove','update','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x2db81e,_0x466aea){var _0x1ee08d=function(_0x43a9a1){while(--_0x43a9a1){_0x2db81e['push'](_0x2db81e['shift']());}};_0x1ee08d(++_0x466aea);}(_0xf93b,0x13f));var _0xbf93=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0xf93b[_0x4605dc];return _0x5d3e81;};'use strict';var ChatGroupEvents=require(_0xbf93('0x0'));var events=[_0xbf93('0x1'),_0xbf93('0x2'),_0xbf93('0x3')];function createListener(_0x1e736b,_0x36c728){return function(_0x1ce73a){_0x36c728['emit'](_0x1e736b,_0x1ce73a);};}function removeListener(_0x4eaa8c,_0x2f07d6){return function(){ChatGroupEvents[_0xbf93('0x4')](_0x4eaa8c,_0x2f07d6);};}exports[_0xbf93('0x5')]=function(_0x414d4f){for(var _0x21e825=0x0,_0x542372=events[_0xbf93('0x6')];_0x21e825<_0x542372;_0x21e825++){var _0x235c4f=events[_0x21e825];var _0x194099=createListener(_0xbf93('0x7')+_0x235c4f,_0x414d4f);ChatGroupEvents['on'](_0x235c4f,_0x194099);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 3673680..c72785b 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 _0x3dbb=['addMembers','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x3dbb,0x10b));var _0xb3db=function(_0x5c38a2,_0x40e4e4){_0x5c38a2=_0x5c38a2-0x0;var _0x22869c=_0x3dbb[_0x5c38a2];return _0x22869c;};'use strict';var multer=require('multer');var util=require(_0xb3db('0x0'));var path=require(_0xb3db('0x1'));var timeout=require(_0xb3db('0x2'));var express=require(_0xb3db('0x3'));var router=express[_0xb3db('0x4')]();var fs_extra=require(_0xb3db('0x5'));var auth=require(_0xb3db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb3db('0x7'));var controller=require('./chatGroup.controller');router[_0xb3db('0x8')]('/',auth[_0xb3db('0x9')](),controller[_0xb3db('0xa')]);router['get'](_0xb3db('0xb'),auth[_0xb3db('0x9')](),controller[_0xb3db('0xc')]);router[_0xb3db('0x8')](_0xb3db('0xd'),auth[_0xb3db('0x9')](),controller[_0xb3db('0xe')]);router[_0xb3db('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0xb3db('0xf')]);router['get'](_0xb3db('0x10'),auth[_0xb3db('0x9')](),controller[_0xb3db('0x11')]);router[_0xb3db('0x8')](_0xb3db('0x12'),auth[_0xb3db('0x9')](),controller[_0xb3db('0x13')]);router[_0xb3db('0x14')]('/',auth[_0xb3db('0x9')](),controller['create']);router['post'](_0xb3db('0x10'),auth[_0xb3db('0x9')](),controller[_0xb3db('0x15')]);router[_0xb3db('0x14')](_0xb3db('0x12'),auth['isAuthenticated'](),controller['addMessage']);router['put'](_0xb3db('0xd'),auth[_0xb3db('0x9')](),controller['update']);router[_0xb3db('0x16')](_0xb3db('0xd'),auth[_0xb3db('0x9')](),controller['destroy']);router[_0xb3db('0x16')](_0xb3db('0x10'),auth[_0xb3db('0x9')](),controller['removeMembers']);module[_0xb3db('0x17')]=router; \ No newline at end of file +var _0x30cc=['./chatGroup.controller','get','isAuthenticated','index','describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','/:id','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x403d18,_0x512651){var _0x483587=function(_0x325a71){while(--_0x325a71){_0x403d18['push'](_0x403d18['shift']());}};_0x483587(++_0x512651);}(_0x30cc,0x105));var _0xc30c=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x30cc[_0x1e05c1];return _0x15f1ca;};'use strict';var multer=require(_0xc30c('0x0'));var util=require(_0xc30c('0x1'));var path=require(_0xc30c('0x2'));var timeout=require(_0xc30c('0x3'));var express=require(_0xc30c('0x4'));var router=express[_0xc30c('0x5')]();var fs_extra=require(_0xc30c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc30c('0x7'));var config=require(_0xc30c('0x8'));var controller=require(_0xc30c('0x9'));router[_0xc30c('0xa')]('/',auth[_0xc30c('0xb')](),controller[_0xc30c('0xc')]);router[_0xc30c('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xc30c('0xd')]);router[_0xc30c('0xa')]('/:id',auth[_0xc30c('0xb')](),controller[_0xc30c('0xe')]);router[_0xc30c('0xa')]('/:id/unread',auth[_0xc30c('0xb')](),controller[_0xc30c('0xf')]);router[_0xc30c('0xa')](_0xc30c('0x10'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x11')]);router[_0xc30c('0xa')](_0xc30c('0x12'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x13')]);router[_0xc30c('0x14')]('/',auth[_0xc30c('0xb')](),controller[_0xc30c('0x15')]);router[_0xc30c('0x14')](_0xc30c('0x10'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x16')]);router[_0xc30c('0x14')](_0xc30c('0x12'),auth[_0xc30c('0xb')](),controller['addMessage']);router[_0xc30c('0x17')]('/:id',auth[_0xc30c('0xb')](),controller[_0xc30c('0x18')]);router[_0xc30c('0x19')](_0xc30c('0x1a'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x1b')]);router['delete']('/:id/members',auth[_0xc30c('0xb')](),controller[_0xc30c('0x1c')]);module[_0xc30c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 66a0c47..1e783a5 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 _0x00fa=['BOOLEAN','ENUM','star','TEXT','STRING','long','DATE','out','INTEGER','sequelize','exports'];(function(_0x14020d,_0x447281){var _0x487489=function(_0x155e22){while(--_0x155e22){_0x14020d['push'](_0x14020d['shift']());}};_0x487489(++_0x447281);}(_0x00fa,0x15e));var _0xa00f=function(_0x51cfc8,_0x109e72){_0x51cfc8=_0x51cfc8-0x0;var _0x8322f1=_0x00fa[_0x51cfc8];return _0x8322f1;};'use strict';var Sequelize=require(_0xa00f('0x0'));module[_0xa00f('0x1')]={'closed':{'type':Sequelize[_0xa00f('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa00f('0x3')](_0xa00f('0x4'),'thumb'),'defaultValue':_0xa00f('0x4')},'ratingMessage':{'type':Sequelize[_0xa00f('0x5')]},'pathTranscript':{'type':Sequelize[_0xa00f('0x5')]},'mailTranscript':{'type':Sequelize[_0xa00f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa00f('0x6')]},'secondDisposition':{'type':Sequelize[_0xa00f('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa00f('0x6')]},'browserName':{'type':Sequelize[_0xa00f('0x6')]},'browserVersion':{'type':Sequelize[_0xa00f('0x6')]},'osName':{'type':Sequelize[_0xa00f('0x6')]},'osVersion':{'type':Sequelize[_0xa00f('0x6')]},'deviceModel':{'type':Sequelize[_0xa00f('0x6')]},'deviceVendor':{'type':Sequelize[_0xa00f('0x6')]},'deviceType':{'type':Sequelize[_0xa00f('0x6')]},'referer':{'type':Sequelize[_0xa00f('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xa00f('0x7'))},'read1stAt':{'type':Sequelize[_0xa00f('0x8')]},'lastMsgAt':{'type':Sequelize[_0xa00f('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa00f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa00f('0x6')]},'customerPort':{'type':Sequelize[_0xa00f('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xa00f('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xa00f('0xa')]}}; \ No newline at end of file +var _0xf92a=['DATE','STRING','long','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0xf92a,0x1c7));var _0xaf92=function(_0x7fa8a1,_0x52c9be){_0x7fa8a1=_0x7fa8a1-0x0;var _0x41fa61=_0xf92a[_0x7fa8a1];return _0x41fa61;};'use strict';var Sequelize=require(_0xaf92('0x0'));module[_0xaf92('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaf92('0x2')]},'ratingType':{'type':Sequelize[_0xaf92('0x3')](_0xaf92('0x4'),_0xaf92('0x5')),'defaultValue':_0xaf92('0x4')},'ratingMessage':{'type':Sequelize[_0xaf92('0x6')]},'pathTranscript':{'type':Sequelize[_0xaf92('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xaf92('0x7')]},'disposition':{'type':Sequelize[_0xaf92('0x8')]},'secondDisposition':{'type':Sequelize[_0xaf92('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xaf92('0x8')]},'osName':{'type':Sequelize[_0xaf92('0x8')]},'osVersion':{'type':Sequelize[_0xaf92('0x8')]},'deviceModel':{'type':Sequelize[_0xaf92('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xaf92('0x8')]},'formData':{'type':Sequelize[_0xaf92('0x6')](_0xaf92('0x9'))},'read1stAt':{'type':Sequelize[_0xaf92('0x7')]},'lastMsgAt':{'type':Sequelize[_0xaf92('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xaf92('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xaf92('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xaf92('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xaf92('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 05339e0..90bb6b0 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 _0x507e=['length','includeAll','merge','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','POST','email','vidaooNote','follow','isNull','vidaooMetadata','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','update','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','type','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','Messages','User','ChatWebsiteId','ContactId','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','include','getMyMessages','pick','fullname','rows','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','tmp','transcript-%d-%s.zip','push','lastName','attachments','read','Account','Owner','get','mkdirSync','Chat','toString','closedAt','YYYY-MM-DD\x20HH:mm:ss','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','name','send','render','body','contact','agent','index','map','ChatInteraction','fieldName','key','getOptions','findAll','chat','query','user','catch','params','model','keys','rawAttributes','filters','intersection','fields','attributes'];(function(_0x5a80c8,_0x40d8cb){var _0x4860c0=function(_0x4d1126){while(--_0x4d1126){_0x5a80c8['push'](_0x5a80c8['shift']());}};_0x4860c0(++_0x40d8cb);}(_0x507e,0x92));var _0xe507=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x507e[_0x467488];return _0x56107f;};'use strict';var rimraf=require(_0xe507('0x0'));var zipdir=require(_0xe507('0x1'));var rp=require(_0xe507('0x2'));var moment=require(_0xe507('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe507('0x4'));var path=require(_0xe507('0x5'));var ejs=require(_0xe507('0x6'));var fs=require('fs');var _=require(_0xe507('0x7'));var Redis=require(_0xe507('0x8'));var interaction=require(_0xe507('0x9'));var qs=require(_0xe507('0xa'));var pdf=require(_0xe507('0xb'));var logger=require(_0xe507('0xc'))('api');var config=require(_0xe507('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe507('0xe')](config['redis'],{'host':_0xe507('0xf'),'port':0x18eb});var socket=require(_0xe507('0x10'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xe507('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe507('0x12')]['http']({'port':0x232b});var client9004=jayson[_0xe507('0x12')][_0xe507('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5f14ee,_0x44c852,_0x529337,_0xac7692){return new BPromise(function(_0x3c8c0e,_0x9c2624){var _0x9f9c2c=_0xac7692||client;return _0x9f9c2c[_0xe507('0x14')](_0x5f14ee,_0x529337)[_0xe507('0x15')](function(_0x50982c){logger[_0xe507('0x16')](_0xe507('0x17'),_0x44c852,_0xe507('0x18'));logger['debug'](_0xe507('0x19'),_0x44c852,_0xe507('0x18'),JSON[_0xe507('0x1a')](_0x50982c));if(_0x50982c['error']){if(_0x50982c['error'][_0xe507('0x1b')]===0x1f4){logger[_0xe507('0x1c')](_0xe507('0x17'),_0x44c852,_0x50982c[_0xe507('0x1c')][_0xe507('0x1d')]);return _0x9c2624(_0x50982c[_0xe507('0x1c')][_0xe507('0x1d')]);}logger[_0xe507('0x1c')](_0xe507('0x17'),_0x44c852,_0x50982c['error'][_0xe507('0x1d')]);return _0x3c8c0e(_0x50982c[_0xe507('0x1c')]['message']);}else{logger[_0xe507('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x44c852,'request\x20sent');_0x3c8c0e(_0x50982c[_0xe507('0x1e')]['message']);}})['catch'](function(_0x243399){logger[_0xe507('0x1c')](_0xe507('0x17'),_0x44c852,_0x243399);_0x9c2624(_0x243399);});});}function respondWithStatusCode(_0x535df4,_0x30d422){_0x30d422=_0x30d422||0xcc;return function(_0x34e5d1){if(_0x34e5d1){return _0x535df4[_0xe507('0x1f')](_0x30d422);}return _0x535df4[_0xe507('0x20')](_0x30d422)[_0xe507('0x21')]();};}function respondWithResult(_0x57ad24,_0x53088c){_0x53088c=_0x53088c||0xc8;return function(_0x38c6c9){if(_0x38c6c9){return _0x57ad24[_0xe507('0x20')](_0x53088c)[_0xe507('0x22')](_0x38c6c9);}};}function respondWithFilteredResult(_0x150fab,_0x1925d7){return function(_0x388b46){if(_0x388b46){var _0x40d3d0=typeof _0x1925d7[_0xe507('0x23')]===_0xe507('0x24')&&typeof _0x1925d7[_0xe507('0x25')]==='undefined';var _0x270aa5=_0x388b46[_0xe507('0x26')];var _0x5227e9=_0x40d3d0?0x0:_0x1925d7[_0xe507('0x23')];var _0x27133b=_0x40d3d0?_0x388b46[_0xe507('0x26')]:_0x1925d7[_0xe507('0x23')]+_0x1925d7['limit'];var _0x3a4056;if(_0x27133b>=_0x270aa5){_0x27133b=_0x270aa5;_0x3a4056=0xc8;}else{_0x3a4056=0xce;}_0x150fab[_0xe507('0x20')](_0x3a4056);return _0x150fab[_0xe507('0x27')]('Content-Range',_0x5227e9+'-'+_0x27133b+'/'+_0x270aa5)['json'](_0x388b46);}return null;};}function saveUpdates(_0x53a14a){return function(_0x555ea0){if(_0x555ea0){return _0x555ea0['update'](_0x53a14a)[_0xe507('0x15')](function(_0xb60176){return _0xb60176;});}return null;};}function removeEntity(_0x2b5ecf){return function(_0x58315f){if(_0x58315f){return _0x58315f[_0xe507('0x28')]()[_0xe507('0x15')](function(){_0x2b5ecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x533411){return function(_0x311782){if(!_0x311782){_0x533411['sendStatus'](0x194);}return _0x311782;};}function handleError(_0x17fcc7,_0x4f7da5){_0x4f7da5=_0x4f7da5||0x1f4;return function(_0x1af788){logger[_0xe507('0x1c')](_0x1af788['stack']);if(_0x1af788['name']){delete _0x1af788[_0xe507('0x29')];}_0x17fcc7[_0xe507('0x20')](_0x4f7da5)[_0xe507('0x2a')](_0x1af788);};}function getMustacheRender(_0x185672,_0x521a6e){return Mustache[_0xe507('0x2b')](_0x185672,_['merge'](_0x521a6e[_0xe507('0x2c')],{'contact':_0x521a6e[_0xe507('0x2d')],'message':_0x521a6e[_0xe507('0x1d')],'agent':_0x521a6e[_0xe507('0x2e')],'interaction':_0x521a6e['interaction'],'account':_0x521a6e['account']}))||'';}exports[_0xe507('0x2f')]=function(_0x4d5b47,_0x44dd35){var _0x16af93={};var _0x2cec8c=_[_0xe507('0x30')](db[_0xe507('0x31')]['rawAttributes'],function(_0x21e113){return{'name':_0x21e113[_0xe507('0x32')],'type':_0x21e113['type'][_0xe507('0x33')]};});_0x16af93=qs[_0xe507('0x34')](_0x2cec8c,_0x4d5b47);return interaction[_0xe507('0x35')](_0xe507('0x36'),_0x4d5b47[_0xe507('0x37')],_0x4d5b47[_0xe507('0x38')],_0x16af93,_0x2cec8c)[_0xe507('0x15')](respondWithFilteredResult(_0x44dd35,_0x16af93))[_0xe507('0x39')](handleError(_0x44dd35,null));};exports['show']=function(_0x4b0cb5,_0x20981c){var _0x4b321d={'raw':![],'where':{'id':_0x4b0cb5[_0xe507('0x3a')]['id']}},_0x137851={};_0x137851[_0xe507('0x3b')]=_[_0xe507('0x3c')](db[_0xe507('0x31')][_0xe507('0x3d')]);_0x137851[_0xe507('0x37')]=_[_0xe507('0x3c')](_0x4b0cb5[_0xe507('0x37')]);_0x137851[_0xe507('0x3e')]=_['intersection'](_0x137851[_0xe507('0x3b')],_0x137851['query']);_0x4b321d['attributes']=_[_0xe507('0x3f')](_0x137851['model'],qs[_0xe507('0x40')](_0x4b0cb5[_0xe507('0x37')]['fields']));_0x4b321d[_0xe507('0x41')]=_0x4b321d[_0xe507('0x41')][_0xe507('0x42')]?_0x4b321d[_0xe507('0x41')]:_0x137851[_0xe507('0x3b')];if(_0x4b0cb5[_0xe507('0x37')][_0xe507('0x43')]){_0x4b321d['include']=[{'all':!![]}];}_0x4b321d=_[_0xe507('0x44')]({},_0x4b321d,_0x4b0cb5[_0xe507('0x45')]);return db[_0xe507('0x31')][_0xe507('0x46')](_0x4b321d)['then'](handleEntityNotFound(_0x20981c,null))[_0xe507('0x15')](respondWithResult(_0x20981c,null))[_0xe507('0x39')](handleError(_0x20981c,null));};exports[_0xe507('0x47')]=function(_0x191018,_0x34af04){return db[_0xe507('0x31')][_0xe507('0x47')](_0x191018['body'],{})[_0xe507('0x15')](respondWithResult(_0x34af04,0xc9))[_0xe507('0x39')](handleError(_0x34af04,null));};exports['update']=function(_0x1ef75c,_0x4633f5){if(_0x1ef75c[_0xe507('0x2c')]['id']){delete _0x1ef75c[_0xe507('0x2c')]['id'];}return db[_0xe507('0x31')]['find']({'where':{'id':_0x1ef75c['params']['id']}})['then'](handleEntityNotFound(_0x4633f5,null))[_0xe507('0x15')](saveUpdates(_0x1ef75c[_0xe507('0x2c')],null))[_0xe507('0x15')](respondWithResult(_0x4633f5,null))[_0xe507('0x39')](handleError(_0x4633f5,null));};exports[_0xe507('0x28')]=function(_0xda85cb,_0x2246ba){return db[_0xe507('0x31')][_0xe507('0x46')]({'where':{'id':_0xda85cb[_0xe507('0x3a')]['id']}})[_0xe507('0x15')](handleEntityNotFound(_0x2246ba,null))[_0xe507('0x15')](removeEntity(_0x2246ba,null))[_0xe507('0x39')](handleError(_0x2246ba,null));};exports[_0xe507('0x48')]=function(_0x100c84,_0xd20101){return db['ChatInteraction']['describe']()[_0xe507('0x15')](respondWithResult(_0xd20101,null))[_0xe507('0x39')](handleError(_0xd20101,null));};exports[_0xe507('0x49')]=function(_0x11055,_0x2e4cd5){var _0x389483=_0x11055[_0xe507('0x3a')]['id'];var _0x48416c;var _0x9fc34d;var _0x3fa607;return db[_0xe507('0x31')][_0xe507('0x4a')]({'where':{'id':_0x389483}})['then'](function(_0x597a6c){_0x48416c=_0x597a6c;return db[_0xe507('0x4b')][_0xe507('0x4a')]({'where':{'id':_0x597a6c['ChatWebsiteId']},'attributes':['id',_0xe507('0x4c'),_0xe507('0x4d'),_0xe507('0x4e'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xe507('0x15')](function(_0x36bece){if(_0x36bece&&_0x36bece[_0xe507('0x4c')]&&_0x36bece[_0xe507('0x4d')]){_0x9fc34d=_0x36bece;var _0x561dc6={'interaction':{'id':_0x389483},'agent':{'id':_0x11055[_0xe507('0x38')]['id'],'name':_0x11055[_0xe507('0x38')][_0xe507('0x29')],'fullname':_0x11055[_0xe507('0x38')]['fullname'],'email':_0x11055[_0xe507('0x38')]['email']},'contact':_0x11055[_0xe507('0x2c')][_0xe507('0x2d')],'account':_0x11055[_0xe507('0x2c')]['account']};var _0x2cafdd={'rejectUnauthorized':![],'method':_0xe507('0x4f'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x36bece[_0xe507('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11055[_0xe507('0x38')][_0xe507('0x50')]],'buttons':null,'topic':_0x9fc34d[_0xe507('0x4e')],'note':_['isNull'](_0x9fc34d[_0xe507('0x51')])?null:getMustacheRender(_0x9fc34d['vidaooNote'],_0x561dc6),'metadata':null},'redirect':_0xe507('0x52'),'json':!![]};try{if(!_[_0xe507('0x53')](_0x9fc34d['vidaooMetadata'])){var _0x5dba84=getMustacheRender(_0x9fc34d[_0xe507('0x54')],_0x561dc6);var _0x16ccb=JSON[_0xe507('0x55')](_0x5dba84);_0x2cafdd[_0xe507('0x2c')][_0xe507('0x56')]=_0x16ccb;}}catch(_0x97f5de){throw new db['Sequelize'][(_0xe507('0x57'))](_0xe507('0x58'));}return rp(_0x2cafdd);}else{throw new db[(_0xe507('0x59'))][(_0xe507('0x57'))](_0xe507('0x5a'));}})[_0xe507('0x15')](function(_0x3849e3){_0x3fa607=_0x3849e3;if(_0x3fa607['id']){var _0x1ab9fc={'body':_0x3fa607[_0xe507('0x5b')],'ChatWebsiteId':_0x9fc34d['id'],'ChatInteractionId':_0x48416c['id'],'direction':'out','UserId':_0x11055[_0xe507('0x38')]['id']};return db[_0xe507('0x5c')][_0xe507('0x47')](_0x1ab9fc,{});}else{throw new db['Sequelize'][(_0xe507('0x57'))](_0xe507('0x5d'));}})[_0xe507('0x15')](function(){return _0x48416c[_0xe507('0x5e')]({'vidaooSessionId':_0x3fa607['id']});})[_0xe507('0x15')](respondWithResult(_0x2e4cd5,null))['catch'](handleError(_0x2e4cd5,null));};exports[_0xe507('0x5f')]=function(_0x3c43da,_0x3505bf){if(_0x3c43da[_0xe507('0x2c')]['id']){delete _0x3c43da[_0xe507('0x2c')]['id'];}return db[_0xe507('0x31')][_0xe507('0x46')]({'where':{'id':_0x3c43da[_0xe507('0x3a')]['id']},'include':[{'model':db[_0xe507('0x60')],'as':_0xe507('0x61')}]})[_0xe507('0x15')](handleEntityNotFound(_0x3505bf,null))[_0xe507('0x15')](saveUpdates(_0x3c43da[_0xe507('0x2c')],null))[_0xe507('0x15')](respondWithResult(_0x3505bf,null))[_0xe507('0x39')](handleError(_0x3505bf,null));};exports['abandon']=function(_0x29e4f9,_0x1e6d46){if(_0x29e4f9[_0xe507('0x2c')]['id']){delete _0x29e4f9[_0xe507('0x2c')]['id'];}return db[_0xe507('0x31')][_0xe507('0x46')]({'where':{'id':_0x29e4f9['params']['id']}})[_0xe507('0x15')](function(_0x175686){if(!_0x175686){logger[_0xe507('0x1c')](_0xe507('0x62'),_0xe507('0x63'),0x194,_0xe507('0x64'));_0x1e6d46[_0xe507('0x1f')](0x194);}else{if(_0x175686[_0xe507('0x65')]){throw new db[(_0xe507('0x59'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x175686;})[_0xe507('0x15')](function(_0x5122b9){if(_0x5122b9){return _0x5122b9[_0xe507('0x66')]({'closed':_0x29e4f9[_0xe507('0x2c')]['closed'],'disposition':_0x29e4f9[_0xe507('0x2c')][_0xe507('0x67')]})[_0xe507('0x15')](function(_0x46a644){return _0x46a644;});}})['then'](function(){return respondWithRpcPromise(_0xe507('0x68'),_0xe507('0x63'),_0x29e4f9[_0xe507('0x2c')],client9004);})[_0xe507('0x15')](respondWithResult(_0x1e6d46,null))[_0xe507('0x39')](handleError(_0x1e6d46,null));};exports[_0xe507('0x69')]=function(_0x55bb26,_0x514357){_0x55bb26[_0xe507('0x2c')][_0xe507('0x29')]=_0x55bb26[_0xe507('0x6a')]['originalname'];_0x55bb26[_0xe507('0x2c')][_0xe507('0x6b')]=_0x55bb26[_0xe507('0x6a')][_0xe507('0x6c')];_0x55bb26[_0xe507('0x2c')][_0xe507('0x6d')]=_0x55bb26[_0xe507('0x6a')][_0xe507('0x6e')];return db['Attachment'][_0xe507('0x47')](_0x55bb26[_0xe507('0x2c')])[_0xe507('0x15')](respondWithResult(_0x514357,0xc9))[_0xe507('0x39')](handleError(_0x514357,null));};exports[_0xe507('0x6f')]=function(_0x2a68fa,_0x14f898){return db[_0xe507('0x31')][_0xe507('0x4a')]({'where':{'id':_0x2a68fa[_0xe507('0x3a')]['id']},'raw':!![]})[_0xe507('0x15')](handleEntityNotFound(_0x14f898,null))['then'](function(_0x235bfb){if(_0x235bfb){if(_0x235bfb[_0xe507('0x70')]){return _0x14f898['status'](0x193)['json']({'status':0x193,'message':_0xe507('0x71')});}return db[_0xe507('0x72')][_0xe507('0x4a')]({'where':{'id':_0x2a68fa[_0xe507('0x37')][_0xe507('0x73')]},'raw':!![]})[_0xe507('0x15')](handleEntityNotFound(_0x14f898,null));}})['then'](function(_0x33e7d2){if(_0x33e7d2){var _0x5f81cb=_0x33e7d2[_0xe507('0x74')]!==null;var _0x1fda46=path['join'](config[_0xe507('0x75')],_0xe507('0x76'));if(_0x5f81cb){_0x1fda46=path[_0xe507('0x77')](_0x1fda46,_0xe507('0x78'));}var _0x4c5d97=path[_0xe507('0x77')](_0x1fda46,_0x33e7d2['basename']);return _0x14f898[_0xe507('0x79')](_0x4c5d97);}})[_0xe507('0x39')](handleError(_0x14f898,null));};exports[_0xe507('0x7a')]=function(_0x383163,_0x227c40){var _0x4874a4=null;var _0x267078=null;var _0x291f07=null;if(_0x383163['body']['id']){delete _0x383163[_0xe507('0x2c')]['id'];}if(_0x383163[_0xe507('0x2c')][_0xe507('0x7b')]){_0x291f07=path[_0xe507('0x77')](config['root'],_0xe507('0x7c'),util[_0xe507('0x7d')]('transcript-%s.txt',Date[_0xe507('0x7e')]()));_0x383163[_0xe507('0x2c')]['pathTranscript']=_0x291f07;}return db['ChatInteraction'][_0xe507('0x46')]({'where':{'id':_0x383163[_0xe507('0x3a')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xe507('0x7f'),'include':[{'model':db['User'],'as':_0xe507('0x80')}]}]})[_0xe507('0x15')](handleEntityNotFound(_0x227c40,null))['then'](saveUpdates(_0x383163['body'],null))[_0xe507('0x15')](function(_0x5e2a1e){if(_0x5e2a1e){_0x4874a4=_0x5e2a1e;return db[_0xe507('0x4b')]['find']({'where':{'id':_0x4874a4[_0xe507('0x81')]}});}})[_0xe507('0x15')](function(_0x3eeee0){if(_0x3eeee0){_0x267078=_0x3eeee0;return db[_0xe507('0x60')]['find']({'where':{'id':_0x4874a4[_0xe507('0x82')]}});}})[_0xe507('0x15')](function(_0x44d490){if(_0x44d490){if(_0x291f07){var _0x534d5b=null;for(var _0x246823=0x1;_0x246823<_0x4874a4[_0xe507('0x7f')][_0xe507('0x42')];++_0x246823){_0x534d5b=_0x4874a4[_0xe507('0x7f')][_0x246823];var _0x456492=_0x534d5b[_0xe507('0x65')]?util[_0xe507('0x7d')](_0xe507('0x83'),_0x267078[_0xe507('0x84')],_0x534d5b[_0xe507('0x65')]):_0xe507('0x85');var _0x420a67=_0x383163[_0xe507('0x2c')][_0xe507('0x86')]||util[_0xe507('0x7d')](_0xe507('0x83'),_0xe507('0x87'),_0x534d5b['ContactId']);switch(_0x267078['agentIdentifier']){case _0xe507('0x88'):_0x456492=_0x534d5b[_0xe507('0x65')]?util[_0xe507('0x7d')](_0xe507('0x83'),_0x267078[_0xe507('0x84')],_0x534d5b['UserId']):'System';break;case'agent_alias':_0x456492=_0x534d5b[_0xe507('0x65')]?_0x534d5b[_0xe507('0x80')][_0xe507('0x89')]||_0x534d5b[_0xe507('0x80')]['fullname']:'System';break;case _0xe507('0x8a'):_0x456492=_0x534d5b['UserId']?_0x534d5b['User']['fullname']:_0xe507('0x85');break;default:_0x456492=_0x534d5b[_0xe507('0x65')]?util[_0xe507('0x7d')](_0xe507('0x83'),_0x267078[_0xe507('0x84')],_0x534d5b[_0xe507('0x65')]):'System';}var _0x235c98=util[_0xe507('0x7d')](_0xe507('0x8b'),moment(_0x534d5b[_0xe507('0x8c')])['format'](_0xe507('0x8d')),_0x534d5b[_0xe507('0x8e')]==='in'?_0x420a67:_0x456492,_0x534d5b[_0xe507('0x2c')]);if(!_0x534d5b[_0xe507('0x8f')]){fs[_0xe507('0x90')](_0x291f07,_0x235c98);}}return db[_0xe507('0x91')][_0xe507('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xe507('0x92')],'as':_0xe507('0x93'),'raw':!![],'include':[{'model':db[_0xe507('0x94')],'as':_0xe507('0x94'),'raw':!![]}]}]});}}})[_0xe507('0x15')](function(_0x105e77){if(!_0x105e77||!_0x105e77[_0xe507('0x93')]||!_0x383163[_0xe507('0x2c')])return _0x4874a4;var _0xe864c8=_0x105e77[_0xe507('0x95')]();return respondWithRpcPromise(_0xe507('0x96'),_0xe507('0x97'),{'account':_0xe864c8,'message':{'from':util[_0xe507('0x7d')](_0xe507('0x98'),_0x105e77[_0xe507('0x29')],_0x105e77[_0xe507('0x50')]||_0x105e77[_0xe507('0x93')][_0xe507('0x38')]),'to':_0x383163[_0xe507('0x2c')]['mailTranscript'],'subject':_0xe507('0x99'),'text':util[_0xe507('0x7d')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x383163[_0xe507('0x2c')]['mailTranscript']),'attachments':[{'path':_0x291f07}]}})[_0xe507('0x15')](function(){return _0x4874a4;})[_0xe507('0x39')](function(_0x244f46){logger[_0xe507('0x1c')](_0x244f46);});})['then'](respondWithStatusCode(_0x227c40,0xc8))['catch'](handleError(_0x227c40,null));};exports['addMessage']=function(_0x2928b0,_0x5bf1fc){return db['ChatMessage'][_0xe507('0x46')]({'where':{'id':_0x2928b0[_0xe507('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5bf1fc,null))['then'](function(_0x164608){if(_0x164608){return _0x164608[_0xe507('0x9a')](_0x2928b0[_0xe507('0x2c')]['ids'],_[_0xe507('0x9b')](_0x2928b0[_0xe507('0x2c')],[_0xe507('0x9c'),'id'])||{});}})['then'](respondWithResult(_0x5bf1fc,null))[_0xe507('0x39')](handleError(_0x5bf1fc,null));};exports[_0xe507('0x9d')]=function(_0x49fc97,_0x5af924){var _0x3906aa={'raw':![],'where':{}};var _0x6bac68={};var _0x30612c={'count':0x0,'rows':[]};return db[_0xe507('0x31')][_0xe507('0x4a')]({'where':{'id':_0x49fc97[_0xe507('0x3a')]['id']}})[_0xe507('0x15')](handleEntityNotFound(_0x5af924,null))[_0xe507('0x15')](function(_0xc15238){if(_0xc15238){_0x6bac68['model']=_[_0xe507('0x3c')](db[_0xe507('0x5c')][_0xe507('0x3d')]);_0x6bac68[_0xe507('0x37')]=_[_0xe507('0x3c')](_0x49fc97['query']);_0x6bac68[_0xe507('0x3e')]=_['intersection'](_0x6bac68[_0xe507('0x3b')],_0x6bac68[_0xe507('0x37')]);_0x3906aa[_0xe507('0x41')]=_[_0xe507('0x3f')](_0x6bac68[_0xe507('0x3b')],qs['fields'](_0x49fc97[_0xe507('0x37')][_0xe507('0x40')]));_0x3906aa[_0xe507('0x41')]=_0x3906aa[_0xe507('0x41')][_0xe507('0x42')]?_0x3906aa[_0xe507('0x41')]:_0x6bac68[_0xe507('0x3b')];if(!_0x49fc97[_0xe507('0x37')][_0xe507('0x9e')](_0xe507('0x9f'))){_0x3906aa['limit']=qs[_0xe507('0x25')](_0x49fc97[_0xe507('0x37')][_0xe507('0x25')]);_0x3906aa[_0xe507('0x23')]=qs[_0xe507('0x23')](_0x49fc97[_0xe507('0x37')][_0xe507('0x23')]);}_0x3906aa[_0xe507('0xa0')]=qs[_0xe507('0xa1')](_0x49fc97[_0xe507('0x37')][_0xe507('0xa1')]);_0x3906aa[_0xe507('0xa2')]=qs['filters'](_['pick'](_0x49fc97['query'],_0x6bac68[_0xe507('0x3e')]));_0x3906aa['where'][_0xe507('0xa3')]=_0xc15238['id'];if(_0x49fc97['query'][_0xe507('0xa4')]){_0x3906aa[_0xe507('0xa2')]=_[_0xe507('0x44')](_0x3906aa[_0xe507('0xa2')],{'$or':_[_0xe507('0x30')](_0x3906aa[_0xe507('0x41')],function(_0x409e16){var _0x45c94b={};_0x45c94b[_0x409e16]={'$like':'%'+_0x49fc97['query'][_0xe507('0xa4')]+'%'};return _0x45c94b;})});}if(_0x49fc97['query'][_0xe507('0xa5')]){var _0x383a7f=_0x49fc97[_0xe507('0x37')]['$gte']['split'](',');var _0x587662={};_0x587662[_0x383a7f[0x0]]={'$gte':moment(_0x383a7f[0x1])[_0xe507('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3906aa[_0xe507('0xa2')]=_[_0xe507('0x44')](_0x3906aa[_0xe507('0xa2')],_0x587662);}_0x3906aa=_[_0xe507('0x44')]({},_0x3906aa,_0x49fc97[_0xe507('0x45')]);return db[_0xe507('0x5c')]['count']({'where':_0x3906aa['where']})[_0xe507('0x15')](function(_0x13b0e0){_0x30612c[_0xe507('0x26')]=_0x13b0e0;if(_0x49fc97['query'][_0xe507('0x43')]){_0x3906aa[_0xe507('0xa6')]=[{'all':!![]}];}return db[_0xe507('0x5c')][_0xe507('0x35')](_0x3906aa);})[_0xe507('0x15')](function(_0x1a1eb7){_0x30612c['rows']=_0x1a1eb7;return _0x30612c;});}})[_0xe507('0x15')](respondWithFilteredResult(_0x5af924,_0x3906aa))['catch'](handleError(_0x5af924,null));};exports[_0xe507('0xa7')]=function(_0x2f0b6d,_0x375609){var _0x32bb87={'where':{}},_0x5c4e2f={},_0x57777d={'count':0x0,'rows':[]};return db[_0xe507('0x31')][_0xe507('0x4a')]({'where':{'id':_0x2f0b6d[_0xe507('0x3a')]['id']}})[_0xe507('0x15')](handleEntityNotFound(_0x375609,null))[_0xe507('0x15')](function(_0x113d60){if(_0x113d60){_0x5c4e2f['model']=_['keys'](db[_0xe507('0x5c')][_0xe507('0x3d')]);_0x5c4e2f[_0xe507('0x37')]=_[_0xe507('0x3c')](_0x2f0b6d[_0xe507('0x37')]);_0x5c4e2f[_0xe507('0x3e')]=_['intersection'](_0x5c4e2f[_0xe507('0x3b')],_0x5c4e2f[_0xe507('0x37')]);_0x32bb87[_0xe507('0x41')]=_['intersection'](_0x5c4e2f['model'],qs['fields'](_0x2f0b6d[_0xe507('0x37')]['fields']));_0x32bb87[_0xe507('0x41')]=_0x32bb87[_0xe507('0x41')][_0xe507('0x42')]?_0x32bb87[_0xe507('0x41')]:_0x5c4e2f['model'];if(!_0x2f0b6d[_0xe507('0x37')]['hasOwnProperty'](_0xe507('0x9f'))){_0x32bb87[_0xe507('0x25')]=qs[_0xe507('0x25')](_0x2f0b6d[_0xe507('0x37')][_0xe507('0x25')]);_0x32bb87[_0xe507('0x23')]=qs[_0xe507('0x23')](_0x2f0b6d[_0xe507('0x37')][_0xe507('0x23')]);}_0x32bb87[_0xe507('0xa0')]=qs['sort'](_0x2f0b6d[_0xe507('0x37')][_0xe507('0xa1')]);_0x32bb87[_0xe507('0xa2')]=qs['filters'](_[_0xe507('0xa8')](_0x2f0b6d[_0xe507('0x37')],_0x5c4e2f[_0xe507('0x3e')]));_0x32bb87[_0xe507('0xa2')][_0xe507('0xa3')]=_0x113d60['id'];if(_0x2f0b6d[_0xe507('0x37')][_0xe507('0xa4')]){_0x32bb87[_0xe507('0xa2')]=_[_0xe507('0x44')](_0x32bb87[_0xe507('0xa2')],{'$or':_[_0xe507('0x30')](_0x32bb87[_0xe507('0x41')],function(_0x55eba2){var _0xdfa26a={};_0xdfa26a[_0x55eba2]={'$like':'%'+_0x2f0b6d['query'][_0xe507('0xa4')]+'%'};return _0xdfa26a;})});}_0x32bb87[_0xe507('0xa2')]['secret']=![];if(_0x2f0b6d[_0xe507('0x37')]['id']){_0x32bb87[_0xe507('0xa2')]['id']={'$gt':_0x2f0b6d[_0xe507('0x37')]['id']};}_0x32bb87=_['merge']({},_0x32bb87,_0x2f0b6d[_0xe507('0x45')]);return db[_0xe507('0x5c')]['count']({'where':_0x32bb87['where']})['then'](function(_0xd21bb4){_0x57777d[_0xe507('0x26')]=_0xd21bb4;_0x32bb87[_0xe507('0xa6')]=[];if(_0x2f0b6d[_0xe507('0x37')]['includeAgent']){_0x32bb87['include']['push']({'model':db[_0xe507('0x80')],'as':_0xe507('0x80'),'attributes':['id',_0xe507('0xa9'),_0xe507('0x89')]});}if(_0x2f0b6d[_0xe507('0x37')][_0xe507('0x43')]){_0x32bb87[_0xe507('0xa6')]=[{'all':!![]}];}return db[_0xe507('0x5c')]['findAll'](_0x32bb87);})['then'](function(_0x126b4e){_0x57777d[_0xe507('0xaa')]=_0x126b4e;return _0x57777d;});}})['then'](respondWithFilteredResult(_0x375609,_0x32bb87))[_0xe507('0x39')](handleError(_0x375609,null));};exports[_0xe507('0xab')]=function(_0x59cb2d,_0x58dff2){return db[_0xe507('0x31')][_0xe507('0x46')]({'where':{'id':_0x59cb2d['params']['id']}})[_0xe507('0x15')](handleEntityNotFound(_0x58dff2,null))[_0xe507('0x15')](function(_0x28cd57){if(_0x28cd57){return _0x28cd57[_0xe507('0xac')](_0x59cb2d[_0xe507('0x2c')]['ids'],_[_0xe507('0x9b')](_0x59cb2d[_0xe507('0x2c')],['ids','id'])||{})[_0xe507('0xad')](function(){return db[_0xe507('0xae')]['findAll']({'attributes':['id',_0xe507('0x29'),_0xe507('0xaf')],'where':{'id':_0x59cb2d[_0xe507('0x2c')][_0xe507('0x9c')]}});})['then'](function(_0x30d0a8){socket['emit'](_0xe507('0xb0'),{'id':Number(_0x59cb2d[_0xe507('0x3a')]['id']),'tags':_0x30d0a8||[]});return{'id':Number(_0x59cb2d[_0xe507('0x3a')]['id']),'tags':_0x30d0a8||[]};});}})[_0xe507('0x15')](respondWithResult(_0x58dff2,null))[_0xe507('0x39')](handleError(_0x58dff2,null));};exports[_0xe507('0xb1')]=function(_0x6b8a7,_0x1df4ad){return db['ChatInteraction'][_0xe507('0x46')]({'where':{'id':_0x6b8a7[_0xe507('0x3a')]['id']}})[_0xe507('0x15')](handleEntityNotFound(_0x1df4ad,null))['then'](function(_0x3b1533){if(_0x3b1533){return _0x3b1533[_0xe507('0xb1')](_0x6b8a7['query']['ids']);}})[_0xe507('0x15')](respondWithStatusCode(_0x1df4ad,null))[_0xe507('0x39')](handleError(_0x1df4ad,null));};exports['download']=function(_0x204b52,_0x4d5094){var _0x204cd9=moment()['unix']()['toString']();var _0xfc9d75=path[_0xe507('0x77')](config[_0xe507('0x75')],_0xe507('0xb2'),_0xe507('0xb3'),_0xe507('0xb4'));var _0x220990=path[_0xe507('0x77')](config['root'],'server','files','attachments');var _0x323cdc=path[_0xe507('0x77')](_0xfc9d75,_0x204cd9);var _0x41d8ed=util[_0xe507('0x7d')](_0xe507('0xb5'),_0x204b52[_0xe507('0x3a')]['id'],_0x204cd9);var _0x5ee731=path[_0xe507('0x77')](_0xfc9d75,_0x41d8ed);var _0x273bb8=[];_0x273bb8[_0xe507('0xb6')]({'model':db[_0xe507('0x80')],'as':_0xe507('0x80'),'attributes':['id',_0xe507('0xa9')],'raw':!![]});_0x273bb8[_0xe507('0xb6')]({'model':db[_0xe507('0x60')],'as':_0xe507('0x61'),'attributes':['id','firstName',_0xe507('0xb7')],'raw':!![]});if(_0x204b52[_0xe507('0x37')][_0xe507('0xb8')]){_0x273bb8[_0xe507('0xb6')]({'model':db[_0xe507('0x72')],'as':_0xe507('0x72'),'raw':!![]});}var _0x50f5c8=[{'model':db[_0xe507('0x5c')],'as':_0xe507('0x7f'),'attributes':['id',_0xe507('0x2c'),_0xe507('0x8c'),_0xe507('0x8e'),_0xe507('0x8f'),_0xe507('0xb9')],'include':_0x273bb8}];_0x50f5c8['push']({'model':db[_0xe507('0x4b')],'as':_0xe507('0xba'),'attributes':['id',_0xe507('0x29')]});_0x50f5c8['push']({'model':db['User'],'as':_0xe507('0xbb'),'attributes':['id',_0xe507('0xa9')]});return db[_0xe507('0x31')]['find']({'where':{'id':_0x204b52[_0xe507('0x3a')]['id']},'include':_0x50f5c8})['then'](handleEntityNotFound(_0x4d5094,null))[_0xe507('0x15')](function(_0x26367a){if(_0x26367a){var _0x1fd211=_0x26367a[_0xe507('0xbc')]({'plain':!![]});fs[_0xe507('0xbd')](_0x323cdc);var _0x3d01af={'channel':_0xe507('0xbe'),'account':_0x1fd211[_0xe507('0xba')][_0xe507('0x29')],'agent':_0x1fd211['Owner']?_0x1fd211[_0xe507('0xbb')][_0xe507('0xa9')]:'N.A.','createdAt':moment(_0x1fd211[_0xe507('0x8c')])[_0xe507('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe507('0xbf')](),'closedAt':_0x1fd211[_0xe507('0x70')]?moment(_0x1fd211[_0xe507('0xc0')])[_0xe507('0x7d')](_0xe507('0xc1'))[_0xe507('0xbf')]():'','disposition':_0x1fd211['disposition'],'chatInfo':{'browser':_0x1fd211['browserName'],'os':_0x1fd211[_0xe507('0xc2')],'referer':_0x1fd211[_0xe507('0xc3')],'customerIp':_0x1fd211['customerIp'],'customerPort':_0x1fd211[_0xe507('0xc4')]?_0x1fd211[_0xe507('0xc4')]:'N.A.'},'messages':_(_0x1fd211[_0xe507('0x7f')])[_0xe507('0xc5')]()[_0xe507('0xa4')]({'secret':![]})[_0xe507('0x30')](function(_0x46f039){if(_0x46f039[_0xe507('0x72')]){var _0x30b737=path[_0xe507('0x77')](_0x220990,_0x46f039[_0xe507('0x72')][_0xe507('0x6b')]);if(fs[_0xe507('0xc6')](_0x30b737)){fs[_0xe507('0xc7')](_0x30b737)[_0xe507('0xc8')](fs[_0xe507('0xc9')](path[_0xe507('0x77')](_0x323cdc,_0x46f039[_0xe507('0x72')][_0xe507('0x6b')])));}}return{'date':moment(_0x46f039[_0xe507('0x8c')])[_0xe507('0x7d')](_0xe507('0xc1'))[_0xe507('0xbf')](),'sender':_0x46f039['direction']===_0xe507('0xca')?_0x46f039['User']?_0x46f039[_0xe507('0x80')]['fullname']:_0xe507('0x85'):_0x46f039[_0xe507('0x61')][_0xe507('0xcb')]+(_0x46f039[_0xe507('0x61')]['lastName']?'\x20'+_0x46f039[_0xe507('0x61')][_0xe507('0xb7')]:''),'body':_0x46f039['Attachment']?_0x46f039[_0xe507('0x72')][_0xe507('0x6b')]:_0x46f039[_0xe507('0x2c')],'direction':_0x46f039[_0xe507('0x8e')]===_0xe507('0xca')?'A':'C','secret':_0x46f039[_0xe507('0x8f')],'read':_0x46f039['read'],'attachment':_0x46f039[_0xe507('0x72')]};})[_0xe507('0xcc')]()};return ejs[_0xe507('0xcd')](path[_0xe507('0x77')](config[_0xe507('0x75')],_0xe507('0xb2'),_0xe507('0xce'),_0xe507('0xcf')),{'interaction':_0x3d01af})[_0xe507('0x15')](function(_0x3d3b3f){var _0x5a9e1a=path[_0xe507('0x77')](_0x323cdc,_0xe507('0xd0')+_0x1fd211['id']+'-'+_0x204cd9+_0xe507('0xd1'));var _0x3af52e={'path':_0x5a9e1a,'channel':_0xe507('0xbe'),'interactionId':_0x1fd211['id']};return pdf[_0xe507('0xd2')](_0x3d3b3f,_0x3af52e);})['then'](function(){return new Promise(function(_0xc19b49,_0x4e9675){zipdir(_0x323cdc,{'saveTo':_0x5ee731},function(_0x15d4f3,_0x374ce0){if(_0x15d4f3)return _0x4e9675(_0x15d4f3);return _0xc19b49(_0x374ce0);});})[_0xe507('0x15')](function(){return new BPromise(function(_0x5a09ac,_0x40a3a0){rimraf(_0x323cdc,function(_0x586049){if(_0x586049)_0x40a3a0(_0x586049);return _0x5a09ac();});});})[_0xe507('0x15')](function(){return _0x4d5094['download'](_0x5ee731,_0x41d8ed,function(_0x865666){if(_0x865666){logger[_0xe507('0x1c')](_0xe507('0xd3'),_0x865666);}else{fs['unlinkSync'](_0x5ee731);}});});});}else{return _0x4d5094['sendStatus'](0xc8);}})[_0xe507('0x39')](handleError(_0x4d5094,null));}; \ No newline at end of file +var _0xea4b=['error','code','message','info','result','sendStatus','status','end','offset','undefined','limit','count','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','rawAttributes','type','key','findAll','chat','user','catch','show','model','keys','ChatInteraction','query','intersection','attributes','fields','length','includeAll','include','options','find','create','update','params','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','email','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','root','server/files/attachments/','join','offline-chat/','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','User','ChatWebsite','ContactId','Messages','%s%d','agentAlias','System','customer','format','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','getMessages','filters','hasOwnProperty','sort','where','pick','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','order','push','rows','spread','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','attachments','transcript-%d-%s.zip','Contact','lastName','read','Account','Owner','Chat','N.A.','closedAt','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','value','downloadInteraction.ejs','.pdf','err','unlinkSync','request-promise','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x13515d,_0x5ef9c3){var _0x46ab60=function(_0x11c6ba){while(--_0x11c6ba){_0x13515d['push'](_0x13515d['shift']());}};_0x46ab60(++_0x5ef9c3);}(_0xea4b,0xac));var _0xbea4=function(_0x26bfb0,_0x5b0ffc){_0x26bfb0=_0x26bfb0-0x0;var _0x4454b3=_0xea4b[_0x26bfb0];return _0x4454b3;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0xbea4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbea4('0x1'));var ejs=require(_0xbea4('0x2'));var fs=require('fs');var _=require(_0xbea4('0x3'));var Redis=require('ioredis');var interaction=require(_0xbea4('0x4'));var qs=require(_0xbea4('0x5'));var pdf=require(_0xbea4('0x6'));var logger=require(_0xbea4('0x7'))('api');var config=require(_0xbea4('0x8'));var db=require(_0xbea4('0x9'))['db'];config[_0xbea4('0xa')]=_[_0xbea4('0xb')](config[_0xbea4('0xa')],{'host':_0xbea4('0xc'),'port':0x18eb});var socket=require(_0xbea4('0xd'))(new Redis(config['redis']));require(_0xbea4('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xbea4('0xf')][_0xbea4('0x10')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1fe774,_0x445cc9,_0x8645cb,_0x16b32e){return new BPromise(function(_0x54518b,_0x3d4663){var _0x4558bb=_0x16b32e||client;return _0x4558bb[_0xbea4('0x11')](_0x1fe774,_0x8645cb)[_0xbea4('0x12')](function(_0x2cf478){logger['info'](_0xbea4('0x13'),_0x445cc9,_0xbea4('0x14'));logger['debug'](_0xbea4('0x15'),_0x445cc9,'request\x20sent',JSON['stringify'](_0x2cf478));if(_0x2cf478[_0xbea4('0x16')]){if(_0x2cf478['error'][_0xbea4('0x17')]===0x1f4){logger[_0xbea4('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x445cc9,_0x2cf478[_0xbea4('0x16')][_0xbea4('0x18')]);return _0x3d4663(_0x2cf478['error']['message']);}logger[_0xbea4('0x16')](_0xbea4('0x13'),_0x445cc9,_0x2cf478[_0xbea4('0x16')][_0xbea4('0x18')]);return _0x54518b(_0x2cf478[_0xbea4('0x16')][_0xbea4('0x18')]);}else{logger[_0xbea4('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x445cc9,_0xbea4('0x14'));_0x54518b(_0x2cf478[_0xbea4('0x1a')]['message']);}})['catch'](function(_0x41844c){logger[_0xbea4('0x16')](_0xbea4('0x13'),_0x445cc9,_0x41844c);_0x3d4663(_0x41844c);});});}function respondWithStatusCode(_0x4eddf5,_0x44d1a7){_0x44d1a7=_0x44d1a7||0xcc;return function(_0x396e63){if(_0x396e63){return _0x4eddf5[_0xbea4('0x1b')](_0x44d1a7);}return _0x4eddf5[_0xbea4('0x1c')](_0x44d1a7)[_0xbea4('0x1d')]();};}function respondWithResult(_0x34d840,_0x59fa3b){_0x59fa3b=_0x59fa3b||0xc8;return function(_0x216ab9){if(_0x216ab9){return _0x34d840[_0xbea4('0x1c')](_0x59fa3b)['json'](_0x216ab9);}};}function respondWithFilteredResult(_0x246256,_0x44c3ff){return function(_0x281f4f){if(_0x281f4f){var _0x3f632d=typeof _0x44c3ff[_0xbea4('0x1e')]===_0xbea4('0x1f')&&typeof _0x44c3ff[_0xbea4('0x20')]==='undefined';var _0x404649=_0x281f4f['count'];var _0x1e29f8=_0x3f632d?0x0:_0x44c3ff['offset'];var _0x30286d=_0x3f632d?_0x281f4f[_0xbea4('0x21')]:_0x44c3ff[_0xbea4('0x1e')]+_0x44c3ff[_0xbea4('0x20')];var _0xef65d0;if(_0x30286d>=_0x404649){_0x30286d=_0x404649;_0xef65d0=0xc8;}else{_0xef65d0=0xce;}_0x246256[_0xbea4('0x1c')](_0xef65d0);return _0x246256['set']('Content-Range',_0x1e29f8+'-'+_0x30286d+'/'+_0x404649)['json'](_0x281f4f);}return null;};}function saveUpdates(_0x184d6e){return function(_0x4c512c){if(_0x4c512c){return _0x4c512c['update'](_0x184d6e)[_0xbea4('0x12')](function(_0x2dd1ab){return _0x2dd1ab;});}return null;};}function removeEntity(_0x5ead12){return function(_0x2dc212){if(_0x2dc212){return _0x2dc212[_0xbea4('0x22')]()[_0xbea4('0x12')](function(){_0x5ead12[_0xbea4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c35d9){return function(_0x2e46f5){if(!_0x2e46f5){_0x1c35d9['sendStatus'](0x194);}return _0x2e46f5;};}function handleError(_0x3140e9,_0xa602a4){_0xa602a4=_0xa602a4||0x1f4;return function(_0x1c6d97){logger[_0xbea4('0x16')](_0x1c6d97[_0xbea4('0x23')]);if(_0x1c6d97[_0xbea4('0x24')]){delete _0x1c6d97['name'];}_0x3140e9[_0xbea4('0x1c')](_0xa602a4)[_0xbea4('0x25')](_0x1c6d97);};}function getMustacheRender(_0x26402b,_0x5de493){return Mustache[_0xbea4('0x26')](_0x26402b,_[_0xbea4('0x27')](_0x5de493[_0xbea4('0x28')],{'contact':_0x5de493[_0xbea4('0x29')],'message':_0x5de493[_0xbea4('0x18')],'agent':_0x5de493[_0xbea4('0x2a')],'interaction':_0x5de493[_0xbea4('0x2b')],'account':_0x5de493[_0xbea4('0x2c')]}))||'';}exports[_0xbea4('0x2d')]=function(_0x552072,_0x4b960b){var _0x398764={};var _0x2c7df9=_['map'](db['ChatInteraction'][_0xbea4('0x2e')],function(_0x1aa856){return{'name':_0x1aa856['fieldName'],'type':_0x1aa856[_0xbea4('0x2f')][_0xbea4('0x30')]};});_0x398764=qs['getOptions'](_0x2c7df9,_0x552072);return interaction[_0xbea4('0x31')](_0xbea4('0x32'),_0x552072['query'],_0x552072[_0xbea4('0x33')],_0x398764,_0x2c7df9)[_0xbea4('0x12')](respondWithFilteredResult(_0x4b960b,_0x398764))[_0xbea4('0x34')](handleError(_0x4b960b,null));};exports[_0xbea4('0x35')]=function(_0xb96fce,_0x434fd8){var _0x3ec213={'raw':![],'where':{'id':_0xb96fce['params']['id']}},_0x46246c={};_0x46246c[_0xbea4('0x36')]=_[_0xbea4('0x37')](db[_0xbea4('0x38')]['rawAttributes']);_0x46246c[_0xbea4('0x39')]=_['keys'](_0xb96fce[_0xbea4('0x39')]);_0x46246c['filters']=_[_0xbea4('0x3a')](_0x46246c[_0xbea4('0x36')],_0x46246c[_0xbea4('0x39')]);_0x3ec213[_0xbea4('0x3b')]=_[_0xbea4('0x3a')](_0x46246c[_0xbea4('0x36')],qs[_0xbea4('0x3c')](_0xb96fce['query']['fields']));_0x3ec213[_0xbea4('0x3b')]=_0x3ec213['attributes'][_0xbea4('0x3d')]?_0x3ec213[_0xbea4('0x3b')]:_0x46246c[_0xbea4('0x36')];if(_0xb96fce[_0xbea4('0x39')][_0xbea4('0x3e')]){_0x3ec213[_0xbea4('0x3f')]=[{'all':!![]}];}_0x3ec213=_[_0xbea4('0x27')]({},_0x3ec213,_0xb96fce[_0xbea4('0x40')]);return db[_0xbea4('0x38')][_0xbea4('0x41')](_0x3ec213)[_0xbea4('0x12')](handleEntityNotFound(_0x434fd8,null))[_0xbea4('0x12')](respondWithResult(_0x434fd8,null))[_0xbea4('0x34')](handleError(_0x434fd8,null));};exports['create']=function(_0x333e8f,_0x246036){return db['ChatInteraction'][_0xbea4('0x42')](_0x333e8f[_0xbea4('0x28')],{})[_0xbea4('0x12')](respondWithResult(_0x246036,0xc9))[_0xbea4('0x34')](handleError(_0x246036,null));};exports[_0xbea4('0x43')]=function(_0x556bb6,_0x40b3e4){if(_0x556bb6[_0xbea4('0x28')]['id']){delete _0x556bb6[_0xbea4('0x28')]['id'];}return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x556bb6[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x40b3e4,null))[_0xbea4('0x12')](saveUpdates(_0x556bb6[_0xbea4('0x28')],null))[_0xbea4('0x12')](respondWithResult(_0x40b3e4,null))[_0xbea4('0x34')](handleError(_0x40b3e4,null));};exports[_0xbea4('0x22')]=function(_0x4b9b8b,_0x1a3cfd){return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x4b9b8b[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x1a3cfd,null))[_0xbea4('0x12')](removeEntity(_0x1a3cfd,null))[_0xbea4('0x34')](handleError(_0x1a3cfd,null));};exports['describe']=function(_0x2f249d,_0x8e132){return db['ChatInteraction']['describe']()[_0xbea4('0x12')](respondWithResult(_0x8e132,null))[_0xbea4('0x34')](handleError(_0x8e132,null));};exports[_0xbea4('0x45')]=function(_0x46e03b,_0x21d93d){var _0x23e0b1=_0x46e03b[_0xbea4('0x44')]['id'];var _0x3b4c60;var _0x3a6917;var _0x5ece85;return db[_0xbea4('0x38')][_0xbea4('0x46')]({'where':{'id':_0x23e0b1}})[_0xbea4('0x12')](function(_0xb32b0c){_0x3b4c60=_0xb32b0c;return db['ChatWebsite'][_0xbea4('0x46')]({'where':{'id':_0xb32b0c[_0xbea4('0x47')]},'attributes':['id',_0xbea4('0x48'),_0xbea4('0x49'),_0xbea4('0x4a'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xbea4('0x12')](function(_0xc1c1f1){if(_0xc1c1f1&&_0xc1c1f1['vidaooApiKey']&&_0xc1c1f1[_0xbea4('0x49')]){_0x3a6917=_0xc1c1f1;var _0x51c5a5={'interaction':{'id':_0x23e0b1},'agent':{'id':_0x46e03b['user']['id'],'name':_0x46e03b[_0xbea4('0x33')][_0xbea4('0x24')],'fullname':_0x46e03b[_0xbea4('0x33')]['fullname'],'email':_0x46e03b[_0xbea4('0x33')][_0xbea4('0x4b')]},'contact':_0x46e03b[_0xbea4('0x28')][_0xbea4('0x29')],'account':_0x46e03b[_0xbea4('0x28')]['account']};var _0x4b6443={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0xc1c1f1['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e03b[_0xbea4('0x33')]['email']],'buttons':null,'topic':_0x3a6917[_0xbea4('0x4a')],'note':_[_0xbea4('0x4c')](_0x3a6917[_0xbea4('0x4d')])?null:getMustacheRender(_0x3a6917[_0xbea4('0x4d')],_0x51c5a5),'metadata':null},'redirect':_0xbea4('0x4e'),'json':!![]};try{if(!_['isNull'](_0x3a6917[_0xbea4('0x4f')])){var _0x43efd7=getMustacheRender(_0x3a6917[_0xbea4('0x4f')],_0x51c5a5);var _0x5419d2=JSON[_0xbea4('0x50')](_0x43efd7);_0x4b6443['body'][_0xbea4('0x51')]=_0x5419d2;}}catch(_0x485dd4){throw new db['Sequelize'][(_0xbea4('0x52'))](_0xbea4('0x53'));}return rp(_0x4b6443);}else{throw new db[(_0xbea4('0x54'))][(_0xbea4('0x52'))](_0xbea4('0x55'));}})[_0xbea4('0x12')](function(_0x40b411){_0x5ece85=_0x40b411;if(_0x5ece85['id']){var _0x413196={'body':_0x5ece85[_0xbea4('0x56')],'ChatWebsiteId':_0x3a6917['id'],'ChatInteractionId':_0x3b4c60['id'],'direction':_0xbea4('0x57'),'UserId':_0x46e03b['user']['id']};return db[_0xbea4('0x58')]['create'](_0x413196,{});}else{throw new db[(_0xbea4('0x54'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xbea4('0x12')](function(){return _0x3b4c60[_0xbea4('0x59')]({'vidaooSessionId':_0x5ece85['id']});})['then'](respondWithResult(_0x21d93d,null))['catch'](handleError(_0x21d93d,null));};exports[_0xbea4('0x5a')]=function(_0x210664,_0x5dbd02){if(_0x210664[_0xbea4('0x28')]['id']){delete _0x210664[_0xbea4('0x28')]['id'];}return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x210664[_0xbea4('0x44')]['id']},'include':[{'model':db[_0xbea4('0x5b')],'as':'Contact'}]})[_0xbea4('0x12')](handleEntityNotFound(_0x5dbd02,null))[_0xbea4('0x12')](saveUpdates(_0x210664[_0xbea4('0x28')],null))['then'](respondWithResult(_0x5dbd02,null))[_0xbea4('0x34')](handleError(_0x5dbd02,null));};exports['abandon']=function(_0x165380,_0x1fc5ef){if(_0x165380[_0xbea4('0x28')]['id']){delete _0x165380[_0xbea4('0x28')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x165380[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](function(_0x33633e){if(!_0x33633e){logger[_0xbea4('0x16')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xbea4('0x5c'),0x194,_0xbea4('0x5d'));_0x1fc5ef['sendStatus'](0x194);}else{if(_0x33633e[_0xbea4('0x5e')]){throw new db[(_0xbea4('0x54'))][(_0xbea4('0x52'))]('Interaction\x20already\x20assigned');}}return _0x33633e;})[_0xbea4('0x12')](function(_0x3d89bb){if(_0x3d89bb){return _0x3d89bb[_0xbea4('0x43')]({'closed':_0x165380[_0xbea4('0x28')][_0xbea4('0x5f')],'disposition':_0x165380['body'][_0xbea4('0x60')]})[_0xbea4('0x12')](function(_0x1fba22){return _0x1fba22;});}})[_0xbea4('0x12')](function(){return respondWithRpcPromise(_0xbea4('0x61'),_0xbea4('0x5c'),_0x165380['body'],client9004);})['then'](respondWithResult(_0x1fc5ef,null))[_0xbea4('0x34')](handleError(_0x1fc5ef,null));};exports[_0xbea4('0x62')]=function(_0x3c917f,_0x5025b4){_0x3c917f[_0xbea4('0x28')]['name']=_0x3c917f['file'][_0xbea4('0x63')];_0x3c917f[_0xbea4('0x28')][_0xbea4('0x64')]=_0x3c917f[_0xbea4('0x65')][_0xbea4('0x66')];_0x3c917f[_0xbea4('0x28')][_0xbea4('0x2f')]=_0x3c917f[_0xbea4('0x65')][_0xbea4('0x67')];return db[_0xbea4('0x68')][_0xbea4('0x42')](_0x3c917f['body'])[_0xbea4('0x12')](respondWithResult(_0x5025b4,0xc9))[_0xbea4('0x34')](handleError(_0x5025b4,null));};exports[_0xbea4('0x69')]=function(_0x1cf83d,_0x25a4be){return db['ChatInteraction'][_0xbea4('0x46')]({'where':{'id':_0x1cf83d[_0xbea4('0x44')]['id']},'raw':!![]})[_0xbea4('0x12')](handleEntityNotFound(_0x25a4be,null))['then'](function(_0x44cf22){if(_0x44cf22){if(_0x44cf22[_0xbea4('0x5f')]){return _0x25a4be[_0xbea4('0x1c')](0x193)[_0xbea4('0x6a')]({'status':0x193,'message':_0xbea4('0x6b')});}return db[_0xbea4('0x68')][_0xbea4('0x46')]({'where':{'id':_0x1cf83d[_0xbea4('0x39')][_0xbea4('0x6c')]},'raw':!![]})['then'](handleEntityNotFound(_0x25a4be,null));}})['then'](function(_0x521193){if(_0x521193){var _0x3eed8b=_0x521193['ChatOfflineMessageId']!==null;var _0x110458=path['join'](config[_0xbea4('0x6d')],_0xbea4('0x6e'));if(_0x3eed8b){_0x110458=path[_0xbea4('0x6f')](_0x110458,_0xbea4('0x70'));}var _0x22afd3=path[_0xbea4('0x6f')](_0x110458,_0x521193[_0xbea4('0x64')]);return _0x25a4be['download'](_0x22afd3);}})[_0xbea4('0x34')](handleError(_0x25a4be,null));};exports['close']=function(_0x5848ed,_0xa50f37){var _0x30c5dd=null;var _0x26c530=null;var _0x4f694a=null;if(_0x5848ed['body']['id']){delete _0x5848ed[_0xbea4('0x28')]['id'];}if(_0x5848ed[_0xbea4('0x28')][_0xbea4('0x71')]){_0x4f694a=path[_0xbea4('0x6f')](config[_0xbea4('0x6d')],_0xbea4('0x72'),util['format'](_0xbea4('0x73'),Date[_0xbea4('0x74')]()));_0x5848ed[_0xbea4('0x28')]['pathTranscript']=_0x4f694a;}return db['ChatInteraction'][_0xbea4('0x41')]({'where':{'id':_0x5848ed[_0xbea4('0x44')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xbea4('0x75')],'as':_0xbea4('0x75')}]}]})[_0xbea4('0x12')](handleEntityNotFound(_0xa50f37,null))[_0xbea4('0x12')](saveUpdates(_0x5848ed[_0xbea4('0x28')],null))[_0xbea4('0x12')](function(_0x4c77b3){if(_0x4c77b3){_0x30c5dd=_0x4c77b3;return db[_0xbea4('0x76')][_0xbea4('0x41')]({'where':{'id':_0x30c5dd[_0xbea4('0x47')]}});}})['then'](function(_0x3dcf32){if(_0x3dcf32){_0x26c530=_0x3dcf32;return db['CmContact'][_0xbea4('0x41')]({'where':{'id':_0x30c5dd[_0xbea4('0x77')]}});}})[_0xbea4('0x12')](function(_0x4504a2){if(_0x4504a2){if(_0x4f694a){var _0x5d6a52=null;for(var _0x126440=0x1;_0x126440<_0x30c5dd[_0xbea4('0x78')]['length'];++_0x126440){_0x5d6a52=_0x30c5dd[_0xbea4('0x78')][_0x126440];var _0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?util['format'](_0xbea4('0x79'),_0x26c530[_0xbea4('0x7a')],_0x5d6a52[_0xbea4('0x5e')]):_0xbea4('0x7b');var _0x57db9d=_0x5848ed[_0xbea4('0x28')][_0xbea4('0x7c')]||util[_0xbea4('0x7d')](_0xbea4('0x79'),'Visitor',_0x5d6a52['ContactId']);switch(_0x26c530['agentIdentifier']){case'website_alias':_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?util['format']('%s%d',_0x26c530[_0xbea4('0x7a')],_0x5d6a52[_0xbea4('0x5e')]):_0xbea4('0x7b');break;case'agent_alias':_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?_0x5d6a52[_0xbea4('0x75')][_0xbea4('0x7e')]||_0x5d6a52['User'][_0xbea4('0x7f')]:_0xbea4('0x7b');break;case _0xbea4('0x80'):_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?_0x5d6a52[_0xbea4('0x75')][_0xbea4('0x7f')]:_0xbea4('0x7b');break;default:_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?util[_0xbea4('0x7d')](_0xbea4('0x79'),_0x26c530[_0xbea4('0x7a')],_0x5d6a52[_0xbea4('0x5e')]):_0xbea4('0x7b');}var _0x16d2f6=util[_0xbea4('0x7d')](_0xbea4('0x81'),moment(_0x5d6a52[_0xbea4('0x82')])['format'](_0xbea4('0x83')),_0x5d6a52[_0xbea4('0x84')]==='in'?_0x57db9d:_0x3cf449,_0x5d6a52[_0xbea4('0x28')]);if(!_0x5d6a52[_0xbea4('0x85')]){fs[_0xbea4('0x86')](_0x4f694a,_0x16d2f6);}}return db[_0xbea4('0x87')][_0xbea4('0x46')]({'where':{'service':!![]},'include':[{'model':db[_0xbea4('0x88')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xbea4('0x89')],'as':_0xbea4('0x89'),'raw':!![]}]}]});}}})[_0xbea4('0x12')](function(_0x2da295){if(!_0x2da295||!_0x2da295[_0xbea4('0x8a')]||!_0x5848ed[_0xbea4('0x28')])return _0x30c5dd;var _0x43e12b=_0x2da295['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xbea4('0x8b'),{'account':_0x43e12b,'message':{'from':util[_0xbea4('0x7d')](_0xbea4('0x8c'),_0x2da295[_0xbea4('0x24')],_0x2da295[_0xbea4('0x4b')]||_0x2da295['Smtp'][_0xbea4('0x33')]),'to':_0x5848ed[_0xbea4('0x28')]['mailTranscript'],'subject':_0xbea4('0x8d'),'text':util[_0xbea4('0x7d')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5848ed[_0xbea4('0x28')][_0xbea4('0x71')]),'attachments':[{'path':_0x4f694a}]}})[_0xbea4('0x12')](function(){return _0x30c5dd;})['catch'](function(_0x3d9151){logger[_0xbea4('0x16')](_0x3d9151);});})[_0xbea4('0x12')](respondWithStatusCode(_0xa50f37,0xc8))[_0xbea4('0x34')](handleError(_0xa50f37,null));};exports[_0xbea4('0x8e')]=function(_0x7ae010,_0x1342be){return db[_0xbea4('0x58')][_0xbea4('0x41')]({'where':{'id':_0x7ae010['params']['id']}})['then'](handleEntityNotFound(_0x1342be,null))['then'](function(_0xb39f2f){if(_0xb39f2f){return _0xb39f2f[_0xbea4('0x8e')](_0x7ae010['body']['ids'],_[_0xbea4('0x8f')](_0x7ae010[_0xbea4('0x28')],[_0xbea4('0x90'),'id'])||{});}})[_0xbea4('0x12')](respondWithResult(_0x1342be,null))[_0xbea4('0x34')](handleError(_0x1342be,null));};exports[_0xbea4('0x91')]=function(_0x2ed107,_0x3c2833){var _0x2a990c={'raw':![],'where':{}};var _0xaa1d04={};var _0x5c96e0={'count':0x0,'rows':[]};return db[_0xbea4('0x38')][_0xbea4('0x46')]({'where':{'id':_0x2ed107[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x3c2833,null))[_0xbea4('0x12')](function(_0x1fcb20){if(_0x1fcb20){_0xaa1d04[_0xbea4('0x36')]=_[_0xbea4('0x37')](db[_0xbea4('0x58')][_0xbea4('0x2e')]);_0xaa1d04[_0xbea4('0x39')]=_['keys'](_0x2ed107['query']);_0xaa1d04[_0xbea4('0x92')]=_[_0xbea4('0x3a')](_0xaa1d04[_0xbea4('0x36')],_0xaa1d04[_0xbea4('0x39')]);_0x2a990c[_0xbea4('0x3b')]=_[_0xbea4('0x3a')](_0xaa1d04[_0xbea4('0x36')],qs[_0xbea4('0x3c')](_0x2ed107[_0xbea4('0x39')]['fields']));_0x2a990c[_0xbea4('0x3b')]=_0x2a990c[_0xbea4('0x3b')]['length']?_0x2a990c[_0xbea4('0x3b')]:_0xaa1d04[_0xbea4('0x36')];if(!_0x2ed107[_0xbea4('0x39')][_0xbea4('0x93')]('nolimit')){_0x2a990c[_0xbea4('0x20')]=qs[_0xbea4('0x20')](_0x2ed107[_0xbea4('0x39')][_0xbea4('0x20')]);_0x2a990c['offset']=qs[_0xbea4('0x1e')](_0x2ed107[_0xbea4('0x39')][_0xbea4('0x1e')]);}_0x2a990c['order']=qs[_0xbea4('0x94')](_0x2ed107['query'][_0xbea4('0x94')]);_0x2a990c[_0xbea4('0x95')]=qs['filters'](_[_0xbea4('0x96')](_0x2ed107['query'],_0xaa1d04['filters']));_0x2a990c[_0xbea4('0x95')][_0xbea4('0x97')]=_0x1fcb20['id'];if(_0x2ed107[_0xbea4('0x39')][_0xbea4('0x98')]){_0x2a990c[_0xbea4('0x95')]=_[_0xbea4('0x27')](_0x2a990c[_0xbea4('0x95')],{'$or':_[_0xbea4('0x99')](_0x2a990c[_0xbea4('0x3b')],function(_0x123f91){var _0x3741ad={};_0x3741ad[_0x123f91]={'$like':'%'+_0x2ed107[_0xbea4('0x39')][_0xbea4('0x98')]+'%'};return _0x3741ad;})});}if(_0x2ed107[_0xbea4('0x39')][_0xbea4('0x9a')]){var _0xf3d57e=_0x2ed107[_0xbea4('0x39')][_0xbea4('0x9a')][_0xbea4('0x9b')](',');var _0x422a02={};_0x422a02[_0xf3d57e[0x0]]={'$gte':moment(_0xf3d57e[0x1])[_0xbea4('0x7d')](_0xbea4('0x9c'))};_0x2a990c[_0xbea4('0x95')]=_[_0xbea4('0x27')](_0x2a990c[_0xbea4('0x95')],_0x422a02);}_0x2a990c=_[_0xbea4('0x27')]({},_0x2a990c,_0x2ed107[_0xbea4('0x40')]);return db[_0xbea4('0x58')][_0xbea4('0x21')]({'where':_0x2a990c[_0xbea4('0x95')]})['then'](function(_0x4ad23b){_0x5c96e0[_0xbea4('0x21')]=_0x4ad23b;if(_0x2ed107[_0xbea4('0x39')][_0xbea4('0x3e')]){_0x2a990c[_0xbea4('0x3f')]=[{'all':!![]}];}return db[_0xbea4('0x58')][_0xbea4('0x31')](_0x2a990c);})[_0xbea4('0x12')](function(_0xcdb077){_0x5c96e0['rows']=_0xcdb077;return _0x5c96e0;});}})['then'](respondWithFilteredResult(_0x3c2833,_0x2a990c))[_0xbea4('0x34')](handleError(_0x3c2833,null));};exports['getMyMessages']=function(_0x8a3d1d,_0x1ea201){var _0x56da24={'where':{}},_0x1da8a2={},_0x565a75={'count':0x0,'rows':[]};return db[_0xbea4('0x38')][_0xbea4('0x46')]({'where':{'id':_0x8a3d1d[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x1ea201,null))[_0xbea4('0x12')](function(_0x3bbb91){if(_0x3bbb91){_0x1da8a2['model']=_[_0xbea4('0x37')](db[_0xbea4('0x58')][_0xbea4('0x2e')]);_0x1da8a2[_0xbea4('0x39')]=_[_0xbea4('0x37')](_0x8a3d1d[_0xbea4('0x39')]);_0x1da8a2[_0xbea4('0x92')]=_[_0xbea4('0x3a')](_0x1da8a2[_0xbea4('0x36')],_0x1da8a2[_0xbea4('0x39')]);_0x56da24[_0xbea4('0x3b')]=_['intersection'](_0x1da8a2[_0xbea4('0x36')],qs['fields'](_0x8a3d1d[_0xbea4('0x39')][_0xbea4('0x3c')]));_0x56da24[_0xbea4('0x3b')]=_0x56da24[_0xbea4('0x3b')]['length']?_0x56da24[_0xbea4('0x3b')]:_0x1da8a2['model'];if(!_0x8a3d1d[_0xbea4('0x39')][_0xbea4('0x93')]('nolimit')){_0x56da24[_0xbea4('0x20')]=qs[_0xbea4('0x20')](_0x8a3d1d[_0xbea4('0x39')]['limit']);_0x56da24[_0xbea4('0x1e')]=qs[_0xbea4('0x1e')](_0x8a3d1d['query']['offset']);}_0x56da24[_0xbea4('0x9d')]=qs['sort'](_0x8a3d1d['query']['sort']);_0x56da24['where']=qs[_0xbea4('0x92')](_[_0xbea4('0x96')](_0x8a3d1d[_0xbea4('0x39')],_0x1da8a2['filters']));_0x56da24[_0xbea4('0x95')][_0xbea4('0x97')]=_0x3bbb91['id'];if(_0x8a3d1d['query'][_0xbea4('0x98')]){_0x56da24[_0xbea4('0x95')]=_['merge'](_0x56da24[_0xbea4('0x95')],{'$or':_['map'](_0x56da24[_0xbea4('0x3b')],function(_0x58b10f){var _0x307f61={};_0x307f61[_0x58b10f]={'$like':'%'+_0x8a3d1d[_0xbea4('0x39')]['filter']+'%'};return _0x307f61;})});}_0x56da24[_0xbea4('0x95')]['secret']=![];if(_0x8a3d1d[_0xbea4('0x39')]['id']){_0x56da24[_0xbea4('0x95')]['id']={'$gt':_0x8a3d1d[_0xbea4('0x39')]['id']};}_0x56da24=_[_0xbea4('0x27')]({},_0x56da24,_0x8a3d1d['options']);return db['ChatMessage'][_0xbea4('0x21')]({'where':_0x56da24[_0xbea4('0x95')]})['then'](function(_0x55cfa6){_0x565a75[_0xbea4('0x21')]=_0x55cfa6;_0x56da24[_0xbea4('0x3f')]=[];if(_0x8a3d1d[_0xbea4('0x39')]['includeAgent']){_0x56da24[_0xbea4('0x3f')][_0xbea4('0x9e')]({'model':db['User'],'as':'User','attributes':['id',_0xbea4('0x7f'),'alias']});}if(_0x8a3d1d['query'][_0xbea4('0x3e')]){_0x56da24[_0xbea4('0x3f')]=[{'all':!![]}];}return db[_0xbea4('0x58')][_0xbea4('0x31')](_0x56da24);})['then'](function(_0x1192d9){_0x565a75[_0xbea4('0x9f')]=_0x1192d9;return _0x565a75;});}})[_0xbea4('0x12')](respondWithFilteredResult(_0x1ea201,_0x56da24))[_0xbea4('0x34')](handleError(_0x1ea201,null));};exports['addTags']=function(_0x3551d8,_0x2d350d){return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x3551d8[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x2d350d,null))[_0xbea4('0x12')](function(_0xed9830){if(_0xed9830){return _0xed9830['setTags'](_0x3551d8[_0xbea4('0x28')]['ids'],_[_0xbea4('0x8f')](_0x3551d8['body'],[_0xbea4('0x90'),'id'])||{})[_0xbea4('0xa0')](function(){return db['Tag'][_0xbea4('0x31')]({'attributes':['id',_0xbea4('0x24'),_0xbea4('0xa1')],'where':{'id':_0x3551d8[_0xbea4('0x28')][_0xbea4('0x90')]}});})[_0xbea4('0x12')](function(_0x326fe8){socket[_0xbea4('0xa2')](_0xbea4('0xa3'),{'id':Number(_0x3551d8[_0xbea4('0x44')]['id']),'tags':_0x326fe8||[]});return{'id':Number(_0x3551d8[_0xbea4('0x44')]['id']),'tags':_0x326fe8||[]};});}})['then'](respondWithResult(_0x2d350d,null))['catch'](handleError(_0x2d350d,null));};exports['removeTags']=function(_0x3a4ebf,_0x68f42e){return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x3a4ebf[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x68f42e,null))[_0xbea4('0x12')](function(_0x5afce9){if(_0x5afce9){return _0x5afce9[_0xbea4('0xa4')](_0x3a4ebf[_0xbea4('0x39')][_0xbea4('0x90')]);}})[_0xbea4('0x12')](respondWithStatusCode(_0x68f42e,null))[_0xbea4('0x34')](handleError(_0x68f42e,null));};exports[_0xbea4('0xa5')]=function(_0x3be5e6,_0x1fdfc3){var _0x1792c8=moment()[_0xbea4('0xa6')]()[_0xbea4('0xa7')]();var _0x4150ad=path[_0xbea4('0x6f')](config['root'],_0xbea4('0xa8'),_0xbea4('0xa9'),'tmp');var _0x1dff0c=path[_0xbea4('0x6f')](config[_0xbea4('0x6d')],_0xbea4('0xa8'),'files',_0xbea4('0xaa'));var _0x36a708=path[_0xbea4('0x6f')](_0x4150ad,_0x1792c8);var _0x1b9a59=util[_0xbea4('0x7d')](_0xbea4('0xab'),_0x3be5e6[_0xbea4('0x44')]['id'],_0x1792c8);var _0x4518ed=path['join'](_0x4150ad,_0x1b9a59);var _0x848132=[];_0x848132[_0xbea4('0x9e')]({'model':db[_0xbea4('0x75')],'as':_0xbea4('0x75'),'attributes':['id',_0xbea4('0x7f')],'raw':!![]});_0x848132[_0xbea4('0x9e')]({'model':db[_0xbea4('0x5b')],'as':_0xbea4('0xac'),'attributes':['id','firstName',_0xbea4('0xad')],'raw':!![]});if(_0x3be5e6['query'][_0xbea4('0xaa')]){_0x848132[_0xbea4('0x9e')]({'model':db[_0xbea4('0x68')],'as':'Attachment','raw':!![]});}var _0x2d7645=[{'model':db['ChatMessage'],'as':_0xbea4('0x78'),'attributes':['id',_0xbea4('0x28'),_0xbea4('0x82'),_0xbea4('0x84'),_0xbea4('0x85'),_0xbea4('0xae')],'include':_0x848132}];_0x2d7645[_0xbea4('0x9e')]({'model':db[_0xbea4('0x76')],'as':_0xbea4('0xaf'),'attributes':['id',_0xbea4('0x24')]});_0x2d7645[_0xbea4('0x9e')]({'model':db['User'],'as':_0xbea4('0xb0'),'attributes':['id',_0xbea4('0x7f')]});return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x3be5e6['params']['id']},'include':_0x2d7645})[_0xbea4('0x12')](handleEntityNotFound(_0x1fdfc3,null))[_0xbea4('0x12')](function(_0x2ed9ea){if(_0x2ed9ea){var _0x42d8d8=_0x2ed9ea['get']({'plain':!![]});fs['mkdirSync'](_0x36a708);var _0x462549={'channel':_0xbea4('0xb1'),'account':_0x42d8d8['Account'][_0xbea4('0x24')],'agent':_0x42d8d8[_0xbea4('0xb0')]?_0x42d8d8['Owner'][_0xbea4('0x7f')]:_0xbea4('0xb2'),'createdAt':moment(_0x42d8d8[_0xbea4('0x82')])[_0xbea4('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbea4('0xa7')](),'closedAt':_0x42d8d8[_0xbea4('0x5f')]?moment(_0x42d8d8[_0xbea4('0xb3')])[_0xbea4('0x7d')](_0xbea4('0x9c'))['toString']():'','disposition':_0x42d8d8[_0xbea4('0x60')],'chatInfo':{'browser':_0x42d8d8['browserName'],'os':_0x42d8d8[_0xbea4('0xb4')],'referer':_0x42d8d8[_0xbea4('0xb5')],'customerIp':_0x42d8d8[_0xbea4('0xb6')],'customerPort':_0x42d8d8['customerPort']?_0x42d8d8[_0xbea4('0xb7')]:_0xbea4('0xb2')},'messages':_(_0x42d8d8['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x2c6a13){if(_0x2c6a13[_0xbea4('0x68')]){var _0x456d19=path[_0xbea4('0x6f')](_0x1dff0c,_0x2c6a13[_0xbea4('0x68')][_0xbea4('0x64')]);if(fs[_0xbea4('0xb8')](_0x456d19)){fs[_0xbea4('0xb9')](_0x456d19)[_0xbea4('0xba')](fs[_0xbea4('0xbb')](path[_0xbea4('0x6f')](_0x36a708,_0x2c6a13[_0xbea4('0x68')]['basename'])));}}return{'date':moment(_0x2c6a13[_0xbea4('0x82')])[_0xbea4('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2c6a13[_0xbea4('0x84')]===_0xbea4('0x57')?_0x2c6a13[_0xbea4('0x75')]?_0x2c6a13[_0xbea4('0x75')][_0xbea4('0x7f')]:_0xbea4('0x7b'):_0x2c6a13[_0xbea4('0xac')][_0xbea4('0xbc')]+(_0x2c6a13['Contact'][_0xbea4('0xad')]?'\x20'+_0x2c6a13[_0xbea4('0xac')]['lastName']:''),'body':_0x2c6a13[_0xbea4('0x68')]?_0x2c6a13['Attachment'][_0xbea4('0x64')]:_0x2c6a13[_0xbea4('0x28')],'direction':_0x2c6a13[_0xbea4('0x84')]==='out'?'A':'C','secret':_0x2c6a13[_0xbea4('0x85')],'read':_0x2c6a13[_0xbea4('0xae')],'attachment':_0x2c6a13[_0xbea4('0x68')]};})[_0xbea4('0xbd')]()};return ejs['renderFile'](path[_0xbea4('0x6f')](config[_0xbea4('0x6d')],_0xbea4('0xa8'),'views',_0xbea4('0xbe')),{'interaction':_0x462549})[_0xbea4('0x12')](function(_0x551893){var _0x497354=path['join'](_0x36a708,'transcript-'+_0x42d8d8['id']+'-'+_0x1792c8+_0xbea4('0xbf'));var _0x378354={'path':_0x497354,'channel':_0xbea4('0xb1'),'interactionId':_0x42d8d8['id']};return pdf['createPdfFromHTML'](_0x551893,_0x378354);})['then'](function(){return new Promise(function(_0x35573d,_0x5af036){zipdir(_0x36a708,{'saveTo':_0x4518ed},function(_0x3d5567,_0x54c4d6){if(_0x3d5567)return _0x5af036(_0x3d5567);return _0x35573d(_0x54c4d6);});})[_0xbea4('0x12')](function(){return new BPromise(function(_0x12c5d6,_0x36d8bd){rimraf(_0x36a708,function(_0x140d2c){if(_0x140d2c)_0x36d8bd(_0x140d2c);return _0x12c5d6();});});})[_0xbea4('0x12')](function(){return _0x1fdfc3[_0xbea4('0xa5')](_0x4518ed,_0x1b9a59,function(_0x3183ec){if(_0x3183ec){logger['error'](_0xbea4('0xc0'),_0x3183ec);}else{fs[_0xbea4('0xc1')](_0x4518ed);}});});});}else{return _0x1fdfc3[_0xbea4('0x1b')](0xc8);}})[_0xbea4('0x34')](handleError(_0x1fdfc3,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 54bdb58..66f1515 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 _0xdc4a=['catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc4a,0x1a2));var _0xadc4=function(_0x3087f3,_0x583bda){_0x3087f3=_0x3087f3-0x0;var _0x3ee8e3=_0xdc4a[_0x3087f3];return _0x3ee8e3;};'use strict';var EventEmitter=require(_0xadc4('0x0'));var ChatInteraction=require(_0xadc4('0x1'))['db'][_0xadc4('0x2')];var ChatMessage=require(_0xadc4('0x1'))['db'][_0xadc4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xadc4('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xadc4('0x5'),'afterDestroy':_0xadc4('0x6')};function emitEvent(_0x5a6ba9){return function(_0x398c8e,_0x149062,_0x33fa48){_0x398c8e[_0xadc4('0x7')]({'attributes':['id'],'raw':!![]})[_0xadc4('0x8')](function(_0x3405d0){_0x398c8e[_0xadc4('0x9')](_0xadc4('0xa'),_0x3405d0['map'](function(_0x2ad5a2){return{'id':_0x2ad5a2['id']};}));return ChatMessage[_0xadc4('0xb')]({'where':{'ChatInteractionId':_0x398c8e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x13b860){_0x398c8e['setDataValue'](_0xadc4('0xc'),_0x13b860['length']);ChatInteractionEvents[_0xadc4('0xd')](_0x5a6ba9+':'+_0x398c8e['id'],_0x398c8e);ChatInteractionEvents['emit'](_0x5a6ba9,_0x398c8e);_0x33fa48(null);})[_0xadc4('0xe')](_0x33fa48(null));};}for(var e in events){if(events[_0xadc4('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x17d4=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','setDataValue','unreadMessages','length','emit'];(function(_0x372eaf,_0x49ec27){var _0x240471=function(_0x112005){while(--_0x112005){_0x372eaf['push'](_0x372eaf['shift']());}};_0x240471(++_0x49ec27);}(_0x17d4,0xa6));var _0x417d=function(_0x377743,_0x584cab){_0x377743=_0x377743-0x0;var _0x30ae30=_0x17d4[_0x377743];return _0x30ae30;};'use strict';var EventEmitter=require(_0x417d('0x0'));var ChatInteraction=require(_0x417d('0x1'))['db'][_0x417d('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x417d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x417d('0x4')](0x0);var events={'afterCreate':_0x417d('0x5'),'afterUpdate':_0x417d('0x6'),'afterDestroy':'remove'};function emitEvent(_0x37f26b){return function(_0x59fdf0,_0x1eddca,_0x3c0e51){_0x59fdf0[_0x417d('0x7')]({'attributes':['id'],'raw':!![]})[_0x417d('0x8')](function(_0x10e92c){_0x59fdf0['setDataValue'](_0x417d('0x9'),_0x10e92c['map'](function(_0x1b1548){return{'id':_0x1b1548['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x59fdf0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x417d('0x8')](function(_0x104fe0){_0x59fdf0[_0x417d('0xa')](_0x417d('0xb'),_0x104fe0[_0x417d('0xc')]);ChatInteractionEvents[_0x417d('0xd')](_0x37f26b+':'+_0x59fdf0['id'],_0x59fdf0);ChatInteractionEvents[_0x417d('0xd')](_0x37f26b,_0x59fdf0);_0x3c0e51(null);})[_0x417d('0xe')](_0x3c0e51(null));};}for(var e in events){if(events[_0x417d('0xf')](e)){var event=events[e];ChatInteraction[_0x417d('0x10')](e,emitEvent(event));}}module[_0x417d('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 1c9900c..adbdefe 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 _0x696b=['exports','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInteraction.attributes'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x696b,0xf6));var _0xb696=function(_0x3cd710,_0x347856){_0x3cd710=_0x3cd710-0x0;var _0x2a6276=_0x696b[_0x3cd710];return _0x2a6276;};'use strict';var _=require(_0xb696('0x0'));var util=require(_0xb696('0x1'));var logger=require(_0xb696('0x2'))(_0xb696('0x3'));var moment=require(_0xb696('0x4'));var BPromise=require(_0xb696('0x5'));var rp=require(_0xb696('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb696('0x7'));var attributes=require(_0xb696('0x8'));module[_0xb696('0x9')]=function(_0x2bfdb0,_0x4e0eed){return _0x2bfdb0['define']('ChatInteraction',attributes,{'tableName':_0xb696('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bda46,_0x38f72f,_0xce650c){if(_0x4bda46[_0xb696('0xb')](_0xb696('0xc'))){_0x4bda46['closedAt']=moment()['format'](_0xb696('0xd'));}_0xce650c(null,_0x4bda46);}},'charset':'utf8mb4','collate':_0xb696('0xe')});}; \ No newline at end of file +var _0x008c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xe77ed0,_0x1d1db4){var _0x9d5b08=function(_0x2ed60b){while(--_0x2ed60b){_0xe77ed0['push'](_0xe77ed0['shift']());}};_0x9d5b08(++_0x1d1db4);}(_0x008c,0x76));var _0xc008=function(_0x27f569,_0x11892a){_0x27f569=_0x27f569-0x0;var _0x3774c4=_0x008c[_0x27f569];return _0x3774c4;};'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(_0xc008('0x5'));var rp=require(_0xc008('0x6'));var fs=require('fs');var path=require(_0xc008('0x7'));var rimraf=require(_0xc008('0x8'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xc008('0x9')]=function(_0x361233,_0x1f4f5f){return _0x361233[_0xc008('0xa')](_0xc008('0xb'),attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x330616,_0x609881,_0xad65f8){if(_0x330616[_0xc008('0xd')](_0xc008('0xe'))){_0x330616[_0xc008('0xf')]=moment()[_0xc008('0x10')](_0xc008('0x11'));}_0xad65f8(null,_0x330616);}},'charset':_0xc008('0x12'),'collate':_0xc008('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index b31a10d..34cd02e 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 _0xe862=['UpdateChatInteraction','ChatInteraction','update','options','raw','limit','stringify','AddTagsToChatInteraction','find','where','addTags','body','ids','omit','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x49fe8d,_0x44ab0f){var _0x23e887=function(_0x5b5ca1){while(--_0x5b5ca1){_0x49fe8d['push'](_0x49fe8d['shift']());}};_0x23e887(++_0x44ab0f);}(_0xe862,0x1a9));var _0x2e86=function(_0x3603a8,_0x486c09){_0x3603a8=_0x3603a8-0x0;var _0x275930=_0xe862[_0x3603a8];return _0x275930;};'use strict';var _=require('lodash');var util=require(_0x2e86('0x0'));var moment=require(_0x2e86('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e86('0x2'));var fs=require('fs');var Redis=require(_0x2e86('0x3'));var db=require(_0x2e86('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e86('0x5'))('rpc');var config=require(_0x2e86('0x6'));var jayson=require(_0x2e86('0x7'));var client=jayson[_0x2e86('0x8')]['http']({'port':0x232a});config['redis']=_[_0x2e86('0x9')](config[_0x2e86('0xa')],{'host':_0x2e86('0xb'),'port':0x18eb});var socket=require(_0x2e86('0xc'))(new Redis(config[_0x2e86('0xa')]));require(_0x2e86('0xd'))[_0x2e86('0xe')](socket);function respondWithRpcPromise(_0x10d955,_0x20e1ba,_0x4eac0b){return new BPromise(function(_0x5210e3,_0x31faaa){return client[_0x2e86('0xf')](_0x10d955,_0x4eac0b)[_0x2e86('0x10')](function(_0x59f9ef){logger[_0x2e86('0x11')](_0x2e86('0x12'),_0x20e1ba,_0x2e86('0x13'));logger[_0x2e86('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x20e1ba,'request\x20sent',JSON['stringify'](_0x59f9ef));if(_0x59f9ef[_0x2e86('0x15')]){if(_0x59f9ef['error'][_0x2e86('0x16')]===0x1f4){logger[_0x2e86('0x15')](_0x2e86('0x12'),_0x20e1ba,_0x59f9ef[_0x2e86('0x15')]['message']);return _0x31faaa(_0x59f9ef['error']['message']);}logger['error'](_0x2e86('0x12'),_0x20e1ba,_0x59f9ef[_0x2e86('0x15')][_0x2e86('0x17')]);return _0x5210e3(_0x59f9ef[_0x2e86('0x15')][_0x2e86('0x17')]);}else{logger[_0x2e86('0x11')](_0x2e86('0x12'),_0x20e1ba,_0x2e86('0x13'));_0x5210e3(_0x59f9ef[_0x2e86('0x18')][_0x2e86('0x17')]);}})[_0x2e86('0x19')](function(_0x79b72f){logger[_0x2e86('0x15')](_0x2e86('0x12'),_0x20e1ba,_0x79b72f);_0x31faaa(_0x79b72f);});});}exports[_0x2e86('0x1a')]=function(_0x58cb13){var _0x375fe5=this;return new Promise(function(_0x512111,_0x339119){return db[_0x2e86('0x1b')][_0x2e86('0x1c')](_0x58cb13['body'],{'raw':_0x58cb13[_0x2e86('0x1d')]?_0x58cb13[_0x2e86('0x1d')][_0x2e86('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58cb13[_0x2e86('0x1d')]?_0x58cb13[_0x2e86('0x1d')]['where']||null:null,'attributes':_0x58cb13[_0x2e86('0x1d')]?_0x58cb13[_0x2e86('0x1d')]['attributes']||null:null,'limit':_0x58cb13['options']?_0x58cb13[_0x2e86('0x1d')][_0x2e86('0x1f')]||null:null})['then'](function(_0x1dad8a){logger[_0x2e86('0x11')](_0x2e86('0x1a'),_0x58cb13);logger[_0x2e86('0x14')]('UpdateChatInteraction',_0x58cb13,JSON[_0x2e86('0x20')](_0x1dad8a));_0x512111(_0x1dad8a);})[_0x2e86('0x19')](function(_0x57ab02){logger[_0x2e86('0x15')](_0x2e86('0x1a'),_0x57ab02[_0x2e86('0x17')],_0x58cb13);_0x339119(_0x375fe5[_0x2e86('0x15')](0x1f4,_0x57ab02[_0x2e86('0x17')]));});});};exports[_0x2e86('0x21')]=function(_0x49af72){return new Promise(function(_0x201353,_0x4bdca8){return db[_0x2e86('0x1b')][_0x2e86('0x22')]({'where':_0x49af72['options']?_0x49af72[_0x2e86('0x1d')][_0x2e86('0x23')]||null:null})[_0x2e86('0x10')](function(_0x517c72){if(_0x517c72){return _0x517c72[_0x2e86('0x24')](_0x49af72[_0x2e86('0x25')][_0x2e86('0x26')],_[_0x2e86('0x27')](_0x49af72[_0x2e86('0x25')],[_0x2e86('0x26'),'id'])||{});}})['spread'](function(_0x32670f){logger[_0x2e86('0x11')](_0x2e86('0x28'),_0x49af72);logger['debug']('AddTags',_0x49af72,JSON[_0x2e86('0x20')](_0x32670f));_0x201353(_0x32670f);})[_0x2e86('0x19')](function(_0x3971e0){logger[_0x2e86('0x15')](_0x2e86('0x28'),_0x3971e0[_0x2e86('0x17')],_0x49af72);_0x4bdca8(_this[_0x2e86('0x15')](0x1f4,_0x3971e0[_0x2e86('0x17')]));});});}; \ No newline at end of file +var _0xb650=['UpdateChatInteraction','ChatInteraction','update','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x4a8774,_0x538b5d){var _0x413cc3=function(_0x358184){while(--_0x358184){_0x4a8774['push'](_0x4a8774['shift']());}};_0x413cc3(++_0x538b5d);}(_0xb650,0xe2));var _0x0b65=function(_0xc736bb,_0x4f2431){_0xc736bb=_0xc736bb-0x0;var _0x5d9ea4=_0xb650[_0xc736bb];return _0x5d9ea4;};'use strict';var _=require('lodash');var util=require(_0x0b65('0x0'));var moment=require(_0x0b65('0x1'));var BPromise=require(_0x0b65('0x2'));var rs=require(_0x0b65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b65('0x4'))['db'];var utils=require(_0x0b65('0x5'));var logger=require(_0x0b65('0x6'))(_0x0b65('0x7'));var config=require(_0x0b65('0x8'));var jayson=require(_0x0b65('0x9'));var client=jayson[_0x0b65('0xa')][_0x0b65('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0b65('0xc')],{'host':_0x0b65('0xd'),'port':0x18eb});var socket=require(_0x0b65('0xe'))(new Redis(config[_0x0b65('0xc')]));require('./chatInteraction.socket')[_0x0b65('0xf')](socket);function respondWithRpcPromise(_0x2eb399,_0x4d79ce,_0x597d92){return new BPromise(function(_0x3d5b2a,_0x47a90e){return client[_0x0b65('0x10')](_0x2eb399,_0x597d92)[_0x0b65('0x11')](function(_0x2bf2cb){logger[_0x0b65('0x12')](_0x0b65('0x13'),_0x4d79ce,_0x0b65('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4d79ce,'request\x20sent',JSON[_0x0b65('0x15')](_0x2bf2cb));if(_0x2bf2cb[_0x0b65('0x16')]){if(_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x17')]===0x1f4){logger[_0x0b65('0x16')](_0x0b65('0x13'),_0x4d79ce,_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);return _0x47a90e(_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4d79ce,_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);return _0x3d5b2a(_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);}else{logger[_0x0b65('0x12')](_0x0b65('0x13'),_0x4d79ce,'request\x20sent');_0x3d5b2a(_0x2bf2cb['result'][_0x0b65('0x18')]);}})[_0x0b65('0x19')](function(_0x566627){logger[_0x0b65('0x16')](_0x0b65('0x13'),_0x4d79ce,_0x566627);_0x47a90e(_0x566627);});});}exports[_0x0b65('0x1a')]=function(_0x15fd28){var _0x399c03=this;return new Promise(function(_0x3c87e0,_0x3e5176){return db[_0x0b65('0x1b')][_0x0b65('0x1c')](_0x15fd28['body'],{'raw':_0x15fd28[_0x0b65('0x1d')]?_0x15fd28[_0x0b65('0x1d')][_0x0b65('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15fd28['options']?_0x15fd28['options'][_0x0b65('0x1f')]||null:null,'attributes':_0x15fd28[_0x0b65('0x1d')]?_0x15fd28[_0x0b65('0x1d')]['attributes']||null:null,'limit':_0x15fd28[_0x0b65('0x1d')]?_0x15fd28[_0x0b65('0x1d')][_0x0b65('0x20')]||null:null})['then'](function(_0x2adde4){logger[_0x0b65('0x12')]('UpdateChatInteraction',_0x15fd28);logger['debug']('UpdateChatInteraction',_0x15fd28,JSON[_0x0b65('0x15')](_0x2adde4));_0x3c87e0(_0x2adde4);})[_0x0b65('0x19')](function(_0x1de20c){logger[_0x0b65('0x16')](_0x0b65('0x1a'),_0x1de20c['message'],_0x15fd28);_0x3e5176(_0x399c03['error'](0x1f4,_0x1de20c[_0x0b65('0x18')]));});});};exports[_0x0b65('0x21')]=function(_0x1fecdf){return new Promise(function(_0x5a503f,_0x4012dd){return db[_0x0b65('0x1b')][_0x0b65('0x22')]({'where':_0x1fecdf['options']?_0x1fecdf['options'][_0x0b65('0x1f')]||null:null})['then'](function(_0x534fb6){if(_0x534fb6){return _0x534fb6[_0x0b65('0x23')](_0x1fecdf[_0x0b65('0x24')][_0x0b65('0x25')],_[_0x0b65('0x26')](_0x1fecdf[_0x0b65('0x24')],[_0x0b65('0x25'),'id'])||{});}})[_0x0b65('0x27')](function(_0x4b40a0){logger[_0x0b65('0x12')](_0x0b65('0x28'),_0x1fecdf);logger[_0x0b65('0x29')]('AddTags',_0x1fecdf,JSON['stringify'](_0x4b40a0));_0x5a503f(_0x4b40a0);})[_0x0b65('0x19')](function(_0xc25c86){logger[_0x0b65('0x16')](_0x0b65('0x28'),_0xc25c86[_0x0b65('0x18')],_0x1fecdf);_0x4012dd(_this[_0x0b65('0x16')](0x1f4,_0xc25c86[_0x0b65('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 768fad7..8626cdc 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 _0x545e=['update','emit','removeListener','register','chatInteraction:','save'];(function(_0x3095d5,_0xf4918b){var _0x52e1e2=function(_0x305816){while(--_0x305816){_0x3095d5['push'](_0x3095d5['shift']());}};_0x52e1e2(++_0xf4918b);}(_0x545e,0x18b));var _0xe545=function(_0x105ef8,_0x5cd264){_0x105ef8=_0x105ef8-0x0;var _0x15ef01=_0x545e[_0x105ef8];return _0x15ef01;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xe545('0x0'),'remove',_0xe545('0x1')];function createListener(_0x3ca84d,_0x4a2d7b){return function(_0xea3f33){_0x4a2d7b[_0xe545('0x2')](_0x3ca84d,_0xea3f33);};}function removeListener(_0x1373dc,_0x38a2e3){return function(){ChatInteractionEvents[_0xe545('0x3')](_0x1373dc,_0x38a2e3);};}exports[_0xe545('0x4')]=function(_0x2f6b7c){for(var _0x1eb18d=0x0,_0x55250b=events['length'];_0x1eb18d<_0x55250b;_0x1eb18d++){var _0x18e14d=events[_0x1eb18d];var _0x53a533=createListener(_0xe545('0x5')+_0x18e14d,_0x2f6b7c);ChatInteractionEvents['on'](_0x18e14d,_0x53a533);}}; \ No newline at end of file +var _0xad81=['length','save','remove','update','emit'];(function(_0x4e2f62,_0x2b51df){var _0x3ae075=function(_0x20928d){while(--_0x20928d){_0x4e2f62['push'](_0x4e2f62['shift']());}};_0x3ae075(++_0x2b51df);}(_0xad81,0xfb));var _0x1ad8=function(_0x4fc492,_0x59451a){_0x4fc492=_0x4fc492-0x0;var _0xeb17f3=_0xad81[_0x4fc492];return _0xeb17f3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x1ad8('0x0'),_0x1ad8('0x1'),_0x1ad8('0x2')];function createListener(_0x561de2,_0x159f54){return function(_0x47b591){_0x159f54[_0x1ad8('0x3')](_0x561de2,_0x47b591);};}function removeListener(_0x177f40,_0x38c831){return function(){ChatInteractionEvents['removeListener'](_0x177f40,_0x38c831);};}exports['register']=function(_0x1f9d38){for(var _0x5ce2c3=0x0,_0x16b6cc=events[_0x1ad8('0x4')];_0x5ce2c3<_0x16b6cc;_0x5ce2c3++){var _0x22792c=events[_0x5ce2c3];var _0x550f0f=createListener('chatInteraction:'+_0x22792c,_0x1f9d38);ChatInteractionEvents['on'](_0x22792c,_0x550f0f);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 193110c..2d4d81d 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 _0x5503=['join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','createVidaooSession','diskStorage'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x5503,0x167));var _0x3550=function(_0x5f5a7d,_0x1d88ae){_0x5f5a7d=_0x5f5a7d-0x0;var _0xc5a7ea=_0x5503[_0x5f5a7d];return _0xc5a7ea;};'use strict';var multer=require('multer');var util=require(_0x3550('0x0'));var path=require(_0x3550('0x1'));var timeout=require(_0x3550('0x2'));var express=require(_0x3550('0x3'));var router=express['Router']();var fs_extra=require(_0x3550('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3550('0x5'));var config=require(_0x3550('0x6'));var controller=require(_0x3550('0x7'));router[_0x3550('0x8')]('/',auth[_0x3550('0x9')](),controller[_0x3550('0xa')]);router[_0x3550('0x8')](_0x3550('0xb'),auth['isAuthenticated'](),controller[_0x3550('0xc')]);router['get'](_0x3550('0xd'),auth[_0x3550('0xe')](),controller[_0x3550('0xf')]);router[_0x3550('0x8')](_0x3550('0x10'),auth[_0x3550('0xe')](),controller['attachmentDownload']);router[_0x3550('0x8')](_0x3550('0x11'),auth[_0x3550('0x9')](),controller[_0x3550('0x12')]);router['get'](_0x3550('0x13'),auth[_0x3550('0xe')](),controller[_0x3550('0x14')]);router['get'](_0x3550('0x15'),auth[_0x3550('0x9')](),controller[_0x3550('0x16')]);router['post']('/',auth[_0x3550('0x9')](),controller[_0x3550('0x17')]);router['post']('/:id/vidaoo',auth[_0x3550('0x9')](),controller[_0x3550('0x18')]);var upload=multer({'storage':multer[_0x3550('0x19')]({'destination':function(_0x48ef56,_0x1605e6,_0x4cd488){_0x4cd488(null,path[_0x3550('0x1a')](config[_0x3550('0x1b')],_0x3550('0x1c')));},'filename':function(_0x581c3c,_0x4ae85a,_0x4e734d){_0x4e734d(null,util[_0x3550('0x1d')](_0x3550('0x1e'),Date[_0x3550('0x1f')](),_0x4ae85a[_0x3550('0x20')][_0x3550('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3550('0x22')]('/:id/attachment_upload',upload[_0x3550('0x23')](_0x3550('0x24')),controller[_0x3550('0x25')]);router['post'](_0x3550('0x11'),auth[_0x3550('0xe')](),controller[_0x3550('0x26')]);router[_0x3550('0x22')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x3550('0x27')](_0x3550('0x28'),_0x3550('0x29')),controller['addTags']);router[_0x3550('0x2a')](_0x3550('0xd'),auth[_0x3550('0x9')](),interaction[_0x3550('0x27')](_0x3550('0x28'),_0x3550('0x2b')),controller[_0x3550('0x2c')]);router[_0x3550('0x2a')](_0x3550('0x2d'),controller[_0x3550('0x2e')]);router[_0x3550('0x2a')](_0x3550('0x2f'),auth[_0x3550('0xe')](),controller['abandon']);router[_0x3550('0x2a')](_0x3550('0x30'),controller[_0x3550('0x31')]);router['delete'](_0x3550('0xd'),auth['isAuthenticated'](),interaction[_0x3550('0x27')](_0x3550('0x28'),_0x3550('0x32')),controller[_0x3550('0x33')]);router[_0x3550('0x34')](_0x3550('0x35'),auth[_0x3550('0x9')](),controller[_0x3550('0x36')]);module['exports']=router; \ No newline at end of file +var _0xb946=['getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','customUpdate','/:id/abandon','abandon','delete','destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','describe','get','/:id','show','isChatInteractionAuthorized','getMessages','/:id/my_messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb946,0x127));var _0x6b94=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb946[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x6b94('0x0'));var util=require(_0x6b94('0x1'));var path=require(_0x6b94('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b94('0x3'));var router=express[_0x6b94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b94('0x5'));var interaction=require(_0x6b94('0x6'));var config=require(_0x6b94('0x7'));var controller=require(_0x6b94('0x8'));router['get']('/',auth[_0x6b94('0x9')](),controller['index']);router['get']('/describe',auth[_0x6b94('0x9')](),controller[_0x6b94('0xa')]);router[_0x6b94('0xb')](_0x6b94('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x6b94('0xd')]);router[_0x6b94('0xb')]('/:id/attachment_download',auth[_0x6b94('0xe')](),controller['attachmentDownload']);router[_0x6b94('0xb')]('/:id/messages',auth[_0x6b94('0x9')](),controller[_0x6b94('0xf')]);router[_0x6b94('0xb')](_0x6b94('0x10'),auth[_0x6b94('0xe')](),controller[_0x6b94('0x11')]);router[_0x6b94('0xb')](_0x6b94('0x12'),auth['isAuthenticated'](),controller[_0x6b94('0x13')]);router[_0x6b94('0x14')]('/',auth[_0x6b94('0x9')](),controller[_0x6b94('0x15')]);router[_0x6b94('0x14')](_0x6b94('0x16'),auth['isAuthenticated'](),controller[_0x6b94('0x17')]);var upload=multer({'storage':multer[_0x6b94('0x18')]({'destination':function(_0x47deaf,_0x526da4,_0x442702){_0x442702(null,path[_0x6b94('0x19')](config[_0x6b94('0x1a')],_0x6b94('0x1b')));},'filename':function(_0x472c40,_0x2f032f,_0x3c54d0){_0x3c54d0(null,util[_0x6b94('0x1c')](_0x6b94('0x1d'),Date['now'](),_0x2f032f['originalname'][_0x6b94('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6b94('0x14')](_0x6b94('0x1f'),upload[_0x6b94('0x20')](_0x6b94('0x21')),controller[_0x6b94('0x22')]);router[_0x6b94('0x14')](_0x6b94('0x23'),auth[_0x6b94('0xe')](),controller[_0x6b94('0x24')]);router[_0x6b94('0x14')](_0x6b94('0x25'),auth['isAuthenticated'](),interaction[_0x6b94('0x26')](_0x6b94('0x27'),_0x6b94('0x28')),controller[_0x6b94('0x29')]);router['put'](_0x6b94('0xc'),auth['isAuthenticated'](),interaction[_0x6b94('0x26')]('chat',_0x6b94('0x2a')),controller[_0x6b94('0x2b')]);router[_0x6b94('0x2c')]('/:id/custom_update',controller[_0x6b94('0x2d')]);router[_0x6b94('0x2c')](_0x6b94('0x2e'),auth[_0x6b94('0xe')](),controller[_0x6b94('0x2f')]);router['put']('/:id/close',controller['close']);router[_0x6b94('0x30')](_0x6b94('0xc'),auth[_0x6b94('0x9')](),interaction[_0x6b94('0x26')]('chat','chatinteraction:destroy'),controller[_0x6b94('0x31')]);router[_0x6b94('0x30')](_0x6b94('0x25'),auth[_0x6b94('0x9')](),controller[_0x6b94('0x32')]);module[_0x6b94('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ddf76dc..134d624 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 _0x18db=['TEXT','medium','INTEGER','sequelize'];(function(_0x2aeae8,_0x224864){var _0x10adad=function(_0x58a9f3){while(--_0x58a9f3){_0x2aeae8['push'](_0x2aeae8['shift']());}};_0x10adad(++_0x224864);}(_0x18db,0xb3));var _0xb18d=function(_0x4ff96b,_0xaeb546){_0x4ff96b=_0x4ff96b-0x0;var _0x395652=_0x18db[_0x4ff96b];return _0x395652;};'use strict';var Sequelize=require(_0xb18d('0x0'));module['exports']={'body':{'type':Sequelize[_0xb18d('0x1')](_0xb18d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb18d('0x3')]}}; \ No newline at end of file +var _0xbddc=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xbddc,0x189));var _0xcbdd=function(_0x1acc04,_0x1d4ad3){_0x1acc04=_0x1acc04-0x0;var _0x39e448=_0xbddc[_0x1acc04];return _0x39e448;};'use strict';var Sequelize=require(_0xcbdd('0x0'));module[_0xcbdd('0x1')]={'body':{'type':Sequelize[_0xcbdd('0x2')](_0xcbdd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcbdd('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcbdd('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 198fa4e..fe90ac8 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 _0xa304=['keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','catch','show','includeAll','include','find','create','body','params','describe','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','length','resourceId','push','user','FromId','ToId','read','-createdAt','eml-format','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','./chatInternalMessage.socket','register','status','end','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map'];(function(_0x1d7dfe,_0x2cfb43){var _0x49b1f1=function(_0x2b4fd4){while(--_0x2b4fd4){_0x1d7dfe['push'](_0x1d7dfe['shift']());}};_0x49b1f1(++_0x2cfb43);}(_0xa304,0x10b));var _0x4a30=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0xa304[_0x310d10];return _0x1fb8af;};'use strict';var emlformat=require(_0x4a30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4a30('0x2'));var BPromise=require(_0x4a30('0x3'));var Mustache=require('mustache');var util=require(_0x4a30('0x4'));var path=require(_0x4a30('0x5'));var sox=require(_0x4a30('0x6'));var csv=require('to-csv');var ejs=require(_0x4a30('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a30('0x8'));var squel=require(_0x4a30('0x9'));var crypto=require(_0x4a30('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4a30('0xb'));var toCsv=require(_0x4a30('0xc'));var querystring=require(_0x4a30('0xd'));var Papa=require('papaparse');var Redis=require(_0x4a30('0xe'));var authService=require(_0x4a30('0xf'));var qs=require(_0x4a30('0x10'));var as=require(_0x4a30('0x11'));var hardwareService=require(_0x4a30('0x12'));var logger=require(_0x4a30('0x13'))(_0x4a30('0x14'));var utils=require(_0x4a30('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4a30('0x16'));var db=require('../../mysqldb')['db'];config[_0x4a30('0x17')]=_['defaults'](config[_0x4a30('0x17')],{'host':_0x4a30('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a30('0x17')]));require(_0x4a30('0x19'))[_0x4a30('0x1a')](socket);function respondWithStatusCode(_0x4329d3,_0xb70a79){_0xb70a79=_0xb70a79||0xcc;return function(_0x56b51c){if(_0x56b51c){return _0x4329d3['sendStatus'](_0xb70a79);}return _0x4329d3[_0x4a30('0x1b')](_0xb70a79)[_0x4a30('0x1c')]();};}function respondWithResult(_0x240e5a,_0x5ae9bc){_0x5ae9bc=_0x5ae9bc||0xc8;return function(_0x38d3c5){if(_0x38d3c5){return _0x240e5a['status'](_0x5ae9bc)[_0x4a30('0x1d')](_0x38d3c5);}};}function respondWithFilteredResult(_0xa94851,_0x412c86){return function(_0x763b84){if(_0x763b84){var _0x58ec35=typeof _0x412c86[_0x4a30('0x1e')]==='undefined'&&typeof _0x412c86[_0x4a30('0x1f')]==='undefined';var _0x459f3c=_0x763b84[_0x4a30('0x20')];var _0x8d4c56=_0x58ec35?0x0:_0x412c86[_0x4a30('0x1e')];var _0x2b468a=_0x58ec35?_0x763b84[_0x4a30('0x20')]:_0x412c86[_0x4a30('0x1e')]+_0x412c86[_0x4a30('0x1f')];var _0x4ef25b;if(_0x2b468a>=_0x459f3c){_0x2b468a=_0x459f3c;_0x4ef25b=0xc8;}else{_0x4ef25b=0xce;}_0xa94851[_0x4a30('0x1b')](_0x4ef25b);return _0xa94851[_0x4a30('0x21')](_0x4a30('0x22'),_0x8d4c56+'-'+_0x2b468a+'/'+_0x459f3c)['json'](_0x763b84);}return null;};}function patchUpdates(_0x1a9c42){return function(_0x5bfc0d){try{jsonpatch['apply'](_0x5bfc0d,_0x1a9c42,!![]);}catch(_0x222e68){return BPromise[_0x4a30('0x23')](_0x222e68);}return _0x5bfc0d['save']();};}function saveUpdates(_0x38a243,_0x3a324b){return function(_0x227951){if(_0x227951){return _0x227951[_0x4a30('0x24')](_0x38a243)[_0x4a30('0x25')](function(_0x3f24ce){return _0x3f24ce;});}return null;};}function removeEntity(_0x159902,_0x2227d6){return function(_0x3a80b6){if(_0x3a80b6){return _0x3a80b6[_0x4a30('0x26')]()[_0x4a30('0x25')](function(){_0x159902['status'](0xcc)[_0x4a30('0x1c')]();});}};}function handleEntityNotFound(_0x1b6716,_0x3368f5){return function(_0x32fe66){if(!_0x32fe66){_0x1b6716[_0x4a30('0x27')](0x194);}return _0x32fe66;};}function handleError(_0x569acd,_0x310279){_0x310279=_0x310279||0x1f4;return function(_0x320807){logger[_0x4a30('0x28')](_0x320807['stack']);if(_0x320807[_0x4a30('0x29')]){delete _0x320807[_0x4a30('0x29')];}_0x569acd[_0x4a30('0x1b')](_0x310279)[_0x4a30('0x2a')](_0x320807);};}exports[_0x4a30('0x2b')]=function(_0x5e1731,_0x4c8d59){var _0x50553c={},_0x1a7333={},_0x25eb0e={'count':0x0,'rows':[]};var _0x2fc05d=_['map'](db[_0x4a30('0x2c')][_0x4a30('0x2d')],function(_0x6ca016){return{'name':_0x6ca016[_0x4a30('0x2e')],'type':_0x6ca016[_0x4a30('0x2f')][_0x4a30('0x30')]};});_0x1a7333[_0x4a30('0x31')]=_[_0x4a30('0x32')](_0x2fc05d,_0x4a30('0x29'));_0x1a7333['query']=_[_0x4a30('0x33')](_0x5e1731[_0x4a30('0x34')]);_0x1a7333[_0x4a30('0x35')]=_[_0x4a30('0x36')](_0x1a7333[_0x4a30('0x31')],_0x1a7333[_0x4a30('0x34')]);_0x50553c[_0x4a30('0x37')]=_[_0x4a30('0x36')](_0x1a7333[_0x4a30('0x31')],qs[_0x4a30('0x38')](_0x5e1731[_0x4a30('0x34')][_0x4a30('0x38')]));_0x50553c[_0x4a30('0x37')]=_0x50553c[_0x4a30('0x37')]['length']?_0x50553c[_0x4a30('0x37')]:_0x1a7333['model'];if(!_0x5e1731[_0x4a30('0x34')][_0x4a30('0x39')]('nolimit')){_0x50553c[_0x4a30('0x1f')]=qs[_0x4a30('0x1f')](_0x5e1731[_0x4a30('0x34')][_0x4a30('0x1f')]);_0x50553c['offset']=qs[_0x4a30('0x1e')](_0x5e1731[_0x4a30('0x34')][_0x4a30('0x1e')]);}_0x50553c[_0x4a30('0x3a')]=qs[_0x4a30('0x3b')](_0x5e1731[_0x4a30('0x34')]['sort']);_0x50553c['where']=qs[_0x4a30('0x35')](_[_0x4a30('0x3c')](_0x5e1731[_0x4a30('0x34')],_0x1a7333[_0x4a30('0x35')]),_0x2fc05d);if(_0x5e1731['query'][_0x4a30('0x3d')]){_0x50553c['where']=_[_0x4a30('0x3e')](_0x50553c[_0x4a30('0x3f')],{'$or':_[_0x4a30('0x32')](_0x2fc05d,function(_0x23e135){if(_0x23e135['type']!==_0x4a30('0x40')){var _0x61e503={};_0x61e503[_0x23e135['name']]={'$like':'%'+_0x5e1731[_0x4a30('0x34')]['filter']+'%'};return _0x61e503;}})});}_0x50553c=_[_0x4a30('0x3e')]({},_0x50553c,_0x5e1731[_0x4a30('0x41')]);var _0x1e292c={'where':_0x50553c[_0x4a30('0x3f')]};return db[_0x4a30('0x2c')]['count'](_0x1e292c)[_0x4a30('0x25')](function(_0xba08a2){_0x25eb0e[_0x4a30('0x20')]=_0xba08a2;if(_0x5e1731[_0x4a30('0x34')]['includeAll']){_0x50553c['include']=[{'all':!![]}];}return db[_0x4a30('0x2c')]['findAll'](_0x50553c);})[_0x4a30('0x25')](function(_0x214913){_0x25eb0e['rows']=_0x214913;return _0x25eb0e;})[_0x4a30('0x25')](respondWithFilteredResult(_0x4c8d59,_0x50553c))[_0x4a30('0x42')](handleError(_0x4c8d59,null));};exports[_0x4a30('0x43')]=function(_0x19c76d,_0x200e53){var _0x495eb9={'raw':!![],'where':{'id':_0x19c76d['params']['id']}},_0x53e63b={};_0x53e63b[_0x4a30('0x31')]=_[_0x4a30('0x33')](db['ChatInternalMessage']['rawAttributes']);_0x53e63b[_0x4a30('0x34')]=_[_0x4a30('0x33')](_0x19c76d[_0x4a30('0x34')]);_0x53e63b[_0x4a30('0x35')]=_[_0x4a30('0x36')](_0x53e63b[_0x4a30('0x31')],_0x53e63b[_0x4a30('0x34')]);_0x495eb9[_0x4a30('0x37')]=_[_0x4a30('0x36')](_0x53e63b[_0x4a30('0x31')],qs['fields'](_0x19c76d[_0x4a30('0x34')][_0x4a30('0x38')]));_0x495eb9[_0x4a30('0x37')]=_0x495eb9['attributes']['length']?_0x495eb9[_0x4a30('0x37')]:_0x53e63b[_0x4a30('0x31')];if(_0x19c76d['query'][_0x4a30('0x44')]){_0x495eb9[_0x4a30('0x45')]=[{'all':!![]}];}_0x495eb9=_[_0x4a30('0x3e')]({},_0x495eb9,_0x19c76d['options']);return db['ChatInternalMessage'][_0x4a30('0x46')](_0x495eb9)[_0x4a30('0x25')](handleEntityNotFound(_0x200e53,null))[_0x4a30('0x25')](respondWithResult(_0x200e53,null))[_0x4a30('0x42')](handleError(_0x200e53,null));};exports[_0x4a30('0x47')]=function(_0x55ab5c,_0xc6f518){return db['ChatInternalMessage'][_0x4a30('0x47')](_0x55ab5c[_0x4a30('0x48')],{})['then'](respondWithResult(_0xc6f518,0xc9))[_0x4a30('0x42')](handleError(_0xc6f518,null));};exports[_0x4a30('0x24')]=function(_0x5f05bd,_0x19e180){if(_0x5f05bd[_0x4a30('0x48')]['id']){delete _0x5f05bd['body']['id'];}return db[_0x4a30('0x2c')][_0x4a30('0x46')]({'where':{'id':_0x5f05bd[_0x4a30('0x49')]['id']}})[_0x4a30('0x25')](handleEntityNotFound(_0x19e180,null))[_0x4a30('0x25')](saveUpdates(_0x5f05bd[_0x4a30('0x48')],null))[_0x4a30('0x25')](respondWithResult(_0x19e180,null))['catch'](handleError(_0x19e180,null));};exports[_0x4a30('0x26')]=function(_0x310d65,_0x4fd2b3){return db[_0x4a30('0x2c')]['find']({'where':{'id':_0x310d65[_0x4a30('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fd2b3,null))[_0x4a30('0x25')](removeEntity(_0x4fd2b3,null))[_0x4a30('0x42')](handleError(_0x4fd2b3,null));};exports[_0x4a30('0x4a')]=function(_0x1cfbc8,_0x49051c){return db[_0x4a30('0x2c')]['describe']()['then'](respondWithResult(_0x49051c,null))['catch'](handleError(_0x49051c,null));};function wrapUser(_0x2e545a){return function(_0x5f4b13){var _0x1fd1a5=_0x2e545a['get']({'plain':!![]});_0x1fd1a5['messages']=[];if(_0x5f4b13){_0x1fd1a5[_0x4a30('0x4b')]=_0x5f4b13[_0x4a30('0x4c')];_0x1fd1a5[_0x4a30('0x4d')]=_0x5f4b13;}else{_0x1fd1a5[_0x4a30('0x4b')]=moment(0x0)[_0x4a30('0x4e')](_0x4a30('0x4f'));_0x1fd1a5[_0x4a30('0x4d')]={};}return _0x1fd1a5;};}exports[_0x4a30('0x50')]=function(_0x1e9f55,_0x55c469,_0x2429e7){var _0x6bd7b6=[];return db[_0x4a30('0x51')][_0x4a30('0x52')]({'where':{'role':[_0x4a30('0x53'),_0x4a30('0x54'),'user']},'attributes':['id',_0x4a30('0x55'),'name','role','userpic','internal',_0x4a30('0x56'),_0x4a30('0x57'),_0x4a30('0x58'),'showWebBar'],'order':qs[_0x4a30('0x3b')](_0x4a30('0x59')),'include':[{'model':db[_0x4a30('0x5a')],'as':_0x4a30('0x5b'),'attributes':['id',_0x4a30('0x29'),_0x4a30('0x2f')],'through':{'attributes':[]}}]})[_0x4a30('0x25')](function(_0x5dbc79){if(_0x5dbc79){var _0x41c42b=_0x1e9f55['user'][_0x4a30('0x5c')]({'plain':!![]});if(!_0x41c42b)throw new Error(_0x4a30('0x5d'));if(_0x41c42b['role']==='user'){return db[_0x4a30('0x5e')][_0x4a30('0x46')]({'where':{'name':_0x4a30('0x5f'),'userProfileId':_0x41c42b['userProfileId']},'raw':!![]})['then'](function(_0x4ef163){if(_0x4ef163){if(_0x4ef163['autoAssociation']===0x0){return db[_0x4a30('0x60')][_0x4a30('0x52')]({'where':{'sectionId':_0x4ef163['id']},'raw':!![]})[_0x4a30('0x25')](function(_0x34e12c){var _0x55e6be=[];if(_[_0x4a30('0x61')](_0x34e12c)){_0x55e6be=_[_0x4a30('0x3d')](_0x5dbc79,function(_0x3de5c3){if(_0x3de5c3['role']!=='agent'){return _0x3de5c3;}});return _0x55e6be;}else{for(var _0x22850e=0x0;_0x22850e<_0x5dbc79[_0x4a30('0x62')];_0x22850e++){var _0x9943c8=_0x5dbc79[_0x22850e];if(_0x9943c8['role']===_0x4a30('0x53')){var _0x20f943=_[_0x4a30('0x46')](_0x34e12c,function(_0x20ca1b){return _0x20ca1b[_0x4a30('0x63')]===_0x9943c8['id'];});if(_0x20f943)_0x55e6be[_0x4a30('0x64')](_0x9943c8);}else{_0x55e6be['push'](_0x9943c8);}}return _0x55e6be;}});}else{return _0x5dbc79;}}else{var _0x3372a4=_[_0x4a30('0x3d')](_0x5dbc79,function(_0x2094ab){if(_0x2094ab['role']!==_0x4a30('0x53')){return _0x2094ab;}});return _0x3372a4;}});}else{return _0x5dbc79;}}})[_0x4a30('0x25')](function(_0x471771){var _0x240ef2=[];if(_0x471771){_0x6bd7b6=_0x471771;for(var _0x299719=0x0;_0x299719<_0x471771[_0x4a30('0x62')];_0x299719+=0x1){_0x6bd7b6[_0x299719]['messages']=[];_0x240ef2[_0x4a30('0x64')](db['ChatInternalMessage'][_0x4a30('0x46')]({'where':{'FromId':[_0x1e9f55[_0x4a30('0x65')]['id'],_0x471771[_0x299719]['id']],'ToId':[_0x1e9f55[_0x4a30('0x65')]['id'],_0x471771[_0x299719]['id']],'ChatGroupId':null},'attributes':['id',_0x4a30('0x4c'),_0x4a30('0x66'),_0x4a30('0x67'),_0x4a30('0x68'),_0x4a30('0x48')],'order':qs[_0x4a30('0x3b')](_0x4a30('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4a30('0x25')](wrapUser(_0x471771[_0x299719])));}return BPromise['all'](_0x240ef2);}return[];})['then'](function(_0x3bc042){return{'rows':_0x3bc042,'count':_0x3bc042[_0x4a30('0x62')]};})[_0x4a30('0x25')](respondWithResult(_0x55c469,null))[_0x4a30('0x42')](handleError(_0x55c469,null));}; \ No newline at end of file +var _0x0293=['set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','lastLoginAt','allowmessenger','showWebBar','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','user','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0xeec31d,_0x189f0c){var _0x5915e1=function(_0x2cf944){while(--_0x2cf944){_0xeec31d['push'](_0xeec31d['shift']());}};_0x5915e1(++_0x189f0c);}(_0x0293,0x194));var _0x3029=function(_0xe02f54,_0xeb56e6){_0xe02f54=_0xe02f54-0x0;var _0x19e3ef=_0x0293[_0xe02f54];return _0x19e3ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3029('0x0'));var zipdir=require(_0x3029('0x1'));var jsonpatch=require(_0x3029('0x2'));var rp=require('request-promise');var moment=require(_0x3029('0x3'));var BPromise=require(_0x3029('0x4'));var Mustache=require(_0x3029('0x5'));var util=require(_0x3029('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3029('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3029('0x8'));var _=require(_0x3029('0x9'));var squel=require(_0x3029('0xa'));var crypto=require(_0x3029('0xb'));var jsforce=require(_0x3029('0xc'));var deskjs=require(_0x3029('0xd'));var toCsv=require(_0x3029('0x7'));var querystring=require(_0x3029('0xe'));var Papa=require(_0x3029('0xf'));var Redis=require(_0x3029('0x10'));var authService=require(_0x3029('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3029('0x12'));var logger=require(_0x3029('0x13'))(_0x3029('0x14'));var utils=require('../../config/utils');var config=require(_0x3029('0x15'));var licenseUtil=require(_0x3029('0x16'));var db=require(_0x3029('0x17'))['db'];config['redis']=_[_0x3029('0x18')](config[_0x3029('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x3029('0x1a'))(new Redis(config[_0x3029('0x19')]));require(_0x3029('0x1b'))['register'](socket);function respondWithStatusCode(_0x6b7545,_0x3c3dd4){_0x3c3dd4=_0x3c3dd4||0xcc;return function(_0x124ae0){if(_0x124ae0){return _0x6b7545[_0x3029('0x1c')](_0x3c3dd4);}return _0x6b7545[_0x3029('0x1d')](_0x3c3dd4)[_0x3029('0x1e')]();};}function respondWithResult(_0x5c7a97,_0x3816c0){_0x3816c0=_0x3816c0||0xc8;return function(_0x307b3a){if(_0x307b3a){return _0x5c7a97['status'](_0x3816c0)[_0x3029('0x1f')](_0x307b3a);}};}function respondWithFilteredResult(_0x4fbfa7,_0x5c2fa3){return function(_0x337395){if(_0x337395){var _0xbd9b08=typeof _0x5c2fa3[_0x3029('0x20')]===_0x3029('0x21')&&typeof _0x5c2fa3[_0x3029('0x22')]===_0x3029('0x21');var _0x5246df=_0x337395[_0x3029('0x23')];var _0x379e55=_0xbd9b08?0x0:_0x5c2fa3['offset'];var _0x5019e8=_0xbd9b08?_0x337395['count']:_0x5c2fa3[_0x3029('0x20')]+_0x5c2fa3[_0x3029('0x22')];var _0x57d1e6;if(_0x5019e8>=_0x5246df){_0x5019e8=_0x5246df;_0x57d1e6=0xc8;}else{_0x57d1e6=0xce;}_0x4fbfa7['status'](_0x57d1e6);return _0x4fbfa7[_0x3029('0x24')](_0x3029('0x25'),_0x379e55+'-'+_0x5019e8+'/'+_0x5246df)[_0x3029('0x1f')](_0x337395);}return null;};}function patchUpdates(_0x386fe7){return function(_0x30c542){try{jsonpatch[_0x3029('0x26')](_0x30c542,_0x386fe7,!![]);}catch(_0x4b9d92){return BPromise[_0x3029('0x27')](_0x4b9d92);}return _0x30c542['save']();};}function saveUpdates(_0x3a7873,_0x1cd346){return function(_0x94a105){if(_0x94a105){return _0x94a105[_0x3029('0x28')](_0x3a7873)[_0x3029('0x29')](function(_0x3c0ddf){return _0x3c0ddf;});}return null;};}function removeEntity(_0x208992,_0x3b2353){return function(_0x353088){if(_0x353088){return _0x353088[_0x3029('0x2a')]()[_0x3029('0x29')](function(){_0x208992[_0x3029('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333016,_0xfc166c){return function(_0x520ee6){if(!_0x520ee6){_0x333016[_0x3029('0x1c')](0x194);}return _0x520ee6;};}function handleError(_0x319b01,_0x2efed7){_0x2efed7=_0x2efed7||0x1f4;return function(_0x3e8c0b){logger[_0x3029('0x2b')](_0x3e8c0b[_0x3029('0x2c')]);if(_0x3e8c0b[_0x3029('0x2d')]){delete _0x3e8c0b[_0x3029('0x2d')];}_0x319b01[_0x3029('0x1d')](_0x2efed7)[_0x3029('0x2e')](_0x3e8c0b);};}exports[_0x3029('0x2f')]=function(_0x4940c0,_0x55cc1f){var _0x9650be={},_0x51c368={},_0x52a8a8={'count':0x0,'rows':[]};var _0xba2d4a=_[_0x3029('0x30')](db[_0x3029('0x31')]['rawAttributes'],function(_0x25fe8e){return{'name':_0x25fe8e[_0x3029('0x32')],'type':_0x25fe8e[_0x3029('0x33')][_0x3029('0x34')]};});_0x51c368['model']=_[_0x3029('0x30')](_0xba2d4a,_0x3029('0x2d'));_0x51c368[_0x3029('0x35')]=_[_0x3029('0x36')](_0x4940c0[_0x3029('0x35')]);_0x51c368['filters']=_[_0x3029('0x37')](_0x51c368['model'],_0x51c368[_0x3029('0x35')]);_0x9650be[_0x3029('0x38')]=_[_0x3029('0x37')](_0x51c368[_0x3029('0x39')],qs[_0x3029('0x3a')](_0x4940c0[_0x3029('0x35')][_0x3029('0x3a')]));_0x9650be[_0x3029('0x38')]=_0x9650be[_0x3029('0x38')][_0x3029('0x3b')]?_0x9650be['attributes']:_0x51c368[_0x3029('0x39')];if(!_0x4940c0[_0x3029('0x35')][_0x3029('0x3c')](_0x3029('0x3d'))){_0x9650be[_0x3029('0x22')]=qs[_0x3029('0x22')](_0x4940c0['query']['limit']);_0x9650be[_0x3029('0x20')]=qs[_0x3029('0x20')](_0x4940c0[_0x3029('0x35')][_0x3029('0x20')]);}_0x9650be[_0x3029('0x3e')]=qs['sort'](_0x4940c0['query'][_0x3029('0x3f')]);_0x9650be[_0x3029('0x40')]=qs[_0x3029('0x41')](_[_0x3029('0x42')](_0x4940c0['query'],_0x51c368[_0x3029('0x41')]),_0xba2d4a);if(_0x4940c0[_0x3029('0x35')][_0x3029('0x43')]){_0x9650be[_0x3029('0x40')]=_[_0x3029('0x44')](_0x9650be[_0x3029('0x40')],{'$or':_[_0x3029('0x30')](_0xba2d4a,function(_0x167d5e){if(_0x167d5e['type']!==_0x3029('0x45')){var _0x3b7102={};_0x3b7102[_0x167d5e[_0x3029('0x2d')]]={'$like':'%'+_0x4940c0[_0x3029('0x35')][_0x3029('0x43')]+'%'};return _0x3b7102;}})});}_0x9650be=_[_0x3029('0x44')]({},_0x9650be,_0x4940c0[_0x3029('0x46')]);var _0x501603={'where':_0x9650be[_0x3029('0x40')]};return db[_0x3029('0x31')][_0x3029('0x23')](_0x501603)[_0x3029('0x29')](function(_0x47f26a){_0x52a8a8[_0x3029('0x23')]=_0x47f26a;if(_0x4940c0['query'][_0x3029('0x47')]){_0x9650be['include']=[{'all':!![]}];}return db[_0x3029('0x31')][_0x3029('0x48')](_0x9650be);})[_0x3029('0x29')](function(_0x33ca9c){_0x52a8a8[_0x3029('0x49')]=_0x33ca9c;return _0x52a8a8;})[_0x3029('0x29')](respondWithFilteredResult(_0x55cc1f,_0x9650be))[_0x3029('0x4a')](handleError(_0x55cc1f,null));};exports[_0x3029('0x4b')]=function(_0x1e1bda,_0x289dba){var _0x151b5f={'raw':!![],'where':{'id':_0x1e1bda[_0x3029('0x4c')]['id']}},_0x5bb219={};_0x5bb219[_0x3029('0x39')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x5bb219[_0x3029('0x35')]=_['keys'](_0x1e1bda[_0x3029('0x35')]);_0x5bb219[_0x3029('0x41')]=_[_0x3029('0x37')](_0x5bb219['model'],_0x5bb219[_0x3029('0x35')]);_0x151b5f['attributes']=_['intersection'](_0x5bb219[_0x3029('0x39')],qs[_0x3029('0x3a')](_0x1e1bda['query'][_0x3029('0x3a')]));_0x151b5f[_0x3029('0x38')]=_0x151b5f[_0x3029('0x38')][_0x3029('0x3b')]?_0x151b5f[_0x3029('0x38')]:_0x5bb219[_0x3029('0x39')];if(_0x1e1bda[_0x3029('0x35')][_0x3029('0x47')]){_0x151b5f[_0x3029('0x4d')]=[{'all':!![]}];}_0x151b5f=_[_0x3029('0x44')]({},_0x151b5f,_0x1e1bda[_0x3029('0x46')]);return db[_0x3029('0x31')][_0x3029('0x4e')](_0x151b5f)['then'](handleEntityNotFound(_0x289dba,null))[_0x3029('0x29')](respondWithResult(_0x289dba,null))['catch'](handleError(_0x289dba,null));};exports[_0x3029('0x4f')]=function(_0x4e23c2,_0x32a8d0){return db[_0x3029('0x31')][_0x3029('0x4f')](_0x4e23c2['body'],{})['then'](respondWithResult(_0x32a8d0,0xc9))[_0x3029('0x4a')](handleError(_0x32a8d0,null));};exports['update']=function(_0x27e8fa,_0x45e846){if(_0x27e8fa[_0x3029('0x50')]['id']){delete _0x27e8fa[_0x3029('0x50')]['id'];}return db[_0x3029('0x31')]['find']({'where':{'id':_0x27e8fa[_0x3029('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45e846,null))[_0x3029('0x29')](saveUpdates(_0x27e8fa['body'],null))['then'](respondWithResult(_0x45e846,null))['catch'](handleError(_0x45e846,null));};exports[_0x3029('0x2a')]=function(_0x4b9e55,_0x1499e9){return db['ChatInternalMessage'][_0x3029('0x4e')]({'where':{'id':_0x4b9e55[_0x3029('0x4c')]['id']}})[_0x3029('0x29')](handleEntityNotFound(_0x1499e9,null))['then'](removeEntity(_0x1499e9,null))[_0x3029('0x4a')](handleError(_0x1499e9,null));};exports[_0x3029('0x51')]=function(_0x3a736d,_0x2a2df4){return db[_0x3029('0x31')][_0x3029('0x51')]()[_0x3029('0x29')](respondWithResult(_0x2a2df4,null))['catch'](handleError(_0x2a2df4,null));};function wrapUser(_0x29a4f9){return function(_0x28a704){var _0x266315=_0x29a4f9['get']({'plain':!![]});_0x266315[_0x3029('0x52')]=[];if(_0x28a704){_0x266315['lastMessageAt']=_0x28a704[_0x3029('0x53')];_0x266315[_0x3029('0x54')]=_0x28a704;}else{_0x266315[_0x3029('0x55')]=moment(0x0)['format'](_0x3029('0x56'));_0x266315[_0x3029('0x54')]={};}return _0x266315;};}exports[_0x3029('0x57')]=function(_0x1c27ba,_0x3577dd,_0x587f13){var _0x43c44e=[];return db[_0x3029('0x58')][_0x3029('0x48')]({'where':{'role':[_0x3029('0x59'),_0x3029('0x5a'),'user']},'attributes':['id',_0x3029('0x5b'),_0x3029('0x2d'),_0x3029('0x5c'),'userpic','internal','online',_0x3029('0x5d'),_0x3029('0x5e'),_0x3029('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x3029('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x3e0f2d){if(_0x3e0f2d){var _0x8b0107=_0x1c27ba['user'][_0x3029('0x60')]({'plain':!![]});if(!_0x8b0107)throw new Error(_0x3029('0x61'));if(_0x8b0107[_0x3029('0x5c')]==='user'){return db[_0x3029('0x62')][_0x3029('0x4e')]({'where':{'name':_0x3029('0x63'),'userProfileId':_0x8b0107[_0x3029('0x64')]},'raw':!![]})[_0x3029('0x29')](function(_0x33ff74){if(_0x33ff74){if(_0x33ff74['autoAssociation']===0x0){return db[_0x3029('0x65')][_0x3029('0x48')]({'where':{'sectionId':_0x33ff74['id']},'raw':!![]})['then'](function(_0xe9d8a2){var _0x7ee3cf=[];if(_[_0x3029('0x66')](_0xe9d8a2)){_0x7ee3cf=_[_0x3029('0x43')](_0x3e0f2d,function(_0x1a0a3a){if(_0x1a0a3a[_0x3029('0x5c')]!==_0x3029('0x59')){return _0x1a0a3a;}});return _0x7ee3cf;}else{for(var _0x549a59=0x0;_0x549a59<_0x3e0f2d[_0x3029('0x3b')];_0x549a59++){var _0x2f23ae=_0x3e0f2d[_0x549a59];if(_0x2f23ae[_0x3029('0x5c')]===_0x3029('0x59')){var _0x2c8e6a=_[_0x3029('0x4e')](_0xe9d8a2,function(_0x719bd){return _0x719bd[_0x3029('0x67')]===_0x2f23ae['id'];});if(_0x2c8e6a)_0x7ee3cf['push'](_0x2f23ae);}else{_0x7ee3cf[_0x3029('0x68')](_0x2f23ae);}}return _0x7ee3cf;}});}else{return _0x3e0f2d;}}else{var _0x3a7771=_[_0x3029('0x43')](_0x3e0f2d,function(_0x5d67a9){if(_0x5d67a9['role']!==_0x3029('0x59')){return _0x5d67a9;}});return _0x3a7771;}});}else{return _0x3e0f2d;}}})[_0x3029('0x29')](function(_0x2c1e36){var _0x472c54=[];if(_0x2c1e36){_0x43c44e=_0x2c1e36;for(var _0x3e2bcc=0x0;_0x3e2bcc<_0x2c1e36[_0x3029('0x3b')];_0x3e2bcc+=0x1){_0x43c44e[_0x3e2bcc][_0x3029('0x52')]=[];_0x472c54[_0x3029('0x68')](db[_0x3029('0x31')][_0x3029('0x4e')]({'where':{'FromId':[_0x1c27ba[_0x3029('0x69')]['id'],_0x2c1e36[_0x3e2bcc]['id']],'ToId':[_0x1c27ba[_0x3029('0x69')]['id'],_0x2c1e36[_0x3e2bcc]['id']],'ChatGroupId':null},'attributes':['id',_0x3029('0x53'),_0x3029('0x6a'),_0x3029('0x6b'),_0x3029('0x6c'),_0x3029('0x50')],'order':qs['sort'](_0x3029('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3029('0x29')](wrapUser(_0x2c1e36[_0x3e2bcc])));}return BPromise['all'](_0x472c54);}return[];})['then'](function(_0x5dec56){return{'rows':_0x5dec56,'count':_0x5dec56['length']};})[_0x3029('0x29')](respondWithResult(_0x3577dd,null))[_0x3029('0x4a')](handleError(_0x3577dd,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ca3ba08..5accf8e 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 _0x60cb=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','emit','hasOwnProperty'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x60cb,0x9a));var _0xb60c=function(_0x2d0dee,_0x4e77fb){_0x2d0dee=_0x2d0dee-0x0;var _0x787187=_0x60cb[_0x2d0dee];return _0x787187;};'use strict';var EventEmitter=require(_0xb60c('0x0'));var ChatInternalMessage=require(_0xb60c('0x1'))['db'][_0xb60c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb60c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b8775){return function(_0x2cf2f8,_0x2ee129,_0x4c17fa){ChatInternalMessageEvents['emit'](_0x1b8775+':'+_0x2cf2f8['id'],_0x2cf2f8);ChatInternalMessageEvents[_0xb60c('0x4')](_0x1b8775,_0x2cf2f8);_0x4c17fa(null);};}for(var e in events){if(events[_0xb60c('0x5')](e)){var event=events[e];ChatInternalMessage[_0xb60c('0x6')](e,emitEvent(event));}}module[_0xb60c('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x105c=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x105c,0x87));var _0xc105=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x105c[_0x25efdf];return _0x22c495;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc105('0x0'))['db'][_0xc105('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc105('0x2')](0x0);var events={'afterCreate':_0xc105('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x36fbda){return function(_0x4855d9,_0x19e45d,_0x41a155){ChatInternalMessageEvents[_0xc105('0x4')](_0x36fbda+':'+_0x4855d9['id'],_0x4855d9);ChatInternalMessageEvents[_0xc105('0x4')](_0x36fbda,_0x4855d9);_0x41a155(null);};}for(var e in events){if(events[_0xc105('0x5')](e)){var event=events[e];ChatInternalMessage[_0xc105('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 9dd4bfb..c14a7ae 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 _0x418d=['api','moment','bluebird','path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x152eb6,_0x526b85){var _0x47b86b=function(_0x31e02a){while(--_0x31e02a){_0x152eb6['push'](_0x152eb6['shift']());}};_0x47b86b(++_0x526b85);}(_0x418d,0x106));var _0xd418=function(_0xfa5506,_0x54fc93){_0xfa5506=_0xfa5506-0x0;var _0x5bedc1=_0x418d[_0xfa5506];return _0x5bedc1;};'use strict';var _=require(_0xd418('0x0'));var util=require(_0xd418('0x1'));var logger=require('../../config/logger')(_0xd418('0x2'));var moment=require(_0xd418('0x3'));var BPromise=require(_0xd418('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd418('0x5'));var rimraf=require(_0xd418('0x6'));var config=require('../../config/environment');var attributes=require(_0xd418('0x7'));module[_0xd418('0x8')]=function(_0x2a98b2,_0x31e77a){return _0x2a98b2['define'](_0xd418('0x9'),attributes,{'tableName':_0xd418('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd418('0xb')});}; \ No newline at end of file +var _0xb029=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb029,0x6d));var _0x9b02=function(_0x59522b,_0x49e8e7){_0x59522b=_0x59522b-0x0;var _0x294b92=_0xb029[_0x59522b];return _0x294b92;};'use strict';var _=require(_0x9b02('0x0'));var util=require(_0x9b02('0x1'));var logger=require('../../config/logger')(_0x9b02('0x2'));var moment=require(_0x9b02('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b02('0x4'));var fs=require('fs');var path=require(_0x9b02('0x5'));var rimraf=require(_0x9b02('0x6'));var config=require(_0x9b02('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x2582d7,_0x1eb59a){return _0x2582d7[_0x9b02('0x8')](_0x9b02('0x9'),attributes,{'tableName':_0x9b02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b02('0xb'),'collate':_0x9b02('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 3b560cd..105c7d2 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 _0xe3c5=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x3f2855,_0x220576){_0x3f2855=_0x3f2855-0x0;var _0x20c16f=_0xe3c5[_0x3f2855];return _0x20c16f;};'use strict';var _=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var moment=require(_0x5e3c('0x2'));var BPromise=require(_0x5e3c('0x3'));var rs=require(_0x5e3c('0x4'));var fs=require('fs');var Redis=require(_0x5e3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e3c('0x6'));var logger=require(_0x5e3c('0x7'))(_0x5e3c('0x8'));var config=require(_0x5e3c('0x9'));var jayson=require(_0x5e3c('0xa'));var client=jayson[_0x5e3c('0xb')][_0x5e3c('0xc')]({'port':0x232a});config[_0x5e3c('0xd')]=_[_0x5e3c('0xe')](config[_0x5e3c('0xd')],{'host':_0x5e3c('0xf'),'port':0x18eb});var socket=require(_0x5e3c('0x10'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5e3c('0x11')](socket);function respondWithRpcPromise(_0x125a7c,_0x1835d9,_0x167eee){return new BPromise(function(_0x3ffc9,_0x54ce39){return client[_0x5e3c('0x12')](_0x125a7c,_0x167eee)[_0x5e3c('0x13')](function(_0x5e110b){logger[_0x5e3c('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1835d9,'request\x20sent');logger[_0x5e3c('0x15')](_0x5e3c('0x16'),_0x1835d9,_0x5e3c('0x17'),JSON[_0x5e3c('0x18')](_0x5e110b));if(_0x5e110b[_0x5e3c('0x19')]){if(_0x5e110b[_0x5e3c('0x19')][_0x5e3c('0x1a')]===0x1f4){logger[_0x5e3c('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x1835d9,_0x5e110b['error'][_0x5e3c('0x1b')]);return _0x54ce39(_0x5e110b[_0x5e3c('0x19')][_0x5e3c('0x1b')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1835d9,_0x5e110b[_0x5e3c('0x19')][_0x5e3c('0x1b')]);return _0x3ffc9(_0x5e110b[_0x5e3c('0x19')][_0x5e3c('0x1b')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1835d9,_0x5e3c('0x17'));_0x3ffc9(_0x5e110b['result']['message']);}})[_0x5e3c('0x1c')](function(_0x551ccb){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1835d9,_0x551ccb);_0x54ce39(_0x551ccb);});});} \ No newline at end of file +var _0xcc5a=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xcc5a,0x16e));var _0xacc5=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0xcc5a[_0x5e238b];return _0x389bea;};'use strict';var _=require(_0xacc5('0x0'));var util=require('util');var moment=require(_0xacc5('0x1'));var BPromise=require(_0xacc5('0x2'));var rs=require(_0xacc5('0x3'));var fs=require('fs');var Redis=require(_0xacc5('0x4'));var db=require(_0xacc5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xacc5('0x6'))(_0xacc5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xacc5('0x8')]['http']({'port':0x232a});config[_0xacc5('0x9')]=_['defaults'](config[_0xacc5('0x9')],{'host':_0xacc5('0xa'),'port':0x18eb});var socket=require(_0xacc5('0xb'))(new Redis(config[_0xacc5('0x9')]));require(_0xacc5('0xc'))[_0xacc5('0xd')](socket);function respondWithRpcPromise(_0xf66a80,_0x2710d2,_0x416393){return new BPromise(function(_0x447e1b,_0x5cff39){return client[_0xacc5('0xe')](_0xf66a80,_0x416393)[_0xacc5('0xf')](function(_0x39bf8d){logger[_0xacc5('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x2710d2,_0xacc5('0x11'));logger[_0xacc5('0x12')](_0xacc5('0x13'),_0x2710d2,_0xacc5('0x11'),JSON['stringify'](_0x39bf8d));if(_0x39bf8d[_0xacc5('0x14')]){if(_0x39bf8d[_0xacc5('0x14')][_0xacc5('0x15')]===0x1f4){logger['error'](_0xacc5('0x16'),_0x2710d2,_0x39bf8d['error'][_0xacc5('0x17')]);return _0x5cff39(_0x39bf8d['error'][_0xacc5('0x17')]);}logger[_0xacc5('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x2710d2,_0x39bf8d[_0xacc5('0x14')]['message']);return _0x447e1b(_0x39bf8d[_0xacc5('0x14')][_0xacc5('0x17')]);}else{logger[_0xacc5('0x10')](_0xacc5('0x16'),_0x2710d2,_0xacc5('0x11'));_0x447e1b(_0x39bf8d[_0xacc5('0x18')][_0xacc5('0x17')]);}})[_0xacc5('0x19')](function(_0x2cb572){logger[_0xacc5('0x14')](_0xacc5('0x16'),_0x2710d2,_0x2cb572);_0x5cff39(_0x2cb572);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 19b5092..2e1a409 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 _0x87fc=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x576d5b,_0x1b8b7b){var _0x5b1f5e=function(_0xc8aa04){while(--_0xc8aa04){_0x576d5b['push'](_0x576d5b['shift']());}};_0x5b1f5e(++_0x1b8b7b);}(_0x87fc,0x14d));var _0xc87f=function(_0x2a67b0,_0x19833e){_0x2a67b0=_0x2a67b0-0x0;var _0x35911b=_0x87fc[_0x2a67b0];return _0x35911b;};'use strict';var ChatInternalMessageEvents=require(_0xc87f('0x0'));var events=[_0xc87f('0x1'),_0xc87f('0x2'),_0xc87f('0x3')];function createListener(_0x323ace,_0x1439a3){return function(_0x22b244){_0x1439a3['emit'](_0x323ace,_0x22b244);};}function removeListener(_0x407b31,_0x1e156f){return function(){ChatInternalMessageEvents[_0xc87f('0x4')](_0x407b31,_0x1e156f);};}exports[_0xc87f('0x5')]=function(_0x40a217){for(var _0xb78a30=0x0,_0x50ab2e=events[_0xc87f('0x6')];_0xb78a30<_0x50ab2e;_0xb78a30++){var _0x231f92=events[_0xb78a30];var _0x2cb9e6=createListener(_0xc87f('0x7')+_0x231f92,_0x40a217);ChatInternalMessageEvents['on'](_0x231f92,_0x2cb9e6);}}; \ No newline at end of file +var _0xe85b=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x842c6b,_0x50959e){var _0x31ede1=function(_0x423d6a){while(--_0x423d6a){_0x842c6b['push'](_0x842c6b['shift']());}};_0x31ede1(++_0x50959e);}(_0xe85b,0x184));var _0xbe85=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0xe85b[_0x107f10];return _0x811cab;};'use strict';var ChatInternalMessageEvents=require(_0xbe85('0x0'));var events=['save',_0xbe85('0x1'),_0xbe85('0x2')];function createListener(_0x380c1a,_0x1343d4){return function(_0x3c74b6){_0x1343d4[_0xbe85('0x3')](_0x380c1a,_0x3c74b6);};}function removeListener(_0x49025d,_0x52fade){return function(){ChatInternalMessageEvents[_0xbe85('0x4')](_0x49025d,_0x52fade);};}exports[_0xbe85('0x5')]=function(_0x30e497){for(var _0x453865=0x0,_0x4659d2=events[_0xbe85('0x6')];_0x453865<_0x4659d2;_0x453865++){var _0x1ea854=events[_0x453865];var _0x2d0153=createListener(_0xbe85('0x7')+_0x1ea854,_0x30e497);ChatInternalMessageEvents['on'](_0x1ea854,_0x2d0153);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 7b99b44..1b9e34e 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 _0xf7c3=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/users','/:id','show','create','put','update','delete','exports','multer','util'];(function(_0x3cf387,_0x31ed26){var _0x24425f=function(_0x500fc6){while(--_0x500fc6){_0x3cf387['push'](_0x3cf387['shift']());}};_0x24425f(++_0x31ed26);}(_0xf7c3,0x154));var _0x3f7c=function(_0x332d8b,_0x471b26){_0x332d8b=_0x332d8b-0x0;var _0x827fc9=_0xf7c3[_0x332d8b];return _0x827fc9;};'use strict';var multer=require(_0x3f7c('0x0'));var util=require(_0x3f7c('0x1'));var path=require(_0x3f7c('0x2'));var timeout=require(_0x3f7c('0x3'));var express=require('express');var router=express[_0x3f7c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3f7c('0x5'));var interaction=require(_0x3f7c('0x6'));var config=require(_0x3f7c('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x3f7c('0x8')]('/',auth[_0x3f7c('0x9')](),controller['index']);router[_0x3f7c('0x8')]('/describe',auth[_0x3f7c('0x9')](),controller['describe']);router[_0x3f7c('0x8')](_0x3f7c('0xa'),auth[_0x3f7c('0x9')](),controller['getUsers']);router[_0x3f7c('0x8')](_0x3f7c('0xb'),auth[_0x3f7c('0x9')](),controller[_0x3f7c('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3f7c('0xd')]);router[_0x3f7c('0xe')]('/:id',controller[_0x3f7c('0xf')]);router[_0x3f7c('0x10')](_0x3f7c('0xb'),auth[_0x3f7c('0x9')](),controller['destroy']);module[_0x3f7c('0x11')]=router; \ No newline at end of file +var _0xc140=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','getUsers','/:id','post','put','update','delete','destroy'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xc140,0xa1));var _0x0c14=function(_0x33ceeb,_0x58b863){_0x33ceeb=_0x33ceeb-0x0;var _0x5b6556=_0xc140[_0x33ceeb];return _0x5b6556;};'use strict';var multer=require(_0x0c14('0x0'));var util=require(_0x0c14('0x1'));var path=require(_0x0c14('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0c14('0x4'));var interaction=require(_0x0c14('0x5'));var config=require(_0x0c14('0x6'));var controller=require(_0x0c14('0x7'));router['get']('/',auth[_0x0c14('0x8')](),controller[_0x0c14('0x9')]);router[_0x0c14('0xa')](_0x0c14('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0c14('0xa')]('/users',auth['isAuthenticated'](),controller[_0x0c14('0xc')]);router[_0x0c14('0xa')](_0x0c14('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0c14('0xe')]('/',auth[_0x0c14('0x8')](),controller['create']);router[_0x0c14('0xf')](_0x0c14('0xd'),controller[_0x0c14('0x10')]);router[_0x0c14('0x11')](_0x0c14('0xd'),auth[_0x0c14('0x8')](),controller[_0x0c14('0x12')]);module[_0x0c14('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 7b947bd..97e9f62 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 _0x34ab=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x27e44b,_0x3099a2){var _0x321740=function(_0x2f7fdd){while(--_0x2f7fdd){_0x27e44b['push'](_0x27e44b['shift']());}};_0x321740(++_0x3099a2);}(_0x34ab,0x169));var _0xb34a=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x34ab[_0x3a1ea5];return _0xfac9b2;};'use strict';var Sequelize=require(_0xb34a('0x0'));module[_0xb34a('0x1')]={'body':{'type':Sequelize[_0xb34a('0x2')](_0xb34a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb34a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb34a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb34a('0x5')]('in',_0xb34a('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb34a('0x7')]},'providerResponse':{'type':Sequelize[_0xb34a('0x2')]}}; \ No newline at end of file +var _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x196efd,_0x1fb243){var _0x1b35d6=function(_0x2f95ff){while(--_0x2f95ff){_0x196efd['push'](_0x196efd['shift']());}};_0x1b35d6(++_0x1fb243);}(_0xfd6f,0x19d));var _0xffd6=function(_0x53a168,_0x1ab0ef){_0x53a168=_0x53a168-0x0;var _0x45c22b=_0xfd6f[_0x53a168];return _0x45c22b;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index f7bec0e..6e84b89 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 _0x55df=['offset','count','set','Content-Range','apply','update','destroy','name','map','ChatMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','filter','where','merge','type','options','includeAll','include','findAll','rows','params','find','create','body','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','ContactId','User','internal','rejectmessage','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','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined'];(function(_0x3bb250,_0x2475d8){var _0x4a1ab6=function(_0x32fd70){while(--_0x32fd70){_0x3bb250['push'](_0x3bb250['shift']());}};_0x4a1ab6(++_0x2475d8);}(_0x55df,0x15c));var _0xf55d=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x55df[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require(_0xf55d('0x0'));var rimraf=require(_0xf55d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf55d('0x2'));var rp=require(_0xf55d('0x3'));var moment=require(_0xf55d('0x4'));var BPromise=require(_0xf55d('0x5'));var Mustache=require(_0xf55d('0x6'));var util=require(_0xf55d('0x7'));var path=require(_0xf55d('0x8'));var sox=require(_0xf55d('0x9'));var csv=require(_0xf55d('0xa'));var ejs=require(_0xf55d('0xb'));var fs=require('fs');var fs_extra=require(_0xf55d('0xc'));var _=require('lodash');var squel=require(_0xf55d('0xd'));var crypto=require(_0xf55d('0xe'));var jsforce=require(_0xf55d('0xf'));var deskjs=require(_0xf55d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf55d('0x11'));var Papa=require(_0xf55d('0x12'));var Redis=require(_0xf55d('0x13'));var authService=require(_0xf55d('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf55d('0x15'));var logger=require(_0xf55d('0x16'))(_0xf55d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf55d('0x18'))['db'];config[_0xf55d('0x19')]=_[_0xf55d('0x1a')](config[_0xf55d('0x19')],{'host':_0xf55d('0x1b'),'port':0x18eb});var socket=require(_0xf55d('0x1c'))(new Redis(config[_0xf55d('0x19')]));require(_0xf55d('0x1d'))['register'](socket);var jayson=require(_0xf55d('0x1e'));var client=jayson['client'][_0xf55d('0x1f')]({'port':0x232c});var client9002=jayson[_0xf55d('0x20')][_0xf55d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1389e2,_0x502b9a,_0x4e8f6b,_0x4b090d){return new BPromise(function(_0x20074c,_0x10c495){var _0x342eb4=_0x4b090d||client;return _0x342eb4[_0xf55d('0x21')](_0x1389e2,_0x4e8f6b)[_0xf55d('0x22')](function(_0x25ca84){logger[_0xf55d('0x23')](_0xf55d('0x24'),_0x502b9a,_0xf55d('0x25'));logger[_0xf55d('0x26')](_0xf55d('0x27'),_0x502b9a,_0xf55d('0x25'),JSON[_0xf55d('0x28')](_0x25ca84));if(_0x25ca84[_0xf55d('0x29')]){if(_0x25ca84['error'][_0xf55d('0x2a')]===0x1f4){logger[_0xf55d('0x29')](_0xf55d('0x24'),_0x502b9a,_0x25ca84[_0xf55d('0x29')][_0xf55d('0x2b')]);return _0x10c495(_0x25ca84['error'][_0xf55d('0x2b')]);}logger[_0xf55d('0x29')](_0xf55d('0x24'),_0x502b9a,_0x25ca84[_0xf55d('0x29')][_0xf55d('0x2b')]);return _0x20074c(_0x25ca84['error'][_0xf55d('0x2b')]);}else{logger[_0xf55d('0x23')](_0xf55d('0x24'),_0x502b9a,_0xf55d('0x25'));_0x20074c(_0x25ca84[_0xf55d('0x2c')][_0xf55d('0x2b')]);}})[_0xf55d('0x2d')](function(_0x45397f){logger[_0xf55d('0x29')](_0xf55d('0x24'),_0x502b9a,_0x45397f);_0x10c495(_0x45397f);});});}function respondWithStatusCode(_0x5a5715,_0x562e1d){_0x562e1d=_0x562e1d||0xcc;return function(_0x18b9e5){if(_0x18b9e5){return _0x5a5715[_0xf55d('0x2e')](_0x562e1d);}return _0x5a5715[_0xf55d('0x2f')](_0x562e1d)[_0xf55d('0x30')]();};}function respondWithResult(_0x38d568,_0x59fdc7){_0x59fdc7=_0x59fdc7||0xc8;return function(_0x178cc3){if(_0x178cc3){return _0x38d568[_0xf55d('0x2f')](_0x59fdc7)[_0xf55d('0x31')](_0x178cc3);}};}function respondWithFilteredResult(_0x1551fd,_0x3ff826){return function(_0x437fd9){if(_0x437fd9){var _0xd73489=typeof _0x3ff826['offset']===_0xf55d('0x32')&&typeof _0x3ff826['limit']===_0xf55d('0x32');var _0x4192f0=_0x437fd9['count'];var _0xbc16d6=_0xd73489?0x0:_0x3ff826[_0xf55d('0x33')];var _0x499d9d=_0xd73489?_0x437fd9[_0xf55d('0x34')]:_0x3ff826['offset']+_0x3ff826['limit'];var _0x476080;if(_0x499d9d>=_0x4192f0){_0x499d9d=_0x4192f0;_0x476080=0xc8;}else{_0x476080=0xce;}_0x1551fd[_0xf55d('0x2f')](_0x476080);return _0x1551fd[_0xf55d('0x35')](_0xf55d('0x36'),_0xbc16d6+'-'+_0x499d9d+'/'+_0x4192f0)[_0xf55d('0x31')](_0x437fd9);}return null;};}function patchUpdates(_0x180779){return function(_0xc8dbce){try{jsonpatch[_0xf55d('0x37')](_0xc8dbce,_0x180779,!![]);}catch(_0x524f41){return BPromise['reject'](_0x524f41);}return _0xc8dbce['save']();};}function saveUpdates(_0x5371c1,_0x57b397){return function(_0x267312){if(_0x267312){return _0x267312[_0xf55d('0x38')](_0x5371c1)['then'](function(_0x5e4bd4){return _0x5e4bd4;});}return null;};}function removeEntity(_0x240c87,_0xf24033){return function(_0x499f50){if(_0x499f50){return _0x499f50[_0xf55d('0x39')]()['then'](function(){_0x240c87['status'](0xcc)[_0xf55d('0x30')]();});}};}function handleEntityNotFound(_0x2a7f8b,_0x491532){return function(_0x35c58b){if(!_0x35c58b){_0x2a7f8b['sendStatus'](0x194);}return _0x35c58b;};}function handleError(_0x29fd87,_0xefc5ac){_0xefc5ac=_0xefc5ac||0x1f4;return function(_0x17bfa1){logger['error'](_0x17bfa1['stack']);if(_0x17bfa1[_0xf55d('0x3a')]){delete _0x17bfa1[_0xf55d('0x3a')];}_0x29fd87[_0xf55d('0x2f')](_0xefc5ac)['send'](_0x17bfa1);};}exports['index']=function(_0x595f55,_0x2efdc4){var _0x482fbc={},_0x1f01fd={},_0x5540f1={'count':0x0,'rows':[]};var _0xb70539=_[_0xf55d('0x3b')](db[_0xf55d('0x3c')][_0xf55d('0x3d')],function(_0x1000d6){return{'name':_0x1000d6[_0xf55d('0x3e')],'type':_0x1000d6['type'][_0xf55d('0x3f')]};});_0x1f01fd['model']=_['map'](_0xb70539,_0xf55d('0x3a'));_0x1f01fd[_0xf55d('0x40')]=_[_0xf55d('0x41')](_0x595f55[_0xf55d('0x40')]);_0x1f01fd[_0xf55d('0x42')]=_[_0xf55d('0x43')](_0x1f01fd[_0xf55d('0x44')],_0x1f01fd['query']);_0x482fbc[_0xf55d('0x45')]=_['intersection'](_0x1f01fd['model'],qs[_0xf55d('0x46')](_0x595f55[_0xf55d('0x40')][_0xf55d('0x46')]));_0x482fbc[_0xf55d('0x45')]=_0x482fbc[_0xf55d('0x45')][_0xf55d('0x47')]?_0x482fbc[_0xf55d('0x45')]:_0x1f01fd['model'];if(!_0x595f55[_0xf55d('0x40')]['hasOwnProperty'](_0xf55d('0x48'))){_0x482fbc[_0xf55d('0x49')]=qs[_0xf55d('0x49')](_0x595f55[_0xf55d('0x40')][_0xf55d('0x49')]);_0x482fbc['offset']=qs['offset'](_0x595f55['query'][_0xf55d('0x33')]);}_0x482fbc['order']=qs['sort'](_0x595f55['query'][_0xf55d('0x4a')]);_0x482fbc['where']=qs[_0xf55d('0x42')](_['pick'](_0x595f55[_0xf55d('0x40')],_0x1f01fd[_0xf55d('0x42')]),_0xb70539);if(_0x595f55[_0xf55d('0x40')][_0xf55d('0x4b')]){_0x482fbc[_0xf55d('0x4c')]=_[_0xf55d('0x4d')](_0x482fbc[_0xf55d('0x4c')],{'$or':_[_0xf55d('0x3b')](_0xb70539,function(_0x14ef22){if(_0x14ef22[_0xf55d('0x4e')]!=='VIRTUAL'){var _0x54b5d3={};_0x54b5d3[_0x14ef22[_0xf55d('0x3a')]]={'$like':'%'+_0x595f55[_0xf55d('0x40')][_0xf55d('0x4b')]+'%'};return _0x54b5d3;}})});}_0x482fbc=_[_0xf55d('0x4d')]({},_0x482fbc,_0x595f55[_0xf55d('0x4f')]);var _0x1b49ef={'where':_0x482fbc['where']};return db['ChatMessage'][_0xf55d('0x34')](_0x1b49ef)[_0xf55d('0x22')](function(_0x2f9656){_0x5540f1[_0xf55d('0x34')]=_0x2f9656;if(_0x595f55['query'][_0xf55d('0x50')]){_0x482fbc[_0xf55d('0x51')]=[{'all':!![]}];}return db[_0xf55d('0x3c')][_0xf55d('0x52')](_0x482fbc);})['then'](function(_0x35486e){_0x5540f1[_0xf55d('0x53')]=_0x35486e;return _0x5540f1;})[_0xf55d('0x22')](respondWithFilteredResult(_0x2efdc4,_0x482fbc))[_0xf55d('0x2d')](handleError(_0x2efdc4,null));};exports['show']=function(_0x292872,_0x3aade8){var _0x2f9946={'raw':!![],'where':{'id':_0x292872[_0xf55d('0x54')]['id']}},_0x46e81a={};_0x46e81a['model']=_[_0xf55d('0x41')](db[_0xf55d('0x3c')][_0xf55d('0x3d')]);_0x46e81a[_0xf55d('0x40')]=_['keys'](_0x292872[_0xf55d('0x40')]);_0x46e81a['filters']=_[_0xf55d('0x43')](_0x46e81a[_0xf55d('0x44')],_0x46e81a[_0xf55d('0x40')]);_0x2f9946[_0xf55d('0x45')]=_[_0xf55d('0x43')](_0x46e81a[_0xf55d('0x44')],qs['fields'](_0x292872['query'][_0xf55d('0x46')]));_0x2f9946['attributes']=_0x2f9946[_0xf55d('0x45')][_0xf55d('0x47')]?_0x2f9946[_0xf55d('0x45')]:_0x46e81a[_0xf55d('0x44')];if(_0x292872[_0xf55d('0x40')][_0xf55d('0x50')]){_0x2f9946[_0xf55d('0x51')]=[{'all':!![]}];}_0x2f9946=_[_0xf55d('0x4d')]({},_0x2f9946,_0x292872[_0xf55d('0x4f')]);return db[_0xf55d('0x3c')][_0xf55d('0x55')](_0x2f9946)['then'](handleEntityNotFound(_0x3aade8,null))[_0xf55d('0x22')](respondWithResult(_0x3aade8,null))[_0xf55d('0x2d')](handleError(_0x3aade8,null));};exports[_0xf55d('0x56')]=function(_0x43d581,_0x5bbb54){return db[_0xf55d('0x3c')][_0xf55d('0x56')](_0x43d581[_0xf55d('0x57')],{})[_0xf55d('0x22')](respondWithResult(_0x5bbb54,0xc9))[_0xf55d('0x2d')](handleError(_0x5bbb54,null));};exports[_0xf55d('0x38')]=function(_0x176113,_0x16ab5d){if(_0x176113[_0xf55d('0x57')]['id']){delete _0x176113[_0xf55d('0x57')]['id'];}return db[_0xf55d('0x3c')][_0xf55d('0x55')]({'where':{'id':_0x176113[_0xf55d('0x54')]['id']}})[_0xf55d('0x22')](handleEntityNotFound(_0x16ab5d,null))['then'](saveUpdates(_0x176113[_0xf55d('0x57')],null))[_0xf55d('0x22')](respondWithResult(_0x16ab5d,null))['catch'](handleError(_0x16ab5d,null));};exports[_0xf55d('0x39')]=function(_0x32d2bc,_0x38e60a){return db[_0xf55d('0x3c')]['find']({'where':{'id':_0x32d2bc['params']['id']}})['then'](handleEntityNotFound(_0x38e60a,null))[_0xf55d('0x22')](removeEntity(_0x38e60a,null))['catch'](handleError(_0x38e60a,null));};exports[_0xf55d('0x58')]=function(_0xd46c50,_0x100ff9){return db[_0xf55d('0x3c')][_0xf55d('0x58')]()[_0xf55d('0x22')](respondWithResult(_0x100ff9,null))[_0xf55d('0x2d')](handleError(_0x100ff9,null));};var interaction_log=require(_0xf55d('0x16'))(_0xf55d('0x59'));exports[_0xf55d('0x5a')]=function(_0x2c42f2,_0x2d1a77,_0x4acf7a){var _0x483028={'agent':{},'channel':_0xf55d('0x5b')};if(_0x2c42f2[_0xf55d('0x57')]['id']){delete _0x2c42f2[_0xf55d('0x57')]['id'];}_0x2c42f2[_0xf55d('0x57')]['read']=!![];_0x2c42f2['body'][_0xf55d('0x5c')]=moment()[_0xf55d('0x5d')](_0xf55d('0x5e'));_0x2c42f2[_0xf55d('0x57')][_0xf55d('0x5f')]=_0x2c42f2['body'][_0xf55d('0x5f')]||_0x2c42f2[_0xf55d('0x60')]['id'];_0x483028[_0xf55d('0x61')]['id']=_0x2c42f2[_0xf55d('0x57')][_0xf55d('0x5f')];return db[_0xf55d('0x3c')][_0xf55d('0x55')]({'where':{'id':_0x2c42f2[_0xf55d('0x54')]['id'],'UserId':null}})[_0xf55d('0x22')](handleEntityNotFound(_0x2d1a77,null))['then'](saveUpdates(_0x2c42f2['body'],null))['then'](function(_0x4bd6eb){if(_0x4bd6eb){_0x483028[_0xf55d('0x2b')]=_0x4bd6eb['get']({'plain':!![]});return db[_0xf55d('0x62')][_0xf55d('0x55')]({'where':{'id':_0x4bd6eb[_0xf55d('0x63')]}});}return null;})[_0xf55d('0x22')](handleEntityNotFound(_0x2d1a77,null))[_0xf55d('0x22')](function(_0x3ebc59){if(_0x3ebc59){return _0x3ebc59[_0xf55d('0x38')]({'UserId':_0x2c42f2[_0xf55d('0x57')]['UserId'],'read1stAt':_[_0xf55d('0x64')](_0x3ebc59[_0xf55d('0x65')])?moment()[_0xf55d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf55d('0x22')](function(_0x35d695){if(_0x35d695){_0x483028[_0xf55d('0x66')]=_0x35d695['get']({'plain':!![]});interaction_log[_0xf55d('0x23')](_0xf55d('0x67'),_0x2c42f2[_0xf55d('0x60')]['id'],_0x2c42f2['user'][_0xf55d('0x3a')],_0x2c42f2['user']['role'],_0x483028[_0xf55d('0x66')]['id'],_0x2c42f2[_0xf55d('0x57')]?JSON[_0xf55d('0x28')](_0x2c42f2[_0xf55d('0x57')]):_0xf55d('0x68'));return respondWithRpcPromise(_0xf55d('0x69'),_0xf55d('0x6a'),_0x483028);}return null;})[_0xf55d('0x22')](function(_0x44e3be){var _0x3cef7d=_0xf55d('0x6b')+_0x44e3be[_0xf55d('0x2b')]['ContactId'];return db[_0xf55d('0x6c')][_0xf55d('0x40')](_0x3cef7d,{'type':db[_0xf55d('0x6d')][_0xf55d('0x6e')][_0xf55d('0x6f')],'raw':!![]})[_0xf55d('0x22')](function(_0xe5d328){return _0xe5d328;});})[_0xf55d('0x22')](function(_0x583784){if(_0x583784){_0x483028[_0xf55d('0x2b')][_0xf55d('0x70')]=_0x583784[0x0];if(!_0x2c42f2[_0xf55d('0x57')][_0xf55d('0x5f')])return;return db['User'][_0xf55d('0x55')]({'where':{'id':_0x2c42f2[_0xf55d('0x57')][_0xf55d('0x5f')],'role':_0xf55d('0x61')},'attributes':['id',_0xf55d('0x3a'),_0xf55d('0x71'),_0xf55d('0x72'),'internal'],'raw':!![]});}return null;})[_0xf55d('0x22')](function(_0x51968c){if(!_0x51968c)return null;_0x483028[_0xf55d('0x2b')]['agent']=_0x51968c;return _0x483028;})[_0xf55d('0x22')](function(_0x600027){if(_0x600027){if(_0x2c42f2[_0xf55d('0x57')]['manual']){_0x483028[_0xf55d('0x2b')][_0xf55d('0x73')]=util[_0xf55d('0x5d')](_0xf55d('0x74'),_0x2c42f2[_0xf55d('0x60')][_0xf55d('0x3a')]);_0x483028[_0xf55d('0x2b')][_0xf55d('0x75')]=_0x483028[_0xf55d('0x75')];_0x483028[_0xf55d('0x2b')][_0xf55d('0x76')]=_0x483028[_0xf55d('0x75')];_0x483028[_0xf55d('0x2b')][_0xf55d('0x77')]=_0xf55d('0x5a');return respondWithRpcPromise(_0xf55d('0x78'),_0xf55d('0x78'),{'event':_0xf55d('0x79'),'message':_[_0xf55d('0x4d')](_0x483028[_0xf55d('0x2b')],JSON[_0xf55d('0x7a')](_0x483028['interaction'][_0xf55d('0x7b')]))},client9002)[_0xf55d('0x22')](function(){return _0x483028;});}return _0x483028;}return null;})['then'](respondWithResult(_0x2d1a77,null))[_0xf55d('0x2d')](handleError(_0x2d1a77,null));};var interaction_log=require(_0xf55d('0x16'))(_0xf55d('0x59'));exports[_0xf55d('0x7c')]=function(_0x55c82f,_0x43b06a,_0x49db7c){var _0x3adbaf={'agent':{},'channel':_0xf55d('0x5b')};if(_0x55c82f[_0xf55d('0x57')]['id']){delete _0x55c82f[_0xf55d('0x57')]['id'];}_0x55c82f[_0xf55d('0x57')][_0xf55d('0x5f')]=_0x55c82f[_0xf55d('0x57')]['UserId']||_0x55c82f[_0xf55d('0x60')]['id'];_0x3adbaf[_0xf55d('0x61')]['id']=_0x55c82f[_0xf55d('0x57')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x55c82f['params']['id'],'UserId':null}})[_0xf55d('0x22')](handleEntityNotFound(_0x43b06a,null))[_0xf55d('0x22')](function(_0x40be48){if(_0x40be48){_0x3adbaf['message']=_0x40be48[_0xf55d('0x7d')]({'plain':!![]});return db[_0xf55d('0x62')][_0xf55d('0x55')]({'where':{'id':_0x40be48[_0xf55d('0x63')]}});}return null;})[_0xf55d('0x22')](handleEntityNotFound(_0x43b06a,null))[_0xf55d('0x22')](function(_0x5928ce){if(_0x5928ce){_0x3adbaf[_0xf55d('0x66')]=_0x5928ce[_0xf55d('0x7d')]({'plain':!![]});interaction_log[_0xf55d('0x23')](_0xf55d('0x7e'),_0x55c82f[_0xf55d('0x60')]['id'],_0x55c82f[_0xf55d('0x60')][_0xf55d('0x3a')],_0x55c82f[_0xf55d('0x60')][_0xf55d('0x7f')],_0x3adbaf['interaction']['id'],_0x55c82f[_0xf55d('0x57')]?JSON['stringify'](_0x55c82f[_0xf55d('0x57')]):_0xf55d('0x68'));return respondWithRpcPromise('RejectMessage',_0xf55d('0x80'),_0x3adbaf);}return null;})[_0xf55d('0x22')](function(_0x25a42c){var _0x32eb80=_0xf55d('0x6b')+_0x25a42c['message'][_0xf55d('0x81')];return db['sequelize'][_0xf55d('0x40')](_0x32eb80,{'type':db[_0xf55d('0x6d')][_0xf55d('0x6e')][_0xf55d('0x6f')],'raw':!![]})[_0xf55d('0x22')](function(_0x44df3f){return _0x44df3f;});})[_0xf55d('0x22')](function(_0x5e593b){if(_0x5e593b){_0x3adbaf[_0xf55d('0x2b')]['contact']=_0x5e593b[0x0];if(!_0x55c82f[_0xf55d('0x57')][_0xf55d('0x5f')])return;return db[_0xf55d('0x82')][_0xf55d('0x55')]({'where':{'id':_0x55c82f[_0xf55d('0x57')][_0xf55d('0x5f')],'role':_0xf55d('0x61')},'attributes':['id','name',_0xf55d('0x71'),_0xf55d('0x72'),_0xf55d('0x83')],'raw':!![]});}return null;})[_0xf55d('0x22')](function(_0x21e3f4){if(!_0x21e3f4)return null;_0x3adbaf[_0xf55d('0x2b')][_0xf55d('0x61')]=_0x21e3f4;return _0x3adbaf;})['then'](function(_0x27c717){if(_0x27c717){_0x27c717['message']['interface']=util['format'](_0xf55d('0x74'),_0x55c82f[_0xf55d('0x60')][_0xf55d('0x3a')]);_0x27c717['message'][_0xf55d('0x75')]=_0x3adbaf[_0xf55d('0x75')];_0x27c717[_0xf55d('0x2b')][_0xf55d('0x76')]=_0x3adbaf['channel'];_0x27c717[_0xf55d('0x2b')]['event']='reject';respondWithRpcPromise('EventManager',_0xf55d('0x78'),{'event':_0xf55d('0x84'),'message':_[_0xf55d('0x4d')](_0x3adbaf[_0xf55d('0x2b')],JSON['parse'](_0x3adbaf['interaction'][_0xf55d('0x7b')]))},client9002);return _0x3adbaf;}return null;})[_0xf55d('0x22')](respondWithResult(_0x43b06a,null))[_0xf55d('0x2d')](handleError(_0x43b06a,null));}; \ No newline at end of file +var _0xc278=['query','keys','model','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','create','body','destroy','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','isNil','read1stAt','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','event','rejectmessage','parse','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','offset','undefined','count','status','Content-Range','json','apply','reject','save','update','end','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key'];(function(_0x2a67d5,_0x1fac5b){var _0x55548c=function(_0x49f76c){while(--_0x49f76c){_0x2a67d5['push'](_0x2a67d5['shift']());}};_0x55548c(++_0x1fac5b);}(_0xc278,0x1d6));var _0x8c27=function(_0x415ef9,_0x1a1c9f){_0x415ef9=_0x415ef9-0x0;var _0x41aea6=_0xc278[_0x415ef9];return _0x41aea6;};'use strict';var emlformat=require(_0x8c27('0x0'));var rimraf=require(_0x8c27('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c27('0x2'));var moment=require(_0x8c27('0x3'));var BPromise=require(_0x8c27('0x4'));var Mustache=require(_0x8c27('0x5'));var util=require(_0x8c27('0x6'));var path=require('path');var sox=require(_0x8c27('0x7'));var csv=require(_0x8c27('0x8'));var ejs=require(_0x8c27('0x9'));var fs=require('fs');var fs_extra=require(_0x8c27('0xa'));var _=require(_0x8c27('0xb'));var squel=require('squel');var crypto=require(_0x8c27('0xc'));var jsforce=require(_0x8c27('0xd'));var deskjs=require(_0x8c27('0xe'));var toCsv=require(_0x8c27('0x8'));var querystring=require(_0x8c27('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c27('0x10'));var qs=require(_0x8c27('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c27('0x12'));var logger=require(_0x8c27('0x13'))('api');var utils=require(_0x8c27('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8c27('0x15'))['db'];config[_0x8c27('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8c27('0x17'))(new Redis(config[_0x8c27('0x16')]));require(_0x8c27('0x18'))[_0x8c27('0x19')](socket);var jayson=require(_0x8c27('0x1a'));var client=jayson[_0x8c27('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x8c27('0x1b')][_0x8c27('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xfc7f10,_0x5e4f37,_0x16d8b4,_0x5c979f){return new BPromise(function(_0x3f7755,_0x11be5a){var _0x5ab3e8=_0x5c979f||client;return _0x5ab3e8[_0x8c27('0x1d')](_0xfc7f10,_0x16d8b4)[_0x8c27('0x1e')](function(_0x2389de){logger['info'](_0x8c27('0x1f'),_0x5e4f37,_0x8c27('0x20'));logger['debug'](_0x8c27('0x21'),_0x5e4f37,'request\x20sent',JSON[_0x8c27('0x22')](_0x2389de));if(_0x2389de[_0x8c27('0x23')]){if(_0x2389de[_0x8c27('0x23')][_0x8c27('0x24')]===0x1f4){logger[_0x8c27('0x23')](_0x8c27('0x1f'),_0x5e4f37,_0x2389de[_0x8c27('0x23')][_0x8c27('0x25')]);return _0x11be5a(_0x2389de['error'][_0x8c27('0x25')]);}logger[_0x8c27('0x23')](_0x8c27('0x1f'),_0x5e4f37,_0x2389de['error'][_0x8c27('0x25')]);return _0x3f7755(_0x2389de['error']['message']);}else{logger['info'](_0x8c27('0x1f'),_0x5e4f37,_0x8c27('0x20'));_0x3f7755(_0x2389de[_0x8c27('0x26')][_0x8c27('0x25')]);}})[_0x8c27('0x27')](function(_0x563fc2){logger[_0x8c27('0x23')](_0x8c27('0x1f'),_0x5e4f37,_0x563fc2);_0x11be5a(_0x563fc2);});});}function respondWithStatusCode(_0x332097,_0xf4433e){_0xf4433e=_0xf4433e||0xcc;return function(_0x427f85){if(_0x427f85){return _0x332097['sendStatus'](_0xf4433e);}return _0x332097['status'](_0xf4433e)['end']();};}function respondWithResult(_0x468ecc,_0x55760b){_0x55760b=_0x55760b||0xc8;return function(_0x4a11c8){if(_0x4a11c8){return _0x468ecc['status'](_0x55760b)['json'](_0x4a11c8);}};}function respondWithFilteredResult(_0x4fc1fd,_0x352a07){return function(_0x4ecba7){if(_0x4ecba7){var _0x248fbb=typeof _0x352a07[_0x8c27('0x28')]===_0x8c27('0x29')&&typeof _0x352a07['limit']===_0x8c27('0x29');var _0x9a8b4f=_0x4ecba7[_0x8c27('0x2a')];var _0x45ab72=_0x248fbb?0x0:_0x352a07[_0x8c27('0x28')];var _0x5b2427=_0x248fbb?_0x4ecba7[_0x8c27('0x2a')]:_0x352a07[_0x8c27('0x28')]+_0x352a07['limit'];var _0x2fea4d;if(_0x5b2427>=_0x9a8b4f){_0x5b2427=_0x9a8b4f;_0x2fea4d=0xc8;}else{_0x2fea4d=0xce;}_0x4fc1fd[_0x8c27('0x2b')](_0x2fea4d);return _0x4fc1fd['set'](_0x8c27('0x2c'),_0x45ab72+'-'+_0x5b2427+'/'+_0x9a8b4f)[_0x8c27('0x2d')](_0x4ecba7);}return null;};}function patchUpdates(_0x51be9){return function(_0x5cae7f){try{jsonpatch[_0x8c27('0x2e')](_0x5cae7f,_0x51be9,!![]);}catch(_0x19549a){return BPromise[_0x8c27('0x2f')](_0x19549a);}return _0x5cae7f[_0x8c27('0x30')]();};}function saveUpdates(_0x3c43c4,_0x3bcfb8){return function(_0x50a778){if(_0x50a778){return _0x50a778[_0x8c27('0x31')](_0x3c43c4)[_0x8c27('0x1e')](function(_0x95f2f6){return _0x95f2f6;});}return null;};}function removeEntity(_0x2f9128,_0x2de948){return function(_0x5b6f19){if(_0x5b6f19){return _0x5b6f19['destroy']()['then'](function(){_0x2f9128[_0x8c27('0x2b')](0xcc)[_0x8c27('0x32')]();});}};}function handleEntityNotFound(_0x5604a9,_0x394612){return function(_0x3306a6){if(!_0x3306a6){_0x5604a9[_0x8c27('0x33')](0x194);}return _0x3306a6;};}function handleError(_0x3b1247,_0x4ec6c5){_0x4ec6c5=_0x4ec6c5||0x1f4;return function(_0x4d6767){logger[_0x8c27('0x23')](_0x4d6767[_0x8c27('0x34')]);if(_0x4d6767[_0x8c27('0x35')]){delete _0x4d6767['name'];}_0x3b1247[_0x8c27('0x2b')](_0x4ec6c5)[_0x8c27('0x36')](_0x4d6767);};}exports[_0x8c27('0x37')]=function(_0xcf4551,_0x41c2e5){var _0x541a85={},_0xd7f3b9={},_0x19c6e2={'count':0x0,'rows':[]};var _0x566a0e=_[_0x8c27('0x38')](db[_0x8c27('0x39')][_0x8c27('0x3a')],function(_0x1ece2f){return{'name':_0x1ece2f[_0x8c27('0x3b')],'type':_0x1ece2f[_0x8c27('0x3c')][_0x8c27('0x3d')]};});_0xd7f3b9['model']=_[_0x8c27('0x38')](_0x566a0e,_0x8c27('0x35'));_0xd7f3b9[_0x8c27('0x3e')]=_[_0x8c27('0x3f')](_0xcf4551[_0x8c27('0x3e')]);_0xd7f3b9['filters']=_['intersection'](_0xd7f3b9[_0x8c27('0x40')],_0xd7f3b9[_0x8c27('0x3e')]);_0x541a85[_0x8c27('0x41')]=_['intersection'](_0xd7f3b9[_0x8c27('0x40')],qs[_0x8c27('0x42')](_0xcf4551[_0x8c27('0x3e')][_0x8c27('0x42')]));_0x541a85[_0x8c27('0x41')]=_0x541a85[_0x8c27('0x41')][_0x8c27('0x43')]?_0x541a85[_0x8c27('0x41')]:_0xd7f3b9[_0x8c27('0x40')];if(!_0xcf4551[_0x8c27('0x3e')]['hasOwnProperty']('nolimit')){_0x541a85[_0x8c27('0x44')]=qs[_0x8c27('0x44')](_0xcf4551[_0x8c27('0x3e')]['limit']);_0x541a85[_0x8c27('0x28')]=qs[_0x8c27('0x28')](_0xcf4551['query'][_0x8c27('0x28')]);}_0x541a85[_0x8c27('0x45')]=qs[_0x8c27('0x46')](_0xcf4551[_0x8c27('0x3e')]['sort']);_0x541a85[_0x8c27('0x47')]=qs[_0x8c27('0x48')](_[_0x8c27('0x49')](_0xcf4551['query'],_0xd7f3b9['filters']),_0x566a0e);if(_0xcf4551['query'][_0x8c27('0x4a')]){_0x541a85['where']=_[_0x8c27('0x4b')](_0x541a85['where'],{'$or':_['map'](_0x566a0e,function(_0x2ce525){if(_0x2ce525[_0x8c27('0x3c')]!==_0x8c27('0x4c')){var _0x423a35={};_0x423a35[_0x2ce525['name']]={'$like':'%'+_0xcf4551['query'][_0x8c27('0x4a')]+'%'};return _0x423a35;}})});}_0x541a85=_['merge']({},_0x541a85,_0xcf4551[_0x8c27('0x4d')]);var _0x2a7c92={'where':_0x541a85[_0x8c27('0x47')]};return db[_0x8c27('0x39')][_0x8c27('0x2a')](_0x2a7c92)[_0x8c27('0x1e')](function(_0x58b901){_0x19c6e2[_0x8c27('0x2a')]=_0x58b901;if(_0xcf4551[_0x8c27('0x3e')][_0x8c27('0x4e')]){_0x541a85[_0x8c27('0x4f')]=[{'all':!![]}];}return db[_0x8c27('0x39')]['findAll'](_0x541a85);})[_0x8c27('0x1e')](function(_0x56e0fd){_0x19c6e2[_0x8c27('0x50')]=_0x56e0fd;return _0x19c6e2;})[_0x8c27('0x1e')](respondWithFilteredResult(_0x41c2e5,_0x541a85))['catch'](handleError(_0x41c2e5,null));};exports[_0x8c27('0x51')]=function(_0x21e31f,_0x4c3378){var _0xcdd607={'raw':!![],'where':{'id':_0x21e31f[_0x8c27('0x52')]['id']}},_0x13e87f={};_0x13e87f[_0x8c27('0x40')]=_[_0x8c27('0x3f')](db['ChatMessage'][_0x8c27('0x3a')]);_0x13e87f['query']=_[_0x8c27('0x3f')](_0x21e31f[_0x8c27('0x3e')]);_0x13e87f[_0x8c27('0x48')]=_[_0x8c27('0x53')](_0x13e87f[_0x8c27('0x40')],_0x13e87f[_0x8c27('0x3e')]);_0xcdd607[_0x8c27('0x41')]=_['intersection'](_0x13e87f[_0x8c27('0x40')],qs[_0x8c27('0x42')](_0x21e31f[_0x8c27('0x3e')]['fields']));_0xcdd607[_0x8c27('0x41')]=_0xcdd607[_0x8c27('0x41')][_0x8c27('0x43')]?_0xcdd607[_0x8c27('0x41')]:_0x13e87f[_0x8c27('0x40')];if(_0x21e31f[_0x8c27('0x3e')][_0x8c27('0x4e')]){_0xcdd607[_0x8c27('0x4f')]=[{'all':!![]}];}_0xcdd607=_[_0x8c27('0x4b')]({},_0xcdd607,_0x21e31f[_0x8c27('0x4d')]);return db[_0x8c27('0x39')][_0x8c27('0x54')](_0xcdd607)[_0x8c27('0x1e')](handleEntityNotFound(_0x4c3378,null))[_0x8c27('0x1e')](respondWithResult(_0x4c3378,null))['catch'](handleError(_0x4c3378,null));};exports['create']=function(_0x46aa39,_0xadb9f0){return db[_0x8c27('0x39')][_0x8c27('0x55')](_0x46aa39[_0x8c27('0x56')],{})[_0x8c27('0x1e')](respondWithResult(_0xadb9f0,0xc9))[_0x8c27('0x27')](handleError(_0xadb9f0,null));};exports[_0x8c27('0x31')]=function(_0x424f0a,_0x2ebc92){if(_0x424f0a[_0x8c27('0x56')]['id']){delete _0x424f0a[_0x8c27('0x56')]['id'];}return db[_0x8c27('0x39')][_0x8c27('0x54')]({'where':{'id':_0x424f0a[_0x8c27('0x52')]['id']}})[_0x8c27('0x1e')](handleEntityNotFound(_0x2ebc92,null))[_0x8c27('0x1e')](saveUpdates(_0x424f0a[_0x8c27('0x56')],null))['then'](respondWithResult(_0x2ebc92,null))[_0x8c27('0x27')](handleError(_0x2ebc92,null));};exports[_0x8c27('0x57')]=function(_0x594e21,_0x408345){return db['ChatMessage'][_0x8c27('0x54')]({'where':{'id':_0x594e21['params']['id']}})[_0x8c27('0x1e')](handleEntityNotFound(_0x408345,null))[_0x8c27('0x1e')](removeEntity(_0x408345,null))[_0x8c27('0x27')](handleError(_0x408345,null));};exports[_0x8c27('0x58')]=function(_0x187dac,_0x10aa21){return db[_0x8c27('0x39')][_0x8c27('0x58')]()[_0x8c27('0x1e')](respondWithResult(_0x10aa21,null))['catch'](handleError(_0x10aa21,null));};var interaction_log=require(_0x8c27('0x13'))(_0x8c27('0x59'));exports[_0x8c27('0x5a')]=function(_0x5a57d2,_0x3b5735,_0x339a70){var _0x59dd95={'agent':{},'channel':_0x8c27('0x5b')};if(_0x5a57d2['body']['id']){delete _0x5a57d2['body']['id'];}_0x5a57d2['body']['read']=!![];_0x5a57d2['body'][_0x8c27('0x5c')]=moment()[_0x8c27('0x5d')](_0x8c27('0x5e'));_0x5a57d2[_0x8c27('0x56')]['UserId']=_0x5a57d2['body'][_0x8c27('0x5f')]||_0x5a57d2['user']['id'];_0x59dd95['agent']['id']=_0x5a57d2['body'][_0x8c27('0x5f')];return db['ChatMessage'][_0x8c27('0x54')]({'where':{'id':_0x5a57d2[_0x8c27('0x52')]['id'],'UserId':null}})[_0x8c27('0x1e')](handleEntityNotFound(_0x3b5735,null))[_0x8c27('0x1e')](saveUpdates(_0x5a57d2[_0x8c27('0x56')],null))['then'](function(_0x45c767){if(_0x45c767){_0x59dd95[_0x8c27('0x25')]=_0x45c767[_0x8c27('0x60')]({'plain':!![]});return db[_0x8c27('0x61')][_0x8c27('0x54')]({'where':{'id':_0x45c767['ChatInteractionId']}});}return null;})[_0x8c27('0x1e')](handleEntityNotFound(_0x3b5735,null))[_0x8c27('0x1e')](function(_0x254073){if(_0x254073){return _0x254073[_0x8c27('0x31')]({'UserId':_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x5f')],'read1stAt':_[_0x8c27('0x62')](_0x254073[_0x8c27('0x63')])?moment()['format'](_0x8c27('0x5e')):undefined});}return null;})[_0x8c27('0x1e')](function(_0x365bd1){if(_0x365bd1){_0x59dd95['interaction']=_0x365bd1[_0x8c27('0x60')]({'plain':!![]});interaction_log[_0x8c27('0x64')](_0x8c27('0x65'),_0x5a57d2['user']['id'],_0x5a57d2['user'][_0x8c27('0x35')],_0x5a57d2[_0x8c27('0x66')]['role'],_0x59dd95[_0x8c27('0x67')]['id'],_0x5a57d2[_0x8c27('0x56')]?JSON[_0x8c27('0x22')](_0x5a57d2[_0x8c27('0x56')]):'null');return respondWithRpcPromise(_0x8c27('0x68'),_0x8c27('0x69'),_0x59dd95);}return null;})[_0x8c27('0x1e')](function(_0x18428f){var _0x3f1149='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x18428f['message'][_0x8c27('0x6a')];return db[_0x8c27('0x6b')][_0x8c27('0x3e')](_0x3f1149,{'type':db[_0x8c27('0x6c')][_0x8c27('0x6d')][_0x8c27('0x6e')],'raw':!![]})[_0x8c27('0x1e')](function(_0x519b91){return _0x519b91;});})[_0x8c27('0x1e')](function(_0x559b18){if(_0x559b18){_0x59dd95[_0x8c27('0x25')][_0x8c27('0x6f')]=_0x559b18[0x0];if(!_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x5f')])return;return db[_0x8c27('0x70')]['find']({'where':{'id':_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x5f')],'role':_0x8c27('0x71')},'attributes':['id','name',_0x8c27('0x72'),_0x8c27('0x73'),_0x8c27('0x74')],'raw':!![]});}return null;})['then'](function(_0x14bff6){if(!_0x14bff6)return null;_0x59dd95[_0x8c27('0x25')][_0x8c27('0x71')]=_0x14bff6;return _0x59dd95;})[_0x8c27('0x1e')](function(_0x43e34d){if(_0x43e34d){if(_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x75')]){_0x59dd95[_0x8c27('0x25')][_0x8c27('0x76')]=util[_0x8c27('0x5d')](_0x8c27('0x77'),_0x5a57d2[_0x8c27('0x66')][_0x8c27('0x35')]);_0x59dd95[_0x8c27('0x25')]['channel']=_0x59dd95[_0x8c27('0x78')];_0x59dd95[_0x8c27('0x25')][_0x8c27('0x79')]=_0x59dd95[_0x8c27('0x78')];_0x59dd95[_0x8c27('0x25')]['event']=_0x8c27('0x5a');return respondWithRpcPromise(_0x8c27('0x7a'),'EventManager',{'event':_0x8c27('0x7b'),'message':_[_0x8c27('0x4b')](_0x59dd95[_0x8c27('0x25')],JSON['parse'](_0x59dd95[_0x8c27('0x67')][_0x8c27('0x7c')]))},client9002)[_0x8c27('0x1e')](function(){return _0x59dd95;});}return _0x59dd95;}return null;})[_0x8c27('0x1e')](respondWithResult(_0x3b5735,null))['catch'](handleError(_0x3b5735,null));};var interaction_log=require(_0x8c27('0x13'))(_0x8c27('0x59'));exports['reject']=function(_0x43fc5d,_0x33243f,_0x33096a){var _0x5f55c9={'agent':{},'channel':_0x8c27('0x5b')};if(_0x43fc5d[_0x8c27('0x56')]['id']){delete _0x43fc5d[_0x8c27('0x56')]['id'];}_0x43fc5d['body']['UserId']=_0x43fc5d['body'][_0x8c27('0x5f')]||_0x43fc5d[_0x8c27('0x66')]['id'];_0x5f55c9[_0x8c27('0x71')]['id']=_0x43fc5d['body'][_0x8c27('0x5f')];return db['ChatMessage'][_0x8c27('0x54')]({'where':{'id':_0x43fc5d[_0x8c27('0x52')]['id'],'UserId':null}})[_0x8c27('0x1e')](handleEntityNotFound(_0x33243f,null))[_0x8c27('0x1e')](function(_0x326e17){if(_0x326e17){_0x5f55c9[_0x8c27('0x25')]=_0x326e17[_0x8c27('0x60')]({'plain':!![]});return db[_0x8c27('0x61')][_0x8c27('0x54')]({'where':{'id':_0x326e17['ChatInteractionId']}});}return null;})[_0x8c27('0x1e')](handleEntityNotFound(_0x33243f,null))['then'](function(_0x4ee883){if(_0x4ee883){_0x5f55c9['interaction']=_0x4ee883['get']({'plain':!![]});interaction_log[_0x8c27('0x64')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43fc5d[_0x8c27('0x66')]['id'],_0x43fc5d[_0x8c27('0x66')][_0x8c27('0x35')],_0x43fc5d['user'][_0x8c27('0x7d')],_0x5f55c9[_0x8c27('0x67')]['id'],_0x43fc5d[_0x8c27('0x56')]?JSON['stringify'](_0x43fc5d[_0x8c27('0x56')]):_0x8c27('0x7e'));return respondWithRpcPromise(_0x8c27('0x7f'),_0x8c27('0x80'),_0x5f55c9);}return null;})[_0x8c27('0x1e')](function(_0x304ddd){var _0x361285=_0x8c27('0x81')+_0x304ddd[_0x8c27('0x25')]['ContactId'];return db[_0x8c27('0x6b')]['query'](_0x361285,{'type':db[_0x8c27('0x6c')][_0x8c27('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x4c6d59){return _0x4c6d59;});})[_0x8c27('0x1e')](function(_0xe7b4e7){if(_0xe7b4e7){_0x5f55c9['message']['contact']=_0xe7b4e7[0x0];if(!_0x43fc5d[_0x8c27('0x56')]['UserId'])return;return db[_0x8c27('0x70')][_0x8c27('0x54')]({'where':{'id':_0x43fc5d[_0x8c27('0x56')][_0x8c27('0x5f')],'role':_0x8c27('0x71')},'attributes':['id',_0x8c27('0x35'),_0x8c27('0x72'),_0x8c27('0x73'),'internal'],'raw':!![]});}return null;})[_0x8c27('0x1e')](function(_0x46cbc5){if(!_0x46cbc5)return null;_0x5f55c9['message'][_0x8c27('0x71')]=_0x46cbc5;return _0x5f55c9;})['then'](function(_0x133c02){if(_0x133c02){_0x133c02['message']['interface']=util[_0x8c27('0x5d')](_0x8c27('0x77'),_0x43fc5d[_0x8c27('0x66')][_0x8c27('0x35')]);_0x133c02['message'][_0x8c27('0x78')]=_0x5f55c9[_0x8c27('0x78')];_0x133c02[_0x8c27('0x25')][_0x8c27('0x79')]=_0x5f55c9[_0x8c27('0x78')];_0x133c02[_0x8c27('0x25')][_0x8c27('0x82')]=_0x8c27('0x2f');respondWithRpcPromise('EventManager','EventManager',{'event':_0x8c27('0x83'),'message':_[_0x8c27('0x4b')](_0x5f55c9[_0x8c27('0x25')],JSON[_0x8c27('0x84')](_0x5f55c9[_0x8c27('0x67')][_0x8c27('0x7c')]))},client9002);return _0x5f55c9;}return null;})['then'](respondWithResult(_0x33243f,null))[_0x8c27('0x27')](handleError(_0x33243f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index d153186..61fe514 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 _0x41dd=['ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41dd,0x107));var _0xd41d=function(_0x2858d3,_0x547bd){_0x2858d3=_0x2858d3-0x0;var _0x1c2657=_0x41dd[_0x2858d3];return _0x1c2657;};'use strict';var EventEmitter=require(_0xd41d('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xd41d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd41d('0x2')](0x0);var events={'afterCreate':_0xd41d('0x3'),'afterUpdate':'update','afterDestroy':_0xd41d('0x4')};function emitEvent(_0x1c08b6){return function(_0x29d677,_0x43cc7b,_0xc404a4){ChatMessageEvents[_0xd41d('0x5')](_0x1c08b6+':'+_0x29d677['id'],_0x29d677);ChatMessageEvents['emit'](_0x1c08b6,_0x29d677);_0xc404a4(null);};}for(var e in events){if(events[_0xd41d('0x6')](e)){var event=events[e];ChatMessage[_0xd41d('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xb343=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1ff193,_0x349597){var _0x85b096=function(_0x5d64e7){while(--_0x5d64e7){_0x1ff193['push'](_0x1ff193['shift']());}};_0x85b096(++_0x349597);}(_0xb343,0x1e8));var _0x3b34=function(_0x5d5fad,_0x18e495){_0x5d5fad=_0x5d5fad-0x0;var _0x2285b7=_0xb343[_0x5d5fad];return _0x2285b7;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x3b34('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3b34('0x1')](0x0);var events={'afterCreate':_0x3b34('0x2'),'afterUpdate':_0x3b34('0x3'),'afterDestroy':_0x3b34('0x4')};function emitEvent(_0x2031f0){return function(_0x12f577,_0x5f1757,_0x25461c){ChatMessageEvents[_0x3b34('0x5')](_0x2031f0+':'+_0x12f577['id'],_0x12f577);ChatMessageEvents[_0x3b34('0x5')](_0x2031f0,_0x12f577);_0x25461c(null);};}for(var e in events){if(events[_0x3b34('0x6')](e)){var event=events[e];ChatMessage[_0x3b34('0x7')](e,emitEvent(event));}}module[_0x3b34('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b923775..57932af 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 _0x56c7=['out','secret','UserId','ChatInteraction','ChatInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatMessage.attributes','chat_messages','fti_chat_messages','FULLTEXT','models','direction','toLowerCase'];(function(_0x40fede,_0x203a11){var _0x482694=function(_0x4b7fa0){while(--_0x4b7fa0){_0x40fede['push'](_0x40fede['shift']());}};_0x482694(++_0x203a11);}(_0x56c7,0x6e));var _0x756c=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0x56c7[_0x29bf80];return _0x932096;};'use strict';var _=require(_0x756c('0x0'));var util=require(_0x756c('0x1'));var logger=require(_0x756c('0x2'))(_0x756c('0x3'));var moment=require(_0x756c('0x4'));var BPromise=require('bluebird');var rp=require(_0x756c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x756c('0x6'));var config=require(_0x756c('0x7'));var attributes=require(_0x756c('0x8'));module['exports']=function(_0x24a105,_0x3161d2){return _0x24a105['define']('ChatMessage',attributes,{'tableName':_0x756c('0x9'),'paranoid':![],'indexes':[{'name':_0x756c('0xa'),'fields':['body'],'type':_0x756c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1471fe,_0x1fff1b,_0x48bc47){var _0x20f943=_0x24a105[_0x756c('0xc')];var _0x380f82=_0x1471fe['get']({'plain':!![]});if(_0x380f82[_0x756c('0xd')]['toLowerCase']()==='in'||_0x380f82['direction'][_0x756c('0xe')]()===_0x756c('0xf')&&!_0x380f82[_0x756c('0x10')]&&!_['isNil'](_0x380f82[_0x756c('0x11')])){_0x20f943[_0x756c('0x12')]['findOne']({'where':{'id':_0x380f82[_0x756c('0x13')]}})[_0x756c('0x14')](function(_0x328e11){if(_0x328e11){_0x328e11['update']({'lastMsgAt':_0x380f82[_0x756c('0x15')],'lastMsgDirection':_0x380f82['direction'][_0x756c('0xe')]()});}})[_0x756c('0x16')](function(_0x258bd8){console[_0x756c('0x17')](_0x258bd8);});}_0x48bc47();}},'charset':_0x756c('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x405f=['secret','isNil','findOne','ChatInteractionId','then','catch','error','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','body','FULLTEXT','get','direction','toLowerCase'];(function(_0x41e460,_0x5be232){var _0x4b3605=function(_0x343480){while(--_0x343480){_0x41e460['push'](_0x41e460['shift']());}};_0x4b3605(++_0x5be232);}(_0x405f,0x127));var _0xf405=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x405f[_0x369151];return _0x4292d5;};'use strict';var _=require('lodash');var util=require(_0xf405('0x0'));var logger=require(_0xf405('0x1'))(_0xf405('0x2'));var moment=require(_0xf405('0x3'));var BPromise=require(_0xf405('0x4'));var rp=require(_0xf405('0x5'));var fs=require('fs');var path=require(_0xf405('0x6'));var rimraf=require(_0xf405('0x7'));var config=require(_0xf405('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x179442,_0x56b41f){return _0x179442[_0xf405('0x9')](_0xf405('0xa'),attributes,{'tableName':_0xf405('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xf405('0xc')],'type':_0xf405('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4703a4,_0x70a752,_0x1bcc12){var _0x3b9422=_0x179442['models'];var _0x5aa384=_0x4703a4[_0xf405('0xe')]({'plain':!![]});if(_0x5aa384[_0xf405('0xf')][_0xf405('0x10')]()==='in'||_0x5aa384[_0xf405('0xf')][_0xf405('0x10')]()==='out'&&!_0x5aa384[_0xf405('0x11')]&&!_[_0xf405('0x12')](_0x5aa384['UserId'])){_0x3b9422['ChatInteraction'][_0xf405('0x13')]({'where':{'id':_0x5aa384[_0xf405('0x14')]}})[_0xf405('0x15')](function(_0x292947){if(_0x292947){_0x292947['update']({'lastMsgAt':_0x5aa384['createdAt'],'lastMsgDirection':_0x5aa384[_0xf405('0xf')][_0xf405('0x10')]()});}})[_0xf405('0x16')](function(_0x270a21){console[_0xf405('0x17')](_0x270a21);});}_0x1bcc12();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 89fff92..ca699bd 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 _0x2168=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0x2168,0x112));var _0x8216=function(_0x2e3554,_0x5bde4d){_0x2e3554=_0x2e3554-0x0;var _0x35be33=_0x2168[_0x2e3554];return _0x35be33;};'use strict';var _=require(_0x8216('0x0'));var util=require(_0x8216('0x1'));var moment=require('moment');var BPromise=require(_0x8216('0x2'));var rs=require(_0x8216('0x3'));var fs=require('fs');var Redis=require(_0x8216('0x4'));var db=require(_0x8216('0x5'))['db'];var utils=require(_0x8216('0x6'));var logger=require(_0x8216('0x7'))(_0x8216('0x8'));var config=require(_0x8216('0x9'));var jayson=require(_0x8216('0xa'));var client=jayson[_0x8216('0xb')][_0x8216('0xc')]({'port':0x232a});config['redis']=_[_0x8216('0xd')](config[_0x8216('0xe')],{'host':_0x8216('0xf'),'port':0x18eb});var socket=require(_0x8216('0x10'))(new Redis(config[_0x8216('0xe')]));require(_0x8216('0x11'))['register'](socket);function respondWithRpcPromise(_0x5a0a09,_0x42b111,_0x57dcb8){return new BPromise(function(_0x3f865c,_0xf6a7e8){return client['request'](_0x5a0a09,_0x57dcb8)[_0x8216('0x12')](function(_0x15a006){logger[_0x8216('0x13')](_0x8216('0x14'),_0x42b111,_0x8216('0x15'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x42b111,_0x8216('0x15'),JSON[_0x8216('0x16')](_0x15a006));if(_0x15a006[_0x8216('0x17')]){if(_0x15a006['error'][_0x8216('0x18')]===0x1f4){logger[_0x8216('0x17')](_0x8216('0x14'),_0x42b111,_0x15a006[_0x8216('0x17')][_0x8216('0x19')]);return _0xf6a7e8(_0x15a006[_0x8216('0x17')][_0x8216('0x19')]);}logger[_0x8216('0x17')]('ChatMessage,\x20%s,\x20%s',_0x42b111,_0x15a006['error']['message']);return _0x3f865c(_0x15a006[_0x8216('0x17')][_0x8216('0x19')]);}else{logger[_0x8216('0x13')](_0x8216('0x14'),_0x42b111,'request\x20sent');_0x3f865c(_0x15a006[_0x8216('0x1a')][_0x8216('0x19')]);}})[_0x8216('0x1b')](function(_0x599f6e){logger[_0x8216('0x17')]('ChatMessage,\x20%s,\x20%s',_0x42b111,_0x599f6e);_0xf6a7e8(_0x599f6e);});});}exports[_0x8216('0x1c')]=function(_0x398bff){var _0x4783e3=this;return new Promise(function(_0x5a6783,_0x70b231){return db[_0x8216('0x1d')][_0x8216('0x1e')](_0x398bff[_0x8216('0x1f')],{'raw':_0x398bff[_0x8216('0x20')]?_0x398bff['options'][_0x8216('0x21')]===undefined?!![]:![]:!![]})[_0x8216('0x12')](function(_0x520481){logger[_0x8216('0x13')](_0x8216('0x1c'),_0x398bff);logger[_0x8216('0x22')](_0x8216('0x1c'),_0x398bff,JSON[_0x8216('0x16')](_0x520481));_0x5a6783(_0x520481);})[_0x8216('0x1b')](function(_0xf1c5d){logger[_0x8216('0x17')](_0x8216('0x1c'),_0xf1c5d[_0x8216('0x19')],_0x398bff);_0x70b231(_0x4783e3[_0x8216('0x17')](0x1f4,_0xf1c5d[_0x8216('0x19')]));});});}; \ No newline at end of file +var _0xfb44=['options','raw','CreateChatMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatMessage','body'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfb44,0xb8));var _0x4fb4=function(_0x23d105,_0x4adf80){_0x23d105=_0x23d105-0x0;var _0x2367d9=_0xfb44[_0x23d105];return _0x2367d9;};'use strict';var _=require(_0x4fb4('0x0'));var util=require(_0x4fb4('0x1'));var moment=require(_0x4fb4('0x2'));var BPromise=require(_0x4fb4('0x3'));var rs=require(_0x4fb4('0x4'));var fs=require('fs');var Redis=require(_0x4fb4('0x5'));var db=require(_0x4fb4('0x6'))['db'];var utils=require(_0x4fb4('0x7'));var logger=require(_0x4fb4('0x8'))(_0x4fb4('0x9'));var config=require(_0x4fb4('0xa'));var jayson=require(_0x4fb4('0xb'));var client=jayson['client'][_0x4fb4('0xc')]({'port':0x232a});config[_0x4fb4('0xd')]=_['defaults'](config['redis'],{'host':_0x4fb4('0xe'),'port':0x18eb});var socket=require(_0x4fb4('0xf'))(new Redis(config[_0x4fb4('0xd')]));require(_0x4fb4('0x10'))[_0x4fb4('0x11')](socket);function respondWithRpcPromise(_0x310516,_0x5c7127,_0x322ac0){return new BPromise(function(_0x37a72c,_0x3c12e5){return client[_0x4fb4('0x12')](_0x310516,_0x322ac0)[_0x4fb4('0x13')](function(_0x13cf4a){logger[_0x4fb4('0x14')](_0x4fb4('0x15'),_0x5c7127,_0x4fb4('0x16'));logger[_0x4fb4('0x17')](_0x4fb4('0x18'),_0x5c7127,_0x4fb4('0x16'),JSON['stringify'](_0x13cf4a));if(_0x13cf4a[_0x4fb4('0x19')]){if(_0x13cf4a['error'][_0x4fb4('0x1a')]===0x1f4){logger[_0x4fb4('0x19')](_0x4fb4('0x15'),_0x5c7127,_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);return _0x3c12e5(_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);}logger[_0x4fb4('0x19')]('ChatMessage,\x20%s,\x20%s',_0x5c7127,_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);return _0x37a72c(_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);}else{logger[_0x4fb4('0x14')](_0x4fb4('0x15'),_0x5c7127,_0x4fb4('0x16'));_0x37a72c(_0x13cf4a[_0x4fb4('0x1c')][_0x4fb4('0x1b')]);}})[_0x4fb4('0x1d')](function(_0x5ad027){logger[_0x4fb4('0x19')](_0x4fb4('0x15'),_0x5c7127,_0x5ad027);_0x3c12e5(_0x5ad027);});});}exports['CreateChatMessage']=function(_0x4b2e48){var _0x31c99f=this;return new Promise(function(_0x44e24c,_0x18c38a){return db[_0x4fb4('0x1e')]['create'](_0x4b2e48[_0x4fb4('0x1f')],{'raw':_0x4b2e48[_0x4fb4('0x20')]?_0x4b2e48['options'][_0x4fb4('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x51d30a){logger['info'](_0x4fb4('0x22'),_0x4b2e48);logger[_0x4fb4('0x17')](_0x4fb4('0x22'),_0x4b2e48,JSON[_0x4fb4('0x23')](_0x51d30a));_0x44e24c(_0x51d30a);})['catch'](function(_0x196423){logger['error'](_0x4fb4('0x22'),_0x196423[_0x4fb4('0x1b')],_0x4b2e48);_0x18c38a(_0x31c99f[_0x4fb4('0x19')](0x1f4,_0x196423[_0x4fb4('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b3ce20c..b380db2 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 _0xf2ca=['emit','register','./chatMessage.events','save','remove'];(function(_0x338b5b,_0x100239){var _0x1b55ad=function(_0x20bf87){while(--_0x20bf87){_0x338b5b['push'](_0x338b5b['shift']());}};_0x1b55ad(++_0x100239);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf2ca[_0x413feb];return _0x40ee88;};'use strict';var ChatMessageEvents=require(_0xaf2c('0x0'));var events=[_0xaf2c('0x1'),_0xaf2c('0x2'),'update'];function createListener(_0xbb7f52,_0x2102e2){return function(_0x1271a9){_0x2102e2[_0xaf2c('0x3')](_0xbb7f52,_0x1271a9);};}function removeListener(_0x3a724c,_0x10c910){return function(){ChatMessageEvents['removeListener'](_0x3a724c,_0x10c910);};}exports[_0xaf2c('0x4')]=function(_0x100d17){for(var _0x297740=0x0,_0x1f9531=events['length'];_0x297740<_0x1f9531;_0x297740++){var _0x37fedd=events[_0x297740];var _0x3c0421=createListener('chatMessage:'+_0x37fedd,_0x100d17);ChatMessageEvents['on'](_0x37fedd,_0x3c0421);}}; \ No newline at end of file +var _0x3561=['chatMessage:','./chatMessage.events','remove','update','emit','removeListener','register'];(function(_0x3e1c0b,_0x51fa97){var _0x5bfb8b=function(_0x2ed521){while(--_0x2ed521){_0x3e1c0b['push'](_0x3e1c0b['shift']());}};_0x5bfb8b(++_0x51fa97);}(_0x3561,0x94));var _0x1356=function(_0x127ae9,_0x4ef4b4){_0x127ae9=_0x127ae9-0x0;var _0x9671cd=_0x3561[_0x127ae9];return _0x9671cd;};'use strict';var ChatMessageEvents=require(_0x1356('0x0'));var events=['save',_0x1356('0x1'),_0x1356('0x2')];function createListener(_0x8ef5f,_0x14465e){return function(_0x442fbc){_0x14465e[_0x1356('0x3')](_0x8ef5f,_0x442fbc);};}function removeListener(_0x1634de,_0x116ff0){return function(){ChatMessageEvents[_0x1356('0x4')](_0x1634de,_0x116ff0);};}exports[_0x1356('0x5')]=function(_0x417d11){for(var _0x36e81f=0x0,_0x45ac56=events['length'];_0x36e81f<_0x45ac56;_0x36e81f++){var _0x105aaf=events[_0x36e81f];var _0x33529f=createListener(_0x1356('0x6')+_0x105aaf,_0x417d11);ChatMessageEvents['on'](_0x105aaf,_0x33529f);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 39d57ae..26d2a47 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 _0x5378=['get','isAuthenticated','/describe','describe','/:id','post','tracked','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x55d1a7,_0x1f93c1){var _0x4b5087=function(_0x1e7442){while(--_0x1e7442){_0x55d1a7['push'](_0x55d1a7['shift']());}};_0x4b5087(++_0x1f93c1);}(_0x5378,0x196));var _0x8537=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5378[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x8537('0x0'));var util=require(_0x8537('0x1'));var path=require(_0x8537('0x2'));var timeout=require(_0x8537('0x3'));var express=require(_0x8537('0x4'));var router=express[_0x8537('0x5')]();var fs_extra=require(_0x8537('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8537('0x7'));var config=require(_0x8537('0x8'));var controller=require(_0x8537('0x9'));router[_0x8537('0xa')]('/',auth[_0x8537('0xb')](),controller['index']);router[_0x8537('0xa')](_0x8537('0xc'),auth[_0x8537('0xb')](),controller[_0x8537('0xd')]);router[_0x8537('0xa')](_0x8537('0xe'),auth[_0x8537('0xb')](),controller['show']);router[_0x8537('0xf')]('/',auth[_0x8537('0xb')](),interaction[_0x8537('0x10')]('chat','chatmessage:create'),controller[_0x8537('0x11')]);router[_0x8537('0x12')](_0x8537('0xe'),controller[_0x8537('0x13')]);router['put'](_0x8537('0x14'),auth[_0x8537('0xb')](),controller[_0x8537('0x15')]);router['put'](_0x8537('0x16'),auth[_0x8537('0xb')](),controller[_0x8537('0x17')]);router[_0x8537('0x18')](_0x8537('0xe'),auth[_0x8537('0xb')](),controller['destroy']);module[_0x8537('0x19')]=router; \ No newline at end of file +var _0x8bf9=['post','chat','create','/:id','update','put','accept','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8bf9,0x191));var _0x98bf=function(_0x32b312,_0x4e3f0f){_0x32b312=_0x32b312-0x0;var _0x313368=_0x8bf9[_0x32b312];return _0x313368;};'use strict';var multer=require(_0x98bf('0x0'));var util=require(_0x98bf('0x1'));var path=require('path');var timeout=require(_0x98bf('0x2'));var express=require(_0x98bf('0x3'));var router=express[_0x98bf('0x4')]();var fs_extra=require(_0x98bf('0x5'));var auth=require(_0x98bf('0x6'));var interaction=require(_0x98bf('0x7'));var config=require(_0x98bf('0x8'));var controller=require(_0x98bf('0x9'));router[_0x98bf('0xa')]('/',auth[_0x98bf('0xb')](),controller[_0x98bf('0xc')]);router[_0x98bf('0xa')](_0x98bf('0xd'),auth[_0x98bf('0xb')](),controller[_0x98bf('0xe')]);router[_0x98bf('0xa')]('/:id',auth[_0x98bf('0xb')](),controller['show']);router[_0x98bf('0xf')]('/',auth[_0x98bf('0xb')](),interaction['tracked'](_0x98bf('0x10'),'chatmessage:create'),controller[_0x98bf('0x11')]);router['put'](_0x98bf('0x12'),controller[_0x98bf('0x13')]);router[_0x98bf('0x14')]('/:id/accept',auth[_0x98bf('0xb')](),controller[_0x98bf('0x15')]);router[_0x98bf('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x98bf('0x16')]);router[_0x98bf('0x17')](_0x98bf('0x12'),auth[_0x98bf('0xb')](),controller[_0x98bf('0x18')]);module[_0x98bf('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 6e59720..c696d07 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 _0x5f66=['medium','TEXT','exports'];(function(_0xb2d7c9,_0x49927a){var _0x2e3cf3=function(_0xa5efec){while(--_0xa5efec){_0xb2d7c9['push'](_0xb2d7c9['shift']());}};_0x2e3cf3(++_0x49927a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0xa6cefc,_0x1ffb0b){var _0x1ae289=function(_0x1507a0){while(--_0x1507a0){_0xa6cefc['push'](_0xa6cefc['shift']());}};_0x1ae289(++_0x1ffb0b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0x5f2f[_0x56d1b7];return _0x184d91;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 9031f5f..4c42be4 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(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x7a54,0x106));var _0x47a5=function(_0x88bfb0,_0x874804){_0x88bfb0=_0x88bfb0-0x0;var _0x21f0e9=_0x7a54[_0x88bfb0];return _0x21f0e9;};'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(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x518b63,_0x3e9c08){_0x518b63=_0x518b63-0x0;var _0x152f98=_0x7a54[_0x518b63];return _0x152f98;};'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 01a87e3..00c39f5 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 _0x7a07=['hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x2a94cf,_0x2b970d){var _0x22147f=function(_0xfc71ab){while(--_0xfc71ab){_0x2a94cf['push'](_0x2a94cf['shift']());}};_0x22147f(++_0x2b970d);}(_0x7a07,0x1b1));var _0x77a0=function(_0xc4225c,_0x3e8cd2){_0xc4225c=_0xc4225c-0x0;var _0x409b79=_0x7a07[_0xc4225c];return _0x409b79;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x77a0('0x0'))['db'][_0x77a0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x77a0('0x2')](0x0);var events={'afterCreate':_0x77a0('0x3'),'afterUpdate':_0x77a0('0x4'),'afterDestroy':_0x77a0('0x5')};function emitEvent(_0x20a850){return function(_0x5cac76,_0x34b84c,_0x39bb14){ChatOfflineMessageEvents[_0x77a0('0x6')](_0x20a850+':'+_0x5cac76['id'],_0x5cac76);ChatOfflineMessageEvents[_0x77a0('0x6')](_0x20a850,_0x5cac76);_0x39bb14(null);};}for(var e in events){if(events[_0x77a0('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x77a0('0x8')](e,emitEvent(event));}}module[_0x77a0('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x3a4f=['hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','remove','emit'];(function(_0xbc1e82,_0x51893d){var _0x9f286d=function(_0x4c110a){while(--_0x4c110a){_0xbc1e82['push'](_0xbc1e82['shift']());}};_0x9f286d(++_0x51893d);}(_0x3a4f,0x18b));var _0xf3a4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a4f[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0xf3a4('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xf3a4('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf3a4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf3a4('0x3')};function emitEvent(_0xc1d1d9){return function(_0x5774c4,_0x4c6d11,_0x5a03ec){ChatOfflineMessageEvents['emit'](_0xc1d1d9+':'+_0x5774c4['id'],_0x5774c4);ChatOfflineMessageEvents[_0xf3a4('0x4')](_0xc1d1d9,_0x5774c4);_0x5a03ec(null);};}for(var e in events){if(events[_0xf3a4('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xf3a4('0x6')](e,emitEvent(event));}}module[_0xf3a4('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 63c4eeb..38cd797 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 _0x76fc=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0x76fc,0x6f));var _0xc76f=function(_0x2b029f,_0x32881a){_0x2b029f=_0x2b029f-0x0;var _0x3565b5=_0x76fc[_0x2b029f];return _0x3565b5;};'use strict';var attributes=require(_0xc76f('0x0'));module[_0xc76f('0x1')]=function(_0x21ee89){return _0x21ee89[_0xc76f('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xc76f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc76f('0x4'),'collate':_0xc76f('0x5')});}; \ No newline at end of file +var _0xe451=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4e84b8,_0x5094da){var _0x3e00d1=function(_0x9a6831){while(--_0x9a6831){_0x4e84b8['push'](_0x4e84b8['shift']());}};_0x3e00d1(++_0x5094da);}(_0xe451,0x1ec));var _0x1e45=function(_0x385a10,_0xf8377a){_0x385a10=_0x385a10-0x0;var _0x1fa2d7=_0xe451[_0x385a10];return _0x1fa2d7;};'use strict';var attributes=require(_0x1e45('0x0'));module[_0x1e45('0x1')]=function(_0x4c95a9){return _0x4c95a9['define'](_0x1e45('0x2'),attributes,{'tableName':_0x1e45('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e45('0x4'),'collate':_0x1e45('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6c9a8e7..138838a 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 _0xb2ef=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','message','ChatOfflineMessage,\x20%s,\x20%s','info','lodash'];(function(_0x3caef,_0x37f288){var _0x2ed271=function(_0x21eaad){while(--_0x21eaad){_0x3caef['push'](_0x3caef['shift']());}};_0x2ed271(++_0x37f288);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x1355c6,_0x1f21f0){_0x1355c6=_0x1355c6-0x0;var _0x6f646e=_0xb2ef[_0x1355c6];return _0x6f646e;};'use strict';var _=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var moment=require(_0xfb2e('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb2e('0x3'));var fs=require('fs');var Redis=require(_0xfb2e('0x4'));var db=require(_0xfb2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb2e('0x6'))(_0xfb2e('0x7'));var config=require(_0xfb2e('0x8'));var jayson=require(_0xfb2e('0x9'));var client=jayson[_0xfb2e('0xa')][_0xfb2e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fb22e,_0x72054c,_0x1d0a05){return new BPromise(function(_0x46c641,_0x4f31d6){return client[_0xfb2e('0xc')](_0x1fb22e,_0x1d0a05)[_0xfb2e('0xd')](function(_0x26494e){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x72054c,_0xfb2e('0xe'));logger[_0xfb2e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x72054c,_0xfb2e('0xe'),JSON[_0xfb2e('0x10')](_0x26494e));if(_0x26494e['error']){if(_0x26494e['error']['code']===0x1f4){logger[_0xfb2e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x72054c,_0x26494e[_0xfb2e('0x11')][_0xfb2e('0x12')]);return _0x4f31d6(_0x26494e[_0xfb2e('0x11')][_0xfb2e('0x12')]);}logger[_0xfb2e('0x11')](_0xfb2e('0x13'),_0x72054c,_0x26494e['error'][_0xfb2e('0x12')]);return _0x46c641(_0x26494e[_0xfb2e('0x11')][_0xfb2e('0x12')]);}else{logger[_0xfb2e('0x14')](_0xfb2e('0x13'),_0x72054c,'request\x20sent');_0x46c641(_0x26494e['result']['message']);}})['catch'](function(_0x2ab641){logger[_0xfb2e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x72054c,_0x2ab641);_0x4f31d6(_0x2ab641);});});} \ No newline at end of file +var _0xe528=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','ChatOfflineMessage,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1f622f,_0x52d4e3){var _0x12e56a=function(_0x24749b){while(--_0x24749b){_0x1f622f['push'](_0x1f622f['shift']());}};_0x12e56a(++_0x52d4e3);}(_0xe528,0x9d));var _0x8e52=function(_0x115a8c,_0x3cf74e){_0x115a8c=_0x115a8c-0x0;var _0x42d351=_0xe528[_0x115a8c];return _0x42d351;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8e52('0x0'));var BPromise=require(_0x8e52('0x1'));var rs=require(_0x8e52('0x2'));var fs=require('fs');var Redis=require(_0x8e52('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e52('0x4'))(_0x8e52('0x5'));var config=require(_0x8e52('0x6'));var jayson=require(_0x8e52('0x7'));var client=jayson['client'][_0x8e52('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2be5b8,_0xa7202a,_0xb3f277){return new BPromise(function(_0x8ef34f,_0x38ac36){return client[_0x8e52('0x9')](_0x2be5b8,_0xb3f277)[_0x8e52('0xa')](function(_0x594e8e){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xa7202a,'request\x20sent');logger[_0x8e52('0xb')](_0x8e52('0xc'),_0xa7202a,_0x8e52('0xd'),JSON[_0x8e52('0xe')](_0x594e8e));if(_0x594e8e['error']){if(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x10')]===0x1f4){logger[_0x8e52('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa7202a,_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);return _0x38ac36(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);}logger[_0x8e52('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa7202a,_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);return _0x8ef34f(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);}else{logger[_0x8e52('0x12')](_0x8e52('0x13'),_0xa7202a,_0x8e52('0xd'));_0x8ef34f(_0x594e8e['result'][_0x8e52('0x11')]);}})[_0x8e52('0x14')](function(_0xd3f736){logger[_0x8e52('0xf')](_0x8e52('0x13'),_0xa7202a,_0xd3f736);_0x38ac36(_0xd3f736);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 189703c..3b60e1b 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 _0x7ed2=['/describe','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x38923a,_0x5c384f){var _0x25ba22=function(_0x4bef4d){while(--_0x4bef4d){_0x38923a['push'](_0x38923a['shift']());}};_0x25ba22(++_0x5c384f);}(_0x7ed2,0x82));var _0x27ed=function(_0x49de88,_0x3030f2){_0x49de88=_0x49de88-0x0;var _0x4cc5dd=_0x7ed2[_0x49de88];return _0x4cc5dd;};'use strict';var multer=require(_0x27ed('0x0'));var util=require(_0x27ed('0x1'));var path=require(_0x27ed('0x2'));var timeout=require(_0x27ed('0x3'));var express=require(_0x27ed('0x4'));var router=express[_0x27ed('0x5')]();var fs_extra=require(_0x27ed('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x27ed('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x27ed('0x8')]('/',auth[_0x27ed('0x9')](),controller['index']);router['get'](_0x27ed('0xa'),auth[_0x27ed('0x9')](),controller[_0x27ed('0xb')]);router[_0x27ed('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x27ed('0xc')]);router[_0x27ed('0xd')]('/',auth['isAuthenticated'](),controller[_0x27ed('0xe')]);router[_0x27ed('0xf')](_0x27ed('0x10'),auth[_0x27ed('0x9')](),controller[_0x27ed('0x11')]);router[_0x27ed('0x12')]('/:id',auth[_0x27ed('0x9')](),controller['destroy']);module[_0x27ed('0x13')]=router; \ No newline at end of file +var _0xfb17=['get','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatOfflineMessage.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfb17,0x1ad));var _0x7fb1=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xfb17[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x7fb1('0x0'));var util=require(_0x7fb1('0x1'));var path=require(_0x7fb1('0x2'));var timeout=require(_0x7fb1('0x3'));var express=require(_0x7fb1('0x4'));var router=express[_0x7fb1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7fb1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7fb1('0x7'));router[_0x7fb1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7fb1('0x9'),auth[_0x7fb1('0xa')](),controller['describe']);router[_0x7fb1('0x8')](_0x7fb1('0xb'),auth[_0x7fb1('0xa')](),controller[_0x7fb1('0xc')]);router[_0x7fb1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7fb1('0xe')](_0x7fb1('0xb'),auth[_0x7fb1('0xa')](),controller[_0x7fb1('0xf')]);router[_0x7fb1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7fb1('0x11')]);module[_0x7fb1('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ff7b6e3..18091f5 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 _0x0e72=['mouseOver','timeout','sequelize','STRING','ENUM'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x0e72,0x197));var _0x20e7=function(_0x46b442,_0x380188){_0x46b442=_0x46b442-0x0;var _0x435621=_0x0e72[_0x46b442];return _0x435621;};'use strict';var Sequelize=require(_0x20e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x20e7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x20e7('0x2')](_0x20e7('0x3'),_0x20e7('0x4')),'defaultValue':_0x20e7('0x3')},'selector':{'type':Sequelize[_0x20e7('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc9f5=['mouseOver','timeout','exports','ENUM'];(function(_0xf0bfe6,_0x5d0357){var _0x3872f6=function(_0x3b5f66){while(--_0x3b5f66){_0xf0bfe6['push'](_0xf0bfe6['shift']());}};_0x3872f6(++_0x5d0357);}(_0xc9f5,0x1f2));var _0x5c9f=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xc9f5[_0x4a9beb];return _0x2d4c58;};'use strict';var Sequelize=require('sequelize');module[_0x5c9f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5c9f('0x1')](_0x5c9f('0x2'),_0x5c9f('0x3')),'defaultValue':_0x5c9f('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index de11c5e..46e6b62 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 _0xb138=['name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0xb138,0x1dd));var _0x8b13=function(_0x58fa4a,_0x4ea771){_0x58fa4a=_0x58fa4a-0x0;var _0x4321b6=_0xb138[_0x58fa4a];return _0x4321b6;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={'raw':!![],'where':{'id':_0x3475d8['params']['id']}},_0x2bb51d={};_0x2bb51d[_0x8b13('0x2e')]=_[_0x8b13('0x2f')](db[_0x8b13('0x30')][_0x8b13('0x31')]);_0x2bb51d[_0x8b13('0x32')]=_[_0x8b13('0x2f')](_0x3475d8[_0x8b13('0x32')]);_0x2bb51d[_0x8b13('0x33')]=_[_0x8b13('0x34')](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x32')]);_0x114b01[_0x8b13('0x35')]=_[_0x8b13('0x34')](_0x2bb51d[_0x8b13('0x2e')],qs['fields'](_0x3475d8['query'][_0x8b13('0x36')]));_0x114b01['attributes']=_0x114b01['attributes'][_0x8b13('0x37')]?_0x114b01['attributes']:_0x2bb51d[_0x8b13('0x2e')];if(_0x3475d8[_0x8b13('0x32')][_0x8b13('0x38')]){_0x114b01[_0x8b13('0x39')]=[{'all':!![]}];}_0x114b01=_[_0x8b13('0x3a')]({},_0x114b01,_0x3475d8[_0x8b13('0x3b')]);return db[_0x8b13('0x30')][_0x8b13('0x3c')](_0x114b01)[_0x8b13('0x26')](handleEntityNotFound(_0x1511bf,null))[_0x8b13('0x26')](respondWithResult(_0x1511bf,null))['catch'](handleError(_0x1511bf,null));};exports[_0x8b13('0x3d')]=function(_0x31f5bd,_0x19b21c){return db[_0x8b13('0x30')][_0x8b13('0x3d')](_0x31f5bd[_0x8b13('0x3e')],{})[_0x8b13('0x26')](respondWithResult(_0x19b21c,0xc9))[_0x8b13('0x3f')](handleError(_0x19b21c,null));};exports['update']=function(_0x219bdf,_0x5089c6){if(_0x219bdf[_0x8b13('0x3e')]['id']){delete _0x219bdf[_0x8b13('0x3e')]['id'];}return db[_0x8b13('0x30')][_0x8b13('0x3c')]({'where':{'id':_0x219bdf[_0x8b13('0x40')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x5089c6,null))['then'](saveUpdates(_0x219bdf['body'],null))[_0x8b13('0x26')](respondWithResult(_0x5089c6,null))['catch'](handleError(_0x5089c6,null));};exports[_0x8b13('0x27')]=function(_0x5b7591,_0x590a23){return db[_0x8b13('0x30')][_0x8b13('0x3c')]({'where':{'id':_0x5b7591[_0x8b13('0x40')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x590a23,null))['then'](removeEntity(_0x590a23,null))['catch'](handleError(_0x590a23,null));}; \ No newline at end of file +var _0x482d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','fields','includeAll','merge','catch','create','body','params','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x482d,0x16c));var _0xd482=function(_0x3fb002,_0xdccfe3){_0x3fb002=_0x3fb002-0x0;var _0x481669=_0x482d[_0x3fb002];return _0x481669;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd482('0x0'));var jsonpatch=require(_0xd482('0x1'));var rp=require(_0xd482('0x2'));var moment=require(_0xd482('0x3'));var BPromise=require(_0xd482('0x4'));var Mustache=require(_0xd482('0x5'));var util=require('util');var path=require(_0xd482('0x6'));var sox=require(_0xd482('0x7'));var csv=require(_0xd482('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd482('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd482('0xa'));var deskjs=require(_0xd482('0xb'));var toCsv=require(_0xd482('0x8'));var querystring=require('querystring');var Papa=require(_0xd482('0xc'));var Redis=require(_0xd482('0xd'));var authService=require(_0xd482('0xe'));var qs=require(_0xd482('0xf'));var as=require(_0xd482('0x10'));var hardwareService=require(_0xd482('0x11'));var logger=require(_0xd482('0x12'))(_0xd482('0x13'));var utils=require('../../config/utils');var config=require(_0xd482('0x14'));var licenseUtil=require(_0xd482('0x15'));var db=require(_0xd482('0x16'))['db'];function respondWithStatusCode(_0x2bde45,_0x4b2350){_0x4b2350=_0x4b2350||0xcc;return function(_0x276ba4){if(_0x276ba4){return _0x2bde45[_0xd482('0x17')](_0x4b2350);}return _0x2bde45[_0xd482('0x18')](_0x4b2350)['end']();};}function respondWithResult(_0x248c9d,_0x56d516){_0x56d516=_0x56d516||0xc8;return function(_0x5c5eaa){if(_0x5c5eaa){return _0x248c9d[_0xd482('0x18')](_0x56d516)['json'](_0x5c5eaa);}};}function respondWithFilteredResult(_0x3b6849,_0x3e7067){return function(_0x494272){if(_0x494272){var _0x3f4c2f=typeof _0x3e7067[_0xd482('0x19')]===_0xd482('0x1a')&&typeof _0x3e7067[_0xd482('0x1b')]===_0xd482('0x1a');var _0x499dbc=_0x494272[_0xd482('0x1c')];var _0x1816b7=_0x3f4c2f?0x0:_0x3e7067[_0xd482('0x19')];var _0x5dbc03=_0x3f4c2f?_0x494272[_0xd482('0x1c')]:_0x3e7067[_0xd482('0x19')]+_0x3e7067[_0xd482('0x1b')];var _0x155c35;if(_0x5dbc03>=_0x499dbc){_0x5dbc03=_0x499dbc;_0x155c35=0xc8;}else{_0x155c35=0xce;}_0x3b6849[_0xd482('0x18')](_0x155c35);return _0x3b6849['set']('Content-Range',_0x1816b7+'-'+_0x5dbc03+'/'+_0x499dbc)['json'](_0x494272);}return null;};}function patchUpdates(_0x28d660){return function(_0x1897a7){try{jsonpatch[_0xd482('0x1d')](_0x1897a7,_0x28d660,!![]);}catch(_0x5510cd){return BPromise[_0xd482('0x1e')](_0x5510cd);}return _0x1897a7[_0xd482('0x1f')]();};}function saveUpdates(_0x25d72d,_0xc4b518){return function(_0x76b6ea){if(_0x76b6ea){return _0x76b6ea[_0xd482('0x20')](_0x25d72d)[_0xd482('0x21')](function(_0x305251){return _0x305251;});}return null;};}function removeEntity(_0x58ec59,_0x3a6bba){return function(_0x34c646){if(_0x34c646){return _0x34c646[_0xd482('0x22')]()[_0xd482('0x21')](function(){_0x58ec59[_0xd482('0x18')](0xcc)[_0xd482('0x23')]();});}};}function handleEntityNotFound(_0x1e68c2,_0x1545d8){return function(_0x5075b7){if(!_0x5075b7){_0x1e68c2['sendStatus'](0x194);}return _0x5075b7;};}function handleError(_0x40ee1b,_0x5a78cb){_0x5a78cb=_0x5a78cb||0x1f4;return function(_0x111ebd){logger['error'](_0x111ebd['stack']);if(_0x111ebd['name']){delete _0x111ebd[_0xd482('0x24')];}_0x40ee1b[_0xd482('0x18')](_0x5a78cb)[_0xd482('0x25')](_0x111ebd);};}exports[_0xd482('0x26')]=function(_0x3654fa,_0x3426dd){var _0x1bacca={'raw':!![],'where':{'id':_0x3654fa['params']['id']}},_0x53a958={};_0x53a958[_0xd482('0x27')]=_[_0xd482('0x28')](db[_0xd482('0x29')][_0xd482('0x2a')]);_0x53a958['query']=_[_0xd482('0x28')](_0x3654fa[_0xd482('0x2b')]);_0x53a958[_0xd482('0x2c')]=_['intersection'](_0x53a958[_0xd482('0x27')],_0x53a958[_0xd482('0x2b')]);_0x1bacca[_0xd482('0x2d')]=_['intersection'](_0x53a958[_0xd482('0x27')],qs['fields'](_0x3654fa[_0xd482('0x2b')][_0xd482('0x2e')]));_0x1bacca[_0xd482('0x2d')]=_0x1bacca[_0xd482('0x2d')]['length']?_0x1bacca[_0xd482('0x2d')]:_0x53a958[_0xd482('0x27')];if(_0x3654fa['query'][_0xd482('0x2f')]){_0x1bacca['include']=[{'all':!![]}];}_0x1bacca=_[_0xd482('0x30')]({},_0x1bacca,_0x3654fa['options']);return db['ChatProactiveAction']['find'](_0x1bacca)[_0xd482('0x21')](handleEntityNotFound(_0x3426dd,null))['then'](respondWithResult(_0x3426dd,null))[_0xd482('0x31')](handleError(_0x3426dd,null));};exports[_0xd482('0x32')]=function(_0x46d858,_0x52a8d0){return db[_0xd482('0x29')]['create'](_0x46d858[_0xd482('0x33')],{})[_0xd482('0x21')](respondWithResult(_0x52a8d0,0xc9))[_0xd482('0x31')](handleError(_0x52a8d0,null));};exports[_0xd482('0x20')]=function(_0x1ce476,_0x2566a9){if(_0x1ce476[_0xd482('0x33')]['id']){delete _0x1ce476[_0xd482('0x33')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x1ce476[_0xd482('0x34')]['id']}})[_0xd482('0x21')](handleEntityNotFound(_0x2566a9,null))[_0xd482('0x21')](saveUpdates(_0x1ce476['body'],null))['then'](respondWithResult(_0x2566a9,null))[_0xd482('0x31')](handleError(_0x2566a9,null));};exports[_0xd482('0x22')]=function(_0x4b3654,_0x4a1f52){return db[_0xd482('0x29')][_0xd482('0x35')]({'where':{'id':_0x4b3654[_0xd482('0x34')]['id']}})[_0xd482('0x21')](handleEntityNotFound(_0x4a1f52,null))[_0xd482('0x21')](removeEntity(_0x4a1f52,null))[_0xd482('0x31')](handleError(_0x4a1f52,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index cf89021..0c2cefd 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 _0x768b=['define','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x1b3f40,_0x567c2e){var _0x3f021c=function(_0x3b9ea4){while(--_0x3b9ea4){_0x1b3f40['push'](_0x1b3f40['shift']());}};_0x3f021c(++_0x567c2e);}(_0x768b,0xc2));var _0xb768=function(_0x3a1ccb,_0x5f1f4c){_0x3a1ccb=_0x3a1ccb-0x0;var _0x181a26=_0x768b[_0x3a1ccb];return _0x181a26;};'use strict';var _=require(_0xb768('0x0'));var util=require('util');var logger=require(_0xb768('0x1'))(_0xb768('0x2'));var moment=require(_0xb768('0x3'));var BPromise=require(_0xb768('0x4'));var rp=require(_0xb768('0x5'));var fs=require('fs');var path=require(_0xb768('0x6'));var rimraf=require(_0xb768('0x7'));var config=require(_0xb768('0x8'));var attributes=require(_0xb768('0x9'));module['exports']=function(_0x45fe4c,_0x480a49){return _0x45fe4c[_0xb768('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xb768('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bc5=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x12207c,_0x6c800e){var _0xb3d757=function(_0xf87283){while(--_0xf87283){_0x12207c['push'](_0x12207c['shift']());}};_0xb3d757(++_0x6c800e);}(_0x6bc5,0x68));var _0x56bc=function(_0x5d1702,_0x131b83){_0x5d1702=_0x5d1702-0x0;var _0x5b2ff3=_0x6bc5[_0x5d1702];return _0x5b2ff3;};'use strict';var _=require('lodash');var util=require(_0x56bc('0x0'));var logger=require(_0x56bc('0x1'))(_0x56bc('0x2'));var moment=require(_0x56bc('0x3'));var BPromise=require(_0x56bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56bc('0x5'));var attributes=require(_0x56bc('0x6'));module[_0x56bc('0x7')]=function(_0x11e024,_0x43097e){return _0x11e024[_0x56bc('0x8')](_0x56bc('0x9'),attributes,{'tableName':_0x56bc('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 e034d28..e64f772 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 _0x2b82=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x2d952a,_0x46ae29){var _0x1fa0bf=function(_0x436a0d){while(--_0x436a0d){_0x2d952a['push'](_0x2d952a['shift']());}};_0x1fa0bf(++_0x46ae29);}(_0x2b82,0x16c));var _0x22b8=function(_0x3e9259,_0x2c1f26){_0x3e9259=_0x3e9259-0x0;var _0x5353d6=_0x2b82[_0x3e9259];return _0x5353d6;};'use strict';var _=require('lodash');var util=require(_0x22b8('0x0'));var moment=require(_0x22b8('0x1'));var BPromise=require(_0x22b8('0x2'));var rs=require(_0x22b8('0x3'));var fs=require('fs');var Redis=require(_0x22b8('0x4'));var db=require(_0x22b8('0x5'))['db'];var utils=require(_0x22b8('0x6'));var logger=require(_0x22b8('0x7'))(_0x22b8('0x8'));var config=require(_0x22b8('0x9'));var jayson=require(_0x22b8('0xa'));var client=jayson[_0x22b8('0xb')][_0x22b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57af6e,_0x4f99f1,_0x24c7ec){return new BPromise(function(_0xa0b164,_0x7798f9){return client['request'](_0x57af6e,_0x24c7ec)['then'](function(_0x4825d0){logger[_0x22b8('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f99f1,_0x22b8('0xe'));logger[_0x22b8('0xf')](_0x22b8('0x10'),_0x4f99f1,_0x22b8('0xe'),JSON[_0x22b8('0x11')](_0x4825d0));if(_0x4825d0[_0x22b8('0x12')]){if(_0x4825d0[_0x22b8('0x12')][_0x22b8('0x13')]===0x1f4){logger[_0x22b8('0x12')](_0x22b8('0x14'),_0x4f99f1,_0x4825d0[_0x22b8('0x12')][_0x22b8('0x15')]);return _0x7798f9(_0x4825d0[_0x22b8('0x12')][_0x22b8('0x15')]);}logger['error'](_0x22b8('0x14'),_0x4f99f1,_0x4825d0[_0x22b8('0x12')][_0x22b8('0x15')]);return _0xa0b164(_0x4825d0[_0x22b8('0x12')][_0x22b8('0x15')]);}else{logger[_0x22b8('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f99f1,'request\x20sent');_0xa0b164(_0x4825d0['result'][_0x22b8('0x15')]);}})[_0x22b8('0x16')](function(_0x2ee558){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f99f1,_0x2ee558);_0x7798f9(_0x2ee558);});});} \ No newline at end of file +var _0x2b14=['request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x18c887,_0x80c8df){var _0x574b3e=function(_0x15d4b3){while(--_0x15d4b3){_0x18c887['push'](_0x18c887['shift']());}};_0x574b3e(++_0x80c8df);}(_0x2b14,0x9d));var _0x42b1=function(_0x2b8dd7,_0x227f23){_0x2b8dd7=_0x2b8dd7-0x0;var _0x40953d=_0x2b14[_0x2b8dd7];return _0x40953d;};'use strict';var _=require(_0x42b1('0x0'));var util=require(_0x42b1('0x1'));var moment=require('moment');var BPromise=require(_0x42b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42b1('0x3'));var db=require(_0x42b1('0x4'))['db'];var utils=require(_0x42b1('0x5'));var logger=require(_0x42b1('0x6'))(_0x42b1('0x7'));var config=require(_0x42b1('0x8'));var jayson=require(_0x42b1('0x9'));var client=jayson['client'][_0x42b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x413be3,_0x377cfc,_0x2d6089){return new BPromise(function(_0x48427d,_0x1fc9df){return client[_0x42b1('0xb')](_0x413be3,_0x2d6089)['then'](function(_0x297e05){logger[_0x42b1('0xc')](_0x42b1('0xd'),_0x377cfc,_0x42b1('0xe'));logger['debug'](_0x42b1('0xf'),_0x377cfc,_0x42b1('0xe'),JSON['stringify'](_0x297e05));if(_0x297e05[_0x42b1('0x10')]){if(_0x297e05[_0x42b1('0x10')][_0x42b1('0x11')]===0x1f4){logger['error'](_0x42b1('0xd'),_0x377cfc,_0x297e05[_0x42b1('0x10')][_0x42b1('0x12')]);return _0x1fc9df(_0x297e05[_0x42b1('0x10')][_0x42b1('0x12')]);}logger[_0x42b1('0x10')](_0x42b1('0xd'),_0x377cfc,_0x297e05['error']['message']);return _0x48427d(_0x297e05[_0x42b1('0x10')]['message']);}else{logger[_0x42b1('0xc')](_0x42b1('0xd'),_0x377cfc,_0x42b1('0xe'));_0x48427d(_0x297e05[_0x42b1('0x13')][_0x42b1('0x12')]);}})[_0x42b1('0x14')](function(_0x2ecda8){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x377cfc,_0x2ecda8);_0x1fc9df(_0x2ecda8);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index edc26de..d31250d 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x7da7,0x10d));var _0x77da=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x7da7[_0x1aeda2];return _0x32dc6d;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router; \ No newline at end of file +var _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x102402,_0x4eaaf8){var _0x321b44=function(_0x198c94){while(--_0x198c94){_0x102402['push'](_0x102402['shift']());}};_0x321b44(++_0x4eaaf8);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3e3064,_0x3dd6f5){_0x3e3064=_0x3e3064-0x0;var _0x4547e1=_0xeec6[_0x3e3064];return _0x4547e1;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 20ec207..385c2a6 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 _0xb668=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x56d1b7,_0x1d88f5){var _0x184d91=function(_0x123bdb){while(--_0x123bdb){_0x56d1b7['push'](_0x56d1b7['shift']());}};_0x184d91(++_0x1d88f5);}(_0xb668,0xab));var _0x8b66=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb668[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x8b66('0x0'));module[_0x8b66('0x1')]={'name':{'type':Sequelize[_0x8b66('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8b66('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8b66('0x4'),_0x8b66('0x5'),_0x8b66('0x6'))}}; \ No newline at end of file +var _0x505b=['rrmemory','sequelize','STRING','name','ENUM'];(function(_0x3fd06c,_0x295baa){var _0x18608a=function(_0x3f7674){while(--_0x3f7674){_0x3fd06c['push'](_0x3fd06c['shift']());}};_0x18608a(++_0x295baa);}(_0x505b,0x155));var _0xb505=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x505b[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xb505('0x0'));module['exports']={'name':{'type':Sequelize[_0xb505('0x1')],'unique':_0xb505('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb505('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb505('0x3')](_0xb505('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f1fae30..8949c2f 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 _0xc523=['squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','end','status','json','offset','limit','undefined','count','set','update','then','get','ChatQueues','UserProfileResource','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','ChatQueue','include','query','findAll','rows','catch','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','create','body','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','filters','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','UserChatQueue','User','agent','chatPause','createdAt','%s/%s','updatedAt','Team','where','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','value','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','getAgents','findOne','bluebird','util'];(function(_0x332d98,_0x4cf4ac){var _0x155f32=function(_0x293e55){while(--_0x293e55){_0x332d98['push'](_0x332d98['shift']());}};_0x155f32(++_0x4cf4ac);}(_0xc523,0x74));var _0x3c52=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xc523[_0x18cd5b];return _0x5eaa52;};'use strict';var BPromise=require(_0x3c52('0x0'));var util=require(_0x3c52('0x1'));var _=require('lodash');var squel=require(_0x3c52('0x2'));var Redis=require(_0x3c52('0x3'));var qs=require(_0x3c52('0x4'));var logger=require('../../config/logger')(_0x3c52('0x5'));var config=require(_0x3c52('0x6'));var db=require(_0x3c52('0x7'))['db'];config[_0x3c52('0x8')]=_[_0x3c52('0x9')](config[_0x3c52('0x8')],{'host':_0x3c52('0xa'),'port':0x18eb});var socket=require(_0x3c52('0xb'))(new Redis(config[_0x3c52('0x8')]));require(_0x3c52('0xc'))['register'](socket);function respondWithStatusCode(_0x2796b3,_0x39a1de){_0x39a1de=_0x39a1de||0xcc;return function(_0x265002){if(_0x265002){return _0x2796b3['sendStatus'](_0x39a1de);}return _0x2796b3['status'](_0x39a1de)[_0x3c52('0xd')]();};}function respondWithResult(_0x2468ab,_0x5176fd){_0x5176fd=_0x5176fd||0xc8;return function(_0x55e0cc){if(_0x55e0cc){return _0x2468ab[_0x3c52('0xe')](_0x5176fd)[_0x3c52('0xf')](_0x55e0cc);}};}function respondWithFilteredResult(_0x303956,_0x6a983c){return function(_0x59228e){if(_0x59228e){var _0x387dfa=typeof _0x6a983c[_0x3c52('0x10')]==='undefined'&&typeof _0x6a983c[_0x3c52('0x11')]===_0x3c52('0x12');var _0x26ff0e=_0x59228e[_0x3c52('0x13')];var _0x56b164=_0x387dfa?0x0:_0x6a983c[_0x3c52('0x10')];var _0x65f7ed=_0x387dfa?_0x59228e[_0x3c52('0x13')]:_0x6a983c['offset']+_0x6a983c['limit'];var _0x53af37;if(_0x65f7ed>=_0x26ff0e){_0x65f7ed=_0x26ff0e;_0x53af37=0xc8;}else{_0x53af37=0xce;}_0x303956[_0x3c52('0xe')](_0x53af37);return _0x303956[_0x3c52('0x14')]('Content-Range',_0x56b164+'-'+_0x65f7ed+'/'+_0x26ff0e)[_0x3c52('0xf')](_0x59228e);}return null;};}function saveUpdates(_0x3dc933){return function(_0x4aa746){if(_0x4aa746){return _0x4aa746[_0x3c52('0x15')](_0x3dc933)[_0x3c52('0x16')](function(_0x4b7591){return _0x4b7591;});}return null;};}function removeEntity(_0xe5e0f0){return function(_0x1e7b38){if(_0x1e7b38){return _0x1e7b38['destroy']()[_0x3c52('0x16')](function(){var _0x5e14f6=_0x1e7b38[_0x3c52('0x17')]({'plain':!![]});var _0xd858d7=_0x3c52('0x18');return db[_0x3c52('0x19')]['destroy']({'where':{'type':_0xd858d7,'resourceId':_0x5e14f6['id']}})[_0x3c52('0x16')](function(){return _0x1e7b38;});})[_0x3c52('0x16')](function(){_0xe5e0f0[_0x3c52('0xe')](0xcc)[_0x3c52('0xd')]();});}};}function handleEntityNotFound(_0x39fc1b){return function(_0x541538){if(!_0x541538){_0x39fc1b[_0x3c52('0x1a')](0x194);}return _0x541538;};}function handleError(_0x5588e9,_0x5dd684){_0x5dd684=_0x5dd684||0x1f4;return function(_0x204318){logger[_0x3c52('0x1b')](_0x204318[_0x3c52('0x1c')]);if(_0x204318[_0x3c52('0x1d')]){delete _0x204318[_0x3c52('0x1d')];}_0x5588e9['status'](_0x5dd684)['send'](_0x204318);};}exports['index']=function(_0x36184e,_0x513ac9){var _0x3ae411={};var _0x4bc308={'count':0x0,'rows':[]};var _0x1b7857=_[_0x3c52('0x1e')](db['ChatQueue'][_0x3c52('0x1f')],function(_0x342b3b){return{'name':_0x342b3b[_0x3c52('0x20')],'type':_0x342b3b[_0x3c52('0x21')][_0x3c52('0x22')]};});_0x3ae411=qs['getOptions'](_0x1b7857,_0x36184e);var _0x15b3dd={'where':_0x3ae411['where']};return db[_0x3c52('0x23')][_0x3c52('0x13')](_0x15b3dd)[_0x3c52('0x16')](function(_0x2a872a){_0x4bc308['count']=_0x2a872a;_0x3ae411[_0x3c52('0x24')]=qs[_0x3c52('0x24')](_0x36184e[_0x3c52('0x25')]);return db['ChatQueue'][_0x3c52('0x26')](_0x3ae411);})[_0x3c52('0x16')](function(_0x1fae21){_0x4bc308[_0x3c52('0x27')]=_0x1fae21;return _0x4bc308;})[_0x3c52('0x16')](respondWithFilteredResult(_0x513ac9,_0x3ae411))[_0x3c52('0x28')](handleError(_0x513ac9,null));};exports['show']=function(_0x2bc521,_0x2f91c6){var _0x15e548={'raw':!![],'where':{'id':_0x2bc521[_0x3c52('0x29')]['id']}},_0x34ad9d={};_0x34ad9d[_0x3c52('0x2a')]=_[_0x3c52('0x2b')](db['ChatQueue'][_0x3c52('0x1f')]);_0x34ad9d[_0x3c52('0x25')]=_[_0x3c52('0x2b')](_0x2bc521[_0x3c52('0x25')]);_0x34ad9d['filters']=_[_0x3c52('0x2c')](_0x34ad9d['model'],_0x34ad9d[_0x3c52('0x25')]);_0x15e548[_0x3c52('0x2d')]=_[_0x3c52('0x2c')](_0x34ad9d['model'],qs[_0x3c52('0x2e')](_0x2bc521['query'][_0x3c52('0x2e')]));_0x15e548[_0x3c52('0x2d')]=_0x15e548[_0x3c52('0x2d')][_0x3c52('0x2f')]?_0x15e548[_0x3c52('0x2d')]:_0x34ad9d['model'];if(_0x2bc521['query'][_0x3c52('0x30')]){_0x15e548['include']=[{'all':!![]}];}_0x15e548=_[_0x3c52('0x31')]({},_0x15e548,_0x2bc521[_0x3c52('0x32')]);return db['ChatQueue']['find'](_0x15e548)[_0x3c52('0x16')](handleEntityNotFound(_0x2f91c6,null))[_0x3c52('0x16')](respondWithResult(_0x2f91c6,null))[_0x3c52('0x28')](handleError(_0x2f91c6,null));};exports[_0x3c52('0x33')]=function(_0x3bdf8b,_0x391a19){return db[_0x3c52('0x23')][_0x3c52('0x33')](_0x3bdf8b[_0x3c52('0x34')],{})['then'](function(_0x8fc5dc){var _0x5e44e7=_0x3bdf8b[_0x3c52('0x35')][_0x3c52('0x17')]({'plain':!![]});if(!_0x5e44e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e44e7[_0x3c52('0x36')]===_0x3c52('0x35')){var _0x7e1a5d=_0x8fc5dc[_0x3c52('0x17')]({'plain':!![]});var _0x410d96=_0x3c52('0x18');return db['UserProfileSection'][_0x3c52('0x37')]({'where':{'name':_0x410d96,'userProfileId':_0x5e44e7[_0x3c52('0x38')]},'raw':!![]})[_0x3c52('0x16')](function(_0x7ff286){if(_0x7ff286&&_0x7ff286['autoAssociation']===0x0){return db['UserProfileResource'][_0x3c52('0x33')]({'name':_0x7e1a5d[_0x3c52('0x1d')],'resourceId':_0x7e1a5d['id'],'type':_0x7ff286['name'],'sectionId':_0x7ff286['id']},{})[_0x3c52('0x16')](function(){return _0x8fc5dc;});}else{return _0x8fc5dc;}})['catch'](function(_0x1e81b9){logger[_0x3c52('0x1b')](_0x3c52('0x39'),_0x1e81b9);throw _0x1e81b9;});}return _0x8fc5dc;})[_0x3c52('0x16')](respondWithResult(_0x391a19,0xc9))[_0x3c52('0x28')](handleError(_0x391a19,null));};exports[_0x3c52('0x15')]=function(_0x505aa4,_0x15bb26){if(_0x505aa4[_0x3c52('0x34')]['id']){delete _0x505aa4[_0x3c52('0x34')]['id'];}return db['ChatQueue'][_0x3c52('0x37')]({'where':{'id':_0x505aa4[_0x3c52('0x29')]['id']}})[_0x3c52('0x16')](handleEntityNotFound(_0x15bb26,null))[_0x3c52('0x16')](saveUpdates(_0x505aa4[_0x3c52('0x34')],null))[_0x3c52('0x16')](respondWithResult(_0x15bb26,null))['catch'](handleError(_0x15bb26,null));};exports[_0x3c52('0x3a')]=function(_0x500fe7,_0xd885bb){return db['ChatQueue'][_0x3c52('0x37')]({'where':{'id':_0x500fe7[_0x3c52('0x29')]['id']}})['then'](handleEntityNotFound(_0xd885bb,null))[_0x3c52('0x16')](removeEntity(_0xd885bb,null))[_0x3c52('0x28')](handleError(_0xd885bb,null));};exports[_0x3c52('0x3b')]=function(_0x1fca08,_0x53d8c6){return db[_0x3c52('0x23')][_0x3c52('0x3b')]()[_0x3c52('0x16')](respondWithResult(_0x53d8c6,null))[_0x3c52('0x28')](handleError(_0x53d8c6,null));};exports[_0x3c52('0x3c')]=function(_0x2827da,_0x4a367a){var _0x12d9c7={'raw':!![],'where':{}},_0x445671={},_0x998153;return db['ChatQueue']['findOne']({'where':{'id':_0x2827da['params']['id']}})['then'](handleEntityNotFound(_0x4a367a,null))[_0x3c52('0x16')](function(_0x5bd99c){if(_0x5bd99c){_0x998153=_0x5bd99c[_0x3c52('0x17')]({'plain':!![]});_0x445671[_0x3c52('0x2a')]=_[_0x3c52('0x2b')](db['UserChatQueue'][_0x3c52('0x1f')]);_0x445671[_0x3c52('0x25')]=_[_0x3c52('0x2b')](_0x2827da[_0x3c52('0x25')]);_0x445671[_0x3c52('0x3d')]=_['intersection'](_0x445671[_0x3c52('0x2a')],_0x445671['query']);_0x12d9c7[_0x3c52('0x2d')]=_['intersection'](_0x445671[_0x3c52('0x2a')],qs[_0x3c52('0x2e')](_0x2827da[_0x3c52('0x25')][_0x3c52('0x2e')]));_0x12d9c7['attributes']=_0x12d9c7[_0x3c52('0x2d')][_0x3c52('0x2f')]?_0x12d9c7[_0x3c52('0x2d')]:_0x445671['model'];if(!_0x2827da[_0x3c52('0x25')][_0x3c52('0x3e')](_0x3c52('0x3f'))){_0x12d9c7[_0x3c52('0x11')]=qs[_0x3c52('0x11')](_0x2827da[_0x3c52('0x25')][_0x3c52('0x11')]);_0x12d9c7[_0x3c52('0x10')]=qs[_0x3c52('0x10')](_0x2827da['query'][_0x3c52('0x10')]);}_0x12d9c7[_0x3c52('0x40')]=qs[_0x3c52('0x41')](_0x2827da[_0x3c52('0x25')][_0x3c52('0x41')]);_0x12d9c7['where']=qs['filters'](_[_0x3c52('0x42')](_0x2827da[_0x3c52('0x25')],_0x445671['filters']));_0x12d9c7['where'][_0x3c52('0x43')]=_0x5bd99c['id'];if(_0x2827da[_0x3c52('0x25')][_0x3c52('0x44')]){_0x12d9c7['where']=_[_0x3c52('0x31')](_0x12d9c7['where'],{'$or':_[_0x3c52('0x1e')](_0x12d9c7[_0x3c52('0x2d')],function(_0x24d7fc){var _0x325eba={};_0x325eba[_0x24d7fc]={'$like':'%'+_0x2827da['query'][_0x3c52('0x44')]+'%'};return _0x325eba;})});}_0x12d9c7=_[_0x3c52('0x31')]({},_0x12d9c7,_0x2827da[_0x3c52('0x32')]);return db[_0x3c52('0x45')]['findAll'](_0x12d9c7);}})[_0x3c52('0x16')](function(_0x2f57dd){if(_0x2f57dd){return db[_0x3c52('0x46')]['findAndCountAll']({'where':{'id':_['map'](_0x2f57dd,'UserId'),'role':_0x3c52('0x47')},'attributes':['id',_0x3c52('0x1d'),_0x3c52('0x48'),'updatedAt',_0x3c52('0x49')]});}})[_0x3c52('0x16')](function(_0x21411d){if(_0x21411d){return{'count':_0x21411d[_0x3c52('0x13')],'rows':_[_0x3c52('0x1e')](_0x21411d[_0x3c52('0x27')],function(_0x470df6){return{'membername':_0x470df6[_0x3c52('0x1d')],'UserId':_0x470df6['id'],'queue_name':_0x998153[_0x3c52('0x1d')],'ChatQueueId':_0x998153['id'],'interface':util['format'](_0x3c52('0x4a'),'SIP',_0x470df6[_0x3c52('0x1d')]),'penalty':0x0,'paused':_0x470df6[_0x3c52('0x48')],'createdAt':_0x470df6[_0x3c52('0x49')],'updatedAt':_0x470df6[_0x3c52('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3c52('0x16')](respondWithFilteredResult(_0x4a367a,_0x12d9c7))[_0x3c52('0x28')](handleError(_0x4a367a,null));};exports['getTeams']=function(_0x2f624b,_0x30f963){var _0x5d4375={};var _0x4f4a94={};var _0xe2f5b5;var _0xafcfc8;return db[_0x3c52('0x23')]['findOne']({'where':{'id':_0x2f624b['params']['id']}})[_0x3c52('0x16')](handleEntityNotFound(_0x30f963,null))['then'](function(_0x1b3bd6){if(_0x1b3bd6){_0xe2f5b5=_0x1b3bd6;_0x4f4a94[_0x3c52('0x2a')]=_[_0x3c52('0x2b')](db[_0x3c52('0x4c')][_0x3c52('0x1f')]);_0x4f4a94[_0x3c52('0x25')]=_[_0x3c52('0x2b')](_0x2f624b['query']);_0x4f4a94[_0x3c52('0x3d')]=_[_0x3c52('0x2c')](_0x4f4a94[_0x3c52('0x2a')],_0x4f4a94['query']);_0x5d4375[_0x3c52('0x2d')]=_[_0x3c52('0x2c')](_0x4f4a94[_0x3c52('0x2a')],qs[_0x3c52('0x2e')](_0x2f624b[_0x3c52('0x25')]['fields']));_0x5d4375[_0x3c52('0x2d')]=_0x5d4375[_0x3c52('0x2d')][_0x3c52('0x2f')]?_0x5d4375[_0x3c52('0x2d')]:_0x4f4a94[_0x3c52('0x2a')];_0x5d4375[_0x3c52('0x40')]=qs[_0x3c52('0x41')](_0x2f624b[_0x3c52('0x25')][_0x3c52('0x41')]);_0x5d4375['where']=qs['filters'](_[_0x3c52('0x42')](_0x2f624b[_0x3c52('0x25')],_0x4f4a94['filters']));if(_0x2f624b[_0x3c52('0x25')][_0x3c52('0x44')]){_0x5d4375['where']=_[_0x3c52('0x31')](_0x5d4375[_0x3c52('0x4d')],{'$or':_[_0x3c52('0x1e')](_0x5d4375[_0x3c52('0x2d')],function(_0x1db04d){var _0x526f1b={};_0x526f1b[_0x1db04d]={'$like':'%'+_0x2f624b['query'][_0x3c52('0x44')]+'%'};return _0x526f1b;})});}_0x5d4375=_[_0x3c52('0x31')]({},_0x5d4375,_0x2f624b['options']);return _0xe2f5b5[_0x3c52('0x4e')](_0x5d4375);}})[_0x3c52('0x16')](function(_0x69c51f){if(_0x69c51f){_0xafcfc8=_0x69c51f[_0x3c52('0x2f')];if(!_0x2f624b[_0x3c52('0x25')][_0x3c52('0x3e')](_0x3c52('0x3f'))){_0x5d4375[_0x3c52('0x11')]=qs[_0x3c52('0x11')](_0x2f624b['query'][_0x3c52('0x11')]);_0x5d4375[_0x3c52('0x10')]=qs[_0x3c52('0x10')](_0x2f624b[_0x3c52('0x25')][_0x3c52('0x10')]);}return _0xe2f5b5[_0x3c52('0x4e')](_0x5d4375);}})[_0x3c52('0x16')](function(_0x124563){if(_0x124563){return _0x124563?{'count':_0xafcfc8,'rows':_0x124563}:null;}})[_0x3c52('0x16')](respondWithResult(_0x30f963,null))[_0x3c52('0x28')](handleError(_0x30f963,null));};exports[_0x3c52('0x4f')]=function(_0x3dac70,_0x56fd23){var _0x3bc761=_0x3dac70[_0x3c52('0x34')][_0x3c52('0x50')];return db[_0x3c52('0x4c')][_0x3c52('0x26')]({'where':{'id':_0x3bc761},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3c52('0x51'),'attributes':['id','name',_0x3c52('0x52'),'voicePause',_0x3c52('0x53')],'raw':!![]}]})[_0x3c52('0x16')](function(_0x53abb4){if(_0x53abb4){var _0x50f886=_[_0x3c52('0x54')](_0x53abb4,function(_0x5bb217){var _0x2a765b=_0x5bb217[_0x3c52('0x17')]({'plain':!![]});return _0x2a765b[_0x3c52('0x51')];});return db[_0x3c52('0x23')][_0x3c52('0x37')]({'where':{'id':_0x3dac70[_0x3c52('0x29')]['id']}})[_0x3c52('0x16')](function(_0x43a0d1){return db[_0x3c52('0x55')][_0x3c52('0x56')](function(_0x228974){return _0x43a0d1['addTeams'](_0x3bc761,{'transaction':_0x228974})[_0x3c52('0x16')](function(){return BPromise[_0x3c52('0x57')](_0x50f886,function(_0x549e0a){return db[_0x3c52('0x45')][_0x3c52('0x58')]({'where':{'UserId':_0x549e0a['id'],'ChatQueueId':_0x3dac70[_0x3c52('0x29')]['id']},'transaction':_0x228974});});})[_0x3c52('0x16')](function(){_0x50f886['forEach'](function(_0x4815f6){socket[_0x3c52('0x59')](_0x3c52('0x5a'),{'UserId':_0x4815f6['id'],'ChatQueueId':_0x43a0d1['id']});});});});});}})[_0x3c52('0x16')](respondWithStatusCode(_0x56fd23,null))['catch'](handleError(_0x56fd23,null));};exports['removeTeams']=function(_0x36dd1c,_0x4b0f0b){return db[_0x3c52('0x4c')]['findAll']({'where':{'id':_0x36dd1c[_0x3c52('0x25')][_0x3c52('0x50')]},'attributes':['id'],'include':[{'model':db[_0x3c52('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b0f0b,null))[_0x3c52('0x16')](function(_0x2e541a){var _0x162e38=_[_0x3c52('0x1e')](_0x2e541a,'id');var _0xd192c3=[];var _0x2fa8c8=[];var _0x3bdb67=squel[_0x3c52('0x5b')]();_0x3bdb67[_0x3c52('0x5c')](_0x3c52('0x5d'))['from'](_0x3c52('0x5e'),'tq')[_0x3c52('0x5f')](_0x3c52('0x60'),'ut',_0x3c52('0x61'))[_0x3c52('0x4d')](_0x3c52('0x62'),_0x36dd1c[_0x3c52('0x29')]['id']);for(var _0x1d53fa=0x0;_0x1d53fa<_0x2e541a[_0x3c52('0x2f')];_0x1d53fa+=0x1){let _0x27e525=_0x2e541a[_0x1d53fa];for(var _0x5808bf=0x0;_0x5808bf<_0x27e525[_0x3c52('0x51')][_0x3c52('0x2f')];_0x5808bf+=0x1){let _0x13b170=_0x27e525['Agents'][_0x5808bf];var _0xae0fea=_0x3bdb67[_0x3c52('0x63')]();_0xae0fea[_0x3c52('0x4d')](_0x3c52('0x64'),_0x13b170['id']);_0x2fa8c8[_0x3c52('0x65')](db[_0x3c52('0x55')][_0x3c52('0x25')](_0xae0fea[_0x3c52('0x66')](),{'type':db['sequelize'][_0x3c52('0x67')][_0x3c52('0x68')]})[_0x3c52('0x16')](function(_0x2573b3){if(_0x2573b3[_0x3c52('0x2f')]===0x1){return _0x13b170['id'];}else{var _0x4abe9f=_[_0x3c52('0x69')](_[_0x3c52('0x1e')](_0x2573b3,'TeamId'),function(_0x3f7ebd){return _[_0x3c52('0x6a')](_0x162e38,_0x3f7ebd);});if(_0x4abe9f){return _0x13b170['id'];}}}));}}return BPromise[_0x3c52('0x6b')](_0x2fa8c8)[_0x3c52('0x16')](function(_0x51ff0c){_0xd192c3=_(_0xd192c3)['union'](_0x51ff0c)['compact']()[_0x3c52('0x6c')]();return db['ChatQueue']['find']({'where':{'id':_0x36dd1c[_0x3c52('0x29')]['id']}})['then'](function(_0x1bb9c8){return db[_0x3c52('0x55')][_0x3c52('0x56')](function(_0x156b81){return _0x1bb9c8[_0x3c52('0x6d')](_0x36dd1c['query'][_0x3c52('0x50')],{'transaction':_0x156b81})[_0x3c52('0x16')](function(){if(!_[_0x3c52('0x6e')](_0xd192c3)){return _0x1bb9c8[_0x3c52('0x6f')](_0xd192c3,{'transaction':_0x156b81});}})[_0x3c52('0x16')](function(){_0xd192c3[_0x3c52('0x70')](function(_0x6ea2b3){socket[_0x3c52('0x59')](_0x3c52('0x71'),{'UserId':_0x6ea2b3,'ChatQueueId':_0x1bb9c8['id']});});});});});});})[_0x3c52('0x16')](respondWithStatusCode(_0x4b0f0b,null))[_0x3c52('0x28')](handleError(_0x4b0f0b,null));};exports[_0x3c52('0x72')]=function(_0x2e070a,_0x47a75a){return db[_0x3c52('0x23')]['find']({'where':{'id':_0x2e070a[_0x3c52('0x29')]['id']}})[_0x3c52('0x16')](handleEntityNotFound(_0x47a75a,null))[_0x3c52('0x16')](function(_0x2deb0f){if(_0x2deb0f){return _0x2deb0f[_0x3c52('0x72')](_0x2e070a[_0x3c52('0x34')][_0x3c52('0x50')],_[_0x3c52('0x73')](_0x2e070a[_0x3c52('0x34')],[_0x3c52('0x50'),'id'])||{})['spread'](function(_0x3fe9a9){for(var _0x18419e=0x0;_0x18419e<_0x2e070a[_0x3c52('0x34')][_0x3c52('0x50')][_0x3c52('0x2f')];_0x18419e+=0x1){socket[_0x3c52('0x59')]('userChatQueue:save',{'UserId':Number(_0x2e070a[_0x3c52('0x34')][_0x3c52('0x50')][_0x18419e]),'ChatQueueId':Number(_0x2e070a['params']['id'])});}return _0x3fe9a9;});}})[_0x3c52('0x16')](respondWithResult(_0x47a75a,null))[_0x3c52('0x28')](handleError(_0x47a75a,null));};exports[_0x3c52('0x6f')]=function(_0x5f41c4,_0x1e8531){return db[_0x3c52('0x23')]['find']({'where':{'id':_0x5f41c4[_0x3c52('0x29')]['id']}})[_0x3c52('0x16')](handleEntityNotFound(_0x1e8531,null))[_0x3c52('0x16')](function(_0x409a86){if(_0x409a86){return _0x409a86[_0x3c52('0x6f')](_0x5f41c4[_0x3c52('0x25')][_0x3c52('0x50')])[_0x3c52('0x16')](function(){if(_['isArray'](_0x5f41c4[_0x3c52('0x25')][_0x3c52('0x50')])){for(var _0x53eea9=0x0;_0x53eea9<_0x5f41c4['query'][_0x3c52('0x50')][_0x3c52('0x2f')];_0x53eea9+=0x1){socket[_0x3c52('0x59')](_0x3c52('0x71'),{'UserId':Number(_0x5f41c4[_0x3c52('0x25')][_0x3c52('0x50')][_0x53eea9]),'ChatQueueId':Number(_0x5f41c4['params']['id'])});}}else{socket[_0x3c52('0x59')](_0x3c52('0x71'),{'UserId':Number(_0x5f41c4[_0x3c52('0x25')][_0x3c52('0x50')]),'ChatQueueId':Number(_0x5f41c4['params']['id'])});}});}})[_0x3c52('0x16')](respondWithStatusCode(_0x1e8531,null))['catch'](handleError(_0x1e8531,null));};exports[_0x3c52('0x74')]=function(_0x272ea6,_0x51fc73){var _0x1fe254={};var _0x420c4b={};var _0x53630f;var _0x229b42;return db[_0x3c52('0x23')][_0x3c52('0x75')]({'where':{'id':_0x272ea6[_0x3c52('0x29')]['id']}})[_0x3c52('0x16')](handleEntityNotFound(_0x51fc73,null))[_0x3c52('0x16')](function(_0x2d387e){if(_0x2d387e){_0x53630f=_0x2d387e;_0x420c4b[_0x3c52('0x2a')]=_['keys'](db[_0x3c52('0x46')]['rawAttributes']);_0x420c4b['query']=_['keys'](_0x272ea6[_0x3c52('0x25')]);_0x420c4b[_0x3c52('0x3d')]=_['intersection'](_0x420c4b[_0x3c52('0x2a')],_0x420c4b[_0x3c52('0x25')]);_0x1fe254[_0x3c52('0x2d')]=_[_0x3c52('0x2c')](_0x420c4b[_0x3c52('0x2a')],qs['fields'](_0x272ea6[_0x3c52('0x25')]['fields']));_0x1fe254['attributes']=_0x1fe254['attributes'][_0x3c52('0x2f')]?_0x1fe254[_0x3c52('0x2d')]:_0x420c4b[_0x3c52('0x2a')];_0x1fe254[_0x3c52('0x40')]=qs[_0x3c52('0x41')](_0x272ea6[_0x3c52('0x25')][_0x3c52('0x41')]);_0x1fe254['where']=qs[_0x3c52('0x3d')](_[_0x3c52('0x42')](_0x272ea6[_0x3c52('0x25')],_0x420c4b['filters']));if(_0x272ea6['query'][_0x3c52('0x44')]){_0x1fe254['where']=_[_0x3c52('0x31')](_0x1fe254[_0x3c52('0x4d')],{'$or':_['map'](_0x1fe254['attributes'],function(_0x3962d7){var _0x39db35={};_0x39db35[_0x3962d7]={'$like':'%'+_0x272ea6[_0x3c52('0x25')]['filter']+'%'};return _0x39db35;})});}_0x1fe254=_[_0x3c52('0x31')]({},_0x1fe254,_0x272ea6[_0x3c52('0x32')]);return _0x53630f['getAgents'](_0x1fe254);}})['then'](function(_0x68ca88){if(_0x68ca88){_0x229b42=_0x68ca88[_0x3c52('0x2f')];if(!_0x272ea6[_0x3c52('0x25')][_0x3c52('0x3e')](_0x3c52('0x3f'))){_0x1fe254['limit']=qs[_0x3c52('0x11')](_0x272ea6[_0x3c52('0x25')][_0x3c52('0x11')]);_0x1fe254['offset']=qs[_0x3c52('0x10')](_0x272ea6[_0x3c52('0x25')][_0x3c52('0x10')]);}return _0x53630f[_0x3c52('0x74')](_0x1fe254);}})[_0x3c52('0x16')](function(_0x2e0274){if(_0x2e0274){return _0x2e0274?{'count':_0x229b42,'rows':_0x2e0274}:null;}})['then'](respondWithResult(_0x51fc73,null))[_0x3c52('0x28')](handleError(_0x51fc73,null));}; \ No newline at end of file +var _0x0100=['addTeams','ids','Agents','online','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','hasOwnProperty','bluebird','lodash','../../config/logger','api','../../config/environment','redis','defaults','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','intersection','model','fields','attributes','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','length','order','sort','pick','filter','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0100,0x184));var _0x0010=function(_0x327607,_0xe7a1a){_0x327607=_0x327607-0x0;var _0x21510=_0x0100[_0x327607];return _0x21510;};'use strict';var BPromise=require(_0x0010('0x0'));var util=require('util');var _=require(_0x0010('0x1'));var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0010('0x2'))(_0x0010('0x3'));var config=require(_0x0010('0x4'));var db=require('../../mysqldb')['db'];config[_0x0010('0x5')]=_[_0x0010('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x0010('0x7')](socket);function respondWithStatusCode(_0x571eda,_0x26be81){_0x26be81=_0x26be81||0xcc;return function(_0x2085a6){if(_0x2085a6){return _0x571eda['sendStatus'](_0x26be81);}return _0x571eda[_0x0010('0x8')](_0x26be81)[_0x0010('0x9')]();};}function respondWithResult(_0xcf0388,_0x3dd787){_0x3dd787=_0x3dd787||0xc8;return function(_0x38ac06){if(_0x38ac06){return _0xcf0388[_0x0010('0x8')](_0x3dd787)[_0x0010('0xa')](_0x38ac06);}};}function respondWithFilteredResult(_0x30f586,_0x47a88c){return function(_0x2f320f){if(_0x2f320f){var _0x5082e1=typeof _0x47a88c[_0x0010('0xb')]===_0x0010('0xc')&&typeof _0x47a88c[_0x0010('0xd')]==='undefined';var _0x13c8af=_0x2f320f['count'];var _0x31e5a5=_0x5082e1?0x0:_0x47a88c[_0x0010('0xb')];var _0x368268=_0x5082e1?_0x2f320f[_0x0010('0xe')]:_0x47a88c[_0x0010('0xb')]+_0x47a88c['limit'];var _0x97f156;if(_0x368268>=_0x13c8af){_0x368268=_0x13c8af;_0x97f156=0xc8;}else{_0x97f156=0xce;}_0x30f586['status'](_0x97f156);return _0x30f586[_0x0010('0xf')](_0x0010('0x10'),_0x31e5a5+'-'+_0x368268+'/'+_0x13c8af)[_0x0010('0xa')](_0x2f320f);}return null;};}function saveUpdates(_0x1d8e9f){return function(_0x190591){if(_0x190591){return _0x190591[_0x0010('0x11')](_0x1d8e9f)[_0x0010('0x12')](function(_0x2bc961){return _0x2bc961;});}return null;};}function removeEntity(_0xc729b8){return function(_0xe4146f){if(_0xe4146f){return _0xe4146f[_0x0010('0x13')]()[_0x0010('0x12')](function(){var _0x1035b8=_0xe4146f[_0x0010('0x14')]({'plain':!![]});var _0x1fe355=_0x0010('0x15');return db['UserProfileResource'][_0x0010('0x13')]({'where':{'type':_0x1fe355,'resourceId':_0x1035b8['id']}})[_0x0010('0x12')](function(){return _0xe4146f;});})[_0x0010('0x12')](function(){_0xc729b8['status'](0xcc)[_0x0010('0x9')]();});}};}function handleEntityNotFound(_0x2f14dc){return function(_0x53e0a9){if(!_0x53e0a9){_0x2f14dc['sendStatus'](0x194);}return _0x53e0a9;};}function handleError(_0x4ac0db,_0x1e7d02){_0x1e7d02=_0x1e7d02||0x1f4;return function(_0x1edc99){logger[_0x0010('0x16')](_0x1edc99[_0x0010('0x17')]);if(_0x1edc99[_0x0010('0x18')]){delete _0x1edc99[_0x0010('0x18')];}_0x4ac0db[_0x0010('0x8')](_0x1e7d02)[_0x0010('0x19')](_0x1edc99);};}exports[_0x0010('0x1a')]=function(_0x514b09,_0x3bfb7f){var _0x13c483={};var _0x48b328={'count':0x0,'rows':[]};var _0x568601=_[_0x0010('0x1b')](db[_0x0010('0x1c')][_0x0010('0x1d')],function(_0x3ff16a){return{'name':_0x3ff16a[_0x0010('0x1e')],'type':_0x3ff16a['type'][_0x0010('0x1f')]};});_0x13c483=qs[_0x0010('0x20')](_0x568601,_0x514b09);var _0x4249fd={'where':_0x13c483[_0x0010('0x21')]};return db[_0x0010('0x1c')][_0x0010('0xe')](_0x4249fd)[_0x0010('0x12')](function(_0x28f813){_0x48b328[_0x0010('0xe')]=_0x28f813;_0x13c483['include']=qs[_0x0010('0x22')](_0x514b09[_0x0010('0x23')]);return db[_0x0010('0x1c')][_0x0010('0x24')](_0x13c483);})[_0x0010('0x12')](function(_0x1fdcf2){_0x48b328[_0x0010('0x25')]=_0x1fdcf2;return _0x48b328;})[_0x0010('0x12')](respondWithFilteredResult(_0x3bfb7f,_0x13c483))[_0x0010('0x26')](handleError(_0x3bfb7f,null));};exports[_0x0010('0x27')]=function(_0x39db37,_0x5b9d5a){var _0x12c2a2={'raw':!![],'where':{'id':_0x39db37[_0x0010('0x28')]['id']}},_0x64b645={};_0x64b645['model']=_['keys'](db[_0x0010('0x1c')]['rawAttributes']);_0x64b645[_0x0010('0x23')]=_[_0x0010('0x29')](_0x39db37['query']);_0x64b645['filters']=_[_0x0010('0x2a')](_0x64b645[_0x0010('0x2b')],_0x64b645[_0x0010('0x23')]);_0x12c2a2['attributes']=_[_0x0010('0x2a')](_0x64b645[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0x39db37[_0x0010('0x23')][_0x0010('0x2c')]));_0x12c2a2[_0x0010('0x2d')]=_0x12c2a2[_0x0010('0x2d')]['length']?_0x12c2a2[_0x0010('0x2d')]:_0x64b645[_0x0010('0x2b')];if(_0x39db37['query'][_0x0010('0x2e')]){_0x12c2a2[_0x0010('0x22')]=[{'all':!![]}];}_0x12c2a2=_[_0x0010('0x2f')]({},_0x12c2a2,_0x39db37[_0x0010('0x30')]);return db['ChatQueue']['find'](_0x12c2a2)['then'](handleEntityNotFound(_0x5b9d5a,null))[_0x0010('0x12')](respondWithResult(_0x5b9d5a,null))[_0x0010('0x26')](handleError(_0x5b9d5a,null));};exports[_0x0010('0x31')]=function(_0x3b3b5c,_0x32ee88){return db[_0x0010('0x1c')][_0x0010('0x31')](_0x3b3b5c[_0x0010('0x32')],{})[_0x0010('0x12')](function(_0x4e352e){var _0x2f9816=_0x3b3b5c[_0x0010('0x33')][_0x0010('0x14')]({'plain':!![]});if(!_0x2f9816)throw new Error(_0x0010('0x34'));if(_0x2f9816[_0x0010('0x35')]==='user'){var _0x47f9e2=_0x4e352e['get']({'plain':!![]});var _0x3d9ed2=_0x0010('0x15');return db[_0x0010('0x36')][_0x0010('0x37')]({'where':{'name':_0x3d9ed2,'userProfileId':_0x2f9816['userProfileId']},'raw':!![]})[_0x0010('0x12')](function(_0x227f12){if(_0x227f12&&_0x227f12['autoAssociation']===0x0){return db[_0x0010('0x38')][_0x0010('0x31')]({'name':_0x47f9e2[_0x0010('0x18')],'resourceId':_0x47f9e2['id'],'type':_0x227f12[_0x0010('0x18')],'sectionId':_0x227f12['id']},{})[_0x0010('0x12')](function(){return _0x4e352e;});}else{return _0x4e352e;}})[_0x0010('0x26')](function(_0xa47fbd){logger['error'](_0x0010('0x39'),_0xa47fbd);throw _0xa47fbd;});}return _0x4e352e;})[_0x0010('0x12')](respondWithResult(_0x32ee88,0xc9))[_0x0010('0x26')](handleError(_0x32ee88,null));};exports[_0x0010('0x11')]=function(_0x1406e4,_0x548be4){if(_0x1406e4[_0x0010('0x32')]['id']){delete _0x1406e4[_0x0010('0x32')]['id'];}return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x1406e4[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x548be4,null))[_0x0010('0x12')](saveUpdates(_0x1406e4[_0x0010('0x32')],null))[_0x0010('0x12')](respondWithResult(_0x548be4,null))['catch'](handleError(_0x548be4,null));};exports[_0x0010('0x13')]=function(_0x5bd82c,_0x6e1cec){return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x5bd82c['params']['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x6e1cec,null))[_0x0010('0x12')](removeEntity(_0x6e1cec,null))[_0x0010('0x26')](handleError(_0x6e1cec,null));};exports[_0x0010('0x3a')]=function(_0xb645f8,_0x23f558){return db[_0x0010('0x1c')][_0x0010('0x3a')]()[_0x0010('0x12')](respondWithResult(_0x23f558,null))['catch'](handleError(_0x23f558,null));};exports[_0x0010('0x3b')]=function(_0xc0f6d2,_0x3bf09d){var _0x49bc80={'raw':!![],'where':{}},_0x3e0c8f={},_0x2b9f65;return db[_0x0010('0x1c')][_0x0010('0x3c')]({'where':{'id':_0xc0f6d2[_0x0010('0x28')]['id']}})['then'](handleEntityNotFound(_0x3bf09d,null))[_0x0010('0x12')](function(_0x54a584){if(_0x54a584){_0x2b9f65=_0x54a584[_0x0010('0x14')]({'plain':!![]});_0x3e0c8f[_0x0010('0x2b')]=_[_0x0010('0x29')](db[_0x0010('0x3d')][_0x0010('0x1d')]);_0x3e0c8f[_0x0010('0x23')]=_[_0x0010('0x29')](_0xc0f6d2['query']);_0x3e0c8f[_0x0010('0x3e')]=_[_0x0010('0x2a')](_0x3e0c8f[_0x0010('0x2b')],_0x3e0c8f['query']);_0x49bc80['attributes']=_[_0x0010('0x2a')](_0x3e0c8f[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0xc0f6d2['query'][_0x0010('0x2c')]));_0x49bc80[_0x0010('0x2d')]=_0x49bc80[_0x0010('0x2d')][_0x0010('0x3f')]?_0x49bc80[_0x0010('0x2d')]:_0x3e0c8f[_0x0010('0x2b')];if(!_0xc0f6d2[_0x0010('0x23')]['hasOwnProperty']('nolimit')){_0x49bc80['limit']=qs[_0x0010('0xd')](_0xc0f6d2['query'][_0x0010('0xd')]);_0x49bc80[_0x0010('0xb')]=qs[_0x0010('0xb')](_0xc0f6d2['query'][_0x0010('0xb')]);}_0x49bc80[_0x0010('0x40')]=qs[_0x0010('0x41')](_0xc0f6d2[_0x0010('0x23')][_0x0010('0x41')]);_0x49bc80[_0x0010('0x21')]=qs[_0x0010('0x3e')](_[_0x0010('0x42')](_0xc0f6d2[_0x0010('0x23')],_0x3e0c8f[_0x0010('0x3e')]));_0x49bc80['where']['ChatQueueId']=_0x54a584['id'];if(_0xc0f6d2[_0x0010('0x23')][_0x0010('0x43')]){_0x49bc80[_0x0010('0x21')]=_[_0x0010('0x2f')](_0x49bc80['where'],{'$or':_[_0x0010('0x1b')](_0x49bc80['attributes'],function(_0x662f09){var _0x27e6cc={};_0x27e6cc[_0x662f09]={'$like':'%'+_0xc0f6d2[_0x0010('0x23')][_0x0010('0x43')]+'%'};return _0x27e6cc;})});}_0x49bc80=_['merge']({},_0x49bc80,_0xc0f6d2[_0x0010('0x30')]);return db[_0x0010('0x3d')][_0x0010('0x24')](_0x49bc80);}})[_0x0010('0x12')](function(_0x5da2ec){if(_0x5da2ec){return db[_0x0010('0x44')][_0x0010('0x45')]({'where':{'id':_[_0x0010('0x1b')](_0x5da2ec,_0x0010('0x46')),'role':'agent'},'attributes':['id',_0x0010('0x18'),_0x0010('0x47'),_0x0010('0x48'),_0x0010('0x49')]});}})[_0x0010('0x12')](function(_0x1722ff){if(_0x1722ff){return{'count':_0x1722ff[_0x0010('0xe')],'rows':_[_0x0010('0x1b')](_0x1722ff[_0x0010('0x25')],function(_0xe3a170){return{'membername':_0xe3a170[_0x0010('0x18')],'UserId':_0xe3a170['id'],'queue_name':_0x2b9f65[_0x0010('0x18')],'ChatQueueId':_0x2b9f65['id'],'interface':util[_0x0010('0x4a')](_0x0010('0x4b'),_0x0010('0x4c'),_0xe3a170[_0x0010('0x18')]),'penalty':0x0,'paused':_0xe3a170[_0x0010('0x47')],'createdAt':_0xe3a170['createdAt'],'updatedAt':_0xe3a170['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0010('0x12')](respondWithFilteredResult(_0x3bf09d,_0x49bc80))[_0x0010('0x26')](handleError(_0x3bf09d,null));};exports[_0x0010('0x4d')]=function(_0x2c2649,_0x539bd9){var _0x34973f={};var _0x307b87={};var _0x4a7559;var _0x9121;return db[_0x0010('0x1c')][_0x0010('0x3c')]({'where':{'id':_0x2c2649[_0x0010('0x28')]['id']}})['then'](handleEntityNotFound(_0x539bd9,null))[_0x0010('0x12')](function(_0x3761da){if(_0x3761da){_0x4a7559=_0x3761da;_0x307b87[_0x0010('0x2b')]=_[_0x0010('0x29')](db[_0x0010('0x4e')]['rawAttributes']);_0x307b87['query']=_[_0x0010('0x29')](_0x2c2649[_0x0010('0x23')]);_0x307b87[_0x0010('0x3e')]=_[_0x0010('0x2a')](_0x307b87[_0x0010('0x2b')],_0x307b87[_0x0010('0x23')]);_0x34973f[_0x0010('0x2d')]=_[_0x0010('0x2a')](_0x307b87[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0x2c2649[_0x0010('0x23')][_0x0010('0x2c')]));_0x34973f[_0x0010('0x2d')]=_0x34973f[_0x0010('0x2d')]['length']?_0x34973f[_0x0010('0x2d')]:_0x307b87[_0x0010('0x2b')];_0x34973f[_0x0010('0x40')]=qs['sort'](_0x2c2649['query'][_0x0010('0x41')]);_0x34973f[_0x0010('0x21')]=qs[_0x0010('0x3e')](_[_0x0010('0x42')](_0x2c2649[_0x0010('0x23')],_0x307b87['filters']));if(_0x2c2649[_0x0010('0x23')][_0x0010('0x43')]){_0x34973f[_0x0010('0x21')]=_['merge'](_0x34973f[_0x0010('0x21')],{'$or':_[_0x0010('0x1b')](_0x34973f[_0x0010('0x2d')],function(_0x19fc7a){var _0x391bd7={};_0x391bd7[_0x19fc7a]={'$like':'%'+_0x2c2649[_0x0010('0x23')][_0x0010('0x43')]+'%'};return _0x391bd7;})});}_0x34973f=_['merge']({},_0x34973f,_0x2c2649[_0x0010('0x30')]);return _0x4a7559['getTeams'](_0x34973f);}})[_0x0010('0x12')](function(_0x456f5a){if(_0x456f5a){_0x9121=_0x456f5a['length'];if(!_0x2c2649['query']['hasOwnProperty'](_0x0010('0x4f'))){_0x34973f[_0x0010('0xd')]=qs[_0x0010('0xd')](_0x2c2649['query']['limit']);_0x34973f['offset']=qs['offset'](_0x2c2649['query'][_0x0010('0xb')]);}return _0x4a7559[_0x0010('0x4d')](_0x34973f);}})[_0x0010('0x12')](function(_0x2c5531){if(_0x2c5531){return _0x2c5531?{'count':_0x9121,'rows':_0x2c5531}:null;}})[_0x0010('0x12')](respondWithResult(_0x539bd9,null))[_0x0010('0x26')](handleError(_0x539bd9,null));};exports[_0x0010('0x50')]=function(_0x15d380,_0x3601d6){var _0x1be7ab=_0x15d380[_0x0010('0x32')][_0x0010('0x51')];return db[_0x0010('0x4e')][_0x0010('0x24')]({'where':{'id':_0x1be7ab},'attributes':['id'],'include':[{'model':db[_0x0010('0x44')],'as':_0x0010('0x52'),'attributes':['id',_0x0010('0x18'),_0x0010('0x53'),'voicePause','interface'],'raw':!![]}]})[_0x0010('0x12')](function(_0x2b0a11){if(_0x2b0a11){var _0x2307c3=_[_0x0010('0x54')](_0x2b0a11,function(_0x4aa559){var _0x336ada=_0x4aa559[_0x0010('0x14')]({'plain':!![]});return _0x336ada[_0x0010('0x52')];});return db['ChatQueue'][_0x0010('0x37')]({'where':{'id':_0x15d380[_0x0010('0x28')]['id']}})[_0x0010('0x12')](function(_0x2c0ee6){return db[_0x0010('0x55')]['transaction'](function(_0x4d6658){return _0x2c0ee6[_0x0010('0x50')](_0x1be7ab,{'transaction':_0x4d6658})['then'](function(){return BPromise[_0x0010('0x56')](_0x2307c3,function(_0x2e99ac){return db[_0x0010('0x3d')][_0x0010('0x57')]({'where':{'UserId':_0x2e99ac['id'],'ChatQueueId':_0x15d380[_0x0010('0x28')]['id']},'transaction':_0x4d6658});});})[_0x0010('0x12')](function(){_0x2307c3[_0x0010('0x58')](function(_0x30a327){socket[_0x0010('0x59')](_0x0010('0x5a'),{'UserId':_0x30a327['id'],'ChatQueueId':_0x2c0ee6['id']});});});});});}})[_0x0010('0x12')](respondWithStatusCode(_0x3601d6,null))[_0x0010('0x26')](handleError(_0x3601d6,null));};exports[_0x0010('0x5b')]=function(_0x24ea4f,_0x5817e1){return db[_0x0010('0x4e')][_0x0010('0x24')]({'where':{'id':_0x24ea4f[_0x0010('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0010('0x44')],'as':_0x0010('0x52'),'attributes':['id'],'raw':!![]}]})[_0x0010('0x12')](handleEntityNotFound(_0x5817e1,null))[_0x0010('0x12')](function(_0x21cabe){var _0x26c603=_[_0x0010('0x1b')](_0x21cabe,'id');var _0x251a11=[];var _0xd60c0c=[];var _0x9564f9=squel[_0x0010('0x5c')]();_0x9564f9['field'](_0x0010('0x5d'))[_0x0010('0x5e')](_0x0010('0x5f'),'tq')['join'](_0x0010('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0010('0x21')](_0x0010('0x61'),_0x24ea4f[_0x0010('0x28')]['id']);for(var _0x586a26=0x0;_0x586a26<_0x21cabe['length'];_0x586a26+=0x1){let _0x1889f2=_0x21cabe[_0x586a26];for(var _0x557d13=0x0;_0x557d13<_0x1889f2[_0x0010('0x52')]['length'];_0x557d13+=0x1){let _0x522aef=_0x1889f2[_0x0010('0x52')][_0x557d13];var _0x180292=_0x9564f9['clone']();_0x180292['where'](_0x0010('0x62'),_0x522aef['id']);_0xd60c0c[_0x0010('0x63')](db[_0x0010('0x55')][_0x0010('0x23')](_0x180292[_0x0010('0x64')](),{'type':db[_0x0010('0x55')][_0x0010('0x65')][_0x0010('0x66')]})[_0x0010('0x12')](function(_0xf27ebf){if(_0xf27ebf[_0x0010('0x3f')]===0x1){return _0x522aef['id'];}else{var _0x3768f3=_[_0x0010('0x67')](_[_0x0010('0x1b')](_0xf27ebf,_0x0010('0x68')),function(_0x290eac){return _[_0x0010('0x69')](_0x26c603,_0x290eac);});if(_0x3768f3){return _0x522aef['id'];}}}));}}return BPromise[_0x0010('0x6a')](_0xd60c0c)['then'](function(_0x22d6f9){_0x251a11=_(_0x251a11)['union'](_0x22d6f9)['compact']()[_0x0010('0x6b')]();return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x24ea4f['params']['id']}})[_0x0010('0x12')](function(_0x2d2698){return db[_0x0010('0x55')][_0x0010('0x6c')](function(_0x29bd41){return _0x2d2698[_0x0010('0x5b')](_0x24ea4f[_0x0010('0x23')][_0x0010('0x51')],{'transaction':_0x29bd41})[_0x0010('0x12')](function(){if(!_[_0x0010('0x6d')](_0x251a11)){return _0x2d2698[_0x0010('0x6e')](_0x251a11,{'transaction':_0x29bd41});}})[_0x0010('0x12')](function(){_0x251a11[_0x0010('0x58')](function(_0x289a20){socket[_0x0010('0x59')](_0x0010('0x6f'),{'UserId':_0x289a20,'ChatQueueId':_0x2d2698['id']});});});});});});})[_0x0010('0x12')](respondWithStatusCode(_0x5817e1,null))['catch'](handleError(_0x5817e1,null));};exports['addAgents']=function(_0x338713,_0x2c9c35){return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x338713[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x2c9c35,null))[_0x0010('0x12')](function(_0x5682bc){if(_0x5682bc){return _0x5682bc[_0x0010('0x70')](_0x338713[_0x0010('0x32')][_0x0010('0x51')],_[_0x0010('0x71')](_0x338713['body'],[_0x0010('0x51'),'id'])||{})['spread'](function(_0x13323b){for(var _0x19aeb5=0x0;_0x19aeb5<_0x338713[_0x0010('0x32')][_0x0010('0x51')][_0x0010('0x3f')];_0x19aeb5+=0x1){socket[_0x0010('0x59')](_0x0010('0x5a'),{'UserId':Number(_0x338713[_0x0010('0x32')][_0x0010('0x51')][_0x19aeb5]),'ChatQueueId':Number(_0x338713[_0x0010('0x28')]['id'])});}return _0x13323b;});}})[_0x0010('0x12')](respondWithResult(_0x2c9c35,null))[_0x0010('0x26')](handleError(_0x2c9c35,null));};exports[_0x0010('0x6e')]=function(_0x2208ed,_0x2b063a){return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x2208ed[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x2b063a,null))['then'](function(_0x9e41f){if(_0x9e41f){return _0x9e41f[_0x0010('0x6e')](_0x2208ed[_0x0010('0x23')][_0x0010('0x51')])[_0x0010('0x12')](function(){if(_[_0x0010('0x72')](_0x2208ed[_0x0010('0x23')][_0x0010('0x51')])){for(var _0x3be8da=0x0;_0x3be8da<_0x2208ed[_0x0010('0x23')][_0x0010('0x51')]['length'];_0x3be8da+=0x1){socket['emit'](_0x0010('0x6f'),{'UserId':Number(_0x2208ed[_0x0010('0x23')][_0x0010('0x51')][_0x3be8da]),'ChatQueueId':Number(_0x2208ed[_0x0010('0x28')]['id'])});}}else{socket[_0x0010('0x59')](_0x0010('0x6f'),{'UserId':Number(_0x2208ed[_0x0010('0x23')]['ids']),'ChatQueueId':Number(_0x2208ed[_0x0010('0x28')]['id'])});}});}})[_0x0010('0x12')](respondWithStatusCode(_0x2b063a,null))[_0x0010('0x26')](handleError(_0x2b063a,null));};exports[_0x0010('0x73')]=function(_0x558e28,_0x1fc55b){var _0x19ffe4={};var _0x4eb1ea={};var _0x52f35d;var _0x4931b7;return db[_0x0010('0x1c')][_0x0010('0x3c')]({'where':{'id':_0x558e28[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x1fc55b,null))[_0x0010('0x12')](function(_0x2b5ec6){if(_0x2b5ec6){_0x52f35d=_0x2b5ec6;_0x4eb1ea[_0x0010('0x2b')]=_['keys'](db[_0x0010('0x44')][_0x0010('0x1d')]);_0x4eb1ea[_0x0010('0x23')]=_[_0x0010('0x29')](_0x558e28[_0x0010('0x23')]);_0x4eb1ea['filters']=_[_0x0010('0x2a')](_0x4eb1ea['model'],_0x4eb1ea['query']);_0x19ffe4[_0x0010('0x2d')]=_[_0x0010('0x2a')](_0x4eb1ea[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0x558e28[_0x0010('0x23')][_0x0010('0x2c')]));_0x19ffe4[_0x0010('0x2d')]=_0x19ffe4[_0x0010('0x2d')][_0x0010('0x3f')]?_0x19ffe4[_0x0010('0x2d')]:_0x4eb1ea[_0x0010('0x2b')];_0x19ffe4[_0x0010('0x40')]=qs[_0x0010('0x41')](_0x558e28['query'][_0x0010('0x41')]);_0x19ffe4[_0x0010('0x21')]=qs[_0x0010('0x3e')](_[_0x0010('0x42')](_0x558e28[_0x0010('0x23')],_0x4eb1ea[_0x0010('0x3e')]));if(_0x558e28[_0x0010('0x23')]['filter']){_0x19ffe4['where']=_['merge'](_0x19ffe4['where'],{'$or':_['map'](_0x19ffe4[_0x0010('0x2d')],function(_0x21ff4f){var _0x1a891a={};_0x1a891a[_0x21ff4f]={'$like':'%'+_0x558e28[_0x0010('0x23')][_0x0010('0x43')]+'%'};return _0x1a891a;})});}_0x19ffe4=_[_0x0010('0x2f')]({},_0x19ffe4,_0x558e28['options']);return _0x52f35d[_0x0010('0x73')](_0x19ffe4);}})['then'](function(_0x1563df){if(_0x1563df){_0x4931b7=_0x1563df[_0x0010('0x3f')];if(!_0x558e28[_0x0010('0x23')][_0x0010('0x74')](_0x0010('0x4f'))){_0x19ffe4[_0x0010('0xd')]=qs[_0x0010('0xd')](_0x558e28[_0x0010('0x23')][_0x0010('0xd')]);_0x19ffe4[_0x0010('0xb')]=qs['offset'](_0x558e28[_0x0010('0x23')][_0x0010('0xb')]);}return _0x52f35d['getAgents'](_0x19ffe4);}})['then'](function(_0x24642c){if(_0x24642c){return _0x24642c?{'count':_0x4931b7,'rows':_0x24642c}:null;}})[_0x0010('0x12')](respondWithResult(_0x1fc55b,null))[_0x0010('0x26')](handleError(_0x1fc55b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index b344133..ae355a5 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 _0x74c7=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','ChatQueue'];(function(_0x36e73d,_0x5c3d89){var _0x32c610=function(_0x4c7142){while(--_0x4c7142){_0x36e73d['push'](_0x36e73d['shift']());}};_0x32c610(++_0x5c3d89);}(_0x74c7,0x8e));var _0x774c=function(_0x3431ae,_0x317e67){_0x3431ae=_0x3431ae-0x0;var _0x22ab33=_0x74c7[_0x3431ae];return _0x22ab33;};'use strict';var EventEmitter=require(_0x774c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x774c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x774c('0x2')](0x0);var events={'afterCreate':_0x774c('0x3'),'afterUpdate':_0x774c('0x4'),'afterDestroy':_0x774c('0x5')};function emitEvent(_0x5f257e){return function(_0x23f7aa,_0x110a25,_0x2426b0){ChatQueueEvents[_0x774c('0x6')](_0x5f257e+':'+_0x23f7aa['id'],_0x23f7aa);ChatQueueEvents['emit'](_0x5f257e,_0x23f7aa);_0x2426b0(null);};}for(var e in events){if(events[_0x774c('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x774c('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xc726=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x2dd62d,_0x128ccd){var _0x18e1a5=function(_0x3de31){while(--_0x3de31){_0x2dd62d['push'](_0x2dd62d['shift']());}};_0x18e1a5(++_0x128ccd);}(_0xc726,0x185));var _0x6c72=function(_0x397ec9,_0x384f51){_0x397ec9=_0x397ec9-0x0;var _0x381635=_0xc726[_0x397ec9];return _0x381635;};'use strict';var EventEmitter=require(_0x6c72('0x0'));var ChatQueue=require(_0x6c72('0x1'))['db'][_0x6c72('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6c72('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6c72('0x4')};function emitEvent(_0x1a3f1d){return function(_0x553da1,_0x16702a,_0x1fb17d){ChatQueueEvents[_0x6c72('0x5')](_0x1a3f1d+':'+_0x553da1['id'],_0x553da1);ChatQueueEvents[_0x6c72('0x5')](_0x1a3f1d,_0x553da1);_0x1fb17d(null);};}for(var e in events){if(events[_0x6c72('0x6')](e)){var event=events[e];ChatQueue[_0x6c72('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 87fcd25..595da57 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 _0xe910=['chat_queues','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe910,0x1cf));var _0x0e91=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xe910[_0x525c7b];return _0x27b33e;};'use strict';var _=require('lodash');var util=require(_0x0e91('0x0'));var logger=require(_0x0e91('0x1'))(_0x0e91('0x2'));var moment=require(_0x0e91('0x3'));var BPromise=require('bluebird');var rp=require(_0x0e91('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e91('0x5'));var config=require(_0x0e91('0x6'));var attributes=require(_0x0e91('0x7'));module['exports']=function(_0x43cfc5,_0x1d9596){return _0x43cfc5[_0x0e91('0x8')](_0x0e91('0x9'),attributes,{'tableName':_0x0e91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3481=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger'];(function(_0xd7226b,_0x5d5296){var _0x297d39=function(_0x68fb41){while(--_0x68fb41){_0xd7226b['push'](_0xd7226b['shift']());}};_0x297d39(++_0x5d5296);}(_0x3481,0x81));var _0x1348=function(_0x1a797c,_0x45d3a6){_0x1a797c=_0x1a797c-0x0;var _0x1b35d5=_0x3481[_0x1a797c];return _0x1b35d5;};'use strict';var _=require(_0x1348('0x0'));var util=require(_0x1348('0x1'));var logger=require(_0x1348('0x2'))('api');var moment=require(_0x1348('0x3'));var BPromise=require(_0x1348('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1348('0x5'));var rimraf=require(_0x1348('0x6'));var config=require(_0x1348('0x7'));var attributes=require(_0x1348('0x8'));module[_0x1348('0x9')]=function(_0x657a9c,_0x15d0fd){return _0x657a9c[_0x1348('0xa')](_0x1348('0xb'),attributes,{'tableName':'chat_queues','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 a9a6f71..5af0702 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 _0x83d4=['findAll','options','raw','attributes','limit','include','model','map','GetChatQueue','find','where','ShowChatQueue','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','debug','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s','message','info','result','ChatQueue'];(function(_0x2c85be,_0x214fcf){var _0x127b53=function(_0x46fcb8){while(--_0x46fcb8){_0x2c85be['push'](_0x2c85be['shift']());}};_0x127b53(++_0x214fcf);}(_0x83d4,0xf1));var _0x483d=function(_0x1baf0d,_0x329406){_0x1baf0d=_0x1baf0d-0x0;var _0x31843f=_0x83d4[_0x1baf0d];return _0x31843f;};'use strict';var _=require(_0x483d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x483d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x483d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x483d('0x3'));var logger=require(_0x483d('0x4'))(_0x483d('0x5'));var config=require(_0x483d('0x6'));var jayson=require(_0x483d('0x7'));var client=jayson['client'][_0x483d('0x8')]({'port':0x232a});config[_0x483d('0x9')]=_[_0x483d('0xa')](config[_0x483d('0x9')],{'host':_0x483d('0xb'),'port':0x18eb});var socket=require(_0x483d('0xc'))(new Redis(config[_0x483d('0x9')]));require(_0x483d('0xd'))[_0x483d('0xe')](socket);function respondWithRpcPromise(_0x4aa664,_0x191e7c,_0x54cb3f){return new BPromise(function(_0x404f5f,_0x2081e4){return client['request'](_0x4aa664,_0x54cb3f)[_0x483d('0xf')](function(_0xf4296f){logger['info']('ChatQueue,\x20%s,\x20%s',_0x191e7c,'request\x20sent');logger[_0x483d('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x191e7c,_0x483d('0x11'),JSON[_0x483d('0x12')](_0xf4296f));if(_0xf4296f[_0x483d('0x13')]){if(_0xf4296f[_0x483d('0x13')]['code']===0x1f4){logger[_0x483d('0x13')](_0x483d('0x14'),_0x191e7c,_0xf4296f[_0x483d('0x13')][_0x483d('0x15')]);return _0x2081e4(_0xf4296f['error'][_0x483d('0x15')]);}logger[_0x483d('0x13')]('ChatQueue,\x20%s,\x20%s',_0x191e7c,_0xf4296f['error']['message']);return _0x404f5f(_0xf4296f[_0x483d('0x13')][_0x483d('0x15')]);}else{logger[_0x483d('0x16')]('ChatQueue,\x20%s,\x20%s',_0x191e7c,_0x483d('0x11'));_0x404f5f(_0xf4296f[_0x483d('0x17')][_0x483d('0x15')]);}})['catch'](function(_0x52bd8b){logger[_0x483d('0x13')](_0x483d('0x14'),_0x191e7c,_0x52bd8b);_0x2081e4(_0x52bd8b);});});}exports['GetChatQueue']=function(_0x579f8a){var _0x227328=this;return new Promise(function(_0x28c661,_0x27c9b9){return db[_0x483d('0x18')][_0x483d('0x19')]({'raw':_0x579f8a[_0x483d('0x1a')]?_0x579f8a[_0x483d('0x1a')][_0x483d('0x1b')]===undefined?!![]:![]:!![],'where':_0x579f8a[_0x483d('0x1a')]?_0x579f8a['options']['where']||null:null,'attributes':_0x579f8a['options']?_0x579f8a['options'][_0x483d('0x1c')]||null:null,'limit':_0x579f8a[_0x483d('0x1a')]?_0x579f8a[_0x483d('0x1a')][_0x483d('0x1d')]||null:null,'include':_0x579f8a['options']?_0x579f8a['options'][_0x483d('0x1e')]?_['map'](_0x579f8a[_0x483d('0x1a')][_0x483d('0x1e')],function(_0x6ba422){return{'model':db[_0x6ba422[_0x483d('0x1f')]],'as':_0x6ba422['as'],'attributes':_0x6ba422[_0x483d('0x1c')],'include':_0x6ba422[_0x483d('0x1e')]?_['map'](_0x6ba422['include'],function(_0x1d8ed4){return{'model':db[_0x1d8ed4[_0x483d('0x1f')]],'as':_0x1d8ed4['as'],'attributes':_0x1d8ed4['attributes'],'include':_0x1d8ed4[_0x483d('0x1e')]?_[_0x483d('0x20')](_0x1d8ed4[_0x483d('0x1e')],function(_0x5310e7){return{'model':db[_0x5310e7[_0x483d('0x1f')]],'as':_0x5310e7['as'],'attributes':_0x5310e7[_0x483d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x483d('0xf')](function(_0x593f6b){logger[_0x483d('0x16')](_0x483d('0x21'),_0x579f8a);logger[_0x483d('0x10')](_0x483d('0x21'),_0x579f8a,JSON[_0x483d('0x12')](_0x593f6b));_0x28c661(_0x593f6b);})['catch'](function(_0x5a0c20){logger[_0x483d('0x13')](_0x483d('0x21'),_0x5a0c20['message'],_0x579f8a);_0x27c9b9(_0x227328[_0x483d('0x13')](0x1f4,_0x5a0c20[_0x483d('0x15')]));});});};exports['ShowChatQueue']=function(_0x156938){var _0x435e20=this;return new Promise(function(_0x2fc955,_0x5c0c4e){return db['ChatQueue'][_0x483d('0x22')]({'raw':_0x156938[_0x483d('0x1a')]?_0x156938[_0x483d('0x1a')][_0x483d('0x1b')]===undefined?!![]:![]:!![],'where':_0x156938[_0x483d('0x1a')]?_0x156938[_0x483d('0x1a')][_0x483d('0x23')]||null:null,'attributes':_0x156938[_0x483d('0x1a')]?_0x156938[_0x483d('0x1a')][_0x483d('0x1c')]||null:null,'include':_0x156938[_0x483d('0x1a')]?_0x156938[_0x483d('0x1a')][_0x483d('0x1e')]?_['map'](_0x156938[_0x483d('0x1a')][_0x483d('0x1e')],function(_0x467b7d){return{'model':db[_0x467b7d[_0x483d('0x1f')]],'as':_0x467b7d['as'],'attributes':_0x467b7d[_0x483d('0x1c')],'include':_0x467b7d['include']?_[_0x483d('0x20')](_0x467b7d[_0x483d('0x1e')],function(_0x2f0a2e){return{'model':db[_0x2f0a2e[_0x483d('0x1f')]],'as':_0x2f0a2e['as'],'attributes':_0x2f0a2e[_0x483d('0x1c')],'include':_0x2f0a2e['include']?_[_0x483d('0x20')](_0x2f0a2e['include'],function(_0x5d97e2){return{'model':db[_0x5d97e2[_0x483d('0x1f')]],'as':_0x5d97e2['as'],'attributes':_0x5d97e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x483d('0xf')](function(_0x53cb1a){logger[_0x483d('0x16')](_0x483d('0x24'),_0x156938);logger['debug'](_0x483d('0x24'),_0x156938,JSON['stringify'](_0x53cb1a));_0x2fc955(_0x53cb1a);})[_0x483d('0x25')](function(_0x2ffa2d){logger[_0x483d('0x13')]('ShowChatQueue',_0x2ffa2d[_0x483d('0x15')],_0x156938);_0x5c0c4e(_0x435e20['error'](0x1f4,_0x2ffa2d[_0x483d('0x15')]));});});}; \ No newline at end of file +var _0x5cb4=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','ShowChatQueue','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9f46f5,_0xf4cc8){var _0x121a01=function(_0x531bb0){while(--_0x531bb0){_0x9f46f5['push'](_0x9f46f5['shift']());}};_0x121a01(++_0xf4cc8);}(_0x5cb4,0xc6));var _0x45cb=function(_0x3be7d4,_0x2a412f){_0x3be7d4=_0x3be7d4-0x0;var _0x49acbc=_0x5cb4[_0x3be7d4];return _0x49acbc;};'use strict';var _=require(_0x45cb('0x0'));var util=require('util');var moment=require(_0x45cb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45cb('0x2'));var db=require(_0x45cb('0x3'))['db'];var utils=require(_0x45cb('0x4'));var logger=require(_0x45cb('0x5'))(_0x45cb('0x6'));var config=require(_0x45cb('0x7'));var jayson=require(_0x45cb('0x8'));var client=jayson[_0x45cb('0x9')][_0x45cb('0xa')]({'port':0x232a});config[_0x45cb('0xb')]=_[_0x45cb('0xc')](config[_0x45cb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x45cb('0xd'))(new Redis(config[_0x45cb('0xb')]));require(_0x45cb('0xe'))[_0x45cb('0xf')](socket);function respondWithRpcPromise(_0x27c3a4,_0x4acbcf,_0x13ed09){return new BPromise(function(_0x2a79a0,_0x2aee1a){return client[_0x45cb('0x10')](_0x27c3a4,_0x13ed09)[_0x45cb('0x11')](function(_0x178c58){logger['info'](_0x45cb('0x12'),_0x4acbcf,_0x45cb('0x13'));logger[_0x45cb('0x14')](_0x45cb('0x15'),_0x4acbcf,_0x45cb('0x13'),JSON[_0x45cb('0x16')](_0x178c58));if(_0x178c58[_0x45cb('0x17')]){if(_0x178c58['error'][_0x45cb('0x18')]===0x1f4){logger[_0x45cb('0x17')](_0x45cb('0x12'),_0x4acbcf,_0x178c58[_0x45cb('0x17')][_0x45cb('0x19')]);return _0x2aee1a(_0x178c58[_0x45cb('0x17')][_0x45cb('0x19')]);}logger[_0x45cb('0x17')](_0x45cb('0x12'),_0x4acbcf,_0x178c58['error'][_0x45cb('0x19')]);return _0x2a79a0(_0x178c58['error'][_0x45cb('0x19')]);}else{logger['info'](_0x45cb('0x12'),_0x4acbcf,_0x45cb('0x13'));_0x2a79a0(_0x178c58[_0x45cb('0x1a')]['message']);}})[_0x45cb('0x1b')](function(_0x24c2d9){logger[_0x45cb('0x17')](_0x45cb('0x12'),_0x4acbcf,_0x24c2d9);_0x2aee1a(_0x24c2d9);});});}exports['GetChatQueue']=function(_0x48f0a6){var _0x46fc46=this;return new Promise(function(_0x436aa6,_0x9efe4){return db[_0x45cb('0x1c')][_0x45cb('0x1d')]({'raw':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6['options'][_0x45cb('0x1f')]===undefined?!![]:![]:!![],'where':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6[_0x45cb('0x1e')][_0x45cb('0x20')]||null:null,'attributes':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6['options'][_0x45cb('0x21')]||null:null,'limit':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6[_0x45cb('0x1e')][_0x45cb('0x22')]||null:null,'include':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6[_0x45cb('0x1e')][_0x45cb('0x23')]?_[_0x45cb('0x24')](_0x48f0a6['options']['include'],function(_0x2440d2){return{'model':db[_0x2440d2[_0x45cb('0x25')]],'as':_0x2440d2['as'],'attributes':_0x2440d2[_0x45cb('0x21')],'include':_0x2440d2[_0x45cb('0x23')]?_[_0x45cb('0x24')](_0x2440d2['include'],function(_0x550ebd){return{'model':db[_0x550ebd[_0x45cb('0x25')]],'as':_0x550ebd['as'],'attributes':_0x550ebd['attributes'],'include':_0x550ebd['include']?_[_0x45cb('0x24')](_0x550ebd[_0x45cb('0x23')],function(_0x84b1ec){return{'model':db[_0x84b1ec['model']],'as':_0x84b1ec['as'],'attributes':_0x84b1ec[_0x45cb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x45cb('0x11')](function(_0x31ad38){logger[_0x45cb('0x26')](_0x45cb('0x27'),_0x48f0a6);logger['debug'](_0x45cb('0x27'),_0x48f0a6,JSON[_0x45cb('0x16')](_0x31ad38));_0x436aa6(_0x31ad38);})[_0x45cb('0x1b')](function(_0x25bb3b){logger[_0x45cb('0x17')](_0x45cb('0x27'),_0x25bb3b[_0x45cb('0x19')],_0x48f0a6);_0x9efe4(_0x46fc46['error'](0x1f4,_0x25bb3b['message']));});});};exports[_0x45cb('0x28')]=function(_0x20764e){var _0x3d9a81=this;return new Promise(function(_0x395e7a,_0x404725){return db[_0x45cb('0x1c')]['find']({'raw':_0x20764e[_0x45cb('0x1e')]?_0x20764e[_0x45cb('0x1e')][_0x45cb('0x1f')]===undefined?!![]:![]:!![],'where':_0x20764e[_0x45cb('0x1e')]?_0x20764e['options'][_0x45cb('0x20')]||null:null,'attributes':_0x20764e[_0x45cb('0x1e')]?_0x20764e['options'][_0x45cb('0x21')]||null:null,'include':_0x20764e[_0x45cb('0x1e')]?_0x20764e[_0x45cb('0x1e')]['include']?_[_0x45cb('0x24')](_0x20764e['options'][_0x45cb('0x23')],function(_0x459e16){return{'model':db[_0x459e16[_0x45cb('0x25')]],'as':_0x459e16['as'],'attributes':_0x459e16[_0x45cb('0x21')],'include':_0x459e16[_0x45cb('0x23')]?_['map'](_0x459e16['include'],function(_0x2d4508){return{'model':db[_0x2d4508[_0x45cb('0x25')]],'as':_0x2d4508['as'],'attributes':_0x2d4508['attributes'],'include':_0x2d4508[_0x45cb('0x23')]?_['map'](_0x2d4508[_0x45cb('0x23')],function(_0x3f26da){return{'model':db[_0x3f26da[_0x45cb('0x25')]],'as':_0x3f26da['as'],'attributes':_0x3f26da[_0x45cb('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43f5a3){logger[_0x45cb('0x26')](_0x45cb('0x28'),_0x20764e);logger['debug'](_0x45cb('0x28'),_0x20764e,JSON['stringify'](_0x43f5a3));_0x395e7a(_0x43f5a3);})[_0x45cb('0x1b')](function(_0x53dda6){logger[_0x45cb('0x17')](_0x45cb('0x28'),_0x53dda6[_0x45cb('0x19')],_0x20764e);_0x404725(_0x3d9a81[_0x45cb('0x17')](0x1f4,_0x53dda6[_0x45cb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index af3c569..eea39c0 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 _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x2b5ee5,_0x3741bf){_0x2b5ee5=_0x2b5ee5-0x0;var _0x1c480b=_0x5ad3[_0x2b5ee5];return _0x1c480b;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}}; \ No newline at end of file +var _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x4f6c32,_0x2d8f23){var _0x24ef25=function(_0x569c69){while(--_0x569c69){_0x4f6c32['push'](_0x4f6c32['shift']());}};_0x24ef25(++_0x2d8f23);}(_0x5089,0x1bb));var _0x9508=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x5089[_0x5534fe];return _0x3d1dc2;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index fe5f07f..b0585ec 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x2490e7,_0x41410b){_0x2490e7=_0x2490e7-0x0;var _0x14e3fb=_0x3e74[_0x2490e7];return _0x14e3fb;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x421f94,_0x1080b8){var _0x1929b8=function(_0x1452ab){while(--_0x1452ab){_0x421f94['push'](_0x421f94['shift']());}};_0x1929b8(++_0x1080b8);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 6306189..7232268 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 _0xd488=['DATE','moment','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd488,0xe1));var _0x8d48=function(_0xc1263e,_0x56d738){_0xc1263e=_0xc1263e-0x0;var _0x471f07=_0xd488[_0xc1263e];return _0x471f07;};'use strict';var moment=require(_0x8d48('0x0'));var Sequelize=require('sequelize');module[_0x8d48('0x1')]={'uniqueid':{'type':Sequelize[_0x8d48('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8d48('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8d48('0x3')]},'acceptAt':{'type':Sequelize[_0x8d48('0x3')]},'exitAt':{'type':Sequelize[_0x8d48('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb82a=['moment','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb82a,0x82));var _0xab82=function(_0x239cff,_0x4f1d14){_0x239cff=_0x239cff-0x0;var _0x582ca4=_0xb82a[_0x239cff];return _0x582ca4;};'use strict';var moment=require(_0xab82('0x0'));var Sequelize=require(_0xab82('0x1'));module[_0xab82('0x2')]={'uniqueid':{'type':Sequelize[_0xab82('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xab82('0x4')]},'acceptAt':{'type':Sequelize[_0xab82('0x4')]},'exitAt':{'type':Sequelize[_0xab82('0x4')]},'reason':{'type':Sequelize[_0xab82('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 115277d..6139397 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 _0xcd0e=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','end','error','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','params','length','options','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xa50cb7,_0x3f962f){var _0x59543d=function(_0x22e21d){while(--_0x22e21d){_0xa50cb7['push'](_0xa50cb7['shift']());}};_0x59543d(++_0x3f962f);}(_0xcd0e,0xe9));var _0xecd0=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xcd0e[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0xecd0('0x0'));var rimraf=require(_0xecd0('0x1'));var zipdir=require(_0xecd0('0x2'));var jsonpatch=require(_0xecd0('0x3'));var rp=require(_0xecd0('0x4'));var moment=require(_0xecd0('0x5'));var BPromise=require(_0xecd0('0x6'));var Mustache=require(_0xecd0('0x7'));var util=require(_0xecd0('0x8'));var path=require(_0xecd0('0x9'));var sox=require(_0xecd0('0xa'));var csv=require(_0xecd0('0xb'));var ejs=require(_0xecd0('0xc'));var fs=require('fs');var fs_extra=require(_0xecd0('0xd'));var _=require(_0xecd0('0xe'));var squel=require(_0xecd0('0xf'));var crypto=require(_0xecd0('0x10'));var jsforce=require(_0xecd0('0x11'));var deskjs=require(_0xecd0('0x12'));var toCsv=require('to-csv');var querystring=require(_0xecd0('0x13'));var Papa=require(_0xecd0('0x14'));var Redis=require(_0xecd0('0x15'));var authService=require(_0xecd0('0x16'));var qs=require(_0xecd0('0x17'));var as=require(_0xecd0('0x18'));var hardwareService=require(_0xecd0('0x19'));var logger=require(_0xecd0('0x1a'))(_0xecd0('0x1b'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xecd0('0x1c'))['db'];function respondWithStatusCode(_0x33af86,_0x241974){_0x241974=_0x241974||0xcc;return function(_0x3bccd2){if(_0x3bccd2){return _0x33af86[_0xecd0('0x1d')](_0x241974);}return _0x33af86[_0xecd0('0x1e')](_0x241974)['end']();};}function respondWithResult(_0x595dd8,_0x35b69b){_0x35b69b=_0x35b69b||0xc8;return function(_0xe13b00){if(_0xe13b00){return _0x595dd8['status'](_0x35b69b)[_0xecd0('0x1f')](_0xe13b00);}};}function respondWithFilteredResult(_0x45184c,_0x4b96d8){return function(_0x51d3bd){if(_0x51d3bd){var _0x118746=typeof _0x4b96d8['offset']===_0xecd0('0x20')&&typeof _0x4b96d8[_0xecd0('0x21')]==='undefined';var _0x367c38=_0x51d3bd[_0xecd0('0x22')];var _0x291300=_0x118746?0x0:_0x4b96d8['offset'];var _0x1b0054=_0x118746?_0x51d3bd[_0xecd0('0x22')]:_0x4b96d8[_0xecd0('0x23')]+_0x4b96d8['limit'];var _0x22a703;if(_0x1b0054>=_0x367c38){_0x1b0054=_0x367c38;_0x22a703=0xc8;}else{_0x22a703=0xce;}_0x45184c[_0xecd0('0x1e')](_0x22a703);return _0x45184c['set'](_0xecd0('0x24'),_0x291300+'-'+_0x1b0054+'/'+_0x367c38)[_0xecd0('0x1f')](_0x51d3bd);}return null;};}function patchUpdates(_0x51ec16){return function(_0x409e0b){try{jsonpatch[_0xecd0('0x25')](_0x409e0b,_0x51ec16,!![]);}catch(_0x4a488c){return BPromise['reject'](_0x4a488c);}return _0x409e0b[_0xecd0('0x26')]();};}function saveUpdates(_0x48fb4c,_0x26ea52){return function(_0x5c0153){if(_0x5c0153){return _0x5c0153['update'](_0x48fb4c)['then'](function(_0x355846){return _0x355846;});}return null;};}function removeEntity(_0x5b0183,_0x25d9e9){return function(_0x4ce453){if(_0x4ce453){return _0x4ce453[_0xecd0('0x27')]()['then'](function(){_0x5b0183['status'](0xcc)[_0xecd0('0x28')]();});}};}function handleEntityNotFound(_0x4f00c9,_0x3625a4){return function(_0x918e){if(!_0x918e){_0x4f00c9[_0xecd0('0x1d')](0x194);}return _0x918e;};}function handleError(_0x133ecd,_0x3b2f14){_0x3b2f14=_0x3b2f14||0x1f4;return function(_0x482321){logger[_0xecd0('0x29')](_0x482321[_0xecd0('0x2a')]);if(_0x482321[_0xecd0('0x2b')]){delete _0x482321[_0xecd0('0x2b')];}_0x133ecd[_0xecd0('0x1e')](_0x3b2f14)['send'](_0x482321);};}exports[_0xecd0('0x2c')]=function(_0x4c0dcb,_0x4374a5){var _0x45fc62={},_0x2a99a2={},_0x22efb3={'count':0x0,'rows':[]};var _0x511ef2=_['map'](db[_0xecd0('0x2d')][_0xecd0('0x2e')],function(_0x1dbfdf){return{'name':_0x1dbfdf[_0xecd0('0x2f')],'type':_0x1dbfdf[_0xecd0('0x30')]['key']};});_0x2a99a2[_0xecd0('0x31')]=_['map'](_0x511ef2,_0xecd0('0x2b'));_0x2a99a2[_0xecd0('0x32')]=_[_0xecd0('0x33')](_0x4c0dcb[_0xecd0('0x32')]);_0x2a99a2['filters']=_[_0xecd0('0x34')](_0x2a99a2[_0xecd0('0x31')],_0x2a99a2[_0xecd0('0x32')]);_0x45fc62[_0xecd0('0x35')]=_[_0xecd0('0x34')](_0x2a99a2[_0xecd0('0x31')],qs[_0xecd0('0x36')](_0x4c0dcb['query'][_0xecd0('0x36')]));_0x45fc62[_0xecd0('0x35')]=_0x45fc62[_0xecd0('0x35')]['length']?_0x45fc62['attributes']:_0x2a99a2[_0xecd0('0x31')];if(!_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x37')](_0xecd0('0x38'))){_0x45fc62[_0xecd0('0x21')]=qs[_0xecd0('0x21')](_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x21')]);_0x45fc62[_0xecd0('0x23')]=qs['offset'](_0x4c0dcb['query'][_0xecd0('0x23')]);}_0x45fc62[_0xecd0('0x39')]=qs[_0xecd0('0x3a')](_0x4c0dcb['query'][_0xecd0('0x3a')]);_0x45fc62[_0xecd0('0x3b')]=qs[_0xecd0('0x3c')](_[_0xecd0('0x3d')](_0x4c0dcb[_0xecd0('0x32')],_0x2a99a2[_0xecd0('0x3c')]),_0x511ef2);if(_0x4c0dcb['query']['filter']){_0x45fc62[_0xecd0('0x3b')]=_[_0xecd0('0x3e')](_0x45fc62[_0xecd0('0x3b')],{'$or':_['map'](_0x511ef2,function(_0x58b2a0){if(_0x58b2a0[_0xecd0('0x30')]!==_0xecd0('0x3f')){var _0x30728d={};_0x30728d[_0x58b2a0[_0xecd0('0x2b')]]={'$like':'%'+_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x40')]+'%'};return _0x30728d;}})});}_0x45fc62=_['merge']({},_0x45fc62,_0x4c0dcb['options']);var _0xed68aa={'where':_0x45fc62[_0xecd0('0x3b')]};return db['ChatQueueReport'][_0xecd0('0x22')](_0xed68aa)[_0xecd0('0x41')](function(_0x3a4fb5){_0x22efb3['count']=_0x3a4fb5;if(_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x42')]){_0x45fc62[_0xecd0('0x43')]=[{'all':!![]}];}return db[_0xecd0('0x2d')][_0xecd0('0x44')](_0x45fc62);})[_0xecd0('0x41')](function(_0xfc1eee){_0x22efb3[_0xecd0('0x45')]=_0xfc1eee;return _0x22efb3;})[_0xecd0('0x41')](respondWithFilteredResult(_0x4374a5,_0x45fc62))['catch'](handleError(_0x4374a5,null));};exports['show']=function(_0x5cab5e,_0xaa5340){var _0x94e9dd={'raw':!![],'where':{'id':_0x5cab5e[_0xecd0('0x46')]['id']}},_0x3b08ca={};_0x3b08ca['model']=_['keys'](db[_0xecd0('0x2d')][_0xecd0('0x2e')]);_0x3b08ca[_0xecd0('0x32')]=_[_0xecd0('0x33')](_0x5cab5e[_0xecd0('0x32')]);_0x3b08ca['filters']=_['intersection'](_0x3b08ca['model'],_0x3b08ca[_0xecd0('0x32')]);_0x94e9dd['attributes']=_[_0xecd0('0x34')](_0x3b08ca[_0xecd0('0x31')],qs[_0xecd0('0x36')](_0x5cab5e['query'][_0xecd0('0x36')]));_0x94e9dd['attributes']=_0x94e9dd['attributes'][_0xecd0('0x47')]?_0x94e9dd[_0xecd0('0x35')]:_0x3b08ca[_0xecd0('0x31')];if(_0x5cab5e[_0xecd0('0x32')][_0xecd0('0x42')]){_0x94e9dd[_0xecd0('0x43')]=[{'all':!![]}];}_0x94e9dd=_[_0xecd0('0x3e')]({},_0x94e9dd,_0x5cab5e[_0xecd0('0x48')]);return db[_0xecd0('0x2d')]['find'](_0x94e9dd)[_0xecd0('0x41')](handleEntityNotFound(_0xaa5340,null))['then'](respondWithResult(_0xaa5340,null))[_0xecd0('0x49')](handleError(_0xaa5340,null));};exports[_0xecd0('0x4a')]=function(_0x496e2b,_0x563b3c){return db[_0xecd0('0x2d')][_0xecd0('0x4a')](_0x496e2b[_0xecd0('0x4b')],{})['then'](respondWithResult(_0x563b3c,0xc9))[_0xecd0('0x49')](handleError(_0x563b3c,null));};exports[_0xecd0('0x4c')]=function(_0x565829,_0x54de11){if(_0x565829[_0xecd0('0x4b')]['id']){delete _0x565829[_0xecd0('0x4b')]['id'];}return db[_0xecd0('0x2d')][_0xecd0('0x4d')]({'where':{'id':_0x565829[_0xecd0('0x46')]['id']}})[_0xecd0('0x41')](handleEntityNotFound(_0x54de11,null))[_0xecd0('0x41')](saveUpdates(_0x565829['body'],null))[_0xecd0('0x41')](respondWithResult(_0x54de11,null))[_0xecd0('0x49')](handleError(_0x54de11,null));};exports[_0xecd0('0x27')]=function(_0x1806cf,_0x3aef3e){return db['ChatQueueReport'][_0xecd0('0x4d')]({'where':{'id':_0x1806cf[_0xecd0('0x46')]['id']}})[_0xecd0('0x41')](handleEntityNotFound(_0x3aef3e,null))['then'](removeEntity(_0x3aef3e,null))[_0xecd0('0x49')](handleError(_0x3aef3e,null));};exports[_0xecd0('0x4e')]=function(_0x495b6d,_0x39cc8e){return db['ChatQueueReport'][_0xecd0('0x4e')]()[_0xecd0('0x41')](respondWithResult(_0x39cc8e,null))[_0xecd0('0x49')](handleError(_0x39cc8e,null));}; \ No newline at end of file +var _0x6337=['nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','find','describe','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','ChatQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1bbf60,_0x1cc30c){var _0x2008a0=function(_0x51eb57){while(--_0x51eb57){_0x1bbf60['push'](_0x1bbf60['shift']());}};_0x2008a0(++_0x1cc30c);}(_0x6337,0x18a));var _0x7633=function(_0x421c55,_0x169e3a){_0x421c55=_0x421c55-0x0;var _0x589d4c=_0x6337[_0x421c55];return _0x589d4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7633('0x0'));var zipdir=require(_0x7633('0x1'));var jsonpatch=require(_0x7633('0x2'));var rp=require(_0x7633('0x3'));var moment=require(_0x7633('0x4'));var BPromise=require(_0x7633('0x5'));var Mustache=require(_0x7633('0x6'));var util=require(_0x7633('0x7'));var path=require(_0x7633('0x8'));var sox=require('sox');var csv=require(_0x7633('0x9'));var ejs=require(_0x7633('0xa'));var fs=require('fs');var fs_extra=require(_0x7633('0xb'));var _=require('lodash');var squel=require(_0x7633('0xc'));var crypto=require('crypto');var jsforce=require(_0x7633('0xd'));var deskjs=require(_0x7633('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7633('0xf'));var Papa=require('papaparse');var Redis=require(_0x7633('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7633('0x11'));var as=require(_0x7633('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7633('0x13'))(_0x7633('0x14'));var utils=require(_0x7633('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7633('0x16'));var db=require(_0x7633('0x17'))['db'];function respondWithStatusCode(_0xeef065,_0x563006){_0x563006=_0x563006||0xcc;return function(_0x2007bc){if(_0x2007bc){return _0xeef065[_0x7633('0x18')](_0x563006);}return _0xeef065[_0x7633('0x19')](_0x563006)['end']();};}function respondWithResult(_0x5654bc,_0x50e10c){_0x50e10c=_0x50e10c||0xc8;return function(_0x18abe4){if(_0x18abe4){return _0x5654bc[_0x7633('0x19')](_0x50e10c)[_0x7633('0x1a')](_0x18abe4);}};}function respondWithFilteredResult(_0x3666a1,_0x25e7d5){return function(_0x1c9957){if(_0x1c9957){var _0x47e212=typeof _0x25e7d5[_0x7633('0x1b')]===_0x7633('0x1c')&&typeof _0x25e7d5['limit']===_0x7633('0x1c');var _0x4c4e1=_0x1c9957[_0x7633('0x1d')];var _0x321043=_0x47e212?0x0:_0x25e7d5[_0x7633('0x1b')];var _0x5c7609=_0x47e212?_0x1c9957[_0x7633('0x1d')]:_0x25e7d5[_0x7633('0x1b')]+_0x25e7d5[_0x7633('0x1e')];var _0x5988d4;if(_0x5c7609>=_0x4c4e1){_0x5c7609=_0x4c4e1;_0x5988d4=0xc8;}else{_0x5988d4=0xce;}_0x3666a1[_0x7633('0x19')](_0x5988d4);return _0x3666a1[_0x7633('0x1f')](_0x7633('0x20'),_0x321043+'-'+_0x5c7609+'/'+_0x4c4e1)[_0x7633('0x1a')](_0x1c9957);}return null;};}function patchUpdates(_0x14df18){return function(_0x503d13){try{jsonpatch[_0x7633('0x21')](_0x503d13,_0x14df18,!![]);}catch(_0x1140cd){return BPromise[_0x7633('0x22')](_0x1140cd);}return _0x503d13[_0x7633('0x23')]();};}function saveUpdates(_0x1c8efc,_0x55715b){return function(_0x38a915){if(_0x38a915){return _0x38a915[_0x7633('0x24')](_0x1c8efc)[_0x7633('0x25')](function(_0x2471b7){return _0x2471b7;});}return null;};}function removeEntity(_0x531e8f,_0x135a75){return function(_0x9152df){if(_0x9152df){return _0x9152df[_0x7633('0x26')]()[_0x7633('0x25')](function(){_0x531e8f['status'](0xcc)[_0x7633('0x27')]();});}};}function handleEntityNotFound(_0x34aa76,_0x555923){return function(_0x1eb275){if(!_0x1eb275){_0x34aa76['sendStatus'](0x194);}return _0x1eb275;};}function handleError(_0x47f2cb,_0x42b4a7){_0x42b4a7=_0x42b4a7||0x1f4;return function(_0x1b2920){logger[_0x7633('0x28')](_0x1b2920[_0x7633('0x29')]);if(_0x1b2920[_0x7633('0x2a')]){delete _0x1b2920[_0x7633('0x2a')];}_0x47f2cb[_0x7633('0x19')](_0x42b4a7)['send'](_0x1b2920);};}exports[_0x7633('0x2b')]=function(_0x7b9d8b,_0x266944){var _0x3d0b0c={},_0x323e00={},_0x1abaed={'count':0x0,'rows':[]};var _0x5d79ce=_[_0x7633('0x2c')](db[_0x7633('0x2d')]['rawAttributes'],function(_0x8fcf83){return{'name':_0x8fcf83[_0x7633('0x2e')],'type':_0x8fcf83['type']['key']};});_0x323e00[_0x7633('0x2f')]=_['map'](_0x5d79ce,_0x7633('0x2a'));_0x323e00[_0x7633('0x30')]=_[_0x7633('0x31')](_0x7b9d8b[_0x7633('0x30')]);_0x323e00[_0x7633('0x32')]=_[_0x7633('0x33')](_0x323e00['model'],_0x323e00[_0x7633('0x30')]);_0x3d0b0c[_0x7633('0x34')]=_['intersection'](_0x323e00['model'],qs[_0x7633('0x35')](_0x7b9d8b['query'][_0x7633('0x35')]));_0x3d0b0c['attributes']=_0x3d0b0c['attributes'][_0x7633('0x36')]?_0x3d0b0c[_0x7633('0x34')]:_0x323e00[_0x7633('0x2f')];if(!_0x7b9d8b[_0x7633('0x30')][_0x7633('0x37')](_0x7633('0x38'))){_0x3d0b0c['limit']=qs[_0x7633('0x1e')](_0x7b9d8b['query'][_0x7633('0x1e')]);_0x3d0b0c[_0x7633('0x1b')]=qs[_0x7633('0x1b')](_0x7b9d8b[_0x7633('0x30')][_0x7633('0x1b')]);}_0x3d0b0c[_0x7633('0x39')]=qs['sort'](_0x7b9d8b[_0x7633('0x30')][_0x7633('0x3a')]);_0x3d0b0c['where']=qs[_0x7633('0x32')](_[_0x7633('0x3b')](_0x7b9d8b[_0x7633('0x30')],_0x323e00[_0x7633('0x32')]),_0x5d79ce);if(_0x7b9d8b['query'][_0x7633('0x3c')]){_0x3d0b0c[_0x7633('0x3d')]=_[_0x7633('0x3e')](_0x3d0b0c[_0x7633('0x3d')],{'$or':_[_0x7633('0x2c')](_0x5d79ce,function(_0x552927){if(_0x552927[_0x7633('0x3f')]!==_0x7633('0x40')){var _0x2d6459={};_0x2d6459[_0x552927['name']]={'$like':'%'+_0x7b9d8b[_0x7633('0x30')][_0x7633('0x3c')]+'%'};return _0x2d6459;}})});}_0x3d0b0c=_[_0x7633('0x3e')]({},_0x3d0b0c,_0x7b9d8b[_0x7633('0x41')]);var _0x5371d7={'where':_0x3d0b0c['where']};return db[_0x7633('0x2d')][_0x7633('0x1d')](_0x5371d7)[_0x7633('0x25')](function(_0x50856e){_0x1abaed[_0x7633('0x1d')]=_0x50856e;if(_0x7b9d8b[_0x7633('0x30')][_0x7633('0x42')]){_0x3d0b0c[_0x7633('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x7633('0x44')](_0x3d0b0c);})['then'](function(_0x25a22e){_0x1abaed['rows']=_0x25a22e;return _0x1abaed;})[_0x7633('0x25')](respondWithFilteredResult(_0x266944,_0x3d0b0c))[_0x7633('0x45')](handleError(_0x266944,null));};exports['show']=function(_0x46e83f,_0x27209e){var _0x3f24b2={'raw':!![],'where':{'id':_0x46e83f[_0x7633('0x46')]['id']}},_0x79c2d0={};_0x79c2d0[_0x7633('0x2f')]=_[_0x7633('0x31')](db['ChatQueueReport']['rawAttributes']);_0x79c2d0[_0x7633('0x30')]=_['keys'](_0x46e83f[_0x7633('0x30')]);_0x79c2d0[_0x7633('0x32')]=_[_0x7633('0x33')](_0x79c2d0[_0x7633('0x2f')],_0x79c2d0[_0x7633('0x30')]);_0x3f24b2[_0x7633('0x34')]=_[_0x7633('0x33')](_0x79c2d0[_0x7633('0x2f')],qs[_0x7633('0x35')](_0x46e83f[_0x7633('0x30')][_0x7633('0x35')]));_0x3f24b2[_0x7633('0x34')]=_0x3f24b2[_0x7633('0x34')]['length']?_0x3f24b2['attributes']:_0x79c2d0[_0x7633('0x2f')];if(_0x46e83f[_0x7633('0x30')][_0x7633('0x42')]){_0x3f24b2[_0x7633('0x43')]=[{'all':!![]}];}_0x3f24b2=_[_0x7633('0x3e')]({},_0x3f24b2,_0x46e83f[_0x7633('0x41')]);return db['ChatQueueReport']['find'](_0x3f24b2)[_0x7633('0x25')](handleEntityNotFound(_0x27209e,null))[_0x7633('0x25')](respondWithResult(_0x27209e,null))[_0x7633('0x45')](handleError(_0x27209e,null));};exports[_0x7633('0x47')]=function(_0x599601,_0x5d9a0d){return db[_0x7633('0x2d')][_0x7633('0x47')](_0x599601[_0x7633('0x48')],{})['then'](respondWithResult(_0x5d9a0d,0xc9))[_0x7633('0x45')](handleError(_0x5d9a0d,null));};exports[_0x7633('0x24')]=function(_0x31f166,_0x3c79cb){if(_0x31f166[_0x7633('0x48')]['id']){delete _0x31f166[_0x7633('0x48')]['id'];}return db['ChatQueueReport'][_0x7633('0x49')]({'where':{'id':_0x31f166[_0x7633('0x46')]['id']}})[_0x7633('0x25')](handleEntityNotFound(_0x3c79cb,null))['then'](saveUpdates(_0x31f166[_0x7633('0x48')],null))[_0x7633('0x25')](respondWithResult(_0x3c79cb,null))[_0x7633('0x45')](handleError(_0x3c79cb,null));};exports['destroy']=function(_0x54d4c1,_0x436788){return db[_0x7633('0x2d')][_0x7633('0x49')]({'where':{'id':_0x54d4c1[_0x7633('0x46')]['id']}})['then'](handleEntityNotFound(_0x436788,null))[_0x7633('0x25')](removeEntity(_0x436788,null))[_0x7633('0x45')](handleError(_0x436788,null));};exports[_0x7633('0x4a')]=function(_0x1169bc,_0x457477){return db[_0x7633('0x2d')][_0x7633('0x4a')]()[_0x7633('0x25')](respondWithResult(_0x457477,null))[_0x7633('0x45')](handleError(_0x457477,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 9e730b1..3f84177 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x594867,_0x2ee5d3){var _0x9ac5b1=function(_0x4609ec){while(--_0x4609ec){_0x594867['push'](_0x594867['shift']());}};_0x9ac5b1(++_0x2ee5d3);}(_0xb10b,0x12a));var _0xbb10=function(_0x3240ff,_0x3b9c3d){_0x3240ff=_0x3240ff-0x0;var _0x514858=_0xb10b[_0x3240ff];return _0x514858;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x147003,_0x36e2e3){var _0x5167b2=function(_0x5b54da){while(--_0x5b54da){_0x147003['push'](_0x147003['shift']());}};_0x5167b2(++_0x36e2e3);}(_0xe706,0xa3));var _0x6e70=function(_0x14e69a,_0x2eac7c){_0x14e69a=_0x14e69a-0x0;var _0x26adb8=_0xe706[_0x14e69a];return _0x26adb8;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index e86ecc7..855ab65 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 _0xfd11=['where','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','CreateChatQueueReport','ChatQueueReport','create','options','stringify','catch','UpdateChatQueueReport','update','body'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xfd11,0x13a));var _0x1fd1=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xfd11[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0x1fd1('0x0'));var moment=require(_0x1fd1('0x1'));var BPromise=require(_0x1fd1('0x2'));var rs=require(_0x1fd1('0x3'));var fs=require('fs');var Redis=require(_0x1fd1('0x4'));var db=require(_0x1fd1('0x5'))['db'];var utils=require(_0x1fd1('0x6'));var logger=require(_0x1fd1('0x7'))(_0x1fd1('0x8'));var config=require('../../config/environment');var jayson=require(_0x1fd1('0x9'));var client=jayson[_0x1fd1('0xa')][_0x1fd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59ac4b,_0x1ed666,_0x35308b){return new BPromise(function(_0x3d82c2,_0x451127){return client['request'](_0x59ac4b,_0x35308b)['then'](function(_0x51ee4a){logger['info'](_0x1fd1('0xc'),_0x1ed666,_0x1fd1('0xd'));logger[_0x1fd1('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1ed666,'request\x20sent',JSON['stringify'](_0x51ee4a));if(_0x51ee4a['error']){if(_0x51ee4a[_0x1fd1('0xf')]['code']===0x1f4){logger['error'](_0x1fd1('0xc'),_0x1ed666,_0x51ee4a[_0x1fd1('0xf')][_0x1fd1('0x10')]);return _0x451127(_0x51ee4a[_0x1fd1('0xf')][_0x1fd1('0x10')]);}logger['error'](_0x1fd1('0xc'),_0x1ed666,_0x51ee4a[_0x1fd1('0xf')][_0x1fd1('0x10')]);return _0x3d82c2(_0x51ee4a[_0x1fd1('0xf')]['message']);}else{logger[_0x1fd1('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x1ed666,_0x1fd1('0xd'));_0x3d82c2(_0x51ee4a['result']['message']);}})['catch'](function(_0x3b0907){logger[_0x1fd1('0xf')](_0x1fd1('0xc'),_0x1ed666,_0x3b0907);_0x451127(_0x3b0907);});});}exports[_0x1fd1('0x12')]=function(_0xd0c3e6){var _0x244de0=this;return new Promise(function(_0x481301,_0x7617b2){return db[_0x1fd1('0x13')][_0x1fd1('0x14')](_0xd0c3e6['body'],{'raw':_0xd0c3e6[_0x1fd1('0x15')]?_0xd0c3e6[_0x1fd1('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x558274){logger[_0x1fd1('0x11')](_0x1fd1('0x12'),_0xd0c3e6);logger[_0x1fd1('0xe')](_0x1fd1('0x12'),_0xd0c3e6,JSON[_0x1fd1('0x16')](_0x558274));_0x481301(_0x558274);})[_0x1fd1('0x17')](function(_0x10ad2f){logger[_0x1fd1('0xf')](_0x1fd1('0x12'),_0x10ad2f[_0x1fd1('0x10')],_0xd0c3e6);_0x7617b2(_0x244de0[_0x1fd1('0xf')](0x1f4,_0x10ad2f[_0x1fd1('0x10')]));});});};exports[_0x1fd1('0x18')]=function(_0x47f6b8){var _0x2a8514=this;return new Promise(function(_0x1c1ea6,_0x6becfc){return db[_0x1fd1('0x13')][_0x1fd1('0x19')](_0x47f6b8[_0x1fd1('0x1a')],{'raw':_0x47f6b8['options']?_0x47f6b8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47f6b8[_0x1fd1('0x15')]?_0x47f6b8[_0x1fd1('0x15')][_0x1fd1('0x1b')]||null:null,'attributes':_0x47f6b8[_0x1fd1('0x15')]?_0x47f6b8['options'][_0x1fd1('0x1c')]||null:null,'limit':_0x47f6b8['options']?_0x47f6b8['options'][_0x1fd1('0x1d')]||null:null})[_0x1fd1('0x1e')](function(_0x4db25c){logger['info'](_0x1fd1('0x18'),_0x47f6b8);logger['debug']('UpdateChatQueueReport',_0x47f6b8,JSON[_0x1fd1('0x16')](_0x4db25c));_0x1c1ea6(_0x4db25c);})[_0x1fd1('0x17')](function(_0x42460e){logger[_0x1fd1('0xf')](_0x1fd1('0x18'),_0x42460e[_0x1fd1('0x10')],_0x47f6b8);_0x6becfc(_0x2a8514[_0x1fd1('0xf')](0x1f4,_0x42460e['message']));});});}; \ No newline at end of file +var _0xc022=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','ChatQueueReport','create','body','options','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','lodash'];(function(_0xf8a7d1,_0xb9d6c8){var _0x4b40a0=function(_0x377688){while(--_0x377688){_0xf8a7d1['push'](_0xf8a7d1['shift']());}};_0x4b40a0(++_0xb9d6c8);}(_0xc022,0xd1));var _0x2c02=function(_0x984e97,_0x2c72e7){_0x984e97=_0x984e97-0x0;var _0x3630e5=_0xc022[_0x984e97];return _0x3630e5;};'use strict';var _=require(_0x2c02('0x0'));var util=require(_0x2c02('0x1'));var moment=require('moment');var BPromise=require(_0x2c02('0x2'));var rs=require(_0x2c02('0x3'));var fs=require('fs');var Redis=require(_0x2c02('0x4'));var db=require(_0x2c02('0x5'))['db'];var utils=require(_0x2c02('0x6'));var logger=require(_0x2c02('0x7'))(_0x2c02('0x8'));var config=require(_0x2c02('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2c02('0xa')][_0x2c02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f22ce,_0x53f739,_0x3f4b2f){return new BPromise(function(_0x5151df,_0x11be0a){return client[_0x2c02('0xc')](_0x2f22ce,_0x3f4b2f)[_0x2c02('0xd')](function(_0x318538){logger['info'](_0x2c02('0xe'),_0x53f739,'request\x20sent');logger[_0x2c02('0xf')](_0x2c02('0x10'),_0x53f739,'request\x20sent',JSON[_0x2c02('0x11')](_0x318538));if(_0x318538[_0x2c02('0x12')]){if(_0x318538[_0x2c02('0x12')][_0x2c02('0x13')]===0x1f4){logger[_0x2c02('0x12')](_0x2c02('0xe'),_0x53f739,_0x318538['error'][_0x2c02('0x14')]);return _0x11be0a(_0x318538[_0x2c02('0x12')]['message']);}logger[_0x2c02('0x12')](_0x2c02('0xe'),_0x53f739,_0x318538[_0x2c02('0x12')]['message']);return _0x5151df(_0x318538['error'][_0x2c02('0x14')]);}else{logger[_0x2c02('0x15')](_0x2c02('0xe'),_0x53f739,_0x2c02('0x16'));_0x5151df(_0x318538[_0x2c02('0x17')][_0x2c02('0x14')]);}})[_0x2c02('0x18')](function(_0x4914ca){logger[_0x2c02('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x53f739,_0x4914ca);_0x11be0a(_0x4914ca);});});}exports['CreateChatQueueReport']=function(_0x2b29ad){var _0x137092=this;return new Promise(function(_0x64e4ae,_0x5cd5f5){return db[_0x2c02('0x19')][_0x2c02('0x1a')](_0x2b29ad[_0x2c02('0x1b')],{'raw':_0x2b29ad['options']?_0x2b29ad[_0x2c02('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ee975){logger[_0x2c02('0x15')]('CreateChatQueueReport',_0x2b29ad);logger['debug'](_0x2c02('0x1d'),_0x2b29ad,JSON[_0x2c02('0x11')](_0x5ee975));_0x64e4ae(_0x5ee975);})[_0x2c02('0x18')](function(_0x25264e){logger[_0x2c02('0x12')]('CreateChatQueueReport',_0x25264e['message'],_0x2b29ad);_0x5cd5f5(_0x137092['error'](0x1f4,_0x25264e['message']));});});};exports[_0x2c02('0x1e')]=function(_0x490c7d){var _0x1fb602=this;return new Promise(function(_0x1fe3d9,_0x494860){return db[_0x2c02('0x19')][_0x2c02('0x1f')](_0x490c7d['body'],{'raw':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')][_0x2c02('0x20')]||null:null,'attributes':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')][_0x2c02('0x21')]||null:null,'limit':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')][_0x2c02('0x22')]||null:null})['then'](function(_0x4b9d9e){logger[_0x2c02('0x15')]('UpdateChatQueueReport',_0x490c7d);logger[_0x2c02('0xf')](_0x2c02('0x1e'),_0x490c7d,JSON[_0x2c02('0x11')](_0x4b9d9e));_0x1fe3d9(_0x4b9d9e);})['catch'](function(_0x1a7389){logger[_0x2c02('0x12')](_0x2c02('0x1e'),_0x1a7389[_0x2c02('0x14')],_0x490c7d);_0x494860(_0x1fb602[_0x2c02('0x12')](0x1f4,_0x1a7389[_0x2c02('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 698c68c..aff8aec 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 _0x9a0d=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update'];(function(_0x312efd,_0x1529e7){var _0x5b4b42=function(_0xa62f9a){while(--_0xa62f9a){_0x312efd['push'](_0x312efd['shift']());}};_0x5b4b42(++_0x1529e7);}(_0x9a0d,0x8e));var _0xd9a0=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x9a0d[_0x49052b];return _0x48c045;};'use strict';var multer=require(_0xd9a0('0x0'));var util=require('util');var path=require(_0xd9a0('0x1'));var timeout=require('connect-timeout');var express=require(_0xd9a0('0x2'));var router=express[_0xd9a0('0x3')]();var fs_extra=require(_0xd9a0('0x4'));var auth=require(_0xd9a0('0x5'));var interaction=require(_0xd9a0('0x6'));var config=require(_0xd9a0('0x7'));var controller=require(_0xd9a0('0x8'));router[_0xd9a0('0x9')]('/',auth[_0xd9a0('0xa')](),controller[_0xd9a0('0xb')]);router[_0xd9a0('0x9')]('/describe',auth[_0xd9a0('0xa')](),controller[_0xd9a0('0xc')]);router[_0xd9a0('0x9')](_0xd9a0('0xd'),auth[_0xd9a0('0xa')](),controller[_0xd9a0('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd9a0('0xf')]);router[_0xd9a0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd9a0('0x11')]);router['delete']('/:id',auth[_0xd9a0('0xa')](),controller[_0xd9a0('0x12')]);module[_0xd9a0('0x13')]=router; \ No newline at end of file +var _0x56b7=['index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x56b7,0x156));var _0x756b=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x56b7[_0x1e7701];return _0x3ab707;};'use strict';var multer=require('multer');var util=require(_0x756b('0x0'));var path=require(_0x756b('0x1'));var timeout=require(_0x756b('0x2'));var express=require('express');var router=express[_0x756b('0x3')]();var fs_extra=require(_0x756b('0x4'));var auth=require(_0x756b('0x5'));var interaction=require(_0x756b('0x6'));var config=require(_0x756b('0x7'));var controller=require(_0x756b('0x8'));router[_0x756b('0x9')]('/',auth['isAuthenticated'](),controller[_0x756b('0xa')]);router[_0x756b('0x9')](_0x756b('0xb'),auth['isAuthenticated'](),controller[_0x756b('0xc')]);router['get'](_0x756b('0xd'),auth[_0x756b('0xe')](),controller[_0x756b('0xf')]);router[_0x756b('0x10')]('/',auth[_0x756b('0xe')](),controller[_0x756b('0x11')]);router[_0x756b('0x12')](_0x756b('0xd'),auth[_0x756b('0xe')](),controller[_0x756b('0x13')]);router[_0x756b('0x14')](_0x756b('0xd'),auth[_0x756b('0xe')](),controller['destroy']);module[_0x756b('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index c90f9cc..069ea20 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x118986,_0x2ea044){var _0x25c9e6=function(_0x13b4d4){while(--_0x13b4d4){_0x118986['push'](_0x118986['shift']());}};_0x25c9e6(++_0x2ea044);}(_0x34e8,0x12c));var _0x834e=function(_0x4d0914,_0x36523d){_0x4d0914=_0x4d0914-0x0;var _0x52904d=_0x34e8[_0x4d0914];return _0x52904d;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xe55a92,_0x9c77fe){var _0x608e76=function(_0x4af890){while(--_0x4af890){_0xe55a92['push'](_0xe55a92['shift']());}};_0x608e76(++_0x9c77fe);}(_0xedd9,0xfc));var _0x9edd=function(_0x161171,_0x2aaa5c){_0x161171=_0x161171-0x0;var _0x3c5aef=_0xedd9[_0x161171];return _0x3c5aef;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 2d58b4a..ea8a449 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 _0x114e=['limit','undefined','count','offset','set','apply','save','then','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json'];(function(_0x3c5a8c,_0x18b5e0){var _0x1b0d79=function(_0x533b62){while(--_0x533b62){_0x3c5a8c['push'](_0x3c5a8c['shift']());}};_0x1b0d79(++_0x18b5e0);}(_0x114e,0x79));var _0xe114=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x114e[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe114('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe114('0x1'));var rp=require(_0xe114('0x2'));var moment=require(_0xe114('0x3'));var BPromise=require(_0xe114('0x4'));var Mustache=require(_0xe114('0x5'));var util=require('util');var path=require(_0xe114('0x6'));var sox=require(_0xe114('0x7'));var csv=require('to-csv');var ejs=require(_0xe114('0x8'));var fs=require('fs');var fs_extra=require(_0xe114('0x9'));var _=require(_0xe114('0xa'));var squel=require(_0xe114('0xb'));var crypto=require('crypto');var jsforce=require(_0xe114('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe114('0xd'));var querystring=require(_0xe114('0xe'));var Papa=require(_0xe114('0xf'));var Redis=require(_0xe114('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe114('0x11'));var hardwareService=require(_0xe114('0x12'));var logger=require(_0xe114('0x13'))(_0xe114('0x14'));var utils=require(_0xe114('0x15'));var config=require(_0xe114('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe114('0x17'))['db'];function respondWithStatusCode(_0xc99b3f,_0x1f4153){_0x1f4153=_0x1f4153||0xcc;return function(_0x14380b){if(_0x14380b){return _0xc99b3f['sendStatus'](_0x1f4153);}return _0xc99b3f[_0xe114('0x18')](_0x1f4153)[_0xe114('0x19')]();};}function respondWithResult(_0x41d081,_0xa7b5a2){_0xa7b5a2=_0xa7b5a2||0xc8;return function(_0x10b59d){if(_0x10b59d){return _0x41d081[_0xe114('0x18')](_0xa7b5a2)[_0xe114('0x1a')](_0x10b59d);}};}function respondWithFilteredResult(_0x12aac9,_0x1d80f9){return function(_0x43083b){if(_0x43083b){var _0x110c64=typeof _0x1d80f9['offset']==='undefined'&&typeof _0x1d80f9[_0xe114('0x1b')]===_0xe114('0x1c');var _0x166160=_0x43083b[_0xe114('0x1d')];var _0x55c67d=_0x110c64?0x0:_0x1d80f9[_0xe114('0x1e')];var _0x3da80e=_0x110c64?_0x43083b[_0xe114('0x1d')]:_0x1d80f9[_0xe114('0x1e')]+_0x1d80f9[_0xe114('0x1b')];var _0x307f42;if(_0x3da80e>=_0x166160){_0x3da80e=_0x166160;_0x307f42=0xc8;}else{_0x307f42=0xce;}_0x12aac9[_0xe114('0x18')](_0x307f42);return _0x12aac9[_0xe114('0x1f')]('Content-Range',_0x55c67d+'-'+_0x3da80e+'/'+_0x166160)['json'](_0x43083b);}return null;};}function patchUpdates(_0x541d94){return function(_0x204ae8){try{jsonpatch[_0xe114('0x20')](_0x204ae8,_0x541d94,!![]);}catch(_0x2399c8){return BPromise['reject'](_0x2399c8);}return _0x204ae8[_0xe114('0x21')]();};}function saveUpdates(_0x2ad619,_0x452869){return function(_0x4e274e){if(_0x4e274e){return _0x4e274e['update'](_0x2ad619)[_0xe114('0x22')](function(_0x4255ea){return _0x4255ea;});}return null;};}function removeEntity(_0x28fba5,_0x433eed){return function(_0x2b9633){if(_0x2b9633){return _0x2b9633[_0xe114('0x23')]()['then'](function(){_0x28fba5[_0xe114('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x390c84,_0x428ced){return function(_0x5c563b){if(!_0x5c563b){_0x390c84['sendStatus'](0x194);}return _0x5c563b;};}function handleError(_0x3c34a1,_0x2aee26){_0x2aee26=_0x2aee26||0x1f4;return function(_0x39634e){logger[_0xe114('0x24')](_0x39634e[_0xe114('0x25')]);if(_0x39634e[_0xe114('0x26')]){delete _0x39634e[_0xe114('0x26')];}_0x3c34a1[_0xe114('0x18')](_0x2aee26)[_0xe114('0x27')](_0x39634e);};}exports[_0xe114('0x28')]=function(_0x477742,_0x3ff091){var _0x5afddb={},_0x1c4154={},_0x110a48={'count':0x0,'rows':[]};var _0x4419f2=_['map'](db[_0xe114('0x29')][_0xe114('0x2a')],function(_0x882077){return{'name':_0x882077[_0xe114('0x2b')],'type':_0x882077[_0xe114('0x2c')][_0xe114('0x2d')]};});_0x1c4154['model']=_[_0xe114('0x2e')](_0x4419f2,_0xe114('0x26'));_0x1c4154[_0xe114('0x2f')]=_[_0xe114('0x30')](_0x477742[_0xe114('0x2f')]);_0x1c4154['filters']=_['intersection'](_0x1c4154[_0xe114('0x31')],_0x1c4154[_0xe114('0x2f')]);_0x5afddb[_0xe114('0x32')]=_[_0xe114('0x33')](_0x1c4154['model'],qs[_0xe114('0x34')](_0x477742[_0xe114('0x2f')][_0xe114('0x34')]));_0x5afddb['attributes']=_0x5afddb[_0xe114('0x32')][_0xe114('0x35')]?_0x5afddb[_0xe114('0x32')]:_0x1c4154[_0xe114('0x31')];if(!_0x477742[_0xe114('0x2f')][_0xe114('0x36')]('nolimit')){_0x5afddb[_0xe114('0x1b')]=qs['limit'](_0x477742[_0xe114('0x2f')][_0xe114('0x1b')]);_0x5afddb['offset']=qs[_0xe114('0x1e')](_0x477742[_0xe114('0x2f')][_0xe114('0x1e')]);}_0x5afddb[_0xe114('0x37')]=qs[_0xe114('0x38')](_0x477742['query'][_0xe114('0x38')]);_0x5afddb['where']=qs[_0xe114('0x39')](_['pick'](_0x477742['query'],_0x1c4154[_0xe114('0x39')]),_0x4419f2);if(_0x477742[_0xe114('0x2f')]['filter']){_0x5afddb[_0xe114('0x3a')]=_[_0xe114('0x3b')](_0x5afddb['where'],{'$or':_[_0xe114('0x2e')](_0x4419f2,function(_0x36580e){if(_0x36580e[_0xe114('0x2c')]!==_0xe114('0x3c')){var _0x515144={};_0x515144[_0x36580e[_0xe114('0x26')]]={'$like':'%'+_0x477742[_0xe114('0x2f')][_0xe114('0x3d')]+'%'};return _0x515144;}})});}_0x5afddb=_[_0xe114('0x3b')]({},_0x5afddb,_0x477742[_0xe114('0x3e')]);var _0x4b2450={'where':_0x5afddb[_0xe114('0x3a')]};return db[_0xe114('0x29')]['count'](_0x4b2450)[_0xe114('0x22')](function(_0xcd4c38){_0x110a48[_0xe114('0x1d')]=_0xcd4c38;if(_0x477742[_0xe114('0x2f')][_0xe114('0x3f')]){_0x5afddb[_0xe114('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe114('0x41')](_0x5afddb);})[_0xe114('0x22')](function(_0x15b58e){_0x110a48[_0xe114('0x42')]=_0x15b58e;return _0x110a48;})[_0xe114('0x22')](respondWithFilteredResult(_0x3ff091,_0x5afddb))[_0xe114('0x43')](handleError(_0x3ff091,null));};exports[_0xe114('0x44')]=function(_0x442f67,_0x508111){var _0x11bc9a={'raw':!![],'where':{'id':_0x442f67['params']['id']}},_0x34661c={};_0x34661c['model']=_['keys'](db['ChatTransferReport'][_0xe114('0x2a')]);_0x34661c[_0xe114('0x2f')]=_[_0xe114('0x30')](_0x442f67[_0xe114('0x2f')]);_0x34661c[_0xe114('0x39')]=_[_0xe114('0x33')](_0x34661c[_0xe114('0x31')],_0x34661c[_0xe114('0x2f')]);_0x11bc9a[_0xe114('0x32')]=_[_0xe114('0x33')](_0x34661c[_0xe114('0x31')],qs['fields'](_0x442f67[_0xe114('0x2f')][_0xe114('0x34')]));_0x11bc9a[_0xe114('0x32')]=_0x11bc9a[_0xe114('0x32')]['length']?_0x11bc9a[_0xe114('0x32')]:_0x34661c[_0xe114('0x31')];if(_0x442f67[_0xe114('0x2f')][_0xe114('0x3f')]){_0x11bc9a[_0xe114('0x40')]=[{'all':!![]}];}_0x11bc9a=_[_0xe114('0x3b')]({},_0x11bc9a,_0x442f67[_0xe114('0x3e')]);return db['ChatTransferReport'][_0xe114('0x45')](_0x11bc9a)[_0xe114('0x22')](handleEntityNotFound(_0x508111,null))['then'](respondWithResult(_0x508111,null))[_0xe114('0x43')](handleError(_0x508111,null));};exports[_0xe114('0x46')]=function(_0x1bc69c,_0x39d2b7){return db['ChatTransferReport'][_0xe114('0x46')](_0x1bc69c['body'],{})[_0xe114('0x22')](respondWithResult(_0x39d2b7,0xc9))[_0xe114('0x43')](handleError(_0x39d2b7,null));};exports['update']=function(_0x3d91a6,_0x2268c5){if(_0x3d91a6[_0xe114('0x47')]['id']){delete _0x3d91a6['body']['id'];}return db[_0xe114('0x29')]['find']({'where':{'id':_0x3d91a6[_0xe114('0x48')]['id']}})[_0xe114('0x22')](handleEntityNotFound(_0x2268c5,null))[_0xe114('0x22')](saveUpdates(_0x3d91a6[_0xe114('0x47')],null))[_0xe114('0x22')](respondWithResult(_0x2268c5,null))[_0xe114('0x43')](handleError(_0x2268c5,null));};exports[_0xe114('0x23')]=function(_0x220511,_0x4415fb){return db[_0xe114('0x29')][_0xe114('0x45')]({'where':{'id':_0x220511['params']['id']}})[_0xe114('0x22')](handleEntityNotFound(_0x4415fb,null))[_0xe114('0x22')](removeEntity(_0x4415fb,null))[_0xe114('0x43')](handleError(_0x4415fb,null));};exports[_0xe114('0x49')]=function(_0x3a1453,_0x37ee3a){return db['ChatTransferReport']['describe']()[_0xe114('0x22')](respondWithResult(_0x37ee3a,null))[_0xe114('0x43')](handleError(_0x37ee3a,null));}; \ No newline at end of file +var _0x5eab=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','include','ChatTransferReport','findAll','catch','show','params','length','includeAll','options','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash'];(function(_0x490662,_0x1611bd){var _0x5b2ffc=function(_0x1c6ab9){while(--_0x1c6ab9){_0x490662['push'](_0x490662['shift']());}};_0x5b2ffc(++_0x1611bd);}(_0x5eab,0x153));var _0xb5ea=function(_0x2c9220,_0x5b343e){_0x2c9220=_0x2c9220-0x0;var _0x7d7c2a=_0x5eab[_0x2c9220];return _0x7d7c2a;};'use strict';var emlformat=require(_0xb5ea('0x0'));var rimraf=require(_0xb5ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5ea('0x2'));var rp=require(_0xb5ea('0x3'));var moment=require(_0xb5ea('0x4'));var BPromise=require(_0xb5ea('0x5'));var Mustache=require(_0xb5ea('0x6'));var util=require(_0xb5ea('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb5ea('0x8'));var ejs=require(_0xb5ea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5ea('0xa'));var squel=require(_0xb5ea('0xb'));var crypto=require('crypto');var jsforce=require(_0xb5ea('0xc'));var deskjs=require(_0xb5ea('0xd'));var toCsv=require(_0xb5ea('0x8'));var querystring=require(_0xb5ea('0xe'));var Papa=require('papaparse');var Redis=require(_0xb5ea('0xf'));var authService=require(_0xb5ea('0x10'));var qs=require(_0xb5ea('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5ea('0x12'))('api');var utils=require(_0xb5ea('0x13'));var config=require(_0xb5ea('0x14'));var licenseUtil=require(_0xb5ea('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f5fa4,_0x4e421b){_0x4e421b=_0x4e421b||0xcc;return function(_0x460c31){if(_0x460c31){return _0x2f5fa4[_0xb5ea('0x16')](_0x4e421b);}return _0x2f5fa4['status'](_0x4e421b)[_0xb5ea('0x17')]();};}function respondWithResult(_0x5f4e35,_0x3eec8e){_0x3eec8e=_0x3eec8e||0xc8;return function(_0x2eb880){if(_0x2eb880){return _0x5f4e35[_0xb5ea('0x18')](_0x3eec8e)[_0xb5ea('0x19')](_0x2eb880);}};}function respondWithFilteredResult(_0x22851c,_0x3a8a92){return function(_0x321aaa){if(_0x321aaa){var _0x24b45c=typeof _0x3a8a92['offset']===_0xb5ea('0x1a')&&typeof _0x3a8a92[_0xb5ea('0x1b')]===_0xb5ea('0x1a');var _0x31aaff=_0x321aaa[_0xb5ea('0x1c')];var _0x5d60ec=_0x24b45c?0x0:_0x3a8a92[_0xb5ea('0x1d')];var _0x394967=_0x24b45c?_0x321aaa[_0xb5ea('0x1c')]:_0x3a8a92['offset']+_0x3a8a92[_0xb5ea('0x1b')];var _0x27eb6e;if(_0x394967>=_0x31aaff){_0x394967=_0x31aaff;_0x27eb6e=0xc8;}else{_0x27eb6e=0xce;}_0x22851c['status'](_0x27eb6e);return _0x22851c[_0xb5ea('0x1e')]('Content-Range',_0x5d60ec+'-'+_0x394967+'/'+_0x31aaff)[_0xb5ea('0x19')](_0x321aaa);}return null;};}function patchUpdates(_0x2c32fb){return function(_0x1e8b87){try{jsonpatch['apply'](_0x1e8b87,_0x2c32fb,!![]);}catch(_0x3020a1){return BPromise[_0xb5ea('0x1f')](_0x3020a1);}return _0x1e8b87[_0xb5ea('0x20')]();};}function saveUpdates(_0x1e7897,_0x4fba2f){return function(_0x310ba4){if(_0x310ba4){return _0x310ba4['update'](_0x1e7897)['then'](function(_0x2ab570){return _0x2ab570;});}return null;};}function removeEntity(_0x3a541c,_0x3f12ff){return function(_0x8b26f7){if(_0x8b26f7){return _0x8b26f7[_0xb5ea('0x21')]()[_0xb5ea('0x22')](function(){_0x3a541c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c21d,_0x2a7dc7){return function(_0x36eede){if(!_0x36eede){_0x30c21d[_0xb5ea('0x16')](0x194);}return _0x36eede;};}function handleError(_0x4a9fa0,_0x4a011d){_0x4a011d=_0x4a011d||0x1f4;return function(_0x387c5c){logger[_0xb5ea('0x23')](_0x387c5c['stack']);if(_0x387c5c['name']){delete _0x387c5c[_0xb5ea('0x24')];}_0x4a9fa0[_0xb5ea('0x18')](_0x4a011d)['send'](_0x387c5c);};}exports[_0xb5ea('0x25')]=function(_0x534f2d,_0xb856b8){var _0x5db8d5={},_0x41f576={},_0x57257b={'count':0x0,'rows':[]};var _0x275a8b=_[_0xb5ea('0x26')](db['ChatTransferReport'][_0xb5ea('0x27')],function(_0x3f9ef4){return{'name':_0x3f9ef4[_0xb5ea('0x28')],'type':_0x3f9ef4[_0xb5ea('0x29')][_0xb5ea('0x2a')]};});_0x41f576[_0xb5ea('0x2b')]=_[_0xb5ea('0x26')](_0x275a8b,_0xb5ea('0x24'));_0x41f576['query']=_[_0xb5ea('0x2c')](_0x534f2d[_0xb5ea('0x2d')]);_0x41f576['filters']=_['intersection'](_0x41f576[_0xb5ea('0x2b')],_0x41f576[_0xb5ea('0x2d')]);_0x5db8d5[_0xb5ea('0x2e')]=_[_0xb5ea('0x2f')](_0x41f576['model'],qs[_0xb5ea('0x30')](_0x534f2d['query']['fields']));_0x5db8d5['attributes']=_0x5db8d5[_0xb5ea('0x2e')]['length']?_0x5db8d5[_0xb5ea('0x2e')]:_0x41f576[_0xb5ea('0x2b')];if(!_0x534f2d[_0xb5ea('0x2d')][_0xb5ea('0x31')](_0xb5ea('0x32'))){_0x5db8d5[_0xb5ea('0x1b')]=qs[_0xb5ea('0x1b')](_0x534f2d[_0xb5ea('0x2d')]['limit']);_0x5db8d5[_0xb5ea('0x1d')]=qs['offset'](_0x534f2d['query'][_0xb5ea('0x1d')]);}_0x5db8d5['order']=qs['sort'](_0x534f2d['query'][_0xb5ea('0x33')]);_0x5db8d5['where']=qs[_0xb5ea('0x34')](_['pick'](_0x534f2d['query'],_0x41f576[_0xb5ea('0x34')]),_0x275a8b);if(_0x534f2d[_0xb5ea('0x2d')][_0xb5ea('0x35')]){_0x5db8d5[_0xb5ea('0x36')]=_['merge'](_0x5db8d5[_0xb5ea('0x36')],{'$or':_[_0xb5ea('0x26')](_0x275a8b,function(_0x15b012){if(_0x15b012[_0xb5ea('0x29')]!=='VIRTUAL'){var _0x111d54={};_0x111d54[_0x15b012[_0xb5ea('0x24')]]={'$like':'%'+_0x534f2d[_0xb5ea('0x2d')][_0xb5ea('0x35')]+'%'};return _0x111d54;}})});}_0x5db8d5=_[_0xb5ea('0x37')]({},_0x5db8d5,_0x534f2d['options']);var _0x9c4708={'where':_0x5db8d5[_0xb5ea('0x36')]};return db['ChatTransferReport'][_0xb5ea('0x1c')](_0x9c4708)[_0xb5ea('0x22')](function(_0x5a8917){_0x57257b['count']=_0x5a8917;if(_0x534f2d[_0xb5ea('0x2d')]['includeAll']){_0x5db8d5[_0xb5ea('0x38')]=[{'all':!![]}];}return db[_0xb5ea('0x39')][_0xb5ea('0x3a')](_0x5db8d5);})[_0xb5ea('0x22')](function(_0x10dded){_0x57257b['rows']=_0x10dded;return _0x57257b;})[_0xb5ea('0x22')](respondWithFilteredResult(_0xb856b8,_0x5db8d5))[_0xb5ea('0x3b')](handleError(_0xb856b8,null));};exports[_0xb5ea('0x3c')]=function(_0x274a60,_0x4e2087){var _0x21b9d0={'raw':!![],'where':{'id':_0x274a60[_0xb5ea('0x3d')]['id']}},_0x535f9f={};_0x535f9f[_0xb5ea('0x2b')]=_[_0xb5ea('0x2c')](db[_0xb5ea('0x39')][_0xb5ea('0x27')]);_0x535f9f[_0xb5ea('0x2d')]=_[_0xb5ea('0x2c')](_0x274a60[_0xb5ea('0x2d')]);_0x535f9f[_0xb5ea('0x34')]=_[_0xb5ea('0x2f')](_0x535f9f['model'],_0x535f9f[_0xb5ea('0x2d')]);_0x21b9d0[_0xb5ea('0x2e')]=_[_0xb5ea('0x2f')](_0x535f9f[_0xb5ea('0x2b')],qs[_0xb5ea('0x30')](_0x274a60[_0xb5ea('0x2d')]['fields']));_0x21b9d0['attributes']=_0x21b9d0[_0xb5ea('0x2e')][_0xb5ea('0x3e')]?_0x21b9d0['attributes']:_0x535f9f[_0xb5ea('0x2b')];if(_0x274a60[_0xb5ea('0x2d')][_0xb5ea('0x3f')]){_0x21b9d0[_0xb5ea('0x38')]=[{'all':!![]}];}_0x21b9d0=_['merge']({},_0x21b9d0,_0x274a60[_0xb5ea('0x40')]);return db[_0xb5ea('0x39')][_0xb5ea('0x41')](_0x21b9d0)[_0xb5ea('0x22')](handleEntityNotFound(_0x4e2087,null))[_0xb5ea('0x22')](respondWithResult(_0x4e2087,null))[_0xb5ea('0x3b')](handleError(_0x4e2087,null));};exports[_0xb5ea('0x42')]=function(_0x472779,_0x21b9bd){return db[_0xb5ea('0x39')][_0xb5ea('0x42')](_0x472779[_0xb5ea('0x43')],{})[_0xb5ea('0x22')](respondWithResult(_0x21b9bd,0xc9))['catch'](handleError(_0x21b9bd,null));};exports[_0xb5ea('0x44')]=function(_0x4e1e49,_0x291fc7){if(_0x4e1e49[_0xb5ea('0x43')]['id']){delete _0x4e1e49[_0xb5ea('0x43')]['id'];}return db['ChatTransferReport'][_0xb5ea('0x41')]({'where':{'id':_0x4e1e49['params']['id']}})['then'](handleEntityNotFound(_0x291fc7,null))[_0xb5ea('0x22')](saveUpdates(_0x4e1e49[_0xb5ea('0x43')],null))['then'](respondWithResult(_0x291fc7,null))[_0xb5ea('0x3b')](handleError(_0x291fc7,null));};exports[_0xb5ea('0x21')]=function(_0x228d89,_0x5b6f17){return db[_0xb5ea('0x39')][_0xb5ea('0x41')]({'where':{'id':_0x228d89[_0xb5ea('0x3d')]['id']}})[_0xb5ea('0x22')](handleEntityNotFound(_0x5b6f17,null))[_0xb5ea('0x22')](removeEntity(_0x5b6f17,null))[_0xb5ea('0x3b')](handleError(_0x5b6f17,null));};exports[_0xb5ea('0x45')]=function(_0xd0b79a,_0xb1a500){return db[_0xb5ea('0x39')][_0xb5ea('0x45')]()[_0xb5ea('0x22')](respondWithResult(_0xb1a500,null))['catch'](handleError(_0xb1a500,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 7a630be..f892604 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 _0xc669=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x5c4e89,_0x2c7c82){var _0x447840=function(_0x2eb0b5){while(--_0x2eb0b5){_0x5c4e89['push'](_0x5c4e89['shift']());}};_0x447840(++_0x2c7c82);}(_0xc669,0xdd));var _0x9c66=function(_0x2bcd39,_0x543ebc){_0x2bcd39=_0x2bcd39-0x0;var _0x291700=_0xc669[_0x2bcd39];return _0x291700;};'use strict';var _=require(_0x9c66('0x0'));var util=require(_0x9c66('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c66('0x2'));var BPromise=require('bluebird');var rp=require(_0x9c66('0x3'));var fs=require('fs');var path=require(_0x9c66('0x4'));var rimraf=require(_0x9c66('0x5'));var config=require(_0x9c66('0x6'));var attributes=require(_0x9c66('0x7'));module[_0x9c66('0x8')]=function(_0x54bc83,_0x1dee2b){return _0x54bc83[_0x9c66('0x9')](_0x9c66('0xa'),attributes,{'tableName':_0x9c66('0xb'),'paranoid':![],'indexes':[{'name':_0x9c66('0xc'),'fields':[_0x9c66('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda00=['api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','util'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xda00,0x1ba));var _0x0da0=function(_0xc37fab,_0xaf1029){_0xc37fab=_0xc37fab-0x0;var _0x6efaff=_0xda00[_0xc37fab];return _0x6efaff;};'use strict';var _=require(_0x0da0('0x0'));var util=require(_0x0da0('0x1'));var logger=require('../../config/logger')(_0x0da0('0x2'));var moment=require(_0x0da0('0x3'));var BPromise=require('bluebird');var rp=require(_0x0da0('0x4'));var fs=require('fs');var path=require(_0x0da0('0x5'));var rimraf=require(_0x0da0('0x6'));var config=require(_0x0da0('0x7'));var attributes=require(_0x0da0('0x8'));module['exports']=function(_0x4472c7,_0x2ec832){return _0x4472c7[_0x0da0('0x9')](_0x0da0('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x0da0('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index f955f1b..f4d8287 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 _0x9185=['then','info','request\x20sent','debug','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9185,0x128));var _0x5918=function(_0xca6909,_0x31d421){_0xca6909=_0xca6909-0x0;var _0x44d08e=_0x9185[_0xca6909];return _0x44d08e;};'use strict';var _=require(_0x5918('0x0'));var util=require(_0x5918('0x1'));var moment=require('moment');var BPromise=require(_0x5918('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5918('0x3'));var db=require(_0x5918('0x4'))['db'];var utils=require(_0x5918('0x5'));var logger=require(_0x5918('0x6'))(_0x5918('0x7'));var config=require('../../config/environment');var jayson=require(_0x5918('0x8'));var client=jayson[_0x5918('0x9')][_0x5918('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d3456,_0x4a829a,_0x39c799){return new BPromise(function(_0x5afbba,_0x286bcb){return client[_0x5918('0xb')](_0x3d3456,_0x39c799)[_0x5918('0xc')](function(_0x3e8134){logger[_0x5918('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x4a829a,_0x5918('0xe'));logger[_0x5918('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4a829a,_0x5918('0xe'),JSON[_0x5918('0x10')](_0x3e8134));if(_0x3e8134['error']){if(_0x3e8134[_0x5918('0x11')][_0x5918('0x12')]===0x1f4){logger[_0x5918('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4a829a,_0x3e8134[_0x5918('0x11')]['message']);return _0x286bcb(_0x3e8134[_0x5918('0x11')][_0x5918('0x13')]);}logger[_0x5918('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4a829a,_0x3e8134['error'][_0x5918('0x13')]);return _0x5afbba(_0x3e8134[_0x5918('0x11')][_0x5918('0x13')]);}else{logger['info'](_0x5918('0x14'),_0x4a829a,_0x5918('0xe'));_0x5afbba(_0x3e8134['result'][_0x5918('0x13')]);}})[_0x5918('0x15')](function(_0x3e828d){logger[_0x5918('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4a829a,_0x3e828d);_0x286bcb(_0x3e828d);});});} \ No newline at end of file +var _0x0bdd=['request\x20sent','debug','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x2a6ab4,_0x3f927c){var _0x37ba31=function(_0x4d44f1){while(--_0x4d44f1){_0x2a6ab4['push'](_0x2a6ab4['shift']());}};_0x37ba31(++_0x3f927c);}(_0x0bdd,0x17d));var _0xd0bd=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0x0bdd[_0x4f83ca];return _0x1fbac3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd0bd('0x0'));var BPromise=require(_0xd0bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0bd('0x2'))['db'];var utils=require(_0xd0bd('0x3'));var logger=require(_0xd0bd('0x4'))(_0xd0bd('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0bd('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc620e,_0x142341,_0x1a9b91){return new BPromise(function(_0x2b94dc,_0x33de02){return client[_0xd0bd('0x7')](_0xc620e,_0x1a9b91)[_0xd0bd('0x8')](function(_0x36ed8c){logger['info'](_0xd0bd('0x9'),_0x142341,_0xd0bd('0xa'));logger[_0xd0bd('0xb')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x142341,_0xd0bd('0xa'),JSON['stringify'](_0x36ed8c));if(_0x36ed8c[_0xd0bd('0xc')]){if(_0x36ed8c[_0xd0bd('0xc')][_0xd0bd('0xd')]===0x1f4){logger[_0xd0bd('0xc')](_0xd0bd('0x9'),_0x142341,_0x36ed8c[_0xd0bd('0xc')]['message']);return _0x33de02(_0x36ed8c['error'][_0xd0bd('0xe')]);}logger[_0xd0bd('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x142341,_0x36ed8c[_0xd0bd('0xc')][_0xd0bd('0xe')]);return _0x2b94dc(_0x36ed8c[_0xd0bd('0xc')][_0xd0bd('0xe')]);}else{logger['info'](_0xd0bd('0x9'),_0x142341,_0xd0bd('0xa'));_0x2b94dc(_0x36ed8c[_0xd0bd('0xf')][_0xd0bd('0xe')]);}})[_0xd0bd('0x10')](function(_0x2cf6e1){logger[_0xd0bd('0xc')](_0xd0bd('0x9'),_0x142341,_0x2cf6e1);_0x33de02(_0x2cf6e1);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 79ef1db..26d9701 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 _0xdd8f=['get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdd8f,0x174));var _0xfdd8=function(_0x14079f,_0x219f84){_0x14079f=_0x14079f-0x0;var _0xfacec=_0xdd8f[_0x14079f];return _0xfacec;};'use strict';var multer=require(_0xfdd8('0x0'));var util=require(_0xfdd8('0x1'));var path=require('path');var timeout=require(_0xfdd8('0x2'));var express=require(_0xfdd8('0x3'));var router=express[_0xfdd8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfdd8('0x6'));var controller=require(_0xfdd8('0x7'));router[_0xfdd8('0x8')]('/',auth[_0xfdd8('0x9')](),controller[_0xfdd8('0xa')]);router[_0xfdd8('0x8')](_0xfdd8('0xb'),auth['isAuthenticated'](),controller[_0xfdd8('0xc')]);router[_0xfdd8('0x8')]('/:id',auth[_0xfdd8('0x9')](),controller[_0xfdd8('0xd')]);router['post']('/',auth[_0xfdd8('0x9')](),controller[_0xfdd8('0xe')]);router[_0xfdd8('0xf')](_0xfdd8('0x10'),auth[_0xfdd8('0x9')](),controller[_0xfdd8('0x11')]);router[_0xfdd8('0x12')](_0xfdd8('0x10'),auth['isAuthenticated'](),controller[_0xfdd8('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0ad0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xaa7e97,_0x58f5e1){var _0x5b7a56=function(_0x56f705){while(--_0x56f705){_0xaa7e97['push'](_0xaa7e97['shift']());}};_0x5b7a56(++_0x58f5e1);}(_0x0ad0,0x124));var _0x00ad=function(_0xd01d7b,_0x2921b4){_0xd01d7b=_0xd01d7b-0x0;var _0x68549c=_0x0ad0[_0xd01d7b];return _0x68549c;};'use strict';var multer=require(_0x00ad('0x0'));var util=require(_0x00ad('0x1'));var path=require(_0x00ad('0x2'));var timeout=require(_0x00ad('0x3'));var express=require(_0x00ad('0x4'));var router=express[_0x00ad('0x5')]();var fs_extra=require(_0x00ad('0x6'));var auth=require(_0x00ad('0x7'));var interaction=require(_0x00ad('0x8'));var config=require(_0x00ad('0x9'));var controller=require(_0x00ad('0xa'));router[_0x00ad('0xb')]('/',auth['isAuthenticated'](),controller[_0x00ad('0xc')]);router['get'](_0x00ad('0xd'),auth[_0x00ad('0xe')](),controller[_0x00ad('0xf')]);router['get'](_0x00ad('0x10'),auth['isAuthenticated'](),controller[_0x00ad('0x11')]);router[_0x00ad('0x12')]('/',auth[_0x00ad('0xe')](),controller[_0x00ad('0x13')]);router[_0x00ad('0x14')](_0x00ad('0x10'),auth[_0x00ad('0xe')](),controller['update']);router['delete'](_0x00ad('0x10'),auth['isAuthenticated'](),controller[_0x00ad('0x15')]);module[_0x00ad('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 36f9708..c599985 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 _0xafe0=['Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Feedback','star','stringify','name','text','input','email','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xafe0,0x13d));var _0x0afe=function(_0x1220dc,_0x448145){_0x1220dc=_0x1220dc-0x0;var _0x264ada=_0xafe0[_0x1220dc];return _0x264ada;};'use strict';var Sequelize=require(_0x0afe('0x0'));var rs=require(_0x0afe('0x1'));module[_0x0afe('0x2')]={'name':{'type':Sequelize[_0x0afe('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x0afe('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x0afe('0x3')]},'mapKey':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x0afe('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0afe('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0afe('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0afe('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x0afe('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0afe('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0afe('0x8')]('rounded',_0x0afe('0x9')),'defaultValue':_0x0afe('0xa')},'header_online':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0xb')},'start_chat_button':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0xc')},'offline_chat_button':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0xd')},'download_transcript':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0afe('0xf')]},'closingQuestion':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0afe('0x13')},'closingMessage':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x14')},'closingMessageButton':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x15')},'skipMessageButton':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x0afe('0x17'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x0afe('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0afe('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0afe('0x19'),'type':_0x0afe('0x1a'),'required':!![]},'props':{'title':_0x0afe('0x19'),'helpText':''}},{'type':_0x0afe('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0afe('0x1c')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0afe('0x1d')](_0x0afe('0x1e'))?JSON['parse'](this[_0x0afe('0x1d')]('onlineForm')):{};},'set':function(_0x14fe56){return this[_0x0afe('0x1f')](_0x0afe('0x1e'),JSON[_0x0afe('0x18')](_0x14fe56));}},'offlineForm':{'type':Sequelize[_0x0afe('0xf')],'defaultValue':function(){return JSON[_0x0afe('0x18')]({'items':[{'type':_0x0afe('0x1b'),'props':{'title':_0x0afe('0x1c'),'helpText':''},'config':{'required':!![],'placeholder':_0x0afe('0x1c'),'type':_0x0afe('0x1c')},'variable':null},{'type':_0x0afe('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x0afe('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x0afe('0x22'))?JSON[_0x0afe('0x23')](this['getDataValue'](_0x0afe('0x22'))):{};},'set':function(_0x52b8e5){return this['setDataValue'](_0x0afe('0x22'),JSON[_0x0afe('0x18')](_0x52b8e5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0afe('0x3')]},'waitingTitle':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x24')},'waitingMessage':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x26')},'offlineMessageBody':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0afe('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0afe('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0afe('0xf')],'defaultValue':function(){return _0x0afe('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x0afe('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0afe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0afe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x0afe('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0afe('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':_0x0afe('0x2d')},'defaultTitle':{'type':Sequelize[_0x0afe('0x3')]},'customerAvatar':{'type':Sequelize[_0x0afe('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0afe('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0afe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0afe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0afe('0x2e')},'systemAvatar':{'type':Sequelize[_0x0afe('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x0afe('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1cd4ba){if(!_0x1cd4ba)this['setDataValue'](_0x0afe('0x30'),null);this[_0x0afe('0x1f')](_0x0afe('0x31'),_0x1cd4ba);}},'vidaooEscalation':{'type':Sequelize[_0x0afe('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0afe('0x3')]},'vidaooTopic':{'type':Sequelize[_0x0afe('0x3')],'allowNull':![],'defaultValue':_0x0afe('0x32')},'vidaooNote':{'type':Sequelize[_0x0afe('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x0afe('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x90d9=['We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared'];(function(_0x4c117f,_0x51e880){var _0x49bc6e=function(_0x5eb7f3){while(--_0x5eb7f3){_0x4c117f['push'](_0x4c117f['shift']());}};_0x49bc6e(++_0x51e880);}(_0x90d9,0x152));var _0x990d=function(_0x519c7f,_0x1dc5f9){_0x519c7f=_0x519c7f-0x0;var _0x69ce5c=_0x90d9[_0x519c7f];return _0x69ce5c;};'use strict';var Sequelize=require(_0x990d('0x0'));var rs=require(_0x990d('0x1'));module[_0x990d('0x2')]={'name':{'type':Sequelize[_0x990d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x990d('0x3')]},'mapKey':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x4')},'mapKeyOffline':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x4')},'key':{'type':Sequelize[_0x990d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x5')},'customerAlias':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':_0x990d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':_0x990d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x990d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x990d('0x9')](_0x990d('0xa'),_0x990d('0xb')),'defaultValue':_0x990d('0xa')},'header_online':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0xc')},'start_chat_button':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0x11')},'noteTitle':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x13')},'closingMessageButton':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x14')},'conditionAgreement':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x990d('0x9')](_0x990d('0x15'),_0x990d('0x16')),'defaultValue':_0x990d('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x990d('0x17')]({'items':[{'type':_0x990d('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x990d('0x19'),'required':!![]},'props':{'title':_0x990d('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x990d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x990d('0x4'),'type':_0x990d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x990d('0x1b')](_0x990d('0x1c'))?JSON[_0x990d('0x1d')](this[_0x990d('0x1b')]('onlineForm')):{};},'set':function(_0x39d0c9){return this[_0x990d('0x1e')]('onlineForm',JSON['stringify'](_0x39d0c9));}},'offlineForm':{'type':Sequelize[_0x990d('0x1f')],'defaultValue':function(){return JSON[_0x990d('0x17')]({'items':[{'type':'input','props':{'title':_0x990d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x990d('0x4'),'type':_0x990d('0x4')},'variable':null},{'type':_0x990d('0x20'),'config':{'placeholder':_0x990d('0x21')},'props':{'title':'Comments','helpText':_0x990d('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON['parse'](this['getDataValue'](_0x990d('0x23'))):{};},'set':function(_0x3669c9){return this[_0x990d('0x1e')](_0x990d('0x23'),JSON[_0x990d('0x17')](_0x3669c9));}},'token':{'type':Sequelize[_0x990d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x990d('0x3')]},'forwardOffline':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x990d('0x3')]},'waitingTitle':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x24')},'waitingMessage':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0x25')},'offlineMessageBody':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x26')},'skipUnmanaged':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x14')},'sendUnmanaged':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x990d('0x1f')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x990d('0x1f')],'defaultValue':function(){return _0x990d('0x27');}},'notificationSound':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0x28')},'verticalAlignment':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x29')},'messagesAlignment':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x2a')},'defaultTitle':{'type':Sequelize[_0x990d('0x3')]},'customerAvatar':{'type':Sequelize[_0x990d('0x1f')]},'showCustomerAvatar':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x2b')},'systemAvatar':{'type':Sequelize[_0x990d('0x1f')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x990d('0xf')],'comment':_0x990d('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![],'comment':_0x990d('0x2d'),'set':function(_0x4dd73d){if(!_0x4dd73d)this[_0x990d('0x1e')](_0x990d('0x2e'),null);this[_0x990d('0x1e')](_0x990d('0x2f'),_0x4dd73d);}},'vidaooEscalation':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x990d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':_0x990d('0x30')},'vidaooNote':{'type':Sequelize[_0x990d('0x3')],'defaultValue':function(){return _0x990d('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x990d('0x1f')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x990d('0x1f')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index d0b67d9..916dec0 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 _0xc849=['rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','from','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','ChatApplication','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','asc','Contacts','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','send','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','server/files/templates/chatOfflineMessage.ejs','render','ChatOfflineMessage','originalname','mimetype','offline-chat','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','sendMail','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','email','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','tag','getProactiveActions','virtual','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','utf8','URL','origin','3.5.0','remote','replace','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','READ_COMMITTED','priority','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','url','../../config/logger','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','ChatWebsites','UserProfileResource','name','Command','getSnippet','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','catch','inspect','map','get','all','some','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','key','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','findAll','show','params','Pause','keys','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xc849,0x1d8));var _0x9c84=function(_0x47451b,_0x47d261){_0x47451b=_0x47451b-0x0;var _0x23b025=_0xc849[_0x47451b];return _0x23b025;};'use strict';var Mustache=require(_0x9c84('0x0'));var util=require(_0x9c84('0x1'));var path=require(_0x9c84('0x2'));var ejs=require(_0x9c84('0x3'));var fs=require('fs');var fs_extra=require(_0x9c84('0x4'));var _=require(_0x9c84('0x5'));var querystring=require('querystring');var htmlToText=require(_0x9c84('0x6'));var Redis=require(_0x9c84('0x7'));var jayson=require(_0x9c84('0x8'));var url=require(_0x9c84('0x9'));var qs=require('../../components/parsers/qs');var logger=require(_0x9c84('0xa'))(_0x9c84('0xb'));var config=require(_0x9c84('0xc'));var APIOutOfIntervalError=require(_0x9c84('0xd'))[_0x9c84('0xe')];var APINotFoundError=require('../../errors/api')[_0x9c84('0xf')];var APIHandleError=require(_0x9c84('0xd'))[_0x9c84('0x10')];var db=require(_0x9c84('0x11'))['db'];config['redis']=_[_0x9c84('0x12')](config[_0x9c84('0x13')],{'host':_0x9c84('0x14'),'port':0x18eb});var socket=require(_0x9c84('0x15'))(new Redis(config['redis']));require(_0x9c84('0x16'))['register'](socket);var client=jayson[_0x9c84('0x17')][_0x9c84('0x18')]({'port':0x232c});var client9002=jayson[_0x9c84('0x17')]['http']({'port':0x232a});var client9003=jayson[_0x9c84('0x17')][_0x9c84('0x18')]({'port':0x232b});var client9001=jayson[_0x9c84('0x17')]['http']({'port':0x2329});function respondWithRpcPromise(_0x362a45,_0x514d1c,_0x4b5a5a,_0x4b412f){return new Promise(function(_0x68b08b,_0x310929){var _0x54689f=_0x4b412f||client;return _0x54689f['request'](_0x362a45,_0x4b5a5a)[_0x9c84('0x19')](function(_0x5b3017){logger['info'](_0x9c84('0x1a'),_0x514d1c,_0x9c84('0x1b'));logger[_0x9c84('0x1c')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x514d1c,'request\x20sent',JSON[_0x9c84('0x1d')](_0x5b3017));if(_0x5b3017['error']){if(_0x5b3017[_0x9c84('0x1e')][_0x9c84('0x1f')]===0x1f4){logger[_0x9c84('0x1e')](_0x9c84('0x1a'),_0x514d1c,_0x5b3017[_0x9c84('0x1e')][_0x9c84('0x20')]);return _0x310929(_0x5b3017[_0x9c84('0x1e')][_0x9c84('0x20')]);}logger[_0x9c84('0x1e')](_0x9c84('0x1a'),_0x514d1c,_0x5b3017[_0x9c84('0x1e')][_0x9c84('0x20')]);return _0x68b08b(_0x5b3017['error']['message']);}else{logger[_0x9c84('0x21')](_0x9c84('0x1a'),_0x514d1c,_0x9c84('0x1b'));_0x68b08b(_0x5b3017[_0x9c84('0x22')][_0x9c84('0x20')]);}})['catch'](function(_0xdaf975){logger[_0x9c84('0x1e')](_0x9c84('0x1a'),_0x514d1c,_0xdaf975);_0x310929(_0xdaf975);});});}function respondWithStatusCode(_0x3d5890,_0x3438d4){_0x3438d4=_0x3438d4||0xcc;return function(_0x525033){if(_0x525033){return _0x3d5890[_0x9c84('0x23')](_0x3438d4);}return _0x3d5890[_0x9c84('0x24')](_0x3438d4)[_0x9c84('0x25')]();};}function respondWithResult(_0x48a4f7,_0x5bf371){_0x5bf371=_0x5bf371||0xc8;return function(_0xe8ef16){if(_0xe8ef16){return _0x48a4f7[_0x9c84('0x24')](_0x5bf371)[_0x9c84('0x26')](_0xe8ef16);}};}function respondWithFilteredResult(_0x23c95d,_0x123da7){return function(_0x12d5d7){if(_0x12d5d7){var _0xa45d4f=typeof _0x123da7['offset']===_0x9c84('0x27')&&typeof _0x123da7['limit']===_0x9c84('0x27');var _0x5575ea=_0x12d5d7[_0x9c84('0x28')];var _0x14559c=_0xa45d4f?0x0:_0x123da7[_0x9c84('0x29')];var _0x5a2ff3=_0xa45d4f?_0x12d5d7[_0x9c84('0x28')]:_0x123da7[_0x9c84('0x29')]+_0x123da7[_0x9c84('0x2a')];var _0x19cf37;if(_0x5a2ff3>=_0x5575ea){_0x5a2ff3=_0x5575ea;_0x19cf37=0xc8;}else{_0x19cf37=0xce;}_0x23c95d[_0x9c84('0x24')](_0x19cf37);return _0x23c95d[_0x9c84('0x2b')](_0x9c84('0x2c'),_0x14559c+'-'+_0x5a2ff3+'/'+_0x5575ea)['json'](_0x12d5d7);}return null;};}function saveUpdates(_0x50d911){return function(_0x3f3dff){if(_0x3f3dff){return _0x3f3dff[_0x9c84('0x2d')](_0x50d911)[_0x9c84('0x19')](function(_0x24e544){return _0x24e544;});}return null;};}function removeEntity(_0x57354c){return function(_0x62458b){if(_0x62458b){return _0x62458b[_0x9c84('0x2e')]()[_0x9c84('0x19')](function(){var _0x31d3d0=_0x62458b['get']({'plain':!![]});var _0xa64b13=_0x9c84('0x2f');return db[_0x9c84('0x30')][_0x9c84('0x2e')]({'where':{'type':_0xa64b13,'resourceId':_0x31d3d0['id']}})['then'](function(){return _0x62458b;});})['then'](function(){_0x57354c['status'](0xcc)[_0x9c84('0x25')]();});}};}function handleEntityNotFound(_0x4d8275){return function(_0x48ea8e){if(!_0x48ea8e){_0x4d8275[_0x9c84('0x23')](0x194);}return _0x48ea8e;};}function handleError(_0x4838fb,_0x442431){_0x442431=_0x442431||0x1f4;return function(_0xa60f13){logger[_0x9c84('0x1e')](_0xa60f13['stack']);if(_0xa60f13[_0x9c84('0x31')]){delete _0xa60f13['name'];}_0x4838fb[_0x9c84('0x24')](_0x442431)['send'](_0xa60f13);};}function iftimePromise(_0x7329d2,_0x2fd33d){return respondWithRpcPromise(_0x9c84('0x32'),_0x9c84('0x33'),{'command':_0x2fd33d['timezone']?util['format']('iftime\x20%s,%s',_0x7329d2[_0x9c84('0x34')],_0x2fd33d[_0x9c84('0x35')]):util['format'](_0x9c84('0x36'),_0x7329d2[_0x9c84('0x34')])},client9002)[_0x9c84('0x19')](function(_0x539d2e){var _0x566210=_0x539d2e&&_0x539d2e[_0x9c84('0x37')](_0x9c84('0x38'))>=0x0?!![]:![];logger[_0x9c84('0x21')](_0x9c84('0x39'),_0x2fd33d['id'],_0x7329d2['id'],_0x7329d2[_0x9c84('0x34')],_0x566210?_0x9c84('0x3a'):_0x9c84('0x3b'),_0x2fd33d[_0x9c84('0x35')]?_0x2fd33d[_0x9c84('0x35')]:_0x9c84('0x3c'));return _0x566210;})[_0x9c84('0x3d')](function(_0x46e5ee){logger[_0x9c84('0x1e')](_0x9c84('0x39'),_0x2fd33d['id'],_0x7329d2['id'],_0x7329d2[_0x9c84('0x34')],util[_0x9c84('0x3e')](_0x46e5ee,{'showHidden':![],'depth':null}),_0x2fd33d[_0x9c84('0x35')]?_0x2fd33d[_0x9c84('0x35')]:_0x9c84('0x3c'));return![];});}function checkWebsiteIntervals(_0x4cd863){var _0x3e0cec=_[_0x9c84('0x3f')](_0x4cd863['Interval']['Intervals'],function(_0x56c8f9){var _0x165c57=_0x56c8f9[_0x9c84('0x40')]({'plain':!![]});return iftimePromise(_0x165c57,_0x4cd863);});return Promise[_0x9c84('0x41')](_0x3e0cec)['then'](function(_0x4d2b23){return _[_0x9c84('0x42')](_0x4d2b23);});}function createInteractionObject(_0x3f404a,_0xcfe5b2,_0x36118d,_0x124a33){var _0x293f12=require('user-agent-parser');var _0x448868=new _0x293f12();var _0xe35081=_0x448868['setUA'](_0x36118d[_0x9c84('0x43')])[_0x9c84('0x44')]();var _0xee1d3b=_0xcfe5b2[_0x9c84('0x45')];if(_0x36118d[_0x9c84('0x46')]){_0xee1d3b=_0x36118d[_0x9c84('0x46')];}else if(_0x36118d[_0x9c84('0x47')]){_0xee1d3b=_[_0x9c84('0x48')](_0x36118d[_0x9c84('0x47')][_0x9c84('0x49')](','));}return{'ContactId':_0x124a33['id'],'ChatWebsiteId':_0x3f404a,'from':(_0x124a33[_0x9c84('0x4a')]||'')+'\x20'+(_0x124a33[_0x9c84('0x4b')]||''),'customerIp':_0xee1d3b,'customerPort':_0x36118d[_0x9c84('0x4c')]?_0x36118d[_0x9c84('0x4c')]:null,'referer':_0xcfe5b2[_0x9c84('0x4d')],'browserName':_0xe35081[_0x9c84('0x4e')][_0x9c84('0x31')]&&_0xe35081[_0x9c84('0x4e')][_0x9c84('0x4f')]?util['format']('%s\x20%s',_0xe35081[_0x9c84('0x4e')]['name'],_0xe35081[_0x9c84('0x4e')][_0x9c84('0x4f')]):_0x9c84('0x50'),'browserVersion':_0xe35081[_0x9c84('0x4e')][_0x9c84('0x4f')]||_0x9c84('0x50'),'osName':util[_0x9c84('0x51')](_0x9c84('0x52'),_0xe35081['os']['name'],_0xe35081['os'][_0x9c84('0x4f')]),'osVersion':_0xe35081['os'][_0x9c84('0x4f')],'deviceModel':_0xe35081[_0x9c84('0x53')][_0x9c84('0x54')]&&_0xe35081[_0x9c84('0x53')][_0x9c84('0x55')]?util[_0x9c84('0x51')](_0x9c84('0x56'),_0xe35081['device'][_0x9c84('0x54')],_0xe35081[_0x9c84('0x53')][_0x9c84('0x55')],_0xe35081[_0x9c84('0x53')][_0x9c84('0x57')]):null,'deviceVendor':_0xe35081['device'][_0x9c84('0x55')],'deviceType':_0xe35081[_0x9c84('0x53')][_0x9c84('0x57')],'formData':JSON['stringify'](_0xcfe5b2)};}exports[_0x9c84('0x58')]=function(_0xc3e492,_0x4ee8cd){var _0x27d7eb={'include':[{'model':db['Pause'],'as':_0x9c84('0x59')}]},_0x15cafd={},_0x59419c={'count':0x0,'rows':[]};var _0x3b67d5=_['map'](db[_0x9c84('0x5a')][_0x9c84('0x5b')],function(_0xcb5a6a){return{'name':_0xcb5a6a['fieldName'],'type':_0xcb5a6a[_0x9c84('0x57')][_0x9c84('0x5c')]};});_0x15cafd[_0x9c84('0x54')]=_[_0x9c84('0x3f')](_0x3b67d5,_0x9c84('0x31'));_0x15cafd[_0x9c84('0x5d')]=_['keys'](_0xc3e492[_0x9c84('0x5d')]);_0x15cafd['filters']=_['intersection'](_0x15cafd['model'],_0x15cafd['query']);_0x27d7eb['attributes']=_[_0x9c84('0x5e')](_0x15cafd[_0x9c84('0x54')],qs[_0x9c84('0x5f')](_0xc3e492[_0x9c84('0x5d')][_0x9c84('0x5f')]));_0x27d7eb[_0x9c84('0x60')]=_0x27d7eb[_0x9c84('0x60')]['length']?_0x27d7eb['attributes']:_0x15cafd[_0x9c84('0x54')];if(!_0xc3e492[_0x9c84('0x5d')][_0x9c84('0x61')](_0x9c84('0x62'))){_0x27d7eb[_0x9c84('0x2a')]=qs[_0x9c84('0x2a')](_0xc3e492['query']['limit']);_0x27d7eb[_0x9c84('0x29')]=qs['offset'](_0xc3e492['query']['offset']);}_0x27d7eb[_0x9c84('0x63')]=qs[_0x9c84('0x64')](_0xc3e492[_0x9c84('0x5d')][_0x9c84('0x64')]);_0x27d7eb[_0x9c84('0x65')]=qs[_0x9c84('0x66')](_[_0x9c84('0x67')](_0xc3e492['query'],_0x15cafd[_0x9c84('0x66')]),_0x3b67d5);if(_0xc3e492[_0x9c84('0x5d')]['filter']){_0x27d7eb['where']=_[_0x9c84('0x68')](_0x27d7eb['where'],{'$or':_['map'](_0x3b67d5,function(_0x1b1c31){if(_0x1b1c31[_0x9c84('0x57')]!==_0x9c84('0x69')){var _0x230abd={};_0x230abd[_0x1b1c31[_0x9c84('0x31')]]={'$like':'%'+_0xc3e492['query'][_0x9c84('0x6a')]+'%'};return _0x230abd;}})});}_0x27d7eb=_['merge']({},_0x27d7eb,_0xc3e492[_0x9c84('0x6b')]);var _0xaa7149={'where':_0x27d7eb['where']};return db['ChatWebsite'][_0x9c84('0x28')](_0xaa7149)[_0x9c84('0x19')](function(_0x335f32){_0x59419c[_0x9c84('0x28')]=_0x335f32;if(_0xc3e492[_0x9c84('0x5d')]['includeAll']){_0x27d7eb['include']=[{'all':!![]}];}return db[_0x9c84('0x5a')][_0x9c84('0x6c')](_0x27d7eb);})[_0x9c84('0x19')](function(_0x556087){_0x59419c['rows']=_0x556087;return _0x59419c;})[_0x9c84('0x19')](respondWithFilteredResult(_0x4ee8cd,_0x27d7eb))[_0x9c84('0x3d')](handleError(_0x4ee8cd,null));};exports[_0x9c84('0x6d')]=function(_0x179be4,_0x2b9309){var _0x5769c5={'raw':![],'where':{'id':_0x179be4[_0x9c84('0x6e')]['id']},'include':[{'model':db[_0x9c84('0x6f')],'as':_0x9c84('0x59')}]},_0x319602={};_0x319602[_0x9c84('0x54')]=_[_0x9c84('0x70')](db[_0x9c84('0x5a')][_0x9c84('0x5b')]);_0x319602['query']=_['keys'](_0x179be4[_0x9c84('0x5d')]);_0x319602['filters']=_[_0x9c84('0x5e')](_0x319602['model'],_0x319602[_0x9c84('0x5d')]);_0x5769c5[_0x9c84('0x60')]=_[_0x9c84('0x5e')](_0x319602[_0x9c84('0x54')],qs[_0x9c84('0x5f')](_0x179be4[_0x9c84('0x5d')][_0x9c84('0x5f')]));_0x5769c5[_0x9c84('0x60')]=_0x5769c5[_0x9c84('0x60')][_0x9c84('0x71')]?_0x5769c5[_0x9c84('0x60')]:_0x319602[_0x9c84('0x54')];if(_0x179be4[_0x9c84('0x5d')][_0x9c84('0x72')]){_0x5769c5[_0x9c84('0x73')]=[{'all':!![]}];}_0x5769c5=_[_0x9c84('0x68')]({},_0x5769c5,_0x179be4[_0x9c84('0x6b')]);return db['ChatWebsite'][_0x9c84('0x74')](_0x5769c5)[_0x9c84('0x19')](handleEntityNotFound(_0x2b9309,null))[_0x9c84('0x19')](respondWithResult(_0x2b9309,null))[_0x9c84('0x3d')](handleError(_0x2b9309,null));};exports[_0x9c84('0x75')]=function(_0x590cd0,_0x2fce12){return db[_0x9c84('0x5a')][_0x9c84('0x75')](_0x590cd0[_0x9c84('0x76')],{})['then'](function(_0x4281ec){var _0x3ecf6e=_0x590cd0[_0x9c84('0x77')][_0x9c84('0x40')]({'plain':!![]});if(!_0x3ecf6e)throw new Error(_0x9c84('0x78'));if(_0x3ecf6e['role']===_0x9c84('0x77')){var _0x4e6a96=_0x4281ec[_0x9c84('0x40')]({'plain':!![]});var _0x542b0d=_0x9c84('0x2f');return db[_0x9c84('0x79')][_0x9c84('0x74')]({'where':{'name':_0x542b0d,'userProfileId':_0x3ecf6e[_0x9c84('0x7a')]},'raw':!![]})[_0x9c84('0x19')](function(_0x167c95){if(_0x167c95&&_0x167c95['autoAssociation']===0x0){return db[_0x9c84('0x30')][_0x9c84('0x75')]({'name':_0x4e6a96['name'],'resourceId':_0x4e6a96['id'],'type':_0x167c95[_0x9c84('0x31')],'sectionId':_0x167c95['id']},{})[_0x9c84('0x19')](function(){return _0x4281ec;});}else{return _0x4281ec;}})[_0x9c84('0x3d')](function(_0x3fa35e){logger[_0x9c84('0x1e')](_0x9c84('0x7b'),_0x3fa35e);throw _0x3fa35e;});}return _0x4281ec;})['then'](respondWithResult(_0x2fce12,0xc9))[_0x9c84('0x3d')](handleError(_0x2fce12,null));};exports[_0x9c84('0x2d')]=function(_0x2f07cc,_0x38a9a4){if(_0x2f07cc[_0x9c84('0x76')]['id']){delete _0x2f07cc['body']['id'];}return db[_0x9c84('0x5a')]['find']({'where':{'id':_0x2f07cc['params']['id']},'include':[{'model':db['Pause'],'as':_0x9c84('0x59')}]})[_0x9c84('0x19')](handleEntityNotFound(_0x38a9a4,null))['then'](saveUpdates(_0x2f07cc['body'],null))['then'](respondWithResult(_0x38a9a4,null))[_0x9c84('0x3d')](handleError(_0x38a9a4,null));};exports[_0x9c84('0x2e')]=function(_0x56c52e,_0x44702a){return db['ChatWebsite'][_0x9c84('0x74')]({'where':{'id':_0x56c52e['params']['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x44702a,null))[_0x9c84('0x19')](removeEntity(_0x44702a,null))[_0x9c84('0x3d')](handleError(_0x44702a,null));};exports[_0x9c84('0x7c')]=function(_0x55f6a4,_0x1a4ce7){return db[_0x9c84('0x5a')]['describe']()['then'](respondWithResult(_0x1a4ce7,null))[_0x9c84('0x3d')](handleError(_0x1a4ce7,null));};exports[_0x9c84('0x7d')]=function(_0x457f06,_0x596c3e){if(_0x457f06['body']['id']){delete _0x457f06[_0x9c84('0x76')]['id'];}return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x457f06[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x596c3e,null))[_0x9c84('0x19')](function(_0x2007c5){if(_0x2007c5){_0x457f06[_0x9c84('0x76')][_0x9c84('0x7e')]=_0x2007c5['id'];return db['Disposition'][_0x9c84('0x75')](_0x457f06[_0x9c84('0x76')]);}})[_0x9c84('0x19')](respondWithResult(_0x596c3e,null))[_0x9c84('0x3d')](handleError(_0x596c3e,null));};exports[_0x9c84('0x7f')]=function(_0x37cd41,_0x315171){var _0x276a5c={'raw':![],'where':{}};var _0x1f86d1={};var _0x4f4940={'count':0x0,'rows':[]};return db[_0x9c84('0x5a')][_0x9c84('0x80')]({'where':{'id':_0x37cd41[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x315171,null))[_0x9c84('0x19')](function(_0x75108a){if(_0x75108a){_0x1f86d1[_0x9c84('0x54')]=_[_0x9c84('0x70')](db[_0x9c84('0x81')][_0x9c84('0x5b')]);_0x1f86d1[_0x9c84('0x5d')]=_[_0x9c84('0x70')](_0x37cd41[_0x9c84('0x5d')]);_0x1f86d1[_0x9c84('0x66')]=_['intersection'](_0x1f86d1[_0x9c84('0x54')],_0x1f86d1[_0x9c84('0x5d')]);_0x276a5c['attributes']=_[_0x9c84('0x5e')](_0x1f86d1[_0x9c84('0x54')],qs['fields'](_0x37cd41[_0x9c84('0x5d')][_0x9c84('0x5f')]));_0x276a5c[_0x9c84('0x60')]=_0x276a5c[_0x9c84('0x60')][_0x9c84('0x71')]?_0x276a5c[_0x9c84('0x60')]:_0x1f86d1[_0x9c84('0x54')];if(!_0x37cd41[_0x9c84('0x5d')][_0x9c84('0x61')](_0x9c84('0x62'))){_0x276a5c[_0x9c84('0x2a')]=qs['limit'](_0x37cd41[_0x9c84('0x5d')][_0x9c84('0x2a')]);_0x276a5c[_0x9c84('0x29')]=qs['offset'](_0x37cd41['query'][_0x9c84('0x29')]);}_0x276a5c[_0x9c84('0x63')]=qs[_0x9c84('0x64')](_0x37cd41[_0x9c84('0x5d')]['sort']);_0x276a5c[_0x9c84('0x65')]=qs['filters'](_[_0x9c84('0x67')](_0x37cd41[_0x9c84('0x5d')],_0x1f86d1[_0x9c84('0x66')]));_0x276a5c['where'][_0x9c84('0x7e')]=_0x75108a['id'];if(_0x37cd41[_0x9c84('0x5d')]['filter']){_0x276a5c[_0x9c84('0x65')]=_[_0x9c84('0x68')](_0x276a5c[_0x9c84('0x65')],{'$or':_[_0x9c84('0x3f')](_0x276a5c[_0x9c84('0x60')],function(_0x22332a){var _0x85c366={};_0x85c366[_0x22332a]={'$like':'%'+_0x37cd41[_0x9c84('0x5d')][_0x9c84('0x6a')]+'%'};return _0x85c366;})});}_0x276a5c=_['merge']({},_0x276a5c,_0x37cd41[_0x9c84('0x6b')]);return db[_0x9c84('0x81')][_0x9c84('0x28')]({'where':_0x276a5c[_0x9c84('0x65')]})[_0x9c84('0x19')](function(_0x88d9ed){_0x4f4940[_0x9c84('0x28')]=_0x88d9ed;if(_0x37cd41[_0x9c84('0x5d')][_0x9c84('0x72')]){_0x276a5c['include']=[{'all':!![]}];}return db[_0x9c84('0x81')][_0x9c84('0x6c')](_0x276a5c);})[_0x9c84('0x19')](function(_0x6e8544){_0x4f4940[_0x9c84('0x82')]=_0x6e8544;return _0x4f4940;});}})['then'](respondWithFilteredResult(_0x315171,_0x276a5c))[_0x9c84('0x3d')](handleError(_0x315171,null));};exports[_0x9c84('0x83')]=function(_0x4aa55c,_0x1fc3d5){return db['ChatWebsite'][_0x9c84('0x74')]({'where':{'id':_0x4aa55c[_0x9c84('0x6e')]['id']}})['then'](handleEntityNotFound(_0x1fc3d5,null))[_0x9c84('0x19')](function(_0xb738d8){if(_0xb738d8){return _0xb738d8['removeDispositions'](_0x4aa55c['query'][_0x9c84('0x84')]);}})['then'](respondWithStatusCode(_0x1fc3d5,null))['catch'](handleError(_0x1fc3d5,null));};exports['addAnswer']=function(_0x528ef,_0x3e64ea){if(_0x528ef[_0x9c84('0x76')]['id']){delete _0x528ef[_0x9c84('0x76')]['id'];}return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x528ef[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x3e64ea,null))['then'](function(_0x36e5db){if(_0x36e5db){_0x528ef['body'][_0x9c84('0x7e')]=_0x36e5db['id'];return db[_0x9c84('0x85')][_0x9c84('0x75')](_0x528ef['body']);}})[_0x9c84('0x19')](respondWithResult(_0x3e64ea,null))['catch'](handleError(_0x3e64ea,null));};exports[_0x9c84('0x86')]=function(_0x4b8c1d,_0x1fbe0c){var _0x28ea6e={'raw':![],'where':{}};var _0x324b54={};var _0x7cada7={'count':0x0,'rows':[]};return db[_0x9c84('0x5a')][_0x9c84('0x80')]({'where':{'id':_0x4b8c1d[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x1fbe0c,null))['then'](function(_0xcab4f8){if(_0xcab4f8){_0x324b54[_0x9c84('0x54')]=_[_0x9c84('0x70')](db[_0x9c84('0x85')]['rawAttributes']);_0x324b54[_0x9c84('0x5d')]=_['keys'](_0x4b8c1d[_0x9c84('0x5d')]);_0x324b54[_0x9c84('0x66')]=_['intersection'](_0x324b54['model'],_0x324b54[_0x9c84('0x5d')]);_0x28ea6e[_0x9c84('0x60')]=_['intersection'](_0x324b54[_0x9c84('0x54')],qs[_0x9c84('0x5f')](_0x4b8c1d['query'][_0x9c84('0x5f')]));_0x28ea6e[_0x9c84('0x60')]=_0x28ea6e['attributes'][_0x9c84('0x71')]?_0x28ea6e[_0x9c84('0x60')]:_0x324b54[_0x9c84('0x54')];if(!_0x4b8c1d[_0x9c84('0x5d')][_0x9c84('0x61')](_0x9c84('0x62'))){_0x28ea6e[_0x9c84('0x2a')]=qs[_0x9c84('0x2a')](_0x4b8c1d['query'][_0x9c84('0x2a')]);_0x28ea6e['offset']=qs[_0x9c84('0x29')](_0x4b8c1d[_0x9c84('0x5d')][_0x9c84('0x29')]);}_0x28ea6e[_0x9c84('0x63')]=qs[_0x9c84('0x64')](_0x4b8c1d[_0x9c84('0x5d')]['sort']);_0x28ea6e[_0x9c84('0x65')]=qs['filters'](_[_0x9c84('0x67')](_0x4b8c1d[_0x9c84('0x5d')],_0x324b54[_0x9c84('0x66')]));_0x28ea6e[_0x9c84('0x65')][_0x9c84('0x7e')]=_0xcab4f8['id'];if(_0x4b8c1d[_0x9c84('0x5d')][_0x9c84('0x6a')]){_0x28ea6e['where']=_[_0x9c84('0x68')](_0x28ea6e['where'],{'$or':_[_0x9c84('0x3f')](_0x28ea6e[_0x9c84('0x60')],function(_0x1d6f8c){var _0x4d3ffd={};_0x4d3ffd[_0x1d6f8c]={'$like':'%'+_0x4b8c1d['query'][_0x9c84('0x6a')]+'%'};return _0x4d3ffd;})});}_0x28ea6e=_[_0x9c84('0x68')]({},_0x28ea6e,_0x4b8c1d['options']);return db[_0x9c84('0x85')][_0x9c84('0x28')]({'where':_0x28ea6e[_0x9c84('0x65')]})[_0x9c84('0x19')](function(_0x2522cb){_0x7cada7[_0x9c84('0x28')]=_0x2522cb;if(_0x4b8c1d[_0x9c84('0x5d')][_0x9c84('0x72')]){_0x28ea6e[_0x9c84('0x73')]=[{'all':!![]}];}return db[_0x9c84('0x85')][_0x9c84('0x6c')](_0x28ea6e);})[_0x9c84('0x19')](function(_0x4f3ac6){_0x7cada7['rows']=_0x4f3ac6;return _0x7cada7;});}})['then'](respondWithFilteredResult(_0x1fbe0c,_0x28ea6e))['catch'](handleError(_0x1fbe0c,null));};exports['removeAnswers']=function(_0x47d054,_0x4e63a3){return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x47d054[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x4e63a3,null))[_0x9c84('0x19')](function(_0x21f3b3){if(_0x21f3b3){return _0x21f3b3[_0x9c84('0x87')](_0x47d054[_0x9c84('0x5d')][_0x9c84('0x84')]);}})[_0x9c84('0x19')](respondWithStatusCode(_0x4e63a3,null))[_0x9c84('0x3d')](handleError(_0x4e63a3,null));};exports['addLogo']=function(_0x492f3d,_0x125b95){_0x492f3d[_0x9c84('0x76')][_0x9c84('0x88')]=_0x492f3d[_0x9c84('0x89')][_0x9c84('0x8a')];return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x492f3d[_0x9c84('0x6e')]['id']}})['then'](handleEntityNotFound(_0x125b95,null))[_0x9c84('0x19')](saveUpdates(_0x492f3d[_0x9c84('0x76')],null))[_0x9c84('0x19')](respondWithResult(_0x125b95,null))[_0x9c84('0x3d')](handleError(_0x125b95,null));};exports[_0x9c84('0x8b')]=function(_0x436c57,_0x1f0175){_0x436c57[_0x9c84('0x76')][_0x9c84('0x8c')]=_0x436c57[_0x9c84('0x89')][_0x9c84('0x8a')];return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x436c57[_0x9c84('0x6e')]['id']}})['then'](handleEntityNotFound(_0x1f0175,null))[_0x9c84('0x19')](saveUpdates(_0x436c57[_0x9c84('0x76')],null))['then'](respondWithResult(_0x1f0175,null))['catch'](handleError(_0x1f0175,null));};exports[_0x9c84('0x8d')]=function(_0x43c8ad,_0x57830f){_0x43c8ad[_0x9c84('0x76')][_0x9c84('0x8e')]=_0x43c8ad[_0x9c84('0x89')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x43c8ad[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x57830f,null))[_0x9c84('0x19')](saveUpdates(_0x43c8ad['body'],null))['then'](respondWithResult(_0x57830f,null))['catch'](handleError(_0x57830f,null));};exports[_0x9c84('0x8f')]=function(_0x55c642,_0x23731e){_0x55c642['body'][_0x9c84('0x90')]=_0x55c642[_0x9c84('0x89')][_0x9c84('0x8a')];return db['ChatWebsite']['find']({'where':{'id':_0x55c642['params']['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x23731e,null))['then'](saveUpdates(_0x55c642['body'],null))[_0x9c84('0x19')](respondWithResult(_0x23731e,null))[_0x9c84('0x3d')](handleError(_0x23731e,null));};exports[_0x9c84('0x91')]=function(_0x3730eb,_0x38ecec){var _0x5ed5c9=path['join'](config[_0x9c84('0x92')],_0x9c84('0x93'));var _0x12c270={'where':{'id':_0x3730eb['params']['id']},'attributes':['id',_0x9c84('0x88')],'raw':!![]};var _0x2a80b3=![];return require(_0x9c84('0x94'))[_0x9c84('0x95')]()[_0x9c84('0x19')](function(_0x6cba2a){if(_0x6cba2a){_0x2a80b3=_0x6cba2a[_0x9c84('0x96')];}})['then'](function(){return db[_0x9c84('0x5a')][_0x9c84('0x74')](_0x12c270);})[_0x9c84('0x19')](handleEntityNotFound(_0x38ecec,null))[_0x9c84('0x19')](function(_0x57662f){if(_0x57662f){if(!_[_0x9c84('0x97')](_0x57662f['sitepic'])){if(fs[_0x9c84('0x98')](path[_0x9c84('0x99')](config[_0x9c84('0x92')],_0x9c84('0x9a'),_0x57662f['sitepic']))&&_0x2a80b3){_0x5ed5c9=path[_0x9c84('0x99')](config[_0x9c84('0x92')],_0x9c84('0x9a'),_0x57662f['sitepic']);}}return _0x38ecec['download'](_0x5ed5c9);}})[_0x9c84('0x3d')](handleError(_0x38ecec,null));};exports[_0x9c84('0x9b')]=function(_0x58e807,_0x5767b2){var _0x5f03aa=path[_0x9c84('0x99')](config[_0x9c84('0x92')],'server/files/images/avatars/default_avatar.png');var _0x6182fb={'where':{'id':_0x58e807['params']['id']},'attributes':['id',_0x9c84('0x8c')],'raw':!![]};return db[_0x9c84('0x5a')]['find'](_0x6182fb)[_0x9c84('0x19')](handleEntityNotFound(_0x5767b2,null))[_0x9c84('0x19')](function(_0x35a33b){if(_0x35a33b){if(!_[_0x9c84('0x97')](_0x35a33b['agentAvatar'])){if(fs[_0x9c84('0x98')](path['join'](config[_0x9c84('0x92')],_0x9c84('0x9c'),_0x35a33b['agentAvatar']))){_0x5f03aa=path['join'](config[_0x9c84('0x92')],_0x9c84('0x9c'),_0x35a33b[_0x9c84('0x8c')]);}}return _0x5767b2[_0x9c84('0x9d')](_0x5f03aa);}})['catch'](handleError(_0x5767b2,null));};exports[_0x9c84('0x9e')]=function(_0x4fe724,_0x3a55a3){var _0x36b445=path['join'](config[_0x9c84('0x92')],_0x9c84('0x9f'));var _0x505d68={'where':{'id':_0x4fe724[_0x9c84('0x6e')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x9c84('0x5a')]['find'](_0x505d68)['then'](handleEntityNotFound(_0x3a55a3,null))[_0x9c84('0x19')](function(_0x2e81dc){if(_0x2e81dc){if(!_['isNil'](_0x2e81dc['customerAvatar'])){if(fs[_0x9c84('0x98')](path['join'](config['root'],_0x9c84('0x9c'),_0x2e81dc[_0x9c84('0x8e')]))&&_0x2e81dc[_0x9c84('0xa0')]){_0x36b445=path[_0x9c84('0x99')](config['root'],_0x9c84('0x9c'),_0x2e81dc[_0x9c84('0x8e')]);}}return _0x3a55a3[_0x9c84('0x9d')](_0x36b445);}})[_0x9c84('0x3d')](handleError(_0x3a55a3,null));};exports['getSystemAvatar']=function(_0x313397,_0x560f61){var _0x30a842=path['join'](config[_0x9c84('0x92')],_0x9c84('0xa1'));var _0x3943c8={'where':{'id':_0x313397['params']['id']},'attributes':['id',_0x9c84('0x90')],'raw':!![]};return db['ChatWebsite'][_0x9c84('0x74')](_0x3943c8)[_0x9c84('0x19')](handleEntityNotFound(_0x560f61,null))['then'](function(_0x27e8ca){if(_0x27e8ca){if(!_[_0x9c84('0x97')](_0x27e8ca[_0x9c84('0x90')])){if(fs[_0x9c84('0x98')](path[_0x9c84('0x99')](config[_0x9c84('0x92')],'server/files/images/avatars/',_0x27e8ca['systemAvatar']))){_0x30a842=path[_0x9c84('0x99')](config[_0x9c84('0x92')],_0x9c84('0x9c'),_0x27e8ca[_0x9c84('0x90')]);}}return _0x560f61[_0x9c84('0x9d')](_0x30a842);}})[_0x9c84('0x3d')](handleError(_0x560f61,null));};exports[_0x9c84('0xa2')]=function(_0x14b90a,_0x5da8d2){var _0x334d6a={'body':_0x14b90a[_0x9c84('0x76')],'channel':_0x9c84('0xa3')};var _0xe00d70=[];var _0x241c26=[];var _0xaba40b={};var _0x194b6b=![];return db[_0x9c84('0xa4')][_0x9c84('0x7c')]()['then'](function(_0x3685f6){if(!_0x3685f6){throw new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))]('no\x20available\x20attributes');}_0xe00d70=_['difference'](_[_0x9c84('0x70')](_0x3685f6),[_0x9c84('0xa7'),_0x9c84('0xa8')]);_0x241c26=_[_0x9c84('0xa9')](_[_0x9c84('0x70')](_0x3685f6),[_0x9c84('0xa7'),_0x9c84('0xa8'),_0x9c84('0xaa'),_0x9c84('0xab')]);if(_0x14b90a[_0x9c84('0x76')]['id']){delete _0x14b90a[_0x9c84('0x76')]['id'];}if(_['isNil'](_0x14b90a[_0x9c84('0x76')][_0x9c84('0xac')])){throw new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))]('from\x20is\x20mandatory');}if(_[_0x9c84('0x97')](_0x14b90a[_0x9c84('0x76')][_0x9c84('0x76')])||_0x14b90a[_0x9c84('0x76')][_0x9c84('0x76')]===''){throw new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9c84('0x97')](_0x14b90a[_0x9c84('0x76')]['mapKey'])){throw new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x241c26);}if(!_[_0x9c84('0xad')](_0x241c26,_0x14b90a['body'][_0x9c84('0xae')])){throw new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))](_0x9c84('0xaf')+_0x241c26);}_0xaba40b[_0x14b90a[_0x9c84('0x76')][_0x9c84('0xae')]]=_0x14b90a[_0x9c84('0x76')][_0x9c84('0xac')];})[_0x9c84('0x19')](function(){return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x14b90a[_0x9c84('0x6e')]['id']},'include':[{'model':db[_0x9c84('0xb0')],'as':_0x9c84('0xb1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0xaba40b,'limit':0x1,'order':[[_0x9c84('0xa8'),'DESC']]}]},{'model':db[_0x9c84('0xb2')],'as':_0x9c84('0xb3')},{'model':db['Interval'],'as':_0x9c84('0xb4'),'include':[{'model':db['Interval'],'as':_0x9c84('0xb5'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x9c84('0x19')](function(_0x3e46e){if(!_0x3e46e)throw new APINotFoundError(util[_0x9c84('0x51')](_0x9c84('0xb6'),_0x14b90a[_0x9c84('0x6e')]['id']));if(!_0x3e46e[_0x9c84('0xb4')]||!_0x3e46e[_0x9c84('0xb4')][_0x9c84('0xb5')])return[_0x3e46e,!![]];return[_0x3e46e,checkWebsiteIntervals(_0x3e46e)];})[_0x9c84('0xb7')](function(_0x4a30e2,_0x480be0){if(!_0x480be0)throw new APIOutOfIntervalError();if(!_0x4a30e2[_0x9c84('0xb1')])return;_0x334d6a[_0x9c84('0xb8')]=_0x4a30e2;_0x334d6a[_0x9c84('0xb9')]=_0x4a30e2[_0x9c84('0xb1')];_0x334d6a[_0x9c84('0xba')]=_[_0x9c84('0xbb')](_0x4a30e2[_0x9c84('0xb3')],['priority'],[_0x9c84('0xbc')]);if(_0x334d6a[_0x9c84('0xb8')][_0x9c84('0xb3')]){delete _0x334d6a[_0x9c84('0xb8')][_0x9c84('0xb3')];}if(_0x334d6a['account'][_0x9c84('0xb1')]&&_0x334d6a[_0x9c84('0xb8')][_0x9c84('0xb1')][_0x9c84('0xbd')][_0x9c84('0x71')]){return _0x334d6a[_0x9c84('0xb8')][_0x9c84('0xb1')][_0x9c84('0xbd')][0x0];}var _0x3b41f5=_['defaults'](_0x14b90a[_0x9c84('0x76')],{'firstName':_0x14b90a[_0x9c84('0x76')][_0x9c84('0xac')],'ListId':_0x4a30e2[_0x9c84('0xab')]});_0x3b41f5[_0x14b90a[_0x9c84('0x76')]['mapKey']]=_0x14b90a['body'][_0x9c84('0xac')];return db[_0x9c84('0xa4')][_0x9c84('0x75')](_0x3b41f5,{'fields':_0xe00d70,'raw':!![]});})[_0x9c84('0x19')](function(_0x40985e){_0x334d6a[_0x9c84('0xbe')]=_0x40985e;var _0x30b6fd=createInteractionObject(_0x14b90a[_0x9c84('0x6e')]['id'],_0x14b90a[_0x9c84('0x76')],_0x14b90a[_0x9c84('0xbf')],_0x40985e);var _0x3f4ac9={'ChatWebsiteId':_0x14b90a['params']['id'],'closed':![]};if(_0x14b90a[_0x9c84('0x76')][_0x9c84('0xc0')]){_0x3f4ac9[_0x9c84('0xc0')]=_0x14b90a[_0x9c84('0x76')][_0x9c84('0xc0')];return db[_0x9c84('0xc1')][_0x9c84('0x74')]({'where':_0x3f4ac9})[_0x9c84('0x19')](function(_0x14b563){if(_0x14b563){_0x194b6b=!![];return _0x14b563;}_0x30b6fd[_0x9c84('0xc0')]=_0x14b90a[_0x9c84('0x76')][_0x9c84('0xc0')];_0x30b6fd[_0x9c84('0xc2')]=_0x14b90a[_0x9c84('0x76')][_0x9c84('0xc2')];return db[_0x9c84('0xc1')][_0x9c84('0x75')](_0x30b6fd);});}_0x3f4ac9[_0x9c84('0xc3')]=_0x40985e['id'];if(_0x14b90a['body'][_0x9c84('0xc4')]&&_0x14b90a['body'][_0x9c84('0xc4')]['id']){_0x3f4ac9['id']=_0x14b90a[_0x9c84('0x76')][_0x9c84('0xc4')]['id'];return db[_0x9c84('0xc1')][_0x9c84('0x74')]({'where':_0x3f4ac9})['then'](function(_0x4044a8){if(_0x4044a8){_0x194b6b=!![];return _0x4044a8;}return db[_0x9c84('0xc1')][_0x9c84('0x75')](_0x30b6fd);});}return db[_0x9c84('0xc1')]['create'](_0x30b6fd);})[_0x9c84('0x19')](function(_0x387e90){if(!_0x194b6b)return _0x387e90;var _0x28add9={'from':(_0x334d6a['contact']['firstName']||'')+'\x20'+(_0x334d6a[_0x9c84('0xbe')][_0x9c84('0x4b')]||'')};if(_0x14b90a[_0x9c84('0x76')][_0x9c84('0xc0')]&&_0x14b90a[_0x9c84('0x76')]['messageId']&&_0x14b90a[_0x9c84('0x76')]['threadId']!=_0x14b90a[_0x9c84('0x76')][_0x9c84('0xc5')]){_0x28add9[_0x9c84('0xc0')]=_0x14b90a['body'][_0x9c84('0xc5')];}return _0x387e90[_0x9c84('0x2d')](_0x28add9);})[_0x9c84('0x19')](function(_0x4481da){_0x334d6a[_0x9c84('0xc4')]=_0x4481da[_0x9c84('0x40')]({'plain':!![]});_0x334d6a[_0x9c84('0xc4')][_0x9c84('0xc6')]=!_0x194b6b;if(_0x334d6a[_0x9c84('0xc4')][_0x9c84('0xc6')]){if(_0x334d6a[_0x9c84('0xb8')][_0x9c84('0xc7')]){_0x334d6a[_0x9c84('0xba')]['push']({'id':0x0,'priority':_0x334d6a[_0x9c84('0xba')]['length']+0x1,'app':_0x9c84('0xc8'),'appdata':_0x9c84('0xc9'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x14b90a[_0x9c84('0x76')][_0x9c84('0x76')],'ChatWebsiteId':_0x14b90a['params']['id'],'ChatInteractionId':_0x4481da['id'],'direction':'in','ContactId':_0x334d6a[_0x9c84('0xbe')]['id'],'AttachmentId':_0x14b90a[_0x9c84('0x76')]['AttachmentId']});})[_0x9c84('0x19')](function(_0xcd834a){_0x334d6a[_0x9c84('0x20')]=_0xcd834a;if(!_0x334d6a[_0x9c84('0xc4')][_0x9c84('0xca')]){return;}return db[_0x9c84('0xcb')][_0x9c84('0x74')]({'attributes':['id',_0x9c84('0x31')],'where':{'id':_0x334d6a[_0x9c84('0xc4')]['UserId']}});})[_0x9c84('0x19')](function(_0x398fd4){if(_0x398fd4){_0x334d6a[_0x9c84('0xba')][_0x9c84('0xcc')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x398fd4[_0x9c84('0x31')]+','+(_0x334d6a['account'][_0x9c84('0xcd')]||0xa),'interval':_0x9c84('0xce')});_0x334d6a[_0x9c84('0xcf')]=!![];}if(!_0x334d6a[_0x9c84('0xc4')][_0x9c84('0xd0')]){return;}return db[_0x9c84('0xd1')]['find']({'attributes':['id',_0x9c84('0x31')],'where':{'id':_0x334d6a['interaction'][_0x9c84('0xd0')]}});})[_0x9c84('0x19')](function(_0x4e7de9){if(_0x4e7de9){_0x334d6a[_0x9c84('0xba')][_0x9c84('0xcc')]({'id':0x0,'priority':0x1,'app':_0x9c84('0xd2'),'appdata':_0x4e7de9[_0x9c84('0x31')]+','+(_0x334d6a[_0x9c84('0xb8')]['waitForTheAssignedQueue']||0x12c),'interval':_0x9c84('0xce')});}return respondWithRpcPromise(_0x9c84('0xd3'),_0x9c84('0xd4'),_0x334d6a);})['then'](function(_0x2f084f){respondWithRpcPromise('EventManager',_0x9c84('0xd5'),{'event':'notify','message':_0x2f084f},client9002);return _0x2f084f;})[_0x9c84('0x19')](respondWithResult(_0x5da8d2,null))['catch'](APIHandleError(_0x5da8d2));};exports[_0x9c84('0xd6')]=function(_0x4c45e9,_0x341b99){var _0x1f4a04,_0x41daee,_0x51715c;var _0x515e04=[];var _0x47c4be={};var _0x5769b5=_0x4c45e9[_0x9c84('0xd7')]||[];var _0x2e9a0c=[];var _0x1d8d34;return db['CmContact'][_0x9c84('0x7c')]()[_0x9c84('0x19')](function(_0x5b61af){if(!_0x5b61af){throw new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))](_0x9c84('0xd8'));}_0x515e04=_[_0x9c84('0xa9')](_['keys'](_0x5b61af),['createdAt','updatedAt',_0x9c84('0xaa'),_0x9c84('0xab')]);if(_0x4c45e9[_0x9c84('0x76')]['id']){delete _0x4c45e9['body']['id'];}if(_[_0x9c84('0x97')](_0x4c45e9[_0x9c84('0x76')][_0x9c84('0xac')])){throw _0x341b99[_0x9c84('0x24')](0x1f4)[_0x9c84('0xd9')](new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))](_0x9c84('0xda')));}if(_[_0x9c84('0x97')](_0x4c45e9[_0x9c84('0x76')]['body'])||_0x4c45e9[_0x9c84('0x76')][_0x9c84('0x76')]===''){throw _0x341b99[_0x9c84('0x24')](0x1f4)['send'](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x9c84('0x97')](_0x4c45e9[_0x9c84('0x76')]['mapKeyOffline'])){throw _0x341b99[_0x9c84('0x24')](0x1f4)[_0x9c84('0xd9')](new db['Sequelize'][(_0x9c84('0xa6'))](_0x9c84('0xdb')+_0x515e04));}if(!_[_0x9c84('0xad')](_0x515e04,_0x4c45e9['body']['mapKeyOffline'])){throw _0x341b99[_0x9c84('0x24')](0x1f4)[_0x9c84('0xd9')](new db[(_0x9c84('0xa5'))][(_0x9c84('0xa6'))](_0x9c84('0xdc')+_0x515e04));}_0x47c4be[_0x4c45e9[_0x9c84('0x76')][_0x9c84('0xdd')]]=_0x4c45e9[_0x9c84('0x76')][_0x9c84('0xac')];})['then'](function(){return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x4c45e9['params']['id']},'include':[{'model':db['CmList'],'as':_0x9c84('0xb1')},{'model':db['MailAccount'],'as':_0x9c84('0xde')}]});})[_0x9c84('0x19')](handleEntityNotFound(_0x341b99,null))[_0x9c84('0x19')](function(_0x5e27bb){if(_0x5e27bb&&_0x5e27bb[_0x9c84('0xb1')]){_0x41daee=_0x5e27bb;var _0x53e2f4=_['defaults'](_0x4c45e9[_0x9c84('0x76')],{'firstName':_0x4c45e9['body'][_0x9c84('0xac')],'phone':_0x4c45e9[_0x9c84('0x76')][_0x9c84('0xac')],'ListId':_0x5e27bb[_0x9c84('0xab')]});_0x53e2f4[_0x4c45e9[_0x9c84('0x76')]['mapKeyOffline']]=_0x4c45e9[_0x9c84('0x76')][_0x9c84('0xac')];return db[_0x9c84('0xa4')]['findOrCreate']({'where':_0x47c4be,'defaults':_0x53e2f4});}})['spread'](function(_0x3acce5){if(_0x3acce5){_0x51715c=_0x3acce5;var _0x524e01=fs['readFileSync'](path[_0x9c84('0x99')](config[_0x9c84('0x92')],_0x9c84('0xdf')),'utf8');var _0x407f8a=ejs[_0x9c84('0xe0')](_0x524e01,{'body':_['toPairs'](_0x4c45e9[_0x9c84('0x76')][_0x9c84('0x76')]),'bodyTitle':_0x41daee['offlineMessageBody']});return db[_0x9c84('0xe1')][_0x9c84('0x75')]({'body':_0x407f8a,'plainBody':htmlToText['fromString'](_0x407f8a),'ContactId':_0x3acce5['id'],'ChatWebsiteId':_0x41daee['id']});}})['then'](function(_0x21e5f8){_0x1d8d34=_0x21e5f8;if(_0x5769b5[_0x9c84('0x71')]){var _0x32d367=_0x5769b5[_0x9c84('0x3f')](function(_0x4d0fdb){return{'name':_0x4d0fdb[_0x9c84('0xe2')],'basename':_0x4d0fdb[_0x9c84('0x8a')],'type':_0x4d0fdb[_0x9c84('0xe3')],'ChatOfflineMessageId':_0x21e5f8['id']};});_0x2e9a0c=_0x32d367[_0x9c84('0x3f')](_0x27c9a4=>{var _0xedee2a={'filename':_0x27c9a4[_0x9c84('0x31')],'path':path[_0x9c84('0x99')](config[_0x9c84('0x92')],'server',_0x9c84('0xd7'),'attachments',_0x9c84('0xe4'),_0x27c9a4['basename'])};return _0xedee2a;});if(!_0x41daee['openNewInteraction']){return db['sequelize'][_0x9c84('0xe5')](function(_0x5d4ad5){return db[_0x9c84('0xe6')][_0x9c84('0xe7')](_0x32d367,{'transaction':_0x5d4ad5});});}}})[_0x9c84('0x19')](function(){if(_0x1d8d34){_0x1f4a04=_0x1d8d34;return db[_0x9c84('0xde')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x9c84('0xe8')],'as':_0x9c84('0xe9'),'raw':!![],'include':[{'model':db[_0x9c84('0xea')],'as':_0x9c84('0xea'),'raw':!![]}]}]});}})[_0x9c84('0x19')](function(_0x195c19){if(_0x195c19&&_0x195c19[_0x9c84('0xe9')]&&_0x41daee['forwardOffline']&&_0x41daee[_0x9c84('0xeb')]){var _0x460789=_0x195c19[_0x9c84('0xec')]();return respondWithRpcPromise('SendMail',_0x9c84('0xed'),{'account':_0x460789,'message':{'from':util[_0x9c84('0x51')]('\x22%s\x22\x20<%s>',_0x195c19[_0x9c84('0x31')],_0x195c19['email']||_0x195c19[_0x9c84('0xe9')]['user']),'to':_0x41daee[_0x9c84('0xeb')],'subject':_0x41daee[_0x9c84('0xee')],'html':_0x1f4a04[_0x9c84('0x76')],'attachments':_0x2e9a0c}},client9003)['then'](function(){return _0x1f4a04;})[_0x9c84('0x3d')](function(_0x32f752){logger['error'](_0x32f752);});}})[_0x9c84('0x19')](function(){if(_0x41daee&&_0x41daee[_0x9c84('0xef')]&&_0x41daee[_0x9c84('0xf0')]){var _0x2fa929=[];if(_0x5769b5[_0x9c84('0x71')]){_0x2fa929=_0x5769b5[_0x9c84('0x3f')](function(_0x45b16d){return{'name':_0x45b16d[_0x9c84('0xe2')],'basename':_0x45b16d[_0x9c84('0x8a')],'type':_0x45b16d[_0x9c84('0xe3')],'ChatOfflineMessageId':_0x1d8d34['id']};});}var _0x186e75;if(!_[_0x9c84('0x97')](_0x41daee['subjectOffline'])){var _0x150b4b=_['map'](_0x4c45e9[_0x9c84('0x76')],function(_0x15b844){return _0x15b844;});var _0x92f855=_[_0x9c84('0xf1')](_0x150b4b)[0x0];var _0x28f529=_[_0x9c84('0xf2')](_0x92f855,function(_0x7973c0){return _0x7973c0;});_0x186e75=_0x28f529[0x1][_0x41daee[_0x9c84('0xf3')]];}var _0x1647ba={'from':_0x51715c['email'],'firstName':_0x51715c['firstName'],'lastName':_0x51715c['lastName'],'mapKey':'email','message':{'from':_0x51715c[_0x9c84('0xf4')],'to':_0x41daee['MailAccount'][_0x9c84('0xf4')],'cc':'','subject':_['isNil'](_0x186e75)?_0x41daee[_0x9c84('0xee')]:_0x186e75,'messageId':'','sentAt':new Date(),'attach':_0x2fa929['length'],'attachments':_0x2fa929,'originChannel':_0x9c84('0xf5'),'ChatWebsiteId':_0x41daee['id'],'ChatOfflineMessageId':_0x1f4a04['id'],'originTo':_0x41daee[_0x9c84('0xde')][_0x9c84('0xf4')]},'body':_0x1f4a04[_0x9c84('0x76')]};var _0x5db442={'account':{'id':_0x41daee[_0x9c84('0xf0')]},'body':_0x1647ba,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x9c84('0xf6'),_0x9c84('0xf7'),_0x5db442,client9001)[_0x9c84('0x19')](function(){return _0x1f4a04;})[_0x9c84('0x3d')](function(_0x2bec80){logger[_0x9c84('0x1e')](_0x2bec80);});}return;})[_0x9c84('0x19')](function(){if(_0x1f4a04){return _0x1f4a04;}})[_0x9c84('0x19')](respondWithResult(_0x341b99,null))['catch'](function(){for(var _0x597369 of _0x5769b5){var _0x187f4b=path[_0x9c84('0x99')](config[_0x9c84('0x92')],'server',_0x9c84('0xd7'),_0x9c84('0xf8'),'offline-chat',_0x597369[_0x9c84('0x8a')]);fs_extra[_0x9c84('0xf9')](_0x187f4b)[_0x9c84('0x3d')](function(_0x57d99d){logger['error'](_0x9c84('0xfa'),_0x187f4b,_0x57d99d);});}});};exports[_0x9c84('0xfb')]=function(_0x5988a7,_0x5f5686){return db['ChatInteraction']['find']({'where':{'id':_0x5988a7[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x5f5686,null))[_0x9c84('0x19')](function(_0x3f41e7){if(_0x3f41e7){return _0x3f41e7['addInteraction'](_0x5988a7['body']['ids'],_[_0x9c84('0xfc')](_0x5988a7[_0x9c84('0x76')],[_0x9c84('0x84'),'id'])||{});}})[_0x9c84('0x19')](respondWithResult(_0x5f5686,null))[_0x9c84('0x3d')](handleError(_0x5f5686,null));};exports[_0x9c84('0xfd')]=function(_0x338f34,_0xd3ea63){var _0x8b0a8b={'raw':![],'where':{}};var _0x43a2d5={};var _0x20bc75={'count':0x0,'rows':[]};return db[_0x9c84('0x5a')][_0x9c84('0x80')]({'where':{'id':_0x338f34['params']['id']}})['then'](handleEntityNotFound(_0xd3ea63,null))['then'](function(_0x287758){if(_0x287758){_0x43a2d5[_0x9c84('0x54')]=_[_0x9c84('0x70')](db[_0x9c84('0xc1')][_0x9c84('0x5b')]);_0x43a2d5[_0x9c84('0x5d')]=_[_0x9c84('0x70')](_0x338f34[_0x9c84('0x5d')]);_0x43a2d5[_0x9c84('0x66')]=_[_0x9c84('0x5e')](_0x43a2d5[_0x9c84('0x54')],_0x43a2d5['query']);_0x8b0a8b[_0x9c84('0x60')]=_['intersection'](_0x43a2d5[_0x9c84('0x54')],qs[_0x9c84('0x5f')](_0x338f34[_0x9c84('0x5d')][_0x9c84('0x5f')]));_0x8b0a8b[_0x9c84('0x60')]=_0x8b0a8b[_0x9c84('0x60')]['length']?_0x8b0a8b[_0x9c84('0x60')]:_0x43a2d5[_0x9c84('0x54')];if(!_0x338f34[_0x9c84('0x5d')][_0x9c84('0x61')]('nolimit')){_0x8b0a8b['limit']=qs[_0x9c84('0x2a')](_0x338f34[_0x9c84('0x5d')][_0x9c84('0x2a')]);_0x8b0a8b['offset']=qs['offset'](_0x338f34[_0x9c84('0x5d')][_0x9c84('0x29')]);}_0x8b0a8b['order']=qs[_0x9c84('0x64')](_0x338f34[_0x9c84('0x5d')][_0x9c84('0x64')]);_0x8b0a8b['where']=qs[_0x9c84('0x66')](_['pick'](_0x338f34[_0x9c84('0x5d')],_0x43a2d5['filters']));_0x8b0a8b['where']['ChatWebsiteId']=_0x287758['id'];if(_0x338f34['query']['filter']){_0x8b0a8b['where']=_['merge'](_0x8b0a8b['where'],{'$or':_[_0x9c84('0x3f')](_0x8b0a8b[_0x9c84('0x60')],function(_0x3d06ed){var _0x331743={};_0x331743[_0x3d06ed]={'$like':'%'+_0x338f34[_0x9c84('0x5d')][_0x9c84('0x6a')]+'%'};return _0x331743;})});}_0x8b0a8b=_['merge']({},_0x8b0a8b,_0x338f34[_0x9c84('0x6b')]);return db[_0x9c84('0xc1')][_0x9c84('0x28')]({'where':_0x8b0a8b[_0x9c84('0x65')]})[_0x9c84('0x19')](function(_0x5abc33){_0x20bc75['count']=_0x5abc33;if(_0x338f34[_0x9c84('0x5d')][_0x9c84('0x72')]){_0x8b0a8b[_0x9c84('0x73')]=[{'model':db[_0x9c84('0xa4')],'as':_0x9c84('0xfe'),'required':![]},{'model':db[_0x9c84('0xcb')],'as':'Owner','attributes':[_0x9c84('0x31'),_0x9c84('0xff'),_0x9c84('0x100')],'required':![]},{'model':db[_0x9c84('0x101')],'as':'Tags','attributes':['id',_0x9c84('0x31'),'color'],'where':_0x338f34[_0x9c84('0x5d')]['tag']?{'id':_0x338f34[_0x9c84('0x5d')]['tag']}:undefined,'required':_0x338f34[_0x9c84('0x5d')][_0x9c84('0x102')]?!![]:![]}];}return db[_0x9c84('0xc1')][_0x9c84('0x6c')](_0x8b0a8b);})[_0x9c84('0x19')](function(_0x363964){_0x20bc75[_0x9c84('0x82')]=_0x363964;return _0x20bc75;});}})[_0x9c84('0x19')](respondWithFilteredResult(_0xd3ea63,_0x8b0a8b))[_0x9c84('0x3d')](handleError(_0xd3ea63,null));};exports['getSnippet']=function(_0x2e7173,_0x36de8c){var _0x53f7c9=0x0;var _0x1c54ec=0x0;var _0x2cd9a7=![];var _0x432362;var _0x3d9bb1;return db['ChatWebsite']['find']({'where':{'id':_0x2e7173[_0x9c84('0x6e')]['id']},'include':[{'model':db['Interval'],'as':_0x9c84('0xb4'),'include':[{'model':db['Interval'],'as':_0x9c84('0xb5'),'attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x36de8c,null))[_0x9c84('0x19')](function(_0x483d04){if(_0x483d04){_0x432362=_0x483d04;return _0x483d04[_0x9c84('0x103')]({'raw':!![]});}})[_0x9c84('0x19')](function(_0x5e7926){if(_0x432362){if(_0x5e7926){_0x3d9bb1=_0x5e7926;}}return require(_0x9c84('0x94'))[_0x9c84('0x95')]();})[_0x9c84('0x19')](function(_0x5b3e14){if(_0x5b3e14){_0x1c54ec=_0x5b3e14[_0x9c84('0x104')];_0x2cd9a7=_0x5b3e14[_0x9c84('0x96')];}})['then'](function(){return db[_0x9c84('0xc1')][_0x9c84('0x28')]({'where':{'closed':![]}});})[_0x9c84('0x19')](function(_0x47ed45){_0x53f7c9=_0x47ed45;if(_0x1c54ec&&_0x47ed45>_0x1c54ec){return db['License']['findOne']({'where':{'id':0x1}})[_0x9c84('0x19')](function(_0x1b3bb0){if(_0x1b3bb0){_0x1b3bb0[_0x9c84('0x105')](_0x9c84('0x106'));}});}})[_0x9c84('0x19')](function(){if(!_0x432362['Interval']||!_0x432362[_0x9c84('0xb4')][_0x9c84('0xb5')])return!![];return checkWebsiteIntervals(_0x432362);})[_0x9c84('0x19')](function(_0x3c6981){var _0x126e2d=fs[_0x9c84('0x107')](path['join'](config[_0x9c84('0x92')],_0x9c84('0x108')),_0x9c84('0x109'));var _0x5efa3b=new url[(_0x9c84('0x10a'))](_0x432362['address'])[_0x9c84('0x10b')];var _0x10373a=_0x9c84('0x10c');var _0x16da14=![];var _0x2f64bc={'chatVersion':_0x10373a,'chatWebsiteAddressOrigin':_0x5efa3b,'remote':_0x432362[_0x9c84('0x10d')],'query':querystring[_0x9c84('0x1d')](_[_0x9c84('0x68')](_0x432362[_0x9c84('0x40')]({'plain':!![]}),{'customerIp':_0x2e7173[_0x9c84('0xbf')][_0x9c84('0x47')]||_0x2e7173['headers']['x-real-ip']||_0x2e7173['connection']['remoteAddress']||_0x2e7173['ip'],'referer':_0x2e7173[_0x9c84('0xbf')][_0x9c84('0x4d')],'openedInteractions':_0x53f7c9,'maxInteractions':_0x1c54ec,'virtual':_0x2cd9a7[_0x9c84('0x104')],'online':_0x3c6981,'custom':_0x2cd9a7}))[_0x9c84('0x10e')](/'/g,'\x5c\x27')};_0x36de8c[_0x9c84('0xd9')](ejs[_0x9c84('0xe0')](Mustache[_0x9c84('0xe0')](_0x126e2d,_0x2f64bc),{'proactiveActions':_0x3d9bb1,'alignment':_0x432362['alignment'],'verticalAlignment':_0x432362['verticalAlignment'],'div_color':_0x432362['color'],'labelText':_0x432362['labelText'],'text_color':_0x432362[_0x9c84('0x10f')],'text_button_color':_0x432362[_0x9c84('0x110')],'button_color':_0x432362[_0x9c84('0x111')],'background_color':_0x432362[_0x9c84('0x112')],'hideWhenOffline':_0x432362[_0x9c84('0x113')],'intervalId':_0x432362[_0x9c84('0x114')],'isDevelopment':_0x16da14,'chatVersion':_0x10373a}));})['catch'](handleError(_0x36de8c,null));};exports[_0x9c84('0x115')]=function(_0xba686c,_0x5916e8){var _0x39b7b6=_0xba686c['params']['id'];var _0x53f74c=_0xba686c['body'];var _0x399cce=0xc8;var _0x1d1a25=null;return db[_0x9c84('0x116')][_0x9c84('0xe5')]({'isolationLevel':db[_0x9c84('0x116')][_0x9c84('0x117')]['ISOLATION_LEVELS'][_0x9c84('0x118')]},function(_0x255a52){return db['ChatWebsite'][_0x9c84('0x80')]({'where':{'id':_0x39b7b6},'transaction':_0x255a52})[_0x9c84('0x19')](function(_0x1547db){if(_0x1547db){return db['ChatApplication'][_0x9c84('0x2e')]({'where':{'ChatWebsiteId':_0x39b7b6},'transaction':_0x255a52})[_0x9c84('0x19')](function(){var _0x2f4ffe=_[_0x9c84('0x3f')](_0x53f74c,function(_0x66a581){_0x66a581[_0x9c84('0x7e')]=_0x39b7b6;return _0x66a581;});return db['ChatApplication'][_0x9c84('0xe7')](_0x2f4ffe,{'transaction':_0x255a52});});}else{_0x399cce=0x194;_0x1d1a25=[];}});})[_0x9c84('0x19')](function(){if(_0x399cce!==0x194){return db[_0x9c84('0xb2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x39b7b6},'order':_0x9c84('0x119')})[_0x9c84('0x19')](function(_0x2bfe7c){_0x1d1a25=_0x2bfe7c;});}})[_0x9c84('0x3d')](function(_0x216f3d){_0x399cce=0x1f4;logger[_0x9c84('0x1e')](_0x216f3d[_0x9c84('0x11a')]);if(_0x216f3d['name']){delete _0x216f3d[_0x9c84('0x31')];}_0x1d1a25=_0x216f3d;})[_0x9c84('0x11b')](function(){if(_0x1d1a25===null){_0x5916e8['sendStatus'](_0x399cce);}else{if(_0x399cce===0x1f4){_0x5916e8['status'](_0x399cce)[_0x9c84('0xd9')](_0x1d1a25);}else{_0x5916e8[_0x9c84('0x24')](_0x399cce)[_0x9c84('0x26')](_0x1d1a25);}}});};exports[_0x9c84('0x11c')]=function(_0xcc6b04,_0x4d8f67){var _0x56e92a={};var _0x9e8dc2={};var _0x4dfac3;var _0x6c6aa2;return db['ChatWebsite']['findOne']({'where':{'id':_0xcc6b04['params']['id']}})['then'](handleEntityNotFound(_0x4d8f67,null))[_0x9c84('0x19')](function(_0x242029){if(_0x242029){_0x4dfac3=_0x242029;_0x9e8dc2[_0x9c84('0x54')]=_['keys'](db['ChatApplication'][_0x9c84('0x5b')]);_0x9e8dc2[_0x9c84('0x5d')]=_[_0x9c84('0x70')](_0xcc6b04[_0x9c84('0x5d')]);_0x9e8dc2[_0x9c84('0x66')]=_['intersection'](_0x9e8dc2['model'],_0x9e8dc2[_0x9c84('0x5d')]);_0x56e92a[_0x9c84('0x60')]=_[_0x9c84('0x5e')](_0x9e8dc2['model'],qs[_0x9c84('0x5f')](_0xcc6b04[_0x9c84('0x5d')]['fields']));_0x56e92a['attributes']=_0x56e92a[_0x9c84('0x60')][_0x9c84('0x71')]?_0x56e92a['attributes']:_0x9e8dc2[_0x9c84('0x54')];_0x56e92a[_0x9c84('0x63')]=qs[_0x9c84('0x64')](_0xcc6b04[_0x9c84('0x5d')][_0x9c84('0x64')]);_0x56e92a['where']=qs[_0x9c84('0x66')](_[_0x9c84('0x67')](_0xcc6b04['query'],_0x9e8dc2[_0x9c84('0x66')]));if(_0xcc6b04['query']['filter']){_0x56e92a[_0x9c84('0x65')]=_[_0x9c84('0x68')](_0x56e92a[_0x9c84('0x65')],{'$or':_[_0x9c84('0x3f')](_0x56e92a['attributes'],function(_0x3ff3c7){var _0x2dcf19={};_0x2dcf19[_0x3ff3c7]={'$like':'%'+_0xcc6b04[_0x9c84('0x5d')][_0x9c84('0x6a')]+'%'};return _0x2dcf19;})});}_0x56e92a=_['merge']({},_0x56e92a,_0xcc6b04[_0x9c84('0x6b')]);return _0x4dfac3[_0x9c84('0x11c')](_0x56e92a);}})[_0x9c84('0x19')](function(_0x16ae7d){if(_0x16ae7d){_0x6c6aa2=_0x16ae7d['length'];if(!_0xcc6b04[_0x9c84('0x5d')]['hasOwnProperty'](_0x9c84('0x62'))){_0x56e92a['limit']=qs[_0x9c84('0x2a')](_0xcc6b04[_0x9c84('0x5d')][_0x9c84('0x2a')]);_0x56e92a[_0x9c84('0x29')]=qs['offset'](_0xcc6b04[_0x9c84('0x5d')][_0x9c84('0x29')]);}return _0x4dfac3[_0x9c84('0x11c')](_0x56e92a);}})[_0x9c84('0x19')](function(_0x896558){if(_0x896558){return _0x896558?{'count':_0x6c6aa2,'rows':_0x896558}:null;}})[_0x9c84('0x19')](respondWithResult(_0x4d8f67,null))['catch'](handleError(_0x4d8f67,null));};exports[_0x9c84('0x11d')]=function(_0x1746a0,_0xe3b21e){return db[_0x9c84('0x11e')][_0x9c84('0x74')]({'where':{'id':_0x1746a0['params']['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0xe3b21e,null))['then'](function(_0x2c7d47){if(_0x2c7d47){return _0x2c7d47[_0x9c84('0x11d')](_0x1746a0[_0x9c84('0x76')][_0x9c84('0x84')],_['omit'](_0x1746a0[_0x9c84('0x76')],[_0x9c84('0x84'),'id'])||{});}})[_0x9c84('0x19')](respondWithResult(_0xe3b21e,null))[_0x9c84('0x3d')](handleError(_0xe3b21e,null));};exports[_0x9c84('0x103')]=function(_0x42c9cf,_0xbecb7c){var _0x4291a0={};var _0x544f73={};var _0x3e261c;var _0x2c7f2e;return db[_0x9c84('0x5a')]['findOne']({'where':{'id':_0x42c9cf[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0xbecb7c,null))[_0x9c84('0x19')](function(_0x226252){if(_0x226252){_0x3e261c=_0x226252;_0x544f73[_0x9c84('0x54')]=_[_0x9c84('0x70')](db[_0x9c84('0x11f')][_0x9c84('0x5b')]);_0x544f73['query']=_[_0x9c84('0x70')](_0x42c9cf[_0x9c84('0x5d')]);_0x544f73['filters']=_[_0x9c84('0x5e')](_0x544f73[_0x9c84('0x54')],_0x544f73[_0x9c84('0x5d')]);_0x4291a0['attributes']=_[_0x9c84('0x5e')](_0x544f73[_0x9c84('0x54')],qs['fields'](_0x42c9cf[_0x9c84('0x5d')][_0x9c84('0x5f')]));_0x4291a0['attributes']=_0x4291a0[_0x9c84('0x60')][_0x9c84('0x71')]?_0x4291a0[_0x9c84('0x60')]:_0x544f73[_0x9c84('0x54')];_0x4291a0[_0x9c84('0x63')]=qs[_0x9c84('0x64')](_0x42c9cf[_0x9c84('0x5d')][_0x9c84('0x64')]);_0x4291a0[_0x9c84('0x65')]=qs['filters'](_[_0x9c84('0x67')](_0x42c9cf['query'],_0x544f73[_0x9c84('0x66')]));if(_0x42c9cf[_0x9c84('0x5d')][_0x9c84('0x6a')]){_0x4291a0[_0x9c84('0x65')]=_[_0x9c84('0x68')](_0x4291a0[_0x9c84('0x65')],{'$or':_['map'](_0x4291a0[_0x9c84('0x60')],function(_0x2de401){var _0x1d215f={};_0x1d215f[_0x2de401]={'$like':'%'+_0x42c9cf[_0x9c84('0x5d')][_0x9c84('0x6a')]+'%'};return _0x1d215f;})});}_0x4291a0=_[_0x9c84('0x68')]({},_0x4291a0,_0x42c9cf['options']);return _0x3e261c[_0x9c84('0x103')](_0x4291a0);}})['then'](function(_0x2638b2){if(_0x2638b2){_0x2c7f2e=_0x2638b2[_0x9c84('0x71')];if(!_0x42c9cf[_0x9c84('0x5d')][_0x9c84('0x61')](_0x9c84('0x62'))){_0x4291a0[_0x9c84('0x2a')]=qs[_0x9c84('0x2a')](_0x42c9cf[_0x9c84('0x5d')][_0x9c84('0x2a')]);_0x4291a0[_0x9c84('0x29')]=qs[_0x9c84('0x29')](_0x42c9cf[_0x9c84('0x5d')][_0x9c84('0x29')]);}return _0x3e261c['getProactiveActions'](_0x4291a0);}})[_0x9c84('0x19')](function(_0x3e7795){if(_0x3e7795){return _0x3e7795?{'count':_0x2c7f2e,'rows':_0x3e7795}:null;}})[_0x9c84('0x19')](respondWithResult(_0xbecb7c,null))[_0x9c84('0x3d')](handleError(_0xbecb7c,null));};exports[_0x9c84('0x120')]=function(_0x16bd60,_0x5b134f){var _0x608617=_0x16bd60[_0x9c84('0x5d')][_0x9c84('0x121')]==='false'?'offlineForm':_0x9c84('0x122');return db['ChatWebsite']['find']({'attributes':['id',_0x608617],'where':{'id':_0x16bd60['params']['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x5b134f,null))['then'](function(_0x3448cf){if(_0x3448cf){var _0x5cb576=_0x3448cf[_0x608617];var _0x4132d4=_0x5cb576&&_0x5cb576[_0x9c84('0x123')]?_0x5cb576[_0x9c84('0x123')]:[];_0x5b134f[_0x9c84('0xd9')]({'fromKey':_[_0x9c84('0x97')](_0x5cb576[_0x9c84('0x124')])?undefined:_0x5cb576[_0x9c84('0x124')],'count':_0x4132d4[_0x9c84('0x71')],'rows':_0x4132d4});}})[_0x9c84('0x3d')](handleError(_0x5b134f,null));};exports[_0x9c84('0x125')]=function(_0x4c4da0,_0x254bcd){var _0x5df443={'raw':![],'where':{}};var _0x1d4cc7={};var _0x2e3045={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x4c4da0[_0x9c84('0x6e')]['id']}})['then'](handleEntityNotFound(_0x254bcd,null))[_0x9c84('0x19')](function(_0x389de6){if(_0x389de6){_0x1d4cc7[_0x9c84('0x54')]=_[_0x9c84('0x70')](db[_0x9c84('0xe1')][_0x9c84('0x5b')]);_0x1d4cc7[_0x9c84('0x5d')]=_[_0x9c84('0x70')](_0x4c4da0[_0x9c84('0x5d')]);_0x1d4cc7['filters']=_[_0x9c84('0x5e')](_0x1d4cc7[_0x9c84('0x54')],_0x1d4cc7[_0x9c84('0x5d')]);_0x5df443[_0x9c84('0x60')]=_['intersection'](_0x1d4cc7[_0x9c84('0x54')],qs[_0x9c84('0x5f')](_0x4c4da0[_0x9c84('0x5d')]['fields']));_0x5df443['attributes']=_0x5df443[_0x9c84('0x60')]['length']?_0x5df443[_0x9c84('0x60')]:_0x1d4cc7[_0x9c84('0x54')];if(!_0x4c4da0[_0x9c84('0x5d')]['hasOwnProperty'](_0x9c84('0x62'))){_0x5df443[_0x9c84('0x2a')]=qs[_0x9c84('0x2a')](_0x4c4da0['query'][_0x9c84('0x2a')]);_0x5df443[_0x9c84('0x29')]=qs[_0x9c84('0x29')](_0x4c4da0['query'][_0x9c84('0x29')]);}_0x5df443['order']=qs[_0x9c84('0x64')](_0x4c4da0[_0x9c84('0x5d')][_0x9c84('0x64')]);_0x5df443['where']=qs[_0x9c84('0x66')](_[_0x9c84('0x67')](_0x4c4da0['query'],_0x1d4cc7[_0x9c84('0x66')]));_0x5df443[_0x9c84('0x65')][_0x9c84('0x7e')]=_0x389de6['id'];if(_0x4c4da0['query']['filter']){_0x5df443[_0x9c84('0x65')]=_['merge'](_0x5df443[_0x9c84('0x65')],{'$or':_[_0x9c84('0x3f')](_0x5df443['attributes'],function(_0x14456e){var _0x41c240={};_0x41c240[_0x14456e]={'$like':'%'+_0x4c4da0[_0x9c84('0x5d')][_0x9c84('0x6a')]+'%'};return _0x41c240;})});}_0x5df443=_['merge']({},_0x5df443,_0x4c4da0['options']);return db[_0x9c84('0xe1')][_0x9c84('0x28')]({'where':_0x5df443[_0x9c84('0x65')]})[_0x9c84('0x19')](function(_0x52ef66){_0x2e3045[_0x9c84('0x28')]=_0x52ef66;if(_0x4c4da0[_0x9c84('0x5d')]['includeAll']){_0x5df443['include']=[{'all':!![]}];}else{_0x5df443[_0x9c84('0x73')]=[{'model':db[_0x9c84('0xa4')],'as':_0x9c84('0xfe'),'required':![]},{'model':db['Attachment'],'as':_0x9c84('0x126'),'required':![]}];}return db[_0x9c84('0xe1')][_0x9c84('0x6c')](_0x5df443);})[_0x9c84('0x19')](function(_0x5c80c5){_0x2e3045[_0x9c84('0x82')]=_0x5c80c5;return _0x2e3045;});}})['then'](respondWithFilteredResult(_0x254bcd,_0x5df443))[_0x9c84('0x3d')](handleError(_0x254bcd,null));};exports[_0x9c84('0x127')]=function(_0x29c1d9,_0x2255ef){return db['ChatWebsite'][_0x9c84('0x74')]({'where':{'id':_0x29c1d9['params']['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x2255ef,null))['then'](function(_0x2a190f){if(_0x2a190f){return _0x2a190f[_0x9c84('0x127')](_0x29c1d9['body']['ids'],_[_0x9c84('0xfc')](_0x29c1d9[_0x9c84('0x76')],['ids','id'])||{})['spread'](function(_0x2f89f2){for(var _0x479eee=0x0;_0x479eee<_0x29c1d9['body']['ids'][_0x9c84('0x71')];_0x479eee+=0x1){socket[_0x9c84('0x128')]('userChatWebsite:save',{'UserId':Number(_0x29c1d9[_0x9c84('0x76')][_0x9c84('0x84')][_0x479eee]),'ChatWebsiteId':Number(_0x29c1d9[_0x9c84('0x6e')]['id'])});}return _0x2f89f2;});}})[_0x9c84('0x19')](respondWithResult(_0x2255ef,null))[_0x9c84('0x3d')](handleError(_0x2255ef,null));};exports['removeAgents']=function(_0x248449,_0x47cfe1){return db[_0x9c84('0x5a')][_0x9c84('0x74')]({'where':{'id':_0x248449[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x47cfe1,null))[_0x9c84('0x19')](function(_0x101ba4){if(_0x101ba4){return _0x101ba4[_0x9c84('0x129')](_0x248449[_0x9c84('0x5d')][_0x9c84('0x84')])[_0x9c84('0x19')](function(){if(_[_0x9c84('0x12a')](_0x248449[_0x9c84('0x5d')]['ids'])){for(var _0x533007=0x0;_0x533007<_0x248449[_0x9c84('0x5d')][_0x9c84('0x84')][_0x9c84('0x71')];_0x533007+=0x1){socket[_0x9c84('0x128')](_0x9c84('0x12b'),{'UserId':Number(_0x248449[_0x9c84('0x5d')][_0x9c84('0x84')][_0x533007]),'ChatWebsiteId':Number(_0x248449[_0x9c84('0x6e')]['id'])});}}else{socket[_0x9c84('0x128')]('userChatWebsite:remove',{'UserId':Number(_0x248449[_0x9c84('0x5d')]['ids']),'ChatWebsiteId':Number(_0x248449[_0x9c84('0x6e')]['id'])});}});}})['then'](respondWithStatusCode(_0x47cfe1,null))[_0x9c84('0x3d')](handleError(_0x47cfe1,null));};exports[_0x9c84('0x12c')]=function(_0x1057e5,_0x58faa6){var _0x4e4c46={};var _0x1c983d={};var _0x26fc6e;var _0x3b0e18;return db[_0x9c84('0x5a')]['findOne']({'where':{'id':_0x1057e5[_0x9c84('0x6e')]['id']}})[_0x9c84('0x19')](handleEntityNotFound(_0x58faa6,null))[_0x9c84('0x19')](function(_0x344b5a){if(_0x344b5a){_0x26fc6e=_0x344b5a;_0x1c983d[_0x9c84('0x54')]=_[_0x9c84('0x70')](db[_0x9c84('0xcb')][_0x9c84('0x5b')]);_0x1c983d['query']=_[_0x9c84('0x70')](_0x1057e5[_0x9c84('0x5d')]);_0x1c983d[_0x9c84('0x66')]=_['intersection'](_0x1c983d[_0x9c84('0x54')],_0x1c983d[_0x9c84('0x5d')]);_0x4e4c46['attributes']=_[_0x9c84('0x5e')](_0x1c983d['model'],qs[_0x9c84('0x5f')](_0x1057e5[_0x9c84('0x5d')][_0x9c84('0x5f')]));_0x4e4c46[_0x9c84('0x60')]=_0x4e4c46[_0x9c84('0x60')][_0x9c84('0x71')]?_0x4e4c46[_0x9c84('0x60')]:_0x1c983d[_0x9c84('0x54')];_0x4e4c46[_0x9c84('0x63')]=qs[_0x9c84('0x64')](_0x1057e5[_0x9c84('0x5d')]['sort']);_0x4e4c46['where']=qs[_0x9c84('0x66')](_[_0x9c84('0x67')](_0x1057e5[_0x9c84('0x5d')],_0x1c983d[_0x9c84('0x66')]));if(_0x1057e5[_0x9c84('0x5d')][_0x9c84('0x6a')]){_0x4e4c46[_0x9c84('0x65')]=_['merge'](_0x4e4c46[_0x9c84('0x65')],{'$or':_[_0x9c84('0x3f')](_0x4e4c46['attributes'],function(_0x3d9bea){var _0x1215ae={};_0x1215ae[_0x3d9bea]={'$like':'%'+_0x1057e5[_0x9c84('0x5d')][_0x9c84('0x6a')]+'%'};return _0x1215ae;})});}_0x4e4c46=_[_0x9c84('0x68')]({},_0x4e4c46,_0x1057e5[_0x9c84('0x6b')]);return _0x26fc6e['getAgents'](_0x4e4c46);}})[_0x9c84('0x19')](function(_0x3f0450){if(_0x3f0450){_0x3b0e18=_0x3f0450['length'];if(!_0x1057e5[_0x9c84('0x5d')][_0x9c84('0x61')](_0x9c84('0x62'))){_0x4e4c46[_0x9c84('0x2a')]=qs[_0x9c84('0x2a')](_0x1057e5[_0x9c84('0x5d')][_0x9c84('0x2a')]);_0x4e4c46[_0x9c84('0x29')]=qs[_0x9c84('0x29')](_0x1057e5[_0x9c84('0x5d')][_0x9c84('0x29')]);}return _0x26fc6e[_0x9c84('0x12c')](_0x4e4c46);}})[_0x9c84('0x19')](function(_0x54b0cf){if(_0x54b0cf){return _0x54b0cf?{'count':_0x3b0e18,'rows':_0x54b0cf}:null;}})[_0x9c84('0x19')](respondWithResult(_0x58faa6,null))['catch'](handleError(_0x58faa6,null));}; \ No newline at end of file +var _0x9487=['emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','lodash','querystring','html-to-text','ioredis','url','../../components/parsers/qs','../../config/logger','../../config/environment','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','undefined','count','limit','set','Content-Range','destroy','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','map','Interval','get','all','some','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','order','sort','removeDispositions','ids','getAnswers','CannedAnswer','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','root','download','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','defaults','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','Smtp','openNewInteraction','mimetype','mapValues','subjectOffline','email','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Contact','User','internal','Tag','Tags','color','tag','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','URL','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','json','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents'];(function(_0x5a1e0a,_0x84f951){var _0x369626=function(_0x70b9c5){while(--_0x70b9c5){_0x5a1e0a['push'](_0x5a1e0a['shift']());}};_0x369626(++_0x84f951);}(_0x9487,0x13c));var _0x7948=function(_0x5a1fba,_0x54bd31){_0x5a1fba=_0x5a1fba-0x0;var _0x5bfa4a=_0x9487[_0x5a1fba];return _0x5bfa4a;};'use strict';var Mustache=require(_0x7948('0x0'));var util=require(_0x7948('0x1'));var path=require('path');var ejs=require(_0x7948('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7948('0x3'));var querystring=require(_0x7948('0x4'));var htmlToText=require(_0x7948('0x5'));var Redis=require(_0x7948('0x6'));var jayson=require('jayson/promise');var url=require(_0x7948('0x7'));var qs=require(_0x7948('0x8'));var logger=require(_0x7948('0x9'))('api');var config=require(_0x7948('0xa'));var APIOutOfIntervalError=require('../../errors/api')[_0x7948('0xb')];var APINotFoundError=require(_0x7948('0xc'))[_0x7948('0xd')];var APIHandleError=require(_0x7948('0xc'))[_0x7948('0xe')];var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x7948('0xf')],{'host':_0x7948('0x10'),'port':0x18eb});var socket=require(_0x7948('0x11'))(new Redis(config['redis']));require(_0x7948('0x12'))[_0x7948('0x13')](socket);var client=jayson[_0x7948('0x14')]['http']({'port':0x232c});var client9002=jayson[_0x7948('0x14')][_0x7948('0x15')]({'port':0x232a});var client9003=jayson['client'][_0x7948('0x15')]({'port':0x232b});var client9001=jayson[_0x7948('0x14')][_0x7948('0x15')]({'port':0x2329});function respondWithRpcPromise(_0xe14f87,_0x1a8628,_0x315553,_0xbe9a42){return new Promise(function(_0x424137,_0x5cdbbb){var _0x49f25d=_0xbe9a42||client;return _0x49f25d['request'](_0xe14f87,_0x315553)[_0x7948('0x16')](function(_0x3cb4a9){logger[_0x7948('0x17')](_0x7948('0x18'),_0x1a8628,'request\x20sent');logger[_0x7948('0x19')](_0x7948('0x1a'),_0x1a8628,_0x7948('0x1b'),JSON[_0x7948('0x1c')](_0x3cb4a9));if(_0x3cb4a9[_0x7948('0x1d')]){if(_0x3cb4a9['error'][_0x7948('0x1e')]===0x1f4){logger[_0x7948('0x1d')](_0x7948('0x18'),_0x1a8628,_0x3cb4a9['error'][_0x7948('0x1f')]);return _0x5cdbbb(_0x3cb4a9[_0x7948('0x1d')]['message']);}logger[_0x7948('0x1d')](_0x7948('0x18'),_0x1a8628,_0x3cb4a9['error'][_0x7948('0x1f')]);return _0x424137(_0x3cb4a9[_0x7948('0x1d')][_0x7948('0x1f')]);}else{logger[_0x7948('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a8628,_0x7948('0x1b'));_0x424137(_0x3cb4a9[_0x7948('0x20')][_0x7948('0x1f')]);}})[_0x7948('0x21')](function(_0x587297){logger[_0x7948('0x1d')](_0x7948('0x18'),_0x1a8628,_0x587297);_0x5cdbbb(_0x587297);});});}function respondWithStatusCode(_0x366f97,_0x5058f7){_0x5058f7=_0x5058f7||0xcc;return function(_0x4700e3){if(_0x4700e3){return _0x366f97['sendStatus'](_0x5058f7);}return _0x366f97['status'](_0x5058f7)['end']();};}function respondWithResult(_0x1a8b27,_0x46c938){_0x46c938=_0x46c938||0xc8;return function(_0x14be04){if(_0x14be04){return _0x1a8b27[_0x7948('0x22')](_0x46c938)['json'](_0x14be04);}};}function respondWithFilteredResult(_0x3b267a,_0x4d8f1f){return function(_0x20cafb){if(_0x20cafb){var _0x497f35=typeof _0x4d8f1f[_0x7948('0x23')]===_0x7948('0x24')&&typeof _0x4d8f1f['limit']===_0x7948('0x24');var _0x56f8f4=_0x20cafb['count'];var _0xe59f51=_0x497f35?0x0:_0x4d8f1f[_0x7948('0x23')];var _0x10e4b1=_0x497f35?_0x20cafb[_0x7948('0x25')]:_0x4d8f1f[_0x7948('0x23')]+_0x4d8f1f[_0x7948('0x26')];var _0x3fc3d3;if(_0x10e4b1>=_0x56f8f4){_0x10e4b1=_0x56f8f4;_0x3fc3d3=0xc8;}else{_0x3fc3d3=0xce;}_0x3b267a['status'](_0x3fc3d3);return _0x3b267a[_0x7948('0x27')](_0x7948('0x28'),_0xe59f51+'-'+_0x10e4b1+'/'+_0x56f8f4)['json'](_0x20cafb);}return null;};}function saveUpdates(_0xe6c897){return function(_0x53c29d){if(_0x53c29d){return _0x53c29d['update'](_0xe6c897)[_0x7948('0x16')](function(_0x2efe39){return _0x2efe39;});}return null;};}function removeEntity(_0x476d9a){return function(_0x4f4792){if(_0x4f4792){return _0x4f4792[_0x7948('0x29')]()['then'](function(){var _0x4e9086=_0x4f4792['get']({'plain':!![]});var _0x48fdd6=_0x7948('0x2a');return db[_0x7948('0x2b')][_0x7948('0x29')]({'where':{'type':_0x48fdd6,'resourceId':_0x4e9086['id']}})[_0x7948('0x16')](function(){return _0x4f4792;});})['then'](function(){_0x476d9a[_0x7948('0x22')](0xcc)[_0x7948('0x2c')]();});}};}function handleEntityNotFound(_0xa154){return function(_0x3e7d2a){if(!_0x3e7d2a){_0xa154[_0x7948('0x2d')](0x194);}return _0x3e7d2a;};}function handleError(_0x7e8a98,_0x5634ee){_0x5634ee=_0x5634ee||0x1f4;return function(_0x443640){logger[_0x7948('0x1d')](_0x443640[_0x7948('0x2e')]);if(_0x443640[_0x7948('0x2f')]){delete _0x443640[_0x7948('0x2f')];}_0x7e8a98[_0x7948('0x22')](_0x5634ee)['send'](_0x443640);};}function iftimePromise(_0x48b9c8,_0x442388){return respondWithRpcPromise(_0x7948('0x30'),_0x7948('0x31'),{'command':_0x442388[_0x7948('0x32')]?util[_0x7948('0x33')](_0x7948('0x34'),_0x48b9c8['interval'],_0x442388[_0x7948('0x32')]):util['format']('iftime\x20%s',_0x48b9c8[_0x7948('0x35')])},client9002)['then'](function(_0x1d6d41){var _0x30fdc6=_0x1d6d41&&_0x1d6d41[_0x7948('0x36')](_0x7948('0x37'))>=0x0?!![]:![];logger[_0x7948('0x17')](_0x7948('0x38'),_0x442388['id'],_0x48b9c8['id'],_0x48b9c8[_0x7948('0x35')],_0x30fdc6?_0x7948('0x39'):'OFFLINE',_0x442388[_0x7948('0x32')]?_0x442388[_0x7948('0x32')]:_0x7948('0x3a'));return _0x30fdc6;})[_0x7948('0x21')](function(_0x44de44){logger[_0x7948('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x442388['id'],_0x48b9c8['id'],_0x48b9c8[_0x7948('0x35')],util['inspect'](_0x44de44,{'showHidden':![],'depth':null}),_0x442388['timezone']?_0x442388['timezone']:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0x37efef){var _0x43d199=_[_0x7948('0x3b')](_0x37efef[_0x7948('0x3c')]['Intervals'],function(_0x31b5a3){var _0x1476e7=_0x31b5a3[_0x7948('0x3d')]({'plain':!![]});return iftimePromise(_0x1476e7,_0x37efef);});return Promise[_0x7948('0x3e')](_0x43d199)[_0x7948('0x16')](function(_0x5b769d){return _[_0x7948('0x3f')](_0x5b769d);});}function createInteractionObject(_0x40b271,_0x8c098a,_0x200cda,_0x2a969f){var _0x51a5a0=require(_0x7948('0x40'));var _0x534273=new _0x51a5a0();var _0x51b46c=_0x534273[_0x7948('0x41')](_0x200cda[_0x7948('0x42')])['getResult']();var _0x526dca=_0x8c098a[_0x7948('0x43')];if(_0x200cda[_0x7948('0x44')]){_0x526dca=_0x200cda[_0x7948('0x44')];}else if(_0x200cda['x-forwarded-for']){_0x526dca=_[_0x7948('0x45')](_0x200cda[_0x7948('0x46')][_0x7948('0x47')](','));}return{'ContactId':_0x2a969f['id'],'ChatWebsiteId':_0x40b271,'from':(_0x2a969f[_0x7948('0x48')]||'')+'\x20'+(_0x2a969f[_0x7948('0x49')]||''),'customerIp':_0x526dca,'customerPort':_0x200cda[_0x7948('0x4a')]?_0x200cda['x-real-port']:null,'referer':_0x8c098a['referer'],'browserName':_0x51b46c['browser']['name']&&_0x51b46c[_0x7948('0x4b')][_0x7948('0x4c')]?util[_0x7948('0x33')](_0x7948('0x4d'),_0x51b46c[_0x7948('0x4b')][_0x7948('0x2f')],_0x51b46c['browser'][_0x7948('0x4c')]):_0x7948('0x4e'),'browserVersion':_0x51b46c['browser'][_0x7948('0x4c')]||_0x7948('0x4e'),'osName':util['format'](_0x7948('0x4d'),_0x51b46c['os'][_0x7948('0x2f')],_0x51b46c['os'][_0x7948('0x4c')]),'osVersion':_0x51b46c['os'][_0x7948('0x4c')],'deviceModel':_0x51b46c[_0x7948('0x4f')][_0x7948('0x50')]&&_0x51b46c[_0x7948('0x4f')][_0x7948('0x51')]?util[_0x7948('0x33')](_0x7948('0x52'),_0x51b46c['device'][_0x7948('0x50')],_0x51b46c[_0x7948('0x4f')][_0x7948('0x51')],_0x51b46c[_0x7948('0x4f')][_0x7948('0x53')]):null,'deviceVendor':_0x51b46c[_0x7948('0x4f')][_0x7948('0x51')],'deviceType':_0x51b46c[_0x7948('0x4f')][_0x7948('0x53')],'formData':JSON[_0x7948('0x1c')](_0x8c098a)};}exports[_0x7948('0x54')]=function(_0xfcf68d,_0xb195d1){var _0x349ac4={'include':[{'model':db['Pause'],'as':_0x7948('0x55')}]},_0x2a87af={},_0xe5d8f7={'count':0x0,'rows':[]};var _0x2cd8be=_[_0x7948('0x3b')](db[_0x7948('0x56')][_0x7948('0x57')],function(_0x55edb5){return{'name':_0x55edb5[_0x7948('0x58')],'type':_0x55edb5[_0x7948('0x53')][_0x7948('0x59')]};});_0x2a87af['model']=_['map'](_0x2cd8be,_0x7948('0x2f'));_0x2a87af['query']=_[_0x7948('0x5a')](_0xfcf68d[_0x7948('0x5b')]);_0x2a87af[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x2a87af[_0x7948('0x50')],_0x2a87af[_0x7948('0x5b')]);_0x349ac4[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x2a87af[_0x7948('0x50')],qs[_0x7948('0x5f')](_0xfcf68d[_0x7948('0x5b')][_0x7948('0x5f')]));_0x349ac4[_0x7948('0x5e')]=_0x349ac4['attributes'][_0x7948('0x60')]?_0x349ac4[_0x7948('0x5e')]:_0x2a87af['model'];if(!_0xfcf68d['query']['hasOwnProperty'](_0x7948('0x61'))){_0x349ac4[_0x7948('0x26')]=qs[_0x7948('0x26')](_0xfcf68d['query'][_0x7948('0x26')]);_0x349ac4[_0x7948('0x23')]=qs['offset'](_0xfcf68d[_0x7948('0x5b')][_0x7948('0x23')]);}_0x349ac4['order']=qs['sort'](_0xfcf68d[_0x7948('0x5b')]['sort']);_0x349ac4[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0xfcf68d[_0x7948('0x5b')],_0x2a87af[_0x7948('0x5c')]),_0x2cd8be);if(_0xfcf68d[_0x7948('0x5b')][_0x7948('0x64')]){_0x349ac4[_0x7948('0x62')]=_[_0x7948('0x65')](_0x349ac4[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x2cd8be,function(_0x2ef17b){if(_0x2ef17b['type']!==_0x7948('0x66')){var _0x53d091={};_0x53d091[_0x2ef17b[_0x7948('0x2f')]]={'$like':'%'+_0xfcf68d['query'][_0x7948('0x64')]+'%'};return _0x53d091;}})});}_0x349ac4=_['merge']({},_0x349ac4,_0xfcf68d[_0x7948('0x67')]);var _0x27b09b={'where':_0x349ac4[_0x7948('0x62')]};return db[_0x7948('0x56')][_0x7948('0x25')](_0x27b09b)['then'](function(_0x3093f6){_0xe5d8f7[_0x7948('0x25')]=_0x3093f6;if(_0xfcf68d[_0x7948('0x5b')][_0x7948('0x68')]){_0x349ac4[_0x7948('0x69')]=[{'all':!![]}];}return db[_0x7948('0x56')][_0x7948('0x6a')](_0x349ac4);})['then'](function(_0x2f61b1){_0xe5d8f7[_0x7948('0x6b')]=_0x2f61b1;return _0xe5d8f7;})[_0x7948('0x16')](respondWithFilteredResult(_0xb195d1,_0x349ac4))[_0x7948('0x21')](handleError(_0xb195d1,null));};exports[_0x7948('0x6c')]=function(_0x22ede8,_0x15680){var _0x3a04f3={'raw':![],'where':{'id':_0x22ede8[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0x6e')],'as':_0x7948('0x55')}]},_0x4a3b56={};_0x4a3b56['model']=_[_0x7948('0x5a')](db[_0x7948('0x56')][_0x7948('0x57')]);_0x4a3b56[_0x7948('0x5b')]=_['keys'](_0x22ede8[_0x7948('0x5b')]);_0x4a3b56['filters']=_[_0x7948('0x5d')](_0x4a3b56[_0x7948('0x50')],_0x4a3b56[_0x7948('0x5b')]);_0x3a04f3[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x4a3b56[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x22ede8[_0x7948('0x5b')][_0x7948('0x5f')]));_0x3a04f3[_0x7948('0x5e')]=_0x3a04f3['attributes'][_0x7948('0x60')]?_0x3a04f3[_0x7948('0x5e')]:_0x4a3b56[_0x7948('0x50')];if(_0x22ede8[_0x7948('0x5b')][_0x7948('0x68')]){_0x3a04f3[_0x7948('0x69')]=[{'all':!![]}];}_0x3a04f3=_[_0x7948('0x65')]({},_0x3a04f3,_0x22ede8[_0x7948('0x67')]);return db[_0x7948('0x56')][_0x7948('0x6f')](_0x3a04f3)[_0x7948('0x16')](handleEntityNotFound(_0x15680,null))[_0x7948('0x16')](respondWithResult(_0x15680,null))['catch'](handleError(_0x15680,null));};exports[_0x7948('0x70')]=function(_0x5ec4f9,_0xd50a6a){return db['ChatWebsite'][_0x7948('0x70')](_0x5ec4f9[_0x7948('0x71')],{})['then'](function(_0x15d14f){var _0x35bfdf=_0x5ec4f9['user'][_0x7948('0x3d')]({'plain':!![]});if(!_0x35bfdf)throw new Error(_0x7948('0x72'));if(_0x35bfdf[_0x7948('0x73')]===_0x7948('0x74')){var _0x186b1d=_0x15d14f[_0x7948('0x3d')]({'plain':!![]});var _0x4e36c0=_0x7948('0x2a');return db[_0x7948('0x75')]['find']({'where':{'name':_0x4e36c0,'userProfileId':_0x35bfdf[_0x7948('0x76')]},'raw':!![]})[_0x7948('0x16')](function(_0x45f2eb){if(_0x45f2eb&&_0x45f2eb[_0x7948('0x77')]===0x0){return db['UserProfileResource'][_0x7948('0x70')]({'name':_0x186b1d[_0x7948('0x2f')],'resourceId':_0x186b1d['id'],'type':_0x45f2eb['name'],'sectionId':_0x45f2eb['id']},{})[_0x7948('0x16')](function(){return _0x15d14f;});}else{return _0x15d14f;}})[_0x7948('0x21')](function(_0x52e0f3){logger['error'](_0x7948('0x78'),_0x52e0f3);throw _0x52e0f3;});}return _0x15d14f;})['then'](respondWithResult(_0xd50a6a,0xc9))[_0x7948('0x21')](handleError(_0xd50a6a,null));};exports[_0x7948('0x79')]=function(_0x535902,_0x372939){if(_0x535902['body']['id']){delete _0x535902['body']['id'];}return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x535902[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0x6e')],'as':_0x7948('0x55')}]})['then'](handleEntityNotFound(_0x372939,null))['then'](saveUpdates(_0x535902['body'],null))[_0x7948('0x16')](respondWithResult(_0x372939,null))[_0x7948('0x21')](handleError(_0x372939,null));};exports[_0x7948('0x29')]=function(_0x3748c3,_0x141dba){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x3748c3[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x141dba,null))[_0x7948('0x16')](removeEntity(_0x141dba,null))['catch'](handleError(_0x141dba,null));};exports[_0x7948('0x7a')]=function(_0xdfff7,_0x25db4e){return db[_0x7948('0x56')][_0x7948('0x7a')]()['then'](respondWithResult(_0x25db4e,null))[_0x7948('0x21')](handleError(_0x25db4e,null));};exports[_0x7948('0x7b')]=function(_0x21e6c9,_0x11a304){if(_0x21e6c9['body']['id']){delete _0x21e6c9['body']['id'];}return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x21e6c9[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x11a304,null))['then'](function(_0x1271d7){if(_0x1271d7){_0x21e6c9[_0x7948('0x71')][_0x7948('0x7c')]=_0x1271d7['id'];return db[_0x7948('0x7d')][_0x7948('0x70')](_0x21e6c9[_0x7948('0x71')]);}})[_0x7948('0x16')](respondWithResult(_0x11a304,null))[_0x7948('0x21')](handleError(_0x11a304,null));};exports[_0x7948('0x7e')]=function(_0x3cd2ae,_0x95216e){var _0x5f0385={'raw':![],'where':{}};var _0x270949={};var _0x4dcadf={'count':0x0,'rows':[]};return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x3cd2ae[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x95216e,null))[_0x7948('0x16')](function(_0x1a4689){if(_0x1a4689){_0x270949[_0x7948('0x50')]=_['keys'](db[_0x7948('0x7d')]['rawAttributes']);_0x270949['query']=_[_0x7948('0x5a')](_0x3cd2ae['query']);_0x270949[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x270949[_0x7948('0x50')],_0x270949[_0x7948('0x5b')]);_0x5f0385[_0x7948('0x5e')]=_['intersection'](_0x270949[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x3cd2ae[_0x7948('0x5b')]['fields']));_0x5f0385[_0x7948('0x5e')]=_0x5f0385[_0x7948('0x5e')][_0x7948('0x60')]?_0x5f0385[_0x7948('0x5e')]:_0x270949[_0x7948('0x50')];if(!_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x5f0385[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x26')]);_0x5f0385[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x23')]);}_0x5f0385[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x82')]);_0x5f0385['where']=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x3cd2ae['query'],_0x270949['filters']));_0x5f0385['where'][_0x7948('0x7c')]=_0x1a4689['id'];if(_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x64')]){_0x5f0385[_0x7948('0x62')]=_['merge'](_0x5f0385[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x5f0385[_0x7948('0x5e')],function(_0x33b80b){var _0x405e55={};_0x405e55[_0x33b80b]={'$like':'%'+_0x3cd2ae[_0x7948('0x5b')]['filter']+'%'};return _0x405e55;})});}_0x5f0385=_[_0x7948('0x65')]({},_0x5f0385,_0x3cd2ae[_0x7948('0x67')]);return db['Disposition'][_0x7948('0x25')]({'where':_0x5f0385['where']})['then'](function(_0x5733e4){_0x4dcadf[_0x7948('0x25')]=_0x5733e4;if(_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x68')]){_0x5f0385[_0x7948('0x69')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5f0385);})[_0x7948('0x16')](function(_0x4d8aac){_0x4dcadf[_0x7948('0x6b')]=_0x4d8aac;return _0x4dcadf;});}})[_0x7948('0x16')](respondWithFilteredResult(_0x95216e,_0x5f0385))[_0x7948('0x21')](handleError(_0x95216e,null));};exports['removeDispositions']=function(_0x3cbbd9,_0x2935ea){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x3cbbd9[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x2935ea,null))[_0x7948('0x16')](function(_0x3fb943){if(_0x3fb943){return _0x3fb943[_0x7948('0x83')](_0x3cbbd9[_0x7948('0x5b')][_0x7948('0x84')]);}})[_0x7948('0x16')](respondWithStatusCode(_0x2935ea,null))[_0x7948('0x21')](handleError(_0x2935ea,null));};exports['addAnswer']=function(_0x313fe1,_0x3f632f){if(_0x313fe1['body']['id']){delete _0x313fe1[_0x7948('0x71')]['id'];}return db[_0x7948('0x56')]['find']({'where':{'id':_0x313fe1[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x3f632f,null))['then'](function(_0xdfbbff){if(_0xdfbbff){_0x313fe1[_0x7948('0x71')][_0x7948('0x7c')]=_0xdfbbff['id'];return db['CannedAnswer'][_0x7948('0x70')](_0x313fe1[_0x7948('0x71')]);}})[_0x7948('0x16')](respondWithResult(_0x3f632f,null))[_0x7948('0x21')](handleError(_0x3f632f,null));};exports[_0x7948('0x85')]=function(_0x4340bc,_0x118e05){var _0x962ee7={'raw':![],'where':{}};var _0x37ccd8={};var _0x294a59={'count':0x0,'rows':[]};return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x4340bc[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x118e05,null))[_0x7948('0x16')](function(_0x5dfbbe){if(_0x5dfbbe){_0x37ccd8[_0x7948('0x50')]=_[_0x7948('0x5a')](db['CannedAnswer'][_0x7948('0x57')]);_0x37ccd8[_0x7948('0x5b')]=_[_0x7948('0x5a')](_0x4340bc[_0x7948('0x5b')]);_0x37ccd8[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x37ccd8[_0x7948('0x50')],_0x37ccd8[_0x7948('0x5b')]);_0x962ee7[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x37ccd8[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x4340bc['query'][_0x7948('0x5f')]));_0x962ee7[_0x7948('0x5e')]=_0x962ee7[_0x7948('0x5e')][_0x7948('0x60')]?_0x962ee7[_0x7948('0x5e')]:_0x37ccd8[_0x7948('0x50')];if(!_0x4340bc[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x962ee7[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x4340bc['query']['limit']);_0x962ee7[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x4340bc['query'][_0x7948('0x23')]);}_0x962ee7[_0x7948('0x81')]=qs['sort'](_0x4340bc['query'][_0x7948('0x82')]);_0x962ee7[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x4340bc['query'],_0x37ccd8[_0x7948('0x5c')]));_0x962ee7[_0x7948('0x62')][_0x7948('0x7c')]=_0x5dfbbe['id'];if(_0x4340bc[_0x7948('0x5b')][_0x7948('0x64')]){_0x962ee7[_0x7948('0x62')]=_[_0x7948('0x65')](_0x962ee7[_0x7948('0x62')],{'$or':_['map'](_0x962ee7[_0x7948('0x5e')],function(_0x477fdf){var _0x23a85b={};_0x23a85b[_0x477fdf]={'$like':'%'+_0x4340bc[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x23a85b;})});}_0x962ee7=_[_0x7948('0x65')]({},_0x962ee7,_0x4340bc[_0x7948('0x67')]);return db[_0x7948('0x86')][_0x7948('0x25')]({'where':_0x962ee7[_0x7948('0x62')]})[_0x7948('0x16')](function(_0x4c6392){_0x294a59[_0x7948('0x25')]=_0x4c6392;if(_0x4340bc[_0x7948('0x5b')]['includeAll']){_0x962ee7[_0x7948('0x69')]=[{'all':!![]}];}return db[_0x7948('0x86')]['findAll'](_0x962ee7);})['then'](function(_0x239640){_0x294a59[_0x7948('0x6b')]=_0x239640;return _0x294a59;});}})['then'](respondWithFilteredResult(_0x118e05,_0x962ee7))['catch'](handleError(_0x118e05,null));};exports['removeAnswers']=function(_0x2bc53c,_0xe86df9){return db[_0x7948('0x56')]['find']({'where':{'id':_0x2bc53c[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0xe86df9,null))[_0x7948('0x16')](function(_0x21728f){if(_0x21728f){return _0x21728f['removeAnswers'](_0x2bc53c['query'][_0x7948('0x84')]);}})[_0x7948('0x16')](respondWithStatusCode(_0xe86df9,null))[_0x7948('0x21')](handleError(_0xe86df9,null));};exports[_0x7948('0x87')]=function(_0x3be840,_0x441645){_0x3be840[_0x7948('0x71')][_0x7948('0x88')]=_0x3be840[_0x7948('0x89')][_0x7948('0x8a')];return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x3be840[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x441645,null))[_0x7948('0x16')](saveUpdates(_0x3be840[_0x7948('0x71')],null))[_0x7948('0x16')](respondWithResult(_0x441645,null))[_0x7948('0x21')](handleError(_0x441645,null));};exports[_0x7948('0x8b')]=function(_0x4925fb,_0x27ab0c){_0x4925fb[_0x7948('0x71')][_0x7948('0x8c')]=_0x4925fb[_0x7948('0x89')][_0x7948('0x8a')];return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x4925fb[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x27ab0c,null))[_0x7948('0x16')](saveUpdates(_0x4925fb[_0x7948('0x71')],null))[_0x7948('0x16')](respondWithResult(_0x27ab0c,null))[_0x7948('0x21')](handleError(_0x27ab0c,null));};exports['addCustomerAvatar']=function(_0x4ed5a1,_0x588bce){_0x4ed5a1[_0x7948('0x71')][_0x7948('0x8d')]=_0x4ed5a1[_0x7948('0x89')]['filename'];return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x4ed5a1[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x588bce,null))[_0x7948('0x16')](saveUpdates(_0x4ed5a1[_0x7948('0x71')],null))[_0x7948('0x16')](respondWithResult(_0x588bce,null))[_0x7948('0x21')](handleError(_0x588bce,null));};exports['addSystemAvatar']=function(_0x43f116,_0x389a47){_0x43f116['body'][_0x7948('0x8e')]=_0x43f116['file']['filename'];return db['ChatWebsite'][_0x7948('0x6f')]({'where':{'id':_0x43f116[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x389a47,null))['then'](saveUpdates(_0x43f116['body'],null))[_0x7948('0x16')](respondWithResult(_0x389a47,null))['catch'](handleError(_0x389a47,null));};exports['getLogo']=function(_0x302e68,_0x371b97){var _0x5f1ede=path[_0x7948('0x8f')](config['root'],_0x7948('0x90'));var _0x4658b2={'where':{'id':_0x302e68[_0x7948('0x6d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x21da48=![];return require(_0x7948('0x91'))[_0x7948('0x92')]()['then'](function(_0x51a8ad){if(_0x51a8ad){_0x21da48=_0x51a8ad['custom'];}})['then'](function(){return db[_0x7948('0x56')][_0x7948('0x6f')](_0x4658b2);})['then'](handleEntityNotFound(_0x371b97,null))['then'](function(_0x535cd2){if(_0x535cd2){if(!_['isNil'](_0x535cd2[_0x7948('0x88')])){if(fs['existsSync'](path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/logos/',_0x535cd2[_0x7948('0x88')]))&&_0x21da48){_0x5f1ede=path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/logos/',_0x535cd2[_0x7948('0x88')]);}}return _0x371b97[_0x7948('0x94')](_0x5f1ede);}})['catch'](handleError(_0x371b97,null));};exports['getAvatar']=function(_0x16d547,_0x14e945){var _0xd7120f=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x231ed4={'where':{'id':_0x16d547[_0x7948('0x6d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7948('0x56')][_0x7948('0x6f')](_0x231ed4)[_0x7948('0x16')](handleEntityNotFound(_0x14e945,null))['then'](function(_0x22efb0){if(_0x22efb0){if(!_[_0x7948('0x95')](_0x22efb0[_0x7948('0x8c')])){if(fs[_0x7948('0x96')](path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0x97'),_0x22efb0[_0x7948('0x8c')]))){_0xd7120f=path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/avatars/',_0x22efb0['agentAvatar']);}}return _0x14e945['download'](_0xd7120f);}})[_0x7948('0x21')](handleError(_0x14e945,null));};exports[_0x7948('0x98')]=function(_0x2bb0ce,_0x26179e){var _0x3494ff=path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/avatars/customer_avatar.png');var _0x211634={'where':{'id':_0x2bb0ce[_0x7948('0x6d')]['id']},'attributes':['id',_0x7948('0x8d'),_0x7948('0x99')],'raw':!![]};return db[_0x7948('0x56')][_0x7948('0x6f')](_0x211634)['then'](handleEntityNotFound(_0x26179e,null))[_0x7948('0x16')](function(_0x165eb6){if(_0x165eb6){if(!_[_0x7948('0x95')](_0x165eb6[_0x7948('0x8d')])){if(fs[_0x7948('0x96')](path['join'](config['root'],_0x7948('0x97'),_0x165eb6[_0x7948('0x8d')]))&&_0x165eb6[_0x7948('0x99')]){_0x3494ff=path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0x97'),_0x165eb6[_0x7948('0x8d')]);}}return _0x26179e[_0x7948('0x94')](_0x3494ff);}})['catch'](handleError(_0x26179e,null));};exports[_0x7948('0x9a')]=function(_0x7914ca,_0x2a4182){var _0x34974d=path[_0x7948('0x8f')](config['root'],_0x7948('0x9b'));var _0x208124={'where':{'id':_0x7914ca['params']['id']},'attributes':['id',_0x7948('0x8e')],'raw':!![]};return db['ChatWebsite']['find'](_0x208124)[_0x7948('0x16')](handleEntityNotFound(_0x2a4182,null))[_0x7948('0x16')](function(_0x36b9ad){if(_0x36b9ad){if(!_[_0x7948('0x95')](_0x36b9ad[_0x7948('0x8e')])){if(fs[_0x7948('0x96')](path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0x97'),_0x36b9ad[_0x7948('0x8e')]))){_0x34974d=path[_0x7948('0x8f')](config['root'],_0x7948('0x97'),_0x36b9ad[_0x7948('0x8e')]);}}return _0x2a4182[_0x7948('0x94')](_0x34974d);}})[_0x7948('0x21')](handleError(_0x2a4182,null));};exports[_0x7948('0x9c')]=function(_0x305f0a,_0x36e8d1){var _0x30f159={'body':_0x305f0a[_0x7948('0x71')],'channel':_0x7948('0x9d')};var _0x2d8984=[];var _0x5c180e=[];var _0x3c625e={};var _0x320c3d=![];return db[_0x7948('0x9e')]['describe']()['then'](function(_0xe26e2d){if(!_0xe26e2d){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xa1'));}_0x2d8984=_['difference'](_['keys'](_0xe26e2d),[_0x7948('0xa2'),_0x7948('0xa3')]);_0x5c180e=_[_0x7948('0xa4')](_[_0x7948('0x5a')](_0xe26e2d),[_0x7948('0xa2'),_0x7948('0xa3'),_0x7948('0xa5'),_0x7948('0xa6')]);if(_0x305f0a['body']['id']){delete _0x305f0a[_0x7948('0x71')]['id'];}if(_[_0x7948('0x95')](_0x305f0a[_0x7948('0x71')][_0x7948('0xa7')])){throw new db[(_0x7948('0x9f'))]['ValidationError'](_0x7948('0xa8'));}if(_[_0x7948('0x95')](_0x305f0a[_0x7948('0x71')][_0x7948('0x71')])||_0x305f0a[_0x7948('0x71')][_0x7948('0x71')]===''){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x305f0a['body'][_0x7948('0xa9')])){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xaa')+_0x5c180e);}if(!_[_0x7948('0xab')](_0x5c180e,_0x305f0a[_0x7948('0x71')][_0x7948('0xa9')])){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c180e);}_0x3c625e[_0x305f0a[_0x7948('0x71')]['mapKey']]=_0x305f0a[_0x7948('0x71')][_0x7948('0xa7')];})['then'](function(){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x305f0a['params']['id']},'include':[{'model':db['CmList'],'as':_0x7948('0xac'),'include':[{'model':db[_0x7948('0x9e')],'as':_0x7948('0xad'),'where':_0x3c625e,'limit':0x1,'order':[['updatedAt',_0x7948('0xae')]]}]},{'model':db[_0x7948('0xaf')],'as':_0x7948('0xb0')},{'model':db[_0x7948('0x3c')],'as':_0x7948('0x3c'),'include':[{'model':db[_0x7948('0x3c')],'as':_0x7948('0xb1'),'attributes':['id',_0x7948('0x35')],'raw':!![]}]}]});})[_0x7948('0x16')](function(_0x5ef2a6){if(!_0x5ef2a6)throw new APINotFoundError(util['format'](_0x7948('0xb2'),_0x305f0a[_0x7948('0x6d')]['id']));if(!_0x5ef2a6[_0x7948('0x3c')]||!_0x5ef2a6[_0x7948('0x3c')]['Intervals'])return[_0x5ef2a6,!![]];return[_0x5ef2a6,checkWebsiteIntervals(_0x5ef2a6)];})[_0x7948('0xb3')](function(_0x4ca859,_0x4ff341){if(!_0x4ff341)throw new APIOutOfIntervalError();if(!_0x4ca859['List'])return;_0x30f159[_0x7948('0xb4')]=_0x4ca859;_0x30f159[_0x7948('0xb5')]=_0x4ca859[_0x7948('0xac')];_0x30f159[_0x7948('0xb6')]=_[_0x7948('0xb7')](_0x4ca859[_0x7948('0xb0')],[_0x7948('0xb8')],[_0x7948('0xb9')]);if(_0x30f159['account'][_0x7948('0xb0')]){delete _0x30f159['account'][_0x7948('0xb0')];}if(_0x30f159[_0x7948('0xb4')][_0x7948('0xac')]&&_0x30f159[_0x7948('0xb4')][_0x7948('0xac')][_0x7948('0xad')]['length']){return _0x30f159[_0x7948('0xb4')]['List'][_0x7948('0xad')][0x0];}var _0x3dd076=_[_0x7948('0xba')](_0x305f0a[_0x7948('0x71')],{'firstName':_0x305f0a['body'][_0x7948('0xa7')],'ListId':_0x4ca859[_0x7948('0xa6')]});_0x3dd076[_0x305f0a['body']['mapKey']]=_0x305f0a[_0x7948('0x71')][_0x7948('0xa7')];return db[_0x7948('0x9e')][_0x7948('0x70')](_0x3dd076,{'fields':_0x2d8984,'raw':!![]});})[_0x7948('0x16')](function(_0x5960c2){_0x30f159[_0x7948('0xbb')]=_0x5960c2;var _0x59097b=createInteractionObject(_0x305f0a[_0x7948('0x6d')]['id'],_0x305f0a[_0x7948('0x71')],_0x305f0a[_0x7948('0xbc')],_0x5960c2);var _0x450ddd={'ChatWebsiteId':_0x305f0a[_0x7948('0x6d')]['id'],'closed':![]};if(_0x305f0a[_0x7948('0x71')][_0x7948('0xbd')]){_0x450ddd[_0x7948('0xbd')]=_0x305f0a[_0x7948('0x71')][_0x7948('0xbd')];return db[_0x7948('0xbe')][_0x7948('0x6f')]({'where':_0x450ddd})[_0x7948('0x16')](function(_0x3fb9c9){if(_0x3fb9c9){_0x320c3d=!![];return _0x3fb9c9;}_0x59097b[_0x7948('0xbd')]=_0x305f0a[_0x7948('0x71')][_0x7948('0xbd')];_0x59097b[_0x7948('0xbf')]=_0x305f0a[_0x7948('0x71')][_0x7948('0xbf')];return db[_0x7948('0xbe')][_0x7948('0x70')](_0x59097b);});}_0x450ddd[_0x7948('0xc0')]=_0x5960c2['id'];if(_0x305f0a[_0x7948('0x71')]['interaction']&&_0x305f0a[_0x7948('0x71')]['interaction']['id']){_0x450ddd['id']=_0x305f0a[_0x7948('0x71')][_0x7948('0xc1')]['id'];return db[_0x7948('0xbe')][_0x7948('0x6f')]({'where':_0x450ddd})['then'](function(_0xb3da40){if(_0xb3da40){_0x320c3d=!![];return _0xb3da40;}return db['ChatInteraction']['create'](_0x59097b);});}return db[_0x7948('0xbe')][_0x7948('0x70')](_0x59097b);})[_0x7948('0x16')](function(_0x369c13){if(!_0x320c3d)return _0x369c13;var _0x1f36fd={'from':(_0x30f159[_0x7948('0xbb')][_0x7948('0x48')]||'')+'\x20'+(_0x30f159[_0x7948('0xbb')][_0x7948('0x49')]||'')};if(_0x305f0a['body'][_0x7948('0xbd')]&&_0x305f0a[_0x7948('0x71')][_0x7948('0xc2')]&&_0x305f0a['body'][_0x7948('0xbd')]!=_0x305f0a[_0x7948('0x71')][_0x7948('0xc2')]){_0x1f36fd['threadId']=_0x305f0a['body'][_0x7948('0xc2')];}return _0x369c13['update'](_0x1f36fd);})[_0x7948('0x16')](function(_0x283470){_0x30f159['interaction']=_0x283470['get']({'plain':!![]});_0x30f159[_0x7948('0xc1')][_0x7948('0xc3')]=!_0x320c3d;if(_0x30f159[_0x7948('0xc1')][_0x7948('0xc3')]){if(_0x30f159[_0x7948('0xb4')][_0x7948('0xc4')]){_0x30f159[_0x7948('0xb6')][_0x7948('0xc5')]({'id':0x0,'priority':_0x30f159[_0x7948('0xb6')][_0x7948('0x60')]+0x1,'app':_0x7948('0xc6'),'appdata':'unmanaged','interval':_0x7948('0xc7')});}}return db[_0x7948('0xc8')][_0x7948('0x70')]({'body':_0x305f0a['body'][_0x7948('0x71')],'ChatWebsiteId':_0x305f0a[_0x7948('0x6d')]['id'],'ChatInteractionId':_0x283470['id'],'direction':'in','ContactId':_0x30f159[_0x7948('0xbb')]['id'],'AttachmentId':_0x305f0a[_0x7948('0x71')][_0x7948('0xc9')]});})[_0x7948('0x16')](function(_0x31f928){_0x30f159[_0x7948('0x1f')]=_0x31f928;if(!_0x30f159['interaction']['UserId']){return;}return db['User'][_0x7948('0x6f')]({'attributes':['id',_0x7948('0x2f')],'where':{'id':_0x30f159['interaction'][_0x7948('0xca')]}});})[_0x7948('0x16')](function(_0x34b2ce){if(_0x34b2ce){_0x30f159['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x7948('0xcb'),'appdata':_0x34b2ce['name']+','+(_0x30f159['account'][_0x7948('0xcc')]||0xa),'interval':_0x7948('0xc7')});_0x30f159[_0x7948('0xcd')]=!![];}if(!_0x30f159[_0x7948('0xc1')][_0x7948('0xce')]){return;}return db['ChatQueue'][_0x7948('0x6f')]({'attributes':['id',_0x7948('0x2f')],'where':{'id':_0x30f159[_0x7948('0xc1')][_0x7948('0xce')]}});})[_0x7948('0x16')](function(_0x4f6961){if(_0x4f6961){_0x30f159['applications'][_0x7948('0xcf')]({'id':0x0,'priority':0x1,'app':_0x7948('0xd0'),'appdata':_0x4f6961[_0x7948('0x2f')]+','+(_0x30f159[_0x7948('0xb4')][_0x7948('0xd1')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7948('0xd2'),_0x7948('0xd3'),_0x30f159);})[_0x7948('0x16')](function(_0x5a57d5){respondWithRpcPromise(_0x7948('0xd4'),_0x7948('0xd4'),{'event':_0x7948('0x9c'),'message':_0x5a57d5},client9002);return _0x5a57d5;})[_0x7948('0x16')](respondWithResult(_0x36e8d1,null))[_0x7948('0x21')](APIHandleError(_0x36e8d1));};exports[_0x7948('0xd5')]=function(_0x1a12c1,_0x2b5b9d){var _0x30f8a5,_0x7e86ab,_0x81425b;var _0x8c0e4f=[];var _0x3cde0b={};var _0x2d7d00=_0x1a12c1['files']||[];var _0x14513=[];var _0x4e9eef;return db['CmContact']['describe']()['then'](function(_0x4a64c9){if(!_0x4a64c9){throw new db['Sequelize'][(_0x7948('0xa0'))](_0x7948('0xa1'));}_0x8c0e4f=_[_0x7948('0xa4')](_['keys'](_0x4a64c9),[_0x7948('0xa2'),_0x7948('0xa3'),_0x7948('0xa5'),'ListId']);if(_0x1a12c1[_0x7948('0x71')]['id']){delete _0x1a12c1[_0x7948('0x71')]['id'];}if(_[_0x7948('0x95')](_0x1a12c1[_0x7948('0x71')][_0x7948('0xa7')])){throw _0x2b5b9d['status'](0x1f4)[_0x7948('0xd6')](new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xa8')));}if(_[_0x7948('0x95')](_0x1a12c1[_0x7948('0x71')][_0x7948('0x71')])||_0x1a12c1[_0x7948('0x71')][_0x7948('0x71')]===''){throw _0x2b5b9d[_0x7948('0x22')](0x1f4)[_0x7948('0xd6')](new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xd7')));}if(_[_0x7948('0x95')](_0x1a12c1['body'][_0x7948('0xd8')])){throw _0x2b5b9d[_0x7948('0x22')](0x1f4)['send'](new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xd9')+_0x8c0e4f));}if(!_[_0x7948('0xab')](_0x8c0e4f,_0x1a12c1[_0x7948('0x71')][_0x7948('0xd8')])){throw _0x2b5b9d[_0x7948('0x22')](0x1f4)[_0x7948('0xd6')](new db['Sequelize'][(_0x7948('0xa0'))](_0x7948('0xda')+_0x8c0e4f));}_0x3cde0b[_0x1a12c1[_0x7948('0x71')][_0x7948('0xd8')]]=_0x1a12c1['body'][_0x7948('0xa7')];})[_0x7948('0x16')](function(){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x1a12c1[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0xdb')],'as':_0x7948('0xac')},{'model':db[_0x7948('0xdc')],'as':'MailAccount'}]});})[_0x7948('0x16')](handleEntityNotFound(_0x2b5b9d,null))[_0x7948('0x16')](function(_0x5c439e){if(_0x5c439e&&_0x5c439e[_0x7948('0xac')]){_0x7e86ab=_0x5c439e;var _0x1776e9=_[_0x7948('0xba')](_0x1a12c1[_0x7948('0x71')],{'firstName':_0x1a12c1['body'][_0x7948('0xa7')],'phone':_0x1a12c1['body']['from'],'ListId':_0x5c439e[_0x7948('0xa6')]});_0x1776e9[_0x1a12c1['body'][_0x7948('0xd8')]]=_0x1a12c1[_0x7948('0x71')]['from'];return db[_0x7948('0x9e')][_0x7948('0xdd')]({'where':_0x3cde0b,'defaults':_0x1776e9});}})[_0x7948('0xb3')](function(_0x508e47){if(_0x508e47){_0x81425b=_0x508e47;var _0x22396a=fs[_0x7948('0xde')](path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0xdf')),_0x7948('0xe0'));var _0x391d11=ejs[_0x7948('0xe1')](_0x22396a,{'body':_[_0x7948('0xe2')](_0x1a12c1['body'][_0x7948('0x71')]),'bodyTitle':_0x7e86ab[_0x7948('0xe3')]});return db[_0x7948('0xe4')][_0x7948('0x70')]({'body':_0x391d11,'plainBody':htmlToText[_0x7948('0xe5')](_0x391d11),'ContactId':_0x508e47['id'],'ChatWebsiteId':_0x7e86ab['id']});}})[_0x7948('0x16')](function(_0x366a2d){_0x4e9eef=_0x366a2d;if(_0x2d7d00[_0x7948('0x60')]){var _0x12c7ad=_0x2d7d00[_0x7948('0x3b')](function(_0x39ecfd){return{'name':_0x39ecfd[_0x7948('0xe6')],'basename':_0x39ecfd[_0x7948('0x8a')],'type':_0x39ecfd['mimetype'],'ChatOfflineMessageId':_0x366a2d['id']};});_0x14513=_0x12c7ad['map'](_0x203919=>{var _0x56bcd0={'filename':_0x203919[_0x7948('0x2f')],'path':path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0xe7'),_0x7948('0xe8'),_0x7948('0xe9'),_0x7948('0xea'),_0x203919[_0x7948('0xeb')])};return _0x56bcd0;});if(!_0x7e86ab['openNewInteraction']){return db['sequelize'][_0x7948('0xec')](function(_0x48b85c){return db[_0x7948('0xed')][_0x7948('0xee')](_0x12c7ad,{'transaction':_0x48b85c});});}}})[_0x7948('0x16')](function(){if(_0x4e9eef){_0x30f8a5=_0x4e9eef;return db['MailAccount'][_0x7948('0x7f')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7948('0xef')],'as':_0x7948('0xef'),'raw':!![]}]}]});}})[_0x7948('0x16')](function(_0x1e226c){if(_0x1e226c&&_0x1e226c['Smtp']&&_0x7e86ab['forwardOffline']&&_0x7e86ab[_0x7948('0xf0')]){var _0xf33154=_0x1e226c[_0x7948('0xf1')]();return respondWithRpcPromise(_0x7948('0xf2'),_0x7948('0xf3'),{'account':_0xf33154,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1e226c[_0x7948('0x2f')],_0x1e226c['email']||_0x1e226c[_0x7948('0xf4')][_0x7948('0x74')]),'to':_0x7e86ab[_0x7948('0xf0')],'subject':_0x7e86ab['offlineMessageSubject'],'html':_0x30f8a5[_0x7948('0x71')],'attachments':_0x14513}},client9003)['then'](function(){return _0x30f8a5;})['catch'](function(_0x8d06f4){logger[_0x7948('0x1d')](_0x8d06f4);});}})[_0x7948('0x16')](function(){if(_0x7e86ab&&_0x7e86ab[_0x7948('0xf5')]&&_0x7e86ab['MailAccountId']){var _0x5886d6=[];if(_0x2d7d00[_0x7948('0x60')]){_0x5886d6=_0x2d7d00[_0x7948('0x3b')](function(_0x454b46){return{'name':_0x454b46[_0x7948('0xe6')],'basename':_0x454b46[_0x7948('0x8a')],'type':_0x454b46[_0x7948('0xf6')],'ChatOfflineMessageId':_0x4e9eef['id']};});}var _0x4562c7;if(!_['isNil'](_0x7e86ab['subjectOffline'])){var _0x121549=_['map'](_0x1a12c1[_0x7948('0x71')],function(_0x2c8bf8){return _0x2c8bf8;});var _0x4cb23a=_['toPairsIn'](_0x121549)[0x0];var _0xf8c0a4=_[_0x7948('0xf7')](_0x4cb23a,function(_0x5363df){return _0x5363df;});_0x4562c7=_0xf8c0a4[0x1][_0x7e86ab[_0x7948('0xf8')]];}var _0x53b399={'from':_0x81425b[_0x7948('0xf9')],'firstName':_0x81425b[_0x7948('0x48')],'lastName':_0x81425b[_0x7948('0x49')],'mapKey':_0x7948('0xf9'),'message':{'from':_0x81425b[_0x7948('0xf9')],'to':_0x7e86ab['MailAccount'][_0x7948('0xf9')],'cc':'','subject':_[_0x7948('0x95')](_0x4562c7)?_0x7e86ab[_0x7948('0xfa')]:_0x4562c7,'messageId':'','sentAt':new Date(),'attach':_0x5886d6[_0x7948('0x60')],'attachments':_0x5886d6,'originChannel':_0x7948('0xfb'),'ChatWebsiteId':_0x7e86ab['id'],'ChatOfflineMessageId':_0x30f8a5['id'],'originTo':_0x7e86ab[_0x7948('0xdc')]['email']},'body':_0x30f8a5['body']};var _0x242f35={'account':{'id':_0x7e86ab[_0x7948('0xfc')]},'body':_0x53b399,'log':_0x7948('0xfd')};return respondWithRpcPromise('NotifyMailAccount',_0x7948('0xfe'),_0x242f35,client9001)['then'](function(){return _0x30f8a5;})[_0x7948('0x21')](function(_0x4b4764){logger[_0x7948('0x1d')](_0x4b4764);});}return;})[_0x7948('0x16')](function(){if(_0x30f8a5){return _0x30f8a5;}})[_0x7948('0x16')](respondWithResult(_0x2b5b9d,null))['catch'](function(){for(var _0x5b1dfd of _0x2d7d00){var _0x46130d=path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0xe7'),_0x7948('0xe8'),_0x7948('0xe9'),_0x7948('0xea'),_0x5b1dfd[_0x7948('0x8a')]);fs_extra['remove'](_0x46130d)[_0x7948('0x21')](function(_0x263db9){logger[_0x7948('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x46130d,_0x263db9);});}});};exports[_0x7948('0xff')]=function(_0x21d56f,_0x35d2fe){return db[_0x7948('0xbe')]['find']({'where':{'id':_0x21d56f[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x35d2fe,null))['then'](function(_0x571840){if(_0x571840){return _0x571840['addInteraction'](_0x21d56f[_0x7948('0x71')]['ids'],_[_0x7948('0x100')](_0x21d56f[_0x7948('0x71')],[_0x7948('0x84'),'id'])||{});}})[_0x7948('0x16')](respondWithResult(_0x35d2fe,null))['catch'](handleError(_0x35d2fe,null));};exports[_0x7948('0x101')]=function(_0x2a7a06,_0xa7eacb){var _0x438c78={'raw':![],'where':{}};var _0x48beba={};var _0x4b624f={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2a7a06[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0xa7eacb,null))[_0x7948('0x16')](function(_0x599fc2){if(_0x599fc2){_0x48beba['model']=_[_0x7948('0x5a')](db['ChatInteraction']['rawAttributes']);_0x48beba['query']=_[_0x7948('0x5a')](_0x2a7a06['query']);_0x48beba['filters']=_[_0x7948('0x5d')](_0x48beba[_0x7948('0x50')],_0x48beba[_0x7948('0x5b')]);_0x438c78[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x48beba['model'],qs[_0x7948('0x5f')](_0x2a7a06[_0x7948('0x5b')][_0x7948('0x5f')]));_0x438c78[_0x7948('0x5e')]=_0x438c78[_0x7948('0x5e')][_0x7948('0x60')]?_0x438c78[_0x7948('0x5e')]:_0x48beba[_0x7948('0x50')];if(!_0x2a7a06[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x438c78[_0x7948('0x26')]=qs['limit'](_0x2a7a06['query'][_0x7948('0x26')]);_0x438c78[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x2a7a06[_0x7948('0x5b')][_0x7948('0x23')]);}_0x438c78[_0x7948('0x81')]=qs['sort'](_0x2a7a06[_0x7948('0x5b')]['sort']);_0x438c78[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x2a7a06[_0x7948('0x5b')],_0x48beba['filters']));_0x438c78['where']['ChatWebsiteId']=_0x599fc2['id'];if(_0x2a7a06[_0x7948('0x5b')]['filter']){_0x438c78['where']=_[_0x7948('0x65')](_0x438c78[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x438c78[_0x7948('0x5e')],function(_0x26bfc3){var _0x7578a6={};_0x7578a6[_0x26bfc3]={'$like':'%'+_0x2a7a06[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x7578a6;})});}_0x438c78=_[_0x7948('0x65')]({},_0x438c78,_0x2a7a06[_0x7948('0x67')]);return db[_0x7948('0xbe')][_0x7948('0x25')]({'where':_0x438c78[_0x7948('0x62')]})['then'](function(_0x4832de){_0x4b624f[_0x7948('0x25')]=_0x4832de;if(_0x2a7a06['query'][_0x7948('0x68')]){_0x438c78[_0x7948('0x69')]=[{'model':db[_0x7948('0x9e')],'as':_0x7948('0x102'),'required':![]},{'model':db[_0x7948('0x103')],'as':'Owner','attributes':[_0x7948('0x2f'),'fullname',_0x7948('0x104')],'required':![]},{'model':db[_0x7948('0x105')],'as':_0x7948('0x106'),'attributes':['id','name',_0x7948('0x107')],'where':_0x2a7a06[_0x7948('0x5b')]['tag']?{'id':_0x2a7a06[_0x7948('0x5b')][_0x7948('0x108')]}:undefined,'required':_0x2a7a06['query'][_0x7948('0x108')]?!![]:![]}];}return db[_0x7948('0xbe')][_0x7948('0x6a')](_0x438c78);})[_0x7948('0x16')](function(_0x4f9394){_0x4b624f['rows']=_0x4f9394;return _0x4b624f;});}})[_0x7948('0x16')](respondWithFilteredResult(_0xa7eacb,_0x438c78))[_0x7948('0x21')](handleError(_0xa7eacb,null));};exports[_0x7948('0x31')]=function(_0x423b45,_0x356126){var _0x2319ef=0x0;var _0x2b7922=0x0;var _0x9d0a89=![];var _0x599c92;var _0x5cd732;return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x423b45[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0x3c')],'as':'Interval','include':[{'model':db[_0x7948('0x3c')],'as':'Intervals','attributes':['id',_0x7948('0x35')]}]}]})[_0x7948('0x16')](handleEntityNotFound(_0x356126,null))[_0x7948('0x16')](function(_0x203e64){if(_0x203e64){_0x599c92=_0x203e64;return _0x203e64[_0x7948('0x109')]({'raw':!![]});}})[_0x7948('0x16')](function(_0x5dd9ed){if(_0x599c92){if(_0x5dd9ed){_0x5cd732=_0x5dd9ed;}}return require(_0x7948('0x91'))['getLicense']();})['then'](function(_0x1013d2){if(_0x1013d2){_0x2b7922=_0x1013d2[_0x7948('0x10a')];_0x9d0a89=_0x1013d2[_0x7948('0x10b')];}})[_0x7948('0x16')](function(){return db[_0x7948('0xbe')]['count']({'where':{'closed':![]}});})[_0x7948('0x16')](function(_0xe0d3b4){_0x2319ef=_0xe0d3b4;if(_0x2b7922&&_0xe0d3b4>_0x2b7922){return db[_0x7948('0x10c')][_0x7948('0x7f')]({'where':{'id':0x1}})[_0x7948('0x16')](function(_0x5c1dab){if(_0x5c1dab){_0x5c1dab[_0x7948('0x10d')](_0x7948('0x10e'));}});}})[_0x7948('0x16')](function(){if(!_0x599c92[_0x7948('0x3c')]||!_0x599c92[_0x7948('0x3c')][_0x7948('0xb1')])return!![];return checkWebsiteIntervals(_0x599c92);})[_0x7948('0x16')](function(_0x137b61){var _0x15cabd=fs[_0x7948('0xde')](path['join'](config['root'],'server/files/chat/iframe.ejs'),_0x7948('0xe0'));var _0x375a1a=new url[(_0x7948('0x10f'))](_0x599c92['address'])['origin'];var _0x238366='3.5.0';var _0x44ce32=![];var _0x953603={'chatVersion':_0x238366,'chatWebsiteAddressOrigin':_0x375a1a,'remote':_0x599c92[_0x7948('0x110')],'query':querystring[_0x7948('0x1c')](_[_0x7948('0x65')](_0x599c92[_0x7948('0x3d')]({'plain':!![]}),{'customerIp':_0x423b45[_0x7948('0xbc')][_0x7948('0x46')]||_0x423b45['headers'][_0x7948('0x111')]||_0x423b45[_0x7948('0x112')][_0x7948('0x113')]||_0x423b45['ip'],'referer':_0x423b45[_0x7948('0xbc')][_0x7948('0x114')],'openedInteractions':_0x2319ef,'maxInteractions':_0x2b7922,'virtual':_0x9d0a89['virtual'],'online':_0x137b61,'custom':_0x9d0a89}))['replace'](/'/g,'\x5c\x27')};_0x356126['send'](ejs[_0x7948('0xe1')](Mustache[_0x7948('0xe1')](_0x15cabd,_0x953603),{'proactiveActions':_0x5cd732,'alignment':_0x599c92[_0x7948('0x115')],'verticalAlignment':_0x599c92[_0x7948('0x116')],'div_color':_0x599c92[_0x7948('0x107')],'labelText':_0x599c92['labelText'],'text_color':_0x599c92[_0x7948('0x117')],'text_button_color':_0x599c92[_0x7948('0x118')],'button_color':_0x599c92[_0x7948('0x119')],'background_color':_0x599c92[_0x7948('0x11a')],'hideWhenOffline':_0x599c92[_0x7948('0x11b')],'intervalId':_0x599c92['IntervalId'],'isDevelopment':_0x44ce32,'chatVersion':_0x238366}));})['catch'](handleError(_0x356126,null));};exports[_0x7948('0x11c')]=function(_0x10adef,_0x31f764){var _0xe56cf8=_0x10adef[_0x7948('0x6d')]['id'];var _0x3ffea7=_0x10adef[_0x7948('0x71')];var _0x28a84e=0xc8;var _0x13e239=null;return db[_0x7948('0x11d')]['transaction']({'isolationLevel':db['sequelize'][_0x7948('0x11e')][_0x7948('0x11f')][_0x7948('0x120')]},function(_0x277e85){return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0xe56cf8},'transaction':_0x277e85})[_0x7948('0x16')](function(_0xbb7ab1){if(_0xbb7ab1){return db[_0x7948('0xaf')][_0x7948('0x29')]({'where':{'ChatWebsiteId':_0xe56cf8},'transaction':_0x277e85})[_0x7948('0x16')](function(){var _0x574dd6=_[_0x7948('0x3b')](_0x3ffea7,function(_0x492049){_0x492049[_0x7948('0x7c')]=_0xe56cf8;return _0x492049;});return db[_0x7948('0xaf')][_0x7948('0xee')](_0x574dd6,{'transaction':_0x277e85});});}else{_0x28a84e=0x194;_0x13e239=[];}});})['then'](function(){if(_0x28a84e!==0x194){return db[_0x7948('0xaf')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xe56cf8},'order':_0x7948('0xb8')})[_0x7948('0x16')](function(_0xdd114f){_0x13e239=_0xdd114f;});}})[_0x7948('0x21')](function(_0x129b93){_0x28a84e=0x1f4;logger[_0x7948('0x1d')](_0x129b93[_0x7948('0x2e')]);if(_0x129b93[_0x7948('0x2f')]){delete _0x129b93[_0x7948('0x2f')];}_0x13e239=_0x129b93;})[_0x7948('0x121')](function(){if(_0x13e239===null){_0x31f764[_0x7948('0x2d')](_0x28a84e);}else{if(_0x28a84e===0x1f4){_0x31f764[_0x7948('0x22')](_0x28a84e)[_0x7948('0xd6')](_0x13e239);}else{_0x31f764[_0x7948('0x22')](_0x28a84e)[_0x7948('0x122')](_0x13e239);}}});};exports[_0x7948('0x123')]=function(_0x5c405d,_0x121afa){var _0x340128={};var _0x23ac21={};var _0x22a403;var _0x568182;return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x5c405d[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x121afa,null))[_0x7948('0x16')](function(_0x22a968){if(_0x22a968){_0x22a403=_0x22a968;_0x23ac21[_0x7948('0x50')]=_[_0x7948('0x5a')](db[_0x7948('0xaf')]['rawAttributes']);_0x23ac21[_0x7948('0x5b')]=_['keys'](_0x5c405d[_0x7948('0x5b')]);_0x23ac21[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x23ac21[_0x7948('0x50')],_0x23ac21[_0x7948('0x5b')]);_0x340128[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x23ac21[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x5c405d[_0x7948('0x5b')][_0x7948('0x5f')]));_0x340128[_0x7948('0x5e')]=_0x340128[_0x7948('0x5e')]['length']?_0x340128['attributes']:_0x23ac21['model'];_0x340128[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x5c405d[_0x7948('0x5b')][_0x7948('0x82')]);_0x340128['where']=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x5c405d[_0x7948('0x5b')],_0x23ac21['filters']));if(_0x5c405d['query'][_0x7948('0x64')]){_0x340128['where']=_[_0x7948('0x65')](_0x340128[_0x7948('0x62')],{'$or':_['map'](_0x340128['attributes'],function(_0x1e2913){var _0x4b9c82={};_0x4b9c82[_0x1e2913]={'$like':'%'+_0x5c405d[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x4b9c82;})});}_0x340128=_[_0x7948('0x65')]({},_0x340128,_0x5c405d['options']);return _0x22a403[_0x7948('0x123')](_0x340128);}})[_0x7948('0x16')](function(_0x2272ea){if(_0x2272ea){_0x568182=_0x2272ea[_0x7948('0x60')];if(!_0x5c405d[_0x7948('0x5b')][_0x7948('0x80')]('nolimit')){_0x340128[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x5c405d[_0x7948('0x5b')]['limit']);_0x340128['offset']=qs[_0x7948('0x23')](_0x5c405d[_0x7948('0x5b')][_0x7948('0x23')]);}return _0x22a403[_0x7948('0x123')](_0x340128);}})['then'](function(_0x24b811){if(_0x24b811){return _0x24b811?{'count':_0x568182,'rows':_0x24b811}:null;}})[_0x7948('0x16')](respondWithResult(_0x121afa,null))['catch'](handleError(_0x121afa,null));};exports[_0x7948('0x124')]=function(_0x24d890,_0x23a25e){return db[_0x7948('0x125')]['find']({'where':{'id':_0x24d890[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x23a25e,null))[_0x7948('0x16')](function(_0x3ac360){if(_0x3ac360){return _0x3ac360['addProactiveActions'](_0x24d890[_0x7948('0x71')][_0x7948('0x84')],_[_0x7948('0x100')](_0x24d890[_0x7948('0x71')],[_0x7948('0x84'),'id'])||{});}})[_0x7948('0x16')](respondWithResult(_0x23a25e,null))[_0x7948('0x21')](handleError(_0x23a25e,null));};exports[_0x7948('0x109')]=function(_0x4a1922,_0xe1eaf0){var _0x5739dc={};var _0x3f87e8={};var _0x5b7633;var _0x2f536c;return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x4a1922[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0xe1eaf0,null))['then'](function(_0x499327){if(_0x499327){_0x5b7633=_0x499327;_0x3f87e8[_0x7948('0x50')]=_['keys'](db[_0x7948('0x126')]['rawAttributes']);_0x3f87e8[_0x7948('0x5b')]=_['keys'](_0x4a1922[_0x7948('0x5b')]);_0x3f87e8['filters']=_['intersection'](_0x3f87e8[_0x7948('0x50')],_0x3f87e8[_0x7948('0x5b')]);_0x5739dc[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x3f87e8['model'],qs[_0x7948('0x5f')](_0x4a1922[_0x7948('0x5b')][_0x7948('0x5f')]));_0x5739dc['attributes']=_0x5739dc[_0x7948('0x5e')][_0x7948('0x60')]?_0x5739dc[_0x7948('0x5e')]:_0x3f87e8[_0x7948('0x50')];_0x5739dc[_0x7948('0x81')]=qs['sort'](_0x4a1922[_0x7948('0x5b')][_0x7948('0x82')]);_0x5739dc['where']=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x4a1922[_0x7948('0x5b')],_0x3f87e8[_0x7948('0x5c')]));if(_0x4a1922[_0x7948('0x5b')][_0x7948('0x64')]){_0x5739dc[_0x7948('0x62')]=_[_0x7948('0x65')](_0x5739dc[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x5739dc['attributes'],function(_0x375dae){var _0xeb4f4e={};_0xeb4f4e[_0x375dae]={'$like':'%'+_0x4a1922[_0x7948('0x5b')]['filter']+'%'};return _0xeb4f4e;})});}_0x5739dc=_['merge']({},_0x5739dc,_0x4a1922['options']);return _0x5b7633[_0x7948('0x109')](_0x5739dc);}})[_0x7948('0x16')](function(_0x295274){if(_0x295274){_0x2f536c=_0x295274[_0x7948('0x60')];if(!_0x4a1922[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x5739dc[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x4a1922[_0x7948('0x5b')][_0x7948('0x26')]);_0x5739dc[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x4a1922[_0x7948('0x5b')][_0x7948('0x23')]);}return _0x5b7633[_0x7948('0x109')](_0x5739dc);}})[_0x7948('0x16')](function(_0x47daf2){if(_0x47daf2){return _0x47daf2?{'count':_0x2f536c,'rows':_0x47daf2}:null;}})[_0x7948('0x16')](respondWithResult(_0xe1eaf0,null))[_0x7948('0x21')](handleError(_0xe1eaf0,null));};exports[_0x7948('0x127')]=function(_0xbc1b74,_0x541e7d){var _0x1aa6fb=_0xbc1b74[_0x7948('0x5b')][_0x7948('0x128')]===_0x7948('0x129')?_0x7948('0x12a'):_0x7948('0x12b');return db[_0x7948('0x56')][_0x7948('0x6f')]({'attributes':['id',_0x1aa6fb],'where':{'id':_0xbc1b74['params']['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x541e7d,null))['then'](function(_0x2fc1db){if(_0x2fc1db){var _0x3ccc7b=_0x2fc1db[_0x1aa6fb];var _0x532a15=_0x3ccc7b&&_0x3ccc7b['items']?_0x3ccc7b[_0x7948('0x12c')]:[];_0x541e7d[_0x7948('0xd6')]({'fromKey':_[_0x7948('0x95')](_0x3ccc7b[_0x7948('0x12d')])?undefined:_0x3ccc7b[_0x7948('0x12d')],'count':_0x532a15[_0x7948('0x60')],'rows':_0x532a15});}})[_0x7948('0x21')](handleError(_0x541e7d,null));};exports[_0x7948('0x12e')]=function(_0x21cee3,_0x40c212){var _0x13f5ed={'raw':![],'where':{}};var _0x587613={};var _0x1213fb={'count':0x0,'rows':[]};return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x21cee3['params']['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x40c212,null))[_0x7948('0x16')](function(_0x22fc4e){if(_0x22fc4e){_0x587613[_0x7948('0x50')]=_[_0x7948('0x5a')](db[_0x7948('0xe4')][_0x7948('0x57')]);_0x587613['query']=_['keys'](_0x21cee3[_0x7948('0x5b')]);_0x587613['filters']=_['intersection'](_0x587613[_0x7948('0x50')],_0x587613[_0x7948('0x5b')]);_0x13f5ed['attributes']=_[_0x7948('0x5d')](_0x587613[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x21cee3[_0x7948('0x5b')]['fields']));_0x13f5ed[_0x7948('0x5e')]=_0x13f5ed['attributes'][_0x7948('0x60')]?_0x13f5ed['attributes']:_0x587613['model'];if(!_0x21cee3[_0x7948('0x5b')]['hasOwnProperty'](_0x7948('0x61'))){_0x13f5ed[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x21cee3[_0x7948('0x5b')][_0x7948('0x26')]);_0x13f5ed[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x21cee3[_0x7948('0x5b')][_0x7948('0x23')]);}_0x13f5ed[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x21cee3[_0x7948('0x5b')][_0x7948('0x82')]);_0x13f5ed[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x21cee3[_0x7948('0x5b')],_0x587613[_0x7948('0x5c')]));_0x13f5ed['where'][_0x7948('0x7c')]=_0x22fc4e['id'];if(_0x21cee3['query'][_0x7948('0x64')]){_0x13f5ed[_0x7948('0x62')]=_[_0x7948('0x65')](_0x13f5ed[_0x7948('0x62')],{'$or':_['map'](_0x13f5ed[_0x7948('0x5e')],function(_0x3533bd){var _0x366d84={};_0x366d84[_0x3533bd]={'$like':'%'+_0x21cee3['query']['filter']+'%'};return _0x366d84;})});}_0x13f5ed=_[_0x7948('0x65')]({},_0x13f5ed,_0x21cee3[_0x7948('0x67')]);return db[_0x7948('0xe4')][_0x7948('0x25')]({'where':_0x13f5ed['where']})[_0x7948('0x16')](function(_0x1bbbb4){_0x1213fb['count']=_0x1bbbb4;if(_0x21cee3[_0x7948('0x5b')][_0x7948('0x68')]){_0x13f5ed[_0x7948('0x69')]=[{'all':!![]}];}else{_0x13f5ed[_0x7948('0x69')]=[{'model':db[_0x7948('0x9e')],'as':_0x7948('0x102'),'required':![]},{'model':db[_0x7948('0xed')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x7948('0x6a')](_0x13f5ed);})[_0x7948('0x16')](function(_0x5acfb1){_0x1213fb[_0x7948('0x6b')]=_0x5acfb1;return _0x1213fb;});}})[_0x7948('0x16')](respondWithFilteredResult(_0x40c212,_0x13f5ed))[_0x7948('0x21')](handleError(_0x40c212,null));};exports[_0x7948('0x12f')]=function(_0x4f9e2e,_0x550968){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x4f9e2e['params']['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x550968,null))['then'](function(_0x6cc925){if(_0x6cc925){return _0x6cc925[_0x7948('0x12f')](_0x4f9e2e[_0x7948('0x71')][_0x7948('0x84')],_[_0x7948('0x100')](_0x4f9e2e[_0x7948('0x71')],[_0x7948('0x84'),'id'])||{})[_0x7948('0xb3')](function(_0x347fe2){for(var _0x5ebc57=0x0;_0x5ebc57<_0x4f9e2e['body'][_0x7948('0x84')][_0x7948('0x60')];_0x5ebc57+=0x1){socket[_0x7948('0x130')](_0x7948('0x131'),{'UserId':Number(_0x4f9e2e['body'][_0x7948('0x84')][_0x5ebc57]),'ChatWebsiteId':Number(_0x4f9e2e[_0x7948('0x6d')]['id'])});}return _0x347fe2;});}})['then'](respondWithResult(_0x550968,null))[_0x7948('0x21')](handleError(_0x550968,null));};exports[_0x7948('0x132')]=function(_0x2ce850,_0x2d3975){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x2ce850[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x2d3975,null))[_0x7948('0x16')](function(_0x53646e){if(_0x53646e){return _0x53646e[_0x7948('0x132')](_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')])[_0x7948('0x16')](function(){if(_[_0x7948('0x133')](_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')])){for(var _0x4c9708=0x0;_0x4c9708<_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')]['length'];_0x4c9708+=0x1){socket[_0x7948('0x130')](_0x7948('0x134'),{'UserId':Number(_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')][_0x4c9708]),'ChatWebsiteId':Number(_0x2ce850[_0x7948('0x6d')]['id'])});}}else{socket[_0x7948('0x130')](_0x7948('0x134'),{'UserId':Number(_0x2ce850['query'][_0x7948('0x84')]),'ChatWebsiteId':Number(_0x2ce850[_0x7948('0x6d')]['id'])});}});}})[_0x7948('0x16')](respondWithStatusCode(_0x2d3975,null))['catch'](handleError(_0x2d3975,null));};exports[_0x7948('0x135')]=function(_0x341a38,_0x5b3ffe){var _0x21412c={};var _0x59690b={};var _0x2b2307;var _0x45fbab;return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x341a38[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x5b3ffe,null))[_0x7948('0x16')](function(_0x40524f){if(_0x40524f){_0x2b2307=_0x40524f;_0x59690b['model']=_['keys'](db[_0x7948('0x103')]['rawAttributes']);_0x59690b[_0x7948('0x5b')]=_[_0x7948('0x5a')](_0x341a38['query']);_0x59690b['filters']=_[_0x7948('0x5d')](_0x59690b['model'],_0x59690b['query']);_0x21412c[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x59690b['model'],qs['fields'](_0x341a38[_0x7948('0x5b')][_0x7948('0x5f')]));_0x21412c[_0x7948('0x5e')]=_0x21412c[_0x7948('0x5e')]['length']?_0x21412c[_0x7948('0x5e')]:_0x59690b[_0x7948('0x50')];_0x21412c[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x341a38['query'][_0x7948('0x82')]);_0x21412c[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x341a38[_0x7948('0x5b')],_0x59690b[_0x7948('0x5c')]));if(_0x341a38[_0x7948('0x5b')][_0x7948('0x64')]){_0x21412c[_0x7948('0x62')]=_[_0x7948('0x65')](_0x21412c[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x21412c[_0x7948('0x5e')],function(_0x136639){var _0x5976e1={};_0x5976e1[_0x136639]={'$like':'%'+_0x341a38[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x5976e1;})});}_0x21412c=_[_0x7948('0x65')]({},_0x21412c,_0x341a38[_0x7948('0x67')]);return _0x2b2307[_0x7948('0x135')](_0x21412c);}})[_0x7948('0x16')](function(_0x2524f0){if(_0x2524f0){_0x45fbab=_0x2524f0[_0x7948('0x60')];if(!_0x341a38[_0x7948('0x5b')][_0x7948('0x80')]('nolimit')){_0x21412c[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x341a38[_0x7948('0x5b')][_0x7948('0x26')]);_0x21412c['offset']=qs['offset'](_0x341a38[_0x7948('0x5b')][_0x7948('0x23')]);}return _0x2b2307[_0x7948('0x135')](_0x21412c);}})[_0x7948('0x16')](function(_0x13a361){if(_0x13a361){return _0x13a361?{'count':_0x45fbab,'rows':_0x13a361}:null;}})[_0x7948('0x16')](respondWithResult(_0x5b3ffe,null))[_0x7948('0x21')](handleError(_0x5b3ffe,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 4dc0f1e..508a31c 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 _0x4ab0=['save','update','emit','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x32f776,_0x1bf7e6){var _0xa9f55=function(_0x3a1045){while(--_0x3a1045){_0x32f776['push'](_0x32f776['shift']());}};_0xa9f55(++_0x1bf7e6);}(_0x4ab0,0xd5));var _0x04ab=function(_0x721a88,_0x480321){_0x721a88=_0x721a88-0x0;var _0x39f85a=_0x4ab0[_0x721a88];return _0x39f85a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x04ab('0x0'))['db'][_0x04ab('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x04ab('0x2')](0x0);var events={'afterCreate':_0x04ab('0x3'),'afterUpdate':_0x04ab('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c3a53){return function(_0x45dfee,_0xb1bf2d,_0x491958){ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53+':'+_0x45dfee['id'],_0x45dfee);ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53,_0x45dfee);_0x491958(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x04ab('0x6')](e,emitEvent(event));}}module[_0x04ab('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa8eb=['exports','events','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa8eb,0x179));var _0xba8e=function(_0x4e2db8,_0x145135){_0x4e2db8=_0x4e2db8-0x0;var _0x4231f6=_0xa8eb[_0x4e2db8];return _0x4231f6;};'use strict';var EventEmitter=require(_0xba8e('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xba8e('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba8e('0x2'),'afterUpdate':_0xba8e('0x3'),'afterDestroy':_0xba8e('0x4')};function emitEvent(_0x5c94e6){return function(_0x353df2,_0x368ce6,_0x4c5cd0){ChatWebsiteEvents[_0xba8e('0x5')](_0x5c94e6+':'+_0x353df2['id'],_0x353df2);ChatWebsiteEvents['emit'](_0x5c94e6,_0x353df2);_0x4c5cd0(null);};}for(var e in events){if(events[_0xba8e('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xba8e('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 39aab27..0f19699 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 _0xe8b8=['../../config/environment','util','api','bluebird','path','rimraf'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0xe8b8,0x103));var _0x8e8b=function(_0x4915f4,_0xde6df0){_0x4915f4=_0x4915f4-0x0;var _0x504378=_0xe8b8[_0x4915f4];return _0x504378;};'use strict';var _=require('lodash');var util=require(_0x8e8b('0x0'));var logger=require('../../config/logger')(_0x8e8b('0x1'));var moment=require('moment');var BPromise=require(_0x8e8b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e8b('0x3'));var rimraf=require(_0x8e8b('0x4'));var config=require(_0x8e8b('0x5'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x59f8e4,_0x3193b2){return _0x59f8e4['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb50e=['ChatWebsite','lodash','util','../../config/logger','bluebird','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x80ac62,_0xfcf410){var _0x983e30=function(_0x39a46b){while(--_0x39a46b){_0x80ac62['push'](_0x80ac62['shift']());}};_0x983e30(++_0xfcf410);}(_0xb50e,0x91));var _0xeb50=function(_0x21f089,_0x5ebacd){_0x21f089=_0x21f089-0x0;var _0x59c5e7=_0xb50e[_0x21f089];return _0x59c5e7;};'use strict';var _=require(_0xeb50('0x0'));var util=require(_0xeb50('0x1'));var logger=require(_0xeb50('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeb50('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb50('0x4'));var rimraf=require('rimraf');var config=require(_0xeb50('0x5'));var attributes=require(_0xeb50('0x6'));module[_0xeb50('0x7')]=function(_0x41b93b,_0x32b4a6){return _0x41b93b['define'](_0xeb50('0x8'),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 9d0938e..4858b07 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 _0xee91=['error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x468234,_0xa51a9e){var _0x1cd6c2=function(_0xf6f14c){while(--_0xf6f14c){_0x468234['push'](_0x468234['shift']());}};_0x1cd6c2(++_0xa51a9e);}(_0xee91,0x92));var _0x1ee9=function(_0x3c95c4,_0xb86b0){_0x3c95c4=_0x3c95c4-0x0;var _0x20bc24=_0xee91[_0x3c95c4];return _0x20bc24;};'use strict';var _=require(_0x1ee9('0x0'));var util=require(_0x1ee9('0x1'));var moment=require(_0x1ee9('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ee9('0x3'));var fs=require('fs');var Redis=require(_0x1ee9('0x4'));var db=require(_0x1ee9('0x5'))['db'];var utils=require(_0x1ee9('0x6'));var logger=require(_0x1ee9('0x7'))('rpc');var config=require(_0x1ee9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ee9('0x9')][_0x1ee9('0xa')]({'port':0x232a});config[_0x1ee9('0xb')]=_['defaults'](config[_0x1ee9('0xb')],{'host':_0x1ee9('0xc'),'port':0x18eb});var socket=require(_0x1ee9('0xd'))(new Redis(config[_0x1ee9('0xb')]));require(_0x1ee9('0xe'))[_0x1ee9('0xf')](socket);function respondWithRpcPromise(_0x55d1b6,_0x50dc0e,_0x25d730){return new BPromise(function(_0x3668aa,_0x499f93){return client['request'](_0x55d1b6,_0x25d730)[_0x1ee9('0x10')](function(_0x473d83){logger[_0x1ee9('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x50dc0e,_0x1ee9('0x12'));logger[_0x1ee9('0x13')](_0x1ee9('0x14'),_0x50dc0e,'request\x20sent',JSON[_0x1ee9('0x15')](_0x473d83));if(_0x473d83[_0x1ee9('0x16')]){if(_0x473d83[_0x1ee9('0x16')][_0x1ee9('0x17')]===0x1f4){logger[_0x1ee9('0x16')](_0x1ee9('0x18'),_0x50dc0e,_0x473d83[_0x1ee9('0x16')]['message']);return _0x499f93(_0x473d83['error']['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x50dc0e,_0x473d83[_0x1ee9('0x16')][_0x1ee9('0x19')]);return _0x3668aa(_0x473d83[_0x1ee9('0x16')][_0x1ee9('0x19')]);}else{logger[_0x1ee9('0x11')](_0x1ee9('0x18'),_0x50dc0e,_0x1ee9('0x12'));_0x3668aa(_0x473d83[_0x1ee9('0x1a')]['message']);}})[_0x1ee9('0x1b')](function(_0x151e1a){logger[_0x1ee9('0x16')](_0x1ee9('0x18'),_0x50dc0e,_0x151e1a);_0x499f93(_0x151e1a);});});} \ No newline at end of file +var _0x0272=['info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatWebsite.socket','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0272,0xd1));var _0x2027=function(_0xbcc57,_0x3e25f1){_0xbcc57=_0xbcc57-0x0;var _0x73f607=_0x0272[_0xbcc57];return _0x73f607;};'use strict';var _=require(_0x2027('0x0'));var util=require(_0x2027('0x1'));var moment=require('moment');var BPromise=require(_0x2027('0x2'));var rs=require(_0x2027('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2027('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2027('0x5'))(_0x2027('0x6'));var config=require(_0x2027('0x7'));var jayson=require(_0x2027('0x8'));var client=jayson[_0x2027('0x9')][_0x2027('0xa')]({'port':0x232a});config[_0x2027('0xb')]=_[_0x2027('0xc')](config[_0x2027('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2027('0xd'))['register'](socket);function respondWithRpcPromise(_0x3d75f8,_0x4bc6a7,_0xa5d623){return new BPromise(function(_0xc6932e,_0x1ad058){return client[_0x2027('0xe')](_0x3d75f8,_0xa5d623)[_0x2027('0xf')](function(_0x2b6a18){logger[_0x2027('0x10')](_0x2027('0x11'),_0x4bc6a7,'request\x20sent');logger['debug'](_0x2027('0x12'),_0x4bc6a7,_0x2027('0x13'),JSON['stringify'](_0x2b6a18));if(_0x2b6a18[_0x2027('0x14')]){if(_0x2b6a18['error'][_0x2027('0x15')]===0x1f4){logger[_0x2027('0x14')](_0x2027('0x11'),_0x4bc6a7,_0x2b6a18[_0x2027('0x14')][_0x2027('0x16')]);return _0x1ad058(_0x2b6a18['error']['message']);}logger[_0x2027('0x14')](_0x2027('0x11'),_0x4bc6a7,_0x2b6a18[_0x2027('0x14')][_0x2027('0x16')]);return _0xc6932e(_0x2b6a18[_0x2027('0x14')][_0x2027('0x16')]);}else{logger[_0x2027('0x10')](_0x2027('0x11'),_0x4bc6a7,_0x2027('0x13'));_0xc6932e(_0x2b6a18[_0x2027('0x17')][_0x2027('0x16')]);}})[_0x2027('0x18')](function(_0x4009f4){logger[_0x2027('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4bc6a7,_0x4009f4);_0x1ad058(_0x4009f4);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index f53f06b..680e1d4 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 _0xdd40=['removeListener','register','chatWebsite:','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd40,0x199));var _0x0dd4=function(_0x3ca640,_0x2a063f){_0x3ca640=_0x3ca640-0x0;var _0x3e49c5=_0xdd40[_0x3ca640];return _0x3e49c5;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x0dd4('0x0'),_0x0dd4('0x1'),_0x0dd4('0x2')];function createListener(_0x57a94f,_0x40a7ab){return function(_0x5d4e2b){_0x40a7ab[_0x0dd4('0x3')](_0x57a94f,_0x5d4e2b);};}function removeListener(_0x3f5493,_0x897b95){return function(){ChatWebsiteEvents[_0x0dd4('0x4')](_0x3f5493,_0x897b95);};}exports[_0x0dd4('0x5')]=function(_0xda754f){for(var _0x197adb=0x0,_0x515aab=events['length'];_0x197adb<_0x515aab;_0x197adb++){var _0x962b78=events[_0x197adb];var _0x5e67b9=createListener(_0x0dd4('0x6')+_0x962b78,_0xda754f);ChatWebsiteEvents['on'](_0x962b78,_0x5e67b9);}}; \ No newline at end of file +var _0x5898=['chatWebsite:','./chatWebsite.events','remove','update','emit','register','length'];(function(_0x34c956,_0x2eed30){var _0x1bf1d0=function(_0x8beb67){while(--_0x8beb67){_0x34c956['push'](_0x34c956['shift']());}};_0x1bf1d0(++_0x2eed30);}(_0x5898,0x14a));var _0x8589=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x5898[_0x5de214];return _0x4df627;};'use strict';var ChatWebsiteEvents=require(_0x8589('0x0'));var events=['save',_0x8589('0x1'),_0x8589('0x2')];function createListener(_0x24b1f2,_0x5937a5){return function(_0x242075){_0x5937a5[_0x8589('0x3')](_0x24b1f2,_0x242075);};}function removeListener(_0x3eff73,_0x414632){return function(){ChatWebsiteEvents['removeListener'](_0x3eff73,_0x414632);};}exports[_0x8589('0x4')]=function(_0x441469){for(var _0x14f416=0x0,_0x545f37=events[_0x8589('0x5')];_0x14f416<_0x545f37;_0x14f416++){var _0xd0e405=events[_0x14f416];var _0x4c458c=createListener(_0x8589('0x6')+_0xd0e405,_0x441469);ChatWebsiteEvents['on'](_0xd0e405,_0x4c458c);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4d74b05..51c201e 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 _0x8892=['getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','addAgents','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','fs-extra','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x8892,0x16a));var _0x2889=function(_0x1b91e8,_0x4197e0){_0x1b91e8=_0x1b91e8-0x0;var _0x599517=_0x8892[_0x1b91e8];return _0x599517;};'use strict';var multer=require('multer');var util=require(_0x2889('0x0'));var path=require(_0x2889('0x1'));var timeout=require(_0x2889('0x2'));var express=require(_0x2889('0x3'));var router=express['Router']();var fs_extra=require(_0x2889('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2889('0x5'));router[_0x2889('0x6')]('/',auth[_0x2889('0x7')](),controller[_0x2889('0x8')]);router[_0x2889('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x2889('0x9')]);router['get'](_0x2889('0xa'),auth[_0x2889('0x7')](),controller[_0x2889('0xb')]);router['get'](_0x2889('0xc'),auth[_0x2889('0x7')](),controller[_0x2889('0xd')]);router[_0x2889('0x6')](_0x2889('0xe'),auth['isAuthenticated'](),controller[_0x2889('0xf')]);router[_0x2889('0x6')]('/:id/logo',controller[_0x2889('0x10')]);router['get'](_0x2889('0x11'),controller[_0x2889('0x12')]);router[_0x2889('0x6')](_0x2889('0x13'),controller[_0x2889('0x14')]);router[_0x2889('0x6')]('/:id/system_avatar',controller[_0x2889('0x15')]);router['get'](_0x2889('0x16'),auth[_0x2889('0x7')](),controller[_0x2889('0x17')]);router[_0x2889('0x6')](_0x2889('0x18'),controller[_0x2889('0x19')]);router[_0x2889('0x6')](_0x2889('0x1a'),auth['isAuthenticated'](),controller[_0x2889('0x1b')]);router['get'](_0x2889('0x1c'),auth[_0x2889('0x7')](),controller[_0x2889('0x1d')]);router[_0x2889('0x6')](_0x2889('0x1e'),controller[_0x2889('0x1f')]);router[_0x2889('0x6')](_0x2889('0x20'),auth[_0x2889('0x7')](),controller['getOfflineMessages']);router[_0x2889('0x6')](_0x2889('0x21'),auth[_0x2889('0x7')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x2889('0x22')]);router[_0x2889('0x23')](_0x2889('0xc'),auth[_0x2889('0x7')](),controller[_0x2889('0x24')]);router[_0x2889('0x23')]('/:id/canned_answers',auth[_0x2889('0x7')](),controller[_0x2889('0x25')]);var upload=multer({'storage':multer[_0x2889('0x26')]({'destination':function(_0x4bf5ae,_0x42a30e,_0x507685){_0x507685(null,path[_0x2889('0x27')](config[_0x2889('0x28')],_0x2889('0x29')));},'filename':function(_0x3cb503,_0x3e3054,_0x16d4ac){_0x16d4ac(null,util[_0x2889('0x2a')](_0x2889('0x2b'),Date[_0x2889('0x2c')](),_0x3e3054[_0x2889('0x2d')]));}})});router[_0x2889('0x23')](_0x2889('0x2e'),upload[_0x2889('0x2f')](_0x2889('0x30')),controller[_0x2889('0x31')]);var upload=multer({'storage':multer[_0x2889('0x26')]({'destination':function(_0x5271f5,_0x28a30d,_0x21e5cb){_0x21e5cb(null,path['join'](config['root'],_0x2889('0x32')));},'filename':function(_0x512dc4,_0x825e16,_0x58c558){_0x58c558(null,util[_0x2889('0x2a')](_0x2889('0x2b'),Date[_0x2889('0x2c')](),_0x825e16['originalname']));}})});router[_0x2889('0x23')]('/:id/avatar',upload['single'](_0x2889('0x30')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2889('0x26')]({'destination':function(_0x5220b6,_0x475580,_0x50a208){_0x50a208(null,path['join'](config['root'],_0x2889('0x32')));},'filename':function(_0x36f0f3,_0x51d4cd,_0x5effe3){_0x5effe3(null,util['format']('%s-%s',Date[_0x2889('0x2c')](),_0x51d4cd[_0x2889('0x2d')]));}})});router[_0x2889('0x23')](_0x2889('0x13'),upload[_0x2889('0x2f')](_0x2889('0x30')),controller[_0x2889('0x33')]);var upload=multer({'storage':multer[_0x2889('0x26')]({'destination':function(_0x118b29,_0x3c74cd,_0x198a23){_0x198a23(null,path[_0x2889('0x27')](config[_0x2889('0x28')],'server/files/images/avatars/'));},'filename':function(_0x3dfae6,_0x37f741,_0x202817){_0x202817(null,util['format']('%s-%s',Date[_0x2889('0x2c')](),_0x37f741[_0x2889('0x2d')]));}})});router['post'](_0x2889('0x34'),upload[_0x2889('0x2f')](_0x2889('0x30')),controller[_0x2889('0x35')]);router[_0x2889('0x23')](_0x2889('0x36'),controller[_0x2889('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x2889('0x26')]({'destination':function(_0xeb3198,_0x1ed55b,_0xb4192c){const _0x139f02=path['join'](config[_0x2889('0x28')],_0x2889('0x38'),_0x2889('0x39'),_0x2889('0x3a'));fs_extra[_0x2889('0x3b')](_0x139f02,function(){_0xb4192c(null,_0x139f02);});},'filename':function(_0x1fe11b,_0x17a5dc,_0x55b42e){const _0x1abd70=_0x17a5dc['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x494d57=path[_0x2889('0x3c')](_0x1abd70);const _0xb064d=Date[_0x2889('0x2c')]()+'-'+_0x1abd70[_0x2889('0x3d')](_0x494d57,'')+_0x494d57;_0x55b42e(null,_0xb064d);}})});router['post'](_0x2889('0x3e'),offlineUploadMulter[_0x2889('0x3f')](),controller[_0x2889('0x40')]);router[_0x2889('0x23')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x2889('0x41')]);router[_0x2889('0x23')]('/:id/applications',auth[_0x2889('0x7')](),controller[_0x2889('0x42')]);router['post'](_0x2889('0x1c'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x2889('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x2889('0x43')]);router['put'](_0x2889('0xa'),auth['isAuthenticated'](),controller[_0x2889('0x44')]);router['delete'](_0x2889('0xa'),auth[_0x2889('0x7')](),controller[_0x2889('0x45')]);router['delete'](_0x2889('0xc'),auth[_0x2889('0x7')](),controller[_0x2889('0x46')]);router[_0x2889('0x47')](_0x2889('0xe'),auth['isAuthenticated'](),controller[_0x2889('0x48')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x2889('0x49')]);module[_0x2889('0x4a')]=router; \ No newline at end of file +var _0x0a07=['create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','file','server/files/images/avatars/','single','/:id/customer_avatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post'];(function(_0x2dde26,_0x30ddaa){var _0x4e05de=function(_0xfe222e){while(--_0xfe222e){_0x2dde26['push'](_0x2dde26['shift']());}};_0x4e05de(++_0x30ddaa);}(_0x0a07,0x13b));var _0x70a0=function(_0x1423e6,_0x164fe9){_0x1423e6=_0x1423e6-0x0;var _0x2a5341=_0x0a07[_0x1423e6];return _0x2a5341;};'use strict';var multer=require(_0x70a0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x70a0('0x1'));var router=express['Router']();var fs_extra=require(_0x70a0('0x2'));var auth=require(_0x70a0('0x3'));var interaction=require(_0x70a0('0x4'));var config=require('../../config/environment');var controller=require(_0x70a0('0x5'));router[_0x70a0('0x6')]('/',auth[_0x70a0('0x7')](),controller[_0x70a0('0x8')]);router['get'](_0x70a0('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x70a0('0x6')](_0x70a0('0xa'),auth['isAuthenticated'](),controller[_0x70a0('0xb')]);router[_0x70a0('0x6')](_0x70a0('0xc'),auth[_0x70a0('0x7')](),controller[_0x70a0('0xd')]);router[_0x70a0('0x6')](_0x70a0('0xe'),auth[_0x70a0('0x7')](),controller[_0x70a0('0xf')]);router[_0x70a0('0x6')]('/:id/logo',controller[_0x70a0('0x10')]);router[_0x70a0('0x6')](_0x70a0('0x11'),controller[_0x70a0('0x12')]);router['get']('/:id/customer_avatar',controller[_0x70a0('0x13')]);router[_0x70a0('0x6')](_0x70a0('0x14'),controller[_0x70a0('0x15')]);router[_0x70a0('0x6')](_0x70a0('0x16'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x17')]);router[_0x70a0('0x6')](_0x70a0('0x18'),controller[_0x70a0('0x19')]);router[_0x70a0('0x6')](_0x70a0('0x1a'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x1b')]);router['get'](_0x70a0('0x1c'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x1d')]);router['get'](_0x70a0('0x1e'),controller[_0x70a0('0x1f')]);router[_0x70a0('0x6')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x70a0('0x6')](_0x70a0('0x20'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x21')]);router[_0x70a0('0x22')]('/',auth[_0x70a0('0x7')](),controller[_0x70a0('0x23')]);router[_0x70a0('0x22')](_0x70a0('0xc'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x24')]);router[_0x70a0('0x22')](_0x70a0('0xe'),auth[_0x70a0('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0x4687b7,_0x13d925,_0x1dc93c){_0x1dc93c(null,path[_0x70a0('0x26')](config[_0x70a0('0x27')],_0x70a0('0x28')));},'filename':function(_0xd9951a,_0x348bb8,_0x5eae64){_0x5eae64(null,util[_0x70a0('0x29')](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0x348bb8[_0x70a0('0x2c')]));}})});router[_0x70a0('0x22')](_0x70a0('0x2d'),upload['single'](_0x70a0('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0xba70be,_0x46a3af,_0x40292d){_0x40292d(null,path[_0x70a0('0x26')](config['root'],_0x70a0('0x2f')));},'filename':function(_0x4c17fd,_0xb3f363,_0x2f1ce1){_0x2f1ce1(null,util[_0x70a0('0x29')](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0xb3f363[_0x70a0('0x2c')]));}})});router[_0x70a0('0x22')](_0x70a0('0x11'),upload[_0x70a0('0x30')](_0x70a0('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x549b48,_0x18907a,_0x312488){_0x312488(null,path[_0x70a0('0x26')](config[_0x70a0('0x27')],_0x70a0('0x2f')));},'filename':function(_0x240105,_0x5c2b6c,_0x3fc085){_0x3fc085(null,util['format'](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0x5c2b6c['originalname']));}})});router[_0x70a0('0x22')](_0x70a0('0x31'),upload[_0x70a0('0x30')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0x3c1619,_0x5ed8bc,_0x1eb55d){_0x1eb55d(null,path[_0x70a0('0x26')](config['root'],_0x70a0('0x2f')));},'filename':function(_0x199a6f,_0x2e6676,_0x34f9e5){_0x34f9e5(null,util[_0x70a0('0x29')](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0x2e6676['originalname']));}})});router[_0x70a0('0x22')]('/:id/system_avatar',upload[_0x70a0('0x30')]('file'),controller[_0x70a0('0x32')]);router[_0x70a0('0x22')]('/:id/notify',controller[_0x70a0('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0x4e5f06,_0xf67276,_0x1eb46a){const _0x5501bb=path[_0x70a0('0x26')](config[_0x70a0('0x27')],_0x70a0('0x34'),'attachments',_0x70a0('0x35'));fs_extra[_0x70a0('0x36')](_0x5501bb,function(){_0x1eb46a(null,_0x5501bb);});},'filename':function(_0x1d9945,_0x1a4ce9,_0x55d7e6){const _0x3a5be7=_0x1a4ce9[_0x70a0('0x2c')][_0x70a0('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2bc976=path[_0x70a0('0x38')](_0x3a5be7);const _0x548cdd=Date[_0x70a0('0x2b')]()+'-'+_0x3a5be7[_0x70a0('0x37')](_0x2bc976,'')+_0x2bc976;_0x55d7e6(null,_0x548cdd);}})});router['post'](_0x70a0('0x39'),offlineUploadMulter[_0x70a0('0x3a')](),controller['offline']);router[_0x70a0('0x22')](_0x70a0('0x16'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x70a0('0x22')](_0x70a0('0x1a'),auth['isAuthenticated'](),controller[_0x70a0('0x3b')]);router['post'](_0x70a0('0x1c'),auth['isAuthenticated'](),controller[_0x70a0('0x3c')]);router[_0x70a0('0x22')]('/:id/users',auth[_0x70a0('0x7')](),controller[_0x70a0('0x3d')]);router[_0x70a0('0x3e')](_0x70a0('0xa'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x3f')]);router[_0x70a0('0x40')](_0x70a0('0xa'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x41')]);router['delete']('/:id/dispositions',auth[_0x70a0('0x7')](),controller[_0x70a0('0x42')]);router[_0x70a0('0x40')](_0x70a0('0xe'),auth['isAuthenticated'](),controller[_0x70a0('0x43')]);router[_0x70a0('0x40')]('/:id/users',auth['isAuthenticated'](),controller[_0x70a0('0x44')]);module[_0x70a0('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 12e7812..b2d4dfa 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 _0x0327=['app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x0327,0x18f));var _0x7032=function(_0xec0852,_0x2232e7){_0xec0852=_0xec0852-0x0;var _0x5d2b68=_0x0327[_0xec0852];return _0x5d2b68;};var beaverLogger=require(_0x7032('0x0'));var express=require(_0x7032('0x1'));var auth=require(_0x7032('0x2'));var config=require(_0x7032('0x3'));var router=express[_0x7032('0x4')]();var isProduction=config[_0x7032('0x5')]===_0x7032('0x6')||![];function clientSideLogs(_0x54b339,_0x1d650a,_0x515a96){var _0x446dec=_0x54b339[_0x7032('0x7')][_0x7032('0x8')]('client-side-logger');if(!_0x446dec){throw new Error(_0x7032('0x9'));}return beaverLogger[_0x7032('0xa')]({'uri':_0x7032('0xb'),'logger':_0x446dec,'enableCors':!isProduction})(_0x54b339,_0x1d650a,_0x515a96);}router[_0x7032('0xc')](auth['isAuthenticated'](),clientSideLogs);module[_0x7032('0xd')]=router; \ No newline at end of file +var _0x9657=['env','app','get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router'];(function(_0x1b3761,_0x54b964){var _0x147d69=function(_0x3fa4fb){while(--_0x3fa4fb){_0x1b3761['push'](_0x1b3761['shift']());}};_0x147d69(++_0x54b964);}(_0x9657,0x167));var _0x7965=function(_0x2119ae,_0x3757a5){_0x2119ae=_0x2119ae-0x0;var _0x4d5811=_0x9657[_0x2119ae];return _0x4d5811;};var beaverLogger=require(_0x7965('0x0'));var express=require(_0x7965('0x1'));var auth=require(_0x7965('0x2'));var config=require(_0x7965('0x3'));var router=express[_0x7965('0x4')]();var isProduction=config[_0x7965('0x5')]==='production'||![];function clientSideLogs(_0x5270c4,_0x39aad7,_0x5e32bd){var _0x686954=_0x5270c4[_0x7965('0x6')][_0x7965('0x7')](_0x7965('0x8'));if(!_0x686954){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x7965('0x9')]({'uri':'/client-logs','logger':_0x686954,'enableCors':!isProduction})(_0x5270c4,_0x39aad7,_0x5e32bd);}router[_0x7965('0xa')](auth[_0x7965('0xb')](),clientSideLogs);module[_0x7965('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index bbc38a2..ca0f4d0 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 _0x3229=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','MicrosoftAzure'];(function(_0x34ce29,_0x534037){var _0x5b4d28=function(_0x5327b0){while(--_0x5327b0){_0x34ce29['push'](_0x34ce29['shift']());}};_0x5b4d28(++_0x534037);}(_0x3229,0xc8));var _0x9322=function(_0x43f772,_0x5482ac){_0x43f772=_0x43f772-0x0;var _0x57bdc4=_0x3229[_0x43f772];return _0x57bdc4;};'use strict';var Sequelize=require('sequelize');module[_0x9322('0x0')]={'name':{'type':Sequelize[_0x9322('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9322('0x2')]('AmazonAWS','Google',_0x9322('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x9322('0x4'),_0x9322('0x5'))},'data1':{'type':Sequelize[_0x9322('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x9322('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x9322('0x6')},'data4':{'type':Sequelize['STRING'],'comment':_0x9322('0x7')},'data5':{'type':Sequelize[_0x9322('0x8')],'comment':_0x9322('0x9')},'data6':{'type':Sequelize[_0x9322('0x8')],'comment':_0x9322('0xa')},'data7':{'type':Sequelize[_0x9322('0x8')],'comment':_0x9322('0xb')}}; \ No newline at end of file +var _0x12cc=['MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','Google'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x12cc,0x80));var _0xc12c=function(_0x325ffc,_0x105c82){_0x325ffc=_0x325ffc-0x0;var _0x91fa5=_0x12cc[_0x325ffc];return _0x91fa5;};'use strict';var Sequelize=require('sequelize');module[_0xc12c('0x0')]={'name':{'type':Sequelize[_0xc12c('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc12c('0x2')]('AmazonAWS',_0xc12c('0x3'),_0xc12c('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc12c('0x2')](_0xc12c('0x5'),_0xc12c('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xc12c('0x1')],'comment':_0xc12c('0x7')},'data3':{'type':Sequelize[_0xc12c('0x1')],'comment':_0xc12c('0x8')},'data4':{'type':Sequelize[_0xc12c('0x1')],'comment':_0xc12c('0x9')},'data5':{'type':Sequelize[_0xc12c('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xc12c('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0xc12c('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 7316919..8b1fcf7 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 _0x168a=['getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','error','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','offset','limit','count','set','json','update','then','destroy','name','padEnd','slice','index','map','CloudProvider','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','include','findAll','rows','service','decryptString','data3','catch','show','params','keys','includeAll','options','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','find','oauth2MicrosoftAuthorize','findOne','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del'];(function(_0x157267,_0x48378c){var _0x5f1562=function(_0x3e9524){while(--_0x3e9524){_0x157267['push'](_0x157267['shift']());}};_0x5f1562(++_0x48378c);}(_0x168a,0x167));var _0xa168=function(_0x52e191,_0x491651){_0x52e191=_0x52e191-0x0;var _0x3e1e46=_0x168a[_0x52e191];return _0x3e1e46;};'use strict';var _=require(_0xa168('0x0'));var Redis=require(_0xa168('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xa168('0x2'));var config=require(_0xa168('0x3'));var logger=require(_0xa168('0x4'))(_0xa168('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xa168('0x6'));config[_0xa168('0x7')]=_['defaults'](config[_0xa168('0x7')],{'host':_0xa168('0x8'),'port':0x18eb});var socket=require(_0xa168('0x9'))(new Redis(config[_0xa168('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x3ce048,_0x54479b){_0x54479b=_0x54479b||0xcc;return function(_0x2216c4){if(_0x2216c4){return _0x3ce048[_0xa168('0xa')](_0x54479b);}return _0x3ce048[_0xa168('0xb')](_0x54479b)['end']();};}function respondWithResult(_0x35b6d6,_0x3f9512){_0x3f9512=_0x3f9512||0xc8;return function(_0x2d5727){if(_0x2d5727){return _0x35b6d6[_0xa168('0xb')](_0x3f9512)['json'](_0x2d5727);}};}function respondWithFilteredResult(_0x25123d,_0x1771d9){return function(_0x45cfcb){if(_0x45cfcb){var _0x15ebf8=typeof _0x1771d9[_0xa168('0xc')]==='undefined'&&typeof _0x1771d9[_0xa168('0xd')]==='undefined';var _0x5b0fc9=_0x45cfcb[_0xa168('0xe')];var _0x13189a=_0x15ebf8?0x0:_0x1771d9['offset'];var _0x36b271=_0x15ebf8?_0x45cfcb[_0xa168('0xe')]:_0x1771d9['offset']+_0x1771d9[_0xa168('0xd')];var _0x3552f1;if(_0x36b271>=_0x5b0fc9){_0x36b271=_0x5b0fc9;_0x3552f1=0xc8;}else{_0x3552f1=0xce;}_0x25123d[_0xa168('0xb')](_0x3552f1);return _0x25123d[_0xa168('0xf')]('Content-Range',_0x13189a+'-'+_0x36b271+'/'+_0x5b0fc9)[_0xa168('0x10')](_0x45cfcb);}return null;};}function saveUpdates(_0xd51557){return function(_0x3516f4){if(_0x3516f4){return _0x3516f4[_0xa168('0x11')](_0xd51557)[_0xa168('0x12')](function(_0x39abcb){return _0x39abcb;});}return null;};}function removeEntity(_0x42cfd5){return function(_0x267c59){if(_0x267c59){return _0x267c59[_0xa168('0x13')]()[_0xa168('0x12')](function(){_0x42cfd5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f70cd){return function(_0x370ae7){if(!_0x370ae7){_0x2f70cd['sendStatus'](0x194);}return _0x370ae7;};}function handleError(_0x26443e,_0x28bd51){_0x28bd51=_0x28bd51||0x1f4;return function(_0x497b09){logger['error'](_0x497b09['stack']);if(_0x497b09['name']){delete _0x497b09[_0xa168('0x14')];}_0x26443e[_0xa168('0xb')](_0x28bd51)['send'](_0x497b09);};}function maskClientSecret(_0x558aeb){return _[_0xa168('0x15')](_0x558aeb[_0xa168('0x16')](0x0,0x3),0x14,'*');}exports[_0xa168('0x17')]=function(_0x404813,_0x3df380){var _0x5b40e3={},_0x3ecc48={},_0x5349d8={'count':0x0,'rows':[]};var _0xdf44d1=_[_0xa168('0x18')](db[_0xa168('0x19')]['rawAttributes'],function(_0x29603){return{'name':_0x29603[_0xa168('0x1a')],'type':_0x29603[_0xa168('0x1b')][_0xa168('0x1c')]};});_0x3ecc48[_0xa168('0x1d')]=_['map'](_0xdf44d1,_0xa168('0x14'));_0x3ecc48['query']=_['keys'](_0x404813[_0xa168('0x1e')]);_0x3ecc48[_0xa168('0x1f')]=_[_0xa168('0x20')](_0x3ecc48[_0xa168('0x1d')],_0x3ecc48[_0xa168('0x1e')]);_0x5b40e3['attributes']=_[_0xa168('0x20')](_0x3ecc48['model'],qs[_0xa168('0x21')](_0x404813[_0xa168('0x1e')][_0xa168('0x21')]));_0x5b40e3[_0xa168('0x22')]=_0x5b40e3[_0xa168('0x22')][_0xa168('0x23')]?_0x5b40e3[_0xa168('0x22')]:_0x3ecc48[_0xa168('0x1d')];if(!_0x404813[_0xa168('0x1e')][_0xa168('0x24')]('nolimit')){_0x5b40e3[_0xa168('0xd')]=qs[_0xa168('0xd')](_0x404813[_0xa168('0x1e')][_0xa168('0xd')]);_0x5b40e3[_0xa168('0xc')]=qs['offset'](_0x404813[_0xa168('0x1e')][_0xa168('0xc')]);}_0x5b40e3['order']=qs[_0xa168('0x25')](_0x404813['query'][_0xa168('0x25')]);_0x5b40e3[_0xa168('0x26')]=qs[_0xa168('0x1f')](_['pick'](_0x404813[_0xa168('0x1e')],_0x3ecc48[_0xa168('0x1f')]),_0xdf44d1);if(_0x404813[_0xa168('0x1e')][_0xa168('0x27')]){_0x5b40e3[_0xa168('0x26')]=_[_0xa168('0x28')](_0x5b40e3['where'],{'$or':_[_0xa168('0x18')](_0xdf44d1,function(_0x5251dd){if(_0x5251dd[_0xa168('0x1b')]!=='VIRTUAL'){var _0x3d7712={};_0x3d7712[_0x5251dd[_0xa168('0x14')]]={'$like':'%'+_0x404813['query']['filter']+'%'};return _0x3d7712;}})});}_0x5b40e3=_['merge']({},_0x5b40e3,_0x404813['options']);var _0x5d4942={'where':_0x5b40e3['where']};return db['CloudProvider'][_0xa168('0xe')](_0x5d4942)[_0xa168('0x12')](function(_0x1c9829){_0x5349d8[_0xa168('0xe')]=_0x1c9829;if(_0x404813[_0xa168('0x1e')]['includeAll']){_0x5b40e3[_0xa168('0x29')]=[{'all':!![]}];}return db['CloudProvider'][_0xa168('0x2a')](_0x5b40e3);})['then'](function(_0x28b584){_0x5349d8[_0xa168('0x2b')]=_[_0xa168('0x18')](_0x28b584,function(_0x43abf2){if(_0x43abf2[_0xa168('0x2c')]==='MicrosoftAzure'){var _0x4eff6e=encryptor[_0xa168('0x2d')](_0x43abf2[_0xa168('0x2e')]);_0x43abf2[_0xa168('0x2e')]=maskClientSecret(_0x4eff6e);}return _0x43abf2;});return _0x5349d8;})[_0xa168('0x12')](respondWithFilteredResult(_0x3df380,_0x5b40e3))[_0xa168('0x2f')](handleError(_0x3df380,null));};exports[_0xa168('0x30')]=function(_0x4925f5,_0x3010df){var _0x310751={'raw':!![],'where':{'id':_0x4925f5[_0xa168('0x31')]['id']}},_0x1b2970={};_0x1b2970['model']=_[_0xa168('0x32')](db[_0xa168('0x19')]['rawAttributes']);_0x1b2970[_0xa168('0x1e')]=_[_0xa168('0x32')](_0x4925f5['query']);_0x1b2970[_0xa168('0x1f')]=_['intersection'](_0x1b2970[_0xa168('0x1d')],_0x1b2970['query']);_0x310751['attributes']=_[_0xa168('0x20')](_0x1b2970[_0xa168('0x1d')],qs[_0xa168('0x21')](_0x4925f5[_0xa168('0x1e')][_0xa168('0x21')]));_0x310751[_0xa168('0x22')]=_0x310751[_0xa168('0x22')][_0xa168('0x23')]?_0x310751[_0xa168('0x22')]:_0x1b2970[_0xa168('0x1d')];if(_0x4925f5[_0xa168('0x1e')][_0xa168('0x33')]){_0x310751[_0xa168('0x29')]=[{'all':!![]}];}_0x310751=_[_0xa168('0x28')]({},_0x310751,_0x4925f5[_0xa168('0x34')]);return db['CloudProvider']['find'](_0x310751)[_0xa168('0x12')](handleEntityNotFound(_0x3010df,null))['then'](function(_0xd66ae5){if(_0xd66ae5[_0xa168('0x2c')]===_0xa168('0x35')){var _0x2f9ec9=encryptor[_0xa168('0x2d')](_0xd66ae5[_0xa168('0x2e')]);_0xd66ae5[_0xa168('0x2e')]=maskClientSecret(_0x2f9ec9);}return _0xd66ae5;})[_0xa168('0x12')](respondWithResult(_0x3010df,null))['catch'](handleError(_0x3010df,null));};exports[_0xa168('0x36')]=function(_0x1ac24d,_0x367565){if(!_0x1ac24d[_0xa168('0x37')][_0xa168('0x14')])throw new Error(_0xa168('0x38'));if(!_0x1ac24d[_0xa168('0x37')]['service'])throw new Error(_0xa168('0x39'));var _0x1f9ee1=db['CloudProvider']['rawAttributes']['service'][_0xa168('0x3a')];if(!_0x1f9ee1[_0xa168('0x3b')](_0x1ac24d['body'][_0xa168('0x2c')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x1f9ee1[_0xa168('0x3c')](',\x20'));if(_0x1ac24d[_0xa168('0x37')][_0xa168('0x2c')]==='MicrosoftAzure'&&_0x1ac24d[_0xa168('0x37')]['data3']){_0x1ac24d['body'][_0xa168('0x2e')]=encryptor[_0xa168('0x3d')](_0x1ac24d[_0xa168('0x37')][_0xa168('0x2e')]);}return db[_0xa168('0x19')][_0xa168('0x36')](_0x1ac24d[_0xa168('0x37')],{})[_0xa168('0x12')](respondWithResult(_0x367565,0xc9))[_0xa168('0x2f')](handleError(_0x367565,null));};exports[_0xa168('0x11')]=function(_0x7b7eb6,_0x13a2b0){if(_0x7b7eb6[_0xa168('0x37')]['id']){delete _0x7b7eb6[_0xa168('0x37')]['id'];}return db[_0xa168('0x19')]['find']({'where':{'id':_0x7b7eb6[_0xa168('0x31')]['id']}})['then'](handleEntityNotFound(_0x13a2b0,null))[_0xa168('0x12')](function(_0x3cea2d){if(_0x3cea2d[_0xa168('0x2c')]===_0xa168('0x35')&&_0x7b7eb6[_0xa168('0x37')]['data3']){_0x7b7eb6[_0xa168('0x37')][_0xa168('0x2e')]=encryptor[_0xa168('0x3d')](_0x7b7eb6[_0xa168('0x37')][_0xa168('0x2e')]);}return _0x3cea2d;})[_0xa168('0x12')](saveUpdates(_0x7b7eb6['body'],null))[_0xa168('0x12')](respondWithResult(_0x13a2b0,null))[_0xa168('0x2f')](handleError(_0x13a2b0,null));};exports[_0xa168('0x13')]=function(_0xa6e8c7,_0x6979c2){return db['CloudProvider'][_0xa168('0x3e')]({'where':{'id':_0xa6e8c7[_0xa168('0x31')]['id']}})[_0xa168('0x12')](handleEntityNotFound(_0x6979c2,null))[_0xa168('0x12')](removeEntity(_0x6979c2,null))[_0xa168('0x2f')](handleError(_0x6979c2,null));};exports[_0xa168('0x3f')]=function(_0x5d8629,_0x1a9f1f){return db[_0xa168('0x19')][_0xa168('0x40')]({'where':{'id':_0x5d8629[_0xa168('0x31')]['id']},'raw':!![]})[_0xa168('0x12')](function(_0xecc5c5){if(!_0xecc5c5)return _0x1a9f1f[_0xa168('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xecc5c5,_0x5d8629['user']['id'])};})[_0xa168('0x12')](respondWithResult(_0x1a9f1f,null))['catch'](handleError(_0x1a9f1f,null));};exports['oauth2MicrosoftCallback']=function(_0x4ec9fc,_0x2d47a1){var _0x283267=_0x4ec9fc[_0xa168('0x37')];var _0x7750d3;var _0x42e3de;if(_0x283267['error'])throw _0x283267;redis[_0xa168('0x41')](_0x283267[_0xa168('0x42')])['then'](function(_0x398eef){if(!_0x398eef)throw new Error(_0xa168('0x43'));_0x7750d3=JSON[_0xa168('0x44')](_0x398eef);var _0x26044c=Buffer[_0xa168('0x45')](_0x283267[_0xa168('0x42')],_0xa168('0x46'))['toString'](_0xa168('0x47'));_0x42e3de=JSON[_0xa168('0x44')](_0x26044c);if(!oauth[_0xa168('0x48')](_0x283267['id_token'],_0x7750d3[_0xa168('0x49')]))throw new Error(_0xa168('0x4a'));redis[_0xa168('0x4b')](_0x283267['state']);return oauth[_0xa168('0x4c')](_0x283267[_0xa168('0x4d')],_0x7750d3);})[_0xa168('0x12')](function(_0x141634){_0x7750d3[_0xa168('0x4e')]=_0x141634[_0xa168('0x4f')];_0x7750d3[_0xa168('0x50')]=_0x141634[_0xa168('0x51')];return db[_0xa168('0x19')][_0xa168('0x11')]({'data5':_0x7750d3[_0xa168('0x4e')],'data6':_0x7750d3[_0xa168('0x50')]},{'where':{'id':_0x7750d3['id']}});})[_0xa168('0x12')](function(){oauth['startRefreshInterval'](_0x7750d3);socket['emit']('microsoftAuthorization:success',{'id':_0x42e3de['id']});return;})[_0xa168('0x12')](respondWithStatusCode(_0x2d47a1,null))['catch'](function(_0x36a49b){if(_0x42e3de){socket[_0xa168('0x52')]('microsoftAuthorization:error',{'id':_0x42e3de['id']});}if(!_0x7750d3){logger[_0xa168('0x53')]('Invalid\x20authentication\x20state\x20parameter',_0x36a49b);return _0x2d47a1[_0xa168('0xb')](0x1f4)[_0xa168('0x54')](_0x36a49b[_0xa168('0x55')]);}logger[_0xa168('0x53')](_0xa168('0x56'),_0x7750d3['id'],JSON['stringify'](_0x36a49b));});}; \ No newline at end of file +var _0x1438=['socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','destroy','then','error','stack','name','send','slice','map','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','CloudProvider','findAll','rows','service','decryptString','data3','catch','params','rawAttributes','include','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x1438,0xb6));var _0x8143=function(_0xacbfa5,_0xfe352){_0xacbfa5=_0xacbfa5-0x0;var _0x5a8a3d=_0x1438[_0xacbfa5];return _0x5a8a3d;};'use strict';var _=require(_0x8143('0x0'));var Redis=require('ioredis');var qs=require(_0x8143('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x8143('0x2'));var logger=require(_0x8143('0x3'))(_0x8143('0x4'));var db=require(_0x8143('0x5'))['db'];var oauth=require(_0x8143('0x6'));config[_0x8143('0x7')]=_[_0x8143('0x8')](config[_0x8143('0x7')],{'host':_0x8143('0x9'),'port':0x18eb});var socket=require(_0x8143('0xa'))(new Redis(config[_0x8143('0x7')]));var redis=new Redis(config[_0x8143('0x7')]);function respondWithStatusCode(_0x2ff159,_0x44f8a5){_0x44f8a5=_0x44f8a5||0xcc;return function(_0xc3ed6c){if(_0xc3ed6c){return _0x2ff159[_0x8143('0xb')](_0x44f8a5);}return _0x2ff159[_0x8143('0xc')](_0x44f8a5)[_0x8143('0xd')]();};}function respondWithResult(_0x2e4a37,_0x232a85){_0x232a85=_0x232a85||0xc8;return function(_0x15cc50){if(_0x15cc50){return _0x2e4a37[_0x8143('0xc')](_0x232a85)['json'](_0x15cc50);}};}function respondWithFilteredResult(_0x5ebb3b,_0x5bb370){return function(_0x2ed4fa){if(_0x2ed4fa){var _0x4b78d7=typeof _0x5bb370['offset']==='undefined'&&typeof _0x5bb370['limit']===_0x8143('0xe');var _0x3f3012=_0x2ed4fa[_0x8143('0xf')];var _0x5bd82a=_0x4b78d7?0x0:_0x5bb370[_0x8143('0x10')];var _0xe74e8b=_0x4b78d7?_0x2ed4fa[_0x8143('0xf')]:_0x5bb370[_0x8143('0x10')]+_0x5bb370[_0x8143('0x11')];var _0x26e40c;if(_0xe74e8b>=_0x3f3012){_0xe74e8b=_0x3f3012;_0x26e40c=0xc8;}else{_0x26e40c=0xce;}_0x5ebb3b['status'](_0x26e40c);return _0x5ebb3b[_0x8143('0x12')](_0x8143('0x13'),_0x5bd82a+'-'+_0xe74e8b+'/'+_0x3f3012)['json'](_0x2ed4fa);}return null;};}function saveUpdates(_0x13f6e4){return function(_0x11e78f){if(_0x11e78f){return _0x11e78f['update'](_0x13f6e4)['then'](function(_0x204e01){return _0x204e01;});}return null;};}function removeEntity(_0x55df0b){return function(_0x1c8680){if(_0x1c8680){return _0x1c8680[_0x8143('0x14')]()[_0x8143('0x15')](function(){_0x55df0b[_0x8143('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24534c){return function(_0x34e4a4){if(!_0x34e4a4){_0x24534c[_0x8143('0xb')](0x194);}return _0x34e4a4;};}function handleError(_0x470f29,_0x543b79){_0x543b79=_0x543b79||0x1f4;return function(_0x3f5bf5){logger[_0x8143('0x16')](_0x3f5bf5[_0x8143('0x17')]);if(_0x3f5bf5[_0x8143('0x18')]){delete _0x3f5bf5[_0x8143('0x18')];}_0x470f29[_0x8143('0xc')](_0x543b79)[_0x8143('0x19')](_0x3f5bf5);};}function maskClientSecret(_0x76230f){return _['padEnd'](_0x76230f[_0x8143('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x163026,_0x336b3d){var _0xa18cc6={},_0x300b59={},_0x138721={'count':0x0,'rows':[]};var _0x4f3894=_[_0x8143('0x1b')](db['CloudProvider']['rawAttributes'],function(_0x4b29c8){return{'name':_0x4b29c8['fieldName'],'type':_0x4b29c8['type'][_0x8143('0x1c')]};});_0x300b59[_0x8143('0x1d')]=_['map'](_0x4f3894,'name');_0x300b59[_0x8143('0x1e')]=_[_0x8143('0x1f')](_0x163026[_0x8143('0x1e')]);_0x300b59[_0x8143('0x20')]=_[_0x8143('0x21')](_0x300b59[_0x8143('0x1d')],_0x300b59[_0x8143('0x1e')]);_0xa18cc6['attributes']=_[_0x8143('0x21')](_0x300b59[_0x8143('0x1d')],qs[_0x8143('0x22')](_0x163026[_0x8143('0x1e')]['fields']));_0xa18cc6[_0x8143('0x23')]=_0xa18cc6[_0x8143('0x23')][_0x8143('0x24')]?_0xa18cc6[_0x8143('0x23')]:_0x300b59[_0x8143('0x1d')];if(!_0x163026[_0x8143('0x1e')][_0x8143('0x25')](_0x8143('0x26'))){_0xa18cc6[_0x8143('0x11')]=qs['limit'](_0x163026['query'][_0x8143('0x11')]);_0xa18cc6[_0x8143('0x10')]=qs[_0x8143('0x10')](_0x163026[_0x8143('0x1e')][_0x8143('0x10')]);}_0xa18cc6['order']=qs['sort'](_0x163026[_0x8143('0x1e')][_0x8143('0x27')]);_0xa18cc6[_0x8143('0x28')]=qs[_0x8143('0x20')](_[_0x8143('0x29')](_0x163026['query'],_0x300b59[_0x8143('0x20')]),_0x4f3894);if(_0x163026['query'][_0x8143('0x2a')]){_0xa18cc6[_0x8143('0x28')]=_['merge'](_0xa18cc6[_0x8143('0x28')],{'$or':_[_0x8143('0x1b')](_0x4f3894,function(_0x56e65e){if(_0x56e65e[_0x8143('0x2b')]!==_0x8143('0x2c')){var _0x2382d9={};_0x2382d9[_0x56e65e[_0x8143('0x18')]]={'$like':'%'+_0x163026[_0x8143('0x1e')]['filter']+'%'};return _0x2382d9;}})});}_0xa18cc6=_[_0x8143('0x2d')]({},_0xa18cc6,_0x163026[_0x8143('0x2e')]);var _0x171bed={'where':_0xa18cc6[_0x8143('0x28')]};return db[_0x8143('0x2f')]['count'](_0x171bed)[_0x8143('0x15')](function(_0x1dcafa){_0x138721[_0x8143('0xf')]=_0x1dcafa;if(_0x163026[_0x8143('0x1e')]['includeAll']){_0xa18cc6['include']=[{'all':!![]}];}return db[_0x8143('0x2f')][_0x8143('0x30')](_0xa18cc6);})[_0x8143('0x15')](function(_0x367d54){_0x138721[_0x8143('0x31')]=_[_0x8143('0x1b')](_0x367d54,function(_0x2b6f03){if(_0x2b6f03[_0x8143('0x32')]==='MicrosoftAzure'){var _0x2715ba=encryptor[_0x8143('0x33')](_0x2b6f03[_0x8143('0x34')]);_0x2b6f03['data3']=maskClientSecret(_0x2715ba);}return _0x2b6f03;});return _0x138721;})['then'](respondWithFilteredResult(_0x336b3d,_0xa18cc6))[_0x8143('0x35')](handleError(_0x336b3d,null));};exports['show']=function(_0x279f63,_0x28f8df){var _0x3377e4={'raw':!![],'where':{'id':_0x279f63[_0x8143('0x36')]['id']}},_0x2701b6={};_0x2701b6[_0x8143('0x1d')]=_[_0x8143('0x1f')](db[_0x8143('0x2f')][_0x8143('0x37')]);_0x2701b6[_0x8143('0x1e')]=_[_0x8143('0x1f')](_0x279f63[_0x8143('0x1e')]);_0x2701b6['filters']=_['intersection'](_0x2701b6[_0x8143('0x1d')],_0x2701b6[_0x8143('0x1e')]);_0x3377e4[_0x8143('0x23')]=_['intersection'](_0x2701b6[_0x8143('0x1d')],qs[_0x8143('0x22')](_0x279f63[_0x8143('0x1e')][_0x8143('0x22')]));_0x3377e4['attributes']=_0x3377e4[_0x8143('0x23')][_0x8143('0x24')]?_0x3377e4['attributes']:_0x2701b6['model'];if(_0x279f63[_0x8143('0x1e')]['includeAll']){_0x3377e4[_0x8143('0x38')]=[{'all':!![]}];}_0x3377e4=_[_0x8143('0x2d')]({},_0x3377e4,_0x279f63[_0x8143('0x2e')]);return db[_0x8143('0x2f')][_0x8143('0x39')](_0x3377e4)['then'](handleEntityNotFound(_0x28f8df,null))[_0x8143('0x15')](function(_0x5a5b83){if(_0x5a5b83[_0x8143('0x32')]===_0x8143('0x3a')){var _0x1caddf=encryptor[_0x8143('0x33')](_0x5a5b83[_0x8143('0x34')]);_0x5a5b83[_0x8143('0x34')]=maskClientSecret(_0x1caddf);}return _0x5a5b83;})[_0x8143('0x15')](respondWithResult(_0x28f8df,null))['catch'](handleError(_0x28f8df,null));};exports[_0x8143('0x3b')]=function(_0x559925,_0x43af86){if(!_0x559925[_0x8143('0x3c')]['name'])throw new Error(_0x8143('0x3d'));if(!_0x559925[_0x8143('0x3c')][_0x8143('0x32')])throw new Error(_0x8143('0x3e'));var _0x58437f=db['CloudProvider'][_0x8143('0x37')][_0x8143('0x32')][_0x8143('0x3f')];if(!_0x58437f['includes'](_0x559925['body'][_0x8143('0x32')]))throw new Error(_0x8143('0x40')+_0x58437f[_0x8143('0x41')](',\x20'));if(_0x559925['body'][_0x8143('0x32')]===_0x8143('0x3a')&&_0x559925[_0x8143('0x3c')]['data3']){_0x559925[_0x8143('0x3c')][_0x8143('0x34')]=encryptor[_0x8143('0x42')](_0x559925[_0x8143('0x3c')]['data3']);}return db['CloudProvider'][_0x8143('0x3b')](_0x559925[_0x8143('0x3c')],{})[_0x8143('0x15')](respondWithResult(_0x43af86,0xc9))[_0x8143('0x35')](handleError(_0x43af86,null));};exports['update']=function(_0x4d8645,_0x36af9c){if(_0x4d8645[_0x8143('0x3c')]['id']){delete _0x4d8645['body']['id'];}return db['CloudProvider']['find']({'where':{'id':_0x4d8645[_0x8143('0x36')]['id']}})['then'](handleEntityNotFound(_0x36af9c,null))[_0x8143('0x15')](function(_0x2394aa){if(_0x2394aa['service']===_0x8143('0x3a')&&_0x4d8645['body']['data3']){_0x4d8645['body'][_0x8143('0x34')]=encryptor[_0x8143('0x42')](_0x4d8645[_0x8143('0x3c')][_0x8143('0x34')]);}return _0x2394aa;})['then'](saveUpdates(_0x4d8645[_0x8143('0x3c')],null))[_0x8143('0x15')](respondWithResult(_0x36af9c,null))[_0x8143('0x35')](handleError(_0x36af9c,null));};exports[_0x8143('0x14')]=function(_0x554a5d,_0x13c8cf){return db['CloudProvider'][_0x8143('0x39')]({'where':{'id':_0x554a5d[_0x8143('0x36')]['id']}})[_0x8143('0x15')](handleEntityNotFound(_0x13c8cf,null))[_0x8143('0x15')](removeEntity(_0x13c8cf,null))[_0x8143('0x35')](handleError(_0x13c8cf,null));};exports[_0x8143('0x43')]=function(_0x1c6296,_0x104c7b){return db[_0x8143('0x2f')][_0x8143('0x44')]({'where':{'id':_0x1c6296[_0x8143('0x36')]['id']},'raw':!![]})[_0x8143('0x15')](function(_0x1d290b){if(!_0x1d290b)return _0x104c7b[_0x8143('0xb')](0x194);return{'url':oauth[_0x8143('0x45')](_0x1d290b,_0x1c6296[_0x8143('0x46')]['id'])};})[_0x8143('0x15')](respondWithResult(_0x104c7b,null))[_0x8143('0x35')](handleError(_0x104c7b,null));};exports['oauth2MicrosoftCallback']=function(_0x3b1962,_0x4396bb){var _0x4014d9=_0x3b1962[_0x8143('0x3c')];var _0x1e7425;var _0x18e804;if(_0x4014d9['error'])throw _0x4014d9;redis[_0x8143('0x47')](_0x4014d9[_0x8143('0x48')])[_0x8143('0x15')](function(_0x42a6c9){if(!_0x42a6c9)throw new Error(_0x8143('0x49'));_0x1e7425=JSON[_0x8143('0x4a')](_0x42a6c9);var _0x287447=Buffer[_0x8143('0x4b')](_0x4014d9[_0x8143('0x48')],_0x8143('0x4c'))[_0x8143('0x4d')](_0x8143('0x4e'));_0x18e804=JSON[_0x8143('0x4a')](_0x287447);if(!oauth[_0x8143('0x4f')](_0x4014d9['id_token'],_0x1e7425[_0x8143('0x50')]))throw new Error(_0x8143('0x51'));redis[_0x8143('0x52')](_0x4014d9[_0x8143('0x48')]);return oauth[_0x8143('0x53')](_0x4014d9[_0x8143('0x54')],_0x1e7425);})[_0x8143('0x15')](function(_0x3c034d){_0x1e7425[_0x8143('0x55')]=_0x3c034d[_0x8143('0x56')];_0x1e7425['data6']=_0x3c034d[_0x8143('0x57')];return db[_0x8143('0x2f')]['update']({'data5':_0x1e7425[_0x8143('0x55')],'data6':_0x1e7425[_0x8143('0x58')]},{'where':{'id':_0x1e7425['id']}});})[_0x8143('0x15')](function(){oauth[_0x8143('0x59')](_0x1e7425);socket[_0x8143('0x5a')](_0x8143('0x5b'),{'id':_0x18e804['id']});return;})[_0x8143('0x15')](respondWithStatusCode(_0x4396bb,null))['catch'](function(_0x15d5da){if(_0x18e804){socket[_0x8143('0x5a')](_0x8143('0x5c'),{'id':_0x18e804['id']});}if(!_0x1e7425){logger[_0x8143('0x16')](_0x8143('0x5d'),_0x15d5da);return _0x4396bb['status'](0x1f4)[_0x8143('0x19')](_0x15d5da['message']);}logger['error'](_0x8143('0x5e'),_0x1e7425['id'],JSON[_0x8143('0x5f')](_0x15d5da));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 6f3d4f2..8fb1f0a 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 _0xd37f=['define','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports'];(function(_0x1c4e3e,_0x438c66){var _0x42caa4=function(_0x4a0fbb){while(--_0x4a0fbb){_0x1c4e3e['push'](_0x1c4e3e['shift']());}};_0x42caa4(++_0x438c66);}(_0xd37f,0x1d0));var _0xfd37=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xd37f[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xfd37('0x0'));var util=require('util');var logger=require(_0xfd37('0x1'))(_0xfd37('0x2'));var moment=require('moment');var BPromise=require(_0xfd37('0x3'));var rp=require(_0xfd37('0x4'));var fs=require('fs');var path=require(_0xfd37('0x5'));var rimraf=require(_0xfd37('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd37('0x7'));module[_0xfd37('0x8')]=function(_0x372a2a,_0x4e8133){return _0x372a2a[_0xfd37('0x9')]('CloudProvider',attributes,{'tableName':_0xfd37('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e4b=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','path'];(function(_0x17fc3e,_0x196b84){var _0x35341a=function(_0x68b1e1){while(--_0x68b1e1){_0x17fc3e['push'](_0x17fc3e['shift']());}};_0x35341a(++_0x196b84);}(_0x6e4b,0x192));var _0xb6e4=function(_0x1d8fba,_0x529150){_0x1d8fba=_0x1d8fba-0x0;var _0xfc4196=_0x6e4b[_0x1d8fba];return _0xfc4196;};'use strict';var _=require(_0xb6e4('0x0'));var util=require(_0xb6e4('0x1'));var logger=require(_0xb6e4('0x2'))(_0xb6e4('0x3'));var moment=require(_0xb6e4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6e4('0x5'));var rimraf=require('rimraf');var config=require(_0xb6e4('0x6'));var attributes=require(_0xb6e4('0x7'));module[_0xb6e4('0x8')]=function(_0x276b95,_0x407130){return _0x276b95[_0xb6e4('0x9')](_0xb6e4('0xa'),attributes,{'tableName':_0xb6e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 3a4dcdd..33d0e78 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 _0x68d0=['issuer','aud','audience','isAfter','exp','resolve','then','CloudProvider','refresh_token','data6','data4','decryptString','data3','POST','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','bind','intervals','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','join','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','set','payload','iss'];(function(_0x5b1b8e,_0x5d60ca){var _0x329c4f=function(_0x555bec){while(--_0x555bec){_0x5b1b8e['push'](_0x5b1b8e['shift']());}};_0x329c4f(++_0x5d60ca);}(_0x68d0,0x14d));var _0x068d=function(_0x2fadb7,_0x12cc6d){_0x2fadb7=_0x2fadb7-0x0;var _0x21c656=_0x68d0[_0x2fadb7];return _0x21c656;};'use strict';var _=require(_0x068d('0x0'));var crypto=require(_0x068d('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x068d('0x2'));var Redis=require('ioredis');var rp=require(_0x068d('0x3'));var util=require(_0x068d('0x4'));var encryptor=require(_0x068d('0x5'));var config=require(_0x068d('0x6'));var logger=require(_0x068d('0x7'))('api');var schedule=require(_0x068d('0x8'));var db=require('../../mysqldb')['db'];config[_0x068d('0x9')]=_[_0x068d('0xa')](config[_0x068d('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x068d('0x9')]);var MICROSOFT_AUTH_URL=_0x068d('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x068d('0xc'),_0x068d('0xd'),_0x068d('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x068d('0xf'),_0x068d('0x10')],'Dynamics365':[_0x068d('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x068d('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x068d('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x18618d){var _0x201dae=_[_0x068d('0x13')](AZURE_AUTH_SCOPES[_0x18618d['type']]);if(_0x18618d[_0x068d('0x14')]==='Dynamics365')_0x201dae['push'](_0x18618d[_0x068d('0x15')]+_0x068d('0x16'));return _0x201dae['join']('\x20');}function getAccessTokenScope(_0x57e761){if(_0x57e761[_0x068d('0x14')]===_0x068d('0x17'))return _0x068d('0x18');if(_0x57e761[_0x068d('0x14')]===_0x068d('0x19'))return _0x57e761[_0x068d('0x15')]+_0x068d('0x16');}function generateMicrosoftAuthorizationUrl(_0x577126,_0x270f80){var _0x1c93bf=MICROSOFT_AUTH_URL[_0x068d('0x1a')](_0x068d('0x1b'),_0x577126[_0x068d('0x1c')]);var _0x491471=['code',_0x068d('0x1d')];var _0xbf3358=Buffer[_0x068d('0x1e')](JSON[_0x068d('0x1f')]({'id':_0x270f80}))[_0x068d('0x20')](_0x068d('0x21'));var _0x517b62=crypto[_0x068d('0x22')](0x10)['toString'](_0x068d('0x23'));var _0x2db622=getAuthorizationScopes(_0x577126);var _0x1f7213=[{'key':_0x068d('0x24'),'value':_0x577126[_0x068d('0x25')]},{'key':_0x068d('0x26'),'value':encodeURIComponent(_0x491471[_0x068d('0x27')]('\x20'))},{'key':'redirect_uri','value':_0x577126['data4']},{'key':'response_mode','value':_0x068d('0x28')},{'key':_0x068d('0x29'),'value':encodeURIComponent(_0x2db622)},{'key':_0x068d('0x2a'),'value':_0xbf3358},{'key':_0x068d('0x2b'),'value':_0x517b62},{'key':_0x068d('0x2c'),'value':_0x068d('0x2d')}];var _0x21779b=_0x1c93bf+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x068d('0x13')](_0x1f7213,function(_0x54774f){return _0x54774f['key']+'='+_0x54774f[_0x068d('0x2e')];})[_0x068d('0x27')]('&');_0x577126[_0x068d('0x2f')]={'issuer':_0x1c93bf[_0x068d('0x1a')](_0x068d('0x30'),''),'audience':_0x577126[_0x068d('0x25')],'state':_0xbf3358,'nonce':_0x517b62};redis[_0x068d('0x31')](_0xbf3358,JSON[_0x068d('0x1f')](_0x577126));return _0x21779b;}function isValidIdToken(_0x5adabb,_0x4eefe2){try{var _0x4a5e26=jwt['decode'](_0x5adabb,{'complete':!![]});var _0x1b9f63=_0x4a5e26[_0x068d('0x32')];if(_0x1b9f63[_0x068d('0x33')]!==_0x4eefe2[_0x068d('0x34')])return![];if(_0x1b9f63[_0x068d('0x35')]!==_0x4eefe2[_0x068d('0x36')])return![];if(_0x1b9f63[_0x068d('0x2b')]!==_0x4eefe2[_0x068d('0x2b')])return![];if(moment()[_0x068d('0x37')](moment['unix'](_0x1b9f63[_0x068d('0x38')])))return![];return!![];}catch(_0x406ea1){throw _0x406ea1;}}function refreshOauth2MicrosoftAccessToken(_0x12c5a1){return Promise[_0x068d('0x39')]()[_0x068d('0x3a')](function(){if(_0x12c5a1['data3'])return _0x12c5a1;return db[_0x068d('0x3b')]['findOne']({'where':{'id':_0x12c5a1['id']},'raw':!![]});})['then'](function(_0x1a0f89){var _0x538c36={'grant_type':_0x068d('0x3c'),'refresh_token':_0x1a0f89[_0x068d('0x3d')],'scope':getAccessTokenScope(_0x1a0f89),'redirect_uri':_0x1a0f89[_0x068d('0x3e')],'client_id':_0x1a0f89[_0x068d('0x25')],'client_secret':encryptor[_0x068d('0x3f')](_0x1a0f89[_0x068d('0x40')])};var _0x323707={'method':_0x068d('0x41'),'uri':MICROSOFT_AUTH_URL[_0x068d('0x1a')]('{TENANT_ID}',_0x1a0f89[_0x068d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x538c36,'json':!![]};return rp(_0x323707);})[_0x068d('0x3a')](function(_0x1e202d){_0x12c5a1['data5']=_0x1e202d['access_token'];_0x12c5a1[_0x068d('0x3d')]=_0x1e202d['refresh_token'];return db[_0x068d('0x3b')][_0x068d('0x42')]({'data5':_0x12c5a1['data5'],'data6':_0x12c5a1['data6']},{'where':{'id':_0x12c5a1['id']}});})[_0x068d('0x3a')](function(){return _0x12c5a1;})[_0x068d('0x43')](function(_0x2aff23){logger[_0x068d('0x44')](_0x068d('0x45'),_0x12c5a1['id'],_0x2aff23);});}function getOauth2MicrosoftAccessToken(_0x5ab5b1,_0x1045a3){var _0x58e583={'grant_type':_0x068d('0x46'),'code':_0x5ab5b1,'scope':getAccessTokenScope(_0x1045a3),'redirect_uri':_0x1045a3[_0x068d('0x3e')],'client_id':_0x1045a3[_0x068d('0x25')],'client_secret':encryptor[_0x068d('0x3f')](_0x1045a3['data3'])};var _0x310e70={'method':_0x068d('0x41'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x1045a3[_0x068d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x58e583,'json':!![]};return rp(_0x310e70);}function startRefreshInterval(_0x24e837){var _0x3284be=schedule['intervals'];if(_0x3284be[_0x24e837['id']])clearInterval(_0x3284be[_0x24e837['id']]);_0x3284be[_0x24e837['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x068d('0x47')](this,{'id':_0x24e837['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x068d('0x48')]=_0x3284be;}function startAllRefreshIntervals(){return db[_0x068d('0x3b')][_0x068d('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x068d('0x3a')](function(_0x2c8d03){var _0x127291=_0x2c8d03[_0x068d('0x13')](function(_0x50574a){return refreshOauth2MicrosoftAccessToken(_0x50574a)[_0x068d('0x3a')](function(_0x39362a){startRefreshInterval(_0x39362a);});});return Promise['all'](_0x127291);})[_0x068d('0x43')](function(_0xf03da6){var _0x5265ea=_0xf03da6?util[_0x068d('0x4a')](_0xf03da6,{'showHidden':![],'depth':null}):'';logger['error'](_0x068d('0x4b'),_0x5265ea);});}module[_0x068d('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x97b8=['findOne','refresh_token','data6','decryptString','data5','access_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','map','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','id_token','stringify','toString','base64','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','state','nonce','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','aud','isAfter','unix','exp','resolve','then','data3','CloudProvider'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x97b8,0x1eb));var _0x897b=function(_0x14f08a,_0x125286){_0x14f08a=_0x14f08a-0x0;var _0x448ac8=_0x97b8[_0x14f08a];return _0x448ac8;};'use strict';var _=require('lodash');var crypto=require(_0x897b('0x0'));var jwt=require(_0x897b('0x1'));var moment=require(_0x897b('0x2'));var Redis=require(_0x897b('0x3'));var rp=require('request-promise');var util=require(_0x897b('0x4'));var encryptor=require(_0x897b('0x5'));var config=require(_0x897b('0x6'));var logger=require(_0x897b('0x7'))(_0x897b('0x8'));var schedule=require(_0x897b('0x9'));var db=require('../../mysqldb')['db'];config[_0x897b('0xa')]=_[_0x897b('0xb')](config[_0x897b('0xa')],{'host':_0x897b('0xc'),'port':0x18eb});var redis=new Redis(config[_0x897b('0xa')]);var MICROSOFT_AUTH_URL=_0x897b('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x897b('0xe'),_0x897b('0xf'),_0x897b('0x10'),_0x897b('0x11'),_0x897b('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x897b('0x13')],'Dynamics365':[_0x897b('0xe'),_0x897b('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x897b('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x897b('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x48c909){var _0x296e92=_['map'](AZURE_AUTH_SCOPES[_0x48c909[_0x897b('0x16')]]);if(_0x48c909['type']===_0x897b('0x17'))_0x296e92[_0x897b('0x18')](_0x48c909[_0x897b('0x19')]+_0x897b('0x1a'));return _0x296e92[_0x897b('0x1b')]('\x20');}function getAccessTokenScope(_0x56fda1){if(_0x56fda1[_0x897b('0x16')]===_0x897b('0x1c'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x56fda1['type']==='Dynamics365')return _0x56fda1[_0x897b('0x19')]+_0x897b('0x1a');}function generateMicrosoftAuthorizationUrl(_0x146426,_0x5cc574){var _0x2100e6=MICROSOFT_AUTH_URL[_0x897b('0x1d')](_0x897b('0x1e'),_0x146426[_0x897b('0x1f')]);var _0x4f5ce8=['code',_0x897b('0x20')];var _0x298bdd=Buffer['from'](JSON[_0x897b('0x21')]({'id':_0x5cc574}))[_0x897b('0x22')](_0x897b('0x23'));var _0x449981=crypto['randomBytes'](0x10)[_0x897b('0x22')](_0x897b('0x24'));var _0x4409ab=getAuthorizationScopes(_0x146426);var _0x57152f=[{'key':_0x897b('0x25'),'value':_0x146426[_0x897b('0x26')]},{'key':_0x897b('0x27'),'value':encodeURIComponent(_0x4f5ce8[_0x897b('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x146426[_0x897b('0x28')]},{'key':_0x897b('0x29'),'value':_0x897b('0x2a')},{'key':_0x897b('0x2b'),'value':encodeURIComponent(_0x4409ab)},{'key':_0x897b('0x2c'),'value':_0x298bdd},{'key':_0x897b('0x2d'),'value':_0x449981},{'key':'prompt','value':'login'}];var _0x3c6b1f=_0x2100e6+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x57152f,function(_0x7a1d57){return _0x7a1d57[_0x897b('0x2e')]+'='+_0x7a1d57[_0x897b('0x2f')];})[_0x897b('0x1b')]('&');_0x146426[_0x897b('0x30')]={'issuer':_0x2100e6['replace'](_0x897b('0x31'),''),'audience':_0x146426[_0x897b('0x26')],'state':_0x298bdd,'nonce':_0x449981};redis[_0x897b('0x32')](_0x298bdd,JSON['stringify'](_0x146426));return _0x3c6b1f;}function isValidIdToken(_0x560598,_0x161593){try{var _0x497d96=jwt[_0x897b('0x33')](_0x560598,{'complete':!![]});var _0x3a8ec5=_0x497d96[_0x897b('0x34')];if(_0x3a8ec5[_0x897b('0x35')]!==_0x161593['issuer'])return![];if(_0x3a8ec5[_0x897b('0x36')]!==_0x161593['audience'])return![];if(_0x3a8ec5[_0x897b('0x2d')]!==_0x161593[_0x897b('0x2d')])return![];if(moment()[_0x897b('0x37')](moment[_0x897b('0x38')](_0x3a8ec5[_0x897b('0x39')])))return![];return!![];}catch(_0xb19836){throw _0xb19836;}}function refreshOauth2MicrosoftAccessToken(_0x17fc51){return Promise[_0x897b('0x3a')]()[_0x897b('0x3b')](function(){if(_0x17fc51[_0x897b('0x3c')])return _0x17fc51;return db[_0x897b('0x3d')][_0x897b('0x3e')]({'where':{'id':_0x17fc51['id']},'raw':!![]});})[_0x897b('0x3b')](function(_0x499955){var _0x49755c={'grant_type':_0x897b('0x3f'),'refresh_token':_0x499955[_0x897b('0x40')],'scope':getAccessTokenScope(_0x499955),'redirect_uri':_0x499955[_0x897b('0x28')],'client_id':_0x499955[_0x897b('0x26')],'client_secret':encryptor[_0x897b('0x41')](_0x499955[_0x897b('0x3c')])};var _0xe1d4a4={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x897b('0x1d')]('{TENANT_ID}',_0x499955[_0x897b('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x49755c,'json':!![]};return rp(_0xe1d4a4);})['then'](function(_0x234361){_0x17fc51[_0x897b('0x42')]=_0x234361[_0x897b('0x43')];_0x17fc51[_0x897b('0x40')]=_0x234361[_0x897b('0x3f')];return db['CloudProvider'][_0x897b('0x44')]({'data5':_0x17fc51[_0x897b('0x42')],'data6':_0x17fc51[_0x897b('0x40')]},{'where':{'id':_0x17fc51['id']}});})[_0x897b('0x3b')](function(){return _0x17fc51;})['catch'](function(_0x3fa75b){logger['error'](_0x897b('0x45'),_0x17fc51['id'],_0x3fa75b);});}function getOauth2MicrosoftAccessToken(_0x3be814,_0x22e299){var _0x38a2aa={'grant_type':_0x897b('0x46'),'code':_0x3be814,'scope':getAccessTokenScope(_0x22e299),'redirect_uri':_0x22e299[_0x897b('0x28')],'client_id':_0x22e299[_0x897b('0x26')],'client_secret':encryptor[_0x897b('0x41')](_0x22e299['data3'])};var _0x23c4f3={'method':_0x897b('0x47'),'uri':MICROSOFT_AUTH_URL[_0x897b('0x1d')](_0x897b('0x1e'),_0x22e299[_0x897b('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x38a2aa,'json':!![]};return rp(_0x23c4f3);}function startRefreshInterval(_0x547789){var _0x4908ed=schedule[_0x897b('0x48')];if(_0x4908ed[_0x547789['id']])clearInterval(_0x4908ed[_0x547789['id']]);_0x4908ed[_0x547789['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x897b('0x49')](this,{'id':_0x547789['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4908ed;}function startAllRefreshIntervals(){return db[_0x897b('0x3d')][_0x897b('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x897b('0x3b')](function(_0x2e6e1e){var _0x36bbe2=_0x2e6e1e[_0x897b('0x4b')](function(_0x4703bc){return refreshOauth2MicrosoftAccessToken(_0x4703bc)[_0x897b('0x3b')](function(_0x33ce86){startRefreshInterval(_0x33ce86);});});return Promise[_0x897b('0x4c')](_0x36bbe2);})['catch'](function(_0x3301a7){var _0x3acee4=_0x3301a7?util['inspect'](_0x3301a7,{'showHidden':![],'depth':null}):'';logger[_0x897b('0x4d')](_0x897b('0x4e'),_0x3acee4);});}module['exports']={'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 b83f08b..85b112b 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 _0xd509=['request','then','info','debug','request\x20sent','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x512e47,_0xe98b90){var _0x1313ae=function(_0x3b8a00){while(--_0x3b8a00){_0x512e47['push'](_0x512e47['shift']());}};_0x1313ae(++_0xe98b90);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d50('0x0'));var BPromise=require(_0x9d50('0x1'));var rs=require(_0x9d50('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9d50('0x3'));var logger=require(_0x9d50('0x4'))('rpc');var config=require(_0x9d50('0x5'));var jayson=require(_0x9d50('0x6'));var client=jayson[_0x9d50('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x907927,_0x57ca79,_0x427cee){return new BPromise(function(_0x9b5ecd,_0x2f7c2f){return client[_0x9d50('0x8')](_0x907927,_0x427cee)[_0x9d50('0x9')](function(_0x5380be){logger[_0x9d50('0xa')]('CloudProvider,\x20%s,\x20%s',_0x57ca79,'request\x20sent');logger[_0x9d50('0xb')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x57ca79,_0x9d50('0xc'),JSON[_0x9d50('0xd')](_0x5380be));if(_0x5380be[_0x9d50('0xe')]){if(_0x5380be[_0x9d50('0xe')][_0x9d50('0xf')]===0x1f4){logger[_0x9d50('0xe')](_0x9d50('0x10'),_0x57ca79,_0x5380be['error'][_0x9d50('0x11')]);return _0x2f7c2f(_0x5380be['error'][_0x9d50('0x11')]);}logger[_0x9d50('0xe')](_0x9d50('0x10'),_0x57ca79,_0x5380be[_0x9d50('0xe')][_0x9d50('0x11')]);return _0x9b5ecd(_0x5380be[_0x9d50('0xe')][_0x9d50('0x11')]);}else{logger[_0x9d50('0xa')](_0x9d50('0x10'),_0x57ca79,_0x9d50('0xc'));_0x9b5ecd(_0x5380be[_0x9d50('0x12')][_0x9d50('0x11')]);}})['catch'](function(_0x12d178){logger[_0x9d50('0xe')](_0x9d50('0x10'),_0x57ca79,_0x12d178);_0x2f7c2f(_0x12d178);});});} \ No newline at end of file +var _0xbd8e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbd8e[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xebd8('0x0'));var util=require(_0xebd8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xebd8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebd8('0x3'))['db'];var utils=require(_0xebd8('0x4'));var logger=require(_0xebd8('0x5'))(_0xebd8('0x6'));var config=require(_0xebd8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xebd8('0x8')][_0xebd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f2b2e,_0x3740bd,_0x3b92b9){return new BPromise(function(_0x4ac0d0,_0x19c8ee){return client[_0xebd8('0xa')](_0x3f2b2e,_0x3b92b9)[_0xebd8('0xb')](function(_0x13afa5){logger['info']('CloudProvider,\x20%s,\x20%s',_0x3740bd,'request\x20sent');logger[_0xebd8('0xc')](_0xebd8('0xd'),_0x3740bd,_0xebd8('0xe'),JSON[_0xebd8('0xf')](_0x13afa5));if(_0x13afa5[_0xebd8('0x10')]){if(_0x13afa5['error'][_0xebd8('0x11')]===0x1f4){logger['error'](_0xebd8('0x12'),_0x3740bd,_0x13afa5[_0xebd8('0x10')]['message']);return _0x19c8ee(_0x13afa5[_0xebd8('0x10')][_0xebd8('0x13')]);}logger[_0xebd8('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3740bd,_0x13afa5[_0xebd8('0x10')]['message']);return _0x4ac0d0(_0x13afa5[_0xebd8('0x10')]['message']);}else{logger['info'](_0xebd8('0x12'),_0x3740bd,_0xebd8('0xe'));_0x4ac0d0(_0x13afa5[_0xebd8('0x14')][_0xebd8('0x13')]);}})[_0xebd8('0x15')](function(_0x2b6ac4){logger[_0xebd8('0x10')](_0xebd8('0x12'),_0x3740bd,_0x2b6ac4);_0x19c8ee(_0x2b6ac4);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index e5f5b39..0eba535 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x7a54,0x106));var _0x47a5=function(_0x5e0a72,_0x4a3e8b){_0x5e0a72=_0x5e0a72-0x0;var _0x114f21=_0x7a54[_0x5e0a72];return _0x114f21;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x561bfe,_0x1324f6){var _0x30281d=function(_0x3145c9){while(--_0x3145c9){_0x561bfe['push'](_0x561bfe['shift']());}};_0x30281d(++_0x1324f6);}(_0xadb5,0xad));var _0x5adb=function(_0x1d8f49,_0x4d145e){_0x1d8f49=_0x1d8f49-0x0;var _0x23a0fc=_0xadb5[_0x1d8f49];return _0x23a0fc;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index b26be3c..2582528 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 _0x447b=['sequelize','exports','name','STRING'];(function(_0x48483d,_0x2e5eaf){var _0x3b1f83=function(_0x4135e2){while(--_0x4135e2){_0x48483d['push'](_0x48483d['shift']());}};_0x3b1f83(++_0x2e5eaf);}(_0x447b,0xe4));var _0xb447=function(_0x184bb5,_0x4c6fb1){_0x184bb5=_0x184bb5-0x0;var _0x4250fa=_0x447b[_0x184bb5];return _0x4250fa;};'use strict';var Sequelize=require(_0xb447('0x0'));module[_0xb447('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb447('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb447('0x3')]},'companyId':{'type':Sequelize[_0xb447('0x3')]},'website':{'type':Sequelize[_0xb447('0x3')]},'phone':{'type':Sequelize[_0xb447('0x3')]},'fax':{'type':Sequelize[_0xb447('0x3')]},'type':{'type':Sequelize[_0xb447('0x3')]},'street':{'type':Sequelize[_0xb447('0x3')]},'postalCode':{'type':Sequelize[_0xb447('0x3')]},'city':{'type':Sequelize[_0xb447('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb447('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xb447('0x3')]},'sCity':{'type':Sequelize[_0xb447('0x3')]},'sCountry':{'type':Sequelize[_0xb447('0x3')]},'description':{'type':Sequelize[_0xb447('0x3')]}}; \ No newline at end of file +var _0x49d2=['exports','STRING','name','sequelize'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x49d2,0xa7));var _0x249d=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x49d2[_0x64aff8];return _0x5488a3;};'use strict';var Sequelize=require(_0x249d('0x0'));module[_0x249d('0x1')]={'name':{'type':Sequelize[_0x249d('0x2')],'unique':_0x249d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x249d('0x2')]},'companyId':{'type':Sequelize[_0x249d('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x249d('0x2')]},'street':{'type':Sequelize[_0x249d('0x2')]},'postalCode':{'type':Sequelize[_0x249d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x249d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x249d('0x2')]},'sStreet':{'type':Sequelize[_0x249d('0x2')]},'sPostalCode':{'type':Sequelize[_0x249d('0x2')]},'sCity':{'type':Sequelize[_0x249d('0x2')]},'sCountry':{'type':Sequelize[_0x249d('0x2')]},'description':{'type':Sequelize[_0x249d('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 84087be..48a0fe9 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 _0xeaaf=['ids','getContacts','findOne','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','userProfileId','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContact','addContacts'];(function(_0x1a4979,_0x524bcf){var _0x2f6fec=function(_0x2ece47){while(--_0x2ece47){_0x1a4979['push'](_0x1a4979['shift']());}};_0x2f6fec(++_0x524bcf);}(_0xeaaf,0x106));var _0xfeaa=function(_0x5461e2,_0x53b497){_0x5461e2=_0x5461e2-0x0;var _0x3c12b4=_0xeaaf[_0x5461e2];return _0x3c12b4;};'use strict';var emlformat=require(_0xfeaa('0x0'));var rimraf=require(_0xfeaa('0x1'));var zipdir=require(_0xfeaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfeaa('0x3'));var moment=require(_0xfeaa('0x4'));var BPromise=require(_0xfeaa('0x5'));var Mustache=require(_0xfeaa('0x6'));var util=require(_0xfeaa('0x7'));var path=require(_0xfeaa('0x8'));var sox=require('sox');var csv=require(_0xfeaa('0x9'));var ejs=require(_0xfeaa('0xa'));var fs=require('fs');var fs_extra=require(_0xfeaa('0xb'));var _=require(_0xfeaa('0xc'));var squel=require(_0xfeaa('0xd'));var crypto=require('crypto');var jsforce=require(_0xfeaa('0xe'));var deskjs=require(_0xfeaa('0xf'));var toCsv=require(_0xfeaa('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfeaa('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfeaa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xfeaa('0x12'));var config=require(_0xfeaa('0x13'));var licenseUtil=require(_0xfeaa('0x14'));var db=require(_0xfeaa('0x15'))['db'];function respondWithStatusCode(_0x4f9496,_0x289d1b){_0x289d1b=_0x289d1b||0xcc;return function(_0x363bbc){if(_0x363bbc){return _0x4f9496[_0xfeaa('0x16')](_0x289d1b);}return _0x4f9496[_0xfeaa('0x17')](_0x289d1b)[_0xfeaa('0x18')]();};}function respondWithResult(_0x217df6,_0x245015){_0x245015=_0x245015||0xc8;return function(_0x20a016){if(_0x20a016){return _0x217df6[_0xfeaa('0x17')](_0x245015)['json'](_0x20a016);}};}function respondWithFilteredResult(_0x25ba88,_0x381235){return function(_0x29a466){if(_0x29a466){var _0x4694f3=typeof _0x381235[_0xfeaa('0x19')]===_0xfeaa('0x1a')&&typeof _0x381235[_0xfeaa('0x1b')]==='undefined';var _0x2bfdb1=_0x29a466['count'];var _0x2dd9e3=_0x4694f3?0x0:_0x381235[_0xfeaa('0x19')];var _0xca548d=_0x4694f3?_0x29a466['count']:_0x381235[_0xfeaa('0x19')]+_0x381235[_0xfeaa('0x1b')];var _0x570bc5;if(_0xca548d>=_0x2bfdb1){_0xca548d=_0x2bfdb1;_0x570bc5=0xc8;}else{_0x570bc5=0xce;}_0x25ba88['status'](_0x570bc5);return _0x25ba88[_0xfeaa('0x1c')](_0xfeaa('0x1d'),_0x2dd9e3+'-'+_0xca548d+'/'+_0x2bfdb1)['json'](_0x29a466);}return null;};}function patchUpdates(_0x2c4ca6){return function(_0x2f4a94){try{jsonpatch[_0xfeaa('0x1e')](_0x2f4a94,_0x2c4ca6,!![]);}catch(_0x2bf833){return BPromise[_0xfeaa('0x1f')](_0x2bf833);}return _0x2f4a94[_0xfeaa('0x20')]();};}function saveUpdates(_0xe56192,_0x3392cd){return function(_0x43acd2){if(_0x43acd2){return _0x43acd2[_0xfeaa('0x21')](_0xe56192)[_0xfeaa('0x22')](function(_0x562905){return _0x562905;});}return null;};}function removeEntity(_0x50921e,_0x4e459b){return function(_0x505c35){if(_0x505c35){return _0x505c35[_0xfeaa('0x23')]()[_0xfeaa('0x22')](function(){var _0x2c39e0=_0x505c35[_0xfeaa('0x24')]({'plain':!![]});var _0x517e4a='Companies';return db['UserProfileResource'][_0xfeaa('0x23')]({'where':{'type':_0x517e4a,'resourceId':_0x2c39e0['id']}})['then'](function(){return _0x505c35;});})['then'](function(){_0x50921e[_0xfeaa('0x17')](0xcc)[_0xfeaa('0x18')]();});}};}function handleEntityNotFound(_0x4e4f94,_0x381fdf){return function(_0x465aa9){if(!_0x465aa9){_0x4e4f94[_0xfeaa('0x16')](0x194);}return _0x465aa9;};}function handleError(_0x427f65,_0x38adc8){_0x38adc8=_0x38adc8||0x1f4;return function(_0x419e2b){logger[_0xfeaa('0x25')](_0x419e2b['stack']);if(_0x419e2b['name']){delete _0x419e2b['name'];}_0x427f65[_0xfeaa('0x17')](_0x38adc8)[_0xfeaa('0x26')](_0x419e2b);};}exports[_0xfeaa('0x27')]=function(_0x4c50c5,_0x487101){var _0xd5caad={},_0x528383={},_0x227f84={'count':0x0,'rows':[]};return db[_0xfeaa('0x28')][_0xfeaa('0x29')]()['then'](function(_0x4ad27e){_0x528383['model']=_[_0xfeaa('0x2a')](_0x4ad27e);_0x528383['query']=_[_0xfeaa('0x2a')](_0x4c50c5[_0xfeaa('0x2b')]);_0x528383[_0xfeaa('0x2c')]=_[_0xfeaa('0x2d')](_0x528383[_0xfeaa('0x2e')],_0x528383[_0xfeaa('0x2b')]);_0xd5caad[_0xfeaa('0x2f')]=_[_0xfeaa('0x2d')](_0x528383['model'],qs[_0xfeaa('0x30')](_0x4c50c5['query'][_0xfeaa('0x30')]));_0xd5caad[_0xfeaa('0x2f')]=_0xd5caad[_0xfeaa('0x2f')]['length']?_0xd5caad[_0xfeaa('0x2f')]:_0x528383[_0xfeaa('0x2e')];if(!_0x4c50c5['query'][_0xfeaa('0x31')](_0xfeaa('0x32'))){_0xd5caad['limit']=qs[_0xfeaa('0x1b')](_0x4c50c5[_0xfeaa('0x2b')][_0xfeaa('0x1b')]);_0xd5caad['offset']=qs[_0xfeaa('0x19')](_0x4c50c5['query'][_0xfeaa('0x19')]);}_0xd5caad[_0xfeaa('0x33')]=qs[_0xfeaa('0x34')](_0x4c50c5[_0xfeaa('0x2b')]['sort']);_0xd5caad['where']=qs['filters'](_[_0xfeaa('0x35')](_0x4c50c5['query'],_0x528383[_0xfeaa('0x2c')]),_0x4ad27e);if(_0x4c50c5[_0xfeaa('0x2b')]['filter']){_0xd5caad[_0xfeaa('0x36')]=_[_0xfeaa('0x37')](_0xd5caad[_0xfeaa('0x36')],{'$or':_['map'](_0xd5caad['attributes'],function(_0x363d1c){var _0x1a90f1={};_0x1a90f1[_0x363d1c]={'$like':'%'+_0x4c50c5[_0xfeaa('0x2b')][_0xfeaa('0x38')]+'%'};return _0x1a90f1;})});}_0xd5caad=_['merge']({},_0xd5caad,_0x4c50c5[_0xfeaa('0x39')]);var _0x47aa96={'where':_0xd5caad[_0xfeaa('0x36')]};return db[_0xfeaa('0x28')][_0xfeaa('0x3a')](_0x47aa96)['then'](function(_0x16629c){_0x227f84[_0xfeaa('0x3a')]=_0x16629c;if(_0x4c50c5[_0xfeaa('0x2b')][_0xfeaa('0x3b')]){_0xd5caad[_0xfeaa('0x3c')]=[{'all':!![]}];}return db[_0xfeaa('0x28')][_0xfeaa('0x3d')](_0xd5caad);})[_0xfeaa('0x22')](function(_0x1faae8){_0x227f84[_0xfeaa('0x3e')]=_0x1faae8;return _0x227f84;})[_0xfeaa('0x22')](respondWithFilteredResult(_0x487101,_0xd5caad))[_0xfeaa('0x3f')](handleError(_0x487101,null));})['catch'](handleError(_0x487101,null));};exports[_0xfeaa('0x40')]=function(_0x12ed73,_0x341833){var _0x286093={'raw':![],'where':{'id':_0x12ed73[_0xfeaa('0x41')]['id']}},_0x9a8ee7={};_0x9a8ee7[_0xfeaa('0x2e')]=_[_0xfeaa('0x2a')](db[_0xfeaa('0x28')][_0xfeaa('0x42')]);_0x9a8ee7['query']=_[_0xfeaa('0x2a')](_0x12ed73[_0xfeaa('0x2b')]);_0x9a8ee7[_0xfeaa('0x2c')]=_[_0xfeaa('0x2d')](_0x9a8ee7[_0xfeaa('0x2e')],_0x9a8ee7[_0xfeaa('0x2b')]);_0x286093['attributes']=_[_0xfeaa('0x2d')](_0x9a8ee7[_0xfeaa('0x2e')],qs[_0xfeaa('0x30')](_0x12ed73[_0xfeaa('0x2b')][_0xfeaa('0x30')]));_0x286093['attributes']=_0x286093['attributes'][_0xfeaa('0x43')]?_0x286093[_0xfeaa('0x2f')]:_0x9a8ee7[_0xfeaa('0x2e')];if(_0x12ed73[_0xfeaa('0x2b')][_0xfeaa('0x3b')]){_0x286093[_0xfeaa('0x3c')]=[{'all':!![]}];}_0x286093=_[_0xfeaa('0x37')]({},_0x286093,_0x12ed73[_0xfeaa('0x39')]);return db[_0xfeaa('0x28')][_0xfeaa('0x44')](_0x286093)[_0xfeaa('0x22')](handleEntityNotFound(_0x341833,null))['then'](respondWithResult(_0x341833,null))[_0xfeaa('0x3f')](handleError(_0x341833,null));};exports[_0xfeaa('0x45')]=function(_0x57cf1a,_0x33cc09){return db[_0xfeaa('0x28')][_0xfeaa('0x45')](_0x57cf1a['body'],{})[_0xfeaa('0x22')](function(_0x527c70){var _0x25536b=_0x57cf1a[_0xfeaa('0x46')][_0xfeaa('0x24')]({'plain':!![]});if(!_0x25536b)throw new Error(_0xfeaa('0x47'));if(_0x25536b[_0xfeaa('0x48')]===_0xfeaa('0x46')){var _0x38dd73=_0x527c70[_0xfeaa('0x24')]({'plain':!![]});var _0x3feaef=_0xfeaa('0x49');return db['UserProfileSection'][_0xfeaa('0x44')]({'where':{'name':_0x3feaef,'userProfileId':_0x25536b[_0xfeaa('0x4a')]},'raw':!![]})[_0xfeaa('0x22')](function(_0x497596){if(_0x497596&&_0x497596[_0xfeaa('0x4b')]===0x0){return db[_0xfeaa('0x4c')][_0xfeaa('0x45')]({'name':_0x38dd73[_0xfeaa('0x4d')],'resourceId':_0x38dd73['id'],'type':_0x497596[_0xfeaa('0x4d')],'sectionId':_0x497596['id']},{})['then'](function(){return _0x527c70;});}else{return _0x527c70;}})[_0xfeaa('0x3f')](function(_0x561547){logger[_0xfeaa('0x25')](_0xfeaa('0x4e'),_0x561547);throw _0x561547;});}return _0x527c70;})[_0xfeaa('0x22')](respondWithResult(_0x33cc09,0xc9))[_0xfeaa('0x3f')](handleError(_0x33cc09,null));};exports['update']=function(_0x2a89d0,_0x38f218){if(_0x2a89d0[_0xfeaa('0x4f')]['id']){delete _0x2a89d0['body']['id'];}return db['CmCompany'][_0xfeaa('0x44')]({'where':{'id':_0x2a89d0[_0xfeaa('0x41')]['id']}})[_0xfeaa('0x22')](handleEntityNotFound(_0x38f218,null))[_0xfeaa('0x22')](saveUpdates(_0x2a89d0[_0xfeaa('0x4f')],null))[_0xfeaa('0x22')](respondWithResult(_0x38f218,null))[_0xfeaa('0x3f')](handleError(_0x38f218,null));};exports[_0xfeaa('0x23')]=function(_0x1a7b12,_0x56c60f){return db[_0xfeaa('0x28')][_0xfeaa('0x44')]({'where':{'id':_0x1a7b12[_0xfeaa('0x41')]['id']}})['then'](handleEntityNotFound(_0x56c60f,null))['then'](removeEntity(_0x56c60f,null))[_0xfeaa('0x3f')](handleError(_0x56c60f,null));};exports[_0xfeaa('0x29')]=function(_0x5967e3,_0x2ad02d){return db[_0xfeaa('0x28')][_0xfeaa('0x29')]()[_0xfeaa('0x22')](respondWithResult(_0x2ad02d,null))[_0xfeaa('0x3f')](handleError(_0x2ad02d,null));};exports['addContacts']=function(_0x36c836,_0x401091,_0x283934){return db[_0xfeaa('0x50')]['find']({'where':{'id':_0x36c836[_0xfeaa('0x41')]['id']}})[_0xfeaa('0x22')](handleEntityNotFound(_0x401091,null))[_0xfeaa('0x22')](function(_0x15c473){if(_0x15c473){return _0x15c473[_0xfeaa('0x51')](_0x36c836[_0xfeaa('0x4f')][_0xfeaa('0x52')],_['omit'](_0x36c836[_0xfeaa('0x4f')],[_0xfeaa('0x52'),'id'])||{});}})[_0xfeaa('0x22')](respondWithResult(_0x401091,null))[_0xfeaa('0x3f')](handleError(_0x401091,null));};exports[_0xfeaa('0x53')]=function(_0x7c9690,_0x45986a,_0xbbff2b){var _0x1daedd={};var _0x27a4df={};var _0x3ea081;var _0x3dee1b;return db[_0xfeaa('0x28')][_0xfeaa('0x54')]({'where':{'id':_0x7c9690['params']['id']}})[_0xfeaa('0x22')](handleEntityNotFound(_0x45986a,null))[_0xfeaa('0x22')](function(_0x2bbf7e){if(_0x2bbf7e){_0x3ea081=_0x2bbf7e;_0x27a4df[_0xfeaa('0x2e')]=_['keys'](db[_0xfeaa('0x50')][_0xfeaa('0x42')]);_0x27a4df['query']=_[_0xfeaa('0x2a')](_0x7c9690['query']);_0x27a4df[_0xfeaa('0x2c')]=_[_0xfeaa('0x2d')](_0x27a4df[_0xfeaa('0x2e')],_0x27a4df['query']);_0x1daedd[_0xfeaa('0x2f')]=_['intersection'](_0x27a4df['model'],qs[_0xfeaa('0x30')](_0x7c9690[_0xfeaa('0x2b')][_0xfeaa('0x30')]));_0x1daedd[_0xfeaa('0x2f')]=_0x1daedd['attributes'][_0xfeaa('0x43')]?_0x1daedd[_0xfeaa('0x2f')]:_0x27a4df[_0xfeaa('0x2e')];_0x1daedd[_0xfeaa('0x33')]=qs[_0xfeaa('0x34')](_0x7c9690[_0xfeaa('0x2b')][_0xfeaa('0x34')]);_0x1daedd['where']=qs[_0xfeaa('0x2c')](_[_0xfeaa('0x35')](_0x7c9690[_0xfeaa('0x2b')],_0x27a4df[_0xfeaa('0x2c')]));if(_0x7c9690[_0xfeaa('0x2b')][_0xfeaa('0x38')]){_0x1daedd[_0xfeaa('0x36')]=_[_0xfeaa('0x37')](_0x1daedd['where'],{'$or':_[_0xfeaa('0x55')](_0x1daedd['attributes'],function(_0x201648){var _0x576656={};_0x576656[_0x201648]={'$like':'%'+_0x7c9690[_0xfeaa('0x2b')][_0xfeaa('0x38')]+'%'};return _0x576656;})});}_0x1daedd=_[_0xfeaa('0x37')]({},_0x1daedd,_0x7c9690['options']);return _0x3ea081['getContacts'](_0x1daedd);}})[_0xfeaa('0x22')](function(_0x17d31e){if(_0x17d31e){_0x3dee1b=_0x17d31e['length'];if(!_0x7c9690[_0xfeaa('0x2b')][_0xfeaa('0x31')](_0xfeaa('0x32'))){_0x1daedd['limit']=qs['limit'](_0x7c9690[_0xfeaa('0x2b')][_0xfeaa('0x1b')]);_0x1daedd[_0xfeaa('0x19')]=qs[_0xfeaa('0x19')](_0x7c9690[_0xfeaa('0x2b')]['offset']);}return _0x3ea081[_0xfeaa('0x53')](_0x1daedd);}})[_0xfeaa('0x22')](function(_0x2c1da2){if(_0x2c1da2){return _0x2c1da2?{'count':_0x3dee1b,'rows':_0x2c1da2}:null;}})[_0xfeaa('0x22')](respondWithResult(_0x45986a,null))[_0xfeaa('0x3f')](handleError(_0x45986a,null));}; \ No newline at end of file +var _0x7acd=['reject','then','get','UserProfileResource','destroy','error','stack','name','send','index','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','addContacts','CmContact','ids','getContacts','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','fs-extra','lodash','squel','jsforce','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','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x7acd,0x11b));var _0xd7ac=function(_0x168f14,_0x518aba){_0x168f14=_0x168f14-0x0;var _0x542ae6=_0x7acd[_0x168f14];return _0x542ae6;};'use strict';var emlformat=require(_0xd7ac('0x0'));var rimraf=require(_0xd7ac('0x1'));var zipdir=require(_0xd7ac('0x2'));var jsonpatch=require(_0xd7ac('0x3'));var rp=require('request-promise');var moment=require(_0xd7ac('0x4'));var BPromise=require(_0xd7ac('0x5'));var Mustache=require('mustache');var util=require(_0xd7ac('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd7ac('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd7ac('0x8'));var _=require(_0xd7ac('0x9'));var squel=require(_0xd7ac('0xa'));var crypto=require('crypto');var jsforce=require(_0xd7ac('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd7ac('0x7'));var querystring=require(_0xd7ac('0xc'));var Papa=require(_0xd7ac('0xd'));var Redis=require(_0xd7ac('0xe'));var authService=require(_0xd7ac('0xf'));var qs=require(_0xd7ac('0x10'));var as=require(_0xd7ac('0x11'));var hardwareService=require(_0xd7ac('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd7ac('0x13'));var licenseUtil=require(_0xd7ac('0x14'));var db=require(_0xd7ac('0x15'))['db'];function respondWithStatusCode(_0x3aa602,_0x46e3bc){_0x46e3bc=_0x46e3bc||0xcc;return function(_0x2d500d){if(_0x2d500d){return _0x3aa602[_0xd7ac('0x16')](_0x46e3bc);}return _0x3aa602[_0xd7ac('0x17')](_0x46e3bc)[_0xd7ac('0x18')]();};}function respondWithResult(_0x219e74,_0x30b8ca){_0x30b8ca=_0x30b8ca||0xc8;return function(_0x458158){if(_0x458158){return _0x219e74[_0xd7ac('0x17')](_0x30b8ca)[_0xd7ac('0x19')](_0x458158);}};}function respondWithFilteredResult(_0x5daed0,_0xa45ff){return function(_0x7a0576){if(_0x7a0576){var _0x394255=typeof _0xa45ff['offset']===_0xd7ac('0x1a')&&typeof _0xa45ff[_0xd7ac('0x1b')]===_0xd7ac('0x1a');var _0x32187c=_0x7a0576[_0xd7ac('0x1c')];var _0x2f391f=_0x394255?0x0:_0xa45ff['offset'];var _0x2eeb50=_0x394255?_0x7a0576[_0xd7ac('0x1c')]:_0xa45ff[_0xd7ac('0x1d')]+_0xa45ff[_0xd7ac('0x1b')];var _0x46e8c4;if(_0x2eeb50>=_0x32187c){_0x2eeb50=_0x32187c;_0x46e8c4=0xc8;}else{_0x46e8c4=0xce;}_0x5daed0['status'](_0x46e8c4);return _0x5daed0[_0xd7ac('0x1e')](_0xd7ac('0x1f'),_0x2f391f+'-'+_0x2eeb50+'/'+_0x32187c)[_0xd7ac('0x19')](_0x7a0576);}return null;};}function patchUpdates(_0x5e9ddf){return function(_0x46553e){try{jsonpatch[_0xd7ac('0x20')](_0x46553e,_0x5e9ddf,!![]);}catch(_0x3589ee){return BPromise[_0xd7ac('0x21')](_0x3589ee);}return _0x46553e['save']();};}function saveUpdates(_0x4bdd16,_0x168e83){return function(_0x499136){if(_0x499136){return _0x499136['update'](_0x4bdd16)[_0xd7ac('0x22')](function(_0xb7246f){return _0xb7246f;});}return null;};}function removeEntity(_0x3ecffc,_0x3b9b30){return function(_0xea3bc1){if(_0xea3bc1){return _0xea3bc1['destroy']()[_0xd7ac('0x22')](function(){var _0x4e5d2c=_0xea3bc1[_0xd7ac('0x23')]({'plain':!![]});var _0x3e0daa='Companies';return db[_0xd7ac('0x24')][_0xd7ac('0x25')]({'where':{'type':_0x3e0daa,'resourceId':_0x4e5d2c['id']}})['then'](function(){return _0xea3bc1;});})[_0xd7ac('0x22')](function(){_0x3ecffc[_0xd7ac('0x17')](0xcc)[_0xd7ac('0x18')]();});}};}function handleEntityNotFound(_0x344bfb,_0x346edf){return function(_0x20569c){if(!_0x20569c){_0x344bfb[_0xd7ac('0x16')](0x194);}return _0x20569c;};}function handleError(_0x1a2ff1,_0x425d92){_0x425d92=_0x425d92||0x1f4;return function(_0x123a96){logger[_0xd7ac('0x26')](_0x123a96[_0xd7ac('0x27')]);if(_0x123a96['name']){delete _0x123a96[_0xd7ac('0x28')];}_0x1a2ff1['status'](_0x425d92)[_0xd7ac('0x29')](_0x123a96);};}exports[_0xd7ac('0x2a')]=function(_0x44d844,_0xc1e2ba){var _0x37298e={},_0x1320f3={},_0x543daf={'count':0x0,'rows':[]};return db['CmCompany'][_0xd7ac('0x2b')]()[_0xd7ac('0x22')](function(_0x3cf363){_0x1320f3[_0xd7ac('0x2c')]=_[_0xd7ac('0x2d')](_0x3cf363);_0x1320f3[_0xd7ac('0x2e')]=_[_0xd7ac('0x2d')](_0x44d844[_0xd7ac('0x2e')]);_0x1320f3[_0xd7ac('0x2f')]=_[_0xd7ac('0x30')](_0x1320f3[_0xd7ac('0x2c')],_0x1320f3[_0xd7ac('0x2e')]);_0x37298e['attributes']=_['intersection'](_0x1320f3['model'],qs['fields'](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x31')]));_0x37298e[_0xd7ac('0x32')]=_0x37298e[_0xd7ac('0x32')][_0xd7ac('0x33')]?_0x37298e[_0xd7ac('0x32')]:_0x1320f3[_0xd7ac('0x2c')];if(!_0x44d844['query'][_0xd7ac('0x34')]('nolimit')){_0x37298e[_0xd7ac('0x1b')]=qs[_0xd7ac('0x1b')](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x1b')]);_0x37298e['offset']=qs['offset'](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x1d')]);}_0x37298e['order']=qs[_0xd7ac('0x35')](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x35')]);_0x37298e[_0xd7ac('0x36')]=qs[_0xd7ac('0x2f')](_[_0xd7ac('0x37')](_0x44d844[_0xd7ac('0x2e')],_0x1320f3['filters']),_0x3cf363);if(_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x38')]){_0x37298e[_0xd7ac('0x36')]=_[_0xd7ac('0x39')](_0x37298e[_0xd7ac('0x36')],{'$or':_[_0xd7ac('0x3a')](_0x37298e['attributes'],function(_0x1c03e5){var _0x4c4d0c={};_0x4c4d0c[_0x1c03e5]={'$like':'%'+_0x44d844['query'][_0xd7ac('0x38')]+'%'};return _0x4c4d0c;})});}_0x37298e=_[_0xd7ac('0x39')]({},_0x37298e,_0x44d844[_0xd7ac('0x3b')]);var _0x2f66cc={'where':_0x37298e[_0xd7ac('0x36')]};return db[_0xd7ac('0x3c')][_0xd7ac('0x1c')](_0x2f66cc)[_0xd7ac('0x22')](function(_0x19b703){_0x543daf[_0xd7ac('0x1c')]=_0x19b703;if(_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x3d')]){_0x37298e['include']=[{'all':!![]}];}return db[_0xd7ac('0x3c')]['findAll'](_0x37298e);})[_0xd7ac('0x22')](function(_0xb1d2b2){_0x543daf['rows']=_0xb1d2b2;return _0x543daf;})['then'](respondWithFilteredResult(_0xc1e2ba,_0x37298e))['catch'](handleError(_0xc1e2ba,null));})[_0xd7ac('0x3e')](handleError(_0xc1e2ba,null));};exports[_0xd7ac('0x3f')]=function(_0x336236,_0x415a9e){var _0x5886c8={'raw':![],'where':{'id':_0x336236[_0xd7ac('0x40')]['id']}},_0x37e861={};_0x37e861['model']=_['keys'](db[_0xd7ac('0x3c')]['rawAttributes']);_0x37e861[_0xd7ac('0x2e')]=_['keys'](_0x336236[_0xd7ac('0x2e')]);_0x37e861['filters']=_[_0xd7ac('0x30')](_0x37e861['model'],_0x37e861[_0xd7ac('0x2e')]);_0x5886c8[_0xd7ac('0x32')]=_[_0xd7ac('0x30')](_0x37e861['model'],qs['fields'](_0x336236[_0xd7ac('0x2e')][_0xd7ac('0x31')]));_0x5886c8[_0xd7ac('0x32')]=_0x5886c8[_0xd7ac('0x32')]['length']?_0x5886c8[_0xd7ac('0x32')]:_0x37e861[_0xd7ac('0x2c')];if(_0x336236[_0xd7ac('0x2e')][_0xd7ac('0x3d')]){_0x5886c8['include']=[{'all':!![]}];}_0x5886c8=_[_0xd7ac('0x39')]({},_0x5886c8,_0x336236['options']);return db['CmCompany']['find'](_0x5886c8)[_0xd7ac('0x22')](handleEntityNotFound(_0x415a9e,null))['then'](respondWithResult(_0x415a9e,null))[_0xd7ac('0x3e')](handleError(_0x415a9e,null));};exports[_0xd7ac('0x41')]=function(_0x2eebbc,_0x4f04ea){return db[_0xd7ac('0x3c')][_0xd7ac('0x41')](_0x2eebbc[_0xd7ac('0x42')],{})['then'](function(_0x2173b3){var _0x4f8de0=_0x2eebbc[_0xd7ac('0x43')]['get']({'plain':!![]});if(!_0x4f8de0)throw new Error(_0xd7ac('0x44'));if(_0x4f8de0[_0xd7ac('0x45')]===_0xd7ac('0x43')){var _0x35f3e2=_0x2173b3[_0xd7ac('0x23')]({'plain':!![]});var _0x16865e='Companies';return db[_0xd7ac('0x46')][_0xd7ac('0x47')]({'where':{'name':_0x16865e,'userProfileId':_0x4f8de0[_0xd7ac('0x48')]},'raw':!![]})['then'](function(_0x50f7d7){if(_0x50f7d7&&_0x50f7d7['autoAssociation']===0x0){return db[_0xd7ac('0x24')][_0xd7ac('0x41')]({'name':_0x35f3e2['name'],'resourceId':_0x35f3e2['id'],'type':_0x50f7d7[_0xd7ac('0x28')],'sectionId':_0x50f7d7['id']},{})[_0xd7ac('0x22')](function(){return _0x2173b3;});}else{return _0x2173b3;}})['catch'](function(_0x4049e7){logger[_0xd7ac('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4049e7);throw _0x4049e7;});}return _0x2173b3;})['then'](respondWithResult(_0x4f04ea,0xc9))['catch'](handleError(_0x4f04ea,null));};exports['update']=function(_0x29a5d0,_0xa0bd50){if(_0x29a5d0[_0xd7ac('0x42')]['id']){delete _0x29a5d0[_0xd7ac('0x42')]['id'];}return db[_0xd7ac('0x3c')][_0xd7ac('0x47')]({'where':{'id':_0x29a5d0[_0xd7ac('0x40')]['id']}})[_0xd7ac('0x22')](handleEntityNotFound(_0xa0bd50,null))[_0xd7ac('0x22')](saveUpdates(_0x29a5d0[_0xd7ac('0x42')],null))[_0xd7ac('0x22')](respondWithResult(_0xa0bd50,null))[_0xd7ac('0x3e')](handleError(_0xa0bd50,null));};exports[_0xd7ac('0x25')]=function(_0x373c5f,_0x4a1516){return db[_0xd7ac('0x3c')][_0xd7ac('0x47')]({'where':{'id':_0x373c5f[_0xd7ac('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a1516,null))[_0xd7ac('0x22')](removeEntity(_0x4a1516,null))[_0xd7ac('0x3e')](handleError(_0x4a1516,null));};exports[_0xd7ac('0x2b')]=function(_0xf033b,_0x29e477){return db[_0xd7ac('0x3c')][_0xd7ac('0x2b')]()[_0xd7ac('0x22')](respondWithResult(_0x29e477,null))[_0xd7ac('0x3e')](handleError(_0x29e477,null));};exports[_0xd7ac('0x49')]=function(_0x4ec11c,_0x478c28,_0x5c7461){return db[_0xd7ac('0x4a')][_0xd7ac('0x47')]({'where':{'id':_0x4ec11c[_0xd7ac('0x40')]['id']}})[_0xd7ac('0x22')](handleEntityNotFound(_0x478c28,null))[_0xd7ac('0x22')](function(_0x3f664a){if(_0x3f664a){return _0x3f664a['addContacts'](_0x4ec11c[_0xd7ac('0x42')][_0xd7ac('0x4b')],_['omit'](_0x4ec11c[_0xd7ac('0x42')],['ids','id'])||{});}})['then'](respondWithResult(_0x478c28,null))[_0xd7ac('0x3e')](handleError(_0x478c28,null));};exports[_0xd7ac('0x4c')]=function(_0x3f5eea,_0x2ceabc,_0x381c8d){var _0x24027e={};var _0x8d177c={};var _0x65bb36;var _0x338abd;return db[_0xd7ac('0x3c')]['findOne']({'where':{'id':_0x3f5eea[_0xd7ac('0x40')]['id']}})[_0xd7ac('0x22')](handleEntityNotFound(_0x2ceabc,null))[_0xd7ac('0x22')](function(_0x57e821){if(_0x57e821){_0x65bb36=_0x57e821;_0x8d177c[_0xd7ac('0x2c')]=_[_0xd7ac('0x2d')](db[_0xd7ac('0x4a')]['rawAttributes']);_0x8d177c[_0xd7ac('0x2e')]=_[_0xd7ac('0x2d')](_0x3f5eea[_0xd7ac('0x2e')]);_0x8d177c[_0xd7ac('0x2f')]=_[_0xd7ac('0x30')](_0x8d177c[_0xd7ac('0x2c')],_0x8d177c[_0xd7ac('0x2e')]);_0x24027e[_0xd7ac('0x32')]=_['intersection'](_0x8d177c[_0xd7ac('0x2c')],qs[_0xd7ac('0x31')](_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x31')]));_0x24027e[_0xd7ac('0x32')]=_0x24027e[_0xd7ac('0x32')][_0xd7ac('0x33')]?_0x24027e[_0xd7ac('0x32')]:_0x8d177c['model'];_0x24027e[_0xd7ac('0x4d')]=qs[_0xd7ac('0x35')](_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x35')]);_0x24027e[_0xd7ac('0x36')]=qs[_0xd7ac('0x2f')](_[_0xd7ac('0x37')](_0x3f5eea[_0xd7ac('0x2e')],_0x8d177c[_0xd7ac('0x2f')]));if(_0x3f5eea[_0xd7ac('0x2e')]['filter']){_0x24027e[_0xd7ac('0x36')]=_[_0xd7ac('0x39')](_0x24027e[_0xd7ac('0x36')],{'$or':_[_0xd7ac('0x3a')](_0x24027e['attributes'],function(_0x43d6ad){var _0x5ac8f1={};_0x5ac8f1[_0x43d6ad]={'$like':'%'+_0x3f5eea['query']['filter']+'%'};return _0x5ac8f1;})});}_0x24027e=_['merge']({},_0x24027e,_0x3f5eea['options']);return _0x65bb36[_0xd7ac('0x4c')](_0x24027e);}})[_0xd7ac('0x22')](function(_0x41ac57){if(_0x41ac57){_0x338abd=_0x41ac57[_0xd7ac('0x33')];if(!_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x34')](_0xd7ac('0x4e'))){_0x24027e[_0xd7ac('0x1b')]=qs[_0xd7ac('0x1b')](_0x3f5eea['query'][_0xd7ac('0x1b')]);_0x24027e[_0xd7ac('0x1d')]=qs[_0xd7ac('0x1d')](_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x1d')]);}return _0x65bb36[_0xd7ac('0x4c')](_0x24027e);}})[_0xd7ac('0x22')](function(_0x1302ac){if(_0x1302ac){return _0x1302ac?{'count':_0x338abd,'rows':_0x1302ac}:null;}})[_0xd7ac('0x22')](respondWithResult(_0x2ceabc,null))['catch'](handleError(_0x2ceabc,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 8bdf791..7c8a9d2 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 _0x8c2c=['../../config/logger','api','bluebird','request-promise','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8c2c,0xe6));var _0xc8c2=function(_0x1dac3f,_0x3538f8){_0x1dac3f=_0x1dac3f-0x0;var _0x17c156=_0x8c2c[_0x1dac3f];return _0x17c156;};'use strict';var _=require('lodash');var util=require(_0xc8c2('0x0'));var logger=require(_0xc8c2('0x1'))(_0xc8c2('0x2'));var moment=require('moment');var BPromise=require(_0xc8c2('0x3'));var rp=require(_0xc8c2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8c2('0x5'));var config=require('../../config/environment');var attributes=require(_0xc8c2('0x6'));module[_0xc8c2('0x7')]=function(_0x3b3f21,_0x2b11eb){return _0x3b3f21[_0xc8c2('0x8')](_0xc8c2('0x9'),attributes,{'tableName':_0xc8c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf76f=['../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x182b57,_0x599ae8){var _0x2fe443=function(_0x3d6614){while(--_0x3d6614){_0x182b57['push'](_0x182b57['shift']());}};_0x2fe443(++_0x599ae8);}(_0xf76f,0x127));var _0xff76=function(_0xc8069a,_0x2968fc){_0xc8069a=_0xc8069a-0x0;var _0x16bc69=_0xf76f[_0xc8069a];return _0x16bc69;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xff76('0x0'))('api');var moment=require('moment');var BPromise=require(_0xff76('0x1'));var rp=require(_0xff76('0x2'));var fs=require('fs');var path=require(_0xff76('0x3'));var rimraf=require(_0xff76('0x4'));var config=require(_0xff76('0x5'));var attributes=require(_0xff76('0x6'));module[_0xff76('0x7')]=function(_0x38880c,_0x40c86a){return _0x38880c['define'](_0xff76('0x8'),attributes,{'tableName':_0xff76('0x9'),'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 9db71f6..638bafd 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 _0x9594=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d3906,_0x551f8c){var _0x90e496=function(_0x13e6ac){while(--_0x13e6ac){_0x1d3906['push'](_0x1d3906['shift']());}};_0x90e496(++_0x551f8c);}(_0x9594,0x14b));var _0x4959=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9594[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x4959('0x0'));var util=require(_0x4959('0x1'));var moment=require(_0x4959('0x2'));var BPromise=require(_0x4959('0x3'));var rs=require(_0x4959('0x4'));var fs=require('fs');var Redis=require(_0x4959('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4959('0x6'));var logger=require(_0x4959('0x7'))(_0x4959('0x8'));var config=require(_0x4959('0x9'));var jayson=require(_0x4959('0xa'));var client=jayson[_0x4959('0xb')][_0x4959('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52c4e4,_0x11137d,_0x8b2086){return new BPromise(function(_0x40da38,_0xca3666){return client[_0x4959('0xd')](_0x52c4e4,_0x8b2086)[_0x4959('0xe')](function(_0x28043e){logger[_0x4959('0xf')](_0x4959('0x10'),_0x11137d,_0x4959('0x11'));logger[_0x4959('0x12')](_0x4959('0x13'),_0x11137d,'request\x20sent',JSON[_0x4959('0x14')](_0x28043e));if(_0x28043e[_0x4959('0x15')]){if(_0x28043e[_0x4959('0x15')][_0x4959('0x16')]===0x1f4){logger[_0x4959('0x15')](_0x4959('0x10'),_0x11137d,_0x28043e[_0x4959('0x15')][_0x4959('0x17')]);return _0xca3666(_0x28043e['error'][_0x4959('0x17')]);}logger[_0x4959('0x15')](_0x4959('0x10'),_0x11137d,_0x28043e['error'][_0x4959('0x17')]);return _0x40da38(_0x28043e['error'][_0x4959('0x17')]);}else{logger[_0x4959('0xf')]('CmCompany,\x20%s,\x20%s',_0x11137d,_0x4959('0x11'));_0x40da38(_0x28043e[_0x4959('0x18')][_0x4959('0x17')]);}})['catch'](function(_0x5f080e){logger[_0x4959('0x15')](_0x4959('0x10'),_0x11137d,_0x5f080e);_0xca3666(_0x5f080e);});});} \ No newline at end of file +var _0x45f4=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x23f8af,_0x53bf47){var _0x18af50=function(_0x174697){while(--_0x174697){_0x23f8af['push'](_0x23f8af['shift']());}};_0x18af50(++_0x53bf47);}(_0x45f4,0x7a));var _0x445f=function(_0x3c202d,_0x5171ff){_0x3c202d=_0x3c202d-0x0;var _0x99199=_0x45f4[_0x3c202d];return _0x99199;};'use strict';var _=require(_0x445f('0x0'));var util=require(_0x445f('0x1'));var moment=require(_0x445f('0x2'));var BPromise=require(_0x445f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x445f('0x4'));var db=require(_0x445f('0x5'))['db'];var utils=require(_0x445f('0x6'));var logger=require('../../config/logger')(_0x445f('0x7'));var config=require(_0x445f('0x8'));var jayson=require(_0x445f('0x9'));var client=jayson['client'][_0x445f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x328307,_0x14f32b,_0x15f107){return new BPromise(function(_0x58af8a,_0x3b974a){return client[_0x445f('0xb')](_0x328307,_0x15f107)[_0x445f('0xc')](function(_0x1cac8a){logger[_0x445f('0xd')](_0x445f('0xe'),_0x14f32b,_0x445f('0xf'));logger[_0x445f('0x10')](_0x445f('0x11'),_0x14f32b,'request\x20sent',JSON[_0x445f('0x12')](_0x1cac8a));if(_0x1cac8a[_0x445f('0x13')]){if(_0x1cac8a[_0x445f('0x13')][_0x445f('0x14')]===0x1f4){logger[_0x445f('0x13')](_0x445f('0xe'),_0x14f32b,_0x1cac8a[_0x445f('0x13')]['message']);return _0x3b974a(_0x1cac8a['error'][_0x445f('0x15')]);}logger[_0x445f('0x13')](_0x445f('0xe'),_0x14f32b,_0x1cac8a[_0x445f('0x13')]['message']);return _0x58af8a(_0x1cac8a[_0x445f('0x13')][_0x445f('0x15')]);}else{logger[_0x445f('0xd')](_0x445f('0xe'),_0x14f32b,_0x445f('0xf'));_0x58af8a(_0x1cac8a[_0x445f('0x16')][_0x445f('0x15')]);}})[_0x445f('0x17')](function(_0x1b09a9){logger[_0x445f('0x13')](_0x445f('0xe'),_0x14f32b,_0x1b09a9);_0x3b974a(_0x1b09a9);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 78f8943..c56d15d 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 _0x2dd2=['../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','show','/:id/contacts','getContacts','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2dd2,0x16a));var _0x22dd=function(_0x20590d,_0x70a3d9){_0x20590d=_0x20590d-0x0;var _0x8fef18=_0x2dd2[_0x20590d];return _0x8fef18;};'use strict';var multer=require(_0x22dd('0x0'));var util=require('util');var path=require(_0x22dd('0x1'));var timeout=require(_0x22dd('0x2'));var express=require(_0x22dd('0x3'));var router=express[_0x22dd('0x4')]();var fs_extra=require(_0x22dd('0x5'));var auth=require(_0x22dd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x22dd('0x7'));var controller=require(_0x22dd('0x8'));router['get']('/',auth[_0x22dd('0x9')](),controller[_0x22dd('0xa')]);router[_0x22dd('0xb')](_0x22dd('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x22dd('0xb')]('/:id',auth[_0x22dd('0x9')](),controller[_0x22dd('0xd')]);router[_0x22dd('0xb')](_0x22dd('0xe'),auth['isAuthenticated'](),controller[_0x22dd('0xf')]);router[_0x22dd('0x10')]('/',auth[_0x22dd('0x9')](),controller[_0x22dd('0x11')]);router[_0x22dd('0x10')](_0x22dd('0xe'),auth[_0x22dd('0x9')](),controller['addContacts']);router[_0x22dd('0x12')](_0x22dd('0x13'),auth[_0x22dd('0x9')](),controller[_0x22dd('0x14')]);router[_0x22dd('0x15')]('/:id',auth[_0x22dd('0x9')](),controller['destroy']);module[_0x22dd('0x16')]=router; \ No newline at end of file +var _0xf6c9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x440dab,_0xd7b5fc){var _0x318c2f=function(_0x5518b8){while(--_0x5518b8){_0x440dab['push'](_0x440dab['shift']());}};_0x318c2f(++_0xd7b5fc);}(_0xf6c9,0x10d));var _0x9f6c=function(_0x4f0f7b,_0x290974){_0x4f0f7b=_0x4f0f7b-0x0;var _0x2d155e=_0xf6c9[_0x4f0f7b];return _0x2d155e;};'use strict';var multer=require(_0x9f6c('0x0'));var util=require(_0x9f6c('0x1'));var path=require(_0x9f6c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f6c('0x3'));var router=express[_0x9f6c('0x4')]();var fs_extra=require(_0x9f6c('0x5'));var auth=require(_0x9f6c('0x6'));var interaction=require(_0x9f6c('0x7'));var config=require(_0x9f6c('0x8'));var controller=require(_0x9f6c('0x9'));router[_0x9f6c('0xa')]('/',auth[_0x9f6c('0xb')](),controller[_0x9f6c('0xc')]);router[_0x9f6c('0xa')]('/describe',auth[_0x9f6c('0xb')](),controller[_0x9f6c('0xd')]);router[_0x9f6c('0xa')](_0x9f6c('0xe'),auth[_0x9f6c('0xb')](),controller[_0x9f6c('0xf')]);router[_0x9f6c('0xa')](_0x9f6c('0x10'),auth['isAuthenticated'](),controller[_0x9f6c('0x11')]);router[_0x9f6c('0x12')]('/',auth[_0x9f6c('0xb')](),controller[_0x9f6c('0x13')]);router[_0x9f6c('0x12')](_0x9f6c('0x10'),auth[_0x9f6c('0xb')](),controller[_0x9f6c('0x14')]);router[_0x9f6c('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9f6c('0x16')]);router[_0x9f6c('0x17')](_0x9f6c('0xe'),auth[_0x9f6c('0xb')](),controller[_0x9f6c('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index ed50ea8..2e466c8 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 _0x9a55=['exports','STRING','TEXT','INTEGER','lodash','sequelize'];(function(_0x17615e,_0x483a49){var _0xa4c97e=function(_0x24ecf7){while(--_0x24ecf7){_0x17615e['push'](_0x17615e['shift']());}};_0xa4c97e(++_0x483a49);}(_0x9a55,0x14e));var _0x59a5=function(_0x273eaa,_0x3a23c7){_0x273eaa=_0x273eaa-0x0;var _0x5d443d=_0x9a55[_0x273eaa];return _0x5d443d;};'use strict';var _=require(_0x59a5('0x0'));var Sequelize=require(_0x59a5('0x1'));module[_0x59a5('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x59a5('0x3')]},'street':{'type':Sequelize[_0x59a5('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x59a5('0x3')]},'country':{'type':Sequelize[_0x59a5('0x3')]},'dateOfBirth':{'type':Sequelize[_0x59a5('0x3')]},'description':{'type':Sequelize[_0x59a5('0x4')]},'phone':{'type':Sequelize[_0x59a5('0x3')]},'mobile':{'type':Sequelize[_0x59a5('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x59a5('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x59a5('0x3')]},'fb_data':{'type':Sequelize[_0x59a5('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x59a5('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x59a5('0x3')]},'line':{'type':Sequelize[_0x59a5('0x3')]},'wechat':{'type':Sequelize[_0x59a5('0x3')]},'telegram':{'type':Sequelize[_0x59a5('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x59a5('0x3')]},'priority':{'type':Sequelize[_0x59a5('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x59a5('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6687=['TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6687,0xac));var _0x7668=function(_0x21bb6a,_0x57fb37){_0x21bb6a=_0x21bb6a-0x0;var _0x21d589=_0x6687[_0x21bb6a];return _0x21d589;};'use strict';var _=require(_0x7668('0x0'));var Sequelize=require(_0x7668('0x1'));module[_0x7668('0x2')]={'firstName':{'type':Sequelize[_0x7668('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7668('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7668('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7668('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7668('0x4')]},'phone':{'type':Sequelize[_0x7668('0x3')]},'mobile':{'type':Sequelize[_0x7668('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x7668('0x3')]},'facebook':{'type':Sequelize[_0x7668('0x3')]},'fb_data':{'type':Sequelize[_0x7668('0x3')]},'twitter':{'type':Sequelize[_0x7668('0x3')]},'skype':{'type':Sequelize[_0x7668('0x3')]},'teams':{'type':Sequelize[_0x7668('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x7668('0x3')]},'wechat':{'type':Sequelize[_0x7668('0x3')]},'telegram':{'type':Sequelize[_0x7668('0x3')]},'UserId':{'type':Sequelize[_0x7668('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x7668('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x7668('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7668('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x7668('0x3')]},'utcOffset':{'type':Sequelize[_0x7668('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 659f7a4..3cbbdc4 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 _0x0846=['findOne','model','rawAttributes','filters','intersection','attributes','fields','sort','merge','filter','options','nolimit','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','pick','ContactId','includeAll','rows','getHopperHistories','order','include','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!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','send','upload','createReadStream','parse','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','getJourney','chat','openchannel','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','Owner','color','browserName','customerPort','osName','ratingMessage','ratingValue','referer','mail','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','value','slice','bluebird','util','path','squel','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','status','json','offset','undefined','count','limit','Content-Range','update','then','destroy','end','sendStatus','stack','name','index','getOptions','findAll','catch','CmContact','find','params','describe','tags','keys','length','cf_','displayName','columnName','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','body','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','CmHopperBlack','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','isNil','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','hasOwnProperty','all','show','Tag','Tags','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','CmCustomField','omit','map','cf_%d','pickBy','startsWith','format','isEmpty','cm_contacts','id\x20=\x20?','toParam','query','text','phone','getTags'];(function(_0x4afd00,_0x509b6b){var _0x19d48c=function(_0x3d3728){while(--_0x3d3728){_0x4afd00['push'](_0x4afd00['shift']());}};_0x19d48c(++_0x509b6b);}(_0x0846,0x18a));var _0x6084=function(_0x5967f4,_0x49b886){_0x5967f4=_0x5967f4-0x0;var _0x14d5cc=_0x0846[_0x5967f4];return _0x14d5cc;};'use strict';var moment=require('moment');var BPromise=require(_0x6084('0x0'));var util=require(_0x6084('0x1'));var path=require(_0x6084('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6084('0x3'));var Papa=require(_0x6084('0x4'));var Redis=require('ioredis');var contacts=require('../../components/contacts');var qs=require(_0x6084('0x5'));var logger=require(_0x6084('0x6'))(_0x6084('0x7'));var config=require(_0x6084('0x8'));var shared=require('../../config/environment/shared');var db=require(_0x6084('0x9'))['db'];config[_0x6084('0xa')]=_[_0x6084('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6084('0xa')]));require('./cmContact.socket')[_0x6084('0xc')](socket);function respondWithResult(_0x924895,_0xf40f50){_0xf40f50=_0xf40f50||0xc8;return function(_0x1bd796){if(_0x1bd796){return _0x924895[_0x6084('0xd')](_0xf40f50)[_0x6084('0xe')](_0x1bd796);}};}function respondWithFilteredResult(_0x5c561c,_0x4015f2){return function(_0x2a8ef8){if(_0x2a8ef8){var _0x51dda9=typeof _0x4015f2[_0x6084('0xf')]==='undefined'&&typeof _0x4015f2['limit']===_0x6084('0x10');var _0x4ae25e=_0x2a8ef8[_0x6084('0x11')];var _0x167af8=_0x51dda9?0x0:_0x4015f2['offset'];var _0x374412=_0x51dda9?_0x2a8ef8[_0x6084('0x11')]:_0x4015f2[_0x6084('0xf')]+_0x4015f2[_0x6084('0x12')];var _0x1e122d;if(_0x374412>=_0x4ae25e){_0x374412=_0x4ae25e;_0x1e122d=0xc8;}else{_0x1e122d=0xce;}_0x5c561c[_0x6084('0xd')](_0x1e122d);return _0x5c561c['set'](_0x6084('0x13'),_0x167af8+'-'+_0x374412+'/'+_0x4ae25e)['json'](_0x2a8ef8);}return null;};}function saveUpdates(_0xacf7c4){return function(_0x2c5a39){if(_0x2c5a39){return _0x2c5a39[_0x6084('0x14')](_0xacf7c4)[_0x6084('0x15')](function(_0x35c48c){return _0x35c48c;});}return null;};}function removeEntity(_0x28eb4c){return function(_0x224ce5){if(_0x224ce5){return _0x224ce5[_0x6084('0x16')]()['then'](function(){_0x28eb4c[_0x6084('0xd')](0xcc)[_0x6084('0x17')]();});}};}function handleEntityNotFound(_0x52b418){return function(_0x33078b){if(!_0x33078b){_0x52b418[_0x6084('0x18')](0x194);}return _0x33078b;};}function handleError(_0x276539,_0x5bf8ad){_0x5bf8ad=_0x5bf8ad||0x1f4;return function(_0x479d78){logger['error'](_0x479d78[_0x6084('0x19')]);if(_0x479d78[_0x6084('0x1a')]){delete _0x479d78[_0x6084('0x1a')];}_0x276539['status'](_0x5bf8ad)['send'](_0x479d78);};}exports[_0x6084('0x1b')]=function(_0x41c0f0,_0x599c85){var _0x405050={};return contacts['describe']()[_0x6084('0x15')](function(_0xd7b2ef){_0x405050=qs[_0x6084('0x1c')](_0xd7b2ef,_0x41c0f0);return contacts[_0x6084('0x1d')](_0x41c0f0['query'],_0x41c0f0['user'],_0x405050,_0xd7b2ef);})[_0x6084('0x15')](respondWithFilteredResult(_0x599c85,_0x405050))[_0x6084('0x1e')](handleError(_0x599c85,null));};exports[_0x6084('0x16')]=function(_0x42ab42,_0x3a4a96){return db[_0x6084('0x1f')][_0x6084('0x20')]({'where':{'id':_0x42ab42[_0x6084('0x21')]['id']}})[_0x6084('0x15')](handleEntityNotFound(_0x3a4a96,null))['then'](removeEntity(_0x3a4a96,null))[_0x6084('0x1e')](handleError(_0x3a4a96,null));};exports[_0x6084('0x22')]=function(_0x58dc3b,_0x2c5bf4){return db['CmContact'][_0x6084('0x22')]()['then'](function(_0x4ad777){delete _0x4ad777[_0x6084('0x23')];for(var _0x21c15e=0x0;_0x21c15e0x0){return new Promise(function(_0x5eb66b){var _0x55f5d8=[];for(var _0x37ba34=0x0;_0x37ba34<_0x46c455[_0x6084('0x25')];_0x37ba34++){_0x55f5d8[_0x6084('0x57')](insertAdditionalPhones(_0x46c455[_0x37ba34]['contact'],_0x46c455[_0x37ba34]['additionalPhones']));}Promise[_0x6084('0x5b')](_0x55f5d8)[_0x6084('0x15')](function(){_0x5eb66b(0x1);});})[_0x6084('0x15')](function(){return{'success':_0xab67b7,'failure':_0x163429,'duplicates':_0x346264};});}else{return{'success':_0xab67b7,'failure':_0x163429,'duplicates':_0x346264};}}})[_0x6084('0x15')](respondWithResult(_0x2729f9,0xc9))[_0x6084('0x1e')](handleError(_0x2729f9,null));};exports[_0x6084('0x5c')]=function(_0x4ec413,_0x443410){var _0x56157c;return db[_0x6084('0x1f')]['describe']()[_0x6084('0x15')](function(_0x38ec46){return db[_0x6084('0x1f')]['find']({'where':{'id':_0x4ec413[_0x6084('0x21')]['id']},'include':[{'model':db[_0x6084('0x5d')],'as':_0x6084('0x5e'),'attributes':['id','name','color'],'required':_0x4ec413['query'][_0x6084('0x5f')]?!![]:![]},{'model':db[_0x6084('0x41')],'as':_0x6084('0x60'),'where':{'CmContactId':_0x4ec413['params']['id']},'required':![],'include':[{'model':db[_0x6084('0x61')],'as':_0x6084('0x62')}]}],'order':[db[_0x6084('0x63')][_0x6084('0x64')](_0x6084('0x65'))],'attributes':_[_0x6084('0x24')](_0x38ec46)});})[_0x6084('0x15')](function(_0x26cd10){if(!_[_0x6084('0x4f')](_0x26cd10)){_0x56157c=_0x26cd10['get']({'plain':!![]});var _0x2ecc3d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x26cd10&&_0x26cd10[_0x6084('0x58')]){if(_0x26cd10[_0x6084('0x58')]){_0x2ecc3d[_0x6084('0x55')][_0x6084('0x66')][_0x6084('0x57')]({'ListId':{'$ne':_0x26cd10[_0x6084('0x58')]}});}}return db[_0x6084('0x67')][_0x6084('0x1d')](_0x2ecc3d);}})[_0x6084('0x15')](function(_0xf60157){if(!_[_0x6084('0x4f')](_0xf60157)){return _[_0x6084('0x68')](_0x56157c,_[_0x6084('0x69')](_0xf60157,function(_0xcd36b7){return util['format'](_0x6084('0x6a'),_0xcd36b7['id']);}));}})['then'](handleEntityNotFound(_0x443410,null))[_0x6084('0x15')](respondWithResult(_0x443410,null))[_0x6084('0x1e')](handleError(_0x443410,null));};exports[_0x6084('0x14')]=function(_0x3332de,_0x568a21){var _0x310fa7;if(_0x3332de[_0x6084('0x2f')]['id']){delete _0x3332de[_0x6084('0x2f')]['id'];}if(!_[_0x6084('0x4f')](_0x3332de[_0x6084('0x2f')][_0x6084('0x4e')])){var _0x4f57a8=_0x3332de[_0x6084('0x2f')][_0x6084('0x4e')];if(!_[_0x6084('0x4f')](shared['timezones'][_0x4f57a8]))_0x3332de[_0x6084('0x2f')][_0x6084('0x51')]=shared[_0x6084('0x50')][_0x4f57a8][_0x6084('0x51')];}return db[_0x6084('0x1f')][_0x6084('0x20')]({'where':{'id':_0x3332de[_0x6084('0x21')]['id']}})[_0x6084('0x15')](handleEntityNotFound(_0x568a21,null))[_0x6084('0x15')](saveUpdates(_0x3332de['body'],null))[_0x6084('0x15')](function(_0x3af878){_0x310fa7=_0x3af878;var _0x2da6a4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3af878&&_0x3af878[_0x6084('0x58')]){if(_0x3af878[_0x6084('0x58')]){_0x2da6a4[_0x6084('0x55')]['$and'][_0x6084('0x57')]({'ListId':{'$ne':_0x3af878[_0x6084('0x58')]}});}}return db['CmCustomField']['findAll'](_0x2da6a4);})[_0x6084('0x15')](function(_0x513bb7){if(_0x513bb7){return _[_0x6084('0x68')](_[_0x6084('0x6b')](_0x3332de['body'],function(_0x449c46,_0x1feb47){return _[_0x6084('0x6c')](_0x1feb47,_0x6084('0x26'));}),_[_0x6084('0x69')](_0x513bb7,function(_0x561f0a){return util[_0x6084('0x6d')]('cf_%d',_0x561f0a['id']);}));}})[_0x6084('0x15')](function(_0x1986a3){if(_0x1986a3&&!_[_0x6084('0x6e')](_0x1986a3)){var _0x43dcbf=squel[_0x6084('0x14')]()['table'](_0x6084('0x6f'))['setFields'](_0x1986a3)[_0x6084('0x55')](_0x6084('0x70'),_0x3332de[_0x6084('0x21')]['id'])[_0x6084('0x71')]();return db[_0x6084('0x63')][_0x6084('0x72')](_0x43dcbf[_0x6084('0x73')],{'replacements':_0x43dcbf[_0x6084('0x2b')]});}})[_0x6084('0x15')](function(){if(_0x3332de['body'][_0x6084('0x74')]&&_0x310fa7){return db[_0x6084('0x36')][_0x6084('0x14')]({'phone':_0x3332de[_0x6084('0x2f')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x310fa7['id']}});}})[_0x6084('0x15')](function(){return _0x310fa7;})[_0x6084('0x15')](respondWithResult(_0x568a21,null))[_0x6084('0x1e')](handleError(_0x568a21,null));};exports[_0x6084('0x75')]=function(_0x321307,_0x17a711){var _0xcc4a47={};var _0x431e50={};var _0x14c54e;var _0x21e892;return db[_0x6084('0x1f')][_0x6084('0x76')]({'where':{'id':_0x321307['params']['id']}})[_0x6084('0x15')](handleEntityNotFound(_0x17a711,null))[_0x6084('0x15')](function(_0x4734ec){if(_0x4734ec){_0x14c54e=_0x4734ec;_0x431e50[_0x6084('0x77')]=_[_0x6084('0x24')](db[_0x6084('0x5d')][_0x6084('0x78')]);_0x431e50[_0x6084('0x72')]=_[_0x6084('0x24')](_0x321307[_0x6084('0x72')]);_0x431e50[_0x6084('0x79')]=_[_0x6084('0x7a')](_0x431e50['model'],_0x431e50[_0x6084('0x72')]);_0xcc4a47[_0x6084('0x7b')]=_[_0x6084('0x7a')](_0x431e50[_0x6084('0x77')],qs[_0x6084('0x7c')](_0x321307[_0x6084('0x72')][_0x6084('0x7c')]));_0xcc4a47[_0x6084('0x7b')]=_0xcc4a47[_0x6084('0x7b')][_0x6084('0x25')]?_0xcc4a47[_0x6084('0x7b')]:_0x431e50[_0x6084('0x77')];_0xcc4a47['order']=qs[_0x6084('0x7d')](_0x321307[_0x6084('0x72')][_0x6084('0x7d')]);_0xcc4a47[_0x6084('0x55')]=qs['filters'](_['pick'](_0x321307['query'],_0x431e50[_0x6084('0x79')]));if(_0x321307[_0x6084('0x72')]['filter']){_0xcc4a47[_0x6084('0x55')]=_[_0x6084('0x7e')](_0xcc4a47[_0x6084('0x55')],{'$or':_[_0x6084('0x69')](_0xcc4a47[_0x6084('0x7b')],function(_0x48c018){var _0x3bfd94={};_0x3bfd94[_0x48c018]={'$like':'%'+_0x321307[_0x6084('0x72')][_0x6084('0x7f')]+'%'};return _0x3bfd94;})});}_0xcc4a47=_[_0x6084('0x7e')]({},_0xcc4a47,_0x321307[_0x6084('0x80')]);return _0x14c54e[_0x6084('0x75')](_0xcc4a47);}})[_0x6084('0x15')](function(_0x5b6e23){if(_0x5b6e23){_0x21e892=_0x5b6e23[_0x6084('0x25')];if(!_0x321307[_0x6084('0x72')][_0x6084('0x5a')](_0x6084('0x81'))){_0xcc4a47[_0x6084('0x12')]=qs[_0x6084('0x12')](_0x321307[_0x6084('0x72')][_0x6084('0x12')]);_0xcc4a47[_0x6084('0xf')]=qs[_0x6084('0xf')](_0x321307[_0x6084('0x72')][_0x6084('0xf')]);}return _0x14c54e[_0x6084('0x75')](_0xcc4a47);}})['then'](function(_0x2ae7c6){if(_0x2ae7c6){return _0x2ae7c6?{'count':_0x21e892,'rows':_0x2ae7c6}:null;}})[_0x6084('0x15')](respondWithResult(_0x17a711,null))[_0x6084('0x1e')](handleError(_0x17a711,null));};exports['setTags']=function(_0xccde07,_0x4ba38b){if(_0xccde07['body']['id']){delete _0xccde07[_0x6084('0x2f')]['id'];}return db['CmContact'][_0x6084('0x76')]({'where':{'id':_0xccde07[_0x6084('0x21')]['id']}})[_0x6084('0x15')](handleEntityNotFound(_0x4ba38b,null))[_0x6084('0x15')](function(_0x38e84a){if(_0x38e84a){return _0x38e84a['setTags'](_0xccde07['body'][_0x6084('0x82')]||[]);}return null;})[_0x6084('0x15')](respondWithResult(_0x4ba38b,null))[_0x6084('0x1e')](handleError(_0x4ba38b,null));};exports[_0x6084('0x83')]=function(_0x22b2b5,_0x22c611){var _0x1f8566=[];_0x1f8566[_0x6084('0x57')](addAdditionalPhones(_0x22b2b5[_0x6084('0x2f')]));Promise['all'](_0x1f8566)['then'](function(){_0x1f8566=[];_0x1f8566['push'](deleteCmHopperPhones(_0x22b2b5[_0x6084('0x2f')]['id']));_0x1f8566['push'](addCmHopperPhones(_0x22b2b5[_0x6084('0x2f')]['id']));Promise['all'](_0x1f8566)['then'](function(){return[0x1];})[_0x6084('0x15')](respondWithResult(_0x22c611,null));});};function addAdditionalPhones(_0x145097){var _0x398f30;return new Promise(function(_0x20d8b6){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x145097['id']}})['then'](function(){db[_0x6084('0x61')][_0x6084('0x1d')]({'raw':!![],'attributes':['id',_0x6084('0x84')]})[_0x6084('0x15')](function(_0x15db5a){var _0x264f8a=[];for(var _0x4796e7=0x0;_0x4796e7<_0x145097[_0x6084('0x85')][_0x6084('0x25')];_0x4796e7++){var _0xd4bd5f=_0x145097[_0x6084('0x86')]?_[_0x6084('0x4f')](_0x145097[_0x6084('0x86')][_0x4796e7])?'':_0x145097[_0x6084('0x86')][_0x4796e7]:_0x145097[_0x6084('0x85')][_0x4796e7]['ItemTypeId']?_0x145097[_0x6084('0x85')][_0x4796e7][_0x6084('0x87')]:'';var _0x3742da=_[_0x6084('0x4f')](_0x145097[_0x6084('0x85')][_0x4796e7][_0x6084('0x88')])?'':_0x145097[_0x6084('0x85')][_0x4796e7]['description'];var _0x2784fe=_0xd4bd5f+':'+_0x145097[_0x6084('0x85')][_0x4796e7][_0x6084('0x74')]+'§'+_0x3742da;if(_[_0x6084('0x4f')](_0x398f30))_0x398f30=_0x2784fe;else _0x398f30+=';'+_0x2784fe;var _0x33abd2=null;var _0x5ab9b0=null;if(_0x145097['item_types']){if(!_[_0x6084('0x4f')](_0x145097[_0x6084('0x86')][_0x4796e7])){_0x5ab9b0=_[_0x6084('0x20')](_0x15db5a,function(_0x174dec){return _0x174dec['id']===_0x145097[_0x6084('0x86')][_0x4796e7];});if(!_[_0x6084('0x4f')](_0x5ab9b0)){_0x33abd2=_0x5ab9b0[_0x6084('0x84')];}}}else{if(!_[_0x6084('0x4f')](_0x145097[_0x6084('0x85')][_0x4796e7])){_0x5ab9b0=_[_0x6084('0x20')](_0x15db5a,function(_0x5b793b){return _0x5b793b['id']===_0x145097[_0x6084('0x85')][_0x4796e7][_0x6084('0x87')];});if(!_[_0x6084('0x4f')](_0x5ab9b0)){_0x33abd2=_0x4796e7;}}}if(_[_0x6084('0x4f')](_0x33abd2)){_0x33abd2=0x64;}_0x264f8a[_0x6084('0x57')](addAdditionalPhone(_0x145097['id'],_0x145097[_0x6084('0x85')][_0x4796e7]['phone'],_0x145097[_0x6084('0x86')]?_[_0x6084('0x4f')](_0x145097['item_types'][_0x4796e7])?null:_0x145097[_0x6084('0x86')][_0x4796e7]:_0x145097[_0x6084('0x85')][_0x4796e7]['ItemTypeId']?_0x145097[_0x6084('0x85')][_0x4796e7][_0x6084('0x87')]:null,_0x33abd2,_0x3742da));}Promise['all'](_0x264f8a)[_0x6084('0x15')](function(){db[_0x6084('0x1f')][_0x6084('0x14')]({'AdditionalPhones':_0x398f30},{'where':{'id':_0x145097['id']}})[_0x6084('0x15')](function(){_0x20d8b6(0x1);});});});});});}function addAdditionalPhone(_0xe52bbf,_0x3cc5ba,_0x25e021,_0x386616,_0x195db1){return db['CmContactHasItem'][_0x6084('0x20')]({'where':{'CmContactId':_0xe52bbf,'item':_0x3cc5ba}})[_0x6084('0x15')](function(_0xec8ecc){if(_0xec8ecc)logger[_0x6084('0x2c')]('contact\x20phone\x20exists',_0xec8ecc);else{db[_0x6084('0x41')][_0x6084('0x4d')]({'CmContactId':_0xe52bbf,'item':_0x3cc5ba,'ItemTypeId':_0x25e021,'OrderBy':_0x386616,'ItemClass':_0x6084('0x89'),'description':_0x195db1});}});}function deleteCmHopperPhones(_0x1ce80e){return new Promise(function(_0x12d3ab){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1ce80e}})[_0x6084('0x15')](function(_0x116dab){db[_0x6084('0x8a')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x6084('0x69')](_0x116dab,'id')}}});})[_0x6084('0x15')](function(){_0x12d3ab(0x1);});});}function addCmHopperPhones(_0x3ef36b){return new Promise(function(_0x5a7447){return db[_0x6084('0x36')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3ef36b}})[_0x6084('0x15')](function(_0x26d4db){var _0x1bfade=[];_[_0x6084('0x69')](_0x26d4db,function(_0x445127){_0x1bfade[_0x6084('0x57')](createCmHopperPhone(_0x3ef36b,_0x445127['id']));});Promise[_0x6084('0x5b')](_0x1bfade)['then'](function(){_0x5a7447(0x1);});});});}function createCmHopperPhone(_0x515bad,_0x19802c){return new Promise(function(_0x156a20){db['CmContactHasItem'][_0x6084('0x1d')]({'raw':!![],'attributes':[_0x6084('0x8b'),_0x6084('0x84')],'where':{'CmContactId':_0x515bad,'ItemClass':_0x6084('0x89')},'include':[{'model':db[_0x6084('0x61')],'attributes':[_0x6084('0x84')],'as':_0x6084('0x62')}],'order':['OrderBy',db['sequelize'][_0x6084('0x64')](_0x6084('0x8c'))]})[_0x6084('0x15')](function(_0x208344){var _0x313f5d=0x1;var _0x4f618a=_['map'](_0x208344,function(_0x2866ac){_0x2866ac[_0x6084('0x8d')]=_0x19802c;_0x2866ac['phone']=_0x2866ac[_0x6084('0x8b')];_0x2866ac[_0x6084('0x84')]=_0x313f5d;delete _0x2866ac[_0x6084('0x8e')];_0x313f5d=_0x313f5d+0x1;return _0x2866ac;});return db['CmHopperAdditionalPhone'][_0x6084('0x8f')](_0x4f618a,{});})[_0x6084('0x15')](function(){_0x156a20(0x1);});});}function insertAdditionalPhones(_0x8fef13,_0x2a9a44){return new Promise(function(_0x523e5a){var _0x313665=[];for(var _0x46cb53=0x0;_0x46cb53<_0x2a9a44[_0x6084('0x25')];_0x46cb53++){var _0x307741=_0x2a9a44[_0x46cb53];_0x313665[_0x6084('0x57')](parseContactItemType(_0x307741));}Promise['all'](_0x313665)[_0x6084('0x15')](function(){var _0x3733d0={'id':_0x8fef13['id'],'items':_0x2a9a44};return addAdditionalPhones(_0x3733d0)['then'](function(){return addCmHopperPhones(_0x8fef13['id']);});})[_0x6084('0x15')](function(){_0x523e5a(_0x8fef13);});});}function parseContactItemType(_0x389c53){return new Promise(function(_0x517206){if(_0x389c53[_0x6084('0x5a')](_0x6084('0x87'))){_0x517206(_0x389c53);}else{return db[_0x6084('0x61')]['find']({'where':{'name':_0x389c53[_0x6084('0x62')]}})[_0x6084('0x15')](function(_0x376f6b){if(_[_0x6084('0x4f')](_0x376f6b))_0x389c53[_0x6084('0x87')]=null;else _0x389c53[_0x6084('0x87')]=_0x376f6b['id'];_0x517206(_0x389c53);});}});}exports[_0x6084('0x90')]=function(_0x2a72c9,_0x505a8e){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x2a72c9['params']['id'],'ItemClass':_0x6084('0x89')},'include':[{'model':db[_0x6084('0x61')],'as':'ItemType'}],'order':[[_0x6084('0x84')],[db[_0x6084('0x63')][_0x6084('0x64')](_0x6084('0x8c'))]]})['then'](function(_0x3ac8fd){return _0x3ac8fd;})[_0x6084('0x15')](respondWithResult(_0x505a8e,null))[_0x6084('0x1e')](handleError(_0x505a8e,null));};exports[_0x6084('0x91')]=function(_0x2e9426,_0x45966d){return db['CmContactHasItem'][_0x6084('0x1d')]({'raw':!![],'where':{'CmContactId':_0x2e9426[_0x6084('0x2f')][_0x6084('0x92')]}})[_0x6084('0x15')](function(_0x418c7b){var _0x5e41ea=_[_0x6084('0x69')](_0x418c7b,function(_0x5e7a21){_0x5e7a21['CmContactId']=_0x2e9426[_0x6084('0x2f')][_0x6084('0x93')];return _0x5e7a21;});return db[_0x6084('0x41')][_0x6084('0x8f')](_0x5e41ea,{});})[_0x6084('0x15')](function(){return addCmHopperPhones(_0x2e9426['body'][_0x6084('0x93')]);})[_0x6084('0x15')](function(){return['ok'];})[_0x6084('0x15')](respondWithResult(_0x45966d,null))['catch'](handleError(_0x45966d,null));};exports[_0x6084('0x94')]=function(_0x5bb317,_0x1e8ef5){var _0x119ebe=[];_0x119ebe['push'](createCmHopperPhone(_0x5bb317[_0x6084('0x2f')]['id'],_0x5bb317[_0x6084('0x2f')][_0x6084('0x95')]));Promise['all'](_0x119ebe)[_0x6084('0x15')](function(){return[0x1];})[_0x6084('0x15')](respondWithResult(_0x1e8ef5,null));};exports[_0x6084('0x96')]=function(_0x275274,_0x26ce16){var _0x4d070d={'raw':![],'where':{}};var _0x5b6f77={};var _0x6305bc={'count':0x0,'rows':[]};return db[_0x6084('0x1f')][_0x6084('0x76')]({'where':{'id':_0x275274[_0x6084('0x21')]['id']}})[_0x6084('0x15')](handleEntityNotFound(_0x26ce16,null))['then'](function(_0x52294a){if(_0x52294a){_0x5b6f77[_0x6084('0x77')]=_[_0x6084('0x24')](db[_0x6084('0x36')]['rawAttributes']);_0x5b6f77['query']=_[_0x6084('0x24')](_0x275274[_0x6084('0x72')]);_0x5b6f77[_0x6084('0x79')]=_[_0x6084('0x7a')](_0x5b6f77[_0x6084('0x77')],_0x5b6f77['query']);_0x4d070d['attributes']=_['intersection'](_0x5b6f77['model'],qs['fields'](_0x275274['query'][_0x6084('0x7c')]));_0x4d070d[_0x6084('0x7b')]=_0x4d070d[_0x6084('0x7b')]['length']?_0x4d070d[_0x6084('0x7b')]:_0x5b6f77['model'];if(!_0x275274[_0x6084('0x72')][_0x6084('0x5a')](_0x6084('0x81'))){_0x4d070d[_0x6084('0x12')]=qs[_0x6084('0x12')](_0x275274[_0x6084('0x72')][_0x6084('0x12')]);_0x4d070d[_0x6084('0xf')]=qs[_0x6084('0xf')](_0x275274[_0x6084('0x72')]['offset']);}_0x4d070d['order']=qs[_0x6084('0x7d')](_0x275274[_0x6084('0x72')][_0x6084('0x7d')]);_0x4d070d[_0x6084('0x55')]=qs[_0x6084('0x79')](_[_0x6084('0x97')](_0x275274[_0x6084('0x72')],_0x5b6f77['filters']));_0x4d070d[_0x6084('0x55')][_0x6084('0x98')]=_0x52294a['id'];if(_0x275274[_0x6084('0x72')][_0x6084('0x7f')]){_0x4d070d[_0x6084('0x55')]=_[_0x6084('0x7e')](_0x4d070d['where'],{'$or':_[_0x6084('0x69')](_0x4d070d['attributes'],function(_0x3bd7c7){var _0x23aee6={};_0x23aee6[_0x3bd7c7]={'$like':'%'+_0x275274[_0x6084('0x72')][_0x6084('0x7f')]+'%'};return _0x23aee6;})});}_0x4d070d=_['merge']({},_0x4d070d,_0x275274[_0x6084('0x80')]);return db[_0x6084('0x36')][_0x6084('0x11')]({'where':_0x4d070d[_0x6084('0x55')]})[_0x6084('0x15')](function(_0x1e04c3){_0x6305bc[_0x6084('0x11')]=_0x1e04c3;if(_0x275274[_0x6084('0x72')][_0x6084('0x99')]){_0x4d070d['include']=[{'all':!![]}];}return db[_0x6084('0x36')][_0x6084('0x1d')](_0x4d070d);})[_0x6084('0x15')](function(_0x1851ad){_0x6305bc[_0x6084('0x9a')]=_0x1851ad;return _0x6305bc;});}})[_0x6084('0x15')](respondWithFilteredResult(_0x26ce16,_0x4d070d))[_0x6084('0x1e')](handleError(_0x26ce16,null));};exports[_0x6084('0x9b')]=function(_0x48abd6,_0x511ad3){var _0x2c15cb={'raw':!![],'where':{}};var _0x3083e4={};var _0xcffbf0={'count':0x0,'rows':[]};return db['CmContact'][_0x6084('0x76')]({'where':{'id':_0x48abd6['params']['id']}})[_0x6084('0x15')](handleEntityNotFound(_0x511ad3,null))[_0x6084('0x15')](function(_0x1c59e0){if(_0x1c59e0){_0x3083e4[_0x6084('0x77')]=_[_0x6084('0x24')](db[_0x6084('0x43')][_0x6084('0x78')]);_0x3083e4[_0x6084('0x72')]=_[_0x6084('0x24')](_0x48abd6[_0x6084('0x72')]);_0x3083e4[_0x6084('0x79')]=_[_0x6084('0x7a')](_0x3083e4['model'],_0x3083e4['query']);_0x2c15cb[_0x6084('0x7b')]=_['intersection'](_0x3083e4[_0x6084('0x77')],qs[_0x6084('0x7c')](_0x48abd6[_0x6084('0x72')]['fields']));_0x2c15cb['attributes']=_0x2c15cb[_0x6084('0x7b')][_0x6084('0x25')]?_0x2c15cb[_0x6084('0x7b')]:_0x3083e4['model'];if(!_0x48abd6[_0x6084('0x72')][_0x6084('0x5a')]('nolimit')){_0x2c15cb[_0x6084('0x12')]=qs[_0x6084('0x12')](_0x48abd6['query'][_0x6084('0x12')]);_0x2c15cb[_0x6084('0xf')]=qs[_0x6084('0xf')](_0x48abd6['query']['offset']);}_0x2c15cb[_0x6084('0x9c')]=qs[_0x6084('0x7d')](_0x48abd6[_0x6084('0x72')]['sort']);_0x2c15cb[_0x6084('0x55')]=qs[_0x6084('0x79')](_[_0x6084('0x97')](_0x48abd6['query'],_0x3083e4[_0x6084('0x79')]));_0x2c15cb[_0x6084('0x55')][_0x6084('0x98')]=_0x1c59e0['id'];if(_0x48abd6[_0x6084('0x72')][_0x6084('0x7f')]){_0x2c15cb[_0x6084('0x55')]=_[_0x6084('0x7e')](_0x2c15cb[_0x6084('0x55')],{'$or':_[_0x6084('0x69')](_0x2c15cb[_0x6084('0x7b')],function(_0x3fb36c){var _0x3050fe={};_0x3050fe[_0x3fb36c]={'$like':'%'+_0x48abd6[_0x6084('0x72')][_0x6084('0x7f')]+'%'};return _0x3050fe;})});}_0x2c15cb=_[_0x6084('0x7e')]({},_0x2c15cb,_0x48abd6[_0x6084('0x80')]);return db[_0x6084('0x43')]['count']({'where':_0x2c15cb[_0x6084('0x55')]})[_0x6084('0x15')](function(_0x4714ec){_0xcffbf0[_0x6084('0x11')]=_0x4714ec;if(_0x48abd6['query'][_0x6084('0x99')]){_0x2c15cb[_0x6084('0x9d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x6084('0x1d')](_0x2c15cb);})[_0x6084('0x15')](function(_0x1b62eb){_0xcffbf0[_0x6084('0x9a')]=_0x1b62eb;return _0xcffbf0;});}})[_0x6084('0x15')](respondWithFilteredResult(_0x511ad3,_0x2c15cb))[_0x6084('0x1e')](handleError(_0x511ad3,null));};exports['getHopperFinals']=function(_0x3b02c5,_0x4391b2){var _0x13d372={'raw':!![],'where':{}};var _0x2b10f3={};var _0x541f4a={'count':0x0,'rows':[]};return db[_0x6084('0x1f')][_0x6084('0x76')]({'where':{'id':_0x3b02c5[_0x6084('0x21')]['id']}})[_0x6084('0x15')](handleEntityNotFound(_0x4391b2,null))[_0x6084('0x15')](function(_0x15a837){if(_0x15a837){_0x2b10f3[_0x6084('0x77')]=_['keys'](db[_0x6084('0x42')][_0x6084('0x78')]);_0x2b10f3[_0x6084('0x72')]=_[_0x6084('0x24')](_0x3b02c5[_0x6084('0x72')]);_0x2b10f3[_0x6084('0x79')]=_[_0x6084('0x7a')](_0x2b10f3[_0x6084('0x77')],_0x2b10f3[_0x6084('0x72')]);_0x13d372[_0x6084('0x7b')]=_[_0x6084('0x7a')](_0x2b10f3['model'],qs[_0x6084('0x7c')](_0x3b02c5[_0x6084('0x72')][_0x6084('0x7c')]));_0x13d372[_0x6084('0x7b')]=_0x13d372[_0x6084('0x7b')][_0x6084('0x25')]?_0x13d372[_0x6084('0x7b')]:_0x2b10f3[_0x6084('0x77')];if(!_0x3b02c5[_0x6084('0x72')][_0x6084('0x5a')](_0x6084('0x81'))){_0x13d372[_0x6084('0x12')]=qs[_0x6084('0x12')](_0x3b02c5[_0x6084('0x72')]['limit']);_0x13d372['offset']=qs[_0x6084('0xf')](_0x3b02c5[_0x6084('0x72')][_0x6084('0xf')]);}_0x13d372['order']=qs[_0x6084('0x7d')](_0x3b02c5[_0x6084('0x72')][_0x6084('0x7d')]);_0x13d372[_0x6084('0x55')]=qs[_0x6084('0x79')](_['pick'](_0x3b02c5[_0x6084('0x72')],_0x2b10f3[_0x6084('0x79')]));_0x13d372['where']['ContactId']=_0x15a837['id'];if(_0x3b02c5[_0x6084('0x72')][_0x6084('0x7f')]){_0x13d372[_0x6084('0x55')]=_['merge'](_0x13d372[_0x6084('0x55')],{'$or':_[_0x6084('0x69')](_0x13d372['attributes'],function(_0x4a8a26){var _0x3a9e35={};_0x3a9e35[_0x4a8a26]={'$like':'%'+_0x3b02c5[_0x6084('0x72')][_0x6084('0x7f')]+'%'};return _0x3a9e35;})});}_0x13d372=_['merge']({},_0x13d372,_0x3b02c5[_0x6084('0x80')]);return db[_0x6084('0x42')][_0x6084('0x11')]({'where':_0x13d372[_0x6084('0x55')]})[_0x6084('0x15')](function(_0xab4ace){_0x541f4a[_0x6084('0x11')]=_0xab4ace;if(_0x3b02c5[_0x6084('0x72')][_0x6084('0x99')]){_0x13d372['include']=[{'all':!![]}];}return db[_0x6084('0x42')][_0x6084('0x1d')](_0x13d372);})[_0x6084('0x15')](function(_0x4e7a09){_0x541f4a['rows']=_0x4e7a09;return _0x541f4a;});}})['then'](respondWithFilteredResult(_0x4391b2,_0x13d372))['catch'](handleError(_0x4391b2,null));};exports[_0x6084('0x9e')]=function(_0x55de50,_0x447b0f){var _0x423393={'raw':!![],'where':{}};var _0x51e5b5={};var _0x26d990={'count':0x0,'rows':[]};return db['CmContact'][_0x6084('0x76')]({'where':{'id':_0x55de50[_0x6084('0x21')]['id']}})['then'](handleEntityNotFound(_0x447b0f,null))[_0x6084('0x15')](function(_0x4e58a7){if(_0x4e58a7){_0x51e5b5['model']=_['keys'](db[_0x6084('0x49')][_0x6084('0x78')]);_0x51e5b5[_0x6084('0x72')]=_['keys'](_0x55de50[_0x6084('0x72')]);_0x51e5b5[_0x6084('0x79')]=_[_0x6084('0x7a')](_0x51e5b5[_0x6084('0x77')],_0x51e5b5[_0x6084('0x72')]);_0x423393['attributes']=_['intersection'](_0x51e5b5['model'],qs[_0x6084('0x7c')](_0x55de50['query'][_0x6084('0x7c')]));_0x423393['attributes']=_0x423393[_0x6084('0x7b')]['length']?_0x423393[_0x6084('0x7b')]:_0x51e5b5['model'];if(!_0x55de50[_0x6084('0x72')]['hasOwnProperty']('nolimit')){_0x423393[_0x6084('0x12')]=qs['limit'](_0x55de50[_0x6084('0x72')][_0x6084('0x12')]);_0x423393['offset']=qs[_0x6084('0xf')](_0x55de50['query']['offset']);}_0x423393[_0x6084('0x9c')]=qs[_0x6084('0x7d')](_0x55de50[_0x6084('0x72')][_0x6084('0x7d')]);_0x423393[_0x6084('0x55')]=qs['filters'](_[_0x6084('0x97')](_0x55de50[_0x6084('0x72')],_0x51e5b5['filters']));_0x423393[_0x6084('0x55')][_0x6084('0x98')]=_0x4e58a7['id'];if(_0x55de50['query'][_0x6084('0x7f')]){_0x423393[_0x6084('0x55')]=_['merge'](_0x423393[_0x6084('0x55')],{'$or':_[_0x6084('0x69')](_0x423393[_0x6084('0x7b')],function(_0x5ea38d){var _0x27043c={};_0x27043c[_0x5ea38d]={'$like':'%'+_0x55de50[_0x6084('0x72')][_0x6084('0x7f')]+'%'};return _0x27043c;})});}_0x423393=_['merge']({},_0x423393,_0x55de50[_0x6084('0x80')]);return db['JscriptySessionReport'][_0x6084('0x11')]({'where':_0x423393[_0x6084('0x55')]})[_0x6084('0x15')](function(_0x561870){_0x26d990[_0x6084('0x11')]=_0x561870;if(_0x55de50[_0x6084('0x72')][_0x6084('0x99')]){_0x423393['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x6084('0x1d')](_0x423393);})[_0x6084('0x15')](function(_0x3601e1){_0x26d990['rows']=_0x3601e1;return _0x26d990;});}})[_0x6084('0x15')](respondWithFilteredResult(_0x447b0f,_0x423393))[_0x6084('0x1e')](handleError(_0x447b0f,null));};exports[_0x6084('0x9f')]=function(_0x596888,_0x38d3e2){try{if(!_0x596888[_0x6084('0x2f')][_0x6084('0x58')]){throw new Error(_0x6084('0xa0'));}if(!_0x596888[_0x6084('0x2f')][_0x6084('0xa1')]){throw new Error(_0x6084('0xa2'));}if(!_0x596888[_0x6084('0x2f')][_0x6084('0xa3')]){throw new Error(_0x6084('0xa4'));}if(!_0x596888[_0x6084('0x2f')][_0x6084('0xa5')]){throw new Error(_0x6084('0xa6'));}var _0x4f67e6=_0x596888[_0x6084('0x2f')][_0x6084('0xa1')][_0x6084('0xa7')](',');var _0xcba5ea=_0x596888[_0x6084('0x2f')][_0x6084('0xa3')][_0x6084('0xa7')](',');if(!_0x4f67e6['length']||!_0xcba5ea[_0x6084('0x25')]||_0x4f67e6['length']!==_0xcba5ea[_0x6084('0x25')]){throw new Error(_0x6084('0xa8'));}_0x596888[_0x6084('0x2f')]['fields']=_['zipObject'](_0x4f67e6,_0xcba5ea);if(!_0x596888['body'][_0x6084('0x7c')][_0x6084('0x74')]){throw new Error(_0x6084('0xa9'));}if(!_0x596888[_0x6084('0x2f')][_0x6084('0x7c')][_0x6084('0xaa')]){throw new Error(_0x6084('0xab'));}var _0x31f645=path[_0x6084('0x33')](config[_0x6084('0xac')],_0x6084('0xad'),_0x596888[_0x6084('0xae')][_0x6084('0xaf')]);fs[_0x6084('0xb0')](_0x31f645,parseInt(_0x6084('0xb1'),0x8));var _0x30469d=require(_0x6084('0xb2'))[_0x6084('0xb3')](path[_0x6084('0x33')](__dirname,_0x6084('0xb4')),[_0x31f645,_0x596888['body']['binding_keys'],_0x596888[_0x6084('0x2f')]['binding_values'],_0x596888[_0x6084('0x2f')]['ListId'],_0x596888[_0x6084('0x2f')][_0x6084('0xb5')],_0x596888[_0x6084('0x2f')]['duplicates'],_0x596888[_0x6084('0x2f')][_0x6084('0xa5')]]);return _0x38d3e2[_0x6084('0xd')](0xc8)[_0x6084('0xe')]({'message':'File\x20uploaded\x20correctly!','pid':_0x30469d[_0x6084('0xb6')]});}catch(_0x326e40){return _0x38d3e2[_0x6084('0xd')](0x1f4)[_0x6084('0xb7')](_0x326e40);}};exports[_0x6084('0xb8')]=function(_0x324dc3,_0x5199d4){var _0x24deaa=fs[_0x6084('0xb9')](_0x324dc3[_0x6084('0xae')][_0x6084('0x2')]);Papa[_0x6084('0xba')](_0x24deaa,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3cb9d7){return _0x5199d4[_0x6084('0xd')](0xc8)[_0x6084('0xe')]({'file':_0x324dc3[_0x6084('0xae')],'fields':_0x3cb9d7[_0x6084('0xbb')]['fields']});}});};exports['import']=function(_0xc70eff,_0x13d39a){return db[_0x6084('0xbc')][_0x6084('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x6084('0xbd')}})[_0x6084('0x15')](function(_0x3edd82){var _0x365488=![];if(!_0xc70eff['body'][_0x6084('0x58')]){throw new Error(_0x6084('0xa0'));}if(!_0xc70eff[_0x6084('0x2f')][_0x6084('0xbe')]['phone']){throw new Error(_0x6084('0xa9'));}if(!_0xc70eff[_0x6084('0x2f')][_0x6084('0xbe')][_0x6084('0xaa')]){throw new Error(_0x6084('0xab'));}if(!_0xc70eff[_0x6084('0x2f')][_0x6084('0xa5')]){throw new Error(_0x6084('0xa6'));}var _0x156d2f=require(_0x6084('0xb2'))[_0x6084('0xb3')](path['join'](__dirname,_0x6084('0xbf')),[_0xc70eff[_0x6084('0x21')]['id'],JSON['stringify'](_0xc70eff[_0x6084('0x2f')]),JSON[_0x6084('0xc0')](_0x3edd82)]);_0x156d2f['on'](_0x6084('0xc1'),function(){_0x365488=!![];return _0x13d39a['status'](0xc8)[_0x6084('0xe')]({'message':_0x6084('0xc2'),'pid':_0x156d2f[_0x6084('0xb6')]});});_0x156d2f['on'](_0x6084('0xc3'),function(_0x4f6bce){if(_0x4f6bce&&!_0x365488){return _0x13d39a[_0x6084('0xd')](0x1f4)[_0x6084('0xe')]({'message':_0x6084('0xc4'),'pid':_0x156d2f[_0x6084('0xb6')]});}});})[_0x6084('0x1e')](handleError(_0x13d39a,null));};exports[_0x6084('0xc5')]=function(_0x152836,_0x2f3ce7){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x6084('0xbd')}})['then'](function(_0x4d1f79){var _0xd56dcd=![];if(!_0x152836['body'][_0x6084('0x58')]){throw new Error(_0x6084('0xa0'));}if(!_0x152836[_0x6084('0x2f')][_0x6084('0xbe')][_0x6084('0x74')]){throw new Error(_0x6084('0xa9'));}if(!_0x152836[_0x6084('0x2f')][_0x6084('0xbe')][_0x6084('0xaa')]){throw new Error(_0x6084('0xab'));}if(!_0x152836[_0x6084('0x2f')][_0x6084('0xa5')]){throw new Error(_0x6084('0xa6'));}var _0x7b8af1=require(_0x6084('0xb2'))[_0x6084('0xb3')](path[_0x6084('0x33')](__dirname,'../../components/import/cm/csvUpdates'),[_0x152836['params']['id'],JSON['stringify'](_0x152836[_0x6084('0x2f')]),JSON[_0x6084('0xc0')](_0x4d1f79)]);_0x7b8af1['on'](_0x6084('0xc1'),function(){_0xd56dcd=!![];return _0x2f3ce7['status'](0xc8)['json']({'message':_0x6084('0xc2'),'pid':_0x7b8af1['pid']});});_0x7b8af1['on'](_0x6084('0xc3'),function(_0x43ab0a){if(_0x43ab0a&&!_0xd56dcd){return _0x2f3ce7['status'](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x7b8af1[_0x6084('0xb6')]});}});})[_0x6084('0x1e')](handleError(_0x2f3ce7,null));};exports[_0x6084('0xc6')]=function(_0x4c80cb,_0x1a4e1a){var _0x157f41=['mail',_0x6084('0xc7'),'sms',_0x6084('0xc8'),'fax',_0x6084('0xc9'),_0x6084('0xca')];var _0x46999d={'offset':0x0,'order':qs['sort'](_0x6084('0xcb'))},_0x528ead={'count':0x0,'rows':[]};Promise['resolve']()[_0x6084('0x15')](function(){if(_0x4c80cb[_0x6084('0x72')][_0x6084('0xcc')]){if(!_[_0x6084('0xcd')](_0x157f41,_0x4c80cb[_0x6084('0x72')]['channel']['toLowerCase']())){throw new Error(_0x6084('0xce'));}_0x157f41=[_0x4c80cb[_0x6084('0x72')][_0x6084('0xcc')][_0x6084('0xcf')]()];}if(_0x4c80cb['query']['range']){try{var _0xae6a33=JSON[_0x6084('0xba')](_0x4c80cb[_0x6084('0x72')][_0x6084('0xd0')]);if(!moment(_0xae6a33[_0x6084('0x35')])[_0x6084('0xd1')]()){throw new Error(_0x6084('0xd2'));}if(!moment(_0xae6a33['to'])[_0x6084('0xd1')]()){throw new Error(_0x6084('0xd3'));}}catch(_0x4e2941){throw new Error(_0x6084('0xd4'));}}if(!_0x4c80cb[_0x6084('0x72')]['hasOwnProperty']('nolimit')){_0x46999d['limit']=qs[_0x6084('0x12')](_0x4c80cb[_0x6084('0x72')][_0x6084('0x12')]||0xa);_0x46999d[_0x6084('0xf')]=qs[_0x6084('0xf')](_0x4c80cb[_0x6084('0x72')][_0x6084('0xf')]);}var _0x4c4ba1=_0x157f41[_0x6084('0x69')](function(_0x4aa8db){if(_0x4aa8db==='voice'){var _0x11e8b3={'attributes':['id',_0x6084('0xd5'),_0x6084('0xd6'),_0x6084('0xd7'),_0x6084('0xd8'),'callerid',_0x6084('0xd9'),_0x6084('0xda'),_0x6084('0xdb'),_0x6084('0xdc'),_0x6084('0xdd'),_0x6084('0xde'),_0x6084('0xdf'),_0x6084('0xe0'),'UserId'],'where':{'ContactId':_0x4c80cb[_0x6084('0x21')]['id']},'include':[{'model':db[_0x6084('0xbc')],'as':'User','attributes':['id','name',_0x6084('0xe1'),'alias']}],'order':[[_0x6084('0xdd'),_0x6084('0xe2')]]};if(_0x4c80cb[_0x6084('0x72')][_0x6084('0xd0')]){_0x11e8b3[_0x6084('0x55')][_0x6084('0xdd')]={'$gte':_0xae6a33[_0x6084('0x35')],'$lte':_0xae6a33['to']};}return db[_0x6084('0x44')][_0x6084('0xe3')](_0x11e8b3)[_0x6084('0x15')](function(_0x222e98){_0x528ead[_0x6084('0x11')]+=_0x222e98['count'];return _[_0x6084('0x69')](_0x222e98[_0x6084('0x9a')],function(_0xdcca66){var _0x362ca2=_0xdcca66['get']({'plain':!![]});_0x362ca2['channel']=_0x4aa8db;if(_0x362ca2[_0x6084('0xbc')]){_0x362ca2[_0x6084('0xbc')]={'id':_0x362ca2['User']['id'],'name':_0x362ca2[_0x6084('0xbc')][_0x6084('0x1a')],'fullname':_0x362ca2['User'][_0x6084('0xe1')],'alias':_0x362ca2['User'][_0x6084('0x29')]};}return _0x362ca2;});});}else{var _0x2261cd=_[_0x6084('0xe4')](_0x4aa8db)+(_0x4aa8db===_0x6084('0xc7')?_0x6084('0xe5'):_0x6084('0xe6'));var _0xe6bba0={'attributes':['id',_0x6084('0xe7'),_0x6084('0xe8'),_0x6084('0xdd'),'note',_0x6084('0xe9'),_0x6084('0xea'),_0x6084('0xeb'),_0x6084('0xec'),_0x2261cd+'Id'],'where':{'ContactId':_0x4c80cb[_0x6084('0x21')]['id']},'include':[{'model':db[_0x2261cd],'as':_0x6084('0xe6'),'attributes':['id',_0x6084('0x1a'),_0x6084('0xed')]},{'model':db[_0x6084('0xbc')],'as':_0x6084('0xee'),'attributes':['id',_0x6084('0x1a'),_0x6084('0xe1')]},{'model':db[_0x6084('0x5d')],'as':_0x6084('0x5e'),'attributes':['id',_0x6084('0x1a'),_0x6084('0xef')],'through':{'attributes':[]}}],'order':[['createdAt','DESC']]};if(_0x4c80cb[_0x6084('0x72')]['range']){_0xe6bba0[_0x6084('0x55')]['createdAt']={'$gte':_0xae6a33[_0x6084('0x35')],'$lte':_0xae6a33['to']};}switch(_0x4aa8db){case _0x6084('0xc7'):_0xe6bba0['attributes'][_0x6084('0x57')](_0x6084('0xf0'),'customerIp',_0x6084('0xf1'),'deviceModel',_0x6084('0xf2'),_0x6084('0xf3'),'ratingType',_0x6084('0xf4'),_0x6084('0xf5'));break;case _0x6084('0xf6'):_0xe6bba0['attributes'][_0x6084('0x57')]('subject',_0x6084('0xf7'));break;case _0x6084('0xc8'):_0xe6bba0[_0x6084('0x7b')]['push'](_0x6084('0xf8'),_0x6084('0xf9'));break;}return db[_[_0x6084('0xe4')](_0x4aa8db)+_0x6084('0xfa')][_0x6084('0xe3')](_0xe6bba0)[_0x6084('0x15')](function(_0x3edb8f){_0x528ead[_0x6084('0x11')]+=_0x3edb8f[_0x6084('0x11')];return _['map'](_0x3edb8f[_0x6084('0x9a')],function(_0x928f74){var _0x3c0047=_0x928f74[_0x6084('0x30')]({'plain':!![]});_0x3c0047['channel']=_0x4aa8db;if(_0x3c0047[_0x6084('0xee')]){_0x3c0047[_0x6084('0xee')]={'id':_0x3c0047['Owner']['id'],'name':_0x3c0047[_0x6084('0xee')]['name'],'fullname':_0x3c0047['Owner'][_0x6084('0xe1')]};}return _0x3c0047;});});}});return Promise[_0x6084('0x5b')](_0x4c4ba1);})[_0x6084('0x15')](function(_0xa78f72){return _(_0xa78f72)[_0x6084('0xfb')]()[_0x6084('0xfc')]('createdAt')[_0x6084('0xfd')]()[_0x6084('0xfe')]();})[_0x6084('0x15')](function(_0xa650be){_0x528ead[_0x6084('0x9a')]=_0x46999d[_0x6084('0x12')]?_0xa650be[_0x6084('0xff')](_0x46999d[_0x6084('0xf')],_0x46999d['offset']+_0x46999d[_0x6084('0x12')]):_0xa650be;return _0x528ead;})[_0x6084('0x15')](respondWithFilteredResult(_0x1a4e1a,_0x46999d))[_0x6084('0x1e')](handleError(_0x1a4e1a,null));}; \ No newline at end of file +var _0xbd77=['create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','show','params','Tag','tag','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','omit','map','format','cf_%d','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','model','rawAttributes','filters','intersection','fields','attributes','order','sort','pick','filter','merge','getTags','setTags','findOne','ids','all','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','literal','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','options','include','rows','getHopperHistories','ContactId','getHopperFinals','includeAll','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','split','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','import','User','agent','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','importUpdates','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','source','destination','callerid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','UserId','DESC','createdAt','findAndCountAll','fullname','Website','Account','closed','disposition','secondDisposition','thirdDisposition','key','Owner','color','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','subject','substatus','openchannel','externalUrl','threadId','startCase','Interaction','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','squel','../../components/contacts','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','register','status','json','offset','count','limit','set','Content-Range','update','then','destroy','end','sendStatus','name','send','index','findAll','query','user','CmContact','find','catch','describe','tags','keys','length','startsWith','cf_','columnName','analytics','CmCustomField','alias','type','values','info','forEach','hasOwnProperty','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s'];(function(_0x3415d5,_0xf7cd6c){var _0xe2007a=function(_0x92e1e0){while(--_0x92e1e0){_0x3415d5['push'](_0x3415d5['shift']());}};_0xe2007a(++_0xf7cd6c);}(_0xbd77,0x1b5));var _0x7bd7=function(_0x487887,_0x478f12){_0x487887=_0x487887-0x0;var _0x2304a0=_0xbd77[_0x487887];return _0x2304a0;};'use strict';var moment=require(_0x7bd7('0x0'));var BPromise=require(_0x7bd7('0x1'));var util=require(_0x7bd7('0x2'));var path=require(_0x7bd7('0x3'));var fs=require('fs');var _=require(_0x7bd7('0x4'));var squel=require(_0x7bd7('0x5'));var Papa=require('papaparse');var Redis=require('ioredis');var contacts=require(_0x7bd7('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x7bd7('0x7'))(_0x7bd7('0x8'));var config=require(_0x7bd7('0x9'));var shared=require('../../config/environment/shared');var db=require(_0x7bd7('0xa'))['db'];config['redis']=_[_0x7bd7('0xb')](config['redis'],{'host':_0x7bd7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')[_0x7bd7('0xd')](socket);function respondWithResult(_0xfff3bb,_0x22d5b4){_0x22d5b4=_0x22d5b4||0xc8;return function(_0x5d05ce){if(_0x5d05ce){return _0xfff3bb[_0x7bd7('0xe')](_0x22d5b4)[_0x7bd7('0xf')](_0x5d05ce);}};}function respondWithFilteredResult(_0x1a87f9,_0x22f279){return function(_0x1bee61){if(_0x1bee61){var _0x12a44f=typeof _0x22f279[_0x7bd7('0x10')]==='undefined'&&typeof _0x22f279['limit']==='undefined';var _0x3ce8ef=_0x1bee61[_0x7bd7('0x11')];var _0x18d7c5=_0x12a44f?0x0:_0x22f279[_0x7bd7('0x10')];var _0x242495=_0x12a44f?_0x1bee61['count']:_0x22f279[_0x7bd7('0x10')]+_0x22f279[_0x7bd7('0x12')];var _0x3a63b8;if(_0x242495>=_0x3ce8ef){_0x242495=_0x3ce8ef;_0x3a63b8=0xc8;}else{_0x3a63b8=0xce;}_0x1a87f9[_0x7bd7('0xe')](_0x3a63b8);return _0x1a87f9[_0x7bd7('0x13')](_0x7bd7('0x14'),_0x18d7c5+'-'+_0x242495+'/'+_0x3ce8ef)[_0x7bd7('0xf')](_0x1bee61);}return null;};}function saveUpdates(_0x4a4e98){return function(_0x53006a){if(_0x53006a){return _0x53006a[_0x7bd7('0x15')](_0x4a4e98)[_0x7bd7('0x16')](function(_0x357df1){return _0x357df1;});}return null;};}function removeEntity(_0x5e7bab){return function(_0xbda442){if(_0xbda442){return _0xbda442[_0x7bd7('0x17')]()[_0x7bd7('0x16')](function(){_0x5e7bab['status'](0xcc)[_0x7bd7('0x18')]();});}};}function handleEntityNotFound(_0xd1f930){return function(_0x28ce4b){if(!_0x28ce4b){_0xd1f930[_0x7bd7('0x19')](0x194);}return _0x28ce4b;};}function handleError(_0x56b9c4,_0x19b3ea){_0x19b3ea=_0x19b3ea||0x1f4;return function(_0x4675d8){logger['error'](_0x4675d8['stack']);if(_0x4675d8[_0x7bd7('0x1a')]){delete _0x4675d8[_0x7bd7('0x1a')];}_0x56b9c4[_0x7bd7('0xe')](_0x19b3ea)[_0x7bd7('0x1b')](_0x4675d8);};}exports[_0x7bd7('0x1c')]=function(_0x3804cf,_0x1f4d3d){var _0x330535={};return contacts['describe']()['then'](function(_0xcdbee8){_0x330535=qs['getOptions'](_0xcdbee8,_0x3804cf);return contacts[_0x7bd7('0x1d')](_0x3804cf[_0x7bd7('0x1e')],_0x3804cf[_0x7bd7('0x1f')],_0x330535,_0xcdbee8);})['then'](respondWithFilteredResult(_0x1f4d3d,_0x330535))['catch'](handleError(_0x1f4d3d,null));};exports[_0x7bd7('0x17')]=function(_0x2b60db,_0x2c37a7){return db[_0x7bd7('0x20')][_0x7bd7('0x21')]({'where':{'id':_0x2b60db['params']['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x2c37a7,null))[_0x7bd7('0x16')](removeEntity(_0x2c37a7,null))[_0x7bd7('0x22')](handleError(_0x2c37a7,null));};exports[_0x7bd7('0x23')]=function(_0x3a5e2c,_0x40c240){return db[_0x7bd7('0x20')]['describe']()['then'](function(_0x1b3934){delete _0x1b3934[_0x7bd7('0x24')];for(var _0x5ed15a=0x0;_0x5ed15a0x0){return new Promise(function(_0x25fd4d){var _0x4d4221=[];for(var _0x4794a8=0x0;_0x4794a8<_0x4d32d8['length'];_0x4794a8++){_0x4d4221[_0x7bd7('0x5a')](insertAdditionalPhones(_0x4d32d8[_0x4794a8][_0x7bd7('0x5e')],_0x4d32d8[_0x4794a8][_0x7bd7('0x55')]));}Promise['all'](_0x4d4221)[_0x7bd7('0x16')](function(){_0x25fd4d(0x1);});})['then'](function(){return{'success':_0x79ad7d,'failure':_0x6a777,'duplicates':_0x27ed28};});}else{return{'success':_0x79ad7d,'failure':_0x6a777,'duplicates':_0x27ed28};}}})['then'](respondWithResult(_0x15354a,0xc9))[_0x7bd7('0x22')](handleError(_0x15354a,null));};exports[_0x7bd7('0x5f')]=function(_0x281607,_0x29d975){var _0x5b9235;return db[_0x7bd7('0x20')][_0x7bd7('0x23')]()['then'](function(_0x3622e2){return db[_0x7bd7('0x20')][_0x7bd7('0x21')]({'where':{'id':_0x281607[_0x7bd7('0x60')]['id']},'include':[{'model':db[_0x7bd7('0x61')],'as':'Tags','attributes':['id','name','color'],'required':_0x281607['query'][_0x7bd7('0x62')]?!![]:![]},{'model':db[_0x7bd7('0x48')],'as':_0x7bd7('0x63'),'where':{'CmContactId':_0x281607['params']['id']},'required':![],'include':[{'model':db[_0x7bd7('0x64')],'as':_0x7bd7('0x65')}]}],'order':[db[_0x7bd7('0x66')]['literal'](_0x7bd7('0x67'))],'attributes':_['keys'](_0x3622e2)});})[_0x7bd7('0x16')](function(_0x4bf6e2){if(!_[_0x7bd7('0x51')](_0x4bf6e2)){_0x5b9235=_0x4bf6e2[_0x7bd7('0x34')]({'plain':!![]});var _0x30bd5f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4bf6e2&&_0x4bf6e2[_0x7bd7('0x5b')]){if(_0x4bf6e2[_0x7bd7('0x5b')]){_0x30bd5f[_0x7bd7('0x58')][_0x7bd7('0x68')]['push']({'ListId':{'$ne':_0x4bf6e2[_0x7bd7('0x5b')]}});}}return db['CmCustomField'][_0x7bd7('0x1d')](_0x30bd5f);}})[_0x7bd7('0x16')](function(_0x29d680){if(!_[_0x7bd7('0x51')](_0x29d680)){return _[_0x7bd7('0x69')](_0x5b9235,_[_0x7bd7('0x6a')](_0x29d680,function(_0x233b91){return util[_0x7bd7('0x6b')](_0x7bd7('0x6c'),_0x233b91['id']);}));}})[_0x7bd7('0x16')](handleEntityNotFound(_0x29d975,null))[_0x7bd7('0x16')](respondWithResult(_0x29d975,null))[_0x7bd7('0x22')](handleError(_0x29d975,null));};exports['update']=function(_0x1853cd,_0x4e859a){var _0x693f44;if(_0x1853cd[_0x7bd7('0x32')]['id']){delete _0x1853cd['body']['id'];}if(!_['isNil'](_0x1853cd[_0x7bd7('0x32')]['dialTimezone'])){var _0x269100=_0x1853cd[_0x7bd7('0x32')][_0x7bd7('0x52')];if(!_[_0x7bd7('0x51')](shared[_0x7bd7('0x54')][_0x269100]))_0x1853cd[_0x7bd7('0x32')]['utcOffset']=shared[_0x7bd7('0x54')][_0x269100][_0x7bd7('0x53')];}return db[_0x7bd7('0x20')][_0x7bd7('0x21')]({'where':{'id':_0x1853cd['params']['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x4e859a,null))[_0x7bd7('0x16')](saveUpdates(_0x1853cd[_0x7bd7('0x32')],null))[_0x7bd7('0x16')](function(_0x4c68f1){_0x693f44=_0x4c68f1;var _0x5d6458={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4c68f1&&_0x4c68f1[_0x7bd7('0x5b')]){if(_0x4c68f1['ListId']){_0x5d6458[_0x7bd7('0x58')][_0x7bd7('0x68')][_0x7bd7('0x5a')]({'ListId':{'$ne':_0x4c68f1[_0x7bd7('0x5b')]}});}}return db[_0x7bd7('0x2b')]['findAll'](_0x5d6458);})['then'](function(_0x48825a){if(_0x48825a){return _['omit'](_['pickBy'](_0x1853cd[_0x7bd7('0x32')],function(_0x77a6b2,_0x3d0a7a){return _[_0x7bd7('0x27')](_0x3d0a7a,_0x7bd7('0x28'));}),_['map'](_0x48825a,function(_0x3e8db6){return util[_0x7bd7('0x6b')](_0x7bd7('0x6c'),_0x3e8db6['id']);}));}})[_0x7bd7('0x16')](function(_0x5e2fa5){if(_0x5e2fa5&&!_[_0x7bd7('0x6d')](_0x5e2fa5)){var _0x42eb37=squel[_0x7bd7('0x15')]()[_0x7bd7('0x6e')](_0x7bd7('0x6f'))[_0x7bd7('0x70')](_0x5e2fa5)[_0x7bd7('0x58')](_0x7bd7('0x71'),_0x1853cd[_0x7bd7('0x60')]['id'])[_0x7bd7('0x72')]();return db[_0x7bd7('0x66')][_0x7bd7('0x1e')](_0x42eb37[_0x7bd7('0x73')],{'replacements':_0x42eb37['values']});}})['then'](function(){if(_0x1853cd[_0x7bd7('0x32')]['phone']&&_0x693f44){return db[_0x7bd7('0x39')]['update']({'phone':_0x1853cd[_0x7bd7('0x32')][_0x7bd7('0x74')],'OrderBy':0x0},{'where':{'ContactId':_0x693f44['id']}});}})['then'](function(){return _0x693f44;})[_0x7bd7('0x16')](respondWithResult(_0x4e859a,null))[_0x7bd7('0x22')](handleError(_0x4e859a,null));};exports['getTags']=function(_0x1fb1ed,_0x59a3f0){var _0xef3f68={};var _0x4b1788={};var _0x5b0d32;var _0x572199;return db[_0x7bd7('0x20')]['findOne']({'where':{'id':_0x1fb1ed[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x59a3f0,null))[_0x7bd7('0x16')](function(_0x390052){if(_0x390052){_0x5b0d32=_0x390052;_0x4b1788[_0x7bd7('0x75')]=_['keys'](db[_0x7bd7('0x61')][_0x7bd7('0x76')]);_0x4b1788[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x1fb1ed[_0x7bd7('0x1e')]);_0x4b1788[_0x7bd7('0x77')]=_['intersection'](_0x4b1788[_0x7bd7('0x75')],_0x4b1788[_0x7bd7('0x1e')]);_0xef3f68['attributes']=_[_0x7bd7('0x78')](_0x4b1788[_0x7bd7('0x75')],qs[_0x7bd7('0x79')](_0x1fb1ed[_0x7bd7('0x1e')]['fields']));_0xef3f68['attributes']=_0xef3f68[_0x7bd7('0x7a')]['length']?_0xef3f68[_0x7bd7('0x7a')]:_0x4b1788['model'];_0xef3f68[_0x7bd7('0x7b')]=qs['sort'](_0x1fb1ed['query'][_0x7bd7('0x7c')]);_0xef3f68[_0x7bd7('0x58')]=qs[_0x7bd7('0x77')](_[_0x7bd7('0x7d')](_0x1fb1ed[_0x7bd7('0x1e')],_0x4b1788[_0x7bd7('0x77')]));if(_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0xef3f68[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0xef3f68['where'],{'$or':_['map'](_0xef3f68[_0x7bd7('0x7a')],function(_0x5d6362){var _0x229e33={};_0x229e33[_0x5d6362]={'$like':'%'+_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x7e')]+'%'};return _0x229e33;})});}_0xef3f68=_[_0x7bd7('0x7f')]({},_0xef3f68,_0x1fb1ed['options']);return _0x5b0d32[_0x7bd7('0x80')](_0xef3f68);}})[_0x7bd7('0x16')](function(_0x122eb8){if(_0x122eb8){_0x572199=_0x122eb8['length'];if(!_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x31')]('nolimit')){_0xef3f68[_0x7bd7('0x12')]=qs['limit'](_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x12')]);_0xef3f68[_0x7bd7('0x10')]=qs[_0x7bd7('0x10')](_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x10')]);}return _0x5b0d32[_0x7bd7('0x80')](_0xef3f68);}})[_0x7bd7('0x16')](function(_0x2b725a){if(_0x2b725a){return _0x2b725a?{'count':_0x572199,'rows':_0x2b725a}:null;}})['then'](respondWithResult(_0x59a3f0,null))[_0x7bd7('0x22')](handleError(_0x59a3f0,null));};exports[_0x7bd7('0x81')]=function(_0x56a120,_0x326289){if(_0x56a120['body']['id']){delete _0x56a120[_0x7bd7('0x32')]['id'];}return db['CmContact'][_0x7bd7('0x82')]({'where':{'id':_0x56a120[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x326289,null))['then'](function(_0xe6400e){if(_0xe6400e){return _0xe6400e['setTags'](_0x56a120['body'][_0x7bd7('0x83')]||[]);}return null;})[_0x7bd7('0x16')](respondWithResult(_0x326289,null))[_0x7bd7('0x22')](handleError(_0x326289,null));};exports['setAdditionalPhones']=function(_0xcd8c05,_0x406301){var _0x3306b2=[];_0x3306b2[_0x7bd7('0x5a')](addAdditionalPhones(_0xcd8c05[_0x7bd7('0x32')]));Promise[_0x7bd7('0x84')](_0x3306b2)[_0x7bd7('0x16')](function(){_0x3306b2=[];_0x3306b2[_0x7bd7('0x5a')](deleteCmHopperPhones(_0xcd8c05['body']['id']));_0x3306b2[_0x7bd7('0x5a')](addCmHopperPhones(_0xcd8c05[_0x7bd7('0x32')]['id']));Promise['all'](_0x3306b2)[_0x7bd7('0x16')](function(){return[0x1];})[_0x7bd7('0x16')](respondWithResult(_0x406301,null));});};function addAdditionalPhones(_0x559c1d){var _0x259360;return new Promise(function(_0x3cb784){return db[_0x7bd7('0x48')][_0x7bd7('0x17')]({'where':{'CmContactId':_0x559c1d['id']}})[_0x7bd7('0x16')](function(){db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x7bd7('0x85')]})[_0x7bd7('0x16')](function(_0xac10e6){var _0x7f9e05=[];for(var _0x44caac=0x0;_0x44caac<_0x559c1d[_0x7bd7('0x86')][_0x7bd7('0x26')];_0x44caac++){var _0x54fa7f=_0x559c1d[_0x7bd7('0x87')]?_[_0x7bd7('0x51')](_0x559c1d['item_types'][_0x44caac])?'':_0x559c1d[_0x7bd7('0x87')][_0x44caac]:_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x88')]?_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x88')]:'';var _0x33098b=_[_0x7bd7('0x51')](_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x89')])?'':_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x89')];var _0x53fadd=_0x54fa7f+':'+_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x74')]+'§'+_0x33098b;if(_[_0x7bd7('0x51')](_0x259360))_0x259360=_0x53fadd;else _0x259360+=';'+_0x53fadd;var _0xa84539=null;var _0x230ccf=null;if(_0x559c1d[_0x7bd7('0x87')]){if(!_[_0x7bd7('0x51')](_0x559c1d[_0x7bd7('0x87')][_0x44caac])){_0x230ccf=_[_0x7bd7('0x21')](_0xac10e6,function(_0xdea420){return _0xdea420['id']===_0x559c1d[_0x7bd7('0x87')][_0x44caac];});if(!_['isNil'](_0x230ccf)){_0xa84539=_0x230ccf[_0x7bd7('0x85')];}}}else{if(!_['isNil'](_0x559c1d[_0x7bd7('0x86')][_0x44caac])){_0x230ccf=_[_0x7bd7('0x21')](_0xac10e6,function(_0x34f1f8){return _0x34f1f8['id']===_0x559c1d[_0x7bd7('0x86')][_0x44caac]['ItemTypeId'];});if(!_[_0x7bd7('0x51')](_0x230ccf)){_0xa84539=_0x44caac;}}}if(_['isNil'](_0xa84539)){_0xa84539=0x64;}_0x7f9e05[_0x7bd7('0x5a')](addAdditionalPhone(_0x559c1d['id'],_0x559c1d['items'][_0x44caac][_0x7bd7('0x74')],_0x559c1d['item_types']?_['isNil'](_0x559c1d[_0x7bd7('0x87')][_0x44caac])?null:_0x559c1d['item_types'][_0x44caac]:_0x559c1d['items'][_0x44caac][_0x7bd7('0x88')]?_0x559c1d['items'][_0x44caac]['ItemTypeId']:null,_0xa84539,_0x33098b));}Promise[_0x7bd7('0x84')](_0x7f9e05)[_0x7bd7('0x16')](function(){db[_0x7bd7('0x20')][_0x7bd7('0x15')]({'AdditionalPhones':_0x259360},{'where':{'id':_0x559c1d['id']}})['then'](function(){_0x3cb784(0x1);});});});});});}function addAdditionalPhone(_0x5362b9,_0x5ccdb9,_0x490dd1,_0x3c82a9,_0x381d46){return db[_0x7bd7('0x48')][_0x7bd7('0x21')]({'where':{'CmContactId':_0x5362b9,'item':_0x5ccdb9}})['then'](function(_0x55dbe8){if(_0x55dbe8)logger[_0x7bd7('0x2f')](_0x7bd7('0x8a'),_0x55dbe8);else{db[_0x7bd7('0x48')][_0x7bd7('0x3d')]({'CmContactId':_0x5362b9,'item':_0x5ccdb9,'ItemTypeId':_0x490dd1,'OrderBy':_0x3c82a9,'ItemClass':'PHONE','description':_0x381d46});}});}function deleteCmHopperPhones(_0x449dea){return new Promise(function(_0x58db1a){return db[_0x7bd7('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x449dea}})[_0x7bd7('0x16')](function(_0x21f756){db[_0x7bd7('0x8b')][_0x7bd7('0x17')]({'where':{'CmHopperId':{'$in':_['map'](_0x21f756,'id')}}});})[_0x7bd7('0x16')](function(){_0x58db1a(0x1);});});}function addCmHopperPhones(_0xcb1cd9){return new Promise(function(_0x2d9120){return db['CmHopper'][_0x7bd7('0x1d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xcb1cd9}})[_0x7bd7('0x16')](function(_0x8b5da){var _0xf9ee6b=[];_['map'](_0x8b5da,function(_0x320c86){_0xf9ee6b[_0x7bd7('0x5a')](createCmHopperPhone(_0xcb1cd9,_0x320c86['id']));});Promise[_0x7bd7('0x84')](_0xf9ee6b)['then'](function(){_0x2d9120(0x1);});});});}function createCmHopperPhone(_0xb18bb1,_0x556b0d){return new Promise(function(_0x3d3886){db['CmContactHasItem'][_0x7bd7('0x1d')]({'raw':!![],'attributes':[_0x7bd7('0x8c'),'OrderBy'],'where':{'CmContactId':_0xb18bb1,'ItemClass':_0x7bd7('0x8d')},'include':[{'model':db[_0x7bd7('0x64')],'attributes':[_0x7bd7('0x85')],'as':_0x7bd7('0x65')}],'order':[_0x7bd7('0x85'),db['sequelize'][_0x7bd7('0x8e')]('`ItemType`.OrderBy')]})[_0x7bd7('0x16')](function(_0x3a7a41){var _0x20483a=0x1;var _0x42e09e=_['map'](_0x3a7a41,function(_0x53112e){_0x53112e['CmHopperId']=_0x556b0d;_0x53112e['phone']=_0x53112e[_0x7bd7('0x8c')];_0x53112e[_0x7bd7('0x85')]=_0x20483a;delete _0x53112e[_0x7bd7('0x8f')];_0x20483a=_0x20483a+0x1;return _0x53112e;});return db[_0x7bd7('0x8b')][_0x7bd7('0x56')](_0x42e09e,{});})[_0x7bd7('0x16')](function(){_0x3d3886(0x1);});});}function insertAdditionalPhones(_0x4735e3,_0x161c78){return new Promise(function(_0x20634d){var _0xe529ee=[];for(var _0x432eb6=0x0;_0x432eb6<_0x161c78[_0x7bd7('0x26')];_0x432eb6++){var _0x4bac7f=_0x161c78[_0x432eb6];_0xe529ee['push'](parseContactItemType(_0x4bac7f));}Promise[_0x7bd7('0x84')](_0xe529ee)[_0x7bd7('0x16')](function(){var _0x1d1f92={'id':_0x4735e3['id'],'items':_0x161c78};return addAdditionalPhones(_0x1d1f92)[_0x7bd7('0x16')](function(){return addCmHopperPhones(_0x4735e3['id']);});})[_0x7bd7('0x16')](function(){_0x20634d(_0x4735e3);});});}function parseContactItemType(_0x45a374){return new Promise(function(_0x1d49fe){if(_0x45a374[_0x7bd7('0x31')](_0x7bd7('0x88'))){_0x1d49fe(_0x45a374);}else{return db[_0x7bd7('0x64')]['find']({'where':{'name':_0x45a374['ItemType']}})[_0x7bd7('0x16')](function(_0x1d25af){if(_['isNil'](_0x1d25af))_0x45a374['ItemTypeId']=null;else _0x45a374[_0x7bd7('0x88')]=_0x1d25af['id'];_0x1d49fe(_0x45a374);});}});}exports[_0x7bd7('0x90')]=function(_0xdfe129,_0xc87db0){return db[_0x7bd7('0x48')][_0x7bd7('0x1d')]({'raw':!![],'where':{'CmContactId':_0xdfe129['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':_0x7bd7('0x65')}],'order':[[_0x7bd7('0x85')],[db[_0x7bd7('0x66')]['literal']('`ItemType`.OrderBy')]]})[_0x7bd7('0x16')](function(_0x1aa7aa){return _0x1aa7aa;})[_0x7bd7('0x16')](respondWithResult(_0xc87db0,null))[_0x7bd7('0x22')](handleError(_0xc87db0,null));};exports[_0x7bd7('0x91')]=function(_0x153a94,_0x28c878){return db[_0x7bd7('0x48')][_0x7bd7('0x1d')]({'raw':!![],'where':{'CmContactId':_0x153a94[_0x7bd7('0x32')][_0x7bd7('0x92')]}})[_0x7bd7('0x16')](function(_0x39713d){var _0x4de4c3=_[_0x7bd7('0x6a')](_0x39713d,function(_0x234ccf){_0x234ccf[_0x7bd7('0x93')]=_0x153a94[_0x7bd7('0x32')]['toContactId'];return _0x234ccf;});return db[_0x7bd7('0x48')][_0x7bd7('0x56')](_0x4de4c3,{});})[_0x7bd7('0x16')](function(){return addCmHopperPhones(_0x153a94[_0x7bd7('0x32')][_0x7bd7('0x94')]);})[_0x7bd7('0x16')](function(){return['ok'];})[_0x7bd7('0x16')](respondWithResult(_0x28c878,null))['catch'](handleError(_0x28c878,null));};exports[_0x7bd7('0x95')]=function(_0xa1683c,_0x1bd95a){var _0x502614=[];_0x502614[_0x7bd7('0x5a')](createCmHopperPhone(_0xa1683c['body']['id'],_0xa1683c[_0x7bd7('0x32')][_0x7bd7('0x96')]));Promise[_0x7bd7('0x84')](_0x502614)[_0x7bd7('0x16')](function(){return[0x1];})[_0x7bd7('0x16')](respondWithResult(_0x1bd95a,null));};exports[_0x7bd7('0x97')]=function(_0x5a69da,_0x2d6348){var _0xbbe185={'raw':![],'where':{}};var _0x135de2={};var _0x2a6a40={'count':0x0,'rows':[]};return db[_0x7bd7('0x20')][_0x7bd7('0x82')]({'where':{'id':_0x5a69da[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x2d6348,null))['then'](function(_0x201599){if(_0x201599){_0x135de2[_0x7bd7('0x75')]=_[_0x7bd7('0x25')](db['CmHopper'][_0x7bd7('0x76')]);_0x135de2[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x5a69da[_0x7bd7('0x1e')]);_0x135de2[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0x135de2[_0x7bd7('0x75')],_0x135de2[_0x7bd7('0x1e')]);_0xbbe185[_0x7bd7('0x7a')]=_['intersection'](_0x135de2[_0x7bd7('0x75')],qs['fields'](_0x5a69da['query'][_0x7bd7('0x79')]));_0xbbe185[_0x7bd7('0x7a')]=_0xbbe185['attributes'][_0x7bd7('0x26')]?_0xbbe185[_0x7bd7('0x7a')]:_0x135de2['model'];if(!_0x5a69da['query'][_0x7bd7('0x31')](_0x7bd7('0x98'))){_0xbbe185[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x5a69da[_0x7bd7('0x1e')]['limit']);_0xbbe185[_0x7bd7('0x10')]=qs['offset'](_0x5a69da['query']['offset']);}_0xbbe185[_0x7bd7('0x7b')]=qs['sort'](_0x5a69da[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0xbbe185['where']=qs[_0x7bd7('0x77')](_[_0x7bd7('0x7d')](_0x5a69da[_0x7bd7('0x1e')],_0x135de2[_0x7bd7('0x77')]));_0xbbe185[_0x7bd7('0x58')]['ContactId']=_0x201599['id'];if(_0x5a69da[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0xbbe185[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0xbbe185[_0x7bd7('0x58')],{'$or':_[_0x7bd7('0x6a')](_0xbbe185[_0x7bd7('0x7a')],function(_0x4c0d7d){var _0x10cbc3={};_0x10cbc3[_0x4c0d7d]={'$like':'%'+_0x5a69da[_0x7bd7('0x1e')]['filter']+'%'};return _0x10cbc3;})});}_0xbbe185=_[_0x7bd7('0x7f')]({},_0xbbe185,_0x5a69da[_0x7bd7('0x99')]);return db[_0x7bd7('0x39')][_0x7bd7('0x11')]({'where':_0xbbe185[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0x52cc8e){_0x2a6a40[_0x7bd7('0x11')]=_0x52cc8e;if(_0x5a69da[_0x7bd7('0x1e')]['includeAll']){_0xbbe185[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x39')][_0x7bd7('0x1d')](_0xbbe185);})[_0x7bd7('0x16')](function(_0x40e6ac){_0x2a6a40[_0x7bd7('0x9b')]=_0x40e6ac;return _0x2a6a40;});}})['then'](respondWithFilteredResult(_0x2d6348,_0xbbe185))[_0x7bd7('0x22')](handleError(_0x2d6348,null));};exports[_0x7bd7('0x9c')]=function(_0x133488,_0x4f0653){var _0xa1a741={'raw':!![],'where':{}};var _0x11387c={};var _0x3755b9={'count':0x0,'rows':[]};return db['CmContact'][_0x7bd7('0x82')]({'where':{'id':_0x133488[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x4f0653,null))[_0x7bd7('0x16')](function(_0xc3604c){if(_0xc3604c){_0x11387c[_0x7bd7('0x75')]=_[_0x7bd7('0x25')](db[_0x7bd7('0x4a')]['rawAttributes']);_0x11387c[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x133488[_0x7bd7('0x1e')]);_0x11387c[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0x11387c[_0x7bd7('0x75')],_0x11387c['query']);_0xa1a741[_0x7bd7('0x7a')]=_[_0x7bd7('0x78')](_0x11387c[_0x7bd7('0x75')],qs[_0x7bd7('0x79')](_0x133488['query']['fields']));_0xa1a741[_0x7bd7('0x7a')]=_0xa1a741[_0x7bd7('0x7a')][_0x7bd7('0x26')]?_0xa1a741['attributes']:_0x11387c[_0x7bd7('0x75')];if(!_0x133488[_0x7bd7('0x1e')]['hasOwnProperty'](_0x7bd7('0x98'))){_0xa1a741[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x133488['query'][_0x7bd7('0x12')]);_0xa1a741[_0x7bd7('0x10')]=qs[_0x7bd7('0x10')](_0x133488['query'][_0x7bd7('0x10')]);}_0xa1a741[_0x7bd7('0x7b')]=qs['sort'](_0x133488[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0xa1a741[_0x7bd7('0x58')]=qs[_0x7bd7('0x77')](_[_0x7bd7('0x7d')](_0x133488[_0x7bd7('0x1e')],_0x11387c['filters']));_0xa1a741[_0x7bd7('0x58')][_0x7bd7('0x9d')]=_0xc3604c['id'];if(_0x133488[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0xa1a741[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0xa1a741['where'],{'$or':_['map'](_0xa1a741['attributes'],function(_0x214b52){var _0x2c173c={};_0x2c173c[_0x214b52]={'$like':'%'+_0x133488[_0x7bd7('0x1e')]['filter']+'%'};return _0x2c173c;})});}_0xa1a741=_['merge']({},_0xa1a741,_0x133488[_0x7bd7('0x99')]);return db[_0x7bd7('0x4a')][_0x7bd7('0x11')]({'where':_0xa1a741[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0xf0771f){_0x3755b9['count']=_0xf0771f;if(_0x133488[_0x7bd7('0x1e')]['includeAll']){_0xa1a741[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x4a')]['findAll'](_0xa1a741);})[_0x7bd7('0x16')](function(_0x19c09e){_0x3755b9['rows']=_0x19c09e;return _0x3755b9;});}})[_0x7bd7('0x16')](respondWithFilteredResult(_0x4f0653,_0xa1a741))['catch'](handleError(_0x4f0653,null));};exports[_0x7bd7('0x9e')]=function(_0x9218b6,_0x2b55ec){var _0x42f507={'raw':!![],'where':{}};var _0xae4b2d={};var _0x32454a={'count':0x0,'rows':[]};return db[_0x7bd7('0x20')][_0x7bd7('0x82')]({'where':{'id':_0x9218b6['params']['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x2b55ec,null))[_0x7bd7('0x16')](function(_0x5ec873){if(_0x5ec873){_0xae4b2d['model']=_[_0x7bd7('0x25')](db[_0x7bd7('0x49')]['rawAttributes']);_0xae4b2d[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x9218b6[_0x7bd7('0x1e')]);_0xae4b2d[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0xae4b2d[_0x7bd7('0x75')],_0xae4b2d['query']);_0x42f507[_0x7bd7('0x7a')]=_['intersection'](_0xae4b2d[_0x7bd7('0x75')],qs[_0x7bd7('0x79')](_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x79')]));_0x42f507[_0x7bd7('0x7a')]=_0x42f507[_0x7bd7('0x7a')]['length']?_0x42f507['attributes']:_0xae4b2d[_0x7bd7('0x75')];if(!_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x31')](_0x7bd7('0x98'))){_0x42f507[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x12')]);_0x42f507[_0x7bd7('0x10')]=qs[_0x7bd7('0x10')](_0x9218b6['query']['offset']);}_0x42f507['order']=qs[_0x7bd7('0x7c')](_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0x42f507['where']=qs[_0x7bd7('0x77')](_['pick'](_0x9218b6[_0x7bd7('0x1e')],_0xae4b2d[_0x7bd7('0x77')]));_0x42f507[_0x7bd7('0x58')][_0x7bd7('0x9d')]=_0x5ec873['id'];if(_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0x42f507[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0x42f507[_0x7bd7('0x58')],{'$or':_[_0x7bd7('0x6a')](_0x42f507[_0x7bd7('0x7a')],function(_0x4d8f1d){var _0x8df59d={};_0x8df59d[_0x4d8f1d]={'$like':'%'+_0x9218b6[_0x7bd7('0x1e')]['filter']+'%'};return _0x8df59d;})});}_0x42f507=_[_0x7bd7('0x7f')]({},_0x42f507,_0x9218b6[_0x7bd7('0x99')]);return db[_0x7bd7('0x49')]['count']({'where':_0x42f507[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0x352f57){_0x32454a['count']=_0x352f57;if(_0x9218b6['query'][_0x7bd7('0x9f')]){_0x42f507[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x49')][_0x7bd7('0x1d')](_0x42f507);})[_0x7bd7('0x16')](function(_0x5a4fb9){_0x32454a['rows']=_0x5a4fb9;return _0x32454a;});}})['then'](respondWithFilteredResult(_0x2b55ec,_0x42f507))[_0x7bd7('0x22')](handleError(_0x2b55ec,null));};exports['getJscriptySessions']=function(_0x4a308c,_0x812910){var _0x3b591c={'raw':!![],'where':{}};var _0x26548b={};var _0x46fa2a={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x4a308c[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x812910,null))[_0x7bd7('0x16')](function(_0x5ef6d6){if(_0x5ef6d6){_0x26548b['model']=_[_0x7bd7('0x25')](db[_0x7bd7('0x4f')][_0x7bd7('0x76')]);_0x26548b[_0x7bd7('0x1e')]=_['keys'](_0x4a308c['query']);_0x26548b[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0x26548b[_0x7bd7('0x75')],_0x26548b[_0x7bd7('0x1e')]);_0x3b591c['attributes']=_[_0x7bd7('0x78')](_0x26548b[_0x7bd7('0x75')],qs['fields'](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x79')]));_0x3b591c[_0x7bd7('0x7a')]=_0x3b591c[_0x7bd7('0x7a')]['length']?_0x3b591c['attributes']:_0x26548b[_0x7bd7('0x75')];if(!_0x4a308c[_0x7bd7('0x1e')]['hasOwnProperty'](_0x7bd7('0x98'))){_0x3b591c[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x12')]);_0x3b591c['offset']=qs[_0x7bd7('0x10')](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x10')]);}_0x3b591c[_0x7bd7('0x7b')]=qs[_0x7bd7('0x7c')](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0x3b591c[_0x7bd7('0x58')]=qs[_0x7bd7('0x77')](_['pick'](_0x4a308c[_0x7bd7('0x1e')],_0x26548b[_0x7bd7('0x77')]));_0x3b591c[_0x7bd7('0x58')][_0x7bd7('0x9d')]=_0x5ef6d6['id'];if(_0x4a308c[_0x7bd7('0x1e')]['filter']){_0x3b591c[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0x3b591c['where'],{'$or':_[_0x7bd7('0x6a')](_0x3b591c[_0x7bd7('0x7a')],function(_0x2da92f){var _0x2c277e={};_0x2c277e[_0x2da92f]={'$like':'%'+_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x7e')]+'%'};return _0x2c277e;})});}_0x3b591c=_[_0x7bd7('0x7f')]({},_0x3b591c,_0x4a308c['options']);return db[_0x7bd7('0x4f')]['count']({'where':_0x3b591c[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0x6503b){_0x46fa2a[_0x7bd7('0x11')]=_0x6503b;if(_0x4a308c['query'][_0x7bd7('0x9f')]){_0x3b591c[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x4f')][_0x7bd7('0x1d')](_0x3b591c);})[_0x7bd7('0x16')](function(_0x8029dd){_0x46fa2a[_0x7bd7('0x9b')]=_0x8029dd;return _0x46fa2a;});}})['then'](respondWithFilteredResult(_0x812910,_0x3b591c))['catch'](handleError(_0x812910,null));};exports['uploadCsv']=function(_0x3557f8,_0x3fe36b){try{if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0x5b')]){throw new Error(_0x7bd7('0xa0'));}if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0xa1')]){throw new Error(_0x7bd7('0xa2'));}if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0xa3')]){throw new Error(_0x7bd7('0xa4'));}if(!_0x3557f8[_0x7bd7('0x32')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3fca6b=_0x3557f8['body']['binding_keys'][_0x7bd7('0xa5')](',');var _0x24a2da=_0x3557f8['body'][_0x7bd7('0xa3')]['split'](',');if(!_0x3fca6b['length']||!_0x24a2da['length']||_0x3fca6b['length']!==_0x24a2da[_0x7bd7('0x26')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3557f8['body']['fields']=_['zipObject'](_0x3fca6b,_0x24a2da);if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0x79')][_0x7bd7('0x74')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0x79')][_0x7bd7('0xa6')]){throw new Error(_0x7bd7('0xa7'));}var _0x24b82e=path[_0x7bd7('0x37')](config['root'],_0x7bd7('0xa8'),_0x3557f8[_0x7bd7('0xa9')][_0x7bd7('0xaa')]);fs[_0x7bd7('0xab')](_0x24b82e,parseInt(_0x7bd7('0xac'),0x8));var _0x56bec4=require(_0x7bd7('0xad'))[_0x7bd7('0xae')](path[_0x7bd7('0x37')](__dirname,_0x7bd7('0xaf')),[_0x24b82e,_0x3557f8[_0x7bd7('0x32')]['binding_keys'],_0x3557f8[_0x7bd7('0x32')]['binding_values'],_0x3557f8[_0x7bd7('0x32')]['ListId'],_0x3557f8[_0x7bd7('0x32')]['CompanyId'],_0x3557f8['body']['duplicates'],_0x3557f8['body'][_0x7bd7('0xb0')]]);return _0x3fe36b[_0x7bd7('0xe')](0xc8)[_0x7bd7('0xf')]({'message':_0x7bd7('0xb1'),'pid':_0x56bec4['pid']});}catch(_0x49f162){return _0x3fe36b[_0x7bd7('0xe')](0x1f4)[_0x7bd7('0x1b')](_0x49f162);}};exports[_0x7bd7('0xb2')]=function(_0x223e0b,_0x235688){var _0x92b3da=fs[_0x7bd7('0xb3')](_0x223e0b[_0x7bd7('0xa9')][_0x7bd7('0x3')]);Papa[_0x7bd7('0xb4')](_0x92b3da,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3ed666){return _0x235688[_0x7bd7('0xe')](0xc8)['json']({'file':_0x223e0b[_0x7bd7('0xa9')],'fields':_0x3ed666[_0x7bd7('0xb5')][_0x7bd7('0x79')]});}});};exports[_0x7bd7('0xb6')]=function(_0x226ac8,_0x1b4339){return db[_0x7bd7('0xb7')][_0x7bd7('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x7bd7('0xb8')}})['then'](function(_0x222ede){var _0xe7f5bc=![];if(!_0x226ac8['body'][_0x7bd7('0x5b')]){throw new Error(_0x7bd7('0xa0'));}if(!_0x226ac8[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0x74')]){throw new Error(_0x7bd7('0xba'));}if(!_0x226ac8[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0xa6')]){throw new Error(_0x7bd7('0xa7'));}if(!_0x226ac8[_0x7bd7('0x32')]['socket_timestamp']){throw new Error(_0x7bd7('0xbb'));}var _0x220ce4=require('child_process')['fork'](path['join'](__dirname,'../../components/import/cm/csv2'),[_0x226ac8[_0x7bd7('0x60')]['id'],JSON[_0x7bd7('0xbc')](_0x226ac8[_0x7bd7('0x32')]),JSON[_0x7bd7('0xbc')](_0x222ede)]);_0x220ce4['on']('message',function(){_0xe7f5bc=!![];return _0x1b4339['status'](0xc8)[_0x7bd7('0xf')]({'message':_0x7bd7('0xbd'),'pid':_0x220ce4['pid']});});_0x220ce4['on'](_0x7bd7('0xbe'),function(_0x532432){if(_0x532432&&!_0xe7f5bc){return _0x1b4339[_0x7bd7('0xe')](0x1f4)[_0x7bd7('0xf')]({'message':_0x7bd7('0xbf'),'pid':_0x220ce4[_0x7bd7('0xc0')]});}});})['catch'](handleError(_0x1b4339,null));};exports[_0x7bd7('0xc1')]=function(_0x12a16a,_0x1c525e){return db[_0x7bd7('0xb7')][_0x7bd7('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x7bd7('0xb8')}})[_0x7bd7('0x16')](function(_0x35d70c){var _0x5cc05e=![];if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0x5b')]){throw new Error(_0x7bd7('0xa0'));}if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0x74')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0xa6')]){throw new Error(_0x7bd7('0xa7'));}if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0xb0')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x62f3bc=require('child_process')[_0x7bd7('0xae')](path[_0x7bd7('0x37')](__dirname,'../../components/import/cm/csvUpdates'),[_0x12a16a[_0x7bd7('0x60')]['id'],JSON[_0x7bd7('0xbc')](_0x12a16a[_0x7bd7('0x32')]),JSON['stringify'](_0x35d70c)]);_0x62f3bc['on']('message',function(){_0x5cc05e=!![];return _0x1c525e[_0x7bd7('0xe')](0xc8)[_0x7bd7('0xf')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x62f3bc[_0x7bd7('0xc0')]});});_0x62f3bc['on'](_0x7bd7('0xbe'),function(_0x46f25d){if(_0x46f25d&&!_0x5cc05e){return _0x1c525e[_0x7bd7('0xe')](0x1f4)[_0x7bd7('0xf')]({'message':'error\x20child\x20process','pid':_0x62f3bc['pid']});}});})[_0x7bd7('0x22')](handleError(_0x1c525e,null));};exports[_0x7bd7('0xc2')]=function(_0x30ebfa,_0xbd37da){var _0x305ded=[_0x7bd7('0xc3'),_0x7bd7('0xc4'),_0x7bd7('0xc5'),'openchannel',_0x7bd7('0xc6'),_0x7bd7('0xc7'),_0x7bd7('0xc8')];var _0x49e4a8={'offset':0x0,'order':qs[_0x7bd7('0x7c')](_0x7bd7('0xc9'))},_0x1d90fe={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x30ebfa['query'][_0x7bd7('0xca')]){if(!_[_0x7bd7('0xcb')](_0x305ded,_0x30ebfa[_0x7bd7('0x1e')]['channel'][_0x7bd7('0xcc')]())){throw new Error(_0x7bd7('0xcd'));}_0x305ded=[_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xca')][_0x7bd7('0xcc')]()];}if(_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xce')]){try{var _0x5477b0=JSON['parse'](_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xce')]);if(!moment(_0x5477b0['from'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x5477b0['to'])[_0x7bd7('0xcf')]()){throw new Error(_0x7bd7('0xd0'));}}catch(_0x36b5ba){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x30ebfa[_0x7bd7('0x1e')]['hasOwnProperty'](_0x7bd7('0x98'))){_0x49e4a8['limit']=qs[_0x7bd7('0x12')](_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0x12')]||0xa);_0x49e4a8['offset']=qs['offset'](_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0x10')]);}var _0x1ec1e5=_0x305ded['map'](function(_0x544ad8){if(_0x544ad8===_0x7bd7('0xc8')){var _0x7a7fe={'attributes':['id','uniqueid','type',_0x7bd7('0xd1'),_0x7bd7('0xd2'),_0x7bd7('0xd3'),_0x7bd7('0xd4'),_0x7bd7('0xd5'),_0x7bd7('0xd6'),_0x7bd7('0xd7'),'createdAt',_0x7bd7('0xd8'),_0x7bd7('0xd9'),'userThirdDisposition',_0x7bd7('0xda')],'where':{'ContactId':_0x30ebfa['params']['id']},'include':[{'model':db[_0x7bd7('0xb7')],'as':_0x7bd7('0xb7'),'attributes':['id',_0x7bd7('0x1a'),'fullname',_0x7bd7('0x2c')]}],'order':[['createdAt',_0x7bd7('0xdb')]]};if(_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xce')]){_0x7a7fe[_0x7bd7('0x58')][_0x7bd7('0xdc')]={'$gte':_0x5477b0[_0x7bd7('0x33')],'$lte':_0x5477b0['to']};}return db[_0x7bd7('0x4c')][_0x7bd7('0xdd')](_0x7a7fe)[_0x7bd7('0x16')](function(_0x2e0217){_0x1d90fe[_0x7bd7('0x11')]+=_0x2e0217[_0x7bd7('0x11')];return _[_0x7bd7('0x6a')](_0x2e0217[_0x7bd7('0x9b')],function(_0xa3b0aa){var _0x2220bf=_0xa3b0aa[_0x7bd7('0x34')]({'plain':!![]});_0x2220bf[_0x7bd7('0xca')]=_0x544ad8;if(_0x2220bf[_0x7bd7('0xb7')]){_0x2220bf[_0x7bd7('0xb7')]={'id':_0x2220bf['User']['id'],'name':_0x2220bf[_0x7bd7('0xb7')]['name'],'fullname':_0x2220bf['User'][_0x7bd7('0xde')],'alias':_0x2220bf[_0x7bd7('0xb7')]['alias']};}return _0x2220bf;});});}else{var _0x47b854=_['startCase'](_0x544ad8)+(_0x544ad8===_0x7bd7('0xc4')?_0x7bd7('0xdf'):_0x7bd7('0xe0'));var _0x4807ee={'attributes':['id',_0x7bd7('0xe1'),'closedAt',_0x7bd7('0xdc'),_0x7bd7('0xd7'),_0x7bd7('0xe2'),_0x7bd7('0xe3'),_0x7bd7('0xe4'),_0x7bd7('0xda'),_0x47b854+'Id'],'where':{'ContactId':_0x30ebfa[_0x7bd7('0x60')]['id']},'include':[{'model':db[_0x47b854],'as':_0x7bd7('0xe0'),'attributes':['id',_0x7bd7('0x1a'),_0x7bd7('0xe5')]},{'model':db[_0x7bd7('0xb7')],'as':_0x7bd7('0xe6'),'attributes':['id',_0x7bd7('0x1a'),_0x7bd7('0xde')]},{'model':db[_0x7bd7('0x61')],'as':'Tags','attributes':['id',_0x7bd7('0x1a'),_0x7bd7('0xe7')],'through':{'attributes':[]}}],'order':[[_0x7bd7('0xdc'),'DESC']]};if(_0x30ebfa[_0x7bd7('0x1e')]['range']){_0x4807ee['where']['createdAt']={'$gte':_0x5477b0['from'],'$lte':_0x5477b0['to']};}switch(_0x544ad8){case _0x7bd7('0xc4'):_0x4807ee['attributes'][_0x7bd7('0x5a')]('browserName',_0x7bd7('0xe8'),_0x7bd7('0xe9'),_0x7bd7('0xea'),'osName',_0x7bd7('0xeb'),_0x7bd7('0xec'),_0x7bd7('0xed'),'referer');break;case _0x7bd7('0xc3'):_0x4807ee[_0x7bd7('0x7a')][_0x7bd7('0x5a')](_0x7bd7('0xee'),_0x7bd7('0xef'));break;case _0x7bd7('0xf0'):_0x4807ee['attributes'][_0x7bd7('0x5a')](_0x7bd7('0xf1'),_0x7bd7('0xf2'));break;}return db[_[_0x7bd7('0xf3')](_0x544ad8)+_0x7bd7('0xf4')][_0x7bd7('0xdd')](_0x4807ee)[_0x7bd7('0x16')](function(_0x1dc8ea){_0x1d90fe[_0x7bd7('0x11')]+=_0x1dc8ea[_0x7bd7('0x11')];return _[_0x7bd7('0x6a')](_0x1dc8ea[_0x7bd7('0x9b')],function(_0x1bab0b){var _0x4564fd=_0x1bab0b['get']({'plain':!![]});_0x4564fd['channel']=_0x544ad8;if(_0x4564fd[_0x7bd7('0xe6')]){_0x4564fd[_0x7bd7('0xe6')]={'id':_0x4564fd['Owner']['id'],'name':_0x4564fd['Owner'][_0x7bd7('0x1a')],'fullname':_0x4564fd[_0x7bd7('0xe6')][_0x7bd7('0xde')]};}return _0x4564fd;});});}});return Promise[_0x7bd7('0x84')](_0x1ec1e5);})[_0x7bd7('0x16')](function(_0x438f5a){return _(_0x438f5a)['flatten']()[_0x7bd7('0xf5')](_0x7bd7('0xdc'))[_0x7bd7('0xf6')]()[_0x7bd7('0xf7')]();})[_0x7bd7('0x16')](function(_0x3ed7a9){_0x1d90fe[_0x7bd7('0x9b')]=_0x49e4a8[_0x7bd7('0x12')]?_0x3ed7a9[_0x7bd7('0xf8')](_0x49e4a8[_0x7bd7('0x10')],_0x49e4a8[_0x7bd7('0x10')]+_0x49e4a8[_0x7bd7('0x12')]):_0x3ed7a9;return _0x1d90fe;})[_0x7bd7('0x16')](respondWithFilteredResult(_0xbd37da,_0x49e4a8))[_0x7bd7('0x22')](handleError(_0xbd37da,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 2111f9e..2a203fd 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 _0x5007=['exports','events','CmContact','save','update','emit','hasOwnProperty','hook'];(function(_0x455eda,_0x5ba3e4){var _0x30284b=function(_0x46ea92){while(--_0x46ea92){_0x455eda['push'](_0x455eda['shift']());}};_0x30284b(++_0x5ba3e4);}(_0x5007,0x129));var _0x7500=function(_0x42036f,_0x4d3872){_0x42036f=_0x42036f-0x0;var _0x2dcac1=_0x5007[_0x42036f];return _0x2dcac1;};'use strict';var EventEmitter=require(_0x7500('0x0'));var CmContact=require('../../mysqldb')['db'][_0x7500('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7500('0x2'),'afterUpdate':_0x7500('0x3'),'afterDestroy':'remove'};function emitEvent(_0x14d69a){return function(_0x5935ec,_0x337682,_0xfc2b3d){CmContactEvents[_0x7500('0x4')](_0x14d69a+':'+_0x5935ec['id'],_0x5935ec);CmContactEvents['emit'](_0x14d69a,_0x5935ec);_0xfc2b3d(null);};}for(var e in events){if(events[_0x7500('0x5')](e)){var event=events[e];CmContact[_0x7500('0x6')](e,emitEvent(event));}}module[_0x7500('0x7')]=CmContactEvents; \ No newline at end of file +var _0xad58=['hook','exports','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xad58,0x1ec));var _0x8ad5=function(_0x96b6a,_0x12471d){_0x96b6a=_0x96b6a-0x0;var _0x3e16f3=_0xad58[_0x96b6a];return _0x3e16f3;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x8ad5('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ad5('0x1'),'afterDestroy':_0x8ad5('0x2')};function emitEvent(_0x1f8c50){return function(_0x4f6dc6,_0x467b34,_0xc7e608){CmContactEvents[_0x8ad5('0x3')](_0x1f8c50+':'+_0x4f6dc6['id'],_0x4f6dc6);CmContactEvents[_0x8ad5('0x3')](_0x1f8c50,_0x4f6dc6);_0xc7e608(null);};}for(var e in events){if(events[_0x8ad5('0x4')](e)){var event=events[e];CmContact[_0x8ad5('0x5')](e,emitEvent(event));}}module[_0x8ad5('0x6')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 7fc12e0..a29dd42 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 _0x82c5=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','length','get','always','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Lists','onlyIfOpen','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','info','lodash','util','../../config/logger','api','moment','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','cm_contacts','firstName','phone','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20'];(function(_0x2cf16f,_0x5899df){var _0xfb99c6=function(_0x3cbc1b){while(--_0x3cbc1b){_0x2cf16f['push'](_0x2cf16f['shift']());}};_0xfb99c6(++_0x5899df);}(_0x82c5,0x147));var _0x582c=function(_0x16b952,_0x5c856e){_0x16b952=_0x16b952-0x0;var _0x2d5cc5=_0x82c5[_0x16b952];return _0x2d5cc5;};'use strict';var _=require(_0x582c('0x0'));var util=require(_0x582c('0x1'));var logger=require(_0x582c('0x2'))(_0x582c('0x3'));var moment=require(_0x582c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x582c('0x5'));var rimraf=require('rimraf');var config=require(_0x582c('0x6'));var shared=require(_0x582c('0x7'));var attributes=require(_0x582c('0x8'));module['exports']=function(_0x117b7c,_0x57824c){return _0x117b7c[_0x582c('0x9')](_0x582c('0xa'),attributes,{'tableName':_0x582c('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x582c('0xc'),'lastName',_0x582c('0xd'),_0x582c('0xe'),_0x582c('0xf'),_0x582c('0x10')],'type':_0x582c('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x582c('0x12'),'hooks':{'afterCreate':function(_0x43e4b4,_0x147e58,_0x391158){var _0x452333=_0x117b7c[_0x582c('0x13')];var _0x4d57b9=_0x43e4b4['get']({'plain':!![]});function _0x254f81(){return function(_0x3a6e35){logger[_0x582c('0x14')](_0x582c('0x15'),_0x582c('0x16'),util[_0x582c('0x17')](_0x3a6e35,{'showHidden':![],'depth':null}));};}function _0x117057(_0x5e6e0b,_0x59a0b1){var _0x476a4f=_0x59a0b1[_0x582c('0x18')]?_0x59a0b1[_0x582c('0x18')]:moment()[_0x582c('0x19')](_0x582c('0x1a'));return new BPromise(function(_0x1a2542,_0x27349f){if(_[_0x582c('0x1b')](_0x59a0b1['dialTimezone'])){_0x1a2542({'ret':_0x476a4f});}else{_0x452333[_0x582c('0x1c')][_0x582c('0x1d')]({'where':{'id':_0x5e6e0b['id']}})[_0x582c('0x1e')](function(_0x4e911a){if(!_['isNil'](_0x4e911a)){var _0x5e00ee=_0x4e911a[_0x582c('0x1f')];if(!_[_0x582c('0x1b')](_0x5e00ee)){var _0x550c8d=shared[_0x582c('0x20')];var _0xd3fff8=_0x550c8d[_0x5e00ee];var _0x22a35a=_0x550c8d[_0x59a0b1[_0x582c('0x1f')]];if(!_[_0x582c('0x1b')](_0xd3fff8)&&!_['isNil'](_0x22a35a)){var _0xe09b64=_0xd3fff8['utcOffset']-_0x22a35a[_0x582c('0x21')];_0x476a4f=_0x59a0b1[_0x582c('0x18')]?_0x59a0b1['scheduledat']:moment();var _0x3559cc=moment(_0x476a4f)[_0x582c('0x22')](_0xe09b64,_0x582c('0x23'));_0x1a2542({'ret':_0x3559cc[_0x582c('0x19')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1a2542({'ret':_0x476a4f});}else _0x1a2542({'ret':_0x476a4f});}else{_0x1a2542({'ret':_0x476a4f});}});}});return 0xa;}var _0x419465=function(_0x23c14d){return new BPromise(function(_0x2fcb61,_0x5cc8ec){_0x117057(_0x23c14d,_0x4d57b9)[_0x582c('0x1e')](function(_0x57b230){_0x4d57b9['scheduledat']=_0x57b230['ret'];_0x452333[_0x582c('0x24')][_0x582c('0x1d')]({'where':{'phone':_0x4d57b9[_0x582c('0xd')],'VoiceQueueId':_0x23c14d['id']}})[_0x582c('0x1e')](function(_0x21f26e){if(!_[_0x582c('0x1b')](_0x21f26e)){throw new Error(_0x582c('0x25')+_0x4d57b9[_0x582c('0xd')]+_0x582c('0x26')+_0x23c14d['id']);}return _0x452333['CmHopper'][_0x582c('0x27')]({'phone':_0x4d57b9[_0x582c('0xd')],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'priority':_0x4d57b9['priority']?_0x4d57b9[_0x582c('0x29')]:0x2,'scheduledat':_0x4d57b9['scheduledat']?_0x4d57b9[_0x582c('0x18')]:moment()[_0x582c('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4d57b9[_0x582c('0x2a')]?!![]:![],'callbackuniqueid':_0x4d57b9[_0x582c('0x2a')]?_0x4d57b9[_0x582c('0x2a')]:undefined,'callbackat':_0x4d57b9['callbackUniqueid']?moment()[_0x582c('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x23c14d['id']});})[_0x582c('0x2b')](function(_0x3bcfd){_0x5cc8ec(_0x3bcfd);});});});};var _0x21396d=function(_0xce5b11){return new BPromise(function(_0x47e919,_0x467265){_0x117057(_0xce5b11,_0x4d57b9)[_0x582c('0x1e')](function(_0x48db6a){_0x4d57b9['scheduledat']=_0x48db6a['ret'];_0x452333[_0x582c('0x24')][_0x582c('0x1d')]({'where':{'phone':_0x4d57b9[_0x582c('0xd')],'VoiceQueueId':_0xce5b11['id']}})['then'](function(_0x2bb70a){if(!_[_0x582c('0x1b')](_0x2bb70a)){throw new Error(_0x582c('0x25')+_0x4d57b9[_0x582c('0xd')]+_0x582c('0x2c')+_0xce5b11['id']);}return _0x452333[_0x582c('0x2d')][_0x582c('0x1d')]({'where':{'calleridnum':_0x4d57b9[_0x582c('0xd')],'VoiceQueueId':_0xce5b11['id']}});})[_0x582c('0x1e')](function(_0x4c0e96){if(!_[_0x582c('0x1b')](_0x4c0e96)){throw new Error(_0x582c('0x2e')+_0x4d57b9[_0x582c('0xd')]+_0x582c('0x2f')+_0xce5b11['id']);}return _0x452333[_0x582c('0x24')][_0x582c('0x27')]({'phone':_0x4d57b9[_0x582c('0xd')],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'priority':_0x4d57b9[_0x582c('0x29')]?_0x4d57b9[_0x582c('0x29')]:0x2,'scheduledat':_0x4d57b9[_0x582c('0x18')]?_0x4d57b9[_0x582c('0x18')]:moment()[_0x582c('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4d57b9[_0x582c('0x2a')]?!![]:![],'callbackuniqueid':_0x4d57b9[_0x582c('0x2a')]?_0x4d57b9[_0x582c('0x2a')]:undefined,'callbackat':_0x4d57b9[_0x582c('0x2a')]?moment()['format'](_0x582c('0x1a')):undefined,'VoiceQueueId':_0xce5b11['id']});})[_0x582c('0x2b')](function(_0x3e24e0){_0x467265(_0x3e24e0);});});});};function _0x1c68fe(){return function(_0xf4f96b){logger['error']('cmContact',_0x582c('0x16'),util[_0x582c('0x17')](_0xf4f96b,{'showHidden':![],'depth':null}));};}function _0x54aba2(_0xb72973,_0x20f7fe){var _0x182982=_0x20f7fe[_0x582c('0x18')]?_0x20f7fe[_0x582c('0x18')]:moment()['format'](_0x582c('0x1a'));return new BPromise(function(_0x3da294,_0x1aa3e3){if(_[_0x582c('0x1b')](_0x20f7fe[_0x582c('0x1f')])){_0x3da294({'ret':_0x182982});}else{_0x452333[_0x582c('0x30')][_0x582c('0x1d')]({'where':{'id':_0xb72973['id']}})[_0x582c('0x1e')](function(_0x43aaa4){if(!_[_0x582c('0x1b')](_0x43aaa4)){var _0x2d0e39=_0x43aaa4['dialTimezone'];if(!_[_0x582c('0x1b')](_0x2d0e39)){var _0x1f1666=shared[_0x582c('0x20')];var _0x2e929a=_0x1f1666[_0x2d0e39];var _0x37ec4b=_0x1f1666[_0x20f7fe['dialTimezone']];if(!_['isNil'](_0x2e929a)&&!_['isNil'](_0x37ec4b)){var _0x59e481=_0x2e929a['utcOffset']-_0x37ec4b['utcOffset'];_0x182982=_0x20f7fe[_0x582c('0x18')]?_0x20f7fe[_0x582c('0x18')]:moment();var _0x54e3d8=moment(_0x182982)[_0x582c('0x22')](_0x59e481,_0x582c('0x23'));_0x3da294({'ret':_0x54e3d8[_0x582c('0x19')](_0x582c('0x1a'))});}else _0x3da294({'ret':_0x182982});}else _0x3da294({'ret':_0x182982});}else{_0x3da294({'ret':_0x182982});}});}});return 0xa;}var _0x23ace5=function(_0x5db94f){return new BPromise(function(_0x238d3f,_0x14046b){_0x54aba2(_0x5db94f,_0x4d57b9)[_0x582c('0x1e')](function(_0x1ec085){_0x4d57b9['scheduledat']=_0x1ec085[_0x582c('0x31')];_0x452333['CmHopper'][_0x582c('0x1d')]({'where':{'phone':_0x4d57b9['phone'],'CampaignId':_0x5db94f['id']}})['then'](function(_0x4cff56){if(!_[_0x582c('0x1b')](_0x4cff56)){throw new Error(_0x582c('0x25')+_0x4d57b9[_0x582c('0xd')]+_0x582c('0x32')+_0x5db94f['id']);}return _0x452333[_0x582c('0x24')][_0x582c('0x27')]({'phone':_0x4d57b9['phone'],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'priority':_0x4d57b9[_0x582c('0x29')]?_0x4d57b9[_0x582c('0x29')]:0x2,'scheduledat':_0x4d57b9[_0x582c('0x18')]?_0x4d57b9[_0x582c('0x18')]:moment()['format'](_0x582c('0x1a')),'callback':_0x4d57b9[_0x582c('0x2a')]?!![]:![],'callbackuniqueid':_0x4d57b9[_0x582c('0x2a')]?_0x4d57b9[_0x582c('0x2a')]:undefined,'callbackat':_0x4d57b9['callbackUniqueid']?moment()[_0x582c('0x19')](_0x582c('0x1a')):undefined,'CampaignId':_0x5db94f['id']});})[_0x582c('0x2b')](function(_0x4477c7){_0x14046b(_0x4477c7);});});});};var _0x1f0eba=function(_0x3956e7){return new BPromise(function(_0xdfc85e,_0x521f7c){_0x54aba2(_0x3956e7,_0x4d57b9)['then'](function(_0x5e06c4){_0x4d57b9[_0x582c('0x18')]=_0x5e06c4[_0x582c('0x31')];_0x452333[_0x582c('0x24')]['findOne']({'where':{'phone':_0x4d57b9[_0x582c('0xd')],'CampaignId':_0x3956e7['id']}})[_0x582c('0x1e')](function(_0x302f35){if(!_[_0x582c('0x1b')](_0x302f35)){throw new Error(_0x582c('0x25')+_0x4d57b9['phone']+_0x582c('0x33')+_0x3956e7['id']);}return _0x452333['CmHopperFinal'][_0x582c('0x1d')]({'where':{'calleridnum':_0x4d57b9[_0x582c('0xd')],'CampaignId':_0x3956e7['id']}});})[_0x582c('0x1e')](function(_0x4a5ec3){if(!_[_0x582c('0x1b')](_0x4a5ec3)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4d57b9[_0x582c('0xd')]+_0x582c('0x34')+_0x3956e7['id']);}return _0x452333[_0x582c('0x24')][_0x582c('0x27')]({'phone':_0x4d57b9[_0x582c('0xd')],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'priority':_0x4d57b9[_0x582c('0x29')]?_0x4d57b9[_0x582c('0x29')]:0x2,'scheduledat':_0x4d57b9[_0x582c('0x18')]?_0x4d57b9[_0x582c('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4d57b9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4d57b9[_0x582c('0x2a')]?_0x4d57b9[_0x582c('0x2a')]:undefined,'callbackat':_0x4d57b9[_0x582c('0x2a')]?moment()[_0x582c('0x19')](_0x582c('0x1a')):undefined,'CampaignId':_0x3956e7['id']});})[_0x582c('0x2b')](function(_0xe54111){_0x521f7c(_0xe54111);});});});};if(_0x4d57b9[_0x582c('0x28')]){_0x452333['VoiceQueue'][_0x582c('0x35')]({'where':{'type':_0x582c('0x36')},'attributes':['id',_0x582c('0x37'),_0x582c('0x1f')],'include':[{'model':_0x452333['CmList'],'as':'Lists','where':{'id':_0x4d57b9['ListId']}}]})[_0x582c('0x1e')](function(_0x5db16e){if(_0x5db16e){var _0x18a3b7=[];for(var _0x25004f=0x0,_0x21d623;_0x25004f<_0x5db16e[_0x582c('0x38')];_0x25004f+=0x1){_0x21d623=_0x5db16e[_0x25004f][_0x582c('0x39')]({'plain':!![]});switch(_0x21d623[_0x582c('0x37')]){case _0x582c('0x3a'):_0x21396d(_0x21d623)[_0x582c('0x2b')](_0x254f81());break;case'onlyIfOpen':_0x419465(_0x21d623)[_0x582c('0x2b')](_0x254f81());break;default:_0x54aba2(_0x21d623,_0x4d57b9)[_0x582c('0x1e')](function(_0x479223){_0x4d57b9[_0x582c('0x18')]=_0x479223[_0x582c('0x31')];_0x452333[_0x582c('0x24')]['create']({'phone':_0x4d57b9[_0x582c('0xd')],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'scheduledat':_0x4d57b9[_0x582c('0x18')]?_0x4d57b9[_0x582c('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4d57b9[_0x582c('0x29')]?_0x4d57b9[_0x582c('0x29')]:0x2,'callback':_0x4d57b9[_0x582c('0x2a')]?!![]:![],'callbackuniqueid':_0x4d57b9[_0x582c('0x2a')]?_0x4d57b9[_0x582c('0x2a')]:undefined,'callbackat':_0x4d57b9['callbackUniqueid']?moment()[_0x582c('0x19')](_0x582c('0x1a')):undefined,'VoiceQueueId':_0x21d623['id']})[_0x582c('0x2b')](_0x254f81());});}}}})[_0x582c('0x1e')](function(){return _0x452333[_0x582c('0x1c')][_0x582c('0x35')]({'where':{'type':_0x582c('0x36')},'attributes':['id'],'include':[{'model':_0x452333[_0x582c('0x3b')],'as':_0x582c('0x3c'),'where':{'id':_0x4d57b9[_0x582c('0x28')]}}]})['then'](function(_0x26445a){if(_0x26445a){var _0x2ba9bf=[];for(var _0x3d7cd4=0x0,_0x361c6e;_0x3d7cd4<_0x26445a[_0x582c('0x38')];_0x3d7cd4+=0x1){_0x361c6e=_0x26445a[_0x3d7cd4][_0x582c('0x39')]({'plain':!![]});_0x452333[_0x582c('0x3d')][_0x582c('0x27')]({'phone':_0x4d57b9[_0x582c('0xd')],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'VoiceQueueId':_0x361c6e['id']})[_0x582c('0x2b')](function(_0x492c57){logger[_0x582c('0x14')](_0x582c('0x3e'),_0x582c('0x16'),_0x492c57[_0x582c('0x3f')]);});}}});})['then'](function(){return _0x452333[_0x582c('0x30')][_0x582c('0x35')]({'attributes':['id',_0x582c('0x37'),_0x582c('0x1f')],'include':[{'model':_0x452333[_0x582c('0x3b')],'as':_0x582c('0x40'),'where':{'id':_0x4d57b9[_0x582c('0x28')]}}]})[_0x582c('0x1e')](function(_0x3332df){if(_0x3332df){var _0x5ceae4=[];for(var _0x2c5c1d=0x0,_0x74fd89;_0x2c5c1d<_0x3332df[_0x582c('0x38')];_0x2c5c1d+=0x1){_0x74fd89=_0x3332df[_0x2c5c1d][_0x582c('0x39')]({'plain':!![]});switch(_0x74fd89[_0x582c('0x37')]){case'always':_0x1f0eba(_0x74fd89)['catch'](_0x1c68fe());break;case _0x582c('0x41'):_0x23ace5(_0x74fd89)[_0x582c('0x2b')](_0x1c68fe());break;default:_0x452333[_0x582c('0x24')][_0x582c('0x27')]({'phone':_0x4d57b9[_0x582c('0xd')],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'scheduledat':_0x4d57b9[_0x582c('0x18')]?_0x4d57b9['scheduledat']:moment()[_0x582c('0x19')](_0x582c('0x1a')),'priority':_0x4d57b9['priority']?_0x4d57b9[_0x582c('0x29')]:0x2,'callback':_0x4d57b9[_0x582c('0x2a')]?!![]:![],'callbackuniqueid':_0x4d57b9[_0x582c('0x2a')]?_0x4d57b9['callbackUniqueid']:undefined,'callbackat':_0x4d57b9[_0x582c('0x2a')]?moment()[_0x582c('0x19')](_0x582c('0x1a')):undefined,'CampaignId':_0x74fd89['id']})[_0x582c('0x2b')](_0x1c68fe());}}}});})['then'](function(){return _0x452333[_0x582c('0x30')][_0x582c('0x35')]({'attributes':['id'],'include':[{'model':_0x452333[_0x582c('0x3b')],'as':'BlackLists','where':{'id':_0x4d57b9[_0x582c('0x28')]}}]})['then'](function(_0x34f463){if(_0x34f463){var _0x342f66=[];for(var _0x463493=0x0,_0x3ec789;_0x463493<_0x34f463['length'];_0x463493+=0x1){_0x3ec789=_0x34f463[_0x463493][_0x582c('0x39')]({'plain':!![]});_0x452333['CmHopperBlack'][_0x582c('0x27')]({'phone':_0x4d57b9[_0x582c('0xd')],'ContactId':_0x4d57b9['id'],'ListId':_0x4d57b9[_0x582c('0x28')],'CampaignId':_0x3ec789['id']})['catch'](function(_0x5a21f0){logger[_0x582c('0x14')](_0x582c('0x3e'),_0x582c('0x16'),_0x5a21f0[_0x582c('0x3f')]);});}}});})[_0x582c('0x1e')](function(){_0x391158();})[_0x582c('0x2b')](function(_0xc5c71b){logger[_0x582c('0x14')](_0x582c('0x3e'),'afterCreate',_0xc5c71b[_0x582c('0x3f')]);_0x391158(_0xc5c71b);});}else{_0x391158(new Error(_0x582c('0x42')));}},'afterDestroy':function(_0x251585,_0x19856f,_0x4ca97c){var _0x45e18a=_0x117b7c[_0x582c('0x13')];var _0x15b220=_0x251585[_0x582c('0x39')]({'plain':!![]});return _0x45e18a[_0x582c('0x24')][_0x582c('0x35')]({'raw':!![],'where':{'ListId':_0x15b220['ListId'],'ContactId':_0x15b220['id']}})[_0x582c('0x1e')](function(_0x54dcaf){if(!_[_0x582c('0x43')](_0x54dcaf)){var _0x268f00=[];for(var _0x19fe53=0x0;_0x19fe53<_0x54dcaf[_0x582c('0x38')];_0x19fe53+=0x1){var _0x409d92=_0x45e18a[_0x582c('0x24')][_0x582c('0x44')]({'where':{'ListId':_0x54dcaf[_0x19fe53][_0x582c('0x28')],'ContactId':_0x54dcaf[_0x19fe53][_0x582c('0x45')],'VoiceQueueId':_0x54dcaf[_0x19fe53][_0x582c('0x46')],'CampaignId':_0x54dcaf[_0x19fe53][_0x582c('0x47')]}});_0x268f00['push'](_0x409d92);}return BPromise['all'](_0x268f00);}})[_0x582c('0x1e')](function(_0xba5dfd){logger[_0x582c('0x48')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0xba5dfd,{'showHidden':![],'depth':null}));_0x4ca97c();})[_0x582c('0x2b')](function(_0x2e4275){logger['error']('[CmContact][afterDestroy][Error]',util[_0x582c('0x17')](_0x2e4275,{'showHidden':![],'depth':null}));_0x4ca97c(_0x2e4275);});}}});}; \ No newline at end of file +var _0x17b3=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','Campaign','add','minutes','\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','VoiceQueue','findAll','outbound','CmList','Lists','length','dialCheckDuplicateType','always','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','message','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','define','cm_contacts','fti_cm_contacts','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','then','isNil','timezones','utcOffset','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','phone','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch'];(function(_0x2c887f,_0x35ec5a){var _0x448b2e=function(_0x195483){while(--_0x195483){_0x2c887f['push'](_0x2c887f['shift']());}};_0x448b2e(++_0x35ec5a);}(_0x17b3,0x68));var _0x317b=function(_0x159aa2,_0x24eb0b){_0x159aa2=_0x159aa2-0x0;var _0x3a8e1e=_0x17b3[_0x159aa2];return _0x3a8e1e;};'use strict';var _=require(_0x317b('0x0'));var util=require(_0x317b('0x1'));var logger=require(_0x317b('0x2'))(_0x317b('0x3'));var moment=require(_0x317b('0x4'));var BPromise=require('bluebird');var rp=require(_0x317b('0x5'));var fs=require('fs');var path=require(_0x317b('0x6'));var rimraf=require(_0x317b('0x7'));var config=require(_0x317b('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0x317b('0x9'));module['exports']=function(_0x379ff3,_0x50b8e5){return _0x379ff3[_0x317b('0xa')]('CmContact',attributes,{'tableName':_0x317b('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x317b('0xc'),'fields':['firstName','lastName','phone',_0x317b('0xd'),_0x317b('0xe'),'email'],'type':_0x317b('0xf')}],'timestamps':!![],'charset':_0x317b('0x10'),'collate':_0x317b('0x11'),'hooks':{'afterCreate':function(_0x2c0058,_0x2f1c13,_0xa2f089){var _0x5d4444=_0x379ff3['models'];var _0x247670=_0x2c0058[_0x317b('0x12')]({'plain':!![]});function _0x9dee0a(){return function(_0x32a0e8){logger[_0x317b('0x13')](_0x317b('0x14'),_0x317b('0x15'),util[_0x317b('0x16')](_0x32a0e8,{'showHidden':![],'depth':null}));};}function _0x27bb62(_0xd9f8fc,_0x595269){var _0x2543f9=_0x595269[_0x317b('0x17')]?_0x595269[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19'));return new BPromise(function(_0x3429c0,_0x27a0a3){if(_['isNil'](_0x595269[_0x317b('0x1a')])){_0x3429c0({'ret':_0x2543f9});}else{_0x5d4444['VoiceQueue']['findOne']({'where':{'id':_0xd9f8fc['id']}})[_0x317b('0x1b')](function(_0x5932a5){if(!_[_0x317b('0x1c')](_0x5932a5)){var _0x3c30c4=_0x5932a5['dialTimezone'];if(!_[_0x317b('0x1c')](_0x3c30c4)){var _0xd15f8a=shared[_0x317b('0x1d')];var _0x7db3e4=_0xd15f8a[_0x3c30c4];var _0x117ebd=_0xd15f8a[_0x595269[_0x317b('0x1a')]];if(!_[_0x317b('0x1c')](_0x7db3e4)&&!_[_0x317b('0x1c')](_0x117ebd)){var _0x1a8a66=_0x7db3e4[_0x317b('0x1e')]-_0x117ebd[_0x317b('0x1e')];_0x2543f9=_0x595269[_0x317b('0x17')]?_0x595269[_0x317b('0x17')]:moment();var _0x3d0a9e=moment(_0x2543f9)['add'](_0x1a8a66,'minutes');_0x3429c0({'ret':_0x3d0a9e[_0x317b('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x3429c0({'ret':_0x2543f9});}else _0x3429c0({'ret':_0x2543f9});}else{_0x3429c0({'ret':_0x2543f9});}});}});return 0xa;}var _0x58532e=function(_0x1a7c74){return new BPromise(function(_0x48e8db,_0x11f5b5){_0x27bb62(_0x1a7c74,_0x247670)['then'](function(_0x453ce5){_0x247670[_0x317b('0x17')]=_0x453ce5[_0x317b('0x1f')];_0x5d4444[_0x317b('0x20')][_0x317b('0x21')]({'where':{'phone':_0x247670['phone'],'VoiceQueueId':_0x1a7c74['id']}})['then'](function(_0x72356c){if(!_[_0x317b('0x1c')](_0x72356c)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+_0x317b('0x24')+_0x1a7c74['id']);}return _0x5d4444['CmHopper'][_0x317b('0x25')]({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670[_0x317b('0x27')]?_0x247670[_0x317b('0x27')]:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19')),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670['callbackUniqueid']?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'VoiceQueueId':_0x1a7c74['id']});})[_0x317b('0x29')](function(_0x1991f8){_0x11f5b5(_0x1991f8);});});});};var _0x3d7eff=function(_0xd2ab6f){return new BPromise(function(_0x47c667,_0x268f28){_0x27bb62(_0xd2ab6f,_0x247670)['then'](function(_0x4a51f9){_0x247670['scheduledat']=_0x4a51f9['ret'];_0x5d4444[_0x317b('0x20')][_0x317b('0x21')]({'where':{'phone':_0x247670[_0x317b('0x23')],'VoiceQueueId':_0xd2ab6f['id']}})[_0x317b('0x1b')](function(_0x3fe9af){if(!_[_0x317b('0x1c')](_0x3fe9af)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+_0x317b('0x2a')+_0xd2ab6f['id']);}return _0x5d4444['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x247670['phone'],'VoiceQueueId':_0xd2ab6f['id']}});})[_0x317b('0x1b')](function(_0x1dacbd){if(!_['isNil'](_0x1dacbd)){throw new Error(_0x317b('0x2b')+_0x247670[_0x317b('0x23')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0xd2ab6f['id']);}return _0x5d4444[_0x317b('0x20')]['create']({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670[_0x317b('0x27')]?_0x247670['priority']:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19')),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670['callbackUniqueid']?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'VoiceQueueId':_0xd2ab6f['id']});})[_0x317b('0x29')](function(_0x40e4fb){_0x268f28(_0x40e4fb);});});});};function _0x4a11a0(){return function(_0x3b4713){logger[_0x317b('0x13')]('cmContact','afterCreate',util[_0x317b('0x16')](_0x3b4713,{'showHidden':![],'depth':null}));};}function _0x5c219e(_0x8c7362,_0x5b6cba){var _0x323ea8=_0x5b6cba[_0x317b('0x17')]?_0x5b6cba[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19'));return new BPromise(function(_0x8d47a3,_0x1e911d){if(_[_0x317b('0x1c')](_0x5b6cba[_0x317b('0x1a')])){_0x8d47a3({'ret':_0x323ea8});}else{_0x5d4444[_0x317b('0x2c')][_0x317b('0x21')]({'where':{'id':_0x8c7362['id']}})[_0x317b('0x1b')](function(_0xd9b063){if(!_['isNil'](_0xd9b063)){var _0x3b037b=_0xd9b063[_0x317b('0x1a')];if(!_[_0x317b('0x1c')](_0x3b037b)){var _0xcbdd13=shared[_0x317b('0x1d')];var _0x3f247d=_0xcbdd13[_0x3b037b];var _0x3df8cc=_0xcbdd13[_0x5b6cba[_0x317b('0x1a')]];if(!_['isNil'](_0x3f247d)&&!_[_0x317b('0x1c')](_0x3df8cc)){var _0x46c6a3=_0x3f247d['utcOffset']-_0x3df8cc[_0x317b('0x1e')];_0x323ea8=_0x5b6cba['scheduledat']?_0x5b6cba['scheduledat']:moment();var _0x4f9180=moment(_0x323ea8)[_0x317b('0x2d')](_0x46c6a3,_0x317b('0x2e'));_0x8d47a3({'ret':_0x4f9180[_0x317b('0x18')](_0x317b('0x19'))});}else _0x8d47a3({'ret':_0x323ea8});}else _0x8d47a3({'ret':_0x323ea8});}else{_0x8d47a3({'ret':_0x323ea8});}});}});return 0xa;}var _0x22e617=function(_0x478d32){return new BPromise(function(_0x3841bd,_0x4f200c){_0x5c219e(_0x478d32,_0x247670)[_0x317b('0x1b')](function(_0x26e988){_0x247670[_0x317b('0x17')]=_0x26e988['ret'];_0x5d4444[_0x317b('0x20')]['findOne']({'where':{'phone':_0x247670[_0x317b('0x23')],'CampaignId':_0x478d32['id']}})[_0x317b('0x1b')](function(_0x15f123){if(!_['isNil'](_0x15f123)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x478d32['id']);}return _0x5d4444[_0x317b('0x20')][_0x317b('0x25')]({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670['priority']?_0x247670[_0x317b('0x27')]:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19')),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()['format'](_0x317b('0x19')):undefined,'CampaignId':_0x478d32['id']});})[_0x317b('0x29')](function(_0x46c7b3){_0x4f200c(_0x46c7b3);});});});};var _0x205565=function(_0x5722e2){return new BPromise(function(_0x3d0a67,_0x406fb6){_0x5c219e(_0x5722e2,_0x247670)[_0x317b('0x1b')](function(_0xd20281){_0x247670[_0x317b('0x17')]=_0xd20281[_0x317b('0x1f')];_0x5d4444[_0x317b('0x20')][_0x317b('0x21')]({'where':{'phone':_0x247670[_0x317b('0x23')],'CampaignId':_0x5722e2['id']}})[_0x317b('0x1b')](function(_0x439123){if(!_[_0x317b('0x1c')](_0x439123)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+_0x317b('0x2f')+_0x5722e2['id']);}return _0x5d4444[_0x317b('0x30')][_0x317b('0x21')]({'where':{'calleridnum':_0x247670['phone'],'CampaignId':_0x5722e2['id']}});})[_0x317b('0x1b')](function(_0x1c72b0){if(!_[_0x317b('0x1c')](_0x1c72b0)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x247670[_0x317b('0x23')]+_0x317b('0x31')+_0x5722e2['id']);}return _0x5d4444['CmHopper']['create']({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670[_0x317b('0x27')]?_0x247670['priority']:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670['callbackUniqueid']:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5722e2['id']});})[_0x317b('0x29')](function(_0x3694dd){_0x406fb6(_0x3694dd);});});});};if(_0x247670['ListId']){_0x5d4444[_0x317b('0x32')][_0x317b('0x33')]({'where':{'type':_0x317b('0x34')},'attributes':['id','dialCheckDuplicateType',_0x317b('0x1a')],'include':[{'model':_0x5d4444[_0x317b('0x35')],'as':_0x317b('0x36'),'where':{'id':_0x247670[_0x317b('0x26')]}}]})[_0x317b('0x1b')](function(_0xa62679){if(_0xa62679){var _0x273911=[];for(var _0x2240b2=0x0,_0x19266a;_0x2240b2<_0xa62679[_0x317b('0x37')];_0x2240b2+=0x1){_0x19266a=_0xa62679[_0x2240b2][_0x317b('0x12')]({'plain':!![]});switch(_0x19266a[_0x317b('0x38')]){case _0x317b('0x39'):_0x3d7eff(_0x19266a)['catch'](_0x9dee0a());break;case _0x317b('0x3a'):_0x58532e(_0x19266a)['catch'](_0x9dee0a());break;default:_0x5c219e(_0x19266a,_0x247670)[_0x317b('0x1b')](function(_0x2122c5){_0x247670[_0x317b('0x17')]=_0x2122c5[_0x317b('0x1f')];_0x5d4444[_0x317b('0x20')]['create']({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670['scheduledat']:moment()[_0x317b('0x18')](_0x317b('0x19')),'priority':_0x247670[_0x317b('0x27')]?_0x247670[_0x317b('0x27')]:0x2,'callback':_0x247670['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'VoiceQueueId':_0x19266a['id']})[_0x317b('0x29')](_0x9dee0a());});}}}})['then'](function(){return _0x5d4444[_0x317b('0x32')][_0x317b('0x33')]({'where':{'type':_0x317b('0x34')},'attributes':['id'],'include':[{'model':_0x5d4444[_0x317b('0x35')],'as':_0x317b('0x3b'),'where':{'id':_0x247670['ListId']}}]})[_0x317b('0x1b')](function(_0x594eac){if(_0x594eac){var _0x362fc3=[];for(var _0x1c0397=0x0,_0x2b9fe2;_0x1c0397<_0x594eac[_0x317b('0x37')];_0x1c0397+=0x1){_0x2b9fe2=_0x594eac[_0x1c0397][_0x317b('0x12')]({'plain':!![]});_0x5d4444['CmHopperBlack'][_0x317b('0x25')]({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'VoiceQueueId':_0x2b9fe2['id']})['catch'](function(_0x45c5d0){logger[_0x317b('0x13')](_0x317b('0x3c'),'afterCreate',_0x45c5d0[_0x317b('0x3d')]);});}}});})[_0x317b('0x1b')](function(){return _0x5d4444[_0x317b('0x2c')][_0x317b('0x33')]({'attributes':['id','dialCheckDuplicateType',_0x317b('0x1a')],'include':[{'model':_0x5d4444['CmList'],'as':_0x317b('0x36'),'where':{'id':_0x247670[_0x317b('0x26')]}}]})[_0x317b('0x1b')](function(_0x5e850b){if(_0x5e850b){var _0x117e25=[];for(var _0x5128e8=0x0,_0xcba1d8;_0x5128e8<_0x5e850b[_0x317b('0x37')];_0x5128e8+=0x1){_0xcba1d8=_0x5e850b[_0x5128e8][_0x317b('0x12')]({'plain':!![]});switch(_0xcba1d8[_0x317b('0x38')]){case _0x317b('0x39'):_0x205565(_0xcba1d8)[_0x317b('0x29')](_0x4a11a0());break;case _0x317b('0x3a'):_0x22e617(_0xcba1d8)[_0x317b('0x29')](_0x4a11a0());break;default:_0x5d4444[_0x317b('0x20')][_0x317b('0x25')]({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x247670['priority']?_0x247670['priority']:0x2,'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670['callbackUniqueid']:undefined,'callbackat':_0x247670['callbackUniqueid']?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'CampaignId':_0xcba1d8['id']})[_0x317b('0x29')](_0x4a11a0());}}}});})['then'](function(){return _0x5d4444[_0x317b('0x2c')]['findAll']({'attributes':['id'],'include':[{'model':_0x5d4444['CmList'],'as':_0x317b('0x3b'),'where':{'id':_0x247670['ListId']}}]})[_0x317b('0x1b')](function(_0x240674){if(_0x240674){var _0x41ab5f=[];for(var _0x3d2d3b=0x0,_0xbcddc9;_0x3d2d3b<_0x240674[_0x317b('0x37')];_0x3d2d3b+=0x1){_0xbcddc9=_0x240674[_0x3d2d3b][_0x317b('0x12')]({'plain':!![]});_0x5d4444[_0x317b('0x3e')][_0x317b('0x25')]({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670['ListId'],'CampaignId':_0xbcddc9['id']})[_0x317b('0x29')](function(_0x104166){logger[_0x317b('0x13')](_0x317b('0x3c'),_0x317b('0x15'),_0x104166['message']);});}}});})[_0x317b('0x1b')](function(){_0xa2f089();})[_0x317b('0x29')](function(_0x265bfd){logger[_0x317b('0x13')](_0x317b('0x3c'),_0x317b('0x15'),_0x265bfd['message']);_0xa2f089(_0x265bfd);});}else{_0xa2f089(new Error(_0x317b('0x3f')));}},'afterDestroy':function(_0x55d40e,_0x1a10c9,_0x39d33b){var _0x1ea6ee=_0x379ff3['models'];var _0x301161=_0x55d40e['get']({'plain':!![]});return _0x1ea6ee['CmHopper'][_0x317b('0x33')]({'raw':!![],'where':{'ListId':_0x301161[_0x317b('0x26')],'ContactId':_0x301161['id']}})[_0x317b('0x1b')](function(_0x30bfc5){if(!_[_0x317b('0x40')](_0x30bfc5)){var _0xc411c1=[];for(var _0x497821=0x0;_0x497821<_0x30bfc5[_0x317b('0x37')];_0x497821+=0x1){var _0x3cf4b9=_0x1ea6ee['CmHopper'][_0x317b('0x41')]({'where':{'ListId':_0x30bfc5[_0x497821][_0x317b('0x26')],'ContactId':_0x30bfc5[_0x497821][_0x317b('0x42')],'VoiceQueueId':_0x30bfc5[_0x497821][_0x317b('0x43')],'CampaignId':_0x30bfc5[_0x497821][_0x317b('0x44')]}});_0xc411c1[_0x317b('0x45')](_0x3cf4b9);}return BPromise[_0x317b('0x46')](_0xc411c1);}})[_0x317b('0x1b')](function(_0x2b6f90){logger['info'](_0x317b('0x47'),util[_0x317b('0x16')](_0x2b6f90,{'showHidden':![],'depth':null}));_0x39d33b();})[_0x317b('0x29')](function(_0x164f36){logger[_0x317b('0x13')](_0x317b('0x48'),util[_0x317b('0x16')](_0x164f36,{'showHidden':![],'depth':null}));_0x39d33b(_0x164f36);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 80fbf4e..00dc55e 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x5d1fbd,_0x4a09eb){var _0x109dd1=function(_0x5c335a){while(--_0x5c335a){_0x5d1fbd['push'](_0x5d1fbd['shift']());}};_0x109dd1(++_0x4a09eb);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x56b02e,_0x20d04f){var _0x416666=function(_0x2ede93){while(--_0x2ede93){_0x56b02e['push'](_0x56b02e['shift']());}};_0x416666(++_0x20d04f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 36ce529..c2df2b7 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 _0x847d=['exports','INTEGER','STRING'];(function(_0xdc5b9a,_0x232a75){var _0x34171=function(_0x2050ce){while(--_0x2050ce){_0xdc5b9a['push'](_0xdc5b9a['shift']());}};_0x34171(++_0x232a75);}(_0x847d,0x14a));var _0xd847=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x847d[_0x16dbfd];return _0x382254;};'use strict';var Sequelize=require('sequelize');module[_0xd847('0x0')]={'CmContactId':{'type':Sequelize[_0xd847('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xd847('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xd847('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xd847('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xd847('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x5089=['STRING','INTEGER','PHONE','sequelize','exports'];(function(_0x371646,_0x3b06ba){var _0x21385e=function(_0x3fe625){while(--_0x3fe625){_0x371646['push'](_0x371646['shift']());}};_0x21385e(++_0x3b06ba);}(_0x5089,0x1bb));var _0x9508=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x5089[_0x9d1e6b];return _0x2b3070;};'use strict';var Sequelize=require(_0x9508('0x0'));module[_0x9508('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x9508('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x9508('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x9508('0x2')],'defaultValue':_0x9508('0x4')},'OrderBy':{'type':Sequelize[_0x9508('0x3')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index e46bc4e..a670c16 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 _0xf4e6=['includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','get','error','stack','name','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','options','where','include','findAll','rows','catch','show','params'];(function(_0x5073eb,_0xd38033){var _0x2d5c8d=function(_0xe12259){while(--_0xe12259){_0x5073eb['push'](_0x5073eb['shift']());}};_0x2d5c8d(++_0xd38033);}(_0xf4e6,0x19c));var _0x6f4e=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xf4e6[_0x39cf70];return _0x580424;};'use strict';var emlformat=require(_0x6f4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f4e('0x1'));var jsonpatch=require(_0x6f4e('0x2'));var rp=require(_0x6f4e('0x3'));var moment=require('moment');var BPromise=require(_0x6f4e('0x4'));var Mustache=require('mustache');var util=require(_0x6f4e('0x5'));var path=require(_0x6f4e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6f4e('0x7'));var crypto=require(_0x6f4e('0x8'));var jsforce=require(_0x6f4e('0x9'));var deskjs=require(_0x6f4e('0xa'));var toCsv=require(_0x6f4e('0xb'));var querystring=require(_0x6f4e('0xc'));var Papa=require('papaparse');var Redis=require(_0x6f4e('0xd'));var authService=require(_0x6f4e('0xe'));var qs=require(_0x6f4e('0xf'));var as=require(_0x6f4e('0x10'));var hardwareService=require(_0x6f4e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6f4e('0x12'));var config=require(_0x6f4e('0x13'));var licenseUtil=require(_0x6f4e('0x14'));var db=require(_0x6f4e('0x15'))['db'];function respondWithStatusCode(_0x509ace,_0x7b833d){_0x7b833d=_0x7b833d||0xcc;return function(_0x14f86b){if(_0x14f86b){return _0x509ace[_0x6f4e('0x16')](_0x7b833d);}return _0x509ace[_0x6f4e('0x17')](_0x7b833d)[_0x6f4e('0x18')]();};}function respondWithResult(_0x46c628,_0x16e78e){_0x16e78e=_0x16e78e||0xc8;return function(_0x430e0b){if(_0x430e0b){return _0x46c628[_0x6f4e('0x17')](_0x16e78e)[_0x6f4e('0x19')](_0x430e0b);}};}function respondWithFilteredResult(_0x45b35c,_0x4d1653){return function(_0x445879){if(_0x445879){var _0xd845b0=typeof _0x4d1653[_0x6f4e('0x1a')]==='undefined'&&typeof _0x4d1653[_0x6f4e('0x1b')]==='undefined';var _0x4024c1=_0x445879[_0x6f4e('0x1c')];var _0x17c251=_0xd845b0?0x0:_0x4d1653[_0x6f4e('0x1a')];var _0x1494c8=_0xd845b0?_0x445879[_0x6f4e('0x1c')]:_0x4d1653[_0x6f4e('0x1a')]+_0x4d1653[_0x6f4e('0x1b')];var _0x277c5a;if(_0x1494c8>=_0x4024c1){_0x1494c8=_0x4024c1;_0x277c5a=0xc8;}else{_0x277c5a=0xce;}_0x45b35c[_0x6f4e('0x17')](_0x277c5a);return _0x45b35c[_0x6f4e('0x1d')](_0x6f4e('0x1e'),_0x17c251+'-'+_0x1494c8+'/'+_0x4024c1)[_0x6f4e('0x19')](_0x445879);}return null;};}function patchUpdates(_0x48ff6b){return function(_0x32a9b9){try{jsonpatch[_0x6f4e('0x1f')](_0x32a9b9,_0x48ff6b,!![]);}catch(_0x3c7267){return BPromise['reject'](_0x3c7267);}return _0x32a9b9[_0x6f4e('0x20')]();};}function saveUpdates(_0x28223f,_0x1bfa67){return function(_0x4f5056){if(_0x4f5056){return _0x4f5056[_0x6f4e('0x21')](_0x28223f)['then'](function(_0x3adfde){return _0x3adfde;});}return null;};}function removeEntity(_0xaf3c5c,_0x3ec1a5){return function(_0x54546c){if(_0x54546c){return _0x54546c[_0x6f4e('0x22')]()[_0x6f4e('0x23')](function(){var _0x2372b3=_0x54546c[_0x6f4e('0x24')]({'plain':!![]});var _0x2e14a7='CmContactHasItems';return db['UserProfileResource'][_0x6f4e('0x22')]({'where':{'type':_0x2e14a7,'resourceId':_0x2372b3['id']}})[_0x6f4e('0x23')](function(){return _0x54546c;});})[_0x6f4e('0x23')](function(){_0xaf3c5c[_0x6f4e('0x17')](0xcc)[_0x6f4e('0x18')]();});}};}function handleEntityNotFound(_0x12d871,_0x55d785){return function(_0x94b633){if(!_0x94b633){_0x12d871[_0x6f4e('0x16')](0x194);}return _0x94b633;};}function handleError(_0x1afcfd,_0x293576){_0x293576=_0x293576||0x1f4;return function(_0x4ba068){logger[_0x6f4e('0x25')](_0x4ba068[_0x6f4e('0x26')]);if(_0x4ba068['name']){delete _0x4ba068[_0x6f4e('0x27')];}_0x1afcfd[_0x6f4e('0x17')](_0x293576)['send'](_0x4ba068);};}exports['index']=function(_0x118b0e,_0x1fe825){var _0x187c47={},_0x41aced={},_0x18d065={'count':0x0,'rows':[]};var _0x5d6dbc=_[_0x6f4e('0x28')](db[_0x6f4e('0x29')][_0x6f4e('0x2a')],function(_0x393b8f){return{'name':_0x393b8f[_0x6f4e('0x2b')],'type':_0x393b8f[_0x6f4e('0x2c')][_0x6f4e('0x2d')]};});_0x41aced[_0x6f4e('0x2e')]=_['map'](_0x5d6dbc,'name');_0x41aced[_0x6f4e('0x2f')]=_[_0x6f4e('0x30')](_0x118b0e[_0x6f4e('0x2f')]);_0x41aced[_0x6f4e('0x31')]=_['intersection'](_0x41aced[_0x6f4e('0x2e')],_0x41aced[_0x6f4e('0x2f')]);_0x187c47[_0x6f4e('0x32')]=_[_0x6f4e('0x33')](_0x41aced[_0x6f4e('0x2e')],qs[_0x6f4e('0x34')](_0x118b0e[_0x6f4e('0x2f')]['fields']));_0x187c47[_0x6f4e('0x32')]=_0x187c47[_0x6f4e('0x32')][_0x6f4e('0x35')]?_0x187c47[_0x6f4e('0x32')]:_0x41aced[_0x6f4e('0x2e')];if(!_0x118b0e['query']['hasOwnProperty'](_0x6f4e('0x36'))){_0x187c47[_0x6f4e('0x1b')]=qs[_0x6f4e('0x1b')](_0x118b0e[_0x6f4e('0x2f')]['limit']);_0x187c47[_0x6f4e('0x1a')]=qs['offset'](_0x118b0e[_0x6f4e('0x2f')][_0x6f4e('0x1a')]);}_0x187c47[_0x6f4e('0x37')]=qs['sort'](_0x118b0e[_0x6f4e('0x2f')][_0x6f4e('0x38')]);_0x187c47['where']=qs[_0x6f4e('0x31')](_[_0x6f4e('0x39')](_0x118b0e[_0x6f4e('0x2f')],_0x41aced[_0x6f4e('0x31')]),_0x5d6dbc);if(_0x118b0e['query'][_0x6f4e('0x3a')]){_0x187c47['where']=_[_0x6f4e('0x3b')](_0x187c47['where'],{'$or':_[_0x6f4e('0x28')](_0x5d6dbc,function(_0x994914){if(_0x994914[_0x6f4e('0x2c')]!=='VIRTUAL'){var _0x391971={};_0x391971[_0x994914[_0x6f4e('0x27')]]={'$like':'%'+_0x118b0e[_0x6f4e('0x2f')][_0x6f4e('0x3a')]+'%'};return _0x391971;}})});}_0x187c47=_[_0x6f4e('0x3b')]({},_0x187c47,_0x118b0e[_0x6f4e('0x3c')]);var _0xb16a3b={'where':_0x187c47[_0x6f4e('0x3d')]};return db[_0x6f4e('0x29')][_0x6f4e('0x1c')](_0xb16a3b)['then'](function(_0x25499a){_0x18d065['count']=_0x25499a;if(_0x118b0e[_0x6f4e('0x2f')]['includeAll']){_0x187c47[_0x6f4e('0x3e')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x6f4e('0x3f')](_0x187c47);})[_0x6f4e('0x23')](function(_0x1e6711){_0x18d065[_0x6f4e('0x40')]=_0x1e6711;return _0x18d065;})[_0x6f4e('0x23')](respondWithFilteredResult(_0x1fe825,_0x187c47))[_0x6f4e('0x41')](handleError(_0x1fe825,null));};exports[_0x6f4e('0x42')]=function(_0x31f0ed,_0x19c560){var _0x227f42={'raw':!![],'where':{'id':_0x31f0ed[_0x6f4e('0x43')]['id']}},_0x21484a={};_0x21484a['model']=_[_0x6f4e('0x30')](db[_0x6f4e('0x29')]['rawAttributes']);_0x21484a[_0x6f4e('0x2f')]=_[_0x6f4e('0x30')](_0x31f0ed[_0x6f4e('0x2f')]);_0x21484a[_0x6f4e('0x31')]=_['intersection'](_0x21484a[_0x6f4e('0x2e')],_0x21484a['query']);_0x227f42[_0x6f4e('0x32')]=_[_0x6f4e('0x33')](_0x21484a[_0x6f4e('0x2e')],qs[_0x6f4e('0x34')](_0x31f0ed['query'][_0x6f4e('0x34')]));_0x227f42[_0x6f4e('0x32')]=_0x227f42['attributes'][_0x6f4e('0x35')]?_0x227f42[_0x6f4e('0x32')]:_0x21484a[_0x6f4e('0x2e')];if(_0x31f0ed['query'][_0x6f4e('0x44')]){_0x227f42[_0x6f4e('0x3e')]=[{'all':!![]}];}_0x227f42=_['merge']({},_0x227f42,_0x31f0ed[_0x6f4e('0x3c')]);return db[_0x6f4e('0x29')][_0x6f4e('0x45')](_0x227f42)[_0x6f4e('0x23')](handleEntityNotFound(_0x19c560,null))[_0x6f4e('0x23')](respondWithResult(_0x19c560,null))[_0x6f4e('0x41')](handleError(_0x19c560,null));};exports[_0x6f4e('0x46')]=function(_0x561133,_0x1a7bc2){return db[_0x6f4e('0x29')][_0x6f4e('0x46')](_0x561133[_0x6f4e('0x47')],{})[_0x6f4e('0x23')](function(_0x51493e){var _0x5e7075=_0x561133[_0x6f4e('0x48')][_0x6f4e('0x24')]({'plain':!![]});if(!_0x5e7075)throw new Error(_0x6f4e('0x49'));if(_0x5e7075[_0x6f4e('0x4a')]==='user'){var _0x183072=_0x51493e[_0x6f4e('0x24')]({'plain':!![]});var _0x117ad5=_0x6f4e('0x4b');return db[_0x6f4e('0x4c')]['find']({'where':{'name':_0x117ad5,'userProfileId':_0x5e7075[_0x6f4e('0x4d')]},'raw':!![]})[_0x6f4e('0x23')](function(_0x25a70b){if(_0x25a70b&&_0x25a70b[_0x6f4e('0x4e')]===0x0){return db[_0x6f4e('0x4f')][_0x6f4e('0x46')]({'name':_0x183072['name'],'resourceId':_0x183072['id'],'type':_0x25a70b[_0x6f4e('0x27')],'sectionId':_0x25a70b['id']},{})[_0x6f4e('0x23')](function(){return _0x51493e;});}else{return _0x51493e;}})[_0x6f4e('0x41')](function(_0x55dc79){logger[_0x6f4e('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55dc79);throw _0x55dc79;});}return _0x51493e;})['then'](respondWithResult(_0x1a7bc2,0xc9))[_0x6f4e('0x41')](handleError(_0x1a7bc2,null));};exports[_0x6f4e('0x21')]=function(_0x5ef029,_0x413302){if(_0x5ef029[_0x6f4e('0x47')]['id']){delete _0x5ef029[_0x6f4e('0x47')]['id'];}return db['CmContactHasItem'][_0x6f4e('0x45')]({'where':{'id':_0x5ef029[_0x6f4e('0x43')]['id']}})[_0x6f4e('0x23')](handleEntityNotFound(_0x413302,null))[_0x6f4e('0x23')](saveUpdates(_0x5ef029[_0x6f4e('0x47')],null))[_0x6f4e('0x23')](respondWithResult(_0x413302,null))[_0x6f4e('0x41')](handleError(_0x413302,null));};exports[_0x6f4e('0x22')]=function(_0x3251cb,_0x1a235f){return db[_0x6f4e('0x29')][_0x6f4e('0x45')]({'where':{'id':_0x3251cb['params']['id']}})['then'](handleEntityNotFound(_0x1a235f,null))[_0x6f4e('0x23')](removeEntity(_0x1a235f,null))[_0x6f4e('0x41')](handleError(_0x1a235f,null));}; \ No newline at end of file +var _0xc402=['rawAttributes','type','key','model','name','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','includeAll','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','stack','send','index','map','CmContactHasItem'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xc402,0xca));var _0x2c40=function(_0x2cf7a3,_0x5f4e4b){_0x2cf7a3=_0x2cf7a3-0x0;var _0x2df1f1=_0xc402[_0x2cf7a3];return _0x2df1f1;};'use strict';var emlformat=require(_0x2c40('0x0'));var rimraf=require(_0x2c40('0x1'));var zipdir=require(_0x2c40('0x2'));var jsonpatch=require(_0x2c40('0x3'));var rp=require('request-promise');var moment=require(_0x2c40('0x4'));var BPromise=require(_0x2c40('0x5'));var Mustache=require(_0x2c40('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2c40('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c40('0x8'));var _=require('lodash');var squel=require(_0x2c40('0x9'));var crypto=require(_0x2c40('0xa'));var jsforce=require(_0x2c40('0xb'));var deskjs=require(_0x2c40('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2c40('0xd'));var Papa=require('papaparse');var Redis=require(_0x2c40('0xe'));var authService=require(_0x2c40('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c40('0x10'));var logger=require(_0x2c40('0x11'))(_0x2c40('0x12'));var utils=require(_0x2c40('0x13'));var config=require(_0x2c40('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27fa0c,_0x5bf683){_0x5bf683=_0x5bf683||0xcc;return function(_0x32a078){if(_0x32a078){return _0x27fa0c[_0x2c40('0x15')](_0x5bf683);}return _0x27fa0c[_0x2c40('0x16')](_0x5bf683)[_0x2c40('0x17')]();};}function respondWithResult(_0x4ee8f5,_0x3b60cd){_0x3b60cd=_0x3b60cd||0xc8;return function(_0x8b11c9){if(_0x8b11c9){return _0x4ee8f5[_0x2c40('0x16')](_0x3b60cd)[_0x2c40('0x18')](_0x8b11c9);}};}function respondWithFilteredResult(_0x5148de,_0x4e9ff4){return function(_0x5d0884){if(_0x5d0884){var _0x2255b1=typeof _0x4e9ff4[_0x2c40('0x19')]===_0x2c40('0x1a')&&typeof _0x4e9ff4[_0x2c40('0x1b')]===_0x2c40('0x1a');var _0x1fadc2=_0x5d0884[_0x2c40('0x1c')];var _0x51a750=_0x2255b1?0x0:_0x4e9ff4[_0x2c40('0x19')];var _0x32334e=_0x2255b1?_0x5d0884['count']:_0x4e9ff4[_0x2c40('0x19')]+_0x4e9ff4[_0x2c40('0x1b')];var _0x36d06c;if(_0x32334e>=_0x1fadc2){_0x32334e=_0x1fadc2;_0x36d06c=0xc8;}else{_0x36d06c=0xce;}_0x5148de[_0x2c40('0x16')](_0x36d06c);return _0x5148de[_0x2c40('0x1d')](_0x2c40('0x1e'),_0x51a750+'-'+_0x32334e+'/'+_0x1fadc2)[_0x2c40('0x18')](_0x5d0884);}return null;};}function patchUpdates(_0x4c2116){return function(_0xe77015){try{jsonpatch[_0x2c40('0x1f')](_0xe77015,_0x4c2116,!![]);}catch(_0x2acec4){return BPromise[_0x2c40('0x20')](_0x2acec4);}return _0xe77015[_0x2c40('0x21')]();};}function saveUpdates(_0x3856eb,_0x4b17b8){return function(_0x357c87){if(_0x357c87){return _0x357c87[_0x2c40('0x22')](_0x3856eb)[_0x2c40('0x23')](function(_0x4b83c6){return _0x4b83c6;});}return null;};}function removeEntity(_0x4333b4,_0x3fd702){return function(_0x55630e){if(_0x55630e){return _0x55630e[_0x2c40('0x24')]()[_0x2c40('0x23')](function(){var _0x1818e3=_0x55630e['get']({'plain':!![]});var _0x3e807e=_0x2c40('0x25');return db[_0x2c40('0x26')]['destroy']({'where':{'type':_0x3e807e,'resourceId':_0x1818e3['id']}})[_0x2c40('0x23')](function(){return _0x55630e;});})[_0x2c40('0x23')](function(){_0x4333b4[_0x2c40('0x16')](0xcc)[_0x2c40('0x17')]();});}};}function handleEntityNotFound(_0x3770ce,_0x358254){return function(_0x1fda96){if(!_0x1fda96){_0x3770ce['sendStatus'](0x194);}return _0x1fda96;};}function handleError(_0x92969d,_0x1c4572){_0x1c4572=_0x1c4572||0x1f4;return function(_0x5087c2){logger['error'](_0x5087c2[_0x2c40('0x27')]);if(_0x5087c2['name']){delete _0x5087c2['name'];}_0x92969d[_0x2c40('0x16')](_0x1c4572)[_0x2c40('0x28')](_0x5087c2);};}exports[_0x2c40('0x29')]=function(_0x3d0079,_0x31364e){var _0x37c144={},_0x3d68c5={},_0x501c11={'count':0x0,'rows':[]};var _0x27ebac=_[_0x2c40('0x2a')](db[_0x2c40('0x2b')][_0x2c40('0x2c')],function(_0x30da81){return{'name':_0x30da81['fieldName'],'type':_0x30da81[_0x2c40('0x2d')][_0x2c40('0x2e')]};});_0x3d68c5[_0x2c40('0x2f')]=_[_0x2c40('0x2a')](_0x27ebac,_0x2c40('0x30'));_0x3d68c5['query']=_[_0x2c40('0x31')](_0x3d0079['query']);_0x3d68c5['filters']=_[_0x2c40('0x32')](_0x3d68c5[_0x2c40('0x2f')],_0x3d68c5[_0x2c40('0x33')]);_0x37c144['attributes']=_[_0x2c40('0x32')](_0x3d68c5[_0x2c40('0x2f')],qs[_0x2c40('0x34')](_0x3d0079[_0x2c40('0x33')][_0x2c40('0x34')]));_0x37c144['attributes']=_0x37c144[_0x2c40('0x35')][_0x2c40('0x36')]?_0x37c144[_0x2c40('0x35')]:_0x3d68c5[_0x2c40('0x2f')];if(!_0x3d0079[_0x2c40('0x33')][_0x2c40('0x37')](_0x2c40('0x38'))){_0x37c144[_0x2c40('0x1b')]=qs[_0x2c40('0x1b')](_0x3d0079['query'][_0x2c40('0x1b')]);_0x37c144[_0x2c40('0x19')]=qs[_0x2c40('0x19')](_0x3d0079[_0x2c40('0x33')][_0x2c40('0x19')]);}_0x37c144[_0x2c40('0x39')]=qs[_0x2c40('0x3a')](_0x3d0079[_0x2c40('0x33')][_0x2c40('0x3a')]);_0x37c144[_0x2c40('0x3b')]=qs[_0x2c40('0x3c')](_[_0x2c40('0x3d')](_0x3d0079[_0x2c40('0x33')],_0x3d68c5['filters']),_0x27ebac);if(_0x3d0079['query'][_0x2c40('0x3e')]){_0x37c144[_0x2c40('0x3b')]=_[_0x2c40('0x3f')](_0x37c144[_0x2c40('0x3b')],{'$or':_[_0x2c40('0x2a')](_0x27ebac,function(_0x1437f1){if(_0x1437f1[_0x2c40('0x2d')]!==_0x2c40('0x40')){var _0x2b3253={};_0x2b3253[_0x1437f1[_0x2c40('0x30')]]={'$like':'%'+_0x3d0079['query'][_0x2c40('0x3e')]+'%'};return _0x2b3253;}})});}_0x37c144=_[_0x2c40('0x3f')]({},_0x37c144,_0x3d0079[_0x2c40('0x41')]);var _0x5cddc5={'where':_0x37c144[_0x2c40('0x3b')]};return db[_0x2c40('0x2b')][_0x2c40('0x1c')](_0x5cddc5)['then'](function(_0x142081){_0x501c11['count']=_0x142081;if(_0x3d0079[_0x2c40('0x33')]['includeAll']){_0x37c144[_0x2c40('0x42')]=[{'all':!![]}];}return db[_0x2c40('0x2b')]['findAll'](_0x37c144);})[_0x2c40('0x23')](function(_0x211516){_0x501c11[_0x2c40('0x43')]=_0x211516;return _0x501c11;})['then'](respondWithFilteredResult(_0x31364e,_0x37c144))[_0x2c40('0x44')](handleError(_0x31364e,null));};exports['show']=function(_0x439d75,_0x17e149){var _0x4258cf={'raw':!![],'where':{'id':_0x439d75[_0x2c40('0x45')]['id']}},_0x497c11={};_0x497c11[_0x2c40('0x2f')]=_[_0x2c40('0x31')](db[_0x2c40('0x2b')][_0x2c40('0x2c')]);_0x497c11['query']=_['keys'](_0x439d75[_0x2c40('0x33')]);_0x497c11['filters']=_[_0x2c40('0x32')](_0x497c11['model'],_0x497c11[_0x2c40('0x33')]);_0x4258cf[_0x2c40('0x35')]=_[_0x2c40('0x32')](_0x497c11[_0x2c40('0x2f')],qs[_0x2c40('0x34')](_0x439d75[_0x2c40('0x33')][_0x2c40('0x34')]));_0x4258cf['attributes']=_0x4258cf[_0x2c40('0x35')][_0x2c40('0x36')]?_0x4258cf[_0x2c40('0x35')]:_0x497c11[_0x2c40('0x2f')];if(_0x439d75[_0x2c40('0x33')][_0x2c40('0x46')]){_0x4258cf[_0x2c40('0x42')]=[{'all':!![]}];}_0x4258cf=_['merge']({},_0x4258cf,_0x439d75['options']);return db[_0x2c40('0x2b')][_0x2c40('0x47')](_0x4258cf)[_0x2c40('0x23')](handleEntityNotFound(_0x17e149,null))['then'](respondWithResult(_0x17e149,null))[_0x2c40('0x44')](handleError(_0x17e149,null));};exports[_0x2c40('0x48')]=function(_0x3a344f,_0x55c4e4){return db[_0x2c40('0x2b')][_0x2c40('0x48')](_0x3a344f[_0x2c40('0x49')],{})['then'](function(_0x5c0786){var _0x3a246a=_0x3a344f['user'][_0x2c40('0x4a')]({'plain':!![]});if(!_0x3a246a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a246a[_0x2c40('0x4b')]===_0x2c40('0x4c')){var _0x2f0710=_0x5c0786[_0x2c40('0x4a')]({'plain':!![]});var _0x49f774=_0x2c40('0x25');return db[_0x2c40('0x4d')][_0x2c40('0x47')]({'where':{'name':_0x49f774,'userProfileId':_0x3a246a[_0x2c40('0x4e')]},'raw':!![]})[_0x2c40('0x23')](function(_0x8f11d4){if(_0x8f11d4&&_0x8f11d4[_0x2c40('0x4f')]===0x0){return db[_0x2c40('0x26')]['create']({'name':_0x2f0710[_0x2c40('0x30')],'resourceId':_0x2f0710['id'],'type':_0x8f11d4[_0x2c40('0x30')],'sectionId':_0x8f11d4['id']},{})[_0x2c40('0x23')](function(){return _0x5c0786;});}else{return _0x5c0786;}})[_0x2c40('0x44')](function(_0x207a9d){logger[_0x2c40('0x50')](_0x2c40('0x51'),_0x207a9d);throw _0x207a9d;});}return _0x5c0786;})[_0x2c40('0x23')](respondWithResult(_0x55c4e4,0xc9))[_0x2c40('0x44')](handleError(_0x55c4e4,null));};exports[_0x2c40('0x22')]=function(_0x4fe737,_0x5a7dc2){if(_0x4fe737['body']['id']){delete _0x4fe737[_0x2c40('0x49')]['id'];}return db[_0x2c40('0x2b')][_0x2c40('0x47')]({'where':{'id':_0x4fe737[_0x2c40('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a7dc2,null))[_0x2c40('0x23')](saveUpdates(_0x4fe737[_0x2c40('0x49')],null))[_0x2c40('0x23')](respondWithResult(_0x5a7dc2,null))[_0x2c40('0x44')](handleError(_0x5a7dc2,null));};exports['destroy']=function(_0x2c5de4,_0x4259f5){return db[_0x2c40('0x2b')]['find']({'where':{'id':_0x2c5de4['params']['id']}})[_0x2c40('0x23')](handleEntityNotFound(_0x4259f5,null))['then'](removeEntity(_0x4259f5,null))[_0x2c40('0x44')](handleError(_0x4259f5,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index e888efd..ab3e5a7 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 _0x5f22=['path','./cmContactHasItem.attributes','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x545712,_0x2f3449){var _0x2e1c53=function(_0x4e5fa9){while(--_0x4e5fa9){_0x545712['push'](_0x545712['shift']());}};_0x2e1c53(++_0x2f3449);}(_0x5f22,0x144));var _0x25f2=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x5f22[_0xf31767];return _0x24bd0c;};'use strict';var _=require(_0x25f2('0x0'));var util=require(_0x25f2('0x1'));var logger=require(_0x25f2('0x2'))(_0x25f2('0x3'));var moment=require(_0x25f2('0x4'));var BPromise=require('bluebird');var rp=require(_0x25f2('0x5'));var fs=require('fs');var path=require(_0x25f2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x25f2('0x7'));module['exports']=function(_0x21384d,_0x3ff788){return _0x21384d['define'](_0x25f2('0x8'),attributes,{'tableName':_0x25f2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a13=['api','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items','util','../../config/logger'];(function(_0x5d1a3f,_0x3df1c0){var _0xbb4d27=function(_0x450caf){while(--_0x450caf){_0x5d1a3f['push'](_0x5d1a3f['shift']());}};_0xbb4d27(++_0x3df1c0);}(_0x4a13,0xa3));var _0x34a1=function(_0x4a4028,_0x1fdbd7){_0x4a4028=_0x4a4028-0x0;var _0x12985d=_0x4a13[_0x4a4028];return _0x12985d;};'use strict';var _=require('lodash');var util=require(_0x34a1('0x0'));var logger=require(_0x34a1('0x1'))(_0x34a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x34a1('0x3'));var fs=require('fs');var path=require(_0x34a1('0x4'));var rimraf=require(_0x34a1('0x5'));var config=require(_0x34a1('0x6'));var attributes=require(_0x34a1('0x7'));module[_0x34a1('0x8')]=function(_0x42525e,_0x2edfd7){return _0x42525e[_0x34a1('0x9')]('CmContactHasItem',attributes,{'tableName':_0x34a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 989c30b..84a73d7 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 _0xec2e=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','CmContactHasItem,\x20%s,\x20%s','result','lodash','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xec2e,0x163));var _0xeec2=function(_0x3e042f,_0x51e726){_0x3e042f=_0x3e042f-0x0;var _0x2eba6b=_0xec2e[_0x3e042f];return _0x2eba6b;};'use strict';var _=require(_0xeec2('0x0'));var util=require(_0xeec2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeec2('0x2'));var db=require(_0xeec2('0x3'))['db'];var utils=require(_0xeec2('0x4'));var logger=require(_0xeec2('0x5'))('rpc');var config=require(_0xeec2('0x6'));var jayson=require(_0xeec2('0x7'));var client=jayson[_0xeec2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeab77e,_0x3b17ec,_0x3fd70c){return new BPromise(function(_0x4a6a09,_0x127243){return client[_0xeec2('0x9')](_0xeab77e,_0x3fd70c)[_0xeec2('0xa')](function(_0x130ab4){logger[_0xeec2('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x3b17ec,_0xeec2('0xc'));logger[_0xeec2('0xd')](_0xeec2('0xe'),_0x3b17ec,_0xeec2('0xc'),JSON[_0xeec2('0xf')](_0x130ab4));if(_0x130ab4['error']){if(_0x130ab4[_0xeec2('0x10')]['code']===0x1f4){logger[_0xeec2('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x3b17ec,_0x130ab4[_0xeec2('0x10')][_0xeec2('0x11')]);return _0x127243(_0x130ab4['error']['message']);}logger['error'](_0xeec2('0x12'),_0x3b17ec,_0x130ab4[_0xeec2('0x10')]['message']);return _0x4a6a09(_0x130ab4[_0xeec2('0x10')]['message']);}else{logger['info'](_0xeec2('0x12'),_0x3b17ec,_0xeec2('0xc'));_0x4a6a09(_0x130ab4[_0xeec2('0x13')][_0xeec2('0x11')]);}})['catch'](function(_0x2be93e){logger[_0xeec2('0x10')](_0xeec2('0x12'),_0x3b17ec,_0x2be93e);_0x127243(_0x2be93e);});});} \ No newline at end of file +var _0x8337=['rpc','jayson/promise','http','request','then','info','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmContactHasItem,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4f7116,_0x22a118){var _0x407cc8=function(_0x963773){while(--_0x963773){_0x4f7116['push'](_0x4f7116['shift']());}};_0x407cc8(++_0x22a118);}(_0x8337,0xaa));var _0x7833=function(_0x532169,_0x40bc6c){_0x532169=_0x532169-0x0;var _0x26a17d=_0x8337[_0x532169];return _0x26a17d;};'use strict';var _=require(_0x7833('0x0'));var util=require(_0x7833('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7833('0x2'));var fs=require('fs');var Redis=require(_0x7833('0x3'));var db=require(_0x7833('0x4'))['db'];var utils=require(_0x7833('0x5'));var logger=require('../../config/logger')(_0x7833('0x6'));var config=require('../../config/environment');var jayson=require(_0x7833('0x7'));var client=jayson['client'][_0x7833('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2eb78c,_0x3d4ff7,_0x95a14f){return new BPromise(function(_0x5e6d51,_0x2fc699){return client[_0x7833('0x9')](_0x2eb78c,_0x95a14f)[_0x7833('0xa')](function(_0x37e655){logger[_0x7833('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x3d4ff7,'request\x20sent');logger[_0x7833('0xc')](_0x7833('0xd'),_0x3d4ff7,_0x7833('0xe'),JSON[_0x7833('0xf')](_0x37e655));if(_0x37e655[_0x7833('0x10')]){if(_0x37e655[_0x7833('0x10')][_0x7833('0x11')]===0x1f4){logger[_0x7833('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x3d4ff7,_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);return _0x2fc699(_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);}logger[_0x7833('0x10')](_0x7833('0x13'),_0x3d4ff7,_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);return _0x5e6d51(_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);}else{logger[_0x7833('0xb')](_0x7833('0x13'),_0x3d4ff7,_0x7833('0xe'));_0x5e6d51(_0x37e655[_0x7833('0x14')][_0x7833('0x12')]);}})[_0x7833('0x15')](function(_0x4ad22f){logger[_0x7833('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x3d4ff7,_0x4ad22f);_0x2fc699(_0x4ad22f);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 4398a96..4ef363a 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 _0x549f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','delete','destroy','exports'];(function(_0xa365c4,_0x299a22){var _0x2e6af5=function(_0x50ebd8){while(--_0x50ebd8){_0xa365c4['push'](_0xa365c4['shift']());}};_0x2e6af5(++_0x299a22);}(_0x549f,0xab));var _0xf549=function(_0x4cc470,_0x28dc14){_0x4cc470=_0x4cc470-0x0;var _0x1a7f82=_0x549f[_0x4cc470];return _0x1a7f82;};'use strict';var multer=require(_0xf549('0x0'));var util=require(_0xf549('0x1'));var path=require(_0xf549('0x2'));var timeout=require(_0xf549('0x3'));var express=require(_0xf549('0x4'));var router=express[_0xf549('0x5')]();var fs_extra=require(_0xf549('0x6'));var auth=require(_0xf549('0x7'));var interaction=require(_0xf549('0x8'));var config=require(_0xf549('0x9'));var controller=require('./cmContactHasItem.controller');router[_0xf549('0xa')]('/',auth[_0xf549('0xb')](),controller[_0xf549('0xc')]);router[_0xf549('0xa')](_0xf549('0xd'),auth[_0xf549('0xb')](),controller[_0xf549('0xe')]);router['post']('/',auth[_0xf549('0xb')](),controller['create']);router[_0xf549('0xf')]('/:id',auth[_0xf549('0xb')](),controller['update']);router[_0xf549('0x10')](_0xf549('0xd'),auth[_0xf549('0xb')](),controller[_0xf549('0x11')]);module[_0xf549('0x12')]=router; \ No newline at end of file +var _0x7a27=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','show','post','create','put','/:id','multer','util','path','connect-timeout'];(function(_0x1de6e1,_0x35c25b){var _0x5e895f=function(_0x39eeb7){while(--_0x39eeb7){_0x1de6e1['push'](_0x1de6e1['shift']());}};_0x5e895f(++_0x35c25b);}(_0x7a27,0x172));var _0x77a2=function(_0x107179,_0x46e138){_0x107179=_0x107179-0x0;var _0x31f40e=_0x7a27[_0x107179];return _0x31f40e;};'use strict';var multer=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var path=require(_0x77a2('0x2'));var timeout=require(_0x77a2('0x3'));var express=require('express');var router=express[_0x77a2('0x4')]();var fs_extra=require(_0x77a2('0x5'));var auth=require(_0x77a2('0x6'));var interaction=require(_0x77a2('0x7'));var config=require('../../config/environment');var controller=require(_0x77a2('0x8'));router[_0x77a2('0x9')]('/',auth[_0x77a2('0xa')](),controller[_0x77a2('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x77a2('0xc')]);router[_0x77a2('0xd')]('/',auth[_0x77a2('0xa')](),controller[_0x77a2('0xe')]);router[_0x77a2('0xf')]('/:id',auth[_0x77a2('0xa')](),controller['update']);router['delete'](_0x77a2('0x10'),auth[_0x77a2('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 6cc5995..9fa14c0 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 _0x3b52=['exports','VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT','type','select','parse','values','stringify','BOOLEAN','ENUM','lodash'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0x3b52,0xdf));var _0x23b5=function(_0x1ff0cd,_0x75a49c){_0x1ff0cd=_0x1ff0cd-0x0;var _0x3389fd=_0x3b52[_0x1ff0cd];return _0x3389fd;};'use strict';var Sequelize=require('sequelize');var _=require(_0x23b5('0x0'));module[_0x23b5('0x1')]={'name':{'type':Sequelize[_0x23b5('0x2')],'get':function(_0x38dabb){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x23b5('0x3')],'allowNull':![],'set':function(_0x10746c){this[_0x23b5('0x4')](_0x23b5('0x5'),_0x10746c?_0x10746c:this[_0x23b5('0x6')](_0x23b5('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x23b5('0x8')]('long'),'get':function(){if(this[_0x23b5('0x6')](_0x23b5('0x9'))===_0x23b5('0xa')){return JSON[_0x23b5('0xb')](this[_0x23b5('0x6')](_0x23b5('0xc')));}else{return this['getDataValue']('values');}},'set':function(_0x58592f){if(Array['isArray'](_0x58592f)){this[_0x23b5('0x4')](_0x23b5('0xc'),JSON[_0x23b5('0xd')](_0x58592f));}else{this[_0x23b5('0x4')](_0x23b5('0xc'),_0x58592f);}}},'required':{'type':Sequelize[_0x23b5('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x23b5('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x23b5('0xf')]('voice')}}; \ No newline at end of file +var _0x0295=['BOOLEAN','voice','sequelize','lodash','VIRTUAL','alias','STRING','setDataValue','name','TEXT','type','select','parse','getDataValue','values'];(function(_0x4dff34,_0x49f98a){var _0x395029=function(_0x4031ee){while(--_0x4031ee){_0x4dff34['push'](_0x4dff34['shift']());}};_0x395029(++_0x49f98a);}(_0x0295,0x11f));var _0x5029=function(_0xff8595,_0x39341d){_0xff8595=_0xff8595-0x0;var _0x31e49e=_0x0295[_0xff8595];return _0x31e49e;};'use strict';var Sequelize=require(_0x5029('0x0'));var _=require(_0x5029('0x1'));module['exports']={'name':{'type':Sequelize[_0x5029('0x2')],'get':function(_0x9d4f24){return this['getDataValue'](_0x5029('0x3'));}},'alias':{'type':Sequelize[_0x5029('0x4')],'allowNull':![],'set':function(_0x4cd251){this[_0x5029('0x5')]('alias',_0x4cd251?_0x4cd251:this['getDataValue'](_0x5029('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x5029('0x7')]('long'),'get':function(){if(this['getDataValue'](_0x5029('0x8'))===_0x5029('0x9')){return JSON[_0x5029('0xa')](this[_0x5029('0xb')](_0x5029('0xc')));}else{return this['getDataValue'](_0x5029('0xc'));}},'set':function(_0x9022a6){if(Array['isArray'](_0x9022a6)){this[_0x5029('0x5')]('values',JSON['stringify'](_0x9022a6));}else{this[_0x5029('0x5')]('values',_0x9022a6);}}},'required':{'type':Sequelize[_0x5029('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x5029('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 1835fc5..7bf2dc4 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 _0xbee8=['TEXT','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','options','CmCustomField','includeAll','findAll','rows','show','params','length','include','find','catch','body','create','sequelize','Sequelize'];(function(_0x3afdfa,_0x236c0a){var _0x53fd42=function(_0x4457be){while(--_0x4457be){_0x3afdfa['push'](_0x3afdfa['shift']());}};_0x53fd42(++_0x236c0a);}(_0xbee8,0x1b2));var _0x8bee=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0xbee8[_0x4d6bfd];return _0x243a46;};'use strict';var emlformat=require(_0x8bee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bee('0x1'));var jsonpatch=require(_0x8bee('0x2'));var rp=require(_0x8bee('0x3'));var moment=require(_0x8bee('0x4'));var BPromise=require(_0x8bee('0x5'));var Mustache=require('mustache');var util=require(_0x8bee('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8bee('0x7'));var ejs=require(_0x8bee('0x8'));var fs=require('fs');var fs_extra=require(_0x8bee('0x9'));var _=require('lodash');var squel=require(_0x8bee('0xa'));var crypto=require(_0x8bee('0xb'));var jsforce=require(_0x8bee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8bee('0xd'));var Papa=require(_0x8bee('0xe'));var Redis=require(_0x8bee('0xf'));var authService=require(_0x8bee('0x10'));var qs=require(_0x8bee('0x11'));var as=require(_0x8bee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bee('0x13'))(_0x8bee('0x14'));var utils=require(_0x8bee('0x15'));var config=require(_0x8bee('0x16'));var licenseUtil=require(_0x8bee('0x17'));var db=require(_0x8bee('0x18'))['db'];function respondWithStatusCode(_0x3365fc,_0x385250){_0x385250=_0x385250||0xcc;return function(_0x45784c){if(_0x45784c){return _0x3365fc[_0x8bee('0x19')](_0x385250);}return _0x3365fc[_0x8bee('0x1a')](_0x385250)['end']();};}function respondWithResult(_0xf266c7,_0x48f61d){_0x48f61d=_0x48f61d||0xc8;return function(_0x583b60){if(_0x583b60){return _0xf266c7[_0x8bee('0x1a')](_0x48f61d)[_0x8bee('0x1b')](_0x583b60);}};}function respondWithFilteredResult(_0x3f5ca9,_0x31dbe2){return function(_0x47d004){if(_0x47d004){var _0x2495cb=typeof _0x31dbe2[_0x8bee('0x1c')]===_0x8bee('0x1d')&&typeof _0x31dbe2[_0x8bee('0x1e')]==='undefined';var _0x31ec7d=_0x47d004[_0x8bee('0x1f')];var _0x2b35ad=_0x2495cb?0x0:_0x31dbe2[_0x8bee('0x1c')];var _0x5b22bd=_0x2495cb?_0x47d004[_0x8bee('0x1f')]:_0x31dbe2['offset']+_0x31dbe2[_0x8bee('0x1e')];var _0x5d7dde;if(_0x5b22bd>=_0x31ec7d){_0x5b22bd=_0x31ec7d;_0x5d7dde=0xc8;}else{_0x5d7dde=0xce;}_0x3f5ca9[_0x8bee('0x1a')](_0x5d7dde);return _0x3f5ca9['set'](_0x8bee('0x20'),_0x2b35ad+'-'+_0x5b22bd+'/'+_0x31ec7d)[_0x8bee('0x1b')](_0x47d004);}return null;};}function patchUpdates(_0x18cd96){return function(_0x1c0434){try{jsonpatch[_0x8bee('0x21')](_0x1c0434,_0x18cd96,!![]);}catch(_0x499a96){return BPromise[_0x8bee('0x22')](_0x499a96);}return _0x1c0434[_0x8bee('0x23')]();};}function saveUpdates(_0x12f5ea,_0x2622ee){return function(_0x2ba11f){if(_0x2ba11f){return _0x2ba11f[_0x8bee('0x24')](_0x12f5ea)[_0x8bee('0x25')](function(_0x2a6c19){return _0x2a6c19;});}return null;};}function removeEntity(_0x2081ef,_0x30bb0c){return function(_0xd965a5){if(_0xd965a5){return _0xd965a5[_0x8bee('0x26')]()[_0x8bee('0x25')](function(){_0x2081ef['status'](0xcc)[_0x8bee('0x27')]();});}};}function handleEntityNotFound(_0x436a1f,_0x6590a0){return function(_0x1f7b99){if(!_0x1f7b99){_0x436a1f['sendStatus'](0x194);}return _0x1f7b99;};}function handleError(_0x31a581,_0x188623){_0x188623=_0x188623||0x1f4;return function(_0x53ae95){logger['error'](_0x53ae95[_0x8bee('0x28')]);if(_0x53ae95[_0x8bee('0x29')]){delete _0x53ae95[_0x8bee('0x29')];}_0x31a581['status'](_0x188623)[_0x8bee('0x2a')](_0x53ae95);};}exports['index']=function(_0x5ca805,_0x1d1ca0){var _0x5367eb={},_0x576d31={},_0x51d569={'count':0x0,'rows':[]};var _0x24330e=_[_0x8bee('0x2b')](db['CmCustomField'][_0x8bee('0x2c')],function(_0x863735){return{'name':_0x863735['fieldName'],'type':_0x863735['type'][_0x8bee('0x2d')]};});_0x576d31['model']=_[_0x8bee('0x2e')](_[_0x8bee('0x2b')](_0x24330e,_0x8bee('0x29')),[_0x8bee('0x29')]);_0x576d31[_0x8bee('0x2f')]=_[_0x8bee('0x30')](_0x5ca805[_0x8bee('0x2f')]);_0x576d31[_0x8bee('0x31')]=_[_0x8bee('0x32')](_0x576d31[_0x8bee('0x33')],_0x576d31[_0x8bee('0x2f')]);_0x5367eb[_0x8bee('0x34')]=_[_0x8bee('0x32')](_0x576d31[_0x8bee('0x33')],qs['fields'](_0x5ca805[_0x8bee('0x2f')][_0x8bee('0x35')]));_0x5367eb[_0x8bee('0x34')]=_0x5367eb[_0x8bee('0x34')]['length']?_0x5367eb[_0x8bee('0x34')]:_0x576d31['model'];if(!_0x5ca805['query'][_0x8bee('0x36')](_0x8bee('0x37'))){_0x5367eb['limit']=qs[_0x8bee('0x1e')](_0x5ca805[_0x8bee('0x2f')][_0x8bee('0x1e')]);_0x5367eb[_0x8bee('0x1c')]=qs['offset'](_0x5ca805[_0x8bee('0x2f')][_0x8bee('0x1c')]);}_0x5367eb['order']=qs[_0x8bee('0x38')](_0x5ca805[_0x8bee('0x2f')][_0x8bee('0x38')]);_0x5367eb[_0x8bee('0x39')]=qs[_0x8bee('0x31')](_['pick'](_0x5ca805[_0x8bee('0x2f')],_0x576d31[_0x8bee('0x31')]),_0x24330e);if(_0x5ca805[_0x8bee('0x2f')]['filter']){_0x5367eb[_0x8bee('0x39')]=_[_0x8bee('0x3a')](_0x5367eb[_0x8bee('0x39')],{'$or':_[_0x8bee('0x2b')](_0x24330e,function(_0x54bccc){if(_0x54bccc[_0x8bee('0x3b')]!==_0x8bee('0x3c')){var _0x3d0e00={};_0x3d0e00[_0x54bccc[_0x8bee('0x29')]]={'$like':'%'+_0x5ca805[_0x8bee('0x2f')]['filter']+'%'};return _0x3d0e00;}})});}_0x5367eb=_[_0x8bee('0x3a')]({},_0x5367eb,_0x5ca805[_0x8bee('0x3d')]);var _0x15c55b={'where':_0x5367eb[_0x8bee('0x39')]};return db[_0x8bee('0x3e')][_0x8bee('0x1f')](_0x15c55b)[_0x8bee('0x25')](function(_0x5af113){_0x51d569['count']=_0x5af113;if(_0x5ca805['query'][_0x8bee('0x3f')]){_0x5367eb['include']=[{'all':!![]}];}return db['CmCustomField'][_0x8bee('0x40')](_0x5367eb);})['then'](function(_0x1f9eb2){_0x51d569[_0x8bee('0x41')]=_0x1f9eb2;return _0x51d569;})[_0x8bee('0x25')](respondWithFilteredResult(_0x1d1ca0,_0x5367eb))['catch'](handleError(_0x1d1ca0,null));};exports[_0x8bee('0x42')]=function(_0x4d5434,_0x193a7c){var _0x3f6136={'raw':!![],'where':{'id':_0x4d5434[_0x8bee('0x43')]['id']}},_0x195973={};_0x195973[_0x8bee('0x33')]=_[_0x8bee('0x30')](db[_0x8bee('0x3e')][_0x8bee('0x2c')]);_0x195973['query']=_[_0x8bee('0x30')](_0x4d5434[_0x8bee('0x2f')]);_0x195973[_0x8bee('0x31')]=_[_0x8bee('0x32')](_0x195973['model'],_0x195973['query']);_0x3f6136[_0x8bee('0x34')]=_[_0x8bee('0x32')](_0x195973[_0x8bee('0x33')],qs[_0x8bee('0x35')](_0x4d5434[_0x8bee('0x2f')][_0x8bee('0x35')]));_0x3f6136[_0x8bee('0x34')]=_0x3f6136[_0x8bee('0x34')][_0x8bee('0x44')]?_0x3f6136['attributes']:_0x195973[_0x8bee('0x33')];if(_0x4d5434[_0x8bee('0x2f')]['includeAll']){_0x3f6136[_0x8bee('0x45')]=[{'all':!![]}];}_0x3f6136=_[_0x8bee('0x3a')]({},_0x3f6136,_0x4d5434[_0x8bee('0x3d')]);return db[_0x8bee('0x3e')][_0x8bee('0x46')](_0x3f6136)[_0x8bee('0x25')](handleEntityNotFound(_0x193a7c,null))[_0x8bee('0x25')](respondWithResult(_0x193a7c,null))[_0x8bee('0x47')](handleError(_0x193a7c,null));};exports[_0x8bee('0x24')]=function(_0x47df85,_0x38e020){if(_0x47df85[_0x8bee('0x48')]['id']){delete _0x47df85['body']['id'];}return db[_0x8bee('0x3e')]['find']({'where':{'id':_0x47df85['params']['id']}})[_0x8bee('0x25')](handleEntityNotFound(_0x38e020,null))[_0x8bee('0x25')](saveUpdates(_0x47df85[_0x8bee('0x48')],null))[_0x8bee('0x25')](respondWithResult(_0x38e020,null))[_0x8bee('0x47')](handleError(_0x38e020,null));};exports['destroy']=function(_0x1ecf0d,_0x3a5fc4){return db['CmCustomField'][_0x8bee('0x46')]({'where':{'id':_0x1ecf0d[_0x8bee('0x43')]['id']}})[_0x8bee('0x25')](handleEntityNotFound(_0x3a5fc4,null))[_0x8bee('0x25')](removeEntity(_0x3a5fc4,null))[_0x8bee('0x47')](handleError(_0x3a5fc4,null));};exports[_0x8bee('0x49')]=function(_0x334f4a,_0x5e89c4){var _0x5c55ed;return db[_0x8bee('0x4a')]['transaction'](function(_0x5c191b){return db[_0x8bee('0x3e')][_0x8bee('0x49')](_0x334f4a['body'],{'transaction':_0x5c191b})[_0x8bee('0x25')](function(_0x2390e2){_0x5c55ed=_0x2390e2;var _0x3e3651={'type':db['Sequelize']['TEXT'],'transaction':_0x5c191b};switch(_0x334f4a['body']['type']){case'text':_0x3e3651[_0x8bee('0x3b')]=db[_0x8bee('0x4b')][_0x8bee('0x4c')];break;case _0x8bee('0x4d'):_0x3e3651[_0x8bee('0x3b')]=db[_0x8bee('0x4b')][_0x8bee('0x4e')];break;case _0x8bee('0x4f'):_0x3e3651[_0x8bee('0x3b')]=db['Sequelize']['BOOLEAN'];_0x3e3651[_0x8bee('0x50')]=![];break;default:}return db[_0x8bee('0x4a')][_0x8bee('0x51')][_0x8bee('0x52')](_0x8bee('0x53'),util[_0x8bee('0x54')]('cf_%d',_0x5c55ed['id']),_0x3e3651);})[_0x8bee('0x25')](function(){return _0x5c55ed;});})[_0x8bee('0x25')](respondWithResult(_0x5e89c4,0xc9))[_0x8bee('0x47')](handleError(_0x5e89c4,null));}; \ No newline at end of file +var _0x32bf=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','fieldName','type','key','model','differenceBy','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','filter','options','CmCustomField','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','length','merge','find','body','params','create','sequelize','Sequelize','text','INTEGER','switch','defaultValue','queryInterface','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x7d3603,_0x38dbd8){var _0x157464=function(_0x52a990){while(--_0x52a990){_0x7d3603['push'](_0x7d3603['shift']());}};_0x157464(++_0x38dbd8);}(_0x32bf,0xf5));var _0xf32b=function(_0x4a40dd,_0x37a7d4){_0x4a40dd=_0x4a40dd-0x0;var _0xfdfa08=_0x32bf[_0x4a40dd];return _0xfdfa08;};'use strict';var emlformat=require(_0xf32b('0x0'));var rimraf=require(_0xf32b('0x1'));var zipdir=require(_0xf32b('0x2'));var jsonpatch=require(_0xf32b('0x3'));var rp=require(_0xf32b('0x4'));var moment=require(_0xf32b('0x5'));var BPromise=require(_0xf32b('0x6'));var Mustache=require(_0xf32b('0x7'));var util=require(_0xf32b('0x8'));var path=require(_0xf32b('0x9'));var sox=require(_0xf32b('0xa'));var csv=require(_0xf32b('0xb'));var ejs=require(_0xf32b('0xc'));var fs=require('fs');var fs_extra=require(_0xf32b('0xd'));var _=require(_0xf32b('0xe'));var squel=require(_0xf32b('0xf'));var crypto=require(_0xf32b('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xf32b('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf32b('0x12'));var Redis=require('ioredis');var authService=require(_0xf32b('0x13'));var qs=require(_0xf32b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf32b('0x15'));var logger=require(_0xf32b('0x16'))(_0xf32b('0x17'));var utils=require(_0xf32b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf32b('0x19'))['db'];function respondWithStatusCode(_0x430fc5,_0x2476a2){_0x2476a2=_0x2476a2||0xcc;return function(_0x3a3f7f){if(_0x3a3f7f){return _0x430fc5[_0xf32b('0x1a')](_0x2476a2);}return _0x430fc5['status'](_0x2476a2)['end']();};}function respondWithResult(_0x4fd49e,_0x27a5aa){_0x27a5aa=_0x27a5aa||0xc8;return function(_0x266909){if(_0x266909){return _0x4fd49e[_0xf32b('0x1b')](_0x27a5aa)[_0xf32b('0x1c')](_0x266909);}};}function respondWithFilteredResult(_0x2767ed,_0x5a89b6){return function(_0x408749){if(_0x408749){var _0xdf6f99=typeof _0x5a89b6['offset']===_0xf32b('0x1d')&&typeof _0x5a89b6[_0xf32b('0x1e')]===_0xf32b('0x1d');var _0x1ff2b3=_0x408749[_0xf32b('0x1f')];var _0x4803f0=_0xdf6f99?0x0:_0x5a89b6['offset'];var _0x1b008d=_0xdf6f99?_0x408749['count']:_0x5a89b6[_0xf32b('0x20')]+_0x5a89b6['limit'];var _0x220800;if(_0x1b008d>=_0x1ff2b3){_0x1b008d=_0x1ff2b3;_0x220800=0xc8;}else{_0x220800=0xce;}_0x2767ed[_0xf32b('0x1b')](_0x220800);return _0x2767ed['set'](_0xf32b('0x21'),_0x4803f0+'-'+_0x1b008d+'/'+_0x1ff2b3)['json'](_0x408749);}return null;};}function patchUpdates(_0x11e74c){return function(_0x482578){try{jsonpatch[_0xf32b('0x22')](_0x482578,_0x11e74c,!![]);}catch(_0x460f32){return BPromise[_0xf32b('0x23')](_0x460f32);}return _0x482578[_0xf32b('0x24')]();};}function saveUpdates(_0x3ff141,_0x144e6){return function(_0x1b6268){if(_0x1b6268){return _0x1b6268[_0xf32b('0x25')](_0x3ff141)['then'](function(_0x13df20){return _0x13df20;});}return null;};}function removeEntity(_0x21e910,_0x1b81db){return function(_0x1cba41){if(_0x1cba41){return _0x1cba41[_0xf32b('0x26')]()[_0xf32b('0x27')](function(){_0x21e910[_0xf32b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc86a0,_0x4974d2){return function(_0x231899){if(!_0x231899){_0xc86a0[_0xf32b('0x1a')](0x194);}return _0x231899;};}function handleError(_0x34c99d,_0x20b7fe){_0x20b7fe=_0x20b7fe||0x1f4;return function(_0x2fc377){logger[_0xf32b('0x28')](_0x2fc377[_0xf32b('0x29')]);if(_0x2fc377[_0xf32b('0x2a')]){delete _0x2fc377['name'];}_0x34c99d[_0xf32b('0x1b')](_0x20b7fe)['send'](_0x2fc377);};}exports[_0xf32b('0x2b')]=function(_0x335314,_0xf2b907){var _0x33d438={},_0x432a3c={},_0x4acac4={'count':0x0,'rows':[]};var _0x647dbc=_[_0xf32b('0x2c')](db['CmCustomField']['rawAttributes'],function(_0x3c9e9b){return{'name':_0x3c9e9b[_0xf32b('0x2d')],'type':_0x3c9e9b[_0xf32b('0x2e')][_0xf32b('0x2f')]};});_0x432a3c[_0xf32b('0x30')]=_[_0xf32b('0x31')](_[_0xf32b('0x2c')](_0x647dbc,_0xf32b('0x2a')),[_0xf32b('0x2a')]);_0x432a3c[_0xf32b('0x32')]=_[_0xf32b('0x33')](_0x335314['query']);_0x432a3c[_0xf32b('0x34')]=_['intersection'](_0x432a3c[_0xf32b('0x30')],_0x432a3c[_0xf32b('0x32')]);_0x33d438['attributes']=_['intersection'](_0x432a3c[_0xf32b('0x30')],qs[_0xf32b('0x35')](_0x335314[_0xf32b('0x32')][_0xf32b('0x35')]));_0x33d438[_0xf32b('0x36')]=_0x33d438[_0xf32b('0x36')]['length']?_0x33d438[_0xf32b('0x36')]:_0x432a3c[_0xf32b('0x30')];if(!_0x335314[_0xf32b('0x32')]['hasOwnProperty'](_0xf32b('0x37'))){_0x33d438[_0xf32b('0x1e')]=qs['limit'](_0x335314['query']['limit']);_0x33d438[_0xf32b('0x20')]=qs[_0xf32b('0x20')](_0x335314[_0xf32b('0x32')][_0xf32b('0x20')]);}_0x33d438[_0xf32b('0x38')]=qs[_0xf32b('0x39')](_0x335314['query']['sort']);_0x33d438[_0xf32b('0x3a')]=qs[_0xf32b('0x34')](_[_0xf32b('0x3b')](_0x335314[_0xf32b('0x32')],_0x432a3c[_0xf32b('0x34')]),_0x647dbc);if(_0x335314[_0xf32b('0x32')][_0xf32b('0x3c')]){_0x33d438[_0xf32b('0x3a')]=_['merge'](_0x33d438['where'],{'$or':_[_0xf32b('0x2c')](_0x647dbc,function(_0x1671a4){if(_0x1671a4['type']!=='VIRTUAL'){var _0x712a4a={};_0x712a4a[_0x1671a4[_0xf32b('0x2a')]]={'$like':'%'+_0x335314[_0xf32b('0x32')][_0xf32b('0x3c')]+'%'};return _0x712a4a;}})});}_0x33d438=_['merge']({},_0x33d438,_0x335314[_0xf32b('0x3d')]);var _0x153292={'where':_0x33d438[_0xf32b('0x3a')]};return db[_0xf32b('0x3e')][_0xf32b('0x1f')](_0x153292)[_0xf32b('0x27')](function(_0x51987b){_0x4acac4['count']=_0x51987b;if(_0x335314[_0xf32b('0x32')][_0xf32b('0x3f')]){_0x33d438[_0xf32b('0x40')]=[{'all':!![]}];}return db[_0xf32b('0x3e')][_0xf32b('0x41')](_0x33d438);})['then'](function(_0x5dc2ea){_0x4acac4[_0xf32b('0x42')]=_0x5dc2ea;return _0x4acac4;})[_0xf32b('0x27')](respondWithFilteredResult(_0xf2b907,_0x33d438))[_0xf32b('0x43')](handleError(_0xf2b907,null));};exports[_0xf32b('0x44')]=function(_0x21f1d5,_0x341587){var _0x513d42={'raw':!![],'where':{'id':_0x21f1d5['params']['id']}},_0x427f7c={};_0x427f7c[_0xf32b('0x30')]=_[_0xf32b('0x33')](db[_0xf32b('0x3e')][_0xf32b('0x45')]);_0x427f7c[_0xf32b('0x32')]=_[_0xf32b('0x33')](_0x21f1d5[_0xf32b('0x32')]);_0x427f7c[_0xf32b('0x34')]=_[_0xf32b('0x46')](_0x427f7c[_0xf32b('0x30')],_0x427f7c['query']);_0x513d42[_0xf32b('0x36')]=_['intersection'](_0x427f7c[_0xf32b('0x30')],qs[_0xf32b('0x35')](_0x21f1d5[_0xf32b('0x32')][_0xf32b('0x35')]));_0x513d42[_0xf32b('0x36')]=_0x513d42[_0xf32b('0x36')][_0xf32b('0x47')]?_0x513d42[_0xf32b('0x36')]:_0x427f7c[_0xf32b('0x30')];if(_0x21f1d5[_0xf32b('0x32')][_0xf32b('0x3f')]){_0x513d42[_0xf32b('0x40')]=[{'all':!![]}];}_0x513d42=_[_0xf32b('0x48')]({},_0x513d42,_0x21f1d5[_0xf32b('0x3d')]);return db[_0xf32b('0x3e')][_0xf32b('0x49')](_0x513d42)['then'](handleEntityNotFound(_0x341587,null))[_0xf32b('0x27')](respondWithResult(_0x341587,null))['catch'](handleError(_0x341587,null));};exports[_0xf32b('0x25')]=function(_0x4e042a,_0x40a8eb){if(_0x4e042a['body']['id']){delete _0x4e042a[_0xf32b('0x4a')]['id'];}return db[_0xf32b('0x3e')][_0xf32b('0x49')]({'where':{'id':_0x4e042a[_0xf32b('0x4b')]['id']}})[_0xf32b('0x27')](handleEntityNotFound(_0x40a8eb,null))[_0xf32b('0x27')](saveUpdates(_0x4e042a[_0xf32b('0x4a')],null))['then'](respondWithResult(_0x40a8eb,null))['catch'](handleError(_0x40a8eb,null));};exports[_0xf32b('0x26')]=function(_0x397f6f,_0x5e41e7){return db[_0xf32b('0x3e')][_0xf32b('0x49')]({'where':{'id':_0x397f6f[_0xf32b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e41e7,null))[_0xf32b('0x27')](removeEntity(_0x5e41e7,null))['catch'](handleError(_0x5e41e7,null));};exports[_0xf32b('0x4c')]=function(_0xe8eb55,_0x5da270){var _0x384d51;return db[_0xf32b('0x4d')]['transaction'](function(_0x226ed9){return db['CmCustomField'][_0xf32b('0x4c')](_0xe8eb55['body'],{'transaction':_0x226ed9})[_0xf32b('0x27')](function(_0x5b888d){_0x384d51=_0x5b888d;var _0x4cd76c={'type':db[_0xf32b('0x4e')]['TEXT'],'transaction':_0x226ed9};switch(_0xe8eb55[_0xf32b('0x4a')][_0xf32b('0x2e')]){case _0xf32b('0x4f'):_0x4cd76c[_0xf32b('0x2e')]=db[_0xf32b('0x4e')]['TEXT'];break;case'number':_0x4cd76c[_0xf32b('0x2e')]=db[_0xf32b('0x4e')][_0xf32b('0x50')];break;case _0xf32b('0x51'):_0x4cd76c['type']=db[_0xf32b('0x4e')]['BOOLEAN'];_0x4cd76c[_0xf32b('0x52')]=![];break;default:}return db['sequelize'][_0xf32b('0x53')]['addColumn']('cm_contacts',util['format'](_0xf32b('0x54'),_0x384d51['id']),_0x4cd76c);})[_0xf32b('0x27')](function(){return _0x384d51;});})[_0xf32b('0x27')](respondWithResult(_0x5da270,0xc9))['catch'](handleError(_0x5da270,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 68fa559..5c36022 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 _0xd950=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd950,0xca));var _0x0d95=function(_0xf2210e,_0x41b259){_0xf2210e=_0xf2210e-0x0;var _0x51d444=_0xd950[_0xf2210e];return _0x51d444;};'use strict';var _=require(_0x0d95('0x0'));var util=require(_0x0d95('0x1'));var logger=require(_0x0d95('0x2'))(_0x0d95('0x3'));var moment=require(_0x0d95('0x4'));var BPromise=require(_0x0d95('0x5'));var rp=require(_0x0d95('0x6'));var fs=require('fs');var path=require(_0x0d95('0x7'));var rimraf=require(_0x0d95('0x8'));var config=require(_0x0d95('0x9'));var attributes=require(_0x0d95('0xa'));module[_0x0d95('0xb')]=function(_0x381afd,_0x3ed929){return _0x381afd[_0x0d95('0xc')](_0x0d95('0xd'),attributes,{'tableName':_0x0d95('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6fa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','cm_custom_fields','lodash','../../config/logger'];(function(_0x4d98e6,_0x290e7a){var _0x1c648d=function(_0x2003ba){while(--_0x2003ba){_0x4d98e6['push'](_0x4d98e6['shift']());}};_0x1c648d(++_0x290e7a);}(_0xa6fa,0x196));var _0xaa6f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa6fa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xaa6f('0x0'));var util=require('util');var logger=require(_0xaa6f('0x1'))(_0xaa6f('0x2'));var moment=require(_0xaa6f('0x3'));var BPromise=require(_0xaa6f('0x4'));var rp=require(_0xaa6f('0x5'));var fs=require('fs');var path=require(_0xaa6f('0x6'));var rimraf=require(_0xaa6f('0x7'));var config=require(_0xaa6f('0x8'));var attributes=require(_0xaa6f('0x9'));module[_0xaa6f('0xa')]=function(_0x3ed08f,_0x3f64f5){return _0x3ed08f['define']('CmCustomField',attributes,{'tableName':_0xaa6f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 69c4c26..37d2c64 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 _0x519d=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x3f5ef2,_0x139d90){var _0x5ed69d=function(_0x24f28e){while(--_0x24f28e){_0x3f5ef2['push'](_0x3f5ef2['shift']());}};_0x5ed69d(++_0x139d90);}(_0x519d,0x160));var _0xd519=function(_0x5216d1,_0x3f9ae9){_0x5216d1=_0x5216d1-0x0;var _0x13865a=_0x519d[_0x5216d1];return _0x13865a;};'use strict';var _=require(_0xd519('0x0'));var util=require(_0xd519('0x1'));var moment=require(_0xd519('0x2'));var BPromise=require(_0xd519('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd519('0x4'));var db=require(_0xd519('0x5'))['db'];var utils=require(_0xd519('0x6'));var logger=require(_0xd519('0x7'))('rpc');var config=require(_0xd519('0x8'));var jayson=require(_0xd519('0x9'));var client=jayson[_0xd519('0xa')][_0xd519('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48db7b,_0x849bae,_0x34505e){return new BPromise(function(_0x407e95,_0x3344fc){return client[_0xd519('0xc')](_0x48db7b,_0x34505e)['then'](function(_0x1a224a){logger[_0xd519('0xd')](_0xd519('0xe'),_0x849bae,_0xd519('0xf'));logger[_0xd519('0x10')](_0xd519('0x11'),_0x849bae,_0xd519('0xf'),JSON[_0xd519('0x12')](_0x1a224a));if(_0x1a224a['error']){if(_0x1a224a[_0xd519('0x13')][_0xd519('0x14')]===0x1f4){logger[_0xd519('0x13')]('CmCustomField,\x20%s,\x20%s',_0x849bae,_0x1a224a['error'][_0xd519('0x15')]);return _0x3344fc(_0x1a224a[_0xd519('0x13')][_0xd519('0x15')]);}logger[_0xd519('0x13')](_0xd519('0xe'),_0x849bae,_0x1a224a[_0xd519('0x13')][_0xd519('0x15')]);return _0x407e95(_0x1a224a[_0xd519('0x13')][_0xd519('0x15')]);}else{logger[_0xd519('0xd')](_0xd519('0xe'),_0x849bae,'request\x20sent');_0x407e95(_0x1a224a[_0xd519('0x16')]['message']);}})['catch'](function(_0x43673d){logger[_0xd519('0x13')]('CmCustomField,\x20%s,\x20%s',_0x849bae,_0x43673d);_0x3344fc(_0x43673d);});});} \ No newline at end of file +var _0xc4a7=['CmCustomField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x117026,_0xde804f){var _0x5b70f3=function(_0x16ac91){while(--_0x16ac91){_0x117026['push'](_0x117026['shift']());}};_0x5b70f3(++_0xde804f);}(_0xc4a7,0x163));var _0x7c4a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc4a7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7c4a('0x0'));var util=require(_0x7c4a('0x1'));var moment=require(_0x7c4a('0x2'));var BPromise=require(_0x7c4a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c4a('0x4'));var db=require(_0x7c4a('0x5'))['db'];var utils=require(_0x7c4a('0x6'));var logger=require(_0x7c4a('0x7'))(_0x7c4a('0x8'));var config=require(_0x7c4a('0x9'));var jayson=require(_0x7c4a('0xa'));var client=jayson[_0x7c4a('0xb')][_0x7c4a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31fb00,_0xc6851d,_0x1d9e6c){return new BPromise(function(_0x4696a7,_0x27a14f){return client[_0x7c4a('0xd')](_0x31fb00,_0x1d9e6c)[_0x7c4a('0xe')](function(_0xc66d54){logger['info']('CmCustomField,\x20%s,\x20%s',_0xc6851d,_0x7c4a('0xf'));logger[_0x7c4a('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xc6851d,_0x7c4a('0xf'),JSON[_0x7c4a('0x11')](_0xc66d54));if(_0xc66d54[_0x7c4a('0x12')]){if(_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x13')]===0x1f4){logger[_0x7c4a('0x12')](_0x7c4a('0x14'),_0xc6851d,_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);return _0x27a14f(_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);}logger[_0x7c4a('0x12')]('CmCustomField,\x20%s,\x20%s',_0xc6851d,_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);return _0x4696a7(_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);}else{logger[_0x7c4a('0x16')]('CmCustomField,\x20%s,\x20%s',_0xc6851d,_0x7c4a('0xf'));_0x4696a7(_0xc66d54[_0x7c4a('0x17')][_0x7c4a('0x15')]);}})[_0x7c4a('0x18')](function(_0x48cd52){logger[_0x7c4a('0x12')](_0x7c4a('0x14'),_0xc6851d,_0x48cd52);_0x27a14f(_0x48cd52);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 8a73401..03e3703 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 _0xa566=['update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','post','put','/:id'];(function(_0x59b9da,_0x43c956){var _0x2f9fbf=function(_0x365d71){while(--_0x365d71){_0x59b9da['push'](_0x59b9da['shift']());}};_0x2f9fbf(++_0x43c956);}(_0xa566,0x1c1));var _0x6a56=function(_0xfaaffb,_0x2345d2){_0xfaaffb=_0xfaaffb-0x0;var _0x5a8b3b=_0xa566[_0xfaaffb];return _0x5a8b3b;};'use strict';var multer=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var path=require(_0x6a56('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a56('0x3'));var router=express[_0x6a56('0x4')]();var fs_extra=require(_0x6a56('0x5'));var auth=require(_0x6a56('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a56('0x7'));var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6a56('0x8')]('/:id',auth[_0x6a56('0x9')](),controller['show']);router[_0x6a56('0xa')]('/',auth[_0x6a56('0x9')](),controller['create']);router[_0x6a56('0xb')](_0x6a56('0xc'),auth[_0x6a56('0x9')](),controller[_0x6a56('0xd')]);router['delete'](_0x6a56('0xc'),auth[_0x6a56('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8585=['../../config/environment','./cmCustomField.controller','index','get','/:id','post','isAuthenticated','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x4e538e,_0x2f2a57){var _0x276652=function(_0x5b3a81){while(--_0x5b3a81){_0x4e538e['push'](_0x4e538e['shift']());}};_0x276652(++_0x2f2a57);}(_0x8585,0x64));var _0x5858=function(_0x47d6b2,_0x35b42d){_0x47d6b2=_0x47d6b2-0x0;var _0x395b74=_0x8585[_0x47d6b2];return _0x395b74;};'use strict';var multer=require(_0x5858('0x0'));var util=require(_0x5858('0x1'));var path=require(_0x5858('0x2'));var timeout=require('connect-timeout');var express=require(_0x5858('0x3'));var router=express[_0x5858('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5858('0x5'));var controller=require(_0x5858('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5858('0x7')]);router[_0x5858('0x8')](_0x5858('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5858('0xa')]('/',auth[_0x5858('0xb')](),controller['create']);router['put'](_0x5858('0x9'),auth[_0x5858('0xb')](),controller['update']);router[_0x5858('0xc')](_0x5858('0x9'),auth[_0x5858('0xb')](),controller[_0x5858('0xd')]);module[_0x5858('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 4475127..71e45ca 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 _0xdad6=['BOOLEAN','INTEGER','UNSIGNED','contactListQueue','DATE','moment','sequelize','STRING'];(function(_0x30aaf9,_0x226708){var _0x4337a3=function(_0xebd936){while(--_0xebd936){_0x30aaf9['push'](_0x30aaf9['shift']());}};_0x4337a3(++_0x226708);}(_0xdad6,0x1b5));var _0x6dad=function(_0x55a2bc,_0x4f2e03){_0x55a2bc=_0x55a2bc-0x0;var _0x299ac3=_0xdad6[_0x55a2bc];return _0x299ac3;};'use strict';var moment=require(_0x6dad('0x0'));var Sequelize=require(_0x6dad('0x1'));module['exports']={'phone':{'type':Sequelize[_0x6dad('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x6dad('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6dad('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6dad('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6dad('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6dad('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x6dad('0x4')](0x2)[_0x6dad('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6dad('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6dad('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x6dad('0x4')],'unique':_0x6dad('0x6')},'UserId':{'type':Sequelize[_0x6dad('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x6dad('0x4')],'unique':_0x6dad('0x6')},'CampaignId':{'type':Sequelize[_0x6dad('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6dad('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6dad('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6dad('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6dad('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x0e4c=['INTEGER','STRING','DATE','contactListQueue','moment','sequelize','exports','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x0e4c,0x90));var _0xc0e4=function(_0x25db72,_0x46274d){_0x25db72=_0x25db72-0x0;var _0x108a0f=_0x0e4c[_0x25db72];return _0x108a0f;};'use strict';var moment=require(_0xc0e4('0x0'));var Sequelize=require(_0xc0e4('0x1'));module[_0xc0e4('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xc0e4('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc0e4('0x4')](_0xc0e4('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc0e4('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc0e4('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc0e4('0x8')]},'priority':{'type':Sequelize[_0xc0e4('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc0e4('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc0e4('0x6')],'unique':_0xc0e4('0x9')},'ListId':{'type':Sequelize[_0xc0e4('0x6')],'unique':_0xc0e4('0x9')},'UserId':{'type':Sequelize[_0xc0e4('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xc0e4('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xc0e4('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 73ce992..939518e 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 _0x61a5=['$gte','$lt','$lte','$ne','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contained','$any','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','catch','show','params','fields','include','options','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','hopperIds','ASC','DESC','isEmpty','priority','scheduledAt','literal','findOne','recallme','UPDATE','Contact','Company','List','Queue','getPreviewRecall','transaction','scheduledat','LOCK','CmCompany','CmList','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','count','limit','status','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','CmHopper','fieldName','type','model','map','query','keys','intersection','filters','$and','$or','$gt'];(function(_0x25c3df,_0x27c81d){var _0x2f08ac=function(_0x8a2178){while(--_0x8a2178){_0x25c3df['push'](_0x25c3df['shift']());}};_0x2f08ac(++_0x27c81d);}(_0x61a5,0xf0));var _0x561a=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0x61a5[_0x1f27df];return _0x286ee2;};'use strict';var moment=require(_0x561a('0x0'));var _=require('lodash');var qs=require(_0x561a('0x1'));var logger=require(_0x561a('0x2'))(_0x561a('0x3'));var shared=require(_0x561a('0x4'));var db=require(_0x561a('0x5'))['db'];function respondWithResult(_0x58f636,_0xe92b4d){_0xe92b4d=_0xe92b4d||0xc8;return function(_0x33c0f5){if(_0x33c0f5){return _0x58f636['status'](_0xe92b4d)[_0x561a('0x6')](_0x33c0f5);}};}function respondWithFilteredResult(_0x31f762,_0x24c89a){return function(_0x2646bd){if(_0x2646bd){var _0x3d55f8=typeof _0x24c89a[_0x561a('0x7')]===_0x561a('0x8')&&typeof _0x24c89a['limit']===_0x561a('0x8');var _0x52563e=_0x2646bd[_0x561a('0x9')];var _0x5288b4=_0x3d55f8?0x0:_0x24c89a['offset'];var _0x34e464=_0x3d55f8?_0x2646bd[_0x561a('0x9')]:_0x24c89a['offset']+_0x24c89a[_0x561a('0xa')];var _0x5cc8ed;if(_0x34e464>=_0x52563e){_0x34e464=_0x52563e;_0x5cc8ed=0xc8;}else{_0x5cc8ed=0xce;}_0x31f762[_0x561a('0xb')](_0x5cc8ed);return _0x31f762[_0x561a('0xc')](_0x561a('0xd'),_0x5288b4+'-'+_0x34e464+'/'+_0x52563e)[_0x561a('0x6')](_0x2646bd);}return null;};}function saveUpdates(_0x2777c6,_0x3dfa9f){return function(_0x136465){if(_0x136465){return _0x136465[_0x561a('0xe')](_0x2777c6)[_0x561a('0xf')](function(_0x4f1e33){return _0x4f1e33;});}return null;};}function handleEntityNotFound(_0x2a332e,_0x28638b){return function(_0x5696b9){if(!_0x5696b9){_0x2a332e[_0x561a('0x10')](0x194);}return _0x5696b9;};}function handleError(_0x64498a,_0x1ab5ae){_0x1ab5ae=_0x1ab5ae||0x1f4;return function(_0xecbcc4){logger[_0x561a('0x11')](_0xecbcc4[_0x561a('0x12')]);if(_0xecbcc4[_0x561a('0x13')]){delete _0xecbcc4[_0x561a('0x13')];}_0x64498a[_0x561a('0xb')](_0x1ab5ae)[_0x561a('0x14')](_0xecbcc4);};}exports[_0x561a('0x15')]=function(_0x48df6a,_0x43c5aa){var _0x190057={},_0x533d95={},_0x11033f={'count':0x0,'rows':[]};var _0x785831=_['map'](db[_0x561a('0x16')]['rawAttributes'],function(_0x4d66b8){return{'name':_0x4d66b8[_0x561a('0x17')],'type':_0x4d66b8[_0x561a('0x18')]['key']};});_0x533d95[_0x561a('0x19')]=_[_0x561a('0x1a')](_0x785831,_0x561a('0x13'));_0x533d95[_0x561a('0x1b')]=_[_0x561a('0x1c')](_0x48df6a[_0x561a('0x1b')]);_0x533d95['filters']=_[_0x561a('0x1d')](_0x533d95[_0x561a('0x19')],_0x533d95[_0x561a('0x1b')]);_0x533d95['filters']=_['concat'](_0x533d95[_0x561a('0x1e')],[_0x561a('0x1f'),_0x561a('0x20'),_0x561a('0x21'),_0x561a('0x22'),_0x561a('0x23'),_0x561a('0x24'),_0x561a('0x25'),'$eq','$not',_0x561a('0x26'),_0x561a('0x27'),_0x561a('0x28'),_0x561a('0x29'),'$like',_0x561a('0x2a'),_0x561a('0x2b'),_0x561a('0x2c'),_0x561a('0x2d'),_0x561a('0x2e'),'$contains',_0x561a('0x2f'),_0x561a('0x30')]);_0x190057['attributes']=_[_0x561a('0x1d')](_0x533d95[_0x561a('0x19')],qs['fields'](_0x48df6a[_0x561a('0x1b')]['fields']));_0x190057['attributes']=_0x190057[_0x561a('0x31')][_0x561a('0x32')]?_0x190057['attributes']:_0x533d95[_0x561a('0x19')];if(!_0x48df6a[_0x561a('0x1b')][_0x561a('0x33')](_0x561a('0x34'))){_0x190057[_0x561a('0xa')]=qs[_0x561a('0xa')](_0x48df6a[_0x561a('0x1b')][_0x561a('0xa')]);_0x190057['offset']=qs[_0x561a('0x7')](_0x48df6a[_0x561a('0x1b')][_0x561a('0x7')]);}_0x190057[_0x561a('0x35')]=qs[_0x561a('0x36')](_0x48df6a['query'][_0x561a('0x36')]);_0x190057[_0x561a('0x37')]=qs[_0x561a('0x1e')](_[_0x561a('0x38')](_0x48df6a['query'],_0x533d95[_0x561a('0x1e')]),_0x785831);if(_0x48df6a[_0x561a('0x1b')][_0x561a('0x39')]){_0x190057['where']=_['merge'](_0x190057[_0x561a('0x37')],{'$or':_['map'](_0x785831,function(_0x5a45a4){if(_0x5a45a4['type']!==_0x561a('0x3a')){var _0x2a2479={};_0x2a2479[_0x5a45a4[_0x561a('0x13')]]={'$like':'%'+_0x48df6a[_0x561a('0x1b')][_0x561a('0x39')]+'%'};return _0x2a2479;}})});}_0x190057=_[_0x561a('0x3b')]({},_0x190057,_0x48df6a['options']);var _0x588a39={'where':_0x190057[_0x561a('0x37')]};return db[_0x561a('0x16')][_0x561a('0x9')](_0x588a39)[_0x561a('0xf')](function(_0x4d81f7){_0x11033f[_0x561a('0x9')]=_0x4d81f7;if(_0x48df6a[_0x561a('0x1b')][_0x561a('0x3c')]){_0x190057['include']=[{'all':!![]}];}return db[_0x561a('0x16')][_0x561a('0x3d')](_0x190057);})[_0x561a('0xf')](function(_0x330c8d){_0x11033f['rows']=_0x330c8d;return _0x11033f;})[_0x561a('0xf')](respondWithFilteredResult(_0x43c5aa,_0x190057))[_0x561a('0x3e')](handleError(_0x43c5aa,null));};exports[_0x561a('0x3f')]=function(_0x5c59dc,_0x3ebf2b){var _0x3ae2db={'raw':!![],'where':{'id':_0x5c59dc[_0x561a('0x40')]['id']}},_0x289c68={};_0x289c68[_0x561a('0x19')]=_[_0x561a('0x1c')](db[_0x561a('0x16')]['rawAttributes']);_0x289c68[_0x561a('0x1b')]=_[_0x561a('0x1c')](_0x5c59dc[_0x561a('0x1b')]);_0x289c68[_0x561a('0x1e')]=_[_0x561a('0x1d')](_0x289c68[_0x561a('0x19')],_0x289c68['query']);_0x3ae2db[_0x561a('0x31')]=_[_0x561a('0x1d')](_0x289c68[_0x561a('0x19')],qs[_0x561a('0x41')](_0x5c59dc[_0x561a('0x1b')][_0x561a('0x41')]));_0x3ae2db[_0x561a('0x31')]=_0x3ae2db[_0x561a('0x31')][_0x561a('0x32')]?_0x3ae2db['attributes']:_0x289c68[_0x561a('0x19')];if(_0x5c59dc[_0x561a('0x1b')]['includeAll']){_0x3ae2db[_0x561a('0x42')]=[{'all':!![]}];}_0x3ae2db=_['merge']({},_0x3ae2db,_0x5c59dc[_0x561a('0x43')]);return db[_0x561a('0x16')][_0x561a('0x44')](_0x3ae2db)[_0x561a('0xf')](handleEntityNotFound(_0x3ebf2b,null))[_0x561a('0xf')](respondWithResult(_0x3ebf2b,null))['catch'](handleError(_0x3ebf2b,null));};exports[_0x561a('0x45')]=function(_0x12e7c6,_0x30b94d){return db[_0x561a('0x16')][_0x561a('0x45')](_0x12e7c6[_0x561a('0x46')],{})['then'](respondWithResult(_0x30b94d,0xc9))['catch'](handleError(_0x30b94d,null));};exports[_0x561a('0xe')]=function(_0x5d6f3d,_0x4c4127){if(_0x5d6f3d['body']['id']){delete _0x5d6f3d['body']['id'];}return db['CmHopper'][_0x561a('0x44')]({'where':{'id':_0x5d6f3d[_0x561a('0x40')]['id']}})[_0x561a('0xf')](handleEntityNotFound(_0x4c4127,null))['then'](saveUpdates(_0x5d6f3d[_0x561a('0x46')],null))['then'](respondWithResult(_0x4c4127,null))['catch'](handleError(_0x4c4127,null));};exports[_0x561a('0x47')]=function(_0x13a2ad,_0x19d247){return db['CmHopper'][_0x561a('0x47')]()['then'](respondWithResult(_0x19d247,null))[_0x561a('0x3e')](handleError(_0x19d247,null));};exports['destroy']=function(_0x1bd3df,_0x43d557){var _0x68dc4a;var _0x14d82b=_0x1bd3df[_0x561a('0x40')]['id'];return db[_0x561a('0x16')][_0x561a('0x44')]({'where':{'id':_0x1bd3df[_0x561a('0x40')]['id']}})[_0x561a('0xf')](handleEntityNotFound(_0x43d557,null))['then'](function(_0x1cb7e4){if(_0x1cb7e4){return _0x1cb7e4[_0x561a('0x48')]()[_0x561a('0xf')](function(_0x48ed34){return _0x48ed34;});}})[_0x561a('0xf')](function(_0x4583b1){_0x68dc4a=_0x4583b1;if(_0x4583b1){if(_0x4583b1['VoiceQueueId']||_0x4583b1[_0x561a('0x49')]){return db[_0x4583b1[_0x561a('0x4a')]?_0x561a('0x4b'):'Campaign'][_0x561a('0x44')]({'where':{'id':_0x4583b1[_0x561a('0x4a')]?_0x4583b1[_0x561a('0x4a')]:_0x4583b1[_0x561a('0x49')]},'attributes':['id',_0x561a('0x13')],'raw':!![]});}}})[_0x561a('0xf')](function(_0x3d9b63){var _0x4ebb99={};if(_0x3d9b63){_[_0x561a('0x3b')](_0x4ebb99,_[_0x561a('0x4c')](_0x68dc4a[_0x561a('0x4d')],[_0x561a('0x4e'),_0x561a('0x4f'),'id']));_0x4ebb99[_0x561a('0x50')]=0x15;_0x4ebb99[_0x561a('0x51')]='deleted';_0x4ebb99[_0x561a('0x52')]=_0x3d9b63[_0x561a('0x13')];_0x4ebb99[_0x561a('0x53')]=_0x1bd3df['user'][_0x561a('0x13')];_0x4ebb99['UserId']=_0x1bd3df[_0x561a('0x54')]['id'];_0x4ebb99[_0x561a('0x55')]=!![];_0x4ebb99[_0x561a('0x56')]=moment()[_0x561a('0x57')](_0x561a('0x58'));_0x4ebb99[_0x561a('0x59')]=_0x68dc4a[_0x561a('0x5a')];_0x4ebb99['campaigntype']=_0x68dc4a['VoiceQueueId']?_0x561a('0x5b'):_0x561a('0x5c');return db[_0x561a('0x5d')][_0x561a('0x44')]({'where':{'id':_0x4ebb99[_0x561a('0x5e')]},'attributes':[_0x561a('0x5f'),'lastName']})[_0x561a('0xf')](function(_0x1b0ecf){if(!_['isNil'](_0x43d557)&&!_[_0x561a('0x60')](_0x1b0ecf['firstName'])){_0x4ebb99[_0x561a('0x61')]=_0x1b0ecf[_0x561a('0x5f')];if(!_[_0x561a('0x60')](_0x1b0ecf[_0x561a('0x62')])){_0x4ebb99[_0x561a('0x61')]+='\x20'+_0x1b0ecf['lastName'];}}})[_0x561a('0x63')](function(){return db['CmHopperFinal'][_0x561a('0x45')](_0x4ebb99);});}})[_0x561a('0xf')](function(_0x457d0e){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x14d82b}});})['then'](function(){return _0x43d557['status'](0xcc)[_0x561a('0x64')]();})[_0x561a('0x3e')](handleError(_0x43d557,null));};exports['getPreview']=function(_0xb0f744,_0xe76184){var _0x209f07=[];return db['CmContact'][_0x561a('0x47')]()[_0x561a('0xf')](function(_0x4341a4){_0x209f07=_[_0x561a('0x1c')](_0x4341a4);return _0xb0f744[_0x561a('0x54')][_0x561a('0x65')]({'where':{'type':_0x561a('0x66'),'dialActive':!![],'dialMethod':_0x561a('0x67')},'attributes':['id',_0x561a('0x68'),_0x561a('0x69')],'raw':!![]});})[_0x561a('0xf')](function(_0x5ac279){if(_0x5ac279&&_0x5ac279[_0x561a('0x32')]){return db[_0x561a('0x6a')]['transaction'](function(_0x54056b){var _0x33509a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x561a('0x57')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x561a('0x1a')](_0x5ac279,'id')},'$or':[{'UserId':null},{'UserId':_0xb0f744[_0x561a('0x54')]['id']}]};var _0x174483={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5ac279)[_0x561a('0x39')]([_0x561a('0x69'),0x0])[_0x561a('0x1a')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0xb0f744['user']['id']}]};var _0x518826={'$or':[_0x33509a,_0x174483]};var _0x21234d=[];if(_0xb0f744[_0x561a('0x46')][_0x561a('0x6b')]&&_0xb0f744[_0x561a('0x46')][_0x561a('0x6b')]==='prev'){if(!_['isEmpty'](_0xb0f744['body'][_0x561a('0x6c')])){_0x518826['id']={'$in':_0xb0f744[_0x561a('0x46')][_0x561a('0x6c')]};}_0x21234d=[['priority','ASC'],['scheduledAt',_0x5ac279[0x0]['dialOrderByScheduledAt']===_0x561a('0x6d')?_0x561a('0x6e'):'ASC'],db[_0x561a('0x6a')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x561a('0x6e')]];}else{if(!_[_0x561a('0x6f')](_0xb0f744['body'][_0x561a('0x6c')])){_0x518826['id']={'$notIn':_0xb0f744['body'][_0x561a('0x6c')]};}_0x21234d=[[_0x561a('0x70'),_0x561a('0x6e')],[_0x561a('0x71'),_0x5ac279[0x0][_0x561a('0x68')]],db[_0x561a('0x6a')][_0x561a('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x561a('0x16')][_0x561a('0x73')]({'attributes':['id','scheduledat',_0x561a('0x5a'),_0x561a('0x74')],'where':_0x518826,'order':_0x21234d,'transaction':_0x54056b,'lock':_0x54056b['LOCK'][_0x561a('0x75')],'include':[{'model':db[_0x561a('0x5d')],'as':_0x561a('0x76'),'attributes':_0x209f07,'include':[{'model':db['CmCompany'],'as':_0x561a('0x77'),'attributes':['id',_0x561a('0x13')]}]},{'model':db['CmList'],'as':_0x561a('0x78'),'attributes':['id','name']},{'model':db[_0x561a('0x4b')],'as':_0x561a('0x79'),'attributes':['id',_0x561a('0x13'),'dialActive']}]})[_0x561a('0xf')](function(_0x4e155f){if(_0x4e155f){return _0x4e155f[_0x561a('0xe')]({'UserId':_0xb0f744['user']['id']},{'transaction':_0x54056b});}});});}})[_0x561a('0xf')](handleEntityNotFound(_0xe76184,null))[_0x561a('0xf')](respondWithResult(_0xe76184,null))[_0x561a('0x3e')](handleError(_0xe76184,null));};exports[_0x561a('0x7a')]=function(_0x3e0b55,_0x127301,_0x4dcb3a){var _0x528846=[];var _0x43dd9b=_0x3e0b55[_0x561a('0x40')]['id'];var _0x5153f0=_0x3e0b55[_0x561a('0x54')]['id'];return db[_0x561a('0x5d')][_0x561a('0x47')]()[_0x561a('0xf')](function(_0x26699b){_0x528846=_[_0x561a('0x1c')](_0x26699b);return db[_0x561a('0x6a')][_0x561a('0x7b')](function(_0x127a29){const _0x45df37={'id':_0x43dd9b};return db[_0x561a('0x16')][_0x561a('0x73')]({'attributes':['id',_0x561a('0x7c'),'recallme'],'where':_0x45df37,'transaction':_0x127a29,'lock':_0x127a29[_0x561a('0x7d')][_0x561a('0x75')],'include':[{'model':db[_0x561a('0x5d')],'as':'Contact','attributes':_0x528846,'include':[{'model':db[_0x561a('0x7e')],'as':_0x561a('0x77'),'attributes':['id',_0x561a('0x13')]}]},{'model':db[_0x561a('0x7f')],'as':'List','attributes':['id',_0x561a('0x13')]},{'model':db[_0x561a('0x4b')],'as':_0x561a('0x79'),'attributes':['id',_0x561a('0x13'),_0x561a('0x80')]}]})[_0x561a('0xf')](function(_0x40d801){if(_0x40d801){return _0x40d801['update']({'UserId':_0x5153f0},{'transaction':_0x127a29});}});});})['then'](handleEntityNotFound(_0x127301,null))[_0x561a('0xf')](respondWithResult(_0x127301,null))[_0x561a('0x3e')](handleError(_0x127301,null));};exports['getOpenContacts']=function(_0x5a6e8a,_0x54f78e){return _0x5a6e8a[_0x561a('0x54')][_0x561a('0x65')]({'where':{'type':_0x561a('0x66'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x4ec14a){if(_0x4ec14a&&_0x4ec14a[_0x561a('0x32')]){return db[_0x561a('0x16')][_0x561a('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x561a('0x57')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x561a('0x1a')](_0x4ec14a,'id')},'$or':[{'UserId':null},{'UserId':_0x5a6e8a[_0x561a('0x54')]['id']}]}});}return 0x0;})[_0x561a('0xf')](function(_0x3698c2){if(!_[_0x561a('0x60')](_0x3698c2)&&_['isNumber'](_0x3698c2)){return _0x54f78e['status'](0xc8)[_0x561a('0x6')]({'contacts':_0x3698c2});}else{logger[_0x561a('0x11')](_0x561a('0x81'),_0x561a('0x82'),0x194,_0x561a('0x83'));_0x54f78e[_0x561a('0x10')](0x194);}})['catch'](handleError(_0x54f78e,null));};exports[_0x561a('0x84')]=function(_0x1d3771,_0x168fe8){var _0x443a4a=shared[_0x561a('0x85')];var _0x56ce02=[];_[_0x561a('0x1a')](_0x443a4a,function(_0x81c3e4){_0x56ce02[_0x561a('0x86')]({'id':_0x81c3e4[_0x561a('0x13')],'name':_0x81c3e4[_0x561a('0x13')],'utcOffset':_0x81c3e4[_0x561a('0x87')]});});return _0x168fe8[_0x561a('0xb')](0xc8)[_0x561a('0x6')]({'tz':_0x56ce02});};exports[_0x561a('0x88')]=function(_0x5bdb1c,_0x379e9e){var _0x2d3cb3=shared[_0x561a('0x85')];var _0x2874a0={};if(!_[_0x561a('0x60')](_0x2d3cb3[_0x5bdb1c[_0x561a('0x46')]['id']]))_0x2874a0=_0x2d3cb3[_0x5bdb1c[_0x561a('0x46')]['id']];return _0x379e9e['status'](0xc8)[_0x561a('0x6')](_0x2874a0);}; \ No newline at end of file +var _0x6737=['$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','CmHopper','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','firstName','calleridname','isNil','lastName','finally','CmHopperFinal','end','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','recallme','CmCompany','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','limit','count','offset','set','Content-Range','json','update','then','sendStatus','error','stack','send','rawAttributes','type','key','model','map','name','query','filters','intersection','$and','$or','$gt','$gte','$lt'];(function(_0x23a04d,_0x18c735){var _0x30b21c=function(_0x3ff497){while(--_0x3ff497){_0x23a04d['push'](_0x23a04d['shift']());}};_0x30b21c(++_0x18c735);}(_0x6737,0xe2));var _0x7673=function(_0x30f45e,_0x2d09a4){_0x30f45e=_0x30f45e-0x0;var _0xad0513=_0x6737[_0x30f45e];return _0xad0513;};'use strict';var moment=require('moment');var _=require(_0x7673('0x0'));var qs=require(_0x7673('0x1'));var logger=require('../../config/logger')(_0x7673('0x2'));var shared=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];function respondWithResult(_0x12efff,_0x54002e){_0x54002e=_0x54002e||0xc8;return function(_0x32e6f2){if(_0x32e6f2){return _0x12efff[_0x7673('0x5')](_0x54002e)['json'](_0x32e6f2);}};}function respondWithFilteredResult(_0x2f5edc,_0x15230f){return function(_0x5af802){if(_0x5af802){var _0x4e4b24=typeof _0x15230f['offset']==='undefined'&&typeof _0x15230f[_0x7673('0x6')]==='undefined';var _0x3b3184=_0x5af802[_0x7673('0x7')];var _0x5bfae2=_0x4e4b24?0x0:_0x15230f[_0x7673('0x8')];var _0x331f57=_0x4e4b24?_0x5af802[_0x7673('0x7')]:_0x15230f['offset']+_0x15230f['limit'];var _0x3ca258;if(_0x331f57>=_0x3b3184){_0x331f57=_0x3b3184;_0x3ca258=0xc8;}else{_0x3ca258=0xce;}_0x2f5edc['status'](_0x3ca258);return _0x2f5edc[_0x7673('0x9')](_0x7673('0xa'),_0x5bfae2+'-'+_0x331f57+'/'+_0x3b3184)[_0x7673('0xb')](_0x5af802);}return null;};}function saveUpdates(_0x451c87,_0x41d6bd){return function(_0x119e42){if(_0x119e42){return _0x119e42[_0x7673('0xc')](_0x451c87)[_0x7673('0xd')](function(_0x1da115){return _0x1da115;});}return null;};}function handleEntityNotFound(_0x20a649,_0x5c8626){return function(_0x26f0c4){if(!_0x26f0c4){_0x20a649[_0x7673('0xe')](0x194);}return _0x26f0c4;};}function handleError(_0x408470,_0x2c83d){_0x2c83d=_0x2c83d||0x1f4;return function(_0x224cea){logger[_0x7673('0xf')](_0x224cea[_0x7673('0x10')]);if(_0x224cea['name']){delete _0x224cea['name'];}_0x408470[_0x7673('0x5')](_0x2c83d)[_0x7673('0x11')](_0x224cea);};}exports['index']=function(_0x3afbb3,_0x17699a){var _0x58a821={},_0x33ff7d={},_0x44704d={'count':0x0,'rows':[]};var _0x1015ba=_['map'](db['CmHopper'][_0x7673('0x12')],function(_0x267fa3){return{'name':_0x267fa3['fieldName'],'type':_0x267fa3[_0x7673('0x13')][_0x7673('0x14')]};});_0x33ff7d[_0x7673('0x15')]=_[_0x7673('0x16')](_0x1015ba,_0x7673('0x17'));_0x33ff7d[_0x7673('0x18')]=_['keys'](_0x3afbb3['query']);_0x33ff7d[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],_0x33ff7d[_0x7673('0x18')]);_0x33ff7d[_0x7673('0x19')]=_['concat'](_0x33ff7d[_0x7673('0x19')],[_0x7673('0x1b'),_0x7673('0x1c'),_0x7673('0x1d'),_0x7673('0x1e'),_0x7673('0x1f'),'$lte',_0x7673('0x20'),_0x7673('0x21'),_0x7673('0x22'),_0x7673('0x23'),'$notBetween','$in',_0x7673('0x24'),_0x7673('0x25'),_0x7673('0x26'),_0x7673('0x27'),_0x7673('0x28'),_0x7673('0x25'),_0x7673('0x29'),'$contains','$contained',_0x7673('0x2a')]);_0x58a821[_0x7673('0x2b')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],qs[_0x7673('0x2c')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x2c')]));_0x58a821['attributes']=_0x58a821['attributes'][_0x7673('0x2d')]?_0x58a821[_0x7673('0x2b')]:_0x33ff7d[_0x7673('0x15')];if(!_0x3afbb3[_0x7673('0x18')]['hasOwnProperty'](_0x7673('0x2e'))){_0x58a821['limit']=qs[_0x7673('0x6')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x6')]);_0x58a821[_0x7673('0x8')]=qs[_0x7673('0x8')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x8')]);}_0x58a821[_0x7673('0x2f')]=qs[_0x7673('0x30')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x30')]);_0x58a821[_0x7673('0x31')]=qs[_0x7673('0x19')](_['pick'](_0x3afbb3[_0x7673('0x18')],_0x33ff7d[_0x7673('0x19')]),_0x1015ba);if(_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]){_0x58a821[_0x7673('0x31')]=_[_0x7673('0x33')](_0x58a821[_0x7673('0x31')],{'$or':_['map'](_0x1015ba,function(_0x563e2d){if(_0x563e2d[_0x7673('0x13')]!==_0x7673('0x34')){var _0x2d34cb={};_0x2d34cb[_0x563e2d[_0x7673('0x17')]]={'$like':'%'+_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]+'%'};return _0x2d34cb;}})});}_0x58a821=_[_0x7673('0x33')]({},_0x58a821,_0x3afbb3['options']);var _0x2845f6={'where':_0x58a821[_0x7673('0x31')]};return db['CmHopper'][_0x7673('0x7')](_0x2845f6)[_0x7673('0xd')](function(_0x287eee){_0x44704d[_0x7673('0x7')]=_0x287eee;if(_0x3afbb3['query'][_0x7673('0x35')]){_0x58a821[_0x7673('0x36')]=[{'all':!![]}];}return db['CmHopper'][_0x7673('0x37')](_0x58a821);})[_0x7673('0xd')](function(_0x1be04a){_0x44704d['rows']=_0x1be04a;return _0x44704d;})[_0x7673('0xd')](respondWithFilteredResult(_0x17699a,_0x58a821))[_0x7673('0x38')](handleError(_0x17699a,null));};exports[_0x7673('0x39')]=function(_0x5dfb9a,_0x4c6106){var _0x13ce30={'raw':!![],'where':{'id':_0x5dfb9a['params']['id']}},_0x5efdf6={};_0x5efdf6[_0x7673('0x15')]=_[_0x7673('0x3a')](db['CmHopper'][_0x7673('0x12')]);_0x5efdf6[_0x7673('0x18')]=_[_0x7673('0x3a')](_0x5dfb9a[_0x7673('0x18')]);_0x5efdf6[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x5efdf6['model'],_0x5efdf6[_0x7673('0x18')]);_0x13ce30['attributes']=_[_0x7673('0x1a')](_0x5efdf6['model'],qs[_0x7673('0x2c')](_0x5dfb9a[_0x7673('0x18')]['fields']));_0x13ce30['attributes']=_0x13ce30[_0x7673('0x2b')]['length']?_0x13ce30[_0x7673('0x2b')]:_0x5efdf6[_0x7673('0x15')];if(_0x5dfb9a[_0x7673('0x18')][_0x7673('0x35')]){_0x13ce30[_0x7673('0x36')]=[{'all':!![]}];}_0x13ce30=_['merge']({},_0x13ce30,_0x5dfb9a['options']);return db[_0x7673('0x3b')][_0x7673('0x3c')](_0x13ce30)['then'](handleEntityNotFound(_0x4c6106,null))[_0x7673('0xd')](respondWithResult(_0x4c6106,null))[_0x7673('0x38')](handleError(_0x4c6106,null));};exports[_0x7673('0x3d')]=function(_0x5991d7,_0x1a9017){return db[_0x7673('0x3b')][_0x7673('0x3d')](_0x5991d7[_0x7673('0x3e')],{})[_0x7673('0xd')](respondWithResult(_0x1a9017,0xc9))[_0x7673('0x38')](handleError(_0x1a9017,null));};exports[_0x7673('0xc')]=function(_0x232576,_0x58e17d){if(_0x232576['body']['id']){delete _0x232576[_0x7673('0x3e')]['id'];}return db[_0x7673('0x3b')][_0x7673('0x3c')]({'where':{'id':_0x232576[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x58e17d,null))[_0x7673('0xd')](saveUpdates(_0x232576[_0x7673('0x3e')],null))['then'](respondWithResult(_0x58e17d,null))[_0x7673('0x38')](handleError(_0x58e17d,null));};exports[_0x7673('0x40')]=function(_0x461ac3,_0x2de2e9){return db[_0x7673('0x3b')]['describe']()[_0x7673('0xd')](respondWithResult(_0x2de2e9,null))[_0x7673('0x38')](handleError(_0x2de2e9,null));};exports[_0x7673('0x41')]=function(_0x2397fb,_0x3f76a3){var _0x4c022d;var _0x56cd7a=_0x2397fb[_0x7673('0x3f')]['id'];return db[_0x7673('0x3b')]['find']({'where':{'id':_0x2397fb[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x3f76a3,null))[_0x7673('0xd')](function(_0x32a5e7){if(_0x32a5e7){return _0x32a5e7[_0x7673('0x41')]()['then'](function(_0x23789d){return _0x23789d;});}})[_0x7673('0xd')](function(_0x2a275b){_0x4c022d=_0x2a275b;if(_0x2a275b){if(_0x2a275b[_0x7673('0x42')]||_0x2a275b['CampaignId']){return db[_0x2a275b[_0x7673('0x42')]?_0x7673('0x43'):_0x7673('0x44')][_0x7673('0x3c')]({'where':{'id':_0x2a275b[_0x7673('0x42')]?_0x2a275b[_0x7673('0x42')]:_0x2a275b[_0x7673('0x45')]},'attributes':['id',_0x7673('0x17')],'raw':!![]});}}})[_0x7673('0xd')](function(_0x362409){var _0xcb9e0b={};if(_0x362409){_['merge'](_0xcb9e0b,_[_0x7673('0x46')](_0x4c022d['dataValues'],[_0x7673('0x47'),_0x7673('0x48'),'id']));_0xcb9e0b[_0x7673('0x49')]=0x15;_0xcb9e0b['statedesc']=_0x7673('0x4a');_0xcb9e0b[_0x7673('0x4b')]=_0x362409[_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4c')]=_0x2397fb[_0x7673('0x4d')][_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4e')]=_0x2397fb[_0x7673('0x4d')]['id'];_0xcb9e0b[_0x7673('0x4a')]=!![];_0xcb9e0b[_0x7673('0x4f')]=moment()[_0x7673('0x50')](_0x7673('0x51'));_0xcb9e0b[_0x7673('0x52')]=_0x4c022d[_0x7673('0x53')];_0xcb9e0b['campaigntype']=_0x4c022d[_0x7673('0x42')]?'queue':_0x7673('0x54');return db[_0x7673('0x55')][_0x7673('0x3c')]({'where':{'id':_0xcb9e0b['ContactId']},'attributes':[_0x7673('0x56'),'lastName']})['then'](function(_0x1804a4){if(!_['isNil'](_0x3f76a3)&&!_['isNil'](_0x1804a4[_0x7673('0x56')])){_0xcb9e0b[_0x7673('0x57')]=_0x1804a4[_0x7673('0x56')];if(!_[_0x7673('0x58')](_0x1804a4[_0x7673('0x59')])){_0xcb9e0b[_0x7673('0x57')]+='\x20'+_0x1804a4[_0x7673('0x59')];}}})[_0x7673('0x5a')](function(){return db[_0x7673('0x5b')][_0x7673('0x3d')](_0xcb9e0b);});}})[_0x7673('0xd')](function(_0x5e1985){return db['CmHopperAdditionalPhone'][_0x7673('0x41')]({'where':{'CmHopperId':_0x56cd7a}});})[_0x7673('0xd')](function(){return _0x3f76a3[_0x7673('0x5')](0xcc)[_0x7673('0x5c')]();})[_0x7673('0x38')](handleError(_0x3f76a3,null));};exports['getPreview']=function(_0x5caca9,_0x44fa26){var _0x7ac2d=[];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x47b5b3){_0x7ac2d=_[_0x7673('0x3a')](_0x47b5b3);return _0x5caca9[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0x7673('0x5f')],'raw':!![]});})[_0x7673('0xd')](function(_0x31be3a){if(_0x31be3a&&_0x31be3a['length']){return db[_0x7673('0x60')][_0x7673('0x61')](function(_0x562a20){var _0x53c638={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x31be3a,'id')},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x40776d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31be3a)['filter']([_0x7673('0x5f'),0x0])['map']('id')[_0x7673('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x12cfe7={'$or':[_0x53c638,_0x40776d]};var _0x2a8feb=[];if(_0x5caca9['body'][_0x7673('0x63')]&&_0x5caca9[_0x7673('0x3e')][_0x7673('0x63')]==='prev'){if(!_['isEmpty'](_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')])){_0x12cfe7['id']={'$in':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'ASC'],[_0x7673('0x66'),_0x31be3a[0x0][_0x7673('0x67')]==='ASC'?'DESC':'ASC'],db[_0x7673('0x60')][_0x7673('0x68')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7673('0x69')]];}else{if(!_['isEmpty'](_0x5caca9['body'][_0x7673('0x64')])){_0x12cfe7['id']={'$notIn':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'DESC'],[_0x7673('0x66'),_0x31be3a[0x0]['dialOrderByScheduledAt']],db[_0x7673('0x60')][_0x7673('0x68')](_0x7673('0x6a')),['id',_0x7673('0x6b')]];}return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),'phone','recallme'],'where':_0x12cfe7,'order':_0x2a8feb,'transaction':_0x562a20,'lock':_0x562a20[_0x7673('0x6e')][_0x7673('0x6f')],'include':[{'model':db[_0x7673('0x55')],'as':_0x7673('0x70'),'attributes':_0x7ac2d,'include':[{'model':db['CmCompany'],'as':_0x7673('0x71'),'attributes':['id',_0x7673('0x17')]}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id',_0x7673('0x17'),_0x7673('0x75')]}]})['then'](function(_0x376f42){if(_0x376f42){return _0x376f42[_0x7673('0xc')]({'UserId':_0x5caca9[_0x7673('0x4d')]['id']},{'transaction':_0x562a20});}});});}})[_0x7673('0xd')](handleEntityNotFound(_0x44fa26,null))[_0x7673('0xd')](respondWithResult(_0x44fa26,null))[_0x7673('0x38')](handleError(_0x44fa26,null));};exports['getPreviewRecall']=function(_0xc74a16,_0x36a751,_0xc6660d){var _0x413d2a=[];var _0x1a32e3=_0xc74a16[_0x7673('0x3f')]['id'];var _0x533e5b=_0xc74a16[_0x7673('0x4d')]['id'];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x52de39){_0x413d2a=_[_0x7673('0x3a')](_0x52de39);return db[_0x7673('0x60')][_0x7673('0x61')](function(_0xc4e03e){const _0xfed5e5={'id':_0x1a32e3};return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),_0x7673('0x76')],'where':_0xfed5e5,'transaction':_0xc4e03e,'lock':_0xc4e03e[_0x7673('0x6e')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x7673('0x70'),'attributes':_0x413d2a,'include':[{'model':db[_0x7673('0x77')],'as':_0x7673('0x71'),'attributes':['id','name']}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id','name',_0x7673('0x75')]}]})[_0x7673('0xd')](function(_0x4c7b28){if(_0x4c7b28){return _0x4c7b28['update']({'UserId':_0x533e5b},{'transaction':_0xc4e03e});}});});})[_0x7673('0xd')](handleEntityNotFound(_0x36a751,null))[_0x7673('0xd')](respondWithResult(_0x36a751,null))['catch'](handleError(_0x36a751,null));};exports['getOpenContacts']=function(_0x384aac,_0x595493){return _0x384aac[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':_0x7673('0x78'),'dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id'],'raw':!![]})[_0x7673('0xd')](function(_0x3c82d3){if(_0x3c82d3&&_0x3c82d3[_0x7673('0x2d')]){return db[_0x7673('0x3b')][_0x7673('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x3c82d3,'id')},'$or':[{'UserId':null},{'UserId':_0x384aac[_0x7673('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x1cc5c2){if(!_[_0x7673('0x58')](_0x1cc5c2)&&_[_0x7673('0x79')](_0x1cc5c2)){return _0x595493[_0x7673('0x5')](0xc8)[_0x7673('0xb')]({'contacts':_0x1cc5c2});}else{logger[_0x7673('0xf')](_0x7673('0x7a'),'getOpenContacts',0x194,_0x7673('0x7b'));_0x595493['sendStatus'](0x194);}})[_0x7673('0x38')](handleError(_0x595493,null));};exports[_0x7673('0x7c')]=function(_0x1c61f9,_0x3a7767){var _0x4ed050=shared[_0x7673('0x7d')];var _0x31e97c=[];_[_0x7673('0x16')](_0x4ed050,function(_0x541a8a){_0x31e97c[_0x7673('0x7e')]({'id':_0x541a8a[_0x7673('0x17')],'name':_0x541a8a[_0x7673('0x17')],'utcOffset':_0x541a8a[_0x7673('0x7f')]});});return _0x3a7767['status'](0xc8)[_0x7673('0xb')]({'tz':_0x31e97c});};exports[_0x7673('0x80')]=function(_0x493c4d,_0x2d3583){var _0x332c63=shared['timezones'];var _0x3ba1aa={};if(!_['isNil'](_0x332c63[_0x493c4d[_0x7673('0x3e')]['id']]))_0x3ba1aa=_0x332c63[_0x493c4d['body']['id']];return _0x2d3583[_0x7673('0x5')](0xc8)[_0x7673('0xb')](_0x3ba1aa);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index c8ab785..1793636 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 _0x2eb2=['request-promise','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x351c1f,_0xa4bf1b){var _0x13cc76=function(_0x120a7b){while(--_0x120a7b){_0x351c1f['push'](_0x351c1f['shift']());}};_0x13cc76(++_0xa4bf1b);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x2eb2[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[{'name':_0x22eb('0xb'),'fields':[_0x22eb('0xb')]},{'name':_0x22eb('0xc'),'fields':[_0x22eb('0xc')]},{'name':_0x22eb('0xd'),'fields':[_0x22eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x54f64b,_0x30ef9f){var _0x25523c=function(_0x20b211){while(--_0x20b211){_0x54f64b['push'](_0x54f64b['shift']());}};_0x25523c(++_0x30ef9f);}(_0xafc4,0x69));var _0x4afc=function(_0x5db096,_0x3c6406){_0x5db096=_0x5db096-0x0;var _0x4c5d3d=_0xafc4[_0x5db096];return _0x4c5d3d;};'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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index ad5add0..9fb75fc 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 _0x5d9d=['CmContact','sequelize','transaction','order','UPDATE','keys','Agent','name','length','UserId','push','includes','all','ContactId','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','describe','LOCK','GetContactRecallMe','GetContactByPhone','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','Contact','User','List','NOW()','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','limit','include','model','attributes','map','then','info','catch','message','ShowCmHopper','find','where','debug','error','CreateCmHopper','create','body','stringify','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer'];(function(_0x8264e6,_0x38d9e9){var _0x5de77a=function(_0x1e9778){while(--_0x1e9778){_0x8264e6['push'](_0x8264e6['shift']());}};_0x5de77a(++_0x38d9e9);}(_0x5d9d,0xcc));var _0xd5d9=function(_0x5e1f84,_0x133b7c){_0x5e1f84=_0x5e1f84-0x0;var _0x6ee3b1=_0x5d9d[_0x5e1f84];return _0x6ee3b1;};'use strict';var _=require('lodash');var util=require(_0xd5d9('0x0'));var moment=require(_0xd5d9('0x1'));var BPromise=require(_0xd5d9('0x2'));var db=require(_0xd5d9('0x3'))['db'];var logger=require(_0xd5d9('0x4'))(_0xd5d9('0x5'));exports[_0xd5d9('0x6')]=function(_0x531d00){var _0x5ea025=this;return new Promise(function(_0x38f0e1,_0x5d7519){return db[_0xd5d9('0x7')][_0xd5d9('0x8')]({'raw':_0x531d00[_0xd5d9('0x9')]?_0x531d00[_0xd5d9('0x9')][_0xd5d9('0xa')]===undefined?!![]:![]:!![],'where':_0x531d00[_0xd5d9('0x9')]?_0x531d00[_0xd5d9('0x9')]['where']||null:null,'attributes':_0x531d00[_0xd5d9('0x9')]?_0x531d00[_0xd5d9('0x9')]['attributes']||null:null,'limit':_0x531d00['options']?_0x531d00['options'][_0xd5d9('0xb')]||null:null,'include':_0x531d00['options']?_0x531d00[_0xd5d9('0x9')][_0xd5d9('0xc')]?_['map'](_0x531d00[_0xd5d9('0x9')][_0xd5d9('0xc')],function(_0x2b1711){return{'model':db[_0x2b1711[_0xd5d9('0xd')]],'as':_0x2b1711['as'],'attributes':_0x2b1711[_0xd5d9('0xe')],'include':_0x2b1711[_0xd5d9('0xc')]?_[_0xd5d9('0xf')](_0x2b1711['include'],function(_0x367d56){return{'model':db[_0x367d56[_0xd5d9('0xd')]],'as':_0x367d56['as'],'attributes':_0x367d56[_0xd5d9('0xe')],'include':_0x367d56['include']?_[_0xd5d9('0xf')](_0x367d56[_0xd5d9('0xc')],function(_0x17729e){return{'model':db[_0x17729e[_0xd5d9('0xd')]],'as':_0x17729e['as'],'attributes':_0x17729e[_0xd5d9('0xe')]};}):[]};}):[]};}):[]:[]})[_0xd5d9('0x10')](function(_0x105da3){logger[_0xd5d9('0x11')](_0xd5d9('0x6'),_0x531d00);logger['debug'](_0xd5d9('0x6'),_0x531d00,JSON['stringify'](_0x105da3));_0x38f0e1(_0x105da3);})[_0xd5d9('0x12')](function(_0x3c81cc){logger['error'](_0xd5d9('0x6'),_0x3c81cc[_0xd5d9('0x13')],_0x531d00);_0x5d7519(_0x5ea025['error'](0x1f4,_0x3c81cc[_0xd5d9('0x13')]));});});};exports[_0xd5d9('0x14')]=function(_0x5c6198){var _0xaf3c58=this;return new Promise(function(_0x45aa52,_0x38bb53){return db[_0xd5d9('0x7')][_0xd5d9('0x15')]({'raw':_0x5c6198[_0xd5d9('0x9')]?_0x5c6198[_0xd5d9('0x9')][_0xd5d9('0xa')]===undefined?!![]:![]:!![],'where':_0x5c6198[_0xd5d9('0x9')]?_0x5c6198['options'][_0xd5d9('0x16')]||null:null,'attributes':_0x5c6198['options']?_0x5c6198[_0xd5d9('0x9')]['attributes']||null:null,'include':_0x5c6198[_0xd5d9('0x9')]?_0x5c6198[_0xd5d9('0x9')][_0xd5d9('0xc')]?_[_0xd5d9('0xf')](_0x5c6198[_0xd5d9('0x9')][_0xd5d9('0xc')],function(_0x158695){return{'model':db[_0x158695[_0xd5d9('0xd')]],'as':_0x158695['as'],'attributes':_0x158695[_0xd5d9('0xe')],'include':_0x158695[_0xd5d9('0xc')]?_['map'](_0x158695[_0xd5d9('0xc')],function(_0x1cb74d){return{'model':db[_0x1cb74d['model']],'as':_0x1cb74d['as'],'attributes':_0x1cb74d[_0xd5d9('0xe')],'include':_0x1cb74d['include']?_[_0xd5d9('0xf')](_0x1cb74d[_0xd5d9('0xc')],function(_0x4bd309){return{'model':db[_0x4bd309[_0xd5d9('0xd')]],'as':_0x4bd309['as'],'attributes':_0x4bd309['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x26a784){logger[_0xd5d9('0x11')](_0xd5d9('0x14'),_0x5c6198);logger[_0xd5d9('0x17')]('ShowCmHopper',_0x5c6198,JSON['stringify'](_0x26a784));_0x45aa52(_0x26a784);})[_0xd5d9('0x12')](function(_0x1bd853){logger[_0xd5d9('0x18')](_0xd5d9('0x14'),_0x1bd853[_0xd5d9('0x13')],_0x5c6198);_0x38bb53(_0xaf3c58[_0xd5d9('0x18')](0x1f4,_0x1bd853[_0xd5d9('0x13')]));});});};exports[_0xd5d9('0x19')]=function(_0x57979b){var _0x55b8e9=this;return new Promise(function(_0x546b66,_0x28f526){return db[_0xd5d9('0x7')][_0xd5d9('0x1a')](_0x57979b[_0xd5d9('0x1b')],{'raw':_0x57979b[_0xd5d9('0x9')]?_0x57979b[_0xd5d9('0x9')]['raw']===undefined?!![]:![]:!![]})[_0xd5d9('0x10')](function(_0x1a2094){logger[_0xd5d9('0x11')](_0xd5d9('0x19'),_0x57979b);logger['debug'](_0xd5d9('0x19'),_0x57979b,JSON[_0xd5d9('0x1c')](_0x1a2094));_0x546b66(_0x1a2094);})['catch'](function(_0xabe3c5){logger[_0xd5d9('0x18')](_0xd5d9('0x19'),_0xabe3c5['message'],_0x57979b);_0x28f526(_0x55b8e9[_0xd5d9('0x18')](0x1f4,_0xabe3c5['message']));});});};exports['UpdateCmHopper']=function(_0x3f10e7){var _0x4483d2=this;return new Promise(function(_0x39eac2,_0x55793d){return db['CmHopper'][_0xd5d9('0x1d')](_0x3f10e7[_0xd5d9('0x1b')],{'raw':_0x3f10e7[_0xd5d9('0x9')]?_0x3f10e7[_0xd5d9('0x9')][_0xd5d9('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f10e7[_0xd5d9('0x9')]?_0x3f10e7['options'][_0xd5d9('0x16')]||null:null,'attributes':_0x3f10e7['options']?_0x3f10e7[_0xd5d9('0x9')]['attributes']||null:null,'limit':_0x3f10e7[_0xd5d9('0x9')]?_0x3f10e7[_0xd5d9('0x9')][_0xd5d9('0xb')]||null:null})[_0xd5d9('0x10')](function(_0x1a882d){logger[_0xd5d9('0x11')](_0xd5d9('0x1e'),_0x3f10e7);logger['info'](_0xd5d9('0x1f'),JSON['stringify'](_0x3f10e7[_0xd5d9('0x9')][_0xd5d9('0x16')]),_0x3f10e7['body'][_0xd5d9('0x20')]);logger[_0xd5d9('0x17')](_0xd5d9('0x1e'),_0x3f10e7,JSON[_0xd5d9('0x1c')](_0x1a882d));_0x39eac2(_0x1a882d);})['catch'](function(_0x1e6330){logger[_0xd5d9('0x18')](_0xd5d9('0x1e'),_0x1e6330[_0xd5d9('0x13')],_0x3f10e7);_0x55793d(_0x4483d2[_0xd5d9('0x18')](0x1f4,_0x1e6330[_0xd5d9('0x13')]));});});};exports[_0xd5d9('0x21')]=function(_0x34ec81){var _0x1e1323=this;return new Promise(function(_0x531fdb,_0x32d784){return db[_0xd5d9('0x7')][_0xd5d9('0x22')]({'where':_0x34ec81['options']?_0x34ec81['options'][_0xd5d9('0x16')]||null:null})[_0xd5d9('0x10')](function(_0x49e5ee){logger[_0xd5d9('0x11')](_0xd5d9('0x21'),_0x34ec81);logger['debug'](_0xd5d9('0x21'),_0x34ec81,JSON[_0xd5d9('0x1c')](_0x49e5ee));_0x531fdb(_0x49e5ee);})[_0xd5d9('0x12')](function(_0x12a6b3){logger[_0xd5d9('0x18')](_0xd5d9('0x21'),_0x12a6b3[_0xd5d9('0x13')],_0x34ec81);_0x32d784(_0x1e1323[_0xd5d9('0x18')](0x1f4,_0x12a6b3['message']));});});};exports[_0xd5d9('0x23')]=function(_0xd56e5){var _0x532224=this;return new Promise(function(_0x5923f6,_0x34bcb9){return db[_0xd5d9('0x24')]['describe']()['then'](function(_0x6cfdaa){return db[_0xd5d9('0x25')][_0xd5d9('0x26')](function(_0x423efd){return db[_0xd5d9('0x7')]['findAll']({'where':_0xd56e5[_0xd5d9('0x9')]?_0xd56e5[_0xd5d9('0x9')][_0xd5d9('0x16')]||null:null,'attributes':_0xd56e5[_0xd5d9('0x9')]?_0xd56e5[_0xd5d9('0x9')]['attributes']||null:null,'limit':_0xd56e5[_0xd5d9('0x9')]?_0xd56e5[_0xd5d9('0x9')][_0xd5d9('0xb')]||null:null,'order':_0xd56e5[_0xd5d9('0x9')]?_0xd56e5[_0xd5d9('0x9')][_0xd5d9('0x27')]||null:null,'transaction':_0x423efd,'lock':_0x423efd['LOCK'][_0xd5d9('0x28')],'include':[{'model':db[_0xd5d9('0x24')],'as':'Contact','attributes':_[_0xd5d9('0x29')](_0x6cfdaa)},{'model':db['User'],'as':_0xd5d9('0x2a'),'attributes':['id',_0xd5d9('0x2b'),'voicePause']}]})[_0xd5d9('0x10')](function(_0x48067f){var _0xb8d0dd=[];var _0x275716=[];for(var _0x358764=0x0;_0x358764<_0x48067f[_0xd5d9('0x2c')];_0x358764+=0x1){var _0xa6e3e5=_0x48067f[_0x358764][_0xd5d9('0x2d')];if(_0xa6e3e5===null){_0xb8d0dd[_0xd5d9('0x2e')](_0x48067f[_0x358764][_0xd5d9('0x1d')](_0xd56e5['body'],{'transaction':_0x423efd}));}else if(!_0x275716[_0xd5d9('0x2f')](_0xa6e3e5)){_0x275716['push'](_0xa6e3e5);_0xb8d0dd[_0xd5d9('0x2e')](_0x48067f[_0x358764][_0xd5d9('0x1d')](_0xd56e5[_0xd5d9('0x1b')],{'transaction':_0x423efd}));}}return BPromise[_0xd5d9('0x30')](_0xb8d0dd);});})[_0xd5d9('0x10')](function(_0x1726a2){logger[_0xd5d9('0x11')](_0xd5d9('0x23'),_0xd56e5);if(_0x1726a2[_0xd5d9('0x2c')]>0x0){logger[_0xd5d9('0x11')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x1726a2[0x0]['dataValues']['id'],_0x1726a2[0x0]['dataValues'][_0xd5d9('0x31')],_0x1726a2[0x0][_0xd5d9('0x32')]['active']);}logger[_0xd5d9('0x17')]('GetContactDialer',_0xd56e5,JSON['stringify'](_0x1726a2));_0x5923f6(_0x1726a2);})[_0xd5d9('0x12')](function(_0x230e8d){logger['error'](_0xd5d9('0x23'),_0x230e8d[_0xd5d9('0x13')],_0xd56e5);_0x34bcb9(_0x532224[_0xd5d9('0x18')](0x1f4,_0x230e8d[_0xd5d9('0x13')]));});});});};exports[_0xd5d9('0x33')]=function(_0x503121){var _0x7e0bc9=this;return new Promise(function(_0x1e3647,_0x3c2123){return db[_0xd5d9('0x25')][_0xd5d9('0x26')](function(_0x2078e9){return db[_0xd5d9('0x34')]['create'](_0x503121[_0xd5d9('0x1b')],{'raw':_0x503121[_0xd5d9('0x9')]?_0x503121[_0xd5d9('0x9')][_0xd5d9('0xa')]===undefined?!![]:![]:!![],'transaction':_0x2078e9})[_0xd5d9('0x10')](function(){logger[_0xd5d9('0x11')](_0xd5d9('0x35'),JSON[_0xd5d9('0x1c')](_0x503121[_0xd5d9('0x9')]['where']),_0x503121[_0xd5d9('0x9')][_0xd5d9('0x16')][_0xd5d9('0x20')]);return db[_0xd5d9('0x7')][_0xd5d9('0x22')]({'where':_0x503121[_0xd5d9('0x9')]?_0x503121[_0xd5d9('0x9')][_0xd5d9('0x16')]||null:null,'transaction':_0x2078e9});});})[_0xd5d9('0x10')](function(_0x316cb0){logger[_0xd5d9('0x11')](_0xd5d9('0x33'),_0x503121);logger[_0xd5d9('0x17')](_0xd5d9('0x33'),_0x503121,JSON[_0xd5d9('0x1c')](_0x316cb0));_0x1e3647(_0x316cb0);})[_0xd5d9('0x12')](function(_0x37d099){logger[_0xd5d9('0x18')]('MoveContactManagedDialer',_0x37d099[_0xd5d9('0x13')],_0x503121);_0x3c2123(_0x7e0bc9[_0xd5d9('0x18')](0x1f4,_0x37d099[_0xd5d9('0x13')]));});});};exports[_0xd5d9('0x36')]=function(_0x27358f){var _0x1cd55e=this;return new Promise(function(_0x45fe60,_0x183110){return db[_0xd5d9('0x7')][_0xd5d9('0x8')]({'raw':_0x27358f[_0xd5d9('0x9')]?_0x27358f[_0xd5d9('0x9')][_0xd5d9('0xa')]===undefined?!![]:![]:!![],'where':_0x27358f[_0xd5d9('0x9')]?_0x27358f['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xd5d9('0x37'),db[_0xd5d9('0x25')]['fn']('IF',db[_0xd5d9('0x25')][_0xd5d9('0x38')](_0xd5d9('0x39')+util[_0xd5d9('0x3a')](_0xd5d9('0x3b'),moment()[_0xd5d9('0x3a')](_0xd5d9('0x3c')))+_0xd5d9('0x3d')))),'contactsRescheduled']]})[_0xd5d9('0x10')](function(_0x10ba29){logger['info']('CountReScheduled',_0x27358f);logger[_0xd5d9('0x17')](_0xd5d9('0x36'),_0x27358f,JSON[_0xd5d9('0x1c')](_0x10ba29));_0x45fe60(_0x10ba29);})[_0xd5d9('0x12')](function(_0x2231c3){logger[_0xd5d9('0x18')](_0xd5d9('0x36'),_0x2231c3[_0xd5d9('0x13')],_0x27358f);_0x183110(_0x1cd55e[_0xd5d9('0x18')](0x1f4,_0x2231c3[_0xd5d9('0x13')]));});});};exports['GetContactRecallMe']=function(_0x372f36){var _0x16dab5=this;return new Promise(function(_0x5d4149,_0x1bdbd8){return db[_0xd5d9('0x24')][_0xd5d9('0x3e')]()[_0xd5d9('0x10')](function(){return db['sequelize'][_0xd5d9('0x26')](function(_0x28a0e5){return db[_0xd5d9('0x7')][_0xd5d9('0x8')]({'where':_0x372f36[_0xd5d9('0x9')]?_0x372f36[_0xd5d9('0x9')][_0xd5d9('0x16')]||null:null,'attributes':_0x372f36['options']?_0x372f36[_0xd5d9('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x372f36[_0xd5d9('0x9')]?_0x372f36[_0xd5d9('0x9')][_0xd5d9('0x27')]||null:null,'group':db[_0xd5d9('0x7')][_0xd5d9('0x2d')],'transaction':_0x28a0e5,'lock':_0x28a0e5[_0xd5d9('0x3f')][_0xd5d9('0x28')],'include':_0x372f36['options']?_0x372f36[_0xd5d9('0x9')]['include']?_[_0xd5d9('0xf')](_0x372f36[_0xd5d9('0x9')][_0xd5d9('0xc')],function(_0x384f0e){return{'model':db[_0x384f0e[_0xd5d9('0xd')]],'as':_0x384f0e['as'],'attributes':_0x384f0e[_0xd5d9('0xe')],'include':_0x384f0e[_0xd5d9('0xc')]?_[_0xd5d9('0xf')](_0x384f0e[_0xd5d9('0xc')],function(_0x1d5fd2){return{'model':db[_0x1d5fd2[_0xd5d9('0xd')]],'as':_0x1d5fd2['as'],'attributes':_0x1d5fd2['attributes'],'include':_0x1d5fd2[_0xd5d9('0xc')]?_[_0xd5d9('0xf')](_0x1d5fd2[_0xd5d9('0xc')],function(_0x120b5b){return{'model':db[_0x120b5b[_0xd5d9('0xd')]],'as':_0x120b5b['as'],'attributes':_0x120b5b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x36a783){var _0x16ac08=[];for(var _0x24dc71=0x0;_0x24dc71<_0x36a783[_0xd5d9('0x2c')];_0x24dc71+=0x1){_0x16ac08[_0xd5d9('0x2e')](_0x36a783[_0x24dc71][_0xd5d9('0x1d')](_0x372f36[_0xd5d9('0x1b')],{'transaction':_0x28a0e5}));}return BPromise[_0xd5d9('0x30')](_0x16ac08);});})[_0xd5d9('0x10')](function(_0x246af8){logger[_0xd5d9('0x11')](_0xd5d9('0x40'),_0x372f36);logger['debug'](_0xd5d9('0x40'),_0x372f36,JSON[_0xd5d9('0x1c')](_0x246af8));_0x5d4149(_0x246af8);})[_0xd5d9('0x12')](function(_0x50f12d){logger[_0xd5d9('0x18')](_0xd5d9('0x40'),_0x50f12d[_0xd5d9('0x13')],_0x372f36);_0x1bdbd8(_0x16dab5[_0xd5d9('0x18')](0x1f4,_0x50f12d[_0xd5d9('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x960817){var _0x1f968d=this;return new Promise(function(_0x25bf44,_0x46596c){db['CmContact'][_0xd5d9('0x3e')]()[_0xd5d9('0x10')](function(_0x37d851){return db[_0xd5d9('0x7')][_0xd5d9('0x8')]({'raw':_0x960817[_0xd5d9('0x9')]?_0x960817[_0xd5d9('0x9')][_0xd5d9('0xa')]===undefined?!![]:![]:!![],'where':_0x960817['options']?_0x960817[_0xd5d9('0x9')][_0xd5d9('0x16')]||null:null,'attributes':_0x960817[_0xd5d9('0x9')]?_0x960817['options'][_0xd5d9('0xe')]||null:null,'limit':_0x960817['options']?_0x960817[_0xd5d9('0x9')]['limit']||null:null,'include':_0x960817[_0xd5d9('0x9')]?_0x960817['options'][_0xd5d9('0xc')]?_['map'](_0x960817['options'][_0xd5d9('0xc')],function(_0x22cc1c){return{'model':db[_0x22cc1c[_0xd5d9('0xd')]],'as':_0x22cc1c['as'],'attributes':_0x22cc1c['as']==='Contact'?_[_0xd5d9('0x29')](_0x37d851):_0x22cc1c[_0xd5d9('0xe')],'include':_0x22cc1c[_0xd5d9('0xc')]?_[_0xd5d9('0xf')](_0x22cc1c[_0xd5d9('0xc')],function(_0x5ecca3){return{'model':db[_0x5ecca3[_0xd5d9('0xd')]],'as':_0x5ecca3['as'],'attributes':_0x5ecca3[_0xd5d9('0xe')],'include':_0x5ecca3['include']?_['map'](_0x5ecca3[_0xd5d9('0xc')],function(_0x3a7d69){return{'model':db[_0x3a7d69[_0xd5d9('0xd')]],'as':_0x3a7d69['as'],'attributes':_0x3a7d69[_0xd5d9('0xe')]};}):[]};}):[]};}):[]:[]})[_0xd5d9('0x10')](function(_0x32d43b){logger[_0xd5d9('0x11')](_0xd5d9('0x6'),_0x960817);logger[_0xd5d9('0x17')](_0xd5d9('0x6'),_0x960817,JSON['stringify'](_0x32d43b));_0x25bf44(_0x32d43b);})[_0xd5d9('0x12')](function(_0x3e6b30){logger[_0xd5d9('0x18')]('GetCmHopper',_0x3e6b30['message'],_0x960817);_0x46596c(_0x1f968d[_0xd5d9('0x18')](0x1f4,_0x3e6b30[_0xd5d9('0x13')]));});});});};exports[_0xd5d9('0x41')]=function(_0x28be15){var _0x89540b=this;return new Promise(function(_0x5a360a,_0x101edc){return db[_0xd5d9('0x24')]['findOne']({'raw':!![],'where':{'phone':_0x28be15[_0xd5d9('0x9')][_0xd5d9('0x16')][_0xd5d9('0x42')]},'attributes':['id','dialTimezone'],'order':[['id',_0xd5d9('0x43')]]})[_0xd5d9('0x10')](function(_0x3060ab){logger[_0xd5d9('0x11')](_0xd5d9('0x44'),_0x28be15);logger[_0xd5d9('0x17')]('getContactByPhone',_0x28be15,JSON[_0xd5d9('0x1c')](_0x3060ab));_0x5a360a(_0x3060ab);})[_0xd5d9('0x12')](function(_0x4e0e52){logger[_0xd5d9('0x18')](_0xd5d9('0x44'),_0x4e0e52[_0xd5d9('0x13')],_0x28be15);_0x101edc(_0x89540b['error'](0x1f4,_0x4e0e52[_0xd5d9('0x13')]));});});};exports[_0xd5d9('0x45')]=function(_0x1dff80){var _0xa68aae=this;return new Promise(function(_0x4c4f6d,_0xda10dc){return db[_0xd5d9('0x25')][_0xd5d9('0x26')](function(_0x3a3d89){var _0x32fd47=_0x1dff80[_0xd5d9('0x9')]&&_0x1dff80[_0xd5d9('0x9')][_0xd5d9('0x16')]?_0x1dff80[_0xd5d9('0x9')][_0xd5d9('0x16')]:{};return db[_0xd5d9('0x7')][_0xd5d9('0x1d')](_0x1dff80[_0xd5d9('0x1b')],{'where':_0x32fd47,'transaction':_0x3a3d89})[_0xd5d9('0x10')](function(_0x5198fd){logger[_0xd5d9('0x11')](_0xd5d9('0x45'),_0x1dff80);logger[_0xd5d9('0x17')](_0xd5d9('0x45'),_0x1dff80,JSON[_0xd5d9('0x1c')](_0x5198fd));_0x4c4f6d(_0x5198fd);})[_0xd5d9('0x12')](function(_0x4c2a30){logger[_0xd5d9('0x18')]('ResetActiveCalls',_0x4c2a30['message'],_0x1dff80);_0xda10dc(_0xa68aae[_0xd5d9('0x18')](0x1f4,_0x4c2a30[_0xd5d9('0x13')]));});});});};exports[_0xd5d9('0x46')]=function(_0x545dfa){var _0x11ddcf=this;var _0x3fd09c=_0x545dfa[_0xd5d9('0x1b')][_0xd5d9('0x16')][_0xd5d9('0x47')];var _0x397e1d=_0x545dfa[_0xd5d9('0x1b')][_0xd5d9('0x16')][_0xd5d9('0x48')];var _0x21d197=_0x545dfa[_0xd5d9('0x1b')][_0xd5d9('0x16')][_0xd5d9('0x49')];return new Promise(function(_0x57f346,_0x31d709){return db['CmHopper'][_0xd5d9('0x8')]({'where':{'voiceQueueId':{'$in':_0x3fd09c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xd5d9('0x38')](_0xd5d9('0x4a')+_0x397e1d+_0xd5d9('0x4b')),'$gt':db['sequelize'][_0xd5d9('0x38')]('NOW()')}},'UserId':{'$in':_0x21d197}},'include':[{'model':db[_0xd5d9('0x24')],'as':_0xd5d9('0x4c')},{'model':db[_0xd5d9('0x4d')],'as':_0xd5d9('0x2a'),'attributes':['id',_0xd5d9('0x2b'),'voicePause']},{'model':db['CmList'],'as':_0xd5d9('0x4e')}]})[_0xd5d9('0x10')](function(_0x33464c){if(_0x33464c[_0xd5d9('0x2c')]>0x0){return db[_0xd5d9('0x25')]['transaction'](function(_0x581fb0){return db['CmHopper'][_0xd5d9('0x1d')]({'recallmeNotifiedDate':db[_0xd5d9('0x25')][_0xd5d9('0x38')](_0xd5d9('0x4f'))},{'where':{'id':{'$in':_[_0xd5d9('0xf')](_0x33464c,'id')}},'transaction':_0x581fb0})['then'](function(){_0x57f346(_0x33464c);})['catch'](function(_0x17f59b){logger[_0xd5d9('0x18')]('CmHopperHandlePreviewRecallNotifications',_0x17f59b[_0xd5d9('0x13')],_0x545dfa);_0x31d709(_0x11ddcf[_0xd5d9('0x18')](0x1f4,_0x17f59b[_0xd5d9('0x13')]));});})[_0xd5d9('0x12')](function(_0xa5afba){logger[_0xd5d9('0x18')](_0xd5d9('0x46'),_0xa5afba[_0xd5d9('0x13')],_0x545dfa);_0x31d709(_0x11ddcf['error'](0x1f4,_0xa5afba[_0xd5d9('0x13')]));});}else{_0x57f346(_0x33464c);}});});}; \ No newline at end of file +var _0x304a=['options','raw','where','attributes','map','include','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','limit','order','LOCK','UPDATE','Contact','keys','User','name','voicePause','UserId','push','update','includes','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll'];(function(_0x5968e4,_0x5c185c){var _0x409a7c=function(_0x2768c0){while(--_0x2768c0){_0x5968e4['push'](_0x5968e4['shift']());}};_0x409a7c(++_0x5c185c);}(_0x304a,0x19a));var _0xa304=function(_0x4c5237,_0x1125c0){_0x4c5237=_0x4c5237-0x0;var _0x5cb8e0=_0x304a[_0x4c5237];return _0x5cb8e0;};'use strict';var _=require(_0xa304('0x0'));var util=require(_0xa304('0x1'));var moment=require(_0xa304('0x2'));var BPromise=require(_0xa304('0x3'));var db=require(_0xa304('0x4'))['db'];var logger=require(_0xa304('0x5'))(_0xa304('0x6'));exports[_0xa304('0x7')]=function(_0x4409a3){var _0x150cb0=this;return new Promise(function(_0x4628a9,_0x4ef358){return db[_0xa304('0x8')][_0xa304('0x9')]({'raw':_0x4409a3[_0xa304('0xa')]?_0x4409a3[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'where':_0x4409a3[_0xa304('0xa')]?_0x4409a3[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x4409a3['options']?_0x4409a3[_0xa304('0xa')][_0xa304('0xd')]||null:null,'limit':_0x4409a3[_0xa304('0xa')]?_0x4409a3[_0xa304('0xa')]['limit']||null:null,'include':_0x4409a3['options']?_0x4409a3[_0xa304('0xa')]['include']?_[_0xa304('0xe')](_0x4409a3[_0xa304('0xa')][_0xa304('0xf')],function(_0x2acc50){return{'model':db[_0x2acc50[_0xa304('0x10')]],'as':_0x2acc50['as'],'attributes':_0x2acc50[_0xa304('0xd')],'include':_0x2acc50[_0xa304('0xf')]?_[_0xa304('0xe')](_0x2acc50['include'],function(_0x3ab97a){return{'model':db[_0x3ab97a['model']],'as':_0x3ab97a['as'],'attributes':_0x3ab97a[_0xa304('0xd')],'include':_0x3ab97a[_0xa304('0xf')]?_[_0xa304('0xe')](_0x3ab97a['include'],function(_0x1c79ca){return{'model':db[_0x1c79ca[_0xa304('0x10')]],'as':_0x1c79ca['as'],'attributes':_0x1c79ca[_0xa304('0xd')]};}):[]};}):[]};}):[]:[]})[_0xa304('0x11')](function(_0x3d6506){logger[_0xa304('0x12')](_0xa304('0x7'),_0x4409a3);logger[_0xa304('0x13')](_0xa304('0x7'),_0x4409a3,JSON[_0xa304('0x14')](_0x3d6506));_0x4628a9(_0x3d6506);})[_0xa304('0x15')](function(_0x6fe98d){logger[_0xa304('0x16')](_0xa304('0x7'),_0x6fe98d[_0xa304('0x17')],_0x4409a3);_0x4ef358(_0x150cb0['error'](0x1f4,_0x6fe98d['message']));});});};exports[_0xa304('0x18')]=function(_0x461ba2){var _0x3626fd=this;return new Promise(function(_0x37b317,_0x510cfc){return db[_0xa304('0x8')][_0xa304('0x19')]({'raw':_0x461ba2[_0xa304('0xa')]?_0x461ba2[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'where':_0x461ba2['options']?_0x461ba2[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x461ba2[_0xa304('0xa')]?_0x461ba2[_0xa304('0xa')][_0xa304('0xd')]||null:null,'include':_0x461ba2[_0xa304('0xa')]?_0x461ba2['options'][_0xa304('0xf')]?_[_0xa304('0xe')](_0x461ba2[_0xa304('0xa')][_0xa304('0xf')],function(_0x314da2){return{'model':db[_0x314da2[_0xa304('0x10')]],'as':_0x314da2['as'],'attributes':_0x314da2[_0xa304('0xd')],'include':_0x314da2['include']?_['map'](_0x314da2[_0xa304('0xf')],function(_0x26f037){return{'model':db[_0x26f037[_0xa304('0x10')]],'as':_0x26f037['as'],'attributes':_0x26f037['attributes'],'include':_0x26f037[_0xa304('0xf')]?_['map'](_0x26f037['include'],function(_0x42dac0){return{'model':db[_0x42dac0[_0xa304('0x10')]],'as':_0x42dac0['as'],'attributes':_0x42dac0[_0xa304('0xd')]};}):[]};}):[]};}):[]:[]})[_0xa304('0x11')](function(_0x109fef){logger['info'](_0xa304('0x18'),_0x461ba2);logger[_0xa304('0x13')](_0xa304('0x18'),_0x461ba2,JSON[_0xa304('0x14')](_0x109fef));_0x37b317(_0x109fef);})[_0xa304('0x15')](function(_0x1ac30e){logger[_0xa304('0x16')]('ShowCmHopper',_0x1ac30e[_0xa304('0x17')],_0x461ba2);_0x510cfc(_0x3626fd[_0xa304('0x16')](0x1f4,_0x1ac30e[_0xa304('0x17')]));});});};exports[_0xa304('0x1a')]=function(_0x41f011){var _0x365bc0=this;return new Promise(function(_0x330102,_0x25485f){return db[_0xa304('0x8')][_0xa304('0x1b')](_0x41f011[_0xa304('0x1c')],{'raw':_0x41f011['options']?_0x41f011[_0xa304('0xa')]['raw']===undefined?!![]:![]:!![]})[_0xa304('0x11')](function(_0x444d31){logger[_0xa304('0x12')](_0xa304('0x1a'),_0x41f011);logger['debug']('CreateCmHopper',_0x41f011,JSON[_0xa304('0x14')](_0x444d31));_0x330102(_0x444d31);})['catch'](function(_0x5e4615){logger[_0xa304('0x16')](_0xa304('0x1a'),_0x5e4615['message'],_0x41f011);_0x25485f(_0x365bc0['error'](0x1f4,_0x5e4615[_0xa304('0x17')]));});});};exports['UpdateCmHopper']=function(_0x47daa9){var _0x5b6dcf=this;return new Promise(function(_0x3dcbf7,_0x5828f2){return db[_0xa304('0x8')]['update'](_0x47daa9[_0xa304('0x1c')],{'raw':_0x47daa9[_0xa304('0xa')]?_0x47daa9[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47daa9[_0xa304('0xa')]?_0x47daa9[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x47daa9[_0xa304('0xa')]?_0x47daa9[_0xa304('0xa')]['attributes']||null:null,'limit':_0x47daa9['options']?_0x47daa9[_0xa304('0xa')]['limit']||null:null})[_0xa304('0x11')](function(_0x18b183){logger[_0xa304('0x12')](_0xa304('0x1d'),_0x47daa9);logger[_0xa304('0x12')](_0xa304('0x1e'),JSON['stringify'](_0x47daa9[_0xa304('0xa')][_0xa304('0xc')]),_0x47daa9[_0xa304('0x1c')][_0xa304('0x1f')]);logger[_0xa304('0x13')](_0xa304('0x1d'),_0x47daa9,JSON['stringify'](_0x18b183));_0x3dcbf7(_0x18b183);})[_0xa304('0x15')](function(_0x5d2ac7){logger['error'](_0xa304('0x1d'),_0x5d2ac7[_0xa304('0x17')],_0x47daa9);_0x5828f2(_0x5b6dcf[_0xa304('0x16')](0x1f4,_0x5d2ac7[_0xa304('0x17')]));});});};exports[_0xa304('0x20')]=function(_0x1d72c4){var _0x25f9cd=this;return new Promise(function(_0x32f8ef,_0x59f339){return db[_0xa304('0x8')][_0xa304('0x21')]({'where':_0x1d72c4[_0xa304('0xa')]?_0x1d72c4['options']['where']||null:null})[_0xa304('0x11')](function(_0x4c3aaa){logger[_0xa304('0x12')]('DestroyCmHopper',_0x1d72c4);logger[_0xa304('0x13')](_0xa304('0x20'),_0x1d72c4,JSON['stringify'](_0x4c3aaa));_0x32f8ef(_0x4c3aaa);})[_0xa304('0x15')](function(_0x3884b1){logger[_0xa304('0x16')](_0xa304('0x20'),_0x3884b1[_0xa304('0x17')],_0x1d72c4);_0x59f339(_0x25f9cd[_0xa304('0x16')](0x1f4,_0x3884b1['message']));});});};exports['GetContactDialer']=function(_0x549d04){var _0x2b046f=this;return new Promise(function(_0x2ca424,_0x5f35cb){return db[_0xa304('0x22')][_0xa304('0x23')]()[_0xa304('0x11')](function(_0x535a89){return db[_0xa304('0x24')][_0xa304('0x25')](function(_0x1ed1e7){return db[_0xa304('0x8')]['findAll']({'where':_0x549d04['options']?_0x549d04[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x549d04[_0xa304('0xa')]?_0x549d04['options'][_0xa304('0xd')]||null:null,'limit':_0x549d04['options']?_0x549d04[_0xa304('0xa')][_0xa304('0x26')]||null:null,'order':_0x549d04[_0xa304('0xa')]?_0x549d04[_0xa304('0xa')][_0xa304('0x27')]||null:null,'transaction':_0x1ed1e7,'lock':_0x1ed1e7[_0xa304('0x28')][_0xa304('0x29')],'include':[{'model':db['CmContact'],'as':_0xa304('0x2a'),'attributes':_[_0xa304('0x2b')](_0x535a89)},{'model':db[_0xa304('0x2c')],'as':'Agent','attributes':['id',_0xa304('0x2d'),_0xa304('0x2e')]}]})[_0xa304('0x11')](function(_0x4e6c1d){var _0x4b11f1=[];var _0x126477=[];for(var _0x7319db=0x0;_0x7319db<_0x4e6c1d['length'];_0x7319db+=0x1){var _0x58c94e=_0x4e6c1d[_0x7319db][_0xa304('0x2f')];if(_0x58c94e===null){_0x4b11f1[_0xa304('0x30')](_0x4e6c1d[_0x7319db][_0xa304('0x31')](_0x549d04[_0xa304('0x1c')],{'transaction':_0x1ed1e7}));}else if(!_0x126477[_0xa304('0x32')](_0x58c94e)){_0x126477[_0xa304('0x30')](_0x58c94e);_0x4b11f1[_0xa304('0x30')](_0x4e6c1d[_0x7319db][_0xa304('0x31')](_0x549d04[_0xa304('0x1c')],{'transaction':_0x1ed1e7}));}}return BPromise[_0xa304('0x33')](_0x4b11f1);});})[_0xa304('0x11')](function(_0x53c220){logger[_0xa304('0x12')](_0xa304('0x34'),_0x549d04);if(_0x53c220[_0xa304('0x35')]>0x0){logger[_0xa304('0x12')](_0xa304('0x36'),_0x53c220[0x0][_0xa304('0x37')]['id'],_0x53c220[0x0][_0xa304('0x37')][_0xa304('0x38')],_0x53c220[0x0]['dataValues'][_0xa304('0x1f')]);}logger[_0xa304('0x13')]('GetContactDialer',_0x549d04,JSON[_0xa304('0x14')](_0x53c220));_0x2ca424(_0x53c220);})[_0xa304('0x15')](function(_0x321602){logger[_0xa304('0x16')](_0xa304('0x34'),_0x321602['message'],_0x549d04);_0x5f35cb(_0x2b046f[_0xa304('0x16')](0x1f4,_0x321602['message']));});});});};exports['MoveContactManagedDialer']=function(_0x216ebc){var _0x1119b3=this;return new Promise(function(_0x343d1d,_0x36a977){return db[_0xa304('0x24')]['transaction'](function(_0x3ed75c){return db[_0xa304('0x39')][_0xa304('0x1b')](_0x216ebc[_0xa304('0x1c')],{'raw':_0x216ebc[_0xa304('0xa')]?_0x216ebc['options'][_0xa304('0xb')]===undefined?!![]:![]:!![],'transaction':_0x3ed75c})[_0xa304('0x11')](function(){logger[_0xa304('0x12')](_0xa304('0x3a'),JSON[_0xa304('0x14')](_0x216ebc[_0xa304('0xa')][_0xa304('0xc')]),_0x216ebc[_0xa304('0xa')][_0xa304('0xc')][_0xa304('0x1f')]);return db[_0xa304('0x8')][_0xa304('0x21')]({'where':_0x216ebc['options']?_0x216ebc[_0xa304('0xa')][_0xa304('0xc')]||null:null,'transaction':_0x3ed75c});});})[_0xa304('0x11')](function(_0x5996c1){logger[_0xa304('0x12')](_0xa304('0x3b'),_0x216ebc);logger[_0xa304('0x13')](_0xa304('0x3b'),_0x216ebc,JSON[_0xa304('0x14')](_0x5996c1));_0x343d1d(_0x5996c1);})[_0xa304('0x15')](function(_0x1c36a5){logger[_0xa304('0x16')](_0xa304('0x3b'),_0x1c36a5[_0xa304('0x17')],_0x216ebc);_0x36a977(_0x1119b3[_0xa304('0x16')](0x1f4,_0x1c36a5['message']));});});};exports[_0xa304('0x3c')]=function(_0xad4d7c){var _0x2bdaa8=this;return new Promise(function(_0x8d0652,_0x4139de){return db[_0xa304('0x8')][_0xa304('0x9')]({'raw':_0xad4d7c[_0xa304('0xa')]?_0xad4d7c[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'where':_0xad4d7c[_0xa304('0xa')]?_0xad4d7c['options'][_0xa304('0xc')]||null:null,'attributes':[[db[_0xa304('0x24')]['fn'](_0xa304('0x3d'),db[_0xa304('0x24')]['fn']('IF',db[_0xa304('0x24')][_0xa304('0x3e')](_0xa304('0x3f')+util[_0xa304('0x40')]('\x22%s\x22',moment()[_0xa304('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xa304('0x41')))),_0xa304('0x42')]]})['then'](function(_0x3b8db5){logger[_0xa304('0x12')](_0xa304('0x3c'),_0xad4d7c);logger[_0xa304('0x13')](_0xa304('0x3c'),_0xad4d7c,JSON[_0xa304('0x14')](_0x3b8db5));_0x8d0652(_0x3b8db5);})['catch'](function(_0x36de63){logger[_0xa304('0x16')](_0xa304('0x3c'),_0x36de63[_0xa304('0x17')],_0xad4d7c);_0x4139de(_0x2bdaa8[_0xa304('0x16')](0x1f4,_0x36de63[_0xa304('0x17')]));});});};exports[_0xa304('0x43')]=function(_0x79c83c){var _0x3d6dd8=this;return new Promise(function(_0x59c7d7,_0x4290ca){return db[_0xa304('0x22')][_0xa304('0x23')]()[_0xa304('0x11')](function(){return db[_0xa304('0x24')][_0xa304('0x25')](function(_0x316273){return db[_0xa304('0x8')][_0xa304('0x9')]({'where':_0x79c83c['options']?_0x79c83c['options']['where']||null:null,'attributes':_0x79c83c['options']?_0x79c83c[_0xa304('0xa')]['attributes']||null:null,'limit':0x1,'order':_0x79c83c[_0xa304('0xa')]?_0x79c83c[_0xa304('0xa')][_0xa304('0x27')]||null:null,'group':db[_0xa304('0x8')][_0xa304('0x2f')],'transaction':_0x316273,'lock':_0x316273[_0xa304('0x28')][_0xa304('0x29')],'include':_0x79c83c[_0xa304('0xa')]?_0x79c83c[_0xa304('0xa')][_0xa304('0xf')]?_[_0xa304('0xe')](_0x79c83c['options'][_0xa304('0xf')],function(_0x27ec1e){return{'model':db[_0x27ec1e[_0xa304('0x10')]],'as':_0x27ec1e['as'],'attributes':_0x27ec1e[_0xa304('0xd')],'include':_0x27ec1e[_0xa304('0xf')]?_[_0xa304('0xe')](_0x27ec1e['include'],function(_0x230d8e){return{'model':db[_0x230d8e['model']],'as':_0x230d8e['as'],'attributes':_0x230d8e[_0xa304('0xd')],'include':_0x230d8e[_0xa304('0xf')]?_[_0xa304('0xe')](_0x230d8e[_0xa304('0xf')],function(_0x507843){return{'model':db[_0x507843['model']],'as':_0x507843['as'],'attributes':_0x507843['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1aba17){var _0x50ec26=[];for(var _0xd877e8=0x0;_0xd877e8<_0x1aba17[_0xa304('0x35')];_0xd877e8+=0x1){_0x50ec26[_0xa304('0x30')](_0x1aba17[_0xd877e8]['update'](_0x79c83c['body'],{'transaction':_0x316273}));}return BPromise[_0xa304('0x33')](_0x50ec26);});})[_0xa304('0x11')](function(_0x265148){logger[_0xa304('0x12')]('GetContactRecallMe',_0x79c83c);logger['debug'](_0xa304('0x43'),_0x79c83c,JSON['stringify'](_0x265148));_0x59c7d7(_0x265148);})['catch'](function(_0x17964f){logger['error']('GetContactRecallMe',_0x17964f[_0xa304('0x17')],_0x79c83c);_0x4290ca(_0x3d6dd8['error'](0x1f4,_0x17964f['message']));});});});};exports[_0xa304('0x44')]=function(_0x59b7ca){var _0x19137d=this;return new Promise(function(_0x3d58e4,_0x298f6b){db[_0xa304('0x22')][_0xa304('0x23')]()[_0xa304('0x11')](function(_0x1885a3){return db[_0xa304('0x8')]['findAll']({'raw':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca[_0xa304('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca['options']['attributes']||null:null,'limit':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca[_0xa304('0xa')]['limit']||null:null,'include':_0x59b7ca['options']?_0x59b7ca[_0xa304('0xa')]['include']?_[_0xa304('0xe')](_0x59b7ca[_0xa304('0xa')]['include'],function(_0x5403d7){return{'model':db[_0x5403d7['model']],'as':_0x5403d7['as'],'attributes':_0x5403d7['as']===_0xa304('0x2a')?_[_0xa304('0x2b')](_0x1885a3):_0x5403d7['attributes'],'include':_0x5403d7['include']?_['map'](_0x5403d7['include'],function(_0x34caef){return{'model':db[_0x34caef[_0xa304('0x10')]],'as':_0x34caef['as'],'attributes':_0x34caef['attributes'],'include':_0x34caef[_0xa304('0xf')]?_[_0xa304('0xe')](_0x34caef[_0xa304('0xf')],function(_0x164149){return{'model':db[_0x164149[_0xa304('0x10')]],'as':_0x164149['as'],'attributes':_0x164149['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34881d){logger[_0xa304('0x12')](_0xa304('0x7'),_0x59b7ca);logger[_0xa304('0x13')](_0xa304('0x7'),_0x59b7ca,JSON['stringify'](_0x34881d));_0x3d58e4(_0x34881d);})['catch'](function(_0x6f1163){logger[_0xa304('0x16')](_0xa304('0x7'),_0x6f1163['message'],_0x59b7ca);_0x298f6b(_0x19137d[_0xa304('0x16')](0x1f4,_0x6f1163[_0xa304('0x17')]));});});});};exports[_0xa304('0x45')]=function(_0x91ace7){var _0x3d7a04=this;return new Promise(function(_0x543028,_0x4c60fb){return db['CmContact'][_0xa304('0x46')]({'raw':!![],'where':{'phone':_0x91ace7[_0xa304('0xa')][_0xa304('0xc')][_0xa304('0x47')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0xa304('0x11')](function(_0x56149a){logger[_0xa304('0x12')](_0xa304('0x48'),_0x91ace7);logger[_0xa304('0x13')](_0xa304('0x48'),_0x91ace7,JSON[_0xa304('0x14')](_0x56149a));_0x543028(_0x56149a);})[_0xa304('0x15')](function(_0x5494a1){logger[_0xa304('0x16')](_0xa304('0x48'),_0x5494a1[_0xa304('0x17')],_0x91ace7);_0x4c60fb(_0x3d7a04[_0xa304('0x16')](0x1f4,_0x5494a1['message']));});});};exports[_0xa304('0x49')]=function(_0x460b90){var _0x4f3bc0=this;return new Promise(function(_0x4128d0,_0x157850){return db['sequelize'][_0xa304('0x25')](function(_0x217bd2){var _0x3d6904=_0x460b90[_0xa304('0xa')]&&_0x460b90[_0xa304('0xa')][_0xa304('0xc')]?_0x460b90[_0xa304('0xa')][_0xa304('0xc')]:{};return db[_0xa304('0x8')]['update'](_0x460b90[_0xa304('0x1c')],{'where':_0x3d6904,'transaction':_0x217bd2})['then'](function(_0x5554f0){logger['info'](_0xa304('0x49'),_0x460b90);logger[_0xa304('0x13')](_0xa304('0x49'),_0x460b90,JSON[_0xa304('0x14')](_0x5554f0));_0x4128d0(_0x5554f0);})[_0xa304('0x15')](function(_0x418c45){logger[_0xa304('0x16')](_0xa304('0x49'),_0x418c45[_0xa304('0x17')],_0x460b90);_0x157850(_0x4f3bc0['error'](0x1f4,_0x418c45[_0xa304('0x17')]));});});});};exports[_0xa304('0x4a')]=function(_0x4ddb81){var _0x37fef1=this;var _0x4076bd=_0x4ddb81['body'][_0xa304('0xc')][_0xa304('0x4b')];var _0x40d388=_0x4ddb81[_0xa304('0x1c')][_0xa304('0xc')][_0xa304('0x4c')];var _0x48db6e=_0x4ddb81[_0xa304('0x1c')][_0xa304('0xc')][_0xa304('0x4d')];return new Promise(function(_0x3fcf63,_0x5505a2){return db['CmHopper'][_0xa304('0x9')]({'where':{'voiceQueueId':{'$in':_0x4076bd},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa304('0x24')]['literal'](_0xa304('0x4e')+_0x40d388+_0xa304('0x4f')),'$gt':db[_0xa304('0x24')][_0xa304('0x3e')](_0xa304('0x50'))}},'UserId':{'$in':_0x48db6e}},'include':[{'model':db[_0xa304('0x22')],'as':_0xa304('0x2a')},{'model':db[_0xa304('0x2c')],'as':_0xa304('0x51'),'attributes':['id',_0xa304('0x2d'),_0xa304('0x2e')]},{'model':db[_0xa304('0x52')],'as':_0xa304('0x53')}]})[_0xa304('0x11')](function(_0x416801){if(_0x416801[_0xa304('0x35')]>0x0){return db[_0xa304('0x24')]['transaction'](function(_0x42db8c){return db[_0xa304('0x8')]['update']({'recallmeNotifiedDate':db[_0xa304('0x24')][_0xa304('0x3e')](_0xa304('0x50'))},{'where':{'id':{'$in':_[_0xa304('0xe')](_0x416801,'id')}},'transaction':_0x42db8c})['then'](function(){_0x3fcf63(_0x416801);})[_0xa304('0x15')](function(_0x196ec4){logger[_0xa304('0x16')](_0xa304('0x4a'),_0x196ec4['message'],_0x4ddb81);_0x5505a2(_0x37fef1[_0xa304('0x16')](0x1f4,_0x196ec4['message']));});})['catch'](function(_0x20096a){logger[_0xa304('0x16')](_0xa304('0x4a'),_0x20096a[_0xa304('0x17')],_0x4ddb81);_0x5505a2(_0x37fef1[_0xa304('0x16')](0x1f4,_0x20096a[_0xa304('0x17')]));});}else{_0x3fcf63(_0x416801);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index fafa758..0e48b61 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 _0xa9ac=['post','/timezone','delete','destroy','express','Router','./cmHopper.controller','get','isAuthenticated','/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','show','getPreviewRecall'];(function(_0x22bcc5,_0x522e27){var _0x488f6f=function(_0x58c786){while(--_0x58c786){_0x22bcc5['push'](_0x22bcc5['shift']());}};_0x488f6f(++_0x522e27);}(_0xa9ac,0xb4));var _0xca9a=function(_0x2b7dcd,_0x4c775b){_0x2b7dcd=_0x2b7dcd-0x0;var _0x305a26=_0xa9ac[_0x2b7dcd];return _0x305a26;};'use strict';var express=require(_0xca9a('0x0'));var router=express[_0xca9a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xca9a('0x2'));router[_0xca9a('0x3')]('/',auth[_0xca9a('0x4')](),controller['index']);router['get'](_0xca9a('0x5'),auth[_0xca9a('0x4')](),controller['describe']);router[_0xca9a('0x3')](_0xca9a('0x6'),auth[_0xca9a('0x4')](),controller[_0xca9a('0x7')]);router[_0xca9a('0x3')](_0xca9a('0x8'),auth['isAuthenticated'](),controller[_0xca9a('0x9')]);router[_0xca9a('0x3')]('/:id',auth[_0xca9a('0x4')](),controller[_0xca9a('0xa')]);router[_0xca9a('0x3')]('/:id/previewrecall',auth[_0xca9a('0x4')](),controller[_0xca9a('0xb')]);router[_0xca9a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/preview',auth['isAuthenticated'](),controller['getPreview']);router[_0xca9a('0xc')](_0xca9a('0xd'),auth[_0xca9a('0x4')](),controller['getTimezone']);router['put']('/:id',auth[_0xca9a('0x4')](),controller['update']);router[_0xca9a('0xe')]('/:id',auth[_0xca9a('0x4')](),controller[_0xca9a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2bdf=['post','/preview','getPreview','/timezone','put','/:id','delete','express','Router','../../components/auth/service','get','isAuthenticated','/describe','describe','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall'];(function(_0x3dd92b,_0x4d1139){var _0x5e1d23=function(_0x5d866f){while(--_0x5d866f){_0x3dd92b['push'](_0x3dd92b['shift']());}};_0x5e1d23(++_0x4d1139);}(_0x2bdf,0x1cf));var _0xf2bd=function(_0x1f531e,_0x3b694c){_0x1f531e=_0x1f531e-0x0;var _0x83e774=_0x2bdf[_0x1f531e];return _0x83e774;};'use strict';var express=require(_0xf2bd('0x0'));var router=express[_0xf2bd('0x1')]();var auth=require(_0xf2bd('0x2'));var controller=require('./cmHopper.controller');router[_0xf2bd('0x3')]('/',auth[_0xf2bd('0x4')](),controller['index']);router['get'](_0xf2bd('0x5'),auth['isAuthenticated'](),controller[_0xf2bd('0x6')]);router[_0xf2bd('0x3')]('/opencontacts',auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xf2bd('0x3')](_0xf2bd('0x7'),auth[_0xf2bd('0x4')](),controller[_0xf2bd('0x8')]);router[_0xf2bd('0x3')]('/:id',auth[_0xf2bd('0x4')](),controller[_0xf2bd('0x9')]);router[_0xf2bd('0x3')](_0xf2bd('0xa'),auth[_0xf2bd('0x4')](),controller[_0xf2bd('0xb')]);router[_0xf2bd('0xc')]('/',auth[_0xf2bd('0x4')](),controller['create']);router['post'](_0xf2bd('0xd'),auth[_0xf2bd('0x4')](),controller[_0xf2bd('0xe')]);router[_0xf2bd('0xc')](_0xf2bd('0xf'),auth[_0xf2bd('0x4')](),controller['getTimezone']);router[_0xf2bd('0x10')](_0xf2bd('0x11'),auth[_0xf2bd('0x4')](),controller['update']);router[_0xf2bd('0x12')](_0xf2bd('0x11'),auth[_0xf2bd('0x4')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 671588e..9187bf9 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 _0x4b99=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER','STRING','DATE'];(function(_0x3efbb4,_0x1f7356){var _0x373424=function(_0x5a253c){while(--_0x5a253c){_0x3efbb4['push'](_0x3efbb4['shift']());}};_0x373424(++_0x1f7356);}(_0x4b99,0xf0));var _0x94b9=function(_0x1603c9,_0x41e4ee){_0x1603c9=_0x1603c9-0x0;var _0x3f98dc=_0x4b99[_0x1603c9];return _0x3f98dc;};'use strict';var moment=require(_0x94b9('0x0'));var Sequelize=require('sequelize');module[_0x94b9('0x1')]={'CmHopperId':{'type':Sequelize[_0x94b9('0x2')]},'phone':{'type':Sequelize[_0x94b9('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x94b9('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x94b9('0x4')],'defaultValue':moment()[_0x94b9('0x5')](_0x94b9('0x6'))},'countbusyretry':{'type':Sequelize[_0x94b9('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x94b9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x94b9('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x94b9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x94b9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8cba=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','DATE'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8cba,0xc2));var _0xa8cb=function(_0x13d2a5,_0x5016a4){_0x13d2a5=_0x13d2a5-0x0;var _0x437a87=_0x8cba[_0x13d2a5];return _0x437a87;};'use strict';var moment=require(_0xa8cb('0x0'));var Sequelize=require(_0xa8cb('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xa8cb('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa8cb('0x3')],'defaultValue':moment()[_0xa8cb('0x4')](_0xa8cb('0x5'))},'countbusyretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 3837401..ec95ecf 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 _0xa709=['sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','get','CmHopperAdditionalPhones','error','stack','send','CmHopperAdditionalPhone','rawAttributes','fieldName','type','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','map','VIRTUAL','name','merge','includeAll','findAll','rows','catch','show','model','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x455451,_0x12bac0){var _0x371739=function(_0x5d6165){while(--_0x5d6165){_0x455451['push'](_0x455451['shift']());}};_0x371739(++_0x12bac0);}(_0xa709,0x1d1));var _0x9a70=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0xa709[_0x405385];return _0x43837b;};'use strict';var emlformat=require(_0x9a70('0x0'));var rimraf=require(_0x9a70('0x1'));var zipdir=require(_0x9a70('0x2'));var jsonpatch=require(_0x9a70('0x3'));var rp=require(_0x9a70('0x4'));var moment=require('moment');var BPromise=require(_0x9a70('0x5'));var Mustache=require(_0x9a70('0x6'));var util=require(_0x9a70('0x7'));var path=require(_0x9a70('0x8'));var sox=require(_0x9a70('0x9'));var csv=require(_0x9a70('0xa'));var ejs=require(_0x9a70('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a70('0xc'));var squel=require(_0x9a70('0xd'));var crypto=require(_0x9a70('0xe'));var jsforce=require(_0x9a70('0xf'));var deskjs=require(_0x9a70('0x10'));var toCsv=require(_0x9a70('0xa'));var querystring=require(_0x9a70('0x11'));var Papa=require('papaparse');var Redis=require(_0x9a70('0x12'));var authService=require(_0x9a70('0x13'));var qs=require(_0x9a70('0x14'));var as=require(_0x9a70('0x15'));var hardwareService=require(_0x9a70('0x16'));var logger=require(_0x9a70('0x17'))(_0x9a70('0x18'));var utils=require('../../config/utils');var config=require(_0x9a70('0x19'));var licenseUtil=require(_0x9a70('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aed8c,_0x5dcd42){_0x5dcd42=_0x5dcd42||0xcc;return function(_0x44bab3){if(_0x44bab3){return _0x1aed8c[_0x9a70('0x1b')](_0x5dcd42);}return _0x1aed8c['status'](_0x5dcd42)[_0x9a70('0x1c')]();};}function respondWithResult(_0x226884,_0x1ae4de){_0x1ae4de=_0x1ae4de||0xc8;return function(_0x3bccb9){if(_0x3bccb9){return _0x226884[_0x9a70('0x1d')](_0x1ae4de)[_0x9a70('0x1e')](_0x3bccb9);}};}function respondWithFilteredResult(_0xd19554,_0x15f245){return function(_0x46fd6a){if(_0x46fd6a){var _0x45e44d=typeof _0x15f245[_0x9a70('0x1f')]===_0x9a70('0x20')&&typeof _0x15f245[_0x9a70('0x21')]==='undefined';var _0x38d8c9=_0x46fd6a[_0x9a70('0x22')];var _0x304933=_0x45e44d?0x0:_0x15f245[_0x9a70('0x1f')];var _0x5eab2f=_0x45e44d?_0x46fd6a[_0x9a70('0x22')]:_0x15f245[_0x9a70('0x1f')]+_0x15f245[_0x9a70('0x21')];var _0x29a389;if(_0x5eab2f>=_0x38d8c9){_0x5eab2f=_0x38d8c9;_0x29a389=0xc8;}else{_0x29a389=0xce;}_0xd19554['status'](_0x29a389);return _0xd19554['set'](_0x9a70('0x23'),_0x304933+'-'+_0x5eab2f+'/'+_0x38d8c9)[_0x9a70('0x1e')](_0x46fd6a);}return null;};}function patchUpdates(_0x2b6bdc){return function(_0x2a8dfb){try{jsonpatch[_0x9a70('0x24')](_0x2a8dfb,_0x2b6bdc,!![]);}catch(_0x39eaab){return BPromise['reject'](_0x39eaab);}return _0x2a8dfb[_0x9a70('0x25')]();};}function saveUpdates(_0x5be0bb,_0x5567c0){return function(_0x555c7d){if(_0x555c7d){return _0x555c7d[_0x9a70('0x26')](_0x5be0bb)['then'](function(_0x53d920){return _0x53d920;});}return null;};}function removeEntity(_0x4c5097,_0x2c38f6){return function(_0x12cb69){if(_0x12cb69){return _0x12cb69[_0x9a70('0x27')]()[_0x9a70('0x28')](function(){var _0x3f71bb=_0x12cb69[_0x9a70('0x29')]({'plain':!![]});var _0x281f17=_0x9a70('0x2a');return db['UserProfileResource'][_0x9a70('0x27')]({'where':{'type':_0x281f17,'resourceId':_0x3f71bb['id']}})[_0x9a70('0x28')](function(){return _0x12cb69;});})['then'](function(){_0x4c5097[_0x9a70('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494b7d,_0x19b0f4){return function(_0x143f5e){if(!_0x143f5e){_0x494b7d[_0x9a70('0x1b')](0x194);}return _0x143f5e;};}function handleError(_0x22b62b,_0xf4d1b1){_0xf4d1b1=_0xf4d1b1||0x1f4;return function(_0x380959){logger[_0x9a70('0x2b')](_0x380959[_0x9a70('0x2c')]);if(_0x380959['name']){delete _0x380959['name'];}_0x22b62b['status'](_0xf4d1b1)[_0x9a70('0x2d')](_0x380959);};}exports['index']=function(_0x281a02,_0x3f32ce){var _0x3132f2={},_0x344b76={},_0xba7669={'count':0x0,'rows':[]};var _0x519184=_['map'](db[_0x9a70('0x2e')][_0x9a70('0x2f')],function(_0x1ce8f3){return{'name':_0x1ce8f3[_0x9a70('0x30')],'type':_0x1ce8f3[_0x9a70('0x31')]['key']};});_0x344b76['model']=_['map'](_0x519184,'name');_0x344b76['query']=_[_0x9a70('0x32')](_0x281a02[_0x9a70('0x33')]);_0x344b76[_0x9a70('0x34')]=_[_0x9a70('0x35')](_0x344b76['model'],_0x344b76['query']);_0x3132f2['attributes']=_[_0x9a70('0x35')](_0x344b76['model'],qs['fields'](_0x281a02['query'][_0x9a70('0x36')]));_0x3132f2[_0x9a70('0x37')]=_0x3132f2[_0x9a70('0x37')][_0x9a70('0x38')]?_0x3132f2[_0x9a70('0x37')]:_0x344b76['model'];if(!_0x281a02[_0x9a70('0x33')][_0x9a70('0x39')]('nolimit')){_0x3132f2[_0x9a70('0x21')]=qs['limit'](_0x281a02[_0x9a70('0x33')][_0x9a70('0x21')]);_0x3132f2[_0x9a70('0x1f')]=qs[_0x9a70('0x1f')](_0x281a02['query'][_0x9a70('0x1f')]);}_0x3132f2['order']=qs[_0x9a70('0x3a')](_0x281a02['query'][_0x9a70('0x3a')]);_0x3132f2[_0x9a70('0x3b')]=qs[_0x9a70('0x34')](_['pick'](_0x281a02[_0x9a70('0x33')],_0x344b76[_0x9a70('0x34')]),_0x519184);if(_0x281a02[_0x9a70('0x33')][_0x9a70('0x3c')]){_0x3132f2[_0x9a70('0x3b')]=_['merge'](_0x3132f2['where'],{'$or':_[_0x9a70('0x3d')](_0x519184,function(_0x2752ed){if(_0x2752ed[_0x9a70('0x31')]!==_0x9a70('0x3e')){var _0x399fe5={};_0x399fe5[_0x2752ed[_0x9a70('0x3f')]]={'$like':'%'+_0x281a02[_0x9a70('0x33')][_0x9a70('0x3c')]+'%'};return _0x399fe5;}})});}_0x3132f2=_[_0x9a70('0x40')]({},_0x3132f2,_0x281a02['options']);var _0x560bcb={'where':_0x3132f2[_0x9a70('0x3b')]};return db[_0x9a70('0x2e')][_0x9a70('0x22')](_0x560bcb)[_0x9a70('0x28')](function(_0x861c53){_0xba7669['count']=_0x861c53;if(_0x281a02[_0x9a70('0x33')][_0x9a70('0x41')]){_0x3132f2['include']=[{'all':!![]}];}return db[_0x9a70('0x2e')][_0x9a70('0x42')](_0x3132f2);})['then'](function(_0x134339){_0xba7669[_0x9a70('0x43')]=_0x134339;return _0xba7669;})[_0x9a70('0x28')](respondWithFilteredResult(_0x3f32ce,_0x3132f2))[_0x9a70('0x44')](handleError(_0x3f32ce,null));};exports[_0x9a70('0x45')]=function(_0x20f41c,_0x2a2160){var _0xcb901d={'raw':!![],'where':{'id':_0x20f41c['params']['id']}},_0x455bfb={};_0x455bfb[_0x9a70('0x46')]=_[_0x9a70('0x32')](db[_0x9a70('0x2e')][_0x9a70('0x2f')]);_0x455bfb[_0x9a70('0x33')]=_['keys'](_0x20f41c[_0x9a70('0x33')]);_0x455bfb[_0x9a70('0x34')]=_[_0x9a70('0x35')](_0x455bfb[_0x9a70('0x46')],_0x455bfb['query']);_0xcb901d[_0x9a70('0x37')]=_[_0x9a70('0x35')](_0x455bfb[_0x9a70('0x46')],qs[_0x9a70('0x36')](_0x20f41c['query'][_0x9a70('0x36')]));_0xcb901d[_0x9a70('0x37')]=_0xcb901d['attributes'][_0x9a70('0x38')]?_0xcb901d[_0x9a70('0x37')]:_0x455bfb[_0x9a70('0x46')];if(_0x20f41c['query'][_0x9a70('0x41')]){_0xcb901d[_0x9a70('0x47')]=[{'all':!![]}];}_0xcb901d=_[_0x9a70('0x40')]({},_0xcb901d,_0x20f41c['options']);return db[_0x9a70('0x2e')][_0x9a70('0x48')](_0xcb901d)['then'](handleEntityNotFound(_0x2a2160,null))[_0x9a70('0x28')](respondWithResult(_0x2a2160,null))[_0x9a70('0x44')](handleError(_0x2a2160,null));};exports[_0x9a70('0x49')]=function(_0x1b868a,_0x385683){return db[_0x9a70('0x2e')][_0x9a70('0x49')](_0x1b868a[_0x9a70('0x4a')],{})[_0x9a70('0x28')](function(_0x40d29c){var _0x20352b=_0x1b868a[_0x9a70('0x4b')][_0x9a70('0x29')]({'plain':!![]});if(!_0x20352b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20352b[_0x9a70('0x4c')]===_0x9a70('0x4b')){var _0x7b8db3=_0x40d29c[_0x9a70('0x29')]({'plain':!![]});var _0x5ca6cc='CmHopperAdditionalPhones';return db[_0x9a70('0x4d')][_0x9a70('0x48')]({'where':{'name':_0x5ca6cc,'userProfileId':_0x20352b[_0x9a70('0x4e')]},'raw':!![]})[_0x9a70('0x28')](function(_0x375b8f){if(_0x375b8f&&_0x375b8f[_0x9a70('0x4f')]===0x0){return db[_0x9a70('0x50')][_0x9a70('0x49')]({'name':_0x7b8db3[_0x9a70('0x3f')],'resourceId':_0x7b8db3['id'],'type':_0x375b8f[_0x9a70('0x3f')],'sectionId':_0x375b8f['id']},{})[_0x9a70('0x28')](function(){return _0x40d29c;});}else{return _0x40d29c;}})[_0x9a70('0x44')](function(_0x26f60f){logger[_0x9a70('0x2b')](_0x9a70('0x51'),_0x26f60f);throw _0x26f60f;});}return _0x40d29c;})[_0x9a70('0x28')](respondWithResult(_0x385683,0xc9))['catch'](handleError(_0x385683,null));};exports['update']=function(_0xbd2b6f,_0x4f9862){if(_0xbd2b6f[_0x9a70('0x4a')]['id']){delete _0xbd2b6f[_0x9a70('0x4a')]['id'];}return db[_0x9a70('0x2e')]['find']({'where':{'id':_0xbd2b6f['params']['id']}})[_0x9a70('0x28')](handleEntityNotFound(_0x4f9862,null))[_0x9a70('0x28')](saveUpdates(_0xbd2b6f[_0x9a70('0x4a')],null))[_0x9a70('0x28')](respondWithResult(_0x4f9862,null))['catch'](handleError(_0x4f9862,null));};exports[_0x9a70('0x27')]=function(_0x394009,_0x4984fe){return db['CmHopperAdditionalPhone'][_0x9a70('0x48')]({'where':{'id':_0x394009['params']['id']}})[_0x9a70('0x28')](handleEntityNotFound(_0x4984fe,null))['then'](removeEntity(_0x4984fe,null))[_0x9a70('0x44')](handleError(_0x4984fe,null));}; \ No newline at end of file +var _0xf33d=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','sendStatus','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','find','body','user','role','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring'];(function(_0x9f39fc,_0x520816){var _0x29658c=function(_0xbc2d82){while(--_0xbc2d82){_0x9f39fc['push'](_0x9f39fc['shift']());}};_0x29658c(++_0x520816);}(_0xf33d,0x12d));var _0xdf33=function(_0x44769c,_0x4b2cc6){_0x44769c=_0x44769c-0x0;var _0x216eb5=_0xf33d[_0x44769c];return _0x216eb5;};'use strict';var emlformat=require(_0xdf33('0x0'));var rimraf=require(_0xdf33('0x1'));var zipdir=require(_0xdf33('0x2'));var jsonpatch=require(_0xdf33('0x3'));var rp=require(_0xdf33('0x4'));var moment=require('moment');var BPromise=require(_0xdf33('0x5'));var Mustache=require(_0xdf33('0x6'));var util=require(_0xdf33('0x7'));var path=require('path');var sox=require(_0xdf33('0x8'));var csv=require(_0xdf33('0x9'));var ejs=require(_0xdf33('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdf33('0xb'));var crypto=require(_0xdf33('0xc'));var jsforce=require(_0xdf33('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdf33('0xe'));var Papa=require(_0xdf33('0xf'));var Redis=require('ioredis');var authService=require(_0xdf33('0x10'));var qs=require(_0xdf33('0x11'));var as=require(_0xdf33('0x12'));var hardwareService=require(_0xdf33('0x13'));var logger=require('../../config/logger')(_0xdf33('0x14'));var utils=require('../../config/utils');var config=require(_0xdf33('0x15'));var licenseUtil=require(_0xdf33('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x533f9b,_0x46c1d3){_0x46c1d3=_0x46c1d3||0xcc;return function(_0x46ff9c){if(_0x46ff9c){return _0x533f9b['sendStatus'](_0x46c1d3);}return _0x533f9b[_0xdf33('0x17')](_0x46c1d3)[_0xdf33('0x18')]();};}function respondWithResult(_0x379c32,_0x3a4ed1){_0x3a4ed1=_0x3a4ed1||0xc8;return function(_0x4b1ec8){if(_0x4b1ec8){return _0x379c32[_0xdf33('0x17')](_0x3a4ed1)[_0xdf33('0x19')](_0x4b1ec8);}};}function respondWithFilteredResult(_0x5e420c,_0x572c77){return function(_0x3b3a72){if(_0x3b3a72){var _0x32c8bb=typeof _0x572c77[_0xdf33('0x1a')]===_0xdf33('0x1b')&&typeof _0x572c77['limit']===_0xdf33('0x1b');var _0x5948e7=_0x3b3a72[_0xdf33('0x1c')];var _0x2d47b0=_0x32c8bb?0x0:_0x572c77[_0xdf33('0x1a')];var _0x22bede=_0x32c8bb?_0x3b3a72['count']:_0x572c77['offset']+_0x572c77[_0xdf33('0x1d')];var _0x1b36f7;if(_0x22bede>=_0x5948e7){_0x22bede=_0x5948e7;_0x1b36f7=0xc8;}else{_0x1b36f7=0xce;}_0x5e420c[_0xdf33('0x17')](_0x1b36f7);return _0x5e420c[_0xdf33('0x1e')]('Content-Range',_0x2d47b0+'-'+_0x22bede+'/'+_0x5948e7)[_0xdf33('0x19')](_0x3b3a72);}return null;};}function patchUpdates(_0x16e606){return function(_0x43732e){try{jsonpatch['apply'](_0x43732e,_0x16e606,!![]);}catch(_0x435d44){return BPromise[_0xdf33('0x1f')](_0x435d44);}return _0x43732e[_0xdf33('0x20')]();};}function saveUpdates(_0x4a0bf6,_0x5399ee){return function(_0x9a0b3){if(_0x9a0b3){return _0x9a0b3['update'](_0x4a0bf6)[_0xdf33('0x21')](function(_0xa1324d){return _0xa1324d;});}return null;};}function removeEntity(_0x5f0235,_0x25ab0a){return function(_0x284e5c){if(_0x284e5c){return _0x284e5c[_0xdf33('0x22')]()[_0xdf33('0x21')](function(){var _0x330668=_0x284e5c[_0xdf33('0x23')]({'plain':!![]});var _0x5ea292=_0xdf33('0x24');return db[_0xdf33('0x25')][_0xdf33('0x22')]({'where':{'type':_0x5ea292,'resourceId':_0x330668['id']}})[_0xdf33('0x21')](function(){return _0x284e5c;});})['then'](function(){_0x5f0235[_0xdf33('0x17')](0xcc)[_0xdf33('0x18')]();});}};}function handleEntityNotFound(_0x50a63d,_0x1c88a8){return function(_0x1b5538){if(!_0x1b5538){_0x50a63d[_0xdf33('0x26')](0x194);}return _0x1b5538;};}function handleError(_0x163ec8,_0x424855){_0x424855=_0x424855||0x1f4;return function(_0x309eed){logger[_0xdf33('0x27')](_0x309eed[_0xdf33('0x28')]);if(_0x309eed[_0xdf33('0x29')]){delete _0x309eed['name'];}_0x163ec8['status'](_0x424855)[_0xdf33('0x2a')](_0x309eed);};}exports[_0xdf33('0x2b')]=function(_0x2b5cbc,_0x2008bb){var _0x464df4={},_0x1ac378={},_0x436beb={'count':0x0,'rows':[]};var _0x586511=_['map'](db[_0xdf33('0x2c')][_0xdf33('0x2d')],function(_0x1b5e4d){return{'name':_0x1b5e4d[_0xdf33('0x2e')],'type':_0x1b5e4d[_0xdf33('0x2f')]['key']};});_0x1ac378[_0xdf33('0x30')]=_[_0xdf33('0x31')](_0x586511,'name');_0x1ac378[_0xdf33('0x32')]=_[_0xdf33('0x33')](_0x2b5cbc['query']);_0x1ac378[_0xdf33('0x34')]=_[_0xdf33('0x35')](_0x1ac378[_0xdf33('0x30')],_0x1ac378[_0xdf33('0x32')]);_0x464df4['attributes']=_[_0xdf33('0x35')](_0x1ac378[_0xdf33('0x30')],qs[_0xdf33('0x36')](_0x2b5cbc[_0xdf33('0x32')]['fields']));_0x464df4[_0xdf33('0x37')]=_0x464df4[_0xdf33('0x37')]['length']?_0x464df4['attributes']:_0x1ac378[_0xdf33('0x30')];if(!_0x2b5cbc[_0xdf33('0x32')]['hasOwnProperty']('nolimit')){_0x464df4[_0xdf33('0x1d')]=qs['limit'](_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x1d')]);_0x464df4[_0xdf33('0x1a')]=qs[_0xdf33('0x1a')](_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x1a')]);}_0x464df4[_0xdf33('0x38')]=qs['sort'](_0x2b5cbc['query'][_0xdf33('0x39')]);_0x464df4[_0xdf33('0x3a')]=qs[_0xdf33('0x34')](_[_0xdf33('0x3b')](_0x2b5cbc['query'],_0x1ac378['filters']),_0x586511);if(_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x3c')]){_0x464df4['where']=_['merge'](_0x464df4['where'],{'$or':_['map'](_0x586511,function(_0x39b25e){if(_0x39b25e['type']!==_0xdf33('0x3d')){var _0x229059={};_0x229059[_0x39b25e[_0xdf33('0x29')]]={'$like':'%'+_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x3c')]+'%'};return _0x229059;}})});}_0x464df4=_[_0xdf33('0x3e')]({},_0x464df4,_0x2b5cbc[_0xdf33('0x3f')]);var _0x4a13fb={'where':_0x464df4[_0xdf33('0x3a')]};return db[_0xdf33('0x2c')][_0xdf33('0x1c')](_0x4a13fb)[_0xdf33('0x21')](function(_0x11e1e4){_0x436beb['count']=_0x11e1e4;if(_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x40')]){_0x464df4[_0xdf33('0x41')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x464df4);})[_0xdf33('0x21')](function(_0x1e365b){_0x436beb[_0xdf33('0x42')]=_0x1e365b;return _0x436beb;})[_0xdf33('0x21')](respondWithFilteredResult(_0x2008bb,_0x464df4))['catch'](handleError(_0x2008bb,null));};exports[_0xdf33('0x43')]=function(_0x5d2cf6,_0x164b25){var _0x1632f1={'raw':!![],'where':{'id':_0x5d2cf6[_0xdf33('0x44')]['id']}},_0x424518={};_0x424518[_0xdf33('0x30')]=_[_0xdf33('0x33')](db[_0xdf33('0x2c')][_0xdf33('0x2d')]);_0x424518['query']=_['keys'](_0x5d2cf6[_0xdf33('0x32')]);_0x424518[_0xdf33('0x34')]=_[_0xdf33('0x35')](_0x424518[_0xdf33('0x30')],_0x424518[_0xdf33('0x32')]);_0x1632f1[_0xdf33('0x37')]=_[_0xdf33('0x35')](_0x424518['model'],qs['fields'](_0x5d2cf6[_0xdf33('0x32')][_0xdf33('0x36')]));_0x1632f1['attributes']=_0x1632f1['attributes'][_0xdf33('0x45')]?_0x1632f1[_0xdf33('0x37')]:_0x424518[_0xdf33('0x30')];if(_0x5d2cf6[_0xdf33('0x32')][_0xdf33('0x40')]){_0x1632f1[_0xdf33('0x41')]=[{'all':!![]}];}_0x1632f1=_[_0xdf33('0x3e')]({},_0x1632f1,_0x5d2cf6[_0xdf33('0x3f')]);return db[_0xdf33('0x2c')][_0xdf33('0x46')](_0x1632f1)[_0xdf33('0x21')](handleEntityNotFound(_0x164b25,null))[_0xdf33('0x21')](respondWithResult(_0x164b25,null))['catch'](handleError(_0x164b25,null));};exports['create']=function(_0x470883,_0x213135){return db[_0xdf33('0x2c')]['create'](_0x470883[_0xdf33('0x47')],{})['then'](function(_0x45a4e6){var _0x1a9e27=_0x470883[_0xdf33('0x48')][_0xdf33('0x23')]({'plain':!![]});if(!_0x1a9e27)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a9e27[_0xdf33('0x49')]===_0xdf33('0x48')){var _0x587031=_0x45a4e6[_0xdf33('0x23')]({'plain':!![]});var _0x3a217a=_0xdf33('0x24');return db['UserProfileSection'][_0xdf33('0x46')]({'where':{'name':_0x3a217a,'userProfileId':_0x1a9e27[_0xdf33('0x4a')]},'raw':!![]})[_0xdf33('0x21')](function(_0x225f38){if(_0x225f38&&_0x225f38[_0xdf33('0x4b')]===0x0){return db[_0xdf33('0x25')][_0xdf33('0x4c')]({'name':_0x587031[_0xdf33('0x29')],'resourceId':_0x587031['id'],'type':_0x225f38['name'],'sectionId':_0x225f38['id']},{})[_0xdf33('0x21')](function(){return _0x45a4e6;});}else{return _0x45a4e6;}})[_0xdf33('0x4d')](function(_0x2427fe){logger['error'](_0xdf33('0x4e'),_0x2427fe);throw _0x2427fe;});}return _0x45a4e6;})[_0xdf33('0x21')](respondWithResult(_0x213135,0xc9))['catch'](handleError(_0x213135,null));};exports['update']=function(_0x3e28c4,_0x37a640){if(_0x3e28c4[_0xdf33('0x47')]['id']){delete _0x3e28c4[_0xdf33('0x47')]['id'];}return db[_0xdf33('0x2c')][_0xdf33('0x46')]({'where':{'id':_0x3e28c4[_0xdf33('0x44')]['id']}})[_0xdf33('0x21')](handleEntityNotFound(_0x37a640,null))[_0xdf33('0x21')](saveUpdates(_0x3e28c4[_0xdf33('0x47')],null))['then'](respondWithResult(_0x37a640,null))[_0xdf33('0x4d')](handleError(_0x37a640,null));};exports[_0xdf33('0x22')]=function(_0x127699,_0x55f7d9){return db[_0xdf33('0x2c')][_0xdf33('0x46')]({'where':{'id':_0x127699[_0xdf33('0x44')]['id']}})[_0xdf33('0x21')](handleEntityNotFound(_0x55f7d9,null))[_0xdf33('0x21')](removeEntity(_0x55f7d9,null))[_0xdf33('0x4d')](handleError(_0x55f7d9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 0daa5c8..61fb2a2 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 _0x2960=['../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x4d4330,_0x838446){var _0x11b116=function(_0x34490d){while(--_0x34490d){_0x4d4330['push'](_0x4d4330['shift']());}};_0x11b116(++_0x838446);}(_0x2960,0x71));var _0x0296=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x2960[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x0296('0x0'));var util=require(_0x0296('0x1'));var logger=require(_0x0296('0x2'))(_0x0296('0x3'));var moment=require('moment');var BPromise=require(_0x0296('0x4'));var rp=require(_0x0296('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0296('0x6'));var config=require(_0x0296('0x7'));var attributes=require(_0x0296('0x8'));module['exports']=function(_0x299dac,_0x3d4085){return _0x299dac[_0x0296('0x9')](_0x0296('0xa'),attributes,{'tableName':_0x0296('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7be4=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x12ea1e,_0x5e965f){var _0x2c1505=function(_0x38e952){while(--_0x38e952){_0x12ea1e['push'](_0x12ea1e['shift']());}};_0x2c1505(++_0x5e965f);}(_0x7be4,0x16e));var _0x47be=function(_0x52063b,_0x125b81){_0x52063b=_0x52063b-0x0;var _0xc94b04=_0x7be4[_0x52063b];return _0xc94b04;};'use strict';var _=require(_0x47be('0x0'));var util=require(_0x47be('0x1'));var logger=require(_0x47be('0x2'))(_0x47be('0x3'));var moment=require(_0x47be('0x4'));var BPromise=require(_0x47be('0x5'));var rp=require(_0x47be('0x6'));var fs=require('fs');var path=require(_0x47be('0x7'));var rimraf=require(_0x47be('0x8'));var config=require(_0x47be('0x9'));var attributes=require(_0x47be('0xa'));module[_0x47be('0xb')]=function(_0x4c5a08,_0x475ba7){return _0x4c5a08[_0x47be('0xc')](_0x47be('0xd'),attributes,{'tableName':_0x47be('0xe'),'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 4d931ff..fea2d7e 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 _0x0572=['scheduledat','minutes','add','phone','countnoanswerretry','updatedAt','createdAt','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CmHopperAdditionalPhone','OrderBy','ASC','then','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','catch','SwapAdditionalPhones','CampaignId','waitTime','duration','isNil'];(function(_0x31c900,_0x2d9cf9){var _0x1e3b6d=function(_0x27fdbe){while(--_0x27fdbe){_0x31c900['push'](_0x31c900['shift']());}};_0x1e3b6d(++_0x2d9cf9);}(_0x0572,0x137));var _0x2057=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0572[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x2057('0x0'));var util=require(_0x2057('0x1'));var moment=require('moment');var BPromise=require(_0x2057('0x2'));var rs=require(_0x2057('0x3'));var fs=require('fs');var Redis=require(_0x2057('0x4'));var db=require(_0x2057('0x5'))['db'];var utils=require(_0x2057('0x6'));var logger=require(_0x2057('0x7'))(_0x2057('0x8'));var config=require(_0x2057('0x9'));var jayson=require(_0x2057('0xa'));var client=jayson['client'][_0x2057('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cd9f9,_0x2c98c4,_0x499aec){return new BPromise(function(_0xe86a1e,_0x4bb8c){return client[_0x2057('0xc')](_0x1cd9f9,_0x499aec)['then'](function(_0xd07de6){logger[_0x2057('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2c98c4,'request\x20sent');logger[_0x2057('0xe')](_0x2057('0xf'),_0x2c98c4,_0x2057('0x10'),JSON[_0x2057('0x11')](_0xd07de6));if(_0xd07de6['error']){if(_0xd07de6[_0x2057('0x12')][_0x2057('0x13')]===0x1f4){logger[_0x2057('0x12')](_0x2057('0x14'),_0x2c98c4,_0xd07de6['error']['message']);return _0x4bb8c(_0xd07de6[_0x2057('0x12')][_0x2057('0x15')]);}logger[_0x2057('0x12')](_0x2057('0x14'),_0x2c98c4,_0xd07de6[_0x2057('0x12')][_0x2057('0x15')]);return _0xe86a1e(_0xd07de6[_0x2057('0x12')][_0x2057('0x15')]);}else{logger['info'](_0x2057('0x14'),_0x2c98c4,_0x2057('0x10'));_0xe86a1e(_0xd07de6[_0x2057('0x16')][_0x2057('0x15')]);}})['catch'](function(_0x37163e){logger[_0x2057('0x12')](_0x2057('0x14'),_0x2c98c4,_0x37163e);_0x4bb8c(_0x37163e);});});}exports[_0x2057('0x17')]=function(_0x433ae6){var _0x3ab6e3=this;return new Promise(function(_0x24c089,_0x92849b){return db[_0x2057('0x18')][_0x2057('0x19')]({'raw':!![],'where':{'ContactId':_0x433ae6[_0x2057('0x1a')][_0x2057('0x1b')],'ListId':_0x433ae6[_0x2057('0x1a')][_0x2057('0x1c')],'VoiceQueueId':_0x433ae6[_0x2057('0x1a')]['VoiceQueueId']===undefined?null:_0x433ae6[_0x2057('0x1a')][_0x2057('0x1d')],'CampaignId':_0x433ae6[_0x2057('0x1a')]['CampaignId']===undefined?null:_0x433ae6[_0x2057('0x1a')]['CampaignId']}})['then'](function(_0x380fc0){if(_0x380fc0!=null){return db[_0x2057('0x1e')][_0x2057('0x19')]({'raw':!![],'where':{'CmHopperId':_0x380fc0['id'],'OrderBy':{'$gt':_0x380fc0[_0x2057('0x1f')]}},'order':[[_0x2057('0x1f'),_0x2057('0x20')]]})[_0x2057('0x21')](function(_0x40389a){var _0x2a21ad=0x0;if(_0x40389a){if(_0x40389a['countbusyretry']+_0x40389a[_0x2057('0x22')]+_0x40389a['countnoanswerretry']+_0x40389a[_0x2057('0x23')]+_0x40389a[_0x2057('0x24')]+_0x40389a[_0x2057('0x25')]+_0x40389a[_0x2057('0x26')]+_0x40389a[_0x2057('0x27')]<_0x433ae6[_0x2057('0x28')][_0x2057('0x29')])_0x2a21ad=0x1;_0x24c089({'additional':_0x2a21ad});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x380fc0['id']},'order':[[_0x2057('0x1f'),_0x2057('0x20')]]})[_0x2057('0x21')](function(_0x105b45){var _0x3f9bef=0x0;if(_0x105b45){if(_0x105b45[_0x2057('0x2a')]+_0x105b45[_0x2057('0x22')]+_0x105b45['countnoanswerretry']+_0x105b45['countnosuchnumberretry']+_0x105b45[_0x2057('0x24')]+_0x105b45[_0x2057('0x25')]+_0x105b45['countmachineretry']+_0x105b45['countagentrejectretry']<_0x433ae6['entity']['dialGlobalMaxRetry'])_0x3f9bef=0x1;_0x24c089({'additional':_0x3f9bef});}else{_0x24c089({'additional':0x0});}})[_0x2057('0x2b')](function(_0x2a5186){logger[_0x2057('0x12')](_0x2057('0x17'),_0x2a5186[_0x2057('0x15')]);_0x92849b(_0x3ab6e3[_0x2057('0x12')](0x1f4,_0x2a5186[_0x2057('0x15')]));});}})[_0x2057('0x2b')](function(_0x47c3a4){logger[_0x2057('0x12')](_0x2057('0x17'),_0x47c3a4[_0x2057('0x15')]);_0x92849b(_0x3ab6e3[_0x2057('0x12')](0x1f4,_0x47c3a4[_0x2057('0x15')]));});}else _0x24c089({'additional':0x0});});});};exports[_0x2057('0x2c')]=function(_0x3b12ea){var _0x32652f=this;return new Promise(function(_0x262170,_0x1a44b6){return db[_0x2057('0x18')][_0x2057('0x19')]({'raw':!![],'where':{'ContactId':_0x3b12ea[_0x2057('0x1a')][_0x2057('0x1b')],'ListId':_0x3b12ea[_0x2057('0x1a')][_0x2057('0x1c')],'VoiceQueueId':_0x3b12ea['body']['VoiceQueueId']===undefined?null:_0x3b12ea[_0x2057('0x1a')][_0x2057('0x1d')],'CampaignId':_0x3b12ea[_0x2057('0x1a')][_0x2057('0x2d')]===undefined?null:_0x3b12ea['body'][_0x2057('0x2d')]}})['then'](function(_0x1d1689){if(_0x1d1689!=null){return db['CmHopperAdditionalPhone'][_0x2057('0x19')]({'raw':!![],'where':{'CmHopperId':_0x1d1689['id'],'OrderBy':{'$gte':_0x1d1689[_0x2057('0x1f')]}},'order':[[_0x2057('0x1f'),_0x2057('0x20')]]})['then'](function(_0x2207d5){if(_0x2207d5)return activateAdditionalPhone(_0x1d1689,_0x3b12ea[_0x2057('0x1a')],_0x2207d5,_0x3b12ea['duration'],_0x3b12ea[_0x2057('0x2e')])[_0x2057('0x21')](function(_0xc3277d){_0x262170(_0xc3277d);});else{return db[_0x2057('0x1e')][_0x2057('0x19')]({'raw':!![],'where':{'CmHopperId':_0x1d1689['id']},'order':[['OrderBy',_0x2057('0x20')]]})['then'](function(_0x56540a){if(_0x56540a)return activateAdditionalPhone(_0x1d1689,_0x3b12ea[_0x2057('0x1a')],_0x56540a,_0x3b12ea[_0x2057('0x2f')],_0x3b12ea[_0x2057('0x2e')])[_0x2057('0x21')](function(_0x554ada){_0x262170(_0x554ada);});else{_0x262170({'id':_0x1d1689['id'],'phone':''});}})[_0x2057('0x2b')](function(_0x3e10ce){logger[_0x2057('0x12')]('VerifyAdditionalPhones',_0x3e10ce[_0x2057('0x15')]);_0x1a44b6(_0x32652f[_0x2057('0x12')](0x1f4,_0x3e10ce[_0x2057('0x15')]));});}})[_0x2057('0x2b')](function(_0x1b7ce7){logger[_0x2057('0x12')](_0x2057('0x17'),_0x1b7ce7[_0x2057('0x15')]);_0x1a44b6(_0x32652f[_0x2057('0x12')](0x1f4,_0x1b7ce7[_0x2057('0x15')]));});}else _0x262170(0x1);});});};function activateAdditionalPhone(_0x500291,_0x5eb9f1,_0x5902ae,_0x5ac102,_0x24cc43){return new Promise(function(_0x18db29,_0x4b4c98){var _0x4b800d;if(_[_0x2057('0x30')](_0x5902ae[_0x2057('0x31')])){_0x5902ae[_0x2057('0x31')]=moment();}if(moment()>moment(_0x5902ae[_0x2057('0x31')])){_0x4b800d=moment()['add'](_0x24cc43||0x3,_0x2057('0x32'));}else{if(_0x5902ae[_0x2057('0x1f')]==0x0){_0x4b800d=moment(_0x5902ae[_0x2057('0x31')]);}else{_0x4b800d=moment()[_0x2057('0x33')](_0x24cc43||0x3,_0x2057('0x32'));}}if(_['isNil'](_0x4b800d)){_0x4b800d=moment()[_0x2057('0x33')](_0x24cc43||0x3,'minutes');}var _0x9703f1={'phone':_0x500291[_0x2057('0x34')],'active':0x0,'OrderBy':_[_0x2057('0x30')](_0x500291[_0x2057('0x1f')])?0x0:_0x500291[_0x2057('0x1f')],'scheduledat':moment()['add'](_0x5ac102||0x1,_0x2057('0x32')),'countbusyretry':_0x5eb9f1[_0x2057('0x2a')],'countcongestionretry':_0x5eb9f1[_0x2057('0x22')],'countnoanswerretry':_0x5eb9f1[_0x2057('0x35')],'countnosuchnumberretry':_0x5eb9f1[_0x2057('0x23')],'countdropretry':_0x5eb9f1['countdropretry'],'countabandonedretry':_0x5eb9f1[_0x2057('0x25')],'countmachineretry':_0x5eb9f1[_0x2057('0x26')],'countagentrejectretry':_0x5eb9f1[_0x2057('0x27')],'createdAt':_0x5eb9f1['createdAt'],'updatedAt':_0x5eb9f1[_0x2057('0x36')]};var _0x53711f={'CmHopperId':_0x500291['id'],'phone':_0x5902ae[_0x2057('0x34')],'active':0x0,'OrderBy':_[_0x2057('0x30')](_0x5902ae[_0x2057('0x1f')])?0x0:_0x5902ae[_0x2057('0x1f')],'scheduledat':_0x4b800d,'countbusyretry':_0x5902ae['countbusyretry'],'countcongestionretry':_0x5902ae['countcongestionretry'],'countnoanswerretry':_0x5902ae[_0x2057('0x35')],'countnosuchnumberretry':_0x5902ae[_0x2057('0x23')],'countdropretry':_0x5902ae[_0x2057('0x24')],'countabandonedretry':_0x5902ae['countabandonedretry'],'countmachineretry':_0x5902ae[_0x2057('0x26')],'countagentrejectretry':_0x5902ae[_0x2057('0x27')],'createdAt':_0x5902ae[_0x2057('0x37')],'updatedAt':_0x5902ae['updatedAt']};return db['sequelize']['transaction'](function(_0x4d6107){return db[_0x2057('0x1e')][_0x2057('0x38')](_0x9703f1,{'where':{'id':_0x5902ae['id']}},{'transaction':_0x4d6107})[_0x2057('0x21')](function(){return db['CmHopper'][_0x2057('0x38')](_0x53711f,{'where':{'id':_0x500291['id']}},{'transaction':_0x4d6107});});})[_0x2057('0x21')](function(_0x29ab0e){_0x18db29({'id':_0x500291['id'],'phone':_0x5902ae[_0x2057('0x34')]});})[_0x2057('0x2b')](function(_0xa78f49){logger[_0x2057('0x12')](_0x2057('0x39'),_0xa78f49[_0x2057('0x15')]);_0x4b4c98({'error':_0xa78f49[_0x2057('0x15')]});});});}exports[_0x2057('0x3a')]=function(_0x577c63){var _0x1e322a=this;return new Promise(function(_0x48e2f3,_0xf6aefe){return db[_0x2057('0x18')][_0x2057('0x38')](_0x577c63['body'][_0x2057('0x3b')],{'where':{'id':_0x577c63[_0x2057('0x1a')]['id']}})['then'](function(_0x4237bb){_0x48e2f3(_0x4237bb);})[_0x2057('0x2b')](function(_0xe0a06){logger[_0x2057('0x12')]('IncrementPreviewCounters',_0xe0a06[_0x2057('0x15')]);_0xf6aefe(_0x1e322a['error'](0x1f4,_0xe0a06[_0x2057('0x15')]));});});}; \ No newline at end of file +var _0xc5c2=['minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','request\x20sent','debug','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','SwapAdditionalPhones','duration','isNil','scheduledat','add'];(function(_0x2fc834,_0x3aff52){var _0x12e7f9=function(_0x59ac43){while(--_0x59ac43){_0x2fc834['push'](_0x2fc834['shift']());}};_0x12e7f9(++_0x3aff52);}(_0xc5c2,0x14d));var _0x2c5c=function(_0x56b508,_0x4d642a){_0x56b508=_0x56b508-0x0;var _0x2a0b8e=_0xc5c2[_0x56b508];return _0x2a0b8e;};'use strict';var _=require(_0x2c5c('0x0'));var util=require(_0x2c5c('0x1'));var moment=require(_0x2c5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c5c('0x3'))['db'];var utils=require(_0x2c5c('0x4'));var logger=require(_0x2c5c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2c5c('0x6'));var client=jayson[_0x2c5c('0x7')][_0x2c5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dd75e,_0x370475,_0x3e6735){return new BPromise(function(_0x13bd7b,_0x2bd5b3){return client['request'](_0x4dd75e,_0x3e6735)['then'](function(_0x30652f){logger[_0x2c5c('0x9')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x370475,_0x2c5c('0xa'));logger[_0x2c5c('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x370475,_0x2c5c('0xa'),JSON['stringify'](_0x30652f));if(_0x30652f['error']){if(_0x30652f[_0x2c5c('0xc')][_0x2c5c('0xd')]===0x1f4){logger[_0x2c5c('0xc')](_0x2c5c('0xe'),_0x370475,_0x30652f['error'][_0x2c5c('0xf')]);return _0x2bd5b3(_0x30652f[_0x2c5c('0xc')]['message']);}logger['error'](_0x2c5c('0xe'),_0x370475,_0x30652f[_0x2c5c('0xc')][_0x2c5c('0xf')]);return _0x13bd7b(_0x30652f[_0x2c5c('0xc')][_0x2c5c('0xf')]);}else{logger[_0x2c5c('0x9')](_0x2c5c('0xe'),_0x370475,_0x2c5c('0xa'));_0x13bd7b(_0x30652f[_0x2c5c('0x10')][_0x2c5c('0xf')]);}})[_0x2c5c('0x11')](function(_0x1f6d7c){logger[_0x2c5c('0xc')](_0x2c5c('0xe'),_0x370475,_0x1f6d7c);_0x2bd5b3(_0x1f6d7c);});});}exports[_0x2c5c('0x12')]=function(_0x144fae){var _0x108568=this;return new Promise(function(_0xc3a0c6,_0x52ad2b){return db[_0x2c5c('0x13')][_0x2c5c('0x14')]({'raw':!![],'where':{'ContactId':_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x16')],'ListId':_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x17')],'VoiceQueueId':_0x144fae['body'][_0x2c5c('0x18')]===undefined?null:_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x18')],'CampaignId':_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x19')]===undefined?null:_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x19')]}})['then'](function(_0x3aa590){if(_0x3aa590!=null){return db[_0x2c5c('0x1a')][_0x2c5c('0x14')]({'raw':!![],'where':{'CmHopperId':_0x3aa590['id'],'OrderBy':{'$gt':_0x3aa590[_0x2c5c('0x1b')]}},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})[_0x2c5c('0x1d')](function(_0x381a76){var _0x54dfb1=0x0;if(_0x381a76){if(_0x381a76[_0x2c5c('0x1e')]+_0x381a76['countcongestionretry']+_0x381a76['countnoanswerretry']+_0x381a76['countnosuchnumberretry']+_0x381a76[_0x2c5c('0x1f')]+_0x381a76[_0x2c5c('0x20')]+_0x381a76[_0x2c5c('0x21')]+_0x381a76[_0x2c5c('0x22')]<_0x144fae[_0x2c5c('0x23')]['dialGlobalMaxRetry'])_0x54dfb1=0x1;_0xc3a0c6({'additional':_0x54dfb1});}else{return db[_0x2c5c('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3aa590['id']},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})['then'](function(_0x5624f3){var _0x2af96f=0x0;if(_0x5624f3){if(_0x5624f3[_0x2c5c('0x1e')]+_0x5624f3[_0x2c5c('0x24')]+_0x5624f3[_0x2c5c('0x25')]+_0x5624f3[_0x2c5c('0x26')]+_0x5624f3['countdropretry']+_0x5624f3['countabandonedretry']+_0x5624f3[_0x2c5c('0x21')]+_0x5624f3[_0x2c5c('0x22')]<_0x144fae[_0x2c5c('0x23')][_0x2c5c('0x27')])_0x2af96f=0x1;_0xc3a0c6({'additional':_0x2af96f});}else{_0xc3a0c6({'additional':0x0});}})[_0x2c5c('0x11')](function(_0x15d1d9){logger[_0x2c5c('0xc')](_0x2c5c('0x12'),_0x15d1d9['message']);_0x52ad2b(_0x108568[_0x2c5c('0xc')](0x1f4,_0x15d1d9[_0x2c5c('0xf')]));});}})['catch'](function(_0x187333){logger[_0x2c5c('0xc')](_0x2c5c('0x12'),_0x187333[_0x2c5c('0xf')]);_0x52ad2b(_0x108568[_0x2c5c('0xc')](0x1f4,_0x187333['message']));});}else _0xc3a0c6({'additional':0x0});});});};exports[_0x2c5c('0x28')]=function(_0x473fe8){var _0x5c2249=this;return new Promise(function(_0x3bf52c,_0x3095a2){return db[_0x2c5c('0x13')][_0x2c5c('0x14')]({'raw':!![],'where':{'ContactId':_0x473fe8['body']['ContactId'],'ListId':_0x473fe8[_0x2c5c('0x15')]['ListId'],'VoiceQueueId':_0x473fe8[_0x2c5c('0x15')][_0x2c5c('0x18')]===undefined?null:_0x473fe8[_0x2c5c('0x15')][_0x2c5c('0x18')],'CampaignId':_0x473fe8['body'][_0x2c5c('0x19')]===undefined?null:_0x473fe8['body'][_0x2c5c('0x19')]}})[_0x2c5c('0x1d')](function(_0x5853f0){if(_0x5853f0!=null){return db[_0x2c5c('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5853f0['id'],'OrderBy':{'$gte':_0x5853f0[_0x2c5c('0x1b')]}},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})[_0x2c5c('0x1d')](function(_0x426178){if(_0x426178)return activateAdditionalPhone(_0x5853f0,_0x473fe8['body'],_0x426178,_0x473fe8['duration'],_0x473fe8['waitTime'])[_0x2c5c('0x1d')](function(_0x5856e6){_0x3bf52c(_0x5856e6);});else{return db[_0x2c5c('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5853f0['id']},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})[_0x2c5c('0x1d')](function(_0x424a1e){if(_0x424a1e)return activateAdditionalPhone(_0x5853f0,_0x473fe8[_0x2c5c('0x15')],_0x424a1e,_0x473fe8[_0x2c5c('0x29')],_0x473fe8['waitTime'])[_0x2c5c('0x1d')](function(_0x198ee1){_0x3bf52c(_0x198ee1);});else{_0x3bf52c({'id':_0x5853f0['id'],'phone':''});}})[_0x2c5c('0x11')](function(_0x8f22f6){logger[_0x2c5c('0xc')](_0x2c5c('0x12'),_0x8f22f6[_0x2c5c('0xf')]);_0x3095a2(_0x5c2249[_0x2c5c('0xc')](0x1f4,_0x8f22f6[_0x2c5c('0xf')]));});}})[_0x2c5c('0x11')](function(_0x3ccb6f){logger['error'](_0x2c5c('0x12'),_0x3ccb6f[_0x2c5c('0xf')]);_0x3095a2(_0x5c2249[_0x2c5c('0xc')](0x1f4,_0x3ccb6f['message']));});}else _0x3bf52c(0x1);});});};function activateAdditionalPhone(_0x13769e,_0x340fd7,_0x2f3822,_0x10dcec,_0x1558d8){return new Promise(function(_0x3e93ba,_0xaa2642){var _0x3e3402;if(_[_0x2c5c('0x2a')](_0x2f3822[_0x2c5c('0x2b')])){_0x2f3822[_0x2c5c('0x2b')]=moment();}if(moment()>moment(_0x2f3822[_0x2c5c('0x2b')])){_0x3e3402=moment()[_0x2c5c('0x2c')](_0x1558d8||0x3,_0x2c5c('0x2d'));}else{if(_0x2f3822[_0x2c5c('0x1b')]==0x0){_0x3e3402=moment(_0x2f3822[_0x2c5c('0x2b')]);}else{_0x3e3402=moment()[_0x2c5c('0x2c')](_0x1558d8||0x3,'minutes');}}if(_[_0x2c5c('0x2a')](_0x3e3402)){_0x3e3402=moment()[_0x2c5c('0x2c')](_0x1558d8||0x3,_0x2c5c('0x2d'));}var _0x451879={'phone':_0x13769e[_0x2c5c('0x2e')],'active':0x0,'OrderBy':_[_0x2c5c('0x2a')](_0x13769e[_0x2c5c('0x1b')])?0x0:_0x13769e[_0x2c5c('0x1b')],'scheduledat':moment()[_0x2c5c('0x2c')](_0x10dcec||0x1,_0x2c5c('0x2d')),'countbusyretry':_0x340fd7[_0x2c5c('0x1e')],'countcongestionretry':_0x340fd7[_0x2c5c('0x24')],'countnoanswerretry':_0x340fd7[_0x2c5c('0x25')],'countnosuchnumberretry':_0x340fd7[_0x2c5c('0x26')],'countdropretry':_0x340fd7['countdropretry'],'countabandonedretry':_0x340fd7[_0x2c5c('0x20')],'countmachineretry':_0x340fd7[_0x2c5c('0x21')],'countagentrejectretry':_0x340fd7['countagentrejectretry'],'createdAt':_0x340fd7[_0x2c5c('0x2f')],'updatedAt':_0x340fd7[_0x2c5c('0x30')]};var _0x271ab0={'CmHopperId':_0x13769e['id'],'phone':_0x2f3822[_0x2c5c('0x2e')],'active':0x0,'OrderBy':_[_0x2c5c('0x2a')](_0x2f3822[_0x2c5c('0x1b')])?0x0:_0x2f3822['OrderBy'],'scheduledat':_0x3e3402,'countbusyretry':_0x2f3822[_0x2c5c('0x1e')],'countcongestionretry':_0x2f3822['countcongestionretry'],'countnoanswerretry':_0x2f3822[_0x2c5c('0x25')],'countnosuchnumberretry':_0x2f3822[_0x2c5c('0x26')],'countdropretry':_0x2f3822[_0x2c5c('0x1f')],'countabandonedretry':_0x2f3822[_0x2c5c('0x20')],'countmachineretry':_0x2f3822[_0x2c5c('0x21')],'countagentrejectretry':_0x2f3822['countagentrejectretry'],'createdAt':_0x2f3822[_0x2c5c('0x2f')],'updatedAt':_0x2f3822['updatedAt']};return db[_0x2c5c('0x31')][_0x2c5c('0x32')](function(_0x529780){return db[_0x2c5c('0x1a')]['update'](_0x451879,{'where':{'id':_0x2f3822['id']}},{'transaction':_0x529780})[_0x2c5c('0x1d')](function(){return db[_0x2c5c('0x13')][_0x2c5c('0x33')](_0x271ab0,{'where':{'id':_0x13769e['id']}},{'transaction':_0x529780});});})['then'](function(_0x23f5f2){_0x3e93ba({'id':_0x13769e['id'],'phone':_0x2f3822[_0x2c5c('0x2e')]});})['catch'](function(_0x3cbf0f){logger['error'](_0x2c5c('0x34'),_0x3cbf0f[_0x2c5c('0xf')]);_0xaa2642({'error':_0x3cbf0f[_0x2c5c('0xf')]});});});}exports[_0x2c5c('0x35')]=function(_0x43c435){var _0x592f4c=this;return new Promise(function(_0x24e914,_0x18d361){return db['CmHopper'][_0x2c5c('0x33')](_0x43c435[_0x2c5c('0x15')]['field'],{'where':{'id':_0x43c435[_0x2c5c('0x15')]['id']}})[_0x2c5c('0x1d')](function(_0x1f4f08){_0x24e914(_0x1f4f08);})['catch'](function(_0x8ca65b){logger['error']('IncrementPreviewCounters',_0x8ca65b[_0x2c5c('0xf')]);_0x18d361(_0x592f4c[_0x2c5c('0xc')](0x1f4,_0x8ca65b[_0x2c5c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 1cc40a1..a271df7 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 _0x86e6=['../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x51356c,_0x501f0c){var _0x2ebe29=function(_0x581edd){while(--_0x581edd){_0x51356c['push'](_0x51356c['shift']());}};_0x2ebe29(++_0x501f0c);}(_0x86e6,0x1c2));var _0x686e=function(_0x218f57,_0x5900b0){_0x218f57=_0x218f57-0x0;var _0x519ed2=_0x86e6[_0x218f57];return _0x519ed2;};'use strict';var multer=require(_0x686e('0x0'));var util=require('util');var path=require(_0x686e('0x1'));var timeout=require(_0x686e('0x2'));var express=require(_0x686e('0x3'));var router=express[_0x686e('0x4')]();var fs_extra=require(_0x686e('0x5'));var auth=require(_0x686e('0x6'));var interaction=require(_0x686e('0x7'));var config=require('../../config/environment');var controller=require(_0x686e('0x8'));router[_0x686e('0x9')]('/',auth[_0x686e('0xa')](),controller['index']);router[_0x686e('0x9')](_0x686e('0xb'),auth[_0x686e('0xa')](),controller[_0x686e('0xc')]);router[_0x686e('0xd')]('/',auth[_0x686e('0xa')](),controller[_0x686e('0xe')]);router[_0x686e('0xf')](_0x686e('0xb'),auth[_0x686e('0xa')](),controller[_0x686e('0x10')]);router[_0x686e('0x11')](_0x686e('0xb'),auth[_0x686e('0xa')](),controller['destroy']);module[_0x686e('0x12')]=router; \ No newline at end of file +var _0xe140=['Router','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xe140,0xf7));var _0x0e14=function(_0x5d6b8d,_0x59b787){_0x5d6b8d=_0x5d6b8d-0x0;var _0x123b7d=_0xe140[_0x5d6b8d];return _0x123b7d;};'use strict';var multer=require(_0x0e14('0x0'));var util=require(_0x0e14('0x1'));var path=require(_0x0e14('0x2'));var timeout=require(_0x0e14('0x3'));var express=require(_0x0e14('0x4'));var router=express[_0x0e14('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e14('0x6'));var config=require(_0x0e14('0x7'));var controller=require(_0x0e14('0x8'));router['get']('/',auth[_0x0e14('0x9')](),controller[_0x0e14('0xa')]);router[_0x0e14('0xb')](_0x0e14('0xc'),auth[_0x0e14('0x9')](),controller[_0x0e14('0xd')]);router[_0x0e14('0xe')]('/',auth[_0x0e14('0x9')](),controller['create']);router[_0x0e14('0xf')](_0x0e14('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0e14('0xc'),auth[_0x0e14('0x9')](),controller[_0x0e14('0x10')]);module[_0x0e14('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index c816e0f..f771175 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 _0x1f89=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x1f89,0x14c));var _0x91f8=function(_0x56b3a3,_0x3170bf){_0x56b3a3=_0x56b3a3-0x0;var _0xda808a=_0x1f89[_0x56b3a3];return _0xda808a;};'use strict';var moment=require(_0x91f8('0x0'));var Sequelize=require(_0x91f8('0x1'));module[_0x91f8('0x2')]={'phone':{'type':Sequelize[_0x91f8('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x91f8('0x4')],'unique':_0x91f8('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x91f8('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x91f8('0x5')}}; \ No newline at end of file +var _0x7e1e=['STRING','contactListQueue','INTEGER','moment','sequelize','exports'];(function(_0x1103fb,_0x3d767e){var _0x42a03f=function(_0x53b927){while(--_0x53b927){_0x1103fb['push'](_0x1103fb['shift']());}};_0x42a03f(++_0x3d767e);}(_0x7e1e,0x183));var _0xe7e1=function(_0x323d9d,_0x4ac6f4){_0x323d9d=_0x323d9d-0x0;var _0x4683a0=_0x7e1e[_0x323d9d];return _0x4683a0;};'use strict';var moment=require(_0xe7e1('0x0'));var Sequelize=require(_0xe7e1('0x1'));module[_0xe7e1('0x2')]={'phone':{'type':Sequelize[_0xe7e1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xe7e1('0x4')},'ListId':{'type':Sequelize[_0xe7e1('0x5')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xe7e1('0x5')],'unique':_0xe7e1('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c5a01d2..1dbce1a 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 _0xbc33=['lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','CmHopperBlack','includeAll','include','findAll','rows','catch','params','merge','options','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x29b0c6,_0x1e6263){var _0x13d47e=function(_0x35a0df){while(--_0x35a0df){_0x29b0c6['push'](_0x29b0c6['shift']());}};_0x13d47e(++_0x1e6263);}(_0xbc33,0xd1));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3bc3('0x0'));var rimraf=require(_0x3bc3('0x1'));var zipdir=require(_0x3bc3('0x2'));var jsonpatch=require(_0x3bc3('0x3'));var rp=require(_0x3bc3('0x4'));var moment=require('moment');var BPromise=require(_0x3bc3('0x5'));var Mustache=require(_0x3bc3('0x6'));var util=require(_0x3bc3('0x7'));var path=require(_0x3bc3('0x8'));var sox=require(_0x3bc3('0x9'));var csv=require(_0x3bc3('0xa'));var ejs=require(_0x3bc3('0xb'));var fs=require('fs');var fs_extra=require(_0x3bc3('0xc'));var _=require(_0x3bc3('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3bc3('0xe'));var deskjs=require(_0x3bc3('0xf'));var toCsv=require(_0x3bc3('0xa'));var querystring=require('querystring');var Papa=require(_0x3bc3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3bc3('0x11'));var as=require(_0x3bc3('0x12'));var hardwareService=require(_0x3bc3('0x13'));var logger=require(_0x3bc3('0x14'))(_0x3bc3('0x15'));var utils=require(_0x3bc3('0x16'));var config=require(_0x3bc3('0x17'));var licenseUtil=require(_0x3bc3('0x18'));var db=require(_0x3bc3('0x19'))['db'];function respondWithStatusCode(_0x6ed490,_0x51f4c6){_0x51f4c6=_0x51f4c6||0xcc;return function(_0x28d399){if(_0x28d399){return _0x6ed490['sendStatus'](_0x51f4c6);}return _0x6ed490[_0x3bc3('0x1a')](_0x51f4c6)[_0x3bc3('0x1b')]();};}function respondWithResult(_0x22f9de,_0x4f6c74){_0x4f6c74=_0x4f6c74||0xc8;return function(_0x10930b){if(_0x10930b){return _0x22f9de[_0x3bc3('0x1a')](_0x4f6c74)['json'](_0x10930b);}};}function respondWithFilteredResult(_0x7d2ed5,_0x4a0f7c){return function(_0x13f0f7){if(_0x13f0f7){var _0x31000b=typeof _0x4a0f7c[_0x3bc3('0x1c')]===_0x3bc3('0x1d')&&typeof _0x4a0f7c[_0x3bc3('0x1e')]===_0x3bc3('0x1d');var _0x2b0098=_0x13f0f7[_0x3bc3('0x1f')];var _0x4718b0=_0x31000b?0x0:_0x4a0f7c[_0x3bc3('0x1c')];var _0x38cc85=_0x31000b?_0x13f0f7[_0x3bc3('0x1f')]:_0x4a0f7c['offset']+_0x4a0f7c[_0x3bc3('0x1e')];var _0x53f706;if(_0x38cc85>=_0x2b0098){_0x38cc85=_0x2b0098;_0x53f706=0xc8;}else{_0x53f706=0xce;}_0x7d2ed5[_0x3bc3('0x1a')](_0x53f706);return _0x7d2ed5[_0x3bc3('0x20')](_0x3bc3('0x21'),_0x4718b0+'-'+_0x38cc85+'/'+_0x2b0098)['json'](_0x13f0f7);}return null;};}function patchUpdates(_0xd2f6f1){return function(_0x45aeaa){try{jsonpatch['apply'](_0x45aeaa,_0xd2f6f1,!![]);}catch(_0x3e4ded){return BPromise['reject'](_0x3e4ded);}return _0x45aeaa[_0x3bc3('0x22')]();};}function saveUpdates(_0x5bf27b,_0x8c536c){return function(_0x2fee4b){if(_0x2fee4b){return _0x2fee4b[_0x3bc3('0x23')](_0x5bf27b)[_0x3bc3('0x24')](function(_0x3b124b){return _0x3b124b;});}return null;};}function removeEntity(_0x197727,_0x3c48ea){return function(_0x3422e5){if(_0x3422e5){return _0x3422e5[_0x3bc3('0x25')]()[_0x3bc3('0x24')](function(){_0x197727[_0x3bc3('0x1a')](0xcc)[_0x3bc3('0x1b')]();});}};}function handleEntityNotFound(_0x463567,_0x5964f5){return function(_0x32abea){if(!_0x32abea){_0x463567['sendStatus'](0x194);}return _0x32abea;};}function handleError(_0x4c4827,_0x2a27b3){_0x2a27b3=_0x2a27b3||0x1f4;return function(_0x42deb5){logger[_0x3bc3('0x26')](_0x42deb5[_0x3bc3('0x27')]);if(_0x42deb5[_0x3bc3('0x28')]){delete _0x42deb5[_0x3bc3('0x28')];}_0x4c4827[_0x3bc3('0x1a')](_0x2a27b3)[_0x3bc3('0x29')](_0x42deb5);};}exports[_0x3bc3('0x2a')]=function(_0x17fe4a,_0xcb8ba){var _0x366f82={},_0x8cc787={},_0x19d43c={'count':0x0,'rows':[]};var _0x4516af=_[_0x3bc3('0x2b')](db['CmHopperBlack'][_0x3bc3('0x2c')],function(_0x3202a5){return{'name':_0x3202a5[_0x3bc3('0x2d')],'type':_0x3202a5['type'][_0x3bc3('0x2e')]};});_0x8cc787[_0x3bc3('0x2f')]=_[_0x3bc3('0x2b')](_0x4516af,_0x3bc3('0x28'));_0x8cc787[_0x3bc3('0x30')]=_[_0x3bc3('0x31')](_0x17fe4a[_0x3bc3('0x30')]);_0x8cc787[_0x3bc3('0x32')]=_[_0x3bc3('0x33')](_0x8cc787[_0x3bc3('0x2f')],_0x8cc787[_0x3bc3('0x30')]);_0x366f82[_0x3bc3('0x34')]=_[_0x3bc3('0x33')](_0x8cc787[_0x3bc3('0x2f')],qs[_0x3bc3('0x35')](_0x17fe4a[_0x3bc3('0x30')][_0x3bc3('0x35')]));_0x366f82['attributes']=_0x366f82[_0x3bc3('0x34')][_0x3bc3('0x36')]?_0x366f82[_0x3bc3('0x34')]:_0x8cc787[_0x3bc3('0x2f')];if(!_0x17fe4a[_0x3bc3('0x30')]['hasOwnProperty'](_0x3bc3('0x37'))){_0x366f82[_0x3bc3('0x1e')]=qs[_0x3bc3('0x1e')](_0x17fe4a[_0x3bc3('0x30')]['limit']);_0x366f82['offset']=qs[_0x3bc3('0x1c')](_0x17fe4a[_0x3bc3('0x30')][_0x3bc3('0x1c')]);}_0x366f82['order']=qs[_0x3bc3('0x38')](_0x17fe4a[_0x3bc3('0x30')][_0x3bc3('0x38')]);_0x366f82[_0x3bc3('0x39')]=qs['filters'](_[_0x3bc3('0x3a')](_0x17fe4a[_0x3bc3('0x30')],_0x8cc787[_0x3bc3('0x32')]),_0x4516af);if(_0x17fe4a[_0x3bc3('0x30')][_0x3bc3('0x3b')]){_0x366f82[_0x3bc3('0x39')]=_['merge'](_0x366f82['where'],{'$or':_[_0x3bc3('0x2b')](_0x4516af,function(_0x5c7fa){if(_0x5c7fa[_0x3bc3('0x3c')]!==_0x3bc3('0x3d')){var _0x18af7f={};_0x18af7f[_0x5c7fa['name']]={'$like':'%'+_0x17fe4a['query'][_0x3bc3('0x3b')]+'%'};return _0x18af7f;}})});}_0x366f82=_['merge']({},_0x366f82,_0x17fe4a['options']);var _0x55ddd1={'where':_0x366f82[_0x3bc3('0x39')]};return db[_0x3bc3('0x3e')][_0x3bc3('0x1f')](_0x55ddd1)[_0x3bc3('0x24')](function(_0x5b6093){_0x19d43c[_0x3bc3('0x1f')]=_0x5b6093;if(_0x17fe4a['query'][_0x3bc3('0x3f')]){_0x366f82[_0x3bc3('0x40')]=[{'all':!![]}];}return db[_0x3bc3('0x3e')][_0x3bc3('0x41')](_0x366f82);})['then'](function(_0x147643){_0x19d43c[_0x3bc3('0x42')]=_0x147643;return _0x19d43c;})[_0x3bc3('0x24')](respondWithFilteredResult(_0xcb8ba,_0x366f82))[_0x3bc3('0x43')](handleError(_0xcb8ba,null));};exports['show']=function(_0x321ea4,_0x4f56ed){var _0xe3dadf={'raw':!![],'where':{'id':_0x321ea4[_0x3bc3('0x44')]['id']}},_0x2e6897={};_0x2e6897[_0x3bc3('0x2f')]=_[_0x3bc3('0x31')](db[_0x3bc3('0x3e')][_0x3bc3('0x2c')]);_0x2e6897['query']=_['keys'](_0x321ea4[_0x3bc3('0x30')]);_0x2e6897[_0x3bc3('0x32')]=_[_0x3bc3('0x33')](_0x2e6897[_0x3bc3('0x2f')],_0x2e6897[_0x3bc3('0x30')]);_0xe3dadf[_0x3bc3('0x34')]=_['intersection'](_0x2e6897[_0x3bc3('0x2f')],qs[_0x3bc3('0x35')](_0x321ea4[_0x3bc3('0x30')]['fields']));_0xe3dadf['attributes']=_0xe3dadf[_0x3bc3('0x34')][_0x3bc3('0x36')]?_0xe3dadf[_0x3bc3('0x34')]:_0x2e6897['model'];if(_0x321ea4[_0x3bc3('0x30')]['includeAll']){_0xe3dadf[_0x3bc3('0x40')]=[{'all':!![]}];}_0xe3dadf=_[_0x3bc3('0x45')]({},_0xe3dadf,_0x321ea4[_0x3bc3('0x46')]);return db[_0x3bc3('0x3e')]['find'](_0xe3dadf)[_0x3bc3('0x24')](handleEntityNotFound(_0x4f56ed,null))[_0x3bc3('0x24')](respondWithResult(_0x4f56ed,null))[_0x3bc3('0x43')](handleError(_0x4f56ed,null));};exports[_0x3bc3('0x23')]=function(_0x4f6eb0,_0x31b2be){if(_0x4f6eb0['body']['id']){delete _0x4f6eb0[_0x3bc3('0x47')]['id'];}return db[_0x3bc3('0x3e')]['find']({'where':{'id':_0x4f6eb0[_0x3bc3('0x44')]['id']}})['then'](handleEntityNotFound(_0x31b2be,null))[_0x3bc3('0x24')](saveUpdates(_0x4f6eb0['body'],null))[_0x3bc3('0x24')](respondWithResult(_0x31b2be,null))[_0x3bc3('0x43')](handleError(_0x31b2be,null));};exports[_0x3bc3('0x25')]=function(_0x11a552,_0x5b85bd){return db[_0x3bc3('0x3e')][_0x3bc3('0x48')]({'where':{'id':_0x11a552['params']['id']}})['then'](handleEntityNotFound(_0x5b85bd,null))['then'](removeEntity(_0x5b85bd,null))['catch'](handleError(_0x5b85bd,null));};exports[_0x3bc3('0x49')]=function(_0x5ca252,_0x354179){return db[_0x3bc3('0x3e')]['describe']()['then'](respondWithResult(_0x354179,null))[_0x3bc3('0x43')](handleError(_0x354179,null));}; \ No newline at end of file +var _0x3dc9=['describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','map','CmHopperBlack','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','rawAttributes','find','update','body','params'];(function(_0xdb1afd,_0x18e372){var _0x1f17aa=function(_0x4c8627){while(--_0x4c8627){_0xdb1afd['push'](_0xdb1afd['shift']());}};_0x1f17aa(++_0x18e372);}(_0x3dc9,0x164));var _0x93dc=function(_0x4883a2,_0x387e16){_0x4883a2=_0x4883a2-0x0;var _0x337ba4=_0x3dc9[_0x4883a2];return _0x337ba4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93dc('0x0'));var jsonpatch=require(_0x93dc('0x1'));var rp=require(_0x93dc('0x2'));var moment=require(_0x93dc('0x3'));var BPromise=require(_0x93dc('0x4'));var Mustache=require(_0x93dc('0x5'));var util=require(_0x93dc('0x6'));var path=require(_0x93dc('0x7'));var sox=require(_0x93dc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93dc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x93dc('0xa'));var jsforce=require(_0x93dc('0xb'));var deskjs=require(_0x93dc('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x93dc('0xd'));var Redis=require(_0x93dc('0xe'));var authService=require(_0x93dc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x93dc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93dc('0x11'))('api');var utils=require(_0x93dc('0x12'));var config=require(_0x93dc('0x13'));var licenseUtil=require(_0x93dc('0x14'));var db=require(_0x93dc('0x15'))['db'];function respondWithStatusCode(_0x509ea9,_0x23832a){_0x23832a=_0x23832a||0xcc;return function(_0x2760ef){if(_0x2760ef){return _0x509ea9['sendStatus'](_0x23832a);}return _0x509ea9[_0x93dc('0x16')](_0x23832a)[_0x93dc('0x17')]();};}function respondWithResult(_0x497822,_0x3617aa){_0x3617aa=_0x3617aa||0xc8;return function(_0x556462){if(_0x556462){return _0x497822['status'](_0x3617aa)[_0x93dc('0x18')](_0x556462);}};}function respondWithFilteredResult(_0x2c4785,_0x55343c){return function(_0x3312c1){if(_0x3312c1){var _0x453c12=typeof _0x55343c[_0x93dc('0x19')]===_0x93dc('0x1a')&&typeof _0x55343c[_0x93dc('0x1b')]===_0x93dc('0x1a');var _0x974b39=_0x3312c1[_0x93dc('0x1c')];var _0x1414fc=_0x453c12?0x0:_0x55343c['offset'];var _0x416ad6=_0x453c12?_0x3312c1[_0x93dc('0x1c')]:_0x55343c[_0x93dc('0x19')]+_0x55343c[_0x93dc('0x1b')];var _0xcb8c55;if(_0x416ad6>=_0x974b39){_0x416ad6=_0x974b39;_0xcb8c55=0xc8;}else{_0xcb8c55=0xce;}_0x2c4785['status'](_0xcb8c55);return _0x2c4785[_0x93dc('0x1d')](_0x93dc('0x1e'),_0x1414fc+'-'+_0x416ad6+'/'+_0x974b39)[_0x93dc('0x18')](_0x3312c1);}return null;};}function patchUpdates(_0x347582){return function(_0x342496){try{jsonpatch['apply'](_0x342496,_0x347582,!![]);}catch(_0x189d9f){return BPromise[_0x93dc('0x1f')](_0x189d9f);}return _0x342496[_0x93dc('0x20')]();};}function saveUpdates(_0x196ead,_0x5d0aa1){return function(_0x2c7ae2){if(_0x2c7ae2){return _0x2c7ae2['update'](_0x196ead)[_0x93dc('0x21')](function(_0x1e20a2){return _0x1e20a2;});}return null;};}function removeEntity(_0x2427ab,_0x90bf26){return function(_0x222a81){if(_0x222a81){return _0x222a81[_0x93dc('0x22')]()[_0x93dc('0x21')](function(){_0x2427ab['status'](0xcc)[_0x93dc('0x17')]();});}};}function handleEntityNotFound(_0x32a4bd,_0x214e10){return function(_0x338577){if(!_0x338577){_0x32a4bd[_0x93dc('0x23')](0x194);}return _0x338577;};}function handleError(_0x258070,_0xa82992){_0xa82992=_0xa82992||0x1f4;return function(_0x46dea4){logger[_0x93dc('0x24')](_0x46dea4['stack']);if(_0x46dea4[_0x93dc('0x25')]){delete _0x46dea4['name'];}_0x258070['status'](_0xa82992)[_0x93dc('0x26')](_0x46dea4);};}exports['index']=function(_0x5b7310,_0x3e6197){var _0x320261={},_0x40bc5a={},_0x2dc65b={'count':0x0,'rows':[]};var _0x237bdf=_[_0x93dc('0x27')](db[_0x93dc('0x28')]['rawAttributes'],function(_0x5f15b0){return{'name':_0x5f15b0[_0x93dc('0x29')],'type':_0x5f15b0[_0x93dc('0x2a')][_0x93dc('0x2b')]};});_0x40bc5a[_0x93dc('0x2c')]=_['map'](_0x237bdf,_0x93dc('0x25'));_0x40bc5a[_0x93dc('0x2d')]=_[_0x93dc('0x2e')](_0x5b7310[_0x93dc('0x2d')]);_0x40bc5a['filters']=_[_0x93dc('0x2f')](_0x40bc5a[_0x93dc('0x2c')],_0x40bc5a['query']);_0x320261[_0x93dc('0x30')]=_[_0x93dc('0x2f')](_0x40bc5a[_0x93dc('0x2c')],qs[_0x93dc('0x31')](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x31')]));_0x320261['attributes']=_0x320261[_0x93dc('0x30')][_0x93dc('0x32')]?_0x320261[_0x93dc('0x30')]:_0x40bc5a[_0x93dc('0x2c')];if(!_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x33')](_0x93dc('0x34'))){_0x320261[_0x93dc('0x1b')]=qs[_0x93dc('0x1b')](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x1b')]);_0x320261[_0x93dc('0x19')]=qs['offset'](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x19')]);}_0x320261[_0x93dc('0x35')]=qs[_0x93dc('0x36')](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x36')]);_0x320261['where']=qs[_0x93dc('0x37')](_['pick'](_0x5b7310[_0x93dc('0x2d')],_0x40bc5a[_0x93dc('0x37')]),_0x237bdf);if(_0x5b7310['query']['filter']){_0x320261[_0x93dc('0x38')]=_[_0x93dc('0x39')](_0x320261[_0x93dc('0x38')],{'$or':_[_0x93dc('0x27')](_0x237bdf,function(_0x766683){if(_0x766683[_0x93dc('0x2a')]!==_0x93dc('0x3a')){var _0x557f6e={};_0x557f6e[_0x766683[_0x93dc('0x25')]]={'$like':'%'+_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x3b')]+'%'};return _0x557f6e;}})});}_0x320261=_[_0x93dc('0x39')]({},_0x320261,_0x5b7310[_0x93dc('0x3c')]);var _0x43510c={'where':_0x320261[_0x93dc('0x38')]};return db[_0x93dc('0x28')][_0x93dc('0x1c')](_0x43510c)['then'](function(_0x5642b6){_0x2dc65b[_0x93dc('0x1c')]=_0x5642b6;if(_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x3d')]){_0x320261[_0x93dc('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x93dc('0x3f')](_0x320261);})[_0x93dc('0x21')](function(_0x118707){_0x2dc65b['rows']=_0x118707;return _0x2dc65b;})[_0x93dc('0x21')](respondWithFilteredResult(_0x3e6197,_0x320261))[_0x93dc('0x40')](handleError(_0x3e6197,null));};exports['show']=function(_0x114676,_0x386e7f){var _0x35da65={'raw':!![],'where':{'id':_0x114676['params']['id']}},_0x17c512={};_0x17c512[_0x93dc('0x2c')]=_[_0x93dc('0x2e')](db[_0x93dc('0x28')][_0x93dc('0x41')]);_0x17c512[_0x93dc('0x2d')]=_[_0x93dc('0x2e')](_0x114676[_0x93dc('0x2d')]);_0x17c512[_0x93dc('0x37')]=_[_0x93dc('0x2f')](_0x17c512['model'],_0x17c512[_0x93dc('0x2d')]);_0x35da65[_0x93dc('0x30')]=_['intersection'](_0x17c512[_0x93dc('0x2c')],qs[_0x93dc('0x31')](_0x114676[_0x93dc('0x2d')][_0x93dc('0x31')]));_0x35da65[_0x93dc('0x30')]=_0x35da65[_0x93dc('0x30')][_0x93dc('0x32')]?_0x35da65[_0x93dc('0x30')]:_0x17c512[_0x93dc('0x2c')];if(_0x114676[_0x93dc('0x2d')]['includeAll']){_0x35da65['include']=[{'all':!![]}];}_0x35da65=_[_0x93dc('0x39')]({},_0x35da65,_0x114676[_0x93dc('0x3c')]);return db[_0x93dc('0x28')][_0x93dc('0x42')](_0x35da65)['then'](handleEntityNotFound(_0x386e7f,null))['then'](respondWithResult(_0x386e7f,null))[_0x93dc('0x40')](handleError(_0x386e7f,null));};exports[_0x93dc('0x43')]=function(_0x2ccaa9,_0x57a423){if(_0x2ccaa9['body']['id']){delete _0x2ccaa9['body']['id'];}return db['CmHopperBlack'][_0x93dc('0x42')]({'where':{'id':_0x2ccaa9['params']['id']}})[_0x93dc('0x21')](handleEntityNotFound(_0x57a423,null))[_0x93dc('0x21')](saveUpdates(_0x2ccaa9[_0x93dc('0x44')],null))[_0x93dc('0x21')](respondWithResult(_0x57a423,null))[_0x93dc('0x40')](handleError(_0x57a423,null));};exports['destroy']=function(_0x34ed83,_0xea1da2){return db[_0x93dc('0x28')]['find']({'where':{'id':_0x34ed83[_0x93dc('0x45')]['id']}})[_0x93dc('0x21')](handleEntityNotFound(_0xea1da2,null))[_0x93dc('0x21')](removeEntity(_0xea1da2,null))[_0x93dc('0x40')](handleError(_0xea1da2,null));};exports[_0x93dc('0x46')]=function(_0x1fe042,_0x2dcac3){return db[_0x93dc('0x28')]['describe']()['then'](respondWithResult(_0x2dcac3,null))[_0x93dc('0x40')](handleError(_0x2dcac3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 59e7c32..6d0b105 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 _0x1c2c=['cm_hopper_black','util','../../config/logger','api','bluebird','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x1c2c,0x114));var _0xc1c2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1c2c[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xc1c2('0x0'));var logger=require(_0xc1c2('0x1'))(_0xc1c2('0x2'));var moment=require('moment');var BPromise=require(_0xc1c2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1c2('0x4'));var rimraf=require('rimraf');var config=require(_0xc1c2('0x5'));var attributes=require(_0xc1c2('0x6'));module[_0xc1c2('0x7')]=function(_0x19ca07,_0x2f0a52){return _0x19ca07[_0xc1c2('0x8')](_0xc1c2('0x9'),attributes,{'tableName':_0xc1c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x782a=['CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports'];(function(_0x581a8f,_0x3d274f){var _0x3729fa=function(_0x3842a7){while(--_0x3842a7){_0x581a8f['push'](_0x581a8f['shift']());}};_0x3729fa(++_0x3d274f);}(_0x782a,0x1a4));var _0xa782=function(_0x40d20e,_0x5518cd){_0x40d20e=_0x40d20e-0x0;var _0x8812de=_0x782a[_0x40d20e];return _0x8812de;};'use strict';var _=require(_0xa782('0x0'));var util=require('util');var logger=require(_0xa782('0x1'))(_0xa782('0x2'));var moment=require('moment');var BPromise=require(_0xa782('0x3'));var rp=require(_0xa782('0x4'));var fs=require('fs');var path=require(_0xa782('0x5'));var rimraf=require(_0xa782('0x6'));var config=require('../../config/environment');var attributes=require(_0xa782('0x7'));module[_0xa782('0x8')]=function(_0x9ba4e6,_0x228df2){return _0x9ba4e6['define'](_0xa782('0x9'),attributes,{'tableName':_0xa782('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 44927ff..9b6cdca 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 _0xec40=['error','code','message','catch','CmHopperBlack','findAll','options','where','limit','include','model','attributes','GetCmHopperBlack','UpdateCmHopperBlack','body','raw','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec40,0xaa));var _0x0ec4=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xec40[_0x2d994d];return _0xd54be4;};'use strict';var _=require(_0x0ec4('0x0'));var util=require(_0x0ec4('0x1'));var moment=require(_0x0ec4('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ec4('0x3'));var fs=require('fs');var Redis=require(_0x0ec4('0x4'));var db=require(_0x0ec4('0x5'))['db'];var utils=require(_0x0ec4('0x6'));var logger=require(_0x0ec4('0x7'))(_0x0ec4('0x8'));var config=require(_0x0ec4('0x9'));var jayson=require(_0x0ec4('0xa'));var client=jayson[_0x0ec4('0xb')][_0x0ec4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3482d1,_0x526b2b,_0x5219e0){return new BPromise(function(_0x5c7571,_0x23e39a){return client[_0x0ec4('0xd')](_0x3482d1,_0x5219e0)[_0x0ec4('0xe')](function(_0x21407c){logger[_0x0ec4('0xf')](_0x0ec4('0x10'),_0x526b2b,_0x0ec4('0x11'));logger[_0x0ec4('0x12')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x526b2b,_0x0ec4('0x11'),JSON[_0x0ec4('0x13')](_0x21407c));if(_0x21407c[_0x0ec4('0x14')]){if(_0x21407c[_0x0ec4('0x14')][_0x0ec4('0x15')]===0x1f4){logger[_0x0ec4('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x526b2b,_0x21407c['error'][_0x0ec4('0x16')]);return _0x23e39a(_0x21407c[_0x0ec4('0x14')][_0x0ec4('0x16')]);}logger[_0x0ec4('0x14')](_0x0ec4('0x10'),_0x526b2b,_0x21407c[_0x0ec4('0x14')][_0x0ec4('0x16')]);return _0x5c7571(_0x21407c[_0x0ec4('0x14')]['message']);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x526b2b,_0x0ec4('0x11'));_0x5c7571(_0x21407c['result'][_0x0ec4('0x16')]);}})[_0x0ec4('0x17')](function(_0x228f89){logger[_0x0ec4('0x14')](_0x0ec4('0x10'),_0x526b2b,_0x228f89);_0x23e39a(_0x228f89);});});}exports['GetCmHopperBlack']=function(_0x1fcdd1){var _0x2ac611=this;return new Promise(function(_0x42bdeb,_0x5da534){return db[_0x0ec4('0x18')][_0x0ec4('0x19')]({'raw':_0x1fcdd1[_0x0ec4('0x1a')]?_0x1fcdd1[_0x0ec4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1fcdd1['options']?_0x1fcdd1[_0x0ec4('0x1a')][_0x0ec4('0x1b')]||null:null,'attributes':_0x1fcdd1[_0x0ec4('0x1a')]?_0x1fcdd1['options']['attributes']||null:null,'limit':_0x1fcdd1[_0x0ec4('0x1a')]?_0x1fcdd1[_0x0ec4('0x1a')][_0x0ec4('0x1c')]||null:null,'include':_0x1fcdd1[_0x0ec4('0x1a')]?_0x1fcdd1[_0x0ec4('0x1a')][_0x0ec4('0x1d')]?_['map'](_0x1fcdd1[_0x0ec4('0x1a')]['include'],function(_0x150568){return{'model':db[_0x150568[_0x0ec4('0x1e')]],'as':_0x150568['as'],'attributes':_0x150568[_0x0ec4('0x1f')],'include':_0x150568['include']?_['map'](_0x150568['include'],function(_0x35ac7c){return{'model':db[_0x35ac7c[_0x0ec4('0x1e')]],'as':_0x35ac7c['as'],'attributes':_0x35ac7c[_0x0ec4('0x1f')],'include':_0x35ac7c[_0x0ec4('0x1d')]?_['map'](_0x35ac7c[_0x0ec4('0x1d')],function(_0x3dc2c9){return{'model':db[_0x3dc2c9[_0x0ec4('0x1e')]],'as':_0x3dc2c9['as'],'attributes':_0x3dc2c9[_0x0ec4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0ec4('0xe')](function(_0x3bceb5){logger[_0x0ec4('0xf')](_0x0ec4('0x20'),_0x1fcdd1);logger['debug'](_0x0ec4('0x20'),_0x1fcdd1,JSON[_0x0ec4('0x13')](_0x3bceb5));_0x42bdeb(_0x3bceb5);})[_0x0ec4('0x17')](function(_0x5714b4){logger[_0x0ec4('0x14')](_0x0ec4('0x20'),_0x5714b4[_0x0ec4('0x16')],_0x1fcdd1);_0x5da534(_0x2ac611[_0x0ec4('0x14')](0x1f4,_0x5714b4[_0x0ec4('0x16')]));});});};exports[_0x0ec4('0x21')]=function(_0x1ba4ef){var _0x25c4b8=this;return new Promise(function(_0xaa574f,_0x385b59){return db[_0x0ec4('0x18')]['update'](_0x1ba4ef[_0x0ec4('0x22')],{'raw':_0x1ba4ef[_0x0ec4('0x1a')]?_0x1ba4ef[_0x0ec4('0x1a')][_0x0ec4('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ba4ef[_0x0ec4('0x1a')]?_0x1ba4ef[_0x0ec4('0x1a')]['where']||null:null,'attributes':_0x1ba4ef['options']?_0x1ba4ef['options'][_0x0ec4('0x1f')]||null:null,'limit':_0x1ba4ef['options']?_0x1ba4ef[_0x0ec4('0x1a')][_0x0ec4('0x1c')]||null:null})[_0x0ec4('0xe')](function(_0x23b406){logger[_0x0ec4('0xf')](_0x0ec4('0x21'),_0x1ba4ef);logger[_0x0ec4('0x12')]('UpdateCmHopperBlack',_0x1ba4ef,JSON[_0x0ec4('0x13')](_0x23b406));_0xaa574f(_0x23b406);})[_0x0ec4('0x17')](function(_0x1ef6c3){logger[_0x0ec4('0x14')](_0x0ec4('0x21'),_0x1ef6c3['message'],_0x1ba4ef);_0x385b59(_0x25c4b8['error'](0x1f4,_0x1ef6c3[_0x0ec4('0x16')]));});});};exports[_0x0ec4('0x24')]=function(_0x40da72){var _0x16df4f=this;return new Promise(function(_0x48e5f4,_0x246e6e){return db['CmHopperBlack'][_0x0ec4('0x25')]({'where':_0x40da72[_0x0ec4('0x1a')]?_0x40da72[_0x0ec4('0x1a')][_0x0ec4('0x1b')]||null:null})[_0x0ec4('0xe')](function(_0x5a8145){logger[_0x0ec4('0xf')](_0x0ec4('0x24'),_0x40da72);logger[_0x0ec4('0x12')](_0x0ec4('0x24'),_0x40da72,JSON[_0x0ec4('0x13')](_0x5a8145));_0x48e5f4(_0x5a8145);})[_0x0ec4('0x17')](function(_0x8c2f4){logger[_0x0ec4('0x14')](_0x0ec4('0x24'),_0x8c2f4[_0x0ec4('0x16')],_0x40da72);_0x246e6e(_0x16df4f[_0x0ec4('0x14')](0x1f4,_0x8c2f4[_0x0ec4('0x16')]));});});}; \ No newline at end of file +var _0xed2f=['result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','map','include','model','attributes','info','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message'];(function(_0x3429b9,_0x2624f2){var _0x31e4f6=function(_0x1b2741){while(--_0x1b2741){_0x3429b9['push'](_0x3429b9['shift']());}};_0x31e4f6(++_0x2624f2);}(_0xed2f,0x14b));var _0xfed2=function(_0x50c2a9,_0x49ed47){_0x50c2a9=_0x50c2a9-0x0;var _0x205bd7=_0xed2f[_0x50c2a9];return _0x205bd7;};'use strict';var _=require(_0xfed2('0x0'));var util=require(_0xfed2('0x1'));var moment=require(_0xfed2('0x2'));var BPromise=require(_0xfed2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfed2('0x4'));var db=require(_0xfed2('0x5'))['db'];var utils=require(_0xfed2('0x6'));var logger=require(_0xfed2('0x7'))(_0xfed2('0x8'));var config=require(_0xfed2('0x9'));var jayson=require(_0xfed2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7a12b2,_0x1e1b9c,_0x427930){return new BPromise(function(_0x276d32,_0x41250e){return client['request'](_0x7a12b2,_0x427930)[_0xfed2('0xb')](function(_0x57807a){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x1e1b9c,'request\x20sent');logger[_0xfed2('0xc')](_0xfed2('0xd'),_0x1e1b9c,_0xfed2('0xe'),JSON[_0xfed2('0xf')](_0x57807a));if(_0x57807a[_0xfed2('0x10')]){if(_0x57807a['error'][_0xfed2('0x11')]===0x1f4){logger[_0xfed2('0x10')](_0xfed2('0x12'),_0x1e1b9c,_0x57807a['error'][_0xfed2('0x13')]);return _0x41250e(_0x57807a[_0xfed2('0x10')][_0xfed2('0x13')]);}logger[_0xfed2('0x10')](_0xfed2('0x12'),_0x1e1b9c,_0x57807a[_0xfed2('0x10')][_0xfed2('0x13')]);return _0x276d32(_0x57807a[_0xfed2('0x10')][_0xfed2('0x13')]);}else{logger['info'](_0xfed2('0x12'),_0x1e1b9c,_0xfed2('0xe'));_0x276d32(_0x57807a[_0xfed2('0x14')][_0xfed2('0x13')]);}})[_0xfed2('0x15')](function(_0x327018){logger['error'](_0xfed2('0x12'),_0x1e1b9c,_0x327018);_0x41250e(_0x327018);});});}exports[_0xfed2('0x16')]=function(_0x5616fd){var _0x45dfbd=this;return new Promise(function(_0x2156c4,_0x3eebbb){return db[_0xfed2('0x17')][_0xfed2('0x18')]({'raw':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1a')]===undefined?!![]:![]:!![],'where':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1b')]||null:null,'attributes':_0x5616fd[_0xfed2('0x19')]?_0x5616fd['options']['attributes']||null:null,'limit':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1c')]||null:null,'include':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')]['include']?_[_0xfed2('0x1d')](_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1e')],function(_0x27a655){return{'model':db[_0x27a655[_0xfed2('0x1f')]],'as':_0x27a655['as'],'attributes':_0x27a655[_0xfed2('0x20')],'include':_0x27a655[_0xfed2('0x1e')]?_['map'](_0x27a655['include'],function(_0x1cf1b6){return{'model':db[_0x1cf1b6[_0xfed2('0x1f')]],'as':_0x1cf1b6['as'],'attributes':_0x1cf1b6[_0xfed2('0x20')],'include':_0x1cf1b6[_0xfed2('0x1e')]?_[_0xfed2('0x1d')](_0x1cf1b6['include'],function(_0xb29b9f){return{'model':db[_0xb29b9f[_0xfed2('0x1f')]],'as':_0xb29b9f['as'],'attributes':_0xb29b9f[_0xfed2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfed2('0xb')](function(_0x5741f4){logger[_0xfed2('0x21')](_0xfed2('0x16'),_0x5616fd);logger['debug']('GetCmHopperBlack',_0x5616fd,JSON[_0xfed2('0xf')](_0x5741f4));_0x2156c4(_0x5741f4);})[_0xfed2('0x15')](function(_0x6e1199){logger[_0xfed2('0x10')](_0xfed2('0x16'),_0x6e1199[_0xfed2('0x13')],_0x5616fd);_0x3eebbb(_0x45dfbd['error'](0x1f4,_0x6e1199[_0xfed2('0x13')]));});});};exports[_0xfed2('0x22')]=function(_0x28d530){var _0x4e939b=this;return new Promise(function(_0x4418dd,_0x2637b2){return db[_0xfed2('0x17')][_0xfed2('0x23')](_0x28d530[_0xfed2('0x24')],{'raw':_0x28d530[_0xfed2('0x19')]?_0x28d530['options'][_0xfed2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28d530['options']?_0x28d530[_0xfed2('0x19')]['where']||null:null,'attributes':_0x28d530['options']?_0x28d530[_0xfed2('0x19')][_0xfed2('0x20')]||null:null,'limit':_0x28d530[_0xfed2('0x19')]?_0x28d530['options'][_0xfed2('0x1c')]||null:null})[_0xfed2('0xb')](function(_0x4d806f){logger[_0xfed2('0x21')](_0xfed2('0x22'),_0x28d530);logger['debug'](_0xfed2('0x22'),_0x28d530,JSON[_0xfed2('0xf')](_0x4d806f));_0x4418dd(_0x4d806f);})[_0xfed2('0x15')](function(_0x2e2509){logger[_0xfed2('0x10')](_0xfed2('0x22'),_0x2e2509['message'],_0x28d530);_0x2637b2(_0x4e939b[_0xfed2('0x10')](0x1f4,_0x2e2509[_0xfed2('0x13')]));});});};exports[_0xfed2('0x25')]=function(_0x5157b9){var _0x41c809=this;return new Promise(function(_0x2a9e59,_0x16de10){return db[_0xfed2('0x17')][_0xfed2('0x26')]({'where':_0x5157b9[_0xfed2('0x19')]?_0x5157b9[_0xfed2('0x19')]['where']||null:null})['then'](function(_0x370bab){logger[_0xfed2('0x21')](_0xfed2('0x25'),_0x5157b9);logger[_0xfed2('0xc')](_0xfed2('0x25'),_0x5157b9,JSON['stringify'](_0x370bab));_0x2a9e59(_0x370bab);})['catch'](function(_0x561dfa){logger[_0xfed2('0x10')](_0xfed2('0x25'),_0x561dfa[_0xfed2('0x13')],_0x5157b9);_0x16de10(_0x41c809['error'](0x1f4,_0x561dfa['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 202415a..14b0250 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 _0x32f4=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','show','put','/:id','delete','exports'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x32f4,0x154));var _0x432f=function(_0x31f396,_0x1e8351){_0x31f396=_0x31f396-0x0;var _0x3ab7e7=_0x32f4[_0x31f396];return _0x3ab7e7;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['describe']);router[_0x432f('0x9')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0xd')](_0x432f('0xe'),auth[_0x432f('0xa')](),controller['update']);router[_0x432f('0xf')]('/:id',auth[_0x432f('0xa')](),controller['destroy']);module[_0x432f('0x10')]=router; \ No newline at end of file +var _0xc2c7=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','update','delete'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xc2c7,0x134));var _0x7c2c=function(_0x34d9a2,_0x167cdb){_0x34d9a2=_0x34d9a2-0x0;var _0x5727ad=_0xc2c7[_0x34d9a2];return _0x5727ad;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['put'](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);module[_0x7c2c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7d7d948..5eefb76 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 _0xec46=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','BOOLEAN','sequelize','moment','INTEGER'];(function(_0xd3cffb,_0x34f60c){var _0x34ff2a=function(_0x257f0a){while(--_0x257f0a){_0xd3cffb['push'](_0xd3cffb['shift']());}};_0x34ff2a(++_0x34f60c);}(_0xec46,0x131));var _0x6ec4=function(_0x4812c9,_0x154b76){_0x4812c9=_0x4812c9-0x0;var _0x4de61f=_0xec46[_0x4812c9];return _0x4de61f;};'use strict';var Sequelize=require(_0x6ec4('0x0'));var moment=require(_0x6ec4('0x1'));module['exports']={'state':{'type':Sequelize[_0x6ec4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6ec4('0x3')]},'scheduledat':{'type':Sequelize[_0x6ec4('0x4')]},'countbusyretry':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6ec4('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6ec4('0x3')]},'originatecalleridname':{'type':Sequelize[_0x6ec4('0x3')]},'calleridnum':{'type':Sequelize[_0x6ec4('0x3')]},'calleridname':{'type':Sequelize[_0x6ec4('0x3')]},'starttime':{'type':Sequelize[_0x6ec4('0x4')]},'responsetime':{'type':Sequelize[_0x6ec4('0x4')]},'answertime':{'type':Sequelize[_0x6ec4('0x4')]},'droptime':{'type':Sequelize[_0x6ec4('0x4')]},'endtime':{'type':Sequelize[_0x6ec4('0x4')]},'ringtime':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6ec4('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6ec4('0x3')]},'membername':{'type':Sequelize[_0x6ec4('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6ec4('0x3')]},'secondDisposition':{'type':Sequelize[_0x6ec4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6ec4('0x4')],'set':function(_0x4db420){var _0x38d4da=this[_0x6ec4('0x5')](_0x6ec4('0x6'));if(_0x38d4da&&_0x4db420){this[_0x6ec4('0x7')](_0x6ec4('0x8'),moment(_0x4db420)[_0x6ec4('0x9')](moment(_0x38d4da),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6ec4('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x6ec4('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6ec4('0x4')]},'deleted':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6ec4('0x4')]},'recallme':{'type':Sequelize[_0x6ec4('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6ec4('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x56a2=['diff','BOOLEAN','sequelize','moment','INTEGER','DATE','STRING','setDataValue','followuptime'];(function(_0x267cf4,_0xcbcf72){var _0x4824cf=function(_0x3e53d6){while(--_0x3e53d6){_0x267cf4['push'](_0x267cf4['shift']());}};_0x4824cf(++_0xcbcf72);}(_0x56a2,0x158));var _0x256a=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x56a2[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require(_0x256a('0x0'));var moment=require(_0x256a('0x1'));module['exports']={'state':{'type':Sequelize[_0x256a('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x256a('0x3')]},'countbusyretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x256a('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x256a('0x4')]},'originatecalleridname':{'type':Sequelize[_0x256a('0x4')]},'calleridnum':{'type':Sequelize[_0x256a('0x4')]},'calleridname':{'type':Sequelize[_0x256a('0x4')]},'starttime':{'type':Sequelize[_0x256a('0x3')]},'responsetime':{'type':Sequelize[_0x256a('0x3')]},'answertime':{'type':Sequelize[_0x256a('0x3')]},'droptime':{'type':Sequelize[_0x256a('0x3')]},'endtime':{'type':Sequelize[_0x256a('0x3')]},'ringtime':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x256a('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x256a('0x4')]},'membername':{'type':Sequelize[_0x256a('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x256a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x256a('0x4')]},'dispositionat':{'type':Sequelize[_0x256a('0x3')],'set':function(_0x168bd1){var _0x4baab3=this['getDataValue']('endtime');if(_0x4baab3&&_0x168bd1){this[_0x256a('0x5')](_0x256a('0x6'),moment(_0x168bd1)[_0x256a('0x7')](moment(_0x4baab3),'seconds'));}}},'amd':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x256a('0x3')]},'callback':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x256a('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x256a('0x3')]},'deleted':{'type':Sequelize[_0x256a('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x256a('0x3')]},'recallme':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 8c6653e..7a881b9 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 _0x9536=['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','CmHopperFinal','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ListId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ListId)','CampaignId\x20=\x20?','cm_hopper_final','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x5411de,_0x38e366){var _0x2c7160=function(_0x335287){while(--_0x335287){_0x5411de['push'](_0x5411de['shift']());}};_0x2c7160(++_0x38e366);}(_0x9536,0x179));var _0x6953=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x9536[_0x5447aa];return _0xb21e53;};'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['CmHopperFinal'][_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['describe']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['describe']()[_0x6953('0x3c')](respondWithResult(_0x1d5979,null))[_0x6953('0x41')](handleError(_0x1d5979,null));};exports['update']=function(_0x525145,_0xbf5b61){if(_0x525145[_0x6953('0x48')][_0x6953('0x49')]){delete _0x525145[_0x6953('0x48')][_0x6953('0x49')];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'uniqueid':_0x525145[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xbf5b61,null))[_0x6953('0x3c')](saveUpdates(_0x525145[_0x6953('0x48')],null))['then'](respondWithResult(_0xbf5b61,null))['catch'](handleError(_0xbf5b61,null));};exports[_0x6953('0x4a')]=function(_0x38e3e8,_0x68ab5d,_0x7bcd92){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x38e3e8[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db['sequelize']['fn']('COUNT',db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db['sequelize']['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db['sequelize']['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x57')))),'reCallContacts'],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x58')))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x68ab5d,null))['then'](respondWithResult(_0x68ab5d,null))[_0x6953('0x41')](handleError(_0x68ab5d,null));};exports[_0x6953('0x5a')]=function(_0x35ac0e,_0x57ffab,_0x479ab4){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'CampaignId':_0x35ac0e[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5b')))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5c')))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5d')))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x57')))),_0x6953('0x5e')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x57ffab,null))['then'](respondWithResult(_0x57ffab,null))[_0x6953('0x41')](handleError(_0x57ffab,null));};exports[_0x6953('0x5f')]=function(_0x41d74d,_0x5063ac,_0x4cb8a4){return db[_0x6953('0x60')][_0x6953('0x47')]({'where':{'id':_0x41d74d[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x5063ac,null))[_0x6953('0x3c')](function(_0x43a39f){var _0x3cf1c0;if(_0x43a39f){_0x3cf1c0=squel[_0x6953('0x61')]()[_0x6953('0x62')]('cm_hopper')[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),_0x6953('0x66'),'ListId',_0x6953('0x67'),_0x6953('0x68'),_0x6953('0x69')],squel['select']()[_0x6953('0x6a')](_0x6953('0x6b'),_0x6953('0x64'))[_0x6953('0x6a')]('NOW()',_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field']('ANY_VALUE(ListId)',_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x68'))[_0x6953('0x6a')]('NOW()',_0x6953('0x69'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id']['toString']())['where'](_0x6953('0x71'),_0x41d74d[_0x6953('0x48')][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x64'))[_0x6953('0x6f')](_0x6953('0x76'))[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id'][_0x6953('0x73')]()))['where'](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x77'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))['group'](_0x6953('0x66')))[_0x6953('0x73')]();return db[_0x6953('0x4b')][_0x6953('0x2e')](_0x3cf1c0);}return[];})[_0x6953('0x3c')](respondWithResult(_0x5063ac,null))[_0x6953('0x41')](handleError(_0x5063ac,null));};exports[_0x6953('0x79')]=function(_0xa26241,_0xefb593,_0x216b92){return db[_0x6953('0x7a')]['find']({'where':{'id':_0xa26241[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xefb593,null))[_0x6953('0x3c')](function(_0x396a9f){var _0x92c0bc;if(_0x396a9f){_0x92c0bc=squel[_0x6953('0x61')]()[_0x6953('0x62')](_0x6953('0x76'))[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),'ContactId',_0x6953('0x6d'),_0x6953('0x7b'),_0x6953('0x68'),'updatedAt'],squel[_0x6953('0x7c')]()['field']('ANY_VALUE(calleridnum)',_0x6953('0x64'))[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field'](_0x6953('0x7d'),_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(CampaignId)',_0x6953('0x7b'))[_0x6953('0x6a')]('NOW()',_0x6953('0x68'))['field']('NOW()',_0x6953('0x69'))['from']('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id']['toString']())[_0x6953('0x39')](_0x6953('0x71'),_0xa26241['body'][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x64'))['from'](_0x6953('0x76'))[_0x6953('0x39')]('CampaignId\x20=\x20?',_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]()))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x77'))['from'](_0x6953('0x7f'))[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))[_0x6953('0x80')](_0x6953('0x66')))['toString']();return db[_0x6953('0x4b')]['query'](_0x92c0bc);}return[];})[_0x6953('0x3c')](respondWithResult(_0xefb593,null))['catch'](handleError(_0xefb593,null));};exports[_0x6953('0x81')]=function(_0x7215ed,_0x3cb96a,_0x46bcec){return db[_0x6953('0x82')]['findOne']({'where':{'VoiceQueueId':_0x7215ed[_0x6953('0x48')]['VoiceQueueId'],'CampaignId':_0x7215ed[_0x6953('0x48')][_0x6953('0x7b')],'ContactId':_0x7215ed[_0x6953('0x48')][_0x6953('0x66')]}})['then'](handleEntityNotFound(_0x3cb96a,null))[_0x6953('0x3c')](function(_0x50f019){if(_0x50f019){return _0x50f019;}return null;})[_0x6953('0x3c')](respondWithResult(_0x3cb96a,null))[_0x6953('0x41')](handleError(_0x3cb96a,null));}; \ No newline at end of file +var _0x4c60=['include','findAll','rows','catch','show','includeAll','find','describe','update','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','VoiceQueue','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','CmHopperFinal','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x480326,_0x3f7891){var _0x288327=function(_0x3ae295){while(--_0x3ae295){_0x480326['push'](_0x480326['shift']());}};_0x288327(++_0x3f7891);}(_0x4c60,0xc1));var _0x04c6=function(_0x5b2e19,_0x46636e){_0x5b2e19=_0x5b2e19-0x0;var _0x4c36c1=_0x4c60[_0x5b2e19];return _0x4c36c1;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['CmHopperFinal'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['CmHopperFinal'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['CmHopperFinal'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')]()['then'](respondWithResult(_0x4ef366,null))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0x2472ed,_0xee2822){if(_0x2472ed['body'][_0x04c6('0x44')]){delete _0x2472ed[_0x04c6('0x45')][_0x04c6('0x44')];}return db[_0x04c6('0x27')]['find']({'where':{'uniqueid':_0x2472ed[_0x04c6('0x46')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0xee2822,null))[_0x04c6('0x1f')](saveUpdates(_0x2472ed[_0x04c6('0x45')],null))['then'](respondWithResult(_0xee2822,null))[_0x04c6('0x3e')](handleError(_0xee2822,null));};exports[_0x04c6('0x47')]=function(_0x15ec61,_0x489361,_0x3119f0){return db[_0x04c6('0x27')][_0x04c6('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x15ec61[_0x04c6('0x46')]['id']},'attributes':[[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4b')))),_0x04c6('0x4c')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),_0x04c6('0x55')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x56')))),'answeringMachine']]})[_0x04c6('0x1f')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x1f')](respondWithResult(_0x489361,null))[_0x04c6('0x3e')](handleError(_0x489361,null));};exports[_0x04c6('0x57')]=function(_0x28299e,_0x5b536f,_0xf073a8){return db[_0x04c6('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x28299e[_0x04c6('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize']['literal'](_0x04c6('0x4b')))),'noSuchContacts'],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x04c6('0x58')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x59')))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),'reCallContacts'],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x56')))),_0x04c6('0x5a')]]})[_0x04c6('0x1f')](handleEntityNotFound(_0x5b536f,null))[_0x04c6('0x1f')](respondWithResult(_0x5b536f,null))[_0x04c6('0x3e')](handleError(_0x5b536f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x31cc93,_0x1b6242,_0x1f5b9a){return db[_0x04c6('0x5b')][_0x04c6('0x41')]({'where':{'id':_0x31cc93['params']['id']}})['then'](handleEntityNotFound(_0x1b6242,null))[_0x04c6('0x1f')](function(_0x598941){var _0x2df63b;if(_0x598941){_0x2df63b=squel['insert']()[_0x04c6('0x5c')](_0x04c6('0x5d'))['fromQuery']([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),_0x04c6('0x64')],squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),'scheduledAt')[_0x04c6('0x66')](_0x04c6('0x69'),'ContactId')[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))[_0x04c6('0x66')](_0x04c6('0x6b'),'VoiceQueueId')[_0x04c6('0x66')]('NOW()',_0x04c6('0x63'))['field'](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())[_0x04c6('0x35')]('state\x20=\x20?',_0x31cc93[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x04c6('0x35')](_0x04c6('0x71'),squel['select']()[_0x04c6('0x66')](_0x04c6('0x5e'))['from'](_0x04c6('0x5d'))[_0x04c6('0x35')]('VoiceQueueId\x20=\x20?',_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()['field']('calleridnum')['from'](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where'](_0x04c6('0x72')))[_0x04c6('0x73')](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db[_0x04c6('0x48')][_0x04c6('0x2b')](_0x2df63b);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x1b6242,null))['catch'](handleError(_0x1b6242,null));};exports[_0x04c6('0x74')]=function(_0x4f258c,_0x202761,_0x480c74){return db['Campaign'][_0x04c6('0x41')]({'where':{'id':_0x4f258c['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x202761,null))[_0x04c6('0x1f')](function(_0x174de6){var _0x425d01;if(_0x174de6){_0x425d01=squel[_0x04c6('0x75')]()['into']('cm_hopper')[_0x04c6('0x76')]([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x77'),'createdAt',_0x04c6('0x64')],squel['select']()['field'](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x5f'))[_0x04c6('0x66')](_0x04c6('0x69'),_0x04c6('0x60'))[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))['field'](_0x04c6('0x78'),'CampaignId')['field'](_0x04c6('0x68'),_0x04c6('0x63'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x20?',_0x4f258c[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')](_0x04c6('0x7a'))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x5e'))[_0x04c6('0x6c')](_0x04c6('0x5d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c['params']['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x7b'))[_0x04c6('0x6c')](_0x04c6('0x6d'))['where'](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x204'))['group'](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db['sequelize'][_0x04c6('0x2b')](_0x425d01);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x202761,null))[_0x04c6('0x3e')](handleError(_0x202761,null));};exports['checkContactHopper']=function(_0x343c1f,_0x485457,_0x1c0c74){return db[_0x04c6('0x7c')][_0x04c6('0x7d')]({'where':{'VoiceQueueId':_0x343c1f['body']['VoiceQueueId'],'CampaignId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x77')],'ContactId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x60')]}})['then'](handleEntityNotFound(_0x485457,null))['then'](function(_0x3e12a4){if(_0x3e12a4){return _0x3e12a4;}return null;})[_0x04c6('0x1f')](respondWithResult(_0x485457,null))[_0x04c6('0x3e')](handleError(_0x485457,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 91a82db..08ff6a7 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 _0xaa58=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','lodash','util','../../config/logger','api','request-promise'];(function(_0x46665f,_0xf02237){var _0x250f85=function(_0x4a319e){while(--_0x4a319e){_0x46665f['push'](_0x46665f['shift']());}};_0x250f85(++_0xf02237);}(_0xaa58,0xff));var _0x8aa5=function(_0x21e7a1,_0xea0615){_0x21e7a1=_0x21e7a1-0x0;var _0xcfa778=_0xaa58[_0x21e7a1];return _0xcfa778;};'use strict';var _=require(_0x8aa5('0x0'));var util=require(_0x8aa5('0x1'));var logger=require(_0x8aa5('0x2'))(_0x8aa5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8aa5('0x4'));var fs=require('fs');var path=require(_0x8aa5('0x5'));var rimraf=require(_0x8aa5('0x6'));var config=require(_0x8aa5('0x7'));var attributes=require(_0x8aa5('0x8'));module[_0x8aa5('0x9')]=function(_0x50e68a,_0x2fee11){return _0x50e68a['define'](_0x8aa5('0xa'),attributes,{'tableName':_0x8aa5('0xb'),'paranoid':![],'indexes':[{'name':_0x8aa5('0xc'),'fields':[_0x8aa5('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x65d7=['path','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','request-promise'];(function(_0x166f63,_0x47ed87){var _0x51862b=function(_0x378ec8){while(--_0x378ec8){_0x166f63['push'](_0x166f63['shift']());}};_0x51862b(++_0x47ed87);}(_0x65d7,0x70));var _0x765d=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x65d7[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x765d('0x0'));var util=require(_0x765d('0x1'));var logger=require('../../config/logger')(_0x765d('0x2'));var moment=require(_0x765d('0x3'));var BPromise=require('bluebird');var rp=require(_0x765d('0x4'));var fs=require('fs');var path=require(_0x765d('0x5'));var rimraf=require('rimraf');var config=require(_0x765d('0x6'));var attributes=require(_0x765d('0x7'));module['exports']=function(_0x3a465e,_0x3ee63d){return _0x3a465e[_0x765d('0x8')](_0x765d('0x9'),attributes,{'tableName':_0x765d('0xa'),'paranoid':![],'indexes':[{'name':_0x765d('0xb'),'fields':[_0x765d('0xb')]},{'name':_0x765d('0xc'),'fields':[_0x765d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 8c8bd0d..30c0c9f 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(_0x25c2d7,_0x3d86a0){var _0x32fbc2=function(_0x3e7e3e){while(--_0x3e7e3e){_0x25c2d7['push'](_0x25c2d7['shift']());}};_0x32fbc2(++_0x3d86a0);}(_0x7a54,0x106));var _0x47a5=function(_0x258cd3,_0x121991){_0x258cd3=_0x258cd3-0x0;var _0x5eff60=_0x7a54[_0x258cd3];return _0x5eff60;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x59df8b,_0xa63331){var _0x18f62c=function(_0x58986f){while(--_0x58986f){_0x59df8b['push'](_0x59df8b['shift']());}};_0x18f62c(++_0xa63331);}(_0xb10b,0x12a));var _0xbb10=function(_0x382500,_0x43e04e){_0x382500=_0x382500-0x0;var _0x4aa842=_0xb10b[_0x382500];return _0x4aa842;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index bf7773a..d1af4a9 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 _0xa405=['fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','util','path','express','Router'];(function(_0x382a03,_0x1b43f1){var _0x1794e0=function(_0x3816){while(--_0x3816){_0x382a03['push'](_0x382a03['shift']());}};_0x1794e0(++_0x1b43f1);}(_0xa405,0x1ca));var _0x5a40=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa405[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x5a40('0x0'));var path=require(_0x5a40('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a40('0x2'));var router=express[_0x5a40('0x3')]();var fs_extra=require(_0x5a40('0x4'));var auth=require(_0x5a40('0x5'));var interaction=require(_0x5a40('0x6'));var config=require('../../config/environment');var controller=require(_0x5a40('0x7'));router[_0x5a40('0x8')]('/',auth[_0x5a40('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5a40('0xa')]);router[_0x5a40('0x8')](_0x5a40('0xb'),auth[_0x5a40('0x9')](),controller[_0x5a40('0xc')]);router[_0x5a40('0x8')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x5a40('0x8')]('/campaign/countAttributes/:id',auth[_0x5a40('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x5a40('0xd')]('/voice/queue/moveContacts/:id',auth[_0x5a40('0x9')](),controller[_0x5a40('0xe')]);router['post'](_0x5a40('0xf'),auth[_0x5a40('0x9')](),controller[_0x5a40('0x10')]);router['post'](_0x5a40('0x11'),auth[_0x5a40('0x9')](),controller[_0x5a40('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5a40('0x13')]);module[_0x5a40('0x14')]=router; \ No newline at end of file +var _0xf88a=['post','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal'];(function(_0x3cd89a,_0x5bb576){var _0x173d52=function(_0x3ad8d3){while(--_0x3ad8d3){_0x3cd89a['push'](_0x3cd89a['shift']());}};_0x173d52(++_0x5bb576);}(_0xf88a,0x1e8));var _0xaf88=function(_0x408457,_0x1e0b2e){_0x408457=_0x408457-0x0;var _0x194afd=_0xf88a[_0x408457];return _0x194afd;};'use strict';var multer=require(_0xaf88('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaf88('0x1'));var express=require(_0xaf88('0x2'));var router=express['Router']();var fs_extra=require(_0xaf88('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xaf88('0x4'));var config=require(_0xaf88('0x5'));var controller=require(_0xaf88('0x6'));router[_0xaf88('0x7')]('/',auth[_0xaf88('0x8')](),controller[_0xaf88('0x9')]);router[_0xaf88('0x7')](_0xaf88('0xa'),auth[_0xaf88('0x8')](),controller['describe']);router[_0xaf88('0x7')](_0xaf88('0xb'),auth[_0xaf88('0x8')](),controller[_0xaf88('0xc')]);router['get'](_0xaf88('0xd'),auth[_0xaf88('0x8')](),controller[_0xaf88('0xe')]);router[_0xaf88('0x7')]('/campaign/countAttributes/:id',auth[_0xaf88('0x8')](),controller[_0xaf88('0xf')]);router['post'](_0xaf88('0x10'),auth[_0xaf88('0x8')](),controller[_0xaf88('0x11')]);router[_0xaf88('0x12')]('/voice/campaign/moveContacts/:id',auth[_0xaf88('0x8')](),controller[_0xaf88('0x13')]);router['post'](_0xaf88('0x14'),auth[_0xaf88('0x8')](),controller[_0xaf88('0x15')]);router['put'](_0xaf88('0xb'),auth[_0xaf88('0x8')](),controller[_0xaf88('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index eb10428..8ccb4b9 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 _0xe148=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe148,0x16b));var _0x8e14=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xe148[_0x4bd06e];return _0x85ebb;};'use strict';var Sequelize=require('sequelize');module[_0x8e14('0x0')]={'state':{'type':Sequelize[_0x8e14('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x8e14('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8e14('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x8e14('0x2')]},'calleridnum':{'type':Sequelize[_0x8e14('0x2')]},'calleridname':{'type':Sequelize[_0x8e14('0x2')]},'starttime':{'type':Sequelize[_0x8e14('0x3')]},'responsetime':{'type':Sequelize[_0x8e14('0x3')]},'answertime':{'type':Sequelize[_0x8e14('0x3')]},'droptime':{'type':Sequelize[_0x8e14('0x3')]},'endtime':{'type':Sequelize[_0x8e14('0x3')]},'ringtime':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8e14('0x2')]},'campaign':{'type':Sequelize[_0x8e14('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8e14('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x8e14('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8e14('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x8e14('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8e14('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8e14('0x3')]},'edited':{'type':Sequelize[_0x8e14('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8e14('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6bd7=['exports','STRING','INTEGER','DATE','BOOLEAN','sequelize'];(function(_0xc8b023,_0x1033ea){var _0xf7a930=function(_0x331771){while(--_0x331771){_0xc8b023['push'](_0xc8b023['shift']());}};_0xf7a930(++_0x1033ea);}(_0x6bd7,0x71));var _0x76bd=function(_0x555bbd,_0x196748){_0x555bbd=_0x555bbd-0x0;var _0x3184d7=_0x6bd7[_0x555bbd];return _0x3184d7;};'use strict';var Sequelize=require(_0x76bd('0x0'));module[_0x76bd('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x76bd('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x76bd('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x76bd('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x76bd('0x4')]},'endtime':{'type':Sequelize[_0x76bd('0x4')]},'ringtime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x76bd('0x2')]},'campaign':{'type':Sequelize[_0x76bd('0x2')]},'campaigntype':{'type':Sequelize[_0x76bd('0x2')]},'membername':{'type':Sequelize[_0x76bd('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x76bd('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x76bd('0x4')]},'edited':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x76bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index c232f17..aaf1c3a 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 _0xe712=['find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','index','CmHopperHistory','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll'];(function(_0x26fc5e,_0x25dad2){var _0x296a36=function(_0xebf4ae){while(--_0xebf4ae){_0x26fc5e['push'](_0x26fc5e['shift']());}};_0x296a36(++_0x25dad2);}(_0xe712,0x1a9));var _0x2e71=function(_0x2a1e11,_0x35312c){_0x2a1e11=_0x2a1e11-0x0;var _0x4d545e=_0xe712[_0x2a1e11];return _0x4d545e;};'use strict';var emlformat=require(_0x2e71('0x0'));var rimraf=require(_0x2e71('0x1'));var zipdir=require(_0x2e71('0x2'));var jsonpatch=require(_0x2e71('0x3'));var rp=require(_0x2e71('0x4'));var moment=require(_0x2e71('0x5'));var BPromise=require(_0x2e71('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2e71('0x7'));var sox=require('sox');var csv=require(_0x2e71('0x8'));var ejs=require(_0x2e71('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e71('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2e71('0xb'));var deskjs=require(_0x2e71('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2e71('0xd'));var Papa=require(_0x2e71('0xe'));var Redis=require('ioredis');var authService=require(_0x2e71('0xf'));var qs=require(_0x2e71('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e71('0x11'));var logger=require(_0x2e71('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2e71('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bbc3b,_0x3b15a7){_0x3b15a7=_0x3b15a7||0xcc;return function(_0x5e47a7){if(_0x5e47a7){return _0x5bbc3b[_0x2e71('0x14')](_0x3b15a7);}return _0x5bbc3b['status'](_0x3b15a7)[_0x2e71('0x15')]();};}function respondWithResult(_0x7a8bec,_0x5e950e){_0x5e950e=_0x5e950e||0xc8;return function(_0x17fddb){if(_0x17fddb){return _0x7a8bec[_0x2e71('0x16')](_0x5e950e)[_0x2e71('0x17')](_0x17fddb);}};}function respondWithFilteredResult(_0x52dbaf,_0x4e5018){return function(_0xc3f339){if(_0xc3f339){var _0x9a6905=typeof _0x4e5018[_0x2e71('0x18')]===_0x2e71('0x19')&&typeof _0x4e5018[_0x2e71('0x1a')]===_0x2e71('0x19');var _0x3227e9=_0xc3f339['count'];var _0x4000cf=_0x9a6905?0x0:_0x4e5018['offset'];var _0x12e35e=_0x9a6905?_0xc3f339[_0x2e71('0x1b')]:_0x4e5018['offset']+_0x4e5018[_0x2e71('0x1a')];var _0x132755;if(_0x12e35e>=_0x3227e9){_0x12e35e=_0x3227e9;_0x132755=0xc8;}else{_0x132755=0xce;}_0x52dbaf['status'](_0x132755);return _0x52dbaf[_0x2e71('0x1c')](_0x2e71('0x1d'),_0x4000cf+'-'+_0x12e35e+'/'+_0x3227e9)[_0x2e71('0x17')](_0xc3f339);}return null;};}function patchUpdates(_0x1bc64c){return function(_0x331082){try{jsonpatch[_0x2e71('0x1e')](_0x331082,_0x1bc64c,!![]);}catch(_0x1d2c19){return BPromise['reject'](_0x1d2c19);}return _0x331082[_0x2e71('0x1f')]();};}function saveUpdates(_0x1ae339,_0x2f0266){return function(_0x169b47){if(_0x169b47){return _0x169b47[_0x2e71('0x20')](_0x1ae339)[_0x2e71('0x21')](function(_0x206983){return _0x206983;});}return null;};}function removeEntity(_0x2648bf,_0x6d72f5){return function(_0x292a8f){if(_0x292a8f){return _0x292a8f[_0x2e71('0x22')]()['then'](function(){_0x2648bf[_0x2e71('0x16')](0xcc)[_0x2e71('0x15')]();});}};}function handleEntityNotFound(_0x3dc9a6,_0x2a33d7){return function(_0x17fc6f){if(!_0x17fc6f){_0x3dc9a6[_0x2e71('0x14')](0x194);}return _0x17fc6f;};}function handleError(_0x194103,_0x207b5b){_0x207b5b=_0x207b5b||0x1f4;return function(_0x305393){logger[_0x2e71('0x23')](_0x305393['stack']);if(_0x305393[_0x2e71('0x24')]){delete _0x305393[_0x2e71('0x24')];}_0x194103[_0x2e71('0x16')](_0x207b5b)['send'](_0x305393);};}exports[_0x2e71('0x25')]=function(_0x14f1f3,_0x3b26be){var _0x5d7129={},_0x3606a9={},_0x4bd4c8={'count':0x0,'rows':[]};var _0xde0fce=_['map'](db[_0x2e71('0x26')][_0x2e71('0x27')],function(_0x153e5a){return{'name':_0x153e5a['fieldName'],'type':_0x153e5a[_0x2e71('0x28')]['key']};});_0x3606a9['model']=_['map'](_0xde0fce,_0x2e71('0x24'));_0x3606a9[_0x2e71('0x29')]=_[_0x2e71('0x2a')](_0x14f1f3[_0x2e71('0x29')]);_0x3606a9[_0x2e71('0x2b')]=_[_0x2e71('0x2c')](_0x3606a9['model'],_0x3606a9[_0x2e71('0x29')]);_0x5d7129['attributes']=_[_0x2e71('0x2c')](_0x3606a9[_0x2e71('0x2d')],qs[_0x2e71('0x2e')](_0x14f1f3['query']['fields']));_0x5d7129[_0x2e71('0x2f')]=_0x5d7129[_0x2e71('0x2f')][_0x2e71('0x30')]?_0x5d7129[_0x2e71('0x2f')]:_0x3606a9[_0x2e71('0x2d')];if(!_0x14f1f3['query'][_0x2e71('0x31')](_0x2e71('0x32'))){_0x5d7129['limit']=qs[_0x2e71('0x1a')](_0x14f1f3['query'][_0x2e71('0x1a')]);_0x5d7129[_0x2e71('0x18')]=qs[_0x2e71('0x18')](_0x14f1f3[_0x2e71('0x29')][_0x2e71('0x18')]);}_0x5d7129['order']=qs['sort'](_0x14f1f3[_0x2e71('0x29')][_0x2e71('0x33')]);_0x5d7129[_0x2e71('0x34')]=qs['filters'](_[_0x2e71('0x35')](_0x14f1f3[_0x2e71('0x29')],_0x3606a9['filters']),_0xde0fce);if(_0x14f1f3[_0x2e71('0x29')]['filter']){_0x5d7129[_0x2e71('0x34')]=_[_0x2e71('0x36')](_0x5d7129[_0x2e71('0x34')],{'$or':_[_0x2e71('0x37')](_0xde0fce,function(_0x30a318){if(_0x30a318[_0x2e71('0x28')]!==_0x2e71('0x38')){var _0x53c40f={};_0x53c40f[_0x30a318[_0x2e71('0x24')]]={'$like':'%'+_0x14f1f3[_0x2e71('0x29')]['filter']+'%'};return _0x53c40f;}})});}_0x5d7129=_[_0x2e71('0x36')]({},_0x5d7129,_0x14f1f3[_0x2e71('0x39')]);var _0x16ada3={'where':_0x5d7129[_0x2e71('0x34')]};return db[_0x2e71('0x26')][_0x2e71('0x1b')](_0x16ada3)[_0x2e71('0x21')](function(_0x506e77){_0x4bd4c8[_0x2e71('0x1b')]=_0x506e77;if(_0x14f1f3[_0x2e71('0x29')]['includeAll']){_0x5d7129[_0x2e71('0x3a')]=[{'all':!![]}];}return db[_0x2e71('0x26')][_0x2e71('0x3b')](_0x5d7129);})['then'](function(_0x1cc16f){_0x4bd4c8[_0x2e71('0x3c')]=_0x1cc16f;return _0x4bd4c8;})[_0x2e71('0x21')](respondWithFilteredResult(_0x3b26be,_0x5d7129))[_0x2e71('0x3d')](handleError(_0x3b26be,null));};exports[_0x2e71('0x3e')]=function(_0x1a2a09,_0x264d5e){var _0x2e2643={'raw':!![],'where':{'id':_0x1a2a09[_0x2e71('0x3f')]['id']}},_0x438546={};_0x438546['model']=_['keys'](db[_0x2e71('0x26')][_0x2e71('0x27')]);_0x438546['query']=_[_0x2e71('0x2a')](_0x1a2a09[_0x2e71('0x29')]);_0x438546[_0x2e71('0x2b')]=_[_0x2e71('0x2c')](_0x438546['model'],_0x438546['query']);_0x2e2643[_0x2e71('0x2f')]=_['intersection'](_0x438546['model'],qs[_0x2e71('0x2e')](_0x1a2a09[_0x2e71('0x29')][_0x2e71('0x2e')]));_0x2e2643[_0x2e71('0x2f')]=_0x2e2643[_0x2e71('0x2f')][_0x2e71('0x30')]?_0x2e2643['attributes']:_0x438546[_0x2e71('0x2d')];if(_0x1a2a09[_0x2e71('0x29')][_0x2e71('0x40')]){_0x2e2643[_0x2e71('0x3a')]=[{'all':!![]}];}_0x2e2643=_[_0x2e71('0x36')]({},_0x2e2643,_0x1a2a09['options']);return db[_0x2e71('0x26')][_0x2e71('0x41')](_0x2e2643)['then'](handleEntityNotFound(_0x264d5e,null))[_0x2e71('0x21')](respondWithResult(_0x264d5e,null))[_0x2e71('0x3d')](handleError(_0x264d5e,null));};exports['create']=function(_0x159d4a,_0x20aabe){return db[_0x2e71('0x26')][_0x2e71('0x42')](_0x159d4a[_0x2e71('0x43')],{})['then'](respondWithResult(_0x20aabe,0xc9))[_0x2e71('0x3d')](handleError(_0x20aabe,null));};exports['describe']=function(_0xfc6c0,_0x389b5a){return db[_0x2e71('0x26')][_0x2e71('0x44')]()[_0x2e71('0x21')](respondWithResult(_0x389b5a,null))[_0x2e71('0x3d')](handleError(_0x389b5a,null));};exports[_0x2e71('0x20')]=function(_0x3986d7,_0x218df1){if(_0x3986d7['body'][_0x2e71('0x45')]){delete _0x3986d7['body']['uniqueid'];}return db[_0x2e71('0x26')][_0x2e71('0x41')]({'where':{'uniqueid':_0x3986d7[_0x2e71('0x3f')]['id']}})[_0x2e71('0x21')](handleEntityNotFound(_0x218df1,null))['then'](saveUpdates(_0x3986d7['body'],null))[_0x2e71('0x21')](respondWithResult(_0x218df1,null))['catch'](handleError(_0x218df1,null));}; \ No newline at end of file +var _0x3b9b=['update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','model','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','find','create','describe','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','save'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x3b9b,0x19e));var _0xb3b9=function(_0x2382c9,_0x5f5326){_0x2382c9=_0x2382c9-0x0;var _0x5bb5c4=_0x3b9b[_0x2382c9];return _0x5bb5c4;};'use strict';var emlformat=require(_0xb3b9('0x0'));var rimraf=require(_0xb3b9('0x1'));var zipdir=require(_0xb3b9('0x2'));var jsonpatch=require(_0xb3b9('0x3'));var rp=require(_0xb3b9('0x4'));var moment=require(_0xb3b9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb3b9('0x6'));var util=require('util');var path=require(_0xb3b9('0x7'));var sox=require(_0xb3b9('0x8'));var csv=require(_0xb3b9('0x9'));var ejs=require(_0xb3b9('0xa'));var fs=require('fs');var fs_extra=require(_0xb3b9('0xb'));var _=require(_0xb3b9('0xc'));var squel=require(_0xb3b9('0xd'));var crypto=require(_0xb3b9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb3b9('0x9'));var querystring=require(_0xb3b9('0xf'));var Papa=require(_0xb3b9('0x10'));var Redis=require(_0xb3b9('0x11'));var authService=require(_0xb3b9('0x12'));var qs=require(_0xb3b9('0x13'));var as=require(_0xb3b9('0x14'));var hardwareService=require(_0xb3b9('0x15'));var logger=require(_0xb3b9('0x16'))(_0xb3b9('0x17'));var utils=require(_0xb3b9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb3b9('0x19'));var db=require(_0xb3b9('0x1a'))['db'];function respondWithStatusCode(_0xaa20b3,_0x277e19){_0x277e19=_0x277e19||0xcc;return function(_0x410b23){if(_0x410b23){return _0xaa20b3[_0xb3b9('0x1b')](_0x277e19);}return _0xaa20b3[_0xb3b9('0x1c')](_0x277e19)[_0xb3b9('0x1d')]();};}function respondWithResult(_0x23a214,_0x34daba){_0x34daba=_0x34daba||0xc8;return function(_0xecad9c){if(_0xecad9c){return _0x23a214[_0xb3b9('0x1c')](_0x34daba)[_0xb3b9('0x1e')](_0xecad9c);}};}function respondWithFilteredResult(_0x15548c,_0x8edef2){return function(_0x46d63c){if(_0x46d63c){var _0x4ceb8f=typeof _0x8edef2['offset']===_0xb3b9('0x1f')&&typeof _0x8edef2[_0xb3b9('0x20')]===_0xb3b9('0x1f');var _0x516d27=_0x46d63c[_0xb3b9('0x21')];var _0x33c3e4=_0x4ceb8f?0x0:_0x8edef2[_0xb3b9('0x22')];var _0xb0ee66=_0x4ceb8f?_0x46d63c[_0xb3b9('0x21')]:_0x8edef2[_0xb3b9('0x22')]+_0x8edef2[_0xb3b9('0x20')];var _0x5a328e;if(_0xb0ee66>=_0x516d27){_0xb0ee66=_0x516d27;_0x5a328e=0xc8;}else{_0x5a328e=0xce;}_0x15548c[_0xb3b9('0x1c')](_0x5a328e);return _0x15548c['set']('Content-Range',_0x33c3e4+'-'+_0xb0ee66+'/'+_0x516d27)[_0xb3b9('0x1e')](_0x46d63c);}return null;};}function patchUpdates(_0xdadc0b){return function(_0x32d43e){try{jsonpatch['apply'](_0x32d43e,_0xdadc0b,!![]);}catch(_0x166f9c){return BPromise['reject'](_0x166f9c);}return _0x32d43e[_0xb3b9('0x23')]();};}function saveUpdates(_0x589913,_0x3122f1){return function(_0x4bfe63){if(_0x4bfe63){return _0x4bfe63[_0xb3b9('0x24')](_0x589913)[_0xb3b9('0x25')](function(_0x457353){return _0x457353;});}return null;};}function removeEntity(_0x54287b,_0x39c371){return function(_0x149a10){if(_0x149a10){return _0x149a10[_0xb3b9('0x26')]()['then'](function(){_0x54287b['status'](0xcc)[_0xb3b9('0x1d')]();});}};}function handleEntityNotFound(_0x71db9e,_0x6b50a8){return function(_0x14865b){if(!_0x14865b){_0x71db9e['sendStatus'](0x194);}return _0x14865b;};}function handleError(_0x4bea20,_0x2a509a){_0x2a509a=_0x2a509a||0x1f4;return function(_0x16a542){logger['error'](_0x16a542[_0xb3b9('0x27')]);if(_0x16a542[_0xb3b9('0x28')]){delete _0x16a542[_0xb3b9('0x28')];}_0x4bea20['status'](_0x2a509a)[_0xb3b9('0x29')](_0x16a542);};}exports[_0xb3b9('0x2a')]=function(_0x1905bc,_0xc7d094){var _0x2b57d8={},_0x3231de={},_0x1f417e={'count':0x0,'rows':[]};var _0x266fa7=_[_0xb3b9('0x2b')](db[_0xb3b9('0x2c')][_0xb3b9('0x2d')],function(_0x49191c){return{'name':_0x49191c[_0xb3b9('0x2e')],'type':_0x49191c['type'][_0xb3b9('0x2f')]};});_0x3231de['model']=_['map'](_0x266fa7,'name');_0x3231de[_0xb3b9('0x30')]=_[_0xb3b9('0x31')](_0x1905bc[_0xb3b9('0x30')]);_0x3231de[_0xb3b9('0x32')]=_[_0xb3b9('0x33')](_0x3231de['model'],_0x3231de[_0xb3b9('0x30')]);_0x2b57d8[_0xb3b9('0x34')]=_[_0xb3b9('0x33')](_0x3231de['model'],qs[_0xb3b9('0x35')](_0x1905bc[_0xb3b9('0x30')][_0xb3b9('0x35')]));_0x2b57d8[_0xb3b9('0x34')]=_0x2b57d8[_0xb3b9('0x34')]['length']?_0x2b57d8['attributes']:_0x3231de[_0xb3b9('0x36')];if(!_0x1905bc[_0xb3b9('0x30')]['hasOwnProperty'](_0xb3b9('0x37'))){_0x2b57d8[_0xb3b9('0x20')]=qs[_0xb3b9('0x20')](_0x1905bc['query'][_0xb3b9('0x20')]);_0x2b57d8[_0xb3b9('0x22')]=qs[_0xb3b9('0x22')](_0x1905bc[_0xb3b9('0x30')]['offset']);}_0x2b57d8[_0xb3b9('0x38')]=qs[_0xb3b9('0x39')](_0x1905bc[_0xb3b9('0x30')]['sort']);_0x2b57d8[_0xb3b9('0x3a')]=qs[_0xb3b9('0x32')](_['pick'](_0x1905bc[_0xb3b9('0x30')],_0x3231de[_0xb3b9('0x32')]),_0x266fa7);if(_0x1905bc['query'][_0xb3b9('0x3b')]){_0x2b57d8['where']=_[_0xb3b9('0x3c')](_0x2b57d8[_0xb3b9('0x3a')],{'$or':_['map'](_0x266fa7,function(_0x5486b5){if(_0x5486b5[_0xb3b9('0x3d')]!==_0xb3b9('0x3e')){var _0x5011ab={};_0x5011ab[_0x5486b5['name']]={'$like':'%'+_0x1905bc[_0xb3b9('0x30')]['filter']+'%'};return _0x5011ab;}})});}_0x2b57d8=_[_0xb3b9('0x3c')]({},_0x2b57d8,_0x1905bc[_0xb3b9('0x3f')]);var _0xb9f338={'where':_0x2b57d8[_0xb3b9('0x3a')]};return db['CmHopperHistory'][_0xb3b9('0x21')](_0xb9f338)[_0xb3b9('0x25')](function(_0x56da37){_0x1f417e[_0xb3b9('0x21')]=_0x56da37;if(_0x1905bc[_0xb3b9('0x30')][_0xb3b9('0x40')]){_0x2b57d8['include']=[{'all':!![]}];}return db[_0xb3b9('0x2c')]['findAll'](_0x2b57d8);})[_0xb3b9('0x25')](function(_0x311743){_0x1f417e[_0xb3b9('0x41')]=_0x311743;return _0x1f417e;})[_0xb3b9('0x25')](respondWithFilteredResult(_0xc7d094,_0x2b57d8))[_0xb3b9('0x42')](handleError(_0xc7d094,null));};exports[_0xb3b9('0x43')]=function(_0x19356c,_0x5a70ae){var _0x2e1910={'raw':!![],'where':{'id':_0x19356c[_0xb3b9('0x44')]['id']}},_0x84d46={};_0x84d46[_0xb3b9('0x36')]=_['keys'](db['CmHopperHistory'][_0xb3b9('0x2d')]);_0x84d46[_0xb3b9('0x30')]=_[_0xb3b9('0x31')](_0x19356c[_0xb3b9('0x30')]);_0x84d46['filters']=_[_0xb3b9('0x33')](_0x84d46['model'],_0x84d46[_0xb3b9('0x30')]);_0x2e1910['attributes']=_[_0xb3b9('0x33')](_0x84d46[_0xb3b9('0x36')],qs['fields'](_0x19356c['query']['fields']));_0x2e1910[_0xb3b9('0x34')]=_0x2e1910[_0xb3b9('0x34')][_0xb3b9('0x45')]?_0x2e1910[_0xb3b9('0x34')]:_0x84d46[_0xb3b9('0x36')];if(_0x19356c['query'][_0xb3b9('0x40')]){_0x2e1910[_0xb3b9('0x46')]=[{'all':!![]}];}_0x2e1910=_['merge']({},_0x2e1910,_0x19356c[_0xb3b9('0x3f')]);return db[_0xb3b9('0x2c')][_0xb3b9('0x47')](_0x2e1910)[_0xb3b9('0x25')](handleEntityNotFound(_0x5a70ae,null))['then'](respondWithResult(_0x5a70ae,null))[_0xb3b9('0x42')](handleError(_0x5a70ae,null));};exports[_0xb3b9('0x48')]=function(_0x3d5b76,_0x9abf5){return db[_0xb3b9('0x2c')][_0xb3b9('0x48')](_0x3d5b76['body'],{})[_0xb3b9('0x25')](respondWithResult(_0x9abf5,0xc9))[_0xb3b9('0x42')](handleError(_0x9abf5,null));};exports[_0xb3b9('0x49')]=function(_0x122789,_0xdac880){return db[_0xb3b9('0x2c')]['describe']()['then'](respondWithResult(_0xdac880,null))[_0xb3b9('0x42')](handleError(_0xdac880,null));};exports[_0xb3b9('0x24')]=function(_0x2edda8,_0xdad9d0){if(_0x2edda8[_0xb3b9('0x4a')]['uniqueid']){delete _0x2edda8[_0xb3b9('0x4a')]['uniqueid'];}return db[_0xb3b9('0x2c')][_0xb3b9('0x47')]({'where':{'uniqueid':_0x2edda8['params']['id']}})[_0xb3b9('0x25')](handleEntityNotFound(_0xdad9d0,null))[_0xb3b9('0x25')](saveUpdates(_0x2edda8[_0xb3b9('0x4a')],null))['then'](respondWithResult(_0xdad9d0,null))[_0xb3b9('0x42')](handleError(_0xdad9d0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 1b203e0..24fa593 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 _0xd1f1=['rimraf','../../config/environment','exports','define','CmHopperHistory','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x3979d4,_0x2f816f){_0x3979d4=_0x3979d4-0x0;var _0x381f3c=_0xd1f1[_0x3979d4];return _0x381f3c;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var logger=require('../../config/logger')(_0x1d1f('0x2'));var moment=require(_0x1d1f('0x3'));var BPromise=require(_0x1d1f('0x4'));var rp=require(_0x1d1f('0x5'));var fs=require('fs');var path=require(_0x1d1f('0x6'));var rimraf=require(_0x1d1f('0x7'));var config=require(_0x1d1f('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0x1d1f('0x9')]=function(_0x246882,_0x68d881){return _0x246882[_0x1d1f('0xa')](_0x1d1f('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x1d1f('0xc'),'fields':[_0x1d1f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x97b2=['exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperHistory.attributes'];(function(_0xe34637,_0xcf116c){var _0x5896d6=function(_0xd31ec8){while(--_0xd31ec8){_0xe34637['push'](_0xe34637['shift']());}};_0x5896d6(++_0xcf116c);}(_0x97b2,0x1b7));var _0x297b=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x97b2[_0x29e0eb];return _0x597d2d;};'use strict';var _=require(_0x297b('0x0'));var util=require(_0x297b('0x1'));var logger=require(_0x297b('0x2'))(_0x297b('0x3'));var moment=require(_0x297b('0x4'));var BPromise=require(_0x297b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x297b('0x6'));var rimraf=require(_0x297b('0x7'));var config=require('../../config/environment');var attributes=require(_0x297b('0x8'));module[_0x297b('0x9')]=function(_0x5ef74e,_0x596f9c){return _0x5ef74e['define'](_0x297b('0xa'),attributes,{'tableName':_0x297b('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x297b('0xc')]},{'name':_0x297b('0xd'),'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 b490d1a..16feed9 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 _0xfaf3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','raw','debug','CmHopperHistory','findAll','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','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','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird'];(function(_0x5f3516,_0x18a12c){var _0x1ff1d8=function(_0x171c75){while(--_0x171c75){_0x5f3516['push'](_0x5f3516['shift']());}};_0x1ff1d8(++_0x18a12c);}(_0xfaf3,0x93));var _0x3faf=function(_0x59d47c,_0x278622){_0x59d47c=_0x59d47c-0x0;var _0x34c4f3=_0xfaf3[_0x59d47c];return _0x34c4f3;};'use strict';var _=require(_0x3faf('0x0'));var util=require('util');var moment=require(_0x3faf('0x1'));var BPromise=require(_0x3faf('0x2'));var rs=require(_0x3faf('0x3'));var fs=require('fs');var Redis=require(_0x3faf('0x4'));var db=require(_0x3faf('0x5'))['db'];var utils=require(_0x3faf('0x6'));var logger=require(_0x3faf('0x7'))(_0x3faf('0x8'));var config=require(_0x3faf('0x9'));var jayson=require(_0x3faf('0xa'));var client=jayson[_0x3faf('0xb')][_0x3faf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d9f7,_0x1bc76c,_0x721e42){return new BPromise(function(_0x3749a8,_0x35f788){return client['request'](_0x41d9f7,_0x721e42)[_0x3faf('0xd')](function(_0x8cd5fe){logger[_0x3faf('0xe')](_0x3faf('0xf'),_0x1bc76c,_0x3faf('0x10'));logger['debug'](_0x3faf('0x11'),_0x1bc76c,_0x3faf('0x10'),JSON[_0x3faf('0x12')](_0x8cd5fe));if(_0x8cd5fe[_0x3faf('0x13')]){if(_0x8cd5fe[_0x3faf('0x13')][_0x3faf('0x14')]===0x1f4){logger[_0x3faf('0x13')](_0x3faf('0xf'),_0x1bc76c,_0x8cd5fe[_0x3faf('0x13')]['message']);return _0x35f788(_0x8cd5fe[_0x3faf('0x13')]['message']);}logger[_0x3faf('0x13')](_0x3faf('0xf'),_0x1bc76c,_0x8cd5fe['error'][_0x3faf('0x15')]);return _0x3749a8(_0x8cd5fe['error']['message']);}else{logger[_0x3faf('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1bc76c,'request\x20sent');_0x3749a8(_0x8cd5fe[_0x3faf('0x16')][_0x3faf('0x15')]);}})[_0x3faf('0x17')](function(_0x39b234){logger[_0x3faf('0x13')](_0x3faf('0xf'),_0x1bc76c,_0x39b234);_0x35f788(_0x39b234);});});}exports[_0x3faf('0x18')]=function(_0x5568db){var _0x3d311d=this;return new Promise(function(_0x41598e,_0x2a391d){return db['CmHopperHistory'][_0x3faf('0x19')](_0x5568db[_0x3faf('0x1a')],{'raw':_0x5568db[_0x3faf('0x1b')]?_0x5568db['options'][_0x3faf('0x1c')]===undefined?!![]:![]:!![]})[_0x3faf('0xd')](function(_0x48a1d6){logger[_0x3faf('0xe')](_0x3faf('0x18'),_0x5568db);logger[_0x3faf('0x1d')](_0x3faf('0x18'),_0x5568db,JSON[_0x3faf('0x12')](_0x48a1d6));_0x41598e(_0x48a1d6);})[_0x3faf('0x17')](function(_0x2df07b){logger[_0x3faf('0x13')](_0x3faf('0x18'),_0x2df07b['message'],_0x5568db);_0x2a391d(_0x3d311d[_0x3faf('0x13')](0x1f4,_0x2df07b[_0x3faf('0x15')]));});});};exports['AvgHandleTime']=function(_0x1ba12b){var _0x7071bd=this;return new Promise(function(_0x44a47f,_0x4224c8){return db[_0x3faf('0x1e')][_0x3faf('0x1f')]({'raw':_0x1ba12b[_0x3faf('0x1b')]?_0x1ba12b['options'][_0x3faf('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ba12b['options']?_0x1ba12b[_0x3faf('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')][_0x3faf('0x22')]('id')),'predictiveIntervalTotalCalls'],[db[_0x3faf('0x21')]['fn']('COUNT',db[_0x3faf('0x21')]['fn']('IF',db['sequelize'][_0x3faf('0x23')](_0x3faf('0x24')))),_0x3faf('0x25')],[db['sequelize']['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db['sequelize'][_0x3faf('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),_0x3faf('0x26')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db['sequelize'][_0x3faf('0x23')](_0x3faf('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x28'),db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')][_0x3faf('0x23')](_0x3faf('0x29')))),_0x3faf('0x2a')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x28'),db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')]['literal'](_0x3faf('0x2b')))),_0x3faf('0x2c')]]})[_0x3faf('0xd')](function(_0x586e7a){logger[_0x3faf('0xe')]('AvgHandleTime',_0x1ba12b);logger[_0x3faf('0x1d')](_0x3faf('0x2d'),_0x1ba12b,JSON['stringify'](_0x586e7a));_0x44a47f(_0x586e7a);})['catch'](function(_0xc03699){logger[_0x3faf('0x13')](_0x3faf('0x2d'),_0xc03699['message'],_0x1ba12b);_0x4224c8(_0x7071bd['error'](0x1f4,_0xc03699['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x13710d){var _0xc66c9d=this;return new Promise(function(_0x23f6a4,_0x4f5ebe){return db['CmHopperHistory'][_0x3faf('0x1f')]({'raw':_0x13710d['options']?_0x13710d[_0x3faf('0x1b')][_0x3faf('0x1c')]===undefined?!![]:![]:!![],'where':_0x13710d[_0x3faf('0x1b')]?_0x13710d['options']['where']||null:null,'attributes':[['campaign',_0x3faf('0x2e')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x3faf('0x23')](_0x3faf('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')]['literal'](_0x3faf('0x30')))),_0x3faf('0x31')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')][_0x3faf('0x23')](_0x3faf('0x24')))),_0x3faf('0x32')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db['sequelize'][_0x3faf('0x23')](_0x3faf('0x33')))),_0x3faf('0x34')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db['sequelize'][_0x3faf('0x23')](_0x3faf('0x35')))),_0x3faf('0x36')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db['sequelize']['fn']('IF',db[_0x3faf('0x21')][_0x3faf('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x3faf('0x37')],[db['sequelize']['fn'](_0x3faf('0x20'),db['sequelize']['fn']('IF',db[_0x3faf('0x21')][_0x3faf('0x23')](_0x3faf('0x38')))),_0x3faf('0x39')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x3faf('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0x3faf('0x3a')],[db['sequelize']['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')]['literal'](_0x3faf('0x3b')))),_0x3faf('0x3c')],[db[_0x3faf('0x21')]['fn']('COUNT',db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')][_0x3faf('0x23')](_0x3faf('0x3d')))),_0x3faf('0x3e')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')][_0x3faf('0x23')](_0x3faf('0x3f')))),_0x3faf('0x40')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db['sequelize']['fn']('IF',db[_0x3faf('0x21')][_0x3faf('0x23')](_0x3faf('0x41')))),_0x3faf('0x42')],[db[_0x3faf('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x3faf('0x23')](_0x3faf('0x43')))),_0x3faf('0x40')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x3faf('0x23')](_0x3faf('0x44')))),_0x3faf('0x45')]],'group':[_0x3faf('0x46')]})['then'](function(_0x515c1d){logger[_0x3faf('0xe')](_0x3faf('0x47'),_0x13710d);logger[_0x3faf('0x1d')](_0x3faf('0x47'),_0x13710d,JSON[_0x3faf('0x12')](_0x515c1d));_0x23f6a4(_0x515c1d);})['catch'](function(_0x4b586e){logger[_0x3faf('0x13')](_0x3faf('0x47'),_0x4b586e[_0x3faf('0x15')],_0x13710d);_0x4f5ebe(_0xc66c9d['error'](0x1f4,_0x4b586e[_0x3faf('0x15')]));});});};exports[_0x3faf('0x48')]=function(_0x5b7ec1){var _0x4ce652=this;return new Promise(function(_0x593879,_0x3c3b9d){return db[_0x3faf('0x1e')][_0x3faf('0x1f')]({'raw':_0x5b7ec1['options']?_0x5b7ec1[_0x3faf('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5b7ec1['options']?_0x5b7ec1[_0x3faf('0x1b')]['where']||null:null,'attributes':[[_0x3faf('0x46'),_0x3faf('0x2e')],[db[_0x3faf('0x21')]['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')][_0x3faf('0x22')]('id')),_0x3faf('0x49')],[db['sequelize']['fn'](_0x3faf('0x20'),db[_0x3faf('0x21')]['fn']('IF',db[_0x3faf('0x21')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x3faf('0x4a')]],'group':[_0x3faf('0x46')]})['then'](function(_0x884ea0){logger['info'](_0x3faf('0x48'),_0x5b7ec1);logger[_0x3faf('0x1d')](_0x3faf('0x48'),_0x5b7ec1,JSON[_0x3faf('0x12')](_0x884ea0));_0x593879(_0x884ea0);})[_0x3faf('0x17')](function(_0x25dafb){logger['error'](_0x3faf('0x48'),_0x25dafb[_0x3faf('0x15')],_0x5b7ec1);_0x3c3b9d(_0x4ce652[_0x3faf('0x13')](0x1f4,_0x25dafb[_0x3faf('0x15')]));});});}; \ No newline at end of file +var _0x04b8=['info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','catch','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`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','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','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','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x45d4db,_0x52603b){var _0xbd8b1d=function(_0xc41757){while(--_0xc41757){_0x45d4db['push'](_0x45d4db['shift']());}};_0xbd8b1d(++_0x52603b);}(_0x04b8,0x159));var _0x804b=function(_0xdfea3b,_0x28bcbd){_0xdfea3b=_0xdfea3b-0x0;var _0x19e9ee=_0x04b8[_0xdfea3b];return _0x19e9ee;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});}exports[_0x804b('0x12')]=function(_0x3a05c0){var _0x5a0a82=this;return new Promise(function(_0x871d6c,_0x50b4fe){return db[_0x804b('0x13')][_0x804b('0x14')](_0x3a05c0[_0x804b('0x15')],{'raw':_0x3a05c0[_0x804b('0x16')]?_0x3a05c0['options'][_0x804b('0x17')]===undefined?!![]:![]:!![]})[_0x804b('0x9')](function(_0x427166){logger[_0x804b('0xa')](_0x804b('0x12'),_0x3a05c0);logger[_0x804b('0x18')](_0x804b('0x12'),_0x3a05c0,JSON[_0x804b('0xe')](_0x427166));_0x871d6c(_0x427166);})[_0x804b('0x19')](function(_0x2b7271){logger[_0x804b('0xf')]('CreateCmHopperHistory',_0x2b7271[_0x804b('0x11')],_0x3a05c0);_0x50b4fe(_0x5a0a82[_0x804b('0xf')](0x1f4,_0x2b7271['message']));});});};exports[_0x804b('0x1a')]=function(_0x367024){var _0x115b8f=this;return new Promise(function(_0x2309a2,_0x9080c2){return db['CmHopperHistory'][_0x804b('0x1b')]({'raw':_0x367024[_0x804b('0x16')]?_0x367024['options'][_0x804b('0x17')]===undefined?!![]:![]:!![],'where':_0x367024[_0x804b('0x16')]?_0x367024[_0x804b('0x16')][_0x804b('0x1c')]||null:null,'attributes':[[db[_0x804b('0x1d')]['fn']('COUNT',db[_0x804b('0x1d')][_0x804b('0x1e')]('id')),_0x804b('0x1f')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db['sequelize']['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x804b('0x1d')]['fn'](_0x804b('0x25'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x26')))),_0x804b('0x27')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x25'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x28')))),_0x804b('0x29')]]})[_0x804b('0x9')](function(_0x384c44){logger[_0x804b('0xa')](_0x804b('0x1a'),_0x367024);logger[_0x804b('0x18')](_0x804b('0x1a'),_0x367024,JSON[_0x804b('0xe')](_0x384c44));_0x2309a2(_0x384c44);})[_0x804b('0x19')](function(_0x447ad8){logger[_0x804b('0xf')](_0x804b('0x1a'),_0x447ad8['message'],_0x367024);_0x9080c2(_0x115b8f['error'](0x1f4,_0x447ad8['message']));});});};exports[_0x804b('0x2a')]=function(_0x2f3661){var _0x37a883=this;return new Promise(function(_0x5b28d7,_0x5918f2){return db['CmHopperHistory'][_0x804b('0x1b')]({'raw':_0x2f3661[_0x804b('0x16')]?_0x2f3661[_0x804b('0x16')][_0x804b('0x17')]===undefined?!![]:![]:!![],'where':_0x2f3661[_0x804b('0x16')]?_0x2f3661[_0x804b('0x16')][_0x804b('0x1c')]||null:null,'attributes':[[_0x804b('0x2b'),_0x804b('0x2c')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')]['literal'](_0x804b('0x2d')))),_0x804b('0x2e')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x804b('0x2f')))),_0x804b('0x30')],[db[_0x804b('0x1d')]['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x22')))),_0x804b('0x31')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')]['literal'](_0x804b('0x32')))),_0x804b('0x33')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db['sequelize']['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x34')))),_0x804b('0x35')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')]['literal'](_0x804b('0x36')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x37')))),_0x804b('0x38')],[db[_0x804b('0x1d')]['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0x804b('0x39')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db['sequelize']['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x3a')))),_0x804b('0x3b')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x3c')))),_0x804b('0x3d')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x804b('0x3e')))),_0x804b('0x3f')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x40')))),_0x804b('0x41')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x804b('0x42')))),_0x804b('0x3f')],[db['sequelize']['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x804b('0x43')]],'group':[_0x804b('0x2b')]})['then'](function(_0x2756de){logger['info'](_0x804b('0x2a'),_0x2f3661);logger['debug'](_0x804b('0x2a'),_0x2f3661,JSON[_0x804b('0xe')](_0x2756de));_0x5b28d7(_0x2756de);})['catch'](function(_0x2f9360){logger['error'](_0x804b('0x2a'),_0x2f9360[_0x804b('0x11')],_0x2f3661);_0x5918f2(_0x37a883[_0x804b('0xf')](0x1f4,_0x2f9360[_0x804b('0x11')]));});});};exports[_0x804b('0x44')]=function(_0x3c1e0e){var _0x3a3a59=this;return new Promise(function(_0x13a84f,_0x453b94){return db[_0x804b('0x13')]['findAll']({'raw':_0x3c1e0e['options']?_0x3c1e0e[_0x804b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3c1e0e['options']?_0x3c1e0e[_0x804b('0x16')][_0x804b('0x1c')]||null:null,'attributes':[[_0x804b('0x2b'),_0x804b('0x2c')],[db['sequelize']['fn']('COUNT',db[_0x804b('0x1d')][_0x804b('0x1e')]('id')),_0x804b('0x45')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x22')))),_0x804b('0x46')]],'group':[_0x804b('0x2b')]})[_0x804b('0x9')](function(_0x38abab){logger[_0x804b('0xa')](_0x804b('0x44'),_0x3c1e0e);logger[_0x804b('0x18')]('GetCampaignHopperHistory',_0x3c1e0e,JSON[_0x804b('0xe')](_0x38abab));_0x13a84f(_0x38abab);})[_0x804b('0x19')](function(_0x56b5f1){logger[_0x804b('0xf')](_0x804b('0x44'),_0x56b5f1[_0x804b('0x11')],_0x3c1e0e);_0x453b94(_0x3a3a59[_0x804b('0xf')](0x1f4,_0x56b5f1['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3d89b81..58ea289 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 _0x6262=['index','/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0x6262,0x128));var _0x2626=function(_0x5ab238,_0x4ddda9){_0x5ab238=_0x5ab238-0x0;var _0x236db6=_0x6262[_0x5ab238];return _0x236db6;};'use strict';var multer=require(_0x2626('0x0'));var util=require(_0x2626('0x1'));var path=require(_0x2626('0x2'));var timeout=require(_0x2626('0x3'));var express=require('express');var router=express[_0x2626('0x4')]();var fs_extra=require(_0x2626('0x5'));var auth=require(_0x2626('0x6'));var interaction=require(_0x2626('0x7'));var config=require(_0x2626('0x8'));var controller=require(_0x2626('0x9'));router[_0x2626('0xa')]('/',auth[_0x2626('0xb')](),controller[_0x2626('0xc')]);router['get'](_0x2626('0xd'),auth[_0x2626('0xb')](),controller[_0x2626('0xe')]);router[_0x2626('0xa')](_0x2626('0xf'),auth[_0x2626('0xb')](),controller[_0x2626('0x10')]);router[_0x2626('0x11')]('/',auth[_0x2626('0xb')](),controller[_0x2626('0x12')]);router[_0x2626('0x13')](_0x2626('0xf'),auth['isAuthenticated'](),controller[_0x2626('0x14')]);module[_0x2626('0x15')]=router; \ No newline at end of file +var _0x941f=['/:id','isAuthenticated','show','post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','index'];(function(_0x4396c3,_0x34b684){var _0x1b4db7=function(_0x4f2082){while(--_0x4f2082){_0x4396c3['push'](_0x4396c3['shift']());}};_0x1b4db7(++_0x34b684);}(_0x941f,0xfe));var _0xf941=function(_0x26a163,_0x9deb33){_0x26a163=_0x26a163-0x0;var _0x17578d=_0x941f[_0x26a163];return _0x17578d;};'use strict';var multer=require(_0xf941('0x0'));var util=require(_0xf941('0x1'));var path=require(_0xf941('0x2'));var timeout=require(_0xf941('0x3'));var express=require(_0xf941('0x4'));var router=express[_0xf941('0x5')]();var fs_extra=require(_0xf941('0x6'));var auth=require(_0xf941('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf941('0x8'));var controller=require(_0xf941('0x9'));router[_0xf941('0xa')]('/',auth['isAuthenticated'](),controller[_0xf941('0xb')]);router[_0xf941('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xf941('0xc'),auth[_0xf941('0xd')](),controller[_0xf941('0xe')]);router[_0xf941('0xf')]('/',auth['isAuthenticated'](),controller[_0xf941('0x10')]);router[_0xf941('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf941('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 4998cdd..d157fa9 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 _0xae24=['sequelize','STRING'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xae24,0x182));var _0x4ae2=function(_0x2bb8ff,_0x2c24b5){_0x2bb8ff=_0x2bb8ff-0x0;var _0x1e7ee7=_0xae24[_0x2bb8ff];return _0x1e7ee7;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4ae2('0x1')]},'dialPrefix':{'type':Sequelize[_0x4ae2('0x1')]}}; \ No newline at end of file +var _0xb1d3=['sequelize','STRING'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x2e2731,_0x5729b8){_0x2e2731=_0x2e2731-0x0;var _0x3be9dd=_0xb1d3[_0x2e2731];return _0x3be9dd;};'use strict';var Sequelize=require(_0x3b1d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3b1d('0x1')]},'dialPrefix':{'type':Sequelize[_0x3b1d('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index a6559eb..5456bc3 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 _0x9971=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','offset','undefined','limit','count','status','Content-Range','json','apply','reject','then','destroy','Lists','UserProfileResource','end','name','index','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','CmList','includeAll','rows','catch','show','rawAttributes','length','include','create','body','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','params','describe','addDisposition','Disposition','keys','order','ListId','options','findAll','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','OrderBy','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','customField_','alias','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','findOne','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','getCustomFields','findAndCountAll','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9971,0x1e1));var _0x1997=function(_0x1b816e,_0x22f647){_0x1b816e=_0x1b816e-0x0;var _0x57db71=_0x9971[_0x1b816e];return _0x57db71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1997('0x0'));var zipdir=require(_0x1997('0x1'));var jsonpatch=require(_0x1997('0x2'));var rp=require(_0x1997('0x3'));var moment=require(_0x1997('0x4'));var BPromise=require(_0x1997('0x5'));var Mustache=require(_0x1997('0x6'));var util=require(_0x1997('0x7'));var path=require('path');var sox=require(_0x1997('0x8'));var csv=require(_0x1997('0x9'));var ejs=require(_0x1997('0xa'));var fs=require('fs');var fs_extra=require(_0x1997('0xb'));var _=require(_0x1997('0xc'));var squel=require(_0x1997('0xd'));var crypto=require(_0x1997('0xe'));var jsforce=require(_0x1997('0xf'));var deskjs=require(_0x1997('0x10'));var toCsv=require(_0x1997('0x9'));var querystring=require(_0x1997('0x11'));var Papa=require(_0x1997('0x12'));var Redis=require(_0x1997('0x13'));var authService=require(_0x1997('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1997('0x15'));var hardwareService=require(_0x1997('0x16'));var logger=require(_0x1997('0x17'))(_0x1997('0x18'));var utils=require(_0x1997('0x19'));var config=require(_0x1997('0x1a'));var licenseUtil=require(_0x1997('0x1b'));var db=require(_0x1997('0x1c'))['db'];var csv_results;config[_0x1997('0x1d')]=_[_0x1997('0x1e')](config[_0x1997('0x1d')],{'host':_0x1997('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1997('0x1d')]));require('./cmList.socket')[_0x1997('0x20')](socket);function respondWithStatusCode(_0x11fac1,_0x2f4a31){_0x2f4a31=_0x2f4a31||0xcc;return function(_0x8f0d0a){if(_0x8f0d0a){return _0x11fac1[_0x1997('0x21')](_0x2f4a31);}return _0x11fac1['status'](_0x2f4a31)['end']();};}function respondWithResult(_0x4f3719,_0x494316){_0x494316=_0x494316||0xc8;return function(_0xe2ade0){if(_0xe2ade0){return _0x4f3719['status'](_0x494316)['json'](_0xe2ade0);}};}function respondWithFilteredResult(_0x2bb3d6,_0x32d590){return function(_0x2565cc){if(_0x2565cc){var _0x392e9d=typeof _0x32d590[_0x1997('0x22')]===_0x1997('0x23')&&typeof _0x32d590[_0x1997('0x24')]===_0x1997('0x23');var _0x24fd77=_0x2565cc['count'];var _0x2b2692=_0x392e9d?0x0:_0x32d590['offset'];var _0x257999=_0x392e9d?_0x2565cc[_0x1997('0x25')]:_0x32d590[_0x1997('0x22')]+_0x32d590['limit'];var _0x37ae41;if(_0x257999>=_0x24fd77){_0x257999=_0x24fd77;_0x37ae41=0xc8;}else{_0x37ae41=0xce;}_0x2bb3d6[_0x1997('0x26')](_0x37ae41);return _0x2bb3d6['set'](_0x1997('0x27'),_0x2b2692+'-'+_0x257999+'/'+_0x24fd77)[_0x1997('0x28')](_0x2565cc);}return null;};}function patchUpdates(_0x4b929f){return function(_0x3fbd52){try{jsonpatch[_0x1997('0x29')](_0x3fbd52,_0x4b929f,!![]);}catch(_0x5e3f15){return BPromise[_0x1997('0x2a')](_0x5e3f15);}return _0x3fbd52['save']();};}function saveUpdates(_0x1effdc,_0x10ab75){return function(_0x87e272){if(_0x87e272){return _0x87e272['update'](_0x1effdc)[_0x1997('0x2b')](function(_0x59f8f0){return _0x59f8f0;});}return null;};}function removeEntity(_0x43c080,_0xc4b3ef){return function(_0x3f5572){if(_0x3f5572){return _0x3f5572[_0x1997('0x2c')]()[_0x1997('0x2b')](function(){var _0x507d00=_0x3f5572['get']({'plain':!![]});var _0x4f37c5=_0x1997('0x2d');return db[_0x1997('0x2e')]['destroy']({'where':{'type':_0x4f37c5,'resourceId':_0x507d00['id']}})[_0x1997('0x2b')](function(){return _0x3f5572;});})[_0x1997('0x2b')](function(){_0x43c080[_0x1997('0x26')](0xcc)[_0x1997('0x2f')]();});}};}function handleEntityNotFound(_0xcb6420,_0x396d43){return function(_0x836456){if(!_0x836456){_0xcb6420[_0x1997('0x21')](0x194);}return _0x836456;};}function handleError(_0x99469,_0x54f7d0){_0x54f7d0=_0x54f7d0||0x1f4;return function(_0x17f9ec){logger['error'](_0x17f9ec['stack']);if(_0x17f9ec[_0x1997('0x30')]){delete _0x17f9ec['name'];}_0x99469[_0x1997('0x26')](_0x54f7d0)['send'](_0x17f9ec);};}exports[_0x1997('0x31')]=function(_0x4e77a7,_0x56cade){var _0x295cae={},_0x51e973={},_0x3b9620={'count':0x0,'rows':[]};var _0x5ddeb1=_['map'](db['CmList']['rawAttributes'],function(_0x4f17fc){return{'name':_0x4f17fc[_0x1997('0x32')],'type':_0x4f17fc['type']['key']};});_0x51e973[_0x1997('0x33')]=_[_0x1997('0x34')](_0x5ddeb1,_0x1997('0x30'));_0x51e973['query']=_['keys'](_0x4e77a7[_0x1997('0x35')]);_0x51e973[_0x1997('0x36')]=_[_0x1997('0x37')](_0x51e973[_0x1997('0x33')],_0x51e973[_0x1997('0x35')]);_0x295cae[_0x1997('0x38')]=_[_0x1997('0x37')](_0x51e973[_0x1997('0x33')],qs[_0x1997('0x39')](_0x4e77a7[_0x1997('0x35')][_0x1997('0x39')]));_0x295cae[_0x1997('0x38')]=_0x295cae[_0x1997('0x38')]['length']?_0x295cae[_0x1997('0x38')]:_0x51e973[_0x1997('0x33')];if(!_0x4e77a7['query'][_0x1997('0x3a')](_0x1997('0x3b'))){_0x295cae[_0x1997('0x24')]=qs[_0x1997('0x24')](_0x4e77a7['query']['limit']);_0x295cae[_0x1997('0x22')]=qs[_0x1997('0x22')](_0x4e77a7[_0x1997('0x35')][_0x1997('0x22')]);}_0x295cae['order']=qs[_0x1997('0x3c')](_0x4e77a7[_0x1997('0x35')]['sort']);_0x295cae[_0x1997('0x3d')]=qs[_0x1997('0x36')](_[_0x1997('0x3e')](_0x4e77a7[_0x1997('0x35')],_0x51e973[_0x1997('0x36')]),_0x5ddeb1);if(_0x4e77a7[_0x1997('0x35')][_0x1997('0x3f')]){_0x295cae[_0x1997('0x3d')]=_['merge'](_0x295cae[_0x1997('0x3d')],{'$or':_[_0x1997('0x34')](_0x5ddeb1,function(_0x53c616){if(_0x53c616[_0x1997('0x40')]!==_0x1997('0x41')){var _0x3be05a={};_0x3be05a[_0x53c616[_0x1997('0x30')]]={'$like':'%'+_0x4e77a7[_0x1997('0x35')][_0x1997('0x3f')]+'%'};return _0x3be05a;}})});}_0x295cae=_[_0x1997('0x42')]({},_0x295cae,_0x4e77a7['options']);var _0x35aac9={'where':_0x295cae[_0x1997('0x3d')]};return db[_0x1997('0x43')]['count'](_0x35aac9)[_0x1997('0x2b')](function(_0x1dc2ab){_0x3b9620[_0x1997('0x25')]=_0x1dc2ab;if(_0x4e77a7['query'][_0x1997('0x44')]){_0x295cae['include']=[{'all':!![]}];}return db['CmList']['findAll'](_0x295cae);})['then'](function(_0x3c0be1){_0x3b9620[_0x1997('0x45')]=_0x3c0be1;return _0x3b9620;})['then'](respondWithFilteredResult(_0x56cade,_0x295cae))[_0x1997('0x46')](handleError(_0x56cade,null));};exports[_0x1997('0x47')]=function(_0x32db92,_0x17e39a){var _0x5c3c3d={'raw':![],'where':{'id':_0x32db92['params']['id']}},_0x4233b5={};_0x4233b5[_0x1997('0x33')]=_['keys'](db[_0x1997('0x43')][_0x1997('0x48')]);_0x4233b5[_0x1997('0x35')]=_['keys'](_0x32db92[_0x1997('0x35')]);_0x4233b5[_0x1997('0x36')]=_[_0x1997('0x37')](_0x4233b5['model'],_0x4233b5[_0x1997('0x35')]);_0x5c3c3d[_0x1997('0x38')]=_[_0x1997('0x37')](_0x4233b5['model'],qs[_0x1997('0x39')](_0x32db92[_0x1997('0x35')][_0x1997('0x39')]));_0x5c3c3d[_0x1997('0x38')]=_0x5c3c3d[_0x1997('0x38')][_0x1997('0x49')]?_0x5c3c3d[_0x1997('0x38')]:_0x4233b5[_0x1997('0x33')];if(_0x32db92[_0x1997('0x35')][_0x1997('0x44')]){_0x5c3c3d[_0x1997('0x4a')]=[{'all':!![]}];}_0x5c3c3d=_[_0x1997('0x42')]({},_0x5c3c3d,_0x32db92['options']);return db[_0x1997('0x43')]['find'](_0x5c3c3d)[_0x1997('0x2b')](handleEntityNotFound(_0x17e39a,null))[_0x1997('0x2b')](respondWithResult(_0x17e39a,null))['catch'](handleError(_0x17e39a,null));};exports[_0x1997('0x4b')]=function(_0x58a2bb,_0x347df2){return db[_0x1997('0x43')][_0x1997('0x4b')](_0x58a2bb[_0x1997('0x4c')],{})['then'](function(_0x55e60c){var _0x57a175=_0x58a2bb['user'][_0x1997('0x4d')]({'plain':!![]});if(!_0x57a175)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57a175[_0x1997('0x4e')]===_0x1997('0x4f')){var _0x5e6fad=_0x55e60c['get']({'plain':!![]});var _0x5ae415=_0x1997('0x2d');return db[_0x1997('0x50')][_0x1997('0x51')]({'where':{'name':_0x5ae415,'userProfileId':_0x57a175[_0x1997('0x52')]},'raw':!![]})[_0x1997('0x2b')](function(_0x3eeba2){if(_0x3eeba2&&_0x3eeba2[_0x1997('0x53')]===0x0){return db[_0x1997('0x2e')][_0x1997('0x4b')]({'name':_0x5e6fad['name'],'resourceId':_0x5e6fad['id'],'type':_0x3eeba2['name'],'sectionId':_0x3eeba2['id']},{})[_0x1997('0x2b')](function(){return _0x55e60c;});}else{return _0x55e60c;}})[_0x1997('0x46')](function(_0x172e35){logger[_0x1997('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x172e35);throw _0x172e35;});}return _0x55e60c;})['then'](respondWithResult(_0x347df2,0xc9))[_0x1997('0x46')](handleError(_0x347df2,null));};exports['update']=function(_0x1b3b30,_0x28c9b9){if(_0x1b3b30[_0x1997('0x4c')]['id']){delete _0x1b3b30[_0x1997('0x4c')]['id'];}return db['CmList'][_0x1997('0x51')]({'where':{'id':_0x1b3b30[_0x1997('0x55')]['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x28c9b9,null))[_0x1997('0x2b')](saveUpdates(_0x1b3b30[_0x1997('0x4c')],null))[_0x1997('0x2b')](respondWithResult(_0x28c9b9,null))[_0x1997('0x46')](handleError(_0x28c9b9,null));};exports[_0x1997('0x2c')]=function(_0x5138c7,_0x5d3e23){return db[_0x1997('0x43')][_0x1997('0x51')]({'where':{'id':_0x5138c7[_0x1997('0x55')]['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x5d3e23,null))[_0x1997('0x2b')](removeEntity(_0x5d3e23,null))[_0x1997('0x46')](handleError(_0x5d3e23,null));};exports[_0x1997('0x56')]=function(_0x1c5ab2,_0x4f0426){return db[_0x1997('0x43')][_0x1997('0x56')]()['then'](respondWithResult(_0x4f0426,null))['catch'](handleError(_0x4f0426,null));};exports[_0x1997('0x57')]=function(_0x44d01b,_0x3d024e,_0x11de89){if(_0x44d01b[_0x1997('0x4c')]['id']){delete _0x44d01b[_0x1997('0x4c')]['id'];}return db[_0x1997('0x43')]['find']({'where':{'id':_0x44d01b[_0x1997('0x55')]['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x3d024e,null))[_0x1997('0x2b')](function(_0x3df4b8){if(_0x3df4b8){_0x44d01b[_0x1997('0x4c')]['ListId']=_0x3df4b8['id'];return db[_0x1997('0x58')][_0x1997('0x4b')](_0x44d01b[_0x1997('0x4c')]);}})[_0x1997('0x2b')](respondWithResult(_0x3d024e,null))['catch'](handleError(_0x3d024e,null));};exports['getDispositions']=function(_0x400305,_0x3e0490,_0x432fb0){var _0x30897d={'raw':![],'where':{}};var _0xa141f3={};var _0x4cd7b8={'count':0x0,'rows':[]};return db[_0x1997('0x43')]['findOne']({'where':{'id':_0x400305[_0x1997('0x55')]['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x3e0490,null))[_0x1997('0x2b')](function(_0x1f8adb){if(_0x1f8adb){_0xa141f3[_0x1997('0x33')]=_[_0x1997('0x59')](db[_0x1997('0x58')][_0x1997('0x48')]);_0xa141f3[_0x1997('0x35')]=_['keys'](_0x400305[_0x1997('0x35')]);_0xa141f3['filters']=_[_0x1997('0x37')](_0xa141f3['model'],_0xa141f3[_0x1997('0x35')]);_0x30897d['attributes']=_[_0x1997('0x37')](_0xa141f3[_0x1997('0x33')],qs['fields'](_0x400305[_0x1997('0x35')][_0x1997('0x39')]));_0x30897d['attributes']=_0x30897d[_0x1997('0x38')][_0x1997('0x49')]?_0x30897d[_0x1997('0x38')]:_0xa141f3[_0x1997('0x33')];if(!_0x400305[_0x1997('0x35')][_0x1997('0x3a')](_0x1997('0x3b'))){_0x30897d[_0x1997('0x24')]=qs[_0x1997('0x24')](_0x400305[_0x1997('0x35')]['limit']);_0x30897d[_0x1997('0x22')]=qs[_0x1997('0x22')](_0x400305[_0x1997('0x35')]['offset']);}_0x30897d[_0x1997('0x5a')]=qs[_0x1997('0x3c')](_0x400305[_0x1997('0x35')][_0x1997('0x3c')]);_0x30897d[_0x1997('0x3d')]=qs[_0x1997('0x36')](_[_0x1997('0x3e')](_0x400305[_0x1997('0x35')],_0xa141f3[_0x1997('0x36')]));_0x30897d['where'][_0x1997('0x5b')]=_0x1f8adb['id'];if(_0x400305[_0x1997('0x35')][_0x1997('0x3f')]){_0x30897d[_0x1997('0x3d')]=_['merge'](_0x30897d['where'],{'$or':_[_0x1997('0x34')](_0x30897d['attributes'],function(_0x177ab5){var _0x5aa6f4={};_0x5aa6f4[_0x177ab5]={'$like':'%'+_0x400305[_0x1997('0x35')]['filter']+'%'};return _0x5aa6f4;})});}_0x30897d=_[_0x1997('0x42')]({},_0x30897d,_0x400305[_0x1997('0x5c')]);return db[_0x1997('0x58')]['count']({'where':_0x30897d[_0x1997('0x3d')]})[_0x1997('0x2b')](function(_0x3cf352){_0x4cd7b8['count']=_0x3cf352;if(_0x400305[_0x1997('0x35')][_0x1997('0x44')]){_0x30897d[_0x1997('0x4a')]=[{'all':!![]}];}return db['Disposition'][_0x1997('0x5d')](_0x30897d);})[_0x1997('0x2b')](function(_0x55f86d){_0x4cd7b8[_0x1997('0x45')]=_0x55f86d;return _0x4cd7b8;});}})[_0x1997('0x2b')](respondWithFilteredResult(_0x3e0490,_0x30897d))[_0x1997('0x46')](handleError(_0x3e0490,null));};exports[_0x1997('0x5e')]=function(_0x3be80f,_0x563ee8,_0x20841d){return db[_0x1997('0x43')][_0x1997('0x51')]({'where':{'id':_0x3be80f[_0x1997('0x55')]['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x563ee8,null))[_0x1997('0x2b')](function(_0x5b1d85){if(_0x5b1d85){return _0x5b1d85['removeDispositions'](_0x3be80f['query'][_0x1997('0x5f')]);}})[_0x1997('0x2b')](respondWithStatusCode(_0x563ee8,null))[_0x1997('0x46')](handleError(_0x563ee8,null));};exports['addContacts']=function(_0x45c2bc,_0x20b6bc,_0x178293){return db[_0x1997('0x43')][_0x1997('0x51')]({'where':{'id':_0x45c2bc['params']['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x20b6bc,null))[_0x1997('0x2b')](function(_0x407e6d){if(_0x407e6d){var _0x29319d=[];var _0x2da0be={'success':[],'errors':[]};return db[_0x1997('0x60')][_0x1997('0x56')]()[_0x1997('0x2b')](function(_0x448df2){if(_0x45c2bc['body'][_0x1997('0x61')]&&_[_0x1997('0x62')](_0x45c2bc[_0x1997('0x4c')][_0x1997('0x61')])){if(_0x45c2bc['body'][_0x1997('0x61')][_0x1997('0x49')]){_0x45c2bc[_0x1997('0x4c')][_0x1997('0x61')]=_0x45c2bc[_0x1997('0x4c')][_0x1997('0x61')][_0x1997('0x63')](';')+';';}else{_0x45c2bc['body'][_0x1997('0x61')]=null;}}else{_0x45c2bc[_0x1997('0x4c')][_0x1997('0x61')]=null;}if(_0x45c2bc[_0x1997('0x4c')]&&_[_0x1997('0x62')](_0x45c2bc[_0x1997('0x4c')])){for(var _0x4561fa=0x0;_0x4561fa<_0x45c2bc[_0x1997('0x4c')]['length'];_0x4561fa+=0x1){_0x45c2bc['body'][_0x4561fa][_0x1997('0x5b')]=_0x45c2bc[_0x1997('0x55')]['id'];_0x29319d[_0x1997('0x64')](_0x45c2bc['body'][_0x4561fa]);}return BPromise[_0x1997('0x65')](_0x29319d,function(_0x3662ad){return db[_0x1997('0x60')][_0x1997('0x4b')](_[_0x1997('0x66')](_0x3662ad,[_0x1997('0x5f'),'id'])||{},{'fields':_[_0x1997('0x59')](_0x448df2),'raw':!![]})['then'](function(_0x3d90be){_0x2da0be[_0x1997('0x67')][_0x1997('0x64')](_0x3d90be[_0x1997('0x68')]);})[_0x1997('0x46')](function(_0x9e08b7){_0x2da0be[_0x1997('0x69')]['push']({'data':_0x3662ad,'error':_0x9e08b7[_0x1997('0x6a')]});});})[_0x1997('0x2b')](function(_0x928d8d){return _0x2da0be;})[_0x1997('0x46')](function(_0x53a4ee){return _0x53a4ee;});}else{_0x20b6bc['status'](0x190)[_0x1997('0x28')]({'message':_0x1997('0x6b')});}});}})['then'](respondWithResult(_0x20b6bc,null))[_0x1997('0x46')](handleError(_0x20b6bc,null));};exports[_0x1997('0x6c')]=function(_0x52a992,_0x5405fb,_0x57f25d){var _0x5c7a4d;return db['CmList'][_0x1997('0x51')]({'where':{'id':_0x52a992[_0x1997('0x55')]['id']},'include':[{'model':db[_0x1997('0x6d')],'as':_0x1997('0x6e')}]})[_0x1997('0x2b')](handleEntityNotFound(_0x5405fb,null))[_0x1997('0x2b')](function(_0x42336e){if(_0x42336e){_0x5c7a4d=_0x42336e;return db[_0x1997('0x60')]['rawAttributes'];}})['then'](function(_0x280e59){if(_0x280e59){var _0xc7525e={};var _0x35a8d3={};_0x35a8d3['model']=_[_0x1997('0x6f')](_['keys'](_0x280e59),_[_0x1997('0x34')](_0x5c7a4d['CustomFields'],function(_0x13e3bb){return util[_0x1997('0x70')]('cf_%d',_0x13e3bb['id']);}));_0x35a8d3[_0x1997('0x35')]=_[_0x1997('0x59')](_0x52a992[_0x1997('0x35')]);_0x35a8d3[_0x1997('0x36')]=_[_0x1997('0x37')](_0x35a8d3[_0x1997('0x33')],_0x35a8d3[_0x1997('0x35')]);_0xc7525e[_0x1997('0x38')]=_[_0x1997('0x37')](_0x35a8d3[_0x1997('0x33')],qs['fields'](_0x52a992[_0x1997('0x35')][_0x1997('0x39')]));_0xc7525e[_0x1997('0x38')]=_0xc7525e[_0x1997('0x38')][_0x1997('0x49')]?_0xc7525e[_0x1997('0x38')]:_0x35a8d3['model'];if(!_0x52a992[_0x1997('0x35')]['hasOwnProperty']('nolimit')){_0xc7525e['limit']=qs[_0x1997('0x24')](_0x52a992[_0x1997('0x35')][_0x1997('0x24')]);_0xc7525e[_0x1997('0x22')]=qs[_0x1997('0x22')](_0x52a992[_0x1997('0x35')][_0x1997('0x22')]);}_0xc7525e[_0x1997('0x5a')]=qs['sort'](_0x52a992['query'][_0x1997('0x3c')]);_0xc7525e['where']=qs[_0x1997('0x36')](_['pick'](_0x52a992[_0x1997('0x35')],_0x35a8d3[_0x1997('0x36')]));_0xc7525e[_0x1997('0x71')]=!![];if(_0x52a992[_0x1997('0x35')][_0x1997('0x3f')]){_0xc7525e[_0x1997('0x3d')]=_['merge'](_0xc7525e[_0x1997('0x3d')],{'$or':_[_0x1997('0x34')](_0xc7525e[_0x1997('0x38')],function(_0x2f8758){var _0x4c2d66={};_0x4c2d66[_0x2f8758]={'$like':'%'+_0x52a992[_0x1997('0x35')][_0x1997('0x3f')]+'%'};return _0x4c2d66;})});}_0xc7525e=_['merge']({},_0xc7525e,_0x52a992['options']);return _0x5c7a4d['getContacts'](_0xc7525e);}})['then'](respondWithResult(_0x5405fb,null))['catch'](handleError(_0x5405fb,null));};exports[_0x1997('0x72')]=function(_0x1670e1,_0x2b52aa,_0x4b8a35){var _0x3b6035;var _0x3bb53d;var _0x231921;var _0x30809e=_0x1670e1[_0x1997('0x55')]['id'];csv_results=[];return db[_0x1997('0x73')][_0x1997('0x5d')]({'attributes':['id',_0x1997('0x30')],'raw':!![],'order':[_0x1997('0x74')]})['then'](function(_0x4d0ac5){_0x3b6035=_0x4d0ac5;var _0x59f1bc=_[_0x1997('0x59')](db[_0x1997('0x60')][_0x1997('0x48')]);return db['CmCustomField'][_0x1997('0x5d')]({'raw':!![],'attributes':['id','alias']})[_0x1997('0x2b')](function(_0x41b289){_0x3bb53d=_0x41b289;var _0x47b956=squel[_0x1997('0x75')]()['fields'](_0x59f1bc)[_0x1997('0x76')](_0x1997('0x77'),'c')[_0x1997('0x3d')](_0x1997('0x78'),_0x30809e)[_0x1997('0x3d')](_0x1997('0x79'))['distinct']();for(var _0x366b8f=0x0;_0x366b8f<_0x3bb53d[_0x1997('0x49')];_0x366b8f++){_0x47b956[_0x1997('0x7a')]('c.cf_'+_0x3bb53d[_0x366b8f]['id'],_0x1997('0x7b')+_0x3bb53d[_0x366b8f][_0x1997('0x7c')]);}for(var _0x366b8f=0x0;_0x366b8f<_0x3b6035['length'];_0x366b8f++){_0x47b956[_0x1997('0x7a')](squel[_0x1997('0x75')]()[_0x1997('0x7a')](_0x1997('0x7d'))[_0x1997('0x76')](_0x1997('0x7e'))['where']('ItemTypeId\x20=\x20?',_0x3b6035[_0x366b8f]['id'])['where'](_0x1997('0x7f')),_0x1997('0x80')+_0x3b6035[_0x366b8f][_0x1997('0x30')]);_0x47b956[_0x1997('0x7a')](squel[_0x1997('0x75')]()['field'](_0x1997('0x81'))[_0x1997('0x76')](_0x1997('0x7e'))[_0x1997('0x3d')](_0x1997('0x82'),_0x3b6035[_0x366b8f]['id'])['where'](_0x1997('0x7f')),_0x1997('0x83')+_0x3b6035[_0x366b8f][_0x1997('0x30')]);}var _0x362f64=[];_0x362f64[_0x1997('0x64')](_0x47b956[_0x1997('0x84')]());BPromise[_0x1997('0x65')](_0x362f64,handleQuery)[_0x1997('0x2b')](function(_0x5b43a3){handleQuery(_0x47b956['toString']());var _0x5582e3=csv_results[0x0];if(!_[_0x1997('0x85')](_0x5582e3)){var _0x2ba200=toCsv(_0x5582e3);var _0xd45a66=Date['now']();fs[_0x1997('0x86')](util[_0x1997('0x70')]('/tmp/list_%d_%s.csv',_0x30809e,_0xd45a66),_0x2ba200);_0x2b52aa[_0x1997('0x87')](_0x1997('0x88'),_0x1997('0x89')+util[_0x1997('0x70')](_0x1997('0x8a'),_0x30809e,_0xd45a66));_0x2b52aa['setHeader'](_0x1997('0x8b'),_0x1997('0x8c'));return _0x2b52aa[_0x1997('0x8d')](util[_0x1997('0x70')](_0x1997('0x8e'),_0x30809e,_0xd45a66));}else{return _0x2b52aa['sendStatus'](0xcc);}});});});};exports[_0x1997('0x8f')]=function(_0x32db40,_0x4b193d,_0x5d6ee8){var _0x58f245;delete _0x32db40['body']['id'];return db[_0x1997('0x43')][_0x1997('0x90')]({'where':{'id':_0x32db40[_0x1997('0x55')]['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x4b193d,null))[_0x1997('0x2b')](function(_0x3d9077){if(_0x3d9077){return db['sequelize'][_0x1997('0x91')](function(_0x4dd8d0){return db[_0x1997('0x6d')]['create'](_0x32db40[_0x1997('0x4c')],{'transaction':_0x4dd8d0})[_0x1997('0x2b')](function(_0x1c3dc1){_0x58f245=_0x1c3dc1;return _0x3d9077['addCustomFields'](_0x1c3dc1,{'transaction':_0x4dd8d0});})[_0x1997('0x2b')](function(){var _0x55b9ce={'type':db[_0x1997('0x92')][_0x1997('0x93')],'transaction':_0x4dd8d0};switch(_0x32db40[_0x1997('0x4c')][_0x1997('0x40')]){case _0x1997('0x94'):_0x55b9ce[_0x1997('0x40')]=db['Sequelize'][_0x1997('0x93')];break;case _0x1997('0x95'):_0x55b9ce['type']=db[_0x1997('0x92')][_0x1997('0x96')];break;case _0x1997('0x97'):_0x55b9ce[_0x1997('0x40')]=db[_0x1997('0x92')][_0x1997('0x98')];_0x55b9ce[_0x1997('0x99')]=![];break;default:}return db[_0x1997('0x9a')]['queryInterface']['addColumn'](_0x1997('0x77'),util[_0x1997('0x70')]('cf_%s',_0x58f245['id']),_0x55b9ce);})[_0x1997('0x2b')](function(){return _0x58f245;});});}})[_0x1997('0x2b')](respondWithResult(_0x4b193d,null))['catch'](handleError(_0x4b193d,null));};exports[_0x1997('0x9b')]=function(_0x99a476,_0xa5a44c,_0x3936ac){var _0x5b9eff={};var _0x4ef846={};var _0x5b38b5;var _0x4c953f;return db[_0x1997('0x43')][_0x1997('0x90')]({'where':{'id':_0x99a476[_0x1997('0x55')]['id']}})['then'](handleEntityNotFound(_0xa5a44c,null))[_0x1997('0x2b')](function(_0x3003bc){if(_0x3003bc){_0x5b38b5=_0x3003bc;_0x4ef846[_0x1997('0x33')]=_[_0x1997('0x59')](db['CmCustomField'][_0x1997('0x48')]);_0x4ef846[_0x1997('0x35')]=_['keys'](_0x99a476[_0x1997('0x35')]);_0x4ef846[_0x1997('0x36')]=_[_0x1997('0x37')](_0x4ef846[_0x1997('0x33')],_0x4ef846['query']);_0x5b9eff[_0x1997('0x38')]=_[_0x1997('0x37')](_0x4ef846[_0x1997('0x33')],qs[_0x1997('0x39')](_0x99a476[_0x1997('0x35')][_0x1997('0x39')]));_0x5b9eff[_0x1997('0x38')]=_0x5b9eff[_0x1997('0x38')][_0x1997('0x49')]?_0x5b9eff[_0x1997('0x38')]:_0x4ef846['model'];_0x5b9eff[_0x1997('0x5a')]=qs[_0x1997('0x3c')](_0x99a476[_0x1997('0x35')][_0x1997('0x3c')]);_0x5b9eff[_0x1997('0x3d')]=qs[_0x1997('0x36')](_[_0x1997('0x3e')](_0x99a476[_0x1997('0x35')],_0x4ef846['filters']));_0x5b9eff[_0x1997('0x3d')]=_['merge'](_0x5b9eff[_0x1997('0x3d')],{'$or':[{'ListId':_0x3003bc['id']},{'ListId':null}]});if(_0x99a476['query'][_0x1997('0x3f')]){_0x5b9eff[_0x1997('0x3d')]=_['merge'](_0x5b9eff[_0x1997('0x3d')],{'$or':_[_0x1997('0x34')](_0x5b9eff['attributes'],function(_0xb42ad3){var _0x63e3a2={};_0x63e3a2[_0xb42ad3]={'$like':'%'+_0x99a476['query'][_0x1997('0x3f')]+'%'};return _0x63e3a2;})});}_0x5b9eff=_[_0x1997('0x42')]({},_0x5b9eff,_0x99a476['options']);return db[_0x1997('0x6d')][_0x1997('0x9c')](_0x5b9eff);}})['then'](respondWithResult(_0xa5a44c,null))[_0x1997('0x46')](handleError(_0xa5a44c,null));};exports['getGlobalCustomFields']=function(_0x13f98a,_0x5f1473){return db[_0x1997('0x6d')][_0x1997('0x9c')]({'where':{'ListId':null}})[_0x1997('0x2b')](handleEntityNotFound(_0x5f1473,null))['then'](function(_0x144b2d){return _0x144b2d;})[_0x1997('0x2b')](respondWithResult(_0x5f1473,null))[_0x1997('0x46')](handleError(_0x5f1473,null));};exports['addAgents']=function(_0x352070,_0x1b384f,_0x941641){return db[_0x1997('0x43')][_0x1997('0x51')]({'where':{'id':_0x352070['params']['id']}})['then'](handleEntityNotFound(_0x1b384f,null))[_0x1997('0x2b')](function(_0x4288a8){if(_0x4288a8){return _0x4288a8['addAgents'](_0x352070[_0x1997('0x4c')][_0x1997('0x5f')],_[_0x1997('0x66')](_0x352070[_0x1997('0x4c')],[_0x1997('0x5f'),'id'])||{})[_0x1997('0x9d')](function(_0x1a4425){for(var _0x284b29=0x0;_0x284b29<_0x352070[_0x1997('0x4c')][_0x1997('0x5f')][_0x1997('0x49')];_0x284b29+=0x1){socket[_0x1997('0x9e')](_0x1997('0x9f'),{'UserId':Number(_0x352070[_0x1997('0x4c')][_0x1997('0x5f')][_0x284b29]),'CmListId':Number(_0x352070['params']['id'])});}return _0x1a4425;});}})[_0x1997('0x2b')](respondWithResult(_0x1b384f,null))[_0x1997('0x46')](handleError(_0x1b384f,null));};exports[_0x1997('0xa0')]=function(_0x348d6d,_0x3b5d04,_0x5630dc){return db[_0x1997('0x43')][_0x1997('0x51')]({'where':{'id':_0x348d6d[_0x1997('0x55')]['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x3b5d04,null))['then'](function(_0x3e2906){if(_0x3e2906){return _0x3e2906[_0x1997('0xa0')](_0x348d6d[_0x1997('0x35')][_0x1997('0x5f')])[_0x1997('0x2b')](function(){if(_[_0x1997('0x62')](_0x348d6d[_0x1997('0x35')]['ids'])){for(var _0x177940=0x0;_0x177940<_0x348d6d[_0x1997('0x35')][_0x1997('0x5f')][_0x1997('0x49')];_0x177940+=0x1){socket['emit'](_0x1997('0xa1'),{'UserId':Number(_0x348d6d[_0x1997('0x35')][_0x1997('0x5f')][_0x177940]),'CmListId':Number(_0x348d6d[_0x1997('0x55')]['id'])});}}else{socket[_0x1997('0x9e')](_0x1997('0xa1'),{'UserId':Number(_0x348d6d['query'][_0x1997('0x5f')]),'CmListId':Number(_0x348d6d[_0x1997('0x55')]['id'])});}});}})[_0x1997('0x2b')](respondWithStatusCode(_0x3b5d04,null))[_0x1997('0x46')](handleError(_0x3b5d04,null));};exports['getAgents']=function(_0x30b621,_0x488d92,_0x4dbf7d){var _0x237571={};var _0x7b2bdd={};var _0x228110;var _0x29044b;return db[_0x1997('0x43')][_0x1997('0x90')]({'where':{'id':_0x30b621['params']['id']}})[_0x1997('0x2b')](handleEntityNotFound(_0x488d92,null))[_0x1997('0x2b')](function(_0x2f19a9){if(_0x2f19a9){_0x228110=_0x2f19a9;_0x7b2bdd[_0x1997('0x33')]=_[_0x1997('0x59')](db[_0x1997('0xa2')]['rawAttributes']);_0x7b2bdd[_0x1997('0x35')]=_['keys'](_0x30b621[_0x1997('0x35')]);_0x7b2bdd[_0x1997('0x36')]=_[_0x1997('0x37')](_0x7b2bdd[_0x1997('0x33')],_0x7b2bdd[_0x1997('0x35')]);_0x237571[_0x1997('0x38')]=_[_0x1997('0x37')](_0x7b2bdd[_0x1997('0x33')],qs[_0x1997('0x39')](_0x30b621[_0x1997('0x35')][_0x1997('0x39')]));_0x237571['attributes']=_0x237571[_0x1997('0x38')]['length']?_0x237571[_0x1997('0x38')]:_0x7b2bdd[_0x1997('0x33')];_0x237571[_0x1997('0x5a')]=qs[_0x1997('0x3c')](_0x30b621['query'][_0x1997('0x3c')]);_0x237571[_0x1997('0x3d')]=qs[_0x1997('0x36')](_[_0x1997('0x3e')](_0x30b621['query'],_0x7b2bdd['filters']));if(_0x30b621['query'][_0x1997('0x3f')]){_0x237571[_0x1997('0x3d')]=_['merge'](_0x237571['where'],{'$or':_[_0x1997('0x34')](_0x237571[_0x1997('0x38')],function(_0xcf8f7){var _0x500644={};_0x500644[_0xcf8f7]={'$like':'%'+_0x30b621[_0x1997('0x35')][_0x1997('0x3f')]+'%'};return _0x500644;})});}_0x237571=_[_0x1997('0x42')]({},_0x237571,_0x30b621[_0x1997('0x5c')]);return _0x228110[_0x1997('0xa3')](_0x237571);}})['then'](function(_0x151258){if(_0x151258){_0x29044b=_0x151258[_0x1997('0x49')];if(!_0x30b621[_0x1997('0x35')]['hasOwnProperty']('nolimit')){_0x237571[_0x1997('0x24')]=qs[_0x1997('0x24')](_0x30b621['query'][_0x1997('0x24')]);_0x237571[_0x1997('0x22')]=qs[_0x1997('0x22')](_0x30b621[_0x1997('0x35')][_0x1997('0x22')]);}return _0x228110[_0x1997('0xa3')](_0x237571);}})['then'](function(_0x429a35){if(_0x429a35){return _0x429a35?{'count':_0x29044b,'rows':_0x429a35}:null;}})[_0x1997('0x2b')](respondWithResult(_0x488d92,null))[_0x1997('0x46')](handleError(_0x488d92,null));};function handleQuery(_0x4ebc63){logger[_0x1997('0xa4')](_0x4ebc63);return db[_0x1997('0x9a')][_0x1997('0x35')](_0x4ebc63)['spread'](function(_0x49067b){csv_results[_0x1997('0x64')](_0x49067b);})[_0x1997('0x46')](function(_0x5389bd){logger[_0x1997('0x54')](_0x5389bd[_0x1997('0x6a')]);});} \ No newline at end of file +var _0x358b=['filter','VIRTUAL','merge','options','includeAll','include','CmList','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','Disposition','findOne','sort','pick','ListId','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','c.deletedAt\x20is\x20null','distinct','field','c.cf_','select','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','from','cm_contact_has_items','description_additionalPhone_','toString','isEmpty','setHeader','attachment;\x20filename=','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','ids','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../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','count','offset','limit','set','Content-Range','json','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x358b,0xf7));var _0xb358=function(_0x2445af,_0x1e4b99){_0x2445af=_0x2445af-0x0;var _0x24388c=_0x358b[_0x2445af];return _0x24388c;};'use strict';var emlformat=require(_0xb358('0x0'));var rimraf=require(_0xb358('0x1'));var zipdir=require(_0xb358('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb358('0x3'));var moment=require(_0xb358('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb358('0x5'));var util=require('util');var path=require(_0xb358('0x6'));var sox=require('sox');var csv=require(_0xb358('0x7'));var ejs=require(_0xb358('0x8'));var fs=require('fs');var fs_extra=require(_0xb358('0x9'));var _=require(_0xb358('0xa'));var squel=require('squel');var crypto=require(_0xb358('0xb'));var jsforce=require(_0xb358('0xc'));var deskjs=require(_0xb358('0xd'));var toCsv=require(_0xb358('0x7'));var querystring=require(_0xb358('0xe'));var Papa=require('papaparse');var Redis=require(_0xb358('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb358('0x10'));var hardwareService=require(_0xb358('0x11'));var logger=require(_0xb358('0x12'))('api');var utils=require(_0xb358('0x13'));var config=require(_0xb358('0x14'));var licenseUtil=require(_0xb358('0x15'));var db=require(_0xb358('0x16'))['db'];var csv_results;config[_0xb358('0x17')]=_[_0xb358('0x18')](config[_0xb358('0x17')],{'host':_0xb358('0x19'),'port':0x18eb});var socket=require(_0xb358('0x1a'))(new Redis(config[_0xb358('0x17')]));require('./cmList.socket')[_0xb358('0x1b')](socket);function respondWithStatusCode(_0x54d511,_0x26b029){_0x26b029=_0x26b029||0xcc;return function(_0x4092c8){if(_0x4092c8){return _0x54d511[_0xb358('0x1c')](_0x26b029);}return _0x54d511[_0xb358('0x1d')](_0x26b029)[_0xb358('0x1e')]();};}function respondWithResult(_0x524f6b,_0x3ece9b){_0x3ece9b=_0x3ece9b||0xc8;return function(_0x2dab40){if(_0x2dab40){return _0x524f6b[_0xb358('0x1d')](_0x3ece9b)['json'](_0x2dab40);}};}function respondWithFilteredResult(_0x4d23f0,_0x5a58c3){return function(_0x4ad78f){if(_0x4ad78f){var _0x339652=typeof _0x5a58c3['offset']===_0xb358('0x1f')&&typeof _0x5a58c3['limit']===_0xb358('0x1f');var _0x76fa35=_0x4ad78f[_0xb358('0x20')];var _0x3b1e99=_0x339652?0x0:_0x5a58c3[_0xb358('0x21')];var _0x5b2792=_0x339652?_0x4ad78f[_0xb358('0x20')]:_0x5a58c3[_0xb358('0x21')]+_0x5a58c3[_0xb358('0x22')];var _0x302569;if(_0x5b2792>=_0x76fa35){_0x5b2792=_0x76fa35;_0x302569=0xc8;}else{_0x302569=0xce;}_0x4d23f0[_0xb358('0x1d')](_0x302569);return _0x4d23f0[_0xb358('0x23')](_0xb358('0x24'),_0x3b1e99+'-'+_0x5b2792+'/'+_0x76fa35)[_0xb358('0x25')](_0x4ad78f);}return null;};}function patchUpdates(_0x5c71da){return function(_0x557e2c){try{jsonpatch['apply'](_0x557e2c,_0x5c71da,!![]);}catch(_0x4a8bbe){return BPromise['reject'](_0x4a8bbe);}return _0x557e2c[_0xb358('0x26')]();};}function saveUpdates(_0x5e0a53,_0x1a6a08){return function(_0xc5abac){if(_0xc5abac){return _0xc5abac[_0xb358('0x27')](_0x5e0a53)[_0xb358('0x28')](function(_0x1a496f){return _0x1a496f;});}return null;};}function removeEntity(_0x436ec3,_0x1f3294){return function(_0x1921b1){if(_0x1921b1){return _0x1921b1[_0xb358('0x29')]()['then'](function(){var _0x3fc484=_0x1921b1[_0xb358('0x2a')]({'plain':!![]});var _0x23cc09=_0xb358('0x2b');return db[_0xb358('0x2c')][_0xb358('0x29')]({'where':{'type':_0x23cc09,'resourceId':_0x3fc484['id']}})['then'](function(){return _0x1921b1;});})['then'](function(){_0x436ec3[_0xb358('0x1d')](0xcc)[_0xb358('0x1e')]();});}};}function handleEntityNotFound(_0x2973c3,_0x38c3c6){return function(_0x5c03d4){if(!_0x5c03d4){_0x2973c3['sendStatus'](0x194);}return _0x5c03d4;};}function handleError(_0x322017,_0x1bbd6d){_0x1bbd6d=_0x1bbd6d||0x1f4;return function(_0x46565b){logger[_0xb358('0x2d')](_0x46565b[_0xb358('0x2e')]);if(_0x46565b[_0xb358('0x2f')]){delete _0x46565b[_0xb358('0x2f')];}_0x322017[_0xb358('0x1d')](_0x1bbd6d)[_0xb358('0x30')](_0x46565b);};}exports['index']=function(_0x3e18a2,_0x25bb3a){var _0x19298e={},_0x2581fc={},_0x59f80a={'count':0x0,'rows':[]};var _0x590eb4=_[_0xb358('0x31')](db['CmList']['rawAttributes'],function(_0x42d978){return{'name':_0x42d978[_0xb358('0x32')],'type':_0x42d978[_0xb358('0x33')][_0xb358('0x34')]};});_0x2581fc['model']=_[_0xb358('0x31')](_0x590eb4,_0xb358('0x2f'));_0x2581fc[_0xb358('0x35')]=_[_0xb358('0x36')](_0x3e18a2[_0xb358('0x35')]);_0x2581fc[_0xb358('0x37')]=_[_0xb358('0x38')](_0x2581fc[_0xb358('0x39')],_0x2581fc[_0xb358('0x35')]);_0x19298e[_0xb358('0x3a')]=_['intersection'](_0x2581fc['model'],qs[_0xb358('0x3b')](_0x3e18a2[_0xb358('0x35')][_0xb358('0x3b')]));_0x19298e[_0xb358('0x3a')]=_0x19298e[_0xb358('0x3a')][_0xb358('0x3c')]?_0x19298e[_0xb358('0x3a')]:_0x2581fc['model'];if(!_0x3e18a2[_0xb358('0x35')][_0xb358('0x3d')](_0xb358('0x3e'))){_0x19298e[_0xb358('0x22')]=qs[_0xb358('0x22')](_0x3e18a2[_0xb358('0x35')][_0xb358('0x22')]);_0x19298e[_0xb358('0x21')]=qs[_0xb358('0x21')](_0x3e18a2[_0xb358('0x35')][_0xb358('0x21')]);}_0x19298e[_0xb358('0x3f')]=qs['sort'](_0x3e18a2[_0xb358('0x35')]['sort']);_0x19298e[_0xb358('0x40')]=qs[_0xb358('0x37')](_['pick'](_0x3e18a2[_0xb358('0x35')],_0x2581fc[_0xb358('0x37')]),_0x590eb4);if(_0x3e18a2[_0xb358('0x35')][_0xb358('0x41')]){_0x19298e['where']=_['merge'](_0x19298e['where'],{'$or':_[_0xb358('0x31')](_0x590eb4,function(_0x3da02c){if(_0x3da02c[_0xb358('0x33')]!==_0xb358('0x42')){var _0x51df37={};_0x51df37[_0x3da02c[_0xb358('0x2f')]]={'$like':'%'+_0x3e18a2[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x51df37;}})});}_0x19298e=_[_0xb358('0x43')]({},_0x19298e,_0x3e18a2[_0xb358('0x44')]);var _0x4ae402={'where':_0x19298e['where']};return db['CmList'][_0xb358('0x20')](_0x4ae402)[_0xb358('0x28')](function(_0x519bdc){_0x59f80a[_0xb358('0x20')]=_0x519bdc;if(_0x3e18a2[_0xb358('0x35')][_0xb358('0x45')]){_0x19298e[_0xb358('0x46')]=[{'all':!![]}];}return db[_0xb358('0x47')][_0xb358('0x48')](_0x19298e);})['then'](function(_0x10d09f){_0x59f80a[_0xb358('0x49')]=_0x10d09f;return _0x59f80a;})[_0xb358('0x28')](respondWithFilteredResult(_0x25bb3a,_0x19298e))[_0xb358('0x4a')](handleError(_0x25bb3a,null));};exports[_0xb358('0x4b')]=function(_0x48c451,_0x60b2ca){var _0x464290={'raw':![],'where':{'id':_0x48c451[_0xb358('0x4c')]['id']}},_0x564f08={};_0x564f08[_0xb358('0x39')]=_[_0xb358('0x36')](db['CmList'][_0xb358('0x4d')]);_0x564f08[_0xb358('0x35')]=_[_0xb358('0x36')](_0x48c451[_0xb358('0x35')]);_0x564f08[_0xb358('0x37')]=_[_0xb358('0x38')](_0x564f08[_0xb358('0x39')],_0x564f08[_0xb358('0x35')]);_0x464290['attributes']=_[_0xb358('0x38')](_0x564f08[_0xb358('0x39')],qs[_0xb358('0x3b')](_0x48c451[_0xb358('0x35')]['fields']));_0x464290['attributes']=_0x464290[_0xb358('0x3a')][_0xb358('0x3c')]?_0x464290[_0xb358('0x3a')]:_0x564f08[_0xb358('0x39')];if(_0x48c451[_0xb358('0x35')][_0xb358('0x45')]){_0x464290[_0xb358('0x46')]=[{'all':!![]}];}_0x464290=_[_0xb358('0x43')]({},_0x464290,_0x48c451['options']);return db[_0xb358('0x47')][_0xb358('0x4e')](_0x464290)['then'](handleEntityNotFound(_0x60b2ca,null))[_0xb358('0x28')](respondWithResult(_0x60b2ca,null))[_0xb358('0x4a')](handleError(_0x60b2ca,null));};exports[_0xb358('0x4f')]=function(_0x45e287,_0x5e58a2){return db[_0xb358('0x47')][_0xb358('0x4f')](_0x45e287[_0xb358('0x50')],{})[_0xb358('0x28')](function(_0x38584d){var _0xa29a79=_0x45e287[_0xb358('0x51')][_0xb358('0x2a')]({'plain':!![]});if(!_0xa29a79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa29a79[_0xb358('0x52')]===_0xb358('0x51')){var _0x2d959b=_0x38584d[_0xb358('0x2a')]({'plain':!![]});var _0x3a6d20='Lists';return db[_0xb358('0x53')]['find']({'where':{'name':_0x3a6d20,'userProfileId':_0xa29a79[_0xb358('0x54')]},'raw':!![]})['then'](function(_0x28b28b){if(_0x28b28b&&_0x28b28b[_0xb358('0x55')]===0x0){return db[_0xb358('0x2c')][_0xb358('0x4f')]({'name':_0x2d959b[_0xb358('0x2f')],'resourceId':_0x2d959b['id'],'type':_0x28b28b[_0xb358('0x2f')],'sectionId':_0x28b28b['id']},{})[_0xb358('0x28')](function(){return _0x38584d;});}else{return _0x38584d;}})[_0xb358('0x4a')](function(_0x27bd01){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27bd01);throw _0x27bd01;});}return _0x38584d;})[_0xb358('0x28')](respondWithResult(_0x5e58a2,0xc9))[_0xb358('0x4a')](handleError(_0x5e58a2,null));};exports[_0xb358('0x27')]=function(_0x4b4f46,_0x1fb8a6){if(_0x4b4f46['body']['id']){delete _0x4b4f46[_0xb358('0x50')]['id'];}return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0x4b4f46['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x1fb8a6,null))[_0xb358('0x28')](saveUpdates(_0x4b4f46[_0xb358('0x50')],null))[_0xb358('0x28')](respondWithResult(_0x1fb8a6,null))['catch'](handleError(_0x1fb8a6,null));};exports[_0xb358('0x29')]=function(_0x59290e,_0x2ba23b){return db[_0xb358('0x47')]['find']({'where':{'id':_0x59290e[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x2ba23b,null))[_0xb358('0x28')](removeEntity(_0x2ba23b,null))['catch'](handleError(_0x2ba23b,null));};exports[_0xb358('0x56')]=function(_0x1fdb7e,_0x2f674a){return db['CmList'][_0xb358('0x56')]()[_0xb358('0x28')](respondWithResult(_0x2f674a,null))[_0xb358('0x4a')](handleError(_0x2f674a,null));};exports[_0xb358('0x57')]=function(_0x1d78bd,_0x25a420,_0x5dcd42){if(_0x1d78bd['body']['id']){delete _0x1d78bd[_0xb358('0x50')]['id'];}return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0x1d78bd[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x25a420,null))[_0xb358('0x28')](function(_0x1a76dd){if(_0x1a76dd){_0x1d78bd[_0xb358('0x50')]['ListId']=_0x1a76dd['id'];return db[_0xb358('0x58')][_0xb358('0x4f')](_0x1d78bd['body']);}})[_0xb358('0x28')](respondWithResult(_0x25a420,null))['catch'](handleError(_0x25a420,null));};exports['getDispositions']=function(_0x15f98d,_0x4c2284,_0x1cc733){var _0x52a1da={'raw':![],'where':{}};var _0xc968a3={};var _0x21308e={'count':0x0,'rows':[]};return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x15f98d['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x4c2284,null))[_0xb358('0x28')](function(_0x4ba320){if(_0x4ba320){_0xc968a3[_0xb358('0x39')]=_[_0xb358('0x36')](db['Disposition'][_0xb358('0x4d')]);_0xc968a3['query']=_['keys'](_0x15f98d[_0xb358('0x35')]);_0xc968a3['filters']=_['intersection'](_0xc968a3[_0xb358('0x39')],_0xc968a3[_0xb358('0x35')]);_0x52a1da['attributes']=_['intersection'](_0xc968a3['model'],qs['fields'](_0x15f98d[_0xb358('0x35')][_0xb358('0x3b')]));_0x52a1da[_0xb358('0x3a')]=_0x52a1da['attributes']['length']?_0x52a1da[_0xb358('0x3a')]:_0xc968a3[_0xb358('0x39')];if(!_0x15f98d[_0xb358('0x35')][_0xb358('0x3d')](_0xb358('0x3e'))){_0x52a1da[_0xb358('0x22')]=qs[_0xb358('0x22')](_0x15f98d['query'][_0xb358('0x22')]);_0x52a1da['offset']=qs[_0xb358('0x21')](_0x15f98d[_0xb358('0x35')][_0xb358('0x21')]);}_0x52a1da[_0xb358('0x3f')]=qs[_0xb358('0x5a')](_0x15f98d[_0xb358('0x35')][_0xb358('0x5a')]);_0x52a1da[_0xb358('0x40')]=qs['filters'](_[_0xb358('0x5b')](_0x15f98d['query'],_0xc968a3[_0xb358('0x37')]));_0x52a1da['where'][_0xb358('0x5c')]=_0x4ba320['id'];if(_0x15f98d[_0xb358('0x35')]['filter']){_0x52a1da[_0xb358('0x40')]=_[_0xb358('0x43')](_0x52a1da[_0xb358('0x40')],{'$or':_[_0xb358('0x31')](_0x52a1da['attributes'],function(_0x46832f){var _0x17806a={};_0x17806a[_0x46832f]={'$like':'%'+_0x15f98d[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x17806a;})});}_0x52a1da=_['merge']({},_0x52a1da,_0x15f98d[_0xb358('0x44')]);return db[_0xb358('0x58')][_0xb358('0x20')]({'where':_0x52a1da['where']})[_0xb358('0x28')](function(_0x490d56){_0x21308e['count']=_0x490d56;if(_0x15f98d[_0xb358('0x35')][_0xb358('0x45')]){_0x52a1da[_0xb358('0x46')]=[{'all':!![]}];}return db[_0xb358('0x58')][_0xb358('0x48')](_0x52a1da);})['then'](function(_0x35e292){_0x21308e[_0xb358('0x49')]=_0x35e292;return _0x21308e;});}})[_0xb358('0x28')](respondWithFilteredResult(_0x4c2284,_0x52a1da))[_0xb358('0x4a')](handleError(_0x4c2284,null));};exports[_0xb358('0x5d')]=function(_0x13bdf2,_0xb0d8eb,_0x533529){return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0x13bdf2[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0xb0d8eb,null))['then'](function(_0x210e2f){if(_0x210e2f){return _0x210e2f[_0xb358('0x5d')](_0x13bdf2['query']['ids']);}})[_0xb358('0x28')](respondWithStatusCode(_0xb0d8eb,null))[_0xb358('0x4a')](handleError(_0xb0d8eb,null));};exports[_0xb358('0x5e')]=function(_0x3eda8d,_0x2c6fcf,_0x396a57){return db['CmList'][_0xb358('0x4e')]({'where':{'id':_0x3eda8d[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x2c6fcf,null))[_0xb358('0x28')](function(_0x443872){if(_0x443872){var _0xd04da8=[];var _0x53a85b={'success':[],'errors':[]};return db[_0xb358('0x5f')][_0xb358('0x56')]()[_0xb358('0x28')](function(_0x21b7c9){if(_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')]&&_[_0xb358('0x61')](_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')])){if(_0x3eda8d[_0xb358('0x50')]['tags']['length']){_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')]=_0x3eda8d['body'][_0xb358('0x60')][_0xb358('0x62')](';')+';';}else{_0x3eda8d['body'][_0xb358('0x60')]=null;}}else{_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')]=null;}if(_0x3eda8d['body']&&_[_0xb358('0x61')](_0x3eda8d[_0xb358('0x50')])){for(var _0x44827b=0x0;_0x44827b<_0x3eda8d[_0xb358('0x50')][_0xb358('0x3c')];_0x44827b+=0x1){_0x3eda8d[_0xb358('0x50')][_0x44827b]['ListId']=_0x3eda8d[_0xb358('0x4c')]['id'];_0xd04da8[_0xb358('0x63')](_0x3eda8d[_0xb358('0x50')][_0x44827b]);}return BPromise[_0xb358('0x64')](_0xd04da8,function(_0x4ecb8d){return db[_0xb358('0x5f')][_0xb358('0x4f')](_[_0xb358('0x65')](_0x4ecb8d,['ids','id'])||{},{'fields':_[_0xb358('0x36')](_0x21b7c9),'raw':!![]})[_0xb358('0x28')](function(_0x532e5f){_0x53a85b[_0xb358('0x66')][_0xb358('0x63')](_0x532e5f['dataValues']);})[_0xb358('0x4a')](function(_0x21435a){_0x53a85b[_0xb358('0x67')][_0xb358('0x63')]({'data':_0x4ecb8d,'error':_0x21435a[_0xb358('0x68')]});});})['then'](function(_0x26dad9){return _0x53a85b;})[_0xb358('0x4a')](function(_0x43b75f){return _0x43b75f;});}else{_0x2c6fcf[_0xb358('0x1d')](0x190)[_0xb358('0x25')]({'message':_0xb358('0x69')});}});}})[_0xb358('0x28')](respondWithResult(_0x2c6fcf,null))['catch'](handleError(_0x2c6fcf,null));};exports[_0xb358('0x6a')]=function(_0x27d9a1,_0x29eacc,_0x59b32d){var _0x326853;return db['CmList'][_0xb358('0x4e')]({'where':{'id':_0x27d9a1[_0xb358('0x4c')]['id']},'include':[{'model':db[_0xb358('0x6b')],'as':_0xb358('0x6c')}]})[_0xb358('0x28')](handleEntityNotFound(_0x29eacc,null))['then'](function(_0x28a146){if(_0x28a146){_0x326853=_0x28a146;return db[_0xb358('0x5f')]['rawAttributes'];}})[_0xb358('0x28')](function(_0x3243aa){if(_0x3243aa){var _0x174cc1={};var _0x13e03e={};_0x13e03e[_0xb358('0x39')]=_['concat'](_['keys'](_0x3243aa),_[_0xb358('0x31')](_0x326853[_0xb358('0x6c')],function(_0x37943b){return util[_0xb358('0x6d')](_0xb358('0x6e'),_0x37943b['id']);}));_0x13e03e['query']=_[_0xb358('0x36')](_0x27d9a1['query']);_0x13e03e[_0xb358('0x37')]=_[_0xb358('0x38')](_0x13e03e[_0xb358('0x39')],_0x13e03e[_0xb358('0x35')]);_0x174cc1['attributes']=_[_0xb358('0x38')](_0x13e03e['model'],qs[_0xb358('0x3b')](_0x27d9a1[_0xb358('0x35')]['fields']));_0x174cc1[_0xb358('0x3a')]=_0x174cc1[_0xb358('0x3a')]['length']?_0x174cc1[_0xb358('0x3a')]:_0x13e03e[_0xb358('0x39')];if(!_0x27d9a1['query'][_0xb358('0x3d')](_0xb358('0x3e'))){_0x174cc1[_0xb358('0x22')]=qs['limit'](_0x27d9a1[_0xb358('0x35')][_0xb358('0x22')]);_0x174cc1[_0xb358('0x21')]=qs[_0xb358('0x21')](_0x27d9a1[_0xb358('0x35')][_0xb358('0x21')]);}_0x174cc1[_0xb358('0x3f')]=qs[_0xb358('0x5a')](_0x27d9a1[_0xb358('0x35')][_0xb358('0x5a')]);_0x174cc1[_0xb358('0x40')]=qs[_0xb358('0x37')](_[_0xb358('0x5b')](_0x27d9a1[_0xb358('0x35')],_0x13e03e[_0xb358('0x37')]));_0x174cc1[_0xb358('0x6f')]=!![];if(_0x27d9a1[_0xb358('0x35')][_0xb358('0x41')]){_0x174cc1['where']=_[_0xb358('0x43')](_0x174cc1['where'],{'$or':_[_0xb358('0x31')](_0x174cc1[_0xb358('0x3a')],function(_0x1d24ae){var _0xba932e={};_0xba932e[_0x1d24ae]={'$like':'%'+_0x27d9a1[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0xba932e;})});}_0x174cc1=_[_0xb358('0x43')]({},_0x174cc1,_0x27d9a1[_0xb358('0x44')]);return _0x326853[_0xb358('0x6a')](_0x174cc1);}})[_0xb358('0x28')](respondWithResult(_0x29eacc,null))['catch'](handleError(_0x29eacc,null));};exports[_0xb358('0x70')]=function(_0x4a60d8,_0x152c04,_0x213cda){var _0x2e3267;var _0x2abf91;var _0x2a36fa;var _0x151e3a=_0x4a60d8['params']['id'];csv_results=[];return db[_0xb358('0x71')][_0xb358('0x48')]({'attributes':['id',_0xb358('0x2f')],'raw':!![],'order':[_0xb358('0x72')]})[_0xb358('0x28')](function(_0x35a18c){_0x2e3267=_0x35a18c;var _0x42c01a=_['keys'](db['CmContact'][_0xb358('0x4d')]);return db['CmCustomField'][_0xb358('0x48')]({'raw':!![],'attributes':['id',_0xb358('0x73')]})[_0xb358('0x28')](function(_0x585436){_0x2abf91=_0x585436;var _0x559b3f=squel['select']()[_0xb358('0x3b')](_0x42c01a)['from']('cm_contacts','c')['where']('c.ListId\x20=\x20?',_0x151e3a)[_0xb358('0x40')](_0xb358('0x74'))[_0xb358('0x75')]();for(var _0x3c57d4=0x0;_0x3c57d4<_0x2abf91[_0xb358('0x3c')];_0x3c57d4++){_0x559b3f[_0xb358('0x76')](_0xb358('0x77')+_0x2abf91[_0x3c57d4]['id'],'customField_'+_0x2abf91[_0x3c57d4][_0xb358('0x73')]);}for(var _0x3c57d4=0x0;_0x3c57d4<_0x2e3267[_0xb358('0x3c')];_0x3c57d4++){_0x559b3f['field'](squel[_0xb358('0x78')]()[_0xb358('0x76')]('item')['from']('cm_contact_has_items')['where'](_0xb358('0x79'),_0x2e3267[_0x3c57d4]['id'])['where'](_0xb358('0x7a')),_0xb358('0x7b')+_0x2e3267[_0x3c57d4][_0xb358('0x2f')]);_0x559b3f['field'](squel[_0xb358('0x78')]()[_0xb358('0x76')](_0xb358('0x7c'))[_0xb358('0x7d')](_0xb358('0x7e'))[_0xb358('0x40')]('ItemTypeId\x20=\x20?',_0x2e3267[_0x3c57d4]['id'])[_0xb358('0x40')](_0xb358('0x7a')),_0xb358('0x7f')+_0x2e3267[_0x3c57d4][_0xb358('0x2f')]);}var _0x4b49d4=[];_0x4b49d4[_0xb358('0x63')](_0x559b3f[_0xb358('0x80')]());BPromise['each'](_0x4b49d4,handleQuery)['then'](function(_0x14841f){handleQuery(_0x559b3f[_0xb358('0x80')]());var _0x45885f=csv_results[0x0];if(!_[_0xb358('0x81')](_0x45885f)){var _0x1504cb=toCsv(_0x45885f);var _0x27fb03=Date['now']();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x151e3a,_0x27fb03),_0x1504cb);_0x152c04[_0xb358('0x82')]('Content-disposition',_0xb358('0x83')+util[_0xb358('0x6d')]('list_%d_%s.csv',_0x151e3a,_0x27fb03));_0x152c04['setHeader']('Content-type',_0xb358('0x84'));return _0x152c04[_0xb358('0x85')](util[_0xb358('0x6d')](_0xb358('0x86'),_0x151e3a,_0x27fb03));}else{return _0x152c04[_0xb358('0x1c')](0xcc);}});});});};exports[_0xb358('0x87')]=function(_0x47611f,_0x1f3694,_0x5663fe){var _0x41ad1a;delete _0x47611f[_0xb358('0x50')]['id'];return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x47611f['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x1f3694,null))[_0xb358('0x28')](function(_0x16f7f9){if(_0x16f7f9){return db[_0xb358('0x88')]['transaction'](function(_0x37b872){return db[_0xb358('0x6b')][_0xb358('0x4f')](_0x47611f[_0xb358('0x50')],{'transaction':_0x37b872})[_0xb358('0x28')](function(_0x2f3ca5){_0x41ad1a=_0x2f3ca5;return _0x16f7f9['addCustomFields'](_0x2f3ca5,{'transaction':_0x37b872});})['then'](function(){var _0x3b3d94={'type':db['Sequelize'][_0xb358('0x89')],'transaction':_0x37b872};switch(_0x47611f['body']['type']){case'text':_0x3b3d94[_0xb358('0x33')]=db[_0xb358('0x8a')]['TEXT'];break;case _0xb358('0x8b'):_0x3b3d94[_0xb358('0x33')]=db[_0xb358('0x8a')][_0xb358('0x8c')];break;case'switch':_0x3b3d94['type']=db[_0xb358('0x8a')][_0xb358('0x8d')];_0x3b3d94[_0xb358('0x8e')]=![];break;default:}return db[_0xb358('0x88')][_0xb358('0x8f')][_0xb358('0x90')]('cm_contacts',util['format'](_0xb358('0x91'),_0x41ad1a['id']),_0x3b3d94);})[_0xb358('0x28')](function(){return _0x41ad1a;});});}})[_0xb358('0x28')](respondWithResult(_0x1f3694,null))[_0xb358('0x4a')](handleError(_0x1f3694,null));};exports[_0xb358('0x92')]=function(_0x1c0c0e,_0x43af1c,_0x52f0eb){var _0x5a5f22={};var _0x320bc1={};var _0x285713;var _0x4eabd5;return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x1c0c0e[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x43af1c,null))[_0xb358('0x28')](function(_0x3a40ab){if(_0x3a40ab){_0x285713=_0x3a40ab;_0x320bc1[_0xb358('0x39')]=_[_0xb358('0x36')](db[_0xb358('0x6b')][_0xb358('0x4d')]);_0x320bc1['query']=_[_0xb358('0x36')](_0x1c0c0e['query']);_0x320bc1['filters']=_[_0xb358('0x38')](_0x320bc1[_0xb358('0x39')],_0x320bc1['query']);_0x5a5f22['attributes']=_[_0xb358('0x38')](_0x320bc1[_0xb358('0x39')],qs[_0xb358('0x3b')](_0x1c0c0e['query'][_0xb358('0x3b')]));_0x5a5f22[_0xb358('0x3a')]=_0x5a5f22[_0xb358('0x3a')]['length']?_0x5a5f22['attributes']:_0x320bc1[_0xb358('0x39')];_0x5a5f22['order']=qs[_0xb358('0x5a')](_0x1c0c0e['query']['sort']);_0x5a5f22[_0xb358('0x40')]=qs[_0xb358('0x37')](_[_0xb358('0x5b')](_0x1c0c0e[_0xb358('0x35')],_0x320bc1[_0xb358('0x37')]));_0x5a5f22[_0xb358('0x40')]=_[_0xb358('0x43')](_0x5a5f22['where'],{'$or':[{'ListId':_0x3a40ab['id']},{'ListId':null}]});if(_0x1c0c0e[_0xb358('0x35')]['filter']){_0x5a5f22[_0xb358('0x40')]=_['merge'](_0x5a5f22[_0xb358('0x40')],{'$or':_[_0xb358('0x31')](_0x5a5f22[_0xb358('0x3a')],function(_0x1b8425){var _0x53ee27={};_0x53ee27[_0x1b8425]={'$like':'%'+_0x1c0c0e[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x53ee27;})});}_0x5a5f22=_[_0xb358('0x43')]({},_0x5a5f22,_0x1c0c0e[_0xb358('0x44')]);return db[_0xb358('0x6b')]['findAndCountAll'](_0x5a5f22);}})['then'](respondWithResult(_0x43af1c,null))['catch'](handleError(_0x43af1c,null));};exports[_0xb358('0x93')]=function(_0x3fcb20,_0x3783eb){return db['CmCustomField'][_0xb358('0x94')]({'where':{'ListId':null}})[_0xb358('0x28')](handleEntityNotFound(_0x3783eb,null))[_0xb358('0x28')](function(_0x405ac6){return _0x405ac6;})['then'](respondWithResult(_0x3783eb,null))[_0xb358('0x4a')](handleError(_0x3783eb,null));};exports[_0xb358('0x95')]=function(_0x15e775,_0x518960,_0x5d7add){return db[_0xb358('0x47')]['find']({'where':{'id':_0x15e775[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x518960,null))[_0xb358('0x28')](function(_0x5e4a8b){if(_0x5e4a8b){return _0x5e4a8b[_0xb358('0x95')](_0x15e775[_0xb358('0x50')][_0xb358('0x96')],_[_0xb358('0x65')](_0x15e775[_0xb358('0x50')],[_0xb358('0x96'),'id'])||{})['spread'](function(_0x382d08){for(var _0x40baee=0x0;_0x40baee<_0x15e775[_0xb358('0x50')][_0xb358('0x96')]['length'];_0x40baee+=0x1){socket['emit'](_0xb358('0x97'),{'UserId':Number(_0x15e775[_0xb358('0x50')][_0xb358('0x96')][_0x40baee]),'CmListId':Number(_0x15e775['params']['id'])});}return _0x382d08;});}})[_0xb358('0x28')](respondWithResult(_0x518960,null))['catch'](handleError(_0x518960,null));};exports[_0xb358('0x98')]=function(_0xed5a55,_0x111826,_0x566b75){return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0xed5a55['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x111826,null))[_0xb358('0x28')](function(_0x3cc141){if(_0x3cc141){return _0x3cc141[_0xb358('0x98')](_0xed5a55[_0xb358('0x35')][_0xb358('0x96')])[_0xb358('0x28')](function(){if(_[_0xb358('0x61')](_0xed5a55['query'][_0xb358('0x96')])){for(var _0x4d4a65=0x0;_0x4d4a65<_0xed5a55[_0xb358('0x35')][_0xb358('0x96')][_0xb358('0x3c')];_0x4d4a65+=0x1){socket[_0xb358('0x99')](_0xb358('0x9a'),{'UserId':Number(_0xed5a55['query'][_0xb358('0x96')][_0x4d4a65]),'CmListId':Number(_0xed5a55['params']['id'])});}}else{socket['emit'](_0xb358('0x9a'),{'UserId':Number(_0xed5a55[_0xb358('0x35')][_0xb358('0x96')]),'CmListId':Number(_0xed5a55[_0xb358('0x4c')]['id'])});}});}})[_0xb358('0x28')](respondWithStatusCode(_0x111826,null))[_0xb358('0x4a')](handleError(_0x111826,null));};exports[_0xb358('0x9b')]=function(_0x26e1db,_0x4ec369,_0x235e0b){var _0x53fd4c={};var _0x1e415d={};var _0x78fc2b;var _0x25eea5;return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x26e1db[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x4ec369,null))['then'](function(_0x4d2b46){if(_0x4d2b46){_0x78fc2b=_0x4d2b46;_0x1e415d[_0xb358('0x39')]=_[_0xb358('0x36')](db['User'][_0xb358('0x4d')]);_0x1e415d['query']=_[_0xb358('0x36')](_0x26e1db[_0xb358('0x35')]);_0x1e415d[_0xb358('0x37')]=_[_0xb358('0x38')](_0x1e415d['model'],_0x1e415d[_0xb358('0x35')]);_0x53fd4c[_0xb358('0x3a')]=_['intersection'](_0x1e415d[_0xb358('0x39')],qs['fields'](_0x26e1db[_0xb358('0x35')][_0xb358('0x3b')]));_0x53fd4c[_0xb358('0x3a')]=_0x53fd4c[_0xb358('0x3a')]['length']?_0x53fd4c[_0xb358('0x3a')]:_0x1e415d[_0xb358('0x39')];_0x53fd4c['order']=qs['sort'](_0x26e1db[_0xb358('0x35')][_0xb358('0x5a')]);_0x53fd4c['where']=qs[_0xb358('0x37')](_[_0xb358('0x5b')](_0x26e1db[_0xb358('0x35')],_0x1e415d['filters']));if(_0x26e1db[_0xb358('0x35')][_0xb358('0x41')]){_0x53fd4c[_0xb358('0x40')]=_[_0xb358('0x43')](_0x53fd4c['where'],{'$or':_[_0xb358('0x31')](_0x53fd4c[_0xb358('0x3a')],function(_0x26849c){var _0x4ddc2b={};_0x4ddc2b[_0x26849c]={'$like':'%'+_0x26e1db[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x4ddc2b;})});}_0x53fd4c=_[_0xb358('0x43')]({},_0x53fd4c,_0x26e1db[_0xb358('0x44')]);return _0x78fc2b[_0xb358('0x9b')](_0x53fd4c);}})[_0xb358('0x28')](function(_0x5df729){if(_0x5df729){_0x25eea5=_0x5df729['length'];if(!_0x26e1db[_0xb358('0x35')][_0xb358('0x3d')](_0xb358('0x3e'))){_0x53fd4c[_0xb358('0x22')]=qs[_0xb358('0x22')](_0x26e1db['query'][_0xb358('0x22')]);_0x53fd4c[_0xb358('0x21')]=qs[_0xb358('0x21')](_0x26e1db[_0xb358('0x35')]['offset']);}return _0x78fc2b['getAgents'](_0x53fd4c);}})[_0xb358('0x28')](function(_0x2248ff){if(_0x2248ff){return _0x2248ff?{'count':_0x25eea5,'rows':_0x2248ff}:null;}})[_0xb358('0x28')](respondWithResult(_0x4ec369,null))[_0xb358('0x4a')](handleError(_0x4ec369,null));};function handleQuery(_0x3e9ac4){logger['info'](_0x3e9ac4);return db[_0xb358('0x88')][_0xb358('0x35')](_0x3e9ac4)['spread'](function(_0x4b97a0){csv_results[_0xb358('0x63')](_0x4b97a0);})['catch'](function(_0x3b0fac){logger['error'](_0x3b0fac[_0xb358('0x68')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 79954f3..90a34c2 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3e74,0x175));var _0x43e7=function(_0x2908d9,_0x7d29f1){_0x2908d9=_0x2908d9-0x0;var _0x85f41e=_0x3e74[_0x2908d9];return _0x85f41e;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x53d01b,_0x1d5d9c){var _0x5973bd=function(_0x210bc1){while(--_0x210bc1){_0x53d01b['push'](_0x53d01b['shift']());}};_0x5973bd(++_0x1d5d9c);}(_0x814b,0x1a2));var _0xb814=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x814b[_0x2850c0];return _0x21e830;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4bf9a63..8eb779e 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 _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x3957c0,_0x57e4ef){var _0x21f140=function(_0x3dcd27){while(--_0x3dcd27){_0x3957c0['push'](_0x3957c0['shift']());}};_0x21f140(++_0x57e4ef);}(_0x99e9,0xb4));var _0x999e=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x99e9[_0x263b0e];return _0x113fee;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x3686a6,_0x4adc12){var _0x51e284=function(_0x2f2613){while(--_0x2f2613){_0x3686a6['push'](_0x3686a6['shift']());}};_0x51e284(++_0x4adc12);}(_0x2dae,0xc3));var _0xe2da=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x2dae[_0x236c89];return _0x3b2a15;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index a188018..6ded6bc 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 _0xd4a1=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s'];(function(_0x446467,_0x6cc57e){var _0x5a4e55=function(_0x4c1556){while(--_0x4c1556){_0x446467['push'](_0x446467['shift']());}};_0x5a4e55(++_0x6cc57e);}(_0xd4a1,0x1c9));var _0x1d4a=function(_0x1cd2df,_0x5b6c5f){_0x1cd2df=_0x1cd2df-0x0;var _0x48542b=_0xd4a1[_0x1cd2df];return _0x48542b;};'use strict';var _=require(_0x1d4a('0x0'));var util=require('util');var moment=require(_0x1d4a('0x1'));var BPromise=require(_0x1d4a('0x2'));var rs=require(_0x1d4a('0x3'));var fs=require('fs');var Redis=require(_0x1d4a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d4a('0x5'))(_0x1d4a('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d4a('0x7'));var client=jayson[_0x1d4a('0x8')][_0x1d4a('0x9')]({'port':0x232a});config[_0x1d4a('0xa')]=_[_0x1d4a('0xb')](config[_0x1d4a('0xa')],{'host':_0x1d4a('0xc'),'port':0x18eb});var socket=require(_0x1d4a('0xd'))(new Redis(config[_0x1d4a('0xa')]));require(_0x1d4a('0xe'))[_0x1d4a('0xf')](socket);function respondWithRpcPromise(_0x232c09,_0x1f5f06,_0xac319f){return new BPromise(function(_0x48ca37,_0x5c49e4){return client[_0x1d4a('0x10')](_0x232c09,_0xac319f)[_0x1d4a('0x11')](function(_0x27f8d6){logger['info'](_0x1d4a('0x12'),_0x1f5f06,_0x1d4a('0x13'));logger[_0x1d4a('0x14')](_0x1d4a('0x15'),_0x1f5f06,'request\x20sent',JSON[_0x1d4a('0x16')](_0x27f8d6));if(_0x27f8d6[_0x1d4a('0x17')]){if(_0x27f8d6[_0x1d4a('0x17')][_0x1d4a('0x18')]===0x1f4){logger[_0x1d4a('0x17')](_0x1d4a('0x12'),_0x1f5f06,_0x27f8d6[_0x1d4a('0x17')][_0x1d4a('0x19')]);return _0x5c49e4(_0x27f8d6['error'][_0x1d4a('0x19')]);}logger[_0x1d4a('0x17')](_0x1d4a('0x12'),_0x1f5f06,_0x27f8d6[_0x1d4a('0x17')][_0x1d4a('0x19')]);return _0x48ca37(_0x27f8d6[_0x1d4a('0x17')][_0x1d4a('0x19')]);}else{logger['info'](_0x1d4a('0x12'),_0x1f5f06,'request\x20sent');_0x48ca37(_0x27f8d6[_0x1d4a('0x1a')][_0x1d4a('0x19')]);}})[_0x1d4a('0x1b')](function(_0x11884d){logger[_0x1d4a('0x17')](_0x1d4a('0x12'),_0x1f5f06,_0x11884d);_0x5c49e4(_0x11884d);});});} \ No newline at end of file +var _0xf812=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','then','request\x20sent','debug','error','CmList,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf812,0x10b));var _0x2f81=function(_0x560fdb,_0xe678c1){_0x560fdb=_0x560fdb-0x0;var _0x18ef38=_0xf812[_0x560fdb];return _0x18ef38;};'use strict';var _=require(_0x2f81('0x0'));var util=require('util');var moment=require(_0x2f81('0x1'));var BPromise=require(_0x2f81('0x2'));var rs=require(_0x2f81('0x3'));var fs=require('fs');var Redis=require(_0x2f81('0x4'));var db=require(_0x2f81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f81('0x6'))(_0x2f81('0x7'));var config=require(_0x2f81('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2f81('0x9')][_0x2f81('0xa')]({'port':0x232a});config[_0x2f81('0xb')]=_[_0x2f81('0xc')](config[_0x2f81('0xb')],{'host':_0x2f81('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f81('0xb')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x3cd2e9,_0x4c6436,_0x2f0819){return new BPromise(function(_0x38eb3b,_0x1d9cfd){return client['request'](_0x3cd2e9,_0x2f0819)[_0x2f81('0xe')](function(_0x54699d){logger['info']('CmList,\x20%s,\x20%s',_0x4c6436,_0x2f81('0xf'));logger[_0x2f81('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0x4c6436,_0x2f81('0xf'),JSON['stringify'](_0x54699d));if(_0x54699d[_0x2f81('0x11')]){if(_0x54699d[_0x2f81('0x11')]['code']===0x1f4){logger[_0x2f81('0x11')](_0x2f81('0x12'),_0x4c6436,_0x54699d[_0x2f81('0x11')][_0x2f81('0x13')]);return _0x1d9cfd(_0x54699d[_0x2f81('0x11')]['message']);}logger['error'](_0x2f81('0x12'),_0x4c6436,_0x54699d['error'][_0x2f81('0x13')]);return _0x38eb3b(_0x54699d[_0x2f81('0x11')]['message']);}else{logger['info'](_0x2f81('0x12'),_0x4c6436,_0x2f81('0xf'));_0x38eb3b(_0x54699d['result']['message']);}})[_0x2f81('0x14')](function(_0x5565b5){logger[_0x2f81('0x11')](_0x2f81('0x12'),_0x4c6436,_0x5565b5);_0x1d9cfd(_0x5565b5);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index aef5a6e..4e527df 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 _0xad55=['remove','update','removeListener','length','cmList:','./cmList.events','save'];(function(_0x11bac6,_0x2915fe){var _0x4807df=function(_0x33e6bf){while(--_0x33e6bf){_0x11bac6['push'](_0x11bac6['shift']());}};_0x4807df(++_0x2915fe);}(_0xad55,0xc9));var _0x5ad5=function(_0x2b56ad,_0x4c1c4f){_0x2b56ad=_0x2b56ad-0x0;var _0x3ece1=_0xad55[_0x2b56ad];return _0x3ece1;};'use strict';var CmListEvents=require(_0x5ad5('0x0'));var events=[_0x5ad5('0x1'),_0x5ad5('0x2'),_0x5ad5('0x3')];function createListener(_0x4c9bb5,_0x59626d){return function(_0x2a6e64){_0x59626d['emit'](_0x4c9bb5,_0x2a6e64);};}function removeListener(_0x1e93cc,_0x36bfe6){return function(){CmListEvents[_0x5ad5('0x4')](_0x1e93cc,_0x36bfe6);};}exports['register']=function(_0x3c25c4){for(var _0x2daca4=0x0,_0x782aa4=events[_0x5ad5('0x5')];_0x2daca4<_0x782aa4;_0x2daca4++){var _0x54993a=events[_0x2daca4];var _0x4c2d08=createListener(_0x5ad5('0x6')+_0x54993a,_0x3c25c4);CmListEvents['on'](_0x54993a,_0x4c2d08);}}; \ No newline at end of file +var _0x0263=['removeListener','register','save','remove','update'];(function(_0x3fea87,_0x5917e4){var _0x5c5a53=function(_0x3b8ceb){while(--_0x3b8ceb){_0x3fea87['push'](_0x3fea87['shift']());}};_0x5c5a53(++_0x5917e4);}(_0x0263,0x75));var _0x3026=function(_0x3e5ec1,_0x3a7e8e){_0x3e5ec1=_0x3e5ec1-0x0;var _0x6c561c=_0x0263[_0x3e5ec1];return _0x6c561c;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x3026('0x0'),_0x3026('0x1'),_0x3026('0x2')];function createListener(_0x415ce4,_0x552bc2){return function(_0x24e791){_0x552bc2['emit'](_0x415ce4,_0x24e791);};}function removeListener(_0x1a04bb,_0x445355){return function(){CmListEvents[_0x3026('0x3')](_0x1a04bb,_0x445355);};}exports[_0x3026('0x4')]=function(_0x582e84){for(var _0x2b0923=0x0,_0x5651f5=events['length'];_0x2b0923<_0x5651f5;_0x2b0923++){var _0x2ae3d7=events[_0x2b0923];var _0x2528a7=createListener('cmList:'+_0x2ae3d7,_0x582e84);CmListEvents['on'](_0x2ae3d7,_0x2528a7);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 15eebd3..dd52f6a 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 _0xbcc2=['delete','exports','multer','util','path','express','fs-extra','./cmList.controller','get','index','/describe','describe','/global_fields','isAuthenticated','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','addContacts','addCustomField','addAgents','update','destroy'];(function(_0x13a275,_0x3959a5){var _0x45919a=function(_0x56cb70){while(--_0x56cb70){_0x13a275['push'](_0x13a275['shift']());}};_0x45919a(++_0x3959a5);}(_0xbcc2,0xdb));var _0x2bcc=function(_0x511058,_0x289636){_0x511058=_0x511058-0x0;var _0x472041=_0xbcc2[_0x511058];return _0x472041;};'use strict';var multer=require(_0x2bcc('0x0'));var util=require(_0x2bcc('0x1'));var path=require(_0x2bcc('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bcc('0x3'));var router=express['Router']();var fs_extra=require(_0x2bcc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2bcc('0x5'));router[_0x2bcc('0x6')]('/',auth['isAuthenticated'](),controller[_0x2bcc('0x7')]);router[_0x2bcc('0x6')](_0x2bcc('0x8'),auth['isAuthenticated'](),controller[_0x2bcc('0x9')]);router[_0x2bcc('0x6')](_0x2bcc('0xa'),auth[_0x2bcc('0xb')](),controller[_0x2bcc('0xc')]);router[_0x2bcc('0x6')](_0x2bcc('0xd'),auth['isAuthenticated'](),controller[_0x2bcc('0xe')]);router['get'](_0x2bcc('0xf'),auth[_0x2bcc('0xb')](),controller['getDispositions']);router['get'](_0x2bcc('0x10'),auth['isAuthenticated'](),controller['getContacts']);router[_0x2bcc('0x6')](_0x2bcc('0x11'),auth[_0x2bcc('0xb')](),controller['getContactsCsv']);router[_0x2bcc('0x6')](_0x2bcc('0x12'),auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x13')]);router['get'](_0x2bcc('0x14'),auth[_0x2bcc('0xb')](),controller['getAgents']);router[_0x2bcc('0x15')]('/',auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x16')]);router[_0x2bcc('0x15')](_0x2bcc('0xf'),auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x17')]);router[_0x2bcc('0x15')](_0x2bcc('0x10'),auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x18')]);router[_0x2bcc('0x15')](_0x2bcc('0x12'),auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x19')]);router['post'](_0x2bcc('0x14'),auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x1a')]);router['put'](_0x2bcc('0xd'),auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x1b')]);router['delete']('/:id',auth[_0x2bcc('0xb')](),controller[_0x2bcc('0x1c')]);router['delete'](_0x2bcc('0xf'),auth[_0x2bcc('0xb')](),controller['removeDispositions']);router[_0x2bcc('0x1d')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x2bcc('0x1e')]=router; \ No newline at end of file +var _0x08af=['post','create','addDisposition','/:id/contacts','addAgents','put','delete','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents'];(function(_0x40354b,_0x16b710){var _0x3021ef=function(_0x36c3a5){while(--_0x36c3a5){_0x40354b['push'](_0x40354b['shift']());}};_0x3021ef(++_0x16b710);}(_0x08af,0xff));var _0xf08a=function(_0x4de2de,_0x2171db){_0x4de2de=_0x4de2de-0x0;var _0x2e3372=_0x08af[_0x4de2de];return _0x2e3372;};'use strict';var multer=require('multer');var util=require(_0xf08a('0x0'));var path=require(_0xf08a('0x1'));var timeout=require('connect-timeout');var express=require(_0xf08a('0x2'));var router=express[_0xf08a('0x3')]();var fs_extra=require(_0xf08a('0x4'));var auth=require(_0xf08a('0x5'));var interaction=require(_0xf08a('0x6'));var config=require(_0xf08a('0x7'));var controller=require('./cmList.controller');router[_0xf08a('0x8')]('/',auth[_0xf08a('0x9')](),controller[_0xf08a('0xa')]);router[_0xf08a('0x8')](_0xf08a('0xb'),auth['isAuthenticated'](),controller[_0xf08a('0xc')]);router[_0xf08a('0x8')](_0xf08a('0xd'),auth['isAuthenticated'](),controller[_0xf08a('0xe')]);router[_0xf08a('0x8')](_0xf08a('0xf'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x10')]);router[_0xf08a('0x8')](_0xf08a('0x11'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x12')]);router[_0xf08a('0x8')]('/:id/contacts',auth[_0xf08a('0x9')](),controller[_0xf08a('0x13')]);router['get'](_0xf08a('0x14'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xf08a('0x8')](_0xf08a('0x15'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x16')]);router[_0xf08a('0x8')](_0xf08a('0x17'),auth['isAuthenticated'](),controller[_0xf08a('0x18')]);router[_0xf08a('0x19')]('/',auth[_0xf08a('0x9')](),controller[_0xf08a('0x1a')]);router['post']('/:id/dispositions',auth[_0xf08a('0x9')](),controller[_0xf08a('0x1b')]);router['post'](_0xf08a('0x1c'),auth[_0xf08a('0x9')](),controller['addContacts']);router[_0xf08a('0x19')]('/:id/fields',auth[_0xf08a('0x9')](),controller['addCustomField']);router[_0xf08a('0x19')](_0xf08a('0x17'),auth['isAuthenticated'](),controller[_0xf08a('0x1d')]);router[_0xf08a('0x1e')](_0xf08a('0xf'),auth[_0xf08a('0x9')](),controller['update']);router[_0xf08a('0x1f')](_0xf08a('0xf'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x20')]);router['delete'](_0xf08a('0x11'),auth[_0xf08a('0x9')](),controller['removeDispositions']);router[_0xf08a('0x1f')](_0xf08a('0x17'),auth['isAuthenticated'](),controller[_0xf08a('0x21')]);module[_0xf08a('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 2427833..02f6ce7 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 _0x5337=['getDataValue','field','STRING','exports'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x5337,0x1cb));var _0x7533=function(_0x491ded,_0x17abba){_0x491ded=_0x491ded-0x0;var _0x4ea2c9=_0x5337[_0x491ded];return _0x4ea2c9;};'use strict';var Sequelize=require('sequelize');module[_0x7533('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x19a991){return this[_0x7533('0x1')](_0x7533('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x7533('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xef46=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x590ec2,_0x236838){var _0x362434=function(_0xd8de48){while(--_0xd8de48){_0x590ec2['push'](_0x590ec2['shift']());}};_0x362434(++_0x236838);}(_0xef46,0x1f2));var _0x6ef4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xef46[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x6ef4('0x0'));module[_0x6ef4('0x1')]={'name':{'type':Sequelize[_0x6ef4('0x2')],'get':function(_0x18612c){return this[_0x6ef4('0x3')](_0x6ef4('0x4'));}},'field':{'type':Sequelize[_0x6ef4('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x6ef4('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 155456b..5a147ff 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x522bb1,_0x4409c2){var _0x40e1a6=function(_0x525b41){while(--_0x525b41){_0x522bb1['push'](_0x522bb1['shift']());}};_0x40e1a6(++_0x4409c2);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x36af77,_0x227ccf){var _0x3d98cf=function(_0x20efbe){while(--_0x20efbe){_0x36af77['push'](_0x36af77['shift']());}};_0x3d98cf(++_0x227ccf);}(_0x7a54,0x106));var _0x47a5=function(_0x2cfaa5,_0x2cb7c4){_0x2cfaa5=_0x2cfaa5-0x0;var _0x244c32=_0x7a54[_0x2cfaa5];return _0x244c32;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 92468a7..d51c9e9 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 _0xd70e=['../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0xd70e,0x11a));var _0xed70=function(_0x53c247,_0x20d880){_0x53c247=_0x53c247-0x0;var _0xacb9bc=_0xd70e[_0x53c247];return _0xacb9bc;};'use strict';var _=require(_0xed70('0x0'));var util=require('util');var logger=require(_0xed70('0x1'))(_0xed70('0x2'));var moment=require(_0xed70('0x3'));var BPromise=require(_0xed70('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed70('0x5'));var config=require(_0xed70('0x6'));var attributes=require(_0xed70('0x7'));module[_0xed70('0x8')]=function(_0x1add25,_0x18dbe7){return _0x1add25[_0xed70('0x9')](_0xed70('0xa'),attributes,{'tableName':_0xed70('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6197=['exports','define','tools_conditions','../../config/logger','api','bluebird','request-promise','path','./condition.attributes'];(function(_0x257d2e,_0x40507d){var _0x50c7cd=function(_0x3be08a){while(--_0x3be08a){_0x257d2e['push'](_0x257d2e['shift']());}};_0x50c7cd(++_0x40507d);}(_0x6197,0x8a));var _0x7619=function(_0x483448,_0x54957d){_0x483448=_0x483448-0x0;var _0x8be9a=_0x6197[_0x483448];return _0x8be9a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7619('0x0'))(_0x7619('0x1'));var moment=require('moment');var BPromise=require(_0x7619('0x2'));var rp=require(_0x7619('0x3'));var fs=require('fs');var path=require(_0x7619('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7619('0x5'));module[_0x7619('0x6')]=function(_0x12ae6a,_0x115776){return _0x12ae6a[_0x7619('0x7')]('Condition',attributes,{'tableName':_0x7619('0x8'),'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 9b253e0..b68a97f 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 _0x2661=['debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0x3b7998,_0x30087c){var _0x46f5f3=function(_0x3b0b53){while(--_0x3b0b53){_0x3b7998['push'](_0x3b7998['shift']());}};_0x46f5f3(++_0x30087c);}(_0x2661,0x193));var _0x1266=function(_0x32cb27,_0xc2b7b4){_0x32cb27=_0x32cb27-0x0;var _0x3870bc=_0x2661[_0x32cb27];return _0x3870bc;};'use strict';var _=require('lodash');var util=require(_0x1266('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1266('0x1'));var fs=require('fs');var Redis=require(_0x1266('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1266('0x3'));var logger=require(_0x1266('0x4'))(_0x1266('0x5'));var config=require(_0x1266('0x6'));var jayson=require(_0x1266('0x7'));var client=jayson[_0x1266('0x8')][_0x1266('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4feea7,_0x3d83b1,_0x540785){return new BPromise(function(_0x13202e,_0x3742fe){return client[_0x1266('0xa')](_0x4feea7,_0x540785)[_0x1266('0xb')](function(_0x11cd89){logger[_0x1266('0xc')](_0x1266('0xd'),_0x3d83b1,_0x1266('0xe'));logger[_0x1266('0xf')](_0x1266('0x10'),_0x3d83b1,_0x1266('0xe'),JSON[_0x1266('0x11')](_0x11cd89));if(_0x11cd89[_0x1266('0x12')]){if(_0x11cd89[_0x1266('0x12')]['code']===0x1f4){logger[_0x1266('0x12')](_0x1266('0xd'),_0x3d83b1,_0x11cd89[_0x1266('0x12')][_0x1266('0x13')]);return _0x3742fe(_0x11cd89[_0x1266('0x12')][_0x1266('0x13')]);}logger[_0x1266('0x12')](_0x1266('0xd'),_0x3d83b1,_0x11cd89[_0x1266('0x12')][_0x1266('0x13')]);return _0x13202e(_0x11cd89[_0x1266('0x12')][_0x1266('0x13')]);}else{logger['info'](_0x1266('0xd'),_0x3d83b1,'request\x20sent');_0x13202e(_0x11cd89[_0x1266('0x14')][_0x1266('0x13')]);}})[_0x1266('0x15')](function(_0x916627){logger[_0x1266('0x12')](_0x1266('0xd'),_0x3d83b1,_0x916627);_0x3742fe(_0x916627);});});} \ No newline at end of file +var _0x16fc=['stringify','error','Condition,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x348295,_0x3daf50){var _0x32b929=function(_0x621b4a){while(--_0x621b4a){_0x348295['push'](_0x348295['shift']());}};_0x32b929(++_0x3daf50);}(_0x16fc,0x9e));var _0xc16f=function(_0x281cfd,_0x1ce59a){_0x281cfd=_0x281cfd-0x0;var _0x1d42ca=_0x16fc[_0x281cfd];return _0x1d42ca;};'use strict';var _=require(_0xc16f('0x0'));var util=require(_0xc16f('0x1'));var moment=require(_0xc16f('0x2'));var BPromise=require(_0xc16f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc16f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc16f('0x5'))('rpc');var config=require(_0xc16f('0x6'));var jayson=require(_0xc16f('0x7'));var client=jayson[_0xc16f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399ef3,_0x28f356,_0x7baa81){return new BPromise(function(_0x2f74e1,_0x17bd12){return client[_0xc16f('0x9')](_0x399ef3,_0x7baa81)['then'](function(_0xe93f1f){logger[_0xc16f('0xa')]('Condition,\x20%s,\x20%s',_0x28f356,'request\x20sent');logger[_0xc16f('0xb')](_0xc16f('0xc'),_0x28f356,'request\x20sent',JSON[_0xc16f('0xd')](_0xe93f1f));if(_0xe93f1f[_0xc16f('0xe')]){if(_0xe93f1f[_0xc16f('0xe')]['code']===0x1f4){logger[_0xc16f('0xe')](_0xc16f('0xf'),_0x28f356,_0xe93f1f[_0xc16f('0xe')]['message']);return _0x17bd12(_0xe93f1f['error'][_0xc16f('0x10')]);}logger[_0xc16f('0xe')](_0xc16f('0xf'),_0x28f356,_0xe93f1f[_0xc16f('0xe')][_0xc16f('0x10')]);return _0x2f74e1(_0xe93f1f[_0xc16f('0xe')][_0xc16f('0x10')]);}else{logger['info'](_0xc16f('0xf'),_0x28f356,_0xc16f('0x11'));_0x2f74e1(_0xe93f1f['result'][_0xc16f('0x10')]);}})[_0xc16f('0x12')](function(_0xa9ffdb){logger[_0xc16f('0xe')](_0xc16f('0xf'),_0x28f356,_0xa9ffdb);_0x17bd12(_0xa9ffdb);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index de0ea21..d6f55b9 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 _0x714b=['../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x714b,0x1d9));var _0xb714=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x714b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb714('0x0'));var util=require(_0xb714('0x1'));var path=require(_0xb714('0x2'));var timeout=require(_0xb714('0x3'));var express=require(_0xb714('0x4'));var router=express[_0xb714('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb714('0x6'));var interaction=require(_0xb714('0x7'));var config=require(_0xb714('0x8'));var controller=require(_0xb714('0x9'));router[_0xb714('0xa')]('/:id',auth[_0xb714('0xb')](),controller[_0xb714('0xc')]);router['delete'](_0xb714('0xd'),auth[_0xb714('0xb')](),controller[_0xb714('0xe')]);module[_0xb714('0xf')]=router; \ No newline at end of file +var _0x6eeb=['../../components/interaction/service','../../config/environment','put','/:id','update','delete','destroy','exports','multer','util','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eeb,0x97));var _0xb6ee=function(_0xf10ab2,_0x4139fa){_0xf10ab2=_0xf10ab2-0x0;var _0x4c6629=_0x6eeb[_0xf10ab2];return _0x4c6629;};'use strict';var multer=require(_0xb6ee('0x0'));var util=require(_0xb6ee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb6ee('0x2'));var interaction=require(_0xb6ee('0x3'));var config=require(_0xb6ee('0x4'));var controller=require('./condition.controller');router[_0xb6ee('0x5')](_0xb6ee('0x6'),auth['isAuthenticated'](),controller[_0xb6ee('0x7')]);router[_0xb6ee('0x8')](_0xb6ee('0x6'),auth['isAuthenticated'](),controller[_0xb6ee('0x9')]);module[_0xb6ee('0xa')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 66d3a8d..1657f69 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 _0xe47e=['name','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe47e,0x111));var _0xee47=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xe47e[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0xee47('0x0'));module[_0xee47('0x1')]={'name':{'type':Sequelize[_0xee47('0x2')],'allowNull':![],'unique':_0xee47('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x1ea8=['name','INTEGER','exports','STRING'];(function(_0x39bd1e,_0x443871){var _0x81a2eb=function(_0x17153e){while(--_0x17153e){_0x39bd1e['push'](_0x39bd1e['shift']());}};_0x81a2eb(++_0x443871);}(_0x1ea8,0x19e));var _0x81ea=function(_0x4a00a9,_0x487257){_0x4a00a9=_0x4a00a9-0x0;var _0x46b8d5=_0x1ea8[_0x4a00a9];return _0x46b8d5;};'use strict';var Sequelize=require('sequelize');module[_0x81ea('0x0')]={'name':{'type':Sequelize[_0x81ea('0x1')],'allowNull':![],'unique':_0x81ea('0x2')},'OrderBy':{'type':Sequelize[_0x81ea('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x81ea('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 3c7cc5d..17dbd83 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 _0x958a=['Content-Range','apply','save','update','destroy','then','get','ContactItemTypes','name','send','ContactItemType','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x2469a9,_0x35fc0e){var _0x5ebe9c=function(_0xa510e6){while(--_0xa510e6){_0x2469a9['push'](_0x2469a9['shift']());}};_0x5ebe9c(++_0x35fc0e);}(_0x958a,0x128));var _0xa958=function(_0x45b41e,_0x11b9ba){_0x45b41e=_0x45b41e-0x0;var _0xc6d845=_0x958a[_0x45b41e];return _0xc6d845;};'use strict';var emlformat=require(_0xa958('0x0'));var rimraf=require(_0xa958('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa958('0x2'));var rp=require(_0xa958('0x3'));var moment=require(_0xa958('0x4'));var BPromise=require(_0xa958('0x5'));var Mustache=require(_0xa958('0x6'));var util=require('util');var path=require(_0xa958('0x7'));var sox=require('sox');var csv=require(_0xa958('0x8'));var ejs=require(_0xa958('0x9'));var fs=require('fs');var fs_extra=require(_0xa958('0xa'));var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var Redis=require(_0xa958('0x11'));var authService=require(_0xa958('0x12'));var qs=require(_0xa958('0x13'));var as=require(_0xa958('0x14'));var hardwareService=require(_0xa958('0x15'));var logger=require(_0xa958('0x16'))(_0xa958('0x17'));var utils=require(_0xa958('0x18'));var config=require(_0xa958('0x19'));var licenseUtil=require(_0xa958('0x1a'));var db=require(_0xa958('0x1b'))['db'];function respondWithStatusCode(_0x53bf27,_0x5063ae){_0x5063ae=_0x5063ae||0xcc;return function(_0x5bcc66){if(_0x5bcc66){return _0x53bf27[_0xa958('0x1c')](_0x5063ae);}return _0x53bf27[_0xa958('0x1d')](_0x5063ae)[_0xa958('0x1e')]();};}function respondWithResult(_0x591d4d,_0x3ebc66){_0x3ebc66=_0x3ebc66||0xc8;return function(_0x54c439){if(_0x54c439){return _0x591d4d['status'](_0x3ebc66)['json'](_0x54c439);}};}function respondWithFilteredResult(_0x1fe41e,_0x15fca8){return function(_0xb90ac6){if(_0xb90ac6){var _0x6a81c7=typeof _0x15fca8[_0xa958('0x1f')]===_0xa958('0x20')&&typeof _0x15fca8[_0xa958('0x21')]===_0xa958('0x20');var _0x4d836f=_0xb90ac6[_0xa958('0x22')];var _0x4eadc9=_0x6a81c7?0x0:_0x15fca8[_0xa958('0x1f')];var _0x70d13e=_0x6a81c7?_0xb90ac6['count']:_0x15fca8[_0xa958('0x1f')]+_0x15fca8[_0xa958('0x21')];var _0x47636f;if(_0x70d13e>=_0x4d836f){_0x70d13e=_0x4d836f;_0x47636f=0xc8;}else{_0x47636f=0xce;}_0x1fe41e[_0xa958('0x1d')](_0x47636f);return _0x1fe41e[_0xa958('0x23')](_0xa958('0x24'),_0x4eadc9+'-'+_0x70d13e+'/'+_0x4d836f)['json'](_0xb90ac6);}return null;};}function patchUpdates(_0x4a90c2){return function(_0x373661){try{jsonpatch[_0xa958('0x25')](_0x373661,_0x4a90c2,!![]);}catch(_0x16c0be){return BPromise['reject'](_0x16c0be);}return _0x373661[_0xa958('0x26')]();};}function saveUpdates(_0x383aa3,_0x5c091a){return function(_0x28cf12){if(_0x28cf12){return _0x28cf12[_0xa958('0x27')](_0x383aa3)['then'](function(_0x5c5a2b){return _0x5c5a2b;});}return null;};}function removeEntity(_0x201ed3,_0x40b51e){return function(_0x50b3c3){if(_0x50b3c3){return _0x50b3c3[_0xa958('0x28')]()[_0xa958('0x29')](function(){var _0x2f03df=_0x50b3c3[_0xa958('0x2a')]({'plain':!![]});var _0x16b04a=_0xa958('0x2b');return db['UserProfileResource'][_0xa958('0x28')]({'where':{'type':_0x16b04a,'resourceId':_0x2f03df['id']}})['then'](function(){return _0x50b3c3;});})[_0xa958('0x29')](function(){_0x201ed3[_0xa958('0x1d')](0xcc)[_0xa958('0x1e')]();});}};}function handleEntityNotFound(_0x18f600,_0x21541f){return function(_0xddc7f6){if(!_0xddc7f6){_0x18f600[_0xa958('0x1c')](0x194);}return _0xddc7f6;};}function handleError(_0xc75ae9,_0x12cfde){_0x12cfde=_0x12cfde||0x1f4;return function(_0x404d07){logger['error'](_0x404d07['stack']);if(_0x404d07[_0xa958('0x2c')]){delete _0x404d07['name'];}_0xc75ae9[_0xa958('0x1d')](_0x12cfde)[_0xa958('0x2d')](_0x404d07);};}exports['index']=function(_0x23bdbf,_0x3d4711){var _0x179bc2={},_0x374c77={},_0x283452={'count':0x0,'rows':[]};var _0x54ad35=_['map'](db[_0xa958('0x2e')]['rawAttributes'],function(_0x51e50b){return{'name':_0x51e50b[_0xa958('0x2f')],'type':_0x51e50b[_0xa958('0x30')][_0xa958('0x31')]};});_0x374c77[_0xa958('0x32')]=_[_0xa958('0x33')](_0x54ad35,_0xa958('0x2c'));_0x374c77['query']=_[_0xa958('0x34')](_0x23bdbf['query']);_0x374c77['filters']=_[_0xa958('0x35')](_0x374c77[_0xa958('0x32')],_0x374c77[_0xa958('0x36')]);_0x179bc2[_0xa958('0x37')]=_[_0xa958('0x35')](_0x374c77[_0xa958('0x32')],qs[_0xa958('0x38')](_0x23bdbf[_0xa958('0x36')]['fields']));_0x179bc2['attributes']=_0x179bc2[_0xa958('0x37')][_0xa958('0x39')]?_0x179bc2[_0xa958('0x37')]:_0x374c77[_0xa958('0x32')];if(!_0x23bdbf[_0xa958('0x36')]['hasOwnProperty'](_0xa958('0x3a'))){_0x179bc2[_0xa958('0x21')]=qs[_0xa958('0x21')](_0x23bdbf[_0xa958('0x36')]['limit']);_0x179bc2[_0xa958('0x1f')]=qs[_0xa958('0x1f')](_0x23bdbf[_0xa958('0x36')][_0xa958('0x1f')]);}_0x179bc2[_0xa958('0x3b')]=qs['sort'](_0x23bdbf[_0xa958('0x36')][_0xa958('0x3c')]);_0x179bc2[_0xa958('0x3d')]=qs[_0xa958('0x3e')](_[_0xa958('0x3f')](_0x23bdbf[_0xa958('0x36')],_0x374c77[_0xa958('0x3e')]),_0x54ad35);if(_0x23bdbf[_0xa958('0x36')][_0xa958('0x40')]){_0x179bc2[_0xa958('0x3d')]=_['merge'](_0x179bc2[_0xa958('0x3d')],{'$or':_[_0xa958('0x33')](_0x54ad35,function(_0x454a00){if(_0x454a00['type']!==_0xa958('0x41')){var _0x3f9a50={};_0x3f9a50[_0x454a00['name']]={'$like':'%'+_0x23bdbf['query'][_0xa958('0x40')]+'%'};return _0x3f9a50;}})});}_0x179bc2=_['merge']({},_0x179bc2,_0x23bdbf[_0xa958('0x42')]);var _0x5b6251={'where':_0x179bc2[_0xa958('0x3d')]};return db['ContactItemType'][_0xa958('0x22')](_0x5b6251)[_0xa958('0x29')](function(_0x44fa44){_0x283452[_0xa958('0x22')]=_0x44fa44;if(_0x23bdbf[_0xa958('0x36')][_0xa958('0x43')]){_0x179bc2[_0xa958('0x44')]=[{'all':!![]}];}return db[_0xa958('0x2e')]['findAll'](_0x179bc2);})[_0xa958('0x29')](function(_0x38dfb4){_0x283452[_0xa958('0x45')]=_0x38dfb4;return _0x283452;})['then'](respondWithFilteredResult(_0x3d4711,_0x179bc2))['catch'](handleError(_0x3d4711,null));};exports['show']=function(_0x469035,_0x1b41d0){var _0x3bd5dc={'raw':!![],'where':{'id':_0x469035[_0xa958('0x46')]['id']}},_0x155901={};_0x155901['model']=_[_0xa958('0x34')](db[_0xa958('0x2e')][_0xa958('0x47')]);_0x155901[_0xa958('0x36')]=_[_0xa958('0x34')](_0x469035[_0xa958('0x36')]);_0x155901[_0xa958('0x3e')]=_[_0xa958('0x35')](_0x155901[_0xa958('0x32')],_0x155901[_0xa958('0x36')]);_0x3bd5dc[_0xa958('0x37')]=_[_0xa958('0x35')](_0x155901[_0xa958('0x32')],qs[_0xa958('0x38')](_0x469035[_0xa958('0x36')][_0xa958('0x38')]));_0x3bd5dc[_0xa958('0x37')]=_0x3bd5dc['attributes']['length']?_0x3bd5dc['attributes']:_0x155901[_0xa958('0x32')];if(_0x469035[_0xa958('0x36')][_0xa958('0x43')]){_0x3bd5dc[_0xa958('0x44')]=[{'all':!![]}];}_0x3bd5dc=_['merge']({},_0x3bd5dc,_0x469035[_0xa958('0x42')]);return db[_0xa958('0x2e')][_0xa958('0x48')](_0x3bd5dc)[_0xa958('0x29')](handleEntityNotFound(_0x1b41d0,null))[_0xa958('0x29')](respondWithResult(_0x1b41d0,null))['catch'](handleError(_0x1b41d0,null));};exports[_0xa958('0x49')]=function(_0x2bbb2e,_0x3f8407){return db['ContactItemType'][_0xa958('0x49')](_0x2bbb2e['body'],{})[_0xa958('0x29')](function(_0x26e79b){var _0x414fb1=_0x2bbb2e['user'][_0xa958('0x2a')]({'plain':!![]});if(!_0x414fb1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x414fb1[_0xa958('0x4a')]===_0xa958('0x4b')){var _0x85fc0d=_0x26e79b[_0xa958('0x2a')]({'plain':!![]});var _0x472d96='ContactItemTypes';return db[_0xa958('0x4c')]['find']({'where':{'name':_0x472d96,'userProfileId':_0x414fb1[_0xa958('0x4d')]},'raw':!![]})[_0xa958('0x29')](function(_0x47e4ca){if(_0x47e4ca&&_0x47e4ca[_0xa958('0x4e')]===0x0){return db['UserProfileResource'][_0xa958('0x49')]({'name':_0x85fc0d[_0xa958('0x2c')],'resourceId':_0x85fc0d['id'],'type':_0x47e4ca[_0xa958('0x2c')],'sectionId':_0x47e4ca['id']},{})[_0xa958('0x29')](function(){return _0x26e79b;});}else{return _0x26e79b;}})[_0xa958('0x4f')](function(_0x65f37f){logger[_0xa958('0x50')](_0xa958('0x51'),_0x65f37f);throw _0x65f37f;});}return _0x26e79b;})[_0xa958('0x29')](respondWithResult(_0x3f8407,0xc9))['catch'](handleError(_0x3f8407,null));};exports[_0xa958('0x27')]=function(_0x5411e0,_0x9c407e){if(_0x5411e0[_0xa958('0x52')]['id']){delete _0x5411e0[_0xa958('0x52')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x5411e0[_0xa958('0x46')]['id']}})[_0xa958('0x29')](handleEntityNotFound(_0x9c407e,null))[_0xa958('0x29')](saveUpdates(_0x5411e0[_0xa958('0x52')],null))['then'](respondWithResult(_0x9c407e,null))[_0xa958('0x4f')](handleError(_0x9c407e,null));};exports[_0xa958('0x28')]=function(_0x4cf7af,_0x1b3b46){return db[_0xa958('0x2e')]['find']({'where':{'id':_0x4cf7af[_0xa958('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b3b46,null))['then'](db['CmContactHasItem'][_0xa958('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4cf7af[_0xa958('0x46')]['id']}}))[_0xa958('0x29')](removeEntity(_0x1b3b46,null))[_0xa958('0x4f')](handleError(_0x1b3b46,null));}; \ No newline at end of file +var _0x4213=['model','map','query','keys','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','filters','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','destroy','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','save','update','then','get','UserProfileResource','error','name','send','ContactItemType','fieldName','type','key'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x4213,0x77));var _0x3421=function(_0x2c7d91,_0x24c096){_0x2c7d91=_0x2c7d91-0x0;var _0x24ff3f=_0x4213[_0x2c7d91];return _0x24ff3f;};'use strict';var emlformat=require(_0x3421('0x0'));var rimraf=require(_0x3421('0x1'));var zipdir=require(_0x3421('0x2'));var jsonpatch=require(_0x3421('0x3'));var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require('mustache');var util=require(_0x3421('0x7'));var path=require('path');var sox=require(_0x3421('0x8'));var csv=require(_0x3421('0x9'));var ejs=require(_0x3421('0xa'));var fs=require('fs');var fs_extra=require(_0x3421('0xb'));var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0x9'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3421('0x12'));var logger=require(_0x3421('0x13'))(_0x3421('0x14'));var utils=require(_0x3421('0x15'));var config=require(_0x3421('0x16'));var licenseUtil=require(_0x3421('0x17'));var db=require(_0x3421('0x18'))['db'];function respondWithStatusCode(_0x59eaf1,_0x26d459){_0x26d459=_0x26d459||0xcc;return function(_0x3e2ecd){if(_0x3e2ecd){return _0x59eaf1[_0x3421('0x19')](_0x26d459);}return _0x59eaf1[_0x3421('0x1a')](_0x26d459)[_0x3421('0x1b')]();};}function respondWithResult(_0x3f4672,_0x25ffd4){_0x25ffd4=_0x25ffd4||0xc8;return function(_0x59ea4a){if(_0x59ea4a){return _0x3f4672[_0x3421('0x1a')](_0x25ffd4)['json'](_0x59ea4a);}};}function respondWithFilteredResult(_0x372d21,_0x5257ad){return function(_0x59ae45){if(_0x59ae45){var _0x1e33ab=typeof _0x5257ad['offset']===_0x3421('0x1c')&&typeof _0x5257ad[_0x3421('0x1d')]==='undefined';var _0x3584d6=_0x59ae45[_0x3421('0x1e')];var _0x130d3c=_0x1e33ab?0x0:_0x5257ad[_0x3421('0x1f')];var _0x18acc1=_0x1e33ab?_0x59ae45[_0x3421('0x1e')]:_0x5257ad[_0x3421('0x1f')]+_0x5257ad[_0x3421('0x1d')];var _0x197b83;if(_0x18acc1>=_0x3584d6){_0x18acc1=_0x3584d6;_0x197b83=0xc8;}else{_0x197b83=0xce;}_0x372d21[_0x3421('0x1a')](_0x197b83);return _0x372d21[_0x3421('0x20')]('Content-Range',_0x130d3c+'-'+_0x18acc1+'/'+_0x3584d6)[_0x3421('0x21')](_0x59ae45);}return null;};}function patchUpdates(_0x4b59a5){return function(_0x5820f6){try{jsonpatch['apply'](_0x5820f6,_0x4b59a5,!![]);}catch(_0x33155b){return BPromise[_0x3421('0x22')](_0x33155b);}return _0x5820f6[_0x3421('0x23')]();};}function saveUpdates(_0x256cc5,_0x132e8e){return function(_0x39bed4){if(_0x39bed4){return _0x39bed4[_0x3421('0x24')](_0x256cc5)[_0x3421('0x25')](function(_0xb9af5f){return _0xb9af5f;});}return null;};}function removeEntity(_0x34389e,_0x48fb3d){return function(_0x57a4af){if(_0x57a4af){return _0x57a4af['destroy']()[_0x3421('0x25')](function(){var _0x958899=_0x57a4af[_0x3421('0x26')]({'plain':!![]});var _0x5bc28a='ContactItemTypes';return db[_0x3421('0x27')]['destroy']({'where':{'type':_0x5bc28a,'resourceId':_0x958899['id']}})[_0x3421('0x25')](function(){return _0x57a4af;});})['then'](function(){_0x34389e[_0x3421('0x1a')](0xcc)[_0x3421('0x1b')]();});}};}function handleEntityNotFound(_0x36d75f,_0x2e6a75){return function(_0x186885){if(!_0x186885){_0x36d75f['sendStatus'](0x194);}return _0x186885;};}function handleError(_0x332017,_0x52fd41){_0x52fd41=_0x52fd41||0x1f4;return function(_0x5efe73){logger[_0x3421('0x28')](_0x5efe73['stack']);if(_0x5efe73['name']){delete _0x5efe73[_0x3421('0x29')];}_0x332017['status'](_0x52fd41)[_0x3421('0x2a')](_0x5efe73);};}exports['index']=function(_0xc7f9fb,_0xbe9f09){var _0x48d828={},_0x3f7c0b={},_0x3bc7c1={'count':0x0,'rows':[]};var _0x420349=_['map'](db[_0x3421('0x2b')]['rawAttributes'],function(_0x2b5af4){return{'name':_0x2b5af4[_0x3421('0x2c')],'type':_0x2b5af4[_0x3421('0x2d')][_0x3421('0x2e')]};});_0x3f7c0b[_0x3421('0x2f')]=_[_0x3421('0x30')](_0x420349,_0x3421('0x29'));_0x3f7c0b[_0x3421('0x31')]=_[_0x3421('0x32')](_0xc7f9fb[_0x3421('0x31')]);_0x3f7c0b['filters']=_['intersection'](_0x3f7c0b[_0x3421('0x2f')],_0x3f7c0b[_0x3421('0x31')]);_0x48d828['attributes']=_[_0x3421('0x33')](_0x3f7c0b[_0x3421('0x2f')],qs[_0x3421('0x34')](_0xc7f9fb[_0x3421('0x31')][_0x3421('0x34')]));_0x48d828['attributes']=_0x48d828[_0x3421('0x35')][_0x3421('0x36')]?_0x48d828[_0x3421('0x35')]:_0x3f7c0b['model'];if(!_0xc7f9fb[_0x3421('0x31')]['hasOwnProperty'](_0x3421('0x37'))){_0x48d828[_0x3421('0x1d')]=qs[_0x3421('0x1d')](_0xc7f9fb[_0x3421('0x31')][_0x3421('0x1d')]);_0x48d828[_0x3421('0x1f')]=qs[_0x3421('0x1f')](_0xc7f9fb['query']['offset']);}_0x48d828['order']=qs[_0x3421('0x38')](_0xc7f9fb['query']['sort']);_0x48d828[_0x3421('0x39')]=qs['filters'](_[_0x3421('0x3a')](_0xc7f9fb[_0x3421('0x31')],_0x3f7c0b['filters']),_0x420349);if(_0xc7f9fb[_0x3421('0x31')][_0x3421('0x3b')]){_0x48d828[_0x3421('0x39')]=_[_0x3421('0x3c')](_0x48d828['where'],{'$or':_[_0x3421('0x30')](_0x420349,function(_0x2745c9){if(_0x2745c9[_0x3421('0x2d')]!==_0x3421('0x3d')){var _0x25de09={};_0x25de09[_0x2745c9['name']]={'$like':'%'+_0xc7f9fb[_0x3421('0x31')][_0x3421('0x3b')]+'%'};return _0x25de09;}})});}_0x48d828=_['merge']({},_0x48d828,_0xc7f9fb[_0x3421('0x3e')]);var _0x5daa14={'where':_0x48d828['where']};return db['ContactItemType'][_0x3421('0x1e')](_0x5daa14)[_0x3421('0x25')](function(_0x41bdb7){_0x3bc7c1[_0x3421('0x1e')]=_0x41bdb7;if(_0xc7f9fb[_0x3421('0x31')][_0x3421('0x3f')]){_0x48d828[_0x3421('0x40')]=[{'all':!![]}];}return db[_0x3421('0x2b')][_0x3421('0x41')](_0x48d828);})[_0x3421('0x25')](function(_0x3b9d15){_0x3bc7c1[_0x3421('0x42')]=_0x3b9d15;return _0x3bc7c1;})[_0x3421('0x25')](respondWithFilteredResult(_0xbe9f09,_0x48d828))[_0x3421('0x43')](handleError(_0xbe9f09,null));};exports['show']=function(_0x3076eb,_0x2e7c59){var _0x139d55={'raw':!![],'where':{'id':_0x3076eb['params']['id']}},_0x4466be={};_0x4466be[_0x3421('0x2f')]=_['keys'](db[_0x3421('0x2b')][_0x3421('0x44')]);_0x4466be[_0x3421('0x31')]=_[_0x3421('0x32')](_0x3076eb[_0x3421('0x31')]);_0x4466be[_0x3421('0x45')]=_[_0x3421('0x33')](_0x4466be[_0x3421('0x2f')],_0x4466be[_0x3421('0x31')]);_0x139d55[_0x3421('0x35')]=_[_0x3421('0x33')](_0x4466be[_0x3421('0x2f')],qs[_0x3421('0x34')](_0x3076eb['query'][_0x3421('0x34')]));_0x139d55['attributes']=_0x139d55[_0x3421('0x35')][_0x3421('0x36')]?_0x139d55[_0x3421('0x35')]:_0x4466be[_0x3421('0x2f')];if(_0x3076eb[_0x3421('0x31')][_0x3421('0x3f')]){_0x139d55[_0x3421('0x40')]=[{'all':!![]}];}_0x139d55=_[_0x3421('0x3c')]({},_0x139d55,_0x3076eb[_0x3421('0x3e')]);return db[_0x3421('0x2b')]['find'](_0x139d55)[_0x3421('0x25')](handleEntityNotFound(_0x2e7c59,null))[_0x3421('0x25')](respondWithResult(_0x2e7c59,null))[_0x3421('0x43')](handleError(_0x2e7c59,null));};exports['create']=function(_0x566f95,_0x43a94f){return db[_0x3421('0x2b')][_0x3421('0x46')](_0x566f95['body'],{})[_0x3421('0x25')](function(_0x18eba6){var _0x213e27=_0x566f95[_0x3421('0x47')]['get']({'plain':!![]});if(!_0x213e27)throw new Error(_0x3421('0x48'));if(_0x213e27[_0x3421('0x49')]===_0x3421('0x47')){var _0x51a21f=_0x18eba6['get']({'plain':!![]});var _0x5a2004=_0x3421('0x4a');return db[_0x3421('0x4b')]['find']({'where':{'name':_0x5a2004,'userProfileId':_0x213e27['userProfileId']},'raw':!![]})[_0x3421('0x25')](function(_0x42934d){if(_0x42934d&&_0x42934d[_0x3421('0x4c')]===0x0){return db[_0x3421('0x27')][_0x3421('0x46')]({'name':_0x51a21f['name'],'resourceId':_0x51a21f['id'],'type':_0x42934d[_0x3421('0x29')],'sectionId':_0x42934d['id']},{})[_0x3421('0x25')](function(){return _0x18eba6;});}else{return _0x18eba6;}})[_0x3421('0x43')](function(_0x2f9ce1){logger['error'](_0x3421('0x4d'),_0x2f9ce1);throw _0x2f9ce1;});}return _0x18eba6;})[_0x3421('0x25')](respondWithResult(_0x43a94f,0xc9))[_0x3421('0x43')](handleError(_0x43a94f,null));};exports['update']=function(_0x5f97d5,_0x5c73ae){if(_0x5f97d5['body']['id']){delete _0x5f97d5[_0x3421('0x4e')]['id'];}return db['ContactItemType'][_0x3421('0x4f')]({'where':{'id':_0x5f97d5[_0x3421('0x50')]['id']}})[_0x3421('0x25')](handleEntityNotFound(_0x5c73ae,null))['then'](saveUpdates(_0x5f97d5[_0x3421('0x4e')],null))[_0x3421('0x25')](respondWithResult(_0x5c73ae,null))[_0x3421('0x43')](handleError(_0x5c73ae,null));};exports[_0x3421('0x51')]=function(_0x1c73b9,_0x4738e7){return db[_0x3421('0x2b')][_0x3421('0x4f')]({'where':{'id':_0x1c73b9[_0x3421('0x50')]['id']}})['then'](handleEntityNotFound(_0x4738e7,null))[_0x3421('0x25')](db[_0x3421('0x52')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1c73b9[_0x3421('0x50')]['id']}}))[_0x3421('0x25')](removeEntity(_0x4738e7,null))[_0x3421('0x43')](handleError(_0x4738e7,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 574e3f1..1c72a69 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 _0xc218=['ContactItemType','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define'];(function(_0x3987d4,_0x5c1fb9){var _0xc65153=function(_0xba822){while(--_0xba822){_0x3987d4['push'](_0x3987d4['shift']());}};_0xc65153(++_0x5c1fb9);}(_0xc218,0x9c));var _0x8c21=function(_0x34e294,_0x28be0d){_0x34e294=_0x34e294-0x0;var _0x464247=_0xc218[_0x34e294];return _0x464247;};'use strict';var _=require(_0x8c21('0x0'));var util=require('util');var logger=require(_0x8c21('0x1'))(_0x8c21('0x2'));var moment=require(_0x8c21('0x3'));var BPromise=require(_0x8c21('0x4'));var rp=require(_0x8c21('0x5'));var fs=require('fs');var path=require(_0x8c21('0x6'));var rimraf=require(_0x8c21('0x7'));var config=require(_0x8c21('0x8'));var attributes=require(_0x8c21('0x9'));module[_0x8c21('0xa')]=function(_0x4859f2,_0x183b30){return _0x4859f2[_0x8c21('0xb')](_0x8c21('0xc'),attributes,{'tableName':_0x8c21('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cdb=['tools_contact_item_types','../../config/logger','api','bluebird','request-promise','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x9cdb,0x14b));var _0xb9cd=function(_0x120a47,_0xeb0bbf){_0x120a47=_0x120a47-0x0;var _0x30f714=_0x9cdb[_0x120a47];return _0x30f714;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9cd('0x0'))(_0xb9cd('0x1'));var moment=require('moment');var BPromise=require(_0xb9cd('0x2'));var rp=require(_0xb9cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb9cd('0x4'));var attributes=require(_0xb9cd('0x5'));module[_0xb9cd('0x6')]=function(_0x5c77f4,_0x29cbb6){return _0x5c77f4[_0xb9cd('0x7')](_0xb9cd('0x8'),attributes,{'tableName':_0xb9cd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 875178a..7d3845c 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 _0x9acc=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s'];(function(_0x19e4fd,_0x3ad75b){var _0xcb98a=function(_0xa16adc){while(--_0xa16adc){_0x19e4fd['push'](_0x19e4fd['shift']());}};_0xcb98a(++_0x3ad75b);}(_0x9acc,0x175));var _0xc9ac=function(_0x1956a9,_0x265954){_0x1956a9=_0x1956a9-0x0;var _0x42f25b=_0x9acc[_0x1956a9];return _0x42f25b;};'use strict';var _=require(_0xc9ac('0x0'));var util=require(_0xc9ac('0x1'));var moment=require(_0xc9ac('0x2'));var BPromise=require(_0xc9ac('0x3'));var rs=require(_0xc9ac('0x4'));var fs=require('fs');var Redis=require(_0xc9ac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9ac('0x6'));var logger=require('../../config/logger')(_0xc9ac('0x7'));var config=require('../../config/environment');var jayson=require(_0xc9ac('0x8'));var client=jayson[_0xc9ac('0x9')][_0xc9ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8307,_0x212dcc,_0x391c03){return new BPromise(function(_0x387423,_0x1d552a){return client[_0xc9ac('0xb')](_0x1c8307,_0x391c03)[_0xc9ac('0xc')](function(_0x38fce0){logger[_0xc9ac('0xd')](_0xc9ac('0xe'),_0x212dcc,_0xc9ac('0xf'));logger[_0xc9ac('0x10')](_0xc9ac('0x11'),_0x212dcc,_0xc9ac('0xf'),JSON[_0xc9ac('0x12')](_0x38fce0));if(_0x38fce0[_0xc9ac('0x13')]){if(_0x38fce0[_0xc9ac('0x13')]['code']===0x1f4){logger[_0xc9ac('0x13')](_0xc9ac('0xe'),_0x212dcc,_0x38fce0['error'][_0xc9ac('0x14')]);return _0x1d552a(_0x38fce0[_0xc9ac('0x13')][_0xc9ac('0x14')]);}logger['error'](_0xc9ac('0xe'),_0x212dcc,_0x38fce0[_0xc9ac('0x13')]['message']);return _0x387423(_0x38fce0[_0xc9ac('0x13')][_0xc9ac('0x14')]);}else{logger['info'](_0xc9ac('0xe'),_0x212dcc,_0xc9ac('0xf'));_0x387423(_0x38fce0[_0xc9ac('0x15')][_0xc9ac('0x14')]);}})[_0xc9ac('0x16')](function(_0x3727b5){logger[_0xc9ac('0x13')](_0xc9ac('0xe'),_0x212dcc,_0x3727b5);_0x1d552a(_0x3727b5);});});} \ No newline at end of file +var _0xe664=['then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','rpc','../../config/environment','client','request'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xe664,0x1c4));var _0x4e66=function(_0x435379,_0x507bf0){_0x435379=_0x435379-0x0;var _0x2cf12b=_0xe664[_0x435379];return _0x2cf12b;};'use strict';var _=require(_0x4e66('0x0'));var util=require(_0x4e66('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4e66('0x2'));var fs=require('fs');var Redis=require(_0x4e66('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e66('0x4'));var config=require(_0x4e66('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4e66('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x531df6,_0x6f981f,_0x42365f){return new BPromise(function(_0x2c645a,_0x436928){return client[_0x4e66('0x7')](_0x531df6,_0x42365f)[_0x4e66('0x8')](function(_0x6a1ae3){logger[_0x4e66('0x9')](_0x4e66('0xa'),_0x6f981f,'request\x20sent');logger[_0x4e66('0xb')](_0x4e66('0xc'),_0x6f981f,'request\x20sent',JSON[_0x4e66('0xd')](_0x6a1ae3));if(_0x6a1ae3[_0x4e66('0xe')]){if(_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0xf')]===0x1f4){logger['error'](_0x4e66('0xa'),_0x6f981f,_0x6a1ae3['error']['message']);return _0x436928(_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0x10')]);}logger[_0x4e66('0xe')](_0x4e66('0xa'),_0x6f981f,_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0x10')]);return _0x2c645a(_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0x10')]);}else{logger[_0x4e66('0x9')](_0x4e66('0xa'),_0x6f981f,_0x4e66('0x11'));_0x2c645a(_0x6a1ae3[_0x4e66('0x12')]['message']);}})[_0x4e66('0x13')](function(_0x3c4a78){logger['error'](_0x4e66('0xa'),_0x6f981f,_0x3c4a78);_0x436928(_0x3c4a78);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 4304d83..bc0af36 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 _0xdcdf=['/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','show','post','create','update','delete'];(function(_0x5c66fb,_0x54af77){var _0x151365=function(_0x586b62){while(--_0x586b62){_0x5c66fb['push'](_0x5c66fb['shift']());}};_0x151365(++_0x54af77);}(_0xdcdf,0x17e));var _0xfdcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcdf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfdcd('0x0'));var util=require(_0xfdcd('0x1'));var path=require(_0xfdcd('0x2'));var timeout=require('connect-timeout');var express=require(_0xfdcd('0x3'));var router=express[_0xfdcd('0x4')]();var fs_extra=require(_0xfdcd('0x5'));var auth=require(_0xfdcd('0x6'));var interaction=require(_0xfdcd('0x7'));var config=require(_0xfdcd('0x8'));var controller=require(_0xfdcd('0x9'));router[_0xfdcd('0xa')]('/',auth[_0xfdcd('0xb')](),controller[_0xfdcd('0xc')]);router[_0xfdcd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xfdcd('0xd')]);router[_0xfdcd('0xe')]('/',auth['isAuthenticated'](),controller[_0xfdcd('0xf')]);router['put']('/:id',auth[_0xfdcd('0xb')](),controller[_0xfdcd('0x10')]);router[_0xfdcd('0x11')](_0xfdcd('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xfdcd('0x13')]=router; \ No newline at end of file +var _0xbe36=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x289330,_0x54f85a){var _0x22d2d0=function(_0x4bdcf9){while(--_0x4bdcf9){_0x289330['push'](_0x289330['shift']());}};_0x22d2d0(++_0x54f85a);}(_0xbe36,0xd7));var _0x6be3=function(_0x1c6c8e,_0x2ef74c){_0x1c6c8e=_0x1c6c8e-0x0;var _0x354d96=_0xbe36[_0x1c6c8e];return _0x354d96;};'use strict';var multer=require('multer');var util=require(_0x6be3('0x0'));var path=require(_0x6be3('0x1'));var timeout=require(_0x6be3('0x2'));var express=require(_0x6be3('0x3'));var router=express[_0x6be3('0x4')]();var fs_extra=require(_0x6be3('0x5'));var auth=require(_0x6be3('0x6'));var interaction=require(_0x6be3('0x7'));var config=require(_0x6be3('0x8'));var controller=require(_0x6be3('0x9'));router[_0x6be3('0xa')]('/',auth['isAuthenticated'](),controller[_0x6be3('0xb')]);router[_0x6be3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6be3('0xc')]);router[_0x6be3('0xd')]('/',auth[_0x6be3('0xe')](),controller[_0x6be3('0xf')]);router[_0x6be3('0x10')](_0x6be3('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x6be3('0x12')](_0x6be3('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x6be3('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 6ceef16..b23f3d6 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x4f4033,_0x2378b9){var _0x2051ec=function(_0x573fc0){while(--_0x573fc0){_0x4f4033['push'](_0x4f4033['shift']());}};_0x2051ec(++_0x2378b9);}(_0x757a,0xde));var _0xa757=function(_0x3223d8,_0x3c63f8){_0x3223d8=_0x3223d8-0x0;var _0x2737b1=_0x757a[_0x3223d8];return _0x2737b1;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe706,0xa3));var _0x6e70=function(_0x56503a,_0x1c4b81){_0x56503a=_0x56503a-0x0;var _0x52e0d4=_0xe706[_0x56503a];return _0x52e0d4;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 64cbd99..cb424f0 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 _0x095f=['request-promise','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','redis','./dashboard.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','CustomDashboards','UserProfileResource','destroy','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','include','omit','createdAt','updatedAt','body','update','iframe','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','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','rimraf','zip-dir','fast-json-patch'];(function(_0x33ac28,_0xbcde95){var _0x263076=function(_0xa46653){while(--_0xa46653){_0x33ac28['push'](_0x33ac28['shift']());}};_0x263076(++_0xbcde95);}(_0x095f,0x79));var _0xf095=function(_0x3e8836,_0xf9d1a0){_0x3e8836=_0x3e8836-0x0;var _0x48f9e5=_0x095f[_0x3e8836];return _0x48f9e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf095('0x0'));var zipdir=require(_0xf095('0x1'));var jsonpatch=require(_0xf095('0x2'));var rp=require(_0xf095('0x3'));var moment=require('moment');var BPromise=require(_0xf095('0x4'));var Mustache=require(_0xf095('0x5'));var util=require('util');var path=require(_0xf095('0x6'));var sox=require(_0xf095('0x7'));var csv=require(_0xf095('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf095('0x9'));var crypto=require(_0xf095('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf095('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf095('0xc'));var Papa=require(_0xf095('0xd'));var Redis=require(_0xf095('0xe'));var authService=require(_0xf095('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf095('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf095('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf095('0x12'))['db'];config['redis']=_['defaults'](config[_0xf095('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf095('0x13')]));require(_0xf095('0x14'))[_0xf095('0x15')](socket);function respondWithStatusCode(_0x4c2db0,_0x53aecb){_0x53aecb=_0x53aecb||0xcc;return function(_0x2bf472){if(_0x2bf472){return _0x4c2db0[_0xf095('0x16')](_0x53aecb);}return _0x4c2db0[_0xf095('0x17')](_0x53aecb)[_0xf095('0x18')]();};}function respondWithResult(_0xdda832,_0x4698d8){_0x4698d8=_0x4698d8||0xc8;return function(_0x29ccac){if(_0x29ccac){return _0xdda832['status'](_0x4698d8)['json'](_0x29ccac);}};}function respondWithFilteredResult(_0x2b031f,_0x4928b9){return function(_0xa7c441){if(_0xa7c441){var _0x5ecd7a=typeof _0x4928b9[_0xf095('0x19')]===_0xf095('0x1a')&&typeof _0x4928b9[_0xf095('0x1b')]==='undefined';var _0x5c2af4=_0xa7c441[_0xf095('0x1c')];var _0x1605c9=_0x5ecd7a?0x0:_0x4928b9[_0xf095('0x19')];var _0x5862dc=_0x5ecd7a?_0xa7c441[_0xf095('0x1c')]:_0x4928b9['offset']+_0x4928b9['limit'];var _0xd41868;if(_0x5862dc>=_0x5c2af4){_0x5862dc=_0x5c2af4;_0xd41868=0xc8;}else{_0xd41868=0xce;}_0x2b031f['status'](_0xd41868);return _0x2b031f[_0xf095('0x1d')](_0xf095('0x1e'),_0x1605c9+'-'+_0x5862dc+'/'+_0x5c2af4)[_0xf095('0x1f')](_0xa7c441);}return null;};}function patchUpdates(_0x3469ce){return function(_0x45a9d0){try{jsonpatch[_0xf095('0x20')](_0x45a9d0,_0x3469ce,!![]);}catch(_0x152c6c){return BPromise[_0xf095('0x21')](_0x152c6c);}return _0x45a9d0[_0xf095('0x22')]();};}function saveUpdates(_0x4b0596,_0x5923bc){return function(_0x16cda1){if(_0x16cda1){return _0x16cda1['update'](_0x4b0596)[_0xf095('0x23')](function(_0xb938e2){return _0xb938e2;});}return null;};}function removeEntity(_0x1cfa1b,_0x114887){return function(_0x88b80e){if(_0x88b80e){return _0x88b80e['destroy']()[_0xf095('0x23')](function(){var _0x32dd67=_0x88b80e[_0xf095('0x24')]({'plain':!![]});var _0x5f5b0c=_0xf095('0x25');return db[_0xf095('0x26')][_0xf095('0x27')]({'where':{'type':_0x5f5b0c,'resourceId':_0x32dd67['id']}})[_0xf095('0x23')](function(){return _0x88b80e;});})[_0xf095('0x23')](function(){_0x1cfa1b['status'](0xcc)[_0xf095('0x18')]();});}};}function handleEntityNotFound(_0xbb9c98,_0x3c006c){return function(_0x53bec4){if(!_0x53bec4){_0xbb9c98[_0xf095('0x16')](0x194);}return _0x53bec4;};}function handleError(_0x192d89,_0x96297a){_0x96297a=_0x96297a||0x1f4;return function(_0x5a0ba8){logger[_0xf095('0x28')](_0x5a0ba8[_0xf095('0x29')]);if(_0x5a0ba8[_0xf095('0x2a')]){delete _0x5a0ba8['name'];}_0x192d89['status'](_0x96297a)['send'](_0x5a0ba8);};}exports[_0xf095('0x2b')]=function(_0x427fc5,_0x5ee1ca){var _0x32e55b={},_0x29bbec={},_0x25336a={'count':0x0,'rows':[]};var _0x359f94=_[_0xf095('0x2c')](db[_0xf095('0x2d')][_0xf095('0x2e')],function(_0x3814ce){return{'name':_0x3814ce[_0xf095('0x2f')],'type':_0x3814ce[_0xf095('0x30')][_0xf095('0x31')]};});_0x29bbec['model']=_[_0xf095('0x2c')](_0x359f94,_0xf095('0x2a'));_0x29bbec[_0xf095('0x32')]=_[_0xf095('0x33')](_0x427fc5[_0xf095('0x32')]);_0x29bbec[_0xf095('0x34')]=_[_0xf095('0x35')](_0x29bbec['model'],_0x29bbec[_0xf095('0x32')]);_0x32e55b[_0xf095('0x36')]=_['intersection'](_0x29bbec[_0xf095('0x37')],qs['fields'](_0x427fc5[_0xf095('0x32')][_0xf095('0x38')]));_0x32e55b[_0xf095('0x36')]=_0x32e55b[_0xf095('0x36')]['length']?_0x32e55b[_0xf095('0x36')]:_0x29bbec[_0xf095('0x37')];if(!_0x427fc5[_0xf095('0x32')]['hasOwnProperty'](_0xf095('0x39'))){_0x32e55b[_0xf095('0x1b')]=qs[_0xf095('0x1b')](_0x427fc5[_0xf095('0x32')][_0xf095('0x1b')]);_0x32e55b['offset']=qs[_0xf095('0x19')](_0x427fc5['query'][_0xf095('0x19')]);}_0x32e55b[_0xf095('0x3a')]=qs[_0xf095('0x3b')](_0x427fc5[_0xf095('0x32')][_0xf095('0x3b')]);_0x32e55b[_0xf095('0x3c')]=qs[_0xf095('0x34')](_[_0xf095('0x3d')](_0x427fc5[_0xf095('0x32')],_0x29bbec[_0xf095('0x34')]),_0x359f94);if(_0x427fc5[_0xf095('0x32')]['filter']){_0x32e55b[_0xf095('0x3c')]=_[_0xf095('0x3e')](_0x32e55b[_0xf095('0x3c')],{'$or':_['map'](_0x359f94,function(_0x4d3bc9){if(_0x4d3bc9[_0xf095('0x30')]!==_0xf095('0x3f')){var _0x3b1988={};_0x3b1988[_0x4d3bc9[_0xf095('0x2a')]]={'$like':'%'+_0x427fc5[_0xf095('0x32')][_0xf095('0x40')]+'%'};return _0x3b1988;}})});}_0x32e55b=_['merge']({},_0x32e55b,_0x427fc5[_0xf095('0x41')]);var _0x1089b2={'where':_0x32e55b[_0xf095('0x3c')]};return db[_0xf095('0x2d')][_0xf095('0x1c')](_0x1089b2)[_0xf095('0x23')](function(_0x4cdb64){_0x25336a[_0xf095('0x1c')]=_0x4cdb64;if(_0x427fc5[_0xf095('0x32')]['includeAll']){_0x32e55b['include']=[{'all':!![]}];}return db[_0xf095('0x2d')][_0xf095('0x42')](_0x32e55b);})[_0xf095('0x23')](function(_0x364ab2){_0x25336a[_0xf095('0x43')]=_0x364ab2;return _0x25336a;})[_0xf095('0x23')](respondWithFilteredResult(_0x5ee1ca,_0x32e55b))[_0xf095('0x44')](handleError(_0x5ee1ca,null));};exports['show']=function(_0x122fed,_0x3f4ae9){var _0x2de56e={'raw':![],'where':{'id':_0x122fed[_0xf095('0x45')]['id']}},_0x4a5114={};_0x4a5114[_0xf095('0x37')]=_[_0xf095('0x33')](db[_0xf095('0x2d')][_0xf095('0x2e')]);_0x4a5114[_0xf095('0x32')]=_[_0xf095('0x33')](_0x122fed[_0xf095('0x32')]);_0x4a5114['filters']=_['intersection'](_0x4a5114[_0xf095('0x37')],_0x4a5114['query']);_0x2de56e['attributes']=_[_0xf095('0x35')](_0x4a5114['model'],qs[_0xf095('0x38')](_0x122fed[_0xf095('0x32')]['fields']));_0x2de56e[_0xf095('0x36')]=_0x2de56e[_0xf095('0x36')][_0xf095('0x46')]?_0x2de56e[_0xf095('0x36')]:_0x4a5114[_0xf095('0x37')];if(_0x122fed['query'][_0xf095('0x47')]){_0x2de56e['include']=[{'all':!![]}];}_0x2de56e=_['merge']({},_0x2de56e,_0x122fed[_0xf095('0x41')]);return db[_0xf095('0x2d')][_0xf095('0x48')](_0x2de56e)[_0xf095('0x23')](handleEntityNotFound(_0x3f4ae9,null))[_0xf095('0x23')](respondWithResult(_0x3f4ae9,null))['catch'](handleError(_0x3f4ae9,null));};exports[_0xf095('0x49')]=function(_0x9384de,_0x39b02c){return db['Dashboard'][_0xf095('0x49')](_0x9384de['body'],{})['then'](function(_0x5713ea){var _0x5958d5=_0x9384de[_0xf095('0x4a')]['get']({'plain':!![]});if(!_0x5958d5)throw new Error(_0xf095('0x4b'));if(_0x5958d5['role']===_0xf095('0x4a')){var _0x1c21b8=_0x5713ea[_0xf095('0x24')]({'plain':!![]});var _0x12b3ed=_0xf095('0x25');return db[_0xf095('0x4c')][_0xf095('0x48')]({'where':{'name':_0x12b3ed,'userProfileId':_0x5958d5[_0xf095('0x4d')]},'raw':!![]})[_0xf095('0x23')](function(_0x5285a8){if(_0x5285a8&&_0x5285a8[_0xf095('0x4e')]===0x0){return db['UserProfileResource'][_0xf095('0x49')]({'name':_0x1c21b8[_0xf095('0x2a')],'resourceId':_0x1c21b8['id'],'type':_0x5285a8[_0xf095('0x2a')],'sectionId':_0x5285a8['id']},{})[_0xf095('0x23')](function(){return _0x5713ea;});}else{return _0x5713ea;}})['catch'](function(_0x3a76f6){logger[_0xf095('0x28')](_0xf095('0x4f'),_0x3a76f6);throw _0x3a76f6;});}return _0x5713ea;})[_0xf095('0x23')](respondWithResult(_0x39b02c,0xc9))['catch'](handleError(_0x39b02c,null));};exports['clone']=function(_0x2cee7b,_0x3fc295){var _0x929c6f={'where':{'id':_0x2cee7b['params']['id']}},_0x30da2e={};_0x30da2e[_0xf095('0x37')]=_['keys'](db[_0xf095('0x2d')][_0xf095('0x2e')]);_0x929c6f[_0xf095('0x36')]=_[_0xf095('0x35')](_0x30da2e['model'],qs[_0xf095('0x38')](_0x2cee7b['query'][_0xf095('0x38')]));_0x929c6f['attributes']=_0x929c6f[_0xf095('0x36')][_0xf095('0x46')]?_0x929c6f[_0xf095('0x36')]:_0x30da2e[_0xf095('0x37')];if(_0x2cee7b['query']['includeAll']){_0x929c6f[_0xf095('0x50')]=[{'all':!![]}];}_0x929c6f=_[_0xf095('0x3e')]({},_0x929c6f,_0x2cee7b[_0xf095('0x41')]);return db[_0xf095('0x2d')][_0xf095('0x48')](_0x929c6f)[_0xf095('0x23')](handleEntityNotFound(_0x3fc295,null))[_0xf095('0x23')](function(_0x521792){if(_0x521792){var _0x14eba4=_0x521792[_0xf095('0x24')]({'plain':!![]});_0x14eba4=qs[_0xf095('0x51')](_0x14eba4,['id',_0xf095('0x52'),_0xf095('0x53')]);_0x2cee7b[_0xf095('0x54')]=_[_0xf095('0x51')](_0x2cee7b[_0xf095('0x54')],['id',_0xf095('0x52'),_0xf095('0x53')]);return db['Dashboard'][_0xf095('0x49')](_[_0xf095('0x3e')](_0x14eba4,_0x2cee7b[_0xf095('0x54')]),{'include':_0x2cee7b[_0xf095('0x32')][_0xf095('0x47')]?[{'all':!![]}]:undefined})[_0xf095('0x23')](function(_0x3872c5){var _0x11387f=_0x2cee7b[_0xf095('0x4a')][_0xf095('0x24')]({'plain':!![]});if(!_0x11387f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11387f['role']===_0xf095('0x4a')){var _0x4c4160=_0x3872c5[_0xf095('0x24')]({'plain':!![]});var _0x246169=_0xf095('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x246169,'userProfileId':_0x11387f['userProfileId']},'raw':!![]})[_0xf095('0x23')](function(_0x28c0f9){if(_0x28c0f9&&_0x28c0f9[_0xf095('0x4e')]===0x0){return db[_0xf095('0x26')]['create']({'name':_0x4c4160['name'],'resourceId':_0x4c4160['id'],'type':_0x28c0f9[_0xf095('0x2a')],'sectionId':_0x28c0f9['id']},{})['then'](function(){return _0x3872c5;});}else{return _0x3872c5;}})[_0xf095('0x44')](function(_0x46be0a){logger[_0xf095('0x28')](_0xf095('0x4f'),_0x46be0a);throw _0x46be0a;});}return _0x3872c5;});}})[_0xf095('0x23')](respondWithResult(_0x3fc295,0xc9))[_0xf095('0x44')](handleError(_0x3fc295,null));};exports[_0xf095('0x55')]=function(_0x3c8259,_0x125e7d){if(_0x3c8259[_0xf095('0x54')]['id']){delete _0x3c8259[_0xf095('0x54')]['id'];}return db['Dashboard'][_0xf095('0x48')]({'where':{'id':_0x3c8259[_0xf095('0x45')]['id']}})[_0xf095('0x23')](handleEntityNotFound(_0x125e7d,null))[_0xf095('0x23')](saveUpdates(_0x3c8259[_0xf095('0x54')],null))[_0xf095('0x23')](respondWithResult(_0x125e7d,null))['catch'](handleError(_0x125e7d,null));};exports[_0xf095('0x27')]=function(_0x3f3849,_0x5d72ba){return db[_0xf095('0x2d')][_0xf095('0x48')]({'where':{'id':_0x3f3849[_0xf095('0x45')]['id']}})[_0xf095('0x23')](handleEntityNotFound(_0x5d72ba,null))['then'](removeEntity(_0x5d72ba,null))[_0xf095('0x44')](handleError(_0x5d72ba,null));};function widgetAttributes(_0x3a79ba){try{switch(_0x3a79ba['type']){case _0xf095('0x56'):return[{'name':_0xf095('0x57'),'value':_0x3a79ba[_0xf095('0x57')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x0]?_0x3a79ba[_0xf095('0x58')][0x0][_0xf095('0x59')]:undefined)||_0xf095('0x5a')}];case _0xf095('0x5b'):return[{'name':'attrPath','value':_0x3a79ba[_0xf095('0x5c')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x0]?_0x3a79ba['attrs'][0x0]['value']:undefined)||''}];case _0xf095('0x5d'):return[{'name':_0xf095('0x5e'),'value':_0x3a79ba['attrHourFormat']||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x0]?_0x3a79ba[_0xf095('0x58')][0x0]['value']:undefined)||_0xf095('0x5f')},{'name':_0xf095('0x60'),'value':_0x3a79ba[_0xf095('0x60')]||(_0x3a79ba['attrs']&&_0x3a79ba[_0xf095('0x58')][0x1]?_0x3a79ba[_0xf095('0x58')][0x1][_0xf095('0x59')]:undefined)||_0xf095('0x61')},{'name':_0xf095('0x62'),'value':_0x3a79ba[_0xf095('0x62')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x2]?_0x3a79ba[_0xf095('0x58')][0x2][_0xf095('0x59')]:undefined)||0xc}];case _0xf095('0x63'):return[{'name':_0xf095('0x64'),'value':_0x3a79ba[_0xf095('0x64')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x0]?_0x3a79ba[_0xf095('0x58')][0x0][_0xf095('0x59')]:undefined)||_0xf095('0x65')},{'name':_0xf095('0x66'),'value':_0x3a79ba[_0xf095('0x66')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x1]?_0x3a79ba[_0xf095('0x58')][0x1][_0xf095('0x59')]:undefined)||[]},{'name':_0xf095('0x62'),'value':_0x3a79ba[_0xf095('0x62')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x2]?_0x3a79ba[_0xf095('0x58')][0x2]['value']:undefined)||0x14},{'name':_0xf095('0x67'),'value':_0x3a79ba[_0xf095('0x67')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba['attrs'][0x3]?_0x3a79ba[_0xf095('0x58')][0x3][_0xf095('0x59')]:undefined)||'voice'},{'name':_0xf095('0x68'),'value':_0x3a79ba[_0xf095('0x68')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x4]?_0x3a79ba['attrs'][0x4][_0xf095('0x59')]:undefined)||''},{'name':_0xf095('0x69'),'value':_0x3a79ba[_0xf095('0x69')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x5]?_0x3a79ba[_0xf095('0x58')][0x5][_0xf095('0x59')]:undefined)||''},{'name':_0xf095('0x6a'),'value':_0x3a79ba[_0xf095('0x6a')]||(_0x3a79ba['attrs']&&_0x3a79ba[_0xf095('0x58')][0x6]?_0x3a79ba[_0xf095('0x58')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3a79ba[_0xf095('0x6b')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x7]?_0x3a79ba[_0xf095('0x58')][0x7][_0xf095('0x59')]:undefined)||''},{'name':_0xf095('0x6c'),'value':_0x3a79ba[_0xf095('0x6c')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x8]?_0x3a79ba[_0xf095('0x58')][0x8][_0xf095('0x59')]:undefined)||''},{'name':_0xf095('0x6d'),'value':_0x3a79ba[_0xf095('0x6d')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x9]?_0x3a79ba[_0xf095('0x58')][0x9][_0xf095('0x59')]:undefined)||''}];case _0xf095('0x6e'):case'pie-chart':return[{'name':_0xf095('0x6f'),'value':_0x3a79ba['attrSerie1']||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba['attrs'][0x0]?_0x3a79ba[_0xf095('0x58')][0x0][_0xf095('0x59')]:undefined)||'total'},{'name':_0xf095('0x70'),'value':_0x3a79ba['attrSerie2']||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x1]?_0x3a79ba[_0xf095('0x58')][0x1][_0xf095('0x59')]:undefined)||null},{'name':_0xf095('0x71'),'value':_0x3a79ba[_0xf095('0x71')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x2]?_0x3a79ba[_0xf095('0x58')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x3a79ba['attrVoiceQueues']||(_0x3a79ba['attrs']&&_0x3a79ba[_0xf095('0x58')][0x3]?_0x3a79ba[_0xf095('0x58')][0x3][_0xf095('0x59')]:undefined)||[]},{'name':_0xf095('0x67'),'value':_0x3a79ba[_0xf095('0x67')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x4]?_0x3a79ba['attrs'][0x4][_0xf095('0x59')]:undefined)||'voice'},{'name':_0xf095('0x68'),'value':_0x3a79ba[_0xf095('0x68')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x5]?_0x3a79ba[_0xf095('0x58')][0x5][_0xf095('0x59')]:undefined)||''},{'name':_0xf095('0x69'),'value':_0x3a79ba['attrFaxAccounts']||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x6]?_0x3a79ba[_0xf095('0x58')][0x6]['value']:undefined)||''},{'name':_0xf095('0x6a'),'value':_0x3a79ba[_0xf095('0x6a')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x7]?_0x3a79ba[_0xf095('0x58')][0x7][_0xf095('0x59')]:undefined)||''},{'name':_0xf095('0x6b'),'value':_0x3a79ba[_0xf095('0x6b')]||(_0x3a79ba['attrs']&&_0x3a79ba[_0xf095('0x58')][0x8]?_0x3a79ba['attrs'][0x8]['value']:undefined)||''},{'name':_0xf095('0x6c'),'value':_0x3a79ba['attrWhatsappAccounts']||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x9]?_0x3a79ba[_0xf095('0x58')][0x9][_0xf095('0x59')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3a79ba[_0xf095('0x6d')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0xa]?_0x3a79ba['attrs'][0xa]['value']:undefined)||''}];case _0xf095('0x72'):return[{'name':_0xf095('0x73'),'type':_0x3a79ba['reportType']||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba['attrs'][0x0]?_0x3a79ba['attrs'][0x0]['type']:undefined)||null,'value':_0x3a79ba[_0xf095('0x73')]||(_0x3a79ba[_0xf095('0x58')]&&_0x3a79ba[_0xf095('0x58')][0x0]?_0x3a79ba[_0xf095('0x58')][0x0][_0xf095('0x59')]:undefined)||null},{'name':_0xf095('0x74'),'value':_0x3a79ba[_0xf095('0x74')]||(_0x3a79ba['attrs']&&_0x3a79ba[_0xf095('0x58')][0x1]?_0x3a79ba['attrs'][0x1][_0xf095('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x2484aa){logger[_0xf095('0x28')](_0xf095('0x75'),JSON['stringify'](_0x2484aa));return[];}}exports[_0xf095('0x76')]=function(_0x283dfb,_0x3eee1d,_0x16f27f){if(_0x283dfb[_0xf095('0x54')]['id']){delete _0x283dfb[_0xf095('0x54')]['id'];}return db[_0xf095('0x2d')][_0xf095('0x48')]({'where':{'id':_0x283dfb[_0xf095('0x45')]['id']}})[_0xf095('0x23')](handleEntityNotFound(_0x3eee1d,null))[_0xf095('0x23')](function(_0x43fc05){if(_0x43fc05){_0x283dfb[_0xf095('0x54')][_0xf095('0x77')]=_0x43fc05['id'];_0x283dfb[_0xf095('0x54')]['attrs']=widgetAttributes(_0x283dfb[_0xf095('0x54')]);return db[_0xf095('0x78')][_0xf095('0x49')](_0x283dfb[_0xf095('0x54')]);}})[_0xf095('0x23')](respondWithResult(_0x3eee1d,null))[_0xf095('0x44')](handleError(_0x3eee1d,null));};exports[_0xf095('0x79')]=function(_0x150b66,_0x5b5e15,_0x1a3fa0){var _0x47343e={};var _0x1b7184={};var _0x8fb8a9;var _0x25f8fc;return db[_0xf095('0x2d')][_0xf095('0x7a')]({'where':{'id':_0x150b66[_0xf095('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b5e15,null))[_0xf095('0x23')](function(_0x560271){if(_0x560271){_0x8fb8a9=_0x560271;_0x1b7184[_0xf095('0x37')]=_[_0xf095('0x33')](db[_0xf095('0x78')][_0xf095('0x2e')]);_0x1b7184[_0xf095('0x32')]=_[_0xf095('0x33')](_0x150b66[_0xf095('0x32')]);_0x1b7184['filters']=_[_0xf095('0x35')](_0x1b7184[_0xf095('0x37')],_0x1b7184['query']);_0x47343e[_0xf095('0x36')]=_[_0xf095('0x35')](_0x1b7184['model'],qs[_0xf095('0x38')](_0x150b66[_0xf095('0x32')][_0xf095('0x38')]));_0x47343e[_0xf095('0x36')]=_0x47343e['attributes']['length']?_0x47343e[_0xf095('0x36')]:_0x1b7184['model'];_0x47343e['order']=qs[_0xf095('0x3b')](_0x150b66['query']['sort']);_0x47343e[_0xf095('0x3c')]=qs[_0xf095('0x34')](_['pick'](_0x150b66['query'],_0x1b7184['filters']));if(_0x150b66[_0xf095('0x32')][_0xf095('0x40')]){_0x47343e[_0xf095('0x3c')]=_[_0xf095('0x3e')](_0x47343e[_0xf095('0x3c')],{'$or':_[_0xf095('0x2c')](_0x47343e[_0xf095('0x36')],function(_0xf718cd){var _0x2cfc45={};_0x2cfc45[_0xf718cd]={'$like':'%'+_0x150b66[_0xf095('0x32')]['filter']+'%'};return _0x2cfc45;})});}_0x47343e=_[_0xf095('0x3e')]({},_0x47343e,_0x150b66[_0xf095('0x41')]);return _0x8fb8a9[_0xf095('0x79')](_0x47343e);}})['then'](function(_0x3c0a74){if(_0x3c0a74){_0x25f8fc=_0x3c0a74[_0xf095('0x46')];if(!_0x150b66[_0xf095('0x32')][_0xf095('0x7b')](_0xf095('0x39'))){_0x47343e[_0xf095('0x1b')]=qs[_0xf095('0x1b')](_0x150b66['query'][_0xf095('0x1b')]);_0x47343e[_0xf095('0x19')]=qs['offset'](_0x150b66[_0xf095('0x32')][_0xf095('0x19')]);}return _0x8fb8a9[_0xf095('0x79')](_0x47343e);}})[_0xf095('0x23')](function(_0x2f7f4b){if(_0x2f7f4b){return _0x2f7f4b?{'count':_0x25f8fc,'rows':_0x2f7f4b}:null;}})[_0xf095('0x23')](respondWithResult(_0x5b5e15,null))[_0xf095('0x44')](handleError(_0x5b5e15,null));}; \ No newline at end of file +var _0x6e7d=['params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','role','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrFaxAccounts','web-report','reportType','attrReport','attrRefresh','stringify','getItems','findOne','DashboardItem','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3a5a50,_0x2f87ca){var _0x3b0f7e=function(_0x37f954){while(--_0x37f954){_0x3a5a50['push'](_0x3a5a50['shift']());}};_0x3b0f7e(++_0x2f87ca);}(_0x6e7d,0xb9));var _0xd6e7=function(_0x532dd0,_0xff1a19){_0x532dd0=_0x532dd0-0x0;var _0x10fef2=_0x6e7d[_0x532dd0];return _0x10fef2;};'use strict';var emlformat=require(_0xd6e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6e7('0x1'));var jsonpatch=require(_0xd6e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd6e7('0x3'));var Mustache=require(_0xd6e7('0x4'));var util=require(_0xd6e7('0x5'));var path=require(_0xd6e7('0x6'));var sox=require('sox');var csv=require(_0xd6e7('0x7'));var ejs=require(_0xd6e7('0x8'));var fs=require('fs');var fs_extra=require(_0xd6e7('0x9'));var _=require('lodash');var squel=require(_0xd6e7('0xa'));var crypto=require(_0xd6e7('0xb'));var jsforce=require(_0xd6e7('0xc'));var deskjs=require(_0xd6e7('0xd'));var toCsv=require(_0xd6e7('0x7'));var querystring=require(_0xd6e7('0xe'));var Papa=require(_0xd6e7('0xf'));var Redis=require(_0xd6e7('0x10'));var authService=require(_0xd6e7('0x11'));var qs=require(_0xd6e7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6e7('0x13'));var logger=require(_0xd6e7('0x14'))(_0xd6e7('0x15'));var utils=require(_0xd6e7('0x16'));var config=require(_0xd6e7('0x17'));var licenseUtil=require(_0xd6e7('0x18'));var db=require(_0xd6e7('0x19'))['db'];config[_0xd6e7('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd6e7('0x1b'))(new Redis(config[_0xd6e7('0x1a')]));require(_0xd6e7('0x1c'))['register'](socket);function respondWithStatusCode(_0x5b9145,_0x71e88e){_0x71e88e=_0x71e88e||0xcc;return function(_0x25c5f2){if(_0x25c5f2){return _0x5b9145[_0xd6e7('0x1d')](_0x71e88e);}return _0x5b9145['status'](_0x71e88e)[_0xd6e7('0x1e')]();};}function respondWithResult(_0x51cf7c,_0x118b60){_0x118b60=_0x118b60||0xc8;return function(_0x467760){if(_0x467760){return _0x51cf7c[_0xd6e7('0x1f')](_0x118b60)[_0xd6e7('0x20')](_0x467760);}};}function respondWithFilteredResult(_0x4f900a,_0x4202ce){return function(_0x3e907b){if(_0x3e907b){var _0xae9186=typeof _0x4202ce['offset']===_0xd6e7('0x21')&&typeof _0x4202ce[_0xd6e7('0x22')]===_0xd6e7('0x21');var _0x5a5f78=_0x3e907b['count'];var _0x322245=_0xae9186?0x0:_0x4202ce['offset'];var _0x10ed74=_0xae9186?_0x3e907b[_0xd6e7('0x23')]:_0x4202ce[_0xd6e7('0x24')]+_0x4202ce[_0xd6e7('0x22')];var _0x4545e2;if(_0x10ed74>=_0x5a5f78){_0x10ed74=_0x5a5f78;_0x4545e2=0xc8;}else{_0x4545e2=0xce;}_0x4f900a['status'](_0x4545e2);return _0x4f900a['set'](_0xd6e7('0x25'),_0x322245+'-'+_0x10ed74+'/'+_0x5a5f78)['json'](_0x3e907b);}return null;};}function patchUpdates(_0x495cd3){return function(_0x4450d3){try{jsonpatch[_0xd6e7('0x26')](_0x4450d3,_0x495cd3,!![]);}catch(_0x3c4a0a){return BPromise[_0xd6e7('0x27')](_0x3c4a0a);}return _0x4450d3[_0xd6e7('0x28')]();};}function saveUpdates(_0x3d24f1,_0xa39b91){return function(_0x18bc84){if(_0x18bc84){return _0x18bc84[_0xd6e7('0x29')](_0x3d24f1)[_0xd6e7('0x2a')](function(_0x33e768){return _0x33e768;});}return null;};}function removeEntity(_0x2168c2,_0x125922){return function(_0x46a5c6){if(_0x46a5c6){return _0x46a5c6['destroy']()[_0xd6e7('0x2a')](function(){var _0x25e480=_0x46a5c6[_0xd6e7('0x2b')]({'plain':!![]});var _0xaa389d='CustomDashboards';return db[_0xd6e7('0x2c')][_0xd6e7('0x2d')]({'where':{'type':_0xaa389d,'resourceId':_0x25e480['id']}})[_0xd6e7('0x2a')](function(){return _0x46a5c6;});})[_0xd6e7('0x2a')](function(){_0x2168c2[_0xd6e7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x242bad,_0x3354ab){return function(_0x42fcce){if(!_0x42fcce){_0x242bad['sendStatus'](0x194);}return _0x42fcce;};}function handleError(_0x8e7a6b,_0x1b1bec){_0x1b1bec=_0x1b1bec||0x1f4;return function(_0x414d25){logger['error'](_0x414d25[_0xd6e7('0x2e')]);if(_0x414d25[_0xd6e7('0x2f')]){delete _0x414d25[_0xd6e7('0x2f')];}_0x8e7a6b[_0xd6e7('0x1f')](_0x1b1bec)[_0xd6e7('0x30')](_0x414d25);};}exports[_0xd6e7('0x31')]=function(_0x51b0e0,_0x42947c){var _0x165039={},_0x4f8ff9={},_0x106ff9={'count':0x0,'rows':[]};var _0xb895a5=_['map'](db[_0xd6e7('0x32')][_0xd6e7('0x33')],function(_0x27ee99){return{'name':_0x27ee99[_0xd6e7('0x34')],'type':_0x27ee99[_0xd6e7('0x35')]['key']};});_0x4f8ff9[_0xd6e7('0x36')]=_['map'](_0xb895a5,_0xd6e7('0x2f'));_0x4f8ff9['query']=_[_0xd6e7('0x37')](_0x51b0e0[_0xd6e7('0x38')]);_0x4f8ff9[_0xd6e7('0x39')]=_[_0xd6e7('0x3a')](_0x4f8ff9[_0xd6e7('0x36')],_0x4f8ff9['query']);_0x165039[_0xd6e7('0x3b')]=_[_0xd6e7('0x3a')](_0x4f8ff9[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x51b0e0[_0xd6e7('0x38')]['fields']));_0x165039[_0xd6e7('0x3b')]=_0x165039[_0xd6e7('0x3b')][_0xd6e7('0x3d')]?_0x165039[_0xd6e7('0x3b')]:_0x4f8ff9[_0xd6e7('0x36')];if(!_0x51b0e0[_0xd6e7('0x38')][_0xd6e7('0x3e')](_0xd6e7('0x3f'))){_0x165039[_0xd6e7('0x22')]=qs[_0xd6e7('0x22')](_0x51b0e0['query'][_0xd6e7('0x22')]);_0x165039[_0xd6e7('0x24')]=qs[_0xd6e7('0x24')](_0x51b0e0['query'][_0xd6e7('0x24')]);}_0x165039[_0xd6e7('0x40')]=qs[_0xd6e7('0x41')](_0x51b0e0['query'][_0xd6e7('0x41')]);_0x165039[_0xd6e7('0x42')]=qs[_0xd6e7('0x39')](_[_0xd6e7('0x43')](_0x51b0e0[_0xd6e7('0x38')],_0x4f8ff9[_0xd6e7('0x39')]),_0xb895a5);if(_0x51b0e0['query'][_0xd6e7('0x44')]){_0x165039['where']=_['merge'](_0x165039[_0xd6e7('0x42')],{'$or':_[_0xd6e7('0x45')](_0xb895a5,function(_0xd10c21){if(_0xd10c21[_0xd6e7('0x35')]!==_0xd6e7('0x46')){var _0x3bb68c={};_0x3bb68c[_0xd10c21['name']]={'$like':'%'+_0x51b0e0[_0xd6e7('0x38')]['filter']+'%'};return _0x3bb68c;}})});}_0x165039=_[_0xd6e7('0x47')]({},_0x165039,_0x51b0e0[_0xd6e7('0x48')]);var _0x158d98={'where':_0x165039[_0xd6e7('0x42')]};return db[_0xd6e7('0x32')][_0xd6e7('0x23')](_0x158d98)[_0xd6e7('0x2a')](function(_0x2cbecc){_0x106ff9[_0xd6e7('0x23')]=_0x2cbecc;if(_0x51b0e0[_0xd6e7('0x38')][_0xd6e7('0x49')]){_0x165039[_0xd6e7('0x4a')]=[{'all':!![]}];}return db['Dashboard'][_0xd6e7('0x4b')](_0x165039);})['then'](function(_0x368dcb){_0x106ff9[_0xd6e7('0x4c')]=_0x368dcb;return _0x106ff9;})[_0xd6e7('0x2a')](respondWithFilteredResult(_0x42947c,_0x165039))[_0xd6e7('0x4d')](handleError(_0x42947c,null));};exports[_0xd6e7('0x4e')]=function(_0x33dd23,_0x225f08){var _0x3d6667={'raw':![],'where':{'id':_0x33dd23[_0xd6e7('0x4f')]['id']}},_0x5c71da={};_0x5c71da[_0xd6e7('0x36')]=_[_0xd6e7('0x37')](db['Dashboard'][_0xd6e7('0x33')]);_0x5c71da['query']=_[_0xd6e7('0x37')](_0x33dd23[_0xd6e7('0x38')]);_0x5c71da[_0xd6e7('0x39')]=_[_0xd6e7('0x3a')](_0x5c71da['model'],_0x5c71da[_0xd6e7('0x38')]);_0x3d6667[_0xd6e7('0x3b')]=_[_0xd6e7('0x3a')](_0x5c71da[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x33dd23[_0xd6e7('0x38')][_0xd6e7('0x3c')]));_0x3d6667[_0xd6e7('0x3b')]=_0x3d6667[_0xd6e7('0x3b')][_0xd6e7('0x3d')]?_0x3d6667['attributes']:_0x5c71da[_0xd6e7('0x36')];if(_0x33dd23[_0xd6e7('0x38')][_0xd6e7('0x49')]){_0x3d6667[_0xd6e7('0x4a')]=[{'all':!![]}];}_0x3d6667=_[_0xd6e7('0x47')]({},_0x3d6667,_0x33dd23['options']);return db[_0xd6e7('0x32')][_0xd6e7('0x50')](_0x3d6667)[_0xd6e7('0x2a')](handleEntityNotFound(_0x225f08,null))[_0xd6e7('0x2a')](respondWithResult(_0x225f08,null))['catch'](handleError(_0x225f08,null));};exports[_0xd6e7('0x51')]=function(_0x42ffc0,_0x436e88){return db[_0xd6e7('0x32')]['create'](_0x42ffc0['body'],{})[_0xd6e7('0x2a')](function(_0x1b051c){var _0x9268d7=_0x42ffc0[_0xd6e7('0x52')][_0xd6e7('0x2b')]({'plain':!![]});if(!_0x9268d7)throw new Error(_0xd6e7('0x53'));if(_0x9268d7['role']===_0xd6e7('0x52')){var _0x36ad97=_0x1b051c['get']({'plain':!![]});var _0x3d8f16=_0xd6e7('0x54');return db[_0xd6e7('0x55')][_0xd6e7('0x50')]({'where':{'name':_0x3d8f16,'userProfileId':_0x9268d7[_0xd6e7('0x56')]},'raw':!![]})['then'](function(_0xa1a19f){if(_0xa1a19f&&_0xa1a19f[_0xd6e7('0x57')]===0x0){return db[_0xd6e7('0x2c')][_0xd6e7('0x51')]({'name':_0x36ad97[_0xd6e7('0x2f')],'resourceId':_0x36ad97['id'],'type':_0xa1a19f[_0xd6e7('0x2f')],'sectionId':_0xa1a19f['id']},{})['then'](function(){return _0x1b051c;});}else{return _0x1b051c;}})[_0xd6e7('0x4d')](function(_0x514750){logger[_0xd6e7('0x58')](_0xd6e7('0x59'),_0x514750);throw _0x514750;});}return _0x1b051c;})[_0xd6e7('0x2a')](respondWithResult(_0x436e88,0xc9))[_0xd6e7('0x4d')](handleError(_0x436e88,null));};exports[_0xd6e7('0x5a')]=function(_0x118226,_0x5ce207){var _0x318891={'where':{'id':_0x118226[_0xd6e7('0x4f')]['id']}},_0x174587={};_0x174587[_0xd6e7('0x36')]=_[_0xd6e7('0x37')](db[_0xd6e7('0x32')][_0xd6e7('0x33')]);_0x318891[_0xd6e7('0x3b')]=_[_0xd6e7('0x3a')](_0x174587[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x118226['query']['fields']));_0x318891[_0xd6e7('0x3b')]=_0x318891[_0xd6e7('0x3b')]['length']?_0x318891[_0xd6e7('0x3b')]:_0x174587[_0xd6e7('0x36')];if(_0x118226[_0xd6e7('0x38')][_0xd6e7('0x49')]){_0x318891[_0xd6e7('0x4a')]=[{'all':!![]}];}_0x318891=_[_0xd6e7('0x47')]({},_0x318891,_0x118226[_0xd6e7('0x48')]);return db[_0xd6e7('0x32')][_0xd6e7('0x50')](_0x318891)[_0xd6e7('0x2a')](handleEntityNotFound(_0x5ce207,null))[_0xd6e7('0x2a')](function(_0x5b57e2){if(_0x5b57e2){var _0x5152f8=_0x5b57e2[_0xd6e7('0x2b')]({'plain':!![]});_0x5152f8=qs[_0xd6e7('0x5b')](_0x5152f8,['id','createdAt',_0xd6e7('0x5c')]);_0x118226[_0xd6e7('0x5d')]=_['omit'](_0x118226[_0xd6e7('0x5d')],['id',_0xd6e7('0x5e'),'updatedAt']);return db[_0xd6e7('0x32')]['create'](_[_0xd6e7('0x47')](_0x5152f8,_0x118226['body']),{'include':_0x118226[_0xd6e7('0x38')][_0xd6e7('0x49')]?[{'all':!![]}]:undefined})[_0xd6e7('0x2a')](function(_0x386afc){var _0x4f5ffe=_0x118226['user']['get']({'plain':!![]});if(!_0x4f5ffe)throw new Error(_0xd6e7('0x53'));if(_0x4f5ffe[_0xd6e7('0x5f')]===_0xd6e7('0x52')){var _0x25a7b8=_0x386afc[_0xd6e7('0x2b')]({'plain':!![]});var _0x345e64=_0xd6e7('0x54');return db[_0xd6e7('0x55')][_0xd6e7('0x50')]({'where':{'name':_0x345e64,'userProfileId':_0x4f5ffe[_0xd6e7('0x56')]},'raw':!![]})[_0xd6e7('0x2a')](function(_0x306dd6){if(_0x306dd6&&_0x306dd6['autoAssociation']===0x0){return db[_0xd6e7('0x2c')][_0xd6e7('0x51')]({'name':_0x25a7b8[_0xd6e7('0x2f')],'resourceId':_0x25a7b8['id'],'type':_0x306dd6[_0xd6e7('0x2f')],'sectionId':_0x306dd6['id']},{})[_0xd6e7('0x2a')](function(){return _0x386afc;});}else{return _0x386afc;}})[_0xd6e7('0x4d')](function(_0x5bd2f1){logger['error'](_0xd6e7('0x59'),_0x5bd2f1);throw _0x5bd2f1;});}return _0x386afc;});}})['then'](respondWithResult(_0x5ce207,0xc9))[_0xd6e7('0x4d')](handleError(_0x5ce207,null));};exports['update']=function(_0x35424d,_0x2c7966){if(_0x35424d[_0xd6e7('0x5d')]['id']){delete _0x35424d[_0xd6e7('0x5d')]['id'];}return db[_0xd6e7('0x32')]['find']({'where':{'id':_0x35424d[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x2c7966,null))['then'](saveUpdates(_0x35424d[_0xd6e7('0x5d')],null))[_0xd6e7('0x2a')](respondWithResult(_0x2c7966,null))[_0xd6e7('0x4d')](handleError(_0x2c7966,null));};exports[_0xd6e7('0x2d')]=function(_0x1d1f7e,_0x4b9d31){return db['Dashboard'][_0xd6e7('0x50')]({'where':{'id':_0x1d1f7e[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x4b9d31,null))[_0xd6e7('0x2a')](removeEntity(_0x4b9d31,null))[_0xd6e7('0x4d')](handleError(_0x4b9d31,null));};function widgetAttributes(_0x529ba8){try{switch(_0x529ba8[_0xd6e7('0x35')]){case _0xd6e7('0x60'):return[{'name':'attrUrl','value':_0x529ba8[_0xd6e7('0x61')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x64')}];case _0xd6e7('0x65'):return[{'name':'attrPath','value':_0x529ba8[_0xd6e7('0x66')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8['attrs'][0x0][_0xd6e7('0x63')]:undefined)||''}];case'clock':return[{'name':_0xd6e7('0x67'),'value':_0x529ba8[_0xd6e7('0x67')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x68')},{'name':_0xd6e7('0x69'),'value':_0x529ba8[_0xd6e7('0x69')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x6a')},{'name':'attrFontSize','value':_0x529ba8[_0xd6e7('0x6b')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x2]?_0x529ba8[_0xd6e7('0x62')][0x2][_0xd6e7('0x63')]:undefined)||0xc}];case _0xd6e7('0x6c'):return[{'name':_0xd6e7('0x6d'),'value':_0x529ba8[_0xd6e7('0x6d')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x6e')},{'name':_0xd6e7('0x6f'),'value':_0x529ba8['attrVoiceQueues']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||[]},{'name':_0xd6e7('0x6b'),'value':_0x529ba8[_0xd6e7('0x6b')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x2]?_0x529ba8[_0xd6e7('0x62')][0x2][_0xd6e7('0x63')]:undefined)||0x14},{'name':_0xd6e7('0x70'),'value':_0x529ba8[_0xd6e7('0x70')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x3]?_0x529ba8[_0xd6e7('0x62')][0x3][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x71')},{'name':_0xd6e7('0x72'),'value':_0x529ba8[_0xd6e7('0x72')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x4]?_0x529ba8[_0xd6e7('0x62')][0x4][_0xd6e7('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x529ba8['attrFaxAccounts']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x5]?_0x529ba8['attrs'][0x5]['value']:undefined)||''},{'name':_0xd6e7('0x73'),'value':_0x529ba8['attrSmsAccounts']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x6]?_0x529ba8[_0xd6e7('0x62')][0x6]['value']:undefined)||''},{'name':_0xd6e7('0x74'),'value':_0x529ba8[_0xd6e7('0x74')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x7]?_0x529ba8[_0xd6e7('0x62')][0x7]['value']:undefined)||''},{'name':_0xd6e7('0x75'),'value':_0x529ba8[_0xd6e7('0x75')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x8]?_0x529ba8[_0xd6e7('0x62')][0x8][_0xd6e7('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x529ba8[_0xd6e7('0x76')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x9]?_0x529ba8[_0xd6e7('0x62')][0x9][_0xd6e7('0x63')]:undefined)||''}];case _0xd6e7('0x77'):case'pie-chart':return[{'name':'attrSerie1','value':_0x529ba8[_0xd6e7('0x78')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||'total'},{'name':_0xd6e7('0x79'),'value':_0x529ba8[_0xd6e7('0x79')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||null},{'name':_0xd6e7('0x7a'),'value':_0x529ba8[_0xd6e7('0x7a')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x2]?_0x529ba8[_0xd6e7('0x62')][0x2][_0xd6e7('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x529ba8[_0xd6e7('0x6f')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x3]?_0x529ba8[_0xd6e7('0x62')][0x3][_0xd6e7('0x63')]:undefined)||[]},{'name':_0xd6e7('0x70'),'value':_0x529ba8[_0xd6e7('0x70')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x4]?_0x529ba8[_0xd6e7('0x62')][0x4]['value']:undefined)||_0xd6e7('0x71')},{'name':'attrEmailAccounts','value':_0x529ba8['attrEmailAccounts']||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x5]?_0x529ba8[_0xd6e7('0x62')][0x5]['value']:undefined)||''},{'name':_0xd6e7('0x7b'),'value':_0x529ba8[_0xd6e7('0x7b')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x6]?_0x529ba8[_0xd6e7('0x62')][0x6][_0xd6e7('0x63')]:undefined)||''},{'name':_0xd6e7('0x73'),'value':_0x529ba8[_0xd6e7('0x73')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x7]?_0x529ba8[_0xd6e7('0x62')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x529ba8[_0xd6e7('0x74')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x8]?_0x529ba8[_0xd6e7('0x62')][0x8]['value']:undefined)||''},{'name':_0xd6e7('0x75'),'value':_0x529ba8[_0xd6e7('0x75')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x9]?_0x529ba8[_0xd6e7('0x62')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x529ba8[_0xd6e7('0x76')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0xa]?_0x529ba8['attrs'][0xa][_0xd6e7('0x63')]:undefined)||''}];case _0xd6e7('0x7c'):return[{'name':'attrReport','type':_0x529ba8[_0xd6e7('0x7d')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x35')]:undefined)||null,'value':_0x529ba8[_0xd6e7('0x7e')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||null},{'name':_0xd6e7('0x7f'),'value':_0x529ba8['attrRefresh']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x4f9cb5){logger[_0xd6e7('0x58')]('widgetAttributes:\x20%s',JSON[_0xd6e7('0x80')](_0x4f9cb5));return[];}}exports['addItem']=function(_0x57ff64,_0x5abd05,_0xee280d){if(_0x57ff64[_0xd6e7('0x5d')]['id']){delete _0x57ff64[_0xd6e7('0x5d')]['id'];}return db[_0xd6e7('0x32')][_0xd6e7('0x50')]({'where':{'id':_0x57ff64[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x5abd05,null))['then'](function(_0x2eafa4){if(_0x2eafa4){_0x57ff64[_0xd6e7('0x5d')]['DashboardId']=_0x2eafa4['id'];_0x57ff64['body'][_0xd6e7('0x62')]=widgetAttributes(_0x57ff64[_0xd6e7('0x5d')]);return db['DashboardItem'][_0xd6e7('0x51')](_0x57ff64[_0xd6e7('0x5d')]);}})[_0xd6e7('0x2a')](respondWithResult(_0x5abd05,null))[_0xd6e7('0x4d')](handleError(_0x5abd05,null));};exports[_0xd6e7('0x81')]=function(_0x51c482,_0x3c272a,_0x7d20c4){var _0x52c542={};var _0x3a19ca={};var _0x4b94c4;var _0x5f1ba6;return db[_0xd6e7('0x32')][_0xd6e7('0x82')]({'where':{'id':_0x51c482[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x3c272a,null))[_0xd6e7('0x2a')](function(_0x7e2308){if(_0x7e2308){_0x4b94c4=_0x7e2308;_0x3a19ca[_0xd6e7('0x36')]=_[_0xd6e7('0x37')](db[_0xd6e7('0x83')][_0xd6e7('0x33')]);_0x3a19ca[_0xd6e7('0x38')]=_[_0xd6e7('0x37')](_0x51c482[_0xd6e7('0x38')]);_0x3a19ca[_0xd6e7('0x39')]=_[_0xd6e7('0x3a')](_0x3a19ca['model'],_0x3a19ca[_0xd6e7('0x38')]);_0x52c542[_0xd6e7('0x3b')]=_['intersection'](_0x3a19ca[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x51c482[_0xd6e7('0x38')]['fields']));_0x52c542[_0xd6e7('0x3b')]=_0x52c542[_0xd6e7('0x3b')][_0xd6e7('0x3d')]?_0x52c542[_0xd6e7('0x3b')]:_0x3a19ca[_0xd6e7('0x36')];_0x52c542[_0xd6e7('0x40')]=qs[_0xd6e7('0x41')](_0x51c482['query']['sort']);_0x52c542[_0xd6e7('0x42')]=qs[_0xd6e7('0x39')](_['pick'](_0x51c482[_0xd6e7('0x38')],_0x3a19ca[_0xd6e7('0x39')]));if(_0x51c482['query'][_0xd6e7('0x44')]){_0x52c542[_0xd6e7('0x42')]=_[_0xd6e7('0x47')](_0x52c542[_0xd6e7('0x42')],{'$or':_[_0xd6e7('0x45')](_0x52c542[_0xd6e7('0x3b')],function(_0x1424de){var _0x29ad4b={};_0x29ad4b[_0x1424de]={'$like':'%'+_0x51c482[_0xd6e7('0x38')]['filter']+'%'};return _0x29ad4b;})});}_0x52c542=_['merge']({},_0x52c542,_0x51c482[_0xd6e7('0x48')]);return _0x4b94c4[_0xd6e7('0x81')](_0x52c542);}})[_0xd6e7('0x2a')](function(_0x4f681c){if(_0x4f681c){_0x5f1ba6=_0x4f681c[_0xd6e7('0x3d')];if(!_0x51c482[_0xd6e7('0x38')][_0xd6e7('0x3e')]('nolimit')){_0x52c542[_0xd6e7('0x22')]=qs[_0xd6e7('0x22')](_0x51c482[_0xd6e7('0x38')]['limit']);_0x52c542[_0xd6e7('0x24')]=qs[_0xd6e7('0x24')](_0x51c482[_0xd6e7('0x38')]['offset']);}return _0x4b94c4[_0xd6e7('0x81')](_0x52c542);}})[_0xd6e7('0x2a')](function(_0x328806){if(_0x328806){return _0x328806?{'count':_0x5f1ba6,'rows':_0x328806}:null;}})['then'](respondWithResult(_0x3c272a,null))[_0xd6e7('0x4d')](handleError(_0x3c272a,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 079b495..3541f1f 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 _0xf061=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x3d5f61,_0x34069e){var _0x8d87b1=function(_0x48d7e1){while(--_0x48d7e1){_0x3d5f61['push'](_0x3d5f61['shift']());}};_0x8d87b1(++_0x34069e);}(_0xf061,0x7e));var _0x1f06=function(_0x238545,_0x1e8a22){_0x238545=_0x238545-0x0;var _0x5b0ed7=_0xf061[_0x238545];return _0x5b0ed7;};'use strict';var EventEmitter=require(_0x1f06('0x0'));var Dashboard=require(_0x1f06('0x1'))['db'][_0x1f06('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1f06('0x3')](0x0);var events={'afterCreate':_0x1f06('0x4'),'afterUpdate':_0x1f06('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46b4fb){return function(_0x76a0e0,_0x524d67,_0x1642c4){DashboardEvents[_0x1f06('0x6')](_0x46b4fb+':'+_0x76a0e0['id'],_0x76a0e0);DashboardEvents[_0x1f06('0x6')](_0x46b4fb,_0x76a0e0);_0x1642c4(null);};}for(var e in events){if(events[_0x1f06('0x7')](e)){var event=events[e];Dashboard[_0x1f06('0x8')](e,emitEvent(event));}}module[_0x1f06('0x9')]=DashboardEvents; \ No newline at end of file +var _0xad08=['Dashboard','save','update','remove','emit','hook','events'];(function(_0x400d32,_0x3a9508){var _0x2f88db=function(_0x11ab61){while(--_0x11ab61){_0x400d32['push'](_0x400d32['shift']());}};_0x2f88db(++_0x3a9508);}(_0xad08,0x1c6));var _0x8ad0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xad08[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x8ad0('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x8ad0('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8ad0('0x2'),'afterUpdate':_0x8ad0('0x3'),'afterDestroy':_0x8ad0('0x4')};function emitEvent(_0x4cc96b){return function(_0x1c233d,_0xb35f8,_0x15e573){DashboardEvents[_0x8ad0('0x5')](_0x4cc96b+':'+_0x1c233d['id'],_0x1c233d);DashboardEvents[_0x8ad0('0x5')](_0x4cc96b,_0x1c233d);_0x15e573(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8ad0('0x6')](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 ed346ee..197d578 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 _0x734f=['../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0x734f,0x155));var _0xf734=function(_0x3fe90c,_0x231b20){_0x3fe90c=_0x3fe90c-0x0;var _0x12c302=_0x734f[_0x3fe90c];return _0x12c302;};'use strict';var _=require(_0xf734('0x0'));var util=require(_0xf734('0x1'));var logger=require(_0xf734('0x2'))(_0xf734('0x3'));var moment=require(_0xf734('0x4'));var BPromise=require('bluebird');var rp=require(_0xf734('0x5'));var fs=require('fs');var path=require(_0xf734('0x6'));var rimraf=require('rimraf');var config=require(_0xf734('0x7'));var attributes=require(_0xf734('0x8'));module['exports']=function(_0x4b1c77,_0x120d3e){return _0x4b1c77[_0xf734('0x9')](_0xf734('0xa'),attributes,{'tableName':_0xf734('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66e6=['exports','define','Dashboard','dashboards','util','api','moment','bluebird','rimraf','./dashboard.attributes'];(function(_0x7f516c,_0x3a9deb){var _0xe554db=function(_0x4424f9){while(--_0x4424f9){_0x7f516c['push'](_0x7f516c['shift']());}};_0xe554db(++_0x3a9deb);}(_0x66e6,0xfe));var _0x666e=function(_0x903cb9,_0x4f7d16){_0x903cb9=_0x903cb9-0x0;var _0x30f5ed=_0x66e6[_0x903cb9];return _0x30f5ed;};'use strict';var _=require('lodash');var util=require(_0x666e('0x0'));var logger=require('../../config/logger')(_0x666e('0x1'));var moment=require(_0x666e('0x2'));var BPromise=require(_0x666e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x666e('0x4'));var config=require('../../config/environment');var attributes=require(_0x666e('0x5'));module[_0x666e('0x6')]=function(_0x201944,_0x38082e){return _0x201944[_0x666e('0x7')](_0x666e('0x8'),attributes,{'tableName':_0x666e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 44517af..8d2e066 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 _0x0149=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','Dashboard,\x20%s,\x20%s','result','catch','moment','bluebird','../../mysqldb'];(function(_0x459475,_0x3a5454){var _0x345dbf=function(_0x1c95ea){while(--_0x1c95ea){_0x459475['push'](_0x459475['shift']());}};_0x345dbf(++_0x3a5454);}(_0x0149,0x1a6));var _0x9014=function(_0x505177,_0x123933){_0x505177=_0x505177-0x0;var _0xe59521=_0x0149[_0x505177];return _0xe59521;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9014('0x0'));var BPromise=require(_0x9014('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9014('0x2'))['db'];var utils=require(_0x9014('0x3'));var logger=require(_0x9014('0x4'))(_0x9014('0x5'));var config=require(_0x9014('0x6'));var jayson=require(_0x9014('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x9014('0x8')]=_[_0x9014('0x9')](config[_0x9014('0x8')],{'host':_0x9014('0xa'),'port':0x18eb});var socket=require(_0x9014('0xb'))(new Redis(config['redis']));require(_0x9014('0xc'))[_0x9014('0xd')](socket);function respondWithRpcPromise(_0xda8d9c,_0x4fc1c9,_0x3c00c6){return new BPromise(function(_0x61d2b9,_0x3bf16c){return client['request'](_0xda8d9c,_0x3c00c6)[_0x9014('0xe')](function(_0x20af0e){logger[_0x9014('0xf')]('Dashboard,\x20%s,\x20%s',_0x4fc1c9,_0x9014('0x10'));logger[_0x9014('0x11')](_0x9014('0x12'),_0x4fc1c9,_0x9014('0x10'),JSON[_0x9014('0x13')](_0x20af0e));if(_0x20af0e['error']){if(_0x20af0e['error']['code']===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x4fc1c9,_0x20af0e[_0x9014('0x14')]['message']);return _0x3bf16c(_0x20af0e['error'][_0x9014('0x15')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x4fc1c9,_0x20af0e[_0x9014('0x14')][_0x9014('0x15')]);return _0x61d2b9(_0x20af0e[_0x9014('0x14')][_0x9014('0x15')]);}else{logger[_0x9014('0xf')](_0x9014('0x16'),_0x4fc1c9,_0x9014('0x10'));_0x61d2b9(_0x20af0e[_0x9014('0x17')][_0x9014('0x15')]);}})[_0x9014('0x18')](function(_0x39800b){logger['error'](_0x9014('0x16'),_0x4fc1c9,_0x39800b);_0x3bf16c(_0x39800b);});});} \ No newline at end of file +var _0x687d=['request\x20sent','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s'];(function(_0x228aa5,_0x56aad3){var _0x4b329b=function(_0x1a44f7){while(--_0x1a44f7){_0x228aa5['push'](_0x228aa5['shift']());}};_0x4b329b(++_0x56aad3);}(_0x687d,0x191));var _0xd687=function(_0x59137b,_0x20880e){_0x59137b=_0x59137b-0x0;var _0x267490=_0x687d[_0x59137b];return _0x267490;};'use strict';var _=require('lodash');var util=require(_0xd687('0x0'));var moment=require(_0xd687('0x1'));var BPromise=require(_0xd687('0x2'));var rs=require(_0xd687('0x3'));var fs=require('fs');var Redis=require(_0xd687('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd687('0x5'));var logger=require(_0xd687('0x6'))(_0xd687('0x7'));var config=require('../../config/environment');var jayson=require(_0xd687('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xd687('0x9')]=_[_0xd687('0xa')](config[_0xd687('0x9')],{'host':_0xd687('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd687('0xc'))[_0xd687('0xd')](socket);function respondWithRpcPromise(_0x5be5f1,_0x1fa53d,_0xb79bef){return new BPromise(function(_0x203461,_0x15ad73){return client[_0xd687('0xe')](_0x5be5f1,_0xb79bef)['then'](function(_0x4a1f5f){logger[_0xd687('0xf')](_0xd687('0x10'),_0x1fa53d,'request\x20sent');logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x1fa53d,_0xd687('0x11'),JSON['stringify'](_0x4a1f5f));if(_0x4a1f5f[_0xd687('0x12')]){if(_0x4a1f5f[_0xd687('0x12')][_0xd687('0x13')]===0x1f4){logger[_0xd687('0x12')](_0xd687('0x10'),_0x1fa53d,_0x4a1f5f[_0xd687('0x12')][_0xd687('0x14')]);return _0x15ad73(_0x4a1f5f[_0xd687('0x12')]['message']);}logger[_0xd687('0x12')](_0xd687('0x10'),_0x1fa53d,_0x4a1f5f[_0xd687('0x12')][_0xd687('0x14')]);return _0x203461(_0x4a1f5f['error']['message']);}else{logger[_0xd687('0xf')]('Dashboard,\x20%s,\x20%s',_0x1fa53d,_0xd687('0x11'));_0x203461(_0x4a1f5f[_0xd687('0x15')]['message']);}})['catch'](function(_0x3d5281){logger[_0xd687('0x12')](_0xd687('0x10'),_0x1fa53d,_0x3d5281);_0x15ad73(_0x3d5281);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 06b1a14..9b85ba5 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 _0xef49=['dashboard:','./dashboard.events','save','remove','update','removeListener','register','length'];(function(_0x4f1593,_0x3d693c){var _0x418daf=function(_0x502cf5){while(--_0x502cf5){_0x4f1593['push'](_0x4f1593['shift']());}};_0x418daf(++_0x3d693c);}(_0xef49,0x99));var _0x9ef4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xef49[_0x255d5b];return _0x3e141a;};'use strict';var DashboardEvents=require(_0x9ef4('0x0'));var events=[_0x9ef4('0x1'),_0x9ef4('0x2'),_0x9ef4('0x3')];function createListener(_0x10db0a,_0x45cb85){return function(_0x15b464){_0x45cb85['emit'](_0x10db0a,_0x15b464);};}function removeListener(_0x433861,_0x5759df){return function(){DashboardEvents[_0x9ef4('0x4')](_0x433861,_0x5759df);};}exports[_0x9ef4('0x5')]=function(_0x8f27d1){for(var _0x58fc95=0x0,_0xc35dd=events[_0x9ef4('0x6')];_0x58fc95<_0xc35dd;_0x58fc95++){var _0x443452=events[_0x58fc95];var _0x518fc3=createListener(_0x9ef4('0x7')+_0x443452,_0x8f27d1);DashboardEvents['on'](_0x443452,_0x518fc3);}}; \ No newline at end of file +var _0x3715=['save','remove','update','emit','length','./dashboard.events'];(function(_0x262f7d,_0xc206ad){var _0x25a1d6=function(_0x3a59d4){while(--_0x3a59d4){_0x262f7d['push'](_0x262f7d['shift']());}};_0x25a1d6(++_0xc206ad);}(_0x3715,0x1a9));var _0x5371=function(_0x57a109,_0x574bf4){_0x57a109=_0x57a109-0x0;var _0x47a582=_0x3715[_0x57a109];return _0x47a582;};'use strict';var DashboardEvents=require(_0x5371('0x0'));var events=[_0x5371('0x1'),_0x5371('0x2'),_0x5371('0x3')];function createListener(_0x4a9532,_0xd46829){return function(_0x5313bc){_0xd46829[_0x5371('0x4')](_0x4a9532,_0x5313bc);};}function removeListener(_0x22d1b3,_0xb718b3){return function(){DashboardEvents['removeListener'](_0x22d1b3,_0xb718b3);};}exports['register']=function(_0x1c1ad2){for(var _0x45109f=0x0,_0x547e3a=events[_0x5371('0x5')];_0x45109f<_0x547e3a;_0x45109f++){var _0x2bcbb2=events[_0x45109f];var _0x552781=createListener('dashboard:'+_0x2bcbb2,_0x1c1ad2);DashboardEvents['on'](_0x2bcbb2,_0x552781);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 357ac98..2d67353 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 _0x0787=['/:id/clone','clone','addItem','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','/:id/items','getItems','post','create'];(function(_0x56e5b0,_0x2821ee){var _0x5e61f2=function(_0x1a0fc8){while(--_0x1a0fc8){_0x56e5b0['push'](_0x56e5b0['shift']());}};_0x5e61f2(++_0x2821ee);}(_0x0787,0x16f));var _0x7078=function(_0x224f65,_0x4750bf){_0x224f65=_0x224f65-0x0;var _0x3f921c=_0x0787[_0x224f65];return _0x3f921c;};'use strict';var multer=require(_0x7078('0x0'));var util=require(_0x7078('0x1'));var path=require(_0x7078('0x2'));var timeout=require('connect-timeout');var express=require(_0x7078('0x3'));var router=express['Router']();var fs_extra=require(_0x7078('0x4'));var auth=require(_0x7078('0x5'));var interaction=require(_0x7078('0x6'));var config=require(_0x7078('0x7'));var controller=require(_0x7078('0x8'));router[_0x7078('0x9')]('/',auth['isAuthenticated'](),controller[_0x7078('0xa')]);router[_0x7078('0x9')](_0x7078('0xb'),auth[_0x7078('0xc')](),controller['show']);router[_0x7078('0x9')](_0x7078('0xd'),auth['isAuthenticated'](),controller[_0x7078('0xe')]);router[_0x7078('0xf')]('/',auth[_0x7078('0xc')](),controller[_0x7078('0x10')]);router[_0x7078('0xf')](_0x7078('0x11'),auth['isAuthenticated'](),controller[_0x7078('0x12')]);router[_0x7078('0xf')](_0x7078('0xd'),auth['isAuthenticated'](),controller[_0x7078('0x13')]);router[_0x7078('0x14')](_0x7078('0xb'),auth[_0x7078('0xc')](),controller[_0x7078('0x15')]);router['delete'](_0x7078('0xb'),auth[_0x7078('0xc')](),controller[_0x7078('0x16')]);module[_0x7078('0x17')]=router; \ No newline at end of file +var _0xe8bb=['isAuthenticated','index','/:id','show','/:id/items','post','create','/:id/clone','clone','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x110bb7,_0x56c479){var _0x1e6ac2=function(_0x27ca58){while(--_0x27ca58){_0x110bb7['push'](_0x110bb7['shift']());}};_0x1e6ac2(++_0x56c479);}(_0xe8bb,0xdb));var _0xbe8b=function(_0x2e01f4,_0x2120b2){_0x2e01f4=_0x2e01f4-0x0;var _0x9937c2=_0xe8bb[_0x2e01f4];return _0x9937c2;};'use strict';var multer=require(_0xbe8b('0x0'));var util=require(_0xbe8b('0x1'));var path=require(_0xbe8b('0x2'));var timeout=require(_0xbe8b('0x3'));var express=require(_0xbe8b('0x4'));var router=express['Router']();var fs_extra=require(_0xbe8b('0x5'));var auth=require(_0xbe8b('0x6'));var interaction=require(_0xbe8b('0x7'));var config=require(_0xbe8b('0x8'));var controller=require(_0xbe8b('0x9'));router[_0xbe8b('0xa')]('/',auth[_0xbe8b('0xb')](),controller[_0xbe8b('0xc')]);router[_0xbe8b('0xa')](_0xbe8b('0xd'),auth[_0xbe8b('0xb')](),controller[_0xbe8b('0xe')]);router[_0xbe8b('0xa')](_0xbe8b('0xf'),auth[_0xbe8b('0xb')](),controller['getItems']);router[_0xbe8b('0x10')]('/',auth[_0xbe8b('0xb')](),controller[_0xbe8b('0x11')]);router[_0xbe8b('0x10')](_0xbe8b('0x12'),auth['isAuthenticated'](),controller[_0xbe8b('0x13')]);router[_0xbe8b('0x10')](_0xbe8b('0xf'),auth[_0xbe8b('0xb')](),controller['addItem']);router['put'](_0xbe8b('0xd'),auth['isAuthenticated'](),controller[_0xbe8b('0x14')]);router[_0xbe8b('0x15')]('/:id',auth[_0xbe8b('0xb')](),controller[_0xbe8b('0x16')]);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 ee9f09a..3d57f9f 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 _0x814b=['lodash','exports','STRING','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel'];(function(_0x11b7ee,_0x304f2c){var _0x118a1f=function(_0x5a3595){while(--_0x5a3595){_0x11b7ee['push'](_0x11b7ee['shift']());}};_0x118a1f(++_0x304f2c);}(_0x814b,0x1a2));var _0xb814=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x814b[_0x2a67fe];return _0x57e726;};'use strict';var Sequelize=require(_0xb814('0x0'));var squel=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));module[_0xb814('0x3')]={'title':{'type':Sequelize[_0xb814('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb814('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb814('0x5')),'get':function(){try{return JSON[_0xb814('0x6')](this[_0xb814('0x7')](_0xb814('0x8')));}catch(_0x44931c){return[];}},'set':function(_0x322a70){try{this['setDataValue'](_0xb814('0x8'),JSON[_0xb814('0x9')](_0x322a70));}catch(_0x5c8539){this[_0xb814('0xa')](_0xb814('0x8'),JSON[_0xb814('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb814('0xb')]},'col':{'type':Sequelize[_0xb814('0xb')]},'background':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xb814('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x46ed=['sequelize','squel','exports','STRING','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x152b25,_0x5da2a5){var _0x41b54a=function(_0x515690){while(--_0x515690){_0x152b25['push'](_0x152b25['shift']());}};_0x41b54a(++_0x5da2a5);}(_0x46ed,0x168));var _0xd46e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x46ed[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xd46e('0x0'));var squel=require(_0xd46e('0x1'));var _=require('lodash');module[_0xd46e('0x2')]={'title':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd46e('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xd46e('0x4')),'get':function(){try{return JSON[_0xd46e('0x5')](this['getDataValue'](_0xd46e('0x6')));}catch(_0x1926d9){return[];}},'set':function(_0x160bcf){try{this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')](_0x160bcf));}catch(_0x437ea0){this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xd46e('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd46e('0x9')]},'col':{'type':Sequelize[_0xd46e('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd46e('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![],'defaultValue':_0xd46e('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd46e('0x3')]},'titleFontSize':{'type':Sequelize[_0xd46e('0x9')],'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 134a3a8..c43d3d3 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 _0x15b2=['query','keys','model','fields','attributes','includeAll','options','DashboardItem','find','params','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','show','rawAttributes'];(function(_0x5cfec9,_0x303ef8){var _0xfaff2c=function(_0x466153){while(--_0x466153){_0x5cfec9['push'](_0x5cfec9['shift']());}};_0xfaff2c(++_0x303ef8);}(_0x15b2,0x145));var _0x215b=function(_0x11549d,_0x2198f3){_0x11549d=_0x11549d-0x0;var _0x321cad=_0x15b2[_0x11549d];return _0x321cad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x215b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x215b('0x1'));var rp=require(_0x215b('0x2'));var moment=require('moment');var BPromise=require(_0x215b('0x3'));var Mustache=require(_0x215b('0x4'));var util=require(_0x215b('0x5'));var path=require(_0x215b('0x6'));var sox=require('sox');var csv=require(_0x215b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x215b('0x8'));var _=require(_0x215b('0x9'));var squel=require(_0x215b('0xa'));var crypto=require(_0x215b('0xb'));var jsforce=require(_0x215b('0xc'));var deskjs=require(_0x215b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x215b('0xe'));var Papa=require(_0x215b('0xf'));var Redis=require('ioredis');var authService=require(_0x215b('0x10'));var qs=require(_0x215b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x215b('0x12'))('api');var utils=require(_0x215b('0x13'));var config=require(_0x215b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x215b('0x15'))['db'];config['redis']=_['defaults'](config[_0x215b('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x215b('0x17'))(new Redis(config['redis']));require(_0x215b('0x18'))[_0x215b('0x19')](socket);function respondWithStatusCode(_0x38d765,_0x4ed24c){_0x4ed24c=_0x4ed24c||0xcc;return function(_0x495178){if(_0x495178){return _0x38d765['sendStatus'](_0x4ed24c);}return _0x38d765[_0x215b('0x1a')](_0x4ed24c)[_0x215b('0x1b')]();};}function respondWithResult(_0x2d04cb,_0x2e96f5){_0x2e96f5=_0x2e96f5||0xc8;return function(_0x35508e){if(_0x35508e){return _0x2d04cb[_0x215b('0x1a')](_0x2e96f5)[_0x215b('0x1c')](_0x35508e);}};}function respondWithFilteredResult(_0x4a27aa,_0x31d565){return function(_0x2ca496){if(_0x2ca496){var _0x2fd65=typeof _0x31d565[_0x215b('0x1d')]===_0x215b('0x1e')&&typeof _0x31d565[_0x215b('0x1f')]===_0x215b('0x1e');var _0x2a1921=_0x2ca496['count'];var _0x534e73=_0x2fd65?0x0:_0x31d565[_0x215b('0x1d')];var _0x5d1998=_0x2fd65?_0x2ca496[_0x215b('0x20')]:_0x31d565[_0x215b('0x1d')]+_0x31d565[_0x215b('0x1f')];var _0x303c89;if(_0x5d1998>=_0x2a1921){_0x5d1998=_0x2a1921;_0x303c89=0xc8;}else{_0x303c89=0xce;}_0x4a27aa[_0x215b('0x1a')](_0x303c89);return _0x4a27aa[_0x215b('0x21')](_0x215b('0x22'),_0x534e73+'-'+_0x5d1998+'/'+_0x2a1921)[_0x215b('0x1c')](_0x2ca496);}return null;};}function patchUpdates(_0x5cce5d){return function(_0x4b31c3){try{jsonpatch[_0x215b('0x23')](_0x4b31c3,_0x5cce5d,!![]);}catch(_0x515a5c){return BPromise[_0x215b('0x24')](_0x515a5c);}return _0x4b31c3[_0x215b('0x25')]();};}function saveUpdates(_0x48568a,_0x91587a){return function(_0x55efe7){if(_0x55efe7){return _0x55efe7[_0x215b('0x26')](_0x48568a)[_0x215b('0x27')](function(_0x1b7c12){return _0x1b7c12;});}return null;};}function removeEntity(_0x245a36,_0x1f30b1){return function(_0x2b02d1){if(_0x2b02d1){return _0x2b02d1[_0x215b('0x28')]()[_0x215b('0x27')](function(){_0x245a36['status'](0xcc)[_0x215b('0x1b')]();});}};}function handleEntityNotFound(_0x1f1a6f,_0x47d96d){return function(_0x40eb6e){if(!_0x40eb6e){_0x1f1a6f[_0x215b('0x29')](0x194);}return _0x40eb6e;};}function handleError(_0x1470ac,_0x5df10e){_0x5df10e=_0x5df10e||0x1f4;return function(_0x23ffca){logger[_0x215b('0x2a')](_0x23ffca[_0x215b('0x2b')]);if(_0x23ffca[_0x215b('0x2c')]){delete _0x23ffca[_0x215b('0x2c')];}_0x1470ac[_0x215b('0x1a')](_0x5df10e)['send'](_0x23ffca);};}exports[_0x215b('0x2d')]=function(_0x3903b7,_0x1f59dc){var _0x1d449b={'raw':![],'where':{'id':_0x3903b7['params']['id']}},_0x5eb42b={};_0x5eb42b['model']=_['keys'](db['DashboardItem'][_0x215b('0x2e')]);_0x5eb42b[_0x215b('0x2f')]=_[_0x215b('0x30')](_0x3903b7[_0x215b('0x2f')]);_0x5eb42b['filters']=_['intersection'](_0x5eb42b['model'],_0x5eb42b[_0x215b('0x2f')]);_0x1d449b['attributes']=_['intersection'](_0x5eb42b[_0x215b('0x31')],qs[_0x215b('0x32')](_0x3903b7[_0x215b('0x2f')]['fields']));_0x1d449b[_0x215b('0x33')]=_0x1d449b[_0x215b('0x33')]['length']?_0x1d449b['attributes']:_0x5eb42b[_0x215b('0x31')];if(_0x3903b7['query'][_0x215b('0x34')]){_0x1d449b['include']=[{'all':!![]}];}_0x1d449b=_['merge']({},_0x1d449b,_0x3903b7[_0x215b('0x35')]);return db[_0x215b('0x36')][_0x215b('0x37')](_0x1d449b)['then'](handleEntityNotFound(_0x1f59dc,null))[_0x215b('0x27')](respondWithResult(_0x1f59dc,null))['catch'](handleError(_0x1f59dc,null));};exports['destroy']=function(_0x210713,_0x133d07){return db[_0x215b('0x36')][_0x215b('0x37')]({'where':{'id':_0x210713[_0x215b('0x38')]['id']}})[_0x215b('0x27')](handleEntityNotFound(_0x133d07,null))['then'](removeEntity(_0x133d07,null))[_0x215b('0x39')](handleError(_0x133d07,null));};function widgetAttributes(_0x22fbb3){try{switch(_0x22fbb3['type']){case _0x215b('0x3a'):return[{'name':_0x215b('0x3b'),'value':_0x22fbb3[_0x215b('0x3b')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||_0x215b('0x3e')}];case _0x215b('0x3f'):return[{'name':_0x215b('0x40'),'value':_0x22fbb3[_0x215b('0x40')]||(_0x22fbb3['attrs']&&_0x22fbb3['attrs'][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x215b('0x41'),'value':_0x22fbb3[_0x215b('0x41')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||_0x215b('0x42')},{'name':'attrTimezone','value':_0x22fbb3[_0x215b('0x43')]||(_0x22fbb3['attrs']&&_0x22fbb3['attrs'][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1][_0x215b('0x3d')]:undefined)||_0x215b('0x44')},{'name':'attrFontSize','value':_0x22fbb3[_0x215b('0x45')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x2]?_0x22fbb3[_0x215b('0x3c')][0x2]['value']:undefined)||0xc}];case _0x215b('0x46'):return[{'name':_0x215b('0x47'),'value':_0x22fbb3[_0x215b('0x47')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3['attrs'][0x0][_0x215b('0x3d')]:undefined)||'total'},{'name':_0x215b('0x48'),'value':_0x22fbb3['attrVoiceQueues']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1][_0x215b('0x3d')]:undefined)||[]},{'name':_0x215b('0x45'),'value':_0x22fbb3['attrFontSize']||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x2]?_0x22fbb3['attrs'][0x2][_0x215b('0x3d')]:undefined)||0x14},{'name':_0x215b('0x49'),'value':_0x22fbb3[_0x215b('0x49')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x3]?_0x22fbb3[_0x215b('0x3c')][0x3][_0x215b('0x3d')]:undefined)||_0x215b('0x4a')},{'name':'attrEmailAccounts','value':_0x22fbb3[_0x215b('0x4b')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x4]?_0x22fbb3[_0x215b('0x3c')][0x4]['value']:undefined)||''},{'name':_0x215b('0x4c'),'value':_0x22fbb3['attrFaxAccounts']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x5]?_0x22fbb3['attrs'][0x5][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x4d'),'value':_0x22fbb3['attrSmsAccounts']||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x6]?_0x22fbb3[_0x215b('0x3c')][0x6][_0x215b('0x3d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x22fbb3[_0x215b('0x4e')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x7]?_0x22fbb3[_0x215b('0x3c')][0x7]['value']:undefined)||''},{'name':_0x215b('0x4f'),'value':_0x22fbb3['attrWhatsappAccounts']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x8]?_0x22fbb3[_0x215b('0x3c')][0x8]['value']:undefined)||''},{'name':_0x215b('0x50'),'value':_0x22fbb3[_0x215b('0x50')]||(_0x22fbb3['attrs']&&_0x22fbb3['attrs'][0x9]?_0x22fbb3[_0x215b('0x3c')][0x9][_0x215b('0x3d')]:undefined)||''}];case'multibar-chart':case _0x215b('0x51'):return[{'name':_0x215b('0x52'),'value':_0x22fbb3[_0x215b('0x52')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0][_0x215b('0x3d')]:undefined)||'total'},{'name':'attrSerie2','value':_0x22fbb3[_0x215b('0x53')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1][_0x215b('0x3d')]:undefined)||null},{'name':_0x215b('0x54'),'value':_0x22fbb3[_0x215b('0x54')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x2]?_0x22fbb3[_0x215b('0x3c')][0x2][_0x215b('0x3d')]:undefined)||null},{'name':_0x215b('0x48'),'value':_0x22fbb3['attrVoiceQueues']||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x3]?_0x22fbb3[_0x215b('0x3c')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x22fbb3[_0x215b('0x49')]||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x4]?_0x22fbb3['attrs'][0x4][_0x215b('0x3d')]:undefined)||'voice'},{'name':_0x215b('0x4b'),'value':_0x22fbb3[_0x215b('0x4b')]||(_0x22fbb3['attrs']&&_0x22fbb3[_0x215b('0x3c')][0x5]?_0x22fbb3['attrs'][0x5][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x4c'),'value':_0x22fbb3[_0x215b('0x4c')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x6]?_0x22fbb3[_0x215b('0x3c')][0x6]['value']:undefined)||''},{'name':_0x215b('0x4d'),'value':_0x22fbb3[_0x215b('0x4d')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x7]?_0x22fbb3['attrs'][0x7]['value']:undefined)||''},{'name':_0x215b('0x4e'),'value':_0x22fbb3[_0x215b('0x4e')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x8]?_0x22fbb3[_0x215b('0x3c')][0x8][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x4f'),'value':_0x22fbb3[_0x215b('0x4f')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3['attrs'][0x9]?_0x22fbb3[_0x215b('0x3c')][0x9][_0x215b('0x3d')]:undefined)||''},{'name':_0x215b('0x50'),'value':_0x22fbb3[_0x215b('0x50')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0xa]?_0x22fbb3[_0x215b('0x3c')][0xa][_0x215b('0x3d')]:undefined)||''}];case _0x215b('0x55'):return[{'name':_0x215b('0x56'),'type':_0x22fbb3[_0x215b('0x57')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0]['type']:undefined)||null,'value':_0x22fbb3[_0x215b('0x56')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x0]?_0x22fbb3[_0x215b('0x3c')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x22fbb3[_0x215b('0x58')]||(_0x22fbb3[_0x215b('0x3c')]&&_0x22fbb3[_0x215b('0x3c')][0x1]?_0x22fbb3[_0x215b('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xf7497c){logger['error'](_0x215b('0x59'),JSON[_0x215b('0x5a')](_0xf7497c));return[];}}exports[_0x215b('0x5b')]=function(_0x3fc7aa,_0x305517){if(_0x3fc7aa[_0x215b('0x5c')]){_0x3fc7aa['body'][_0x215b('0x3c')]=widgetAttributes(_0x3fc7aa[_0x215b('0x5c')]);}return db[_0x215b('0x36')][_0x215b('0x5b')](_0x3fc7aa[_0x215b('0x5c')],{})[_0x215b('0x27')](respondWithResult(_0x305517,0xc9))['catch'](handleError(_0x305517,null));};exports[_0x215b('0x26')]=function(_0x3ff49d,_0x106595){if(_0x3ff49d['body']['id']){delete _0x3ff49d[_0x215b('0x5c')]['id'];}_0x3ff49d[_0x215b('0x5c')]['attrs']=widgetAttributes(_0x3ff49d[_0x215b('0x5c')]);return db[_0x215b('0x36')]['find']({'where':{'id':_0x3ff49d[_0x215b('0x38')]['id']}})[_0x215b('0x27')](handleEntityNotFound(_0x106595,null))['then'](saveUpdates(_0x3ff49d['body'],null))[_0x215b('0x27')](respondWithResult(_0x106595,null))[_0x215b('0x39')](handleError(_0x106595,null));}; \ No newline at end of file +var _0xa786=['total','attrSerie2','attrSerie3','attrChatWebsites','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','catch','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','type','iframe','attrUrl','attrs','value','https://','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart'];(function(_0x3b45d7,_0xbc2848){var _0x4690e8=function(_0x209c3b){while(--_0x209c3b){_0x3b45d7['push'](_0x3b45d7['shift']());}};_0x4690e8(++_0xbc2848);}(_0xa786,0x71));var _0x6a78=function(_0x394c71,_0x582fe8){_0x394c71=_0x394c71-0x0;var _0x5d6e42=_0xa786[_0x394c71];return _0x5d6e42;};'use strict';var emlformat=require(_0x6a78('0x0'));var rimraf=require(_0x6a78('0x1'));var zipdir=require(_0x6a78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a78('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a78('0x4'));var util=require(_0x6a78('0x5'));var path=require(_0x6a78('0x6'));var sox=require(_0x6a78('0x7'));var csv=require(_0x6a78('0x8'));var ejs=require(_0x6a78('0x9'));var fs=require('fs');var fs_extra=require(_0x6a78('0xa'));var _=require('lodash');var squel=require(_0x6a78('0xb'));var crypto=require(_0x6a78('0xc'));var jsforce=require(_0x6a78('0xd'));var deskjs=require(_0x6a78('0xe'));var toCsv=require(_0x6a78('0x8'));var querystring=require(_0x6a78('0xf'));var Papa=require(_0x6a78('0x10'));var Redis=require(_0x6a78('0x11'));var authService=require(_0x6a78('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6a78('0x13'));var hardwareService=require(_0x6a78('0x14'));var logger=require(_0x6a78('0x15'))('api');var utils=require(_0x6a78('0x16'));var config=require(_0x6a78('0x17'));var licenseUtil=require(_0x6a78('0x18'));var db=require(_0x6a78('0x19'))['db'];config[_0x6a78('0x1a')]=_['defaults'](config[_0x6a78('0x1a')],{'host':_0x6a78('0x1b'),'port':0x18eb});var socket=require(_0x6a78('0x1c'))(new Redis(config['redis']));require(_0x6a78('0x1d'))[_0x6a78('0x1e')](socket);function respondWithStatusCode(_0x4c5351,_0x476d18){_0x476d18=_0x476d18||0xcc;return function(_0x42ae6f){if(_0x42ae6f){return _0x4c5351[_0x6a78('0x1f')](_0x476d18);}return _0x4c5351[_0x6a78('0x20')](_0x476d18)[_0x6a78('0x21')]();};}function respondWithResult(_0x36e824,_0x4e9031){_0x4e9031=_0x4e9031||0xc8;return function(_0x27d687){if(_0x27d687){return _0x36e824[_0x6a78('0x20')](_0x4e9031)[_0x6a78('0x22')](_0x27d687);}};}function respondWithFilteredResult(_0x265f90,_0x4fa916){return function(_0x5e3616){if(_0x5e3616){var _0x460991=typeof _0x4fa916['offset']==='undefined'&&typeof _0x4fa916['limit']===_0x6a78('0x23');var _0xed3863=_0x5e3616[_0x6a78('0x24')];var _0x5e7922=_0x460991?0x0:_0x4fa916['offset'];var _0xcc06ea=_0x460991?_0x5e3616[_0x6a78('0x24')]:_0x4fa916[_0x6a78('0x25')]+_0x4fa916[_0x6a78('0x26')];var _0x5dc3fa;if(_0xcc06ea>=_0xed3863){_0xcc06ea=_0xed3863;_0x5dc3fa=0xc8;}else{_0x5dc3fa=0xce;}_0x265f90['status'](_0x5dc3fa);return _0x265f90['set'](_0x6a78('0x27'),_0x5e7922+'-'+_0xcc06ea+'/'+_0xed3863)['json'](_0x5e3616);}return null;};}function patchUpdates(_0xd938cd){return function(_0x2fbfd1){try{jsonpatch[_0x6a78('0x28')](_0x2fbfd1,_0xd938cd,!![]);}catch(_0x4b47b6){return BPromise[_0x6a78('0x29')](_0x4b47b6);}return _0x2fbfd1[_0x6a78('0x2a')]();};}function saveUpdates(_0x89fd2b,_0x2a363f){return function(_0x246f6c){if(_0x246f6c){return _0x246f6c[_0x6a78('0x2b')](_0x89fd2b)[_0x6a78('0x2c')](function(_0xefaa55){return _0xefaa55;});}return null;};}function removeEntity(_0x4ea33e,_0x28cbbf){return function(_0xf17e35){if(_0xf17e35){return _0xf17e35[_0x6a78('0x2d')]()['then'](function(){_0x4ea33e[_0x6a78('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbe2627,_0x196b81){return function(_0x5cef13){if(!_0x5cef13){_0xbe2627[_0x6a78('0x1f')](0x194);}return _0x5cef13;};}function handleError(_0x159b96,_0xfdd266){_0xfdd266=_0xfdd266||0x1f4;return function(_0x149105){logger['error'](_0x149105[_0x6a78('0x2e')]);if(_0x149105[_0x6a78('0x2f')]){delete _0x149105[_0x6a78('0x2f')];}_0x159b96[_0x6a78('0x20')](_0xfdd266)['send'](_0x149105);};}exports[_0x6a78('0x30')]=function(_0x9bc18,_0x3299c2){var _0x4cc569={'raw':![],'where':{'id':_0x9bc18[_0x6a78('0x31')]['id']}},_0x118f6c={};_0x118f6c['model']=_[_0x6a78('0x32')](db[_0x6a78('0x33')][_0x6a78('0x34')]);_0x118f6c[_0x6a78('0x35')]=_[_0x6a78('0x32')](_0x9bc18['query']);_0x118f6c[_0x6a78('0x36')]=_[_0x6a78('0x37')](_0x118f6c['model'],_0x118f6c[_0x6a78('0x35')]);_0x4cc569[_0x6a78('0x38')]=_[_0x6a78('0x37')](_0x118f6c[_0x6a78('0x39')],qs[_0x6a78('0x3a')](_0x9bc18[_0x6a78('0x35')]['fields']));_0x4cc569[_0x6a78('0x38')]=_0x4cc569['attributes'][_0x6a78('0x3b')]?_0x4cc569[_0x6a78('0x38')]:_0x118f6c[_0x6a78('0x39')];if(_0x9bc18[_0x6a78('0x35')][_0x6a78('0x3c')]){_0x4cc569[_0x6a78('0x3d')]=[{'all':!![]}];}_0x4cc569=_[_0x6a78('0x3e')]({},_0x4cc569,_0x9bc18[_0x6a78('0x3f')]);return db[_0x6a78('0x33')]['find'](_0x4cc569)['then'](handleEntityNotFound(_0x3299c2,null))[_0x6a78('0x2c')](respondWithResult(_0x3299c2,null))['catch'](handleError(_0x3299c2,null));};exports[_0x6a78('0x2d')]=function(_0x50cc5b,_0x1c1514){return db[_0x6a78('0x33')][_0x6a78('0x40')]({'where':{'id':_0x50cc5b[_0x6a78('0x31')]['id']}})[_0x6a78('0x2c')](handleEntityNotFound(_0x1c1514,null))[_0x6a78('0x2c')](removeEntity(_0x1c1514,null))['catch'](handleError(_0x1c1514,null));};function widgetAttributes(_0x34cb3a){try{switch(_0x34cb3a[_0x6a78('0x41')]){case _0x6a78('0x42'):return[{'name':'attrUrl','value':_0x34cb3a[_0x6a78('0x43')]||(_0x34cb3a['attrs']&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0][_0x6a78('0x45')]:undefined)||_0x6a78('0x46')}];case'custom':return[{'name':'attrPath','value':_0x34cb3a['attrPath']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a['attrs'][0x0][_0x6a78('0x45')]:undefined)||''}];case _0x6a78('0x47'):return[{'name':_0x6a78('0x48'),'value':_0x34cb3a[_0x6a78('0x48')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a['attrs'][0x0][_0x6a78('0x45')]:undefined)||_0x6a78('0x49')},{'name':_0x6a78('0x4a'),'value':_0x34cb3a[_0x6a78('0x4a')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1]['value']:undefined)||_0x6a78('0x4b')},{'name':'attrFontSize','value':_0x34cb3a[_0x6a78('0x4c')]||(_0x34cb3a['attrs']&&_0x34cb3a['attrs'][0x2]?_0x34cb3a[_0x6a78('0x44')][0x2][_0x6a78('0x45')]:undefined)||0xc}];case'counter':return[{'name':_0x6a78('0x4d'),'value':_0x34cb3a[_0x6a78('0x4d')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0]['value']:undefined)||'total'},{'name':_0x6a78('0x4e'),'value':_0x34cb3a[_0x6a78('0x4e')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1][_0x6a78('0x45')]:undefined)||[]},{'name':_0x6a78('0x4c'),'value':_0x34cb3a['attrFontSize']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x2]?_0x34cb3a['attrs'][0x2][_0x6a78('0x45')]:undefined)||0x14},{'name':_0x6a78('0x4f'),'value':_0x34cb3a[_0x6a78('0x4f')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x3]?_0x34cb3a[_0x6a78('0x44')][0x3]['value']:undefined)||_0x6a78('0x50')},{'name':_0x6a78('0x51'),'value':_0x34cb3a[_0x6a78('0x51')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x4]?_0x34cb3a['attrs'][0x4][_0x6a78('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x34cb3a[_0x6a78('0x52')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x5]?_0x34cb3a[_0x6a78('0x44')][0x5]['value']:undefined)||''},{'name':_0x6a78('0x53'),'value':_0x34cb3a[_0x6a78('0x53')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x6]?_0x34cb3a[_0x6a78('0x44')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x34cb3a[_0x6a78('0x54')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x7]?_0x34cb3a[_0x6a78('0x44')][0x7]['value']:undefined)||''},{'name':_0x6a78('0x55'),'value':_0x34cb3a[_0x6a78('0x55')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x8]?_0x34cb3a['attrs'][0x8][_0x6a78('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x34cb3a['attrChatWebsites']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x9]?_0x34cb3a[_0x6a78('0x44')][0x9][_0x6a78('0x45')]:undefined)||''}];case _0x6a78('0x56'):case'pie-chart':return[{'name':'attrSerie1','value':_0x34cb3a['attrSerie1']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0]['value']:undefined)||_0x6a78('0x57')},{'name':_0x6a78('0x58'),'value':_0x34cb3a['attrSerie2']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1][_0x6a78('0x45')]:undefined)||null},{'name':_0x6a78('0x59'),'value':_0x34cb3a[_0x6a78('0x59')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x2]?_0x34cb3a['attrs'][0x2]['value']:undefined)||null},{'name':_0x6a78('0x4e'),'value':_0x34cb3a['attrVoiceQueues']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x3]?_0x34cb3a[_0x6a78('0x44')][0x3][_0x6a78('0x45')]:undefined)||[]},{'name':'attrChannel','value':_0x34cb3a[_0x6a78('0x4f')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x4]?_0x34cb3a[_0x6a78('0x44')][0x4][_0x6a78('0x45')]:undefined)||_0x6a78('0x50')},{'name':_0x6a78('0x51'),'value':_0x34cb3a[_0x6a78('0x51')]||(_0x34cb3a['attrs']&&_0x34cb3a[_0x6a78('0x44')][0x5]?_0x34cb3a[_0x6a78('0x44')][0x5][_0x6a78('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x34cb3a['attrFaxAccounts']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x6]?_0x34cb3a['attrs'][0x6][_0x6a78('0x45')]:undefined)||''},{'name':_0x6a78('0x53'),'value':_0x34cb3a[_0x6a78('0x53')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x7]?_0x34cb3a[_0x6a78('0x44')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x34cb3a[_0x6a78('0x54')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x8]?_0x34cb3a[_0x6a78('0x44')][0x8][_0x6a78('0x45')]:undefined)||''},{'name':_0x6a78('0x55'),'value':_0x34cb3a[_0x6a78('0x55')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x9]?_0x34cb3a[_0x6a78('0x44')][0x9][_0x6a78('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x34cb3a[_0x6a78('0x5a')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0xa]?_0x34cb3a[_0x6a78('0x44')][0xa][_0x6a78('0x45')]:undefined)||''}];case'web-report':return[{'name':_0x6a78('0x5b'),'type':_0x34cb3a[_0x6a78('0x5c')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0][_0x6a78('0x41')]:undefined)||null,'value':_0x34cb3a[_0x6a78('0x5b')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a['attrs'][0x0][_0x6a78('0x45')]:undefined)||null},{'name':_0x6a78('0x5d'),'value':_0x34cb3a[_0x6a78('0x5d')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1][_0x6a78('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x2f7807){logger[_0x6a78('0x5e')](_0x6a78('0x5f'),JSON[_0x6a78('0x60')](_0x2f7807));return[];}}exports[_0x6a78('0x61')]=function(_0x245acb,_0x3fe964){if(_0x245acb['body']){_0x245acb[_0x6a78('0x62')][_0x6a78('0x44')]=widgetAttributes(_0x245acb[_0x6a78('0x62')]);}return db[_0x6a78('0x33')]['create'](_0x245acb['body'],{})[_0x6a78('0x2c')](respondWithResult(_0x3fe964,0xc9))[_0x6a78('0x63')](handleError(_0x3fe964,null));};exports[_0x6a78('0x2b')]=function(_0x9dfae6,_0x14282a){if(_0x9dfae6['body']['id']){delete _0x9dfae6[_0x6a78('0x62')]['id'];}_0x9dfae6[_0x6a78('0x62')][_0x6a78('0x44')]=widgetAttributes(_0x9dfae6[_0x6a78('0x62')]);return db['DashboardItem'][_0x6a78('0x40')]({'where':{'id':_0x9dfae6[_0x6a78('0x31')]['id']}})[_0x6a78('0x2c')](handleEntityNotFound(_0x14282a,null))['then'](saveUpdates(_0x9dfae6['body'],null))[_0x6a78('0x2c')](respondWithResult(_0x14282a,null))['catch'](handleError(_0x14282a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index b52e45f..65f9567 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 _0xf759=['DashboardItem','setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0xc37c7e,_0x5a648d){var _0x19ea6d=function(_0x13609f){while(--_0x13609f){_0xc37c7e['push'](_0xc37c7e['shift']());}};_0x19ea6d(++_0x5a648d);}(_0xf759,0x154));var _0x9f75=function(_0x24a5d7,_0x3ec114){_0x24a5d7=_0x24a5d7-0x0;var _0x648d86=_0xf759[_0x24a5d7];return _0x648d86;};'use strict';var EventEmitter=require(_0x9f75('0x0'));var DashboardItem=require(_0x9f75('0x1'))['db'][_0x9f75('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9f75('0x3')](0x0);var events={'afterCreate':_0x9f75('0x4'),'afterUpdate':_0x9f75('0x5'),'afterDestroy':_0x9f75('0x6')};function emitEvent(_0xf22315){return function(_0x3692df,_0x2a5404,_0x2fb1b0){DashboardItemEvents['emit'](_0xf22315+':'+_0x3692df['id'],_0x3692df);DashboardItemEvents[_0x9f75('0x7')](_0xf22315,_0x3692df);_0x2fb1b0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x9f75('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x5c84=['DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5c84,0x1ca));var _0x45c8=function(_0x203fa3,_0x1acde1){_0x203fa3=_0x203fa3-0x0;var _0x293831=_0x5c84[_0x203fa3];return _0x293831;};'use strict';var EventEmitter=require(_0x45c8('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x45c8('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x45c8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x45c8('0x3'),'afterDestroy':_0x45c8('0x4')};function emitEvent(_0x574115){return function(_0x281a51,_0x4d0715,_0x23b847){DashboardItemEvents[_0x45c8('0x5')](_0x574115+':'+_0x281a51['id'],_0x281a51);DashboardItemEvents[_0x45c8('0x5')](_0x574115,_0x281a51);_0x23b847(null);};}for(var e in events){if(events[_0x45c8('0x6')](e)){var event=events[e];DashboardItem[_0x45c8('0x7')](e,emitEvent(event));}}module[_0x45c8('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b170c53..e98e354 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 _0x642b=['exports','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x642b,0x196));var _0xb642=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x642b[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0xb642('0x0'));var logger=require(_0xb642('0x1'))(_0xb642('0x2'));var moment=require(_0xb642('0x3'));var BPromise=require(_0xb642('0x4'));var rp=require(_0xb642('0x5'));var fs=require('fs');var path=require(_0xb642('0x6'));var rimraf=require(_0xb642('0x7'));var config=require(_0xb642('0x8'));var attributes=require(_0xb642('0x9'));module[_0xb642('0xa')]=function(_0x3463c5,_0x2de868){return _0x3463c5['define'](_0xb642('0xb'),attributes,{'tableName':_0xb642('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2516=['define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x2516,0x9d));var _0x6251=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x2516[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var logger=require(_0x6251('0x2'))(_0x6251('0x3'));var moment=require(_0x6251('0x4'));var BPromise=require('bluebird');var rp=require(_0x6251('0x5'));var fs=require('fs');var path=require(_0x6251('0x6'));var rimraf=require(_0x6251('0x7'));var config=require(_0x6251('0x8'));var attributes=require(_0x6251('0x9'));module[_0x6251('0xa')]=function(_0x52d3b7,_0x3be691){return _0x52d3b7[_0x6251('0xb')](_0x6251('0xc'),attributes,{'tableName':_0x6251('0xd'),'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 9c02a8a..31faf52 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 _0x6119=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request'];(function(_0x1ccdee,_0x2a80dc){var _0x808f1d=function(_0x15263f){while(--_0x15263f){_0x1ccdee['push'](_0x1ccdee['shift']());}};_0x808f1d(++_0x2a80dc);}(_0x6119,0x190));var _0x9611=function(_0x5ebede,_0x220afe){_0x5ebede=_0x5ebede-0x0;var _0x273f8e=_0x6119[_0x5ebede];return _0x273f8e;};'use strict';var _=require(_0x9611('0x0'));var util=require(_0x9611('0x1'));var moment=require(_0x9611('0x2'));var BPromise=require(_0x9611('0x3'));var rs=require(_0x9611('0x4'));var fs=require('fs');var Redis=require(_0x9611('0x5'));var db=require(_0x9611('0x6'))['db'];var utils=require(_0x9611('0x7'));var logger=require(_0x9611('0x8'))(_0x9611('0x9'));var config=require(_0x9611('0xa'));var jayson=require(_0x9611('0xb'));var client=jayson[_0x9611('0xc')][_0x9611('0xd')]({'port':0x232a});config[_0x9611('0xe')]=_[_0x9611('0xf')](config[_0x9611('0xe')],{'host':_0x9611('0x10'),'port':0x18eb});var socket=require(_0x9611('0x11'))(new Redis(config[_0x9611('0xe')]));require(_0x9611('0x12'))['register'](socket);function respondWithRpcPromise(_0x5cd81e,_0x11eda6,_0xe5ac64){return new BPromise(function(_0xf0b80d,_0x4272c6){return client[_0x9611('0x13')](_0x5cd81e,_0xe5ac64)['then'](function(_0x3b1977){logger['info'](_0x9611('0x14'),_0x11eda6,_0x9611('0x15'));logger[_0x9611('0x16')](_0x9611('0x17'),_0x11eda6,_0x9611('0x15'),JSON[_0x9611('0x18')](_0x3b1977));if(_0x3b1977[_0x9611('0x19')]){if(_0x3b1977[_0x9611('0x19')][_0x9611('0x1a')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x11eda6,_0x3b1977['error'][_0x9611('0x1b')]);return _0x4272c6(_0x3b1977[_0x9611('0x19')][_0x9611('0x1b')]);}logger['error'](_0x9611('0x14'),_0x11eda6,_0x3b1977[_0x9611('0x19')][_0x9611('0x1b')]);return _0xf0b80d(_0x3b1977[_0x9611('0x19')][_0x9611('0x1b')]);}else{logger[_0x9611('0x1c')](_0x9611('0x14'),_0x11eda6,'request\x20sent');_0xf0b80d(_0x3b1977['result'][_0x9611('0x1b')]);}})[_0x9611('0x1d')](function(_0x5df864){logger[_0x9611('0x19')](_0x9611('0x14'),_0x11eda6,_0x5df864);_0x4272c6(_0x5df864);});});} \ No newline at end of file +var _0x4a4a=['catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','DashboardItem,\x20%s,\x20%s','message'];(function(_0x530c80,_0x554bb1){var _0x43c149=function(_0x1e66d3){while(--_0x1e66d3){_0x530c80['push'](_0x530c80['shift']());}};_0x43c149(++_0x554bb1);}(_0x4a4a,0x1b1));var _0xa4a4=function(_0x404682,_0x547c67){_0x404682=_0x404682-0x0;var _0x85dadd=_0x4a4a[_0x404682];return _0x85dadd;};'use strict';var _=require('lodash');var util=require(_0xa4a4('0x0'));var moment=require(_0xa4a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xa4a4('0x2'));var fs=require('fs');var Redis=require(_0xa4a4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4a4('0x4'));var logger=require(_0xa4a4('0x5'))('rpc');var config=require(_0xa4a4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa4a4('0x7')][_0xa4a4('0x8')]({'port':0x232a});config[_0xa4a4('0x9')]=_[_0xa4a4('0xa')](config[_0xa4a4('0x9')],{'host':_0xa4a4('0xb'),'port':0x18eb});var socket=require(_0xa4a4('0xc'))(new Redis(config[_0xa4a4('0x9')]));require(_0xa4a4('0xd'))['register'](socket);function respondWithRpcPromise(_0x488cf7,_0x47f415,_0x58d164){return new BPromise(function(_0x49efdf,_0x2906b9){return client[_0xa4a4('0xe')](_0x488cf7,_0x58d164)['then'](function(_0x1276e4){logger[_0xa4a4('0xf')]('DashboardItem,\x20%s,\x20%s',_0x47f415,'request\x20sent');logger[_0xa4a4('0x10')](_0xa4a4('0x11'),_0x47f415,_0xa4a4('0x12'),JSON[_0xa4a4('0x13')](_0x1276e4));if(_0x1276e4[_0xa4a4('0x14')]){if(_0x1276e4['error']['code']===0x1f4){logger[_0xa4a4('0x14')](_0xa4a4('0x15'),_0x47f415,_0x1276e4[_0xa4a4('0x14')]['message']);return _0x2906b9(_0x1276e4[_0xa4a4('0x14')]['message']);}logger[_0xa4a4('0x14')](_0xa4a4('0x15'),_0x47f415,_0x1276e4[_0xa4a4('0x14')][_0xa4a4('0x16')]);return _0x49efdf(_0x1276e4[_0xa4a4('0x14')][_0xa4a4('0x16')]);}else{logger[_0xa4a4('0xf')](_0xa4a4('0x15'),_0x47f415,_0xa4a4('0x12'));_0x49efdf(_0x1276e4['result'][_0xa4a4('0x16')]);}})[_0xa4a4('0x17')](function(_0x58bd97){logger[_0xa4a4('0x14')](_0xa4a4('0x15'),_0x47f415,_0x58bd97);_0x2906b9(_0x58bd97);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7984be2..a2243d8 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 _0xe2d2=['dashboardItem:','save','remove','emit','register'];(function(_0x248b44,_0x24fdfb){var _0xf63758=function(_0x5b138d){while(--_0x5b138d){_0x248b44['push'](_0x248b44['shift']());}};_0xf63758(++_0x24fdfb);}(_0xe2d2,0x1d7));var _0x2e2d=function(_0x594fed,_0x5f3e58){_0x594fed=_0x594fed-0x0;var _0x3f4d65=_0xe2d2[_0x594fed];return _0x3f4d65;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x2e2d('0x0'),_0x2e2d('0x1'),'update'];function createListener(_0x1806a4,_0x3f3f02){return function(_0x23cd58){_0x3f3f02[_0x2e2d('0x2')](_0x1806a4,_0x23cd58);};}function removeListener(_0x576b98,_0x521f30){return function(){DashboardItemEvents['removeListener'](_0x576b98,_0x521f30);};}exports[_0x2e2d('0x3')]=function(_0x46893e){for(var _0x1edb11=0x0,_0x1a7ea4=events['length'];_0x1edb11<_0x1a7ea4;_0x1edb11++){var _0xc9a5c1=events[_0x1edb11];var _0x3bfa90=createListener(_0x2e2d('0x4')+_0xc9a5c1,_0x46893e);DashboardItemEvents['on'](_0xc9a5c1,_0x3bfa90);}}; \ No newline at end of file +var _0x9e61=['./dashboardItem.events','save','remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x469fa0,_0x43695c){var _0x3fa3b4=function(_0xfb0465){while(--_0xfb0465){_0x469fa0['push'](_0x469fa0['shift']());}};_0x3fa3b4(++_0x43695c);}(_0x9e61,0x15f));var _0x19e6=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x9e61[_0x59d89e];return _0x554e93;};'use strict';var DashboardItemEvents=require(_0x19e6('0x0'));var events=[_0x19e6('0x1'),_0x19e6('0x2'),_0x19e6('0x3')];function createListener(_0x26484f,_0x591cde){return function(_0x4c5396){_0x591cde[_0x19e6('0x4')](_0x26484f,_0x4c5396);};}function removeListener(_0x292925,_0x49e553){return function(){DashboardItemEvents[_0x19e6('0x5')](_0x292925,_0x49e553);};}exports[_0x19e6('0x6')]=function(_0x5bfc12){for(var _0x6ac887=0x0,_0x127866=events[_0x19e6('0x7')];_0x6ac887<_0x127866;_0x6ac887++){var _0x59a228=events[_0x6ac887];var _0x5362bf=createListener(_0x19e6('0x8')+_0x59a228,_0x5bfc12);DashboardItemEvents['on'](_0x59a228,_0x5362bf);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 4e4e44e..a5b2c0f 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 _0x5128=['delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','create','put','update'];(function(_0x1f45f6,_0x31be90){var _0x48f22b=function(_0x3fad90){while(--_0x3fad90){_0x1f45f6['push'](_0x1f45f6['shift']());}};_0x48f22b(++_0x31be90);}(_0x5128,0x19a));var _0x8512=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x5128[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x8512('0x0'));var util=require(_0x8512('0x1'));var path=require(_0x8512('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8512('0x3')]();var fs_extra=require(_0x8512('0x4'));var auth=require(_0x8512('0x5'));var interaction=require(_0x8512('0x6'));var config=require(_0x8512('0x7'));var controller=require(_0x8512('0x8'));router['get'](_0x8512('0x9'),auth[_0x8512('0xa')](),controller[_0x8512('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8512('0xc')]);router[_0x8512('0xd')](_0x8512('0x9'),auth[_0x8512('0xa')](),controller[_0x8512('0xe')]);router[_0x8512('0xf')](_0x8512('0x9'),auth[_0x8512('0xa')](),controller[_0x8512('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7eec=['/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','get'];(function(_0x48b01c,_0x493709){var _0x5442e3=function(_0x5623b6){while(--_0x5623b6){_0x48b01c['push'](_0x48b01c['shift']());}};_0x5442e3(++_0x493709);}(_0x7eec,0x79));var _0xc7ee=function(_0x10b533,_0x53ea06){_0x10b533=_0x10b533-0x0;var _0x4f6059=_0x7eec[_0x10b533];return _0x4f6059;};'use strict';var multer=require('multer');var util=require(_0xc7ee('0x0'));var path=require(_0xc7ee('0x1'));var timeout=require(_0xc7ee('0x2'));var express=require(_0xc7ee('0x3'));var router=express[_0xc7ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc7ee('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0xc7ee('0x6')](_0xc7ee('0x7'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc7ee('0xa')]);router[_0xc7ee('0xb')](_0xc7ee('0x7'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xc')]);router[_0xc7ee('0xd')](_0xc7ee('0x7'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xe')]);module[_0xc7ee('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index b96c74f..e135acb 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 _0xa439=['ENUM','first','third','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa439,0x99));var _0x9a43=function(_0x4581b1,_0x59a1c3){_0x4581b1=_0x4581b1-0x0;var _0x136efb=_0xa439[_0x4581b1];return _0x136efb;};'use strict';var Sequelize=require(_0x9a43('0x0'));module[_0x9a43('0x1')]={'name':{'type':Sequelize[_0x9a43('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x9a43('0x3')](_0x9a43('0x4'),'second',_0x9a43('0x5')),'allowNull':![],'defaultValue':_0x9a43('0x4')},'description':{'type':Sequelize[_0x9a43('0x2')]}}; \ No newline at end of file +var _0xef32=['STRING','ENUM','second','third','sequelize','exports'];(function(_0x29b8cc,_0x404aba){var _0x880a7d=function(_0x2eae8a){while(--_0x2eae8a){_0x29b8cc['push'](_0x29b8cc['shift']());}};_0x880a7d(++_0x404aba);}(_0xef32,0x112));var _0x2ef3=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0xef32[_0x26f1b2];return _0x1624a4;};'use strict';var Sequelize=require(_0x2ef3('0x0'));module[_0x2ef3('0x1')]={'name':{'type':Sequelize[_0x2ef3('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x2ef3('0x3')]('first',_0x2ef3('0x4'),_0x2ef3('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x2ef3('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 22621fc..b0e18b9 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 _0xdbfe=['type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','get','Dispositions','destroy','then','error','stack','name','send','index','Disposition','rawAttributes','fieldName'];(function(_0xf14bd4,_0x38cf5e){var _0x301af7=function(_0x55e0e2){while(--_0x55e0e2){_0xf14bd4['push'](_0xf14bd4['shift']());}};_0x301af7(++_0x38cf5e);}(_0xdbfe,0xd0));var _0xedbf=function(_0x5643ff,_0x1982b3){_0x5643ff=_0x5643ff-0x0;var _0x347ce5=_0xdbfe[_0x5643ff];return _0x347ce5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedbf('0x0'));var zipdir=require(_0xedbf('0x1'));var jsonpatch=require(_0xedbf('0x2'));var rp=require(_0xedbf('0x3'));var moment=require(_0xedbf('0x4'));var BPromise=require(_0xedbf('0x5'));var Mustache=require(_0xedbf('0x6'));var util=require(_0xedbf('0x7'));var path=require(_0xedbf('0x8'));var sox=require(_0xedbf('0x9'));var csv=require(_0xedbf('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedbf('0xb'));var _=require(_0xedbf('0xc'));var squel=require(_0xedbf('0xd'));var crypto=require(_0xedbf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xedbf('0xf'));var toCsv=require(_0xedbf('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xedbf('0x10'));var authService=require(_0xedbf('0x11'));var qs=require(_0xedbf('0x12'));var as=require(_0xedbf('0x13'));var hardwareService=require(_0xedbf('0x14'));var logger=require(_0xedbf('0x15'))('api');var utils=require(_0xedbf('0x16'));var config=require(_0xedbf('0x17'));var licenseUtil=require(_0xedbf('0x18'));var db=require(_0xedbf('0x19'))['db'];function respondWithStatusCode(_0x430168,_0x5242cf){_0x5242cf=_0x5242cf||0xcc;return function(_0x351a33){if(_0x351a33){return _0x430168[_0xedbf('0x1a')](_0x5242cf);}return _0x430168[_0xedbf('0x1b')](_0x5242cf)['end']();};}function respondWithResult(_0x533fe4,_0x1ae042){_0x1ae042=_0x1ae042||0xc8;return function(_0x3b39db){if(_0x3b39db){return _0x533fe4[_0xedbf('0x1b')](_0x1ae042)[_0xedbf('0x1c')](_0x3b39db);}};}function respondWithFilteredResult(_0x11c4f3,_0x127f2d){return function(_0x1e6a70){if(_0x1e6a70){var _0x4903a4=typeof _0x127f2d['offset']===_0xedbf('0x1d')&&typeof _0x127f2d[_0xedbf('0x1e')]===_0xedbf('0x1d');var _0x1837c1=_0x1e6a70[_0xedbf('0x1f')];var _0x265856=_0x4903a4?0x0:_0x127f2d[_0xedbf('0x20')];var _0x3ec3cc=_0x4903a4?_0x1e6a70[_0xedbf('0x1f')]:_0x127f2d[_0xedbf('0x20')]+_0x127f2d[_0xedbf('0x1e')];var _0x2e981d;if(_0x3ec3cc>=_0x1837c1){_0x3ec3cc=_0x1837c1;_0x2e981d=0xc8;}else{_0x2e981d=0xce;}_0x11c4f3[_0xedbf('0x1b')](_0x2e981d);return _0x11c4f3[_0xedbf('0x21')](_0xedbf('0x22'),_0x265856+'-'+_0x3ec3cc+'/'+_0x1837c1)[_0xedbf('0x1c')](_0x1e6a70);}return null;};}function patchUpdates(_0x4f036c){return function(_0x219577){try{jsonpatch[_0xedbf('0x23')](_0x219577,_0x4f036c,!![]);}catch(_0x44cd27){return BPromise[_0xedbf('0x24')](_0x44cd27);}return _0x219577[_0xedbf('0x25')]();};}function saveUpdates(_0x4bb274,_0x543430){return function(_0x4ab11e){if(_0x4ab11e){return _0x4ab11e['update'](_0x4bb274)['then'](function(_0x36b348){return _0x36b348;});}return null;};}function removeEntity(_0x266231,_0x692771){return function(_0x20018d){if(_0x20018d){return _0x20018d['destroy']()['then'](function(){var _0xca6cd=_0x20018d[_0xedbf('0x26')]({'plain':!![]});var _0x39b675=_0xedbf('0x27');return db['UserProfileResource'][_0xedbf('0x28')]({'where':{'type':_0x39b675,'resourceId':_0xca6cd['id']}})[_0xedbf('0x29')](function(){return _0x20018d;});})['then'](function(){_0x266231[_0xedbf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b7d2e,_0x46a52d){return function(_0x34a4fd){if(!_0x34a4fd){_0x2b7d2e[_0xedbf('0x1a')](0x194);}return _0x34a4fd;};}function handleError(_0xd24651,_0xf99676){_0xf99676=_0xf99676||0x1f4;return function(_0x116355){logger[_0xedbf('0x2a')](_0x116355[_0xedbf('0x2b')]);if(_0x116355[_0xedbf('0x2c')]){delete _0x116355[_0xedbf('0x2c')];}_0xd24651[_0xedbf('0x1b')](_0xf99676)[_0xedbf('0x2d')](_0x116355);};}exports[_0xedbf('0x2e')]=function(_0x4be9b4,_0x44fcc0){var _0x1a42fb={},_0x5d8b7c={},_0x3ed681={'count':0x0,'rows':[]};var _0x2ada3f=_['map'](db[_0xedbf('0x2f')][_0xedbf('0x30')],function(_0xd07c02){return{'name':_0xd07c02[_0xedbf('0x31')],'type':_0xd07c02[_0xedbf('0x32')]['key']};});_0x5d8b7c[_0xedbf('0x33')]=_['map'](_0x2ada3f,_0xedbf('0x2c'));_0x5d8b7c['query']=_['keys'](_0x4be9b4[_0xedbf('0x34')]);_0x5d8b7c[_0xedbf('0x35')]=_[_0xedbf('0x36')](_0x5d8b7c[_0xedbf('0x33')],_0x5d8b7c[_0xedbf('0x34')]);_0x1a42fb[_0xedbf('0x37')]=_[_0xedbf('0x36')](_0x5d8b7c[_0xedbf('0x33')],qs[_0xedbf('0x38')](_0x4be9b4[_0xedbf('0x34')][_0xedbf('0x38')]));_0x1a42fb[_0xedbf('0x37')]=_0x1a42fb['attributes'][_0xedbf('0x39')]?_0x1a42fb['attributes']:_0x5d8b7c[_0xedbf('0x33')];if(!_0x4be9b4['query']['hasOwnProperty'](_0xedbf('0x3a'))){_0x1a42fb['limit']=qs['limit'](_0x4be9b4[_0xedbf('0x34')][_0xedbf('0x1e')]);_0x1a42fb[_0xedbf('0x20')]=qs[_0xedbf('0x20')](_0x4be9b4[_0xedbf('0x34')][_0xedbf('0x20')]);}_0x1a42fb[_0xedbf('0x3b')]=qs['sort'](_0x4be9b4[_0xedbf('0x34')][_0xedbf('0x3c')]);_0x1a42fb[_0xedbf('0x3d')]=qs['filters'](_[_0xedbf('0x3e')](_0x4be9b4[_0xedbf('0x34')],_0x5d8b7c['filters']),_0x2ada3f);if(_0x4be9b4[_0xedbf('0x34')][_0xedbf('0x3f')]){_0x1a42fb[_0xedbf('0x3d')]=_[_0xedbf('0x40')](_0x1a42fb['where'],{'$or':_[_0xedbf('0x41')](_0x2ada3f,function(_0xa664ef){if(_0xa664ef[_0xedbf('0x32')]!==_0xedbf('0x42')){var _0x480928={};_0x480928[_0xa664ef[_0xedbf('0x2c')]]={'$like':'%'+_0x4be9b4[_0xedbf('0x34')][_0xedbf('0x3f')]+'%'};return _0x480928;}})});}_0x1a42fb=_[_0xedbf('0x40')]({},_0x1a42fb,_0x4be9b4[_0xedbf('0x43')]);var _0x99e7fb={'where':_0x1a42fb[_0xedbf('0x3d')]};return db[_0xedbf('0x2f')]['count'](_0x99e7fb)['then'](function(_0x80f179){_0x3ed681['count']=_0x80f179;if(_0x4be9b4[_0xedbf('0x34')][_0xedbf('0x44')]){_0x1a42fb['include']=[{'all':!![]}];}return db[_0xedbf('0x2f')][_0xedbf('0x45')](_0x1a42fb);})[_0xedbf('0x29')](function(_0x3c0e5c){_0x3ed681[_0xedbf('0x46')]=_0x3c0e5c;return _0x3ed681;})[_0xedbf('0x29')](respondWithFilteredResult(_0x44fcc0,_0x1a42fb))[_0xedbf('0x47')](handleError(_0x44fcc0,null));};exports[_0xedbf('0x48')]=function(_0x478d61,_0x8d643a){var _0x258a37={'raw':!![],'where':{'id':_0x478d61['params']['id']}},_0xd6ac87={};_0xd6ac87[_0xedbf('0x33')]=_['keys'](db['Disposition'][_0xedbf('0x30')]);_0xd6ac87[_0xedbf('0x34')]=_[_0xedbf('0x49')](_0x478d61[_0xedbf('0x34')]);_0xd6ac87['filters']=_[_0xedbf('0x36')](_0xd6ac87[_0xedbf('0x33')],_0xd6ac87[_0xedbf('0x34')]);_0x258a37[_0xedbf('0x37')]=_['intersection'](_0xd6ac87[_0xedbf('0x33')],qs['fields'](_0x478d61[_0xedbf('0x34')][_0xedbf('0x38')]));_0x258a37['attributes']=_0x258a37[_0xedbf('0x37')][_0xedbf('0x39')]?_0x258a37[_0xedbf('0x37')]:_0xd6ac87['model'];if(_0x478d61[_0xedbf('0x34')]['includeAll']){_0x258a37[_0xedbf('0x4a')]=[{'all':!![]}];}_0x258a37=_[_0xedbf('0x40')]({},_0x258a37,_0x478d61[_0xedbf('0x43')]);return db[_0xedbf('0x2f')][_0xedbf('0x4b')](_0x258a37)[_0xedbf('0x29')](handleEntityNotFound(_0x8d643a,null))[_0xedbf('0x29')](respondWithResult(_0x8d643a,null))[_0xedbf('0x47')](handleError(_0x8d643a,null));};exports[_0xedbf('0x4c')]=function(_0x3129a0,_0xe019df){return db[_0xedbf('0x2f')][_0xedbf('0x4c')](_0x3129a0[_0xedbf('0x4d')],{})[_0xedbf('0x29')](function(_0x37cac8){var _0x52cf4a=_0x3129a0[_0xedbf('0x4e')][_0xedbf('0x26')]({'plain':!![]});if(!_0x52cf4a)throw new Error(_0xedbf('0x4f'));if(_0x52cf4a[_0xedbf('0x50')]==='user'){var _0x196b45=_0x37cac8[_0xedbf('0x26')]({'plain':!![]});var _0x35885e=_0xedbf('0x27');return db['UserProfileSection'][_0xedbf('0x4b')]({'where':{'name':_0x35885e,'userProfileId':_0x52cf4a['userProfileId']},'raw':!![]})[_0xedbf('0x29')](function(_0x297c2b){if(_0x297c2b&&_0x297c2b[_0xedbf('0x51')]===0x0){return db[_0xedbf('0x52')][_0xedbf('0x4c')]({'name':_0x196b45[_0xedbf('0x2c')],'resourceId':_0x196b45['id'],'type':_0x297c2b[_0xedbf('0x2c')],'sectionId':_0x297c2b['id']},{})[_0xedbf('0x29')](function(){return _0x37cac8;});}else{return _0x37cac8;}})[_0xedbf('0x47')](function(_0x32650d){logger[_0xedbf('0x2a')](_0xedbf('0x53'),_0x32650d);throw _0x32650d;});}return _0x37cac8;})[_0xedbf('0x29')](respondWithResult(_0xe019df,0xc9))[_0xedbf('0x47')](handleError(_0xe019df,null));};exports[_0xedbf('0x54')]=function(_0xea4f34,_0x49d9f4){if(_0xea4f34['body']['id']){delete _0xea4f34['body']['id'];}return db[_0xedbf('0x2f')][_0xedbf('0x4b')]({'where':{'id':_0xea4f34[_0xedbf('0x55')]['id']}})[_0xedbf('0x29')](handleEntityNotFound(_0x49d9f4,null))[_0xedbf('0x29')](saveUpdates(_0xea4f34[_0xedbf('0x4d')],null))['then'](respondWithResult(_0x49d9f4,null))[_0xedbf('0x47')](handleError(_0x49d9f4,null));};exports['destroy']=function(_0x18d8e3,_0x5c6947){return db[_0xedbf('0x2f')][_0xedbf('0x4b')]({'where':{'id':_0x18d8e3[_0xedbf('0x55')]['id']}})[_0xedbf('0x29')](handleEntityNotFound(_0x5c6947,null))['then'](removeEntity(_0x5c6947,null))['catch'](handleError(_0x5c6947,null));}; \ No newline at end of file +var _0x8ba4=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','Disposition','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','length','nolimit','offset','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','attributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x748f0a,_0x4a5884){var _0x31929b=function(_0xac8200){while(--_0xac8200){_0x748f0a['push'](_0x748f0a['shift']());}};_0x31929b(++_0x4a5884);}(_0x8ba4,0x1ec));var _0x48ba=function(_0x134bfc,_0x144d5f){_0x134bfc=_0x134bfc-0x0;var _0x2f4dcc=_0x8ba4[_0x134bfc];return _0x2f4dcc;};'use strict';var emlformat=require(_0x48ba('0x0'));var rimraf=require(_0x48ba('0x1'));var zipdir=require(_0x48ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48ba('0x3'));var moment=require(_0x48ba('0x4'));var BPromise=require(_0x48ba('0x5'));var Mustache=require(_0x48ba('0x6'));var util=require(_0x48ba('0x7'));var path=require(_0x48ba('0x8'));var sox=require('sox');var csv=require(_0x48ba('0x9'));var ejs=require(_0x48ba('0xa'));var fs=require('fs');var fs_extra=require(_0x48ba('0xb'));var _=require(_0x48ba('0xc'));var squel=require(_0x48ba('0xd'));var crypto=require(_0x48ba('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x48ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x48ba('0x10'));var Papa=require(_0x48ba('0x11'));var Redis=require(_0x48ba('0x12'));var authService=require(_0x48ba('0x13'));var qs=require(_0x48ba('0x14'));var as=require(_0x48ba('0x15'));var hardwareService=require(_0x48ba('0x16'));var logger=require('../../config/logger')(_0x48ba('0x17'));var utils=require('../../config/utils');var config=require(_0x48ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x48ba('0x19'))['db'];function respondWithStatusCode(_0x145e9b,_0x13002c){_0x13002c=_0x13002c||0xcc;return function(_0x802aa6){if(_0x802aa6){return _0x145e9b['sendStatus'](_0x13002c);}return _0x145e9b[_0x48ba('0x1a')](_0x13002c)[_0x48ba('0x1b')]();};}function respondWithResult(_0x11420d,_0x40dfd8){_0x40dfd8=_0x40dfd8||0xc8;return function(_0x21c51c){if(_0x21c51c){return _0x11420d[_0x48ba('0x1a')](_0x40dfd8)[_0x48ba('0x1c')](_0x21c51c);}};}function respondWithFilteredResult(_0x359e9b,_0x14bf1c){return function(_0x1a6346){if(_0x1a6346){var _0x2cca2d=typeof _0x14bf1c['offset']===_0x48ba('0x1d')&&typeof _0x14bf1c[_0x48ba('0x1e')]===_0x48ba('0x1d');var _0x1b4185=_0x1a6346[_0x48ba('0x1f')];var _0x450633=_0x2cca2d?0x0:_0x14bf1c['offset'];var _0x1eef13=_0x2cca2d?_0x1a6346[_0x48ba('0x1f')]:_0x14bf1c['offset']+_0x14bf1c[_0x48ba('0x1e')];var _0x8013cc;if(_0x1eef13>=_0x1b4185){_0x1eef13=_0x1b4185;_0x8013cc=0xc8;}else{_0x8013cc=0xce;}_0x359e9b[_0x48ba('0x1a')](_0x8013cc);return _0x359e9b[_0x48ba('0x20')](_0x48ba('0x21'),_0x450633+'-'+_0x1eef13+'/'+_0x1b4185)[_0x48ba('0x1c')](_0x1a6346);}return null;};}function patchUpdates(_0x396a8f){return function(_0x4092ce){try{jsonpatch[_0x48ba('0x22')](_0x4092ce,_0x396a8f,!![]);}catch(_0x55af07){return BPromise['reject'](_0x55af07);}return _0x4092ce[_0x48ba('0x23')]();};}function saveUpdates(_0x42f1fa,_0x19ce1e){return function(_0x1f4472){if(_0x1f4472){return _0x1f4472[_0x48ba('0x24')](_0x42f1fa)[_0x48ba('0x25')](function(_0xf7ad86){return _0xf7ad86;});}return null;};}function removeEntity(_0x11bf67,_0x453c04){return function(_0x778ef4){if(_0x778ef4){return _0x778ef4['destroy']()[_0x48ba('0x25')](function(){var _0x274dfe=_0x778ef4[_0x48ba('0x26')]({'plain':!![]});var _0x2d384c='Dispositions';return db[_0x48ba('0x27')][_0x48ba('0x28')]({'where':{'type':_0x2d384c,'resourceId':_0x274dfe['id']}})[_0x48ba('0x25')](function(){return _0x778ef4;});})[_0x48ba('0x25')](function(){_0x11bf67[_0x48ba('0x1a')](0xcc)[_0x48ba('0x1b')]();});}};}function handleEntityNotFound(_0x4b967c,_0x59602f){return function(_0xe53cb3){if(!_0xe53cb3){_0x4b967c[_0x48ba('0x29')](0x194);}return _0xe53cb3;};}function handleError(_0x46d274,_0x1a469a){_0x1a469a=_0x1a469a||0x1f4;return function(_0x495e07){logger[_0x48ba('0x2a')](_0x495e07[_0x48ba('0x2b')]);if(_0x495e07[_0x48ba('0x2c')]){delete _0x495e07[_0x48ba('0x2c')];}_0x46d274[_0x48ba('0x1a')](_0x1a469a)[_0x48ba('0x2d')](_0x495e07);};}exports['index']=function(_0x4775c9,_0x2bc5ff){var _0x53490d={},_0x14a214={},_0x2be2ed={'count':0x0,'rows':[]};var _0x37d8a1=_['map'](db[_0x48ba('0x2e')][_0x48ba('0x2f')],function(_0x2735fa){return{'name':_0x2735fa[_0x48ba('0x30')],'type':_0x2735fa[_0x48ba('0x31')]['key']};});_0x14a214[_0x48ba('0x32')]=_[_0x48ba('0x33')](_0x37d8a1,_0x48ba('0x2c'));_0x14a214[_0x48ba('0x34')]=_[_0x48ba('0x35')](_0x4775c9[_0x48ba('0x34')]);_0x14a214[_0x48ba('0x36')]=_[_0x48ba('0x37')](_0x14a214[_0x48ba('0x32')],_0x14a214[_0x48ba('0x34')]);_0x53490d['attributes']=_[_0x48ba('0x37')](_0x14a214[_0x48ba('0x32')],qs['fields'](_0x4775c9[_0x48ba('0x34')][_0x48ba('0x38')]));_0x53490d['attributes']=_0x53490d['attributes'][_0x48ba('0x39')]?_0x53490d['attributes']:_0x14a214[_0x48ba('0x32')];if(!_0x4775c9['query']['hasOwnProperty'](_0x48ba('0x3a'))){_0x53490d[_0x48ba('0x1e')]=qs['limit'](_0x4775c9['query'][_0x48ba('0x1e')]);_0x53490d[_0x48ba('0x3b')]=qs[_0x48ba('0x3b')](_0x4775c9['query']['offset']);}_0x53490d[_0x48ba('0x3c')]=qs[_0x48ba('0x3d')](_0x4775c9[_0x48ba('0x34')]['sort']);_0x53490d[_0x48ba('0x3e')]=qs['filters'](_[_0x48ba('0x3f')](_0x4775c9[_0x48ba('0x34')],_0x14a214['filters']),_0x37d8a1);if(_0x4775c9['query']['filter']){_0x53490d[_0x48ba('0x3e')]=_[_0x48ba('0x40')](_0x53490d['where'],{'$or':_[_0x48ba('0x33')](_0x37d8a1,function(_0x2f343a){if(_0x2f343a[_0x48ba('0x31')]!=='VIRTUAL'){var _0x52c60e={};_0x52c60e[_0x2f343a['name']]={'$like':'%'+_0x4775c9[_0x48ba('0x34')]['filter']+'%'};return _0x52c60e;}})});}_0x53490d=_[_0x48ba('0x40')]({},_0x53490d,_0x4775c9[_0x48ba('0x41')]);var _0xf7f7f5={'where':_0x53490d[_0x48ba('0x3e')]};return db[_0x48ba('0x2e')][_0x48ba('0x1f')](_0xf7f7f5)[_0x48ba('0x25')](function(_0x5eb46a){_0x2be2ed['count']=_0x5eb46a;if(_0x4775c9[_0x48ba('0x34')][_0x48ba('0x42')]){_0x53490d['include']=[{'all':!![]}];}return db[_0x48ba('0x2e')][_0x48ba('0x43')](_0x53490d);})[_0x48ba('0x25')](function(_0x154d38){_0x2be2ed[_0x48ba('0x44')]=_0x154d38;return _0x2be2ed;})[_0x48ba('0x25')](respondWithFilteredResult(_0x2bc5ff,_0x53490d))[_0x48ba('0x45')](handleError(_0x2bc5ff,null));};exports[_0x48ba('0x46')]=function(_0x4b3625,_0x4e56aa){var _0xe37981={'raw':!![],'where':{'id':_0x4b3625['params']['id']}},_0x286f10={};_0x286f10[_0x48ba('0x32')]=_['keys'](db['Disposition'][_0x48ba('0x2f')]);_0x286f10[_0x48ba('0x34')]=_['keys'](_0x4b3625['query']);_0x286f10[_0x48ba('0x36')]=_[_0x48ba('0x37')](_0x286f10[_0x48ba('0x32')],_0x286f10[_0x48ba('0x34')]);_0xe37981[_0x48ba('0x47')]=_[_0x48ba('0x37')](_0x286f10[_0x48ba('0x32')],qs[_0x48ba('0x38')](_0x4b3625[_0x48ba('0x34')][_0x48ba('0x38')]));_0xe37981[_0x48ba('0x47')]=_0xe37981[_0x48ba('0x47')]['length']?_0xe37981[_0x48ba('0x47')]:_0x286f10['model'];if(_0x4b3625[_0x48ba('0x34')][_0x48ba('0x42')]){_0xe37981[_0x48ba('0x48')]=[{'all':!![]}];}_0xe37981=_[_0x48ba('0x40')]({},_0xe37981,_0x4b3625[_0x48ba('0x41')]);return db[_0x48ba('0x2e')]['find'](_0xe37981)['then'](handleEntityNotFound(_0x4e56aa,null))[_0x48ba('0x25')](respondWithResult(_0x4e56aa,null))[_0x48ba('0x45')](handleError(_0x4e56aa,null));};exports[_0x48ba('0x49')]=function(_0x5ba0b5,_0x5d542b){return db[_0x48ba('0x2e')][_0x48ba('0x49')](_0x5ba0b5[_0x48ba('0x4a')],{})[_0x48ba('0x25')](function(_0x2b4b3a){var _0x31ba26=_0x5ba0b5['user'][_0x48ba('0x26')]({'plain':!![]});if(!_0x31ba26)throw new Error(_0x48ba('0x4b'));if(_0x31ba26[_0x48ba('0x4c')]===_0x48ba('0x4d')){var _0x559d2f=_0x2b4b3a[_0x48ba('0x26')]({'plain':!![]});var _0x5bdade='Dispositions';return db[_0x48ba('0x4e')][_0x48ba('0x4f')]({'where':{'name':_0x5bdade,'userProfileId':_0x31ba26[_0x48ba('0x50')]},'raw':!![]})[_0x48ba('0x25')](function(_0x21e27f){if(_0x21e27f&&_0x21e27f[_0x48ba('0x51')]===0x0){return db['UserProfileResource'][_0x48ba('0x49')]({'name':_0x559d2f[_0x48ba('0x2c')],'resourceId':_0x559d2f['id'],'type':_0x21e27f[_0x48ba('0x2c')],'sectionId':_0x21e27f['id']},{})['then'](function(){return _0x2b4b3a;});}else{return _0x2b4b3a;}})[_0x48ba('0x45')](function(_0xaa4f){logger[_0x48ba('0x2a')](_0x48ba('0x52'),_0xaa4f);throw _0xaa4f;});}return _0x2b4b3a;})[_0x48ba('0x25')](respondWithResult(_0x5d542b,0xc9))[_0x48ba('0x45')](handleError(_0x5d542b,null));};exports[_0x48ba('0x24')]=function(_0x18e634,_0x18085c){if(_0x18e634[_0x48ba('0x4a')]['id']){delete _0x18e634[_0x48ba('0x4a')]['id'];}return db['Disposition']['find']({'where':{'id':_0x18e634['params']['id']}})[_0x48ba('0x25')](handleEntityNotFound(_0x18085c,null))[_0x48ba('0x25')](saveUpdates(_0x18e634[_0x48ba('0x4a')],null))[_0x48ba('0x25')](respondWithResult(_0x18085c,null))['catch'](handleError(_0x18085c,null));};exports[_0x48ba('0x28')]=function(_0x16af32,_0x429825){return db[_0x48ba('0x2e')]['find']({'where':{'id':_0x16af32[_0x48ba('0x53')]['id']}})[_0x48ba('0x25')](handleEntityNotFound(_0x429825,null))[_0x48ba('0x25')](removeEntity(_0x429825,null))['catch'](handleError(_0x429825,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cf529e2..c1775dd 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 _0xd9c4=['name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel'];(function(_0x5454ef,_0x4f6f17){var _0x2e4701=function(_0x471906){while(--_0x471906){_0x5454ef['push'](_0x5454ef['shift']());}};_0x2e4701(++_0x4f6f17);}(_0xd9c4,0x162));var _0x4d9c=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xd9c4[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x4d9c('0x0'));var util=require(_0x4d9c('0x1'));var logger=require(_0x4d9c('0x2'))(_0x4d9c('0x3'));var moment=require(_0x4d9c('0x4'));var BPromise=require(_0x4d9c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d9c('0x6'));var config=require('../../config/environment');var attributes=require(_0x4d9c('0x7'));module[_0x4d9c('0x8')]=function(_0x25d510,_0x244f71){return _0x25d510['define'](_0x4d9c('0x9'),attributes,{'tableName':_0x4d9c('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4d9c('0xb'),'fields':[_0x4d9c('0xc'),'ListId']},{'unique':!![],'name':_0x4d9c('0xd'),'fields':[_0x4d9c('0xc'),_0x4d9c('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0x4d9c('0xc'),_0x4d9c('0xf')]},{'unique':!![],'name':_0x4d9c('0x10'),'fields':[_0x4d9c('0xc'),_0x4d9c('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0x4d9c('0xc'),_0x4d9c('0x12')]},{'unique':!![],'name':_0x4d9c('0x13'),'fields':[_0x4d9c('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x4d9c('0x14'),'fields':[_0x4d9c('0xc'),_0x4d9c('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f37=['rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','MailAccountId','name_sms','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3f37,0x78));var _0x73f3=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x3f37[_0x491faa];return _0x414440;};'use strict';var _=require(_0x73f3('0x0'));var util=require('util');var logger=require(_0x73f3('0x1'))('api');var moment=require(_0x73f3('0x2'));var BPromise=require(_0x73f3('0x3'));var rp=require(_0x73f3('0x4'));var fs=require('fs');var path=require(_0x73f3('0x5'));var rimraf=require(_0x73f3('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x73f3('0x7')]=function(_0x3e1906,_0x40953f){return _0x3e1906[_0x73f3('0x8')](_0x73f3('0x9'),attributes,{'tableName':_0x73f3('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x73f3('0xb'),'fields':[_0x73f3('0xc'),_0x73f3('0xd')]},{'unique':!![],'name':_0x73f3('0xe'),'fields':[_0x73f3('0xc'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x73f3('0xc'),_0x73f3('0xf')]},{'unique':!![],'name':_0x73f3('0x10'),'fields':[_0x73f3('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x73f3('0x11'),'fields':[_0x73f3('0xc'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x73f3('0xc'),_0x73f3('0x12')]},{'unique':!![],'name':_0x73f3('0x13'),'fields':[_0x73f3('0xc'),_0x73f3('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 53f5eb7..e6930aa 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(_0x52855a,_0x20d943){var _0x52b4ca=function(_0x1ad094){while(--_0x1ad094){_0x52855a['push'](_0x52855a['shift']());}};_0x52b4ca(++_0x20d943);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x2ed3b0,_0x3b73aa){var _0x362ca0=function(_0x449446){while(--_0x449446){_0x2ed3b0['push'](_0x2ed3b0['shift']());}};_0x362ca0(++_0x3b73aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 d96a5ce..1705ad0 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 _0x11d1=['post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','show'];(function(_0x1c33fb,_0xfe64c4){var _0x708fc6=function(_0x4c1119){while(--_0x4c1119){_0x1c33fb['push'](_0x1c33fb['shift']());}};_0x708fc6(++_0xfe64c4);}(_0x11d1,0x184));var _0x111d=function(_0x166096,_0xebd666){_0x166096=_0x166096-0x0;var _0x88cba8=_0x11d1[_0x166096];return _0x88cba8;};'use strict';var multer=require(_0x111d('0x0'));var util=require('util');var path=require(_0x111d('0x1'));var timeout=require(_0x111d('0x2'));var express=require(_0x111d('0x3'));var router=express['Router']();var fs_extra=require(_0x111d('0x4'));var auth=require(_0x111d('0x5'));var interaction=require(_0x111d('0x6'));var config=require('../../config/environment');var controller=require(_0x111d('0x7'));router[_0x111d('0x8')]('/',auth[_0x111d('0x9')](),controller[_0x111d('0xa')]);router[_0x111d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x111d('0xb')]);router[_0x111d('0xc')]('/',auth['isAuthenticated'](),controller[_0x111d('0xd')]);router[_0x111d('0xe')]('/:id',auth[_0x111d('0x9')](),controller[_0x111d('0xf')]);router[_0x111d('0x10')](_0x111d('0x11'),auth[_0x111d('0x9')](),controller[_0x111d('0x12')]);module[_0x111d('0x13')]=router; \ No newline at end of file +var _0xb14a=['./disposition.controller','get','isAuthenticated','/:id','post','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2f4767,_0x4f317b){var _0x3d8aae=function(_0xa3ebf0){while(--_0xa3ebf0){_0x2f4767['push'](_0x2f4767['shift']());}};_0x3d8aae(++_0x4f317b);}(_0xb14a,0x69));var _0xab14=function(_0x288e4e,_0x20e652){_0x288e4e=_0x288e4e-0x0;var _0x48a60c=_0xb14a[_0x288e4e];return _0x48a60c;};'use strict';var multer=require(_0xab14('0x0'));var util=require(_0xab14('0x1'));var path=require(_0xab14('0x2'));var timeout=require('connect-timeout');var express=require(_0xab14('0x3'));var router=express[_0xab14('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xab14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab14('0x6'));var controller=require(_0xab14('0x7'));router[_0xab14('0x8')]('/',auth[_0xab14('0x9')](),controller['index']);router[_0xab14('0x8')](_0xab14('0xa'),auth[_0xab14('0x9')](),controller['show']);router[_0xab14('0xb')]('/',auth[_0xab14('0x9')](),controller['create']);router[_0xab14('0xc')]('/:id',auth[_0xab14('0x9')](),controller[_0xab14('0xd')]);router[_0xab14('0xe')](_0xab14('0xa'),auth[_0xab14('0x9')](),controller['destroy']);module[_0xab14('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index c0aacb7..fb7a613 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 _0x07e8=['yes','localstationid','4800','7200','9600','12000','14400','2400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM'];(function(_0x2c94c7,_0x5557a8){var _0x16322f=function(_0x5ab1b8){while(--_0x5ab1b8){_0x2c94c7['push'](_0x2c94c7['shift']());}};_0x16322f(++_0x5557a8);}(_0x07e8,0x10f));var _0x807e=function(_0x5964d6,_0x1c7a0f){_0x5964d6=_0x5964d6-0x0;var _0x1e27c8=_0x07e8[_0x5964d6];return _0x1e27c8;};'use strict';var Sequelize=require(_0x807e('0x0'));module[_0x807e('0x1')]={'name':{'type':Sequelize[_0x807e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x807e('0x3')]('yes','no'),'defaultValue':_0x807e('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x807e('0x2')],'unique':_0x807e('0x5')},'minrate':{'type':Sequelize[_0x807e('0x3')]('2400',_0x807e('0x6'),_0x807e('0x7'),_0x807e('0x8'),_0x807e('0x9'),_0x807e('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x807e('0x3')](_0x807e('0xb'),_0x807e('0x6'),_0x807e('0x7'),_0x807e('0x8'),_0x807e('0x9'),_0x807e('0xa')),'defaultValue':_0x807e('0xa')},'modem':{'type':Sequelize[_0x807e('0x2')],'defaultValue':_0x807e('0xc')},'gateway':{'type':Sequelize[_0x807e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x807e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x807e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x807e('0x3')]('SIP',_0x807e('0xe'),_0x807e('0xf'),_0x807e('0x10')),'defaultValue':_0x807e('0x11')},'key':{'type':Sequelize[_0x807e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x807e('0x12')],'defaultValue':function(){return _0x807e('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x807e('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x807e('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x807e('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x807e('0x14')],'defaultValue':![],'comment':_0x807e('0x16'),'set':function(_0x454bd3){if(!_0x454bd3)this['setDataValue'](_0x807e('0x17'),null);this['setDataValue'](_0x807e('0x18'),_0x454bd3);}}}; \ No newline at end of file +var _0x0adf=['KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400','4800','v17,v27,v29','INTEGER','SIP','IAX'];(function(_0xa41047,_0x333992){var _0x7d80ce=function(_0x3886ad){while(--_0x3886ad){_0xa41047['push'](_0xa41047['shift']());}};_0x7d80ce(++_0x333992);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x9ffc13,_0x285220){_0x9ffc13=_0x9ffc13-0x0;var _0x49acae=_0x0adf[_0x9ffc13];return _0x49acae;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xf0ad('0x3')](_0xf0ad('0x4'),'no'),'defaultValue':_0xf0ad('0x4')},'headerinfo':{'type':Sequelize[_0xf0ad('0x2')],'defaultValue':_0xf0ad('0x5')},'localstationid':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x6')},'minrate':{'type':Sequelize['ENUM'](_0xf0ad('0x7'),'4800',_0xf0ad('0x8'),_0xf0ad('0x9'),_0xf0ad('0xa'),_0xf0ad('0xb')),'defaultValue':_0xf0ad('0xc')},'maxrate':{'type':Sequelize[_0xf0ad('0x3')](_0xf0ad('0x7'),'4800',_0xf0ad('0x8'),'9600',_0xf0ad('0xa'),_0xf0ad('0xb')),'defaultValue':_0xf0ad('0xb')},'modem':{'type':Sequelize[_0xf0ad('0x2')],'defaultValue':_0xf0ad('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf0ad('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf0ad('0x3')](_0xf0ad('0xf'),_0xf0ad('0x10'),'DADHI',_0xf0ad('0x11')),'defaultValue':_0xf0ad('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf0ad('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf0ad('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf0ad('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf0ad('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xf0ad('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':![],'comment':_0xf0ad('0x14'),'set':function(_0x47fa2b){if(!_0x47fa2b)this['setDataValue'](_0xf0ad('0x15'),null);this[_0xf0ad('0x16')]('mandatoryDisposition',_0x47fa2b);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 21a9732..d9fc065 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 _0xb65f=['attributes','length','hasOwnProperty','nolimit','order','where','merge','filter','includeAll','include','findAll','rows','catch','show','mandatoryDispositionPause','options','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','create','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','sort','removeDispositions','ids','addAnswer','findOne','CannedAnswer','pick','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','ReceiveFax','addAccountApplications','VoiceExtension','key','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','./faxAccount.socket','register','client','http','request','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','status','offset','undefined','limit','count','json','apply','save','update','then','FaxAccounts','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x35c5c2,_0x3ce27c){var _0x2ea1dc=function(_0x5e9c0e){while(--_0x5e9c0e){_0x35c5c2['push'](_0x35c5c2['shift']());}};_0x2ea1dc(++_0x3ce27c);}(_0xb65f,0x7e));var _0xfb65=function(_0x597e05,_0x10c7b9){_0x597e05=_0x597e05-0x0;var _0x2283b5=_0xb65f[_0x597e05];return _0x2283b5;};'use strict';var emlformat=require(_0xfb65('0x0'));var rimraf=require(_0xfb65('0x1'));var zipdir=require(_0xfb65('0x2'));var jsonpatch=require(_0xfb65('0x3'));var rp=require(_0xfb65('0x4'));var moment=require(_0xfb65('0x5'));var BPromise=require(_0xfb65('0x6'));var Mustache=require(_0xfb65('0x7'));var util=require(_0xfb65('0x8'));var path=require(_0xfb65('0x9'));var sox=require(_0xfb65('0xa'));var csv=require(_0xfb65('0xb'));var ejs=require(_0xfb65('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb65('0xd'));var squel=require(_0xfb65('0xe'));var crypto=require(_0xfb65('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xfb65('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfb65('0x11'));var Papa=require(_0xfb65('0x12'));var Redis=require('ioredis');var authService=require(_0xfb65('0x13'));var qs=require(_0xfb65('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb65('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xfb65('0x16'));var config=require(_0xfb65('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfb65('0x18')]=_[_0xfb65('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb65('0x18')]));require(_0xfb65('0x1a'))[_0xfb65('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfb65('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0xfb65('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2cdcb3,_0x3726ed,_0xdbb55b,_0x2cae77){return new BPromise(function(_0x24d533,_0x191ee3){var _0x2985d9=_0x2cae77||client;return _0x2985d9[_0xfb65('0x1e')](_0x2cdcb3,_0xdbb55b)['then'](function(_0x1736d4){logger['info'](_0xfb65('0x1f'),_0x3726ed,'request\x20sent');logger[_0xfb65('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3726ed,_0xfb65('0x21'),JSON[_0xfb65('0x22')](_0x1736d4));if(_0x1736d4[_0xfb65('0x23')]){if(_0x1736d4['error']['code']===0x1f4){logger[_0xfb65('0x23')](_0xfb65('0x1f'),_0x3726ed,_0x1736d4[_0xfb65('0x23')][_0xfb65('0x24')]);return _0x191ee3(_0x1736d4['error'][_0xfb65('0x24')]);}logger['error'](_0xfb65('0x1f'),_0x3726ed,_0x1736d4['error'][_0xfb65('0x24')]);return _0x24d533(_0x1736d4['error'][_0xfb65('0x24')]);}else{logger[_0xfb65('0x25')]('FaxAccount,\x20%s,\x20%s',_0x3726ed,'request\x20sent');_0x24d533(_0x1736d4[_0xfb65('0x26')][_0xfb65('0x24')]);}})['catch'](function(_0x1d6298){logger['error'](_0xfb65('0x1f'),_0x3726ed,_0x1d6298);_0x191ee3(_0x1d6298);});});}function respondWithStatusCode(_0x40dfd0,_0x6c5f05){_0x6c5f05=_0x6c5f05||0xcc;return function(_0x7df81e){if(_0x7df81e){return _0x40dfd0['sendStatus'](_0x6c5f05);}return _0x40dfd0['status'](_0x6c5f05)['end']();};}function respondWithResult(_0x47e377,_0x4941ec){_0x4941ec=_0x4941ec||0xc8;return function(_0x2de808){if(_0x2de808){return _0x47e377[_0xfb65('0x27')](_0x4941ec)['json'](_0x2de808);}};}function respondWithFilteredResult(_0x57600e,_0x2a30f3){return function(_0x59d93a){if(_0x59d93a){var _0x164ecf=typeof _0x2a30f3[_0xfb65('0x28')]===_0xfb65('0x29')&&typeof _0x2a30f3[_0xfb65('0x2a')]===_0xfb65('0x29');var _0x13344f=_0x59d93a[_0xfb65('0x2b')];var _0x96f34a=_0x164ecf?0x0:_0x2a30f3[_0xfb65('0x28')];var _0x2e811b=_0x164ecf?_0x59d93a[_0xfb65('0x2b')]:_0x2a30f3['offset']+_0x2a30f3['limit'];var _0x52fdcf;if(_0x2e811b>=_0x13344f){_0x2e811b=_0x13344f;_0x52fdcf=0xc8;}else{_0x52fdcf=0xce;}_0x57600e['status'](_0x52fdcf);return _0x57600e['set']('Content-Range',_0x96f34a+'-'+_0x2e811b+'/'+_0x13344f)[_0xfb65('0x2c')](_0x59d93a);}return null;};}function patchUpdates(_0x3f2fe3){return function(_0x32fa25){try{jsonpatch[_0xfb65('0x2d')](_0x32fa25,_0x3f2fe3,!![]);}catch(_0xd9acac){return BPromise['reject'](_0xd9acac);}return _0x32fa25[_0xfb65('0x2e')]();};}function saveUpdates(_0x3608fe,_0x21de13){return function(_0x3c6dc5){if(_0x3c6dc5){return _0x3c6dc5[_0xfb65('0x2f')](_0x3608fe)[_0xfb65('0x30')](function(_0x4c342f){return _0x4c342f;});}return null;};}function removeEntity(_0x258f3c,_0x40c814){return function(_0x5cc5f2){if(_0x5cc5f2){return _0x5cc5f2['destroy']()[_0xfb65('0x30')](function(){var _0x212ad7=_0x5cc5f2['get']({'plain':!![]});var _0xec7162=_0xfb65('0x31');return db[_0xfb65('0x32')][_0xfb65('0x33')]({'where':{'type':_0xec7162,'resourceId':_0x212ad7['id']}})[_0xfb65('0x30')](function(){return _0x5cc5f2;});})[_0xfb65('0x30')](function(){_0x258f3c['status'](0xcc)[_0xfb65('0x34')]();});}};}function handleEntityNotFound(_0x79dcb5,_0x170f29){return function(_0x3713e6){if(!_0x3713e6){_0x79dcb5[_0xfb65('0x35')](0x194);}return _0x3713e6;};}function handleError(_0x32f44c,_0x27b0b1){_0x27b0b1=_0x27b0b1||0x1f4;return function(_0x38cfee){logger[_0xfb65('0x23')](_0x38cfee[_0xfb65('0x36')]);if(_0x38cfee[_0xfb65('0x37')]){delete _0x38cfee['name'];}_0x32f44c[_0xfb65('0x27')](_0x27b0b1)[_0xfb65('0x38')](_0x38cfee);};}exports[_0xfb65('0x39')]=function(_0x5f299a,_0x54e93f){var _0x277390={'include':[{'model':db[_0xfb65('0x3a')],'as':'mandatoryDispositionPause'}]},_0x4da42b={},_0x429cb2={'count':0x0,'rows':[]};var _0x1ceb73=_[_0xfb65('0x3b')](db[_0xfb65('0x3c')][_0xfb65('0x3d')],function(_0x370169){return{'name':_0x370169[_0xfb65('0x3e')],'type':_0x370169[_0xfb65('0x3f')]['key']};});_0x4da42b[_0xfb65('0x40')]=_[_0xfb65('0x3b')](_0x1ceb73,_0xfb65('0x37'));_0x4da42b[_0xfb65('0x41')]=_[_0xfb65('0x42')](_0x5f299a[_0xfb65('0x41')]);_0x4da42b[_0xfb65('0x43')]=_['intersection'](_0x4da42b[_0xfb65('0x40')],_0x4da42b[_0xfb65('0x41')]);_0x277390['attributes']=_[_0xfb65('0x44')](_0x4da42b[_0xfb65('0x40')],qs[_0xfb65('0x45')](_0x5f299a[_0xfb65('0x41')]['fields']));_0x277390['attributes']=_0x277390[_0xfb65('0x46')][_0xfb65('0x47')]?_0x277390['attributes']:_0x4da42b['model'];if(!_0x5f299a[_0xfb65('0x41')][_0xfb65('0x48')](_0xfb65('0x49'))){_0x277390[_0xfb65('0x2a')]=qs[_0xfb65('0x2a')](_0x5f299a[_0xfb65('0x41')][_0xfb65('0x2a')]);_0x277390['offset']=qs[_0xfb65('0x28')](_0x5f299a[_0xfb65('0x41')]['offset']);}_0x277390[_0xfb65('0x4a')]=qs['sort'](_0x5f299a[_0xfb65('0x41')]['sort']);_0x277390[_0xfb65('0x4b')]=qs['filters'](_['pick'](_0x5f299a['query'],_0x4da42b[_0xfb65('0x43')]),_0x1ceb73);if(_0x5f299a[_0xfb65('0x41')]['filter']){_0x277390[_0xfb65('0x4b')]=_[_0xfb65('0x4c')](_0x277390['where'],{'$or':_[_0xfb65('0x3b')](_0x1ceb73,function(_0x4c74d9){if(_0x4c74d9[_0xfb65('0x3f')]!=='VIRTUAL'){var _0xb0f164={};_0xb0f164[_0x4c74d9['name']]={'$like':'%'+_0x5f299a['query'][_0xfb65('0x4d')]+'%'};return _0xb0f164;}})});}_0x277390=_[_0xfb65('0x4c')]({},_0x277390,_0x5f299a['options']);var _0x2bcfd3={'where':_0x277390[_0xfb65('0x4b')]};return db[_0xfb65('0x3c')]['count'](_0x2bcfd3)[_0xfb65('0x30')](function(_0x52f15d){_0x429cb2[_0xfb65('0x2b')]=_0x52f15d;if(_0x5f299a[_0xfb65('0x41')][_0xfb65('0x4e')]){_0x277390[_0xfb65('0x4f')]=[{'all':!![]}];}return db['FaxAccount'][_0xfb65('0x50')](_0x277390);})[_0xfb65('0x30')](function(_0x19b593){_0x429cb2[_0xfb65('0x51')]=_0x19b593;return _0x429cb2;})[_0xfb65('0x30')](respondWithFilteredResult(_0x54e93f,_0x277390))[_0xfb65('0x52')](handleError(_0x54e93f,null));};exports[_0xfb65('0x53')]=function(_0x1bf006,_0x5df2b5){var _0x2af67c={'raw':![],'where':{'id':_0x1bf006['params']['id']},'include':[{'model':db[_0xfb65('0x3a')],'as':_0xfb65('0x54')}]},_0x521036={};_0x521036['model']=_['keys'](db[_0xfb65('0x3c')][_0xfb65('0x3d')]);_0x521036[_0xfb65('0x41')]=_[_0xfb65('0x42')](_0x1bf006['query']);_0x521036[_0xfb65('0x43')]=_[_0xfb65('0x44')](_0x521036[_0xfb65('0x40')],_0x521036[_0xfb65('0x41')]);_0x2af67c[_0xfb65('0x46')]=_['intersection'](_0x521036[_0xfb65('0x40')],qs['fields'](_0x1bf006['query']['fields']));_0x2af67c[_0xfb65('0x46')]=_0x2af67c['attributes']['length']?_0x2af67c[_0xfb65('0x46')]:_0x521036['model'];if(_0x1bf006[_0xfb65('0x41')][_0xfb65('0x4e')]){_0x2af67c['include']=[{'all':!![]}];}_0x2af67c=_[_0xfb65('0x4c')]({},_0x2af67c,_0x1bf006[_0xfb65('0x55')]);return db['FaxAccount']['find'](_0x2af67c)[_0xfb65('0x30')](handleEntityNotFound(_0x5df2b5,null))[_0xfb65('0x30')](respondWithResult(_0x5df2b5,null))[_0xfb65('0x52')](handleError(_0x5df2b5,null));};exports['create']=function(_0x5779b0,_0x5dcf24){return db['FaxAccount']['create'](_0x5779b0[_0xfb65('0x56')],{})[_0xfb65('0x30')](function(_0x59f810){var _0x48749b=_0x5779b0['user'][_0xfb65('0x57')]({'plain':!![]});if(!_0x48749b)throw new Error(_0xfb65('0x58'));if(_0x48749b[_0xfb65('0x59')]===_0xfb65('0x5a')){var _0x5e1e86=_0x59f810[_0xfb65('0x57')]({'plain':!![]});var _0x2305e2='FaxAccounts';return db[_0xfb65('0x5b')][_0xfb65('0x5c')]({'where':{'name':_0x2305e2,'userProfileId':_0x48749b[_0xfb65('0x5d')]},'raw':!![]})['then'](function(_0xb98c8a){if(_0xb98c8a&&_0xb98c8a[_0xfb65('0x5e')]===0x0){return db[_0xfb65('0x32')][_0xfb65('0x5f')]({'name':_0x5e1e86['name'],'resourceId':_0x5e1e86['id'],'type':_0xb98c8a[_0xfb65('0x37')],'sectionId':_0xb98c8a['id']},{})[_0xfb65('0x30')](function(){return _0x59f810;});}else{return _0x59f810;}})[_0xfb65('0x52')](function(_0x2f3580){logger[_0xfb65('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f3580);throw _0x2f3580;});}return _0x59f810;})[_0xfb65('0x30')](respondWithResult(_0x5dcf24,0xc9))['catch'](handleError(_0x5dcf24,null));};exports[_0xfb65('0x2f')]=function(_0x5a63d8,_0x4cd833){if(_0x5a63d8[_0xfb65('0x56')]['id']){delete _0x5a63d8[_0xfb65('0x56')]['id'];}return db['FaxAccount'][_0xfb65('0x5c')]({'where':{'id':_0x5a63d8['params']['id']},'include':[{'model':db[_0xfb65('0x3a')],'as':_0xfb65('0x54')}]})[_0xfb65('0x30')](handleEntityNotFound(_0x4cd833,null))[_0xfb65('0x30')](saveUpdates(_0x5a63d8[_0xfb65('0x56')],null))[_0xfb65('0x30')](respondWithResult(_0x4cd833,null))[_0xfb65('0x52')](handleError(_0x4cd833,null));};exports['destroy']=function(_0x4cbe91,_0x55f837){return db[_0xfb65('0x3c')][_0xfb65('0x5c')]({'where':{'id':_0x4cbe91[_0xfb65('0x60')]['id']}})['then'](handleEntityNotFound(_0x55f837,null))[_0xfb65('0x30')](removeEntity(_0x55f837,null))[_0xfb65('0x52')](handleError(_0x55f837,null));};exports[_0xfb65('0x61')]=function(_0x3e8464,_0xcd2469){return db['FaxAccount'][_0xfb65('0x61')]()[_0xfb65('0x30')](respondWithResult(_0xcd2469,null))[_0xfb65('0x52')](handleError(_0xcd2469,null));};exports[_0xfb65('0x62')]=function(_0x228b4a,_0xa6ca4c,_0x4bec2a){if(_0x228b4a[_0xfb65('0x56')]['id']){delete _0x228b4a[_0xfb65('0x56')]['id'];}return db[_0xfb65('0x3c')][_0xfb65('0x5c')]({'where':{'id':_0x228b4a['params']['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0xa6ca4c,null))[_0xfb65('0x30')](function(_0x34de1a){if(_0x34de1a){_0x228b4a['body'][_0xfb65('0x63')]=_0x34de1a['id'];return db[_0xfb65('0x64')][_0xfb65('0x5f')](_0x228b4a['body']);}})[_0xfb65('0x30')](respondWithResult(_0xa6ca4c,null))[_0xfb65('0x52')](handleError(_0xa6ca4c,null));};exports[_0xfb65('0x65')]=function(_0x2b2836,_0xac8dd3,_0x467d6d){var _0x1b5cdd={'raw':![],'where':{}};var _0x19ae79={};var _0x2f1924={'count':0x0,'rows':[]};return db[_0xfb65('0x3c')]['findOne']({'where':{'id':_0x2b2836[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0xac8dd3,null))[_0xfb65('0x30')](function(_0x4bef8f){if(_0x4bef8f){_0x19ae79[_0xfb65('0x40')]=_[_0xfb65('0x42')](db['Disposition']['rawAttributes']);_0x19ae79['query']=_[_0xfb65('0x42')](_0x2b2836[_0xfb65('0x41')]);_0x19ae79[_0xfb65('0x43')]=_[_0xfb65('0x44')](_0x19ae79['model'],_0x19ae79[_0xfb65('0x41')]);_0x1b5cdd[_0xfb65('0x46')]=_['intersection'](_0x19ae79[_0xfb65('0x40')],qs['fields'](_0x2b2836[_0xfb65('0x41')][_0xfb65('0x45')]));_0x1b5cdd[_0xfb65('0x46')]=_0x1b5cdd['attributes'][_0xfb65('0x47')]?_0x1b5cdd[_0xfb65('0x46')]:_0x19ae79[_0xfb65('0x40')];if(!_0x2b2836[_0xfb65('0x41')][_0xfb65('0x48')](_0xfb65('0x49'))){_0x1b5cdd[_0xfb65('0x2a')]=qs['limit'](_0x2b2836[_0xfb65('0x41')]['limit']);_0x1b5cdd[_0xfb65('0x28')]=qs['offset'](_0x2b2836[_0xfb65('0x41')]['offset']);}_0x1b5cdd[_0xfb65('0x4a')]=qs[_0xfb65('0x66')](_0x2b2836[_0xfb65('0x41')]['sort']);_0x1b5cdd[_0xfb65('0x4b')]=qs[_0xfb65('0x43')](_['pick'](_0x2b2836[_0xfb65('0x41')],_0x19ae79['filters']));_0x1b5cdd[_0xfb65('0x4b')][_0xfb65('0x63')]=_0x4bef8f['id'];if(_0x2b2836[_0xfb65('0x41')][_0xfb65('0x4d')]){_0x1b5cdd['where']=_[_0xfb65('0x4c')](_0x1b5cdd[_0xfb65('0x4b')],{'$or':_[_0xfb65('0x3b')](_0x1b5cdd[_0xfb65('0x46')],function(_0x2465c4){var _0x251c19={};_0x251c19[_0x2465c4]={'$like':'%'+_0x2b2836[_0xfb65('0x41')][_0xfb65('0x4d')]+'%'};return _0x251c19;})});}_0x1b5cdd=_[_0xfb65('0x4c')]({},_0x1b5cdd,_0x2b2836[_0xfb65('0x55')]);return db[_0xfb65('0x64')][_0xfb65('0x2b')]({'where':_0x1b5cdd[_0xfb65('0x4b')]})[_0xfb65('0x30')](function(_0x5d8de1){_0x2f1924[_0xfb65('0x2b')]=_0x5d8de1;if(_0x2b2836[_0xfb65('0x41')]['includeAll']){_0x1b5cdd[_0xfb65('0x4f')]=[{'all':!![]}];}return db[_0xfb65('0x64')][_0xfb65('0x50')](_0x1b5cdd);})[_0xfb65('0x30')](function(_0x171459){_0x2f1924[_0xfb65('0x51')]=_0x171459;return _0x2f1924;});}})['then'](respondWithFilteredResult(_0xac8dd3,_0x1b5cdd))[_0xfb65('0x52')](handleError(_0xac8dd3,null));};exports[_0xfb65('0x67')]=function(_0x4a4cbb,_0x31138a,_0x188086){return db[_0xfb65('0x3c')][_0xfb65('0x5c')]({'where':{'id':_0x4a4cbb[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x31138a,null))[_0xfb65('0x30')](function(_0x2c4547){if(_0x2c4547){return _0x2c4547['removeDispositions'](_0x4a4cbb['query'][_0xfb65('0x68')]);}})[_0xfb65('0x30')](respondWithStatusCode(_0x31138a,null))[_0xfb65('0x52')](handleError(_0x31138a,null));};exports[_0xfb65('0x69')]=function(_0x490d9d,_0x156d6a,_0xa287cd){if(_0x490d9d['body']['id']){delete _0x490d9d['body']['id'];}return db[_0xfb65('0x3c')][_0xfb65('0x5c')]({'where':{'id':_0x490d9d[_0xfb65('0x60')]['id']}})['then'](handleEntityNotFound(_0x156d6a,null))[_0xfb65('0x30')](function(_0x54d3f1){if(_0x54d3f1){_0x490d9d['body']['FaxAccountId']=_0x54d3f1['id'];return db['CannedAnswer'][_0xfb65('0x5f')](_0x490d9d[_0xfb65('0x56')]);}})['then'](respondWithResult(_0x156d6a,null))[_0xfb65('0x52')](handleError(_0x156d6a,null));};exports['getAnswers']=function(_0x495212,_0x214231,_0x2f1265){var _0xb5ae7c={'raw':![],'where':{}};var _0x5a239a={};var _0x3dcd1c={'count':0x0,'rows':[]};return db['FaxAccount'][_0xfb65('0x6a')]({'where':{'id':_0x495212[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x214231,null))[_0xfb65('0x30')](function(_0x400868){if(_0x400868){_0x5a239a[_0xfb65('0x40')]=_['keys'](db[_0xfb65('0x6b')]['rawAttributes']);_0x5a239a[_0xfb65('0x41')]=_[_0xfb65('0x42')](_0x495212[_0xfb65('0x41')]);_0x5a239a[_0xfb65('0x43')]=_[_0xfb65('0x44')](_0x5a239a['model'],_0x5a239a[_0xfb65('0x41')]);_0xb5ae7c[_0xfb65('0x46')]=_['intersection'](_0x5a239a[_0xfb65('0x40')],qs[_0xfb65('0x45')](_0x495212[_0xfb65('0x41')][_0xfb65('0x45')]));_0xb5ae7c[_0xfb65('0x46')]=_0xb5ae7c[_0xfb65('0x46')][_0xfb65('0x47')]?_0xb5ae7c[_0xfb65('0x46')]:_0x5a239a[_0xfb65('0x40')];if(!_0x495212['query'][_0xfb65('0x48')](_0xfb65('0x49'))){_0xb5ae7c[_0xfb65('0x2a')]=qs[_0xfb65('0x2a')](_0x495212[_0xfb65('0x41')][_0xfb65('0x2a')]);_0xb5ae7c[_0xfb65('0x28')]=qs['offset'](_0x495212[_0xfb65('0x41')][_0xfb65('0x28')]);}_0xb5ae7c[_0xfb65('0x4a')]=qs[_0xfb65('0x66')](_0x495212[_0xfb65('0x41')][_0xfb65('0x66')]);_0xb5ae7c[_0xfb65('0x4b')]=qs['filters'](_[_0xfb65('0x6c')](_0x495212[_0xfb65('0x41')],_0x5a239a[_0xfb65('0x43')]));_0xb5ae7c['where'][_0xfb65('0x63')]=_0x400868['id'];if(_0x495212['query']['filter']){_0xb5ae7c[_0xfb65('0x4b')]=_[_0xfb65('0x4c')](_0xb5ae7c['where'],{'$or':_[_0xfb65('0x3b')](_0xb5ae7c[_0xfb65('0x46')],function(_0x2f3176){var _0x571617={};_0x571617[_0x2f3176]={'$like':'%'+_0x495212[_0xfb65('0x41')][_0xfb65('0x4d')]+'%'};return _0x571617;})});}_0xb5ae7c=_['merge']({},_0xb5ae7c,_0x495212[_0xfb65('0x55')]);return db[_0xfb65('0x6b')][_0xfb65('0x2b')]({'where':_0xb5ae7c['where']})[_0xfb65('0x30')](function(_0x82e8ac){_0x3dcd1c[_0xfb65('0x2b')]=_0x82e8ac;if(_0x495212[_0xfb65('0x41')][_0xfb65('0x4e')]){_0xb5ae7c[_0xfb65('0x4f')]=[{'all':!![]}];}return db[_0xfb65('0x6b')][_0xfb65('0x50')](_0xb5ae7c);})[_0xfb65('0x30')](function(_0x39e44a){_0x3dcd1c[_0xfb65('0x51')]=_0x39e44a;return _0x3dcd1c;});}})[_0xfb65('0x30')](respondWithFilteredResult(_0x214231,_0xb5ae7c))[_0xfb65('0x52')](handleError(_0x214231,null));};exports[_0xfb65('0x6d')]=function(_0x222f6b,_0x5eac37,_0xf5bca1){return db[_0xfb65('0x3c')]['find']({'where':{'id':_0x222f6b[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x5eac37,null))[_0xfb65('0x30')](function(_0xd5f8d8){if(_0xd5f8d8){return _0xd5f8d8[_0xfb65('0x6d')](_0x222f6b[_0xfb65('0x41')][_0xfb65('0x68')]);}})[_0xfb65('0x30')](respondWithStatusCode(_0x5eac37,null))['catch'](handleError(_0x5eac37,null));};exports[_0xfb65('0x6e')]=function(_0x22291b,_0x2f03f1,_0x46d300){return db[_0xfb65('0x6f')]['find']({'where':{'id':_0x22291b[_0xfb65('0x60')]['id']}})['then'](handleEntityNotFound(_0x2f03f1,null))[_0xfb65('0x30')](function(_0x1e6c63){if(_0x1e6c63){return _0x1e6c63['addInteraction'](_0x22291b[_0xfb65('0x56')][_0xfb65('0x68')],_['omit'](_0x22291b[_0xfb65('0x56')],['ids','id'])||{});}})[_0xfb65('0x30')](respondWithResult(_0x2f03f1,null))[_0xfb65('0x52')](handleError(_0x2f03f1,null));};exports[_0xfb65('0x70')]=function(_0x176b9,_0x382043,_0x3280e1){var _0x5dd802={'raw':![],'where':{}};var _0x2fddad={};var _0x6ccb93={'count':0x0,'rows':[]};return db[_0xfb65('0x3c')][_0xfb65('0x6a')]({'where':{'id':_0x176b9[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x382043,null))[_0xfb65('0x30')](function(_0x32304e){if(_0x32304e){_0x2fddad[_0xfb65('0x40')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x2fddad[_0xfb65('0x41')]=_[_0xfb65('0x42')](_0x176b9[_0xfb65('0x41')]);_0x2fddad[_0xfb65('0x43')]=_['intersection'](_0x2fddad['model'],_0x2fddad['query']);_0x5dd802[_0xfb65('0x46')]=_[_0xfb65('0x44')](_0x2fddad[_0xfb65('0x40')],qs[_0xfb65('0x45')](_0x176b9['query'][_0xfb65('0x45')]));_0x5dd802[_0xfb65('0x46')]=_0x5dd802[_0xfb65('0x46')][_0xfb65('0x47')]?_0x5dd802[_0xfb65('0x46')]:_0x2fddad[_0xfb65('0x40')];if(!_0x176b9[_0xfb65('0x41')][_0xfb65('0x48')](_0xfb65('0x49'))){_0x5dd802[_0xfb65('0x2a')]=qs[_0xfb65('0x2a')](_0x176b9[_0xfb65('0x41')][_0xfb65('0x2a')]);_0x5dd802[_0xfb65('0x28')]=qs[_0xfb65('0x28')](_0x176b9['query'][_0xfb65('0x28')]);}_0x5dd802['order']=qs[_0xfb65('0x66')](_0x176b9[_0xfb65('0x41')]['sort']);_0x5dd802[_0xfb65('0x4b')]=qs['filters'](_[_0xfb65('0x6c')](_0x176b9[_0xfb65('0x41')],_0x2fddad[_0xfb65('0x43')]));_0x5dd802[_0xfb65('0x4b')][_0xfb65('0x63')]=_0x32304e['id'];if(_0x176b9[_0xfb65('0x41')][_0xfb65('0x4d')]){_0x5dd802[_0xfb65('0x4b')]=_[_0xfb65('0x4c')](_0x5dd802[_0xfb65('0x4b')],{'$or':_[_0xfb65('0x3b')](_0x5dd802[_0xfb65('0x46')],function(_0x1ec24c){var _0x26ab41={};_0x26ab41[_0x1ec24c]={'$like':'%'+_0x176b9[_0xfb65('0x41')][_0xfb65('0x4d')]+'%'};return _0x26ab41;})});}_0x5dd802=_[_0xfb65('0x4c')]({},_0x5dd802,_0x176b9['options']);return db[_0xfb65('0x6f')][_0xfb65('0x2b')]({'where':_0x5dd802['where']})[_0xfb65('0x30')](function(_0x290ebe){_0x6ccb93[_0xfb65('0x2b')]=_0x290ebe;if(_0x176b9[_0xfb65('0x41')]['includeAll']){_0x5dd802[_0xfb65('0x4f')]=[{'model':db[_0xfb65('0x71')],'as':_0xfb65('0x72'),'required':![]},{'model':db[_0xfb65('0x73')],'as':_0xfb65('0x74'),'attributes':[_0xfb65('0x37'),'fullname',_0xfb65('0x75')],'required':![]},{'model':db[_0xfb65('0x76')],'as':_0xfb65('0x77'),'attributes':['id','name',_0xfb65('0x78')],'where':_0x176b9[_0xfb65('0x41')][_0xfb65('0x79')]?{'id':_0x176b9[_0xfb65('0x41')][_0xfb65('0x79')]}:undefined,'required':_0x176b9[_0xfb65('0x41')][_0xfb65('0x79')]?!![]:![]}];}return db[_0xfb65('0x6f')][_0xfb65('0x50')](_0x5dd802);})[_0xfb65('0x30')](function(_0x115563){_0x6ccb93[_0xfb65('0x51')]=_0x115563;return _0x6ccb93;});}})['then'](respondWithFilteredResult(_0x382043,_0x5dd802))[_0xfb65('0x52')](handleError(_0x382043,null));};exports[_0xfb65('0x7a')]=function(_0x113701,_0x5653db){var _0x177c4f=_0x113701['params']['id'];var _0x26fb78=_0x113701[_0xfb65('0x56')];var _0x10d3ee=0xc8;var _0x5f28c4=null;return db[_0xfb65('0x7b')][_0xfb65('0x7c')]({'isolationLevel':db[_0xfb65('0x7b')][_0xfb65('0x7d')][_0xfb65('0x7e')]['READ_COMMITTED']},function(_0xf7717e){return db[_0xfb65('0x3c')][_0xfb65('0x6a')]({'where':{'id':_0x177c4f},'transaction':_0xf7717e})[_0xfb65('0x30')](function(_0x1cd141){if(_0x1cd141){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x177c4f},'transaction':_0xf7717e})[_0xfb65('0x30')](function(){var _0x2635bc=_[_0xfb65('0x3b')](_0x26fb78,function(_0x44acca){_0x44acca[_0xfb65('0x63')]=_0x177c4f;return _0x44acca;});return db[_0xfb65('0x7f')][_0xfb65('0x80')](_0x2635bc,{'transaction':_0xf7717e});});}else{_0x10d3ee=0x194;_0x5f28c4=[];}});})[_0xfb65('0x30')](function(){if(_0x10d3ee!==0x194){return db['FaxApplication'][_0xfb65('0x81')]({'where':{'FaxAccountId':_0x177c4f},'order':_0xfb65('0x82')})[_0xfb65('0x30')](function(_0x3bde60){_0x5f28c4=_0x3bde60;});}})[_0xfb65('0x52')](function(_0x19bf75){_0x10d3ee=0x1f4;logger[_0xfb65('0x23')](_0x19bf75[_0xfb65('0x36')]);if(_0x19bf75[_0xfb65('0x37')]){delete _0x19bf75[_0xfb65('0x37')];}_0x5f28c4=_0x19bf75;})[_0xfb65('0x83')](function(){if(_0x5f28c4===null){_0x5653db['sendStatus'](_0x10d3ee);}else{if(_0x10d3ee===0x1f4){_0x5653db[_0xfb65('0x27')](_0x10d3ee)['send'](_0x5f28c4);}else{_0x5653db[_0xfb65('0x27')](_0x10d3ee)[_0xfb65('0x2c')](_0x5f28c4);}}});};exports['getApplications']=function(_0x154675,_0x1aac75,_0x49f603){var _0x683524={};var _0x118a5d={};var _0x5e7b26;var _0x1bb3a3;return db['FaxAccount'][_0xfb65('0x6a')]({'where':{'id':_0x154675[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x1aac75,null))[_0xfb65('0x30')](function(_0x2b4db6){if(_0x2b4db6){_0x5e7b26=_0x2b4db6;_0x118a5d[_0xfb65('0x40')]=_[_0xfb65('0x42')](db[_0xfb65('0x7f')][_0xfb65('0x3d')]);_0x118a5d[_0xfb65('0x41')]=_[_0xfb65('0x42')](_0x154675[_0xfb65('0x41')]);_0x118a5d['filters']=_[_0xfb65('0x44')](_0x118a5d['model'],_0x118a5d['query']);_0x683524['attributes']=_[_0xfb65('0x44')](_0x118a5d['model'],qs[_0xfb65('0x45')](_0x154675[_0xfb65('0x41')][_0xfb65('0x45')]));_0x683524[_0xfb65('0x46')]=_0x683524[_0xfb65('0x46')]['length']?_0x683524[_0xfb65('0x46')]:_0x118a5d['model'];_0x683524[_0xfb65('0x4a')]=qs['sort'](_0x154675[_0xfb65('0x41')][_0xfb65('0x66')]);_0x683524[_0xfb65('0x4b')]=qs[_0xfb65('0x43')](_[_0xfb65('0x6c')](_0x154675[_0xfb65('0x41')],_0x118a5d[_0xfb65('0x43')]));if(_0x154675['query'][_0xfb65('0x4d')]){_0x683524['where']=_[_0xfb65('0x4c')](_0x683524[_0xfb65('0x4b')],{'$or':_['map'](_0x683524[_0xfb65('0x46')],function(_0x5521b9){var _0x5e0457={};_0x5e0457[_0x5521b9]={'$like':'%'+_0x154675[_0xfb65('0x41')][_0xfb65('0x4d')]+'%'};return _0x5e0457;})});}_0x683524=_[_0xfb65('0x4c')]({},_0x683524,_0x154675[_0xfb65('0x55')]);return _0x5e7b26[_0xfb65('0x84')](_0x683524);}})[_0xfb65('0x30')](function(_0x1c7be9){if(_0x1c7be9){_0x1bb3a3=_0x1c7be9[_0xfb65('0x47')];if(!_0x154675['query']['hasOwnProperty']('nolimit')){_0x683524[_0xfb65('0x2a')]=qs[_0xfb65('0x2a')](_0x154675['query'][_0xfb65('0x2a')]);_0x683524[_0xfb65('0x28')]=qs[_0xfb65('0x28')](_0x154675['query'][_0xfb65('0x28')]);}return _0x5e7b26[_0xfb65('0x84')](_0x683524);}})['then'](function(_0x444c7f){if(_0x444c7f){return _0x444c7f?{'count':_0x1bb3a3,'rows':_0x444c7f}:null;}})[_0xfb65('0x30')](respondWithResult(_0x1aac75,null))[_0xfb65('0x52')](handleError(_0x1aac75,null));};function Extension(_0x24ec9f,_0x383d1f,_0x56896d,_0x4cfe6e){this[_0xfb65('0x85')]=_0xfb65('0x86');this[_0xfb65('0x87')]=_0x24ec9f[_0xfb65('0x88')];this['app']=_0x4cfe6e;this[_0xfb65('0x3f')]=_0xfb65('0x89');this[_0xfb65('0x8a')]=_0xfb65('0x8b');this[_0xfb65('0x63')]=_0x24ec9f['id'];this[_0xfb65('0x82')]=_0x383d1f;this[_0xfb65('0x8c')]=_0x56896d;}function createExtensionsReciveFax(_0xfd4f4b){var _0x15fb34=0x1;var _0x17b5ab=[];_0x17b5ab[_0xfb65('0x8d')](new Extension(_0xfd4f4b,_0x15fb34,'',_0xfb65('0x8e')));_0x15fb34+=0x1;_0x17b5ab['push'](new Extension(_0xfd4f4b,_0x15fb34,_0xfb65('0x8f'),_0xfb65('0x90')));_0x15fb34+=0x1;for(var _0x41c4a0 in _0xfd4f4b){if(_0xfd4f4b[_0xfb65('0x48')](_0x41c4a0)&&(_0x41c4a0===_0xfb65('0x91')||_0x41c4a0==='localstationid'||_0x41c4a0===_0xfb65('0x92')||_0x41c4a0===_0xfb65('0x93')||_0x41c4a0===_0xfb65('0x94')||_0x41c4a0===_0xfb65('0x95')||_0x41c4a0===_0xfb65('0x96')||_0x41c4a0===_0xfb65('0x97')||_0x41c4a0==='t38timeout')){_0x17b5ab[_0xfb65('0x8d')](new Extension(_0xfd4f4b,_0x15fb34,_0xfb65('0x98')+_0x41c4a0+')='+_0xfd4f4b[_0x41c4a0],_0xfb65('0x90')));_0x15fb34+=0x1;}}_0x17b5ab[_0xfb65('0x8d')](new Extension(_0xfd4f4b,_0x15fb34,'6','Wait'));_0x15fb34+=0x1;_0x17b5ab[_0xfb65('0x8d')](new Extension(_0xfd4f4b,_0x15fb34,'/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',_0xfb65('0x99')));_0x15fb34=0x0;return _0x17b5ab;}exports[_0xfb65('0x9a')]=function(_0x2a3275,_0x4cf4d7,_0x137431){var _0x193a34;return db[_0xfb65('0x7b')]['transaction'](function(_0x127824){return db[_0xfb65('0x3c')]['create'](_0x2a3275[_0xfb65('0x56')],{'transaction':_0x127824})[_0xfb65('0x30')](function(_0x41371a){_0x193a34=_0x41371a[_0xfb65('0x57')]({'plain':!![]});return db[_0xfb65('0x9b')][_0xfb65('0x80')](createExtensionsReciveFax(_0x193a34),{'transaction':_0x127824});});})[_0xfb65('0x30')](function(){return _0x193a34;})[_0xfb65('0x30')](respondWithResult(_0x4cf4d7,null))['catch'](handleError(_0x4cf4d7,null));};exports['updateAccountApplications']=function(_0x2ade91,_0xaf02f7,_0x30dcce){var _0x4887bb;return db['sequelize'][_0xfb65('0x7c')](function(_0x1bb3bf){return db[_0xfb65('0x3c')]['update'](_0x2ade91[_0xfb65('0x56')],{'where':{'id':_0x2ade91[_0xfb65('0x56')]['id']},'transaction':_0x1bb3bf})[_0xfb65('0x30')](function(_0x365472){return db[_0xfb65('0x9b')][_0xfb65('0x33')]({'where':{'FaxAccountId':_0x2ade91[_0xfb65('0x56')]['id']},'transaction':_0x1bb3bf})[_0xfb65('0x30')](function(_0x4b2351){return db[_0xfb65('0x9b')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x2ade91[_0xfb65('0x56')],['tech',_0xfb65('0x9c'),_0xfb65('0x9d'),_0xfb65('0x9e'),'TrunkId',_0xfb65('0x9f')])),{'transaction':_0x1bb3bf});});});})[_0xfb65('0x30')](function(){return db[_0xfb65('0x3c')][_0xfb65('0xa0')](_0x2ade91[_0xfb65('0x56')]['id']);})[_0xfb65('0x30')](respondWithResult(_0xaf02f7,null))[_0xfb65('0x52')](handleError(_0xaf02f7,null));};exports[_0xfb65('0xa1')]=function(_0x1d1f47,_0x1b6fc9,_0xd09fb3){var _0x93a248={'raw':!![],'where':{}};var _0x4dcf51={};var _0xd454b3={'count':0x0,'rows':[]};return db[_0xfb65('0x3c')]['findOne']({'where':{'id':_0x1d1f47[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x1b6fc9,null))['then'](function(_0x3cf55b){if(_0x3cf55b){_0x4dcf51['model']=_[_0xfb65('0x42')](db[_0xfb65('0xa2')][_0xfb65('0x3d')]);_0x4dcf51[_0xfb65('0x41')]=_[_0xfb65('0x42')](_0x1d1f47[_0xfb65('0x41')]);_0x4dcf51[_0xfb65('0x43')]=_['intersection'](_0x4dcf51['model'],_0x4dcf51[_0xfb65('0x41')]);_0x93a248['attributes']=_['intersection'](_0x4dcf51[_0xfb65('0x40')],qs[_0xfb65('0x45')](_0x1d1f47[_0xfb65('0x41')][_0xfb65('0x45')]));_0x93a248[_0xfb65('0x46')]=_0x93a248[_0xfb65('0x46')][_0xfb65('0x47')]?_0x93a248[_0xfb65('0x46')]:_0x4dcf51[_0xfb65('0x40')];if(!_0x1d1f47[_0xfb65('0x41')]['hasOwnProperty'](_0xfb65('0x49'))){_0x93a248[_0xfb65('0x2a')]=qs[_0xfb65('0x2a')](_0x1d1f47['query'][_0xfb65('0x2a')]);_0x93a248[_0xfb65('0x28')]=qs[_0xfb65('0x28')](_0x1d1f47['query'][_0xfb65('0x28')]);}_0x93a248[_0xfb65('0x4a')]=qs[_0xfb65('0x66')](_0x1d1f47[_0xfb65('0x41')][_0xfb65('0x66')]);_0x93a248['where']=qs[_0xfb65('0x43')](_[_0xfb65('0x6c')](_0x1d1f47['query'],_0x4dcf51[_0xfb65('0x43')]));_0x93a248[_0xfb65('0x4b')][_0xfb65('0x63')]=_0x3cf55b['id'];if(_0x1d1f47[_0xfb65('0x41')][_0xfb65('0x4d')]){_0x93a248[_0xfb65('0x4b')]=_[_0xfb65('0x4c')](_0x93a248[_0xfb65('0x4b')],{'$or':_[_0xfb65('0x3b')](_0x93a248[_0xfb65('0x46')],function(_0x2e12c6){var _0x3bd5de={};_0x3bd5de[_0x2e12c6]={'$like':'%'+_0x1d1f47[_0xfb65('0x41')]['filter']+'%'};return _0x3bd5de;})});}if(_0x1d1f47['query'][_0xfb65('0xa3')]){var _0x5d346f=_0x1d1f47['query'][_0xfb65('0xa3')][_0xfb65('0xa4')](',');var _0x2d0075={};_0x2d0075[_0x5d346f[0x0]]={'$gte':moment(_0x5d346f[0x1])[_0xfb65('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x93a248['where']=_[_0xfb65('0x4c')](_0x93a248[_0xfb65('0x4b')],_0x2d0075);}_0x93a248=_[_0xfb65('0x4c')]({},_0x93a248,_0x1d1f47[_0xfb65('0x55')]);return db[_0xfb65('0xa2')][_0xfb65('0x2b')]({'where':_0x93a248[_0xfb65('0x4b')]})[_0xfb65('0x30')](function(_0x5e40d9){_0xd454b3[_0xfb65('0x2b')]=_0x5e40d9;if(_0x1d1f47[_0xfb65('0x41')]['includeAll']){_0x93a248[_0xfb65('0x4f')]=[{'all':!![]}];}return db[_0xfb65('0xa2')][_0xfb65('0x50')](_0x93a248);})[_0xfb65('0x30')](function(_0x5731da){_0xd454b3[_0xfb65('0x51')]=_0x5731da;return _0xd454b3;});}})[_0xfb65('0x30')](respondWithFilteredResult(_0x1b6fc9,_0x93a248))[_0xfb65('0x52')](handleError(_0x1b6fc9,null));};exports[_0xfb65('0x38')]=function(_0x32706b,_0x4c3e9e,_0x21582f){var _0x434a21,_0x5c5b29={},_0xa7163a;if(_0x32706b[_0xfb65('0x56')]['to']){_0xa7163a=_0x32706b[_0xfb65('0x56')]['to'][0x0];}return db[_0xfb65('0x3c')][_0xfb65('0x5c')]({'where':{'id':_0x32706b[_0xfb65('0x60')]['id']},'include':[{'model':db[_0xfb65('0xa6')],'as':_0xfb65('0xa7'),'include':[{'model':db[_0xfb65('0x71')],'as':_0xfb65('0xa8'),'where':{'fax':_0xa7163a},'limit':0x1,'order':[[_0xfb65('0x9e'),_0xfb65('0xa9')]]}]}]})[_0xfb65('0x30')](handleEntityNotFound(_0x4c3e9e,null))[_0xfb65('0x30')](function(_0x478ac3){_0x434a21=_0x478ac3;if(_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')]&&_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][_0xfb65('0x47')]){for(var _0x4310ca=0x0;_0x4310ca<_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][_0xfb65('0x47')];_0x4310ca+=0x1){_0x32706b['body'][_0xfb65('0xaa')][_0x4310ca]={'filename':_0x32706b[_0xfb65('0x56')]['attachments'][_0x4310ca][_0xfb65('0x37')],'id':_0x32706b['body']['attachments'][_0x4310ca]['id'],'path':path[_0xfb65('0xab')](config[_0xfb65('0xac')],'server/files/attachments',_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][_0x4310ca][_0xfb65('0xad')])};}}return respondWithRpcPromise(_0xfb65('0xae'),_0xfb65('0xae'),{'FaxAccountId':_['isNil'](_0x32706b[_0xfb65('0x60')]['id'])?undefined:_0x32706b[_0xfb65('0x60')]['id'],'path':_[_0xfb65('0xaf')](_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][0x0][_0xfb65('0x9')])?undefined:_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][0x0][_0xfb65('0x9')],'fax':_[_0xfb65('0xaf')](_0x32706b['body']['to'][0x0])?undefined:_0x32706b[_0xfb65('0x56')]['to'][0x0]},client9002);})[_0xfb65('0x30')](function(){if(_0x434a21){if(_[_0xfb65('0xaf')](_0x32706b['body'][_0xfb65('0xb0')])){_0x32706b['body'][_0xfb65('0xb0')]=util[_0xfb65('0xa5')](_0xfb65('0xb1'),_0x434a21['name'],_0x434a21[_0xfb65('0xb2')]);}if(_0x434a21[_0xfb65('0xa7')]){if(_0x434a21['List'][_0xfb65('0xa8')][_0xfb65('0x47')]){return _0x434a21[_0xfb65('0xa7')][_0xfb65('0xa8')][0x0];}else{return db[_0xfb65('0x71')][_0xfb65('0x5f')](_[_0xfb65('0x19')](_0x32706b[_0xfb65('0x56')],{'firstName':_0x32706b[_0xfb65('0x56')]['to'][0x0],'phone':_0x32706b[_0xfb65('0x56')]['to'][0x0],'fax':_0x32706b['body']['to'][0x0],'ListId':_0x434a21[_0xfb65('0x9f')]}));}}else{throw new Error(_0xfb65('0xb3'));}}else{throw new Error(_0xfb65('0xb4'));}})['then'](function(_0x1cd9fb){if(_0x1cd9fb){return db['FaxInteraction']['find']({'where':{'ContactId':_0x1cd9fb['id'],'closed':![],'FaxAccountId':_0x434a21['id']}})[_0xfb65('0x30')](function(_0x19f516){if(_0x19f516){return[_0x19f516,![]];}return db[_0xfb65('0x6f')]['create']({'UserId':_0x32706b[_0xfb65('0x5a')]['id'],'ContactId':_0x1cd9fb['id'],'FaxAccountId':_0x434a21['id'],'fax':_0x32706b['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xfb65('0x4c')](_0x32706b['body'],{'read':![],'body':_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][0x0][_0xfb65('0xb5')],'FaxAccountId':_0x434a21['id'],'UserId':_0x32706b[_0xfb65('0x5a')]['id'],'ContactId':_0x1cd9fb['id'],'AttachmentId':_0x32706b['body'][_0xfb65('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xfb65('0xa2')],'as':_0xfb65('0xb6')}]})['then'](function(_0x12c1f8){return[_0x12c1f8,!![]];});});}else{throw new Error(_0xfb65('0xb7'));}})[_0xfb65('0xb8')](function(_0x4c40b5,_0x1cc2ef){if(_0x1cc2ef){return _0x4c40b5;}return db[_0xfb65('0xa2')][_0xfb65('0x5f')]({'direction':_0xfb65('0xb9'),'read':![],'body':_0x32706b[_0xfb65('0x56')]['attachments'][0x0][_0xfb65('0xb5')],'FaxAccountId':_0x434a21['id'],'FaxInteractionId':_0x4c40b5['id'],'UserId':_0x32706b[_0xfb65('0x5a')]['id'],'ContactId':_0x4c40b5[_0xfb65('0xba')],'AttachmentId':_0x32706b['body'][_0xfb65('0xaa')][0x0]['id']})[_0xfb65('0x30')](function(_0x161ced){_0x4c40b5['dataValues'][_0xfb65('0xb6')]=[];_0x4c40b5[_0xfb65('0xbb')][_0xfb65('0xb6')][_0xfb65('0x8d')](_0x161ced[_0xfb65('0xbb')]);return _0x4c40b5;});})[_0xfb65('0x30')](function(_0x5a0876){respondWithRpcPromise(_0xfb65('0xbc'),_0xfb65('0xbc'),{'FaxAccountId':_[_0xfb65('0xaf')](_0x32706b[_0xfb65('0x60')]['id'])?undefined:_0x32706b['params']['id'],'path':_['isNil'](_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][0x0]['path'])?undefined:_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][0x0]['path'],'fax':_[_0xfb65('0xaf')](_0x32706b[_0xfb65('0x56')]['to'][0x0])?undefined:_0x32706b[_0xfb65('0x56')]['to'][0x0],'AttachmentId':_0x32706b[_0xfb65('0x56')][_0xfb65('0xaa')][0x0]['id']},client9002)['then'](function(_0x3aab3b){logger[_0xfb65('0x25')](_0xfb65('0xbd'),_0x3aab3b);})[_0xfb65('0x52')](function(_0x16f63b){logger[_0xfb65('0x25')](_0xfb65('0xbd'),_0x16f63b);});return _0x5a0876;})[_0xfb65('0x30')](respondWithResult(_0x4c3e9e,null))['catch'](handleError(_0x4c3e9e,null));};exports[_0xfb65('0xbe')]=function(_0x803a84,_0x1f9090,_0xa729c7){return db[_0xfb65('0x3c')]['find']({'where':{'id':_0x803a84[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x1f9090,null))['then'](function(_0x25194a){if(_0x25194a){return _0x25194a['addAgents'](_0x803a84[_0xfb65('0x56')][_0xfb65('0x68')],_['omit'](_0x803a84[_0xfb65('0x56')],[_0xfb65('0x68'),'id'])||{})['spread'](function(_0x5b3ac0){for(var _0x32aabf=0x0;_0x32aabf<_0x803a84[_0xfb65('0x56')][_0xfb65('0x68')][_0xfb65('0x47')];_0x32aabf+=0x1){socket[_0xfb65('0xbf')](_0xfb65('0xc0'),{'UserId':Number(_0x803a84[_0xfb65('0x56')][_0xfb65('0x68')][_0x32aabf]),'FaxAccountId':Number(_0x803a84['params']['id'])});}return _0x5b3ac0;});}})[_0xfb65('0x30')](respondWithResult(_0x1f9090,null))[_0xfb65('0x52')](handleError(_0x1f9090,null));};exports[_0xfb65('0xc1')]=function(_0x24d50c,_0x5abbc1,_0x2826c2){return db['FaxAccount']['find']({'where':{'id':_0x24d50c['params']['id']}})['then'](handleEntityNotFound(_0x5abbc1,null))[_0xfb65('0x30')](function(_0x3bd295){if(_0x3bd295){return _0x3bd295[_0xfb65('0xc1')](_0x24d50c[_0xfb65('0x41')][_0xfb65('0x68')])[_0xfb65('0x30')](function(){if(_[_0xfb65('0xc2')](_0x24d50c[_0xfb65('0x41')][_0xfb65('0x68')])){for(var _0x4b93be=0x0;_0x4b93be<_0x24d50c[_0xfb65('0x41')][_0xfb65('0x68')]['length'];_0x4b93be+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x24d50c[_0xfb65('0x41')][_0xfb65('0x68')][_0x4b93be]),'FaxAccountId':Number(_0x24d50c['params']['id'])});}}else{socket[_0xfb65('0xbf')](_0xfb65('0xc3'),{'UserId':Number(_0x24d50c[_0xfb65('0x41')][_0xfb65('0x68')]),'FaxAccountId':Number(_0x24d50c['params']['id'])});}});}})[_0xfb65('0x30')](respondWithStatusCode(_0x5abbc1,null))[_0xfb65('0x52')](handleError(_0x5abbc1,null));};exports['getAgents']=function(_0x5f5051,_0x641ee2,_0x29f0bb){var _0x5eaf29={};var _0x272e5d={};var _0x573624;var _0xa711f5;return db[_0xfb65('0x3c')][_0xfb65('0x6a')]({'where':{'id':_0x5f5051[_0xfb65('0x60')]['id']}})[_0xfb65('0x30')](handleEntityNotFound(_0x641ee2,null))['then'](function(_0x407a2e){if(_0x407a2e){_0x573624=_0x407a2e;_0x272e5d[_0xfb65('0x40')]=_[_0xfb65('0x42')](db['User'][_0xfb65('0x3d')]);_0x272e5d[_0xfb65('0x41')]=_['keys'](_0x5f5051[_0xfb65('0x41')]);_0x272e5d['filters']=_[_0xfb65('0x44')](_0x272e5d['model'],_0x272e5d['query']);_0x5eaf29[_0xfb65('0x46')]=_[_0xfb65('0x44')](_0x272e5d[_0xfb65('0x40')],qs[_0xfb65('0x45')](_0x5f5051[_0xfb65('0x41')][_0xfb65('0x45')]));_0x5eaf29['attributes']=_0x5eaf29[_0xfb65('0x46')][_0xfb65('0x47')]?_0x5eaf29['attributes']:_0x272e5d[_0xfb65('0x40')];_0x5eaf29[_0xfb65('0x4a')]=qs[_0xfb65('0x66')](_0x5f5051['query']['sort']);_0x5eaf29[_0xfb65('0x4b')]=qs[_0xfb65('0x43')](_['pick'](_0x5f5051[_0xfb65('0x41')],_0x272e5d[_0xfb65('0x43')]));if(_0x5f5051[_0xfb65('0x41')]['filter']){_0x5eaf29['where']=_[_0xfb65('0x4c')](_0x5eaf29[_0xfb65('0x4b')],{'$or':_[_0xfb65('0x3b')](_0x5eaf29[_0xfb65('0x46')],function(_0x1aeb9b){var _0x45cb24={};_0x45cb24[_0x1aeb9b]={'$like':'%'+_0x5f5051[_0xfb65('0x41')]['filter']+'%'};return _0x45cb24;})});}_0x5eaf29=_[_0xfb65('0x4c')]({},_0x5eaf29,_0x5f5051[_0xfb65('0x55')]);return _0x573624['getAgents'](_0x5eaf29);}})['then'](function(_0x37e187){if(_0x37e187){_0xa711f5=_0x37e187['length'];if(!_0x5f5051[_0xfb65('0x41')]['hasOwnProperty']('nolimit')){_0x5eaf29[_0xfb65('0x2a')]=qs[_0xfb65('0x2a')](_0x5f5051[_0xfb65('0x41')][_0xfb65('0x2a')]);_0x5eaf29[_0xfb65('0x28')]=qs['offset'](_0x5f5051[_0xfb65('0x41')][_0xfb65('0x28')]);}return _0x573624['getAgents'](_0x5eaf29);}})['then'](function(_0x1bee38){if(_0x1bee38){return _0x1bee38?{'count':_0xa711f5,'rows':_0x1bee38}:null;}})[_0xfb65('0x30')](respondWithResult(_0x641ee2,null))[_0xfb65('0x52')](handleError(_0x641ee2,null));}; \ No newline at end of file +var _0x635d=['fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','Pause','find','body','user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','pick','findAll','removeDispositions','addAnswer','CannedAnswer','findOne','hasOwnProperty','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','User','Owner','fullname','internal','Tags','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','findAndCountAll','finally','getApplications','from-voip-provider','localstationid','app','description','Fax\x20Extension','priority','push','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','ListId','findById','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','CmContact','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_0x635d,0x78));var _0xd635=function(_0x486a8b,_0x1d918f){_0x486a8b=_0x486a8b-0x0;var _0x2e1dd9=_0x635d[_0x486a8b];return _0x2e1dd9;};'use strict';var emlformat=require(_0xd635('0x0'));var rimraf=require(_0xd635('0x1'));var zipdir=require(_0xd635('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd635('0x3'));var moment=require(_0xd635('0x4'));var BPromise=require(_0xd635('0x5'));var Mustache=require(_0xd635('0x6'));var util=require(_0xd635('0x7'));var path=require('path');var sox=require(_0xd635('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd635('0x9'));var squel=require(_0xd635('0xa'));var crypto=require('crypto');var jsforce=require(_0xd635('0xb'));var deskjs=require(_0xd635('0xc'));var toCsv=require(_0xd635('0xd'));var querystring=require(_0xd635('0xe'));var Papa=require(_0xd635('0xf'));var Redis=require('ioredis');var authService=require(_0xd635('0x10'));var qs=require(_0xd635('0x11'));var as=require(_0xd635('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd635('0x13'));var utils=require('../../config/utils');var config=require(_0xd635('0x14'));var licenseUtil=require(_0xd635('0x15'));var db=require(_0xd635('0x16'))['db'];config[_0xd635('0x17')]=_['defaults'](config[_0xd635('0x17')],{'host':_0xd635('0x18'),'port':0x18eb});var socket=require(_0xd635('0x19'))(new Redis(config[_0xd635('0x17')]));require(_0xd635('0x1a'))[_0xd635('0x1b')](socket);var jayson=require(_0xd635('0x1c'));var client=jayson[_0xd635('0x1d')][_0xd635('0x1e')]({'port':0x232c});var client9002=jayson[_0xd635('0x1d')][_0xd635('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x108676,_0x2860e0,_0x33f401,_0x2465e8){return new BPromise(function(_0x179049,_0x20eaff){var _0x145a67=_0x2465e8||client;return _0x145a67[_0xd635('0x1f')](_0x108676,_0x33f401)[_0xd635('0x20')](function(_0x13dd43){logger[_0xd635('0x21')](_0xd635('0x22'),_0x2860e0,_0xd635('0x23'));logger[_0xd635('0x24')](_0xd635('0x25'),_0x2860e0,'request\x20sent',JSON[_0xd635('0x26')](_0x13dd43));if(_0x13dd43[_0xd635('0x27')]){if(_0x13dd43['error'][_0xd635('0x28')]===0x1f4){logger[_0xd635('0x27')](_0xd635('0x22'),_0x2860e0,_0x13dd43[_0xd635('0x27')]['message']);return _0x20eaff(_0x13dd43[_0xd635('0x27')][_0xd635('0x29')]);}logger[_0xd635('0x27')]('FaxAccount,\x20%s,\x20%s',_0x2860e0,_0x13dd43['error'][_0xd635('0x29')]);return _0x179049(_0x13dd43[_0xd635('0x27')][_0xd635('0x29')]);}else{logger[_0xd635('0x21')](_0xd635('0x22'),_0x2860e0,_0xd635('0x23'));_0x179049(_0x13dd43[_0xd635('0x2a')][_0xd635('0x29')]);}})['catch'](function(_0x4b624a){logger[_0xd635('0x27')]('FaxAccount,\x20%s,\x20%s',_0x2860e0,_0x4b624a);_0x20eaff(_0x4b624a);});});}function respondWithStatusCode(_0x53db79,_0x29c30f){_0x29c30f=_0x29c30f||0xcc;return function(_0x49f655){if(_0x49f655){return _0x53db79[_0xd635('0x2b')](_0x29c30f);}return _0x53db79[_0xd635('0x2c')](_0x29c30f)['end']();};}function respondWithResult(_0x1c88d4,_0x1f5b8d){_0x1f5b8d=_0x1f5b8d||0xc8;return function(_0x16f979){if(_0x16f979){return _0x1c88d4[_0xd635('0x2c')](_0x1f5b8d)[_0xd635('0x2d')](_0x16f979);}};}function respondWithFilteredResult(_0x13e59b,_0x56fb0d){return function(_0xe98f9d){if(_0xe98f9d){var _0x5e3674=typeof _0x56fb0d[_0xd635('0x2e')]===_0xd635('0x2f')&&typeof _0x56fb0d[_0xd635('0x30')]==='undefined';var _0x544618=_0xe98f9d[_0xd635('0x31')];var _0xa3870e=_0x5e3674?0x0:_0x56fb0d[_0xd635('0x2e')];var _0x4db4b1=_0x5e3674?_0xe98f9d['count']:_0x56fb0d['offset']+_0x56fb0d[_0xd635('0x30')];var _0x292b9f;if(_0x4db4b1>=_0x544618){_0x4db4b1=_0x544618;_0x292b9f=0xc8;}else{_0x292b9f=0xce;}_0x13e59b[_0xd635('0x2c')](_0x292b9f);return _0x13e59b['set'](_0xd635('0x32'),_0xa3870e+'-'+_0x4db4b1+'/'+_0x544618)[_0xd635('0x2d')](_0xe98f9d);}return null;};}function patchUpdates(_0x3b3ccc){return function(_0x374b1a){try{jsonpatch[_0xd635('0x33')](_0x374b1a,_0x3b3ccc,!![]);}catch(_0x2a364a){return BPromise[_0xd635('0x34')](_0x2a364a);}return _0x374b1a['save']();};}function saveUpdates(_0x14899e,_0x55b262){return function(_0x4357d5){if(_0x4357d5){return _0x4357d5['update'](_0x14899e)[_0xd635('0x20')](function(_0x10da22){return _0x10da22;});}return null;};}function removeEntity(_0x3ef9a0,_0x44597c){return function(_0x19b4e5){if(_0x19b4e5){return _0x19b4e5[_0xd635('0x35')]()['then'](function(){var _0x2d94cd=_0x19b4e5[_0xd635('0x36')]({'plain':!![]});var _0x39ba86=_0xd635('0x37');return db[_0xd635('0x38')][_0xd635('0x35')]({'where':{'type':_0x39ba86,'resourceId':_0x2d94cd['id']}})[_0xd635('0x20')](function(){return _0x19b4e5;});})[_0xd635('0x20')](function(){_0x3ef9a0[_0xd635('0x2c')](0xcc)[_0xd635('0x39')]();});}};}function handleEntityNotFound(_0x4c84b0,_0x4890ed){return function(_0x4a3bb5){if(!_0x4a3bb5){_0x4c84b0[_0xd635('0x2b')](0x194);}return _0x4a3bb5;};}function handleError(_0x193036,_0x595eae){_0x595eae=_0x595eae||0x1f4;return function(_0x2cdece){logger['error'](_0x2cdece[_0xd635('0x3a')]);if(_0x2cdece[_0xd635('0x3b')]){delete _0x2cdece[_0xd635('0x3b')];}_0x193036[_0xd635('0x2c')](_0x595eae)[_0xd635('0x3c')](_0x2cdece);};}exports[_0xd635('0x3d')]=function(_0x1eb947,_0x3998ce){var _0x4c79da={'include':[{'model':db['Pause'],'as':_0xd635('0x3e')}]},_0x1caf7b={},_0x2664e0={'count':0x0,'rows':[]};var _0x420539=_[_0xd635('0x3f')](db[_0xd635('0x40')][_0xd635('0x41')],function(_0x2bc590){return{'name':_0x2bc590['fieldName'],'type':_0x2bc590[_0xd635('0x42')][_0xd635('0x43')]};});_0x1caf7b['model']=_[_0xd635('0x3f')](_0x420539,_0xd635('0x3b'));_0x1caf7b[_0xd635('0x44')]=_[_0xd635('0x45')](_0x1eb947['query']);_0x1caf7b[_0xd635('0x46')]=_[_0xd635('0x47')](_0x1caf7b[_0xd635('0x48')],_0x1caf7b['query']);_0x4c79da['attributes']=_[_0xd635('0x47')](_0x1caf7b[_0xd635('0x48')],qs[_0xd635('0x49')](_0x1eb947[_0xd635('0x44')][_0xd635('0x49')]));_0x4c79da[_0xd635('0x4a')]=_0x4c79da[_0xd635('0x4a')][_0xd635('0x4b')]?_0x4c79da['attributes']:_0x1caf7b[_0xd635('0x48')];if(!_0x1eb947['query']['hasOwnProperty'](_0xd635('0x4c'))){_0x4c79da[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x1eb947[_0xd635('0x44')][_0xd635('0x30')]);_0x4c79da['offset']=qs[_0xd635('0x2e')](_0x1eb947['query'][_0xd635('0x2e')]);}_0x4c79da[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x1eb947[_0xd635('0x44')]['sort']);_0x4c79da[_0xd635('0x4f')]=qs[_0xd635('0x46')](_['pick'](_0x1eb947[_0xd635('0x44')],_0x1caf7b['filters']),_0x420539);if(_0x1eb947[_0xd635('0x44')][_0xd635('0x50')]){_0x4c79da[_0xd635('0x4f')]=_['merge'](_0x4c79da[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x420539,function(_0x15c963){if(_0x15c963[_0xd635('0x42')]!==_0xd635('0x51')){var _0x34621b={};_0x34621b[_0x15c963['name']]={'$like':'%'+_0x1eb947['query']['filter']+'%'};return _0x34621b;}})});}_0x4c79da=_[_0xd635('0x52')]({},_0x4c79da,_0x1eb947[_0xd635('0x53')]);var _0x19289c={'where':_0x4c79da[_0xd635('0x4f')]};return db['FaxAccount'][_0xd635('0x31')](_0x19289c)[_0xd635('0x20')](function(_0x5d55fc){_0x2664e0[_0xd635('0x31')]=_0x5d55fc;if(_0x1eb947[_0xd635('0x44')][_0xd635('0x54')]){_0x4c79da[_0xd635('0x55')]=[{'all':!![]}];}return db[_0xd635('0x40')]['findAll'](_0x4c79da);})['then'](function(_0x328285){_0x2664e0[_0xd635('0x56')]=_0x328285;return _0x2664e0;})[_0xd635('0x20')](respondWithFilteredResult(_0x3998ce,_0x4c79da))[_0xd635('0x57')](handleError(_0x3998ce,null));};exports[_0xd635('0x58')]=function(_0x416336,_0x4523c2){var _0x5ea18e={'raw':![],'where':{'id':_0x416336[_0xd635('0x59')]['id']},'include':[{'model':db[_0xd635('0x5a')],'as':_0xd635('0x3e')}]},_0x585cbe={};_0x585cbe[_0xd635('0x48')]=_['keys'](db['FaxAccount'][_0xd635('0x41')]);_0x585cbe[_0xd635('0x44')]=_[_0xd635('0x45')](_0x416336['query']);_0x585cbe[_0xd635('0x46')]=_[_0xd635('0x47')](_0x585cbe[_0xd635('0x48')],_0x585cbe[_0xd635('0x44')]);_0x5ea18e[_0xd635('0x4a')]=_['intersection'](_0x585cbe[_0xd635('0x48')],qs[_0xd635('0x49')](_0x416336[_0xd635('0x44')][_0xd635('0x49')]));_0x5ea18e['attributes']=_0x5ea18e['attributes'][_0xd635('0x4b')]?_0x5ea18e['attributes']:_0x585cbe[_0xd635('0x48')];if(_0x416336[_0xd635('0x44')]['includeAll']){_0x5ea18e['include']=[{'all':!![]}];}_0x5ea18e=_[_0xd635('0x52')]({},_0x5ea18e,_0x416336['options']);return db[_0xd635('0x40')][_0xd635('0x5b')](_0x5ea18e)[_0xd635('0x20')](handleEntityNotFound(_0x4523c2,null))[_0xd635('0x20')](respondWithResult(_0x4523c2,null))[_0xd635('0x57')](handleError(_0x4523c2,null));};exports['create']=function(_0x1425d2,_0x5e066c){return db[_0xd635('0x40')]['create'](_0x1425d2[_0xd635('0x5c')],{})[_0xd635('0x20')](function(_0x2d00e5){var _0x1ce463=_0x1425d2[_0xd635('0x5d')]['get']({'plain':!![]});if(!_0x1ce463)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ce463[_0xd635('0x5e')]===_0xd635('0x5d')){var _0x545428=_0x2d00e5[_0xd635('0x36')]({'plain':!![]});var _0x427f91=_0xd635('0x37');return db[_0xd635('0x5f')][_0xd635('0x5b')]({'where':{'name':_0x427f91,'userProfileId':_0x1ce463[_0xd635('0x60')]},'raw':!![]})[_0xd635('0x20')](function(_0x3d6663){if(_0x3d6663&&_0x3d6663['autoAssociation']===0x0){return db[_0xd635('0x38')][_0xd635('0x61')]({'name':_0x545428[_0xd635('0x3b')],'resourceId':_0x545428['id'],'type':_0x3d6663[_0xd635('0x3b')],'sectionId':_0x3d6663['id']},{})[_0xd635('0x20')](function(){return _0x2d00e5;});}else{return _0x2d00e5;}})[_0xd635('0x57')](function(_0x4ed439){logger['error'](_0xd635('0x62'),_0x4ed439);throw _0x4ed439;});}return _0x2d00e5;})[_0xd635('0x20')](respondWithResult(_0x5e066c,0xc9))[_0xd635('0x57')](handleError(_0x5e066c,null));};exports[_0xd635('0x63')]=function(_0x3f06ce,_0x12a3f4){if(_0x3f06ce[_0xd635('0x5c')]['id']){delete _0x3f06ce[_0xd635('0x5c')]['id'];}return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x3f06ce['params']['id']},'include':[{'model':db[_0xd635('0x5a')],'as':_0xd635('0x3e')}]})[_0xd635('0x20')](handleEntityNotFound(_0x12a3f4,null))['then'](saveUpdates(_0x3f06ce['body'],null))[_0xd635('0x20')](respondWithResult(_0x12a3f4,null))[_0xd635('0x57')](handleError(_0x12a3f4,null));};exports[_0xd635('0x35')]=function(_0x552edf,_0x340d95){return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x552edf['params']['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x340d95,null))[_0xd635('0x20')](removeEntity(_0x340d95,null))[_0xd635('0x57')](handleError(_0x340d95,null));};exports[_0xd635('0x64')]=function(_0x5aabce,_0x1ad80f){return db[_0xd635('0x40')][_0xd635('0x64')]()[_0xd635('0x20')](respondWithResult(_0x1ad80f,null))[_0xd635('0x57')](handleError(_0x1ad80f,null));};exports[_0xd635('0x65')]=function(_0x4af2e1,_0x601e74,_0x141fbe){if(_0x4af2e1['body']['id']){delete _0x4af2e1['body']['id'];}return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x4af2e1[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x601e74,null))[_0xd635('0x20')](function(_0x185d1d){if(_0x185d1d){_0x4af2e1[_0xd635('0x5c')][_0xd635('0x66')]=_0x185d1d['id'];return db[_0xd635('0x67')]['create'](_0x4af2e1[_0xd635('0x5c')]);}})[_0xd635('0x20')](respondWithResult(_0x601e74,null))[_0xd635('0x57')](handleError(_0x601e74,null));};exports[_0xd635('0x68')]=function(_0x350ba4,_0x2aa774,_0xbd1bfe){var _0x128c74={'raw':![],'where':{}};var _0x5687de={};var _0xcda8e4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x350ba4['params']['id']}})['then'](handleEntityNotFound(_0x2aa774,null))['then'](function(_0x4734ed){if(_0x4734ed){_0x5687de[_0xd635('0x48')]=_['keys'](db[_0xd635('0x67')][_0xd635('0x41')]);_0x5687de[_0xd635('0x44')]=_[_0xd635('0x45')](_0x350ba4[_0xd635('0x44')]);_0x5687de['filters']=_[_0xd635('0x47')](_0x5687de[_0xd635('0x48')],_0x5687de[_0xd635('0x44')]);_0x128c74[_0xd635('0x4a')]=_[_0xd635('0x47')](_0x5687de[_0xd635('0x48')],qs[_0xd635('0x49')](_0x350ba4['query'][_0xd635('0x49')]));_0x128c74['attributes']=_0x128c74[_0xd635('0x4a')][_0xd635('0x4b')]?_0x128c74[_0xd635('0x4a')]:_0x5687de[_0xd635('0x48')];if(!_0x350ba4['query']['hasOwnProperty'](_0xd635('0x4c'))){_0x128c74[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x350ba4['query']['limit']);_0x128c74[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x350ba4[_0xd635('0x44')]['offset']);}_0x128c74[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x350ba4[_0xd635('0x44')][_0xd635('0x4e')]);_0x128c74['where']=qs['filters'](_[_0xd635('0x69')](_0x350ba4[_0xd635('0x44')],_0x5687de[_0xd635('0x46')]));_0x128c74[_0xd635('0x4f')]['FaxAccountId']=_0x4734ed['id'];if(_0x350ba4[_0xd635('0x44')][_0xd635('0x50')]){_0x128c74['where']=_[_0xd635('0x52')](_0x128c74[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x128c74[_0xd635('0x4a')],function(_0x3e35e8){var _0x2e17f8={};_0x2e17f8[_0x3e35e8]={'$like':'%'+_0x350ba4['query'][_0xd635('0x50')]+'%'};return _0x2e17f8;})});}_0x128c74=_[_0xd635('0x52')]({},_0x128c74,_0x350ba4[_0xd635('0x53')]);return db[_0xd635('0x67')][_0xd635('0x31')]({'where':_0x128c74[_0xd635('0x4f')]})['then'](function(_0x1bdf20){_0xcda8e4[_0xd635('0x31')]=_0x1bdf20;if(_0x350ba4[_0xd635('0x44')][_0xd635('0x54')]){_0x128c74[_0xd635('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xd635('0x6a')](_0x128c74);})['then'](function(_0x522c37){_0xcda8e4[_0xd635('0x56')]=_0x522c37;return _0xcda8e4;});}})[_0xd635('0x20')](respondWithFilteredResult(_0x2aa774,_0x128c74))[_0xd635('0x57')](handleError(_0x2aa774,null));};exports['removeDispositions']=function(_0x5ca5d4,_0x27c25b,_0x41f8fc){return db[_0xd635('0x40')]['find']({'where':{'id':_0x5ca5d4[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x27c25b,null))[_0xd635('0x20')](function(_0x37cca7){if(_0x37cca7){return _0x37cca7[_0xd635('0x6b')](_0x5ca5d4['query']['ids']);}})[_0xd635('0x20')](respondWithStatusCode(_0x27c25b,null))[_0xd635('0x57')](handleError(_0x27c25b,null));};exports[_0xd635('0x6c')]=function(_0x1dca5d,_0x32e03c,_0x487003){if(_0x1dca5d['body']['id']){delete _0x1dca5d['body']['id'];}return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x1dca5d[_0xd635('0x59')]['id']}})['then'](handleEntityNotFound(_0x32e03c,null))[_0xd635('0x20')](function(_0xcbc7b){if(_0xcbc7b){_0x1dca5d[_0xd635('0x5c')]['FaxAccountId']=_0xcbc7b['id'];return db[_0xd635('0x6d')][_0xd635('0x61')](_0x1dca5d[_0xd635('0x5c')]);}})[_0xd635('0x20')](respondWithResult(_0x32e03c,null))[_0xd635('0x57')](handleError(_0x32e03c,null));};exports['getAnswers']=function(_0x25ff0c,_0xbd8183,_0x461dbb){var _0x2b0f67={'raw':![],'where':{}};var _0x300fe6={};var _0x19bb98={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd635('0x6e')]({'where':{'id':_0x25ff0c[_0xd635('0x59')]['id']}})['then'](handleEntityNotFound(_0xbd8183,null))[_0xd635('0x20')](function(_0x567545){if(_0x567545){_0x300fe6[_0xd635('0x48')]=_[_0xd635('0x45')](db[_0xd635('0x6d')]['rawAttributes']);_0x300fe6[_0xd635('0x44')]=_[_0xd635('0x45')](_0x25ff0c[_0xd635('0x44')]);_0x300fe6['filters']=_['intersection'](_0x300fe6['model'],_0x300fe6[_0xd635('0x44')]);_0x2b0f67['attributes']=_[_0xd635('0x47')](_0x300fe6['model'],qs[_0xd635('0x49')](_0x25ff0c[_0xd635('0x44')][_0xd635('0x49')]));_0x2b0f67[_0xd635('0x4a')]=_0x2b0f67[_0xd635('0x4a')][_0xd635('0x4b')]?_0x2b0f67[_0xd635('0x4a')]:_0x300fe6[_0xd635('0x48')];if(!_0x25ff0c[_0xd635('0x44')][_0xd635('0x6f')]('nolimit')){_0x2b0f67[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x25ff0c['query'][_0xd635('0x30')]);_0x2b0f67[_0xd635('0x2e')]=qs['offset'](_0x25ff0c['query'][_0xd635('0x2e')]);}_0x2b0f67[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x25ff0c['query'][_0xd635('0x4e')]);_0x2b0f67[_0xd635('0x4f')]=qs['filters'](_[_0xd635('0x69')](_0x25ff0c['query'],_0x300fe6[_0xd635('0x46')]));_0x2b0f67[_0xd635('0x4f')][_0xd635('0x66')]=_0x567545['id'];if(_0x25ff0c[_0xd635('0x44')][_0xd635('0x50')]){_0x2b0f67[_0xd635('0x4f')]=_[_0xd635('0x52')](_0x2b0f67[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x2b0f67[_0xd635('0x4a')],function(_0x28c157){var _0x23c683={};_0x23c683[_0x28c157]={'$like':'%'+_0x25ff0c['query'][_0xd635('0x50')]+'%'};return _0x23c683;})});}_0x2b0f67=_[_0xd635('0x52')]({},_0x2b0f67,_0x25ff0c[_0xd635('0x53')]);return db['CannedAnswer']['count']({'where':_0x2b0f67['where']})[_0xd635('0x20')](function(_0x22d39f){_0x19bb98[_0xd635('0x31')]=_0x22d39f;if(_0x25ff0c[_0xd635('0x44')][_0xd635('0x54')]){_0x2b0f67[_0xd635('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2b0f67);})[_0xd635('0x20')](function(_0x330e53){_0x19bb98[_0xd635('0x56')]=_0x330e53;return _0x19bb98;});}})['then'](respondWithFilteredResult(_0xbd8183,_0x2b0f67))['catch'](handleError(_0xbd8183,null));};exports[_0xd635('0x70')]=function(_0x295c6f,_0x2120fc,_0xb46161){return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x295c6f[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x2120fc,null))[_0xd635('0x20')](function(_0x427e64){if(_0x427e64){return _0x427e64['removeAnswers'](_0x295c6f['query'][_0xd635('0x71')]);}})['then'](respondWithStatusCode(_0x2120fc,null))[_0xd635('0x57')](handleError(_0x2120fc,null));};exports[_0xd635('0x72')]=function(_0x4446d5,_0x2910be,_0x321229){return db[_0xd635('0x73')]['find']({'where':{'id':_0x4446d5[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x2910be,null))[_0xd635('0x20')](function(_0x164bb6){if(_0x164bb6){return _0x164bb6[_0xd635('0x72')](_0x4446d5[_0xd635('0x5c')][_0xd635('0x71')],_[_0xd635('0x74')](_0x4446d5[_0xd635('0x5c')],[_0xd635('0x71'),'id'])||{});}})['then'](respondWithResult(_0x2910be,null))[_0xd635('0x57')](handleError(_0x2910be,null));};exports[_0xd635('0x75')]=function(_0x51ec3c,_0x15da4b,_0x4c1010){var _0x320acb={'raw':![],'where':{}};var _0x408c3b={};var _0x495ea5={'count':0x0,'rows':[]};return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x51ec3c[_0xd635('0x59')]['id']}})['then'](handleEntityNotFound(_0x15da4b,null))[_0xd635('0x20')](function(_0x162848){if(_0x162848){_0x408c3b['model']=_[_0xd635('0x45')](db[_0xd635('0x73')][_0xd635('0x41')]);_0x408c3b['query']=_['keys'](_0x51ec3c['query']);_0x408c3b[_0xd635('0x46')]=_[_0xd635('0x47')](_0x408c3b[_0xd635('0x48')],_0x408c3b['query']);_0x320acb[_0xd635('0x4a')]=_[_0xd635('0x47')](_0x408c3b[_0xd635('0x48')],qs['fields'](_0x51ec3c[_0xd635('0x44')]['fields']));_0x320acb[_0xd635('0x4a')]=_0x320acb['attributes'][_0xd635('0x4b')]?_0x320acb['attributes']:_0x408c3b[_0xd635('0x48')];if(!_0x51ec3c[_0xd635('0x44')][_0xd635('0x6f')](_0xd635('0x4c'))){_0x320acb['limit']=qs[_0xd635('0x30')](_0x51ec3c['query'][_0xd635('0x30')]);_0x320acb[_0xd635('0x2e')]=qs['offset'](_0x51ec3c[_0xd635('0x44')]['offset']);}_0x320acb[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x51ec3c[_0xd635('0x44')][_0xd635('0x4e')]);_0x320acb[_0xd635('0x4f')]=qs[_0xd635('0x46')](_[_0xd635('0x69')](_0x51ec3c[_0xd635('0x44')],_0x408c3b[_0xd635('0x46')]));_0x320acb['where'][_0xd635('0x66')]=_0x162848['id'];if(_0x51ec3c[_0xd635('0x44')][_0xd635('0x50')]){_0x320acb[_0xd635('0x4f')]=_[_0xd635('0x52')](_0x320acb['where'],{'$or':_['map'](_0x320acb[_0xd635('0x4a')],function(_0x325257){var _0x20eb94={};_0x20eb94[_0x325257]={'$like':'%'+_0x51ec3c[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x20eb94;})});}_0x320acb=_[_0xd635('0x52')]({},_0x320acb,_0x51ec3c[_0xd635('0x53')]);return db[_0xd635('0x73')][_0xd635('0x31')]({'where':_0x320acb['where']})[_0xd635('0x20')](function(_0x2814c2){_0x495ea5[_0xd635('0x31')]=_0x2814c2;if(_0x51ec3c[_0xd635('0x44')]['includeAll']){_0x320acb[_0xd635('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xd635('0x76')],'as':_0xd635('0x77'),'attributes':['name',_0xd635('0x78'),_0xd635('0x79')],'required':![]},{'model':db['Tag'],'as':_0xd635('0x7a'),'attributes':['id',_0xd635('0x3b'),'color'],'where':_0x51ec3c[_0xd635('0x44')][_0xd635('0x7b')]?{'id':_0x51ec3c[_0xd635('0x44')][_0xd635('0x7b')]}:undefined,'required':_0x51ec3c[_0xd635('0x44')][_0xd635('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0xd635('0x6a')](_0x320acb);})[_0xd635('0x20')](function(_0x40a6ff){_0x495ea5['rows']=_0x40a6ff;return _0x495ea5;});}})['then'](respondWithFilteredResult(_0x15da4b,_0x320acb))[_0xd635('0x57')](handleError(_0x15da4b,null));};exports['addApplications']=function(_0x3a610a,_0x2f77bc){var _0x441a21=_0x3a610a[_0xd635('0x59')]['id'];var _0x218f9b=_0x3a610a['body'];var _0x2fd2e6=0xc8;var _0x502780=null;return db[_0xd635('0x7c')][_0xd635('0x7d')]({'isolationLevel':db[_0xd635('0x7c')][_0xd635('0x7e')][_0xd635('0x7f')][_0xd635('0x80')]},function(_0x2b6282){return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x441a21},'transaction':_0x2b6282})['then'](function(_0xcf6132){if(_0xcf6132){return db['FaxApplication'][_0xd635('0x35')]({'where':{'FaxAccountId':_0x441a21},'transaction':_0x2b6282})[_0xd635('0x20')](function(){var _0x42538e=_[_0xd635('0x3f')](_0x218f9b,function(_0x55f9a0){_0x55f9a0[_0xd635('0x66')]=_0x441a21;return _0x55f9a0;});return db['FaxApplication'][_0xd635('0x81')](_0x42538e,{'transaction':_0x2b6282});});}else{_0x2fd2e6=0x194;_0x502780=[];}});})[_0xd635('0x20')](function(){if(_0x2fd2e6!==0x194){return db[_0xd635('0x82')][_0xd635('0x83')]({'where':{'FaxAccountId':_0x441a21},'order':'priority'})[_0xd635('0x20')](function(_0x31f264){_0x502780=_0x31f264;});}})['catch'](function(_0xfbe969){_0x2fd2e6=0x1f4;logger[_0xd635('0x27')](_0xfbe969[_0xd635('0x3a')]);if(_0xfbe969['name']){delete _0xfbe969[_0xd635('0x3b')];}_0x502780=_0xfbe969;})[_0xd635('0x84')](function(){if(_0x502780===null){_0x2f77bc['sendStatus'](_0x2fd2e6);}else{if(_0x2fd2e6===0x1f4){_0x2f77bc[_0xd635('0x2c')](_0x2fd2e6)[_0xd635('0x3c')](_0x502780);}else{_0x2f77bc['status'](_0x2fd2e6)[_0xd635('0x2d')](_0x502780);}}});};exports['getApplications']=function(_0x1f4c37,_0x38ab34,_0x2035b7){var _0x35cb12={};var _0x34e953={};var _0x3f323a;var _0x15140b;return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x1f4c37[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x38ab34,null))[_0xd635('0x20')](function(_0x5c253b){if(_0x5c253b){_0x3f323a=_0x5c253b;_0x34e953[_0xd635('0x48')]=_['keys'](db['FaxApplication'][_0xd635('0x41')]);_0x34e953[_0xd635('0x44')]=_[_0xd635('0x45')](_0x1f4c37[_0xd635('0x44')]);_0x34e953['filters']=_[_0xd635('0x47')](_0x34e953[_0xd635('0x48')],_0x34e953[_0xd635('0x44')]);_0x35cb12[_0xd635('0x4a')]=_[_0xd635('0x47')](_0x34e953[_0xd635('0x48')],qs['fields'](_0x1f4c37['query'][_0xd635('0x49')]));_0x35cb12['attributes']=_0x35cb12[_0xd635('0x4a')][_0xd635('0x4b')]?_0x35cb12[_0xd635('0x4a')]:_0x34e953[_0xd635('0x48')];_0x35cb12['order']=qs[_0xd635('0x4e')](_0x1f4c37[_0xd635('0x44')][_0xd635('0x4e')]);_0x35cb12[_0xd635('0x4f')]=qs['filters'](_[_0xd635('0x69')](_0x1f4c37[_0xd635('0x44')],_0x34e953[_0xd635('0x46')]));if(_0x1f4c37[_0xd635('0x44')][_0xd635('0x50')]){_0x35cb12['where']=_[_0xd635('0x52')](_0x35cb12[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x35cb12['attributes'],function(_0x1f0197){var _0x149d17={};_0x149d17[_0x1f0197]={'$like':'%'+_0x1f4c37[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x149d17;})});}_0x35cb12=_[_0xd635('0x52')]({},_0x35cb12,_0x1f4c37['options']);return _0x3f323a[_0xd635('0x85')](_0x35cb12);}})[_0xd635('0x20')](function(_0x5bbe2a){if(_0x5bbe2a){_0x15140b=_0x5bbe2a[_0xd635('0x4b')];if(!_0x1f4c37[_0xd635('0x44')][_0xd635('0x6f')](_0xd635('0x4c'))){_0x35cb12[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x1f4c37['query'][_0xd635('0x30')]);_0x35cb12[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x1f4c37[_0xd635('0x44')][_0xd635('0x2e')]);}return _0x3f323a[_0xd635('0x85')](_0x35cb12);}})['then'](function(_0x5ac8f9){if(_0x5ac8f9){return _0x5ac8f9?{'count':_0x15140b,'rows':_0x5ac8f9}:null;}})[_0xd635('0x20')](respondWithResult(_0x38ab34,null))[_0xd635('0x57')](handleError(_0x38ab34,null));};function Extension(_0x3211b4,_0x1d9dd7,_0x111664,_0x15564e){this['context']=_0xd635('0x86');this['exten']=_0x3211b4[_0xd635('0x87')];this[_0xd635('0x88')]=_0x15564e;this[_0xd635('0x42')]='system';this[_0xd635('0x89')]=_0xd635('0x8a');this[_0xd635('0x66')]=_0x3211b4['id'];this[_0xd635('0x8b')]=_0x1d9dd7;this['appdata']=_0x111664;}function createExtensionsReciveFax(_0x1a7a20){var _0x12b5b9=0x1;var _0x5e8b0a=[];_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,'','Answer'));_0x12b5b9+=0x1;_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,'CDR(type)=inbound-fax','Set'));_0x12b5b9+=0x1;for(var _0x3aa788 in _0x1a7a20){if(_0x1a7a20[_0xd635('0x6f')](_0x3aa788)&&(_0x3aa788===_0xd635('0x8d')||_0x3aa788==='localstationid'||_0x3aa788===_0xd635('0x8e')||_0x3aa788===_0xd635('0x8f')||_0x3aa788===_0xd635('0x90')||_0x3aa788===_0xd635('0x91')||_0x3aa788===_0xd635('0x92')||_0x3aa788==='modem'||_0x3aa788===_0xd635('0x93'))){_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,_0xd635('0x94')+_0x3aa788+')='+_0x1a7a20[_0x3aa788],'Set'));_0x12b5b9+=0x1;}}_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,'6',_0xd635('0x95')));_0x12b5b9+=0x1;_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,_0xd635('0x96'),_0xd635('0x97')));_0x12b5b9=0x0;return _0x5e8b0a;}exports[_0xd635('0x98')]=function(_0x364172,_0x33bdd6,_0x4a0c50){var _0x45f9c2;return db[_0xd635('0x7c')][_0xd635('0x7d')](function(_0x2bbe00){return db[_0xd635('0x40')][_0xd635('0x61')](_0x364172['body'],{'transaction':_0x2bbe00})[_0xd635('0x20')](function(_0x5ec4be){_0x45f9c2=_0x5ec4be['get']({'plain':!![]});return db[_0xd635('0x99')][_0xd635('0x81')](createExtensionsReciveFax(_0x45f9c2),{'transaction':_0x2bbe00});});})[_0xd635('0x20')](function(){return _0x45f9c2;})['then'](respondWithResult(_0x33bdd6,null))['catch'](handleError(_0x33bdd6,null));};exports[_0xd635('0x9a')]=function(_0x5136ca,_0x4b6cf0,_0x529344){var _0x2d4b81;return db['sequelize']['transaction'](function(_0x5b1f60){return db[_0xd635('0x40')]['update'](_0x5136ca[_0xd635('0x5c')],{'where':{'id':_0x5136ca[_0xd635('0x5c')]['id']},'transaction':_0x5b1f60})['then'](function(_0x145488){return db[_0xd635('0x99')][_0xd635('0x35')]({'where':{'FaxAccountId':_0x5136ca[_0xd635('0x5c')]['id']},'transaction':_0x5b1f60})[_0xd635('0x20')](function(_0x457289){return db[_0xd635('0x99')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x5136ca['body'],[_0xd635('0x9b'),_0xd635('0x43'),_0xd635('0x9c'),'updatedAt','TrunkId',_0xd635('0x9d')])),{'transaction':_0x5b1f60});});});})[_0xd635('0x20')](function(){return db[_0xd635('0x40')][_0xd635('0x9e')](_0x5136ca[_0xd635('0x5c')]['id']);})[_0xd635('0x20')](respondWithResult(_0x4b6cf0,null))[_0xd635('0x57')](handleError(_0x4b6cf0,null));};exports[_0xd635('0x9f')]=function(_0x4c6477,_0x282049,_0x258b42){var _0x5d91cf={'raw':!![],'where':{}};var _0x39e485={};var _0x195e1e={'count':0x0,'rows':[]};return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x4c6477['params']['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x282049,null))[_0xd635('0x20')](function(_0x77dc64){if(_0x77dc64){_0x39e485[_0xd635('0x48')]=_[_0xd635('0x45')](db['FaxMessage'][_0xd635('0x41')]);_0x39e485[_0xd635('0x44')]=_[_0xd635('0x45')](_0x4c6477[_0xd635('0x44')]);_0x39e485[_0xd635('0x46')]=_[_0xd635('0x47')](_0x39e485[_0xd635('0x48')],_0x39e485[_0xd635('0x44')]);_0x5d91cf[_0xd635('0x4a')]=_['intersection'](_0x39e485[_0xd635('0x48')],qs[_0xd635('0x49')](_0x4c6477[_0xd635('0x44')][_0xd635('0x49')]));_0x5d91cf['attributes']=_0x5d91cf['attributes'][_0xd635('0x4b')]?_0x5d91cf[_0xd635('0x4a')]:_0x39e485[_0xd635('0x48')];if(!_0x4c6477['query']['hasOwnProperty'](_0xd635('0x4c'))){_0x5d91cf[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x4c6477['query']['limit']);_0x5d91cf[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x4c6477[_0xd635('0x44')]['offset']);}_0x5d91cf[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x4c6477[_0xd635('0x44')][_0xd635('0x4e')]);_0x5d91cf[_0xd635('0x4f')]=qs[_0xd635('0x46')](_[_0xd635('0x69')](_0x4c6477[_0xd635('0x44')],_0x39e485['filters']));_0x5d91cf['where'][_0xd635('0x66')]=_0x77dc64['id'];if(_0x4c6477['query'][_0xd635('0x50')]){_0x5d91cf[_0xd635('0x4f')]=_[_0xd635('0x52')](_0x5d91cf['where'],{'$or':_[_0xd635('0x3f')](_0x5d91cf[_0xd635('0x4a')],function(_0x2e4063){var _0x3ed3b4={};_0x3ed3b4[_0x2e4063]={'$like':'%'+_0x4c6477[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x3ed3b4;})});}if(_0x4c6477[_0xd635('0x44')][_0xd635('0xa0')]){var _0x1d2a6a=_0x4c6477[_0xd635('0x44')][_0xd635('0xa0')]['split'](',');var _0x639a84={};_0x639a84[_0x1d2a6a[0x0]]={'$gte':moment(_0x1d2a6a[0x1])[_0xd635('0xa1')](_0xd635('0xa2'))};_0x5d91cf['where']=_[_0xd635('0x52')](_0x5d91cf[_0xd635('0x4f')],_0x639a84);}_0x5d91cf=_[_0xd635('0x52')]({},_0x5d91cf,_0x4c6477[_0xd635('0x53')]);return db[_0xd635('0xa3')]['count']({'where':_0x5d91cf['where']})['then'](function(_0x2e5e3c){_0x195e1e['count']=_0x2e5e3c;if(_0x4c6477[_0xd635('0x44')]['includeAll']){_0x5d91cf[_0xd635('0x55')]=[{'all':!![]}];}return db[_0xd635('0xa3')][_0xd635('0x6a')](_0x5d91cf);})[_0xd635('0x20')](function(_0x29b300){_0x195e1e[_0xd635('0x56')]=_0x29b300;return _0x195e1e;});}})[_0xd635('0x20')](respondWithFilteredResult(_0x282049,_0x5d91cf))[_0xd635('0x57')](handleError(_0x282049,null));};exports[_0xd635('0x3c')]=function(_0x59f04a,_0x5f086c,_0x1873eb){var _0x2913c5,_0x3e494f={},_0x3bab32;if(_0x59f04a[_0xd635('0x5c')]['to']){_0x3bab32=_0x59f04a[_0xd635('0x5c')]['to'][0x0];}return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x59f04a[_0xd635('0x59')]['id']},'include':[{'model':db[_0xd635('0xa4')],'as':'List','include':[{'model':db[_0xd635('0xa5')],'as':_0xd635('0xa6'),'where':{'fax':_0x3bab32},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x5f086c,null))['then'](function(_0x1d149f){_0x2913c5=_0x1d149f;if(_0x59f04a[_0xd635('0x5c')]['attachments']&&_0x59f04a['body'][_0xd635('0xa7')][_0xd635('0x4b')]){for(var _0x33396a=0x0;_0x33396a<_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][_0xd635('0x4b')];_0x33396a+=0x1){_0x59f04a['body'][_0xd635('0xa7')][_0x33396a]={'filename':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][_0x33396a][_0xd635('0x3b')],'id':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][_0x33396a]['id'],'path':path[_0xd635('0xa8')](config['root'],_0xd635('0xa9'),_0x59f04a['body']['attachments'][_0x33396a][_0xd635('0xaa')])};}}return respondWithRpcPromise(_0xd635('0xab'),_0xd635('0xab'),{'FaxAccountId':_[_0xd635('0xac')](_0x59f04a[_0xd635('0x59')]['id'])?undefined:_0x59f04a['params']['id'],'path':_[_0xd635('0xac')](_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['path'])?undefined:_0x59f04a['body'][_0xd635('0xa7')][0x0][_0xd635('0xad')],'fax':_[_0xd635('0xac')](_0x59f04a[_0xd635('0x5c')]['to'][0x0])?undefined:_0x59f04a[_0xd635('0x5c')]['to'][0x0]},client9002);})[_0xd635('0x20')](function(){if(_0x2913c5){if(_['isNil'](_0x59f04a[_0xd635('0x5c')][_0xd635('0xae')])){_0x59f04a['body'][_0xd635('0xae')]=util[_0xd635('0xa1')](_0xd635('0xaf'),_0x2913c5[_0xd635('0x3b')],_0x2913c5['fax']);}if(_0x2913c5[_0xd635('0xb0')]){if(_0x2913c5[_0xd635('0xb0')][_0xd635('0xa6')][_0xd635('0x4b')]){return _0x2913c5['List'][_0xd635('0xa6')][0x0];}else{return db[_0xd635('0xa5')][_0xd635('0x61')](_['defaults'](_0x59f04a['body'],{'firstName':_0x59f04a['body']['to'][0x0],'phone':_0x59f04a[_0xd635('0x5c')]['to'][0x0],'fax':_0x59f04a[_0xd635('0x5c')]['to'][0x0],'ListId':_0x2913c5[_0xd635('0x9d')]}));}}else{throw new Error(_0xd635('0xb1'));}}else{throw new Error(_0xd635('0xb2'));}})[_0xd635('0x20')](function(_0x6b8d07){if(_0x6b8d07){return db['FaxInteraction']['find']({'where':{'ContactId':_0x6b8d07['id'],'closed':![],'FaxAccountId':_0x2913c5['id']}})[_0xd635('0x20')](function(_0xa67898){if(_0xa67898){return[_0xa67898,![]];}return db[_0xd635('0x73')]['create']({'UserId':_0x59f04a[_0xd635('0x5d')]['id'],'ContactId':_0x6b8d07['id'],'FaxAccountId':_0x2913c5['id'],'fax':_0x59f04a['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xd635('0x52')](_0x59f04a[_0xd635('0x5c')],{'read':![],'body':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0][_0xd635('0xb3')],'FaxAccountId':_0x2913c5['id'],'UserId':_0x59f04a['user']['id'],'ContactId':_0x6b8d07['id'],'AttachmentId':_0x59f04a['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xd635('0xa3')],'as':'Messages'}]})['then'](function(_0x182c10){return[_0x182c10,!![]];});});}else{throw new Error(_0xd635('0xb4'));}})[_0xd635('0xb5')](function(_0x44330c,_0x5c160){if(_0x5c160){return _0x44330c;}return db[_0xd635('0xa3')][_0xd635('0x61')]({'direction':_0xd635('0xb6'),'read':![],'body':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0][_0xd635('0xb3')],'FaxAccountId':_0x2913c5['id'],'FaxInteractionId':_0x44330c['id'],'UserId':_0x59f04a[_0xd635('0x5d')]['id'],'ContactId':_0x44330c[_0xd635('0xb7')],'AttachmentId':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['id']})[_0xd635('0x20')](function(_0xa2d895){_0x44330c[_0xd635('0xb8')]['Messages']=[];_0x44330c[_0xd635('0xb8')]['Messages'][_0xd635('0x8c')](_0xa2d895['dataValues']);return _0x44330c;});})[_0xd635('0x20')](function(_0x45fc7c){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xd635('0xac')](_0x59f04a['params']['id'])?undefined:_0x59f04a['params']['id'],'path':_['isNil'](_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['path'])?undefined:_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['path'],'fax':_['isNil'](_0x59f04a[_0xd635('0x5c')]['to'][0x0])?undefined:_0x59f04a['body']['to'][0x0],'AttachmentId':_0x59f04a['body'][_0xd635('0xa7')][0x0]['id']},client9002)['then'](function(_0x5480d6){logger[_0xd635('0x21')](_0xd635('0xb9'),_0x5480d6);})[_0xd635('0x57')](function(_0x42a06e){logger[_0xd635('0x21')]('SendFaxRpc,\x20%s',_0x42a06e);});return _0x45fc7c;})[_0xd635('0x20')](respondWithResult(_0x5f086c,null))['catch'](handleError(_0x5f086c,null));};exports['addAgents']=function(_0x1e8709,_0x127e8e,_0x51bb4a){return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x1e8709[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x127e8e,null))[_0xd635('0x20')](function(_0x10fb01){if(_0x10fb01){return _0x10fb01[_0xd635('0xba')](_0x1e8709[_0xd635('0x5c')][_0xd635('0x71')],_[_0xd635('0x74')](_0x1e8709['body'],[_0xd635('0x71'),'id'])||{})[_0xd635('0xb5')](function(_0x1aea75){for(var _0x35270f=0x0;_0x35270f<_0x1e8709[_0xd635('0x5c')][_0xd635('0x71')][_0xd635('0x4b')];_0x35270f+=0x1){socket['emit'](_0xd635('0xbb'),{'UserId':Number(_0x1e8709['body'][_0xd635('0x71')][_0x35270f]),'FaxAccountId':Number(_0x1e8709[_0xd635('0x59')]['id'])});}return _0x1aea75;});}})[_0xd635('0x20')](respondWithResult(_0x127e8e,null))[_0xd635('0x57')](handleError(_0x127e8e,null));};exports[_0xd635('0xbc')]=function(_0x43640e,_0x5c723e,_0x1c9cb8){return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x43640e['params']['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x5c723e,null))[_0xd635('0x20')](function(_0x54cd33){if(_0x54cd33){return _0x54cd33[_0xd635('0xbc')](_0x43640e[_0xd635('0x44')][_0xd635('0x71')])[_0xd635('0x20')](function(){if(_[_0xd635('0xbd')](_0x43640e[_0xd635('0x44')][_0xd635('0x71')])){for(var _0x433cd8=0x0;_0x433cd8<_0x43640e[_0xd635('0x44')][_0xd635('0x71')]['length'];_0x433cd8+=0x1){socket[_0xd635('0xbe')](_0xd635('0xbf'),{'UserId':Number(_0x43640e[_0xd635('0x44')][_0xd635('0x71')][_0x433cd8]),'FaxAccountId':Number(_0x43640e[_0xd635('0x59')]['id'])});}}else{socket['emit'](_0xd635('0xbf'),{'UserId':Number(_0x43640e[_0xd635('0x44')][_0xd635('0x71')]),'FaxAccountId':Number(_0x43640e[_0xd635('0x59')]['id'])});}});}})[_0xd635('0x20')](respondWithStatusCode(_0x5c723e,null))[_0xd635('0x57')](handleError(_0x5c723e,null));};exports['getAgents']=function(_0x5afe70,_0x420018,_0x293cef){var _0x108dc5={};var _0x1adbec={};var _0x454267;var _0x323dc6;return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x5afe70[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x420018,null))[_0xd635('0x20')](function(_0x1df836){if(_0x1df836){_0x454267=_0x1df836;_0x1adbec[_0xd635('0x48')]=_[_0xd635('0x45')](db['User'][_0xd635('0x41')]);_0x1adbec['query']=_[_0xd635('0x45')](_0x5afe70[_0xd635('0x44')]);_0x1adbec['filters']=_['intersection'](_0x1adbec['model'],_0x1adbec[_0xd635('0x44')]);_0x108dc5[_0xd635('0x4a')]=_['intersection'](_0x1adbec[_0xd635('0x48')],qs[_0xd635('0x49')](_0x5afe70['query'][_0xd635('0x49')]));_0x108dc5[_0xd635('0x4a')]=_0x108dc5['attributes'][_0xd635('0x4b')]?_0x108dc5[_0xd635('0x4a')]:_0x1adbec[_0xd635('0x48')];_0x108dc5['order']=qs[_0xd635('0x4e')](_0x5afe70[_0xd635('0x44')][_0xd635('0x4e')]);_0x108dc5[_0xd635('0x4f')]=qs[_0xd635('0x46')](_[_0xd635('0x69')](_0x5afe70['query'],_0x1adbec['filters']));if(_0x5afe70['query'][_0xd635('0x50')]){_0x108dc5['where']=_['merge'](_0x108dc5['where'],{'$or':_[_0xd635('0x3f')](_0x108dc5['attributes'],function(_0x4de6b4){var _0x1e93d7={};_0x1e93d7[_0x4de6b4]={'$like':'%'+_0x5afe70[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x1e93d7;})});}_0x108dc5=_[_0xd635('0x52')]({},_0x108dc5,_0x5afe70[_0xd635('0x53')]);return _0x454267[_0xd635('0xc0')](_0x108dc5);}})[_0xd635('0x20')](function(_0x35c263){if(_0x35c263){_0x323dc6=_0x35c263[_0xd635('0x4b')];if(!_0x5afe70[_0xd635('0x44')]['hasOwnProperty'](_0xd635('0x4c'))){_0x108dc5['limit']=qs[_0xd635('0x30')](_0x5afe70[_0xd635('0x44')][_0xd635('0x30')]);_0x108dc5[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x5afe70[_0xd635('0x44')][_0xd635('0x2e')]);}return _0x454267[_0xd635('0xc0')](_0x108dc5);}})[_0xd635('0x20')](function(_0x1a42f5){if(_0x1a42f5){return _0x1a42f5?{'count':_0x323dc6,'rows':_0x1a42f5}:null;}})[_0xd635('0x20')](respondWithResult(_0x420018,null))[_0xd635('0x57')](handleError(_0x420018,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 650f695..795965f 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 _0x4b8f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x2c2b1f,_0x224277){var _0x5ff7ae=function(_0x489fa1){while(--_0x489fa1){_0x2c2b1f['push'](_0x2c2b1f['shift']());}};_0x5ff7ae(++_0x224277);}(_0x4b8f,0x187));var _0xf4b8=function(_0x23108d,_0x4cafaa){_0x23108d=_0x23108d-0x0;var _0xd2303d=_0x4b8f[_0x23108d];return _0xd2303d;};'use strict';var EventEmitter=require(_0xf4b8('0x0'));var FaxAccount=require(_0xf4b8('0x1'))['db'][_0xf4b8('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf4b8('0x3')](0x0);var events={'afterCreate':_0xf4b8('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x339b61){return function(_0x469c73,_0x43d84a,_0x573516){FaxAccountEvents[_0xf4b8('0x5')](_0x339b61+':'+_0x469c73['id'],_0x469c73);FaxAccountEvents[_0xf4b8('0x5')](_0x339b61,_0x469c73);_0x573516(null);};}for(var e in events){if(events[_0xf4b8('0x6')](e)){var event=events[e];FaxAccount[_0xf4b8('0x7')](e,emitEvent(event));}}module[_0xf4b8('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xa88b=['hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x256e40,_0x6e651d){var _0x15a4a6=function(_0x1c8bbf){while(--_0x1c8bbf){_0x256e40['push'](_0x256e40['shift']());}};_0x15a4a6(++_0x6e651d);}(_0xa88b,0x133));var _0xba88=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0xa88b[_0x3e21f4];return _0x40fc49;};'use strict';var EventEmitter=require(_0xba88('0x0'));var FaxAccount=require(_0xba88('0x1'))['db'][_0xba88('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xba88('0x3')](0x0);var events={'afterCreate':_0xba88('0x4'),'afterUpdate':_0xba88('0x5'),'afterDestroy':'remove'};function emitEvent(_0x299ee7){return function(_0x4ccd49,_0x58ae2b,_0x2bc008){FaxAccountEvents['emit'](_0x299ee7+':'+_0x4ccd49['id'],_0x4ccd49);FaxAccountEvents[_0xba88('0x6')](_0x299ee7,_0x4ccd49);_0x2bc008(null);};}for(var e in events){if(events[_0xba88('0x7')](e)){var event=events[e];FaxAccount[_0xba88('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 7d0ac7a..5f7b561 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 _0x6425=['./faxAccount.attributes','exports','FaxAccount','fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6425,0xc4));var _0x5642=function(_0x78a99f,_0x4a37c4){_0x78a99f=_0x78a99f-0x0;var _0x45c7fa=_0x6425[_0x78a99f];return _0x45c7fa;};'use strict';var _=require('lodash');var util=require(_0x5642('0x0'));var logger=require(_0x5642('0x1'))(_0x5642('0x2'));var moment=require(_0x5642('0x3'));var BPromise=require(_0x5642('0x4'));var rp=require(_0x5642('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5642('0x6'));var config=require(_0x5642('0x7'));var attributes=require(_0x5642('0x8'));module[_0x5642('0x9')]=function(_0x2c70ad,_0x3f264a){return _0x2c70ad['define'](_0x5642('0xa'),attributes,{'tableName':_0x5642('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4038=['exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4d2ed7,_0x1999e5){var _0x12af27=function(_0x28e2d4){while(--_0x28e2d4){_0x4d2ed7['push'](_0x4d2ed7['shift']());}};_0x12af27(++_0x1999e5);}(_0x4038,0x1a8));var _0x8403=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x4038[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0x8403('0x0'));var util=require(_0x8403('0x1'));var logger=require(_0x8403('0x2'))('api');var moment=require(_0x8403('0x3'));var BPromise=require(_0x8403('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8403('0x5'));var rimraf=require(_0x8403('0x6'));var config=require(_0x8403('0x7'));var attributes=require('./faxAccount.attributes');module[_0x8403('0x8')]=function(_0x3435d1,_0x353d3a){return _0x3435d1[_0x8403('0x9')](_0x8403('0xa'),attributes,{'tableName':_0x8403('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 73ad50d..33cef5a 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 _0xfd8d=['close','unmanaged','*,*,*,*','created','FaxMessage','name','interaction','unshift','agent','queueId','FaxQueue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxAccount','FaxAccount','options','where','attributes','limit','map','include','model','catch','body','fax','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','isNil','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','find','account','List','Contacts','FaxApplication','Applications','get','applications','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0xfd8d,0x11c));var _0xdfd8=function(_0x2f4bb7,_0x37e1b2){_0x2f4bb7=_0x2f4bb7-0x0;var _0x236a64=_0xfd8d[_0x2f4bb7];return _0x236a64;};'use strict';var _=require(_0xdfd8('0x0'));var util=require(_0xdfd8('0x1'));var moment=require(_0xdfd8('0x2'));var BPromise=require('bluebird');var rs=require(_0xdfd8('0x3'));var fs=require('fs');var Redis=require(_0xdfd8('0x4'));var db=require(_0xdfd8('0x5'))['db'];var utils=require(_0xdfd8('0x6'));var logger=require(_0xdfd8('0x7'))(_0xdfd8('0x8'));var config=require(_0xdfd8('0x9'));var jayson=require(_0xdfd8('0xa'));var client=jayson[_0xdfd8('0xb')][_0xdfd8('0xc')]({'port':0x232c});config[_0xdfd8('0xd')]=_[_0xdfd8('0xe')](config['redis'],{'host':_0xdfd8('0xf'),'port':0x18eb});var socket=require(_0xdfd8('0x10'))(new Redis(config['redis']));require(_0xdfd8('0x11'))[_0xdfd8('0x12')](socket);function respondWithRpcPromise(_0x580604,_0x3882ae,_0x1415ed){return new BPromise(function(_0xedc3fb,_0x310438){return client[_0xdfd8('0x13')](_0x580604,_0x1415ed)[_0xdfd8('0x14')](function(_0x5294b5){logger[_0xdfd8('0x15')](_0xdfd8('0x16'),_0x3882ae,_0xdfd8('0x17'));logger[_0xdfd8('0x18')](_0xdfd8('0x19'),_0x3882ae,_0xdfd8('0x17'),JSON[_0xdfd8('0x1a')](_0x5294b5));if(_0x5294b5[_0xdfd8('0x1b')]){if(_0x5294b5['error'][_0xdfd8('0x1c')]===0x1f4){logger[_0xdfd8('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x3882ae,_0x5294b5['error']['message']);return _0x310438(_0x5294b5[_0xdfd8('0x1b')][_0xdfd8('0x1d')]);}logger[_0xdfd8('0x1b')](_0xdfd8('0x16'),_0x3882ae,_0x5294b5['error'][_0xdfd8('0x1d')]);return _0xedc3fb(_0x5294b5[_0xdfd8('0x1b')][_0xdfd8('0x1d')]);}else{logger['info'](_0xdfd8('0x16'),_0x3882ae,_0xdfd8('0x17'));_0xedc3fb(_0x5294b5['result'][_0xdfd8('0x1d')]);}})['catch'](function(_0xf6ae4a){logger[_0xdfd8('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x3882ae,_0xf6ae4a);_0x310438(_0xf6ae4a);});});}exports[_0xdfd8('0x1e')]=function(_0x39feed){var _0x143aec=this;return new Promise(function(_0x567f49,_0x43278e){return db[_0xdfd8('0x1f')]['findAll']({'raw':_0x39feed[_0xdfd8('0x20')]?_0x39feed[_0xdfd8('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x39feed['options']?_0x39feed[_0xdfd8('0x20')][_0xdfd8('0x21')]||null:null,'attributes':_0x39feed[_0xdfd8('0x20')]?_0x39feed['options'][_0xdfd8('0x22')]||null:null,'limit':_0x39feed[_0xdfd8('0x20')]?_0x39feed['options'][_0xdfd8('0x23')]||null:null,'include':_0x39feed['options']?_0x39feed[_0xdfd8('0x20')]['include']?_[_0xdfd8('0x24')](_0x39feed[_0xdfd8('0x20')][_0xdfd8('0x25')],function(_0x21c2c4){return{'model':db[_0x21c2c4['model']],'as':_0x21c2c4['as'],'attributes':_0x21c2c4[_0xdfd8('0x22')],'include':_0x21c2c4[_0xdfd8('0x25')]?_[_0xdfd8('0x24')](_0x21c2c4['include'],function(_0x39f335){return{'model':db[_0x39f335[_0xdfd8('0x26')]],'as':_0x39f335['as'],'attributes':_0x39f335[_0xdfd8('0x22')],'include':_0x39f335['include']?_[_0xdfd8('0x24')](_0x39f335['include'],function(_0x577873){return{'model':db[_0x577873[_0xdfd8('0x26')]],'as':_0x577873['as'],'attributes':_0x577873[_0xdfd8('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdfd8('0x14')](function(_0x5125cd){logger[_0xdfd8('0x15')](_0xdfd8('0x1e'),_0x39feed);logger['debug'](_0xdfd8('0x1e'),_0x39feed,JSON['stringify'](_0x5125cd));_0x567f49(_0x5125cd);})[_0xdfd8('0x27')](function(_0x42c4dd){logger[_0xdfd8('0x1b')](_0xdfd8('0x1e'),_0x42c4dd[_0xdfd8('0x1d')],_0x39feed);_0x43278e(_0x143aec[_0xdfd8('0x1b')](0x1f4,_0x42c4dd[_0xdfd8('0x1d')]));});});};exports['NotifyFaxAccount']=function(_0x23e2f4,_0x3419c1,_0x3f1293){var _0x4817bb=this;return new Promise(function(_0x1221db,_0x2b3451){var _0x4aab37={'body':_0x23e2f4[_0xdfd8('0x28')],'channel':_0xdfd8('0x29')};var _0x3c95bb=[];var _0x59cf02=[];var _0x38a261={};return db[_0xdfd8('0x2a')]['describe']()[_0xdfd8('0x14')](function(_0x5bb4b9){if(!_0x5bb4b9){throw new db['Sequelize'][(_0xdfd8('0x2b'))]('no\x20available\x20attributes');}_0x3c95bb=_[_0xdfd8('0x2c')](_['keys'](_0x5bb4b9),['createdAt','updatedAt']);_0x59cf02=_['difference'](_['keys'](_0x5bb4b9),[_0xdfd8('0x2d'),_0xdfd8('0x2e'),_0xdfd8('0x2f'),'ListId']);if(_0x23e2f4[_0xdfd8('0x28')]['id']){delete _0x23e2f4[_0xdfd8('0x28')]['id'];}if(_[_0xdfd8('0x30')](_0x23e2f4[_0xdfd8('0x28')][_0xdfd8('0x31')])){throw new db[(_0xdfd8('0x32'))][(_0xdfd8('0x2b'))](_0xdfd8('0x33'));}if(_[_0xdfd8('0x30')](_0x23e2f4[_0xdfd8('0x28')][_0xdfd8('0x28')])||_0x23e2f4[_0xdfd8('0x28')][_0xdfd8('0x28')]===''){throw new db[(_0xdfd8('0x32'))][(_0xdfd8('0x2b'))](_0xdfd8('0x34'));}if(_[_0xdfd8('0x30')](_0x23e2f4[_0xdfd8('0x28')][_0xdfd8('0x35')])){throw new db[(_0xdfd8('0x32'))][(_0xdfd8('0x2b'))](_0xdfd8('0x36')+_0x59cf02);}if(!_['includes'](_0x59cf02,_0x23e2f4['body'][_0xdfd8('0x35')])){throw new db['Sequelize']['ValidationError'](_0xdfd8('0x37')+_0x59cf02);}_0x38a261[_0x23e2f4[_0xdfd8('0x28')][_0xdfd8('0x35')]]=_0x23e2f4[_0xdfd8('0x28')][_0xdfd8('0x31')];})[_0xdfd8('0x14')](function(){return db['FaxAccount'][_0xdfd8('0x38')]({'where':{'id':_0x23e2f4[_0xdfd8('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xdfd8('0x3a'),'include':[{'model':db[_0xdfd8('0x2a')],'as':_0xdfd8('0x3b'),'where':_0x38a261,'limit':0x1,'order':[[_0xdfd8('0x2e'),'DESC']]}]},{'model':db[_0xdfd8('0x3c')],'as':_0xdfd8('0x3d')}]});})[_0xdfd8('0x14')](function(_0x163fd4){if(_0x163fd4&&_0x163fd4[_0xdfd8('0x3a')]){var _0xf09bcd=_0x163fd4[_0xdfd8('0x3e')]({'plain':!![]});_0x4aab37[_0xdfd8('0x39')]=_0xf09bcd;_0x4aab37[_0xdfd8('0x3f')]=_0xf09bcd[_0xdfd8('0x3d')];_0x4aab37['list']=_0xf09bcd['List'];_0x4aab37['applications']=_[_0xdfd8('0x40')](_0x4aab37['applications'],[_0xdfd8('0x41')],[_0xdfd8('0x42')]);if(_0x4aab37[_0xdfd8('0x39')][_0xdfd8('0x3d')]){delete _0x4aab37[_0xdfd8('0x39')][_0xdfd8('0x3d')];}if(_0x4aab37[_0xdfd8('0x39')][_0xdfd8('0x3a')]&&_0x4aab37['account'][_0xdfd8('0x3a')]['Contacts'][_0xdfd8('0x43')]){return _0x4aab37[_0xdfd8('0x39')][_0xdfd8('0x3a')][_0xdfd8('0x3b')][0x0];}var _0xd3baf0=_[_0xdfd8('0xe')](_0x23e2f4[_0xdfd8('0x28')],{'firstName':_0x23e2f4[_0xdfd8('0x28')]['from'],'ListId':_0xf09bcd[_0xdfd8('0x44')]});_0xd3baf0[_0x23e2f4['body'][_0xdfd8('0x35')]]=_0x23e2f4[_0xdfd8('0x28')]['from'];return db[_0xdfd8('0x2a')][_0xdfd8('0x45')](_0xd3baf0,{'fields':_0x3c95bb,'raw':!![]});}})[_0xdfd8('0x14')](function(_0xe7813c){_0x4aab37[_0xdfd8('0x46')]=_0xe7813c;if(_0xe7813c){var _0xdf36be={'ContactId':_0xe7813c['id'],'FaxAccountId':_0x23e2f4[_0xdfd8('0x39')]['id'],'fax':_0xe7813c[_0xdfd8('0x29')]};return db['FaxInteraction'][_0xdfd8('0x38')]({'where':{'ContactId':_0xe7813c['id'],'closed':![],'FaxAccountId':_0x23e2f4[_0xdfd8('0x39')]['id']}})[_0xdfd8('0x14')](function(_0x517895){if(_0x517895){return[_0x517895,![]];}return db[_0xdfd8('0x47')][_0xdfd8('0x45')](_0xdf36be)[_0xdfd8('0x14')](function(_0x5bb066){return[_0x5bb066,!![]];});});}else{throw new Error(_0xdfd8('0x48'));}})[_0xdfd8('0x49')](function(_0x1640d9,_0x3c3711){var _0x3ec5a0=_0x1640d9[_0xdfd8('0x3e')]({'plain':!![]});if(_0x3c3711){if(_0x4aab37[_0xdfd8('0x39')][_0xdfd8('0x4a')]){_0x4aab37[_0xdfd8('0x3f')][_0xdfd8('0x4b')]({'id':0x0,'priority':_0x4aab37[_0xdfd8('0x3f')]['length']+0x1,'app':_0xdfd8('0x4c'),'appdata':_0xdfd8('0x4d'),'interval':_0xdfd8('0x4e')});}_0x3ec5a0[_0xdfd8('0x4f')]=!![];}else{_0x3ec5a0['created']=![];}_0x4aab37['interaction']=_0x3ec5a0;return db[_0xdfd8('0x50')][_0xdfd8('0x45')]({'body':_0x23e2f4[_0xdfd8('0x28')]['body'],'FaxAccountId':_0x23e2f4[_0xdfd8('0x39')]['id'],'FaxInteractionId':_0x1640d9['id'],'direction':'in','ContactId':_0x1640d9['ContactId'],'AttachmentId':_0x23e2f4['body']['AttachmentId']});})['then'](function(_0x17e2e8){_0x4aab37[_0xdfd8('0x1d')]=_0x17e2e8;if(!_0x4aab37['interaction']['UserId'])return;return db['User']['find']({'attributes':['id',_0xdfd8('0x51')],'where':{'id':_0x4aab37[_0xdfd8('0x52')]['UserId']}});})[_0xdfd8('0x14')](function(_0x8a394a){if(_0x8a394a){_0x4aab37[_0xdfd8('0x3f')][_0xdfd8('0x53')]({'id':0x0,'priority':0x0,'app':_0xdfd8('0x54'),'appdata':_0x8a394a[_0xdfd8('0x51')]+','+(_0x4aab37[_0xdfd8('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x4aab37[_0xdfd8('0x52')][_0xdfd8('0x55')])return;return db[_0xdfd8('0x56')]['find']({'attributes':['id',_0xdfd8('0x51')],'where':{'id':_0x4aab37[_0xdfd8('0x52')][_0xdfd8('0x55')]}});})[_0xdfd8('0x14')](function(_0x26b24c){if(_0x26b24c){_0x4aab37[_0xdfd8('0x3f')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x26b24c['name']+','+(_0x4aab37['account'][_0xdfd8('0x57')]||0x12c),'interval':_0xdfd8('0x4e')});}return respondWithRpcPromise(_0xdfd8('0x58'),_0xdfd8('0x59'),_0x4aab37);})[_0xdfd8('0x14')](function(_0x348cf3){_0x1221db(_0x348cf3);})[_0xdfd8('0x27')](function(_0x1885ce){_0x2b3451(_0x4817bb['error'](0x1f4,_0x1885ce['message']));});});}; \ No newline at end of file +var _0x9c45=['unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','agent','queueId','FaxQueue','name','unshift','queue','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','limit','include','attributes','map','model','NotifyFaxAccount','body','CmContact','describe','then','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','list','applications','orderBy','priority','asc','length','from','create','contact','fax','FaxInteraction','autoclose'];(function(_0x2023e1,_0xeca985){var _0x1fe133=function(_0x526d5f){while(--_0x526d5f){_0x2023e1['push'](_0x2023e1['shift']());}};_0x1fe133(++_0xeca985);}(_0x9c45,0x1c6));var _0x59c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x59c4('0x0'));var util=require(_0x59c4('0x1'));var moment=require('moment');var BPromise=require(_0x59c4('0x2'));var rs=require(_0x59c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x59c4('0x4'));var logger=require(_0x59c4('0x5'))('rpc');var config=require(_0x59c4('0x6'));var jayson=require(_0x59c4('0x7'));var client=jayson[_0x59c4('0x8')]['http']({'port':0x232c});config[_0x59c4('0x9')]=_[_0x59c4('0xa')](config[_0x59c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x59c4('0xb'))(new Redis(config[_0x59c4('0x9')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x9a45fc,_0x431913,_0x33af0f){return new BPromise(function(_0x31fc2b,_0x530bcd){return client[_0x59c4('0xc')](_0x9a45fc,_0x33af0f)['then'](function(_0x1d677c){logger[_0x59c4('0xd')](_0x59c4('0xe'),_0x431913,_0x59c4('0xf'));logger[_0x59c4('0x10')](_0x59c4('0x11'),_0x431913,_0x59c4('0xf'),JSON[_0x59c4('0x12')](_0x1d677c));if(_0x1d677c[_0x59c4('0x13')]){if(_0x1d677c[_0x59c4('0x13')][_0x59c4('0x14')]===0x1f4){logger[_0x59c4('0x13')](_0x59c4('0xe'),_0x431913,_0x1d677c['error'][_0x59c4('0x15')]);return _0x530bcd(_0x1d677c[_0x59c4('0x13')][_0x59c4('0x15')]);}logger[_0x59c4('0x13')](_0x59c4('0xe'),_0x431913,_0x1d677c[_0x59c4('0x13')][_0x59c4('0x15')]);return _0x31fc2b(_0x1d677c[_0x59c4('0x13')][_0x59c4('0x15')]);}else{logger[_0x59c4('0xd')](_0x59c4('0xe'),_0x431913,'request\x20sent');_0x31fc2b(_0x1d677c[_0x59c4('0x16')][_0x59c4('0x15')]);}})[_0x59c4('0x17')](function(_0x52015f){logger[_0x59c4('0x13')](_0x59c4('0xe'),_0x431913,_0x52015f);_0x530bcd(_0x52015f);});});}exports[_0x59c4('0x18')]=function(_0x171d8a){var _0x2a6923=this;return new Promise(function(_0x5e3599,_0x1c5b5f){return db[_0x59c4('0x19')]['findAll']({'raw':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1b')]===undefined?!![]:![]:!![],'where':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1c')]||null:null,'attributes':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')]['attributes']||null:null,'limit':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1d')]||null:null,'include':_0x171d8a['options']?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1e')]?_['map'](_0x171d8a['options'][_0x59c4('0x1e')],function(_0x306a6a){return{'model':db[_0x306a6a['model']],'as':_0x306a6a['as'],'attributes':_0x306a6a[_0x59c4('0x1f')],'include':_0x306a6a[_0x59c4('0x1e')]?_['map'](_0x306a6a[_0x59c4('0x1e')],function(_0x13229f){return{'model':db[_0x13229f['model']],'as':_0x13229f['as'],'attributes':_0x13229f[_0x59c4('0x1f')],'include':_0x13229f[_0x59c4('0x1e')]?_[_0x59c4('0x20')](_0x13229f[_0x59c4('0x1e')],function(_0x30cd94){return{'model':db[_0x30cd94[_0x59c4('0x21')]],'as':_0x30cd94['as'],'attributes':_0x30cd94[_0x59c4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d45aa){logger[_0x59c4('0xd')](_0x59c4('0x18'),_0x171d8a);logger['debug'](_0x59c4('0x18'),_0x171d8a,JSON[_0x59c4('0x12')](_0x4d45aa));_0x5e3599(_0x4d45aa);})[_0x59c4('0x17')](function(_0x51b3d7){logger['error'](_0x59c4('0x18'),_0x51b3d7['message'],_0x171d8a);_0x1c5b5f(_0x2a6923['error'](0x1f4,_0x51b3d7['message']));});});};exports[_0x59c4('0x22')]=function(_0x4ab591,_0x902a64,_0x32f13e){var _0x1d8d67=this;return new Promise(function(_0x53f3fd,_0x3fdeee){var _0x4c9ab9={'body':_0x4ab591[_0x59c4('0x23')],'channel':'fax'};var _0x45b1ee=[];var _0x21b1e2=[];var _0x5cb914={};return db[_0x59c4('0x24')][_0x59c4('0x25')]()[_0x59c4('0x26')](function(_0x412c3f){if(!_0x412c3f){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x29'));}_0x45b1ee=_[_0x59c4('0x2a')](_[_0x59c4('0x2b')](_0x412c3f),[_0x59c4('0x2c'),_0x59c4('0x2d')]);_0x21b1e2=_[_0x59c4('0x2a')](_[_0x59c4('0x2b')](_0x412c3f),[_0x59c4('0x2c'),_0x59c4('0x2d'),_0x59c4('0x2e'),'ListId']);if(_0x4ab591[_0x59c4('0x23')]['id']){delete _0x4ab591['body']['id'];}if(_[_0x59c4('0x2f')](_0x4ab591[_0x59c4('0x23')]['from'])){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x30'));}if(_[_0x59c4('0x2f')](_0x4ab591[_0x59c4('0x23')][_0x59c4('0x23')])||_0x4ab591[_0x59c4('0x23')][_0x59c4('0x23')]===''){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x59c4('0x2f')](_0x4ab591['body']['mapKey'])){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x31')+_0x21b1e2);}if(!_[_0x59c4('0x32')](_0x21b1e2,_0x4ab591[_0x59c4('0x23')][_0x59c4('0x33')])){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x34')+_0x21b1e2);}_0x5cb914[_0x4ab591[_0x59c4('0x23')]['mapKey']]=_0x4ab591[_0x59c4('0x23')]['from'];})[_0x59c4('0x26')](function(){return db[_0x59c4('0x19')][_0x59c4('0x35')]({'where':{'id':_0x4ab591[_0x59c4('0x36')]['id']},'include':[{'model':db[_0x59c4('0x37')],'as':'List','include':[{'model':db[_0x59c4('0x24')],'as':_0x59c4('0x38'),'where':_0x5cb914,'limit':0x1,'order':[[_0x59c4('0x2d'),_0x59c4('0x39')]]}]},{'model':db[_0x59c4('0x3a')],'as':_0x59c4('0x3b')}]});})[_0x59c4('0x26')](function(_0x7018b5){if(_0x7018b5&&_0x7018b5[_0x59c4('0x3c')]){var _0x42cc2e=_0x7018b5[_0x59c4('0x3d')]({'plain':!![]});_0x4c9ab9[_0x59c4('0x36')]=_0x42cc2e;_0x4c9ab9['applications']=_0x42cc2e[_0x59c4('0x3b')];_0x4c9ab9[_0x59c4('0x3e')]=_0x42cc2e[_0x59c4('0x3c')];_0x4c9ab9[_0x59c4('0x3f')]=_[_0x59c4('0x40')](_0x4c9ab9['applications'],[_0x59c4('0x41')],[_0x59c4('0x42')]);if(_0x4c9ab9['account'][_0x59c4('0x3b')]){delete _0x4c9ab9[_0x59c4('0x36')][_0x59c4('0x3b')];}if(_0x4c9ab9[_0x59c4('0x36')][_0x59c4('0x3c')]&&_0x4c9ab9[_0x59c4('0x36')]['List'][_0x59c4('0x38')][_0x59c4('0x43')]){return _0x4c9ab9['account'][_0x59c4('0x3c')][_0x59c4('0x38')][0x0];}var _0x8c4c34=_[_0x59c4('0xa')](_0x4ab591['body'],{'firstName':_0x4ab591[_0x59c4('0x23')]['from'],'ListId':_0x42cc2e['ListId']});_0x8c4c34[_0x4ab591[_0x59c4('0x23')][_0x59c4('0x33')]]=_0x4ab591[_0x59c4('0x23')][_0x59c4('0x44')];return db[_0x59c4('0x24')][_0x59c4('0x45')](_0x8c4c34,{'fields':_0x45b1ee,'raw':!![]});}})[_0x59c4('0x26')](function(_0x112a5f){_0x4c9ab9[_0x59c4('0x46')]=_0x112a5f;if(_0x112a5f){var _0x324494={'ContactId':_0x112a5f['id'],'FaxAccountId':_0x4ab591[_0x59c4('0x36')]['id'],'fax':_0x112a5f[_0x59c4('0x47')]};return db[_0x59c4('0x48')][_0x59c4('0x35')]({'where':{'ContactId':_0x112a5f['id'],'closed':![],'FaxAccountId':_0x4ab591[_0x59c4('0x36')]['id']}})[_0x59c4('0x26')](function(_0x443ac3){if(_0x443ac3){return[_0x443ac3,![]];}return db[_0x59c4('0x48')][_0x59c4('0x45')](_0x324494)[_0x59c4('0x26')](function(_0x47f542){return[_0x47f542,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x87d9cd,_0x1caf9d){var _0x4cb23d=_0x87d9cd[_0x59c4('0x3d')]({'plain':!![]});if(_0x1caf9d){if(_0x4c9ab9[_0x59c4('0x36')][_0x59c4('0x49')]){_0x4c9ab9['applications']['push']({'id':0x0,'priority':_0x4c9ab9[_0x59c4('0x3f')][_0x59c4('0x43')]+0x1,'app':'close','appdata':_0x59c4('0x4a'),'interval':_0x59c4('0x4b')});}_0x4cb23d[_0x59c4('0x4c')]=!![];}else{_0x4cb23d[_0x59c4('0x4c')]=![];}_0x4c9ab9[_0x59c4('0x4d')]=_0x4cb23d;return db[_0x59c4('0x4e')]['create']({'body':_0x4ab591[_0x59c4('0x23')][_0x59c4('0x23')],'FaxAccountId':_0x4ab591[_0x59c4('0x36')]['id'],'FaxInteractionId':_0x87d9cd['id'],'direction':'in','ContactId':_0x87d9cd['ContactId'],'AttachmentId':_0x4ab591[_0x59c4('0x23')][_0x59c4('0x4f')]});})['then'](function(_0x3b5c40){_0x4c9ab9[_0x59c4('0x15')]=_0x3b5c40;if(!_0x4c9ab9[_0x59c4('0x4d')][_0x59c4('0x50')])return;return db[_0x59c4('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0x4c9ab9[_0x59c4('0x4d')]['UserId']}});})['then'](function(_0x20582c){if(_0x20582c){_0x4c9ab9[_0x59c4('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x59c4('0x52'),'appdata':_0x20582c['name']+','+(_0x4c9ab9[_0x59c4('0x36')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x4c9ab9[_0x59c4('0x4d')][_0x59c4('0x53')])return;return db[_0x59c4('0x54')][_0x59c4('0x35')]({'attributes':['id',_0x59c4('0x55')],'where':{'id':_0x4c9ab9[_0x59c4('0x4d')][_0x59c4('0x53')]}});})[_0x59c4('0x26')](function(_0x4e95b1){if(_0x4e95b1){_0x4c9ab9[_0x59c4('0x3f')][_0x59c4('0x56')]({'id':0x0,'priority':0x1,'app':_0x59c4('0x57'),'appdata':_0x4e95b1['name']+','+(_0x4c9ab9['account']['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x4c9ab9);})[_0x59c4('0x26')](function(_0x1695b4){_0x53f3fd(_0x1695b4);})['catch'](function(_0x3338bb){_0x3fdeee(_0x1d8d67[_0x59c4('0x13')](0x1f4,_0x3338bb[_0x59c4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index c002aed..dbf0e28 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 _0x970d=['./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2f4d41,_0x525047){var _0x3b0bb2=function(_0x19960d){while(--_0x19960d){_0x2f4d41['push'](_0x2f4d41['shift']());}};_0x3b0bb2(++_0x525047);}(_0x970d,0xa0));var _0xd970=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0x970d[_0xbec8e6];return _0x4aa6f2;};'use strict';var FaxAccountEvents=require(_0xd970('0x0'));var events=[_0xd970('0x1'),_0xd970('0x2'),_0xd970('0x3')];function createListener(_0x16a291,_0x3394e6){return function(_0x2846ca){_0x3394e6[_0xd970('0x4')](_0x16a291,_0x2846ca);};}function removeListener(_0x4e7eaf,_0x3054ab){return function(){FaxAccountEvents[_0xd970('0x5')](_0x4e7eaf,_0x3054ab);};}exports[_0xd970('0x6')]=function(_0x5abb33){for(var _0x250a41=0x0,_0x200b82=events[_0xd970('0x7')];_0x250a41<_0x200b82;_0x250a41++){var _0x27acd7=events[_0x250a41];var _0x2a96b5=createListener('faxAccount:'+_0x27acd7,_0x5abb33);FaxAccountEvents['on'](_0x27acd7,_0x2a96b5);}}; \ No newline at end of file +var _0x83cd=['save','remove','update','removeListener','length','faxAccount:','./faxAccount.events'];(function(_0x478bf5,_0x40ec46){var _0x243c14=function(_0x46d305){while(--_0x46d305){_0x478bf5['push'](_0x478bf5['shift']());}};_0x243c14(++_0x40ec46);}(_0x83cd,0x6f));var _0xd83c=function(_0x1a5182,_0x25b2dd){_0x1a5182=_0x1a5182-0x0;var _0x37d275=_0x83cd[_0x1a5182];return _0x37d275;};'use strict';var FaxAccountEvents=require(_0xd83c('0x0'));var events=[_0xd83c('0x1'),_0xd83c('0x2'),_0xd83c('0x3')];function createListener(_0x310e25,_0x552584){return function(_0x5f1ea6){_0x552584['emit'](_0x310e25,_0x5f1ea6);};}function removeListener(_0x5857fe,_0x10cb85){return function(){FaxAccountEvents[_0xd83c('0x4')](_0x5857fe,_0x10cb85);};}exports['register']=function(_0x5c1658){for(var _0x3c752d=0x0,_0x3d3e1b=events[_0xd83c('0x5')];_0x3c752d<_0x3d3e1b;_0x3c752d++){var _0x5af261=events[_0x3c752d];var _0x4d652c=createListener(_0xd83c('0x6')+_0x5af261,_0x5c1658);FaxAccountEvents['on'](_0x5af261,_0x4d652c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index bef1bcf..41c9d0e 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 _0xbadd=['describe','get','/:id','show','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','addInteraction','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','index'];(function(_0x3da0aa,_0x5028cf){var _0x5b656a=function(_0x5db5ff){while(--_0x5db5ff){_0x3da0aa['push'](_0x3da0aa['shift']());}};_0x5b656a(++_0x5028cf);}(_0xbadd,0x1c2));var _0xdbad=function(_0x3b4455,_0x3e4395){_0x3b4455=_0x3b4455-0x0;var _0x34dd09=_0xbadd[_0x3b4455];return _0x34dd09;};'use strict';var multer=require('multer');var util=require(_0xdbad('0x0'));var path=require('path');var timeout=require(_0xdbad('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdbad('0x2'));var interaction=require(_0xdbad('0x3'));var config=require('../../config/environment');var controller=require(_0xdbad('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xdbad('0x5')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdbad('0x6')]);router[_0xdbad('0x7')](_0xdbad('0x8'),auth['isAuthenticated'](),controller[_0xdbad('0x9')]);router[_0xdbad('0x7')]('/:id/dispositions',auth[_0xdbad('0xa')](),controller[_0xdbad('0xb')]);router['get'](_0xdbad('0xc'),auth['isAuthenticated'](),controller[_0xdbad('0xd')]);router['get'](_0xdbad('0xe'),auth[_0xdbad('0xa')](),controller['getInteractions']);router[_0xdbad('0x7')](_0xdbad('0xf'),auth['isAuthenticated'](),controller[_0xdbad('0x10')]);router[_0xdbad('0x7')](_0xdbad('0x11'),auth[_0xdbad('0xa')](),controller['getMessages']);router[_0xdbad('0x7')](_0xdbad('0x12'),auth[_0xdbad('0xa')](),controller[_0xdbad('0x13')]);router['post']('/',auth[_0xdbad('0xa')](),controller[_0xdbad('0x14')]);router[_0xdbad('0x15')](_0xdbad('0x16'),auth['isAuthenticated'](),controller[_0xdbad('0x17')]);router[_0xdbad('0x15')](_0xdbad('0xc'),auth[_0xdbad('0xa')](),controller[_0xdbad('0x18')]);router[_0xdbad('0x15')](_0xdbad('0xe'),auth[_0xdbad('0xa')](),controller[_0xdbad('0x19')]);router[_0xdbad('0x15')](_0xdbad('0xf'),auth[_0xdbad('0xa')](),controller['addApplications']);router[_0xdbad('0x15')](_0xdbad('0x1a'),auth[_0xdbad('0xa')](),controller['addAccountApplications']);router[_0xdbad('0x15')](_0xdbad('0x1b'),auth[_0xdbad('0xa')](),controller[_0xdbad('0x1c')]);router[_0xdbad('0x15')](_0xdbad('0x1d'),auth['isAuthenticated'](),controller[_0xdbad('0x1e')]);router[_0xdbad('0x15')](_0xdbad('0x12'),auth['isAuthenticated'](),controller[_0xdbad('0x1f')]);router[_0xdbad('0x20')](_0xdbad('0x8'),auth[_0xdbad('0xa')](),controller['update']);router['delete'](_0xdbad('0x8'),auth['isAuthenticated'](),controller[_0xdbad('0x21')]);router[_0xdbad('0x22')](_0xdbad('0x16'),auth[_0xdbad('0xa')](),controller[_0xdbad('0x23')]);router[_0xdbad('0x22')](_0xdbad('0xc'),auth[_0xdbad('0xa')](),controller['removeAnswers']);router[_0xdbad('0x22')]('/:id/users',auth[_0xdbad('0xa')](),controller[_0xdbad('0x24')]);module[_0xdbad('0x25')]=router; \ No newline at end of file +var _0x74fa=['create','post','addDisposition','addAnswer','/:id/interactions','addInteraction','/:id/applications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/messages','getMessages','/:id/users','getAgents'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0x74fa,0x6e));var _0xa74f=function(_0x347c98,_0x19aefa){_0x347c98=_0x347c98-0x0;var _0x315569=_0x74fa[_0x347c98];return _0x315569;};'use strict';var multer=require(_0xa74f('0x0'));var util=require(_0xa74f('0x1'));var path=require(_0xa74f('0x2'));var timeout=require(_0xa74f('0x3'));var express=require(_0xa74f('0x4'));var router=express[_0xa74f('0x5')]();var fs_extra=require(_0xa74f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa74f('0x7'));var config=require(_0xa74f('0x8'));var controller=require(_0xa74f('0x9'));router[_0xa74f('0xa')]('/',auth[_0xa74f('0xb')](),controller['index']);router[_0xa74f('0xa')](_0xa74f('0xc'),auth[_0xa74f('0xb')](),controller[_0xa74f('0xd')]);router['get'](_0xa74f('0xe'),auth[_0xa74f('0xb')](),controller[_0xa74f('0xf')]);router[_0xa74f('0xa')](_0xa74f('0x10'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x11')]);router[_0xa74f('0xa')](_0xa74f('0x12'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x13')]);router['get']('/:id/interactions',auth[_0xa74f('0xb')](),controller['getInteractions']);router[_0xa74f('0xa')]('/:id/applications',auth[_0xa74f('0xb')](),controller[_0xa74f('0x14')]);router[_0xa74f('0xa')](_0xa74f('0x15'),auth['isAuthenticated'](),controller[_0xa74f('0x16')]);router['get'](_0xa74f('0x17'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x18')]);router['post']('/',auth[_0xa74f('0xb')](),controller[_0xa74f('0x19')]);router[_0xa74f('0x1a')](_0xa74f('0x10'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x1b')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa74f('0x1c')]);router[_0xa74f('0x1a')](_0xa74f('0x1d'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x1e')]);router[_0xa74f('0x1a')](_0xa74f('0x1f'),auth[_0xa74f('0xb')](),controller['addApplications']);router[_0xa74f('0x1a')](_0xa74f('0x20'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x21')]);router['post'](_0xa74f('0x22'),auth['isAuthenticated'](),controller[_0xa74f('0x23')]);router['post'](_0xa74f('0x24'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x25')]);router['post'](_0xa74f('0x17'),auth['isAuthenticated'](),controller[_0xa74f('0x26')]);router['put'](_0xa74f('0xe'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x27')]);router[_0xa74f('0x28')](_0xa74f('0xe'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x29')]);router[_0xa74f('0x28')](_0xa74f('0x10'),auth['isAuthenticated'](),controller[_0xa74f('0x2a')]);router[_0xa74f('0x28')](_0xa74f('0x12'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x2b')]);router['delete'](_0xa74f('0x17'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 6f42c42..a51b7bb 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 _0xb4da=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x524d5e,_0x269f75){var _0x3a1eca=function(_0x14c736){while(--_0x14c736){_0x524d5e['push'](_0x524d5e['shift']());}};_0x3a1eca(++_0x269f75);}(_0xb4da,0xb2));var _0xab4d=function(_0x916c9b,_0x5bb48e){_0x916c9b=_0x916c9b-0x0;var _0x28b701=_0xb4da[_0x916c9b];return _0x28b701;};'use strict';var Sequelize=require(_0xab4d('0x0'));module[_0xab4d('0x1')]={'priority':{'type':Sequelize[_0xab4d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xab4d('0x3')],'allowNull':![],'defaultValue':_0xab4d('0x4')},'appdata':{'type':Sequelize[_0xab4d('0x5')]()},'description':{'type':Sequelize[_0xab4d('0x3')]},'interval':{'type':Sequelize[_0xab4d('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xfa69=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x66f307,_0x2be928){var _0x422a86=function(_0x508487){while(--_0x508487){_0x66f307['push'](_0x66f307['shift']());}};_0x422a86(++_0x2be928);}(_0xfa69,0x137));var _0x9fa6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfa69[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x9fa6('0x0'));module[_0x9fa6('0x1')]={'priority':{'type':Sequelize[_0x9fa6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9fa6('0x3')],'allowNull':![],'defaultValue':_0x9fa6('0x4')},'appdata':{'type':Sequelize[_0x9fa6('0x5')]()},'description':{'type':Sequelize[_0x9fa6('0x3')]},'interval':{'type':Sequelize[_0x9fa6('0x3')],'defaultValue':_0x9fa6('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b203969..aba2483 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 _0x6050=['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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FaxApplication','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra'];(function(_0x484e47,_0x155a54){var _0x5c6ea5=function(_0x312683){while(--_0x312683){_0x484e47['push'](_0x484e47['shift']());}};_0x5c6ea5(++_0x155a54);}(_0x6050,0x180));var _0x0605=function(_0x5114e5,_0x45c7ec){_0x5114e5=_0x5114e5-0x0;var _0x34a432=_0x6050[_0x5114e5];return _0x34a432;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require('moment');var BPromise=require(_0x0605('0x5'));var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0605('0x8'));var ejs=require(_0x0605('0x9'));var fs=require('fs');var fs_extra=require(_0x0605('0xa'));var _=require(_0x0605('0xb'));var squel=require(_0x0605('0xc'));var crypto=require(_0x0605('0xd'));var jsforce=require(_0x0605('0xe'));var deskjs=require(_0x0605('0xf'));var toCsv=require(_0x0605('0x8'));var querystring=require(_0x0605('0x10'));var Papa=require(_0x0605('0x11'));var Redis=require(_0x0605('0x12'));var authService=require(_0x0605('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0605('0x14'));var hardwareService=require(_0x0605('0x15'));var logger=require(_0x0605('0x16'))(_0x0605('0x17'));var utils=require(_0x0605('0x18'));var config=require(_0x0605('0x19'));var licenseUtil=require(_0x0605('0x1a'));var db=require(_0x0605('0x1b'))['db'];function respondWithStatusCode(_0x2fa563,_0x168a94){_0x168a94=_0x168a94||0xcc;return function(_0x722153){if(_0x722153){return _0x2fa563[_0x0605('0x1c')](_0x168a94);}return _0x2fa563['status'](_0x168a94)[_0x0605('0x1d')]();};}function respondWithResult(_0x11bdc1,_0x1ce32c){_0x1ce32c=_0x1ce32c||0xc8;return function(_0x322ae7){if(_0x322ae7){return _0x11bdc1[_0x0605('0x1e')](_0x1ce32c)[_0x0605('0x1f')](_0x322ae7);}};}function respondWithFilteredResult(_0x4ae1f6,_0x29bed4){return function(_0xeb1d8){if(_0xeb1d8){var _0x125546=typeof _0x29bed4[_0x0605('0x20')]===_0x0605('0x21')&&typeof _0x29bed4[_0x0605('0x22')]==='undefined';var _0x337341=_0xeb1d8[_0x0605('0x23')];var _0x2db7da=_0x125546?0x0:_0x29bed4['offset'];var _0x48dfce=_0x125546?_0xeb1d8[_0x0605('0x23')]:_0x29bed4[_0x0605('0x20')]+_0x29bed4[_0x0605('0x22')];var _0x52ae96;if(_0x48dfce>=_0x337341){_0x48dfce=_0x337341;_0x52ae96=0xc8;}else{_0x52ae96=0xce;}_0x4ae1f6[_0x0605('0x1e')](_0x52ae96);return _0x4ae1f6[_0x0605('0x24')](_0x0605('0x25'),_0x2db7da+'-'+_0x48dfce+'/'+_0x337341)[_0x0605('0x1f')](_0xeb1d8);}return null;};}function patchUpdates(_0x1ac459){return function(_0x367259){try{jsonpatch[_0x0605('0x26')](_0x367259,_0x1ac459,!![]);}catch(_0x383f4a){return BPromise[_0x0605('0x27')](_0x383f4a);}return _0x367259[_0x0605('0x28')]();};}function saveUpdates(_0x3d9a7f,_0x3a5e9b){return function(_0x230ba9){if(_0x230ba9){return _0x230ba9[_0x0605('0x29')](_0x3d9a7f)[_0x0605('0x2a')](function(_0x46493c){return _0x46493c;});}return null;};}function removeEntity(_0x38e3e2,_0x2341ba){return function(_0x14a749){if(_0x14a749){return _0x14a749['destroy']()[_0x0605('0x2a')](function(){_0x38e3e2['status'](0xcc)[_0x0605('0x1d')]();});}};}function handleEntityNotFound(_0x5809d0,_0x29e75c){return function(_0x139305){if(!_0x139305){_0x5809d0[_0x0605('0x1c')](0x194);}return _0x139305;};}function handleError(_0x5d5291,_0x13bafa){_0x13bafa=_0x13bafa||0x1f4;return function(_0x134409){logger[_0x0605('0x2b')](_0x134409[_0x0605('0x2c')]);if(_0x134409[_0x0605('0x2d')]){delete _0x134409[_0x0605('0x2d')];}_0x5d5291[_0x0605('0x1e')](_0x13bafa)[_0x0605('0x2e')](_0x134409);};}exports['index']=function(_0x1f7082,_0x3bce04){var _0xbca611={},_0x5701d4={},_0x3a255b={'count':0x0,'rows':[]};var _0x490d2e=_['map'](db['FaxApplication'][_0x0605('0x2f')],function(_0x352875){return{'name':_0x352875[_0x0605('0x30')],'type':_0x352875['type'][_0x0605('0x31')]};});_0x5701d4[_0x0605('0x32')]=_['map'](_0x490d2e,_0x0605('0x2d'));_0x5701d4[_0x0605('0x33')]=_[_0x0605('0x34')](_0x1f7082[_0x0605('0x33')]);_0x5701d4[_0x0605('0x35')]=_['intersection'](_0x5701d4[_0x0605('0x32')],_0x5701d4['query']);_0xbca611[_0x0605('0x36')]=_[_0x0605('0x37')](_0x5701d4[_0x0605('0x32')],qs['fields'](_0x1f7082[_0x0605('0x33')][_0x0605('0x38')]));_0xbca611[_0x0605('0x36')]=_0xbca611[_0x0605('0x36')][_0x0605('0x39')]?_0xbca611[_0x0605('0x36')]:_0x5701d4[_0x0605('0x32')];if(!_0x1f7082[_0x0605('0x33')][_0x0605('0x3a')](_0x0605('0x3b'))){_0xbca611[_0x0605('0x22')]=qs['limit'](_0x1f7082['query']['limit']);_0xbca611['offset']=qs['offset'](_0x1f7082[_0x0605('0x33')]['offset']);}_0xbca611[_0x0605('0x3c')]=qs[_0x0605('0x3d')](_0x1f7082[_0x0605('0x33')]['sort']);_0xbca611[_0x0605('0x3e')]=qs[_0x0605('0x35')](_[_0x0605('0x3f')](_0x1f7082[_0x0605('0x33')],_0x5701d4[_0x0605('0x35')]),_0x490d2e);if(_0x1f7082['query'][_0x0605('0x40')]){_0xbca611[_0x0605('0x3e')]=_[_0x0605('0x41')](_0xbca611[_0x0605('0x3e')],{'$or':_['map'](_0x490d2e,function(_0x144b26){if(_0x144b26[_0x0605('0x42')]!==_0x0605('0x43')){var _0x12d8b0={};_0x12d8b0[_0x144b26[_0x0605('0x2d')]]={'$like':'%'+_0x1f7082['query'][_0x0605('0x40')]+'%'};return _0x12d8b0;}})});}_0xbca611=_['merge']({},_0xbca611,_0x1f7082[_0x0605('0x44')]);var _0x476fea={'where':_0xbca611[_0x0605('0x3e')]};return db[_0x0605('0x45')][_0x0605('0x23')](_0x476fea)[_0x0605('0x2a')](function(_0x3ee0b1){_0x3a255b[_0x0605('0x23')]=_0x3ee0b1;if(_0x1f7082[_0x0605('0x33')][_0x0605('0x46')]){_0xbca611[_0x0605('0x47')]=[{'all':!![]}];}return db[_0x0605('0x45')][_0x0605('0x48')](_0xbca611);})[_0x0605('0x2a')](function(_0x2a145c){_0x3a255b['rows']=_0x2a145c;return _0x3a255b;})[_0x0605('0x2a')](respondWithFilteredResult(_0x3bce04,_0xbca611))[_0x0605('0x49')](handleError(_0x3bce04,null));};exports[_0x0605('0x4a')]=function(_0x2f518f,_0x79945b){var _0x5d7329={'raw':!![],'where':{'id':_0x2f518f['params']['id']}},_0x3de01a={};_0x3de01a[_0x0605('0x32')]=_['keys'](db[_0x0605('0x45')][_0x0605('0x2f')]);_0x3de01a['query']=_[_0x0605('0x34')](_0x2f518f[_0x0605('0x33')]);_0x3de01a['filters']=_[_0x0605('0x37')](_0x3de01a['model'],_0x3de01a[_0x0605('0x33')]);_0x5d7329['attributes']=_[_0x0605('0x37')](_0x3de01a['model'],qs['fields'](_0x2f518f['query']['fields']));_0x5d7329[_0x0605('0x36')]=_0x5d7329[_0x0605('0x36')][_0x0605('0x39')]?_0x5d7329[_0x0605('0x36')]:_0x3de01a[_0x0605('0x32')];if(_0x2f518f[_0x0605('0x33')][_0x0605('0x46')]){_0x5d7329[_0x0605('0x47')]=[{'all':!![]}];}_0x5d7329=_[_0x0605('0x41')]({},_0x5d7329,_0x2f518f[_0x0605('0x44')]);return db[_0x0605('0x45')][_0x0605('0x4b')](_0x5d7329)[_0x0605('0x2a')](handleEntityNotFound(_0x79945b,null))[_0x0605('0x2a')](respondWithResult(_0x79945b,null))[_0x0605('0x49')](handleError(_0x79945b,null));};exports['create']=function(_0x320223,_0x38719d){return db[_0x0605('0x45')][_0x0605('0x4c')](_0x320223[_0x0605('0x4d')],{})[_0x0605('0x2a')](respondWithResult(_0x38719d,0xc9))[_0x0605('0x49')](handleError(_0x38719d,null));};exports[_0x0605('0x29')]=function(_0x480a16,_0x3e63ae){if(_0x480a16[_0x0605('0x4d')]['id']){delete _0x480a16[_0x0605('0x4d')]['id'];}return db[_0x0605('0x45')][_0x0605('0x4b')]({'where':{'id':_0x480a16[_0x0605('0x4e')]['id']}})[_0x0605('0x2a')](handleEntityNotFound(_0x3e63ae,null))['then'](saveUpdates(_0x480a16[_0x0605('0x4d')],null))[_0x0605('0x2a')](respondWithResult(_0x3e63ae,null))['catch'](handleError(_0x3e63ae,null));};exports['destroy']=function(_0x563d82,_0x32711a){return db[_0x0605('0x45')][_0x0605('0x4b')]({'where':{'id':_0x563d82[_0x0605('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32711a,null))[_0x0605('0x2a')](removeEntity(_0x32711a,null))[_0x0605('0x49')](handleError(_0x32711a,null));}; \ No newline at end of file +var _0x8da9=['create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxApplication','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','show','rawAttributes','catch'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x8da9,0x1ae));var _0x98da=function(_0x435681,_0x5e6a4a){_0x435681=_0x435681-0x0;var _0x157d07=_0x8da9[_0x435681];return _0x157d07;};'use strict';var emlformat=require(_0x98da('0x0'));var rimraf=require(_0x98da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x98da('0x2'));var moment=require(_0x98da('0x3'));var BPromise=require(_0x98da('0x4'));var Mustache=require(_0x98da('0x5'));var util=require(_0x98da('0x6'));var path=require('path');var sox=require(_0x98da('0x7'));var csv=require(_0x98da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98da('0x9'));var squel=require(_0x98da('0xa'));var crypto=require(_0x98da('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x98da('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x98da('0xd'));var Redis=require(_0x98da('0xe'));var authService=require(_0x98da('0xf'));var qs=require(_0x98da('0x10'));var as=require(_0x98da('0x11'));var hardwareService=require(_0x98da('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x98da('0x13'));var config=require(_0x98da('0x14'));var licenseUtil=require(_0x98da('0x15'));var db=require(_0x98da('0x16'))['db'];function respondWithStatusCode(_0x124dcb,_0x1c51aa){_0x1c51aa=_0x1c51aa||0xcc;return function(_0x14eb59){if(_0x14eb59){return _0x124dcb['sendStatus'](_0x1c51aa);}return _0x124dcb[_0x98da('0x17')](_0x1c51aa)[_0x98da('0x18')]();};}function respondWithResult(_0x4ded0d,_0x4bb0b9){_0x4bb0b9=_0x4bb0b9||0xc8;return function(_0x33e616){if(_0x33e616){return _0x4ded0d[_0x98da('0x17')](_0x4bb0b9)['json'](_0x33e616);}};}function respondWithFilteredResult(_0x43b8c8,_0x319558){return function(_0xa851f3){if(_0xa851f3){var _0x251da5=typeof _0x319558['offset']===_0x98da('0x19')&&typeof _0x319558['limit']===_0x98da('0x19');var _0x337a36=_0xa851f3[_0x98da('0x1a')];var _0x4558ec=_0x251da5?0x0:_0x319558[_0x98da('0x1b')];var _0x458cbd=_0x251da5?_0xa851f3['count']:_0x319558[_0x98da('0x1b')]+_0x319558[_0x98da('0x1c')];var _0x503b2a;if(_0x458cbd>=_0x337a36){_0x458cbd=_0x337a36;_0x503b2a=0xc8;}else{_0x503b2a=0xce;}_0x43b8c8[_0x98da('0x17')](_0x503b2a);return _0x43b8c8['set'](_0x98da('0x1d'),_0x4558ec+'-'+_0x458cbd+'/'+_0x337a36)[_0x98da('0x1e')](_0xa851f3);}return null;};}function patchUpdates(_0x42b08e){return function(_0x340b5c){try{jsonpatch[_0x98da('0x1f')](_0x340b5c,_0x42b08e,!![]);}catch(_0x3cbb91){return BPromise['reject'](_0x3cbb91);}return _0x340b5c[_0x98da('0x20')]();};}function saveUpdates(_0x915fda,_0x4ea46d){return function(_0x3a6ad2){if(_0x3a6ad2){return _0x3a6ad2[_0x98da('0x21')](_0x915fda)[_0x98da('0x22')](function(_0x2b2076){return _0x2b2076;});}return null;};}function removeEntity(_0x30cea1,_0x34f3b7){return function(_0x56f7f5){if(_0x56f7f5){return _0x56f7f5[_0x98da('0x23')]()[_0x98da('0x22')](function(){_0x30cea1[_0x98da('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x87cdb5,_0xb3b383){return function(_0x68161){if(!_0x68161){_0x87cdb5[_0x98da('0x24')](0x194);}return _0x68161;};}function handleError(_0x373be1,_0x160277){_0x160277=_0x160277||0x1f4;return function(_0x49c4aa){logger[_0x98da('0x25')](_0x49c4aa[_0x98da('0x26')]);if(_0x49c4aa[_0x98da('0x27')]){delete _0x49c4aa[_0x98da('0x27')];}_0x373be1[_0x98da('0x17')](_0x160277)[_0x98da('0x28')](_0x49c4aa);};}exports[_0x98da('0x29')]=function(_0x4c421d,_0x24139f){var _0x332851={},_0x53d3a6={},_0x6a5144={'count':0x0,'rows':[]};var _0x3d4a37=_['map'](db[_0x98da('0x2a')]['rawAttributes'],function(_0x1a96ad){return{'name':_0x1a96ad['fieldName'],'type':_0x1a96ad[_0x98da('0x2b')][_0x98da('0x2c')]};});_0x53d3a6[_0x98da('0x2d')]=_[_0x98da('0x2e')](_0x3d4a37,_0x98da('0x27'));_0x53d3a6['query']=_[_0x98da('0x2f')](_0x4c421d[_0x98da('0x30')]);_0x53d3a6[_0x98da('0x31')]=_[_0x98da('0x32')](_0x53d3a6[_0x98da('0x2d')],_0x53d3a6[_0x98da('0x30')]);_0x332851[_0x98da('0x33')]=_[_0x98da('0x32')](_0x53d3a6[_0x98da('0x2d')],qs[_0x98da('0x34')](_0x4c421d['query'][_0x98da('0x34')]));_0x332851['attributes']=_0x332851[_0x98da('0x33')][_0x98da('0x35')]?_0x332851[_0x98da('0x33')]:_0x53d3a6['model'];if(!_0x4c421d[_0x98da('0x30')][_0x98da('0x36')]('nolimit')){_0x332851[_0x98da('0x1c')]=qs['limit'](_0x4c421d['query']['limit']);_0x332851['offset']=qs[_0x98da('0x1b')](_0x4c421d[_0x98da('0x30')]['offset']);}_0x332851[_0x98da('0x37')]=qs[_0x98da('0x38')](_0x4c421d[_0x98da('0x30')][_0x98da('0x38')]);_0x332851[_0x98da('0x39')]=qs['filters'](_['pick'](_0x4c421d[_0x98da('0x30')],_0x53d3a6[_0x98da('0x31')]),_0x3d4a37);if(_0x4c421d[_0x98da('0x30')][_0x98da('0x3a')]){_0x332851[_0x98da('0x39')]=_[_0x98da('0x3b')](_0x332851['where'],{'$or':_['map'](_0x3d4a37,function(_0x402e59){if(_0x402e59[_0x98da('0x2b')]!=='VIRTUAL'){var _0x391909={};_0x391909[_0x402e59[_0x98da('0x27')]]={'$like':'%'+_0x4c421d[_0x98da('0x30')][_0x98da('0x3a')]+'%'};return _0x391909;}})});}_0x332851=_[_0x98da('0x3b')]({},_0x332851,_0x4c421d[_0x98da('0x3c')]);var _0x4b2fb3={'where':_0x332851[_0x98da('0x39')]};return db[_0x98da('0x2a')][_0x98da('0x1a')](_0x4b2fb3)[_0x98da('0x22')](function(_0x478a2d){_0x6a5144[_0x98da('0x1a')]=_0x478a2d;if(_0x4c421d[_0x98da('0x30')][_0x98da('0x3d')]){_0x332851[_0x98da('0x3e')]=[{'all':!![]}];}return db[_0x98da('0x2a')][_0x98da('0x3f')](_0x332851);})[_0x98da('0x22')](function(_0xee121a){_0x6a5144['rows']=_0xee121a;return _0x6a5144;})[_0x98da('0x22')](respondWithFilteredResult(_0x24139f,_0x332851))['catch'](handleError(_0x24139f,null));};exports[_0x98da('0x40')]=function(_0x133c62,_0x5dc487){var _0x481245={'raw':!![],'where':{'id':_0x133c62['params']['id']}},_0x8e41eb={};_0x8e41eb['model']=_['keys'](db['FaxApplication'][_0x98da('0x41')]);_0x8e41eb['query']=_[_0x98da('0x2f')](_0x133c62['query']);_0x8e41eb[_0x98da('0x31')]=_[_0x98da('0x32')](_0x8e41eb[_0x98da('0x2d')],_0x8e41eb['query']);_0x481245[_0x98da('0x33')]=_[_0x98da('0x32')](_0x8e41eb[_0x98da('0x2d')],qs[_0x98da('0x34')](_0x133c62[_0x98da('0x30')][_0x98da('0x34')]));_0x481245[_0x98da('0x33')]=_0x481245[_0x98da('0x33')]['length']?_0x481245[_0x98da('0x33')]:_0x8e41eb[_0x98da('0x2d')];if(_0x133c62[_0x98da('0x30')][_0x98da('0x3d')]){_0x481245[_0x98da('0x3e')]=[{'all':!![]}];}_0x481245=_[_0x98da('0x3b')]({},_0x481245,_0x133c62[_0x98da('0x3c')]);return db[_0x98da('0x2a')]['find'](_0x481245)[_0x98da('0x22')](handleEntityNotFound(_0x5dc487,null))[_0x98da('0x22')](respondWithResult(_0x5dc487,null))[_0x98da('0x42')](handleError(_0x5dc487,null));};exports['create']=function(_0x37be2b,_0x191cc6){return db[_0x98da('0x2a')][_0x98da('0x43')](_0x37be2b['body'],{})[_0x98da('0x22')](respondWithResult(_0x191cc6,0xc9))[_0x98da('0x42')](handleError(_0x191cc6,null));};exports[_0x98da('0x21')]=function(_0x1d6c23,_0x40eb7b){if(_0x1d6c23[_0x98da('0x44')]['id']){delete _0x1d6c23[_0x98da('0x44')]['id'];}return db['FaxApplication'][_0x98da('0x45')]({'where':{'id':_0x1d6c23[_0x98da('0x46')]['id']}})[_0x98da('0x22')](handleEntityNotFound(_0x40eb7b,null))[_0x98da('0x22')](saveUpdates(_0x1d6c23['body'],null))[_0x98da('0x22')](respondWithResult(_0x40eb7b,null))[_0x98da('0x42')](handleError(_0x40eb7b,null));};exports[_0x98da('0x23')]=function(_0x54ead6,_0x1fce7){return db[_0x98da('0x2a')][_0x98da('0x45')]({'where':{'id':_0x54ead6[_0x98da('0x46')]['id']}})[_0x98da('0x22')](handleEntityNotFound(_0x1fce7,null))[_0x98da('0x22')](removeEntity(_0x1fce7,null))[_0x98da('0x42')](handleError(_0x1fce7,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index af5c044..45657cc 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 _0x8367=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x37f40e,_0x5c5a1d){var _0x1bab3f=function(_0x3a5eb9){while(--_0x3a5eb9){_0x37f40e['push'](_0x37f40e['shift']());}};_0x1bab3f(++_0x5c5a1d);}(_0x8367,0x193));var _0x7836=function(_0x15ffd5,_0x1bf5de){_0x15ffd5=_0x15ffd5-0x0;var _0x170afa=_0x8367[_0x15ffd5];return _0x170afa;};'use strict';var _=require(_0x7836('0x0'));var util=require(_0x7836('0x1'));var logger=require(_0x7836('0x2'))(_0x7836('0x3'));var moment=require(_0x7836('0x4'));var BPromise=require(_0x7836('0x5'));var rp=require(_0x7836('0x6'));var fs=require('fs');var path=require(_0x7836('0x7'));var rimraf=require(_0x7836('0x8'));var config=require(_0x7836('0x9'));var attributes=require(_0x7836('0xa'));module[_0x7836('0xb')]=function(_0x1e8204,_0x48229b){return _0x1e8204[_0x7836('0xc')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7836('0xd'),'collate':_0x7836('0xe')});}; \ No newline at end of file +var _0xcc8f=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./faxApplication.attributes','define'];(function(_0xc4966b,_0x6cd5e0){var _0x1802bb=function(_0x12f623){while(--_0x12f623){_0xc4966b['push'](_0xc4966b['shift']());}};_0x1802bb(++_0x6cd5e0);}(_0xcc8f,0x1cb));var _0xfcc8=function(_0x50fb12,_0x39c2a3){_0x50fb12=_0x50fb12-0x0;var _0x37c6a2=_0xcc8f[_0x50fb12];return _0x37c6a2;};'use strict';var _=require(_0xfcc8('0x0'));var util=require(_0xfcc8('0x1'));var logger=require(_0xfcc8('0x2'))(_0xfcc8('0x3'));var moment=require('moment');var BPromise=require(_0xfcc8('0x4'));var rp=require(_0xfcc8('0x5'));var fs=require('fs');var path=require(_0xfcc8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfcc8('0x7'));module['exports']=function(_0x5ad357,_0xb50e0d){return _0x5ad357[_0xfcc8('0x8')](_0xfcc8('0x9'),attributes,{'tableName':_0xfcc8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfcc8('0xb'),'collate':_0xfcc8('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 68668c1..73996bb 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 _0x3abc=['body','options','raw','where','attributes','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxApplication','FaxApplication','update'];(function(_0x12e6e5,_0x39855b){var _0x4ef6ce=function(_0x3e06f3){while(--_0x3e06f3){_0x12e6e5['push'](_0x12e6e5['shift']());}};_0x4ef6ce(++_0x39855b);}(_0x3abc,0x1c8));var _0xc3ab=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x3abc[_0x4ea69d];return _0x5318e0;};'use strict';var _=require('lodash');var util=require(_0xc3ab('0x0'));var moment=require('moment');var BPromise=require(_0xc3ab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ab('0x2'));var db=require(_0xc3ab('0x3'))['db'];var utils=require(_0xc3ab('0x4'));var logger=require(_0xc3ab('0x5'))(_0xc3ab('0x6'));var config=require(_0xc3ab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc3ab('0x8')][_0xc3ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2afa96,_0x23b148,_0x534fcf){return new BPromise(function(_0x334b22,_0x21fab1){return client[_0xc3ab('0xa')](_0x2afa96,_0x534fcf)[_0xc3ab('0xb')](function(_0x44bc41){logger[_0xc3ab('0xc')](_0xc3ab('0xd'),_0x23b148,_0xc3ab('0xe'));logger[_0xc3ab('0xf')](_0xc3ab('0x10'),_0x23b148,_0xc3ab('0xe'),JSON[_0xc3ab('0x11')](_0x44bc41));if(_0x44bc41['error']){if(_0x44bc41['error']['code']===0x1f4){logger[_0xc3ab('0x12')](_0xc3ab('0xd'),_0x23b148,_0x44bc41['error']['message']);return _0x21fab1(_0x44bc41[_0xc3ab('0x12')]['message']);}logger[_0xc3ab('0x12')](_0xc3ab('0xd'),_0x23b148,_0x44bc41[_0xc3ab('0x12')][_0xc3ab('0x13')]);return _0x334b22(_0x44bc41[_0xc3ab('0x12')][_0xc3ab('0x13')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x23b148,'request\x20sent');_0x334b22(_0x44bc41['result'][_0xc3ab('0x13')]);}})[_0xc3ab('0x14')](function(_0x3e95b7){logger[_0xc3ab('0x12')](_0xc3ab('0xd'),_0x23b148,_0x3e95b7);_0x21fab1(_0x3e95b7);});});}exports[_0xc3ab('0x15')]=function(_0x563501){var _0x392cfd=this;return new Promise(function(_0x397609,_0x5e0b56){return db[_0xc3ab('0x16')][_0xc3ab('0x17')](_0x563501[_0xc3ab('0x18')],{'raw':_0x563501[_0xc3ab('0x19')]?_0x563501[_0xc3ab('0x19')][_0xc3ab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x563501['options']?_0x563501['options'][_0xc3ab('0x1b')]||null:null,'attributes':_0x563501[_0xc3ab('0x19')]?_0x563501['options'][_0xc3ab('0x1c')]||null:null,'limit':_0x563501['options']?_0x563501['options'][_0xc3ab('0x1d')]||null:null})[_0xc3ab('0xb')](function(_0x56bcc4){logger[_0xc3ab('0xc')](_0xc3ab('0x15'),_0x563501);logger['debug'](_0xc3ab('0x15'),_0x563501,JSON['stringify'](_0x56bcc4));_0x397609(_0x56bcc4);})[_0xc3ab('0x14')](function(_0x225643){logger[_0xc3ab('0x12')]('UpdateFaxApplication',_0x225643[_0xc3ab('0x13')],_0x563501);_0x5e0b56(_0x392cfd['error'](0x1f4,_0x225643['message']));});});}; \ No newline at end of file +var _0x6068=['FaxApplication,\x20%s,\x20%s','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x6068,0x66));var _0x8606=function(_0x3338e3,_0x4b1ab0){_0x3338e3=_0x3338e3-0x0;var _0x5cd9d2=_0x6068[_0x3338e3];return _0x5cd9d2;};'use strict';var _=require(_0x8606('0x0'));var util=require(_0x8606('0x1'));var moment=require(_0x8606('0x2'));var BPromise=require(_0x8606('0x3'));var rs=require(_0x8606('0x4'));var fs=require('fs');var Redis=require(_0x8606('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8606('0x6'));var logger=require(_0x8606('0x7'))(_0x8606('0x8'));var config=require('../../config/environment');var jayson=require(_0x8606('0x9'));var client=jayson[_0x8606('0xa')][_0x8606('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c6e20,_0x2327e2,_0x106957){return new BPromise(function(_0x524049,_0x4350e6){return client[_0x8606('0xc')](_0x1c6e20,_0x106957)[_0x8606('0xd')](function(_0x467899){logger[_0x8606('0xe')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,_0x8606('0xf'));logger[_0x8606('0x10')](_0x8606('0x11'),_0x2327e2,'request\x20sent',JSON[_0x8606('0x12')](_0x467899));if(_0x467899[_0x8606('0x13')]){if(_0x467899[_0x8606('0x13')][_0x8606('0x14')]===0x1f4){logger[_0x8606('0x13')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,_0x467899[_0x8606('0x13')][_0x8606('0x15')]);return _0x4350e6(_0x467899[_0x8606('0x13')]['message']);}logger[_0x8606('0x13')](_0x8606('0x16'),_0x2327e2,_0x467899[_0x8606('0x13')][_0x8606('0x15')]);return _0x524049(_0x467899[_0x8606('0x13')]['message']);}else{logger[_0x8606('0xe')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,'request\x20sent');_0x524049(_0x467899['result']['message']);}})['catch'](function(_0x31902c){logger[_0x8606('0x13')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,_0x31902c);_0x4350e6(_0x31902c);});});}exports[_0x8606('0x17')]=function(_0x240e3b){var _0x2da381=this;return new Promise(function(_0x107648,_0x39ddb7){return db[_0x8606('0x18')][_0x8606('0x19')](_0x240e3b[_0x8606('0x1a')],{'raw':_0x240e3b[_0x8606('0x1b')]?_0x240e3b[_0x8606('0x1b')][_0x8606('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240e3b[_0x8606('0x1b')]?_0x240e3b[_0x8606('0x1b')]['where']||null:null,'attributes':_0x240e3b['options']?_0x240e3b[_0x8606('0x1b')][_0x8606('0x1d')]||null:null,'limit':_0x240e3b[_0x8606('0x1b')]?_0x240e3b[_0x8606('0x1b')]['limit']||null:null})[_0x8606('0xd')](function(_0x52b66){logger[_0x8606('0xe')](_0x8606('0x17'),_0x240e3b);logger[_0x8606('0x10')](_0x8606('0x17'),_0x240e3b,JSON[_0x8606('0x12')](_0x52b66));_0x107648(_0x52b66);})[_0x8606('0x1e')](function(_0x2a9626){logger[_0x8606('0x13')](_0x8606('0x17'),_0x2a9626[_0x8606('0x15')],_0x240e3b);_0x39ddb7(_0x2da381[_0x8606('0x13')](0x1f4,_0x2a9626[_0x8606('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 50e35a3..d5cf6ea 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 _0x9c00=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xde237b,_0x3c2c82){var _0x571a8d=function(_0x1b04b8){while(--_0x1b04b8){_0xde237b['push'](_0xde237b['shift']());}};_0x571a8d(++_0x3c2c82);}(_0x9c00,0x1a0));var _0x09c0=function(_0x385eee,_0x270cca){_0x385eee=_0x385eee-0x0;var _0x41fd49=_0x9c00[_0x385eee];return _0x41fd49;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x09c0('0xd')]);router[_0x09c0('0xe')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xf')]);router[_0x09c0('0x10')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x11')]);module[_0x09c0('0x12')]=router; \ No newline at end of file +var _0x087b=['destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x1a3495,_0x5eb05e){var _0x5045a7=function(_0x52e904){while(--_0x52e904){_0x1a3495['push'](_0x1a3495['shift']());}};_0x5045a7(++_0x5eb05e);}(_0x087b,0x11a));var _0xb087=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x087b[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0xd')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0xf')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x10')]);router[_0xb087('0x11')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);module[_0xb087('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 269b4f9..bc03380 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 _0xf4f4=['out','ENUM','INTEGER','sequelize','exports','DATE','STRING'];(function(_0x1832fc,_0x326340){var _0x2299fd=function(_0x2e9bb4){while(--_0x2e9bb4){_0x1832fc['push'](_0x1832fc['shift']());}};_0x2299fd(++_0x326340);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x2159e6,_0x55c285){_0x2159e6=_0x2159e6-0x0;var _0x355dbb=_0xf4f4[_0x2159e6];return _0x355dbb;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4f4f('0x2')]},'disposition':{'type':Sequelize[_0x4f4f('0x3')]},'secondDisposition':{'type':Sequelize[_0x4f4f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4f4f('0x3')]},'note':{'type':Sequelize[_0x4f4f('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x4f4f('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4f4f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4f4f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x4f4f('0x5')]('in',_0x4f4f('0x4')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x4f4f('0x6')]}}; \ No newline at end of file +var _0x2ef3=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x150fd1,_0x5b314b){var _0x52538a=function(_0x27886e){while(--_0x27886e){_0x150fd1['push'](_0x150fd1['shift']());}};_0x52538a(++_0x5b314b);}(_0x2ef3,0xba));var _0x32ef=function(_0x4520a3,_0x120646){_0x4520a3=_0x4520a3-0x0;var _0x326fdc=_0x2ef3[_0x4520a3];return _0x326fdc;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'closed':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x32ef('0x3')]},'disposition':{'type':Sequelize[_0x32ef('0x4')]},'secondDisposition':{'type':Sequelize[_0x32ef('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x32ef('0x4')]},'read1stAt':{'type':Sequelize[_0x32ef('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x32ef('0x5')]('in',_0x32ef('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x32ef('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x32ef('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 528364e..67bfbd0 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 _0x391f=['then','sendStatus','error','name','map','FaxInteraction','rawAttributes','fieldName','type','getOptions','findAll','user','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','params','destroy','describe','addMessage','ids','omit','findOne','FaxMessage','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','color','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','push','Attachment','Messages','basename','existsSync','createWriteStream','resolve','log','err','moment','bluebird','util','path','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','offset','undefined','limit','count','set','update'];(function(_0x4832eb,_0x2347c5){var _0xbff3f7=function(_0x4d51e0){while(--_0x4d51e0){_0x4832eb['push'](_0x4832eb['shift']());}};_0xbff3f7(++_0x2347c5);}(_0x391f,0xa6));var _0xf391=function(_0x22e758,_0xc45ae4){_0x22e758=_0x22e758-0x0;var _0x20c4a8=_0x391f[_0x22e758];return _0x20c4a8;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xf391('0x0'));var BPromise=require(_0xf391('0x1'));var util=require(_0xf391('0x2'));var path=require(_0xf391('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xf391('0x4'));var qs=require(_0xf391('0x5'));var logger=require('../../config/logger')(_0xf391('0x6'));var config=require(_0xf391('0x7'));var db=require(_0xf391('0x8'))['db'];config[_0xf391('0x9')]=_['defaults'](config[_0xf391('0x9')],{'host':_0xf391('0xa'),'port':0x18eb});var socket=require(_0xf391('0xb'))(new Redis(config[_0xf391('0x9')]));require(_0xf391('0xc'))[_0xf391('0xd')](socket);function respondWithStatusCode(_0x167a34,_0x2f2729){_0x2f2729=_0x2f2729||0xcc;return function(_0x50e6c7){if(_0x50e6c7){return _0x167a34['sendStatus'](_0x2f2729);}return _0x167a34[_0xf391('0xe')](_0x2f2729)[_0xf391('0xf')]();};}function respondWithResult(_0x233d1a,_0x196c62){_0x196c62=_0x196c62||0xc8;return function(_0x4adc4c){if(_0x4adc4c){return _0x233d1a[_0xf391('0xe')](_0x196c62)['json'](_0x4adc4c);}};}function respondWithFilteredResult(_0x2901d4,_0x197d7b){return function(_0x4ba146){if(_0x4ba146){var _0x4fe573=typeof _0x197d7b[_0xf391('0x10')]===_0xf391('0x11')&&typeof _0x197d7b[_0xf391('0x12')]==='undefined';var _0x2c31e3=_0x4ba146[_0xf391('0x13')];var _0x5748fd=_0x4fe573?0x0:_0x197d7b[_0xf391('0x10')];var _0x2f9f33=_0x4fe573?_0x4ba146[_0xf391('0x13')]:_0x197d7b[_0xf391('0x10')]+_0x197d7b[_0xf391('0x12')];var _0x192fc9;if(_0x2f9f33>=_0x2c31e3){_0x2f9f33=_0x2c31e3;_0x192fc9=0xc8;}else{_0x192fc9=0xce;}_0x2901d4[_0xf391('0xe')](_0x192fc9);return _0x2901d4[_0xf391('0x14')]('Content-Range',_0x5748fd+'-'+_0x2f9f33+'/'+_0x2c31e3)['json'](_0x4ba146);}return null;};}function saveUpdates(_0x378692){return function(_0x5bb5b1){if(_0x5bb5b1){return _0x5bb5b1[_0xf391('0x15')](_0x378692)[_0xf391('0x16')](function(_0x446178){return _0x446178;});}return null;};}function removeEntity(_0x138c68){return function(_0x552b75){if(_0x552b75){return _0x552b75['destroy']()[_0xf391('0x16')](function(){_0x138c68['status'](0xcc)[_0xf391('0xf')]();});}};}function handleEntityNotFound(_0x4b04a9){return function(_0x4ab52f){if(!_0x4ab52f){_0x4b04a9[_0xf391('0x17')](0x194);}return _0x4ab52f;};}function handleError(_0x25765d,_0x249d64){_0x249d64=_0x249d64||0x1f4;return function(_0x3223d9){logger[_0xf391('0x18')](_0x3223d9['stack']);if(_0x3223d9[_0xf391('0x19')]){delete _0x3223d9[_0xf391('0x19')];}_0x25765d['status'](_0x249d64)['send'](_0x3223d9);};}exports['index']=function(_0x475489,_0x5b711d){var _0x513588={};var _0x3d2c20=_[_0xf391('0x1a')](db[_0xf391('0x1b')][_0xf391('0x1c')],function(_0x16e1a4){return{'name':_0x16e1a4[_0xf391('0x1d')],'type':_0x16e1a4[_0xf391('0x1e')]['key']};});_0x513588=qs[_0xf391('0x1f')](_0x3d2c20,_0x475489);return interaction[_0xf391('0x20')]('fax',_0x475489['query'],_0x475489[_0xf391('0x21')],_0x513588,_0x3d2c20)['then'](respondWithFilteredResult(_0x5b711d,_0x513588))['catch'](handleError(_0x5b711d,null));};exports[_0xf391('0x22')]=function(_0x23dcba,_0x51eca6){var _0x308a1e={'raw':![],'where':{'id':_0x23dcba['params']['id']}},_0x1288df={};_0x1288df['model']=_[_0xf391('0x23')](db[_0xf391('0x1b')][_0xf391('0x1c')]);_0x1288df[_0xf391('0x24')]=_[_0xf391('0x23')](_0x23dcba['query']);_0x1288df[_0xf391('0x25')]=_[_0xf391('0x26')](_0x1288df[_0xf391('0x27')],_0x1288df[_0xf391('0x24')]);_0x308a1e[_0xf391('0x28')]=_['intersection'](_0x1288df['model'],qs[_0xf391('0x29')](_0x23dcba[_0xf391('0x24')][_0xf391('0x29')]));_0x308a1e['attributes']=_0x308a1e['attributes'][_0xf391('0x2a')]?_0x308a1e['attributes']:_0x1288df[_0xf391('0x27')];if(_0x23dcba[_0xf391('0x24')][_0xf391('0x2b')]){_0x308a1e[_0xf391('0x2c')]=[{'all':!![]}];}_0x308a1e=_[_0xf391('0x2d')]({},_0x308a1e,_0x23dcba[_0xf391('0x2e')]);return db[_0xf391('0x1b')][_0xf391('0x2f')](_0x308a1e)[_0xf391('0x16')](handleEntityNotFound(_0x51eca6,null))['then'](respondWithResult(_0x51eca6,null))[_0xf391('0x30')](handleError(_0x51eca6,null));};exports[_0xf391('0x31')]=function(_0x34d55f,_0x59119b){return db[_0xf391('0x1b')][_0xf391('0x31')](_0x34d55f['body'],{})[_0xf391('0x16')](respondWithResult(_0x59119b,0xc9))['catch'](handleError(_0x59119b,null));};exports['update']=function(_0x1c257a,_0x4f57d6){if(_0x1c257a[_0xf391('0x32')]['id']){delete _0x1c257a['body']['id'];}return db[_0xf391('0x1b')][_0xf391('0x2f')]({'where':{'id':_0x1c257a[_0xf391('0x33')]['id']}})[_0xf391('0x16')](handleEntityNotFound(_0x4f57d6,null))[_0xf391('0x16')](saveUpdates(_0x1c257a['body'],null))['then'](respondWithResult(_0x4f57d6,null))[_0xf391('0x30')](handleError(_0x4f57d6,null));};exports[_0xf391('0x34')]=function(_0x1dbdd4,_0x25303e){return db[_0xf391('0x1b')][_0xf391('0x2f')]({'where':{'id':_0x1dbdd4[_0xf391('0x33')]['id']}})[_0xf391('0x16')](handleEntityNotFound(_0x25303e,null))['then'](removeEntity(_0x25303e,null))[_0xf391('0x30')](handleError(_0x25303e,null));};exports[_0xf391('0x35')]=function(_0x8aa73f,_0x568c24){return db[_0xf391('0x1b')]['describe']()[_0xf391('0x16')](respondWithResult(_0x568c24,null))[_0xf391('0x30')](handleError(_0x568c24,null));};exports[_0xf391('0x36')]=function(_0x43d7a9,_0x583378){return db['FaxMessage'][_0xf391('0x2f')]({'where':{'id':_0x43d7a9[_0xf391('0x33')]['id']}})[_0xf391('0x16')](handleEntityNotFound(_0x583378,null))[_0xf391('0x16')](function(_0x285a05){if(_0x285a05){return _0x285a05[_0xf391('0x36')](_0x43d7a9[_0xf391('0x32')][_0xf391('0x37')],_[_0xf391('0x38')](_0x43d7a9['body'],[_0xf391('0x37'),'id'])||{});}})['then'](respondWithResult(_0x583378,null))[_0xf391('0x30')](handleError(_0x583378,null));};exports['getMessages']=function(_0x45e6af,_0x4b2034){var _0x28f5e8={'raw':![],'where':{}};var _0x2f1eec={};var _0x5a2ae1={'count':0x0,'rows':[]};return db[_0xf391('0x1b')][_0xf391('0x39')]({'where':{'id':_0x45e6af['params']['id']}})[_0xf391('0x16')](handleEntityNotFound(_0x4b2034,null))[_0xf391('0x16')](function(_0x4b6b24){if(_0x4b6b24){_0x2f1eec[_0xf391('0x27')]=_['keys'](db[_0xf391('0x3a')][_0xf391('0x1c')]);_0x2f1eec[_0xf391('0x24')]=_['keys'](_0x45e6af['query']);_0x2f1eec[_0xf391('0x25')]=_['intersection'](_0x2f1eec[_0xf391('0x27')],_0x2f1eec[_0xf391('0x24')]);_0x28f5e8[_0xf391('0x28')]=_['intersection'](_0x2f1eec[_0xf391('0x27')],qs[_0xf391('0x29')](_0x45e6af[_0xf391('0x24')]['fields']));_0x28f5e8[_0xf391('0x28')]=_0x28f5e8[_0xf391('0x28')][_0xf391('0x2a')]?_0x28f5e8[_0xf391('0x28')]:_0x2f1eec['model'];if(!_0x45e6af[_0xf391('0x24')]['hasOwnProperty'](_0xf391('0x3b'))){_0x28f5e8[_0xf391('0x12')]=qs['limit'](_0x45e6af[_0xf391('0x24')]['limit']);_0x28f5e8[_0xf391('0x10')]=qs[_0xf391('0x10')](_0x45e6af[_0xf391('0x24')]['offset']);}_0x28f5e8[_0xf391('0x3c')]=qs[_0xf391('0x3d')](_0x45e6af[_0xf391('0x24')]['sort']);_0x28f5e8[_0xf391('0x3e')]=qs[_0xf391('0x25')](_[_0xf391('0x3f')](_0x45e6af['query'],_0x2f1eec['filters']));_0x28f5e8[_0xf391('0x3e')][_0xf391('0x40')]=_0x4b6b24['id'];if(_0x45e6af[_0xf391('0x24')][_0xf391('0x41')]){_0x28f5e8[_0xf391('0x3e')]=_['merge'](_0x28f5e8[_0xf391('0x3e')],{'$or':_[_0xf391('0x1a')](_0x28f5e8['attributes'],function(_0x30c2b1){var _0xdf35a2={};_0xdf35a2[_0x30c2b1]={'$like':'%'+_0x45e6af['query'][_0xf391('0x41')]+'%'};return _0xdf35a2;})});}if(_0x45e6af[_0xf391('0x24')][_0xf391('0x42')]){var _0x83caa3=_0x45e6af[_0xf391('0x24')][_0xf391('0x42')][_0xf391('0x43')](',');var _0x4dec59={};_0x4dec59[_0x83caa3[0x0]]={'$gte':moment(_0x83caa3[0x1])[_0xf391('0x44')](_0xf391('0x45'))};_0x28f5e8['where']=_[_0xf391('0x2d')](_0x28f5e8['where'],_0x4dec59);}_0x28f5e8=_[_0xf391('0x2d')]({},_0x28f5e8,_0x45e6af[_0xf391('0x2e')]);return db[_0xf391('0x3a')][_0xf391('0x13')]({'where':_0x28f5e8[_0xf391('0x3e')]})[_0xf391('0x16')](function(_0x23e00b){_0x5a2ae1[_0xf391('0x13')]=_0x23e00b;if(_0x45e6af[_0xf391('0x24')][_0xf391('0x2b')]){_0x28f5e8[_0xf391('0x2c')]=[{'all':!![]}];}return db[_0xf391('0x3a')]['findAll'](_0x28f5e8);})[_0xf391('0x16')](function(_0x31c98f){_0x5a2ae1['rows']=_0x31c98f;return _0x5a2ae1;});}})[_0xf391('0x16')](respondWithFilteredResult(_0x4b2034,_0x28f5e8))[_0xf391('0x30')](handleError(_0x4b2034,null));};exports[_0xf391('0x46')]=function(_0x44e598,_0x93c521){return db[_0xf391('0x1b')]['find']({'where':{'id':_0x44e598[_0xf391('0x33')]['id']}})[_0xf391('0x16')](handleEntityNotFound(_0x93c521,null))['then'](function(_0x5bc4a6){if(_0x5bc4a6){return _0x5bc4a6[_0xf391('0x47')](_0x44e598[_0xf391('0x32')][_0xf391('0x37')],_[_0xf391('0x38')](_0x44e598['body'],[_0xf391('0x37'),'id'])||{})[_0xf391('0x48')](function(){return db['Tag'][_0xf391('0x20')]({'attributes':['id',_0xf391('0x19'),_0xf391('0x49')],'where':{'id':_0x44e598[_0xf391('0x32')][_0xf391('0x37')]}});})[_0xf391('0x16')](function(_0x58ed33){socket['emit'](_0xf391('0x4a'),{'id':Number(_0x44e598[_0xf391('0x33')]['id']),'tags':_0x58ed33||[]});return{'id':Number(_0x44e598['params']['id']),'tags':_0x58ed33||[]};});}})[_0xf391('0x16')](respondWithResult(_0x93c521,null))[_0xf391('0x30')](handleError(_0x93c521,null));};exports[_0xf391('0x4b')]=function(_0x54587a,_0x49bf85){return db['FaxInteraction'][_0xf391('0x2f')]({'where':{'id':_0x54587a[_0xf391('0x33')]['id']}})['then'](handleEntityNotFound(_0x49bf85,null))['then'](function(_0x3681cc){if(_0x3681cc){return _0x3681cc[_0xf391('0x4b')](_0x54587a[_0xf391('0x24')][_0xf391('0x37')]);}})['then'](respondWithStatusCode(_0x49bf85,null))[_0xf391('0x30')](handleError(_0x49bf85,null));};exports[_0xf391('0x4c')]=function(_0x4e6e82,_0x3f0cf7){var _0x492b16=moment()[_0xf391('0x4d')]()[_0xf391('0x4e')]();var _0x42201b=path[_0xf391('0x4f')](config[_0xf391('0x50')],_0xf391('0x51'),_0xf391('0x52'),_0xf391('0x53'));var _0x479bb8=path[_0xf391('0x4f')](config[_0xf391('0x50')],'server','files',_0xf391('0x54'));var _0x3d169c=path['join'](_0x42201b,_0x492b16);var _0x1a5a09=util['format']('transcript-%d-%s.zip',_0x4e6e82[_0xf391('0x33')]['id'],_0x492b16);var _0x50593a=path['join'](_0x42201b,_0x1a5a09);var _0x21c35f=[];_0x21c35f[_0xf391('0x55')]({'model':db['Attachment'],'as':_0xf391('0x56'),'raw':!![]});var _0x45a5e0=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xf391('0x32'),'createdAt'],'include':_0x21c35f}];return db['FaxInteraction'][_0xf391('0x2f')]({'where':{'id':_0x4e6e82[_0xf391('0x33')]['id']},'include':_0x45a5e0})[_0xf391('0x16')](handleEntityNotFound(_0x3f0cf7,null))[_0xf391('0x16')](function(_0x881cd2){if(_0x881cd2&&_0x881cd2[_0xf391('0x57')]){var _0xab531b=_0x881cd2['get']({'plain':!![]});fs['mkdirSync'](_0x3d169c);for(var _0x4e1334=0x0;_0x4e1334<_0xab531b[_0xf391('0x57')]['length'];_0x4e1334++){var _0x5b19bb=_0xab531b['Messages'][_0x4e1334]['Attachment'];if(_0x5b19bb){var _0x2fa543=path[_0xf391('0x4f')](_0x479bb8,_0x5b19bb[_0xf391('0x58')]);if(fs[_0xf391('0x59')](_0x2fa543)){fs['createReadStream'](_0x2fa543)['pipe'](fs[_0xf391('0x5a')](path[_0xf391('0x4f')](_0x3d169c,_0x5b19bb[_0xf391('0x58')])));}}}return BPromise[_0xf391('0x5b')]()['then'](function(){return new BPromise(function(_0x464724,_0x59a5bb){zipdir(_0x3d169c,{'saveTo':_0x50593a},function(_0x171f79,_0x8e45f3){if(_0x171f79)return _0x59a5bb(_0x171f79);return _0x464724(_0x8e45f3);});})[_0xf391('0x16')](function(){return new BPromise(function(_0x588a2e,_0x2e1387){rimraf(_0x3d169c,function(_0x919ef3){if(_0x919ef3)_0x2e1387(_0x919ef3);return _0x588a2e();});});})[_0xf391('0x16')](function(){return _0x3f0cf7[_0xf391('0x4c')](_0x50593a,_0x1a5a09,function(_0x2d3985){if(_0x2d3985){console[_0xf391('0x5c')](_0xf391('0x5d'),_0x2d3985);}else{fs['unlinkSync'](_0x50593a);}});});});}else{return _0x3f0cf7[_0xf391('0x17')](0xc8);}})[_0xf391('0x30')](handleError(_0x3f0cf7,null));}; \ No newline at end of file +var _0xaa11=['index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','fax','user','catch','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','include','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','filters','pick','FaxInteractionId','filter','where','$gte','split','merge','options','findAll','rows','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ioredis','../../components/interaction/service','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','update','then','destroy','end','error','name','send'];(function(_0x2ac1ee,_0x5e87eb){var _0x3f164b=function(_0x520d24){while(--_0x520d24){_0x2ac1ee['push'](_0x2ac1ee['shift']());}};_0x3f164b(++_0x5e87eb);}(_0xaa11,0x17f));var _0x1aa1=function(_0x143b68,_0x31a28b){_0x143b68=_0x143b68-0x0;var _0x58524d=_0xaa11[_0x143b68];return _0x58524d;};'use strict';var rimraf=require(_0x1aa1('0x0'));var zipdir=require(_0x1aa1('0x1'));var moment=require(_0x1aa1('0x2'));var BPromise=require(_0x1aa1('0x3'));var util=require(_0x1aa1('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x1aa1('0x5'));var interaction=require(_0x1aa1('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x1aa1('0x7'))('api');var config=require('../../config/environment');var db=require(_0x1aa1('0x8'))['db'];config[_0x1aa1('0x9')]=_[_0x1aa1('0xa')](config['redis'],{'host':_0x1aa1('0xb'),'port':0x18eb});var socket=require(_0x1aa1('0xc'))(new Redis(config[_0x1aa1('0x9')]));require('./faxInteraction.socket')[_0x1aa1('0xd')](socket);function respondWithStatusCode(_0x252daa,_0xc670e9){_0xc670e9=_0xc670e9||0xcc;return function(_0x15277f){if(_0x15277f){return _0x252daa[_0x1aa1('0xe')](_0xc670e9);}return _0x252daa[_0x1aa1('0xf')](_0xc670e9)['end']();};}function respondWithResult(_0x238b12,_0x5d9593){_0x5d9593=_0x5d9593||0xc8;return function(_0xcf8f7f){if(_0xcf8f7f){return _0x238b12[_0x1aa1('0xf')](_0x5d9593)[_0x1aa1('0x10')](_0xcf8f7f);}};}function respondWithFilteredResult(_0x407b8d,_0x1c1f2d){return function(_0x280617){if(_0x280617){var _0x49acc3=typeof _0x1c1f2d['offset']===_0x1aa1('0x11')&&typeof _0x1c1f2d[_0x1aa1('0x12')]===_0x1aa1('0x11');var _0x1621bc=_0x280617[_0x1aa1('0x13')];var _0x21ece3=_0x49acc3?0x0:_0x1c1f2d[_0x1aa1('0x14')];var _0xd80d78=_0x49acc3?_0x280617[_0x1aa1('0x13')]:_0x1c1f2d[_0x1aa1('0x14')]+_0x1c1f2d[_0x1aa1('0x12')];var _0x3e59c7;if(_0xd80d78>=_0x1621bc){_0xd80d78=_0x1621bc;_0x3e59c7=0xc8;}else{_0x3e59c7=0xce;}_0x407b8d['status'](_0x3e59c7);return _0x407b8d[_0x1aa1('0x15')]('Content-Range',_0x21ece3+'-'+_0xd80d78+'/'+_0x1621bc)[_0x1aa1('0x10')](_0x280617);}return null;};}function saveUpdates(_0x2719bb){return function(_0x21c39b){if(_0x21c39b){return _0x21c39b[_0x1aa1('0x16')](_0x2719bb)[_0x1aa1('0x17')](function(_0x5dc8f6){return _0x5dc8f6;});}return null;};}function removeEntity(_0x5d84d3){return function(_0x46686f){if(_0x46686f){return _0x46686f[_0x1aa1('0x18')]()[_0x1aa1('0x17')](function(){_0x5d84d3['status'](0xcc)[_0x1aa1('0x19')]();});}};}function handleEntityNotFound(_0x27dae6){return function(_0x3a49a3){if(!_0x3a49a3){_0x27dae6[_0x1aa1('0xe')](0x194);}return _0x3a49a3;};}function handleError(_0x786758,_0x5cdec4){_0x5cdec4=_0x5cdec4||0x1f4;return function(_0x2275bf){logger[_0x1aa1('0x1a')](_0x2275bf['stack']);if(_0x2275bf[_0x1aa1('0x1b')]){delete _0x2275bf[_0x1aa1('0x1b')];}_0x786758[_0x1aa1('0xf')](_0x5cdec4)[_0x1aa1('0x1c')](_0x2275bf);};}exports[_0x1aa1('0x1d')]=function(_0x33487b,_0x3d9d25){var _0x559f3b={};var _0x18b158=_[_0x1aa1('0x1e')](db[_0x1aa1('0x1f')][_0x1aa1('0x20')],function(_0x483e8b){return{'name':_0x483e8b[_0x1aa1('0x21')],'type':_0x483e8b['type'][_0x1aa1('0x22')]};});_0x559f3b=qs[_0x1aa1('0x23')](_0x18b158,_0x33487b);return interaction['findAll'](_0x1aa1('0x24'),_0x33487b['query'],_0x33487b[_0x1aa1('0x25')],_0x559f3b,_0x18b158)[_0x1aa1('0x17')](respondWithFilteredResult(_0x3d9d25,_0x559f3b))[_0x1aa1('0x26')](handleError(_0x3d9d25,null));};exports[_0x1aa1('0x27')]=function(_0x13e255,_0x5ceec6){var _0x562310={'raw':![],'where':{'id':_0x13e255[_0x1aa1('0x28')]['id']}},_0x11dccb={};_0x11dccb[_0x1aa1('0x29')]=_[_0x1aa1('0x2a')](db[_0x1aa1('0x1f')][_0x1aa1('0x20')]);_0x11dccb[_0x1aa1('0x2b')]=_[_0x1aa1('0x2a')](_0x13e255[_0x1aa1('0x2b')]);_0x11dccb['filters']=_[_0x1aa1('0x2c')](_0x11dccb[_0x1aa1('0x29')],_0x11dccb[_0x1aa1('0x2b')]);_0x562310[_0x1aa1('0x2d')]=_[_0x1aa1('0x2c')](_0x11dccb[_0x1aa1('0x29')],qs[_0x1aa1('0x2e')](_0x13e255['query']['fields']));_0x562310[_0x1aa1('0x2d')]=_0x562310[_0x1aa1('0x2d')][_0x1aa1('0x2f')]?_0x562310[_0x1aa1('0x2d')]:_0x11dccb['model'];if(_0x13e255[_0x1aa1('0x2b')][_0x1aa1('0x30')]){_0x562310[_0x1aa1('0x31')]=[{'all':!![]}];}_0x562310=_['merge']({},_0x562310,_0x13e255['options']);return db[_0x1aa1('0x1f')][_0x1aa1('0x32')](_0x562310)['then'](handleEntityNotFound(_0x5ceec6,null))[_0x1aa1('0x17')](respondWithResult(_0x5ceec6,null))[_0x1aa1('0x26')](handleError(_0x5ceec6,null));};exports[_0x1aa1('0x33')]=function(_0x49c76c,_0x5696cc){return db['FaxInteraction'][_0x1aa1('0x33')](_0x49c76c[_0x1aa1('0x34')],{})['then'](respondWithResult(_0x5696cc,0xc9))[_0x1aa1('0x26')](handleError(_0x5696cc,null));};exports[_0x1aa1('0x16')]=function(_0x3e9813,_0x21b0e7){if(_0x3e9813[_0x1aa1('0x34')]['id']){delete _0x3e9813[_0x1aa1('0x34')]['id'];}return db[_0x1aa1('0x1f')]['find']({'where':{'id':_0x3e9813['params']['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x21b0e7,null))['then'](saveUpdates(_0x3e9813[_0x1aa1('0x34')],null))[_0x1aa1('0x17')](respondWithResult(_0x21b0e7,null))[_0x1aa1('0x26')](handleError(_0x21b0e7,null));};exports[_0x1aa1('0x18')]=function(_0x4ec997,_0x357345){return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x4ec997[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x357345,null))[_0x1aa1('0x17')](removeEntity(_0x357345,null))['catch'](handleError(_0x357345,null));};exports['describe']=function(_0x14d1ed,_0x18fb5f){return db[_0x1aa1('0x1f')][_0x1aa1('0x35')]()['then'](respondWithResult(_0x18fb5f,null))[_0x1aa1('0x26')](handleError(_0x18fb5f,null));};exports[_0x1aa1('0x36')]=function(_0x35f744,_0x24d489){return db[_0x1aa1('0x37')][_0x1aa1('0x32')]({'where':{'id':_0x35f744[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x24d489,null))['then'](function(_0x6279bb){if(_0x6279bb){return _0x6279bb[_0x1aa1('0x36')](_0x35f744[_0x1aa1('0x34')][_0x1aa1('0x38')],_[_0x1aa1('0x39')](_0x35f744[_0x1aa1('0x34')],[_0x1aa1('0x38'),'id'])||{});}})['then'](respondWithResult(_0x24d489,null))[_0x1aa1('0x26')](handleError(_0x24d489,null));};exports[_0x1aa1('0x3a')]=function(_0x2cd0ce,_0x25e7bf){var _0x4277f4={'raw':![],'where':{}};var _0x46a036={};var _0x478f7d={'count':0x0,'rows':[]};return db[_0x1aa1('0x1f')][_0x1aa1('0x3b')]({'where':{'id':_0x2cd0ce[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x25e7bf,null))['then'](function(_0x40597b){if(_0x40597b){_0x46a036[_0x1aa1('0x29')]=_['keys'](db[_0x1aa1('0x37')]['rawAttributes']);_0x46a036[_0x1aa1('0x2b')]=_['keys'](_0x2cd0ce[_0x1aa1('0x2b')]);_0x46a036['filters']=_['intersection'](_0x46a036[_0x1aa1('0x29')],_0x46a036[_0x1aa1('0x2b')]);_0x4277f4['attributes']=_[_0x1aa1('0x2c')](_0x46a036[_0x1aa1('0x29')],qs[_0x1aa1('0x2e')](_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x2e')]));_0x4277f4[_0x1aa1('0x2d')]=_0x4277f4[_0x1aa1('0x2d')][_0x1aa1('0x2f')]?_0x4277f4[_0x1aa1('0x2d')]:_0x46a036['model'];if(!_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x3c')]('nolimit')){_0x4277f4[_0x1aa1('0x12')]=qs[_0x1aa1('0x12')](_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x12')]);_0x4277f4[_0x1aa1('0x14')]=qs['offset'](_0x2cd0ce['query'][_0x1aa1('0x14')]);}_0x4277f4[_0x1aa1('0x3d')]=qs[_0x1aa1('0x3e')](_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x3e')]);_0x4277f4['where']=qs[_0x1aa1('0x3f')](_[_0x1aa1('0x40')](_0x2cd0ce[_0x1aa1('0x2b')],_0x46a036[_0x1aa1('0x3f')]));_0x4277f4['where'][_0x1aa1('0x41')]=_0x40597b['id'];if(_0x2cd0ce['query'][_0x1aa1('0x42')]){_0x4277f4[_0x1aa1('0x43')]=_['merge'](_0x4277f4['where'],{'$or':_['map'](_0x4277f4['attributes'],function(_0x317633){var _0x5d7e9d={};_0x5d7e9d[_0x317633]={'$like':'%'+_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x42')]+'%'};return _0x5d7e9d;})});}if(_0x2cd0ce['query'][_0x1aa1('0x44')]){var _0x2452f8=_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x44')][_0x1aa1('0x45')](',');var _0x3f6ad3={};_0x3f6ad3[_0x2452f8[0x0]]={'$gte':moment(_0x2452f8[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4277f4[_0x1aa1('0x43')]=_[_0x1aa1('0x46')](_0x4277f4[_0x1aa1('0x43')],_0x3f6ad3);}_0x4277f4=_['merge']({},_0x4277f4,_0x2cd0ce[_0x1aa1('0x47')]);return db['FaxMessage'][_0x1aa1('0x13')]({'where':_0x4277f4[_0x1aa1('0x43')]})['then'](function(_0x5773d1){_0x478f7d[_0x1aa1('0x13')]=_0x5773d1;if(_0x2cd0ce[_0x1aa1('0x2b')]['includeAll']){_0x4277f4[_0x1aa1('0x31')]=[{'all':!![]}];}return db[_0x1aa1('0x37')][_0x1aa1('0x48')](_0x4277f4);})['then'](function(_0x376458){_0x478f7d[_0x1aa1('0x49')]=_0x376458;return _0x478f7d;});}})['then'](respondWithFilteredResult(_0x25e7bf,_0x4277f4))[_0x1aa1('0x26')](handleError(_0x25e7bf,null));};exports['addTags']=function(_0x4214eb,_0x356d4b){return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x4214eb[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x356d4b,null))[_0x1aa1('0x17')](function(_0x27cabe){if(_0x27cabe){return _0x27cabe[_0x1aa1('0x4a')](_0x4214eb[_0x1aa1('0x34')][_0x1aa1('0x38')],_[_0x1aa1('0x39')](_0x4214eb['body'],[_0x1aa1('0x38'),'id'])||{})[_0x1aa1('0x4b')](function(){return db[_0x1aa1('0x4c')][_0x1aa1('0x48')]({'attributes':['id',_0x1aa1('0x1b'),_0x1aa1('0x4d')],'where':{'id':_0x4214eb[_0x1aa1('0x34')][_0x1aa1('0x38')]}});})['then'](function(_0xfe5377){socket[_0x1aa1('0x4e')](_0x1aa1('0x4f'),{'id':Number(_0x4214eb[_0x1aa1('0x28')]['id']),'tags':_0xfe5377||[]});return{'id':Number(_0x4214eb[_0x1aa1('0x28')]['id']),'tags':_0xfe5377||[]};});}})['then'](respondWithResult(_0x356d4b,null))['catch'](handleError(_0x356d4b,null));};exports['removeTags']=function(_0x3ceb2a,_0x106e54){return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x3ceb2a[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x106e54,null))[_0x1aa1('0x17')](function(_0x4b07af){if(_0x4b07af){return _0x4b07af[_0x1aa1('0x50')](_0x3ceb2a['query'][_0x1aa1('0x38')]);}})[_0x1aa1('0x17')](respondWithStatusCode(_0x106e54,null))[_0x1aa1('0x26')](handleError(_0x106e54,null));};exports[_0x1aa1('0x51')]=function(_0x3cc834,_0x26c1a2){var _0x38161c=moment()[_0x1aa1('0x52')]()[_0x1aa1('0x53')]();var _0x1f5eb8=path[_0x1aa1('0x54')](config[_0x1aa1('0x55')],_0x1aa1('0x56'),_0x1aa1('0x57'),'tmp');var _0x366cf2=path[_0x1aa1('0x54')](config[_0x1aa1('0x55')],'server',_0x1aa1('0x57'),_0x1aa1('0x58'));var _0x3e3820=path[_0x1aa1('0x54')](_0x1f5eb8,_0x38161c);var _0x2023b3=util[_0x1aa1('0x59')](_0x1aa1('0x5a'),_0x3cc834['params']['id'],_0x38161c);var _0x369414=path[_0x1aa1('0x54')](_0x1f5eb8,_0x2023b3);var _0x34c2a1=[];_0x34c2a1[_0x1aa1('0x5b')]({'model':db[_0x1aa1('0x5c')],'as':'Attachment','raw':!![]});var _0x164db7=[{'model':db[_0x1aa1('0x37')],'as':_0x1aa1('0x5d'),'attributes':['id',_0x1aa1('0x34'),_0x1aa1('0x5e')],'include':_0x34c2a1}];return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x3cc834['params']['id']},'include':_0x164db7})[_0x1aa1('0x17')](handleEntityNotFound(_0x26c1a2,null))[_0x1aa1('0x17')](function(_0x31e0b8){if(_0x31e0b8&&_0x31e0b8[_0x1aa1('0x5d')]){var _0x3a946d=_0x31e0b8[_0x1aa1('0x5f')]({'plain':!![]});fs[_0x1aa1('0x60')](_0x3e3820);for(var _0x48e94a=0x0;_0x48e94a<_0x3a946d['Messages']['length'];_0x48e94a++){var _0x40b57e=_0x3a946d[_0x1aa1('0x5d')][_0x48e94a]['Attachment'];if(_0x40b57e){var _0x2d40f7=path[_0x1aa1('0x54')](_0x366cf2,_0x40b57e[_0x1aa1('0x61')]);if(fs[_0x1aa1('0x62')](_0x2d40f7)){fs[_0x1aa1('0x63')](_0x2d40f7)['pipe'](fs['createWriteStream'](path[_0x1aa1('0x54')](_0x3e3820,_0x40b57e[_0x1aa1('0x61')])));}}}return BPromise['resolve']()[_0x1aa1('0x17')](function(){return new BPromise(function(_0x10e2bd,_0x24ddc3){zipdir(_0x3e3820,{'saveTo':_0x369414},function(_0xc08798,_0x5f1175){if(_0xc08798)return _0x24ddc3(_0xc08798);return _0x10e2bd(_0x5f1175);});})[_0x1aa1('0x17')](function(){return new BPromise(function(_0xf678ba,_0x5a2224){rimraf(_0x3e3820,function(_0x3ef5e5){if(_0x3ef5e5)_0x5a2224(_0x3ef5e5);return _0xf678ba();});});})[_0x1aa1('0x17')](function(){return _0x26c1a2['download'](_0x369414,_0x2023b3,function(_0x3b2ce5){if(_0x3b2ce5){console[_0x1aa1('0x64')](_0x1aa1('0x65'),_0x3b2ce5);}else{fs[_0x1aa1('0x66')](_0x369414);}});});});}else{return _0x26c1a2['sendStatus'](0xc8);}})[_0x1aa1('0x26')](handleError(_0x26c1a2,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 6039f07..2383111 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 _0x8cae=['findAll','emit','catch','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x237149,_0xd6e02f){var _0x1b3192=function(_0x5eb79f){while(--_0x5eb79f){_0x237149['push'](_0x237149['shift']());}};_0x1b3192(++_0xd6e02f);}(_0x8cae,0x199));var _0xe8ca=function(_0x10085f,_0x3b601c){_0x10085f=_0x10085f-0x0;var _0x16c1aa=_0x8cae[_0x10085f];return _0x16c1aa;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xe8ca('0x0'))['db'][_0xe8ca('0x1')];var FaxMessage=require(_0xe8ca('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe8ca('0x2')](0x0);var events={'afterCreate':_0xe8ca('0x3'),'afterUpdate':_0xe8ca('0x4'),'afterDestroy':_0xe8ca('0x5')};function emitEvent(_0xfc1e9e){return function(_0x1f952f,_0x5d7923,_0x29aef6){_0x1f952f[_0xe8ca('0x6')]({'attributes':['id'],'raw':!![]})[_0xe8ca('0x7')](function(_0x5784a9){_0x1f952f[_0xe8ca('0x8')](_0xe8ca('0x9'),_0x5784a9[_0xe8ca('0xa')](function(_0x578e99){return{'id':_0x578e99['id']};}));return FaxMessage[_0xe8ca('0xb')]({'where':{'FaxInteractionId':_0x1f952f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe8ca('0x7')](function(_0x2e5e6d){_0x1f952f[_0xe8ca('0x8')]('unreadMessages',_0x2e5e6d['length']);FaxInteractionEvents[_0xe8ca('0xc')](_0xfc1e9e+':'+_0x1f952f['id'],_0x1f952f);FaxInteractionEvents[_0xe8ca('0xc')](_0xfc1e9e,_0x1f952f);_0x29aef6(null);})[_0xe8ca('0xd')](_0x29aef6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xe8ca('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x98b8=['update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0x98b8,0x92));var _0x898b=function(_0x3b375e,_0x565734){_0x3b375e=_0x3b375e-0x0;var _0x55419f=_0x98b8[_0x3b375e];return _0x55419f;};'use strict';var EventEmitter=require(_0x898b('0x0'));var FaxInteraction=require(_0x898b('0x1'))['db'][_0x898b('0x2')];var FaxMessage=require(_0x898b('0x1'))['db'][_0x898b('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x898b('0x4')](0x0);var events={'afterCreate':_0x898b('0x5'),'afterUpdate':_0x898b('0x6'),'afterDestroy':_0x898b('0x7')};function emitEvent(_0x3b22ae){return function(_0x2ef732,_0x4ec78d,_0x323bfd){_0x2ef732[_0x898b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e9282){_0x2ef732[_0x898b('0x9')](_0x898b('0xa'),_0x1e9282['map'](function(_0x4502d9){return{'id':_0x4502d9['id']};}));return FaxMessage[_0x898b('0xb')]({'where':{'FaxInteractionId':_0x2ef732['id'],'direction':'in','read':![]},'raw':!![]});})[_0x898b('0xc')](function(_0x2e5cb3){_0x2ef732['setDataValue'](_0x898b('0xd'),_0x2e5cb3[_0x898b('0xe')]);FaxInteractionEvents[_0x898b('0xf')](_0x3b22ae+':'+_0x2ef732['id'],_0x2ef732);FaxInteractionEvents[_0x898b('0xf')](_0x3b22ae,_0x2ef732);_0x323bfd(null);})[_0x898b('0x10')](_0x323bfd(null));};}for(var e in events){if(events[_0x898b('0x11')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x898b('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0afb626..2ca2359 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 _0xbada=['exports','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','rimraf','./faxInteraction.attributes'];(function(_0x5a520b,_0x3e78b8){var _0x3c6a0a=function(_0x47d326){while(--_0x47d326){_0x5a520b['push'](_0x5a520b['shift']());}};_0x3c6a0a(++_0x3e78b8);}(_0xbada,0x18e));var _0xabad=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xbada[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xabad('0x0'));var util=require(_0xabad('0x1'));var logger=require('../../config/logger')(_0xabad('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xabad('0x3'));var config=require('../../config/environment');var attributes=require(_0xabad('0x4'));module[_0xabad('0x5')]=function(_0x1aaf3,_0x204186){return _0x1aaf3[_0xabad('0x6')](_0xabad('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4902b1,_0x4df5d0,_0x4097fe){if(_0x4902b1[_0xabad('0x8')](_0xabad('0x9'))){_0x4902b1[_0xabad('0xa')]=moment()[_0xabad('0xb')](_0xabad('0xc'));}_0x4097fe(null,_0x4902b1);}}});}; \ No newline at end of file +var _0x9fa0=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','closed','format'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x9fa0,0x6c));var _0x09fa=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9fa0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x09fa('0x0'));var moment=require(_0x09fa('0x1'));var BPromise=require(_0x09fa('0x2'));var rp=require(_0x09fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09fa('0x4'));var config=require(_0x09fa('0x5'));var attributes=require(_0x09fa('0x6'));module['exports']=function(_0xe2e03d,_0x5c10d2){return _0xe2e03d[_0x09fa('0x7')](_0x09fa('0x8'),attributes,{'tableName':_0x09fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1aefdb,_0x576a7c,_0x182728){if(_0x1aefdb['changed'](_0x09fa('0xa'))){_0x1aefdb['closedAt']=moment()[_0x09fa('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x182728(null,_0x1aefdb);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5949544..4c68223 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 _0x12ca=['error','code','message','info','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','limit','catch','AddTagsToFaxInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x31f9ac,_0x571b2b){var _0x5adec9=function(_0x4322ba){while(--_0x4322ba){_0x31f9ac['push'](_0x31f9ac['shift']());}};_0x5adec9(++_0x571b2b);}(_0x12ca,0x97));var _0xa12c=function(_0x3505ae,_0x5b1f9f){_0x3505ae=_0x3505ae-0x0;var _0x3b0ca7=_0x12ca[_0x3505ae];return _0x3b0ca7;};'use strict';var _=require(_0xa12c('0x0'));var util=require(_0xa12c('0x1'));var moment=require(_0xa12c('0x2'));var BPromise=require('bluebird');var rs=require(_0xa12c('0x3'));var fs=require('fs');var Redis=require(_0xa12c('0x4'));var db=require(_0xa12c('0x5'))['db'];var utils=require(_0xa12c('0x6'));var logger=require(_0xa12c('0x7'))(_0xa12c('0x8'));var config=require(_0xa12c('0x9'));var jayson=require(_0xa12c('0xa'));var client=jayson[_0xa12c('0xb')][_0xa12c('0xc')]({'port':0x232a});config[_0xa12c('0xd')]=_[_0xa12c('0xe')](config[_0xa12c('0xd')],{'host':_0xa12c('0xf'),'port':0x18eb});var socket=require(_0xa12c('0x10'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xa12c('0x11')](socket);function respondWithRpcPromise(_0x1ed533,_0x4a19e4,_0x5f2600){return new BPromise(function(_0x35e832,_0x394279){return client[_0xa12c('0x12')](_0x1ed533,_0x5f2600)[_0xa12c('0x13')](function(_0x429e23){logger['info'](_0xa12c('0x14'),_0x4a19e4,'request\x20sent');logger[_0xa12c('0x15')](_0xa12c('0x16'),_0x4a19e4,_0xa12c('0x17'),JSON[_0xa12c('0x18')](_0x429e23));if(_0x429e23[_0xa12c('0x19')]){if(_0x429e23[_0xa12c('0x19')][_0xa12c('0x1a')]===0x1f4){logger[_0xa12c('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x4a19e4,_0x429e23['error'][_0xa12c('0x1b')]);return _0x394279(_0x429e23[_0xa12c('0x19')]['message']);}logger[_0xa12c('0x19')](_0xa12c('0x14'),_0x4a19e4,_0x429e23['error'][_0xa12c('0x1b')]);return _0x35e832(_0x429e23[_0xa12c('0x19')][_0xa12c('0x1b')]);}else{logger[_0xa12c('0x1c')](_0xa12c('0x14'),_0x4a19e4,_0xa12c('0x17'));_0x35e832(_0x429e23['result'][_0xa12c('0x1b')]);}})['catch'](function(_0x32f53f){logger['error'](_0xa12c('0x14'),_0x4a19e4,_0x32f53f);_0x394279(_0x32f53f);});});}exports[_0xa12c('0x1d')]=function(_0x20d0f1){var _0x157637=this;return new Promise(function(_0x11bd80,_0x2d660f){return db[_0xa12c('0x1e')][_0xa12c('0x1f')](_0x20d0f1[_0xa12c('0x20')],{'raw':_0x20d0f1[_0xa12c('0x21')]?_0x20d0f1[_0xa12c('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20d0f1[_0xa12c('0x21')]?_0x20d0f1[_0xa12c('0x21')]['where']||null:null,'attributes':_0x20d0f1[_0xa12c('0x21')]?_0x20d0f1[_0xa12c('0x21')][_0xa12c('0x22')]||null:null,'limit':_0x20d0f1['options']?_0x20d0f1[_0xa12c('0x21')][_0xa12c('0x23')]||null:null})[_0xa12c('0x13')](function(_0x217cf7){logger['info']('UpdateFaxInteraction',_0x20d0f1);logger[_0xa12c('0x15')](_0xa12c('0x1d'),_0x20d0f1,JSON[_0xa12c('0x18')](_0x217cf7));_0x11bd80(_0x217cf7);})[_0xa12c('0x24')](function(_0x57c3fb){logger[_0xa12c('0x19')]('UpdateFaxInteraction',_0x57c3fb[_0xa12c('0x1b')],_0x20d0f1);_0x2d660f(_0x157637[_0xa12c('0x19')](0x1f4,_0x57c3fb['message']));});});};exports[_0xa12c('0x25')]=function(_0x50cc0c){return new Promise(function(_0x480e97,_0x5da61a){return db[_0xa12c('0x1e')][_0xa12c('0x26')]({'where':_0x50cc0c[_0xa12c('0x21')]?_0x50cc0c[_0xa12c('0x21')][_0xa12c('0x27')]||null:null})[_0xa12c('0x13')](function(_0x1fd8c0){if(_0x1fd8c0){return _0x1fd8c0[_0xa12c('0x28')](_0x50cc0c[_0xa12c('0x20')][_0xa12c('0x29')],_['omit'](_0x50cc0c[_0xa12c('0x20')],[_0xa12c('0x29'),'id'])||{});}})[_0xa12c('0x2a')](function(_0x40570b){logger[_0xa12c('0x1c')]('AddTags',_0x50cc0c);logger[_0xa12c('0x15')](_0xa12c('0x2b'),_0x50cc0c,JSON[_0xa12c('0x18')](_0x40570b));_0x480e97(_0x40570b);})[_0xa12c('0x24')](function(_0x364228){logger[_0xa12c('0x19')]('AddTags',_0x364228[_0xa12c('0x1b')],_0x50cc0c);_0x5da61a(_this[_0xa12c('0x19')](0x1f4,_0x364228[_0xa12c('0x1b')]));});});}; \ No newline at end of file +var _0x306b=['then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x125f8b,_0x192ef7){var _0x54372d=function(_0xa9053c){while(--_0xa9053c){_0x125f8b['push'](_0x125f8b['shift']());}};_0x54372d(++_0x192ef7);}(_0x306b,0x73));var _0xb306=function(_0x47258d,_0x2dd8b8){_0x47258d=_0x47258d-0x0;var _0x1ed4ed=_0x306b[_0x47258d];return _0x1ed4ed;};'use strict';var _=require(_0xb306('0x0'));var util=require(_0xb306('0x1'));var moment=require(_0xb306('0x2'));var BPromise=require('bluebird');var rs=require(_0xb306('0x3'));var fs=require('fs');var Redis=require(_0xb306('0x4'));var db=require(_0xb306('0x5'))['db'];var utils=require(_0xb306('0x6'));var logger=require(_0xb306('0x7'))(_0xb306('0x8'));var config=require('../../config/environment');var jayson=require(_0xb306('0x9'));var client=jayson[_0xb306('0xa')][_0xb306('0xb')]({'port':0x232a});config[_0xb306('0xc')]=_[_0xb306('0xd')](config[_0xb306('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb306('0xe'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xb306('0xf')](socket);function respondWithRpcPromise(_0x35b409,_0x28beb3,_0x2ee090){return new BPromise(function(_0x5b62b8,_0x13e3e1){return client[_0xb306('0x10')](_0x35b409,_0x2ee090)[_0xb306('0x11')](function(_0x2213b8){logger[_0xb306('0x12')](_0xb306('0x13'),_0x28beb3,_0xb306('0x14'));logger[_0xb306('0x15')](_0xb306('0x16'),_0x28beb3,_0xb306('0x14'),JSON[_0xb306('0x17')](_0x2213b8));if(_0x2213b8[_0xb306('0x18')]){if(_0x2213b8[_0xb306('0x18')][_0xb306('0x19')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x28beb3,_0x2213b8[_0xb306('0x18')][_0xb306('0x1a')]);return _0x13e3e1(_0x2213b8[_0xb306('0x18')][_0xb306('0x1a')]);}logger[_0xb306('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x28beb3,_0x2213b8[_0xb306('0x18')]['message']);return _0x5b62b8(_0x2213b8['error'][_0xb306('0x1a')]);}else{logger[_0xb306('0x12')](_0xb306('0x13'),_0x28beb3,_0xb306('0x14'));_0x5b62b8(_0x2213b8[_0xb306('0x1b')][_0xb306('0x1a')]);}})['catch'](function(_0x455e83){logger['error'](_0xb306('0x13'),_0x28beb3,_0x455e83);_0x13e3e1(_0x455e83);});});}exports[_0xb306('0x1c')]=function(_0x5f27ce){var _0x282260=this;return new Promise(function(_0xd35892,_0x123a5d){return db[_0xb306('0x1d')][_0xb306('0x1e')](_0x5f27ce[_0xb306('0x1f')],{'raw':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce[_0xb306('0x20')][_0xb306('0x21')]||null:null,'attributes':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce[_0xb306('0x20')][_0xb306('0x22')]||null:null,'limit':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce['options'][_0xb306('0x23')]||null:null})[_0xb306('0x11')](function(_0x5ed0cc){logger[_0xb306('0x12')](_0xb306('0x1c'),_0x5f27ce);logger[_0xb306('0x15')](_0xb306('0x1c'),_0x5f27ce,JSON[_0xb306('0x17')](_0x5ed0cc));_0xd35892(_0x5ed0cc);})[_0xb306('0x24')](function(_0xe61c2c){logger['error'](_0xb306('0x1c'),_0xe61c2c[_0xb306('0x1a')],_0x5f27ce);_0x123a5d(_0x282260[_0xb306('0x18')](0x1f4,_0xe61c2c[_0xb306('0x1a')]));});});};exports[_0xb306('0x25')]=function(_0x53990f){return new Promise(function(_0x3b3c6a,_0x4e7a4d){return db[_0xb306('0x1d')][_0xb306('0x26')]({'where':_0x53990f[_0xb306('0x20')]?_0x53990f[_0xb306('0x20')]['where']||null:null})[_0xb306('0x11')](function(_0x375b42){if(_0x375b42){return _0x375b42[_0xb306('0x27')](_0x53990f['body'][_0xb306('0x28')],_[_0xb306('0x29')](_0x53990f['body'],['ids','id'])||{});}})[_0xb306('0x2a')](function(_0x24685d){logger[_0xb306('0x12')](_0xb306('0x2b'),_0x53990f);logger[_0xb306('0x15')](_0xb306('0x2b'),_0x53990f,JSON['stringify'](_0x24685d));_0x3b3c6a(_0x24685d);})[_0xb306('0x24')](function(_0x50f494){logger[_0xb306('0x18')](_0xb306('0x2b'),_0x50f494[_0xb306('0x1a')],_0x53990f);_0x4e7a4d(_this[_0xb306('0x18')](0x1f4,_0x50f494[_0xb306('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 01aee01..71a2313 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 _0x62e3=['save','remove','emit','removeListener','register','length','./faxInteraction.events'];(function(_0xbca5f7,_0x7f833a){var _0x2eb4c0=function(_0x3c81ef){while(--_0x3c81ef){_0xbca5f7['push'](_0xbca5f7['shift']());}};_0x2eb4c0(++_0x7f833a);}(_0x62e3,0x1db));var _0x362e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62e3[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require(_0x362e('0x0'));var events=[_0x362e('0x1'),_0x362e('0x2'),'update'];function createListener(_0x312baa,_0x34e89c){return function(_0x4a31ff){_0x34e89c[_0x362e('0x3')](_0x312baa,_0x4a31ff);};}function removeListener(_0x6c402b,_0x1a21f8){return function(){FaxInteractionEvents[_0x362e('0x4')](_0x6c402b,_0x1a21f8);};}exports[_0x362e('0x5')]=function(_0x5615ad){for(var _0x4b11a7=0x0,_0x435dae=events[_0x362e('0x6')];_0x4b11a7<_0x435dae;_0x4b11a7++){var _0x12b2dc=events[_0x4b11a7];var _0x2b924a=createListener('faxInteraction:'+_0x12b2dc,_0x5615ad);FaxInteractionEvents['on'](_0x12b2dc,_0x2b924a);}}; \ No newline at end of file +var _0xc90a=['update','register','length','./faxInteraction.events','save','remove'];(function(_0x1d0626,_0x4b460){var _0x550c0a=function(_0xc345d6){while(--_0xc345d6){_0x1d0626['push'](_0x1d0626['shift']());}};_0x550c0a(++_0x4b460);}(_0xc90a,0x99));var _0xac90=function(_0x3fe9f5,_0x2c302b){_0x3fe9f5=_0x3fe9f5-0x0;var _0x5acbb4=_0xc90a[_0x3fe9f5];return _0x5acbb4;};'use strict';var FaxInteractionEvents=require(_0xac90('0x0'));var events=[_0xac90('0x1'),_0xac90('0x2'),_0xac90('0x3')];function createListener(_0x4a6228,_0x3c0966){return function(_0x48e5cc){_0x3c0966['emit'](_0x4a6228,_0x48e5cc);};}function removeListener(_0x1171ea,_0x15f908){return function(){FaxInteractionEvents['removeListener'](_0x1171ea,_0x15f908);};}exports[_0xac90('0x4')]=function(_0x1cf4c9){for(var _0x1cfc4c=0x0,_0x1d39da=events[_0xac90('0x5')];_0x1cfc4c<_0x1d39da;_0x1cfc4c++){var _0x4092a1=events[_0x1cfc4c];var _0x5b66c3=createListener('faxInteraction:'+_0x4092a1,_0x1cf4c9);FaxInteractionEvents['on'](_0x4092a1,_0x5b66c3);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 508405c..e224065 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 _0xc2de=['isAuthenticated','/describe','describe','get','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','fax','faxinteraction:addtags','faxinteraction:update','update','delete','tracked','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller'];(function(_0x50f622,_0x1d09df){var _0x5f4b5a=function(_0x39af7d){while(--_0x39af7d){_0x50f622['push'](_0x50f622['shift']());}};_0x5f4b5a(++_0x1d09df);}(_0xc2de,0x18e));var _0xec2d=function(_0x3a6117,_0x5758d7){_0x3a6117=_0x3a6117-0x0;var _0x22ac96=_0xc2de[_0x3a6117];return _0x22ac96;};'use strict';var multer=require('multer');var util=require(_0xec2d('0x0'));var path=require(_0xec2d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xec2d('0x2'));var auth=require(_0xec2d('0x3'));var interaction=require(_0xec2d('0x4'));var config=require(_0xec2d('0x5'));var controller=require(_0xec2d('0x6'));router['get']('/',auth[_0xec2d('0x7')](),controller['index']);router['get'](_0xec2d('0x8'),auth['isAuthenticated'](),controller[_0xec2d('0x9')]);router[_0xec2d('0xa')](_0xec2d('0xb'),auth[_0xec2d('0x7')](),controller[_0xec2d('0xc')]);router[_0xec2d('0xa')]('/:id/messages',auth[_0xec2d('0x7')](),controller[_0xec2d('0xd')]);router[_0xec2d('0xa')](_0xec2d('0xe'),auth[_0xec2d('0x7')](),controller[_0xec2d('0xf')]);router[_0xec2d('0x10')]('/',auth[_0xec2d('0x7')](),controller[_0xec2d('0x11')]);router[_0xec2d('0x10')](_0xec2d('0x12'),auth['isAuthenticated'](),controller['addMessage']);router[_0xec2d('0x10')](_0xec2d('0x13'),auth[_0xec2d('0x7')](),interaction['tracked'](_0xec2d('0x14'),_0xec2d('0x15')),controller['addTags']);router['put'](_0xec2d('0xb'),auth[_0xec2d('0x7')](),interaction['tracked'](_0xec2d('0x14'),_0xec2d('0x16')),controller[_0xec2d('0x17')]);router[_0xec2d('0x18')](_0xec2d('0xb'),auth[_0xec2d('0x7')](),interaction[_0xec2d('0x19')](_0xec2d('0x14'),'faxinteraction:destroy'),controller['destroy']);router['delete'](_0xec2d('0x13'),auth[_0xec2d('0x7')](),controller[_0xec2d('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xbd36=['faxinteraction:update','update','delete','tracked','faxinteraction:destroy','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','fax','faxinteraction:addtags','addTags','put'];(function(_0x460998,_0x31c609){var _0x53b613=function(_0x261787){while(--_0x261787){_0x460998['push'](_0x460998['shift']());}};_0x53b613(++_0x31c609);}(_0xbd36,0x127));var _0x6bd3=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xbd36[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6bd3('0x0'));var timeout=require(_0x6bd3('0x1'));var express=require(_0x6bd3('0x2'));var router=express['Router']();var fs_extra=require(_0x6bd3('0x3'));var auth=require(_0x6bd3('0x4'));var interaction=require(_0x6bd3('0x5'));var config=require(_0x6bd3('0x6'));var controller=require(_0x6bd3('0x7'));router[_0x6bd3('0x8')]('/',auth[_0x6bd3('0x9')](),controller[_0x6bd3('0xa')]);router[_0x6bd3('0x8')](_0x6bd3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6bd3('0x8')](_0x6bd3('0xc'),auth[_0x6bd3('0x9')](),controller[_0x6bd3('0xd')]);router[_0x6bd3('0x8')](_0x6bd3('0xe'),auth[_0x6bd3('0x9')](),controller[_0x6bd3('0xf')]);router[_0x6bd3('0x8')](_0x6bd3('0x10'),auth[_0x6bd3('0x9')](),controller[_0x6bd3('0x11')]);router[_0x6bd3('0x12')]('/',auth['isAuthenticated'](),controller[_0x6bd3('0x13')]);router[_0x6bd3('0x12')](_0x6bd3('0xe'),auth[_0x6bd3('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x6bd3('0x9')](),interaction['tracked'](_0x6bd3('0x14'),_0x6bd3('0x15')),controller[_0x6bd3('0x16')]);router[_0x6bd3('0x17')](_0x6bd3('0xc'),auth[_0x6bd3('0x9')](),interaction['tracked']('fax',_0x6bd3('0x18')),controller[_0x6bd3('0x19')]);router[_0x6bd3('0x1a')](_0x6bd3('0xc'),auth['isAuthenticated'](),interaction[_0x6bd3('0x1b')](_0x6bd3('0x14'),_0x6bd3('0x1c')),controller['destroy']);router[_0x6bd3('0x1a')]('/:id/tags',auth[_0x6bd3('0x9')](),controller['removeTags']);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 d4eeda1..3ce645e 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 _0x9221=['BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x578f84,_0x2d4fb1){var _0x2d9631=function(_0x3a8c39){while(--_0x3a8c39){_0x578f84['push'](_0x578f84['shift']());}};_0x2d9631(++_0x2d4fb1);}(_0x9221,0x64));var _0x1922=function(_0x59080e,_0x2c3518){_0x59080e=_0x59080e-0x0;var _0x4f86a9=_0x9221[_0x59080e];return _0x4f86a9;};'use strict';var Sequelize=require('sequelize');module[_0x1922('0x0')]={'body':{'type':Sequelize[_0x1922('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1922('0x3')]('in','out'),'defaultValue':_0x1922('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1922('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1922('0x5')]}}; \ No newline at end of file +var _0x94dc=['ENUM','out','DATE','sequelize','TEXT','BOOLEAN'];(function(_0x1f6390,_0x42ac64){var _0x563851=function(_0x80b9fa){while(--_0x80b9fa){_0x1f6390['push'](_0x1f6390['shift']());}};_0x563851(++_0x42ac64);}(_0x94dc,0xb1));var _0xc94d=function(_0x37cedc,_0x494316){_0x37cedc=_0x37cedc-0x0;var _0x3a6f33=_0x94dc[_0x37cedc];return _0x3a6f33;};'use strict';var Sequelize=require(_0xc94d('0x0'));module['exports']={'body':{'type':Sequelize[_0xc94d('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc94d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc94d('0x3')]('in',_0xc94d('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xc94d('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xc94d('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 2b96eef..3940448 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 _0x472e=['catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','find','params','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','user','role','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','internal','manual','channel','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','email','interface','SIP/%s','motionChannel','create','CmContact','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','isNil','join','root','server','files','attachments','download','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x472e,0xee));var _0xe472=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x472e[_0x460150];return _0x340677;};'use strict';var emlformat=require(_0xe472('0x0'));var rimraf=require(_0xe472('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe472('0x2'));var rp=require('request-promise');var moment=require(_0xe472('0x3'));var BPromise=require(_0xe472('0x4'));var Mustache=require(_0xe472('0x5'));var util=require('util');var path=require(_0xe472('0x6'));var sox=require(_0xe472('0x7'));var csv=require(_0xe472('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe472('0x9'));var _=require(_0xe472('0xa'));var squel=require(_0xe472('0xb'));var crypto=require(_0xe472('0xc'));var jsforce=require(_0xe472('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe472('0x8'));var querystring=require('querystring');var Papa=require(_0xe472('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe472('0xf'));var as=require(_0xe472('0x10'));var hardwareService=require(_0xe472('0x11'));var logger=require(_0xe472('0x12'))(_0xe472('0x13'));var utils=require('../../config/utils');var config=require(_0xe472('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe472('0x15'))['db'];config[_0xe472('0x16')]=_[_0xe472('0x17')](config[_0xe472('0x16')],{'host':_0xe472('0x18'),'port':0x18eb});var socket=require(_0xe472('0x19'))(new Redis(config[_0xe472('0x16')]));require(_0xe472('0x1a'))[_0xe472('0x1b')](socket);var jayson=require(_0xe472('0x1c'));var client=jayson[_0xe472('0x1d')][_0xe472('0x1e')]({'port':0x232c});var client9002=jayson[_0xe472('0x1d')][_0xe472('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5a7454,_0x2d48c9,_0x49e24b,_0x261173){return new BPromise(function(_0x52686c,_0x6be086){var _0xff417=_0x261173||client;return _0xff417['request'](_0x5a7454,_0x49e24b)[_0xe472('0x1f')](function(_0x4c4888){logger[_0xe472('0x20')](_0xe472('0x21'),_0x2d48c9,_0xe472('0x22'));logger[_0xe472('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2d48c9,_0xe472('0x22'),JSON[_0xe472('0x24')](_0x4c4888));if(_0x4c4888[_0xe472('0x25')]){if(_0x4c4888[_0xe472('0x25')]['code']===0x1f4){logger['error'](_0xe472('0x21'),_0x2d48c9,_0x4c4888['error'][_0xe472('0x26')]);return _0x6be086(_0x4c4888[_0xe472('0x25')][_0xe472('0x26')]);}logger[_0xe472('0x25')]('FaxMessage,\x20%s,\x20%s',_0x2d48c9,_0x4c4888['error']['message']);return _0x52686c(_0x4c4888[_0xe472('0x25')][_0xe472('0x26')]);}else{logger[_0xe472('0x20')](_0xe472('0x21'),_0x2d48c9,_0xe472('0x22'));_0x52686c(_0x4c4888[_0xe472('0x27')][_0xe472('0x26')]);}})[_0xe472('0x28')](function(_0x4a7c04){logger[_0xe472('0x25')](_0xe472('0x21'),_0x2d48c9,_0x4a7c04);_0x6be086(_0x4a7c04);});});}function respondWithStatusCode(_0x20e856,_0x4b6594){_0x4b6594=_0x4b6594||0xcc;return function(_0x38eca9){if(_0x38eca9){return _0x20e856[_0xe472('0x29')](_0x4b6594);}return _0x20e856[_0xe472('0x2a')](_0x4b6594)[_0xe472('0x2b')]();};}function respondWithResult(_0xc46c9c,_0x327f89){_0x327f89=_0x327f89||0xc8;return function(_0x3a6775){if(_0x3a6775){return _0xc46c9c['status'](_0x327f89)[_0xe472('0x2c')](_0x3a6775);}};}function respondWithFilteredResult(_0x1bfab3,_0x277073){return function(_0xdf8567){if(_0xdf8567){var _0x5d52aa=typeof _0x277073[_0xe472('0x2d')]==='undefined'&&typeof _0x277073['limit']===_0xe472('0x2e');var _0x2d45ac=_0xdf8567[_0xe472('0x2f')];var _0xf73a8=_0x5d52aa?0x0:_0x277073[_0xe472('0x2d')];var _0x295a9f=_0x5d52aa?_0xdf8567[_0xe472('0x2f')]:_0x277073[_0xe472('0x2d')]+_0x277073[_0xe472('0x30')];var _0x229f32;if(_0x295a9f>=_0x2d45ac){_0x295a9f=_0x2d45ac;_0x229f32=0xc8;}else{_0x229f32=0xce;}_0x1bfab3['status'](_0x229f32);return _0x1bfab3[_0xe472('0x31')](_0xe472('0x32'),_0xf73a8+'-'+_0x295a9f+'/'+_0x2d45ac)[_0xe472('0x2c')](_0xdf8567);}return null;};}function patchUpdates(_0x25cca8){return function(_0x2888f4){try{jsonpatch[_0xe472('0x33')](_0x2888f4,_0x25cca8,!![]);}catch(_0x2a2182){return BPromise[_0xe472('0x34')](_0x2a2182);}return _0x2888f4[_0xe472('0x35')]();};}function saveUpdates(_0x513ed5,_0x30fff4){return function(_0x15f76c){if(_0x15f76c){return _0x15f76c[_0xe472('0x36')](_0x513ed5)['then'](function(_0xfdb0c6){return _0xfdb0c6;});}return null;};}function removeEntity(_0x12c872,_0x5ece43){return function(_0x19b4f5){if(_0x19b4f5){return _0x19b4f5[_0xe472('0x37')]()[_0xe472('0x1f')](function(){_0x12c872['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3235e4,_0x1c1cf0){return function(_0x356deb){if(!_0x356deb){_0x3235e4[_0xe472('0x29')](0x194);}return _0x356deb;};}function handleError(_0x196f72,_0x3c7542){_0x3c7542=_0x3c7542||0x1f4;return function(_0x3db1b9){logger[_0xe472('0x25')](_0x3db1b9[_0xe472('0x38')]);if(_0x3db1b9[_0xe472('0x39')]){delete _0x3db1b9['name'];}_0x196f72[_0xe472('0x2a')](_0x3c7542)[_0xe472('0x3a')](_0x3db1b9);};}exports[_0xe472('0x3b')]=function(_0x2b204c,_0x347198){var _0x26c8d2={},_0x40035b={},_0x299143={'count':0x0,'rows':[]};var _0x4b4624=_[_0xe472('0x3c')](db[_0xe472('0x3d')][_0xe472('0x3e')],function(_0x2038ce){return{'name':_0x2038ce[_0xe472('0x3f')],'type':_0x2038ce['type']['key']};});_0x40035b[_0xe472('0x40')]=_['map'](_0x4b4624,_0xe472('0x39'));_0x40035b[_0xe472('0x41')]=_[_0xe472('0x42')](_0x2b204c[_0xe472('0x41')]);_0x40035b[_0xe472('0x43')]=_[_0xe472('0x44')](_0x40035b['model'],_0x40035b[_0xe472('0x41')]);_0x26c8d2['attributes']=_[_0xe472('0x44')](_0x40035b[_0xe472('0x40')],qs[_0xe472('0x45')](_0x2b204c['query'][_0xe472('0x45')]));_0x26c8d2[_0xe472('0x46')]=_0x26c8d2[_0xe472('0x46')][_0xe472('0x47')]?_0x26c8d2[_0xe472('0x46')]:_0x40035b[_0xe472('0x40')];if(!_0x2b204c[_0xe472('0x41')][_0xe472('0x48')]('nolimit')){_0x26c8d2['limit']=qs[_0xe472('0x30')](_0x2b204c[_0xe472('0x41')]['limit']);_0x26c8d2[_0xe472('0x2d')]=qs[_0xe472('0x2d')](_0x2b204c['query'][_0xe472('0x2d')]);}_0x26c8d2[_0xe472('0x49')]=qs['sort'](_0x2b204c[_0xe472('0x41')][_0xe472('0x4a')]);_0x26c8d2[_0xe472('0x4b')]=qs[_0xe472('0x43')](_['pick'](_0x2b204c[_0xe472('0x41')],_0x40035b[_0xe472('0x43')]),_0x4b4624);if(_0x2b204c[_0xe472('0x41')][_0xe472('0x4c')]){_0x26c8d2[_0xe472('0x4b')]=_[_0xe472('0x4d')](_0x26c8d2[_0xe472('0x4b')],{'$or':_[_0xe472('0x3c')](_0x4b4624,function(_0x551d76){if(_0x551d76['type']!=='VIRTUAL'){var _0xe663e8={};_0xe663e8[_0x551d76[_0xe472('0x39')]]={'$like':'%'+_0x2b204c['query'][_0xe472('0x4c')]+'%'};return _0xe663e8;}})});}_0x26c8d2=_[_0xe472('0x4d')]({},_0x26c8d2,_0x2b204c['options']);var _0x280695={'where':_0x26c8d2['where']};return db['FaxMessage']['count'](_0x280695)[_0xe472('0x1f')](function(_0x28949b){_0x299143['count']=_0x28949b;if(_0x2b204c[_0xe472('0x41')][_0xe472('0x4e')]){_0x26c8d2[_0xe472('0x4f')]=[{'all':!![]}];}return db[_0xe472('0x3d')][_0xe472('0x50')](_0x26c8d2);})[_0xe472('0x1f')](function(_0x4aeeb9){_0x299143[_0xe472('0x51')]=_0x4aeeb9;return _0x299143;})['then'](respondWithFilteredResult(_0x347198,_0x26c8d2))[_0xe472('0x28')](handleError(_0x347198,null));};exports[_0xe472('0x52')]=function(_0x2d2398,_0x47cdcf){var _0x271b40={'raw':!![],'where':{'id':_0x2d2398['params']['id']}},_0x4214f6={};_0x4214f6[_0xe472('0x40')]=_['keys'](db[_0xe472('0x3d')][_0xe472('0x3e')]);_0x4214f6['query']=_[_0xe472('0x42')](_0x2d2398[_0xe472('0x41')]);_0x4214f6['filters']=_[_0xe472('0x44')](_0x4214f6['model'],_0x4214f6['query']);_0x271b40[_0xe472('0x46')]=_[_0xe472('0x44')](_0x4214f6[_0xe472('0x40')],qs[_0xe472('0x45')](_0x2d2398[_0xe472('0x41')]['fields']));_0x271b40[_0xe472('0x46')]=_0x271b40[_0xe472('0x46')][_0xe472('0x47')]?_0x271b40[_0xe472('0x46')]:_0x4214f6[_0xe472('0x40')];if(_0x2d2398[_0xe472('0x41')][_0xe472('0x4e')]){_0x271b40[_0xe472('0x4f')]=[{'all':!![]}];}_0x271b40=_[_0xe472('0x4d')]({},_0x271b40,_0x2d2398['options']);return db['FaxMessage']['find'](_0x271b40)[_0xe472('0x1f')](handleEntityNotFound(_0x47cdcf,null))[_0xe472('0x1f')](respondWithResult(_0x47cdcf,null))[_0xe472('0x28')](handleError(_0x47cdcf,null));};exports[_0xe472('0x36')]=function(_0x5d9e76,_0x57e0c1){if(_0x5d9e76['body']['id']){delete _0x5d9e76['body']['id'];}return db['FaxMessage'][_0xe472('0x53')]({'where':{'id':_0x5d9e76[_0xe472('0x54')]['id']}})[_0xe472('0x1f')](handleEntityNotFound(_0x57e0c1,null))[_0xe472('0x1f')](saveUpdates(_0x5d9e76[_0xe472('0x55')],null))[_0xe472('0x1f')](respondWithResult(_0x57e0c1,null))['catch'](handleError(_0x57e0c1,null));};exports[_0xe472('0x37')]=function(_0x253619,_0x360e40){return db[_0xe472('0x3d')][_0xe472('0x53')]({'where':{'id':_0x253619['params']['id']}})[_0xe472('0x1f')](handleEntityNotFound(_0x360e40,null))[_0xe472('0x1f')](removeEntity(_0x360e40,null))[_0xe472('0x28')](handleError(_0x360e40,null));};exports[_0xe472('0x56')]=function(_0x3f3e7f,_0x4f02f5){return db[_0xe472('0x3d')][_0xe472('0x56')]()['then'](respondWithResult(_0x4f02f5,null))[_0xe472('0x28')](handleError(_0x4f02f5,null));};var interaction_log=require(_0xe472('0x12'))(_0xe472('0x57'));exports[_0xe472('0x58')]=function(_0x43edd5,_0x48bfee,_0x2ca358){var _0x565fb3={'agent':{},'channel':_0xe472('0x59')};if(_0x43edd5[_0xe472('0x55')]['id']){delete _0x43edd5['body']['id'];}_0x43edd5[_0xe472('0x55')][_0xe472('0x5a')]=!![];_0x43edd5['body']['readAt']=moment()[_0xe472('0x5b')](_0xe472('0x5c'));_0x43edd5['body']['UserId']=_0x43edd5[_0xe472('0x55')][_0xe472('0x5d')]||_0x43edd5['user']['id'];_0x565fb3['agent']['id']=_0x43edd5[_0xe472('0x55')][_0xe472('0x5d')];return db['FaxMessage'][_0xe472('0x53')]({'where':{'id':_0x43edd5[_0xe472('0x54')]['id'],'UserId':null}})[_0xe472('0x1f')](handleEntityNotFound(_0x48bfee,null))[_0xe472('0x1f')](saveUpdates(_0x43edd5[_0xe472('0x55')],null))['then'](function(_0x3d61f8){if(_0x3d61f8){_0x565fb3[_0xe472('0x26')]=_0x3d61f8[_0xe472('0x5e')]({'plain':!![]});return db[_0xe472('0x5f')][_0xe472('0x53')]({'where':{'id':_0x3d61f8[_0xe472('0x60')]}});}return null;})[_0xe472('0x1f')](handleEntityNotFound(_0x48bfee,null))[_0xe472('0x1f')](function(_0xe81129){if(_0xe81129){return _0xe81129[_0xe472('0x36')]({'UserId':_0x43edd5[_0xe472('0x55')][_0xe472('0x5d')],'read1stAt':_['isNil'](_0xe81129[_0xe472('0x61')])?moment()[_0xe472('0x5b')](_0xe472('0x5c')):undefined});}return null;})[_0xe472('0x1f')](function(_0x2aad4d){if(_0x2aad4d){_0x565fb3[_0xe472('0x62')]=_0x2aad4d[_0xe472('0x5e')]({'plain':!![]});interaction_log[_0xe472('0x20')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43edd5[_0xe472('0x63')]['id'],_0x43edd5[_0xe472('0x63')][_0xe472('0x39')],_0x43edd5[_0xe472('0x63')][_0xe472('0x64')],_0x565fb3[_0xe472('0x62')]['id'],_0x43edd5[_0xe472('0x55')]?JSON['stringify'](_0x43edd5[_0xe472('0x55')]):'null');return respondWithRpcPromise('AcceptMessage',_0xe472('0x65'),_0x565fb3);}return null;})[_0xe472('0x1f')](function(_0x4e3ed7){var _0x19fe09='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e3ed7[_0xe472('0x26')][_0xe472('0x66')];return db[_0xe472('0x67')]['query'](_0x19fe09,{'type':db[_0xe472('0x68')][_0xe472('0x69')][_0xe472('0x6a')],'raw':!![]})[_0xe472('0x1f')](function(_0x5d223c){return _0x5d223c;});})['then'](function(_0x5f0712){if(_0x5f0712){_0x565fb3[_0xe472('0x26')][_0xe472('0x6b')]=_0x5f0712[0x0];if(!_0x43edd5[_0xe472('0x55')][_0xe472('0x5d')])return;return db[_0xe472('0x6c')][_0xe472('0x53')]({'where':{'id':_0x43edd5[_0xe472('0x55')][_0xe472('0x5d')],'role':_0xe472('0x6d')},'attributes':['id',_0xe472('0x39'),'fullname','email',_0xe472('0x6e')],'raw':!![]});}return null;})[_0xe472('0x1f')](function(_0xd629b4){if(!_0xd629b4)return null;_0x565fb3[_0xe472('0x26')]['agent']=_0xd629b4;return _0x565fb3;})[_0xe472('0x1f')](function(_0x2c6b71){if(_0x2c6b71){if(_0x43edd5['body'][_0xe472('0x6f')]){_0x565fb3[_0xe472('0x26')]['interface']=util['format']('SIP/%s',_0x43edd5['user'][_0xe472('0x39')]);_0x565fb3['message'][_0xe472('0x70')]=_0x565fb3[_0xe472('0x70')];_0x565fb3['message']['motionChannel']=_0x565fb3[_0xe472('0x70')];_0x565fb3[_0xe472('0x26')]['event']=_0xe472('0x58');return respondWithRpcPromise(_0xe472('0x71'),_0xe472('0x71'),{'event':_0xe472('0x72'),'message':_0x565fb3[_0xe472('0x26')]},client9002)[_0xe472('0x1f')](function(){return _0x565fb3;});}return _0x565fb3;}return null;})[_0xe472('0x1f')](respondWithResult(_0x48bfee,null))[_0xe472('0x28')](handleError(_0x48bfee,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xe472('0x34')]=function(_0x54fae3,_0x450d57,_0x1d2c26){var _0x7ee55e={'agent':{},'channel':'fax'};if(_0x54fae3[_0xe472('0x55')]['id']){delete _0x54fae3[_0xe472('0x55')]['id'];}_0x54fae3[_0xe472('0x55')][_0xe472('0x5d')]=_0x54fae3[_0xe472('0x55')][_0xe472('0x5d')]||_0x54fae3[_0xe472('0x63')]['id'];_0x7ee55e[_0xe472('0x6d')]['id']=_0x54fae3['body']['UserId'];return db['FaxMessage'][_0xe472('0x53')]({'where':{'id':_0x54fae3[_0xe472('0x54')]['id'],'UserId':null}})[_0xe472('0x1f')](handleEntityNotFound(_0x450d57,null))[_0xe472('0x1f')](function(_0x2957fe){if(_0x2957fe){_0x7ee55e[_0xe472('0x26')]=_0x2957fe[_0xe472('0x5e')]({'plain':!![]});return db[_0xe472('0x5f')]['find']({'where':{'id':_0x2957fe['FaxInteractionId']}});}return null;})[_0xe472('0x1f')](handleEntityNotFound(_0x450d57,null))[_0xe472('0x1f')](function(_0x543145){if(_0x543145){_0x7ee55e[_0xe472('0x62')]=_0x543145[_0xe472('0x5e')]({'plain':!![]});interaction_log[_0xe472('0x20')](_0xe472('0x73'),_0x54fae3[_0xe472('0x63')]['id'],_0x54fae3[_0xe472('0x63')]['name'],_0x54fae3[_0xe472('0x63')][_0xe472('0x64')],_0x7ee55e[_0xe472('0x62')]['id'],_0x54fae3[_0xe472('0x55')]?JSON[_0xe472('0x24')](_0x54fae3['body']):_0xe472('0x74'));return respondWithRpcPromise('RejectMessage',_0xe472('0x75'),_0x7ee55e);}return null;})[_0xe472('0x1f')](function(_0x57439f){var _0x458a61=_0xe472('0x76')+_0x57439f[_0xe472('0x26')][_0xe472('0x66')];return db[_0xe472('0x67')][_0xe472('0x41')](_0x458a61,{'type':db[_0xe472('0x68')]['QueryTypes'][_0xe472('0x6a')],'raw':!![]})[_0xe472('0x1f')](function(_0xa31c6a){return _0xa31c6a;});})[_0xe472('0x1f')](function(_0x3404a1){if(_0x3404a1){_0x7ee55e[_0xe472('0x26')][_0xe472('0x6b')]=_0x3404a1[0x0];if(!_0x54fae3[_0xe472('0x55')][_0xe472('0x5d')])return;return db[_0xe472('0x6c')]['find']({'where':{'id':_0x54fae3[_0xe472('0x55')][_0xe472('0x5d')],'role':_0xe472('0x6d')},'attributes':['id','name',_0xe472('0x77'),_0xe472('0x78'),'internal'],'raw':!![]});}return null;})[_0xe472('0x1f')](function(_0x491581){if(!_0x491581)return null;_0x7ee55e['message']['agent']=_0x491581;return _0x7ee55e;})[_0xe472('0x1f')](function(_0x425f02){if(_0x425f02){_0x425f02[_0xe472('0x26')][_0xe472('0x79')]=util[_0xe472('0x5b')](_0xe472('0x7a'),_0x54fae3[_0xe472('0x63')][_0xe472('0x39')]);_0x425f02[_0xe472('0x26')]['channel']=_0x7ee55e[_0xe472('0x70')];_0x425f02[_0xe472('0x26')][_0xe472('0x7b')]=_0x7ee55e['channel'];_0x425f02[_0xe472('0x26')]['event']=_0xe472('0x34');respondWithRpcPromise(_0xe472('0x71'),_0xe472('0x71'),{'event':'rejectmessage','message':_0x425f02[_0xe472('0x26')]},client9002);return _0x7ee55e;}return null;})['then'](respondWithResult(_0x450d57,null))[_0xe472('0x28')](handleError(_0x450d57,null));};exports['create']=function(_0xc1aad6,_0x5a209a){var _0x786fa2;return db[_0xe472('0x3d')][_0xe472('0x7c')](_0xc1aad6['body'],{})['then'](function(_0x1000cb){_0x786fa2=_0x1000cb;return db[_0xe472('0x7d')]['findOne']({'where':{'id':_0x786fa2['ContactId']}});})[_0xe472('0x1f')](function(_0x58a975){if(_['isNil'](_0x58a975)){return;}else{_0x786fa2[_0xe472('0x59')]=_0x58a975[_0xe472('0x59')];return db[_0xe472('0x7e')]['findOne']({'where':{'id':_0x786fa2[_0xe472('0x7f')]}});}})[_0xe472('0x1f')](function(_0x35d798){return respondWithRpcPromise(_0xe472('0x80'),_0xe472('0x80'),{'FaxAccountId':_['isNil'](_0xc1aad6[_0xe472('0x55')])?undefined:_0xc1aad6[_0xe472('0x55')][_0xe472('0x81')],'path':_['isNil'](_0x35d798)?undefined:util[_0xe472('0x5b')](_0xe472('0x82'),_0x35d798[_0xe472('0x83')]),'fax':_[_0xe472('0x84')](_0x786fa2[_0xe472('0x59')])?undefined:_0x786fa2[_0xe472('0x59')],'AttachmentId':_0x786fa2['AttachmentId']},client9002);})[_0xe472('0x1f')](respondWithResult(_0x5a209a,0xc9))['catch'](handleError(_0x5a209a,null));};exports['download']=function(_0x1de7b2,_0x2b7ef1){var _0x2c4355=path[_0xe472('0x85')](config[_0xe472('0x86')],_0xe472('0x87'),_0xe472('0x88'),_0xe472('0x89'));return db['FaxMessage']['find']({'where':{'id':_0x1de7b2['params']['id']},'include':[{'model':db[_0xe472('0x7e')],'as':'Attachment'}]})[_0xe472('0x1f')](handleEntityNotFound(_0x2b7ef1,null))[_0xe472('0x1f')](function(_0x5363eb){if(_0x5363eb){return _0x2b7ef1[_0xe472('0x8a')](path[_0xe472('0x85')](_0x2c4355,_0x5363eb[_0xe472('0x7e')][_0xe472('0x83')]));}})[_0xe472('0x28')](handleError(_0x2b7ef1,null));}; \ No newline at end of file +var _0xf5b5=['moment','bluebird','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','sendStatus','stack','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','body','FaxMessage','find','params','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','rejectMessage','Sequelize','QueryTypes','contact','EventManager','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0xf5b5,0x115));var _0x5f5b=function(_0x744f1a,_0xb0ba39){_0x744f1a=_0x744f1a-0x0;var _0x212ce6=_0xf5b5[_0x744f1a];return _0x212ce6;};'use strict';var emlformat=require(_0x5f5b('0x0'));var rimraf=require(_0x5f5b('0x1'));var zipdir=require(_0x5f5b('0x2'));var jsonpatch=require(_0x5f5b('0x3'));var rp=require(_0x5f5b('0x4'));var moment=require(_0x5f5b('0x5'));var BPromise=require(_0x5f5b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5f5b('0x7'));var sox=require('sox');var csv=require(_0x5f5b('0x8'));var ejs=require(_0x5f5b('0x9'));var fs=require('fs');var fs_extra=require(_0x5f5b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f5b('0xb'));var jsforce=require(_0x5f5b('0xc'));var deskjs=require(_0x5f5b('0xd'));var toCsv=require(_0x5f5b('0x8'));var querystring=require('querystring');var Papa=require(_0x5f5b('0xe'));var Redis=require(_0x5f5b('0xf'));var authService=require(_0x5f5b('0x10'));var qs=require(_0x5f5b('0x11'));var as=require(_0x5f5b('0x12'));var hardwareService=require(_0x5f5b('0x13'));var logger=require(_0x5f5b('0x14'))('api');var utils=require(_0x5f5b('0x15'));var config=require(_0x5f5b('0x16'));var licenseUtil=require(_0x5f5b('0x17'));var db=require(_0x5f5b('0x18'))['db'];config[_0x5f5b('0x19')]=_[_0x5f5b('0x1a')](config[_0x5f5b('0x19')],{'host':_0x5f5b('0x1b'),'port':0x18eb});var socket=require(_0x5f5b('0x1c'))(new Redis(config['redis']));require(_0x5f5b('0x1d'))['register'](socket);var jayson=require(_0x5f5b('0x1e'));var client=jayson[_0x5f5b('0x1f')][_0x5f5b('0x20')]({'port':0x232c});var client9002=jayson[_0x5f5b('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3676a6,_0xee9da3,_0xcd7fc7,_0x1f5dfb){return new BPromise(function(_0x2e660c,_0x181499){var _0x354edb=_0x1f5dfb||client;return _0x354edb[_0x5f5b('0x21')](_0x3676a6,_0xcd7fc7)[_0x5f5b('0x22')](function(_0x268571){logger[_0x5f5b('0x23')](_0x5f5b('0x24'),_0xee9da3,'request\x20sent');logger[_0x5f5b('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0xee9da3,_0x5f5b('0x26'),JSON[_0x5f5b('0x27')](_0x268571));if(_0x268571[_0x5f5b('0x28')]){if(_0x268571[_0x5f5b('0x28')][_0x5f5b('0x29')]===0x1f4){logger[_0x5f5b('0x28')]('FaxMessage,\x20%s,\x20%s',_0xee9da3,_0x268571['error']['message']);return _0x181499(_0x268571[_0x5f5b('0x28')][_0x5f5b('0x2a')]);}logger[_0x5f5b('0x28')](_0x5f5b('0x24'),_0xee9da3,_0x268571[_0x5f5b('0x28')][_0x5f5b('0x2a')]);return _0x2e660c(_0x268571[_0x5f5b('0x28')][_0x5f5b('0x2a')]);}else{logger[_0x5f5b('0x23')](_0x5f5b('0x24'),_0xee9da3,_0x5f5b('0x26'));_0x2e660c(_0x268571[_0x5f5b('0x2b')][_0x5f5b('0x2a')]);}})[_0x5f5b('0x2c')](function(_0x54da1e){logger[_0x5f5b('0x28')](_0x5f5b('0x24'),_0xee9da3,_0x54da1e);_0x181499(_0x54da1e);});});}function respondWithStatusCode(_0x39c77d,_0x403293){_0x403293=_0x403293||0xcc;return function(_0x2de4d3){if(_0x2de4d3){return _0x39c77d['sendStatus'](_0x403293);}return _0x39c77d[_0x5f5b('0x2d')](_0x403293)[_0x5f5b('0x2e')]();};}function respondWithResult(_0x39ee81,_0x382592){_0x382592=_0x382592||0xc8;return function(_0x3c5aa1){if(_0x3c5aa1){return _0x39ee81[_0x5f5b('0x2d')](_0x382592)[_0x5f5b('0x2f')](_0x3c5aa1);}};}function respondWithFilteredResult(_0x2c8f11,_0x36b94f){return function(_0x4f6394){if(_0x4f6394){var _0x1c4d98=typeof _0x36b94f[_0x5f5b('0x30')]==='undefined'&&typeof _0x36b94f[_0x5f5b('0x31')]===_0x5f5b('0x32');var _0xe314fe=_0x4f6394['count'];var _0x2d618a=_0x1c4d98?0x0:_0x36b94f[_0x5f5b('0x30')];var _0x5f3484=_0x1c4d98?_0x4f6394[_0x5f5b('0x33')]:_0x36b94f[_0x5f5b('0x30')]+_0x36b94f[_0x5f5b('0x31')];var _0x442549;if(_0x5f3484>=_0xe314fe){_0x5f3484=_0xe314fe;_0x442549=0xc8;}else{_0x442549=0xce;}_0x2c8f11[_0x5f5b('0x2d')](_0x442549);return _0x2c8f11['set'](_0x5f5b('0x34'),_0x2d618a+'-'+_0x5f3484+'/'+_0xe314fe)[_0x5f5b('0x2f')](_0x4f6394);}return null;};}function patchUpdates(_0x14301b){return function(_0x2cae84){try{jsonpatch['apply'](_0x2cae84,_0x14301b,!![]);}catch(_0x4e91d0){return BPromise[_0x5f5b('0x35')](_0x4e91d0);}return _0x2cae84['save']();};}function saveUpdates(_0x3a9588,_0x2e5bc4){return function(_0x5b4ab5){if(_0x5b4ab5){return _0x5b4ab5[_0x5f5b('0x36')](_0x3a9588)[_0x5f5b('0x22')](function(_0x4c7b32){return _0x4c7b32;});}return null;};}function removeEntity(_0x5b4a70,_0x279c5c){return function(_0x55c839){if(_0x55c839){return _0x55c839[_0x5f5b('0x37')]()['then'](function(){_0x5b4a70[_0x5f5b('0x2d')](0xcc)[_0x5f5b('0x2e')]();});}};}function handleEntityNotFound(_0x1ebd59,_0x46e5ee){return function(_0x409970){if(!_0x409970){_0x1ebd59[_0x5f5b('0x38')](0x194);}return _0x409970;};}function handleError(_0x404299,_0x111720){_0x111720=_0x111720||0x1f4;return function(_0xe27594){logger[_0x5f5b('0x28')](_0xe27594[_0x5f5b('0x39')]);if(_0xe27594['name']){delete _0xe27594['name'];}_0x404299[_0x5f5b('0x2d')](_0x111720)['send'](_0xe27594);};}exports[_0x5f5b('0x3a')]=function(_0x35ad66,_0x183832){var _0x777827={},_0x278e46={},_0x2d6a41={'count':0x0,'rows':[]};var _0x5a9199=_[_0x5f5b('0x3b')](db['FaxMessage']['rawAttributes'],function(_0x36dd82){return{'name':_0x36dd82[_0x5f5b('0x3c')],'type':_0x36dd82[_0x5f5b('0x3d')][_0x5f5b('0x3e')]};});_0x278e46[_0x5f5b('0x3f')]=_[_0x5f5b('0x3b')](_0x5a9199,_0x5f5b('0x40'));_0x278e46[_0x5f5b('0x41')]=_[_0x5f5b('0x42')](_0x35ad66[_0x5f5b('0x41')]);_0x278e46[_0x5f5b('0x43')]=_[_0x5f5b('0x44')](_0x278e46[_0x5f5b('0x3f')],_0x278e46[_0x5f5b('0x41')]);_0x777827[_0x5f5b('0x45')]=_[_0x5f5b('0x44')](_0x278e46['model'],qs[_0x5f5b('0x46')](_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x46')]));_0x777827[_0x5f5b('0x45')]=_0x777827[_0x5f5b('0x45')][_0x5f5b('0x47')]?_0x777827[_0x5f5b('0x45')]:_0x278e46[_0x5f5b('0x3f')];if(!_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x48')]('nolimit')){_0x777827[_0x5f5b('0x31')]=qs[_0x5f5b('0x31')](_0x35ad66['query'][_0x5f5b('0x31')]);_0x777827[_0x5f5b('0x30')]=qs[_0x5f5b('0x30')](_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x30')]);}_0x777827[_0x5f5b('0x49')]=qs[_0x5f5b('0x4a')](_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x4a')]);_0x777827[_0x5f5b('0x4b')]=qs['filters'](_[_0x5f5b('0x4c')](_0x35ad66['query'],_0x278e46['filters']),_0x5a9199);if(_0x35ad66[_0x5f5b('0x41')]['filter']){_0x777827[_0x5f5b('0x4b')]=_[_0x5f5b('0x4d')](_0x777827[_0x5f5b('0x4b')],{'$or':_['map'](_0x5a9199,function(_0x53a283){if(_0x53a283[_0x5f5b('0x3d')]!==_0x5f5b('0x4e')){var _0xe4c696={};_0xe4c696[_0x53a283['name']]={'$like':'%'+_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x4f')]+'%'};return _0xe4c696;}})});}_0x777827=_['merge']({},_0x777827,_0x35ad66[_0x5f5b('0x50')]);var _0x4c21de={'where':_0x777827[_0x5f5b('0x4b')]};return db['FaxMessage'][_0x5f5b('0x33')](_0x4c21de)['then'](function(_0x305077){_0x2d6a41['count']=_0x305077;if(_0x35ad66['query'][_0x5f5b('0x51')]){_0x777827[_0x5f5b('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x777827);})[_0x5f5b('0x22')](function(_0x23db78){_0x2d6a41[_0x5f5b('0x53')]=_0x23db78;return _0x2d6a41;})[_0x5f5b('0x22')](respondWithFilteredResult(_0x183832,_0x777827))[_0x5f5b('0x2c')](handleError(_0x183832,null));};exports[_0x5f5b('0x54')]=function(_0x54592a,_0x3e3b55){var _0x255d59={'raw':!![],'where':{'id':_0x54592a['params']['id']}},_0x22908f={};_0x22908f['model']=_[_0x5f5b('0x42')](db['FaxMessage']['rawAttributes']);_0x22908f[_0x5f5b('0x41')]=_[_0x5f5b('0x42')](_0x54592a[_0x5f5b('0x41')]);_0x22908f['filters']=_[_0x5f5b('0x44')](_0x22908f[_0x5f5b('0x3f')],_0x22908f[_0x5f5b('0x41')]);_0x255d59[_0x5f5b('0x45')]=_[_0x5f5b('0x44')](_0x22908f[_0x5f5b('0x3f')],qs[_0x5f5b('0x46')](_0x54592a[_0x5f5b('0x41')][_0x5f5b('0x46')]));_0x255d59['attributes']=_0x255d59[_0x5f5b('0x45')][_0x5f5b('0x47')]?_0x255d59[_0x5f5b('0x45')]:_0x22908f[_0x5f5b('0x3f')];if(_0x54592a[_0x5f5b('0x41')][_0x5f5b('0x51')]){_0x255d59[_0x5f5b('0x52')]=[{'all':!![]}];}_0x255d59=_[_0x5f5b('0x4d')]({},_0x255d59,_0x54592a[_0x5f5b('0x50')]);return db['FaxMessage']['find'](_0x255d59)[_0x5f5b('0x22')](handleEntityNotFound(_0x3e3b55,null))[_0x5f5b('0x22')](respondWithResult(_0x3e3b55,null))['catch'](handleError(_0x3e3b55,null));};exports[_0x5f5b('0x36')]=function(_0x502f17,_0x3049d6){if(_0x502f17['body']['id']){delete _0x502f17[_0x5f5b('0x55')]['id'];}return db[_0x5f5b('0x56')][_0x5f5b('0x57')]({'where':{'id':_0x502f17[_0x5f5b('0x58')]['id']}})[_0x5f5b('0x22')](handleEntityNotFound(_0x3049d6,null))[_0x5f5b('0x22')](saveUpdates(_0x502f17[_0x5f5b('0x55')],null))[_0x5f5b('0x22')](respondWithResult(_0x3049d6,null))[_0x5f5b('0x2c')](handleError(_0x3049d6,null));};exports['destroy']=function(_0x584ab7,_0xa283e7){return db['FaxMessage'][_0x5f5b('0x57')]({'where':{'id':_0x584ab7[_0x5f5b('0x58')]['id']}})[_0x5f5b('0x22')](handleEntityNotFound(_0xa283e7,null))['then'](removeEntity(_0xa283e7,null))[_0x5f5b('0x2c')](handleError(_0xa283e7,null));};exports[_0x5f5b('0x59')]=function(_0x57d983,_0x641b0d){return db[_0x5f5b('0x56')][_0x5f5b('0x59')]()['then'](respondWithResult(_0x641b0d,null))[_0x5f5b('0x2c')](handleError(_0x641b0d,null));};var interaction_log=require(_0x5f5b('0x14'))(_0x5f5b('0x5a'));exports[_0x5f5b('0x5b')]=function(_0x2b4230,_0x1dbfd9,_0x53ab36){var _0x20f9d1={'agent':{},'channel':_0x5f5b('0x5c')};if(_0x2b4230[_0x5f5b('0x55')]['id']){delete _0x2b4230[_0x5f5b('0x55')]['id'];}_0x2b4230['body']['read']=!![];_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x5d')]=moment()[_0x5f5b('0x5e')](_0x5f5b('0x5f'));_0x2b4230['body'][_0x5f5b('0x60')]=_0x2b4230['body'][_0x5f5b('0x60')]||_0x2b4230['user']['id'];_0x20f9d1['agent']['id']=_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')];return db[_0x5f5b('0x56')][_0x5f5b('0x57')]({'where':{'id':_0x2b4230[_0x5f5b('0x58')]['id'],'UserId':null}})[_0x5f5b('0x22')](handleEntityNotFound(_0x1dbfd9,null))[_0x5f5b('0x22')](saveUpdates(_0x2b4230[_0x5f5b('0x55')],null))[_0x5f5b('0x22')](function(_0x316b5f){if(_0x316b5f){_0x20f9d1[_0x5f5b('0x2a')]=_0x316b5f['get']({'plain':!![]});return db[_0x5f5b('0x61')][_0x5f5b('0x57')]({'where':{'id':_0x316b5f[_0x5f5b('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1dbfd9,null))[_0x5f5b('0x22')](function(_0x2a9ff7){if(_0x2a9ff7){return _0x2a9ff7['update']({'UserId':_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')],'read1stAt':_[_0x5f5b('0x63')](_0x2a9ff7[_0x5f5b('0x64')])?moment()[_0x5f5b('0x5e')](_0x5f5b('0x5f')):undefined});}return null;})[_0x5f5b('0x22')](function(_0x183096){if(_0x183096){_0x20f9d1[_0x5f5b('0x65')]=_0x183096[_0x5f5b('0x66')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b4230[_0x5f5b('0x67')]['id'],_0x2b4230[_0x5f5b('0x67')]['name'],_0x2b4230[_0x5f5b('0x67')][_0x5f5b('0x68')],_0x20f9d1['interaction']['id'],_0x2b4230[_0x5f5b('0x55')]?JSON[_0x5f5b('0x27')](_0x2b4230[_0x5f5b('0x55')]):_0x5f5b('0x69'));return respondWithRpcPromise(_0x5f5b('0x6a'),_0x5f5b('0x6b'),_0x20f9d1);}return null;})[_0x5f5b('0x22')](function(_0x3c9718){var _0x2a93c3=_0x5f5b('0x6c')+_0x3c9718[_0x5f5b('0x2a')][_0x5f5b('0x6d')];return db[_0x5f5b('0x6e')][_0x5f5b('0x41')](_0x2a93c3,{'type':db['Sequelize']['QueryTypes'][_0x5f5b('0x6f')],'raw':!![]})[_0x5f5b('0x22')](function(_0x5d2aeb){return _0x5d2aeb;});})[_0x5f5b('0x22')](function(_0x44c94a){if(_0x44c94a){_0x20f9d1[_0x5f5b('0x2a')]['contact']=_0x44c94a[0x0];if(!_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')])return;return db[_0x5f5b('0x70')][_0x5f5b('0x57')]({'where':{'id':_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')],'role':_0x5f5b('0x71')},'attributes':['id',_0x5f5b('0x40'),_0x5f5b('0x72'),_0x5f5b('0x73'),_0x5f5b('0x74')],'raw':!![]});}return null;})[_0x5f5b('0x22')](function(_0x341b2a){if(!_0x341b2a)return null;_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x71')]=_0x341b2a;return _0x20f9d1;})['then'](function(_0x59f2b3){if(_0x59f2b3){if(_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x75')]){_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x76')]=util['format'](_0x5f5b('0x77'),_0x2b4230[_0x5f5b('0x67')][_0x5f5b('0x40')]);_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x78')]=_0x20f9d1[_0x5f5b('0x78')];_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x79')]=_0x20f9d1[_0x5f5b('0x78')];_0x20f9d1[_0x5f5b('0x2a')]['event']=_0x5f5b('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5f5b('0x7a'),'message':_0x20f9d1['message']},client9002)[_0x5f5b('0x22')](function(){return _0x20f9d1;});}return _0x20f9d1;}return null;})[_0x5f5b('0x22')](respondWithResult(_0x1dbfd9,null))[_0x5f5b('0x2c')](handleError(_0x1dbfd9,null));};var interaction_log=require(_0x5f5b('0x14'))(_0x5f5b('0x5a'));exports['reject']=function(_0x12d3fd,_0x224783,_0x28e682){var _0x11b85f={'agent':{},'channel':_0x5f5b('0x5c')};if(_0x12d3fd['body']['id']){delete _0x12d3fd[_0x5f5b('0x55')]['id'];}_0x12d3fd[_0x5f5b('0x55')]['UserId']=_0x12d3fd[_0x5f5b('0x55')][_0x5f5b('0x60')]||_0x12d3fd[_0x5f5b('0x67')]['id'];_0x11b85f[_0x5f5b('0x71')]['id']=_0x12d3fd[_0x5f5b('0x55')][_0x5f5b('0x60')];return db['FaxMessage']['find']({'where':{'id':_0x12d3fd[_0x5f5b('0x58')]['id'],'UserId':null}})[_0x5f5b('0x22')](handleEntityNotFound(_0x224783,null))[_0x5f5b('0x22')](function(_0x5db7ee){if(_0x5db7ee){_0x11b85f[_0x5f5b('0x2a')]=_0x5db7ee[_0x5f5b('0x66')]({'plain':!![]});return db[_0x5f5b('0x61')][_0x5f5b('0x57')]({'where':{'id':_0x5db7ee[_0x5f5b('0x62')]}});}return null;})[_0x5f5b('0x22')](handleEntityNotFound(_0x224783,null))[_0x5f5b('0x22')](function(_0x179ef1){if(_0x179ef1){_0x11b85f[_0x5f5b('0x65')]=_0x179ef1[_0x5f5b('0x66')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12d3fd[_0x5f5b('0x67')]['id'],_0x12d3fd[_0x5f5b('0x67')][_0x5f5b('0x40')],_0x12d3fd[_0x5f5b('0x67')][_0x5f5b('0x68')],_0x11b85f[_0x5f5b('0x65')]['id'],_0x12d3fd[_0x5f5b('0x55')]?JSON['stringify'](_0x12d3fd['body']):_0x5f5b('0x69'));return respondWithRpcPromise('RejectMessage',_0x5f5b('0x7b'),_0x11b85f);}return null;})[_0x5f5b('0x22')](function(_0x165e40){var _0x486cee=_0x5f5b('0x6c')+_0x165e40['message'][_0x5f5b('0x6d')];return db[_0x5f5b('0x6e')][_0x5f5b('0x41')](_0x486cee,{'type':db[_0x5f5b('0x7c')][_0x5f5b('0x7d')][_0x5f5b('0x6f')],'raw':!![]})[_0x5f5b('0x22')](function(_0x560950){return _0x560950;});})['then'](function(_0x468f7b){if(_0x468f7b){_0x11b85f[_0x5f5b('0x2a')][_0x5f5b('0x7e')]=_0x468f7b[0x0];if(!_0x12d3fd['body']['UserId'])return;return db[_0x5f5b('0x70')]['find']({'where':{'id':_0x12d3fd[_0x5f5b('0x55')][_0x5f5b('0x60')],'role':'agent'},'attributes':['id','name',_0x5f5b('0x72'),_0x5f5b('0x73'),_0x5f5b('0x74')],'raw':!![]});}return null;})[_0x5f5b('0x22')](function(_0x148120){if(!_0x148120)return null;_0x11b85f[_0x5f5b('0x2a')][_0x5f5b('0x71')]=_0x148120;return _0x11b85f;})['then'](function(_0xe328b3){if(_0xe328b3){_0xe328b3[_0x5f5b('0x2a')][_0x5f5b('0x76')]=util[_0x5f5b('0x5e')](_0x5f5b('0x77'),_0x12d3fd[_0x5f5b('0x67')][_0x5f5b('0x40')]);_0xe328b3[_0x5f5b('0x2a')][_0x5f5b('0x78')]=_0x11b85f[_0x5f5b('0x78')];_0xe328b3[_0x5f5b('0x2a')][_0x5f5b('0x79')]=_0x11b85f[_0x5f5b('0x78')];_0xe328b3[_0x5f5b('0x2a')]['event']=_0x5f5b('0x35');respondWithRpcPromise(_0x5f5b('0x7f'),_0x5f5b('0x7f'),{'event':'rejectmessage','message':_0xe328b3[_0x5f5b('0x2a')]},client9002);return _0x11b85f;}return null;})['then'](respondWithResult(_0x224783,null))['catch'](handleError(_0x224783,null));};exports[_0x5f5b('0x80')]=function(_0x280955,_0x3f6a14){var _0x13d71b;return db[_0x5f5b('0x56')][_0x5f5b('0x80')](_0x280955[_0x5f5b('0x55')],{})[_0x5f5b('0x22')](function(_0x3c74eb){_0x13d71b=_0x3c74eb;return db[_0x5f5b('0x81')]['findOne']({'where':{'id':_0x13d71b[_0x5f5b('0x6d')]}});})[_0x5f5b('0x22')](function(_0x1b9ac8){if(_['isNil'](_0x1b9ac8)){return;}else{_0x13d71b[_0x5f5b('0x5c')]=_0x1b9ac8[_0x5f5b('0x5c')];return db[_0x5f5b('0x82')][_0x5f5b('0x83')]({'where':{'id':_0x13d71b[_0x5f5b('0x84')]}});}})[_0x5f5b('0x22')](function(_0x3baaa5){return respondWithRpcPromise(_0x5f5b('0x85'),_0x5f5b('0x85'),{'FaxAccountId':_[_0x5f5b('0x63')](_0x280955['body'])?undefined:_0x280955[_0x5f5b('0x55')][_0x5f5b('0x86')],'path':_[_0x5f5b('0x63')](_0x3baaa5)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x3baaa5['basename']),'fax':_['isNil'](_0x13d71b[_0x5f5b('0x5c')])?undefined:_0x13d71b[_0x5f5b('0x5c')],'AttachmentId':_0x13d71b[_0x5f5b('0x84')]},client9002);})['then'](respondWithResult(_0x3f6a14,0xc9))[_0x5f5b('0x2c')](handleError(_0x3f6a14,null));};exports[_0x5f5b('0x87')]=function(_0x38b51d,_0x5e347f){var _0x39f11b=path[_0x5f5b('0x88')](config[_0x5f5b('0x89')],_0x5f5b('0x8a'),_0x5f5b('0x8b'),_0x5f5b('0x8c'));return db[_0x5f5b('0x56')][_0x5f5b('0x57')]({'where':{'id':_0x38b51d[_0x5f5b('0x58')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x5e347f,null))['then'](function(_0x2cda91){if(_0x2cda91){return _0x5e347f[_0x5f5b('0x87')](path[_0x5f5b('0x88')](_0x39f11b,_0x2cda91[_0x5f5b('0x82')]['basename']));}})['catch'](handleError(_0x5e347f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 11ec39a..7965f1d 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 _0xf40b=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x22708e,_0x4f2c28){var _0x3c66db=function(_0x152aef){while(--_0x152aef){_0x22708e['push'](_0x22708e['shift']());}};_0x3c66db(++_0x4f2c28);}(_0xf40b,0xb0));var _0xbf40=function(_0x2601c2,_0x16bec){_0x2601c2=_0x2601c2-0x0;var _0x499fcb=_0xf40b[_0x2601c2];return _0x499fcb;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xbf40('0x0'))['db'][_0xbf40('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xbf40('0x2')](0x0);var events={'afterCreate':_0xbf40('0x3'),'afterUpdate':'update','afterDestroy':_0xbf40('0x4')};function emitEvent(_0x2a92dc){return function(_0x118fce,_0x887cae,_0x1a1c6f){FaxMessageEvents['emit'](_0x2a92dc+':'+_0x118fce['id'],_0x118fce);FaxMessageEvents[_0xbf40('0x5')](_0x2a92dc,_0x118fce);_0x1a1c6f(null);};}for(var e in events){if(events[_0xbf40('0x6')](e)){var event=events[e];FaxMessage[_0xbf40('0x7')](e,emitEvent(event));}}module[_0xbf40('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xf435=['update','emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0xf435,0x174));var _0x5f43=function(_0xc96929,_0x4097c9){_0xc96929=_0xc96929-0x0;var _0x744a38=_0xf435[_0xc96929];return _0x744a38;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x5f43('0x0'))['db'][_0x5f43('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5f43('0x2')](0x0);var events={'afterCreate':_0x5f43('0x3'),'afterUpdate':_0x5f43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x286c03){return function(_0x968d6a,_0x312c99,_0x140bd7){FaxMessageEvents['emit'](_0x286c03+':'+_0x968d6a['id'],_0x968d6a);FaxMessageEvents[_0x5f43('0x5')](_0x286c03,_0x968d6a);_0x140bd7(null);};}for(var e in events){if(events[_0x5f43('0x6')](e)){var event=events[e];FaxMessage[_0x5f43('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e10e083..1e3cb73 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 _0xd2d5=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','direction','toLowerCase','out','isNil','findOne','FaxInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xdcc6ae,_0x1c3228){var _0x18108f=function(_0x302ccd){while(--_0x302ccd){_0xdcc6ae['push'](_0xdcc6ae['shift']());}};_0x18108f(++_0x1c3228);}(_0xd2d5,0xf9));var _0x5d2d=function(_0x481af3,_0x483fac){_0x481af3=_0x481af3-0x0;var _0x3354ea=_0xd2d5[_0x481af3];return _0x3354ea;};'use strict';var _=require(_0x5d2d('0x0'));var util=require(_0x5d2d('0x1'));var logger=require(_0x5d2d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d2d('0x3'));var rp=require(_0x5d2d('0x4'));var fs=require('fs');var path=require(_0x5d2d('0x5'));var rimraf=require(_0x5d2d('0x6'));var config=require(_0x5d2d('0x7'));var attributes=require('./faxMessage.attributes');module[_0x5d2d('0x8')]=function(_0xca1b05,_0x8b5c25){return _0xca1b05[_0x5d2d('0x9')](_0x5d2d('0xa'),attributes,{'tableName':_0x5d2d('0xb'),'paranoid':![],'indexes':[{'name':_0x5d2d('0xc'),'fields':['body'],'type':_0x5d2d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b4550,_0x152686,_0x5d681d){var _0x5e2fb6=_0xca1b05[_0x5d2d('0xe')];var _0x20cecb=_0x4b4550['get']({'plain':!![]});if(_0x20cecb[_0x5d2d('0xf')][_0x5d2d('0x10')]()==='in'||_0x20cecb['direction']['toLowerCase']()===_0x5d2d('0x11')&&!_0x20cecb['secret']&&!_[_0x5d2d('0x12')](_0x20cecb['UserId'])){_0x5e2fb6['FaxInteraction'][_0x5d2d('0x13')]({'where':{'id':_0x20cecb[_0x5d2d('0x14')]}})[_0x5d2d('0x15')](function(_0x3da2f7){if(_0x3da2f7){_0x3da2f7[_0x5d2d('0x16')]({'lastMsgAt':_0x20cecb['createdAt'],'lastMsgDirection':_0x20cecb['direction'][_0x5d2d('0x10')]()});}})['catch'](function(_0x1b4732){console['error'](_0x1b4732);});}_0x5d681d();}},'charset':_0x5d2d('0x17'),'collate':_0x5d2d('0x18')});}; \ No newline at end of file +var _0xe2dc=['FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe2dc,0x19f));var _0xce2d=function(_0x3416a8,_0x4b32b7){_0x3416a8=_0x3416a8-0x0;var _0x2ff995=_0xe2dc[_0x3416a8];return _0x2ff995;};'use strict';var _=require(_0xce2d('0x0'));var util=require(_0xce2d('0x1'));var logger=require('../../config/logger')(_0xce2d('0x2'));var moment=require(_0xce2d('0x3'));var BPromise=require(_0xce2d('0x4'));var rp=require(_0xce2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce2d('0x6'));var config=require(_0xce2d('0x7'));var attributes=require(_0xce2d('0x8'));module[_0xce2d('0x9')]=function(_0x47848d,_0x13994e){return _0x47848d['define'](_0xce2d('0xa'),attributes,{'tableName':_0xce2d('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xce2d('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5658ec,_0x281efb,_0x133a01){var _0x2e7e92=_0x47848d['models'];var _0x1488db=_0x5658ec[_0xce2d('0xd')]({'plain':!![]});if(_0x1488db[_0xce2d('0xe')][_0xce2d('0xf')]()==='in'||_0x1488db['direction'][_0xce2d('0xf')]()===_0xce2d('0x10')&&!_0x1488db[_0xce2d('0x11')]&&!_[_0xce2d('0x12')](_0x1488db[_0xce2d('0x13')])){_0x2e7e92[_0xce2d('0x14')][_0xce2d('0x15')]({'where':{'id':_0x1488db['FaxInteractionId']}})[_0xce2d('0x16')](function(_0x39d874){if(_0x39d874){_0x39d874[_0xce2d('0x17')]({'lastMsgAt':_0x1488db[_0xce2d('0x18')],'lastMsgDirection':_0x1488db[_0xce2d('0xe')][_0xce2d('0xf')]()});}})[_0xce2d('0x19')](function(_0xdb39d1){console[_0xce2d('0x1a')](_0xdb39d1);});}_0x133a01();}},'charset':_0xce2d('0x1b'),'collate':_0xce2d('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 6fe1b77..c49bcea 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 _0xbd50=['request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','options','raw','then','UpdateFaxMessage','FaxMessage','update','body','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','./faxMessage.socket','register'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xbd50,0x196));var _0x0bd5=function(_0x3d564e,_0x2744e2){_0x3d564e=_0x3d564e-0x0;var _0x52e232=_0xbd50[_0x3d564e];return _0x52e232;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});config[_0x0bd5('0xa')]=_[_0x0bd5('0xb')](config[_0x0bd5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd5('0xa')]));require(_0x0bd5('0xc'))[_0x0bd5('0xd')](socket);function respondWithRpcPromise(_0x5f5a0c,_0xa98f54,_0x2fa7d1){return new BPromise(function(_0x519bc6,_0x210f45){return client[_0x0bd5('0xe')](_0x5f5a0c,_0x2fa7d1)['then'](function(_0x1ce7dd){logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,'request\x20sent');logger[_0x0bd5('0x11')](_0x0bd5('0x12'),_0xa98f54,_0x0bd5('0x13'),JSON[_0x0bd5('0x14')](_0x1ce7dd));if(_0x1ce7dd[_0x0bd5('0x15')]){if(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x16')]===0x1f4){logger[_0x0bd5('0x15')]('FaxMessage,\x20%s,\x20%s',_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);return _0x210f45(_0x1ce7dd['error'][_0x0bd5('0x17')]);}logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')]['message']);return _0x519bc6(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);}else{logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,_0x0bd5('0x13'));_0x519bc6(_0x1ce7dd[_0x0bd5('0x18')][_0x0bd5('0x17')]);}})[_0x0bd5('0x19')](function(_0x29fa4c){logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x29fa4c);_0x210f45(_0x29fa4c);});});}exports[_0x0bd5('0x1a')]=function(_0x4008bd){var _0x2dc1e5=this;return new Promise(function(_0x527c37,_0x5ba943){return db['FaxMessage']['create'](_0x4008bd['body'],{'raw':_0x4008bd[_0x0bd5('0x1b')]?_0x4008bd[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![]})[_0x0bd5('0x1d')](function(_0x6ee1a8){logger['info'](_0x0bd5('0x1a'),_0x4008bd);logger[_0x0bd5('0x11')](_0x0bd5('0x1a'),_0x4008bd,JSON['stringify'](_0x6ee1a8));_0x527c37(_0x6ee1a8);})[_0x0bd5('0x19')](function(_0x4a8787){logger['error'](_0x0bd5('0x1a'),_0x4a8787[_0x0bd5('0x17')],_0x4008bd);_0x5ba943(_0x2dc1e5[_0x0bd5('0x15')](0x1f4,_0x4a8787['message']));});});};exports[_0x0bd5('0x1e')]=function(_0x5eab3e){var _0x456e87=this;return new Promise(function(_0x3ffb08,_0x18cec3){return db[_0x0bd5('0x1f')][_0x0bd5('0x20')](_0x5eab3e[_0x0bd5('0x21')],{'raw':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x22')]||null:null,'attributes':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['attributes']||null:null,'limit':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['limit']||null:null})[_0x0bd5('0x1d')](function(_0x8eccc9){logger['info'](_0x0bd5('0x1e'),_0x5eab3e);logger[_0x0bd5('0x11')](_0x0bd5('0x1e'),_0x5eab3e,JSON[_0x0bd5('0x14')](_0x8eccc9));_0x3ffb08(_0x8eccc9);})['catch'](function(_0x440e69){logger[_0x0bd5('0x15')](_0x0bd5('0x1e'),_0x440e69[_0x0bd5('0x17')],_0x5eab3e);_0x18cec3(_0x456e87[_0x0bd5('0x15')](0x1f4,_0x440e69[_0x0bd5('0x17')]));});});}; \ No newline at end of file +var _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xed1f,0x6a));var _0xfed1=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xed1f[_0x576170];return _0x397c70;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7a792eb..76063ac 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 _0x644c=['removeListener','register','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x4d2d07,_0x59b3f6){var _0x5b3dd5=function(_0x5d334d){while(--_0x5d334d){_0x4d2d07['push'](_0x4d2d07['shift']());}};_0x5b3dd5(++_0x59b3f6);}(_0x644c,0x11b));var _0xc644=function(_0x25f7a4,_0x476575){_0x25f7a4=_0x25f7a4-0x0;var _0x4130a2=_0x644c[_0x25f7a4];return _0x4130a2;};'use strict';var FaxMessageEvents=require(_0xc644('0x0'));var events=[_0xc644('0x1'),_0xc644('0x2'),_0xc644('0x3')];function createListener(_0x1f46ef,_0x4d319c){return function(_0x7ce0d8){_0x4d319c[_0xc644('0x4')](_0x1f46ef,_0x7ce0d8);};}function removeListener(_0x2b593b,_0x5e6181){return function(){FaxMessageEvents[_0xc644('0x5')](_0x2b593b,_0x5e6181);};}exports[_0xc644('0x6')]=function(_0x5c65c9){for(var _0x1e05f5=0x0,_0x5afa95=events['length'];_0x1e05f5<_0x5afa95;_0x1e05f5++){var _0x128ee3=events[_0x1e05f5];var _0x54e60f=createListener(_0xc644('0x7')+_0x128ee3,_0x5c65c9);FaxMessageEvents['on'](_0x128ee3,_0x54e60f);}}; \ No newline at end of file +var _0x845c=['emit','removeListener','length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x45d032,_0x1d9fd1){var _0x25d880=function(_0x1eeb8e){while(--_0x1eeb8e){_0x45d032['push'](_0x45d032['shift']());}};_0x25d880(++_0x1d9fd1);}(_0x845c,0xe4));var _0xc845=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x845c[_0x3ab51d];return _0x29a04e;};'use strict';var FaxMessageEvents=require(_0xc845('0x0'));var events=[_0xc845('0x1'),_0xc845('0x2'),_0xc845('0x3')];function createListener(_0x4d09f7,_0x5c5099){return function(_0x4834b3){_0x5c5099[_0xc845('0x4')](_0x4d09f7,_0x4834b3);};}function removeListener(_0x2499f4,_0x1646ba){return function(){FaxMessageEvents[_0xc845('0x5')](_0x2499f4,_0x1646ba);};}exports['register']=function(_0x1e8d8a){for(var _0x4943df=0x0,_0x3d9b1b=events[_0xc845('0x6')];_0x4943df<_0x3d9b1b;_0x4943df++){var _0x16dd86=events[_0x4943df];var _0x36cb8c=createListener(_0xc845('0x7')+_0x16dd86,_0x1e8d8a);FaxMessageEvents['on'](_0x16dd86,_0x36cb8c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 7d596d1..5e3c6ad 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 _0xc368=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','download','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','delete','destroy','exports','util','connect-timeout'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xc368,0x7b));var _0x8c36=function(_0x1d4484,_0x2cb9a5){_0x1d4484=_0x1d4484-0x0;var _0x2dc186=_0xc368[_0x1d4484];return _0x2dc186;};'use strict';var multer=require('multer');var util=require(_0x8c36('0x0'));var path=require('path');var timeout=require(_0x8c36('0x1'));var express=require(_0x8c36('0x2'));var router=express[_0x8c36('0x3')]();var fs_extra=require(_0x8c36('0x4'));var auth=require(_0x8c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c36('0x6'));var controller=require(_0x8c36('0x7'));router[_0x8c36('0x8')]('/',auth[_0x8c36('0x9')](),controller['index']);router['get'](_0x8c36('0xa'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xb')]);router[_0x8c36('0x8')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller['show']);router['get']('/:id/download',auth[_0x8c36('0x9')](),controller[_0x8c36('0xd')]);router['post']('/',auth[_0x8c36('0x9')](),interaction[_0x8c36('0xe')](_0x8c36('0xf'),_0x8c36('0x10')),controller[_0x8c36('0x11')]);router[_0x8c36('0x12')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x13')]);router[_0x8c36('0x12')](_0x8c36('0x14'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x15')]);router[_0x8c36('0x12')]('/:id/reject',auth[_0x8c36('0x9')](),controller['reject']);router[_0x8c36('0x16')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x17')]);module[_0x8c36('0x18')]=router; \ No newline at end of file +var _0x9354=['describe','/:id','show','/:id/download','download','post','fax','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x582780,_0x227ce6){var _0x815a16=function(_0x2b5cca){while(--_0x2b5cca){_0x582780['push'](_0x582780['shift']());}};_0x815a16(++_0x227ce6);}(_0x9354,0x96));var _0x4935=function(_0x2e7c1b,_0x232f79){_0x2e7c1b=_0x2e7c1b-0x0;var _0x42f565=_0x9354[_0x2e7c1b];return _0x42f565;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4935('0x12'),'faxmessage:create'),controller['create']);router[_0x4935('0x13')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x13')](_0x4935('0x15'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);router[_0x4935('0x13')](_0x4935('0x17'),auth[_0x4935('0x9')](),controller[_0x4935('0x18')]);router[_0x4935('0x19')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 739ee4f..4da91bf 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 _0x0d4d=['exports','STRING','INTEGER','rrmemory','beepall','sequelize'];(function(_0xf7c208,_0x5cbc84){var _0x16992d=function(_0x2fe157){while(--_0x2fe157){_0xf7c208['push'](_0xf7c208['shift']());}};_0x16992d(++_0x5cbc84);}(_0x0d4d,0x10d));var _0xd0d4=function(_0x15e221,_0x2a3790){_0x15e221=_0x15e221-0x0;var _0x165892=_0x0d4d[_0x15e221];return _0x165892;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd0d4('0x2')]},'timeout':{'type':Sequelize[_0xd0d4('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd0d4('0x4'),_0xd0d4('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd0d4('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6f6d=['name','INTEGER','rrmemory','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6f6d,0x141));var _0xd6f6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6f6d[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xd6f6('0x0'));module[_0xd6f6('0x1')]={'name':{'type':Sequelize[_0xd6f6('0x2')],'unique':_0xd6f6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd6f6('0x2')]},'timeout':{'type':Sequelize[_0xd6f6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd6f6('0x5'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index fe1cbc5..0d1d1fa 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 _0x4753=['transaction','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','from','team_has_fax_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','redis','localhost','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','getOptions','include','query','findAll','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserFaxQueue','hasOwnProperty','order','sort','pick','where','FaxQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','Team','filter','nolimit','addTeams','Agents','online','flatMap','sequelize'];(function(_0x45ef7c,_0x4827ed){var _0x7f72cd=function(_0x3e2979){while(--_0x3e2979){_0x45ef7c['push'](_0x45ef7c['shift']());}};_0x7f72cd(++_0x4827ed);}(_0x4753,0x1f4));var _0x3475=function(_0x44927a,_0x228bdd){_0x44927a=_0x44927a-0x0;var _0x710bee=_0x4753[_0x44927a];return _0x710bee;};'use strict';var BPromise=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var _=require(_0x3475('0x2'));var squel=require('squel');var Redis=require(_0x3475('0x3'));var qs=require(_0x3475('0x4'));var logger=require('../../config/logger')(_0x3475('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3475('0x6')],{'host':_0x3475('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3475('0x6')]));require(_0x3475('0x8'))[_0x3475('0x9')](socket);function respondWithStatusCode(_0x1d021b,_0x6b37e6){_0x6b37e6=_0x6b37e6||0xcc;return function(_0xae52cf){if(_0xae52cf){return _0x1d021b[_0x3475('0xa')](_0x6b37e6);}return _0x1d021b[_0x3475('0xb')](_0x6b37e6)[_0x3475('0xc')]();};}function respondWithResult(_0xf56f7d,_0x5a0fba){_0x5a0fba=_0x5a0fba||0xc8;return function(_0x30f276){if(_0x30f276){return _0xf56f7d[_0x3475('0xb')](_0x5a0fba)[_0x3475('0xd')](_0x30f276);}};}function respondWithFilteredResult(_0x4cb55a,_0x2e2662){return function(_0x3e6cae){if(_0x3e6cae){var _0x49e0fa=typeof _0x2e2662[_0x3475('0xe')]==='undefined'&&typeof _0x2e2662[_0x3475('0xf')]===_0x3475('0x10');var _0x1b9cfc=_0x3e6cae['count'];var _0x3fbdd5=_0x49e0fa?0x0:_0x2e2662[_0x3475('0xe')];var _0x306cd8=_0x49e0fa?_0x3e6cae[_0x3475('0x11')]:_0x2e2662['offset']+_0x2e2662[_0x3475('0xf')];var _0x56e77a;if(_0x306cd8>=_0x1b9cfc){_0x306cd8=_0x1b9cfc;_0x56e77a=0xc8;}else{_0x56e77a=0xce;}_0x4cb55a['status'](_0x56e77a);return _0x4cb55a[_0x3475('0x12')](_0x3475('0x13'),_0x3fbdd5+'-'+_0x306cd8+'/'+_0x1b9cfc)[_0x3475('0xd')](_0x3e6cae);}return null;};}function saveUpdates(_0x1e0c0a){return function(_0x8be7e6){if(_0x8be7e6){return _0x8be7e6['update'](_0x1e0c0a)[_0x3475('0x14')](function(_0x547009){return _0x547009;});}return null;};}function removeEntity(_0x12a893){return function(_0x26764a){if(_0x26764a){return _0x26764a[_0x3475('0x15')]()[_0x3475('0x14')](function(){var _0x5983a8=_0x26764a[_0x3475('0x16')]({'plain':!![]});var _0x4d22e7=_0x3475('0x17');return db[_0x3475('0x18')][_0x3475('0x15')]({'where':{'type':_0x4d22e7,'resourceId':_0x5983a8['id']}})[_0x3475('0x14')](function(){return _0x26764a;});})['then'](function(){_0x12a893[_0x3475('0xb')](0xcc)[_0x3475('0xc')]();});}};}function handleEntityNotFound(_0x649ad){return function(_0x4e0221){if(!_0x4e0221){_0x649ad[_0x3475('0xa')](0x194);}return _0x4e0221;};}function handleError(_0x381aea,_0x438992){_0x438992=_0x438992||0x1f4;return function(_0x38ea14){logger[_0x3475('0x19')](_0x38ea14[_0x3475('0x1a')]);if(_0x38ea14[_0x3475('0x1b')]){delete _0x38ea14[_0x3475('0x1b')];}_0x381aea[_0x3475('0xb')](_0x438992)[_0x3475('0x1c')](_0x38ea14);};}exports[_0x3475('0x1d')]=function(_0x1e8830,_0x1c8ca6){var _0x4ff2a1={};var _0x4d35f9={'count':0x0,'rows':[]};var _0x52c825=_[_0x3475('0x1e')](db[_0x3475('0x1f')]['rawAttributes'],function(_0x1f3481){return{'name':_0x1f3481[_0x3475('0x20')],'type':_0x1f3481[_0x3475('0x21')][_0x3475('0x22')]};});_0x4ff2a1=qs[_0x3475('0x23')](_0x52c825,_0x1e8830);var _0x52ca74={'where':_0x4ff2a1['where']};return db[_0x3475('0x1f')][_0x3475('0x11')](_0x52ca74)[_0x3475('0x14')](function(_0x3a3b8a){_0x4d35f9[_0x3475('0x11')]=_0x3a3b8a;_0x4ff2a1[_0x3475('0x24')]=qs['include'](_0x1e8830[_0x3475('0x25')]);return db[_0x3475('0x1f')][_0x3475('0x26')](_0x4ff2a1);})[_0x3475('0x14')](function(_0x26426a){_0x4d35f9['rows']=_0x26426a;return _0x4d35f9;})['then'](respondWithFilteredResult(_0x1c8ca6,_0x4ff2a1))[_0x3475('0x27')](handleError(_0x1c8ca6,null));};exports[_0x3475('0x28')]=function(_0x18fd29,_0x5426bc){var _0x2d95c0={'raw':!![],'where':{'id':_0x18fd29[_0x3475('0x29')]['id']}},_0x40d37a={};_0x40d37a[_0x3475('0x2a')]=_[_0x3475('0x2b')](db[_0x3475('0x1f')][_0x3475('0x2c')]);_0x40d37a['query']=_[_0x3475('0x2b')](_0x18fd29[_0x3475('0x25')]);_0x40d37a[_0x3475('0x2d')]=_[_0x3475('0x2e')](_0x40d37a[_0x3475('0x2a')],_0x40d37a[_0x3475('0x25')]);_0x2d95c0[_0x3475('0x2f')]=_[_0x3475('0x2e')](_0x40d37a[_0x3475('0x2a')],qs[_0x3475('0x30')](_0x18fd29['query']['fields']));_0x2d95c0[_0x3475('0x2f')]=_0x2d95c0[_0x3475('0x2f')][_0x3475('0x31')]?_0x2d95c0[_0x3475('0x2f')]:_0x40d37a[_0x3475('0x2a')];if(_0x18fd29['query']['includeAll']){_0x2d95c0[_0x3475('0x24')]=[{'all':!![]}];}_0x2d95c0=_[_0x3475('0x32')]({},_0x2d95c0,_0x18fd29[_0x3475('0x33')]);return db[_0x3475('0x1f')]['find'](_0x2d95c0)[_0x3475('0x14')](handleEntityNotFound(_0x5426bc,null))[_0x3475('0x14')](respondWithResult(_0x5426bc,null))[_0x3475('0x27')](handleError(_0x5426bc,null));};exports[_0x3475('0x34')]=function(_0x2a3cee,_0x1a697e){return db[_0x3475('0x1f')][_0x3475('0x34')](_0x2a3cee[_0x3475('0x35')],{})[_0x3475('0x14')](function(_0x2ec299){var _0x5909db=_0x2a3cee['user'][_0x3475('0x16')]({'plain':!![]});if(!_0x5909db)throw new Error(_0x3475('0x36'));if(_0x5909db[_0x3475('0x37')]===_0x3475('0x38')){var _0x10dbdf=_0x2ec299[_0x3475('0x16')]({'plain':!![]});var _0x2e6ad2=_0x3475('0x17');return db['UserProfileSection'][_0x3475('0x39')]({'where':{'name':_0x2e6ad2,'userProfileId':_0x5909db[_0x3475('0x3a')]},'raw':!![]})[_0x3475('0x14')](function(_0x5962d4){if(_0x5962d4&&_0x5962d4[_0x3475('0x3b')]===0x0){return db[_0x3475('0x18')][_0x3475('0x34')]({'name':_0x10dbdf[_0x3475('0x1b')],'resourceId':_0x10dbdf['id'],'type':_0x5962d4['name'],'sectionId':_0x5962d4['id']},{})[_0x3475('0x14')](function(){return _0x2ec299;});}else{return _0x2ec299;}})[_0x3475('0x27')](function(_0xcd8f8d){logger['error'](_0x3475('0x3c'),_0xcd8f8d);throw _0xcd8f8d;});}return _0x2ec299;})['then'](respondWithResult(_0x1a697e,0xc9))[_0x3475('0x27')](handleError(_0x1a697e,null));};exports[_0x3475('0x3d')]=function(_0x2b40b9,_0x14de28){if(_0x2b40b9[_0x3475('0x35')]['id']){delete _0x2b40b9['body']['id'];}return db[_0x3475('0x1f')]['find']({'where':{'id':_0x2b40b9['params']['id']}})[_0x3475('0x14')](handleEntityNotFound(_0x14de28,null))[_0x3475('0x14')](saveUpdates(_0x2b40b9['body'],null))[_0x3475('0x14')](respondWithResult(_0x14de28,null))[_0x3475('0x27')](handleError(_0x14de28,null));};exports[_0x3475('0x15')]=function(_0x394d62,_0x556b20){return db['FaxQueue'][_0x3475('0x39')]({'where':{'id':_0x394d62['params']['id']}})['then'](handleEntityNotFound(_0x556b20,null))['then'](removeEntity(_0x556b20,null))[_0x3475('0x27')](handleError(_0x556b20,null));};exports['describe']=function(_0x4265e0,_0x552700){return db[_0x3475('0x1f')][_0x3475('0x3e')]()[_0x3475('0x14')](respondWithResult(_0x552700,null))[_0x3475('0x27')](handleError(_0x552700,null));};exports['getMembers']=function(_0x6c593b,_0x5d1833){var _0x473747={'raw':!![],'where':{}},_0x3793c4={},_0x5c5e3e;return db[_0x3475('0x1f')][_0x3475('0x3f')]({'where':{'id':_0x6c593b[_0x3475('0x29')]['id']}})['then'](handleEntityNotFound(_0x5d1833,null))[_0x3475('0x14')](function(_0x514cb1){if(_0x514cb1){_0x5c5e3e=_0x514cb1[_0x3475('0x16')]({'plain':!![]});_0x3793c4['model']=_['keys'](db[_0x3475('0x40')][_0x3475('0x2c')]);_0x3793c4[_0x3475('0x25')]=_['keys'](_0x6c593b['query']);_0x3793c4[_0x3475('0x2d')]=_['intersection'](_0x3793c4[_0x3475('0x2a')],_0x3793c4[_0x3475('0x25')]);_0x473747[_0x3475('0x2f')]=_[_0x3475('0x2e')](_0x3793c4['model'],qs[_0x3475('0x30')](_0x6c593b['query']['fields']));_0x473747['attributes']=_0x473747[_0x3475('0x2f')][_0x3475('0x31')]?_0x473747[_0x3475('0x2f')]:_0x3793c4['model'];if(!_0x6c593b[_0x3475('0x25')][_0x3475('0x41')]('nolimit')){_0x473747[_0x3475('0xf')]=qs[_0x3475('0xf')](_0x6c593b[_0x3475('0x25')][_0x3475('0xf')]);_0x473747[_0x3475('0xe')]=qs['offset'](_0x6c593b[_0x3475('0x25')]['offset']);}_0x473747[_0x3475('0x42')]=qs[_0x3475('0x43')](_0x6c593b[_0x3475('0x25')][_0x3475('0x43')]);_0x473747['where']=qs[_0x3475('0x2d')](_[_0x3475('0x44')](_0x6c593b[_0x3475('0x25')],_0x3793c4[_0x3475('0x2d')]));_0x473747[_0x3475('0x45')][_0x3475('0x46')]=_0x514cb1['id'];if(_0x6c593b[_0x3475('0x25')]['filter']){_0x473747[_0x3475('0x45')]=_[_0x3475('0x32')](_0x473747['where'],{'$or':_[_0x3475('0x1e')](_0x473747[_0x3475('0x2f')],function(_0x573eab){var _0x114eef={};_0x114eef[_0x573eab]={'$like':'%'+_0x6c593b[_0x3475('0x25')]['filter']+'%'};return _0x114eef;})});}_0x473747=_[_0x3475('0x32')]({},_0x473747,_0x6c593b[_0x3475('0x33')]);return db[_0x3475('0x40')][_0x3475('0x26')](_0x473747);}})[_0x3475('0x14')](function(_0x37ff09){if(_0x37ff09){return db[_0x3475('0x47')][_0x3475('0x48')]({'where':{'id':_[_0x3475('0x1e')](_0x37ff09,_0x3475('0x49')),'role':_0x3475('0x4a')},'attributes':['id','name','faxPause',_0x3475('0x4b'),_0x3475('0x4c')]});}})[_0x3475('0x14')](function(_0x59e620){if(_0x59e620){return{'count':_0x59e620[_0x3475('0x11')],'rows':_[_0x3475('0x1e')](_0x59e620[_0x3475('0x4d')],function(_0x97383e){return{'membername':_0x97383e[_0x3475('0x1b')],'UserId':_0x97383e['id'],'queue_name':_0x5c5e3e['name'],'FaxQueueId':_0x5c5e3e['id'],'interface':util[_0x3475('0x4e')](_0x3475('0x4f'),_0x3475('0x50'),_0x97383e[_0x3475('0x1b')]),'penalty':0x0,'paused':_0x97383e[_0x3475('0x51')],'createdAt':_0x97383e[_0x3475('0x4c')],'updatedAt':_0x97383e[_0x3475('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3475('0x14')](respondWithFilteredResult(_0x5d1833,_0x473747))[_0x3475('0x27')](handleError(_0x5d1833,null));};exports['getTeams']=function(_0x23976f,_0x3ce006){var _0x36e6d4={};var _0x4393e2={};var _0x25ad32;var _0x483ac6;return db[_0x3475('0x1f')]['findOne']({'where':{'id':_0x23976f[_0x3475('0x29')]['id']}})[_0x3475('0x14')](handleEntityNotFound(_0x3ce006,null))[_0x3475('0x14')](function(_0x57cb59){if(_0x57cb59){_0x25ad32=_0x57cb59;_0x4393e2[_0x3475('0x2a')]=_[_0x3475('0x2b')](db[_0x3475('0x52')][_0x3475('0x2c')]);_0x4393e2[_0x3475('0x25')]=_[_0x3475('0x2b')](_0x23976f[_0x3475('0x25')]);_0x4393e2[_0x3475('0x2d')]=_['intersection'](_0x4393e2['model'],_0x4393e2[_0x3475('0x25')]);_0x36e6d4[_0x3475('0x2f')]=_['intersection'](_0x4393e2[_0x3475('0x2a')],qs['fields'](_0x23976f[_0x3475('0x25')][_0x3475('0x30')]));_0x36e6d4['attributes']=_0x36e6d4['attributes']['length']?_0x36e6d4['attributes']:_0x4393e2['model'];_0x36e6d4['order']=qs['sort'](_0x23976f['query'][_0x3475('0x43')]);_0x36e6d4['where']=qs[_0x3475('0x2d')](_[_0x3475('0x44')](_0x23976f[_0x3475('0x25')],_0x4393e2[_0x3475('0x2d')]));if(_0x23976f['query'][_0x3475('0x53')]){_0x36e6d4[_0x3475('0x45')]=_['merge'](_0x36e6d4[_0x3475('0x45')],{'$or':_['map'](_0x36e6d4[_0x3475('0x2f')],function(_0x18c16a){var _0x357418={};_0x357418[_0x18c16a]={'$like':'%'+_0x23976f['query'][_0x3475('0x53')]+'%'};return _0x357418;})});}_0x36e6d4=_[_0x3475('0x32')]({},_0x36e6d4,_0x23976f[_0x3475('0x33')]);return _0x25ad32['getTeams'](_0x36e6d4);}})[_0x3475('0x14')](function(_0x5480bc){if(_0x5480bc){_0x483ac6=_0x5480bc[_0x3475('0x31')];if(!_0x23976f['query'][_0x3475('0x41')](_0x3475('0x54'))){_0x36e6d4[_0x3475('0xf')]=qs[_0x3475('0xf')](_0x23976f[_0x3475('0x25')]['limit']);_0x36e6d4[_0x3475('0xe')]=qs[_0x3475('0xe')](_0x23976f[_0x3475('0x25')][_0x3475('0xe')]);}return _0x25ad32['getTeams'](_0x36e6d4);}})[_0x3475('0x14')](function(_0x39c105){if(_0x39c105){return _0x39c105?{'count':_0x483ac6,'rows':_0x39c105}:null;}})[_0x3475('0x14')](respondWithResult(_0x3ce006,null))[_0x3475('0x27')](handleError(_0x3ce006,null));};exports[_0x3475('0x55')]=function(_0x52825d,_0x387ea6){var _0x488f7d=_0x52825d[_0x3475('0x35')]['ids'];return db['Team'][_0x3475('0x26')]({'where':{'id':_0x488f7d},'attributes':['id'],'include':[{'model':db[_0x3475('0x47')],'as':_0x3475('0x56'),'attributes':['id',_0x3475('0x1b'),_0x3475('0x57'),'voicePause','interface'],'raw':!![]}]})[_0x3475('0x14')](function(_0xcc0802){if(_0xcc0802){var _0x3f22f7=_[_0x3475('0x58')](_0xcc0802,function(_0x5860b0){var _0x5a1922=_0x5860b0[_0x3475('0x16')]({'plain':!![]});return _0x5a1922[_0x3475('0x56')];});return db['FaxQueue'][_0x3475('0x39')]({'where':{'id':_0x52825d[_0x3475('0x29')]['id']}})['then'](function(_0x599ef1){return db[_0x3475('0x59')][_0x3475('0x5a')](function(_0x5da2e8){return _0x599ef1['addTeams'](_0x488f7d,{'transaction':_0x5da2e8})[_0x3475('0x14')](function(){return BPromise['each'](_0x3f22f7,function(_0x2d512d){return db[_0x3475('0x40')]['findOrCreate']({'where':{'UserId':_0x2d512d['id'],'FaxQueueId':_0x52825d[_0x3475('0x29')]['id']},'transaction':_0x5da2e8});});})[_0x3475('0x14')](function(){_0x3f22f7[_0x3475('0x5b')](function(_0x21d0d4){socket[_0x3475('0x5c')](_0x3475('0x5d'),{'UserId':_0x21d0d4['id'],'FaxQueueId':_0x599ef1['id']});});});});});}})[_0x3475('0x14')](respondWithStatusCode(_0x387ea6,null))[_0x3475('0x27')](handleError(_0x387ea6,null));};exports[_0x3475('0x5e')]=function(_0x1840c2,_0x5a3d9b){return db[_0x3475('0x52')][_0x3475('0x26')]({'where':{'id':_0x1840c2['query'][_0x3475('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x3475('0x47')],'as':_0x3475('0x56'),'attributes':['id'],'raw':!![]}]})[_0x3475('0x14')](handleEntityNotFound(_0x5a3d9b,null))[_0x3475('0x14')](function(_0xa86db0){var _0x3b0ff9=_[_0x3475('0x1e')](_0xa86db0,'id');var _0x14ed10=[];var _0x449b4f=[];var _0x4309cc=squel[_0x3475('0x60')]();_0x4309cc[_0x3475('0x61')]('tq.TeamId')[_0x3475('0x62')](_0x3475('0x63'),'tq')[_0x3475('0x64')](_0x3475('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('FaxQueueId\x20=\x20?',_0x1840c2[_0x3475('0x29')]['id']);for(var _0x169c87=0x0;_0x169c87<_0xa86db0[_0x3475('0x31')];_0x169c87+=0x1){let _0x117250=_0xa86db0[_0x169c87];for(var _0x1469b2=0x0;_0x1469b2<_0x117250[_0x3475('0x56')][_0x3475('0x31')];_0x1469b2+=0x1){let _0x23e125=_0x117250[_0x3475('0x56')][_0x1469b2];var _0xd4a1d9=_0x4309cc[_0x3475('0x66')]();_0xd4a1d9[_0x3475('0x45')](_0x3475('0x67'),_0x23e125['id']);_0x449b4f[_0x3475('0x68')](db['sequelize'][_0x3475('0x25')](_0xd4a1d9[_0x3475('0x69')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x3475('0x14')](function(_0x4c92a4){if(_0x4c92a4[_0x3475('0x31')]===0x1){return _0x23e125['id'];}else{var _0x91abf3=_[_0x3475('0x6a')](_[_0x3475('0x1e')](_0x4c92a4,_0x3475('0x6b')),function(_0x1e7ff2){return _[_0x3475('0x6c')](_0x3b0ff9,_0x1e7ff2);});if(_0x91abf3){return _0x23e125['id'];}}}));}}return BPromise[_0x3475('0x6d')](_0x449b4f)[_0x3475('0x14')](function(_0x392da4){_0x14ed10=_(_0x14ed10)[_0x3475('0x6e')](_0x392da4)['compact']()['value']();return db[_0x3475('0x1f')][_0x3475('0x39')]({'where':{'id':_0x1840c2[_0x3475('0x29')]['id']}})[_0x3475('0x14')](function(_0x5efa7e){return db[_0x3475('0x59')][_0x3475('0x5a')](function(_0x5e9a4e){return _0x5efa7e[_0x3475('0x5e')](_0x1840c2[_0x3475('0x25')]['ids'],{'transaction':_0x5e9a4e})[_0x3475('0x14')](function(){if(!_[_0x3475('0x6f')](_0x14ed10)){return _0x5efa7e[_0x3475('0x70')](_0x14ed10,{'transaction':_0x5e9a4e});}})[_0x3475('0x14')](function(){_0x14ed10[_0x3475('0x5b')](function(_0x2ddb64){socket[_0x3475('0x5c')](_0x3475('0x71'),{'UserId':_0x2ddb64,'FaxQueueId':_0x5efa7e['id']});});});});});});})[_0x3475('0x14')](respondWithStatusCode(_0x5a3d9b,null))[_0x3475('0x27')](handleError(_0x5a3d9b,null));};exports['addAgents']=function(_0x2a2606,_0xec22f7){return db[_0x3475('0x1f')]['find']({'where':{'id':_0x2a2606[_0x3475('0x29')]['id']}})[_0x3475('0x14')](handleEntityNotFound(_0xec22f7,null))[_0x3475('0x14')](function(_0x3c650e){if(_0x3c650e){return _0x3c650e[_0x3475('0x72')](_0x2a2606[_0x3475('0x35')][_0x3475('0x5f')],_[_0x3475('0x73')](_0x2a2606['body'],[_0x3475('0x5f'),'id'])||{})[_0x3475('0x74')](function(_0x502eab){for(var _0x5e3f55=0x0;_0x5e3f55<_0x2a2606[_0x3475('0x35')][_0x3475('0x5f')][_0x3475('0x31')];_0x5e3f55+=0x1){socket[_0x3475('0x5c')](_0x3475('0x5d'),{'UserId':Number(_0x2a2606['body'][_0x3475('0x5f')][_0x5e3f55]),'FaxQueueId':Number(_0x2a2606[_0x3475('0x29')]['id'])});}return _0x502eab;});}})[_0x3475('0x14')](respondWithResult(_0xec22f7,null))[_0x3475('0x27')](handleError(_0xec22f7,null));};exports['removeAgents']=function(_0x3275fe,_0x2b7fd6){return db[_0x3475('0x1f')][_0x3475('0x39')]({'where':{'id':_0x3275fe[_0x3475('0x29')]['id']}})[_0x3475('0x14')](handleEntityNotFound(_0x2b7fd6,null))[_0x3475('0x14')](function(_0x442db0){if(_0x442db0){return _0x442db0[_0x3475('0x70')](_0x3275fe[_0x3475('0x25')][_0x3475('0x5f')])[_0x3475('0x14')](function(){if(_['isArray'](_0x3275fe[_0x3475('0x25')][_0x3475('0x5f')])){for(var _0x23b7d0=0x0;_0x23b7d0<_0x3275fe[_0x3475('0x25')][_0x3475('0x5f')][_0x3475('0x31')];_0x23b7d0+=0x1){socket[_0x3475('0x5c')]('userFaxQueue:remove',{'UserId':Number(_0x3275fe[_0x3475('0x25')][_0x3475('0x5f')][_0x23b7d0]),'FaxQueueId':Number(_0x3275fe[_0x3475('0x29')]['id'])});}}else{socket[_0x3475('0x5c')](_0x3475('0x71'),{'UserId':Number(_0x3275fe[_0x3475('0x25')][_0x3475('0x5f')]),'FaxQueueId':Number(_0x3275fe[_0x3475('0x29')]['id'])});}});}})[_0x3475('0x14')](respondWithStatusCode(_0x2b7fd6,null))[_0x3475('0x27')](handleError(_0x2b7fd6,null));};exports['getAgents']=function(_0x1abff8,_0x2889fa){var _0x2a381f={};var _0x565a25={};var _0x5e674e;var _0xe59620;return db[_0x3475('0x1f')]['findOne']({'where':{'id':_0x1abff8[_0x3475('0x29')]['id']}})[_0x3475('0x14')](handleEntityNotFound(_0x2889fa,null))['then'](function(_0x24afe1){if(_0x24afe1){_0x5e674e=_0x24afe1;_0x565a25['model']=_['keys'](db[_0x3475('0x47')][_0x3475('0x2c')]);_0x565a25[_0x3475('0x25')]=_[_0x3475('0x2b')](_0x1abff8['query']);_0x565a25[_0x3475('0x2d')]=_['intersection'](_0x565a25[_0x3475('0x2a')],_0x565a25[_0x3475('0x25')]);_0x2a381f[_0x3475('0x2f')]=_['intersection'](_0x565a25[_0x3475('0x2a')],qs[_0x3475('0x30')](_0x1abff8[_0x3475('0x25')][_0x3475('0x30')]));_0x2a381f[_0x3475('0x2f')]=_0x2a381f[_0x3475('0x2f')][_0x3475('0x31')]?_0x2a381f['attributes']:_0x565a25[_0x3475('0x2a')];_0x2a381f[_0x3475('0x42')]=qs[_0x3475('0x43')](_0x1abff8[_0x3475('0x25')][_0x3475('0x43')]);_0x2a381f[_0x3475('0x45')]=qs[_0x3475('0x2d')](_[_0x3475('0x44')](_0x1abff8[_0x3475('0x25')],_0x565a25[_0x3475('0x2d')]));if(_0x1abff8[_0x3475('0x25')][_0x3475('0x53')]){_0x2a381f['where']=_[_0x3475('0x32')](_0x2a381f[_0x3475('0x45')],{'$or':_[_0x3475('0x1e')](_0x2a381f['attributes'],function(_0x2d8dd0){var _0x9a2c4={};_0x9a2c4[_0x2d8dd0]={'$like':'%'+_0x1abff8[_0x3475('0x25')][_0x3475('0x53')]+'%'};return _0x9a2c4;})});}_0x2a381f=_[_0x3475('0x32')]({},_0x2a381f,_0x1abff8[_0x3475('0x33')]);return _0x5e674e[_0x3475('0x75')](_0x2a381f);}})[_0x3475('0x14')](function(_0x2adc05){if(_0x2adc05){_0xe59620=_0x2adc05[_0x3475('0x31')];if(!_0x1abff8['query']['hasOwnProperty']('nolimit')){_0x2a381f[_0x3475('0xf')]=qs[_0x3475('0xf')](_0x1abff8[_0x3475('0x25')]['limit']);_0x2a381f[_0x3475('0xe')]=qs[_0x3475('0xe')](_0x1abff8[_0x3475('0x25')][_0x3475('0xe')]);}return _0x5e674e['getAgents'](_0x2a381f);}})['then'](function(_0x18440f){if(_0x18440f){return _0x18440f?{'count':_0xe59620,'rows':_0x18440f}:null;}})[_0x3475('0x14')](respondWithResult(_0x2889fa,null))[_0x3475('0x27')](handleError(_0x2889fa,null));}; \ No newline at end of file +var _0x202a=['include','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','length','includeAll','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','filters','hasOwnProperty','nolimit','sort','FaxQueueId','filter','options','User','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','order','getTeams','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','userFaxQueue:save','field','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','compact','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','pick','getAgents','util','lodash','squel','../../components/parsers/qs','../../mysqldb','redis','localhost','register','end','json','undefined','limit','count','offset','set','Content-Range','update','then','get','FaxQueues','destroy','status','sendStatus','error','stack','send','map','FaxQueue','rawAttributes','where'];(function(_0x47b4c8,_0x4effd4){var _0x480e8c=function(_0x523b12){while(--_0x523b12){_0x47b4c8['push'](_0x47b4c8['shift']());}};_0x480e8c(++_0x4effd4);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0xa202('0x0'));var _=require(_0xa202('0x1'));var squel=require(_0xa202('0x2'));var Redis=require('ioredis');var qs=require(_0xa202('0x3'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xa202('0x4'))['db'];config[_0xa202('0x5')]=_['defaults'](config['redis'],{'host':_0xa202('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xa202('0x7')](socket);function respondWithStatusCode(_0xcd59fb,_0x26ad43){_0x26ad43=_0x26ad43||0xcc;return function(_0x16951a){if(_0x16951a){return _0xcd59fb['sendStatus'](_0x26ad43);}return _0xcd59fb['status'](_0x26ad43)[_0xa202('0x8')]();};}function respondWithResult(_0x351e18,_0x32ae0b){_0x32ae0b=_0x32ae0b||0xc8;return function(_0x2c4250){if(_0x2c4250){return _0x351e18['status'](_0x32ae0b)[_0xa202('0x9')](_0x2c4250);}};}function respondWithFilteredResult(_0x5e7899,_0x202c0f){return function(_0x256601){if(_0x256601){var _0x64324c=typeof _0x202c0f['offset']===_0xa202('0xa')&&typeof _0x202c0f[_0xa202('0xb')]===_0xa202('0xa');var _0x417e31=_0x256601[_0xa202('0xc')];var _0x29969e=_0x64324c?0x0:_0x202c0f['offset'];var _0x13510c=_0x64324c?_0x256601[_0xa202('0xc')]:_0x202c0f[_0xa202('0xd')]+_0x202c0f[_0xa202('0xb')];var _0x2e1790;if(_0x13510c>=_0x417e31){_0x13510c=_0x417e31;_0x2e1790=0xc8;}else{_0x2e1790=0xce;}_0x5e7899['status'](_0x2e1790);return _0x5e7899[_0xa202('0xe')](_0xa202('0xf'),_0x29969e+'-'+_0x13510c+'/'+_0x417e31)[_0xa202('0x9')](_0x256601);}return null;};}function saveUpdates(_0x3fcc66){return function(_0x2c191f){if(_0x2c191f){return _0x2c191f[_0xa202('0x10')](_0x3fcc66)['then'](function(_0x44a1b6){return _0x44a1b6;});}return null;};}function removeEntity(_0x53ff78){return function(_0x130df2){if(_0x130df2){return _0x130df2['destroy']()[_0xa202('0x11')](function(){var _0x33b91f=_0x130df2[_0xa202('0x12')]({'plain':!![]});var _0xfce413=_0xa202('0x13');return db['UserProfileResource'][_0xa202('0x14')]({'where':{'type':_0xfce413,'resourceId':_0x33b91f['id']}})[_0xa202('0x11')](function(){return _0x130df2;});})[_0xa202('0x11')](function(){_0x53ff78[_0xa202('0x15')](0xcc)[_0xa202('0x8')]();});}};}function handleEntityNotFound(_0x587cb7){return function(_0x55c9a5){if(!_0x55c9a5){_0x587cb7[_0xa202('0x16')](0x194);}return _0x55c9a5;};}function handleError(_0x46cfa4,_0x44801a){_0x44801a=_0x44801a||0x1f4;return function(_0x5845f5){logger[_0xa202('0x17')](_0x5845f5[_0xa202('0x18')]);if(_0x5845f5['name']){delete _0x5845f5['name'];}_0x46cfa4[_0xa202('0x15')](_0x44801a)[_0xa202('0x19')](_0x5845f5);};}exports['index']=function(_0x27101e,_0x5a1ea3){var _0x5373b6={};var _0x72fe3e={'count':0x0,'rows':[]};var _0x268ee9=_[_0xa202('0x1a')](db[_0xa202('0x1b')][_0xa202('0x1c')],function(_0x1d6704){return{'name':_0x1d6704['fieldName'],'type':_0x1d6704['type']['key']};});_0x5373b6=qs['getOptions'](_0x268ee9,_0x27101e);var _0x406716={'where':_0x5373b6[_0xa202('0x1d')]};return db[_0xa202('0x1b')]['count'](_0x406716)[_0xa202('0x11')](function(_0x390633){_0x72fe3e[_0xa202('0xc')]=_0x390633;_0x5373b6[_0xa202('0x1e')]=qs[_0xa202('0x1e')](_0x27101e[_0xa202('0x1f')]);return db[_0xa202('0x1b')][_0xa202('0x20')](_0x5373b6);})[_0xa202('0x11')](function(_0x106b89){_0x72fe3e[_0xa202('0x21')]=_0x106b89;return _0x72fe3e;})[_0xa202('0x11')](respondWithFilteredResult(_0x5a1ea3,_0x5373b6))[_0xa202('0x22')](handleError(_0x5a1ea3,null));};exports[_0xa202('0x23')]=function(_0xcea252,_0x3bb9ab){var _0x5b3b40={'raw':!![],'where':{'id':_0xcea252[_0xa202('0x24')]['id']}},_0x418ff0={};_0x418ff0[_0xa202('0x25')]=_[_0xa202('0x26')](db[_0xa202('0x1b')][_0xa202('0x1c')]);_0x418ff0['query']=_[_0xa202('0x26')](_0xcea252[_0xa202('0x1f')]);_0x418ff0['filters']=_[_0xa202('0x27')](_0x418ff0[_0xa202('0x25')],_0x418ff0['query']);_0x5b3b40['attributes']=_['intersection'](_0x418ff0[_0xa202('0x25')],qs[_0xa202('0x28')](_0xcea252[_0xa202('0x1f')][_0xa202('0x28')]));_0x5b3b40[_0xa202('0x29')]=_0x5b3b40['attributes'][_0xa202('0x2a')]?_0x5b3b40['attributes']:_0x418ff0[_0xa202('0x25')];if(_0xcea252[_0xa202('0x1f')][_0xa202('0x2b')]){_0x5b3b40['include']=[{'all':!![]}];}_0x5b3b40=_[_0xa202('0x2c')]({},_0x5b3b40,_0xcea252['options']);return db['FaxQueue'][_0xa202('0x2d')](_0x5b3b40)[_0xa202('0x11')](handleEntityNotFound(_0x3bb9ab,null))['then'](respondWithResult(_0x3bb9ab,null))[_0xa202('0x22')](handleError(_0x3bb9ab,null));};exports['create']=function(_0x56cd45,_0x20369c){return db[_0xa202('0x1b')]['create'](_0x56cd45[_0xa202('0x2e')],{})[_0xa202('0x11')](function(_0xc5cc0c){var _0x527921=_0x56cd45[_0xa202('0x2f')][_0xa202('0x12')]({'plain':!![]});if(!_0x527921)throw new Error(_0xa202('0x30'));if(_0x527921[_0xa202('0x31')]===_0xa202('0x2f')){var _0x2f9674=_0xc5cc0c[_0xa202('0x12')]({'plain':!![]});var _0x3c480f=_0xa202('0x13');return db[_0xa202('0x32')][_0xa202('0x2d')]({'where':{'name':_0x3c480f,'userProfileId':_0x527921[_0xa202('0x33')]},'raw':!![]})['then'](function(_0x5bd528){if(_0x5bd528&&_0x5bd528[_0xa202('0x34')]===0x0){return db[_0xa202('0x35')][_0xa202('0x36')]({'name':_0x2f9674[_0xa202('0x37')],'resourceId':_0x2f9674['id'],'type':_0x5bd528[_0xa202('0x37')],'sectionId':_0x5bd528['id']},{})[_0xa202('0x11')](function(){return _0xc5cc0c;});}else{return _0xc5cc0c;}})[_0xa202('0x22')](function(_0x3bca66){logger[_0xa202('0x17')](_0xa202('0x38'),_0x3bca66);throw _0x3bca66;});}return _0xc5cc0c;})['then'](respondWithResult(_0x20369c,0xc9))[_0xa202('0x22')](handleError(_0x20369c,null));};exports[_0xa202('0x10')]=function(_0x51c551,_0x48a546){if(_0x51c551['body']['id']){delete _0x51c551[_0xa202('0x2e')]['id'];}return db[_0xa202('0x1b')][_0xa202('0x2d')]({'where':{'id':_0x51c551[_0xa202('0x24')]['id']}})['then'](handleEntityNotFound(_0x48a546,null))[_0xa202('0x11')](saveUpdates(_0x51c551[_0xa202('0x2e')],null))[_0xa202('0x11')](respondWithResult(_0x48a546,null))[_0xa202('0x22')](handleError(_0x48a546,null));};exports['destroy']=function(_0x169a02,_0x201e51){return db[_0xa202('0x1b')]['find']({'where':{'id':_0x169a02[_0xa202('0x24')]['id']}})[_0xa202('0x11')](handleEntityNotFound(_0x201e51,null))[_0xa202('0x11')](removeEntity(_0x201e51,null))[_0xa202('0x22')](handleError(_0x201e51,null));};exports[_0xa202('0x39')]=function(_0x36046d,_0x46f873){return db[_0xa202('0x1b')][_0xa202('0x39')]()[_0xa202('0x11')](respondWithResult(_0x46f873,null))[_0xa202('0x22')](handleError(_0x46f873,null));};exports[_0xa202('0x3a')]=function(_0x4b771b,_0x1f906a){var _0x1dca0c={'raw':!![],'where':{}},_0x2608a2={},_0x26c959;return db[_0xa202('0x1b')][_0xa202('0x3b')]({'where':{'id':_0x4b771b[_0xa202('0x24')]['id']}})[_0xa202('0x11')](handleEntityNotFound(_0x1f906a,null))['then'](function(_0x232941){if(_0x232941){_0x26c959=_0x232941[_0xa202('0x12')]({'plain':!![]});_0x2608a2[_0xa202('0x25')]=_['keys'](db[_0xa202('0x3c')][_0xa202('0x1c')]);_0x2608a2[_0xa202('0x1f')]=_['keys'](_0x4b771b[_0xa202('0x1f')]);_0x2608a2[_0xa202('0x3d')]=_[_0xa202('0x27')](_0x2608a2[_0xa202('0x25')],_0x2608a2[_0xa202('0x1f')]);_0x1dca0c[_0xa202('0x29')]=_[_0xa202('0x27')](_0x2608a2[_0xa202('0x25')],qs[_0xa202('0x28')](_0x4b771b[_0xa202('0x1f')][_0xa202('0x28')]));_0x1dca0c['attributes']=_0x1dca0c[_0xa202('0x29')][_0xa202('0x2a')]?_0x1dca0c[_0xa202('0x29')]:_0x2608a2['model'];if(!_0x4b771b['query'][_0xa202('0x3e')](_0xa202('0x3f'))){_0x1dca0c['limit']=qs[_0xa202('0xb')](_0x4b771b[_0xa202('0x1f')]['limit']);_0x1dca0c[_0xa202('0xd')]=qs[_0xa202('0xd')](_0x4b771b[_0xa202('0x1f')][_0xa202('0xd')]);}_0x1dca0c['order']=qs[_0xa202('0x40')](_0x4b771b['query']['sort']);_0x1dca0c[_0xa202('0x1d')]=qs['filters'](_['pick'](_0x4b771b[_0xa202('0x1f')],_0x2608a2['filters']));_0x1dca0c['where'][_0xa202('0x41')]=_0x232941['id'];if(_0x4b771b[_0xa202('0x1f')][_0xa202('0x42')]){_0x1dca0c[_0xa202('0x1d')]=_[_0xa202('0x2c')](_0x1dca0c[_0xa202('0x1d')],{'$or':_[_0xa202('0x1a')](_0x1dca0c['attributes'],function(_0x45a54b){var _0x35b091={};_0x35b091[_0x45a54b]={'$like':'%'+_0x4b771b[_0xa202('0x1f')][_0xa202('0x42')]+'%'};return _0x35b091;})});}_0x1dca0c=_[_0xa202('0x2c')]({},_0x1dca0c,_0x4b771b[_0xa202('0x43')]);return db[_0xa202('0x3c')]['findAll'](_0x1dca0c);}})[_0xa202('0x11')](function(_0x3905de){if(_0x3905de){return db[_0xa202('0x44')]['findAndCountAll']({'where':{'id':_['map'](_0x3905de,'UserId'),'role':_0xa202('0x45')},'attributes':['id',_0xa202('0x37'),_0xa202('0x46'),_0xa202('0x47'),_0xa202('0x48')]});}})[_0xa202('0x11')](function(_0x3b1efe){if(_0x3b1efe){return{'count':_0x3b1efe[_0xa202('0xc')],'rows':_[_0xa202('0x1a')](_0x3b1efe['rows'],function(_0x209634){return{'membername':_0x209634['name'],'UserId':_0x209634['id'],'queue_name':_0x26c959[_0xa202('0x37')],'FaxQueueId':_0x26c959['id'],'interface':util[_0xa202('0x49')](_0xa202('0x4a'),_0xa202('0x4b'),_0x209634[_0xa202('0x37')]),'penalty':0x0,'paused':_0x209634['faxPause'],'createdAt':_0x209634[_0xa202('0x48')],'updatedAt':_0x209634[_0xa202('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1f906a,_0x1dca0c))[_0xa202('0x22')](handleError(_0x1f906a,null));};exports['getTeams']=function(_0x41ed29,_0x530b90){var _0x4d26fe={};var _0x248d1c={};var _0x24e526;var _0x3a3c54;return db[_0xa202('0x1b')][_0xa202('0x3b')]({'where':{'id':_0x41ed29['params']['id']}})['then'](handleEntityNotFound(_0x530b90,null))['then'](function(_0x584072){if(_0x584072){_0x24e526=_0x584072;_0x248d1c[_0xa202('0x25')]=_[_0xa202('0x26')](db[_0xa202('0x4c')][_0xa202('0x1c')]);_0x248d1c['query']=_['keys'](_0x41ed29['query']);_0x248d1c[_0xa202('0x3d')]=_[_0xa202('0x27')](_0x248d1c['model'],_0x248d1c[_0xa202('0x1f')]);_0x4d26fe[_0xa202('0x29')]=_['intersection'](_0x248d1c['model'],qs[_0xa202('0x28')](_0x41ed29['query'][_0xa202('0x28')]));_0x4d26fe[_0xa202('0x29')]=_0x4d26fe[_0xa202('0x29')]['length']?_0x4d26fe[_0xa202('0x29')]:_0x248d1c[_0xa202('0x25')];_0x4d26fe[_0xa202('0x4d')]=qs['sort'](_0x41ed29[_0xa202('0x1f')][_0xa202('0x40')]);_0x4d26fe[_0xa202('0x1d')]=qs[_0xa202('0x3d')](_['pick'](_0x41ed29[_0xa202('0x1f')],_0x248d1c[_0xa202('0x3d')]));if(_0x41ed29['query'][_0xa202('0x42')]){_0x4d26fe[_0xa202('0x1d')]=_['merge'](_0x4d26fe['where'],{'$or':_[_0xa202('0x1a')](_0x4d26fe[_0xa202('0x29')],function(_0x5496b7){var _0x5ac40c={};_0x5ac40c[_0x5496b7]={'$like':'%'+_0x41ed29['query'][_0xa202('0x42')]+'%'};return _0x5ac40c;})});}_0x4d26fe=_['merge']({},_0x4d26fe,_0x41ed29[_0xa202('0x43')]);return _0x24e526[_0xa202('0x4e')](_0x4d26fe);}})[_0xa202('0x11')](function(_0x14d17d){if(_0x14d17d){_0x3a3c54=_0x14d17d[_0xa202('0x2a')];if(!_0x41ed29[_0xa202('0x1f')][_0xa202('0x3e')](_0xa202('0x3f'))){_0x4d26fe[_0xa202('0xb')]=qs[_0xa202('0xb')](_0x41ed29[_0xa202('0x1f')][_0xa202('0xb')]);_0x4d26fe[_0xa202('0xd')]=qs[_0xa202('0xd')](_0x41ed29[_0xa202('0x1f')][_0xa202('0xd')]);}return _0x24e526[_0xa202('0x4e')](_0x4d26fe);}})[_0xa202('0x11')](function(_0x56d398){if(_0x56d398){return _0x56d398?{'count':_0x3a3c54,'rows':_0x56d398}:null;}})[_0xa202('0x11')](respondWithResult(_0x530b90,null))[_0xa202('0x22')](handleError(_0x530b90,null));};exports[_0xa202('0x4f')]=function(_0x5e0f99,_0x516ac5){var _0xc28dd2=_0x5e0f99[_0xa202('0x2e')][_0xa202('0x50')];return db[_0xa202('0x4c')][_0xa202('0x20')]({'where':{'id':_0xc28dd2},'attributes':['id'],'include':[{'model':db[_0xa202('0x44')],'as':_0xa202('0x51'),'attributes':['id',_0xa202('0x37'),_0xa202('0x52'),_0xa202('0x53'),_0xa202('0x54')],'raw':!![]}]})[_0xa202('0x11')](function(_0x874371){if(_0x874371){var _0x268914=_['flatMap'](_0x874371,function(_0x1ff0db){var _0x19c6a5=_0x1ff0db['get']({'plain':!![]});return _0x19c6a5[_0xa202('0x51')];});return db[_0xa202('0x1b')]['find']({'where':{'id':_0x5e0f99['params']['id']}})[_0xa202('0x11')](function(_0x46bf07){return db['sequelize'][_0xa202('0x55')](function(_0x228bb8){return _0x46bf07['addTeams'](_0xc28dd2,{'transaction':_0x228bb8})['then'](function(){return BPromise[_0xa202('0x56')](_0x268914,function(_0x4310c5){return db['UserFaxQueue'][_0xa202('0x57')]({'where':{'UserId':_0x4310c5['id'],'FaxQueueId':_0x5e0f99['params']['id']},'transaction':_0x228bb8});});})[_0xa202('0x11')](function(){_0x268914['forEach'](function(_0x51c055){socket['emit'](_0xa202('0x58'),{'UserId':_0x51c055['id'],'FaxQueueId':_0x46bf07['id']});});});});});}})[_0xa202('0x11')](respondWithStatusCode(_0x516ac5,null))[_0xa202('0x22')](handleError(_0x516ac5,null));};exports['removeTeams']=function(_0x620c8d,_0x38f9a6){return db[_0xa202('0x4c')][_0xa202('0x20')]({'where':{'id':_0x620c8d[_0xa202('0x1f')][_0xa202('0x50')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa202('0x51'),'attributes':['id'],'raw':!![]}]})[_0xa202('0x11')](handleEntityNotFound(_0x38f9a6,null))[_0xa202('0x11')](function(_0x1ee182){var _0x46383d=_[_0xa202('0x1a')](_0x1ee182,'id');var _0x20e056=[];var _0x2c3584=[];var _0x4e2851=squel['select']();_0x4e2851[_0xa202('0x59')](_0xa202('0x5a'))[_0xa202('0x5b')]('team_has_fax_queues','tq')[_0xa202('0x5c')](_0xa202('0x5d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa202('0x1d')](_0xa202('0x5e'),_0x620c8d[_0xa202('0x24')]['id']);for(var _0x597bc0=0x0;_0x597bc0<_0x1ee182[_0xa202('0x2a')];_0x597bc0+=0x1){let _0x4c97d7=_0x1ee182[_0x597bc0];for(var _0x4c466d=0x0;_0x4c466d<_0x4c97d7[_0xa202('0x51')]['length'];_0x4c466d+=0x1){let _0x211521=_0x4c97d7[_0xa202('0x51')][_0x4c466d];var _0x40c2a7=_0x4e2851['clone']();_0x40c2a7[_0xa202('0x1d')]('ut.UserId\x20=\x20?',_0x211521['id']);_0x2c3584['push'](db[_0xa202('0x5f')][_0xa202('0x1f')](_0x40c2a7['toString'](),{'type':db[_0xa202('0x5f')][_0xa202('0x60')][_0xa202('0x61')]})['then'](function(_0x29fcb1){if(_0x29fcb1[_0xa202('0x2a')]===0x1){return _0x211521['id'];}else{var _0x46b74d=_[_0xa202('0x62')](_[_0xa202('0x1a')](_0x29fcb1,_0xa202('0x63')),function(_0xadb16f){return _[_0xa202('0x64')](_0x46383d,_0xadb16f);});if(_0x46b74d){return _0x211521['id'];}}}));}}return BPromise['all'](_0x2c3584)[_0xa202('0x11')](function(_0x57a47a){_0x20e056=_(_0x20e056)['union'](_0x57a47a)[_0xa202('0x65')]()['value']();return db['FaxQueue']['find']({'where':{'id':_0x620c8d[_0xa202('0x24')]['id']}})[_0xa202('0x11')](function(_0x406805){return db['sequelize'][_0xa202('0x55')](function(_0x432dfb){return _0x406805['removeTeams'](_0x620c8d[_0xa202('0x1f')][_0xa202('0x50')],{'transaction':_0x432dfb})['then'](function(){if(!_[_0xa202('0x66')](_0x20e056)){return _0x406805[_0xa202('0x67')](_0x20e056,{'transaction':_0x432dfb});}})['then'](function(){_0x20e056['forEach'](function(_0x13699b){socket[_0xa202('0x68')](_0xa202('0x69'),{'UserId':_0x13699b,'FaxQueueId':_0x406805['id']});});});});});});})['then'](respondWithStatusCode(_0x38f9a6,null))[_0xa202('0x22')](handleError(_0x38f9a6,null));};exports[_0xa202('0x6a')]=function(_0x5e0d4e,_0x1c2c22){return db[_0xa202('0x1b')][_0xa202('0x2d')]({'where':{'id':_0x5e0d4e[_0xa202('0x24')]['id']}})[_0xa202('0x11')](handleEntityNotFound(_0x1c2c22,null))[_0xa202('0x11')](function(_0x490303){if(_0x490303){return _0x490303['addAgents'](_0x5e0d4e[_0xa202('0x2e')][_0xa202('0x50')],_['omit'](_0x5e0d4e['body'],[_0xa202('0x50'),'id'])||{})[_0xa202('0x6b')](function(_0x151b03){for(var _0x1c480b=0x0;_0x1c480b<_0x5e0d4e['body'][_0xa202('0x50')][_0xa202('0x2a')];_0x1c480b+=0x1){socket[_0xa202('0x68')](_0xa202('0x58'),{'UserId':Number(_0x5e0d4e[_0xa202('0x2e')][_0xa202('0x50')][_0x1c480b]),'FaxQueueId':Number(_0x5e0d4e[_0xa202('0x24')]['id'])});}return _0x151b03;});}})[_0xa202('0x11')](respondWithResult(_0x1c2c22,null))['catch'](handleError(_0x1c2c22,null));};exports['removeAgents']=function(_0xadc091,_0x35d046){return db['FaxQueue']['find']({'where':{'id':_0xadc091['params']['id']}})['then'](handleEntityNotFound(_0x35d046,null))[_0xa202('0x11')](function(_0x4fa0b3){if(_0x4fa0b3){return _0x4fa0b3['removeAgents'](_0xadc091['query'][_0xa202('0x50')])['then'](function(){if(_[_0xa202('0x6c')](_0xadc091[_0xa202('0x1f')][_0xa202('0x50')])){for(var _0x381008=0x0;_0x381008<_0xadc091[_0xa202('0x1f')][_0xa202('0x50')][_0xa202('0x2a')];_0x381008+=0x1){socket[_0xa202('0x68')]('userFaxQueue:remove',{'UserId':Number(_0xadc091[_0xa202('0x1f')][_0xa202('0x50')][_0x381008]),'FaxQueueId':Number(_0xadc091[_0xa202('0x24')]['id'])});}}else{socket[_0xa202('0x68')](_0xa202('0x69'),{'UserId':Number(_0xadc091[_0xa202('0x1f')][_0xa202('0x50')]),'FaxQueueId':Number(_0xadc091[_0xa202('0x24')]['id'])});}});}})[_0xa202('0x11')](respondWithStatusCode(_0x35d046,null))[_0xa202('0x22')](handleError(_0x35d046,null));};exports['getAgents']=function(_0x138203,_0x66b533){var _0x3b7beb={};var _0xbc129b={};var _0x34a9c1;var _0x425467;return db[_0xa202('0x1b')][_0xa202('0x3b')]({'where':{'id':_0x138203[_0xa202('0x24')]['id']}})['then'](handleEntityNotFound(_0x66b533,null))[_0xa202('0x11')](function(_0x1a2d95){if(_0x1a2d95){_0x34a9c1=_0x1a2d95;_0xbc129b['model']=_['keys'](db[_0xa202('0x44')][_0xa202('0x1c')]);_0xbc129b[_0xa202('0x1f')]=_['keys'](_0x138203['query']);_0xbc129b[_0xa202('0x3d')]=_[_0xa202('0x27')](_0xbc129b[_0xa202('0x25')],_0xbc129b[_0xa202('0x1f')]);_0x3b7beb['attributes']=_[_0xa202('0x27')](_0xbc129b[_0xa202('0x25')],qs[_0xa202('0x28')](_0x138203[_0xa202('0x1f')][_0xa202('0x28')]));_0x3b7beb[_0xa202('0x29')]=_0x3b7beb[_0xa202('0x29')]['length']?_0x3b7beb[_0xa202('0x29')]:_0xbc129b[_0xa202('0x25')];_0x3b7beb[_0xa202('0x4d')]=qs[_0xa202('0x40')](_0x138203[_0xa202('0x1f')][_0xa202('0x40')]);_0x3b7beb['where']=qs[_0xa202('0x3d')](_[_0xa202('0x6d')](_0x138203[_0xa202('0x1f')],_0xbc129b[_0xa202('0x3d')]));if(_0x138203[_0xa202('0x1f')]['filter']){_0x3b7beb[_0xa202('0x1d')]=_[_0xa202('0x2c')](_0x3b7beb[_0xa202('0x1d')],{'$or':_['map'](_0x3b7beb[_0xa202('0x29')],function(_0x49b059){var _0x50f88c={};_0x50f88c[_0x49b059]={'$like':'%'+_0x138203['query'][_0xa202('0x42')]+'%'};return _0x50f88c;})});}_0x3b7beb=_[_0xa202('0x2c')]({},_0x3b7beb,_0x138203[_0xa202('0x43')]);return _0x34a9c1[_0xa202('0x6e')](_0x3b7beb);}})[_0xa202('0x11')](function(_0xfc5594){if(_0xfc5594){_0x425467=_0xfc5594[_0xa202('0x2a')];if(!_0x138203['query']['hasOwnProperty'](_0xa202('0x3f'))){_0x3b7beb[_0xa202('0xb')]=qs[_0xa202('0xb')](_0x138203[_0xa202('0x1f')]['limit']);_0x3b7beb[_0xa202('0xd')]=qs[_0xa202('0xd')](_0x138203[_0xa202('0x1f')][_0xa202('0xd')]);}return _0x34a9c1[_0xa202('0x6e')](_0x3b7beb);}})[_0xa202('0x11')](function(_0x7de4dd){if(_0x7de4dd){return _0x7de4dd?{'count':_0x425467,'rows':_0x7de4dd}:null;}})['then'](respondWithResult(_0x66b533,null))[_0xa202('0x22')](handleError(_0x66b533,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 3cd373c..3e33b91 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 _0x6ff5=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue'];(function(_0x194905,_0x4ec489){var _0xcafcb8=function(_0x2c95f1){while(--_0x2c95f1){_0x194905['push'](_0x194905['shift']());}};_0xcafcb8(++_0x4ec489);}(_0x6ff5,0x181));var _0x56ff=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6ff5[_0x4c12ec];return _0x3ae42c;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x56ff('0x0'))['db'][_0x56ff('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x56ff('0x2')](0x0);var events={'afterCreate':_0x56ff('0x3'),'afterUpdate':'update','afterDestroy':_0x56ff('0x4')};function emitEvent(_0x4a78f1){return function(_0x54dd06,_0x49cf4e,_0x16bb33){FaxQueueEvents[_0x56ff('0x5')](_0x4a78f1+':'+_0x54dd06['id'],_0x54dd06);FaxQueueEvents['emit'](_0x4a78f1,_0x54dd06);_0x16bb33(null);};}for(var e in events){if(events[_0x56ff('0x6')](e)){var event=events[e];FaxQueue[_0x56ff('0x7')](e,emitEvent(event));}}module[_0x56ff('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xa50a=['hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x411c22,_0x5ea879){var _0x522561=function(_0x33af00){while(--_0x33af00){_0x411c22['push'](_0x411c22['shift']());}};_0x522561(++_0x5ea879);}(_0xa50a,0x1ec));var _0xaa50=function(_0x54203e,_0x1db8db){_0x54203e=_0x54203e-0x0;var _0xe307cf=_0xa50a[_0x54203e];return _0xe307cf;};'use strict';var EventEmitter=require(_0xaa50('0x0'));var FaxQueue=require(_0xaa50('0x1'))['db'][_0xaa50('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xaa50('0x3')](0x0);var events={'afterCreate':_0xaa50('0x4'),'afterUpdate':_0xaa50('0x5'),'afterDestroy':_0xaa50('0x6')};function emitEvent(_0x242e36){return function(_0x1eba54,_0x456b0c,_0x2b21d6){FaxQueueEvents[_0xaa50('0x7')](_0x242e36+':'+_0x1eba54['id'],_0x1eba54);FaxQueueEvents['emit'](_0x242e36,_0x1eba54);_0x2b21d6(null);};}for(var e in events){if(events[_0xaa50('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xaa50('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 4d00c20..484341b 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 _0x9318=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','FaxQueue','fax_queues'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9318,0x12c));var _0x8931=function(_0x3e060a,_0x4c08e7){_0x3e060a=_0x3e060a-0x0;var _0x495c14=_0x9318[_0x3e060a];return _0x495c14;};'use strict';var _=require(_0x8931('0x0'));var util=require(_0x8931('0x1'));var logger=require(_0x8931('0x2'))(_0x8931('0x3'));var moment=require(_0x8931('0x4'));var BPromise=require(_0x8931('0x5'));var rp=require(_0x8931('0x6'));var fs=require('fs');var path=require(_0x8931('0x7'));var rimraf=require('rimraf');var config=require(_0x8931('0x8'));var attributes=require('./faxQueue.attributes');module[_0x8931('0x9')]=function(_0x1e5faf,_0x43aa56){return _0x1e5faf['define'](_0x8931('0xa'),attributes,{'tableName':_0x8931('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1f5=['request-promise','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','../../config/logger','bluebird'];(function(_0x42ad6b,_0x39a94){var _0x442838=function(_0x4dc38c){while(--_0x4dc38c){_0x42ad6b['push'](_0x42ad6b['shift']());}};_0x442838(++_0x39a94);}(_0xc1f5,0x11d));var _0x5c1f=function(_0x56e9c1,_0x2024ff){_0x56e9c1=_0x56e9c1-0x0;var _0x2b18da=_0xc1f5[_0x56e9c1];return _0x2b18da;};'use strict';var _=require(_0x5c1f('0x0'));var util=require('util');var logger=require(_0x5c1f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5c1f('0x2'));var rp=require(_0x5c1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5c1f('0x4'));module['exports']=function(_0x1339df,_0x5681cb){return _0x1339df[_0x5c1f('0x5')](_0x5c1f('0x6'),attributes,{'tableName':_0x5c1f('0x7'),'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 33905f2..e83b8db 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 _0x5929=['defaults','redis','localhost','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetFaxQueue','options','raw','where','limit','include','map','attributes','model','then','debug','FaxQueue','find','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x5929,0x1b7));var _0x9592=function(_0x40339e,_0x4c0c94){_0x40339e=_0x40339e-0x0;var _0x107178=_0x5929[_0x40339e];return _0x107178;};'use strict';var _=require(_0x9592('0x0'));var util=require(_0x9592('0x1'));var moment=require(_0x9592('0x2'));var BPromise=require('bluebird');var rs=require(_0x9592('0x3'));var fs=require('fs');var Redis=require(_0x9592('0x4'));var db=require(_0x9592('0x5'))['db'];var utils=require(_0x9592('0x6'));var logger=require(_0x9592('0x7'))(_0x9592('0x8'));var config=require(_0x9592('0x9'));var jayson=require(_0x9592('0xa'));var client=jayson[_0x9592('0xb')]['http']({'port':0x232a});config['redis']=_[_0x9592('0xc')](config[_0x9592('0xd')],{'host':_0x9592('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9592('0xd')]));require(_0x9592('0xf'))[_0x9592('0x10')](socket);function respondWithRpcPromise(_0x50e8e9,_0x40c2c4,_0x3a2258){return new BPromise(function(_0x2f4253,_0x47836c){return client[_0x9592('0x11')](_0x50e8e9,_0x3a2258)['then'](function(_0x1f8019){logger[_0x9592('0x12')](_0x9592('0x13'),_0x40c2c4,_0x9592('0x14'));logger['debug'](_0x9592('0x15'),_0x40c2c4,_0x9592('0x14'),JSON['stringify'](_0x1f8019));if(_0x1f8019['error']){if(_0x1f8019['error'][_0x9592('0x16')]===0x1f4){logger[_0x9592('0x17')]('FaxQueue,\x20%s,\x20%s',_0x40c2c4,_0x1f8019['error'][_0x9592('0x18')]);return _0x47836c(_0x1f8019[_0x9592('0x17')]['message']);}logger[_0x9592('0x17')](_0x9592('0x13'),_0x40c2c4,_0x1f8019['error'][_0x9592('0x18')]);return _0x2f4253(_0x1f8019[_0x9592('0x17')][_0x9592('0x18')]);}else{logger[_0x9592('0x12')](_0x9592('0x13'),_0x40c2c4,_0x9592('0x14'));_0x2f4253(_0x1f8019[_0x9592('0x19')]['message']);}})[_0x9592('0x1a')](function(_0x36c050){logger['error'](_0x9592('0x13'),_0x40c2c4,_0x36c050);_0x47836c(_0x36c050);});});}exports[_0x9592('0x1b')]=function(_0x5913d9){var _0x2ec44b=this;return new Promise(function(_0x229fd3,_0x590fdf){return db['FaxQueue']['findAll']({'raw':_0x5913d9[_0x9592('0x1c')]?_0x5913d9[_0x9592('0x1c')][_0x9592('0x1d')]===undefined?!![]:![]:!![],'where':_0x5913d9[_0x9592('0x1c')]?_0x5913d9['options'][_0x9592('0x1e')]||null:null,'attributes':_0x5913d9['options']?_0x5913d9[_0x9592('0x1c')]['attributes']||null:null,'limit':_0x5913d9[_0x9592('0x1c')]?_0x5913d9[_0x9592('0x1c')][_0x9592('0x1f')]||null:null,'include':_0x5913d9[_0x9592('0x1c')]?_0x5913d9[_0x9592('0x1c')][_0x9592('0x20')]?_[_0x9592('0x21')](_0x5913d9['options']['include'],function(_0x5e0653){return{'model':db[_0x5e0653['model']],'as':_0x5e0653['as'],'attributes':_0x5e0653[_0x9592('0x22')],'include':_0x5e0653['include']?_[_0x9592('0x21')](_0x5e0653[_0x9592('0x20')],function(_0x53ea43){return{'model':db[_0x53ea43['model']],'as':_0x53ea43['as'],'attributes':_0x53ea43[_0x9592('0x22')],'include':_0x53ea43[_0x9592('0x20')]?_[_0x9592('0x21')](_0x53ea43[_0x9592('0x20')],function(_0x109eaa){return{'model':db[_0x109eaa[_0x9592('0x23')]],'as':_0x109eaa['as'],'attributes':_0x109eaa[_0x9592('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9592('0x24')](function(_0x4dc214){logger['info'](_0x9592('0x1b'),_0x5913d9);logger[_0x9592('0x25')]('GetFaxQueue',_0x5913d9,JSON['stringify'](_0x4dc214));_0x229fd3(_0x4dc214);})[_0x9592('0x1a')](function(_0x1e1697){logger[_0x9592('0x17')](_0x9592('0x1b'),_0x1e1697[_0x9592('0x18')],_0x5913d9);_0x590fdf(_0x2ec44b[_0x9592('0x17')](0x1f4,_0x1e1697[_0x9592('0x18')]));});});};exports['ShowFaxQueue']=function(_0x22cf4a){var _0x398c48=this;return new Promise(function(_0xac58cc,_0x4e0431){return db[_0x9592('0x26')][_0x9592('0x27')]({'raw':_0x22cf4a[_0x9592('0x1c')]?_0x22cf4a[_0x9592('0x1c')][_0x9592('0x1d')]===undefined?!![]:![]:!![],'where':_0x22cf4a[_0x9592('0x1c')]?_0x22cf4a[_0x9592('0x1c')][_0x9592('0x1e')]||null:null,'attributes':_0x22cf4a[_0x9592('0x1c')]?_0x22cf4a[_0x9592('0x1c')][_0x9592('0x22')]||null:null,'include':_0x22cf4a[_0x9592('0x1c')]?_0x22cf4a[_0x9592('0x1c')]['include']?_['map'](_0x22cf4a['options'][_0x9592('0x20')],function(_0x1e59da){return{'model':db[_0x1e59da[_0x9592('0x23')]],'as':_0x1e59da['as'],'attributes':_0x1e59da[_0x9592('0x22')],'include':_0x1e59da['include']?_[_0x9592('0x21')](_0x1e59da[_0x9592('0x20')],function(_0x211498){return{'model':db[_0x211498[_0x9592('0x23')]],'as':_0x211498['as'],'attributes':_0x211498['attributes'],'include':_0x211498[_0x9592('0x20')]?_['map'](_0x211498[_0x9592('0x20')],function(_0x2afd68){return{'model':db[_0x2afd68['model']],'as':_0x2afd68['as'],'attributes':_0x2afd68[_0x9592('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eec5f){logger['info']('ShowFaxQueue',_0x22cf4a);logger[_0x9592('0x25')]('ShowFaxQueue',_0x22cf4a,JSON[_0x9592('0x28')](_0x4eec5f));_0xac58cc(_0x4eec5f);})[_0x9592('0x1a')](function(_0x57f533){logger[_0x9592('0x17')]('ShowFaxQueue',_0x57f533[_0x9592('0x18')],_0x22cf4a);_0x4e0431(_0x398c48[_0x9592('0x17')](0x1f4,_0x57f533['message']));});});}; \ No newline at end of file +var _0xd18f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowFaxQueue','find','info','debug','lodash','util','moment','randomstring'];(function(_0x21a7ec,_0x450563){var _0x391fbf=function(_0x2abbd3){while(--_0x2abbd3){_0x21a7ec['push'](_0x21a7ec['shift']());}};_0x391fbf(++_0x450563);}(_0xd18f,0x1bf));var _0xfd18=function(_0x135d2a,_0x546cd1){_0x135d2a=_0x135d2a-0x0;var _0xae488=_0xd18f[_0x135d2a];return _0xae488;};'use strict';var _=require(_0xfd18('0x0'));var util=require(_0xfd18('0x1'));var moment=require(_0xfd18('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd18('0x3'));var fs=require('fs');var Redis=require(_0xfd18('0x4'));var db=require(_0xfd18('0x5'))['db'];var utils=require(_0xfd18('0x6'));var logger=require(_0xfd18('0x7'))(_0xfd18('0x8'));var config=require(_0xfd18('0x9'));var jayson=require(_0xfd18('0xa'));var client=jayson[_0xfd18('0xb')][_0xfd18('0xc')]({'port':0x232a});config[_0xfd18('0xd')]=_['defaults'](config[_0xfd18('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd18('0xd')]));require(_0xfd18('0xe'))['register'](socket);function respondWithRpcPromise(_0x42ab22,_0x11dbe8,_0x489bfd){return new BPromise(function(_0x43f85d,_0x377f59){return client[_0xfd18('0xf')](_0x42ab22,_0x489bfd)[_0xfd18('0x10')](function(_0x2eebab){logger['info'](_0xfd18('0x11'),_0x11dbe8,_0xfd18('0x12'));logger['debug'](_0xfd18('0x13'),_0x11dbe8,_0xfd18('0x12'),JSON[_0xfd18('0x14')](_0x2eebab));if(_0x2eebab[_0xfd18('0x15')]){if(_0x2eebab[_0xfd18('0x15')][_0xfd18('0x16')]===0x1f4){logger[_0xfd18('0x15')](_0xfd18('0x11'),_0x11dbe8,_0x2eebab[_0xfd18('0x15')]['message']);return _0x377f59(_0x2eebab['error'][_0xfd18('0x17')]);}logger['error'](_0xfd18('0x11'),_0x11dbe8,_0x2eebab[_0xfd18('0x15')][_0xfd18('0x17')]);return _0x43f85d(_0x2eebab[_0xfd18('0x15')][_0xfd18('0x17')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x11dbe8,'request\x20sent');_0x43f85d(_0x2eebab[_0xfd18('0x18')][_0xfd18('0x17')]);}})[_0xfd18('0x19')](function(_0x4ce29d){logger['error'](_0xfd18('0x11'),_0x11dbe8,_0x4ce29d);_0x377f59(_0x4ce29d);});});}exports[_0xfd18('0x1a')]=function(_0x549eb2){var _0x5d456a=this;return new Promise(function(_0x272e03,_0x3086a1){return db[_0xfd18('0x1b')][_0xfd18('0x1c')]({'raw':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x1e')]===undefined?!![]:![]:!![],'where':_0x549eb2['options']?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x1f')]||null:null,'attributes':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x20')]||null:null,'limit':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x21')]||null:null,'include':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')]['include']?_['map'](_0x549eb2['options'][_0xfd18('0x22')],function(_0x566a51){return{'model':db[_0x566a51[_0xfd18('0x23')]],'as':_0x566a51['as'],'attributes':_0x566a51['attributes'],'include':_0x566a51[_0xfd18('0x22')]?_['map'](_0x566a51['include'],function(_0x220687){return{'model':db[_0x220687[_0xfd18('0x23')]],'as':_0x220687['as'],'attributes':_0x220687[_0xfd18('0x20')],'include':_0x220687[_0xfd18('0x22')]?_[_0xfd18('0x24')](_0x220687[_0xfd18('0x22')],function(_0x269417){return{'model':db[_0x269417[_0xfd18('0x23')]],'as':_0x269417['as'],'attributes':_0x269417[_0xfd18('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfd18('0x10')](function(_0x4301a0){logger['info']('GetFaxQueue',_0x549eb2);logger['debug'](_0xfd18('0x1a'),_0x549eb2,JSON['stringify'](_0x4301a0));_0x272e03(_0x4301a0);})['catch'](function(_0xcebd4e){logger['error'](_0xfd18('0x1a'),_0xcebd4e[_0xfd18('0x17')],_0x549eb2);_0x3086a1(_0x5d456a[_0xfd18('0x15')](0x1f4,_0xcebd4e['message']));});});};exports[_0xfd18('0x25')]=function(_0x11a4b3){var _0x3688c4=this;return new Promise(function(_0x2842c7,_0x1edecb){return db['FaxQueue'][_0xfd18('0x26')]({'raw':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3[_0xfd18('0x1d')][_0xfd18('0x1e')]===undefined?!![]:![]:!![],'where':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3[_0xfd18('0x1d')][_0xfd18('0x1f')]||null:null,'attributes':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3['options'][_0xfd18('0x20')]||null:null,'include':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3[_0xfd18('0x1d')][_0xfd18('0x22')]?_[_0xfd18('0x24')](_0x11a4b3['options'][_0xfd18('0x22')],function(_0x3d34a4){return{'model':db[_0x3d34a4[_0xfd18('0x23')]],'as':_0x3d34a4['as'],'attributes':_0x3d34a4['attributes'],'include':_0x3d34a4[_0xfd18('0x22')]?_[_0xfd18('0x24')](_0x3d34a4[_0xfd18('0x22')],function(_0xddffcb){return{'model':db[_0xddffcb[_0xfd18('0x23')]],'as':_0xddffcb['as'],'attributes':_0xddffcb[_0xfd18('0x20')],'include':_0xddffcb[_0xfd18('0x22')]?_[_0xfd18('0x24')](_0xddffcb[_0xfd18('0x22')],function(_0x572a7c){return{'model':db[_0x572a7c['model']],'as':_0x572a7c['as'],'attributes':_0x572a7c[_0xfd18('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfd18('0x10')](function(_0x476a23){logger[_0xfd18('0x27')](_0xfd18('0x25'),_0x11a4b3);logger[_0xfd18('0x28')](_0xfd18('0x25'),_0x11a4b3,JSON[_0xfd18('0x14')](_0x476a23));_0x2842c7(_0x476a23);})['catch'](function(_0x455d75){logger['error'](_0xfd18('0x25'),_0x455d75[_0xfd18('0x17')],_0x11a4b3);_0x1edecb(_0x3688c4[_0xfd18('0x15')](0x1f4,_0x455d75[_0xfd18('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index cc98d3f..b91e0e4 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 _0xbacb=['register','faxQueue:','./faxQueue.events','save','update','emit'];(function(_0x29bba5,_0x4c59a){var _0xd03a9d=function(_0x493b59){while(--_0x493b59){_0x29bba5['push'](_0x29bba5['shift']());}};_0xd03a9d(++_0x4c59a);}(_0xbacb,0x1a6));var _0xbbac=function(_0x3c8ed7,_0x5b4105){_0x3c8ed7=_0x3c8ed7-0x0;var _0x54e9a6=_0xbacb[_0x3c8ed7];return _0x54e9a6;};'use strict';var FaxQueueEvents=require(_0xbbac('0x0'));var events=[_0xbbac('0x1'),'remove',_0xbbac('0x2')];function createListener(_0x27e607,_0x3689f3){return function(_0x30e505){_0x3689f3[_0xbbac('0x3')](_0x27e607,_0x30e505);};}function removeListener(_0x97ea61,_0x4e3698){return function(){FaxQueueEvents['removeListener'](_0x97ea61,_0x4e3698);};}exports[_0xbbac('0x4')]=function(_0x2b9236){for(var _0x210763=0x0,_0x2d3a31=events['length'];_0x210763<_0x2d3a31;_0x210763++){var _0x17aaf1=events[_0x210763];var _0xfd6f21=createListener(_0xbbac('0x5')+_0x17aaf1,_0x2b9236);FaxQueueEvents['on'](_0x17aaf1,_0xfd6f21);}}; \ No newline at end of file +var _0xf555=['faxQueue:','./faxQueue.events','save','remove','update','emit','register','length'];(function(_0x29117d,_0x1b884e){var _0x157c92=function(_0x2947eb){while(--_0x2947eb){_0x29117d['push'](_0x29117d['shift']());}};_0x157c92(++_0x1b884e);}(_0xf555,0xc1));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x5f55('0x0'));var events=[_0x5f55('0x1'),_0x5f55('0x2'),_0x5f55('0x3')];function createListener(_0x1303e2,_0x527045){return function(_0x40e97d){_0x527045[_0x5f55('0x4')](_0x1303e2,_0x40e97d);};}function removeListener(_0x3f4299,_0x5371d6){return function(){FaxQueueEvents['removeListener'](_0x3f4299,_0x5371d6);};}exports[_0x5f55('0x5')]=function(_0x2ea7e1){for(var _0x4b1c0a=0x0,_0x4b0466=events[_0x5f55('0x6')];_0x4b1c0a<_0x4b0466;_0x4b1c0a++){var _0x50ef6e=events[_0x4b1c0a];var _0x2f93a0=createListener(_0x5f55('0x7')+_0x50ef6e,_0x2ea7e1);FaxQueueEvents['on'](_0x50ef6e,_0x2f93a0);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2802eda..9e95d9d 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 _0xa498=['getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','/:id/teams'];(function(_0xf01bfe,_0x4e1152){var _0x23590d=function(_0x48c511){while(--_0x48c511){_0xf01bfe['push'](_0xf01bfe['shift']());}};_0x23590d(++_0x4e1152);}(_0xa498,0x1d6));var _0x8a49=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xa498[_0x5805d7];return _0x170fe4;};'use strict';var multer=require('multer');var util=require(_0x8a49('0x0'));var path=require(_0x8a49('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a49('0x2')]();var fs_extra=require(_0x8a49('0x3'));var auth=require(_0x8a49('0x4'));var interaction=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var controller=require('./faxQueue.controller');router[_0x8a49('0x7')]('/',auth['isAuthenticated'](),controller[_0x8a49('0x8')]);router[_0x8a49('0x7')](_0x8a49('0x9'),auth['isAuthenticated'](),controller[_0x8a49('0xa')]);router[_0x8a49('0x7')](_0x8a49('0xb'),auth[_0x8a49('0xc')](),controller[_0x8a49('0xd')]);router[_0x8a49('0x7')]('/:id/members',auth[_0x8a49('0xc')](),controller[_0x8a49('0xe')]);router[_0x8a49('0x7')](_0x8a49('0xf'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x10')]);router[_0x8a49('0x7')](_0x8a49('0x11'),auth[_0x8a49('0xc')](),controller['getAgents']);router[_0x8a49('0x12')]('/',auth[_0x8a49('0xc')](),controller[_0x8a49('0x13')]);router['post'](_0x8a49('0xf'),auth['isAuthenticated'](),controller[_0x8a49('0x14')]);router[_0x8a49('0x12')]('/:id/users',auth[_0x8a49('0xc')](),controller[_0x8a49('0x15')]);router[_0x8a49('0x16')](_0x8a49('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8a49('0x17')](_0x8a49('0xb'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x18')]);router['delete'](_0x8a49('0xf'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x19')]);router[_0x8a49('0x17')](_0x8a49('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x8a49('0x1a')]=router; \ No newline at end of file +var _0x07e8=['post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','fs-extra','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x1c1820,_0x18bb79){var _0x6690e6=function(_0x11ae54){while(--_0x11ae54){_0x1c1820['push'](_0x1c1820['shift']());}};_0x6690e6(++_0x18bb79);}(_0x07e8,0x10f));var _0x807e=function(_0x5e8394,_0x2e0c21){_0x5e8394=_0x5e8394-0x0;var _0x1e469d=_0x07e8[_0x5e8394];return _0x1e469d;};'use strict';var multer=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var path=require(_0x807e('0x2'));var timeout=require('connect-timeout');var express=require(_0x807e('0x3'));var router=express['Router']();var fs_extra=require(_0x807e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x807e('0x5'));var controller=require(_0x807e('0x6'));router[_0x807e('0x7')]('/',auth['isAuthenticated'](),controller[_0x807e('0x8')]);router[_0x807e('0x7')](_0x807e('0x9'),auth[_0x807e('0xa')](),controller[_0x807e('0xb')]);router['get'](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0xd')]);router[_0x807e('0x7')](_0x807e('0xe'),auth[_0x807e('0xa')](),controller[_0x807e('0xf')]);router[_0x807e('0x7')](_0x807e('0x10'),auth[_0x807e('0xa')](),controller[_0x807e('0x11')]);router[_0x807e('0x7')](_0x807e('0x12'),auth[_0x807e('0xa')](),controller['getAgents']);router[_0x807e('0x13')]('/',auth[_0x807e('0xa')](),controller[_0x807e('0x14')]);router[_0x807e('0x13')](_0x807e('0x10'),auth[_0x807e('0xa')](),controller[_0x807e('0x15')]);router['post']('/:id/users',auth[_0x807e('0xa')](),controller[_0x807e('0x16')]);router[_0x807e('0x17')](_0x807e('0xc'),auth['isAuthenticated'](),controller[_0x807e('0x18')]);router[_0x807e('0x19')](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0x1a')]);router[_0x807e('0x19')]('/:id/teams',auth[_0x807e('0xa')](),controller['removeTeams']);router[_0x807e('0x19')](_0x807e('0x12'),auth[_0x807e('0xa')](),controller[_0x807e('0x1b')]);module[_0x807e('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 83282b6..fb400fa 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 _0x5dd1=['DATE','moment','sequelize','STRING'];(function(_0x44fdd4,_0x57a781){var _0x2caffe=function(_0x124757){while(--_0x124757){_0x44fdd4['push'](_0x44fdd4['shift']());}};_0x2caffe(++_0x57a781);}(_0x5dd1,0xed));var _0x15dd=function(_0x4bc5e3,_0x252194){_0x4bc5e3=_0x4bc5e3-0x0;var _0x2cb7a1=_0x5dd1[_0x4bc5e3];return _0x2cb7a1;};'use strict';var moment=require(_0x15dd('0x0'));var Sequelize=require(_0x15dd('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x15dd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x15dd('0x2')]},'joinAt':{'type':Sequelize[_0x15dd('0x3')]},'leaveAt':{'type':Sequelize[_0x15dd('0x3')]},'acceptAt':{'type':Sequelize[_0x15dd('0x3')]},'exitAt':{'type':Sequelize[_0x15dd('0x3')]},'reason':{'type':Sequelize[_0x15dd('0x2')]}}; \ No newline at end of file +var _0x75fc=['exports','STRING','DATE','moment','sequelize'];(function(_0x27fecd,_0x490a88){var _0x458423=function(_0x1df95f){while(--_0x1df95f){_0x27fecd['push'](_0x27fecd['shift']());}};_0x458423(++_0x490a88);}(_0x75fc,0x8a));var _0xc75f=function(_0x3bb744,_0x18cdeb){_0x3bb744=_0x3bb744-0x0;var _0x374564=_0x75fc[_0x3bb744];return _0x374564;};'use strict';var moment=require(_0xc75f('0x0'));var Sequelize=require(_0xc75f('0x1'));module[_0xc75f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc75f('0x3')]},'joinAt':{'type':Sequelize[_0xc75f('0x4')]},'leaveAt':{'type':Sequelize[_0xc75f('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc75f('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4837874..1bd1bd6 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 _0x17ba=['length','nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','then','rows','params','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','FaxQueueReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0x17ba,0xab));var _0xa17b=function(_0x4a5fca,_0x1c8f71){_0x4a5fca=_0x4a5fca-0x0;var _0x11b4ab=_0x17ba[_0x4a5fca];return _0x11b4ab;};'use strict';var emlformat=require(_0xa17b('0x0'));var rimraf=require(_0xa17b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa17b('0x2'));var rp=require(_0xa17b('0x3'));var moment=require(_0xa17b('0x4'));var BPromise=require(_0xa17b('0x5'));var Mustache=require(_0xa17b('0x6'));var util=require(_0xa17b('0x7'));var path=require(_0xa17b('0x8'));var sox=require(_0xa17b('0x9'));var csv=require(_0xa17b('0xa'));var ejs=require(_0xa17b('0xb'));var fs=require('fs');var fs_extra=require(_0xa17b('0xc'));var _=require(_0xa17b('0xd'));var squel=require(_0xa17b('0xe'));var crypto=require(_0xa17b('0xf'));var jsforce=require(_0xa17b('0x10'));var deskjs=require(_0xa17b('0x11'));var toCsv=require(_0xa17b('0xa'));var querystring=require(_0xa17b('0x12'));var Papa=require(_0xa17b('0x13'));var Redis=require('ioredis');var authService=require(_0xa17b('0x14'));var qs=require(_0xa17b('0x15'));var as=require(_0xa17b('0x16'));var hardwareService=require(_0xa17b('0x17'));var logger=require(_0xa17b('0x18'))(_0xa17b('0x19'));var utils=require(_0xa17b('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xa17b('0x1b'));var db=require(_0xa17b('0x1c'))['db'];function respondWithStatusCode(_0x3c3a8a,_0x52b7aa){_0x52b7aa=_0x52b7aa||0xcc;return function(_0x3abc59){if(_0x3abc59){return _0x3c3a8a[_0xa17b('0x1d')](_0x52b7aa);}return _0x3c3a8a[_0xa17b('0x1e')](_0x52b7aa)[_0xa17b('0x1f')]();};}function respondWithResult(_0x4a222e,_0x117ad9){_0x117ad9=_0x117ad9||0xc8;return function(_0x529910){if(_0x529910){return _0x4a222e[_0xa17b('0x1e')](_0x117ad9)[_0xa17b('0x20')](_0x529910);}};}function respondWithFilteredResult(_0x5de138,_0x112764){return function(_0x3c63e3){if(_0x3c63e3){var _0x1c0578=typeof _0x112764[_0xa17b('0x21')]==='undefined'&&typeof _0x112764[_0xa17b('0x22')]==='undefined';var _0x4d5592=_0x3c63e3['count'];var _0x36f985=_0x1c0578?0x0:_0x112764[_0xa17b('0x21')];var _0x53a0f7=_0x1c0578?_0x3c63e3[_0xa17b('0x23')]:_0x112764[_0xa17b('0x21')]+_0x112764[_0xa17b('0x22')];var _0x2fb679;if(_0x53a0f7>=_0x4d5592){_0x53a0f7=_0x4d5592;_0x2fb679=0xc8;}else{_0x2fb679=0xce;}_0x5de138[_0xa17b('0x1e')](_0x2fb679);return _0x5de138[_0xa17b('0x24')](_0xa17b('0x25'),_0x36f985+'-'+_0x53a0f7+'/'+_0x4d5592)['json'](_0x3c63e3);}return null;};}function patchUpdates(_0x610c2b){return function(_0x3f409a){try{jsonpatch[_0xa17b('0x26')](_0x3f409a,_0x610c2b,!![]);}catch(_0x52e75a){return BPromise[_0xa17b('0x27')](_0x52e75a);}return _0x3f409a[_0xa17b('0x28')]();};}function saveUpdates(_0x24d305,_0xbbbb62){return function(_0x3c7ec2){if(_0x3c7ec2){return _0x3c7ec2[_0xa17b('0x29')](_0x24d305)['then'](function(_0x3df11f){return _0x3df11f;});}return null;};}function removeEntity(_0x4d4a65,_0xa34739){return function(_0x13630d){if(_0x13630d){return _0x13630d['destroy']()['then'](function(){_0x4d4a65[_0xa17b('0x1e')](0xcc)[_0xa17b('0x1f')]();});}};}function handleEntityNotFound(_0x4216ca,_0x98f802){return function(_0x3c32a5){if(!_0x3c32a5){_0x4216ca[_0xa17b('0x1d')](0x194);}return _0x3c32a5;};}function handleError(_0x4cd38e,_0x47aff8){_0x47aff8=_0x47aff8||0x1f4;return function(_0x5c98fe){logger['error'](_0x5c98fe[_0xa17b('0x2a')]);if(_0x5c98fe['name']){delete _0x5c98fe[_0xa17b('0x2b')];}_0x4cd38e['status'](_0x47aff8)[_0xa17b('0x2c')](_0x5c98fe);};}exports[_0xa17b('0x2d')]=function(_0x32cad9,_0x28e6b8){var _0x346cc2={},_0x3ccdb8={},_0x2fbbe8={'count':0x0,'rows':[]};var _0x366b47=_[_0xa17b('0x2e')](db[_0xa17b('0x2f')][_0xa17b('0x30')],function(_0x573585){return{'name':_0x573585['fieldName'],'type':_0x573585['type'][_0xa17b('0x31')]};});_0x3ccdb8[_0xa17b('0x32')]=_[_0xa17b('0x2e')](_0x366b47,_0xa17b('0x2b'));_0x3ccdb8[_0xa17b('0x33')]=_[_0xa17b('0x34')](_0x32cad9[_0xa17b('0x33')]);_0x3ccdb8[_0xa17b('0x35')]=_['intersection'](_0x3ccdb8[_0xa17b('0x32')],_0x3ccdb8['query']);_0x346cc2[_0xa17b('0x36')]=_[_0xa17b('0x37')](_0x3ccdb8[_0xa17b('0x32')],qs[_0xa17b('0x38')](_0x32cad9[_0xa17b('0x33')][_0xa17b('0x38')]));_0x346cc2['attributes']=_0x346cc2[_0xa17b('0x36')][_0xa17b('0x39')]?_0x346cc2[_0xa17b('0x36')]:_0x3ccdb8[_0xa17b('0x32')];if(!_0x32cad9[_0xa17b('0x33')]['hasOwnProperty'](_0xa17b('0x3a'))){_0x346cc2['limit']=qs[_0xa17b('0x22')](_0x32cad9['query'][_0xa17b('0x22')]);_0x346cc2[_0xa17b('0x21')]=qs['offset'](_0x32cad9[_0xa17b('0x33')][_0xa17b('0x21')]);}_0x346cc2['order']=qs[_0xa17b('0x3b')](_0x32cad9[_0xa17b('0x33')][_0xa17b('0x3b')]);_0x346cc2[_0xa17b('0x3c')]=qs[_0xa17b('0x35')](_['pick'](_0x32cad9[_0xa17b('0x33')],_0x3ccdb8['filters']),_0x366b47);if(_0x32cad9[_0xa17b('0x33')]['filter']){_0x346cc2[_0xa17b('0x3c')]=_['merge'](_0x346cc2[_0xa17b('0x3c')],{'$or':_['map'](_0x366b47,function(_0x110183){if(_0x110183['type']!==_0xa17b('0x3d')){var _0x44be7d={};_0x44be7d[_0x110183[_0xa17b('0x2b')]]={'$like':'%'+_0x32cad9[_0xa17b('0x33')][_0xa17b('0x3e')]+'%'};return _0x44be7d;}})});}_0x346cc2=_[_0xa17b('0x3f')]({},_0x346cc2,_0x32cad9[_0xa17b('0x40')]);var _0xe57f94={'where':_0x346cc2['where']};return db[_0xa17b('0x2f')][_0xa17b('0x23')](_0xe57f94)['then'](function(_0x477922){_0x2fbbe8[_0xa17b('0x23')]=_0x477922;if(_0x32cad9[_0xa17b('0x33')][_0xa17b('0x41')]){_0x346cc2[_0xa17b('0x42')]=[{'all':!![]}];}return db[_0xa17b('0x2f')]['findAll'](_0x346cc2);})[_0xa17b('0x43')](function(_0x1521fe){_0x2fbbe8[_0xa17b('0x44')]=_0x1521fe;return _0x2fbbe8;})['then'](respondWithFilteredResult(_0x28e6b8,_0x346cc2))['catch'](handleError(_0x28e6b8,null));};exports['show']=function(_0x2c8d74,_0x18b230){var _0x3c2788={'raw':!![],'where':{'id':_0x2c8d74[_0xa17b('0x45')]['id']}},_0x1d6b35={};_0x1d6b35[_0xa17b('0x32')]=_[_0xa17b('0x34')](db[_0xa17b('0x2f')][_0xa17b('0x30')]);_0x1d6b35[_0xa17b('0x33')]=_[_0xa17b('0x34')](_0x2c8d74[_0xa17b('0x33')]);_0x1d6b35['filters']=_[_0xa17b('0x37')](_0x1d6b35[_0xa17b('0x32')],_0x1d6b35[_0xa17b('0x33')]);_0x3c2788[_0xa17b('0x36')]=_[_0xa17b('0x37')](_0x1d6b35[_0xa17b('0x32')],qs['fields'](_0x2c8d74[_0xa17b('0x33')][_0xa17b('0x38')]));_0x3c2788[_0xa17b('0x36')]=_0x3c2788[_0xa17b('0x36')][_0xa17b('0x39')]?_0x3c2788['attributes']:_0x1d6b35[_0xa17b('0x32')];if(_0x2c8d74[_0xa17b('0x33')][_0xa17b('0x41')]){_0x3c2788[_0xa17b('0x42')]=[{'all':!![]}];}_0x3c2788=_['merge']({},_0x3c2788,_0x2c8d74[_0xa17b('0x40')]);return db[_0xa17b('0x2f')][_0xa17b('0x46')](_0x3c2788)[_0xa17b('0x43')](handleEntityNotFound(_0x18b230,null))[_0xa17b('0x43')](respondWithResult(_0x18b230,null))[_0xa17b('0x47')](handleError(_0x18b230,null));};exports[_0xa17b('0x48')]=function(_0x5bf8f9,_0x43b5d5){return db[_0xa17b('0x2f')]['create'](_0x5bf8f9[_0xa17b('0x49')],{})[_0xa17b('0x43')](respondWithResult(_0x43b5d5,0xc9))[_0xa17b('0x47')](handleError(_0x43b5d5,null));};exports['update']=function(_0x187237,_0x4681ca){if(_0x187237['body']['id']){delete _0x187237[_0xa17b('0x49')]['id'];}return db[_0xa17b('0x2f')]['find']({'where':{'id':_0x187237[_0xa17b('0x45')]['id']}})[_0xa17b('0x43')](handleEntityNotFound(_0x4681ca,null))['then'](saveUpdates(_0x187237[_0xa17b('0x49')],null))[_0xa17b('0x43')](respondWithResult(_0x4681ca,null))[_0xa17b('0x47')](handleError(_0x4681ca,null));};exports[_0xa17b('0x4a')]=function(_0x2f4a2c,_0x133823){return db[_0xa17b('0x2f')]['find']({'where':{'id':_0x2f4a2c[_0xa17b('0x45')]['id']}})[_0xa17b('0x43')](handleEntityNotFound(_0x133823,null))[_0xa17b('0x43')](removeEntity(_0x133823,null))[_0xa17b('0x47')](handleError(_0x133823,null));};exports[_0xa17b('0x4b')]=function(_0x13a0d3,_0x1dffb7){return db[_0xa17b('0x2f')][_0xa17b('0x4b')]()[_0xa17b('0x43')](respondWithResult(_0x1dffb7,null))[_0xa17b('0x47')](handleError(_0x1dffb7,null));}; \ No newline at end of file +var _0x0851=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','json','reject','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','keys','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1d3642,_0x48fdc2){var _0x5de26=function(_0x91373e){while(--_0x91373e){_0x1d3642['push'](_0x1d3642['shift']());}};_0x5de26(++_0x48fdc2);}(_0x0851,0x8a));var _0x1085=function(_0x119ded,_0x497e72){_0x119ded=_0x119ded-0x0;var _0x22108b=_0x0851[_0x119ded];return _0x22108b;};'use strict';var emlformat=require(_0x1085('0x0'));var rimraf=require(_0x1085('0x1'));var zipdir=require(_0x1085('0x2'));var jsonpatch=require(_0x1085('0x3'));var rp=require('request-promise');var moment=require(_0x1085('0x4'));var BPromise=require(_0x1085('0x5'));var Mustache=require(_0x1085('0x6'));var util=require(_0x1085('0x7'));var path=require(_0x1085('0x8'));var sox=require(_0x1085('0x9'));var csv=require(_0x1085('0xa'));var ejs=require(_0x1085('0xb'));var fs=require('fs');var fs_extra=require(_0x1085('0xc'));var _=require(_0x1085('0xd'));var squel=require(_0x1085('0xe'));var crypto=require(_0x1085('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1085('0xa'));var querystring=require(_0x1085('0x10'));var Papa=require(_0x1085('0x11'));var Redis=require(_0x1085('0x12'));var authService=require(_0x1085('0x13'));var qs=require(_0x1085('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1085('0x15'));var logger=require(_0x1085('0x16'))(_0x1085('0x17'));var utils=require(_0x1085('0x18'));var config=require(_0x1085('0x19'));var licenseUtil=require(_0x1085('0x1a'));var db=require(_0x1085('0x1b'))['db'];function respondWithStatusCode(_0x4c7520,_0x3664c9){_0x3664c9=_0x3664c9||0xcc;return function(_0x95194a){if(_0x95194a){return _0x4c7520[_0x1085('0x1c')](_0x3664c9);}return _0x4c7520['status'](_0x3664c9)[_0x1085('0x1d')]();};}function respondWithResult(_0x59802d,_0x4754c9){_0x4754c9=_0x4754c9||0xc8;return function(_0x23dcd7){if(_0x23dcd7){return _0x59802d[_0x1085('0x1e')](_0x4754c9)['json'](_0x23dcd7);}};}function respondWithFilteredResult(_0x334c3a,_0x27b8d9){return function(_0x1332ad){if(_0x1332ad){var _0x41e4d7=typeof _0x27b8d9['offset']===_0x1085('0x1f')&&typeof _0x27b8d9['limit']===_0x1085('0x1f');var _0x5877e9=_0x1332ad[_0x1085('0x20')];var _0x37b760=_0x41e4d7?0x0:_0x27b8d9[_0x1085('0x21')];var _0x5e2270=_0x41e4d7?_0x1332ad[_0x1085('0x20')]:_0x27b8d9['offset']+_0x27b8d9[_0x1085('0x22')];var _0x5b715a;if(_0x5e2270>=_0x5877e9){_0x5e2270=_0x5877e9;_0x5b715a=0xc8;}else{_0x5b715a=0xce;}_0x334c3a['status'](_0x5b715a);return _0x334c3a['set']('Content-Range',_0x37b760+'-'+_0x5e2270+'/'+_0x5877e9)[_0x1085('0x23')](_0x1332ad);}return null;};}function patchUpdates(_0x5c89f2){return function(_0x5460cb){try{jsonpatch['apply'](_0x5460cb,_0x5c89f2,!![]);}catch(_0x17aed6){return BPromise[_0x1085('0x24')](_0x17aed6);}return _0x5460cb[_0x1085('0x25')]();};}function saveUpdates(_0x50d3d6,_0x146a78){return function(_0x3c77f2){if(_0x3c77f2){return _0x3c77f2['update'](_0x50d3d6)[_0x1085('0x26')](function(_0x55a0eb){return _0x55a0eb;});}return null;};}function removeEntity(_0x32efc1,_0x54f32c){return function(_0xafd7df){if(_0xafd7df){return _0xafd7df[_0x1085('0x27')]()[_0x1085('0x26')](function(){_0x32efc1['status'](0xcc)[_0x1085('0x1d')]();});}};}function handleEntityNotFound(_0x1698e2,_0x2712c9){return function(_0x552876){if(!_0x552876){_0x1698e2[_0x1085('0x1c')](0x194);}return _0x552876;};}function handleError(_0xbf3272,_0x3f788b){_0x3f788b=_0x3f788b||0x1f4;return function(_0x4b3ca1){logger[_0x1085('0x28')](_0x4b3ca1[_0x1085('0x29')]);if(_0x4b3ca1[_0x1085('0x2a')]){delete _0x4b3ca1[_0x1085('0x2a')];}_0xbf3272[_0x1085('0x1e')](_0x3f788b)[_0x1085('0x2b')](_0x4b3ca1);};}exports[_0x1085('0x2c')]=function(_0x2a90d1,_0x22f3d9){var _0x417cb6={},_0x1881d5={},_0x5c5ed1={'count':0x0,'rows':[]};var _0x24959b=_[_0x1085('0x2d')](db[_0x1085('0x2e')][_0x1085('0x2f')],function(_0x41da9b){return{'name':_0x41da9b[_0x1085('0x30')],'type':_0x41da9b[_0x1085('0x31')][_0x1085('0x32')]};});_0x1881d5[_0x1085('0x33')]=_[_0x1085('0x2d')](_0x24959b,_0x1085('0x2a'));_0x1881d5[_0x1085('0x34')]=_['keys'](_0x2a90d1[_0x1085('0x34')]);_0x1881d5[_0x1085('0x35')]=_['intersection'](_0x1881d5[_0x1085('0x33')],_0x1881d5[_0x1085('0x34')]);_0x417cb6[_0x1085('0x36')]=_[_0x1085('0x37')](_0x1881d5[_0x1085('0x33')],qs['fields'](_0x2a90d1[_0x1085('0x34')][_0x1085('0x38')]));_0x417cb6['attributes']=_0x417cb6[_0x1085('0x36')][_0x1085('0x39')]?_0x417cb6[_0x1085('0x36')]:_0x1881d5[_0x1085('0x33')];if(!_0x2a90d1['query'][_0x1085('0x3a')](_0x1085('0x3b'))){_0x417cb6[_0x1085('0x22')]=qs[_0x1085('0x22')](_0x2a90d1['query'][_0x1085('0x22')]);_0x417cb6[_0x1085('0x21')]=qs[_0x1085('0x21')](_0x2a90d1['query'][_0x1085('0x21')]);}_0x417cb6['order']=qs[_0x1085('0x3c')](_0x2a90d1['query'][_0x1085('0x3c')]);_0x417cb6[_0x1085('0x3d')]=qs['filters'](_[_0x1085('0x3e')](_0x2a90d1[_0x1085('0x34')],_0x1881d5['filters']),_0x24959b);if(_0x2a90d1[_0x1085('0x34')]['filter']){_0x417cb6['where']=_[_0x1085('0x3f')](_0x417cb6[_0x1085('0x3d')],{'$or':_['map'](_0x24959b,function(_0x2b34b9){if(_0x2b34b9[_0x1085('0x31')]!==_0x1085('0x40')){var _0x34b696={};_0x34b696[_0x2b34b9['name']]={'$like':'%'+_0x2a90d1[_0x1085('0x34')][_0x1085('0x41')]+'%'};return _0x34b696;}})});}_0x417cb6=_[_0x1085('0x3f')]({},_0x417cb6,_0x2a90d1[_0x1085('0x42')]);var _0x3d11f4={'where':_0x417cb6['where']};return db[_0x1085('0x2e')]['count'](_0x3d11f4)['then'](function(_0x3b7482){_0x5c5ed1['count']=_0x3b7482;if(_0x2a90d1['query']['includeAll']){_0x417cb6[_0x1085('0x43')]=[{'all':!![]}];}return db[_0x1085('0x2e')][_0x1085('0x44')](_0x417cb6);})[_0x1085('0x26')](function(_0x3bda3b){_0x5c5ed1[_0x1085('0x45')]=_0x3bda3b;return _0x5c5ed1;})[_0x1085('0x26')](respondWithFilteredResult(_0x22f3d9,_0x417cb6))['catch'](handleError(_0x22f3d9,null));};exports['show']=function(_0x26fefd,_0x47a10c){var _0x4e8ccf={'raw':!![],'where':{'id':_0x26fefd[_0x1085('0x46')]['id']}},_0x2fbad5={};_0x2fbad5[_0x1085('0x33')]=_[_0x1085('0x47')](db[_0x1085('0x2e')][_0x1085('0x2f')]);_0x2fbad5[_0x1085('0x34')]=_['keys'](_0x26fefd['query']);_0x2fbad5[_0x1085('0x35')]=_['intersection'](_0x2fbad5['model'],_0x2fbad5[_0x1085('0x34')]);_0x4e8ccf[_0x1085('0x36')]=_[_0x1085('0x37')](_0x2fbad5[_0x1085('0x33')],qs[_0x1085('0x38')](_0x26fefd[_0x1085('0x34')][_0x1085('0x38')]));_0x4e8ccf[_0x1085('0x36')]=_0x4e8ccf['attributes'][_0x1085('0x39')]?_0x4e8ccf['attributes']:_0x2fbad5[_0x1085('0x33')];if(_0x26fefd[_0x1085('0x34')][_0x1085('0x48')]){_0x4e8ccf[_0x1085('0x43')]=[{'all':!![]}];}_0x4e8ccf=_[_0x1085('0x3f')]({},_0x4e8ccf,_0x26fefd['options']);return db[_0x1085('0x2e')][_0x1085('0x49')](_0x4e8ccf)[_0x1085('0x26')](handleEntityNotFound(_0x47a10c,null))[_0x1085('0x26')](respondWithResult(_0x47a10c,null))[_0x1085('0x4a')](handleError(_0x47a10c,null));};exports['create']=function(_0x3b004d,_0x32c07d){return db[_0x1085('0x2e')][_0x1085('0x4b')](_0x3b004d[_0x1085('0x4c')],{})[_0x1085('0x26')](respondWithResult(_0x32c07d,0xc9))['catch'](handleError(_0x32c07d,null));};exports[_0x1085('0x4d')]=function(_0x43ccd2,_0x7338f9){if(_0x43ccd2[_0x1085('0x4c')]['id']){delete _0x43ccd2[_0x1085('0x4c')]['id'];}return db['FaxQueueReport'][_0x1085('0x49')]({'where':{'id':_0x43ccd2[_0x1085('0x46')]['id']}})[_0x1085('0x26')](handleEntityNotFound(_0x7338f9,null))[_0x1085('0x26')](saveUpdates(_0x43ccd2['body'],null))['then'](respondWithResult(_0x7338f9,null))[_0x1085('0x4a')](handleError(_0x7338f9,null));};exports['destroy']=function(_0x329804,_0x279d0b){return db[_0x1085('0x2e')][_0x1085('0x49')]({'where':{'id':_0x329804['params']['id']}})[_0x1085('0x26')](handleEntityNotFound(_0x279d0b,null))[_0x1085('0x26')](removeEntity(_0x279d0b,null))[_0x1085('0x4a')](handleError(_0x279d0b,null));};exports['describe']=function(_0x1c9d86,_0x1ccbb5){return db[_0x1085('0x2e')][_0x1085('0x4e')]()[_0x1085('0x26')](respondWithResult(_0x1ccbb5,null))[_0x1085('0x4a')](handleError(_0x1ccbb5,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 1a5a8d5..b5e4e8d 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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x15b6fe,_0x294d05){var _0x1c7e10=function(_0x62f5a7){while(--_0x62f5a7){_0x15b6fe['push'](_0x15b6fe['shift']());}};_0x1c7e10(++_0x294d05);}(_0x53ec,0x192));var _0xc53e=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0x53ec[_0x4fe19c];return _0x952ac7;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x27736f,_0x41fefb){var _0x2c1933=function(_0x5ba49e){while(--_0x5ba49e){_0x27736f['push'](_0x27736f['shift']());}};_0x2c1933(++_0x41fefb);}(_0xe14b,0x93));var _0xbe14=function(_0x246a50,_0x4f18c8){_0x246a50=_0x246a50-0x0;var _0x3f9a77=_0xe14b[_0x246a50];return _0x3f9a77;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 98d6b28..399cb0c 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 _0xf293=['jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','create','body','options','raw','update','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment'];(function(_0x1f4674,_0x146085){var _0x3e7f42=function(_0x4bd366){while(--_0x4bd366){_0x1f4674['push'](_0x1f4674['shift']());}};_0x3e7f42(++_0x146085);}(_0xf293,0x172));var _0x3f29=function(_0x186e99,_0x27a044){_0x186e99=_0x186e99-0x0;var _0x275b9e=_0xf293[_0x186e99];return _0x275b9e;};'use strict';var _=require(_0x3f29('0x0'));var util=require(_0x3f29('0x1'));var moment=require(_0x3f29('0x2'));var BPromise=require(_0x3f29('0x3'));var rs=require(_0x3f29('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f29('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3f29('0x6'));var jayson=require(_0x3f29('0x7'));var client=jayson[_0x3f29('0x8')][_0x3f29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43e9f2,_0x5488da,_0x35c404){return new BPromise(function(_0x3f2019,_0x369d4d){return client['request'](_0x43e9f2,_0x35c404)[_0x3f29('0xa')](function(_0x3ab928){logger[_0x3f29('0xb')](_0x3f29('0xc'),_0x5488da,_0x3f29('0xd'));logger[_0x3f29('0xe')](_0x3f29('0xf'),_0x5488da,_0x3f29('0xd'),JSON[_0x3f29('0x10')](_0x3ab928));if(_0x3ab928[_0x3f29('0x11')]){if(_0x3ab928[_0x3f29('0x11')]['code']===0x1f4){logger['error'](_0x3f29('0xc'),_0x5488da,_0x3ab928['error'][_0x3f29('0x12')]);return _0x369d4d(_0x3ab928[_0x3f29('0x11')]['message']);}logger[_0x3f29('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x5488da,_0x3ab928['error']['message']);return _0x3f2019(_0x3ab928['error'][_0x3f29('0x12')]);}else{logger[_0x3f29('0xb')](_0x3f29('0xc'),_0x5488da,'request\x20sent');_0x3f2019(_0x3ab928[_0x3f29('0x13')][_0x3f29('0x12')]);}})[_0x3f29('0x14')](function(_0x11645a){logger['error'](_0x3f29('0xc'),_0x5488da,_0x11645a);_0x369d4d(_0x11645a);});});}exports[_0x3f29('0x15')]=function(_0x33c523){var _0x3b73e0=this;return new Promise(function(_0x7a7bb2,_0x411182){return db['FaxQueueReport'][_0x3f29('0x16')](_0x33c523[_0x3f29('0x17')],{'raw':_0x33c523[_0x3f29('0x18')]?_0x33c523[_0x3f29('0x18')][_0x3f29('0x19')]===undefined?!![]:![]:!![]})[_0x3f29('0xa')](function(_0x52ba04){logger[_0x3f29('0xb')](_0x3f29('0x15'),_0x33c523);logger['debug'](_0x3f29('0x15'),_0x33c523,JSON[_0x3f29('0x10')](_0x52ba04));_0x7a7bb2(_0x52ba04);})[_0x3f29('0x14')](function(_0x16b22b){logger[_0x3f29('0x11')](_0x3f29('0x15'),_0x16b22b[_0x3f29('0x12')],_0x33c523);_0x411182(_0x3b73e0['error'](0x1f4,_0x16b22b[_0x3f29('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x5ec915){var _0x273745=this;return new Promise(function(_0x463cf7,_0x15b435){return db['FaxQueueReport'][_0x3f29('0x1a')](_0x5ec915[_0x3f29('0x17')],{'raw':_0x5ec915[_0x3f29('0x18')]?_0x5ec915[_0x3f29('0x18')][_0x3f29('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec915[_0x3f29('0x18')]?_0x5ec915['options']['where']||null:null,'attributes':_0x5ec915[_0x3f29('0x18')]?_0x5ec915[_0x3f29('0x18')][_0x3f29('0x1b')]||null:null,'limit':_0x5ec915['options']?_0x5ec915['options'][_0x3f29('0x1c')]||null:null})[_0x3f29('0xa')](function(_0x475e8f){logger[_0x3f29('0xb')]('UpdateFaxQueueReport',_0x5ec915);logger[_0x3f29('0xe')]('UpdateFaxQueueReport',_0x5ec915,JSON['stringify'](_0x475e8f));_0x463cf7(_0x475e8f);})[_0x3f29('0x14')](function(_0x25f707){logger[_0x3f29('0x11')]('UpdateFaxQueueReport',_0x25f707[_0x3f29('0x12')],_0x5ec915);_0x15b435(_0x273745[_0x3f29('0x11')](0x1f4,_0x25f707[_0x3f29('0x12')]));});});}; \ No newline at end of file +var _0x0b1b=['request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','update','where','attributes','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x130c00,_0x3a2054){var _0x173ba7=function(_0x4808b){while(--_0x4808b){_0x130c00['push'](_0x130c00['shift']());}};_0x173ba7(++_0x3a2054);}(_0x0b1b,0x105));var _0xb0b1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x0b1b[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xb0b1('0x0'));var util=require('util');var moment=require(_0xb0b1('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0b1('0x2'));var fs=require('fs');var Redis=require(_0xb0b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb0b1('0x4'))(_0xb0b1('0x5'));var config=require('../../config/environment');var jayson=require(_0xb0b1('0x6'));var client=jayson[_0xb0b1('0x7')][_0xb0b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c7838,_0x20bebb,_0x3ea549){return new BPromise(function(_0x393ccb,_0x170533){return client[_0xb0b1('0x9')](_0x3c7838,_0x3ea549)[_0xb0b1('0xa')](function(_0x37eb7c){logger[_0xb0b1('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x20bebb,_0xb0b1('0xc'));logger[_0xb0b1('0xd')](_0xb0b1('0xe'),_0x20bebb,_0xb0b1('0xc'),JSON[_0xb0b1('0xf')](_0x37eb7c));if(_0x37eb7c[_0xb0b1('0x10')]){if(_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x11')]===0x1f4){logger['error'](_0xb0b1('0x12'),_0x20bebb,_0x37eb7c['error'][_0xb0b1('0x13')]);return _0x170533(_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x13')]);}logger[_0xb0b1('0x10')](_0xb0b1('0x12'),_0x20bebb,_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x13')]);return _0x393ccb(_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x13')]);}else{logger[_0xb0b1('0xb')](_0xb0b1('0x12'),_0x20bebb,_0xb0b1('0xc'));_0x393ccb(_0x37eb7c['result'][_0xb0b1('0x13')]);}})[_0xb0b1('0x14')](function(_0x52d76f){logger['error'](_0xb0b1('0x12'),_0x20bebb,_0x52d76f);_0x170533(_0x52d76f);});});}exports[_0xb0b1('0x15')]=function(_0x40ef35){var _0x4dc9c3=this;return new Promise(function(_0x488ca4,_0x6ddf54){return db[_0xb0b1('0x16')]['create'](_0x40ef35[_0xb0b1('0x17')],{'raw':_0x40ef35[_0xb0b1('0x18')]?_0x40ef35['options'][_0xb0b1('0x19')]===undefined?!![]:![]:!![]})[_0xb0b1('0xa')](function(_0xd83ab5){logger[_0xb0b1('0xb')]('CreateFaxQueueReport',_0x40ef35);logger[_0xb0b1('0xd')](_0xb0b1('0x15'),_0x40ef35,JSON[_0xb0b1('0xf')](_0xd83ab5));_0x488ca4(_0xd83ab5);})['catch'](function(_0x2d372e){logger[_0xb0b1('0x10')](_0xb0b1('0x15'),_0x2d372e[_0xb0b1('0x13')],_0x40ef35);_0x6ddf54(_0x4dc9c3[_0xb0b1('0x10')](0x1f4,_0x2d372e['message']));});});};exports[_0xb0b1('0x1a')]=function(_0x228deb){var _0xcb02bd=this;return new Promise(function(_0x31dcf1,_0x31a395){return db[_0xb0b1('0x16')][_0xb0b1('0x1b')](_0x228deb[_0xb0b1('0x17')],{'raw':_0x228deb[_0xb0b1('0x18')]?_0x228deb[_0xb0b1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228deb[_0xb0b1('0x18')]?_0x228deb[_0xb0b1('0x18')][_0xb0b1('0x1c')]||null:null,'attributes':_0x228deb[_0xb0b1('0x18')]?_0x228deb['options'][_0xb0b1('0x1d')]||null:null,'limit':_0x228deb[_0xb0b1('0x18')]?_0x228deb[_0xb0b1('0x18')]['limit']||null:null})[_0xb0b1('0xa')](function(_0x5938fe){logger[_0xb0b1('0xb')]('UpdateFaxQueueReport',_0x228deb);logger[_0xb0b1('0xd')](_0xb0b1('0x1a'),_0x228deb,JSON[_0xb0b1('0xf')](_0x5938fe));_0x31dcf1(_0x5938fe);})[_0xb0b1('0x14')](function(_0x127ddf){logger['error'](_0xb0b1('0x1a'),_0x127ddf[_0xb0b1('0x13')],_0x228deb);_0x31a395(_0xcb02bd[_0xb0b1('0x10')](0x1f4,_0x127ddf[_0xb0b1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 4bad752..3320515 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 _0xebc9=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e2ba0,_0x12bc09){var _0x2d6353=function(_0x4aee7c){while(--_0x4aee7c){_0x5e2ba0['push'](_0x5e2ba0['shift']());}};_0x2d6353(++_0x12bc09);}(_0xebc9,0x76));var _0x9ebc=function(_0x15abac,_0x4b47d8){_0x15abac=_0x15abac-0x0;var _0xfd8a1a=_0xebc9[_0x15abac];return _0xfd8a1a;};'use strict';var multer=require(_0x9ebc('0x0'));var util=require(_0x9ebc('0x1'));var path=require(_0x9ebc('0x2'));var timeout=require(_0x9ebc('0x3'));var express=require(_0x9ebc('0x4'));var router=express[_0x9ebc('0x5')]();var fs_extra=require(_0x9ebc('0x6'));var auth=require(_0x9ebc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9ebc('0x8'));var controller=require('./faxQueueReport.controller');router[_0x9ebc('0x9')]('/',auth[_0x9ebc('0xa')](),controller[_0x9ebc('0xb')]);router[_0x9ebc('0x9')](_0x9ebc('0xc'),auth[_0x9ebc('0xa')](),controller[_0x9ebc('0xd')]);router['get'](_0x9ebc('0xe'),auth[_0x9ebc('0xa')](),controller[_0x9ebc('0xf')]);router[_0x9ebc('0x10')]('/',auth[_0x9ebc('0xa')](),controller['create']);router['put'](_0x9ebc('0xe'),auth['isAuthenticated'](),controller[_0x9ebc('0x11')]);router[_0x9ebc('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9ebc('0x13')]);module[_0x9ebc('0x14')]=router; \ No newline at end of file +var _0xdba8=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','multer'];(function(_0x3a1a18,_0x44c3c1){var _0x373922=function(_0x120e66){while(--_0x120e66){_0x3a1a18['push'](_0x3a1a18['shift']());}};_0x373922(++_0x44c3c1);}(_0xdba8,0x153));var _0x8dba=function(_0xe088d9,_0x2116af){_0xe088d9=_0xe088d9-0x0;var _0x2bce66=_0xdba8[_0xe088d9];return _0x2bce66;};'use strict';var multer=require(_0x8dba('0x0'));var util=require(_0x8dba('0x1'));var path=require(_0x8dba('0x2'));var timeout=require(_0x8dba('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8dba('0x4'));var auth=require(_0x8dba('0x5'));var interaction=require(_0x8dba('0x6'));var config=require(_0x8dba('0x7'));var controller=require('./faxQueueReport.controller');router[_0x8dba('0x8')]('/',auth[_0x8dba('0x9')](),controller[_0x8dba('0xa')]);router[_0x8dba('0x8')](_0x8dba('0xb'),auth[_0x8dba('0x9')](),controller[_0x8dba('0xc')]);router['get'](_0x8dba('0xd'),auth[_0x8dba('0x9')](),controller['show']);router[_0x8dba('0xe')]('/',auth['isAuthenticated'](),controller[_0x8dba('0xf')]);router[_0x8dba('0x10')]('/:id',auth[_0x8dba('0x9')](),controller[_0x8dba('0x11')]);router['delete'](_0x8dba('0xd'),auth[_0x8dba('0x9')](),controller[_0x8dba('0x12')]);module[_0x8dba('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 6e3264c..5779aac 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3a1d6d,_0x344a02){var _0x2cf752=function(_0x1aeb07){while(--_0x1aeb07){_0x3a1d6d['push'](_0x3a1d6d['shift']());}};_0x2cf752(++_0x344a02);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xf3cd[_0x146a97];return _0x259d5c;};'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 +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x234e7e,_0xf82c84){var _0x23319a=function(_0x3e6e30){while(--_0x3e6e30){_0x234e7e['push'](_0x234e7e['shift']());}};_0x23319a(++_0xf82c84);}(_0x008c,0x188));var _0xc008=function(_0x1614c2,_0x1fccfc){_0x1614c2=_0x1614c2-0x0;var _0x182c4c=_0x008c[_0x1614c2];return _0x182c4c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index cb7bbf5..78f3da9 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 _0xda4f=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox'];(function(_0x15b03f,_0x43c225){var _0x4e34d1=function(_0x2b25b9){while(--_0x2b25b9){_0x15b03f['push'](_0x15b03f['shift']());}};_0x4e34d1(++_0x43c225);}(_0xda4f,0xde));var _0xfda4=function(_0x505100,_0xf6d9fb){_0x505100=_0x505100-0x0;var _0x4a5eb3=_0xda4f[_0x505100];return _0x4a5eb3;};'use strict';var emlformat=require(_0xfda4('0x0'));var rimraf=require(_0xfda4('0x1'));var zipdir=require(_0xfda4('0x2'));var jsonpatch=require(_0xfda4('0x3'));var rp=require('request-promise');var moment=require(_0xfda4('0x4'));var BPromise=require(_0xfda4('0x5'));var Mustache=require(_0xfda4('0x6'));var util=require('util');var path=require(_0xfda4('0x7'));var sox=require(_0xfda4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfda4('0x9'));var _=require(_0xfda4('0xa'));var squel=require(_0xfda4('0xb'));var crypto=require(_0xfda4('0xc'));var jsforce=require(_0xfda4('0xd'));var deskjs=require(_0xfda4('0xe'));var toCsv=require(_0xfda4('0xf'));var querystring=require(_0xfda4('0x10'));var Papa=require(_0xfda4('0x11'));var Redis=require(_0xfda4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfda4('0x13'));var as=require(_0xfda4('0x14'));var hardwareService=require(_0xfda4('0x15'));var logger=require('../../config/logger')(_0xfda4('0x16'));var utils=require(_0xfda4('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfda4('0x18'))['db'];function respondWithStatusCode(_0x2ad1ca,_0x4727da){_0x4727da=_0x4727da||0xcc;return function(_0x2258b6){if(_0x2258b6){return _0x2ad1ca['sendStatus'](_0x4727da);}return _0x2ad1ca[_0xfda4('0x19')](_0x4727da)[_0xfda4('0x1a')]();};}function respondWithResult(_0x39cfb1,_0x1a2a64){_0x1a2a64=_0x1a2a64||0xc8;return function(_0xe2771a){if(_0xe2771a){return _0x39cfb1['status'](_0x1a2a64)['json'](_0xe2771a);}};}function respondWithFilteredResult(_0xc1ec60,_0x297077){return function(_0x2724cf){if(_0x2724cf){var _0x5e6c81=typeof _0x297077[_0xfda4('0x1b')]===_0xfda4('0x1c')&&typeof _0x297077['limit']===_0xfda4('0x1c');var _0x24c2ee=_0x2724cf[_0xfda4('0x1d')];var _0x2bf43b=_0x5e6c81?0x0:_0x297077[_0xfda4('0x1b')];var _0x30f1b1=_0x5e6c81?_0x2724cf['count']:_0x297077[_0xfda4('0x1b')]+_0x297077[_0xfda4('0x1e')];var _0x2228eb;if(_0x30f1b1>=_0x24c2ee){_0x30f1b1=_0x24c2ee;_0x2228eb=0xc8;}else{_0x2228eb=0xce;}_0xc1ec60[_0xfda4('0x19')](_0x2228eb);return _0xc1ec60[_0xfda4('0x1f')]('Content-Range',_0x2bf43b+'-'+_0x30f1b1+'/'+_0x24c2ee)[_0xfda4('0x20')](_0x2724cf);}return null;};}function patchUpdates(_0x1e9dae){return function(_0x3f6775){try{jsonpatch[_0xfda4('0x21')](_0x3f6775,_0x1e9dae,!![]);}catch(_0x477da5){return BPromise[_0xfda4('0x22')](_0x477da5);}return _0x3f6775[_0xfda4('0x23')]();};}function saveUpdates(_0x42516d,_0xf31a10){return function(_0x3a7b7e){if(_0x3a7b7e){return _0x3a7b7e[_0xfda4('0x24')](_0x42516d)[_0xfda4('0x25')](function(_0x1171c2){return _0x1171c2;});}return null;};}function removeEntity(_0x2d462f,_0x387819){return function(_0x176f33){if(_0x176f33){return _0x176f33[_0xfda4('0x26')]()[_0xfda4('0x25')](function(){_0x2d462f[_0xfda4('0x19')](0xcc)[_0xfda4('0x1a')]();});}};}function handleEntityNotFound(_0x13f203,_0x1f209f){return function(_0x2d3ee5){if(!_0x2d3ee5){_0x13f203[_0xfda4('0x27')](0x194);}return _0x2d3ee5;};}function handleError(_0x14c3e0,_0x4cd74a){_0x4cd74a=_0x4cd74a||0x1f4;return function(_0x4ff756){logger['error'](_0x4ff756[_0xfda4('0x28')]);if(_0x4ff756[_0xfda4('0x29')]){delete _0x4ff756['name'];}_0x14c3e0[_0xfda4('0x19')](_0x4cd74a)[_0xfda4('0x2a')](_0x4ff756);};}exports[_0xfda4('0x2b')]=function(_0xba92e9,_0x350d8e){var _0x1fd9b4={},_0x63528f={},_0x345c49={'count':0x0,'rows':[]};var _0x5d9f90=_['map'](db[_0xfda4('0x2c')][_0xfda4('0x2d')],function(_0xdf2ee9){return{'name':_0xdf2ee9[_0xfda4('0x2e')],'type':_0xdf2ee9[_0xfda4('0x2f')][_0xfda4('0x30')]};});_0x63528f['model']=_[_0xfda4('0x31')](_0x5d9f90,_0xfda4('0x29'));_0x63528f[_0xfda4('0x32')]=_[_0xfda4('0x33')](_0xba92e9[_0xfda4('0x32')]);_0x63528f[_0xfda4('0x34')]=_[_0xfda4('0x35')](_0x63528f[_0xfda4('0x36')],_0x63528f[_0xfda4('0x32')]);_0x1fd9b4[_0xfda4('0x37')]=_[_0xfda4('0x35')](_0x63528f['model'],qs[_0xfda4('0x38')](_0xba92e9[_0xfda4('0x32')][_0xfda4('0x38')]));_0x1fd9b4['attributes']=_0x1fd9b4[_0xfda4('0x37')]['length']?_0x1fd9b4['attributes']:_0x63528f[_0xfda4('0x36')];if(!_0xba92e9[_0xfda4('0x32')]['hasOwnProperty'](_0xfda4('0x39'))){_0x1fd9b4[_0xfda4('0x1e')]=qs['limit'](_0xba92e9['query'][_0xfda4('0x1e')]);_0x1fd9b4[_0xfda4('0x1b')]=qs[_0xfda4('0x1b')](_0xba92e9['query'][_0xfda4('0x1b')]);}_0x1fd9b4[_0xfda4('0x3a')]=qs['sort'](_0xba92e9['query'][_0xfda4('0x3b')]);_0x1fd9b4['where']=qs[_0xfda4('0x34')](_[_0xfda4('0x3c')](_0xba92e9[_0xfda4('0x32')],_0x63528f[_0xfda4('0x34')]),_0x5d9f90);if(_0xba92e9[_0xfda4('0x32')][_0xfda4('0x3d')]){_0x1fd9b4[_0xfda4('0x3e')]=_[_0xfda4('0x3f')](_0x1fd9b4[_0xfda4('0x3e')],{'$or':_[_0xfda4('0x31')](_0x5d9f90,function(_0x25c5cf){if(_0x25c5cf[_0xfda4('0x2f')]!=='VIRTUAL'){var _0x45834d={};_0x45834d[_0x25c5cf[_0xfda4('0x29')]]={'$like':'%'+_0xba92e9['query'][_0xfda4('0x3d')]+'%'};return _0x45834d;}})});}_0x1fd9b4=_[_0xfda4('0x3f')]({},_0x1fd9b4,_0xba92e9[_0xfda4('0x40')]);var _0x41dccb={'where':_0x1fd9b4['where']};return db['FaxTransferReport']['count'](_0x41dccb)[_0xfda4('0x25')](function(_0x33c1b4){_0x345c49[_0xfda4('0x1d')]=_0x33c1b4;if(_0xba92e9[_0xfda4('0x32')][_0xfda4('0x41')]){_0x1fd9b4['include']=[{'all':!![]}];}return db[_0xfda4('0x2c')][_0xfda4('0x42')](_0x1fd9b4);})[_0xfda4('0x25')](function(_0x3a0333){_0x345c49[_0xfda4('0x43')]=_0x3a0333;return _0x345c49;})[_0xfda4('0x25')](respondWithFilteredResult(_0x350d8e,_0x1fd9b4))[_0xfda4('0x44')](handleError(_0x350d8e,null));};exports[_0xfda4('0x45')]=function(_0x3d063e,_0x3fed9e){var _0x3e7910={'raw':!![],'where':{'id':_0x3d063e['params']['id']}},_0x288366={};_0x288366[_0xfda4('0x36')]=_['keys'](db[_0xfda4('0x2c')][_0xfda4('0x2d')]);_0x288366[_0xfda4('0x32')]=_['keys'](_0x3d063e[_0xfda4('0x32')]);_0x288366['filters']=_[_0xfda4('0x35')](_0x288366[_0xfda4('0x36')],_0x288366['query']);_0x3e7910[_0xfda4('0x37')]=_[_0xfda4('0x35')](_0x288366[_0xfda4('0x36')],qs['fields'](_0x3d063e[_0xfda4('0x32')][_0xfda4('0x38')]));_0x3e7910[_0xfda4('0x37')]=_0x3e7910[_0xfda4('0x37')][_0xfda4('0x46')]?_0x3e7910[_0xfda4('0x37')]:_0x288366['model'];if(_0x3d063e['query']['includeAll']){_0x3e7910[_0xfda4('0x47')]=[{'all':!![]}];}_0x3e7910=_[_0xfda4('0x3f')]({},_0x3e7910,_0x3d063e[_0xfda4('0x40')]);return db[_0xfda4('0x2c')][_0xfda4('0x48')](_0x3e7910)[_0xfda4('0x25')](handleEntityNotFound(_0x3fed9e,null))[_0xfda4('0x25')](respondWithResult(_0x3fed9e,null))['catch'](handleError(_0x3fed9e,null));};exports[_0xfda4('0x49')]=function(_0x3998fb,_0x1703a1){return db['FaxTransferReport'][_0xfda4('0x49')](_0x3998fb[_0xfda4('0x4a')],{})[_0xfda4('0x25')](respondWithResult(_0x1703a1,0xc9))[_0xfda4('0x44')](handleError(_0x1703a1,null));};exports[_0xfda4('0x24')]=function(_0xf04ba0,_0x2d4ebc){if(_0xf04ba0[_0xfda4('0x4a')]['id']){delete _0xf04ba0[_0xfda4('0x4a')]['id'];}return db[_0xfda4('0x2c')][_0xfda4('0x48')]({'where':{'id':_0xf04ba0[_0xfda4('0x4b')]['id']}})[_0xfda4('0x25')](handleEntityNotFound(_0x2d4ebc,null))[_0xfda4('0x25')](saveUpdates(_0xf04ba0[_0xfda4('0x4a')],null))[_0xfda4('0x25')](respondWithResult(_0x2d4ebc,null))[_0xfda4('0x44')](handleError(_0x2d4ebc,null));};exports[_0xfda4('0x26')]=function(_0x1cfdaa,_0xd1c5d2){return db[_0xfda4('0x2c')][_0xfda4('0x48')]({'where':{'id':_0x1cfdaa[_0xfda4('0x4b')]['id']}})['then'](handleEntityNotFound(_0xd1c5d2,null))[_0xfda4('0x25')](removeEntity(_0xd1c5d2,null))[_0xfda4('0x44')](handleError(_0xd1c5d2,null));};exports['describe']=function(_0x13e2db,_0x146975){return db[_0xfda4('0x2c')][_0xfda4('0x4c')]()[_0xfda4('0x25')](respondWithResult(_0x146975,null))[_0xfda4('0x44')](handleError(_0x146975,null));}; \ No newline at end of file +var _0xd1fc=['error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','params','length','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end'];(function(_0x3d713d,_0x26eea2){var _0x269b08=function(_0x5ad4b7){while(--_0x5ad4b7){_0x3d713d['push'](_0x3d713d['shift']());}};_0x269b08(++_0x26eea2);}(_0xd1fc,0x196));var _0xcd1f=function(_0x2b9e64,_0x405a2d){_0x2b9e64=_0x2b9e64-0x0;var _0x452cbe=_0xd1fc[_0x2b9e64];return _0x452cbe;};'use strict';var emlformat=require(_0xcd1f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd1f('0x1'));var jsonpatch=require(_0xcd1f('0x2'));var rp=require(_0xcd1f('0x3'));var moment=require(_0xcd1f('0x4'));var BPromise=require(_0xcd1f('0x5'));var Mustache=require(_0xcd1f('0x6'));var util=require('util');var path=require(_0xcd1f('0x7'));var sox=require('sox');var csv=require(_0xcd1f('0x8'));var ejs=require(_0xcd1f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd1f('0xa'));var squel=require(_0xcd1f('0xb'));var crypto=require(_0xcd1f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcd1f('0xd'));var Papa=require(_0xcd1f('0xe'));var Redis=require(_0xcd1f('0xf'));var authService=require(_0xcd1f('0x10'));var qs=require(_0xcd1f('0x11'));var as=require(_0xcd1f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd1f('0x13'))(_0xcd1f('0x14'));var utils=require(_0xcd1f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcd1f('0x16'));var db=require(_0xcd1f('0x17'))['db'];function respondWithStatusCode(_0x3f73cf,_0x2500a2){_0x2500a2=_0x2500a2||0xcc;return function(_0x2bfccc){if(_0x2bfccc){return _0x3f73cf[_0xcd1f('0x18')](_0x2500a2);}return _0x3f73cf[_0xcd1f('0x19')](_0x2500a2)['end']();};}function respondWithResult(_0x5440a2,_0x49e2f7){_0x49e2f7=_0x49e2f7||0xc8;return function(_0x215ad1){if(_0x215ad1){return _0x5440a2[_0xcd1f('0x19')](_0x49e2f7)[_0xcd1f('0x1a')](_0x215ad1);}};}function respondWithFilteredResult(_0x4d28bc,_0x72246d){return function(_0x3ae67f){if(_0x3ae67f){var _0x4bd120=typeof _0x72246d[_0xcd1f('0x1b')]===_0xcd1f('0x1c')&&typeof _0x72246d[_0xcd1f('0x1d')]===_0xcd1f('0x1c');var _0x487dc3=_0x3ae67f['count'];var _0x172d95=_0x4bd120?0x0:_0x72246d[_0xcd1f('0x1b')];var _0x460675=_0x4bd120?_0x3ae67f[_0xcd1f('0x1e')]:_0x72246d['offset']+_0x72246d[_0xcd1f('0x1d')];var _0x3d39a3;if(_0x460675>=_0x487dc3){_0x460675=_0x487dc3;_0x3d39a3=0xc8;}else{_0x3d39a3=0xce;}_0x4d28bc[_0xcd1f('0x19')](_0x3d39a3);return _0x4d28bc['set']('Content-Range',_0x172d95+'-'+_0x460675+'/'+_0x487dc3)[_0xcd1f('0x1a')](_0x3ae67f);}return null;};}function patchUpdates(_0x58a07a){return function(_0x185d7d){try{jsonpatch[_0xcd1f('0x1f')](_0x185d7d,_0x58a07a,!![]);}catch(_0x2595d6){return BPromise[_0xcd1f('0x20')](_0x2595d6);}return _0x185d7d[_0xcd1f('0x21')]();};}function saveUpdates(_0x21429e,_0x17bd87){return function(_0x1df970){if(_0x1df970){return _0x1df970[_0xcd1f('0x22')](_0x21429e)[_0xcd1f('0x23')](function(_0x1506e3){return _0x1506e3;});}return null;};}function removeEntity(_0x5227a6,_0x428d32){return function(_0x33b8a8){if(_0x33b8a8){return _0x33b8a8[_0xcd1f('0x24')]()[_0xcd1f('0x23')](function(){_0x5227a6[_0xcd1f('0x19')](0xcc)[_0xcd1f('0x25')]();});}};}function handleEntityNotFound(_0x2e7921,_0x2955ad){return function(_0x18a041){if(!_0x18a041){_0x2e7921[_0xcd1f('0x18')](0x194);}return _0x18a041;};}function handleError(_0xa21a4,_0x3612b6){_0x3612b6=_0x3612b6||0x1f4;return function(_0x369abd){logger[_0xcd1f('0x26')](_0x369abd['stack']);if(_0x369abd['name']){delete _0x369abd[_0xcd1f('0x27')];}_0xa21a4['status'](_0x3612b6)[_0xcd1f('0x28')](_0x369abd);};}exports[_0xcd1f('0x29')]=function(_0x2d1111,_0x3264c4){var _0x54d63e={},_0x5c95a8={},_0x5b6280={'count':0x0,'rows':[]};var _0x356096=_[_0xcd1f('0x2a')](db[_0xcd1f('0x2b')][_0xcd1f('0x2c')],function(_0x234fd4){return{'name':_0x234fd4[_0xcd1f('0x2d')],'type':_0x234fd4[_0xcd1f('0x2e')]['key']};});_0x5c95a8[_0xcd1f('0x2f')]=_['map'](_0x356096,'name');_0x5c95a8[_0xcd1f('0x30')]=_[_0xcd1f('0x31')](_0x2d1111[_0xcd1f('0x30')]);_0x5c95a8[_0xcd1f('0x32')]=_[_0xcd1f('0x33')](_0x5c95a8['model'],_0x5c95a8[_0xcd1f('0x30')]);_0x54d63e[_0xcd1f('0x34')]=_[_0xcd1f('0x33')](_0x5c95a8[_0xcd1f('0x2f')],qs[_0xcd1f('0x35')](_0x2d1111['query']['fields']));_0x54d63e[_0xcd1f('0x34')]=_0x54d63e[_0xcd1f('0x34')]['length']?_0x54d63e[_0xcd1f('0x34')]:_0x5c95a8['model'];if(!_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x36')](_0xcd1f('0x37'))){_0x54d63e[_0xcd1f('0x1d')]=qs[_0xcd1f('0x1d')](_0x2d1111[_0xcd1f('0x30')]['limit']);_0x54d63e[_0xcd1f('0x1b')]=qs['offset'](_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x1b')]);}_0x54d63e[_0xcd1f('0x38')]=qs['sort'](_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x39')]);_0x54d63e['where']=qs[_0xcd1f('0x32')](_[_0xcd1f('0x3a')](_0x2d1111[_0xcd1f('0x30')],_0x5c95a8['filters']),_0x356096);if(_0x2d1111['query'][_0xcd1f('0x3b')]){_0x54d63e[_0xcd1f('0x3c')]=_[_0xcd1f('0x3d')](_0x54d63e[_0xcd1f('0x3c')],{'$or':_[_0xcd1f('0x2a')](_0x356096,function(_0x49caed){if(_0x49caed['type']!==_0xcd1f('0x3e')){var _0x42a61f={};_0x42a61f[_0x49caed[_0xcd1f('0x27')]]={'$like':'%'+_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x3b')]+'%'};return _0x42a61f;}})});}_0x54d63e=_[_0xcd1f('0x3d')]({},_0x54d63e,_0x2d1111[_0xcd1f('0x3f')]);var _0x4c6b4e={'where':_0x54d63e[_0xcd1f('0x3c')]};return db['FaxTransferReport'][_0xcd1f('0x1e')](_0x4c6b4e)[_0xcd1f('0x23')](function(_0x43a3b0){_0x5b6280[_0xcd1f('0x1e')]=_0x43a3b0;if(_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x40')]){_0x54d63e['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x54d63e);})[_0xcd1f('0x23')](function(_0x260e22){_0x5b6280[_0xcd1f('0x41')]=_0x260e22;return _0x5b6280;})[_0xcd1f('0x23')](respondWithFilteredResult(_0x3264c4,_0x54d63e))[_0xcd1f('0x42')](handleError(_0x3264c4,null));};exports['show']=function(_0x2d7b2d,_0x270de6){var _0x2a391c={'raw':!![],'where':{'id':_0x2d7b2d[_0xcd1f('0x43')]['id']}},_0x353008={};_0x353008['model']=_[_0xcd1f('0x31')](db[_0xcd1f('0x2b')][_0xcd1f('0x2c')]);_0x353008[_0xcd1f('0x30')]=_[_0xcd1f('0x31')](_0x2d7b2d['query']);_0x353008[_0xcd1f('0x32')]=_[_0xcd1f('0x33')](_0x353008[_0xcd1f('0x2f')],_0x353008[_0xcd1f('0x30')]);_0x2a391c[_0xcd1f('0x34')]=_[_0xcd1f('0x33')](_0x353008[_0xcd1f('0x2f')],qs[_0xcd1f('0x35')](_0x2d7b2d[_0xcd1f('0x30')][_0xcd1f('0x35')]));_0x2a391c[_0xcd1f('0x34')]=_0x2a391c[_0xcd1f('0x34')][_0xcd1f('0x44')]?_0x2a391c['attributes']:_0x353008[_0xcd1f('0x2f')];if(_0x2d7b2d[_0xcd1f('0x30')]['includeAll']){_0x2a391c[_0xcd1f('0x45')]=[{'all':!![]}];}_0x2a391c=_[_0xcd1f('0x3d')]({},_0x2a391c,_0x2d7b2d['options']);return db[_0xcd1f('0x2b')][_0xcd1f('0x46')](_0x2a391c)[_0xcd1f('0x23')](handleEntityNotFound(_0x270de6,null))[_0xcd1f('0x23')](respondWithResult(_0x270de6,null))[_0xcd1f('0x42')](handleError(_0x270de6,null));};exports['create']=function(_0x2a4ef8,_0x155bb3){return db[_0xcd1f('0x2b')][_0xcd1f('0x47')](_0x2a4ef8[_0xcd1f('0x48')],{})[_0xcd1f('0x23')](respondWithResult(_0x155bb3,0xc9))['catch'](handleError(_0x155bb3,null));};exports[_0xcd1f('0x22')]=function(_0xa4855f,_0x4118b1){if(_0xa4855f[_0xcd1f('0x48')]['id']){delete _0xa4855f[_0xcd1f('0x48')]['id'];}return db['FaxTransferReport'][_0xcd1f('0x46')]({'where':{'id':_0xa4855f['params']['id']}})[_0xcd1f('0x23')](handleEntityNotFound(_0x4118b1,null))[_0xcd1f('0x23')](saveUpdates(_0xa4855f[_0xcd1f('0x48')],null))['then'](respondWithResult(_0x4118b1,null))[_0xcd1f('0x42')](handleError(_0x4118b1,null));};exports[_0xcd1f('0x24')]=function(_0x1ded41,_0x1eb41c){return db[_0xcd1f('0x2b')][_0xcd1f('0x46')]({'where':{'id':_0x1ded41[_0xcd1f('0x43')]['id']}})[_0xcd1f('0x23')](handleEntityNotFound(_0x1eb41c,null))[_0xcd1f('0x23')](removeEntity(_0x1eb41c,null))[_0xcd1f('0x42')](handleError(_0x1eb41c,null));};exports[_0xcd1f('0x49')]=function(_0x48c606,_0xa0fe33){return db[_0xcd1f('0x2b')][_0xcd1f('0x49')]()['then'](respondWithResult(_0xa0fe33,null))[_0xcd1f('0x42')](handleError(_0xa0fe33,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 1dc46f9..dbec51f 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 _0x8ba9=['./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x8ba9,0x18c));var _0x98ba=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8ba9[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x98ba('0x0'));var util=require(_0x98ba('0x1'));var logger=require(_0x98ba('0x2'))(_0x98ba('0x3'));var moment=require(_0x98ba('0x4'));var BPromise=require(_0x98ba('0x5'));var rp=require(_0x98ba('0x6'));var fs=require('fs');var path=require(_0x98ba('0x7'));var rimraf=require(_0x98ba('0x8'));var config=require(_0x98ba('0x9'));var attributes=require(_0x98ba('0xa'));module['exports']=function(_0x50afa5,_0x33b94b){return _0x50afa5[_0x98ba('0xb')](_0x98ba('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x98ba('0xd'),'fields':[_0x98ba('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7a1=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','define'];(function(_0x457e12,_0x3ba321){var _0xa4de6c=function(_0x47c78d){while(--_0x47c78d){_0x457e12['push'](_0x457e12['shift']());}};_0xa4de6c(++_0x3ba321);}(_0xf7a1,0xed));var _0x1f7a=function(_0x21d0a5,_0x242625){_0x21d0a5=_0x21d0a5-0x0;var _0x3619ee=_0xf7a1[_0x21d0a5];return _0x3619ee;};'use strict';var _=require(_0x1f7a('0x0'));var util=require(_0x1f7a('0x1'));var logger=require(_0x1f7a('0x2'))(_0x1f7a('0x3'));var moment=require(_0x1f7a('0x4'));var BPromise=require(_0x1f7a('0x5'));var rp=require(_0x1f7a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f7a('0x7'));var config=require('../../config/environment');var attributes=require(_0x1f7a('0x8'));module['exports']=function(_0x4e22a8,_0x44bfb0){return _0x4e22a8[_0x1f7a('0x9')](_0x1f7a('0xa'),attributes,{'tableName':_0x1f7a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1f7a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6c970c8..d1118d2 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 _0xd075=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x519960,_0x227071){var _0x1801be=function(_0x59a109){while(--_0x59a109){_0x519960['push'](_0x519960['shift']());}};_0x1801be(++_0x227071);}(_0xd075,0x195));var _0x5d07=function(_0x11603a,_0x1a5e14){_0x11603a=_0x11603a-0x0;var _0x35847e=_0xd075[_0x11603a];return _0x35847e;};'use strict';var _=require('lodash');var util=require(_0x5d07('0x0'));var moment=require(_0x5d07('0x1'));var BPromise=require(_0x5d07('0x2'));var rs=require(_0x5d07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d07('0x4'))['db'];var utils=require(_0x5d07('0x5'));var logger=require('../../config/logger')(_0x5d07('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d07('0x7')][_0x5d07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42e7d1,_0x4e03b5,_0x434e89){return new BPromise(function(_0xe45ec,_0x1473fe){return client['request'](_0x42e7d1,_0x434e89)['then'](function(_0xaa730d){logger['info'](_0x5d07('0x9'),_0x4e03b5,_0x5d07('0xa'));logger['debug'](_0x5d07('0xb'),_0x4e03b5,'request\x20sent',JSON[_0x5d07('0xc')](_0xaa730d));if(_0xaa730d[_0x5d07('0xd')]){if(_0xaa730d[_0x5d07('0xd')][_0x5d07('0xe')]===0x1f4){logger[_0x5d07('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x4e03b5,_0xaa730d['error'][_0x5d07('0xf')]);return _0x1473fe(_0xaa730d[_0x5d07('0xd')][_0x5d07('0xf')]);}logger[_0x5d07('0xd')](_0x5d07('0x9'),_0x4e03b5,_0xaa730d['error'][_0x5d07('0xf')]);return _0xe45ec(_0xaa730d[_0x5d07('0xd')][_0x5d07('0xf')]);}else{logger[_0x5d07('0x10')](_0x5d07('0x9'),_0x4e03b5,_0x5d07('0xa'));_0xe45ec(_0xaa730d[_0x5d07('0x11')]['message']);}})['catch'](function(_0x837104){logger[_0x5d07('0xd')](_0x5d07('0x9'),_0x4e03b5,_0x837104);_0x1473fe(_0x837104);});});} \ No newline at end of file +var _0x9be4=['request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ba5cb,_0x4429ec){var _0x22cd08=function(_0x4d9ea8){while(--_0x4d9ea8){_0x4ba5cb['push'](_0x4ba5cb['shift']());}};_0x22cd08(++_0x4429ec);}(_0x9be4,0x165));var _0x49be=function(_0x1dbc40,_0x46b1a7){_0x1dbc40=_0x1dbc40-0x0;var _0x1b995b=_0x9be4[_0x1dbc40];return _0x1b995b;};'use strict';var _=require(_0x49be('0x0'));var util=require(_0x49be('0x1'));var moment=require(_0x49be('0x2'));var BPromise=require(_0x49be('0x3'));var rs=require(_0x49be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49be('0x5'))['db'];var utils=require(_0x49be('0x6'));var logger=require(_0x49be('0x7'))(_0x49be('0x8'));var config=require(_0x49be('0x9'));var jayson=require(_0x49be('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f2366,_0x50d9e7,_0x37fb24){return new BPromise(function(_0xb0de42,_0xdd17e9){return client[_0x49be('0xb')](_0x2f2366,_0x37fb24)[_0x49be('0xc')](function(_0x115d77){logger['info'](_0x49be('0xd'),_0x50d9e7,_0x49be('0xe'));logger[_0x49be('0xf')](_0x49be('0x10'),_0x50d9e7,_0x49be('0xe'),JSON[_0x49be('0x11')](_0x115d77));if(_0x115d77[_0x49be('0x12')]){if(_0x115d77[_0x49be('0x12')]['code']===0x1f4){logger[_0x49be('0x12')](_0x49be('0xd'),_0x50d9e7,_0x115d77[_0x49be('0x12')][_0x49be('0x13')]);return _0xdd17e9(_0x115d77[_0x49be('0x12')]['message']);}logger['error'](_0x49be('0xd'),_0x50d9e7,_0x115d77[_0x49be('0x12')][_0x49be('0x13')]);return _0xb0de42(_0x115d77[_0x49be('0x12')][_0x49be('0x13')]);}else{logger[_0x49be('0x14')](_0x49be('0xd'),_0x50d9e7,_0x49be('0xe'));_0xb0de42(_0x115d77[_0x49be('0x15')]['message']);}})[_0x49be('0x16')](function(_0x47ec12){logger[_0x49be('0x12')](_0x49be('0xd'),_0x50d9e7,_0x47ec12);_0xdd17e9(_0x47ec12);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d1984a1..69c43d3 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 _0x07a5=['/:id','show','post','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x07a5,0x1aa));var _0x507a=function(_0x1a63b6,_0x45b328){_0x1a63b6=_0x1a63b6-0x0;var _0xb75519=_0x07a5[_0x1a63b6];return _0xb75519;};'use strict';var multer=require(_0x507a('0x0'));var util=require(_0x507a('0x1'));var path=require(_0x507a('0x2'));var timeout=require('connect-timeout');var express=require(_0x507a('0x3'));var router=express[_0x507a('0x4')]();var fs_extra=require(_0x507a('0x5'));var auth=require(_0x507a('0x6'));var interaction=require(_0x507a('0x7'));var config=require(_0x507a('0x8'));var controller=require('./faxTransferReport.controller');router[_0x507a('0x9')]('/',auth[_0x507a('0xa')](),controller[_0x507a('0xb')]);router['get'](_0x507a('0xc'),auth[_0x507a('0xa')](),controller[_0x507a('0xd')]);router[_0x507a('0x9')](_0x507a('0xe'),auth[_0x507a('0xa')](),controller[_0x507a('0xf')]);router[_0x507a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x507a('0x11')](_0x507a('0xe'),auth[_0x507a('0xa')](),controller[_0x507a('0x12')]);router['delete'](_0x507a('0xe'),auth[_0x507a('0xa')](),controller[_0x507a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7f68=['Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','connect-timeout','express'];(function(_0x5ecfa8,_0x231ca0){var _0x138228=function(_0x23c076){while(--_0x23c076){_0x5ecfa8['push'](_0x5ecfa8['shift']());}};_0x138228(++_0x231ca0);}(_0x7f68,0x1c6));var _0x87f6=function(_0x384070,_0x56cd7f){_0x384070=_0x384070-0x0;var _0x2fe1bb=_0x7f68[_0x384070];return _0x2fe1bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x87f6('0x0'));var express=require(_0x87f6('0x1'));var router=express[_0x87f6('0x2')]();var fs_extra=require(_0x87f6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x87f6('0x4'));var config=require(_0x87f6('0x5'));var controller=require(_0x87f6('0x6'));router['get']('/',auth[_0x87f6('0x7')](),controller['index']);router[_0x87f6('0x8')](_0x87f6('0x9'),auth['isAuthenticated'](),controller[_0x87f6('0xa')]);router['get'](_0x87f6('0xb'),auth[_0x87f6('0x7')](),controller[_0x87f6('0xc')]);router['post']('/',auth[_0x87f6('0x7')](),controller[_0x87f6('0xd')]);router[_0x87f6('0xe')](_0x87f6('0xb'),auth[_0x87f6('0x7')](),controller[_0x87f6('0xf')]);router[_0x87f6('0x10')](_0x87f6('0xb'),auth[_0x87f6('0x7')](),controller[_0x87f6('0x11')]);module[_0x87f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 12e59b1..0dc7e50 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 _0x1655=['get','/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index'];(function(_0x5484a5,_0x42d641){var _0x8af9ae=function(_0x3d29de){while(--_0x3d29de){_0x5484a5['push'](_0x5484a5['shift']());}};_0x8af9ae(++_0x42d641);}(_0x1655,0xbe));var _0x5165=function(_0x284283,_0x397971){_0x284283=_0x284283-0x0;var _0x49caba=_0x1655[_0x284283];return _0x49caba;};'use strict';var multer=require(_0x5165('0x0'));var util=require(_0x5165('0x1'));var path=require('path');var timeout=require(_0x5165('0x2'));var express=require('express');var router=express[_0x5165('0x3')]();var fs_extra=require(_0x5165('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5165('0x5'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x5165('0x6')](),controller[_0x5165('0x7')]);router[_0x5165('0x8')](_0x5165('0x9'),auth[_0x5165('0x6')](),controller[_0x5165('0xa')]);router[_0x5165('0x8')]('/:id/configurations',auth[_0x5165('0x6')](),controller[_0x5165('0xb')]);router[_0x5165('0x8')]('/:id/fields',auth[_0x5165('0x6')](),controller[_0x5165('0xc')]);router[_0x5165('0xd')]('/',auth[_0x5165('0x6')](),controller['create']);router[_0x5165('0xd')](_0x5165('0xe'),auth['isAuthenticated'](),controller[_0x5165('0xf')]);router[_0x5165('0x10')](_0x5165('0x9'),auth[_0x5165('0x6')](),controller[_0x5165('0x11')]);router['delete'](_0x5165('0x9'),auth[_0x5165('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x05bb=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','create','post','addConfiguration','put'];(function(_0x10a546,_0x5ea132){var _0x30e897=function(_0x54964b){while(--_0x54964b){_0x10a546['push'](_0x10a546['shift']());}};_0x30e897(++_0x5ea132);}(_0x05bb,0x1a4));var _0xb05b=function(_0xf70695,_0x4932a6){_0xf70695=_0xf70695-0x0;var _0x57a642=_0x05bb[_0xf70695];return _0x57a642;};'use strict';var multer=require(_0xb05b('0x0'));var util=require(_0xb05b('0x1'));var path=require(_0xb05b('0x2'));var timeout=require(_0xb05b('0x3'));var express=require(_0xb05b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb05b('0x5'));var interaction=require(_0xb05b('0x6'));var config=require(_0xb05b('0x7'));var controller=require(_0xb05b('0x8'));router[_0xb05b('0x9')]('/',auth[_0xb05b('0xa')](),controller[_0xb05b('0xb')]);router['get'](_0xb05b('0xc'),auth[_0xb05b('0xa')](),controller[_0xb05b('0xd')]);router[_0xb05b('0x9')](_0xb05b('0xe'),auth[_0xb05b('0xa')](),controller['getConfigurations']);router[_0xb05b('0x9')]('/:id/fields',auth[_0xb05b('0xa')](),controller[_0xb05b('0xf')]);router['post']('/',auth[_0xb05b('0xa')](),controller[_0xb05b('0x10')]);router[_0xb05b('0x11')](_0xb05b('0xe'),auth[_0xb05b('0xa')](),controller[_0xb05b('0x12')]);router[_0xb05b('0x13')]('/:id',auth[_0xb05b('0xa')](),controller['update']);router[_0xb05b('0x14')](_0xb05b('0xc'),auth[_0xb05b('0xa')](),controller[_0xb05b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index aea35c1..4cba6da 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 _0x7e99=['newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x50f217,_0x4509c4){var _0x3037c0=function(_0xf95392){while(--_0xf95392){_0x50f217['push'](_0x50f217['shift']());}};_0x3037c0(++_0x4509c4);}(_0x7e99,0xc1));var _0x97e9=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x7e99[_0xabfec4];return _0x7bafa2;};'use strict';var Sequelize=require(_0x97e9('0x0'));module[_0x97e9('0x1')]={'name':{'type':Sequelize[_0x97e9('0x2')]},'description':{'type':Sequelize[_0x97e9('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x97e9('0x2')]},'authType':{'type':Sequelize[_0x97e9('0x3')](_0x97e9('0x4')),'defaultValue':_0x97e9('0x4')},'password':{'type':Sequelize[_0x97e9('0x2')]},'consumerKey':{'type':Sequelize[_0x97e9('0x2')]},'consumerSecret':{'type':Sequelize[_0x97e9('0x2')]},'token':{'type':Sequelize[_0x97e9('0x2')]},'tokenSecret':{'type':Sequelize[_0x97e9('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x97e9('0x3')]('integrationTab',_0x97e9('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xef85=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x44b517,_0x5d0ed5){var _0x82d9b5=function(_0x4fb0fc){while(--_0x4fb0fc){_0x44b517['push'](_0x44b517['shift']());}};_0x82d9b5(++_0x5d0ed5);}(_0xef85,0xe7));var _0x5ef8=function(_0x55f5ca,_0x29da4b){_0x55f5ca=_0x55f5ca-0x0;var _0x1dfe24=_0xef85[_0x55f5ca];return _0x1dfe24;};'use strict';var Sequelize=require(_0x5ef8('0x0'));module[_0x5ef8('0x1')]={'name':{'type':Sequelize[_0x5ef8('0x2')]},'description':{'type':Sequelize[_0x5ef8('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5ef8('0x2')]},'authType':{'type':Sequelize[_0x5ef8('0x3')](_0x5ef8('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x5ef8('0x2')]},'consumerKey':{'type':Sequelize[_0x5ef8('0x2')]},'consumerSecret':{'type':Sequelize[_0x5ef8('0x2')]},'token':{'type':Sequelize[_0x5ef8('0x2')]},'tokenSecret':{'type':Sequelize[_0x5ef8('0x2')]},'serverUrl':{'type':Sequelize[_0x5ef8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5ef8('0x3')](_0x5ef8('0x5'),'newTab'),'defaultValue':_0x5ef8('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9b311bd..dcd9db8 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 _0xf25f=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','DeskAccount','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','body','catch','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','DeskConfiguration','create','DeskField','Descriptions','getFields','priority','remoteUri','username','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','map','type','key','keys','query','filters','intersection'];(function(_0x4cdc6b,_0x4b50f1){var _0x24b0d2=function(_0x532bc3){while(--_0x532bc3){_0x4cdc6b['push'](_0x4cdc6b['shift']());}};_0x24b0d2(++_0x4b50f1);}(_0xf25f,0xba));var _0xff25=function(_0x372685,_0x48686d){_0x372685=_0x372685-0x0;var _0x2bd9a6=_0xf25f[_0x372685];return _0x2bd9a6;};'use strict';var emlformat=require(_0xff25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff25('0x1'));var jsonpatch=require(_0xff25('0x2'));var rp=require(_0xff25('0x3'));var moment=require('moment');var BPromise=require(_0xff25('0x4'));var Mustache=require(_0xff25('0x5'));var util=require(_0xff25('0x6'));var path=require('path');var sox=require(_0xff25('0x7'));var csv=require('to-csv');var ejs=require(_0xff25('0x8'));var fs=require('fs');var fs_extra=require(_0xff25('0x9'));var _=require(_0xff25('0xa'));var squel=require(_0xff25('0xb'));var crypto=require(_0xff25('0xc'));var jsforce=require(_0xff25('0xd'));var deskjs=require(_0xff25('0xe'));var toCsv=require(_0xff25('0xf'));var querystring=require(_0xff25('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xff25('0x11'));var qs=require(_0xff25('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff25('0x13'));var logger=require(_0xff25('0x14'))(_0xff25('0x15'));var utils=require(_0xff25('0x16'));var config=require(_0xff25('0x17'));var licenseUtil=require(_0xff25('0x18'));var db=require(_0xff25('0x19'))['db'];var integrations=require(_0xff25('0x1a'));function respondWithStatusCode(_0x1c3b5f,_0x401693){_0x401693=_0x401693||0xcc;return function(_0x2e197b){if(_0x2e197b){return _0x1c3b5f[_0xff25('0x1b')](_0x401693);}return _0x1c3b5f[_0xff25('0x1c')](_0x401693)[_0xff25('0x1d')]();};}function respondWithResult(_0x215e5c,_0x987893){_0x987893=_0x987893||0xc8;return function(_0x1cfbe2){if(_0x1cfbe2){return _0x215e5c[_0xff25('0x1c')](_0x987893)[_0xff25('0x1e')](_0x1cfbe2);}};}function respondWithFilteredResult(_0x26a4a6,_0x47c9e0){return function(_0x4d7f1d){if(_0x4d7f1d){var _0x4b8dcc=typeof _0x47c9e0[_0xff25('0x1f')]===_0xff25('0x20')&&typeof _0x47c9e0[_0xff25('0x21')]===_0xff25('0x20');var _0x582103=_0x4d7f1d[_0xff25('0x22')];var _0x5ce083=_0x4b8dcc?0x0:_0x47c9e0['offset'];var _0x45214c=_0x4b8dcc?_0x4d7f1d['count']:_0x47c9e0[_0xff25('0x1f')]+_0x47c9e0[_0xff25('0x21')];var _0x676884;if(_0x45214c>=_0x582103){_0x45214c=_0x582103;_0x676884=0xc8;}else{_0x676884=0xce;}_0x26a4a6[_0xff25('0x1c')](_0x676884);return _0x26a4a6[_0xff25('0x23')]('Content-Range',_0x5ce083+'-'+_0x45214c+'/'+_0x582103)[_0xff25('0x1e')](_0x4d7f1d);}return null;};}function patchUpdates(_0x544eb4){return function(_0xdfaeb0){try{jsonpatch['apply'](_0xdfaeb0,_0x544eb4,!![]);}catch(_0x452fe8){return BPromise[_0xff25('0x24')](_0x452fe8);}return _0xdfaeb0[_0xff25('0x25')]();};}function saveUpdates(_0x4caf7c,_0x3d9ca6){return function(_0x39bdf4){if(_0x39bdf4){return _0x39bdf4['update'](_0x4caf7c)[_0xff25('0x26')](function(_0x59450c){return _0x59450c;});}return null;};}function removeEntity(_0x1c5745,_0x427a70){return function(_0x38472f){if(_0x38472f){return _0x38472f[_0xff25('0x27')]()['then'](function(){_0x1c5745['status'](0xcc)[_0xff25('0x1d')]();});}};}function handleEntityNotFound(_0x5db414,_0x1be002){return function(_0x505752){if(!_0x505752){_0x5db414[_0xff25('0x1b')](0x194);}return _0x505752;};}function handleError(_0x4bcc3a,_0xa1d9c){_0xa1d9c=_0xa1d9c||0x1f4;return function(_0x543b46){logger[_0xff25('0x28')](_0x543b46[_0xff25('0x29')]);if(_0x543b46[_0xff25('0x2a')]){delete _0x543b46[_0xff25('0x2a')];}_0x4bcc3a['status'](_0xa1d9c)['send'](_0x543b46);};}exports['index']=function(_0xa76350,_0x507a1f){var _0x22e86a={},_0x54fa16={},_0x24c149={'count':0x0,'rows':[]};var _0x3ab6f3=_[_0xff25('0x2b')](db['DeskAccount']['rawAttributes'],function(_0x35c370){return{'name':_0x35c370['fieldName'],'type':_0x35c370[_0xff25('0x2c')][_0xff25('0x2d')]};});_0x54fa16['model']=_[_0xff25('0x2b')](_0x3ab6f3,_0xff25('0x2a'));_0x54fa16['query']=_[_0xff25('0x2e')](_0xa76350[_0xff25('0x2f')]);_0x54fa16[_0xff25('0x30')]=_[_0xff25('0x31')](_0x54fa16[_0xff25('0x32')],_0x54fa16[_0xff25('0x2f')]);_0x22e86a[_0xff25('0x33')]=_[_0xff25('0x31')](_0x54fa16[_0xff25('0x32')],qs[_0xff25('0x34')](_0xa76350['query'][_0xff25('0x34')]));_0x22e86a['attributes']=_0x22e86a[_0xff25('0x33')][_0xff25('0x35')]?_0x22e86a['attributes']:_0x54fa16[_0xff25('0x32')];if(!_0xa76350['query'][_0xff25('0x36')](_0xff25('0x37'))){_0x22e86a[_0xff25('0x21')]=qs[_0xff25('0x21')](_0xa76350[_0xff25('0x2f')][_0xff25('0x21')]);_0x22e86a[_0xff25('0x1f')]=qs[_0xff25('0x1f')](_0xa76350[_0xff25('0x2f')]['offset']);}_0x22e86a['order']=qs[_0xff25('0x38')](_0xa76350['query'][_0xff25('0x38')]);_0x22e86a[_0xff25('0x39')]=qs[_0xff25('0x30')](_[_0xff25('0x3a')](_0xa76350[_0xff25('0x2f')],_0x54fa16['filters']),_0x3ab6f3);if(_0xa76350[_0xff25('0x2f')]['filter']){_0x22e86a[_0xff25('0x39')]=_['merge'](_0x22e86a[_0xff25('0x39')],{'$or':_[_0xff25('0x2b')](_0x3ab6f3,function(_0x4c46a0){if(_0x4c46a0[_0xff25('0x2c')]!==_0xff25('0x3b')){var _0x895f29={};_0x895f29[_0x4c46a0[_0xff25('0x2a')]]={'$like':'%'+_0xa76350[_0xff25('0x2f')][_0xff25('0x3c')]+'%'};return _0x895f29;}})});}_0x22e86a=_['merge']({},_0x22e86a,_0xa76350[_0xff25('0x3d')]);var _0x304643={'where':_0x22e86a[_0xff25('0x39')]};return db[_0xff25('0x3e')]['count'](_0x304643)[_0xff25('0x26')](function(_0x25d87c){_0x24c149[_0xff25('0x22')]=_0x25d87c;if(_0xa76350[_0xff25('0x2f')][_0xff25('0x3f')]){_0x22e86a[_0xff25('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0xff25('0x41')](_0x22e86a);})[_0xff25('0x26')](function(_0x8ab69f){_0x24c149[_0xff25('0x42')]=_0x8ab69f;return _0x24c149;})[_0xff25('0x26')](respondWithFilteredResult(_0x507a1f,_0x22e86a))['catch'](handleError(_0x507a1f,null));};exports[_0xff25('0x43')]=function(_0x4b52b1,_0x29ffca){var _0x4f1cfd={'raw':![],'where':{'id':_0x4b52b1[_0xff25('0x44')]['id']}},_0xc7c7e={};_0xc7c7e[_0xff25('0x32')]=_['keys'](db['DeskAccount'][_0xff25('0x45')]);_0xc7c7e[_0xff25('0x2f')]=_['keys'](_0x4b52b1[_0xff25('0x2f')]);_0xc7c7e['filters']=_['intersection'](_0xc7c7e['model'],_0xc7c7e[_0xff25('0x2f')]);_0x4f1cfd[_0xff25('0x33')]=_[_0xff25('0x31')](_0xc7c7e[_0xff25('0x32')],qs[_0xff25('0x34')](_0x4b52b1[_0xff25('0x2f')][_0xff25('0x34')]));_0x4f1cfd['attributes']=_0x4f1cfd['attributes'][_0xff25('0x35')]?_0x4f1cfd['attributes']:_0xc7c7e[_0xff25('0x32')];if(_0x4b52b1[_0xff25('0x2f')][_0xff25('0x3f')]){_0x4f1cfd['include']=[{'all':!![]}];}_0x4f1cfd=_[_0xff25('0x46')]({},_0x4f1cfd,_0x4b52b1[_0xff25('0x3d')]);return db[_0xff25('0x3e')][_0xff25('0x47')](_0x4f1cfd)[_0xff25('0x26')](handleEntityNotFound(_0x29ffca,null))[_0xff25('0x26')](respondWithResult(_0x29ffca,null))['catch'](handleError(_0x29ffca,null));};exports['create']=function(_0x5a0b30,_0x45e938){return db[_0xff25('0x3e')]['create'](_0x5a0b30[_0xff25('0x48')],{})[_0xff25('0x26')](respondWithResult(_0x45e938,0xc9))[_0xff25('0x49')](handleError(_0x45e938,null));};exports['update']=function(_0x23e547,_0x589d25){if(_0x23e547[_0xff25('0x48')]['id']){delete _0x23e547[_0xff25('0x48')]['id'];}return db[_0xff25('0x3e')][_0xff25('0x47')]({'where':{'id':_0x23e547[_0xff25('0x44')]['id']}})[_0xff25('0x26')](handleEntityNotFound(_0x589d25,null))[_0xff25('0x26')](saveUpdates(_0x23e547['body'],null))[_0xff25('0x26')](respondWithResult(_0x589d25,null))['catch'](handleError(_0x589d25,null));};exports[_0xff25('0x27')]=function(_0x2be8c8,_0x1ec899){return db['DeskAccount']['find']({'where':{'id':_0x2be8c8[_0xff25('0x44')]['id']}})[_0xff25('0x26')](handleEntityNotFound(_0x1ec899,null))['then'](removeEntity(_0x1ec899,null))[_0xff25('0x49')](handleError(_0x1ec899,null));};exports[_0xff25('0x4a')]=function(_0x49ecc3,_0x8f867f,_0x330bf6){var _0x56a470={};var _0x5448d6={};var _0xf3beba;var _0x10ffdc;return db['DeskAccount'][_0xff25('0x4b')]({'where':{'id':_0x49ecc3['params']['id']}})['then'](handleEntityNotFound(_0x8f867f,null))['then'](function(_0xdcc210){if(_0xdcc210){_0xf3beba=_0xdcc210;_0x5448d6[_0xff25('0x32')]=_[_0xff25('0x2e')](db['DeskConfiguration']['rawAttributes']);_0x5448d6[_0xff25('0x2f')]=_['keys'](_0x49ecc3[_0xff25('0x2f')]);_0x5448d6[_0xff25('0x30')]=_[_0xff25('0x31')](_0x5448d6['model'],_0x5448d6[_0xff25('0x2f')]);_0x56a470[_0xff25('0x33')]=_[_0xff25('0x31')](_0x5448d6['model'],qs['fields'](_0x49ecc3[_0xff25('0x2f')]['fields']));_0x56a470[_0xff25('0x33')]=_0x56a470[_0xff25('0x33')]['length']?_0x56a470[_0xff25('0x33')]:_0x5448d6[_0xff25('0x32')];_0x56a470[_0xff25('0x4c')]=qs[_0xff25('0x38')](_0x49ecc3[_0xff25('0x2f')][_0xff25('0x38')]);_0x56a470[_0xff25('0x39')]=qs[_0xff25('0x30')](_[_0xff25('0x3a')](_0x49ecc3['query'],_0x5448d6[_0xff25('0x30')]));if(_0x49ecc3[_0xff25('0x2f')]['filter']){_0x56a470['where']=_[_0xff25('0x46')](_0x56a470['where'],{'$or':_['map'](_0x56a470[_0xff25('0x33')],function(_0x2fd3b5){var _0x547632={};_0x547632[_0x2fd3b5]={'$like':'%'+_0x49ecc3[_0xff25('0x2f')][_0xff25('0x3c')]+'%'};return _0x547632;})});}_0x56a470=_[_0xff25('0x46')]({},_0x56a470,_0x49ecc3[_0xff25('0x3d')]);return _0xf3beba[_0xff25('0x4a')](_0x56a470);}})[_0xff25('0x26')](function(_0x17a3ee){if(_0x17a3ee){_0x10ffdc=_0x17a3ee[_0xff25('0x35')];if(!_0x49ecc3[_0xff25('0x2f')][_0xff25('0x36')]('nolimit')){_0x56a470[_0xff25('0x21')]=qs['limit'](_0x49ecc3[_0xff25('0x2f')][_0xff25('0x21')]);_0x56a470[_0xff25('0x1f')]=qs[_0xff25('0x1f')](_0x49ecc3[_0xff25('0x2f')][_0xff25('0x1f')]);}return _0xf3beba[_0xff25('0x4a')](_0x56a470);}})[_0xff25('0x26')](function(_0x3a38e3){if(_0x3a38e3){return _0x3a38e3?{'count':_0x10ffdc,'rows':_0x3a38e3}:null;}})['then'](respondWithResult(_0x8f867f,null))[_0xff25('0x49')](handleError(_0x8f867f,null));};exports[_0xff25('0x4d')]=function(_0x13688f,_0x1f9e40,_0x531284){if(_0x13688f[_0xff25('0x48')]['id']){delete _0x13688f[_0xff25('0x48')]['id'];}return db[_0xff25('0x3e')][_0xff25('0x4b')]({'where':{'id':_0x13688f[_0xff25('0x44')]['id']}})[_0xff25('0x26')](handleEntityNotFound(_0x1f9e40,null))[_0xff25('0x26')](function(_0x44d38e){if(_0x44d38e){_0x13688f[_0xff25('0x48')][_0xff25('0x4e')]=_0x44d38e['id'];_0x13688f[_0xff25('0x48')][_0xff25('0x4f')]=integrations[_0xff25('0x50')](_0x13688f[_0xff25('0x48')]['channel'],_0x13688f[_0xff25('0x48')][_0xff25('0x2c')]);_0x13688f[_0xff25('0x48')]['Descriptions']=integrations[_0xff25('0x51')](_0x13688f[_0xff25('0x48')][_0xff25('0x52')],_0x13688f[_0xff25('0x48')][_0xff25('0x2c')]);return db[_0xff25('0x53')][_0xff25('0x54')](_0x13688f[_0xff25('0x48')],{'include':[{'model':db[_0xff25('0x55')],'as':_0xff25('0x4f')},{'model':db[_0xff25('0x55')],'as':_0xff25('0x56')}]});}return null;})[_0xff25('0x26')](respondWithResult(_0x1f9e40,null))['catch'](handleError(_0x1f9e40,null));};exports[_0xff25('0x57')]=function(_0x1e1336,_0x35f061,_0x3fe931){var _0x4cdc99=[{'name':_0xff25('0x58'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1773e6='';return db[_0xff25('0x3e')][_0xff25('0x4b')]({'where':{'id':_0x1e1336[_0xff25('0x44')]['id']},'attributes':['id',_0xff25('0x59'),'authType',_0xff25('0x5a'),'password',_0xff25('0x5b'),_0xff25('0x5c'),_0xff25('0x5d'),_0xff25('0x5e')]})[_0xff25('0x26')](handleEntityNotFound(_0x35f061,null))[_0xff25('0x26')](function(_0x117471){if(_0x117471){_0x1773e6=_0x117471[_0xff25('0x59')];var _0x46691b=_0x1773e6[_0xff25('0x5f')](-0x1);if(_0x46691b==='/'){_0x1773e6=_0x1773e6['substring'](0x0,_0x1773e6[_0xff25('0x60')](_0x46691b));}var _0x1f3e04={'method':_0xff25('0x61'),'uri':util[_0xff25('0x62')](_0xff25('0x63'),_0x1773e6),'headers':{'Content-Type':_0xff25('0x64'),'Accept':_0xff25('0x64')},'json':!![]};if(_0x117471[_0xff25('0x65')]===_0xff25('0x66')){_0x1f3e04['headers'][_0xff25('0x67')]=util[_0xff25('0x62')](_0xff25('0x68'),new Buffer(util['format'](_0xff25('0x69'),_0x117471[_0xff25('0x5a')],_0x117471[_0xff25('0x6a')]))[_0xff25('0x6b')](_0xff25('0x6c')));}return rp(_0x1f3e04)[_0xff25('0x26')](function(_0x5732de){return _0x4cdc99[_0xff25('0x6d')](_[_0xff25('0x2b')](_0x5732de[_0xff25('0x6e')][_0xff25('0x6f')],function(_0x4efc60){return{'id':_0x4efc60[_0xff25('0x2a')],'name':_0x4efc60['name'],'type':_0x4efc60['type'],'active':_0x4efc60['active'],'label':_0x4efc60[_0xff25('0x70')],'custom':!![]};}));});}})['then'](function(_0x41bb70){return{'count':_0x41bb70['length'],'rows':_0x41bb70};})[_0xff25('0x26')](respondWithResult(_0x35f061,null))['catch'](function(_0x45d908){var _0xf005a=_0x1e1336['query'][_0xff25('0x71')]?0x1f4:_0x45d908['statusCode']||0x1f4;logger[_0xff25('0x28')](_0xff25('0x72'),_0xff25('0x57'),_0xf005a,JSON[_0xff25('0x73')](_0x45d908));delete _0x45d908[_0xff25('0x2a')];if(_0xf005a===0x191){_0xf005a=0x190;}_0x35f061[_0xff25('0x1c')](_0xf005a)[_0xff25('0x74')](_0x1e1336[_0xff25('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x45d908[_0xff25('0x75')]}:_0x45d908);});}; \ No newline at end of file +var _0x9f8c=['authType','format','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','DeskConfiguration','getConfigurations','AccountId','Subjects','channel','DeskField','Descriptions','priority','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','GET','%s/custom_fields','application/json'];(function(_0x444335,_0x927a8c){var _0x1a5612=function(_0x47b662){while(--_0x47b662){_0x444335['push'](_0x444335['shift']());}};_0x1a5612(++_0x927a8c);}(_0x9f8c,0xeb));var _0xc9f8=function(_0x324f9f,_0x22ff81){_0x324f9f=_0x324f9f-0x0;var _0x3047b0=_0x9f8c[_0x324f9f];return _0x3047b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9f8('0x0'));var zipdir=require(_0xc9f8('0x1'));var jsonpatch=require(_0xc9f8('0x2'));var rp=require('request-promise');var moment=require(_0xc9f8('0x3'));var BPromise=require(_0xc9f8('0x4'));var Mustache=require(_0xc9f8('0x5'));var util=require(_0xc9f8('0x6'));var path=require(_0xc9f8('0x7'));var sox=require('sox');var csv=require(_0xc9f8('0x8'));var ejs=require(_0xc9f8('0x9'));var fs=require('fs');var fs_extra=require(_0xc9f8('0xa'));var _=require(_0xc9f8('0xb'));var squel=require(_0xc9f8('0xc'));var crypto=require('crypto');var jsforce=require(_0xc9f8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9f8('0xe'));var Papa=require(_0xc9f8('0xf'));var Redis=require('ioredis');var authService=require(_0xc9f8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9f8('0x11'));var logger=require(_0xc9f8('0x12'))(_0xc9f8('0x13'));var utils=require(_0xc9f8('0x14'));var config=require(_0xc9f8('0x15'));var licenseUtil=require(_0xc9f8('0x16'));var db=require(_0xc9f8('0x17'))['db'];var integrations=require(_0xc9f8('0x18'));function respondWithStatusCode(_0x39942a,_0x553f87){_0x553f87=_0x553f87||0xcc;return function(_0x1e716b){if(_0x1e716b){return _0x39942a['sendStatus'](_0x553f87);}return _0x39942a[_0xc9f8('0x19')](_0x553f87)[_0xc9f8('0x1a')]();};}function respondWithResult(_0x4a6db8,_0x4740d6){_0x4740d6=_0x4740d6||0xc8;return function(_0xbdda15){if(_0xbdda15){return _0x4a6db8[_0xc9f8('0x19')](_0x4740d6)['json'](_0xbdda15);}};}function respondWithFilteredResult(_0x3f673a,_0x2fa078){return function(_0x131b6f){if(_0x131b6f){var _0x26dda5=typeof _0x2fa078[_0xc9f8('0x1b')]===_0xc9f8('0x1c')&&typeof _0x2fa078[_0xc9f8('0x1d')]===_0xc9f8('0x1c');var _0x5e0a32=_0x131b6f[_0xc9f8('0x1e')];var _0x3dfd1f=_0x26dda5?0x0:_0x2fa078[_0xc9f8('0x1b')];var _0xa88f5f=_0x26dda5?_0x131b6f[_0xc9f8('0x1e')]:_0x2fa078['offset']+_0x2fa078[_0xc9f8('0x1d')];var _0x2ecf42;if(_0xa88f5f>=_0x5e0a32){_0xa88f5f=_0x5e0a32;_0x2ecf42=0xc8;}else{_0x2ecf42=0xce;}_0x3f673a[_0xc9f8('0x19')](_0x2ecf42);return _0x3f673a[_0xc9f8('0x1f')](_0xc9f8('0x20'),_0x3dfd1f+'-'+_0xa88f5f+'/'+_0x5e0a32)[_0xc9f8('0x21')](_0x131b6f);}return null;};}function patchUpdates(_0x4304e1){return function(_0x7f9661){try{jsonpatch[_0xc9f8('0x22')](_0x7f9661,_0x4304e1,!![]);}catch(_0x223272){return BPromise['reject'](_0x223272);}return _0x7f9661[_0xc9f8('0x23')]();};}function saveUpdates(_0x4fc7b0,_0x5f1c88){return function(_0x9be31c){if(_0x9be31c){return _0x9be31c[_0xc9f8('0x24')](_0x4fc7b0)[_0xc9f8('0x25')](function(_0x367675){return _0x367675;});}return null;};}function removeEntity(_0x42d30c,_0x1b6daa){return function(_0x4b58df){if(_0x4b58df){return _0x4b58df['destroy']()['then'](function(){_0x42d30c[_0xc9f8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x831d88,_0x3ac152){return function(_0x5b4d9d){if(!_0x5b4d9d){_0x831d88['sendStatus'](0x194);}return _0x5b4d9d;};}function handleError(_0x3b6cb3,_0x4ac038){_0x4ac038=_0x4ac038||0x1f4;return function(_0x4cd242){logger[_0xc9f8('0x26')](_0x4cd242[_0xc9f8('0x27')]);if(_0x4cd242['name']){delete _0x4cd242[_0xc9f8('0x28')];}_0x3b6cb3[_0xc9f8('0x19')](_0x4ac038)[_0xc9f8('0x29')](_0x4cd242);};}exports['index']=function(_0x2ac1ac,_0xa5c390){var _0x380696={},_0x1f6a8d={},_0x32fb4d={'count':0x0,'rows':[]};var _0x51f8a5=_[_0xc9f8('0x2a')](db[_0xc9f8('0x2b')][_0xc9f8('0x2c')],function(_0x40ae2d){return{'name':_0x40ae2d[_0xc9f8('0x2d')],'type':_0x40ae2d['type']['key']};});_0x1f6a8d[_0xc9f8('0x2e')]=_[_0xc9f8('0x2a')](_0x51f8a5,_0xc9f8('0x28'));_0x1f6a8d[_0xc9f8('0x2f')]=_[_0xc9f8('0x30')](_0x2ac1ac['query']);_0x1f6a8d[_0xc9f8('0x31')]=_['intersection'](_0x1f6a8d['model'],_0x1f6a8d[_0xc9f8('0x2f')]);_0x380696[_0xc9f8('0x32')]=_[_0xc9f8('0x33')](_0x1f6a8d['model'],qs[_0xc9f8('0x34')](_0x2ac1ac[_0xc9f8('0x2f')]['fields']));_0x380696['attributes']=_0x380696[_0xc9f8('0x32')][_0xc9f8('0x35')]?_0x380696[_0xc9f8('0x32')]:_0x1f6a8d[_0xc9f8('0x2e')];if(!_0x2ac1ac['query'][_0xc9f8('0x36')](_0xc9f8('0x37'))){_0x380696[_0xc9f8('0x1d')]=qs[_0xc9f8('0x1d')](_0x2ac1ac[_0xc9f8('0x2f')][_0xc9f8('0x1d')]);_0x380696[_0xc9f8('0x1b')]=qs['offset'](_0x2ac1ac[_0xc9f8('0x2f')]['offset']);}_0x380696[_0xc9f8('0x38')]=qs[_0xc9f8('0x39')](_0x2ac1ac[_0xc9f8('0x2f')][_0xc9f8('0x39')]);_0x380696[_0xc9f8('0x3a')]=qs['filters'](_[_0xc9f8('0x3b')](_0x2ac1ac[_0xc9f8('0x2f')],_0x1f6a8d['filters']),_0x51f8a5);if(_0x2ac1ac[_0xc9f8('0x2f')][_0xc9f8('0x3c')]){_0x380696[_0xc9f8('0x3a')]=_[_0xc9f8('0x3d')](_0x380696[_0xc9f8('0x3a')],{'$or':_[_0xc9f8('0x2a')](_0x51f8a5,function(_0x430227){if(_0x430227[_0xc9f8('0x3e')]!==_0xc9f8('0x3f')){var _0x75570d={};_0x75570d[_0x430227[_0xc9f8('0x28')]]={'$like':'%'+_0x2ac1ac[_0xc9f8('0x2f')]['filter']+'%'};return _0x75570d;}})});}_0x380696=_[_0xc9f8('0x3d')]({},_0x380696,_0x2ac1ac[_0xc9f8('0x40')]);var _0x306f41={'where':_0x380696[_0xc9f8('0x3a')]};return db[_0xc9f8('0x2b')][_0xc9f8('0x1e')](_0x306f41)['then'](function(_0x436a5d){_0x32fb4d[_0xc9f8('0x1e')]=_0x436a5d;if(_0x2ac1ac['query'][_0xc9f8('0x41')]){_0x380696[_0xc9f8('0x42')]=[{'all':!![]}];}return db[_0xc9f8('0x2b')][_0xc9f8('0x43')](_0x380696);})[_0xc9f8('0x25')](function(_0x43be04){_0x32fb4d[_0xc9f8('0x44')]=_0x43be04;return _0x32fb4d;})[_0xc9f8('0x25')](respondWithFilteredResult(_0xa5c390,_0x380696))[_0xc9f8('0x45')](handleError(_0xa5c390,null));};exports[_0xc9f8('0x46')]=function(_0x3e8889,_0x23cf36){var _0x59d128={'raw':![],'where':{'id':_0x3e8889['params']['id']}},_0x2d5f2a={};_0x2d5f2a[_0xc9f8('0x2e')]=_[_0xc9f8('0x30')](db[_0xc9f8('0x2b')]['rawAttributes']);_0x2d5f2a[_0xc9f8('0x2f')]=_[_0xc9f8('0x30')](_0x3e8889[_0xc9f8('0x2f')]);_0x2d5f2a[_0xc9f8('0x31')]=_[_0xc9f8('0x33')](_0x2d5f2a[_0xc9f8('0x2e')],_0x2d5f2a[_0xc9f8('0x2f')]);_0x59d128[_0xc9f8('0x32')]=_['intersection'](_0x2d5f2a[_0xc9f8('0x2e')],qs['fields'](_0x3e8889[_0xc9f8('0x2f')][_0xc9f8('0x34')]));_0x59d128[_0xc9f8('0x32')]=_0x59d128[_0xc9f8('0x32')][_0xc9f8('0x35')]?_0x59d128[_0xc9f8('0x32')]:_0x2d5f2a[_0xc9f8('0x2e')];if(_0x3e8889[_0xc9f8('0x2f')]['includeAll']){_0x59d128[_0xc9f8('0x42')]=[{'all':!![]}];}_0x59d128=_[_0xc9f8('0x3d')]({},_0x59d128,_0x3e8889[_0xc9f8('0x40')]);return db[_0xc9f8('0x2b')][_0xc9f8('0x47')](_0x59d128)[_0xc9f8('0x25')](handleEntityNotFound(_0x23cf36,null))[_0xc9f8('0x25')](respondWithResult(_0x23cf36,null))[_0xc9f8('0x45')](handleError(_0x23cf36,null));};exports[_0xc9f8('0x48')]=function(_0x4783fa,_0x4fd271){return db[_0xc9f8('0x2b')][_0xc9f8('0x48')](_0x4783fa[_0xc9f8('0x49')],{})[_0xc9f8('0x25')](respondWithResult(_0x4fd271,0xc9))[_0xc9f8('0x45')](handleError(_0x4fd271,null));};exports[_0xc9f8('0x24')]=function(_0x16444c,_0xb9c16f){if(_0x16444c[_0xc9f8('0x49')]['id']){delete _0x16444c[_0xc9f8('0x49')]['id'];}return db[_0xc9f8('0x2b')]['find']({'where':{'id':_0x16444c[_0xc9f8('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb9c16f,null))[_0xc9f8('0x25')](saveUpdates(_0x16444c['body'],null))[_0xc9f8('0x25')](respondWithResult(_0xb9c16f,null))['catch'](handleError(_0xb9c16f,null));};exports[_0xc9f8('0x4b')]=function(_0x22aec8,_0x44a664){return db[_0xc9f8('0x2b')][_0xc9f8('0x47')]({'where':{'id':_0x22aec8[_0xc9f8('0x4a')]['id']}})[_0xc9f8('0x25')](handleEntityNotFound(_0x44a664,null))[_0xc9f8('0x25')](removeEntity(_0x44a664,null))[_0xc9f8('0x45')](handleError(_0x44a664,null));};exports['getConfigurations']=function(_0x1d88d2,_0x506ac4,_0x354a85){var _0x32d69f={};var _0x342cbd={};var _0x43a311;var _0x128cb9;return db[_0xc9f8('0x2b')]['findOne']({'where':{'id':_0x1d88d2[_0xc9f8('0x4a')]['id']}})[_0xc9f8('0x25')](handleEntityNotFound(_0x506ac4,null))[_0xc9f8('0x25')](function(_0x123d85){if(_0x123d85){_0x43a311=_0x123d85;_0x342cbd[_0xc9f8('0x2e')]=_[_0xc9f8('0x30')](db[_0xc9f8('0x4c')]['rawAttributes']);_0x342cbd[_0xc9f8('0x2f')]=_[_0xc9f8('0x30')](_0x1d88d2[_0xc9f8('0x2f')]);_0x342cbd[_0xc9f8('0x31')]=_['intersection'](_0x342cbd[_0xc9f8('0x2e')],_0x342cbd['query']);_0x32d69f[_0xc9f8('0x32')]=_[_0xc9f8('0x33')](_0x342cbd[_0xc9f8('0x2e')],qs[_0xc9f8('0x34')](_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x34')]));_0x32d69f[_0xc9f8('0x32')]=_0x32d69f[_0xc9f8('0x32')][_0xc9f8('0x35')]?_0x32d69f[_0xc9f8('0x32')]:_0x342cbd[_0xc9f8('0x2e')];_0x32d69f[_0xc9f8('0x38')]=qs['sort'](_0x1d88d2[_0xc9f8('0x2f')]['sort']);_0x32d69f[_0xc9f8('0x3a')]=qs[_0xc9f8('0x31')](_[_0xc9f8('0x3b')](_0x1d88d2['query'],_0x342cbd['filters']));if(_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x3c')]){_0x32d69f['where']=_['merge'](_0x32d69f[_0xc9f8('0x3a')],{'$or':_[_0xc9f8('0x2a')](_0x32d69f[_0xc9f8('0x32')],function(_0x500b9a){var _0x17bb40={};_0x17bb40[_0x500b9a]={'$like':'%'+_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x3c')]+'%'};return _0x17bb40;})});}_0x32d69f=_['merge']({},_0x32d69f,_0x1d88d2[_0xc9f8('0x40')]);return _0x43a311[_0xc9f8('0x4d')](_0x32d69f);}})['then'](function(_0x14017f){if(_0x14017f){_0x128cb9=_0x14017f[_0xc9f8('0x35')];if(!_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x36')]('nolimit')){_0x32d69f[_0xc9f8('0x1d')]=qs[_0xc9f8('0x1d')](_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x1d')]);_0x32d69f['offset']=qs[_0xc9f8('0x1b')](_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x1b')]);}return _0x43a311[_0xc9f8('0x4d')](_0x32d69f);}})[_0xc9f8('0x25')](function(_0x25466a){if(_0x25466a){return _0x25466a?{'count':_0x128cb9,'rows':_0x25466a}:null;}})[_0xc9f8('0x25')](respondWithResult(_0x506ac4,null))[_0xc9f8('0x45')](handleError(_0x506ac4,null));};exports['addConfiguration']=function(_0x400b74,_0x2d91ab,_0x5eb5b0){if(_0x400b74[_0xc9f8('0x49')]['id']){delete _0x400b74[_0xc9f8('0x49')]['id'];}return db[_0xc9f8('0x2b')]['findOne']({'where':{'id':_0x400b74[_0xc9f8('0x4a')]['id']}})[_0xc9f8('0x25')](handleEntityNotFound(_0x2d91ab,null))['then'](function(_0x4b677a){if(_0x4b677a){_0x400b74['body'][_0xc9f8('0x4e')]=_0x4b677a['id'];_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x4f')]=integrations['getSubjects'](_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x50')],_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x3e')]);_0x400b74[_0xc9f8('0x49')]['Descriptions']=integrations['getDescriptions'](_0x400b74[_0xc9f8('0x49')]['channel'],_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x3e')]);return db['DeskConfiguration'][_0xc9f8('0x48')](_0x400b74[_0xc9f8('0x49')],{'include':[{'model':db[_0xc9f8('0x51')],'as':_0xc9f8('0x4f')},{'model':db['DeskField'],'as':_0xc9f8('0x52')}]});}return null;})[_0xc9f8('0x25')](respondWithResult(_0x2d91ab,null))[_0xc9f8('0x45')](handleError(_0x2d91ab,null));};exports['getFields']=function(_0x2cafc0,_0x1003bf,_0x7646e7){var _0x5be1d7=[{'name':'priority','label':_0xc9f8('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x46e7b7='';return db[_0xc9f8('0x2b')]['findOne']({'where':{'id':_0x2cafc0[_0xc9f8('0x4a')]['id']},'attributes':['id','remoteUri','authType',_0xc9f8('0x54'),_0xc9f8('0x55'),_0xc9f8('0x56'),_0xc9f8('0x57'),_0xc9f8('0x58'),_0xc9f8('0x59')]})[_0xc9f8('0x25')](handleEntityNotFound(_0x1003bf,null))[_0xc9f8('0x25')](function(_0x2aef58){if(_0x2aef58){_0x46e7b7=_0x2aef58[_0xc9f8('0x5a')];var _0x12e1e6=_0x46e7b7[_0xc9f8('0x5b')](-0x1);if(_0x12e1e6==='/'){_0x46e7b7=_0x46e7b7['substring'](0x0,_0x46e7b7['lastIndexOf'](_0x12e1e6));}var _0x56009d={'method':_0xc9f8('0x5c'),'uri':util['format'](_0xc9f8('0x5d'),_0x46e7b7),'headers':{'Content-Type':'application/json','Accept':_0xc9f8('0x5e')},'json':!![]};if(_0x2aef58[_0xc9f8('0x5f')]==='basic'){_0x56009d['headers']['Authorization']=util[_0xc9f8('0x60')](_0xc9f8('0x61'),new Buffer(util[_0xc9f8('0x60')](_0xc9f8('0x62'),_0x2aef58[_0xc9f8('0x54')],_0x2aef58['password']))[_0xc9f8('0x63')](_0xc9f8('0x64')));}return rp(_0x56009d)[_0xc9f8('0x25')](function(_0x371038){return _0x5be1d7[_0xc9f8('0x65')](_['map'](_0x371038[_0xc9f8('0x66')]['entries'],function(_0x3e4ad0){return{'id':_0x3e4ad0[_0xc9f8('0x28')],'name':_0x3e4ad0[_0xc9f8('0x28')],'type':_0x3e4ad0[_0xc9f8('0x3e')],'active':_0x3e4ad0[_0xc9f8('0x67')],'label':_0x3e4ad0['label'],'custom':!![]};}));});}})['then'](function(_0x275a3f){return{'count':_0x275a3f[_0xc9f8('0x35')],'rows':_0x275a3f};})[_0xc9f8('0x25')](respondWithResult(_0x1003bf,null))['catch'](function(_0x33be32){var _0x525afa=_0x2cafc0[_0xc9f8('0x2f')][_0xc9f8('0x68')]?0x1f4:_0x33be32[_0xc9f8('0x69')]||0x1f4;logger[_0xc9f8('0x26')](_0xc9f8('0x6a'),_0xc9f8('0x6b'),_0x525afa,JSON[_0xc9f8('0x6c')](_0x33be32));delete _0x33be32[_0xc9f8('0x28')];if(_0x525afa===0x191){_0x525afa=0x190;}_0x1003bf['status'](_0x525afa)[_0xc9f8('0x29')](_0x2cafc0['query'][_0xc9f8('0x68')]?{'message':_0xc9f8('0x6d'),'statusCode':_0x33be32[_0xc9f8('0x69')]}:_0x33be32);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 9c04611..3468beb 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 _0xf585=['DeskAccount','int_desk_accounts','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intDeskAccount.attributes','define'];(function(_0x21cb42,_0x4a9d87){var _0x4d847b=function(_0x555ede){while(--_0x555ede){_0x21cb42['push'](_0x21cb42['shift']());}};_0x4d847b(++_0x4a9d87);}(_0xf585,0x1ba));var _0x5f58=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xf585[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0x5f58('0x0'));var logger=require(_0x5f58('0x1'))('api');var moment=require(_0x5f58('0x2'));var BPromise=require(_0x5f58('0x3'));var rp=require(_0x5f58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f58('0x5'));var config=require('../../config/environment');var attributes=require(_0x5f58('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4b8a06,_0x365ec6){return _0x4b8a06[_0x5f58('0x7')](_0x5f58('0x8'),attributes,{'tableName':_0x5f58('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8655=['request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','define','DeskAccount','api','moment'];(function(_0x3f6c4b,_0x2f89b5){var _0x4da1ab=function(_0x44a7eb){while(--_0x44a7eb){_0x3f6c4b['push'](_0x3f6c4b['shift']());}};_0x4da1ab(++_0x2f89b5);}(_0x8655,0x17e));var _0x5865=function(_0x4c2a0f,_0x11fb52){_0x4c2a0f=_0x4c2a0f-0x0;var _0x2c8aac=_0x8655[_0x4c2a0f];return _0x2c8aac;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5865('0x0'));var moment=require(_0x5865('0x1'));var BPromise=require('bluebird');var rp=require(_0x5865('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5865('0x3'));var config=require(_0x5865('0x4'));var attributes=require(_0x5865('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xb2425c,_0x46e0cb){return _0xb2425c[_0x5865('0x6')](_0x5865('0x7'),attributes,{'tableName':'int_desk_accounts','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 5e9350f..255526b 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 _0x5f2b=['../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','stringify','DeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x11f0e1,_0x520662){var _0x383b23=function(_0x397ed4){while(--_0x397ed4){_0x11f0e1['push'](_0x11f0e1['shift']());}};_0x383b23(++_0x520662);}(_0x5f2b,0xb1));var _0xb5f2=function(_0x44302e,_0x2993dc){_0x44302e=_0x44302e-0x0;var _0x930e40=_0x5f2b[_0x44302e];return _0x930e40;};'use strict';var _=require(_0xb5f2('0x0'));var util=require(_0xb5f2('0x1'));var moment=require(_0xb5f2('0x2'));var BPromise=require(_0xb5f2('0x3'));var rs=require(_0xb5f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5f2('0x6'))(_0xb5f2('0x7'));var config=require(_0xb5f2('0x8'));var jayson=require(_0xb5f2('0x9'));var client=jayson[_0xb5f2('0xa')][_0xb5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x261036,_0x402902,_0xbb7c45){return new BPromise(function(_0xfcf583,_0x1284cd){return client['request'](_0x261036,_0xbb7c45)[_0xb5f2('0xc')](function(_0x17993d){logger[_0xb5f2('0xd')](_0xb5f2('0xe'),_0x402902,_0xb5f2('0xf'));logger[_0xb5f2('0x10')](_0xb5f2('0x11'),_0x402902,_0xb5f2('0xf'),JSON['stringify'](_0x17993d));if(_0x17993d[_0xb5f2('0x12')]){if(_0x17993d[_0xb5f2('0x12')][_0xb5f2('0x13')]===0x1f4){logger[_0xb5f2('0x12')](_0xb5f2('0xe'),_0x402902,_0x17993d['error'][_0xb5f2('0x14')]);return _0x1284cd(_0x17993d[_0xb5f2('0x12')][_0xb5f2('0x14')]);}logger[_0xb5f2('0x12')]('DeskAccount,\x20%s,\x20%s',_0x402902,_0x17993d[_0xb5f2('0x12')]['message']);return _0xfcf583(_0x17993d[_0xb5f2('0x12')]['message']);}else{logger[_0xb5f2('0xd')](_0xb5f2('0xe'),_0x402902,_0xb5f2('0xf'));_0xfcf583(_0x17993d[_0xb5f2('0x15')][_0xb5f2('0x14')]);}})[_0xb5f2('0x16')](function(_0x163e92){logger[_0xb5f2('0x12')]('DeskAccount,\x20%s,\x20%s',_0x402902,_0x163e92);_0x1284cd(_0x163e92);});});}exports['GetDeskAccount']=function(_0x266edf){var _0xc77af6=this;return new Promise(function(_0x531586,_0x553baa){return db['DeskAccount'][_0xb5f2('0x17')]({'raw':_0x266edf[_0xb5f2('0x18')]?_0x266edf[_0xb5f2('0x18')][_0xb5f2('0x19')]===undefined?!![]:![]:!![],'where':_0x266edf[_0xb5f2('0x18')]?_0x266edf[_0xb5f2('0x18')][_0xb5f2('0x1a')]||null:null,'attributes':_0x266edf[_0xb5f2('0x18')]?_0x266edf[_0xb5f2('0x18')][_0xb5f2('0x1b')]||null:null,'limit':_0x266edf[_0xb5f2('0x18')]?_0x266edf[_0xb5f2('0x18')][_0xb5f2('0x1c')]||null:null,'include':_0x266edf[_0xb5f2('0x18')]?_0x266edf[_0xb5f2('0x18')][_0xb5f2('0x1d')]?_[_0xb5f2('0x1e')](_0x266edf[_0xb5f2('0x18')][_0xb5f2('0x1d')],function(_0x5d0fb3){return{'model':db[_0x5d0fb3['model']],'as':_0x5d0fb3['as'],'attributes':_0x5d0fb3[_0xb5f2('0x1b')],'include':_0x5d0fb3[_0xb5f2('0x1d')]?_[_0xb5f2('0x1e')](_0x5d0fb3[_0xb5f2('0x1d')],function(_0x11b7cd){return{'model':db[_0x11b7cd['model']],'as':_0x11b7cd['as'],'attributes':_0x11b7cd['attributes'],'include':_0x11b7cd['include']?_[_0xb5f2('0x1e')](_0x11b7cd[_0xb5f2('0x1d')],function(_0x38f9f4){return{'model':db[_0x38f9f4[_0xb5f2('0x1f')]],'as':_0x38f9f4['as'],'attributes':_0x38f9f4['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5f2('0xc')](function(_0x3e0d88){logger[_0xb5f2('0xd')](_0xb5f2('0x20'),_0x266edf);logger[_0xb5f2('0x10')](_0xb5f2('0x20'),_0x266edf,JSON[_0xb5f2('0x21')](_0x3e0d88));_0x531586(_0x3e0d88);})['catch'](function(_0x53c624){logger['error'](_0xb5f2('0x20'),_0x53c624[_0xb5f2('0x14')],_0x266edf);_0x553baa(_0xc77af6['error'](0x1f4,_0x53c624['message']));});});};exports['ShowDeskAccount']=function(_0x59208f){var _0xd46d98=this;return new Promise(function(_0x2bf54a,_0x2c854d){return db[_0xb5f2('0x22')][_0xb5f2('0x23')]({'raw':_0x59208f[_0xb5f2('0x18')]?_0x59208f[_0xb5f2('0x18')][_0xb5f2('0x19')]===undefined?!![]:![]:!![],'where':_0x59208f[_0xb5f2('0x18')]?_0x59208f[_0xb5f2('0x18')][_0xb5f2('0x1a')]||null:null,'attributes':_0x59208f[_0xb5f2('0x18')]?_0x59208f[_0xb5f2('0x18')]['attributes']||null:null,'include':_0x59208f[_0xb5f2('0x18')]?_0x59208f[_0xb5f2('0x18')][_0xb5f2('0x1d')]?_[_0xb5f2('0x1e')](_0x59208f[_0xb5f2('0x18')]['include'],function(_0x12f5e6){return{'model':db[_0x12f5e6[_0xb5f2('0x1f')]],'as':_0x12f5e6['as'],'attributes':_0x12f5e6['attributes'],'include':_0x12f5e6[_0xb5f2('0x1d')]?_[_0xb5f2('0x1e')](_0x12f5e6[_0xb5f2('0x1d')],function(_0x57401b){return{'model':db[_0x57401b[_0xb5f2('0x1f')]],'as':_0x57401b['as'],'attributes':_0x57401b[_0xb5f2('0x1b')],'include':_0x57401b[_0xb5f2('0x1d')]?_[_0xb5f2('0x1e')](_0x57401b[_0xb5f2('0x1d')],function(_0x586442){return{'model':db[_0x586442['model']],'as':_0x586442['as'],'attributes':_0x586442['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5f2('0xc')](function(_0xb63c0f){logger[_0xb5f2('0xd')](_0xb5f2('0x24'),_0x59208f);logger['debug'](_0xb5f2('0x24'),_0x59208f,JSON[_0xb5f2('0x21')](_0xb63c0f));_0x2bf54a(_0xb63c0f);})[_0xb5f2('0x16')](function(_0x3ed8ff){logger[_0xb5f2('0x12')]('ShowDeskAccount',_0x3ed8ff['message'],_0x59208f);_0x2c854d(_0xd46d98[_0xb5f2('0x12')](0x1f4,_0x3ed8ff[_0xb5f2('0x14')]));});});}; \ No newline at end of file +var _0xf36b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetDeskAccount','options','where','attributes','limit','include','map','model','debug','catch','DeskAccount','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0xf36b,0x14f));var _0xbf36=function(_0x15145d,_0x58bde5){_0x15145d=_0x15145d-0x0;var _0x89ebb2=_0xf36b[_0x15145d];return _0x89ebb2;};'use strict';var _=require(_0xbf36('0x0'));var util=require('util');var moment=require(_0xbf36('0x1'));var BPromise=require(_0xbf36('0x2'));var rs=require(_0xbf36('0x3'));var fs=require('fs');var Redis=require(_0xbf36('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf36('0x5'));var logger=require(_0xbf36('0x6'))('rpc');var config=require(_0xbf36('0x7'));var jayson=require(_0xbf36('0x8'));var client=jayson[_0xbf36('0x9')][_0xbf36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3af23e,_0x19f968,_0x41245c){return new BPromise(function(_0x2eee68,_0x574bec){return client[_0xbf36('0xb')](_0x3af23e,_0x41245c)[_0xbf36('0xc')](function(_0x4a1ff5){logger[_0xbf36('0xd')](_0xbf36('0xe'),_0x19f968,'request\x20sent');logger['debug'](_0xbf36('0xf'),_0x19f968,_0xbf36('0x10'),JSON[_0xbf36('0x11')](_0x4a1ff5));if(_0x4a1ff5[_0xbf36('0x12')]){if(_0x4a1ff5[_0xbf36('0x12')][_0xbf36('0x13')]===0x1f4){logger['error'](_0xbf36('0xe'),_0x19f968,_0x4a1ff5[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x574bec(_0x4a1ff5['error']['message']);}logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x19f968,_0x4a1ff5[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x2eee68(_0x4a1ff5[_0xbf36('0x12')]['message']);}else{logger[_0xbf36('0xd')]('DeskAccount,\x20%s,\x20%s',_0x19f968,_0xbf36('0x10'));_0x2eee68(_0x4a1ff5[_0xbf36('0x15')][_0xbf36('0x14')]);}})['catch'](function(_0x2d59af){logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x19f968,_0x2d59af);_0x574bec(_0x2d59af);});});}exports[_0xbf36('0x16')]=function(_0x5f1a57){var _0x53e239=this;return new Promise(function(_0x166e41,_0x267234){return db['DeskAccount']['findAll']({'raw':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57[_0xbf36('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57[_0xbf36('0x17')][_0xbf36('0x18')]||null:null,'attributes':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57['options'][_0xbf36('0x19')]||null:null,'limit':_0x5f1a57['options']?_0x5f1a57['options'][_0xbf36('0x1a')]||null:null,'include':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57[_0xbf36('0x17')][_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x5f1a57['options'][_0xbf36('0x1b')],function(_0x5ca88a){return{'model':db[_0x5ca88a[_0xbf36('0x1d')]],'as':_0x5ca88a['as'],'attributes':_0x5ca88a['attributes'],'include':_0x5ca88a['include']?_['map'](_0x5ca88a[_0xbf36('0x1b')],function(_0x20f81d){return{'model':db[_0x20f81d[_0xbf36('0x1d')]],'as':_0x20f81d['as'],'attributes':_0x20f81d[_0xbf36('0x19')],'include':_0x20f81d[_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x20f81d[_0xbf36('0x1b')],function(_0x5ecdf2){return{'model':db[_0x5ecdf2[_0xbf36('0x1d')]],'as':_0x5ecdf2['as'],'attributes':_0x5ecdf2[_0xbf36('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbf36('0xc')](function(_0x5e8d4a){logger['info'](_0xbf36('0x16'),_0x5f1a57);logger[_0xbf36('0x1e')](_0xbf36('0x16'),_0x5f1a57,JSON['stringify'](_0x5e8d4a));_0x166e41(_0x5e8d4a);})[_0xbf36('0x1f')](function(_0x12725c){logger['error'](_0xbf36('0x16'),_0x12725c['message'],_0x5f1a57);_0x267234(_0x53e239['error'](0x1f4,_0x12725c['message']));});});};exports['ShowDeskAccount']=function(_0x103e8f){var _0x4f5fec=this;return new Promise(function(_0x1bdaa7,_0x380c7a){return db[_0xbf36('0x20')]['find']({'raw':_0x103e8f[_0xbf36('0x17')]?_0x103e8f['options']['raw']===undefined?!![]:![]:!![],'where':_0x103e8f[_0xbf36('0x17')]?_0x103e8f[_0xbf36('0x17')][_0xbf36('0x18')]||null:null,'attributes':_0x103e8f[_0xbf36('0x17')]?_0x103e8f[_0xbf36('0x17')]['attributes']||null:null,'include':_0x103e8f[_0xbf36('0x17')]?_0x103e8f[_0xbf36('0x17')][_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x103e8f['options']['include'],function(_0x16b8b7){return{'model':db[_0x16b8b7['model']],'as':_0x16b8b7['as'],'attributes':_0x16b8b7['attributes'],'include':_0x16b8b7[_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x16b8b7[_0xbf36('0x1b')],function(_0x4ef2c2){return{'model':db[_0x4ef2c2[_0xbf36('0x1d')]],'as':_0x4ef2c2['as'],'attributes':_0x4ef2c2[_0xbf36('0x19')],'include':_0x4ef2c2['include']?_[_0xbf36('0x1c')](_0x4ef2c2[_0xbf36('0x1b')],function(_0x5c030e){return{'model':db[_0x5c030e['model']],'as':_0x5c030e['as'],'attributes':_0x5c030e[_0xbf36('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbf36('0xc')](function(_0x461da1){logger[_0xbf36('0xd')](_0xbf36('0x21'),_0x103e8f);logger[_0xbf36('0x1e')](_0xbf36('0x21'),_0x103e8f,JSON['stringify'](_0x461da1));_0x1bdaa7(_0x461da1);})[_0xbf36('0x1f')](function(_0x5b30bc){logger[_0xbf36('0x12')]('ShowDeskAccount',_0x5b30bc['message'],_0x103e8f);_0x380c7a(_0x4f5fec['error'](0x1f4,_0x5b30bc[_0xbf36('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index dbe5193..7ee3e9f 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x1cc883,_0x169c7f){var _0x1271f6=function(_0x5f43d3){while(--_0x5f43d3){_0x1cc883['push'](_0x1cc883['shift']());}};_0x1271f6(++_0x169c7f);}(_0x3e74,0x175));var _0x43e7=function(_0x4ce74b,_0x582044){_0x4ce74b=_0x4ce74b-0x0;var _0x5abacb=_0x3e74[_0x4ce74b];return _0x5abacb;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4a978d,_0x2178bc){var _0x573415=function(_0x54c997){while(--_0x54c997){_0x4a978d['push'](_0x4a978d['shift']());}};_0x573415(++_0x2178bc);}(_0x34e8,0x12c));var _0x834e=function(_0x2acdf2,_0x3a4380){_0x2acdf2=_0x2acdf2-0x0;var _0x91715d=_0x34e8[_0x2acdf2];return _0x91715d;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 44f1b81..40ac2d1 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 _0x0bc8=['sequelize','exports','STRING'];(function(_0x510c7b,_0x90f7a2){var _0x232264=function(_0x4165da){while(--_0x4165da){_0x510c7b['push'](_0x510c7b['shift']());}};_0x232264(++_0x90f7a2);}(_0x0bc8,0x156));var _0x80bc=function(_0x5e1f21,_0x2fde17){_0x5e1f21=_0x5e1f21-0x0;var _0x431f8a=_0x0bc8[_0x5e1f21];return _0x431f8a;};'use strict';var Sequelize=require(_0x80bc('0x0'));module[_0x80bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x80bc('0x2')]}}; \ No newline at end of file +var _0x2b30=['exports','STRING','sequelize'];(function(_0xb9404d,_0xb9c541){var _0x5cfcf7=function(_0x1732d2){while(--_0x1732d2){_0xb9404d['push'](_0xb9404d['shift']());}};_0x5cfcf7(++_0xb9c541);}(_0x2b30,0xe0));var _0x02b3=function(_0x5e08b4,_0x4d0e31){_0x5e08b4=_0x5e08b4-0x0;var _0x2c8b90=_0x2b30[_0x5e08b4];return _0x2c8b90;};'use strict';var Sequelize=require(_0x02b3('0x0'));module[_0x02b3('0x1')]={'name':{'type':Sequelize[_0x02b3('0x2')]},'description':{'type':Sequelize[_0x02b3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7a1a257..ba36305 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 _0x7494=['attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','getFields','DeskField','pick','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','save','update','then','destroy','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7494,0x6f));var _0x4749=function(_0x5128dd,_0x40973f){_0x5128dd=_0x5128dd-0x0;var _0xa9016b=_0x7494[_0x5128dd];return _0xa9016b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4749('0x0'));var zipdir=require(_0x4749('0x1'));var jsonpatch=require(_0x4749('0x2'));var rp=require(_0x4749('0x3'));var moment=require(_0x4749('0x4'));var BPromise=require(_0x4749('0x5'));var Mustache=require(_0x4749('0x6'));var util=require(_0x4749('0x7'));var path=require(_0x4749('0x8'));var sox=require(_0x4749('0x9'));var csv=require(_0x4749('0xa'));var ejs=require(_0x4749('0xb'));var fs=require('fs');var fs_extra=require(_0x4749('0xc'));var _=require('lodash');var squel=require(_0x4749('0xd'));var crypto=require(_0x4749('0xe'));var jsforce=require(_0x4749('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4749('0xa'));var querystring=require(_0x4749('0x10'));var Papa=require(_0x4749('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4749('0x12'));var hardwareService=require(_0x4749('0x13'));var logger=require(_0x4749('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4749('0x15'));var licenseUtil=require(_0x4749('0x16'));var db=require(_0x4749('0x17'))['db'];function respondWithStatusCode(_0x492176,_0x5e6c40){_0x5e6c40=_0x5e6c40||0xcc;return function(_0x1a0ec4){if(_0x1a0ec4){return _0x492176[_0x4749('0x18')](_0x5e6c40);}return _0x492176[_0x4749('0x19')](_0x5e6c40)[_0x4749('0x1a')]();};}function respondWithResult(_0x3e1cdf,_0x2bcd8b){_0x2bcd8b=_0x2bcd8b||0xc8;return function(_0x3e980c){if(_0x3e980c){return _0x3e1cdf[_0x4749('0x19')](_0x2bcd8b)['json'](_0x3e980c);}};}function respondWithFilteredResult(_0x3ca596,_0x5dfc9c){return function(_0x298334){if(_0x298334){var _0x6ae723=typeof _0x5dfc9c[_0x4749('0x1b')]===_0x4749('0x1c')&&typeof _0x5dfc9c[_0x4749('0x1d')]===_0x4749('0x1c');var _0xb6ab00=_0x298334[_0x4749('0x1e')];var _0x281ae1=_0x6ae723?0x0:_0x5dfc9c[_0x4749('0x1b')];var _0x4defb3=_0x6ae723?_0x298334['count']:_0x5dfc9c[_0x4749('0x1b')]+_0x5dfc9c[_0x4749('0x1d')];var _0x33e1da;if(_0x4defb3>=_0xb6ab00){_0x4defb3=_0xb6ab00;_0x33e1da=0xc8;}else{_0x33e1da=0xce;}_0x3ca596['status'](_0x33e1da);return _0x3ca596['set'](_0x4749('0x1f'),_0x281ae1+'-'+_0x4defb3+'/'+_0xb6ab00)[_0x4749('0x20')](_0x298334);}return null;};}function patchUpdates(_0x30740d){return function(_0x3890b8){try{jsonpatch['apply'](_0x3890b8,_0x30740d,!![]);}catch(_0x227d70){return BPromise['reject'](_0x227d70);}return _0x3890b8[_0x4749('0x21')]();};}function saveUpdates(_0x475090,_0x2edd00){return function(_0x32cd7d){if(_0x32cd7d){return _0x32cd7d[_0x4749('0x22')](_0x475090)[_0x4749('0x23')](function(_0x1c0635){return _0x1c0635;});}return null;};}function removeEntity(_0x2f6df2,_0x291ec3){return function(_0x1d4ae6){if(_0x1d4ae6){return _0x1d4ae6[_0x4749('0x24')]()[_0x4749('0x23')](function(){_0x2f6df2['status'](0xcc)[_0x4749('0x1a')]();});}};}function handleEntityNotFound(_0x4a823a,_0x21e7dd){return function(_0x12d248){if(!_0x12d248){_0x4a823a['sendStatus'](0x194);}return _0x12d248;};}function handleError(_0x36ce0e,_0x55b5d3){_0x55b5d3=_0x55b5d3||0x1f4;return function(_0x48ca59){logger['error'](_0x48ca59['stack']);if(_0x48ca59[_0x4749('0x25')]){delete _0x48ca59[_0x4749('0x25')];}_0x36ce0e['status'](_0x55b5d3)[_0x4749('0x26')](_0x48ca59);};}exports[_0x4749('0x27')]=function(_0xcdc5e1,_0x3e5c70){var _0x392143={},_0xfdb101={},_0x210ab4={'count':0x0,'rows':[]};var _0x2d2550=_['map'](db[_0x4749('0x28')][_0x4749('0x29')],function(_0x2bf7a3){return{'name':_0x2bf7a3[_0x4749('0x2a')],'type':_0x2bf7a3[_0x4749('0x2b')][_0x4749('0x2c')]};});_0xfdb101['model']=_[_0x4749('0x2d')](_0x2d2550,_0x4749('0x25'));_0xfdb101[_0x4749('0x2e')]=_[_0x4749('0x2f')](_0xcdc5e1['query']);_0xfdb101[_0x4749('0x30')]=_[_0x4749('0x31')](_0xfdb101[_0x4749('0x32')],_0xfdb101[_0x4749('0x2e')]);_0x392143[_0x4749('0x33')]=_['intersection'](_0xfdb101[_0x4749('0x32')],qs['fields'](_0xcdc5e1[_0x4749('0x2e')][_0x4749('0x34')]));_0x392143[_0x4749('0x33')]=_0x392143[_0x4749('0x33')][_0x4749('0x35')]?_0x392143[_0x4749('0x33')]:_0xfdb101[_0x4749('0x32')];if(!_0xcdc5e1[_0x4749('0x2e')]['hasOwnProperty'](_0x4749('0x36'))){_0x392143[_0x4749('0x1d')]=qs['limit'](_0xcdc5e1[_0x4749('0x2e')]['limit']);_0x392143['offset']=qs[_0x4749('0x1b')](_0xcdc5e1[_0x4749('0x2e')]['offset']);}_0x392143[_0x4749('0x37')]=qs[_0x4749('0x38')](_0xcdc5e1['query']['sort']);_0x392143['where']=qs[_0x4749('0x30')](_['pick'](_0xcdc5e1[_0x4749('0x2e')],_0xfdb101['filters']),_0x2d2550);if(_0xcdc5e1['query'][_0x4749('0x39')]){_0x392143[_0x4749('0x3a')]=_[_0x4749('0x3b')](_0x392143[_0x4749('0x3a')],{'$or':_['map'](_0x2d2550,function(_0x1f3061){if(_0x1f3061[_0x4749('0x2b')]!==_0x4749('0x3c')){var _0x470584={};_0x470584[_0x1f3061['name']]={'$like':'%'+_0xcdc5e1[_0x4749('0x2e')][_0x4749('0x39')]+'%'};return _0x470584;}})});}_0x392143=_[_0x4749('0x3b')]({},_0x392143,_0xcdc5e1[_0x4749('0x3d')]);var _0x3fa3e={'where':_0x392143[_0x4749('0x3a')]};return db[_0x4749('0x28')][_0x4749('0x1e')](_0x3fa3e)[_0x4749('0x23')](function(_0x225fd6){_0x210ab4['count']=_0x225fd6;if(_0xcdc5e1[_0x4749('0x2e')][_0x4749('0x3e')]){_0x392143['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x4749('0x3f')](_0x392143);})[_0x4749('0x23')](function(_0x1f0d4c){_0x210ab4['rows']=_0x1f0d4c;return _0x210ab4;})[_0x4749('0x23')](respondWithFilteredResult(_0x3e5c70,_0x392143))[_0x4749('0x40')](handleError(_0x3e5c70,null));};exports[_0x4749('0x41')]=function(_0x37f293,_0x3ce12c){var _0xdc35b5={'raw':![],'where':{'id':_0x37f293[_0x4749('0x42')]['id']}},_0x200080={};_0x200080[_0x4749('0x32')]=_['keys'](db[_0x4749('0x28')][_0x4749('0x29')]);_0x200080[_0x4749('0x2e')]=_[_0x4749('0x2f')](_0x37f293['query']);_0x200080[_0x4749('0x30')]=_[_0x4749('0x31')](_0x200080[_0x4749('0x32')],_0x200080[_0x4749('0x2e')]);_0xdc35b5[_0x4749('0x33')]=_[_0x4749('0x31')](_0x200080[_0x4749('0x32')],qs[_0x4749('0x34')](_0x37f293[_0x4749('0x2e')][_0x4749('0x34')]));_0xdc35b5[_0x4749('0x33')]=_0xdc35b5[_0x4749('0x33')][_0x4749('0x35')]?_0xdc35b5[_0x4749('0x33')]:_0x200080[_0x4749('0x32')];if(_0x37f293[_0x4749('0x2e')][_0x4749('0x3e')]){_0xdc35b5[_0x4749('0x43')]=[{'all':!![]}];}_0xdc35b5=_[_0x4749('0x3b')]({},_0xdc35b5,_0x37f293[_0x4749('0x3d')]);return db[_0x4749('0x28')]['find'](_0xdc35b5)[_0x4749('0x23')](handleEntityNotFound(_0x3ce12c,null))[_0x4749('0x23')](respondWithResult(_0x3ce12c,null))[_0x4749('0x40')](handleError(_0x3ce12c,null));};exports[_0x4749('0x44')]=function(_0x101b09,_0x4f28eb){return db[_0x4749('0x28')]['create'](_0x101b09[_0x4749('0x45')],{})[_0x4749('0x23')](respondWithResult(_0x4f28eb,0xc9))[_0x4749('0x40')](handleError(_0x4f28eb,null));};exports[_0x4749('0x22')]=function(_0x5a7157,_0x34aa3b){if(_0x5a7157[_0x4749('0x45')]['id']){delete _0x5a7157[_0x4749('0x45')]['id'];}return db[_0x4749('0x28')][_0x4749('0x46')]({'where':{'id':_0x5a7157[_0x4749('0x42')]['id']}})[_0x4749('0x23')](handleEntityNotFound(_0x34aa3b,null))[_0x4749('0x23')](saveUpdates(_0x5a7157[_0x4749('0x45')],null))['then'](respondWithResult(_0x34aa3b,null))['catch'](handleError(_0x34aa3b,null));};exports['destroy']=function(_0x2575b9,_0x59d910){return db[_0x4749('0x28')][_0x4749('0x46')]({'where':{'id':_0x2575b9[_0x4749('0x42')]['id']}})[_0x4749('0x23')](handleEntityNotFound(_0x59d910,null))[_0x4749('0x23')](removeEntity(_0x59d910,null))[_0x4749('0x40')](handleError(_0x59d910,null));};exports[_0x4749('0x47')]=function(_0x1bce0f,_0x22aa8a,_0x16a6d9){var _0x3b4636={};var _0x39f259={};var _0x194cac;var _0xa87fa3;return db[_0x4749('0x28')]['findOne']({'where':{'id':_0x1bce0f[_0x4749('0x42')]['id']}})[_0x4749('0x23')](handleEntityNotFound(_0x22aa8a,null))[_0x4749('0x23')](function(_0x4421b0){if(_0x4421b0){_0x194cac=_0x4421b0;_0x39f259['model']=_[_0x4749('0x2f')](db[_0x4749('0x48')]['rawAttributes']);_0x39f259[_0x4749('0x2e')]=_[_0x4749('0x2f')](_0x1bce0f[_0x4749('0x2e')]);_0x39f259['filters']=_[_0x4749('0x31')](_0x39f259[_0x4749('0x32')],_0x39f259['query']);_0x3b4636[_0x4749('0x33')]=_['intersection'](_0x39f259['model'],qs[_0x4749('0x34')](_0x1bce0f[_0x4749('0x2e')][_0x4749('0x34')]));_0x3b4636[_0x4749('0x33')]=_0x3b4636[_0x4749('0x33')][_0x4749('0x35')]?_0x3b4636['attributes']:_0x39f259[_0x4749('0x32')];_0x3b4636[_0x4749('0x37')]=qs[_0x4749('0x38')](_0x1bce0f['query'][_0x4749('0x38')]);_0x3b4636[_0x4749('0x3a')]=qs[_0x4749('0x30')](_[_0x4749('0x49')](_0x1bce0f[_0x4749('0x2e')],_0x39f259['filters']));if(_0x1bce0f[_0x4749('0x2e')]['filter']){_0x3b4636[_0x4749('0x3a')]=_[_0x4749('0x3b')](_0x3b4636[_0x4749('0x3a')],{'$or':_[_0x4749('0x2d')](_0x3b4636[_0x4749('0x33')],function(_0xdd114c){var _0x39a8bb={};_0x39a8bb[_0xdd114c]={'$like':'%'+_0x1bce0f[_0x4749('0x2e')][_0x4749('0x39')]+'%'};return _0x39a8bb;})});}_0x3b4636=_[_0x4749('0x3b')]({},_0x3b4636,_0x1bce0f[_0x4749('0x3d')]);return _0x194cac[_0x4749('0x47')](_0x3b4636);}})['then'](function(_0x297001){if(_0x297001){_0xa87fa3=_0x297001[_0x4749('0x35')];if(!_0x1bce0f[_0x4749('0x2e')]['hasOwnProperty']('nolimit')){_0x3b4636[_0x4749('0x1d')]=qs[_0x4749('0x1d')](_0x1bce0f['query'][_0x4749('0x1d')]);_0x3b4636[_0x4749('0x1b')]=qs[_0x4749('0x1b')](_0x1bce0f['query'][_0x4749('0x1b')]);}return _0x194cac[_0x4749('0x47')](_0x3b4636);}})[_0x4749('0x23')](function(_0x33fe69){if(_0x33fe69){return _0x33fe69?{'count':_0xa87fa3,'rows':_0x33fe69}:null;}})[_0x4749('0x23')](respondWithResult(_0x22aa8a,null))['catch'](handleError(_0x22aa8a,null));};exports[_0x4749('0x4a')]=function(_0x248946,_0x2aa30a,_0x42a37c){var _0x2bb34d={};var _0x262669={};var _0x56bd91;var _0x6efc;return db[_0x4749('0x28')]['findOne']({'where':{'id':_0x248946['params']['id']}})[_0x4749('0x23')](handleEntityNotFound(_0x2aa30a,null))[_0x4749('0x23')](function(_0x4aeb3f){if(_0x4aeb3f){_0x56bd91=_0x4aeb3f;_0x262669[_0x4749('0x32')]=_[_0x4749('0x2f')](db['DeskField'][_0x4749('0x29')]);_0x262669['query']=_[_0x4749('0x2f')](_0x248946[_0x4749('0x2e')]);_0x262669[_0x4749('0x30')]=_['intersection'](_0x262669[_0x4749('0x32')],_0x262669['query']);_0x2bb34d[_0x4749('0x33')]=_[_0x4749('0x31')](_0x262669[_0x4749('0x32')],qs[_0x4749('0x34')](_0x248946['query'][_0x4749('0x34')]));_0x2bb34d[_0x4749('0x33')]=_0x2bb34d[_0x4749('0x33')][_0x4749('0x35')]?_0x2bb34d['attributes']:_0x262669[_0x4749('0x32')];_0x2bb34d[_0x4749('0x37')]=qs[_0x4749('0x38')](_0x248946['query'][_0x4749('0x38')]);_0x2bb34d[_0x4749('0x3a')]=qs[_0x4749('0x30')](_[_0x4749('0x49')](_0x248946['query'],_0x262669[_0x4749('0x30')]));if(_0x248946[_0x4749('0x2e')]['filter']){_0x2bb34d['where']=_['merge'](_0x2bb34d[_0x4749('0x3a')],{'$or':_['map'](_0x2bb34d[_0x4749('0x33')],function(_0x226322){var _0x2d94c5={};_0x2d94c5[_0x226322]={'$like':'%'+_0x248946[_0x4749('0x2e')][_0x4749('0x39')]+'%'};return _0x2d94c5;})});}_0x2bb34d=_[_0x4749('0x3b')]({},_0x2bb34d,_0x248946[_0x4749('0x3d')]);return _0x56bd91['getSubjects'](_0x2bb34d);}})[_0x4749('0x23')](function(_0x319cda){if(_0x319cda){_0x6efc=_0x319cda['length'];if(!_0x248946[_0x4749('0x2e')][_0x4749('0x4b')]('nolimit')){_0x2bb34d[_0x4749('0x1d')]=qs[_0x4749('0x1d')](_0x248946[_0x4749('0x2e')][_0x4749('0x1d')]);_0x2bb34d['offset']=qs[_0x4749('0x1b')](_0x248946['query']['offset']);}return _0x56bd91['getSubjects'](_0x2bb34d);}})[_0x4749('0x23')](function(_0x2a3416){if(_0x2a3416){return _0x2a3416?{'count':_0x6efc,'rows':_0x2a3416}:null;}})[_0x4749('0x23')](respondWithResult(_0x2aa30a,null))[_0x4749('0x40')](handleError(_0x2aa30a,null));};exports[_0x4749('0x4c')]=function(_0x57cb89,_0x4d9cd6,_0x383f26){var _0x4896bc={};var _0x5d8d26={};var _0x4a672f;var _0x27d8ff;return db[_0x4749('0x28')]['findOne']({'where':{'id':_0x57cb89[_0x4749('0x42')]['id']}})[_0x4749('0x23')](handleEntityNotFound(_0x4d9cd6,null))[_0x4749('0x23')](function(_0xd20a8b){if(_0xd20a8b){_0x4a672f=_0xd20a8b;_0x5d8d26['model']=_['keys'](db[_0x4749('0x48')]['rawAttributes']);_0x5d8d26[_0x4749('0x2e')]=_['keys'](_0x57cb89[_0x4749('0x2e')]);_0x5d8d26[_0x4749('0x30')]=_[_0x4749('0x31')](_0x5d8d26[_0x4749('0x32')],_0x5d8d26[_0x4749('0x2e')]);_0x4896bc[_0x4749('0x33')]=_[_0x4749('0x31')](_0x5d8d26[_0x4749('0x32')],qs[_0x4749('0x34')](_0x57cb89[_0x4749('0x2e')][_0x4749('0x34')]));_0x4896bc['attributes']=_0x4896bc['attributes'][_0x4749('0x35')]?_0x4896bc[_0x4749('0x33')]:_0x5d8d26['model'];_0x4896bc[_0x4749('0x37')]=qs[_0x4749('0x38')](_0x57cb89[_0x4749('0x2e')][_0x4749('0x38')]);_0x4896bc[_0x4749('0x3a')]=qs[_0x4749('0x30')](_[_0x4749('0x49')](_0x57cb89[_0x4749('0x2e')],_0x5d8d26[_0x4749('0x30')]));if(_0x57cb89[_0x4749('0x2e')]['filter']){_0x4896bc[_0x4749('0x3a')]=_[_0x4749('0x3b')](_0x4896bc[_0x4749('0x3a')],{'$or':_['map'](_0x4896bc['attributes'],function(_0x5d59bb){var _0x580025={};_0x580025[_0x5d59bb]={'$like':'%'+_0x57cb89[_0x4749('0x2e')][_0x4749('0x39')]+'%'};return _0x580025;})});}_0x4896bc=_[_0x4749('0x3b')]({},_0x4896bc,_0x57cb89['options']);return _0x4a672f['getDescriptions'](_0x4896bc);}})[_0x4749('0x23')](function(_0x333a4f){if(_0x333a4f){_0x27d8ff=_0x333a4f['length'];if(!_0x57cb89[_0x4749('0x2e')]['hasOwnProperty'](_0x4749('0x36'))){_0x4896bc['limit']=qs[_0x4749('0x1d')](_0x57cb89[_0x4749('0x2e')][_0x4749('0x1d')]);_0x4896bc[_0x4749('0x1b')]=qs['offset'](_0x57cb89[_0x4749('0x2e')][_0x4749('0x1b')]);}return _0x4a672f[_0x4749('0x4c')](_0x4896bc);}})[_0x4749('0x23')](function(_0x32ef17){if(_0x32ef17){return _0x32ef17?{'count':_0x27d8ff,'rows':_0x32ef17}:null;}})[_0x4749('0x23')](respondWithResult(_0x4d9cd6,null))[_0x4749('0x40')](handleError(_0x4d9cd6,null));};exports[_0x4749('0x4d')]=function(_0x5e6ebf,_0x233752,_0x494df0){var _0x5834ff={};var _0x2dbfef={};var _0x130225;var _0x489460;return db[_0x4749('0x28')]['findOne']({'where':{'id':_0x5e6ebf['params']['id']}})[_0x4749('0x23')](handleEntityNotFound(_0x233752,null))[_0x4749('0x23')](function(_0x54045b){if(_0x54045b){_0x130225=_0x54045b;_0x2dbfef['model']=_[_0x4749('0x2f')](db[_0x4749('0x4e')][_0x4749('0x29')]);_0x2dbfef[_0x4749('0x2e')]=_['keys'](_0x5e6ebf['query']);_0x2dbfef[_0x4749('0x30')]=_[_0x4749('0x31')](_0x2dbfef['model'],_0x2dbfef['query']);_0x5834ff['attributes']=_[_0x4749('0x31')](_0x2dbfef[_0x4749('0x32')],qs[_0x4749('0x34')](_0x5e6ebf[_0x4749('0x2e')][_0x4749('0x34')]));_0x5834ff[_0x4749('0x33')]=_0x5834ff[_0x4749('0x33')]['length']?_0x5834ff[_0x4749('0x33')]:_0x2dbfef[_0x4749('0x32')];_0x5834ff['order']=qs[_0x4749('0x38')](_0x5e6ebf[_0x4749('0x2e')][_0x4749('0x38')]);_0x5834ff[_0x4749('0x3a')]=qs['filters'](_[_0x4749('0x49')](_0x5e6ebf[_0x4749('0x2e')],_0x2dbfef[_0x4749('0x30')]));if(_0x5e6ebf[_0x4749('0x2e')]['filter']){_0x5834ff[_0x4749('0x3a')]=_[_0x4749('0x3b')](_0x5834ff['where'],{'$or':_['map'](_0x5834ff[_0x4749('0x33')],function(_0x29bde8){var _0x333e09={};_0x333e09[_0x29bde8]={'$like':'%'+_0x5e6ebf['query'][_0x4749('0x39')]+'%'};return _0x333e09;})});}_0x5834ff=_[_0x4749('0x3b')]({},_0x5834ff,_0x5e6ebf[_0x4749('0x3d')]);return _0x130225[_0x4749('0x4d')](_0x5834ff);}})[_0x4749('0x23')](function(_0x55466){if(_0x55466){_0x489460=_0x55466['length'];if(!_0x5e6ebf[_0x4749('0x2e')][_0x4749('0x4b')](_0x4749('0x36'))){_0x5834ff['limit']=qs[_0x4749('0x1d')](_0x5e6ebf[_0x4749('0x2e')]['limit']);_0x5834ff['offset']=qs[_0x4749('0x1b')](_0x5e6ebf[_0x4749('0x2e')]['offset']);}return _0x130225['getTags'](_0x5834ff);}})[_0x4749('0x23')](function(_0xe9ced0){if(_0xe9ced0){return _0xe9ced0?{'count':_0x489460,'rows':_0xe9ced0}:null;}})[_0x4749('0x23')](respondWithResult(_0x233752,null))[_0x4749('0x40')](handleError(_0x233752,null));};exports[_0x4749('0x4f')]=function(_0x526464,_0x2df046,_0x2d8097){if(_0x526464[_0x4749('0x45')]['id']){delete _0x526464[_0x4749('0x45')]['id'];}return db[_0x4749('0x28')][_0x4749('0x50')]({'where':{'id':_0x526464['params']['id']}})['then'](handleEntityNotFound(_0x2df046,null))['then'](function(_0x4bc969){if(_0x4bc969){return _0x4bc969[_0x4749('0x4f')](_0x526464['body']['ids']||[]);}return null;})[_0x4749('0x23')](respondWithResult(_0x2df046,null))[_0x4749('0x40')](handleError(_0x2df046,null));}; \ No newline at end of file +var _0x1fca=['update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','options','DeskConfiguration','include','findAll','rows','catch','params','find','create','body','destroy','findOne','DeskField','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','Content-Range','apply','reject','save'];(function(_0x7d248c,_0x7bffaf){var _0x536715=function(_0x35ced2){while(--_0x35ced2){_0x7d248c['push'](_0x7d248c['shift']());}};_0x536715(++_0x7bffaf);}(_0x1fca,0x130));var _0xa1fc=function(_0x1960b5,_0x1835a4){_0x1960b5=_0x1960b5-0x0;var _0x18f387=_0x1fca[_0x1960b5];return _0x18f387;};'use strict';var emlformat=require(_0xa1fc('0x0'));var rimraf=require(_0xa1fc('0x1'));var zipdir=require(_0xa1fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1fc('0x3'));var moment=require(_0xa1fc('0x4'));var BPromise=require(_0xa1fc('0x5'));var Mustache=require(_0xa1fc('0x6'));var util=require(_0xa1fc('0x7'));var path=require(_0xa1fc('0x8'));var sox=require(_0xa1fc('0x9'));var csv=require(_0xa1fc('0xa'));var ejs=require(_0xa1fc('0xb'));var fs=require('fs');var fs_extra=require(_0xa1fc('0xc'));var _=require(_0xa1fc('0xd'));var squel=require(_0xa1fc('0xe'));var crypto=require(_0xa1fc('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa1fc('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1fc('0x11'));var Papa=require(_0xa1fc('0x12'));var Redis=require('ioredis');var authService=require(_0xa1fc('0x13'));var qs=require(_0xa1fc('0x14'));var as=require(_0xa1fc('0x15'));var hardwareService=require(_0xa1fc('0x16'));var logger=require(_0xa1fc('0x17'))(_0xa1fc('0x18'));var utils=require(_0xa1fc('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa1fc('0x1a'))['db'];function respondWithStatusCode(_0x25143a,_0x346750){_0x346750=_0x346750||0xcc;return function(_0x577cef){if(_0x577cef){return _0x25143a['sendStatus'](_0x346750);}return _0x25143a[_0xa1fc('0x1b')](_0x346750)['end']();};}function respondWithResult(_0x53af5a,_0xa21cf0){_0xa21cf0=_0xa21cf0||0xc8;return function(_0x129d55){if(_0x129d55){return _0x53af5a[_0xa1fc('0x1b')](_0xa21cf0)[_0xa1fc('0x1c')](_0x129d55);}};}function respondWithFilteredResult(_0x447ccc,_0x412ad9){return function(_0x1c1c82){if(_0x1c1c82){var _0x47973a=typeof _0x412ad9[_0xa1fc('0x1d')]==='undefined'&&typeof _0x412ad9['limit']===_0xa1fc('0x1e');var _0x418e0b=_0x1c1c82[_0xa1fc('0x1f')];var _0x44f2d6=_0x47973a?0x0:_0x412ad9['offset'];var _0x2365d3=_0x47973a?_0x1c1c82[_0xa1fc('0x1f')]:_0x412ad9[_0xa1fc('0x1d')]+_0x412ad9['limit'];var _0xb11cd1;if(_0x2365d3>=_0x418e0b){_0x2365d3=_0x418e0b;_0xb11cd1=0xc8;}else{_0xb11cd1=0xce;}_0x447ccc[_0xa1fc('0x1b')](_0xb11cd1);return _0x447ccc['set'](_0xa1fc('0x20'),_0x44f2d6+'-'+_0x2365d3+'/'+_0x418e0b)['json'](_0x1c1c82);}return null;};}function patchUpdates(_0x42f912){return function(_0x5cacb0){try{jsonpatch[_0xa1fc('0x21')](_0x5cacb0,_0x42f912,!![]);}catch(_0x40d46c){return BPromise[_0xa1fc('0x22')](_0x40d46c);}return _0x5cacb0[_0xa1fc('0x23')]();};}function saveUpdates(_0x592340,_0x3d41bf){return function(_0x562a7){if(_0x562a7){return _0x562a7[_0xa1fc('0x24')](_0x592340)[_0xa1fc('0x25')](function(_0x5c9d99){return _0x5c9d99;});}return null;};}function removeEntity(_0x180fa4,_0x7980bb){return function(_0x5eb5b3){if(_0x5eb5b3){return _0x5eb5b3['destroy']()[_0xa1fc('0x25')](function(){_0x180fa4['status'](0xcc)[_0xa1fc('0x26')]();});}};}function handleEntityNotFound(_0x5549fd,_0x2790e9){return function(_0x4b8c85){if(!_0x4b8c85){_0x5549fd[_0xa1fc('0x27')](0x194);}return _0x4b8c85;};}function handleError(_0x326484,_0x58476b){_0x58476b=_0x58476b||0x1f4;return function(_0x524844){logger['error'](_0x524844[_0xa1fc('0x28')]);if(_0x524844['name']){delete _0x524844[_0xa1fc('0x29')];}_0x326484[_0xa1fc('0x1b')](_0x58476b)[_0xa1fc('0x2a')](_0x524844);};}exports[_0xa1fc('0x2b')]=function(_0x3e6f6a,_0x201d9b){var _0x563f24={},_0x41799f={},_0x598705={'count':0x0,'rows':[]};var _0x57092d=_['map'](db['DeskConfiguration'][_0xa1fc('0x2c')],function(_0x1cfa63){return{'name':_0x1cfa63[_0xa1fc('0x2d')],'type':_0x1cfa63[_0xa1fc('0x2e')][_0xa1fc('0x2f')]};});_0x41799f[_0xa1fc('0x30')]=_[_0xa1fc('0x31')](_0x57092d,'name');_0x41799f[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0x3e6f6a[_0xa1fc('0x32')]);_0x41799f['filters']=_['intersection'](_0x41799f[_0xa1fc('0x30')],_0x41799f['query']);_0x563f24[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x41799f[_0xa1fc('0x30')],qs['fields'](_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x563f24[_0xa1fc('0x34')]=_0x563f24[_0xa1fc('0x34')][_0xa1fc('0x37')]?_0x563f24[_0xa1fc('0x34')]:_0x41799f['model'];if(!_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x38')]('nolimit')){_0x563f24['limit']=qs['limit'](_0x3e6f6a['query'][_0xa1fc('0x39')]);_0x563f24['offset']=qs[_0xa1fc('0x1d')](_0x3e6f6a['query'][_0xa1fc('0x1d')]);}_0x563f24[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x3b')]);_0x563f24[_0xa1fc('0x3c')]=qs['filters'](_[_0xa1fc('0x3d')](_0x3e6f6a[_0xa1fc('0x32')],_0x41799f[_0xa1fc('0x3e')]),_0x57092d);if(_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x563f24[_0xa1fc('0x3c')]=_[_0xa1fc('0x40')](_0x563f24[_0xa1fc('0x3c')],{'$or':_[_0xa1fc('0x31')](_0x57092d,function(_0x4340a3){if(_0x4340a3['type']!=='VIRTUAL'){var _0x4f8956={};_0x4f8956[_0x4340a3[_0xa1fc('0x29')]]={'$like':'%'+_0x3e6f6a['query']['filter']+'%'};return _0x4f8956;}})});}_0x563f24=_[_0xa1fc('0x40')]({},_0x563f24,_0x3e6f6a[_0xa1fc('0x41')]);var _0x1463e1={'where':_0x563f24[_0xa1fc('0x3c')]};return db[_0xa1fc('0x42')][_0xa1fc('0x1f')](_0x1463e1)[_0xa1fc('0x25')](function(_0x4d3442){_0x598705[_0xa1fc('0x1f')]=_0x4d3442;if(_0x3e6f6a[_0xa1fc('0x32')]['includeAll']){_0x563f24[_0xa1fc('0x43')]=[{'all':!![]}];}return db[_0xa1fc('0x42')][_0xa1fc('0x44')](_0x563f24);})[_0xa1fc('0x25')](function(_0x48c88a){_0x598705[_0xa1fc('0x45')]=_0x48c88a;return _0x598705;})[_0xa1fc('0x25')](respondWithFilteredResult(_0x201d9b,_0x563f24))[_0xa1fc('0x46')](handleError(_0x201d9b,null));};exports['show']=function(_0x562aa4,_0x20a37d){var _0x1f44c2={'raw':![],'where':{'id':_0x562aa4[_0xa1fc('0x47')]['id']}},_0x2c1f6d={};_0x2c1f6d[_0xa1fc('0x30')]=_['keys'](db[_0xa1fc('0x42')][_0xa1fc('0x2c')]);_0x2c1f6d[_0xa1fc('0x32')]=_['keys'](_0x562aa4['query']);_0x2c1f6d[_0xa1fc('0x3e')]=_['intersection'](_0x2c1f6d['model'],_0x2c1f6d['query']);_0x1f44c2[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x2c1f6d[_0xa1fc('0x30')],qs[_0xa1fc('0x36')](_0x562aa4['query'][_0xa1fc('0x36')]));_0x1f44c2['attributes']=_0x1f44c2[_0xa1fc('0x34')]['length']?_0x1f44c2[_0xa1fc('0x34')]:_0x2c1f6d[_0xa1fc('0x30')];if(_0x562aa4[_0xa1fc('0x32')]['includeAll']){_0x1f44c2['include']=[{'all':!![]}];}_0x1f44c2=_[_0xa1fc('0x40')]({},_0x1f44c2,_0x562aa4[_0xa1fc('0x41')]);return db[_0xa1fc('0x42')][_0xa1fc('0x48')](_0x1f44c2)[_0xa1fc('0x25')](handleEntityNotFound(_0x20a37d,null))[_0xa1fc('0x25')](respondWithResult(_0x20a37d,null))[_0xa1fc('0x46')](handleError(_0x20a37d,null));};exports['create']=function(_0x1f4828,_0x324b16){return db['DeskConfiguration'][_0xa1fc('0x49')](_0x1f4828[_0xa1fc('0x4a')],{})[_0xa1fc('0x25')](respondWithResult(_0x324b16,0xc9))[_0xa1fc('0x46')](handleError(_0x324b16,null));};exports[_0xa1fc('0x24')]=function(_0x56bb2a,_0x4867c7){if(_0x56bb2a['body']['id']){delete _0x56bb2a['body']['id'];}return db[_0xa1fc('0x42')]['find']({'where':{'id':_0x56bb2a[_0xa1fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x4867c7,null))['then'](saveUpdates(_0x56bb2a[_0xa1fc('0x4a')],null))[_0xa1fc('0x25')](respondWithResult(_0x4867c7,null))[_0xa1fc('0x46')](handleError(_0x4867c7,null));};exports[_0xa1fc('0x4b')]=function(_0x53ff10,_0x1f5a2b){return db[_0xa1fc('0x42')][_0xa1fc('0x48')]({'where':{'id':_0x53ff10[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x1f5a2b,null))[_0xa1fc('0x25')](removeEntity(_0x1f5a2b,null))['catch'](handleError(_0x1f5a2b,null));};exports['getFields']=function(_0xb7c194,_0x21016c,_0x215080){var _0x3e7ad2={};var _0x1f70af={};var _0xbc518e;var _0x2cece9;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0xb7c194[_0xa1fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x21016c,null))[_0xa1fc('0x25')](function(_0x1bd50e){if(_0x1bd50e){_0xbc518e=_0x1bd50e;_0x1f70af[_0xa1fc('0x30')]=_[_0xa1fc('0x33')](db[_0xa1fc('0x4d')][_0xa1fc('0x2c')]);_0x1f70af[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0xb7c194[_0xa1fc('0x32')]);_0x1f70af[_0xa1fc('0x3e')]=_[_0xa1fc('0x35')](_0x1f70af['model'],_0x1f70af['query']);_0x3e7ad2[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x1f70af[_0xa1fc('0x30')],qs[_0xa1fc('0x36')](_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x3e7ad2[_0xa1fc('0x34')]=_0x3e7ad2['attributes'][_0xa1fc('0x37')]?_0x3e7ad2['attributes']:_0x1f70af[_0xa1fc('0x30')];_0x3e7ad2[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0xb7c194['query']['sort']);_0x3e7ad2['where']=qs[_0xa1fc('0x3e')](_['pick'](_0xb7c194[_0xa1fc('0x32')],_0x1f70af[_0xa1fc('0x3e')]));if(_0xb7c194['query']['filter']){_0x3e7ad2[_0xa1fc('0x3c')]=_['merge'](_0x3e7ad2[_0xa1fc('0x3c')],{'$or':_['map'](_0x3e7ad2[_0xa1fc('0x34')],function(_0x2a6003){var _0x16ce33={};_0x16ce33[_0x2a6003]={'$like':'%'+_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x3f')]+'%'};return _0x16ce33;})});}_0x3e7ad2=_['merge']({},_0x3e7ad2,_0xb7c194[_0xa1fc('0x41')]);return _0xbc518e[_0xa1fc('0x4e')](_0x3e7ad2);}})['then'](function(_0x12980f){if(_0x12980f){_0x2cece9=_0x12980f[_0xa1fc('0x37')];if(!_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x3e7ad2[_0xa1fc('0x39')]=qs[_0xa1fc('0x39')](_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x3e7ad2[_0xa1fc('0x1d')]=qs[_0xa1fc('0x1d')](_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x1d')]);}return _0xbc518e[_0xa1fc('0x4e')](_0x3e7ad2);}})[_0xa1fc('0x25')](function(_0x53172b){if(_0x53172b){return _0x53172b?{'count':_0x2cece9,'rows':_0x53172b}:null;}})[_0xa1fc('0x25')](respondWithResult(_0x21016c,null))[_0xa1fc('0x46')](handleError(_0x21016c,null));};exports[_0xa1fc('0x50')]=function(_0x4daedd,_0x5146ed,_0x3929c8){var _0x3237af={};var _0x580be3={};var _0x1d0f5f;var _0x5aa289;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0x4daedd['params']['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x5146ed,null))[_0xa1fc('0x25')](function(_0x512633){if(_0x512633){_0x1d0f5f=_0x512633;_0x580be3[_0xa1fc('0x30')]=_[_0xa1fc('0x33')](db[_0xa1fc('0x4d')][_0xa1fc('0x2c')]);_0x580be3[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0x4daedd[_0xa1fc('0x32')]);_0x580be3['filters']=_[_0xa1fc('0x35')](_0x580be3['model'],_0x580be3['query']);_0x3237af[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x580be3[_0xa1fc('0x30')],qs['fields'](_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x3237af[_0xa1fc('0x34')]=_0x3237af['attributes']['length']?_0x3237af[_0xa1fc('0x34')]:_0x580be3[_0xa1fc('0x30')];_0x3237af[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0x4daedd[_0xa1fc('0x32')]['sort']);_0x3237af[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3e')](_[_0xa1fc('0x3d')](_0x4daedd[_0xa1fc('0x32')],_0x580be3[_0xa1fc('0x3e')]));if(_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x3237af[_0xa1fc('0x3c')]=_[_0xa1fc('0x40')](_0x3237af[_0xa1fc('0x3c')],{'$or':_[_0xa1fc('0x31')](_0x3237af[_0xa1fc('0x34')],function(_0x723c06){var _0x26b6f8={};_0x26b6f8[_0x723c06]={'$like':'%'+_0x4daedd[_0xa1fc('0x32')]['filter']+'%'};return _0x26b6f8;})});}_0x3237af=_[_0xa1fc('0x40')]({},_0x3237af,_0x4daedd[_0xa1fc('0x41')]);return _0x1d0f5f[_0xa1fc('0x50')](_0x3237af);}})[_0xa1fc('0x25')](function(_0x4f4295){if(_0x4f4295){_0x5aa289=_0x4f4295[_0xa1fc('0x37')];if(!_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x3237af[_0xa1fc('0x39')]=qs['limit'](_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x3237af[_0xa1fc('0x1d')]=qs[_0xa1fc('0x1d')](_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x1d')]);}return _0x1d0f5f['getSubjects'](_0x3237af);}})[_0xa1fc('0x25')](function(_0x43cbd9){if(_0x43cbd9){return _0x43cbd9?{'count':_0x5aa289,'rows':_0x43cbd9}:null;}})['then'](respondWithResult(_0x5146ed,null))[_0xa1fc('0x46')](handleError(_0x5146ed,null));};exports[_0xa1fc('0x51')]=function(_0x3ccf9a,_0x40770c,_0x912c68){var _0x2dcea7={};var _0x3b7cd2={};var _0xf054b5;var _0x476e91;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0x3ccf9a[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x40770c,null))[_0xa1fc('0x25')](function(_0x4ba82b){if(_0x4ba82b){_0xf054b5=_0x4ba82b;_0x3b7cd2[_0xa1fc('0x30')]=_['keys'](db[_0xa1fc('0x4d')][_0xa1fc('0x2c')]);_0x3b7cd2[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0x3ccf9a[_0xa1fc('0x32')]);_0x3b7cd2[_0xa1fc('0x3e')]=_[_0xa1fc('0x35')](_0x3b7cd2[_0xa1fc('0x30')],_0x3b7cd2[_0xa1fc('0x32')]);_0x2dcea7[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x3b7cd2[_0xa1fc('0x30')],qs[_0xa1fc('0x36')](_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x2dcea7[_0xa1fc('0x34')]=_0x2dcea7[_0xa1fc('0x34')][_0xa1fc('0x37')]?_0x2dcea7[_0xa1fc('0x34')]:_0x3b7cd2['model'];_0x2dcea7[_0xa1fc('0x3a')]=qs['sort'](_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x3b')]);_0x2dcea7[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3e')](_[_0xa1fc('0x3d')](_0x3ccf9a[_0xa1fc('0x32')],_0x3b7cd2['filters']));if(_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x2dcea7[_0xa1fc('0x3c')]=_[_0xa1fc('0x40')](_0x2dcea7['where'],{'$or':_['map'](_0x2dcea7[_0xa1fc('0x34')],function(_0x2bfb14){var _0x1775a4={};_0x1775a4[_0x2bfb14]={'$like':'%'+_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x3f')]+'%'};return _0x1775a4;})});}_0x2dcea7=_[_0xa1fc('0x40')]({},_0x2dcea7,_0x3ccf9a[_0xa1fc('0x41')]);return _0xf054b5[_0xa1fc('0x51')](_0x2dcea7);}})[_0xa1fc('0x25')](function(_0x5ccac1){if(_0x5ccac1){_0x476e91=_0x5ccac1[_0xa1fc('0x37')];if(!_0x3ccf9a['query'][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x2dcea7[_0xa1fc('0x39')]=qs[_0xa1fc('0x39')](_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x2dcea7[_0xa1fc('0x1d')]=qs['offset'](_0x3ccf9a['query'][_0xa1fc('0x1d')]);}return _0xf054b5[_0xa1fc('0x51')](_0x2dcea7);}})[_0xa1fc('0x25')](function(_0x4698d7){if(_0x4698d7){return _0x4698d7?{'count':_0x476e91,'rows':_0x4698d7}:null;}})['then'](respondWithResult(_0x40770c,null))[_0xa1fc('0x46')](handleError(_0x40770c,null));};exports[_0xa1fc('0x52')]=function(_0xfe51dc,_0x306f00,_0x1998c5){var _0x444ae3={};var _0x4d7426={};var _0x1c2875;var _0x24ca7b;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0xfe51dc[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x306f00,null))[_0xa1fc('0x25')](function(_0x3c63e0){if(_0x3c63e0){_0x1c2875=_0x3c63e0;_0x4d7426['model']=_[_0xa1fc('0x33')](db[_0xa1fc('0x53')][_0xa1fc('0x2c')]);_0x4d7426[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0xfe51dc[_0xa1fc('0x32')]);_0x4d7426[_0xa1fc('0x3e')]=_['intersection'](_0x4d7426[_0xa1fc('0x30')],_0x4d7426[_0xa1fc('0x32')]);_0x444ae3[_0xa1fc('0x34')]=_['intersection'](_0x4d7426[_0xa1fc('0x30')],qs['fields'](_0xfe51dc['query'][_0xa1fc('0x36')]));_0x444ae3[_0xa1fc('0x34')]=_0x444ae3[_0xa1fc('0x34')][_0xa1fc('0x37')]?_0x444ae3[_0xa1fc('0x34')]:_0x4d7426[_0xa1fc('0x30')];_0x444ae3[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0xfe51dc[_0xa1fc('0x32')]['sort']);_0x444ae3['where']=qs[_0xa1fc('0x3e')](_[_0xa1fc('0x3d')](_0xfe51dc[_0xa1fc('0x32')],_0x4d7426[_0xa1fc('0x3e')]));if(_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x444ae3['where']=_['merge'](_0x444ae3[_0xa1fc('0x3c')],{'$or':_[_0xa1fc('0x31')](_0x444ae3[_0xa1fc('0x34')],function(_0x43d2dd){var _0x6efff1={};_0x6efff1[_0x43d2dd]={'$like':'%'+_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x3f')]+'%'};return _0x6efff1;})});}_0x444ae3=_[_0xa1fc('0x40')]({},_0x444ae3,_0xfe51dc[_0xa1fc('0x41')]);return _0x1c2875[_0xa1fc('0x52')](_0x444ae3);}})[_0xa1fc('0x25')](function(_0x4a8d10){if(_0x4a8d10){_0x24ca7b=_0x4a8d10[_0xa1fc('0x37')];if(!_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x444ae3[_0xa1fc('0x39')]=qs['limit'](_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x444ae3['offset']=qs['offset'](_0xfe51dc[_0xa1fc('0x32')]['offset']);}return _0x1c2875[_0xa1fc('0x52')](_0x444ae3);}})[_0xa1fc('0x25')](function(_0x106b82){if(_0x106b82){return _0x106b82?{'count':_0x24ca7b,'rows':_0x106b82}:null;}})[_0xa1fc('0x25')](respondWithResult(_0x306f00,null))[_0xa1fc('0x46')](handleError(_0x306f00,null));};exports['setTags']=function(_0x3d48e7,_0x512405,_0x270889){if(_0x3d48e7['body']['id']){delete _0x3d48e7[_0xa1fc('0x4a')]['id'];}return db['DeskConfiguration'][_0xa1fc('0x4c')]({'where':{'id':_0x3d48e7['params']['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x512405,null))[_0xa1fc('0x25')](function(_0x1c9a06){if(_0x1c9a06){return _0x1c9a06['setTags'](_0x3d48e7[_0xa1fc('0x4a')][_0xa1fc('0x54')]||[]);}return null;})[_0xa1fc('0x25')](respondWithResult(_0x512405,null))[_0xa1fc('0x46')](handleError(_0x512405,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index f790b1c..2a834eb 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 _0xcd6a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','DeskConfiguration','int_desk_configurations'];(function(_0x20cfe6,_0x2c5534){var _0x1dbdcf=function(_0x4cba31){while(--_0x4cba31){_0x20cfe6['push'](_0x20cfe6['shift']());}};_0x1dbdcf(++_0x2c5534);}(_0xcd6a,0xbe));var _0xacd6=function(_0x5d4588,_0x3afa2e){_0x5d4588=_0x5d4588-0x0;var _0xb15e44=_0xcd6a[_0x5d4588];return _0xb15e44;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xacd6('0x0'))(_0xacd6('0x1'));var moment=require(_0xacd6('0x2'));var BPromise=require(_0xacd6('0x3'));var rp=require(_0xacd6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacd6('0x5'));var config=require(_0xacd6('0x6'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x16dee0,_0x36efb4){return _0x16dee0[_0xacd6('0x7')](_0xacd6('0x8'),attributes,{'tableName':_0xacd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc92f=['util','api','moment','bluebird','request-promise','../../config/environment','define','DeskConfiguration'];(function(_0x3c3c13,_0x34598c){var _0x2f7928=function(_0x1af637){while(--_0x1af637){_0x3c3c13['push'](_0x3c3c13['shift']());}};_0x2f7928(++_0x34598c);}(_0xc92f,0x140));var _0xfc92=function(_0x4735dc,_0x2c6039){_0x4735dc=_0x4735dc-0x0;var _0x22e40e=_0xc92f[_0x4735dc];return _0x22e40e;};'use strict';var _=require('lodash');var util=require(_0xfc92('0x0'));var logger=require('../../config/logger')(_0xfc92('0x1'));var moment=require(_0xfc92('0x2'));var BPromise=require(_0xfc92('0x3'));var rp=require(_0xfc92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfc92('0x5'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x4a23ca,_0xe54672){return _0x4a23ca[_0xfc92('0x6')](_0xfc92('0x7'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 2042e64..84162b0 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 _0xaf23=['jayson/promise','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x176d58,_0x329fcd){var _0x191a96=function(_0x2ff3b0){while(--_0x2ff3b0){_0x176d58['push'](_0x176d58['shift']());}};_0x191a96(++_0x329fcd);}(_0xaf23,0x11a));var _0x3af2=function(_0x58e2fb,_0x10888e){_0x58e2fb=_0x58e2fb-0x0;var _0xf4b221=_0xaf23[_0x58e2fb];return _0xf4b221;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3af2('0x0'));var BPromise=require(_0x3af2('0x1'));var rs=require(_0x3af2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3af2('0x3'))['db'];var utils=require(_0x3af2('0x4'));var logger=require('../../config/logger')(_0x3af2('0x5'));var config=require('../../config/environment');var jayson=require(_0x3af2('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x141c5e,_0x1af3de,_0x6df222){return new BPromise(function(_0x27b4b0,_0x587abd){return client[_0x3af2('0x7')](_0x141c5e,_0x6df222)['then'](function(_0x23ebd8){logger['info'](_0x3af2('0x8'),_0x1af3de,_0x3af2('0x9'));logger[_0x3af2('0xa')](_0x3af2('0xb'),_0x1af3de,_0x3af2('0x9'),JSON[_0x3af2('0xc')](_0x23ebd8));if(_0x23ebd8[_0x3af2('0xd')]){if(_0x23ebd8[_0x3af2('0xd')][_0x3af2('0xe')]===0x1f4){logger[_0x3af2('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x1af3de,_0x23ebd8[_0x3af2('0xd')][_0x3af2('0xf')]);return _0x587abd(_0x23ebd8[_0x3af2('0xd')]['message']);}logger['error'](_0x3af2('0x8'),_0x1af3de,_0x23ebd8[_0x3af2('0xd')][_0x3af2('0xf')]);return _0x27b4b0(_0x23ebd8[_0x3af2('0xd')]['message']);}else{logger[_0x3af2('0x10')](_0x3af2('0x8'),_0x1af3de,_0x3af2('0x9'));_0x27b4b0(_0x23ebd8['result'][_0x3af2('0xf')]);}})[_0x3af2('0x11')](function(_0x21f087){logger[_0x3af2('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x1af3de,_0x21f087);_0x587abd(_0x21f087);});});} \ No newline at end of file +var _0xdac7=['error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa522f,_0x5debbc){var _0x2083b0=function(_0x288f01){while(--_0x288f01){_0xa522f['push'](_0xa522f['shift']());}};_0x2083b0(++_0x5debbc);}(_0xdac7,0x180));var _0x7dac=function(_0x3f276e,_0x3c4891){_0x3f276e=_0x3f276e-0x0;var _0x135142=_0xdac7[_0x3f276e];return _0x135142;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dac('0x2'));var db=require(_0x7dac('0x3'))['db'];var utils=require(_0x7dac('0x4'));var logger=require(_0x7dac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dac('0x6')][_0x7dac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505705,_0x28cc84,_0x53c460){return new BPromise(function(_0x3b319f,_0x5ccf75){return client[_0x7dac('0x8')](_0x505705,_0x53c460)[_0x7dac('0x9')](function(_0x45fbdc){logger[_0x7dac('0xa')](_0x7dac('0xb'),_0x28cc84,_0x7dac('0xc'));logger[_0x7dac('0xd')](_0x7dac('0xe'),_0x28cc84,_0x7dac('0xc'),JSON[_0x7dac('0xf')](_0x45fbdc));if(_0x45fbdc['error']){if(_0x45fbdc['error']['code']===0x1f4){logger[_0x7dac('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x28cc84,_0x45fbdc[_0x7dac('0x10')]['message']);return _0x5ccf75(_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);}logger[_0x7dac('0x10')](_0x7dac('0xb'),_0x28cc84,_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);return _0x3b319f(_0x45fbdc[_0x7dac('0x10')]['message']);}else{logger[_0x7dac('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x28cc84,'request\x20sent');_0x3b319f(_0x45fbdc[_0x7dac('0x12')][_0x7dac('0x11')]);}})[_0x7dac('0x13')](function(_0x2de4ea){logger[_0x7dac('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x28cc84,_0x2de4ea);_0x5ccf75(_0x2de4ea);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 0d5a56d..41a7558 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 _0x33c8=['fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express'];(function(_0x5741c0,_0x41905e){var _0xfeb6a5=function(_0x5dc7ca){while(--_0x5dc7ca){_0x5741c0['push'](_0x5741c0['shift']());}};_0xfeb6a5(++_0x41905e);}(_0x33c8,0xf2));var _0x833c=function(_0xf2faa3,_0x4a77a7){_0xf2faa3=_0xf2faa3-0x0;var _0x34b2fe=_0x33c8[_0xf2faa3];return _0x34b2fe;};'use strict';var multer=require(_0x833c('0x0'));var util=require(_0x833c('0x1'));var path=require(_0x833c('0x2'));var timeout=require(_0x833c('0x3'));var express=require(_0x833c('0x4'));var router=express['Router']();var fs_extra=require(_0x833c('0x5'));var auth=require(_0x833c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x833c('0x7'));var controller=require(_0x833c('0x8'));router[_0x833c('0x9')]('/',auth[_0x833c('0xa')](),controller[_0x833c('0xb')]);router[_0x833c('0x9')]('/:id',auth[_0x833c('0xa')](),controller['show']);router[_0x833c('0xc')]('/',auth['isAuthenticated'](),controller[_0x833c('0xd')]);router[_0x833c('0xe')]('/:id',auth[_0x833c('0xa')](),controller[_0x833c('0xf')]);router[_0x833c('0x10')](_0x833c('0x11'),auth[_0x833c('0xa')](),controller['destroy']);module[_0x833c('0x12')]=router; \ No newline at end of file +var _0xb68a=['./intDeskField.controller','isAuthenticated','index','get','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5733e8,_0x3e3080){var _0x99327e=function(_0x3fc6ae){while(--_0x3fc6ae){_0x5733e8['push'](_0x5733e8['shift']());}};_0x99327e(++_0x3e3080);}(_0xb68a,0x93));var _0xab68=function(_0x11f1f4,_0x189cf3){_0x11f1f4=_0x11f1f4-0x0;var _0x6d3dec=_0xb68a[_0x11f1f4];return _0x6d3dec;};'use strict';var multer=require(_0xab68('0x0'));var util=require('util');var path=require(_0xab68('0x1'));var timeout=require('connect-timeout');var express=require(_0xab68('0x2'));var router=express[_0xab68('0x3')]();var fs_extra=require(_0xab68('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xab68('0x5'));var config=require('../../config/environment');var controller=require(_0xab68('0x6'));router['get']('/',auth[_0xab68('0x7')](),controller[_0xab68('0x8')]);router[_0xab68('0x9')]('/:id',auth[_0xab68('0x7')](),controller['show']);router[_0xab68('0xa')]('/',auth[_0xab68('0x7')](),controller[_0xab68('0xb')]);router[_0xab68('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xab68('0xd')]);router[_0xab68('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xab68('0xf')]);module[_0xab68('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 8944650..28d0c13 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 _0x0831=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2fbf0c,_0x1b4f2e){var _0x125b93=function(_0x135173){while(--_0x135173){_0x2fbf0c['push'](_0x2fbf0c['shift']());}};_0x125b93(++_0x1b4f2e);}(_0x0831,0x198));var _0x1083=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x0831[_0x1305e3];return _0x1068e9;};'use strict';var Sequelize=require(_0x1083('0x0'));module[_0x1083('0x1')]={'type':{'type':Sequelize[_0x1083('0x2')](_0x1083('0x3'),_0x1083('0x4'),_0x1083('0x5'),_0x1083('0x6'),_0x1083('0x7')),'defaultValue':_0x1083('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1083('0x8')]},'keyType':{'type':Sequelize[_0x1083('0x2')](_0x1083('0x3'),_0x1083('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1083('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1083('0x8')]}}; \ No newline at end of file +var _0x15fd=['BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','STRING','string'];(function(_0xbe7320,_0x106a76){var _0x43f0a9=function(_0x1ecd82){while(--_0x1ecd82){_0xbe7320['push'](_0xbe7320['shift']());}};_0x43f0a9(++_0x106a76);}(_0x15fd,0xf4));var _0xd15f=function(_0x1c99d7,_0x47744c){_0x1c99d7=_0x1c99d7-0x0;var _0x513a7b=_0x15fd[_0x1c99d7];return _0x513a7b;};'use strict';var Sequelize=require(_0xd15f('0x0'));module[_0xd15f('0x1')]={'type':{'type':Sequelize[_0xd15f('0x2')]('string',_0xd15f('0x3'),'customVariable',_0xd15f('0x4'),_0xd15f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd15f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd15f('0x7'),_0xd15f('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd15f('0x6')]},'idField':{'type':Sequelize[_0xd15f('0x6')]},'nameField':{'type':Sequelize[_0xd15f('0x6')]},'customField':{'type':Sequelize[_0xd15f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd15f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index b561a4a..b6d0d6d 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 _0xef96=['rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','DeskField','findAll','rows','show','params','intersection','find','catch','create','body','update','eml-format'];(function(_0x8eea3e,_0x10e5d6){var _0x50e5b6=function(_0x8968b3){while(--_0x8968b3){_0x8eea3e['push'](_0x8eea3e['shift']());}};_0x50e5b6(++_0x10e5d6);}(_0xef96,0x162));var _0x6ef9=function(_0x35546a,_0x422ad6){_0x35546a=_0x35546a-0x0;var _0x330fe2=_0xef96[_0x35546a];return _0x330fe2;};'use strict';var emlformat=require(_0x6ef9('0x0'));var rimraf=require(_0x6ef9('0x1'));var zipdir=require(_0x6ef9('0x2'));var jsonpatch=require(_0x6ef9('0x3'));var rp=require(_0x6ef9('0x4'));var moment=require(_0x6ef9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ef9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6ef9('0x7'));var ejs=require(_0x6ef9('0x8'));var fs=require('fs');var fs_extra=require(_0x6ef9('0x9'));var _=require('lodash');var squel=require(_0x6ef9('0xa'));var crypto=require('crypto');var jsforce=require(_0x6ef9('0xb'));var deskjs=require(_0x6ef9('0xc'));var toCsv=require(_0x6ef9('0x7'));var querystring=require('querystring');var Papa=require(_0x6ef9('0xd'));var Redis=require('ioredis');var authService=require(_0x6ef9('0xe'));var qs=require(_0x6ef9('0xf'));var as=require(_0x6ef9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef9('0x11'))(_0x6ef9('0x12'));var utils=require(_0x6ef9('0x13'));var config=require(_0x6ef9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ef9('0x15'))['db'];function respondWithStatusCode(_0x428156,_0x2e732f){_0x2e732f=_0x2e732f||0xcc;return function(_0x100591){if(_0x100591){return _0x428156[_0x6ef9('0x16')](_0x2e732f);}return _0x428156[_0x6ef9('0x17')](_0x2e732f)[_0x6ef9('0x18')]();};}function respondWithResult(_0x5e2fc1,_0x24681e){_0x24681e=_0x24681e||0xc8;return function(_0x2942bc){if(_0x2942bc){return _0x5e2fc1[_0x6ef9('0x17')](_0x24681e)[_0x6ef9('0x19')](_0x2942bc);}};}function respondWithFilteredResult(_0xce5672,_0x297af7){return function(_0x2c373c){if(_0x2c373c){var _0x253b13=typeof _0x297af7[_0x6ef9('0x1a')]==='undefined'&&typeof _0x297af7[_0x6ef9('0x1b')]===_0x6ef9('0x1c');var _0x4fac02=_0x2c373c['count'];var _0x1cb130=_0x253b13?0x0:_0x297af7['offset'];var _0x1855e1=_0x253b13?_0x2c373c[_0x6ef9('0x1d')]:_0x297af7[_0x6ef9('0x1a')]+_0x297af7[_0x6ef9('0x1b')];var _0x1d975c;if(_0x1855e1>=_0x4fac02){_0x1855e1=_0x4fac02;_0x1d975c=0xc8;}else{_0x1d975c=0xce;}_0xce5672[_0x6ef9('0x17')](_0x1d975c);return _0xce5672['set']('Content-Range',_0x1cb130+'-'+_0x1855e1+'/'+_0x4fac02)[_0x6ef9('0x19')](_0x2c373c);}return null;};}function patchUpdates(_0x243de4){return function(_0x587d43){try{jsonpatch[_0x6ef9('0x1e')](_0x587d43,_0x243de4,!![]);}catch(_0x3e74d2){return BPromise[_0x6ef9('0x1f')](_0x3e74d2);}return _0x587d43[_0x6ef9('0x20')]();};}function saveUpdates(_0x168cd5,_0x1ef6ee){return function(_0x404515){if(_0x404515){return _0x404515['update'](_0x168cd5)['then'](function(_0xae1b6e){return _0xae1b6e;});}return null;};}function removeEntity(_0x35bc5e,_0x4d664d){return function(_0x49faeb){if(_0x49faeb){return _0x49faeb[_0x6ef9('0x21')]()['then'](function(){_0x35bc5e[_0x6ef9('0x17')](0xcc)[_0x6ef9('0x18')]();});}};}function handleEntityNotFound(_0xdbc856,_0x383197){return function(_0x1bdb00){if(!_0x1bdb00){_0xdbc856[_0x6ef9('0x16')](0x194);}return _0x1bdb00;};}function handleError(_0x196ec0,_0x4f6c85){_0x4f6c85=_0x4f6c85||0x1f4;return function(_0x2e503b){logger['error'](_0x2e503b[_0x6ef9('0x22')]);if(_0x2e503b[_0x6ef9('0x23')]){delete _0x2e503b[_0x6ef9('0x23')];}_0x196ec0[_0x6ef9('0x17')](_0x4f6c85)[_0x6ef9('0x24')](_0x2e503b);};}exports[_0x6ef9('0x25')]=function(_0x212d32,_0x4eb696){var _0x57f6f9={},_0x569649={},_0x50750d={'count':0x0,'rows':[]};var _0x5e0a13=_[_0x6ef9('0x26')](db['DeskField'][_0x6ef9('0x27')],function(_0x5a8f0c){return{'name':_0x5a8f0c[_0x6ef9('0x28')],'type':_0x5a8f0c[_0x6ef9('0x29')][_0x6ef9('0x2a')]};});_0x569649[_0x6ef9('0x2b')]=_['map'](_0x5e0a13,_0x6ef9('0x23'));_0x569649[_0x6ef9('0x2c')]=_[_0x6ef9('0x2d')](_0x212d32['query']);_0x569649[_0x6ef9('0x2e')]=_['intersection'](_0x569649[_0x6ef9('0x2b')],_0x569649[_0x6ef9('0x2c')]);_0x57f6f9[_0x6ef9('0x2f')]=_['intersection'](_0x569649[_0x6ef9('0x2b')],qs[_0x6ef9('0x30')](_0x212d32['query'][_0x6ef9('0x30')]));_0x57f6f9[_0x6ef9('0x2f')]=_0x57f6f9[_0x6ef9('0x2f')][_0x6ef9('0x31')]?_0x57f6f9[_0x6ef9('0x2f')]:_0x569649[_0x6ef9('0x2b')];if(!_0x212d32['query']['hasOwnProperty']('nolimit')){_0x57f6f9['limit']=qs[_0x6ef9('0x1b')](_0x212d32['query']['limit']);_0x57f6f9[_0x6ef9('0x1a')]=qs[_0x6ef9('0x1a')](_0x212d32['query'][_0x6ef9('0x1a')]);}_0x57f6f9['order']=qs['sort'](_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x32')]);_0x57f6f9['where']=qs[_0x6ef9('0x2e')](_[_0x6ef9('0x33')](_0x212d32[_0x6ef9('0x2c')],_0x569649['filters']),_0x5e0a13);if(_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x34')]){_0x57f6f9[_0x6ef9('0x35')]=_[_0x6ef9('0x36')](_0x57f6f9['where'],{'$or':_[_0x6ef9('0x26')](_0x5e0a13,function(_0x2d6370){if(_0x2d6370['type']!==_0x6ef9('0x37')){var _0x305c34={};_0x305c34[_0x2d6370['name']]={'$like':'%'+_0x212d32[_0x6ef9('0x2c')][_0x6ef9('0x34')]+'%'};return _0x305c34;}})});}_0x57f6f9=_[_0x6ef9('0x36')]({},_0x57f6f9,_0x212d32[_0x6ef9('0x38')]);var _0x43a62b={'where':_0x57f6f9[_0x6ef9('0x35')]};return db['DeskField'][_0x6ef9('0x1d')](_0x43a62b)[_0x6ef9('0x39')](function(_0x5e275a){_0x50750d[_0x6ef9('0x1d')]=_0x5e275a;if(_0x212d32['query'][_0x6ef9('0x3a')]){_0x57f6f9[_0x6ef9('0x3b')]=[{'all':!![]}];}return db[_0x6ef9('0x3c')][_0x6ef9('0x3d')](_0x57f6f9);})[_0x6ef9('0x39')](function(_0x4e6f10){_0x50750d[_0x6ef9('0x3e')]=_0x4e6f10;return _0x50750d;})[_0x6ef9('0x39')](respondWithFilteredResult(_0x4eb696,_0x57f6f9))['catch'](handleError(_0x4eb696,null));};exports[_0x6ef9('0x3f')]=function(_0x150cf8,_0x42382e){var _0x335fbf={'raw':!![],'where':{'id':_0x150cf8[_0x6ef9('0x40')]['id']}},_0x4fcd39={};_0x4fcd39[_0x6ef9('0x2b')]=_[_0x6ef9('0x2d')](db[_0x6ef9('0x3c')][_0x6ef9('0x27')]);_0x4fcd39['query']=_['keys'](_0x150cf8['query']);_0x4fcd39[_0x6ef9('0x2e')]=_[_0x6ef9('0x41')](_0x4fcd39['model'],_0x4fcd39[_0x6ef9('0x2c')]);_0x335fbf[_0x6ef9('0x2f')]=_['intersection'](_0x4fcd39[_0x6ef9('0x2b')],qs['fields'](_0x150cf8[_0x6ef9('0x2c')][_0x6ef9('0x30')]));_0x335fbf[_0x6ef9('0x2f')]=_0x335fbf[_0x6ef9('0x2f')][_0x6ef9('0x31')]?_0x335fbf['attributes']:_0x4fcd39[_0x6ef9('0x2b')];if(_0x150cf8[_0x6ef9('0x2c')][_0x6ef9('0x3a')]){_0x335fbf[_0x6ef9('0x3b')]=[{'all':!![]}];}_0x335fbf=_[_0x6ef9('0x36')]({},_0x335fbf,_0x150cf8[_0x6ef9('0x38')]);return db['DeskField'][_0x6ef9('0x42')](_0x335fbf)[_0x6ef9('0x39')](handleEntityNotFound(_0x42382e,null))[_0x6ef9('0x39')](respondWithResult(_0x42382e,null))[_0x6ef9('0x43')](handleError(_0x42382e,null));};exports[_0x6ef9('0x44')]=function(_0xdf2b5b,_0x2d3d8e){return db['DeskField'][_0x6ef9('0x44')](_0xdf2b5b[_0x6ef9('0x45')],{})[_0x6ef9('0x39')](respondWithResult(_0x2d3d8e,0xc9))[_0x6ef9('0x43')](handleError(_0x2d3d8e,null));};exports[_0x6ef9('0x46')]=function(_0x397258,_0x22cd98){if(_0x397258[_0x6ef9('0x45')]['id']){delete _0x397258['body']['id'];}return db[_0x6ef9('0x3c')][_0x6ef9('0x42')]({'where':{'id':_0x397258['params']['id']}})[_0x6ef9('0x39')](handleEntityNotFound(_0x22cd98,null))['then'](saveUpdates(_0x397258[_0x6ef9('0x45')],null))[_0x6ef9('0x39')](respondWithResult(_0x22cd98,null))['catch'](handleError(_0x22cd98,null));};exports[_0x6ef9('0x21')]=function(_0x39f1a8,_0x17cac8){return db[_0x6ef9('0x3c')][_0x6ef9('0x42')]({'where':{'id':_0x39f1a8['params']['id']}})[_0x6ef9('0x39')](handleEntityNotFound(_0x17cac8,null))[_0x6ef9('0x39')](removeEntity(_0x17cac8,null))[_0x6ef9('0x43')](handleError(_0x17cac8,null));}; \ No newline at end of file +var _0xf603=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','find','catch','body'];(function(_0x5b7b39,_0xd7c076){var _0x2037b5=function(_0x4d8903){while(--_0x4d8903){_0x5b7b39['push'](_0x5b7b39['shift']());}};_0x2037b5(++_0xd7c076);}(_0xf603,0x124));var _0x3f60=function(_0x5004b9,_0x3f29c5){_0x5004b9=_0x5004b9-0x0;var _0x5a6701=_0xf603[_0x5004b9];return _0x5a6701;};'use strict';var emlformat=require(_0x3f60('0x0'));var rimraf=require(_0x3f60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f60('0x2'));var rp=require(_0x3f60('0x3'));var moment=require(_0x3f60('0x4'));var BPromise=require(_0x3f60('0x5'));var Mustache=require(_0x3f60('0x6'));var util=require(_0x3f60('0x7'));var path=require(_0x3f60('0x8'));var sox=require(_0x3f60('0x9'));var csv=require(_0x3f60('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3f60('0xb'));var crypto=require(_0x3f60('0xc'));var jsforce=require(_0x3f60('0xd'));var deskjs=require(_0x3f60('0xe'));var toCsv=require(_0x3f60('0xa'));var querystring=require(_0x3f60('0xf'));var Papa=require(_0x3f60('0x10'));var Redis=require(_0x3f60('0x11'));var authService=require(_0x3f60('0x12'));var qs=require(_0x3f60('0x13'));var as=require(_0x3f60('0x14'));var hardwareService=require(_0x3f60('0x15'));var logger=require(_0x3f60('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f60('0x17'));var db=require(_0x3f60('0x18'))['db'];function respondWithStatusCode(_0x2e79e8,_0x58e120){_0x58e120=_0x58e120||0xcc;return function(_0xeb6151){if(_0xeb6151){return _0x2e79e8[_0x3f60('0x19')](_0x58e120);}return _0x2e79e8['status'](_0x58e120)[_0x3f60('0x1a')]();};}function respondWithResult(_0x1b3e74,_0x53ec7a){_0x53ec7a=_0x53ec7a||0xc8;return function(_0x1ec7f4){if(_0x1ec7f4){return _0x1b3e74['status'](_0x53ec7a)[_0x3f60('0x1b')](_0x1ec7f4);}};}function respondWithFilteredResult(_0x2cd28f,_0x5e7718){return function(_0x3c0e9d){if(_0x3c0e9d){var _0x4e84b5=typeof _0x5e7718[_0x3f60('0x1c')]==='undefined'&&typeof _0x5e7718[_0x3f60('0x1d')]===_0x3f60('0x1e');var _0xbc26c=_0x3c0e9d[_0x3f60('0x1f')];var _0x3ae771=_0x4e84b5?0x0:_0x5e7718[_0x3f60('0x1c')];var _0x52aa44=_0x4e84b5?_0x3c0e9d[_0x3f60('0x1f')]:_0x5e7718[_0x3f60('0x1c')]+_0x5e7718[_0x3f60('0x1d')];var _0x9c845f;if(_0x52aa44>=_0xbc26c){_0x52aa44=_0xbc26c;_0x9c845f=0xc8;}else{_0x9c845f=0xce;}_0x2cd28f[_0x3f60('0x20')](_0x9c845f);return _0x2cd28f[_0x3f60('0x21')]('Content-Range',_0x3ae771+'-'+_0x52aa44+'/'+_0xbc26c)[_0x3f60('0x1b')](_0x3c0e9d);}return null;};}function patchUpdates(_0x2f1735){return function(_0x4dace9){try{jsonpatch[_0x3f60('0x22')](_0x4dace9,_0x2f1735,!![]);}catch(_0x2dba08){return BPromise[_0x3f60('0x23')](_0x2dba08);}return _0x4dace9[_0x3f60('0x24')]();};}function saveUpdates(_0x1d23bb,_0x1b161e){return function(_0x44b665){if(_0x44b665){return _0x44b665[_0x3f60('0x25')](_0x1d23bb)[_0x3f60('0x26')](function(_0x31847d){return _0x31847d;});}return null;};}function removeEntity(_0x3f6fa7,_0x35b8f6){return function(_0x1f9390){if(_0x1f9390){return _0x1f9390[_0x3f60('0x27')]()[_0x3f60('0x26')](function(){_0x3f6fa7['status'](0xcc)[_0x3f60('0x1a')]();});}};}function handleEntityNotFound(_0x3cdef4,_0x15315b){return function(_0x4581d6){if(!_0x4581d6){_0x3cdef4[_0x3f60('0x19')](0x194);}return _0x4581d6;};}function handleError(_0x36dfdb,_0xc106a9){_0xc106a9=_0xc106a9||0x1f4;return function(_0x23e265){logger['error'](_0x23e265[_0x3f60('0x28')]);if(_0x23e265[_0x3f60('0x29')]){delete _0x23e265[_0x3f60('0x29')];}_0x36dfdb[_0x3f60('0x20')](_0xc106a9)[_0x3f60('0x2a')](_0x23e265);};}exports[_0x3f60('0x2b')]=function(_0x39e14c,_0x4520a5){var _0x16b590={},_0x3cd0a7={},_0x2f1bc9={'count':0x0,'rows':[]};var _0x457e5b=_[_0x3f60('0x2c')](db[_0x3f60('0x2d')][_0x3f60('0x2e')],function(_0x14d83c){return{'name':_0x14d83c[_0x3f60('0x2f')],'type':_0x14d83c[_0x3f60('0x30')][_0x3f60('0x31')]};});_0x3cd0a7[_0x3f60('0x32')]=_[_0x3f60('0x2c')](_0x457e5b,_0x3f60('0x29'));_0x3cd0a7[_0x3f60('0x33')]=_[_0x3f60('0x34')](_0x39e14c[_0x3f60('0x33')]);_0x3cd0a7[_0x3f60('0x35')]=_[_0x3f60('0x36')](_0x3cd0a7[_0x3f60('0x32')],_0x3cd0a7[_0x3f60('0x33')]);_0x16b590[_0x3f60('0x37')]=_[_0x3f60('0x36')](_0x3cd0a7['model'],qs[_0x3f60('0x38')](_0x39e14c[_0x3f60('0x33')]['fields']));_0x16b590[_0x3f60('0x37')]=_0x16b590[_0x3f60('0x37')][_0x3f60('0x39')]?_0x16b590[_0x3f60('0x37')]:_0x3cd0a7['model'];if(!_0x39e14c[_0x3f60('0x33')][_0x3f60('0x3a')]('nolimit')){_0x16b590['limit']=qs[_0x3f60('0x1d')](_0x39e14c['query'][_0x3f60('0x1d')]);_0x16b590[_0x3f60('0x1c')]=qs[_0x3f60('0x1c')](_0x39e14c[_0x3f60('0x33')]['offset']);}_0x16b590['order']=qs[_0x3f60('0x3b')](_0x39e14c[_0x3f60('0x33')][_0x3f60('0x3b')]);_0x16b590[_0x3f60('0x3c')]=qs[_0x3f60('0x35')](_[_0x3f60('0x3d')](_0x39e14c['query'],_0x3cd0a7[_0x3f60('0x35')]),_0x457e5b);if(_0x39e14c['query'][_0x3f60('0x3e')]){_0x16b590['where']=_[_0x3f60('0x3f')](_0x16b590[_0x3f60('0x3c')],{'$or':_[_0x3f60('0x2c')](_0x457e5b,function(_0x466d05){if(_0x466d05[_0x3f60('0x30')]!=='VIRTUAL'){var _0x4fa98d={};_0x4fa98d[_0x466d05[_0x3f60('0x29')]]={'$like':'%'+_0x39e14c[_0x3f60('0x33')][_0x3f60('0x3e')]+'%'};return _0x4fa98d;}})});}_0x16b590=_['merge']({},_0x16b590,_0x39e14c[_0x3f60('0x40')]);var _0x42f82d={'where':_0x16b590['where']};return db['DeskField'][_0x3f60('0x1f')](_0x42f82d)[_0x3f60('0x26')](function(_0x3f2129){_0x2f1bc9[_0x3f60('0x1f')]=_0x3f2129;if(_0x39e14c[_0x3f60('0x33')]['includeAll']){_0x16b590[_0x3f60('0x41')]=[{'all':!![]}];}return db[_0x3f60('0x2d')][_0x3f60('0x42')](_0x16b590);})[_0x3f60('0x26')](function(_0x4c6346){_0x2f1bc9[_0x3f60('0x43')]=_0x4c6346;return _0x2f1bc9;})['then'](respondWithFilteredResult(_0x4520a5,_0x16b590))['catch'](handleError(_0x4520a5,null));};exports[_0x3f60('0x44')]=function(_0x20422a,_0x4ef8f2){var _0x5cfc2f={'raw':!![],'where':{'id':_0x20422a[_0x3f60('0x45')]['id']}},_0x4f0752={};_0x4f0752[_0x3f60('0x32')]=_['keys'](db['DeskField']['rawAttributes']);_0x4f0752[_0x3f60('0x33')]=_['keys'](_0x20422a['query']);_0x4f0752[_0x3f60('0x35')]=_[_0x3f60('0x36')](_0x4f0752['model'],_0x4f0752['query']);_0x5cfc2f[_0x3f60('0x37')]=_['intersection'](_0x4f0752[_0x3f60('0x32')],qs['fields'](_0x20422a[_0x3f60('0x33')][_0x3f60('0x38')]));_0x5cfc2f[_0x3f60('0x37')]=_0x5cfc2f[_0x3f60('0x37')][_0x3f60('0x39')]?_0x5cfc2f['attributes']:_0x4f0752[_0x3f60('0x32')];if(_0x20422a[_0x3f60('0x33')]['includeAll']){_0x5cfc2f['include']=[{'all':!![]}];}_0x5cfc2f=_[_0x3f60('0x3f')]({},_0x5cfc2f,_0x20422a[_0x3f60('0x40')]);return db[_0x3f60('0x2d')][_0x3f60('0x46')](_0x5cfc2f)[_0x3f60('0x26')](handleEntityNotFound(_0x4ef8f2,null))['then'](respondWithResult(_0x4ef8f2,null))[_0x3f60('0x47')](handleError(_0x4ef8f2,null));};exports['create']=function(_0xe5a2a6,_0x253d2f){return db[_0x3f60('0x2d')]['create'](_0xe5a2a6[_0x3f60('0x48')],{})[_0x3f60('0x26')](respondWithResult(_0x253d2f,0xc9))[_0x3f60('0x47')](handleError(_0x253d2f,null));};exports['update']=function(_0x217348,_0x55f75f){if(_0x217348[_0x3f60('0x48')]['id']){delete _0x217348[_0x3f60('0x48')]['id'];}return db[_0x3f60('0x2d')][_0x3f60('0x46')]({'where':{'id':_0x217348['params']['id']}})[_0x3f60('0x26')](handleEntityNotFound(_0x55f75f,null))[_0x3f60('0x26')](saveUpdates(_0x217348['body'],null))[_0x3f60('0x26')](respondWithResult(_0x55f75f,null))['catch'](handleError(_0x55f75f,null));};exports['destroy']=function(_0x4ce17d,_0x55dd97){return db['DeskField'][_0x3f60('0x46')]({'where':{'id':_0x4ce17d['params']['id']}})[_0x3f60('0x26')](handleEntityNotFound(_0x55dd97,null))[_0x3f60('0x26')](removeEntity(_0x55dd97,null))[_0x3f60('0x47')](handleError(_0x55dd97,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 82bb2f3..32ffbb3 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 _0xbcef=['path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3fe782,_0x51814d){var _0x15189e=function(_0x3ea856){while(--_0x3ea856){_0x3fe782['push'](_0x3fe782['shift']());}};_0x15189e(++_0x51814d);}(_0xbcef,0xa3));var _0xfbce=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbcef[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfbce('0x0'));var util=require(_0xfbce('0x1'));var logger=require(_0xfbce('0x2'))(_0xfbce('0x3'));var moment=require(_0xfbce('0x4'));var BPromise=require(_0xfbce('0x5'));var rp=require(_0xfbce('0x6'));var fs=require('fs');var path=require(_0xfbce('0x7'));var rimraf=require(_0xfbce('0x8'));var config=require(_0xfbce('0x9'));var attributes=require(_0xfbce('0xa'));module[_0xfbce('0xb')]=function(_0x47b2ca,_0xa663dd){return _0x47b2ca[_0xfbce('0xc')](_0xfbce('0xd'),attributes,{'tableName':_0xfbce('0xe'),'paranoid':![],'indexes':[{'name':_0xfbce('0xf'),'fields':['idField',_0xfbce('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a09=['define','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x7a09,0x1d5));var _0x97a0=function(_0x4dbdc3,_0x5a525d){_0x4dbdc3=_0x4dbdc3-0x0;var _0x1765ad=_0x7a09[_0x4dbdc3];return _0x1765ad;};'use strict';var _=require(_0x97a0('0x0'));var util=require(_0x97a0('0x1'));var logger=require(_0x97a0('0x2'))(_0x97a0('0x3'));var moment=require('moment');var BPromise=require(_0x97a0('0x4'));var rp=require(_0x97a0('0x5'));var fs=require('fs');var path=require(_0x97a0('0x6'));var rimraf=require(_0x97a0('0x7'));var config=require(_0x97a0('0x8'));var attributes=require(_0x97a0('0x9'));module[_0x97a0('0xa')]=function(_0x556309,_0x10ec4c){return _0x556309[_0x97a0('0xb')](_0x97a0('0xc'),attributes,{'tableName':_0x97a0('0xd'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x97a0('0xe'),_0x97a0('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 8c42843..bc95079 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 _0xa6f4=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s'];(function(_0x13090e,_0x113d12){var _0x503f4a=function(_0x13784e){while(--_0x13784e){_0x13090e['push'](_0x13090e['shift']());}};_0x503f4a(++_0x113d12);}(_0xa6f4,0xe5));var _0x4a6f=function(_0x5c117a,_0x36ebe6){_0x5c117a=_0x5c117a-0x0;var _0xf7911b=_0xa6f4[_0x5c117a];return _0xf7911b;};'use strict';var _=require(_0x4a6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a6f('0x1'));var rs=require(_0x4a6f('0x2'));var fs=require('fs');var Redis=require(_0x4a6f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4a6f('0x4'))(_0x4a6f('0x5'));var config=require('../../config/environment');var jayson=require(_0x4a6f('0x6'));var client=jayson[_0x4a6f('0x7')][_0x4a6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x490b08,_0x146cbf,_0x30979b){return new BPromise(function(_0x4aa970,_0x4989b0){return client[_0x4a6f('0x9')](_0x490b08,_0x30979b)[_0x4a6f('0xa')](function(_0x4f5da1){logger[_0x4a6f('0xb')](_0x4a6f('0xc'),_0x146cbf,_0x4a6f('0xd'));logger[_0x4a6f('0xe')](_0x4a6f('0xf'),_0x146cbf,_0x4a6f('0xd'),JSON[_0x4a6f('0x10')](_0x4f5da1));if(_0x4f5da1['error']){if(_0x4f5da1[_0x4a6f('0x11')][_0x4a6f('0x12')]===0x1f4){logger[_0x4a6f('0x11')](_0x4a6f('0xc'),_0x146cbf,_0x4f5da1['error']['message']);return _0x4989b0(_0x4f5da1[_0x4a6f('0x11')][_0x4a6f('0x13')]);}logger[_0x4a6f('0x11')]('DeskField,\x20%s,\x20%s',_0x146cbf,_0x4f5da1[_0x4a6f('0x11')][_0x4a6f('0x13')]);return _0x4aa970(_0x4f5da1[_0x4a6f('0x11')][_0x4a6f('0x13')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x146cbf,_0x4a6f('0xd'));_0x4aa970(_0x4f5da1[_0x4a6f('0x14')][_0x4a6f('0x13')]);}})[_0x4a6f('0x15')](function(_0x20f524){logger[_0x4a6f('0x11')]('DeskField,\x20%s,\x20%s',_0x146cbf,_0x20f524);_0x4989b0(_0x20f524);});});} \ No newline at end of file +var _0x5a9d=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','then','DeskField,\x20%s,\x20%s'];(function(_0x44c844,_0x1e3d7d){var _0x1d51b7=function(_0x575840){while(--_0x575840){_0x44c844['push'](_0x44c844['shift']());}};_0x1d51b7(++_0x1e3d7d);}(_0x5a9d,0x199));var _0xd5a9=function(_0x1e2369,_0x238ba9){_0x1e2369=_0x1e2369-0x0;var _0x40350f=_0x5a9d[_0x1e2369];return _0x40350f;};'use strict';var _=require('lodash');var util=require(_0xd5a9('0x0'));var moment=require('moment');var BPromise=require(_0xd5a9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5a9('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd5a9('0x3'))(_0xd5a9('0x4'));var config=require('../../config/environment');var jayson=require(_0xd5a9('0x5'));var client=jayson['client'][_0xd5a9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x58774a,_0xf5f429,_0x80c1b3){return new BPromise(function(_0x51745e,_0x179b00){return client['request'](_0x58774a,_0x80c1b3)[_0xd5a9('0x7')](function(_0x143295){logger['info'](_0xd5a9('0x8'),_0xf5f429,_0xd5a9('0x9'));logger[_0xd5a9('0xa')](_0xd5a9('0xb'),_0xf5f429,_0xd5a9('0x9'),JSON[_0xd5a9('0xc')](_0x143295));if(_0x143295[_0xd5a9('0xd')]){if(_0x143295['error'][_0xd5a9('0xe')]===0x1f4){logger['error'](_0xd5a9('0x8'),_0xf5f429,_0x143295[_0xd5a9('0xd')][_0xd5a9('0xf')]);return _0x179b00(_0x143295[_0xd5a9('0xd')][_0xd5a9('0xf')]);}logger[_0xd5a9('0xd')]('DeskField,\x20%s,\x20%s',_0xf5f429,_0x143295[_0xd5a9('0xd')][_0xd5a9('0xf')]);return _0x51745e(_0x143295['error'][_0xd5a9('0xf')]);}else{logger[_0xd5a9('0x10')](_0xd5a9('0x8'),_0xf5f429,_0xd5a9('0x9'));_0x51745e(_0x143295[_0xd5a9('0x11')][_0xd5a9('0xf')]);}})[_0xd5a9('0x12')](function(_0x3aa30c){logger[_0xd5a9('0xd')](_0xd5a9('0x8'),_0xf5f429,_0x3aa30c);_0x179b00(_0x3aa30c);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index c72aa70..11ba60a 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 _0xfea6=['create','addConfiguration','put','update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x17e686,_0x30d14a){var _0x6a2f97=function(_0x5c47e9){while(--_0x5c47e9){_0x17e686['push'](_0x17e686['shift']());}};_0x6a2f97(++_0x30d14a);}(_0xfea6,0x166));var _0x6fea=function(_0x4ceeed,_0x5ef599){_0x4ceeed=_0x4ceeed-0x0;var _0x340cd0=_0xfea6[_0x4ceeed];return _0x340cd0;};'use strict';var multer=require(_0x6fea('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6fea('0x1'));var express=require('express');var router=express[_0x6fea('0x2')]();var fs_extra=require(_0x6fea('0x3'));var auth=require(_0x6fea('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6fea('0x5'));var controller=require(_0x6fea('0x6'));router[_0x6fea('0x7')]('/',auth[_0x6fea('0x8')](),controller[_0x6fea('0x9')]);router['get'](_0x6fea('0xa'),auth[_0x6fea('0x8')](),controller[_0x6fea('0xb')]);router[_0x6fea('0x7')](_0x6fea('0xc'),auth[_0x6fea('0x8')](),controller[_0x6fea('0xd')]);router[_0x6fea('0x7')](_0x6fea('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x6fea('0xf')]('/',auth[_0x6fea('0x8')](),controller[_0x6fea('0x10')]);router[_0x6fea('0xf')](_0x6fea('0xc'),auth[_0x6fea('0x8')](),controller[_0x6fea('0x11')]);router[_0x6fea('0x12')](_0x6fea('0xa'),auth[_0x6fea('0x8')](),controller[_0x6fea('0x13')]);router[_0x6fea('0x14')](_0x6fea('0xa'),auth[_0x6fea('0x8')](),controller['destroy']);module[_0x6fea('0x15')]=router; \ No newline at end of file +var _0xb332=['show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id'];(function(_0x1bbb5c,_0x233593){var _0x11550c=function(_0x1befb8){while(--_0x1befb8){_0x1bbb5c['push'](_0x1bbb5c['shift']());}};_0x11550c(++_0x233593);}(_0xb332,0x181));var _0x2b33=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0xb332[_0x5a7f64];return _0x3d30f1;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2b33('0x1'));var express=require(_0x2b33('0x2'));var router=express['Router']();var fs_extra=require(_0x2b33('0x3'));var auth=require(_0x2b33('0x4'));var interaction=require(_0x2b33('0x5'));var config=require('../../config/environment');var controller=require(_0x2b33('0x6'));router[_0x2b33('0x7')]('/',auth[_0x2b33('0x8')](),controller[_0x2b33('0x9')]);router[_0x2b33('0x7')](_0x2b33('0xa'),auth[_0x2b33('0x8')](),controller[_0x2b33('0xb')]);router[_0x2b33('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x2b33('0xc')]);router[_0x2b33('0x7')](_0x2b33('0xd'),auth[_0x2b33('0x8')](),controller[_0x2b33('0xe')]);router[_0x2b33('0xf')]('/',auth[_0x2b33('0x8')](),controller[_0x2b33('0x10')]);router[_0x2b33('0xf')](_0x2b33('0x11'),auth[_0x2b33('0x8')](),controller['addConfiguration']);router['put'](_0x2b33('0xa'),auth[_0x2b33('0x8')](),controller[_0x2b33('0x12')]);router[_0x2b33('0x13')](_0x2b33('0xa'),auth[_0x2b33('0x8')](),controller[_0x2b33('0x14')]);module[_0x2b33('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 0a68895..29612d4 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 _0xb138=['sequelize','exports','STRING'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xb138,0x1dd));var _0x8b13=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0xb138[_0x37a0ab];return _0x13ca1d;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')]},'username':{'type':Sequelize[_0x8b13('0x2')]},'password':{'type':Sequelize[_0x8b13('0x2')]},'remoteUri':{'type':Sequelize[_0x8b13('0x2')]},'tenantId':{'type':Sequelize[_0x8b13('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8b13('0x2')]},'serverUrl':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xdbd0=['sequelize','exports','STRING','BOOLEAN'];(function(_0x13c083,_0x5ba7f1){var _0xdc9a12=function(_0x4f2f4a){while(--_0x4f2f4a){_0x13c083['push'](_0x13c083['shift']());}};_0xdc9a12(++_0x5ba7f1);}(_0xdbd0,0x88));var _0x0dbd=function(_0x3fc0af,_0x87bf3a){_0x3fc0af=_0x3fc0af-0x0;var _0x19f17f=_0xdbd0[_0x3fc0af];return _0x19f17f;};'use strict';var Sequelize=require(_0x0dbd('0x0'));module[_0x0dbd('0x1')]={'name':{'type':Sequelize[_0x0dbd('0x2')]},'username':{'type':Sequelize[_0x0dbd('0x2')]},'password':{'type':Sequelize[_0x0dbd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x0dbd('0x2')]},'clientId':{'type':Sequelize[_0x0dbd('0x2')]},'clientSecret':{'type':Sequelize[_0x0dbd('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0dbd('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0dbd('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 89acb08..bc390e3 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 _0x268d=['contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_url','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','owneridname','owneridtype','primarycontactidname','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','data7','modernAuthentication','access_token','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(','4.0','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','statusCode','error','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','then','destroy','sendStatus','stack','name','send','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x268d,0x1cc));var _0xd268=function(_0x30192f,_0x5f2747){_0x30192f=_0x30192f-0x0;var _0x61f605=_0x268d[_0x30192f];return _0x61f605;};'use strict';var rp=require(_0xd268('0x0'));var util=require(_0xd268('0x1'));var _=require(_0xd268('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xd268('0x3'))(_0xd268('0x4'));var db=require(_0xd268('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x6e0f60,_0x4492d5){_0x4492d5=_0x4492d5||0xc8;return function(_0x27648f){if(_0x27648f){return _0x6e0f60[_0xd268('0x6')](_0x4492d5)[_0xd268('0x7')](_0x27648f);}};}function respondWithFilteredResult(_0x4b2270,_0x5acdb8){return function(_0x59cf09){if(_0x59cf09){var _0x2c6939=typeof _0x5acdb8['offset']===_0xd268('0x8')&&typeof _0x5acdb8[_0xd268('0x9')]===_0xd268('0x8');var _0x2a0daa=_0x59cf09[_0xd268('0xa')];var _0x27595b=_0x2c6939?0x0:_0x5acdb8[_0xd268('0xb')];var _0x35ae47=_0x2c6939?_0x59cf09[_0xd268('0xa')]:_0x5acdb8[_0xd268('0xb')]+_0x5acdb8[_0xd268('0x9')];var _0x47c6bb;if(_0x35ae47>=_0x2a0daa){_0x35ae47=_0x2a0daa;_0x47c6bb=0xc8;}else{_0x47c6bb=0xce;}_0x4b2270[_0xd268('0x6')](_0x47c6bb);return _0x4b2270[_0xd268('0xc')](_0xd268('0xd'),_0x27595b+'-'+_0x35ae47+'/'+_0x2a0daa)['json'](_0x59cf09);}return null;};}function saveUpdates(_0x3b3476){return function(_0x14f4ee){if(_0x14f4ee){return _0x14f4ee['update'](_0x3b3476)[_0xd268('0xe')](function(_0x28c7ce){return _0x28c7ce;});}return null;};}function removeEntity(_0x8df865){return function(_0x5e34df){if(_0x5e34df){return _0x5e34df[_0xd268('0xf')]()[_0xd268('0xe')](function(){_0x8df865['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x332470){return function(_0x26d039){if(!_0x26d039){_0x332470[_0xd268('0x10')](0x194);}return _0x26d039;};}function handleError(_0x3d2698,_0x54f148){_0x54f148=_0x54f148||0x1f4;return function(_0x229036){logger['error'](_0x229036[_0xd268('0x11')]);if(_0x229036[_0xd268('0x12')]){delete _0x229036[_0xd268('0x12')];}_0x3d2698[_0xd268('0x6')](_0x54f148)[_0xd268('0x13')](_0x229036);};}exports['index']=function(_0x260674,_0x51a819){var _0x1b8901={},_0x14badb={},_0xdf3c60={'count':0x0,'rows':[]};var _0x49fce6=_['map'](db[_0xd268('0x14')][_0xd268('0x15')],function(_0x15e10f){return{'name':_0x15e10f[_0xd268('0x16')],'type':_0x15e10f[_0xd268('0x17')][_0xd268('0x18')]};});_0x14badb[_0xd268('0x19')]=_[_0xd268('0x1a')](_0x49fce6,_0xd268('0x12'));_0x14badb[_0xd268('0x1b')]=_['keys'](_0x260674[_0xd268('0x1b')]);_0x14badb['filters']=_[_0xd268('0x1c')](_0x14badb['model'],_0x14badb[_0xd268('0x1b')]);_0x1b8901[_0xd268('0x1d')]=_['intersection'](_0x14badb[_0xd268('0x19')],qs[_0xd268('0x1e')](_0x260674[_0xd268('0x1b')][_0xd268('0x1e')]));_0x1b8901[_0xd268('0x1d')]=_0x1b8901[_0xd268('0x1d')]['length']?_0x1b8901[_0xd268('0x1d')]:_0x14badb[_0xd268('0x19')];if(!_0x260674['query'][_0xd268('0x1f')](_0xd268('0x20'))){_0x1b8901['limit']=qs[_0xd268('0x9')](_0x260674[_0xd268('0x1b')][_0xd268('0x9')]);_0x1b8901[_0xd268('0xb')]=qs['offset'](_0x260674[_0xd268('0x1b')][_0xd268('0xb')]);}_0x1b8901[_0xd268('0x21')]=qs[_0xd268('0x22')](_0x260674[_0xd268('0x1b')][_0xd268('0x22')]);_0x1b8901['where']=qs['filters'](_[_0xd268('0x23')](_0x260674[_0xd268('0x1b')],_0x14badb[_0xd268('0x24')]),_0x49fce6);if(_0x260674[_0xd268('0x1b')][_0xd268('0x25')]){_0x1b8901[_0xd268('0x26')]=_[_0xd268('0x27')](_0x1b8901['where'],{'$or':_[_0xd268('0x1a')](_0x49fce6,function(_0x3326ff){if(_0x3326ff[_0xd268('0x17')]!==_0xd268('0x28')){var _0x2526c5={};_0x2526c5[_0x3326ff[_0xd268('0x12')]]={'$like':'%'+_0x260674['query'][_0xd268('0x25')]+'%'};return _0x2526c5;}})});}_0x1b8901=_[_0xd268('0x27')]({},_0x1b8901,_0x260674[_0xd268('0x29')]);var _0x233393={'where':_0x1b8901[_0xd268('0x26')]};return db[_0xd268('0x14')][_0xd268('0xa')](_0x233393)[_0xd268('0xe')](function(_0x364cf0){_0xdf3c60['count']=_0x364cf0;if(_0x260674['query'][_0xd268('0x2a')]){_0x1b8901['include']=[{'all':!![]}];}return db[_0xd268('0x14')][_0xd268('0x2b')](_0x1b8901);})[_0xd268('0xe')](function(_0x2b8cf0){_0xdf3c60[_0xd268('0x2c')]=_0x2b8cf0;return _0xdf3c60;})['then'](respondWithFilteredResult(_0x51a819,_0x1b8901))[_0xd268('0x2d')](handleError(_0x51a819,null));};exports[_0xd268('0x2e')]=function(_0x30b02c,_0x583ec9){var _0x58921f={'raw':![],'where':{'id':_0x30b02c[_0xd268('0x2f')]['id']}},_0x105809={};_0x105809['model']=_[_0xd268('0x30')](db['Dynamics365Account'][_0xd268('0x15')]);_0x105809['query']=_[_0xd268('0x30')](_0x30b02c[_0xd268('0x1b')]);_0x105809[_0xd268('0x24')]=_[_0xd268('0x1c')](_0x105809[_0xd268('0x19')],_0x105809[_0xd268('0x1b')]);_0x58921f[_0xd268('0x1d')]=_[_0xd268('0x1c')](_0x105809['model'],qs[_0xd268('0x1e')](_0x30b02c['query'][_0xd268('0x1e')]));_0x58921f['attributes']=_0x58921f[_0xd268('0x1d')][_0xd268('0x31')]?_0x58921f[_0xd268('0x1d')]:_0x105809[_0xd268('0x19')];if(_0x30b02c[_0xd268('0x1b')][_0xd268('0x2a')]){_0x58921f[_0xd268('0x32')]=[{'all':!![]}];}_0x58921f=_[_0xd268('0x27')]({},_0x58921f,_0x30b02c['options']);return db[_0xd268('0x14')][_0xd268('0x33')](_0x58921f)[_0xd268('0xe')](handleEntityNotFound(_0x583ec9,null))[_0xd268('0xe')](respondWithResult(_0x583ec9,null))[_0xd268('0x2d')](handleError(_0x583ec9,null));};exports[_0xd268('0x34')]=function(_0x1fe2ef,_0x5ca5bb){return db[_0xd268('0x14')][_0xd268('0x34')](_0x1fe2ef['body'],{})[_0xd268('0xe')](respondWithResult(_0x5ca5bb,0xc9))[_0xd268('0x2d')](handleError(_0x5ca5bb,null));};exports['update']=function(_0x448f68,_0x35693e){if(_0x448f68[_0xd268('0x35')]['id']){delete _0x448f68[_0xd268('0x35')]['id'];}return db[_0xd268('0x14')][_0xd268('0x33')]({'where':{'id':_0x448f68[_0xd268('0x2f')]['id']}})[_0xd268('0xe')](handleEntityNotFound(_0x35693e,null))[_0xd268('0xe')](saveUpdates(_0x448f68[_0xd268('0x35')],null))['then'](respondWithResult(_0x35693e,null))[_0xd268('0x2d')](handleError(_0x35693e,null));};exports[_0xd268('0xf')]=function(_0x5419fe,_0x28fdbe){return db[_0xd268('0x14')][_0xd268('0x33')]({'where':{'id':_0x5419fe[_0xd268('0x2f')]['id']}})[_0xd268('0xe')](handleEntityNotFound(_0x28fdbe,null))[_0xd268('0xe')](removeEntity(_0x28fdbe,null))[_0xd268('0x2d')](handleError(_0x28fdbe,null));};exports[_0xd268('0x36')]=function(_0x4c3359,_0x5e7d78){var _0x337c93={};var _0x551a41={};var _0x3a7130;var _0x3eb408;return db['Dynamics365Account'][_0xd268('0x37')]({'where':{'id':_0x4c3359['params']['id']}})['then'](handleEntityNotFound(_0x5e7d78,null))[_0xd268('0xe')](function(_0x5817a5){if(_0x5817a5){_0x3a7130=_0x5817a5;_0x551a41[_0xd268('0x19')]=_[_0xd268('0x30')](db[_0xd268('0x38')][_0xd268('0x15')]);_0x551a41[_0xd268('0x1b')]=_[_0xd268('0x30')](_0x4c3359[_0xd268('0x1b')]);_0x551a41[_0xd268('0x24')]=_[_0xd268('0x1c')](_0x551a41['model'],_0x551a41[_0xd268('0x1b')]);_0x337c93[_0xd268('0x1d')]=_[_0xd268('0x1c')](_0x551a41[_0xd268('0x19')],qs[_0xd268('0x1e')](_0x4c3359[_0xd268('0x1b')][_0xd268('0x1e')]));_0x337c93[_0xd268('0x1d')]=_0x337c93[_0xd268('0x1d')][_0xd268('0x31')]?_0x337c93['attributes']:_0x551a41[_0xd268('0x19')];_0x337c93[_0xd268('0x21')]=qs[_0xd268('0x22')](_0x4c3359[_0xd268('0x1b')][_0xd268('0x22')]);_0x337c93[_0xd268('0x26')]=qs[_0xd268('0x24')](_[_0xd268('0x23')](_0x4c3359['query'],_0x551a41['filters']));if(_0x4c3359['query']['filter']){_0x337c93['where']=_['merge'](_0x337c93['where'],{'$or':_['map'](_0x337c93[_0xd268('0x1d')],function(_0x6082d){var _0x54ae3a={};_0x54ae3a[_0x6082d]={'$like':'%'+_0x4c3359[_0xd268('0x1b')]['filter']+'%'};return _0x54ae3a;})});}_0x337c93=_[_0xd268('0x27')]({},_0x337c93,_0x4c3359[_0xd268('0x29')]);return _0x3a7130[_0xd268('0x36')](_0x337c93);}})[_0xd268('0xe')](function(_0x118460){if(_0x118460){_0x3eb408=_0x118460['length'];if(!_0x4c3359['query']['hasOwnProperty'](_0xd268('0x20'))){_0x337c93['limit']=qs[_0xd268('0x9')](_0x4c3359[_0xd268('0x1b')][_0xd268('0x9')]);_0x337c93['offset']=qs[_0xd268('0xb')](_0x4c3359['query']['offset']);}return _0x3a7130[_0xd268('0x36')](_0x337c93);}})[_0xd268('0xe')](function(_0x19dc12){if(_0x19dc12){return _0x19dc12?{'count':_0x3eb408,'rows':_0x19dc12}:null;}})['then'](respondWithResult(_0x5e7d78,null))[_0xd268('0x2d')](handleError(_0x5e7d78,null));};exports[_0xd268('0x39')]=function(_0x162c26,_0x303b3f){if(_0x162c26[_0xd268('0x35')]['id']){delete _0x162c26[_0xd268('0x35')]['id'];}return db[_0xd268('0x14')]['findOne']({'where':{'id':_0x162c26[_0xd268('0x2f')]['id']}})[_0xd268('0xe')](handleEntityNotFound(_0x303b3f,null))['then'](function(_0xea9780){if(_0xea9780){_0x162c26['body'][_0xd268('0x3a')]=_0xea9780['id'];_0x162c26[_0xd268('0x35')][_0xd268('0x3b')]=integrations[_0xd268('0x3c')](_0x162c26[_0xd268('0x35')][_0xd268('0x3d')],_0x162c26[_0xd268('0x35')][_0xd268('0x17')]);_0x162c26[_0xd268('0x35')][_0xd268('0x3e')]=integrations['getDescriptions'](_0x162c26[_0xd268('0x35')][_0xd268('0x3d')],_0x162c26[_0xd268('0x35')][_0xd268('0x17')]);return db[_0xd268('0x38')][_0xd268('0x34')](_0x162c26[_0xd268('0x35')],{'include':[{'model':db['Dynamics365Field'],'as':_0xd268('0x3b')},{'model':db[_0xd268('0x3f')],'as':'Descriptions'}]});}return null;})[_0xd268('0xe')](respondWithResult(_0x303b3f,null))[_0xd268('0x2d')](handleError(_0x303b3f,null));};function sanitizeRemoteUri(_0x9cb4a6){var _0xb1a990=_0x9cb4a6['slice'](-0x1);if(_0xb1a990==='/')return _0x9cb4a6[_0xd268('0x40')](0x0,_0x9cb4a6[_0xd268('0x41')](_0xb1a990));return _0x9cb4a6;}function getWebApiUrl(_0x87cb59){return util['format'](_0xd268('0x42'),_0x87cb59);}exports[_0xd268('0x43')]=function(_0x587654,_0x4bb6bf){var _0x2ce9a5=_0x587654['query'][_0xd268('0x44')];var _0x1473c6=_0x2ce9a5===_0xd268('0x45')?_0xd268('0x46'):_0xd268('0x47');var _0x202e53='';var _0x2b88f9='';var _0x58fb85='';var _0x28a885='';var _0x2448cd='';var _0x4b4176='';var _0x29daec='';var _0x46dbed='';var _0xceda3b=[_0xd268('0x48'),_0xd268('0x49'),'customerid','ownerid','caseorigincode',_0xd268('0x4a'),_0xd268('0x4b'),_0xd268('0x4c'),_0xd268('0x4d'),_0xd268('0x4e')];var _0x513860=[_0xd268('0x4f'),_0xd268('0x50'),_0xd268('0x51'),_0xd268('0x52'),_0xd268('0x53'),'contactidyominame',_0xd268('0x54'),_0xd268('0x55'),_0xd268('0x56'),'createdbyexternalpartyyominame',_0xd268('0x57'),_0xd268('0x58'),_0xd268('0x59'),_0xd268('0x5a'),_0xd268('0x5b'),_0xd268('0x5c'),_0xd268('0x5d'),'customeridyominame',_0xd268('0x5e'),_0xd268('0x5f'),'entityimage_timestamp',_0xd268('0x60'),'escalatedon','exchangerate','firstresponsebykpiidname',_0xd268('0x61'),_0xd268('0x62'),'influencescore',_0xd268('0x63'),_0xd268('0x64'),_0xd268('0x65'),_0xd268('0x66'),'modifiedbyexternalpartyyominame',_0xd268('0x67'),'modifiedbyyominame',_0xd268('0x68'),_0xd268('0x69'),'modifiedonbehalfbyyominame',_0xd268('0x6a'),'msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon',_0xd268('0x6b'),_0xd268('0x6c'),'owneridyominame','parentcaseidname',_0xd268('0x6d'),'primarycontactidyominame',_0xd268('0x6e'),_0xd268('0x6f'),_0xd268('0x70'),'resolveby','resolvebykpiidname',_0xd268('0x71'),_0xd268('0x72'),_0xd268('0x73'),_0xd268('0x74'),'slainvokedidname',_0xd268('0x75'),_0xd268('0x76'),_0xd268('0x77'),'statuscode',_0xd268('0x78'),_0xd268('0x79'),_0xd268('0x7a'),'transactioncurrencyidname',_0xd268('0x7b'),'utcconversiontimezonecode',_0xd268('0x7c')];var _0x3ed600=_0xceda3b[_0xd268('0x7d')](_0x513860);return db[_0xd268('0x14')][_0xd268('0x37')]({'where':{'id':_0x587654[_0xd268('0x2f')]['id']},'attributes':['id',_0xd268('0x7e'),_0xd268('0x7f'),_0xd268('0x80'),_0xd268('0x81'),_0xd268('0x82'),_0xd268('0x83'),'modernAuthentication'],'include':[{'model':db[_0xd268('0x84')],'as':_0xd268('0x84'),'attributes':['id',_0xd268('0x85'),_0xd268('0x86')]}]})['then'](handleEntityNotFound(_0x4bb6bf,null))[_0xd268('0xe')](function(_0x5a15bc){if(_0x5a15bc){if(_0x5a15bc[_0xd268('0x87')]){_0x5a15bc[_0xd268('0x88')]=_0x5a15bc[_0xd268('0x84')][_0xd268('0x85')];_0x46dbed=sanitizeRemoteUri(_0x5a15bc[_0xd268('0x84')][_0xd268('0x86')]);_0x29daec=getWebApiUrl(_0x46dbed);return _0x5a15bc;}_0x46dbed=sanitizeRemoteUri(_0x5a15bc[_0xd268('0x80')]);_0x29daec=getWebApiUrl(_0x46dbed);var _0x2aebb4={'method':_0xd268('0x89'),'uri':_0xd268('0x8a')+_0x5a15bc['tenantId']+'/oauth2/token','form':{'client_id':_0x5a15bc['clientId'],'resource':_0x46dbed,'username':_0x5a15bc[_0xd268('0x7e')],'password':_0x5a15bc[_0xd268('0x7f')],'grant_type':'password','client_secret':_0x5a15bc[_0xd268('0x83')]},'json':!![]};return rp(_0x2aebb4);}})[_0xd268('0xe')](function(_0x11516f){_0x4b4176=_0x11516f[_0xd268('0x88')];var _0x5bd825={'method':_0xd268('0x8b'),'uri':encodeURI(_0x29daec+_0xd268('0x8c')+_0x1473c6+'\x27'),'headers':{'Authorization':_0xd268('0x8d')+_0x4b4176,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5bd825);})[_0xd268('0xe')](function(_0x2143d9){var _0x56065e=_0x2143d9[_0xd268('0x8e')][0x0];var _0x4e10a2=_0x56065e[_0xd268('0x8f')];var _0x3b9faf={'method':_0xd268('0x8b'),'uri':_0x29daec+_0xd268('0x90')+_0x4e10a2+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xd268('0x8d')+_0x4b4176,'If-None-Match':null,'OData-Version':_0xd268('0x91')},'json':!![]};return rp(_0x3b9faf);})[_0xd268('0xe')](function(_0x35664a){_0x202e53=_0x35664a;_0x2b88f9=_0x202e53[_0xd268('0x92')];_0x2b88f9=_['remove'](_0x2b88f9,function(_0xbca595){return!_0x3ed600[_0xd268('0x93')](_0xbca595[_0xd268('0x94')]);});var _0x9b1fd9=[];var _0x4a4754=[];_0x2b88f9[_0xd268('0x95')](function(_0x5b4c45){if(_0x5b4c45[_0xd268('0x96')]){var _0x1c8e13=_0x5b4c45[_0xd268('0x96')]['substring'](_0x5b4c45[_0xd268('0x96')][_0xd268('0x41')]('.')+0x1);if(_0x1c8e13===_0xd268('0x97')){_0x9b1fd9['push'](getSelectList(_0x29daec,_0x2ce9a5,_0x4a4754,_0x202e53[_0xd268('0x8f')],_0x5b4c45[_0xd268('0x8f')],_0x4b4176));}}});return Promise[_0xd268('0x98')](_0x9b1fd9);})['then'](function(_0x459f6b){_0x58fb85=_0x459f6b[0x0];var _0x10f444=[];var _0xbdfedf=[];_0x2b88f9[_0xd268('0x95')](function(_0x3bb226){if(!_[_0xd268('0x99')](_0x3bb226[_0xd268('0x96')])){var _0x10c8d2=_0x3bb226[_0xd268('0x96')][_0xd268('0x40')](_0x3bb226['@odata.type'][_0xd268('0x41')]('.')+0x1);if(_0x10c8d2===_0xd268('0x9a')){_0x10f444[_0xd268('0x9b')](getBooleanList(_0x29daec,_0x2ce9a5,_0xbdfedf,_0x202e53[_0xd268('0x8f')],_0x3bb226[_0xd268('0x8f')],_0x4b4176));}}});return Promise['all'](_0x10f444);})[_0xd268('0xe')](function(_0x2bcc36){_0x28a885=_0x2bcc36[0x0];var _0x278fc3=[];var _0x516abf=[];_0x2b88f9[_0xd268('0x95')](function(_0x337552){if(_0x337552[_0xd268('0x96')]){var _0x34eb67=_0x337552[_0xd268('0x96')][_0xd268('0x40')](_0x337552['@odata.type'][_0xd268('0x41')]('.')+0x1);if(_0x34eb67===_0xd268('0x9c')||_0x34eb67===_0xd268('0x9d')||_0x34eb67===_0xd268('0x9e')||_0x34eb67===_0xd268('0x9f')||_0x34eb67===_0xd268('0xa0')||_0x34eb67==='DateTimeAttributeMetadata'||_0x34eb67===_0xd268('0xa1')||_0x34eb67==='EntityNameAttributeMetadata'||_0x34eb67==='StateAttributeMetadata'||_0x34eb67===_0xd268('0xa2')){_0x278fc3['push'](getInputList(_0x29daec,_0x2ce9a5,_0x34eb67,_0x516abf,_0x202e53['MetadataId'],_0x337552[_0xd268('0x8f')],_0x4b4176));}}});return Promise[_0xd268('0x98')](_0x278fc3);})[_0xd268('0xe')](function(_0x417484){_0x2448cd=_0x417484[0x0];var _0x2be13d=_0x58fb85[_0xd268('0x7d')](_0x28a885)['concat'](_0x2448cd);var _0x1ef9bb={'count':_0x2be13d[_0xd268('0x31')],'rows':_0x2be13d};return _0x1ef9bb;})['then'](respondWithResult(_0x4bb6bf,null))[_0xd268('0x2d')](function(_0x3e7409){var _0x58c486=_0x587654['query']['test']?0x1f4:_0x3e7409[_0xd268('0xa3')]||0x1f4;logger[_0xd268('0xa4')](_0x3e7409['stack']);delete _0x3e7409[_0xd268('0x12')];if(_0x58c486===0x191){_0x58c486=0x190;}_0x4bb6bf[_0xd268('0x6')](_0x58c486)['send'](_0x587654[_0xd268('0x1b')]['test']?{'message':_0xd268('0xa5'),'statusCode':_0x3e7409[_0xd268('0xa3')]}:_0x3e7409);});};function getSelectList(_0x2c6e2e,_0x478314,_0x2e3f76,_0x3744e6,_0x471c58,_0x2a5f97){var _0x138c27={'method':_0xd268('0x8b'),'uri':_0x2c6e2e+_0xd268('0x90')+_0x3744e6+_0xd268('0xa6')+_0x471c58+_0xd268('0xa7')+_0xd268('0xa8'),'headers':{'Authorization':_0xd268('0x8d')+_0x2a5f97,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x138c27)[_0xd268('0xe')](function(_0x4cd9c2){var _0x5f55b2=[];var _0x4bbdf5=_0x4cd9c2[_0xd268('0xa9')][_0xd268('0xaa')];_0x4bbdf5[_0xd268('0x95')](function(_0x115d1e){_0x5f55b2['push']({'name':_0x115d1e[_0xd268('0xab')][_0xd268('0xac')]['Label'],'value':String(_0x115d1e[_0xd268('0xad')])});});var _0x57c859={'id':_0x478314+'_'+_0x4cd9c2[_0xd268('0x94')],'name':_0x4cd9c2['DisplayName'][_0xd268('0xac')][_0xd268('0xab')],'custom':![],'options':_0x5f55b2};_0x2e3f76[_0xd268('0x9b')](_0x57c859);return _0x2e3f76;});}function getBooleanList(_0x233d4d,_0x4991b5,_0x2583f6,_0x89bb9b,_0x2218ab,_0x150f49){var _0x5cd8ec={'method':_0xd268('0x8b'),'uri':_0x233d4d+'EntityDefinitions('+_0x89bb9b+_0xd268('0xa6')+_0x2218ab+_0xd268('0xae'),'headers':{'Authorization':_0xd268('0x8d')+_0x150f49,'If-None-Match':null,'OData-Version':_0xd268('0x91')},'json':!![]};return rp(_0x5cd8ec)[_0xd268('0xe')](function(_0x3f8262){var _0x3dbd83=[];_0x3dbd83['push']({'name':_0x3f8262[_0xd268('0xa9')][_0xd268('0xaf')][_0xd268('0xab')][_0xd268('0xac')][_0xd268('0xab')],'value':_0xd268('0xb0')},{'name':_0x3f8262[_0xd268('0xa9')][_0xd268('0xb1')][_0xd268('0xab')][_0xd268('0xac')][_0xd268('0xab')],'value':'false'});var _0xe1580f={'id':_0x4991b5+'_'+_0x3f8262[_0xd268('0x94')],'name':_0x3f8262['DisplayName'][_0xd268('0xac')][_0xd268('0xab')],'custom':![],'options':_0x3dbd83};_0x2583f6[_0xd268('0x9b')](_0xe1580f);return _0x2583f6;});}function getInputList(_0x20efe9,_0x27ae71,_0x530a89,_0x5db80e,_0x577aef,_0x45725d,_0x3b60a6){var _0x190f70={'method':'GET','uri':_0x20efe9+_0xd268('0x90')+_0x577aef+_0xd268('0xa6')+_0x45725d+_0xd268('0xb2')+_0x530a89+_0xd268('0xb3'),'headers':{'Authorization':_0xd268('0x8d')+_0x3b60a6,'If-None-Match':null,'OData-Version':_0xd268('0x91')},'json':!![]};return rp(_0x190f70)[_0xd268('0xe')](function(_0x38641c){var _0x477a90={'id':_0x27ae71+'_'+_0x38641c[_0xd268('0x94')],'name':_0x38641c[_0xd268('0xb4')][_0xd268('0xac')]?_0x38641c['DisplayName'][_0xd268('0xac')][_0xd268('0xab')]:_0x38641c[_0xd268('0x94')],'custom':![],'options':[]};_0x5db80e[_0xd268('0x9b')](_0x477a90);return _0x5db80e;});} \ No newline at end of file +var _0x959e=['Dynamics365Configuration','Dynamics365Field','slice','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','title','description','customerid','ownerid','subject','directioncode','accountidname','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','username','password','access_token','GET','Bearer\x20','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','error','test','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','OptionSet','false','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','limit','count','offset','set','Content-Range','json','update','destroy','then','end','sendStatus','stack','name','send','index','map','Dynamics365Account','key','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','model','keys','rawAttributes','include','find','create','body','findOne','order','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel'];(function(_0x258206,_0x22b992){var _0x3e87e1=function(_0x4f8f22){while(--_0x4f8f22){_0x258206['push'](_0x258206['shift']());}};_0x3e87e1(++_0x22b992);}(_0x959e,0x1e2));var _0xe959=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x959e[_0x1ccbcc];return _0x1e873f;};'use strict';var rp=require(_0xe959('0x0'));var util=require(_0xe959('0x1'));var _=require(_0xe959('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xe959('0x3'))(_0xe959('0x4'));var db=require(_0xe959('0x5'))['db'];var integrations=require(_0xe959('0x6'));function respondWithResult(_0x19c802,_0xec5f35){_0xec5f35=_0xec5f35||0xc8;return function(_0x58ecbf){if(_0x58ecbf){return _0x19c802[_0xe959('0x7')](_0xec5f35)['json'](_0x58ecbf);}};}function respondWithFilteredResult(_0x29a59a,_0xd2bb6e){return function(_0x2df805){if(_0x2df805){var _0x36fe93=typeof _0xd2bb6e['offset']==='undefined'&&typeof _0xd2bb6e[_0xe959('0x8')]==='undefined';var _0x4de475=_0x2df805[_0xe959('0x9')];var _0x264816=_0x36fe93?0x0:_0xd2bb6e[_0xe959('0xa')];var _0x507982=_0x36fe93?_0x2df805[_0xe959('0x9')]:_0xd2bb6e[_0xe959('0xa')]+_0xd2bb6e[_0xe959('0x8')];var _0x58ca1c;if(_0x507982>=_0x4de475){_0x507982=_0x4de475;_0x58ca1c=0xc8;}else{_0x58ca1c=0xce;}_0x29a59a[_0xe959('0x7')](_0x58ca1c);return _0x29a59a[_0xe959('0xb')](_0xe959('0xc'),_0x264816+'-'+_0x507982+'/'+_0x4de475)[_0xe959('0xd')](_0x2df805);}return null;};}function saveUpdates(_0x1fa963){return function(_0x5c7a12){if(_0x5c7a12){return _0x5c7a12[_0xe959('0xe')](_0x1fa963)['then'](function(_0x1f1e6f){return _0x1f1e6f;});}return null;};}function removeEntity(_0x5bd09e){return function(_0x468f60){if(_0x468f60){return _0x468f60[_0xe959('0xf')]()[_0xe959('0x10')](function(){_0x5bd09e[_0xe959('0x7')](0xcc)[_0xe959('0x11')]();});}};}function handleEntityNotFound(_0x3bd45f){return function(_0x16835a){if(!_0x16835a){_0x3bd45f[_0xe959('0x12')](0x194);}return _0x16835a;};}function handleError(_0x53d2e0,_0x58078c){_0x58078c=_0x58078c||0x1f4;return function(_0x1d56ad){logger['error'](_0x1d56ad[_0xe959('0x13')]);if(_0x1d56ad[_0xe959('0x14')]){delete _0x1d56ad[_0xe959('0x14')];}_0x53d2e0['status'](_0x58078c)[_0xe959('0x15')](_0x1d56ad);};}exports[_0xe959('0x16')]=function(_0x19d8d5,_0x5430bf){var _0x7cd26d={},_0x5ae319={},_0x299035={'count':0x0,'rows':[]};var _0xe499c7=_[_0xe959('0x17')](db[_0xe959('0x18')]['rawAttributes'],function(_0x463f24){return{'name':_0x463f24['fieldName'],'type':_0x463f24['type'][_0xe959('0x19')]};});_0x5ae319['model']=_['map'](_0xe499c7,_0xe959('0x14'));_0x5ae319[_0xe959('0x1a')]=_['keys'](_0x19d8d5[_0xe959('0x1a')]);_0x5ae319[_0xe959('0x1b')]=_['intersection'](_0x5ae319['model'],_0x5ae319['query']);_0x7cd26d['attributes']=_[_0xe959('0x1c')](_0x5ae319['model'],qs[_0xe959('0x1d')](_0x19d8d5[_0xe959('0x1a')][_0xe959('0x1d')]));_0x7cd26d['attributes']=_0x7cd26d[_0xe959('0x1e')][_0xe959('0x1f')]?_0x7cd26d[_0xe959('0x1e')]:_0x5ae319['model'];if(!_0x19d8d5[_0xe959('0x1a')][_0xe959('0x20')](_0xe959('0x21'))){_0x7cd26d[_0xe959('0x8')]=qs[_0xe959('0x8')](_0x19d8d5[_0xe959('0x1a')]['limit']);_0x7cd26d['offset']=qs[_0xe959('0xa')](_0x19d8d5[_0xe959('0x1a')][_0xe959('0xa')]);}_0x7cd26d['order']=qs[_0xe959('0x22')](_0x19d8d5[_0xe959('0x1a')][_0xe959('0x22')]);_0x7cd26d[_0xe959('0x23')]=qs[_0xe959('0x1b')](_['pick'](_0x19d8d5['query'],_0x5ae319[_0xe959('0x1b')]),_0xe499c7);if(_0x19d8d5['query'][_0xe959('0x24')]){_0x7cd26d[_0xe959('0x23')]=_[_0xe959('0x25')](_0x7cd26d[_0xe959('0x23')],{'$or':_[_0xe959('0x17')](_0xe499c7,function(_0x348f3a){if(_0x348f3a[_0xe959('0x26')]!=='VIRTUAL'){var _0x5612a6={};_0x5612a6[_0x348f3a[_0xe959('0x14')]]={'$like':'%'+_0x19d8d5[_0xe959('0x1a')][_0xe959('0x24')]+'%'};return _0x5612a6;}})});}_0x7cd26d=_[_0xe959('0x25')]({},_0x7cd26d,_0x19d8d5[_0xe959('0x27')]);var _0x3de0ba={'where':_0x7cd26d[_0xe959('0x23')]};return db[_0xe959('0x18')][_0xe959('0x9')](_0x3de0ba)['then'](function(_0x1d1376){_0x299035['count']=_0x1d1376;if(_0x19d8d5[_0xe959('0x1a')][_0xe959('0x28')]){_0x7cd26d['include']=[{'all':!![]}];}return db[_0xe959('0x18')][_0xe959('0x29')](_0x7cd26d);})[_0xe959('0x10')](function(_0x3d05ca){_0x299035[_0xe959('0x2a')]=_0x3d05ca;return _0x299035;})['then'](respondWithFilteredResult(_0x5430bf,_0x7cd26d))[_0xe959('0x2b')](handleError(_0x5430bf,null));};exports[_0xe959('0x2c')]=function(_0xff9199,_0x505fb4){var _0x5af3b0={'raw':![],'where':{'id':_0xff9199[_0xe959('0x2d')]['id']}},_0x11fe41={};_0x11fe41[_0xe959('0x2e')]=_[_0xe959('0x2f')](db[_0xe959('0x18')][_0xe959('0x30')]);_0x11fe41[_0xe959('0x1a')]=_[_0xe959('0x2f')](_0xff9199[_0xe959('0x1a')]);_0x11fe41['filters']=_[_0xe959('0x1c')](_0x11fe41[_0xe959('0x2e')],_0x11fe41[_0xe959('0x1a')]);_0x5af3b0[_0xe959('0x1e')]=_[_0xe959('0x1c')](_0x11fe41[_0xe959('0x2e')],qs['fields'](_0xff9199[_0xe959('0x1a')]['fields']));_0x5af3b0[_0xe959('0x1e')]=_0x5af3b0[_0xe959('0x1e')][_0xe959('0x1f')]?_0x5af3b0['attributes']:_0x11fe41[_0xe959('0x2e')];if(_0xff9199[_0xe959('0x1a')]['includeAll']){_0x5af3b0[_0xe959('0x31')]=[{'all':!![]}];}_0x5af3b0=_['merge']({},_0x5af3b0,_0xff9199[_0xe959('0x27')]);return db[_0xe959('0x18')][_0xe959('0x32')](_0x5af3b0)['then'](handleEntityNotFound(_0x505fb4,null))[_0xe959('0x10')](respondWithResult(_0x505fb4,null))[_0xe959('0x2b')](handleError(_0x505fb4,null));};exports[_0xe959('0x33')]=function(_0x1b729e,_0x3a1926){return db[_0xe959('0x18')][_0xe959('0x33')](_0x1b729e[_0xe959('0x34')],{})[_0xe959('0x10')](respondWithResult(_0x3a1926,0xc9))['catch'](handleError(_0x3a1926,null));};exports['update']=function(_0x256225,_0x291532){if(_0x256225[_0xe959('0x34')]['id']){delete _0x256225[_0xe959('0x34')]['id'];}return db[_0xe959('0x18')][_0xe959('0x32')]({'where':{'id':_0x256225[_0xe959('0x2d')]['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x291532,null))[_0xe959('0x10')](saveUpdates(_0x256225[_0xe959('0x34')],null))[_0xe959('0x10')](respondWithResult(_0x291532,null))[_0xe959('0x2b')](handleError(_0x291532,null));};exports[_0xe959('0xf')]=function(_0x563699,_0x28ba99){return db[_0xe959('0x18')][_0xe959('0x32')]({'where':{'id':_0x563699[_0xe959('0x2d')]['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x28ba99,null))['then'](removeEntity(_0x28ba99,null))['catch'](handleError(_0x28ba99,null));};exports['getConfigurations']=function(_0x159221,_0x219c23){var _0x30c760={};var _0x2bdf38={};var _0x3ea236;var _0x305191;return db[_0xe959('0x18')][_0xe959('0x35')]({'where':{'id':_0x159221[_0xe959('0x2d')]['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x219c23,null))[_0xe959('0x10')](function(_0x4ebacf){if(_0x4ebacf){_0x3ea236=_0x4ebacf;_0x2bdf38[_0xe959('0x2e')]=_['keys'](db['Dynamics365Configuration'][_0xe959('0x30')]);_0x2bdf38['query']=_[_0xe959('0x2f')](_0x159221[_0xe959('0x1a')]);_0x2bdf38['filters']=_[_0xe959('0x1c')](_0x2bdf38[_0xe959('0x2e')],_0x2bdf38[_0xe959('0x1a')]);_0x30c760[_0xe959('0x1e')]=_['intersection'](_0x2bdf38[_0xe959('0x2e')],qs['fields'](_0x159221[_0xe959('0x1a')][_0xe959('0x1d')]));_0x30c760['attributes']=_0x30c760[_0xe959('0x1e')][_0xe959('0x1f')]?_0x30c760[_0xe959('0x1e')]:_0x2bdf38[_0xe959('0x2e')];_0x30c760[_0xe959('0x36')]=qs[_0xe959('0x22')](_0x159221[_0xe959('0x1a')][_0xe959('0x22')]);_0x30c760[_0xe959('0x23')]=qs[_0xe959('0x1b')](_[_0xe959('0x37')](_0x159221[_0xe959('0x1a')],_0x2bdf38['filters']));if(_0x159221['query']['filter']){_0x30c760[_0xe959('0x23')]=_[_0xe959('0x25')](_0x30c760['where'],{'$or':_[_0xe959('0x17')](_0x30c760[_0xe959('0x1e')],function(_0xe78287){var _0x4b0088={};_0x4b0088[_0xe78287]={'$like':'%'+_0x159221['query']['filter']+'%'};return _0x4b0088;})});}_0x30c760=_['merge']({},_0x30c760,_0x159221['options']);return _0x3ea236[_0xe959('0x38')](_0x30c760);}})[_0xe959('0x10')](function(_0x1592e5){if(_0x1592e5){_0x305191=_0x1592e5[_0xe959('0x1f')];if(!_0x159221[_0xe959('0x1a')][_0xe959('0x20')](_0xe959('0x21'))){_0x30c760[_0xe959('0x8')]=qs[_0xe959('0x8')](_0x159221[_0xe959('0x1a')][_0xe959('0x8')]);_0x30c760[_0xe959('0xa')]=qs[_0xe959('0xa')](_0x159221['query']['offset']);}return _0x3ea236[_0xe959('0x38')](_0x30c760);}})[_0xe959('0x10')](function(_0x256b72){if(_0x256b72){return _0x256b72?{'count':_0x305191,'rows':_0x256b72}:null;}})['then'](respondWithResult(_0x219c23,null))['catch'](handleError(_0x219c23,null));};exports[_0xe959('0x39')]=function(_0x301917,_0x31c99c){if(_0x301917[_0xe959('0x34')]['id']){delete _0x301917[_0xe959('0x34')]['id'];}return db[_0xe959('0x18')][_0xe959('0x35')]({'where':{'id':_0x301917['params']['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x31c99c,null))[_0xe959('0x10')](function(_0xfe6e34){if(_0xfe6e34){_0x301917[_0xe959('0x34')][_0xe959('0x3a')]=_0xfe6e34['id'];_0x301917[_0xe959('0x34')][_0xe959('0x3b')]=integrations[_0xe959('0x3c')](_0x301917[_0xe959('0x34')]['channel'],_0x301917[_0xe959('0x34')]['type']);_0x301917['body'][_0xe959('0x3d')]=integrations[_0xe959('0x3e')](_0x301917['body'][_0xe959('0x3f')],_0x301917[_0xe959('0x34')][_0xe959('0x26')]);return db[_0xe959('0x40')][_0xe959('0x33')](_0x301917['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0xe959('0x3b')},{'model':db[_0xe959('0x41')],'as':_0xe959('0x3d')}]});}return null;})[_0xe959('0x10')](respondWithResult(_0x31c99c,null))[_0xe959('0x2b')](handleError(_0x31c99c,null));};function sanitizeRemoteUri(_0x52dc46){var _0x1c529c=_0x52dc46[_0xe959('0x42')](-0x1);if(_0x1c529c==='/')return _0x52dc46['substring'](0x0,_0x52dc46[_0xe959('0x43')](_0x1c529c));return _0x52dc46;}function getWebApiUrl(_0x10af2d){return util['format'](_0xe959('0x44'),_0x10af2d);}exports[_0xe959('0x45')]=function(_0x4dec93,_0x2cfeca){var _0x4de8cd=_0x4dec93[_0xe959('0x1a')][_0xe959('0x46')];var _0x29e174=_0x4de8cd==='incident'?'Incident':'PhoneCall';var _0x222d97='';var _0x17e185='';var _0x56308e='';var _0x703af5='';var _0x2dd054='';var _0xa28d1d='';var _0x19db05='';var _0xe131d8='';var _0x70aa68=[_0xe959('0x47'),_0xe959('0x48'),_0xe959('0x49'),_0xe959('0x4a'),'caseorigincode',_0xe959('0x4b'),'phonenumber','regardingobjectid',_0xe959('0x4c'),'phonecall_activity_parties'];var _0x391863=[_0xe959('0x4d'),'accountidyominame','actualserviceunits','billedserviceunits',_0xe959('0x4e'),_0xe959('0x4f'),_0xe959('0x50'),'contractidname',_0xe959('0x51'),_0xe959('0x52'),'createdbyname',_0xe959('0x53'),'createdon',_0xe959('0x54'),_0xe959('0x55'),_0xe959('0x56'),'customeridtype',_0xe959('0x57'),_0xe959('0x58'),_0xe959('0x59'),'entityimage_timestamp',_0xe959('0x5a'),_0xe959('0x5b'),_0xe959('0x5c'),_0xe959('0x5d'),_0xe959('0x5e'),_0xe959('0x5f'),'influencescore',_0xe959('0x60'),_0xe959('0x61'),_0xe959('0x62'),_0xe959('0x63'),'modifiedbyexternalpartyyominame',_0xe959('0x64'),'modifiedbyyominame',_0xe959('0x65'),'modifiedonbehalfbyname',_0xe959('0x66'),_0xe959('0x67'),_0xe959('0x68'),_0xe959('0x69'),_0xe959('0x6a'),_0xe959('0x6b'),_0xe959('0x6c'),_0xe959('0x6d'),_0xe959('0x6e'),_0xe959('0x6f'),_0xe959('0x70'),_0xe959('0x71'),_0xe959('0x72'),_0xe959('0x73'),'productserialnumber',_0xe959('0x74'),_0xe959('0x75'),'responseby',_0xe959('0x76'),_0xe959('0x77'),'sentimentvalue','slainvokedidname','slaname','socialprofileidname',_0xe959('0x78'),_0xe959('0x79'),_0xe959('0x7a'),_0xe959('0x7b'),_0xe959('0x7c'),_0xe959('0x7d'),_0xe959('0x7e'),_0xe959('0x7f'),_0xe959('0x80')];var _0x400fad=_0x70aa68[_0xe959('0x81')](_0x391863);return db[_0xe959('0x18')]['findOne']({'where':{'id':_0x4dec93[_0xe959('0x2d')]['id']},'attributes':['id','username','password',_0xe959('0x82'),_0xe959('0x83'),_0xe959('0x84'),_0xe959('0x85'),_0xe959('0x86')],'include':[{'model':db[_0xe959('0x87')],'as':_0xe959('0x87'),'attributes':['id',_0xe959('0x88'),_0xe959('0x89')]}]})[_0xe959('0x10')](handleEntityNotFound(_0x2cfeca,null))[_0xe959('0x10')](function(_0x5afa59){if(_0x5afa59){if(_0x5afa59['modernAuthentication']){_0x5afa59['access_token']=_0x5afa59[_0xe959('0x87')][_0xe959('0x88')];_0xe131d8=sanitizeRemoteUri(_0x5afa59[_0xe959('0x87')]['data7']);_0x19db05=getWebApiUrl(_0xe131d8);return _0x5afa59;}_0xe131d8=sanitizeRemoteUri(_0x5afa59['remoteUri']);_0x19db05=getWebApiUrl(_0xe131d8);var _0x40ff76={'method':_0xe959('0x8a'),'uri':_0xe959('0x8b')+_0x5afa59[_0xe959('0x83')]+_0xe959('0x8c'),'form':{'client_id':_0x5afa59[_0xe959('0x84')],'resource':_0xe131d8,'username':_0x5afa59[_0xe959('0x8d')],'password':_0x5afa59[_0xe959('0x8e')],'grant_type':_0xe959('0x8e'),'client_secret':_0x5afa59[_0xe959('0x85')]},'json':!![]};return rp(_0x40ff76);}})['then'](function(_0x3dfb59){_0xa28d1d=_0x3dfb59[_0xe959('0x8f')];var _0x4aef81={'method':_0xe959('0x90'),'uri':encodeURI(_0x19db05+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x29e174+'\x27'),'headers':{'Authorization':_0xe959('0x91')+_0xa28d1d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4aef81);})[_0xe959('0x10')](function(_0x53394d){var _0x2fb93c=_0x53394d[_0xe959('0x92')][0x0];var _0x2f0c7f=_0x2fb93c[_0xe959('0x93')];var _0x4c8872={'method':'GET','uri':_0x19db05+'EntityDefinitions('+_0x2f0c7f+_0xe959('0x94'),'headers':{'Authorization':_0xe959('0x91')+_0xa28d1d,'If-None-Match':null,'OData-Version':_0xe959('0x95')},'json':!![]};return rp(_0x4c8872);})['then'](function(_0x256f73){_0x222d97=_0x256f73;_0x17e185=_0x222d97[_0xe959('0x96')];_0x17e185=_[_0xe959('0x97')](_0x17e185,function(_0x130a02){return!_0x400fad[_0xe959('0x98')](_0x130a02[_0xe959('0x99')]);});var _0xb2fd50=[];var _0x56b8cb=[];_0x17e185[_0xe959('0x9a')](function(_0x129413){if(_0x129413[_0xe959('0x9b')]){var _0x3a7044=_0x129413[_0xe959('0x9b')][_0xe959('0x9c')](_0x129413[_0xe959('0x9b')][_0xe959('0x43')]('.')+0x1);if(_0x3a7044==='PicklistAttributeMetadata'){_0xb2fd50['push'](getSelectList(_0x19db05,_0x4de8cd,_0x56b8cb,_0x222d97[_0xe959('0x93')],_0x129413[_0xe959('0x93')],_0xa28d1d));}}});return Promise['all'](_0xb2fd50);})['then'](function(_0xa2894d){_0x56308e=_0xa2894d[0x0];var _0x1a59cd=[];var _0x325362=[];_0x17e185['forEach'](function(_0x41a7ad){if(!_[_0xe959('0x9d')](_0x41a7ad[_0xe959('0x9b')])){var _0x261c54=_0x41a7ad['@odata.type'][_0xe959('0x9c')](_0x41a7ad[_0xe959('0x9b')][_0xe959('0x43')]('.')+0x1);if(_0x261c54===_0xe959('0x9e')){_0x1a59cd[_0xe959('0x9f')](getBooleanList(_0x19db05,_0x4de8cd,_0x325362,_0x222d97[_0xe959('0x93')],_0x41a7ad[_0xe959('0x93')],_0xa28d1d));}}});return Promise[_0xe959('0xa0')](_0x1a59cd);})[_0xe959('0x10')](function(_0x23d12e){_0x703af5=_0x23d12e[0x0];var _0x24337d=[];var _0x3d65ee=[];_0x17e185[_0xe959('0x9a')](function(_0x56d435){if(_0x56d435[_0xe959('0x9b')]){var _0x5a3d83=_0x56d435[_0xe959('0x9b')][_0xe959('0x9c')](_0x56d435[_0xe959('0x9b')][_0xe959('0x43')]('.')+0x1);if(_0x5a3d83===_0xe959('0xa1')||_0x5a3d83==='DoubleAttributeMetadata'||_0x5a3d83===_0xe959('0xa2')||_0x5a3d83===_0xe959('0xa3')||_0x5a3d83==='MemoAttributeMetadata'||_0x5a3d83==='DateTimeAttributeMetadata'||_0x5a3d83==='StatusAttributeMetadata'||_0x5a3d83===_0xe959('0xa4')||_0x5a3d83==='StateAttributeMetadata'||_0x5a3d83===_0xe959('0xa5')){_0x24337d[_0xe959('0x9f')](getInputList(_0x19db05,_0x4de8cd,_0x5a3d83,_0x3d65ee,_0x222d97[_0xe959('0x93')],_0x56d435[_0xe959('0x93')],_0xa28d1d));}}});return Promise[_0xe959('0xa0')](_0x24337d);})[_0xe959('0x10')](function(_0x4bfd40){_0x2dd054=_0x4bfd40[0x0];var _0x5519a5=_0x56308e[_0xe959('0x81')](_0x703af5)['concat'](_0x2dd054);var _0xcbe4f2={'count':_0x5519a5[_0xe959('0x1f')],'rows':_0x5519a5};return _0xcbe4f2;})['then'](respondWithResult(_0x2cfeca,null))['catch'](function(_0x1cf87c){var _0x2d41e7=_0x4dec93[_0xe959('0x1a')]['test']?0x1f4:_0x1cf87c[_0xe959('0xa6')]||0x1f4;logger[_0xe959('0xa7')](_0x1cf87c[_0xe959('0x13')]);delete _0x1cf87c[_0xe959('0x14')];if(_0x2d41e7===0x191){_0x2d41e7=0x190;}_0x2cfeca[_0xe959('0x7')](_0x2d41e7)['send'](_0x4dec93[_0xe959('0x1a')][_0xe959('0xa8')]?{'message':'Wrong\x20credentials','statusCode':_0x1cf87c['statusCode']}:_0x1cf87c);});};function getSelectList(_0xeb634d,_0x116017,_0x28b8cc,_0x474818,_0xd858b6,_0x1fbb9f){var _0x418391={'method':_0xe959('0x90'),'uri':_0xeb634d+_0xe959('0xa9')+_0x474818+')/Attributes('+_0xd858b6+_0xe959('0xaa')+_0xe959('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x1fbb9f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x418391)['then'](function(_0x564576){var _0x2cd72e=[];var _0x2200e2=_0x564576['OptionSet']['Options'];_0x2200e2[_0xe959('0x9a')](function(_0x4fe6de){_0x2cd72e[_0xe959('0x9f')]({'name':_0x4fe6de[_0xe959('0xac')]['UserLocalizedLabel'][_0xe959('0xac')],'value':String(_0x4fe6de[_0xe959('0xad')])});});var _0x1f2f8a={'id':_0x116017+'_'+_0x564576[_0xe959('0x99')],'name':_0x564576[_0xe959('0xae')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x2cd72e};_0x28b8cc[_0xe959('0x9f')](_0x1f2f8a);return _0x28b8cc;});}function getBooleanList(_0x20b8e6,_0x5a9d71,_0x2f86c2,_0x378c6d,_0x460dd7,_0x335437){var _0x18d23f={'method':_0xe959('0x90'),'uri':_0x20b8e6+_0xe959('0xa9')+_0x378c6d+_0xe959('0xaf')+_0x460dd7+_0xe959('0xb0'),'headers':{'Authorization':_0xe959('0x91')+_0x335437,'If-None-Match':null,'OData-Version':_0xe959('0x95')},'json':!![]};return rp(_0x18d23f)[_0xe959('0x10')](function(_0x2de441){var _0x1a7e33=[];_0x1a7e33[_0xe959('0x9f')]({'name':_0x2de441['OptionSet'][_0xe959('0xb1')][_0xe959('0xac')][_0xe959('0xb2')][_0xe959('0xac')],'value':_0xe959('0xb3')},{'name':_0x2de441[_0xe959('0xb4')]['FalseOption'][_0xe959('0xac')][_0xe959('0xb2')][_0xe959('0xac')],'value':_0xe959('0xb5')});var _0xf9682={'id':_0x5a9d71+'_'+_0x2de441[_0xe959('0x99')],'name':_0x2de441['DisplayName'][_0xe959('0xb2')][_0xe959('0xac')],'custom':![],'options':_0x1a7e33};_0x2f86c2[_0xe959('0x9f')](_0xf9682);return _0x2f86c2;});}function getInputList(_0x371898,_0x58776b,_0x381f24,_0x4ee9d6,_0x18f739,_0x5e190a,_0x1170b3){var _0x345ffc={'method':'GET','uri':_0x371898+'EntityDefinitions('+_0x18f739+_0xe959('0xaf')+_0x5e190a+')/Microsoft.Dynamics.CRM.'+_0x381f24+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xe959('0x91')+_0x1170b3,'If-None-Match':null,'OData-Version':_0xe959('0x95')},'json':!![]};return rp(_0x345ffc)[_0xe959('0x10')](function(_0x1ecc72){var _0x355a60={'id':_0x58776b+'_'+_0x1ecc72[_0xe959('0x99')],'name':_0x1ecc72[_0xe959('0xae')][_0xe959('0xb2')]?_0x1ecc72['DisplayName'][_0xe959('0xb2')]['Label']:_0x1ecc72[_0xe959('0x99')],'custom':![],'options':[]};_0x4ee9d6['push'](_0x355a60);return _0x4ee9d6;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 98b98ee..aad1691 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x18b8b3,_0x20c99c){var _0xc0f98e=function(_0x5be85c){while(--_0x5be85c){_0x18b8b3['push'](_0x18b8b3['shift']());}};_0xc0f98e(++_0x20c99c);}(_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'));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 +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x336ab8,_0x1af16e){var _0x23df86=function(_0x179d59){while(--_0x179d59){_0x336ab8['push'](_0x336ab8['shift']());}};_0x23df86(++_0x1af16e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xcb91[_0x280ae7];return _0x418b9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 7c33e23..3156da5 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 _0xe37d=['ShowDynamics365Account','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','debug','catch'];(function(_0x263ef1,_0x228ce8){var _0x548408=function(_0x139326){while(--_0x139326){_0x263ef1['push'](_0x263ef1['shift']());}};_0x548408(++_0x228ce8);}(_0xe37d,0x1c1));var _0xde37=function(_0x53e809,_0x4bd7e3){_0x53e809=_0x53e809-0x0;var _0x13c0a8=_0xe37d[_0x53e809];return _0x13c0a8;};'use strict';var _=require('lodash');var util=require(_0xde37('0x0'));var moment=require(_0xde37('0x1'));var BPromise=require('bluebird');var rs=require(_0xde37('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde37('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xde37('0x4'));var config=require(_0xde37('0x5'));var jayson=require(_0xde37('0x6'));var client=jayson[_0xde37('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23e0a2,_0x1f056f,_0x59f20c){return new BPromise(function(_0x3a68d0,_0x213e59){return client[_0xde37('0x8')](_0x23e0a2,_0x59f20c)[_0xde37('0x9')](function(_0x2bd114){logger[_0xde37('0xa')](_0xde37('0xb'),_0x1f056f,_0xde37('0xc'));logger['debug'](_0xde37('0xd'),_0x1f056f,_0xde37('0xc'),JSON[_0xde37('0xe')](_0x2bd114));if(_0x2bd114['error']){if(_0x2bd114[_0xde37('0xf')][_0xde37('0x10')]===0x1f4){logger[_0xde37('0xf')](_0xde37('0xb'),_0x1f056f,_0x2bd114[_0xde37('0xf')][_0xde37('0x11')]);return _0x213e59(_0x2bd114['error']['message']);}logger[_0xde37('0xf')](_0xde37('0xb'),_0x1f056f,_0x2bd114[_0xde37('0xf')][_0xde37('0x11')]);return _0x3a68d0(_0x2bd114[_0xde37('0xf')]['message']);}else{logger[_0xde37('0xa')](_0xde37('0xb'),_0x1f056f,'request\x20sent');_0x3a68d0(_0x2bd114[_0xde37('0x12')][_0xde37('0x11')]);}})['catch'](function(_0x6ab8d3){logger[_0xde37('0xf')](_0xde37('0xb'),_0x1f056f,_0x6ab8d3);_0x213e59(_0x6ab8d3);});});}exports['GetDynamics365Account']=function(_0x489e4a){var _0x1ffdf5=this;return new Promise(function(_0x22d392,_0x340250){return db['Dynamics365Account'][_0xde37('0x13')]({'raw':_0x489e4a[_0xde37('0x14')]?_0x489e4a[_0xde37('0x14')][_0xde37('0x15')]===undefined?!![]:![]:!![],'where':_0x489e4a[_0xde37('0x14')]?_0x489e4a['options'][_0xde37('0x16')]||null:null,'attributes':_0x489e4a[_0xde37('0x14')]?_0x489e4a[_0xde37('0x14')][_0xde37('0x17')]||null:null,'limit':_0x489e4a['options']?_0x489e4a[_0xde37('0x14')][_0xde37('0x18')]||null:null,'include':_0x489e4a[_0xde37('0x14')]?_0x489e4a['options'][_0xde37('0x19')]?_[_0xde37('0x1a')](_0x489e4a[_0xde37('0x14')][_0xde37('0x19')],function(_0x5bc3b1){return{'model':db[_0x5bc3b1[_0xde37('0x1b')]],'as':_0x5bc3b1['as'],'attributes':_0x5bc3b1[_0xde37('0x17')],'include':_0x5bc3b1[_0xde37('0x19')]?_[_0xde37('0x1a')](_0x5bc3b1[_0xde37('0x19')],function(_0x2c34df){return{'model':db[_0x2c34df[_0xde37('0x1b')]],'as':_0x2c34df['as'],'attributes':_0x2c34df[_0xde37('0x17')],'include':_0x2c34df[_0xde37('0x19')]?_['map'](_0x2c34df[_0xde37('0x19')],function(_0x33566a){return{'model':db[_0x33566a[_0xde37('0x1b')]],'as':_0x33566a['as'],'attributes':_0x33566a[_0xde37('0x17')]};}):[]};}):[]};}):[]:[]})[_0xde37('0x9')](function(_0x3489f5){logger[_0xde37('0xa')](_0xde37('0x1c'),_0x489e4a);logger[_0xde37('0x1d')](_0xde37('0x1c'),_0x489e4a,JSON['stringify'](_0x3489f5));_0x22d392(_0x3489f5);})[_0xde37('0x1e')](function(_0x305f05){logger[_0xde37('0xf')](_0xde37('0x1c'),_0x305f05[_0xde37('0x11')],_0x489e4a);_0x340250(_0x1ffdf5[_0xde37('0xf')](0x1f4,_0x305f05['message']));});});};exports['ShowDynamics365Account']=function(_0x5bce17){var _0x477ff7=this;return new Promise(function(_0x5cb0c0,_0xac07c3){return db['Dynamics365Account']['find']({'raw':_0x5bce17[_0xde37('0x14')]?_0x5bce17['options']['raw']===undefined?!![]:![]:!![],'where':_0x5bce17['options']?_0x5bce17[_0xde37('0x14')][_0xde37('0x16')]||null:null,'attributes':_0x5bce17[_0xde37('0x14')]?_0x5bce17[_0xde37('0x14')][_0xde37('0x17')]||null:null,'include':_0x5bce17[_0xde37('0x14')]?_0x5bce17['options'][_0xde37('0x19')]?_[_0xde37('0x1a')](_0x5bce17[_0xde37('0x14')][_0xde37('0x19')],function(_0x19f625){return{'model':db[_0x19f625['model']],'as':_0x19f625['as'],'attributes':_0x19f625[_0xde37('0x17')],'include':_0x19f625[_0xde37('0x19')]?_[_0xde37('0x1a')](_0x19f625['include'],function(_0x29153d){return{'model':db[_0x29153d[_0xde37('0x1b')]],'as':_0x29153d['as'],'attributes':_0x29153d[_0xde37('0x17')],'include':_0x29153d[_0xde37('0x19')]?_['map'](_0x29153d[_0xde37('0x19')],function(_0x5ca75b){return{'model':db[_0x5ca75b[_0xde37('0x1b')]],'as':_0x5ca75b['as'],'attributes':_0x5ca75b[_0xde37('0x17')]};}):[]};}):[]};}):[]:[]})[_0xde37('0x9')](function(_0xa7d3ae){logger[_0xde37('0xa')](_0xde37('0x1f'),_0x5bce17);logger[_0xde37('0x1d')](_0xde37('0x1f'),_0x5bce17,JSON[_0xde37('0xe')](_0xa7d3ae));_0x5cb0c0(_0xa7d3ae);})[_0xde37('0x1e')](function(_0x39ff77){logger[_0xde37('0xf')]('ShowDynamics365Account',_0x39ff77[_0xde37('0x11')],_0x5bce17);_0xac07c3(_0x477ff7[_0xde37('0xf')](0x1f4,_0x39ff77[_0xde37('0x11')]));});});}; \ No newline at end of file +var _0x826d=['map','model','attributes','stringify','ShowDynamics365Account','Dynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','Dynamics365Account,\x20%s,\x20%s','catch','GetDynamics365Account','findAll','options','raw','limit','include'];(function(_0x496023,_0x57f3ee){var _0x31403c=function(_0xf53c70){while(--_0xf53c70){_0x496023['push'](_0x496023['shift']());}};_0x31403c(++_0x57f3ee);}(_0x826d,0x1dc));var _0xd826=function(_0x39a3f4,_0x7f4ae8){_0x39a3f4=_0x39a3f4-0x0;var _0x4a894d=_0x826d[_0x39a3f4];return _0x4a894d;};'use strict';var _=require(_0xd826('0x0'));var util=require(_0xd826('0x1'));var moment=require(_0xd826('0x2'));var BPromise=require(_0xd826('0x3'));var rs=require(_0xd826('0x4'));var fs=require('fs');var Redis=require(_0xd826('0x5'));var db=require(_0xd826('0x6'))['db'];var utils=require(_0xd826('0x7'));var logger=require(_0xd826('0x8'))('rpc');var config=require(_0xd826('0x9'));var jayson=require(_0xd826('0xa'));var client=jayson[_0xd826('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51deff,_0x2d53e1,_0x239f9f){return new BPromise(function(_0x18598e,_0x4e8f29){return client[_0xd826('0xc')](_0x51deff,_0x239f9f)[_0xd826('0xd')](function(_0x3e6612){logger[_0xd826('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x2d53e1,_0xd826('0xf'));logger[_0xd826('0x10')](_0xd826('0x11'),_0x2d53e1,_0xd826('0xf'),JSON['stringify'](_0x3e6612));if(_0x3e6612[_0xd826('0x12')]){if(_0x3e6612['error']['code']===0x1f4){logger[_0xd826('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x2d53e1,_0x3e6612[_0xd826('0x12')]['message']);return _0x4e8f29(_0x3e6612['error'][_0xd826('0x13')]);}logger[_0xd826('0x12')](_0xd826('0x14'),_0x2d53e1,_0x3e6612[_0xd826('0x12')][_0xd826('0x13')]);return _0x18598e(_0x3e6612[_0xd826('0x12')][_0xd826('0x13')]);}else{logger[_0xd826('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x2d53e1,_0xd826('0xf'));_0x18598e(_0x3e6612['result']['message']);}})[_0xd826('0x15')](function(_0x28b4b9){logger[_0xd826('0x12')](_0xd826('0x14'),_0x2d53e1,_0x28b4b9);_0x4e8f29(_0x28b4b9);});});}exports[_0xd826('0x16')]=function(_0x369d2e){var _0x20f3cc=this;return new Promise(function(_0x479530,_0x592818){return db['Dynamics365Account'][_0xd826('0x17')]({'raw':_0x369d2e['options']?_0x369d2e[_0xd826('0x18')][_0xd826('0x19')]===undefined?!![]:![]:!![],'where':_0x369d2e[_0xd826('0x18')]?_0x369d2e['options']['where']||null:null,'attributes':_0x369d2e[_0xd826('0x18')]?_0x369d2e[_0xd826('0x18')]['attributes']||null:null,'limit':_0x369d2e[_0xd826('0x18')]?_0x369d2e[_0xd826('0x18')][_0xd826('0x1a')]||null:null,'include':_0x369d2e[_0xd826('0x18')]?_0x369d2e[_0xd826('0x18')][_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x369d2e['options']['include'],function(_0x5457b7){return{'model':db[_0x5457b7[_0xd826('0x1d')]],'as':_0x5457b7['as'],'attributes':_0x5457b7['attributes'],'include':_0x5457b7[_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x5457b7[_0xd826('0x1b')],function(_0x35df1e){return{'model':db[_0x35df1e['model']],'as':_0x35df1e['as'],'attributes':_0x35df1e['attributes'],'include':_0x35df1e[_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x35df1e[_0xd826('0x1b')],function(_0x2a9b6f){return{'model':db[_0x2a9b6f['model']],'as':_0x2a9b6f['as'],'attributes':_0x2a9b6f[_0xd826('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4767fc){logger[_0xd826('0xe')]('GetDynamics365Account',_0x369d2e);logger[_0xd826('0x10')](_0xd826('0x16'),_0x369d2e,JSON[_0xd826('0x1f')](_0x4767fc));_0x479530(_0x4767fc);})['catch'](function(_0x1d5a23){logger[_0xd826('0x12')](_0xd826('0x16'),_0x1d5a23['message'],_0x369d2e);_0x592818(_0x20f3cc[_0xd826('0x12')](0x1f4,_0x1d5a23['message']));});});};exports[_0xd826('0x20')]=function(_0x576692){var _0x1b3e73=this;return new Promise(function(_0x33f30f,_0x31262d){return db[_0xd826('0x21')][_0xd826('0x22')]({'raw':_0x576692[_0xd826('0x18')]?_0x576692[_0xd826('0x18')][_0xd826('0x19')]===undefined?!![]:![]:!![],'where':_0x576692[_0xd826('0x18')]?_0x576692['options'][_0xd826('0x23')]||null:null,'attributes':_0x576692[_0xd826('0x18')]?_0x576692['options'][_0xd826('0x1e')]||null:null,'include':_0x576692[_0xd826('0x18')]?_0x576692[_0xd826('0x18')][_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x576692[_0xd826('0x18')]['include'],function(_0x21b98a){return{'model':db[_0x21b98a[_0xd826('0x1d')]],'as':_0x21b98a['as'],'attributes':_0x21b98a[_0xd826('0x1e')],'include':_0x21b98a[_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x21b98a['include'],function(_0x58c058){return{'model':db[_0x58c058['model']],'as':_0x58c058['as'],'attributes':_0x58c058[_0xd826('0x1e')],'include':_0x58c058['include']?_[_0xd826('0x1c')](_0x58c058[_0xd826('0x1b')],function(_0x349c6a){return{'model':db[_0x349c6a[_0xd826('0x1d')]],'as':_0x349c6a['as'],'attributes':_0x349c6a[_0xd826('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd826('0xd')](function(_0x4b5033){logger[_0xd826('0xe')]('ShowDynamics365Account',_0x576692);logger[_0xd826('0x10')](_0xd826('0x20'),_0x576692,JSON[_0xd826('0x1f')](_0x4b5033));_0x33f30f(_0x4b5033);})[_0xd826('0x15')](function(_0x59881e){logger[_0xd826('0x12')](_0xd826('0x20'),_0x59881e[_0xd826('0x13')],_0x576692);_0x31262d(_0x1b3e73[_0xd826('0x12')](0x1f4,_0x59881e[_0xd826('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3b66f1f..1a2fcaa 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 _0x46a7=['destroy','exports','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','getDescriptions','post','put','/:id'];(function(_0x53fa4d,_0x29c10f){var _0x367fb4=function(_0x9a1a64){while(--_0x9a1a64){_0x53fa4d['push'](_0x53fa4d['shift']());}};_0x367fb4(++_0x29c10f);}(_0x46a7,0x92));var _0x746a=function(_0x5b5ea8,_0x33f8cb){_0x5b5ea8=_0x5b5ea8-0x0;var _0x38a227=_0x46a7[_0x5b5ea8];return _0x38a227;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x746a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x746a('0x1')]();var fs_extra=require(_0x746a('0x2'));var auth=require(_0x746a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x746a('0x4'));var controller=require(_0x746a('0x5'));router['get']('/',auth[_0x746a('0x6')](),controller[_0x746a('0x7')]);router[_0x746a('0x8')]('/:id',auth[_0x746a('0x6')](),controller[_0x746a('0x9')]);router[_0x746a('0x8')]('/:id/fields',auth[_0x746a('0x6')](),controller[_0x746a('0xa')]);router[_0x746a('0x8')](_0x746a('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x746a('0x6')](),controller[_0x746a('0xc')]);router[_0x746a('0xd')]('/',auth[_0x746a('0x6')](),controller['create']);router[_0x746a('0xe')](_0x746a('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x746a('0xf'),auth[_0x746a('0x6')](),controller[_0x746a('0x10')]);module[_0x746a('0x11')]=router; \ No newline at end of file +var _0x4f08=['get','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x4f08,0x194));var _0x84f0=function(_0x3adf13,_0x33a98e){_0x3adf13=_0x3adf13-0x0;var _0xc80a8c=_0x4f08[_0x3adf13];return _0xc80a8c;};'use strict';var multer=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var path=require('path');var timeout=require(_0x84f0('0x2'));var express=require(_0x84f0('0x3'));var router=express['Router']();var fs_extra=require(_0x84f0('0x4'));var auth=require(_0x84f0('0x5'));var interaction=require(_0x84f0('0x6'));var config=require('../../config/environment');var controller=require(_0x84f0('0x7'));router['get']('/',auth[_0x84f0('0x8')](),controller[_0x84f0('0x9')]);router[_0x84f0('0xa')]('/:id',auth[_0x84f0('0x8')](),controller[_0x84f0('0xb')]);router[_0x84f0('0xa')](_0x84f0('0xc'),auth[_0x84f0('0x8')](),controller[_0x84f0('0xd')]);router['get']('/:id/subjects',auth[_0x84f0('0x8')](),controller[_0x84f0('0xe')]);router[_0x84f0('0xa')](_0x84f0('0xf'),auth[_0x84f0('0x8')](),controller[_0x84f0('0x10')]);router[_0x84f0('0x11')]('/',auth[_0x84f0('0x8')](),controller[_0x84f0('0x12')]);router['put'](_0x84f0('0x13'),auth['isAuthenticated'](),controller[_0x84f0('0x14')]);router['delete'](_0x84f0('0x13'),auth[_0x84f0('0x8')](),controller[_0x84f0('0x15')]);module[_0x84f0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index a1033ec..32fd58d 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 _0x5dc1=['phonecall','nothing','contact','BOOLEAN','exports','STRING','ENUM','incident'];(function(_0x5c40bb,_0x4da992){var _0x2e8383=function(_0x51ee75){while(--_0x51ee75){_0x5c40bb['push'](_0x5c40bb['shift']());}};_0x2e8383(++_0x4da992);}(_0x5dc1,0x17c));var _0x15dc=function(_0x52d5e0,_0x25c6ed){_0x52d5e0=_0x52d5e0-0x0;var _0x3a4ddd=_0x5dc1[_0x52d5e0];return _0x3a4ddd;};'use strict';var Sequelize=require('sequelize');module[_0x15dc('0x0')]={'name':{'type':Sequelize[_0x15dc('0x1')]},'description':{'type':Sequelize[_0x15dc('0x1')]},'ticketType':{'type':Sequelize[_0x15dc('0x2')](_0x15dc('0x3'),_0x15dc('0x4')),'defaultValue':_0x15dc('0x3')},'moduleCreate':{'type':Sequelize[_0x15dc('0x2')]('contact',_0x15dc('0x5')),'defaultValue':_0x15dc('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x15dc('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x522e=['incident','phonecall','contact','nothing','STRING','BOOLEAN','exports','ENUM'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x522e,0x1e6));var _0xe522=function(_0x3f68b5,_0x3b7e58){_0x3f68b5=_0x3f68b5-0x0;var _0x5dad5d=_0x522e[_0x3f68b5];return _0x5dad5d;};'use strict';var Sequelize=require('sequelize');module[_0xe522('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xe522('0x1')](_0xe522('0x2'),_0xe522('0x3')),'defaultValue':_0xe522('0x2')},'moduleCreate':{'type':Sequelize[_0xe522('0x1')](_0xe522('0x4'),_0xe522('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xe522('0x6')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe522('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 a1a2093..6d7e2e8 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 _0x256a=['rimraf','moment','mustache','util','path','to-csv','lodash','squel','jsforce','ioredis','../../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','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','params','Dynamics365Field','merge','getFields','getSubjects','findOne','getDescriptions'];(function(_0x429d06,_0x3f38df){var _0x1fe889=function(_0x167e6e){while(--_0x167e6e){_0x429d06['push'](_0x429d06['shift']());}};_0x1fe889(++_0x3f38df);}(_0x256a,0x181));var _0xa256=function(_0x9f3941,_0x43d200){_0x9f3941=_0x9f3941-0x0;var _0x5c682e=_0x256a[_0x9f3941];return _0x5c682e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa256('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa256('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xa256('0x2'));var util=require(_0xa256('0x3'));var path=require(_0xa256('0x4'));var sox=require('sox');var csv=require(_0xa256('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa256('0x6'));var squel=require(_0xa256('0x7'));var crypto=require('crypto');var jsforce=require(_0xa256('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa256('0x9'));var authService=require('../../components/auth/service');var qs=require(_0xa256('0xa'));var as=require(_0xa256('0xb'));var hardwareService=require(_0xa256('0xc'));var logger=require(_0xa256('0xd'))(_0xa256('0xe'));var utils=require(_0xa256('0xf'));var config=require(_0xa256('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xa256('0x11'))['db'];function respondWithStatusCode(_0x1f45ca,_0x1fe231){_0x1fe231=_0x1fe231||0xcc;return function(_0x11efe2){if(_0x11efe2){return _0x1f45ca[_0xa256('0x12')](_0x1fe231);}return _0x1f45ca[_0xa256('0x13')](_0x1fe231)[_0xa256('0x14')]();};}function respondWithResult(_0x293b3a,_0x460fc7){_0x460fc7=_0x460fc7||0xc8;return function(_0x197282){if(_0x197282){return _0x293b3a[_0xa256('0x13')](_0x460fc7)[_0xa256('0x15')](_0x197282);}};}function respondWithFilteredResult(_0x12e0fa,_0x377b75){return function(_0x11481a){if(_0x11481a){var _0x435ed2=typeof _0x377b75[_0xa256('0x16')]===_0xa256('0x17')&&typeof _0x377b75[_0xa256('0x18')]===_0xa256('0x17');var _0x2a4e71=_0x11481a[_0xa256('0x19')];var _0x54534a=_0x435ed2?0x0:_0x377b75[_0xa256('0x16')];var _0x43fa3e=_0x435ed2?_0x11481a[_0xa256('0x19')]:_0x377b75[_0xa256('0x16')]+_0x377b75[_0xa256('0x18')];var _0x61b2e3;if(_0x43fa3e>=_0x2a4e71){_0x43fa3e=_0x2a4e71;_0x61b2e3=0xc8;}else{_0x61b2e3=0xce;}_0x12e0fa[_0xa256('0x13')](_0x61b2e3);return _0x12e0fa[_0xa256('0x1a')](_0xa256('0x1b'),_0x54534a+'-'+_0x43fa3e+'/'+_0x2a4e71)[_0xa256('0x15')](_0x11481a);}return null;};}function patchUpdates(_0x579a54){return function(_0x2d6a33){try{jsonpatch[_0xa256('0x1c')](_0x2d6a33,_0x579a54,!![]);}catch(_0x374296){return BPromise[_0xa256('0x1d')](_0x374296);}return _0x2d6a33[_0xa256('0x1e')]();};}function saveUpdates(_0x318398,_0x27e673){return function(_0x431782){if(_0x431782){return _0x431782[_0xa256('0x1f')](_0x318398)[_0xa256('0x20')](function(_0x278d5f){return _0x278d5f;});}return null;};}function removeEntity(_0x1c8b8a,_0x10d60f){return function(_0x485e42){if(_0x485e42){return _0x485e42[_0xa256('0x21')]()['then'](function(){_0x1c8b8a[_0xa256('0x13')](0xcc)[_0xa256('0x14')]();});}};}function handleEntityNotFound(_0x2449d6,_0x114ff3){return function(_0x40c5dc){if(!_0x40c5dc){_0x2449d6[_0xa256('0x12')](0x194);}return _0x40c5dc;};}function handleError(_0x5ed121,_0x403604){_0x403604=_0x403604||0x1f4;return function(_0x534416){logger[_0xa256('0x22')](_0x534416[_0xa256('0x23')]);if(_0x534416['name']){delete _0x534416[_0xa256('0x24')];}_0x5ed121[_0xa256('0x13')](_0x403604)[_0xa256('0x25')](_0x534416);};}exports[_0xa256('0x26')]=function(_0x4c8078,_0x2fc417){var _0x5bc46c={},_0x2f42d4={},_0xc926e={'count':0x0,'rows':[]};var _0x32554e=_[_0xa256('0x27')](db[_0xa256('0x28')]['rawAttributes'],function(_0x4ac936){return{'name':_0x4ac936[_0xa256('0x29')],'type':_0x4ac936['type']['key']};});_0x2f42d4[_0xa256('0x2a')]=_['map'](_0x32554e,_0xa256('0x24'));_0x2f42d4['query']=_[_0xa256('0x2b')](_0x4c8078[_0xa256('0x2c')]);_0x2f42d4[_0xa256('0x2d')]=_[_0xa256('0x2e')](_0x2f42d4['model'],_0x2f42d4[_0xa256('0x2c')]);_0x5bc46c[_0xa256('0x2f')]=_['intersection'](_0x2f42d4[_0xa256('0x2a')],qs[_0xa256('0x30')](_0x4c8078[_0xa256('0x2c')][_0xa256('0x30')]));_0x5bc46c['attributes']=_0x5bc46c[_0xa256('0x2f')][_0xa256('0x31')]?_0x5bc46c[_0xa256('0x2f')]:_0x2f42d4['model'];if(!_0x4c8078['query'][_0xa256('0x32')](_0xa256('0x33'))){_0x5bc46c[_0xa256('0x18')]=qs[_0xa256('0x18')](_0x4c8078[_0xa256('0x2c')]['limit']);_0x5bc46c[_0xa256('0x16')]=qs['offset'](_0x4c8078[_0xa256('0x2c')]['offset']);}_0x5bc46c[_0xa256('0x34')]=qs[_0xa256('0x35')](_0x4c8078[_0xa256('0x2c')]['sort']);_0x5bc46c[_0xa256('0x36')]=qs[_0xa256('0x2d')](_[_0xa256('0x37')](_0x4c8078[_0xa256('0x2c')],_0x2f42d4[_0xa256('0x2d')]),_0x32554e);if(_0x4c8078['query'][_0xa256('0x38')]){_0x5bc46c[_0xa256('0x36')]=_['merge'](_0x5bc46c[_0xa256('0x36')],{'$or':_['map'](_0x32554e,function(_0x3c8246){if(_0x3c8246[_0xa256('0x39')]!==_0xa256('0x3a')){var _0x51c607={};_0x51c607[_0x3c8246[_0xa256('0x24')]]={'$like':'%'+_0x4c8078[_0xa256('0x2c')][_0xa256('0x38')]+'%'};return _0x51c607;}})});}_0x5bc46c=_['merge']({},_0x5bc46c,_0x4c8078[_0xa256('0x3b')]);var _0x41cee2={'where':_0x5bc46c[_0xa256('0x36')]};return db[_0xa256('0x28')][_0xa256('0x19')](_0x41cee2)[_0xa256('0x20')](function(_0x47ccc3){_0xc926e[_0xa256('0x19')]=_0x47ccc3;if(_0x4c8078[_0xa256('0x2c')]['includeAll']){_0x5bc46c[_0xa256('0x3c')]=[{'all':!![]}];}return db[_0xa256('0x28')][_0xa256('0x3d')](_0x5bc46c);})[_0xa256('0x20')](function(_0x5248bb){_0xc926e[_0xa256('0x3e')]=_0x5248bb;return _0xc926e;})[_0xa256('0x20')](respondWithFilteredResult(_0x2fc417,_0x5bc46c))[_0xa256('0x3f')](handleError(_0x2fc417,null));};exports[_0xa256('0x40')]=function(_0x1196c7,_0x204446){var _0x45a847={'raw':![],'where':{'id':_0x1196c7['params']['id']}},_0x1e87aa={};_0x1e87aa['model']=_[_0xa256('0x2b')](db['Dynamics365Configuration'][_0xa256('0x41')]);_0x1e87aa[_0xa256('0x2c')]=_[_0xa256('0x2b')](_0x1196c7['query']);_0x1e87aa[_0xa256('0x2d')]=_[_0xa256('0x2e')](_0x1e87aa[_0xa256('0x2a')],_0x1e87aa['query']);_0x45a847[_0xa256('0x2f')]=_[_0xa256('0x2e')](_0x1e87aa[_0xa256('0x2a')],qs[_0xa256('0x30')](_0x1196c7[_0xa256('0x2c')][_0xa256('0x30')]));_0x45a847['attributes']=_0x45a847[_0xa256('0x2f')]['length']?_0x45a847[_0xa256('0x2f')]:_0x1e87aa[_0xa256('0x2a')];if(_0x1196c7[_0xa256('0x2c')][_0xa256('0x42')]){_0x45a847['include']=[{'all':!![]}];}_0x45a847=_['merge']({},_0x45a847,_0x1196c7['options']);return db['Dynamics365Configuration'][_0xa256('0x43')](_0x45a847)[_0xa256('0x20')](handleEntityNotFound(_0x204446,null))[_0xa256('0x20')](respondWithResult(_0x204446,null))[_0xa256('0x3f')](handleError(_0x204446,null));};exports['create']=function(_0x576e55,_0x50328e){return db[_0xa256('0x28')][_0xa256('0x44')](_0x576e55[_0xa256('0x45')],{})[_0xa256('0x20')](respondWithResult(_0x50328e,0xc9))[_0xa256('0x3f')](handleError(_0x50328e,null));};exports['update']=function(_0x13caaf,_0x3716ed){if(_0x13caaf['body']['id']){delete _0x13caaf[_0xa256('0x45')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x13caaf['params']['id']}})[_0xa256('0x20')](handleEntityNotFound(_0x3716ed,null))['then'](saveUpdates(_0x13caaf[_0xa256('0x45')],null))[_0xa256('0x20')](respondWithResult(_0x3716ed,null))[_0xa256('0x3f')](handleError(_0x3716ed,null));};exports['destroy']=function(_0x51b8a3,_0x1da680){return db[_0xa256('0x28')][_0xa256('0x43')]({'where':{'id':_0x51b8a3['params']['id']}})[_0xa256('0x20')](handleEntityNotFound(_0x1da680,null))[_0xa256('0x20')](removeEntity(_0x1da680,null))[_0xa256('0x3f')](handleError(_0x1da680,null));};exports['getFields']=function(_0x37ef69,_0x46e179,_0x53f40e){var _0x2ecc5e={};var _0x497feb={};var _0x400929;var _0x169ea4;return db[_0xa256('0x28')]['findOne']({'where':{'id':_0x37ef69[_0xa256('0x46')]['id']}})[_0xa256('0x20')](handleEntityNotFound(_0x46e179,null))[_0xa256('0x20')](function(_0xf4f8f7){if(_0xf4f8f7){_0x400929=_0xf4f8f7;_0x497feb[_0xa256('0x2a')]=_[_0xa256('0x2b')](db[_0xa256('0x47')][_0xa256('0x41')]);_0x497feb['query']=_[_0xa256('0x2b')](_0x37ef69[_0xa256('0x2c')]);_0x497feb[_0xa256('0x2d')]=_[_0xa256('0x2e')](_0x497feb[_0xa256('0x2a')],_0x497feb[_0xa256('0x2c')]);_0x2ecc5e[_0xa256('0x2f')]=_[_0xa256('0x2e')](_0x497feb[_0xa256('0x2a')],qs[_0xa256('0x30')](_0x37ef69[_0xa256('0x2c')]['fields']));_0x2ecc5e[_0xa256('0x2f')]=_0x2ecc5e[_0xa256('0x2f')][_0xa256('0x31')]?_0x2ecc5e[_0xa256('0x2f')]:_0x497feb[_0xa256('0x2a')];_0x2ecc5e[_0xa256('0x34')]=qs[_0xa256('0x35')](_0x37ef69[_0xa256('0x2c')][_0xa256('0x35')]);_0x2ecc5e[_0xa256('0x36')]=qs[_0xa256('0x2d')](_['pick'](_0x37ef69[_0xa256('0x2c')],_0x497feb[_0xa256('0x2d')]));if(_0x37ef69['query'][_0xa256('0x38')]){_0x2ecc5e[_0xa256('0x36')]=_[_0xa256('0x48')](_0x2ecc5e['where'],{'$or':_[_0xa256('0x27')](_0x2ecc5e[_0xa256('0x2f')],function(_0x13f51f){var _0xc0cd50={};_0xc0cd50[_0x13f51f]={'$like':'%'+_0x37ef69[_0xa256('0x2c')]['filter']+'%'};return _0xc0cd50;})});}_0x2ecc5e=_[_0xa256('0x48')]({},_0x2ecc5e,_0x37ef69['options']);return _0x400929[_0xa256('0x49')](_0x2ecc5e);}})[_0xa256('0x20')](function(_0x4a5d06){if(_0x4a5d06){_0x169ea4=_0x4a5d06[_0xa256('0x31')];if(!_0x37ef69[_0xa256('0x2c')]['hasOwnProperty'](_0xa256('0x33'))){_0x2ecc5e[_0xa256('0x18')]=qs[_0xa256('0x18')](_0x37ef69['query'][_0xa256('0x18')]);_0x2ecc5e[_0xa256('0x16')]=qs['offset'](_0x37ef69[_0xa256('0x2c')]['offset']);}return _0x400929['getFields'](_0x2ecc5e);}})[_0xa256('0x20')](function(_0x25bbc8){if(_0x25bbc8){return _0x25bbc8?{'count':_0x169ea4,'rows':_0x25bbc8}:null;}})[_0xa256('0x20')](respondWithResult(_0x46e179,null))[_0xa256('0x3f')](handleError(_0x46e179,null));};exports[_0xa256('0x4a')]=function(_0x4b76ee,_0x55d99c,_0x383616){var _0x47c026={};var _0x2101a1={};var _0x166add;var _0x213d32;return db[_0xa256('0x28')][_0xa256('0x4b')]({'where':{'id':_0x4b76ee[_0xa256('0x46')]['id']}})[_0xa256('0x20')](handleEntityNotFound(_0x55d99c,null))['then'](function(_0x4e2863){if(_0x4e2863){_0x166add=_0x4e2863;_0x2101a1['model']=_['keys'](db[_0xa256('0x47')][_0xa256('0x41')]);_0x2101a1[_0xa256('0x2c')]=_[_0xa256('0x2b')](_0x4b76ee['query']);_0x2101a1[_0xa256('0x2d')]=_[_0xa256('0x2e')](_0x2101a1[_0xa256('0x2a')],_0x2101a1[_0xa256('0x2c')]);_0x47c026[_0xa256('0x2f')]=_[_0xa256('0x2e')](_0x2101a1['model'],qs['fields'](_0x4b76ee[_0xa256('0x2c')][_0xa256('0x30')]));_0x47c026['attributes']=_0x47c026[_0xa256('0x2f')][_0xa256('0x31')]?_0x47c026['attributes']:_0x2101a1['model'];_0x47c026['order']=qs[_0xa256('0x35')](_0x4b76ee[_0xa256('0x2c')][_0xa256('0x35')]);_0x47c026[_0xa256('0x36')]=qs[_0xa256('0x2d')](_['pick'](_0x4b76ee[_0xa256('0x2c')],_0x2101a1[_0xa256('0x2d')]));if(_0x4b76ee[_0xa256('0x2c')][_0xa256('0x38')]){_0x47c026[_0xa256('0x36')]=_[_0xa256('0x48')](_0x47c026[_0xa256('0x36')],{'$or':_[_0xa256('0x27')](_0x47c026[_0xa256('0x2f')],function(_0x4edd91){var _0x22a560={};_0x22a560[_0x4edd91]={'$like':'%'+_0x4b76ee[_0xa256('0x2c')]['filter']+'%'};return _0x22a560;})});}_0x47c026=_[_0xa256('0x48')]({},_0x47c026,_0x4b76ee[_0xa256('0x3b')]);return _0x166add[_0xa256('0x4a')](_0x47c026);}})['then'](function(_0x229362){if(_0x229362){_0x213d32=_0x229362['length'];if(!_0x4b76ee[_0xa256('0x2c')][_0xa256('0x32')](_0xa256('0x33'))){_0x47c026[_0xa256('0x18')]=qs[_0xa256('0x18')](_0x4b76ee['query'][_0xa256('0x18')]);_0x47c026['offset']=qs[_0xa256('0x16')](_0x4b76ee[_0xa256('0x2c')]['offset']);}return _0x166add[_0xa256('0x4a')](_0x47c026);}})[_0xa256('0x20')](function(_0x545d04){if(_0x545d04){return _0x545d04?{'count':_0x213d32,'rows':_0x545d04}:null;}})[_0xa256('0x20')](respondWithResult(_0x55d99c,null))[_0xa256('0x3f')](handleError(_0x55d99c,null));};exports['getDescriptions']=function(_0x3cfbce,_0x137416,_0x3a56ca){var _0x567fb8={};var _0x36f3e7={};var _0x4561ae;var _0x56e867;return db[_0xa256('0x28')]['findOne']({'where':{'id':_0x3cfbce[_0xa256('0x46')]['id']}})[_0xa256('0x20')](handleEntityNotFound(_0x137416,null))[_0xa256('0x20')](function(_0x5b5fcb){if(_0x5b5fcb){_0x4561ae=_0x5b5fcb;_0x36f3e7[_0xa256('0x2a')]=_['keys'](db[_0xa256('0x47')][_0xa256('0x41')]);_0x36f3e7[_0xa256('0x2c')]=_[_0xa256('0x2b')](_0x3cfbce[_0xa256('0x2c')]);_0x36f3e7[_0xa256('0x2d')]=_[_0xa256('0x2e')](_0x36f3e7[_0xa256('0x2a')],_0x36f3e7['query']);_0x567fb8['attributes']=_[_0xa256('0x2e')](_0x36f3e7[_0xa256('0x2a')],qs[_0xa256('0x30')](_0x3cfbce['query'][_0xa256('0x30')]));_0x567fb8[_0xa256('0x2f')]=_0x567fb8['attributes']['length']?_0x567fb8[_0xa256('0x2f')]:_0x36f3e7['model'];_0x567fb8[_0xa256('0x34')]=qs[_0xa256('0x35')](_0x3cfbce[_0xa256('0x2c')]['sort']);_0x567fb8[_0xa256('0x36')]=qs[_0xa256('0x2d')](_[_0xa256('0x37')](_0x3cfbce[_0xa256('0x2c')],_0x36f3e7[_0xa256('0x2d')]));if(_0x3cfbce['query'][_0xa256('0x38')]){_0x567fb8[_0xa256('0x36')]=_[_0xa256('0x48')](_0x567fb8['where'],{'$or':_[_0xa256('0x27')](_0x567fb8['attributes'],function(_0x4f9f4c){var _0x2f0804={};_0x2f0804[_0x4f9f4c]={'$like':'%'+_0x3cfbce[_0xa256('0x2c')][_0xa256('0x38')]+'%'};return _0x2f0804;})});}_0x567fb8=_[_0xa256('0x48')]({},_0x567fb8,_0x3cfbce[_0xa256('0x3b')]);return _0x4561ae[_0xa256('0x4c')](_0x567fb8);}})[_0xa256('0x20')](function(_0x2dc7f0){if(_0x2dc7f0){_0x56e867=_0x2dc7f0[_0xa256('0x31')];if(!_0x3cfbce[_0xa256('0x2c')]['hasOwnProperty'](_0xa256('0x33'))){_0x567fb8[_0xa256('0x18')]=qs[_0xa256('0x18')](_0x3cfbce[_0xa256('0x2c')][_0xa256('0x18')]);_0x567fb8['offset']=qs[_0xa256('0x16')](_0x3cfbce[_0xa256('0x2c')]['offset']);}return _0x4561ae[_0xa256('0x4c')](_0x567fb8);}})[_0xa256('0x20')](function(_0x245e69){if(_0x245e69){return _0x245e69?{'count':_0x56e867,'rows':_0x245e69}:null;}})[_0xa256('0x20')](respondWithResult(_0x137416,null))[_0xa256('0x3f')](handleError(_0x137416,null));}; \ No newline at end of file +var _0x0cf6=['then','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','getFields','sort','getSubjects','findOne','Dynamics365Field','length','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','count','limit','Content-Range','apply','reject','save','update'];(function(_0x249d0a,_0x14daee){var _0x9d309c=function(_0x32fbc8){while(--_0x32fbc8){_0x249d0a['push'](_0x249d0a['shift']());}};_0x9d309c(++_0x14daee);}(_0x0cf6,0x11b));var _0x60cf=function(_0x597351,_0x5aed9f){_0x597351=_0x597351-0x0;var _0x410cd7=_0x0cf6[_0x597351];return _0x410cd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60cf('0x1'));var rp=require(_0x60cf('0x2'));var moment=require('moment');var BPromise=require(_0x60cf('0x3'));var Mustache=require(_0x60cf('0x4'));var util=require(_0x60cf('0x5'));var path=require(_0x60cf('0x6'));var sox=require(_0x60cf('0x7'));var csv=require('to-csv');var ejs=require(_0x60cf('0x8'));var fs=require('fs');var fs_extra=require(_0x60cf('0x9'));var _=require('lodash');var squel=require(_0x60cf('0xa'));var crypto=require(_0x60cf('0xb'));var jsforce=require(_0x60cf('0xc'));var deskjs=require(_0x60cf('0xd'));var toCsv=require(_0x60cf('0xe'));var querystring=require(_0x60cf('0xf'));var Papa=require(_0x60cf('0x10'));var Redis=require(_0x60cf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x60cf('0x12'));var as=require(_0x60cf('0x13'));var hardwareService=require(_0x60cf('0x14'));var logger=require(_0x60cf('0x15'))(_0x60cf('0x16'));var utils=require('../../config/utils');var config=require(_0x60cf('0x17'));var licenseUtil=require(_0x60cf('0x18'));var db=require(_0x60cf('0x19'))['db'];function respondWithStatusCode(_0x28d99e,_0x48fd94){_0x48fd94=_0x48fd94||0xcc;return function(_0x32973e){if(_0x32973e){return _0x28d99e[_0x60cf('0x1a')](_0x48fd94);}return _0x28d99e['status'](_0x48fd94)[_0x60cf('0x1b')]();};}function respondWithResult(_0x1f8700,_0x57948c){_0x57948c=_0x57948c||0xc8;return function(_0x51b604){if(_0x51b604){return _0x1f8700[_0x60cf('0x1c')](_0x57948c)['json'](_0x51b604);}};}function respondWithFilteredResult(_0x3e8f50,_0xfb132f){return function(_0x965017){if(_0x965017){var _0x17e6ae=typeof _0xfb132f[_0x60cf('0x1d')]==='undefined'&&typeof _0xfb132f['limit']==='undefined';var _0x2eddb9=_0x965017[_0x60cf('0x1e')];var _0x48d1f8=_0x17e6ae?0x0:_0xfb132f['offset'];var _0x2ca23e=_0x17e6ae?_0x965017[_0x60cf('0x1e')]:_0xfb132f[_0x60cf('0x1d')]+_0xfb132f[_0x60cf('0x1f')];var _0x3f4f38;if(_0x2ca23e>=_0x2eddb9){_0x2ca23e=_0x2eddb9;_0x3f4f38=0xc8;}else{_0x3f4f38=0xce;}_0x3e8f50[_0x60cf('0x1c')](_0x3f4f38);return _0x3e8f50['set'](_0x60cf('0x20'),_0x48d1f8+'-'+_0x2ca23e+'/'+_0x2eddb9)['json'](_0x965017);}return null;};}function patchUpdates(_0x4026c9){return function(_0x36c7bc){try{jsonpatch[_0x60cf('0x21')](_0x36c7bc,_0x4026c9,!![]);}catch(_0x2b33a8){return BPromise[_0x60cf('0x22')](_0x2b33a8);}return _0x36c7bc[_0x60cf('0x23')]();};}function saveUpdates(_0x4c7a52,_0x43417b){return function(_0x349798){if(_0x349798){return _0x349798[_0x60cf('0x24')](_0x4c7a52)[_0x60cf('0x25')](function(_0x29599c){return _0x29599c;});}return null;};}function removeEntity(_0x799534,_0x5c999e){return function(_0x1869c8){if(_0x1869c8){return _0x1869c8[_0x60cf('0x26')]()[_0x60cf('0x25')](function(){_0x799534['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34cd8f,_0x2c504a){return function(_0x3ebc8b){if(!_0x3ebc8b){_0x34cd8f[_0x60cf('0x1a')](0x194);}return _0x3ebc8b;};}function handleError(_0x5b4cb7,_0x1e980f){_0x1e980f=_0x1e980f||0x1f4;return function(_0x5460a7){logger[_0x60cf('0x27')](_0x5460a7[_0x60cf('0x28')]);if(_0x5460a7[_0x60cf('0x29')]){delete _0x5460a7['name'];}_0x5b4cb7[_0x60cf('0x1c')](_0x1e980f)[_0x60cf('0x2a')](_0x5460a7);};}exports['index']=function(_0x40fe35,_0x153ded){var _0x2a8551={},_0x3d3c24={},_0x4ef601={'count':0x0,'rows':[]};var _0xc9b0e4=_[_0x60cf('0x2b')](db[_0x60cf('0x2c')][_0x60cf('0x2d')],function(_0x2d759b){return{'name':_0x2d759b['fieldName'],'type':_0x2d759b[_0x60cf('0x2e')][_0x60cf('0x2f')]};});_0x3d3c24[_0x60cf('0x30')]=_[_0x60cf('0x2b')](_0xc9b0e4,_0x60cf('0x29'));_0x3d3c24[_0x60cf('0x31')]=_['keys'](_0x40fe35['query']);_0x3d3c24['filters']=_[_0x60cf('0x32')](_0x3d3c24[_0x60cf('0x30')],_0x3d3c24[_0x60cf('0x31')]);_0x2a8551[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x3d3c24[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x40fe35['query'][_0x60cf('0x34')]));_0x2a8551[_0x60cf('0x33')]=_0x2a8551[_0x60cf('0x33')]['length']?_0x2a8551['attributes']:_0x3d3c24[_0x60cf('0x30')];if(!_0x40fe35[_0x60cf('0x31')][_0x60cf('0x35')](_0x60cf('0x36'))){_0x2a8551[_0x60cf('0x1f')]=qs[_0x60cf('0x1f')](_0x40fe35[_0x60cf('0x31')][_0x60cf('0x1f')]);_0x2a8551[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x40fe35[_0x60cf('0x31')][_0x60cf('0x1d')]);}_0x2a8551[_0x60cf('0x37')]=qs['sort'](_0x40fe35[_0x60cf('0x31')]['sort']);_0x2a8551[_0x60cf('0x38')]=qs['filters'](_[_0x60cf('0x39')](_0x40fe35[_0x60cf('0x31')],_0x3d3c24[_0x60cf('0x3a')]),_0xc9b0e4);if(_0x40fe35[_0x60cf('0x31')][_0x60cf('0x3b')]){_0x2a8551[_0x60cf('0x38')]=_[_0x60cf('0x3c')](_0x2a8551['where'],{'$or':_[_0x60cf('0x2b')](_0xc9b0e4,function(_0x334c25){if(_0x334c25[_0x60cf('0x2e')]!==_0x60cf('0x3d')){var _0x3f5af3={};_0x3f5af3[_0x334c25[_0x60cf('0x29')]]={'$like':'%'+_0x40fe35['query'][_0x60cf('0x3b')]+'%'};return _0x3f5af3;}})});}_0x2a8551=_[_0x60cf('0x3c')]({},_0x2a8551,_0x40fe35[_0x60cf('0x3e')]);var _0x42696e={'where':_0x2a8551['where']};return db[_0x60cf('0x2c')][_0x60cf('0x1e')](_0x42696e)[_0x60cf('0x25')](function(_0x49b261){_0x4ef601[_0x60cf('0x1e')]=_0x49b261;if(_0x40fe35['query'][_0x60cf('0x3f')]){_0x2a8551[_0x60cf('0x40')]=[{'all':!![]}];}return db[_0x60cf('0x2c')][_0x60cf('0x41')](_0x2a8551);})['then'](function(_0x498043){_0x4ef601['rows']=_0x498043;return _0x4ef601;})[_0x60cf('0x25')](respondWithFilteredResult(_0x153ded,_0x2a8551))['catch'](handleError(_0x153ded,null));};exports[_0x60cf('0x42')]=function(_0x3f5e91,_0x177e56){var _0x2dcfe4={'raw':![],'where':{'id':_0x3f5e91[_0x60cf('0x43')]['id']}},_0x506d26={};_0x506d26['model']=_[_0x60cf('0x44')](db['Dynamics365Configuration']['rawAttributes']);_0x506d26[_0x60cf('0x31')]=_[_0x60cf('0x44')](_0x3f5e91['query']);_0x506d26['filters']=_[_0x60cf('0x32')](_0x506d26[_0x60cf('0x30')],_0x506d26[_0x60cf('0x31')]);_0x2dcfe4[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x506d26[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x3f5e91[_0x60cf('0x31')][_0x60cf('0x34')]));_0x2dcfe4[_0x60cf('0x33')]=_0x2dcfe4[_0x60cf('0x33')]['length']?_0x2dcfe4[_0x60cf('0x33')]:_0x506d26[_0x60cf('0x30')];if(_0x3f5e91[_0x60cf('0x31')][_0x60cf('0x3f')]){_0x2dcfe4['include']=[{'all':!![]}];}_0x2dcfe4=_['merge']({},_0x2dcfe4,_0x3f5e91[_0x60cf('0x3e')]);return db[_0x60cf('0x2c')]['find'](_0x2dcfe4)['then'](handleEntityNotFound(_0x177e56,null))[_0x60cf('0x25')](respondWithResult(_0x177e56,null))[_0x60cf('0x45')](handleError(_0x177e56,null));};exports[_0x60cf('0x46')]=function(_0x5657dd,_0x276d6d){return db['Dynamics365Configuration'][_0x60cf('0x46')](_0x5657dd['body'],{})[_0x60cf('0x25')](respondWithResult(_0x276d6d,0xc9))['catch'](handleError(_0x276d6d,null));};exports[_0x60cf('0x24')]=function(_0x4705c3,_0x3e7daf){if(_0x4705c3[_0x60cf('0x47')]['id']){delete _0x4705c3[_0x60cf('0x47')]['id'];}return db[_0x60cf('0x2c')][_0x60cf('0x48')]({'where':{'id':_0x4705c3[_0x60cf('0x43')]['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x3e7daf,null))[_0x60cf('0x25')](saveUpdates(_0x4705c3[_0x60cf('0x47')],null))[_0x60cf('0x25')](respondWithResult(_0x3e7daf,null))[_0x60cf('0x45')](handleError(_0x3e7daf,null));};exports['destroy']=function(_0x199a3e,_0x231f34){return db[_0x60cf('0x2c')][_0x60cf('0x48')]({'where':{'id':_0x199a3e[_0x60cf('0x43')]['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x231f34,null))['then'](removeEntity(_0x231f34,null))[_0x60cf('0x45')](handleError(_0x231f34,null));};exports[_0x60cf('0x49')]=function(_0x4afaf9,_0x4a4ea6,_0x321cc0){var _0x203f68={};var _0x26d227={};var _0x106f34;var _0x4f60cb;return db[_0x60cf('0x2c')]['findOne']({'where':{'id':_0x4afaf9[_0x60cf('0x43')]['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x4a4ea6,null))[_0x60cf('0x25')](function(_0x287a10){if(_0x287a10){_0x106f34=_0x287a10;_0x26d227[_0x60cf('0x30')]=_['keys'](db['Dynamics365Field'][_0x60cf('0x2d')]);_0x26d227[_0x60cf('0x31')]=_['keys'](_0x4afaf9[_0x60cf('0x31')]);_0x26d227[_0x60cf('0x3a')]=_[_0x60cf('0x32')](_0x26d227[_0x60cf('0x30')],_0x26d227['query']);_0x203f68[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x26d227[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x4afaf9['query'][_0x60cf('0x34')]));_0x203f68[_0x60cf('0x33')]=_0x203f68['attributes']['length']?_0x203f68['attributes']:_0x26d227[_0x60cf('0x30')];_0x203f68[_0x60cf('0x37')]=qs[_0x60cf('0x4a')](_0x4afaf9[_0x60cf('0x31')]['sort']);_0x203f68[_0x60cf('0x38')]=qs[_0x60cf('0x3a')](_[_0x60cf('0x39')](_0x4afaf9['query'],_0x26d227[_0x60cf('0x3a')]));if(_0x4afaf9['query'][_0x60cf('0x3b')]){_0x203f68[_0x60cf('0x38')]=_['merge'](_0x203f68['where'],{'$or':_[_0x60cf('0x2b')](_0x203f68[_0x60cf('0x33')],function(_0x194be9){var _0x51a9fb={};_0x51a9fb[_0x194be9]={'$like':'%'+_0x4afaf9[_0x60cf('0x31')][_0x60cf('0x3b')]+'%'};return _0x51a9fb;})});}_0x203f68=_['merge']({},_0x203f68,_0x4afaf9[_0x60cf('0x3e')]);return _0x106f34[_0x60cf('0x49')](_0x203f68);}})[_0x60cf('0x25')](function(_0x5047e4){if(_0x5047e4){_0x4f60cb=_0x5047e4['length'];if(!_0x4afaf9[_0x60cf('0x31')][_0x60cf('0x35')](_0x60cf('0x36'))){_0x203f68[_0x60cf('0x1f')]=qs[_0x60cf('0x1f')](_0x4afaf9[_0x60cf('0x31')][_0x60cf('0x1f')]);_0x203f68[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x4afaf9[_0x60cf('0x31')]['offset']);}return _0x106f34[_0x60cf('0x49')](_0x203f68);}})[_0x60cf('0x25')](function(_0x56486c){if(_0x56486c){return _0x56486c?{'count':_0x4f60cb,'rows':_0x56486c}:null;}})[_0x60cf('0x25')](respondWithResult(_0x4a4ea6,null))[_0x60cf('0x45')](handleError(_0x4a4ea6,null));};exports[_0x60cf('0x4b')]=function(_0x144f06,_0x5805af,_0x391d7e){var _0x36c2d3={};var _0x1f8fe7={};var _0x16c581;var _0x4c7dc1;return db[_0x60cf('0x2c')][_0x60cf('0x4c')]({'where':{'id':_0x144f06['params']['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x5805af,null))[_0x60cf('0x25')](function(_0x34c12d){if(_0x34c12d){_0x16c581=_0x34c12d;_0x1f8fe7[_0x60cf('0x30')]=_[_0x60cf('0x44')](db[_0x60cf('0x4d')][_0x60cf('0x2d')]);_0x1f8fe7[_0x60cf('0x31')]=_[_0x60cf('0x44')](_0x144f06[_0x60cf('0x31')]);_0x1f8fe7[_0x60cf('0x3a')]=_['intersection'](_0x1f8fe7[_0x60cf('0x30')],_0x1f8fe7[_0x60cf('0x31')]);_0x36c2d3[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x1f8fe7[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x144f06[_0x60cf('0x31')][_0x60cf('0x34')]));_0x36c2d3[_0x60cf('0x33')]=_0x36c2d3[_0x60cf('0x33')][_0x60cf('0x4e')]?_0x36c2d3[_0x60cf('0x33')]:_0x1f8fe7[_0x60cf('0x30')];_0x36c2d3[_0x60cf('0x37')]=qs[_0x60cf('0x4a')](_0x144f06[_0x60cf('0x31')][_0x60cf('0x4a')]);_0x36c2d3[_0x60cf('0x38')]=qs[_0x60cf('0x3a')](_['pick'](_0x144f06[_0x60cf('0x31')],_0x1f8fe7[_0x60cf('0x3a')]));if(_0x144f06['query'][_0x60cf('0x3b')]){_0x36c2d3[_0x60cf('0x38')]=_[_0x60cf('0x3c')](_0x36c2d3[_0x60cf('0x38')],{'$or':_[_0x60cf('0x2b')](_0x36c2d3[_0x60cf('0x33')],function(_0x495fe3){var _0xa6548b={};_0xa6548b[_0x495fe3]={'$like':'%'+_0x144f06[_0x60cf('0x31')][_0x60cf('0x3b')]+'%'};return _0xa6548b;})});}_0x36c2d3=_[_0x60cf('0x3c')]({},_0x36c2d3,_0x144f06[_0x60cf('0x3e')]);return _0x16c581[_0x60cf('0x4b')](_0x36c2d3);}})[_0x60cf('0x25')](function(_0x355a1c){if(_0x355a1c){_0x4c7dc1=_0x355a1c['length'];if(!_0x144f06[_0x60cf('0x31')][_0x60cf('0x35')]('nolimit')){_0x36c2d3['limit']=qs['limit'](_0x144f06[_0x60cf('0x31')][_0x60cf('0x1f')]);_0x36c2d3[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x144f06[_0x60cf('0x31')]['offset']);}return _0x16c581[_0x60cf('0x4b')](_0x36c2d3);}})['then'](function(_0xb4eec6){if(_0xb4eec6){return _0xb4eec6?{'count':_0x4c7dc1,'rows':_0xb4eec6}:null;}})[_0x60cf('0x25')](respondWithResult(_0x5805af,null))[_0x60cf('0x45')](handleError(_0x5805af,null));};exports[_0x60cf('0x4f')]=function(_0x5ec604,_0x55059d,_0x32226b){var _0x43b42f={};var _0x2eee17={};var _0x2fcdbc;var _0x26b6d5;return db['Dynamics365Configuration'][_0x60cf('0x4c')]({'where':{'id':_0x5ec604[_0x60cf('0x43')]['id']}})['then'](handleEntityNotFound(_0x55059d,null))['then'](function(_0x322ff8){if(_0x322ff8){_0x2fcdbc=_0x322ff8;_0x2eee17['model']=_['keys'](db[_0x60cf('0x4d')][_0x60cf('0x2d')]);_0x2eee17[_0x60cf('0x31')]=_[_0x60cf('0x44')](_0x5ec604['query']);_0x2eee17[_0x60cf('0x3a')]=_[_0x60cf('0x32')](_0x2eee17[_0x60cf('0x30')],_0x2eee17['query']);_0x43b42f['attributes']=_[_0x60cf('0x32')](_0x2eee17[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x5ec604[_0x60cf('0x31')][_0x60cf('0x34')]));_0x43b42f['attributes']=_0x43b42f[_0x60cf('0x33')]['length']?_0x43b42f[_0x60cf('0x33')]:_0x2eee17[_0x60cf('0x30')];_0x43b42f[_0x60cf('0x37')]=qs[_0x60cf('0x4a')](_0x5ec604[_0x60cf('0x31')][_0x60cf('0x4a')]);_0x43b42f['where']=qs[_0x60cf('0x3a')](_['pick'](_0x5ec604[_0x60cf('0x31')],_0x2eee17[_0x60cf('0x3a')]));if(_0x5ec604[_0x60cf('0x31')][_0x60cf('0x3b')]){_0x43b42f[_0x60cf('0x38')]=_[_0x60cf('0x3c')](_0x43b42f[_0x60cf('0x38')],{'$or':_[_0x60cf('0x2b')](_0x43b42f['attributes'],function(_0x271b6b){var _0x5840f2={};_0x5840f2[_0x271b6b]={'$like':'%'+_0x5ec604[_0x60cf('0x31')][_0x60cf('0x3b')]+'%'};return _0x5840f2;})});}_0x43b42f=_['merge']({},_0x43b42f,_0x5ec604[_0x60cf('0x3e')]);return _0x2fcdbc[_0x60cf('0x4f')](_0x43b42f);}})[_0x60cf('0x25')](function(_0x261bfe){if(_0x261bfe){_0x26b6d5=_0x261bfe['length'];if(!_0x5ec604['query'][_0x60cf('0x35')](_0x60cf('0x36'))){_0x43b42f['limit']=qs[_0x60cf('0x1f')](_0x5ec604['query'][_0x60cf('0x1f')]);_0x43b42f[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x5ec604[_0x60cf('0x31')]['offset']);}return _0x2fcdbc[_0x60cf('0x4f')](_0x43b42f);}})['then'](function(_0x1d3890){if(_0x1d3890){return _0x1d3890?{'count':_0x26b6d5,'rows':_0x1d3890}:null;}})['then'](respondWithResult(_0x55059d,null))[_0x60cf('0x45')](handleError(_0x55059d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ef71965..8f8b2c2 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 _0x81bd=['../../config/environment','./intDynamics365Configuration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x25c3a6,_0x178742){var _0x5168e8=function(_0xb6d76f){while(--_0xb6d76f){_0x25c3a6['push'](_0x25c3a6['shift']());}};_0x5168e8(++_0x178742);}(_0x81bd,0x7c));var _0xd81b=function(_0x55b460,_0x497077){_0x55b460=_0x55b460-0x0;var _0x3ac537=_0x81bd[_0x55b460];return _0x3ac537;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x1c43dc,_0x42c937){var _0x5c0698=function(_0x59b8dc){while(--_0x59b8dc){_0x1c43dc['push'](_0x1c43dc['shift']());}};_0x5c0698(++_0x42c937);}(_0xedd9,0xfc));var _0x9edd=function(_0x588fbf,_0x367c67){_0x588fbf=_0x588fbf-0x0;var _0x3d3de5=_0xedd9[_0x588fbf];return _0x3d3de5;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),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 a2096c1..b48db46 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 _0xd7ad=['Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3b1582,_0x31a7ff){var _0x3f2d2f=function(_0x3a6914){while(--_0x3a6914){_0x3b1582['push'](_0x3b1582['shift']());}};_0x3f2d2f(++_0x31a7ff);}(_0xd7ad,0x1c2));var _0xdd7a=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xd7ad[_0x65c50e];return _0x4573e7;};'use strict';var _=require(_0xdd7a('0x0'));var util=require(_0xdd7a('0x1'));var moment=require(_0xdd7a('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd7a('0x5'))(_0xdd7a('0x6'));var config=require(_0xdd7a('0x7'));var jayson=require(_0xdd7a('0x8'));var client=jayson[_0xdd7a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d3031,_0x120a67,_0x3114ab){return new BPromise(function(_0xfb4158,_0x2c32b3){return client[_0xdd7a('0xa')](_0x3d3031,_0x3114ab)[_0xdd7a('0xb')](function(_0x130778){logger['info'](_0xdd7a('0xc'),_0x120a67,'request\x20sent');logger[_0xdd7a('0xd')](_0xdd7a('0xe'),_0x120a67,'request\x20sent',JSON[_0xdd7a('0xf')](_0x130778));if(_0x130778['error']){if(_0x130778['error'][_0xdd7a('0x10')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x120a67,_0x130778[_0xdd7a('0x11')][_0xdd7a('0x12')]);return _0x2c32b3(_0x130778[_0xdd7a('0x11')]['message']);}logger['error'](_0xdd7a('0xc'),_0x120a67,_0x130778[_0xdd7a('0x11')][_0xdd7a('0x12')]);return _0xfb4158(_0x130778[_0xdd7a('0x11')][_0xdd7a('0x12')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x120a67,'request\x20sent');_0xfb4158(_0x130778[_0xdd7a('0x13')][_0xdd7a('0x12')]);}})[_0xdd7a('0x14')](function(_0x5a5018){logger[_0xdd7a('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x120a67,_0x5a5018);_0x2c32b3(_0x5a5018);});});} \ No newline at end of file +var _0x465e=['jayson/promise','client','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/logger'];(function(_0x475c6f,_0x3df83b){var _0x94f69b=function(_0x4a95f1){while(--_0x4a95f1){_0x475c6f['push'](_0x475c6f['shift']());}};_0x94f69b(++_0x3df83b);}(_0x465e,0x1cf));var _0xe465=function(_0x1a9b94,_0x4d763e){_0x1a9b94=_0x1a9b94-0x0;var _0x379102=_0x465e[_0x1a9b94];return _0x379102;};'use strict';var _=require(_0xe465('0x0'));var util=require('util');var moment=require(_0xe465('0x1'));var BPromise=require(_0xe465('0x2'));var rs=require(_0xe465('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe465('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe465('0x5'));var client=jayson[_0xe465('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf7f575,_0x1a1790,_0x753899){return new BPromise(function(_0x479496,_0x3148d7){return client['request'](_0xf7f575,_0x753899)['then'](function(_0x4d8730){logger['info'](_0xe465('0x7'),_0x1a1790,_0xe465('0x8'));logger[_0xe465('0x9')](_0xe465('0xa'),_0x1a1790,_0xe465('0x8'),JSON[_0xe465('0xb')](_0x4d8730));if(_0x4d8730['error']){if(_0x4d8730[_0xe465('0xc')][_0xe465('0xd')]===0x1f4){logger[_0xe465('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a1790,_0x4d8730['error'][_0xe465('0xe')]);return _0x3148d7(_0x4d8730['error'][_0xe465('0xe')]);}logger[_0xe465('0xc')](_0xe465('0x7'),_0x1a1790,_0x4d8730['error'][_0xe465('0xe')]);return _0x479496(_0x4d8730['error'][_0xe465('0xe')]);}else{logger[_0xe465('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a1790,_0xe465('0x8'));_0x479496(_0x4d8730[_0xe465('0x10')][_0xe465('0xe')]);}})[_0xe465('0x11')](function(_0x4957fa){logger['error'](_0xe465('0x7'),_0x1a1790,_0x4957fa);_0x3148d7(_0x4957fa);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 6375cb8..598e42f 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 _0xe7fa=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xe7fa,0xc2));var _0xae7f=function(_0x3f3c0b,_0x105210){_0x3f3c0b=_0x3f3c0b-0x0;var _0x99b716=_0xe7fa[_0x3f3c0b];return _0x99b716;};'use strict';var multer=require(_0xae7f('0x0'));var util=require(_0xae7f('0x1'));var path=require(_0xae7f('0x2'));var timeout=require('connect-timeout');var express=require(_0xae7f('0x3'));var router=express['Router']();var fs_extra=require(_0xae7f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xae7f('0x5'));var config=require(_0xae7f('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xae7f('0x7')]('/',auth[_0xae7f('0x8')](),controller[_0xae7f('0x9')]);router[_0xae7f('0x7')](_0xae7f('0xa'),auth[_0xae7f('0x8')](),controller[_0xae7f('0xb')]);router[_0xae7f('0xc')]('/',auth['isAuthenticated'](),controller[_0xae7f('0xd')]);router['put'](_0xae7f('0xa'),auth[_0xae7f('0x8')](),controller[_0xae7f('0xe')]);router[_0xae7f('0xf')](_0xae7f('0xa'),auth[_0xae7f('0x8')](),controller[_0xae7f('0x10')]);module[_0xae7f('0x11')]=router; \ No newline at end of file +var _0x68df=['/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0x298de3,_0x43e88d){var _0x2bcf0a=function(_0x4ac970){while(--_0x4ac970){_0x298de3['push'](_0x298de3['shift']());}};_0x2bcf0a(++_0x43e88d);}(_0x68df,0x86));var _0xf68d=function(_0x447b23,_0x49c577){_0x447b23=_0x447b23-0x0;var _0x2f37c7=_0x68df[_0x447b23];return _0x2f37c7;};'use strict';var multer=require(_0xf68d('0x0'));var util=require(_0xf68d('0x1'));var path=require(_0xf68d('0x2'));var timeout=require(_0xf68d('0x3'));var express=require(_0xf68d('0x4'));var router=express[_0xf68d('0x5')]();var fs_extra=require(_0xf68d('0x6'));var auth=require(_0xf68d('0x7'));var interaction=require(_0xf68d('0x8'));var config=require(_0xf68d('0x9'));var controller=require(_0xf68d('0xa'));router[_0xf68d('0xb')]('/',auth[_0xf68d('0xc')](),controller['index']);router[_0xf68d('0xb')](_0xf68d('0xd'),auth[_0xf68d('0xc')](),controller[_0xf68d('0xe')]);router[_0xf68d('0xf')]('/',auth[_0xf68d('0xc')](),controller[_0xf68d('0x10')]);router[_0xf68d('0x11')](_0xf68d('0xd'),auth[_0xf68d('0xc')](),controller[_0xf68d('0x12')]);router['delete'](_0xf68d('0xd'),auth[_0xf68d('0xc')](),controller[_0xf68d('0x13')]);module[_0xf68d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index d777a94..af2f415 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 _0x3db9=['picklist','STRING','sequelize','string','variable','customVariable','keyValue'];(function(_0x57704c,_0x68755d){var _0x4558a3=function(_0x2952d8){while(--_0x2952d8){_0x57704c['push'](_0x57704c['shift']());}};_0x4558a3(++_0x68755d);}(_0x3db9,0x183));var _0x93db=function(_0x2ea6db,_0x4e7aad){_0x2ea6db=_0x2ea6db-0x0;var _0xc7798e=_0x3db9[_0x2ea6db];return _0xc7798e;};'use strict';var Sequelize=require(_0x93db('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x93db('0x1'),_0x93db('0x2'),_0x93db('0x3'),_0x93db('0x4'),_0x93db('0x5')),'defaultValue':_0x93db('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x93db('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x93db('0x1'),_0x93db('0x2'),_0x93db('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x93db('0x6')]},'nameField':{'type':Sequelize[_0x93db('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x93db('0x6')]}}; \ No newline at end of file +var _0x3bd2=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x108def,_0x31c7ed){var _0x7bd739=function(_0x371b92){while(--_0x371b92){_0x108def['push'](_0x108def['shift']());}};_0x7bd739(++_0x31c7ed);}(_0x3bd2,0x8e));var _0x23bd=function(_0x1e7633,_0x529a56){_0x1e7633=_0x1e7633-0x0;var _0x44f860=_0x3bd2[_0x1e7633];return _0x44f860;};'use strict';var Sequelize=require('sequelize');module[_0x23bd('0x0')]={'type':{'type':Sequelize[_0x23bd('0x1')](_0x23bd('0x2'),_0x23bd('0x3'),_0x23bd('0x4'),_0x23bd('0x5'),_0x23bd('0x6')),'defaultValue':_0x23bd('0x2')},'content':{'type':Sequelize[_0x23bd('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x23bd('0x1')](_0x23bd('0x2'),_0x23bd('0x3'),_0x23bd('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x23bd('0x7')]},'customField':{'type':Sequelize[_0x23bd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23bd('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 4a61b2b..22a8f13 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 _0xefb9=['status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','length','include','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xefb9,0x124));var _0x9efb=function(_0x5aa023,_0x1cf1d2){_0x5aa023=_0x5aa023-0x0;var _0x31ceb5=_0xefb9[_0x5aa023];return _0x31ceb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9efb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9efb('0x1'));var moment=require(_0x9efb('0x2'));var BPromise=require(_0x9efb('0x3'));var Mustache=require(_0x9efb('0x4'));var util=require(_0x9efb('0x5'));var path=require(_0x9efb('0x6'));var sox=require(_0x9efb('0x7'));var csv=require(_0x9efb('0x8'));var ejs=require(_0x9efb('0x9'));var fs=require('fs');var fs_extra=require(_0x9efb('0xa'));var _=require(_0x9efb('0xb'));var squel=require(_0x9efb('0xc'));var crypto=require(_0x9efb('0xd'));var jsforce=require(_0x9efb('0xe'));var deskjs=require(_0x9efb('0xf'));var toCsv=require(_0x9efb('0x8'));var querystring=require(_0x9efb('0x10'));var Papa=require(_0x9efb('0x11'));var Redis=require(_0x9efb('0x12'));var authService=require(_0x9efb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9efb('0x14'));var hardwareService=require(_0x9efb('0x15'));var logger=require(_0x9efb('0x16'))(_0x9efb('0x17'));var utils=require(_0x9efb('0x18'));var config=require(_0x9efb('0x19'));var licenseUtil=require(_0x9efb('0x1a'));var db=require(_0x9efb('0x1b'))['db'];function respondWithStatusCode(_0x941fde,_0x4c5f83){_0x4c5f83=_0x4c5f83||0xcc;return function(_0x48c7e0){if(_0x48c7e0){return _0x941fde['sendStatus'](_0x4c5f83);}return _0x941fde['status'](_0x4c5f83)['end']();};}function respondWithResult(_0x55a663,_0x49c009){_0x49c009=_0x49c009||0xc8;return function(_0xb392e9){if(_0xb392e9){return _0x55a663[_0x9efb('0x1c')](_0x49c009)[_0x9efb('0x1d')](_0xb392e9);}};}function respondWithFilteredResult(_0x3f73c6,_0x3213de){return function(_0x3abaf2){if(_0x3abaf2){var _0x2efb41=typeof _0x3213de['offset']===_0x9efb('0x1e')&&typeof _0x3213de['limit']===_0x9efb('0x1e');var _0x342b70=_0x3abaf2[_0x9efb('0x1f')];var _0x5c36cf=_0x2efb41?0x0:_0x3213de[_0x9efb('0x20')];var _0x2133ba=_0x2efb41?_0x3abaf2[_0x9efb('0x1f')]:_0x3213de[_0x9efb('0x20')]+_0x3213de[_0x9efb('0x21')];var _0x5d4223;if(_0x2133ba>=_0x342b70){_0x2133ba=_0x342b70;_0x5d4223=0xc8;}else{_0x5d4223=0xce;}_0x3f73c6[_0x9efb('0x1c')](_0x5d4223);return _0x3f73c6[_0x9efb('0x22')](_0x9efb('0x23'),_0x5c36cf+'-'+_0x2133ba+'/'+_0x342b70)[_0x9efb('0x1d')](_0x3abaf2);}return null;};}function patchUpdates(_0x2c5c5b){return function(_0x42a4f4){try{jsonpatch[_0x9efb('0x24')](_0x42a4f4,_0x2c5c5b,!![]);}catch(_0x1f3138){return BPromise[_0x9efb('0x25')](_0x1f3138);}return _0x42a4f4[_0x9efb('0x26')]();};}function saveUpdates(_0x2de144,_0x121483){return function(_0x125939){if(_0x125939){return _0x125939[_0x9efb('0x27')](_0x2de144)[_0x9efb('0x28')](function(_0x3510bb){return _0x3510bb;});}return null;};}function removeEntity(_0x540645,_0x3893c4){return function(_0x28b208){if(_0x28b208){return _0x28b208[_0x9efb('0x29')]()[_0x9efb('0x28')](function(){_0x540645[_0x9efb('0x1c')](0xcc)[_0x9efb('0x2a')]();});}};}function handleEntityNotFound(_0x4e36c8,_0x18b60c){return function(_0x10b764){if(!_0x10b764){_0x4e36c8[_0x9efb('0x2b')](0x194);}return _0x10b764;};}function handleError(_0x31acec,_0x28063c){_0x28063c=_0x28063c||0x1f4;return function(_0x337335){logger[_0x9efb('0x2c')](_0x337335[_0x9efb('0x2d')]);if(_0x337335[_0x9efb('0x2e')]){delete _0x337335[_0x9efb('0x2e')];}_0x31acec[_0x9efb('0x1c')](_0x28063c)[_0x9efb('0x2f')](_0x337335);};}exports[_0x9efb('0x30')]=function(_0x7eadbf,_0xad41a7){var _0x57e3f7={},_0x26a681={},_0x25d982={'count':0x0,'rows':[]};var _0x1f6ab8=_[_0x9efb('0x31')](db[_0x9efb('0x32')][_0x9efb('0x33')],function(_0xf39862){return{'name':_0xf39862[_0x9efb('0x34')],'type':_0xf39862[_0x9efb('0x35')][_0x9efb('0x36')]};});_0x26a681[_0x9efb('0x37')]=_[_0x9efb('0x31')](_0x1f6ab8,_0x9efb('0x2e'));_0x26a681[_0x9efb('0x38')]=_[_0x9efb('0x39')](_0x7eadbf[_0x9efb('0x38')]);_0x26a681[_0x9efb('0x3a')]=_[_0x9efb('0x3b')](_0x26a681['model'],_0x26a681[_0x9efb('0x38')]);_0x57e3f7[_0x9efb('0x3c')]=_[_0x9efb('0x3b')](_0x26a681[_0x9efb('0x37')],qs[_0x9efb('0x3d')](_0x7eadbf['query'][_0x9efb('0x3d')]));_0x57e3f7[_0x9efb('0x3c')]=_0x57e3f7['attributes']['length']?_0x57e3f7[_0x9efb('0x3c')]:_0x26a681['model'];if(!_0x7eadbf[_0x9efb('0x38')][_0x9efb('0x3e')]('nolimit')){_0x57e3f7[_0x9efb('0x21')]=qs[_0x9efb('0x21')](_0x7eadbf[_0x9efb('0x38')][_0x9efb('0x21')]);_0x57e3f7['offset']=qs[_0x9efb('0x20')](_0x7eadbf[_0x9efb('0x38')][_0x9efb('0x20')]);}_0x57e3f7[_0x9efb('0x3f')]=qs[_0x9efb('0x40')](_0x7eadbf[_0x9efb('0x38')][_0x9efb('0x40')]);_0x57e3f7[_0x9efb('0x41')]=qs[_0x9efb('0x3a')](_[_0x9efb('0x42')](_0x7eadbf[_0x9efb('0x38')],_0x26a681[_0x9efb('0x3a')]),_0x1f6ab8);if(_0x7eadbf['query'][_0x9efb('0x43')]){_0x57e3f7[_0x9efb('0x41')]=_[_0x9efb('0x44')](_0x57e3f7['where'],{'$or':_[_0x9efb('0x31')](_0x1f6ab8,function(_0x4342ab){if(_0x4342ab[_0x9efb('0x35')]!==_0x9efb('0x45')){var _0x1aeafb={};_0x1aeafb[_0x4342ab[_0x9efb('0x2e')]]={'$like':'%'+_0x7eadbf['query'][_0x9efb('0x43')]+'%'};return _0x1aeafb;}})});}_0x57e3f7=_[_0x9efb('0x44')]({},_0x57e3f7,_0x7eadbf['options']);var _0x150e1d={'where':_0x57e3f7[_0x9efb('0x41')]};return db[_0x9efb('0x32')][_0x9efb('0x1f')](_0x150e1d)['then'](function(_0x5400b3){_0x25d982[_0x9efb('0x1f')]=_0x5400b3;if(_0x7eadbf[_0x9efb('0x38')][_0x9efb('0x46')]){_0x57e3f7['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x9efb('0x47')](_0x57e3f7);})[_0x9efb('0x28')](function(_0x26d035){_0x25d982[_0x9efb('0x48')]=_0x26d035;return _0x25d982;})[_0x9efb('0x28')](respondWithFilteredResult(_0xad41a7,_0x57e3f7))[_0x9efb('0x49')](handleError(_0xad41a7,null));};exports['show']=function(_0x239f45,_0x1ef0cf){var _0x417dc5={'raw':!![],'where':{'id':_0x239f45[_0x9efb('0x4a')]['id']}},_0x36d7d8={};_0x36d7d8[_0x9efb('0x37')]=_[_0x9efb('0x39')](db[_0x9efb('0x32')]['rawAttributes']);_0x36d7d8['query']=_[_0x9efb('0x39')](_0x239f45['query']);_0x36d7d8[_0x9efb('0x3a')]=_[_0x9efb('0x3b')](_0x36d7d8[_0x9efb('0x37')],_0x36d7d8['query']);_0x417dc5[_0x9efb('0x3c')]=_[_0x9efb('0x3b')](_0x36d7d8[_0x9efb('0x37')],qs[_0x9efb('0x3d')](_0x239f45[_0x9efb('0x38')][_0x9efb('0x3d')]));_0x417dc5['attributes']=_0x417dc5[_0x9efb('0x3c')][_0x9efb('0x4b')]?_0x417dc5['attributes']:_0x36d7d8[_0x9efb('0x37')];if(_0x239f45[_0x9efb('0x38')]['includeAll']){_0x417dc5[_0x9efb('0x4c')]=[{'all':!![]}];}_0x417dc5=_[_0x9efb('0x44')]({},_0x417dc5,_0x239f45['options']);return db[_0x9efb('0x32')][_0x9efb('0x4d')](_0x417dc5)[_0x9efb('0x28')](handleEntityNotFound(_0x1ef0cf,null))[_0x9efb('0x28')](respondWithResult(_0x1ef0cf,null))[_0x9efb('0x49')](handleError(_0x1ef0cf,null));};exports[_0x9efb('0x4e')]=function(_0x5ea050,_0x125e6c){return db['Dynamics365Field']['create'](_0x5ea050[_0x9efb('0x4f')],{})['then'](respondWithResult(_0x125e6c,0xc9))['catch'](handleError(_0x125e6c,null));};exports['update']=function(_0x270ae5,_0x109d3b){if(_0x270ae5[_0x9efb('0x4f')]['id']){delete _0x270ae5[_0x9efb('0x4f')]['id'];}return db[_0x9efb('0x32')][_0x9efb('0x4d')]({'where':{'id':_0x270ae5[_0x9efb('0x4a')]['id']}})[_0x9efb('0x28')](handleEntityNotFound(_0x109d3b,null))['then'](saveUpdates(_0x270ae5[_0x9efb('0x4f')],null))[_0x9efb('0x28')](respondWithResult(_0x109d3b,null))[_0x9efb('0x49')](handleError(_0x109d3b,null));};exports[_0x9efb('0x29')]=function(_0x464bbc,_0x377448){return db[_0x9efb('0x32')]['find']({'where':{'id':_0x464bbc['params']['id']}})[_0x9efb('0x28')](handleEntityNotFound(_0x377448,null))[_0x9efb('0x28')](removeEntity(_0x377448,null))[_0x9efb('0x49')](handleError(_0x377448,null));}; \ No newline at end of file +var _0x1b18=['filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','filters','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','then','destroy','end','stack','name','send','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick'];(function(_0x3c38b0,_0x4256d3){var _0x4484eb=function(_0x4aa25c){while(--_0x4aa25c){_0x3c38b0['push'](_0x3c38b0['shift']());}};_0x4484eb(++_0x4256d3);}(_0x1b18,0x1cb));var _0x81b1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1b18[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x81b1('0x0'));var rimraf=require(_0x81b1('0x1'));var zipdir=require(_0x81b1('0x2'));var jsonpatch=require(_0x81b1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81b1('0x4'));var util=require(_0x81b1('0x5'));var path=require(_0x81b1('0x6'));var sox=require(_0x81b1('0x7'));var csv=require(_0x81b1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x81b1('0x9'));var _=require(_0x81b1('0xa'));var squel=require('squel');var crypto=require(_0x81b1('0xb'));var jsforce=require(_0x81b1('0xc'));var deskjs=require(_0x81b1('0xd'));var toCsv=require(_0x81b1('0x8'));var querystring=require(_0x81b1('0xe'));var Papa=require(_0x81b1('0xf'));var Redis=require(_0x81b1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x81b1('0x11'));var as=require(_0x81b1('0x12'));var hardwareService=require(_0x81b1('0x13'));var logger=require(_0x81b1('0x14'))('api');var utils=require(_0x81b1('0x15'));var config=require(_0x81b1('0x16'));var licenseUtil=require(_0x81b1('0x17'));var db=require(_0x81b1('0x18'))['db'];function respondWithStatusCode(_0x1707da,_0x4bffc6){_0x4bffc6=_0x4bffc6||0xcc;return function(_0x1388f7){if(_0x1388f7){return _0x1707da[_0x81b1('0x19')](_0x4bffc6);}return _0x1707da[_0x81b1('0x1a')](_0x4bffc6)['end']();};}function respondWithResult(_0x5ce75e,_0x29559e){_0x29559e=_0x29559e||0xc8;return function(_0x56fb43){if(_0x56fb43){return _0x5ce75e['status'](_0x29559e)[_0x81b1('0x1b')](_0x56fb43);}};}function respondWithFilteredResult(_0x1e3d55,_0x4c5eed){return function(_0x5ce066){if(_0x5ce066){var _0x212c5b=typeof _0x4c5eed[_0x81b1('0x1c')]===_0x81b1('0x1d')&&typeof _0x4c5eed['limit']===_0x81b1('0x1d');var _0x469ed9=_0x5ce066['count'];var _0x296fe2=_0x212c5b?0x0:_0x4c5eed[_0x81b1('0x1c')];var _0x122973=_0x212c5b?_0x5ce066[_0x81b1('0x1e')]:_0x4c5eed[_0x81b1('0x1c')]+_0x4c5eed[_0x81b1('0x1f')];var _0x2c4aef;if(_0x122973>=_0x469ed9){_0x122973=_0x469ed9;_0x2c4aef=0xc8;}else{_0x2c4aef=0xce;}_0x1e3d55[_0x81b1('0x1a')](_0x2c4aef);return _0x1e3d55[_0x81b1('0x20')]('Content-Range',_0x296fe2+'-'+_0x122973+'/'+_0x469ed9)[_0x81b1('0x1b')](_0x5ce066);}return null;};}function patchUpdates(_0x57c953){return function(_0x209198){try{jsonpatch['apply'](_0x209198,_0x57c953,!![]);}catch(_0xd37841){return BPromise[_0x81b1('0x21')](_0xd37841);}return _0x209198[_0x81b1('0x22')]();};}function saveUpdates(_0x47acad,_0x4dfade){return function(_0x2d2b2f){if(_0x2d2b2f){return _0x2d2b2f['update'](_0x47acad)[_0x81b1('0x23')](function(_0x2d8db8){return _0x2d8db8;});}return null;};}function removeEntity(_0x160b05,_0x534ea2){return function(_0x1a8c14){if(_0x1a8c14){return _0x1a8c14[_0x81b1('0x24')]()['then'](function(){_0x160b05[_0x81b1('0x1a')](0xcc)[_0x81b1('0x25')]();});}};}function handleEntityNotFound(_0xdf1374,_0x54af96){return function(_0x19e446){if(!_0x19e446){_0xdf1374[_0x81b1('0x19')](0x194);}return _0x19e446;};}function handleError(_0x504694,_0x5963b0){_0x5963b0=_0x5963b0||0x1f4;return function(_0x4614d0){logger['error'](_0x4614d0[_0x81b1('0x26')]);if(_0x4614d0['name']){delete _0x4614d0[_0x81b1('0x27')];}_0x504694[_0x81b1('0x1a')](_0x5963b0)[_0x81b1('0x28')](_0x4614d0);};}exports['index']=function(_0x36e0e8,_0x47cce2){var _0x347047={},_0x4df08a={},_0x19d578={'count':0x0,'rows':[]};var _0x3a9e3a=_['map'](db[_0x81b1('0x29')][_0x81b1('0x2a')],function(_0x422b31){return{'name':_0x422b31[_0x81b1('0x2b')],'type':_0x422b31[_0x81b1('0x2c')][_0x81b1('0x2d')]};});_0x4df08a[_0x81b1('0x2e')]=_[_0x81b1('0x2f')](_0x3a9e3a,_0x81b1('0x27'));_0x4df08a[_0x81b1('0x30')]=_[_0x81b1('0x31')](_0x36e0e8[_0x81b1('0x30')]);_0x4df08a['filters']=_[_0x81b1('0x32')](_0x4df08a[_0x81b1('0x2e')],_0x4df08a[_0x81b1('0x30')]);_0x347047['attributes']=_[_0x81b1('0x32')](_0x4df08a[_0x81b1('0x2e')],qs[_0x81b1('0x33')](_0x36e0e8[_0x81b1('0x30')]['fields']));_0x347047['attributes']=_0x347047[_0x81b1('0x34')][_0x81b1('0x35')]?_0x347047['attributes']:_0x4df08a[_0x81b1('0x2e')];if(!_0x36e0e8['query'][_0x81b1('0x36')](_0x81b1('0x37'))){_0x347047[_0x81b1('0x1f')]=qs['limit'](_0x36e0e8[_0x81b1('0x30')]['limit']);_0x347047[_0x81b1('0x1c')]=qs['offset'](_0x36e0e8[_0x81b1('0x30')][_0x81b1('0x1c')]);}_0x347047[_0x81b1('0x38')]=qs['sort'](_0x36e0e8[_0x81b1('0x30')]['sort']);_0x347047[_0x81b1('0x39')]=qs['filters'](_[_0x81b1('0x3a')](_0x36e0e8[_0x81b1('0x30')],_0x4df08a['filters']),_0x3a9e3a);if(_0x36e0e8[_0x81b1('0x30')][_0x81b1('0x3b')]){_0x347047['where']=_['merge'](_0x347047[_0x81b1('0x39')],{'$or':_['map'](_0x3a9e3a,function(_0x1f7884){if(_0x1f7884[_0x81b1('0x2c')]!==_0x81b1('0x3c')){var _0x9560b9={};_0x9560b9[_0x1f7884[_0x81b1('0x27')]]={'$like':'%'+_0x36e0e8['query'][_0x81b1('0x3b')]+'%'};return _0x9560b9;}})});}_0x347047=_[_0x81b1('0x3d')]({},_0x347047,_0x36e0e8[_0x81b1('0x3e')]);var _0x24aa48={'where':_0x347047[_0x81b1('0x39')]};return db[_0x81b1('0x29')][_0x81b1('0x1e')](_0x24aa48)[_0x81b1('0x23')](function(_0x371949){_0x19d578[_0x81b1('0x1e')]=_0x371949;if(_0x36e0e8['query'][_0x81b1('0x3f')]){_0x347047[_0x81b1('0x40')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x81b1('0x41')](_0x347047);})[_0x81b1('0x23')](function(_0x3c144c){_0x19d578[_0x81b1('0x42')]=_0x3c144c;return _0x19d578;})[_0x81b1('0x23')](respondWithFilteredResult(_0x47cce2,_0x347047))['catch'](handleError(_0x47cce2,null));};exports[_0x81b1('0x43')]=function(_0x259236,_0x3937b2){var _0x3333cf={'raw':!![],'where':{'id':_0x259236[_0x81b1('0x44')]['id']}},_0x1e61f1={};_0x1e61f1['model']=_[_0x81b1('0x31')](db[_0x81b1('0x29')]['rawAttributes']);_0x1e61f1['query']=_[_0x81b1('0x31')](_0x259236[_0x81b1('0x30')]);_0x1e61f1[_0x81b1('0x45')]=_['intersection'](_0x1e61f1['model'],_0x1e61f1[_0x81b1('0x30')]);_0x3333cf[_0x81b1('0x34')]=_[_0x81b1('0x32')](_0x1e61f1[_0x81b1('0x2e')],qs[_0x81b1('0x33')](_0x259236['query']['fields']));_0x3333cf[_0x81b1('0x34')]=_0x3333cf[_0x81b1('0x34')][_0x81b1('0x35')]?_0x3333cf[_0x81b1('0x34')]:_0x1e61f1[_0x81b1('0x2e')];if(_0x259236['query'][_0x81b1('0x3f')]){_0x3333cf[_0x81b1('0x40')]=[{'all':!![]}];}_0x3333cf=_[_0x81b1('0x3d')]({},_0x3333cf,_0x259236[_0x81b1('0x3e')]);return db[_0x81b1('0x29')][_0x81b1('0x46')](_0x3333cf)['then'](handleEntityNotFound(_0x3937b2,null))[_0x81b1('0x23')](respondWithResult(_0x3937b2,null))[_0x81b1('0x47')](handleError(_0x3937b2,null));};exports[_0x81b1('0x48')]=function(_0xc1bb34,_0xf98314){return db['Dynamics365Field']['create'](_0xc1bb34['body'],{})[_0x81b1('0x23')](respondWithResult(_0xf98314,0xc9))[_0x81b1('0x47')](handleError(_0xf98314,null));};exports['update']=function(_0x52e90,_0x1679cc){if(_0x52e90[_0x81b1('0x49')]['id']){delete _0x52e90['body']['id'];}return db['Dynamics365Field'][_0x81b1('0x46')]({'where':{'id':_0x52e90[_0x81b1('0x44')]['id']}})[_0x81b1('0x23')](handleEntityNotFound(_0x1679cc,null))[_0x81b1('0x23')](saveUpdates(_0x52e90[_0x81b1('0x49')],null))[_0x81b1('0x23')](respondWithResult(_0x1679cc,null))[_0x81b1('0x47')](handleError(_0x1679cc,null));};exports[_0x81b1('0x24')]=function(_0x35e616,_0x586cfd){return db['Dynamics365Field'][_0x81b1('0x46')]({'where':{'id':_0x35e616[_0x81b1('0x44')]['id']}})['then'](handleEntityNotFound(_0x586cfd,null))[_0x81b1('0x23')](removeEntity(_0x586cfd,null))[_0x81b1('0x47')](handleError(_0x586cfd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 7ba60bf..62b697a 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 _0xc669=['rimraf','../../config/environment','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4ab0b5,_0x458451){var _0x57afc3=function(_0x25c618){while(--_0x25c618){_0x4ab0b5['push'](_0x4ab0b5['shift']());}};_0x57afc3(++_0x458451);}(_0xc669,0xa2));var _0x9c66=function(_0x486ba0,_0x69e139){_0x486ba0=_0x486ba0-0x0;var _0x4f811c=_0xc669[_0x486ba0];return _0x4f811c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9c66('0x0'))(_0x9c66('0x1'));var moment=require(_0x9c66('0x2'));var BPromise=require(_0x9c66('0x3'));var rp=require(_0x9c66('0x4'));var fs=require('fs');var path=require(_0x9c66('0x5'));var rimraf=require(_0x9c66('0x6'));var config=require(_0x9c66('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0x9c66('0x8')]=function(_0x34c1cb,_0x308113){return _0x34c1cb[_0x9c66('0x9')](_0x9c66('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x9c66('0xb'),'fields':[_0x9c66('0xc'),_0x9c66('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b87=['FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','idField'];(function(_0x406a4b,_0x466e37){var _0x419ee3=function(_0x3ca4de){while(--_0x3ca4de){_0x406a4b['push'](_0x406a4b['shift']());}};_0x419ee3(++_0x466e37);}(_0x1b87,0x189));var _0x71b8=function(_0x2f036e,_0x408b81){_0x2f036e=_0x2f036e-0x0;var _0x260ba1=_0x1b87[_0x2f036e];return _0x260ba1;};'use strict';var _=require(_0x71b8('0x0'));var util=require(_0x71b8('0x1'));var logger=require('../../config/logger')(_0x71b8('0x2'));var moment=require('moment');var BPromise=require(_0x71b8('0x3'));var rp=require(_0x71b8('0x4'));var fs=require('fs');var path=require(_0x71b8('0x5'));var rimraf=require(_0x71b8('0x6'));var config=require(_0x71b8('0x7'));var attributes=require(_0x71b8('0x8'));module[_0x71b8('0x9')]=function(_0x1f097e,_0xedd87a){return _0x1f097e[_0x71b8('0xa')](_0x71b8('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x71b8('0xc'),_0x71b8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 9931e67..fb9a7d7 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 _0xbbbe=['../../config/environment','jayson/promise','client','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5e0bfe,_0x747312){var _0x6468b8=function(_0x20e5e0){while(--_0x20e5e0){_0x5e0bfe['push'](_0x5e0bfe['shift']());}};_0x6468b8(++_0x747312);}(_0xbbbe,0x1c5));var _0xebbb=function(_0x38dd7d,_0x58c2da){_0x38dd7d=_0x38dd7d-0x0;var _0x34e946=_0xbbbe[_0x38dd7d];return _0x34e946;};'use strict';var _=require(_0xebbb('0x0'));var util=require(_0xebbb('0x1'));var moment=require(_0xebbb('0x2'));var BPromise=require(_0xebbb('0x3'));var rs=require(_0xebbb('0x4'));var fs=require('fs');var Redis=require(_0xebbb('0x5'));var db=require(_0xebbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xebbb('0x7'))(_0xebbb('0x8'));var config=require(_0xebbb('0x9'));var jayson=require(_0xebbb('0xa'));var client=jayson[_0xebbb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c1838,_0x30e982,_0xd7481b){return new BPromise(function(_0x492d51,_0x361d33){return client[_0xebbb('0xc')](_0x1c1838,_0xd7481b)['then'](function(_0x3c02c4){logger[_0xebbb('0xd')](_0xebbb('0xe'),_0x30e982,_0xebbb('0xf'));logger[_0xebbb('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x30e982,_0xebbb('0xf'),JSON['stringify'](_0x3c02c4));if(_0x3c02c4[_0xebbb('0x11')]){if(_0x3c02c4['error'][_0xebbb('0x12')]===0x1f4){logger[_0xebbb('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x30e982,_0x3c02c4[_0xebbb('0x11')][_0xebbb('0x13')]);return _0x361d33(_0x3c02c4[_0xebbb('0x11')][_0xebbb('0x13')]);}logger[_0xebbb('0x11')](_0xebbb('0xe'),_0x30e982,_0x3c02c4[_0xebbb('0x11')][_0xebbb('0x13')]);return _0x492d51(_0x3c02c4[_0xebbb('0x11')][_0xebbb('0x13')]);}else{logger[_0xebbb('0xd')](_0xebbb('0xe'),_0x30e982,_0xebbb('0xf'));_0x492d51(_0x3c02c4[_0xebbb('0x14')][_0xebbb('0x13')]);}})[_0xebbb('0x15')](function(_0x28a206){logger[_0xebbb('0x11')](_0xebbb('0xe'),_0x30e982,_0x28a206);_0x361d33(_0x28a206);});});} \ No newline at end of file +var _0x60d1=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x1ac658,_0x3dd4c5){var _0x5598e3=function(_0x39d6b){while(--_0x39d6b){_0x1ac658['push'](_0x1ac658['shift']());}};_0x5598e3(++_0x3dd4c5);}(_0x60d1,0x1cf));var _0x160d=function(_0x1ea9dd,_0x1798f1){_0x1ea9dd=_0x1ea9dd-0x0;var _0x1409af=_0x60d1[_0x1ea9dd];return _0x1409af;};'use strict';var _=require(_0x160d('0x0'));var util=require(_0x160d('0x1'));var moment=require('moment');var BPromise=require(_0x160d('0x2'));var rs=require(_0x160d('0x3'));var fs=require('fs');var Redis=require(_0x160d('0x4'));var db=require(_0x160d('0x5'))['db'];var utils=require(_0x160d('0x6'));var logger=require(_0x160d('0x7'))(_0x160d('0x8'));var config=require(_0x160d('0x9'));var jayson=require(_0x160d('0xa'));var client=jayson[_0x160d('0xb')][_0x160d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x429c40,_0x4d6974,_0x33181d){return new BPromise(function(_0x4610d3,_0x5806e6){return client[_0x160d('0xd')](_0x429c40,_0x33181d)['then'](function(_0x5a3caa){logger[_0x160d('0xe')](_0x160d('0xf'),_0x4d6974,_0x160d('0x10'));logger[_0x160d('0x11')](_0x160d('0x12'),_0x4d6974,_0x160d('0x10'),JSON['stringify'](_0x5a3caa));if(_0x5a3caa[_0x160d('0x13')]){if(_0x5a3caa[_0x160d('0x13')][_0x160d('0x14')]===0x1f4){logger[_0x160d('0x13')](_0x160d('0xf'),_0x4d6974,_0x5a3caa[_0x160d('0x13')][_0x160d('0x15')]);return _0x5806e6(_0x5a3caa[_0x160d('0x13')]['message']);}logger[_0x160d('0x13')](_0x160d('0xf'),_0x4d6974,_0x5a3caa[_0x160d('0x13')][_0x160d('0x15')]);return _0x4610d3(_0x5a3caa[_0x160d('0x13')][_0x160d('0x15')]);}else{logger[_0x160d('0xe')](_0x160d('0xf'),_0x4d6974,_0x160d('0x10'));_0x4610d3(_0x5a3caa[_0x160d('0x16')]['message']);}})[_0x160d('0x17')](function(_0x588f32){logger['error'](_0x160d('0xf'),_0x4d6974,_0x588f32);_0x5806e6(_0x588f32);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 59e0037..02cea1b 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 _0x01b5=['post','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x01b5,0x91));var _0x501b=function(_0x37ea15,_0x5a0470){_0x37ea15=_0x37ea15-0x0;var _0x453798=_0x01b5[_0x37ea15];return _0x453798;};'use strict';var multer=require(_0x501b('0x0'));var util=require(_0x501b('0x1'));var path=require(_0x501b('0x2'));var timeout=require(_0x501b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x501b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x501b('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x501b('0x6')]('/',auth[_0x501b('0x7')](),controller[_0x501b('0x8')]);router[_0x501b('0x6')](_0x501b('0x9'),auth[_0x501b('0x7')](),controller[_0x501b('0xa')]);router[_0x501b('0x6')](_0x501b('0xb'),auth['isAuthenticated'](),controller[_0x501b('0xc')]);router[_0x501b('0x6')](_0x501b('0xd'),auth['isAuthenticated'](),controller[_0x501b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x501b('0xf')](_0x501b('0xb'),auth[_0x501b('0x7')](),controller[_0x501b('0x10')]);router['put']('/:id',auth[_0x501b('0x7')](),controller[_0x501b('0x11')]);router[_0x501b('0x12')]('/:id',auth[_0x501b('0x7')](),controller['destroy']);module[_0x501b('0x13')]=router; \ No newline at end of file +var _0x24a8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','addConfiguration','put','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x4f33cb,_0x46c73d){var _0x2b2dbd=function(_0x2e4abf){while(--_0x2e4abf){_0x4f33cb['push'](_0x4f33cb['shift']());}};_0x2b2dbd(++_0x46c73d);}(_0x24a8,0x1c5));var _0x824a=function(_0x32e0ca,_0x169682){_0x32e0ca=_0x32e0ca-0x0;var _0x24c7ac=_0x24a8[_0x32e0ca];return _0x24c7ac;};'use strict';var multer=require(_0x824a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x824a('0x1'));var express=require(_0x824a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x824a('0x3'));var interaction=require(_0x824a('0x4'));var config=require(_0x824a('0x5'));var controller=require(_0x824a('0x6'));router[_0x824a('0x7')]('/',auth['isAuthenticated'](),controller[_0x824a('0x8')]);router['get'](_0x824a('0x9'),auth[_0x824a('0xa')](),controller['show']);router['get'](_0x824a('0xb'),auth[_0x824a('0xa')](),controller[_0x824a('0xc')]);router['get'](_0x824a('0xd'),auth[_0x824a('0xa')](),controller['getFields']);router['post']('/',auth[_0x824a('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0x824a('0xa')](),controller[_0x824a('0xe')]);router[_0x824a('0xf')](_0x824a('0x9'),auth[_0x824a('0xa')](),controller['update']);router[_0x824a('0x10')](_0x824a('0x9'),auth[_0x824a('0xa')](),controller[_0x824a('0x11')]);module[_0x824a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 47e7dba..183a455 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 _0x9582=['exports','STRING','username','remoteUri','sequelize'];(function(_0x20b1cc,_0x286a41){var _0x134bfe=function(_0x4ad8d7){while(--_0x4ad8d7){_0x20b1cc['push'](_0x20b1cc['shift']());}};_0x134bfe(++_0x286a41);}(_0x9582,0x95));var _0x2958=function(_0x5532e0,_0x22097a){_0x5532e0=_0x5532e0-0x0;var _0x4518a1=_0x9582[_0x5532e0];return _0x4518a1;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'name':{'type':Sequelize[_0x2958('0x2')]},'description':{'type':Sequelize[_0x2958('0x2')]},'username':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x4')},'serverUrl':{'type':Sequelize[_0x2958('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1c9a=['sequelize','STRING','username','remoteUri'];(function(_0x292a35,_0x5a325f){var _0xb5d07a=function(_0x18e078){while(--_0x18e078){_0x292a35['push'](_0x292a35['shift']());}};_0xb5d07a(++_0x5a325f);}(_0x1c9a,0x98));var _0xa1c9=function(_0x4b7aca,_0x5cfe48){_0x4b7aca=_0x4b7aca-0x0;var _0x542539=_0x1c9a[_0x4b7aca];return _0x542539;};'use strict';var Sequelize=require(_0xa1c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1c9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa1c9('0x1')],'unique':_0xa1c9('0x2')},'apiKey':{'type':Sequelize[_0xa1c9('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa1c9('0x3')},'serverUrl':{'type':Sequelize[_0xa1c9('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 2abcc37..202add4 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 _0xa1b9=['util','sox','to-csv','ejs','fs-extra','squel','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','filter','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x52953b,_0x4b85ae){var _0x87f24b=function(_0x3f47c7){while(--_0x3f47c7){_0x52953b['push'](_0x52953b['shift']());}};_0x87f24b(++_0x4b85ae);}(_0xa1b9,0x71));var _0x9a1b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa1b9[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x9a1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a1b('0x1'));var jsonpatch=require(_0x9a1b('0x2'));var rp=require(_0x9a1b('0x3'));var moment=require(_0x9a1b('0x4'));var BPromise=require(_0x9a1b('0x5'));var Mustache=require(_0x9a1b('0x6'));var util=require(_0x9a1b('0x7'));var path=require('path');var sox=require(_0x9a1b('0x8'));var csv=require(_0x9a1b('0x9'));var ejs=require(_0x9a1b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a1b('0xb'));var _=require('lodash');var squel=require(_0x9a1b('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a1b('0xd'));var deskjs=require(_0x9a1b('0xe'));var toCsv=require(_0x9a1b('0x9'));var querystring=require(_0x9a1b('0xf'));var Papa=require(_0x9a1b('0x10'));var Redis=require('ioredis');var authService=require(_0x9a1b('0x11'));var qs=require(_0x9a1b('0x12'));var as=require(_0x9a1b('0x13'));var hardwareService=require(_0x9a1b('0x14'));var logger=require(_0x9a1b('0x15'))(_0x9a1b('0x16'));var utils=require(_0x9a1b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a1b('0x18'));var db=require(_0x9a1b('0x19'))['db'];var integrations=require(_0x9a1b('0x1a'));function respondWithStatusCode(_0x5ee9d3,_0x1d016d){_0x1d016d=_0x1d016d||0xcc;return function(_0x3a129b){if(_0x3a129b){return _0x5ee9d3[_0x9a1b('0x1b')](_0x1d016d);}return _0x5ee9d3[_0x9a1b('0x1c')](_0x1d016d)[_0x9a1b('0x1d')]();};}function respondWithResult(_0x157b6f,_0x3fe388){_0x3fe388=_0x3fe388||0xc8;return function(_0x18df50){if(_0x18df50){return _0x157b6f[_0x9a1b('0x1c')](_0x3fe388)[_0x9a1b('0x1e')](_0x18df50);}};}function respondWithFilteredResult(_0x5c397f,_0x357cd9){return function(_0x2440fc){if(_0x2440fc){var _0x5a1d3b=typeof _0x357cd9[_0x9a1b('0x1f')]===_0x9a1b('0x20')&&typeof _0x357cd9[_0x9a1b('0x21')]===_0x9a1b('0x20');var _0x402d0c=_0x2440fc[_0x9a1b('0x22')];var _0xe7a820=_0x5a1d3b?0x0:_0x357cd9['offset'];var _0x403250=_0x5a1d3b?_0x2440fc[_0x9a1b('0x22')]:_0x357cd9[_0x9a1b('0x1f')]+_0x357cd9[_0x9a1b('0x21')];var _0x2dacdc;if(_0x403250>=_0x402d0c){_0x403250=_0x402d0c;_0x2dacdc=0xc8;}else{_0x2dacdc=0xce;}_0x5c397f['status'](_0x2dacdc);return _0x5c397f[_0x9a1b('0x23')](_0x9a1b('0x24'),_0xe7a820+'-'+_0x403250+'/'+_0x402d0c)[_0x9a1b('0x1e')](_0x2440fc);}return null;};}function patchUpdates(_0x1977a7){return function(_0x4a0ccd){try{jsonpatch[_0x9a1b('0x25')](_0x4a0ccd,_0x1977a7,!![]);}catch(_0x303110){return BPromise[_0x9a1b('0x26')](_0x303110);}return _0x4a0ccd[_0x9a1b('0x27')]();};}function saveUpdates(_0x1c9ab3,_0x327cac){return function(_0x2b8cfe){if(_0x2b8cfe){return _0x2b8cfe[_0x9a1b('0x28')](_0x1c9ab3)[_0x9a1b('0x29')](function(_0x37971c){return _0x37971c;});}return null;};}function removeEntity(_0x5841c1,_0x2439e9){return function(_0x3392da){if(_0x3392da){return _0x3392da[_0x9a1b('0x2a')]()['then'](function(){_0x5841c1['status'](0xcc)[_0x9a1b('0x1d')]();});}};}function handleEntityNotFound(_0x52fce9,_0x17704b){return function(_0x4a461e){if(!_0x4a461e){_0x52fce9['sendStatus'](0x194);}return _0x4a461e;};}function handleError(_0x48e736,_0x432a3d){_0x432a3d=_0x432a3d||0x1f4;return function(_0x50ebc5){logger[_0x9a1b('0x2b')](_0x50ebc5[_0x9a1b('0x2c')]);if(_0x50ebc5[_0x9a1b('0x2d')]){delete _0x50ebc5[_0x9a1b('0x2d')];}_0x48e736[_0x9a1b('0x1c')](_0x432a3d)[_0x9a1b('0x2e')](_0x50ebc5);};}exports[_0x9a1b('0x2f')]=function(_0x1453c4,_0x4070aa){var _0x2d9ca8={},_0x56f3e8={},_0x5735a4={'count':0x0,'rows':[]};var _0x46fca0=_[_0x9a1b('0x30')](db['FreshdeskAccount'][_0x9a1b('0x31')],function(_0x43c2e7){return{'name':_0x43c2e7[_0x9a1b('0x32')],'type':_0x43c2e7[_0x9a1b('0x33')][_0x9a1b('0x34')]};});_0x56f3e8[_0x9a1b('0x35')]=_[_0x9a1b('0x30')](_0x46fca0,_0x9a1b('0x2d'));_0x56f3e8[_0x9a1b('0x36')]=_['keys'](_0x1453c4[_0x9a1b('0x36')]);_0x56f3e8['filters']=_[_0x9a1b('0x37')](_0x56f3e8[_0x9a1b('0x35')],_0x56f3e8[_0x9a1b('0x36')]);_0x2d9ca8[_0x9a1b('0x38')]=_['intersection'](_0x56f3e8[_0x9a1b('0x35')],qs[_0x9a1b('0x39')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x2d9ca8[_0x9a1b('0x38')]=_0x2d9ca8[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x2d9ca8[_0x9a1b('0x38')]:_0x56f3e8[_0x9a1b('0x35')];if(!_0x1453c4['query'][_0x9a1b('0x3b')](_0x9a1b('0x3c'))){_0x2d9ca8[_0x9a1b('0x21')]=qs[_0x9a1b('0x21')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x21')]);_0x2d9ca8[_0x9a1b('0x1f')]=qs['offset'](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x1f')]);}_0x2d9ca8[_0x9a1b('0x3d')]=qs[_0x9a1b('0x3e')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x3e')]);_0x2d9ca8[_0x9a1b('0x3f')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x41')](_0x1453c4['query'],_0x56f3e8[_0x9a1b('0x40')]),_0x46fca0);if(_0x1453c4[_0x9a1b('0x36')]['filter']){_0x2d9ca8[_0x9a1b('0x3f')]=_[_0x9a1b('0x42')](_0x2d9ca8['where'],{'$or':_['map'](_0x46fca0,function(_0x4e7d1e){if(_0x4e7d1e[_0x9a1b('0x33')]!==_0x9a1b('0x43')){var _0x3ccca0={};_0x3ccca0[_0x4e7d1e[_0x9a1b('0x2d')]]={'$like':'%'+_0x1453c4[_0x9a1b('0x36')]['filter']+'%'};return _0x3ccca0;}})});}_0x2d9ca8=_[_0x9a1b('0x42')]({},_0x2d9ca8,_0x1453c4[_0x9a1b('0x44')]);var _0x2683a1={'where':_0x2d9ca8[_0x9a1b('0x3f')]};return db[_0x9a1b('0x45')][_0x9a1b('0x22')](_0x2683a1)[_0x9a1b('0x29')](function(_0x4da1c0){_0x5735a4[_0x9a1b('0x22')]=_0x4da1c0;if(_0x1453c4[_0x9a1b('0x36')]['includeAll']){_0x2d9ca8[_0x9a1b('0x46')]=[{'all':!![]}];}return db[_0x9a1b('0x45')][_0x9a1b('0x47')](_0x2d9ca8);})[_0x9a1b('0x29')](function(_0x59b901){_0x5735a4[_0x9a1b('0x48')]=_0x59b901;return _0x5735a4;})[_0x9a1b('0x29')](respondWithFilteredResult(_0x4070aa,_0x2d9ca8))[_0x9a1b('0x49')](handleError(_0x4070aa,null));};exports[_0x9a1b('0x4a')]=function(_0x1863d8,_0x18a606){var _0x515bb8={'raw':![],'where':{'id':_0x1863d8[_0x9a1b('0x4b')]['id']}},_0x2f852e={};_0x2f852e[_0x9a1b('0x35')]=_['keys'](db[_0x9a1b('0x45')][_0x9a1b('0x31')]);_0x2f852e[_0x9a1b('0x36')]=_[_0x9a1b('0x4c')](_0x1863d8[_0x9a1b('0x36')]);_0x2f852e[_0x9a1b('0x40')]=_[_0x9a1b('0x37')](_0x2f852e['model'],_0x2f852e[_0x9a1b('0x36')]);_0x515bb8[_0x9a1b('0x38')]=_[_0x9a1b('0x37')](_0x2f852e[_0x9a1b('0x35')],qs['fields'](_0x1863d8[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x515bb8[_0x9a1b('0x38')]=_0x515bb8[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x515bb8[_0x9a1b('0x38')]:_0x2f852e[_0x9a1b('0x35')];if(_0x1863d8['query']['includeAll']){_0x515bb8[_0x9a1b('0x46')]=[{'all':!![]}];}_0x515bb8=_[_0x9a1b('0x42')]({},_0x515bb8,_0x1863d8['options']);return db[_0x9a1b('0x45')][_0x9a1b('0x4d')](_0x515bb8)[_0x9a1b('0x29')](handleEntityNotFound(_0x18a606,null))['then'](respondWithResult(_0x18a606,null))['catch'](handleError(_0x18a606,null));};exports['create']=function(_0x31b879,_0xd5f4bf){return db['FreshdeskAccount'][_0x9a1b('0x4e')](_0x31b879[_0x9a1b('0x4f')],{})['then'](respondWithResult(_0xd5f4bf,0xc9))['catch'](handleError(_0xd5f4bf,null));};exports[_0x9a1b('0x28')]=function(_0x2ff4b5,_0x511510){if(_0x2ff4b5[_0x9a1b('0x4f')]['id']){delete _0x2ff4b5[_0x9a1b('0x4f')]['id'];}return db[_0x9a1b('0x45')][_0x9a1b('0x4d')]({'where':{'id':_0x2ff4b5['params']['id']}})['then'](handleEntityNotFound(_0x511510,null))['then'](saveUpdates(_0x2ff4b5[_0x9a1b('0x4f')],null))[_0x9a1b('0x29')](respondWithResult(_0x511510,null))[_0x9a1b('0x49')](handleError(_0x511510,null));};exports[_0x9a1b('0x2a')]=function(_0x1a608a,_0x36bb41){return db[_0x9a1b('0x45')][_0x9a1b('0x4d')]({'where':{'id':_0x1a608a[_0x9a1b('0x4b')]['id']}})[_0x9a1b('0x29')](handleEntityNotFound(_0x36bb41,null))[_0x9a1b('0x29')](removeEntity(_0x36bb41,null))[_0x9a1b('0x49')](handleError(_0x36bb41,null));};exports[_0x9a1b('0x50')]=function(_0x2bc22a,_0x5cb018,_0x5c37d2){var _0x25b950={};var _0x10f485={};var _0x25bf42;var _0x2ae8f3;return db[_0x9a1b('0x45')][_0x9a1b('0x51')]({'where':{'id':_0x2bc22a[_0x9a1b('0x4b')]['id']}})[_0x9a1b('0x29')](handleEntityNotFound(_0x5cb018,null))[_0x9a1b('0x29')](function(_0x5c35b7){if(_0x5c35b7){_0x25bf42=_0x5c35b7;_0x10f485[_0x9a1b('0x35')]=_[_0x9a1b('0x4c')](db[_0x9a1b('0x52')][_0x9a1b('0x31')]);_0x10f485['query']=_[_0x9a1b('0x4c')](_0x2bc22a[_0x9a1b('0x36')]);_0x10f485['filters']=_[_0x9a1b('0x37')](_0x10f485['model'],_0x10f485['query']);_0x25b950[_0x9a1b('0x38')]=_[_0x9a1b('0x37')](_0x10f485[_0x9a1b('0x35')],qs['fields'](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x25b950[_0x9a1b('0x38')]=_0x25b950[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x25b950[_0x9a1b('0x38')]:_0x10f485[_0x9a1b('0x35')];_0x25b950[_0x9a1b('0x3d')]=qs[_0x9a1b('0x3e')](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x3e')]);_0x25b950[_0x9a1b('0x3f')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x41')](_0x2bc22a[_0x9a1b('0x36')],_0x10f485[_0x9a1b('0x40')]));if(_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x53')]){_0x25b950[_0x9a1b('0x3f')]=_[_0x9a1b('0x42')](_0x25b950[_0x9a1b('0x3f')],{'$or':_[_0x9a1b('0x30')](_0x25b950[_0x9a1b('0x38')],function(_0x53ea49){var _0x244f08={};_0x244f08[_0x53ea49]={'$like':'%'+_0x2bc22a[_0x9a1b('0x36')]['filter']+'%'};return _0x244f08;})});}_0x25b950=_[_0x9a1b('0x42')]({},_0x25b950,_0x2bc22a[_0x9a1b('0x44')]);return _0x25bf42[_0x9a1b('0x50')](_0x25b950);}})[_0x9a1b('0x29')](function(_0x4b595b){if(_0x4b595b){_0x2ae8f3=_0x4b595b[_0x9a1b('0x3a')];if(!_0x2bc22a[_0x9a1b('0x36')]['hasOwnProperty'](_0x9a1b('0x3c'))){_0x25b950[_0x9a1b('0x21')]=qs['limit'](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x21')]);_0x25b950['offset']=qs[_0x9a1b('0x1f')](_0x2bc22a['query'][_0x9a1b('0x1f')]);}return _0x25bf42[_0x9a1b('0x50')](_0x25b950);}})[_0x9a1b('0x29')](function(_0x11a704){if(_0x11a704){return _0x11a704?{'count':_0x2ae8f3,'rows':_0x11a704}:null;}})['then'](respondWithResult(_0x5cb018,null))[_0x9a1b('0x49')](handleError(_0x5cb018,null));};exports[_0x9a1b('0x54')]=function(_0x265ca5,_0x2cc80c,_0x4c90ea){if(_0x265ca5[_0x9a1b('0x4f')]['id']){delete _0x265ca5[_0x9a1b('0x4f')]['id'];}return db[_0x9a1b('0x45')]['findOne']({'where':{'id':_0x265ca5[_0x9a1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2cc80c,null))['then'](function(_0x5cd1e0){if(_0x5cd1e0){_0x265ca5[_0x9a1b('0x4f')]['AccountId']=_0x5cd1e0['id'];_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x55')]=integrations[_0x9a1b('0x56')](_0x265ca5[_0x9a1b('0x4f')]['channel'],_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x33')]);_0x265ca5['body'][_0x9a1b('0x57')]=integrations[_0x9a1b('0x58')](_0x265ca5[_0x9a1b('0x4f')]['channel'],_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x33')]);return db[_0x9a1b('0x52')][_0x9a1b('0x4e')](_0x265ca5[_0x9a1b('0x4f')],{'include':[{'model':db[_0x9a1b('0x59')],'as':_0x9a1b('0x55')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x9a1b('0x29')](respondWithResult(_0x2cc80c,null))[_0x9a1b('0x49')](handleError(_0x2cc80c,null));};exports[_0x9a1b('0x5a')]=function(_0x3448a3,_0x289b13,_0x34a80b){var _0x40d72b='';return db[_0x9a1b('0x45')][_0x9a1b('0x51')]({'where':{'id':_0x3448a3[_0x9a1b('0x4b')]['id']},'attributes':['id','remoteUri',_0x9a1b('0x5b')]})[_0x9a1b('0x29')](handleEntityNotFound(_0x289b13,null))['then'](function(_0x4c2823){if(_0x4c2823){_0x40d72b=_0x4c2823[_0x9a1b('0x5c')];var _0x46256b=_0x40d72b['slice'](-0x1);if(_0x46256b==='/'){_0x40d72b=_0x40d72b['substring'](0x0,_0x40d72b[_0x9a1b('0x5d')](_0x46256b));}return rp({'method':_0x9a1b('0x5e'),'uri':util[_0x9a1b('0x5f')](_0x9a1b('0x60'),_0x40d72b,_0x9a1b('0x61')),'headers':{'Authorization':util[_0x9a1b('0x5f')](_0x9a1b('0x62'),new Buffer(util[_0x9a1b('0x5f')](_0x9a1b('0x63'),_0x4c2823[_0x9a1b('0x5b')]))[_0x9a1b('0x64')](_0x9a1b('0x65')))},'json':!![]});}})[_0x9a1b('0x29')](function(_0x6dc531){if(_0x6dc531){var _0x33008a=[_0x9a1b('0x66'),_0x9a1b('0x67'),_0x9a1b('0x68'),_0x9a1b('0x69'),_0x9a1b('0x1c'),_0x9a1b('0x6a'),_0x9a1b('0x6b'),'source',_0x9a1b('0x6c'),'group',_0x9a1b('0x6d')];_['remove'](_0x6dc531,function(_0xbb642d){return _0x33008a[_0x9a1b('0x6e')](_0xbb642d[_0x9a1b('0x2d')])||!_0xbb642d[_0x9a1b('0x6f')]&&_0xbb642d['type']!==_0x9a1b('0x70')&&_0xbb642d['type']!==_0x9a1b('0x71');});return{'count':_0x6dc531['length'],'rows':_['map'](_0x6dc531,function(_0x4fa66d){return{'id':_0x4fa66d[_0x9a1b('0x2d')],'name':_0x4fa66d[_0x9a1b('0x72')],'custom':!_0x4fa66d[_0x9a1b('0x6f')],'options':_0x4fa66d[_0x9a1b('0x73')]?_['map'](_0x4fa66d[_0x9a1b('0x73')],function(_0x5f2200){return{'name':_['capitalize'](_0x5f2200),'value':_0x5f2200};}):[]};})};}})['then'](respondWithResult(_0x289b13,null))[_0x9a1b('0x49')](function(_0x32a043){var _0x338c8a=_0x3448a3[_0x9a1b('0x36')][_0x9a1b('0x74')]?0x1f4:_0x32a043[_0x9a1b('0x75')]||0x1f4;logger[_0x9a1b('0x2b')](_0x9a1b('0x76'),_0x9a1b('0x5a'),_0x338c8a,JSON['stringify'](_0x32a043));delete _0x32a043[_0x9a1b('0x2d')];if(_0x338c8a===0x191){_0x338c8a=0x190;}_0x289b13[_0x9a1b('0x1c')](_0x338c8a)[_0x9a1b('0x2e')](_0x3448a3[_0x9a1b('0x36')][_0x9a1b('0x74')]?{'message':_0x9a1b('0x77'),'statusCode':_0x32a043['statusCode']}:_0x32a043);});}; \ No newline at end of file +var _0xbefe=['remoteUri','slice','lastIndexOf','GET','format','api/v2/ticket_fields','apiKey','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','capitalize','statusCode','stringify','send','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','sendStatus','map','rawAttributes','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','filters','merge','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','getFields'];(function(_0x57ccb9,_0x3db5a2){var _0x2a6fe3=function(_0x9ae573){while(--_0x9ae573){_0x57ccb9['push'](_0x57ccb9['shift']());}};_0x2a6fe3(++_0x3db5a2);}(_0xbefe,0x168));var _0xebef=function(_0x274208,_0x3182ff){_0x274208=_0x274208-0x0;var _0x209164=_0xbefe[_0x274208];return _0x209164;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];var integrations=require(_0xebef('0x1a'));function respondWithStatusCode(_0x566dbe,_0x584ac2){_0x584ac2=_0x584ac2||0xcc;return function(_0x5dd833){if(_0x5dd833){return _0x566dbe['sendStatus'](_0x584ac2);}return _0x566dbe[_0xebef('0x1b')](_0x584ac2)[_0xebef('0x1c')]();};}function respondWithResult(_0x31772a,_0x35cd7a){_0x35cd7a=_0x35cd7a||0xc8;return function(_0x2f53e5){if(_0x2f53e5){return _0x31772a[_0xebef('0x1b')](_0x35cd7a)['json'](_0x2f53e5);}};}function respondWithFilteredResult(_0x32ec37,_0x9411d4){return function(_0x1921aa){if(_0x1921aa){var _0x46849f=typeof _0x9411d4[_0xebef('0x1d')]===_0xebef('0x1e')&&typeof _0x9411d4[_0xebef('0x1f')]===_0xebef('0x1e');var _0x2e5efa=_0x1921aa[_0xebef('0x20')];var _0x458e83=_0x46849f?0x0:_0x9411d4['offset'];var _0x1a99ba=_0x46849f?_0x1921aa[_0xebef('0x20')]:_0x9411d4[_0xebef('0x1d')]+_0x9411d4['limit'];var _0xc3518f;if(_0x1a99ba>=_0x2e5efa){_0x1a99ba=_0x2e5efa;_0xc3518f=0xc8;}else{_0xc3518f=0xce;}_0x32ec37[_0xebef('0x1b')](_0xc3518f);return _0x32ec37[_0xebef('0x21')](_0xebef('0x22'),_0x458e83+'-'+_0x1a99ba+'/'+_0x2e5efa)[_0xebef('0x23')](_0x1921aa);}return null;};}function patchUpdates(_0x138760){return function(_0x2f72e3){try{jsonpatch['apply'](_0x2f72e3,_0x138760,!![]);}catch(_0x4dcc76){return BPromise['reject'](_0x4dcc76);}return _0x2f72e3[_0xebef('0x24')]();};}function saveUpdates(_0x2f1193,_0x38f0b8){return function(_0x221a7e){if(_0x221a7e){return _0x221a7e[_0xebef('0x25')](_0x2f1193)[_0xebef('0x26')](function(_0xe8dcbf){return _0xe8dcbf;});}return null;};}function removeEntity(_0x5c5091,_0x460104){return function(_0x449767){if(_0x449767){return _0x449767[_0xebef('0x27')]()[_0xebef('0x26')](function(){_0x5c5091[_0xebef('0x1b')](0xcc)[_0xebef('0x1c')]();});}};}function handleEntityNotFound(_0x36ca6b,_0x42d2af){return function(_0x45bb67){if(!_0x45bb67){_0x36ca6b[_0xebef('0x28')](0x194);}return _0x45bb67;};}function handleError(_0x456a81,_0x4fb77f){_0x4fb77f=_0x4fb77f||0x1f4;return function(_0xc068de){logger['error'](_0xc068de['stack']);if(_0xc068de['name']){delete _0xc068de['name'];}_0x456a81['status'](_0x4fb77f)['send'](_0xc068de);};}exports['index']=function(_0x5703fc,_0x506e64){var _0x5a9249={},_0x54001c={},_0x136ac3={'count':0x0,'rows':[]};var _0x49a6fb=_[_0xebef('0x29')](db['FreshdeskAccount'][_0xebef('0x2a')],function(_0xa0a713){return{'name':_0xa0a713['fieldName'],'type':_0xa0a713[_0xebef('0x2b')]['key']};});_0x54001c[_0xebef('0x2c')]=_[_0xebef('0x29')](_0x49a6fb,_0xebef('0x2d'));_0x54001c[_0xebef('0x2e')]=_[_0xebef('0x2f')](_0x5703fc[_0xebef('0x2e')]);_0x54001c['filters']=_[_0xebef('0x30')](_0x54001c['model'],_0x54001c[_0xebef('0x2e')]);_0x5a9249[_0xebef('0x31')]=_[_0xebef('0x30')](_0x54001c[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x32')]));_0x5a9249['attributes']=_0x5a9249[_0xebef('0x31')][_0xebef('0x33')]?_0x5a9249[_0xebef('0x31')]:_0x54001c[_0xebef('0x2c')];if(!_0x5703fc[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x5a9249['limit']=qs[_0xebef('0x1f')](_0x5703fc[_0xebef('0x2e')]['limit']);_0x5a9249[_0xebef('0x1d')]=qs[_0xebef('0x1d')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x1d')]);}_0x5a9249[_0xebef('0x36')]=qs['sort'](_0x5703fc[_0xebef('0x2e')][_0xebef('0x37')]);_0x5a9249['where']=qs['filters'](_[_0xebef('0x38')](_0x5703fc['query'],_0x54001c['filters']),_0x49a6fb);if(_0x5703fc['query'][_0xebef('0x39')]){_0x5a9249['where']=_['merge'](_0x5a9249[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x49a6fb,function(_0x1348a4){if(_0x1348a4['type']!==_0xebef('0x3b')){var _0x4d61c1={};_0x4d61c1[_0x1348a4['name']]={'$like':'%'+_0x5703fc['query'][_0xebef('0x39')]+'%'};return _0x4d61c1;}})});}_0x5a9249=_['merge']({},_0x5a9249,_0x5703fc[_0xebef('0x3c')]);var _0x5078ec={'where':_0x5a9249['where']};return db[_0xebef('0x3d')][_0xebef('0x20')](_0x5078ec)[_0xebef('0x26')](function(_0x297ee0){_0x136ac3[_0xebef('0x20')]=_0x297ee0;if(_0x5703fc[_0xebef('0x2e')]['includeAll']){_0x5a9249[_0xebef('0x3e')]=[{'all':!![]}];}return db[_0xebef('0x3d')][_0xebef('0x3f')](_0x5a9249);})[_0xebef('0x26')](function(_0x32b93c){_0x136ac3[_0xebef('0x40')]=_0x32b93c;return _0x136ac3;})[_0xebef('0x26')](respondWithFilteredResult(_0x506e64,_0x5a9249))[_0xebef('0x41')](handleError(_0x506e64,null));};exports[_0xebef('0x42')]=function(_0xa69151,_0x56fe84){var _0x5cf908={'raw':![],'where':{'id':_0xa69151['params']['id']}},_0x4e3f60={};_0x4e3f60[_0xebef('0x2c')]=_[_0xebef('0x2f')](db[_0xebef('0x3d')][_0xebef('0x2a')]);_0x4e3f60[_0xebef('0x2e')]=_['keys'](_0xa69151['query']);_0x4e3f60[_0xebef('0x43')]=_['intersection'](_0x4e3f60['model'],_0x4e3f60[_0xebef('0x2e')]);_0x5cf908[_0xebef('0x31')]=_[_0xebef('0x30')](_0x4e3f60[_0xebef('0x2c')],qs[_0xebef('0x32')](_0xa69151[_0xebef('0x2e')][_0xebef('0x32')]));_0x5cf908[_0xebef('0x31')]=_0x5cf908[_0xebef('0x31')][_0xebef('0x33')]?_0x5cf908[_0xebef('0x31')]:_0x4e3f60[_0xebef('0x2c')];if(_0xa69151[_0xebef('0x2e')]['includeAll']){_0x5cf908[_0xebef('0x3e')]=[{'all':!![]}];}_0x5cf908=_[_0xebef('0x44')]({},_0x5cf908,_0xa69151[_0xebef('0x3c')]);return db[_0xebef('0x3d')][_0xebef('0x45')](_0x5cf908)[_0xebef('0x26')](handleEntityNotFound(_0x56fe84,null))['then'](respondWithResult(_0x56fe84,null))[_0xebef('0x41')](handleError(_0x56fe84,null));};exports[_0xebef('0x46')]=function(_0x1c7c81,_0x4ce35e){return db['FreshdeskAccount'][_0xebef('0x46')](_0x1c7c81['body'],{})[_0xebef('0x26')](respondWithResult(_0x4ce35e,0xc9))[_0xebef('0x41')](handleError(_0x4ce35e,null));};exports[_0xebef('0x25')]=function(_0x1d70e8,_0x297550){if(_0x1d70e8[_0xebef('0x47')]['id']){delete _0x1d70e8[_0xebef('0x47')]['id'];}return db['FreshdeskAccount'][_0xebef('0x45')]({'where':{'id':_0x1d70e8['params']['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x297550,null))[_0xebef('0x26')](saveUpdates(_0x1d70e8[_0xebef('0x47')],null))[_0xebef('0x26')](respondWithResult(_0x297550,null))['catch'](handleError(_0x297550,null));};exports[_0xebef('0x27')]=function(_0x52f067,_0x5f1ce5){return db[_0xebef('0x3d')][_0xebef('0x45')]({'where':{'id':_0x52f067[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x5f1ce5,null))[_0xebef('0x26')](removeEntity(_0x5f1ce5,null))[_0xebef('0x41')](handleError(_0x5f1ce5,null));};exports[_0xebef('0x49')]=function(_0x35a755,_0x25bd2,_0x1189ff){var _0x255b01={};var _0xb1d606={};var _0x4321d4;var _0x766610;return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x35a755[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x25bd2,null))[_0xebef('0x26')](function(_0x59db6d){if(_0x59db6d){_0x4321d4=_0x59db6d;_0xb1d606['model']=_['keys'](db[_0xebef('0x4b')]['rawAttributes']);_0xb1d606['query']=_[_0xebef('0x2f')](_0x35a755[_0xebef('0x2e')]);_0xb1d606[_0xebef('0x43')]=_['intersection'](_0xb1d606[_0xebef('0x2c')],_0xb1d606[_0xebef('0x2e')]);_0x255b01[_0xebef('0x31')]=_[_0xebef('0x30')](_0xb1d606[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x35a755['query'][_0xebef('0x32')]));_0x255b01[_0xebef('0x31')]=_0x255b01['attributes']['length']?_0x255b01['attributes']:_0xb1d606[_0xebef('0x2c')];_0x255b01[_0xebef('0x36')]=qs[_0xebef('0x37')](_0x35a755[_0xebef('0x2e')][_0xebef('0x37')]);_0x255b01[_0xebef('0x3a')]=qs['filters'](_[_0xebef('0x38')](_0x35a755[_0xebef('0x2e')],_0xb1d606[_0xebef('0x43')]));if(_0x35a755['query'][_0xebef('0x39')]){_0x255b01['where']=_['merge'](_0x255b01[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x255b01[_0xebef('0x31')],function(_0x380206){var _0x353fe2={};_0x353fe2[_0x380206]={'$like':'%'+_0x35a755[_0xebef('0x2e')][_0xebef('0x39')]+'%'};return _0x353fe2;})});}_0x255b01=_['merge']({},_0x255b01,_0x35a755[_0xebef('0x3c')]);return _0x4321d4[_0xebef('0x49')](_0x255b01);}})[_0xebef('0x26')](function(_0x2f390a){if(_0x2f390a){_0x766610=_0x2f390a['length'];if(!_0x35a755[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x255b01[_0xebef('0x1f')]=qs['limit'](_0x35a755[_0xebef('0x2e')]['limit']);_0x255b01[_0xebef('0x1d')]=qs['offset'](_0x35a755[_0xebef('0x2e')][_0xebef('0x1d')]);}return _0x4321d4[_0xebef('0x49')](_0x255b01);}})['then'](function(_0x46d421){if(_0x46d421){return _0x46d421?{'count':_0x766610,'rows':_0x46d421}:null;}})['then'](respondWithResult(_0x25bd2,null))[_0xebef('0x41')](handleError(_0x25bd2,null));};exports[_0xebef('0x4c')]=function(_0xb117cf,_0x40ee9d,_0x424fc1){if(_0xb117cf['body']['id']){delete _0xb117cf[_0xebef('0x47')]['id'];}return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0xb117cf['params']['id']}})['then'](handleEntityNotFound(_0x40ee9d,null))[_0xebef('0x26')](function(_0xb0a7d6){if(_0xb0a7d6){_0xb117cf[_0xebef('0x47')][_0xebef('0x4d')]=_0xb0a7d6['id'];_0xb117cf[_0xebef('0x47')][_0xebef('0x4e')]=integrations[_0xebef('0x4f')](_0xb117cf[_0xebef('0x47')]['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);_0xb117cf[_0xebef('0x47')][_0xebef('0x50')]=integrations[_0xebef('0x51')](_0xb117cf['body']['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);return db[_0xebef('0x4b')]['create'](_0xb117cf[_0xebef('0x47')],{'include':[{'model':db[_0xebef('0x52')],'as':_0xebef('0x4e')},{'model':db[_0xebef('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x40ee9d,null))[_0xebef('0x41')](handleError(_0x40ee9d,null));};exports[_0xebef('0x53')]=function(_0x214bea,_0x41958a,_0x109a21){var _0x2c91c5='';return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x214bea[_0xebef('0x48')]['id']},'attributes':['id',_0xebef('0x54'),'apiKey']})[_0xebef('0x26')](handleEntityNotFound(_0x41958a,null))[_0xebef('0x26')](function(_0x1f7bc4){if(_0x1f7bc4){_0x2c91c5=_0x1f7bc4[_0xebef('0x54')];var _0x1c0eb6=_0x2c91c5[_0xebef('0x55')](-0x1);if(_0x1c0eb6==='/'){_0x2c91c5=_0x2c91c5['substring'](0x0,_0x2c91c5[_0xebef('0x56')](_0x1c0eb6));}return rp({'method':_0xebef('0x57'),'uri':util[_0xebef('0x58')]('%s/%s',_0x2c91c5,_0xebef('0x59')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xebef('0x58')]('%s:X',_0x1f7bc4[_0xebef('0x5a')]))['toString'](_0xebef('0x5b')))},'json':!![]});}})[_0xebef('0x26')](function(_0x2e4ca8){if(_0x2e4ca8){var _0x225aa1=[_0xebef('0x5c'),_0xebef('0x5d'),_0xebef('0x5e'),_0xebef('0x5f'),_0xebef('0x1b'),_0xebef('0x60'),_0xebef('0x61'),'source',_0xebef('0x62'),_0xebef('0x61'),_0xebef('0x63')];_[_0xebef('0x64')](_0x2e4ca8,function(_0x575591){return _0x225aa1[_0xebef('0x65')](_0x575591['name'])||!_0x575591[_0xebef('0x66')]&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x67')&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x68');});return{'count':_0x2e4ca8[_0xebef('0x33')],'rows':_[_0xebef('0x29')](_0x2e4ca8,function(_0x25d845){return{'id':_0x25d845[_0xebef('0x2d')],'name':_0x25d845['label'],'custom':!_0x25d845[_0xebef('0x66')],'options':_0x25d845['choices']?_[_0xebef('0x29')](_0x25d845['choices'],function(_0x110e23){return{'name':_[_0xebef('0x69')](_0x110e23),'value':_0x110e23};}):[]};})};}})['then'](respondWithResult(_0x41958a,null))[_0xebef('0x41')](function(_0x54a0b3){var _0x1209fc=_0x214bea[_0xebef('0x2e')]['test']?0x1f4:_0x54a0b3[_0xebef('0x6a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xebef('0x53'),_0x1209fc,JSON[_0xebef('0x6b')](_0x54a0b3));delete _0x54a0b3[_0xebef('0x2d')];if(_0x1209fc===0x191){_0x1209fc=0x190;}_0x41958a[_0xebef('0x1b')](_0x1209fc)[_0xebef('0x6c')](_0x214bea[_0xebef('0x2e')][_0xebef('0x6d')]?{'message':_0xebef('0x6e'),'statusCode':_0x54a0b3[_0xebef('0x6a')]}:_0x54a0b3);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index e6ec027..279d8dc 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 _0xf506=['moment','bluebird','path','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x20f1d4,_0x4420b5){var _0x5b0a9c=function(_0x2ecc8a){while(--_0x2ecc8a){_0x20f1d4['push'](_0x20f1d4['shift']());}};_0x5b0a9c(++_0x4420b5);}(_0xf506,0x6a));var _0x6f50=function(_0x290d93,_0x480745){_0x290d93=_0x290d93-0x0;var _0x2bf3ea=_0xf506[_0x290d93];return _0x2bf3ea;};'use strict';var _=require(_0x6f50('0x0'));var util=require(_0x6f50('0x1'));var logger=require(_0x6f50('0x2'))(_0x6f50('0x3'));var moment=require(_0x6f50('0x4'));var BPromise=require(_0x6f50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f50('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f50('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x136115,_0x1ef501){return _0x136115[_0x6f50('0x8')](_0x6f50('0x9'),attributes,{'tableName':_0x6f50('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedab=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x1eae62,_0x5e69dc){var _0x2750a3=function(_0x26dec3){while(--_0x26dec3){_0x1eae62['push'](_0x1eae62['shift']());}};_0x2750a3(++_0x5e69dc);}(_0xedab,0x13d));var _0xbeda=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0xedab[_0x2d460c];return _0xf6fc4c;};'use strict';var _=require(_0xbeda('0x0'));var util=require(_0xbeda('0x1'));var logger=require(_0xbeda('0x2'))(_0xbeda('0x3'));var moment=require(_0xbeda('0x4'));var BPromise=require(_0xbeda('0x5'));var rp=require(_0xbeda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbeda('0x7'));var config=require('../../config/environment');var attributes=require(_0xbeda('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1c9447,_0x35d61f){return _0x1c9447['define'](_0xbeda('0x9'),attributes,{'tableName':_0xbeda('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 35942f1..10646e3 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 _0xa3d4=['result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshdeskAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message'];(function(_0x3a58dc,_0x3a61d7){var _0x152559=function(_0xcf3cb6){while(--_0xcf3cb6){_0x3a58dc['push'](_0x3a58dc['shift']());}};_0x152559(++_0x3a61d7);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xa3d4[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require(_0x4a3d('0x0'));var moment=require(_0x4a3d('0x1'));var BPromise=require(_0x4a3d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a3d('0x3'));var db=require(_0x4a3d('0x4'))['db'];var utils=require(_0x4a3d('0x5'));var logger=require(_0x4a3d('0x6'))(_0x4a3d('0x7'));var config=require(_0x4a3d('0x8'));var jayson=require(_0x4a3d('0x9'));var client=jayson[_0x4a3d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42af8e,_0x2d79c3,_0x1d2c0d){return new BPromise(function(_0x3634aa,_0xc981a0){return client[_0x4a3d('0xb')](_0x42af8e,_0x1d2c0d)[_0x4a3d('0xc')](function(_0x1b6925){logger[_0x4a3d('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x2d79c3,_0x4a3d('0xe'));logger[_0x4a3d('0xf')](_0x4a3d('0x10'),_0x2d79c3,_0x4a3d('0xe'),JSON[_0x4a3d('0x11')](_0x1b6925));if(_0x1b6925['error']){if(_0x1b6925[_0x4a3d('0x12')][_0x4a3d('0x13')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x2d79c3,_0x1b6925['error']['message']);return _0xc981a0(_0x1b6925[_0x4a3d('0x12')]['message']);}logger[_0x4a3d('0x12')](_0x4a3d('0x14'),_0x2d79c3,_0x1b6925[_0x4a3d('0x12')][_0x4a3d('0x15')]);return _0x3634aa(_0x1b6925[_0x4a3d('0x12')][_0x4a3d('0x15')]);}else{logger[_0x4a3d('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x2d79c3,_0x4a3d('0xe'));_0x3634aa(_0x1b6925[_0x4a3d('0x16')]['message']);}})[_0x4a3d('0x17')](function(_0xe20b56){logger[_0x4a3d('0x12')](_0x4a3d('0x14'),_0x2d79c3,_0xe20b56);_0xc981a0(_0xe20b56);});});}exports[_0x4a3d('0x18')]=function(_0x353846){var _0x5ad5bc=this;return new Promise(function(_0x3962bc,_0x4a4991){return db[_0x4a3d('0x19')][_0x4a3d('0x1a')]({'raw':_0x353846[_0x4a3d('0x1b')]?_0x353846[_0x4a3d('0x1b')][_0x4a3d('0x1c')]===undefined?!![]:![]:!![],'where':_0x353846[_0x4a3d('0x1b')]?_0x353846[_0x4a3d('0x1b')]['where']||null:null,'attributes':_0x353846[_0x4a3d('0x1b')]?_0x353846[_0x4a3d('0x1b')][_0x4a3d('0x1d')]||null:null,'limit':_0x353846[_0x4a3d('0x1b')]?_0x353846['options'][_0x4a3d('0x1e')]||null:null,'include':_0x353846[_0x4a3d('0x1b')]?_0x353846[_0x4a3d('0x1b')][_0x4a3d('0x1f')]?_[_0x4a3d('0x20')](_0x353846[_0x4a3d('0x1b')][_0x4a3d('0x1f')],function(_0x5274fd){return{'model':db[_0x5274fd['model']],'as':_0x5274fd['as'],'attributes':_0x5274fd['attributes'],'include':_0x5274fd[_0x4a3d('0x1f')]?_[_0x4a3d('0x20')](_0x5274fd[_0x4a3d('0x1f')],function(_0x4de65b){return{'model':db[_0x4de65b[_0x4a3d('0x21')]],'as':_0x4de65b['as'],'attributes':_0x4de65b[_0x4a3d('0x1d')],'include':_0x4de65b[_0x4a3d('0x1f')]?_[_0x4a3d('0x20')](_0x4de65b['include'],function(_0x7be114){return{'model':db[_0x7be114[_0x4a3d('0x21')]],'as':_0x7be114['as'],'attributes':_0x7be114[_0x4a3d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4a3d('0xc')](function(_0x597fcc){logger['info'](_0x4a3d('0x18'),_0x353846);logger[_0x4a3d('0xf')](_0x4a3d('0x18'),_0x353846,JSON[_0x4a3d('0x11')](_0x597fcc));_0x3962bc(_0x597fcc);})[_0x4a3d('0x17')](function(_0x41b804){logger[_0x4a3d('0x12')](_0x4a3d('0x18'),_0x41b804[_0x4a3d('0x15')],_0x353846);_0x4a4991(_0x5ad5bc[_0x4a3d('0x12')](0x1f4,_0x41b804[_0x4a3d('0x15')]));});});};exports[_0x4a3d('0x22')]=function(_0x45e707){var _0x221466=this;return new Promise(function(_0x1009d5,_0x4964ab){return db[_0x4a3d('0x19')][_0x4a3d('0x23')]({'raw':_0x45e707['options']?_0x45e707[_0x4a3d('0x1b')][_0x4a3d('0x1c')]===undefined?!![]:![]:!![],'where':_0x45e707[_0x4a3d('0x1b')]?_0x45e707[_0x4a3d('0x1b')]['where']||null:null,'attributes':_0x45e707[_0x4a3d('0x1b')]?_0x45e707[_0x4a3d('0x1b')][_0x4a3d('0x1d')]||null:null,'include':_0x45e707['options']?_0x45e707[_0x4a3d('0x1b')][_0x4a3d('0x1f')]?_['map'](_0x45e707['options']['include'],function(_0x33f768){return{'model':db[_0x33f768['model']],'as':_0x33f768['as'],'attributes':_0x33f768[_0x4a3d('0x1d')],'include':_0x33f768[_0x4a3d('0x1f')]?_[_0x4a3d('0x20')](_0x33f768[_0x4a3d('0x1f')],function(_0x48c640){return{'model':db[_0x48c640['model']],'as':_0x48c640['as'],'attributes':_0x48c640[_0x4a3d('0x1d')],'include':_0x48c640[_0x4a3d('0x1f')]?_[_0x4a3d('0x20')](_0x48c640[_0x4a3d('0x1f')],function(_0x451ea9){return{'model':db[_0x451ea9[_0x4a3d('0x21')]],'as':_0x451ea9['as'],'attributes':_0x451ea9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x6095ab){logger[_0x4a3d('0xd')]('ShowFreshdeskAccount',_0x45e707);logger[_0x4a3d('0xf')]('ShowFreshdeskAccount',_0x45e707,JSON['stringify'](_0x6095ab));_0x1009d5(_0x6095ab);})[_0x4a3d('0x17')](function(_0x38923e){logger['error'](_0x4a3d('0x22'),_0x38923e[_0x4a3d('0x15')],_0x45e707);_0x4964ab(_0x221466[_0x4a3d('0x12')](0x1f4,_0x38923e[_0x4a3d('0x15')]));});});}; \ No newline at end of file +var _0x4fdb=['FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','raw','options','where','attributes','limit','map','include','model','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x51695d,_0x4d7e62){_0x51695d=_0x51695d-0x0;var _0x2a0194=_0x4fdb[_0x51695d];return _0x2a0194;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53273f,_0x299bff,_0x3af8e3){return new BPromise(function(_0x1151b5,_0x52dca2){return client['request'](_0x53273f,_0x3af8e3)[_0xb4fd('0xb')](function(_0x4f9d18){logger[_0xb4fd('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x299bff,_0xb4fd('0xd'));logger[_0xb4fd('0xe')](_0xb4fd('0xf'),_0x299bff,_0xb4fd('0xd'),JSON[_0xb4fd('0x10')](_0x4f9d18));if(_0x4f9d18['error']){if(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x12')]===0x1f4){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x4f9d18['error'][_0xb4fd('0x14')]);return _0x52dca2(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}logger['error'](_0xb4fd('0x13'),_0x299bff,_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);return _0x1151b5(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}else{logger[_0xb4fd('0xc')](_0xb4fd('0x13'),_0x299bff,'request\x20sent');_0x1151b5(_0x4f9d18[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x2d4701){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x2d4701);_0x52dca2(_0x2d4701);});});}exports[_0xb4fd('0x17')]=function(_0x44f0f0){var _0x28ecef=this;return new Promise(function(_0x233044,_0x19f7b0){return db['FreshdeskAccount']['findAll']({'raw':_0x44f0f0['options']?_0x44f0f0['options'][_0xb4fd('0x18')]===undefined?!![]:![]:!![],'where':_0x44f0f0[_0xb4fd('0x19')]?_0x44f0f0[_0xb4fd('0x19')][_0xb4fd('0x1a')]||null:null,'attributes':_0x44f0f0[_0xb4fd('0x19')]?_0x44f0f0[_0xb4fd('0x19')][_0xb4fd('0x1b')]||null:null,'limit':_0x44f0f0['options']?_0x44f0f0['options'][_0xb4fd('0x1c')]||null:null,'include':_0x44f0f0[_0xb4fd('0x19')]?_0x44f0f0[_0xb4fd('0x19')]['include']?_[_0xb4fd('0x1d')](_0x44f0f0['options'][_0xb4fd('0x1e')],function(_0x4f5032){return{'model':db[_0x4f5032[_0xb4fd('0x1f')]],'as':_0x4f5032['as'],'attributes':_0x4f5032[_0xb4fd('0x1b')],'include':_0x4f5032[_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x4f5032[_0xb4fd('0x1e')],function(_0x456f35){return{'model':db[_0x456f35[_0xb4fd('0x1f')]],'as':_0x456f35['as'],'attributes':_0x456f35[_0xb4fd('0x1b')],'include':_0x456f35['include']?_['map'](_0x456f35['include'],function(_0x453982){return{'model':db[_0x453982['model']],'as':_0x453982['as'],'attributes':_0x453982[_0xb4fd('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5738c2){logger[_0xb4fd('0xc')](_0xb4fd('0x17'),_0x44f0f0);logger[_0xb4fd('0xe')]('GetFreshdeskAccount',_0x44f0f0,JSON[_0xb4fd('0x10')](_0x5738c2));_0x233044(_0x5738c2);})[_0xb4fd('0x16')](function(_0x68776){logger[_0xb4fd('0x11')]('GetFreshdeskAccount',_0x68776[_0xb4fd('0x14')],_0x44f0f0);_0x19f7b0(_0x28ecef[_0xb4fd('0x11')](0x1f4,_0x68776['message']));});});};exports[_0xb4fd('0x20')]=function(_0x421c89){var _0xbe7d2c=this;return new Promise(function(_0x597874,_0xe73e10){return db[_0xb4fd('0x21')][_0xb4fd('0x22')]({'raw':_0x421c89['options']?_0x421c89['options']['raw']===undefined?!![]:![]:!![],'where':_0x421c89['options']?_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1a')]||null:null,'attributes':_0x421c89[_0xb4fd('0x19')]?_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1b')]||null:null,'include':_0x421c89[_0xb4fd('0x19')]?_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1e')],function(_0x37415b){return{'model':db[_0x37415b[_0xb4fd('0x1f')]],'as':_0x37415b['as'],'attributes':_0x37415b[_0xb4fd('0x1b')],'include':_0x37415b[_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x37415b[_0xb4fd('0x1e')],function(_0x194c14){return{'model':db[_0x194c14['model']],'as':_0x194c14['as'],'attributes':_0x194c14['attributes'],'include':_0x194c14[_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x194c14[_0xb4fd('0x1e')],function(_0x24ae37){return{'model':db[_0x24ae37[_0xb4fd('0x1f')]],'as':_0x24ae37['as'],'attributes':_0x24ae37['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4fd('0xb')](function(_0x265634){logger[_0xb4fd('0xc')](_0xb4fd('0x20'),_0x421c89);logger[_0xb4fd('0xe')]('ShowFreshdeskAccount',_0x421c89,JSON[_0xb4fd('0x10')](_0x265634));_0x597874(_0x265634);})['catch'](function(_0xcda359){logger[_0xb4fd('0x11')]('ShowFreshdeskAccount',_0xcda359['message'],_0x421c89);_0xe73e10(_0xbe7d2c[_0xb4fd('0x11')](0x1f4,_0xcda359[_0xb4fd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 2f2313a..ffe0973 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 _0x34c6=['post','/:id/tags','setTags','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','create'];(function(_0x5a3ec5,_0x71ae0f){var _0x5749de=function(_0x149768){while(--_0x149768){_0x5a3ec5['push'](_0x5a3ec5['shift']());}};_0x5749de(++_0x71ae0f);}(_0x34c6,0x133));var _0x634c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x34c6[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x634c('0x0'));var util=require(_0x634c('0x1'));var path=require(_0x634c('0x2'));var timeout=require('connect-timeout');var express=require(_0x634c('0x3'));var router=express[_0x634c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x634c('0x5'));var interaction=require(_0x634c('0x6'));var config=require('../../config/environment');var controller=require(_0x634c('0x7'));router[_0x634c('0x8')]('/',auth[_0x634c('0x9')](),controller['index']);router[_0x634c('0x8')]('/:id',auth[_0x634c('0x9')](),controller[_0x634c('0xa')]);router[_0x634c('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0x634c('0xb'),auth[_0x634c('0x9')](),controller[_0x634c('0xc')]);router['get']('/:id/descriptions',auth[_0x634c('0x9')](),controller[_0x634c('0xd')]);router['get']('/:id/tags',auth[_0x634c('0x9')](),controller['getTags']);router['post']('/',auth[_0x634c('0x9')](),controller[_0x634c('0xe')]);router[_0x634c('0xf')](_0x634c('0x10'),auth[_0x634c('0x9')](),controller[_0x634c('0x11')]);router[_0x634c('0x12')](_0x634c('0x13'),auth[_0x634c('0x9')](),controller['update']);router[_0x634c('0x14')](_0x634c('0x13'),auth[_0x634c('0x9')](),controller[_0x634c('0x15')]);module[_0x634c('0x16')]=router; \ No newline at end of file +var _0xa5c8=['connect-timeout','express','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','destroy','exports','multer','util','path'];(function(_0x267fe3,_0x12cd9e){var _0x235c96=function(_0x5445c7){while(--_0x5445c7){_0x267fe3['push'](_0x267fe3['shift']());}};_0x235c96(++_0x12cd9e);}(_0xa5c8,0xac));var _0x8a5c=function(_0x1a1e99,_0x562ccf){_0x1a1e99=_0x1a1e99-0x0;var _0x353107=_0xa5c8[_0x1a1e99];return _0x353107;};'use strict';var multer=require(_0x8a5c('0x0'));var util=require(_0x8a5c('0x1'));var path=require(_0x8a5c('0x2'));var timeout=require(_0x8a5c('0x3'));var express=require(_0x8a5c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8a5c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a5c('0x6'));var controller=require(_0x8a5c('0x7'));router[_0x8a5c('0x8')]('/',auth[_0x8a5c('0x9')](),controller[_0x8a5c('0xa')]);router[_0x8a5c('0x8')](_0x8a5c('0xb'),auth[_0x8a5c('0x9')](),controller['show']);router[_0x8a5c('0x8')](_0x8a5c('0xc'),auth[_0x8a5c('0x9')](),controller[_0x8a5c('0xd')]);router[_0x8a5c('0x8')]('/:id/subjects',auth[_0x8a5c('0x9')](),controller[_0x8a5c('0xe')]);router[_0x8a5c('0x8')](_0x8a5c('0xf'),auth[_0x8a5c('0x9')](),controller[_0x8a5c('0x10')]);router[_0x8a5c('0x8')]('/:id/tags',auth[_0x8a5c('0x9')](),controller[_0x8a5c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8a5c('0x12')](_0x8a5c('0x13'),auth['isAuthenticated'](),controller[_0x8a5c('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8a5c('0x15')]);router[_0x8a5c('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x8a5c('0x17')]);module[_0x8a5c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0dd74e0..36ec3b2 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 _0x8bc2=['STRING','sequelize','exports'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x8bc2,0x1a8));var _0x28bc=function(_0x4eefca,_0x4d3314){_0x4eefca=_0x4eefca-0x0;var _0x41decc=_0x8bc2[_0x4eefca];return _0x41decc;};'use strict';var Sequelize=require(_0x28bc('0x0'));module[_0x28bc('0x1')]={'name':{'type':Sequelize[_0x28bc('0x2')]},'description':{'type':Sequelize[_0x28bc('0x2')]}}; \ No newline at end of file +var _0x154d=['exports','STRING','sequelize'];(function(_0x10fee3,_0xb55ea5){var _0x2b0289=function(_0x3d2b0e){while(--_0x3d2b0e){_0x10fee3['push'](_0x10fee3['shift']());}};_0x2b0289(++_0xb55ea5);}(_0x154d,0xfb));var _0xd154=function(_0x190536,_0xe88383){_0x190536=_0x190536-0x0;var _0x176c17=_0x154d[_0x190536];return _0x176c17;};'use strict';var Sequelize=require(_0xd154('0x0'));module[_0xd154('0x1')]={'name':{'type':Sequelize[_0xd154('0x2')]},'description':{'type':Sequelize[_0xd154('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 6d29c33..a106691 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 _0x548b=['../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','sendStatus','error','stack','send','map','rawAttributes','fieldName','key','model','name','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','FreshdeskConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','getFields','length','findOne','FreshdeskField','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x548b,0x1e4));var _0xb548=function(_0x5f3ab4,_0x2b4830){_0x5f3ab4=_0x5f3ab4-0x0;var _0x355223=_0x548b[_0x5f3ab4];return _0x355223;};'use strict';var emlformat=require(_0xb548('0x0'));var rimraf=require(_0xb548('0x1'));var zipdir=require(_0xb548('0x2'));var jsonpatch=require(_0xb548('0x3'));var rp=require(_0xb548('0x4'));var moment=require(_0xb548('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb548('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb548('0x7'));var _=require('lodash');var squel=require(_0xb548('0x8'));var crypto=require(_0xb548('0x9'));var jsforce=require(_0xb548('0xa'));var deskjs=require(_0xb548('0xb'));var toCsv=require(_0xb548('0x6'));var querystring=require(_0xb548('0xc'));var Papa=require('papaparse');var Redis=require(_0xb548('0xd'));var authService=require(_0xb548('0xe'));var qs=require(_0xb548('0xf'));var as=require(_0xb548('0x10'));var hardwareService=require(_0xb548('0x11'));var logger=require(_0xb548('0x12'))(_0xb548('0x13'));var utils=require(_0xb548('0x14'));var config=require(_0xb548('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb548('0x16'))['db'];function respondWithStatusCode(_0x1802a4,_0x1a8453){_0x1a8453=_0x1a8453||0xcc;return function(_0x4a9d5d){if(_0x4a9d5d){return _0x1802a4['sendStatus'](_0x1a8453);}return _0x1802a4[_0xb548('0x17')](_0x1a8453)[_0xb548('0x18')]();};}function respondWithResult(_0x36424a,_0x3b832d){_0x3b832d=_0x3b832d||0xc8;return function(_0x5aa9a7){if(_0x5aa9a7){return _0x36424a[_0xb548('0x17')](_0x3b832d)[_0xb548('0x19')](_0x5aa9a7);}};}function respondWithFilteredResult(_0x140151,_0x3d53dc){return function(_0x23e849){if(_0x23e849){var _0x25c855=typeof _0x3d53dc[_0xb548('0x1a')]===_0xb548('0x1b')&&typeof _0x3d53dc[_0xb548('0x1c')]===_0xb548('0x1b');var _0x1bebbc=_0x23e849[_0xb548('0x1d')];var _0x50f14f=_0x25c855?0x0:_0x3d53dc['offset'];var _0x50428c=_0x25c855?_0x23e849[_0xb548('0x1d')]:_0x3d53dc[_0xb548('0x1a')]+_0x3d53dc[_0xb548('0x1c')];var _0x56f73d;if(_0x50428c>=_0x1bebbc){_0x50428c=_0x1bebbc;_0x56f73d=0xc8;}else{_0x56f73d=0xce;}_0x140151[_0xb548('0x17')](_0x56f73d);return _0x140151[_0xb548('0x1e')]('Content-Range',_0x50f14f+'-'+_0x50428c+'/'+_0x1bebbc)[_0xb548('0x19')](_0x23e849);}return null;};}function patchUpdates(_0x27c079){return function(_0x2c3031){try{jsonpatch[_0xb548('0x1f')](_0x2c3031,_0x27c079,!![]);}catch(_0x323142){return BPromise[_0xb548('0x20')](_0x323142);}return _0x2c3031[_0xb548('0x21')]();};}function saveUpdates(_0x4b48d4,_0x5f58e5){return function(_0x2bea4c){if(_0x2bea4c){return _0x2bea4c['update'](_0x4b48d4)[_0xb548('0x22')](function(_0x2ccffc){return _0x2ccffc;});}return null;};}function removeEntity(_0x20f291,_0x1aa473){return function(_0x323edd){if(_0x323edd){return _0x323edd[_0xb548('0x23')]()['then'](function(){_0x20f291[_0xb548('0x17')](0xcc)[_0xb548('0x18')]();});}};}function handleEntityNotFound(_0x2383df,_0x2e9f79){return function(_0x1e354c){if(!_0x1e354c){_0x2383df[_0xb548('0x24')](0x194);}return _0x1e354c;};}function handleError(_0x476032,_0x21d4a5){_0x21d4a5=_0x21d4a5||0x1f4;return function(_0x58d9eb){logger[_0xb548('0x25')](_0x58d9eb[_0xb548('0x26')]);if(_0x58d9eb['name']){delete _0x58d9eb['name'];}_0x476032[_0xb548('0x17')](_0x21d4a5)[_0xb548('0x27')](_0x58d9eb);};}exports['index']=function(_0x39def5,_0x479e0d){var _0x44a0cd={},_0x200332={},_0x2f0240={'count':0x0,'rows':[]};var _0x3e476c=_[_0xb548('0x28')](db['FreshdeskConfiguration'][_0xb548('0x29')],function(_0x2ac11d){return{'name':_0x2ac11d[_0xb548('0x2a')],'type':_0x2ac11d['type'][_0xb548('0x2b')]};});_0x200332[_0xb548('0x2c')]=_[_0xb548('0x28')](_0x3e476c,_0xb548('0x2d'));_0x200332['query']=_[_0xb548('0x2e')](_0x39def5[_0xb548('0x2f')]);_0x200332[_0xb548('0x30')]=_[_0xb548('0x31')](_0x200332[_0xb548('0x2c')],_0x200332[_0xb548('0x2f')]);_0x44a0cd['attributes']=_[_0xb548('0x31')](_0x200332[_0xb548('0x2c')],qs[_0xb548('0x32')](_0x39def5[_0xb548('0x2f')][_0xb548('0x32')]));_0x44a0cd[_0xb548('0x33')]=_0x44a0cd[_0xb548('0x33')]['length']?_0x44a0cd[_0xb548('0x33')]:_0x200332[_0xb548('0x2c')];if(!_0x39def5[_0xb548('0x2f')][_0xb548('0x34')](_0xb548('0x35'))){_0x44a0cd[_0xb548('0x1c')]=qs[_0xb548('0x1c')](_0x39def5['query'][_0xb548('0x1c')]);_0x44a0cd[_0xb548('0x1a')]=qs[_0xb548('0x1a')](_0x39def5['query'][_0xb548('0x1a')]);}_0x44a0cd[_0xb548('0x36')]=qs[_0xb548('0x37')](_0x39def5[_0xb548('0x2f')]['sort']);_0x44a0cd[_0xb548('0x38')]=qs[_0xb548('0x30')](_['pick'](_0x39def5[_0xb548('0x2f')],_0x200332[_0xb548('0x30')]),_0x3e476c);if(_0x39def5[_0xb548('0x2f')]['filter']){_0x44a0cd['where']=_[_0xb548('0x39')](_0x44a0cd[_0xb548('0x38')],{'$or':_[_0xb548('0x28')](_0x3e476c,function(_0x1c6b5f){if(_0x1c6b5f[_0xb548('0x3a')]!=='VIRTUAL'){var _0x573145={};_0x573145[_0x1c6b5f['name']]={'$like':'%'+_0x39def5[_0xb548('0x2f')][_0xb548('0x3b')]+'%'};return _0x573145;}})});}_0x44a0cd=_[_0xb548('0x39')]({},_0x44a0cd,_0x39def5[_0xb548('0x3c')]);var _0x2f653d={'where':_0x44a0cd['where']};return db[_0xb548('0x3d')][_0xb548('0x1d')](_0x2f653d)[_0xb548('0x22')](function(_0x71623f){_0x2f0240[_0xb548('0x1d')]=_0x71623f;if(_0x39def5['query'][_0xb548('0x3e')]){_0x44a0cd['include']=[{'all':!![]}];}return db[_0xb548('0x3d')][_0xb548('0x3f')](_0x44a0cd);})['then'](function(_0x3e4509){_0x2f0240[_0xb548('0x40')]=_0x3e4509;return _0x2f0240;})[_0xb548('0x22')](respondWithFilteredResult(_0x479e0d,_0x44a0cd))[_0xb548('0x41')](handleError(_0x479e0d,null));};exports[_0xb548('0x42')]=function(_0x1e7643,_0x3a3cfe){var _0x14e010={'raw':![],'where':{'id':_0x1e7643[_0xb548('0x43')]['id']}},_0x8330a0={};_0x8330a0['model']=_[_0xb548('0x2e')](db[_0xb548('0x3d')]['rawAttributes']);_0x8330a0[_0xb548('0x2f')]=_[_0xb548('0x2e')](_0x1e7643['query']);_0x8330a0[_0xb548('0x30')]=_[_0xb548('0x31')](_0x8330a0[_0xb548('0x2c')],_0x8330a0['query']);_0x14e010[_0xb548('0x33')]=_[_0xb548('0x31')](_0x8330a0[_0xb548('0x2c')],qs[_0xb548('0x32')](_0x1e7643['query'][_0xb548('0x32')]));_0x14e010[_0xb548('0x33')]=_0x14e010[_0xb548('0x33')]['length']?_0x14e010[_0xb548('0x33')]:_0x8330a0[_0xb548('0x2c')];if(_0x1e7643[_0xb548('0x2f')][_0xb548('0x3e')]){_0x14e010[_0xb548('0x44')]=[{'all':!![]}];}_0x14e010=_['merge']({},_0x14e010,_0x1e7643[_0xb548('0x3c')]);return db['FreshdeskConfiguration'][_0xb548('0x45')](_0x14e010)[_0xb548('0x22')](handleEntityNotFound(_0x3a3cfe,null))['then'](respondWithResult(_0x3a3cfe,null))[_0xb548('0x41')](handleError(_0x3a3cfe,null));};exports[_0xb548('0x46')]=function(_0x3dd856,_0xcfb137){return db[_0xb548('0x3d')][_0xb548('0x46')](_0x3dd856[_0xb548('0x47')],{})[_0xb548('0x22')](respondWithResult(_0xcfb137,0xc9))[_0xb548('0x41')](handleError(_0xcfb137,null));};exports[_0xb548('0x48')]=function(_0x3859e5,_0x3560d4){if(_0x3859e5[_0xb548('0x47')]['id']){delete _0x3859e5[_0xb548('0x47')]['id'];}return db['FreshdeskConfiguration'][_0xb548('0x45')]({'where':{'id':_0x3859e5[_0xb548('0x43')]['id']}})[_0xb548('0x22')](handleEntityNotFound(_0x3560d4,null))['then'](saveUpdates(_0x3859e5[_0xb548('0x47')],null))['then'](respondWithResult(_0x3560d4,null))[_0xb548('0x41')](handleError(_0x3560d4,null));};exports[_0xb548('0x23')]=function(_0x551eda,_0x2a2719){return db[_0xb548('0x3d')][_0xb548('0x45')]({'where':{'id':_0x551eda[_0xb548('0x43')]['id']}})[_0xb548('0x22')](handleEntityNotFound(_0x2a2719,null))[_0xb548('0x22')](removeEntity(_0x2a2719,null))[_0xb548('0x41')](handleError(_0x2a2719,null));};exports[_0xb548('0x49')]=function(_0x284985,_0x5c20f7,_0x26b7ba){var _0x42bf6a={};var _0x1c5e7f={};var _0x40afd9;var _0x139b60;return db[_0xb548('0x3d')]['findOne']({'where':{'id':_0x284985[_0xb548('0x43')]['id']}})[_0xb548('0x22')](handleEntityNotFound(_0x5c20f7,null))[_0xb548('0x22')](function(_0x275ec4){if(_0x275ec4){_0x40afd9=_0x275ec4;_0x1c5e7f['model']=_[_0xb548('0x2e')](db['FreshdeskField']['rawAttributes']);_0x1c5e7f['query']=_[_0xb548('0x2e')](_0x284985[_0xb548('0x2f')]);_0x1c5e7f['filters']=_['intersection'](_0x1c5e7f[_0xb548('0x2c')],_0x1c5e7f[_0xb548('0x2f')]);_0x42bf6a[_0xb548('0x33')]=_['intersection'](_0x1c5e7f[_0xb548('0x2c')],qs[_0xb548('0x32')](_0x284985[_0xb548('0x2f')][_0xb548('0x32')]));_0x42bf6a[_0xb548('0x33')]=_0x42bf6a[_0xb548('0x33')][_0xb548('0x4a')]?_0x42bf6a[_0xb548('0x33')]:_0x1c5e7f[_0xb548('0x2c')];_0x42bf6a[_0xb548('0x36')]=qs[_0xb548('0x37')](_0x284985[_0xb548('0x2f')][_0xb548('0x37')]);_0x42bf6a[_0xb548('0x38')]=qs['filters'](_['pick'](_0x284985['query'],_0x1c5e7f[_0xb548('0x30')]));if(_0x284985[_0xb548('0x2f')][_0xb548('0x3b')]){_0x42bf6a['where']=_[_0xb548('0x39')](_0x42bf6a['where'],{'$or':_[_0xb548('0x28')](_0x42bf6a['attributes'],function(_0x17b9ad){var _0x53379c={};_0x53379c[_0x17b9ad]={'$like':'%'+_0x284985['query'][_0xb548('0x3b')]+'%'};return _0x53379c;})});}_0x42bf6a=_['merge']({},_0x42bf6a,_0x284985[_0xb548('0x3c')]);return _0x40afd9[_0xb548('0x49')](_0x42bf6a);}})[_0xb548('0x22')](function(_0x21c4c0){if(_0x21c4c0){_0x139b60=_0x21c4c0[_0xb548('0x4a')];if(!_0x284985[_0xb548('0x2f')]['hasOwnProperty']('nolimit')){_0x42bf6a[_0xb548('0x1c')]=qs[_0xb548('0x1c')](_0x284985['query'][_0xb548('0x1c')]);_0x42bf6a[_0xb548('0x1a')]=qs['offset'](_0x284985[_0xb548('0x2f')][_0xb548('0x1a')]);}return _0x40afd9[_0xb548('0x49')](_0x42bf6a);}})[_0xb548('0x22')](function(_0x5ded71){if(_0x5ded71){return _0x5ded71?{'count':_0x139b60,'rows':_0x5ded71}:null;}})[_0xb548('0x22')](respondWithResult(_0x5c20f7,null))[_0xb548('0x41')](handleError(_0x5c20f7,null));};exports['getSubjects']=function(_0x508e9c,_0x1af101,_0x42e6b5){var _0x47e289={};var _0x548130={};var _0x5c48ac;var _0x8d30c6;return db[_0xb548('0x3d')][_0xb548('0x4b')]({'where':{'id':_0x508e9c['params']['id']}})['then'](handleEntityNotFound(_0x1af101,null))['then'](function(_0x26c009){if(_0x26c009){_0x5c48ac=_0x26c009;_0x548130['model']=_[_0xb548('0x2e')](db[_0xb548('0x4c')][_0xb548('0x29')]);_0x548130[_0xb548('0x2f')]=_[_0xb548('0x2e')](_0x508e9c[_0xb548('0x2f')]);_0x548130['filters']=_[_0xb548('0x31')](_0x548130[_0xb548('0x2c')],_0x548130[_0xb548('0x2f')]);_0x47e289[_0xb548('0x33')]=_[_0xb548('0x31')](_0x548130['model'],qs['fields'](_0x508e9c[_0xb548('0x2f')][_0xb548('0x32')]));_0x47e289['attributes']=_0x47e289['attributes'][_0xb548('0x4a')]?_0x47e289['attributes']:_0x548130[_0xb548('0x2c')];_0x47e289[_0xb548('0x36')]=qs[_0xb548('0x37')](_0x508e9c[_0xb548('0x2f')]['sort']);_0x47e289['where']=qs[_0xb548('0x30')](_[_0xb548('0x4d')](_0x508e9c[_0xb548('0x2f')],_0x548130[_0xb548('0x30')]));if(_0x508e9c['query'][_0xb548('0x3b')]){_0x47e289[_0xb548('0x38')]=_[_0xb548('0x39')](_0x47e289[_0xb548('0x38')],{'$or':_[_0xb548('0x28')](_0x47e289[_0xb548('0x33')],function(_0x3f4354){var _0x44eb79={};_0x44eb79[_0x3f4354]={'$like':'%'+_0x508e9c[_0xb548('0x2f')][_0xb548('0x3b')]+'%'};return _0x44eb79;})});}_0x47e289=_[_0xb548('0x39')]({},_0x47e289,_0x508e9c[_0xb548('0x3c')]);return _0x5c48ac[_0xb548('0x4e')](_0x47e289);}})[_0xb548('0x22')](function(_0x3da558){if(_0x3da558){_0x8d30c6=_0x3da558['length'];if(!_0x508e9c['query']['hasOwnProperty'](_0xb548('0x35'))){_0x47e289['limit']=qs[_0xb548('0x1c')](_0x508e9c[_0xb548('0x2f')]['limit']);_0x47e289[_0xb548('0x1a')]=qs[_0xb548('0x1a')](_0x508e9c[_0xb548('0x2f')][_0xb548('0x1a')]);}return _0x5c48ac['getSubjects'](_0x47e289);}})[_0xb548('0x22')](function(_0x33399f){if(_0x33399f){return _0x33399f?{'count':_0x8d30c6,'rows':_0x33399f}:null;}})[_0xb548('0x22')](respondWithResult(_0x1af101,null))[_0xb548('0x41')](handleError(_0x1af101,null));};exports['getDescriptions']=function(_0x59a47c,_0x3f34ba,_0x4fc70e){var _0x58e184={};var _0x4c4d74={};var _0x49d2d2;var _0x26db3e;return db[_0xb548('0x3d')][_0xb548('0x4b')]({'where':{'id':_0x59a47c[_0xb548('0x43')]['id']}})[_0xb548('0x22')](handleEntityNotFound(_0x3f34ba,null))[_0xb548('0x22')](function(_0x5a631a){if(_0x5a631a){_0x49d2d2=_0x5a631a;_0x4c4d74[_0xb548('0x2c')]=_['keys'](db[_0xb548('0x4c')][_0xb548('0x29')]);_0x4c4d74[_0xb548('0x2f')]=_[_0xb548('0x2e')](_0x59a47c[_0xb548('0x2f')]);_0x4c4d74['filters']=_[_0xb548('0x31')](_0x4c4d74[_0xb548('0x2c')],_0x4c4d74['query']);_0x58e184[_0xb548('0x33')]=_[_0xb548('0x31')](_0x4c4d74['model'],qs[_0xb548('0x32')](_0x59a47c[_0xb548('0x2f')][_0xb548('0x32')]));_0x58e184[_0xb548('0x33')]=_0x58e184[_0xb548('0x33')][_0xb548('0x4a')]?_0x58e184['attributes']:_0x4c4d74[_0xb548('0x2c')];_0x58e184[_0xb548('0x36')]=qs[_0xb548('0x37')](_0x59a47c['query']['sort']);_0x58e184[_0xb548('0x38')]=qs[_0xb548('0x30')](_[_0xb548('0x4d')](_0x59a47c[_0xb548('0x2f')],_0x4c4d74[_0xb548('0x30')]));if(_0x59a47c[_0xb548('0x2f')][_0xb548('0x3b')]){_0x58e184[_0xb548('0x38')]=_['merge'](_0x58e184[_0xb548('0x38')],{'$or':_[_0xb548('0x28')](_0x58e184['attributes'],function(_0x347d7a){var _0x213764={};_0x213764[_0x347d7a]={'$like':'%'+_0x59a47c[_0xb548('0x2f')][_0xb548('0x3b')]+'%'};return _0x213764;})});}_0x58e184=_['merge']({},_0x58e184,_0x59a47c[_0xb548('0x3c')]);return _0x49d2d2[_0xb548('0x4f')](_0x58e184);}})[_0xb548('0x22')](function(_0x30dfb0){if(_0x30dfb0){_0x26db3e=_0x30dfb0[_0xb548('0x4a')];if(!_0x59a47c[_0xb548('0x2f')][_0xb548('0x34')]('nolimit')){_0x58e184[_0xb548('0x1c')]=qs[_0xb548('0x1c')](_0x59a47c['query'][_0xb548('0x1c')]);_0x58e184[_0xb548('0x1a')]=qs[_0xb548('0x1a')](_0x59a47c[_0xb548('0x2f')][_0xb548('0x1a')]);}return _0x49d2d2['getDescriptions'](_0x58e184);}})[_0xb548('0x22')](function(_0x5b08f2){if(_0x5b08f2){return _0x5b08f2?{'count':_0x26db3e,'rows':_0x5b08f2}:null;}})[_0xb548('0x22')](respondWithResult(_0x3f34ba,null))['catch'](handleError(_0x3f34ba,null));};exports['getTags']=function(_0x4c0bc6,_0x2a2d94,_0x5d1057){var _0x25db84={};var _0x2835b8={};var _0x467523;var _0x24dbb8;return db[_0xb548('0x3d')][_0xb548('0x4b')]({'where':{'id':_0x4c0bc6[_0xb548('0x43')]['id']}})[_0xb548('0x22')](handleEntityNotFound(_0x2a2d94,null))[_0xb548('0x22')](function(_0x5077fb){if(_0x5077fb){_0x467523=_0x5077fb;_0x2835b8[_0xb548('0x2c')]=_[_0xb548('0x2e')](db[_0xb548('0x50')][_0xb548('0x29')]);_0x2835b8[_0xb548('0x2f')]=_[_0xb548('0x2e')](_0x4c0bc6[_0xb548('0x2f')]);_0x2835b8[_0xb548('0x30')]=_[_0xb548('0x31')](_0x2835b8[_0xb548('0x2c')],_0x2835b8[_0xb548('0x2f')]);_0x25db84[_0xb548('0x33')]=_[_0xb548('0x31')](_0x2835b8['model'],qs[_0xb548('0x32')](_0x4c0bc6[_0xb548('0x2f')][_0xb548('0x32')]));_0x25db84['attributes']=_0x25db84[_0xb548('0x33')]['length']?_0x25db84['attributes']:_0x2835b8[_0xb548('0x2c')];_0x25db84[_0xb548('0x36')]=qs[_0xb548('0x37')](_0x4c0bc6[_0xb548('0x2f')]['sort']);_0x25db84[_0xb548('0x38')]=qs[_0xb548('0x30')](_[_0xb548('0x4d')](_0x4c0bc6[_0xb548('0x2f')],_0x2835b8[_0xb548('0x30')]));if(_0x4c0bc6[_0xb548('0x2f')]['filter']){_0x25db84['where']=_[_0xb548('0x39')](_0x25db84['where'],{'$or':_['map'](_0x25db84[_0xb548('0x33')],function(_0x43d44e){var _0x367a5d={};_0x367a5d[_0x43d44e]={'$like':'%'+_0x4c0bc6[_0xb548('0x2f')][_0xb548('0x3b')]+'%'};return _0x367a5d;})});}_0x25db84=_[_0xb548('0x39')]({},_0x25db84,_0x4c0bc6['options']);return _0x467523[_0xb548('0x51')](_0x25db84);}})[_0xb548('0x22')](function(_0x39089c){if(_0x39089c){_0x24dbb8=_0x39089c[_0xb548('0x4a')];if(!_0x4c0bc6[_0xb548('0x2f')][_0xb548('0x34')](_0xb548('0x35'))){_0x25db84[_0xb548('0x1c')]=qs[_0xb548('0x1c')](_0x4c0bc6[_0xb548('0x2f')][_0xb548('0x1c')]);_0x25db84[_0xb548('0x1a')]=qs['offset'](_0x4c0bc6[_0xb548('0x2f')]['offset']);}return _0x467523[_0xb548('0x51')](_0x25db84);}})[_0xb548('0x22')](function(_0x12f381){if(_0x12f381){return _0x12f381?{'count':_0x24dbb8,'rows':_0x12f381}:null;}})[_0xb548('0x22')](respondWithResult(_0x2a2d94,null))['catch'](handleError(_0x2a2d94,null));};exports[_0xb548('0x52')]=function(_0x4a2430,_0x3f270c,_0x35e104){if(_0x4a2430[_0xb548('0x47')]['id']){delete _0x4a2430[_0xb548('0x47')]['id'];}return db[_0xb548('0x3d')][_0xb548('0x4b')]({'where':{'id':_0x4a2430[_0xb548('0x43')]['id']}})[_0xb548('0x22')](handleEntityNotFound(_0x3f270c,null))[_0xb548('0x22')](function(_0x4ebd2a){if(_0x4ebd2a){return _0x4ebd2a[_0xb548('0x52')](_0x4a2430[_0xb548('0x47')][_0xb548('0x53')]||[]);}return null;})[_0xb548('0x22')](respondWithResult(_0x3f270c,null))['catch'](handleError(_0x3f270c,null));}; \ No newline at end of file +var _0xa20f=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','find','getFields','FreshdeskField','getSubjects','getDescriptions','findOne','pick','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5de818,_0x7c4485){var _0x345670=function(_0x5e268d){while(--_0x5e268d){_0x5de818['push'](_0x5de818['shift']());}};_0x345670(++_0x7c4485);}(_0xa20f,0xfb));var _0xfa20=function(_0x58dd18,_0x4e6fa0){_0x58dd18=_0x58dd18-0x0;var _0x1bc723=_0xa20f[_0x58dd18];return _0x1bc723;};'use strict';var emlformat=require(_0xfa20('0x0'));var rimraf=require(_0xfa20('0x1'));var zipdir=require(_0xfa20('0x2'));var jsonpatch=require(_0xfa20('0x3'));var rp=require(_0xfa20('0x4'));var moment=require('moment');var BPromise=require(_0xfa20('0x5'));var Mustache=require(_0xfa20('0x6'));var util=require(_0xfa20('0x7'));var path=require('path');var sox=require(_0xfa20('0x8'));var csv=require(_0xfa20('0x9'));var ejs=require(_0xfa20('0xa'));var fs=require('fs');var fs_extra=require(_0xfa20('0xb'));var _=require(_0xfa20('0xc'));var squel=require(_0xfa20('0xd'));var crypto=require(_0xfa20('0xe'));var jsforce=require(_0xfa20('0xf'));var deskjs=require(_0xfa20('0x10'));var toCsv=require(_0xfa20('0x9'));var querystring=require(_0xfa20('0x11'));var Papa=require('papaparse');var Redis=require(_0xfa20('0x12'));var authService=require(_0xfa20('0x13'));var qs=require(_0xfa20('0x14'));var as=require(_0xfa20('0x15'));var hardwareService=require(_0xfa20('0x16'));var logger=require(_0xfa20('0x17'))('api');var utils=require(_0xfa20('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfa20('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455c06,_0x4591e8){_0x4591e8=_0x4591e8||0xcc;return function(_0x293d49){if(_0x293d49){return _0x455c06[_0xfa20('0x1a')](_0x4591e8);}return _0x455c06[_0xfa20('0x1b')](_0x4591e8)[_0xfa20('0x1c')]();};}function respondWithResult(_0x1de3a3,_0x61593f){_0x61593f=_0x61593f||0xc8;return function(_0x16dc71){if(_0x16dc71){return _0x1de3a3[_0xfa20('0x1b')](_0x61593f)[_0xfa20('0x1d')](_0x16dc71);}};}function respondWithFilteredResult(_0xc54356,_0x3420e1){return function(_0x493d8b){if(_0x493d8b){var _0x2bb7a3=typeof _0x3420e1[_0xfa20('0x1e')]===_0xfa20('0x1f')&&typeof _0x3420e1[_0xfa20('0x20')]===_0xfa20('0x1f');var _0x32d27b=_0x493d8b['count'];var _0x50e534=_0x2bb7a3?0x0:_0x3420e1[_0xfa20('0x1e')];var _0x35cedb=_0x2bb7a3?_0x493d8b['count']:_0x3420e1['offset']+_0x3420e1[_0xfa20('0x20')];var _0x1fe533;if(_0x35cedb>=_0x32d27b){_0x35cedb=_0x32d27b;_0x1fe533=0xc8;}else{_0x1fe533=0xce;}_0xc54356[_0xfa20('0x1b')](_0x1fe533);return _0xc54356['set'](_0xfa20('0x21'),_0x50e534+'-'+_0x35cedb+'/'+_0x32d27b)[_0xfa20('0x1d')](_0x493d8b);}return null;};}function patchUpdates(_0x42b19d){return function(_0x107a46){try{jsonpatch[_0xfa20('0x22')](_0x107a46,_0x42b19d,!![]);}catch(_0xd8693b){return BPromise[_0xfa20('0x23')](_0xd8693b);}return _0x107a46[_0xfa20('0x24')]();};}function saveUpdates(_0x4f621d,_0x2dee4d){return function(_0x3341a8){if(_0x3341a8){return _0x3341a8[_0xfa20('0x25')](_0x4f621d)[_0xfa20('0x26')](function(_0x42bc08){return _0x42bc08;});}return null;};}function removeEntity(_0x368c5d,_0x19fc3c){return function(_0x258828){if(_0x258828){return _0x258828[_0xfa20('0x27')]()[_0xfa20('0x26')](function(){_0x368c5d[_0xfa20('0x1b')](0xcc)[_0xfa20('0x1c')]();});}};}function handleEntityNotFound(_0x5b867b,_0x97a4da){return function(_0x25cf2d){if(!_0x25cf2d){_0x5b867b[_0xfa20('0x1a')](0x194);}return _0x25cf2d;};}function handleError(_0x3e135f,_0x3828a3){_0x3828a3=_0x3828a3||0x1f4;return function(_0x501036){logger[_0xfa20('0x28')](_0x501036[_0xfa20('0x29')]);if(_0x501036[_0xfa20('0x2a')]){delete _0x501036[_0xfa20('0x2a')];}_0x3e135f[_0xfa20('0x1b')](_0x3828a3)[_0xfa20('0x2b')](_0x501036);};}exports[_0xfa20('0x2c')]=function(_0xb3234f,_0x28050a){var _0x306da6={},_0x4fe564={},_0x4b96ab={'count':0x0,'rows':[]};var _0x383e24=_[_0xfa20('0x2d')](db[_0xfa20('0x2e')][_0xfa20('0x2f')],function(_0x4a9c11){return{'name':_0x4a9c11['fieldName'],'type':_0x4a9c11[_0xfa20('0x30')][_0xfa20('0x31')]};});_0x4fe564[_0xfa20('0x32')]=_[_0xfa20('0x2d')](_0x383e24,_0xfa20('0x2a'));_0x4fe564[_0xfa20('0x33')]=_[_0xfa20('0x34')](_0xb3234f['query']);_0x4fe564['filters']=_[_0xfa20('0x35')](_0x4fe564[_0xfa20('0x32')],_0x4fe564[_0xfa20('0x33')]);_0x306da6['attributes']=_[_0xfa20('0x35')](_0x4fe564[_0xfa20('0x32')],qs['fields'](_0xb3234f[_0xfa20('0x33')][_0xfa20('0x36')]));_0x306da6[_0xfa20('0x37')]=_0x306da6[_0xfa20('0x37')][_0xfa20('0x38')]?_0x306da6[_0xfa20('0x37')]:_0x4fe564['model'];if(!_0xb3234f[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x306da6['limit']=qs[_0xfa20('0x20')](_0xb3234f[_0xfa20('0x33')]['limit']);_0x306da6[_0xfa20('0x1e')]=qs['offset'](_0xb3234f['query'][_0xfa20('0x1e')]);}_0x306da6[_0xfa20('0x3b')]=qs[_0xfa20('0x3c')](_0xb3234f[_0xfa20('0x33')]['sort']);_0x306da6[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_['pick'](_0xb3234f[_0xfa20('0x33')],_0x4fe564[_0xfa20('0x3e')]),_0x383e24);if(_0xb3234f[_0xfa20('0x33')][_0xfa20('0x3f')]){_0x306da6['where']=_[_0xfa20('0x40')](_0x306da6['where'],{'$or':_['map'](_0x383e24,function(_0x14cb91){if(_0x14cb91[_0xfa20('0x30')]!==_0xfa20('0x41')){var _0x3023bb={};_0x3023bb[_0x14cb91[_0xfa20('0x2a')]]={'$like':'%'+_0xb3234f['query'][_0xfa20('0x3f')]+'%'};return _0x3023bb;}})});}_0x306da6=_['merge']({},_0x306da6,_0xb3234f[_0xfa20('0x42')]);var _0x37da60={'where':_0x306da6['where']};return db[_0xfa20('0x2e')]['count'](_0x37da60)[_0xfa20('0x26')](function(_0x13672f){_0x4b96ab[_0xfa20('0x43')]=_0x13672f;if(_0xb3234f[_0xfa20('0x33')][_0xfa20('0x44')]){_0x306da6[_0xfa20('0x45')]=[{'all':!![]}];}return db[_0xfa20('0x2e')][_0xfa20('0x46')](_0x306da6);})[_0xfa20('0x26')](function(_0x50c128){_0x4b96ab['rows']=_0x50c128;return _0x4b96ab;})[_0xfa20('0x26')](respondWithFilteredResult(_0x28050a,_0x306da6))[_0xfa20('0x47')](handleError(_0x28050a,null));};exports[_0xfa20('0x48')]=function(_0x8fe30c,_0x482349){var _0x2282d1={'raw':![],'where':{'id':_0x8fe30c[_0xfa20('0x49')]['id']}},_0x5c74ab={};_0x5c74ab[_0xfa20('0x32')]=_[_0xfa20('0x34')](db[_0xfa20('0x2e')][_0xfa20('0x2f')]);_0x5c74ab['query']=_['keys'](_0x8fe30c['query']);_0x5c74ab[_0xfa20('0x3e')]=_[_0xfa20('0x35')](_0x5c74ab[_0xfa20('0x32')],_0x5c74ab['query']);_0x2282d1[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x5c74ab[_0xfa20('0x32')],qs[_0xfa20('0x36')](_0x8fe30c[_0xfa20('0x33')][_0xfa20('0x36')]));_0x2282d1[_0xfa20('0x37')]=_0x2282d1['attributes'][_0xfa20('0x38')]?_0x2282d1[_0xfa20('0x37')]:_0x5c74ab['model'];if(_0x8fe30c[_0xfa20('0x33')]['includeAll']){_0x2282d1[_0xfa20('0x45')]=[{'all':!![]}];}_0x2282d1=_[_0xfa20('0x40')]({},_0x2282d1,_0x8fe30c[_0xfa20('0x42')]);return db[_0xfa20('0x2e')]['find'](_0x2282d1)[_0xfa20('0x26')](handleEntityNotFound(_0x482349,null))['then'](respondWithResult(_0x482349,null))['catch'](handleError(_0x482349,null));};exports[_0xfa20('0x4a')]=function(_0xfb19a0,_0x147dfc){return db['FreshdeskConfiguration'][_0xfa20('0x4a')](_0xfb19a0[_0xfa20('0x4b')],{})['then'](respondWithResult(_0x147dfc,0xc9))[_0xfa20('0x47')](handleError(_0x147dfc,null));};exports[_0xfa20('0x25')]=function(_0x494d23,_0x1ed924){if(_0x494d23[_0xfa20('0x4b')]['id']){delete _0x494d23[_0xfa20('0x4b')]['id'];}return db[_0xfa20('0x2e')][_0xfa20('0x4c')]({'where':{'id':_0x494d23[_0xfa20('0x49')]['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x1ed924,null))[_0xfa20('0x26')](saveUpdates(_0x494d23[_0xfa20('0x4b')],null))[_0xfa20('0x26')](respondWithResult(_0x1ed924,null))['catch'](handleError(_0x1ed924,null));};exports['destroy']=function(_0x4f151f,_0x77d4da){return db[_0xfa20('0x2e')][_0xfa20('0x4c')]({'where':{'id':_0x4f151f[_0xfa20('0x49')]['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x77d4da,null))[_0xfa20('0x26')](removeEntity(_0x77d4da,null))[_0xfa20('0x47')](handleError(_0x77d4da,null));};exports[_0xfa20('0x4d')]=function(_0x40f070,_0x2c169b,_0x2b696b){var _0x4eedb6={};var _0x2909ec={};var _0x6e2c3;var _0xdf3f66;return db[_0xfa20('0x2e')]['findOne']({'where':{'id':_0x40f070[_0xfa20('0x49')]['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x2c169b,null))[_0xfa20('0x26')](function(_0x196a9e){if(_0x196a9e){_0x6e2c3=_0x196a9e;_0x2909ec[_0xfa20('0x32')]=_[_0xfa20('0x34')](db[_0xfa20('0x4e')][_0xfa20('0x2f')]);_0x2909ec['query']=_[_0xfa20('0x34')](_0x40f070[_0xfa20('0x33')]);_0x2909ec['filters']=_[_0xfa20('0x35')](_0x2909ec[_0xfa20('0x32')],_0x2909ec[_0xfa20('0x33')]);_0x4eedb6['attributes']=_[_0xfa20('0x35')](_0x2909ec[_0xfa20('0x32')],qs[_0xfa20('0x36')](_0x40f070['query'][_0xfa20('0x36')]));_0x4eedb6['attributes']=_0x4eedb6[_0xfa20('0x37')]['length']?_0x4eedb6[_0xfa20('0x37')]:_0x2909ec['model'];_0x4eedb6[_0xfa20('0x3b')]=qs['sort'](_0x40f070[_0xfa20('0x33')]['sort']);_0x4eedb6[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_['pick'](_0x40f070[_0xfa20('0x33')],_0x2909ec[_0xfa20('0x3e')]));if(_0x40f070['query']['filter']){_0x4eedb6[_0xfa20('0x3d')]=_[_0xfa20('0x40')](_0x4eedb6[_0xfa20('0x3d')],{'$or':_[_0xfa20('0x2d')](_0x4eedb6[_0xfa20('0x37')],function(_0x2e0495){var _0x46ddbe={};_0x46ddbe[_0x2e0495]={'$like':'%'+_0x40f070[_0xfa20('0x33')]['filter']+'%'};return _0x46ddbe;})});}_0x4eedb6=_[_0xfa20('0x40')]({},_0x4eedb6,_0x40f070[_0xfa20('0x42')]);return _0x6e2c3[_0xfa20('0x4d')](_0x4eedb6);}})[_0xfa20('0x26')](function(_0x4141a8){if(_0x4141a8){_0xdf3f66=_0x4141a8['length'];if(!_0x40f070[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x4eedb6[_0xfa20('0x20')]=qs['limit'](_0x40f070[_0xfa20('0x33')]['limit']);_0x4eedb6[_0xfa20('0x1e')]=qs[_0xfa20('0x1e')](_0x40f070['query'][_0xfa20('0x1e')]);}return _0x6e2c3[_0xfa20('0x4d')](_0x4eedb6);}})[_0xfa20('0x26')](function(_0x5e7dd2){if(_0x5e7dd2){return _0x5e7dd2?{'count':_0xdf3f66,'rows':_0x5e7dd2}:null;}})[_0xfa20('0x26')](respondWithResult(_0x2c169b,null))[_0xfa20('0x47')](handleError(_0x2c169b,null));};exports[_0xfa20('0x4f')]=function(_0xdabd60,_0x82077c,_0xd467f3){var _0x29e7f2={};var _0x465567={};var _0x160dfe;var _0x11b78b;return db[_0xfa20('0x2e')]['findOne']({'where':{'id':_0xdabd60['params']['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x82077c,null))[_0xfa20('0x26')](function(_0x1a37eb){if(_0x1a37eb){_0x160dfe=_0x1a37eb;_0x465567['model']=_[_0xfa20('0x34')](db[_0xfa20('0x4e')]['rawAttributes']);_0x465567[_0xfa20('0x33')]=_[_0xfa20('0x34')](_0xdabd60[_0xfa20('0x33')]);_0x465567[_0xfa20('0x3e')]=_[_0xfa20('0x35')](_0x465567[_0xfa20('0x32')],_0x465567[_0xfa20('0x33')]);_0x29e7f2[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x465567[_0xfa20('0x32')],qs['fields'](_0xdabd60[_0xfa20('0x33')]['fields']));_0x29e7f2[_0xfa20('0x37')]=_0x29e7f2['attributes'][_0xfa20('0x38')]?_0x29e7f2[_0xfa20('0x37')]:_0x465567[_0xfa20('0x32')];_0x29e7f2[_0xfa20('0x3b')]=qs['sort'](_0xdabd60[_0xfa20('0x33')]['sort']);_0x29e7f2[_0xfa20('0x3d')]=qs['filters'](_['pick'](_0xdabd60[_0xfa20('0x33')],_0x465567['filters']));if(_0xdabd60['query'][_0xfa20('0x3f')]){_0x29e7f2[_0xfa20('0x3d')]=_[_0xfa20('0x40')](_0x29e7f2[_0xfa20('0x3d')],{'$or':_[_0xfa20('0x2d')](_0x29e7f2[_0xfa20('0x37')],function(_0x18b642){var _0x516c5b={};_0x516c5b[_0x18b642]={'$like':'%'+_0xdabd60[_0xfa20('0x33')][_0xfa20('0x3f')]+'%'};return _0x516c5b;})});}_0x29e7f2=_[_0xfa20('0x40')]({},_0x29e7f2,_0xdabd60['options']);return _0x160dfe[_0xfa20('0x4f')](_0x29e7f2);}})[_0xfa20('0x26')](function(_0x3b3f64){if(_0x3b3f64){_0x11b78b=_0x3b3f64['length'];if(!_0xdabd60[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x29e7f2['limit']=qs[_0xfa20('0x20')](_0xdabd60[_0xfa20('0x33')][_0xfa20('0x20')]);_0x29e7f2['offset']=qs[_0xfa20('0x1e')](_0xdabd60[_0xfa20('0x33')][_0xfa20('0x1e')]);}return _0x160dfe[_0xfa20('0x4f')](_0x29e7f2);}})[_0xfa20('0x26')](function(_0x4223a9){if(_0x4223a9){return _0x4223a9?{'count':_0x11b78b,'rows':_0x4223a9}:null;}})[_0xfa20('0x26')](respondWithResult(_0x82077c,null))[_0xfa20('0x47')](handleError(_0x82077c,null));};exports[_0xfa20('0x50')]=function(_0x3aa3fe,_0x31507b,_0x1fd032){var _0x4f16a6={};var _0x5a6430={};var _0x1b3f67;var _0x215ec9;return db[_0xfa20('0x2e')][_0xfa20('0x51')]({'where':{'id':_0x3aa3fe['params']['id']}})['then'](handleEntityNotFound(_0x31507b,null))[_0xfa20('0x26')](function(_0x19f612){if(_0x19f612){_0x1b3f67=_0x19f612;_0x5a6430[_0xfa20('0x32')]=_[_0xfa20('0x34')](db[_0xfa20('0x4e')][_0xfa20('0x2f')]);_0x5a6430[_0xfa20('0x33')]=_[_0xfa20('0x34')](_0x3aa3fe[_0xfa20('0x33')]);_0x5a6430['filters']=_[_0xfa20('0x35')](_0x5a6430['model'],_0x5a6430['query']);_0x4f16a6[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x5a6430[_0xfa20('0x32')],qs['fields'](_0x3aa3fe['query'][_0xfa20('0x36')]));_0x4f16a6['attributes']=_0x4f16a6['attributes']['length']?_0x4f16a6['attributes']:_0x5a6430[_0xfa20('0x32')];_0x4f16a6[_0xfa20('0x3b')]=qs[_0xfa20('0x3c')](_0x3aa3fe[_0xfa20('0x33')]['sort']);_0x4f16a6[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_[_0xfa20('0x52')](_0x3aa3fe['query'],_0x5a6430['filters']));if(_0x3aa3fe['query'][_0xfa20('0x3f')]){_0x4f16a6[_0xfa20('0x3d')]=_[_0xfa20('0x40')](_0x4f16a6['where'],{'$or':_['map'](_0x4f16a6[_0xfa20('0x37')],function(_0x332ed5){var _0x31e388={};_0x31e388[_0x332ed5]={'$like':'%'+_0x3aa3fe[_0xfa20('0x33')][_0xfa20('0x3f')]+'%'};return _0x31e388;})});}_0x4f16a6=_[_0xfa20('0x40')]({},_0x4f16a6,_0x3aa3fe[_0xfa20('0x42')]);return _0x1b3f67[_0xfa20('0x50')](_0x4f16a6);}})[_0xfa20('0x26')](function(_0x59a9ad){if(_0x59a9ad){_0x215ec9=_0x59a9ad[_0xfa20('0x38')];if(!_0x3aa3fe[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x4f16a6[_0xfa20('0x20')]=qs[_0xfa20('0x20')](_0x3aa3fe['query'][_0xfa20('0x20')]);_0x4f16a6[_0xfa20('0x1e')]=qs[_0xfa20('0x1e')](_0x3aa3fe['query'][_0xfa20('0x1e')]);}return _0x1b3f67['getDescriptions'](_0x4f16a6);}})['then'](function(_0xc6d6f0){if(_0xc6d6f0){return _0xc6d6f0?{'count':_0x215ec9,'rows':_0xc6d6f0}:null;}})[_0xfa20('0x26')](respondWithResult(_0x31507b,null))[_0xfa20('0x47')](handleError(_0x31507b,null));};exports['getTags']=function(_0x2ec3a1,_0x16491c,_0x7ae94b){var _0x4842fa={};var _0x17584d={};var _0x36822a;var _0x38d919;return db['FreshdeskConfiguration'][_0xfa20('0x51')]({'where':{'id':_0x2ec3a1['params']['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x16491c,null))[_0xfa20('0x26')](function(_0x99affe){if(_0x99affe){_0x36822a=_0x99affe;_0x17584d[_0xfa20('0x32')]=_[_0xfa20('0x34')](db['Tag']['rawAttributes']);_0x17584d['query']=_[_0xfa20('0x34')](_0x2ec3a1[_0xfa20('0x33')]);_0x17584d[_0xfa20('0x3e')]=_[_0xfa20('0x35')](_0x17584d[_0xfa20('0x32')],_0x17584d[_0xfa20('0x33')]);_0x4842fa[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x17584d[_0xfa20('0x32')],qs[_0xfa20('0x36')](_0x2ec3a1[_0xfa20('0x33')]['fields']));_0x4842fa[_0xfa20('0x37')]=_0x4842fa[_0xfa20('0x37')][_0xfa20('0x38')]?_0x4842fa['attributes']:_0x17584d[_0xfa20('0x32')];_0x4842fa[_0xfa20('0x3b')]=qs[_0xfa20('0x3c')](_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x3c')]);_0x4842fa[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_[_0xfa20('0x52')](_0x2ec3a1['query'],_0x17584d['filters']));if(_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x3f')]){_0x4842fa[_0xfa20('0x3d')]=_['merge'](_0x4842fa[_0xfa20('0x3d')],{'$or':_[_0xfa20('0x2d')](_0x4842fa[_0xfa20('0x37')],function(_0x540821){var _0x294ad8={};_0x294ad8[_0x540821]={'$like':'%'+_0x2ec3a1['query'][_0xfa20('0x3f')]+'%'};return _0x294ad8;})});}_0x4842fa=_['merge']({},_0x4842fa,_0x2ec3a1[_0xfa20('0x42')]);return _0x36822a['getTags'](_0x4842fa);}})[_0xfa20('0x26')](function(_0x56b248){if(_0x56b248){_0x38d919=_0x56b248[_0xfa20('0x38')];if(!_0x2ec3a1['query'][_0xfa20('0x39')]('nolimit')){_0x4842fa[_0xfa20('0x20')]=qs[_0xfa20('0x20')](_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x20')]);_0x4842fa['offset']=qs['offset'](_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x1e')]);}return _0x36822a['getTags'](_0x4842fa);}})[_0xfa20('0x26')](function(_0x484b56){if(_0x484b56){return _0x484b56?{'count':_0x38d919,'rows':_0x484b56}:null;}})['then'](respondWithResult(_0x16491c,null))[_0xfa20('0x47')](handleError(_0x16491c,null));};exports[_0xfa20('0x53')]=function(_0x1baea1,_0xf7ef19,_0x218b02){if(_0x1baea1[_0xfa20('0x4b')]['id']){delete _0x1baea1[_0xfa20('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0xfa20('0x51')]({'where':{'id':_0x1baea1['params']['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0xf7ef19,null))['then'](function(_0x32b1de){if(_0x32b1de){return _0x32b1de['setTags'](_0x1baea1['body'][_0xfa20('0x54')]||[]);}return null;})[_0xfa20('0x26')](respondWithResult(_0xf7ef19,null))['catch'](handleError(_0xf7ef19,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5deacf1..282cdfa 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 _0xaddb=['exports','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x31576f,_0x51715e){var _0x309d28=function(_0x13abff){while(--_0x13abff){_0x31576f['push'](_0x31576f['shift']());}};_0x309d28(++_0x51715e);}(_0xaddb,0xff));var _0xbadd=function(_0x5c108e,_0x2ffa7f){_0x5c108e=_0x5c108e-0x0;var _0x56354a=_0xaddb[_0x5c108e];return _0x56354a;};'use strict';var _=require('lodash');var util=require(_0xbadd('0x0'));var logger=require(_0xbadd('0x1'))(_0xbadd('0x2'));var moment=require(_0xbadd('0x3'));var BPromise=require(_0xbadd('0x4'));var rp=require(_0xbadd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbadd('0x6'));var config=require(_0xbadd('0x7'));var attributes=require(_0xbadd('0x8'));module[_0xbadd('0x9')]=function(_0x42f62d,_0x1f9164){return _0x42f62d['define'](_0xbadd('0xa'),attributes,{'tableName':_0xbadd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dcd=['int_freshdesk_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x6dcd,0x1d5));var _0xd6dc=function(_0x450823,_0x154330){_0x450823=_0x450823-0x0;var _0x288a89=_0x6dcd[_0x450823];return _0x288a89;};'use strict';var _=require(_0xd6dc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd6dc('0x1'));var moment=require(_0xd6dc('0x2'));var BPromise=require(_0xd6dc('0x3'));var rp=require(_0xd6dc('0x4'));var fs=require('fs');var path=require(_0xd6dc('0x5'));var rimraf=require(_0xd6dc('0x6'));var config=require('../../config/environment');var attributes=require(_0xd6dc('0x7'));module[_0xd6dc('0x8')]=function(_0x3b6512,_0x5568fc){return _0x3b6512[_0xd6dc('0x9')](_0xd6dc('0xa'),attributes,{'tableName':_0xd6dc('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 6f9f850..10daeaa 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 _0xd7f7=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xcd74b2,_0x41bb2b){var _0x12b0f6=function(_0x4de5b9){while(--_0x4de5b9){_0xcd74b2['push'](_0xcd74b2['shift']());}};_0x12b0f6(++_0x41bb2b);}(_0xd7f7,0x175));var _0x7d7f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd7f7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7d7f('0x0'));var util=require(_0x7d7f('0x1'));var moment=require(_0x7d7f('0x2'));var BPromise=require(_0x7d7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d7f('0x4'));var db=require(_0x7d7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d7f('0x6'))(_0x7d7f('0x7'));var config=require(_0x7d7f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d7f('0x9')][_0x7d7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1725d3,_0x3150df,_0x42c422){return new BPromise(function(_0x27b6be,_0x52237e){return client[_0x7d7f('0xb')](_0x1725d3,_0x42c422)['then'](function(_0x738498){logger['info'](_0x7d7f('0xc'),_0x3150df,_0x7d7f('0xd'));logger[_0x7d7f('0xe')](_0x7d7f('0xf'),_0x3150df,_0x7d7f('0xd'),JSON[_0x7d7f('0x10')](_0x738498));if(_0x738498[_0x7d7f('0x11')]){if(_0x738498['error'][_0x7d7f('0x12')]===0x1f4){logger[_0x7d7f('0x11')](_0x7d7f('0xc'),_0x3150df,_0x738498[_0x7d7f('0x11')]['message']);return _0x52237e(_0x738498['error'][_0x7d7f('0x13')]);}logger[_0x7d7f('0x11')](_0x7d7f('0xc'),_0x3150df,_0x738498[_0x7d7f('0x11')][_0x7d7f('0x13')]);return _0x27b6be(_0x738498['error'][_0x7d7f('0x13')]);}else{logger[_0x7d7f('0x14')](_0x7d7f('0xc'),_0x3150df,_0x7d7f('0xd'));_0x27b6be(_0x738498[_0x7d7f('0x15')][_0x7d7f('0x13')]);}})[_0x7d7f('0x16')](function(_0x8d9fa2){logger['error'](_0x7d7f('0xc'),_0x3150df,_0x8d9fa2);_0x52237e(_0x8d9fa2);});});} \ No newline at end of file +var _0xa344=['error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x169bd5,_0xab64e8){var _0x356002=function(_0x36648a){while(--_0x36648a){_0x169bd5['push'](_0x169bd5['shift']());}};_0x356002(++_0xab64e8);}(_0xa344,0x1f4));var _0x4a34=function(_0x2dd1cf,_0x33bf28){_0x2dd1cf=_0x2dd1cf-0x0;var _0x46b969=_0xa344[_0x2dd1cf];return _0x46b969;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a34('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a34('0x1'));var db=require(_0x4a34('0x2'))['db'];var utils=require(_0x4a34('0x3'));var logger=require(_0x4a34('0x4'))(_0x4a34('0x5'));var config=require('../../config/environment');var jayson=require(_0x4a34('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa76b9a,_0x37d7d2,_0x38d85){return new BPromise(function(_0x513edc,_0x43c6ff){return client[_0x4a34('0x7')](_0xa76b9a,_0x38d85)['then'](function(_0x3094f6){logger[_0x4a34('0x8')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x37d7d2,_0x4a34('0x9'));logger[_0x4a34('0xa')](_0x4a34('0xb'),_0x37d7d2,_0x4a34('0x9'),JSON[_0x4a34('0xc')](_0x3094f6));if(_0x3094f6['error']){if(_0x3094f6[_0x4a34('0xd')][_0x4a34('0xe')]===0x1f4){logger[_0x4a34('0xd')](_0x4a34('0xf'),_0x37d7d2,_0x3094f6[_0x4a34('0xd')]['message']);return _0x43c6ff(_0x3094f6['error'][_0x4a34('0x10')]);}logger[_0x4a34('0xd')](_0x4a34('0xf'),_0x37d7d2,_0x3094f6['error'][_0x4a34('0x10')]);return _0x513edc(_0x3094f6[_0x4a34('0xd')][_0x4a34('0x10')]);}else{logger[_0x4a34('0x8')](_0x4a34('0xf'),_0x37d7d2,_0x4a34('0x9'));_0x513edc(_0x3094f6[_0x4a34('0x11')][_0x4a34('0x10')]);}})[_0x4a34('0x12')](function(_0xe1dc84){logger[_0x4a34('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x37d7d2,_0xe1dc84);_0x43c6ff(_0xe1dc84);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e324bdd..cbe754d 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 _0x67a0=['create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./intFreshdeskField.controller','get','isAuthenticated','/:id'];(function(_0x1f1763,_0x51a281){var _0x32c8c9=function(_0x2b6a73){while(--_0x2b6a73){_0x1f1763['push'](_0x1f1763['shift']());}};_0x32c8c9(++_0x51a281);}(_0x67a0,0x185));var _0x067a=function(_0x216d22,_0x3ddde2){_0x216d22=_0x216d22-0x0;var _0x5c76a9=_0x67a0[_0x216d22];return _0x5c76a9;};'use strict';var multer=require(_0x067a('0x0'));var util=require(_0x067a('0x1'));var path=require(_0x067a('0x2'));var timeout=require('connect-timeout');var express=require(_0x067a('0x3'));var router=express[_0x067a('0x4')]();var fs_extra=require(_0x067a('0x5'));var auth=require(_0x067a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x067a('0x7'));router[_0x067a('0x8')]('/',auth[_0x067a('0x9')](),controller['index']);router[_0x067a('0x8')](_0x067a('0xa'),auth[_0x067a('0x9')](),controller['show']);router['post']('/',auth[_0x067a('0x9')](),controller[_0x067a('0xb')]);router[_0x067a('0xc')]('/:id',auth[_0x067a('0x9')](),controller[_0x067a('0xd')]);router[_0x067a('0xe')](_0x067a('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x067a('0xf')]=router; \ No newline at end of file +var _0x9719=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3ad23d,_0x1b343f){var _0x231d9e=function(_0x46d7fe){while(--_0x46d7fe){_0x3ad23d['push'](_0x3ad23d['shift']());}};_0x231d9e(++_0x1b343f);}(_0x9719,0x12c));var _0x9971=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9719[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x9971('0x0'));var util=require(_0x9971('0x1'));var path=require(_0x9971('0x2'));var timeout=require(_0x9971('0x3'));var express=require(_0x9971('0x4'));var router=express[_0x9971('0x5')]();var fs_extra=require(_0x9971('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9971('0x7'));var config=require(_0x9971('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x9971('0x9')]('/',auth[_0x9971('0xa')](),controller[_0x9971('0xb')]);router[_0x9971('0x9')](_0x9971('0xc'),auth[_0x9971('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9971('0xd')]);router[_0x9971('0xe')](_0x9971('0xc'),auth[_0x9971('0xa')](),controller[_0x9971('0xf')]);router[_0x9971('0x10')](_0x9971('0xc'),auth[_0x9971('0xa')](),controller[_0x9971('0x11')]);module[_0x9971('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 c114857..c710692 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 _0xe839=['picklist','ENUM','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe839,0x9a));var _0x9e83=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0xe839[_0x50c492];return _0x3505a8;};'use strict';var Sequelize=require(_0x9e83('0x0'));module[_0x9e83('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9e83('0x2'),_0x9e83('0x3'),_0x9e83('0x4'),_0x9e83('0x5'),_0x9e83('0x6')),'defaultValue':_0x9e83('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9e83('0x7')](_0x9e83('0x2'),'variable',_0x9e83('0x4'))},'keyContent':{'type':Sequelize[_0x9e83('0x8')]},'idField':{'type':Sequelize[_0x9e83('0x8')]},'nameField':{'type':Sequelize[_0x9e83('0x8')]},'customField':{'type':Sequelize[_0x9e83('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e83('0x8')]}}; \ No newline at end of file +var _0x9d3f=['sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0xa45f73,_0x268db4){var _0x4ba1cd=function(_0x5fa3ce){while(--_0x5fa3ce){_0xa45f73['push'](_0xa45f73['shift']());}};_0x4ba1cd(++_0x268db4);}(_0x9d3f,0x1ea));var _0xf9d3=function(_0x1695b1,_0x46b72d){_0x1695b1=_0x1695b1-0x0;var _0x236682=_0x9d3f[_0x1695b1];return _0x236682;};'use strict';var Sequelize=require(_0xf9d3('0x0'));module[_0xf9d3('0x1')]={'type':{'type':Sequelize[_0xf9d3('0x2')]('string',_0xf9d3('0x3'),_0xf9d3('0x4'),_0xf9d3('0x5'),_0xf9d3('0x6')),'defaultValue':_0xf9d3('0x7')},'content':{'type':Sequelize[_0xf9d3('0x8')]},'key':{'type':Sequelize[_0xf9d3('0x8')]},'keyType':{'type':Sequelize[_0xf9d3('0x2')]('string',_0xf9d3('0x3'),_0xf9d3('0x4'))},'keyContent':{'type':Sequelize[_0xf9d3('0x8')]},'idField':{'type':Sequelize[_0xf9d3('0x8')]},'nameField':{'type':Sequelize[_0xf9d3('0x8')]},'customField':{'type':Sequelize[_0xf9d3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf9d3('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 9692563..3864679 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 _0x180f=['VIRTUAL','filter','options','includeAll','rows','params','include','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','merge'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x180f,0xf3));var _0xf180=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x180f[_0x186376];return _0x2dbdd9;};'use strict';var emlformat=require(_0xf180('0x0'));var rimraf=require(_0xf180('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf180('0x2'));var rp=require(_0xf180('0x3'));var moment=require('moment');var BPromise=require(_0xf180('0x4'));var Mustache=require(_0xf180('0x5'));var util=require(_0xf180('0x6'));var path=require(_0xf180('0x7'));var sox=require(_0xf180('0x8'));var csv=require('to-csv');var ejs=require(_0xf180('0x9'));var fs=require('fs');var fs_extra=require(_0xf180('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf180('0xb'));var jsforce=require(_0xf180('0xc'));var deskjs=require(_0xf180('0xd'));var toCsv=require(_0xf180('0xe'));var querystring=require(_0xf180('0xf'));var Papa=require(_0xf180('0x10'));var Redis=require(_0xf180('0x11'));var authService=require(_0xf180('0x12'));var qs=require(_0xf180('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf180('0x14'));var logger=require(_0xf180('0x15'))(_0xf180('0x16'));var utils=require(_0xf180('0x17'));var config=require(_0xf180('0x18'));var licenseUtil=require(_0xf180('0x19'));var db=require(_0xf180('0x1a'))['db'];function respondWithStatusCode(_0x2122a0,_0x171513){_0x171513=_0x171513||0xcc;return function(_0x22a1f8){if(_0x22a1f8){return _0x2122a0[_0xf180('0x1b')](_0x171513);}return _0x2122a0['status'](_0x171513)[_0xf180('0x1c')]();};}function respondWithResult(_0x22d179,_0x1eb0a2){_0x1eb0a2=_0x1eb0a2||0xc8;return function(_0x355b07){if(_0x355b07){return _0x22d179['status'](_0x1eb0a2)[_0xf180('0x1d')](_0x355b07);}};}function respondWithFilteredResult(_0x3d3f48,_0x1dbdcf){return function(_0x4ee79b){if(_0x4ee79b){var _0x105c6a=typeof _0x1dbdcf[_0xf180('0x1e')]==='undefined'&&typeof _0x1dbdcf[_0xf180('0x1f')]===_0xf180('0x20');var _0x492c22=_0x4ee79b[_0xf180('0x21')];var _0x14ddc6=_0x105c6a?0x0:_0x1dbdcf[_0xf180('0x1e')];var _0xf7ab26=_0x105c6a?_0x4ee79b[_0xf180('0x21')]:_0x1dbdcf[_0xf180('0x1e')]+_0x1dbdcf[_0xf180('0x1f')];var _0x43f1f4;if(_0xf7ab26>=_0x492c22){_0xf7ab26=_0x492c22;_0x43f1f4=0xc8;}else{_0x43f1f4=0xce;}_0x3d3f48[_0xf180('0x22')](_0x43f1f4);return _0x3d3f48[_0xf180('0x23')](_0xf180('0x24'),_0x14ddc6+'-'+_0xf7ab26+'/'+_0x492c22)[_0xf180('0x1d')](_0x4ee79b);}return null;};}function patchUpdates(_0x180c0a){return function(_0x5c8e98){try{jsonpatch[_0xf180('0x25')](_0x5c8e98,_0x180c0a,!![]);}catch(_0x185cc6){return BPromise['reject'](_0x185cc6);}return _0x5c8e98[_0xf180('0x26')]();};}function saveUpdates(_0x538bac,_0x36aeee){return function(_0x4c54b6){if(_0x4c54b6){return _0x4c54b6[_0xf180('0x27')](_0x538bac)[_0xf180('0x28')](function(_0x5d5ead){return _0x5d5ead;});}return null;};}function removeEntity(_0x48925e,_0x1b28d6){return function(_0x932e29){if(_0x932e29){return _0x932e29['destroy']()[_0xf180('0x28')](function(){_0x48925e[_0xf180('0x22')](0xcc)[_0xf180('0x1c')]();});}};}function handleEntityNotFound(_0x1242d3,_0x12aaad){return function(_0x2ca8f9){if(!_0x2ca8f9){_0x1242d3[_0xf180('0x1b')](0x194);}return _0x2ca8f9;};}function handleError(_0x806b84,_0x3d20bc){_0x3d20bc=_0x3d20bc||0x1f4;return function(_0x34d380){logger['error'](_0x34d380[_0xf180('0x29')]);if(_0x34d380[_0xf180('0x2a')]){delete _0x34d380[_0xf180('0x2a')];}_0x806b84[_0xf180('0x22')](_0x3d20bc)[_0xf180('0x2b')](_0x34d380);};}exports[_0xf180('0x2c')]=function(_0xe1db31,_0x2c875f){var _0x2ac6d2={},_0x3bb197={},_0x564ce1={'count':0x0,'rows':[]};var _0x323482=_[_0xf180('0x2d')](db[_0xf180('0x2e')][_0xf180('0x2f')],function(_0x466895){return{'name':_0x466895[_0xf180('0x30')],'type':_0x466895[_0xf180('0x31')][_0xf180('0x32')]};});_0x3bb197[_0xf180('0x33')]=_[_0xf180('0x2d')](_0x323482,_0xf180('0x2a'));_0x3bb197[_0xf180('0x34')]=_[_0xf180('0x35')](_0xe1db31[_0xf180('0x34')]);_0x3bb197['filters']=_[_0xf180('0x36')](_0x3bb197[_0xf180('0x33')],_0x3bb197['query']);_0x2ac6d2[_0xf180('0x37')]=_['intersection'](_0x3bb197[_0xf180('0x33')],qs[_0xf180('0x38')](_0xe1db31[_0xf180('0x34')]['fields']));_0x2ac6d2[_0xf180('0x37')]=_0x2ac6d2[_0xf180('0x37')][_0xf180('0x39')]?_0x2ac6d2[_0xf180('0x37')]:_0x3bb197['model'];if(!_0xe1db31[_0xf180('0x34')][_0xf180('0x3a')](_0xf180('0x3b'))){_0x2ac6d2[_0xf180('0x1f')]=qs[_0xf180('0x1f')](_0xe1db31[_0xf180('0x34')][_0xf180('0x1f')]);_0x2ac6d2[_0xf180('0x1e')]=qs[_0xf180('0x1e')](_0xe1db31[_0xf180('0x34')]['offset']);}_0x2ac6d2[_0xf180('0x3c')]=qs['sort'](_0xe1db31['query'][_0xf180('0x3d')]);_0x2ac6d2['where']=qs['filters'](_[_0xf180('0x3e')](_0xe1db31[_0xf180('0x34')],_0x3bb197[_0xf180('0x3f')]),_0x323482);if(_0xe1db31[_0xf180('0x34')]['filter']){_0x2ac6d2['where']=_[_0xf180('0x40')](_0x2ac6d2['where'],{'$or':_[_0xf180('0x2d')](_0x323482,function(_0x5bc4be){if(_0x5bc4be[_0xf180('0x31')]!==_0xf180('0x41')){var _0x13de1b={};_0x13de1b[_0x5bc4be[_0xf180('0x2a')]]={'$like':'%'+_0xe1db31[_0xf180('0x34')][_0xf180('0x42')]+'%'};return _0x13de1b;}})});}_0x2ac6d2=_[_0xf180('0x40')]({},_0x2ac6d2,_0xe1db31[_0xf180('0x43')]);var _0x40d5f9={'where':_0x2ac6d2['where']};return db[_0xf180('0x2e')][_0xf180('0x21')](_0x40d5f9)['then'](function(_0x2cd770){_0x564ce1[_0xf180('0x21')]=_0x2cd770;if(_0xe1db31[_0xf180('0x34')][_0xf180('0x44')]){_0x2ac6d2['include']=[{'all':!![]}];}return db[_0xf180('0x2e')]['findAll'](_0x2ac6d2);})[_0xf180('0x28')](function(_0xaa961){_0x564ce1[_0xf180('0x45')]=_0xaa961;return _0x564ce1;})[_0xf180('0x28')](respondWithFilteredResult(_0x2c875f,_0x2ac6d2))['catch'](handleError(_0x2c875f,null));};exports['show']=function(_0x2e85dd,_0x19f297){var _0xafbff7={'raw':!![],'where':{'id':_0x2e85dd[_0xf180('0x46')]['id']}},_0x3083ba={};_0x3083ba[_0xf180('0x33')]=_[_0xf180('0x35')](db[_0xf180('0x2e')][_0xf180('0x2f')]);_0x3083ba[_0xf180('0x34')]=_['keys'](_0x2e85dd[_0xf180('0x34')]);_0x3083ba['filters']=_[_0xf180('0x36')](_0x3083ba[_0xf180('0x33')],_0x3083ba[_0xf180('0x34')]);_0xafbff7['attributes']=_[_0xf180('0x36')](_0x3083ba[_0xf180('0x33')],qs['fields'](_0x2e85dd[_0xf180('0x34')][_0xf180('0x38')]));_0xafbff7[_0xf180('0x37')]=_0xafbff7[_0xf180('0x37')][_0xf180('0x39')]?_0xafbff7[_0xf180('0x37')]:_0x3083ba[_0xf180('0x33')];if(_0x2e85dd[_0xf180('0x34')][_0xf180('0x44')]){_0xafbff7[_0xf180('0x47')]=[{'all':!![]}];}_0xafbff7=_[_0xf180('0x40')]({},_0xafbff7,_0x2e85dd[_0xf180('0x43')]);return db[_0xf180('0x2e')][_0xf180('0x48')](_0xafbff7)[_0xf180('0x28')](handleEntityNotFound(_0x19f297,null))[_0xf180('0x28')](respondWithResult(_0x19f297,null))[_0xf180('0x49')](handleError(_0x19f297,null));};exports[_0xf180('0x4a')]=function(_0x41b90e,_0x43c26c){return db['FreshdeskField']['create'](_0x41b90e[_0xf180('0x4b')],{})[_0xf180('0x28')](respondWithResult(_0x43c26c,0xc9))[_0xf180('0x49')](handleError(_0x43c26c,null));};exports[_0xf180('0x27')]=function(_0x1915b4,_0x30e469){if(_0x1915b4[_0xf180('0x4b')]['id']){delete _0x1915b4[_0xf180('0x4b')]['id'];}return db[_0xf180('0x2e')][_0xf180('0x48')]({'where':{'id':_0x1915b4[_0xf180('0x46')]['id']}})[_0xf180('0x28')](handleEntityNotFound(_0x30e469,null))[_0xf180('0x28')](saveUpdates(_0x1915b4[_0xf180('0x4b')],null))[_0xf180('0x28')](respondWithResult(_0x30e469,null))['catch'](handleError(_0x30e469,null));};exports[_0xf180('0x4c')]=function(_0x12fabe,_0x4b0dcd){return db[_0xf180('0x2e')][_0xf180('0x48')]({'where':{'id':_0x12fabe[_0xf180('0x46')]['id']}})[_0xf180('0x28')](handleEntityNotFound(_0x4b0dcd,null))[_0xf180('0x28')](removeEntity(_0x4b0dcd,null))[_0xf180('0x49')](handleError(_0x4b0dcd,null));}; \ No newline at end of file +var _0xc29b=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','FreshdeskField','fieldName','type','key','model','query','keys','filters','attributes','fields','length','offset','sort','where','pick','VIRTUAL','filter','options','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','include','create','body','find','eml-format','rimraf','zip-dir'];(function(_0x5caee5,_0x3454b0){var _0x41fe57=function(_0x2c8d9b){while(--_0x2c8d9b){_0x5caee5['push'](_0x5caee5['shift']());}};_0x41fe57(++_0x3454b0);}(_0xc29b,0x12d));var _0xbc29=function(_0x3940bb,_0x3f56b2){_0x3940bb=_0x3940bb-0x0;var _0x8ca868=_0xc29b[_0x3940bb];return _0x8ca868;};'use strict';var emlformat=require(_0xbc29('0x0'));var rimraf=require(_0xbc29('0x1'));var zipdir=require(_0xbc29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc29('0x3'));var moment=require(_0xbc29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc29('0x5'));var util=require(_0xbc29('0x6'));var path=require(_0xbc29('0x7'));var sox=require(_0xbc29('0x8'));var csv=require(_0xbc29('0x9'));var ejs=require(_0xbc29('0xa'));var fs=require('fs');var fs_extra=require(_0xbc29('0xb'));var _=require(_0xbc29('0xc'));var squel=require(_0xbc29('0xd'));var crypto=require(_0xbc29('0xe'));var jsforce=require(_0xbc29('0xf'));var deskjs=require(_0xbc29('0x10'));var toCsv=require(_0xbc29('0x9'));var querystring=require(_0xbc29('0x11'));var Papa=require(_0xbc29('0x12'));var Redis=require(_0xbc29('0x13'));var authService=require(_0xbc29('0x14'));var qs=require(_0xbc29('0x15'));var as=require(_0xbc29('0x16'));var hardwareService=require(_0xbc29('0x17'));var logger=require('../../config/logger')(_0xbc29('0x18'));var utils=require(_0xbc29('0x19'));var config=require(_0xbc29('0x1a'));var licenseUtil=require(_0xbc29('0x1b'));var db=require(_0xbc29('0x1c'))['db'];function respondWithStatusCode(_0x2794c6,_0x352c9e){_0x352c9e=_0x352c9e||0xcc;return function(_0x5e581f){if(_0x5e581f){return _0x2794c6[_0xbc29('0x1d')](_0x352c9e);}return _0x2794c6[_0xbc29('0x1e')](_0x352c9e)[_0xbc29('0x1f')]();};}function respondWithResult(_0x515ea8,_0x483fbe){_0x483fbe=_0x483fbe||0xc8;return function(_0x1892fc){if(_0x1892fc){return _0x515ea8['status'](_0x483fbe)[_0xbc29('0x20')](_0x1892fc);}};}function respondWithFilteredResult(_0x3f0264,_0x46eb03){return function(_0x490030){if(_0x490030){var _0x3b31b1=typeof _0x46eb03['offset']===_0xbc29('0x21')&&typeof _0x46eb03[_0xbc29('0x22')]===_0xbc29('0x21');var _0x1e7f15=_0x490030[_0xbc29('0x23')];var _0x42b0be=_0x3b31b1?0x0:_0x46eb03['offset'];var _0x9e84e3=_0x3b31b1?_0x490030[_0xbc29('0x23')]:_0x46eb03['offset']+_0x46eb03['limit'];var _0x30c251;if(_0x9e84e3>=_0x1e7f15){_0x9e84e3=_0x1e7f15;_0x30c251=0xc8;}else{_0x30c251=0xce;}_0x3f0264['status'](_0x30c251);return _0x3f0264['set'](_0xbc29('0x24'),_0x42b0be+'-'+_0x9e84e3+'/'+_0x1e7f15)[_0xbc29('0x20')](_0x490030);}return null;};}function patchUpdates(_0x1912ea){return function(_0x371adc){try{jsonpatch[_0xbc29('0x25')](_0x371adc,_0x1912ea,!![]);}catch(_0x3b6304){return BPromise[_0xbc29('0x26')](_0x3b6304);}return _0x371adc[_0xbc29('0x27')]();};}function saveUpdates(_0x5cdc9e,_0x115592){return function(_0x35920d){if(_0x35920d){return _0x35920d[_0xbc29('0x28')](_0x5cdc9e)[_0xbc29('0x29')](function(_0x1ae3f2){return _0x1ae3f2;});}return null;};}function removeEntity(_0x5c6f6d,_0x24523f){return function(_0x3ca9dc){if(_0x3ca9dc){return _0x3ca9dc[_0xbc29('0x2a')]()[_0xbc29('0x29')](function(){_0x5c6f6d['status'](0xcc)[_0xbc29('0x1f')]();});}};}function handleEntityNotFound(_0x3ad136,_0x536bd2){return function(_0xd3d9a5){if(!_0xd3d9a5){_0x3ad136[_0xbc29('0x1d')](0x194);}return _0xd3d9a5;};}function handleError(_0x511fa7,_0x4983b5){_0x4983b5=_0x4983b5||0x1f4;return function(_0x2c7b63){logger['error'](_0x2c7b63['stack']);if(_0x2c7b63[_0xbc29('0x2b')]){delete _0x2c7b63[_0xbc29('0x2b')];}_0x511fa7[_0xbc29('0x1e')](_0x4983b5)['send'](_0x2c7b63);};}exports[_0xbc29('0x2c')]=function(_0x3febdf,_0x1e11b3){var _0x2f23c2={},_0x1797c9={},_0x549cb5={'count':0x0,'rows':[]};var _0x55971f=_[_0xbc29('0x2d')](db[_0xbc29('0x2e')]['rawAttributes'],function(_0x2d89e1){return{'name':_0x2d89e1[_0xbc29('0x2f')],'type':_0x2d89e1[_0xbc29('0x30')][_0xbc29('0x31')]};});_0x1797c9[_0xbc29('0x32')]=_[_0xbc29('0x2d')](_0x55971f,'name');_0x1797c9[_0xbc29('0x33')]=_[_0xbc29('0x34')](_0x3febdf[_0xbc29('0x33')]);_0x1797c9[_0xbc29('0x35')]=_['intersection'](_0x1797c9[_0xbc29('0x32')],_0x1797c9[_0xbc29('0x33')]);_0x2f23c2[_0xbc29('0x36')]=_['intersection'](_0x1797c9['model'],qs[_0xbc29('0x37')](_0x3febdf[_0xbc29('0x33')][_0xbc29('0x37')]));_0x2f23c2['attributes']=_0x2f23c2[_0xbc29('0x36')][_0xbc29('0x38')]?_0x2f23c2[_0xbc29('0x36')]:_0x1797c9[_0xbc29('0x32')];if(!_0x3febdf['query']['hasOwnProperty']('nolimit')){_0x2f23c2[_0xbc29('0x22')]=qs[_0xbc29('0x22')](_0x3febdf[_0xbc29('0x33')]['limit']);_0x2f23c2['offset']=qs[_0xbc29('0x39')](_0x3febdf[_0xbc29('0x33')]['offset']);}_0x2f23c2['order']=qs[_0xbc29('0x3a')](_0x3febdf[_0xbc29('0x33')][_0xbc29('0x3a')]);_0x2f23c2[_0xbc29('0x3b')]=qs[_0xbc29('0x35')](_[_0xbc29('0x3c')](_0x3febdf['query'],_0x1797c9['filters']),_0x55971f);if(_0x3febdf[_0xbc29('0x33')]['filter']){_0x2f23c2[_0xbc29('0x3b')]=_['merge'](_0x2f23c2[_0xbc29('0x3b')],{'$or':_[_0xbc29('0x2d')](_0x55971f,function(_0x37afc4){if(_0x37afc4[_0xbc29('0x30')]!==_0xbc29('0x3d')){var _0x1d2e98={};_0x1d2e98[_0x37afc4[_0xbc29('0x2b')]]={'$like':'%'+_0x3febdf[_0xbc29('0x33')][_0xbc29('0x3e')]+'%'};return _0x1d2e98;}})});}_0x2f23c2=_['merge']({},_0x2f23c2,_0x3febdf[_0xbc29('0x3f')]);var _0x202804={'where':_0x2f23c2[_0xbc29('0x3b')]};return db[_0xbc29('0x2e')][_0xbc29('0x23')](_0x202804)['then'](function(_0x1e91bd){_0x549cb5[_0xbc29('0x23')]=_0x1e91bd;if(_0x3febdf[_0xbc29('0x33')]['includeAll']){_0x2f23c2['include']=[{'all':!![]}];}return db[_0xbc29('0x2e')][_0xbc29('0x40')](_0x2f23c2);})[_0xbc29('0x29')](function(_0xf8bd18){_0x549cb5[_0xbc29('0x41')]=_0xf8bd18;return _0x549cb5;})[_0xbc29('0x29')](respondWithFilteredResult(_0x1e11b3,_0x2f23c2))[_0xbc29('0x42')](handleError(_0x1e11b3,null));};exports[_0xbc29('0x43')]=function(_0x38f119,_0x3522f1){var _0x86bad5={'raw':!![],'where':{'id':_0x38f119[_0xbc29('0x44')]['id']}},_0x33508d={};_0x33508d['model']=_[_0xbc29('0x34')](db['FreshdeskField'][_0xbc29('0x45')]);_0x33508d[_0xbc29('0x33')]=_[_0xbc29('0x34')](_0x38f119[_0xbc29('0x33')]);_0x33508d['filters']=_[_0xbc29('0x46')](_0x33508d[_0xbc29('0x32')],_0x33508d[_0xbc29('0x33')]);_0x86bad5[_0xbc29('0x36')]=_[_0xbc29('0x46')](_0x33508d['model'],qs[_0xbc29('0x37')](_0x38f119[_0xbc29('0x33')][_0xbc29('0x37')]));_0x86bad5[_0xbc29('0x36')]=_0x86bad5[_0xbc29('0x36')]['length']?_0x86bad5['attributes']:_0x33508d[_0xbc29('0x32')];if(_0x38f119[_0xbc29('0x33')][_0xbc29('0x47')]){_0x86bad5[_0xbc29('0x48')]=[{'all':!![]}];}_0x86bad5=_['merge']({},_0x86bad5,_0x38f119[_0xbc29('0x3f')]);return db[_0xbc29('0x2e')]['find'](_0x86bad5)[_0xbc29('0x29')](handleEntityNotFound(_0x3522f1,null))['then'](respondWithResult(_0x3522f1,null))[_0xbc29('0x42')](handleError(_0x3522f1,null));};exports['create']=function(_0x54a625,_0x2866b2){return db[_0xbc29('0x2e')][_0xbc29('0x49')](_0x54a625[_0xbc29('0x4a')],{})['then'](respondWithResult(_0x2866b2,0xc9))[_0xbc29('0x42')](handleError(_0x2866b2,null));};exports['update']=function(_0x55c0cc,_0x2ff594){if(_0x55c0cc[_0xbc29('0x4a')]['id']){delete _0x55c0cc[_0xbc29('0x4a')]['id'];}return db[_0xbc29('0x2e')][_0xbc29('0x4b')]({'where':{'id':_0x55c0cc[_0xbc29('0x44')]['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x2ff594,null))[_0xbc29('0x29')](saveUpdates(_0x55c0cc['body'],null))[_0xbc29('0x29')](respondWithResult(_0x2ff594,null))[_0xbc29('0x42')](handleError(_0x2ff594,null));};exports[_0xbc29('0x2a')]=function(_0x599ba7,_0x3f4323){return db[_0xbc29('0x2e')]['find']({'where':{'id':_0x599ba7[_0xbc29('0x44')]['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x3f4323,null))[_0xbc29('0x29')](removeEntity(_0x3f4323,null))[_0xbc29('0x42')](handleError(_0x3f4323,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f8f0afb..48d111e 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 _0xf894=['moment','bluebird','rimraf','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x47246d,_0x2dce1e){var _0x21f055=function(_0x566866){while(--_0x566866){_0x47246d['push'](_0x47246d['shift']());}};_0x21f055(++_0x2dce1e);}(_0xf894,0x98));var _0x4f89=function(_0x2516d3,_0x1e1290){_0x2516d3=_0x2516d3-0x0;var _0x276edc=_0xf894[_0x2516d3];return _0x276edc;};'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('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4f89('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x4f89('0x7')]=function(_0x130aae,_0x5e4042){return _0x130aae[_0x4f89('0x8')]('FreshdeskField',attributes,{'tableName':_0x4f89('0x9'),'paranoid':![],'indexes':[{'name':_0x4f89('0xa'),'fields':[_0x4f89('0xb'),_0x4f89('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd25=['bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','api','moment'];(function(_0x5040b0,_0x53c900){var _0x32d66e=function(_0x10451b){while(--_0x10451b){_0x5040b0['push'](_0x5040b0['shift']());}};_0x32d66e(++_0x53c900);}(_0xfd25,0x169));var _0x5fd2=function(_0x393996,_0x4ec58a){_0x393996=_0x393996-0x0;var _0x5c59f3=_0xfd25[_0x393996];return _0x5c59f3;};'use strict';var _=require(_0x5fd2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5fd2('0x1'));var moment=require(_0x5fd2('0x2'));var BPromise=require(_0x5fd2('0x3'));var rp=require(_0x5fd2('0x4'));var fs=require('fs');var path=require(_0x5fd2('0x5'));var rimraf=require(_0x5fd2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fd2('0x7'));module[_0x5fd2('0x8')]=function(_0x31ddb3,_0xbee3e){return _0x31ddb3[_0x5fd2('0x9')]('FreshdeskField',attributes,{'tableName':_0x5fd2('0xa'),'paranoid':![],'indexes':[{'name':_0x5fd2('0xb'),'fields':['idField',_0x5fd2('0xc')],'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 c703b07..d213c9c 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 _0x365c=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x365c,0x1d5));var _0xc365=function(_0x1c025d,_0x94d7cb){_0x1c025d=_0x1c025d-0x0;var _0x138538=_0x365c[_0x1c025d];return _0x138538;};'use strict';var _=require(_0xc365('0x0'));var util=require('util');var moment=require(_0xc365('0x1'));var BPromise=require(_0xc365('0x2'));var rs=require(_0xc365('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc365('0x4'))['db'];var utils=require(_0xc365('0x5'));var logger=require(_0xc365('0x6'))(_0xc365('0x7'));var config=require(_0xc365('0x8'));var jayson=require(_0xc365('0x9'));var client=jayson[_0xc365('0xa')][_0xc365('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x91976b,_0x44427e,_0x684752){return new BPromise(function(_0x2b22cf,_0x303ebb){return client['request'](_0x91976b,_0x684752)[_0xc365('0xc')](function(_0x4ae332){logger[_0xc365('0xd')](_0xc365('0xe'),_0x44427e,_0xc365('0xf'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x44427e,_0xc365('0xf'),JSON[_0xc365('0x10')](_0x4ae332));if(_0x4ae332[_0xc365('0x11')]){if(_0x4ae332[_0xc365('0x11')][_0xc365('0x12')]===0x1f4){logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x4ae332['error']['message']);return _0x303ebb(_0x4ae332[_0xc365('0x11')]['message']);}logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x4ae332['error']['message']);return _0x2b22cf(_0x4ae332[_0xc365('0x11')][_0xc365('0x13')]);}else{logger[_0xc365('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x44427e,_0xc365('0xf'));_0x2b22cf(_0x4ae332[_0xc365('0x14')]['message']);}})[_0xc365('0x15')](function(_0x11412d){logger[_0xc365('0x11')](_0xc365('0xe'),_0x44427e,_0x11412d);_0x303ebb(_0x11412d);});});} \ No newline at end of file +var _0x229d=['FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x229d,0xb8));var _0xd229=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x229d[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xd229('0x0'));var util=require(_0xd229('0x1'));var moment=require(_0xd229('0x2'));var BPromise=require(_0xd229('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd229('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd229('0x5'));var logger=require('../../config/logger')(_0xd229('0x6'));var config=require(_0xd229('0x7'));var jayson=require(_0xd229('0x8'));var client=jayson[_0xd229('0x9')][_0xd229('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f1656,_0x51259a,_0x154f62){return new BPromise(function(_0x270464,_0x56a3ef){return client['request'](_0x3f1656,_0x154f62)[_0xd229('0xb')](function(_0x1a1f47){logger[_0xd229('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x51259a,'request\x20sent');logger[_0xd229('0xd')](_0xd229('0xe'),_0x51259a,_0xd229('0xf'),JSON[_0xd229('0x10')](_0x1a1f47));if(_0x1a1f47['error']){if(_0x1a1f47[_0xd229('0x11')][_0xd229('0x12')]===0x1f4){logger[_0xd229('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x51259a,_0x1a1f47['error']['message']);return _0x56a3ef(_0x1a1f47['error'][_0xd229('0x13')]);}logger[_0xd229('0x11')](_0xd229('0x14'),_0x51259a,_0x1a1f47[_0xd229('0x11')]['message']);return _0x270464(_0x1a1f47[_0xd229('0x11')]['message']);}else{logger['info'](_0xd229('0x14'),_0x51259a,_0xd229('0xf'));_0x270464(_0x1a1f47[_0xd229('0x15')][_0xd229('0x13')]);}})['catch'](function(_0x53157c){logger['error'](_0xd229('0x14'),_0x51259a,_0x53157c);_0x56a3ef(_0x53157c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 47e05d5..13240b2 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 _0xa478=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','getConfigurations','getFields','post','/:id/configurations','update'];(function(_0x312c32,_0x3f296a){var _0x27f712=function(_0x29fd51){while(--_0x29fd51){_0x312c32['push'](_0x312c32['shift']());}};_0x27f712(++_0x3f296a);}(_0xa478,0x136));var _0x8a47=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0xa478[_0x138836];return _0x322688;};'use strict';var multer=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var path=require(_0x8a47('0x2'));var timeout=require(_0x8a47('0x3'));var express=require(_0x8a47('0x4'));var router=express[_0x8a47('0x5')]();var fs_extra=require(_0x8a47('0x6'));var auth=require(_0x8a47('0x7'));var interaction=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var controller=require(_0x8a47('0xa'));router[_0x8a47('0xb')]('/',auth['isAuthenticated'](),controller[_0x8a47('0xc')]);router[_0x8a47('0xb')](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller['show']);router[_0x8a47('0xb')]('/:id/configurations',auth[_0x8a47('0xe')](),controller[_0x8a47('0xf')]);router[_0x8a47('0xb')]('/:id/fields',auth[_0x8a47('0xe')](),controller[_0x8a47('0x10')]);router['post']('/',auth[_0x8a47('0xe')](),controller['create']);router[_0x8a47('0x11')](_0x8a47('0x12'),auth[_0x8a47('0xe')](),controller['addConfiguration']);router['put']('/:id',auth[_0x8a47('0xe')](),controller[_0x8a47('0x13')]);router['delete'](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller[_0x8a47('0x14')]);module[_0x8a47('0x15')]=router; \ No newline at end of file +var _0x7334=['put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x4c89cd,_0x2c57e2){var _0x1090d2=function(_0x1e9dda){while(--_0x1e9dda){_0x4c89cd['push'](_0x4c89cd['shift']());}};_0x1090d2(++_0x2c57e2);}(_0x7334,0x184));var _0x4733=function(_0x172c6d,_0x313d4c){_0x172c6d=_0x172c6d-0x0;var _0x2d63c0=_0x7334[_0x172c6d];return _0x2d63c0;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0x8')](_0x4733('0xf'),auth['isAuthenticated'](),controller[_0x4733('0x10')]);router[_0x4733('0x11')]('/',auth['isAuthenticated'](),controller[_0x4733('0x12')]);router['post'](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0x13')]);router[_0x4733('0x14')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x15')]);router['delete'](_0x4733('0xb'),auth['isAuthenticated'](),controller[_0x4733('0x16')]);module[_0x4733('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 9d4bf8e..8a0628b 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 _0x1893=['STRING','username','remoteUri'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x1893,0xa2));var _0x3189=function(_0x465b0c,_0x569d90){_0x465b0c=_0x465b0c-0x0;var _0x502ff0=_0x1893[_0x465b0c];return _0x502ff0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3189('0x0')]},'description':{'type':Sequelize[_0x3189('0x0')]},'username':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x1')},'apiKey':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5b12=['STRING','sequelize','exports'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x5b12,0xa3));var _0x25b1=function(_0x5cd362,_0x450511){_0x5cd362=_0x5cd362-0x0;var _0x539114=_0x5b12[_0x5cd362];return _0x539114;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x25b1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x25b1('0x2')]},'remoteUri':{'type':Sequelize[_0x25b1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x25b1('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index c1d0b3c..aad2fd7 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 _0x8966=['save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','rows','catch','show','params','include','find','body','update','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','create','FreshsalesField','getFields','username','remoteUri','slice','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x8966,0x173));var _0x6896=function(_0x49d158,_0x3fe8d7){_0x49d158=_0x49d158-0x0;var _0x541fb7=_0x8966[_0x49d158];return _0x541fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6896('0x0'));var jsonpatch=require(_0x6896('0x1'));var rp=require('request-promise');var moment=require(_0x6896('0x2'));var BPromise=require(_0x6896('0x3'));var Mustache=require(_0x6896('0x4'));var util=require(_0x6896('0x5'));var path=require(_0x6896('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6896('0x7'));var fs=require('fs');var fs_extra=require(_0x6896('0x8'));var _=require(_0x6896('0x9'));var squel=require('squel');var crypto=require(_0x6896('0xa'));var jsforce=require(_0x6896('0xb'));var deskjs=require(_0x6896('0xc'));var toCsv=require(_0x6896('0xd'));var querystring=require('querystring');var Papa=require(_0x6896('0xe'));var Redis=require(_0x6896('0xf'));var authService=require(_0x6896('0x10'));var qs=require(_0x6896('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6896('0x12'));var logger=require(_0x6896('0x13'))(_0x6896('0x14'));var utils=require('../../config/utils');var config=require(_0x6896('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x6896('0x16'));function respondWithStatusCode(_0x1a11fe,_0x56b12c){_0x56b12c=_0x56b12c||0xcc;return function(_0x4f0146){if(_0x4f0146){return _0x1a11fe[_0x6896('0x17')](_0x56b12c);}return _0x1a11fe[_0x6896('0x18')](_0x56b12c)['end']();};}function respondWithResult(_0x21eda0,_0x52f2c0){_0x52f2c0=_0x52f2c0||0xc8;return function(_0x52b68b){if(_0x52b68b){return _0x21eda0[_0x6896('0x18')](_0x52f2c0)[_0x6896('0x19')](_0x52b68b);}};}function respondWithFilteredResult(_0x5855c0,_0x4719ee){return function(_0x52d98b){if(_0x52d98b){var _0x43b289=typeof _0x4719ee[_0x6896('0x1a')]===_0x6896('0x1b')&&typeof _0x4719ee[_0x6896('0x1c')]===_0x6896('0x1b');var _0x2c9c0b=_0x52d98b[_0x6896('0x1d')];var _0x4f7533=_0x43b289?0x0:_0x4719ee[_0x6896('0x1a')];var _0x586940=_0x43b289?_0x52d98b[_0x6896('0x1d')]:_0x4719ee[_0x6896('0x1a')]+_0x4719ee[_0x6896('0x1c')];var _0x258260;if(_0x586940>=_0x2c9c0b){_0x586940=_0x2c9c0b;_0x258260=0xc8;}else{_0x258260=0xce;}_0x5855c0['status'](_0x258260);return _0x5855c0[_0x6896('0x1e')](_0x6896('0x1f'),_0x4f7533+'-'+_0x586940+'/'+_0x2c9c0b)[_0x6896('0x19')](_0x52d98b);}return null;};}function patchUpdates(_0x539aa6){return function(_0x31d3be){try{jsonpatch[_0x6896('0x20')](_0x31d3be,_0x539aa6,!![]);}catch(_0x125c52){return BPromise['reject'](_0x125c52);}return _0x31d3be[_0x6896('0x21')]();};}function saveUpdates(_0x6a62c7,_0xe805fd){return function(_0x1b2e17){if(_0x1b2e17){return _0x1b2e17['update'](_0x6a62c7)[_0x6896('0x22')](function(_0x274a2c){return _0x274a2c;});}return null;};}function removeEntity(_0x44bccd,_0x4751fe){return function(_0x5e65d2){if(_0x5e65d2){return _0x5e65d2[_0x6896('0x23')]()[_0x6896('0x22')](function(){_0x44bccd[_0x6896('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca7ca,_0x1400a3){return function(_0x38ddec){if(!_0x38ddec){_0x2ca7ca[_0x6896('0x17')](0x194);}return _0x38ddec;};}function handleError(_0x112d57,_0x2df4c3){_0x2df4c3=_0x2df4c3||0x1f4;return function(_0x1d3bcb){logger[_0x6896('0x24')](_0x1d3bcb[_0x6896('0x25')]);if(_0x1d3bcb['name']){delete _0x1d3bcb[_0x6896('0x26')];}_0x112d57[_0x6896('0x18')](_0x2df4c3)[_0x6896('0x27')](_0x1d3bcb);};}exports['index']=function(_0x17b410,_0x418620){var _0x30845a={},_0x1db010={},_0x114f08={'count':0x0,'rows':[]};var _0x773955=_[_0x6896('0x28')](db['FreshsalesAccount'][_0x6896('0x29')],function(_0x4b3ad2){return{'name':_0x4b3ad2[_0x6896('0x2a')],'type':_0x4b3ad2[_0x6896('0x2b')]['key']};});_0x1db010[_0x6896('0x2c')]=_[_0x6896('0x28')](_0x773955,'name');_0x1db010[_0x6896('0x2d')]=_[_0x6896('0x2e')](_0x17b410[_0x6896('0x2d')]);_0x1db010[_0x6896('0x2f')]=_['intersection'](_0x1db010[_0x6896('0x2c')],_0x1db010[_0x6896('0x2d')]);_0x30845a['attributes']=_[_0x6896('0x30')](_0x1db010[_0x6896('0x2c')],qs[_0x6896('0x31')](_0x17b410[_0x6896('0x2d')]['fields']));_0x30845a['attributes']=_0x30845a[_0x6896('0x32')][_0x6896('0x33')]?_0x30845a[_0x6896('0x32')]:_0x1db010['model'];if(!_0x17b410[_0x6896('0x2d')][_0x6896('0x34')]('nolimit')){_0x30845a[_0x6896('0x1c')]=qs[_0x6896('0x1c')](_0x17b410[_0x6896('0x2d')][_0x6896('0x1c')]);_0x30845a[_0x6896('0x1a')]=qs[_0x6896('0x1a')](_0x17b410[_0x6896('0x2d')]['offset']);}_0x30845a[_0x6896('0x35')]=qs[_0x6896('0x36')](_0x17b410['query'][_0x6896('0x36')]);_0x30845a[_0x6896('0x37')]=qs[_0x6896('0x2f')](_[_0x6896('0x38')](_0x17b410['query'],_0x1db010[_0x6896('0x2f')]),_0x773955);if(_0x17b410[_0x6896('0x2d')][_0x6896('0x39')]){_0x30845a['where']=_[_0x6896('0x3a')](_0x30845a['where'],{'$or':_[_0x6896('0x28')](_0x773955,function(_0x140834){if(_0x140834[_0x6896('0x2b')]!==_0x6896('0x3b')){var _0x4be59f={};_0x4be59f[_0x140834[_0x6896('0x26')]]={'$like':'%'+_0x17b410[_0x6896('0x2d')]['filter']+'%'};return _0x4be59f;}})});}_0x30845a=_[_0x6896('0x3a')]({},_0x30845a,_0x17b410[_0x6896('0x3c')]);var _0x432bdf={'where':_0x30845a[_0x6896('0x37')]};return db[_0x6896('0x3d')][_0x6896('0x1d')](_0x432bdf)['then'](function(_0x4363ed){_0x114f08[_0x6896('0x1d')]=_0x4363ed;if(_0x17b410['query'][_0x6896('0x3e')]){_0x30845a['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x6896('0x3f')](_0x30845a);})[_0x6896('0x22')](function(_0x555168){_0x114f08[_0x6896('0x40')]=_0x555168;return _0x114f08;})[_0x6896('0x22')](respondWithFilteredResult(_0x418620,_0x30845a))[_0x6896('0x41')](handleError(_0x418620,null));};exports[_0x6896('0x42')]=function(_0x48d29f,_0x508eeb){var _0x45f810={'raw':![],'where':{'id':_0x48d29f[_0x6896('0x43')]['id']}},_0x2c9891={};_0x2c9891[_0x6896('0x2c')]=_[_0x6896('0x2e')](db['FreshsalesAccount'][_0x6896('0x29')]);_0x2c9891['query']=_[_0x6896('0x2e')](_0x48d29f[_0x6896('0x2d')]);_0x2c9891[_0x6896('0x2f')]=_[_0x6896('0x30')](_0x2c9891[_0x6896('0x2c')],_0x2c9891[_0x6896('0x2d')]);_0x45f810['attributes']=_[_0x6896('0x30')](_0x2c9891[_0x6896('0x2c')],qs[_0x6896('0x31')](_0x48d29f[_0x6896('0x2d')][_0x6896('0x31')]));_0x45f810[_0x6896('0x32')]=_0x45f810[_0x6896('0x32')][_0x6896('0x33')]?_0x45f810[_0x6896('0x32')]:_0x2c9891[_0x6896('0x2c')];if(_0x48d29f[_0x6896('0x2d')]['includeAll']){_0x45f810[_0x6896('0x44')]=[{'all':!![]}];}_0x45f810=_['merge']({},_0x45f810,_0x48d29f['options']);return db[_0x6896('0x3d')][_0x6896('0x45')](_0x45f810)[_0x6896('0x22')](handleEntityNotFound(_0x508eeb,null))['then'](respondWithResult(_0x508eeb,null))['catch'](handleError(_0x508eeb,null));};exports['create']=function(_0x3f79e0,_0x44c44b){return db[_0x6896('0x3d')]['create'](_0x3f79e0[_0x6896('0x46')],{})[_0x6896('0x22')](respondWithResult(_0x44c44b,0xc9))[_0x6896('0x41')](handleError(_0x44c44b,null));};exports[_0x6896('0x47')]=function(_0x4c7cd7,_0x1250e7){if(_0x4c7cd7[_0x6896('0x46')]['id']){delete _0x4c7cd7[_0x6896('0x46')]['id'];}return db[_0x6896('0x3d')][_0x6896('0x45')]({'where':{'id':_0x4c7cd7[_0x6896('0x43')]['id']}})[_0x6896('0x22')](handleEntityNotFound(_0x1250e7,null))['then'](saveUpdates(_0x4c7cd7[_0x6896('0x46')],null))[_0x6896('0x22')](respondWithResult(_0x1250e7,null))['catch'](handleError(_0x1250e7,null));};exports[_0x6896('0x23')]=function(_0x2cb4e7,_0x47e395){return db[_0x6896('0x3d')][_0x6896('0x45')]({'where':{'id':_0x2cb4e7['params']['id']}})[_0x6896('0x22')](handleEntityNotFound(_0x47e395,null))[_0x6896('0x22')](removeEntity(_0x47e395,null))[_0x6896('0x41')](handleError(_0x47e395,null));};exports[_0x6896('0x48')]=function(_0x3da554,_0x30a20e,_0x156162){var _0x37e1fc={};var _0x2a3330={};var _0x7fe66c;var _0x4b5d15;return db[_0x6896('0x3d')][_0x6896('0x49')]({'where':{'id':_0x3da554[_0x6896('0x43')]['id']}})[_0x6896('0x22')](handleEntityNotFound(_0x30a20e,null))[_0x6896('0x22')](function(_0x521d3c){if(_0x521d3c){_0x7fe66c=_0x521d3c;_0x2a3330[_0x6896('0x2c')]=_['keys'](db[_0x6896('0x4a')][_0x6896('0x29')]);_0x2a3330[_0x6896('0x2d')]=_[_0x6896('0x2e')](_0x3da554[_0x6896('0x2d')]);_0x2a3330['filters']=_[_0x6896('0x30')](_0x2a3330[_0x6896('0x2c')],_0x2a3330[_0x6896('0x2d')]);_0x37e1fc[_0x6896('0x32')]=_[_0x6896('0x30')](_0x2a3330['model'],qs[_0x6896('0x31')](_0x3da554['query']['fields']));_0x37e1fc[_0x6896('0x32')]=_0x37e1fc[_0x6896('0x32')]['length']?_0x37e1fc['attributes']:_0x2a3330['model'];_0x37e1fc['order']=qs['sort'](_0x3da554[_0x6896('0x2d')][_0x6896('0x36')]);_0x37e1fc[_0x6896('0x37')]=qs[_0x6896('0x2f')](_[_0x6896('0x38')](_0x3da554[_0x6896('0x2d')],_0x2a3330['filters']));if(_0x3da554[_0x6896('0x2d')][_0x6896('0x39')]){_0x37e1fc[_0x6896('0x37')]=_[_0x6896('0x3a')](_0x37e1fc[_0x6896('0x37')],{'$or':_[_0x6896('0x28')](_0x37e1fc['attributes'],function(_0x19165c){var _0x57047a={};_0x57047a[_0x19165c]={'$like':'%'+_0x3da554['query'][_0x6896('0x39')]+'%'};return _0x57047a;})});}_0x37e1fc=_[_0x6896('0x3a')]({},_0x37e1fc,_0x3da554['options']);return _0x7fe66c['getConfigurations'](_0x37e1fc);}})[_0x6896('0x22')](function(_0x30bfc1){if(_0x30bfc1){_0x4b5d15=_0x30bfc1['length'];if(!_0x3da554[_0x6896('0x2d')][_0x6896('0x34')]('nolimit')){_0x37e1fc[_0x6896('0x1c')]=qs[_0x6896('0x1c')](_0x3da554[_0x6896('0x2d')]['limit']);_0x37e1fc[_0x6896('0x1a')]=qs['offset'](_0x3da554[_0x6896('0x2d')]['offset']);}return _0x7fe66c[_0x6896('0x48')](_0x37e1fc);}})[_0x6896('0x22')](function(_0x47b589){if(_0x47b589){return _0x47b589?{'count':_0x4b5d15,'rows':_0x47b589}:null;}})['then'](respondWithResult(_0x30a20e,null))[_0x6896('0x41')](handleError(_0x30a20e,null));};exports[_0x6896('0x4b')]=function(_0x482c26,_0x43daaa,_0x3ac6ca){if(_0x482c26[_0x6896('0x46')]['id']){delete _0x482c26[_0x6896('0x46')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x482c26['params']['id']}})[_0x6896('0x22')](handleEntityNotFound(_0x43daaa,null))[_0x6896('0x22')](function(_0x49fbc6){if(_0x49fbc6){_0x482c26[_0x6896('0x46')][_0x6896('0x4c')]=_0x49fbc6['id'];_0x482c26[_0x6896('0x46')][_0x6896('0x4d')]=integrations[_0x6896('0x4e')](_0x482c26[_0x6896('0x46')][_0x6896('0x4f')],_0x482c26[_0x6896('0x46')][_0x6896('0x2b')]);_0x482c26['body'][_0x6896('0x50')]=integrations['getDescriptions'](_0x482c26[_0x6896('0x46')][_0x6896('0x4f')],_0x482c26[_0x6896('0x46')][_0x6896('0x2b')]);return db[_0x6896('0x4a')][_0x6896('0x51')](_0x482c26[_0x6896('0x46')],{'include':[{'model':db[_0x6896('0x52')],'as':_0x6896('0x4d')},{'model':db[_0x6896('0x52')],'as':_0x6896('0x50')}]});}return null;})[_0x6896('0x22')](respondWithResult(_0x43daaa,null))[_0x6896('0x41')](handleError(_0x43daaa,null));};exports[_0x6896('0x53')]=function(_0x1982cb,_0x4607be,_0x4d9513){var _0x3d665f='';var _0x256f56='';return db[_0x6896('0x3d')][_0x6896('0x49')]({'where':{'id':_0x1982cb[_0x6896('0x43')]['id']},'attributes':['id',_0x6896('0x54'),_0x6896('0x55'),'apiKey']})['then'](handleEntityNotFound(_0x4607be,null))[_0x6896('0x22')](function(_0x25bf85){if(_0x25bf85){_0x256f56=_0x25bf85[_0x6896('0x54')];_0x3d665f=_0x25bf85[_0x6896('0x55')];var _0x485952=_0x25bf85[_0x6896('0x55')][_0x6896('0x56')](-0x1);if(_0x485952==='/'){_0x3d665f=_0x3d665f['substring'](0x0,_0x3d665f[_0x6896('0x57')](_0x485952));}return rp({'method':_0x6896('0x58'),'uri':util[_0x6896('0x59')]('%s%s',_0x3d665f,_0x6896('0x5a')),'headers':{'Authorization':_0x6896('0x5b')+_0x25bf85[_0x6896('0x5c')]},'json':!![]});}})[_0x6896('0x22')](function(_0x4559db){if(_0x4559db){var _0x2d28bc=_0x4559db[_0x6896('0x5d')];var _0x16d14e=![];var _0x1f5a30=null;for(_0x1f5a30=0x0;_0x1f5a30<_0x2d28bc[_0x6896('0x33')];_0x1f5a30++){if(_0x2d28bc[_0x1f5a30][_0x6896('0x5e')]===_0x256f56){_0x16d14e=!![];}}if(_0x16d14e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6896('0x5f')});}}})[_0x6896('0x22')](respondWithResult(_0x4607be,null))[_0x6896('0x41')](function(_0x26c2ab){var _0xc47609=_0x1982cb[_0x6896('0x2d')][_0x6896('0x60')]?0x1f4:_0x26c2ab[_0x6896('0x61')]||0x1f4;logger[_0x6896('0x24')](_0x6896('0x62'),_0x6896('0x53'),_0xc47609,JSON[_0x6896('0x63')](_0x26c2ab));delete _0x26c2ab['name'];if(_0xc47609===0x191){_0xc47609=0x190;}_0x4607be[_0x6896('0x18')](_0xc47609)[_0x6896('0x27')](_0x1982cb['query'][_0x6896('0x60')]?{'message':_0x6896('0x64'),'statusCode':_0x26c2ab[_0x6896('0x61')]}:_0x26c2ab);});}; \ No newline at end of file +var _0x119c=['FreshsalesField','Subjects','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','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','set','apply','save','update','then','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','merge','find','catch','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','pick','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions'];(function(_0x5aae4b,_0x4d0da6){var _0xf4485=function(_0x53c067){while(--_0x53c067){_0x5aae4b['push'](_0x5aae4b['shift']());}};_0xf4485(++_0x4d0da6);}(_0x119c,0x7f));var _0xc119=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0x119c[_0x158a58];return _0x4935d9;};'use strict';var emlformat=require(_0xc119('0x0'));var rimraf=require(_0xc119('0x1'));var zipdir=require(_0xc119('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc119('0x3'));var moment=require('moment');var BPromise=require(_0xc119('0x4'));var Mustache=require('mustache');var util=require(_0xc119('0x5'));var path=require('path');var sox=require(_0xc119('0x6'));var csv=require('to-csv');var ejs=require(_0xc119('0x7'));var fs=require('fs');var fs_extra=require(_0xc119('0x8'));var _=require(_0xc119('0x9'));var squel=require('squel');var crypto=require(_0xc119('0xa'));var jsforce=require(_0xc119('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc119('0xc'));var querystring=require(_0xc119('0xd'));var Papa=require('papaparse');var Redis=require(_0xc119('0xe'));var authService=require(_0xc119('0xf'));var qs=require(_0xc119('0x10'));var as=require(_0xc119('0x11'));var hardwareService=require(_0xc119('0x12'));var logger=require(_0xc119('0x13'))(_0xc119('0x14'));var utils=require(_0xc119('0x15'));var config=require(_0xc119('0x16'));var licenseUtil=require(_0xc119('0x17'));var db=require(_0xc119('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x163ae9,_0x229314){_0x229314=_0x229314||0xcc;return function(_0x2a3b9c){if(_0x2a3b9c){return _0x163ae9['sendStatus'](_0x229314);}return _0x163ae9[_0xc119('0x19')](_0x229314)[_0xc119('0x1a')]();};}function respondWithResult(_0x403cf3,_0x443173){_0x443173=_0x443173||0xc8;return function(_0x4cf0b6){if(_0x4cf0b6){return _0x403cf3[_0xc119('0x19')](_0x443173)[_0xc119('0x1b')](_0x4cf0b6);}};}function respondWithFilteredResult(_0x59d9dd,_0x15102b){return function(_0x3cf4b4){if(_0x3cf4b4){var _0xb7bc29=typeof _0x15102b[_0xc119('0x1c')]===_0xc119('0x1d')&&typeof _0x15102b[_0xc119('0x1e')]===_0xc119('0x1d');var _0x426735=_0x3cf4b4[_0xc119('0x1f')];var _0x4fee62=_0xb7bc29?0x0:_0x15102b[_0xc119('0x1c')];var _0x32c7a9=_0xb7bc29?_0x3cf4b4[_0xc119('0x1f')]:_0x15102b['offset']+_0x15102b['limit'];var _0xccc11f;if(_0x32c7a9>=_0x426735){_0x32c7a9=_0x426735;_0xccc11f=0xc8;}else{_0xccc11f=0xce;}_0x59d9dd[_0xc119('0x19')](_0xccc11f);return _0x59d9dd[_0xc119('0x20')]('Content-Range',_0x4fee62+'-'+_0x32c7a9+'/'+_0x426735)[_0xc119('0x1b')](_0x3cf4b4);}return null;};}function patchUpdates(_0x5201c7){return function(_0x2bb419){try{jsonpatch[_0xc119('0x21')](_0x2bb419,_0x5201c7,!![]);}catch(_0x1c8426){return BPromise['reject'](_0x1c8426);}return _0x2bb419[_0xc119('0x22')]();};}function saveUpdates(_0x3336aa,_0x12fe78){return function(_0x5198bd){if(_0x5198bd){return _0x5198bd[_0xc119('0x23')](_0x3336aa)[_0xc119('0x24')](function(_0xdc139){return _0xdc139;});}return null;};}function removeEntity(_0x281be4,_0x1d605f){return function(_0x1936ec){if(_0x1936ec){return _0x1936ec['destroy']()['then'](function(){_0x281be4['status'](0xcc)[_0xc119('0x1a')]();});}};}function handleEntityNotFound(_0x1d79ec,_0x295b7b){return function(_0x94afc6){if(!_0x94afc6){_0x1d79ec[_0xc119('0x25')](0x194);}return _0x94afc6;};}function handleError(_0x134b28,_0x50a5ff){_0x50a5ff=_0x50a5ff||0x1f4;return function(_0x4194f6){logger['error'](_0x4194f6[_0xc119('0x26')]);if(_0x4194f6[_0xc119('0x27')]){delete _0x4194f6[_0xc119('0x27')];}_0x134b28[_0xc119('0x19')](_0x50a5ff)[_0xc119('0x28')](_0x4194f6);};}exports[_0xc119('0x29')]=function(_0x66029d,_0x560082){var _0x4886de={},_0x799c8c={},_0x518ce8={'count':0x0,'rows':[]};var _0x33a95f=_[_0xc119('0x2a')](db[_0xc119('0x2b')][_0xc119('0x2c')],function(_0x4e7c3a){return{'name':_0x4e7c3a[_0xc119('0x2d')],'type':_0x4e7c3a[_0xc119('0x2e')]['key']};});_0x799c8c[_0xc119('0x2f')]=_[_0xc119('0x2a')](_0x33a95f,_0xc119('0x27'));_0x799c8c[_0xc119('0x30')]=_['keys'](_0x66029d[_0xc119('0x30')]);_0x799c8c[_0xc119('0x31')]=_[_0xc119('0x32')](_0x799c8c[_0xc119('0x2f')],_0x799c8c[_0xc119('0x30')]);_0x4886de[_0xc119('0x33')]=_[_0xc119('0x32')](_0x799c8c[_0xc119('0x2f')],qs[_0xc119('0x34')](_0x66029d['query'][_0xc119('0x34')]));_0x4886de[_0xc119('0x33')]=_0x4886de[_0xc119('0x33')][_0xc119('0x35')]?_0x4886de[_0xc119('0x33')]:_0x799c8c['model'];if(!_0x66029d[_0xc119('0x30')][_0xc119('0x36')]('nolimit')){_0x4886de[_0xc119('0x1e')]=qs['limit'](_0x66029d[_0xc119('0x30')][_0xc119('0x1e')]);_0x4886de['offset']=qs[_0xc119('0x1c')](_0x66029d[_0xc119('0x30')][_0xc119('0x1c')]);}_0x4886de[_0xc119('0x37')]=qs[_0xc119('0x38')](_0x66029d['query'][_0xc119('0x38')]);_0x4886de[_0xc119('0x39')]=qs[_0xc119('0x31')](_['pick'](_0x66029d[_0xc119('0x30')],_0x799c8c['filters']),_0x33a95f);if(_0x66029d['query']['filter']){_0x4886de[_0xc119('0x39')]=_['merge'](_0x4886de[_0xc119('0x39')],{'$or':_[_0xc119('0x2a')](_0x33a95f,function(_0x2728dc){if(_0x2728dc[_0xc119('0x2e')]!==_0xc119('0x3a')){var _0x1bdde2={};_0x1bdde2[_0x2728dc[_0xc119('0x27')]]={'$like':'%'+_0x66029d[_0xc119('0x30')][_0xc119('0x3b')]+'%'};return _0x1bdde2;}})});}_0x4886de=_['merge']({},_0x4886de,_0x66029d[_0xc119('0x3c')]);var _0x586119={'where':_0x4886de[_0xc119('0x39')]};return db[_0xc119('0x2b')]['count'](_0x586119)[_0xc119('0x24')](function(_0x35540f){_0x518ce8[_0xc119('0x1f')]=_0x35540f;if(_0x66029d[_0xc119('0x30')][_0xc119('0x3d')]){_0x4886de[_0xc119('0x3e')]=[{'all':!![]}];}return db[_0xc119('0x2b')][_0xc119('0x3f')](_0x4886de);})[_0xc119('0x24')](function(_0x2da5d7){_0x518ce8['rows']=_0x2da5d7;return _0x518ce8;})[_0xc119('0x24')](respondWithFilteredResult(_0x560082,_0x4886de))['catch'](handleError(_0x560082,null));};exports[_0xc119('0x40')]=function(_0x4142a0,_0x4ad999){var _0x49ad65={'raw':![],'where':{'id':_0x4142a0[_0xc119('0x41')]['id']}},_0x35abde={};_0x35abde[_0xc119('0x2f')]=_[_0xc119('0x42')](db[_0xc119('0x2b')]['rawAttributes']);_0x35abde[_0xc119('0x30')]=_['keys'](_0x4142a0[_0xc119('0x30')]);_0x35abde[_0xc119('0x31')]=_[_0xc119('0x32')](_0x35abde[_0xc119('0x2f')],_0x35abde['query']);_0x49ad65[_0xc119('0x33')]=_[_0xc119('0x32')](_0x35abde['model'],qs[_0xc119('0x34')](_0x4142a0['query']['fields']));_0x49ad65[_0xc119('0x33')]=_0x49ad65['attributes'][_0xc119('0x35')]?_0x49ad65[_0xc119('0x33')]:_0x35abde[_0xc119('0x2f')];if(_0x4142a0['query'][_0xc119('0x3d')]){_0x49ad65[_0xc119('0x3e')]=[{'all':!![]}];}_0x49ad65=_[_0xc119('0x43')]({},_0x49ad65,_0x4142a0[_0xc119('0x3c')]);return db[_0xc119('0x2b')][_0xc119('0x44')](_0x49ad65)[_0xc119('0x24')](handleEntityNotFound(_0x4ad999,null))[_0xc119('0x24')](respondWithResult(_0x4ad999,null))[_0xc119('0x45')](handleError(_0x4ad999,null));};exports[_0xc119('0x46')]=function(_0x3ba832,_0x5ad086){return db[_0xc119('0x2b')][_0xc119('0x46')](_0x3ba832[_0xc119('0x47')],{})[_0xc119('0x24')](respondWithResult(_0x5ad086,0xc9))[_0xc119('0x45')](handleError(_0x5ad086,null));};exports[_0xc119('0x23')]=function(_0x2c8de1,_0x1a2eb9){if(_0x2c8de1[_0xc119('0x47')]['id']){delete _0x2c8de1[_0xc119('0x47')]['id'];}return db['FreshsalesAccount'][_0xc119('0x44')]({'where':{'id':_0x2c8de1['params']['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x1a2eb9,null))['then'](saveUpdates(_0x2c8de1['body'],null))[_0xc119('0x24')](respondWithResult(_0x1a2eb9,null))[_0xc119('0x45')](handleError(_0x1a2eb9,null));};exports[_0xc119('0x48')]=function(_0x115b29,_0x5f1f83){return db[_0xc119('0x2b')]['find']({'where':{'id':_0x115b29[_0xc119('0x41')]['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x5f1f83,null))[_0xc119('0x24')](removeEntity(_0x5f1f83,null))[_0xc119('0x45')](handleError(_0x5f1f83,null));};exports[_0xc119('0x49')]=function(_0x2b7dbb,_0x20453e,_0x850d4a){var _0x111598={};var _0x5c4572={};var _0x59bdb1;var _0x560935;return db[_0xc119('0x2b')][_0xc119('0x4a')]({'where':{'id':_0x2b7dbb[_0xc119('0x41')]['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x20453e,null))[_0xc119('0x24')](function(_0x3ffcdd){if(_0x3ffcdd){_0x59bdb1=_0x3ffcdd;_0x5c4572[_0xc119('0x2f')]=_[_0xc119('0x42')](db[_0xc119('0x4b')]['rawAttributes']);_0x5c4572[_0xc119('0x30')]=_[_0xc119('0x42')](_0x2b7dbb['query']);_0x5c4572[_0xc119('0x31')]=_[_0xc119('0x32')](_0x5c4572[_0xc119('0x2f')],_0x5c4572[_0xc119('0x30')]);_0x111598['attributes']=_['intersection'](_0x5c4572[_0xc119('0x2f')],qs['fields'](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x34')]));_0x111598['attributes']=_0x111598[_0xc119('0x33')][_0xc119('0x35')]?_0x111598[_0xc119('0x33')]:_0x5c4572[_0xc119('0x2f')];_0x111598[_0xc119('0x37')]=qs[_0xc119('0x38')](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x38')]);_0x111598[_0xc119('0x39')]=qs[_0xc119('0x31')](_[_0xc119('0x4c')](_0x2b7dbb[_0xc119('0x30')],_0x5c4572[_0xc119('0x31')]));if(_0x2b7dbb[_0xc119('0x30')][_0xc119('0x3b')]){_0x111598[_0xc119('0x39')]=_['merge'](_0x111598[_0xc119('0x39')],{'$or':_['map'](_0x111598['attributes'],function(_0x169ba9){var _0x3ae07a={};_0x3ae07a[_0x169ba9]={'$like':'%'+_0x2b7dbb['query'][_0xc119('0x3b')]+'%'};return _0x3ae07a;})});}_0x111598=_[_0xc119('0x43')]({},_0x111598,_0x2b7dbb['options']);return _0x59bdb1[_0xc119('0x49')](_0x111598);}})[_0xc119('0x24')](function(_0x22b5c1){if(_0x22b5c1){_0x560935=_0x22b5c1[_0xc119('0x35')];if(!_0x2b7dbb[_0xc119('0x30')][_0xc119('0x36')](_0xc119('0x4d'))){_0x111598['limit']=qs[_0xc119('0x1e')](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x1e')]);_0x111598['offset']=qs[_0xc119('0x1c')](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x1c')]);}return _0x59bdb1[_0xc119('0x49')](_0x111598);}})[_0xc119('0x24')](function(_0x598c6f){if(_0x598c6f){return _0x598c6f?{'count':_0x560935,'rows':_0x598c6f}:null;}})[_0xc119('0x24')](respondWithResult(_0x20453e,null))[_0xc119('0x45')](handleError(_0x20453e,null));};exports[_0xc119('0x4e')]=function(_0x1fdfa7,_0x2bb624,_0x27b108){if(_0x1fdfa7[_0xc119('0x47')]['id']){delete _0x1fdfa7[_0xc119('0x47')]['id'];}return db[_0xc119('0x2b')][_0xc119('0x4a')]({'where':{'id':_0x1fdfa7['params']['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x2bb624,null))[_0xc119('0x24')](function(_0x30951e){if(_0x30951e){_0x1fdfa7[_0xc119('0x47')][_0xc119('0x4f')]=_0x30951e['id'];_0x1fdfa7[_0xc119('0x47')]['Subjects']=integrations[_0xc119('0x50')](_0x1fdfa7['body'][_0xc119('0x51')],_0x1fdfa7[_0xc119('0x47')][_0xc119('0x2e')]);_0x1fdfa7[_0xc119('0x47')][_0xc119('0x52')]=integrations['getDescriptions'](_0x1fdfa7['body'][_0xc119('0x51')],_0x1fdfa7[_0xc119('0x47')][_0xc119('0x2e')]);return db[_0xc119('0x4b')][_0xc119('0x46')](_0x1fdfa7[_0xc119('0x47')],{'include':[{'model':db[_0xc119('0x53')],'as':_0xc119('0x54')},{'model':db[_0xc119('0x53')],'as':_0xc119('0x52')}]});}return null;})[_0xc119('0x24')](respondWithResult(_0x2bb624,null))[_0xc119('0x45')](handleError(_0x2bb624,null));};exports[_0xc119('0x55')]=function(_0x99279f,_0x3ed90f,_0x4f8c43){var _0x47e717='';var _0x454082='';return db[_0xc119('0x2b')][_0xc119('0x4a')]({'where':{'id':_0x99279f['params']['id']},'attributes':['id',_0xc119('0x56'),_0xc119('0x57'),'apiKey']})['then'](handleEntityNotFound(_0x3ed90f,null))[_0xc119('0x24')](function(_0x541fad){if(_0x541fad){_0x454082=_0x541fad['username'];_0x47e717=_0x541fad[_0xc119('0x57')];var _0x5e8c0c=_0x541fad['remoteUri'][_0xc119('0x58')](-0x1);if(_0x5e8c0c==='/'){_0x47e717=_0x47e717[_0xc119('0x59')](0x0,_0x47e717[_0xc119('0x5a')](_0x5e8c0c));}return rp({'method':_0xc119('0x5b'),'uri':util[_0xc119('0x5c')](_0xc119('0x5d'),_0x47e717,_0xc119('0x5e')),'headers':{'Authorization':_0xc119('0x5f')+_0x541fad[_0xc119('0x60')]},'json':!![]});}})[_0xc119('0x24')](function(_0x844791){if(_0x844791){var _0x5e1b9b=_0x844791[_0xc119('0x61')];var _0x1faa17=![];var _0x2168f3=null;for(_0x2168f3=0x0;_0x2168f3<_0x5e1b9b[_0xc119('0x35')];_0x2168f3++){if(_0x5e1b9b[_0x2168f3][_0xc119('0x62')]===_0x454082){_0x1faa17=!![];}}if(_0x1faa17){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc119('0x63')});}}})['then'](respondWithResult(_0x3ed90f,null))[_0xc119('0x45')](function(_0x4fa364){var _0x2b1e61=_0x99279f['query'][_0xc119('0x64')]?0x1f4:_0x4fa364[_0xc119('0x65')]||0x1f4;logger['error'](_0xc119('0x66'),_0xc119('0x55'),_0x2b1e61,JSON[_0xc119('0x67')](_0x4fa364));delete _0x4fa364[_0xc119('0x27')];if(_0x2b1e61===0x191){_0x2b1e61=0x190;}_0x3ed90f[_0xc119('0x19')](_0x2b1e61)[_0xc119('0x28')](_0x99279f['query']['test']?{'message':_0xc119('0x68'),'statusCode':_0x4fa364['statusCode']}:_0x4fa364);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 642f904..95eaa16 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 _0x2d72=['exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x2d72,0xa8));var _0x22d7=function(_0x4dd1ba,_0x3c112a){_0x4dd1ba=_0x4dd1ba-0x0;var _0x907277=_0x2d72[_0x4dd1ba];return _0x907277;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));var integrations=require(_0x22d7('0xb'));module[_0x22d7('0xc')]=function(_0x100426,_0x52a3e3){return _0x100426[_0x22d7('0xd')](_0x22d7('0xe'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4745=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b65ce,_0x3726ce){var _0x3df39f=function(_0x23e272){while(--_0x23e272){_0x3b65ce['push'](_0x3b65ce['shift']());}};_0x3df39f(++_0x3726ce);}(_0x4745,0x1e7));var _0x5474=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x4745[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));var integrations=require(_0x5474('0xb'));module['exports']=function(_0x3d1e1,_0x431f81){return _0x3d1e1['define'](_0x5474('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index b43cda4..4f53e70 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 _0x7ee1=['attributes','limit','include','map','model','info','ShowFreshsalesAccount','find','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x7ee1,0x8d));var _0x17ee=function(_0x2040d4,_0xf866ee){_0x2040d4=_0x2040d4-0x0;var _0x261493=_0x7ee1[_0x2040d4];return _0x261493;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17ee('0x1'));var fs=require('fs');var Redis=require(_0x17ee('0x2'));var db=require(_0x17ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x17ee('0x4'))(_0x17ee('0x5'));var config=require(_0x17ee('0x6'));var jayson=require(_0x17ee('0x7'));var client=jayson['client'][_0x17ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b9eb,_0x54b4f6,_0x3f61af){return new BPromise(function(_0x57e1d1,_0x3d767b){return client[_0x17ee('0x9')](_0x29b9eb,_0x3f61af)[_0x17ee('0xa')](function(_0x4af369){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x54b4f6,_0x17ee('0xb'));logger['debug'](_0x17ee('0xc'),_0x54b4f6,_0x17ee('0xb'),JSON[_0x17ee('0xd')](_0x4af369));if(_0x4af369[_0x17ee('0xe')]){if(_0x4af369['error'][_0x17ee('0xf')]===0x1f4){logger['error'](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x3d767b(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x57e1d1(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x54b4f6,'request\x20sent');_0x57e1d1(_0x4af369['result'][_0x17ee('0x11')]);}})[_0x17ee('0x12')](function(_0x1b87c3){logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x1b87c3);_0x3d767b(_0x1b87c3);});});}exports[_0x17ee('0x13')]=function(_0x63d27f){var _0x587ca7=this;return new Promise(function(_0x44fe58,_0x1118a3){return db[_0x17ee('0x14')][_0x17ee('0x15')]({'raw':_0x63d27f[_0x17ee('0x16')]?_0x63d27f['options'][_0x17ee('0x17')]===undefined?!![]:![]:!![],'where':_0x63d27f['options']?_0x63d27f[_0x17ee('0x16')]['where']||null:null,'attributes':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x18')]||null:null,'limit':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x19')]||null:null,'include':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x63d27f[_0x17ee('0x16')]['include'],function(_0x4b7bfe){return{'model':db[_0x4b7bfe[_0x17ee('0x1c')]],'as':_0x4b7bfe['as'],'attributes':_0x4b7bfe[_0x17ee('0x18')],'include':_0x4b7bfe[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x4b7bfe[_0x17ee('0x1a')],function(_0xea358f){return{'model':db[_0xea358f[_0x17ee('0x1c')]],'as':_0xea358f['as'],'attributes':_0xea358f[_0x17ee('0x18')],'include':_0xea358f[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0xea358f[_0x17ee('0x1a')],function(_0x2a332f){return{'model':db[_0x2a332f['model']],'as':_0x2a332f['as'],'attributes':_0x2a332f[_0x17ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0x17ee('0xa')](function(_0x11ce7e){logger[_0x17ee('0x1d')](_0x17ee('0x13'),_0x63d27f);logger['debug'](_0x17ee('0x13'),_0x63d27f,JSON[_0x17ee('0xd')](_0x11ce7e));_0x44fe58(_0x11ce7e);})[_0x17ee('0x12')](function(_0x4c461b){logger[_0x17ee('0xe')](_0x17ee('0x13'),_0x4c461b['message'],_0x63d27f);_0x1118a3(_0x587ca7[_0x17ee('0xe')](0x1f4,_0x4c461b['message']));});});};exports[_0x17ee('0x1e')]=function(_0x5a44c4){var _0x141ac9=this;return new Promise(function(_0x23ca2e,_0x373c20){return db['FreshsalesAccount'][_0x17ee('0x1f')]({'raw':_0x5a44c4[_0x17ee('0x16')]?_0x5a44c4['options'][_0x17ee('0x17')]===undefined?!![]:![]:!![],'where':_0x5a44c4[_0x17ee('0x16')]?_0x5a44c4[_0x17ee('0x16')]['where']||null:null,'attributes':_0x5a44c4['options']?_0x5a44c4[_0x17ee('0x16')][_0x17ee('0x18')]||null:null,'include':_0x5a44c4[_0x17ee('0x16')]?_0x5a44c4[_0x17ee('0x16')]['include']?_['map'](_0x5a44c4[_0x17ee('0x16')][_0x17ee('0x1a')],function(_0x23578a){return{'model':db[_0x23578a[_0x17ee('0x1c')]],'as':_0x23578a['as'],'attributes':_0x23578a[_0x17ee('0x18')],'include':_0x23578a[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x23578a['include'],function(_0x4a6bc9){return{'model':db[_0x4a6bc9['model']],'as':_0x4a6bc9['as'],'attributes':_0x4a6bc9[_0x17ee('0x18')],'include':_0x4a6bc9['include']?_[_0x17ee('0x1b')](_0x4a6bc9[_0x17ee('0x1a')],function(_0xed7e8a){return{'model':db[_0xed7e8a['model']],'as':_0xed7e8a['as'],'attributes':_0xed7e8a[_0x17ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0x17ee('0xa')](function(_0x590d27){logger['info'](_0x17ee('0x1e'),_0x5a44c4);logger[_0x17ee('0x20')](_0x17ee('0x1e'),_0x5a44c4,JSON[_0x17ee('0xd')](_0x590d27));_0x23ca2e(_0x590d27);})[_0x17ee('0x12')](function(_0x5a2c08){logger['error'](_0x17ee('0x1e'),_0x5a2c08[_0x17ee('0x11')],_0x5a44c4);_0x373c20(_0x141ac9[_0x17ee('0xe')](0x1f4,_0x5a2c08[_0x17ee('0x11')]));});});}; \ No newline at end of file +var _0x4137=['stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','catch','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4ddd6f,_0x433c74){var _0x15fce3=function(_0x29330c){while(--_0x29330c){_0x4ddd6f['push'](_0x4ddd6f['shift']());}};_0x15fce3(++_0x433c74);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'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')]('FreshsalesAccount,\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);});});}exports[_0x7413('0x17')]=function(_0x19157f){var _0x12a01e=this;return new Promise(function(_0x2a3417,_0x26dafe){return db['FreshsalesAccount'][_0x7413('0x18')]({'raw':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1a')]===undefined?!![]:![]:!![],'where':_0x19157f['options']?_0x19157f[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1c')]||null:null,'limit':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1d')]||null:null,'include':_0x19157f['options']?_0x19157f['options'][_0x7413('0x1e')]?_['map'](_0x19157f[_0x7413('0x19')][_0x7413('0x1e')],function(_0x3b0c81){return{'model':db[_0x3b0c81[_0x7413('0x1f')]],'as':_0x3b0c81['as'],'attributes':_0x3b0c81[_0x7413('0x1c')],'include':_0x3b0c81[_0x7413('0x1e')]?_[_0x7413('0x20')](_0x3b0c81[_0x7413('0x1e')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x1e')]?_['map'](_0x1d455b[_0x7413('0x1e')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x1f')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7413('0x21')](function(_0x896552){logger[_0x7413('0xe')](_0x7413('0x17'),_0x19157f);logger[_0x7413('0x10')](_0x7413('0x17'),_0x19157f,JSON['stringify'](_0x896552));_0x2a3417(_0x896552);})[_0x7413('0x22')](function(_0x4ed662){logger[_0x7413('0x13')](_0x7413('0x17'),_0x4ed662[_0x7413('0x16')],_0x19157f);_0x26dafe(_0x12a01e[_0x7413('0x13')](0x1f4,_0x4ed662[_0x7413('0x16')]));});});};exports[_0x7413('0x23')]=function(_0x5bb3ea){var _0x1ffb6f=this;return new Promise(function(_0x17c342,_0x39db32){return db[_0x7413('0x24')][_0x7413('0x25')]({'raw':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['attributes']||null:null,'include':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea['options'][_0x7413('0x1e')]?_[_0x7413('0x20')](_0x5bb3ea[_0x7413('0x19')]['include'],function(_0xe6b096){return{'model':db[_0xe6b096['model']],'as':_0xe6b096['as'],'attributes':_0xe6b096[_0x7413('0x1c')],'include':_0xe6b096[_0x7413('0x1e')]?_['map'](_0xe6b096['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x1f')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x1c')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x1e')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ad12d){logger[_0x7413('0xe')](_0x7413('0x23'),_0x5bb3ea);logger[_0x7413('0x10')](_0x7413('0x23'),_0x5bb3ea,JSON['stringify'](_0x3ad12d));_0x17c342(_0x3ad12d);})[_0x7413('0x22')](function(_0x8dc047){logger[_0x7413('0x13')](_0x7413('0x23'),_0x8dc047[_0x7413('0x16')],_0x5bb3ea);_0x39db32(_0x1ffb6f[_0x7413('0x13')](0x1f4,_0x8dc047[_0x7413('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 63bd14c..e9b1eb9 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 _0x4bf1=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/subjects','/:id/fields','getFields','post','create','put'];(function(_0x2361b7,_0x1cb893){var _0x3c7e23=function(_0x45d6ca){while(--_0x45d6ca){_0x2361b7['push'](_0x2361b7['shift']());}};_0x3c7e23(++_0x1cb893);}(_0x4bf1,0xde));var _0x14bf=function(_0x2e933b,_0x65e810){_0x2e933b=_0x2e933b-0x0;var _0x1cba3b=_0x4bf1[_0x2e933b];return _0x1cba3b;};'use strict';var multer=require(_0x14bf('0x0'));var util=require(_0x14bf('0x1'));var path=require(_0x14bf('0x2'));var timeout=require(_0x14bf('0x3'));var express=require(_0x14bf('0x4'));var router=express['Router']();var fs_extra=require(_0x14bf('0x5'));var auth=require(_0x14bf('0x6'));var interaction=require(_0x14bf('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x14bf('0x8')]('/',auth[_0x14bf('0x9')](),controller['index']);router['get'](_0x14bf('0xa'),auth[_0x14bf('0x9')](),controller[_0x14bf('0xb')]);router[_0x14bf('0x8')](_0x14bf('0xc'),auth[_0x14bf('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x14bf('0x9')](),controller['getDescriptions']);router[_0x14bf('0x8')](_0x14bf('0xd'),auth['isAuthenticated'](),controller[_0x14bf('0xe')]);router[_0x14bf('0xf')]('/',auth[_0x14bf('0x9')](),controller[_0x14bf('0x10')]);router[_0x14bf('0x11')](_0x14bf('0xa'),auth[_0x14bf('0x9')](),controller['update']);router['delete'](_0x14bf('0xa'),auth[_0x14bf('0x9')](),controller[_0x14bf('0x12')]);module[_0x14bf('0x13')]=router; \ No newline at end of file +var _0x50e6=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x50e6,0xd6));var _0x650e=function(_0x2ebffa,_0x27f4ec){_0x2ebffa=_0x2ebffa-0x0;var _0xd49421=_0x50e6[_0x2ebffa];return _0xd49421;};'use strict';var multer=require(_0x650e('0x0'));var util=require(_0x650e('0x1'));var path=require(_0x650e('0x2'));var timeout=require(_0x650e('0x3'));var express=require(_0x650e('0x4'));var router=express[_0x650e('0x5')]();var fs_extra=require(_0x650e('0x6'));var auth=require(_0x650e('0x7'));var interaction=require(_0x650e('0x8'));var config=require(_0x650e('0x9'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x650e('0xa')]('/',auth[_0x650e('0xb')](),controller[_0x650e('0xc')]);router[_0x650e('0xa')](_0x650e('0xd'),auth['isAuthenticated'](),controller[_0x650e('0xe')]);router[_0x650e('0xa')](_0x650e('0xf'),auth[_0x650e('0xb')](),controller[_0x650e('0x10')]);router['get'](_0x650e('0x11'),auth[_0x650e('0xb')](),controller['getDescriptions']);router['get'](_0x650e('0x12'),auth[_0x650e('0xb')](),controller[_0x650e('0x13')]);router['post']('/',auth[_0x650e('0xb')](),controller[_0x650e('0x14')]);router[_0x650e('0x15')](_0x650e('0xd'),auth[_0x650e('0xb')](),controller['update']);router['delete'](_0x650e('0xd'),auth[_0x650e('0xb')](),controller[_0x650e('0x16')]);module[_0x650e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 7432760..250dd4f 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 _0x2bb3=['sequelize','exports','STRING'];(function(_0x4f0415,_0x25d521){var _0x580f30=function(_0x53f3ad){while(--_0x53f3ad){_0x4f0415['push'](_0x4f0415['shift']());}};_0x580f30(++_0x25d521);}(_0x2bb3,0x186));var _0x32bb=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x2bb3[_0x43a37c];return _0x5d1d40;};'use strict';var Sequelize=require(_0x32bb('0x0'));module[_0x32bb('0x1')]={'name':{'type':Sequelize[_0x32bb('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa89c=['exports','STRING','sequelize'];(function(_0xdb4e73,_0x30b446){var _0x4578b4=function(_0x119eb5){while(--_0x119eb5){_0xdb4e73['push'](_0xdb4e73['shift']());}};_0x4578b4(++_0x30b446);}(_0xa89c,0x74));var _0xca89=function(_0x311497,_0x51883d){_0x311497=_0x311497-0x0;var _0x39f937=_0xa89c[_0x311497];return _0x39f937;};'use strict';var Sequelize=require(_0xca89('0x0'));module[_0xca89('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xca89('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 5df2d69..649d666 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 _0xb257=['sort','where','pick','filter','includeAll','findAll','then','show','params','find','create','body','update','catch','findOne','FreshsalesField','order','merge','options','getSubjects','getDescriptions','nolimit','getFields','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','sendStatus','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x67ca4c,_0x2eecae){var _0x13bc3f=function(_0x2a9dec){while(--_0x2a9dec){_0x67ca4c['push'](_0x67ca4c['shift']());}};_0x13bc3f(++_0x2eecae);}(_0xb257,0xab));var _0x7b25=function(_0x2dfd3c,_0x1c9d9a){_0x2dfd3c=_0x2dfd3c-0x0;var _0x1ed3b8=_0xb257[_0x2dfd3c];return _0x1ed3b8;};'use strict';var emlformat=require(_0x7b25('0x0'));var rimraf=require(_0x7b25('0x1'));var zipdir=require(_0x7b25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b25('0x3'));var moment=require(_0x7b25('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7b25('0x5'));var util=require(_0x7b25('0x6'));var path=require(_0x7b25('0x7'));var sox=require(_0x7b25('0x8'));var csv=require(_0x7b25('0x9'));var ejs=require(_0x7b25('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b25('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b25('0xc'));var deskjs=require(_0x7b25('0xd'));var toCsv=require(_0x7b25('0x9'));var querystring=require(_0x7b25('0xe'));var Papa=require(_0x7b25('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7b25('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b25('0x11'))(_0x7b25('0x12'));var utils=require(_0x7b25('0x13'));var config=require(_0x7b25('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b25('0x15'))['db'];function respondWithStatusCode(_0x49245e,_0xdb6d76){_0xdb6d76=_0xdb6d76||0xcc;return function(_0x19e79c){if(_0x19e79c){return _0x49245e['sendStatus'](_0xdb6d76);}return _0x49245e['status'](_0xdb6d76)[_0x7b25('0x16')]();};}function respondWithResult(_0x1f11d9,_0x506442){_0x506442=_0x506442||0xc8;return function(_0x42d12b){if(_0x42d12b){return _0x1f11d9[_0x7b25('0x17')](_0x506442)['json'](_0x42d12b);}};}function respondWithFilteredResult(_0x22acbf,_0x114e03){return function(_0x3789e1){if(_0x3789e1){var _0x4ed809=typeof _0x114e03[_0x7b25('0x18')]==='undefined'&&typeof _0x114e03['limit']===_0x7b25('0x19');var _0x30b0c6=_0x3789e1['count'];var _0x3fe778=_0x4ed809?0x0:_0x114e03[_0x7b25('0x18')];var _0x3015a2=_0x4ed809?_0x3789e1[_0x7b25('0x1a')]:_0x114e03['offset']+_0x114e03['limit'];var _0x10a1fc;if(_0x3015a2>=_0x30b0c6){_0x3015a2=_0x30b0c6;_0x10a1fc=0xc8;}else{_0x10a1fc=0xce;}_0x22acbf[_0x7b25('0x17')](_0x10a1fc);return _0x22acbf[_0x7b25('0x1b')](_0x7b25('0x1c'),_0x3fe778+'-'+_0x3015a2+'/'+_0x30b0c6)[_0x7b25('0x1d')](_0x3789e1);}return null;};}function patchUpdates(_0x158c69){return function(_0x27cc6a){try{jsonpatch[_0x7b25('0x1e')](_0x27cc6a,_0x158c69,!![]);}catch(_0x2f3d7b){return BPromise[_0x7b25('0x1f')](_0x2f3d7b);}return _0x27cc6a['save']();};}function saveUpdates(_0x2f19e6,_0x3f0947){return function(_0x34080e){if(_0x34080e){return _0x34080e['update'](_0x2f19e6)['then'](function(_0x11ed6e){return _0x11ed6e;});}return null;};}function removeEntity(_0x434f70,_0x2302e2){return function(_0xf6cd9e){if(_0xf6cd9e){return _0xf6cd9e['destroy']()['then'](function(){_0x434f70[_0x7b25('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7c9f41,_0x378589){return function(_0x2ee283){if(!_0x2ee283){_0x7c9f41[_0x7b25('0x20')](0x194);}return _0x2ee283;};}function handleError(_0xcf8f3,_0x2153f8){_0x2153f8=_0x2153f8||0x1f4;return function(_0x4a6cbe){logger['error'](_0x4a6cbe['stack']);if(_0x4a6cbe[_0x7b25('0x21')]){delete _0x4a6cbe[_0x7b25('0x21')];}_0xcf8f3['status'](_0x2153f8)[_0x7b25('0x22')](_0x4a6cbe);};}exports[_0x7b25('0x23')]=function(_0x3c5e0f,_0x1ad517){var _0x5197ac={},_0x3dc1f6={},_0x1dd393={'count':0x0,'rows':[]};var _0x168df7=_[_0x7b25('0x24')](db[_0x7b25('0x25')][_0x7b25('0x26')],function(_0x14c0db){return{'name':_0x14c0db[_0x7b25('0x27')],'type':_0x14c0db[_0x7b25('0x28')]['key']};});_0x3dc1f6['model']=_[_0x7b25('0x24')](_0x168df7,_0x7b25('0x21'));_0x3dc1f6[_0x7b25('0x29')]=_[_0x7b25('0x2a')](_0x3c5e0f[_0x7b25('0x29')]);_0x3dc1f6[_0x7b25('0x2b')]=_[_0x7b25('0x2c')](_0x3dc1f6[_0x7b25('0x2d')],_0x3dc1f6['query']);_0x5197ac[_0x7b25('0x2e')]=_[_0x7b25('0x2c')](_0x3dc1f6[_0x7b25('0x2d')],qs[_0x7b25('0x2f')](_0x3c5e0f[_0x7b25('0x29')][_0x7b25('0x2f')]));_0x5197ac[_0x7b25('0x2e')]=_0x5197ac[_0x7b25('0x2e')][_0x7b25('0x30')]?_0x5197ac[_0x7b25('0x2e')]:_0x3dc1f6[_0x7b25('0x2d')];if(!_0x3c5e0f['query'][_0x7b25('0x31')]('nolimit')){_0x5197ac[_0x7b25('0x32')]=qs['limit'](_0x3c5e0f['query'][_0x7b25('0x32')]);_0x5197ac['offset']=qs[_0x7b25('0x18')](_0x3c5e0f[_0x7b25('0x29')][_0x7b25('0x18')]);}_0x5197ac['order']=qs[_0x7b25('0x33')](_0x3c5e0f[_0x7b25('0x29')][_0x7b25('0x33')]);_0x5197ac[_0x7b25('0x34')]=qs[_0x7b25('0x2b')](_[_0x7b25('0x35')](_0x3c5e0f[_0x7b25('0x29')],_0x3dc1f6['filters']),_0x168df7);if(_0x3c5e0f[_0x7b25('0x29')][_0x7b25('0x36')]){_0x5197ac['where']=_['merge'](_0x5197ac['where'],{'$or':_[_0x7b25('0x24')](_0x168df7,function(_0x517122){if(_0x517122[_0x7b25('0x28')]!=='VIRTUAL'){var _0x38d709={};_0x38d709[_0x517122['name']]={'$like':'%'+_0x3c5e0f[_0x7b25('0x29')]['filter']+'%'};return _0x38d709;}})});}_0x5197ac=_['merge']({},_0x5197ac,_0x3c5e0f['options']);var _0xd121a7={'where':_0x5197ac[_0x7b25('0x34')]};return db[_0x7b25('0x25')][_0x7b25('0x1a')](_0xd121a7)['then'](function(_0x5e7e3f){_0x1dd393[_0x7b25('0x1a')]=_0x5e7e3f;if(_0x3c5e0f[_0x7b25('0x29')][_0x7b25('0x37')]){_0x5197ac['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x7b25('0x38')](_0x5197ac);})[_0x7b25('0x39')](function(_0x1baea1){_0x1dd393['rows']=_0x1baea1;return _0x1dd393;})[_0x7b25('0x39')](respondWithFilteredResult(_0x1ad517,_0x5197ac))['catch'](handleError(_0x1ad517,null));};exports[_0x7b25('0x3a')]=function(_0x37c5c5,_0x3e8da5){var _0x225a79={'raw':![],'where':{'id':_0x37c5c5[_0x7b25('0x3b')]['id']}},_0x3825ec={};_0x3825ec[_0x7b25('0x2d')]=_['keys'](db[_0x7b25('0x25')]['rawAttributes']);_0x3825ec[_0x7b25('0x29')]=_[_0x7b25('0x2a')](_0x37c5c5[_0x7b25('0x29')]);_0x3825ec[_0x7b25('0x2b')]=_[_0x7b25('0x2c')](_0x3825ec[_0x7b25('0x2d')],_0x3825ec['query']);_0x225a79[_0x7b25('0x2e')]=_[_0x7b25('0x2c')](_0x3825ec['model'],qs['fields'](_0x37c5c5[_0x7b25('0x29')]['fields']));_0x225a79[_0x7b25('0x2e')]=_0x225a79[_0x7b25('0x2e')][_0x7b25('0x30')]?_0x225a79[_0x7b25('0x2e')]:_0x3825ec[_0x7b25('0x2d')];if(_0x37c5c5[_0x7b25('0x29')][_0x7b25('0x37')]){_0x225a79['include']=[{'all':!![]}];}_0x225a79=_['merge']({},_0x225a79,_0x37c5c5['options']);return db[_0x7b25('0x25')][_0x7b25('0x3c')](_0x225a79)[_0x7b25('0x39')](handleEntityNotFound(_0x3e8da5,null))['then'](respondWithResult(_0x3e8da5,null))['catch'](handleError(_0x3e8da5,null));};exports[_0x7b25('0x3d')]=function(_0x2b8c1c,_0x1c8d38){return db[_0x7b25('0x25')][_0x7b25('0x3d')](_0x2b8c1c[_0x7b25('0x3e')],{})[_0x7b25('0x39')](respondWithResult(_0x1c8d38,0xc9))['catch'](handleError(_0x1c8d38,null));};exports[_0x7b25('0x3f')]=function(_0x115910,_0x1135e7){if(_0x115910[_0x7b25('0x3e')]['id']){delete _0x115910[_0x7b25('0x3e')]['id'];}return db[_0x7b25('0x25')]['find']({'where':{'id':_0x115910[_0x7b25('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1135e7,null))[_0x7b25('0x39')](saveUpdates(_0x115910[_0x7b25('0x3e')],null))[_0x7b25('0x39')](respondWithResult(_0x1135e7,null))[_0x7b25('0x40')](handleError(_0x1135e7,null));};exports['destroy']=function(_0x30ac2d,_0x56f86d){return db['FreshsalesConfiguration'][_0x7b25('0x3c')]({'where':{'id':_0x30ac2d['params']['id']}})[_0x7b25('0x39')](handleEntityNotFound(_0x56f86d,null))['then'](removeEntity(_0x56f86d,null))[_0x7b25('0x40')](handleError(_0x56f86d,null));};exports['getSubjects']=function(_0x2aac28,_0xe9c1e8,_0x2dd2a5){var _0x5425a2={};var _0x2d8970={};var _0x2cbee4;var _0x4ab929;return db[_0x7b25('0x25')][_0x7b25('0x41')]({'where':{'id':_0x2aac28[_0x7b25('0x3b')]['id']}})[_0x7b25('0x39')](handleEntityNotFound(_0xe9c1e8,null))[_0x7b25('0x39')](function(_0x45f10e){if(_0x45f10e){_0x2cbee4=_0x45f10e;_0x2d8970[_0x7b25('0x2d')]=_['keys'](db[_0x7b25('0x42')]['rawAttributes']);_0x2d8970[_0x7b25('0x29')]=_[_0x7b25('0x2a')](_0x2aac28[_0x7b25('0x29')]);_0x2d8970['filters']=_['intersection'](_0x2d8970[_0x7b25('0x2d')],_0x2d8970[_0x7b25('0x29')]);_0x5425a2[_0x7b25('0x2e')]=_[_0x7b25('0x2c')](_0x2d8970[_0x7b25('0x2d')],qs[_0x7b25('0x2f')](_0x2aac28[_0x7b25('0x29')]['fields']));_0x5425a2[_0x7b25('0x2e')]=_0x5425a2[_0x7b25('0x2e')]['length']?_0x5425a2[_0x7b25('0x2e')]:_0x2d8970[_0x7b25('0x2d')];_0x5425a2[_0x7b25('0x43')]=qs[_0x7b25('0x33')](_0x2aac28[_0x7b25('0x29')]['sort']);_0x5425a2[_0x7b25('0x34')]=qs[_0x7b25('0x2b')](_[_0x7b25('0x35')](_0x2aac28['query'],_0x2d8970[_0x7b25('0x2b')]));if(_0x2aac28[_0x7b25('0x29')][_0x7b25('0x36')]){_0x5425a2['where']=_[_0x7b25('0x44')](_0x5425a2['where'],{'$or':_['map'](_0x5425a2[_0x7b25('0x2e')],function(_0x1f3abb){var _0xb59a26={};_0xb59a26[_0x1f3abb]={'$like':'%'+_0x2aac28[_0x7b25('0x29')]['filter']+'%'};return _0xb59a26;})});}_0x5425a2=_[_0x7b25('0x44')]({},_0x5425a2,_0x2aac28[_0x7b25('0x45')]);return _0x2cbee4['getSubjects'](_0x5425a2);}})[_0x7b25('0x39')](function(_0x158afa){if(_0x158afa){_0x4ab929=_0x158afa['length'];if(!_0x2aac28['query']['hasOwnProperty']('nolimit')){_0x5425a2[_0x7b25('0x32')]=qs[_0x7b25('0x32')](_0x2aac28[_0x7b25('0x29')]['limit']);_0x5425a2[_0x7b25('0x18')]=qs['offset'](_0x2aac28[_0x7b25('0x29')][_0x7b25('0x18')]);}return _0x2cbee4[_0x7b25('0x46')](_0x5425a2);}})[_0x7b25('0x39')](function(_0x2c6afb){if(_0x2c6afb){return _0x2c6afb?{'count':_0x4ab929,'rows':_0x2c6afb}:null;}})[_0x7b25('0x39')](respondWithResult(_0xe9c1e8,null))[_0x7b25('0x40')](handleError(_0xe9c1e8,null));};exports[_0x7b25('0x47')]=function(_0x4a56c2,_0x465749,_0x5b03f1){var _0x557b9d={};var _0x1d73cc={};var _0x3e0c62;var _0x1ad382;return db[_0x7b25('0x25')]['findOne']({'where':{'id':_0x4a56c2[_0x7b25('0x3b')]['id']}})['then'](handleEntityNotFound(_0x465749,null))['then'](function(_0x37af12){if(_0x37af12){_0x3e0c62=_0x37af12;_0x1d73cc[_0x7b25('0x2d')]=_['keys'](db[_0x7b25('0x42')][_0x7b25('0x26')]);_0x1d73cc[_0x7b25('0x29')]=_[_0x7b25('0x2a')](_0x4a56c2['query']);_0x1d73cc[_0x7b25('0x2b')]=_['intersection'](_0x1d73cc[_0x7b25('0x2d')],_0x1d73cc['query']);_0x557b9d[_0x7b25('0x2e')]=_[_0x7b25('0x2c')](_0x1d73cc[_0x7b25('0x2d')],qs[_0x7b25('0x2f')](_0x4a56c2[_0x7b25('0x29')][_0x7b25('0x2f')]));_0x557b9d[_0x7b25('0x2e')]=_0x557b9d[_0x7b25('0x2e')]['length']?_0x557b9d['attributes']:_0x1d73cc[_0x7b25('0x2d')];_0x557b9d[_0x7b25('0x43')]=qs[_0x7b25('0x33')](_0x4a56c2['query']['sort']);_0x557b9d[_0x7b25('0x34')]=qs[_0x7b25('0x2b')](_[_0x7b25('0x35')](_0x4a56c2[_0x7b25('0x29')],_0x1d73cc[_0x7b25('0x2b')]));if(_0x4a56c2[_0x7b25('0x29')][_0x7b25('0x36')]){_0x557b9d[_0x7b25('0x34')]=_['merge'](_0x557b9d['where'],{'$or':_['map'](_0x557b9d[_0x7b25('0x2e')],function(_0x1dc07f){var _0x19b3f7={};_0x19b3f7[_0x1dc07f]={'$like':'%'+_0x4a56c2[_0x7b25('0x29')][_0x7b25('0x36')]+'%'};return _0x19b3f7;})});}_0x557b9d=_['merge']({},_0x557b9d,_0x4a56c2[_0x7b25('0x45')]);return _0x3e0c62[_0x7b25('0x47')](_0x557b9d);}})[_0x7b25('0x39')](function(_0x1f72cb){if(_0x1f72cb){_0x1ad382=_0x1f72cb[_0x7b25('0x30')];if(!_0x4a56c2[_0x7b25('0x29')][_0x7b25('0x31')](_0x7b25('0x48'))){_0x557b9d[_0x7b25('0x32')]=qs[_0x7b25('0x32')](_0x4a56c2['query']['limit']);_0x557b9d[_0x7b25('0x18')]=qs['offset'](_0x4a56c2['query']['offset']);}return _0x3e0c62[_0x7b25('0x47')](_0x557b9d);}})[_0x7b25('0x39')](function(_0x32df86){if(_0x32df86){return _0x32df86?{'count':_0x1ad382,'rows':_0x32df86}:null;}})[_0x7b25('0x39')](respondWithResult(_0x465749,null))[_0x7b25('0x40')](handleError(_0x465749,null));};exports['getFields']=function(_0x2a571a,_0x321f66,_0x3a9efc){var _0x727dd6={};var _0x5e96e2={};var _0x3190ec;var _0x35705c;return db['FreshsalesConfiguration'][_0x7b25('0x41')]({'where':{'id':_0x2a571a['params']['id']}})[_0x7b25('0x39')](handleEntityNotFound(_0x321f66,null))[_0x7b25('0x39')](function(_0xb0197e){if(_0xb0197e){_0x3190ec=_0xb0197e;_0x5e96e2[_0x7b25('0x2d')]=_[_0x7b25('0x2a')](db[_0x7b25('0x42')][_0x7b25('0x26')]);_0x5e96e2[_0x7b25('0x29')]=_[_0x7b25('0x2a')](_0x2a571a[_0x7b25('0x29')]);_0x5e96e2[_0x7b25('0x2b')]=_[_0x7b25('0x2c')](_0x5e96e2[_0x7b25('0x2d')],_0x5e96e2['query']);_0x727dd6[_0x7b25('0x2e')]=_['intersection'](_0x5e96e2[_0x7b25('0x2d')],qs[_0x7b25('0x2f')](_0x2a571a['query'][_0x7b25('0x2f')]));_0x727dd6[_0x7b25('0x2e')]=_0x727dd6[_0x7b25('0x2e')]['length']?_0x727dd6['attributes']:_0x5e96e2[_0x7b25('0x2d')];_0x727dd6[_0x7b25('0x43')]=qs[_0x7b25('0x33')](_0x2a571a[_0x7b25('0x29')]['sort']);_0x727dd6[_0x7b25('0x34')]=qs[_0x7b25('0x2b')](_[_0x7b25('0x35')](_0x2a571a[_0x7b25('0x29')],_0x5e96e2[_0x7b25('0x2b')]));if(_0x2a571a[_0x7b25('0x29')][_0x7b25('0x36')]){_0x727dd6[_0x7b25('0x34')]=_['merge'](_0x727dd6['where'],{'$or':_[_0x7b25('0x24')](_0x727dd6['attributes'],function(_0x18c179){var _0x4e75f3={};_0x4e75f3[_0x18c179]={'$like':'%'+_0x2a571a[_0x7b25('0x29')]['filter']+'%'};return _0x4e75f3;})});}_0x727dd6=_['merge']({},_0x727dd6,_0x2a571a['options']);return _0x3190ec[_0x7b25('0x49')](_0x727dd6);}})[_0x7b25('0x39')](function(_0x272e0b){if(_0x272e0b){_0x35705c=_0x272e0b[_0x7b25('0x30')];if(!_0x2a571a[_0x7b25('0x29')]['hasOwnProperty'](_0x7b25('0x48'))){_0x727dd6[_0x7b25('0x32')]=qs[_0x7b25('0x32')](_0x2a571a[_0x7b25('0x29')][_0x7b25('0x32')]);_0x727dd6[_0x7b25('0x18')]=qs[_0x7b25('0x18')](_0x2a571a['query'][_0x7b25('0x18')]);}return _0x3190ec[_0x7b25('0x49')](_0x727dd6);}})[_0x7b25('0x39')](function(_0x4d4508){if(_0x4d4508){return _0x4d4508?{'count':_0x35705c,'rows':_0x4d4508}:null;}})[_0x7b25('0x39')](respondWithResult(_0x321f66,null))[_0x7b25('0x40')](handleError(_0x321f66,null));}; \ No newline at end of file +var _0xd5f2=['to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','end','sendStatus','error','name','FreshsalesConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','find','create','body','getSubjects','findOne','params','FreshsalesField','order','sort','options','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x1ee1d4,_0x425984){var _0x128ccc=function(_0x2e1efb){while(--_0x2e1efb){_0x1ee1d4['push'](_0x1ee1d4['shift']());}};_0x128ccc(++_0x425984);}(_0xd5f2,0x8a));var _0x2d5f=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xd5f2[_0x39e84d];return _0x1991bc;};'use strict';var emlformat=require(_0x2d5f('0x0'));var rimraf=require(_0x2d5f('0x1'));var zipdir=require(_0x2d5f('0x2'));var jsonpatch=require(_0x2d5f('0x3'));var rp=require(_0x2d5f('0x4'));var moment=require(_0x2d5f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2d5f('0x6'));var util=require(_0x2d5f('0x7'));var path=require(_0x2d5f('0x8'));var sox=require(_0x2d5f('0x9'));var csv=require(_0x2d5f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d5f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d5f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2d5f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2d5f('0xe'));var Papa=require(_0x2d5f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d5f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d5f('0x11'))(_0x2d5f('0x12'));var utils=require(_0x2d5f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d5f('0x14'))['db'];function respondWithStatusCode(_0xcc3ddf,_0x5a1e0e){_0x5a1e0e=_0x5a1e0e||0xcc;return function(_0x84e51d){if(_0x84e51d){return _0xcc3ddf['sendStatus'](_0x5a1e0e);}return _0xcc3ddf['status'](_0x5a1e0e)['end']();};}function respondWithResult(_0x20bce3,_0x42e59b){_0x42e59b=_0x42e59b||0xc8;return function(_0x4370a0){if(_0x4370a0){return _0x20bce3[_0x2d5f('0x15')](_0x42e59b)['json'](_0x4370a0);}};}function respondWithFilteredResult(_0x420111,_0x4cfa64){return function(_0x214fab){if(_0x214fab){var _0x215da9=typeof _0x4cfa64[_0x2d5f('0x16')]===_0x2d5f('0x17')&&typeof _0x4cfa64[_0x2d5f('0x18')]===_0x2d5f('0x17');var _0x476815=_0x214fab[_0x2d5f('0x19')];var _0x2bc66b=_0x215da9?0x0:_0x4cfa64[_0x2d5f('0x16')];var _0x4c6492=_0x215da9?_0x214fab[_0x2d5f('0x19')]:_0x4cfa64[_0x2d5f('0x16')]+_0x4cfa64['limit'];var _0x534080;if(_0x4c6492>=_0x476815){_0x4c6492=_0x476815;_0x534080=0xc8;}else{_0x534080=0xce;}_0x420111[_0x2d5f('0x15')](_0x534080);return _0x420111[_0x2d5f('0x1a')](_0x2d5f('0x1b'),_0x2bc66b+'-'+_0x4c6492+'/'+_0x476815)[_0x2d5f('0x1c')](_0x214fab);}return null;};}function patchUpdates(_0x285424){return function(_0x58f623){try{jsonpatch[_0x2d5f('0x1d')](_0x58f623,_0x285424,!![]);}catch(_0x20591d){return BPromise['reject'](_0x20591d);}return _0x58f623['save']();};}function saveUpdates(_0x45e64a,_0x54294b){return function(_0x467897){if(_0x467897){return _0x467897[_0x2d5f('0x1e')](_0x45e64a)[_0x2d5f('0x1f')](function(_0x562f3b){return _0x562f3b;});}return null;};}function removeEntity(_0x1f600f,_0x50e417){return function(_0x4cac4f){if(_0x4cac4f){return _0x4cac4f[_0x2d5f('0x20')]()['then'](function(){_0x1f600f[_0x2d5f('0x15')](0xcc)[_0x2d5f('0x21')]();});}};}function handleEntityNotFound(_0x36eb0e,_0x3c1ead){return function(_0x2f2f8f){if(!_0x2f2f8f){_0x36eb0e[_0x2d5f('0x22')](0x194);}return _0x2f2f8f;};}function handleError(_0x4e437d,_0x15e192){_0x15e192=_0x15e192||0x1f4;return function(_0x5d0630){logger[_0x2d5f('0x23')](_0x5d0630['stack']);if(_0x5d0630[_0x2d5f('0x24')]){delete _0x5d0630['name'];}_0x4e437d[_0x2d5f('0x15')](_0x15e192)['send'](_0x5d0630);};}exports['index']=function(_0x2acce0,_0x25c29b){var _0x264bd4={},_0x5739e7={},_0x58576e={'count':0x0,'rows':[]};var _0x256066=_['map'](db[_0x2d5f('0x25')][_0x2d5f('0x26')],function(_0x3b4932){return{'name':_0x3b4932[_0x2d5f('0x27')],'type':_0x3b4932[_0x2d5f('0x28')]['key']};});_0x5739e7[_0x2d5f('0x29')]=_[_0x2d5f('0x2a')](_0x256066,_0x2d5f('0x24'));_0x5739e7[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x2acce0[_0x2d5f('0x2b')]);_0x5739e7[_0x2d5f('0x2d')]=_[_0x2d5f('0x2e')](_0x5739e7[_0x2d5f('0x29')],_0x5739e7['query']);_0x264bd4['attributes']=_[_0x2d5f('0x2e')](_0x5739e7[_0x2d5f('0x29')],qs[_0x2d5f('0x2f')](_0x2acce0[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x264bd4['attributes']=_0x264bd4['attributes'][_0x2d5f('0x30')]?_0x264bd4[_0x2d5f('0x31')]:_0x5739e7[_0x2d5f('0x29')];if(!_0x2acce0['query'][_0x2d5f('0x32')](_0x2d5f('0x33'))){_0x264bd4[_0x2d5f('0x18')]=qs[_0x2d5f('0x18')](_0x2acce0[_0x2d5f('0x2b')]['limit']);_0x264bd4[_0x2d5f('0x16')]=qs['offset'](_0x2acce0[_0x2d5f('0x2b')]['offset']);}_0x264bd4['order']=qs['sort'](_0x2acce0[_0x2d5f('0x2b')]['sort']);_0x264bd4['where']=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x2acce0[_0x2d5f('0x2b')],_0x5739e7[_0x2d5f('0x2d')]),_0x256066);if(_0x2acce0['query'][_0x2d5f('0x35')]){_0x264bd4[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x264bd4['where'],{'$or':_[_0x2d5f('0x2a')](_0x256066,function(_0x5abb1e){if(_0x5abb1e[_0x2d5f('0x28')]!==_0x2d5f('0x38')){var _0x2cabff={};_0x2cabff[_0x5abb1e[_0x2d5f('0x24')]]={'$like':'%'+_0x2acce0[_0x2d5f('0x2b')][_0x2d5f('0x35')]+'%'};return _0x2cabff;}})});}_0x264bd4=_[_0x2d5f('0x37')]({},_0x264bd4,_0x2acce0['options']);var _0x41858f={'where':_0x264bd4[_0x2d5f('0x36')]};return db[_0x2d5f('0x25')][_0x2d5f('0x19')](_0x41858f)['then'](function(_0x30b2e1){_0x58576e[_0x2d5f('0x19')]=_0x30b2e1;if(_0x2acce0['query'][_0x2d5f('0x39')]){_0x264bd4[_0x2d5f('0x3a')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x2d5f('0x3b')](_0x264bd4);})[_0x2d5f('0x1f')](function(_0xe2c083){_0x58576e[_0x2d5f('0x3c')]=_0xe2c083;return _0x58576e;})[_0x2d5f('0x1f')](respondWithFilteredResult(_0x25c29b,_0x264bd4))[_0x2d5f('0x3d')](handleError(_0x25c29b,null));};exports['show']=function(_0x533e66,_0x3adac2){var _0x26e400={'raw':![],'where':{'id':_0x533e66['params']['id']}},_0x596bd5={};_0x596bd5[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x25')][_0x2d5f('0x26')]);_0x596bd5[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x533e66[_0x2d5f('0x2b')]);_0x596bd5[_0x2d5f('0x2d')]=_[_0x2d5f('0x2e')](_0x596bd5[_0x2d5f('0x29')],_0x596bd5[_0x2d5f('0x2b')]);_0x26e400['attributes']=_[_0x2d5f('0x2e')](_0x596bd5[_0x2d5f('0x29')],qs['fields'](_0x533e66[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x26e400['attributes']=_0x26e400[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x26e400[_0x2d5f('0x31')]:_0x596bd5[_0x2d5f('0x29')];if(_0x533e66[_0x2d5f('0x2b')][_0x2d5f('0x39')]){_0x26e400[_0x2d5f('0x3a')]=[{'all':!![]}];}_0x26e400=_[_0x2d5f('0x37')]({},_0x26e400,_0x533e66['options']);return db[_0x2d5f('0x25')][_0x2d5f('0x3e')](_0x26e400)['then'](handleEntityNotFound(_0x3adac2,null))[_0x2d5f('0x1f')](respondWithResult(_0x3adac2,null))['catch'](handleError(_0x3adac2,null));};exports[_0x2d5f('0x3f')]=function(_0x258472,_0x41f5b2){return db[_0x2d5f('0x25')][_0x2d5f('0x3f')](_0x258472['body'],{})['then'](respondWithResult(_0x41f5b2,0xc9))['catch'](handleError(_0x41f5b2,null));};exports[_0x2d5f('0x1e')]=function(_0x3a0276,_0x135c48){if(_0x3a0276['body']['id']){delete _0x3a0276[_0x2d5f('0x40')]['id'];}return db[_0x2d5f('0x25')][_0x2d5f('0x3e')]({'where':{'id':_0x3a0276['params']['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x135c48,null))[_0x2d5f('0x1f')](saveUpdates(_0x3a0276[_0x2d5f('0x40')],null))['then'](respondWithResult(_0x135c48,null))[_0x2d5f('0x3d')](handleError(_0x135c48,null));};exports[_0x2d5f('0x20')]=function(_0x1b61e5,_0x4c0613){return db['FreshsalesConfiguration'][_0x2d5f('0x3e')]({'where':{'id':_0x1b61e5['params']['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x4c0613,null))[_0x2d5f('0x1f')](removeEntity(_0x4c0613,null))[_0x2d5f('0x3d')](handleError(_0x4c0613,null));};exports[_0x2d5f('0x41')]=function(_0x582afb,_0x3e68c8,_0xbc646a){var _0x394403={};var _0x24102c={};var _0x15d5c8;var _0x3d77b1;return db[_0x2d5f('0x25')][_0x2d5f('0x42')]({'where':{'id':_0x582afb[_0x2d5f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e68c8,null))[_0x2d5f('0x1f')](function(_0x481638){if(_0x481638){_0x15d5c8=_0x481638;_0x24102c[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x44')][_0x2d5f('0x26')]);_0x24102c[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x582afb[_0x2d5f('0x2b')]);_0x24102c['filters']=_[_0x2d5f('0x2e')](_0x24102c[_0x2d5f('0x29')],_0x24102c['query']);_0x394403[_0x2d5f('0x31')]=_[_0x2d5f('0x2e')](_0x24102c[_0x2d5f('0x29')],qs[_0x2d5f('0x2f')](_0x582afb[_0x2d5f('0x2b')]['fields']));_0x394403[_0x2d5f('0x31')]=_0x394403[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x394403['attributes']:_0x24102c[_0x2d5f('0x29')];_0x394403[_0x2d5f('0x45')]=qs[_0x2d5f('0x46')](_0x582afb[_0x2d5f('0x2b')][_0x2d5f('0x46')]);_0x394403['where']=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x582afb['query'],_0x24102c[_0x2d5f('0x2d')]));if(_0x582afb[_0x2d5f('0x2b')]['filter']){_0x394403[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x394403[_0x2d5f('0x36')],{'$or':_[_0x2d5f('0x2a')](_0x394403[_0x2d5f('0x31')],function(_0xaa11d4){var _0x4b14b5={};_0x4b14b5[_0xaa11d4]={'$like':'%'+_0x582afb[_0x2d5f('0x2b')]['filter']+'%'};return _0x4b14b5;})});}_0x394403=_['merge']({},_0x394403,_0x582afb[_0x2d5f('0x47')]);return _0x15d5c8[_0x2d5f('0x41')](_0x394403);}})[_0x2d5f('0x1f')](function(_0x584526){if(_0x584526){_0x3d77b1=_0x584526['length'];if(!_0x582afb[_0x2d5f('0x2b')][_0x2d5f('0x32')]('nolimit')){_0x394403[_0x2d5f('0x18')]=qs['limit'](_0x582afb['query']['limit']);_0x394403[_0x2d5f('0x16')]=qs[_0x2d5f('0x16')](_0x582afb[_0x2d5f('0x2b')][_0x2d5f('0x16')]);}return _0x15d5c8[_0x2d5f('0x41')](_0x394403);}})[_0x2d5f('0x1f')](function(_0x292ed6){if(_0x292ed6){return _0x292ed6?{'count':_0x3d77b1,'rows':_0x292ed6}:null;}})['then'](respondWithResult(_0x3e68c8,null))[_0x2d5f('0x3d')](handleError(_0x3e68c8,null));};exports[_0x2d5f('0x48')]=function(_0x4c1543,_0x1cfc9c,_0x1428b0){var _0x4067d0={};var _0x199ad6={};var _0x7c0551;var _0x5dda6a;return db[_0x2d5f('0x25')]['findOne']({'where':{'id':_0x4c1543[_0x2d5f('0x43')]['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x1cfc9c,null))[_0x2d5f('0x1f')](function(_0x170500){if(_0x170500){_0x7c0551=_0x170500;_0x199ad6[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x44')][_0x2d5f('0x26')]);_0x199ad6[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x4c1543[_0x2d5f('0x2b')]);_0x199ad6[_0x2d5f('0x2d')]=_[_0x2d5f('0x2e')](_0x199ad6['model'],_0x199ad6[_0x2d5f('0x2b')]);_0x4067d0[_0x2d5f('0x31')]=_[_0x2d5f('0x2e')](_0x199ad6[_0x2d5f('0x29')],qs['fields'](_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x4067d0[_0x2d5f('0x31')]=_0x4067d0[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x4067d0[_0x2d5f('0x31')]:_0x199ad6[_0x2d5f('0x29')];_0x4067d0[_0x2d5f('0x45')]=qs[_0x2d5f('0x46')](_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x46')]);_0x4067d0['where']=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x4c1543[_0x2d5f('0x2b')],_0x199ad6[_0x2d5f('0x2d')]));if(_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x35')]){_0x4067d0[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x4067d0[_0x2d5f('0x36')],{'$or':_[_0x2d5f('0x2a')](_0x4067d0[_0x2d5f('0x31')],function(_0x3e6400){var _0x2b495e={};_0x2b495e[_0x3e6400]={'$like':'%'+_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x35')]+'%'};return _0x2b495e;})});}_0x4067d0=_[_0x2d5f('0x37')]({},_0x4067d0,_0x4c1543[_0x2d5f('0x47')]);return _0x7c0551[_0x2d5f('0x48')](_0x4067d0);}})[_0x2d5f('0x1f')](function(_0x223ee1){if(_0x223ee1){_0x5dda6a=_0x223ee1[_0x2d5f('0x30')];if(!_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x32')]('nolimit')){_0x4067d0[_0x2d5f('0x18')]=qs[_0x2d5f('0x18')](_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x18')]);_0x4067d0[_0x2d5f('0x16')]=qs[_0x2d5f('0x16')](_0x4c1543['query'][_0x2d5f('0x16')]);}return _0x7c0551['getDescriptions'](_0x4067d0);}})[_0x2d5f('0x1f')](function(_0x4f4b5f){if(_0x4f4b5f){return _0x4f4b5f?{'count':_0x5dda6a,'rows':_0x4f4b5f}:null;}})[_0x2d5f('0x1f')](respondWithResult(_0x1cfc9c,null))['catch'](handleError(_0x1cfc9c,null));};exports[_0x2d5f('0x49')]=function(_0x4a846a,_0x274aae,_0x304c10){var _0x350b40={};var _0x59ac59={};var _0x501a43;var _0x1e7cc5;return db['FreshsalesConfiguration'][_0x2d5f('0x42')]({'where':{'id':_0x4a846a[_0x2d5f('0x43')]['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x274aae,null))['then'](function(_0x45ff34){if(_0x45ff34){_0x501a43=_0x45ff34;_0x59ac59[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x44')]['rawAttributes']);_0x59ac59['query']=_['keys'](_0x4a846a['query']);_0x59ac59[_0x2d5f('0x2d')]=_['intersection'](_0x59ac59[_0x2d5f('0x29')],_0x59ac59['query']);_0x350b40[_0x2d5f('0x31')]=_['intersection'](_0x59ac59[_0x2d5f('0x29')],qs[_0x2d5f('0x2f')](_0x4a846a[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x350b40['attributes']=_0x350b40[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x350b40[_0x2d5f('0x31')]:_0x59ac59[_0x2d5f('0x29')];_0x350b40[_0x2d5f('0x45')]=qs[_0x2d5f('0x46')](_0x4a846a[_0x2d5f('0x2b')]['sort']);_0x350b40[_0x2d5f('0x36')]=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x4a846a[_0x2d5f('0x2b')],_0x59ac59['filters']));if(_0x4a846a['query']['filter']){_0x350b40[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x350b40[_0x2d5f('0x36')],{'$or':_[_0x2d5f('0x2a')](_0x350b40[_0x2d5f('0x31')],function(_0x749345){var _0xf7e225={};_0xf7e225[_0x749345]={'$like':'%'+_0x4a846a[_0x2d5f('0x2b')]['filter']+'%'};return _0xf7e225;})});}_0x350b40=_[_0x2d5f('0x37')]({},_0x350b40,_0x4a846a['options']);return _0x501a43[_0x2d5f('0x49')](_0x350b40);}})[_0x2d5f('0x1f')](function(_0x2131d2){if(_0x2131d2){_0x1e7cc5=_0x2131d2[_0x2d5f('0x30')];if(!_0x4a846a[_0x2d5f('0x2b')][_0x2d5f('0x32')](_0x2d5f('0x33'))){_0x350b40[_0x2d5f('0x18')]=qs[_0x2d5f('0x18')](_0x4a846a['query']['limit']);_0x350b40[_0x2d5f('0x16')]=qs[_0x2d5f('0x16')](_0x4a846a[_0x2d5f('0x2b')]['offset']);}return _0x501a43[_0x2d5f('0x49')](_0x350b40);}})['then'](function(_0x218140){if(_0x218140){return _0x218140?{'count':_0x1e7cc5,'rows':_0x218140}:null;}})[_0x2d5f('0x1f')](respondWithResult(_0x274aae,null))['catch'](handleError(_0x274aae,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index f863fc9..1dc86fd 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 _0x8e03=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x42cbfc,_0x58895c){var _0x4e6a53=function(_0xa4db28){while(--_0xa4db28){_0x42cbfc['push'](_0x42cbfc['shift']());}};_0x4e6a53(++_0x58895c);}(_0x8e03,0xd8));var _0x38e0=function(_0x43cc72,_0x19bf53){_0x43cc72=_0x43cc72-0x0;var _0x48c683=_0x8e03[_0x43cc72];return _0x48c683;};'use strict';var _=require(_0x38e0('0x0'));var util=require(_0x38e0('0x1'));var logger=require(_0x38e0('0x2'))(_0x38e0('0x3'));var moment=require(_0x38e0('0x4'));var BPromise=require(_0x38e0('0x5'));var rp=require(_0x38e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38e0('0x7'));var config=require('../../config/environment');var attributes=require(_0x38e0('0x8'));module[_0x38e0('0x9')]=function(_0x34db38,_0x6d41cd){return _0x34db38[_0x38e0('0xa')](_0x38e0('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6fe=['../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','lodash','util','../../config/logger','api','bluebird','rimraf'];(function(_0x36cba4,_0x53a452){var _0xcc6047=function(_0x20b2a5){while(--_0x20b2a5){_0x36cba4['push'](_0x36cba4['shift']());}};_0xcc6047(++_0x53a452);}(_0xc6fe,0x158));var _0xec6f=function(_0x418780,_0x28b7d7){_0x418780=_0x418780-0x0;var _0x5dd67a=_0xc6fe[_0x418780];return _0x5dd67a;};'use strict';var _=require(_0xec6f('0x0'));var util=require(_0xec6f('0x1'));var logger=require(_0xec6f('0x2'))(_0xec6f('0x3'));var moment=require('moment');var BPromise=require(_0xec6f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec6f('0x5'));var config=require(_0xec6f('0x6'));var attributes=require(_0xec6f('0x7'));module['exports']=function(_0x45dde3,_0x2c3244){return _0x45dde3[_0xec6f('0x8')](_0xec6f('0x9'),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 d153f42..986ee48 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 _0x76cb=['code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xd822d0,_0xb18e5d){var _0x4471ff=function(_0x1c5847){while(--_0x1c5847){_0xd822d0['push'](_0xd822d0['shift']());}};_0x4471ff(++_0xb18e5d);}(_0x76cb,0x192));var _0xb76c=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0x76cb[_0x459a0a];return _0x4ab46c;};'use strict';var _=require(_0xb76c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb76c('0x1'));var rs=require(_0xb76c('0x2'));var fs=require('fs');var Redis=require(_0xb76c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb76c('0x4'));var logger=require(_0xb76c('0x5'))(_0xb76c('0x6'));var config=require(_0xb76c('0x7'));var jayson=require(_0xb76c('0x8'));var client=jayson[_0xb76c('0x9')][_0xb76c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48c48f,_0xc64162,_0x2787cf){return new BPromise(function(_0x3d05f2,_0x564a2d){return client[_0xb76c('0xb')](_0x48c48f,_0x2787cf)[_0xb76c('0xc')](function(_0x597709){logger[_0xb76c('0xd')](_0xb76c('0xe'),_0xc64162,_0xb76c('0xf'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0xc64162,_0xb76c('0xf'),JSON[_0xb76c('0x10')](_0x597709));if(_0x597709[_0xb76c('0x11')]){if(_0x597709[_0xb76c('0x11')][_0xb76c('0x12')]===0x1f4){logger[_0xb76c('0x11')](_0xb76c('0xe'),_0xc64162,_0x597709[_0xb76c('0x11')][_0xb76c('0x13')]);return _0x564a2d(_0x597709[_0xb76c('0x11')][_0xb76c('0x13')]);}logger['error'](_0xb76c('0xe'),_0xc64162,_0x597709[_0xb76c('0x11')][_0xb76c('0x13')]);return _0x3d05f2(_0x597709[_0xb76c('0x11')][_0xb76c('0x13')]);}else{logger[_0xb76c('0xd')](_0xb76c('0xe'),_0xc64162,'request\x20sent');_0x3d05f2(_0x597709['result'][_0xb76c('0x13')]);}})[_0xb76c('0x14')](function(_0x59b528){logger[_0xb76c('0x11')](_0xb76c('0xe'),_0xc64162,_0x59b528);_0x564a2d(_0x59b528);});});} \ No newline at end of file +var _0xeb26=['info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xeb26,0x82));var _0x6eb2=function(_0x3f7363,_0x1fb679){_0x3f7363=_0x3f7363-0x0;var _0x1945de=_0xeb26[_0x3f7363];return _0x1945de;};'use strict';var _=require(_0x6eb2('0x0'));var util=require('util');var moment=require(_0x6eb2('0x1'));var BPromise=require('bluebird');var rs=require(_0x6eb2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6eb2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eb2('0x4'))(_0x6eb2('0x5'));var config=require(_0x6eb2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6eb2('0x7')][_0x6eb2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30122c,_0x5245a2,_0x52875c){return new BPromise(function(_0x366f55,_0x5786eb){return client[_0x6eb2('0x9')](_0x30122c,_0x52875c)['then'](function(_0x377690){logger[_0x6eb2('0xa')](_0x6eb2('0xb'),_0x5245a2,_0x6eb2('0xc'));logger[_0x6eb2('0xd')](_0x6eb2('0xe'),_0x5245a2,'request\x20sent',JSON[_0x6eb2('0xf')](_0x377690));if(_0x377690[_0x6eb2('0x10')]){if(_0x377690[_0x6eb2('0x10')][_0x6eb2('0x11')]===0x1f4){logger[_0x6eb2('0x10')](_0x6eb2('0xb'),_0x5245a2,_0x377690['error']['message']);return _0x5786eb(_0x377690[_0x6eb2('0x10')][_0x6eb2('0x12')]);}logger[_0x6eb2('0x10')](_0x6eb2('0xb'),_0x5245a2,_0x377690[_0x6eb2('0x10')][_0x6eb2('0x12')]);return _0x366f55(_0x377690['error']['message']);}else{logger[_0x6eb2('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5245a2,'request\x20sent');_0x366f55(_0x377690[_0x6eb2('0x13')]['message']);}})['catch'](function(_0x3be28b){logger[_0x6eb2('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5245a2,_0x3be28b);_0x5786eb(_0x3be28b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 37b3b32..e94ce9f 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 _0x5645=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0x5645,0x19e));var _0x5564=function(_0x3f84f7,_0x46a9af){_0x3f84f7=_0x3f84f7-0x0;var _0x1a278a=_0x5645[_0x3f84f7];return _0x1a278a;};'use strict';var multer=require(_0x5564('0x0'));var util=require(_0x5564('0x1'));var path=require(_0x5564('0x2'));var timeout=require(_0x5564('0x3'));var express=require(_0x5564('0x4'));var router=express['Router']();var fs_extra=require(_0x5564('0x5'));var auth=require(_0x5564('0x6'));var interaction=require(_0x5564('0x7'));var config=require(_0x5564('0x8'));var controller=require(_0x5564('0x9'));router[_0x5564('0xa')]('/',auth[_0x5564('0xb')](),controller[_0x5564('0xc')]);router[_0x5564('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5564('0xd')]);router[_0x5564('0xe')]('/',auth[_0x5564('0xb')](),controller[_0x5564('0xf')]);router[_0x5564('0x10')]('/:id',auth[_0x5564('0xb')](),controller[_0x5564('0x11')]);router['delete'](_0x5564('0x12'),auth[_0x5564('0xb')](),controller[_0x5564('0x13')]);module[_0x5564('0x14')]=router; \ No newline at end of file +var _0xf874=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xf874,0x177));var _0x4f87=function(_0x70ab2,_0x24d78a){_0x70ab2=_0x70ab2-0x0;var _0xa9f079=_0xf874[_0x70ab2];return _0xa9f079;};'use strict';var multer=require(_0x4f87('0x0'));var util=require('util');var path=require(_0x4f87('0x1'));var timeout=require(_0x4f87('0x2'));var express=require(_0x4f87('0x3'));var router=express[_0x4f87('0x4')]();var fs_extra=require(_0x4f87('0x5'));var auth=require(_0x4f87('0x6'));var interaction=require(_0x4f87('0x7'));var config=require('../../config/environment');var controller=require(_0x4f87('0x8'));router[_0x4f87('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4f87('0xa')]);router['post']('/',auth[_0x4f87('0xb')](),controller[_0x4f87('0xc')]);router[_0x4f87('0xd')](_0x4f87('0xe'),auth['isAuthenticated'](),controller[_0x4f87('0xf')]);router[_0x4f87('0x10')](_0x4f87('0xe'),auth[_0x4f87('0xb')](),controller[_0x4f87('0x11')]);module[_0x4f87('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 8e13ace..e2334e9 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 _0x6ae9=['STRING','sequelize','string','variable','keyValue','picklist','customVariable'];(function(_0x14510c,_0x3f66f0){var _0x31c5f8=function(_0x1660ec){while(--_0x1660ec){_0x14510c['push'](_0x14510c['shift']());}};_0x31c5f8(++_0x3f66f0);}(_0x6ae9,0x14a));var _0x96ae=function(_0x2ed08c,_0x4b49ed){_0x2ed08c=_0x2ed08c-0x0;var _0x30b2bf=_0x6ae9[_0x2ed08c];return _0x30b2bf;};'use strict';var Sequelize=require(_0x96ae('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x96ae('0x1'),_0x96ae('0x2'),'customVariable',_0x96ae('0x3'),_0x96ae('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x96ae('0x1'),_0x96ae('0x2'),_0x96ae('0x5'))},'keyContent':{'type':Sequelize[_0x96ae('0x6')]},'idField':{'type':Sequelize[_0x96ae('0x6')]},'nameField':{'type':Sequelize[_0x96ae('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfa58=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2dd2ca,_0x3f4560){var _0x3bd7aa=function(_0x10e8f5){while(--_0x10e8f5){_0x2dd2ca['push'](_0x2dd2ca['shift']());}};_0x3bd7aa(++_0x3f4560);}(_0xfa58,0x169));var _0x8fa5=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0xfa58[_0x3c487b];return _0x1d65f6;};'use strict';var Sequelize=require(_0x8fa5('0x0'));module['exports']={'type':{'type':Sequelize[_0x8fa5('0x1')](_0x8fa5('0x2'),_0x8fa5('0x3'),_0x8fa5('0x4'),_0x8fa5('0x5'),_0x8fa5('0x6')),'defaultValue':_0x8fa5('0x2')},'content':{'type':Sequelize[_0x8fa5('0x7')]},'key':{'type':Sequelize[_0x8fa5('0x7')]},'keyType':{'type':Sequelize[_0x8fa5('0x1')]('string',_0x8fa5('0x3'),_0x8fa5('0x4'))},'keyContent':{'type':Sequelize[_0x8fa5('0x7')]},'idField':{'type':Sequelize[_0x8fa5('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8fa5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 83a1940..6193f27 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 _0xe572=['json','apply','reject','save','update','then','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','FreshsalesField','include','findAll','rows','catch','params','options','create','find','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set'];(function(_0x2793ed,_0x226bd0){var _0x3d1bc2=function(_0x6dbc4f){while(--_0x6dbc4f){_0x2793ed['push'](_0x2793ed['shift']());}};_0x3d1bc2(++_0x226bd0);}(_0xe572,0x148));var _0x2e57=function(_0x3a18d0,_0x4eafbd){_0x3a18d0=_0x3a18d0-0x0;var _0x5aaf3b=_0xe572[_0x3a18d0];return _0x5aaf3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e57('0x0'));var zipdir=require(_0x2e57('0x1'));var jsonpatch=require(_0x2e57('0x2'));var rp=require(_0x2e57('0x3'));var moment=require(_0x2e57('0x4'));var BPromise=require(_0x2e57('0x5'));var Mustache=require('mustache');var util=require(_0x2e57('0x6'));var path=require('path');var sox=require(_0x2e57('0x7'));var csv=require(_0x2e57('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e57('0x9'));var _=require(_0x2e57('0xa'));var squel=require('squel');var crypto=require(_0x2e57('0xb'));var jsforce=require(_0x2e57('0xc'));var deskjs=require(_0x2e57('0xd'));var toCsv=require(_0x2e57('0x8'));var querystring=require(_0x2e57('0xe'));var Papa=require(_0x2e57('0xf'));var Redis=require(_0x2e57('0x10'));var authService=require(_0x2e57('0x11'));var qs=require(_0x2e57('0x12'));var as=require(_0x2e57('0x13'));var hardwareService=require(_0x2e57('0x14'));var logger=require(_0x2e57('0x15'))('api');var utils=require(_0x2e57('0x16'));var config=require(_0x2e57('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e57('0x18'))['db'];function respondWithStatusCode(_0x2e3656,_0x1b13f8){_0x1b13f8=_0x1b13f8||0xcc;return function(_0x52c297){if(_0x52c297){return _0x2e3656['sendStatus'](_0x1b13f8);}return _0x2e3656[_0x2e57('0x19')](_0x1b13f8)[_0x2e57('0x1a')]();};}function respondWithResult(_0x4ead47,_0x499517){_0x499517=_0x499517||0xc8;return function(_0x41cbe0){if(_0x41cbe0){return _0x4ead47['status'](_0x499517)['json'](_0x41cbe0);}};}function respondWithFilteredResult(_0x14337b,_0x2eee63){return function(_0x1fd715){if(_0x1fd715){var _0x547c54=typeof _0x2eee63[_0x2e57('0x1b')]===_0x2e57('0x1c')&&typeof _0x2eee63[_0x2e57('0x1d')]==='undefined';var _0x149e44=_0x1fd715[_0x2e57('0x1e')];var _0x211082=_0x547c54?0x0:_0x2eee63[_0x2e57('0x1b')];var _0x56eed6=_0x547c54?_0x1fd715[_0x2e57('0x1e')]:_0x2eee63[_0x2e57('0x1b')]+_0x2eee63['limit'];var _0x3b0acf;if(_0x56eed6>=_0x149e44){_0x56eed6=_0x149e44;_0x3b0acf=0xc8;}else{_0x3b0acf=0xce;}_0x14337b[_0x2e57('0x19')](_0x3b0acf);return _0x14337b[_0x2e57('0x1f')]('Content-Range',_0x211082+'-'+_0x56eed6+'/'+_0x149e44)[_0x2e57('0x20')](_0x1fd715);}return null;};}function patchUpdates(_0x44f926){return function(_0x2a5ff3){try{jsonpatch[_0x2e57('0x21')](_0x2a5ff3,_0x44f926,!![]);}catch(_0x231639){return BPromise[_0x2e57('0x22')](_0x231639);}return _0x2a5ff3[_0x2e57('0x23')]();};}function saveUpdates(_0x130b1e,_0x451eb2){return function(_0x2de4af){if(_0x2de4af){return _0x2de4af[_0x2e57('0x24')](_0x130b1e)[_0x2e57('0x25')](function(_0x3eeb3a){return _0x3eeb3a;});}return null;};}function removeEntity(_0x50fe3e,_0x541f57){return function(_0x3fbe82){if(_0x3fbe82){return _0x3fbe82['destroy']()[_0x2e57('0x25')](function(){_0x50fe3e['status'](0xcc)[_0x2e57('0x1a')]();});}};}function handleEntityNotFound(_0x5c6766,_0x38e7ae){return function(_0x4b49e2){if(!_0x4b49e2){_0x5c6766['sendStatus'](0x194);}return _0x4b49e2;};}function handleError(_0x39bc3a,_0x4fe06a){_0x4fe06a=_0x4fe06a||0x1f4;return function(_0x55d4cc){logger[_0x2e57('0x26')](_0x55d4cc['stack']);if(_0x55d4cc['name']){delete _0x55d4cc['name'];}_0x39bc3a[_0x2e57('0x19')](_0x4fe06a)[_0x2e57('0x27')](_0x55d4cc);};}exports[_0x2e57('0x28')]=function(_0x33fe89,_0x1044c0){var _0x3d7ea6={},_0x14e71b={},_0x59c3f1={'count':0x0,'rows':[]};var _0x174395=_[_0x2e57('0x29')](db['FreshsalesField'][_0x2e57('0x2a')],function(_0x69b9e3){return{'name':_0x69b9e3[_0x2e57('0x2b')],'type':_0x69b9e3[_0x2e57('0x2c')][_0x2e57('0x2d')]};});_0x14e71b[_0x2e57('0x2e')]=_[_0x2e57('0x29')](_0x174395,_0x2e57('0x2f'));_0x14e71b[_0x2e57('0x30')]=_[_0x2e57('0x31')](_0x33fe89[_0x2e57('0x30')]);_0x14e71b[_0x2e57('0x32')]=_[_0x2e57('0x33')](_0x14e71b['model'],_0x14e71b[_0x2e57('0x30')]);_0x3d7ea6[_0x2e57('0x34')]=_[_0x2e57('0x33')](_0x14e71b[_0x2e57('0x2e')],qs[_0x2e57('0x35')](_0x33fe89[_0x2e57('0x30')][_0x2e57('0x35')]));_0x3d7ea6[_0x2e57('0x34')]=_0x3d7ea6[_0x2e57('0x34')][_0x2e57('0x36')]?_0x3d7ea6[_0x2e57('0x34')]:_0x14e71b[_0x2e57('0x2e')];if(!_0x33fe89[_0x2e57('0x30')]['hasOwnProperty'](_0x2e57('0x37'))){_0x3d7ea6[_0x2e57('0x1d')]=qs[_0x2e57('0x1d')](_0x33fe89[_0x2e57('0x30')][_0x2e57('0x1d')]);_0x3d7ea6[_0x2e57('0x1b')]=qs[_0x2e57('0x1b')](_0x33fe89[_0x2e57('0x30')]['offset']);}_0x3d7ea6['order']=qs[_0x2e57('0x38')](_0x33fe89[_0x2e57('0x30')][_0x2e57('0x38')]);_0x3d7ea6[_0x2e57('0x39')]=qs[_0x2e57('0x32')](_[_0x2e57('0x3a')](_0x33fe89[_0x2e57('0x30')],_0x14e71b[_0x2e57('0x32')]),_0x174395);if(_0x33fe89['query'][_0x2e57('0x3b')]){_0x3d7ea6[_0x2e57('0x39')]=_['merge'](_0x3d7ea6['where'],{'$or':_[_0x2e57('0x29')](_0x174395,function(_0x2b6ee3){if(_0x2b6ee3[_0x2e57('0x2c')]!=='VIRTUAL'){var _0x1bb9a0={};_0x1bb9a0[_0x2b6ee3[_0x2e57('0x2f')]]={'$like':'%'+_0x33fe89[_0x2e57('0x30')][_0x2e57('0x3b')]+'%'};return _0x1bb9a0;}})});}_0x3d7ea6=_[_0x2e57('0x3c')]({},_0x3d7ea6,_0x33fe89['options']);var _0x14d7a2={'where':_0x3d7ea6[_0x2e57('0x39')]};return db[_0x2e57('0x3d')][_0x2e57('0x1e')](_0x14d7a2)[_0x2e57('0x25')](function(_0x131128){_0x59c3f1[_0x2e57('0x1e')]=_0x131128;if(_0x33fe89[_0x2e57('0x30')]['includeAll']){_0x3d7ea6[_0x2e57('0x3e')]=[{'all':!![]}];}return db[_0x2e57('0x3d')][_0x2e57('0x3f')](_0x3d7ea6);})[_0x2e57('0x25')](function(_0x5cf995){_0x59c3f1[_0x2e57('0x40')]=_0x5cf995;return _0x59c3f1;})[_0x2e57('0x25')](respondWithFilteredResult(_0x1044c0,_0x3d7ea6))[_0x2e57('0x41')](handleError(_0x1044c0,null));};exports['show']=function(_0x2e5ac5,_0x5da4e8){var _0x5028fe={'raw':!![],'where':{'id':_0x2e5ac5[_0x2e57('0x42')]['id']}},_0x14742c={};_0x14742c[_0x2e57('0x2e')]=_[_0x2e57('0x31')](db['FreshsalesField'][_0x2e57('0x2a')]);_0x14742c[_0x2e57('0x30')]=_[_0x2e57('0x31')](_0x2e5ac5[_0x2e57('0x30')]);_0x14742c[_0x2e57('0x32')]=_['intersection'](_0x14742c[_0x2e57('0x2e')],_0x14742c[_0x2e57('0x30')]);_0x5028fe[_0x2e57('0x34')]=_[_0x2e57('0x33')](_0x14742c[_0x2e57('0x2e')],qs['fields'](_0x2e5ac5['query'][_0x2e57('0x35')]));_0x5028fe[_0x2e57('0x34')]=_0x5028fe['attributes'][_0x2e57('0x36')]?_0x5028fe[_0x2e57('0x34')]:_0x14742c[_0x2e57('0x2e')];if(_0x2e5ac5[_0x2e57('0x30')]['includeAll']){_0x5028fe[_0x2e57('0x3e')]=[{'all':!![]}];}_0x5028fe=_['merge']({},_0x5028fe,_0x2e5ac5[_0x2e57('0x43')]);return db[_0x2e57('0x3d')]['find'](_0x5028fe)[_0x2e57('0x25')](handleEntityNotFound(_0x5da4e8,null))[_0x2e57('0x25')](respondWithResult(_0x5da4e8,null))[_0x2e57('0x41')](handleError(_0x5da4e8,null));};exports['create']=function(_0x58b54a,_0x1d8d70){return db[_0x2e57('0x3d')][_0x2e57('0x44')](_0x58b54a['body'],{})[_0x2e57('0x25')](respondWithResult(_0x1d8d70,0xc9))[_0x2e57('0x41')](handleError(_0x1d8d70,null));};exports[_0x2e57('0x24')]=function(_0x1c3aad,_0x3cbc4f){if(_0x1c3aad['body']['id']){delete _0x1c3aad['body']['id'];}return db[_0x2e57('0x3d')][_0x2e57('0x45')]({'where':{'id':_0x1c3aad[_0x2e57('0x42')]['id']}})[_0x2e57('0x25')](handleEntityNotFound(_0x3cbc4f,null))[_0x2e57('0x25')](saveUpdates(_0x1c3aad[_0x2e57('0x46')],null))[_0x2e57('0x25')](respondWithResult(_0x3cbc4f,null))['catch'](handleError(_0x3cbc4f,null));};exports[_0x2e57('0x47')]=function(_0x19d3fd,_0x2762f3){return db[_0x2e57('0x3d')]['find']({'where':{'id':_0x19d3fd[_0x2e57('0x42')]['id']}})[_0x2e57('0x25')](handleEntityNotFound(_0x2762f3,null))[_0x2e57('0x25')](removeEntity(_0x2762f3,null))[_0x2e57('0x41')](handleError(_0x2762f3,null));}; \ No newline at end of file +var _0x756f=['Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0x756f,0x152));var _0xf756=function(_0x4f1b5c,_0x32cf90){_0x4f1b5c=_0x4f1b5c-0x0;var _0x2b0463=_0x756f[_0x4f1b5c];return _0x2b0463;};'use strict';var emlformat=require(_0xf756('0x0'));var rimraf=require(_0xf756('0x1'));var zipdir=require(_0xf756('0x2'));var jsonpatch=require(_0xf756('0x3'));var rp=require(_0xf756('0x4'));var moment=require(_0xf756('0x5'));var BPromise=require(_0xf756('0x6'));var Mustache=require(_0xf756('0x7'));var util=require(_0xf756('0x8'));var path=require(_0xf756('0x9'));var sox=require(_0xf756('0xa'));var csv=require(_0xf756('0xb'));var ejs=require(_0xf756('0xc'));var fs=require('fs');var fs_extra=require(_0xf756('0xd'));var _=require(_0xf756('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf756('0xf'));var toCsv=require(_0xf756('0xb'));var querystring=require(_0xf756('0x10'));var Papa=require(_0xf756('0x11'));var Redis=require('ioredis');var authService=require(_0xf756('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf756('0x13'));var hardwareService=require(_0xf756('0x14'));var logger=require(_0xf756('0x15'))(_0xf756('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf756('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb15e0a,_0x15061e){_0x15061e=_0x15061e||0xcc;return function(_0x4c4b42){if(_0x4c4b42){return _0xb15e0a[_0xf756('0x18')](_0x15061e);}return _0xb15e0a[_0xf756('0x19')](_0x15061e)[_0xf756('0x1a')]();};}function respondWithResult(_0xdf9f0b,_0x4a6ef9){_0x4a6ef9=_0x4a6ef9||0xc8;return function(_0x10ba5e){if(_0x10ba5e){return _0xdf9f0b[_0xf756('0x19')](_0x4a6ef9)[_0xf756('0x1b')](_0x10ba5e);}};}function respondWithFilteredResult(_0x4e0a5e,_0x3b2c74){return function(_0x25a7cf){if(_0x25a7cf){var _0x5d7db4=typeof _0x3b2c74[_0xf756('0x1c')]==='undefined'&&typeof _0x3b2c74[_0xf756('0x1d')]==='undefined';var _0x4dc946=_0x25a7cf[_0xf756('0x1e')];var _0x593030=_0x5d7db4?0x0:_0x3b2c74['offset'];var _0x432722=_0x5d7db4?_0x25a7cf[_0xf756('0x1e')]:_0x3b2c74[_0xf756('0x1c')]+_0x3b2c74[_0xf756('0x1d')];var _0x1855c9;if(_0x432722>=_0x4dc946){_0x432722=_0x4dc946;_0x1855c9=0xc8;}else{_0x1855c9=0xce;}_0x4e0a5e[_0xf756('0x19')](_0x1855c9);return _0x4e0a5e[_0xf756('0x1f')](_0xf756('0x20'),_0x593030+'-'+_0x432722+'/'+_0x4dc946)[_0xf756('0x1b')](_0x25a7cf);}return null;};}function patchUpdates(_0x30de53){return function(_0x2c0c88){try{jsonpatch[_0xf756('0x21')](_0x2c0c88,_0x30de53,!![]);}catch(_0x3004b2){return BPromise[_0xf756('0x22')](_0x3004b2);}return _0x2c0c88['save']();};}function saveUpdates(_0x4eda74,_0xd0ff52){return function(_0x49f0f7){if(_0x49f0f7){return _0x49f0f7['update'](_0x4eda74)['then'](function(_0x396fb9){return _0x396fb9;});}return null;};}function removeEntity(_0x1eaca4,_0x3102e){return function(_0x333a97){if(_0x333a97){return _0x333a97[_0xf756('0x23')]()[_0xf756('0x24')](function(){_0x1eaca4[_0xf756('0x19')](0xcc)[_0xf756('0x1a')]();});}};}function handleEntityNotFound(_0x1cc642,_0x482604){return function(_0xc99b03){if(!_0xc99b03){_0x1cc642[_0xf756('0x18')](0x194);}return _0xc99b03;};}function handleError(_0x1f1d98,_0x7a90a7){_0x7a90a7=_0x7a90a7||0x1f4;return function(_0x39f35e){logger[_0xf756('0x25')](_0x39f35e[_0xf756('0x26')]);if(_0x39f35e['name']){delete _0x39f35e[_0xf756('0x27')];}_0x1f1d98[_0xf756('0x19')](_0x7a90a7)[_0xf756('0x28')](_0x39f35e);};}exports[_0xf756('0x29')]=function(_0x542a47,_0x172958){var _0x901768={},_0x1aeb63={},_0x968427={'count':0x0,'rows':[]};var _0x5d9475=_[_0xf756('0x2a')](db[_0xf756('0x2b')][_0xf756('0x2c')],function(_0x3ac597){return{'name':_0x3ac597[_0xf756('0x2d')],'type':_0x3ac597[_0xf756('0x2e')]['key']};});_0x1aeb63[_0xf756('0x2f')]=_['map'](_0x5d9475,_0xf756('0x27'));_0x1aeb63[_0xf756('0x30')]=_[_0xf756('0x31')](_0x542a47['query']);_0x1aeb63[_0xf756('0x32')]=_[_0xf756('0x33')](_0x1aeb63[_0xf756('0x2f')],_0x1aeb63[_0xf756('0x30')]);_0x901768[_0xf756('0x34')]=_[_0xf756('0x33')](_0x1aeb63[_0xf756('0x2f')],qs[_0xf756('0x35')](_0x542a47[_0xf756('0x30')][_0xf756('0x35')]));_0x901768['attributes']=_0x901768[_0xf756('0x34')][_0xf756('0x36')]?_0x901768[_0xf756('0x34')]:_0x1aeb63[_0xf756('0x2f')];if(!_0x542a47['query'][_0xf756('0x37')](_0xf756('0x38'))){_0x901768[_0xf756('0x1d')]=qs[_0xf756('0x1d')](_0x542a47[_0xf756('0x30')][_0xf756('0x1d')]);_0x901768[_0xf756('0x1c')]=qs[_0xf756('0x1c')](_0x542a47['query']['offset']);}_0x901768[_0xf756('0x39')]=qs['sort'](_0x542a47[_0xf756('0x30')][_0xf756('0x3a')]);_0x901768['where']=qs[_0xf756('0x32')](_[_0xf756('0x3b')](_0x542a47['query'],_0x1aeb63[_0xf756('0x32')]),_0x5d9475);if(_0x542a47[_0xf756('0x30')]['filter']){_0x901768[_0xf756('0x3c')]=_[_0xf756('0x3d')](_0x901768[_0xf756('0x3c')],{'$or':_[_0xf756('0x2a')](_0x5d9475,function(_0x242938){if(_0x242938[_0xf756('0x2e')]!=='VIRTUAL'){var _0x4f1fad={};_0x4f1fad[_0x242938[_0xf756('0x27')]]={'$like':'%'+_0x542a47[_0xf756('0x30')][_0xf756('0x3e')]+'%'};return _0x4f1fad;}})});}_0x901768=_[_0xf756('0x3d')]({},_0x901768,_0x542a47[_0xf756('0x3f')]);var _0x3e7fac={'where':_0x901768[_0xf756('0x3c')]};return db['FreshsalesField'][_0xf756('0x1e')](_0x3e7fac)['then'](function(_0x681a3a){_0x968427[_0xf756('0x1e')]=_0x681a3a;if(_0x542a47[_0xf756('0x30')][_0xf756('0x40')]){_0x901768[_0xf756('0x41')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x901768);})[_0xf756('0x24')](function(_0x18400b){_0x968427[_0xf756('0x42')]=_0x18400b;return _0x968427;})[_0xf756('0x24')](respondWithFilteredResult(_0x172958,_0x901768))[_0xf756('0x43')](handleError(_0x172958,null));};exports[_0xf756('0x44')]=function(_0x145104,_0x1e8880){var _0x558e59={'raw':!![],'where':{'id':_0x145104[_0xf756('0x45')]['id']}},_0x1163eb={};_0x1163eb[_0xf756('0x2f')]=_[_0xf756('0x31')](db[_0xf756('0x2b')]['rawAttributes']);_0x1163eb[_0xf756('0x30')]=_[_0xf756('0x31')](_0x145104[_0xf756('0x30')]);_0x1163eb[_0xf756('0x32')]=_[_0xf756('0x33')](_0x1163eb[_0xf756('0x2f')],_0x1163eb[_0xf756('0x30')]);_0x558e59['attributes']=_['intersection'](_0x1163eb[_0xf756('0x2f')],qs[_0xf756('0x35')](_0x145104[_0xf756('0x30')][_0xf756('0x35')]));_0x558e59[_0xf756('0x34')]=_0x558e59[_0xf756('0x34')][_0xf756('0x36')]?_0x558e59[_0xf756('0x34')]:_0x1163eb[_0xf756('0x2f')];if(_0x145104[_0xf756('0x30')][_0xf756('0x40')]){_0x558e59[_0xf756('0x41')]=[{'all':!![]}];}_0x558e59=_[_0xf756('0x3d')]({},_0x558e59,_0x145104[_0xf756('0x3f')]);return db['FreshsalesField'][_0xf756('0x46')](_0x558e59)[_0xf756('0x24')](handleEntityNotFound(_0x1e8880,null))[_0xf756('0x24')](respondWithResult(_0x1e8880,null))['catch'](handleError(_0x1e8880,null));};exports[_0xf756('0x47')]=function(_0x401131,_0x5b99bc){return db[_0xf756('0x2b')][_0xf756('0x47')](_0x401131[_0xf756('0x48')],{})[_0xf756('0x24')](respondWithResult(_0x5b99bc,0xc9))['catch'](handleError(_0x5b99bc,null));};exports[_0xf756('0x49')]=function(_0x2eb92f,_0xd69939){if(_0x2eb92f['body']['id']){delete _0x2eb92f['body']['id'];}return db[_0xf756('0x2b')][_0xf756('0x46')]({'where':{'id':_0x2eb92f[_0xf756('0x45')]['id']}})[_0xf756('0x24')](handleEntityNotFound(_0xd69939,null))[_0xf756('0x24')](saveUpdates(_0x2eb92f[_0xf756('0x48')],null))['then'](respondWithResult(_0xd69939,null))[_0xf756('0x43')](handleError(_0xd69939,null));};exports[_0xf756('0x23')]=function(_0x3ec293,_0x4739d0){return db[_0xf756('0x2b')]['find']({'where':{'id':_0x3ec293[_0xf756('0x45')]['id']}})[_0xf756('0x24')](handleEntityNotFound(_0x4739d0,null))[_0xf756('0x24')](removeEntity(_0x4739d0,null))[_0xf756('0x43')](handleError(_0x4739d0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 63c03fd..390960d 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 _0xb44a=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','../../config/logger','moment','path','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x2cb70d,_0x7336a7){var _0x231c53=function(_0x4bc0a2){while(--_0x4bc0a2){_0x2cb70d['push'](_0x2cb70d['shift']());}};_0x231c53(++_0x7336a7);}(_0xb44a,0x1c2));var _0xab44=function(_0x54daf5,_0x528643){_0x54daf5=_0x54daf5-0x0;var _0xf70158=_0xb44a[_0x54daf5];return _0xf70158;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'paranoid':![],'indexes':[{'name':_0xab44('0x9'),'fields':[_0xab44('0xa'),_0xab44('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x110f=['freshsales_unique_index','FieldId','lodash','util','bluebird','path','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields'];(function(_0x5a5113,_0x1c008b){var _0x16a596=function(_0x2726d8){while(--_0x2726d8){_0x5a5113['push'](_0x5a5113['shift']());}};_0x16a596(++_0x1c008b);}(_0x110f,0x1e6));var _0xf110=function(_0x3e17df,_0x1922dd){_0x3e17df=_0x3e17df-0x0;var _0x2decc1=_0x110f[_0x3e17df];return _0x2decc1;};'use strict';var _=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf110('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf110('0x3'));var rimraf=require(_0xf110('0x4'));var config=require(_0xf110('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0xf110('0x6')]=function(_0x3147fd,_0xc27675){return _0x3147fd['define'](_0xf110('0x7'),attributes,{'tableName':_0xf110('0x8'),'paranoid':![],'indexes':[{'name':_0xf110('0x9'),'fields':['idField',_0xf110('0xa')],'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 a360371..75df31f 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 _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3040a5,_0x23489a){var _0x4a977f=function(_0x4823bd){while(--_0x4823bd){_0x3040a5['push'](_0x3040a5['shift']());}};_0x4a977f(++_0x23489a);}(_0x1623,0xab));var _0x3162=function(_0x36b98e,_0x2ab900){_0x36b98e=_0x36b98e-0x0;var _0x5c4e4f=_0x1623[_0x36b98e];return _0x5c4e4f;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file +var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18e737,_0x4dbe54){var _0x24955b=function(_0x4282c9){while(--_0x4282c9){_0x18e737['push'](_0x18e737['shift']());}};_0x24955b(++_0x4dbe54);}(_0x1623,0xab));var _0x3162=function(_0x5c12ed,_0x178d37){_0x5c12ed=_0x5c12ed-0x0;var _0x7985c6=_0x1623[_0x5c12ed];return _0x7985c6;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 1db5eba..b9ac4db 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(_0x31eda4,_0x199e1b){var _0xe1f350=function(_0xf38084){while(--_0xf38084){_0x31eda4['push'](_0x31eda4['shift']());}};_0xe1f350(++_0x199e1b);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x1f4f64,_0x8ec8a6){var _0x3ae24a=function(_0x31429b){while(--_0x31429b){_0x1f4f64['push'](_0x1f4f64['shift']());}};_0x3ae24a(++_0x8ec8a6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0268bb7..322198c 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 _0x9e9f=['exports','STRING','username','integrationTab','newTab','sequelize'];(function(_0x197384,_0xdb6bb){var _0x33cce7=function(_0x220d58){while(--_0x220d58){_0x197384['push'](_0x197384['shift']());}};_0x33cce7(++_0xdb6bb);}(_0x9e9f,0x1cd));var _0xf9e9=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x9e9f[_0x4099ee];return _0x1b7bfc;};'use strict';var Sequelize=require(_0xf9e9('0x0'));module[_0xf9e9('0x1')]={'name':{'type':Sequelize[_0xf9e9('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xf9e9('0x3')},'remoteUri':{'type':Sequelize[_0xf9e9('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xf9e9('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf9e9('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf9e9('0x4'),_0xf9e9('0x5')),'defaultValue':_0xf9e9('0x4')}}; \ No newline at end of file +var _0xbd5d=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xbd5d,0x118));var _0xdbd5=function(_0x4b4cb5,_0x5916db){_0x4b4cb5=_0x4b4cb5-0x0;var _0x4fb22e=_0xbd5d[_0x4b4cb5];return _0x4fb22e;};'use strict';var Sequelize=require(_0xdbd5('0x0'));module[_0xdbd5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdbd5('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xdbd5('0x2')]},'password':{'type':Sequelize[_0xdbd5('0x2')]},'clientId':{'type':Sequelize[_0xdbd5('0x2')]},'clientSecret':{'type':Sequelize[_0xdbd5('0x2')]},'securityToken':{'type':Sequelize[_0xdbd5('0x2')]},'serverUrl':{'type':Sequelize[_0xdbd5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdbd5('0x3')](_0xdbd5('0x4'),_0xdbd5('0x5')),'defaultValue':_0xdbd5('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 83f593b..918cf0d 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 _0xfac0=['order','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','catch','params','SalesforceAccount','include','create','body','find','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','login','concat','securityToken','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Description','picklist','phone','remove','includes','label','custom','value','boolean','true','False','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1f7996,_0x299a14){var _0x584609=function(_0x14c34a){while(--_0x14c34a){_0x1f7996['push'](_0x1f7996['shift']());}};_0x584609(++_0x299a14);}(_0xfac0,0xb0));var _0x0fac=function(_0x2d0ef2,_0x194a92){_0x2d0ef2=_0x2d0ef2-0x0;var _0xf8937d=_0xfac0[_0x2d0ef2];return _0xf8937d;};'use strict';var emlformat=require(_0x0fac('0x0'));var rimraf=require(_0x0fac('0x1'));var zipdir=require(_0x0fac('0x2'));var jsonpatch=require(_0x0fac('0x3'));var rp=require(_0x0fac('0x4'));var moment=require(_0x0fac('0x5'));var BPromise=require(_0x0fac('0x6'));var Mustache=require('mustache');var util=require(_0x0fac('0x7'));var path=require(_0x0fac('0x8'));var sox=require(_0x0fac('0x9'));var csv=require('to-csv');var ejs=require(_0x0fac('0xa'));var fs=require('fs');var fs_extra=require(_0x0fac('0xb'));var _=require(_0x0fac('0xc'));var squel=require('squel');var crypto=require(_0x0fac('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0fac('0xe'));var toCsv=require(_0x0fac('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0fac('0x10'));var authService=require(_0x0fac('0x11'));var qs=require(_0x0fac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fac('0x13'));var logger=require('../../config/logger')(_0x0fac('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0fac('0x15'));var db=require(_0x0fac('0x16'))['db'];var integrations=require(_0x0fac('0x17'));function respondWithStatusCode(_0x46ccdd,_0x174b6a){_0x174b6a=_0x174b6a||0xcc;return function(_0x5d6b72){if(_0x5d6b72){return _0x46ccdd[_0x0fac('0x18')](_0x174b6a);}return _0x46ccdd[_0x0fac('0x19')](_0x174b6a)['end']();};}function respondWithResult(_0x38b3e0,_0x3091c7){_0x3091c7=_0x3091c7||0xc8;return function(_0x2707e4){if(_0x2707e4){return _0x38b3e0['status'](_0x3091c7)['json'](_0x2707e4);}};}function respondWithFilteredResult(_0xebbc09,_0x111b7d){return function(_0x492c57){if(_0x492c57){var _0x4178ee=typeof _0x111b7d[_0x0fac('0x1a')]===_0x0fac('0x1b')&&typeof _0x111b7d['limit']==='undefined';var _0x154db7=_0x492c57[_0x0fac('0x1c')];var _0x264c8e=_0x4178ee?0x0:_0x111b7d[_0x0fac('0x1a')];var _0x4e7e3a=_0x4178ee?_0x492c57[_0x0fac('0x1c')]:_0x111b7d['offset']+_0x111b7d[_0x0fac('0x1d')];var _0x6bc907;if(_0x4e7e3a>=_0x154db7){_0x4e7e3a=_0x154db7;_0x6bc907=0xc8;}else{_0x6bc907=0xce;}_0xebbc09['status'](_0x6bc907);return _0xebbc09[_0x0fac('0x1e')]('Content-Range',_0x264c8e+'-'+_0x4e7e3a+'/'+_0x154db7)['json'](_0x492c57);}return null;};}function patchUpdates(_0x3dee88){return function(_0x31fb44){try{jsonpatch[_0x0fac('0x1f')](_0x31fb44,_0x3dee88,!![]);}catch(_0x177b6c){return BPromise[_0x0fac('0x20')](_0x177b6c);}return _0x31fb44['save']();};}function saveUpdates(_0x541595,_0x75d8eb){return function(_0x285fcb){if(_0x285fcb){return _0x285fcb[_0x0fac('0x21')](_0x541595)['then'](function(_0x17729d){return _0x17729d;});}return null;};}function removeEntity(_0x59629a,_0x5f44a4){return function(_0x8f7ceb){if(_0x8f7ceb){return _0x8f7ceb[_0x0fac('0x22')]()[_0x0fac('0x23')](function(){_0x59629a['status'](0xcc)[_0x0fac('0x24')]();});}};}function handleEntityNotFound(_0x1c1ece,_0xd1ddc1){return function(_0x5ac19c){if(!_0x5ac19c){_0x1c1ece[_0x0fac('0x18')](0x194);}return _0x5ac19c;};}function handleError(_0x112fba,_0x539352){_0x539352=_0x539352||0x1f4;return function(_0x2e2a49){logger[_0x0fac('0x25')](_0x2e2a49[_0x0fac('0x26')]);if(_0x2e2a49['name']){delete _0x2e2a49[_0x0fac('0x27')];}_0x112fba['status'](_0x539352)[_0x0fac('0x28')](_0x2e2a49);};}exports[_0x0fac('0x29')]=function(_0x13fe6a,_0x5eae89){var _0x4a3382={},_0xab21eb={},_0x5bc3b8={'count':0x0,'rows':[]};var _0x4969ba=_[_0x0fac('0x2a')](db['SalesforceAccount'][_0x0fac('0x2b')],function(_0x463828){return{'name':_0x463828[_0x0fac('0x2c')],'type':_0x463828[_0x0fac('0x2d')]['key']};});_0xab21eb[_0x0fac('0x2e')]=_['map'](_0x4969ba,_0x0fac('0x27'));_0xab21eb['query']=_[_0x0fac('0x2f')](_0x13fe6a[_0x0fac('0x30')]);_0xab21eb[_0x0fac('0x31')]=_[_0x0fac('0x32')](_0xab21eb['model'],_0xab21eb['query']);_0x4a3382[_0x0fac('0x33')]=_[_0x0fac('0x32')](_0xab21eb[_0x0fac('0x2e')],qs[_0x0fac('0x34')](_0x13fe6a['query'][_0x0fac('0x34')]));_0x4a3382[_0x0fac('0x33')]=_0x4a3382['attributes'][_0x0fac('0x35')]?_0x4a3382['attributes']:_0xab21eb['model'];if(!_0x13fe6a[_0x0fac('0x30')][_0x0fac('0x36')](_0x0fac('0x37'))){_0x4a3382['limit']=qs['limit'](_0x13fe6a[_0x0fac('0x30')][_0x0fac('0x1d')]);_0x4a3382[_0x0fac('0x1a')]=qs[_0x0fac('0x1a')](_0x13fe6a[_0x0fac('0x30')]['offset']);}_0x4a3382[_0x0fac('0x38')]=qs[_0x0fac('0x39')](_0x13fe6a[_0x0fac('0x30')][_0x0fac('0x39')]);_0x4a3382[_0x0fac('0x3a')]=qs[_0x0fac('0x31')](_['pick'](_0x13fe6a[_0x0fac('0x30')],_0xab21eb[_0x0fac('0x31')]),_0x4969ba);if(_0x13fe6a[_0x0fac('0x30')]['filter']){_0x4a3382[_0x0fac('0x3a')]=_['merge'](_0x4a3382['where'],{'$or':_[_0x0fac('0x2a')](_0x4969ba,function(_0x7ab68a){if(_0x7ab68a['type']!==_0x0fac('0x3b')){var _0x31a696={};_0x31a696[_0x7ab68a['name']]={'$like':'%'+_0x13fe6a[_0x0fac('0x30')][_0x0fac('0x3c')]+'%'};return _0x31a696;}})});}_0x4a3382=_[_0x0fac('0x3d')]({},_0x4a3382,_0x13fe6a[_0x0fac('0x3e')]);var _0xc4ef75={'where':_0x4a3382[_0x0fac('0x3a')]};return db['SalesforceAccount']['count'](_0xc4ef75)[_0x0fac('0x23')](function(_0x2505f5){_0x5bc3b8[_0x0fac('0x1c')]=_0x2505f5;if(_0x13fe6a[_0x0fac('0x30')][_0x0fac('0x3f')]){_0x4a3382['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x0fac('0x40')](_0x4a3382);})[_0x0fac('0x23')](function(_0x5926b5){_0x5bc3b8['rows']=_0x5926b5;return _0x5bc3b8;})[_0x0fac('0x23')](respondWithFilteredResult(_0x5eae89,_0x4a3382))[_0x0fac('0x41')](handleError(_0x5eae89,null));};exports['show']=function(_0x2f025e,_0x5f5b82){var _0x3e0b99={'raw':![],'where':{'id':_0x2f025e[_0x0fac('0x42')]['id']}},_0x2fb3e9={};_0x2fb3e9[_0x0fac('0x2e')]=_[_0x0fac('0x2f')](db[_0x0fac('0x43')][_0x0fac('0x2b')]);_0x2fb3e9[_0x0fac('0x30')]=_[_0x0fac('0x2f')](_0x2f025e['query']);_0x2fb3e9[_0x0fac('0x31')]=_[_0x0fac('0x32')](_0x2fb3e9[_0x0fac('0x2e')],_0x2fb3e9[_0x0fac('0x30')]);_0x3e0b99[_0x0fac('0x33')]=_['intersection'](_0x2fb3e9[_0x0fac('0x2e')],qs[_0x0fac('0x34')](_0x2f025e[_0x0fac('0x30')][_0x0fac('0x34')]));_0x3e0b99[_0x0fac('0x33')]=_0x3e0b99['attributes'][_0x0fac('0x35')]?_0x3e0b99[_0x0fac('0x33')]:_0x2fb3e9[_0x0fac('0x2e')];if(_0x2f025e[_0x0fac('0x30')][_0x0fac('0x3f')]){_0x3e0b99[_0x0fac('0x44')]=[{'all':!![]}];}_0x3e0b99=_['merge']({},_0x3e0b99,_0x2f025e[_0x0fac('0x3e')]);return db[_0x0fac('0x43')]['find'](_0x3e0b99)[_0x0fac('0x23')](handleEntityNotFound(_0x5f5b82,null))[_0x0fac('0x23')](respondWithResult(_0x5f5b82,null))[_0x0fac('0x41')](handleError(_0x5f5b82,null));};exports[_0x0fac('0x45')]=function(_0x11afbe,_0x2bbbc0){return db[_0x0fac('0x43')]['create'](_0x11afbe[_0x0fac('0x46')],{})[_0x0fac('0x23')](respondWithResult(_0x2bbbc0,0xc9))[_0x0fac('0x41')](handleError(_0x2bbbc0,null));};exports['update']=function(_0x3ee95b,_0x581b8d){if(_0x3ee95b[_0x0fac('0x46')]['id']){delete _0x3ee95b['body']['id'];}return db[_0x0fac('0x43')][_0x0fac('0x47')]({'where':{'id':_0x3ee95b[_0x0fac('0x42')]['id']}})['then'](handleEntityNotFound(_0x581b8d,null))[_0x0fac('0x23')](saveUpdates(_0x3ee95b[_0x0fac('0x46')],null))[_0x0fac('0x23')](respondWithResult(_0x581b8d,null))[_0x0fac('0x41')](handleError(_0x581b8d,null));};exports[_0x0fac('0x22')]=function(_0x2b18cd,_0x1de1e1){return db[_0x0fac('0x43')][_0x0fac('0x47')]({'where':{'id':_0x2b18cd[_0x0fac('0x42')]['id']}})['then'](handleEntityNotFound(_0x1de1e1,null))[_0x0fac('0x23')](removeEntity(_0x1de1e1,null))['catch'](handleError(_0x1de1e1,null));};exports['getConfigurations']=function(_0x1d1d18,_0x5848d8,_0x361dcd){var _0x21cac5={};var _0x52912a={};var _0x36fbdc;var _0xaa435;return db['SalesforceAccount']['findOne']({'where':{'id':_0x1d1d18[_0x0fac('0x42')]['id']}})['then'](handleEntityNotFound(_0x5848d8,null))['then'](function(_0x4e0d3a){if(_0x4e0d3a){_0x36fbdc=_0x4e0d3a;_0x52912a[_0x0fac('0x2e')]=_[_0x0fac('0x2f')](db['SalesforceConfiguration'][_0x0fac('0x2b')]);_0x52912a[_0x0fac('0x30')]=_['keys'](_0x1d1d18[_0x0fac('0x30')]);_0x52912a[_0x0fac('0x31')]=_[_0x0fac('0x32')](_0x52912a[_0x0fac('0x2e')],_0x52912a[_0x0fac('0x30')]);_0x21cac5[_0x0fac('0x33')]=_[_0x0fac('0x32')](_0x52912a[_0x0fac('0x2e')],qs['fields'](_0x1d1d18[_0x0fac('0x30')][_0x0fac('0x34')]));_0x21cac5[_0x0fac('0x33')]=_0x21cac5[_0x0fac('0x33')]['length']?_0x21cac5[_0x0fac('0x33')]:_0x52912a[_0x0fac('0x2e')];_0x21cac5[_0x0fac('0x38')]=qs[_0x0fac('0x39')](_0x1d1d18[_0x0fac('0x30')][_0x0fac('0x39')]);_0x21cac5['where']=qs['filters'](_[_0x0fac('0x48')](_0x1d1d18['query'],_0x52912a[_0x0fac('0x31')]));if(_0x1d1d18[_0x0fac('0x30')][_0x0fac('0x3c')]){_0x21cac5['where']=_[_0x0fac('0x3d')](_0x21cac5[_0x0fac('0x3a')],{'$or':_[_0x0fac('0x2a')](_0x21cac5[_0x0fac('0x33')],function(_0x265d15){var _0x33b6de={};_0x33b6de[_0x265d15]={'$like':'%'+_0x1d1d18[_0x0fac('0x30')]['filter']+'%'};return _0x33b6de;})});}_0x21cac5=_['merge']({},_0x21cac5,_0x1d1d18[_0x0fac('0x3e')]);return _0x36fbdc[_0x0fac('0x49')](_0x21cac5);}})[_0x0fac('0x23')](function(_0x31a027){if(_0x31a027){_0xaa435=_0x31a027['length'];if(!_0x1d1d18[_0x0fac('0x30')][_0x0fac('0x36')](_0x0fac('0x37'))){_0x21cac5[_0x0fac('0x1d')]=qs[_0x0fac('0x1d')](_0x1d1d18[_0x0fac('0x30')][_0x0fac('0x1d')]);_0x21cac5[_0x0fac('0x1a')]=qs[_0x0fac('0x1a')](_0x1d1d18[_0x0fac('0x30')][_0x0fac('0x1a')]);}return _0x36fbdc['getConfigurations'](_0x21cac5);}})['then'](function(_0x2dcd31){if(_0x2dcd31){return _0x2dcd31?{'count':_0xaa435,'rows':_0x2dcd31}:null;}})[_0x0fac('0x23')](respondWithResult(_0x5848d8,null))[_0x0fac('0x41')](handleError(_0x5848d8,null));};exports[_0x0fac('0x4a')]=function(_0x3c7cc5,_0x28fcbc,_0x2bf35a){if(_0x3c7cc5[_0x0fac('0x46')]['id']){delete _0x3c7cc5['body']['id'];}return db[_0x0fac('0x43')][_0x0fac('0x4b')]({'where':{'id':_0x3c7cc5[_0x0fac('0x42')]['id']}})[_0x0fac('0x23')](handleEntityNotFound(_0x28fcbc,null))[_0x0fac('0x23')](function(_0x14f5cb){if(_0x14f5cb){_0x3c7cc5[_0x0fac('0x46')][_0x0fac('0x4c')]=_0x14f5cb['id'];_0x3c7cc5[_0x0fac('0x46')][_0x0fac('0x4d')]=integrations['getSubjects'](_0x3c7cc5['body'][_0x0fac('0x4e')],_0x3c7cc5['body'][_0x0fac('0x2d')]);_0x3c7cc5[_0x0fac('0x46')][_0x0fac('0x4f')]=integrations['getDescriptions'](_0x3c7cc5[_0x0fac('0x46')][_0x0fac('0x4e')],_0x3c7cc5[_0x0fac('0x46')][_0x0fac('0x2d')]);return db['SalesforceConfiguration']['create'](_0x3c7cc5[_0x0fac('0x46')],{'include':[{'model':db[_0x0fac('0x50')],'as':_0x0fac('0x4d')},{'model':db['SalesforceField'],'as':_0x0fac('0x4f')}]});}return null;})['then'](respondWithResult(_0x28fcbc,null))[_0x0fac('0x41')](handleError(_0x28fcbc,null));};exports['getFields']=function(_0x2bb87a,_0x2963ad,_0x1afbcf){var _0x5e54c0;var _0x307a96='';var _0x4de826=_0x0fac('0x51');return db[_0x0fac('0x43')]['findOne']({'where':{'id':_0x2bb87a[_0x0fac('0x42')]['id']},'attributes':['id',_0x0fac('0x52'),_0x0fac('0x53'),_0x0fac('0x54'),_0x0fac('0x55'),_0x0fac('0x56'),'securityToken']})[_0x0fac('0x23')](handleEntityNotFound(_0x2963ad,null))[_0x0fac('0x23')](function(_0x42df23){if(_0x42df23){_0x307a96=_0x42df23[_0x0fac('0x52')];var _0x196063=_0x307a96[_0x0fac('0x57')](-0x1);if(_0x196063==='/'){_0x307a96=_0x307a96[_0x0fac('0x58')](0x0,_0x307a96[_0x0fac('0x59')](_0x196063));}_0x5e54c0=new jsforce['Connection']({'oauth2':{'loginUrl':_0x307a96,'clientId':_0x42df23[_0x0fac('0x53')],'clientSecret':_0x42df23['clientSecret']}});return _0x5e54c0[_0x0fac('0x5a')](_0x42df23['username'],_0x42df23['password'][_0x0fac('0x5b')](_0x42df23[_0x0fac('0x5c')]));}})[_0x0fac('0x23')](function(_0x157256){if(_0x157256){if(!_[_0x0fac('0x5d')](_0x2bb87a[_0x0fac('0x30')][_0x0fac('0x5e')])){_0x4de826=_0x2bb87a[_0x0fac('0x30')]['ticketType'];}return _0x5e54c0[_0x0fac('0x5f')](_0x4de826)[_0x0fac('0x60')]();}})[_0x0fac('0x23')](function(_0x16bf3c){var _0x3e4c92=['OwnerId',_0x0fac('0x61'),_0x0fac('0x62'),_0x0fac('0x63'),'Subject',_0x0fac('0x64')];var _0x5600d5=['string','int',_0x0fac('0x65'),'boolean','email','textarea',_0x0fac('0x66')];if(_0x16bf3c){_[_0x0fac('0x67')](_0x16bf3c[_0x0fac('0x34')],function(_0x309c18){return _0x3e4c92[_0x0fac('0x68')](_0x309c18[_0x0fac('0x27')])||!_0x5600d5[_0x0fac('0x68')](_0x309c18[_0x0fac('0x2d')]);});return{'count':_0x16bf3c['fields'][_0x0fac('0x35')],'rows':_['map'](_0x16bf3c[_0x0fac('0x34')],function(_0x164c6e){return{'id':_0x164c6e[_0x0fac('0x27')],'name':_0x164c6e[_0x0fac('0x69')],'custom':_0x164c6e[_0x0fac('0x6a')],'options':_0x164c6e['picklistValues'][_0x0fac('0x35')]>0x0?_[_0x0fac('0x2a')](_0x164c6e['picklistValues'],function(_0x1bc76e){return{'name':_0x1bc76e['label'],'value':_0x1bc76e[_0x0fac('0x6b')]};}):_0x164c6e[_0x0fac('0x2d')]==_0x0fac('0x6c')?[{'name':'True','value':_0x0fac('0x6d')},{'name':_0x0fac('0x6e'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x2963ad,null))[_0x0fac('0x41')](function(_0x2bb73a){var _0x5297a1=_0x2bb87a[_0x0fac('0x30')][_0x0fac('0x6f')]?0x1f4:_0x2bb73a['statusCode']||0x1f4;logger['error'](_0x0fac('0x70'),_0x0fac('0x71'),_0x5297a1,JSON['stringify'](_0x2bb73a));delete _0x2bb73a['name'];if(_0x5297a1===0x191){_0x5297a1=0x190;}_0x2963ad[_0x0fac('0x19')](_0x5297a1)[_0x0fac('0x28')](_0x2bb87a[_0x0fac('0x30')][_0x0fac('0x6f')]?{'message':_0x0fac('0x72'),'statusCode':_0x2bb73a[_0x0fac('0x73')]}:_0x2bb73a);});}; \ No newline at end of file +var _0x7e0b=['util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','rawAttributes','options','find','catch','create','body','params','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','remoteUri','clientId','username','password','securityToken','slice','substring','Connection','clientSecret','concat','isNil','ticketType','sobject','OwnerId','Subject','Description','int','picklist','email','textarea','remove','includes','custom','picklistValues','label','boolean','True','true','False','false','test','statusCode','getFields','stringify','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x502661,_0x2c112f){var _0x37dc28=function(_0x2a05d5){while(--_0x2a05d5){_0x502661['push'](_0x502661['shift']());}};_0x37dc28(++_0x2c112f);}(_0x7e0b,0xeb));var _0xb7e0=function(_0x330955,_0x434849){_0x330955=_0x330955-0x0;var _0x4e7e9e=_0x7e0b[_0x330955];return _0x4e7e9e;};'use strict';var emlformat=require(_0xb7e0('0x0'));var rimraf=require(_0xb7e0('0x1'));var zipdir=require(_0xb7e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7e0('0x3'));var moment=require('moment');var BPromise=require(_0xb7e0('0x4'));var Mustache=require('mustache');var util=require(_0xb7e0('0x5'));var path=require(_0xb7e0('0x6'));var sox=require(_0xb7e0('0x7'));var csv=require(_0xb7e0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7e0('0x9'));var _=require(_0xb7e0('0xa'));var squel=require(_0xb7e0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb7e0('0xc'));var toCsv=require(_0xb7e0('0x8'));var querystring=require(_0xb7e0('0xd'));var Papa=require(_0xb7e0('0xe'));var Redis=require(_0xb7e0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb7e0('0x10'));var as=require(_0xb7e0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7e0('0x12'))(_0xb7e0('0x13'));var utils=require(_0xb7e0('0x14'));var config=require(_0xb7e0('0x15'));var licenseUtil=require(_0xb7e0('0x16'));var db=require(_0xb7e0('0x17'))['db'];var integrations=require(_0xb7e0('0x18'));function respondWithStatusCode(_0x2a2660,_0x46c925){_0x46c925=_0x46c925||0xcc;return function(_0x49c7ad){if(_0x49c7ad){return _0x2a2660[_0xb7e0('0x19')](_0x46c925);}return _0x2a2660[_0xb7e0('0x1a')](_0x46c925)[_0xb7e0('0x1b')]();};}function respondWithResult(_0x359703,_0x4e0389){_0x4e0389=_0x4e0389||0xc8;return function(_0x5cdb03){if(_0x5cdb03){return _0x359703[_0xb7e0('0x1a')](_0x4e0389)['json'](_0x5cdb03);}};}function respondWithFilteredResult(_0xfb7e85,_0x538a07){return function(_0x3d63bd){if(_0x3d63bd){var _0x3f0926=typeof _0x538a07[_0xb7e0('0x1c')]===_0xb7e0('0x1d')&&typeof _0x538a07[_0xb7e0('0x1e')]==='undefined';var _0x39df90=_0x3d63bd[_0xb7e0('0x1f')];var _0xcbdbe3=_0x3f0926?0x0:_0x538a07[_0xb7e0('0x1c')];var _0x30ad72=_0x3f0926?_0x3d63bd[_0xb7e0('0x1f')]:_0x538a07[_0xb7e0('0x1c')]+_0x538a07[_0xb7e0('0x1e')];var _0x22b7ac;if(_0x30ad72>=_0x39df90){_0x30ad72=_0x39df90;_0x22b7ac=0xc8;}else{_0x22b7ac=0xce;}_0xfb7e85[_0xb7e0('0x1a')](_0x22b7ac);return _0xfb7e85[_0xb7e0('0x20')](_0xb7e0('0x21'),_0xcbdbe3+'-'+_0x30ad72+'/'+_0x39df90)[_0xb7e0('0x22')](_0x3d63bd);}return null;};}function patchUpdates(_0x316998){return function(_0x30c49a){try{jsonpatch[_0xb7e0('0x23')](_0x30c49a,_0x316998,!![]);}catch(_0x2014c3){return BPromise[_0xb7e0('0x24')](_0x2014c3);}return _0x30c49a[_0xb7e0('0x25')]();};}function saveUpdates(_0x5e0c06,_0x2e78e6){return function(_0x1e3d6d){if(_0x1e3d6d){return _0x1e3d6d['update'](_0x5e0c06)[_0xb7e0('0x26')](function(_0x515771){return _0x515771;});}return null;};}function removeEntity(_0x3aad54,_0x39a145){return function(_0x330e40){if(_0x330e40){return _0x330e40['destroy']()[_0xb7e0('0x26')](function(){_0x3aad54[_0xb7e0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9948f5,_0x2e4866){return function(_0x211753){if(!_0x211753){_0x9948f5[_0xb7e0('0x19')](0x194);}return _0x211753;};}function handleError(_0x598c41,_0x1eff37){_0x1eff37=_0x1eff37||0x1f4;return function(_0x2f151f){logger[_0xb7e0('0x27')](_0x2f151f[_0xb7e0('0x28')]);if(_0x2f151f[_0xb7e0('0x29')]){delete _0x2f151f[_0xb7e0('0x29')];}_0x598c41['status'](_0x1eff37)[_0xb7e0('0x2a')](_0x2f151f);};}exports['index']=function(_0x5c0075,_0x1fb910){var _0xb11174={},_0x152e0f={},_0x619728={'count':0x0,'rows':[]};var _0x31b676=_[_0xb7e0('0x2b')](db[_0xb7e0('0x2c')]['rawAttributes'],function(_0x44aa07){return{'name':_0x44aa07[_0xb7e0('0x2d')],'type':_0x44aa07[_0xb7e0('0x2e')][_0xb7e0('0x2f')]};});_0x152e0f[_0xb7e0('0x30')]=_[_0xb7e0('0x2b')](_0x31b676,_0xb7e0('0x29'));_0x152e0f[_0xb7e0('0x31')]=_[_0xb7e0('0x32')](_0x5c0075['query']);_0x152e0f[_0xb7e0('0x33')]=_[_0xb7e0('0x34')](_0x152e0f[_0xb7e0('0x30')],_0x152e0f[_0xb7e0('0x31')]);_0xb11174[_0xb7e0('0x35')]=_[_0xb7e0('0x34')](_0x152e0f[_0xb7e0('0x30')],qs[_0xb7e0('0x36')](_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x36')]));_0xb11174[_0xb7e0('0x35')]=_0xb11174['attributes'][_0xb7e0('0x37')]?_0xb11174['attributes']:_0x152e0f[_0xb7e0('0x30')];if(!_0x5c0075['query'][_0xb7e0('0x38')](_0xb7e0('0x39'))){_0xb11174[_0xb7e0('0x1e')]=qs[_0xb7e0('0x1e')](_0x5c0075['query'][_0xb7e0('0x1e')]);_0xb11174[_0xb7e0('0x1c')]=qs['offset'](_0x5c0075[_0xb7e0('0x31')]['offset']);}_0xb11174[_0xb7e0('0x3a')]=qs[_0xb7e0('0x3b')](_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x3b')]);_0xb11174['where']=qs['filters'](_['pick'](_0x5c0075[_0xb7e0('0x31')],_0x152e0f[_0xb7e0('0x33')]),_0x31b676);if(_0x5c0075['query'][_0xb7e0('0x3c')]){_0xb11174[_0xb7e0('0x3d')]=_[_0xb7e0('0x3e')](_0xb11174[_0xb7e0('0x3d')],{'$or':_[_0xb7e0('0x2b')](_0x31b676,function(_0x2e7e82){if(_0x2e7e82[_0xb7e0('0x2e')]!==_0xb7e0('0x3f')){var _0x388ebe={};_0x388ebe[_0x2e7e82[_0xb7e0('0x29')]]={'$like':'%'+_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x3c')]+'%'};return _0x388ebe;}})});}_0xb11174=_[_0xb7e0('0x3e')]({},_0xb11174,_0x5c0075['options']);var _0x264ceb={'where':_0xb11174[_0xb7e0('0x3d')]};return db[_0xb7e0('0x2c')][_0xb7e0('0x1f')](_0x264ceb)[_0xb7e0('0x26')](function(_0xbb5571){_0x619728[_0xb7e0('0x1f')]=_0xbb5571;if(_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x40')]){_0xb11174[_0xb7e0('0x41')]=[{'all':!![]}];}return db[_0xb7e0('0x2c')][_0xb7e0('0x42')](_0xb11174);})[_0xb7e0('0x26')](function(_0x25a274){_0x619728[_0xb7e0('0x43')]=_0x25a274;return _0x619728;})['then'](respondWithFilteredResult(_0x1fb910,_0xb11174))['catch'](handleError(_0x1fb910,null));};exports['show']=function(_0x3d908e,_0x214884){var _0x57c92f={'raw':![],'where':{'id':_0x3d908e['params']['id']}},_0x4328bf={};_0x4328bf[_0xb7e0('0x30')]=_[_0xb7e0('0x32')](db['SalesforceAccount'][_0xb7e0('0x44')]);_0x4328bf['query']=_['keys'](_0x3d908e[_0xb7e0('0x31')]);_0x4328bf[_0xb7e0('0x33')]=_[_0xb7e0('0x34')](_0x4328bf[_0xb7e0('0x30')],_0x4328bf[_0xb7e0('0x31')]);_0x57c92f[_0xb7e0('0x35')]=_[_0xb7e0('0x34')](_0x4328bf['model'],qs['fields'](_0x3d908e['query'][_0xb7e0('0x36')]));_0x57c92f[_0xb7e0('0x35')]=_0x57c92f[_0xb7e0('0x35')][_0xb7e0('0x37')]?_0x57c92f[_0xb7e0('0x35')]:_0x4328bf[_0xb7e0('0x30')];if(_0x3d908e[_0xb7e0('0x31')][_0xb7e0('0x40')]){_0x57c92f[_0xb7e0('0x41')]=[{'all':!![]}];}_0x57c92f=_[_0xb7e0('0x3e')]({},_0x57c92f,_0x3d908e[_0xb7e0('0x45')]);return db[_0xb7e0('0x2c')][_0xb7e0('0x46')](_0x57c92f)[_0xb7e0('0x26')](handleEntityNotFound(_0x214884,null))[_0xb7e0('0x26')](respondWithResult(_0x214884,null))[_0xb7e0('0x47')](handleError(_0x214884,null));};exports['create']=function(_0x3fe820,_0x254297){return db[_0xb7e0('0x2c')][_0xb7e0('0x48')](_0x3fe820['body'],{})[_0xb7e0('0x26')](respondWithResult(_0x254297,0xc9))[_0xb7e0('0x47')](handleError(_0x254297,null));};exports['update']=function(_0x45b770,_0x198ddd){if(_0x45b770[_0xb7e0('0x49')]['id']){delete _0x45b770['body']['id'];}return db[_0xb7e0('0x2c')]['find']({'where':{'id':_0x45b770[_0xb7e0('0x4a')]['id']}})[_0xb7e0('0x26')](handleEntityNotFound(_0x198ddd,null))[_0xb7e0('0x26')](saveUpdates(_0x45b770['body'],null))[_0xb7e0('0x26')](respondWithResult(_0x198ddd,null))['catch'](handleError(_0x198ddd,null));};exports['destroy']=function(_0x56766b,_0x4a9fbf){return db['SalesforceAccount']['find']({'where':{'id':_0x56766b[_0xb7e0('0x4a')]['id']}})[_0xb7e0('0x26')](handleEntityNotFound(_0x4a9fbf,null))['then'](removeEntity(_0x4a9fbf,null))[_0xb7e0('0x47')](handleError(_0x4a9fbf,null));};exports[_0xb7e0('0x4b')]=function(_0x304db5,_0x4a1b56,_0x1f0a7f){var _0x440cb8={};var _0x1fe25a={};var _0x1de893;var _0x74a6ef;return db[_0xb7e0('0x2c')][_0xb7e0('0x4c')]({'where':{'id':_0x304db5[_0xb7e0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a1b56,null))['then'](function(_0xdc3c97){if(_0xdc3c97){_0x1de893=_0xdc3c97;_0x1fe25a['model']=_[_0xb7e0('0x32')](db['SalesforceConfiguration'][_0xb7e0('0x44')]);_0x1fe25a[_0xb7e0('0x31')]=_['keys'](_0x304db5[_0xb7e0('0x31')]);_0x1fe25a[_0xb7e0('0x33')]=_[_0xb7e0('0x34')](_0x1fe25a[_0xb7e0('0x30')],_0x1fe25a[_0xb7e0('0x31')]);_0x440cb8[_0xb7e0('0x35')]=_[_0xb7e0('0x34')](_0x1fe25a[_0xb7e0('0x30')],qs[_0xb7e0('0x36')](_0x304db5['query'][_0xb7e0('0x36')]));_0x440cb8['attributes']=_0x440cb8[_0xb7e0('0x35')][_0xb7e0('0x37')]?_0x440cb8['attributes']:_0x1fe25a[_0xb7e0('0x30')];_0x440cb8['order']=qs[_0xb7e0('0x3b')](_0x304db5[_0xb7e0('0x31')]['sort']);_0x440cb8['where']=qs[_0xb7e0('0x33')](_[_0xb7e0('0x4d')](_0x304db5[_0xb7e0('0x31')],_0x1fe25a[_0xb7e0('0x33')]));if(_0x304db5[_0xb7e0('0x31')][_0xb7e0('0x3c')]){_0x440cb8[_0xb7e0('0x3d')]=_[_0xb7e0('0x3e')](_0x440cb8[_0xb7e0('0x3d')],{'$or':_[_0xb7e0('0x2b')](_0x440cb8['attributes'],function(_0x5997e6){var _0x4d70e3={};_0x4d70e3[_0x5997e6]={'$like':'%'+_0x304db5[_0xb7e0('0x31')][_0xb7e0('0x3c')]+'%'};return _0x4d70e3;})});}_0x440cb8=_[_0xb7e0('0x3e')]({},_0x440cb8,_0x304db5[_0xb7e0('0x45')]);return _0x1de893[_0xb7e0('0x4b')](_0x440cb8);}})[_0xb7e0('0x26')](function(_0x1967a8){if(_0x1967a8){_0x74a6ef=_0x1967a8[_0xb7e0('0x37')];if(!_0x304db5['query'][_0xb7e0('0x38')](_0xb7e0('0x39'))){_0x440cb8[_0xb7e0('0x1e')]=qs[_0xb7e0('0x1e')](_0x304db5['query']['limit']);_0x440cb8[_0xb7e0('0x1c')]=qs['offset'](_0x304db5[_0xb7e0('0x31')][_0xb7e0('0x1c')]);}return _0x1de893[_0xb7e0('0x4b')](_0x440cb8);}})[_0xb7e0('0x26')](function(_0x25bd6f){if(_0x25bd6f){return _0x25bd6f?{'count':_0x74a6ef,'rows':_0x25bd6f}:null;}})[_0xb7e0('0x26')](respondWithResult(_0x4a1b56,null))['catch'](handleError(_0x4a1b56,null));};exports[_0xb7e0('0x4e')]=function(_0x700a52,_0x546159,_0xabdf90){if(_0x700a52[_0xb7e0('0x49')]['id']){delete _0x700a52['body']['id'];}return db['SalesforceAccount'][_0xb7e0('0x4c')]({'where':{'id':_0x700a52[_0xb7e0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x546159,null))['then'](function(_0x360d88){if(_0x360d88){_0x700a52[_0xb7e0('0x49')][_0xb7e0('0x4f')]=_0x360d88['id'];_0x700a52[_0xb7e0('0x49')][_0xb7e0('0x50')]=integrations[_0xb7e0('0x51')](_0x700a52[_0xb7e0('0x49')]['channel'],_0x700a52[_0xb7e0('0x49')]['type']);_0x700a52[_0xb7e0('0x49')][_0xb7e0('0x52')]=integrations[_0xb7e0('0x53')](_0x700a52['body']['channel'],_0x700a52['body'][_0xb7e0('0x2e')]);return db[_0xb7e0('0x54')]['create'](_0x700a52[_0xb7e0('0x49')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xb7e0('0x55')],'as':_0xb7e0('0x52')}]});}return null;})[_0xb7e0('0x26')](respondWithResult(_0x546159,null))[_0xb7e0('0x47')](handleError(_0x546159,null));};exports['getFields']=function(_0xf5ff86,_0x5e1b7c,_0x178b57){var _0x227846;var _0x2d9c2d='';var _0x12f713='Task';return db[_0xb7e0('0x2c')][_0xb7e0('0x4c')]({'where':{'id':_0xf5ff86[_0xb7e0('0x4a')]['id']},'attributes':['id',_0xb7e0('0x56'),_0xb7e0('0x57'),'clientSecret',_0xb7e0('0x58'),_0xb7e0('0x59'),_0xb7e0('0x5a')]})[_0xb7e0('0x26')](handleEntityNotFound(_0x5e1b7c,null))[_0xb7e0('0x26')](function(_0x57cc2a){if(_0x57cc2a){_0x2d9c2d=_0x57cc2a[_0xb7e0('0x56')];var _0x53abc5=_0x2d9c2d[_0xb7e0('0x5b')](-0x1);if(_0x53abc5==='/'){_0x2d9c2d=_0x2d9c2d[_0xb7e0('0x5c')](0x0,_0x2d9c2d['lastIndexOf'](_0x53abc5));}_0x227846=new jsforce[(_0xb7e0('0x5d'))]({'oauth2':{'loginUrl':_0x2d9c2d,'clientId':_0x57cc2a[_0xb7e0('0x57')],'clientSecret':_0x57cc2a[_0xb7e0('0x5e')]}});return _0x227846['login'](_0x57cc2a[_0xb7e0('0x58')],_0x57cc2a[_0xb7e0('0x59')][_0xb7e0('0x5f')](_0x57cc2a[_0xb7e0('0x5a')]));}})[_0xb7e0('0x26')](function(_0x5b77d5){if(_0x5b77d5){if(!_[_0xb7e0('0x60')](_0xf5ff86['query'][_0xb7e0('0x61')])){_0x12f713=_0xf5ff86['query']['ticketType'];}return _0x227846[_0xb7e0('0x62')](_0x12f713)['describe']();}})['then'](function(_0x559b07){var _0x49df06=[_0xb7e0('0x63'),'ActivityDate','IsReminderSet','IsRecurrence',_0xb7e0('0x64'),_0xb7e0('0x65')];var _0x5c1905=['string',_0xb7e0('0x66'),_0xb7e0('0x67'),'boolean',_0xb7e0('0x68'),_0xb7e0('0x69'),'phone'];if(_0x559b07){_[_0xb7e0('0x6a')](_0x559b07[_0xb7e0('0x36')],function(_0x1df160){return _0x49df06[_0xb7e0('0x6b')](_0x1df160[_0xb7e0('0x29')])||!_0x5c1905['includes'](_0x1df160[_0xb7e0('0x2e')]);});return{'count':_0x559b07['fields'][_0xb7e0('0x37')],'rows':_[_0xb7e0('0x2b')](_0x559b07[_0xb7e0('0x36')],function(_0x22357c){return{'id':_0x22357c[_0xb7e0('0x29')],'name':_0x22357c['label'],'custom':_0x22357c[_0xb7e0('0x6c')],'options':_0x22357c[_0xb7e0('0x6d')]['length']>0x0?_[_0xb7e0('0x2b')](_0x22357c[_0xb7e0('0x6d')],function(_0x1ba46f){return{'name':_0x1ba46f[_0xb7e0('0x6e')],'value':_0x1ba46f['value']};}):_0x22357c[_0xb7e0('0x2e')]==_0xb7e0('0x6f')?[{'name':_0xb7e0('0x70'),'value':_0xb7e0('0x71')},{'name':_0xb7e0('0x72'),'value':_0xb7e0('0x73')}]:[]};})};}})[_0xb7e0('0x26')](respondWithResult(_0x5e1b7c,null))['catch'](function(_0x2c984b){var _0x33ce79=_0xf5ff86['query'][_0xb7e0('0x74')]?0x1f4:_0x2c984b[_0xb7e0('0x75')]||0x1f4;logger[_0xb7e0('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xb7e0('0x76'),_0x33ce79,JSON[_0xb7e0('0x77')](_0x2c984b));delete _0x2c984b[_0xb7e0('0x29')];if(_0x33ce79===0x191){_0x33ce79=0x190;}_0x5e1b7c[_0xb7e0('0x1a')](_0x33ce79)[_0xb7e0('0x2a')](_0xf5ff86['query'][_0xb7e0('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x2c984b['statusCode']}:_0x2c984b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 4a5274d..1e0ad97 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 _0xbfc2=['rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','util','../../config/logger','moment','bluebird','path'];(function(_0x3f9a8b,_0x4b5709){var _0x2da380=function(_0x1f12e7){while(--_0x1f12e7){_0x3f9a8b['push'](_0x3f9a8b['shift']());}};_0x2da380(++_0x4b5709);}(_0xbfc2,0xcc));var _0x2bfc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xbfc2[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require(_0x2bfc('0x0'));var logger=require(_0x2bfc('0x1'))('api');var moment=require(_0x2bfc('0x2'));var BPromise=require(_0x2bfc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bfc('0x4'));var rimraf=require(_0x2bfc('0x5'));var config=require(_0x2bfc('0x6'));var attributes=require(_0x2bfc('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x2bfc('0x8')]=function(_0xf32995,_0x5dfc05){return _0xf32995[_0x2bfc('0x9')](_0x2bfc('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x851f=['api','bluebird','request-promise','path','./intSalesforceAccount.attributes','exports','SalesforceAccount','lodash','util','../../config/logger'];(function(_0x13451f,_0x30c84c){var _0x5cddfe=function(_0x42e86c){while(--_0x42e86c){_0x13451f['push'](_0x13451f['shift']());}};_0x5cddfe(++_0x30c84c);}(_0x851f,0xbb));var _0xf851=function(_0x39db05,_0x3868d0){_0x39db05=_0x39db05-0x0;var _0x3f0e22=_0x851f[_0x39db05];return _0x3f0e22;};'use strict';var _=require(_0xf851('0x0'));var util=require(_0xf851('0x1'));var logger=require(_0xf851('0x2'))(_0xf851('0x3'));var moment=require('moment');var BPromise=require(_0xf851('0x4'));var rp=require(_0xf851('0x5'));var fs=require('fs');var path=require(_0xf851('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf851('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf851('0x8')]=function(_0x6a8c18,_0x33f9cf){return _0x6a8c18['define'](_0xf851('0x9'),attributes,{'tableName':'int_salesforce_accounts','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 844fa13..15fdbce 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 _0x3d7e=['stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','model','map','then','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','find','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1712cd,_0x2dcca7){var _0x262485=function(_0x3c2fb9){while(--_0x3c2fb9){_0x1712cd['push'](_0x1712cd['shift']());}};_0x262485(++_0x2dcca7);}(_0x3d7e,0x133));var _0xe3d7=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x3d7e[_0x29d623];return _0x242e59;};'use strict';var _=require('lodash');var util=require(_0xe3d7('0x0'));var moment=require('moment');var BPromise=require(_0xe3d7('0x1'));var rs=require(_0xe3d7('0x2'));var fs=require('fs');var Redis=require(_0xe3d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3d7('0x4'));var logger=require(_0xe3d7('0x5'))(_0xe3d7('0x6'));var config=require(_0xe3d7('0x7'));var jayson=require(_0xe3d7('0x8'));var client=jayson[_0xe3d7('0x9')][_0xe3d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a652b,_0x216481,_0x35d04c){return new BPromise(function(_0x2fb00b,_0x5a9673){return client[_0xe3d7('0xb')](_0x2a652b,_0x35d04c)['then'](function(_0x2e9578){logger[_0xe3d7('0xc')](_0xe3d7('0xd'),_0x216481,_0xe3d7('0xe'));logger[_0xe3d7('0xf')](_0xe3d7('0x10'),_0x216481,_0xe3d7('0xe'),JSON[_0xe3d7('0x11')](_0x2e9578));if(_0x2e9578[_0xe3d7('0x12')]){if(_0x2e9578[_0xe3d7('0x12')][_0xe3d7('0x13')]===0x1f4){logger[_0xe3d7('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x216481,_0x2e9578[_0xe3d7('0x12')]['message']);return _0x5a9673(_0x2e9578[_0xe3d7('0x12')][_0xe3d7('0x14')]);}logger[_0xe3d7('0x12')](_0xe3d7('0xd'),_0x216481,_0x2e9578['error'][_0xe3d7('0x14')]);return _0x2fb00b(_0x2e9578[_0xe3d7('0x12')]['message']);}else{logger['info'](_0xe3d7('0xd'),_0x216481,_0xe3d7('0xe'));_0x2fb00b(_0x2e9578[_0xe3d7('0x15')]['message']);}})[_0xe3d7('0x16')](function(_0x25134d){logger[_0xe3d7('0x12')](_0xe3d7('0xd'),_0x216481,_0x25134d);_0x5a9673(_0x25134d);});});}exports['GetSalesforceAccount']=function(_0x36a705){var _0x17df38=this;return new Promise(function(_0x17e226,_0x3d7da7){return db['SalesforceAccount']['findAll']({'raw':_0x36a705[_0xe3d7('0x17')]?_0x36a705[_0xe3d7('0x17')][_0xe3d7('0x18')]===undefined?!![]:![]:!![],'where':_0x36a705[_0xe3d7('0x17')]?_0x36a705[_0xe3d7('0x17')][_0xe3d7('0x19')]||null:null,'attributes':_0x36a705[_0xe3d7('0x17')]?_0x36a705[_0xe3d7('0x17')][_0xe3d7('0x1a')]||null:null,'limit':_0x36a705[_0xe3d7('0x17')]?_0x36a705[_0xe3d7('0x17')][_0xe3d7('0x1b')]||null:null,'include':_0x36a705['options']?_0x36a705[_0xe3d7('0x17')][_0xe3d7('0x1c')]?_['map'](_0x36a705[_0xe3d7('0x17')][_0xe3d7('0x1c')],function(_0x3d8755){return{'model':db[_0x3d8755[_0xe3d7('0x1d')]],'as':_0x3d8755['as'],'attributes':_0x3d8755[_0xe3d7('0x1a')],'include':_0x3d8755[_0xe3d7('0x1c')]?_[_0xe3d7('0x1e')](_0x3d8755[_0xe3d7('0x1c')],function(_0x183e90){return{'model':db[_0x183e90[_0xe3d7('0x1d')]],'as':_0x183e90['as'],'attributes':_0x183e90[_0xe3d7('0x1a')],'include':_0x183e90[_0xe3d7('0x1c')]?_[_0xe3d7('0x1e')](_0x183e90[_0xe3d7('0x1c')],function(_0xbc29a5){return{'model':db[_0xbc29a5[_0xe3d7('0x1d')]],'as':_0xbc29a5['as'],'attributes':_0xbc29a5[_0xe3d7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe3d7('0x1f')](function(_0x200835){logger[_0xe3d7('0xc')]('GetSalesforceAccount',_0x36a705);logger[_0xe3d7('0xf')](_0xe3d7('0x20'),_0x36a705,JSON[_0xe3d7('0x11')](_0x200835));_0x17e226(_0x200835);})['catch'](function(_0x2d668d){logger[_0xe3d7('0x12')](_0xe3d7('0x20'),_0x2d668d['message'],_0x36a705);_0x3d7da7(_0x17df38[_0xe3d7('0x12')](0x1f4,_0x2d668d[_0xe3d7('0x14')]));});});};exports[_0xe3d7('0x21')]=function(_0x246421){var _0x545862=this;return new Promise(function(_0x444236,_0x40fd72){return db[_0xe3d7('0x22')][_0xe3d7('0x23')]({'raw':_0x246421[_0xe3d7('0x17')]?_0x246421['options'][_0xe3d7('0x18')]===undefined?!![]:![]:!![],'where':_0x246421[_0xe3d7('0x17')]?_0x246421[_0xe3d7('0x17')][_0xe3d7('0x19')]||null:null,'attributes':_0x246421[_0xe3d7('0x17')]?_0x246421['options']['attributes']||null:null,'include':_0x246421[_0xe3d7('0x17')]?_0x246421[_0xe3d7('0x17')][_0xe3d7('0x1c')]?_['map'](_0x246421[_0xe3d7('0x17')][_0xe3d7('0x1c')],function(_0x530c18){return{'model':db[_0x530c18[_0xe3d7('0x1d')]],'as':_0x530c18['as'],'attributes':_0x530c18[_0xe3d7('0x1a')],'include':_0x530c18[_0xe3d7('0x1c')]?_[_0xe3d7('0x1e')](_0x530c18[_0xe3d7('0x1c')],function(_0x2ad7d6){return{'model':db[_0x2ad7d6[_0xe3d7('0x1d')]],'as':_0x2ad7d6['as'],'attributes':_0x2ad7d6[_0xe3d7('0x1a')],'include':_0x2ad7d6[_0xe3d7('0x1c')]?_[_0xe3d7('0x1e')](_0x2ad7d6[_0xe3d7('0x1c')],function(_0x142be5){return{'model':db[_0x142be5['model']],'as':_0x142be5['as'],'attributes':_0x142be5[_0xe3d7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe3d7('0x1f')](function(_0x48862e){logger['info'](_0xe3d7('0x21'),_0x246421);logger['debug'](_0xe3d7('0x21'),_0x246421,JSON[_0xe3d7('0x11')](_0x48862e));_0x444236(_0x48862e);})[_0xe3d7('0x16')](function(_0x5a234d){logger[_0xe3d7('0x12')](_0xe3d7('0x21'),_0x5a234d[_0xe3d7('0x14')],_0x246421);_0x40fd72(_0x545862[_0xe3d7('0x12')](0x1f4,_0x5a234d['message']));});});}; \ No newline at end of file +var _0xb725=['client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SalesforceAccount','findAll','options','raw','limit','include','map','attributes','model','GetSalesforceAccount','find','where','ShowSalesforceAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0xb725,0x86));var _0x5b72=function(_0x26f798,_0x49f65b){_0x26f798=_0x26f798-0x0;var _0x1da5bc=_0xb725[_0x26f798];return _0x1da5bc;};'use strict';var _=require('lodash');var util=require(_0x5b72('0x0'));var moment=require('moment');var BPromise=require(_0x5b72('0x1'));var rs=require(_0x5b72('0x2'));var fs=require('fs');var Redis=require(_0x5b72('0x3'));var db=require(_0x5b72('0x4'))['db'];var utils=require(_0x5b72('0x5'));var logger=require(_0x5b72('0x6'))(_0x5b72('0x7'));var config=require(_0x5b72('0x8'));var jayson=require(_0x5b72('0x9'));var client=jayson[_0x5b72('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4749f2,_0x1b6cca,_0x379572){return new BPromise(function(_0x215658,_0x30d4e6){return client[_0x5b72('0xb')](_0x4749f2,_0x379572)[_0x5b72('0xc')](function(_0x47ba42){logger[_0x5b72('0xd')](_0x5b72('0xe'),_0x1b6cca,_0x5b72('0xf'));logger[_0x5b72('0x10')](_0x5b72('0x11'),_0x1b6cca,_0x5b72('0xf'),JSON[_0x5b72('0x12')](_0x47ba42));if(_0x47ba42[_0x5b72('0x13')]){if(_0x47ba42[_0x5b72('0x13')]['code']===0x1f4){logger['error'](_0x5b72('0xe'),_0x1b6cca,_0x47ba42['error'][_0x5b72('0x14')]);return _0x30d4e6(_0x47ba42[_0x5b72('0x13')][_0x5b72('0x14')]);}logger[_0x5b72('0x13')](_0x5b72('0xe'),_0x1b6cca,_0x47ba42[_0x5b72('0x13')]['message']);return _0x215658(_0x47ba42[_0x5b72('0x13')][_0x5b72('0x14')]);}else{logger[_0x5b72('0xd')](_0x5b72('0xe'),_0x1b6cca,_0x5b72('0xf'));_0x215658(_0x47ba42[_0x5b72('0x15')][_0x5b72('0x14')]);}})[_0x5b72('0x16')](function(_0x330562){logger[_0x5b72('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x1b6cca,_0x330562);_0x30d4e6(_0x330562);});});}exports['GetSalesforceAccount']=function(_0x56c23f){var _0x271bdd=this;return new Promise(function(_0x4b3455,_0x32f31e){return db[_0x5b72('0x17')][_0x5b72('0x18')]({'raw':_0x56c23f['options']?_0x56c23f[_0x5b72('0x19')][_0x5b72('0x1a')]===undefined?!![]:![]:!![],'where':_0x56c23f[_0x5b72('0x19')]?_0x56c23f[_0x5b72('0x19')]['where']||null:null,'attributes':_0x56c23f['options']?_0x56c23f[_0x5b72('0x19')]['attributes']||null:null,'limit':_0x56c23f['options']?_0x56c23f[_0x5b72('0x19')][_0x5b72('0x1b')]||null:null,'include':_0x56c23f[_0x5b72('0x19')]?_0x56c23f['options'][_0x5b72('0x1c')]?_[_0x5b72('0x1d')](_0x56c23f[_0x5b72('0x19')][_0x5b72('0x1c')],function(_0x10ed20){return{'model':db[_0x10ed20['model']],'as':_0x10ed20['as'],'attributes':_0x10ed20[_0x5b72('0x1e')],'include':_0x10ed20[_0x5b72('0x1c')]?_['map'](_0x10ed20['include'],function(_0x52fc1d){return{'model':db[_0x52fc1d[_0x5b72('0x1f')]],'as':_0x52fc1d['as'],'attributes':_0x52fc1d[_0x5b72('0x1e')],'include':_0x52fc1d['include']?_['map'](_0x52fc1d[_0x5b72('0x1c')],function(_0x1ac7a7){return{'model':db[_0x1ac7a7[_0x5b72('0x1f')]],'as':_0x1ac7a7['as'],'attributes':_0x1ac7a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b72('0xc')](function(_0x2dc35d){logger[_0x5b72('0xd')](_0x5b72('0x20'),_0x56c23f);logger[_0x5b72('0x10')]('GetSalesforceAccount',_0x56c23f,JSON[_0x5b72('0x12')](_0x2dc35d));_0x4b3455(_0x2dc35d);})[_0x5b72('0x16')](function(_0x2919a4){logger[_0x5b72('0x13')]('GetSalesforceAccount',_0x2919a4[_0x5b72('0x14')],_0x56c23f);_0x32f31e(_0x271bdd[_0x5b72('0x13')](0x1f4,_0x2919a4[_0x5b72('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0xabf919){var _0x54d5dc=this;return new Promise(function(_0xa455f9,_0x4d0dbc){return db[_0x5b72('0x17')][_0x5b72('0x21')]({'raw':_0xabf919['options']?_0xabf919['options'][_0x5b72('0x1a')]===undefined?!![]:![]:!![],'where':_0xabf919[_0x5b72('0x19')]?_0xabf919['options'][_0x5b72('0x22')]||null:null,'attributes':_0xabf919['options']?_0xabf919[_0x5b72('0x19')][_0x5b72('0x1e')]||null:null,'include':_0xabf919[_0x5b72('0x19')]?_0xabf919[_0x5b72('0x19')]['include']?_[_0x5b72('0x1d')](_0xabf919['options'][_0x5b72('0x1c')],function(_0x5b2505){return{'model':db[_0x5b2505['model']],'as':_0x5b2505['as'],'attributes':_0x5b2505['attributes'],'include':_0x5b2505[_0x5b72('0x1c')]?_[_0x5b72('0x1d')](_0x5b2505[_0x5b72('0x1c')],function(_0x98d697){return{'model':db[_0x98d697['model']],'as':_0x98d697['as'],'attributes':_0x98d697[_0x5b72('0x1e')],'include':_0x98d697[_0x5b72('0x1c')]?_['map'](_0x98d697['include'],function(_0x10d31c){return{'model':db[_0x10d31c['model']],'as':_0x10d31c['as'],'attributes':_0x10d31c[_0x5b72('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5b72('0xc')](function(_0x24da69){logger[_0x5b72('0xd')](_0x5b72('0x23'),_0xabf919);logger['debug'](_0x5b72('0x23'),_0xabf919,JSON[_0x5b72('0x12')](_0x24da69));_0xa455f9(_0x24da69);})['catch'](function(_0x5dba3e){logger[_0x5b72('0x13')]('ShowSalesforceAccount',_0x5dba3e['message'],_0xabf919);_0x4d0dbc(_0x54d5dc[_0x5b72('0x13')](0x1f4,_0x5dba3e['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d59f956..b85a32b 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x57fc54,_0x580dc3){var _0x4597dd=function(_0x3ab0db){while(--_0x3ab0db){_0x57fc54['push'](_0x57fc54['shift']());}};_0x4597dd(++_0x580dc3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x28f822,_0x18d742){var _0x61ab9d=function(_0x183248){while(--_0x183248){_0x28f822['push'](_0x28f822['shift']());}};_0x61ab9d(++_0x18d742);}(_0x2ef3,0xba));var _0x32ef=function(_0x3d9f9d,_0x2691b2){_0x3d9f9d=_0x3d9f9d-0x0;var _0x48b423=_0x2ef3[_0x3d9f9d];return _0x48b423;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index dc05675..c103bed 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 _0x6828=['Task','Case','contact_lead','contact','lead','account','sequelize','exports','STRING','ENUM'];(function(_0x35674d,_0x5283e0){var _0x2f7450=function(_0x40f44c){while(--_0x40f44c){_0x35674d['push'](_0x35674d['shift']());}};_0x2f7450(++_0x5283e0);}(_0x6828,0x1f0));var _0x8682=function(_0x5b1547,_0x36cb82){_0x5b1547=_0x5b1547-0x0;var _0x2eaad8=_0x6828[_0x5b1547];return _0x2eaad8;};'use strict';var Sequelize=require(_0x8682('0x0'));module[_0x8682('0x1')]={'name':{'type':Sequelize[_0x8682('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x8682('0x3')](_0x8682('0x4'),_0x8682('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x8682('0x3')](_0x8682('0x6'),_0x8682('0x7'),_0x8682('0x8'),'account_contact_lead',_0x8682('0x9')),'defaultValue':_0x8682('0x6')},'moduleCreate':{'type':Sequelize[_0x8682('0x3')]('nothing',_0x8682('0x7'),_0x8682('0x8'),_0x8682('0x9')),'defaultValue':_0x8682('0x8')},'leadId':{'type':Sequelize[_0x8682('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x8682('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x8682('0x2')]}}; \ No newline at end of file +var _0x9ecd=['STRING','Task','ENUM','contact_lead','contact','lead','account_contact_lead','account','nothing','exports'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x9ecd,0x185));var _0xd9ec=function(_0x224e4b,_0x4d255e){_0x224e4b=_0x224e4b-0x0;var _0x3c13cd=_0x9ecd[_0x224e4b];return _0x3c13cd;};'use strict';var Sequelize=require('sequelize');module[_0xd9ec('0x0')]={'name':{'type':Sequelize[_0xd9ec('0x1')]},'description':{'type':Sequelize[_0xd9ec('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xd9ec('0x2'),'Case'),'defaultValue':_0xd9ec('0x2')},'moduleSearch':{'type':Sequelize[_0xd9ec('0x3')](_0xd9ec('0x4'),_0xd9ec('0x5'),_0xd9ec('0x6'),_0xd9ec('0x7'),_0xd9ec('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xd9ec('0x3')](_0xd9ec('0x9'),_0xd9ec('0x5'),'lead',_0xd9ec('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xd9ec('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xd9ec('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xd9ec('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c28e7e4..d973837 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 _0x2279=['fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','index','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','map','VIRTUAL','options','SalesforceConfiguration','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','findOne','SalesforceField','sort','getFields','getSubjects','getDescriptions','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x1058ed,_0x109d8d){var _0x4e4661=function(_0x2fc1df){while(--_0x2fc1df){_0x1058ed['push'](_0x1058ed['shift']());}};_0x4e4661(++_0x109d8d);}(_0x2279,0x90));var _0x9227=function(_0x2ce453,_0x5f3f74){_0x2ce453=_0x2ce453-0x0;var _0x19820f=_0x2279[_0x2ce453];return _0x19820f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9227('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9227('0x1'));var rp=require('request-promise');var moment=require(_0x9227('0x2'));var BPromise=require(_0x9227('0x3'));var Mustache=require(_0x9227('0x4'));var util=require(_0x9227('0x5'));var path=require(_0x9227('0x6'));var sox=require(_0x9227('0x7'));var csv=require(_0x9227('0x8'));var ejs=require(_0x9227('0x9'));var fs=require('fs');var fs_extra=require(_0x9227('0xa'));var _=require('lodash');var squel=require(_0x9227('0xb'));var crypto=require(_0x9227('0xc'));var jsforce=require(_0x9227('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9227('0x8'));var querystring=require(_0x9227('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9227('0xf'));var as=require(_0x9227('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9227('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x9227('0x12'));var licenseUtil=require(_0x9227('0x13'));var db=require(_0x9227('0x14'))['db'];function respondWithStatusCode(_0x2c349a,_0x24ae4f){_0x24ae4f=_0x24ae4f||0xcc;return function(_0x2d086e){if(_0x2d086e){return _0x2c349a[_0x9227('0x15')](_0x24ae4f);}return _0x2c349a[_0x9227('0x16')](_0x24ae4f)['end']();};}function respondWithResult(_0x48b1ef,_0x41750d){_0x41750d=_0x41750d||0xc8;return function(_0x371020){if(_0x371020){return _0x48b1ef[_0x9227('0x16')](_0x41750d)[_0x9227('0x17')](_0x371020);}};}function respondWithFilteredResult(_0x3a6d79,_0x3ccbdd){return function(_0x2e6e84){if(_0x2e6e84){var _0x5dbc8e=typeof _0x3ccbdd['offset']===_0x9227('0x18')&&typeof _0x3ccbdd[_0x9227('0x19')]==='undefined';var _0x456e12=_0x2e6e84[_0x9227('0x1a')];var _0x16217f=_0x5dbc8e?0x0:_0x3ccbdd[_0x9227('0x1b')];var _0x3f5fcc=_0x5dbc8e?_0x2e6e84['count']:_0x3ccbdd[_0x9227('0x1b')]+_0x3ccbdd[_0x9227('0x19')];var _0x2fafcf;if(_0x3f5fcc>=_0x456e12){_0x3f5fcc=_0x456e12;_0x2fafcf=0xc8;}else{_0x2fafcf=0xce;}_0x3a6d79[_0x9227('0x16')](_0x2fafcf);return _0x3a6d79[_0x9227('0x1c')](_0x9227('0x1d'),_0x16217f+'-'+_0x3f5fcc+'/'+_0x456e12)['json'](_0x2e6e84);}return null;};}function patchUpdates(_0x3f335f){return function(_0x324475){try{jsonpatch[_0x9227('0x1e')](_0x324475,_0x3f335f,!![]);}catch(_0x4fb8b5){return BPromise['reject'](_0x4fb8b5);}return _0x324475[_0x9227('0x1f')]();};}function saveUpdates(_0x4ec3f5,_0x15437f){return function(_0x206346){if(_0x206346){return _0x206346[_0x9227('0x20')](_0x4ec3f5)[_0x9227('0x21')](function(_0x154877){return _0x154877;});}return null;};}function removeEntity(_0x3bb76c,_0x4256fa){return function(_0x2dfa15){if(_0x2dfa15){return _0x2dfa15[_0x9227('0x22')]()[_0x9227('0x21')](function(){_0x3bb76c[_0x9227('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e3261,_0x41c855){return function(_0x74ef10){if(!_0x74ef10){_0x4e3261['sendStatus'](0x194);}return _0x74ef10;};}function handleError(_0x3002ff,_0x4529ee){_0x4529ee=_0x4529ee||0x1f4;return function(_0x46c6a7){logger['error'](_0x46c6a7[_0x9227('0x23')]);if(_0x46c6a7[_0x9227('0x24')]){delete _0x46c6a7[_0x9227('0x24')];}_0x3002ff[_0x9227('0x16')](_0x4529ee)['send'](_0x46c6a7);};}exports[_0x9227('0x25')]=function(_0x5beb86,_0x520dd9){var _0x13cd95={},_0x49c14f={},_0x13c7f2={'count':0x0,'rows':[]};var _0x53e0ba=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x4ae8de){return{'name':_0x4ae8de[_0x9227('0x26')],'type':_0x4ae8de[_0x9227('0x27')][_0x9227('0x28')]};});_0x49c14f[_0x9227('0x29')]=_['map'](_0x53e0ba,_0x9227('0x24'));_0x49c14f[_0x9227('0x2a')]=_[_0x9227('0x2b')](_0x5beb86[_0x9227('0x2a')]);_0x49c14f['filters']=_['intersection'](_0x49c14f[_0x9227('0x29')],_0x49c14f[_0x9227('0x2a')]);_0x13cd95[_0x9227('0x2c')]=_[_0x9227('0x2d')](_0x49c14f[_0x9227('0x29')],qs[_0x9227('0x2e')](_0x5beb86[_0x9227('0x2a')][_0x9227('0x2e')]));_0x13cd95[_0x9227('0x2c')]=_0x13cd95[_0x9227('0x2c')][_0x9227('0x2f')]?_0x13cd95[_0x9227('0x2c')]:_0x49c14f[_0x9227('0x29')];if(!_0x5beb86[_0x9227('0x2a')][_0x9227('0x30')](_0x9227('0x31'))){_0x13cd95[_0x9227('0x19')]=qs['limit'](_0x5beb86['query'][_0x9227('0x19')]);_0x13cd95['offset']=qs[_0x9227('0x1b')](_0x5beb86[_0x9227('0x2a')][_0x9227('0x1b')]);}_0x13cd95[_0x9227('0x32')]=qs['sort'](_0x5beb86[_0x9227('0x2a')]['sort']);_0x13cd95[_0x9227('0x33')]=qs['filters'](_[_0x9227('0x34')](_0x5beb86['query'],_0x49c14f[_0x9227('0x35')]),_0x53e0ba);if(_0x5beb86[_0x9227('0x2a')][_0x9227('0x36')]){_0x13cd95[_0x9227('0x33')]=_[_0x9227('0x37')](_0x13cd95[_0x9227('0x33')],{'$or':_[_0x9227('0x38')](_0x53e0ba,function(_0x3c68df){if(_0x3c68df[_0x9227('0x27')]!==_0x9227('0x39')){var _0x5e8cb9={};_0x5e8cb9[_0x3c68df[_0x9227('0x24')]]={'$like':'%'+_0x5beb86[_0x9227('0x2a')][_0x9227('0x36')]+'%'};return _0x5e8cb9;}})});}_0x13cd95=_[_0x9227('0x37')]({},_0x13cd95,_0x5beb86[_0x9227('0x3a')]);var _0x59464e={'where':_0x13cd95[_0x9227('0x33')]};return db[_0x9227('0x3b')][_0x9227('0x1a')](_0x59464e)[_0x9227('0x21')](function(_0x50ca32){_0x13c7f2[_0x9227('0x1a')]=_0x50ca32;if(_0x5beb86['query'][_0x9227('0x3c')]){_0x13cd95['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x9227('0x3d')](_0x13cd95);})['then'](function(_0x3b44b3){_0x13c7f2[_0x9227('0x3e')]=_0x3b44b3;return _0x13c7f2;})[_0x9227('0x21')](respondWithFilteredResult(_0x520dd9,_0x13cd95))[_0x9227('0x3f')](handleError(_0x520dd9,null));};exports[_0x9227('0x40')]=function(_0x9faec8,_0xd1de26){var _0xeb8da0={'raw':![],'where':{'id':_0x9faec8[_0x9227('0x41')]['id']}},_0x5b5b35={};_0x5b5b35[_0x9227('0x29')]=_[_0x9227('0x2b')](db[_0x9227('0x3b')][_0x9227('0x42')]);_0x5b5b35[_0x9227('0x2a')]=_[_0x9227('0x2b')](_0x9faec8[_0x9227('0x2a')]);_0x5b5b35[_0x9227('0x35')]=_['intersection'](_0x5b5b35[_0x9227('0x29')],_0x5b5b35[_0x9227('0x2a')]);_0xeb8da0[_0x9227('0x2c')]=_['intersection'](_0x5b5b35[_0x9227('0x29')],qs['fields'](_0x9faec8[_0x9227('0x2a')][_0x9227('0x2e')]));_0xeb8da0['attributes']=_0xeb8da0[_0x9227('0x2c')][_0x9227('0x2f')]?_0xeb8da0['attributes']:_0x5b5b35['model'];if(_0x9faec8[_0x9227('0x2a')][_0x9227('0x3c')]){_0xeb8da0[_0x9227('0x43')]=[{'all':!![]}];}_0xeb8da0=_[_0x9227('0x37')]({},_0xeb8da0,_0x9faec8[_0x9227('0x3a')]);return db[_0x9227('0x3b')]['find'](_0xeb8da0)[_0x9227('0x21')](handleEntityNotFound(_0xd1de26,null))[_0x9227('0x21')](respondWithResult(_0xd1de26,null))[_0x9227('0x3f')](handleError(_0xd1de26,null));};exports[_0x9227('0x44')]=function(_0x459229,_0x546765){return db[_0x9227('0x3b')][_0x9227('0x44')](_0x459229[_0x9227('0x45')],{})[_0x9227('0x21')](respondWithResult(_0x546765,0xc9))[_0x9227('0x3f')](handleError(_0x546765,null));};exports[_0x9227('0x20')]=function(_0x5cc9eb,_0x326e67){if(_0x5cc9eb[_0x9227('0x45')]['id']){delete _0x5cc9eb[_0x9227('0x45')]['id'];}return db[_0x9227('0x3b')][_0x9227('0x46')]({'where':{'id':_0x5cc9eb[_0x9227('0x41')]['id']}})['then'](handleEntityNotFound(_0x326e67,null))[_0x9227('0x21')](saveUpdates(_0x5cc9eb[_0x9227('0x45')],null))[_0x9227('0x21')](respondWithResult(_0x326e67,null))[_0x9227('0x3f')](handleError(_0x326e67,null));};exports['destroy']=function(_0x103074,_0x641226){return db[_0x9227('0x3b')][_0x9227('0x46')]({'where':{'id':_0x103074[_0x9227('0x41')]['id']}})[_0x9227('0x21')](handleEntityNotFound(_0x641226,null))['then'](removeEntity(_0x641226,null))[_0x9227('0x3f')](handleError(_0x641226,null));};exports['getFields']=function(_0x259fd1,_0x46f908,_0x34b4ef){var _0xaf5783={};var _0x2cb8d1={};var _0x38aeab;var _0x539a71;return db[_0x9227('0x3b')][_0x9227('0x47')]({'where':{'id':_0x259fd1[_0x9227('0x41')]['id']}})[_0x9227('0x21')](handleEntityNotFound(_0x46f908,null))[_0x9227('0x21')](function(_0x29a15a){if(_0x29a15a){_0x38aeab=_0x29a15a;_0x2cb8d1['model']=_[_0x9227('0x2b')](db[_0x9227('0x48')]['rawAttributes']);_0x2cb8d1[_0x9227('0x2a')]=_['keys'](_0x259fd1['query']);_0x2cb8d1[_0x9227('0x35')]=_[_0x9227('0x2d')](_0x2cb8d1[_0x9227('0x29')],_0x2cb8d1[_0x9227('0x2a')]);_0xaf5783[_0x9227('0x2c')]=_[_0x9227('0x2d')](_0x2cb8d1['model'],qs['fields'](_0x259fd1[_0x9227('0x2a')]['fields']));_0xaf5783[_0x9227('0x2c')]=_0xaf5783[_0x9227('0x2c')][_0x9227('0x2f')]?_0xaf5783[_0x9227('0x2c')]:_0x2cb8d1[_0x9227('0x29')];_0xaf5783[_0x9227('0x32')]=qs['sort'](_0x259fd1[_0x9227('0x2a')][_0x9227('0x49')]);_0xaf5783[_0x9227('0x33')]=qs[_0x9227('0x35')](_[_0x9227('0x34')](_0x259fd1['query'],_0x2cb8d1[_0x9227('0x35')]));if(_0x259fd1[_0x9227('0x2a')][_0x9227('0x36')]){_0xaf5783[_0x9227('0x33')]=_['merge'](_0xaf5783[_0x9227('0x33')],{'$or':_[_0x9227('0x38')](_0xaf5783[_0x9227('0x2c')],function(_0x337faf){var _0x571601={};_0x571601[_0x337faf]={'$like':'%'+_0x259fd1[_0x9227('0x2a')]['filter']+'%'};return _0x571601;})});}_0xaf5783=_['merge']({},_0xaf5783,_0x259fd1[_0x9227('0x3a')]);return _0x38aeab[_0x9227('0x4a')](_0xaf5783);}})[_0x9227('0x21')](function(_0x4ed82a){if(_0x4ed82a){_0x539a71=_0x4ed82a[_0x9227('0x2f')];if(!_0x259fd1[_0x9227('0x2a')]['hasOwnProperty']('nolimit')){_0xaf5783[_0x9227('0x19')]=qs[_0x9227('0x19')](_0x259fd1[_0x9227('0x2a')][_0x9227('0x19')]);_0xaf5783[_0x9227('0x1b')]=qs['offset'](_0x259fd1[_0x9227('0x2a')][_0x9227('0x1b')]);}return _0x38aeab['getFields'](_0xaf5783);}})[_0x9227('0x21')](function(_0x37ba27){if(_0x37ba27){return _0x37ba27?{'count':_0x539a71,'rows':_0x37ba27}:null;}})['then'](respondWithResult(_0x46f908,null))[_0x9227('0x3f')](handleError(_0x46f908,null));};exports[_0x9227('0x4b')]=function(_0x2e3c40,_0x1b8864,_0x39fec6){var _0x2a6c62={};var _0x40c712={};var _0x4757b6;var _0x20f08c;return db[_0x9227('0x3b')][_0x9227('0x47')]({'where':{'id':_0x2e3c40['params']['id']}})[_0x9227('0x21')](handleEntityNotFound(_0x1b8864,null))[_0x9227('0x21')](function(_0x1928ee){if(_0x1928ee){_0x4757b6=_0x1928ee;_0x40c712[_0x9227('0x29')]=_[_0x9227('0x2b')](db[_0x9227('0x48')]['rawAttributes']);_0x40c712[_0x9227('0x2a')]=_[_0x9227('0x2b')](_0x2e3c40[_0x9227('0x2a')]);_0x40c712[_0x9227('0x35')]=_['intersection'](_0x40c712[_0x9227('0x29')],_0x40c712[_0x9227('0x2a')]);_0x2a6c62[_0x9227('0x2c')]=_['intersection'](_0x40c712[_0x9227('0x29')],qs[_0x9227('0x2e')](_0x2e3c40[_0x9227('0x2a')]['fields']));_0x2a6c62[_0x9227('0x2c')]=_0x2a6c62[_0x9227('0x2c')]['length']?_0x2a6c62[_0x9227('0x2c')]:_0x40c712[_0x9227('0x29')];_0x2a6c62[_0x9227('0x32')]=qs[_0x9227('0x49')](_0x2e3c40['query']['sort']);_0x2a6c62['where']=qs['filters'](_[_0x9227('0x34')](_0x2e3c40[_0x9227('0x2a')],_0x40c712[_0x9227('0x35')]));if(_0x2e3c40[_0x9227('0x2a')]['filter']){_0x2a6c62[_0x9227('0x33')]=_[_0x9227('0x37')](_0x2a6c62[_0x9227('0x33')],{'$or':_['map'](_0x2a6c62['attributes'],function(_0x2bab98){var _0x32cff4={};_0x32cff4[_0x2bab98]={'$like':'%'+_0x2e3c40['query'][_0x9227('0x36')]+'%'};return _0x32cff4;})});}_0x2a6c62=_[_0x9227('0x37')]({},_0x2a6c62,_0x2e3c40[_0x9227('0x3a')]);return _0x4757b6[_0x9227('0x4b')](_0x2a6c62);}})[_0x9227('0x21')](function(_0x449e39){if(_0x449e39){_0x20f08c=_0x449e39[_0x9227('0x2f')];if(!_0x2e3c40[_0x9227('0x2a')][_0x9227('0x30')](_0x9227('0x31'))){_0x2a6c62[_0x9227('0x19')]=qs['limit'](_0x2e3c40[_0x9227('0x2a')]['limit']);_0x2a6c62[_0x9227('0x1b')]=qs[_0x9227('0x1b')](_0x2e3c40[_0x9227('0x2a')][_0x9227('0x1b')]);}return _0x4757b6['getSubjects'](_0x2a6c62);}})['then'](function(_0x319aa8){if(_0x319aa8){return _0x319aa8?{'count':_0x20f08c,'rows':_0x319aa8}:null;}})[_0x9227('0x21')](respondWithResult(_0x1b8864,null))['catch'](handleError(_0x1b8864,null));};exports[_0x9227('0x4c')]=function(_0x56d490,_0x3c3004,_0xace21a){var _0x111ed3={};var _0x17fed3={};var _0x59fce4;var _0x23fd4e;return db[_0x9227('0x3b')]['findOne']({'where':{'id':_0x56d490[_0x9227('0x41')]['id']}})[_0x9227('0x21')](handleEntityNotFound(_0x3c3004,null))[_0x9227('0x21')](function(_0x13fe20){if(_0x13fe20){_0x59fce4=_0x13fe20;_0x17fed3[_0x9227('0x29')]=_[_0x9227('0x2b')](db[_0x9227('0x48')]['rawAttributes']);_0x17fed3['query']=_[_0x9227('0x2b')](_0x56d490['query']);_0x17fed3[_0x9227('0x35')]=_['intersection'](_0x17fed3[_0x9227('0x29')],_0x17fed3['query']);_0x111ed3[_0x9227('0x2c')]=_['intersection'](_0x17fed3[_0x9227('0x29')],qs[_0x9227('0x2e')](_0x56d490[_0x9227('0x2a')][_0x9227('0x2e')]));_0x111ed3['attributes']=_0x111ed3[_0x9227('0x2c')][_0x9227('0x2f')]?_0x111ed3[_0x9227('0x2c')]:_0x17fed3['model'];_0x111ed3[_0x9227('0x32')]=qs[_0x9227('0x49')](_0x56d490[_0x9227('0x2a')][_0x9227('0x49')]);_0x111ed3[_0x9227('0x33')]=qs[_0x9227('0x35')](_[_0x9227('0x34')](_0x56d490[_0x9227('0x2a')],_0x17fed3[_0x9227('0x35')]));if(_0x56d490[_0x9227('0x2a')][_0x9227('0x36')]){_0x111ed3[_0x9227('0x33')]=_[_0x9227('0x37')](_0x111ed3[_0x9227('0x33')],{'$or':_[_0x9227('0x38')](_0x111ed3['attributes'],function(_0x360041){var _0x38b733={};_0x38b733[_0x360041]={'$like':'%'+_0x56d490[_0x9227('0x2a')]['filter']+'%'};return _0x38b733;})});}_0x111ed3=_[_0x9227('0x37')]({},_0x111ed3,_0x56d490[_0x9227('0x3a')]);return _0x59fce4['getDescriptions'](_0x111ed3);}})['then'](function(_0x3bca32){if(_0x3bca32){_0x23fd4e=_0x3bca32[_0x9227('0x2f')];if(!_0x56d490[_0x9227('0x2a')][_0x9227('0x30')](_0x9227('0x31'))){_0x111ed3[_0x9227('0x19')]=qs[_0x9227('0x19')](_0x56d490[_0x9227('0x2a')]['limit']);_0x111ed3[_0x9227('0x1b')]=qs[_0x9227('0x1b')](_0x56d490[_0x9227('0x2a')][_0x9227('0x1b')]);}return _0x59fce4[_0x9227('0x4c')](_0x111ed3);}})[_0x9227('0x21')](function(_0x4ad58b){if(_0x4ad58b){return _0x4ad58b?{'count':_0x23fd4e,'rows':_0x4ad58b}:null;}})['then'](respondWithResult(_0x3c3004,null))[_0x9227('0x3f')](handleError(_0x3c3004,null));}; \ No newline at end of file +var _0x855e=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','fields','length','find','create','body','params','getFields','SalesforceField','sort','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x2dbd3d,_0x1881a8){var _0x14e894=function(_0x2745e2){while(--_0x2745e2){_0x2dbd3d['push'](_0x2dbd3d['shift']());}};_0x14e894(++_0x1881a8);}(_0x855e,0x1af));var _0xe855=function(_0x472072,_0x5add18){_0x472072=_0x472072-0x0;var _0x38ca35=_0x855e[_0x472072];return _0x38ca35;};'use strict';var emlformat=require(_0xe855('0x0'));var rimraf=require(_0xe855('0x1'));var zipdir=require(_0xe855('0x2'));var jsonpatch=require(_0xe855('0x3'));var rp=require(_0xe855('0x4'));var moment=require('moment');var BPromise=require(_0xe855('0x5'));var Mustache=require(_0xe855('0x6'));var util=require(_0xe855('0x7'));var path=require(_0xe855('0x8'));var sox=require(_0xe855('0x9'));var csv=require(_0xe855('0xa'));var ejs=require(_0xe855('0xb'));var fs=require('fs');var fs_extra=require(_0xe855('0xc'));var _=require('lodash');var squel=require(_0xe855('0xd'));var crypto=require(_0xe855('0xe'));var jsforce=require(_0xe855('0xf'));var deskjs=require(_0xe855('0x10'));var toCsv=require(_0xe855('0xa'));var querystring=require(_0xe855('0x11'));var Papa=require(_0xe855('0x12'));var Redis=require(_0xe855('0x13'));var authService=require(_0xe855('0x14'));var qs=require(_0xe855('0x15'));var as=require(_0xe855('0x16'));var hardwareService=require(_0xe855('0x17'));var logger=require(_0xe855('0x18'))(_0xe855('0x19'));var utils=require(_0xe855('0x1a'));var config=require(_0xe855('0x1b'));var licenseUtil=require(_0xe855('0x1c'));var db=require(_0xe855('0x1d'))['db'];function respondWithStatusCode(_0x1a4e9c,_0x3b38cd){_0x3b38cd=_0x3b38cd||0xcc;return function(_0x4b19b8){if(_0x4b19b8){return _0x1a4e9c[_0xe855('0x1e')](_0x3b38cd);}return _0x1a4e9c[_0xe855('0x1f')](_0x3b38cd)[_0xe855('0x20')]();};}function respondWithResult(_0x287779,_0x55af02){_0x55af02=_0x55af02||0xc8;return function(_0x548226){if(_0x548226){return _0x287779[_0xe855('0x1f')](_0x55af02)['json'](_0x548226);}};}function respondWithFilteredResult(_0x322bd9,_0x84321f){return function(_0x41be03){if(_0x41be03){var _0x51c301=typeof _0x84321f['offset']==='undefined'&&typeof _0x84321f[_0xe855('0x21')]===_0xe855('0x22');var _0x1dd64d=_0x41be03[_0xe855('0x23')];var _0xfca61b=_0x51c301?0x0:_0x84321f[_0xe855('0x24')];var _0x4e25db=_0x51c301?_0x41be03[_0xe855('0x23')]:_0x84321f[_0xe855('0x24')]+_0x84321f[_0xe855('0x21')];var _0x488806;if(_0x4e25db>=_0x1dd64d){_0x4e25db=_0x1dd64d;_0x488806=0xc8;}else{_0x488806=0xce;}_0x322bd9[_0xe855('0x1f')](_0x488806);return _0x322bd9[_0xe855('0x25')](_0xe855('0x26'),_0xfca61b+'-'+_0x4e25db+'/'+_0x1dd64d)['json'](_0x41be03);}return null;};}function patchUpdates(_0x123966){return function(_0x4abaef){try{jsonpatch['apply'](_0x4abaef,_0x123966,!![]);}catch(_0x52c2b8){return BPromise[_0xe855('0x27')](_0x52c2b8);}return _0x4abaef[_0xe855('0x28')]();};}function saveUpdates(_0x594c92,_0x14662b){return function(_0x1521e2){if(_0x1521e2){return _0x1521e2[_0xe855('0x29')](_0x594c92)[_0xe855('0x2a')](function(_0x41fca2){return _0x41fca2;});}return null;};}function removeEntity(_0x4ff8d7,_0x1600b9){return function(_0x4c7b37){if(_0x4c7b37){return _0x4c7b37[_0xe855('0x2b')]()['then'](function(){_0x4ff8d7[_0xe855('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21779b,_0x19ce35){return function(_0x3cfda5){if(!_0x3cfda5){_0x21779b[_0xe855('0x1e')](0x194);}return _0x3cfda5;};}function handleError(_0x229288,_0x264098){_0x264098=_0x264098||0x1f4;return function(_0x4bf7ee){logger[_0xe855('0x2c')](_0x4bf7ee[_0xe855('0x2d')]);if(_0x4bf7ee[_0xe855('0x2e')]){delete _0x4bf7ee[_0xe855('0x2e')];}_0x229288[_0xe855('0x1f')](_0x264098)[_0xe855('0x2f')](_0x4bf7ee);};}exports[_0xe855('0x30')]=function(_0xd1839a,_0x4f0435){var _0x279f50={},_0x24c5a7={},_0x960783={'count':0x0,'rows':[]};var _0x46a01f=_[_0xe855('0x31')](db[_0xe855('0x32')][_0xe855('0x33')],function(_0x29905d){return{'name':_0x29905d[_0xe855('0x34')],'type':_0x29905d['type'][_0xe855('0x35')]};});_0x24c5a7['model']=_['map'](_0x46a01f,'name');_0x24c5a7['query']=_[_0xe855('0x36')](_0xd1839a[_0xe855('0x37')]);_0x24c5a7[_0xe855('0x38')]=_[_0xe855('0x39')](_0x24c5a7[_0xe855('0x3a')],_0x24c5a7[_0xe855('0x37')]);_0x279f50[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x24c5a7[_0xe855('0x3a')],qs['fields'](_0xd1839a['query']['fields']));_0x279f50['attributes']=_0x279f50['attributes']['length']?_0x279f50[_0xe855('0x3b')]:_0x24c5a7[_0xe855('0x3a')];if(!_0xd1839a[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x279f50['limit']=qs[_0xe855('0x21')](_0xd1839a[_0xe855('0x37')][_0xe855('0x21')]);_0x279f50[_0xe855('0x24')]=qs[_0xe855('0x24')](_0xd1839a[_0xe855('0x37')]['offset']);}_0x279f50[_0xe855('0x3e')]=qs['sort'](_0xd1839a[_0xe855('0x37')]['sort']);_0x279f50['where']=qs[_0xe855('0x38')](_[_0xe855('0x3f')](_0xd1839a[_0xe855('0x37')],_0x24c5a7[_0xe855('0x38')]),_0x46a01f);if(_0xd1839a['query'][_0xe855('0x40')]){_0x279f50[_0xe855('0x41')]=_['merge'](_0x279f50[_0xe855('0x41')],{'$or':_['map'](_0x46a01f,function(_0x310b69){if(_0x310b69[_0xe855('0x42')]!==_0xe855('0x43')){var _0xa00ab2={};_0xa00ab2[_0x310b69[_0xe855('0x2e')]]={'$like':'%'+_0xd1839a[_0xe855('0x37')][_0xe855('0x40')]+'%'};return _0xa00ab2;}})});}_0x279f50=_[_0xe855('0x44')]({},_0x279f50,_0xd1839a[_0xe855('0x45')]);var _0xbfde21={'where':_0x279f50[_0xe855('0x41')]};return db[_0xe855('0x32')][_0xe855('0x23')](_0xbfde21)[_0xe855('0x2a')](function(_0x235264){_0x960783[_0xe855('0x23')]=_0x235264;if(_0xd1839a[_0xe855('0x37')][_0xe855('0x46')]){_0x279f50[_0xe855('0x47')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xe855('0x48')](_0x279f50);})[_0xe855('0x2a')](function(_0x5f28a9){_0x960783[_0xe855('0x49')]=_0x5f28a9;return _0x960783;})[_0xe855('0x2a')](respondWithFilteredResult(_0x4f0435,_0x279f50))[_0xe855('0x4a')](handleError(_0x4f0435,null));};exports[_0xe855('0x4b')]=function(_0xa84374,_0x1890c5){var _0x4a1c9d={'raw':![],'where':{'id':_0xa84374['params']['id']}},_0x1c213e={};_0x1c213e[_0xe855('0x3a')]=_[_0xe855('0x36')](db[_0xe855('0x32')]['rawAttributes']);_0x1c213e[_0xe855('0x37')]=_['keys'](_0xa84374[_0xe855('0x37')]);_0x1c213e[_0xe855('0x38')]=_[_0xe855('0x39')](_0x1c213e[_0xe855('0x3a')],_0x1c213e[_0xe855('0x37')]);_0x4a1c9d[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x1c213e['model'],qs[_0xe855('0x4c')](_0xa84374[_0xe855('0x37')][_0xe855('0x4c')]));_0x4a1c9d[_0xe855('0x3b')]=_0x4a1c9d[_0xe855('0x3b')][_0xe855('0x4d')]?_0x4a1c9d[_0xe855('0x3b')]:_0x1c213e[_0xe855('0x3a')];if(_0xa84374['query'][_0xe855('0x46')]){_0x4a1c9d[_0xe855('0x47')]=[{'all':!![]}];}_0x4a1c9d=_[_0xe855('0x44')]({},_0x4a1c9d,_0xa84374['options']);return db[_0xe855('0x32')][_0xe855('0x4e')](_0x4a1c9d)[_0xe855('0x2a')](handleEntityNotFound(_0x1890c5,null))[_0xe855('0x2a')](respondWithResult(_0x1890c5,null))['catch'](handleError(_0x1890c5,null));};exports['create']=function(_0x2e0e88,_0x27f14a){return db[_0xe855('0x32')][_0xe855('0x4f')](_0x2e0e88[_0xe855('0x50')],{})[_0xe855('0x2a')](respondWithResult(_0x27f14a,0xc9))[_0xe855('0x4a')](handleError(_0x27f14a,null));};exports[_0xe855('0x29')]=function(_0x567f25,_0x21511e){if(_0x567f25[_0xe855('0x50')]['id']){delete _0x567f25['body']['id'];}return db['SalesforceConfiguration'][_0xe855('0x4e')]({'where':{'id':_0x567f25[_0xe855('0x51')]['id']}})[_0xe855('0x2a')](handleEntityNotFound(_0x21511e,null))['then'](saveUpdates(_0x567f25[_0xe855('0x50')],null))[_0xe855('0x2a')](respondWithResult(_0x21511e,null))[_0xe855('0x4a')](handleError(_0x21511e,null));};exports['destroy']=function(_0x647b50,_0x7733b9){return db[_0xe855('0x32')][_0xe855('0x4e')]({'where':{'id':_0x647b50[_0xe855('0x51')]['id']}})[_0xe855('0x2a')](handleEntityNotFound(_0x7733b9,null))[_0xe855('0x2a')](removeEntity(_0x7733b9,null))[_0xe855('0x4a')](handleError(_0x7733b9,null));};exports[_0xe855('0x52')]=function(_0x59dbe2,_0x52afd1,_0x89d6cf){var _0x539957={};var _0x51e81e={};var _0x2ea5d8;var _0x430833;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x59dbe2['params']['id']}})[_0xe855('0x2a')](handleEntityNotFound(_0x52afd1,null))[_0xe855('0x2a')](function(_0x8c5910){if(_0x8c5910){_0x2ea5d8=_0x8c5910;_0x51e81e[_0xe855('0x3a')]=_[_0xe855('0x36')](db[_0xe855('0x53')]['rawAttributes']);_0x51e81e['query']=_[_0xe855('0x36')](_0x59dbe2['query']);_0x51e81e[_0xe855('0x38')]=_[_0xe855('0x39')](_0x51e81e['model'],_0x51e81e['query']);_0x539957[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x51e81e[_0xe855('0x3a')],qs[_0xe855('0x4c')](_0x59dbe2['query'][_0xe855('0x4c')]));_0x539957[_0xe855('0x3b')]=_0x539957[_0xe855('0x3b')]['length']?_0x539957[_0xe855('0x3b')]:_0x51e81e[_0xe855('0x3a')];_0x539957[_0xe855('0x3e')]=qs[_0xe855('0x54')](_0x59dbe2['query'][_0xe855('0x54')]);_0x539957[_0xe855('0x41')]=qs[_0xe855('0x38')](_[_0xe855('0x3f')](_0x59dbe2[_0xe855('0x37')],_0x51e81e['filters']));if(_0x59dbe2[_0xe855('0x37')][_0xe855('0x40')]){_0x539957[_0xe855('0x41')]=_[_0xe855('0x44')](_0x539957[_0xe855('0x41')],{'$or':_['map'](_0x539957[_0xe855('0x3b')],function(_0x584136){var _0x4c86e9={};_0x4c86e9[_0x584136]={'$like':'%'+_0x59dbe2['query'][_0xe855('0x40')]+'%'};return _0x4c86e9;})});}_0x539957=_[_0xe855('0x44')]({},_0x539957,_0x59dbe2[_0xe855('0x45')]);return _0x2ea5d8[_0xe855('0x52')](_0x539957);}})[_0xe855('0x2a')](function(_0x15b4bc){if(_0x15b4bc){_0x430833=_0x15b4bc[_0xe855('0x4d')];if(!_0x59dbe2[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x539957[_0xe855('0x21')]=qs[_0xe855('0x21')](_0x59dbe2[_0xe855('0x37')][_0xe855('0x21')]);_0x539957[_0xe855('0x24')]=qs[_0xe855('0x24')](_0x59dbe2[_0xe855('0x37')][_0xe855('0x24')]);}return _0x2ea5d8[_0xe855('0x52')](_0x539957);}})[_0xe855('0x2a')](function(_0x194f0f){if(_0x194f0f){return _0x194f0f?{'count':_0x430833,'rows':_0x194f0f}:null;}})[_0xe855('0x2a')](respondWithResult(_0x52afd1,null))[_0xe855('0x4a')](handleError(_0x52afd1,null));};exports[_0xe855('0x55')]=function(_0x307713,_0x12e0b3,_0xef4483){var _0x5c3fa3={};var _0x5ce068={};var _0x518d40;var _0xd1d9b2;return db[_0xe855('0x32')][_0xe855('0x56')]({'where':{'id':_0x307713[_0xe855('0x51')]['id']}})['then'](handleEntityNotFound(_0x12e0b3,null))['then'](function(_0x2c7721){if(_0x2c7721){_0x518d40=_0x2c7721;_0x5ce068['model']=_[_0xe855('0x36')](db[_0xe855('0x53')][_0xe855('0x33')]);_0x5ce068['query']=_[_0xe855('0x36')](_0x307713[_0xe855('0x37')]);_0x5ce068['filters']=_['intersection'](_0x5ce068[_0xe855('0x3a')],_0x5ce068['query']);_0x5c3fa3[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x5ce068[_0xe855('0x3a')],qs[_0xe855('0x4c')](_0x307713[_0xe855('0x37')][_0xe855('0x4c')]));_0x5c3fa3[_0xe855('0x3b')]=_0x5c3fa3[_0xe855('0x3b')][_0xe855('0x4d')]?_0x5c3fa3[_0xe855('0x3b')]:_0x5ce068[_0xe855('0x3a')];_0x5c3fa3[_0xe855('0x3e')]=qs['sort'](_0x307713['query'][_0xe855('0x54')]);_0x5c3fa3[_0xe855('0x41')]=qs[_0xe855('0x38')](_[_0xe855('0x3f')](_0x307713[_0xe855('0x37')],_0x5ce068[_0xe855('0x38')]));if(_0x307713[_0xe855('0x37')]['filter']){_0x5c3fa3[_0xe855('0x41')]=_[_0xe855('0x44')](_0x5c3fa3['where'],{'$or':_[_0xe855('0x31')](_0x5c3fa3['attributes'],function(_0x27d36f){var _0x274374={};_0x274374[_0x27d36f]={'$like':'%'+_0x307713[_0xe855('0x37')]['filter']+'%'};return _0x274374;})});}_0x5c3fa3=_[_0xe855('0x44')]({},_0x5c3fa3,_0x307713[_0xe855('0x45')]);return _0x518d40[_0xe855('0x55')](_0x5c3fa3);}})[_0xe855('0x2a')](function(_0x406c79){if(_0x406c79){_0xd1d9b2=_0x406c79[_0xe855('0x4d')];if(!_0x307713[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x5c3fa3['limit']=qs[_0xe855('0x21')](_0x307713[_0xe855('0x37')][_0xe855('0x21')]);_0x5c3fa3[_0xe855('0x24')]=qs[_0xe855('0x24')](_0x307713[_0xe855('0x37')][_0xe855('0x24')]);}return _0x518d40[_0xe855('0x55')](_0x5c3fa3);}})[_0xe855('0x2a')](function(_0x115958){if(_0x115958){return _0x115958?{'count':_0xd1d9b2,'rows':_0x115958}:null;}})['then'](respondWithResult(_0x12e0b3,null))[_0xe855('0x4a')](handleError(_0x12e0b3,null));};exports[_0xe855('0x57')]=function(_0x2c44a3,_0x38146d,_0x34ef7e){var _0x26e151={};var _0x3c7d09={};var _0x3d847a;var _0x1c194d;return db['SalesforceConfiguration'][_0xe855('0x56')]({'where':{'id':_0x2c44a3[_0xe855('0x51')]['id']}})['then'](handleEntityNotFound(_0x38146d,null))['then'](function(_0x4a4999){if(_0x4a4999){_0x3d847a=_0x4a4999;_0x3c7d09[_0xe855('0x3a')]=_[_0xe855('0x36')](db['SalesforceField'][_0xe855('0x33')]);_0x3c7d09[_0xe855('0x37')]=_[_0xe855('0x36')](_0x2c44a3[_0xe855('0x37')]);_0x3c7d09[_0xe855('0x38')]=_[_0xe855('0x39')](_0x3c7d09[_0xe855('0x3a')],_0x3c7d09[_0xe855('0x37')]);_0x26e151['attributes']=_[_0xe855('0x39')](_0x3c7d09['model'],qs['fields'](_0x2c44a3[_0xe855('0x37')]['fields']));_0x26e151[_0xe855('0x3b')]=_0x26e151[_0xe855('0x3b')][_0xe855('0x4d')]?_0x26e151['attributes']:_0x3c7d09['model'];_0x26e151[_0xe855('0x3e')]=qs[_0xe855('0x54')](_0x2c44a3['query']['sort']);_0x26e151[_0xe855('0x41')]=qs['filters'](_[_0xe855('0x3f')](_0x2c44a3[_0xe855('0x37')],_0x3c7d09[_0xe855('0x38')]));if(_0x2c44a3[_0xe855('0x37')]['filter']){_0x26e151[_0xe855('0x41')]=_[_0xe855('0x44')](_0x26e151[_0xe855('0x41')],{'$or':_['map'](_0x26e151['attributes'],function(_0x2e0e8e){var _0x337ee7={};_0x337ee7[_0x2e0e8e]={'$like':'%'+_0x2c44a3['query'][_0xe855('0x40')]+'%'};return _0x337ee7;})});}_0x26e151=_[_0xe855('0x44')]({},_0x26e151,_0x2c44a3[_0xe855('0x45')]);return _0x3d847a[_0xe855('0x57')](_0x26e151);}})[_0xe855('0x2a')](function(_0x13c8b8){if(_0x13c8b8){_0x1c194d=_0x13c8b8['length'];if(!_0x2c44a3[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x26e151['limit']=qs[_0xe855('0x21')](_0x2c44a3['query'][_0xe855('0x21')]);_0x26e151[_0xe855('0x24')]=qs['offset'](_0x2c44a3[_0xe855('0x37')][_0xe855('0x24')]);}return _0x3d847a['getDescriptions'](_0x26e151);}})[_0xe855('0x2a')](function(_0xf2281){if(_0xf2281){return _0xf2281?{'count':_0x1c194d,'rows':_0xf2281}:null;}})[_0xe855('0x2a')](respondWithResult(_0x38146d,null))[_0xe855('0x4a')](handleError(_0x38146d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index bec67d5..9240d90 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 _0x9b43=['exports','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','request-promise','path','./intSalesforceConfiguration.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b43,0x1b1));var _0x39b4=function(_0x405c22,_0x4ae0e0){_0x405c22=_0x405c22-0x0;var _0x2aeeaf=_0x9b43[_0x405c22];return _0x2aeeaf;};'use strict';var _=require('lodash');var util=require(_0x39b4('0x0'));var logger=require(_0x39b4('0x1'))(_0x39b4('0x2'));var moment=require(_0x39b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x39b4('0x4'));var fs=require('fs');var path=require(_0x39b4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x39b4('0x6'));module[_0x39b4('0x7')]=function(_0x477626,_0x1a83c1){return _0x477626['define'](_0x39b4('0x8'),attributes,{'tableName':_0x39b4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1ed=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','../../config/logger'];(function(_0x5375fd,_0x50887f){var _0x142671=function(_0x1f6139){while(--_0x1f6139){_0x5375fd['push'](_0x5375fd['shift']());}};_0x142671(++_0x50887f);}(_0xb1ed,0x8b));var _0xdb1e=function(_0x96691d,_0x544a9d){_0x96691d=_0x96691d-0x0;var _0x5a79ca=_0xb1ed[_0x96691d];return _0x5a79ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb1e('0x0'))('api');var moment=require('moment');var BPromise=require(_0xdb1e('0x1'));var rp=require(_0xdb1e('0x2'));var fs=require('fs');var path=require(_0xdb1e('0x3'));var rimraf=require(_0xdb1e('0x4'));var config=require(_0xdb1e('0x5'));var attributes=require(_0xdb1e('0x6'));module[_0xdb1e('0x7')]=function(_0x5bcc39,_0x250622){return _0x5bcc39[_0xdb1e('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xdb1e('0x9'),'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 652503c..8a61a2f 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 _0x2ae7=['stringify','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x2ae7,0x148));var _0x72ae=function(_0x25bd6c,_0x4f7907){_0x25bd6c=_0x25bd6c-0x0;var _0x48a2a7=_0x2ae7[_0x25bd6c];return _0x48a2a7;};'use strict';var _=require(_0x72ae('0x0'));var util=require('util');var moment=require(_0x72ae('0x1'));var BPromise=require(_0x72ae('0x2'));var rs=require(_0x72ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72ae('0x4'))['db'];var utils=require(_0x72ae('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x72ae('0x6'));var jayson=require(_0x72ae('0x7'));var client=jayson['client'][_0x72ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40f41c,_0x152af2,_0x1aec56){return new BPromise(function(_0x45d43,_0x2cf400){return client[_0x72ae('0x9')](_0x40f41c,_0x1aec56)[_0x72ae('0xa')](function(_0x597bab){logger['info'](_0x72ae('0xb'),_0x152af2,_0x72ae('0xc'));logger['debug'](_0x72ae('0xd'),_0x152af2,'request\x20sent',JSON[_0x72ae('0xe')](_0x597bab));if(_0x597bab['error']){if(_0x597bab[_0x72ae('0xf')][_0x72ae('0x10')]===0x1f4){logger[_0x72ae('0xf')](_0x72ae('0xb'),_0x152af2,_0x597bab[_0x72ae('0xf')][_0x72ae('0x11')]);return _0x2cf400(_0x597bab[_0x72ae('0xf')][_0x72ae('0x11')]);}logger[_0x72ae('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x152af2,_0x597bab[_0x72ae('0xf')][_0x72ae('0x11')]);return _0x45d43(_0x597bab[_0x72ae('0xf')][_0x72ae('0x11')]);}else{logger[_0x72ae('0x12')](_0x72ae('0xb'),_0x152af2,_0x72ae('0xc'));_0x45d43(_0x597bab['result'][_0x72ae('0x11')]);}})['catch'](function(_0x1deb73){logger[_0x72ae('0xf')](_0x72ae('0xb'),_0x152af2,_0x1deb73);_0x2cf400(_0x1deb73);});});} \ No newline at end of file +var _0xd6ef=['SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x45cd1e,_0x43d3be){var _0x861aed=function(_0x242c86){while(--_0x242c86){_0x45cd1e['push'](_0x45cd1e['shift']());}};_0x861aed(++_0x43d3be);}(_0xd6ef,0x167));var _0xfd6e=function(_0x4985d6,_0x2aa916){_0x4985d6=_0x4985d6-0x0;var _0x94b0db=_0xd6ef[_0x4985d6];return _0x94b0db;};'use strict';var _=require(_0xfd6e('0x0'));var util=require(_0xfd6e('0x1'));var moment=require(_0xfd6e('0x2'));var BPromise=require(_0xfd6e('0x3'));var rs=require(_0xfd6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd6e('0x5'))['db'];var utils=require(_0xfd6e('0x6'));var logger=require(_0xfd6e('0x7'))(_0xfd6e('0x8'));var config=require(_0xfd6e('0x9'));var jayson=require(_0xfd6e('0xa'));var client=jayson[_0xfd6e('0xb')][_0xfd6e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ce61e,_0x5a7c98,_0x4fa6d7){return new BPromise(function(_0x253f92,_0x3c26df){return client[_0xfd6e('0xd')](_0x2ce61e,_0x4fa6d7)[_0xfd6e('0xe')](function(_0x55f76c){logger[_0xfd6e('0xf')](_0xfd6e('0x10'),_0x5a7c98,'request\x20sent');logger[_0xfd6e('0x11')](_0xfd6e('0x12'),_0x5a7c98,'request\x20sent',JSON[_0xfd6e('0x13')](_0x55f76c));if(_0x55f76c[_0xfd6e('0x14')]){if(_0x55f76c[_0xfd6e('0x14')][_0xfd6e('0x15')]===0x1f4){logger[_0xfd6e('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a7c98,_0x55f76c[_0xfd6e('0x14')]['message']);return _0x3c26df(_0x55f76c[_0xfd6e('0x14')][_0xfd6e('0x16')]);}logger[_0xfd6e('0x14')](_0xfd6e('0x10'),_0x5a7c98,_0x55f76c[_0xfd6e('0x14')][_0xfd6e('0x16')]);return _0x253f92(_0x55f76c['error'][_0xfd6e('0x16')]);}else{logger[_0xfd6e('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a7c98,_0xfd6e('0x17'));_0x253f92(_0x55f76c['result'][_0xfd6e('0x16')]);}})[_0xfd6e('0x18')](function(_0x3a6714){logger[_0xfd6e('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a7c98,_0x3a6714);_0x3c26df(_0x3a6714);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index c3548c9..d2aec8a 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 _0x9aa1=['exports','util','connect-timeout','Router','fs-extra','../../config/environment','./intSalesforceField.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x123566,_0x2e9776){var _0x113648=function(_0x1d1ca1){while(--_0x1d1ca1){_0x123566['push'](_0x123566['shift']());}};_0x113648(++_0x2e9776);}(_0x9aa1,0xc1));var _0x19aa=function(_0x527852,_0x43efba){_0x527852=_0x527852-0x0;var _0x584d6f=_0x9aa1[_0x527852];return _0x584d6f;};'use strict';var multer=require('multer');var util=require(_0x19aa('0x0'));var path=require('path');var timeout=require(_0x19aa('0x1'));var express=require('express');var router=express[_0x19aa('0x2')]();var fs_extra=require(_0x19aa('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x19aa('0x4'));var controller=require(_0x19aa('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x19aa('0x6')]);router['get'](_0x19aa('0x7'),auth[_0x19aa('0x8')](),controller[_0x19aa('0x9')]);router[_0x19aa('0xa')]('/',auth['isAuthenticated'](),controller[_0x19aa('0xb')]);router[_0x19aa('0xc')]('/:id',auth[_0x19aa('0x8')](),controller[_0x19aa('0xd')]);router[_0x19aa('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x19aa('0xf')]=router; \ No newline at end of file +var _0x1417=['show','post','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1b17b2,_0x3cd228){var _0x2d1db6=function(_0x283073){while(--_0x283073){_0x1b17b2['push'](_0x1b17b2['shift']());}};_0x2d1db6(++_0x3cd228);}(_0x1417,0x113));var _0x7141=function(_0x513f94,_0x3133ef){_0x513f94=_0x513f94-0x0;var _0x3ff78e=_0x1417[_0x513f94];return _0x3ff78e;};'use strict';var multer=require(_0x7141('0x0'));var util=require(_0x7141('0x1'));var path=require(_0x7141('0x2'));var timeout=require(_0x7141('0x3'));var express=require(_0x7141('0x4'));var router=express[_0x7141('0x5')]();var fs_extra=require(_0x7141('0x6'));var auth=require(_0x7141('0x7'));var interaction=require(_0x7141('0x8'));var config=require(_0x7141('0x9'));var controller=require('./intSalesforceField.controller');router[_0x7141('0xa')]('/',auth[_0x7141('0xb')](),controller[_0x7141('0xc')]);router['get']('/:id',auth[_0x7141('0xb')](),controller[_0x7141('0xd')]);router[_0x7141('0xe')]('/',auth[_0x7141('0xb')](),controller['create']);router['put'](_0x7141('0xf'),auth[_0x7141('0xb')](),controller['update']);router['delete'](_0x7141('0xf'),auth[_0x7141('0xb')](),controller[_0x7141('0x10')]);module[_0x7141('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index c0b2163..1ff54ea 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 _0x9c08=['sequelize','string','variable','customVariable','keyValue','STRING'];(function(_0x328507,_0x458028){var _0x4840c4=function(_0x409667){while(--_0x409667){_0x328507['push'](_0x328507['shift']());}};_0x4840c4(++_0x458028);}(_0x9c08,0x120));var _0x89c0=function(_0x4fbc7a,_0x3dbc92){_0x4fbc7a=_0x4fbc7a-0x0;var _0x479760=_0x9c08[_0x4fbc7a];return _0x479760;};'use strict';var Sequelize=require(_0x89c0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x89c0('0x1'),_0x89c0('0x2'),_0x89c0('0x3'),_0x89c0('0x4'),'picklist'),'defaultValue':_0x89c0('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x89c0('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x89c0('0x1'),'variable',_0x89c0('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x89c0('0x5')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbb4f=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0xe92c5a,_0x18e52f){var _0x40c1bc=function(_0x5eb609){while(--_0x5eb609){_0xe92c5a['push'](_0xe92c5a['shift']());}};_0x40c1bc(++_0x18e52f);}(_0xbb4f,0x192));var _0xfbb4=function(_0x3d3a2a,_0x83b460){_0x3d3a2a=_0x3d3a2a-0x0;var _0x428045=_0xbb4f[_0x3d3a2a];return _0x428045;};'use strict';var Sequelize=require(_0xfbb4('0x0'));module[_0xfbb4('0x1')]={'type':{'type':Sequelize[_0xfbb4('0x2')](_0xfbb4('0x3'),_0xfbb4('0x4'),_0xfbb4('0x5'),_0xfbb4('0x6'),_0xfbb4('0x7')),'defaultValue':_0xfbb4('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfbb4('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xfbb4('0x4'),_0xfbb4('0x5'))},'keyContent':{'type':Sequelize[_0xfbb4('0x8')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xfbb4('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index dc26db0..8c95492 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 _0x2463=['SalesforceField','includeAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','keys','intersection','model','query','attributes','fields','length','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','options'];(function(_0x3c9c53,_0x1279c0){var _0x4288ad=function(_0x4b89b1){while(--_0x4b89b1){_0x3c9c53['push'](_0x3c9c53['shift']());}};_0x4288ad(++_0x1279c0);}(_0x2463,0x1d2));var _0x3246=function(_0xc2a91a,_0x1c7b57){_0xc2a91a=_0xc2a91a-0x0;var _0x2fe58f=_0x2463[_0xc2a91a];return _0x2fe58f;};'use strict';var emlformat=require(_0x3246('0x0'));var rimraf=require(_0x3246('0x1'));var zipdir=require(_0x3246('0x2'));var jsonpatch=require(_0x3246('0x3'));var rp=require(_0x3246('0x4'));var moment=require(_0x3246('0x5'));var BPromise=require(_0x3246('0x6'));var Mustache=require(_0x3246('0x7'));var util=require(_0x3246('0x8'));var path=require(_0x3246('0x9'));var sox=require(_0x3246('0xa'));var csv=require(_0x3246('0xb'));var ejs=require(_0x3246('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3246('0xd'));var squel=require(_0x3246('0xe'));var crypto=require(_0x3246('0xf'));var jsforce=require(_0x3246('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3246('0xb'));var querystring=require(_0x3246('0x11'));var Papa=require('papaparse');var Redis=require(_0x3246('0x12'));var authService=require(_0x3246('0x13'));var qs=require(_0x3246('0x14'));var as=require(_0x3246('0x15'));var hardwareService=require(_0x3246('0x16'));var logger=require(_0x3246('0x17'))('api');var utils=require(_0x3246('0x18'));var config=require(_0x3246('0x19'));var licenseUtil=require(_0x3246('0x1a'));var db=require(_0x3246('0x1b'))['db'];function respondWithStatusCode(_0x39ea78,_0x3bcaa9){_0x3bcaa9=_0x3bcaa9||0xcc;return function(_0x3653ed){if(_0x3653ed){return _0x39ea78[_0x3246('0x1c')](_0x3bcaa9);}return _0x39ea78[_0x3246('0x1d')](_0x3bcaa9)[_0x3246('0x1e')]();};}function respondWithResult(_0x43d43f,_0x258a1c){_0x258a1c=_0x258a1c||0xc8;return function(_0x5d805c){if(_0x5d805c){return _0x43d43f[_0x3246('0x1d')](_0x258a1c)[_0x3246('0x1f')](_0x5d805c);}};}function respondWithFilteredResult(_0x2469b5,_0x563677){return function(_0xfce32a){if(_0xfce32a){var _0x15c702=typeof _0x563677[_0x3246('0x20')]===_0x3246('0x21')&&typeof _0x563677['limit']===_0x3246('0x21');var _0x315f5e=_0xfce32a['count'];var _0x20511b=_0x15c702?0x0:_0x563677[_0x3246('0x20')];var _0x22fb2f=_0x15c702?_0xfce32a[_0x3246('0x22')]:_0x563677[_0x3246('0x20')]+_0x563677[_0x3246('0x23')];var _0x119a37;if(_0x22fb2f>=_0x315f5e){_0x22fb2f=_0x315f5e;_0x119a37=0xc8;}else{_0x119a37=0xce;}_0x2469b5[_0x3246('0x1d')](_0x119a37);return _0x2469b5[_0x3246('0x24')](_0x3246('0x25'),_0x20511b+'-'+_0x22fb2f+'/'+_0x315f5e)[_0x3246('0x1f')](_0xfce32a);}return null;};}function patchUpdates(_0x4e4b2e){return function(_0x1833cb){try{jsonpatch['apply'](_0x1833cb,_0x4e4b2e,!![]);}catch(_0x446df1){return BPromise[_0x3246('0x26')](_0x446df1);}return _0x1833cb['save']();};}function saveUpdates(_0x7211ec,_0xea505c){return function(_0x18771a){if(_0x18771a){return _0x18771a[_0x3246('0x27')](_0x7211ec)[_0x3246('0x28')](function(_0x4338e5){return _0x4338e5;});}return null;};}function removeEntity(_0x14455c,_0x5e84c1){return function(_0x23c059){if(_0x23c059){return _0x23c059[_0x3246('0x29')]()[_0x3246('0x28')](function(){_0x14455c['status'](0xcc)[_0x3246('0x1e')]();});}};}function handleEntityNotFound(_0x3d0666,_0x3a7b82){return function(_0x2f9a45){if(!_0x2f9a45){_0x3d0666[_0x3246('0x1c')](0x194);}return _0x2f9a45;};}function handleError(_0x5a4cc8,_0xf1d2a1){_0xf1d2a1=_0xf1d2a1||0x1f4;return function(_0x24dcff){logger[_0x3246('0x2a')](_0x24dcff[_0x3246('0x2b')]);if(_0x24dcff['name']){delete _0x24dcff[_0x3246('0x2c')];}_0x5a4cc8[_0x3246('0x1d')](_0xf1d2a1)[_0x3246('0x2d')](_0x24dcff);};}exports['index']=function(_0x4dfa19,_0x5153f5){var _0x408b47={},_0x4e4d06={},_0x2d4925={'count':0x0,'rows':[]};var _0x17d318=_[_0x3246('0x2e')](db['SalesforceField'][_0x3246('0x2f')],function(_0x1fffa7){return{'name':_0x1fffa7['fieldName'],'type':_0x1fffa7[_0x3246('0x30')][_0x3246('0x31')]};});_0x4e4d06['model']=_[_0x3246('0x2e')](_0x17d318,_0x3246('0x2c'));_0x4e4d06['query']=_[_0x3246('0x32')](_0x4dfa19['query']);_0x4e4d06['filters']=_[_0x3246('0x33')](_0x4e4d06[_0x3246('0x34')],_0x4e4d06[_0x3246('0x35')]);_0x408b47[_0x3246('0x36')]=_[_0x3246('0x33')](_0x4e4d06[_0x3246('0x34')],qs[_0x3246('0x37')](_0x4dfa19[_0x3246('0x35')][_0x3246('0x37')]));_0x408b47[_0x3246('0x36')]=_0x408b47['attributes'][_0x3246('0x38')]?_0x408b47[_0x3246('0x36')]:_0x4e4d06['model'];if(!_0x4dfa19[_0x3246('0x35')]['hasOwnProperty'](_0x3246('0x39'))){_0x408b47[_0x3246('0x23')]=qs['limit'](_0x4dfa19['query'][_0x3246('0x23')]);_0x408b47[_0x3246('0x20')]=qs['offset'](_0x4dfa19[_0x3246('0x35')]['offset']);}_0x408b47[_0x3246('0x3a')]=qs[_0x3246('0x3b')](_0x4dfa19['query'][_0x3246('0x3b')]);_0x408b47['where']=qs[_0x3246('0x3c')](_[_0x3246('0x3d')](_0x4dfa19[_0x3246('0x35')],_0x4e4d06[_0x3246('0x3c')]),_0x17d318);if(_0x4dfa19[_0x3246('0x35')]['filter']){_0x408b47['where']=_[_0x3246('0x3e')](_0x408b47[_0x3246('0x3f')],{'$or':_[_0x3246('0x2e')](_0x17d318,function(_0x31f4ed){if(_0x31f4ed[_0x3246('0x30')]!==_0x3246('0x40')){var _0x3de59d={};_0x3de59d[_0x31f4ed[_0x3246('0x2c')]]={'$like':'%'+_0x4dfa19[_0x3246('0x35')]['filter']+'%'};return _0x3de59d;}})});}_0x408b47=_[_0x3246('0x3e')]({},_0x408b47,_0x4dfa19[_0x3246('0x41')]);var _0xbd4c3f={'where':_0x408b47[_0x3246('0x3f')]};return db[_0x3246('0x42')][_0x3246('0x22')](_0xbd4c3f)[_0x3246('0x28')](function(_0xcaf254){_0x2d4925[_0x3246('0x22')]=_0xcaf254;if(_0x4dfa19[_0x3246('0x35')][_0x3246('0x43')]){_0x408b47['include']=[{'all':!![]}];}return db[_0x3246('0x42')]['findAll'](_0x408b47);})[_0x3246('0x28')](function(_0x379674){_0x2d4925[_0x3246('0x44')]=_0x379674;return _0x2d4925;})[_0x3246('0x28')](respondWithFilteredResult(_0x5153f5,_0x408b47))['catch'](handleError(_0x5153f5,null));};exports[_0x3246('0x45')]=function(_0x48edb0,_0x2072a4){var _0x4b4c4f={'raw':!![],'where':{'id':_0x48edb0[_0x3246('0x46')]['id']}},_0x4b6b32={};_0x4b6b32[_0x3246('0x34')]=_[_0x3246('0x32')](db[_0x3246('0x42')][_0x3246('0x2f')]);_0x4b6b32[_0x3246('0x35')]=_[_0x3246('0x32')](_0x48edb0[_0x3246('0x35')]);_0x4b6b32[_0x3246('0x3c')]=_['intersection'](_0x4b6b32['model'],_0x4b6b32[_0x3246('0x35')]);_0x4b4c4f['attributes']=_['intersection'](_0x4b6b32[_0x3246('0x34')],qs[_0x3246('0x37')](_0x48edb0[_0x3246('0x35')][_0x3246('0x37')]));_0x4b4c4f[_0x3246('0x36')]=_0x4b4c4f[_0x3246('0x36')][_0x3246('0x38')]?_0x4b4c4f[_0x3246('0x36')]:_0x4b6b32[_0x3246('0x34')];if(_0x48edb0[_0x3246('0x35')][_0x3246('0x43')]){_0x4b4c4f[_0x3246('0x47')]=[{'all':!![]}];}_0x4b4c4f=_['merge']({},_0x4b4c4f,_0x48edb0[_0x3246('0x41')]);return db['SalesforceField'][_0x3246('0x48')](_0x4b4c4f)[_0x3246('0x28')](handleEntityNotFound(_0x2072a4,null))[_0x3246('0x28')](respondWithResult(_0x2072a4,null))[_0x3246('0x49')](handleError(_0x2072a4,null));};exports['create']=function(_0x1f120f,_0x12ccce){return db[_0x3246('0x42')][_0x3246('0x4a')](_0x1f120f['body'],{})[_0x3246('0x28')](respondWithResult(_0x12ccce,0xc9))[_0x3246('0x49')](handleError(_0x12ccce,null));};exports[_0x3246('0x27')]=function(_0x2ed3e8,_0x32e598){if(_0x2ed3e8[_0x3246('0x4b')]['id']){delete _0x2ed3e8['body']['id'];}return db[_0x3246('0x42')][_0x3246('0x48')]({'where':{'id':_0x2ed3e8[_0x3246('0x46')]['id']}})['then'](handleEntityNotFound(_0x32e598,null))['then'](saveUpdates(_0x2ed3e8[_0x3246('0x4b')],null))['then'](respondWithResult(_0x32e598,null))['catch'](handleError(_0x32e598,null));};exports[_0x3246('0x29')]=function(_0x377ac1,_0x32266e){return db[_0x3246('0x42')][_0x3246('0x48')]({'where':{'id':_0x377ac1[_0x3246('0x46')]['id']}})[_0x3246('0x28')](handleEntityNotFound(_0x32266e,null))['then'](removeEntity(_0x32266e,null))[_0x3246('0x49')](handleError(_0x32266e,null));}; \ No newline at end of file +var _0xfc9f=['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','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SalesforceField','includeAll','include','findAll','catch','keys','intersection','create','body','find','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x45029d,_0x3c7d08){var _0x5af9a9=function(_0x24c1cf){while(--_0x24c1cf){_0x45029d['push'](_0x45029d['shift']());}};_0x5af9a9(++_0x3c7d08);}(_0xfc9f,0x11d));var _0xffc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc9f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xffc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffc9('0x1'));var jsonpatch=require(_0xffc9('0x2'));var rp=require(_0xffc9('0x3'));var moment=require(_0xffc9('0x4'));var BPromise=require(_0xffc9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xffc9('0x6'));var ejs=require(_0xffc9('0x7'));var fs=require('fs');var fs_extra=require(_0xffc9('0x8'));var _=require('lodash');var squel=require(_0xffc9('0x9'));var crypto=require(_0xffc9('0xa'));var jsforce=require(_0xffc9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xffc9('0x6'));var querystring=require('querystring');var Papa=require(_0xffc9('0xc'));var Redis=require(_0xffc9('0xd'));var authService=require(_0xffc9('0xe'));var qs=require(_0xffc9('0xf'));var as=require(_0xffc9('0x10'));var hardwareService=require(_0xffc9('0x11'));var logger=require(_0xffc9('0x12'))(_0xffc9('0x13'));var utils=require(_0xffc9('0x14'));var config=require(_0xffc9('0x15'));var licenseUtil=require(_0xffc9('0x16'));var db=require(_0xffc9('0x17'))['db'];function respondWithStatusCode(_0x3dc9c6,_0x25e2a3){_0x25e2a3=_0x25e2a3||0xcc;return function(_0x4deaf5){if(_0x4deaf5){return _0x3dc9c6['sendStatus'](_0x25e2a3);}return _0x3dc9c6[_0xffc9('0x18')](_0x25e2a3)[_0xffc9('0x19')]();};}function respondWithResult(_0x2dc1c7,_0x625a2c){_0x625a2c=_0x625a2c||0xc8;return function(_0xc614b7){if(_0xc614b7){return _0x2dc1c7[_0xffc9('0x18')](_0x625a2c)[_0xffc9('0x1a')](_0xc614b7);}};}function respondWithFilteredResult(_0x40438f,_0x181750){return function(_0x15fdeb){if(_0x15fdeb){var _0x3cd064=typeof _0x181750['offset']===_0xffc9('0x1b')&&typeof _0x181750[_0xffc9('0x1c')]===_0xffc9('0x1b');var _0x2f9c31=_0x15fdeb[_0xffc9('0x1d')];var _0x301a3d=_0x3cd064?0x0:_0x181750[_0xffc9('0x1e')];var _0xa81577=_0x3cd064?_0x15fdeb[_0xffc9('0x1d')]:_0x181750['offset']+_0x181750[_0xffc9('0x1c')];var _0x3c9461;if(_0xa81577>=_0x2f9c31){_0xa81577=_0x2f9c31;_0x3c9461=0xc8;}else{_0x3c9461=0xce;}_0x40438f['status'](_0x3c9461);return _0x40438f[_0xffc9('0x1f')](_0xffc9('0x20'),_0x301a3d+'-'+_0xa81577+'/'+_0x2f9c31)[_0xffc9('0x1a')](_0x15fdeb);}return null;};}function patchUpdates(_0x371a05){return function(_0x5dba2d){try{jsonpatch[_0xffc9('0x21')](_0x5dba2d,_0x371a05,!![]);}catch(_0x21b19f){return BPromise[_0xffc9('0x22')](_0x21b19f);}return _0x5dba2d[_0xffc9('0x23')]();};}function saveUpdates(_0x1999e7,_0x40dd47){return function(_0x2cfde9){if(_0x2cfde9){return _0x2cfde9[_0xffc9('0x24')](_0x1999e7)[_0xffc9('0x25')](function(_0x4f1fae){return _0x4f1fae;});}return null;};}function removeEntity(_0x2687bb,_0x53e36f){return function(_0x28b3ef){if(_0x28b3ef){return _0x28b3ef['destroy']()[_0xffc9('0x25')](function(){_0x2687bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8d90,_0x4488eb){return function(_0x32bb8c){if(!_0x32bb8c){_0x4a8d90[_0xffc9('0x26')](0x194);}return _0x32bb8c;};}function handleError(_0xab17b5,_0x409cdc){_0x409cdc=_0x409cdc||0x1f4;return function(_0xdf6f3f){logger[_0xffc9('0x27')](_0xdf6f3f[_0xffc9('0x28')]);if(_0xdf6f3f['name']){delete _0xdf6f3f[_0xffc9('0x29')];}_0xab17b5['status'](_0x409cdc)[_0xffc9('0x2a')](_0xdf6f3f);};}exports[_0xffc9('0x2b')]=function(_0x29c0d7,_0x44f3c4){var _0x71a7a9={},_0x540a2e={},_0x73f9f9={'count':0x0,'rows':[]};var _0x57ce2c=_[_0xffc9('0x2c')](db['SalesforceField'][_0xffc9('0x2d')],function(_0x3806ca){return{'name':_0x3806ca[_0xffc9('0x2e')],'type':_0x3806ca[_0xffc9('0x2f')]['key']};});_0x540a2e[_0xffc9('0x30')]=_['map'](_0x57ce2c,_0xffc9('0x29'));_0x540a2e[_0xffc9('0x31')]=_['keys'](_0x29c0d7['query']);_0x540a2e['filters']=_['intersection'](_0x540a2e[_0xffc9('0x30')],_0x540a2e[_0xffc9('0x31')]);_0x71a7a9[_0xffc9('0x32')]=_['intersection'](_0x540a2e[_0xffc9('0x30')],qs[_0xffc9('0x33')](_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x33')]));_0x71a7a9[_0xffc9('0x32')]=_0x71a7a9[_0xffc9('0x32')][_0xffc9('0x34')]?_0x71a7a9[_0xffc9('0x32')]:_0x540a2e[_0xffc9('0x30')];if(!_0x29c0d7[_0xffc9('0x31')]['hasOwnProperty']('nolimit')){_0x71a7a9[_0xffc9('0x1c')]=qs[_0xffc9('0x1c')](_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x1c')]);_0x71a7a9[_0xffc9('0x1e')]=qs['offset'](_0x29c0d7[_0xffc9('0x31')]['offset']);}_0x71a7a9[_0xffc9('0x35')]=qs[_0xffc9('0x36')](_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x36')]);_0x71a7a9[_0xffc9('0x37')]=qs[_0xffc9('0x38')](_[_0xffc9('0x39')](_0x29c0d7['query'],_0x540a2e['filters']),_0x57ce2c);if(_0x29c0d7['query'][_0xffc9('0x3a')]){_0x71a7a9[_0xffc9('0x37')]=_[_0xffc9('0x3b')](_0x71a7a9['where'],{'$or':_['map'](_0x57ce2c,function(_0x5cae74){if(_0x5cae74[_0xffc9('0x2f')]!==_0xffc9('0x3c')){var _0x5ac22b={};_0x5ac22b[_0x5cae74[_0xffc9('0x29')]]={'$like':'%'+_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x3a')]+'%'};return _0x5ac22b;}})});}_0x71a7a9=_['merge']({},_0x71a7a9,_0x29c0d7[_0xffc9('0x3d')]);var _0x1678a6={'where':_0x71a7a9[_0xffc9('0x37')]};return db[_0xffc9('0x3e')][_0xffc9('0x1d')](_0x1678a6)[_0xffc9('0x25')](function(_0x81d528){_0x73f9f9[_0xffc9('0x1d')]=_0x81d528;if(_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x3f')]){_0x71a7a9[_0xffc9('0x40')]=[{'all':!![]}];}return db[_0xffc9('0x3e')][_0xffc9('0x41')](_0x71a7a9);})[_0xffc9('0x25')](function(_0x1a3b0f){_0x73f9f9['rows']=_0x1a3b0f;return _0x73f9f9;})[_0xffc9('0x25')](respondWithFilteredResult(_0x44f3c4,_0x71a7a9))[_0xffc9('0x42')](handleError(_0x44f3c4,null));};exports['show']=function(_0x2ee7b5,_0x1bffec){var _0x59b29a={'raw':!![],'where':{'id':_0x2ee7b5['params']['id']}},_0x5807ff={};_0x5807ff[_0xffc9('0x30')]=_[_0xffc9('0x43')](db[_0xffc9('0x3e')][_0xffc9('0x2d')]);_0x5807ff[_0xffc9('0x31')]=_[_0xffc9('0x43')](_0x2ee7b5['query']);_0x5807ff[_0xffc9('0x38')]=_[_0xffc9('0x44')](_0x5807ff[_0xffc9('0x30')],_0x5807ff[_0xffc9('0x31')]);_0x59b29a['attributes']=_['intersection'](_0x5807ff[_0xffc9('0x30')],qs[_0xffc9('0x33')](_0x2ee7b5[_0xffc9('0x31')][_0xffc9('0x33')]));_0x59b29a[_0xffc9('0x32')]=_0x59b29a[_0xffc9('0x32')][_0xffc9('0x34')]?_0x59b29a[_0xffc9('0x32')]:_0x5807ff[_0xffc9('0x30')];if(_0x2ee7b5[_0xffc9('0x31')]['includeAll']){_0x59b29a[_0xffc9('0x40')]=[{'all':!![]}];}_0x59b29a=_[_0xffc9('0x3b')]({},_0x59b29a,_0x2ee7b5[_0xffc9('0x3d')]);return db['SalesforceField']['find'](_0x59b29a)[_0xffc9('0x25')](handleEntityNotFound(_0x1bffec,null))[_0xffc9('0x25')](respondWithResult(_0x1bffec,null))['catch'](handleError(_0x1bffec,null));};exports['create']=function(_0x4dde9a,_0x386b96){return db[_0xffc9('0x3e')][_0xffc9('0x45')](_0x4dde9a[_0xffc9('0x46')],{})[_0xffc9('0x25')](respondWithResult(_0x386b96,0xc9))['catch'](handleError(_0x386b96,null));};exports[_0xffc9('0x24')]=function(_0x36151d,_0x324e1c){if(_0x36151d[_0xffc9('0x46')]['id']){delete _0x36151d[_0xffc9('0x46')]['id'];}return db[_0xffc9('0x3e')][_0xffc9('0x47')]({'where':{'id':_0x36151d[_0xffc9('0x48')]['id']}})[_0xffc9('0x25')](handleEntityNotFound(_0x324e1c,null))['then'](saveUpdates(_0x36151d[_0xffc9('0x46')],null))['then'](respondWithResult(_0x324e1c,null))['catch'](handleError(_0x324e1c,null));};exports[_0xffc9('0x49')]=function(_0x284a20,_0x255192){return db['SalesforceField']['find']({'where':{'id':_0x284a20[_0xffc9('0x48')]['id']}})[_0xffc9('0x25')](handleEntityNotFound(_0x255192,null))['then'](removeEntity(_0x255192,null))[_0xffc9('0x42')](handleError(_0x255192,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 88830d4..d8a1adb 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 _0xc2bd=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes'];(function(_0x268761,_0x5b5bf3){var _0x45c3ef=function(_0x44bb2f){while(--_0x44bb2f){_0x268761['push'](_0x268761['shift']());}};_0x45c3ef(++_0x5b5bf3);}(_0xc2bd,0x197));var _0xdc2b=function(_0x57289a,_0x9e7b11){_0x57289a=_0x57289a-0x0;var _0x3417b4=_0xc2bd[_0x57289a];return _0x3417b4;};'use strict';var _=require(_0xdc2b('0x0'));var util=require(_0xdc2b('0x1'));var logger=require('../../config/logger')(_0xdc2b('0x2'));var moment=require(_0xdc2b('0x3'));var BPromise=require(_0xdc2b('0x4'));var rp=require(_0xdc2b('0x5'));var fs=require('fs');var path=require(_0xdc2b('0x6'));var rimraf=require('rimraf');var config=require(_0xdc2b('0x7'));var attributes=require(_0xdc2b('0x8'));module[_0xdc2b('0x9')]=function(_0xd24127,_0x2a59e9){return _0xd24127[_0xdc2b('0xa')](_0xdc2b('0xb'),attributes,{'tableName':_0xdc2b('0xc'),'paranoid':![],'indexes':[{'name':_0xdc2b('0xd'),'fields':[_0xdc2b('0xe'),_0xdc2b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ab0=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment','bluebird','rimraf','../../config/environment'];(function(_0x5ccb02,_0x3588fb){var _0x52a833=function(_0x1b61d5){while(--_0x1b61d5){_0x5ccb02['push'](_0x5ccb02['shift']());}};_0x52a833(++_0x3588fb);}(_0x6ab0,0x1ac));var _0x06ab=function(_0x3e4879,_0x373530){_0x3e4879=_0x3e4879-0x0;var _0x1c6a07=_0x6ab0[_0x3e4879];return _0x1c6a07;};'use strict';var _=require(_0x06ab('0x0'));var util=require(_0x06ab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x06ab('0x2'));var BPromise=require(_0x06ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x06ab('0x4'));var config=require(_0x06ab('0x5'));var attributes=require(_0x06ab('0x6'));module[_0x06ab('0x7')]=function(_0x418474,_0x4b7bce){return _0x418474[_0x06ab('0x8')](_0x06ab('0x9'),attributes,{'tableName':_0x06ab('0xa'),'paranoid':![],'indexes':[{'name':_0x06ab('0xb'),'fields':[_0x06ab('0xc'),_0x06ab('0xd')],'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 58d07d9..2b49b5a 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 _0x7c99=['SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x7c99,0x16d));var _0x97c9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7c99[_0x432682];return _0x463d05;};'use strict';var _=require(_0x97c9('0x0'));var util=require('util');var moment=require(_0x97c9('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c9('0x2'));var fs=require('fs');var Redis=require(_0x97c9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x97c9('0x4'));var logger=require(_0x97c9('0x5'))('rpc');var config=require(_0x97c9('0x6'));var jayson=require(_0x97c9('0x7'));var client=jayson[_0x97c9('0x8')][_0x97c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12ca78,_0x41508a,_0x1696a5){return new BPromise(function(_0x489f4e,_0x24a56e){return client[_0x97c9('0xa')](_0x12ca78,_0x1696a5)[_0x97c9('0xb')](function(_0x2fe2a5){logger[_0x97c9('0xc')](_0x97c9('0xd'),_0x41508a,'request\x20sent');logger['debug'](_0x97c9('0xe'),_0x41508a,_0x97c9('0xf'),JSON[_0x97c9('0x10')](_0x2fe2a5));if(_0x2fe2a5[_0x97c9('0x11')]){if(_0x2fe2a5['error']['code']===0x1f4){logger[_0x97c9('0x11')](_0x97c9('0xd'),_0x41508a,_0x2fe2a5['error'][_0x97c9('0x12')]);return _0x24a56e(_0x2fe2a5[_0x97c9('0x11')][_0x97c9('0x12')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x41508a,_0x2fe2a5[_0x97c9('0x11')][_0x97c9('0x12')]);return _0x489f4e(_0x2fe2a5['error'][_0x97c9('0x12')]);}else{logger[_0x97c9('0xc')](_0x97c9('0xd'),_0x41508a,_0x97c9('0xf'));_0x489f4e(_0x2fe2a5[_0x97c9('0x13')][_0x97c9('0x12')]);}})[_0x97c9('0x14')](function(_0x255038){logger['error'](_0x97c9('0xd'),_0x41508a,_0x255038);_0x24a56e(_0x255038);});});} \ No newline at end of file +var _0x6a16=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4cfd78,_0x52355e){var _0xf4a95a=function(_0x5c2d5b){while(--_0x5c2d5b){_0x4cfd78['push'](_0x4cfd78['shift']());}};_0xf4a95a(++_0x52355e);}(_0x6a16,0x197));var _0x66a1=function(_0x3b56a2,_0xb763f2){_0x3b56a2=_0x3b56a2-0x0;var _0x22418d=_0x6a16[_0x3b56a2];return _0x22418d;};'use strict';var _=require(_0x66a1('0x0'));var util=require(_0x66a1('0x1'));var moment=require(_0x66a1('0x2'));var BPromise=require(_0x66a1('0x3'));var rs=require(_0x66a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66a1('0x5'))['db'];var utils=require(_0x66a1('0x6'));var logger=require(_0x66a1('0x7'))(_0x66a1('0x8'));var config=require(_0x66a1('0x9'));var jayson=require(_0x66a1('0xa'));var client=jayson[_0x66a1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x151da7,_0x3367a5,_0x8bd41c){return new BPromise(function(_0x1fd1ca,_0x3365a0){return client[_0x66a1('0xc')](_0x151da7,_0x8bd41c)['then'](function(_0x547148){logger[_0x66a1('0xd')](_0x66a1('0xe'),_0x3367a5,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3367a5,_0x66a1('0xf'),JSON[_0x66a1('0x10')](_0x547148));if(_0x547148[_0x66a1('0x11')]){if(_0x547148[_0x66a1('0x11')][_0x66a1('0x12')]===0x1f4){logger[_0x66a1('0x11')](_0x66a1('0xe'),_0x3367a5,_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);return _0x3365a0(_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);}logger[_0x66a1('0x11')](_0x66a1('0xe'),_0x3367a5,_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);return _0x1fd1ca(_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);}else{logger['info'](_0x66a1('0xe'),_0x3367a5,_0x66a1('0xf'));_0x1fd1ca(_0x547148['result'][_0x66a1('0x13')]);}})[_0x66a1('0x14')](function(_0x28ad79){logger[_0x66a1('0x11')](_0x66a1('0xe'),_0x3367a5,_0x28ad79);_0x3365a0(_0x28ad79);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 86f20eb..f609285 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 _0xd4c9=['getConfigurations','/:id/fields','post','addConfiguration','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x409b2d,_0x4383f7){var _0x14e8db=function(_0xd77432){while(--_0xd77432){_0x409b2d['push'](_0x409b2d['shift']());}};_0x14e8db(++_0x4383f7);}(_0xd4c9,0x1bd));var _0x9d4c=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0xd4c9[_0x4b0290];return _0x4bd9f4;};'use strict';var multer=require(_0x9d4c('0x0'));var util=require(_0x9d4c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9d4c('0x2'));var router=express[_0x9d4c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9d4c('0x4'));var interaction=require(_0x9d4c('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0x9d4c('0x6')]('/',auth[_0x9d4c('0x7')](),controller['index']);router[_0x9d4c('0x6')](_0x9d4c('0x8'),auth[_0x9d4c('0x7')](),controller[_0x9d4c('0x9')]);router[_0x9d4c('0x6')](_0x9d4c('0xa'),auth[_0x9d4c('0x7')](),controller[_0x9d4c('0xb')]);router['get'](_0x9d4c('0xc'),auth[_0x9d4c('0x7')](),controller['getFields']);router[_0x9d4c('0xd')]('/',auth[_0x9d4c('0x7')](),controller['create']);router['post']('/:id/configurations',auth[_0x9d4c('0x7')](),controller[_0x9d4c('0xe')]);router['put'](_0x9d4c('0x8'),auth[_0x9d4c('0x7')](),controller[_0x9d4c('0xf')]);router[_0x9d4c('0x10')]('/:id',auth[_0x9d4c('0x7')](),controller[_0x9d4c('0x11')]);module[_0x9d4c('0x12')]=router; \ No newline at end of file +var _0xab26=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','/:id'];(function(_0xf82311,_0x29504b){var _0x39d8fa=function(_0x27c1d2){while(--_0x27c1d2){_0xf82311['push'](_0xf82311['shift']());}};_0x39d8fa(++_0x29504b);}(_0xab26,0xd2));var _0x6ab2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xab26[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x6ab2('0x0'));var util=require(_0x6ab2('0x1'));var path=require(_0x6ab2('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ab2('0x3'));var router=express[_0x6ab2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6ab2('0x5'));var config=require('../../config/environment');var controller=require(_0x6ab2('0x6'));router[_0x6ab2('0x7')]('/',auth[_0x6ab2('0x8')](),controller['index']);router[_0x6ab2('0x7')](_0x6ab2('0x9'),auth['isAuthenticated'](),controller[_0x6ab2('0xa')]);router[_0x6ab2('0x7')](_0x6ab2('0xb'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0xc')]);router[_0x6ab2('0x7')](_0x6ab2('0xd'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0xe')]);router[_0x6ab2('0xf')]('/',auth[_0x6ab2('0x8')](),controller['create']);router[_0x6ab2('0xf')](_0x6ab2('0xb'),auth[_0x6ab2('0x8')](),controller['addConfiguration']);router['put'](_0x6ab2('0x9'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0x10')]);router[_0x6ab2('0x11')](_0x6ab2('0x9'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0x12')]);module[_0x6ab2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 8d66206..dadfedf 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 _0x4c2d=['STRING','username','remoteUri','exports'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x4c2d,0x9b));var _0xd4c2=function(_0x3aef8a,_0x2abce4){_0x3aef8a=_0x3aef8a-0x0;var _0x3469a5=_0x4c2d[_0x3aef8a];return _0x3469a5;};'use strict';var Sequelize=require('sequelize');module[_0xd4c2('0x0')]={'name':{'type':Sequelize[_0xd4c2('0x1')]},'description':{'type':Sequelize[_0xd4c2('0x1')]},'username':{'type':Sequelize[_0xd4c2('0x1')],'unique':_0xd4c2('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd4c2('0x1')]},'remoteUri':{'type':Sequelize[_0xd4c2('0x1')],'unique':_0xd4c2('0x3')},'serverUrl':{'type':Sequelize[_0xd4c2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2ca0=['sequelize','exports','STRING'];(function(_0x8c62c5,_0x1e6f7f){var _0xcf3363=function(_0x1e2f5d){while(--_0x1e2f5d){_0x8c62c5['push'](_0x8c62c5['shift']());}};_0xcf3363(++_0x1e6f7f);}(_0x2ca0,0xae));var _0x02ca=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x2ca0[_0x1b3a5c];return _0x2ae8cb;};'use strict';var Sequelize=require(_0x02ca('0x0'));module[_0x02ca('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x02ca('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x02ca('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x02ca('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x02ca('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 5532eea..fc4d993 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 _0x9f61=['state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','email','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','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','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','end','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','then','rows','catch','show','params','create','body','find','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x9f61,0x10a));var _0x19f6=function(_0x348390,_0x219fe1){_0x348390=_0x348390-0x0;var _0x38f375=_0x9f61[_0x348390];return _0x38f375;};'use strict';var emlformat=require(_0x19f6('0x0'));var rimraf=require(_0x19f6('0x1'));var zipdir=require(_0x19f6('0x2'));var jsonpatch=require(_0x19f6('0x3'));var rp=require(_0x19f6('0x4'));var moment=require(_0x19f6('0x5'));var BPromise=require(_0x19f6('0x6'));var Mustache=require('mustache');var util=require(_0x19f6('0x7'));var path=require(_0x19f6('0x8'));var sox=require(_0x19f6('0x9'));var csv=require(_0x19f6('0xa'));var ejs=require(_0x19f6('0xb'));var fs=require('fs');var fs_extra=require(_0x19f6('0xc'));var _=require(_0x19f6('0xd'));var squel=require(_0x19f6('0xe'));var crypto=require(_0x19f6('0xf'));var jsforce=require(_0x19f6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x19f6('0xa'));var querystring=require(_0x19f6('0x11'));var Papa=require(_0x19f6('0x12'));var Redis=require('ioredis');var authService=require(_0x19f6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x19f6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x19f6('0x15'))(_0x19f6('0x16'));var utils=require('../../config/utils');var config=require(_0x19f6('0x17'));var licenseUtil=require(_0x19f6('0x18'));var db=require(_0x19f6('0x19'))['db'];var integrations=require(_0x19f6('0x1a'));function respondWithStatusCode(_0x29a722,_0x3e7d52){_0x3e7d52=_0x3e7d52||0xcc;return function(_0x4741ea){if(_0x4741ea){return _0x29a722['sendStatus'](_0x3e7d52);}return _0x29a722['status'](_0x3e7d52)['end']();};}function respondWithResult(_0x50cbee,_0xab0631){_0xab0631=_0xab0631||0xc8;return function(_0x232894){if(_0x232894){return _0x50cbee[_0x19f6('0x1b')](_0xab0631)['json'](_0x232894);}};}function respondWithFilteredResult(_0x420d87,_0x6ab571){return function(_0x210683){if(_0x210683){var _0x294dae=typeof _0x6ab571[_0x19f6('0x1c')]===_0x19f6('0x1d')&&typeof _0x6ab571[_0x19f6('0x1e')]===_0x19f6('0x1d');var _0x311a78=_0x210683[_0x19f6('0x1f')];var _0x211508=_0x294dae?0x0:_0x6ab571[_0x19f6('0x1c')];var _0x5741b4=_0x294dae?_0x210683[_0x19f6('0x1f')]:_0x6ab571[_0x19f6('0x1c')]+_0x6ab571[_0x19f6('0x1e')];var _0xcd9bb9;if(_0x5741b4>=_0x311a78){_0x5741b4=_0x311a78;_0xcd9bb9=0xc8;}else{_0xcd9bb9=0xce;}_0x420d87[_0x19f6('0x1b')](_0xcd9bb9);return _0x420d87[_0x19f6('0x20')](_0x19f6('0x21'),_0x211508+'-'+_0x5741b4+'/'+_0x311a78)[_0x19f6('0x22')](_0x210683);}return null;};}function patchUpdates(_0x54e725){return function(_0x32a65b){try{jsonpatch[_0x19f6('0x23')](_0x32a65b,_0x54e725,!![]);}catch(_0x1c4ab2){return BPromise['reject'](_0x1c4ab2);}return _0x32a65b[_0x19f6('0x24')]();};}function saveUpdates(_0x42713d,_0x275635){return function(_0xd2f06a){if(_0xd2f06a){return _0xd2f06a[_0x19f6('0x25')](_0x42713d)['then'](function(_0x5c8a3b){return _0x5c8a3b;});}return null;};}function removeEntity(_0x42b160,_0x1b3361){return function(_0x5b489f){if(_0x5b489f){return _0x5b489f[_0x19f6('0x26')]()['then'](function(){_0x42b160['status'](0xcc)[_0x19f6('0x27')]();});}};}function handleEntityNotFound(_0x3b56b3,_0xafc7da){return function(_0x4f3b2f){if(!_0x4f3b2f){_0x3b56b3['sendStatus'](0x194);}return _0x4f3b2f;};}function handleError(_0x52bca5,_0x3e1920){_0x3e1920=_0x3e1920||0x1f4;return function(_0x28b98b){logger['error'](_0x28b98b[_0x19f6('0x28')]);if(_0x28b98b[_0x19f6('0x29')]){delete _0x28b98b[_0x19f6('0x29')];}_0x52bca5[_0x19f6('0x1b')](_0x3e1920)[_0x19f6('0x2a')](_0x28b98b);};}exports['index']=function(_0x4fef37,_0x22edf0){var _0x26de22={},_0x253320={},_0x4cea15={'count':0x0,'rows':[]};var _0x17d76a=_[_0x19f6('0x2b')](db[_0x19f6('0x2c')][_0x19f6('0x2d')],function(_0x1103fe){return{'name':_0x1103fe[_0x19f6('0x2e')],'type':_0x1103fe[_0x19f6('0x2f')]['key']};});_0x253320[_0x19f6('0x30')]=_[_0x19f6('0x2b')](_0x17d76a,_0x19f6('0x29'));_0x253320[_0x19f6('0x31')]=_[_0x19f6('0x32')](_0x4fef37[_0x19f6('0x31')]);_0x253320[_0x19f6('0x33')]=_['intersection'](_0x253320[_0x19f6('0x30')],_0x253320[_0x19f6('0x31')]);_0x26de22[_0x19f6('0x34')]=_[_0x19f6('0x35')](_0x253320['model'],qs[_0x19f6('0x36')](_0x4fef37[_0x19f6('0x31')][_0x19f6('0x36')]));_0x26de22[_0x19f6('0x34')]=_0x26de22['attributes'][_0x19f6('0x37')]?_0x26de22[_0x19f6('0x34')]:_0x253320['model'];if(!_0x4fef37[_0x19f6('0x31')][_0x19f6('0x38')](_0x19f6('0x39'))){_0x26de22[_0x19f6('0x1e')]=qs[_0x19f6('0x1e')](_0x4fef37[_0x19f6('0x31')][_0x19f6('0x1e')]);_0x26de22['offset']=qs['offset'](_0x4fef37[_0x19f6('0x31')][_0x19f6('0x1c')]);}_0x26de22[_0x19f6('0x3a')]=qs[_0x19f6('0x3b')](_0x4fef37[_0x19f6('0x31')][_0x19f6('0x3b')]);_0x26de22[_0x19f6('0x3c')]=qs[_0x19f6('0x33')](_['pick'](_0x4fef37[_0x19f6('0x31')],_0x253320[_0x19f6('0x33')]),_0x17d76a);if(_0x4fef37[_0x19f6('0x31')][_0x19f6('0x3d')]){_0x26de22[_0x19f6('0x3c')]=_[_0x19f6('0x3e')](_0x26de22[_0x19f6('0x3c')],{'$or':_[_0x19f6('0x2b')](_0x17d76a,function(_0x15d944){if(_0x15d944[_0x19f6('0x2f')]!==_0x19f6('0x3f')){var _0x13ca32={};_0x13ca32[_0x15d944[_0x19f6('0x29')]]={'$like':'%'+_0x4fef37[_0x19f6('0x31')][_0x19f6('0x3d')]+'%'};return _0x13ca32;}})});}_0x26de22=_[_0x19f6('0x3e')]({},_0x26de22,_0x4fef37[_0x19f6('0x40')]);var _0x237f8c={'where':_0x26de22[_0x19f6('0x3c')]};return db['ServicenowAccount'][_0x19f6('0x1f')](_0x237f8c)['then'](function(_0x192d1a){_0x4cea15[_0x19f6('0x1f')]=_0x192d1a;if(_0x4fef37[_0x19f6('0x31')][_0x19f6('0x41')]){_0x26de22[_0x19f6('0x42')]=[{'all':!![]}];}return db[_0x19f6('0x2c')]['findAll'](_0x26de22);})[_0x19f6('0x43')](function(_0x58659f){_0x4cea15[_0x19f6('0x44')]=_0x58659f;return _0x4cea15;})[_0x19f6('0x43')](respondWithFilteredResult(_0x22edf0,_0x26de22))[_0x19f6('0x45')](handleError(_0x22edf0,null));};exports[_0x19f6('0x46')]=function(_0x2fd770,_0xaf422f){var _0x62baff={'raw':![],'where':{'id':_0x2fd770[_0x19f6('0x47')]['id']}},_0xf6a027={};_0xf6a027[_0x19f6('0x30')]=_['keys'](db[_0x19f6('0x2c')]['rawAttributes']);_0xf6a027[_0x19f6('0x31')]=_[_0x19f6('0x32')](_0x2fd770['query']);_0xf6a027[_0x19f6('0x33')]=_[_0x19f6('0x35')](_0xf6a027[_0x19f6('0x30')],_0xf6a027[_0x19f6('0x31')]);_0x62baff[_0x19f6('0x34')]=_[_0x19f6('0x35')](_0xf6a027[_0x19f6('0x30')],qs['fields'](_0x2fd770[_0x19f6('0x31')][_0x19f6('0x36')]));_0x62baff['attributes']=_0x62baff[_0x19f6('0x34')][_0x19f6('0x37')]?_0x62baff[_0x19f6('0x34')]:_0xf6a027[_0x19f6('0x30')];if(_0x2fd770[_0x19f6('0x31')][_0x19f6('0x41')]){_0x62baff[_0x19f6('0x42')]=[{'all':!![]}];}_0x62baff=_['merge']({},_0x62baff,_0x2fd770['options']);return db[_0x19f6('0x2c')]['find'](_0x62baff)['then'](handleEntityNotFound(_0xaf422f,null))[_0x19f6('0x43')](respondWithResult(_0xaf422f,null))['catch'](handleError(_0xaf422f,null));};exports[_0x19f6('0x48')]=function(_0x51d407,_0x248c03){return db[_0x19f6('0x2c')]['create'](_0x51d407[_0x19f6('0x49')],{})[_0x19f6('0x43')](respondWithResult(_0x248c03,0xc9))['catch'](handleError(_0x248c03,null));};exports[_0x19f6('0x25')]=function(_0x170e70,_0x5ea906){if(_0x170e70[_0x19f6('0x49')]['id']){delete _0x170e70[_0x19f6('0x49')]['id'];}return db[_0x19f6('0x2c')][_0x19f6('0x4a')]({'where':{'id':_0x170e70[_0x19f6('0x47')]['id']}})[_0x19f6('0x43')](handleEntityNotFound(_0x5ea906,null))[_0x19f6('0x43')](saveUpdates(_0x170e70['body'],null))[_0x19f6('0x43')](respondWithResult(_0x5ea906,null))[_0x19f6('0x45')](handleError(_0x5ea906,null));};exports['destroy']=function(_0x4dc737,_0x3c2cd6){return db['ServicenowAccount'][_0x19f6('0x4a')]({'where':{'id':_0x4dc737[_0x19f6('0x47')]['id']}})[_0x19f6('0x43')](handleEntityNotFound(_0x3c2cd6,null))[_0x19f6('0x43')](removeEntity(_0x3c2cd6,null))[_0x19f6('0x45')](handleError(_0x3c2cd6,null));};exports[_0x19f6('0x4b')]=function(_0x3496f2,_0x3e6baa,_0x2948d){var _0x325502={};var _0x38bd96={};var _0x35b869;var _0x55021e;return db[_0x19f6('0x2c')][_0x19f6('0x4c')]({'where':{'id':_0x3496f2[_0x19f6('0x47')]['id']}})[_0x19f6('0x43')](handleEntityNotFound(_0x3e6baa,null))['then'](function(_0x16a790){if(_0x16a790){_0x35b869=_0x16a790;_0x38bd96['model']=_[_0x19f6('0x32')](db[_0x19f6('0x4d')]['rawAttributes']);_0x38bd96['query']=_[_0x19f6('0x32')](_0x3496f2[_0x19f6('0x31')]);_0x38bd96[_0x19f6('0x33')]=_[_0x19f6('0x35')](_0x38bd96[_0x19f6('0x30')],_0x38bd96[_0x19f6('0x31')]);_0x325502[_0x19f6('0x34')]=_['intersection'](_0x38bd96[_0x19f6('0x30')],qs['fields'](_0x3496f2['query'][_0x19f6('0x36')]));_0x325502['attributes']=_0x325502[_0x19f6('0x34')]['length']?_0x325502[_0x19f6('0x34')]:_0x38bd96[_0x19f6('0x30')];_0x325502[_0x19f6('0x3a')]=qs[_0x19f6('0x3b')](_0x3496f2[_0x19f6('0x31')][_0x19f6('0x3b')]);_0x325502[_0x19f6('0x3c')]=qs[_0x19f6('0x33')](_['pick'](_0x3496f2[_0x19f6('0x31')],_0x38bd96[_0x19f6('0x33')]));if(_0x3496f2['query'][_0x19f6('0x3d')]){_0x325502['where']=_[_0x19f6('0x3e')](_0x325502['where'],{'$or':_[_0x19f6('0x2b')](_0x325502[_0x19f6('0x34')],function(_0x2d135a){var _0x157521={};_0x157521[_0x2d135a]={'$like':'%'+_0x3496f2[_0x19f6('0x31')]['filter']+'%'};return _0x157521;})});}_0x325502=_[_0x19f6('0x3e')]({},_0x325502,_0x3496f2['options']);return _0x35b869[_0x19f6('0x4b')](_0x325502);}})[_0x19f6('0x43')](function(_0x6c0f52){if(_0x6c0f52){_0x55021e=_0x6c0f52[_0x19f6('0x37')];if(!_0x3496f2['query'][_0x19f6('0x38')](_0x19f6('0x39'))){_0x325502['limit']=qs['limit'](_0x3496f2[_0x19f6('0x31')][_0x19f6('0x1e')]);_0x325502[_0x19f6('0x1c')]=qs['offset'](_0x3496f2[_0x19f6('0x31')][_0x19f6('0x1c')]);}return _0x35b869[_0x19f6('0x4b')](_0x325502);}})[_0x19f6('0x43')](function(_0x46bd4d){if(_0x46bd4d){return _0x46bd4d?{'count':_0x55021e,'rows':_0x46bd4d}:null;}})[_0x19f6('0x43')](respondWithResult(_0x3e6baa,null))['catch'](handleError(_0x3e6baa,null));};exports[_0x19f6('0x4e')]=function(_0x590cff,_0xd261e3,_0x24e42f){if(_0x590cff[_0x19f6('0x49')]['id']){delete _0x590cff[_0x19f6('0x49')]['id'];}return db[_0x19f6('0x2c')][_0x19f6('0x4c')]({'where':{'id':_0x590cff[_0x19f6('0x47')]['id']}})[_0x19f6('0x43')](handleEntityNotFound(_0xd261e3,null))['then'](function(_0x40bc41){if(_0x40bc41){_0x590cff['body'][_0x19f6('0x4f')]=_0x40bc41['id'];_0x590cff[_0x19f6('0x49')]['Subjects']=integrations[_0x19f6('0x50')](_0x590cff[_0x19f6('0x49')]['channel'],_0x590cff[_0x19f6('0x49')][_0x19f6('0x2f')]);_0x590cff['body'][_0x19f6('0x51')]=integrations[_0x19f6('0x52')](_0x590cff['body'][_0x19f6('0x53')],_0x590cff['body']['type']);return db['ServicenowConfiguration'][_0x19f6('0x48')](_0x590cff[_0x19f6('0x49')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x19f6('0x43')](respondWithResult(_0xd261e3,null))[_0x19f6('0x45')](handleError(_0xd261e3,null));};exports['getFields']=function(_0x27661c,_0xcc66df,_0x1d63d3){var _0x1ea65d=[_0x19f6('0x54'),_0x19f6('0x55'),_0x19f6('0x56'),_0x19f6('0x57'),_0x19f6('0x58'),_0x19f6('0x59'),_0x19f6('0x5a'),_0x19f6('0x5b'),_0x19f6('0x5c')];var _0x5b8af8=[_0x19f6('0x5d'),_0x19f6('0x54'),_0x19f6('0x5e'),'watch_list','upon_reject','sys_updated_on','child_incidents',_0x19f6('0x55'),_0x19f6('0x5f'),_0x19f6('0x60'),_0x19f6('0x61'),_0x19f6('0x62'),_0x19f6('0x63'),_0x19f6('0x64'),'sys_created_on',_0x19f6('0x65'),_0x19f6('0x66'),_0x19f6('0x67'),'knowledge',_0x19f6('0x3a'),_0x19f6('0x68'),_0x19f6('0x69'),'cmdb_ci',_0x19f6('0x6a'),_0x19f6('0x6b'),_0x19f6('0x6c'),'work_notes_list',_0x19f6('0x6d'),_0x19f6('0x6e'),_0x19f6('0x6f'),_0x19f6('0x70'),'time_worked','expected_start','opened_at',_0x19f6('0x71'),_0x19f6('0x72'),_0x19f6('0x73'),_0x19f6('0x74'),_0x19f6('0x75'),_0x19f6('0x76'),_0x19f6('0x77'),'subcategory','work_notes',_0x19f6('0x78'),_0x19f6('0x58'),_0x19f6('0x79'),_0x19f6('0x7a'),_0x19f6('0x7b'),_0x19f6('0x7c'),_0x19f6('0x7d'),_0x19f6('0x7e'),_0x19f6('0x7f'),_0x19f6('0x80'),_0x19f6('0x59'),'sys_class_name',_0x19f6('0x81'),_0x19f6('0x82'),_0x19f6('0x83'),_0x19f6('0x84'),'sys_id','contact_type',_0x19f6('0x85'),_0x19f6('0x5a'),_0x19f6('0x86'),_0x19f6('0x87'),_0x19f6('0x88'),_0x19f6('0x89'),_0x19f6('0x8a'),_0x19f6('0x8b'),'severity','comments',_0x19f6('0x8c'),'approval','comments_and_work_notes',_0x19f6('0x8d'),_0x19f6('0x8e'),_0x19f6('0x8f'),_0x19f6('0x90'),'escalation',_0x19f6('0x91'),_0x19f6('0x92'),_0x19f6('0x93'),_0x19f6('0x5c')];var _0x3de136='';var _0xdc4ded='';var _0x1637ec=[];var _0x49b6c1='';var _0x196e47='';var _0x56c52d=[];var _0x90693a='';var _0x45465a='';var _0x2ddffc={};var _0x4c8a71='';return db[_0x19f6('0x2c')]['findOne']({'where':{'id':_0x27661c['params']['id']},'attributes':['id',_0x19f6('0x94'),'password',_0x19f6('0x95'),_0x19f6('0x96'),'serverUrl']})[_0x19f6('0x43')](handleEntityNotFound(_0xcc66df,null))['then'](function(_0x45f6d6){if(_0x45f6d6){_0x4c8a71=_0x45f6d6[_0x19f6('0x96')];var _0x3bfbd6=_0x4c8a71[_0x19f6('0x97')](-0x1);if(_0x3bfbd6==='/'){_0x4c8a71=_0x4c8a71[_0x19f6('0x98')](0x0,_0x4c8a71['lastIndexOf'](_0x3bfbd6));}_0x45465a=util[_0x19f6('0x99')](_0x19f6('0x9a'),_0x4c8a71);_0x90693a=util[_0x19f6('0x99')](_0x19f6('0x9b'),_0x4c8a71);_0x2ddffc={'user':_0x45f6d6[_0x19f6('0x94')],'pass':_0x45f6d6[_0x19f6('0x9c')]};var _0x2b0c46={'method':_0x19f6('0x9d'),'uri':_0x45465a+_0x19f6('0x9e'),'auth':_0x2ddffc,'json':!![]};return rp(_0x2b0c46);}})[_0x19f6('0x43')](function(_0x33a01b){if(_0x33a01b[_0x19f6('0x9f')]['length']>0x0){_0x3de136=_0x33a01b['result'];}console[_0x19f6('0xa0')](_0x19f6('0xa1'),_0x3de136);_0x56c52d=[];_0xdc4ded=Object[_0x19f6('0xa2')]([],_0x3de136);_[_0x19f6('0xa3')](_0xdc4ded,function(_0x34dcda){return!_0x1ea65d[_0x19f6('0xa4')](_0x34dcda[_0x19f6('0x29')]);});_0xdc4ded[_0x19f6('0xa5')](function(_0x3a4baa){var _0x29e71b=createFieldObject(_0x90693a,_0x2ddffc,_0x3a4baa[_0x19f6('0xa6')],_0x3a4baa['name'],_0x3a4baa[_0x19f6('0xa7')],![]);_0x56c52d[_0x19f6('0xa8')](_0x29e71b);});return Promise[_0x19f6('0xa9')](_0x56c52d);})[_0x19f6('0x43')](function(_0x150f2b){_0x1637ec=_0x150f2b;_0x49b6c1=Object[_0x19f6('0xa2')]([],_0x3de136);console['log'](_0x19f6('0xaa'),_0x3de136);_['remove'](_0x49b6c1,function(_0x50da7e){return _0x5b8af8['includes'](_0x50da7e[_0x19f6('0x29')]);});console[_0x19f6('0xa0')](_0x19f6('0xab'),_0x49b6c1);_0x56c52d=[];_0x49b6c1[_0x19f6('0xa5')](function(_0x52c69f){var _0x54045d=createFieldObject(_0x90693a,_0x2ddffc,_0x52c69f['internalType'],_0x52c69f[_0x19f6('0x29')],_0x52c69f[_0x19f6('0xa7')],!![]);_0x56c52d['push'](_0x54045d);});return Promise[_0x19f6('0xa9')](_0x56c52d);})[_0x19f6('0x43')](function(_0xe6e48f){_0x196e47=_0xe6e48f;var _0x25efd3=_0x1637ec[_0x19f6('0xac')](_0x196e47);return{'count':_0x25efd3[_0x19f6('0x37')],'rows':_0x25efd3};})[_0x19f6('0x43')](respondWithResult(_0xcc66df,null))[_0x19f6('0x45')](function(_0x393acb){console[_0x19f6('0xa0')](_0x19f6('0xad')+_0x393acb);var _0x210538=_0x27661c[_0x19f6('0x31')][_0x19f6('0xae')]?0x1f4:_0x393acb[_0x19f6('0xaf')]||0x1f4;logger[_0x19f6('0xb0')](_0x393acb[_0x19f6('0x28')]);delete _0x393acb[_0x19f6('0x29')];if(_0x210538===0x191){_0x210538=0x190;}_0xcc66df[_0x19f6('0x1b')](_0x210538)['send'](_0x27661c[_0x19f6('0x31')][_0x19f6('0xae')]?{'message':_0x19f6('0xb1'),'statusCode':_0x393acb['statusCode']}:_0x393acb);});};function createFieldObject(_0x36e74d,_0x2e0c4c,_0x14f8f1,_0x489dd8,_0x3e893f,_0x5cb74c){return new Promise(function(_0x12a387,_0x116bd7){var _0x364a06={'id':_0x489dd8,'name':_0x3e893f,'custom':_0x5cb74c};if(_0x14f8f1===_0x19f6('0xb2')){_0x364a06[_0x19f6('0x40')]=[{'name':'True','value':_0x19f6('0xb3')},{'name':_0x19f6('0xb4'),'value':_0x19f6('0xb5')}];_0x12a387(_0x364a06);}else{var _0x2d131e={'method':'GET','uri':_0x36e74d+_0x19f6('0xb6')+_0x489dd8,'auth':_0x2e0c4c,'json':!![]};return rp(_0x2d131e)[_0x19f6('0x43')](function(_0x5b55a4){var _0x5202ae=[];if(_0x5b55a4[_0x19f6('0x9f')][_0x19f6('0x37')]>0x0){_0x5b55a4[_0x19f6('0x9f')][_0x19f6('0xa5')](function(_0x27b15e){if(_0x27b15e['inactive']===_0x19f6('0xb5')){var _0x5e9dd7={'name':_0x27b15e['label'],'value':_0x27b15e[_0x19f6('0xb7')]};_0x5202ae[_0x19f6('0xa8')](_0x5e9dd7);}});}_0x364a06['options']=_0x5202ae;if(_0x364a06[_0x19f6('0x40')][_0x19f6('0x37')]>0x0){_0x12a387(_0x364a06);}else{if(_0x5cb74c==![]){_0x12a387();}else{_0x12a387(_0x364a06);}}});}});} \ No newline at end of file +var _0x6ecd=['eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','then','destroy','error','name','send','index','map','ServicenowAccount','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','update','body','getConfigurations','findOne','ServicenowConfiguration','rawAttributes','pick','AccountId','Subjects','Descriptions','channel','ServicenowField','hold_reason','knowledge','close_code','notify','incident_state','severity','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','sys_created_by','closed_at','impact','active','work_notes_list','sys_domain_path','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','subcategory','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','company','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','escalation','upon_approval','correlation_id','location','category','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','label','all','log','TCL:\x20_object','remove','internalType','push','concat','test','statusCode','stack','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x6ecd,0x162));var _0xd6ec=function(_0x4306b5,_0x4c4be2){_0x4306b5=_0x4306b5-0x0;var _0x5cf4c9=_0x6ecd[_0x4306b5];return _0x5cf4c9;};'use strict';var emlformat=require(_0xd6ec('0x0'));var rimraf=require(_0xd6ec('0x1'));var zipdir=require(_0xd6ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd6ec('0x4'));var util=require(_0xd6ec('0x5'));var path=require(_0xd6ec('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6ec('0x7'));var fs=require('fs');var fs_extra=require(_0xd6ec('0x8'));var _=require(_0xd6ec('0x9'));var squel=require(_0xd6ec('0xa'));var crypto=require(_0xd6ec('0xb'));var jsforce=require(_0xd6ec('0xc'));var deskjs=require(_0xd6ec('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd6ec('0xe'));var Papa=require(_0xd6ec('0xf'));var Redis=require(_0xd6ec('0x10'));var authService=require(_0xd6ec('0x11'));var qs=require(_0xd6ec('0x12'));var as=require(_0xd6ec('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd6ec('0x14'));var utils=require(_0xd6ec('0x15'));var config=require(_0xd6ec('0x16'));var licenseUtil=require(_0xd6ec('0x17'));var db=require(_0xd6ec('0x18'))['db'];var integrations=require(_0xd6ec('0x19'));function respondWithStatusCode(_0x277fb1,_0x4f82d6){_0x4f82d6=_0x4f82d6||0xcc;return function(_0x1d89bc){if(_0x1d89bc){return _0x277fb1[_0xd6ec('0x1a')](_0x4f82d6);}return _0x277fb1[_0xd6ec('0x1b')](_0x4f82d6)[_0xd6ec('0x1c')]();};}function respondWithResult(_0x2a638a,_0xa04684){_0xa04684=_0xa04684||0xc8;return function(_0xae2e55){if(_0xae2e55){return _0x2a638a[_0xd6ec('0x1b')](_0xa04684)[_0xd6ec('0x1d')](_0xae2e55);}};}function respondWithFilteredResult(_0x40e75c,_0x2f8d86){return function(_0x43f086){if(_0x43f086){var _0x446c00=typeof _0x2f8d86['offset']===_0xd6ec('0x1e')&&typeof _0x2f8d86['limit']===_0xd6ec('0x1e');var _0x3e5bdf=_0x43f086[_0xd6ec('0x1f')];var _0x5dde1f=_0x446c00?0x0:_0x2f8d86[_0xd6ec('0x20')];var _0x124d71=_0x446c00?_0x43f086[_0xd6ec('0x1f')]:_0x2f8d86[_0xd6ec('0x20')]+_0x2f8d86[_0xd6ec('0x21')];var _0x3f3321;if(_0x124d71>=_0x3e5bdf){_0x124d71=_0x3e5bdf;_0x3f3321=0xc8;}else{_0x3f3321=0xce;}_0x40e75c[_0xd6ec('0x1b')](_0x3f3321);return _0x40e75c['set']('Content-Range',_0x5dde1f+'-'+_0x124d71+'/'+_0x3e5bdf)[_0xd6ec('0x1d')](_0x43f086);}return null;};}function patchUpdates(_0x36b8ea){return function(_0x430cf5){try{jsonpatch[_0xd6ec('0x22')](_0x430cf5,_0x36b8ea,!![]);}catch(_0x4f3456){return BPromise[_0xd6ec('0x23')](_0x4f3456);}return _0x430cf5['save']();};}function saveUpdates(_0x5495f8,_0x53c8b6){return function(_0x2f885c){if(_0x2f885c){return _0x2f885c['update'](_0x5495f8)[_0xd6ec('0x24')](function(_0x32ba88){return _0x32ba88;});}return null;};}function removeEntity(_0xd733c0,_0x5e34d2){return function(_0x326ca0){if(_0x326ca0){return _0x326ca0[_0xd6ec('0x25')]()[_0xd6ec('0x24')](function(){_0xd733c0[_0xd6ec('0x1b')](0xcc)[_0xd6ec('0x1c')]();});}};}function handleEntityNotFound(_0x630598,_0xad42d7){return function(_0xb5aa9c){if(!_0xb5aa9c){_0x630598[_0xd6ec('0x1a')](0x194);}return _0xb5aa9c;};}function handleError(_0x45bd85,_0x2344ca){_0x2344ca=_0x2344ca||0x1f4;return function(_0x27a869){logger[_0xd6ec('0x26')](_0x27a869['stack']);if(_0x27a869[_0xd6ec('0x27')]){delete _0x27a869['name'];}_0x45bd85['status'](_0x2344ca)[_0xd6ec('0x28')](_0x27a869);};}exports[_0xd6ec('0x29')]=function(_0x18a08c,_0x40e768){var _0x486154={},_0x301c1b={},_0x549bb7={'count':0x0,'rows':[]};var _0x45b707=_[_0xd6ec('0x2a')](db[_0xd6ec('0x2b')]['rawAttributes'],function(_0x4b7962){return{'name':_0x4b7962['fieldName'],'type':_0x4b7962[_0xd6ec('0x2c')]['key']};});_0x301c1b['model']=_[_0xd6ec('0x2a')](_0x45b707,_0xd6ec('0x27'));_0x301c1b[_0xd6ec('0x2d')]=_[_0xd6ec('0x2e')](_0x18a08c['query']);_0x301c1b[_0xd6ec('0x2f')]=_[_0xd6ec('0x30')](_0x301c1b[_0xd6ec('0x31')],_0x301c1b['query']);_0x486154['attributes']=_[_0xd6ec('0x30')](_0x301c1b[_0xd6ec('0x31')],qs[_0xd6ec('0x32')](_0x18a08c['query'][_0xd6ec('0x32')]));_0x486154[_0xd6ec('0x33')]=_0x486154[_0xd6ec('0x33')][_0xd6ec('0x34')]?_0x486154[_0xd6ec('0x33')]:_0x301c1b[_0xd6ec('0x31')];if(!_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x35')](_0xd6ec('0x36'))){_0x486154['limit']=qs['limit'](_0x18a08c['query']['limit']);_0x486154[_0xd6ec('0x20')]=qs[_0xd6ec('0x20')](_0x18a08c['query'][_0xd6ec('0x20')]);}_0x486154[_0xd6ec('0x37')]=qs[_0xd6ec('0x38')](_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x38')]);_0x486154['where']=qs[_0xd6ec('0x2f')](_['pick'](_0x18a08c[_0xd6ec('0x2d')],_0x301c1b['filters']),_0x45b707);if(_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x39')]){_0x486154[_0xd6ec('0x3a')]=_[_0xd6ec('0x3b')](_0x486154['where'],{'$or':_[_0xd6ec('0x2a')](_0x45b707,function(_0x48f5d4){if(_0x48f5d4['type']!==_0xd6ec('0x3c')){var _0x315226={};_0x315226[_0x48f5d4[_0xd6ec('0x27')]]={'$like':'%'+_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x39')]+'%'};return _0x315226;}})});}_0x486154=_[_0xd6ec('0x3b')]({},_0x486154,_0x18a08c[_0xd6ec('0x3d')]);var _0x47baf7={'where':_0x486154[_0xd6ec('0x3a')]};return db['ServicenowAccount'][_0xd6ec('0x1f')](_0x47baf7)[_0xd6ec('0x24')](function(_0x38b8ac){_0x549bb7[_0xd6ec('0x1f')]=_0x38b8ac;if(_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x3e')]){_0x486154[_0xd6ec('0x3f')]=[{'all':!![]}];}return db[_0xd6ec('0x2b')][_0xd6ec('0x40')](_0x486154);})[_0xd6ec('0x24')](function(_0x4d3c64){_0x549bb7['rows']=_0x4d3c64;return _0x549bb7;})[_0xd6ec('0x24')](respondWithFilteredResult(_0x40e768,_0x486154))[_0xd6ec('0x41')](handleError(_0x40e768,null));};exports[_0xd6ec('0x42')]=function(_0x2bb2db,_0x41855b){var _0x4a22e9={'raw':![],'where':{'id':_0x2bb2db[_0xd6ec('0x43')]['id']}},_0x406564={};_0x406564[_0xd6ec('0x31')]=_['keys'](db[_0xd6ec('0x2b')]['rawAttributes']);_0x406564[_0xd6ec('0x2d')]=_[_0xd6ec('0x2e')](_0x2bb2db['query']);_0x406564[_0xd6ec('0x2f')]=_[_0xd6ec('0x30')](_0x406564[_0xd6ec('0x31')],_0x406564['query']);_0x4a22e9[_0xd6ec('0x33')]=_[_0xd6ec('0x30')](_0x406564[_0xd6ec('0x31')],qs['fields'](_0x2bb2db[_0xd6ec('0x2d')][_0xd6ec('0x32')]));_0x4a22e9['attributes']=_0x4a22e9['attributes'][_0xd6ec('0x34')]?_0x4a22e9[_0xd6ec('0x33')]:_0x406564[_0xd6ec('0x31')];if(_0x2bb2db[_0xd6ec('0x2d')][_0xd6ec('0x3e')]){_0x4a22e9['include']=[{'all':!![]}];}_0x4a22e9=_[_0xd6ec('0x3b')]({},_0x4a22e9,_0x2bb2db[_0xd6ec('0x3d')]);return db[_0xd6ec('0x2b')][_0xd6ec('0x44')](_0x4a22e9)['then'](handleEntityNotFound(_0x41855b,null))[_0xd6ec('0x24')](respondWithResult(_0x41855b,null))[_0xd6ec('0x41')](handleError(_0x41855b,null));};exports[_0xd6ec('0x45')]=function(_0x397cd6,_0x4071de){return db[_0xd6ec('0x2b')][_0xd6ec('0x45')](_0x397cd6['body'],{})[_0xd6ec('0x24')](respondWithResult(_0x4071de,0xc9))[_0xd6ec('0x41')](handleError(_0x4071de,null));};exports[_0xd6ec('0x46')]=function(_0x34498d,_0x2e2d80){if(_0x34498d[_0xd6ec('0x47')]['id']){delete _0x34498d[_0xd6ec('0x47')]['id'];}return db['ServicenowAccount'][_0xd6ec('0x44')]({'where':{'id':_0x34498d['params']['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0x2e2d80,null))[_0xd6ec('0x24')](saveUpdates(_0x34498d[_0xd6ec('0x47')],null))[_0xd6ec('0x24')](respondWithResult(_0x2e2d80,null))[_0xd6ec('0x41')](handleError(_0x2e2d80,null));};exports[_0xd6ec('0x25')]=function(_0x1e5877,_0x272bc3){return db[_0xd6ec('0x2b')][_0xd6ec('0x44')]({'where':{'id':_0x1e5877[_0xd6ec('0x43')]['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0x272bc3,null))['then'](removeEntity(_0x272bc3,null))[_0xd6ec('0x41')](handleError(_0x272bc3,null));};exports[_0xd6ec('0x48')]=function(_0x5488f8,_0xeede5c,_0x1dba51){var _0x21454a={};var _0x3b8fe9={};var _0x5090c9;var _0x2129f8;return db[_0xd6ec('0x2b')][_0xd6ec('0x49')]({'where':{'id':_0x5488f8['params']['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0xeede5c,null))['then'](function(_0xc0c7f0){if(_0xc0c7f0){_0x5090c9=_0xc0c7f0;_0x3b8fe9[_0xd6ec('0x31')]=_[_0xd6ec('0x2e')](db[_0xd6ec('0x4a')][_0xd6ec('0x4b')]);_0x3b8fe9[_0xd6ec('0x2d')]=_[_0xd6ec('0x2e')](_0x5488f8['query']);_0x3b8fe9[_0xd6ec('0x2f')]=_[_0xd6ec('0x30')](_0x3b8fe9[_0xd6ec('0x31')],_0x3b8fe9['query']);_0x21454a[_0xd6ec('0x33')]=_['intersection'](_0x3b8fe9[_0xd6ec('0x31')],qs[_0xd6ec('0x32')](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x32')]));_0x21454a['attributes']=_0x21454a[_0xd6ec('0x33')][_0xd6ec('0x34')]?_0x21454a['attributes']:_0x3b8fe9[_0xd6ec('0x31')];_0x21454a[_0xd6ec('0x37')]=qs['sort'](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x38')]);_0x21454a['where']=qs[_0xd6ec('0x2f')](_[_0xd6ec('0x4c')](_0x5488f8[_0xd6ec('0x2d')],_0x3b8fe9[_0xd6ec('0x2f')]));if(_0x5488f8[_0xd6ec('0x2d')]['filter']){_0x21454a['where']=_[_0xd6ec('0x3b')](_0x21454a[_0xd6ec('0x3a')],{'$or':_['map'](_0x21454a[_0xd6ec('0x33')],function(_0xa630a){var _0x2befdb={};_0x2befdb[_0xa630a]={'$like':'%'+_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x39')]+'%'};return _0x2befdb;})});}_0x21454a=_[_0xd6ec('0x3b')]({},_0x21454a,_0x5488f8[_0xd6ec('0x3d')]);return _0x5090c9[_0xd6ec('0x48')](_0x21454a);}})[_0xd6ec('0x24')](function(_0x20049f){if(_0x20049f){_0x2129f8=_0x20049f[_0xd6ec('0x34')];if(!_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x35')](_0xd6ec('0x36'))){_0x21454a[_0xd6ec('0x21')]=qs[_0xd6ec('0x21')](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x21')]);_0x21454a[_0xd6ec('0x20')]=qs[_0xd6ec('0x20')](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x20')]);}return _0x5090c9[_0xd6ec('0x48')](_0x21454a);}})[_0xd6ec('0x24')](function(_0x108ad3){if(_0x108ad3){return _0x108ad3?{'count':_0x2129f8,'rows':_0x108ad3}:null;}})[_0xd6ec('0x24')](respondWithResult(_0xeede5c,null))[_0xd6ec('0x41')](handleError(_0xeede5c,null));};exports['addConfiguration']=function(_0x553f7a,_0x3da2aa,_0x327f3e){if(_0x553f7a[_0xd6ec('0x47')]['id']){delete _0x553f7a[_0xd6ec('0x47')]['id'];}return db[_0xd6ec('0x2b')]['findOne']({'where':{'id':_0x553f7a[_0xd6ec('0x43')]['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0x3da2aa,null))[_0xd6ec('0x24')](function(_0x172ba0){if(_0x172ba0){_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x4d')]=_0x172ba0['id'];_0x553f7a['body'][_0xd6ec('0x4e')]=integrations['getSubjects'](_0x553f7a[_0xd6ec('0x47')]['channel'],_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x2c')]);_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x4f')]=integrations['getDescriptions'](_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x50')],_0x553f7a['body']['type']);return db[_0xd6ec('0x4a')][_0xd6ec('0x45')](_0x553f7a[_0xd6ec('0x47')],{'include':[{'model':db[_0xd6ec('0x51')],'as':_0xd6ec('0x4e')},{'model':db[_0xd6ec('0x51')],'as':_0xd6ec('0x4f')}]});}return null;})['then'](respondWithResult(_0x3da2aa,null))[_0xd6ec('0x41')](handleError(_0x3da2aa,null));};exports['getFields']=function(_0x16672a,_0x1edbe5,_0xd32d3e){var _0x352a19=['made_sla',_0xd6ec('0x52'),_0xd6ec('0x53'),'subcategory',_0xd6ec('0x54'),_0xd6ec('0x55'),_0xd6ec('0x56'),_0xd6ec('0x57'),'category'];var _0x15f7a0=['parent',_0xd6ec('0x58'),_0xd6ec('0x59'),_0xd6ec('0x5a'),_0xd6ec('0x5b'),_0xd6ec('0x5c'),_0xd6ec('0x5d'),_0xd6ec('0x52'),_0xd6ec('0x5e'),_0xd6ec('0x5f'),_0xd6ec('0x60'),_0xd6ec('0x61'),'opened_by',_0xd6ec('0x62'),_0xd6ec('0x63'),_0xd6ec('0x64'),'state',_0xd6ec('0x65'),_0xd6ec('0x53'),_0xd6ec('0x37'),'calendar_stc',_0xd6ec('0x66'),'cmdb_ci','delivery_plan',_0xd6ec('0x67'),_0xd6ec('0x68'),_0xd6ec('0x69'),'business_service','priority',_0xd6ec('0x6a'),'rfc',_0xd6ec('0x6b'),_0xd6ec('0x6c'),'opened_at',_0xd6ec('0x6d'),'group_list',_0xd6ec('0x6e'),_0xd6ec('0x6f'),_0xd6ec('0x70'),_0xd6ec('0x71'),'approval_set',_0xd6ec('0x72'),_0xd6ec('0x73'),_0xd6ec('0x74'),_0xd6ec('0x54'),_0xd6ec('0x75'),'delivery_task',_0xd6ec('0x76'),_0xd6ec('0x77'),_0xd6ec('0x78'),_0xd6ec('0x79'),_0xd6ec('0x7a'),'calendar_duration','notify',_0xd6ec('0x7b'),_0xd6ec('0x7c'),_0xd6ec('0x7d'),'follow_up','parent_incident',_0xd6ec('0x7e'),_0xd6ec('0x7f'),_0xd6ec('0x80'),_0xd6ec('0x56'),'urgency','problem_id',_0xd6ec('0x81'),'reassignment_count','activity_due',_0xd6ec('0x82'),_0xd6ec('0x57'),_0xd6ec('0x83'),_0xd6ec('0x84'),_0xd6ec('0x85'),_0xd6ec('0x86'),_0xd6ec('0x87'),_0xd6ec('0x88'),'reopen_count','sys_tags',_0xd6ec('0x89'),_0xd6ec('0x8a'),_0xd6ec('0x8b'),_0xd6ec('0x8c'),_0xd6ec('0x8d')];var _0x1737c5='';var _0x4b64c8='';var _0x4d636c=[];var _0xd168ee='';var _0x438d55='';var _0x477dac=[];var _0x4785f2='';var _0x13585d='';var _0x5c43d3={};var _0x2908f0='';return db['ServicenowAccount'][_0xd6ec('0x49')]({'where':{'id':_0x16672a[_0xd6ec('0x43')]['id']},'attributes':['id',_0xd6ec('0x8e'),_0xd6ec('0x8f'),_0xd6ec('0x90'),_0xd6ec('0x91'),_0xd6ec('0x92')]})[_0xd6ec('0x24')](handleEntityNotFound(_0x1edbe5,null))[_0xd6ec('0x24')](function(_0x5e3447){if(_0x5e3447){_0x2908f0=_0x5e3447[_0xd6ec('0x91')];var _0x41a7e1=_0x2908f0[_0xd6ec('0x93')](-0x1);if(_0x41a7e1==='/'){_0x2908f0=_0x2908f0['substring'](0x0,_0x2908f0[_0xd6ec('0x94')](_0x41a7e1));}_0x13585d=util[_0xd6ec('0x95')]('%s/api/now/doc/table/schema/',_0x2908f0);_0x4785f2=util['format'](_0xd6ec('0x96'),_0x2908f0);_0x5c43d3={'user':_0x5e3447[_0xd6ec('0x8e')],'pass':_0x5e3447[_0xd6ec('0x8f')]};var _0x172739={'method':_0xd6ec('0x97'),'uri':_0x13585d+_0xd6ec('0x98'),'auth':_0x5c43d3,'json':!![]};return rp(_0x172739);}})['then'](function(_0x5c9846){if(_0x5c9846[_0xd6ec('0x99')]['length']>0x0){_0x1737c5=_0x5c9846[_0xd6ec('0x99')];}console['log'](_0xd6ec('0x9a'),_0x1737c5);_0x477dac=[];_0x4b64c8=Object[_0xd6ec('0x9b')]([],_0x1737c5);_['remove'](_0x4b64c8,function(_0x84869e){return!_0x352a19[_0xd6ec('0x9c')](_0x84869e[_0xd6ec('0x27')]);});_0x4b64c8[_0xd6ec('0x9d')](function(_0x1c698b){var _0x365290=createFieldObject(_0x4785f2,_0x5c43d3,_0x1c698b['internalType'],_0x1c698b[_0xd6ec('0x27')],_0x1c698b[_0xd6ec('0x9e')],![]);_0x477dac['push'](_0x365290);});return Promise[_0xd6ec('0x9f')](_0x477dac);})[_0xd6ec('0x24')](function(_0x159689){_0x4d636c=_0x159689;_0xd168ee=Object[_0xd6ec('0x9b')]([],_0x1737c5);console[_0xd6ec('0xa0')](_0xd6ec('0xa1'),_0x1737c5);_[_0xd6ec('0xa2')](_0xd168ee,function(_0x5e3744){return _0x15f7a0[_0xd6ec('0x9c')](_0x5e3744[_0xd6ec('0x27')]);});console[_0xd6ec('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xd168ee);_0x477dac=[];_0xd168ee[_0xd6ec('0x9d')](function(_0xe738d2){var _0x33636d=createFieldObject(_0x4785f2,_0x5c43d3,_0xe738d2[_0xd6ec('0xa3')],_0xe738d2[_0xd6ec('0x27')],_0xe738d2[_0xd6ec('0x9e')],!![]);_0x477dac[_0xd6ec('0xa4')](_0x33636d);});return Promise['all'](_0x477dac);})['then'](function(_0x379ac5){_0x438d55=_0x379ac5;var _0x497f50=_0x4d636c[_0xd6ec('0xa5')](_0x438d55);return{'count':_0x497f50[_0xd6ec('0x34')],'rows':_0x497f50};})[_0xd6ec('0x24')](respondWithResult(_0x1edbe5,null))['catch'](function(_0x59eb99){console[_0xd6ec('0xa0')]('ServiceNow\x20error:\x20'+_0x59eb99);var _0x5ef94e=_0x16672a['query'][_0xd6ec('0xa6')]?0x1f4:_0x59eb99[_0xd6ec('0xa7')]||0x1f4;logger['error'](_0x59eb99[_0xd6ec('0xa8')]);delete _0x59eb99[_0xd6ec('0x27')];if(_0x5ef94e===0x191){_0x5ef94e=0x190;}_0x1edbe5[_0xd6ec('0x1b')](_0x5ef94e)[_0xd6ec('0x28')](_0x16672a['query'][_0xd6ec('0xa6')]?{'message':_0xd6ec('0xa9'),'statusCode':_0x59eb99[_0xd6ec('0xa7')]}:_0x59eb99);});};function createFieldObject(_0x594bb6,_0x2e6c6a,_0xcf47d5,_0x145836,_0x566dea,_0x6eda8){return new Promise(function(_0x2fcc9a,_0x1e2504){var _0x1ac61b={'id':_0x145836,'name':_0x566dea,'custom':_0x6eda8};if(_0xcf47d5===_0xd6ec('0xaa')){_0x1ac61b[_0xd6ec('0x3d')]=[{'name':'True','value':_0xd6ec('0xab')},{'name':_0xd6ec('0xac'),'value':_0xd6ec('0xad')}];_0x2fcc9a(_0x1ac61b);}else{var _0xf16564={'method':_0xd6ec('0x97'),'uri':_0x594bb6+_0xd6ec('0xae')+_0x145836,'auth':_0x2e6c6a,'json':!![]};return rp(_0xf16564)[_0xd6ec('0x24')](function(_0x253126){var _0x33ad6b=[];if(_0x253126['result']['length']>0x0){_0x253126[_0xd6ec('0x99')][_0xd6ec('0x9d')](function(_0x541184){if(_0x541184[_0xd6ec('0xaf')]===_0xd6ec('0xad')){var _0x4a3424={'name':_0x541184[_0xd6ec('0x9e')],'value':_0x541184[_0xd6ec('0xb0')]};_0x33ad6b[_0xd6ec('0xa4')](_0x4a3424);}});}_0x1ac61b[_0xd6ec('0x3d')]=_0x33ad6b;if(_0x1ac61b[_0xd6ec('0x3d')][_0xd6ec('0x34')]>0x0){_0x2fcc9a(_0x1ac61b);}else{if(_0x6eda8==![]){_0x2fcc9a();}else{_0x2fcc9a(_0x1ac61b);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 3956d0f..a5fef18 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 _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes','exports','int_servicenow_accounts'];(function(_0x2ceb2,_0x3a480c){var _0x4a9aca=function(_0x14589){while(--_0x14589){_0x2ceb2['push'](_0x2ceb2['shift']());}};_0x4a9aca(++_0x3a480c);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x42b02c,_0x5c7b99){_0x42b02c=_0x42b02c-0x0;var _0x105518=_0xfdbd[_0x42b02c];return _0x105518;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xdfdb('0xa')]=function(_0x41bd5e,_0x489f19){return _0x41bd5e['define']('ServicenowAccount',attributes,{'tableName':_0xdfdb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x361eec,_0x25d17d){_0x361eec=_0x361eec-0x0;var _0x135971=_0x3f8a[_0x361eec];return _0x135971;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'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 b1cf347..6c45b26 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 _0x61b9=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','limit','map','model','attributes','include','then','find','raw','where','ShowServicenowAccount','catch','lodash','util','moment'];(function(_0x355c20,_0x2090d0){var _0x4fbf70=function(_0x19c377){while(--_0x19c377){_0x355c20['push'](_0x355c20['shift']());}};_0x4fbf70(++_0x2090d0);}(_0x61b9,0x11d));var _0x961b=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x61b9[_0xa990b7];return _0x52c99c;};'use strict';var _=require(_0x961b('0x0'));var util=require(_0x961b('0x1'));var moment=require(_0x961b('0x2'));var BPromise=require('bluebird');var rs=require(_0x961b('0x3'));var fs=require('fs');var Redis=require(_0x961b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x961b('0x5'));var logger=require(_0x961b('0x6'))(_0x961b('0x7'));var config=require(_0x961b('0x8'));var jayson=require(_0x961b('0x9'));var client=jayson[_0x961b('0xa')][_0x961b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ec96,_0x5e2e68,_0x3c62d5){return new BPromise(function(_0xab0c3f,_0x128025){return client[_0x961b('0xc')](_0x11ec96,_0x3c62d5)['then'](function(_0xad664f){logger[_0x961b('0xd')](_0x961b('0xe'),_0x5e2e68,_0x961b('0xf'));logger['debug'](_0x961b('0x10'),_0x5e2e68,_0x961b('0xf'),JSON[_0x961b('0x11')](_0xad664f));if(_0xad664f[_0x961b('0x12')]){if(_0xad664f[_0x961b('0x12')]['code']===0x1f4){logger[_0x961b('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x5e2e68,_0xad664f['error'][_0x961b('0x13')]);return _0x128025(_0xad664f[_0x961b('0x12')][_0x961b('0x13')]);}logger[_0x961b('0x12')](_0x961b('0xe'),_0x5e2e68,_0xad664f[_0x961b('0x12')][_0x961b('0x13')]);return _0xab0c3f(_0xad664f[_0x961b('0x12')][_0x961b('0x13')]);}else{logger[_0x961b('0xd')](_0x961b('0xe'),_0x5e2e68,'request\x20sent');_0xab0c3f(_0xad664f[_0x961b('0x14')][_0x961b('0x13')]);}})['catch'](function(_0x2ddce4){logger[_0x961b('0x12')](_0x961b('0xe'),_0x5e2e68,_0x2ddce4);_0x128025(_0x2ddce4);});});}exports[_0x961b('0x15')]=function(_0x53dce7){var _0x4f5273=this;return new Promise(function(_0xfaa6e6,_0x12ac84){return db[_0x961b('0x16')][_0x961b('0x17')]({'raw':_0x53dce7[_0x961b('0x18')]?_0x53dce7[_0x961b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x53dce7['options']?_0x53dce7[_0x961b('0x18')]['where']||null:null,'attributes':_0x53dce7['options']?_0x53dce7[_0x961b('0x18')]['attributes']||null:null,'limit':_0x53dce7['options']?_0x53dce7[_0x961b('0x18')][_0x961b('0x19')]||null:null,'include':_0x53dce7[_0x961b('0x18')]?_0x53dce7['options']['include']?_[_0x961b('0x1a')](_0x53dce7[_0x961b('0x18')]['include'],function(_0x52eb64){return{'model':db[_0x52eb64[_0x961b('0x1b')]],'as':_0x52eb64['as'],'attributes':_0x52eb64[_0x961b('0x1c')],'include':_0x52eb64['include']?_[_0x961b('0x1a')](_0x52eb64['include'],function(_0x51685c){return{'model':db[_0x51685c[_0x961b('0x1b')]],'as':_0x51685c['as'],'attributes':_0x51685c[_0x961b('0x1c')],'include':_0x51685c[_0x961b('0x1d')]?_[_0x961b('0x1a')](_0x51685c[_0x961b('0x1d')],function(_0x23ddeb){return{'model':db[_0x23ddeb[_0x961b('0x1b')]],'as':_0x23ddeb['as'],'attributes':_0x23ddeb[_0x961b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x961b('0x1e')](function(_0x2224cc){logger['info'](_0x961b('0x15'),_0x53dce7);logger['debug'](_0x961b('0x15'),_0x53dce7,JSON[_0x961b('0x11')](_0x2224cc));_0xfaa6e6(_0x2224cc);})['catch'](function(_0x52bde4){logger[_0x961b('0x12')](_0x961b('0x15'),_0x52bde4[_0x961b('0x13')],_0x53dce7);_0x12ac84(_0x4f5273[_0x961b('0x12')](0x1f4,_0x52bde4['message']));});});};exports['ShowServicenowAccount']=function(_0x427547){var _0x48d90c=this;return new Promise(function(_0x2a44fc,_0x170c16){return db[_0x961b('0x16')][_0x961b('0x1f')]({'raw':_0x427547[_0x961b('0x18')]?_0x427547[_0x961b('0x18')][_0x961b('0x20')]===undefined?!![]:![]:!![],'where':_0x427547[_0x961b('0x18')]?_0x427547['options'][_0x961b('0x21')]||null:null,'attributes':_0x427547[_0x961b('0x18')]?_0x427547['options'][_0x961b('0x1c')]||null:null,'include':_0x427547['options']?_0x427547['options']['include']?_[_0x961b('0x1a')](_0x427547[_0x961b('0x18')]['include'],function(_0x2a657c){return{'model':db[_0x2a657c[_0x961b('0x1b')]],'as':_0x2a657c['as'],'attributes':_0x2a657c[_0x961b('0x1c')],'include':_0x2a657c['include']?_[_0x961b('0x1a')](_0x2a657c[_0x961b('0x1d')],function(_0x43f002){return{'model':db[_0x43f002['model']],'as':_0x43f002['as'],'attributes':_0x43f002[_0x961b('0x1c')],'include':_0x43f002['include']?_[_0x961b('0x1a')](_0x43f002[_0x961b('0x1d')],function(_0x5b04de){return{'model':db[_0x5b04de['model']],'as':_0x5b04de['as'],'attributes':_0x5b04de[_0x961b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x961b('0x1e')](function(_0x430cbd){logger[_0x961b('0xd')]('ShowServicenowAccount',_0x427547);logger['debug'](_0x961b('0x22'),_0x427547,JSON[_0x961b('0x11')](_0x430cbd));_0x2a44fc(_0x430cbd);})[_0x961b('0x23')](function(_0x2e8c74){logger[_0x961b('0x12')]('ShowServicenowAccount',_0x2e8c74[_0x961b('0x13')],_0x427547);_0x170c16(_0x48d90c[_0x961b('0x12')](0x1f4,_0x2e8c74[_0x961b('0x13')]));});});}; \ No newline at end of file +var _0x21f6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','limit','include','map','model','attributes','stringify','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x15a346,_0x46d825){var _0x275a0f=function(_0x3df115){while(--_0x3df115){_0x15a346['push'](_0x15a346['shift']());}};_0x275a0f(++_0x46d825);}(_0x21f6,0xd9));var _0x621f=function(_0x5c113a,_0x53a028){_0x5c113a=_0x5c113a-0x0;var _0x52658e=_0x21f6[_0x5c113a];return _0x52658e;};'use strict';var _=require(_0x621f('0x0'));var util=require(_0x621f('0x1'));var moment=require(_0x621f('0x2'));var BPromise=require(_0x621f('0x3'));var rs=require(_0x621f('0x4'));var fs=require('fs');var Redis=require(_0x621f('0x5'));var db=require(_0x621f('0x6'))['db'];var utils=require(_0x621f('0x7'));var logger=require('../../config/logger')(_0x621f('0x8'));var config=require(_0x621f('0x9'));var jayson=require(_0x621f('0xa'));var client=jayson[_0x621f('0xb')][_0x621f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x489455,_0x40b2a3,_0x1fc4b6){return new BPromise(function(_0x3d6c96,_0xbe5de2){return client[_0x621f('0xd')](_0x489455,_0x1fc4b6)[_0x621f('0xe')](function(_0x3afcd0){logger[_0x621f('0xf')](_0x621f('0x10'),_0x40b2a3,_0x621f('0x11'));logger[_0x621f('0x12')](_0x621f('0x13'),_0x40b2a3,_0x621f('0x11'),JSON['stringify'](_0x3afcd0));if(_0x3afcd0[_0x621f('0x14')]){if(_0x3afcd0[_0x621f('0x14')][_0x621f('0x15')]===0x1f4){logger[_0x621f('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x40b2a3,_0x3afcd0['error'][_0x621f('0x16')]);return _0xbe5de2(_0x3afcd0[_0x621f('0x14')][_0x621f('0x16')]);}logger['error'](_0x621f('0x10'),_0x40b2a3,_0x3afcd0[_0x621f('0x14')][_0x621f('0x16')]);return _0x3d6c96(_0x3afcd0[_0x621f('0x14')][_0x621f('0x16')]);}else{logger[_0x621f('0xf')](_0x621f('0x10'),_0x40b2a3,_0x621f('0x11'));_0x3d6c96(_0x3afcd0['result'][_0x621f('0x16')]);}})[_0x621f('0x17')](function(_0x4d07db){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x40b2a3,_0x4d07db);_0xbe5de2(_0x4d07db);});});}exports[_0x621f('0x18')]=function(_0x1ae719){var _0x2de744=this;return new Promise(function(_0x24db37,_0x3551d3){return db[_0x621f('0x19')]['findAll']({'raw':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1c')]||null:null,'attributes':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')]['attributes']||null:null,'limit':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1d')]||null:null,'include':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x1ae719['options'][_0x621f('0x1e')],function(_0x12c43d){return{'model':db[_0x12c43d[_0x621f('0x20')]],'as':_0x12c43d['as'],'attributes':_0x12c43d['attributes'],'include':_0x12c43d[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x12c43d[_0x621f('0x1e')],function(_0x4f1401){return{'model':db[_0x4f1401[_0x621f('0x20')]],'as':_0x4f1401['as'],'attributes':_0x4f1401[_0x621f('0x21')],'include':_0x4f1401[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x4f1401['include'],function(_0x44e108){return{'model':db[_0x44e108[_0x621f('0x20')]],'as':_0x44e108['as'],'attributes':_0x44e108['attributes']};}):[]};}):[]};}):[]:[]})[_0x621f('0xe')](function(_0x1df856){logger['info']('GetServicenowAccount',_0x1ae719);logger[_0x621f('0x12')](_0x621f('0x18'),_0x1ae719,JSON[_0x621f('0x22')](_0x1df856));_0x24db37(_0x1df856);})['catch'](function(_0x471f52){logger[_0x621f('0x14')]('GetServicenowAccount',_0x471f52[_0x621f('0x16')],_0x1ae719);_0x3551d3(_0x2de744[_0x621f('0x14')](0x1f4,_0x471f52['message']));});});};exports[_0x621f('0x23')]=function(_0x4185df){var _0x18cbee=this;return new Promise(function(_0x3daaa4,_0x328ad2){return db[_0x621f('0x19')][_0x621f('0x24')]({'raw':_0x4185df[_0x621f('0x1a')]?_0x4185df[_0x621f('0x1a')][_0x621f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4185df[_0x621f('0x1a')]?_0x4185df['options']['where']||null:null,'attributes':_0x4185df['options']?_0x4185df[_0x621f('0x1a')][_0x621f('0x21')]||null:null,'include':_0x4185df[_0x621f('0x1a')]?_0x4185df['options'][_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x4185df['options'][_0x621f('0x1e')],function(_0x471ea3){return{'model':db[_0x471ea3[_0x621f('0x20')]],'as':_0x471ea3['as'],'attributes':_0x471ea3['attributes'],'include':_0x471ea3[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x471ea3[_0x621f('0x1e')],function(_0x477eb2){return{'model':db[_0x477eb2[_0x621f('0x20')]],'as':_0x477eb2['as'],'attributes':_0x477eb2[_0x621f('0x21')],'include':_0x477eb2[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x477eb2[_0x621f('0x1e')],function(_0x487f50){return{'model':db[_0x487f50['model']],'as':_0x487f50['as'],'attributes':_0x487f50[_0x621f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbf9709){logger['info'](_0x621f('0x23'),_0x4185df);logger[_0x621f('0x12')](_0x621f('0x23'),_0x4185df,JSON[_0x621f('0x22')](_0xbf9709));_0x3daaa4(_0xbf9709);})[_0x621f('0x17')](function(_0x423b6f){logger['error']('ShowServicenowAccount',_0x423b6f[_0x621f('0x16')],_0x4185df);_0x328ad2(_0x18cbee[_0x621f('0x14')](0x1f4,_0x423b6f['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 560db0d..e5d8e41 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 _0x9f88=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9f88,0x1d7));var _0x89f8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9f88[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x89f8('0x0'));var util=require(_0x89f8('0x1'));var path=require(_0x89f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x89f8('0x3'));var router=express[_0x89f8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89f8('0x5'));var interaction=require(_0x89f8('0x6'));var config=require(_0x89f8('0x7'));var controller=require(_0x89f8('0x8'));router[_0x89f8('0x9')]('/',auth['isAuthenticated'](),controller[_0x89f8('0xa')]);router[_0x89f8('0x9')]('/:id',auth[_0x89f8('0xb')](),controller[_0x89f8('0xc')]);router[_0x89f8('0x9')](_0x89f8('0xd'),auth[_0x89f8('0xb')](),controller[_0x89f8('0xe')]);router[_0x89f8('0x9')](_0x89f8('0xf'),auth['isAuthenticated'](),controller[_0x89f8('0x10')]);router[_0x89f8('0x9')](_0x89f8('0x11'),auth[_0x89f8('0xb')](),controller[_0x89f8('0x12')]);router[_0x89f8('0x13')]('/',auth[_0x89f8('0xb')](),controller[_0x89f8('0x14')]);router[_0x89f8('0x15')]('/:id',auth[_0x89f8('0xb')](),controller[_0x89f8('0x16')]);router[_0x89f8('0x17')](_0x89f8('0x18'),auth[_0x89f8('0xb')](),controller[_0x89f8('0x19')]);module[_0x89f8('0x1a')]=router; \ No newline at end of file +var _0xaf11=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','getDescriptions','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x128e6f,_0x1cc8a1){var _0x2ae82a=function(_0xd4dcaa){while(--_0xd4dcaa){_0x128e6f['push'](_0x128e6f['shift']());}};_0x2ae82a(++_0x1cc8a1);}(_0xaf11,0x17a));var _0x1af1=function(_0x10a649,_0x19ad03){_0x10a649=_0x10a649-0x0;var _0x53e030=_0xaf11[_0x10a649];return _0x53e030;};'use strict';var multer=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1af1('0x2'));var router=express['Router']();var fs_extra=require(_0x1af1('0x3'));var auth=require(_0x1af1('0x4'));var interaction=require(_0x1af1('0x5'));var config=require('../../config/environment');var controller=require(_0x1af1('0x6'));router['get']('/',auth[_0x1af1('0x7')](),controller[_0x1af1('0x8')]);router[_0x1af1('0x9')]('/:id',auth[_0x1af1('0x7')](),controller[_0x1af1('0xa')]);router['get']('/:id/fields',auth[_0x1af1('0x7')](),controller[_0x1af1('0xb')]);router[_0x1af1('0x9')](_0x1af1('0xc'),auth[_0x1af1('0x7')](),controller['getSubjects']);router[_0x1af1('0x9')]('/:id/descriptions',auth[_0x1af1('0x7')](),controller[_0x1af1('0xd')]);router[_0x1af1('0xe')]('/',auth[_0x1af1('0x7')](),controller['create']);router['put'](_0x1af1('0xf'),auth['isAuthenticated'](),controller[_0x1af1('0x10')]);router[_0x1af1('0x11')](_0x1af1('0xf'),auth[_0x1af1('0x7')](),controller[_0x1af1('0x12')]);module[_0x1af1('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 08026fb..1e414d0 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 _0x5910=['sequelize','exports','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x5910,0xd8));var _0x0591=function(_0x183f53,_0x4e7018){_0x183f53=_0x183f53-0x0;var _0xeb2b92=_0x5910[_0x183f53];return _0xeb2b92;};'use strict';var Sequelize=require(_0x0591('0x0'));module[_0x0591('0x1')]={'name':{'type':Sequelize[_0x0591('0x2')]},'description':{'type':Sequelize[_0x0591('0x2')]}}; \ No newline at end of file +var _0xddd1=['exports','STRING','sequelize'];(function(_0x1b943f,_0x6f6e83){var _0x8b7549=function(_0x5b52d3){while(--_0x5b52d3){_0x1b943f['push'](_0x1b943f['shift']());}};_0x8b7549(++_0x6f6e83);}(_0xddd1,0x18e));var _0x1ddd=function(_0x2936a5,_0x46f12e){_0x2936a5=_0x2936a5-0x0;var _0x1eec2d=_0xddd1[_0x2936a5];return _0x1eec2d;};'use strict';var Sequelize=require(_0x1ddd('0x0'));module[_0x1ddd('0x1')]={'name':{'type':Sequelize[_0x1ddd('0x2')]},'description':{'type':Sequelize[_0x1ddd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ed85a1f..ad86950 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 _0xc36a=['ServicenowField','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','then','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','getFields'];(function(_0xa5cf8c,_0x153e9d){var _0x2e60e8=function(_0x1d90f7){while(--_0x1d90f7){_0xa5cf8c['push'](_0xa5cf8c['shift']());}};_0x2e60e8(++_0x153e9d);}(_0xc36a,0x13c));var _0xac36=function(_0x40a649,_0x4def56){_0x40a649=_0x40a649-0x0;var _0x2237ec=_0xc36a[_0x40a649];return _0x2237ec;};'use strict';var emlformat=require(_0xac36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac36('0x1'));var jsonpatch=require(_0xac36('0x2'));var rp=require(_0xac36('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac36('0x4'));var util=require('util');var path=require(_0xac36('0x5'));var sox=require(_0xac36('0x6'));var csv=require(_0xac36('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac36('0x8'));var _=require(_0xac36('0x9'));var squel=require(_0xac36('0xa'));var crypto=require(_0xac36('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xac36('0xc'));var toCsv=require(_0xac36('0x7'));var querystring=require(_0xac36('0xd'));var Papa=require(_0xac36('0xe'));var Redis=require(_0xac36('0xf'));var authService=require(_0xac36('0x10'));var qs=require(_0xac36('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac36('0x12'));var logger=require('../../config/logger')(_0xac36('0x13'));var utils=require(_0xac36('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac36('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x149769,_0x1bd85c){_0x1bd85c=_0x1bd85c||0xcc;return function(_0xf39d73){if(_0xf39d73){return _0x149769[_0xac36('0x16')](_0x1bd85c);}return _0x149769[_0xac36('0x17')](_0x1bd85c)[_0xac36('0x18')]();};}function respondWithResult(_0x4763a2,_0x5963c2){_0x5963c2=_0x5963c2||0xc8;return function(_0x5e7c8f){if(_0x5e7c8f){return _0x4763a2[_0xac36('0x17')](_0x5963c2)[_0xac36('0x19')](_0x5e7c8f);}};}function respondWithFilteredResult(_0x2c47db,_0xa8e59c){return function(_0x187fba){if(_0x187fba){var _0x1e1dc8=typeof _0xa8e59c['offset']===_0xac36('0x1a')&&typeof _0xa8e59c[_0xac36('0x1b')]===_0xac36('0x1a');var _0x566033=_0x187fba[_0xac36('0x1c')];var _0x2936ac=_0x1e1dc8?0x0:_0xa8e59c['offset'];var _0x21cacd=_0x1e1dc8?_0x187fba['count']:_0xa8e59c[_0xac36('0x1d')]+_0xa8e59c[_0xac36('0x1b')];var _0x3dfc73;if(_0x21cacd>=_0x566033){_0x21cacd=_0x566033;_0x3dfc73=0xc8;}else{_0x3dfc73=0xce;}_0x2c47db[_0xac36('0x17')](_0x3dfc73);return _0x2c47db['set'](_0xac36('0x1e'),_0x2936ac+'-'+_0x21cacd+'/'+_0x566033)[_0xac36('0x19')](_0x187fba);}return null;};}function patchUpdates(_0x541dec){return function(_0x3b7f60){try{jsonpatch[_0xac36('0x1f')](_0x3b7f60,_0x541dec,!![]);}catch(_0x20261e){return BPromise[_0xac36('0x20')](_0x20261e);}return _0x3b7f60['save']();};}function saveUpdates(_0x3f3dab,_0x258753){return function(_0x1feb36){if(_0x1feb36){return _0x1feb36[_0xac36('0x21')](_0x3f3dab)['then'](function(_0x52cdc4){return _0x52cdc4;});}return null;};}function removeEntity(_0x54c579,_0x53a403){return function(_0x15fbfd){if(_0x15fbfd){return _0x15fbfd[_0xac36('0x22')]()['then'](function(){_0x54c579[_0xac36('0x17')](0xcc)[_0xac36('0x18')]();});}};}function handleEntityNotFound(_0x5c9ea2,_0x37ae18){return function(_0x4c5ddb){if(!_0x4c5ddb){_0x5c9ea2['sendStatus'](0x194);}return _0x4c5ddb;};}function handleError(_0x8cce6b,_0x341ad0){_0x341ad0=_0x341ad0||0x1f4;return function(_0x30a61e){logger['error'](_0x30a61e[_0xac36('0x23')]);if(_0x30a61e[_0xac36('0x24')]){delete _0x30a61e[_0xac36('0x24')];}_0x8cce6b[_0xac36('0x17')](_0x341ad0)[_0xac36('0x25')](_0x30a61e);};}exports[_0xac36('0x26')]=function(_0x407e84,_0x2a7e44){var _0x3500c0={},_0x2209e5={},_0x1cf90a={'count':0x0,'rows':[]};var _0x5ad328=_[_0xac36('0x27')](db[_0xac36('0x28')][_0xac36('0x29')],function(_0x3b4488){return{'name':_0x3b4488[_0xac36('0x2a')],'type':_0x3b4488['type']['key']};});_0x2209e5[_0xac36('0x2b')]=_[_0xac36('0x27')](_0x5ad328,_0xac36('0x24'));_0x2209e5[_0xac36('0x2c')]=_['keys'](_0x407e84[_0xac36('0x2c')]);_0x2209e5[_0xac36('0x2d')]=_[_0xac36('0x2e')](_0x2209e5[_0xac36('0x2b')],_0x2209e5['query']);_0x3500c0['attributes']=_[_0xac36('0x2e')](_0x2209e5[_0xac36('0x2b')],qs[_0xac36('0x2f')](_0x407e84[_0xac36('0x2c')][_0xac36('0x2f')]));_0x3500c0[_0xac36('0x30')]=_0x3500c0[_0xac36('0x30')][_0xac36('0x31')]?_0x3500c0['attributes']:_0x2209e5[_0xac36('0x2b')];if(!_0x407e84['query'][_0xac36('0x32')](_0xac36('0x33'))){_0x3500c0[_0xac36('0x1b')]=qs[_0xac36('0x1b')](_0x407e84[_0xac36('0x2c')]['limit']);_0x3500c0[_0xac36('0x1d')]=qs[_0xac36('0x1d')](_0x407e84[_0xac36('0x2c')][_0xac36('0x1d')]);}_0x3500c0[_0xac36('0x34')]=qs[_0xac36('0x35')](_0x407e84[_0xac36('0x2c')][_0xac36('0x35')]);_0x3500c0[_0xac36('0x36')]=qs['filters'](_[_0xac36('0x37')](_0x407e84[_0xac36('0x2c')],_0x2209e5['filters']),_0x5ad328);if(_0x407e84[_0xac36('0x2c')][_0xac36('0x38')]){_0x3500c0[_0xac36('0x36')]=_['merge'](_0x3500c0[_0xac36('0x36')],{'$or':_[_0xac36('0x27')](_0x5ad328,function(_0x34c785){if(_0x34c785[_0xac36('0x39')]!==_0xac36('0x3a')){var _0x23dbab={};_0x23dbab[_0x34c785[_0xac36('0x24')]]={'$like':'%'+_0x407e84[_0xac36('0x2c')][_0xac36('0x38')]+'%'};return _0x23dbab;}})});}_0x3500c0=_[_0xac36('0x3b')]({},_0x3500c0,_0x407e84[_0xac36('0x3c')]);var _0x4a0f19={'where':_0x3500c0[_0xac36('0x36')]};return db['ServicenowConfiguration'][_0xac36('0x1c')](_0x4a0f19)[_0xac36('0x3d')](function(_0x5c5c2e){_0x1cf90a[_0xac36('0x1c')]=_0x5c5c2e;if(_0x407e84['query']['includeAll']){_0x3500c0[_0xac36('0x3e')]=[{'all':!![]}];}return db[_0xac36('0x28')][_0xac36('0x3f')](_0x3500c0);})[_0xac36('0x3d')](function(_0x92b8e6){_0x1cf90a[_0xac36('0x40')]=_0x92b8e6;return _0x1cf90a;})['then'](respondWithFilteredResult(_0x2a7e44,_0x3500c0))[_0xac36('0x41')](handleError(_0x2a7e44,null));};exports[_0xac36('0x42')]=function(_0x1ee5ec,_0x46836d){var _0x957869={'raw':![],'where':{'id':_0x1ee5ec[_0xac36('0x43')]['id']}},_0x51213e={};_0x51213e[_0xac36('0x2b')]=_[_0xac36('0x44')](db[_0xac36('0x28')][_0xac36('0x29')]);_0x51213e[_0xac36('0x2c')]=_['keys'](_0x1ee5ec[_0xac36('0x2c')]);_0x51213e['filters']=_[_0xac36('0x2e')](_0x51213e['model'],_0x51213e[_0xac36('0x2c')]);_0x957869[_0xac36('0x30')]=_[_0xac36('0x2e')](_0x51213e[_0xac36('0x2b')],qs[_0xac36('0x2f')](_0x1ee5ec[_0xac36('0x2c')]['fields']));_0x957869[_0xac36('0x30')]=_0x957869['attributes'][_0xac36('0x31')]?_0x957869['attributes']:_0x51213e[_0xac36('0x2b')];if(_0x1ee5ec[_0xac36('0x2c')][_0xac36('0x45')]){_0x957869[_0xac36('0x3e')]=[{'all':!![]}];}_0x957869=_[_0xac36('0x3b')]({},_0x957869,_0x1ee5ec[_0xac36('0x3c')]);return db[_0xac36('0x28')]['find'](_0x957869)[_0xac36('0x3d')](handleEntityNotFound(_0x46836d,null))[_0xac36('0x3d')](respondWithResult(_0x46836d,null))[_0xac36('0x41')](handleError(_0x46836d,null));};exports[_0xac36('0x46')]=function(_0x5e88fc,_0x10d474){return db[_0xac36('0x28')][_0xac36('0x46')](_0x5e88fc[_0xac36('0x47')],{})['then'](respondWithResult(_0x10d474,0xc9))['catch'](handleError(_0x10d474,null));};exports[_0xac36('0x21')]=function(_0x2e8f30,_0x408e0a){if(_0x2e8f30[_0xac36('0x47')]['id']){delete _0x2e8f30['body']['id'];}return db[_0xac36('0x28')][_0xac36('0x48')]({'where':{'id':_0x2e8f30['params']['id']}})[_0xac36('0x3d')](handleEntityNotFound(_0x408e0a,null))['then'](saveUpdates(_0x2e8f30[_0xac36('0x47')],null))[_0xac36('0x3d')](respondWithResult(_0x408e0a,null))[_0xac36('0x41')](handleError(_0x408e0a,null));};exports['destroy']=function(_0x34c792,_0x5adecc){return db[_0xac36('0x28')][_0xac36('0x48')]({'where':{'id':_0x34c792['params']['id']}})[_0xac36('0x3d')](handleEntityNotFound(_0x5adecc,null))['then'](removeEntity(_0x5adecc,null))[_0xac36('0x41')](handleError(_0x5adecc,null));};exports[_0xac36('0x49')]=function(_0xfbcb3a,_0x8cb3bc,_0x1f41dd){var _0x102d61={};var _0x34b253={};var _0x4cb72f;var _0x2e3b56;return db[_0xac36('0x28')]['findOne']({'where':{'id':_0xfbcb3a['params']['id']}})[_0xac36('0x3d')](handleEntityNotFound(_0x8cb3bc,null))[_0xac36('0x3d')](function(_0x195e06){if(_0x195e06){_0x4cb72f=_0x195e06;_0x34b253[_0xac36('0x2b')]=_[_0xac36('0x44')](db[_0xac36('0x4a')][_0xac36('0x29')]);_0x34b253[_0xac36('0x2c')]=_[_0xac36('0x44')](_0xfbcb3a[_0xac36('0x2c')]);_0x34b253[_0xac36('0x2d')]=_[_0xac36('0x2e')](_0x34b253[_0xac36('0x2b')],_0x34b253[_0xac36('0x2c')]);_0x102d61['attributes']=_['intersection'](_0x34b253[_0xac36('0x2b')],qs[_0xac36('0x2f')](_0xfbcb3a[_0xac36('0x2c')]['fields']));_0x102d61[_0xac36('0x30')]=_0x102d61[_0xac36('0x30')][_0xac36('0x31')]?_0x102d61['attributes']:_0x34b253['model'];_0x102d61[_0xac36('0x34')]=qs[_0xac36('0x35')](_0xfbcb3a[_0xac36('0x2c')]['sort']);_0x102d61[_0xac36('0x36')]=qs['filters'](_[_0xac36('0x37')](_0xfbcb3a['query'],_0x34b253[_0xac36('0x2d')]));if(_0xfbcb3a[_0xac36('0x2c')][_0xac36('0x38')]){_0x102d61[_0xac36('0x36')]=_['merge'](_0x102d61[_0xac36('0x36')],{'$or':_[_0xac36('0x27')](_0x102d61[_0xac36('0x30')],function(_0xd05a0f){var _0x23a44a={};_0x23a44a[_0xd05a0f]={'$like':'%'+_0xfbcb3a['query'][_0xac36('0x38')]+'%'};return _0x23a44a;})});}_0x102d61=_[_0xac36('0x3b')]({},_0x102d61,_0xfbcb3a['options']);return _0x4cb72f[_0xac36('0x49')](_0x102d61);}})[_0xac36('0x3d')](function(_0x1df6cf){if(_0x1df6cf){_0x2e3b56=_0x1df6cf[_0xac36('0x31')];if(!_0xfbcb3a['query'][_0xac36('0x32')](_0xac36('0x33'))){_0x102d61['limit']=qs[_0xac36('0x1b')](_0xfbcb3a[_0xac36('0x2c')][_0xac36('0x1b')]);_0x102d61[_0xac36('0x1d')]=qs[_0xac36('0x1d')](_0xfbcb3a['query'][_0xac36('0x1d')]);}return _0x4cb72f['getFields'](_0x102d61);}})[_0xac36('0x3d')](function(_0x126df7){if(_0x126df7){return _0x126df7?{'count':_0x2e3b56,'rows':_0x126df7}:null;}})[_0xac36('0x3d')](respondWithResult(_0x8cb3bc,null))[_0xac36('0x41')](handleError(_0x8cb3bc,null));};exports[_0xac36('0x4b')]=function(_0x3a7796,_0x2f594f,_0x25ab01){var _0x325c5d={};var _0x3b982f={};var _0x3c35cf;var _0x2c46d5;return db[_0xac36('0x28')][_0xac36('0x4c')]({'where':{'id':_0x3a7796[_0xac36('0x43')]['id']}})[_0xac36('0x3d')](handleEntityNotFound(_0x2f594f,null))[_0xac36('0x3d')](function(_0x24df2a){if(_0x24df2a){_0x3c35cf=_0x24df2a;_0x3b982f[_0xac36('0x2b')]=_[_0xac36('0x44')](db['ServicenowField'][_0xac36('0x29')]);_0x3b982f['query']=_['keys'](_0x3a7796[_0xac36('0x2c')]);_0x3b982f['filters']=_[_0xac36('0x2e')](_0x3b982f[_0xac36('0x2b')],_0x3b982f[_0xac36('0x2c')]);_0x325c5d[_0xac36('0x30')]=_[_0xac36('0x2e')](_0x3b982f[_0xac36('0x2b')],qs[_0xac36('0x2f')](_0x3a7796[_0xac36('0x2c')]['fields']));_0x325c5d[_0xac36('0x30')]=_0x325c5d[_0xac36('0x30')][_0xac36('0x31')]?_0x325c5d[_0xac36('0x30')]:_0x3b982f[_0xac36('0x2b')];_0x325c5d[_0xac36('0x34')]=qs['sort'](_0x3a7796[_0xac36('0x2c')][_0xac36('0x35')]);_0x325c5d[_0xac36('0x36')]=qs[_0xac36('0x2d')](_['pick'](_0x3a7796[_0xac36('0x2c')],_0x3b982f['filters']));if(_0x3a7796[_0xac36('0x2c')][_0xac36('0x38')]){_0x325c5d[_0xac36('0x36')]=_[_0xac36('0x3b')](_0x325c5d[_0xac36('0x36')],{'$or':_[_0xac36('0x27')](_0x325c5d[_0xac36('0x30')],function(_0x8b588d){var _0x36fee9={};_0x36fee9[_0x8b588d]={'$like':'%'+_0x3a7796['query'][_0xac36('0x38')]+'%'};return _0x36fee9;})});}_0x325c5d=_[_0xac36('0x3b')]({},_0x325c5d,_0x3a7796[_0xac36('0x3c')]);return _0x3c35cf[_0xac36('0x4b')](_0x325c5d);}})[_0xac36('0x3d')](function(_0x1563b6){if(_0x1563b6){_0x2c46d5=_0x1563b6['length'];if(!_0x3a7796['query']['hasOwnProperty'](_0xac36('0x33'))){_0x325c5d[_0xac36('0x1b')]=qs['limit'](_0x3a7796['query'][_0xac36('0x1b')]);_0x325c5d['offset']=qs['offset'](_0x3a7796[_0xac36('0x2c')][_0xac36('0x1d')]);}return _0x3c35cf['getSubjects'](_0x325c5d);}})[_0xac36('0x3d')](function(_0x3f52c6){if(_0x3f52c6){return _0x3f52c6?{'count':_0x2c46d5,'rows':_0x3f52c6}:null;}})[_0xac36('0x3d')](respondWithResult(_0x2f594f,null))[_0xac36('0x41')](handleError(_0x2f594f,null));};exports[_0xac36('0x4d')]=function(_0x28bc1f,_0x40bb08,_0x7add81){var _0x2dadeb={};var _0x43b7c8={};var _0x2fcc94;var _0x4110dd;return db[_0xac36('0x28')]['findOne']({'where':{'id':_0x28bc1f[_0xac36('0x43')]['id']}})[_0xac36('0x3d')](handleEntityNotFound(_0x40bb08,null))[_0xac36('0x3d')](function(_0x1c30ef){if(_0x1c30ef){_0x2fcc94=_0x1c30ef;_0x43b7c8[_0xac36('0x2b')]=_[_0xac36('0x44')](db[_0xac36('0x4a')][_0xac36('0x29')]);_0x43b7c8[_0xac36('0x2c')]=_[_0xac36('0x44')](_0x28bc1f['query']);_0x43b7c8[_0xac36('0x2d')]=_[_0xac36('0x2e')](_0x43b7c8[_0xac36('0x2b')],_0x43b7c8[_0xac36('0x2c')]);_0x2dadeb['attributes']=_['intersection'](_0x43b7c8['model'],qs[_0xac36('0x2f')](_0x28bc1f[_0xac36('0x2c')]['fields']));_0x2dadeb[_0xac36('0x30')]=_0x2dadeb[_0xac36('0x30')]['length']?_0x2dadeb[_0xac36('0x30')]:_0x43b7c8[_0xac36('0x2b')];_0x2dadeb[_0xac36('0x34')]=qs[_0xac36('0x35')](_0x28bc1f[_0xac36('0x2c')][_0xac36('0x35')]);_0x2dadeb[_0xac36('0x36')]=qs[_0xac36('0x2d')](_[_0xac36('0x37')](_0x28bc1f[_0xac36('0x2c')],_0x43b7c8[_0xac36('0x2d')]));if(_0x28bc1f[_0xac36('0x2c')][_0xac36('0x38')]){_0x2dadeb[_0xac36('0x36')]=_[_0xac36('0x3b')](_0x2dadeb[_0xac36('0x36')],{'$or':_[_0xac36('0x27')](_0x2dadeb['attributes'],function(_0x551789){var _0x2ab0c1={};_0x2ab0c1[_0x551789]={'$like':'%'+_0x28bc1f[_0xac36('0x2c')][_0xac36('0x38')]+'%'};return _0x2ab0c1;})});}_0x2dadeb=_[_0xac36('0x3b')]({},_0x2dadeb,_0x28bc1f['options']);return _0x2fcc94['getDescriptions'](_0x2dadeb);}})[_0xac36('0x3d')](function(_0x2c7d40){if(_0x2c7d40){_0x4110dd=_0x2c7d40[_0xac36('0x31')];if(!_0x28bc1f[_0xac36('0x2c')][_0xac36('0x32')](_0xac36('0x33'))){_0x2dadeb[_0xac36('0x1b')]=qs['limit'](_0x28bc1f[_0xac36('0x2c')]['limit']);_0x2dadeb[_0xac36('0x1d')]=qs[_0xac36('0x1d')](_0x28bc1f[_0xac36('0x2c')]['offset']);}return _0x2fcc94['getDescriptions'](_0x2dadeb);}})[_0xac36('0x3d')](function(_0x301ba8){if(_0x301ba8){return _0x301ba8?{'count':_0x4110dd,'rows':_0x301ba8}:null;}})['then'](respondWithResult(_0x40bb08,null))[_0xac36('0x41')](handleError(_0x40bb08,null));}; \ No newline at end of file +var _0xc2d9=['merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ServicenowField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter'];(function(_0x35d361,_0x3573a7){var _0x458a5f=function(_0x46aa4a){while(--_0x46aa4a){_0x35d361['push'](_0x35d361['shift']());}};_0x458a5f(++_0x3573a7);}(_0xc2d9,0x109));var _0x9c2d=function(_0x2026d2,_0x7e394c){_0x2026d2=_0x2026d2-0x0;var _0x22fab2=_0xc2d9[_0x2026d2];return _0x22fab2;};'use strict';var emlformat=require(_0x9c2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c2d('0x1'));var jsonpatch=require(_0x9c2d('0x2'));var rp=require(_0x9c2d('0x3'));var moment=require(_0x9c2d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c2d('0x5'));var util=require(_0x9c2d('0x6'));var path=require(_0x9c2d('0x7'));var sox=require(_0x9c2d('0x8'));var csv=require('to-csv');var ejs=require(_0x9c2d('0x9'));var fs=require('fs');var fs_extra=require(_0x9c2d('0xa'));var _=require(_0x9c2d('0xb'));var squel=require(_0x9c2d('0xc'));var crypto=require(_0x9c2d('0xd'));var jsforce=require(_0x9c2d('0xe'));var deskjs=require(_0x9c2d('0xf'));var toCsv=require(_0x9c2d('0x10'));var querystring=require('querystring');var Papa=require(_0x9c2d('0x11'));var Redis=require(_0x9c2d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9c2d('0x13'));var as=require(_0x9c2d('0x14'));var hardwareService=require(_0x9c2d('0x15'));var logger=require(_0x9c2d('0x16'))(_0x9c2d('0x17'));var utils=require(_0x9c2d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9c2d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45f600,_0x4cc359){_0x4cc359=_0x4cc359||0xcc;return function(_0x4132c){if(_0x4132c){return _0x45f600[_0x9c2d('0x1a')](_0x4cc359);}return _0x45f600[_0x9c2d('0x1b')](_0x4cc359)['end']();};}function respondWithResult(_0x344387,_0xeeca58){_0xeeca58=_0xeeca58||0xc8;return function(_0x2fe50e){if(_0x2fe50e){return _0x344387['status'](_0xeeca58)['json'](_0x2fe50e);}};}function respondWithFilteredResult(_0x3df2c9,_0x59ebf9){return function(_0x2d75d6){if(_0x2d75d6){var _0x4cb438=typeof _0x59ebf9[_0x9c2d('0x1c')]===_0x9c2d('0x1d')&&typeof _0x59ebf9[_0x9c2d('0x1e')]===_0x9c2d('0x1d');var _0x3d59e7=_0x2d75d6[_0x9c2d('0x1f')];var _0x5bb806=_0x4cb438?0x0:_0x59ebf9[_0x9c2d('0x1c')];var _0x21dc4e=_0x4cb438?_0x2d75d6[_0x9c2d('0x1f')]:_0x59ebf9['offset']+_0x59ebf9[_0x9c2d('0x1e')];var _0x5dc550;if(_0x21dc4e>=_0x3d59e7){_0x21dc4e=_0x3d59e7;_0x5dc550=0xc8;}else{_0x5dc550=0xce;}_0x3df2c9['status'](_0x5dc550);return _0x3df2c9['set'](_0x9c2d('0x20'),_0x5bb806+'-'+_0x21dc4e+'/'+_0x3d59e7)[_0x9c2d('0x21')](_0x2d75d6);}return null;};}function patchUpdates(_0x1a5e18){return function(_0xa5d896){try{jsonpatch[_0x9c2d('0x22')](_0xa5d896,_0x1a5e18,!![]);}catch(_0x1c4faa){return BPromise[_0x9c2d('0x23')](_0x1c4faa);}return _0xa5d896[_0x9c2d('0x24')]();};}function saveUpdates(_0x34e66d,_0x203cdf){return function(_0x45ef71){if(_0x45ef71){return _0x45ef71['update'](_0x34e66d)[_0x9c2d('0x25')](function(_0x4a7933){return _0x4a7933;});}return null;};}function removeEntity(_0x1b71c1,_0x4e185f){return function(_0x41ade3){if(_0x41ade3){return _0x41ade3[_0x9c2d('0x26')]()[_0x9c2d('0x25')](function(){_0x1b71c1[_0x9c2d('0x1b')](0xcc)[_0x9c2d('0x27')]();});}};}function handleEntityNotFound(_0x165db4,_0x4439f0){return function(_0x455079){if(!_0x455079){_0x165db4['sendStatus'](0x194);}return _0x455079;};}function handleError(_0x4176b8,_0x67926){_0x67926=_0x67926||0x1f4;return function(_0x549d8d){logger[_0x9c2d('0x28')](_0x549d8d[_0x9c2d('0x29')]);if(_0x549d8d[_0x9c2d('0x2a')]){delete _0x549d8d[_0x9c2d('0x2a')];}_0x4176b8[_0x9c2d('0x1b')](_0x67926)[_0x9c2d('0x2b')](_0x549d8d);};}exports[_0x9c2d('0x2c')]=function(_0xae05fc,_0x3a84cc){var _0x1cbac6={},_0x1df0e1={},_0x62756d={'count':0x0,'rows':[]};var _0xc11306=_[_0x9c2d('0x2d')](db[_0x9c2d('0x2e')][_0x9c2d('0x2f')],function(_0x3a6798){return{'name':_0x3a6798[_0x9c2d('0x30')],'type':_0x3a6798[_0x9c2d('0x31')]['key']};});_0x1df0e1[_0x9c2d('0x32')]=_[_0x9c2d('0x2d')](_0xc11306,_0x9c2d('0x2a'));_0x1df0e1[_0x9c2d('0x33')]=_[_0x9c2d('0x34')](_0xae05fc['query']);_0x1df0e1['filters']=_[_0x9c2d('0x35')](_0x1df0e1[_0x9c2d('0x32')],_0x1df0e1[_0x9c2d('0x33')]);_0x1cbac6['attributes']=_[_0x9c2d('0x35')](_0x1df0e1[_0x9c2d('0x32')],qs[_0x9c2d('0x36')](_0xae05fc['query'][_0x9c2d('0x36')]));_0x1cbac6['attributes']=_0x1cbac6[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x1cbac6[_0x9c2d('0x37')]:_0x1df0e1[_0x9c2d('0x32')];if(!_0xae05fc[_0x9c2d('0x33')]['hasOwnProperty'](_0x9c2d('0x39'))){_0x1cbac6['limit']=qs['limit'](_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x1e')]);_0x1cbac6[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0xae05fc[_0x9c2d('0x33')]['offset']);}_0x1cbac6[_0x9c2d('0x3a')]=qs[_0x9c2d('0x3b')](_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x1cbac6[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_['pick'](_0xae05fc['query'],_0x1df0e1[_0x9c2d('0x3d')]),_0xc11306);if(_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x3e')]){_0x1cbac6[_0x9c2d('0x3c')]=_[_0x9c2d('0x3f')](_0x1cbac6[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0xc11306,function(_0xba696d){if(_0xba696d[_0x9c2d('0x31')]!=='VIRTUAL'){var _0x24bb6b={};_0x24bb6b[_0xba696d[_0x9c2d('0x2a')]]={'$like':'%'+_0xae05fc['query']['filter']+'%'};return _0x24bb6b;}})});}_0x1cbac6=_[_0x9c2d('0x3f')]({},_0x1cbac6,_0xae05fc[_0x9c2d('0x40')]);var _0x171b37={'where':_0x1cbac6[_0x9c2d('0x3c')]};return db[_0x9c2d('0x2e')][_0x9c2d('0x1f')](_0x171b37)[_0x9c2d('0x25')](function(_0xde2de0){_0x62756d['count']=_0xde2de0;if(_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x41')]){_0x1cbac6[_0x9c2d('0x42')]=[{'all':!![]}];}return db[_0x9c2d('0x2e')][_0x9c2d('0x43')](_0x1cbac6);})[_0x9c2d('0x25')](function(_0x474d1e){_0x62756d[_0x9c2d('0x44')]=_0x474d1e;return _0x62756d;})['then'](respondWithFilteredResult(_0x3a84cc,_0x1cbac6))[_0x9c2d('0x45')](handleError(_0x3a84cc,null));};exports[_0x9c2d('0x46')]=function(_0x10651c,_0x260524){var _0x53b12e={'raw':![],'where':{'id':_0x10651c[_0x9c2d('0x47')]['id']}},_0x6c9bc4={};_0x6c9bc4[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db[_0x9c2d('0x2e')][_0x9c2d('0x2f')]);_0x6c9bc4['query']=_['keys'](_0x10651c[_0x9c2d('0x33')]);_0x6c9bc4[_0x9c2d('0x3d')]=_[_0x9c2d('0x35')](_0x6c9bc4[_0x9c2d('0x32')],_0x6c9bc4[_0x9c2d('0x33')]);_0x53b12e['attributes']=_[_0x9c2d('0x35')](_0x6c9bc4['model'],qs['fields'](_0x10651c['query'][_0x9c2d('0x36')]));_0x53b12e[_0x9c2d('0x37')]=_0x53b12e[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x53b12e[_0x9c2d('0x37')]:_0x6c9bc4[_0x9c2d('0x32')];if(_0x10651c['query'][_0x9c2d('0x41')]){_0x53b12e['include']=[{'all':!![]}];}_0x53b12e=_[_0x9c2d('0x3f')]({},_0x53b12e,_0x10651c[_0x9c2d('0x40')]);return db[_0x9c2d('0x2e')][_0x9c2d('0x48')](_0x53b12e)[_0x9c2d('0x25')](handleEntityNotFound(_0x260524,null))['then'](respondWithResult(_0x260524,null))[_0x9c2d('0x45')](handleError(_0x260524,null));};exports[_0x9c2d('0x49')]=function(_0x2c88bf,_0x42755b){return db[_0x9c2d('0x2e')][_0x9c2d('0x49')](_0x2c88bf[_0x9c2d('0x4a')],{})[_0x9c2d('0x25')](respondWithResult(_0x42755b,0xc9))['catch'](handleError(_0x42755b,null));};exports['update']=function(_0x3e701e,_0xadf45b){if(_0x3e701e['body']['id']){delete _0x3e701e[_0x9c2d('0x4a')]['id'];}return db[_0x9c2d('0x2e')][_0x9c2d('0x48')]({'where':{'id':_0x3e701e['params']['id']}})[_0x9c2d('0x25')](handleEntityNotFound(_0xadf45b,null))['then'](saveUpdates(_0x3e701e[_0x9c2d('0x4a')],null))['then'](respondWithResult(_0xadf45b,null))['catch'](handleError(_0xadf45b,null));};exports[_0x9c2d('0x26')]=function(_0x17ea9f,_0x482887){return db[_0x9c2d('0x2e')][_0x9c2d('0x48')]({'where':{'id':_0x17ea9f[_0x9c2d('0x47')]['id']}})[_0x9c2d('0x25')](handleEntityNotFound(_0x482887,null))[_0x9c2d('0x25')](removeEntity(_0x482887,null))[_0x9c2d('0x45')](handleError(_0x482887,null));};exports['getFields']=function(_0xaf5924,_0x11ea8f,_0x59afbd){var _0x2bd485={};var _0x372bba={};var _0x2e988c;var _0x2893b9;return db[_0x9c2d('0x2e')][_0x9c2d('0x4b')]({'where':{'id':_0xaf5924['params']['id']}})['then'](handleEntityNotFound(_0x11ea8f,null))['then'](function(_0x54c1ea){if(_0x54c1ea){_0x2e988c=_0x54c1ea;_0x372bba[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db[_0x9c2d('0x4c')][_0x9c2d('0x2f')]);_0x372bba[_0x9c2d('0x33')]=_['keys'](_0xaf5924[_0x9c2d('0x33')]);_0x372bba[_0x9c2d('0x3d')]=_['intersection'](_0x372bba[_0x9c2d('0x32')],_0x372bba[_0x9c2d('0x33')]);_0x2bd485[_0x9c2d('0x37')]=_[_0x9c2d('0x35')](_0x372bba['model'],qs[_0x9c2d('0x36')](_0xaf5924[_0x9c2d('0x33')]['fields']));_0x2bd485[_0x9c2d('0x37')]=_0x2bd485[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x2bd485[_0x9c2d('0x37')]:_0x372bba['model'];_0x2bd485[_0x9c2d('0x3a')]=qs[_0x9c2d('0x3b')](_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x2bd485[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_[_0x9c2d('0x4d')](_0xaf5924['query'],_0x372bba[_0x9c2d('0x3d')]));if(_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x3e')]){_0x2bd485[_0x9c2d('0x3c')]=_['merge'](_0x2bd485[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0x2bd485[_0x9c2d('0x37')],function(_0xa6889e){var _0x1f5ec5={};_0x1f5ec5[_0xa6889e]={'$like':'%'+_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x3e')]+'%'};return _0x1f5ec5;})});}_0x2bd485=_[_0x9c2d('0x3f')]({},_0x2bd485,_0xaf5924[_0x9c2d('0x40')]);return _0x2e988c[_0x9c2d('0x4e')](_0x2bd485);}})[_0x9c2d('0x25')](function(_0x319882){if(_0x319882){_0x2893b9=_0x319882[_0x9c2d('0x38')];if(!_0xaf5924['query'][_0x9c2d('0x4f')](_0x9c2d('0x39'))){_0x2bd485[_0x9c2d('0x1e')]=qs['limit'](_0xaf5924['query'][_0x9c2d('0x1e')]);_0x2bd485[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x1c')]);}return _0x2e988c['getFields'](_0x2bd485);}})[_0x9c2d('0x25')](function(_0x24a856){if(_0x24a856){return _0x24a856?{'count':_0x2893b9,'rows':_0x24a856}:null;}})[_0x9c2d('0x25')](respondWithResult(_0x11ea8f,null))[_0x9c2d('0x45')](handleError(_0x11ea8f,null));};exports[_0x9c2d('0x50')]=function(_0x532d4f,_0x42d67a,_0x4a51a4){var _0x5b9fa5={};var _0x2bcca2={};var _0x5f17ac;var _0x247952;return db[_0x9c2d('0x2e')][_0x9c2d('0x4b')]({'where':{'id':_0x532d4f['params']['id']}})['then'](handleEntityNotFound(_0x42d67a,null))[_0x9c2d('0x25')](function(_0x371e0b){if(_0x371e0b){_0x5f17ac=_0x371e0b;_0x2bcca2[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db[_0x9c2d('0x4c')][_0x9c2d('0x2f')]);_0x2bcca2[_0x9c2d('0x33')]=_[_0x9c2d('0x34')](_0x532d4f['query']);_0x2bcca2[_0x9c2d('0x3d')]=_[_0x9c2d('0x35')](_0x2bcca2[_0x9c2d('0x32')],_0x2bcca2[_0x9c2d('0x33')]);_0x5b9fa5[_0x9c2d('0x37')]=_['intersection'](_0x2bcca2[_0x9c2d('0x32')],qs[_0x9c2d('0x36')](_0x532d4f[_0x9c2d('0x33')][_0x9c2d('0x36')]));_0x5b9fa5['attributes']=_0x5b9fa5['attributes']['length']?_0x5b9fa5[_0x9c2d('0x37')]:_0x2bcca2[_0x9c2d('0x32')];_0x5b9fa5[_0x9c2d('0x3a')]=qs['sort'](_0x532d4f[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x5b9fa5[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_[_0x9c2d('0x4d')](_0x532d4f['query'],_0x2bcca2[_0x9c2d('0x3d')]));if(_0x532d4f['query']['filter']){_0x5b9fa5[_0x9c2d('0x3c')]=_[_0x9c2d('0x3f')](_0x5b9fa5[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0x5b9fa5[_0x9c2d('0x37')],function(_0x1e3060){var _0x561551={};_0x561551[_0x1e3060]={'$like':'%'+_0x532d4f[_0x9c2d('0x33')][_0x9c2d('0x3e')]+'%'};return _0x561551;})});}_0x5b9fa5=_[_0x9c2d('0x3f')]({},_0x5b9fa5,_0x532d4f['options']);return _0x5f17ac[_0x9c2d('0x50')](_0x5b9fa5);}})[_0x9c2d('0x25')](function(_0x5ce865){if(_0x5ce865){_0x247952=_0x5ce865['length'];if(!_0x532d4f['query'][_0x9c2d('0x4f')](_0x9c2d('0x39'))){_0x5b9fa5[_0x9c2d('0x1e')]=qs[_0x9c2d('0x1e')](_0x532d4f['query']['limit']);_0x5b9fa5[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0x532d4f['query']['offset']);}return _0x5f17ac[_0x9c2d('0x50')](_0x5b9fa5);}})[_0x9c2d('0x25')](function(_0x1b9b6f){if(_0x1b9b6f){return _0x1b9b6f?{'count':_0x247952,'rows':_0x1b9b6f}:null;}})[_0x9c2d('0x25')](respondWithResult(_0x42d67a,null))[_0x9c2d('0x45')](handleError(_0x42d67a,null));};exports['getDescriptions']=function(_0x3dc61d,_0x5ce321,_0x29f76a){var _0x408cea={};var _0xe2a7cf={};var _0x25932d;var _0x5b8c3c;return db[_0x9c2d('0x2e')]['findOne']({'where':{'id':_0x3dc61d[_0x9c2d('0x47')]['id']}})[_0x9c2d('0x25')](handleEntityNotFound(_0x5ce321,null))[_0x9c2d('0x25')](function(_0x3d5942){if(_0x3d5942){_0x25932d=_0x3d5942;_0xe2a7cf[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db['ServicenowField'][_0x9c2d('0x2f')]);_0xe2a7cf[_0x9c2d('0x33')]=_['keys'](_0x3dc61d[_0x9c2d('0x33')]);_0xe2a7cf[_0x9c2d('0x3d')]=_[_0x9c2d('0x35')](_0xe2a7cf[_0x9c2d('0x32')],_0xe2a7cf[_0x9c2d('0x33')]);_0x408cea[_0x9c2d('0x37')]=_[_0x9c2d('0x35')](_0xe2a7cf[_0x9c2d('0x32')],qs[_0x9c2d('0x36')](_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x36')]));_0x408cea[_0x9c2d('0x37')]=_0x408cea[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x408cea[_0x9c2d('0x37')]:_0xe2a7cf[_0x9c2d('0x32')];_0x408cea['order']=qs['sort'](_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x408cea[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_[_0x9c2d('0x4d')](_0x3dc61d[_0x9c2d('0x33')],_0xe2a7cf[_0x9c2d('0x3d')]));if(_0x3dc61d[_0x9c2d('0x33')]['filter']){_0x408cea[_0x9c2d('0x3c')]=_[_0x9c2d('0x3f')](_0x408cea[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0x408cea[_0x9c2d('0x37')],function(_0x54db4e){var _0x4d409e={};_0x4d409e[_0x54db4e]={'$like':'%'+_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x3e')]+'%'};return _0x4d409e;})});}_0x408cea=_[_0x9c2d('0x3f')]({},_0x408cea,_0x3dc61d[_0x9c2d('0x40')]);return _0x25932d[_0x9c2d('0x51')](_0x408cea);}})['then'](function(_0x3372b4){if(_0x3372b4){_0x5b8c3c=_0x3372b4[_0x9c2d('0x38')];if(!_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x4f')](_0x9c2d('0x39'))){_0x408cea[_0x9c2d('0x1e')]=qs['limit'](_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x1e')]);_0x408cea[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0x3dc61d['query']['offset']);}return _0x25932d['getDescriptions'](_0x408cea);}})[_0x9c2d('0x25')](function(_0x1bc86c){if(_0x1bc86c){return _0x1bc86c?{'count':_0x5b8c3c,'rows':_0x1bc86c}:null;}})[_0x9c2d('0x25')](respondWithResult(_0x5ce321,null))[_0x9c2d('0x45')](handleError(_0x5ce321,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 2e0bebf..77f876a 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 _0x8ff9=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x4e0c76,_0x304a8f){_0x4e0c76=_0x4e0c76-0x0;var _0x5d4374=_0x8ff9[_0x4e0c76];return _0x5d4374;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var logger=require(_0x98ff('0x2'))(_0x98ff('0x3'));var moment=require(_0x98ff('0x4'));var BPromise=require(_0x98ff('0x5'));var rp=require(_0x98ff('0x6'));var fs=require('fs');var path=require(_0x98ff('0x7'));var rimraf=require(_0x98ff('0x8'));var config=require(_0x98ff('0x9'));var attributes=require(_0x98ff('0xa'));module['exports']=function(_0x3c07f5,_0xcdd5f){return _0x3c07f5[_0x98ff('0xb')](_0x98ff('0xc'),attributes,{'tableName':_0x98ff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd027=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xd027,0x197));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7d02('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7d02('0x1'));var BPromise=require(_0x7d02('0x2'));var rp=require(_0x7d02('0x3'));var fs=require('fs');var path=require(_0x7d02('0x4'));var rimraf=require(_0x7d02('0x5'));var config=require(_0x7d02('0x6'));var attributes=require(_0x7d02('0x7'));module[_0x7d02('0x8')]=function(_0x50824f,_0x1e75e2){return _0x50824f[_0x7d02('0x9')](_0x7d02('0xa'),attributes,{'tableName':_0x7d02('0xb'),'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 a39f8a4..2be5133 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 _0x2bbc=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1b2477,_0x368cc0){var _0x38b837=function(_0x353499){while(--_0x353499){_0x1b2477['push'](_0x1b2477['shift']());}};_0x38b837(++_0x368cc0);}(_0x2bbc,0x1ea));var _0xc2bb=function(_0x34e203,_0x1d0cbe){_0x34e203=_0x34e203-0x0;var _0x53c2db=_0x2bbc[_0x34e203];return _0x53c2db;};'use strict';var _=require(_0xc2bb('0x0'));var util=require(_0xc2bb('0x1'));var moment=require(_0xc2bb('0x2'));var BPromise=require(_0xc2bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2bb('0x4'));var db=require(_0xc2bb('0x5'))['db'];var utils=require(_0xc2bb('0x6'));var logger=require(_0xc2bb('0x7'))(_0xc2bb('0x8'));var config=require(_0xc2bb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc2bb('0xa')][_0xc2bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ed363,_0x5b9ad1,_0x481e3f){return new BPromise(function(_0x536ddf,_0x4d9da4){return client[_0xc2bb('0xc')](_0x2ed363,_0x481e3f)[_0xc2bb('0xd')](function(_0x3e1166){logger['info'](_0xc2bb('0xe'),_0x5b9ad1,_0xc2bb('0xf'));logger[_0xc2bb('0x10')](_0xc2bb('0x11'),_0x5b9ad1,'request\x20sent',JSON['stringify'](_0x3e1166));if(_0x3e1166[_0xc2bb('0x12')]){if(_0x3e1166[_0xc2bb('0x12')][_0xc2bb('0x13')]===0x1f4){logger['error'](_0xc2bb('0xe'),_0x5b9ad1,_0x3e1166[_0xc2bb('0x12')][_0xc2bb('0x14')]);return _0x4d9da4(_0x3e1166[_0xc2bb('0x12')][_0xc2bb('0x14')]);}logger['error'](_0xc2bb('0xe'),_0x5b9ad1,_0x3e1166[_0xc2bb('0x12')]['message']);return _0x536ddf(_0x3e1166['error'][_0xc2bb('0x14')]);}else{logger[_0xc2bb('0x15')](_0xc2bb('0xe'),_0x5b9ad1,'request\x20sent');_0x536ddf(_0x3e1166[_0xc2bb('0x16')]['message']);}})['catch'](function(_0x49ff3a){logger['error'](_0xc2bb('0xe'),_0x5b9ad1,_0x49ff3a);_0x4d9da4(_0x49ff3a);});});} \ No newline at end of file +var _0x9e33=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x9795a7,_0x4817a8){var _0x467e1d=function(_0x4c2f13){while(--_0x4c2f13){_0x9795a7['push'](_0x9795a7['shift']());}};_0x467e1d(++_0x4817a8);}(_0x9e33,0x144));var _0x39e3=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9e33[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x39e3('0x0'));var util=require(_0x39e3('0x1'));var moment=require(_0x39e3('0x2'));var BPromise=require(_0x39e3('0x3'));var rs=require(_0x39e3('0x4'));var fs=require('fs');var Redis=require(_0x39e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x39e3('0x6'))(_0x39e3('0x7'));var config=require(_0x39e3('0x8'));var jayson=require(_0x39e3('0x9'));var client=jayson[_0x39e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d2cb4,_0x3da195,_0x4a7806){return new BPromise(function(_0x38ce81,_0x50a66a){return client['request'](_0x4d2cb4,_0x4a7806)[_0x39e3('0xb')](function(_0x1add3b){logger['info'](_0x39e3('0xc'),_0x3da195,_0x39e3('0xd'));logger['debug'](_0x39e3('0xe'),_0x3da195,'request\x20sent',JSON['stringify'](_0x1add3b));if(_0x1add3b['error']){if(_0x1add3b[_0x39e3('0xf')]['code']===0x1f4){logger[_0x39e3('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3da195,_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);return _0x50a66a(_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);}logger[_0x39e3('0xf')](_0x39e3('0xc'),_0x3da195,_0x1add3b[_0x39e3('0xf')]['message']);return _0x38ce81(_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);}else{logger[_0x39e3('0x11')](_0x39e3('0xc'),_0x3da195,_0x39e3('0xd'));_0x38ce81(_0x1add3b[_0x39e3('0x12')][_0x39e3('0x10')]);}})[_0x39e3('0x13')](function(_0x7c86b4){logger[_0x39e3('0xf')](_0x39e3('0xc'),_0x3da195,_0x7c86b4);_0x50a66a(_0x7c86b4);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 6f49c94..e6adc85 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 _0x9b99=['../../components/auth/service','./intServicenowField.controller','isAuthenticated','index','show','post','/:id','update','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x9b99,0x81));var _0x99b9=function(_0x385e3e,_0x10270f){_0x385e3e=_0x385e3e-0x0;var _0x5c88ee=_0x9b99[_0x385e3e];return _0x5c88ee;};'use strict';var multer=require(_0x99b9('0x0'));var util=require(_0x99b9('0x1'));var path=require(_0x99b9('0x2'));var timeout=require(_0x99b9('0x3'));var express=require(_0x99b9('0x4'));var router=express['Router']();var fs_extra=require(_0x99b9('0x5'));var auth=require(_0x99b9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x99b9('0x7'));router['get']('/',auth[_0x99b9('0x8')](),controller[_0x99b9('0x9')]);router['get']('/:id',auth[_0x99b9('0x8')](),controller[_0x99b9('0xa')]);router[_0x99b9('0xb')]('/',auth[_0x99b9('0x8')](),controller['create']);router['put'](_0x99b9('0xc'),auth[_0x99b9('0x8')](),controller[_0x99b9('0xd')]);router['delete'](_0x99b9('0xc'),auth[_0x99b9('0x8')](),controller[_0x99b9('0xe')]);module['exports']=router; \ No newline at end of file +var _0xab20=['post','create','put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab20,0x1db));var _0x0ab2=function(_0x571012,_0x334737){_0x571012=_0x571012-0x0;var _0x4d2ccd=_0xab20[_0x571012];return _0x4d2ccd;};'use strict';var multer=require(_0x0ab2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ab2('0x1'));var router=express[_0x0ab2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0ab2('0x3'));var interaction=require(_0x0ab2('0x4'));var config=require(_0x0ab2('0x5'));var controller=require(_0x0ab2('0x6'));router[_0x0ab2('0x7')]('/',auth[_0x0ab2('0x8')](),controller['index']);router[_0x0ab2('0x7')](_0x0ab2('0x9'),auth['isAuthenticated'](),controller[_0x0ab2('0xa')]);router[_0x0ab2('0xb')]('/',auth[_0x0ab2('0x8')](),controller[_0x0ab2('0xc')]);router[_0x0ab2('0xd')](_0x0ab2('0x9'),auth[_0x0ab2('0x8')](),controller[_0x0ab2('0xe')]);router[_0x0ab2('0xf')](_0x0ab2('0x9'),auth[_0x0ab2('0x8')](),controller[_0x0ab2('0x10')]);module[_0x0ab2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ae84e89..7e5a2d4 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 _0x00b2=['variable','BOOLEAN','sequelize','ENUM','string','customVariable','picklist','STRING'];(function(_0xdbff26,_0xfc8995){var _0x4adb23=function(_0x291780){while(--_0x291780){_0xdbff26['push'](_0xdbff26['shift']());}};_0x4adb23(++_0xfc8995);}(_0x00b2,0xea));var _0x200b=function(_0x5cd923,_0x1cd3bb){_0x5cd923=_0x5cd923-0x0;var _0x543e06=_0x00b2[_0x5cd923];return _0x543e06;};'use strict';var Sequelize=require(_0x200b('0x0'));module['exports']={'type':{'type':Sequelize[_0x200b('0x1')](_0x200b('0x2'),'variable',_0x200b('0x3'),'keyValue',_0x200b('0x4')),'defaultValue':_0x200b('0x2')},'content':{'type':Sequelize[_0x200b('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x200b('0x1')](_0x200b('0x2'),_0x200b('0x6'),_0x200b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x200b('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x200b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x200b('0x5')]}}; \ No newline at end of file +var _0xb944=['BOOLEAN','ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x2d2fc5,_0x37bbf5){var _0x33bb1e=function(_0x120c50){while(--_0x120c50){_0x2d2fc5['push'](_0x2d2fc5['shift']());}};_0x33bb1e(++_0x37bbf5);}(_0xb944,0x1b3));var _0x4b94=function(_0x58c2ac,_0x58c01b){_0x58c2ac=_0x58c2ac-0x0;var _0x10cb51=_0xb944[_0x58c2ac];return _0x10cb51;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4b94('0x0')](_0x4b94('0x1'),_0x4b94('0x2'),'customVariable','keyValue',_0x4b94('0x3')),'defaultValue':_0x4b94('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4b94('0x4')]},'keyType':{'type':Sequelize[_0x4b94('0x0')](_0x4b94('0x1'),_0x4b94('0x2'),_0x4b94('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4b94('0x4')]},'nameField':{'type':Sequelize[_0x4b94('0x4')]},'customField':{'type':Sequelize[_0x4b94('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a067014..818059d 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 _0x7450=['length','include','options','create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ServicenowField','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','rawAttributes'];(function(_0x388afd,_0x2f793d){var _0x4966e2=function(_0x2d9c24){while(--_0x2d9c24){_0x388afd['push'](_0x388afd['shift']());}};_0x4966e2(++_0x2f793d);}(_0x7450,0xa1));var _0x0745=function(_0x7e045a,_0x417023){_0x7e045a=_0x7e045a-0x0;var _0x4cad23=_0x7450[_0x7e045a];return _0x4cad23;};'use strict';var emlformat=require(_0x0745('0x0'));var rimraf=require(_0x0745('0x1'));var zipdir=require(_0x0745('0x2'));var jsonpatch=require(_0x0745('0x3'));var rp=require('request-promise');var moment=require(_0x0745('0x4'));var BPromise=require(_0x0745('0x5'));var Mustache=require(_0x0745('0x6'));var util=require(_0x0745('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0745('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0745('0x9'));var _=require(_0x0745('0xa'));var squel=require('squel');var crypto=require(_0x0745('0xb'));var jsforce=require(_0x0745('0xc'));var deskjs=require(_0x0745('0xd'));var toCsv=require(_0x0745('0x8'));var querystring=require(_0x0745('0xe'));var Papa=require('papaparse');var Redis=require(_0x0745('0xf'));var authService=require(_0x0745('0x10'));var qs=require(_0x0745('0x11'));var as=require(_0x0745('0x12'));var hardwareService=require(_0x0745('0x13'));var logger=require(_0x0745('0x14'))(_0x0745('0x15'));var utils=require('../../config/utils');var config=require(_0x0745('0x16'));var licenseUtil=require(_0x0745('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3df020,_0x3760f2){_0x3760f2=_0x3760f2||0xcc;return function(_0x5c1971){if(_0x5c1971){return _0x3df020[_0x0745('0x18')](_0x3760f2);}return _0x3df020[_0x0745('0x19')](_0x3760f2)[_0x0745('0x1a')]();};}function respondWithResult(_0xbef6e3,_0x2d77f3){_0x2d77f3=_0x2d77f3||0xc8;return function(_0x5a95b4){if(_0x5a95b4){return _0xbef6e3[_0x0745('0x19')](_0x2d77f3)[_0x0745('0x1b')](_0x5a95b4);}};}function respondWithFilteredResult(_0x286bd9,_0x25a49e){return function(_0x1360eb){if(_0x1360eb){var _0x39716b=typeof _0x25a49e[_0x0745('0x1c')]===_0x0745('0x1d')&&typeof _0x25a49e['limit']===_0x0745('0x1d');var _0x1cb809=_0x1360eb[_0x0745('0x1e')];var _0x14f00a=_0x39716b?0x0:_0x25a49e[_0x0745('0x1c')];var _0x109fd1=_0x39716b?_0x1360eb[_0x0745('0x1e')]:_0x25a49e[_0x0745('0x1c')]+_0x25a49e[_0x0745('0x1f')];var _0x25aaf8;if(_0x109fd1>=_0x1cb809){_0x109fd1=_0x1cb809;_0x25aaf8=0xc8;}else{_0x25aaf8=0xce;}_0x286bd9[_0x0745('0x19')](_0x25aaf8);return _0x286bd9[_0x0745('0x20')](_0x0745('0x21'),_0x14f00a+'-'+_0x109fd1+'/'+_0x1cb809)[_0x0745('0x1b')](_0x1360eb);}return null;};}function patchUpdates(_0x15ef79){return function(_0x41dca0){try{jsonpatch[_0x0745('0x22')](_0x41dca0,_0x15ef79,!![]);}catch(_0x48dbfb){return BPromise[_0x0745('0x23')](_0x48dbfb);}return _0x41dca0[_0x0745('0x24')]();};}function saveUpdates(_0xcf9b4a,_0x161957){return function(_0x14fbef){if(_0x14fbef){return _0x14fbef[_0x0745('0x25')](_0xcf9b4a)['then'](function(_0x2f346b){return _0x2f346b;});}return null;};}function removeEntity(_0x4e5759,_0x3f694b){return function(_0x30150c){if(_0x30150c){return _0x30150c['destroy']()[_0x0745('0x26')](function(){_0x4e5759[_0x0745('0x19')](0xcc)[_0x0745('0x1a')]();});}};}function handleEntityNotFound(_0x10be87,_0x4f80df){return function(_0x25dc62){if(!_0x25dc62){_0x10be87[_0x0745('0x18')](0x194);}return _0x25dc62;};}function handleError(_0x4d1e82,_0x12723a){_0x12723a=_0x12723a||0x1f4;return function(_0x20c83a){logger[_0x0745('0x27')](_0x20c83a[_0x0745('0x28')]);if(_0x20c83a[_0x0745('0x29')]){delete _0x20c83a['name'];}_0x4d1e82['status'](_0x12723a)[_0x0745('0x2a')](_0x20c83a);};}exports['index']=function(_0x4ab3a8,_0x5e5bda){var _0x47162a={},_0x3d1c56={},_0x41ce0f={'count':0x0,'rows':[]};var _0x3d49cf=_[_0x0745('0x2b')](db[_0x0745('0x2c')]['rawAttributes'],function(_0x59aa25){return{'name':_0x59aa25[_0x0745('0x2d')],'type':_0x59aa25[_0x0745('0x2e')][_0x0745('0x2f')]};});_0x3d1c56[_0x0745('0x30')]=_[_0x0745('0x2b')](_0x3d49cf,_0x0745('0x29'));_0x3d1c56[_0x0745('0x31')]=_[_0x0745('0x32')](_0x4ab3a8[_0x0745('0x31')]);_0x3d1c56[_0x0745('0x33')]=_['intersection'](_0x3d1c56['model'],_0x3d1c56['query']);_0x47162a[_0x0745('0x34')]=_[_0x0745('0x35')](_0x3d1c56['model'],qs[_0x0745('0x36')](_0x4ab3a8['query'][_0x0745('0x36')]));_0x47162a['attributes']=_0x47162a[_0x0745('0x34')]['length']?_0x47162a[_0x0745('0x34')]:_0x3d1c56[_0x0745('0x30')];if(!_0x4ab3a8[_0x0745('0x31')][_0x0745('0x37')](_0x0745('0x38'))){_0x47162a[_0x0745('0x1f')]=qs['limit'](_0x4ab3a8['query']['limit']);_0x47162a['offset']=qs[_0x0745('0x1c')](_0x4ab3a8[_0x0745('0x31')]['offset']);}_0x47162a[_0x0745('0x39')]=qs[_0x0745('0x3a')](_0x4ab3a8[_0x0745('0x31')]['sort']);_0x47162a['where']=qs['filters'](_[_0x0745('0x3b')](_0x4ab3a8[_0x0745('0x31')],_0x3d1c56[_0x0745('0x33')]),_0x3d49cf);if(_0x4ab3a8['query'][_0x0745('0x3c')]){_0x47162a[_0x0745('0x3d')]=_[_0x0745('0x3e')](_0x47162a[_0x0745('0x3d')],{'$or':_[_0x0745('0x2b')](_0x3d49cf,function(_0x5b45c5){if(_0x5b45c5[_0x0745('0x2e')]!==_0x0745('0x3f')){var _0xdf2e6b={};_0xdf2e6b[_0x5b45c5[_0x0745('0x29')]]={'$like':'%'+_0x4ab3a8[_0x0745('0x31')][_0x0745('0x3c')]+'%'};return _0xdf2e6b;}})});}_0x47162a=_[_0x0745('0x3e')]({},_0x47162a,_0x4ab3a8['options']);var _0x285043={'where':_0x47162a[_0x0745('0x3d')]};return db[_0x0745('0x2c')][_0x0745('0x1e')](_0x285043)[_0x0745('0x26')](function(_0x4999c7){_0x41ce0f['count']=_0x4999c7;if(_0x4ab3a8[_0x0745('0x31')][_0x0745('0x40')]){_0x47162a['include']=[{'all':!![]}];}return db[_0x0745('0x2c')][_0x0745('0x41')](_0x47162a);})[_0x0745('0x26')](function(_0x24454b){_0x41ce0f['rows']=_0x24454b;return _0x41ce0f;})['then'](respondWithFilteredResult(_0x5e5bda,_0x47162a))[_0x0745('0x42')](handleError(_0x5e5bda,null));};exports[_0x0745('0x43')]=function(_0x451842,_0x2f1f83){var _0x43df30={'raw':!![],'where':{'id':_0x451842[_0x0745('0x44')]['id']}},_0x93fac9={};_0x93fac9[_0x0745('0x30')]=_['keys'](db['ServicenowField'][_0x0745('0x45')]);_0x93fac9[_0x0745('0x31')]=_[_0x0745('0x32')](_0x451842['query']);_0x93fac9['filters']=_[_0x0745('0x35')](_0x93fac9[_0x0745('0x30')],_0x93fac9[_0x0745('0x31')]);_0x43df30[_0x0745('0x34')]=_[_0x0745('0x35')](_0x93fac9['model'],qs[_0x0745('0x36')](_0x451842[_0x0745('0x31')][_0x0745('0x36')]));_0x43df30[_0x0745('0x34')]=_0x43df30['attributes'][_0x0745('0x46')]?_0x43df30['attributes']:_0x93fac9[_0x0745('0x30')];if(_0x451842[_0x0745('0x31')][_0x0745('0x40')]){_0x43df30[_0x0745('0x47')]=[{'all':!![]}];}_0x43df30=_[_0x0745('0x3e')]({},_0x43df30,_0x451842[_0x0745('0x48')]);return db[_0x0745('0x2c')]['find'](_0x43df30)[_0x0745('0x26')](handleEntityNotFound(_0x2f1f83,null))[_0x0745('0x26')](respondWithResult(_0x2f1f83,null))['catch'](handleError(_0x2f1f83,null));};exports['create']=function(_0xc3f1f6,_0x28fb54){return db[_0x0745('0x2c')][_0x0745('0x49')](_0xc3f1f6[_0x0745('0x4a')],{})[_0x0745('0x26')](respondWithResult(_0x28fb54,0xc9))['catch'](handleError(_0x28fb54,null));};exports[_0x0745('0x25')]=function(_0x32a882,_0x5d25b4){if(_0x32a882[_0x0745('0x4a')]['id']){delete _0x32a882['body']['id'];}return db[_0x0745('0x2c')]['find']({'where':{'id':_0x32a882[_0x0745('0x44')]['id']}})[_0x0745('0x26')](handleEntityNotFound(_0x5d25b4,null))['then'](saveUpdates(_0x32a882[_0x0745('0x4a')],null))['then'](respondWithResult(_0x5d25b4,null))[_0x0745('0x42')](handleError(_0x5d25b4,null));};exports[_0x0745('0x4b')]=function(_0x223bc3,_0x1e0dd0){return db[_0x0745('0x2c')][_0x0745('0x4c')]({'where':{'id':_0x223bc3['params']['id']}})[_0x0745('0x26')](handleEntityNotFound(_0x1e0dd0,null))['then'](removeEntity(_0x1e0dd0,null))[_0x0745('0x42')](handleError(_0x1e0dd0,null));}; \ No newline at end of file +var _0x199d=['reject','save','then','error','stack','name','send','index','map','ServicenowField','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','rawAttributes','find','create','update','body','destroy','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x199d,0x74));var _0xd199=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x199d[_0x2b91c5];return _0xbd5531;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd199('0x0'));var zipdir=require(_0xd199('0x1'));var jsonpatch=require(_0xd199('0x2'));var rp=require(_0xd199('0x3'));var moment=require(_0xd199('0x4'));var BPromise=require(_0xd199('0x5'));var Mustache=require(_0xd199('0x6'));var util=require(_0xd199('0x7'));var path=require(_0xd199('0x8'));var sox=require(_0xd199('0x9'));var csv=require(_0xd199('0xa'));var ejs=require(_0xd199('0xb'));var fs=require('fs');var fs_extra=require(_0xd199('0xc'));var _=require(_0xd199('0xd'));var squel=require(_0xd199('0xe'));var crypto=require(_0xd199('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd199('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd199('0x11'));var Papa=require(_0xd199('0x12'));var Redis=require(_0xd199('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd199('0x14'));var as=require(_0xd199('0x15'));var hardwareService=require(_0xd199('0x16'));var logger=require('../../config/logger')(_0xd199('0x17'));var utils=require('../../config/utils');var config=require(_0xd199('0x18'));var licenseUtil=require(_0xd199('0x19'));var db=require(_0xd199('0x1a'))['db'];function respondWithStatusCode(_0x408acb,_0x5cd66e){_0x5cd66e=_0x5cd66e||0xcc;return function(_0x79330d){if(_0x79330d){return _0x408acb[_0xd199('0x1b')](_0x5cd66e);}return _0x408acb[_0xd199('0x1c')](_0x5cd66e)[_0xd199('0x1d')]();};}function respondWithResult(_0x4fa488,_0x2c0234){_0x2c0234=_0x2c0234||0xc8;return function(_0x1c454c){if(_0x1c454c){return _0x4fa488[_0xd199('0x1c')](_0x2c0234)[_0xd199('0x1e')](_0x1c454c);}};}function respondWithFilteredResult(_0x5f1d4f,_0xe77815){return function(_0x1e6195){if(_0x1e6195){var _0xae269b=typeof _0xe77815[_0xd199('0x1f')]===_0xd199('0x20')&&typeof _0xe77815[_0xd199('0x21')]==='undefined';var _0x1ad69d=_0x1e6195[_0xd199('0x22')];var _0x1cf7d9=_0xae269b?0x0:_0xe77815[_0xd199('0x1f')];var _0x354139=_0xae269b?_0x1e6195[_0xd199('0x22')]:_0xe77815[_0xd199('0x1f')]+_0xe77815[_0xd199('0x21')];var _0x49df79;if(_0x354139>=_0x1ad69d){_0x354139=_0x1ad69d;_0x49df79=0xc8;}else{_0x49df79=0xce;}_0x5f1d4f['status'](_0x49df79);return _0x5f1d4f[_0xd199('0x23')](_0xd199('0x24'),_0x1cf7d9+'-'+_0x354139+'/'+_0x1ad69d)['json'](_0x1e6195);}return null;};}function patchUpdates(_0x1fc720){return function(_0x2e2fd3){try{jsonpatch[_0xd199('0x25')](_0x2e2fd3,_0x1fc720,!![]);}catch(_0x10871d){return BPromise[_0xd199('0x26')](_0x10871d);}return _0x2e2fd3[_0xd199('0x27')]();};}function saveUpdates(_0x2fbc92,_0x2e2c52){return function(_0x32c342){if(_0x32c342){return _0x32c342['update'](_0x2fbc92)[_0xd199('0x28')](function(_0x5f1867){return _0x5f1867;});}return null;};}function removeEntity(_0x3a8c3f,_0x58ab81){return function(_0x448ed9){if(_0x448ed9){return _0x448ed9['destroy']()['then'](function(){_0x3a8c3f[_0xd199('0x1c')](0xcc)[_0xd199('0x1d')]();});}};}function handleEntityNotFound(_0x211779,_0x1f681d){return function(_0x3f13aa){if(!_0x3f13aa){_0x211779[_0xd199('0x1b')](0x194);}return _0x3f13aa;};}function handleError(_0x1497e8,_0xf00b14){_0xf00b14=_0xf00b14||0x1f4;return function(_0x35d2f3){logger[_0xd199('0x29')](_0x35d2f3[_0xd199('0x2a')]);if(_0x35d2f3[_0xd199('0x2b')]){delete _0x35d2f3[_0xd199('0x2b')];}_0x1497e8[_0xd199('0x1c')](_0xf00b14)[_0xd199('0x2c')](_0x35d2f3);};}exports[_0xd199('0x2d')]=function(_0x52b6f2,_0x251fda){var _0x54d073={},_0xe330fd={},_0x34b688={'count':0x0,'rows':[]};var _0x56d0ec=_[_0xd199('0x2e')](db[_0xd199('0x2f')]['rawAttributes'],function(_0x526feb){return{'name':_0x526feb['fieldName'],'type':_0x526feb['type'][_0xd199('0x30')]};});_0xe330fd[_0xd199('0x31')]=_[_0xd199('0x2e')](_0x56d0ec,_0xd199('0x2b'));_0xe330fd[_0xd199('0x32')]=_[_0xd199('0x33')](_0x52b6f2[_0xd199('0x32')]);_0xe330fd['filters']=_['intersection'](_0xe330fd[_0xd199('0x31')],_0xe330fd[_0xd199('0x32')]);_0x54d073['attributes']=_[_0xd199('0x34')](_0xe330fd[_0xd199('0x31')],qs['fields'](_0x52b6f2[_0xd199('0x32')][_0xd199('0x35')]));_0x54d073['attributes']=_0x54d073[_0xd199('0x36')][_0xd199('0x37')]?_0x54d073[_0xd199('0x36')]:_0xe330fd[_0xd199('0x31')];if(!_0x52b6f2['query'][_0xd199('0x38')](_0xd199('0x39'))){_0x54d073[_0xd199('0x21')]=qs[_0xd199('0x21')](_0x52b6f2['query']['limit']);_0x54d073[_0xd199('0x1f')]=qs[_0xd199('0x1f')](_0x52b6f2[_0xd199('0x32')][_0xd199('0x1f')]);}_0x54d073['order']=qs[_0xd199('0x3a')](_0x52b6f2[_0xd199('0x32')][_0xd199('0x3a')]);_0x54d073['where']=qs[_0xd199('0x3b')](_[_0xd199('0x3c')](_0x52b6f2[_0xd199('0x32')],_0xe330fd[_0xd199('0x3b')]),_0x56d0ec);if(_0x52b6f2[_0xd199('0x32')]['filter']){_0x54d073[_0xd199('0x3d')]=_[_0xd199('0x3e')](_0x54d073[_0xd199('0x3d')],{'$or':_[_0xd199('0x2e')](_0x56d0ec,function(_0x5e73b3){if(_0x5e73b3['type']!==_0xd199('0x3f')){var _0x7e8eba={};_0x7e8eba[_0x5e73b3[_0xd199('0x2b')]]={'$like':'%'+_0x52b6f2[_0xd199('0x32')][_0xd199('0x40')]+'%'};return _0x7e8eba;}})});}_0x54d073=_[_0xd199('0x3e')]({},_0x54d073,_0x52b6f2[_0xd199('0x41')]);var _0x2b698a={'where':_0x54d073[_0xd199('0x3d')]};return db[_0xd199('0x2f')][_0xd199('0x22')](_0x2b698a)[_0xd199('0x28')](function(_0x50eebb){_0x34b688[_0xd199('0x22')]=_0x50eebb;if(_0x52b6f2[_0xd199('0x32')]['includeAll']){_0x54d073[_0xd199('0x42')]=[{'all':!![]}];}return db[_0xd199('0x2f')][_0xd199('0x43')](_0x54d073);})[_0xd199('0x28')](function(_0x18f373){_0x34b688['rows']=_0x18f373;return _0x34b688;})['then'](respondWithFilteredResult(_0x251fda,_0x54d073))[_0xd199('0x44')](handleError(_0x251fda,null));};exports[_0xd199('0x45')]=function(_0xd8166f,_0x5ea9eb){var _0xf530b3={'raw':!![],'where':{'id':_0xd8166f[_0xd199('0x46')]['id']}},_0x163cd9={};_0x163cd9['model']=_[_0xd199('0x33')](db['ServicenowField'][_0xd199('0x47')]);_0x163cd9[_0xd199('0x32')]=_['keys'](_0xd8166f['query']);_0x163cd9[_0xd199('0x3b')]=_[_0xd199('0x34')](_0x163cd9[_0xd199('0x31')],_0x163cd9[_0xd199('0x32')]);_0xf530b3[_0xd199('0x36')]=_['intersection'](_0x163cd9[_0xd199('0x31')],qs[_0xd199('0x35')](_0xd8166f[_0xd199('0x32')][_0xd199('0x35')]));_0xf530b3['attributes']=_0xf530b3['attributes'][_0xd199('0x37')]?_0xf530b3['attributes']:_0x163cd9[_0xd199('0x31')];if(_0xd8166f[_0xd199('0x32')]['includeAll']){_0xf530b3[_0xd199('0x42')]=[{'all':!![]}];}_0xf530b3=_[_0xd199('0x3e')]({},_0xf530b3,_0xd8166f[_0xd199('0x41')]);return db[_0xd199('0x2f')][_0xd199('0x48')](_0xf530b3)['then'](handleEntityNotFound(_0x5ea9eb,null))[_0xd199('0x28')](respondWithResult(_0x5ea9eb,null))[_0xd199('0x44')](handleError(_0x5ea9eb,null));};exports['create']=function(_0x39259d,_0x4f6d66){return db[_0xd199('0x2f')][_0xd199('0x49')](_0x39259d['body'],{})[_0xd199('0x28')](respondWithResult(_0x4f6d66,0xc9))[_0xd199('0x44')](handleError(_0x4f6d66,null));};exports[_0xd199('0x4a')]=function(_0xa6b17,_0x3c808b){if(_0xa6b17[_0xd199('0x4b')]['id']){delete _0xa6b17[_0xd199('0x4b')]['id'];}return db[_0xd199('0x2f')][_0xd199('0x48')]({'where':{'id':_0xa6b17['params']['id']}})[_0xd199('0x28')](handleEntityNotFound(_0x3c808b,null))[_0xd199('0x28')](saveUpdates(_0xa6b17[_0xd199('0x4b')],null))[_0xd199('0x28')](respondWithResult(_0x3c808b,null))[_0xd199('0x44')](handleError(_0x3c808b,null));};exports[_0xd199('0x4c')]=function(_0x47db24,_0x5728e9){return db[_0xd199('0x2f')]['find']({'where':{'id':_0x47db24[_0xd199('0x46')]['id']}})[_0xd199('0x28')](handleEntityNotFound(_0x5728e9,null))[_0xd199('0x28')](removeEntity(_0x5728e9,null))['catch'](handleError(_0x5728e9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 1d49d9f..9ffedd1 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 _0x058b=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','idField'];(function(_0x3b5a4b,_0x2a2ee1){var _0x32258a=function(_0x13e494){while(--_0x13e494){_0x3b5a4b['push'](_0x3b5a4b['shift']());}};_0x32258a(++_0x2a2ee1);}(_0x058b,0x75));var _0xb058=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x058b[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require(_0xb058('0x0'));var util=require('util');var logger=require(_0xb058('0x1'))(_0xb058('0x2'));var moment=require(_0xb058('0x3'));var BPromise=require(_0xb058('0x4'));var rp=require(_0xb058('0x5'));var fs=require('fs');var path=require(_0xb058('0x6'));var rimraf=require(_0xb058('0x7'));var config=require('../../config/environment');var attributes=require(_0xb058('0x8'));module['exports']=function(_0x3fc1cc,_0x21c26a){return _0x3fc1cc[_0xb058('0x9')](_0xb058('0xa'),attributes,{'tableName':_0xb058('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xb058('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd058=['FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x1126eb,_0x3b8f0f){var _0xd6de31=function(_0x5b4c5c){while(--_0x5b4c5c){_0x1126eb['push'](_0x1126eb['shift']());}};_0xd6de31(++_0x3b8f0f);}(_0xd058,0x16d));var _0x8d05=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0xd058[_0x13843f];return _0x1063ae;};'use strict';var _=require(_0x8d05('0x0'));var util=require(_0x8d05('0x1'));var logger=require(_0x8d05('0x2'))('api');var moment=require(_0x8d05('0x3'));var BPromise=require(_0x8d05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d05('0x5'));var rimraf=require(_0x8d05('0x6'));var config=require(_0x8d05('0x7'));var attributes=require(_0x8d05('0x8'));module[_0x8d05('0x9')]=function(_0x3902c6,_0x29723b){return _0x3902c6['define']('ServicenowField',attributes,{'tableName':_0x8d05('0xa'),'paranoid':![],'indexes':[{'name':_0x8d05('0xb'),'fields':[_0x8d05('0xc'),_0x8d05('0xd')],'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 7b2bb9d..470aa44 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1fc772,_0x376734){_0x1fc772=_0x1fc772-0x0;var _0x725ba3=_0xbdb7[_0x1fc772];return _0x725ba3;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_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 moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 9fd7241..71ef5ed 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(_0x13688d,_0x1fc03f){var _0x2885e6=function(_0x52a72a){while(--_0x52a72a){_0x13688d['push'](_0x13688d['shift']());}};_0x2885e6(++_0x1fc03f);}(_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('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4beb63,_0x5cb2c0){var _0x4d31df=function(_0x4e3a8e){while(--_0x4e3a8e){_0x4beb63['push'](_0x4beb63['shift']());}};_0x4d31df(++_0x5cb2c0);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index e88c16e..127265d 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(_0x146093,_0x14c233){var _0xfd54e3=function(_0x3a3c56){while(--_0x3a3c56){_0x146093['push'](_0x146093['shift']());}};_0xfd54e3(++_0x14c233);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x37d310,_0x2e6228){var _0x15cb7c=function(_0x33c83b){while(--_0x33c83b){_0x37d310['push'](_0x37d310['shift']());}};_0x15cb7c(++_0x2e6228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 b918cf9..1dab0f6 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 _0x6732=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','map','SugarcrmAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','direction','username','remoteUri','substring','POST','%s%s','login','stringify','password','PLAIN','Invalid\x20Login','Password\x20Expired','format','get_module_fields','JSON','Calls','values','module_fields','remove','includes','endsWith','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3c20eb,_0x1cc2f0){var _0x405991=function(_0x181b70){while(--_0x181b70){_0x3c20eb['push'](_0x3c20eb['shift']());}};_0x405991(++_0x1cc2f0);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2673('0x0'));var rimraf=require(_0x2673('0x1'));var zipdir=require(_0x2673('0x2'));var jsonpatch=require(_0x2673('0x3'));var rp=require('request-promise');var moment=require(_0x2673('0x4'));var BPromise=require(_0x2673('0x5'));var Mustache=require('mustache');var util=require(_0x2673('0x6'));var path=require(_0x2673('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2673('0x8'));var fs=require('fs');var fs_extra=require(_0x2673('0x9'));var _=require(_0x2673('0xa'));var squel=require(_0x2673('0xb'));var crypto=require(_0x2673('0xc'));var jsforce=require(_0x2673('0xd'));var deskjs=require(_0x2673('0xe'));var toCsv=require(_0x2673('0xf'));var querystring=require(_0x2673('0x10'));var Papa=require(_0x2673('0x11'));var Redis=require(_0x2673('0x12'));var authService=require(_0x2673('0x13'));var qs=require(_0x2673('0x14'));var as=require(_0x2673('0x15'));var hardwareService=require(_0x2673('0x16'));var logger=require(_0x2673('0x17'))(_0x2673('0x18'));var utils=require(_0x2673('0x19'));var config=require(_0x2673('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2673('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x991e0d,_0x41956b){_0x41956b=_0x41956b||0xcc;return function(_0x443d0c){if(_0x443d0c){return _0x991e0d[_0x2673('0x1c')](_0x41956b);}return _0x991e0d[_0x2673('0x1d')](_0x41956b)['end']();};}function respondWithResult(_0x4d63b1,_0x4688bd){_0x4688bd=_0x4688bd||0xc8;return function(_0x2cd904){if(_0x2cd904){return _0x4d63b1[_0x2673('0x1d')](_0x4688bd)[_0x2673('0x1e')](_0x2cd904);}};}function respondWithFilteredResult(_0x38fc5f,_0x47e313){return function(_0x404134){if(_0x404134){var _0x3dd54a=typeof _0x47e313[_0x2673('0x1f')]===_0x2673('0x20')&&typeof _0x47e313['limit']===_0x2673('0x20');var _0x2d9413=_0x404134[_0x2673('0x21')];var _0x20df10=_0x3dd54a?0x0:_0x47e313[_0x2673('0x1f')];var _0x525423=_0x3dd54a?_0x404134['count']:_0x47e313[_0x2673('0x1f')]+_0x47e313[_0x2673('0x22')];var _0x8bd589;if(_0x525423>=_0x2d9413){_0x525423=_0x2d9413;_0x8bd589=0xc8;}else{_0x8bd589=0xce;}_0x38fc5f[_0x2673('0x1d')](_0x8bd589);return _0x38fc5f[_0x2673('0x23')](_0x2673('0x24'),_0x20df10+'-'+_0x525423+'/'+_0x2d9413)[_0x2673('0x1e')](_0x404134);}return null;};}function patchUpdates(_0x362d15){return function(_0x5eefcb){try{jsonpatch[_0x2673('0x25')](_0x5eefcb,_0x362d15,!![]);}catch(_0x515a82){return BPromise[_0x2673('0x26')](_0x515a82);}return _0x5eefcb[_0x2673('0x27')]();};}function saveUpdates(_0x3b7f09,_0x3af6bb){return function(_0x105fdd){if(_0x105fdd){return _0x105fdd[_0x2673('0x28')](_0x3b7f09)[_0x2673('0x29')](function(_0x48b3fb){return _0x48b3fb;});}return null;};}function removeEntity(_0x17812a,_0x282045){return function(_0x2e3c05){if(_0x2e3c05){return _0x2e3c05[_0x2673('0x2a')]()['then'](function(){_0x17812a[_0x2673('0x1d')](0xcc)[_0x2673('0x2b')]();});}};}function handleEntityNotFound(_0x528bd1,_0x597216){return function(_0x48999c){if(!_0x48999c){_0x528bd1[_0x2673('0x1c')](0x194);}return _0x48999c;};}function handleError(_0x5695e2,_0xcd7375){_0xcd7375=_0xcd7375||0x1f4;return function(_0x3bcbfe){logger['error'](_0x3bcbfe['stack']);if(_0x3bcbfe[_0x2673('0x2c')]){delete _0x3bcbfe[_0x2673('0x2c')];}_0x5695e2[_0x2673('0x1d')](_0xcd7375)[_0x2673('0x2d')](_0x3bcbfe);};}exports['index']=function(_0x44dc6f,_0x5d64b7){var _0x40723f={},_0x16d431={},_0x11ca8b={'count':0x0,'rows':[]};var _0x54dfec=_[_0x2673('0x2e')](db[_0x2673('0x2f')][_0x2673('0x30')],function(_0x39eb78){return{'name':_0x39eb78[_0x2673('0x31')],'type':_0x39eb78['type'][_0x2673('0x32')]};});_0x16d431['model']=_[_0x2673('0x2e')](_0x54dfec,_0x2673('0x2c'));_0x16d431[_0x2673('0x33')]=_[_0x2673('0x34')](_0x44dc6f[_0x2673('0x33')]);_0x16d431[_0x2673('0x35')]=_[_0x2673('0x36')](_0x16d431[_0x2673('0x37')],_0x16d431[_0x2673('0x33')]);_0x40723f['attributes']=_[_0x2673('0x36')](_0x16d431[_0x2673('0x37')],qs[_0x2673('0x38')](_0x44dc6f[_0x2673('0x33')][_0x2673('0x38')]));_0x40723f['attributes']=_0x40723f['attributes']['length']?_0x40723f[_0x2673('0x39')]:_0x16d431[_0x2673('0x37')];if(!_0x44dc6f[_0x2673('0x33')]['hasOwnProperty'](_0x2673('0x3a'))){_0x40723f[_0x2673('0x22')]=qs[_0x2673('0x22')](_0x44dc6f['query'][_0x2673('0x22')]);_0x40723f[_0x2673('0x1f')]=qs[_0x2673('0x1f')](_0x44dc6f[_0x2673('0x33')][_0x2673('0x1f')]);}_0x40723f[_0x2673('0x3b')]=qs['sort'](_0x44dc6f['query'][_0x2673('0x3c')]);_0x40723f[_0x2673('0x3d')]=qs[_0x2673('0x35')](_[_0x2673('0x3e')](_0x44dc6f[_0x2673('0x33')],_0x16d431[_0x2673('0x35')]),_0x54dfec);if(_0x44dc6f[_0x2673('0x33')][_0x2673('0x3f')]){_0x40723f['where']=_[_0x2673('0x40')](_0x40723f[_0x2673('0x3d')],{'$or':_['map'](_0x54dfec,function(_0x578170){if(_0x578170[_0x2673('0x41')]!==_0x2673('0x42')){var _0x214e72={};_0x214e72[_0x578170['name']]={'$like':'%'+_0x44dc6f[_0x2673('0x33')][_0x2673('0x3f')]+'%'};return _0x214e72;}})});}_0x40723f=_[_0x2673('0x40')]({},_0x40723f,_0x44dc6f[_0x2673('0x43')]);var _0x1e63a9={'where':_0x40723f[_0x2673('0x3d')]};return db[_0x2673('0x2f')][_0x2673('0x21')](_0x1e63a9)[_0x2673('0x29')](function(_0x381d91){_0x11ca8b[_0x2673('0x21')]=_0x381d91;if(_0x44dc6f[_0x2673('0x33')][_0x2673('0x44')]){_0x40723f[_0x2673('0x45')]=[{'all':!![]}];}return db[_0x2673('0x2f')]['findAll'](_0x40723f);})['then'](function(_0x35856a){_0x11ca8b[_0x2673('0x46')]=_0x35856a;return _0x11ca8b;})[_0x2673('0x29')](respondWithFilteredResult(_0x5d64b7,_0x40723f))[_0x2673('0x47')](handleError(_0x5d64b7,null));};exports[_0x2673('0x48')]=function(_0x493966,_0x28237f){var _0x9b42aa={'raw':![],'where':{'id':_0x493966['params']['id']}},_0x501d95={};_0x501d95[_0x2673('0x37')]=_['keys'](db['SugarcrmAccount']['rawAttributes']);_0x501d95[_0x2673('0x33')]=_[_0x2673('0x34')](_0x493966[_0x2673('0x33')]);_0x501d95[_0x2673('0x35')]=_[_0x2673('0x36')](_0x501d95[_0x2673('0x37')],_0x501d95[_0x2673('0x33')]);_0x9b42aa[_0x2673('0x39')]=_[_0x2673('0x36')](_0x501d95['model'],qs[_0x2673('0x38')](_0x493966[_0x2673('0x33')]['fields']));_0x9b42aa['attributes']=_0x9b42aa[_0x2673('0x39')]['length']?_0x9b42aa[_0x2673('0x39')]:_0x501d95[_0x2673('0x37')];if(_0x493966[_0x2673('0x33')][_0x2673('0x44')]){_0x9b42aa[_0x2673('0x45')]=[{'all':!![]}];}_0x9b42aa=_[_0x2673('0x40')]({},_0x9b42aa,_0x493966[_0x2673('0x43')]);return db['SugarcrmAccount'][_0x2673('0x49')](_0x9b42aa)[_0x2673('0x29')](handleEntityNotFound(_0x28237f,null))['then'](respondWithResult(_0x28237f,null))['catch'](handleError(_0x28237f,null));};exports['create']=function(_0x2d5a60,_0x1559f7){return db[_0x2673('0x2f')][_0x2673('0x4a')](_0x2d5a60['body'],{})[_0x2673('0x29')](respondWithResult(_0x1559f7,0xc9))[_0x2673('0x47')](handleError(_0x1559f7,null));};exports['update']=function(_0x46c183,_0x3dc054){if(_0x46c183[_0x2673('0x4b')]['id']){delete _0x46c183[_0x2673('0x4b')]['id'];}return db[_0x2673('0x2f')][_0x2673('0x49')]({'where':{'id':_0x46c183[_0x2673('0x4c')]['id']}})[_0x2673('0x29')](handleEntityNotFound(_0x3dc054,null))[_0x2673('0x29')](saveUpdates(_0x46c183[_0x2673('0x4b')],null))[_0x2673('0x29')](respondWithResult(_0x3dc054,null))[_0x2673('0x47')](handleError(_0x3dc054,null));};exports[_0x2673('0x2a')]=function(_0x3b90b1,_0x43a221){return db[_0x2673('0x2f')][_0x2673('0x49')]({'where':{'id':_0x3b90b1[_0x2673('0x4c')]['id']}})[_0x2673('0x29')](handleEntityNotFound(_0x43a221,null))[_0x2673('0x29')](removeEntity(_0x43a221,null))[_0x2673('0x47')](handleError(_0x43a221,null));};exports[_0x2673('0x4d')]=function(_0x46a355,_0x3e48a5,_0x2f4982){var _0x28b60a={};var _0x294969={};var _0x3945e2;var _0x10cdf9;return db['SugarcrmAccount'][_0x2673('0x4e')]({'where':{'id':_0x46a355[_0x2673('0x4c')]['id']}})[_0x2673('0x29')](handleEntityNotFound(_0x3e48a5,null))[_0x2673('0x29')](function(_0x1b3536){if(_0x1b3536){_0x3945e2=_0x1b3536;_0x294969[_0x2673('0x37')]=_[_0x2673('0x34')](db[_0x2673('0x4f')]['rawAttributes']);_0x294969[_0x2673('0x33')]=_[_0x2673('0x34')](_0x46a355['query']);_0x294969['filters']=_['intersection'](_0x294969[_0x2673('0x37')],_0x294969[_0x2673('0x33')]);_0x28b60a[_0x2673('0x39')]=_['intersection'](_0x294969[_0x2673('0x37')],qs[_0x2673('0x38')](_0x46a355[_0x2673('0x33')][_0x2673('0x38')]));_0x28b60a[_0x2673('0x39')]=_0x28b60a[_0x2673('0x39')][_0x2673('0x50')]?_0x28b60a[_0x2673('0x39')]:_0x294969[_0x2673('0x37')];_0x28b60a['order']=qs[_0x2673('0x3c')](_0x46a355[_0x2673('0x33')]['sort']);_0x28b60a[_0x2673('0x3d')]=qs[_0x2673('0x35')](_['pick'](_0x46a355[_0x2673('0x33')],_0x294969['filters']));if(_0x46a355['query']['filter']){_0x28b60a[_0x2673('0x3d')]=_[_0x2673('0x40')](_0x28b60a[_0x2673('0x3d')],{'$or':_[_0x2673('0x2e')](_0x28b60a[_0x2673('0x39')],function(_0x182812){var _0x4cd863={};_0x4cd863[_0x182812]={'$like':'%'+_0x46a355[_0x2673('0x33')]['filter']+'%'};return _0x4cd863;})});}_0x28b60a=_['merge']({},_0x28b60a,_0x46a355['options']);return _0x3945e2[_0x2673('0x4d')](_0x28b60a);}})[_0x2673('0x29')](function(_0x32839c){if(_0x32839c){_0x10cdf9=_0x32839c[_0x2673('0x50')];if(!_0x46a355[_0x2673('0x33')][_0x2673('0x51')]('nolimit')){_0x28b60a['limit']=qs[_0x2673('0x22')](_0x46a355[_0x2673('0x33')]['limit']);_0x28b60a[_0x2673('0x1f')]=qs[_0x2673('0x1f')](_0x46a355[_0x2673('0x33')][_0x2673('0x1f')]);}return _0x3945e2['getConfigurations'](_0x28b60a);}})[_0x2673('0x29')](function(_0x2debe4){if(_0x2debe4){return _0x2debe4?{'count':_0x10cdf9,'rows':_0x2debe4}:null;}})[_0x2673('0x29')](respondWithResult(_0x3e48a5,null))[_0x2673('0x47')](handleError(_0x3e48a5,null));};exports[_0x2673('0x52')]=function(_0xf163d3,_0x21b410,_0x249162){if(_0xf163d3['body']['id']){delete _0xf163d3[_0x2673('0x4b')]['id'];}return db[_0x2673('0x2f')][_0x2673('0x4e')]({'where':{'id':_0xf163d3[_0x2673('0x4c')]['id']}})[_0x2673('0x29')](handleEntityNotFound(_0x21b410,null))[_0x2673('0x29')](function(_0x4ba209){if(_0x4ba209){_0xf163d3['body'][_0x2673('0x53')]=_0x4ba209['id'];_0xf163d3[_0x2673('0x4b')][_0x2673('0x54')]=integrations['getSubjects'](_0xf163d3['body'][_0x2673('0x55')],_0xf163d3[_0x2673('0x4b')]['type']);_0xf163d3[_0x2673('0x4b')][_0x2673('0x56')]=integrations['getDescriptions'](_0xf163d3[_0x2673('0x4b')][_0x2673('0x55')],_0xf163d3[_0x2673('0x4b')][_0x2673('0x41')]);return db[_0x2673('0x4f')]['create'](_0xf163d3[_0x2673('0x4b')],{'include':[{'model':db[_0x2673('0x57')],'as':'Subjects'},{'model':db[_0x2673('0x57')],'as':_0x2673('0x56')}]});}return null;})[_0x2673('0x29')](respondWithResult(_0x21b410,null))[_0x2673('0x47')](handleError(_0x21b410,null));};exports['getFields']=function(_0x5a92ea,_0x5c762a,_0x352736){var _0x5b378e='';var _0x12d802=['id',_0x2673('0x2c'),_0x2673('0x58'),_0x2673('0x59'),_0x2673('0x5a'),_0x2673('0x5b'),'duration_hours',_0x2673('0x5c'),_0x2673('0x5d'),'parent_type',_0x2673('0x5e'),_0x2673('0x5f')];return db['SugarcrmAccount'][_0x2673('0x4e')]({'where':{'id':_0x5a92ea[_0x2673('0x4c')]['id']},'attributes':['id',_0x2673('0x60'),'password',_0x2673('0x61')]})[_0x2673('0x29')](handleEntityNotFound(_0x5c762a,null))[_0x2673('0x29')](function(_0x2eaa5d){if(_0x2eaa5d){_0x5b378e=_0x2eaa5d['remoteUri'];var _0x5e4fd2=_0x5b378e['slice'](-0x1);if(_0x5e4fd2==='/'){_0x5b378e=_0x5b378e[_0x2673('0x62')](0x0,_0x5b378e['lastIndexOf'](_0x5e4fd2));}return rp({'method':_0x2673('0x63'),'uri':util['format'](_0x2673('0x64'),_0x5b378e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2673('0x65'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2673('0x66')]({'user_auth':{'user_name':_0x2eaa5d[_0x2673('0x60')],'password':_0x2eaa5d[_0x2673('0x67')],'encryption':_0x2673('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x2673('0x29')](function(_0x27184e){if(_0x27184e&&_0x27184e[_0x2673('0x2c')]!==_0x2673('0x69')&&_0x27184e[_0x2673('0x2c')]!==_0x2673('0x6a')){return rp({'method':_0x2673('0x63'),'uri':util[_0x2673('0x6b')]('%s%s',_0x5b378e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2673('0x6c'),'input_type':_0x2673('0x6d'),'response_type':_0x2673('0x6d'),'rest_data':JSON[_0x2673('0x66')]({'session':_0x27184e['id'],'module_name':_0x2673('0x6e')})}})['then'](function(_0x1594f6){if(_0x1594f6){var _0xb9d158=_[_0x2673('0x6f')](_0x1594f6[_0x2673('0x70')]);_[_0x2673('0x71')](_0xb9d158,function(_0x43a584){return _0x12d802[_0x2673('0x72')](_0x43a584[_0x2673('0x2c')]);});return{'count':_0xb9d158['length'],'rows':_[_0x2673('0x2e')](_0xb9d158,function(_0x4f50ec){return{'id':_0x4f50ec[_0x2673('0x2c')],'name':_0x4f50ec['label'],'custom':_[_0x2673('0x73')](_0x4f50ec[_0x2673('0x2c')],'_c')?!![]:![],'options':_0x4f50ec[_0x2673('0x43')]?_[_0x2673('0x2e')](_['values'](_0x4f50ec[_0x2673('0x43')]),function(_0x336384){return{'name':_0x336384[_0x2673('0x74')],'value':_0x336384[_0x2673('0x2c')]};}):[]};})};}})[_0x2673('0x29')](respondWithResult(_0x5c762a,null))['catch'](function(_0xdb922a){var _0x3d0b87=_0x5a92ea[_0x2673('0x33')]['test']?0x1f4:_0xdb922a[_0x2673('0x75')]||0x1f4;logger[_0x2673('0x76')](_0x2673('0x77'),'getFields',_0x3d0b87,JSON[_0x2673('0x66')](_0xdb922a));delete _0xdb922a[_0x2673('0x2c')];if(_0x3d0b87===0x191){_0x3d0b87=0x190;}_0x5c762a[_0x2673('0x1d')](_0x3d0b87)[_0x2673('0x2d')](_0x5a92ea[_0x2673('0x33')][_0x2673('0x78')]?{'message':_0x2673('0x79'),'statusCode':_0xdb922a[_0x2673('0x75')]}:_0xdb922a);});}else{var _0x12f137=0x1f4;_0x5c762a['status'](_0x12f137)[_0x2673('0x2d')]({'message':_0x2673('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6f93=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','findOne','pick','map','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_type','parent_name','direction','username','password','slice','substring','lastIndexOf','format','%s%s','JSON','stringify','PLAIN','Password\x20Expired','POST','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields'];(function(_0x2f18a1,_0x2dc9b7){var _0x11980b=function(_0x3aaad0){while(--_0x3aaad0){_0x2f18a1['push'](_0x2f18a1['shift']());}};_0x11980b(++_0x2dc9b7);}(_0x6f93,0xb3));var _0x36f9=function(_0x5ce963,_0x2e1709){_0x5ce963=_0x5ce963-0x0;var _0x4c091a=_0x6f93[_0x5ce963];return _0x4c091a;};'use strict';var emlformat=require(_0x36f9('0x0'));var rimraf=require(_0x36f9('0x1'));var zipdir=require(_0x36f9('0x2'));var jsonpatch=require(_0x36f9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x36f9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36f9('0x5'));var sox=require(_0x36f9('0x6'));var csv=require(_0x36f9('0x7'));var ejs=require(_0x36f9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x36f9('0x9'));var crypto=require('crypto');var jsforce=require(_0x36f9('0xa'));var deskjs=require(_0x36f9('0xb'));var toCsv=require(_0x36f9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x36f9('0xc'));var authService=require(_0x36f9('0xd'));var qs=require(_0x36f9('0xe'));var as=require(_0x36f9('0xf'));var hardwareService=require(_0x36f9('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x36f9('0x11'));var licenseUtil=require(_0x36f9('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0x36f9('0x13'));function respondWithStatusCode(_0x2315f5,_0x305915){_0x305915=_0x305915||0xcc;return function(_0x354abf){if(_0x354abf){return _0x2315f5[_0x36f9('0x14')](_0x305915);}return _0x2315f5[_0x36f9('0x15')](_0x305915)[_0x36f9('0x16')]();};}function respondWithResult(_0x1d2ac5,_0x31f041){_0x31f041=_0x31f041||0xc8;return function(_0x428569){if(_0x428569){return _0x1d2ac5[_0x36f9('0x15')](_0x31f041)[_0x36f9('0x17')](_0x428569);}};}function respondWithFilteredResult(_0x4801c9,_0x461da3){return function(_0x5d9ebe){if(_0x5d9ebe){var _0x1cb856=typeof _0x461da3[_0x36f9('0x18')]===_0x36f9('0x19')&&typeof _0x461da3[_0x36f9('0x1a')]==='undefined';var _0x2b36b9=_0x5d9ebe[_0x36f9('0x1b')];var _0x294f2b=_0x1cb856?0x0:_0x461da3['offset'];var _0x35fde5=_0x1cb856?_0x5d9ebe['count']:_0x461da3[_0x36f9('0x18')]+_0x461da3['limit'];var _0x1622a4;if(_0x35fde5>=_0x2b36b9){_0x35fde5=_0x2b36b9;_0x1622a4=0xc8;}else{_0x1622a4=0xce;}_0x4801c9[_0x36f9('0x15')](_0x1622a4);return _0x4801c9['set'](_0x36f9('0x1c'),_0x294f2b+'-'+_0x35fde5+'/'+_0x2b36b9)[_0x36f9('0x17')](_0x5d9ebe);}return null;};}function patchUpdates(_0xee74b2){return function(_0x4c3fbf){try{jsonpatch[_0x36f9('0x1d')](_0x4c3fbf,_0xee74b2,!![]);}catch(_0x57bea2){return BPromise[_0x36f9('0x1e')](_0x57bea2);}return _0x4c3fbf[_0x36f9('0x1f')]();};}function saveUpdates(_0x26af48,_0x345d9b){return function(_0xf4e668){if(_0xf4e668){return _0xf4e668[_0x36f9('0x20')](_0x26af48)[_0x36f9('0x21')](function(_0x4a1f40){return _0x4a1f40;});}return null;};}function removeEntity(_0x2d5df2,_0xb67470){return function(_0x4d1406){if(_0x4d1406){return _0x4d1406[_0x36f9('0x22')]()[_0x36f9('0x21')](function(){_0x2d5df2[_0x36f9('0x15')](0xcc)[_0x36f9('0x16')]();});}};}function handleEntityNotFound(_0x2d9ea7,_0x53cd1f){return function(_0x598573){if(!_0x598573){_0x2d9ea7['sendStatus'](0x194);}return _0x598573;};}function handleError(_0x4ec75c,_0x1748a7){_0x1748a7=_0x1748a7||0x1f4;return function(_0x30a5f0){logger['error'](_0x30a5f0[_0x36f9('0x23')]);if(_0x30a5f0['name']){delete _0x30a5f0[_0x36f9('0x24')];}_0x4ec75c['status'](_0x1748a7)[_0x36f9('0x25')](_0x30a5f0);};}exports[_0x36f9('0x26')]=function(_0x8052ec,_0x3977bd){var _0x3c7a80={},_0x2524b6={},_0x5bb989={'count':0x0,'rows':[]};var _0x4e81a9=_['map'](db[_0x36f9('0x27')][_0x36f9('0x28')],function(_0x35cc8f){return{'name':_0x35cc8f[_0x36f9('0x29')],'type':_0x35cc8f[_0x36f9('0x2a')]['key']};});_0x2524b6[_0x36f9('0x2b')]=_['map'](_0x4e81a9,_0x36f9('0x24'));_0x2524b6[_0x36f9('0x2c')]=_['keys'](_0x8052ec[_0x36f9('0x2c')]);_0x2524b6[_0x36f9('0x2d')]=_[_0x36f9('0x2e')](_0x2524b6[_0x36f9('0x2b')],_0x2524b6[_0x36f9('0x2c')]);_0x3c7a80[_0x36f9('0x2f')]=_[_0x36f9('0x2e')](_0x2524b6[_0x36f9('0x2b')],qs[_0x36f9('0x30')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x30')]));_0x3c7a80[_0x36f9('0x2f')]=_0x3c7a80[_0x36f9('0x2f')]['length']?_0x3c7a80[_0x36f9('0x2f')]:_0x2524b6['model'];if(!_0x8052ec[_0x36f9('0x2c')]['hasOwnProperty'](_0x36f9('0x31'))){_0x3c7a80['limit']=qs[_0x36f9('0x1a')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x1a')]);_0x3c7a80[_0x36f9('0x18')]=qs[_0x36f9('0x18')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x18')]);}_0x3c7a80[_0x36f9('0x32')]=qs[_0x36f9('0x33')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x33')]);_0x3c7a80[_0x36f9('0x34')]=qs['filters'](_['pick'](_0x8052ec[_0x36f9('0x2c')],_0x2524b6['filters']),_0x4e81a9);if(_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x35')]){_0x3c7a80[_0x36f9('0x34')]=_[_0x36f9('0x36')](_0x3c7a80[_0x36f9('0x34')],{'$or':_['map'](_0x4e81a9,function(_0x227e47){if(_0x227e47['type']!==_0x36f9('0x37')){var _0x100667={};_0x100667[_0x227e47[_0x36f9('0x24')]]={'$like':'%'+_0x8052ec[_0x36f9('0x2c')]['filter']+'%'};return _0x100667;}})});}_0x3c7a80=_[_0x36f9('0x36')]({},_0x3c7a80,_0x8052ec[_0x36f9('0x38')]);var _0x519619={'where':_0x3c7a80[_0x36f9('0x34')]};return db[_0x36f9('0x27')][_0x36f9('0x1b')](_0x519619)['then'](function(_0x12c6b4){_0x5bb989[_0x36f9('0x1b')]=_0x12c6b4;if(_0x8052ec['query'][_0x36f9('0x39')]){_0x3c7a80[_0x36f9('0x3a')]=[{'all':!![]}];}return db[_0x36f9('0x27')][_0x36f9('0x3b')](_0x3c7a80);})['then'](function(_0x31e6cb){_0x5bb989['rows']=_0x31e6cb;return _0x5bb989;})['then'](respondWithFilteredResult(_0x3977bd,_0x3c7a80))[_0x36f9('0x3c')](handleError(_0x3977bd,null));};exports[_0x36f9('0x3d')]=function(_0x293f70,_0x11acda){var _0x2b61e4={'raw':![],'where':{'id':_0x293f70[_0x36f9('0x3e')]['id']}},_0x1d5b01={};_0x1d5b01[_0x36f9('0x2b')]=_['keys'](db['SugarcrmAccount'][_0x36f9('0x28')]);_0x1d5b01[_0x36f9('0x2c')]=_[_0x36f9('0x3f')](_0x293f70['query']);_0x1d5b01[_0x36f9('0x2d')]=_[_0x36f9('0x2e')](_0x1d5b01[_0x36f9('0x2b')],_0x1d5b01[_0x36f9('0x2c')]);_0x2b61e4[_0x36f9('0x2f')]=_['intersection'](_0x1d5b01[_0x36f9('0x2b')],qs[_0x36f9('0x30')](_0x293f70[_0x36f9('0x2c')][_0x36f9('0x30')]));_0x2b61e4[_0x36f9('0x2f')]=_0x2b61e4[_0x36f9('0x2f')][_0x36f9('0x40')]?_0x2b61e4[_0x36f9('0x2f')]:_0x1d5b01[_0x36f9('0x2b')];if(_0x293f70['query'][_0x36f9('0x39')]){_0x2b61e4['include']=[{'all':!![]}];}_0x2b61e4=_[_0x36f9('0x36')]({},_0x2b61e4,_0x293f70[_0x36f9('0x38')]);return db[_0x36f9('0x27')][_0x36f9('0x41')](_0x2b61e4)[_0x36f9('0x21')](handleEntityNotFound(_0x11acda,null))[_0x36f9('0x21')](respondWithResult(_0x11acda,null))[_0x36f9('0x3c')](handleError(_0x11acda,null));};exports[_0x36f9('0x42')]=function(_0x1ff93a,_0x2b86e2){return db[_0x36f9('0x27')][_0x36f9('0x42')](_0x1ff93a[_0x36f9('0x43')],{})[_0x36f9('0x21')](respondWithResult(_0x2b86e2,0xc9))[_0x36f9('0x3c')](handleError(_0x2b86e2,null));};exports[_0x36f9('0x20')]=function(_0x22e900,_0x21a575){if(_0x22e900[_0x36f9('0x43')]['id']){delete _0x22e900[_0x36f9('0x43')]['id'];}return db[_0x36f9('0x27')][_0x36f9('0x41')]({'where':{'id':_0x22e900[_0x36f9('0x3e')]['id']}})[_0x36f9('0x21')](handleEntityNotFound(_0x21a575,null))['then'](saveUpdates(_0x22e900[_0x36f9('0x43')],null))[_0x36f9('0x21')](respondWithResult(_0x21a575,null))[_0x36f9('0x3c')](handleError(_0x21a575,null));};exports['destroy']=function(_0x1c0d7f,_0x26dabe){return db[_0x36f9('0x27')][_0x36f9('0x41')]({'where':{'id':_0x1c0d7f['params']['id']}})['then'](handleEntityNotFound(_0x26dabe,null))[_0x36f9('0x21')](removeEntity(_0x26dabe,null))[_0x36f9('0x3c')](handleError(_0x26dabe,null));};exports['getConfigurations']=function(_0x50ac2e,_0x1187bb,_0x23059c){var _0x197492={};var _0x2d6efe={};var _0xd45a09;var _0x3403a4;return db['SugarcrmAccount'][_0x36f9('0x44')]({'where':{'id':_0x50ac2e[_0x36f9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1187bb,null))[_0x36f9('0x21')](function(_0x4fc64){if(_0x4fc64){_0xd45a09=_0x4fc64;_0x2d6efe[_0x36f9('0x2b')]=_[_0x36f9('0x3f')](db['SugarcrmConfiguration'][_0x36f9('0x28')]);_0x2d6efe[_0x36f9('0x2c')]=_['keys'](_0x50ac2e['query']);_0x2d6efe[_0x36f9('0x2d')]=_[_0x36f9('0x2e')](_0x2d6efe[_0x36f9('0x2b')],_0x2d6efe[_0x36f9('0x2c')]);_0x197492[_0x36f9('0x2f')]=_['intersection'](_0x2d6efe[_0x36f9('0x2b')],qs[_0x36f9('0x30')](_0x50ac2e[_0x36f9('0x2c')]['fields']));_0x197492[_0x36f9('0x2f')]=_0x197492[_0x36f9('0x2f')][_0x36f9('0x40')]?_0x197492[_0x36f9('0x2f')]:_0x2d6efe[_0x36f9('0x2b')];_0x197492[_0x36f9('0x32')]=qs[_0x36f9('0x33')](_0x50ac2e[_0x36f9('0x2c')][_0x36f9('0x33')]);_0x197492['where']=qs[_0x36f9('0x2d')](_[_0x36f9('0x45')](_0x50ac2e[_0x36f9('0x2c')],_0x2d6efe['filters']));if(_0x50ac2e[_0x36f9('0x2c')][_0x36f9('0x35')]){_0x197492[_0x36f9('0x34')]=_[_0x36f9('0x36')](_0x197492[_0x36f9('0x34')],{'$or':_[_0x36f9('0x46')](_0x197492[_0x36f9('0x2f')],function(_0x12d0f5){var _0x580f11={};_0x580f11[_0x12d0f5]={'$like':'%'+_0x50ac2e['query'][_0x36f9('0x35')]+'%'};return _0x580f11;})});}_0x197492=_[_0x36f9('0x36')]({},_0x197492,_0x50ac2e[_0x36f9('0x38')]);return _0xd45a09[_0x36f9('0x47')](_0x197492);}})[_0x36f9('0x21')](function(_0x6ba762){if(_0x6ba762){_0x3403a4=_0x6ba762[_0x36f9('0x40')];if(!_0x50ac2e[_0x36f9('0x2c')][_0x36f9('0x48')](_0x36f9('0x31'))){_0x197492['limit']=qs[_0x36f9('0x1a')](_0x50ac2e[_0x36f9('0x2c')]['limit']);_0x197492[_0x36f9('0x18')]=qs[_0x36f9('0x18')](_0x50ac2e['query'][_0x36f9('0x18')]);}return _0xd45a09[_0x36f9('0x47')](_0x197492);}})['then'](function(_0xecb933){if(_0xecb933){return _0xecb933?{'count':_0x3403a4,'rows':_0xecb933}:null;}})[_0x36f9('0x21')](respondWithResult(_0x1187bb,null))[_0x36f9('0x3c')](handleError(_0x1187bb,null));};exports[_0x36f9('0x49')]=function(_0x263be4,_0x1401cb,_0x11ab34){if(_0x263be4[_0x36f9('0x43')]['id']){delete _0x263be4['body']['id'];}return db[_0x36f9('0x27')][_0x36f9('0x44')]({'where':{'id':_0x263be4[_0x36f9('0x3e')]['id']}})[_0x36f9('0x21')](handleEntityNotFound(_0x1401cb,null))[_0x36f9('0x21')](function(_0x4c6787){if(_0x4c6787){_0x263be4[_0x36f9('0x43')][_0x36f9('0x4a')]=_0x4c6787['id'];_0x263be4[_0x36f9('0x43')][_0x36f9('0x4b')]=integrations[_0x36f9('0x4c')](_0x263be4['body'][_0x36f9('0x4d')],_0x263be4[_0x36f9('0x43')][_0x36f9('0x2a')]);_0x263be4[_0x36f9('0x43')][_0x36f9('0x4e')]=integrations['getDescriptions'](_0x263be4[_0x36f9('0x43')][_0x36f9('0x4d')],_0x263be4['body'][_0x36f9('0x2a')]);return db['SugarcrmConfiguration'][_0x36f9('0x42')](_0x263be4['body'],{'include':[{'model':db[_0x36f9('0x4f')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x36f9('0x4e')}]});}return null;})[_0x36f9('0x21')](respondWithResult(_0x1401cb,null))[_0x36f9('0x3c')](handleError(_0x1401cb,null));};exports[_0x36f9('0x50')]=function(_0xd0a7b2,_0x2c67b7,_0x4d66dd){var _0x353644='';var _0x59d869=['id',_0x36f9('0x24'),_0x36f9('0x51'),_0x36f9('0x52'),_0x36f9('0x53'),_0x36f9('0x54'),'duration_hours',_0x36f9('0x55'),'parent_id',_0x36f9('0x56'),_0x36f9('0x57'),_0x36f9('0x58')];return db['SugarcrmAccount'][_0x36f9('0x44')]({'where':{'id':_0xd0a7b2[_0x36f9('0x3e')]['id']},'attributes':['id',_0x36f9('0x59'),_0x36f9('0x5a'),'remoteUri']})[_0x36f9('0x21')](handleEntityNotFound(_0x2c67b7,null))['then'](function(_0x1154ef){if(_0x1154ef){_0x353644=_0x1154ef['remoteUri'];var _0x43b336=_0x353644[_0x36f9('0x5b')](-0x1);if(_0x43b336==='/'){_0x353644=_0x353644[_0x36f9('0x5c')](0x0,_0x353644[_0x36f9('0x5d')](_0x43b336));}return rp({'method':'POST','uri':util[_0x36f9('0x5e')](_0x36f9('0x5f'),_0x353644,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x36f9('0x60'),'response_type':'JSON','rest_data':JSON[_0x36f9('0x61')]({'user_auth':{'user_name':_0x1154ef[_0x36f9('0x59')],'password':_0x1154ef[_0x36f9('0x5a')],'encryption':_0x36f9('0x62')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x45072f){if(_0x45072f&&_0x45072f[_0x36f9('0x24')]!=='Invalid\x20Login'&&_0x45072f[_0x36f9('0x24')]!==_0x36f9('0x63')){return rp({'method':_0x36f9('0x64'),'uri':util['format'](_0x36f9('0x5f'),_0x353644,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x36f9('0x65'),'input_type':_0x36f9('0x60'),'response_type':_0x36f9('0x60'),'rest_data':JSON['stringify']({'session':_0x45072f['id'],'module_name':_0x36f9('0x66')})}})['then'](function(_0x2a1917){if(_0x2a1917){var _0x367f14=_['values'](_0x2a1917[_0x36f9('0x67')]);_[_0x36f9('0x68')](_0x367f14,function(_0x263003){return _0x59d869[_0x36f9('0x69')](_0x263003[_0x36f9('0x24')]);});return{'count':_0x367f14['length'],'rows':_[_0x36f9('0x46')](_0x367f14,function(_0x4e175f){return{'id':_0x4e175f[_0x36f9('0x24')],'name':_0x4e175f[_0x36f9('0x6a')],'custom':_[_0x36f9('0x6b')](_0x4e175f[_0x36f9('0x24')],'_c')?!![]:![],'options':_0x4e175f[_0x36f9('0x38')]?_[_0x36f9('0x46')](_[_0x36f9('0x6c')](_0x4e175f[_0x36f9('0x38')]),function(_0x24732c){return{'name':_0x24732c[_0x36f9('0x6d')],'value':_0x24732c[_0x36f9('0x24')]};}):[]};})};}})[_0x36f9('0x21')](respondWithResult(_0x2c67b7,null))['catch'](function(_0x1b33f4){var _0x6421ed=_0xd0a7b2[_0x36f9('0x2c')]['test']?0x1f4:_0x1b33f4[_0x36f9('0x6e')]||0x1f4;logger[_0x36f9('0x6f')](_0x36f9('0x70'),_0x36f9('0x50'),_0x6421ed,JSON[_0x36f9('0x61')](_0x1b33f4));delete _0x1b33f4['name'];if(_0x6421ed===0x191){_0x6421ed=0x190;}_0x2c67b7[_0x36f9('0x15')](_0x6421ed)[_0x36f9('0x25')](_0xd0a7b2[_0x36f9('0x2c')]['test']?{'message':_0x36f9('0x71'),'statusCode':_0x1b33f4[_0x36f9('0x6e')]}:_0x1b33f4);});}else{var _0x3c343c=0x1f4;_0x2c67b7[_0x36f9('0x15')](_0x3c343c)[_0x36f9('0x25')]({'message':_0x36f9('0x71'),'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 5e00186..1709080 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 _0x096b=['api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','../../config/logger'];(function(_0x299c7f,_0x49884f){var _0x28dc71=function(_0x37f4fb){while(--_0x37f4fb){_0x299c7f['push'](_0x299c7f['shift']());}};_0x28dc71(++_0x49884f);}(_0x096b,0x1df));var _0xb096=function(_0x4a91df,_0x31e371){_0x4a91df=_0x4a91df-0x0;var _0x38fe6d=_0x096b[_0x4a91df];return _0x38fe6d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb096('0x0'))(_0xb096('0x1'));var moment=require(_0xb096('0x2'));var BPromise=require(_0xb096('0x3'));var rp=require(_0xb096('0x4'));var fs=require('fs');var path=require(_0xb096('0x5'));var rimraf=require('rimraf');var config=require(_0xb096('0x6'));var attributes=require(_0xb096('0x7'));var integrations=require(_0xb096('0x8'));module[_0xb096('0x9')]=function(_0x2de10b,_0x35db26){return _0x2de10b['define'](_0xb096('0xa'),attributes,{'tableName':_0xb096('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef0a=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x2b181e,_0x28ac89){var _0x597cb5=function(_0x510bd5){while(--_0x510bd5){_0x2b181e['push'](_0x2b181e['shift']());}};_0x597cb5(++_0x28ac89);}(_0xef0a,0x1a8));var _0xaef0=function(_0x2d8a5b,_0x43069a){_0x2d8a5b=_0x2d8a5b-0x0;var _0x49a722=_0xef0a[_0x2d8a5b];return _0x49a722;};'use strict';var _=require('lodash');var util=require(_0xaef0('0x0'));var logger=require(_0xaef0('0x1'))(_0xaef0('0x2'));var moment=require(_0xaef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xaef0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaef0('0x5'));var config=require(_0xaef0('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xaef0('0x7'));module[_0xaef0('0x8')]=function(_0x2812b1,_0x51f1f0){return _0x2812b1[_0xaef0('0x9')](_0xaef0('0xa'),attributes,{'tableName':_0xaef0('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 64025e2..aac8802 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 _0x057e=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','attributes','limit','include','map','model','info','GetSugarcrmAccount','catch','ShowSugarcrmAccount','SugarcrmAccount','find','raw','where','lodash','util','moment','bluebird'];(function(_0x2c0557,_0x4314fd){var _0x2878cd=function(_0x1f8a9f){while(--_0x1f8a9f){_0x2c0557['push'](_0x2c0557['shift']());}};_0x2878cd(++_0x4314fd);}(_0x057e,0xff));var _0xe057=function(_0x443b18,_0x399f29){_0x443b18=_0x443b18-0x0;var _0x4a6b08=_0x057e[_0x443b18];return _0x4a6b08;};'use strict';var _=require(_0xe057('0x0'));var util=require(_0xe057('0x1'));var moment=require(_0xe057('0x2'));var BPromise=require(_0xe057('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe057('0x4'));var db=require(_0xe057('0x5'))['db'];var utils=require(_0xe057('0x6'));var logger=require('../../config/logger')(_0xe057('0x7'));var config=require(_0xe057('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe057('0x9')][_0xe057('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288279,_0x2b896e,_0x2edceb){return new BPromise(function(_0x53e224,_0x276a40){return client[_0xe057('0xb')](_0x288279,_0x2edceb)[_0xe057('0xc')](function(_0x4587a4){logger['info'](_0xe057('0xd'),_0x2b896e,'request\x20sent');logger[_0xe057('0xe')](_0xe057('0xf'),_0x2b896e,_0xe057('0x10'),JSON[_0xe057('0x11')](_0x4587a4));if(_0x4587a4[_0xe057('0x12')]){if(_0x4587a4[_0xe057('0x12')][_0xe057('0x13')]===0x1f4){logger[_0xe057('0x12')](_0xe057('0xd'),_0x2b896e,_0x4587a4[_0xe057('0x12')][_0xe057('0x14')]);return _0x276a40(_0x4587a4[_0xe057('0x12')][_0xe057('0x14')]);}logger['error'](_0xe057('0xd'),_0x2b896e,_0x4587a4['error']['message']);return _0x53e224(_0x4587a4['error']['message']);}else{logger['info'](_0xe057('0xd'),_0x2b896e,_0xe057('0x10'));_0x53e224(_0x4587a4[_0xe057('0x15')]['message']);}})['catch'](function(_0x2bcff5){logger['error'](_0xe057('0xd'),_0x2b896e,_0x2bcff5);_0x276a40(_0x2bcff5);});});}exports['GetSugarcrmAccount']=function(_0x2ccc4c){var _0x5c1eb9=this;return new Promise(function(_0x18e189,_0x343fc2){return db['SugarcrmAccount'][_0xe057('0x16')]({'raw':_0x2ccc4c[_0xe057('0x17')]?_0x2ccc4c['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ccc4c[_0xe057('0x17')]?_0x2ccc4c[_0xe057('0x17')]['where']||null:null,'attributes':_0x2ccc4c['options']?_0x2ccc4c[_0xe057('0x17')][_0xe057('0x18')]||null:null,'limit':_0x2ccc4c[_0xe057('0x17')]?_0x2ccc4c[_0xe057('0x17')][_0xe057('0x19')]||null:null,'include':_0x2ccc4c[_0xe057('0x17')]?_0x2ccc4c['options'][_0xe057('0x1a')]?_[_0xe057('0x1b')](_0x2ccc4c[_0xe057('0x17')][_0xe057('0x1a')],function(_0x759bbf){return{'model':db[_0x759bbf[_0xe057('0x1c')]],'as':_0x759bbf['as'],'attributes':_0x759bbf[_0xe057('0x18')],'include':_0x759bbf['include']?_[_0xe057('0x1b')](_0x759bbf[_0xe057('0x1a')],function(_0x1e725f){return{'model':db[_0x1e725f[_0xe057('0x1c')]],'as':_0x1e725f['as'],'attributes':_0x1e725f['attributes'],'include':_0x1e725f['include']?_[_0xe057('0x1b')](_0x1e725f[_0xe057('0x1a')],function(_0xd22a14){return{'model':db[_0xd22a14[_0xe057('0x1c')]],'as':_0xd22a14['as'],'attributes':_0xd22a14[_0xe057('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe057('0xc')](function(_0x5d6cfc){logger[_0xe057('0x1d')](_0xe057('0x1e'),_0x2ccc4c);logger[_0xe057('0xe')](_0xe057('0x1e'),_0x2ccc4c,JSON[_0xe057('0x11')](_0x5d6cfc));_0x18e189(_0x5d6cfc);})[_0xe057('0x1f')](function(_0xacad52){logger[_0xe057('0x12')](_0xe057('0x1e'),_0xacad52['message'],_0x2ccc4c);_0x343fc2(_0x5c1eb9[_0xe057('0x12')](0x1f4,_0xacad52[_0xe057('0x14')]));});});};exports[_0xe057('0x20')]=function(_0x109362){var _0x1b5f61=this;return new Promise(function(_0x56a515,_0xb53cac){return db[_0xe057('0x21')][_0xe057('0x22')]({'raw':_0x109362[_0xe057('0x17')]?_0x109362[_0xe057('0x17')][_0xe057('0x23')]===undefined?!![]:![]:!![],'where':_0x109362[_0xe057('0x17')]?_0x109362[_0xe057('0x17')][_0xe057('0x24')]||null:null,'attributes':_0x109362['options']?_0x109362[_0xe057('0x17')][_0xe057('0x18')]||null:null,'include':_0x109362[_0xe057('0x17')]?_0x109362[_0xe057('0x17')][_0xe057('0x1a')]?_[_0xe057('0x1b')](_0x109362[_0xe057('0x17')][_0xe057('0x1a')],function(_0x1c063e){return{'model':db[_0x1c063e['model']],'as':_0x1c063e['as'],'attributes':_0x1c063e[_0xe057('0x18')],'include':_0x1c063e[_0xe057('0x1a')]?_[_0xe057('0x1b')](_0x1c063e['include'],function(_0x29aeb9){return{'model':db[_0x29aeb9[_0xe057('0x1c')]],'as':_0x29aeb9['as'],'attributes':_0x29aeb9['attributes'],'include':_0x29aeb9[_0xe057('0x1a')]?_[_0xe057('0x1b')](_0x29aeb9['include'],function(_0x268c87){return{'model':db[_0x268c87[_0xe057('0x1c')]],'as':_0x268c87['as'],'attributes':_0x268c87['attributes']};}):[]};}):[]};}):[]:[]})[_0xe057('0xc')](function(_0x108468){logger['info'](_0xe057('0x20'),_0x109362);logger[_0xe057('0xe')](_0xe057('0x20'),_0x109362,JSON[_0xe057('0x11')](_0x108468));_0x56a515(_0x108468);})[_0xe057('0x1f')](function(_0x4a3dad){logger[_0xe057('0x12')](_0xe057('0x20'),_0x4a3dad[_0xe057('0x14')],_0x109362);_0xb53cac(_0x1b5f61[_0xe057('0x12')](0x1f4,_0x4a3dad['message']));});});}; \ No newline at end of file +var _0x2eea=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowSugarcrmAccount','find','stringify','lodash'];(function(_0x2c3635,_0x1fd9dd){var _0x105bb9=function(_0x167ed5){while(--_0x167ed5){_0x2c3635['push'](_0x2c3635['shift']());}};_0x105bb9(++_0x1fd9dd);}(_0x2eea,0x1cd));var _0xa2ee=function(_0x127233,_0x524849){_0x127233=_0x127233-0x0;var _0x9fc50a=_0x2eea[_0x127233];return _0x9fc50a;};'use strict';var _=require(_0xa2ee('0x0'));var util=require('util');var moment=require(_0xa2ee('0x1'));var BPromise=require(_0xa2ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2ee('0x3'));var db=require(_0xa2ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2ee('0x5'))(_0xa2ee('0x6'));var config=require(_0xa2ee('0x7'));var jayson=require(_0xa2ee('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49eb69,_0x23fc27,_0x3895ad){return new BPromise(function(_0x1469c3,_0x13dcc8){return client[_0xa2ee('0x9')](_0x49eb69,_0x3895ad)[_0xa2ee('0xa')](function(_0x7b4d9e){logger[_0xa2ee('0xb')](_0xa2ee('0xc'),_0x23fc27,_0xa2ee('0xd'));logger[_0xa2ee('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x23fc27,_0xa2ee('0xd'),JSON['stringify'](_0x7b4d9e));if(_0x7b4d9e['error']){if(_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x10')]===0x1f4){logger[_0xa2ee('0xf')](_0xa2ee('0xc'),_0x23fc27,_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);return _0x13dcc8(_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);}logger[_0xa2ee('0xf')](_0xa2ee('0xc'),_0x23fc27,_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);return _0x1469c3(_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);}else{logger[_0xa2ee('0xb')](_0xa2ee('0xc'),_0x23fc27,_0xa2ee('0xd'));_0x1469c3(_0x7b4d9e['result'][_0xa2ee('0x11')]);}})['catch'](function(_0x3b4712){logger[_0xa2ee('0xf')](_0xa2ee('0xc'),_0x23fc27,_0x3b4712);_0x13dcc8(_0x3b4712);});});}exports[_0xa2ee('0x12')]=function(_0x53e731){var _0x3bf642=this;return new Promise(function(_0x43d791,_0x50fd7b){return db[_0xa2ee('0x13')][_0xa2ee('0x14')]({'raw':_0x53e731[_0xa2ee('0x15')]?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x16')]===undefined?!![]:![]:!![],'where':_0x53e731[_0xa2ee('0x15')]?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x17')]||null:null,'attributes':_0x53e731[_0xa2ee('0x15')]?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x18')]||null:null,'limit':_0x53e731['options']?_0x53e731['options'][_0xa2ee('0x19')]||null:null,'include':_0x53e731['options']?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x53e731[_0xa2ee('0x15')]['include'],function(_0x26c9bc){return{'model':db[_0x26c9bc['model']],'as':_0x26c9bc['as'],'attributes':_0x26c9bc[_0xa2ee('0x18')],'include':_0x26c9bc[_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x26c9bc[_0xa2ee('0x1a')],function(_0x4f6eb4){return{'model':db[_0x4f6eb4[_0xa2ee('0x1c')]],'as':_0x4f6eb4['as'],'attributes':_0x4f6eb4[_0xa2ee('0x18')],'include':_0x4f6eb4[_0xa2ee('0x1a')]?_['map'](_0x4f6eb4[_0xa2ee('0x1a')],function(_0x44ebf9){return{'model':db[_0x44ebf9[_0xa2ee('0x1c')]],'as':_0x44ebf9['as'],'attributes':_0x44ebf9[_0xa2ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa2ee('0xa')](function(_0x221ef6){logger['info'](_0xa2ee('0x12'),_0x53e731);logger[_0xa2ee('0xe')](_0xa2ee('0x12'),_0x53e731,JSON['stringify'](_0x221ef6));_0x43d791(_0x221ef6);})[_0xa2ee('0x1d')](function(_0x5a012f){logger[_0xa2ee('0xf')](_0xa2ee('0x12'),_0x5a012f[_0xa2ee('0x11')],_0x53e731);_0x50fd7b(_0x3bf642[_0xa2ee('0xf')](0x1f4,_0x5a012f[_0xa2ee('0x11')]));});});};exports[_0xa2ee('0x1e')]=function(_0x5d2b91){var _0x11ce06=this;return new Promise(function(_0x362b1b,_0x1ab2c3){return db[_0xa2ee('0x13')][_0xa2ee('0x1f')]({'raw':_0x5d2b91[_0xa2ee('0x15')]?_0x5d2b91[_0xa2ee('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5d2b91[_0xa2ee('0x15')]?_0x5d2b91[_0xa2ee('0x15')]['where']||null:null,'attributes':_0x5d2b91[_0xa2ee('0x15')]?_0x5d2b91[_0xa2ee('0x15')][_0xa2ee('0x18')]||null:null,'include':_0x5d2b91['options']?_0x5d2b91[_0xa2ee('0x15')][_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x5d2b91[_0xa2ee('0x15')][_0xa2ee('0x1a')],function(_0x2a3d9d){return{'model':db[_0x2a3d9d['model']],'as':_0x2a3d9d['as'],'attributes':_0x2a3d9d[_0xa2ee('0x18')],'include':_0x2a3d9d[_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x2a3d9d[_0xa2ee('0x1a')],function(_0x14100f){return{'model':db[_0x14100f[_0xa2ee('0x1c')]],'as':_0x14100f['as'],'attributes':_0x14100f[_0xa2ee('0x18')],'include':_0x14100f[_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x14100f[_0xa2ee('0x1a')],function(_0x3583b2){return{'model':db[_0x3583b2[_0xa2ee('0x1c')]],'as':_0x3583b2['as'],'attributes':_0x3583b2[_0xa2ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa2ee('0xa')](function(_0xe2fbda){logger[_0xa2ee('0xb')](_0xa2ee('0x1e'),_0x5d2b91);logger[_0xa2ee('0xe')](_0xa2ee('0x1e'),_0x5d2b91,JSON[_0xa2ee('0x20')](_0xe2fbda));_0x362b1b(_0xe2fbda);})[_0xa2ee('0x1d')](function(_0x37f536){logger['error']('ShowSugarcrmAccount',_0x37f536[_0xa2ee('0x11')],_0x5d2b91);_0x1ab2c3(_0x11ce06[_0xa2ee('0xf')](0x1f4,_0x37f536[_0xa2ee('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ae500fc..e6df4f0 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 _0x3c4e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','destroy','exports','multer','path'];(function(_0x21b0f2,_0x306d23){var _0x233277=function(_0x5d9056){while(--_0x5d9056){_0x21b0f2['push'](_0x21b0f2['shift']());}};_0x233277(++_0x306d23);}(_0x3c4e,0x111));var _0xe3c4=function(_0x5bbb51,_0xbc12d3){_0x5bbb51=_0x5bbb51-0x0;var _0x15e45e=_0x3c4e[_0x5bbb51];return _0x15e45e;};'use strict';var multer=require(_0xe3c4('0x0'));var util=require('util');var path=require(_0xe3c4('0x1'));var timeout=require('connect-timeout');var express=require(_0xe3c4('0x2'));var router=express[_0xe3c4('0x3')]();var fs_extra=require(_0xe3c4('0x4'));var auth=require(_0xe3c4('0x5'));var interaction=require(_0xe3c4('0x6'));var config=require(_0xe3c4('0x7'));var controller=require(_0xe3c4('0x8'));router[_0xe3c4('0x9')]('/',auth[_0xe3c4('0xa')](),controller[_0xe3c4('0xb')]);router['get'](_0xe3c4('0xc'),auth[_0xe3c4('0xa')](),controller[_0xe3c4('0xd')]);router[_0xe3c4('0x9')](_0xe3c4('0xe'),auth['isAuthenticated'](),controller[_0xe3c4('0xf')]);router[_0xe3c4('0x9')](_0xe3c4('0x10'),auth['isAuthenticated'](),controller[_0xe3c4('0x11')]);router[_0xe3c4('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe3c4('0x12')]);router[_0xe3c4('0x13')]('/',auth['isAuthenticated'](),controller[_0xe3c4('0x14')]);router['put'](_0xe3c4('0xc'),auth[_0xe3c4('0xa')](),controller[_0xe3c4('0x15')]);router[_0xe3c4('0x16')](_0xe3c4('0xc'),auth[_0xe3c4('0xa')](),controller[_0xe3c4('0x17')]);module[_0xe3c4('0x18')]=router; \ No newline at end of file +var _0x46f6=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x1aa33b,_0x385191){var _0x1cf154=function(_0x3302e1){while(--_0x3302e1){_0x1aa33b['push'](_0x1aa33b['shift']());}};_0x1cf154(++_0x385191);}(_0x46f6,0x1f3));var _0x646f=function(_0x2bcdb6,_0x24e786){_0x2bcdb6=_0x2bcdb6-0x0;var _0x21a3af=_0x46f6[_0x2bcdb6];return _0x21a3af;};'use strict';var multer=require(_0x646f('0x0'));var util=require(_0x646f('0x1'));var path=require(_0x646f('0x2'));var timeout=require(_0x646f('0x3'));var express=require(_0x646f('0x4'));var router=express[_0x646f('0x5')]();var fs_extra=require(_0x646f('0x6'));var auth=require(_0x646f('0x7'));var interaction=require(_0x646f('0x8'));var config=require(_0x646f('0x9'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x646f('0xa')]('/',auth[_0x646f('0xb')](),controller[_0x646f('0xc')]);router[_0x646f('0xa')]('/:id',auth[_0x646f('0xb')](),controller[_0x646f('0xd')]);router['get'](_0x646f('0xe'),auth[_0x646f('0xb')](),controller[_0x646f('0xf')]);router[_0x646f('0xa')]('/:id/subjects',auth[_0x646f('0xb')](),controller[_0x646f('0x10')]);router['get'](_0x646f('0x11'),auth['isAuthenticated'](),controller[_0x646f('0x12')]);router[_0x646f('0x13')]('/',auth['isAuthenticated'](),controller[_0x646f('0x14')]);router[_0x646f('0x15')](_0x646f('0x16'),auth[_0x646f('0xb')](),controller['update']);router[_0x646f('0x17')](_0x646f('0x16'),auth[_0x646f('0xb')](),controller[_0x646f('0x18')]);module[_0x646f('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 23bec70..4174700 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 _0x744a=['sequelize','exports','STRING'];(function(_0x2eb779,_0x1193ab){var _0x1fa827=function(_0x56023f){while(--_0x56023f){_0x2eb779['push'](_0x2eb779['shift']());}};_0x1fa827(++_0x1193ab);}(_0x744a,0x8d));var _0xa744=function(_0x2910bf,_0x491a38){_0x2910bf=_0x2910bf-0x0;var _0x32e73c=_0x744a[_0x2910bf];return _0x32e73c;};'use strict';var Sequelize=require(_0xa744('0x0'));module[_0xa744('0x1')]={'name':{'type':Sequelize[_0xa744('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda36=['exports','STRING'];(function(_0x4f6d57,_0x2138e6){var _0x106f59=function(_0x6ef0db){while(--_0x6ef0db){_0x4f6d57['push'](_0x4f6d57['shift']());}};_0x106f59(++_0x2138e6);}(_0xda36,0x96));var _0x6da3=function(_0x40c262,_0x505c60){_0x40c262=_0x40c262-0x0;var _0x2007dc=_0xda36[_0x40c262];return _0x2007dc;};'use strict';var Sequelize=require('sequelize');module[_0x6da3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6da3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c28f091..8ad61b1 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 _0x61f3=['create','body','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','rows','catch','includeAll','find'];(function(_0x122aa7,_0x496c66){var _0x6e99f4=function(_0x3eb4dd){while(--_0x3eb4dd){_0x122aa7['push'](_0x122aa7['shift']());}};_0x6e99f4(++_0x496c66);}(_0x61f3,0x18e));var _0x361f=function(_0x24cfde,_0x26d8d9){_0x24cfde=_0x24cfde-0x0;var _0xaa88cd=_0x61f3[_0x24cfde];return _0xaa88cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x361f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x361f('0x1'));var rp=require('request-promise');var moment=require(_0x361f('0x2'));var BPromise=require(_0x361f('0x3'));var Mustache=require(_0x361f('0x4'));var util=require(_0x361f('0x5'));var path=require('path');var sox=require(_0x361f('0x6'));var csv=require(_0x361f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x361f('0x8'));var _=require(_0x361f('0x9'));var squel=require(_0x361f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x361f('0xb'));var toCsv=require(_0x361f('0x7'));var querystring=require(_0x361f('0xc'));var Papa=require(_0x361f('0xd'));var Redis=require(_0x361f('0xe'));var authService=require(_0x361f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x361f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x361f('0x11'))('api');var utils=require(_0x361f('0x12'));var config=require(_0x361f('0x13'));var licenseUtil=require(_0x361f('0x14'));var db=require(_0x361f('0x15'))['db'];function respondWithStatusCode(_0x7d6b1d,_0x11e3bd){_0x11e3bd=_0x11e3bd||0xcc;return function(_0x2dbda7){if(_0x2dbda7){return _0x7d6b1d[_0x361f('0x16')](_0x11e3bd);}return _0x7d6b1d[_0x361f('0x17')](_0x11e3bd)[_0x361f('0x18')]();};}function respondWithResult(_0x462883,_0x4a01f5){_0x4a01f5=_0x4a01f5||0xc8;return function(_0x23e0f8){if(_0x23e0f8){return _0x462883[_0x361f('0x17')](_0x4a01f5)[_0x361f('0x19')](_0x23e0f8);}};}function respondWithFilteredResult(_0x438624,_0x288861){return function(_0x363e6e){if(_0x363e6e){var _0x16c09a=typeof _0x288861['offset']===_0x361f('0x1a')&&typeof _0x288861['limit']===_0x361f('0x1a');var _0x2dc662=_0x363e6e[_0x361f('0x1b')];var _0x5bb8fe=_0x16c09a?0x0:_0x288861['offset'];var _0xb06a42=_0x16c09a?_0x363e6e[_0x361f('0x1b')]:_0x288861[_0x361f('0x1c')]+_0x288861[_0x361f('0x1d')];var _0x2bea3e;if(_0xb06a42>=_0x2dc662){_0xb06a42=_0x2dc662;_0x2bea3e=0xc8;}else{_0x2bea3e=0xce;}_0x438624[_0x361f('0x17')](_0x2bea3e);return _0x438624[_0x361f('0x1e')](_0x361f('0x1f'),_0x5bb8fe+'-'+_0xb06a42+'/'+_0x2dc662)['json'](_0x363e6e);}return null;};}function patchUpdates(_0x43c26a){return function(_0x5ae095){try{jsonpatch[_0x361f('0x20')](_0x5ae095,_0x43c26a,!![]);}catch(_0x3eeda6){return BPromise[_0x361f('0x21')](_0x3eeda6);}return _0x5ae095[_0x361f('0x22')]();};}function saveUpdates(_0x443873,_0x1a1ae7){return function(_0x36754d){if(_0x36754d){return _0x36754d[_0x361f('0x23')](_0x443873)[_0x361f('0x24')](function(_0x5a4013){return _0x5a4013;});}return null;};}function removeEntity(_0x53f70f,_0x11bc40){return function(_0x17a7fd){if(_0x17a7fd){return _0x17a7fd[_0x361f('0x25')]()[_0x361f('0x24')](function(){_0x53f70f[_0x361f('0x17')](0xcc)[_0x361f('0x18')]();});}};}function handleEntityNotFound(_0x31391f,_0x58c5aa){return function(_0x1e34ba){if(!_0x1e34ba){_0x31391f[_0x361f('0x16')](0x194);}return _0x1e34ba;};}function handleError(_0x4f6aaf,_0x99f4a7){_0x99f4a7=_0x99f4a7||0x1f4;return function(_0x9e2c23){logger[_0x361f('0x26')](_0x9e2c23[_0x361f('0x27')]);if(_0x9e2c23[_0x361f('0x28')]){delete _0x9e2c23[_0x361f('0x28')];}_0x4f6aaf[_0x361f('0x17')](_0x99f4a7)[_0x361f('0x29')](_0x9e2c23);};}exports[_0x361f('0x2a')]=function(_0x37988b,_0x392454){var _0x4a3a76={},_0x21230f={},_0x148822={'count':0x0,'rows':[]};var _0x2851ad=_[_0x361f('0x2b')](db['SugarcrmConfiguration'][_0x361f('0x2c')],function(_0x355147){return{'name':_0x355147[_0x361f('0x2d')],'type':_0x355147[_0x361f('0x2e')]['key']};});_0x21230f[_0x361f('0x2f')]=_['map'](_0x2851ad,_0x361f('0x28'));_0x21230f['query']=_[_0x361f('0x30')](_0x37988b['query']);_0x21230f[_0x361f('0x31')]=_[_0x361f('0x32')](_0x21230f[_0x361f('0x2f')],_0x21230f[_0x361f('0x33')]);_0x4a3a76[_0x361f('0x34')]=_[_0x361f('0x32')](_0x21230f['model'],qs[_0x361f('0x35')](_0x37988b[_0x361f('0x33')][_0x361f('0x35')]));_0x4a3a76['attributes']=_0x4a3a76[_0x361f('0x34')][_0x361f('0x36')]?_0x4a3a76[_0x361f('0x34')]:_0x21230f[_0x361f('0x2f')];if(!_0x37988b['query'][_0x361f('0x37')](_0x361f('0x38'))){_0x4a3a76[_0x361f('0x1d')]=qs[_0x361f('0x1d')](_0x37988b[_0x361f('0x33')]['limit']);_0x4a3a76[_0x361f('0x1c')]=qs['offset'](_0x37988b[_0x361f('0x33')][_0x361f('0x1c')]);}_0x4a3a76[_0x361f('0x39')]=qs['sort'](_0x37988b[_0x361f('0x33')][_0x361f('0x3a')]);_0x4a3a76[_0x361f('0x3b')]=qs[_0x361f('0x31')](_[_0x361f('0x3c')](_0x37988b['query'],_0x21230f[_0x361f('0x31')]),_0x2851ad);if(_0x37988b[_0x361f('0x33')][_0x361f('0x3d')]){_0x4a3a76['where']=_[_0x361f('0x3e')](_0x4a3a76[_0x361f('0x3b')],{'$or':_[_0x361f('0x2b')](_0x2851ad,function(_0x1f75b7){if(_0x1f75b7[_0x361f('0x2e')]!==_0x361f('0x3f')){var _0x373779={};_0x373779[_0x1f75b7[_0x361f('0x28')]]={'$like':'%'+_0x37988b[_0x361f('0x33')][_0x361f('0x3d')]+'%'};return _0x373779;}})});}_0x4a3a76=_['merge']({},_0x4a3a76,_0x37988b[_0x361f('0x40')]);var _0x28231e={'where':_0x4a3a76['where']};return db['SugarcrmConfiguration'][_0x361f('0x1b')](_0x28231e)[_0x361f('0x24')](function(_0x40f782){_0x148822[_0x361f('0x1b')]=_0x40f782;if(_0x37988b[_0x361f('0x33')]['includeAll']){_0x4a3a76['include']=[{'all':!![]}];}return db[_0x361f('0x41')]['findAll'](_0x4a3a76);})['then'](function(_0x171d66){_0x148822[_0x361f('0x42')]=_0x171d66;return _0x148822;})[_0x361f('0x24')](respondWithFilteredResult(_0x392454,_0x4a3a76))[_0x361f('0x43')](handleError(_0x392454,null));};exports['show']=function(_0x1537a6,_0x481139){var _0x9afb4e={'raw':![],'where':{'id':_0x1537a6['params']['id']}},_0x6d9643={};_0x6d9643['model']=_['keys'](db[_0x361f('0x41')][_0x361f('0x2c')]);_0x6d9643['query']=_[_0x361f('0x30')](_0x1537a6[_0x361f('0x33')]);_0x6d9643[_0x361f('0x31')]=_[_0x361f('0x32')](_0x6d9643[_0x361f('0x2f')],_0x6d9643['query']);_0x9afb4e[_0x361f('0x34')]=_[_0x361f('0x32')](_0x6d9643[_0x361f('0x2f')],qs[_0x361f('0x35')](_0x1537a6[_0x361f('0x33')][_0x361f('0x35')]));_0x9afb4e['attributes']=_0x9afb4e[_0x361f('0x34')][_0x361f('0x36')]?_0x9afb4e[_0x361f('0x34')]:_0x6d9643['model'];if(_0x1537a6[_0x361f('0x33')][_0x361f('0x44')]){_0x9afb4e['include']=[{'all':!![]}];}_0x9afb4e=_[_0x361f('0x3e')]({},_0x9afb4e,_0x1537a6[_0x361f('0x40')]);return db[_0x361f('0x41')][_0x361f('0x45')](_0x9afb4e)[_0x361f('0x24')](handleEntityNotFound(_0x481139,null))[_0x361f('0x24')](respondWithResult(_0x481139,null))[_0x361f('0x43')](handleError(_0x481139,null));};exports['create']=function(_0x5b1334,_0xbb8c46){return db['SugarcrmConfiguration'][_0x361f('0x46')](_0x5b1334[_0x361f('0x47')],{})['then'](respondWithResult(_0xbb8c46,0xc9))[_0x361f('0x43')](handleError(_0xbb8c46,null));};exports[_0x361f('0x23')]=function(_0x391b78,_0x21b342){if(_0x391b78['body']['id']){delete _0x391b78[_0x361f('0x47')]['id'];}return db[_0x361f('0x41')]['find']({'where':{'id':_0x391b78[_0x361f('0x48')]['id']}})['then'](handleEntityNotFound(_0x21b342,null))[_0x361f('0x24')](saveUpdates(_0x391b78['body'],null))[_0x361f('0x24')](respondWithResult(_0x21b342,null))[_0x361f('0x43')](handleError(_0x21b342,null));};exports['destroy']=function(_0x5e4c55,_0x132502){return db['SugarcrmConfiguration'][_0x361f('0x45')]({'where':{'id':_0x5e4c55['params']['id']}})['then'](handleEntityNotFound(_0x132502,null))[_0x361f('0x24')](removeEntity(_0x132502,null))[_0x361f('0x43')](handleError(_0x132502,null));};exports[_0x361f('0x49')]=function(_0x31f424,_0x93e7ea,_0xf4d706){var _0x46480a={};var _0x45ecc2={};var _0xbea637;var _0x46eaf7;return db['SugarcrmConfiguration'][_0x361f('0x4a')]({'where':{'id':_0x31f424[_0x361f('0x48')]['id']}})[_0x361f('0x24')](handleEntityNotFound(_0x93e7ea,null))[_0x361f('0x24')](function(_0x1df4c9){if(_0x1df4c9){_0xbea637=_0x1df4c9;_0x45ecc2[_0x361f('0x2f')]=_[_0x361f('0x30')](db[_0x361f('0x4b')]['rawAttributes']);_0x45ecc2[_0x361f('0x33')]=_['keys'](_0x31f424['query']);_0x45ecc2['filters']=_[_0x361f('0x32')](_0x45ecc2['model'],_0x45ecc2['query']);_0x46480a[_0x361f('0x34')]=_[_0x361f('0x32')](_0x45ecc2[_0x361f('0x2f')],qs[_0x361f('0x35')](_0x31f424[_0x361f('0x33')][_0x361f('0x35')]));_0x46480a[_0x361f('0x34')]=_0x46480a[_0x361f('0x34')][_0x361f('0x36')]?_0x46480a[_0x361f('0x34')]:_0x45ecc2['model'];_0x46480a['order']=qs['sort'](_0x31f424[_0x361f('0x33')]['sort']);_0x46480a[_0x361f('0x3b')]=qs[_0x361f('0x31')](_[_0x361f('0x3c')](_0x31f424[_0x361f('0x33')],_0x45ecc2[_0x361f('0x31')]));if(_0x31f424[_0x361f('0x33')]['filter']){_0x46480a[_0x361f('0x3b')]=_[_0x361f('0x3e')](_0x46480a[_0x361f('0x3b')],{'$or':_[_0x361f('0x2b')](_0x46480a[_0x361f('0x34')],function(_0x472527){var _0x131990={};_0x131990[_0x472527]={'$like':'%'+_0x31f424['query'][_0x361f('0x3d')]+'%'};return _0x131990;})});}_0x46480a=_[_0x361f('0x3e')]({},_0x46480a,_0x31f424[_0x361f('0x40')]);return _0xbea637[_0x361f('0x49')](_0x46480a);}})['then'](function(_0x1a9e63){if(_0x1a9e63){_0x46eaf7=_0x1a9e63[_0x361f('0x36')];if(!_0x31f424[_0x361f('0x33')]['hasOwnProperty'](_0x361f('0x38'))){_0x46480a[_0x361f('0x1d')]=qs[_0x361f('0x1d')](_0x31f424[_0x361f('0x33')][_0x361f('0x1d')]);_0x46480a[_0x361f('0x1c')]=qs['offset'](_0x31f424['query'][_0x361f('0x1c')]);}return _0xbea637[_0x361f('0x49')](_0x46480a);}})[_0x361f('0x24')](function(_0x15460d){if(_0x15460d){return _0x15460d?{'count':_0x46eaf7,'rows':_0x15460d}:null;}})[_0x361f('0x24')](respondWithResult(_0x93e7ea,null))[_0x361f('0x43')](handleError(_0x93e7ea,null));};exports[_0x361f('0x4c')]=function(_0x4632ea,_0x44f2ed,_0x2343eb){var _0x5cf332={};var _0x152ba7={};var _0xe179a5;var _0x2d35d4;return db['SugarcrmConfiguration'][_0x361f('0x4a')]({'where':{'id':_0x4632ea[_0x361f('0x48')]['id']}})[_0x361f('0x24')](handleEntityNotFound(_0x44f2ed,null))[_0x361f('0x24')](function(_0x4d4bfe){if(_0x4d4bfe){_0xe179a5=_0x4d4bfe;_0x152ba7[_0x361f('0x2f')]=_[_0x361f('0x30')](db[_0x361f('0x4b')][_0x361f('0x2c')]);_0x152ba7['query']=_[_0x361f('0x30')](_0x4632ea[_0x361f('0x33')]);_0x152ba7[_0x361f('0x31')]=_['intersection'](_0x152ba7[_0x361f('0x2f')],_0x152ba7['query']);_0x5cf332[_0x361f('0x34')]=_[_0x361f('0x32')](_0x152ba7['model'],qs['fields'](_0x4632ea['query'][_0x361f('0x35')]));_0x5cf332['attributes']=_0x5cf332['attributes']['length']?_0x5cf332[_0x361f('0x34')]:_0x152ba7['model'];_0x5cf332['order']=qs[_0x361f('0x3a')](_0x4632ea[_0x361f('0x33')][_0x361f('0x3a')]);_0x5cf332[_0x361f('0x3b')]=qs[_0x361f('0x31')](_[_0x361f('0x3c')](_0x4632ea[_0x361f('0x33')],_0x152ba7[_0x361f('0x31')]));if(_0x4632ea[_0x361f('0x33')]['filter']){_0x5cf332['where']=_['merge'](_0x5cf332['where'],{'$or':_['map'](_0x5cf332['attributes'],function(_0x52c52f){var _0x895ce2={};_0x895ce2[_0x52c52f]={'$like':'%'+_0x4632ea['query'][_0x361f('0x3d')]+'%'};return _0x895ce2;})});}_0x5cf332=_[_0x361f('0x3e')]({},_0x5cf332,_0x4632ea[_0x361f('0x40')]);return _0xe179a5[_0x361f('0x4c')](_0x5cf332);}})[_0x361f('0x24')](function(_0x349f93){if(_0x349f93){_0x2d35d4=_0x349f93['length'];if(!_0x4632ea[_0x361f('0x33')][_0x361f('0x37')](_0x361f('0x38'))){_0x5cf332[_0x361f('0x1d')]=qs[_0x361f('0x1d')](_0x4632ea['query']['limit']);_0x5cf332['offset']=qs[_0x361f('0x1c')](_0x4632ea[_0x361f('0x33')][_0x361f('0x1c')]);}return _0xe179a5[_0x361f('0x4c')](_0x5cf332);}})['then'](function(_0x11ab67){if(_0x11ab67){return _0x11ab67?{'count':_0x2d35d4,'rows':_0x11ab67}:null;}})[_0x361f('0x24')](respondWithResult(_0x44f2ed,null))[_0x361f('0x43')](handleError(_0x44f2ed,null));};exports[_0x361f('0x4d')]=function(_0x3d010c,_0x3a2af7,_0x1f7533){var _0x55966c={};var _0xff7607={};var _0x18f34f;var _0x5b9491;return db[_0x361f('0x41')]['findOne']({'where':{'id':_0x3d010c[_0x361f('0x48')]['id']}})[_0x361f('0x24')](handleEntityNotFound(_0x3a2af7,null))[_0x361f('0x24')](function(_0x39ce5f){if(_0x39ce5f){_0x18f34f=_0x39ce5f;_0xff7607[_0x361f('0x2f')]=_[_0x361f('0x30')](db['SugarcrmField'][_0x361f('0x2c')]);_0xff7607[_0x361f('0x33')]=_[_0x361f('0x30')](_0x3d010c[_0x361f('0x33')]);_0xff7607[_0x361f('0x31')]=_[_0x361f('0x32')](_0xff7607[_0x361f('0x2f')],_0xff7607[_0x361f('0x33')]);_0x55966c[_0x361f('0x34')]=_[_0x361f('0x32')](_0xff7607['model'],qs[_0x361f('0x35')](_0x3d010c[_0x361f('0x33')][_0x361f('0x35')]));_0x55966c[_0x361f('0x34')]=_0x55966c[_0x361f('0x34')][_0x361f('0x36')]?_0x55966c[_0x361f('0x34')]:_0xff7607[_0x361f('0x2f')];_0x55966c['order']=qs[_0x361f('0x3a')](_0x3d010c[_0x361f('0x33')][_0x361f('0x3a')]);_0x55966c[_0x361f('0x3b')]=qs[_0x361f('0x31')](_[_0x361f('0x3c')](_0x3d010c[_0x361f('0x33')],_0xff7607['filters']));if(_0x3d010c[_0x361f('0x33')]['filter']){_0x55966c[_0x361f('0x3b')]=_['merge'](_0x55966c[_0x361f('0x3b')],{'$or':_['map'](_0x55966c['attributes'],function(_0x592c0){var _0x4696bb={};_0x4696bb[_0x592c0]={'$like':'%'+_0x3d010c[_0x361f('0x33')][_0x361f('0x3d')]+'%'};return _0x4696bb;})});}_0x55966c=_['merge']({},_0x55966c,_0x3d010c['options']);return _0x18f34f[_0x361f('0x4d')](_0x55966c);}})[_0x361f('0x24')](function(_0x5e25e0){if(_0x5e25e0){_0x5b9491=_0x5e25e0[_0x361f('0x36')];if(!_0x3d010c['query'][_0x361f('0x37')](_0x361f('0x38'))){_0x55966c[_0x361f('0x1d')]=qs['limit'](_0x3d010c[_0x361f('0x33')]['limit']);_0x55966c[_0x361f('0x1c')]=qs[_0x361f('0x1c')](_0x3d010c[_0x361f('0x33')][_0x361f('0x1c')]);}return _0x18f34f[_0x361f('0x4d')](_0x55966c);}})[_0x361f('0x24')](function(_0x10b0ff){if(_0x10b0ff){return _0x10b0ff?{'count':_0x5b9491,'rows':_0x10b0ff}:null;}})[_0x361f('0x24')](respondWithResult(_0x3a2af7,null))['catch'](handleError(_0x3a2af7,null));}; \ No newline at end of file +var _0x41b9=['create','body','find','getFields','findOne','SugarcrmField','order','getSubjects','getDescriptions','eml-format','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x9cf0e3,_0x498d08){var _0x5565c5=function(_0xa93503){while(--_0xa93503){_0x9cf0e3['push'](_0x9cf0e3['shift']());}};_0x5565c5(++_0x498d08);}(_0x41b9,0x149));var _0x941b=function(_0x1add02,_0x47e989){_0x1add02=_0x1add02-0x0;var _0x31e89f=_0x41b9[_0x1add02];return _0x31e89f;};'use strict';var emlformat=require(_0x941b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x941b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x941b('0x2'));var path=require(_0x941b('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x941b('0x4'));var fs=require('fs');var fs_extra=require(_0x941b('0x5'));var _=require(_0x941b('0x6'));var squel=require(_0x941b('0x7'));var crypto=require(_0x941b('0x8'));var jsforce=require(_0x941b('0x9'));var deskjs=require(_0x941b('0xa'));var toCsv=require(_0x941b('0xb'));var querystring=require(_0x941b('0xc'));var Papa=require(_0x941b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x941b('0xe'));var hardwareService=require(_0x941b('0xf'));var logger=require(_0x941b('0x10'))(_0x941b('0x11'));var utils=require(_0x941b('0x12'));var config=require(_0x941b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x941b('0x14'))['db'];function respondWithStatusCode(_0x577d2e,_0x44844a){_0x44844a=_0x44844a||0xcc;return function(_0x19f2dc){if(_0x19f2dc){return _0x577d2e[_0x941b('0x15')](_0x44844a);}return _0x577d2e[_0x941b('0x16')](_0x44844a)['end']();};}function respondWithResult(_0x32f37c,_0x37dfa2){_0x37dfa2=_0x37dfa2||0xc8;return function(_0x5ecba0){if(_0x5ecba0){return _0x32f37c[_0x941b('0x16')](_0x37dfa2)[_0x941b('0x17')](_0x5ecba0);}};}function respondWithFilteredResult(_0x2fbe5a,_0x1e1fb6){return function(_0x5ab07e){if(_0x5ab07e){var _0x5a64a5=typeof _0x1e1fb6[_0x941b('0x18')]==='undefined'&&typeof _0x1e1fb6[_0x941b('0x19')]===_0x941b('0x1a');var _0x435b27=_0x5ab07e[_0x941b('0x1b')];var _0x2e741b=_0x5a64a5?0x0:_0x1e1fb6['offset'];var _0x341297=_0x5a64a5?_0x5ab07e['count']:_0x1e1fb6[_0x941b('0x18')]+_0x1e1fb6[_0x941b('0x19')];var _0x47f496;if(_0x341297>=_0x435b27){_0x341297=_0x435b27;_0x47f496=0xc8;}else{_0x47f496=0xce;}_0x2fbe5a[_0x941b('0x16')](_0x47f496);return _0x2fbe5a['set'](_0x941b('0x1c'),_0x2e741b+'-'+_0x341297+'/'+_0x435b27)[_0x941b('0x17')](_0x5ab07e);}return null;};}function patchUpdates(_0x4abd3e){return function(_0x52f288){try{jsonpatch[_0x941b('0x1d')](_0x52f288,_0x4abd3e,!![]);}catch(_0x522696){return BPromise[_0x941b('0x1e')](_0x522696);}return _0x52f288[_0x941b('0x1f')]();};}function saveUpdates(_0x2c5305,_0x5977f9){return function(_0x5ecfe9){if(_0x5ecfe9){return _0x5ecfe9[_0x941b('0x20')](_0x2c5305)[_0x941b('0x21')](function(_0xe7e7e3){return _0xe7e7e3;});}return null;};}function removeEntity(_0x3b93f4,_0x10621d){return function(_0x4ab34e){if(_0x4ab34e){return _0x4ab34e[_0x941b('0x22')]()[_0x941b('0x21')](function(){_0x3b93f4[_0x941b('0x16')](0xcc)[_0x941b('0x23')]();});}};}function handleEntityNotFound(_0x2dcb3e,_0x193e65){return function(_0x596ec8){if(!_0x596ec8){_0x2dcb3e[_0x941b('0x15')](0x194);}return _0x596ec8;};}function handleError(_0x7f8175,_0x422425){_0x422425=_0x422425||0x1f4;return function(_0x44cac1){logger[_0x941b('0x24')](_0x44cac1[_0x941b('0x25')]);if(_0x44cac1['name']){delete _0x44cac1[_0x941b('0x26')];}_0x7f8175[_0x941b('0x16')](_0x422425)[_0x941b('0x27')](_0x44cac1);};}exports[_0x941b('0x28')]=function(_0x5e16b8,_0x277a81){var _0x5a9a1d={},_0x216223={},_0x205917={'count':0x0,'rows':[]};var _0x2ecf15=_[_0x941b('0x29')](db[_0x941b('0x2a')]['rawAttributes'],function(_0x48b013){return{'name':_0x48b013[_0x941b('0x2b')],'type':_0x48b013[_0x941b('0x2c')][_0x941b('0x2d')]};});_0x216223[_0x941b('0x2e')]=_['map'](_0x2ecf15,'name');_0x216223[_0x941b('0x2f')]=_[_0x941b('0x30')](_0x5e16b8['query']);_0x216223[_0x941b('0x31')]=_[_0x941b('0x32')](_0x216223[_0x941b('0x2e')],_0x216223[_0x941b('0x2f')]);_0x5a9a1d[_0x941b('0x33')]=_[_0x941b('0x32')](_0x216223['model'],qs[_0x941b('0x34')](_0x5e16b8[_0x941b('0x2f')]['fields']));_0x5a9a1d[_0x941b('0x33')]=_0x5a9a1d[_0x941b('0x33')][_0x941b('0x35')]?_0x5a9a1d[_0x941b('0x33')]:_0x216223[_0x941b('0x2e')];if(!_0x5e16b8['query'][_0x941b('0x36')](_0x941b('0x37'))){_0x5a9a1d[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x5e16b8['query']['limit']);_0x5a9a1d['offset']=qs[_0x941b('0x18')](_0x5e16b8['query'][_0x941b('0x18')]);}_0x5a9a1d['order']=qs[_0x941b('0x38')](_0x5e16b8[_0x941b('0x2f')][_0x941b('0x38')]);_0x5a9a1d[_0x941b('0x39')]=qs[_0x941b('0x31')](_[_0x941b('0x3a')](_0x5e16b8['query'],_0x216223['filters']),_0x2ecf15);if(_0x5e16b8[_0x941b('0x2f')][_0x941b('0x3b')]){_0x5a9a1d['where']=_['merge'](_0x5a9a1d[_0x941b('0x39')],{'$or':_['map'](_0x2ecf15,function(_0x4f64d9){if(_0x4f64d9[_0x941b('0x2c')]!==_0x941b('0x3c')){var _0x15fa2b={};_0x15fa2b[_0x4f64d9[_0x941b('0x26')]]={'$like':'%'+_0x5e16b8[_0x941b('0x2f')][_0x941b('0x3b')]+'%'};return _0x15fa2b;}})});}_0x5a9a1d=_[_0x941b('0x3d')]({},_0x5a9a1d,_0x5e16b8[_0x941b('0x3e')]);var _0x52e56c={'where':_0x5a9a1d[_0x941b('0x39')]};return db[_0x941b('0x2a')][_0x941b('0x1b')](_0x52e56c)[_0x941b('0x21')](function(_0x4eb1ba){_0x205917[_0x941b('0x1b')]=_0x4eb1ba;if(_0x5e16b8[_0x941b('0x2f')][_0x941b('0x3f')]){_0x5a9a1d[_0x941b('0x40')]=[{'all':!![]}];}return db[_0x941b('0x2a')][_0x941b('0x41')](_0x5a9a1d);})[_0x941b('0x21')](function(_0x7cc12d){_0x205917[_0x941b('0x42')]=_0x7cc12d;return _0x205917;})[_0x941b('0x21')](respondWithFilteredResult(_0x277a81,_0x5a9a1d))[_0x941b('0x43')](handleError(_0x277a81,null));};exports[_0x941b('0x44')]=function(_0x63ca2,_0x3280de){var _0x858776={'raw':![],'where':{'id':_0x63ca2[_0x941b('0x45')]['id']}},_0x3c900f={};_0x3c900f[_0x941b('0x2e')]=_[_0x941b('0x30')](db[_0x941b('0x2a')][_0x941b('0x46')]);_0x3c900f[_0x941b('0x2f')]=_['keys'](_0x63ca2[_0x941b('0x2f')]);_0x3c900f[_0x941b('0x31')]=_[_0x941b('0x32')](_0x3c900f[_0x941b('0x2e')],_0x3c900f['query']);_0x858776[_0x941b('0x33')]=_[_0x941b('0x32')](_0x3c900f[_0x941b('0x2e')],qs[_0x941b('0x34')](_0x63ca2[_0x941b('0x2f')][_0x941b('0x34')]));_0x858776[_0x941b('0x33')]=_0x858776[_0x941b('0x33')][_0x941b('0x35')]?_0x858776[_0x941b('0x33')]:_0x3c900f[_0x941b('0x2e')];if(_0x63ca2[_0x941b('0x2f')][_0x941b('0x3f')]){_0x858776[_0x941b('0x40')]=[{'all':!![]}];}_0x858776=_[_0x941b('0x3d')]({},_0x858776,_0x63ca2[_0x941b('0x3e')]);return db[_0x941b('0x2a')]['find'](_0x858776)[_0x941b('0x21')](handleEntityNotFound(_0x3280de,null))[_0x941b('0x21')](respondWithResult(_0x3280de,null))['catch'](handleError(_0x3280de,null));};exports[_0x941b('0x47')]=function(_0x3c2572,_0x41382a){return db[_0x941b('0x2a')]['create'](_0x3c2572[_0x941b('0x48')],{})[_0x941b('0x21')](respondWithResult(_0x41382a,0xc9))[_0x941b('0x43')](handleError(_0x41382a,null));};exports['update']=function(_0x5c1795,_0x5ad299){if(_0x5c1795[_0x941b('0x48')]['id']){delete _0x5c1795[_0x941b('0x48')]['id'];}return db[_0x941b('0x2a')][_0x941b('0x49')]({'where':{'id':_0x5c1795[_0x941b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ad299,null))[_0x941b('0x21')](saveUpdates(_0x5c1795[_0x941b('0x48')],null))[_0x941b('0x21')](respondWithResult(_0x5ad299,null))[_0x941b('0x43')](handleError(_0x5ad299,null));};exports[_0x941b('0x22')]=function(_0x452d6c,_0x3cd4d0){return db[_0x941b('0x2a')][_0x941b('0x49')]({'where':{'id':_0x452d6c[_0x941b('0x45')]['id']}})[_0x941b('0x21')](handleEntityNotFound(_0x3cd4d0,null))[_0x941b('0x21')](removeEntity(_0x3cd4d0,null))['catch'](handleError(_0x3cd4d0,null));};exports[_0x941b('0x4a')]=function(_0x4872e0,_0xe27168,_0x2fcb1b){var _0x649ff8={};var _0x171476={};var _0x10c4b8;var _0x373951;return db['SugarcrmConfiguration'][_0x941b('0x4b')]({'where':{'id':_0x4872e0['params']['id']}})[_0x941b('0x21')](handleEntityNotFound(_0xe27168,null))[_0x941b('0x21')](function(_0x347a51){if(_0x347a51){_0x10c4b8=_0x347a51;_0x171476[_0x941b('0x2e')]=_[_0x941b('0x30')](db[_0x941b('0x4c')][_0x941b('0x46')]);_0x171476[_0x941b('0x2f')]=_[_0x941b('0x30')](_0x4872e0[_0x941b('0x2f')]);_0x171476['filters']=_[_0x941b('0x32')](_0x171476[_0x941b('0x2e')],_0x171476[_0x941b('0x2f')]);_0x649ff8['attributes']=_[_0x941b('0x32')](_0x171476[_0x941b('0x2e')],qs[_0x941b('0x34')](_0x4872e0['query']['fields']));_0x649ff8[_0x941b('0x33')]=_0x649ff8[_0x941b('0x33')]['length']?_0x649ff8[_0x941b('0x33')]:_0x171476[_0x941b('0x2e')];_0x649ff8[_0x941b('0x4d')]=qs['sort'](_0x4872e0[_0x941b('0x2f')][_0x941b('0x38')]);_0x649ff8[_0x941b('0x39')]=qs[_0x941b('0x31')](_[_0x941b('0x3a')](_0x4872e0['query'],_0x171476[_0x941b('0x31')]));if(_0x4872e0[_0x941b('0x2f')][_0x941b('0x3b')]){_0x649ff8[_0x941b('0x39')]=_[_0x941b('0x3d')](_0x649ff8[_0x941b('0x39')],{'$or':_[_0x941b('0x29')](_0x649ff8[_0x941b('0x33')],function(_0x469291){var _0x354a6e={};_0x354a6e[_0x469291]={'$like':'%'+_0x4872e0[_0x941b('0x2f')][_0x941b('0x3b')]+'%'};return _0x354a6e;})});}_0x649ff8=_[_0x941b('0x3d')]({},_0x649ff8,_0x4872e0[_0x941b('0x3e')]);return _0x10c4b8[_0x941b('0x4a')](_0x649ff8);}})[_0x941b('0x21')](function(_0x2f1c02){if(_0x2f1c02){_0x373951=_0x2f1c02[_0x941b('0x35')];if(!_0x4872e0[_0x941b('0x2f')][_0x941b('0x36')](_0x941b('0x37'))){_0x649ff8[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x4872e0[_0x941b('0x2f')]['limit']);_0x649ff8[_0x941b('0x18')]=qs[_0x941b('0x18')](_0x4872e0[_0x941b('0x2f')][_0x941b('0x18')]);}return _0x10c4b8[_0x941b('0x4a')](_0x649ff8);}})[_0x941b('0x21')](function(_0x5c5ca4){if(_0x5c5ca4){return _0x5c5ca4?{'count':_0x373951,'rows':_0x5c5ca4}:null;}})[_0x941b('0x21')](respondWithResult(_0xe27168,null))[_0x941b('0x43')](handleError(_0xe27168,null));};exports[_0x941b('0x4e')]=function(_0x5bfaa2,_0x57d661,_0x2186b5){var _0x17d255={};var _0x317654={};var _0x2c0451;var _0x54b147;return db[_0x941b('0x2a')][_0x941b('0x4b')]({'where':{'id':_0x5bfaa2[_0x941b('0x45')]['id']}})[_0x941b('0x21')](handleEntityNotFound(_0x57d661,null))['then'](function(_0x775600){if(_0x775600){_0x2c0451=_0x775600;_0x317654[_0x941b('0x2e')]=_[_0x941b('0x30')](db[_0x941b('0x4c')][_0x941b('0x46')]);_0x317654[_0x941b('0x2f')]=_[_0x941b('0x30')](_0x5bfaa2[_0x941b('0x2f')]);_0x317654[_0x941b('0x31')]=_[_0x941b('0x32')](_0x317654[_0x941b('0x2e')],_0x317654['query']);_0x17d255[_0x941b('0x33')]=_['intersection'](_0x317654['model'],qs[_0x941b('0x34')](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x34')]));_0x17d255['attributes']=_0x17d255[_0x941b('0x33')][_0x941b('0x35')]?_0x17d255[_0x941b('0x33')]:_0x317654['model'];_0x17d255[_0x941b('0x4d')]=qs[_0x941b('0x38')](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x38')]);_0x17d255[_0x941b('0x39')]=qs[_0x941b('0x31')](_['pick'](_0x5bfaa2['query'],_0x317654['filters']));if(_0x5bfaa2[_0x941b('0x2f')]['filter']){_0x17d255['where']=_[_0x941b('0x3d')](_0x17d255[_0x941b('0x39')],{'$or':_[_0x941b('0x29')](_0x17d255[_0x941b('0x33')],function(_0x10b2ea){var _0x2ca301={};_0x2ca301[_0x10b2ea]={'$like':'%'+_0x5bfaa2[_0x941b('0x2f')]['filter']+'%'};return _0x2ca301;})});}_0x17d255=_[_0x941b('0x3d')]({},_0x17d255,_0x5bfaa2[_0x941b('0x3e')]);return _0x2c0451[_0x941b('0x4e')](_0x17d255);}})[_0x941b('0x21')](function(_0x237bed){if(_0x237bed){_0x54b147=_0x237bed['length'];if(!_0x5bfaa2[_0x941b('0x2f')]['hasOwnProperty'](_0x941b('0x37'))){_0x17d255[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x19')]);_0x17d255['offset']=qs['offset'](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x18')]);}return _0x2c0451[_0x941b('0x4e')](_0x17d255);}})['then'](function(_0x322961){if(_0x322961){return _0x322961?{'count':_0x54b147,'rows':_0x322961}:null;}})[_0x941b('0x21')](respondWithResult(_0x57d661,null))[_0x941b('0x43')](handleError(_0x57d661,null));};exports[_0x941b('0x4f')]=function(_0x489c6c,_0x1334a1,_0x5ed98f){var _0x4f5190={};var _0x5e67ba={};var _0x5a807f;var _0x30aa00;return db['SugarcrmConfiguration'][_0x941b('0x4b')]({'where':{'id':_0x489c6c[_0x941b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1334a1,null))['then'](function(_0x16450a){if(_0x16450a){_0x5a807f=_0x16450a;_0x5e67ba[_0x941b('0x2e')]=_[_0x941b('0x30')](db['SugarcrmField'][_0x941b('0x46')]);_0x5e67ba['query']=_[_0x941b('0x30')](_0x489c6c['query']);_0x5e67ba[_0x941b('0x31')]=_['intersection'](_0x5e67ba[_0x941b('0x2e')],_0x5e67ba['query']);_0x4f5190['attributes']=_[_0x941b('0x32')](_0x5e67ba[_0x941b('0x2e')],qs[_0x941b('0x34')](_0x489c6c['query'][_0x941b('0x34')]));_0x4f5190[_0x941b('0x33')]=_0x4f5190['attributes']['length']?_0x4f5190['attributes']:_0x5e67ba[_0x941b('0x2e')];_0x4f5190[_0x941b('0x4d')]=qs[_0x941b('0x38')](_0x489c6c[_0x941b('0x2f')]['sort']);_0x4f5190[_0x941b('0x39')]=qs[_0x941b('0x31')](_[_0x941b('0x3a')](_0x489c6c[_0x941b('0x2f')],_0x5e67ba[_0x941b('0x31')]));if(_0x489c6c[_0x941b('0x2f')][_0x941b('0x3b')]){_0x4f5190[_0x941b('0x39')]=_[_0x941b('0x3d')](_0x4f5190[_0x941b('0x39')],{'$or':_[_0x941b('0x29')](_0x4f5190[_0x941b('0x33')],function(_0x5e5e50){var _0x5e5f9c={};_0x5e5f9c[_0x5e5e50]={'$like':'%'+_0x489c6c['query']['filter']+'%'};return _0x5e5f9c;})});}_0x4f5190=_['merge']({},_0x4f5190,_0x489c6c[_0x941b('0x3e')]);return _0x5a807f[_0x941b('0x4f')](_0x4f5190);}})[_0x941b('0x21')](function(_0x3f2d69){if(_0x3f2d69){_0x30aa00=_0x3f2d69['length'];if(!_0x489c6c[_0x941b('0x2f')][_0x941b('0x36')]('nolimit')){_0x4f5190[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x489c6c[_0x941b('0x2f')][_0x941b('0x19')]);_0x4f5190[_0x941b('0x18')]=qs[_0x941b('0x18')](_0x489c6c[_0x941b('0x2f')][_0x941b('0x18')]);}return _0x5a807f[_0x941b('0x4f')](_0x4f5190);}})[_0x941b('0x21')](function(_0x32efa8){if(_0x32efa8){return _0x32efa8?{'count':_0x30aa00,'rows':_0x32efa8}:null;}})[_0x941b('0x21')](respondWithResult(_0x1334a1,null))['catch'](handleError(_0x1334a1,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 758b16e..0804570 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 _0xc4d3=['./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c55d1,_0x558f3d){var _0x5de2dd=function(_0x41e660){while(--_0x41e660){_0x2c55d1['push'](_0x2c55d1['shift']());}};_0x5de2dd(++_0x558f3d);}(_0xc4d3,0xb8));var _0x3c4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4d3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c4d('0x0'));var util=require(_0x3c4d('0x1'));var logger=require('../../config/logger')(_0x3c4d('0x2'));var moment=require('moment');var BPromise=require(_0x3c4d('0x3'));var rp=require(_0x3c4d('0x4'));var fs=require('fs');var path=require(_0x3c4d('0x5'));var rimraf=require(_0x3c4d('0x6'));var config=require(_0x3c4d('0x7'));var attributes=require(_0x3c4d('0x8'));module[_0x3c4d('0x9')]=function(_0x513f5f,_0x47fdf5){return _0x513f5f[_0x3c4d('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x3c4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe5b=['path','rimraf','../../config/environment','exports','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','moment','bluebird'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0xbe5b,0x128));var _0xbbe5=function(_0x2a9658,_0x5c1815){_0x2a9658=_0x2a9658-0x0;var _0x183403=_0xbe5b[_0x2a9658];return _0x183403;};'use strict';var _=require('lodash');var util=require(_0xbbe5('0x0'));var logger=require(_0xbbe5('0x1'))('api');var moment=require(_0xbbe5('0x2'));var BPromise=require(_0xbbe5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbe5('0x4'));var rimraf=require(_0xbbe5('0x5'));var config=require(_0xbbe5('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xbbe5('0x7')]=function(_0x5c4290,_0x11ceb0){return _0x5c4290['define'](_0xbbe5('0x8'),attributes,{'tableName':_0xbbe5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 5b59c62..e631535 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 _0xd083=['../../config/logger','../../config/environment','http','request','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd083,0x1b0));var _0x3d08=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0xd083[_0x47d6dc];return _0x1a1c93;};'use strict';var _=require(_0x3d08('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d08('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d08('0x2'));var db=require(_0x3d08('0x3'))['db'];var utils=require(_0x3d08('0x4'));var logger=require(_0x3d08('0x5'))('rpc');var config=require(_0x3d08('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3d08('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x12b62c,_0x72e0c7,_0x1f3082){return new BPromise(function(_0x56825d,_0x51a461){return client[_0x3d08('0x8')](_0x12b62c,_0x1f3082)['then'](function(_0x168708){logger[_0x3d08('0x9')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x72e0c7,'request\x20sent');logger[_0x3d08('0xa')](_0x3d08('0xb'),_0x72e0c7,_0x3d08('0xc'),JSON[_0x3d08('0xd')](_0x168708));if(_0x168708['error']){if(_0x168708[_0x3d08('0xe')]['code']===0x1f4){logger['error'](_0x3d08('0xf'),_0x72e0c7,_0x168708[_0x3d08('0xe')][_0x3d08('0x10')]);return _0x51a461(_0x168708[_0x3d08('0xe')]['message']);}logger[_0x3d08('0xe')](_0x3d08('0xf'),_0x72e0c7,_0x168708[_0x3d08('0xe')][_0x3d08('0x10')]);return _0x56825d(_0x168708['error'][_0x3d08('0x10')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x72e0c7,_0x3d08('0xc'));_0x56825d(_0x168708[_0x3d08('0x11')]['message']);}})[_0x3d08('0x12')](function(_0x5dd22e){logger[_0x3d08('0xe')](_0x3d08('0xf'),_0x72e0c7,_0x5dd22e);_0x51a461(_0x5dd22e);});});} \ No newline at end of file +var _0x30f1=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xe95a40,_0x4ce3ea){var _0x5684b8=function(_0x5d85c4){while(--_0x5d85c4){_0xe95a40['push'](_0xe95a40['shift']());}};_0x5684b8(++_0x4ce3ea);}(_0x30f1,0x192));var _0x130f=function(_0x23cefc,_0xf5204d){_0x23cefc=_0x23cefc-0x0;var _0x396b88=_0x30f1[_0x23cefc];return _0x396b88;};'use strict';var _=require(_0x130f('0x0'));var util=require(_0x130f('0x1'));var moment=require(_0x130f('0x2'));var BPromise=require(_0x130f('0x3'));var rs=require(_0x130f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x130f('0x5'))['db'];var utils=require(_0x130f('0x6'));var logger=require(_0x130f('0x7'))(_0x130f('0x8'));var config=require('../../config/environment');var jayson=require(_0x130f('0x9'));var client=jayson[_0x130f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e164f,_0x1a7b0b,_0x4c55dc){return new BPromise(function(_0x2b7a99,_0x1a996c){return client['request'](_0x2e164f,_0x4c55dc)[_0x130f('0xb')](function(_0x529342){logger['info'](_0x130f('0xc'),_0x1a7b0b,_0x130f('0xd'));logger['debug'](_0x130f('0xe'),_0x1a7b0b,_0x130f('0xd'),JSON['stringify'](_0x529342));if(_0x529342[_0x130f('0xf')]){if(_0x529342[_0x130f('0xf')][_0x130f('0x10')]===0x1f4){logger[_0x130f('0xf')](_0x130f('0xc'),_0x1a7b0b,_0x529342[_0x130f('0xf')][_0x130f('0x11')]);return _0x1a996c(_0x529342['error'][_0x130f('0x11')]);}logger[_0x130f('0xf')](_0x130f('0xc'),_0x1a7b0b,_0x529342[_0x130f('0xf')][_0x130f('0x11')]);return _0x2b7a99(_0x529342[_0x130f('0xf')][_0x130f('0x11')]);}else{logger[_0x130f('0x12')](_0x130f('0xc'),_0x1a7b0b,'request\x20sent');_0x2b7a99(_0x529342[_0x130f('0x13')]['message']);}})[_0x130f('0x14')](function(_0x3bae03){logger[_0x130f('0xf')](_0x130f('0xc'),_0x1a7b0b,_0x3bae03);_0x1a996c(_0x3bae03);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f638aa2..c3a5276 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 _0x6394=['put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1235b3,_0x2ca5af){var _0x23a69a=function(_0x1ec09c){while(--_0x1ec09c){_0x1235b3['push'](_0x1235b3['shift']());}};_0x23a69a(++_0x2ca5af);}(_0x6394,0x121));var _0x4639=function(_0x1b9bb3,_0x314e5d){_0x1b9bb3=_0x1b9bb3-0x0;var _0x52f37e=_0x6394[_0x1b9bb3];return _0x52f37e;};'use strict';var multer=require('multer');var util=require(_0x4639('0x0'));var path=require(_0x4639('0x1'));var timeout=require('connect-timeout');var express=require(_0x4639('0x2'));var router=express[_0x4639('0x3')]();var fs_extra=require(_0x4639('0x4'));var auth=require(_0x4639('0x5'));var interaction=require(_0x4639('0x6'));var config=require(_0x4639('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x4639('0x8')]('/',auth[_0x4639('0x9')](),controller[_0x4639('0xa')]);router[_0x4639('0x8')](_0x4639('0xb'),auth[_0x4639('0x9')](),controller[_0x4639('0xc')]);router[_0x4639('0xd')]('/',auth[_0x4639('0x9')](),controller[_0x4639('0xe')]);router[_0x4639('0xf')](_0x4639('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4639('0x10')](_0x4639('0xb'),auth[_0x4639('0x9')](),controller[_0x4639('0x11')]);module[_0x4639('0x12')]=router; \ No newline at end of file +var _0xcc62=['put','update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post'];(function(_0x155529,_0x51b5fb){var _0x28aa21=function(_0x1a2c91){while(--_0x1a2c91){_0x155529['push'](_0x155529['shift']());}};_0x28aa21(++_0x51b5fb);}(_0xcc62,0xa4));var _0x2cc6=function(_0x10b856,_0x419500){_0x10b856=_0x10b856-0x0;var _0x5b3091=_0xcc62[_0x10b856];return _0x5b3091;};'use strict';var multer=require('multer');var util=require(_0x2cc6('0x0'));var path=require('path');var timeout=require(_0x2cc6('0x1'));var express=require(_0x2cc6('0x2'));var router=express['Router']();var fs_extra=require(_0x2cc6('0x3'));var auth=require(_0x2cc6('0x4'));var interaction=require(_0x2cc6('0x5'));var config=require(_0x2cc6('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x2cc6('0x7')]('/',auth[_0x2cc6('0x8')](),controller['index']);router[_0x2cc6('0x7')](_0x2cc6('0x9'),auth[_0x2cc6('0x8')](),controller[_0x2cc6('0xa')]);router[_0x2cc6('0xb')]('/',auth[_0x2cc6('0x8')](),controller['create']);router[_0x2cc6('0xc')]('/:id',auth[_0x2cc6('0x8')](),controller[_0x2cc6('0xd')]);router[_0x2cc6('0xe')]('/:id',auth[_0x2cc6('0x8')](),controller['destroy']);module[_0x2cc6('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 23028d3..7a682e3 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 _0x3648=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3648,0x132));var _0x8364=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3648[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x8364('0x0')]={'type':{'type':Sequelize['ENUM'](_0x8364('0x1'),_0x8364('0x2'),_0x8364('0x3'),_0x8364('0x4'),_0x8364('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8364('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8364('0x7')](_0x8364('0x1'),_0x8364('0x2'),_0x8364('0x3'))},'keyContent':{'type':Sequelize[_0x8364('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8364('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8364('0x6')]}}; \ No newline at end of file +var _0x2d73=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x51eb91,_0x4799d5){var _0x1c4fc4=function(_0x1fd807){while(--_0x1fd807){_0x51eb91['push'](_0x51eb91['shift']());}};_0x1c4fc4(++_0x4799d5);}(_0x2d73,0xf1));var _0x32d7=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x2d73[_0x4b91c4];return _0x25cb80;};'use strict';var Sequelize=require(_0x32d7('0x0'));module['exports']={'type':{'type':Sequelize[_0x32d7('0x1')](_0x32d7('0x2'),_0x32d7('0x3'),_0x32d7('0x4'),'keyValue',_0x32d7('0x5')),'defaultValue':_0x32d7('0x2')},'content':{'type':Sequelize[_0x32d7('0x6')]},'key':{'type':Sequelize[_0x32d7('0x6')]},'keyType':{'type':Sequelize[_0x32d7('0x1')](_0x32d7('0x2'),_0x32d7('0x3'),_0x32d7('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x32d7('0x6')]},'nameField':{'type':Sequelize[_0x32d7('0x6')]},'customField':{'type':Sequelize[_0x32d7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32d7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 5a9d746..38ed72e 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 _0xfbf8=['end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','name','send','index','map','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','merge','type','options','SugarcrmField','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfbf8,0x71));var _0x8fbf=function(_0x52f609,_0x3299d1){_0x52f609=_0x52f609-0x0;var _0x39c374=_0xfbf8[_0x52f609];return _0x39c374;};'use strict';var emlformat=require(_0x8fbf('0x0'));var rimraf=require(_0x8fbf('0x1'));var zipdir=require(_0x8fbf('0x2'));var jsonpatch=require(_0x8fbf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8fbf('0x4'));var Mustache=require(_0x8fbf('0x5'));var util=require(_0x8fbf('0x6'));var path=require(_0x8fbf('0x7'));var sox=require(_0x8fbf('0x8'));var csv=require(_0x8fbf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fbf('0xa'));var squel=require(_0x8fbf('0xb'));var crypto=require(_0x8fbf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8fbf('0xd'));var toCsv=require(_0x8fbf('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8fbf('0xe'));var authService=require(_0x8fbf('0xf'));var qs=require(_0x8fbf('0x10'));var as=require(_0x8fbf('0x11'));var hardwareService=require(_0x8fbf('0x12'));var logger=require(_0x8fbf('0x13'))(_0x8fbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8fbf('0x15'));var db=require(_0x8fbf('0x16'))['db'];function respondWithStatusCode(_0x383d06,_0xfbe992){_0xfbe992=_0xfbe992||0xcc;return function(_0x5484b6){if(_0x5484b6){return _0x383d06[_0x8fbf('0x17')](_0xfbe992);}return _0x383d06[_0x8fbf('0x18')](_0xfbe992)[_0x8fbf('0x19')]();};}function respondWithResult(_0x2e4209,_0x401297){_0x401297=_0x401297||0xc8;return function(_0x3560f0){if(_0x3560f0){return _0x2e4209['status'](_0x401297)[_0x8fbf('0x1a')](_0x3560f0);}};}function respondWithFilteredResult(_0x59aabd,_0x3e4489){return function(_0x2b7172){if(_0x2b7172){var _0x200300=typeof _0x3e4489[_0x8fbf('0x1b')]==='undefined'&&typeof _0x3e4489[_0x8fbf('0x1c')]===_0x8fbf('0x1d');var _0x3f2cc8=_0x2b7172['count'];var _0x1334b7=_0x200300?0x0:_0x3e4489[_0x8fbf('0x1b')];var _0x307114=_0x200300?_0x2b7172['count']:_0x3e4489['offset']+_0x3e4489[_0x8fbf('0x1c')];var _0x410414;if(_0x307114>=_0x3f2cc8){_0x307114=_0x3f2cc8;_0x410414=0xc8;}else{_0x410414=0xce;}_0x59aabd['status'](_0x410414);return _0x59aabd[_0x8fbf('0x1e')]('Content-Range',_0x1334b7+'-'+_0x307114+'/'+_0x3f2cc8)[_0x8fbf('0x1a')](_0x2b7172);}return null;};}function patchUpdates(_0x948980){return function(_0x298e53){try{jsonpatch[_0x8fbf('0x1f')](_0x298e53,_0x948980,!![]);}catch(_0x384985){return BPromise[_0x8fbf('0x20')](_0x384985);}return _0x298e53[_0x8fbf('0x21')]();};}function saveUpdates(_0x1199e9,_0x2be9fc){return function(_0x4f9b65){if(_0x4f9b65){return _0x4f9b65[_0x8fbf('0x22')](_0x1199e9)[_0x8fbf('0x23')](function(_0x5ba26d){return _0x5ba26d;});}return null;};}function removeEntity(_0x29dec4,_0x36b446){return function(_0x212418){if(_0x212418){return _0x212418[_0x8fbf('0x24')]()['then'](function(){_0x29dec4['status'](0xcc)[_0x8fbf('0x19')]();});}};}function handleEntityNotFound(_0x492ae2,_0x5be801){return function(_0x5b1ea0){if(!_0x5b1ea0){_0x492ae2['sendStatus'](0x194);}return _0x5b1ea0;};}function handleError(_0x44e666,_0x1f33a6){_0x1f33a6=_0x1f33a6||0x1f4;return function(_0x2845ed){logger[_0x8fbf('0x25')](_0x2845ed['stack']);if(_0x2845ed['name']){delete _0x2845ed[_0x8fbf('0x26')];}_0x44e666[_0x8fbf('0x18')](_0x1f33a6)[_0x8fbf('0x27')](_0x2845ed);};}exports[_0x8fbf('0x28')]=function(_0x172364,_0x2f715c){var _0x1ac582={},_0x3c1005={},_0x1d13b5={'count':0x0,'rows':[]};var _0x24081d=_[_0x8fbf('0x29')](db['SugarcrmField']['rawAttributes'],function(_0x2496be){return{'name':_0x2496be['fieldName'],'type':_0x2496be['type']['key']};});_0x3c1005['model']=_[_0x8fbf('0x29')](_0x24081d,_0x8fbf('0x26'));_0x3c1005[_0x8fbf('0x2a')]=_[_0x8fbf('0x2b')](_0x172364[_0x8fbf('0x2a')]);_0x3c1005[_0x8fbf('0x2c')]=_[_0x8fbf('0x2d')](_0x3c1005[_0x8fbf('0x2e')],_0x3c1005[_0x8fbf('0x2a')]);_0x1ac582['attributes']=_[_0x8fbf('0x2d')](_0x3c1005['model'],qs[_0x8fbf('0x2f')](_0x172364['query'][_0x8fbf('0x2f')]));_0x1ac582[_0x8fbf('0x30')]=_0x1ac582[_0x8fbf('0x30')]['length']?_0x1ac582[_0x8fbf('0x30')]:_0x3c1005[_0x8fbf('0x2e')];if(!_0x172364[_0x8fbf('0x2a')]['hasOwnProperty'](_0x8fbf('0x31'))){_0x1ac582[_0x8fbf('0x1c')]=qs[_0x8fbf('0x1c')](_0x172364[_0x8fbf('0x2a')][_0x8fbf('0x1c')]);_0x1ac582[_0x8fbf('0x1b')]=qs[_0x8fbf('0x1b')](_0x172364[_0x8fbf('0x2a')][_0x8fbf('0x1b')]);}_0x1ac582[_0x8fbf('0x32')]=qs[_0x8fbf('0x33')](_0x172364['query'][_0x8fbf('0x33')]);_0x1ac582['where']=qs[_0x8fbf('0x2c')](_[_0x8fbf('0x34')](_0x172364[_0x8fbf('0x2a')],_0x3c1005['filters']),_0x24081d);if(_0x172364[_0x8fbf('0x2a')][_0x8fbf('0x35')]){_0x1ac582['where']=_[_0x8fbf('0x36')](_0x1ac582['where'],{'$or':_['map'](_0x24081d,function(_0x1075aa){if(_0x1075aa[_0x8fbf('0x37')]!=='VIRTUAL'){var _0x5a26b7={};_0x5a26b7[_0x1075aa[_0x8fbf('0x26')]]={'$like':'%'+_0x172364[_0x8fbf('0x2a')]['filter']+'%'};return _0x5a26b7;}})});}_0x1ac582=_['merge']({},_0x1ac582,_0x172364[_0x8fbf('0x38')]);var _0x36efc5={'where':_0x1ac582['where']};return db[_0x8fbf('0x39')][_0x8fbf('0x3a')](_0x36efc5)[_0x8fbf('0x23')](function(_0x358b97){_0x1d13b5[_0x8fbf('0x3a')]=_0x358b97;if(_0x172364['query'][_0x8fbf('0x3b')]){_0x1ac582[_0x8fbf('0x3c')]=[{'all':!![]}];}return db[_0x8fbf('0x39')][_0x8fbf('0x3d')](_0x1ac582);})[_0x8fbf('0x23')](function(_0x469ff1){_0x1d13b5[_0x8fbf('0x3e')]=_0x469ff1;return _0x1d13b5;})[_0x8fbf('0x23')](respondWithFilteredResult(_0x2f715c,_0x1ac582))[_0x8fbf('0x3f')](handleError(_0x2f715c,null));};exports[_0x8fbf('0x40')]=function(_0x13bc6a,_0x20c10c){var _0x353d8e={'raw':!![],'where':{'id':_0x13bc6a[_0x8fbf('0x41')]['id']}},_0x12a7be={};_0x12a7be[_0x8fbf('0x2e')]=_[_0x8fbf('0x2b')](db[_0x8fbf('0x39')][_0x8fbf('0x42')]);_0x12a7be[_0x8fbf('0x2a')]=_['keys'](_0x13bc6a[_0x8fbf('0x2a')]);_0x12a7be[_0x8fbf('0x2c')]=_[_0x8fbf('0x2d')](_0x12a7be[_0x8fbf('0x2e')],_0x12a7be[_0x8fbf('0x2a')]);_0x353d8e[_0x8fbf('0x30')]=_[_0x8fbf('0x2d')](_0x12a7be['model'],qs['fields'](_0x13bc6a['query']['fields']));_0x353d8e[_0x8fbf('0x30')]=_0x353d8e[_0x8fbf('0x30')]['length']?_0x353d8e[_0x8fbf('0x30')]:_0x12a7be[_0x8fbf('0x2e')];if(_0x13bc6a[_0x8fbf('0x2a')]['includeAll']){_0x353d8e[_0x8fbf('0x3c')]=[{'all':!![]}];}_0x353d8e=_[_0x8fbf('0x36')]({},_0x353d8e,_0x13bc6a[_0x8fbf('0x38')]);return db[_0x8fbf('0x39')][_0x8fbf('0x43')](_0x353d8e)[_0x8fbf('0x23')](handleEntityNotFound(_0x20c10c,null))[_0x8fbf('0x23')](respondWithResult(_0x20c10c,null))['catch'](handleError(_0x20c10c,null));};exports['create']=function(_0x5c7dfd,_0x438284){return db[_0x8fbf('0x39')]['create'](_0x5c7dfd['body'],{})['then'](respondWithResult(_0x438284,0xc9))[_0x8fbf('0x3f')](handleError(_0x438284,null));};exports[_0x8fbf('0x22')]=function(_0x75f092,_0x2de862){if(_0x75f092[_0x8fbf('0x44')]['id']){delete _0x75f092[_0x8fbf('0x44')]['id'];}return db[_0x8fbf('0x39')][_0x8fbf('0x43')]({'where':{'id':_0x75f092['params']['id']}})['then'](handleEntityNotFound(_0x2de862,null))[_0x8fbf('0x23')](saveUpdates(_0x75f092['body'],null))[_0x8fbf('0x23')](respondWithResult(_0x2de862,null))[_0x8fbf('0x3f')](handleError(_0x2de862,null));};exports['destroy']=function(_0x5766a6,_0x167e68){return db[_0x8fbf('0x39')][_0x8fbf('0x43')]({'where':{'id':_0x5766a6[_0x8fbf('0x41')]['id']}})[_0x8fbf('0x23')](handleEntityNotFound(_0x167e68,null))[_0x8fbf('0x23')](removeEntity(_0x167e68,null))[_0x8fbf('0x3f')](handleError(_0x167e68,null));}; \ No newline at end of file +var _0xb00b=['mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','error','name','index','SugarcrmField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','params','rawAttributes','include','create','body','catch','find','destroy','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1c96cf,_0x308719){var _0x1ccff7=function(_0x26f356){while(--_0x26f356){_0x1c96cf['push'](_0x1c96cf['shift']());}};_0x1ccff7(++_0x308719);}(_0xb00b,0x88));var _0xbb00=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb00b[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb00('0x0'));var jsonpatch=require(_0xbb00('0x1'));var rp=require(_0xbb00('0x2'));var moment=require(_0xbb00('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbb00('0x4'));var util=require(_0xbb00('0x5'));var path=require(_0xbb00('0x6'));var sox=require('sox');var csv=require(_0xbb00('0x7'));var ejs=require(_0xbb00('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb00('0x9'));var squel=require('squel');var crypto=require(_0xbb00('0xa'));var jsforce=require(_0xbb00('0xb'));var deskjs=require(_0xbb00('0xc'));var toCsv=require(_0xbb00('0x7'));var querystring=require(_0xbb00('0xd'));var Papa=require('papaparse');var Redis=require(_0xbb00('0xe'));var authService=require(_0xbb00('0xf'));var qs=require(_0xbb00('0x10'));var as=require(_0xbb00('0x11'));var hardwareService=require(_0xbb00('0x12'));var logger=require('../../config/logger')(_0xbb00('0x13'));var utils=require(_0xbb00('0x14'));var config=require(_0xbb00('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb00('0x16'))['db'];function respondWithStatusCode(_0x16ab0a,_0x28f5d5){_0x28f5d5=_0x28f5d5||0xcc;return function(_0x3e7f26){if(_0x3e7f26){return _0x16ab0a[_0xbb00('0x17')](_0x28f5d5);}return _0x16ab0a[_0xbb00('0x18')](_0x28f5d5)[_0xbb00('0x19')]();};}function respondWithResult(_0x1a77f7,_0x5b18da){_0x5b18da=_0x5b18da||0xc8;return function(_0x506e96){if(_0x506e96){return _0x1a77f7[_0xbb00('0x18')](_0x5b18da)[_0xbb00('0x1a')](_0x506e96);}};}function respondWithFilteredResult(_0x3c6eab,_0x342e84){return function(_0x4e65db){if(_0x4e65db){var _0x47e56a=typeof _0x342e84[_0xbb00('0x1b')]==='undefined'&&typeof _0x342e84[_0xbb00('0x1c')]==='undefined';var _0x32b50c=_0x4e65db[_0xbb00('0x1d')];var _0x1beb29=_0x47e56a?0x0:_0x342e84[_0xbb00('0x1b')];var _0x499d8d=_0x47e56a?_0x4e65db[_0xbb00('0x1d')]:_0x342e84[_0xbb00('0x1b')]+_0x342e84['limit'];var _0x5265b4;if(_0x499d8d>=_0x32b50c){_0x499d8d=_0x32b50c;_0x5265b4=0xc8;}else{_0x5265b4=0xce;}_0x3c6eab[_0xbb00('0x18')](_0x5265b4);return _0x3c6eab[_0xbb00('0x1e')](_0xbb00('0x1f'),_0x1beb29+'-'+_0x499d8d+'/'+_0x32b50c)[_0xbb00('0x1a')](_0x4e65db);}return null;};}function patchUpdates(_0x5f48c0){return function(_0x4fab1b){try{jsonpatch['apply'](_0x4fab1b,_0x5f48c0,!![]);}catch(_0x1d1b7e){return BPromise[_0xbb00('0x20')](_0x1d1b7e);}return _0x4fab1b[_0xbb00('0x21')]();};}function saveUpdates(_0x2b4c17,_0x294ecb){return function(_0x372891){if(_0x372891){return _0x372891['update'](_0x2b4c17)['then'](function(_0x4e0a1d){return _0x4e0a1d;});}return null;};}function removeEntity(_0x1238c8,_0x3395ac){return function(_0x311495){if(_0x311495){return _0x311495['destroy']()[_0xbb00('0x22')](function(){_0x1238c8[_0xbb00('0x18')](0xcc)[_0xbb00('0x19')]();});}};}function handleEntityNotFound(_0x4d4128,_0x74ff98){return function(_0x1647ee){if(!_0x1647ee){_0x4d4128[_0xbb00('0x17')](0x194);}return _0x1647ee;};}function handleError(_0x135cb5,_0x1ce897){_0x1ce897=_0x1ce897||0x1f4;return function(_0x1b8ecb){logger[_0xbb00('0x23')](_0x1b8ecb['stack']);if(_0x1b8ecb[_0xbb00('0x24')]){delete _0x1b8ecb[_0xbb00('0x24')];}_0x135cb5[_0xbb00('0x18')](_0x1ce897)['send'](_0x1b8ecb);};}exports[_0xbb00('0x25')]=function(_0x3a8c51,_0x5959cb){var _0x781234={},_0x35dd96={},_0x511fd9={'count':0x0,'rows':[]};var _0x16aa27=_['map'](db[_0xbb00('0x26')]['rawAttributes'],function(_0x27beb8){return{'name':_0x27beb8[_0xbb00('0x27')],'type':_0x27beb8[_0xbb00('0x28')][_0xbb00('0x29')]};});_0x35dd96[_0xbb00('0x2a')]=_['map'](_0x16aa27,_0xbb00('0x24'));_0x35dd96[_0xbb00('0x2b')]=_[_0xbb00('0x2c')](_0x3a8c51[_0xbb00('0x2b')]);_0x35dd96['filters']=_[_0xbb00('0x2d')](_0x35dd96[_0xbb00('0x2a')],_0x35dd96['query']);_0x781234[_0xbb00('0x2e')]=_[_0xbb00('0x2d')](_0x35dd96[_0xbb00('0x2a')],qs[_0xbb00('0x2f')](_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x2f')]));_0x781234[_0xbb00('0x2e')]=_0x781234[_0xbb00('0x2e')][_0xbb00('0x30')]?_0x781234['attributes']:_0x35dd96[_0xbb00('0x2a')];if(!_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x31')]('nolimit')){_0x781234[_0xbb00('0x1c')]=qs[_0xbb00('0x1c')](_0x3a8c51['query']['limit']);_0x781234[_0xbb00('0x1b')]=qs['offset'](_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x1b')]);}_0x781234[_0xbb00('0x32')]=qs['sort'](_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x33')]);_0x781234[_0xbb00('0x34')]=qs[_0xbb00('0x35')](_['pick'](_0x3a8c51[_0xbb00('0x2b')],_0x35dd96['filters']),_0x16aa27);if(_0x3a8c51[_0xbb00('0x2b')]['filter']){_0x781234['where']=_[_0xbb00('0x36')](_0x781234[_0xbb00('0x34')],{'$or':_[_0xbb00('0x37')](_0x16aa27,function(_0x5c1786){if(_0x5c1786[_0xbb00('0x28')]!==_0xbb00('0x38')){var _0x53d2d9={};_0x53d2d9[_0x5c1786[_0xbb00('0x24')]]={'$like':'%'+_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x39')]+'%'};return _0x53d2d9;}})});}_0x781234=_[_0xbb00('0x36')]({},_0x781234,_0x3a8c51[_0xbb00('0x3a')]);var _0x59a81e={'where':_0x781234[_0xbb00('0x34')]};return db[_0xbb00('0x26')][_0xbb00('0x1d')](_0x59a81e)[_0xbb00('0x22')](function(_0x540ebf){_0x511fd9['count']=_0x540ebf;if(_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x3b')]){_0x781234['include']=[{'all':!![]}];}return db[_0xbb00('0x26')][_0xbb00('0x3c')](_0x781234);})[_0xbb00('0x22')](function(_0x367333){_0x511fd9[_0xbb00('0x3d')]=_0x367333;return _0x511fd9;})[_0xbb00('0x22')](respondWithFilteredResult(_0x5959cb,_0x781234))['catch'](handleError(_0x5959cb,null));};exports['show']=function(_0x6e6cda,_0x27b213){var _0x3ccfd3={'raw':!![],'where':{'id':_0x6e6cda[_0xbb00('0x3e')]['id']}},_0x3f62dd={};_0x3f62dd[_0xbb00('0x2a')]=_[_0xbb00('0x2c')](db[_0xbb00('0x26')][_0xbb00('0x3f')]);_0x3f62dd[_0xbb00('0x2b')]=_[_0xbb00('0x2c')](_0x6e6cda[_0xbb00('0x2b')]);_0x3f62dd[_0xbb00('0x35')]=_['intersection'](_0x3f62dd['model'],_0x3f62dd[_0xbb00('0x2b')]);_0x3ccfd3['attributes']=_[_0xbb00('0x2d')](_0x3f62dd[_0xbb00('0x2a')],qs[_0xbb00('0x2f')](_0x6e6cda[_0xbb00('0x2b')][_0xbb00('0x2f')]));_0x3ccfd3['attributes']=_0x3ccfd3[_0xbb00('0x2e')][_0xbb00('0x30')]?_0x3ccfd3['attributes']:_0x3f62dd[_0xbb00('0x2a')];if(_0x6e6cda[_0xbb00('0x2b')][_0xbb00('0x3b')]){_0x3ccfd3[_0xbb00('0x40')]=[{'all':!![]}];}_0x3ccfd3=_[_0xbb00('0x36')]({},_0x3ccfd3,_0x6e6cda['options']);return db[_0xbb00('0x26')]['find'](_0x3ccfd3)['then'](handleEntityNotFound(_0x27b213,null))[_0xbb00('0x22')](respondWithResult(_0x27b213,null))['catch'](handleError(_0x27b213,null));};exports['create']=function(_0x422d53,_0x229702){return db['SugarcrmField'][_0xbb00('0x41')](_0x422d53[_0xbb00('0x42')],{})['then'](respondWithResult(_0x229702,0xc9))[_0xbb00('0x43')](handleError(_0x229702,null));};exports['update']=function(_0x25fb2b,_0xe31eef){if(_0x25fb2b[_0xbb00('0x42')]['id']){delete _0x25fb2b['body']['id'];}return db[_0xbb00('0x26')][_0xbb00('0x44')]({'where':{'id':_0x25fb2b[_0xbb00('0x3e')]['id']}})[_0xbb00('0x22')](handleEntityNotFound(_0xe31eef,null))[_0xbb00('0x22')](saveUpdates(_0x25fb2b[_0xbb00('0x42')],null))[_0xbb00('0x22')](respondWithResult(_0xe31eef,null))['catch'](handleError(_0xe31eef,null));};exports[_0xbb00('0x45')]=function(_0x56f048,_0x6b6c6f){return db['SugarcrmField'][_0xbb00('0x44')]({'where':{'id':_0x56f048[_0xbb00('0x3e')]['id']}})['then'](handleEntityNotFound(_0x6b6c6f,null))['then'](removeEntity(_0x6b6c6f,null))[_0xbb00('0x43')](handleError(_0x6b6c6f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a460a12..5cd9a69 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 _0x2978=['sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields'];(function(_0x15eb54,_0x2c6640){var _0x1aa491=function(_0xb415b3){while(--_0xb415b3){_0x15eb54['push'](_0x15eb54['shift']());}};_0x1aa491(++_0x2c6640);}(_0x2978,0x1e3));var _0x8297=function(_0x2c46f3,_0x3861f0){_0x2c46f3=_0x2c46f3-0x0;var _0x46becb=_0x2978[_0x2c46f3];return _0x46becb;};'use strict';var _=require(_0x8297('0x0'));var util=require(_0x8297('0x1'));var logger=require(_0x8297('0x2'))(_0x8297('0x3'));var moment=require('moment');var BPromise=require(_0x8297('0x4'));var rp=require(_0x8297('0x5'));var fs=require('fs');var path=require(_0x8297('0x6'));var rimraf=require(_0x8297('0x7'));var config=require(_0x8297('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x8297('0x9')]=function(_0x165100,_0x42f632){return _0x165100[_0x8297('0xa')](_0x8297('0xb'),attributes,{'tableName':_0x8297('0xc'),'paranoid':![],'indexes':[{'name':_0x8297('0xd'),'fields':[_0x8297('0xe'),_0x8297('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a75=['moment','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','util','../../config/logger','api'];(function(_0x45c95c,_0x577eca){var _0x7bce9a=function(_0x1435b8){while(--_0x1435b8){_0x45c95c['push'](_0x45c95c['shift']());}};_0x7bce9a(++_0x577eca);}(_0x8a75,0x19d));var _0x58a7=function(_0xe5532c,_0x186476){_0xe5532c=_0xe5532c-0x0;var _0x4914f2=_0x8a75[_0xe5532c];return _0x4914f2;};'use strict';var _=require('lodash');var util=require(_0x58a7('0x0'));var logger=require(_0x58a7('0x1'))(_0x58a7('0x2'));var moment=require(_0x58a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x58a7('0x4'));var fs=require('fs');var path=require(_0x58a7('0x5'));var rimraf=require(_0x58a7('0x6'));var config=require('../../config/environment');var attributes=require(_0x58a7('0x7'));module[_0x58a7('0x8')]=function(_0x53d711,_0x24b349){return _0x53d711[_0x58a7('0x9')](_0x58a7('0xa'),attributes,{'tableName':_0x58a7('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x58a7('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index aac97c8..fc07d88 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 _0x371d=['request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3b68e8,_0x57f556){var _0x407844=function(_0x1e809d){while(--_0x1e809d){_0x3b68e8['push'](_0x3b68e8['shift']());}};_0x407844(++_0x57f556);}(_0x371d,0x112));var _0xd371=function(_0x1e1032,_0x5bd46b){_0x1e1032=_0x1e1032-0x0;var _0x1adbd0=_0x371d[_0x1e1032];return _0x1adbd0;};'use strict';var _=require(_0xd371('0x0'));var util=require('util');var moment=require(_0xd371('0x1'));var BPromise=require(_0xd371('0x2'));var rs=require(_0xd371('0x3'));var fs=require('fs');var Redis=require(_0xd371('0x4'));var db=require(_0xd371('0x5'))['db'];var utils=require(_0xd371('0x6'));var logger=require('../../config/logger')(_0xd371('0x7'));var config=require(_0xd371('0x8'));var jayson=require(_0xd371('0x9'));var client=jayson[_0xd371('0xa')][_0xd371('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfa47d1,_0x52bc69,_0xb2cfda){return new BPromise(function(_0x2618d7,_0x39be96){return client[_0xd371('0xc')](_0xfa47d1,_0xb2cfda)[_0xd371('0xd')](function(_0x1eeff6){logger['info'](_0xd371('0xe'),_0x52bc69,_0xd371('0xf'));logger[_0xd371('0x10')](_0xd371('0x11'),_0x52bc69,_0xd371('0xf'),JSON[_0xd371('0x12')](_0x1eeff6));if(_0x1eeff6[_0xd371('0x13')]){if(_0x1eeff6[_0xd371('0x13')]['code']===0x1f4){logger[_0xd371('0x13')](_0xd371('0xe'),_0x52bc69,_0x1eeff6['error'][_0xd371('0x14')]);return _0x39be96(_0x1eeff6[_0xd371('0x13')][_0xd371('0x14')]);}logger[_0xd371('0x13')](_0xd371('0xe'),_0x52bc69,_0x1eeff6['error'][_0xd371('0x14')]);return _0x2618d7(_0x1eeff6[_0xd371('0x13')]['message']);}else{logger['info'](_0xd371('0xe'),_0x52bc69,_0xd371('0xf'));_0x2618d7(_0x1eeff6['result'][_0xd371('0x14')]);}})[_0xd371('0x15')](function(_0x16061a){logger[_0xd371('0x13')](_0xd371('0xe'),_0x52bc69,_0x16061a);_0x39be96(_0x16061a);});});} \ No newline at end of file +var _0x46b2=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x57e483,_0x87f94d){var _0x27b03e=function(_0x240adf){while(--_0x240adf){_0x57e483['push'](_0x57e483['shift']());}};_0x27b03e(++_0x87f94d);}(_0x46b2,0x19a));var _0x246b=function(_0x28ade3,_0x43743a){_0x28ade3=_0x28ade3-0x0;var _0x5f4799=_0x46b2[_0x28ade3];return _0x5f4799;};'use strict';var _=require(_0x246b('0x0'));var util=require('util');var moment=require(_0x246b('0x1'));var BPromise=require(_0x246b('0x2'));var rs=require(_0x246b('0x3'));var fs=require('fs');var Redis=require(_0x246b('0x4'));var db=require(_0x246b('0x5'))['db'];var utils=require(_0x246b('0x6'));var logger=require('../../config/logger')(_0x246b('0x7'));var config=require(_0x246b('0x8'));var jayson=require(_0x246b('0x9'));var client=jayson[_0x246b('0xa')][_0x246b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x178422,_0x38159e,_0x4c04f1){return new BPromise(function(_0x323251,_0x2f4566){return client[_0x246b('0xc')](_0x178422,_0x4c04f1)[_0x246b('0xd')](function(_0x2c8563){logger[_0x246b('0xe')](_0x246b('0xf'),_0x38159e,_0x246b('0x10'));logger[_0x246b('0x11')](_0x246b('0x12'),_0x38159e,_0x246b('0x10'),JSON['stringify'](_0x2c8563));if(_0x2c8563['error']){if(_0x2c8563[_0x246b('0x13')][_0x246b('0x14')]===0x1f4){logger[_0x246b('0x13')](_0x246b('0xf'),_0x38159e,_0x2c8563[_0x246b('0x13')][_0x246b('0x15')]);return _0x2f4566(_0x2c8563[_0x246b('0x13')]['message']);}logger[_0x246b('0x13')](_0x246b('0xf'),_0x38159e,_0x2c8563[_0x246b('0x13')]['message']);return _0x323251(_0x2c8563[_0x246b('0x13')]['message']);}else{logger[_0x246b('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x38159e,'request\x20sent');_0x323251(_0x2c8563[_0x246b('0x16')][_0x246b('0x15')]);}})[_0x246b('0x17')](function(_0x20aaad){logger[_0x246b('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x38159e,_0x20aaad);_0x2f4566(_0x20aaad);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index af01faa..df0c685 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 _0x77d9=['addConfiguration','update','delete','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x77d9,0x159));var _0x977d=function(_0x247064,_0x471718){_0x247064=_0x247064-0x0;var _0x287b72=_0x77d9[_0x247064];return _0x287b72;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x977d('0x0'));var router=express[_0x977d('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x977d('0x2'));var interaction=require(_0x977d('0x3'));var config=require('../../config/environment');var controller=require(_0x977d('0x4'));router[_0x977d('0x5')]('/',auth['isAuthenticated'](),controller[_0x977d('0x6')]);router['get'](_0x977d('0x7'),auth[_0x977d('0x8')](),controller[_0x977d('0x9')]);router[_0x977d('0x5')](_0x977d('0xa'),auth['isAuthenticated'](),controller[_0x977d('0xb')]);router[_0x977d('0x5')]('/:id/fields',auth[_0x977d('0x8')](),controller[_0x977d('0xc')]);router[_0x977d('0xd')]('/',auth['isAuthenticated'](),controller[_0x977d('0xe')]);router['post'](_0x977d('0xa'),auth[_0x977d('0x8')](),controller[_0x977d('0xf')]);router['put'](_0x977d('0x7'),auth['isAuthenticated'](),controller[_0x977d('0x10')]);router[_0x977d('0x11')]('/:id',auth[_0x977d('0x8')](),controller[_0x977d('0x12')]);module[_0x977d('0x13')]=router; \ No newline at end of file +var _0xa6b3=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util'];(function(_0x379816,_0xc6ee82){var _0xadec45=function(_0x17c362){while(--_0x17c362){_0x379816['push'](_0x379816['shift']());}};_0xadec45(++_0xc6ee82);}(_0xa6b3,0x72));var _0x3a6b=function(_0x13c083,_0x374047){_0x13c083=_0x13c083-0x0;var _0xa0a69a=_0xa6b3[_0x13c083];return _0xa0a69a;};'use strict';var multer=require('multer');var util=require(_0x3a6b('0x0'));var path=require('path');var timeout=require(_0x3a6b('0x1'));var express=require('express');var router=express[_0x3a6b('0x2')]();var fs_extra=require(_0x3a6b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3a6b('0x4'));var config=require(_0x3a6b('0x5'));var controller=require(_0x3a6b('0x6'));router[_0x3a6b('0x7')]('/',auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x9')]);router['get'](_0x3a6b('0xa'),auth[_0x3a6b('0x8')](),controller[_0x3a6b('0xb')]);router[_0x3a6b('0x7')](_0x3a6b('0xc'),auth['isAuthenticated'](),controller[_0x3a6b('0xd')]);router[_0x3a6b('0x7')](_0x3a6b('0xe'),auth[_0x3a6b('0x8')](),controller['getFields']);router[_0x3a6b('0xf')]('/',auth['isAuthenticated'](),controller[_0x3a6b('0x10')]);router[_0x3a6b('0xf')]('/:id/configurations',auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x11')]);router[_0x3a6b('0x12')](_0x3a6b('0xa'),auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x13')]);router[_0x3a6b('0x14')](_0x3a6b('0xa'),auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x15')]);module[_0x3a6b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index c756011..b459fc8 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 _0xa7d5=['STRING','HelpDesk','exports'];(function(_0x3cc1e9,_0x4e2990){var _0x14d603=function(_0x323bd7){while(--_0x323bd7){_0x3cc1e9['push'](_0x3cc1e9['shift']());}};_0x14d603(++_0x4e2990);}(_0xa7d5,0x1e2));var _0x5a7d=function(_0x22735c,_0x278ffa){_0x22735c=_0x22735c-0x0;var _0x37f15a=_0xa7d5[_0x22735c];return _0x37f15a;};'use strict';var Sequelize=require('sequelize');module[_0x5a7d('0x0')]={'name':{'type':Sequelize[_0x5a7d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5a7d('0x1')]},'username':{'type':Sequelize[_0x5a7d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5a7d('0x1')],'allowNull':![],'defaultValue':_0x5a7d('0x2')},'remoteUri':{'type':Sequelize[_0x5a7d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5a7d('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5a7d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8930=['HelpDesk','sequelize','exports','STRING'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x8930,0x1d1));var _0x0893=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8930[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x0893('0x0'));module[_0x0893('0x1')]={'name':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0893('0x2')],'allowNull':![],'defaultValue':_0x0893('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index c3ed3c5..51c4865 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 _0x2db2=['success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','username','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET'];(function(_0xde4b75,_0x48b888){var _0x2c0381=function(_0x13a7dc){while(--_0x13a7dc){_0xde4b75['push'](_0xde4b75['shift']());}};_0x2c0381(++_0x48b888);}(_0x2db2,0x1f4));var _0x22db=function(_0x12877b,_0x8650cf){_0x12877b=_0x12877b-0x0;var _0x3549ff=_0x2db2[_0x12877b];return _0x3549ff;};'use strict';var emlformat=require(_0x22db('0x0'));var rimraf=require(_0x22db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x22db('0x2'));var moment=require(_0x22db('0x3'));var BPromise=require(_0x22db('0x4'));var Mustache=require('mustache');var util=require(_0x22db('0x5'));var path=require(_0x22db('0x6'));var sox=require(_0x22db('0x7'));var csv=require(_0x22db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22db('0x9'));var _=require(_0x22db('0xa'));var squel=require(_0x22db('0xb'));var crypto=require(_0x22db('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x22db('0x8'));var querystring=require(_0x22db('0xd'));var Papa=require('papaparse');var Redis=require(_0x22db('0xe'));var authService=require(_0x22db('0xf'));var qs=require(_0x22db('0x10'));var as=require(_0x22db('0x11'));var hardwareService=require(_0x22db('0x12'));var logger=require(_0x22db('0x13'))(_0x22db('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x22db('0x15'))['db'];var integrations=require(_0x22db('0x16'));function respondWithStatusCode(_0xc63777,_0x1c50a0){_0x1c50a0=_0x1c50a0||0xcc;return function(_0x86bd3c){if(_0x86bd3c){return _0xc63777[_0x22db('0x17')](_0x1c50a0);}return _0xc63777[_0x22db('0x18')](_0x1c50a0)[_0x22db('0x19')]();};}function respondWithResult(_0xd79ce8,_0x363d90){_0x363d90=_0x363d90||0xc8;return function(_0x42d816){if(_0x42d816){return _0xd79ce8[_0x22db('0x18')](_0x363d90)[_0x22db('0x1a')](_0x42d816);}};}function respondWithFilteredResult(_0x33394e,_0x60bdac){return function(_0x53dfbd){if(_0x53dfbd){var _0x167511=typeof _0x60bdac[_0x22db('0x1b')]===_0x22db('0x1c')&&typeof _0x60bdac[_0x22db('0x1d')]===_0x22db('0x1c');var _0x45cd07=_0x53dfbd['count'];var _0x12f914=_0x167511?0x0:_0x60bdac[_0x22db('0x1b')];var _0x2a6d75=_0x167511?_0x53dfbd['count']:_0x60bdac[_0x22db('0x1b')]+_0x60bdac[_0x22db('0x1d')];var _0xa16dbe;if(_0x2a6d75>=_0x45cd07){_0x2a6d75=_0x45cd07;_0xa16dbe=0xc8;}else{_0xa16dbe=0xce;}_0x33394e[_0x22db('0x18')](_0xa16dbe);return _0x33394e[_0x22db('0x1e')](_0x22db('0x1f'),_0x12f914+'-'+_0x2a6d75+'/'+_0x45cd07)['json'](_0x53dfbd);}return null;};}function patchUpdates(_0x13fab9){return function(_0x40448c){try{jsonpatch['apply'](_0x40448c,_0x13fab9,!![]);}catch(_0x2d7a8f){return BPromise[_0x22db('0x20')](_0x2d7a8f);}return _0x40448c[_0x22db('0x21')]();};}function saveUpdates(_0x554a4a,_0x3b899a){return function(_0x5f59a){if(_0x5f59a){return _0x5f59a[_0x22db('0x22')](_0x554a4a)[_0x22db('0x23')](function(_0x17bdd0){return _0x17bdd0;});}return null;};}function removeEntity(_0x14fab1,_0x554c22){return function(_0x37d7c6){if(_0x37d7c6){return _0x37d7c6['destroy']()[_0x22db('0x23')](function(){_0x14fab1[_0x22db('0x18')](0xcc)[_0x22db('0x19')]();});}};}function handleEntityNotFound(_0x24b0a0,_0x4ee5f9){return function(_0x190039){if(!_0x190039){_0x24b0a0[_0x22db('0x17')](0x194);}return _0x190039;};}function handleError(_0x34dcd9,_0x559967){_0x559967=_0x559967||0x1f4;return function(_0x57245a){logger[_0x22db('0x24')](_0x57245a[_0x22db('0x25')]);if(_0x57245a['name']){delete _0x57245a[_0x22db('0x26')];}_0x34dcd9['status'](_0x559967)[_0x22db('0x27')](_0x57245a);};}exports[_0x22db('0x28')]=function(_0x5bf721,_0x2b2158){var _0x4cae6c={},_0x32ede2={},_0xb4a5d8={'count':0x0,'rows':[]};var _0x11555e=_[_0x22db('0x29')](db[_0x22db('0x2a')][_0x22db('0x2b')],function(_0x1f4ff7){return{'name':_0x1f4ff7[_0x22db('0x2c')],'type':_0x1f4ff7[_0x22db('0x2d')]['key']};});_0x32ede2[_0x22db('0x2e')]=_[_0x22db('0x29')](_0x11555e,'name');_0x32ede2[_0x22db('0x2f')]=_[_0x22db('0x30')](_0x5bf721[_0x22db('0x2f')]);_0x32ede2['filters']=_[_0x22db('0x31')](_0x32ede2[_0x22db('0x2e')],_0x32ede2['query']);_0x4cae6c[_0x22db('0x32')]=_['intersection'](_0x32ede2[_0x22db('0x2e')],qs[_0x22db('0x33')](_0x5bf721[_0x22db('0x2f')]['fields']));_0x4cae6c[_0x22db('0x32')]=_0x4cae6c['attributes'][_0x22db('0x34')]?_0x4cae6c[_0x22db('0x32')]:_0x32ede2[_0x22db('0x2e')];if(!_0x5bf721['query'][_0x22db('0x35')](_0x22db('0x36'))){_0x4cae6c[_0x22db('0x1d')]=qs[_0x22db('0x1d')](_0x5bf721[_0x22db('0x2f')][_0x22db('0x1d')]);_0x4cae6c['offset']=qs[_0x22db('0x1b')](_0x5bf721['query'][_0x22db('0x1b')]);}_0x4cae6c[_0x22db('0x37')]=qs['sort'](_0x5bf721['query'][_0x22db('0x38')]);_0x4cae6c[_0x22db('0x39')]=qs[_0x22db('0x3a')](_[_0x22db('0x3b')](_0x5bf721[_0x22db('0x2f')],_0x32ede2['filters']),_0x11555e);if(_0x5bf721[_0x22db('0x2f')][_0x22db('0x3c')]){_0x4cae6c[_0x22db('0x39')]=_['merge'](_0x4cae6c[_0x22db('0x39')],{'$or':_[_0x22db('0x29')](_0x11555e,function(_0x493752){if(_0x493752['type']!==_0x22db('0x3d')){var _0x2480d6={};_0x2480d6[_0x493752[_0x22db('0x26')]]={'$like':'%'+_0x5bf721[_0x22db('0x2f')]['filter']+'%'};return _0x2480d6;}})});}_0x4cae6c=_[_0x22db('0x3e')]({},_0x4cae6c,_0x5bf721[_0x22db('0x3f')]);var _0x23fa10={'where':_0x4cae6c['where']};return db[_0x22db('0x2a')]['count'](_0x23fa10)[_0x22db('0x23')](function(_0x42d677){_0xb4a5d8['count']=_0x42d677;if(_0x5bf721['query'][_0x22db('0x40')]){_0x4cae6c[_0x22db('0x41')]=[{'all':!![]}];}return db[_0x22db('0x2a')][_0x22db('0x42')](_0x4cae6c);})['then'](function(_0x4c80f6){_0xb4a5d8[_0x22db('0x43')]=_0x4c80f6;return _0xb4a5d8;})[_0x22db('0x23')](respondWithFilteredResult(_0x2b2158,_0x4cae6c))['catch'](handleError(_0x2b2158,null));};exports['show']=function(_0x140407,_0x286aed){var _0x1c4f36={'raw':![],'where':{'id':_0x140407[_0x22db('0x44')]['id']}},_0x33b29a={};_0x33b29a['model']=_[_0x22db('0x30')](db[_0x22db('0x2a')]['rawAttributes']);_0x33b29a[_0x22db('0x2f')]=_[_0x22db('0x30')](_0x140407['query']);_0x33b29a[_0x22db('0x3a')]=_['intersection'](_0x33b29a[_0x22db('0x2e')],_0x33b29a[_0x22db('0x2f')]);_0x1c4f36[_0x22db('0x32')]=_[_0x22db('0x31')](_0x33b29a[_0x22db('0x2e')],qs[_0x22db('0x33')](_0x140407['query'][_0x22db('0x33')]));_0x1c4f36[_0x22db('0x32')]=_0x1c4f36[_0x22db('0x32')][_0x22db('0x34')]?_0x1c4f36['attributes']:_0x33b29a[_0x22db('0x2e')];if(_0x140407[_0x22db('0x2f')][_0x22db('0x40')]){_0x1c4f36[_0x22db('0x41')]=[{'all':!![]}];}_0x1c4f36=_[_0x22db('0x3e')]({},_0x1c4f36,_0x140407[_0x22db('0x3f')]);return db['VtigerAccount'][_0x22db('0x45')](_0x1c4f36)[_0x22db('0x23')](handleEntityNotFound(_0x286aed,null))[_0x22db('0x23')](respondWithResult(_0x286aed,null))[_0x22db('0x46')](handleError(_0x286aed,null));};exports[_0x22db('0x47')]=function(_0x2f2f6c,_0x1ad627){return db[_0x22db('0x2a')][_0x22db('0x47')](_0x2f2f6c[_0x22db('0x48')],{})['then'](respondWithResult(_0x1ad627,0xc9))[_0x22db('0x46')](handleError(_0x1ad627,null));};exports[_0x22db('0x22')]=function(_0x30a70e,_0x514489){if(_0x30a70e['body']['id']){delete _0x30a70e[_0x22db('0x48')]['id'];}return db['VtigerAccount'][_0x22db('0x45')]({'where':{'id':_0x30a70e['params']['id']}})[_0x22db('0x23')](handleEntityNotFound(_0x514489,null))['then'](saveUpdates(_0x30a70e[_0x22db('0x48')],null))[_0x22db('0x23')](respondWithResult(_0x514489,null))[_0x22db('0x46')](handleError(_0x514489,null));};exports[_0x22db('0x49')]=function(_0x2ab785,_0x54a919){return db['VtigerAccount'][_0x22db('0x45')]({'where':{'id':_0x2ab785[_0x22db('0x44')]['id']}})[_0x22db('0x23')](handleEntityNotFound(_0x54a919,null))['then'](removeEntity(_0x54a919,null))[_0x22db('0x46')](handleError(_0x54a919,null));};exports[_0x22db('0x4a')]=function(_0x199767,_0x29c924,_0x36c443){var _0x19af0c={};var _0x533489={};var _0x83fb0a;var _0x43446e;return db['VtigerAccount'][_0x22db('0x4b')]({'where':{'id':_0x199767['params']['id']}})[_0x22db('0x23')](handleEntityNotFound(_0x29c924,null))[_0x22db('0x23')](function(_0x12bca3){if(_0x12bca3){_0x83fb0a=_0x12bca3;_0x533489['model']=_[_0x22db('0x30')](db[_0x22db('0x4c')][_0x22db('0x2b')]);_0x533489[_0x22db('0x2f')]=_[_0x22db('0x30')](_0x199767[_0x22db('0x2f')]);_0x533489[_0x22db('0x3a')]=_[_0x22db('0x31')](_0x533489['model'],_0x533489[_0x22db('0x2f')]);_0x19af0c['attributes']=_[_0x22db('0x31')](_0x533489['model'],qs[_0x22db('0x33')](_0x199767[_0x22db('0x2f')][_0x22db('0x33')]));_0x19af0c[_0x22db('0x32')]=_0x19af0c[_0x22db('0x32')][_0x22db('0x34')]?_0x19af0c[_0x22db('0x32')]:_0x533489[_0x22db('0x2e')];_0x19af0c['order']=qs[_0x22db('0x38')](_0x199767[_0x22db('0x2f')]['sort']);_0x19af0c['where']=qs[_0x22db('0x3a')](_[_0x22db('0x3b')](_0x199767['query'],_0x533489[_0x22db('0x3a')]));if(_0x199767['query'][_0x22db('0x3c')]){_0x19af0c[_0x22db('0x39')]=_['merge'](_0x19af0c[_0x22db('0x39')],{'$or':_[_0x22db('0x29')](_0x19af0c['attributes'],function(_0x24dfd6){var _0x1422d6={};_0x1422d6[_0x24dfd6]={'$like':'%'+_0x199767['query'][_0x22db('0x3c')]+'%'};return _0x1422d6;})});}_0x19af0c=_['merge']({},_0x19af0c,_0x199767['options']);return _0x83fb0a[_0x22db('0x4a')](_0x19af0c);}})[_0x22db('0x23')](function(_0x9f2618){if(_0x9f2618){_0x43446e=_0x9f2618['length'];if(!_0x199767[_0x22db('0x2f')][_0x22db('0x35')](_0x22db('0x36'))){_0x19af0c['limit']=qs[_0x22db('0x1d')](_0x199767[_0x22db('0x2f')][_0x22db('0x1d')]);_0x19af0c['offset']=qs[_0x22db('0x1b')](_0x199767[_0x22db('0x2f')][_0x22db('0x1b')]);}return _0x83fb0a[_0x22db('0x4a')](_0x19af0c);}})['then'](function(_0x512f29){if(_0x512f29){return _0x512f29?{'count':_0x43446e,'rows':_0x512f29}:null;}})['then'](respondWithResult(_0x29c924,null))[_0x22db('0x46')](handleError(_0x29c924,null));};exports['addConfiguration']=function(_0xb06845,_0x49d5ac,_0x273d0c){if(_0xb06845[_0x22db('0x48')]['id']){delete _0xb06845[_0x22db('0x48')]['id'];}return db['VtigerAccount'][_0x22db('0x4b')]({'where':{'id':_0xb06845['params']['id']}})[_0x22db('0x23')](handleEntityNotFound(_0x49d5ac,null))[_0x22db('0x23')](function(_0x286815){if(_0x286815){_0xb06845[_0x22db('0x48')][_0x22db('0x4d')]=_0x286815['id'];_0xb06845[_0x22db('0x48')][_0x22db('0x4e')]=integrations[_0x22db('0x4f')](_0xb06845[_0x22db('0x48')][_0x22db('0x50')],_0xb06845[_0x22db('0x48')][_0x22db('0x2d')]);_0xb06845[_0x22db('0x48')][_0x22db('0x51')]=integrations[_0x22db('0x52')](_0xb06845[_0x22db('0x48')][_0x22db('0x50')],_0xb06845[_0x22db('0x48')][_0x22db('0x2d')]);return db[_0x22db('0x4c')][_0x22db('0x47')](_0xb06845[_0x22db('0x48')],{'include':[{'model':db[_0x22db('0x53')],'as':'Subjects'},{'model':db[_0x22db('0x53')],'as':_0x22db('0x51')}]});}return null;})[_0x22db('0x23')](respondWithResult(_0x49d5ac,null))[_0x22db('0x46')](handleError(_0x49d5ac,null));};var md5=require(_0x22db('0x54'));exports['getFields']=function(_0x3f90c4,_0x50e713,_0x4ab531){var _0x310f72=null;var _0xd9905a=null;var _0x5920c7=null;var _0x5487fa=null;var _0x3c139a='';return db['VtigerAccount'][_0x22db('0x4b')]({'where':{'id':_0x3f90c4[_0x22db('0x44')]['id']},'attributes':['id',_0x22db('0x26'),_0x22db('0x55'),'description','moduleName','remoteUri',_0x22db('0x56'),_0x22db('0x57')]})[_0x22db('0x23')](handleEntityNotFound(_0x50e713,null))['then'](function(_0x252001){if(_0x252001){_0x310f72=_0x252001['username'];_0xd9905a=_0x252001[_0x22db('0x57')];_0x5920c7=_0x252001[_0x22db('0x58')];_0x3c139a=_0x252001['remoteUri'];var _0x1ffa59=_0x3c139a[_0x22db('0x59')](-0x1);if(_0x1ffa59==='/'){_0x3c139a=_0x3c139a[_0x22db('0x5a')](0x0,_0x3c139a[_0x22db('0x5b')](_0x1ffa59));}_0x5487fa=util[_0x22db('0x5c')](_0x22db('0x5d'),_0x3c139a);var _0xb4a678={'method':_0x22db('0x5e'),'uri':_0x5487fa,'qs':{'operation':'getchallenge','username':_0x252001[_0x22db('0x55')]},'json':!![]};return rp(_0xb4a678);}})[_0x22db('0x23')](function(_0x3991cc){if(_0x3991cc[_0x22db('0x5f')]){var _0x1b90ed={'method':_0x22db('0x60'),'uri':_0x5487fa,'form':{'operation':_0x22db('0x61'),'username':_0x310f72,'accessKey':md5(_0x3991cc[_0x22db('0x62')][_0x22db('0x63')]+_0xd9905a)},'json':!![]};return rp(_0x1b90ed);}})[_0x22db('0x23')](function(_0x139ac0){if(_0x139ac0[_0x22db('0x5f')]){var _0x43d027={'method':_0x22db('0x5e'),'uri':_0x5487fa,'qs':{'operation':_0x22db('0x64'),'username':_0x310f72,'sessionName':_0x139ac0[_0x22db('0x62')][_0x22db('0x65')],'elementType':_0x5920c7},'json':!![]};return rp(_0x43d027);}})[_0x22db('0x23')](function(_0x39078e){if(_0x39078e[_0x22db('0x5f')]){var _0x55868c=[_0x22db('0x66'),_0x22db('0x67'),_0x22db('0x68')];_[_0x22db('0x69')](_0x39078e[_0x22db('0x62')][_0x22db('0x33')],function(_0x1c2b83){return _0x55868c[_0x22db('0x6a')](_0x1c2b83['type'][_0x22db('0x26')]);});_[_0x22db('0x69')](_0x39078e[_0x22db('0x62')][_0x22db('0x33')],function(_0x13dee6){return _0x13dee6[_0x22db('0x6b')]==='false';});return{'count':_0x39078e[_0x22db('0x62')][_0x22db('0x33')][_0x22db('0x34')],'rows':_[_0x22db('0x29')](_0x39078e[_0x22db('0x62')][_0x22db('0x33')],function(_0x4c4611){return{'id':_0x4c4611[_0x22db('0x26')],'name':_0x4c4611[_0x22db('0x6c')],'custom':_['startsWith'](_0x4c4611['name'],_0x22db('0x6d'))?!![]:![],'options':_0x4c4611[_0x22db('0x2d')][_0x22db('0x26')]===_0x22db('0x6e')&&_0x4c4611['type'][_0x22db('0x6f')][_0x22db('0x34')]>0x0?_[_0x22db('0x29')](_0x4c4611['type']['picklistValues'],function(_0x241ad1){return{'name':_0x241ad1['label'],'value':_0x241ad1[_0x22db('0x70')]};}):[]};})};}})['then'](respondWithResult(_0x50e713,null))[_0x22db('0x46')](function(_0x26a17a){console[_0x22db('0x71')](_0x22db('0x72')+_0x26a17a);var _0x1819e4=_0x3f90c4[_0x22db('0x2f')][_0x22db('0x73')]?0x1f4:_0x26a17a['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x22db('0x74'),_0x1819e4,JSON['stringify'](_0x26a17a));delete _0x26a17a[_0x22db('0x26')];if(_0x1819e4===0x191){_0x1819e4=0x190;}_0x50e713[_0x22db('0x18')](_0x1819e4)[_0x22db('0x27')](_0x3f90c4[_0x22db('0x2f')][_0x22db('0x73')]?{'message':_0x22db('0x75'),'statusCode':_0x26a17a[_0x22db('0x76')]}:_0x26a17a);});}; \ No newline at end of file +var _0x5f1b=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','fields','find','create','catch','update','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x1c986c,_0x48f730){var _0xc6e84d=function(_0x1c4bb3){while(--_0x1c4bb3){_0x1c986c['push'](_0x1c986c['shift']());}};_0xc6e84d(++_0x48f730);}(_0x5f1b,0x70));var _0xb5f1=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0x5f1b[_0x687ddc];return _0x441991;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5f1('0x0'));var zipdir=require(_0xb5f1('0x1'));var jsonpatch=require(_0xb5f1('0x2'));var rp=require(_0xb5f1('0x3'));var moment=require(_0xb5f1('0x4'));var BPromise=require(_0xb5f1('0x5'));var Mustache=require('mustache');var util=require(_0xb5f1('0x6'));var path=require(_0xb5f1('0x7'));var sox=require(_0xb5f1('0x8'));var csv=require(_0xb5f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5f1('0xa'));var _=require(_0xb5f1('0xb'));var squel=require('squel');var crypto=require(_0xb5f1('0xc'));var jsforce=require(_0xb5f1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5f1('0xe'));var Papa=require(_0xb5f1('0xf'));var Redis=require(_0xb5f1('0x10'));var authService=require(_0xb5f1('0x11'));var qs=require(_0xb5f1('0x12'));var as=require(_0xb5f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5f1('0x14'))('api');var utils=require(_0xb5f1('0x15'));var config=require(_0xb5f1('0x16'));var licenseUtil=require(_0xb5f1('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb5f1('0x18'));function respondWithStatusCode(_0x24e596,_0x2f61a4){_0x2f61a4=_0x2f61a4||0xcc;return function(_0x5717bd){if(_0x5717bd){return _0x24e596[_0xb5f1('0x19')](_0x2f61a4);}return _0x24e596['status'](_0x2f61a4)[_0xb5f1('0x1a')]();};}function respondWithResult(_0x5ef7d8,_0x53e1dd){_0x53e1dd=_0x53e1dd||0xc8;return function(_0xdaf4ca){if(_0xdaf4ca){return _0x5ef7d8[_0xb5f1('0x1b')](_0x53e1dd)[_0xb5f1('0x1c')](_0xdaf4ca);}};}function respondWithFilteredResult(_0x33fbed,_0x8cd130){return function(_0xed36a2){if(_0xed36a2){var _0x12f6cc=typeof _0x8cd130[_0xb5f1('0x1d')]===_0xb5f1('0x1e')&&typeof _0x8cd130[_0xb5f1('0x1f')]===_0xb5f1('0x1e');var _0x4d62c8=_0xed36a2[_0xb5f1('0x20')];var _0x2cfc21=_0x12f6cc?0x0:_0x8cd130[_0xb5f1('0x1d')];var _0x5624b1=_0x12f6cc?_0xed36a2['count']:_0x8cd130[_0xb5f1('0x1d')]+_0x8cd130['limit'];var _0x572fcb;if(_0x5624b1>=_0x4d62c8){_0x5624b1=_0x4d62c8;_0x572fcb=0xc8;}else{_0x572fcb=0xce;}_0x33fbed[_0xb5f1('0x1b')](_0x572fcb);return _0x33fbed[_0xb5f1('0x21')](_0xb5f1('0x22'),_0x2cfc21+'-'+_0x5624b1+'/'+_0x4d62c8)['json'](_0xed36a2);}return null;};}function patchUpdates(_0x124707){return function(_0x173980){try{jsonpatch[_0xb5f1('0x23')](_0x173980,_0x124707,!![]);}catch(_0x551494){return BPromise[_0xb5f1('0x24')](_0x551494);}return _0x173980['save']();};}function saveUpdates(_0x204c67,_0x4e78f4){return function(_0x195d24){if(_0x195d24){return _0x195d24['update'](_0x204c67)[_0xb5f1('0x25')](function(_0x3a3b23){return _0x3a3b23;});}return null;};}function removeEntity(_0x12ecce,_0x2fea1e){return function(_0x46d044){if(_0x46d044){return _0x46d044['destroy']()[_0xb5f1('0x25')](function(){_0x12ecce[_0xb5f1('0x1b')](0xcc)[_0xb5f1('0x1a')]();});}};}function handleEntityNotFound(_0xc7008e,_0x498a33){return function(_0x325a0e){if(!_0x325a0e){_0xc7008e[_0xb5f1('0x19')](0x194);}return _0x325a0e;};}function handleError(_0x5c1f2a,_0x576860){_0x576860=_0x576860||0x1f4;return function(_0x449c51){logger[_0xb5f1('0x26')](_0x449c51[_0xb5f1('0x27')]);if(_0x449c51['name']){delete _0x449c51[_0xb5f1('0x28')];}_0x5c1f2a['status'](_0x576860)['send'](_0x449c51);};}exports[_0xb5f1('0x29')]=function(_0x949a62,_0x1cc0f1){var _0x1235c2={},_0x195a36={},_0x1dccf7={'count':0x0,'rows':[]};var _0x416f90=_[_0xb5f1('0x2a')](db[_0xb5f1('0x2b')][_0xb5f1('0x2c')],function(_0x6ce0d4){return{'name':_0x6ce0d4[_0xb5f1('0x2d')],'type':_0x6ce0d4[_0xb5f1('0x2e')][_0xb5f1('0x2f')]};});_0x195a36[_0xb5f1('0x30')]=_[_0xb5f1('0x2a')](_0x416f90,_0xb5f1('0x28'));_0x195a36[_0xb5f1('0x31')]=_[_0xb5f1('0x32')](_0x949a62[_0xb5f1('0x31')]);_0x195a36['filters']=_['intersection'](_0x195a36[_0xb5f1('0x30')],_0x195a36['query']);_0x1235c2[_0xb5f1('0x33')]=_[_0xb5f1('0x34')](_0x195a36[_0xb5f1('0x30')],qs['fields'](_0x949a62[_0xb5f1('0x31')]['fields']));_0x1235c2[_0xb5f1('0x33')]=_0x1235c2[_0xb5f1('0x33')][_0xb5f1('0x35')]?_0x1235c2[_0xb5f1('0x33')]:_0x195a36[_0xb5f1('0x30')];if(!_0x949a62[_0xb5f1('0x31')][_0xb5f1('0x36')](_0xb5f1('0x37'))){_0x1235c2['limit']=qs[_0xb5f1('0x1f')](_0x949a62[_0xb5f1('0x31')]['limit']);_0x1235c2[_0xb5f1('0x1d')]=qs['offset'](_0x949a62[_0xb5f1('0x31')][_0xb5f1('0x1d')]);}_0x1235c2[_0xb5f1('0x38')]=qs[_0xb5f1('0x39')](_0x949a62[_0xb5f1('0x31')][_0xb5f1('0x39')]);_0x1235c2[_0xb5f1('0x3a')]=qs[_0xb5f1('0x3b')](_['pick'](_0x949a62[_0xb5f1('0x31')],_0x195a36['filters']),_0x416f90);if(_0x949a62['query'][_0xb5f1('0x3c')]){_0x1235c2['where']=_['merge'](_0x1235c2[_0xb5f1('0x3a')],{'$or':_['map'](_0x416f90,function(_0x518e10){if(_0x518e10['type']!=='VIRTUAL'){var _0x58dbf3={};_0x58dbf3[_0x518e10[_0xb5f1('0x28')]]={'$like':'%'+_0x949a62[_0xb5f1('0x31')]['filter']+'%'};return _0x58dbf3;}})});}_0x1235c2=_[_0xb5f1('0x3d')]({},_0x1235c2,_0x949a62[_0xb5f1('0x3e')]);var _0x1c6b8d={'where':_0x1235c2[_0xb5f1('0x3a')]};return db[_0xb5f1('0x2b')][_0xb5f1('0x20')](_0x1c6b8d)['then'](function(_0x2a7838){_0x1dccf7[_0xb5f1('0x20')]=_0x2a7838;if(_0x949a62['query'][_0xb5f1('0x3f')]){_0x1235c2[_0xb5f1('0x40')]=[{'all':!![]}];}return db[_0xb5f1('0x2b')][_0xb5f1('0x41')](_0x1235c2);})[_0xb5f1('0x25')](function(_0x6076d4){_0x1dccf7[_0xb5f1('0x42')]=_0x6076d4;return _0x1dccf7;})[_0xb5f1('0x25')](respondWithFilteredResult(_0x1cc0f1,_0x1235c2))['catch'](handleError(_0x1cc0f1,null));};exports['show']=function(_0x216521,_0x18eab0){var _0x3f148b={'raw':![],'where':{'id':_0x216521['params']['id']}},_0x75e1c={};_0x75e1c[_0xb5f1('0x30')]=_['keys'](db[_0xb5f1('0x2b')]['rawAttributes']);_0x75e1c[_0xb5f1('0x31')]=_[_0xb5f1('0x32')](_0x216521['query']);_0x75e1c[_0xb5f1('0x3b')]=_[_0xb5f1('0x34')](_0x75e1c[_0xb5f1('0x30')],_0x75e1c[_0xb5f1('0x31')]);_0x3f148b[_0xb5f1('0x33')]=_[_0xb5f1('0x34')](_0x75e1c['model'],qs[_0xb5f1('0x43')](_0x216521[_0xb5f1('0x31')][_0xb5f1('0x43')]));_0x3f148b[_0xb5f1('0x33')]=_0x3f148b['attributes']['length']?_0x3f148b[_0xb5f1('0x33')]:_0x75e1c[_0xb5f1('0x30')];if(_0x216521[_0xb5f1('0x31')][_0xb5f1('0x3f')]){_0x3f148b[_0xb5f1('0x40')]=[{'all':!![]}];}_0x3f148b=_[_0xb5f1('0x3d')]({},_0x3f148b,_0x216521['options']);return db[_0xb5f1('0x2b')][_0xb5f1('0x44')](_0x3f148b)[_0xb5f1('0x25')](handleEntityNotFound(_0x18eab0,null))[_0xb5f1('0x25')](respondWithResult(_0x18eab0,null))['catch'](handleError(_0x18eab0,null));};exports[_0xb5f1('0x45')]=function(_0x342194,_0x434ede){return db[_0xb5f1('0x2b')][_0xb5f1('0x45')](_0x342194['body'],{})[_0xb5f1('0x25')](respondWithResult(_0x434ede,0xc9))[_0xb5f1('0x46')](handleError(_0x434ede,null));};exports[_0xb5f1('0x47')]=function(_0x255356,_0x1733c6){if(_0x255356[_0xb5f1('0x48')]['id']){delete _0x255356[_0xb5f1('0x48')]['id'];}return db[_0xb5f1('0x2b')]['find']({'where':{'id':_0x255356[_0xb5f1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1733c6,null))['then'](saveUpdates(_0x255356['body'],null))[_0xb5f1('0x25')](respondWithResult(_0x1733c6,null))[_0xb5f1('0x46')](handleError(_0x1733c6,null));};exports[_0xb5f1('0x4a')]=function(_0x40d5d4,_0x3c5db4){return db[_0xb5f1('0x2b')][_0xb5f1('0x44')]({'where':{'id':_0x40d5d4[_0xb5f1('0x49')]['id']}})[_0xb5f1('0x25')](handleEntityNotFound(_0x3c5db4,null))[_0xb5f1('0x25')](removeEntity(_0x3c5db4,null))[_0xb5f1('0x46')](handleError(_0x3c5db4,null));};exports[_0xb5f1('0x4b')]=function(_0x443196,_0x24f96c,_0x52fb01){var _0x72a768={};var _0x1c094e={};var _0x9f43ed;var _0x1e90b9;return db[_0xb5f1('0x2b')][_0xb5f1('0x4c')]({'where':{'id':_0x443196[_0xb5f1('0x49')]['id']}})[_0xb5f1('0x25')](handleEntityNotFound(_0x24f96c,null))[_0xb5f1('0x25')](function(_0x5b3411){if(_0x5b3411){_0x9f43ed=_0x5b3411;_0x1c094e[_0xb5f1('0x30')]=_[_0xb5f1('0x32')](db[_0xb5f1('0x4d')][_0xb5f1('0x2c')]);_0x1c094e[_0xb5f1('0x31')]=_['keys'](_0x443196[_0xb5f1('0x31')]);_0x1c094e[_0xb5f1('0x3b')]=_[_0xb5f1('0x34')](_0x1c094e['model'],_0x1c094e['query']);_0x72a768[_0xb5f1('0x33')]=_[_0xb5f1('0x34')](_0x1c094e['model'],qs[_0xb5f1('0x43')](_0x443196[_0xb5f1('0x31')]['fields']));_0x72a768[_0xb5f1('0x33')]=_0x72a768[_0xb5f1('0x33')][_0xb5f1('0x35')]?_0x72a768[_0xb5f1('0x33')]:_0x1c094e[_0xb5f1('0x30')];_0x72a768[_0xb5f1('0x38')]=qs['sort'](_0x443196['query'][_0xb5f1('0x39')]);_0x72a768['where']=qs[_0xb5f1('0x3b')](_[_0xb5f1('0x4e')](_0x443196['query'],_0x1c094e[_0xb5f1('0x3b')]));if(_0x443196[_0xb5f1('0x31')][_0xb5f1('0x3c')]){_0x72a768[_0xb5f1('0x3a')]=_[_0xb5f1('0x3d')](_0x72a768[_0xb5f1('0x3a')],{'$or':_[_0xb5f1('0x2a')](_0x72a768[_0xb5f1('0x33')],function(_0x233818){var _0x54d6c4={};_0x54d6c4[_0x233818]={'$like':'%'+_0x443196['query'][_0xb5f1('0x3c')]+'%'};return _0x54d6c4;})});}_0x72a768=_['merge']({},_0x72a768,_0x443196[_0xb5f1('0x3e')]);return _0x9f43ed[_0xb5f1('0x4b')](_0x72a768);}})[_0xb5f1('0x25')](function(_0x18ec23){if(_0x18ec23){_0x1e90b9=_0x18ec23[_0xb5f1('0x35')];if(!_0x443196[_0xb5f1('0x31')][_0xb5f1('0x36')]('nolimit')){_0x72a768[_0xb5f1('0x1f')]=qs[_0xb5f1('0x1f')](_0x443196[_0xb5f1('0x31')]['limit']);_0x72a768['offset']=qs['offset'](_0x443196[_0xb5f1('0x31')][_0xb5f1('0x1d')]);}return _0x9f43ed[_0xb5f1('0x4b')](_0x72a768);}})[_0xb5f1('0x25')](function(_0x3a2e69){if(_0x3a2e69){return _0x3a2e69?{'count':_0x1e90b9,'rows':_0x3a2e69}:null;}})[_0xb5f1('0x25')](respondWithResult(_0x24f96c,null))[_0xb5f1('0x46')](handleError(_0x24f96c,null));};exports[_0xb5f1('0x4f')]=function(_0x124ce8,_0x5c24fb,_0x4a65bb){if(_0x124ce8[_0xb5f1('0x48')]['id']){delete _0x124ce8[_0xb5f1('0x48')]['id'];}return db['VtigerAccount'][_0xb5f1('0x4c')]({'where':{'id':_0x124ce8['params']['id']}})[_0xb5f1('0x25')](handleEntityNotFound(_0x5c24fb,null))['then'](function(_0x27eb82){if(_0x27eb82){_0x124ce8[_0xb5f1('0x48')][_0xb5f1('0x50')]=_0x27eb82['id'];_0x124ce8['body'][_0xb5f1('0x51')]=integrations[_0xb5f1('0x52')](_0x124ce8[_0xb5f1('0x48')][_0xb5f1('0x53')],_0x124ce8['body']['type']);_0x124ce8['body'][_0xb5f1('0x54')]=integrations[_0xb5f1('0x55')](_0x124ce8[_0xb5f1('0x48')][_0xb5f1('0x53')],_0x124ce8['body']['type']);return db[_0xb5f1('0x4d')][_0xb5f1('0x45')](_0x124ce8[_0xb5f1('0x48')],{'include':[{'model':db['VtigerField'],'as':_0xb5f1('0x51')},{'model':db[_0xb5f1('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5c24fb,null))[_0xb5f1('0x46')](handleError(_0x5c24fb,null));};var md5=require('md5');exports['getFields']=function(_0x57afbb,_0x16c855,_0x2251c3){var _0x47c15a=null;var _0x1d5393=null;var _0x5c3d77=null;var _0x94f5c7=null;var _0x1e75f='';return db[_0xb5f1('0x2b')]['findOne']({'where':{'id':_0x57afbb[_0xb5f1('0x49')]['id']},'attributes':['id',_0xb5f1('0x28'),_0xb5f1('0x57'),_0xb5f1('0x58'),_0xb5f1('0x59'),_0xb5f1('0x5a'),_0xb5f1('0x5b'),_0xb5f1('0x5c')]})['then'](handleEntityNotFound(_0x16c855,null))['then'](function(_0x42549f){if(_0x42549f){_0x47c15a=_0x42549f[_0xb5f1('0x57')];_0x1d5393=_0x42549f[_0xb5f1('0x5c')];_0x5c3d77=_0x42549f['moduleName'];_0x1e75f=_0x42549f[_0xb5f1('0x5a')];var _0x52e8a4=_0x1e75f[_0xb5f1('0x5d')](-0x1);if(_0x52e8a4==='/'){_0x1e75f=_0x1e75f[_0xb5f1('0x5e')](0x0,_0x1e75f[_0xb5f1('0x5f')](_0x52e8a4));}_0x94f5c7=util[_0xb5f1('0x60')]('%s/webservice.php',_0x1e75f);var _0x346216={'method':_0xb5f1('0x61'),'uri':_0x94f5c7,'qs':{'operation':_0xb5f1('0x62'),'username':_0x42549f[_0xb5f1('0x57')]},'json':!![]};return rp(_0x346216);}})[_0xb5f1('0x25')](function(_0x1a86f2){if(_0x1a86f2[_0xb5f1('0x63')]){var _0x54805e={'method':_0xb5f1('0x64'),'uri':_0x94f5c7,'form':{'operation':_0xb5f1('0x65'),'username':_0x47c15a,'accessKey':md5(_0x1a86f2[_0xb5f1('0x66')][_0xb5f1('0x67')]+_0x1d5393)},'json':!![]};return rp(_0x54805e);}})['then'](function(_0xdd41bb){if(_0xdd41bb['success']){var _0x5a3f35={'method':_0xb5f1('0x61'),'uri':_0x94f5c7,'qs':{'operation':'describe','username':_0x47c15a,'sessionName':_0xdd41bb[_0xb5f1('0x66')][_0xb5f1('0x68')],'elementType':_0x5c3d77},'json':!![]};return rp(_0x5a3f35);}})[_0xb5f1('0x25')](function(_0x2a2b79){if(_0x2a2b79['success']){var _0x1d8312=[_0xb5f1('0x69'),_0xb5f1('0x6a'),_0xb5f1('0x6b')];_[_0xb5f1('0x6c')](_0x2a2b79['result'][_0xb5f1('0x43')],function(_0x301066){return _0x1d8312[_0xb5f1('0x6d')](_0x301066[_0xb5f1('0x2e')]['name']);});_[_0xb5f1('0x6c')](_0x2a2b79[_0xb5f1('0x66')][_0xb5f1('0x43')],function(_0x42ab78){return _0x42ab78[_0xb5f1('0x6e')]===_0xb5f1('0x6f');});return{'count':_0x2a2b79[_0xb5f1('0x66')][_0xb5f1('0x43')]['length'],'rows':_[_0xb5f1('0x2a')](_0x2a2b79['result'][_0xb5f1('0x43')],function(_0x30b9bd){return{'id':_0x30b9bd[_0xb5f1('0x28')],'name':_0x30b9bd[_0xb5f1('0x70')],'custom':_[_0xb5f1('0x71')](_0x30b9bd['name'],'cf_')?!![]:![],'options':_0x30b9bd[_0xb5f1('0x2e')][_0xb5f1('0x28')]==='picklist'&&_0x30b9bd[_0xb5f1('0x2e')]['picklistValues']['length']>0x0?_[_0xb5f1('0x2a')](_0x30b9bd['type'][_0xb5f1('0x72')],function(_0x569767){return{'name':_0x569767['label'],'value':_0x569767[_0xb5f1('0x73')]};}):[]};})};}})[_0xb5f1('0x25')](respondWithResult(_0x16c855,null))[_0xb5f1('0x46')](function(_0x355513){console[_0xb5f1('0x74')](_0xb5f1('0x75')+_0x355513);var _0x40993d=_0x57afbb['query'][_0xb5f1('0x76')]?0x1f4:_0x355513[_0xb5f1('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb5f1('0x78'),_0x40993d,JSON[_0xb5f1('0x79')](_0x355513));delete _0x355513['name'];if(_0x40993d===0x191){_0x40993d=0x190;}_0x16c855[_0xb5f1('0x1b')](_0x40993d)[_0xb5f1('0x7a')](_0x57afbb[_0xb5f1('0x31')][_0xb5f1('0x76')]?{'message':_0xb5f1('0x7b'),'statusCode':_0x355513[_0xb5f1('0x77')]}:_0x355513);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index e399fa5..4afe5fb 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 _0x7981=['util','../../config/logger','bluebird','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x10b95c,_0x134f5a){var _0x53fbf8=function(_0x5cc266){while(--_0x5cc266){_0x10b95c['push'](_0x10b95c['shift']());}};_0x53fbf8(++_0x134f5a);}(_0x7981,0x104));var _0x1798=function(_0x2badbb,_0x2bb6d9){_0x2badbb=_0x2badbb-0x0;var _0x5e9d06=_0x7981[_0x2badbb];return _0x5e9d06;};'use strict';var _=require('lodash');var util=require(_0x1798('0x0'));var logger=require(_0x1798('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1798('0x2'));var rp=require(_0x1798('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1798('0x4'));var integrations=require(_0x1798('0x5'));module[_0x1798('0x6')]=function(_0x228046,_0x532b67){return _0x228046[_0x1798('0x7')](_0x1798('0x8'),attributes,{'tableName':_0x1798('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88a6=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5d3276,_0xd38063){var _0x3562f5=function(_0x5c5594){while(--_0x5c5594){_0x5d3276['push'](_0x5d3276['shift']());}};_0x3562f5(++_0xd38063);}(_0x88a6,0x172));var _0x688a=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0x88a6[_0x31abee];return _0x3c1761;};'use strict';var _=require(_0x688a('0x0'));var util=require(_0x688a('0x1'));var logger=require('../../config/logger')(_0x688a('0x2'));var moment=require(_0x688a('0x3'));var BPromise=require(_0x688a('0x4'));var rp=require(_0x688a('0x5'));var fs=require('fs');var path=require(_0x688a('0x6'));var rimraf=require('rimraf');var config=require(_0x688a('0x7'));var attributes=require(_0x688a('0x8'));var integrations=require(_0x688a('0x9'));module[_0x688a('0xa')]=function(_0x1301d4,_0x390b09){return _0x1301d4[_0x688a('0xb')]('VtigerAccount',attributes,{'tableName':_0x688a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index f960400..5f621f2 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 _0xeffd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeffd,0x6b));var _0xdeff=function(_0xf10758,_0x334d43){_0xf10758=_0xf10758-0x0;var _0x2327dc=_0xeffd[_0xf10758];return _0x2327dc;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x281ad7,_0x256323,_0x39878e){return new BPromise(function(_0x12e953,_0x24897a){return client['request'](_0x281ad7,_0x39878e)[_0xdeff('0xd')](function(_0x45a8a6){logger[_0xdeff('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x256323,_0xdeff('0xf'));logger[_0xdeff('0x10')](_0xdeff('0x11'),_0x256323,_0xdeff('0xf'),JSON[_0xdeff('0x12')](_0x45a8a6));if(_0x45a8a6[_0xdeff('0x13')]){if(_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x14')]===0x1f4){logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')]['message']);return _0x24897a(_0x45a8a6[_0xdeff('0x13')]['message']);}logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x16')]);return _0x12e953(_0x45a8a6[_0xdeff('0x13')]['message']);}else{logger[_0xdeff('0xe')](_0xdeff('0x15'),_0x256323,_0xdeff('0xf'));_0x12e953(_0x45a8a6[_0xdeff('0x17')][_0xdeff('0x16')]);}})[_0xdeff('0x18')](function(_0x577244){logger['error'](_0xdeff('0x15'),_0x256323,_0x577244);_0x24897a(_0x577244);});});}exports['GetVtigerAccount']=function(_0x5c9837){var _0x35635f=this;return new Promise(function(_0x369e13,_0x4b14b6){return db[_0xdeff('0x19')][_0xdeff('0x1a')]({'raw':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x5c9837['options']?_0x5c9837['options']['attributes']||null:null,'limit':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1e')]||null:null,'include':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x5c9837['options']['include'],function(_0x3b2554){return{'model':db[_0x3b2554[_0xdeff('0x21')]],'as':_0x3b2554['as'],'attributes':_0x3b2554[_0xdeff('0x22')],'include':_0x3b2554[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x3b2554['include'],function(_0xb08f19){return{'model':db[_0xb08f19[_0xdeff('0x21')]],'as':_0xb08f19['as'],'attributes':_0xb08f19[_0xdeff('0x22')],'include':_0xb08f19[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0xb08f19[_0xdeff('0x1f')],function(_0x3d0111){return{'model':db[_0x3d0111['model']],'as':_0x3d0111['as'],'attributes':_0x3d0111[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x53b168){logger['info'](_0xdeff('0x23'),_0x5c9837);logger[_0xdeff('0x10')](_0xdeff('0x23'),_0x5c9837,JSON[_0xdeff('0x12')](_0x53b168));_0x369e13(_0x53b168);})[_0xdeff('0x18')](function(_0xf9b278){logger[_0xdeff('0x13')]('GetVtigerAccount',_0xf9b278[_0xdeff('0x16')],_0x5c9837);_0x4b14b6(_0x35635f[_0xdeff('0x13')](0x1f4,_0xf9b278[_0xdeff('0x16')]));});});};exports['ShowVtigerAccount']=function(_0x59f7a0){var _0x346743=this;return new Promise(function(_0x505e3f,_0x69842a){return db[_0xdeff('0x19')][_0xdeff('0x24')]({'raw':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')]['attributes']||null:null,'include':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')],function(_0x321ef0){return{'model':db[_0x321ef0['model']],'as':_0x321ef0['as'],'attributes':_0x321ef0[_0xdeff('0x22')],'include':_0x321ef0['include']?_[_0xdeff('0x20')](_0x321ef0[_0xdeff('0x1f')],function(_0x2e1736){return{'model':db[_0x2e1736[_0xdeff('0x21')]],'as':_0x2e1736['as'],'attributes':_0x2e1736[_0xdeff('0x22')],'include':_0x2e1736[_0xdeff('0x1f')]?_['map'](_0x2e1736[_0xdeff('0x1f')],function(_0x3bf462){return{'model':db[_0x3bf462['model']],'as':_0x3bf462['as'],'attributes':_0x3bf462[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x1c6d4c){logger[_0xdeff('0xe')](_0xdeff('0x25'),_0x59f7a0);logger[_0xdeff('0x10')](_0xdeff('0x25'),_0x59f7a0,JSON[_0xdeff('0x12')](_0x1c6d4c));_0x505e3f(_0x1c6d4c);})['catch'](function(_0x118752){logger['error'](_0xdeff('0x25'),_0x118752[_0xdeff('0x16')],_0x59f7a0);_0x69842a(_0x346743[_0xdeff('0x13')](0x1f4,_0x118752['message']));});});}; \ No newline at end of file +var _0x4483=['client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVtigerAccount','options','raw','where','attributes','include','model','find','map','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x325d3c,_0xc4f35d){var _0x42b1e2=function(_0x5e1bc3){while(--_0x5e1bc3){_0x325d3c['push'](_0x325d3c['shift']());}};_0x42b1e2(++_0xc4f35d);}(_0x4483,0x1a3));var _0x3448=function(_0x23e5a8,_0x1a32d0){_0x23e5a8=_0x23e5a8-0x0;var _0x39df93=_0x4483[_0x23e5a8];return _0x39df93;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});}exports[_0x3448('0x17')]=function(_0x425514){var _0x4a348c=this;return new Promise(function(_0x1658cd,_0x5b410d){return db['VtigerAccount']['findAll']({'raw':_0x425514[_0x3448('0x18')]?_0x425514[_0x3448('0x18')][_0x3448('0x19')]===undefined?!![]:![]:!![],'where':_0x425514['options']?_0x425514[_0x3448('0x18')][_0x3448('0x1a')]||null:null,'attributes':_0x425514[_0x3448('0x18')]?_0x425514[_0x3448('0x18')][_0x3448('0x1b')]||null:null,'limit':_0x425514[_0x3448('0x18')]?_0x425514['options']['limit']||null:null,'include':_0x425514['options']?_0x425514[_0x3448('0x18')][_0x3448('0x1c')]?_['map'](_0x425514['options'][_0x3448('0x1c')],function(_0x4371d6){return{'model':db[_0x4371d6[_0x3448('0x1d')]],'as':_0x4371d6['as'],'attributes':_0x4371d6[_0x3448('0x1b')],'include':_0x4371d6[_0x3448('0x1c')]?_['map'](_0x4371d6[_0x3448('0x1c')],function(_0x1b5c49){return{'model':db[_0x1b5c49[_0x3448('0x1d')]],'as':_0x1b5c49['as'],'attributes':_0x1b5c49[_0x3448('0x1b')],'include':_0x1b5c49[_0x3448('0x1c')]?_['map'](_0x1b5c49[_0x3448('0x1c')],function(_0x393081){return{'model':db[_0x393081['model']],'as':_0x393081['as'],'attributes':_0x393081[_0x3448('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3448('0xc')](function(_0x310912){logger[_0x3448('0xd')](_0x3448('0x17'),_0x425514);logger[_0x3448('0x10')](_0x3448('0x17'),_0x425514,JSON[_0x3448('0x12')](_0x310912));_0x1658cd(_0x310912);})['catch'](function(_0x3307dc){logger[_0x3448('0x13')](_0x3448('0x17'),_0x3307dc['message'],_0x425514);_0x5b410d(_0x4a348c[_0x3448('0x13')](0x1f4,_0x3307dc['message']));});});};exports['ShowVtigerAccount']=function(_0x493898){var _0x52fb48=this;return new Promise(function(_0xff6513,_0x5e96f0){return db['VtigerAccount'][_0x3448('0x1e')]({'raw':_0x493898[_0x3448('0x18')]?_0x493898[_0x3448('0x18')][_0x3448('0x19')]===undefined?!![]:![]:!![],'where':_0x493898['options']?_0x493898[_0x3448('0x18')][_0x3448('0x1a')]||null:null,'attributes':_0x493898[_0x3448('0x18')]?_0x493898['options'][_0x3448('0x1b')]||null:null,'include':_0x493898[_0x3448('0x18')]?_0x493898['options']['include']?_[_0x3448('0x1f')](_0x493898[_0x3448('0x18')][_0x3448('0x1c')],function(_0x37a0ee){return{'model':db[_0x37a0ee['model']],'as':_0x37a0ee['as'],'attributes':_0x37a0ee[_0x3448('0x1b')],'include':_0x37a0ee[_0x3448('0x1c')]?_[_0x3448('0x1f')](_0x37a0ee[_0x3448('0x1c')],function(_0x5ebab6){return{'model':db[_0x5ebab6[_0x3448('0x1d')]],'as':_0x5ebab6['as'],'attributes':_0x5ebab6[_0x3448('0x1b')],'include':_0x5ebab6['include']?_[_0x3448('0x1f')](_0x5ebab6[_0x3448('0x1c')],function(_0x89d6ae){return{'model':db[_0x89d6ae[_0x3448('0x1d')]],'as':_0x89d6ae['as'],'attributes':_0x89d6ae[_0x3448('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3448('0xc')](function(_0x32592f){logger[_0x3448('0xd')](_0x3448('0x20'),_0x493898);logger['debug']('ShowVtigerAccount',_0x493898,JSON[_0x3448('0x12')](_0x32592f));_0xff6513(_0x32592f);})['catch'](function(_0x22bb31){logger[_0x3448('0x13')](_0x3448('0x20'),_0x22bb31[_0x3448('0x14')],_0x493898);_0x5e96f0(_0x52fb48['error'](0x1f4,_0x22bb31[_0x3448('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 67e4cdb..aca68a2 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 _0x9c9a=['getDescriptions','post','create','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions'];(function(_0x2a9b2,_0x3ceab0){var _0x387e0d=function(_0x27c831){while(--_0x27c831){_0x2a9b2['push'](_0x2a9b2['shift']());}};_0x387e0d(++_0x3ceab0);}(_0x9c9a,0x6f));var _0xa9c9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c9a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa9c9('0x0'));var util=require(_0xa9c9('0x1'));var path=require(_0xa9c9('0x2'));var timeout=require('connect-timeout');var express=require(_0xa9c9('0x3'));var router=express[_0xa9c9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa9c9('0x5'));var config=require(_0xa9c9('0x6'));var controller=require(_0xa9c9('0x7'));router['get']('/',auth[_0xa9c9('0x8')](),controller['index']);router[_0xa9c9('0x9')](_0xa9c9('0xa'),auth[_0xa9c9('0x8')](),controller[_0xa9c9('0xb')]);router[_0xa9c9('0x9')](_0xa9c9('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xa9c9('0x9')](_0xa9c9('0xd'),auth[_0xa9c9('0x8')](),controller['getSubjects']);router[_0xa9c9('0x9')](_0xa9c9('0xe'),auth['isAuthenticated'](),controller[_0xa9c9('0xf')]);router[_0xa9c9('0x10')]('/',auth[_0xa9c9('0x8')](),controller[_0xa9c9('0x11')]);router['put']('/:id',auth[_0xa9c9('0x8')](),controller[_0xa9c9('0x12')]);router[_0xa9c9('0x13')](_0xa9c9('0xa'),auth[_0xa9c9('0x8')](),controller[_0xa9c9('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4efe=['create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','getSubjects','/:id/descriptions'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x4efe,0x16c));var _0xe4ef=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x4efe[_0x390733];return _0x33beb9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe4ef('0x0'));var timeout=require(_0xe4ef('0x1'));var express=require('express');var router=express[_0xe4ef('0x2')]();var fs_extra=require(_0xe4ef('0x3'));var auth=require(_0xe4ef('0x4'));var interaction=require(_0xe4ef('0x5'));var config=require(_0xe4ef('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0xe4ef('0x7')]('/',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0x9')]);router[_0xe4ef('0x7')]('/:id',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xa')]);router[_0xe4ef('0x7')]('/:id/fields',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xb')]);router['get']('/:id/subjects',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xc')]);router[_0xe4ef('0x7')](_0xe4ef('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xe')]);router[_0xe4ef('0xf')](_0xe4ef('0x10'),auth['isAuthenticated'](),controller[_0xe4ef('0x11')]);router[_0xe4ef('0x12')](_0xe4ef('0x10'),auth[_0xe4ef('0x8')](),controller[_0xe4ef('0x13')]);module[_0xe4ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 0f129e2..712b787 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 _0x5cf0=['STRING'];(function(_0x12004b,_0x969450){var _0x2677aa=function(_0x51a1d9){while(--_0x51a1d9){_0x12004b['push'](_0x12004b['shift']());}};_0x2677aa(++_0x969450);}(_0x5cf0,0x70));var _0x05cf=function(_0x4d1ab6,_0xd6c6ce){_0x4d1ab6=_0x4d1ab6-0x0;var _0x10e2aa=_0x5cf0[_0x4d1ab6];return _0x10e2aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x05cf('0x0')]},'description':{'type':Sequelize[_0x05cf('0x0')]}}; \ No newline at end of file +var _0x33bb=['exports','STRING','sequelize'];(function(_0x145980,_0x52cc4e){var _0x2fe396=function(_0x4b0c30){while(--_0x4b0c30){_0x145980['push'](_0x145980['shift']());}};_0x2fe396(++_0x52cc4e);}(_0x33bb,0x122));var _0xb33b=function(_0x5d2bd,_0x50fa53){_0x5d2bd=_0x5d2bd-0x0;var _0x51665d=_0x33bb[_0x5d2bd];return _0x51665d;};'use strict';var Sequelize=require(_0xb33b('0x0'));module[_0xb33b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb33b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e52aa60..b2990fb 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 _0x4d22=['params','keys','length','merge','find','create','body','getFields','findOne','VtigerField','getSubjects','order','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0x4d22,0x1ac));var _0x24d2=function(_0x2ad2d1,_0x5886a5){_0x2ad2d1=_0x2ad2d1-0x0;var _0x235ef0=_0x4d22[_0x2ad2d1];return _0x235ef0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x24d2('0x0'));var jsonpatch=require(_0x24d2('0x1'));var rp=require(_0x24d2('0x2'));var moment=require('moment');var BPromise=require(_0x24d2('0x3'));var Mustache=require('mustache');var util=require(_0x24d2('0x4'));var path=require(_0x24d2('0x5'));var sox=require(_0x24d2('0x6'));var csv=require(_0x24d2('0x7'));var ejs=require(_0x24d2('0x8'));var fs=require('fs');var fs_extra=require(_0x24d2('0x9'));var _=require(_0x24d2('0xa'));var squel=require(_0x24d2('0xb'));var crypto=require(_0x24d2('0xc'));var jsforce=require(_0x24d2('0xd'));var deskjs=require(_0x24d2('0xe'));var toCsv=require(_0x24d2('0x7'));var querystring=require(_0x24d2('0xf'));var Papa=require(_0x24d2('0x10'));var Redis=require('ioredis');var authService=require(_0x24d2('0x11'));var qs=require(_0x24d2('0x12'));var as=require(_0x24d2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24d2('0x14'))(_0x24d2('0x15'));var utils=require(_0x24d2('0x16'));var config=require(_0x24d2('0x17'));var licenseUtil=require(_0x24d2('0x18'));var db=require(_0x24d2('0x19'))['db'];function respondWithStatusCode(_0x257e21,_0x37677a){_0x37677a=_0x37677a||0xcc;return function(_0x2f0443){if(_0x2f0443){return _0x257e21['sendStatus'](_0x37677a);}return _0x257e21[_0x24d2('0x1a')](_0x37677a)[_0x24d2('0x1b')]();};}function respondWithResult(_0x39570f,_0x2a5afd){_0x2a5afd=_0x2a5afd||0xc8;return function(_0x4c3a80){if(_0x4c3a80){return _0x39570f['status'](_0x2a5afd)[_0x24d2('0x1c')](_0x4c3a80);}};}function respondWithFilteredResult(_0x228783,_0x535eab){return function(_0x30b336){if(_0x30b336){var _0xf949c=typeof _0x535eab['offset']===_0x24d2('0x1d')&&typeof _0x535eab[_0x24d2('0x1e')]===_0x24d2('0x1d');var _0x1c2cd2=_0x30b336[_0x24d2('0x1f')];var _0x1b8d33=_0xf949c?0x0:_0x535eab[_0x24d2('0x20')];var _0x534a4d=_0xf949c?_0x30b336[_0x24d2('0x1f')]:_0x535eab[_0x24d2('0x20')]+_0x535eab[_0x24d2('0x1e')];var _0x2cab71;if(_0x534a4d>=_0x1c2cd2){_0x534a4d=_0x1c2cd2;_0x2cab71=0xc8;}else{_0x2cab71=0xce;}_0x228783[_0x24d2('0x1a')](_0x2cab71);return _0x228783[_0x24d2('0x21')]('Content-Range',_0x1b8d33+'-'+_0x534a4d+'/'+_0x1c2cd2)[_0x24d2('0x1c')](_0x30b336);}return null;};}function patchUpdates(_0x6e52a4){return function(_0xc49d2d){try{jsonpatch[_0x24d2('0x22')](_0xc49d2d,_0x6e52a4,!![]);}catch(_0x3d0d01){return BPromise[_0x24d2('0x23')](_0x3d0d01);}return _0xc49d2d['save']();};}function saveUpdates(_0x31dc49,_0x26a328){return function(_0x4e6718){if(_0x4e6718){return _0x4e6718[_0x24d2('0x24')](_0x31dc49)[_0x24d2('0x25')](function(_0x2aa431){return _0x2aa431;});}return null;};}function removeEntity(_0x24db17,_0x5efbcc){return function(_0x6e2817){if(_0x6e2817){return _0x6e2817[_0x24d2('0x26')]()[_0x24d2('0x25')](function(){_0x24db17['status'](0xcc)[_0x24d2('0x1b')]();});}};}function handleEntityNotFound(_0x3d5d4f,_0x338acf){return function(_0x5e0c91){if(!_0x5e0c91){_0x3d5d4f[_0x24d2('0x27')](0x194);}return _0x5e0c91;};}function handleError(_0x50477f,_0x3ce1bf){_0x3ce1bf=_0x3ce1bf||0x1f4;return function(_0x16f484){logger[_0x24d2('0x28')](_0x16f484[_0x24d2('0x29')]);if(_0x16f484[_0x24d2('0x2a')]){delete _0x16f484[_0x24d2('0x2a')];}_0x50477f[_0x24d2('0x1a')](_0x3ce1bf)[_0x24d2('0x2b')](_0x16f484);};}exports[_0x24d2('0x2c')]=function(_0x56e931,_0x10e2ea){var _0x39c95d={},_0x42b3fd={},_0x3db263={'count':0x0,'rows':[]};var _0xb5778f=_[_0x24d2('0x2d')](db[_0x24d2('0x2e')][_0x24d2('0x2f')],function(_0x1250a9){return{'name':_0x1250a9['fieldName'],'type':_0x1250a9[_0x24d2('0x30')][_0x24d2('0x31')]};});_0x42b3fd[_0x24d2('0x32')]=_['map'](_0xb5778f,_0x24d2('0x2a'));_0x42b3fd['query']=_['keys'](_0x56e931[_0x24d2('0x33')]);_0x42b3fd['filters']=_[_0x24d2('0x34')](_0x42b3fd[_0x24d2('0x32')],_0x42b3fd[_0x24d2('0x33')]);_0x39c95d['attributes']=_[_0x24d2('0x34')](_0x42b3fd[_0x24d2('0x32')],qs[_0x24d2('0x35')](_0x56e931[_0x24d2('0x33')][_0x24d2('0x35')]));_0x39c95d[_0x24d2('0x36')]=_0x39c95d['attributes']['length']?_0x39c95d['attributes']:_0x42b3fd['model'];if(!_0x56e931[_0x24d2('0x33')][_0x24d2('0x37')](_0x24d2('0x38'))){_0x39c95d[_0x24d2('0x1e')]=qs['limit'](_0x56e931[_0x24d2('0x33')][_0x24d2('0x1e')]);_0x39c95d[_0x24d2('0x20')]=qs[_0x24d2('0x20')](_0x56e931[_0x24d2('0x33')][_0x24d2('0x20')]);}_0x39c95d['order']=qs['sort'](_0x56e931[_0x24d2('0x33')][_0x24d2('0x39')]);_0x39c95d[_0x24d2('0x3a')]=qs[_0x24d2('0x3b')](_[_0x24d2('0x3c')](_0x56e931[_0x24d2('0x33')],_0x42b3fd[_0x24d2('0x3b')]),_0xb5778f);if(_0x56e931[_0x24d2('0x33')][_0x24d2('0x3d')]){_0x39c95d[_0x24d2('0x3a')]=_['merge'](_0x39c95d[_0x24d2('0x3a')],{'$or':_[_0x24d2('0x2d')](_0xb5778f,function(_0x1fb3c4){if(_0x1fb3c4[_0x24d2('0x30')]!==_0x24d2('0x3e')){var _0x15d9c2={};_0x15d9c2[_0x1fb3c4['name']]={'$like':'%'+_0x56e931[_0x24d2('0x33')][_0x24d2('0x3d')]+'%'};return _0x15d9c2;}})});}_0x39c95d=_['merge']({},_0x39c95d,_0x56e931[_0x24d2('0x3f')]);var _0x490a41={'where':_0x39c95d[_0x24d2('0x3a')]};return db[_0x24d2('0x2e')][_0x24d2('0x1f')](_0x490a41)[_0x24d2('0x25')](function(_0x20fc14){_0x3db263[_0x24d2('0x1f')]=_0x20fc14;if(_0x56e931['query'][_0x24d2('0x40')]){_0x39c95d[_0x24d2('0x41')]=[{'all':!![]}];}return db[_0x24d2('0x2e')][_0x24d2('0x42')](_0x39c95d);})[_0x24d2('0x25')](function(_0xd5ab5){_0x3db263[_0x24d2('0x43')]=_0xd5ab5;return _0x3db263;})[_0x24d2('0x25')](respondWithFilteredResult(_0x10e2ea,_0x39c95d))[_0x24d2('0x44')](handleError(_0x10e2ea,null));};exports[_0x24d2('0x45')]=function(_0x35fe4f,_0x2a3f4b){var _0x12b5a8={'raw':![],'where':{'id':_0x35fe4f[_0x24d2('0x46')]['id']}},_0x81dc8d={};_0x81dc8d[_0x24d2('0x32')]=_[_0x24d2('0x47')](db[_0x24d2('0x2e')][_0x24d2('0x2f')]);_0x81dc8d[_0x24d2('0x33')]=_['keys'](_0x35fe4f[_0x24d2('0x33')]);_0x81dc8d[_0x24d2('0x3b')]=_[_0x24d2('0x34')](_0x81dc8d[_0x24d2('0x32')],_0x81dc8d[_0x24d2('0x33')]);_0x12b5a8[_0x24d2('0x36')]=_[_0x24d2('0x34')](_0x81dc8d['model'],qs['fields'](_0x35fe4f[_0x24d2('0x33')][_0x24d2('0x35')]));_0x12b5a8[_0x24d2('0x36')]=_0x12b5a8['attributes'][_0x24d2('0x48')]?_0x12b5a8[_0x24d2('0x36')]:_0x81dc8d[_0x24d2('0x32')];if(_0x35fe4f[_0x24d2('0x33')][_0x24d2('0x40')]){_0x12b5a8[_0x24d2('0x41')]=[{'all':!![]}];}_0x12b5a8=_[_0x24d2('0x49')]({},_0x12b5a8,_0x35fe4f[_0x24d2('0x3f')]);return db[_0x24d2('0x2e')][_0x24d2('0x4a')](_0x12b5a8)[_0x24d2('0x25')](handleEntityNotFound(_0x2a3f4b,null))[_0x24d2('0x25')](respondWithResult(_0x2a3f4b,null))[_0x24d2('0x44')](handleError(_0x2a3f4b,null));};exports[_0x24d2('0x4b')]=function(_0xbbf7f7,_0x28b9d4){return db['VtigerConfiguration']['create'](_0xbbf7f7[_0x24d2('0x4c')],{})[_0x24d2('0x25')](respondWithResult(_0x28b9d4,0xc9))[_0x24d2('0x44')](handleError(_0x28b9d4,null));};exports[_0x24d2('0x24')]=function(_0x5d966a,_0x4d2289){if(_0x5d966a[_0x24d2('0x4c')]['id']){delete _0x5d966a['body']['id'];}return db[_0x24d2('0x2e')]['find']({'where':{'id':_0x5d966a[_0x24d2('0x46')]['id']}})[_0x24d2('0x25')](handleEntityNotFound(_0x4d2289,null))[_0x24d2('0x25')](saveUpdates(_0x5d966a['body'],null))[_0x24d2('0x25')](respondWithResult(_0x4d2289,null))[_0x24d2('0x44')](handleError(_0x4d2289,null));};exports[_0x24d2('0x26')]=function(_0x2065da,_0x5e0db7){return db[_0x24d2('0x2e')]['find']({'where':{'id':_0x2065da[_0x24d2('0x46')]['id']}})[_0x24d2('0x25')](handleEntityNotFound(_0x5e0db7,null))[_0x24d2('0x25')](removeEntity(_0x5e0db7,null))['catch'](handleError(_0x5e0db7,null));};exports[_0x24d2('0x4d')]=function(_0x9641a2,_0x41316b,_0x275f79){var _0x855c36={};var _0x202311={};var _0x4e8562;var _0x1cebcb;return db[_0x24d2('0x2e')][_0x24d2('0x4e')]({'where':{'id':_0x9641a2[_0x24d2('0x46')]['id']}})[_0x24d2('0x25')](handleEntityNotFound(_0x41316b,null))[_0x24d2('0x25')](function(_0xf57053){if(_0xf57053){_0x4e8562=_0xf57053;_0x202311['model']=_['keys'](db[_0x24d2('0x4f')][_0x24d2('0x2f')]);_0x202311[_0x24d2('0x33')]=_['keys'](_0x9641a2[_0x24d2('0x33')]);_0x202311['filters']=_[_0x24d2('0x34')](_0x202311[_0x24d2('0x32')],_0x202311['query']);_0x855c36[_0x24d2('0x36')]=_[_0x24d2('0x34')](_0x202311[_0x24d2('0x32')],qs[_0x24d2('0x35')](_0x9641a2['query']['fields']));_0x855c36[_0x24d2('0x36')]=_0x855c36[_0x24d2('0x36')][_0x24d2('0x48')]?_0x855c36[_0x24d2('0x36')]:_0x202311['model'];_0x855c36['order']=qs[_0x24d2('0x39')](_0x9641a2[_0x24d2('0x33')][_0x24d2('0x39')]);_0x855c36[_0x24d2('0x3a')]=qs[_0x24d2('0x3b')](_['pick'](_0x9641a2[_0x24d2('0x33')],_0x202311[_0x24d2('0x3b')]));if(_0x9641a2[_0x24d2('0x33')][_0x24d2('0x3d')]){_0x855c36[_0x24d2('0x3a')]=_[_0x24d2('0x49')](_0x855c36[_0x24d2('0x3a')],{'$or':_['map'](_0x855c36[_0x24d2('0x36')],function(_0x573345){var _0x2bfc3a={};_0x2bfc3a[_0x573345]={'$like':'%'+_0x9641a2[_0x24d2('0x33')][_0x24d2('0x3d')]+'%'};return _0x2bfc3a;})});}_0x855c36=_[_0x24d2('0x49')]({},_0x855c36,_0x9641a2[_0x24d2('0x3f')]);return _0x4e8562['getFields'](_0x855c36);}})['then'](function(_0x546e68){if(_0x546e68){_0x1cebcb=_0x546e68[_0x24d2('0x48')];if(!_0x9641a2[_0x24d2('0x33')][_0x24d2('0x37')](_0x24d2('0x38'))){_0x855c36[_0x24d2('0x1e')]=qs[_0x24d2('0x1e')](_0x9641a2[_0x24d2('0x33')][_0x24d2('0x1e')]);_0x855c36[_0x24d2('0x20')]=qs[_0x24d2('0x20')](_0x9641a2['query'][_0x24d2('0x20')]);}return _0x4e8562[_0x24d2('0x4d')](_0x855c36);}})[_0x24d2('0x25')](function(_0x174536){if(_0x174536){return _0x174536?{'count':_0x1cebcb,'rows':_0x174536}:null;}})[_0x24d2('0x25')](respondWithResult(_0x41316b,null))[_0x24d2('0x44')](handleError(_0x41316b,null));};exports[_0x24d2('0x50')]=function(_0x354607,_0x5f516e,_0x2a837f){var _0x36b994={};var _0x43f3d4={};var _0x11d94f;var _0x281bc8;return db[_0x24d2('0x2e')]['findOne']({'where':{'id':_0x354607[_0x24d2('0x46')]['id']}})['then'](handleEntityNotFound(_0x5f516e,null))[_0x24d2('0x25')](function(_0x6cb395){if(_0x6cb395){_0x11d94f=_0x6cb395;_0x43f3d4[_0x24d2('0x32')]=_[_0x24d2('0x47')](db['VtigerField']['rawAttributes']);_0x43f3d4[_0x24d2('0x33')]=_[_0x24d2('0x47')](_0x354607['query']);_0x43f3d4[_0x24d2('0x3b')]=_['intersection'](_0x43f3d4[_0x24d2('0x32')],_0x43f3d4[_0x24d2('0x33')]);_0x36b994[_0x24d2('0x36')]=_['intersection'](_0x43f3d4[_0x24d2('0x32')],qs['fields'](_0x354607[_0x24d2('0x33')]['fields']));_0x36b994[_0x24d2('0x36')]=_0x36b994[_0x24d2('0x36')][_0x24d2('0x48')]?_0x36b994['attributes']:_0x43f3d4[_0x24d2('0x32')];_0x36b994['order']=qs['sort'](_0x354607['query'][_0x24d2('0x39')]);_0x36b994['where']=qs[_0x24d2('0x3b')](_[_0x24d2('0x3c')](_0x354607[_0x24d2('0x33')],_0x43f3d4['filters']));if(_0x354607[_0x24d2('0x33')]['filter']){_0x36b994[_0x24d2('0x3a')]=_[_0x24d2('0x49')](_0x36b994['where'],{'$or':_['map'](_0x36b994[_0x24d2('0x36')],function(_0xf1fd12){var _0x2e3ae9={};_0x2e3ae9[_0xf1fd12]={'$like':'%'+_0x354607['query']['filter']+'%'};return _0x2e3ae9;})});}_0x36b994=_[_0x24d2('0x49')]({},_0x36b994,_0x354607['options']);return _0x11d94f[_0x24d2('0x50')](_0x36b994);}})['then'](function(_0x2b1787){if(_0x2b1787){_0x281bc8=_0x2b1787[_0x24d2('0x48')];if(!_0x354607['query']['hasOwnProperty'](_0x24d2('0x38'))){_0x36b994[_0x24d2('0x1e')]=qs[_0x24d2('0x1e')](_0x354607[_0x24d2('0x33')]['limit']);_0x36b994[_0x24d2('0x20')]=qs[_0x24d2('0x20')](_0x354607[_0x24d2('0x33')][_0x24d2('0x20')]);}return _0x11d94f[_0x24d2('0x50')](_0x36b994);}})[_0x24d2('0x25')](function(_0x3c92dd){if(_0x3c92dd){return _0x3c92dd?{'count':_0x281bc8,'rows':_0x3c92dd}:null;}})['then'](respondWithResult(_0x5f516e,null))[_0x24d2('0x44')](handleError(_0x5f516e,null));};exports['getDescriptions']=function(_0x37e32c,_0x271817,_0x34f838){var _0x4a6f9d={};var _0x112b01={};var _0xb9bacb;var _0x369662;return db[_0x24d2('0x2e')][_0x24d2('0x4e')]({'where':{'id':_0x37e32c[_0x24d2('0x46')]['id']}})[_0x24d2('0x25')](handleEntityNotFound(_0x271817,null))[_0x24d2('0x25')](function(_0x26f636){if(_0x26f636){_0xb9bacb=_0x26f636;_0x112b01[_0x24d2('0x32')]=_['keys'](db['VtigerField'][_0x24d2('0x2f')]);_0x112b01[_0x24d2('0x33')]=_[_0x24d2('0x47')](_0x37e32c[_0x24d2('0x33')]);_0x112b01[_0x24d2('0x3b')]=_[_0x24d2('0x34')](_0x112b01[_0x24d2('0x32')],_0x112b01[_0x24d2('0x33')]);_0x4a6f9d[_0x24d2('0x36')]=_['intersection'](_0x112b01['model'],qs[_0x24d2('0x35')](_0x37e32c[_0x24d2('0x33')]['fields']));_0x4a6f9d[_0x24d2('0x36')]=_0x4a6f9d[_0x24d2('0x36')]['length']?_0x4a6f9d[_0x24d2('0x36')]:_0x112b01[_0x24d2('0x32')];_0x4a6f9d[_0x24d2('0x51')]=qs[_0x24d2('0x39')](_0x37e32c['query'][_0x24d2('0x39')]);_0x4a6f9d[_0x24d2('0x3a')]=qs['filters'](_[_0x24d2('0x3c')](_0x37e32c['query'],_0x112b01[_0x24d2('0x3b')]));if(_0x37e32c['query']['filter']){_0x4a6f9d['where']=_['merge'](_0x4a6f9d[_0x24d2('0x3a')],{'$or':_[_0x24d2('0x2d')](_0x4a6f9d[_0x24d2('0x36')],function(_0x2de243){var _0x4f991b={};_0x4f991b[_0x2de243]={'$like':'%'+_0x37e32c[_0x24d2('0x33')]['filter']+'%'};return _0x4f991b;})});}_0x4a6f9d=_['merge']({},_0x4a6f9d,_0x37e32c[_0x24d2('0x3f')]);return _0xb9bacb[_0x24d2('0x52')](_0x4a6f9d);}})[_0x24d2('0x25')](function(_0x1ae36d){if(_0x1ae36d){_0x369662=_0x1ae36d['length'];if(!_0x37e32c[_0x24d2('0x33')][_0x24d2('0x37')]('nolimit')){_0x4a6f9d['limit']=qs[_0x24d2('0x1e')](_0x37e32c[_0x24d2('0x33')][_0x24d2('0x1e')]);_0x4a6f9d[_0x24d2('0x20')]=qs[_0x24d2('0x20')](_0x37e32c[_0x24d2('0x33')]['offset']);}return _0xb9bacb['getDescriptions'](_0x4a6f9d);}})[_0x24d2('0x25')](function(_0x649bbd){if(_0x649bbd){return _0x649bbd?{'count':_0x369662,'rows':_0x649bbd}:null;}})[_0x24d2('0x25')](respondWithResult(_0x271817,null))[_0x24d2('0x44')](handleError(_0x271817,null));}; \ No newline at end of file +var _0x2f13=['findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','include'];(function(_0x265420,_0x4d4228){var _0x2b7d42=function(_0x4eb2b9){while(--_0x4eb2b9){_0x265420['push'](_0x265420['shift']());}};_0x2b7d42(++_0x4d4228);}(_0x2f13,0x1f0));var _0x32f1=function(_0xaeb053,_0x5e3a79){_0xaeb053=_0xaeb053-0x0;var _0x311af5=_0x2f13[_0xaeb053];return _0x311af5;};'use strict';var emlformat=require(_0x32f1('0x0'));var rimraf=require(_0x32f1('0x1'));var zipdir=require(_0x32f1('0x2'));var jsonpatch=require(_0x32f1('0x3'));var rp=require(_0x32f1('0x4'));var moment=require('moment');var BPromise=require(_0x32f1('0x5'));var Mustache=require(_0x32f1('0x6'));var util=require('util');var path=require(_0x32f1('0x7'));var sox=require(_0x32f1('0x8'));var csv=require(_0x32f1('0x9'));var ejs=require(_0x32f1('0xa'));var fs=require('fs');var fs_extra=require(_0x32f1('0xb'));var _=require('lodash');var squel=require(_0x32f1('0xc'));var crypto=require('crypto');var jsforce=require(_0x32f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x32f1('0x9'));var querystring=require(_0x32f1('0xe'));var Papa=require('papaparse');var Redis=require(_0x32f1('0xf'));var authService=require(_0x32f1('0x10'));var qs=require(_0x32f1('0x11'));var as=require(_0x32f1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32f1('0x13'))(_0x32f1('0x14'));var utils=require(_0x32f1('0x15'));var config=require(_0x32f1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2775cc,_0x4767e8){_0x4767e8=_0x4767e8||0xcc;return function(_0xdad373){if(_0xdad373){return _0x2775cc[_0x32f1('0x17')](_0x4767e8);}return _0x2775cc[_0x32f1('0x18')](_0x4767e8)[_0x32f1('0x19')]();};}function respondWithResult(_0x353c83,_0x4b67f1){_0x4b67f1=_0x4b67f1||0xc8;return function(_0x1fcc19){if(_0x1fcc19){return _0x353c83[_0x32f1('0x18')](_0x4b67f1)['json'](_0x1fcc19);}};}function respondWithFilteredResult(_0x3db949,_0x483965){return function(_0xdd77c2){if(_0xdd77c2){var _0x4793a7=typeof _0x483965[_0x32f1('0x1a')]===_0x32f1('0x1b')&&typeof _0x483965[_0x32f1('0x1c')]===_0x32f1('0x1b');var _0x19f684=_0xdd77c2[_0x32f1('0x1d')];var _0x2d8dfd=_0x4793a7?0x0:_0x483965[_0x32f1('0x1a')];var _0x5d5d06=_0x4793a7?_0xdd77c2['count']:_0x483965[_0x32f1('0x1a')]+_0x483965[_0x32f1('0x1c')];var _0x2bba91;if(_0x5d5d06>=_0x19f684){_0x5d5d06=_0x19f684;_0x2bba91=0xc8;}else{_0x2bba91=0xce;}_0x3db949['status'](_0x2bba91);return _0x3db949['set'](_0x32f1('0x1e'),_0x2d8dfd+'-'+_0x5d5d06+'/'+_0x19f684)[_0x32f1('0x1f')](_0xdd77c2);}return null;};}function patchUpdates(_0x4ab5e0){return function(_0x15071e){try{jsonpatch[_0x32f1('0x20')](_0x15071e,_0x4ab5e0,!![]);}catch(_0x8ca06e){return BPromise[_0x32f1('0x21')](_0x8ca06e);}return _0x15071e[_0x32f1('0x22')]();};}function saveUpdates(_0x44f614,_0x512ced){return function(_0x15e759){if(_0x15e759){return _0x15e759[_0x32f1('0x23')](_0x44f614)['then'](function(_0x45a7c2){return _0x45a7c2;});}return null;};}function removeEntity(_0x9a9cbd,_0x1372a2){return function(_0x3928da){if(_0x3928da){return _0x3928da[_0x32f1('0x24')]()[_0x32f1('0x25')](function(){_0x9a9cbd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d082,_0xe76067){return function(_0x9972f2){if(!_0x9972f2){_0x40d082[_0x32f1('0x17')](0x194);}return _0x9972f2;};}function handleError(_0x199b3c,_0x12c891){_0x12c891=_0x12c891||0x1f4;return function(_0x36e801){logger['error'](_0x36e801['stack']);if(_0x36e801[_0x32f1('0x26')]){delete _0x36e801[_0x32f1('0x26')];}_0x199b3c['status'](_0x12c891)[_0x32f1('0x27')](_0x36e801);};}exports[_0x32f1('0x28')]=function(_0x174512,_0x29e2b){var _0x4d0cd0={},_0xd6c1b9={},_0x1f8523={'count':0x0,'rows':[]};var _0x2f0fa0=_[_0x32f1('0x29')](db['VtigerConfiguration']['rawAttributes'],function(_0x4b2209){return{'name':_0x4b2209[_0x32f1('0x2a')],'type':_0x4b2209[_0x32f1('0x2b')][_0x32f1('0x2c')]};});_0xd6c1b9[_0x32f1('0x2d')]=_['map'](_0x2f0fa0,_0x32f1('0x26'));_0xd6c1b9[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x174512[_0x32f1('0x2e')]);_0xd6c1b9[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0xd6c1b9['model'],_0xd6c1b9[_0x32f1('0x2e')]);_0x4d0cd0['attributes']=_[_0x32f1('0x31')](_0xd6c1b9[_0x32f1('0x2d')],qs[_0x32f1('0x32')](_0x174512['query'][_0x32f1('0x32')]));_0x4d0cd0[_0x32f1('0x33')]=_0x4d0cd0[_0x32f1('0x33')]['length']?_0x4d0cd0[_0x32f1('0x33')]:_0xd6c1b9['model'];if(!_0x174512[_0x32f1('0x2e')][_0x32f1('0x34')](_0x32f1('0x35'))){_0x4d0cd0[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x174512[_0x32f1('0x2e')][_0x32f1('0x1c')]);_0x4d0cd0['offset']=qs[_0x32f1('0x1a')](_0x174512[_0x32f1('0x2e')]['offset']);}_0x4d0cd0[_0x32f1('0x36')]=qs[_0x32f1('0x37')](_0x174512['query'][_0x32f1('0x37')]);_0x4d0cd0[_0x32f1('0x38')]=qs[_0x32f1('0x30')](_[_0x32f1('0x39')](_0x174512[_0x32f1('0x2e')],_0xd6c1b9[_0x32f1('0x30')]),_0x2f0fa0);if(_0x174512[_0x32f1('0x2e')][_0x32f1('0x3a')]){_0x4d0cd0[_0x32f1('0x38')]=_[_0x32f1('0x3b')](_0x4d0cd0['where'],{'$or':_[_0x32f1('0x29')](_0x2f0fa0,function(_0x1566a8){if(_0x1566a8[_0x32f1('0x2b')]!==_0x32f1('0x3c')){var _0x563af7={};_0x563af7[_0x1566a8[_0x32f1('0x26')]]={'$like':'%'+_0x174512[_0x32f1('0x2e')][_0x32f1('0x3a')]+'%'};return _0x563af7;}})});}_0x4d0cd0=_[_0x32f1('0x3b')]({},_0x4d0cd0,_0x174512[_0x32f1('0x3d')]);var _0x17172b={'where':_0x4d0cd0[_0x32f1('0x38')]};return db[_0x32f1('0x3e')][_0x32f1('0x1d')](_0x17172b)[_0x32f1('0x25')](function(_0x224602){_0x1f8523['count']=_0x224602;if(_0x174512['query']['includeAll']){_0x4d0cd0[_0x32f1('0x3f')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x32f1('0x40')](_0x4d0cd0);})[_0x32f1('0x25')](function(_0x3d4e0d){_0x1f8523[_0x32f1('0x41')]=_0x3d4e0d;return _0x1f8523;})[_0x32f1('0x25')](respondWithFilteredResult(_0x29e2b,_0x4d0cd0))[_0x32f1('0x42')](handleError(_0x29e2b,null));};exports[_0x32f1('0x43')]=function(_0x27542e,_0x3ab89c){var _0x1795f7={'raw':![],'where':{'id':_0x27542e[_0x32f1('0x44')]['id']}},_0x48a663={};_0x48a663[_0x32f1('0x2d')]=_[_0x32f1('0x2f')](db[_0x32f1('0x3e')][_0x32f1('0x45')]);_0x48a663[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x27542e['query']);_0x48a663[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0x48a663[_0x32f1('0x2d')],_0x48a663[_0x32f1('0x2e')]);_0x1795f7['attributes']=_['intersection'](_0x48a663['model'],qs[_0x32f1('0x32')](_0x27542e[_0x32f1('0x2e')][_0x32f1('0x32')]));_0x1795f7['attributes']=_0x1795f7['attributes'][_0x32f1('0x46')]?_0x1795f7[_0x32f1('0x33')]:_0x48a663['model'];if(_0x27542e[_0x32f1('0x2e')][_0x32f1('0x47')]){_0x1795f7[_0x32f1('0x3f')]=[{'all':!![]}];}_0x1795f7=_[_0x32f1('0x3b')]({},_0x1795f7,_0x27542e[_0x32f1('0x3d')]);return db[_0x32f1('0x3e')]['find'](_0x1795f7)[_0x32f1('0x25')](handleEntityNotFound(_0x3ab89c,null))[_0x32f1('0x25')](respondWithResult(_0x3ab89c,null))['catch'](handleError(_0x3ab89c,null));};exports[_0x32f1('0x48')]=function(_0x5e972e,_0x19729c){return db['VtigerConfiguration']['create'](_0x5e972e[_0x32f1('0x49')],{})[_0x32f1('0x25')](respondWithResult(_0x19729c,0xc9))[_0x32f1('0x42')](handleError(_0x19729c,null));};exports[_0x32f1('0x23')]=function(_0x198caf,_0x247af2){if(_0x198caf['body']['id']){delete _0x198caf[_0x32f1('0x49')]['id'];}return db['VtigerConfiguration'][_0x32f1('0x4a')]({'where':{'id':_0x198caf['params']['id']}})[_0x32f1('0x25')](handleEntityNotFound(_0x247af2,null))[_0x32f1('0x25')](saveUpdates(_0x198caf[_0x32f1('0x49')],null))['then'](respondWithResult(_0x247af2,null))['catch'](handleError(_0x247af2,null));};exports[_0x32f1('0x24')]=function(_0xe6c977,_0x12c2ad){return db['VtigerConfiguration'][_0x32f1('0x4a')]({'where':{'id':_0xe6c977[_0x32f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x12c2ad,null))[_0x32f1('0x25')](removeEntity(_0x12c2ad,null))['catch'](handleError(_0x12c2ad,null));};exports[_0x32f1('0x4b')]=function(_0x3c9423,_0x583f01,_0x4884e2){var _0x24ef38={};var _0x326d22={};var _0x4daade;var _0x47783f;return db[_0x32f1('0x3e')][_0x32f1('0x4c')]({'where':{'id':_0x3c9423[_0x32f1('0x44')]['id']}})[_0x32f1('0x25')](handleEntityNotFound(_0x583f01,null))['then'](function(_0x414cba){if(_0x414cba){_0x4daade=_0x414cba;_0x326d22[_0x32f1('0x2d')]=_[_0x32f1('0x2f')](db[_0x32f1('0x4d')]['rawAttributes']);_0x326d22[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x3c9423[_0x32f1('0x2e')]);_0x326d22[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0x326d22[_0x32f1('0x2d')],_0x326d22[_0x32f1('0x2e')]);_0x24ef38[_0x32f1('0x33')]=_['intersection'](_0x326d22[_0x32f1('0x2d')],qs[_0x32f1('0x32')](_0x3c9423['query'][_0x32f1('0x32')]));_0x24ef38[_0x32f1('0x33')]=_0x24ef38[_0x32f1('0x33')][_0x32f1('0x46')]?_0x24ef38[_0x32f1('0x33')]:_0x326d22[_0x32f1('0x2d')];_0x24ef38[_0x32f1('0x36')]=qs['sort'](_0x3c9423[_0x32f1('0x2e')][_0x32f1('0x37')]);_0x24ef38[_0x32f1('0x38')]=qs[_0x32f1('0x30')](_[_0x32f1('0x39')](_0x3c9423[_0x32f1('0x2e')],_0x326d22[_0x32f1('0x30')]));if(_0x3c9423['query'][_0x32f1('0x3a')]){_0x24ef38[_0x32f1('0x38')]=_['merge'](_0x24ef38[_0x32f1('0x38')],{'$or':_[_0x32f1('0x29')](_0x24ef38[_0x32f1('0x33')],function(_0x3ed30f){var _0x140989={};_0x140989[_0x3ed30f]={'$like':'%'+_0x3c9423[_0x32f1('0x2e')]['filter']+'%'};return _0x140989;})});}_0x24ef38=_[_0x32f1('0x3b')]({},_0x24ef38,_0x3c9423[_0x32f1('0x3d')]);return _0x4daade['getFields'](_0x24ef38);}})['then'](function(_0xfde0bf){if(_0xfde0bf){_0x47783f=_0xfde0bf[_0x32f1('0x46')];if(!_0x3c9423[_0x32f1('0x2e')]['hasOwnProperty'](_0x32f1('0x35'))){_0x24ef38[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x3c9423['query'][_0x32f1('0x1c')]);_0x24ef38[_0x32f1('0x1a')]=qs['offset'](_0x3c9423[_0x32f1('0x2e')]['offset']);}return _0x4daade[_0x32f1('0x4b')](_0x24ef38);}})[_0x32f1('0x25')](function(_0x51a563){if(_0x51a563){return _0x51a563?{'count':_0x47783f,'rows':_0x51a563}:null;}})[_0x32f1('0x25')](respondWithResult(_0x583f01,null))[_0x32f1('0x42')](handleError(_0x583f01,null));};exports[_0x32f1('0x4e')]=function(_0x546b4e,_0x91da2f,_0x1ae1fc){var _0x7407fb={};var _0x34726a={};var _0x428811;var _0x3aa44f;return db['VtigerConfiguration'][_0x32f1('0x4c')]({'where':{'id':_0x546b4e['params']['id']}})['then'](handleEntityNotFound(_0x91da2f,null))[_0x32f1('0x25')](function(_0x386b3c){if(_0x386b3c){_0x428811=_0x386b3c;_0x34726a[_0x32f1('0x2d')]=_['keys'](db['VtigerField'][_0x32f1('0x45')]);_0x34726a['query']=_[_0x32f1('0x2f')](_0x546b4e[_0x32f1('0x2e')]);_0x34726a[_0x32f1('0x30')]=_['intersection'](_0x34726a[_0x32f1('0x2d')],_0x34726a[_0x32f1('0x2e')]);_0x7407fb['attributes']=_[_0x32f1('0x31')](_0x34726a['model'],qs['fields'](_0x546b4e[_0x32f1('0x2e')][_0x32f1('0x32')]));_0x7407fb[_0x32f1('0x33')]=_0x7407fb['attributes'][_0x32f1('0x46')]?_0x7407fb[_0x32f1('0x33')]:_0x34726a[_0x32f1('0x2d')];_0x7407fb['order']=qs['sort'](_0x546b4e['query']['sort']);_0x7407fb[_0x32f1('0x38')]=qs['filters'](_[_0x32f1('0x39')](_0x546b4e[_0x32f1('0x2e')],_0x34726a['filters']));if(_0x546b4e[_0x32f1('0x2e')]['filter']){_0x7407fb['where']=_['merge'](_0x7407fb[_0x32f1('0x38')],{'$or':_[_0x32f1('0x29')](_0x7407fb[_0x32f1('0x33')],function(_0x24e8d2){var _0x462f78={};_0x462f78[_0x24e8d2]={'$like':'%'+_0x546b4e['query'][_0x32f1('0x3a')]+'%'};return _0x462f78;})});}_0x7407fb=_['merge']({},_0x7407fb,_0x546b4e[_0x32f1('0x3d')]);return _0x428811[_0x32f1('0x4e')](_0x7407fb);}})[_0x32f1('0x25')](function(_0x2acd39){if(_0x2acd39){_0x3aa44f=_0x2acd39[_0x32f1('0x46')];if(!_0x546b4e[_0x32f1('0x2e')][_0x32f1('0x34')]('nolimit')){_0x7407fb[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x546b4e['query'][_0x32f1('0x1c')]);_0x7407fb[_0x32f1('0x1a')]=qs[_0x32f1('0x1a')](_0x546b4e[_0x32f1('0x2e')][_0x32f1('0x1a')]);}return _0x428811[_0x32f1('0x4e')](_0x7407fb);}})[_0x32f1('0x25')](function(_0x262679){if(_0x262679){return _0x262679?{'count':_0x3aa44f,'rows':_0x262679}:null;}})[_0x32f1('0x25')](respondWithResult(_0x91da2f,null))['catch'](handleError(_0x91da2f,null));};exports[_0x32f1('0x4f')]=function(_0x370ce6,_0x246eec,_0x21a2bb){var _0x5bdb9d={};var _0x4ba976={};var _0x10f756;var _0x599068;return db[_0x32f1('0x3e')][_0x32f1('0x4c')]({'where':{'id':_0x370ce6[_0x32f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x246eec,null))['then'](function(_0xcae93a){if(_0xcae93a){_0x10f756=_0xcae93a;_0x4ba976[_0x32f1('0x2d')]=_['keys'](db['VtigerField'][_0x32f1('0x45')]);_0x4ba976[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x370ce6[_0x32f1('0x2e')]);_0x4ba976[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0x4ba976[_0x32f1('0x2d')],_0x4ba976[_0x32f1('0x2e')]);_0x5bdb9d[_0x32f1('0x33')]=_[_0x32f1('0x31')](_0x4ba976['model'],qs[_0x32f1('0x32')](_0x370ce6[_0x32f1('0x2e')]['fields']));_0x5bdb9d['attributes']=_0x5bdb9d[_0x32f1('0x33')][_0x32f1('0x46')]?_0x5bdb9d[_0x32f1('0x33')]:_0x4ba976['model'];_0x5bdb9d[_0x32f1('0x36')]=qs['sort'](_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x37')]);_0x5bdb9d['where']=qs[_0x32f1('0x30')](_[_0x32f1('0x39')](_0x370ce6[_0x32f1('0x2e')],_0x4ba976[_0x32f1('0x30')]));if(_0x370ce6['query'][_0x32f1('0x3a')]){_0x5bdb9d[_0x32f1('0x38')]=_[_0x32f1('0x3b')](_0x5bdb9d['where'],{'$or':_[_0x32f1('0x29')](_0x5bdb9d[_0x32f1('0x33')],function(_0x57c2ef){var _0x2fcd18={};_0x2fcd18[_0x57c2ef]={'$like':'%'+_0x370ce6['query']['filter']+'%'};return _0x2fcd18;})});}_0x5bdb9d=_[_0x32f1('0x3b')]({},_0x5bdb9d,_0x370ce6['options']);return _0x10f756[_0x32f1('0x4f')](_0x5bdb9d);}})['then'](function(_0x259bd2){if(_0x259bd2){_0x599068=_0x259bd2[_0x32f1('0x46')];if(!_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x34')](_0x32f1('0x35'))){_0x5bdb9d[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x1c')]);_0x5bdb9d['offset']=qs[_0x32f1('0x1a')](_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x1a')]);}return _0x10f756[_0x32f1('0x4f')](_0x5bdb9d);}})[_0x32f1('0x25')](function(_0x2fa159){if(_0x2fa159){return _0x2fa159?{'count':_0x599068,'rows':_0x2fa159}:null;}})[_0x32f1('0x25')](respondWithResult(_0x246eec,null))['catch'](handleError(_0x246eec,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 5ddaaba..6489df0 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 _0xadb7=['exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','request-promise','path','rimraf','./intVtigerConfiguration.attributes'];(function(_0x17bdf2,_0x33a3bf){var _0x46368b=function(_0x29a036){while(--_0x29a036){_0x17bdf2['push'](_0x17bdf2['shift']());}};_0x46368b(++_0x33a3bf);}(_0xadb7,0x159));var _0x7adb=function(_0x4ab97a,_0x1df676){_0x4ab97a=_0x4ab97a-0x0;var _0x3cc027=_0xadb7[_0x4ab97a];return _0x3cc027;};'use strict';var _=require(_0x7adb('0x0'));var util=require('util');var logger=require(_0x7adb('0x1'))(_0x7adb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7adb('0x3'));var fs=require('fs');var path=require(_0x7adb('0x4'));var rimraf=require(_0x7adb('0x5'));var config=require('../../config/environment');var attributes=require(_0x7adb('0x6'));module[_0x7adb('0x7')]=function(_0x1a883c,_0x567823){return _0x1a883c[_0x7adb('0x8')](_0x7adb('0x9'),attributes,{'tableName':_0x7adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d5=['bluebird','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','../../config/logger','api'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xa2d5,0x1b7));var _0x5a2d=function(_0x211636,_0x21acd2){_0x211636=_0x211636-0x0;var _0x5c3247=_0xa2d5[_0x211636];return _0x5c3247;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a2d('0x0'))(_0x5a2d('0x1'));var moment=require('moment');var BPromise=require(_0x5a2d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5a2d('0x3'));var config=require(_0x5a2d('0x4'));var attributes=require(_0x5a2d('0x5'));module[_0x5a2d('0x6')]=function(_0x3533de,_0x1a7b42){return _0x3533de[_0x5a2d('0x7')](_0x5a2d('0x8'),attributes,{'tableName':'int_vtiger_configurations','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 beca734..5746304 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 _0x0b55=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x5c4009,_0x3b26a1){var _0x4f237b=function(_0x3cd01f){while(--_0x3cd01f){_0x5c4009['push'](_0x5c4009['shift']());}};_0x4f237b(++_0x3b26a1);}(_0x0b55,0x1d3));var _0x50b5=function(_0x4d0c5a,_0x33d063){_0x4d0c5a=_0x4d0c5a-0x0;var _0x1667d6=_0x0b55[_0x4d0c5a];return _0x1667d6;};'use strict';var _=require('lodash');var util=require(_0x50b5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50b5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50b5('0x2'))['db'];var utils=require(_0x50b5('0x3'));var logger=require(_0x50b5('0x4'))(_0x50b5('0x5'));var config=require(_0x50b5('0x6'));var jayson=require(_0x50b5('0x7'));var client=jayson[_0x50b5('0x8')][_0x50b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59e27d,_0x1b1233,_0x5018e7){return new BPromise(function(_0x4a7aac,_0x3cc137){return client['request'](_0x59e27d,_0x5018e7)[_0x50b5('0xa')](function(_0x3fe8fe){logger[_0x50b5('0xb')](_0x50b5('0xc'),_0x1b1233,_0x50b5('0xd'));logger[_0x50b5('0xe')](_0x50b5('0xf'),_0x1b1233,_0x50b5('0xd'),JSON[_0x50b5('0x10')](_0x3fe8fe));if(_0x3fe8fe[_0x50b5('0x11')]){if(_0x3fe8fe[_0x50b5('0x11')]['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1b1233,_0x3fe8fe[_0x50b5('0x11')]['message']);return _0x3cc137(_0x3fe8fe[_0x50b5('0x11')][_0x50b5('0x12')]);}logger[_0x50b5('0x11')](_0x50b5('0xc'),_0x1b1233,_0x3fe8fe['error'][_0x50b5('0x12')]);return _0x4a7aac(_0x3fe8fe['error']['message']);}else{logger[_0x50b5('0xb')](_0x50b5('0xc'),_0x1b1233,_0x50b5('0xd'));_0x4a7aac(_0x3fe8fe['result']['message']);}})[_0x50b5('0x13')](function(_0x201601){logger[_0x50b5('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x1b1233,_0x201601);_0x3cc137(_0x201601);});});} \ No newline at end of file +var _0x2db4=['error','code','message','VtigerConfiguration,\x20%s,\x20%s','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x3655b8,_0x15eb94){var _0x359944=function(_0x2dde59){while(--_0x2dde59){_0x3655b8['push'](_0x3655b8['shift']());}};_0x359944(++_0x15eb94);}(_0x2db4,0x1a6));var _0x42db=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2db4[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x42db('0x0'));var util=require(_0x42db('0x1'));var moment=require('moment');var BPromise=require(_0x42db('0x2'));var rs=require(_0x42db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42db('0x4'))['db'];var utils=require(_0x42db('0x5'));var logger=require(_0x42db('0x6'))(_0x42db('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x42db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ab1e0,_0x5d00ef,_0xfbc177){return new BPromise(function(_0x3cfd6f,_0x4b54a2){return client[_0x42db('0x9')](_0x2ab1e0,_0xfbc177)[_0x42db('0xa')](function(_0x235e44){logger[_0x42db('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x5d00ef,_0x42db('0xc'));logger[_0x42db('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5d00ef,_0x42db('0xc'),JSON[_0x42db('0xe')](_0x235e44));if(_0x235e44[_0x42db('0xf')]){if(_0x235e44[_0x42db('0xf')][_0x42db('0x10')]===0x1f4){logger[_0x42db('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x5d00ef,_0x235e44[_0x42db('0xf')]['message']);return _0x4b54a2(_0x235e44[_0x42db('0xf')]['message']);}logger[_0x42db('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x5d00ef,_0x235e44[_0x42db('0xf')][_0x42db('0x11')]);return _0x3cfd6f(_0x235e44[_0x42db('0xf')][_0x42db('0x11')]);}else{logger[_0x42db('0xb')](_0x42db('0x12'),_0x5d00ef,'request\x20sent');_0x3cfd6f(_0x235e44['result'][_0x42db('0x11')]);}})['catch'](function(_0x46fa92){logger[_0x42db('0xf')](_0x42db('0x12'),_0x5d00ef,_0x46fa92);_0x4b54a2(_0x46fa92);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 756a3ba..c6f2613 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 _0xac10=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','put','delete','exports','multer','util'];(function(_0x3a851e,_0x480fee){var _0x3ca51f=function(_0x1be9d4){while(--_0x1be9d4){_0x3a851e['push'](_0x3a851e['shift']());}};_0x3ca51f(++_0x480fee);}(_0xac10,0x196));var _0x0ac1=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xac10[_0x16629d];return _0x56ccee;};'use strict';var multer=require(_0x0ac1('0x0'));var util=require(_0x0ac1('0x1'));var path=require(_0x0ac1('0x2'));var timeout=require(_0x0ac1('0x3'));var express=require('express');var router=express[_0x0ac1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0ac1('0x5'));var interaction=require(_0x0ac1('0x6'));var config=require(_0x0ac1('0x7'));var controller=require(_0x0ac1('0x8'));router[_0x0ac1('0x9')]('/',auth[_0x0ac1('0xa')](),controller[_0x0ac1('0xb')]);router[_0x0ac1('0x9')](_0x0ac1('0xc'),auth[_0x0ac1('0xa')](),controller[_0x0ac1('0xd')]);router['post']('/',auth[_0x0ac1('0xa')](),controller['create']);router[_0x0ac1('0xe')](_0x0ac1('0xc'),auth[_0x0ac1('0xa')](),controller['update']);router[_0x0ac1('0xf')](_0x0ac1('0xc'),auth[_0x0ac1('0xa')](),controller['destroy']);module[_0x0ac1('0x10')]=router; \ No newline at end of file +var _0x45c6=['create','/:id','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','isAuthenticated','show'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x45c6,0x1a5));var _0x645c=function(_0x29ada9,_0x4c85b7){_0x29ada9=_0x29ada9-0x0;var _0x14bb2a=_0x45c6[_0x29ada9];return _0x14bb2a;};'use strict';var multer=require('multer');var util=require(_0x645c('0x0'));var path=require(_0x645c('0x1'));var timeout=require(_0x645c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x645c('0x3'));var auth=require(_0x645c('0x4'));var interaction=require(_0x645c('0x5'));var config=require(_0x645c('0x6'));var controller=require(_0x645c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x645c('0x8')]);router['get']('/:id',auth[_0x645c('0x9')](),controller[_0x645c('0xa')]);router['post']('/',auth[_0x645c('0x9')](),controller[_0x645c('0xb')]);router['put'](_0x645c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x645c('0xd')](_0x645c('0xc'),auth[_0x645c('0x9')](),controller[_0x645c('0xe')]);module[_0x645c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 1aea968..50a6577 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 _0x1dd1=['string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x2e53e1,_0x3c2c53){var _0x2d9956=function(_0x368e87){while(--_0x368e87){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x2d9956(++_0x3c2c53);}(_0x1dd1,0x125));var _0x11dd=function(_0x1e48b3,_0x3150bc){_0x1e48b3=_0x1e48b3-0x0;var _0x295fae=_0x1dd1[_0x1e48b3];return _0x295fae;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x11dd('0x0')](_0x11dd('0x1'),_0x11dd('0x2'),_0x11dd('0x3'),_0x11dd('0x4'),_0x11dd('0x5')),'defaultValue':_0x11dd('0x1')},'content':{'type':Sequelize[_0x11dd('0x6')]},'key':{'type':Sequelize[_0x11dd('0x6')]},'keyType':{'type':Sequelize[_0x11dd('0x0')](_0x11dd('0x1'),'variable',_0x11dd('0x3'))},'keyContent':{'type':Sequelize[_0x11dd('0x6')]},'idField':{'type':Sequelize[_0x11dd('0x6')]},'nameField':{'type':Sequelize[_0x11dd('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1630=['sequelize','ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x372ece,_0x44b352){var _0x4b9b4b=function(_0x5e7042){while(--_0x5e7042){_0x372ece['push'](_0x372ece['shift']());}};_0x4b9b4b(++_0x44b352);}(_0x1630,0x1b8));var _0x0163=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1630[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x0163('0x0'));module['exports']={'type':{'type':Sequelize[_0x0163('0x1')](_0x0163('0x2'),'variable',_0x0163('0x3'),_0x0163('0x4'),_0x0163('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0163('0x6')]},'key':{'type':Sequelize[_0x0163('0x6')]},'keyType':{'type':Sequelize[_0x0163('0x1')](_0x0163('0x2'),'variable',_0x0163('0x3'))},'keyContent':{'type':Sequelize[_0x0163('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0163('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0163('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ecb4ae6..2641d42 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 _0x6087=['offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0x6087,0x7b));var _0x7608=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6087[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x7608('0x0'));var rimraf=require(_0x7608('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7608('0x2'));var rp=require(_0x7608('0x3'));var moment=require(_0x7608('0x4'));var BPromise=require(_0x7608('0x5'));var Mustache=require(_0x7608('0x6'));var util=require('util');var path=require(_0x7608('0x7'));var sox=require(_0x7608('0x8'));var csv=require(_0x7608('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7608('0xa'));var _=require('lodash');var squel=require(_0x7608('0xb'));var crypto=require(_0x7608('0xc'));var jsforce=require(_0x7608('0xd'));var deskjs=require(_0x7608('0xe'));var toCsv=require(_0x7608('0x9'));var querystring=require(_0x7608('0xf'));var Papa=require(_0x7608('0x10'));var Redis=require(_0x7608('0x11'));var authService=require(_0x7608('0x12'));var qs=require(_0x7608('0x13'));var as=require(_0x7608('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7608('0x15'))(_0x7608('0x16'));var utils=require(_0x7608('0x17'));var config=require(_0x7608('0x18'));var licenseUtil=require(_0x7608('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f25e8,_0x53e946){_0x53e946=_0x53e946||0xcc;return function(_0x355d6c){if(_0x355d6c){return _0x5f25e8[_0x7608('0x1a')](_0x53e946);}return _0x5f25e8['status'](_0x53e946)['end']();};}function respondWithResult(_0x2710a6,_0x19696e){_0x19696e=_0x19696e||0xc8;return function(_0x3b5424){if(_0x3b5424){return _0x2710a6[_0x7608('0x1b')](_0x19696e)[_0x7608('0x1c')](_0x3b5424);}};}function respondWithFilteredResult(_0x537050,_0x58a68b){return function(_0x1601ac){if(_0x1601ac){var _0x4a4d23=typeof _0x58a68b[_0x7608('0x1d')]===_0x7608('0x1e')&&typeof _0x58a68b['limit']===_0x7608('0x1e');var _0x2d7104=_0x1601ac[_0x7608('0x1f')];var _0xb603d6=_0x4a4d23?0x0:_0x58a68b[_0x7608('0x1d')];var _0xd8e99f=_0x4a4d23?_0x1601ac[_0x7608('0x1f')]:_0x58a68b[_0x7608('0x1d')]+_0x58a68b[_0x7608('0x20')];var _0x5bf2f3;if(_0xd8e99f>=_0x2d7104){_0xd8e99f=_0x2d7104;_0x5bf2f3=0xc8;}else{_0x5bf2f3=0xce;}_0x537050['status'](_0x5bf2f3);return _0x537050[_0x7608('0x21')](_0x7608('0x22'),_0xb603d6+'-'+_0xd8e99f+'/'+_0x2d7104)[_0x7608('0x1c')](_0x1601ac);}return null;};}function patchUpdates(_0x310145){return function(_0x7a1722){try{jsonpatch[_0x7608('0x23')](_0x7a1722,_0x310145,!![]);}catch(_0x5d4b8c){return BPromise['reject'](_0x5d4b8c);}return _0x7a1722[_0x7608('0x24')]();};}function saveUpdates(_0x2bff49,_0x2c64c7){return function(_0x553309){if(_0x553309){return _0x553309[_0x7608('0x25')](_0x2bff49)['then'](function(_0x55006c){return _0x55006c;});}return null;};}function removeEntity(_0x2678fe,_0x1e2a0f){return function(_0x32b2f6){if(_0x32b2f6){return _0x32b2f6[_0x7608('0x26')]()['then'](function(){_0x2678fe[_0x7608('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eab30,_0x3dbb13){return function(_0x8f31d6){if(!_0x8f31d6){_0x3eab30['sendStatus'](0x194);}return _0x8f31d6;};}function handleError(_0x407e4d,_0x3e7507){_0x3e7507=_0x3e7507||0x1f4;return function(_0x2ca5c6){logger['error'](_0x2ca5c6[_0x7608('0x27')]);if(_0x2ca5c6['name']){delete _0x2ca5c6[_0x7608('0x28')];}_0x407e4d[_0x7608('0x1b')](_0x3e7507)[_0x7608('0x29')](_0x2ca5c6);};}exports[_0x7608('0x2a')]=function(_0x3fa9ab,_0x3157fe){var _0x2e4219={},_0x5a35b0={},_0x5e62a0={'count':0x0,'rows':[]};var _0x21190d=_['map'](db[_0x7608('0x2b')][_0x7608('0x2c')],function(_0x529656){return{'name':_0x529656[_0x7608('0x2d')],'type':_0x529656[_0x7608('0x2e')]['key']};});_0x5a35b0[_0x7608('0x2f')]=_[_0x7608('0x30')](_0x21190d,_0x7608('0x28'));_0x5a35b0[_0x7608('0x31')]=_[_0x7608('0x32')](_0x3fa9ab[_0x7608('0x31')]);_0x5a35b0['filters']=_['intersection'](_0x5a35b0[_0x7608('0x2f')],_0x5a35b0[_0x7608('0x31')]);_0x2e4219['attributes']=_[_0x7608('0x33')](_0x5a35b0[_0x7608('0x2f')],qs[_0x7608('0x34')](_0x3fa9ab['query'][_0x7608('0x34')]));_0x2e4219['attributes']=_0x2e4219['attributes']['length']?_0x2e4219[_0x7608('0x35')]:_0x5a35b0[_0x7608('0x2f')];if(!_0x3fa9ab[_0x7608('0x31')][_0x7608('0x36')](_0x7608('0x37'))){_0x2e4219[_0x7608('0x20')]=qs[_0x7608('0x20')](_0x3fa9ab[_0x7608('0x31')][_0x7608('0x20')]);_0x2e4219[_0x7608('0x1d')]=qs[_0x7608('0x1d')](_0x3fa9ab[_0x7608('0x31')]['offset']);}_0x2e4219[_0x7608('0x38')]=qs[_0x7608('0x39')](_0x3fa9ab[_0x7608('0x31')][_0x7608('0x39')]);_0x2e4219[_0x7608('0x3a')]=qs[_0x7608('0x3b')](_[_0x7608('0x3c')](_0x3fa9ab[_0x7608('0x31')],_0x5a35b0[_0x7608('0x3b')]),_0x21190d);if(_0x3fa9ab[_0x7608('0x31')][_0x7608('0x3d')]){_0x2e4219[_0x7608('0x3a')]=_[_0x7608('0x3e')](_0x2e4219[_0x7608('0x3a')],{'$or':_['map'](_0x21190d,function(_0x512978){if(_0x512978[_0x7608('0x2e')]!==_0x7608('0x3f')){var _0x1ac0d6={};_0x1ac0d6[_0x512978['name']]={'$like':'%'+_0x3fa9ab[_0x7608('0x31')][_0x7608('0x3d')]+'%'};return _0x1ac0d6;}})});}_0x2e4219=_[_0x7608('0x3e')]({},_0x2e4219,_0x3fa9ab[_0x7608('0x40')]);var _0x5f2648={'where':_0x2e4219[_0x7608('0x3a')]};return db['VtigerField'][_0x7608('0x1f')](_0x5f2648)[_0x7608('0x41')](function(_0x5356eb){_0x5e62a0['count']=_0x5356eb;if(_0x3fa9ab[_0x7608('0x31')][_0x7608('0x42')]){_0x2e4219[_0x7608('0x43')]=[{'all':!![]}];}return db[_0x7608('0x2b')][_0x7608('0x44')](_0x2e4219);})['then'](function(_0x4ab729){_0x5e62a0[_0x7608('0x45')]=_0x4ab729;return _0x5e62a0;})[_0x7608('0x41')](respondWithFilteredResult(_0x3157fe,_0x2e4219))[_0x7608('0x46')](handleError(_0x3157fe,null));};exports['show']=function(_0x568278,_0x30ffbf){var _0x5845d9={'raw':!![],'where':{'id':_0x568278[_0x7608('0x47')]['id']}},_0x457b9d={};_0x457b9d[_0x7608('0x2f')]=_['keys'](db['VtigerField'][_0x7608('0x2c')]);_0x457b9d[_0x7608('0x31')]=_[_0x7608('0x32')](_0x568278[_0x7608('0x31')]);_0x457b9d[_0x7608('0x3b')]=_[_0x7608('0x33')](_0x457b9d[_0x7608('0x2f')],_0x457b9d[_0x7608('0x31')]);_0x5845d9['attributes']=_[_0x7608('0x33')](_0x457b9d[_0x7608('0x2f')],qs[_0x7608('0x34')](_0x568278[_0x7608('0x31')][_0x7608('0x34')]));_0x5845d9['attributes']=_0x5845d9[_0x7608('0x35')][_0x7608('0x48')]?_0x5845d9[_0x7608('0x35')]:_0x457b9d[_0x7608('0x2f')];if(_0x568278[_0x7608('0x31')][_0x7608('0x42')]){_0x5845d9[_0x7608('0x43')]=[{'all':!![]}];}_0x5845d9=_[_0x7608('0x3e')]({},_0x5845d9,_0x568278['options']);return db[_0x7608('0x2b')][_0x7608('0x49')](_0x5845d9)['then'](handleEntityNotFound(_0x30ffbf,null))[_0x7608('0x41')](respondWithResult(_0x30ffbf,null))[_0x7608('0x46')](handleError(_0x30ffbf,null));};exports[_0x7608('0x4a')]=function(_0xb63847,_0x1de153){return db['VtigerField'][_0x7608('0x4a')](_0xb63847[_0x7608('0x4b')],{})[_0x7608('0x41')](respondWithResult(_0x1de153,0xc9))[_0x7608('0x46')](handleError(_0x1de153,null));};exports[_0x7608('0x25')]=function(_0x199d8d,_0x4482cd){if(_0x199d8d[_0x7608('0x4b')]['id']){delete _0x199d8d[_0x7608('0x4b')]['id'];}return db[_0x7608('0x2b')][_0x7608('0x49')]({'where':{'id':_0x199d8d[_0x7608('0x47')]['id']}})[_0x7608('0x41')](handleEntityNotFound(_0x4482cd,null))[_0x7608('0x41')](saveUpdates(_0x199d8d[_0x7608('0x4b')],null))[_0x7608('0x41')](respondWithResult(_0x4482cd,null))['catch'](handleError(_0x4482cd,null));};exports[_0x7608('0x26')]=function(_0x389d15,_0x5a7deb){return db['VtigerField'][_0x7608('0x49')]({'where':{'id':_0x389d15[_0x7608('0x47')]['id']}})[_0x7608('0x41')](handleEntityNotFound(_0x5a7deb,null))[_0x7608('0x41')](removeEntity(_0x5a7deb,null))[_0x7608('0x46')](handleError(_0x5a7deb,null));}; \ No newline at end of file +var _0x6dcc=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x59ccba,_0x1d9424){var _0x1f43cb=function(_0x5daaf9){while(--_0x5daaf9){_0x59ccba['push'](_0x59ccba['shift']());}};_0x1f43cb(++_0x1d9424);}(_0x6dcc,0x89));var _0xc6dc=function(_0x5cdb4a,_0x39e8ee){_0x5cdb4a=_0x5cdb4a-0x0;var _0x3b0044=_0x6dcc[_0x5cdb4a];return _0x3b0044;};'use strict';var emlformat=require(_0xc6dc('0x0'));var rimraf=require(_0xc6dc('0x1'));var zipdir=require(_0xc6dc('0x2'));var jsonpatch=require(_0xc6dc('0x3'));var rp=require(_0xc6dc('0x4'));var moment=require(_0xc6dc('0x5'));var BPromise=require(_0xc6dc('0x6'));var Mustache=require('mustache');var util=require(_0xc6dc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc6dc('0x8'));var ejs=require(_0xc6dc('0x9'));var fs=require('fs');var fs_extra=require(_0xc6dc('0xa'));var _=require('lodash');var squel=require(_0xc6dc('0xb'));var crypto=require(_0xc6dc('0xc'));var jsforce=require(_0xc6dc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc6dc('0x8'));var querystring=require(_0xc6dc('0xe'));var Papa=require('papaparse');var Redis=require(_0xc6dc('0xf'));var authService=require(_0xc6dc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6dc('0x11'));var logger=require(_0xc6dc('0x12'))(_0xc6dc('0x13'));var utils=require(_0xc6dc('0x14'));var config=require(_0xc6dc('0x15'));var licenseUtil=require(_0xc6dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28f11e,_0xb28d93){_0xb28d93=_0xb28d93||0xcc;return function(_0xcc7262){if(_0xcc7262){return _0x28f11e[_0xc6dc('0x17')](_0xb28d93);}return _0x28f11e['status'](_0xb28d93)[_0xc6dc('0x18')]();};}function respondWithResult(_0x159d06,_0x486b63){_0x486b63=_0x486b63||0xc8;return function(_0xe044ac){if(_0xe044ac){return _0x159d06[_0xc6dc('0x19')](_0x486b63)[_0xc6dc('0x1a')](_0xe044ac);}};}function respondWithFilteredResult(_0x19ec14,_0x3b2e76){return function(_0x3a8dec){if(_0x3a8dec){var _0x3fd89a=typeof _0x3b2e76[_0xc6dc('0x1b')]===_0xc6dc('0x1c')&&typeof _0x3b2e76['limit']==='undefined';var _0x3bb96c=_0x3a8dec[_0xc6dc('0x1d')];var _0x58a4fd=_0x3fd89a?0x0:_0x3b2e76['offset'];var _0x23966d=_0x3fd89a?_0x3a8dec['count']:_0x3b2e76['offset']+_0x3b2e76[_0xc6dc('0x1e')];var _0x2c6cc0;if(_0x23966d>=_0x3bb96c){_0x23966d=_0x3bb96c;_0x2c6cc0=0xc8;}else{_0x2c6cc0=0xce;}_0x19ec14[_0xc6dc('0x19')](_0x2c6cc0);return _0x19ec14[_0xc6dc('0x1f')](_0xc6dc('0x20'),_0x58a4fd+'-'+_0x23966d+'/'+_0x3bb96c)['json'](_0x3a8dec);}return null;};}function patchUpdates(_0x5e46b3){return function(_0x14b4d){try{jsonpatch[_0xc6dc('0x21')](_0x14b4d,_0x5e46b3,!![]);}catch(_0x51165d){return BPromise[_0xc6dc('0x22')](_0x51165d);}return _0x14b4d[_0xc6dc('0x23')]();};}function saveUpdates(_0x31fa80,_0x4c44a4){return function(_0x5134ed){if(_0x5134ed){return _0x5134ed[_0xc6dc('0x24')](_0x31fa80)[_0xc6dc('0x25')](function(_0x2fa2bd){return _0x2fa2bd;});}return null;};}function removeEntity(_0x495ef4,_0x55db49){return function(_0x4531bb){if(_0x4531bb){return _0x4531bb[_0xc6dc('0x26')]()[_0xc6dc('0x25')](function(){_0x495ef4['status'](0xcc)[_0xc6dc('0x18')]();});}};}function handleEntityNotFound(_0x479acd,_0x3da3f6){return function(_0x13d233){if(!_0x13d233){_0x479acd[_0xc6dc('0x17')](0x194);}return _0x13d233;};}function handleError(_0x326eb5,_0x567f25){_0x567f25=_0x567f25||0x1f4;return function(_0x2ea4b0){logger[_0xc6dc('0x27')](_0x2ea4b0[_0xc6dc('0x28')]);if(_0x2ea4b0[_0xc6dc('0x29')]){delete _0x2ea4b0[_0xc6dc('0x29')];}_0x326eb5[_0xc6dc('0x19')](_0x567f25)[_0xc6dc('0x2a')](_0x2ea4b0);};}exports[_0xc6dc('0x2b')]=function(_0x362bbc,_0x1ae725){var _0x222325={},_0xc657ef={},_0x4a0b1e={'count':0x0,'rows':[]};var _0x5e264d=_['map'](db[_0xc6dc('0x2c')][_0xc6dc('0x2d')],function(_0x37e234){return{'name':_0x37e234[_0xc6dc('0x2e')],'type':_0x37e234[_0xc6dc('0x2f')][_0xc6dc('0x30')]};});_0xc657ef[_0xc6dc('0x31')]=_['map'](_0x5e264d,_0xc6dc('0x29'));_0xc657ef['query']=_[_0xc6dc('0x32')](_0x362bbc[_0xc6dc('0x33')]);_0xc657ef['filters']=_[_0xc6dc('0x34')](_0xc657ef[_0xc6dc('0x31')],_0xc657ef[_0xc6dc('0x33')]);_0x222325['attributes']=_['intersection'](_0xc657ef['model'],qs[_0xc6dc('0x35')](_0x362bbc['query'][_0xc6dc('0x35')]));_0x222325[_0xc6dc('0x36')]=_0x222325[_0xc6dc('0x36')][_0xc6dc('0x37')]?_0x222325[_0xc6dc('0x36')]:_0xc657ef[_0xc6dc('0x31')];if(!_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x38')](_0xc6dc('0x39'))){_0x222325[_0xc6dc('0x1e')]=qs[_0xc6dc('0x1e')](_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x1e')]);_0x222325[_0xc6dc('0x1b')]=qs['offset'](_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x1b')]);}_0x222325[_0xc6dc('0x3a')]=qs[_0xc6dc('0x3b')](_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x3b')]);_0x222325[_0xc6dc('0x3c')]=qs[_0xc6dc('0x3d')](_[_0xc6dc('0x3e')](_0x362bbc[_0xc6dc('0x33')],_0xc657ef['filters']),_0x5e264d);if(_0x362bbc[_0xc6dc('0x33')]['filter']){_0x222325['where']=_[_0xc6dc('0x3f')](_0x222325[_0xc6dc('0x3c')],{'$or':_[_0xc6dc('0x40')](_0x5e264d,function(_0x59d0b1){if(_0x59d0b1[_0xc6dc('0x2f')]!==_0xc6dc('0x41')){var _0x1fa363={};_0x1fa363[_0x59d0b1[_0xc6dc('0x29')]]={'$like':'%'+_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x42')]+'%'};return _0x1fa363;}})});}_0x222325=_[_0xc6dc('0x3f')]({},_0x222325,_0x362bbc[_0xc6dc('0x43')]);var _0x5b7bd1={'where':_0x222325[_0xc6dc('0x3c')]};return db[_0xc6dc('0x2c')][_0xc6dc('0x1d')](_0x5b7bd1)['then'](function(_0x9effbc){_0x4a0b1e[_0xc6dc('0x1d')]=_0x9effbc;if(_0x362bbc[_0xc6dc('0x33')]['includeAll']){_0x222325[_0xc6dc('0x44')]=[{'all':!![]}];}return db['VtigerField'][_0xc6dc('0x45')](_0x222325);})[_0xc6dc('0x25')](function(_0x3e983b){_0x4a0b1e[_0xc6dc('0x46')]=_0x3e983b;return _0x4a0b1e;})[_0xc6dc('0x25')](respondWithFilteredResult(_0x1ae725,_0x222325))[_0xc6dc('0x47')](handleError(_0x1ae725,null));};exports[_0xc6dc('0x48')]=function(_0x5d8285,_0x46ed7f){var _0x26275a={'raw':!![],'where':{'id':_0x5d8285['params']['id']}},_0x2edb97={};_0x2edb97[_0xc6dc('0x31')]=_[_0xc6dc('0x32')](db[_0xc6dc('0x2c')]['rawAttributes']);_0x2edb97[_0xc6dc('0x33')]=_['keys'](_0x5d8285[_0xc6dc('0x33')]);_0x2edb97[_0xc6dc('0x3d')]=_[_0xc6dc('0x34')](_0x2edb97[_0xc6dc('0x31')],_0x2edb97[_0xc6dc('0x33')]);_0x26275a[_0xc6dc('0x36')]=_[_0xc6dc('0x34')](_0x2edb97[_0xc6dc('0x31')],qs[_0xc6dc('0x35')](_0x5d8285[_0xc6dc('0x33')][_0xc6dc('0x35')]));_0x26275a[_0xc6dc('0x36')]=_0x26275a[_0xc6dc('0x36')][_0xc6dc('0x37')]?_0x26275a[_0xc6dc('0x36')]:_0x2edb97[_0xc6dc('0x31')];if(_0x5d8285[_0xc6dc('0x33')]['includeAll']){_0x26275a['include']=[{'all':!![]}];}_0x26275a=_[_0xc6dc('0x3f')]({},_0x26275a,_0x5d8285[_0xc6dc('0x43')]);return db[_0xc6dc('0x2c')][_0xc6dc('0x49')](_0x26275a)[_0xc6dc('0x25')](handleEntityNotFound(_0x46ed7f,null))[_0xc6dc('0x25')](respondWithResult(_0x46ed7f,null))[_0xc6dc('0x47')](handleError(_0x46ed7f,null));};exports[_0xc6dc('0x4a')]=function(_0x4be64f,_0x3af2a8){return db['VtigerField'][_0xc6dc('0x4a')](_0x4be64f[_0xc6dc('0x4b')],{})[_0xc6dc('0x25')](respondWithResult(_0x3af2a8,0xc9))[_0xc6dc('0x47')](handleError(_0x3af2a8,null));};exports[_0xc6dc('0x24')]=function(_0x4a2d1c,_0x92a14b){if(_0x4a2d1c[_0xc6dc('0x4b')]['id']){delete _0x4a2d1c[_0xc6dc('0x4b')]['id'];}return db['VtigerField'][_0xc6dc('0x49')]({'where':{'id':_0x4a2d1c[_0xc6dc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x92a14b,null))[_0xc6dc('0x25')](saveUpdates(_0x4a2d1c[_0xc6dc('0x4b')],null))[_0xc6dc('0x25')](respondWithResult(_0x92a14b,null))[_0xc6dc('0x47')](handleError(_0x92a14b,null));};exports['destroy']=function(_0x323107,_0x36f959){return db[_0xc6dc('0x2c')][_0xc6dc('0x49')]({'where':{'id':_0x323107['params']['id']}})[_0xc6dc('0x25')](handleEntityNotFound(_0x36f959,null))['then'](removeEntity(_0x36f959,null))[_0xc6dc('0x47')](handleError(_0x36f959,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 5d92340..115ec64 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 _0x2f7f=['./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','path'];(function(_0x5dbc88,_0x459e80){var _0x570779=function(_0x17709a){while(--_0x17709a){_0x5dbc88['push'](_0x5dbc88['shift']());}};_0x570779(++_0x459e80);}(_0x2f7f,0x1ce));var _0xf2f7=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x2f7f[_0x199bc4];return _0x136ffb;};'use strict';var _=require(_0xf2f7('0x0'));var util=require(_0xf2f7('0x1'));var logger=require(_0xf2f7('0x2'))(_0xf2f7('0x3'));var moment=require(_0xf2f7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2f7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf2f7('0x6'));module[_0xf2f7('0x7')]=function(_0x397f21,_0x50b2c7){return _0x397f21[_0xf2f7('0x8')](_0xf2f7('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xf2f7('0xa'),'fields':['idField',_0xf2f7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326d=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0xa697e6,_0x377690){var _0x44e8d8=function(_0x288897){while(--_0x288897){_0xa697e6['push'](_0xa697e6['shift']());}};_0x44e8d8(++_0x377690);}(_0x326d,0x1ae));var _0xd326=function(_0x5cd6f4,_0x2c7f2c){_0x5cd6f4=_0x5cd6f4-0x0;var _0x112a6b=_0x326d[_0x5cd6f4];return _0x112a6b;};'use strict';var _=require(_0xd326('0x0'));var util=require(_0xd326('0x1'));var logger=require(_0xd326('0x2'))(_0xd326('0x3'));var moment=require(_0xd326('0x4'));var BPromise=require(_0xd326('0x5'));var rp=require(_0xd326('0x6'));var fs=require('fs');var path=require(_0xd326('0x7'));var rimraf=require('rimraf');var config=require(_0xd326('0x8'));var attributes=require(_0xd326('0x9'));module[_0xd326('0xa')]=function(_0x2197c9,_0x3f687e){return _0x2197c9[_0xd326('0xb')](_0xd326('0xc'),attributes,{'tableName':_0xd326('0xd'),'paranoid':![],'indexes':[{'name':_0xd326('0xe'),'fields':[_0xd326('0xf'),_0xd326('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 6ad98a4..966e292 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 _0x9ec8=['rpc','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xda144e,_0x481dfe){var _0x48a060=function(_0x225435){while(--_0x225435){_0xda144e['push'](_0xda144e['shift']());}};_0x48a060(++_0x481dfe);}(_0x9ec8,0xb8));var _0x89ec=function(_0x4620df,_0x46469a){_0x4620df=_0x4620df-0x0;var _0x1d47f4=_0x9ec8[_0x4620df];return _0x1d47f4;};'use strict';var _=require(_0x89ec('0x0'));var util=require(_0x89ec('0x1'));var moment=require('moment');var BPromise=require(_0x89ec('0x2'));var rs=require(_0x89ec('0x3'));var fs=require('fs');var Redis=require(_0x89ec('0x4'));var db=require(_0x89ec('0x5'))['db'];var utils=require(_0x89ec('0x6'));var logger=require(_0x89ec('0x7'))(_0x89ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x89ec('0x9'));var client=jayson[_0x89ec('0xa')][_0x89ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45d23b,_0x5a8882,_0x39b158){return new BPromise(function(_0x1256db,_0x23dd1e){return client[_0x89ec('0xc')](_0x45d23b,_0x39b158)[_0x89ec('0xd')](function(_0x13910d){logger['info'](_0x89ec('0xe'),_0x5a8882,'request\x20sent');logger['debug'](_0x89ec('0xf'),_0x5a8882,_0x89ec('0x10'),JSON[_0x89ec('0x11')](_0x13910d));if(_0x13910d[_0x89ec('0x12')]){if(_0x13910d[_0x89ec('0x12')][_0x89ec('0x13')]===0x1f4){logger[_0x89ec('0x12')](_0x89ec('0xe'),_0x5a8882,_0x13910d[_0x89ec('0x12')][_0x89ec('0x14')]);return _0x23dd1e(_0x13910d[_0x89ec('0x12')][_0x89ec('0x14')]);}logger[_0x89ec('0x12')](_0x89ec('0xe'),_0x5a8882,_0x13910d[_0x89ec('0x12')][_0x89ec('0x14')]);return _0x1256db(_0x13910d['error'][_0x89ec('0x14')]);}else{logger[_0x89ec('0x15')](_0x89ec('0xe'),_0x5a8882,'request\x20sent');_0x1256db(_0x13910d[_0x89ec('0x16')]['message']);}})[_0x89ec('0x17')](function(_0x58175d){logger[_0x89ec('0x12')]('VtigerField,\x20%s,\x20%s',_0x5a8882,_0x58175d);_0x23dd1e(_0x58175d);});});} \ No newline at end of file +var _0xdd28=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring'];(function(_0x19380b,_0x261bb7){var _0x552d6d=function(_0x2bce05){while(--_0x2bce05){_0x19380b['push'](_0x19380b['shift']());}};_0x552d6d(++_0x261bb7);}(_0xdd28,0x1a0));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd2('0x0'));var util=require(_0x8dd2('0x1'));var moment=require('moment');var BPromise=require(_0x8dd2('0x2'));var rs=require(_0x8dd2('0x3'));var fs=require('fs');var Redis=require(_0x8dd2('0x4'));var db=require(_0x8dd2('0x5'))['db'];var utils=require(_0x8dd2('0x6'));var logger=require('../../config/logger')(_0x8dd2('0x7'));var config=require(_0x8dd2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8dd2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538700,_0x52c586,_0x240e1f){return new BPromise(function(_0x2caa8b,_0x1180b9){return client[_0x8dd2('0xa')](_0x538700,_0x240e1f)['then'](function(_0x2ccfda){logger[_0x8dd2('0xb')]('VtigerField,\x20%s,\x20%s',_0x52c586,_0x8dd2('0xc'));logger['debug'](_0x8dd2('0xd'),_0x52c586,'request\x20sent',JSON[_0x8dd2('0xe')](_0x2ccfda));if(_0x2ccfda['error']){if(_0x2ccfda[_0x8dd2('0xf')][_0x8dd2('0x10')]===0x1f4){logger[_0x8dd2('0xf')](_0x8dd2('0x11'),_0x52c586,_0x2ccfda[_0x8dd2('0xf')][_0x8dd2('0x12')]);return _0x1180b9(_0x2ccfda['error'][_0x8dd2('0x12')]);}logger[_0x8dd2('0xf')]('VtigerField,\x20%s,\x20%s',_0x52c586,_0x2ccfda[_0x8dd2('0xf')]['message']);return _0x2caa8b(_0x2ccfda[_0x8dd2('0xf')][_0x8dd2('0x12')]);}else{logger[_0x8dd2('0xb')](_0x8dd2('0x11'),_0x52c586,_0x8dd2('0xc'));_0x2caa8b(_0x2ccfda['result'][_0x8dd2('0x12')]);}})[_0x8dd2('0x13')](function(_0x4da6c0){logger[_0x8dd2('0xf')](_0x8dd2('0x11'),_0x52c586,_0x4da6c0);_0x1180b9(_0x4da6c0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 6f1dc20..3796bb9 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 _0x9d2c=['fs-extra','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xbf8f73,_0x2ca243){var _0x53d9a9=function(_0x7c851d){while(--_0x7c851d){_0xbf8f73['push'](_0xbf8f73['shift']());}};_0x53d9a9(++_0x2ca243);}(_0x9d2c,0x68));var _0xc9d2=function(_0xb9d5c6,_0x39db02){_0xb9d5c6=_0xb9d5c6-0x0;var _0x20aa38=_0x9d2c[_0xb9d5c6];return _0x20aa38;};'use strict';var multer=require(_0xc9d2('0x0'));var util=require(_0xc9d2('0x1'));var path=require(_0xc9d2('0x2'));var timeout=require(_0xc9d2('0x3'));var express=require(_0xc9d2('0x4'));var router=express[_0xc9d2('0x5')]();var fs_extra=require(_0xc9d2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc9d2('0x7'));var controller=require(_0xc9d2('0x8'));router[_0xc9d2('0x9')]('/',auth[_0xc9d2('0xa')](),controller['index']);router[_0xc9d2('0x9')](_0xc9d2('0xb'),auth[_0xc9d2('0xa')](),controller[_0xc9d2('0xc')]);router[_0xc9d2('0x9')](_0xc9d2('0xd'),auth[_0xc9d2('0xa')](),controller[_0xc9d2('0xe')]);router[_0xc9d2('0x9')](_0xc9d2('0xf'),auth[_0xc9d2('0xa')](),controller[_0xc9d2('0x10')]);router[_0xc9d2('0x11')]('/',auth[_0xc9d2('0xa')](),controller[_0xc9d2('0x12')]);router['post'](_0xc9d2('0xd'),auth[_0xc9d2('0xa')](),controller[_0xc9d2('0x13')]);router['put'](_0xc9d2('0xb'),auth['isAuthenticated'](),controller[_0xc9d2('0x14')]);router['delete'](_0xc9d2('0xb'),auth[_0xc9d2('0xa')](),controller['destroy']);module[_0xc9d2('0x15')]=router; \ No newline at end of file +var _0xcb04=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c69cb,_0x25751f){var _0x559c9b=function(_0x2ff2a4){while(--_0x2ff2a4){_0x2c69cb['push'](_0x2c69cb['shift']());}};_0x559c9b(++_0x25751f);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var path=require(_0x4cb0('0x2'));var timeout=require(_0x4cb0('0x3'));var express=require(_0x4cb0('0x4'));var router=express[_0x4cb0('0x5')]();var fs_extra=require(_0x4cb0('0x6'));var auth=require(_0x4cb0('0x7'));var interaction=require(_0x4cb0('0x8'));var config=require(_0x4cb0('0x9'));var controller=require('./intZendeskAccount.controller');router[_0x4cb0('0xa')]('/',auth[_0x4cb0('0xb')](),controller[_0x4cb0('0xc')]);router[_0x4cb0('0xa')](_0x4cb0('0xd'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0xe')]);router[_0x4cb0('0xa')](_0x4cb0('0xf'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x10')]);router[_0x4cb0('0xa')](_0x4cb0('0x11'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x12')]);router[_0x4cb0('0x13')]('/',auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x14')]);router['post'](_0x4cb0('0xf'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x15')]);router[_0x4cb0('0x16')]('/:id',auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x17')]);router[_0x4cb0('0x18')](_0x4cb0('0xd'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x19')]);module[_0x4cb0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 29d1942..850ab02 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 _0x53ec=['username','remoteUri','ENUM','token','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x42e5c7,_0x31f4dd){var _0x159d3b=function(_0x1ae4f5){while(--_0x1ae4f5){_0x42e5c7['push'](_0x42e5c7['shift']());}};_0x159d3b(++_0x31f4dd);}(_0x53ec,0x192));var _0xc53e=function(_0x5301a0,_0x562072){_0x5301a0=_0x5301a0-0x0;var _0x3edb89=_0x53ec[_0x5301a0];return _0x3edb89;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')]},'description':{'type':Sequelize[_0xc53e('0x2')]},'username':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc53e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc53e('0x4')},'authType':{'type':Sequelize[_0xc53e('0x5')]('password',_0xc53e('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x5')]('integrationTab',_0xc53e('0x7')),'defaultValue':_0xc53e('0x8')}}; \ No newline at end of file +var _0x81d4=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','exports'];(function(_0x5c3165,_0x16eb6d){var _0xdb6178=function(_0x2c07b3){while(--_0x2c07b3){_0x5c3165['push'](_0x5c3165['shift']());}};_0xdb6178(++_0x16eb6d);}(_0x81d4,0x197));var _0x481d=function(_0x372938,_0x454f2a){_0x372938=_0x372938-0x0;var _0x39ebc5=_0x81d4[_0x372938];return _0x39ebc5;};'use strict';var Sequelize=require('sequelize');module[_0x481d('0x0')]={'name':{'type':Sequelize[_0x481d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x481d('0x1')],'unique':_0x481d('0x2')},'password':{'type':Sequelize[_0x481d('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x481d('0x3')},'authType':{'type':Sequelize[_0x481d('0x4')](_0x481d('0x5'),'token'),'defaultValue':_0x481d('0x5')},'serverUrl':{'type':Sequelize[_0x481d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x481d('0x4')](_0x481d('0x6'),_0x481d('0x7')),'defaultValue':_0x481d('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index d85e8bd..a0852e5 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 _0x3266=['crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','count','includeAll','include','findAll','rows','catch','merge','options','create','body','find','params','destroy','findOne','ZendeskConfiguration','order','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','username','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','password','headers','Basic\x20%s','%s:%s','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','system_field_options','custom_field_options','test','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash'];(function(_0x1b4949,_0x38c7d7){var _0x3ce6f2=function(_0x6ff38d){while(--_0x6ff38d){_0x1b4949['push'](_0x1b4949['shift']());}};_0x3ce6f2(++_0x38c7d7);}(_0x3266,0x6a));var _0x6326=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x3266[_0x44b3bd];return _0x1efc4a;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];var integrations=require(_0x6326('0x1c'));function respondWithStatusCode(_0x5c07e1,_0x5381d0){_0x5381d0=_0x5381d0||0xcc;return function(_0x301f34){if(_0x301f34){return _0x5c07e1[_0x6326('0x1d')](_0x5381d0);}return _0x5c07e1['status'](_0x5381d0)[_0x6326('0x1e')]();};}function respondWithResult(_0x4caef3,_0x2d2d9b){_0x2d2d9b=_0x2d2d9b||0xc8;return function(_0x20dcc6){if(_0x20dcc6){return _0x4caef3[_0x6326('0x1f')](_0x2d2d9b)[_0x6326('0x20')](_0x20dcc6);}};}function respondWithFilteredResult(_0x1ed3a3,_0x2c1879){return function(_0x55923a){if(_0x55923a){var _0x1104c5=typeof _0x2c1879['offset']==='undefined'&&typeof _0x2c1879['limit']==='undefined';var _0x5d402d=_0x55923a['count'];var _0xdf5ced=_0x1104c5?0x0:_0x2c1879[_0x6326('0x21')];var _0x2be78e=_0x1104c5?_0x55923a['count']:_0x2c1879['offset']+_0x2c1879[_0x6326('0x22')];var _0x42319c;if(_0x2be78e>=_0x5d402d){_0x2be78e=_0x5d402d;_0x42319c=0xc8;}else{_0x42319c=0xce;}_0x1ed3a3[_0x6326('0x1f')](_0x42319c);return _0x1ed3a3[_0x6326('0x23')](_0x6326('0x24'),_0xdf5ced+'-'+_0x2be78e+'/'+_0x5d402d)[_0x6326('0x20')](_0x55923a);}return null;};}function patchUpdates(_0x21ee7d){return function(_0x53b437){try{jsonpatch[_0x6326('0x25')](_0x53b437,_0x21ee7d,!![]);}catch(_0x549f07){return BPromise[_0x6326('0x26')](_0x549f07);}return _0x53b437[_0x6326('0x27')]();};}function saveUpdates(_0x2482ef,_0x24fb78){return function(_0x43cdfc){if(_0x43cdfc){return _0x43cdfc[_0x6326('0x28')](_0x2482ef)[_0x6326('0x29')](function(_0x429bb0){return _0x429bb0;});}return null;};}function removeEntity(_0x4781cc,_0x2d0d00){return function(_0x34954b){if(_0x34954b){return _0x34954b['destroy']()[_0x6326('0x29')](function(){_0x4781cc[_0x6326('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e272b,_0x4d28fd){return function(_0x405474){if(!_0x405474){_0x4e272b['sendStatus'](0x194);}return _0x405474;};}function handleError(_0x33c466,_0x1a48da){_0x1a48da=_0x1a48da||0x1f4;return function(_0x5a907f){logger[_0x6326('0x2a')](_0x5a907f[_0x6326('0x2b')]);if(_0x5a907f[_0x6326('0x2c')]){delete _0x5a907f[_0x6326('0x2c')];}_0x33c466[_0x6326('0x1f')](_0x1a48da)[_0x6326('0x2d')](_0x5a907f);};}exports[_0x6326('0x2e')]=function(_0x27802c,_0x461e0f){var _0x127744={},_0x4980f6={},_0x2a8873={'count':0x0,'rows':[]};var _0x331772=_[_0x6326('0x2f')](db[_0x6326('0x30')][_0x6326('0x31')],function(_0x520e57){return{'name':_0x520e57[_0x6326('0x32')],'type':_0x520e57[_0x6326('0x33')][_0x6326('0x34')]};});_0x4980f6['model']=_[_0x6326('0x2f')](_0x331772,'name');_0x4980f6['query']=_[_0x6326('0x35')](_0x27802c[_0x6326('0x36')]);_0x4980f6[_0x6326('0x37')]=_[_0x6326('0x38')](_0x4980f6[_0x6326('0x39')],_0x4980f6[_0x6326('0x36')]);_0x127744[_0x6326('0x3a')]=_[_0x6326('0x38')](_0x4980f6[_0x6326('0x39')],qs[_0x6326('0x3b')](_0x27802c[_0x6326('0x36')][_0x6326('0x3b')]));_0x127744['attributes']=_0x127744[_0x6326('0x3a')][_0x6326('0x3c')]?_0x127744['attributes']:_0x4980f6[_0x6326('0x39')];if(!_0x27802c[_0x6326('0x36')][_0x6326('0x3d')]('nolimit')){_0x127744[_0x6326('0x22')]=qs['limit'](_0x27802c['query'][_0x6326('0x22')]);_0x127744[_0x6326('0x21')]=qs[_0x6326('0x21')](_0x27802c['query'][_0x6326('0x21')]);}_0x127744['order']=qs[_0x6326('0x3e')](_0x27802c['query'][_0x6326('0x3e')]);_0x127744[_0x6326('0x3f')]=qs[_0x6326('0x37')](_[_0x6326('0x40')](_0x27802c[_0x6326('0x36')],_0x4980f6[_0x6326('0x37')]),_0x331772);if(_0x27802c['query'][_0x6326('0x41')]){_0x127744[_0x6326('0x3f')]=_['merge'](_0x127744[_0x6326('0x3f')],{'$or':_['map'](_0x331772,function(_0x5607ea){if(_0x5607ea[_0x6326('0x33')]!==_0x6326('0x42')){var _0x3c170b={};_0x3c170b[_0x5607ea[_0x6326('0x2c')]]={'$like':'%'+_0x27802c[_0x6326('0x36')][_0x6326('0x41')]+'%'};return _0x3c170b;}})});}_0x127744=_['merge']({},_0x127744,_0x27802c['options']);var _0x32886f={'where':_0x127744['where']};return db[_0x6326('0x30')]['count'](_0x32886f)[_0x6326('0x29')](function(_0x517f6b){_0x2a8873[_0x6326('0x43')]=_0x517f6b;if(_0x27802c[_0x6326('0x36')][_0x6326('0x44')]){_0x127744[_0x6326('0x45')]=[{'all':!![]}];}return db[_0x6326('0x30')][_0x6326('0x46')](_0x127744);})[_0x6326('0x29')](function(_0x3998ba){_0x2a8873[_0x6326('0x47')]=_0x3998ba;return _0x2a8873;})['then'](respondWithFilteredResult(_0x461e0f,_0x127744))[_0x6326('0x48')](handleError(_0x461e0f,null));};exports['show']=function(_0x29f2fd,_0x1d9d4c){var _0x16fc33={'raw':![],'where':{'id':_0x29f2fd['params']['id']}},_0x50582a={};_0x50582a[_0x6326('0x39')]=_[_0x6326('0x35')](db['ZendeskAccount'][_0x6326('0x31')]);_0x50582a[_0x6326('0x36')]=_[_0x6326('0x35')](_0x29f2fd[_0x6326('0x36')]);_0x50582a['filters']=_[_0x6326('0x38')](_0x50582a[_0x6326('0x39')],_0x50582a[_0x6326('0x36')]);_0x16fc33[_0x6326('0x3a')]=_[_0x6326('0x38')](_0x50582a[_0x6326('0x39')],qs[_0x6326('0x3b')](_0x29f2fd['query'][_0x6326('0x3b')]));_0x16fc33[_0x6326('0x3a')]=_0x16fc33[_0x6326('0x3a')][_0x6326('0x3c')]?_0x16fc33['attributes']:_0x50582a[_0x6326('0x39')];if(_0x29f2fd['query'][_0x6326('0x44')]){_0x16fc33[_0x6326('0x45')]=[{'all':!![]}];}_0x16fc33=_[_0x6326('0x49')]({},_0x16fc33,_0x29f2fd[_0x6326('0x4a')]);return db[_0x6326('0x30')]['find'](_0x16fc33)[_0x6326('0x29')](handleEntityNotFound(_0x1d9d4c,null))['then'](respondWithResult(_0x1d9d4c,null))['catch'](handleError(_0x1d9d4c,null));};exports[_0x6326('0x4b')]=function(_0x44cf9d,_0x5b14f4){return db[_0x6326('0x30')][_0x6326('0x4b')](_0x44cf9d[_0x6326('0x4c')],{})[_0x6326('0x29')](respondWithResult(_0x5b14f4,0xc9))[_0x6326('0x48')](handleError(_0x5b14f4,null));};exports['update']=function(_0x4af0ee,_0x2d82c0){if(_0x4af0ee[_0x6326('0x4c')]['id']){delete _0x4af0ee[_0x6326('0x4c')]['id'];}return db[_0x6326('0x30')][_0x6326('0x4d')]({'where':{'id':_0x4af0ee[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x2d82c0,null))['then'](saveUpdates(_0x4af0ee[_0x6326('0x4c')],null))[_0x6326('0x29')](respondWithResult(_0x2d82c0,null))[_0x6326('0x48')](handleError(_0x2d82c0,null));};exports[_0x6326('0x4f')]=function(_0x1b5e9a,_0x4ff8e6){return db[_0x6326('0x30')]['find']({'where':{'id':_0x1b5e9a[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x4ff8e6,null))['then'](removeEntity(_0x4ff8e6,null))[_0x6326('0x48')](handleError(_0x4ff8e6,null));};exports['getConfigurations']=function(_0xaa4c9d,_0x202fd3,_0x2ee8df){var _0x35400e={};var _0x58731d={};var _0x42c8bc;var _0xbe6b3e;return db['ZendeskAccount'][_0x6326('0x50')]({'where':{'id':_0xaa4c9d[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x202fd3,null))['then'](function(_0x2bece1){if(_0x2bece1){_0x42c8bc=_0x2bece1;_0x58731d[_0x6326('0x39')]=_['keys'](db[_0x6326('0x51')]['rawAttributes']);_0x58731d[_0x6326('0x36')]=_[_0x6326('0x35')](_0xaa4c9d[_0x6326('0x36')]);_0x58731d[_0x6326('0x37')]=_[_0x6326('0x38')](_0x58731d[_0x6326('0x39')],_0x58731d[_0x6326('0x36')]);_0x35400e['attributes']=_['intersection'](_0x58731d['model'],qs[_0x6326('0x3b')](_0xaa4c9d['query'][_0x6326('0x3b')]));_0x35400e[_0x6326('0x3a')]=_0x35400e[_0x6326('0x3a')][_0x6326('0x3c')]?_0x35400e[_0x6326('0x3a')]:_0x58731d['model'];_0x35400e[_0x6326('0x52')]=qs[_0x6326('0x3e')](_0xaa4c9d['query'][_0x6326('0x3e')]);_0x35400e[_0x6326('0x3f')]=qs[_0x6326('0x37')](_[_0x6326('0x40')](_0xaa4c9d[_0x6326('0x36')],_0x58731d[_0x6326('0x37')]));if(_0xaa4c9d[_0x6326('0x36')][_0x6326('0x41')]){_0x35400e[_0x6326('0x3f')]=_[_0x6326('0x49')](_0x35400e['where'],{'$or':_[_0x6326('0x2f')](_0x35400e[_0x6326('0x3a')],function(_0x3fc712){var _0x92f535={};_0x92f535[_0x3fc712]={'$like':'%'+_0xaa4c9d['query']['filter']+'%'};return _0x92f535;})});}_0x35400e=_[_0x6326('0x49')]({},_0x35400e,_0xaa4c9d[_0x6326('0x4a')]);return _0x42c8bc[_0x6326('0x53')](_0x35400e);}})[_0x6326('0x29')](function(_0x3ac39d){if(_0x3ac39d){_0xbe6b3e=_0x3ac39d['length'];if(!_0xaa4c9d['query'][_0x6326('0x3d')](_0x6326('0x54'))){_0x35400e[_0x6326('0x22')]=qs[_0x6326('0x22')](_0xaa4c9d['query'][_0x6326('0x22')]);_0x35400e[_0x6326('0x21')]=qs[_0x6326('0x21')](_0xaa4c9d[_0x6326('0x36')][_0x6326('0x21')]);}return _0x42c8bc[_0x6326('0x53')](_0x35400e);}})['then'](function(_0x2bc08a){if(_0x2bc08a){return _0x2bc08a?{'count':_0xbe6b3e,'rows':_0x2bc08a}:null;}})['then'](respondWithResult(_0x202fd3,null))[_0x6326('0x48')](handleError(_0x202fd3,null));};exports[_0x6326('0x55')]=function(_0x57dfde,_0x14d66c,_0x56fb58){if(_0x57dfde[_0x6326('0x4c')]['id']){delete _0x57dfde[_0x6326('0x4c')]['id'];}return db[_0x6326('0x30')][_0x6326('0x50')]({'where':{'id':_0x57dfde[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x14d66c,null))[_0x6326('0x29')](function(_0x3f5e2e){if(_0x3f5e2e){_0x57dfde['body'][_0x6326('0x56')]=_0x3f5e2e['id'];_0x57dfde[_0x6326('0x4c')][_0x6326('0x57')]=integrations[_0x6326('0x58')](_0x57dfde[_0x6326('0x4c')]['channel'],_0x57dfde[_0x6326('0x4c')][_0x6326('0x33')]);_0x57dfde[_0x6326('0x4c')][_0x6326('0x59')]=integrations[_0x6326('0x5a')](_0x57dfde['body'][_0x6326('0x5b')],_0x57dfde['body']['type']);return db[_0x6326('0x51')][_0x6326('0x4b')](_0x57dfde[_0x6326('0x4c')],{'include':[{'model':db[_0x6326('0x5c')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x14d66c,null))[_0x6326('0x48')](handleError(_0x14d66c,null));};exports['getFields']=function(_0x303fef,_0x5f6273,_0x54730e){var _0x4c1d7e='';return db['ZendeskAccount'][_0x6326('0x50')]({'where':{'id':_0x303fef['params']['id']},'attributes':['id',_0x6326('0x5d'),'password','token','authType','remoteUri']})[_0x6326('0x29')](handleEntityNotFound(_0x5f6273,null))['then'](function(_0xe2e249){if(_0xe2e249){_0x4c1d7e=_0xe2e249[_0x6326('0x5e')];var _0x50a1dc=_0x4c1d7e[_0x6326('0x5f')](-0x1);if(_0x50a1dc==='/'){_0x4c1d7e=_0x4c1d7e['substring'](0x0,_0x4c1d7e[_0x6326('0x60')](_0x50a1dc));}var _0x1dda23={'method':_0x6326('0x61'),'uri':util[_0x6326('0x62')](_0x6326('0x63'),_0x4c1d7e,_0x6326('0x64')),'json':!![]};switch(_0xe2e249[_0x6326('0x65')]){case _0x6326('0x66'):_0x1dda23[_0x6326('0x67')]={'Authorization':util[_0x6326('0x62')](_0x6326('0x68'),new Buffer(util[_0x6326('0x62')](_0x6326('0x69'),_0xe2e249[_0x6326('0x5d')],_0xe2e249[_0x6326('0x66')]))[_0x6326('0x6a')](_0x6326('0x6b')))};break;case'token':_0x1dda23['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x6326('0x62')]('%s/token:%s',_0xe2e249['username'],_0xe2e249['token']))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x6326('0x6c'))](_0x6326('0x6d'));}return rp(_0x1dda23);}})['then'](function(_0x3b4bca){if(_0x3b4bca){var _0x2bfc43=[_0x6326('0x6e'),'description',_0x6326('0x6f'),_0x6326('0x70')];_[_0x6326('0x71')](_0x3b4bca[_0x6326('0x64')],function(_0x3e9477){return _0x2bfc43['includes'](_0x3e9477[_0x6326('0x33')]);});return{'count':_0x3b4bca['ticket_fields']['length'],'rows':_[_0x6326('0x2f')](_0x3b4bca['ticket_fields'],function(_0x57c845){return{'id':_0x57c845['id'],'name':_0x57c845['position']>0x7?_0x57c845['title']:_0x57c845['type'],'custom':_0x57c845['position']>0x7?!![]:![],'options':_0x57c845['system_field_options']?_0x57c845[_0x6326('0x72')]:_0x57c845[_0x6326('0x73')]?_0x57c845[_0x6326('0x73')]:[]};})};}})[_0x6326('0x29')](respondWithResult(_0x5f6273,null))['catch'](function(_0x484866){var _0x4b61c4=_0x303fef[_0x6326('0x36')][_0x6326('0x74')]?0x1f4:_0x484866['statusCode']||0x1f4;logger[_0x6326('0x2a')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4b61c4,JSON[_0x6326('0x75')](_0x484866));delete _0x484866[_0x6326('0x2c')];if(_0x4b61c4===0x191){_0x4b61c4=0x190;}_0x5f6273[_0x6326('0x1f')](_0x4b61c4)[_0x6326('0x2d')](_0x303fef[_0x6326('0x36')][_0x6326('0x74')]?{'message':_0x6326('0x76'),'statusCode':_0x484866['statusCode']}:_0x484866);});}; \ No newline at end of file +var _0x6cb4=['getFields','username','password','token','authType','slice','substring','lastIndexOf','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','assignee','includes','position','system_field_options','custom_field_options','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','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','ZendeskAccount','include','findAll','catch','params','keys','find','create','body','getConfigurations','findOne','ZendeskConfiguration','rawAttributes','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField'];(function(_0x4cc7c9,_0xafa40a){var _0x35ea4a=function(_0x96286e){while(--_0x96286e){_0x4cc7c9['push'](_0x4cc7c9['shift']());}};_0x35ea4a(++_0xafa40a);}(_0x6cb4,0xff));var _0x46cb=function(_0x1b61e5,_0x1b1b82){_0x1b61e5=_0x1b61e5-0x0;var _0x525901=_0x6cb4[_0x1b61e5];return _0x525901;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];var integrations=require(_0x46cb('0x18'));function respondWithStatusCode(_0x1058a8,_0xf22158){_0xf22158=_0xf22158||0xcc;return function(_0x553440){if(_0x553440){return _0x1058a8[_0x46cb('0x19')](_0xf22158);}return _0x1058a8[_0x46cb('0x1a')](_0xf22158)[_0x46cb('0x1b')]();};}function respondWithResult(_0x3c0071,_0x1f7150){_0x1f7150=_0x1f7150||0xc8;return function(_0x32201f){if(_0x32201f){return _0x3c0071[_0x46cb('0x1a')](_0x1f7150)[_0x46cb('0x1c')](_0x32201f);}};}function respondWithFilteredResult(_0x37d368,_0x41e398){return function(_0x136215){if(_0x136215){var _0x5cdb4b=typeof _0x41e398[_0x46cb('0x1d')]==='undefined'&&typeof _0x41e398[_0x46cb('0x1e')]==='undefined';var _0x4e3d29=_0x136215['count'];var _0x1b6646=_0x5cdb4b?0x0:_0x41e398[_0x46cb('0x1d')];var _0x4df1f0=_0x5cdb4b?_0x136215[_0x46cb('0x1f')]:_0x41e398[_0x46cb('0x1d')]+_0x41e398[_0x46cb('0x1e')];var _0x264497;if(_0x4df1f0>=_0x4e3d29){_0x4df1f0=_0x4e3d29;_0x264497=0xc8;}else{_0x264497=0xce;}_0x37d368[_0x46cb('0x1a')](_0x264497);return _0x37d368[_0x46cb('0x20')](_0x46cb('0x21'),_0x1b6646+'-'+_0x4df1f0+'/'+_0x4e3d29)[_0x46cb('0x1c')](_0x136215);}return null;};}function patchUpdates(_0x46e541){return function(_0x21e72a){try{jsonpatch[_0x46cb('0x22')](_0x21e72a,_0x46e541,!![]);}catch(_0x188c28){return BPromise[_0x46cb('0x23')](_0x188c28);}return _0x21e72a[_0x46cb('0x24')]();};}function saveUpdates(_0x1fb467,_0x41ecd2){return function(_0xfbf576){if(_0xfbf576){return _0xfbf576[_0x46cb('0x25')](_0x1fb467)[_0x46cb('0x26')](function(_0x309e4b){return _0x309e4b;});}return null;};}function removeEntity(_0xadcad6,_0x40e0e5){return function(_0x5a1338){if(_0x5a1338){return _0x5a1338['destroy']()[_0x46cb('0x26')](function(){_0xadcad6[_0x46cb('0x1a')](0xcc)[_0x46cb('0x1b')]();});}};}function handleEntityNotFound(_0xe078a8,_0x6e6d9){return function(_0x589152){if(!_0x589152){_0xe078a8[_0x46cb('0x19')](0x194);}return _0x589152;};}function handleError(_0x578ffd,_0x495886){_0x495886=_0x495886||0x1f4;return function(_0x544465){logger[_0x46cb('0x27')](_0x544465[_0x46cb('0x28')]);if(_0x544465[_0x46cb('0x29')]){delete _0x544465[_0x46cb('0x29')];}_0x578ffd[_0x46cb('0x1a')](_0x495886)[_0x46cb('0x2a')](_0x544465);};}exports[_0x46cb('0x2b')]=function(_0x8c65b2,_0x2b846a){var _0x12e01e={},_0x4620ef={},_0x4a1517={'count':0x0,'rows':[]};var _0x1ce88f=_[_0x46cb('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x15f5cf){return{'name':_0x15f5cf['fieldName'],'type':_0x15f5cf[_0x46cb('0x2d')][_0x46cb('0x2e')]};});_0x4620ef[_0x46cb('0x2f')]=_[_0x46cb('0x2c')](_0x1ce88f,_0x46cb('0x29'));_0x4620ef[_0x46cb('0x30')]=_['keys'](_0x8c65b2[_0x46cb('0x30')]);_0x4620ef['filters']=_[_0x46cb('0x31')](_0x4620ef[_0x46cb('0x2f')],_0x4620ef['query']);_0x12e01e[_0x46cb('0x32')]=_[_0x46cb('0x31')](_0x4620ef[_0x46cb('0x2f')],qs[_0x46cb('0x33')](_0x8c65b2[_0x46cb('0x30')]['fields']));_0x12e01e[_0x46cb('0x32')]=_0x12e01e['attributes'][_0x46cb('0x34')]?_0x12e01e[_0x46cb('0x32')]:_0x4620ef[_0x46cb('0x2f')];if(!_0x8c65b2['query'][_0x46cb('0x35')](_0x46cb('0x36'))){_0x12e01e['limit']=qs[_0x46cb('0x1e')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x1e')]);_0x12e01e[_0x46cb('0x1d')]=qs[_0x46cb('0x1d')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x1d')]);}_0x12e01e[_0x46cb('0x37')]=qs[_0x46cb('0x38')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x38')]);_0x12e01e['where']=qs['filters'](_['pick'](_0x8c65b2[_0x46cb('0x30')],_0x4620ef[_0x46cb('0x39')]),_0x1ce88f);if(_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x3a')]){_0x12e01e[_0x46cb('0x3b')]=_[_0x46cb('0x3c')](_0x12e01e['where'],{'$or':_[_0x46cb('0x2c')](_0x1ce88f,function(_0x4ae944){if(_0x4ae944['type']!==_0x46cb('0x3d')){var _0x59bdb0={};_0x59bdb0[_0x4ae944['name']]={'$like':'%'+_0x8c65b2[_0x46cb('0x30')]['filter']+'%'};return _0x59bdb0;}})});}_0x12e01e=_['merge']({},_0x12e01e,_0x8c65b2[_0x46cb('0x3e')]);var _0x10017d={'where':_0x12e01e[_0x46cb('0x3b')]};return db[_0x46cb('0x3f')][_0x46cb('0x1f')](_0x10017d)[_0x46cb('0x26')](function(_0x21f9a6){_0x4a1517['count']=_0x21f9a6;if(_0x8c65b2[_0x46cb('0x30')]['includeAll']){_0x12e01e[_0x46cb('0x40')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x46cb('0x41')](_0x12e01e);})[_0x46cb('0x26')](function(_0x2445a2){_0x4a1517['rows']=_0x2445a2;return _0x4a1517;})[_0x46cb('0x26')](respondWithFilteredResult(_0x2b846a,_0x12e01e))[_0x46cb('0x42')](handleError(_0x2b846a,null));};exports['show']=function(_0x18be96,_0x3d0b83){var _0x1f67af={'raw':![],'where':{'id':_0x18be96[_0x46cb('0x43')]['id']}},_0x66e602={};_0x66e602['model']=_['keys'](db[_0x46cb('0x3f')]['rawAttributes']);_0x66e602[_0x46cb('0x30')]=_[_0x46cb('0x44')](_0x18be96['query']);_0x66e602[_0x46cb('0x39')]=_[_0x46cb('0x31')](_0x66e602[_0x46cb('0x2f')],_0x66e602['query']);_0x1f67af['attributes']=_['intersection'](_0x66e602['model'],qs[_0x46cb('0x33')](_0x18be96[_0x46cb('0x30')][_0x46cb('0x33')]));_0x1f67af[_0x46cb('0x32')]=_0x1f67af[_0x46cb('0x32')]['length']?_0x1f67af['attributes']:_0x66e602[_0x46cb('0x2f')];if(_0x18be96[_0x46cb('0x30')]['includeAll']){_0x1f67af[_0x46cb('0x40')]=[{'all':!![]}];}_0x1f67af=_[_0x46cb('0x3c')]({},_0x1f67af,_0x18be96[_0x46cb('0x3e')]);return db[_0x46cb('0x3f')][_0x46cb('0x45')](_0x1f67af)[_0x46cb('0x26')](handleEntityNotFound(_0x3d0b83,null))[_0x46cb('0x26')](respondWithResult(_0x3d0b83,null))['catch'](handleError(_0x3d0b83,null));};exports['create']=function(_0x449593,_0x52ed52){return db[_0x46cb('0x3f')][_0x46cb('0x46')](_0x449593[_0x46cb('0x47')],{})['then'](respondWithResult(_0x52ed52,0xc9))[_0x46cb('0x42')](handleError(_0x52ed52,null));};exports['update']=function(_0x5c02c9,_0x16c500){if(_0x5c02c9[_0x46cb('0x47')]['id']){delete _0x5c02c9[_0x46cb('0x47')]['id'];}return db[_0x46cb('0x3f')][_0x46cb('0x45')]({'where':{'id':_0x5c02c9[_0x46cb('0x43')]['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x16c500,null))['then'](saveUpdates(_0x5c02c9['body'],null))[_0x46cb('0x26')](respondWithResult(_0x16c500,null))[_0x46cb('0x42')](handleError(_0x16c500,null));};exports['destroy']=function(_0x34399d,_0x33ab2e){return db[_0x46cb('0x3f')][_0x46cb('0x45')]({'where':{'id':_0x34399d[_0x46cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x33ab2e,null))[_0x46cb('0x26')](removeEntity(_0x33ab2e,null))[_0x46cb('0x42')](handleError(_0x33ab2e,null));};exports[_0x46cb('0x48')]=function(_0x52d1a7,_0x1f5c71,_0x56ad38){var _0x48b994={};var _0x1e46cc={};var _0x2cfe6f;var _0x2fe0b1;return db[_0x46cb('0x3f')][_0x46cb('0x49')]({'where':{'id':_0x52d1a7['params']['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x1f5c71,null))[_0x46cb('0x26')](function(_0x5701c0){if(_0x5701c0){_0x2cfe6f=_0x5701c0;_0x1e46cc['model']=_[_0x46cb('0x44')](db[_0x46cb('0x4a')][_0x46cb('0x4b')]);_0x1e46cc['query']=_[_0x46cb('0x44')](_0x52d1a7[_0x46cb('0x30')]);_0x1e46cc[_0x46cb('0x39')]=_[_0x46cb('0x31')](_0x1e46cc[_0x46cb('0x2f')],_0x1e46cc[_0x46cb('0x30')]);_0x48b994[_0x46cb('0x32')]=_[_0x46cb('0x31')](_0x1e46cc[_0x46cb('0x2f')],qs['fields'](_0x52d1a7[_0x46cb('0x30')]['fields']));_0x48b994[_0x46cb('0x32')]=_0x48b994[_0x46cb('0x32')][_0x46cb('0x34')]?_0x48b994[_0x46cb('0x32')]:_0x1e46cc['model'];_0x48b994[_0x46cb('0x37')]=qs[_0x46cb('0x38')](_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x38')]);_0x48b994[_0x46cb('0x3b')]=qs[_0x46cb('0x39')](_[_0x46cb('0x4c')](_0x52d1a7[_0x46cb('0x30')],_0x1e46cc['filters']));if(_0x52d1a7['query']['filter']){_0x48b994['where']=_[_0x46cb('0x3c')](_0x48b994[_0x46cb('0x3b')],{'$or':_['map'](_0x48b994[_0x46cb('0x32')],function(_0xfa28a8){var _0x10c3f9={};_0x10c3f9[_0xfa28a8]={'$like':'%'+_0x52d1a7['query']['filter']+'%'};return _0x10c3f9;})});}_0x48b994=_[_0x46cb('0x3c')]({},_0x48b994,_0x52d1a7['options']);return _0x2cfe6f[_0x46cb('0x48')](_0x48b994);}})[_0x46cb('0x26')](function(_0x1eb392){if(_0x1eb392){_0x2fe0b1=_0x1eb392[_0x46cb('0x34')];if(!_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x35')](_0x46cb('0x36'))){_0x48b994[_0x46cb('0x1e')]=qs[_0x46cb('0x1e')](_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x1e')]);_0x48b994[_0x46cb('0x1d')]=qs[_0x46cb('0x1d')](_0x52d1a7['query'][_0x46cb('0x1d')]);}return _0x2cfe6f['getConfigurations'](_0x48b994);}})[_0x46cb('0x26')](function(_0x478ada){if(_0x478ada){return _0x478ada?{'count':_0x2fe0b1,'rows':_0x478ada}:null;}})[_0x46cb('0x26')](respondWithResult(_0x1f5c71,null))[_0x46cb('0x42')](handleError(_0x1f5c71,null));};exports[_0x46cb('0x4d')]=function(_0x3dc4bd,_0x656601,_0x598a41){if(_0x3dc4bd[_0x46cb('0x47')]['id']){delete _0x3dc4bd[_0x46cb('0x47')]['id'];}return db[_0x46cb('0x3f')][_0x46cb('0x49')]({'where':{'id':_0x3dc4bd['params']['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x656601,null))[_0x46cb('0x26')](function(_0x6dc790){if(_0x6dc790){_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x4e')]=_0x6dc790['id'];_0x3dc4bd['body'][_0x46cb('0x4f')]=integrations[_0x46cb('0x50')](_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x51')],_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x2d')]);_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x52')]=integrations['getDescriptions'](_0x3dc4bd['body']['channel'],_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x2d')]);return db[_0x46cb('0x4a')][_0x46cb('0x46')](_0x3dc4bd[_0x46cb('0x47')],{'include':[{'model':db[_0x46cb('0x53')],'as':_0x46cb('0x4f')},{'model':db[_0x46cb('0x53')],'as':_0x46cb('0x52')}]});}return null;})[_0x46cb('0x26')](respondWithResult(_0x656601,null))[_0x46cb('0x42')](handleError(_0x656601,null));};exports[_0x46cb('0x54')]=function(_0x140c96,_0x2ea5d0,_0x5c9f3c){var _0x2e23e4='';return db['ZendeskAccount'][_0x46cb('0x49')]({'where':{'id':_0x140c96['params']['id']},'attributes':['id',_0x46cb('0x55'),_0x46cb('0x56'),_0x46cb('0x57'),_0x46cb('0x58'),'remoteUri']})[_0x46cb('0x26')](handleEntityNotFound(_0x2ea5d0,null))[_0x46cb('0x26')](function(_0x55895a){if(_0x55895a){_0x2e23e4=_0x55895a['remoteUri'];var _0x473758=_0x2e23e4[_0x46cb('0x59')](-0x1);if(_0x473758==='/'){_0x2e23e4=_0x2e23e4[_0x46cb('0x5a')](0x0,_0x2e23e4[_0x46cb('0x5b')](_0x473758));}var _0x1ba6ae={'method':'GET','uri':util['format']('%s/%s',_0x2e23e4,_0x46cb('0x5c')),'json':!![]};switch(_0x55895a[_0x46cb('0x58')]){case _0x46cb('0x56'):_0x1ba6ae[_0x46cb('0x5d')]={'Authorization':util[_0x46cb('0x5e')](_0x46cb('0x5f'),new Buffer(util[_0x46cb('0x5e')](_0x46cb('0x60'),_0x55895a[_0x46cb('0x55')],_0x55895a[_0x46cb('0x56')]))[_0x46cb('0x61')]('base64'))};break;case _0x46cb('0x57'):_0x1ba6ae[_0x46cb('0x5d')]={'Authorization':util[_0x46cb('0x5e')](_0x46cb('0x5f'),new Buffer(util['format'](_0x46cb('0x62'),_0x55895a[_0x46cb('0x55')],_0x55895a[_0x46cb('0x57')]))[_0x46cb('0x61')]('base64'))};break;default:throw new db[(_0x46cb('0x63'))][(_0x46cb('0x64'))](_0x46cb('0x65'));}return rp(_0x1ba6ae);}})[_0x46cb('0x26')](function(_0x5eaad6){if(_0x5eaad6){var _0x5775dc=['subject',_0x46cb('0x66'),'group',_0x46cb('0x67')];_['remove'](_0x5eaad6[_0x46cb('0x5c')],function(_0x36a82b){return _0x5775dc[_0x46cb('0x68')](_0x36a82b[_0x46cb('0x2d')]);});return{'count':_0x5eaad6['ticket_fields'][_0x46cb('0x34')],'rows':_[_0x46cb('0x2c')](_0x5eaad6[_0x46cb('0x5c')],function(_0x468d1f){return{'id':_0x468d1f['id'],'name':_0x468d1f['position']>0x7?_0x468d1f['title']:_0x468d1f[_0x46cb('0x2d')],'custom':_0x468d1f[_0x46cb('0x69')]>0x7?!![]:![],'options':_0x468d1f[_0x46cb('0x6a')]?_0x468d1f[_0x46cb('0x6a')]:_0x468d1f[_0x46cb('0x6b')]?_0x468d1f[_0x46cb('0x6b')]:[]};})};}})['then'](respondWithResult(_0x2ea5d0,null))['catch'](function(_0x3089d7){var _0x53eb=_0x140c96['query'][_0x46cb('0x6c')]?0x1f4:_0x3089d7[_0x46cb('0x6d')]||0x1f4;logger[_0x46cb('0x27')](_0x46cb('0x6e'),_0x46cb('0x54'),_0x53eb,JSON[_0x46cb('0x6f')](_0x3089d7));delete _0x3089d7[_0x46cb('0x29')];if(_0x53eb===0x191){_0x53eb=0x190;}_0x2ea5d0['status'](_0x53eb)[_0x46cb('0x2a')](_0x140c96[_0x46cb('0x30')][_0x46cb('0x6c')]?{'message':_0x46cb('0x70'),'statusCode':_0x3089d7[_0x46cb('0x6d')]}:_0x3089d7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 9a5a41d..c8dd80d 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 _0x4ad0=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x2e8d8f,_0x5b6701){var _0x1d4b5b=function(_0x3dd32a){while(--_0x3dd32a){_0x2e8d8f['push'](_0x2e8d8f['shift']());}};_0x1d4b5b(++_0x5b6701);}(_0x4ad0,0xbf));var _0x04ad=function(_0x2ab3c5,_0x35a3ef){_0x2ab3c5=_0x2ab3c5-0x0;var _0x2733aa=_0x4ad0[_0x2ab3c5];return _0x2733aa;};'use strict';var _=require(_0x04ad('0x0'));var util=require(_0x04ad('0x1'));var logger=require('../../config/logger')(_0x04ad('0x2'));var moment=require('moment');var BPromise=require(_0x04ad('0x3'));var rp=require(_0x04ad('0x4'));var fs=require('fs');var path=require(_0x04ad('0x5'));var rimraf=require(_0x04ad('0x6'));var config=require(_0x04ad('0x7'));var attributes=require(_0x04ad('0x8'));var integrations=require(_0x04ad('0x9'));module['exports']=function(_0xefb4e,_0x583805){return _0xefb4e['define'](_0x04ad('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16a0=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x415264,_0x4e71cc){var _0x305b9e=function(_0x25bde5){while(--_0x25bde5){_0x415264['push'](_0x415264['shift']());}};_0x305b9e(++_0x4e71cc);}(_0x16a0,0x1c5));var _0x016a=function(_0x32f6b6,_0x3a2238){_0x32f6b6=_0x32f6b6-0x0;var _0x5c2229=_0x16a0[_0x32f6b6];return _0x5c2229;};'use strict';var _=require(_0x016a('0x0'));var util=require(_0x016a('0x1'));var logger=require('../../config/logger')(_0x016a('0x2'));var moment=require(_0x016a('0x3'));var BPromise=require(_0x016a('0x4'));var rp=require(_0x016a('0x5'));var fs=require('fs');var path=require(_0x016a('0x6'));var rimraf=require(_0x016a('0x7'));var config=require(_0x016a('0x8'));var attributes=require(_0x016a('0x9'));var integrations=require(_0x016a('0xa'));module[_0x016a('0xb')]=function(_0xb9e274,_0x51c747){return _0xb9e274[_0x016a('0xc')](_0x016a('0xd'),attributes,{'tableName':_0x016a('0xe'),'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 561acf5..dd370da 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 _0x2a5a=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZendeskAccount','findAll','options','raw','attributes','limit','map','model','include','GetZendeskAccount','find','where','ShowZendeskAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2a5a,0x1dd));var _0xa2a5=function(_0x105b82,_0x25da48){_0x105b82=_0x105b82-0x0;var _0x430076=_0x2a5a[_0x105b82];return _0x430076;};'use strict';var _=require(_0xa2a5('0x0'));var util=require(_0xa2a5('0x1'));var moment=require(_0xa2a5('0x2'));var BPromise=require('bluebird');var rs=require(_0xa2a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2a5('0x4'))['db'];var utils=require(_0xa2a5('0x5'));var logger=require(_0xa2a5('0x6'))(_0xa2a5('0x7'));var config=require(_0xa2a5('0x8'));var jayson=require(_0xa2a5('0x9'));var client=jayson[_0xa2a5('0xa')][_0xa2a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e2566,_0x3c38bc,_0x93c180){return new BPromise(function(_0x4d6449,_0x4e23d7){return client[_0xa2a5('0xc')](_0x4e2566,_0x93c180)[_0xa2a5('0xd')](function(_0x26e8a8){logger[_0xa2a5('0xe')](_0xa2a5('0xf'),_0x3c38bc,_0xa2a5('0x10'));logger[_0xa2a5('0x11')](_0xa2a5('0x12'),_0x3c38bc,_0xa2a5('0x10'),JSON[_0xa2a5('0x13')](_0x26e8a8));if(_0x26e8a8[_0xa2a5('0x14')]){if(_0x26e8a8['error'][_0xa2a5('0x15')]===0x1f4){logger[_0xa2a5('0x14')](_0xa2a5('0xf'),_0x3c38bc,_0x26e8a8[_0xa2a5('0x14')][_0xa2a5('0x16')]);return _0x4e23d7(_0x26e8a8[_0xa2a5('0x14')]['message']);}logger[_0xa2a5('0x14')](_0xa2a5('0xf'),_0x3c38bc,_0x26e8a8[_0xa2a5('0x14')][_0xa2a5('0x16')]);return _0x4d6449(_0x26e8a8['error'][_0xa2a5('0x16')]);}else{logger['info'](_0xa2a5('0xf'),_0x3c38bc,'request\x20sent');_0x4d6449(_0x26e8a8[_0xa2a5('0x17')]['message']);}})[_0xa2a5('0x18')](function(_0x344833){logger[_0xa2a5('0x14')](_0xa2a5('0xf'),_0x3c38bc,_0x344833);_0x4e23d7(_0x344833);});});}exports['GetZendeskAccount']=function(_0x57e936){var _0x44fad1=this;return new Promise(function(_0x1cc557,_0x5e1a4b){return db[_0xa2a5('0x19')][_0xa2a5('0x1a')]({'raw':_0x57e936[_0xa2a5('0x1b')]?_0x57e936[_0xa2a5('0x1b')][_0xa2a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x57e936[_0xa2a5('0x1b')]?_0x57e936[_0xa2a5('0x1b')]['where']||null:null,'attributes':_0x57e936['options']?_0x57e936[_0xa2a5('0x1b')][_0xa2a5('0x1d')]||null:null,'limit':_0x57e936[_0xa2a5('0x1b')]?_0x57e936[_0xa2a5('0x1b')][_0xa2a5('0x1e')]||null:null,'include':_0x57e936[_0xa2a5('0x1b')]?_0x57e936[_0xa2a5('0x1b')]['include']?_[_0xa2a5('0x1f')](_0x57e936['options']['include'],function(_0x51fe7c){return{'model':db[_0x51fe7c[_0xa2a5('0x20')]],'as':_0x51fe7c['as'],'attributes':_0x51fe7c['attributes'],'include':_0x51fe7c['include']?_[_0xa2a5('0x1f')](_0x51fe7c[_0xa2a5('0x21')],function(_0x33cd86){return{'model':db[_0x33cd86[_0xa2a5('0x20')]],'as':_0x33cd86['as'],'attributes':_0x33cd86[_0xa2a5('0x1d')],'include':_0x33cd86['include']?_[_0xa2a5('0x1f')](_0x33cd86[_0xa2a5('0x21')],function(_0x582ae6){return{'model':db[_0x582ae6[_0xa2a5('0x20')]],'as':_0x582ae6['as'],'attributes':_0x582ae6[_0xa2a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa2a5('0xd')](function(_0x14c3ac){logger[_0xa2a5('0xe')](_0xa2a5('0x22'),_0x57e936);logger['debug'](_0xa2a5('0x22'),_0x57e936,JSON[_0xa2a5('0x13')](_0x14c3ac));_0x1cc557(_0x14c3ac);})[_0xa2a5('0x18')](function(_0x401e2f){logger[_0xa2a5('0x14')]('GetZendeskAccount',_0x401e2f['message'],_0x57e936);_0x5e1a4b(_0x44fad1[_0xa2a5('0x14')](0x1f4,_0x401e2f['message']));});});};exports['ShowZendeskAccount']=function(_0x283cc0){var _0x57bdc3=this;return new Promise(function(_0x4daf55,_0x1a20a){return db[_0xa2a5('0x19')][_0xa2a5('0x23')]({'raw':_0x283cc0[_0xa2a5('0x1b')]?_0x283cc0[_0xa2a5('0x1b')][_0xa2a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x283cc0[_0xa2a5('0x1b')]?_0x283cc0['options'][_0xa2a5('0x24')]||null:null,'attributes':_0x283cc0[_0xa2a5('0x1b')]?_0x283cc0[_0xa2a5('0x1b')][_0xa2a5('0x1d')]||null:null,'include':_0x283cc0[_0xa2a5('0x1b')]?_0x283cc0[_0xa2a5('0x1b')][_0xa2a5('0x21')]?_['map'](_0x283cc0['options'][_0xa2a5('0x21')],function(_0x28cd36){return{'model':db[_0x28cd36['model']],'as':_0x28cd36['as'],'attributes':_0x28cd36[_0xa2a5('0x1d')],'include':_0x28cd36[_0xa2a5('0x21')]?_[_0xa2a5('0x1f')](_0x28cd36[_0xa2a5('0x21')],function(_0x39281a){return{'model':db[_0x39281a[_0xa2a5('0x20')]],'as':_0x39281a['as'],'attributes':_0x39281a[_0xa2a5('0x1d')],'include':_0x39281a[_0xa2a5('0x21')]?_[_0xa2a5('0x1f')](_0x39281a[_0xa2a5('0x21')],function(_0x5707e5){return{'model':db[_0x5707e5[_0xa2a5('0x20')]],'as':_0x5707e5['as'],'attributes':_0x5707e5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa2a5('0xd')](function(_0x18ad8a){logger[_0xa2a5('0xe')]('ShowZendeskAccount',_0x283cc0);logger['debug']('ShowZendeskAccount',_0x283cc0,JSON[_0xa2a5('0x13')](_0x18ad8a));_0x4daf55(_0x18ad8a);})[_0xa2a5('0x18')](function(_0x2cfde0){logger['error'](_0xa2a5('0x25'),_0x2cfde0[_0xa2a5('0x16')],_0x283cc0);_0x1a20a(_0x57bdc3[_0xa2a5('0x14')](0x1f4,_0x2cfde0[_0xa2a5('0x16')]));});});}; \ No newline at end of file +var _0x34c5=['options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll'];(function(_0x459025,_0x13e37f){var _0x15815e=function(_0x754c0d){while(--_0x754c0d){_0x459025['push'](_0x459025['shift']());}};_0x15815e(++_0x13e37f);}(_0x34c5,0x11b));var _0x534c=function(_0x51d0ef,_0x16d5cd){_0x51d0ef=_0x51d0ef-0x0;var _0x29815d=_0x34c5[_0x51d0ef];return _0x29815d;};'use strict';var _=require(_0x534c('0x0'));var util=require('util');var moment=require(_0x534c('0x1'));var BPromise=require('bluebird');var rs=require(_0x534c('0x2'));var fs=require('fs');var Redis=require(_0x534c('0x3'));var db=require(_0x534c('0x4'))['db'];var utils=require(_0x534c('0x5'));var logger=require(_0x534c('0x6'))('rpc');var config=require(_0x534c('0x7'));var jayson=require(_0x534c('0x8'));var client=jayson[_0x534c('0x9')][_0x534c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x418323,_0x5545fd,_0x2b91d8){return new BPromise(function(_0x214503,_0x50935d){return client[_0x534c('0xb')](_0x418323,_0x2b91d8)[_0x534c('0xc')](function(_0x2cd87e){logger[_0x534c('0xd')](_0x534c('0xe'),_0x5545fd,_0x534c('0xf'));logger[_0x534c('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x5545fd,_0x534c('0xf'),JSON[_0x534c('0x11')](_0x2cd87e));if(_0x2cd87e[_0x534c('0x12')]){if(_0x2cd87e['error'][_0x534c('0x13')]===0x1f4){logger['error'](_0x534c('0xe'),_0x5545fd,_0x2cd87e[_0x534c('0x12')]['message']);return _0x50935d(_0x2cd87e[_0x534c('0x12')][_0x534c('0x14')]);}logger[_0x534c('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x5545fd,_0x2cd87e['error'][_0x534c('0x14')]);return _0x214503(_0x2cd87e[_0x534c('0x12')][_0x534c('0x14')]);}else{logger[_0x534c('0xd')](_0x534c('0xe'),_0x5545fd,_0x534c('0xf'));_0x214503(_0x2cd87e[_0x534c('0x15')][_0x534c('0x14')]);}})['catch'](function(_0x5ce36b){logger['error'](_0x534c('0xe'),_0x5545fd,_0x5ce36b);_0x50935d(_0x5ce36b);});});}exports['GetZendeskAccount']=function(_0x162761){var _0x5b7eba=this;return new Promise(function(_0x21b132,_0x6fce5c){return db['ZendeskAccount'][_0x534c('0x16')]({'raw':_0x162761['options']?_0x162761[_0x534c('0x17')][_0x534c('0x18')]===undefined?!![]:![]:!![],'where':_0x162761[_0x534c('0x17')]?_0x162761['options'][_0x534c('0x19')]||null:null,'attributes':_0x162761['options']?_0x162761[_0x534c('0x17')][_0x534c('0x1a')]||null:null,'limit':_0x162761['options']?_0x162761[_0x534c('0x17')][_0x534c('0x1b')]||null:null,'include':_0x162761['options']?_0x162761[_0x534c('0x17')]['include']?_['map'](_0x162761[_0x534c('0x17')][_0x534c('0x1c')],function(_0x2f8725){return{'model':db[_0x2f8725['model']],'as':_0x2f8725['as'],'attributes':_0x2f8725[_0x534c('0x1a')],'include':_0x2f8725[_0x534c('0x1c')]?_[_0x534c('0x1d')](_0x2f8725[_0x534c('0x1c')],function(_0x1a2e4e){return{'model':db[_0x1a2e4e['model']],'as':_0x1a2e4e['as'],'attributes':_0x1a2e4e[_0x534c('0x1a')],'include':_0x1a2e4e[_0x534c('0x1c')]?_[_0x534c('0x1d')](_0x1a2e4e[_0x534c('0x1c')],function(_0x1be2f4){return{'model':db[_0x1be2f4[_0x534c('0x1e')]],'as':_0x1be2f4['as'],'attributes':_0x1be2f4[_0x534c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x534c('0xc')](function(_0x2e006a){logger[_0x534c('0xd')]('GetZendeskAccount',_0x162761);logger['debug']('GetZendeskAccount',_0x162761,JSON[_0x534c('0x11')](_0x2e006a));_0x21b132(_0x2e006a);})['catch'](function(_0x4c6330){logger[_0x534c('0x12')](_0x534c('0x1f'),_0x4c6330['message'],_0x162761);_0x6fce5c(_0x5b7eba[_0x534c('0x12')](0x1f4,_0x4c6330[_0x534c('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x430ca8){var _0x5856a7=this;return new Promise(function(_0x430716,_0x55fbfa){return db['ZendeskAccount']['find']({'raw':_0x430ca8[_0x534c('0x17')]?_0x430ca8['options']['raw']===undefined?!![]:![]:!![],'where':_0x430ca8[_0x534c('0x17')]?_0x430ca8[_0x534c('0x17')][_0x534c('0x19')]||null:null,'attributes':_0x430ca8[_0x534c('0x17')]?_0x430ca8[_0x534c('0x17')][_0x534c('0x1a')]||null:null,'include':_0x430ca8[_0x534c('0x17')]?_0x430ca8[_0x534c('0x17')][_0x534c('0x1c')]?_[_0x534c('0x1d')](_0x430ca8[_0x534c('0x17')][_0x534c('0x1c')],function(_0xbb2b0d){return{'model':db[_0xbb2b0d[_0x534c('0x1e')]],'as':_0xbb2b0d['as'],'attributes':_0xbb2b0d[_0x534c('0x1a')],'include':_0xbb2b0d[_0x534c('0x1c')]?_[_0x534c('0x1d')](_0xbb2b0d[_0x534c('0x1c')],function(_0x386e0d){return{'model':db[_0x386e0d[_0x534c('0x1e')]],'as':_0x386e0d['as'],'attributes':_0x386e0d[_0x534c('0x1a')],'include':_0x386e0d['include']?_[_0x534c('0x1d')](_0x386e0d[_0x534c('0x1c')],function(_0x3ec4a9){return{'model':db[_0x3ec4a9[_0x534c('0x1e')]],'as':_0x3ec4a9['as'],'attributes':_0x3ec4a9[_0x534c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x534c('0xc')](function(_0x4f6b10){logger[_0x534c('0xd')](_0x534c('0x20'),_0x430ca8);logger['debug']('ShowZendeskAccount',_0x430ca8,JSON[_0x534c('0x11')](_0x4f6b10));_0x430716(_0x4f6b10);})[_0x534c('0x21')](function(_0xd7b59){logger['error'](_0x534c('0x20'),_0xd7b59[_0x534c('0x14')],_0x430ca8);_0x55fbfa(_0x5856a7[_0x534c('0x12')](0x1f4,_0xd7b59[_0x534c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 64de376..924f557 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 _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x3a14ac,_0x55403f){var _0x5e3bc3=function(_0x11f956){while(--_0x11f956){_0x3a14ac['push'](_0x3a14ac['shift']());}};_0x5e3bc3(++_0x55403f);}(_0x4fc2,0x111));var _0x24fc=function(_0x68a64c,_0x4fa1e1){_0x68a64c=_0x68a64c-0x0;var _0x3acf1f=_0x4fc2[_0x68a64c];return _0x3acf1f;};'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')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file +var _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x8ae3e7,_0x58d8f8){var _0x395dcc=function(_0x2b084d){while(--_0x2b084d){_0x8ae3e7['push'](_0x8ae3e7['shift']());}};_0x395dcc(++_0x58d8f8);}(_0x5eb8,0xb0));var _0x85eb=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0x5eb8[_0x6978c0];return _0x361377;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 03b3304..3036655 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 _0x31ac=['sequelize','exports','STRING'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x31ac,0x1c2));var _0xc31a=function(_0xf89181,_0x2b1f87){_0xf89181=_0xf89181-0x0;var _0x4803f3=_0x31ac[_0xf89181];return _0x4803f3;};'use strict';var Sequelize=require(_0xc31a('0x0'));module[_0xc31a('0x1')]={'name':{'type':Sequelize[_0xc31a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfdbd=['exports','STRING'];(function(_0x461da3,_0x5a4717){var _0x5f3cc8=function(_0x541c97){while(--_0x541c97){_0x461da3['push'](_0x461da3['shift']());}};_0x5f3cc8(++_0x5a4717);}(_0xfdbd,0x168));var _0xdfdb=function(_0x19f8ee,_0x3e08c2){_0x19f8ee=_0x19f8ee-0x0;var _0x3b68f2=_0xfdbd[_0x19f8ee];return _0x3b68f2;};'use strict';var Sequelize=require('sequelize');module[_0xdfdb('0x0')]={'name':{'type':Sequelize[_0xdfdb('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 671a9b7..ce2fadb 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 _0xf731=['fast-json-patch','request-promise','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','length','find','catch','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','options','setTags','ids','eml-format','rimraf','zip-dir'];(function(_0x23d4bc,_0x38acb7){var _0x58121e=function(_0x395b3f){while(--_0x395b3f){_0x23d4bc['push'](_0x23d4bc['shift']());}};_0x58121e(++_0x38acb7);}(_0xf731,0xaf));var _0x1f73=function(_0x4dd6b5,_0x394768){_0x4dd6b5=_0x4dd6b5-0x0;var _0x1f16c0=_0xf731[_0x4dd6b5];return _0x1f16c0;};'use strict';var emlformat=require(_0x1f73('0x0'));var rimraf=require(_0x1f73('0x1'));var zipdir=require(_0x1f73('0x2'));var jsonpatch=require(_0x1f73('0x3'));var rp=require(_0x1f73('0x4'));var moment=require(_0x1f73('0x5'));var BPromise=require(_0x1f73('0x6'));var Mustache=require(_0x1f73('0x7'));var util=require(_0x1f73('0x8'));var path=require('path');var sox=require(_0x1f73('0x9'));var csv=require(_0x1f73('0xa'));var ejs=require(_0x1f73('0xb'));var fs=require('fs');var fs_extra=require(_0x1f73('0xc'));var _=require(_0x1f73('0xd'));var squel=require(_0x1f73('0xe'));var crypto=require(_0x1f73('0xf'));var jsforce=require(_0x1f73('0x10'));var deskjs=require(_0x1f73('0x11'));var toCsv=require(_0x1f73('0xa'));var querystring=require(_0x1f73('0x12'));var Papa=require('papaparse');var Redis=require(_0x1f73('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1f73('0x14'));var as=require(_0x1f73('0x15'));var hardwareService=require(_0x1f73('0x16'));var logger=require(_0x1f73('0x17'))(_0x1f73('0x18'));var utils=require(_0x1f73('0x19'));var config=require(_0x1f73('0x1a'));var licenseUtil=require(_0x1f73('0x1b'));var db=require(_0x1f73('0x1c'))['db'];function respondWithStatusCode(_0x1594a3,_0x2cf29b){_0x2cf29b=_0x2cf29b||0xcc;return function(_0x2d6c4d){if(_0x2d6c4d){return _0x1594a3[_0x1f73('0x1d')](_0x2cf29b);}return _0x1594a3['status'](_0x2cf29b)[_0x1f73('0x1e')]();};}function respondWithResult(_0x2e23da,_0x5676c3){_0x5676c3=_0x5676c3||0xc8;return function(_0x4e54a8){if(_0x4e54a8){return _0x2e23da['status'](_0x5676c3)[_0x1f73('0x1f')](_0x4e54a8);}};}function respondWithFilteredResult(_0x283339,_0x151d40){return function(_0x4d0522){if(_0x4d0522){var _0x203d5b=typeof _0x151d40[_0x1f73('0x20')]===_0x1f73('0x21')&&typeof _0x151d40[_0x1f73('0x22')]==='undefined';var _0x4b3edd=_0x4d0522[_0x1f73('0x23')];var _0x459659=_0x203d5b?0x0:_0x151d40[_0x1f73('0x20')];var _0x29013d=_0x203d5b?_0x4d0522['count']:_0x151d40[_0x1f73('0x20')]+_0x151d40[_0x1f73('0x22')];var _0x56831c;if(_0x29013d>=_0x4b3edd){_0x29013d=_0x4b3edd;_0x56831c=0xc8;}else{_0x56831c=0xce;}_0x283339[_0x1f73('0x24')](_0x56831c);return _0x283339[_0x1f73('0x25')](_0x1f73('0x26'),_0x459659+'-'+_0x29013d+'/'+_0x4b3edd)[_0x1f73('0x1f')](_0x4d0522);}return null;};}function patchUpdates(_0x3f0abe){return function(_0x3a5721){try{jsonpatch['apply'](_0x3a5721,_0x3f0abe,!![]);}catch(_0x883e53){return BPromise[_0x1f73('0x27')](_0x883e53);}return _0x3a5721[_0x1f73('0x28')]();};}function saveUpdates(_0x2d233b,_0x1c55b8){return function(_0x2559e0){if(_0x2559e0){return _0x2559e0[_0x1f73('0x29')](_0x2d233b)[_0x1f73('0x2a')](function(_0x1053ac){return _0x1053ac;});}return null;};}function removeEntity(_0x490b24,_0x404c3d){return function(_0x4ce036){if(_0x4ce036){return _0x4ce036['destroy']()[_0x1f73('0x2a')](function(){_0x490b24[_0x1f73('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x241cc8,_0x6c5e1e){return function(_0x2cf3cb){if(!_0x2cf3cb){_0x241cc8[_0x1f73('0x1d')](0x194);}return _0x2cf3cb;};}function handleError(_0x49e637,_0x2c6afa){_0x2c6afa=_0x2c6afa||0x1f4;return function(_0x2c0a4d){logger[_0x1f73('0x2b')](_0x2c0a4d[_0x1f73('0x2c')]);if(_0x2c0a4d[_0x1f73('0x2d')]){delete _0x2c0a4d[_0x1f73('0x2d')];}_0x49e637[_0x1f73('0x24')](_0x2c6afa)['send'](_0x2c0a4d);};}exports[_0x1f73('0x2e')]=function(_0x80ae3,_0x35b81f){var _0x4db475={},_0x30f1be={},_0x31bd9a={'count':0x0,'rows':[]};var _0x130475=_[_0x1f73('0x2f')](db[_0x1f73('0x30')][_0x1f73('0x31')],function(_0x24968d){return{'name':_0x24968d[_0x1f73('0x32')],'type':_0x24968d[_0x1f73('0x33')][_0x1f73('0x34')]};});_0x30f1be[_0x1f73('0x35')]=_[_0x1f73('0x2f')](_0x130475,_0x1f73('0x2d'));_0x30f1be[_0x1f73('0x36')]=_[_0x1f73('0x37')](_0x80ae3[_0x1f73('0x36')]);_0x30f1be[_0x1f73('0x38')]=_[_0x1f73('0x39')](_0x30f1be['model'],_0x30f1be[_0x1f73('0x36')]);_0x4db475[_0x1f73('0x3a')]=_[_0x1f73('0x39')](_0x30f1be['model'],qs[_0x1f73('0x3b')](_0x80ae3[_0x1f73('0x36')]['fields']));_0x4db475[_0x1f73('0x3a')]=_0x4db475[_0x1f73('0x3a')]['length']?_0x4db475[_0x1f73('0x3a')]:_0x30f1be[_0x1f73('0x35')];if(!_0x80ae3[_0x1f73('0x36')][_0x1f73('0x3c')](_0x1f73('0x3d'))){_0x4db475['limit']=qs[_0x1f73('0x22')](_0x80ae3[_0x1f73('0x36')][_0x1f73('0x22')]);_0x4db475[_0x1f73('0x20')]=qs[_0x1f73('0x20')](_0x80ae3[_0x1f73('0x36')][_0x1f73('0x20')]);}_0x4db475[_0x1f73('0x3e')]=qs['sort'](_0x80ae3[_0x1f73('0x36')][_0x1f73('0x3f')]);_0x4db475[_0x1f73('0x40')]=qs[_0x1f73('0x38')](_[_0x1f73('0x41')](_0x80ae3[_0x1f73('0x36')],_0x30f1be[_0x1f73('0x38')]),_0x130475);if(_0x80ae3[_0x1f73('0x36')][_0x1f73('0x42')]){_0x4db475['where']=_[_0x1f73('0x43')](_0x4db475[_0x1f73('0x40')],{'$or':_[_0x1f73('0x2f')](_0x130475,function(_0x57a2bc){if(_0x57a2bc[_0x1f73('0x33')]!==_0x1f73('0x44')){var _0x10f95e={};_0x10f95e[_0x57a2bc[_0x1f73('0x2d')]]={'$like':'%'+_0x80ae3['query'][_0x1f73('0x42')]+'%'};return _0x10f95e;}})});}_0x4db475=_[_0x1f73('0x43')]({},_0x4db475,_0x80ae3['options']);var _0x597c65={'where':_0x4db475[_0x1f73('0x40')]};return db['ZendeskConfiguration'][_0x1f73('0x23')](_0x597c65)[_0x1f73('0x2a')](function(_0x3944d6){_0x31bd9a[_0x1f73('0x23')]=_0x3944d6;if(_0x80ae3[_0x1f73('0x36')][_0x1f73('0x45')]){_0x4db475[_0x1f73('0x46')]=[{'all':!![]}];}return db[_0x1f73('0x30')][_0x1f73('0x47')](_0x4db475);})['then'](function(_0x2ece9b){_0x31bd9a['rows']=_0x2ece9b;return _0x31bd9a;})['then'](respondWithFilteredResult(_0x35b81f,_0x4db475))['catch'](handleError(_0x35b81f,null));};exports[_0x1f73('0x48')]=function(_0x74531b,_0x2fabe1){var _0xbd4c1b={'raw':![],'where':{'id':_0x74531b[_0x1f73('0x49')]['id']}},_0x481b9b={};_0x481b9b[_0x1f73('0x35')]=_[_0x1f73('0x37')](db[_0x1f73('0x30')][_0x1f73('0x31')]);_0x481b9b[_0x1f73('0x36')]=_['keys'](_0x74531b[_0x1f73('0x36')]);_0x481b9b[_0x1f73('0x38')]=_[_0x1f73('0x39')](_0x481b9b[_0x1f73('0x35')],_0x481b9b['query']);_0xbd4c1b['attributes']=_[_0x1f73('0x39')](_0x481b9b[_0x1f73('0x35')],qs[_0x1f73('0x3b')](_0x74531b['query'][_0x1f73('0x3b')]));_0xbd4c1b[_0x1f73('0x3a')]=_0xbd4c1b[_0x1f73('0x3a')][_0x1f73('0x4a')]?_0xbd4c1b[_0x1f73('0x3a')]:_0x481b9b['model'];if(_0x74531b[_0x1f73('0x36')][_0x1f73('0x45')]){_0xbd4c1b[_0x1f73('0x46')]=[{'all':!![]}];}_0xbd4c1b=_['merge']({},_0xbd4c1b,_0x74531b['options']);return db[_0x1f73('0x30')][_0x1f73('0x4b')](_0xbd4c1b)[_0x1f73('0x2a')](handleEntityNotFound(_0x2fabe1,null))['then'](respondWithResult(_0x2fabe1,null))[_0x1f73('0x4c')](handleError(_0x2fabe1,null));};exports[_0x1f73('0x4d')]=function(_0x1c8646,_0x14f5c2){return db['ZendeskConfiguration'][_0x1f73('0x4d')](_0x1c8646[_0x1f73('0x4e')],{})[_0x1f73('0x2a')](respondWithResult(_0x14f5c2,0xc9))[_0x1f73('0x4c')](handleError(_0x14f5c2,null));};exports[_0x1f73('0x29')]=function(_0x16654c,_0x4d2abc){if(_0x16654c['body']['id']){delete _0x16654c['body']['id'];}return db['ZendeskConfiguration'][_0x1f73('0x4b')]({'where':{'id':_0x16654c[_0x1f73('0x49')]['id']}})[_0x1f73('0x2a')](handleEntityNotFound(_0x4d2abc,null))[_0x1f73('0x2a')](saveUpdates(_0x16654c[_0x1f73('0x4e')],null))[_0x1f73('0x2a')](respondWithResult(_0x4d2abc,null))[_0x1f73('0x4c')](handleError(_0x4d2abc,null));};exports['destroy']=function(_0x6b0cc1,_0x3bdf28){return db[_0x1f73('0x30')][_0x1f73('0x4b')]({'where':{'id':_0x6b0cc1[_0x1f73('0x49')]['id']}})[_0x1f73('0x2a')](handleEntityNotFound(_0x3bdf28,null))[_0x1f73('0x2a')](removeEntity(_0x3bdf28,null))[_0x1f73('0x4c')](handleError(_0x3bdf28,null));};exports[_0x1f73('0x4f')]=function(_0x9cc194,_0x794e97,_0xb9f23b){var _0x4849ab={};var _0x263b88={};var _0x1732f9;var _0x477849;return db[_0x1f73('0x30')][_0x1f73('0x50')]({'where':{'id':_0x9cc194[_0x1f73('0x49')]['id']}})[_0x1f73('0x2a')](handleEntityNotFound(_0x794e97,null))['then'](function(_0xff5cbd){if(_0xff5cbd){_0x1732f9=_0xff5cbd;_0x263b88[_0x1f73('0x35')]=_['keys'](db[_0x1f73('0x51')][_0x1f73('0x31')]);_0x263b88[_0x1f73('0x36')]=_[_0x1f73('0x37')](_0x9cc194['query']);_0x263b88['filters']=_[_0x1f73('0x39')](_0x263b88['model'],_0x263b88['query']);_0x4849ab[_0x1f73('0x3a')]=_[_0x1f73('0x39')](_0x263b88['model'],qs[_0x1f73('0x3b')](_0x9cc194[_0x1f73('0x36')]['fields']));_0x4849ab['attributes']=_0x4849ab['attributes'][_0x1f73('0x4a')]?_0x4849ab[_0x1f73('0x3a')]:_0x263b88['model'];_0x4849ab[_0x1f73('0x3e')]=qs[_0x1f73('0x3f')](_0x9cc194[_0x1f73('0x36')]['sort']);_0x4849ab[_0x1f73('0x40')]=qs[_0x1f73('0x38')](_[_0x1f73('0x41')](_0x9cc194[_0x1f73('0x36')],_0x263b88[_0x1f73('0x38')]));if(_0x9cc194[_0x1f73('0x36')][_0x1f73('0x42')]){_0x4849ab[_0x1f73('0x40')]=_[_0x1f73('0x43')](_0x4849ab[_0x1f73('0x40')],{'$or':_[_0x1f73('0x2f')](_0x4849ab[_0x1f73('0x3a')],function(_0x3cd82a){var _0x2b11ca={};_0x2b11ca[_0x3cd82a]={'$like':'%'+_0x9cc194['query'][_0x1f73('0x42')]+'%'};return _0x2b11ca;})});}_0x4849ab=_[_0x1f73('0x43')]({},_0x4849ab,_0x9cc194['options']);return _0x1732f9[_0x1f73('0x4f')](_0x4849ab);}})['then'](function(_0x404af3){if(_0x404af3){_0x477849=_0x404af3[_0x1f73('0x4a')];if(!_0x9cc194['query'][_0x1f73('0x3c')](_0x1f73('0x3d'))){_0x4849ab[_0x1f73('0x22')]=qs['limit'](_0x9cc194[_0x1f73('0x36')][_0x1f73('0x22')]);_0x4849ab['offset']=qs[_0x1f73('0x20')](_0x9cc194['query']['offset']);}return _0x1732f9[_0x1f73('0x4f')](_0x4849ab);}})[_0x1f73('0x2a')](function(_0x35f6c1){if(_0x35f6c1){return _0x35f6c1?{'count':_0x477849,'rows':_0x35f6c1}:null;}})[_0x1f73('0x2a')](respondWithResult(_0x794e97,null))['catch'](handleError(_0x794e97,null));};exports[_0x1f73('0x52')]=function(_0x4502a7,_0x33827b,_0x1e7b2e){var _0x484502={};var _0x24a7c1={};var _0x2716c4;var _0x5e66cf;return db[_0x1f73('0x30')][_0x1f73('0x50')]({'where':{'id':_0x4502a7[_0x1f73('0x49')]['id']}})['then'](handleEntityNotFound(_0x33827b,null))[_0x1f73('0x2a')](function(_0x49acbe){if(_0x49acbe){_0x2716c4=_0x49acbe;_0x24a7c1[_0x1f73('0x35')]=_[_0x1f73('0x37')](db[_0x1f73('0x51')][_0x1f73('0x31')]);_0x24a7c1[_0x1f73('0x36')]=_[_0x1f73('0x37')](_0x4502a7['query']);_0x24a7c1[_0x1f73('0x38')]=_['intersection'](_0x24a7c1['model'],_0x24a7c1[_0x1f73('0x36')]);_0x484502[_0x1f73('0x3a')]=_[_0x1f73('0x39')](_0x24a7c1[_0x1f73('0x35')],qs['fields'](_0x4502a7['query'][_0x1f73('0x3b')]));_0x484502[_0x1f73('0x3a')]=_0x484502[_0x1f73('0x3a')][_0x1f73('0x4a')]?_0x484502[_0x1f73('0x3a')]:_0x24a7c1[_0x1f73('0x35')];_0x484502[_0x1f73('0x3e')]=qs[_0x1f73('0x3f')](_0x4502a7[_0x1f73('0x36')][_0x1f73('0x3f')]);_0x484502[_0x1f73('0x40')]=qs[_0x1f73('0x38')](_[_0x1f73('0x41')](_0x4502a7[_0x1f73('0x36')],_0x24a7c1['filters']));if(_0x4502a7['query'][_0x1f73('0x42')]){_0x484502[_0x1f73('0x40')]=_[_0x1f73('0x43')](_0x484502[_0x1f73('0x40')],{'$or':_[_0x1f73('0x2f')](_0x484502[_0x1f73('0x3a')],function(_0xbe3cae){var _0x2c93f1={};_0x2c93f1[_0xbe3cae]={'$like':'%'+_0x4502a7[_0x1f73('0x36')][_0x1f73('0x42')]+'%'};return _0x2c93f1;})});}_0x484502=_[_0x1f73('0x43')]({},_0x484502,_0x4502a7['options']);return _0x2716c4[_0x1f73('0x52')](_0x484502);}})[_0x1f73('0x2a')](function(_0x408fa1){if(_0x408fa1){_0x5e66cf=_0x408fa1['length'];if(!_0x4502a7[_0x1f73('0x36')][_0x1f73('0x3c')](_0x1f73('0x3d'))){_0x484502[_0x1f73('0x22')]=qs[_0x1f73('0x22')](_0x4502a7[_0x1f73('0x36')][_0x1f73('0x22')]);_0x484502['offset']=qs['offset'](_0x4502a7[_0x1f73('0x36')][_0x1f73('0x20')]);}return _0x2716c4[_0x1f73('0x52')](_0x484502);}})['then'](function(_0x1f7ae9){if(_0x1f7ae9){return _0x1f7ae9?{'count':_0x5e66cf,'rows':_0x1f7ae9}:null;}})[_0x1f73('0x2a')](respondWithResult(_0x33827b,null))[_0x1f73('0x4c')](handleError(_0x33827b,null));};exports[_0x1f73('0x53')]=function(_0x19aa8a,_0x148e84,_0x173d6c){var _0x571fbe={};var _0x3a8e9c={};var _0x109103;var _0x2e9d65;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x19aa8a['params']['id']}})['then'](handleEntityNotFound(_0x148e84,null))[_0x1f73('0x2a')](function(_0x56f2db){if(_0x56f2db){_0x109103=_0x56f2db;_0x3a8e9c[_0x1f73('0x35')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x3a8e9c[_0x1f73('0x36')]=_['keys'](_0x19aa8a[_0x1f73('0x36')]);_0x3a8e9c[_0x1f73('0x38')]=_[_0x1f73('0x39')](_0x3a8e9c['model'],_0x3a8e9c[_0x1f73('0x36')]);_0x571fbe[_0x1f73('0x3a')]=_[_0x1f73('0x39')](_0x3a8e9c[_0x1f73('0x35')],qs[_0x1f73('0x3b')](_0x19aa8a[_0x1f73('0x36')][_0x1f73('0x3b')]));_0x571fbe[_0x1f73('0x3a')]=_0x571fbe[_0x1f73('0x3a')][_0x1f73('0x4a')]?_0x571fbe['attributes']:_0x3a8e9c[_0x1f73('0x35')];_0x571fbe[_0x1f73('0x3e')]=qs['sort'](_0x19aa8a[_0x1f73('0x36')][_0x1f73('0x3f')]);_0x571fbe[_0x1f73('0x40')]=qs[_0x1f73('0x38')](_[_0x1f73('0x41')](_0x19aa8a['query'],_0x3a8e9c['filters']));if(_0x19aa8a[_0x1f73('0x36')]['filter']){_0x571fbe[_0x1f73('0x40')]=_[_0x1f73('0x43')](_0x571fbe[_0x1f73('0x40')],{'$or':_[_0x1f73('0x2f')](_0x571fbe[_0x1f73('0x3a')],function(_0x47d14d){var _0x2a3c3f={};_0x2a3c3f[_0x47d14d]={'$like':'%'+_0x19aa8a['query']['filter']+'%'};return _0x2a3c3f;})});}_0x571fbe=_['merge']({},_0x571fbe,_0x19aa8a['options']);return _0x109103[_0x1f73('0x53')](_0x571fbe);}})[_0x1f73('0x2a')](function(_0x43afe2){if(_0x43afe2){_0x2e9d65=_0x43afe2[_0x1f73('0x4a')];if(!_0x19aa8a[_0x1f73('0x36')]['hasOwnProperty'](_0x1f73('0x3d'))){_0x571fbe[_0x1f73('0x22')]=qs[_0x1f73('0x22')](_0x19aa8a[_0x1f73('0x36')]['limit']);_0x571fbe[_0x1f73('0x20')]=qs['offset'](_0x19aa8a[_0x1f73('0x36')][_0x1f73('0x20')]);}return _0x109103['getDescriptions'](_0x571fbe);}})[_0x1f73('0x2a')](function(_0x2088ff){if(_0x2088ff){return _0x2088ff?{'count':_0x2e9d65,'rows':_0x2088ff}:null;}})[_0x1f73('0x2a')](respondWithResult(_0x148e84,null))[_0x1f73('0x4c')](handleError(_0x148e84,null));};exports[_0x1f73('0x54')]=function(_0xaddde4,_0x2bc0ec,_0x1d76f9){var _0x3d5714={};var _0x4b69ac={};var _0x1d312b;var _0x5c1650;return db[_0x1f73('0x30')]['findOne']({'where':{'id':_0xaddde4['params']['id']}})[_0x1f73('0x2a')](handleEntityNotFound(_0x2bc0ec,null))[_0x1f73('0x2a')](function(_0x8ea561){if(_0x8ea561){_0x1d312b=_0x8ea561;_0x4b69ac[_0x1f73('0x35')]=_[_0x1f73('0x37')](db[_0x1f73('0x55')][_0x1f73('0x31')]);_0x4b69ac[_0x1f73('0x36')]=_[_0x1f73('0x37')](_0xaddde4[_0x1f73('0x36')]);_0x4b69ac[_0x1f73('0x38')]=_[_0x1f73('0x39')](_0x4b69ac[_0x1f73('0x35')],_0x4b69ac[_0x1f73('0x36')]);_0x3d5714['attributes']=_[_0x1f73('0x39')](_0x4b69ac[_0x1f73('0x35')],qs['fields'](_0xaddde4[_0x1f73('0x36')]['fields']));_0x3d5714[_0x1f73('0x3a')]=_0x3d5714[_0x1f73('0x3a')][_0x1f73('0x4a')]?_0x3d5714[_0x1f73('0x3a')]:_0x4b69ac['model'];_0x3d5714[_0x1f73('0x3e')]=qs[_0x1f73('0x3f')](_0xaddde4[_0x1f73('0x36')]['sort']);_0x3d5714[_0x1f73('0x40')]=qs['filters'](_[_0x1f73('0x41')](_0xaddde4[_0x1f73('0x36')],_0x4b69ac['filters']));if(_0xaddde4['query'][_0x1f73('0x42')]){_0x3d5714[_0x1f73('0x40')]=_['merge'](_0x3d5714[_0x1f73('0x40')],{'$or':_[_0x1f73('0x2f')](_0x3d5714[_0x1f73('0x3a')],function(_0x47b15c){var _0x2d3dc7={};_0x2d3dc7[_0x47b15c]={'$like':'%'+_0xaddde4[_0x1f73('0x36')][_0x1f73('0x42')]+'%'};return _0x2d3dc7;})});}_0x3d5714=_[_0x1f73('0x43')]({},_0x3d5714,_0xaddde4[_0x1f73('0x56')]);return _0x1d312b[_0x1f73('0x54')](_0x3d5714);}})[_0x1f73('0x2a')](function(_0x43ba91){if(_0x43ba91){_0x5c1650=_0x43ba91[_0x1f73('0x4a')];if(!_0xaddde4[_0x1f73('0x36')][_0x1f73('0x3c')](_0x1f73('0x3d'))){_0x3d5714[_0x1f73('0x22')]=qs[_0x1f73('0x22')](_0xaddde4['query'][_0x1f73('0x22')]);_0x3d5714[_0x1f73('0x20')]=qs[_0x1f73('0x20')](_0xaddde4[_0x1f73('0x36')][_0x1f73('0x20')]);}return _0x1d312b['getTags'](_0x3d5714);}})[_0x1f73('0x2a')](function(_0x544f95){if(_0x544f95){return _0x544f95?{'count':_0x5c1650,'rows':_0x544f95}:null;}})[_0x1f73('0x2a')](respondWithResult(_0x2bc0ec,null))['catch'](handleError(_0x2bc0ec,null));};exports['setTags']=function(_0x44f693,_0x122bf3,_0x212a35){if(_0x44f693[_0x1f73('0x4e')]['id']){delete _0x44f693['body']['id'];}return db[_0x1f73('0x30')][_0x1f73('0x50')]({'where':{'id':_0x44f693['params']['id']}})[_0x1f73('0x2a')](handleEntityNotFound(_0x122bf3,null))[_0x1f73('0x2a')](function(_0x363e52){if(_0x363e52){return _0x363e52[_0x1f73('0x57')](_0x44f693[_0x1f73('0x4e')][_0x1f73('0x58')]||[]);}return null;})['then'](respondWithResult(_0x122bf3,null))['catch'](handleError(_0x122bf3,null));}; \ No newline at end of file +var _0xcb2c=['sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','map','ZendeskConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','getFields','findOne','ZendeskField','order','pick','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x239d74,_0x1bdde0){var _0x568bb6=function(_0x4bb7fb){while(--_0x4bb7fb){_0x239d74['push'](_0x239d74['shift']());}};_0x568bb6(++_0x1bdde0);}(_0xcb2c,0x8d));var _0xccb2=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xcb2c[_0x1e7b16];return _0x37fadc;};'use strict';var emlformat=require(_0xccb2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccb2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccb2('0x2'));var moment=require(_0xccb2('0x3'));var BPromise=require(_0xccb2('0x4'));var Mustache=require(_0xccb2('0x5'));var util=require(_0xccb2('0x6'));var path=require('path');var sox=require(_0xccb2('0x7'));var csv=require('to-csv');var ejs=require(_0xccb2('0x8'));var fs=require('fs');var fs_extra=require(_0xccb2('0x9'));var _=require('lodash');var squel=require(_0xccb2('0xa'));var crypto=require(_0xccb2('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xccb2('0xc'));var querystring=require('querystring');var Papa=require(_0xccb2('0xd'));var Redis=require(_0xccb2('0xe'));var authService=require(_0xccb2('0xf'));var qs=require(_0xccb2('0x10'));var as=require(_0xccb2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xccb2('0x12'))(_0xccb2('0x13'));var utils=require(_0xccb2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xccb2('0x15'));var db=require(_0xccb2('0x16'))['db'];function respondWithStatusCode(_0x353cbe,_0x9c3e94){_0x9c3e94=_0x9c3e94||0xcc;return function(_0x2870e6){if(_0x2870e6){return _0x353cbe[_0xccb2('0x17')](_0x9c3e94);}return _0x353cbe['status'](_0x9c3e94)['end']();};}function respondWithResult(_0x37fc7a,_0x57e6f1){_0x57e6f1=_0x57e6f1||0xc8;return function(_0x5a54eb){if(_0x5a54eb){return _0x37fc7a[_0xccb2('0x18')](_0x57e6f1)[_0xccb2('0x19')](_0x5a54eb);}};}function respondWithFilteredResult(_0x112188,_0x566168){return function(_0x5204da){if(_0x5204da){var _0x5ee7e4=typeof _0x566168['offset']===_0xccb2('0x1a')&&typeof _0x566168['limit']===_0xccb2('0x1a');var _0x392024=_0x5204da[_0xccb2('0x1b')];var _0xd9a4d0=_0x5ee7e4?0x0:_0x566168[_0xccb2('0x1c')];var _0x2f1fc3=_0x5ee7e4?_0x5204da[_0xccb2('0x1b')]:_0x566168[_0xccb2('0x1c')]+_0x566168[_0xccb2('0x1d')];var _0x4af5a5;if(_0x2f1fc3>=_0x392024){_0x2f1fc3=_0x392024;_0x4af5a5=0xc8;}else{_0x4af5a5=0xce;}_0x112188[_0xccb2('0x18')](_0x4af5a5);return _0x112188[_0xccb2('0x1e')]('Content-Range',_0xd9a4d0+'-'+_0x2f1fc3+'/'+_0x392024)[_0xccb2('0x19')](_0x5204da);}return null;};}function patchUpdates(_0x46a466){return function(_0xf17b4b){try{jsonpatch[_0xccb2('0x1f')](_0xf17b4b,_0x46a466,!![]);}catch(_0x10266a){return BPromise[_0xccb2('0x20')](_0x10266a);}return _0xf17b4b[_0xccb2('0x21')]();};}function saveUpdates(_0x259ef5,_0xce16cb){return function(_0x28d90f){if(_0x28d90f){return _0x28d90f[_0xccb2('0x22')](_0x259ef5)[_0xccb2('0x23')](function(_0x2aac9f){return _0x2aac9f;});}return null;};}function removeEntity(_0x2d58eb,_0x225618){return function(_0x4195c2){if(_0x4195c2){return _0x4195c2[_0xccb2('0x24')]()[_0xccb2('0x23')](function(){_0x2d58eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b15a6,_0x331fe9){return function(_0x5b51da){if(!_0x5b51da){_0x3b15a6[_0xccb2('0x17')](0x194);}return _0x5b51da;};}function handleError(_0xdab10d,_0x27f04d){_0x27f04d=_0x27f04d||0x1f4;return function(_0x5d6f33){logger[_0xccb2('0x25')](_0x5d6f33['stack']);if(_0x5d6f33[_0xccb2('0x26')]){delete _0x5d6f33['name'];}_0xdab10d[_0xccb2('0x18')](_0x27f04d)['send'](_0x5d6f33);};}exports['index']=function(_0x386d6c,_0x503287){var _0x3a88e4={},_0x5b77cc={},_0x26bcf2={'count':0x0,'rows':[]};var _0x37519f=_[_0xccb2('0x27')](db[_0xccb2('0x28')]['rawAttributes'],function(_0x358862){return{'name':_0x358862[_0xccb2('0x29')],'type':_0x358862[_0xccb2('0x2a')][_0xccb2('0x2b')]};});_0x5b77cc[_0xccb2('0x2c')]=_['map'](_0x37519f,_0xccb2('0x26'));_0x5b77cc[_0xccb2('0x2d')]=_['keys'](_0x386d6c[_0xccb2('0x2d')]);_0x5b77cc[_0xccb2('0x2e')]=_[_0xccb2('0x2f')](_0x5b77cc[_0xccb2('0x2c')],_0x5b77cc[_0xccb2('0x2d')]);_0x3a88e4[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x5b77cc[_0xccb2('0x2c')],qs['fields'](_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x3a88e4[_0xccb2('0x30')]=_0x3a88e4[_0xccb2('0x30')][_0xccb2('0x32')]?_0x3a88e4[_0xccb2('0x30')]:_0x5b77cc['model'];if(!_0x386d6c['query']['hasOwnProperty'](_0xccb2('0x33'))){_0x3a88e4[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x3a88e4['offset']=qs[_0xccb2('0x1c')](_0x386d6c['query']['offset']);}_0x3a88e4['order']=qs[_0xccb2('0x34')](_0x386d6c['query']['sort']);_0x3a88e4[_0xccb2('0x35')]=qs[_0xccb2('0x2e')](_['pick'](_0x386d6c[_0xccb2('0x2d')],_0x5b77cc['filters']),_0x37519f);if(_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x36')]){_0x3a88e4[_0xccb2('0x35')]=_[_0xccb2('0x37')](_0x3a88e4['where'],{'$or':_[_0xccb2('0x27')](_0x37519f,function(_0x2cb61c){if(_0x2cb61c[_0xccb2('0x2a')]!==_0xccb2('0x38')){var _0xafa8ce={};_0xafa8ce[_0x2cb61c['name']]={'$like':'%'+_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x36')]+'%'};return _0xafa8ce;}})});}_0x3a88e4=_[_0xccb2('0x37')]({},_0x3a88e4,_0x386d6c[_0xccb2('0x39')]);var _0x50d616={'where':_0x3a88e4[_0xccb2('0x35')]};return db[_0xccb2('0x28')][_0xccb2('0x1b')](_0x50d616)[_0xccb2('0x23')](function(_0x4a6978){_0x26bcf2[_0xccb2('0x1b')]=_0x4a6978;if(_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x3a')]){_0x3a88e4[_0xccb2('0x3b')]=[{'all':!![]}];}return db[_0xccb2('0x28')][_0xccb2('0x3c')](_0x3a88e4);})[_0xccb2('0x23')](function(_0x50b9b3){_0x26bcf2[_0xccb2('0x3d')]=_0x50b9b3;return _0x26bcf2;})[_0xccb2('0x23')](respondWithFilteredResult(_0x503287,_0x3a88e4))[_0xccb2('0x3e')](handleError(_0x503287,null));};exports[_0xccb2('0x3f')]=function(_0x19090b,_0x41f5fd){var _0x2aa449={'raw':![],'where':{'id':_0x19090b[_0xccb2('0x40')]['id']}},_0x38b1b7={};_0x38b1b7[_0xccb2('0x2c')]=_[_0xccb2('0x41')](db[_0xccb2('0x28')][_0xccb2('0x42')]);_0x38b1b7[_0xccb2('0x2d')]=_['keys'](_0x19090b[_0xccb2('0x2d')]);_0x38b1b7[_0xccb2('0x2e')]=_['intersection'](_0x38b1b7['model'],_0x38b1b7[_0xccb2('0x2d')]);_0x2aa449[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x38b1b7[_0xccb2('0x2c')],qs[_0xccb2('0x31')](_0x19090b[_0xccb2('0x2d')]['fields']));_0x2aa449[_0xccb2('0x30')]=_0x2aa449['attributes'][_0xccb2('0x32')]?_0x2aa449['attributes']:_0x38b1b7[_0xccb2('0x2c')];if(_0x19090b[_0xccb2('0x2d')]['includeAll']){_0x2aa449['include']=[{'all':!![]}];}_0x2aa449=_[_0xccb2('0x37')]({},_0x2aa449,_0x19090b[_0xccb2('0x39')]);return db[_0xccb2('0x28')][_0xccb2('0x43')](_0x2aa449)['then'](handleEntityNotFound(_0x41f5fd,null))['then'](respondWithResult(_0x41f5fd,null))[_0xccb2('0x3e')](handleError(_0x41f5fd,null));};exports[_0xccb2('0x44')]=function(_0x544003,_0x585afb){return db[_0xccb2('0x28')]['create'](_0x544003['body'],{})['then'](respondWithResult(_0x585afb,0xc9))[_0xccb2('0x3e')](handleError(_0x585afb,null));};exports[_0xccb2('0x22')]=function(_0x1f1247,_0x3972ef){if(_0x1f1247['body']['id']){delete _0x1f1247[_0xccb2('0x45')]['id'];}return db[_0xccb2('0x28')]['find']({'where':{'id':_0x1f1247['params']['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x3972ef,null))[_0xccb2('0x23')](saveUpdates(_0x1f1247['body'],null))[_0xccb2('0x23')](respondWithResult(_0x3972ef,null))[_0xccb2('0x3e')](handleError(_0x3972ef,null));};exports[_0xccb2('0x24')]=function(_0x5a1fb6,_0x2dd12e){return db[_0xccb2('0x28')][_0xccb2('0x43')]({'where':{'id':_0x5a1fb6[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x2dd12e,null))[_0xccb2('0x23')](removeEntity(_0x2dd12e,null))['catch'](handleError(_0x2dd12e,null));};exports[_0xccb2('0x46')]=function(_0x232825,_0x1d3ef8,_0x256b83){var _0x17ab97={};var _0x33bc5d={};var _0x4bd5a7;var _0x4c7570;return db[_0xccb2('0x28')][_0xccb2('0x47')]({'where':{'id':_0x232825[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x1d3ef8,null))[_0xccb2('0x23')](function(_0x32eec5){if(_0x32eec5){_0x4bd5a7=_0x32eec5;_0x33bc5d[_0xccb2('0x2c')]=_['keys'](db[_0xccb2('0x48')][_0xccb2('0x42')]);_0x33bc5d['query']=_[_0xccb2('0x41')](_0x232825[_0xccb2('0x2d')]);_0x33bc5d[_0xccb2('0x2e')]=_[_0xccb2('0x2f')](_0x33bc5d[_0xccb2('0x2c')],_0x33bc5d[_0xccb2('0x2d')]);_0x17ab97[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x33bc5d[_0xccb2('0x2c')],qs[_0xccb2('0x31')](_0x232825[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x17ab97[_0xccb2('0x30')]=_0x17ab97[_0xccb2('0x30')][_0xccb2('0x32')]?_0x17ab97[_0xccb2('0x30')]:_0x33bc5d[_0xccb2('0x2c')];_0x17ab97[_0xccb2('0x49')]=qs[_0xccb2('0x34')](_0x232825[_0xccb2('0x2d')][_0xccb2('0x34')]);_0x17ab97[_0xccb2('0x35')]=qs['filters'](_[_0xccb2('0x4a')](_0x232825['query'],_0x33bc5d[_0xccb2('0x2e')]));if(_0x232825['query']['filter']){_0x17ab97[_0xccb2('0x35')]=_['merge'](_0x17ab97[_0xccb2('0x35')],{'$or':_[_0xccb2('0x27')](_0x17ab97[_0xccb2('0x30')],function(_0x9165fa){var _0x135a0a={};_0x135a0a[_0x9165fa]={'$like':'%'+_0x232825['query'][_0xccb2('0x36')]+'%'};return _0x135a0a;})});}_0x17ab97=_['merge']({},_0x17ab97,_0x232825['options']);return _0x4bd5a7[_0xccb2('0x46')](_0x17ab97);}})[_0xccb2('0x23')](function(_0x260558){if(_0x260558){_0x4c7570=_0x260558[_0xccb2('0x32')];if(!_0x232825[_0xccb2('0x2d')][_0xccb2('0x4b')](_0xccb2('0x33'))){_0x17ab97[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x232825[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x17ab97[_0xccb2('0x1c')]=qs[_0xccb2('0x1c')](_0x232825['query'][_0xccb2('0x1c')]);}return _0x4bd5a7[_0xccb2('0x46')](_0x17ab97);}})[_0xccb2('0x23')](function(_0x418563){if(_0x418563){return _0x418563?{'count':_0x4c7570,'rows':_0x418563}:null;}})[_0xccb2('0x23')](respondWithResult(_0x1d3ef8,null))[_0xccb2('0x3e')](handleError(_0x1d3ef8,null));};exports[_0xccb2('0x4c')]=function(_0x2914bd,_0xfaeb64,_0x1d54f6){var _0x3b4593={};var _0x487558={};var _0x484c25;var _0x1b7515;return db['ZendeskConfiguration'][_0xccb2('0x47')]({'where':{'id':_0x2914bd[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0xfaeb64,null))[_0xccb2('0x23')](function(_0x5cb717){if(_0x5cb717){_0x484c25=_0x5cb717;_0x487558[_0xccb2('0x2c')]=_[_0xccb2('0x41')](db[_0xccb2('0x48')][_0xccb2('0x42')]);_0x487558['query']=_['keys'](_0x2914bd[_0xccb2('0x2d')]);_0x487558[_0xccb2('0x2e')]=_['intersection'](_0x487558[_0xccb2('0x2c')],_0x487558[_0xccb2('0x2d')]);_0x3b4593[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x487558[_0xccb2('0x2c')],qs['fields'](_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x3b4593[_0xccb2('0x30')]=_0x3b4593[_0xccb2('0x30')][_0xccb2('0x32')]?_0x3b4593[_0xccb2('0x30')]:_0x487558[_0xccb2('0x2c')];_0x3b4593[_0xccb2('0x49')]=qs[_0xccb2('0x34')](_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x34')]);_0x3b4593[_0xccb2('0x35')]=qs[_0xccb2('0x2e')](_[_0xccb2('0x4a')](_0x2914bd[_0xccb2('0x2d')],_0x487558[_0xccb2('0x2e')]));if(_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x36')]){_0x3b4593[_0xccb2('0x35')]=_[_0xccb2('0x37')](_0x3b4593[_0xccb2('0x35')],{'$or':_[_0xccb2('0x27')](_0x3b4593[_0xccb2('0x30')],function(_0xcdecd5){var _0x51838f={};_0x51838f[_0xcdecd5]={'$like':'%'+_0x2914bd['query'][_0xccb2('0x36')]+'%'};return _0x51838f;})});}_0x3b4593=_[_0xccb2('0x37')]({},_0x3b4593,_0x2914bd['options']);return _0x484c25[_0xccb2('0x4c')](_0x3b4593);}})[_0xccb2('0x23')](function(_0x4a2582){if(_0x4a2582){_0x1b7515=_0x4a2582[_0xccb2('0x32')];if(!_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x4b')](_0xccb2('0x33'))){_0x3b4593[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x2914bd['query'][_0xccb2('0x1d')]);_0x3b4593[_0xccb2('0x1c')]=qs[_0xccb2('0x1c')](_0x2914bd[_0xccb2('0x2d')]['offset']);}return _0x484c25[_0xccb2('0x4c')](_0x3b4593);}})[_0xccb2('0x23')](function(_0x4a95e1){if(_0x4a95e1){return _0x4a95e1?{'count':_0x1b7515,'rows':_0x4a95e1}:null;}})[_0xccb2('0x23')](respondWithResult(_0xfaeb64,null))['catch'](handleError(_0xfaeb64,null));};exports[_0xccb2('0x4d')]=function(_0x537d8f,_0x54452e,_0x5d3fbc){var _0x482b82={};var _0x555608={};var _0x23a7ef;var _0x5da759;return db[_0xccb2('0x28')]['findOne']({'where':{'id':_0x537d8f['params']['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x54452e,null))[_0xccb2('0x23')](function(_0x528cd3){if(_0x528cd3){_0x23a7ef=_0x528cd3;_0x555608['model']=_[_0xccb2('0x41')](db[_0xccb2('0x48')][_0xccb2('0x42')]);_0x555608[_0xccb2('0x2d')]=_[_0xccb2('0x41')](_0x537d8f[_0xccb2('0x2d')]);_0x555608[_0xccb2('0x2e')]=_['intersection'](_0x555608[_0xccb2('0x2c')],_0x555608['query']);_0x482b82[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x555608['model'],qs[_0xccb2('0x31')](_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x482b82[_0xccb2('0x30')]=_0x482b82[_0xccb2('0x30')]['length']?_0x482b82[_0xccb2('0x30')]:_0x555608[_0xccb2('0x2c')];_0x482b82['order']=qs[_0xccb2('0x34')](_0x537d8f[_0xccb2('0x2d')]['sort']);_0x482b82[_0xccb2('0x35')]=qs['filters'](_[_0xccb2('0x4a')](_0x537d8f[_0xccb2('0x2d')],_0x555608[_0xccb2('0x2e')]));if(_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x36')]){_0x482b82[_0xccb2('0x35')]=_['merge'](_0x482b82[_0xccb2('0x35')],{'$or':_['map'](_0x482b82[_0xccb2('0x30')],function(_0x335efc){var _0x9d30e1={};_0x9d30e1[_0x335efc]={'$like':'%'+_0x537d8f[_0xccb2('0x2d')]['filter']+'%'};return _0x9d30e1;})});}_0x482b82=_[_0xccb2('0x37')]({},_0x482b82,_0x537d8f[_0xccb2('0x39')]);return _0x23a7ef[_0xccb2('0x4d')](_0x482b82);}})[_0xccb2('0x23')](function(_0x16169b){if(_0x16169b){_0x5da759=_0x16169b['length'];if(!_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x4b')](_0xccb2('0x33'))){_0x482b82[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x482b82[_0xccb2('0x1c')]=qs['offset'](_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x1c')]);}return _0x23a7ef[_0xccb2('0x4d')](_0x482b82);}})[_0xccb2('0x23')](function(_0x3dd5fa){if(_0x3dd5fa){return _0x3dd5fa?{'count':_0x5da759,'rows':_0x3dd5fa}:null;}})['then'](respondWithResult(_0x54452e,null))['catch'](handleError(_0x54452e,null));};exports['getTags']=function(_0x36125a,_0x5f12b9,_0x4c6866){var _0x5f111c={};var _0x16b60d={};var _0x598ea3;var _0x39b85c;return db['ZendeskConfiguration'][_0xccb2('0x47')]({'where':{'id':_0x36125a[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x5f12b9,null))[_0xccb2('0x23')](function(_0x20f30e){if(_0x20f30e){_0x598ea3=_0x20f30e;_0x16b60d[_0xccb2('0x2c')]=_['keys'](db[_0xccb2('0x4e')]['rawAttributes']);_0x16b60d[_0xccb2('0x2d')]=_[_0xccb2('0x41')](_0x36125a['query']);_0x16b60d[_0xccb2('0x2e')]=_[_0xccb2('0x2f')](_0x16b60d[_0xccb2('0x2c')],_0x16b60d[_0xccb2('0x2d')]);_0x5f111c[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x16b60d['model'],qs[_0xccb2('0x31')](_0x36125a[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x5f111c[_0xccb2('0x30')]=_0x5f111c[_0xccb2('0x30')][_0xccb2('0x32')]?_0x5f111c[_0xccb2('0x30')]:_0x16b60d[_0xccb2('0x2c')];_0x5f111c['order']=qs['sort'](_0x36125a[_0xccb2('0x2d')][_0xccb2('0x34')]);_0x5f111c[_0xccb2('0x35')]=qs[_0xccb2('0x2e')](_[_0xccb2('0x4a')](_0x36125a['query'],_0x16b60d[_0xccb2('0x2e')]));if(_0x36125a['query'][_0xccb2('0x36')]){_0x5f111c[_0xccb2('0x35')]=_[_0xccb2('0x37')](_0x5f111c[_0xccb2('0x35')],{'$or':_['map'](_0x5f111c[_0xccb2('0x30')],function(_0x3c8e1f){var _0x2bc0b7={};_0x2bc0b7[_0x3c8e1f]={'$like':'%'+_0x36125a['query'][_0xccb2('0x36')]+'%'};return _0x2bc0b7;})});}_0x5f111c=_[_0xccb2('0x37')]({},_0x5f111c,_0x36125a[_0xccb2('0x39')]);return _0x598ea3[_0xccb2('0x4f')](_0x5f111c);}})[_0xccb2('0x23')](function(_0x2b73a5){if(_0x2b73a5){_0x39b85c=_0x2b73a5['length'];if(!_0x36125a[_0xccb2('0x2d')]['hasOwnProperty'](_0xccb2('0x33'))){_0x5f111c[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x36125a[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x5f111c[_0xccb2('0x1c')]=qs[_0xccb2('0x1c')](_0x36125a['query'][_0xccb2('0x1c')]);}return _0x598ea3[_0xccb2('0x4f')](_0x5f111c);}})[_0xccb2('0x23')](function(_0x37bc0f){if(_0x37bc0f){return _0x37bc0f?{'count':_0x39b85c,'rows':_0x37bc0f}:null;}})[_0xccb2('0x23')](respondWithResult(_0x5f12b9,null))['catch'](handleError(_0x5f12b9,null));};exports[_0xccb2('0x50')]=function(_0x2924f8,_0x1509c0,_0x9280d){if(_0x2924f8[_0xccb2('0x45')]['id']){delete _0x2924f8[_0xccb2('0x45')]['id'];}return db[_0xccb2('0x28')]['findOne']({'where':{'id':_0x2924f8[_0xccb2('0x40')]['id']}})['then'](handleEntityNotFound(_0x1509c0,null))[_0xccb2('0x23')](function(_0xd7916e){if(_0xd7916e){return _0xd7916e[_0xccb2('0x50')](_0x2924f8[_0xccb2('0x45')][_0xccb2('0x51')]||[]);}return null;})['then'](respondWithResult(_0x1509c0,null))[_0xccb2('0x3e')](handleError(_0x1509c0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index f2fcc43..956fb10 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 _0x4e2e=['exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x56fe2f,_0x5321f1){_0x56fe2f=_0x56fe2f-0x0;var _0x84a4a2=_0x4e2e[_0x56fe2f];return _0x84a4a2;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3de3=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0x3de3,0x1ce));var _0x33de=function(_0x1a210e,_0x314587){_0x1a210e=_0x1a210e-0x0;var _0x1276e5=_0x3de3[_0x1a210e];return _0x1276e5;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var logger=require(_0x33de('0x1'))(_0x33de('0x2'));var moment=require('moment');var BPromise=require(_0x33de('0x3'));var rp=require(_0x33de('0x4'));var fs=require('fs');var path=require(_0x33de('0x5'));var rimraf=require(_0x33de('0x6'));var config=require('../../config/environment');var attributes=require(_0x33de('0x7'));module[_0x33de('0x8')]=function(_0x558f98,_0x142716){return _0x558f98['define'](_0x33de('0x9'),attributes,{'tableName':_0x33de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 1f56c66..e51cc96 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 _0xe555=['../../config/utils','rpc','../../config/environment','client','http','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x3dcb6c,_0x5a8145){var _0x5baa02=function(_0x5eb853){while(--_0x5eb853){_0x3dcb6c['push'](_0x3dcb6c['shift']());}};_0x5baa02(++_0x5a8145);}(_0xe555,0x150));var _0x5e55=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0xe555[_0x49e584];return _0x58b1be;};'use strict';var _=require(_0x5e55('0x0'));var util=require(_0x5e55('0x1'));var moment=require(_0x5e55('0x2'));var BPromise=require('bluebird');var rs=require(_0x5e55('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5e55('0x4'));var logger=require('../../config/logger')(_0x5e55('0x5'));var config=require(_0x5e55('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5e55('0x7')][_0x5e55('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1964cb,_0x20dead,_0x4d2473){return new BPromise(function(_0x5bec48,_0x2e08ef){return client['request'](_0x1964cb,_0x4d2473)['then'](function(_0x33bb37){logger[_0x5e55('0x9')](_0x5e55('0xa'),_0x20dead,_0x5e55('0xb'));logger[_0x5e55('0xc')](_0x5e55('0xd'),_0x20dead,'request\x20sent',JSON[_0x5e55('0xe')](_0x33bb37));if(_0x33bb37[_0x5e55('0xf')]){if(_0x33bb37['error'][_0x5e55('0x10')]===0x1f4){logger[_0x5e55('0xf')](_0x5e55('0xa'),_0x20dead,_0x33bb37[_0x5e55('0xf')][_0x5e55('0x11')]);return _0x2e08ef(_0x33bb37[_0x5e55('0xf')][_0x5e55('0x11')]);}logger[_0x5e55('0xf')](_0x5e55('0xa'),_0x20dead,_0x33bb37[_0x5e55('0xf')]['message']);return _0x5bec48(_0x33bb37[_0x5e55('0xf')]['message']);}else{logger['info'](_0x5e55('0xa'),_0x20dead,'request\x20sent');_0x5bec48(_0x33bb37[_0x5e55('0x12')][_0x5e55('0x11')]);}})[_0x5e55('0x13')](function(_0x3516af){logger[_0x5e55('0xf')](_0x5e55('0xa'),_0x20dead,_0x3516af);_0x2e08ef(_0x3516af);});});} \ No newline at end of file +var _0x91e9=['rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59a7e3,_0x109eba){var _0x5a2f16=function(_0x54fb20){while(--_0x54fb20){_0x59a7e3['push'](_0x59a7e3['shift']());}};_0x5a2f16(++_0x109eba);}(_0x91e9,0x123));var _0x991e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x91e9[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x991e('0x0'));var util=require(_0x991e('0x1'));var moment=require(_0x991e('0x2'));var BPromise=require('bluebird');var rs=require(_0x991e('0x3'));var fs=require('fs');var Redis=require(_0x991e('0x4'));var db=require(_0x991e('0x5'))['db'];var utils=require(_0x991e('0x6'));var logger=require(_0x991e('0x7'))(_0x991e('0x8'));var config=require(_0x991e('0x9'));var jayson=require(_0x991e('0xa'));var client=jayson[_0x991e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3df12b,_0x6b7455,_0x5b7e5f){return new BPromise(function(_0x140a8b,_0x1fb824){return client[_0x991e('0xc')](_0x3df12b,_0x5b7e5f)[_0x991e('0xd')](function(_0x338e25){logger[_0x991e('0xe')](_0x991e('0xf'),_0x6b7455,_0x991e('0x10'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x6b7455,'request\x20sent',JSON[_0x991e('0x11')](_0x338e25));if(_0x338e25[_0x991e('0x12')]){if(_0x338e25[_0x991e('0x12')][_0x991e('0x13')]===0x1f4){logger[_0x991e('0x12')](_0x991e('0xf'),_0x6b7455,_0x338e25[_0x991e('0x12')][_0x991e('0x14')]);return _0x1fb824(_0x338e25[_0x991e('0x12')]['message']);}logger['error'](_0x991e('0xf'),_0x6b7455,_0x338e25['error'][_0x991e('0x14')]);return _0x140a8b(_0x338e25[_0x991e('0x12')][_0x991e('0x14')]);}else{logger[_0x991e('0xe')](_0x991e('0xf'),_0x6b7455,_0x991e('0x10'));_0x140a8b(_0x338e25[_0x991e('0x15')][_0x991e('0x14')]);}})[_0x991e('0x16')](function(_0x573d4f){logger['error'](_0x991e('0xf'),_0x6b7455,_0x573d4f);_0x1fb824(_0x573d4f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 63287a7..a7c559e 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 _0x9b79=['../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x497f04,_0x614da0){var _0x1c8826=function(_0x22f6dc){while(--_0x22f6dc){_0x497f04['push'](_0x497f04['shift']());}};_0x1c8826(++_0x614da0);}(_0x9b79,0xae));var _0x99b7=function(_0x6b4e41,_0x3ed208){_0x6b4e41=_0x6b4e41-0x0;var _0x346877=_0x9b79[_0x6b4e41];return _0x346877;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x99b7('0x0'));var timeout=require(_0x99b7('0x1'));var express=require(_0x99b7('0x2'));var router=express[_0x99b7('0x3')]();var fs_extra=require(_0x99b7('0x4'));var auth=require(_0x99b7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x99b7('0x6'));var controller=require(_0x99b7('0x7'));router[_0x99b7('0x8')]('/',auth[_0x99b7('0x9')](),controller[_0x99b7('0xa')]);router[_0x99b7('0x8')](_0x99b7('0xb'),auth['isAuthenticated'](),controller[_0x99b7('0xc')]);router[_0x99b7('0xd')]('/',auth['isAuthenticated'](),controller[_0x99b7('0xe')]);router['put'](_0x99b7('0xb'),auth[_0x99b7('0x9')](),controller[_0x99b7('0xf')]);router['delete'](_0x99b7('0xb'),auth[_0x99b7('0x9')](),controller[_0x99b7('0x10')]);module[_0x99b7('0x11')]=router; \ No newline at end of file +var _0x57a2=['/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x210eec,_0x5cf9ed){var _0x20d7c3=function(_0x468268){while(--_0x468268){_0x210eec['push'](_0x210eec['shift']());}};_0x20d7c3(++_0x5cf9ed);}(_0x57a2,0x99));var _0x257a=function(_0x20e84b,_0x3d7d65){_0x20e84b=_0x20e84b-0x0;var _0x38874d=_0x57a2[_0x20e84b];return _0x38874d;};'use strict';var multer=require(_0x257a('0x0'));var util=require(_0x257a('0x1'));var path=require('path');var timeout=require(_0x257a('0x2'));var express=require(_0x257a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x257a('0x4'));var interaction=require(_0x257a('0x5'));var config=require(_0x257a('0x6'));var controller=require('./intZendeskField.controller');router[_0x257a('0x7')]('/',auth['isAuthenticated'](),controller[_0x257a('0x8')]);router[_0x257a('0x7')](_0x257a('0x9'),auth[_0x257a('0xa')](),controller[_0x257a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x257a('0xc')]);router[_0x257a('0xd')](_0x257a('0x9'),auth[_0x257a('0xa')](),controller[_0x257a('0xe')]);router[_0x257a('0xf')](_0x257a('0x9'),auth['isAuthenticated'](),controller[_0x257a('0x10')]);module[_0x257a('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 30686c1..1c95fa2 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 _0x6418=['ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x552255,_0x41d84d){var _0x2e6bdd=function(_0x258cc8){while(--_0x258cc8){_0x552255['push'](_0x552255['shift']());}};_0x2e6bdd(++_0x41d84d);}(_0x6418,0x165));var _0x8641=function(_0x665319,_0x3b1616){_0x665319=_0x665319-0x0;var _0x28a10a=_0x6418[_0x665319];return _0x28a10a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8641('0x0')](_0x8641('0x1'),_0x8641('0x2'),'customVariable',_0x8641('0x3'),_0x8641('0x4')),'defaultValue':_0x8641('0x1')},'content':{'type':Sequelize[_0x8641('0x5')]},'key':{'type':Sequelize[_0x8641('0x5')]},'keyType':{'type':Sequelize[_0x8641('0x0')](_0x8641('0x1'),_0x8641('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x8641('0x5')]},'idField':{'type':Sequelize[_0x8641('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8641('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8641('0x5')]}}; \ No newline at end of file +var _0x4a4c=['STRING','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x3f711b,_0x117e73){var _0x2f5de9=function(_0x38047f){while(--_0x38047f){_0x3f711b['push'](_0x3f711b['shift']());}};_0x2f5de9(++_0x117e73);}(_0x4a4c,0x71));var _0xc4a4=function(_0x46fff1,_0x5e2c76){_0x46fff1=_0x46fff1-0x0;var _0x98ffc4=_0x4a4c[_0x46fff1];return _0x98ffc4;};'use strict';var Sequelize=require('sequelize');module[_0xc4a4('0x0')]={'type':{'type':Sequelize[_0xc4a4('0x1')](_0xc4a4('0x2'),_0xc4a4('0x3'),_0xc4a4('0x4'),_0xc4a4('0x5'),_0xc4a4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc4a4('0x7')]},'key':{'type':Sequelize[_0xc4a4('0x7')]},'keyType':{'type':Sequelize[_0xc4a4('0x1')]('string',_0xc4a4('0x3'),_0xc4a4('0x4'))},'keyContent':{'type':Sequelize[_0xc4a4('0x7')]},'idField':{'type':Sequelize[_0xc4a4('0x7')]},'nameField':{'type':Sequelize[_0xc4a4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc4a4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a933197..eb6dc6d 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 _0x47e8=['end','error','stack','name','send','index','map','ZendeskField','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','keys','options','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x47e8,0x6e));var _0x847e=function(_0x4dcac4,_0x10e48a){_0x4dcac4=_0x4dcac4-0x0;var _0x2a238d=_0x47e8[_0x4dcac4];return _0x2a238d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x847e('0x0'));var zipdir=require(_0x847e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x847e('0x2'));var moment=require(_0x847e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x847e('0x4'));var util=require(_0x847e('0x5'));var path=require(_0x847e('0x6'));var sox=require(_0x847e('0x7'));var csv=require(_0x847e('0x8'));var ejs=require(_0x847e('0x9'));var fs=require('fs');var fs_extra=require(_0x847e('0xa'));var _=require(_0x847e('0xb'));var squel=require(_0x847e('0xc'));var crypto=require(_0x847e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x847e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x847e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x847e('0x10'));var hardwareService=require(_0x847e('0x11'));var logger=require(_0x847e('0x12'))(_0x847e('0x13'));var utils=require(_0x847e('0x14'));var config=require(_0x847e('0x15'));var licenseUtil=require(_0x847e('0x16'));var db=require(_0x847e('0x17'))['db'];function respondWithStatusCode(_0x38ac18,_0x2c9a00){_0x2c9a00=_0x2c9a00||0xcc;return function(_0x3f9880){if(_0x3f9880){return _0x38ac18[_0x847e('0x18')](_0x2c9a00);}return _0x38ac18[_0x847e('0x19')](_0x2c9a00)['end']();};}function respondWithResult(_0x15563e,_0x43b05){_0x43b05=_0x43b05||0xc8;return function(_0x43bb5d){if(_0x43bb5d){return _0x15563e['status'](_0x43b05)[_0x847e('0x1a')](_0x43bb5d);}};}function respondWithFilteredResult(_0x45d562,_0x3bc55e){return function(_0x511750){if(_0x511750){var _0xcda990=typeof _0x3bc55e[_0x847e('0x1b')]===_0x847e('0x1c')&&typeof _0x3bc55e['limit']===_0x847e('0x1c');var _0x3eb976=_0x511750[_0x847e('0x1d')];var _0xe1f148=_0xcda990?0x0:_0x3bc55e[_0x847e('0x1b')];var _0x5a1107=_0xcda990?_0x511750[_0x847e('0x1d')]:_0x3bc55e[_0x847e('0x1b')]+_0x3bc55e['limit'];var _0x315230;if(_0x5a1107>=_0x3eb976){_0x5a1107=_0x3eb976;_0x315230=0xc8;}else{_0x315230=0xce;}_0x45d562[_0x847e('0x19')](_0x315230);return _0x45d562[_0x847e('0x1e')](_0x847e('0x1f'),_0xe1f148+'-'+_0x5a1107+'/'+_0x3eb976)[_0x847e('0x1a')](_0x511750);}return null;};}function patchUpdates(_0x272356){return function(_0x157b99){try{jsonpatch['apply'](_0x157b99,_0x272356,!![]);}catch(_0x961341){return BPromise['reject'](_0x961341);}return _0x157b99[_0x847e('0x20')]();};}function saveUpdates(_0x3d252a,_0x58f78b){return function(_0x5826a2){if(_0x5826a2){return _0x5826a2[_0x847e('0x21')](_0x3d252a)[_0x847e('0x22')](function(_0x2db475){return _0x2db475;});}return null;};}function removeEntity(_0x240e05,_0x2a2ec1){return function(_0x5d707e){if(_0x5d707e){return _0x5d707e[_0x847e('0x23')]()[_0x847e('0x22')](function(){_0x240e05['status'](0xcc)[_0x847e('0x24')]();});}};}function handleEntityNotFound(_0x225f3f,_0x3ca452){return function(_0x5abe5a){if(!_0x5abe5a){_0x225f3f[_0x847e('0x18')](0x194);}return _0x5abe5a;};}function handleError(_0x3991e5,_0x1fbf70){_0x1fbf70=_0x1fbf70||0x1f4;return function(_0xd8fd15){logger[_0x847e('0x25')](_0xd8fd15[_0x847e('0x26')]);if(_0xd8fd15[_0x847e('0x27')]){delete _0xd8fd15['name'];}_0x3991e5[_0x847e('0x19')](_0x1fbf70)[_0x847e('0x28')](_0xd8fd15);};}exports[_0x847e('0x29')]=function(_0x3b2fb0,_0x32973a){var _0x55d06a={},_0x4bb4ce={},_0x34dea0={'count':0x0,'rows':[]};var _0x40470c=_[_0x847e('0x2a')](db[_0x847e('0x2b')]['rawAttributes'],function(_0x13d408){return{'name':_0x13d408[_0x847e('0x2c')],'type':_0x13d408['type'][_0x847e('0x2d')]};});_0x4bb4ce[_0x847e('0x2e')]=_[_0x847e('0x2a')](_0x40470c,'name');_0x4bb4ce[_0x847e('0x2f')]=_['keys'](_0x3b2fb0[_0x847e('0x2f')]);_0x4bb4ce[_0x847e('0x30')]=_[_0x847e('0x31')](_0x4bb4ce[_0x847e('0x2e')],_0x4bb4ce[_0x847e('0x2f')]);_0x55d06a[_0x847e('0x32')]=_[_0x847e('0x31')](_0x4bb4ce['model'],qs[_0x847e('0x33')](_0x3b2fb0['query'][_0x847e('0x33')]));_0x55d06a[_0x847e('0x32')]=_0x55d06a[_0x847e('0x32')][_0x847e('0x34')]?_0x55d06a[_0x847e('0x32')]:_0x4bb4ce[_0x847e('0x2e')];if(!_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x35')]('nolimit')){_0x55d06a[_0x847e('0x36')]=qs['limit'](_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x36')]);_0x55d06a['offset']=qs[_0x847e('0x1b')](_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x1b')]);}_0x55d06a[_0x847e('0x37')]=qs['sort'](_0x3b2fb0[_0x847e('0x2f')]['sort']);_0x55d06a[_0x847e('0x38')]=qs[_0x847e('0x30')](_[_0x847e('0x39')](_0x3b2fb0[_0x847e('0x2f')],_0x4bb4ce['filters']),_0x40470c);if(_0x3b2fb0[_0x847e('0x2f')]['filter']){_0x55d06a[_0x847e('0x38')]=_[_0x847e('0x3a')](_0x55d06a[_0x847e('0x38')],{'$or':_[_0x847e('0x2a')](_0x40470c,function(_0x3bb45c){if(_0x3bb45c[_0x847e('0x3b')]!==_0x847e('0x3c')){var _0x40c70f={};_0x40c70f[_0x3bb45c[_0x847e('0x27')]]={'$like':'%'+_0x3b2fb0['query'][_0x847e('0x3d')]+'%'};return _0x40c70f;}})});}_0x55d06a=_[_0x847e('0x3a')]({},_0x55d06a,_0x3b2fb0['options']);var _0x70d1f8={'where':_0x55d06a['where']};return db['ZendeskField'][_0x847e('0x1d')](_0x70d1f8)['then'](function(_0x1d2f36){_0x34dea0[_0x847e('0x1d')]=_0x1d2f36;if(_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x3e')]){_0x55d06a[_0x847e('0x3f')]=[{'all':!![]}];}return db[_0x847e('0x2b')]['findAll'](_0x55d06a);})[_0x847e('0x22')](function(_0x28c4bc){_0x34dea0[_0x847e('0x40')]=_0x28c4bc;return _0x34dea0;})[_0x847e('0x22')](respondWithFilteredResult(_0x32973a,_0x55d06a))[_0x847e('0x41')](handleError(_0x32973a,null));};exports[_0x847e('0x42')]=function(_0x352fc8,_0x55d26f){var _0x110fec={'raw':!![],'where':{'id':_0x352fc8['params']['id']}},_0x5da463={};_0x5da463[_0x847e('0x2e')]=_['keys'](db[_0x847e('0x2b')][_0x847e('0x43')]);_0x5da463[_0x847e('0x2f')]=_[_0x847e('0x44')](_0x352fc8[_0x847e('0x2f')]);_0x5da463[_0x847e('0x30')]=_[_0x847e('0x31')](_0x5da463[_0x847e('0x2e')],_0x5da463[_0x847e('0x2f')]);_0x110fec[_0x847e('0x32')]=_[_0x847e('0x31')](_0x5da463[_0x847e('0x2e')],qs[_0x847e('0x33')](_0x352fc8[_0x847e('0x2f')][_0x847e('0x33')]));_0x110fec[_0x847e('0x32')]=_0x110fec[_0x847e('0x32')]['length']?_0x110fec['attributes']:_0x5da463[_0x847e('0x2e')];if(_0x352fc8[_0x847e('0x2f')][_0x847e('0x3e')]){_0x110fec[_0x847e('0x3f')]=[{'all':!![]}];}_0x110fec=_['merge']({},_0x110fec,_0x352fc8[_0x847e('0x45')]);return db[_0x847e('0x2b')][_0x847e('0x46')](_0x110fec)[_0x847e('0x22')](handleEntityNotFound(_0x55d26f,null))['then'](respondWithResult(_0x55d26f,null))[_0x847e('0x41')](handleError(_0x55d26f,null));};exports['create']=function(_0x4f26ef,_0x368814){return db[_0x847e('0x2b')][_0x847e('0x47')](_0x4f26ef['body'],{})[_0x847e('0x22')](respondWithResult(_0x368814,0xc9))[_0x847e('0x41')](handleError(_0x368814,null));};exports[_0x847e('0x21')]=function(_0x3044dd,_0x47323b){if(_0x3044dd[_0x847e('0x48')]['id']){delete _0x3044dd[_0x847e('0x48')]['id'];}return db[_0x847e('0x2b')][_0x847e('0x46')]({'where':{'id':_0x3044dd['params']['id']}})['then'](handleEntityNotFound(_0x47323b,null))[_0x847e('0x22')](saveUpdates(_0x3044dd[_0x847e('0x48')],null))[_0x847e('0x22')](respondWithResult(_0x47323b,null))[_0x847e('0x41')](handleError(_0x47323b,null));};exports[_0x847e('0x23')]=function(_0x34dc67,_0x4f8d07){return db[_0x847e('0x2b')][_0x847e('0x46')]({'where':{'id':_0x34dc67['params']['id']}})['then'](handleEntityNotFound(_0x4f8d07,null))[_0x847e('0x22')](removeEntity(_0x4f8d07,null))['catch'](handleError(_0x4f8d07,null));}; \ No newline at end of file +var _0xfaba=['intersection','model','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','fields','length','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','query','filters'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xafab('0x0'));var rimraf=require(_0xafab('0x1'));var zipdir=require(_0xafab('0x2'));var jsonpatch=require(_0xafab('0x3'));var rp=require('request-promise');var moment=require(_0xafab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xafab('0x5'));var path=require('path');var sox=require(_0xafab('0x6'));var csv=require('to-csv');var ejs=require(_0xafab('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafab('0x8'));var squel=require(_0xafab('0x9'));var crypto=require('crypto');var jsforce=require(_0xafab('0xa'));var deskjs=require(_0xafab('0xb'));var toCsv=require('to-csv');var querystring=require(_0xafab('0xc'));var Papa=require(_0xafab('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafab('0xe'));var as=require(_0xafab('0xf'));var hardwareService=require(_0xafab('0x10'));var logger=require('../../config/logger')(_0xafab('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xafab('0x12'));var db=require(_0xafab('0x13'))['db'];function respondWithStatusCode(_0x3eb9e7,_0xe437ef){_0xe437ef=_0xe437ef||0xcc;return function(_0x45aa37){if(_0x45aa37){return _0x3eb9e7[_0xafab('0x14')](_0xe437ef);}return _0x3eb9e7[_0xafab('0x15')](_0xe437ef)['end']();};}function respondWithResult(_0x42c4e7,_0x300448){_0x300448=_0x300448||0xc8;return function(_0x5074a7){if(_0x5074a7){return _0x42c4e7[_0xafab('0x15')](_0x300448)[_0xafab('0x16')](_0x5074a7);}};}function respondWithFilteredResult(_0x599f2f,_0x192f1b){return function(_0x307c5e){if(_0x307c5e){var _0x5bb925=typeof _0x192f1b['offset']===_0xafab('0x17')&&typeof _0x192f1b[_0xafab('0x18')]===_0xafab('0x17');var _0x254751=_0x307c5e['count'];var _0x3b8140=_0x5bb925?0x0:_0x192f1b['offset'];var _0x38cd9a=_0x5bb925?_0x307c5e[_0xafab('0x19')]:_0x192f1b[_0xafab('0x1a')]+_0x192f1b['limit'];var _0x139ec7;if(_0x38cd9a>=_0x254751){_0x38cd9a=_0x254751;_0x139ec7=0xc8;}else{_0x139ec7=0xce;}_0x599f2f[_0xafab('0x15')](_0x139ec7);return _0x599f2f[_0xafab('0x1b')](_0xafab('0x1c'),_0x3b8140+'-'+_0x38cd9a+'/'+_0x254751)[_0xafab('0x16')](_0x307c5e);}return null;};}function patchUpdates(_0x599e54){return function(_0x4a52ac){try{jsonpatch[_0xafab('0x1d')](_0x4a52ac,_0x599e54,!![]);}catch(_0x19cfc1){return BPromise[_0xafab('0x1e')](_0x19cfc1);}return _0x4a52ac[_0xafab('0x1f')]();};}function saveUpdates(_0x4e9adb,_0x2ae5df){return function(_0x3106bf){if(_0x3106bf){return _0x3106bf[_0xafab('0x20')](_0x4e9adb)[_0xafab('0x21')](function(_0x50a3e3){return _0x50a3e3;});}return null;};}function removeEntity(_0x4049e1,_0x353a3d){return function(_0x19cf4e){if(_0x19cf4e){return _0x19cf4e['destroy']()['then'](function(){_0x4049e1[_0xafab('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233fdd,_0x95c7a7){return function(_0x3fa273){if(!_0x3fa273){_0x233fdd[_0xafab('0x14')](0x194);}return _0x3fa273;};}function handleError(_0x5b84ab,_0x4e0edd){_0x4e0edd=_0x4e0edd||0x1f4;return function(_0x3c0dbd){logger[_0xafab('0x22')](_0x3c0dbd['stack']);if(_0x3c0dbd['name']){delete _0x3c0dbd[_0xafab('0x23')];}_0x5b84ab[_0xafab('0x15')](_0x4e0edd)[_0xafab('0x24')](_0x3c0dbd);};}exports[_0xafab('0x25')]=function(_0x531b36,_0x47ec50){var _0x3ab4c8={},_0x4554ec={},_0x30ea5e={'count':0x0,'rows':[]};var _0x1908d4=_[_0xafab('0x26')](db[_0xafab('0x27')][_0xafab('0x28')],function(_0x525762){return{'name':_0x525762[_0xafab('0x29')],'type':_0x525762['type'][_0xafab('0x2a')]};});_0x4554ec['model']=_[_0xafab('0x26')](_0x1908d4,_0xafab('0x23'));_0x4554ec[_0xafab('0x2b')]=_['keys'](_0x531b36[_0xafab('0x2b')]);_0x4554ec[_0xafab('0x2c')]=_[_0xafab('0x2d')](_0x4554ec[_0xafab('0x2e')],_0x4554ec[_0xafab('0x2b')]);_0x3ab4c8[_0xafab('0x2f')]=_[_0xafab('0x2d')](_0x4554ec['model'],qs['fields'](_0x531b36['query']['fields']));_0x3ab4c8[_0xafab('0x2f')]=_0x3ab4c8[_0xafab('0x2f')]['length']?_0x3ab4c8[_0xafab('0x2f')]:_0x4554ec[_0xafab('0x2e')];if(!_0x531b36[_0xafab('0x2b')][_0xafab('0x30')](_0xafab('0x31'))){_0x3ab4c8[_0xafab('0x18')]=qs[_0xafab('0x18')](_0x531b36[_0xafab('0x2b')][_0xafab('0x18')]);_0x3ab4c8['offset']=qs['offset'](_0x531b36[_0xafab('0x2b')][_0xafab('0x1a')]);}_0x3ab4c8[_0xafab('0x32')]=qs[_0xafab('0x33')](_0x531b36['query'][_0xafab('0x33')]);_0x3ab4c8['where']=qs[_0xafab('0x2c')](_[_0xafab('0x34')](_0x531b36[_0xafab('0x2b')],_0x4554ec[_0xafab('0x2c')]),_0x1908d4);if(_0x531b36[_0xafab('0x2b')][_0xafab('0x35')]){_0x3ab4c8['where']=_[_0xafab('0x36')](_0x3ab4c8['where'],{'$or':_[_0xafab('0x26')](_0x1908d4,function(_0x51fd4c){if(_0x51fd4c['type']!==_0xafab('0x37')){var _0xf52de={};_0xf52de[_0x51fd4c['name']]={'$like':'%'+_0x531b36[_0xafab('0x2b')][_0xafab('0x35')]+'%'};return _0xf52de;}})});}_0x3ab4c8=_[_0xafab('0x36')]({},_0x3ab4c8,_0x531b36[_0xafab('0x38')]);var _0x1bece9={'where':_0x3ab4c8['where']};return db['ZendeskField'][_0xafab('0x19')](_0x1bece9)[_0xafab('0x21')](function(_0x119aac){_0x30ea5e[_0xafab('0x19')]=_0x119aac;if(_0x531b36[_0xafab('0x2b')]['includeAll']){_0x3ab4c8[_0xafab('0x39')]=[{'all':!![]}];}return db[_0xafab('0x27')][_0xafab('0x3a')](_0x3ab4c8);})[_0xafab('0x21')](function(_0x30dc8c){_0x30ea5e['rows']=_0x30dc8c;return _0x30ea5e;})[_0xafab('0x21')](respondWithFilteredResult(_0x47ec50,_0x3ab4c8))[_0xafab('0x3b')](handleError(_0x47ec50,null));};exports[_0xafab('0x3c')]=function(_0x595a1b,_0x5b09c6){var _0x3f1631={'raw':!![],'where':{'id':_0x595a1b['params']['id']}},_0x57cebb={};_0x57cebb[_0xafab('0x2e')]=_[_0xafab('0x3d')](db[_0xafab('0x27')][_0xafab('0x28')]);_0x57cebb[_0xafab('0x2b')]=_[_0xafab('0x3d')](_0x595a1b[_0xafab('0x2b')]);_0x57cebb[_0xafab('0x2c')]=_[_0xafab('0x2d')](_0x57cebb[_0xafab('0x2e')],_0x57cebb[_0xafab('0x2b')]);_0x3f1631[_0xafab('0x2f')]=_['intersection'](_0x57cebb[_0xafab('0x2e')],qs[_0xafab('0x3e')](_0x595a1b['query'][_0xafab('0x3e')]));_0x3f1631[_0xafab('0x2f')]=_0x3f1631[_0xafab('0x2f')][_0xafab('0x3f')]?_0x3f1631[_0xafab('0x2f')]:_0x57cebb['model'];if(_0x595a1b[_0xafab('0x2b')]['includeAll']){_0x3f1631[_0xafab('0x39')]=[{'all':!![]}];}_0x3f1631=_[_0xafab('0x36')]({},_0x3f1631,_0x595a1b[_0xafab('0x38')]);return db[_0xafab('0x27')][_0xafab('0x40')](_0x3f1631)[_0xafab('0x21')](handleEntityNotFound(_0x5b09c6,null))[_0xafab('0x21')](respondWithResult(_0x5b09c6,null))[_0xafab('0x3b')](handleError(_0x5b09c6,null));};exports[_0xafab('0x41')]=function(_0x1ee8d9,_0x1d518e){return db['ZendeskField'][_0xafab('0x41')](_0x1ee8d9['body'],{})[_0xafab('0x21')](respondWithResult(_0x1d518e,0xc9))[_0xafab('0x3b')](handleError(_0x1d518e,null));};exports['update']=function(_0x47856a,_0x5ae92e){if(_0x47856a[_0xafab('0x42')]['id']){delete _0x47856a['body']['id'];}return db['ZendeskField'][_0xafab('0x40')]({'where':{'id':_0x47856a[_0xafab('0x43')]['id']}})[_0xafab('0x21')](handleEntityNotFound(_0x5ae92e,null))[_0xafab('0x21')](saveUpdates(_0x47856a[_0xafab('0x42')],null))[_0xafab('0x21')](respondWithResult(_0x5ae92e,null))[_0xafab('0x3b')](handleError(_0x5ae92e,null));};exports[_0xafab('0x44')]=function(_0x5d021a,_0x5ea623){return db[_0xafab('0x27')]['find']({'where':{'id':_0x5d021a[_0xafab('0x43')]['id']}})[_0xafab('0x21')](handleEntityNotFound(_0x5ea623,null))[_0xafab('0x21')](removeEntity(_0x5ea623,null))[_0xafab('0x3b')](handleError(_0x5ea623,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 07cc9a8..20ad4e6 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 _0xe899=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe899,0x174));var _0x9e89=function(_0x58ceb9,_0x5601df){_0x58ceb9=_0x58ceb9-0x0;var _0x3d0ff5=_0xe899[_0x58ceb9];return _0x3d0ff5;};'use strict';var _=require(_0x9e89('0x0'));var util=require(_0x9e89('0x1'));var logger=require(_0x9e89('0x2'))(_0x9e89('0x3'));var moment=require(_0x9e89('0x4'));var BPromise=require(_0x9e89('0x5'));var rp=require(_0x9e89('0x6'));var fs=require('fs');var path=require(_0x9e89('0x7'));var rimraf=require(_0x9e89('0x8'));var config=require(_0x9e89('0x9'));var attributes=require(_0x9e89('0xa'));module[_0x9e89('0xb')]=function(_0x1a5e02,_0xcf568a){return _0x1a5e02['define'](_0x9e89('0xc'),attributes,{'tableName':_0x9e89('0xd'),'paranoid':![],'indexes':[{'name':_0x9e89('0xe'),'fields':[_0x9e89('0xf'),_0x9e89('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x885f=['exports','define','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes'];(function(_0x31d0ae,_0x2175a9){var _0x4a9217=function(_0x464f76){while(--_0x464f76){_0x31d0ae['push'](_0x31d0ae['shift']());}};_0x4a9217(++_0x2175a9);}(_0x885f,0x14f));var _0xf885=function(_0x4892b5,_0x92937){_0x4892b5=_0x4892b5-0x0;var _0x109cb4=_0x885f[_0x4892b5];return _0x109cb4;};'use strict';var _=require(_0xf885('0x0'));var util=require(_0xf885('0x1'));var logger=require(_0xf885('0x2'))(_0xf885('0x3'));var moment=require(_0xf885('0x4'));var BPromise=require(_0xf885('0x5'));var rp=require(_0xf885('0x6'));var fs=require('fs');var path=require(_0xf885('0x7'));var rimraf=require('rimraf');var config=require(_0xf885('0x8'));var attributes=require(_0xf885('0x9'));module[_0xf885('0xa')]=function(_0x4eaff7,_0x4801ee){return _0x4eaff7[_0xf885('0xb')]('ZendeskField',attributes,{'tableName':_0xf885('0xc'),'paranoid':![],'indexes':[{'name':_0xf885('0xd'),'fields':[_0xf885('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 67bf4d8..7c87e6d 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 _0xa4a3=['http','then','request\x20sent','debug','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','info','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xa4a3,0x9b));var _0x3a4a=function(_0x4808e0,_0x46806c){_0x4808e0=_0x4808e0-0x0;var _0x16d12a=_0xa4a3[_0x4808e0];return _0x16d12a;};'use strict';var _=require(_0x3a4a('0x0'));var util=require(_0x3a4a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a4a('0x2'));var fs=require('fs');var Redis=require(_0x3a4a('0x3'));var db=require(_0x3a4a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a4a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a4a('0x6'));var client=jayson['client'][_0x3a4a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x439991,_0x47a2e7,_0x34d98c){return new BPromise(function(_0x33581c,_0x291a58){return client['request'](_0x439991,_0x34d98c)[_0x3a4a('0x8')](function(_0x3b40ab){logger['info']('ZendeskField,\x20%s,\x20%s',_0x47a2e7,_0x3a4a('0x9'));logger[_0x3a4a('0xa')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x47a2e7,'request\x20sent',JSON[_0x3a4a('0xb')](_0x3b40ab));if(_0x3b40ab[_0x3a4a('0xc')]){if(_0x3b40ab[_0x3a4a('0xc')][_0x3a4a('0xd')]===0x1f4){logger[_0x3a4a('0xc')]('ZendeskField,\x20%s,\x20%s',_0x47a2e7,_0x3b40ab[_0x3a4a('0xc')][_0x3a4a('0xe')]);return _0x291a58(_0x3b40ab[_0x3a4a('0xc')][_0x3a4a('0xe')]);}logger[_0x3a4a('0xc')](_0x3a4a('0xf'),_0x47a2e7,_0x3b40ab[_0x3a4a('0xc')][_0x3a4a('0xe')]);return _0x33581c(_0x3b40ab[_0x3a4a('0xc')][_0x3a4a('0xe')]);}else{logger[_0x3a4a('0x10')](_0x3a4a('0xf'),_0x47a2e7,'request\x20sent');_0x33581c(_0x3b40ab['result'][_0x3a4a('0xe')]);}})[_0x3a4a('0x11')](function(_0x2d661e){logger[_0x3a4a('0xc')](_0x3a4a('0xf'),_0x47a2e7,_0x2d661e);_0x291a58(_0x2d661e);});});} \ No newline at end of file +var _0x75eb=['stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56fcd9,_0x15dea6){var _0x954ad9=function(_0x2b3d48){while(--_0x2b3d48){_0x56fcd9['push'](_0x56fcd9['shift']());}};_0x954ad9(++_0x15dea6);}(_0x75eb,0x1ba));var _0xb75e=function(_0x1bfc3f,_0x12c107){_0x1bfc3f=_0x1bfc3f-0x0;var _0x3c6b4d=_0x75eb[_0x1bfc3f];return _0x3c6b4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb75e('0x0'));var BPromise=require(_0xb75e('0x1'));var rs=require(_0xb75e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb75e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb75e('0x4'))(_0xb75e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb75e('0x6')][_0xb75e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x180875,_0x47926c,_0x1be572){return new BPromise(function(_0xad80ff,_0x1670fb){return client[_0xb75e('0x8')](_0x180875,_0x1be572)[_0xb75e('0x9')](function(_0x546ecb){logger[_0xb75e('0xa')](_0xb75e('0xb'),_0x47926c,_0xb75e('0xc'));logger[_0xb75e('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x47926c,_0xb75e('0xc'),JSON[_0xb75e('0xe')](_0x546ecb));if(_0x546ecb['error']){if(_0x546ecb[_0xb75e('0xf')]['code']===0x1f4){logger[_0xb75e('0xf')]('ZendeskField,\x20%s,\x20%s',_0x47926c,_0x546ecb[_0xb75e('0xf')][_0xb75e('0x10')]);return _0x1670fb(_0x546ecb['error']['message']);}logger['error'](_0xb75e('0xb'),_0x47926c,_0x546ecb[_0xb75e('0xf')][_0xb75e('0x10')]);return _0xad80ff(_0x546ecb[_0xb75e('0xf')][_0xb75e('0x10')]);}else{logger[_0xb75e('0xa')]('ZendeskField,\x20%s,\x20%s',_0x47926c,_0xb75e('0xc'));_0xad80ff(_0x546ecb[_0xb75e('0x11')]['message']);}})[_0xb75e('0x12')](function(_0x237df6){logger[_0xb75e('0xf')](_0xb75e('0xb'),_0x47926c,_0x237df6);_0x1670fb(_0x237df6);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c816cd8..71f0d3b 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 _0x807b=['addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','/:id/configurations'];(function(_0x134aba,_0x3fb04e){var _0x1d3545=function(_0x152a40){while(--_0x152a40){_0x134aba['push'](_0x134aba['shift']());}};_0x1d3545(++_0x3fb04e);}(_0x807b,0x1bc));var _0xb807=function(_0xd14bb1,_0x1ed15b){_0xd14bb1=_0xd14bb1-0x0;var _0x11c5b6=_0x807b[_0xd14bb1];return _0x11c5b6;};'use strict';var multer=require(_0xb807('0x0'));var util=require(_0xb807('0x1'));var path=require(_0xb807('0x2'));var timeout=require(_0xb807('0x3'));var express=require(_0xb807('0x4'));var router=express[_0xb807('0x5')]();var fs_extra=require(_0xb807('0x6'));var auth=require(_0xb807('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb807('0x8'));router[_0xb807('0x9')]('/',auth[_0xb807('0xa')](),controller[_0xb807('0xb')]);router[_0xb807('0x9')](_0xb807('0xc'),auth['isAuthenticated'](),controller[_0xb807('0xd')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb807('0x9')](_0xb807('0xe'),auth[_0xb807('0xa')](),controller[_0xb807('0xf')]);router['post']('/',auth[_0xb807('0xa')](),controller['create']);router[_0xb807('0x10')](_0xb807('0x11'),auth['isAuthenticated'](),controller[_0xb807('0x12')]);router['put'](_0xb807('0xc'),auth[_0xb807('0xa')](),controller[_0xb807('0x13')]);router[_0xb807('0x14')](_0xb807('0xc'),auth[_0xb807('0xa')](),controller['destroy']);module[_0xb807('0x15')]=router; \ No newline at end of file +var _0xc485=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x5aeeae,_0x2c6f39){var _0x2844d2=function(_0x2cd804){while(--_0x2cd804){_0x5aeeae['push'](_0x5aeeae['shift']());}};_0x2844d2(++_0x2c6f39);}(_0xc485,0x105));var _0x5c48=function(_0x15f724,_0x2794ef){_0x15f724=_0x15f724-0x0;var _0x49b152=_0xc485[_0x15f724];return _0x49b152;};'use strict';var multer=require(_0x5c48('0x0'));var util=require(_0x5c48('0x1'));var path=require(_0x5c48('0x2'));var timeout=require(_0x5c48('0x3'));var express=require(_0x5c48('0x4'));var router=express[_0x5c48('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5c48('0x6'));var interaction=require(_0x5c48('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x5c48('0x8')](),controller['index']);router['get']('/:id',auth[_0x5c48('0x8')](),controller[_0x5c48('0x9')]);router['get'](_0x5c48('0xa'),auth[_0x5c48('0x8')](),controller[_0x5c48('0xb')]);router['get'](_0x5c48('0xc'),auth[_0x5c48('0x8')](),controller[_0x5c48('0xd')]);router[_0x5c48('0xe')]('/',auth[_0x5c48('0x8')](),controller[_0x5c48('0xf')]);router['post']('/:id/configurations',auth[_0x5c48('0x8')](),controller[_0x5c48('0x10')]);router[_0x5c48('0x11')](_0x5c48('0x12'),auth[_0x5c48('0x8')](),controller[_0x5c48('0x13')]);router['delete']('/:id',auth[_0x5c48('0x8')](),controller[_0x5c48('0x14')]);module[_0x5c48('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 5ac52bd..15cec15 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 _0xa75b=['sequelize','STRING'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xa75b,0x170));var _0xba75=function(_0x10f49f,_0x49a542){_0x10f49f=_0x10f49f-0x0;var _0x54505d=_0xa75b[_0x10f49f];return _0x54505d;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba75('0x1')]},'host':{'type':Sequelize[_0xba75('0x1')]},'zone':{'type':Sequelize[_0xba75('0x1')]},'clientId':{'type':Sequelize[_0xba75('0x1')]},'clientSecret':{'type':Sequelize[_0xba75('0x1')]},'serverUrl':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xba75('0x1')]},'refreshToken':{'type':Sequelize[_0xba75('0x1')]}}; \ No newline at end of file +var _0x2dae=['STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2dae,0xc3));var _0xe2da=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x2dae[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2da('0x1')]},'description':{'type':Sequelize[_0xe2da('0x1')]},'host':{'type':Sequelize[_0xe2da('0x1')]},'zone':{'type':Sequelize[_0xe2da('0x1')]},'clientId':{'type':Sequelize[_0xe2da('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe2da('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe2da('0x1')]},'refreshToken':{'type':Sequelize[_0xe2da('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 616e87c..438e777 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 _0xb036=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find','create','body','findOne','pick','getConfigurations','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','getFields','host','clientId','serverUrl','code','zoho.eu','com','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','statusCode','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x118844,_0x4b4b88){var _0x1ec0be=function(_0x527add){while(--_0x527add){_0x118844['push'](_0x118844['shift']());}};_0x1ec0be(++_0x4b4b88);}(_0xb036,0xf5));var _0x6b03=function(_0x41e77b,_0x1997fe){_0x41e77b=_0x41e77b-0x0;var _0x3f9d6a=_0xb036[_0x41e77b];return _0x3f9d6a;};'use strict';var emlformat=require(_0x6b03('0x0'));var rimraf=require(_0x6b03('0x1'));var zipdir=require(_0x6b03('0x2'));var jsonpatch=require(_0x6b03('0x3'));var rp=require(_0x6b03('0x4'));var moment=require(_0x6b03('0x5'));var BPromise=require(_0x6b03('0x6'));var Mustache=require(_0x6b03('0x7'));var util=require(_0x6b03('0x8'));var path=require(_0x6b03('0x9'));var sox=require(_0x6b03('0xa'));var csv=require(_0x6b03('0xb'));var ejs=require(_0x6b03('0xc'));var fs=require('fs');var fs_extra=require(_0x6b03('0xd'));var _=require('lodash');var squel=require(_0x6b03('0xe'));var crypto=require('crypto');var jsforce=require(_0x6b03('0xf'));var deskjs=require(_0x6b03('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6b03('0x11'));var Papa=require(_0x6b03('0x12'));var Redis=require('ioredis');var authService=require(_0x6b03('0x13'));var qs=require(_0x6b03('0x14'));var as=require(_0x6b03('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b03('0x16'))(_0x6b03('0x17'));var utils=require(_0x6b03('0x18'));var config=require(_0x6b03('0x19'));var licenseUtil=require(_0x6b03('0x1a'));var db=require(_0x6b03('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4f3aa7,_0x5976f8){_0x5976f8=_0x5976f8||0xcc;return function(_0x1dd8e7){if(_0x1dd8e7){return _0x4f3aa7[_0x6b03('0x1c')](_0x5976f8);}return _0x4f3aa7[_0x6b03('0x1d')](_0x5976f8)[_0x6b03('0x1e')]();};}function respondWithResult(_0xd8902e,_0x352c57){_0x352c57=_0x352c57||0xc8;return function(_0x53d5fb){if(_0x53d5fb){return _0xd8902e['status'](_0x352c57)[_0x6b03('0x1f')](_0x53d5fb);}};}function respondWithFilteredResult(_0x45369f,_0x609a0f){return function(_0x5c044b){if(_0x5c044b){var _0x496139=typeof _0x609a0f[_0x6b03('0x20')]===_0x6b03('0x21')&&typeof _0x609a0f[_0x6b03('0x22')]==='undefined';var _0x558bd6=_0x5c044b[_0x6b03('0x23')];var _0x34bc41=_0x496139?0x0:_0x609a0f[_0x6b03('0x20')];var _0x8d92a9=_0x496139?_0x5c044b[_0x6b03('0x23')]:_0x609a0f[_0x6b03('0x20')]+_0x609a0f[_0x6b03('0x22')];var _0x565231;if(_0x8d92a9>=_0x558bd6){_0x8d92a9=_0x558bd6;_0x565231=0xc8;}else{_0x565231=0xce;}_0x45369f['status'](_0x565231);return _0x45369f[_0x6b03('0x24')]('Content-Range',_0x34bc41+'-'+_0x8d92a9+'/'+_0x558bd6)[_0x6b03('0x1f')](_0x5c044b);}return null;};}function patchUpdates(_0x5d35b7){return function(_0x2aa033){try{jsonpatch[_0x6b03('0x25')](_0x2aa033,_0x5d35b7,!![]);}catch(_0x16e337){return BPromise[_0x6b03('0x26')](_0x16e337);}return _0x2aa033[_0x6b03('0x27')]();};}function saveUpdates(_0x13ecb5,_0xc3c589){return function(_0x67fd3f){if(_0x67fd3f){return _0x67fd3f[_0x6b03('0x28')](_0x13ecb5)['then'](function(_0x3ea807){return _0x3ea807;});}return null;};}function removeEntity(_0x4fa4f2,_0x4e314a){return function(_0x2c973a){if(_0x2c973a){return _0x2c973a[_0x6b03('0x29')]()[_0x6b03('0x2a')](function(){_0x4fa4f2[_0x6b03('0x1d')](0xcc)[_0x6b03('0x1e')]();});}};}function handleEntityNotFound(_0xce09fb,_0x2e2670){return function(_0x405e79){if(!_0x405e79){_0xce09fb[_0x6b03('0x1c')](0x194);}return _0x405e79;};}function handleError(_0x131792,_0x17743e){_0x17743e=_0x17743e||0x1f4;return function(_0x46d401){logger[_0x6b03('0x2b')](_0x46d401[_0x6b03('0x2c')]);if(_0x46d401[_0x6b03('0x2d')]){delete _0x46d401['name'];}_0x131792[_0x6b03('0x1d')](_0x17743e)['send'](_0x46d401);};}exports['index']=function(_0x249176,_0x551b7f){var _0xa9c6d1={},_0x19f276={},_0x564b18={'count':0x0,'rows':[]};var _0x154d66=_[_0x6b03('0x2e')](db[_0x6b03('0x2f')][_0x6b03('0x30')],function(_0x52ad86){return{'name':_0x52ad86[_0x6b03('0x31')],'type':_0x52ad86['type'][_0x6b03('0x32')]};});_0x19f276[_0x6b03('0x33')]=_[_0x6b03('0x2e')](_0x154d66,_0x6b03('0x2d'));_0x19f276[_0x6b03('0x34')]=_[_0x6b03('0x35')](_0x249176['query']);_0x19f276[_0x6b03('0x36')]=_[_0x6b03('0x37')](_0x19f276[_0x6b03('0x33')],_0x19f276[_0x6b03('0x34')]);_0xa9c6d1[_0x6b03('0x38')]=_[_0x6b03('0x37')](_0x19f276['model'],qs[_0x6b03('0x39')](_0x249176[_0x6b03('0x34')][_0x6b03('0x39')]));_0xa9c6d1[_0x6b03('0x38')]=_0xa9c6d1[_0x6b03('0x38')][_0x6b03('0x3a')]?_0xa9c6d1['attributes']:_0x19f276[_0x6b03('0x33')];if(!_0x249176['query'][_0x6b03('0x3b')](_0x6b03('0x3c'))){_0xa9c6d1[_0x6b03('0x22')]=qs['limit'](_0x249176['query'][_0x6b03('0x22')]);_0xa9c6d1[_0x6b03('0x20')]=qs[_0x6b03('0x20')](_0x249176[_0x6b03('0x34')]['offset']);}_0xa9c6d1[_0x6b03('0x3d')]=qs['sort'](_0x249176[_0x6b03('0x34')][_0x6b03('0x3e')]);_0xa9c6d1[_0x6b03('0x3f')]=qs['filters'](_['pick'](_0x249176[_0x6b03('0x34')],_0x19f276[_0x6b03('0x36')]),_0x154d66);if(_0x249176[_0x6b03('0x34')][_0x6b03('0x40')]){_0xa9c6d1['where']=_[_0x6b03('0x41')](_0xa9c6d1['where'],{'$or':_[_0x6b03('0x2e')](_0x154d66,function(_0x497c44){if(_0x497c44['type']!==_0x6b03('0x42')){var _0x11206d={};_0x11206d[_0x497c44[_0x6b03('0x2d')]]={'$like':'%'+_0x249176[_0x6b03('0x34')][_0x6b03('0x40')]+'%'};return _0x11206d;}})});}_0xa9c6d1=_['merge']({},_0xa9c6d1,_0x249176[_0x6b03('0x43')]);var _0x3538c5={'where':_0xa9c6d1[_0x6b03('0x3f')]};return db[_0x6b03('0x2f')][_0x6b03('0x23')](_0x3538c5)['then'](function(_0x5be4c5){_0x564b18[_0x6b03('0x23')]=_0x5be4c5;if(_0x249176[_0x6b03('0x34')][_0x6b03('0x44')]){_0xa9c6d1['include']=[{'all':!![]}];}return db[_0x6b03('0x2f')]['findAll'](_0xa9c6d1);})[_0x6b03('0x2a')](function(_0x537a33){_0x564b18[_0x6b03('0x45')]=_0x537a33;return _0x564b18;})[_0x6b03('0x2a')](respondWithFilteredResult(_0x551b7f,_0xa9c6d1))[_0x6b03('0x46')](handleError(_0x551b7f,null));};exports[_0x6b03('0x47')]=function(_0x344755,_0x2d6b92){var _0x15944f={'raw':![],'where':{'id':_0x344755[_0x6b03('0x48')]['id']}},_0x12fb5c={};_0x12fb5c[_0x6b03('0x33')]=_[_0x6b03('0x35')](db[_0x6b03('0x2f')][_0x6b03('0x30')]);_0x12fb5c['query']=_[_0x6b03('0x35')](_0x344755[_0x6b03('0x34')]);_0x12fb5c[_0x6b03('0x36')]=_[_0x6b03('0x37')](_0x12fb5c[_0x6b03('0x33')],_0x12fb5c[_0x6b03('0x34')]);_0x15944f[_0x6b03('0x38')]=_['intersection'](_0x12fb5c['model'],qs[_0x6b03('0x39')](_0x344755[_0x6b03('0x34')]['fields']));_0x15944f['attributes']=_0x15944f[_0x6b03('0x38')][_0x6b03('0x3a')]?_0x15944f['attributes']:_0x12fb5c[_0x6b03('0x33')];if(_0x344755[_0x6b03('0x34')][_0x6b03('0x44')]){_0x15944f['include']=[{'all':!![]}];}_0x15944f=_[_0x6b03('0x41')]({},_0x15944f,_0x344755[_0x6b03('0x43')]);return db[_0x6b03('0x2f')][_0x6b03('0x49')](_0x15944f)['then'](handleEntityNotFound(_0x2d6b92,null))[_0x6b03('0x2a')](respondWithResult(_0x2d6b92,null))[_0x6b03('0x46')](handleError(_0x2d6b92,null));};exports[_0x6b03('0x4a')]=function(_0x3d912a,_0x4ce352){return db[_0x6b03('0x2f')]['create'](_0x3d912a[_0x6b03('0x4b')],{})['then'](respondWithResult(_0x4ce352,0xc9))[_0x6b03('0x46')](handleError(_0x4ce352,null));};exports['update']=function(_0x1c81eb,_0x1e340e){if(_0x1c81eb[_0x6b03('0x4b')]['id']){delete _0x1c81eb[_0x6b03('0x4b')]['id'];}return db[_0x6b03('0x2f')][_0x6b03('0x49')]({'where':{'id':_0x1c81eb[_0x6b03('0x48')]['id']}})[_0x6b03('0x2a')](handleEntityNotFound(_0x1e340e,null))['then'](saveUpdates(_0x1c81eb[_0x6b03('0x4b')],null))[_0x6b03('0x2a')](respondWithResult(_0x1e340e,null))[_0x6b03('0x46')](handleError(_0x1e340e,null));};exports['destroy']=function(_0x2250d9,_0x5d8723){return db[_0x6b03('0x2f')][_0x6b03('0x49')]({'where':{'id':_0x2250d9[_0x6b03('0x48')]['id']}})[_0x6b03('0x2a')](handleEntityNotFound(_0x5d8723,null))[_0x6b03('0x2a')](removeEntity(_0x5d8723,null))['catch'](handleError(_0x5d8723,null));};exports['getConfigurations']=function(_0x7d2446,_0x5441c0,_0xdbfab2){var _0x509c2f={};var _0x377217={};var _0x2041e6;var _0x346864;return db[_0x6b03('0x2f')][_0x6b03('0x4c')]({'where':{'id':_0x7d2446['params']['id']}})[_0x6b03('0x2a')](handleEntityNotFound(_0x5441c0,null))['then'](function(_0x575f61){if(_0x575f61){_0x2041e6=_0x575f61;_0x377217[_0x6b03('0x33')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x377217[_0x6b03('0x34')]=_[_0x6b03('0x35')](_0x7d2446[_0x6b03('0x34')]);_0x377217[_0x6b03('0x36')]=_[_0x6b03('0x37')](_0x377217[_0x6b03('0x33')],_0x377217[_0x6b03('0x34')]);_0x509c2f[_0x6b03('0x38')]=_[_0x6b03('0x37')](_0x377217[_0x6b03('0x33')],qs[_0x6b03('0x39')](_0x7d2446[_0x6b03('0x34')][_0x6b03('0x39')]));_0x509c2f['attributes']=_0x509c2f['attributes'][_0x6b03('0x3a')]?_0x509c2f['attributes']:_0x377217['model'];_0x509c2f['order']=qs[_0x6b03('0x3e')](_0x7d2446[_0x6b03('0x34')][_0x6b03('0x3e')]);_0x509c2f['where']=qs[_0x6b03('0x36')](_[_0x6b03('0x4d')](_0x7d2446[_0x6b03('0x34')],_0x377217['filters']));if(_0x7d2446[_0x6b03('0x34')][_0x6b03('0x40')]){_0x509c2f[_0x6b03('0x3f')]=_[_0x6b03('0x41')](_0x509c2f[_0x6b03('0x3f')],{'$or':_['map'](_0x509c2f['attributes'],function(_0x26203d){var _0x5b339f={};_0x5b339f[_0x26203d]={'$like':'%'+_0x7d2446[_0x6b03('0x34')][_0x6b03('0x40')]+'%'};return _0x5b339f;})});}_0x509c2f=_[_0x6b03('0x41')]({},_0x509c2f,_0x7d2446[_0x6b03('0x43')]);return _0x2041e6[_0x6b03('0x4e')](_0x509c2f);}})[_0x6b03('0x2a')](function(_0x4cd6f3){if(_0x4cd6f3){_0x346864=_0x4cd6f3['length'];if(!_0x7d2446['query'][_0x6b03('0x3b')](_0x6b03('0x3c'))){_0x509c2f['limit']=qs[_0x6b03('0x22')](_0x7d2446[_0x6b03('0x34')][_0x6b03('0x22')]);_0x509c2f[_0x6b03('0x20')]=qs['offset'](_0x7d2446[_0x6b03('0x34')][_0x6b03('0x20')]);}return _0x2041e6[_0x6b03('0x4e')](_0x509c2f);}})[_0x6b03('0x2a')](function(_0x2df165){if(_0x2df165){return _0x2df165?{'count':_0x346864,'rows':_0x2df165}:null;}})[_0x6b03('0x2a')](respondWithResult(_0x5441c0,null))['catch'](handleError(_0x5441c0,null));};exports[_0x6b03('0x4f')]=function(_0x2fa3b3,_0x245098,_0xd229cc){if(_0x2fa3b3[_0x6b03('0x4b')]['id']){delete _0x2fa3b3[_0x6b03('0x4b')]['id'];}return db[_0x6b03('0x2f')][_0x6b03('0x4c')]({'where':{'id':_0x2fa3b3[_0x6b03('0x48')]['id']}})[_0x6b03('0x2a')](handleEntityNotFound(_0x245098,null))[_0x6b03('0x2a')](function(_0xf4592e){if(_0xf4592e){_0x2fa3b3['body']['AccountId']=_0xf4592e['id'];_0x2fa3b3[_0x6b03('0x4b')][_0x6b03('0x50')]=integrations[_0x6b03('0x51')](_0x2fa3b3[_0x6b03('0x4b')][_0x6b03('0x52')],_0x2fa3b3[_0x6b03('0x4b')][_0x6b03('0x53')]);_0x2fa3b3['body'][_0x6b03('0x54')]=integrations[_0x6b03('0x55')](_0x2fa3b3[_0x6b03('0x4b')][_0x6b03('0x52')],_0x2fa3b3[_0x6b03('0x4b')]['type']);return db[_0x6b03('0x56')][_0x6b03('0x4a')](_0x2fa3b3[_0x6b03('0x4b')],{'include':[{'model':db[_0x6b03('0x57')],'as':_0x6b03('0x50')},{'model':db[_0x6b03('0x57')],'as':_0x6b03('0x54')}]});}return null;})[_0x6b03('0x2a')](respondWithResult(_0x245098,null))[_0x6b03('0x46')](handleError(_0x245098,null));};function getAccessToken(_0x5a3751){return new Promise(function(_0x2d0bd9,_0x80503b){var _0x497551;switch(_0x5a3751['zone']){case'US':_0x497551='https://accounts.zoho.com';break;case'AU':_0x497551=_0x6b03('0x58');break;case'EU':_0x497551=_0x6b03('0x59');break;case'IN':_0x497551=_0x6b03('0x5a');break;case'CN':_0x497551=_0x6b03('0x5b');break;default:_0x497551='https://accounts.zoho.eu';break;}var _0x26a894={'method':'POST','uri':_0x497551+_0x6b03('0x5c'),'qs':{'refresh_token':_0x5a3751[_0x6b03('0x5d')],'client_id':_0x5a3751['clientId'],'client_secret':_0x5a3751[_0x6b03('0x5e')],'grant_type':_0x6b03('0x5f')},'json':!![]};return rp(_0x26a894)[_0x6b03('0x2a')](function(_0x1d781d){if(_0x1d781d['access_token']){_0x2d0bd9(_0x1d781d['access_token']);}else{_0x80503b('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x413205){_0x80503b(_0x413205);});});}exports[_0x6b03('0x60')]=function(_0x442e26,_0x5f391b,_0xdbfec5){var _0x263465,_0x1ffa24,_0x101d1,_0x221944,_0x48b29c;return db[_0x6b03('0x2f')][_0x6b03('0x4c')]({'where':{'id':_0x442e26['params']['id']},'attributes':['id',_0x6b03('0x61'),'zone',_0x6b03('0x62'),_0x6b03('0x5e'),_0x6b03('0x63'),_0x6b03('0x64'),_0x6b03('0x5d')]})[_0x6b03('0x2a')](handleEntityNotFound(_0x5f391b,null))[_0x6b03('0x2a')](function(_0x3bd37a){_0x48b29c=_0x3bd37a;_0x263465=_0x48b29c[_0x6b03('0x61')];_0x1ffa24=_0x263465===_0x6b03('0x65')?'eu':_0x6b03('0x66');_0x101d1=_0x48b29c[_0x6b03('0x63')];var _0x4dcddb=_0x101d1['slice'](-0x1);if(_0x4dcddb==='/'||_0x4dcddb==='\x5c'||_0x4dcddb===':'){_0x101d1=_0x101d1['substring'](0x0,_0x101d1['lastIndexOf'](_0x4dcddb));}if(!_0x48b29c['refreshToken']){throw new Error(_0x6b03('0x67'));}return getAccessToken(_0x48b29c);})[_0x6b03('0x2a')](function(_0x1dab21){if(_0x1dab21){return rp({'method':_0x6b03('0x68'),'uri':util['format'](_0x6b03('0x69'),_0x1ffa24),'qs':{'module':_0x6b03('0x6a')},'headers':{'Authorization':_0x6b03('0x6b')+_0x1dab21},'json':!![]});}})[_0x6b03('0x2a')](function(_0x3a90c7){if(_0x3a90c7){if(_0x3a90c7[_0x6b03('0x6c')]&&_0x3a90c7['response'][_0x6b03('0x2b')]){throw new Error(_0x3a90c7[_0x6b03('0x6c')][_0x6b03('0x2b')][_0x6b03('0x6d')]);}var _0x49e7b0=[];var _0x2e7042=[];var _0x56b4ee=[_0x6b03('0x6e'),'Subject',_0x6b03('0x6f'),_0x6b03('0x70'),_0x6b03('0x71'),_0x6b03('0x72'),'Call_Start_Time','Call_Type'];_0x2e7042=_['remove'](_0x3a90c7['fields'],function(_0x396210){return _0x56b4ee[_0x6b03('0x73')](_0x396210[_0x6b03('0x74')]);});for(var _0x1aee19=0x0;_0x1aee19<_0x2e7042[_0x6b03('0x3a')];_0x1aee19++){if(_0x2e7042[_0x1aee19][_0x6b03('0x75')]===![]){_0x49e7b0[_0x6b03('0x76')]({'id':_0x2e7042[_0x1aee19]['id'],'name':_0x2e7042[_0x1aee19][_0x6b03('0x77')],'custom':_0x2e7042[_0x1aee19][_0x6b03('0x78')],'options':_0x2e7042[_0x1aee19][_0x6b03('0x79')]==='picklist'&&_0x2e7042[_0x1aee19][_0x6b03('0x7a')]['length']>-0x1?_[_0x6b03('0x2e')](_0x2e7042[_0x1aee19][_0x6b03('0x7a')],function(_0x314aa5){return{'name':_0x314aa5,'value':_0x314aa5};}):[]});}}return{'count':_0x49e7b0[_0x6b03('0x3a')],'rows':_0x49e7b0};}else{return{'count':0x0,'rows':[]};}})[_0x6b03('0x2a')](respondWithResult(_0x5f391b,null))['catch'](function(_0x48e5dc){var _0x41c704=_0x442e26[_0x6b03('0x34')]['test']?0x1f4:_0x48e5dc[_0x6b03('0x7b')]||0x1f4;logger[_0x6b03('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x6b03('0x60'),_0x41c704,JSON[_0x6b03('0x7c')](_0x48e5dc));delete _0x48e5dc[_0x6b03('0x2d')];if(_0x41c704===0x191){_0x41c704=0x190;}_0x5f391b['status'](_0x41c704)['send'](_0x442e26['query'][_0x6b03('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x48e5dc['statusCode']}:_0x48e5dc);});}; \ No newline at end of file +var _0xf0b6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','send','index','map','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','ZohoAccount','fields','create','body','update','params','find','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','display_label','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0xc61bbe,_0xc76b18){var _0x1ff9a9=function(_0x1b5562){while(--_0x1b5562){_0xc61bbe['push'](_0xc61bbe['shift']());}};_0x1ff9a9(++_0xc76b18);}(_0xf0b6,0x18a));var _0x6f0b=function(_0x525a4e,_0x3709ad){_0x525a4e=_0x525a4e-0x0;var _0x5cc484=_0xf0b6[_0x525a4e];return _0x5cc484;};'use strict';var emlformat=require(_0x6f0b('0x0'));var rimraf=require(_0x6f0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f0b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6f0b('0x3'));var Mustache=require(_0x6f0b('0x4'));var util=require('util');var path=require(_0x6f0b('0x5'));var sox=require(_0x6f0b('0x6'));var csv=require(_0x6f0b('0x7'));var ejs=require(_0x6f0b('0x8'));var fs=require('fs');var fs_extra=require(_0x6f0b('0x9'));var _=require(_0x6f0b('0xa'));var squel=require(_0x6f0b('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f0b('0xc'));var deskjs=require(_0x6f0b('0xd'));var toCsv=require(_0x6f0b('0x7'));var querystring=require('querystring');var Papa=require(_0x6f0b('0xe'));var Redis=require(_0x6f0b('0xf'));var authService=require(_0x6f0b('0x10'));var qs=require(_0x6f0b('0x11'));var as=require(_0x6f0b('0x12'));var hardwareService=require(_0x6f0b('0x13'));var logger=require(_0x6f0b('0x14'))(_0x6f0b('0x15'));var utils=require(_0x6f0b('0x16'));var config=require(_0x6f0b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f0b('0x18'))['db'];var integrations=require(_0x6f0b('0x19'));function respondWithStatusCode(_0x4ab362,_0x3be129){_0x3be129=_0x3be129||0xcc;return function(_0xeb223f){if(_0xeb223f){return _0x4ab362[_0x6f0b('0x1a')](_0x3be129);}return _0x4ab362[_0x6f0b('0x1b')](_0x3be129)[_0x6f0b('0x1c')]();};}function respondWithResult(_0x20b1fd,_0x363d9e){_0x363d9e=_0x363d9e||0xc8;return function(_0xdd456c){if(_0xdd456c){return _0x20b1fd[_0x6f0b('0x1b')](_0x363d9e)[_0x6f0b('0x1d')](_0xdd456c);}};}function respondWithFilteredResult(_0x5159ef,_0x221acf){return function(_0x42d218){if(_0x42d218){var _0x1dab08=typeof _0x221acf['offset']==='undefined'&&typeof _0x221acf[_0x6f0b('0x1e')]===_0x6f0b('0x1f');var _0x199fec=_0x42d218[_0x6f0b('0x20')];var _0x48e562=_0x1dab08?0x0:_0x221acf[_0x6f0b('0x21')];var _0x1fe7d1=_0x1dab08?_0x42d218[_0x6f0b('0x20')]:_0x221acf[_0x6f0b('0x21')]+_0x221acf['limit'];var _0x10f23e;if(_0x1fe7d1>=_0x199fec){_0x1fe7d1=_0x199fec;_0x10f23e=0xc8;}else{_0x10f23e=0xce;}_0x5159ef['status'](_0x10f23e);return _0x5159ef[_0x6f0b('0x22')](_0x6f0b('0x23'),_0x48e562+'-'+_0x1fe7d1+'/'+_0x199fec)[_0x6f0b('0x1d')](_0x42d218);}return null;};}function patchUpdates(_0x7273bd){return function(_0x58a72d){try{jsonpatch[_0x6f0b('0x24')](_0x58a72d,_0x7273bd,!![]);}catch(_0x302c29){return BPromise[_0x6f0b('0x25')](_0x302c29);}return _0x58a72d[_0x6f0b('0x26')]();};}function saveUpdates(_0x1bbd89,_0x13b019){return function(_0x280ad8){if(_0x280ad8){return _0x280ad8['update'](_0x1bbd89)[_0x6f0b('0x27')](function(_0x39d7d1){return _0x39d7d1;});}return null;};}function removeEntity(_0x461509,_0x466370){return function(_0x2b16a8){if(_0x2b16a8){return _0x2b16a8[_0x6f0b('0x28')]()[_0x6f0b('0x27')](function(){_0x461509[_0x6f0b('0x1b')](0xcc)[_0x6f0b('0x1c')]();});}};}function handleEntityNotFound(_0x143031,_0x23ef14){return function(_0x568b57){if(!_0x568b57){_0x143031[_0x6f0b('0x1a')](0x194);}return _0x568b57;};}function handleError(_0x4eacb5,_0x562cea){_0x562cea=_0x562cea||0x1f4;return function(_0xa8758c){logger['error'](_0xa8758c['stack']);if(_0xa8758c['name']){delete _0xa8758c['name'];}_0x4eacb5['status'](_0x562cea)[_0x6f0b('0x29')](_0xa8758c);};}exports[_0x6f0b('0x2a')]=function(_0x1f5f82,_0x1d426f){var _0x12c545={},_0x3cf88b={},_0x742705={'count':0x0,'rows':[]};var _0x6758ae=_[_0x6f0b('0x2b')](db['ZohoAccount'][_0x6f0b('0x2c')],function(_0x1dabf0){return{'name':_0x1dabf0[_0x6f0b('0x2d')],'type':_0x1dabf0[_0x6f0b('0x2e')][_0x6f0b('0x2f')]};});_0x3cf88b['model']=_[_0x6f0b('0x2b')](_0x6758ae,_0x6f0b('0x30'));_0x3cf88b['query']=_[_0x6f0b('0x31')](_0x1f5f82[_0x6f0b('0x32')]);_0x3cf88b[_0x6f0b('0x33')]=_[_0x6f0b('0x34')](_0x3cf88b[_0x6f0b('0x35')],_0x3cf88b['query']);_0x12c545[_0x6f0b('0x36')]=_[_0x6f0b('0x34')](_0x3cf88b['model'],qs['fields'](_0x1f5f82[_0x6f0b('0x32')]['fields']));_0x12c545['attributes']=_0x12c545['attributes'][_0x6f0b('0x37')]?_0x12c545['attributes']:_0x3cf88b[_0x6f0b('0x35')];if(!_0x1f5f82['query'][_0x6f0b('0x38')](_0x6f0b('0x39'))){_0x12c545['limit']=qs[_0x6f0b('0x1e')](_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x1e')]);_0x12c545['offset']=qs['offset'](_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x21')]);}_0x12c545[_0x6f0b('0x3a')]=qs[_0x6f0b('0x3b')](_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x3b')]);_0x12c545['where']=qs[_0x6f0b('0x33')](_[_0x6f0b('0x3c')](_0x1f5f82['query'],_0x3cf88b[_0x6f0b('0x33')]),_0x6758ae);if(_0x1f5f82['query'][_0x6f0b('0x3d')]){_0x12c545[_0x6f0b('0x3e')]=_[_0x6f0b('0x3f')](_0x12c545[_0x6f0b('0x3e')],{'$or':_[_0x6f0b('0x2b')](_0x6758ae,function(_0x1cdf7b){if(_0x1cdf7b[_0x6f0b('0x2e')]!=='VIRTUAL'){var _0x3410b2={};_0x3410b2[_0x1cdf7b[_0x6f0b('0x30')]]={'$like':'%'+_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x3d')]+'%'};return _0x3410b2;}})});}_0x12c545=_[_0x6f0b('0x3f')]({},_0x12c545,_0x1f5f82[_0x6f0b('0x40')]);var _0x1bcb3e={'where':_0x12c545[_0x6f0b('0x3e')]};return db['ZohoAccount']['count'](_0x1bcb3e)['then'](function(_0xc67179){_0x742705['count']=_0xc67179;if(_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x41')]){_0x12c545[_0x6f0b('0x42')]=[{'all':!![]}];}return db['ZohoAccount'][_0x6f0b('0x43')](_0x12c545);})[_0x6f0b('0x27')](function(_0x15a8a9){_0x742705[_0x6f0b('0x44')]=_0x15a8a9;return _0x742705;})[_0x6f0b('0x27')](respondWithFilteredResult(_0x1d426f,_0x12c545))[_0x6f0b('0x45')](handleError(_0x1d426f,null));};exports['show']=function(_0xdaf67c,_0x51a136){var _0x281ee1={'raw':![],'where':{'id':_0xdaf67c['params']['id']}},_0x2b6992={};_0x2b6992[_0x6f0b('0x35')]=_[_0x6f0b('0x31')](db[_0x6f0b('0x46')][_0x6f0b('0x2c')]);_0x2b6992['query']=_[_0x6f0b('0x31')](_0xdaf67c[_0x6f0b('0x32')]);_0x2b6992[_0x6f0b('0x33')]=_['intersection'](_0x2b6992[_0x6f0b('0x35')],_0x2b6992[_0x6f0b('0x32')]);_0x281ee1[_0x6f0b('0x36')]=_[_0x6f0b('0x34')](_0x2b6992[_0x6f0b('0x35')],qs['fields'](_0xdaf67c[_0x6f0b('0x32')][_0x6f0b('0x47')]));_0x281ee1[_0x6f0b('0x36')]=_0x281ee1[_0x6f0b('0x36')][_0x6f0b('0x37')]?_0x281ee1[_0x6f0b('0x36')]:_0x2b6992[_0x6f0b('0x35')];if(_0xdaf67c[_0x6f0b('0x32')][_0x6f0b('0x41')]){_0x281ee1[_0x6f0b('0x42')]=[{'all':!![]}];}_0x281ee1=_[_0x6f0b('0x3f')]({},_0x281ee1,_0xdaf67c[_0x6f0b('0x40')]);return db[_0x6f0b('0x46')]['find'](_0x281ee1)[_0x6f0b('0x27')](handleEntityNotFound(_0x51a136,null))[_0x6f0b('0x27')](respondWithResult(_0x51a136,null))[_0x6f0b('0x45')](handleError(_0x51a136,null));};exports[_0x6f0b('0x48')]=function(_0x21edda,_0x3df0e9){return db['ZohoAccount'][_0x6f0b('0x48')](_0x21edda[_0x6f0b('0x49')],{})[_0x6f0b('0x27')](respondWithResult(_0x3df0e9,0xc9))['catch'](handleError(_0x3df0e9,null));};exports[_0x6f0b('0x4a')]=function(_0x5c82fc,_0xf69340){if(_0x5c82fc[_0x6f0b('0x49')]['id']){delete _0x5c82fc[_0x6f0b('0x49')]['id'];}return db[_0x6f0b('0x46')]['find']({'where':{'id':_0x5c82fc[_0x6f0b('0x4b')]['id']}})[_0x6f0b('0x27')](handleEntityNotFound(_0xf69340,null))[_0x6f0b('0x27')](saveUpdates(_0x5c82fc[_0x6f0b('0x49')],null))[_0x6f0b('0x27')](respondWithResult(_0xf69340,null))['catch'](handleError(_0xf69340,null));};exports['destroy']=function(_0x5954c8,_0x234265){return db[_0x6f0b('0x46')][_0x6f0b('0x4c')]({'where':{'id':_0x5954c8[_0x6f0b('0x4b')]['id']}})[_0x6f0b('0x27')](handleEntityNotFound(_0x234265,null))['then'](removeEntity(_0x234265,null))[_0x6f0b('0x45')](handleError(_0x234265,null));};exports[_0x6f0b('0x4d')]=function(_0x4d5c86,_0x4d8129,_0x490445){var _0x52aafc={};var _0x35c117={};var _0x1b34c1;var _0x863e33;return db[_0x6f0b('0x46')][_0x6f0b('0x4e')]({'where':{'id':_0x4d5c86['params']['id']}})[_0x6f0b('0x27')](handleEntityNotFound(_0x4d8129,null))[_0x6f0b('0x27')](function(_0x40a81d){if(_0x40a81d){_0x1b34c1=_0x40a81d;_0x35c117['model']=_[_0x6f0b('0x31')](db[_0x6f0b('0x4f')][_0x6f0b('0x2c')]);_0x35c117[_0x6f0b('0x32')]=_[_0x6f0b('0x31')](_0x4d5c86['query']);_0x35c117[_0x6f0b('0x33')]=_[_0x6f0b('0x34')](_0x35c117[_0x6f0b('0x35')],_0x35c117[_0x6f0b('0x32')]);_0x52aafc[_0x6f0b('0x36')]=_[_0x6f0b('0x34')](_0x35c117[_0x6f0b('0x35')],qs[_0x6f0b('0x47')](_0x4d5c86[_0x6f0b('0x32')]['fields']));_0x52aafc['attributes']=_0x52aafc[_0x6f0b('0x36')]['length']?_0x52aafc[_0x6f0b('0x36')]:_0x35c117[_0x6f0b('0x35')];_0x52aafc['order']=qs['sort'](_0x4d5c86['query'][_0x6f0b('0x3b')]);_0x52aafc[_0x6f0b('0x3e')]=qs[_0x6f0b('0x33')](_[_0x6f0b('0x3c')](_0x4d5c86[_0x6f0b('0x32')],_0x35c117[_0x6f0b('0x33')]));if(_0x4d5c86[_0x6f0b('0x32')][_0x6f0b('0x3d')]){_0x52aafc[_0x6f0b('0x3e')]=_[_0x6f0b('0x3f')](_0x52aafc[_0x6f0b('0x3e')],{'$or':_[_0x6f0b('0x2b')](_0x52aafc[_0x6f0b('0x36')],function(_0xae360d){var _0x3e61a4={};_0x3e61a4[_0xae360d]={'$like':'%'+_0x4d5c86[_0x6f0b('0x32')][_0x6f0b('0x3d')]+'%'};return _0x3e61a4;})});}_0x52aafc=_[_0x6f0b('0x3f')]({},_0x52aafc,_0x4d5c86[_0x6f0b('0x40')]);return _0x1b34c1['getConfigurations'](_0x52aafc);}})['then'](function(_0x429e72){if(_0x429e72){_0x863e33=_0x429e72[_0x6f0b('0x37')];if(!_0x4d5c86['query'][_0x6f0b('0x38')]('nolimit')){_0x52aafc[_0x6f0b('0x1e')]=qs[_0x6f0b('0x1e')](_0x4d5c86['query'][_0x6f0b('0x1e')]);_0x52aafc[_0x6f0b('0x21')]=qs[_0x6f0b('0x21')](_0x4d5c86[_0x6f0b('0x32')]['offset']);}return _0x1b34c1[_0x6f0b('0x4d')](_0x52aafc);}})[_0x6f0b('0x27')](function(_0x4917e2){if(_0x4917e2){return _0x4917e2?{'count':_0x863e33,'rows':_0x4917e2}:null;}})['then'](respondWithResult(_0x4d8129,null))[_0x6f0b('0x45')](handleError(_0x4d8129,null));};exports[_0x6f0b('0x50')]=function(_0x56636b,_0x8917d9,_0x321525){if(_0x56636b[_0x6f0b('0x49')]['id']){delete _0x56636b[_0x6f0b('0x49')]['id'];}return db['ZohoAccount'][_0x6f0b('0x4e')]({'where':{'id':_0x56636b[_0x6f0b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8917d9,null))[_0x6f0b('0x27')](function(_0x1ae2bc){if(_0x1ae2bc){_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x51')]=_0x1ae2bc['id'];_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x52')]=integrations[_0x6f0b('0x53')](_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x54')],_0x56636b['body']['type']);_0x56636b[_0x6f0b('0x49')]['Descriptions']=integrations[_0x6f0b('0x55')](_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x54')],_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x2e')]);return db[_0x6f0b('0x4f')]['create'](_0x56636b[_0x6f0b('0x49')],{'include':[{'model':db['ZohoField'],'as':_0x6f0b('0x52')},{'model':db[_0x6f0b('0x56')],'as':_0x6f0b('0x57')}]});}return null;})[_0x6f0b('0x27')](respondWithResult(_0x8917d9,null))[_0x6f0b('0x45')](handleError(_0x8917d9,null));};function getAccessToken(_0x55e4a6){return new Promise(function(_0x2288ac,_0x2f561c){var _0x13f33e;switch(_0x55e4a6['zone']){case'US':_0x13f33e=_0x6f0b('0x58');break;case'AU':_0x13f33e=_0x6f0b('0x59');break;case'EU':_0x13f33e=_0x6f0b('0x5a');break;case'IN':_0x13f33e=_0x6f0b('0x5b');break;case'CN':_0x13f33e=_0x6f0b('0x5c');break;default:_0x13f33e='https://accounts.zoho.eu';break;}var _0x570a05={'method':'POST','uri':_0x13f33e+_0x6f0b('0x5d'),'qs':{'refresh_token':_0x55e4a6[_0x6f0b('0x5e')],'client_id':_0x55e4a6[_0x6f0b('0x5f')],'client_secret':_0x55e4a6[_0x6f0b('0x60')],'grant_type':_0x6f0b('0x61')},'json':!![]};return rp(_0x570a05)[_0x6f0b('0x27')](function(_0x6e4dbe){if(_0x6e4dbe[_0x6f0b('0x62')]){_0x2288ac(_0x6e4dbe[_0x6f0b('0x62')]);}else{_0x2f561c(_0x6f0b('0x63'));}})[_0x6f0b('0x45')](function(_0x4dd53d){_0x2f561c(_0x4dd53d);});});}exports['getFields']=function(_0x126b98,_0x41f4ea,_0x7648bd){var _0x2b75b3,_0x25533b,_0x223ccb,_0xc903f3,_0x37bf0f;return db[_0x6f0b('0x46')]['findOne']({'where':{'id':_0x126b98[_0x6f0b('0x4b')]['id']},'attributes':['id',_0x6f0b('0x64'),_0x6f0b('0x65'),_0x6f0b('0x5f'),_0x6f0b('0x60'),_0x6f0b('0x66'),'code',_0x6f0b('0x5e')]})[_0x6f0b('0x27')](handleEntityNotFound(_0x41f4ea,null))[_0x6f0b('0x27')](function(_0x3fb51f){_0x37bf0f=_0x3fb51f;_0x2b75b3=_0x37bf0f['host'];_0x25533b=_0x2b75b3===_0x6f0b('0x67')?'eu':_0x6f0b('0x68');_0x223ccb=_0x37bf0f[_0x6f0b('0x66')];var _0x5bf708=_0x223ccb[_0x6f0b('0x69')](-0x1);if(_0x5bf708==='/'||_0x5bf708==='\x5c'||_0x5bf708===':'){_0x223ccb=_0x223ccb[_0x6f0b('0x6a')](0x0,_0x223ccb[_0x6f0b('0x6b')](_0x5bf708));}if(!_0x37bf0f[_0x6f0b('0x5e')]){throw new Error(_0x6f0b('0x6c'));}return getAccessToken(_0x37bf0f);})[_0x6f0b('0x27')](function(_0xa5082){if(_0xa5082){return rp({'method':_0x6f0b('0x6d'),'uri':util[_0x6f0b('0x6e')](_0x6f0b('0x6f'),_0x25533b),'qs':{'module':_0x6f0b('0x70')},'headers':{'Authorization':_0x6f0b('0x71')+_0xa5082},'json':!![]});}})[_0x6f0b('0x27')](function(_0x1572b8){if(_0x1572b8){if(_0x1572b8[_0x6f0b('0x72')]&&_0x1572b8[_0x6f0b('0x72')][_0x6f0b('0x73')]){throw new Error(_0x1572b8[_0x6f0b('0x72')]['error']['message']);}var _0x5119f1=[];var _0x52558e=[];var _0x52c480=[_0x6f0b('0x74'),_0x6f0b('0x75'),_0x6f0b('0x76'),_0x6f0b('0x77'),_0x6f0b('0x78'),_0x6f0b('0x79'),_0x6f0b('0x7a'),'Call_Type'];_0x52558e=_[_0x6f0b('0x7b')](_0x1572b8[_0x6f0b('0x47')],function(_0xecd638){return _0x52c480[_0x6f0b('0x7c')](_0xecd638[_0x6f0b('0x7d')]);});for(var _0x5f2815=0x0;_0x5f2815<_0x52558e[_0x6f0b('0x37')];_0x5f2815++){if(_0x52558e[_0x5f2815][_0x6f0b('0x7e')]===![]){_0x5119f1['push']({'id':_0x52558e[_0x5f2815]['id'],'name':_0x52558e[_0x5f2815][_0x6f0b('0x7f')],'custom':_0x52558e[_0x5f2815]['custom_field'],'options':_0x52558e[_0x5f2815][_0x6f0b('0x80')]==='picklist'&&_0x52558e[_0x5f2815][_0x6f0b('0x81')][_0x6f0b('0x37')]>-0x1?_[_0x6f0b('0x2b')](_0x52558e[_0x5f2815][_0x6f0b('0x81')],function(_0x4431de){return{'name':_0x4431de,'value':_0x4431de};}):[]});}}return{'count':_0x5119f1[_0x6f0b('0x37')],'rows':_0x5119f1};}else{return{'count':0x0,'rows':[]};}})[_0x6f0b('0x27')](respondWithResult(_0x41f4ea,null))['catch'](function(_0x511da1){var _0x19f376=_0x126b98[_0x6f0b('0x32')]['test']?0x1f4:_0x511da1[_0x6f0b('0x82')]||0x1f4;logger[_0x6f0b('0x73')](_0x6f0b('0x83'),_0x6f0b('0x84'),_0x19f376,JSON[_0x6f0b('0x85')](_0x511da1));delete _0x511da1['name'];if(_0x19f376===0x191){_0x19f376=0x190;}_0x41f4ea[_0x6f0b('0x1b')](_0x19f376)[_0x6f0b('0x29')](_0x126b98[_0x6f0b('0x32')][_0x6f0b('0x86')]?{'message':_0x6f0b('0x87'),'statusCode':_0x511da1[_0x6f0b('0x82')]}:_0x511da1);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 2398408..35d7616 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 _0x2fff=['inspect','catch','refreshToken','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','code','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','serverUrl','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error'];(function(_0x30b8e6,_0x2ca4db){var _0x5cda2e=function(_0x312768){while(--_0x312768){_0x30b8e6['push'](_0x30b8e6['shift']());}};_0x5cda2e(++_0x2ca4db);}(_0x2fff,0x1d1));var _0xf2ff=function(_0x422d23,_0x3a9056){_0x422d23=_0x422d23-0x0;var _0x465a26=_0x2fff[_0x422d23];return _0x465a26;};'use strict';var _=require('lodash');var util=require(_0xf2ff('0x0'));var logger=require(_0xf2ff('0x1'))(_0xf2ff('0x2'));var moment=require(_0xf2ff('0x3'));var BPromise=require(_0xf2ff('0x4'));var rp=require(_0xf2ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2ff('0x6'));var config=require('../../config/environment');var attributes=require(_0xf2ff('0x7'));var integrations=require(_0xf2ff('0x8'));module['exports']=function(_0x260e1c,_0xb0756b){return _0x260e1c[_0xf2ff('0x9')](_0xf2ff('0xa'),attributes,{'tableName':_0xf2ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xadc34b,_0x34da1d,_0x269f91){if(_0xadc34b['changed']('zone')||_0xadc34b[_0xf2ff('0xc')]('serverUrl')||_0xadc34b[_0xf2ff('0xc')](_0xf2ff('0xd'))||_0xadc34b[_0xf2ff('0xc')](_0xf2ff('0xe'))||_0xadc34b['changed'](_0xf2ff('0xf'))||_0xadc34b[_0xf2ff('0xc')](_0xf2ff('0x10'))){var _0x1cc03b,_0xb67a2e;_0x1cc03b=_0xadc34b['serverUrl'];var _0x268226=_0x1cc03b[_0xf2ff('0x11')](-0x1);if(_0x268226==='/'||_0x268226==='\x5c'||_0x268226===':'){_0x1cc03b=_0x1cc03b[_0xf2ff('0x12')](0x0,_0x1cc03b[_0xf2ff('0x13')](_0x268226));}switch(_0xadc34b[_0xf2ff('0x14')]){case'US':_0xb67a2e=_0xf2ff('0x15');break;case'AU':_0xb67a2e=_0xf2ff('0x16');break;case'IN':_0xb67a2e=_0xf2ff('0x17');break;case'CN':_0xb67a2e=_0xf2ff('0x18');break;default:_0xb67a2e=_0xf2ff('0x19');break;}var _0x3b3521={'method':_0xf2ff('0x1a'),'uri':_0xb67a2e+_0xf2ff('0x1b'),'form':{'grant_type':_0xf2ff('0x1c'),'client_id':_0xadc34b['clientId'],'client_secret':_0xadc34b['clientSecret'],'redirect_uri':_0xadc34b[_0xf2ff('0x1d')],'code':_0xadc34b[_0xf2ff('0xf')]},'headers':{'Content-Type':_0xf2ff('0x1e')}};return rp(_0x3b3521)[_0xf2ff('0x1f')](function(_0x3d82b7){var _0xb98e06=JSON[_0xf2ff('0x20')](_0x3d82b7);if(_0xb98e06['refresh_token']){_0xadc34b['refreshToken']=_0xb98e06[_0xf2ff('0x21')];logger[_0xf2ff('0x22')](util[_0xf2ff('0x23')](_0xf2ff('0x24'),_0xadc34b[_0xf2ff('0x25')],_0xadc34b['id']));}else{logger[_0xf2ff('0x26')](util[_0xf2ff('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xadc34b[_0xf2ff('0x25')],_0xadc34b['id']),util[_0xf2ff('0x27')](_0xb98e06,{'showHidden':![],'depth':null}));}return _0x269f91(null,_0x34da1d);})[_0xf2ff('0x28')](function(_0x5285c5){logger[_0xf2ff('0x26')](util[_0xf2ff('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xadc34b['name'],_0xadc34b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x269f91(_0x5285c5);});}else{return _0x269f91(null,_0x34da1d);}},'beforeUpdate':function(_0x178757,_0xb7fbce,_0x213545){if(_0x178757[_0xf2ff('0xc')]('zone')||_0x178757[_0xf2ff('0xc')](_0xf2ff('0x1d'))||_0x178757[_0xf2ff('0xc')](_0xf2ff('0xd'))||_0x178757[_0xf2ff('0xc')](_0xf2ff('0xe'))||_0x178757['changed']('code')||_0x178757[_0xf2ff('0xc')](_0xf2ff('0x10'))){var _0x11605f,_0x5a8ace;_0x11605f=_0x178757[_0xf2ff('0x1d')];var _0x42c64e=_0x11605f[_0xf2ff('0x11')](-0x1);if(_0x42c64e==='/'||_0x42c64e==='\x5c'||_0x42c64e===':'){_0x11605f=_0x11605f[_0xf2ff('0x12')](0x0,_0x11605f[_0xf2ff('0x13')](_0x42c64e));}switch(_0x178757[_0xf2ff('0x14')]){case'US':_0x5a8ace=_0xf2ff('0x15');break;case'AU':_0x5a8ace=_0xf2ff('0x16');break;case'IN':_0x5a8ace=_0xf2ff('0x17');break;case'CN':_0x5a8ace='https://accounts.zoho.com.cn';break;default:_0x5a8ace=_0xf2ff('0x19');break;}var _0x1d51c9={'method':_0xf2ff('0x1a'),'uri':_0x5a8ace+_0xf2ff('0x1b'),'form':{'grant_type':_0xf2ff('0x1c'),'client_id':_0x178757[_0xf2ff('0xd')],'client_secret':_0x178757[_0xf2ff('0xe')],'redirect_uri':_0x178757[_0xf2ff('0x1d')],'code':_0x178757[_0xf2ff('0xf')]},'headers':{'Content-Type':_0xf2ff('0x1e')}};return rp(_0x1d51c9)[_0xf2ff('0x1f')](function(_0x373b48){var _0x11a863=JSON[_0xf2ff('0x20')](_0x373b48);if(_0x11a863[_0xf2ff('0x21')]){_0x178757[_0xf2ff('0x29')]=_0x11a863[_0xf2ff('0x21')];logger['info'](util[_0xf2ff('0x23')](_0xf2ff('0x24'),_0x178757[_0xf2ff('0x25')],_0x178757['id']));}else{logger[_0xf2ff('0x26')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x178757[_0xf2ff('0x25')],_0x178757['id']),util[_0xf2ff('0x27')](_0x11a863,{'showHidden':![],'depth':null}));}return _0x213545(null,_0xb7fbce);})[_0xf2ff('0x28')](function(_0x482a87){logger[_0xf2ff('0x26')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x178757['name'],_0x178757['id']),util[_0xf2ff('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x213545(_0x482a87);});}else{return _0x213545(null,_0xb7fbce);}}}});}; \ No newline at end of file +var _0x26a2=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','https://accounts.zoho.eu','authorization_code','lodash'];(function(_0x39b3fe,_0x169336){var _0x5234e4=function(_0x31b337){while(--_0x31b337){_0x39b3fe['push'](_0x39b3fe['shift']());}};_0x5234e4(++_0x169336);}(_0x26a2,0x125));var _0x226a=function(_0x252943,_0x21fb5e){_0x252943=_0x252943-0x0;var _0x36bb91=_0x26a2[_0x252943];return _0x36bb91;};'use strict';var _=require(_0x226a('0x0'));var util=require('util');var logger=require(_0x226a('0x1'))(_0x226a('0x2'));var moment=require('moment');var BPromise=require(_0x226a('0x3'));var rp=require(_0x226a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x226a('0x5'));var config=require(_0x226a('0x6'));var attributes=require(_0x226a('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x226a('0x8')]=function(_0x52db37,_0x4f58be){return _0x52db37[_0x226a('0x9')](_0x226a('0xa'),attributes,{'tableName':_0x226a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d7b9f,_0x167fb8,_0x37f58e){if(_0x3d7b9f['changed'](_0x226a('0xc'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0xe'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0xf'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0x10'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0x11'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0x12'))){var _0x8694fe,_0x4be879;_0x8694fe=_0x3d7b9f['serverUrl'];var _0x467a9d=_0x8694fe[_0x226a('0x13')](-0x1);if(_0x467a9d==='/'||_0x467a9d==='\x5c'||_0x467a9d===':'){_0x8694fe=_0x8694fe[_0x226a('0x14')](0x0,_0x8694fe['lastIndexOf'](_0x467a9d));}switch(_0x3d7b9f[_0x226a('0xc')]){case'US':_0x4be879=_0x226a('0x15');break;case'AU':_0x4be879=_0x226a('0x16');break;case'IN':_0x4be879=_0x226a('0x17');break;case'CN':_0x4be879=_0x226a('0x18');break;default:_0x4be879='https://accounts.zoho.eu';break;}var _0x15a150={'method':_0x226a('0x19'),'uri':_0x4be879+_0x226a('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x3d7b9f[_0x226a('0xf')],'client_secret':_0x3d7b9f[_0x226a('0x10')],'redirect_uri':_0x3d7b9f[_0x226a('0xe')],'code':_0x3d7b9f[_0x226a('0x11')]},'headers':{'Content-Type':_0x226a('0x1b')}};return rp(_0x15a150)[_0x226a('0x1c')](function(_0x14801b){var _0x2538fe=JSON[_0x226a('0x1d')](_0x14801b);if(_0x2538fe[_0x226a('0x1e')]){_0x3d7b9f[_0x226a('0x1f')]=_0x2538fe[_0x226a('0x1e')];logger[_0x226a('0x20')](util[_0x226a('0x21')](_0x226a('0x22'),_0x3d7b9f['name'],_0x3d7b9f['id']));}else{logger['error'](util[_0x226a('0x21')](_0x226a('0x23'),_0x3d7b9f[_0x226a('0x24')],_0x3d7b9f['id']),util[_0x226a('0x25')](_0x2538fe,{'showHidden':![],'depth':null}));}return _0x37f58e(null,_0x167fb8);})[_0x226a('0x26')](function(_0x30e655){logger[_0x226a('0x27')](util['format'](_0x226a('0x23'),_0x3d7b9f['name'],_0x3d7b9f['id']),util[_0x226a('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x37f58e(_0x30e655);});}else{return _0x37f58e(null,_0x167fb8);}},'beforeUpdate':function(_0xa441d1,_0x2e00f0,_0x37dd20){if(_0xa441d1['changed'](_0x226a('0xc'))||_0xa441d1[_0x226a('0xd')](_0x226a('0xe'))||_0xa441d1[_0x226a('0xd')](_0x226a('0xf'))||_0xa441d1[_0x226a('0xd')](_0x226a('0x10'))||_0xa441d1[_0x226a('0xd')](_0x226a('0x11'))||_0xa441d1['changed'](_0x226a('0x12'))){var _0x39f1e9,_0x110a86;_0x39f1e9=_0xa441d1[_0x226a('0xe')];var _0x312614=_0x39f1e9[_0x226a('0x13')](-0x1);if(_0x312614==='/'||_0x312614==='\x5c'||_0x312614===':'){_0x39f1e9=_0x39f1e9[_0x226a('0x14')](0x0,_0x39f1e9['lastIndexOf'](_0x312614));}switch(_0xa441d1[_0x226a('0xc')]){case'US':_0x110a86=_0x226a('0x15');break;case'AU':_0x110a86=_0x226a('0x16');break;case'IN':_0x110a86=_0x226a('0x17');break;case'CN':_0x110a86='https://accounts.zoho.com.cn';break;default:_0x110a86=_0x226a('0x28');break;}var _0x1fcd98={'method':_0x226a('0x19'),'uri':_0x110a86+'/oauth/v2/token','form':{'grant_type':_0x226a('0x29'),'client_id':_0xa441d1[_0x226a('0xf')],'client_secret':_0xa441d1['clientSecret'],'redirect_uri':_0xa441d1[_0x226a('0xe')],'code':_0xa441d1['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1fcd98)[_0x226a('0x1c')](function(_0x511f08){var _0x36329c=JSON[_0x226a('0x1d')](_0x511f08);if(_0x36329c[_0x226a('0x1e')]){_0xa441d1[_0x226a('0x1f')]=_0x36329c[_0x226a('0x1e')];logger[_0x226a('0x20')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xa441d1[_0x226a('0x24')],_0xa441d1['id']));}else{logger[_0x226a('0x27')](util[_0x226a('0x21')](_0x226a('0x23'),_0xa441d1[_0x226a('0x24')],_0xa441d1['id']),util[_0x226a('0x25')](_0x36329c,{'showHidden':![],'depth':null}));}return _0x37dd20(null,_0x2e00f0);})[_0x226a('0x26')](function(_0x1b298c){logger[_0x226a('0x27')](util[_0x226a('0x21')](_0x226a('0x23'),_0xa441d1[_0x226a('0x24')],_0xa441d1['id']),util[_0x226a('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x37dd20(_0x1b298c);});}else{return _0x37dd20(null,_0x2e00f0);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8363df5..c60d42e 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 _0x3e94=['stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','map','include','model','find','ShowZohoAccount'];(function(_0x50b16c,_0x30ae9a){var _0x18f7b4=function(_0x317812){while(--_0x317812){_0x50b16c['push'](_0x50b16c['shift']());}};_0x18f7b4(++_0x30ae9a);}(_0x3e94,0x67));var _0x43e9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3e94[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require('moment');var BPromise=require(_0x43e9('0x2'));var rs=require(_0x43e9('0x3'));var fs=require('fs');var Redis=require(_0x43e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e9('0x5'));var logger=require(_0x43e9('0x6'))(_0x43e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x43e9('0x8'));var client=jayson['client'][_0x43e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b35f1,_0x1183a0,_0x2989fe){return new BPromise(function(_0x287aaf,_0x510ee7){return client[_0x43e9('0xa')](_0x4b35f1,_0x2989fe)[_0x43e9('0xb')](function(_0x43d6e8){logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));logger[_0x43e9('0xf')](_0x43e9('0x10'),_0x1183a0,_0x43e9('0xe'),JSON['stringify'](_0x43d6e8));if(_0x43d6e8[_0x43e9('0x11')]){if(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x12')]===0x1f4){logger['error'](_0x43e9('0xd'),_0x1183a0,_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);return _0x510ee7(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1183a0,_0x43d6e8[_0x43e9('0x11')]['message']);return _0x287aaf(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}else{logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));_0x287aaf(_0x43d6e8[_0x43e9('0x14')][_0x43e9('0x13')]);}})[_0x43e9('0x15')](function(_0x3f7164){logger[_0x43e9('0x11')](_0x43e9('0xd'),_0x1183a0,_0x3f7164);_0x510ee7(_0x3f7164);});});}exports[_0x43e9('0x16')]=function(_0x310476){var _0x31614e=this;return new Promise(function(_0x527d97,_0x4e9fef){return db[_0x43e9('0x17')][_0x43e9('0x18')]({'raw':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')][_0x43e9('0x1a')]===undefined?!![]:![]:!![],'where':_0x310476['options']?_0x310476[_0x43e9('0x19')]['where']||null:null,'attributes':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')][_0x43e9('0x1b')]||null:null,'limit':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')]['limit']||null:null,'include':_0x310476[_0x43e9('0x19')]?_0x310476[_0x43e9('0x19')]['include']?_[_0x43e9('0x1c')](_0x310476[_0x43e9('0x19')][_0x43e9('0x1d')],function(_0x6e609b){return{'model':db[_0x6e609b['model']],'as':_0x6e609b['as'],'attributes':_0x6e609b[_0x43e9('0x1b')],'include':_0x6e609b['include']?_[_0x43e9('0x1c')](_0x6e609b['include'],function(_0x486539){return{'model':db[_0x486539['model']],'as':_0x486539['as'],'attributes':_0x486539['attributes'],'include':_0x486539[_0x43e9('0x1d')]?_['map'](_0x486539[_0x43e9('0x1d')],function(_0xf0dbbf){return{'model':db[_0xf0dbbf[_0x43e9('0x1e')]],'as':_0xf0dbbf['as'],'attributes':_0xf0dbbf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xf64426){logger['info']('GetZohoAccount',_0x310476);logger[_0x43e9('0xf')]('GetZohoAccount',_0x310476,JSON['stringify'](_0xf64426));_0x527d97(_0xf64426);})['catch'](function(_0x197c88){logger[_0x43e9('0x11')]('GetZohoAccount',_0x197c88[_0x43e9('0x13')],_0x310476);_0x4e9fef(_0x31614e['error'](0x1f4,_0x197c88[_0x43e9('0x13')]));});});};exports['ShowZohoAccount']=function(_0x24dfff){var _0x580bd0=this;return new Promise(function(_0x4cd81b,_0x128b56){return db[_0x43e9('0x17')][_0x43e9('0x1f')]({'raw':_0x24dfff[_0x43e9('0x19')]?_0x24dfff[_0x43e9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x24dfff[_0x43e9('0x19')]?_0x24dfff['options']['where']||null:null,'attributes':_0x24dfff[_0x43e9('0x19')]?_0x24dfff[_0x43e9('0x19')][_0x43e9('0x1b')]||null:null,'include':_0x24dfff[_0x43e9('0x19')]?_0x24dfff['options'][_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x24dfff[_0x43e9('0x19')][_0x43e9('0x1d')],function(_0x55ea93){return{'model':db[_0x55ea93[_0x43e9('0x1e')]],'as':_0x55ea93['as'],'attributes':_0x55ea93[_0x43e9('0x1b')],'include':_0x55ea93[_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x55ea93[_0x43e9('0x1d')],function(_0x3599e5){return{'model':db[_0x3599e5[_0x43e9('0x1e')]],'as':_0x3599e5['as'],'attributes':_0x3599e5['attributes'],'include':_0x3599e5[_0x43e9('0x1d')]?_[_0x43e9('0x1c')](_0x3599e5[_0x43e9('0x1d')],function(_0x42b436){return{'model':db[_0x42b436[_0x43e9('0x1e')]],'as':_0x42b436['as'],'attributes':_0x42b436['attributes']};}):[]};}):[]};}):[]:[]})[_0x43e9('0xb')](function(_0x238998){logger[_0x43e9('0xc')]('ShowZohoAccount',_0x24dfff);logger[_0x43e9('0xf')](_0x43e9('0x20'),_0x24dfff,JSON[_0x43e9('0x21')](_0x238998));_0x4cd81b(_0x238998);})[_0x43e9('0x15')](function(_0x133fc7){logger['error'](_0x43e9('0x20'),_0x133fc7[_0x43e9('0x13')],_0x24dfff);_0x128b56(_0x580bd0[_0x43e9('0x11')](0x1f4,_0x133fc7[_0x43e9('0x13')]));});});}; \ No newline at end of file +var _0xb7e2=['catch','ZohoAccount','findAll','options','raw','include','map','model','attributes','GetZohoAccount','debug','ShowZohoAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x858755,_0x4a70cf){var _0x2203d0=function(_0x469ac5){while(--_0x469ac5){_0x858755['push'](_0x858755['shift']());}};_0x2203d0(++_0x4a70cf);}(_0xb7e2,0x103));var _0x2b7e=function(_0x549164,_0x7c943){_0x549164=_0x549164-0x0;var _0x50def4=_0xb7e2[_0x549164];return _0x50def4;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('ZohoAccount,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});}exports['GetZohoAccount']=function(_0x16d389){var _0x33b038=this;return new Promise(function(_0x726509,_0x56d349){return db[_0x2b7e('0x16')][_0x2b7e('0x17')]({'raw':_0x16d389[_0x2b7e('0x18')]?_0x16d389[_0x2b7e('0x18')][_0x2b7e('0x19')]===undefined?!![]:![]:!![],'where':_0x16d389['options']?_0x16d389[_0x2b7e('0x18')]['where']||null:null,'attributes':_0x16d389['options']?_0x16d389[_0x2b7e('0x18')]['attributes']||null:null,'limit':_0x16d389[_0x2b7e('0x18')]?_0x16d389[_0x2b7e('0x18')]['limit']||null:null,'include':_0x16d389[_0x2b7e('0x18')]?_0x16d389['options'][_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x16d389['options']['include'],function(_0x3548e3){return{'model':db[_0x3548e3[_0x2b7e('0x1c')]],'as':_0x3548e3['as'],'attributes':_0x3548e3[_0x2b7e('0x1d')],'include':_0x3548e3[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x3548e3[_0x2b7e('0x1a')],function(_0x41b68b){return{'model':db[_0x41b68b[_0x2b7e('0x1c')]],'as':_0x41b68b['as'],'attributes':_0x41b68b[_0x2b7e('0x1d')],'include':_0x41b68b[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x41b68b[_0x2b7e('0x1a')],function(_0x19824e){return{'model':db[_0x19824e[_0x2b7e('0x1c')]],'as':_0x19824e['as'],'attributes':_0x19824e['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b7e('0xb')](function(_0x18dd64){logger[_0x2b7e('0xc')](_0x2b7e('0x1e'),_0x16d389);logger[_0x2b7e('0x1f')]('GetZohoAccount',_0x16d389,JSON[_0x2b7e('0x10')](_0x18dd64));_0x726509(_0x18dd64);})[_0x2b7e('0x15')](function(_0x5871ac){logger[_0x2b7e('0x11')]('GetZohoAccount',_0x5871ac[_0x2b7e('0x13')],_0x16d389);_0x56d349(_0x33b038['error'](0x1f4,_0x5871ac[_0x2b7e('0x13')]));});});};exports[_0x2b7e('0x20')]=function(_0x1f6c89){var _0xfbac54=this;return new Promise(function(_0x54adce,_0xa78818){return db[_0x2b7e('0x16')][_0x2b7e('0x21')]({'raw':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x19')]===undefined?!![]:![]:!![],'where':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89['options'][_0x2b7e('0x22')]||null:null,'attributes':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89[_0x2b7e('0x18')]['attributes']||null:null,'include':_0x1f6c89['options']?_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x1a')],function(_0x1ce9d4){return{'model':db[_0x1ce9d4[_0x2b7e('0x1c')]],'as':_0x1ce9d4['as'],'attributes':_0x1ce9d4['attributes'],'include':_0x1ce9d4[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x1ce9d4[_0x2b7e('0x1a')],function(_0xd97f2a){return{'model':db[_0xd97f2a[_0x2b7e('0x1c')]],'as':_0xd97f2a['as'],'attributes':_0xd97f2a['attributes'],'include':_0xd97f2a[_0x2b7e('0x1a')]?_['map'](_0xd97f2a['include'],function(_0x2b11f2){return{'model':db[_0x2b11f2['model']],'as':_0x2b11f2['as'],'attributes':_0x2b11f2[_0x2b7e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3793c1){logger['info'](_0x2b7e('0x20'),_0x1f6c89);logger[_0x2b7e('0x1f')](_0x2b7e('0x20'),_0x1f6c89,JSON['stringify'](_0x3793c1));_0x54adce(_0x3793c1);})[_0x2b7e('0x15')](function(_0x2b6f0d){logger[_0x2b7e('0x11')]('ShowZohoAccount',_0x2b6f0d['message'],_0x1f6c89);_0xa78818(_0xfbac54['error'](0x1f4,_0x2b6f0d[_0x2b7e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 47706d8..b9b6466 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 _0xed80=['../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x57aa6a,_0x26a3ff){var _0x378d4a=function(_0x399f6c){while(--_0x399f6c){_0x57aa6a['push'](_0x57aa6a['shift']());}};_0x378d4a(++_0x26a3ff);}(_0xed80,0x100));var _0x0ed8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xed80[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x0ed8('0x0'));var path=require(_0x0ed8('0x1'));var timeout=require(_0x0ed8('0x2'));var express=require(_0x0ed8('0x3'));var router=express[_0x0ed8('0x4')]();var fs_extra=require(_0x0ed8('0x5'));var auth=require(_0x0ed8('0x6'));var interaction=require(_0x0ed8('0x7'));var config=require(_0x0ed8('0x8'));var controller=require(_0x0ed8('0x9'));router[_0x0ed8('0xa')]('/',auth['isAuthenticated'](),controller[_0x0ed8('0xb')]);router[_0x0ed8('0xa')](_0x0ed8('0xc'),auth[_0x0ed8('0xd')](),controller[_0x0ed8('0xe')]);router[_0x0ed8('0xa')]('/:id/fields',auth[_0x0ed8('0xd')](),controller[_0x0ed8('0xf')]);router[_0x0ed8('0xa')](_0x0ed8('0x10'),auth[_0x0ed8('0xd')](),controller[_0x0ed8('0x11')]);router[_0x0ed8('0xa')](_0x0ed8('0x12'),auth[_0x0ed8('0xd')](),controller[_0x0ed8('0x13')]);router[_0x0ed8('0x14')]('/',auth[_0x0ed8('0xd')](),controller[_0x0ed8('0x15')]);router['put']('/:id',auth[_0x0ed8('0xd')](),controller[_0x0ed8('0x16')]);router['delete'](_0x0ed8('0xc'),auth['isAuthenticated'](),controller[_0x0ed8('0x17')]);module['exports']=router; \ No newline at end of file +var _0xf2ec=['/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x54ffa3,_0xb59905){var _0x223eda=function(_0x54a3a2){while(--_0x54a3a2){_0x54ffa3['push'](_0x54ffa3['shift']());}};_0x223eda(++_0xb59905);}(_0xf2ec,0xbb));var _0xcf2e=function(_0x4528dc,_0x3227bf){_0x4528dc=_0x4528dc-0x0;var _0x419381=_0xf2ec[_0x4528dc];return _0x419381;};'use strict';var multer=require(_0xcf2e('0x0'));var util=require(_0xcf2e('0x1'));var path=require(_0xcf2e('0x2'));var timeout=require(_0xcf2e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcf2e('0x4'));var auth=require(_0xcf2e('0x5'));var interaction=require(_0xcf2e('0x6'));var config=require('../../config/environment');var controller=require(_0xcf2e('0x7'));router[_0xcf2e('0x8')]('/',auth[_0xcf2e('0x9')](),controller[_0xcf2e('0xa')]);router[_0xcf2e('0x8')](_0xcf2e('0xb'),auth[_0xcf2e('0x9')](),controller[_0xcf2e('0xc')]);router[_0xcf2e('0x8')](_0xcf2e('0xd'),auth['isAuthenticated'](),controller[_0xcf2e('0xe')]);router['get']('/:id/subjects',auth[_0xcf2e('0x9')](),controller[_0xcf2e('0xf')]);router[_0xcf2e('0x8')](_0xcf2e('0x10'),auth['isAuthenticated'](),controller[_0xcf2e('0x11')]);router[_0xcf2e('0x12')]('/',auth[_0xcf2e('0x9')](),controller['create']);router[_0xcf2e('0x13')](_0xcf2e('0xb'),auth[_0xcf2e('0x9')](),controller[_0xcf2e('0x14')]);router['delete']('/:id',auth[_0xcf2e('0x9')](),controller[_0xcf2e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 7f8dd6a..1722ab7 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 _0x9ccf=['ENUM','contact','contact_lead','sequelize','exports','STRING'];(function(_0x5e33ec,_0x13818f){var _0x59bd6f=function(_0x425960){while(--_0x425960){_0x5e33ec['push'](_0x5e33ec['shift']());}};_0x59bd6f(++_0x13818f);}(_0x9ccf,0x111));var _0xf9cc=function(_0x5c2e21,_0x57790e){_0x5c2e21=_0x5c2e21-0x0;var _0x43624a=_0x9ccf[_0x5c2e21];return _0x43624a;};'use strict';var Sequelize=require(_0xf9cc('0x0'));module[_0xf9cc('0x1')]={'name':{'type':Sequelize[_0xf9cc('0x2')]},'moduleCreate':{'type':Sequelize[_0xf9cc('0x3')]('lead',_0xf9cc('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xf9cc('0x5'),_0xf9cc('0x4'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xf9cc('0x2')]}}; \ No newline at end of file +var _0x8169=['nothing','lead','sequelize','STRING','contact'];(function(_0x39ebd9,_0x2ef11a){var _0x8a6176=function(_0x405b7c){while(--_0x405b7c){_0x39ebd9['push'](_0x39ebd9['shift']());}};_0x8a6176(++_0x2ef11a);}(_0x8169,0xd4));var _0x9816=function(_0x4f1a44,_0x1ab56d){_0x4f1a44=_0x4f1a44-0x0;var _0x463feb=_0x8169[_0x4f1a44];return _0x463feb;};'use strict';var Sequelize=require(_0x9816('0x0'));module['exports']={'name':{'type':Sequelize[_0x9816('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x9816('0x2'),_0x9816('0x3')),'defaultValue':_0x9816('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x9816('0x2'),_0x9816('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x9816('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 755c435..043eabc 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 _0x1161=['send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ZohoConfiguration','then','includeAll','findAll','rows','show','params','include','find','create','body','update','catch','destroy','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','sendStatus','error','stack','name'];(function(_0x11fc38,_0x560ade){var _0x26c64b=function(_0x2464b5){while(--_0x2464b5){_0x11fc38['push'](_0x11fc38['shift']());}};_0x26c64b(++_0x560ade);}(_0x1161,0x79));var _0x1116=function(_0x1adfd2,_0x3aa59d){_0x1adfd2=_0x1adfd2-0x0;var _0x298376=_0x1161[_0x1adfd2];return _0x298376;};'use strict';var emlformat=require(_0x1116('0x0'));var rimraf=require(_0x1116('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1116('0x2'));var moment=require(_0x1116('0x3'));var BPromise=require(_0x1116('0x4'));var Mustache=require(_0x1116('0x5'));var util=require(_0x1116('0x6'));var path=require(_0x1116('0x7'));var sox=require('sox');var csv=require(_0x1116('0x8'));var ejs=require(_0x1116('0x9'));var fs=require('fs');var fs_extra=require(_0x1116('0xa'));var _=require(_0x1116('0xb'));var squel=require('squel');var crypto=require(_0x1116('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1116('0x8'));var querystring=require(_0x1116('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1116('0xe'));var qs=require(_0x1116('0xf'));var as=require(_0x1116('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1116('0x11'));var utils=require('../../config/utils');var config=require(_0x1116('0x12'));var licenseUtil=require(_0x1116('0x13'));var db=require(_0x1116('0x14'))['db'];function respondWithStatusCode(_0x1ea6d8,_0x26d524){_0x26d524=_0x26d524||0xcc;return function(_0x2aaeb8){if(_0x2aaeb8){return _0x1ea6d8['sendStatus'](_0x26d524);}return _0x1ea6d8[_0x1116('0x15')](_0x26d524)[_0x1116('0x16')]();};}function respondWithResult(_0x4e137c,_0x23c979){_0x23c979=_0x23c979||0xc8;return function(_0x12c430){if(_0x12c430){return _0x4e137c[_0x1116('0x15')](_0x23c979)['json'](_0x12c430);}};}function respondWithFilteredResult(_0x35f51e,_0x37432e){return function(_0x1c97b7){if(_0x1c97b7){var _0x35854f=typeof _0x37432e[_0x1116('0x17')]===_0x1116('0x18')&&typeof _0x37432e[_0x1116('0x19')]==='undefined';var _0x53ce03=_0x1c97b7[_0x1116('0x1a')];var _0x2b80be=_0x35854f?0x0:_0x37432e[_0x1116('0x17')];var _0x1d0fd1=_0x35854f?_0x1c97b7[_0x1116('0x1a')]:_0x37432e['offset']+_0x37432e[_0x1116('0x19')];var _0x389a7b;if(_0x1d0fd1>=_0x53ce03){_0x1d0fd1=_0x53ce03;_0x389a7b=0xc8;}else{_0x389a7b=0xce;}_0x35f51e['status'](_0x389a7b);return _0x35f51e['set'](_0x1116('0x1b'),_0x2b80be+'-'+_0x1d0fd1+'/'+_0x53ce03)['json'](_0x1c97b7);}return null;};}function patchUpdates(_0x1e9c64){return function(_0x1831f9){try{jsonpatch[_0x1116('0x1c')](_0x1831f9,_0x1e9c64,!![]);}catch(_0x46d0c0){return BPromise[_0x1116('0x1d')](_0x46d0c0);}return _0x1831f9[_0x1116('0x1e')]();};}function saveUpdates(_0x2dcd6b,_0x2fb18d){return function(_0x2a4ae9){if(_0x2a4ae9){return _0x2a4ae9['update'](_0x2dcd6b)['then'](function(_0x5e4b08){return _0x5e4b08;});}return null;};}function removeEntity(_0x2d3311,_0x4cc74b){return function(_0x5f4d20){if(_0x5f4d20){return _0x5f4d20['destroy']()['then'](function(){_0x2d3311[_0x1116('0x15')](0xcc)[_0x1116('0x16')]();});}};}function handleEntityNotFound(_0x33c017,_0x447db7){return function(_0x8763d7){if(!_0x8763d7){_0x33c017[_0x1116('0x1f')](0x194);}return _0x8763d7;};}function handleError(_0xc7b463,_0x3c2299){_0x3c2299=_0x3c2299||0x1f4;return function(_0x525511){logger[_0x1116('0x20')](_0x525511[_0x1116('0x21')]);if(_0x525511['name']){delete _0x525511[_0x1116('0x22')];}_0xc7b463[_0x1116('0x15')](_0x3c2299)[_0x1116('0x23')](_0x525511);};}exports[_0x1116('0x24')]=function(_0x263279,_0x1ec6bd){var _0xf12080={},_0x40a472={},_0x4d1729={'count':0x0,'rows':[]};var _0x38289a=_[_0x1116('0x25')](db['ZohoConfiguration'][_0x1116('0x26')],function(_0x516998){return{'name':_0x516998['fieldName'],'type':_0x516998['type'][_0x1116('0x27')]};});_0x40a472[_0x1116('0x28')]=_[_0x1116('0x25')](_0x38289a,_0x1116('0x22'));_0x40a472[_0x1116('0x29')]=_[_0x1116('0x2a')](_0x263279[_0x1116('0x29')]);_0x40a472[_0x1116('0x2b')]=_[_0x1116('0x2c')](_0x40a472[_0x1116('0x28')],_0x40a472['query']);_0xf12080[_0x1116('0x2d')]=_[_0x1116('0x2c')](_0x40a472[_0x1116('0x28')],qs['fields'](_0x263279['query'][_0x1116('0x2e')]));_0xf12080[_0x1116('0x2d')]=_0xf12080[_0x1116('0x2d')][_0x1116('0x2f')]?_0xf12080[_0x1116('0x2d')]:_0x40a472[_0x1116('0x28')];if(!_0x263279[_0x1116('0x29')][_0x1116('0x30')](_0x1116('0x31'))){_0xf12080[_0x1116('0x19')]=qs[_0x1116('0x19')](_0x263279[_0x1116('0x29')]['limit']);_0xf12080[_0x1116('0x17')]=qs[_0x1116('0x17')](_0x263279[_0x1116('0x29')][_0x1116('0x17')]);}_0xf12080[_0x1116('0x32')]=qs[_0x1116('0x33')](_0x263279['query'][_0x1116('0x33')]);_0xf12080[_0x1116('0x34')]=qs[_0x1116('0x2b')](_[_0x1116('0x35')](_0x263279['query'],_0x40a472['filters']),_0x38289a);if(_0x263279[_0x1116('0x29')][_0x1116('0x36')]){_0xf12080[_0x1116('0x34')]=_[_0x1116('0x37')](_0xf12080[_0x1116('0x34')],{'$or':_[_0x1116('0x25')](_0x38289a,function(_0x13e2a1){if(_0x13e2a1[_0x1116('0x38')]!==_0x1116('0x39')){var _0x43a8ab={};_0x43a8ab[_0x13e2a1[_0x1116('0x22')]]={'$like':'%'+_0x263279[_0x1116('0x29')][_0x1116('0x36')]+'%'};return _0x43a8ab;}})});}_0xf12080=_['merge']({},_0xf12080,_0x263279[_0x1116('0x3a')]);var _0x235a1b={'where':_0xf12080[_0x1116('0x34')]};return db[_0x1116('0x3b')][_0x1116('0x1a')](_0x235a1b)[_0x1116('0x3c')](function(_0x3804b2){_0x4d1729[_0x1116('0x1a')]=_0x3804b2;if(_0x263279[_0x1116('0x29')][_0x1116('0x3d')]){_0xf12080['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x1116('0x3e')](_0xf12080);})[_0x1116('0x3c')](function(_0x366430){_0x4d1729[_0x1116('0x3f')]=_0x366430;return _0x4d1729;})[_0x1116('0x3c')](respondWithFilteredResult(_0x1ec6bd,_0xf12080))['catch'](handleError(_0x1ec6bd,null));};exports[_0x1116('0x40')]=function(_0x3041c1,_0x1c7e80){var _0x39171f={'raw':![],'where':{'id':_0x3041c1[_0x1116('0x41')]['id']}},_0x5207e0={};_0x5207e0['model']=_[_0x1116('0x2a')](db['ZohoConfiguration']['rawAttributes']);_0x5207e0[_0x1116('0x29')]=_[_0x1116('0x2a')](_0x3041c1[_0x1116('0x29')]);_0x5207e0[_0x1116('0x2b')]=_[_0x1116('0x2c')](_0x5207e0[_0x1116('0x28')],_0x5207e0[_0x1116('0x29')]);_0x39171f[_0x1116('0x2d')]=_[_0x1116('0x2c')](_0x5207e0[_0x1116('0x28')],qs[_0x1116('0x2e')](_0x3041c1['query'][_0x1116('0x2e')]));_0x39171f['attributes']=_0x39171f[_0x1116('0x2d')][_0x1116('0x2f')]?_0x39171f[_0x1116('0x2d')]:_0x5207e0[_0x1116('0x28')];if(_0x3041c1[_0x1116('0x29')][_0x1116('0x3d')]){_0x39171f[_0x1116('0x42')]=[{'all':!![]}];}_0x39171f=_[_0x1116('0x37')]({},_0x39171f,_0x3041c1[_0x1116('0x3a')]);return db[_0x1116('0x3b')][_0x1116('0x43')](_0x39171f)['then'](handleEntityNotFound(_0x1c7e80,null))[_0x1116('0x3c')](respondWithResult(_0x1c7e80,null))['catch'](handleError(_0x1c7e80,null));};exports[_0x1116('0x44')]=function(_0x284084,_0x3861af){return db['ZohoConfiguration'][_0x1116('0x44')](_0x284084[_0x1116('0x45')],{})[_0x1116('0x3c')](respondWithResult(_0x3861af,0xc9))['catch'](handleError(_0x3861af,null));};exports[_0x1116('0x46')]=function(_0x52f7b2,_0x1361c0){if(_0x52f7b2['body']['id']){delete _0x52f7b2[_0x1116('0x45')]['id'];}return db[_0x1116('0x3b')]['find']({'where':{'id':_0x52f7b2[_0x1116('0x41')]['id']}})['then'](handleEntityNotFound(_0x1361c0,null))['then'](saveUpdates(_0x52f7b2[_0x1116('0x45')],null))[_0x1116('0x3c')](respondWithResult(_0x1361c0,null))[_0x1116('0x47')](handleError(_0x1361c0,null));};exports[_0x1116('0x48')]=function(_0x595fe6,_0x29d97e){return db[_0x1116('0x3b')][_0x1116('0x43')]({'where':{'id':_0x595fe6[_0x1116('0x41')]['id']}})[_0x1116('0x3c')](handleEntityNotFound(_0x29d97e,null))[_0x1116('0x3c')](removeEntity(_0x29d97e,null))[_0x1116('0x47')](handleError(_0x29d97e,null));};exports[_0x1116('0x49')]=function(_0x5e015e,_0x31a0aa,_0x342c6c){var _0x16a55f={};var _0x214cae={};var _0x422e19;var _0xac7270;return db[_0x1116('0x3b')][_0x1116('0x4a')]({'where':{'id':_0x5e015e['params']['id']}})[_0x1116('0x3c')](handleEntityNotFound(_0x31a0aa,null))['then'](function(_0x2e3cc4){if(_0x2e3cc4){_0x422e19=_0x2e3cc4;_0x214cae[_0x1116('0x28')]=_[_0x1116('0x2a')](db[_0x1116('0x4b')]['rawAttributes']);_0x214cae['query']=_[_0x1116('0x2a')](_0x5e015e[_0x1116('0x29')]);_0x214cae['filters']=_[_0x1116('0x2c')](_0x214cae[_0x1116('0x28')],_0x214cae[_0x1116('0x29')]);_0x16a55f[_0x1116('0x2d')]=_[_0x1116('0x2c')](_0x214cae[_0x1116('0x28')],qs['fields'](_0x5e015e[_0x1116('0x29')]['fields']));_0x16a55f['attributes']=_0x16a55f[_0x1116('0x2d')]['length']?_0x16a55f[_0x1116('0x2d')]:_0x214cae[_0x1116('0x28')];_0x16a55f[_0x1116('0x32')]=qs[_0x1116('0x33')](_0x5e015e[_0x1116('0x29')][_0x1116('0x33')]);_0x16a55f[_0x1116('0x34')]=qs['filters'](_[_0x1116('0x35')](_0x5e015e['query'],_0x214cae[_0x1116('0x2b')]));if(_0x5e015e[_0x1116('0x29')][_0x1116('0x36')]){_0x16a55f[_0x1116('0x34')]=_[_0x1116('0x37')](_0x16a55f[_0x1116('0x34')],{'$or':_[_0x1116('0x25')](_0x16a55f[_0x1116('0x2d')],function(_0x1f927e){var _0x1ee71f={};_0x1ee71f[_0x1f927e]={'$like':'%'+_0x5e015e[_0x1116('0x29')]['filter']+'%'};return _0x1ee71f;})});}_0x16a55f=_['merge']({},_0x16a55f,_0x5e015e[_0x1116('0x3a')]);return _0x422e19[_0x1116('0x49')](_0x16a55f);}})[_0x1116('0x3c')](function(_0x3dacce){if(_0x3dacce){_0xac7270=_0x3dacce[_0x1116('0x2f')];if(!_0x5e015e[_0x1116('0x29')][_0x1116('0x30')](_0x1116('0x31'))){_0x16a55f[_0x1116('0x19')]=qs[_0x1116('0x19')](_0x5e015e[_0x1116('0x29')][_0x1116('0x19')]);_0x16a55f[_0x1116('0x17')]=qs[_0x1116('0x17')](_0x5e015e['query'][_0x1116('0x17')]);}return _0x422e19['getFields'](_0x16a55f);}})[_0x1116('0x3c')](function(_0x33fc99){if(_0x33fc99){return _0x33fc99?{'count':_0xac7270,'rows':_0x33fc99}:null;}})['then'](respondWithResult(_0x31a0aa,null))['catch'](handleError(_0x31a0aa,null));};exports[_0x1116('0x4c')]=function(_0x46806e,_0x1de207,_0x6fd1a2){var _0x5e388f={};var _0x218b0b={};var _0x1355b3;var _0x288721;return db[_0x1116('0x3b')][_0x1116('0x4a')]({'where':{'id':_0x46806e[_0x1116('0x41')]['id']}})[_0x1116('0x3c')](handleEntityNotFound(_0x1de207,null))['then'](function(_0x4cab2c){if(_0x4cab2c){_0x1355b3=_0x4cab2c;_0x218b0b['model']=_[_0x1116('0x2a')](db[_0x1116('0x4b')][_0x1116('0x26')]);_0x218b0b[_0x1116('0x29')]=_[_0x1116('0x2a')](_0x46806e['query']);_0x218b0b['filters']=_[_0x1116('0x2c')](_0x218b0b['model'],_0x218b0b['query']);_0x5e388f[_0x1116('0x2d')]=_[_0x1116('0x2c')](_0x218b0b[_0x1116('0x28')],qs['fields'](_0x46806e[_0x1116('0x29')]['fields']));_0x5e388f['attributes']=_0x5e388f[_0x1116('0x2d')][_0x1116('0x2f')]?_0x5e388f['attributes']:_0x218b0b[_0x1116('0x28')];_0x5e388f[_0x1116('0x32')]=qs[_0x1116('0x33')](_0x46806e[_0x1116('0x29')][_0x1116('0x33')]);_0x5e388f[_0x1116('0x34')]=qs[_0x1116('0x2b')](_[_0x1116('0x35')](_0x46806e[_0x1116('0x29')],_0x218b0b[_0x1116('0x2b')]));if(_0x46806e[_0x1116('0x29')][_0x1116('0x36')]){_0x5e388f[_0x1116('0x34')]=_[_0x1116('0x37')](_0x5e388f[_0x1116('0x34')],{'$or':_['map'](_0x5e388f[_0x1116('0x2d')],function(_0x555840){var _0x5b8d09={};_0x5b8d09[_0x555840]={'$like':'%'+_0x46806e[_0x1116('0x29')][_0x1116('0x36')]+'%'};return _0x5b8d09;})});}_0x5e388f=_[_0x1116('0x37')]({},_0x5e388f,_0x46806e[_0x1116('0x3a')]);return _0x1355b3[_0x1116('0x4c')](_0x5e388f);}})[_0x1116('0x3c')](function(_0x260db2){if(_0x260db2){_0x288721=_0x260db2[_0x1116('0x2f')];if(!_0x46806e[_0x1116('0x29')]['hasOwnProperty'](_0x1116('0x31'))){_0x5e388f[_0x1116('0x19')]=qs[_0x1116('0x19')](_0x46806e[_0x1116('0x29')]['limit']);_0x5e388f[_0x1116('0x17')]=qs[_0x1116('0x17')](_0x46806e[_0x1116('0x29')][_0x1116('0x17')]);}return _0x1355b3[_0x1116('0x4c')](_0x5e388f);}})[_0x1116('0x3c')](function(_0x30a69b){if(_0x30a69b){return _0x30a69b?{'count':_0x288721,'rows':_0x30a69b}:null;}})[_0x1116('0x3c')](respondWithResult(_0x1de207,null))[_0x1116('0x47')](handleError(_0x1de207,null));};exports[_0x1116('0x4d')]=function(_0x33a503,_0x19f2a6,_0x27654d){var _0x1bc4b8={};var _0x2e7531={};var _0x1e702b;var _0xa08c66;return db[_0x1116('0x3b')][_0x1116('0x4a')]({'where':{'id':_0x33a503[_0x1116('0x41')]['id']}})[_0x1116('0x3c')](handleEntityNotFound(_0x19f2a6,null))[_0x1116('0x3c')](function(_0x46ef26){if(_0x46ef26){_0x1e702b=_0x46ef26;_0x2e7531[_0x1116('0x28')]=_[_0x1116('0x2a')](db[_0x1116('0x4b')][_0x1116('0x26')]);_0x2e7531[_0x1116('0x29')]=_[_0x1116('0x2a')](_0x33a503[_0x1116('0x29')]);_0x2e7531['filters']=_['intersection'](_0x2e7531['model'],_0x2e7531[_0x1116('0x29')]);_0x1bc4b8[_0x1116('0x2d')]=_[_0x1116('0x2c')](_0x2e7531['model'],qs[_0x1116('0x2e')](_0x33a503[_0x1116('0x29')]['fields']));_0x1bc4b8['attributes']=_0x1bc4b8[_0x1116('0x2d')]['length']?_0x1bc4b8[_0x1116('0x2d')]:_0x2e7531[_0x1116('0x28')];_0x1bc4b8[_0x1116('0x32')]=qs[_0x1116('0x33')](_0x33a503[_0x1116('0x29')]['sort']);_0x1bc4b8[_0x1116('0x34')]=qs[_0x1116('0x2b')](_[_0x1116('0x35')](_0x33a503[_0x1116('0x29')],_0x2e7531[_0x1116('0x2b')]));if(_0x33a503['query'][_0x1116('0x36')]){_0x1bc4b8[_0x1116('0x34')]=_['merge'](_0x1bc4b8[_0x1116('0x34')],{'$or':_['map'](_0x1bc4b8[_0x1116('0x2d')],function(_0x2ceca7){var _0x312bce={};_0x312bce[_0x2ceca7]={'$like':'%'+_0x33a503[_0x1116('0x29')][_0x1116('0x36')]+'%'};return _0x312bce;})});}_0x1bc4b8=_[_0x1116('0x37')]({},_0x1bc4b8,_0x33a503[_0x1116('0x3a')]);return _0x1e702b['getDescriptions'](_0x1bc4b8);}})[_0x1116('0x3c')](function(_0x5bb6f0){if(_0x5bb6f0){_0xa08c66=_0x5bb6f0[_0x1116('0x2f')];if(!_0x33a503[_0x1116('0x29')][_0x1116('0x30')]('nolimit')){_0x1bc4b8[_0x1116('0x19')]=qs[_0x1116('0x19')](_0x33a503[_0x1116('0x29')][_0x1116('0x19')]);_0x1bc4b8[_0x1116('0x17')]=qs[_0x1116('0x17')](_0x33a503[_0x1116('0x29')][_0x1116('0x17')]);}return _0x1e702b[_0x1116('0x4d')](_0x1bc4b8);}})[_0x1116('0x3c')](function(_0x1fd322){if(_0x1fd322){return _0x1fd322?{'count':_0xa08c66,'rows':_0x1fd322}:null;}})[_0x1116('0x3c')](respondWithResult(_0x19f2a6,null))[_0x1116('0x47')](handleError(_0x19f2a6,null));}; \ No newline at end of file +var _0x2480=['catch','show','params','rawAttributes','keys','includeAll','include','find','create','body','getFields','findOne','nolimit','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoConfiguration','findAll'];(function(_0x41a7d4,_0x409980){var _0x496a94=function(_0x17a65c){while(--_0x17a65c){_0x41a7d4['push'](_0x41a7d4['shift']());}};_0x496a94(++_0x409980);}(_0x2480,0x160));var _0x0248=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2480[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x0248('0x0'));var rimraf=require(_0x0248('0x1'));var zipdir=require(_0x0248('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0248('0x3'));var moment=require(_0x0248('0x4'));var BPromise=require(_0x0248('0x5'));var Mustache=require(_0x0248('0x6'));var util=require(_0x0248('0x7'));var path=require(_0x0248('0x8'));var sox=require(_0x0248('0x9'));var csv=require(_0x0248('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0248('0xb'));var squel=require(_0x0248('0xc'));var crypto=require(_0x0248('0xd'));var jsforce=require(_0x0248('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0248('0xa'));var querystring=require(_0x0248('0xf'));var Papa=require(_0x0248('0x10'));var Redis=require(_0x0248('0x11'));var authService=require(_0x0248('0x12'));var qs=require(_0x0248('0x13'));var as=require(_0x0248('0x14'));var hardwareService=require(_0x0248('0x15'));var logger=require(_0x0248('0x16'))(_0x0248('0x17'));var utils=require(_0x0248('0x18'));var config=require(_0x0248('0x19'));var licenseUtil=require(_0x0248('0x1a'));var db=require(_0x0248('0x1b'))['db'];function respondWithStatusCode(_0x57ed0b,_0x4c2a47){_0x4c2a47=_0x4c2a47||0xcc;return function(_0x2bf650){if(_0x2bf650){return _0x57ed0b['sendStatus'](_0x4c2a47);}return _0x57ed0b[_0x0248('0x1c')](_0x4c2a47)[_0x0248('0x1d')]();};}function respondWithResult(_0x555621,_0x32be75){_0x32be75=_0x32be75||0xc8;return function(_0x33ea62){if(_0x33ea62){return _0x555621[_0x0248('0x1c')](_0x32be75)['json'](_0x33ea62);}};}function respondWithFilteredResult(_0x4d77f7,_0x235605){return function(_0xa547fc){if(_0xa547fc){var _0x110786=typeof _0x235605['offset']===_0x0248('0x1e')&&typeof _0x235605[_0x0248('0x1f')]===_0x0248('0x1e');var _0x4fbdc0=_0xa547fc[_0x0248('0x20')];var _0x4f298c=_0x110786?0x0:_0x235605[_0x0248('0x21')];var _0x2736e1=_0x110786?_0xa547fc[_0x0248('0x20')]:_0x235605[_0x0248('0x21')]+_0x235605[_0x0248('0x1f')];var _0xd25fcc;if(_0x2736e1>=_0x4fbdc0){_0x2736e1=_0x4fbdc0;_0xd25fcc=0xc8;}else{_0xd25fcc=0xce;}_0x4d77f7[_0x0248('0x1c')](_0xd25fcc);return _0x4d77f7['set'](_0x0248('0x22'),_0x4f298c+'-'+_0x2736e1+'/'+_0x4fbdc0)[_0x0248('0x23')](_0xa547fc);}return null;};}function patchUpdates(_0x5c70f4){return function(_0x5a838a){try{jsonpatch[_0x0248('0x24')](_0x5a838a,_0x5c70f4,!![]);}catch(_0x12f15e){return BPromise[_0x0248('0x25')](_0x12f15e);}return _0x5a838a[_0x0248('0x26')]();};}function saveUpdates(_0x69cc0b,_0x50f756){return function(_0x147a7e){if(_0x147a7e){return _0x147a7e[_0x0248('0x27')](_0x69cc0b)[_0x0248('0x28')](function(_0x6437d7){return _0x6437d7;});}return null;};}function removeEntity(_0x13956c,_0x5ad773){return function(_0xa48e7){if(_0xa48e7){return _0xa48e7[_0x0248('0x29')]()[_0x0248('0x28')](function(){_0x13956c[_0x0248('0x1c')](0xcc)[_0x0248('0x1d')]();});}};}function handleEntityNotFound(_0x11e24c,_0x23c411){return function(_0x19221c){if(!_0x19221c){_0x11e24c['sendStatus'](0x194);}return _0x19221c;};}function handleError(_0x49bda0,_0x351ca4){_0x351ca4=_0x351ca4||0x1f4;return function(_0x4c5d42){logger['error'](_0x4c5d42[_0x0248('0x2a')]);if(_0x4c5d42[_0x0248('0x2b')]){delete _0x4c5d42[_0x0248('0x2b')];}_0x49bda0['status'](_0x351ca4)[_0x0248('0x2c')](_0x4c5d42);};}exports[_0x0248('0x2d')]=function(_0x271e29,_0x2652a9){var _0x62415f={},_0x50fbca={},_0x2784c8={'count':0x0,'rows':[]};var _0x27b1cf=_[_0x0248('0x2e')](db['ZohoConfiguration']['rawAttributes'],function(_0x1f61db){return{'name':_0x1f61db[_0x0248('0x2f')],'type':_0x1f61db[_0x0248('0x30')][_0x0248('0x31')]};});_0x50fbca[_0x0248('0x32')]=_[_0x0248('0x2e')](_0x27b1cf,_0x0248('0x2b'));_0x50fbca[_0x0248('0x33')]=_['keys'](_0x271e29[_0x0248('0x33')]);_0x50fbca[_0x0248('0x34')]=_[_0x0248('0x35')](_0x50fbca[_0x0248('0x32')],_0x50fbca[_0x0248('0x33')]);_0x62415f[_0x0248('0x36')]=_['intersection'](_0x50fbca['model'],qs[_0x0248('0x37')](_0x271e29[_0x0248('0x33')][_0x0248('0x37')]));_0x62415f[_0x0248('0x36')]=_0x62415f[_0x0248('0x36')][_0x0248('0x38')]?_0x62415f['attributes']:_0x50fbca['model'];if(!_0x271e29[_0x0248('0x33')][_0x0248('0x39')]('nolimit')){_0x62415f[_0x0248('0x1f')]=qs[_0x0248('0x1f')](_0x271e29[_0x0248('0x33')][_0x0248('0x1f')]);_0x62415f[_0x0248('0x21')]=qs[_0x0248('0x21')](_0x271e29[_0x0248('0x33')][_0x0248('0x21')]);}_0x62415f[_0x0248('0x3a')]=qs['sort'](_0x271e29[_0x0248('0x33')][_0x0248('0x3b')]);_0x62415f[_0x0248('0x3c')]=qs[_0x0248('0x34')](_[_0x0248('0x3d')](_0x271e29[_0x0248('0x33')],_0x50fbca[_0x0248('0x34')]),_0x27b1cf);if(_0x271e29[_0x0248('0x33')][_0x0248('0x3e')]){_0x62415f['where']=_[_0x0248('0x3f')](_0x62415f[_0x0248('0x3c')],{'$or':_[_0x0248('0x2e')](_0x27b1cf,function(_0x5bd82b){if(_0x5bd82b[_0x0248('0x30')]!==_0x0248('0x40')){var _0x170f75={};_0x170f75[_0x5bd82b[_0x0248('0x2b')]]={'$like':'%'+_0x271e29[_0x0248('0x33')][_0x0248('0x3e')]+'%'};return _0x170f75;}})});}_0x62415f=_[_0x0248('0x3f')]({},_0x62415f,_0x271e29[_0x0248('0x41')]);var _0x2a520c={'where':_0x62415f['where']};return db[_0x0248('0x42')][_0x0248('0x20')](_0x2a520c)[_0x0248('0x28')](function(_0x1b7466){_0x2784c8[_0x0248('0x20')]=_0x1b7466;if(_0x271e29['query']['includeAll']){_0x62415f['include']=[{'all':!![]}];}return db[_0x0248('0x42')][_0x0248('0x43')](_0x62415f);})['then'](function(_0x28cf61){_0x2784c8['rows']=_0x28cf61;return _0x2784c8;})[_0x0248('0x28')](respondWithFilteredResult(_0x2652a9,_0x62415f))[_0x0248('0x44')](handleError(_0x2652a9,null));};exports[_0x0248('0x45')]=function(_0x44d5bc,_0xab9409){var _0x1a7b52={'raw':![],'where':{'id':_0x44d5bc[_0x0248('0x46')]['id']}},_0xe9ef90={};_0xe9ef90[_0x0248('0x32')]=_['keys'](db[_0x0248('0x42')][_0x0248('0x47')]);_0xe9ef90['query']=_[_0x0248('0x48')](_0x44d5bc[_0x0248('0x33')]);_0xe9ef90[_0x0248('0x34')]=_['intersection'](_0xe9ef90[_0x0248('0x32')],_0xe9ef90[_0x0248('0x33')]);_0x1a7b52[_0x0248('0x36')]=_[_0x0248('0x35')](_0xe9ef90[_0x0248('0x32')],qs[_0x0248('0x37')](_0x44d5bc['query'][_0x0248('0x37')]));_0x1a7b52['attributes']=_0x1a7b52[_0x0248('0x36')][_0x0248('0x38')]?_0x1a7b52[_0x0248('0x36')]:_0xe9ef90[_0x0248('0x32')];if(_0x44d5bc['query'][_0x0248('0x49')]){_0x1a7b52[_0x0248('0x4a')]=[{'all':!![]}];}_0x1a7b52=_[_0x0248('0x3f')]({},_0x1a7b52,_0x44d5bc[_0x0248('0x41')]);return db[_0x0248('0x42')][_0x0248('0x4b')](_0x1a7b52)[_0x0248('0x28')](handleEntityNotFound(_0xab9409,null))[_0x0248('0x28')](respondWithResult(_0xab9409,null))[_0x0248('0x44')](handleError(_0xab9409,null));};exports[_0x0248('0x4c')]=function(_0xa8cc74,_0x275f88){return db['ZohoConfiguration']['create'](_0xa8cc74[_0x0248('0x4d')],{})[_0x0248('0x28')](respondWithResult(_0x275f88,0xc9))[_0x0248('0x44')](handleError(_0x275f88,null));};exports[_0x0248('0x27')]=function(_0x10b235,_0x32f805){if(_0x10b235[_0x0248('0x4d')]['id']){delete _0x10b235[_0x0248('0x4d')]['id'];}return db[_0x0248('0x42')][_0x0248('0x4b')]({'where':{'id':_0x10b235[_0x0248('0x46')]['id']}})['then'](handleEntityNotFound(_0x32f805,null))[_0x0248('0x28')](saveUpdates(_0x10b235[_0x0248('0x4d')],null))[_0x0248('0x28')](respondWithResult(_0x32f805,null))[_0x0248('0x44')](handleError(_0x32f805,null));};exports[_0x0248('0x29')]=function(_0x29e403,_0x4a3b65){return db['ZohoConfiguration'][_0x0248('0x4b')]({'where':{'id':_0x29e403[_0x0248('0x46')]['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x4a3b65,null))['then'](removeEntity(_0x4a3b65,null))[_0x0248('0x44')](handleError(_0x4a3b65,null));};exports[_0x0248('0x4e')]=function(_0x3d734b,_0x384eb6,_0x472e5e){var _0x4312ba={};var _0x36a686={};var _0x4fd555;var _0x5aa606;return db['ZohoConfiguration'][_0x0248('0x4f')]({'where':{'id':_0x3d734b[_0x0248('0x46')]['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x384eb6,null))['then'](function(_0x4eb08d){if(_0x4eb08d){_0x4fd555=_0x4eb08d;_0x36a686[_0x0248('0x32')]=_[_0x0248('0x48')](db['ZohoField'][_0x0248('0x47')]);_0x36a686[_0x0248('0x33')]=_[_0x0248('0x48')](_0x3d734b[_0x0248('0x33')]);_0x36a686[_0x0248('0x34')]=_['intersection'](_0x36a686[_0x0248('0x32')],_0x36a686[_0x0248('0x33')]);_0x4312ba['attributes']=_[_0x0248('0x35')](_0x36a686[_0x0248('0x32')],qs['fields'](_0x3d734b[_0x0248('0x33')][_0x0248('0x37')]));_0x4312ba['attributes']=_0x4312ba[_0x0248('0x36')][_0x0248('0x38')]?_0x4312ba[_0x0248('0x36')]:_0x36a686[_0x0248('0x32')];_0x4312ba[_0x0248('0x3a')]=qs[_0x0248('0x3b')](_0x3d734b['query'][_0x0248('0x3b')]);_0x4312ba['where']=qs['filters'](_[_0x0248('0x3d')](_0x3d734b['query'],_0x36a686[_0x0248('0x34')]));if(_0x3d734b['query']['filter']){_0x4312ba[_0x0248('0x3c')]=_[_0x0248('0x3f')](_0x4312ba[_0x0248('0x3c')],{'$or':_['map'](_0x4312ba['attributes'],function(_0x85dcbe){var _0x1718cf={};_0x1718cf[_0x85dcbe]={'$like':'%'+_0x3d734b['query']['filter']+'%'};return _0x1718cf;})});}_0x4312ba=_[_0x0248('0x3f')]({},_0x4312ba,_0x3d734b[_0x0248('0x41')]);return _0x4fd555['getFields'](_0x4312ba);}})[_0x0248('0x28')](function(_0x4a4845){if(_0x4a4845){_0x5aa606=_0x4a4845[_0x0248('0x38')];if(!_0x3d734b[_0x0248('0x33')][_0x0248('0x39')](_0x0248('0x50'))){_0x4312ba['limit']=qs[_0x0248('0x1f')](_0x3d734b[_0x0248('0x33')][_0x0248('0x1f')]);_0x4312ba['offset']=qs[_0x0248('0x21')](_0x3d734b['query']['offset']);}return _0x4fd555[_0x0248('0x4e')](_0x4312ba);}})[_0x0248('0x28')](function(_0x36564c){if(_0x36564c){return _0x36564c?{'count':_0x5aa606,'rows':_0x36564c}:null;}})[_0x0248('0x28')](respondWithResult(_0x384eb6,null))[_0x0248('0x44')](handleError(_0x384eb6,null));};exports['getSubjects']=function(_0x597798,_0x2fb727,_0xbf783){var _0x52a3cc={};var _0x1e350f={};var _0x4987e4;var _0x19d2dc;return db[_0x0248('0x42')][_0x0248('0x4f')]({'where':{'id':_0x597798[_0x0248('0x46')]['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x2fb727,null))[_0x0248('0x28')](function(_0x1b9390){if(_0x1b9390){_0x4987e4=_0x1b9390;_0x1e350f['model']=_[_0x0248('0x48')](db[_0x0248('0x51')][_0x0248('0x47')]);_0x1e350f[_0x0248('0x33')]=_[_0x0248('0x48')](_0x597798[_0x0248('0x33')]);_0x1e350f[_0x0248('0x34')]=_[_0x0248('0x35')](_0x1e350f[_0x0248('0x32')],_0x1e350f[_0x0248('0x33')]);_0x52a3cc['attributes']=_['intersection'](_0x1e350f['model'],qs[_0x0248('0x37')](_0x597798[_0x0248('0x33')][_0x0248('0x37')]));_0x52a3cc[_0x0248('0x36')]=_0x52a3cc[_0x0248('0x36')]['length']?_0x52a3cc[_0x0248('0x36')]:_0x1e350f[_0x0248('0x32')];_0x52a3cc[_0x0248('0x3a')]=qs[_0x0248('0x3b')](_0x597798[_0x0248('0x33')][_0x0248('0x3b')]);_0x52a3cc[_0x0248('0x3c')]=qs[_0x0248('0x34')](_[_0x0248('0x3d')](_0x597798[_0x0248('0x33')],_0x1e350f[_0x0248('0x34')]));if(_0x597798[_0x0248('0x33')][_0x0248('0x3e')]){_0x52a3cc[_0x0248('0x3c')]=_[_0x0248('0x3f')](_0x52a3cc[_0x0248('0x3c')],{'$or':_['map'](_0x52a3cc[_0x0248('0x36')],function(_0x56523b){var _0x20fc88={};_0x20fc88[_0x56523b]={'$like':'%'+_0x597798['query'][_0x0248('0x3e')]+'%'};return _0x20fc88;})});}_0x52a3cc=_[_0x0248('0x3f')]({},_0x52a3cc,_0x597798[_0x0248('0x41')]);return _0x4987e4[_0x0248('0x52')](_0x52a3cc);}})['then'](function(_0x18684d){if(_0x18684d){_0x19d2dc=_0x18684d[_0x0248('0x38')];if(!_0x597798[_0x0248('0x33')][_0x0248('0x39')](_0x0248('0x50'))){_0x52a3cc[_0x0248('0x1f')]=qs[_0x0248('0x1f')](_0x597798[_0x0248('0x33')][_0x0248('0x1f')]);_0x52a3cc[_0x0248('0x21')]=qs['offset'](_0x597798[_0x0248('0x33')][_0x0248('0x21')]);}return _0x4987e4[_0x0248('0x52')](_0x52a3cc);}})[_0x0248('0x28')](function(_0x2502ec){if(_0x2502ec){return _0x2502ec?{'count':_0x19d2dc,'rows':_0x2502ec}:null;}})['then'](respondWithResult(_0x2fb727,null))[_0x0248('0x44')](handleError(_0x2fb727,null));};exports[_0x0248('0x53')]=function(_0x1c993d,_0x43776b,_0x318e48){var _0xa817a7={};var _0x363178={};var _0x346cfd;var _0x1a63e2;return db['ZohoConfiguration'][_0x0248('0x4f')]({'where':{'id':_0x1c993d['params']['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x43776b,null))[_0x0248('0x28')](function(_0xbd9f7c){if(_0xbd9f7c){_0x346cfd=_0xbd9f7c;_0x363178[_0x0248('0x32')]=_['keys'](db['ZohoField'][_0x0248('0x47')]);_0x363178[_0x0248('0x33')]=_[_0x0248('0x48')](_0x1c993d['query']);_0x363178['filters']=_['intersection'](_0x363178[_0x0248('0x32')],_0x363178[_0x0248('0x33')]);_0xa817a7['attributes']=_[_0x0248('0x35')](_0x363178[_0x0248('0x32')],qs[_0x0248('0x37')](_0x1c993d[_0x0248('0x33')][_0x0248('0x37')]));_0xa817a7['attributes']=_0xa817a7[_0x0248('0x36')][_0x0248('0x38')]?_0xa817a7[_0x0248('0x36')]:_0x363178[_0x0248('0x32')];_0xa817a7[_0x0248('0x3a')]=qs['sort'](_0x1c993d['query'][_0x0248('0x3b')]);_0xa817a7['where']=qs[_0x0248('0x34')](_[_0x0248('0x3d')](_0x1c993d[_0x0248('0x33')],_0x363178[_0x0248('0x34')]));if(_0x1c993d[_0x0248('0x33')][_0x0248('0x3e')]){_0xa817a7[_0x0248('0x3c')]=_[_0x0248('0x3f')](_0xa817a7[_0x0248('0x3c')],{'$or':_['map'](_0xa817a7[_0x0248('0x36')],function(_0x43f013){var _0x12c886={};_0x12c886[_0x43f013]={'$like':'%'+_0x1c993d[_0x0248('0x33')][_0x0248('0x3e')]+'%'};return _0x12c886;})});}_0xa817a7=_[_0x0248('0x3f')]({},_0xa817a7,_0x1c993d[_0x0248('0x41')]);return _0x346cfd[_0x0248('0x53')](_0xa817a7);}})[_0x0248('0x28')](function(_0x1b574b){if(_0x1b574b){_0x1a63e2=_0x1b574b['length'];if(!_0x1c993d[_0x0248('0x33')][_0x0248('0x39')]('nolimit')){_0xa817a7[_0x0248('0x1f')]=qs[_0x0248('0x1f')](_0x1c993d['query']['limit']);_0xa817a7['offset']=qs[_0x0248('0x21')](_0x1c993d[_0x0248('0x33')][_0x0248('0x21')]);}return _0x346cfd['getDescriptions'](_0xa817a7);}})[_0x0248('0x28')](function(_0x4cd1b6){if(_0x4cd1b6){return _0x4cd1b6?{'count':_0x1a63e2,'rows':_0x4cd1b6}:null;}})[_0x0248('0x28')](respondWithResult(_0x43776b,null))[_0x0248('0x44')](handleError(_0x43776b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 9f5c474..49175c9 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 _0x80bc=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0xf6a9d5,_0x4b111e){var _0x3d20c4=function(_0x4f8407){while(--_0x4f8407){_0xf6a9d5['push'](_0xf6a9d5['shift']());}};_0x3d20c4(++_0x4b111e);}(_0x80bc,0x1da));var _0xc80b=function(_0x14e1cb,_0xd3465e){_0x14e1cb=_0x14e1cb-0x0;var _0x18a337=_0x80bc[_0x14e1cb];return _0x18a337;};'use strict';var _=require(_0xc80b('0x0'));var util=require('util');var logger=require(_0xc80b('0x1'))(_0xc80b('0x2'));var moment=require(_0xc80b('0x3'));var BPromise=require(_0xc80b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc80b('0x5'));var rimraf=require(_0xc80b('0x6'));var config=require(_0xc80b('0x7'));var attributes=require(_0xc80b('0x8'));module[_0xc80b('0x9')]=function(_0x3fb4e9,_0x1d319e){return _0x3fb4e9[_0xc80b('0xa')](_0xc80b('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ca1=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x2e50a4,_0x4b2a34){var _0x2ae3ce=function(_0x2a7e1f){while(--_0x2a7e1f){_0x2e50a4['push'](_0x2e50a4['shift']());}};_0x2ae3ce(++_0x4b2a34);}(_0x4ca1,0x111));var _0x14ca=function(_0x2ab5d7,_0x1243d9){_0x2ab5d7=_0x2ab5d7-0x0;var _0x516388=_0x4ca1[_0x2ab5d7];return _0x516388;};'use strict';var _=require(_0x14ca('0x0'));var util=require('util');var logger=require(_0x14ca('0x1'))(_0x14ca('0x2'));var moment=require(_0x14ca('0x3'));var BPromise=require(_0x14ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14ca('0x5'));var rimraf=require(_0x14ca('0x6'));var config=require(_0x14ca('0x7'));var attributes=require(_0x14ca('0x8'));module[_0x14ca('0x9')]=function(_0x264643,_0x3b2856){return _0x264643[_0x14ca('0xa')](_0x14ca('0xb'),attributes,{'tableName':_0x14ca('0xc'),'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 e5ae74f..97c2700 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 _0xff53=['request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x4cc65f,_0x4a67ad){var _0x4de46b=function(_0x23d858){while(--_0x23d858){_0x4cc65f['push'](_0x4cc65f['shift']());}};_0x4de46b(++_0x4a67ad);}(_0xff53,0xbf));var _0x3ff5=function(_0xdaf41d,_0x39ba94){_0xdaf41d=_0xdaf41d-0x0;var _0x208464=_0xff53[_0xdaf41d];return _0x208464;};'use strict';var _=require(_0x3ff5('0x0'));var util=require(_0x3ff5('0x1'));var moment=require(_0x3ff5('0x2'));var BPromise=require(_0x3ff5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ff5('0x4'));var db=require(_0x3ff5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ff5('0x6'))(_0x3ff5('0x7'));var config=require(_0x3ff5('0x8'));var jayson=require(_0x3ff5('0x9'));var client=jayson[_0x3ff5('0xa')][_0x3ff5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ff5fb,_0x1b41ce,_0x56f2b4){return new BPromise(function(_0x5919c6,_0xbd9569){return client['request'](_0x2ff5fb,_0x56f2b4)[_0x3ff5('0xc')](function(_0x5a212f){logger[_0x3ff5('0xd')](_0x3ff5('0xe'),_0x1b41ce,'request\x20sent');logger[_0x3ff5('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1b41ce,'request\x20sent',JSON[_0x3ff5('0x10')](_0x5a212f));if(_0x5a212f[_0x3ff5('0x11')]){if(_0x5a212f[_0x3ff5('0x11')]['code']===0x1f4){logger[_0x3ff5('0x11')](_0x3ff5('0xe'),_0x1b41ce,_0x5a212f['error'][_0x3ff5('0x12')]);return _0xbd9569(_0x5a212f[_0x3ff5('0x11')][_0x3ff5('0x12')]);}logger[_0x3ff5('0x11')](_0x3ff5('0xe'),_0x1b41ce,_0x5a212f[_0x3ff5('0x11')][_0x3ff5('0x12')]);return _0x5919c6(_0x5a212f[_0x3ff5('0x11')][_0x3ff5('0x12')]);}else{logger[_0x3ff5('0xd')](_0x3ff5('0xe'),_0x1b41ce,_0x3ff5('0x13'));_0x5919c6(_0x5a212f['result'][_0x3ff5('0x12')]);}})[_0x3ff5('0x14')](function(_0x504f98){logger[_0x3ff5('0x11')](_0x3ff5('0xe'),_0x1b41ce,_0x504f98);_0xbd9569(_0x504f98);});});} \ No newline at end of file +var _0x1579=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x136f80,_0x5c5e5a){var _0x592675=function(_0x1ad2c2){while(--_0x1ad2c2){_0x136f80['push'](_0x136f80['shift']());}};_0x592675(++_0x5c5e5a);}(_0x1579,0x1ea));var _0x9157=function(_0x5eb97,_0x1486fb){_0x5eb97=_0x5eb97-0x0;var _0x587cfa=_0x1579[_0x5eb97];return _0x587cfa;};'use strict';var _=require(_0x9157('0x0'));var util=require('util');var moment=require(_0x9157('0x1'));var BPromise=require(_0x9157('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9157('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9157('0x4'));var logger=require(_0x9157('0x5'))(_0x9157('0x6'));var config=require(_0x9157('0x7'));var jayson=require(_0x9157('0x8'));var client=jayson['client'][_0x9157('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a59ac,_0x3ea65a,_0x440e84){return new BPromise(function(_0x3f344c,_0x4ae1c9){return client[_0x9157('0xa')](_0x3a59ac,_0x440e84)[_0x9157('0xb')](function(_0x16cf9e){logger[_0x9157('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ea65a,_0x9157('0xd'));logger['debug'](_0x9157('0xe'),_0x3ea65a,_0x9157('0xd'),JSON[_0x9157('0xf')](_0x16cf9e));if(_0x16cf9e[_0x9157('0x10')]){if(_0x16cf9e['error'][_0x9157('0x11')]===0x1f4){logger[_0x9157('0x10')](_0x9157('0x12'),_0x3ea65a,_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);return _0x4ae1c9(_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);}logger[_0x9157('0x10')](_0x9157('0x12'),_0x3ea65a,_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);return _0x3f344c(_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);}else{logger[_0x9157('0xc')](_0x9157('0x12'),_0x3ea65a,_0x9157('0xd'));_0x3f344c(_0x16cf9e['result'][_0x9157('0x13')]);}})[_0x9157('0x14')](function(_0x16292c){logger[_0x9157('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ea65a,_0x16292c);_0x4ae1c9(_0x16292c);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 4079d0a..32b5445 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 _0x8f89=['Router','fs-extra','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x330198,_0x1270a4){var _0x423530=function(_0x10f486){while(--_0x10f486){_0x330198['push'](_0x330198['shift']());}};_0x423530(++_0x1270a4);}(_0x8f89,0x1eb));var _0x98f8=function(_0x170ff7,_0x14a279){_0x170ff7=_0x170ff7-0x0;var _0x173b77=_0x8f89[_0x170ff7];return _0x173b77;};'use strict';var multer=require(_0x98f8('0x0'));var util=require(_0x98f8('0x1'));var path=require(_0x98f8('0x2'));var timeout=require(_0x98f8('0x3'));var express=require(_0x98f8('0x4'));var router=express[_0x98f8('0x5')]();var fs_extra=require(_0x98f8('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x98f8('0x7')]('/',auth[_0x98f8('0x8')](),controller[_0x98f8('0x9')]);router['get'](_0x98f8('0xa'),auth[_0x98f8('0x8')](),controller['show']);router['post']('/',auth[_0x98f8('0x8')](),controller[_0x98f8('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x98f8('0xc')]);router[_0x98f8('0xd')](_0x98f8('0xa'),auth[_0x98f8('0x8')](),controller[_0x98f8('0xe')]);module[_0x98f8('0xf')]=router; \ No newline at end of file +var _0x1bb3=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1bb3,0x15c));var _0x31bb=function(_0x2fe4d4,_0x183e0c){_0x2fe4d4=_0x2fe4d4-0x0;var _0x1259b6=_0x1bb3[_0x2fe4d4];return _0x1259b6;};'use strict';var multer=require(_0x31bb('0x0'));var util=require(_0x31bb('0x1'));var path=require(_0x31bb('0x2'));var timeout=require(_0x31bb('0x3'));var express=require('express');var router=express[_0x31bb('0x4')]();var fs_extra=require(_0x31bb('0x5'));var auth=require(_0x31bb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31bb('0x7'));router[_0x31bb('0x8')]('/',auth[_0x31bb('0x9')](),controller[_0x31bb('0xa')]);router[_0x31bb('0x8')](_0x31bb('0xb'),auth[_0x31bb('0x9')](),controller[_0x31bb('0xc')]);router[_0x31bb('0xd')]('/',auth['isAuthenticated'](),controller[_0x31bb('0xe')]);router[_0x31bb('0xf')]('/:id',auth[_0x31bb('0x9')](),controller['update']);router[_0x31bb('0x10')](_0x31bb('0xb'),auth['isAuthenticated'](),controller[_0x31bb('0x11')]);module[_0x31bb('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 ce0f6b6..6b47780 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 _0x945e=['string','customVariable','picklist','STRING','variable','ENUM'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x945e,0x13d));var _0xe945=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x945e[_0x1eda20];return _0x31b953;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe945('0x0')](_0xe945('0x1'),'variable',_0xe945('0x2'),'keyValue',_0xe945('0x3')),'defaultValue':_0xe945('0x1')},'content':{'type':Sequelize[_0xe945('0x4')]},'key':{'type':Sequelize[_0xe945('0x4')]},'keyType':{'type':Sequelize[_0xe945('0x0')](_0xe945('0x1'),_0xe945('0x5'),_0xe945('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe945('0x4')]},'nameField':{'type':Sequelize[_0xe945('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe945('0x4')]}}; \ No newline at end of file +var _0xedae=['sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x2eb279,_0x37fc0d){var _0x34eaba=function(_0x515e4a){while(--_0x515e4a){_0x2eb279['push'](_0x2eb279['shift']());}};_0x34eaba(++_0x37fc0d);}(_0xedae,0x1b0));var _0xeeda=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xedae[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0xeeda('0x0'));module['exports']={'type':{'type':Sequelize[_0xeeda('0x1')](_0xeeda('0x2'),_0xeeda('0x3'),_0xeeda('0x4'),_0xeeda('0x5'),_0xeeda('0x6')),'defaultValue':_0xeeda('0x2')},'content':{'type':Sequelize[_0xeeda('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xeeda('0x2'),_0xeeda('0x3'),_0xeeda('0x4'))},'keyContent':{'type':Sequelize[_0xeeda('0x7')]},'idField':{'type':Sequelize[_0xeeda('0x7')]},'nameField':{'type':Sequelize[_0xeeda('0x7')]},'customField':{'type':Sequelize[_0xeeda('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeeda('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 5d25885..c257fa0 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 _0x0e6c=['index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ZohoField','count','includeAll','include','findAll','catch','show','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','save','update','then','error','stack','name','send'];(function(_0x15070a,_0x522955){var _0x251d50=function(_0x1b4f8e){while(--_0x1b4f8e){_0x15070a['push'](_0x15070a['shift']());}};_0x251d50(++_0x522955);}(_0x0e6c,0x6b));var _0xc0e6=function(_0x1b11d1,_0x2f9707){_0x1b11d1=_0x1b11d1-0x0;var _0x2d21e6=_0x0e6c[_0x1b11d1];return _0x2d21e6;};'use strict';var emlformat=require(_0xc0e6('0x0'));var rimraf=require(_0xc0e6('0x1'));var zipdir=require(_0xc0e6('0x2'));var jsonpatch=require(_0xc0e6('0x3'));var rp=require(_0xc0e6('0x4'));var moment=require('moment');var BPromise=require(_0xc0e6('0x5'));var Mustache=require(_0xc0e6('0x6'));var util=require(_0xc0e6('0x7'));var path=require(_0xc0e6('0x8'));var sox=require(_0xc0e6('0x9'));var csv=require(_0xc0e6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0e6('0xb'));var _=require(_0xc0e6('0xc'));var squel=require(_0xc0e6('0xd'));var crypto=require(_0xc0e6('0xe'));var jsforce=require(_0xc0e6('0xf'));var deskjs=require(_0xc0e6('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc0e6('0x11'));var Redis=require(_0xc0e6('0x12'));var authService=require(_0xc0e6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc0e6('0x14'));var hardwareService=require(_0xc0e6('0x15'));var logger=require('../../config/logger')(_0xc0e6('0x16'));var utils=require(_0xc0e6('0x17'));var config=require(_0xc0e6('0x18'));var licenseUtil=require(_0xc0e6('0x19'));var db=require(_0xc0e6('0x1a'))['db'];function respondWithStatusCode(_0x8b0171,_0x1a9950){_0x1a9950=_0x1a9950||0xcc;return function(_0xc255ce){if(_0xc255ce){return _0x8b0171[_0xc0e6('0x1b')](_0x1a9950);}return _0x8b0171[_0xc0e6('0x1c')](_0x1a9950)[_0xc0e6('0x1d')]();};}function respondWithResult(_0x320bb1,_0x27c414){_0x27c414=_0x27c414||0xc8;return function(_0x592771){if(_0x592771){return _0x320bb1[_0xc0e6('0x1c')](_0x27c414)[_0xc0e6('0x1e')](_0x592771);}};}function respondWithFilteredResult(_0x2f5aed,_0x242291){return function(_0x1c3de8){if(_0x1c3de8){var _0x4e3163=typeof _0x242291['offset']===_0xc0e6('0x1f')&&typeof _0x242291[_0xc0e6('0x20')]===_0xc0e6('0x1f');var _0x14c752=_0x1c3de8['count'];var _0x1578ce=_0x4e3163?0x0:_0x242291[_0xc0e6('0x21')];var _0x25434b=_0x4e3163?_0x1c3de8['count']:_0x242291[_0xc0e6('0x21')]+_0x242291['limit'];var _0x2c04e1;if(_0x25434b>=_0x14c752){_0x25434b=_0x14c752;_0x2c04e1=0xc8;}else{_0x2c04e1=0xce;}_0x2f5aed[_0xc0e6('0x1c')](_0x2c04e1);return _0x2f5aed['set'](_0xc0e6('0x22'),_0x1578ce+'-'+_0x25434b+'/'+_0x14c752)[_0xc0e6('0x1e')](_0x1c3de8);}return null;};}function patchUpdates(_0x159fc8){return function(_0x2231d3){try{jsonpatch[_0xc0e6('0x23')](_0x2231d3,_0x159fc8,!![]);}catch(_0x5e8772){return BPromise['reject'](_0x5e8772);}return _0x2231d3[_0xc0e6('0x24')]();};}function saveUpdates(_0x6c9d1e,_0x298423){return function(_0x2ca08a){if(_0x2ca08a){return _0x2ca08a[_0xc0e6('0x25')](_0x6c9d1e)[_0xc0e6('0x26')](function(_0x52ed32){return _0x52ed32;});}return null;};}function removeEntity(_0x1ad67a,_0x1170a3){return function(_0x3ccdd4){if(_0x3ccdd4){return _0x3ccdd4['destroy']()[_0xc0e6('0x26')](function(){_0x1ad67a[_0xc0e6('0x1c')](0xcc)[_0xc0e6('0x1d')]();});}};}function handleEntityNotFound(_0xfcd8e0,_0x47d72f){return function(_0x3bec62){if(!_0x3bec62){_0xfcd8e0[_0xc0e6('0x1b')](0x194);}return _0x3bec62;};}function handleError(_0x3bab25,_0x3bb42a){_0x3bb42a=_0x3bb42a||0x1f4;return function(_0xe0210a){logger[_0xc0e6('0x27')](_0xe0210a[_0xc0e6('0x28')]);if(_0xe0210a[_0xc0e6('0x29')]){delete _0xe0210a[_0xc0e6('0x29')];}_0x3bab25[_0xc0e6('0x1c')](_0x3bb42a)[_0xc0e6('0x2a')](_0xe0210a);};}exports[_0xc0e6('0x2b')]=function(_0x4bb7f6,_0x424d61){var _0x15bbd2={},_0x28bc53={},_0x2cd26b={'count':0x0,'rows':[]};var _0x4d14ec=_[_0xc0e6('0x2c')](db['ZohoField'][_0xc0e6('0x2d')],function(_0x2d8ecc){return{'name':_0x2d8ecc['fieldName'],'type':_0x2d8ecc[_0xc0e6('0x2e')]['key']};});_0x28bc53['model']=_[_0xc0e6('0x2c')](_0x4d14ec,_0xc0e6('0x29'));_0x28bc53[_0xc0e6('0x2f')]=_[_0xc0e6('0x30')](_0x4bb7f6[_0xc0e6('0x2f')]);_0x28bc53[_0xc0e6('0x31')]=_[_0xc0e6('0x32')](_0x28bc53[_0xc0e6('0x33')],_0x28bc53[_0xc0e6('0x2f')]);_0x15bbd2[_0xc0e6('0x34')]=_[_0xc0e6('0x32')](_0x28bc53[_0xc0e6('0x33')],qs['fields'](_0x4bb7f6[_0xc0e6('0x2f')][_0xc0e6('0x35')]));_0x15bbd2[_0xc0e6('0x34')]=_0x15bbd2[_0xc0e6('0x34')][_0xc0e6('0x36')]?_0x15bbd2[_0xc0e6('0x34')]:_0x28bc53[_0xc0e6('0x33')];if(!_0x4bb7f6[_0xc0e6('0x2f')][_0xc0e6('0x37')](_0xc0e6('0x38'))){_0x15bbd2[_0xc0e6('0x20')]=qs[_0xc0e6('0x20')](_0x4bb7f6[_0xc0e6('0x2f')]['limit']);_0x15bbd2['offset']=qs['offset'](_0x4bb7f6[_0xc0e6('0x2f')][_0xc0e6('0x21')]);}_0x15bbd2[_0xc0e6('0x39')]=qs[_0xc0e6('0x3a')](_0x4bb7f6[_0xc0e6('0x2f')][_0xc0e6('0x3a')]);_0x15bbd2['where']=qs[_0xc0e6('0x31')](_[_0xc0e6('0x3b')](_0x4bb7f6[_0xc0e6('0x2f')],_0x28bc53[_0xc0e6('0x31')]),_0x4d14ec);if(_0x4bb7f6['query'][_0xc0e6('0x3c')]){_0x15bbd2[_0xc0e6('0x3d')]=_[_0xc0e6('0x3e')](_0x15bbd2[_0xc0e6('0x3d')],{'$or':_[_0xc0e6('0x2c')](_0x4d14ec,function(_0x5ae516){if(_0x5ae516['type']!=='VIRTUAL'){var _0x35e5ee={};_0x35e5ee[_0x5ae516[_0xc0e6('0x29')]]={'$like':'%'+_0x4bb7f6[_0xc0e6('0x2f')][_0xc0e6('0x3c')]+'%'};return _0x35e5ee;}})});}_0x15bbd2=_[_0xc0e6('0x3e')]({},_0x15bbd2,_0x4bb7f6[_0xc0e6('0x3f')]);var _0x5a0d82={'where':_0x15bbd2[_0xc0e6('0x3d')]};return db[_0xc0e6('0x40')][_0xc0e6('0x41')](_0x5a0d82)['then'](function(_0x4f6ff7){_0x2cd26b[_0xc0e6('0x41')]=_0x4f6ff7;if(_0x4bb7f6[_0xc0e6('0x2f')][_0xc0e6('0x42')]){_0x15bbd2[_0xc0e6('0x43')]=[{'all':!![]}];}return db['ZohoField'][_0xc0e6('0x44')](_0x15bbd2);})[_0xc0e6('0x26')](function(_0x328ed6){_0x2cd26b['rows']=_0x328ed6;return _0x2cd26b;})[_0xc0e6('0x26')](respondWithFilteredResult(_0x424d61,_0x15bbd2))[_0xc0e6('0x45')](handleError(_0x424d61,null));};exports[_0xc0e6('0x46')]=function(_0x1e29b2,_0x15bb2e){var _0x5be3e7={'raw':!![],'where':{'id':_0x1e29b2['params']['id']}},_0x4b6908={};_0x4b6908[_0xc0e6('0x33')]=_[_0xc0e6('0x30')](db[_0xc0e6('0x40')][_0xc0e6('0x2d')]);_0x4b6908[_0xc0e6('0x2f')]=_[_0xc0e6('0x30')](_0x1e29b2[_0xc0e6('0x2f')]);_0x4b6908[_0xc0e6('0x31')]=_[_0xc0e6('0x32')](_0x4b6908['model'],_0x4b6908[_0xc0e6('0x2f')]);_0x5be3e7[_0xc0e6('0x34')]=_[_0xc0e6('0x32')](_0x4b6908['model'],qs['fields'](_0x1e29b2[_0xc0e6('0x2f')][_0xc0e6('0x35')]));_0x5be3e7[_0xc0e6('0x34')]=_0x5be3e7[_0xc0e6('0x34')][_0xc0e6('0x36')]?_0x5be3e7[_0xc0e6('0x34')]:_0x4b6908[_0xc0e6('0x33')];if(_0x1e29b2[_0xc0e6('0x2f')][_0xc0e6('0x42')]){_0x5be3e7[_0xc0e6('0x43')]=[{'all':!![]}];}_0x5be3e7=_['merge']({},_0x5be3e7,_0x1e29b2[_0xc0e6('0x3f')]);return db[_0xc0e6('0x40')][_0xc0e6('0x47')](_0x5be3e7)[_0xc0e6('0x26')](handleEntityNotFound(_0x15bb2e,null))['then'](respondWithResult(_0x15bb2e,null))['catch'](handleError(_0x15bb2e,null));};exports[_0xc0e6('0x48')]=function(_0x2194d,_0x43b209){return db['ZohoField']['create'](_0x2194d[_0xc0e6('0x49')],{})[_0xc0e6('0x26')](respondWithResult(_0x43b209,0xc9))['catch'](handleError(_0x43b209,null));};exports['update']=function(_0x37ecef,_0x1e9d06){if(_0x37ecef[_0xc0e6('0x49')]['id']){delete _0x37ecef[_0xc0e6('0x49')]['id'];}return db[_0xc0e6('0x40')][_0xc0e6('0x47')]({'where':{'id':_0x37ecef['params']['id']}})[_0xc0e6('0x26')](handleEntityNotFound(_0x1e9d06,null))[_0xc0e6('0x26')](saveUpdates(_0x37ecef[_0xc0e6('0x49')],null))[_0xc0e6('0x26')](respondWithResult(_0x1e9d06,null))[_0xc0e6('0x45')](handleError(_0x1e9d06,null));};exports[_0xc0e6('0x4a')]=function(_0x1093e2,_0x4d8339){return db['ZohoField'][_0xc0e6('0x47')]({'where':{'id':_0x1093e2['params']['id']}})[_0xc0e6('0x26')](handleEntityNotFound(_0x4d8339,null))[_0xc0e6('0x26')](removeEntity(_0x4d8339,null))[_0xc0e6('0x45')](handleError(_0x4d8339,null));}; \ No newline at end of file +var _0xdc3f=['destroy','error','name','send','index','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','then'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xdc3f,0xaf));var _0xfdc3=function(_0x39e893,_0x3861a8){_0x39e893=_0x39e893-0x0;var _0xe2fa1e=_0xdc3f[_0x39e893];return _0xe2fa1e;};'use strict';var emlformat=require(_0xfdc3('0x0'));var rimraf=require(_0xfdc3('0x1'));var zipdir=require(_0xfdc3('0x2'));var jsonpatch=require(_0xfdc3('0x3'));var rp=require(_0xfdc3('0x4'));var moment=require('moment');var BPromise=require(_0xfdc3('0x5'));var Mustache=require(_0xfdc3('0x6'));var util=require(_0xfdc3('0x7'));var path=require('path');var sox=require(_0xfdc3('0x8'));var csv=require(_0xfdc3('0x9'));var ejs=require(_0xfdc3('0xa'));var fs=require('fs');var fs_extra=require(_0xfdc3('0xb'));var _=require(_0xfdc3('0xc'));var squel=require('squel');var crypto=require(_0xfdc3('0xd'));var jsforce=require(_0xfdc3('0xe'));var deskjs=require(_0xfdc3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfdc3('0x10'));var Papa=require(_0xfdc3('0x11'));var Redis=require('ioredis');var authService=require(_0xfdc3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfdc3('0x13'));var hardwareService=require(_0xfdc3('0x14'));var logger=require(_0xfdc3('0x15'))(_0xfdc3('0x16'));var utils=require(_0xfdc3('0x17'));var config=require(_0xfdc3('0x18'));var licenseUtil=require(_0xfdc3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa1c6d,_0x3db2ce){_0x3db2ce=_0x3db2ce||0xcc;return function(_0x3dcfa9){if(_0x3dcfa9){return _0xa1c6d[_0xfdc3('0x1a')](_0x3db2ce);}return _0xa1c6d['status'](_0x3db2ce)[_0xfdc3('0x1b')]();};}function respondWithResult(_0x49964a,_0x4816ad){_0x4816ad=_0x4816ad||0xc8;return function(_0x53a288){if(_0x53a288){return _0x49964a[_0xfdc3('0x1c')](_0x4816ad)[_0xfdc3('0x1d')](_0x53a288);}};}function respondWithFilteredResult(_0x37faed,_0x5252c6){return function(_0x401883){if(_0x401883){var _0x427ad2=typeof _0x5252c6[_0xfdc3('0x1e')]===_0xfdc3('0x1f')&&typeof _0x5252c6['limit']===_0xfdc3('0x1f');var _0x1e2e60=_0x401883[_0xfdc3('0x20')];var _0x4a0c7c=_0x427ad2?0x0:_0x5252c6['offset'];var _0x2bf5a2=_0x427ad2?_0x401883[_0xfdc3('0x20')]:_0x5252c6['offset']+_0x5252c6[_0xfdc3('0x21')];var _0x2201db;if(_0x2bf5a2>=_0x1e2e60){_0x2bf5a2=_0x1e2e60;_0x2201db=0xc8;}else{_0x2201db=0xce;}_0x37faed['status'](_0x2201db);return _0x37faed[_0xfdc3('0x22')](_0xfdc3('0x23'),_0x4a0c7c+'-'+_0x2bf5a2+'/'+_0x1e2e60)['json'](_0x401883);}return null;};}function patchUpdates(_0x4a31ba){return function(_0x1eaa44){try{jsonpatch['apply'](_0x1eaa44,_0x4a31ba,!![]);}catch(_0x1d3c89){return BPromise[_0xfdc3('0x24')](_0x1d3c89);}return _0x1eaa44['save']();};}function saveUpdates(_0x1da4ac,_0x90366c){return function(_0x31d9d6){if(_0x31d9d6){return _0x31d9d6['update'](_0x1da4ac)[_0xfdc3('0x25')](function(_0xd3f1d0){return _0xd3f1d0;});}return null;};}function removeEntity(_0x1e19b7,_0x4f5662){return function(_0x46acf7){if(_0x46acf7){return _0x46acf7[_0xfdc3('0x26')]()[_0xfdc3('0x25')](function(){_0x1e19b7[_0xfdc3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f0fa,_0x51a2fc){return function(_0x592514){if(!_0x592514){_0x47f0fa[_0xfdc3('0x1a')](0x194);}return _0x592514;};}function handleError(_0x64abf9,_0x14c862){_0x14c862=_0x14c862||0x1f4;return function(_0xc22521){logger[_0xfdc3('0x27')](_0xc22521['stack']);if(_0xc22521['name']){delete _0xc22521[_0xfdc3('0x28')];}_0x64abf9[_0xfdc3('0x1c')](_0x14c862)[_0xfdc3('0x29')](_0xc22521);};}exports[_0xfdc3('0x2a')]=function(_0xda9926,_0xbd6440){var _0x412414={},_0x481597={},_0x35bd0f={'count':0x0,'rows':[]};var _0x4e4121=_[_0xfdc3('0x2b')](db[_0xfdc3('0x2c')]['rawAttributes'],function(_0x986098){return{'name':_0x986098[_0xfdc3('0x2d')],'type':_0x986098[_0xfdc3('0x2e')]['key']};});_0x481597[_0xfdc3('0x2f')]=_[_0xfdc3('0x2b')](_0x4e4121,_0xfdc3('0x28'));_0x481597[_0xfdc3('0x30')]=_[_0xfdc3('0x31')](_0xda9926[_0xfdc3('0x30')]);_0x481597[_0xfdc3('0x32')]=_[_0xfdc3('0x33')](_0x481597[_0xfdc3('0x2f')],_0x481597[_0xfdc3('0x30')]);_0x412414[_0xfdc3('0x34')]=_[_0xfdc3('0x33')](_0x481597[_0xfdc3('0x2f')],qs[_0xfdc3('0x35')](_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x35')]));_0x412414[_0xfdc3('0x34')]=_0x412414[_0xfdc3('0x34')][_0xfdc3('0x36')]?_0x412414['attributes']:_0x481597[_0xfdc3('0x2f')];if(!_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x37')]('nolimit')){_0x412414['limit']=qs[_0xfdc3('0x21')](_0xda9926[_0xfdc3('0x30')]['limit']);_0x412414[_0xfdc3('0x1e')]=qs[_0xfdc3('0x1e')](_0xda9926['query'][_0xfdc3('0x1e')]);}_0x412414[_0xfdc3('0x38')]=qs[_0xfdc3('0x39')](_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x39')]);_0x412414[_0xfdc3('0x3a')]=qs[_0xfdc3('0x32')](_['pick'](_0xda9926['query'],_0x481597[_0xfdc3('0x32')]),_0x4e4121);if(_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x3b')]){_0x412414['where']=_['merge'](_0x412414[_0xfdc3('0x3a')],{'$or':_[_0xfdc3('0x2b')](_0x4e4121,function(_0x308a94){if(_0x308a94[_0xfdc3('0x2e')]!==_0xfdc3('0x3c')){var _0x448ea7={};_0x448ea7[_0x308a94[_0xfdc3('0x28')]]={'$like':'%'+_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x3b')]+'%'};return _0x448ea7;}})});}_0x412414=_['merge']({},_0x412414,_0xda9926[_0xfdc3('0x3d')]);var _0x2e1a1a={'where':_0x412414[_0xfdc3('0x3a')]};return db[_0xfdc3('0x2c')][_0xfdc3('0x20')](_0x2e1a1a)[_0xfdc3('0x25')](function(_0x47d682){_0x35bd0f['count']=_0x47d682;if(_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x3e')]){_0x412414[_0xfdc3('0x3f')]=[{'all':!![]}];}return db[_0xfdc3('0x2c')]['findAll'](_0x412414);})[_0xfdc3('0x25')](function(_0x514bda){_0x35bd0f[_0xfdc3('0x40')]=_0x514bda;return _0x35bd0f;})['then'](respondWithFilteredResult(_0xbd6440,_0x412414))[_0xfdc3('0x41')](handleError(_0xbd6440,null));};exports[_0xfdc3('0x42')]=function(_0x58d874,_0x2b88c0){var _0x44f738={'raw':!![],'where':{'id':_0x58d874[_0xfdc3('0x43')]['id']}},_0x26985d={};_0x26985d[_0xfdc3('0x2f')]=_[_0xfdc3('0x31')](db[_0xfdc3('0x2c')]['rawAttributes']);_0x26985d[_0xfdc3('0x30')]=_[_0xfdc3('0x31')](_0x58d874[_0xfdc3('0x30')]);_0x26985d[_0xfdc3('0x32')]=_['intersection'](_0x26985d['model'],_0x26985d['query']);_0x44f738[_0xfdc3('0x34')]=_[_0xfdc3('0x33')](_0x26985d[_0xfdc3('0x2f')],qs[_0xfdc3('0x35')](_0x58d874[_0xfdc3('0x30')][_0xfdc3('0x35')]));_0x44f738[_0xfdc3('0x34')]=_0x44f738[_0xfdc3('0x34')][_0xfdc3('0x36')]?_0x44f738[_0xfdc3('0x34')]:_0x26985d[_0xfdc3('0x2f')];if(_0x58d874[_0xfdc3('0x30')][_0xfdc3('0x3e')]){_0x44f738[_0xfdc3('0x3f')]=[{'all':!![]}];}_0x44f738=_['merge']({},_0x44f738,_0x58d874[_0xfdc3('0x3d')]);return db[_0xfdc3('0x2c')][_0xfdc3('0x44')](_0x44f738)[_0xfdc3('0x25')](handleEntityNotFound(_0x2b88c0,null))[_0xfdc3('0x25')](respondWithResult(_0x2b88c0,null))['catch'](handleError(_0x2b88c0,null));};exports['create']=function(_0x458721,_0x5197f0){return db['ZohoField']['create'](_0x458721[_0xfdc3('0x45')],{})[_0xfdc3('0x25')](respondWithResult(_0x5197f0,0xc9))['catch'](handleError(_0x5197f0,null));};exports[_0xfdc3('0x46')]=function(_0x324cdb,_0x53a936){if(_0x324cdb[_0xfdc3('0x45')]['id']){delete _0x324cdb[_0xfdc3('0x45')]['id'];}return db[_0xfdc3('0x2c')][_0xfdc3('0x44')]({'where':{'id':_0x324cdb[_0xfdc3('0x43')]['id']}})[_0xfdc3('0x25')](handleEntityNotFound(_0x53a936,null))[_0xfdc3('0x25')](saveUpdates(_0x324cdb[_0xfdc3('0x45')],null))[_0xfdc3('0x25')](respondWithResult(_0x53a936,null))[_0xfdc3('0x41')](handleError(_0x53a936,null));};exports[_0xfdc3('0x26')]=function(_0x5acc94,_0x3087da){return db[_0xfdc3('0x2c')][_0xfdc3('0x44')]({'where':{'id':_0x5acc94[_0xfdc3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3087da,null))[_0xfdc3('0x25')](removeEntity(_0x3087da,null))[_0xfdc3('0x41')](handleError(_0x3087da,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 32314f3..cd17f48 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 _0x4c60=['FieldId','lodash','util','../../config/logger','api','bluebird','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField'];(function(_0xa77c40,_0x1a184d){var _0x4d709a=function(_0x52696c){while(--_0x52696c){_0xa77c40['push'](_0xa77c40['shift']());}};_0x4d709a(++_0x1a184d);}(_0x4c60,0xc1));var _0x04c6=function(_0x24e69c,_0x550a42){_0x24e69c=_0x24e69c-0x0;var _0x3b5ca6=_0x4c60[_0x24e69c];return _0x3b5ca6;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x04c6('0xa'),_0x04c6('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_zoho_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField'];(function(_0x2b0ccf,_0x4ae4d4){var _0x5293e4=function(_0x4e852f){while(--_0x4e852f){_0x2b0ccf['push'](_0x2b0ccf['shift']());}};_0x5293e4(++_0x4ae4d4);}(_0x7a54,0x106));var _0x47a5=function(_0x17c76c,_0x1fb74c){_0x17c76c=_0x17c76c-0x0;var _0x582fa6=_0x7a54[_0x17c76c];return _0x582fa6;};'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':'zoho_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index fb8040e..ca8b1d3 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 _0x7b70=['client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b70,0x78));var _0x07b7=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x7b70[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x07b7('0x0'));var util=require(_0x07b7('0x1'));var moment=require(_0x07b7('0x2'));var BPromise=require(_0x07b7('0x3'));var rs=require(_0x07b7('0x4'));var fs=require('fs');var Redis=require(_0x07b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x07b7('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24e93d,_0xbdbf84,_0x5473f3){return new BPromise(function(_0x5dbe78,_0x4dc66c){return client[_0x07b7('0x7')](_0x24e93d,_0x5473f3)[_0x07b7('0x8')](function(_0x51f40){logger[_0x07b7('0x9')](_0x07b7('0xa'),_0xbdbf84,_0x07b7('0xb'));logger[_0x07b7('0xc')](_0x07b7('0xd'),_0xbdbf84,'request\x20sent',JSON['stringify'](_0x51f40));if(_0x51f40[_0x07b7('0xe')]){if(_0x51f40['error'][_0x07b7('0xf')]===0x1f4){logger[_0x07b7('0xe')]('ZohoField,\x20%s,\x20%s',_0xbdbf84,_0x51f40[_0x07b7('0xe')]['message']);return _0x4dc66c(_0x51f40[_0x07b7('0xe')][_0x07b7('0x10')]);}logger[_0x07b7('0xe')](_0x07b7('0xa'),_0xbdbf84,_0x51f40[_0x07b7('0xe')][_0x07b7('0x10')]);return _0x5dbe78(_0x51f40[_0x07b7('0xe')]['message']);}else{logger[_0x07b7('0x9')](_0x07b7('0xa'),_0xbdbf84,'request\x20sent');_0x5dbe78(_0x51f40['result'][_0x07b7('0x10')]);}})[_0x07b7('0x11')](function(_0x16feb4){logger['error']('ZohoField,\x20%s,\x20%s',_0xbdbf84,_0x16feb4);_0x4dc66c(_0x16feb4);});});} \ No newline at end of file +var _0x4f35=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x379294,_0x26e624){var _0x4f895d=function(_0x324ca7){while(--_0x324ca7){_0x379294['push'](_0x379294['shift']());}};_0x4f895d(++_0x26e624);}(_0x4f35,0x1b3));var _0x54f3=function(_0x5ba0c9,_0xa2f19a){_0x5ba0c9=_0x5ba0c9-0x0;var _0x9c99ba=_0x4f35[_0x5ba0c9];return _0x9c99ba;};'use strict';var _=require('lodash');var util=require(_0x54f3('0x0'));var moment=require(_0x54f3('0x1'));var BPromise=require(_0x54f3('0x2'));var rs=require(_0x54f3('0x3'));var fs=require('fs');var Redis=require(_0x54f3('0x4'));var db=require(_0x54f3('0x5'))['db'];var utils=require(_0x54f3('0x6'));var logger=require('../../config/logger')(_0x54f3('0x7'));var config=require('../../config/environment');var jayson=require(_0x54f3('0x8'));var client=jayson[_0x54f3('0x9')][_0x54f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ec65,_0x52ecef,_0x28863d){return new BPromise(function(_0x22427c,_0x5f2476){return client[_0x54f3('0xb')](_0x27ec65,_0x28863d)[_0x54f3('0xc')](function(_0x5e6b6e){logger['info'](_0x54f3('0xd'),_0x52ecef,_0x54f3('0xe'));logger[_0x54f3('0xf')](_0x54f3('0x10'),_0x52ecef,_0x54f3('0xe'),JSON[_0x54f3('0x11')](_0x5e6b6e));if(_0x5e6b6e[_0x54f3('0x12')]){if(_0x5e6b6e['error']['code']===0x1f4){logger[_0x54f3('0x12')](_0x54f3('0xd'),_0x52ecef,_0x5e6b6e[_0x54f3('0x12')][_0x54f3('0x13')]);return _0x5f2476(_0x5e6b6e[_0x54f3('0x12')][_0x54f3('0x13')]);}logger['error'](_0x54f3('0xd'),_0x52ecef,_0x5e6b6e[_0x54f3('0x12')][_0x54f3('0x13')]);return _0x22427c(_0x5e6b6e[_0x54f3('0x12')]['message']);}else{logger[_0x54f3('0x14')](_0x54f3('0xd'),_0x52ecef,_0x54f3('0xe'));_0x22427c(_0x5e6b6e['result']['message']);}})[_0x54f3('0x15')](function(_0x5a3ee2){logger[_0x54f3('0x12')](_0x54f3('0xd'),_0x52ecef,_0x5a3ee2);_0x5f2476(_0x5a3ee2);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 9da8409..d3947bf 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x435ce7,_0x5bf1ef){var _0x47edc0=function(_0x3510a8){while(--_0x3510a8){_0x435ce7['push'](_0x435ce7['shift']());}};_0x47edc0(++_0x5bf1ef);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x35cff0,_0x2e162c){var _0x4a9414=function(_0x569e67){while(--_0x569e67){_0x35cff0['push'](_0x35cff0['shift']());}};_0x4a9414(++_0x2e162c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index f1d41e5..f2eb190 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 _0x7e6b=['STRING','unique_name_and_version','INTEGER','BOOLEAN','state'];(function(_0x4e4a09,_0xe4eac8){var _0x17a756=function(_0x23b5ef){while(--_0x23b5ef){_0x4e4a09['push'](_0x4e4a09['shift']());}};_0x17a756(++_0xe4eac8);}(_0x7e6b,0x186));var _0xb7e6=function(_0x5a52df,_0x226d2a){_0x5a52df=_0x5a52df-0x0;var _0x303e7b=_0x7e6b[_0x5a52df];return _0x303e7b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb7e6('0x0')],'allowNull':![],'unique':_0xb7e6('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb7e6('0x1')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xb7e6('0x0')]},'path':{'type':Sequelize[_0xb7e6('0x0')]},'type':{'type':Sequelize[_0xb7e6('0x0')]},'size':{'type':Sequelize[_0xb7e6('0x2')]},'active':{'type':Sequelize[_0xb7e6('0x3')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xb7e6('0x0')],'unique':_0xb7e6('0x4')},'description':{'type':Sequelize[_0xb7e6('0x0')]},'title':{'type':Sequelize[_0xb7e6('0x0')]},'remoteUri':{'type':Sequelize[_0xb7e6('0x0')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xd61e=['INTEGER','BOOLEAN','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x139736,_0x2f6f94){var _0x4f6dd9=function(_0x32879e){while(--_0x32879e){_0x139736['push'](_0x139736['shift']());}};_0x4f6dd9(++_0x2f6f94);}(_0xd61e,0x13d));var _0xed61=function(_0x559076,_0x45d870){_0x559076=_0x559076-0x0;var _0x7c353d=_0xd61e[_0x559076];return _0x7c353d;};'use strict';var Sequelize=require(_0xed61('0x0'));module[_0xed61('0x1')]={'name':{'type':Sequelize[_0xed61('0x2')],'allowNull':![],'unique':_0xed61('0x3')},'version':{'type':Sequelize[_0xed61('0x2')],'allowNull':![],'unique':_0xed61('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xed61('0x4')},'filename':{'type':Sequelize[_0xed61('0x2')]},'path':{'type':Sequelize[_0xed61('0x2')]},'type':{'type':Sequelize[_0xed61('0x2')]},'size':{'type':Sequelize[_0xed61('0x5')]},'active':{'type':Sequelize[_0xed61('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xed61('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xed61('0x2')]},'link':{'type':Sequelize[_0xed61('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ac64810..0b1bf67 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 _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x66fa,0x117));var _0xa66f=function(_0x15a794,_0x471b70){_0x15a794=_0x15a794-0x0;var _0x3da0ae=_0x66fa[_0x15a794];return _0x3da0ae;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));}; \ No newline at end of file +var _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x1894e7,_0x1253e6){var _0x5e857f=function(_0x1b47c3){while(--_0x1b47c3){_0x1894e7['push'](_0x1894e7['shift']());}};_0x5e857f(++_0x1253e6);}(_0x9582,0x95));var _0x2958=function(_0x2ad076,_0x352e9f){_0x2ad076=_0x2ad076-0x0;var _0x2c165a=_0x9582[_0x2ad076];return _0x2c165a;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index fbed9e8..84c4e9d 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 _0xe19d=['../../config/logger','api','moment','path','rimraf','../../config/environment','./integration.attributes','Integration','integrations','lodash','util'];(function(_0x3d61c5,_0x1cff1d){var _0x80223f=function(_0x39a462){while(--_0x39a462){_0x3d61c5['push'](_0x3d61c5['shift']());}};_0x80223f(++_0x1cff1d);}(_0xe19d,0xa3));var _0xde19=function(_0x274584,_0x501942){_0x274584=_0x274584-0x0;var _0x3a068=_0xe19d[_0x274584];return _0x3a068;};'use strict';var _=require(_0xde19('0x0'));var util=require(_0xde19('0x1'));var logger=require(_0xde19('0x2'))(_0xde19('0x3'));var moment=require(_0xde19('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xde19('0x5'));var rimraf=require(_0xde19('0x6'));var config=require(_0xde19('0x7'));var attributes=require(_0xde19('0x8'));module['exports']=function(_0x2bc211,_0x130b28){return _0x2bc211['define'](_0xde19('0x9'),attributes,{'tableName':_0xde19('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa40f=['../../config/environment','./integration.attributes','integrations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2313ed,_0x1b8268){var _0x483fc8=function(_0x15f54a){while(--_0x15f54a){_0x2313ed['push'](_0x2313ed['shift']());}};_0x483fc8(++_0x1b8268);}(_0xa40f,0xfd));var _0xfa40=function(_0x257e8,_0x25ac58){_0x257e8=_0x257e8-0x0;var _0x3302e0=_0xa40f[_0x257e8];return _0x3302e0;};'use strict';var _=require('lodash');var util=require(_0xfa40('0x0'));var logger=require(_0xfa40('0x1'))(_0xfa40('0x2'));var moment=require(_0xfa40('0x3'));var BPromise=require(_0xfa40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa40('0x5'));var rimraf=require(_0xfa40('0x6'));var config=require(_0xfa40('0x7'));var attributes=require(_0xfa40('0x8'));module['exports']=function(_0x31165b,_0x1e096c){return _0x31165b['define']('Integration',attributes,{'tableName':_0xfa40('0x9'),'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 45d83ad..1303df8 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 _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x22d53d,_0x339808){var _0x40dd91=function(_0x1ea0a6){while(--_0x1ea0a6){_0x22d53d['push'](_0x22d53d['shift']());}};_0x40dd91(++_0x339808);}(_0xda2d,0x102));var _0xdda2=function(_0x4c191a,_0x139b1c){_0x4c191a=_0x4c191a-0x0;var _0x467eba=_0xda2d[_0x4c191a];return _0x467eba;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4a77e1,_0x213125){var _0x1bd46d=function(_0x1ab441){while(--_0x1ab441){_0x4a77e1['push'](_0x4a77e1['shift']());}};_0x1bd46d(++_0x213125);}(_0xef0f,0x168));var _0xfef0=function(_0x2d9bec,_0x25bd82){_0x2d9bec=_0x2d9bec-0x0;var _0x55536e=_0xef0f[_0x2d9bec];return _0x55536e;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('Integration,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2d6b780..87b3180 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x2be281,_0x4f239c){var _0xd5f129=function(_0x4d98d2){while(--_0x4d98d2){_0x2be281['push'](_0x2be281['shift']());}};_0xd5f129(++_0x4f239c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x0b0e[_0x4480b9];return _0x3f0f02;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file +var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x16fcdc,_0x31f66d){var _0x186aaa=function(_0x5cfca8){while(--_0x5cfca8){_0x16fcdc['push'](_0x16fcdc['shift']());}};_0x186aaa(++_0x31f66d);}(_0x7880,0x1f4));var _0x0788=function(_0x20be28,_0x24b925){_0x20be28=_0x20be28-0x0;var _0x8ab067=_0x7880[_0x20be28];return _0x8ab067;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 88395e3..cd45b4e 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 _0x2f40=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize'];(function(_0x167d83,_0x45516e){var _0x341d19=function(_0x42840c){while(--_0x42840c){_0x167d83['push'](_0x167d83['shift']());}};_0x341d19(++_0x45516e);}(_0x2f40,0xf9));var _0x02f4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2f40[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x02f4('0x0'));module[_0x02f4('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x02f4('0x2')]},'exitStatus':{'type':Sequelize[_0x02f4('0x2')]},'ticketId':{'type':Sequelize[_0x02f4('0x2')]},'integrationId':{'type':Sequelize[_0x02f4('0x3')]},'contacts':{'type':Sequelize[_0x02f4('0x2')]},'uniqueid':{'type':Sequelize[_0x02f4('0x2')]},'calleridnum':{'type':Sequelize[_0x02f4('0x2')]},'calleridname':{'type':Sequelize[_0x02f4('0x2')]},'queue':{'type':Sequelize[_0x02f4('0x2')]},'interface':{'type':Sequelize[_0x02f4('0x2')]},'membername':{'type':Sequelize[_0x02f4('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x02f4('0x4')]},'holdtime':{'type':Sequelize[_0x02f4('0x3')]},'agentcomplete':{'type':Sequelize[_0x02f4('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x02f4('0x4')]},'talktime':{'type':Sequelize[_0x02f4('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x02f4('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x02f4('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x02f4('0x4')]},'agentdump':{'type':Sequelize[_0x02f4('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x02f4('0x4')]},'lastevent':{'type':Sequelize[_0x02f4('0x2')]},'channel':{'type':Sequelize[_0x02f4('0x2')]},'channelstate':{'type':Sequelize[_0x02f4('0x3')]},'channelstatedesc':{'type':Sequelize[_0x02f4('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x02f4('0x2')]},'language':{'type':Sequelize[_0x02f4('0x2')]},'accountcode':{'type':Sequelize[_0x02f4('0x2')]},'context':{'type':Sequelize[_0x02f4('0x2')]},'exten':{'type':Sequelize[_0x02f4('0x2')]},'priority':{'type':Sequelize[_0x02f4('0x2')]},'destchannel':{'type':Sequelize[_0x02f4('0x2')]},'destchannelstate':{'type':Sequelize[_0x02f4('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x02f4('0x2')]},'destcalleridname':{'type':Sequelize[_0x02f4('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x02f4('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x02f4('0x2')]},'destcontext':{'type':Sequelize[_0x02f4('0x2')]},'destexten':{'type':Sequelize[_0x02f4('0x2')]},'destpriority':{'type':Sequelize[_0x02f4('0x2')]},'destuniqueid':{'type':Sequelize[_0x02f4('0x2')]},'messageId':{'type':Sequelize[_0x02f4('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x02f4('0x2')]},'from':{'type':Sequelize[_0x02f4('0x2')]},'to':{'type':Sequelize[_0x02f4('0x2')]},'cc':{'type':Sequelize[_0x02f4('0x2')]},'attachment':{'type':Sequelize[_0x02f4('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x02f4('0x7')]('SENT',_0x02f4('0x8'),_0x02f4('0x9'),'FAILED')},'url':{'type':Sequelize[_0x02f4('0x2')]},'app':{'type':Sequelize[_0x02f4('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x02f4('0x3')]}}; \ No newline at end of file +var _0x32bf=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED'];(function(_0x2eebc6,_0x14c2c5){var _0x4cfc1e=function(_0x395586){while(--_0x395586){_0x2eebc6['push'](_0x2eebc6['shift']());}};_0x4cfc1e(++_0x14c2c5);}(_0x32bf,0x83));var _0xf32b=function(_0x528f30,_0x1de48f){_0x528f30=_0x528f30-0x0;var _0x4a0077=_0x32bf[_0x528f30];return _0x4a0077;};'use strict';var Sequelize=require('sequelize');module[_0xf32b('0x0')]={'integration':{'type':Sequelize[_0xf32b('0x1')]},'eventChannel':{'type':Sequelize[_0xf32b('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xf32b('0x1')]},'integrationId':{'type':Sequelize[_0xf32b('0x2')]},'contacts':{'type':Sequelize[_0xf32b('0x1')]},'uniqueid':{'type':Sequelize[_0xf32b('0x1')]},'calleridnum':{'type':Sequelize[_0xf32b('0x1')]},'calleridname':{'type':Sequelize[_0xf32b('0x1')]},'queue':{'type':Sequelize[_0xf32b('0x1')]},'interface':{'type':Sequelize[_0xf32b('0x1')]},'membername':{'type':Sequelize[_0xf32b('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf32b('0x3')]},'agentconnectAt':{'type':Sequelize[_0xf32b('0x3')]},'holdtime':{'type':Sequelize[_0xf32b('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf32b('0x3')]},'talktime':{'type':Sequelize[_0xf32b('0x2')]},'agentacw':{'type':Sequelize[_0xf32b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf32b('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf32b('0x3')]},'agentdump':{'type':Sequelize[_0xf32b('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf32b('0x3')]},'lastevent':{'type':Sequelize[_0xf32b('0x1')]},'channel':{'type':Sequelize[_0xf32b('0x1')]},'channelstate':{'type':Sequelize[_0xf32b('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf32b('0x1')]},'connectedlinename':{'type':Sequelize[_0xf32b('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf32b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf32b('0x1')]},'destchannelstate':{'type':Sequelize[_0xf32b('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf32b('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf32b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf32b('0x1')]},'destlanguage':{'type':Sequelize[_0xf32b('0x1')]},'destaccountcode':{'type':Sequelize[_0xf32b('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf32b('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xf32b('0x1')]},'messageId':{'type':Sequelize[_0xf32b('0x1')]},'inReplyTo':{'type':Sequelize[_0xf32b('0x1')]},'subject':{'type':Sequelize[_0xf32b('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf32b('0x1')]},'cc':{'type':Sequelize[_0xf32b('0x1')]},'attachment':{'type':Sequelize[_0xf32b('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xf32b('0x5')]},'status':{'type':Sequelize[_0xf32b('0x6')]('SENT',_0xf32b('0x7'),_0xf32b('0x8'),_0xf32b('0x9'))},'url':{'type':Sequelize[_0xf32b('0x1')]},'app':{'type':Sequelize[_0xf32b('0x1')]},'appdata':{'type':Sequelize[_0xf32b('0x1')]},'projectId':{'type':Sequelize[_0xf32b('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 74f4a46..1811b3e 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 _0xf4c7=['fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','IntegrationReport','rawAttributes'];(function(_0xc53071,_0x2aec21){var _0x41ed36=function(_0x3258f9){while(--_0x3258f9){_0xc53071['push'](_0xc53071['shift']());}};_0x41ed36(++_0x2aec21);}(_0xf4c7,0x6a));var _0x7f4c=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xf4c7[_0x1fdb40];return _0x281f93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f4c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f4c('0x1'));var rp=require(_0x7f4c('0x2'));var moment=require(_0x7f4c('0x3'));var BPromise=require(_0x7f4c('0x4'));var Mustache=require('mustache');var util=require(_0x7f4c('0x5'));var path=require(_0x7f4c('0x6'));var sox=require(_0x7f4c('0x7'));var csv=require(_0x7f4c('0x8'));var ejs=require(_0x7f4c('0x9'));var fs=require('fs');var fs_extra=require(_0x7f4c('0xa'));var _=require(_0x7f4c('0xb'));var squel=require(_0x7f4c('0xc'));var crypto=require('crypto');var jsforce=require(_0x7f4c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7f4c('0x8'));var querystring=require(_0x7f4c('0xe'));var Papa=require(_0x7f4c('0xf'));var Redis=require(_0x7f4c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7f4c('0x11'));var as=require(_0x7f4c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7f4c('0x13'));var utils=require(_0x7f4c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7f4c('0x15'))['db'];function respondWithStatusCode(_0x287164,_0x187039){_0x187039=_0x187039||0xcc;return function(_0x33b906){if(_0x33b906){return _0x287164[_0x7f4c('0x16')](_0x187039);}return _0x287164['status'](_0x187039)[_0x7f4c('0x17')]();};}function respondWithResult(_0x3c4aae,_0x21adda){_0x21adda=_0x21adda||0xc8;return function(_0x183f2e){if(_0x183f2e){return _0x3c4aae[_0x7f4c('0x18')](_0x21adda)[_0x7f4c('0x19')](_0x183f2e);}};}function respondWithFilteredResult(_0x1a3305,_0x10d0cf){return function(_0x5d5353){if(_0x5d5353){var _0x31940c=typeof _0x10d0cf['offset']===_0x7f4c('0x1a')&&typeof _0x10d0cf['limit']===_0x7f4c('0x1a');var _0x1ddedb=_0x5d5353[_0x7f4c('0x1b')];var _0x4581fd=_0x31940c?0x0:_0x10d0cf['offset'];var _0x429d90=_0x31940c?_0x5d5353[_0x7f4c('0x1b')]:_0x10d0cf[_0x7f4c('0x1c')]+_0x10d0cf[_0x7f4c('0x1d')];var _0x1fd14e;if(_0x429d90>=_0x1ddedb){_0x429d90=_0x1ddedb;_0x1fd14e=0xc8;}else{_0x1fd14e=0xce;}_0x1a3305['status'](_0x1fd14e);return _0x1a3305[_0x7f4c('0x1e')]('Content-Range',_0x4581fd+'-'+_0x429d90+'/'+_0x1ddedb)[_0x7f4c('0x19')](_0x5d5353);}return null;};}function patchUpdates(_0x314dc9){return function(_0x3d68dc){try{jsonpatch[_0x7f4c('0x1f')](_0x3d68dc,_0x314dc9,!![]);}catch(_0x3da019){return BPromise[_0x7f4c('0x20')](_0x3da019);}return _0x3d68dc[_0x7f4c('0x21')]();};}function saveUpdates(_0x45c483,_0x194e9f){return function(_0x2a3dc2){if(_0x2a3dc2){return _0x2a3dc2[_0x7f4c('0x22')](_0x45c483)[_0x7f4c('0x23')](function(_0x41880c){return _0x41880c;});}return null;};}function removeEntity(_0x1ed55b,_0x5a6ebd){return function(_0x42b79f){if(_0x42b79f){return _0x42b79f[_0x7f4c('0x24')]()[_0x7f4c('0x23')](function(){_0x1ed55b['status'](0xcc)[_0x7f4c('0x17')]();});}};}function handleEntityNotFound(_0x4e2c78,_0x43bb4f){return function(_0x8b36b1){if(!_0x8b36b1){_0x4e2c78['sendStatus'](0x194);}return _0x8b36b1;};}function handleError(_0x37b41a,_0x378e8e){_0x378e8e=_0x378e8e||0x1f4;return function(_0x16c536){logger[_0x7f4c('0x25')](_0x16c536['stack']);if(_0x16c536[_0x7f4c('0x26')]){delete _0x16c536[_0x7f4c('0x26')];}_0x37b41a['status'](_0x378e8e)[_0x7f4c('0x27')](_0x16c536);};}exports[_0x7f4c('0x28')]=function(_0x582423,_0x495ece){var _0x3a5566={},_0x123eca={},_0x590996={'count':0x0,'rows':[]};var _0x10f552=_[_0x7f4c('0x29')](db[_0x7f4c('0x2a')][_0x7f4c('0x2b')],function(_0x35d192){return{'name':_0x35d192[_0x7f4c('0x2c')],'type':_0x35d192[_0x7f4c('0x2d')][_0x7f4c('0x2e')]};});_0x123eca[_0x7f4c('0x2f')]=_['map'](_0x10f552,'name');_0x123eca[_0x7f4c('0x30')]=_[_0x7f4c('0x31')](_0x582423['query']);_0x123eca[_0x7f4c('0x32')]=_['intersection'](_0x123eca[_0x7f4c('0x2f')],_0x123eca['query']);_0x3a5566[_0x7f4c('0x33')]=_[_0x7f4c('0x34')](_0x123eca[_0x7f4c('0x2f')],qs[_0x7f4c('0x35')](_0x582423[_0x7f4c('0x30')][_0x7f4c('0x35')]));_0x3a5566[_0x7f4c('0x33')]=_0x3a5566[_0x7f4c('0x33')]['length']?_0x3a5566['attributes']:_0x123eca[_0x7f4c('0x2f')];if(!_0x582423[_0x7f4c('0x30')][_0x7f4c('0x36')](_0x7f4c('0x37'))){_0x3a5566[_0x7f4c('0x1d')]=qs[_0x7f4c('0x1d')](_0x582423[_0x7f4c('0x30')][_0x7f4c('0x1d')]);_0x3a5566[_0x7f4c('0x1c')]=qs['offset'](_0x582423['query'][_0x7f4c('0x1c')]);}_0x3a5566[_0x7f4c('0x38')]=qs[_0x7f4c('0x39')](_0x582423[_0x7f4c('0x30')][_0x7f4c('0x39')]);_0x3a5566['where']=qs[_0x7f4c('0x32')](_[_0x7f4c('0x3a')](_0x582423[_0x7f4c('0x30')],_0x123eca[_0x7f4c('0x32')]),_0x10f552);if(_0x582423[_0x7f4c('0x30')]['filter']){_0x3a5566[_0x7f4c('0x3b')]=_[_0x7f4c('0x3c')](_0x3a5566['where'],{'$or':_['map'](_0x10f552,function(_0x41ade8){if(_0x41ade8[_0x7f4c('0x2d')]!==_0x7f4c('0x3d')){var _0x6786be={};_0x6786be[_0x41ade8[_0x7f4c('0x26')]]={'$like':'%'+_0x582423['query'][_0x7f4c('0x3e')]+'%'};return _0x6786be;}})});}_0x3a5566=_[_0x7f4c('0x3c')]({},_0x3a5566,_0x582423[_0x7f4c('0x3f')]);var _0x246a89={'where':_0x3a5566['where']};return db['IntegrationReport'][_0x7f4c('0x1b')](_0x246a89)[_0x7f4c('0x23')](function(_0x52dbdd){_0x590996[_0x7f4c('0x1b')]=_0x52dbdd;if(_0x582423[_0x7f4c('0x30')]['includeAll']){_0x3a5566[_0x7f4c('0x40')]=[{'all':!![]}];}return db[_0x7f4c('0x2a')][_0x7f4c('0x41')](_0x3a5566);})['then'](function(_0x5a88bd){_0x590996[_0x7f4c('0x42')]=_0x5a88bd;return _0x590996;})['then'](respondWithFilteredResult(_0x495ece,_0x3a5566))[_0x7f4c('0x43')](handleError(_0x495ece,null));};exports[_0x7f4c('0x44')]=function(_0x41462d,_0x58b573){var _0x2c0ef3={'raw':![],'where':{'id':_0x41462d[_0x7f4c('0x45')]['id']}},_0x463455={};_0x463455[_0x7f4c('0x2f')]=_[_0x7f4c('0x31')](db[_0x7f4c('0x2a')]['rawAttributes']);_0x463455['query']=_[_0x7f4c('0x31')](_0x41462d[_0x7f4c('0x30')]);_0x463455[_0x7f4c('0x32')]=_['intersection'](_0x463455[_0x7f4c('0x2f')],_0x463455[_0x7f4c('0x30')]);_0x2c0ef3[_0x7f4c('0x33')]=_[_0x7f4c('0x34')](_0x463455['model'],qs[_0x7f4c('0x35')](_0x41462d[_0x7f4c('0x30')][_0x7f4c('0x35')]));_0x2c0ef3[_0x7f4c('0x33')]=_0x2c0ef3[_0x7f4c('0x33')]['length']?_0x2c0ef3[_0x7f4c('0x33')]:_0x463455[_0x7f4c('0x2f')];if(_0x41462d[_0x7f4c('0x30')][_0x7f4c('0x46')]){_0x2c0ef3['include']=[{'all':!![]}];}_0x2c0ef3=_[_0x7f4c('0x3c')]({},_0x2c0ef3,_0x41462d[_0x7f4c('0x3f')]);return db['IntegrationReport'][_0x7f4c('0x47')](_0x2c0ef3)['then'](handleEntityNotFound(_0x58b573,null))['then'](respondWithResult(_0x58b573,null))[_0x7f4c('0x43')](handleError(_0x58b573,null));};exports[_0x7f4c('0x48')]=function(_0x3ee1d3,_0x41d4e8){return db[_0x7f4c('0x2a')]['create'](_0x3ee1d3[_0x7f4c('0x49')],{})['then'](respondWithResult(_0x41d4e8,0xc9))[_0x7f4c('0x43')](handleError(_0x41d4e8,null));};exports['update']=function(_0x579abf,_0x366927){if(_0x579abf[_0x7f4c('0x49')]['id']){delete _0x579abf[_0x7f4c('0x49')]['id'];}return db['IntegrationReport'][_0x7f4c('0x47')]({'where':{'id':_0x579abf[_0x7f4c('0x45')]['id']}})[_0x7f4c('0x23')](handleEntityNotFound(_0x366927,null))[_0x7f4c('0x23')](saveUpdates(_0x579abf['body'],null))[_0x7f4c('0x23')](respondWithResult(_0x366927,null))[_0x7f4c('0x43')](handleError(_0x366927,null));};exports['destroy']=function(_0x68105f,_0x1bca5d){return db[_0x7f4c('0x2a')][_0x7f4c('0x47')]({'where':{'id':_0x68105f[_0x7f4c('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bca5d,null))[_0x7f4c('0x23')](removeEntity(_0x1bca5d,null))[_0x7f4c('0x43')](handleError(_0x1bca5d,null));};exports[_0x7f4c('0x4a')]=function(_0x3ec38b,_0x18bc85){return db[_0x7f4c('0x2a')]['describe']()[_0x7f4c('0x23')](respondWithResult(_0x18bc85,null))['catch'](handleError(_0x18bc85,null));}; \ No newline at end of file +var _0x235a=['../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3db306,_0x39a363){var _0x1ed8c4=function(_0x39a62d){while(--_0x39a62d){_0x3db306['push'](_0x3db306['shift']());}};_0x1ed8c4(++_0x39a363);}(_0x235a,0xc7));var _0xa235=function(_0x28e7ea,_0x5af04c){_0x28e7ea=_0x28e7ea-0x0;var _0x32998b=_0x235a[_0x28e7ea];return _0x32998b;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa235('0x2'));var rp=require('request-promise');var moment=require(_0xa235('0x3'));var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa235('0x6'));var csv=require(_0xa235('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa235('0x8'));var _=require(_0xa235('0x9'));var squel=require('squel');var crypto=require(_0xa235('0xa'));var jsforce=require(_0xa235('0xb'));var deskjs=require(_0xa235('0xc'));var toCsv=require(_0xa235('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0xd'));var qs=require(_0xa235('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa235('0xf'));var logger=require('../../config/logger')(_0xa235('0x10'));var utils=require(_0xa235('0x11'));var config=require(_0xa235('0x12'));var licenseUtil=require(_0xa235('0x13'));var db=require(_0xa235('0x14'))['db'];function respondWithStatusCode(_0x109f20,_0x6a0d69){_0x6a0d69=_0x6a0d69||0xcc;return function(_0x21ddf0){if(_0x21ddf0){return _0x109f20['sendStatus'](_0x6a0d69);}return _0x109f20[_0xa235('0x15')](_0x6a0d69)['end']();};}function respondWithResult(_0x4a0614,_0x137968){_0x137968=_0x137968||0xc8;return function(_0x2b31f1){if(_0x2b31f1){return _0x4a0614[_0xa235('0x15')](_0x137968)[_0xa235('0x16')](_0x2b31f1);}};}function respondWithFilteredResult(_0x23e2df,_0x377527){return function(_0xffb4e0){if(_0xffb4e0){var _0x1ebb0e=typeof _0x377527[_0xa235('0x17')]===_0xa235('0x18')&&typeof _0x377527['limit']===_0xa235('0x18');var _0x56a352=_0xffb4e0[_0xa235('0x19')];var _0x159d30=_0x1ebb0e?0x0:_0x377527[_0xa235('0x17')];var _0x15f7c8=_0x1ebb0e?_0xffb4e0['count']:_0x377527['offset']+_0x377527[_0xa235('0x1a')];var _0x144dd9;if(_0x15f7c8>=_0x56a352){_0x15f7c8=_0x56a352;_0x144dd9=0xc8;}else{_0x144dd9=0xce;}_0x23e2df['status'](_0x144dd9);return _0x23e2df[_0xa235('0x1b')](_0xa235('0x1c'),_0x159d30+'-'+_0x15f7c8+'/'+_0x56a352)[_0xa235('0x16')](_0xffb4e0);}return null;};}function patchUpdates(_0x111d0e){return function(_0x4cc35c){try{jsonpatch[_0xa235('0x1d')](_0x4cc35c,_0x111d0e,!![]);}catch(_0x44f3a3){return BPromise['reject'](_0x44f3a3);}return _0x4cc35c[_0xa235('0x1e')]();};}function saveUpdates(_0x36a7f0,_0x3c8f7e){return function(_0x29d111){if(_0x29d111){return _0x29d111[_0xa235('0x1f')](_0x36a7f0)[_0xa235('0x20')](function(_0x55efb){return _0x55efb;});}return null;};}function removeEntity(_0x14de12,_0x5d8a1b){return function(_0x434903){if(_0x434903){return _0x434903['destroy']()[_0xa235('0x20')](function(){_0x14de12[_0xa235('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aab5f,_0x10dc57){return function(_0x2b0d3c){if(!_0x2b0d3c){_0x5aab5f[_0xa235('0x21')](0x194);}return _0x2b0d3c;};}function handleError(_0xe767af,_0x6586f6){_0x6586f6=_0x6586f6||0x1f4;return function(_0x5767c7){logger[_0xa235('0x22')](_0x5767c7['stack']);if(_0x5767c7[_0xa235('0x23')]){delete _0x5767c7[_0xa235('0x23')];}_0xe767af[_0xa235('0x15')](_0x6586f6)[_0xa235('0x24')](_0x5767c7);};}exports[_0xa235('0x25')]=function(_0x22a794,_0xf9dea6){var _0x47ea60={},_0x5cd355={},_0x123a5c={'count':0x0,'rows':[]};var _0x3e9190=_[_0xa235('0x26')](db[_0xa235('0x27')][_0xa235('0x28')],function(_0x5a765f){return{'name':_0x5a765f[_0xa235('0x29')],'type':_0x5a765f[_0xa235('0x2a')][_0xa235('0x2b')]};});_0x5cd355['model']=_[_0xa235('0x26')](_0x3e9190,_0xa235('0x23'));_0x5cd355[_0xa235('0x2c')]=_[_0xa235('0x2d')](_0x22a794[_0xa235('0x2c')]);_0x5cd355[_0xa235('0x2e')]=_[_0xa235('0x2f')](_0x5cd355[_0xa235('0x30')],_0x5cd355[_0xa235('0x2c')]);_0x47ea60[_0xa235('0x31')]=_[_0xa235('0x2f')](_0x5cd355[_0xa235('0x30')],qs[_0xa235('0x32')](_0x22a794[_0xa235('0x2c')][_0xa235('0x32')]));_0x47ea60[_0xa235('0x31')]=_0x47ea60[_0xa235('0x31')][_0xa235('0x33')]?_0x47ea60[_0xa235('0x31')]:_0x5cd355[_0xa235('0x30')];if(!_0x22a794[_0xa235('0x2c')][_0xa235('0x34')](_0xa235('0x35'))){_0x47ea60[_0xa235('0x1a')]=qs[_0xa235('0x1a')](_0x22a794[_0xa235('0x2c')][_0xa235('0x1a')]);_0x47ea60[_0xa235('0x17')]=qs[_0xa235('0x17')](_0x22a794[_0xa235('0x2c')][_0xa235('0x17')]);}_0x47ea60[_0xa235('0x36')]=qs[_0xa235('0x37')](_0x22a794[_0xa235('0x2c')]['sort']);_0x47ea60[_0xa235('0x38')]=qs[_0xa235('0x2e')](_[_0xa235('0x39')](_0x22a794['query'],_0x5cd355[_0xa235('0x2e')]),_0x3e9190);if(_0x22a794['query'][_0xa235('0x3a')]){_0x47ea60[_0xa235('0x38')]=_[_0xa235('0x3b')](_0x47ea60[_0xa235('0x38')],{'$or':_[_0xa235('0x26')](_0x3e9190,function(_0x15ba38){if(_0x15ba38[_0xa235('0x2a')]!==_0xa235('0x3c')){var _0x3d37c5={};_0x3d37c5[_0x15ba38['name']]={'$like':'%'+_0x22a794[_0xa235('0x2c')][_0xa235('0x3a')]+'%'};return _0x3d37c5;}})});}_0x47ea60=_[_0xa235('0x3b')]({},_0x47ea60,_0x22a794[_0xa235('0x3d')]);var _0x1de18d={'where':_0x47ea60[_0xa235('0x38')]};return db[_0xa235('0x27')][_0xa235('0x19')](_0x1de18d)[_0xa235('0x20')](function(_0x29e9be){_0x123a5c[_0xa235('0x19')]=_0x29e9be;if(_0x22a794[_0xa235('0x2c')]['includeAll']){_0x47ea60[_0xa235('0x3e')]=[{'all':!![]}];}return db[_0xa235('0x27')][_0xa235('0x3f')](_0x47ea60);})[_0xa235('0x20')](function(_0x48bab8){_0x123a5c[_0xa235('0x40')]=_0x48bab8;return _0x123a5c;})[_0xa235('0x20')](respondWithFilteredResult(_0xf9dea6,_0x47ea60))[_0xa235('0x41')](handleError(_0xf9dea6,null));};exports[_0xa235('0x42')]=function(_0x468043,_0x436f21){var _0x4bf221={'raw':![],'where':{'id':_0x468043[_0xa235('0x43')]['id']}},_0x7ddc69={};_0x7ddc69[_0xa235('0x30')]=_[_0xa235('0x2d')](db[_0xa235('0x27')][_0xa235('0x28')]);_0x7ddc69['query']=_[_0xa235('0x2d')](_0x468043[_0xa235('0x2c')]);_0x7ddc69[_0xa235('0x2e')]=_[_0xa235('0x2f')](_0x7ddc69[_0xa235('0x30')],_0x7ddc69[_0xa235('0x2c')]);_0x4bf221['attributes']=_['intersection'](_0x7ddc69[_0xa235('0x30')],qs[_0xa235('0x32')](_0x468043[_0xa235('0x2c')][_0xa235('0x32')]));_0x4bf221['attributes']=_0x4bf221[_0xa235('0x31')][_0xa235('0x33')]?_0x4bf221[_0xa235('0x31')]:_0x7ddc69[_0xa235('0x30')];if(_0x468043[_0xa235('0x2c')][_0xa235('0x44')]){_0x4bf221[_0xa235('0x3e')]=[{'all':!![]}];}_0x4bf221=_['merge']({},_0x4bf221,_0x468043[_0xa235('0x3d')]);return db[_0xa235('0x27')][_0xa235('0x45')](_0x4bf221)[_0xa235('0x20')](handleEntityNotFound(_0x436f21,null))[_0xa235('0x20')](respondWithResult(_0x436f21,null))[_0xa235('0x41')](handleError(_0x436f21,null));};exports[_0xa235('0x46')]=function(_0x2aef7d,_0x2f9868){return db[_0xa235('0x27')]['create'](_0x2aef7d['body'],{})['then'](respondWithResult(_0x2f9868,0xc9))[_0xa235('0x41')](handleError(_0x2f9868,null));};exports[_0xa235('0x1f')]=function(_0x955c32,_0xba295e){if(_0x955c32[_0xa235('0x47')]['id']){delete _0x955c32[_0xa235('0x47')]['id'];}return db[_0xa235('0x27')][_0xa235('0x45')]({'where':{'id':_0x955c32[_0xa235('0x43')]['id']}})['then'](handleEntityNotFound(_0xba295e,null))[_0xa235('0x20')](saveUpdates(_0x955c32[_0xa235('0x47')],null))[_0xa235('0x20')](respondWithResult(_0xba295e,null))[_0xa235('0x41')](handleError(_0xba295e,null));};exports['destroy']=function(_0x2264f8,_0x280589){return db['IntegrationReport']['find']({'where':{'id':_0x2264f8[_0xa235('0x43')]['id']}})['then'](handleEntityNotFound(_0x280589,null))[_0xa235('0x20')](removeEntity(_0x280589,null))[_0xa235('0x41')](handleError(_0x280589,null));};exports[_0xa235('0x48')]=function(_0x526033,_0x3c3549){return db[_0xa235('0x27')][_0xa235('0x48')]()[_0xa235('0x20')](respondWithResult(_0x3c3549,null))['catch'](handleError(_0x3c3549,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e4e5b67..7583dde 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 _0x2e68=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','api','moment','bluebird','request-promise','path'];(function(_0x333a1a,_0x38ce54){var _0xa56834=function(_0x1da9c1){while(--_0x1da9c1){_0x333a1a['push'](_0x333a1a['shift']());}};_0xa56834(++_0x38ce54);}(_0x2e68,0x19a));var _0x82e6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2e68[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x82e6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x82e6('0x1'));var moment=require(_0x82e6('0x2'));var BPromise=require(_0x82e6('0x3'));var rp=require(_0x82e6('0x4'));var fs=require('fs');var path=require(_0x82e6('0x5'));var rimraf=require(_0x82e6('0x6'));var config=require(_0x82e6('0x7'));var attributes=require(_0x82e6('0x8'));module[_0x82e6('0x9')]=function(_0x2c28ec,_0x1f8003){return _0x2c28ec[_0x82e6('0xa')](_0x82e6('0xb'),attributes,{'tableName':_0x82e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ea4=['./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util','api','moment','request-promise','path'];(function(_0x6182bc,_0x1d3f99){var _0x4e1952=function(_0x9b78ac){while(--_0x9b78ac){_0x6182bc['push'](_0x6182bc['shift']());}};_0x4e1952(++_0x1d3f99);}(_0x5ea4,0x86));var _0x45ea=function(_0x1d0088,_0xd875e9){_0x1d0088=_0x1d0088-0x0;var _0x14a99f=_0x5ea4[_0x1d0088];return _0x14a99f;};'use strict';var _=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var logger=require('../../config/logger')(_0x45ea('0x2'));var moment=require(_0x45ea('0x3'));var BPromise=require('bluebird');var rp=require(_0x45ea('0x4'));var fs=require('fs');var path=require(_0x45ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x45ea('0x6'));module['exports']=function(_0x140faf,_0x5b3d43){return _0x140faf[_0x45ea('0x7')](_0x45ea('0x8'),attributes,{'tableName':_0x45ea('0x9'),'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 3378e67..19a42da 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x1967,0x173));var _0x7196=function(_0x3ca5ea,_0x2e2cd1){_0x3ca5ea=_0x3ca5ea-0x0;var _0x87b580=_0x1967[_0x3ca5ea];return _0x87b580;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x225074,_0x1abb16){_0x225074=_0x225074-0x0;var _0x3fb50c=_0x3f8a[_0x225074];return _0x3fb50c;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 696b3af..120f53d 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 _0x7c09=['put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','/:id','isAuthenticated','show','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x7c09,0x102));var _0x97c0=function(_0x4adffa,_0x4b3d49){_0x4adffa=_0x4adffa-0x0;var _0x439a91=_0x7c09[_0x4adffa];return _0x439a91;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0x9')]('/:id/sub_intervals',auth[_0x97c0('0xb')](),controller['getIntervals']);router[_0x97c0('0xd')]('/',auth[_0x97c0('0xb')](),controller['create']);router['post'](_0x97c0('0xe'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xf')]);router[_0x97c0('0xd')](_0x97c0('0x10'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x11')]);router[_0x97c0('0x12')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x13')]);router[_0x97c0('0x14')](_0x97c0('0xa'),auth['isAuthenticated'](),controller[_0x97c0('0x15')]);module[_0x97c0('0x16')]=router; \ No newline at end of file +var _0xd943=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','create','post','/:id/sub_intervals/create_many','update','delete','/:id','destroy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd943,0x14a));var _0x3d94=function(_0xd11bfe,_0xc8df63){_0xd11bfe=_0xd11bfe-0x0;var _0x4d7ab8=_0xd943[_0xd11bfe];return _0x4d7ab8;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require(_0x3d94('0x4'));var router=express[_0x3d94('0x5')]();var fs_extra=require(_0x3d94('0x6'));var auth=require(_0x3d94('0x7'));var interaction=require(_0x3d94('0x8'));var config=require(_0x3d94('0x9'));var controller=require(_0x3d94('0xa'));router[_0x3d94('0xb')]('/',auth[_0x3d94('0xc')](),controller[_0x3d94('0xd')]);router[_0x3d94('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x3d94('0xe'),auth[_0x3d94('0xc')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x3d94('0xf')]);router['post']('/:id/sub_intervals',auth[_0x3d94('0xc')](),controller['addInterval']);router[_0x3d94('0x10')](_0x3d94('0x11'),auth[_0x3d94('0xc')](),controller['addIntervals']);router['put']('/:id',auth[_0x3d94('0xc')](),controller[_0x3d94('0x12')]);router[_0x3d94('0x13')](_0x3d94('0x14'),auth['isAuthenticated'](),controller[_0x3d94('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 9a3630e..112d921 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 _0x19b8=['STRING','sequelize','exports'];(function(_0xc19624,_0x1f840f){var _0x23b300=function(_0x5ab4a8){while(--_0x5ab4a8){_0xc19624['push'](_0xc19624['shift']());}};_0x23b300(++_0x1f840f);}(_0x19b8,0x97));var _0x819b=function(_0x465be6,_0x2668de){_0x465be6=_0x465be6-0x0;var _0x45f7b1=_0x19b8[_0x465be6];return _0x45f7b1;};'use strict';var Sequelize=require(_0x819b('0x0'));module[_0x819b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x819b('0x2')]},'interval':{'type':Sequelize[_0x819b('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xaab6=['sequelize','STRING'];(function(_0x4e32d1,_0x14b293){var _0x1821cc=function(_0x114ae7){while(--_0x114ae7){_0x4e32d1['push'](_0x4e32d1['shift']());}};_0x1821cc(++_0x14b293);}(_0xaab6,0x12c));var _0x6aab=function(_0x1999ca,_0x2951ea){_0x1999ca=_0x1999ca-0x0;var _0xfcfdf6=_0xaab6[_0x1999ca];return _0xfcfdf6;};'use strict';var Sequelize=require(_0x6aab('0x0'));module['exports']={'name':{'type':Sequelize[_0x6aab('0x1')]},'description':{'type':Sequelize[_0x6aab('0x1')]},'interval':{'type':Sequelize[_0x6aab('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 1406073..dfdabec 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 _0x78e4=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','Interval','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addInterval','IntervalId','create','getIntervals','findOne','length','addIntervals','sequelize','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x589162,_0x1e8537){var _0x2826e6=function(_0x31ea78){while(--_0x31ea78){_0x589162['push'](_0x589162['shift']());}};_0x2826e6(++_0x1e8537);}(_0x78e4,0x1bf));var _0x478e=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x78e4[_0x474bc0];return _0x4b24cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x478e('0x0'));var zipdir=require(_0x478e('0x1'));var jsonpatch=require(_0x478e('0x2'));var rp=require(_0x478e('0x3'));var moment=require(_0x478e('0x4'));var BPromise=require(_0x478e('0x5'));var Mustache=require(_0x478e('0x6'));var util=require(_0x478e('0x7'));var path=require(_0x478e('0x8'));var sox=require(_0x478e('0x9'));var csv=require(_0x478e('0xa'));var ejs=require(_0x478e('0xb'));var fs=require('fs');var fs_extra=require(_0x478e('0xc'));var _=require(_0x478e('0xd'));var squel=require(_0x478e('0xe'));var crypto=require(_0x478e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x478e('0x10'));var toCsv=require(_0x478e('0xa'));var querystring=require('querystring');var Papa=require(_0x478e('0x11'));var Redis=require('ioredis');var authService=require(_0x478e('0x12'));var qs=require(_0x478e('0x13'));var as=require(_0x478e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x478e('0x15'))(_0x478e('0x16'));var utils=require(_0x478e('0x17'));var config=require(_0x478e('0x18'));var licenseUtil=require(_0x478e('0x19'));var db=require(_0x478e('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x21bb9b,_0x4a033c){_0x4a033c=_0x4a033c||0xcc;return function(_0x163bbd){if(_0x163bbd){return _0x21bb9b[_0x478e('0x1b')](_0x4a033c);}return _0x21bb9b[_0x478e('0x1c')](_0x4a033c)[_0x478e('0x1d')]();};}function respondWithResult(_0x52d1f6,_0x3f9c56){_0x3f9c56=_0x3f9c56||0xc8;return function(_0x1a603b){if(_0x1a603b){return _0x52d1f6[_0x478e('0x1c')](_0x3f9c56)[_0x478e('0x1e')](_0x1a603b);}};}function respondWithFilteredResult(_0x24cc4e,_0x1abfd9){return function(_0x48ac6c){if(_0x48ac6c){var _0x128d96=typeof _0x1abfd9[_0x478e('0x1f')]===_0x478e('0x20')&&typeof _0x1abfd9[_0x478e('0x21')]===_0x478e('0x20');var _0x291155=_0x48ac6c[_0x478e('0x22')];var _0xfdcc1f=_0x128d96?0x0:_0x1abfd9[_0x478e('0x1f')];var _0x31383d=_0x128d96?_0x48ac6c[_0x478e('0x22')]:_0x1abfd9[_0x478e('0x1f')]+_0x1abfd9[_0x478e('0x21')];var _0x432885;if(_0x31383d>=_0x291155){_0x31383d=_0x291155;_0x432885=0xc8;}else{_0x432885=0xce;}_0x24cc4e[_0x478e('0x1c')](_0x432885);return _0x24cc4e[_0x478e('0x23')](_0x478e('0x24'),_0xfdcc1f+'-'+_0x31383d+'/'+_0x291155)['json'](_0x48ac6c);}return null;};}function patchUpdates(_0xe91414){return function(_0x624f4f){try{jsonpatch[_0x478e('0x25')](_0x624f4f,_0xe91414,!![]);}catch(_0x3d635a){return BPromise[_0x478e('0x26')](_0x3d635a);}return _0x624f4f['save']();};}function saveUpdates(_0x25e806,_0x2bde2d){return function(_0x5b7529){if(_0x5b7529){return _0x5b7529['update'](_0x25e806)[_0x478e('0x27')](function(_0x35556a){return _0x35556a;});}return null;};}function removeEntity(_0x362117,_0x42cf14){return function(_0x1b1531){if(_0x1b1531){return _0x1b1531[_0x478e('0x28')]()[_0x478e('0x27')](function(){var _0x593e3a=_0x1b1531[_0x478e('0x29')]({'plain':!![]});var _0x366928='Intervals';return db[_0x478e('0x2a')]['destroy']({'where':{'type':_0x366928,'resourceId':_0x593e3a['id']}})[_0x478e('0x27')](function(){return _0x1b1531;});})['then'](function(){_0x362117[_0x478e('0x1c')](0xcc)[_0x478e('0x1d')]();});}};}function handleEntityNotFound(_0x3e1b1f,_0x388f15){return function(_0x354fd3){if(!_0x354fd3){_0x3e1b1f[_0x478e('0x1b')](0x194);}return _0x354fd3;};}function handleError(_0x2a9413,_0x25b9e2){_0x25b9e2=_0x25b9e2||0x1f4;return function(_0x3e3d23){logger[_0x478e('0x2b')](_0x3e3d23[_0x478e('0x2c')]);if(_0x3e3d23[_0x478e('0x2d')]){delete _0x3e3d23['name'];}_0x2a9413['status'](_0x25b9e2)[_0x478e('0x2e')](_0x3e3d23);};}exports['index']=function(_0x199e76,_0x352aec){var _0xd8851e={},_0x2602f3={},_0x5ae037={'count':0x0,'rows':[]};var _0x51509a=_['map'](db[_0x478e('0x2f')][_0x478e('0x30')],function(_0x1ee5a5){return{'name':_0x1ee5a5[_0x478e('0x31')],'type':_0x1ee5a5[_0x478e('0x32')][_0x478e('0x33')]};});_0x2602f3[_0x478e('0x34')]=_[_0x478e('0x35')](_0x51509a,_0x478e('0x2d'));_0x2602f3['query']=_[_0x478e('0x36')](_0x199e76[_0x478e('0x37')]);_0x2602f3[_0x478e('0x38')]=_[_0x478e('0x39')](_0x2602f3[_0x478e('0x34')],_0x2602f3[_0x478e('0x37')]);_0xd8851e[_0x478e('0x3a')]=_[_0x478e('0x39')](_0x2602f3[_0x478e('0x34')],qs[_0x478e('0x3b')](_0x199e76[_0x478e('0x37')][_0x478e('0x3b')]));_0xd8851e[_0x478e('0x3a')]=_0xd8851e[_0x478e('0x3a')]['length']?_0xd8851e[_0x478e('0x3a')]:_0x2602f3[_0x478e('0x34')];if(!_0x199e76['query']['hasOwnProperty'](_0x478e('0x3c'))){_0xd8851e[_0x478e('0x21')]=qs[_0x478e('0x21')](_0x199e76[_0x478e('0x37')]['limit']);_0xd8851e['offset']=qs[_0x478e('0x1f')](_0x199e76[_0x478e('0x37')][_0x478e('0x1f')]);}_0xd8851e[_0x478e('0x3d')]=qs['sort'](_0x199e76[_0x478e('0x37')][_0x478e('0x3e')]);_0xd8851e[_0x478e('0x3f')]=qs[_0x478e('0x38')](_[_0x478e('0x40')](_0x199e76[_0x478e('0x37')],_0x2602f3['filters']),_0x51509a);if(_0x199e76[_0x478e('0x37')][_0x478e('0x41')]){_0xd8851e['where']=_['merge'](_0xd8851e['where'],{'$or':_[_0x478e('0x35')](_0x51509a,function(_0xd756a9){if(_0xd756a9[_0x478e('0x32')]!==_0x478e('0x42')){var _0x27fc89={};_0x27fc89[_0xd756a9['name']]={'$like':'%'+_0x199e76['query'][_0x478e('0x41')]+'%'};return _0x27fc89;}})});}_0xd8851e=_[_0x478e('0x43')]({},_0xd8851e,_0x199e76[_0x478e('0x44')]);var _0x24485c={'where':_0xd8851e[_0x478e('0x3f')]};return db['Interval'][_0x478e('0x22')](_0x24485c)[_0x478e('0x27')](function(_0x206e8b){_0x5ae037[_0x478e('0x22')]=_0x206e8b;if(_0x199e76['query'][_0x478e('0x45')]){_0xd8851e[_0x478e('0x46')]=[{'all':!![]}];}return db[_0x478e('0x2f')][_0x478e('0x47')](_0xd8851e);})['then'](function(_0xbdd5cf){_0x5ae037[_0x478e('0x48')]=_0xbdd5cf;return _0x5ae037;})[_0x478e('0x27')](respondWithFilteredResult(_0x352aec,_0xd8851e))[_0x478e('0x49')](handleError(_0x352aec,null));};exports[_0x478e('0x4a')]=function(_0x57e389,_0x4b064d){var _0x5b369c={'raw':!![],'where':{'id':_0x57e389['params']['id']}},_0x583c21={};_0x583c21['model']=_[_0x478e('0x36')](db[_0x478e('0x2f')][_0x478e('0x30')]);_0x583c21[_0x478e('0x37')]=_[_0x478e('0x36')](_0x57e389[_0x478e('0x37')]);_0x583c21['filters']=_[_0x478e('0x39')](_0x583c21[_0x478e('0x34')],_0x583c21[_0x478e('0x37')]);_0x5b369c[_0x478e('0x3a')]=_[_0x478e('0x39')](_0x583c21['model'],qs[_0x478e('0x3b')](_0x57e389[_0x478e('0x37')]['fields']));_0x5b369c[_0x478e('0x3a')]=_0x5b369c[_0x478e('0x3a')]['length']?_0x5b369c[_0x478e('0x3a')]:_0x583c21[_0x478e('0x34')];if(_0x57e389['query']['includeAll']){_0x5b369c[_0x478e('0x46')]=[{'all':!![]}];}_0x5b369c=_['merge']({},_0x5b369c,_0x57e389[_0x478e('0x44')]);return db[_0x478e('0x2f')][_0x478e('0x4b')](_0x5b369c)[_0x478e('0x27')](handleEntityNotFound(_0x4b064d,null))['then'](respondWithResult(_0x4b064d,null))['catch'](handleError(_0x4b064d,null));};exports['create']=function(_0x20fc1c,_0x59fdd1){return db['Interval']['create'](_0x20fc1c[_0x478e('0x4c')],{})['then'](function(_0x1b8e22){var _0x5b1831=_0x20fc1c['user'][_0x478e('0x29')]({'plain':!![]});if(!_0x5b1831)throw new Error(_0x478e('0x4d'));if(_0x5b1831[_0x478e('0x4e')]==='user'){var _0x12cddb=_0x1b8e22[_0x478e('0x29')]({'plain':!![]});var _0xd6fe13='Intervals';return db[_0x478e('0x4f')][_0x478e('0x4b')]({'where':{'name':_0xd6fe13,'userProfileId':_0x5b1831[_0x478e('0x50')]},'raw':!![]})[_0x478e('0x27')](function(_0x1958b5){if(_0x1958b5&&_0x1958b5[_0x478e('0x51')]===0x0){return db[_0x478e('0x2a')]['create']({'name':_0x12cddb[_0x478e('0x2d')],'resourceId':_0x12cddb['id'],'type':_0x1958b5[_0x478e('0x2d')],'sectionId':_0x1958b5['id']},{})['then'](function(){return _0x1b8e22;});}else{return _0x1b8e22;}})[_0x478e('0x49')](function(_0x2e8cae){logger[_0x478e('0x2b')](_0x478e('0x52'),_0x2e8cae);throw _0x2e8cae;});}return _0x1b8e22;})[_0x478e('0x27')](respondWithResult(_0x59fdd1,0xc9))[_0x478e('0x49')](handleError(_0x59fdd1,null));};exports[_0x478e('0x53')]=function(_0x4382d1,_0x1659ed){if(_0x4382d1['body']['id']){delete _0x4382d1[_0x478e('0x4c')]['id'];}return db[_0x478e('0x2f')]['find']({'where':{'id':_0x4382d1[_0x478e('0x54')]['id']}})[_0x478e('0x27')](handleEntityNotFound(_0x1659ed,null))['then'](saveUpdates(_0x4382d1[_0x478e('0x4c')],null))[_0x478e('0x27')](respondWithResult(_0x1659ed,null))[_0x478e('0x49')](handleError(_0x1659ed,null));};exports['destroy']=function(_0x4d2257,_0x23c316){return db[_0x478e('0x2f')][_0x478e('0x4b')]({'where':{'id':_0x4d2257[_0x478e('0x54')]['id']}})[_0x478e('0x27')](handleEntityNotFound(_0x23c316,null))[_0x478e('0x27')](removeEntity(_0x23c316,null))[_0x478e('0x49')](handleError(_0x23c316,null));};exports[_0x478e('0x55')]=function(_0x1b6f0d,_0x580be5,_0x5d7d6a){if(_0x1b6f0d['body']['id']){delete _0x1b6f0d['body']['id'];}return db[_0x478e('0x2f')][_0x478e('0x4b')]({'where':{'id':_0x1b6f0d[_0x478e('0x54')]['id']}})[_0x478e('0x27')](handleEntityNotFound(_0x580be5,null))[_0x478e('0x27')](function(_0x1bd9ce){if(_0x1bd9ce){_0x1b6f0d['body'][_0x478e('0x56')]=_0x1bd9ce['id'];return db['Interval'][_0x478e('0x57')](_0x1b6f0d['body']);}})['then'](respondWithResult(_0x580be5,null))[_0x478e('0x49')](handleError(_0x580be5,null));};exports[_0x478e('0x58')]=function(_0x418d34,_0x42afa1,_0x697f86){var _0x255c31={};var _0x16f3ce={};var _0x4bc325;var _0x248a62;return db[_0x478e('0x2f')][_0x478e('0x59')]({'where':{'id':_0x418d34[_0x478e('0x54')]['id']}})[_0x478e('0x27')](handleEntityNotFound(_0x42afa1,null))['then'](function(_0x449b79){if(_0x449b79){_0x4bc325=_0x449b79;_0x16f3ce[_0x478e('0x34')]=_['keys'](db[_0x478e('0x2f')]['rawAttributes']);_0x16f3ce['query']=_[_0x478e('0x36')](_0x418d34['query']);_0x16f3ce[_0x478e('0x38')]=_['intersection'](_0x16f3ce['model'],_0x16f3ce['query']);_0x255c31[_0x478e('0x3a')]=_[_0x478e('0x39')](_0x16f3ce[_0x478e('0x34')],qs[_0x478e('0x3b')](_0x418d34[_0x478e('0x37')][_0x478e('0x3b')]));_0x255c31['attributes']=_0x255c31['attributes'][_0x478e('0x5a')]?_0x255c31['attributes']:_0x16f3ce[_0x478e('0x34')];_0x255c31[_0x478e('0x3d')]=qs[_0x478e('0x3e')](_0x418d34[_0x478e('0x37')][_0x478e('0x3e')]);_0x255c31[_0x478e('0x3f')]=qs['filters'](_[_0x478e('0x40')](_0x418d34[_0x478e('0x37')],_0x16f3ce[_0x478e('0x38')]));if(_0x418d34['query']['filter']){_0x255c31[_0x478e('0x3f')]=_[_0x478e('0x43')](_0x255c31[_0x478e('0x3f')],{'$or':_[_0x478e('0x35')](_0x255c31[_0x478e('0x3a')],function(_0x54ef99){var _0x3a21ed={};_0x3a21ed[_0x54ef99]={'$like':'%'+_0x418d34['query']['filter']+'%'};return _0x3a21ed;})});}_0x255c31=_[_0x478e('0x43')]({},_0x255c31,_0x418d34[_0x478e('0x44')]);return _0x4bc325[_0x478e('0x58')](_0x255c31);}})[_0x478e('0x27')](function(_0x530e82){if(_0x530e82){_0x248a62=_0x530e82[_0x478e('0x5a')];if(!_0x418d34[_0x478e('0x37')]['hasOwnProperty']('nolimit')){_0x255c31[_0x478e('0x21')]=qs[_0x478e('0x21')](_0x418d34[_0x478e('0x37')][_0x478e('0x21')]);_0x255c31[_0x478e('0x1f')]=qs[_0x478e('0x1f')](_0x418d34[_0x478e('0x37')][_0x478e('0x1f')]);}return _0x4bc325[_0x478e('0x58')](_0x255c31);}})[_0x478e('0x27')](function(_0x1a57a7){if(_0x1a57a7){return _0x1a57a7?{'count':_0x248a62,'rows':_0x1a57a7}:null;}})['then'](respondWithResult(_0x42afa1,null))[_0x478e('0x49')](handleError(_0x42afa1,null));};exports[_0x478e('0x5b')]=function(_0x5c96f8,_0x1927de,_0xb730e5){return db[_0x478e('0x2f')][_0x478e('0x59')]({'where':{'id':_0x5c96f8[_0x478e('0x54')]['id']}})[_0x478e('0x27')](handleEntityNotFound(_0x1927de,null))['then'](function(_0x542d4b){if(_0x542d4b){return db[_0x478e('0x5c')]['transaction'](function(_0x43856f){return db['Interval'][_0x478e('0x28')]({'where':{'IntervalId':_0x5c96f8['params']['id']},'transaction':_0x43856f})[_0x478e('0x27')](function(_0x583eda){var _0x5d2fee=_[_0x478e('0x35')](_0x5c96f8['body'],function(_0x4f6611){delete _0x4f6611['id'];_0x4f6611[_0x478e('0x56')]=_0x5c96f8[_0x478e('0x54')]['id'];return _0x4f6611;});return db[_0x478e('0x2f')][_0x478e('0x5d')](_0x5d2fee,{'transaction':_0x43856f});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x5c96f8['params']['id']}});});}})[_0x478e('0x27')](respondWithResult(_0x1927de,null))['catch'](handleError(_0x1927de,null));}; \ No newline at end of file +var _0x9307=['rows','show','params','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','body','addInterval','getIntervals','hasOwnProperty','addIntervals','findOne','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','options','includeAll','include'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9307,0x69));var _0x7930=function(_0x716390,_0x3e5026){_0x716390=_0x716390-0x0;var _0x2619e0=_0x9307[_0x716390];return _0x2619e0;};'use strict';var emlformat=require(_0x7930('0x0'));var rimraf=require(_0x7930('0x1'));var zipdir=require(_0x7930('0x2'));var jsonpatch=require(_0x7930('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7930('0x4'));var Mustache=require(_0x7930('0x5'));var util=require(_0x7930('0x6'));var path=require('path');var sox=require(_0x7930('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7930('0x8'));var squel=require('squel');var crypto=require(_0x7930('0x9'));var jsforce=require(_0x7930('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7930('0xb'));var Papa=require(_0x7930('0xc'));var Redis=require(_0x7930('0xd'));var authService=require(_0x7930('0xe'));var qs=require(_0x7930('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7930('0x10'));var logger=require('../../config/logger')(_0x7930('0x11'));var utils=require(_0x7930('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7930('0x13'));var db=require('../../mysqldb')['db'];var extensions=require(_0x7930('0x14'));function respondWithStatusCode(_0x443604,_0x931cec){_0x931cec=_0x931cec||0xcc;return function(_0x2283d9){if(_0x2283d9){return _0x443604[_0x7930('0x15')](_0x931cec);}return _0x443604[_0x7930('0x16')](_0x931cec)[_0x7930('0x17')]();};}function respondWithResult(_0x151096,_0x281f9a){_0x281f9a=_0x281f9a||0xc8;return function(_0x55ad98){if(_0x55ad98){return _0x151096[_0x7930('0x16')](_0x281f9a)['json'](_0x55ad98);}};}function respondWithFilteredResult(_0x80d5c8,_0x1262d7){return function(_0x2e6acf){if(_0x2e6acf){var _0x5e6916=typeof _0x1262d7[_0x7930('0x18')]===_0x7930('0x19')&&typeof _0x1262d7[_0x7930('0x1a')]===_0x7930('0x19');var _0x475198=_0x2e6acf[_0x7930('0x1b')];var _0x41bc98=_0x5e6916?0x0:_0x1262d7['offset'];var _0x49c6c5=_0x5e6916?_0x2e6acf['count']:_0x1262d7[_0x7930('0x18')]+_0x1262d7['limit'];var _0x44ebaa;if(_0x49c6c5>=_0x475198){_0x49c6c5=_0x475198;_0x44ebaa=0xc8;}else{_0x44ebaa=0xce;}_0x80d5c8['status'](_0x44ebaa);return _0x80d5c8[_0x7930('0x1c')]('Content-Range',_0x41bc98+'-'+_0x49c6c5+'/'+_0x475198)[_0x7930('0x1d')](_0x2e6acf);}return null;};}function patchUpdates(_0x131e5a){return function(_0x2e69ea){try{jsonpatch[_0x7930('0x1e')](_0x2e69ea,_0x131e5a,!![]);}catch(_0xfc9b4f){return BPromise[_0x7930('0x1f')](_0xfc9b4f);}return _0x2e69ea[_0x7930('0x20')]();};}function saveUpdates(_0x4c4301,_0x11d71f){return function(_0x4b3fa0){if(_0x4b3fa0){return _0x4b3fa0[_0x7930('0x21')](_0x4c4301)[_0x7930('0x22')](function(_0x23dea6){return _0x23dea6;});}return null;};}function removeEntity(_0x46053a,_0x180e36){return function(_0x21a6be){if(_0x21a6be){return _0x21a6be[_0x7930('0x23')]()[_0x7930('0x22')](function(){var _0x58245c=_0x21a6be['get']({'plain':!![]});var _0x467a7d=_0x7930('0x24');return db[_0x7930('0x25')][_0x7930('0x23')]({'where':{'type':_0x467a7d,'resourceId':_0x58245c['id']}})[_0x7930('0x22')](function(){return _0x21a6be;});})[_0x7930('0x22')](function(){_0x46053a[_0x7930('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ea83,_0x123b8b){return function(_0x23a975){if(!_0x23a975){_0x38ea83[_0x7930('0x15')](0x194);}return _0x23a975;};}function handleError(_0x326a60,_0x54adf0){_0x54adf0=_0x54adf0||0x1f4;return function(_0x222863){logger[_0x7930('0x26')](_0x222863[_0x7930('0x27')]);if(_0x222863[_0x7930('0x28')]){delete _0x222863[_0x7930('0x28')];}_0x326a60[_0x7930('0x16')](_0x54adf0)['send'](_0x222863);};}exports[_0x7930('0x29')]=function(_0x1b8817,_0x2065af){var _0x2a440c={},_0x21d8a6={},_0x24b4f6={'count':0x0,'rows':[]};var _0x5cf375=_[_0x7930('0x2a')](db[_0x7930('0x2b')][_0x7930('0x2c')],function(_0x4b44a9){return{'name':_0x4b44a9[_0x7930('0x2d')],'type':_0x4b44a9[_0x7930('0x2e')][_0x7930('0x2f')]};});_0x21d8a6[_0x7930('0x30')]=_['map'](_0x5cf375,_0x7930('0x28'));_0x21d8a6['query']=_[_0x7930('0x31')](_0x1b8817[_0x7930('0x32')]);_0x21d8a6[_0x7930('0x33')]=_[_0x7930('0x34')](_0x21d8a6[_0x7930('0x30')],_0x21d8a6[_0x7930('0x32')]);_0x2a440c['attributes']=_[_0x7930('0x34')](_0x21d8a6[_0x7930('0x30')],qs['fields'](_0x1b8817[_0x7930('0x32')][_0x7930('0x35')]));_0x2a440c[_0x7930('0x36')]=_0x2a440c[_0x7930('0x36')][_0x7930('0x37')]?_0x2a440c[_0x7930('0x36')]:_0x21d8a6[_0x7930('0x30')];if(!_0x1b8817[_0x7930('0x32')]['hasOwnProperty'](_0x7930('0x38'))){_0x2a440c[_0x7930('0x1a')]=qs[_0x7930('0x1a')](_0x1b8817[_0x7930('0x32')][_0x7930('0x1a')]);_0x2a440c[_0x7930('0x18')]=qs[_0x7930('0x18')](_0x1b8817['query'][_0x7930('0x18')]);}_0x2a440c['order']=qs[_0x7930('0x39')](_0x1b8817[_0x7930('0x32')][_0x7930('0x39')]);_0x2a440c['where']=qs[_0x7930('0x33')](_[_0x7930('0x3a')](_0x1b8817[_0x7930('0x32')],_0x21d8a6[_0x7930('0x33')]),_0x5cf375);if(_0x1b8817['query'][_0x7930('0x3b')]){_0x2a440c[_0x7930('0x3c')]=_[_0x7930('0x3d')](_0x2a440c[_0x7930('0x3c')],{'$or':_[_0x7930('0x2a')](_0x5cf375,function(_0xfe66eb){if(_0xfe66eb[_0x7930('0x2e')]!=='VIRTUAL'){var _0x21a515={};_0x21a515[_0xfe66eb[_0x7930('0x28')]]={'$like':'%'+_0x1b8817[_0x7930('0x32')]['filter']+'%'};return _0x21a515;}})});}_0x2a440c=_[_0x7930('0x3d')]({},_0x2a440c,_0x1b8817[_0x7930('0x3e')]);var _0x13726f={'where':_0x2a440c[_0x7930('0x3c')]};return db['Interval'][_0x7930('0x1b')](_0x13726f)[_0x7930('0x22')](function(_0x24ce14){_0x24b4f6[_0x7930('0x1b')]=_0x24ce14;if(_0x1b8817[_0x7930('0x32')][_0x7930('0x3f')]){_0x2a440c[_0x7930('0x40')]=[{'all':!![]}];}return db[_0x7930('0x2b')]['findAll'](_0x2a440c);})[_0x7930('0x22')](function(_0x34a5d9){_0x24b4f6[_0x7930('0x41')]=_0x34a5d9;return _0x24b4f6;})[_0x7930('0x22')](respondWithFilteredResult(_0x2065af,_0x2a440c))['catch'](handleError(_0x2065af,null));};exports[_0x7930('0x42')]=function(_0x45c687,_0x1c0000){var _0x142628={'raw':!![],'where':{'id':_0x45c687[_0x7930('0x43')]['id']}},_0x718c4a={};_0x718c4a[_0x7930('0x30')]=_[_0x7930('0x31')](db[_0x7930('0x2b')][_0x7930('0x2c')]);_0x718c4a[_0x7930('0x32')]=_[_0x7930('0x31')](_0x45c687[_0x7930('0x32')]);_0x718c4a[_0x7930('0x33')]=_[_0x7930('0x34')](_0x718c4a['model'],_0x718c4a[_0x7930('0x32')]);_0x142628[_0x7930('0x36')]=_['intersection'](_0x718c4a[_0x7930('0x30')],qs[_0x7930('0x35')](_0x45c687['query']['fields']));_0x142628[_0x7930('0x36')]=_0x142628[_0x7930('0x36')][_0x7930('0x37')]?_0x142628['attributes']:_0x718c4a[_0x7930('0x30')];if(_0x45c687['query'][_0x7930('0x3f')]){_0x142628[_0x7930('0x40')]=[{'all':!![]}];}_0x142628=_[_0x7930('0x3d')]({},_0x142628,_0x45c687['options']);return db['Interval']['find'](_0x142628)[_0x7930('0x22')](handleEntityNotFound(_0x1c0000,null))[_0x7930('0x22')](respondWithResult(_0x1c0000,null))[_0x7930('0x44')](handleError(_0x1c0000,null));};exports[_0x7930('0x45')]=function(_0x466323,_0x5e838e){return db['Interval']['create'](_0x466323['body'],{})[_0x7930('0x22')](function(_0x83e11f){var _0x1af61c=_0x466323[_0x7930('0x46')][_0x7930('0x47')]({'plain':!![]});if(!_0x1af61c)throw new Error(_0x7930('0x48'));if(_0x1af61c['role']===_0x7930('0x46')){var _0x3904ec=_0x83e11f[_0x7930('0x47')]({'plain':!![]});var _0x5c399b=_0x7930('0x24');return db['UserProfileSection'][_0x7930('0x49')]({'where':{'name':_0x5c399b,'userProfileId':_0x1af61c['userProfileId']},'raw':!![]})[_0x7930('0x22')](function(_0x42327a){if(_0x42327a&&_0x42327a[_0x7930('0x4a')]===0x0){return db[_0x7930('0x25')][_0x7930('0x45')]({'name':_0x3904ec['name'],'resourceId':_0x3904ec['id'],'type':_0x42327a[_0x7930('0x28')],'sectionId':_0x42327a['id']},{})['then'](function(){return _0x83e11f;});}else{return _0x83e11f;}})[_0x7930('0x44')](function(_0x53131d){logger[_0x7930('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53131d);throw _0x53131d;});}return _0x83e11f;})[_0x7930('0x22')](respondWithResult(_0x5e838e,0xc9))[_0x7930('0x44')](handleError(_0x5e838e,null));};exports[_0x7930('0x21')]=function(_0x44e9e7,_0x257051){if(_0x44e9e7[_0x7930('0x4b')]['id']){delete _0x44e9e7[_0x7930('0x4b')]['id'];}return db[_0x7930('0x2b')][_0x7930('0x49')]({'where':{'id':_0x44e9e7[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x257051,null))[_0x7930('0x22')](saveUpdates(_0x44e9e7['body'],null))[_0x7930('0x22')](respondWithResult(_0x257051,null))[_0x7930('0x44')](handleError(_0x257051,null));};exports['destroy']=function(_0x229c9b,_0x252b49){return db[_0x7930('0x2b')]['find']({'where':{'id':_0x229c9b[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x252b49,null))['then'](removeEntity(_0x252b49,null))[_0x7930('0x44')](handleError(_0x252b49,null));};exports[_0x7930('0x4c')]=function(_0x1c47a9,_0x464ec0,_0x1e3fd5){if(_0x1c47a9[_0x7930('0x4b')]['id']){delete _0x1c47a9['body']['id'];}return db[_0x7930('0x2b')][_0x7930('0x49')]({'where':{'id':_0x1c47a9[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x464ec0,null))[_0x7930('0x22')](function(_0x425a10){if(_0x425a10){_0x1c47a9[_0x7930('0x4b')]['IntervalId']=_0x425a10['id'];return db[_0x7930('0x2b')][_0x7930('0x45')](_0x1c47a9[_0x7930('0x4b')]);}})[_0x7930('0x22')](respondWithResult(_0x464ec0,null))['catch'](handleError(_0x464ec0,null));};exports[_0x7930('0x4d')]=function(_0xf23c10,_0x33fac9,_0xa61c5b){var _0x3a8c98={};var _0x324183={};var _0x9dc06d;var _0x336fd1;return db[_0x7930('0x2b')]['findOne']({'where':{'id':_0xf23c10[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x33fac9,null))[_0x7930('0x22')](function(_0x5e5285){if(_0x5e5285){_0x9dc06d=_0x5e5285;_0x324183['model']=_[_0x7930('0x31')](db[_0x7930('0x2b')][_0x7930('0x2c')]);_0x324183['query']=_[_0x7930('0x31')](_0xf23c10['query']);_0x324183[_0x7930('0x33')]=_[_0x7930('0x34')](_0x324183[_0x7930('0x30')],_0x324183[_0x7930('0x32')]);_0x3a8c98['attributes']=_[_0x7930('0x34')](_0x324183[_0x7930('0x30')],qs[_0x7930('0x35')](_0xf23c10[_0x7930('0x32')][_0x7930('0x35')]));_0x3a8c98[_0x7930('0x36')]=_0x3a8c98[_0x7930('0x36')][_0x7930('0x37')]?_0x3a8c98['attributes']:_0x324183['model'];_0x3a8c98['order']=qs[_0x7930('0x39')](_0xf23c10[_0x7930('0x32')]['sort']);_0x3a8c98[_0x7930('0x3c')]=qs['filters'](_[_0x7930('0x3a')](_0xf23c10[_0x7930('0x32')],_0x324183[_0x7930('0x33')]));if(_0xf23c10[_0x7930('0x32')][_0x7930('0x3b')]){_0x3a8c98['where']=_[_0x7930('0x3d')](_0x3a8c98['where'],{'$or':_[_0x7930('0x2a')](_0x3a8c98['attributes'],function(_0x9af7ea){var _0x2da5e0={};_0x2da5e0[_0x9af7ea]={'$like':'%'+_0xf23c10[_0x7930('0x32')][_0x7930('0x3b')]+'%'};return _0x2da5e0;})});}_0x3a8c98=_['merge']({},_0x3a8c98,_0xf23c10['options']);return _0x9dc06d['getIntervals'](_0x3a8c98);}})[_0x7930('0x22')](function(_0x3577b9){if(_0x3577b9){_0x336fd1=_0x3577b9['length'];if(!_0xf23c10[_0x7930('0x32')][_0x7930('0x4e')](_0x7930('0x38'))){_0x3a8c98[_0x7930('0x1a')]=qs[_0x7930('0x1a')](_0xf23c10[_0x7930('0x32')][_0x7930('0x1a')]);_0x3a8c98['offset']=qs['offset'](_0xf23c10[_0x7930('0x32')][_0x7930('0x18')]);}return _0x9dc06d[_0x7930('0x4d')](_0x3a8c98);}})[_0x7930('0x22')](function(_0xa45411){if(_0xa45411){return _0xa45411?{'count':_0x336fd1,'rows':_0xa45411}:null;}})[_0x7930('0x22')](respondWithResult(_0x33fac9,null))[_0x7930('0x44')](handleError(_0x33fac9,null));};exports[_0x7930('0x4f')]=function(_0x11ad58,_0x236573,_0x52d240){return db[_0x7930('0x2b')][_0x7930('0x50')]({'where':{'id':_0x11ad58[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x236573,null))[_0x7930('0x22')](function(_0x4f4057){if(_0x4f4057){return db[_0x7930('0x51')][_0x7930('0x52')](function(_0x10c46f){return db['Interval']['destroy']({'where':{'IntervalId':_0x11ad58[_0x7930('0x43')]['id']},'transaction':_0x10c46f})['then'](function(_0x3496aa){var _0x46bb0b=_['map'](_0x11ad58[_0x7930('0x4b')],function(_0x53898c){delete _0x53898c['id'];_0x53898c[_0x7930('0x53')]=_0x11ad58[_0x7930('0x43')]['id'];return _0x53898c;});return db[_0x7930('0x2b')][_0x7930('0x54')](_0x46bb0b,{'transaction':_0x10c46f});});})[_0x7930('0x22')](function(){return db[_0x7930('0x2b')]['findAll']({'where':{'IntervalId':_0x11ad58['params']['id']}});});}})['then'](respondWithResult(_0x236573,null))[_0x7930('0x44')](handleError(_0x236573,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 1fae80c..83d7237 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 _0xfd57=['tools_intervals','rewrite','interval','map','then','reduce','./interval.attributes','../../utils/iftime','iftime','exports'];(function(_0x5842c3,_0x56bd74){var _0x44bf8c=function(_0x79551f){while(--_0x79551f){_0x5842c3['push'](_0x5842c3['shift']());}};_0x44bf8c(++_0x56bd74);}(_0xfd57,0x7e));var _0x7fd5=function(_0x2e472e,_0x2f8494){_0x2e472e=_0x2e472e-0x0;var _0x14c371=_0xfd57[_0x2e472e];return _0x14c371;};'use strict';var attributes=require(_0x7fd5('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x7fd5('0x1'))[_0x7fd5('0x2')];module[_0x7fd5('0x3')]=function(_0x3e1db0){return _0x3e1db0['define']('Interval',attributes,{'tableName':_0x7fd5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x441649){extensions[_0x7fd5('0x5')](_0x3e1db0,_0x441649);},'afterBulkCreate':function(_0x39320b,_0x21b00f,_0x4bb31b){_0x4bb31b();extensions[_0x7fd5('0x5')](_0x3e1db0,_0x39320b[0x0]);},'afterUpdate':function(_0x5c9ce0){extensions[_0x7fd5('0x5')](_0x3e1db0,_0x5c9ce0);},'afterDestroy':function(_0x4feab8){extensions[_0x7fd5('0x5')](_0x3e1db0,_0x4feab8);}},'instanceMethods':{'ifTime':function(_0x22d7d0=undefined,_0x8eaa9e=new Date()){if(typeof this[_0x7fd5('0x6')]==='string'){return iftime(this[_0x7fd5('0x6')],_0x22d7d0,_0x8eaa9e);}else{return this['getIntervals']()['then'](function(_0xf4b362){return Promise['all'](_0xf4b362[_0x7fd5('0x7')](function(_0x4b94be){return _0x4b94be['ifTime'](_0x22d7d0,_0x8eaa9e);}));})[_0x7fd5('0x8')](function(_0x4c09b2){return _0x4c09b2[_0x7fd5('0x9')](function(_0x22de8b,_0x5860ff){return _0x22de8b||_0x5860ff;},![]);});}}}});}; \ No newline at end of file +var _0xb582=['interval','string','getIntervals','then','all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','Interval','tools_intervals','rewrite'];(function(_0x4b486f,_0x4ac50d){var _0x48534f=function(_0x3f986f){while(--_0x3f986f){_0x4b486f['push'](_0x4b486f['shift']());}};_0x48534f(++_0x4ac50d);}(_0xb582,0x181));var _0x2b58=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb582[_0x1035c1];return _0x308d67;};'use strict';var attributes=require(_0x2b58('0x0'));var extensions=require(_0x2b58('0x1'));var iftime=require(_0x2b58('0x2'))[_0x2b58('0x3')];module['exports']=function(_0x2ce89d){return _0x2ce89d['define'](_0x2b58('0x4'),attributes,{'tableName':_0x2b58('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x10086d){extensions[_0x2b58('0x6')](_0x2ce89d,_0x10086d);},'afterBulkCreate':function(_0x4d23de,_0x5c8d7f,_0x369ba2){_0x369ba2();extensions[_0x2b58('0x6')](_0x2ce89d,_0x4d23de[0x0]);},'afterUpdate':function(_0x80e3ad){extensions[_0x2b58('0x6')](_0x2ce89d,_0x80e3ad);},'afterDestroy':function(_0x869094){extensions[_0x2b58('0x6')](_0x2ce89d,_0x869094);}},'instanceMethods':{'ifTime':function(_0x2d2010=undefined,_0x309a6a=new Date()){if(typeof this[_0x2b58('0x7')]===_0x2b58('0x8')){return iftime(this[_0x2b58('0x7')],_0x2d2010,_0x309a6a);}else{return this[_0x2b58('0x9')]()[_0x2b58('0xa')](function(_0x1395fc){return Promise[_0x2b58('0xb')](_0x1395fc['map'](function(_0x3498ec){return _0x3498ec[_0x2b58('0xc')](_0x2d2010,_0x309a6a);}));})['then'](function(_0x49dea3){return _0x49dea3[_0x2b58('0xd')](function(_0x4e2ecf,_0x3d1453){return _0x4e2ecf||_0x3d1453;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index dae99aa..5a299a5 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 _0x85a4=['format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','intervalIds','isArray','intervals','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','findAll','options','raw','where','limit','include','model','attributes','map','info','stringify','catch','error','message','ShowInterval','find','debug','then','all','ifTime','reduce'];(function(_0x3229b7,_0x5c3ac0){var _0x349264=function(_0xe482c7){while(--_0xe482c7){_0x3229b7['push'](_0x3229b7['shift']());}};_0x349264(++_0x5c3ac0);}(_0x85a4,0x13b));var _0x485a=function(_0x3b61ee,_0x5d83c6){_0x3b61ee=_0x3b61ee-0x0;var _0x5a7d88=_0x85a4[_0x3b61ee];return _0x5a7d88;};'use strict';var _=require(_0x485a('0x0'));var util=require(_0x485a('0x1'));var db=require(_0x485a('0x2'))['db'];var iftime=require(_0x485a('0x3'))[_0x485a('0x4')];var logger=require(_0x485a('0x5'))('rpc');exports[_0x485a('0x6')]=function(_0x5b552c){var _0x3cf787=this;return new Promise(function(_0x3d00d6,_0x3d5c89){return db[_0x485a('0x7')][_0x485a('0x8')]({'raw':_0x5b552c[_0x485a('0x9')]?_0x5b552c[_0x485a('0x9')][_0x485a('0xa')]===undefined?!![]:![]:!![],'where':_0x5b552c[_0x485a('0x9')]?_0x5b552c[_0x485a('0x9')][_0x485a('0xb')]||null:null,'attributes':_0x5b552c['options']?_0x5b552c[_0x485a('0x9')]['attributes']||null:null,'limit':_0x5b552c[_0x485a('0x9')]?_0x5b552c[_0x485a('0x9')][_0x485a('0xc')]||null:null,'include':_0x5b552c[_0x485a('0x9')]?_0x5b552c[_0x485a('0x9')][_0x485a('0xd')]?_['map'](_0x5b552c[_0x485a('0x9')][_0x485a('0xd')],function(_0x3e6bbb){return{'model':db[_0x3e6bbb[_0x485a('0xe')]],'as':_0x3e6bbb['as'],'attributes':_0x3e6bbb['attributes'],'include':_0x3e6bbb[_0x485a('0xd')]?_['map'](_0x3e6bbb[_0x485a('0xd')],function(_0x48a10f){return{'model':db[_0x48a10f[_0x485a('0xe')]],'as':_0x48a10f['as'],'attributes':_0x48a10f[_0x485a('0xf')],'include':_0x48a10f['include']?_[_0x485a('0x10')](_0x48a10f[_0x485a('0xd')],function(_0xce57d9){return{'model':db[_0xce57d9[_0x485a('0xe')]],'as':_0xce57d9['as'],'attributes':_0xce57d9[_0x485a('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b13bd){logger[_0x485a('0x11')](_0x485a('0x6'),_0x5b552c);logger['debug'](_0x485a('0x6'),_0x5b552c,JSON[_0x485a('0x12')](_0x5b13bd));_0x3d00d6(_0x5b13bd);})[_0x485a('0x13')](function(_0x523f70){logger[_0x485a('0x14')](_0x485a('0x6'),_0x523f70[_0x485a('0x15')],_0x5b552c);_0x3d5c89(_0x3cf787[_0x485a('0x14')](0x1f4,_0x523f70['message']));});});};exports[_0x485a('0x16')]=function(_0x2a4c7a){var _0x31d1f0=this;return new Promise(function(_0x5ec859,_0x3792e8){return db[_0x485a('0x7')][_0x485a('0x17')]({'raw':_0x2a4c7a[_0x485a('0x9')]?_0x2a4c7a[_0x485a('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x2a4c7a[_0x485a('0x9')]?_0x2a4c7a[_0x485a('0x9')]['where']||null:null,'attributes':_0x2a4c7a['options']?_0x2a4c7a[_0x485a('0x9')][_0x485a('0xf')]||null:null,'include':_0x2a4c7a[_0x485a('0x9')]?_0x2a4c7a[_0x485a('0x9')][_0x485a('0xd')]?_['map'](_0x2a4c7a['options'][_0x485a('0xd')],function(_0x2092f7){return{'model':db[_0x2092f7[_0x485a('0xe')]],'as':_0x2092f7['as'],'attributes':_0x2092f7[_0x485a('0xf')],'include':_0x2092f7['include']?_[_0x485a('0x10')](_0x2092f7['include'],function(_0x7830ce){return{'model':db[_0x7830ce[_0x485a('0xe')]],'as':_0x7830ce['as'],'attributes':_0x7830ce[_0x485a('0xf')],'include':_0x7830ce[_0x485a('0xd')]?_[_0x485a('0x10')](_0x7830ce[_0x485a('0xd')],function(_0x1ffea2){return{'model':db[_0x1ffea2[_0x485a('0xe')]],'as':_0x1ffea2['as'],'attributes':_0x1ffea2[_0x485a('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1387de){logger[_0x485a('0x11')](_0x485a('0x16'),_0x2a4c7a);logger[_0x485a('0x18')](_0x485a('0x16'),_0x2a4c7a,JSON[_0x485a('0x12')](_0x1387de));_0x5ec859(_0x1387de);})[_0x485a('0x13')](function(_0x876009){logger['error'](_0x485a('0x16'),_0x876009[_0x485a('0x15')],_0x2a4c7a);_0x3792e8(_0x31d1f0['error'](0x1f4,_0x876009[_0x485a('0x15')]));});});};function checkArrayOfIntervals(_0x2b77c8,_0x272487){var _0x390497=[];return db[_0x485a('0x7')][_0x485a('0x8')]({'where':{'id':_0x2b77c8}})[_0x485a('0x19')](function(_0x59d15a){_0x390497=_0x59d15a;return Promise[_0x485a('0x1a')](_0x390497['map'](function(_0x2f9fff){return _0x2f9fff[_0x485a('0x1b')](_0x272487);}));})[_0x485a('0x19')](function(_0x5f29a6){var _0x3dcf38=_0x5f29a6[_0x485a('0x1c')](function(_0x14f3fb,_0x3d2bd5){return _0x14f3fb||_0x3d2bd5;},![]);logger[_0x485a('0x11')](util[_0x485a('0x1d')](_0x485a('0x1e'),_0x390497[_0x485a('0x10')](function(_0x53633e){return _0x53633e[_0x485a('0x1f')];})['join'](',\x20'),_0x390497[_0x485a('0x10')](function(_0x4a7a21){return _0x4a7a21['id'];})[_0x485a('0x20')](',\x20')));return _0x3dcf38;});}function checkSingleInterval(_0x2f493b,_0x31be8e){return db[_0x485a('0x7')]['findById'](_0x2f493b)[_0x485a('0x19')](function(_0x12fb43){if(_0x12fb43){logger[_0x485a('0x11')](util[_0x485a('0x1d')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x12fb43[_0x485a('0x1f')],_0x12fb43['id']));return _0x12fb43['ifTime'](_0x31be8e);}});}exports['IntervalIftime']=function(_0x192eca){var _0x298f7c=_0x192eca[_0x485a('0x21')];var _0xfdd382=Array[_0x485a('0x22')](_0x192eca[_0x485a('0x23')])?_0x192eca[_0x485a('0x23')]:typeof _0x192eca[_0x485a('0x23')]==='string'?[_0x192eca[_0x485a('0x23')]]:[];var _0x4f1951=_0x192eca['timezone']||undefined;var _0xe8b0f4=![];if(_0xfdd382[_0x485a('0x24')]){logger[_0x485a('0x11')](util[_0x485a('0x1d')](_0x485a('0x25'),_0xfdd382['join'](';\x20')));}if(_0x4f1951){logger[_0x485a('0x11')](util[_0x485a('0x1d')](_0x485a('0x26'),_0x4f1951));}logger[_0x485a('0x18')](_0x485a('0x27'),_0xe8b0f4);logger[_0x485a('0x28')](_0x485a('0x29'),_0x192eca);return Promise[_0x485a('0x2a')]()[_0x485a('0x19')](function(){if(Array[_0x485a('0x22')](_0x298f7c)){return checkArrayOfIntervals(_0x298f7c,_0x4f1951);}else if(_0x298f7c){return checkSingleInterval(_0x298f7c,_0x4f1951);}})[_0x485a('0x19')](function(_0x442a2e){var _0x56da84=_0xfdd382[_0x485a('0x1c')](function(_0x2cda47,_0xf0525d){return _0x2cda47||iftime(_0xf0525d,_0x4f1951);},![]);_0xe8b0f4=_0x442a2e||_0x56da84;return _0xe8b0f4;})['catch'](function(_0x19c1e0){logger[_0x485a('0x14')]('IntervalIftime',_0x192eca,_0x19c1e0);throw this['error'](0x1f4,_0x19c1e0[_0x485a('0x15')]);});}; \ No newline at end of file +var _0x4dfc=['name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','options','where','attributes','include','map','model','then','info','debug','stringify','message','error','find','raw','ShowInterval','catch','findAll','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)'];(function(_0x4bba85,_0x4c3e39){var _0x17e4d2=function(_0x57ce98){while(--_0x57ce98){_0x4bba85['push'](_0x4bba85['shift']());}};_0x17e4d2(++_0x4c3e39);}(_0x4dfc,0x1d2));var _0xc4df=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x4dfc[_0x282a1f];return _0x296ea7;};'use strict';var _=require('lodash');var util=require(_0xc4df('0x0'));var db=require(_0xc4df('0x1'))['db'];var iftime=require(_0xc4df('0x2'))[_0xc4df('0x3')];var logger=require(_0xc4df('0x4'))('rpc');exports[_0xc4df('0x5')]=function(_0x53e76d){var _0x16630e=this;return new Promise(function(_0x131cc4,_0xdac4b7){return db[_0xc4df('0x6')]['findAll']({'raw':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x53e76d['options']?_0x53e76d[_0xc4df('0x7')][_0xc4df('0x8')]||null:null,'attributes':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')][_0xc4df('0x9')]||null:null,'limit':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')]['limit']||null:null,'include':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')][_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x53e76d['options'][_0xc4df('0xa')],function(_0x5a4e22){return{'model':db[_0x5a4e22[_0xc4df('0xc')]],'as':_0x5a4e22['as'],'attributes':_0x5a4e22['attributes'],'include':_0x5a4e22[_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x5a4e22[_0xc4df('0xa')],function(_0x179811){return{'model':db[_0x179811['model']],'as':_0x179811['as'],'attributes':_0x179811['attributes'],'include':_0x179811['include']?_['map'](_0x179811[_0xc4df('0xa')],function(_0x47118b){return{'model':db[_0x47118b[_0xc4df('0xc')]],'as':_0x47118b['as'],'attributes':_0x47118b[_0xc4df('0x9')]};}):[]};}):[]};}):[]:[]})[_0xc4df('0xd')](function(_0x37f46c){logger[_0xc4df('0xe')](_0xc4df('0x5'),_0x53e76d);logger[_0xc4df('0xf')](_0xc4df('0x5'),_0x53e76d,JSON[_0xc4df('0x10')](_0x37f46c));_0x131cc4(_0x37f46c);})['catch'](function(_0x579909){logger['error'](_0xc4df('0x5'),_0x579909[_0xc4df('0x11')],_0x53e76d);_0xdac4b7(_0x16630e[_0xc4df('0x12')](0x1f4,_0x579909[_0xc4df('0x11')]));});});};exports['ShowInterval']=function(_0x41c395){var _0x539047=this;return new Promise(function(_0x52ef57,_0x44ab6f){return db[_0xc4df('0x6')][_0xc4df('0x13')]({'raw':_0x41c395[_0xc4df('0x7')]?_0x41c395['options'][_0xc4df('0x14')]===undefined?!![]:![]:!![],'where':_0x41c395['options']?_0x41c395[_0xc4df('0x7')][_0xc4df('0x8')]||null:null,'attributes':_0x41c395[_0xc4df('0x7')]?_0x41c395[_0xc4df('0x7')][_0xc4df('0x9')]||null:null,'include':_0x41c395['options']?_0x41c395[_0xc4df('0x7')][_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x41c395['options']['include'],function(_0x8f458f){return{'model':db[_0x8f458f[_0xc4df('0xc')]],'as':_0x8f458f['as'],'attributes':_0x8f458f['attributes'],'include':_0x8f458f[_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x8f458f[_0xc4df('0xa')],function(_0x22f95a){return{'model':db[_0x22f95a[_0xc4df('0xc')]],'as':_0x22f95a['as'],'attributes':_0x22f95a[_0xc4df('0x9')],'include':_0x22f95a[_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x22f95a[_0xc4df('0xa')],function(_0x12b449){return{'model':db[_0x12b449[_0xc4df('0xc')]],'as':_0x12b449['as'],'attributes':_0x12b449[_0xc4df('0x9')]};}):[]};}):[]};}):[]:[]})[_0xc4df('0xd')](function(_0x1ec057){logger[_0xc4df('0xe')](_0xc4df('0x15'),_0x41c395);logger[_0xc4df('0xf')](_0xc4df('0x15'),_0x41c395,JSON['stringify'](_0x1ec057));_0x52ef57(_0x1ec057);})[_0xc4df('0x16')](function(_0x26bdce){logger['error'](_0xc4df('0x15'),_0x26bdce[_0xc4df('0x11')],_0x41c395);_0x44ab6f(_0x539047[_0xc4df('0x12')](0x1f4,_0x26bdce[_0xc4df('0x11')]));});});};function checkArrayOfIntervals(_0x214596,_0x431db9){var _0x4315d6=[];return db['Interval'][_0xc4df('0x17')]({'where':{'id':_0x214596}})['then'](function(_0x315013){_0x4315d6=_0x315013;return Promise[_0xc4df('0x18')](_0x4315d6[_0xc4df('0xb')](function(_0x41be03){return _0x41be03[_0xc4df('0x19')](_0x431db9);}));})['then'](function(_0x1b338a){var _0x1c800c=_0x1b338a[_0xc4df('0x1a')](function(_0x19a83d,_0x4034cd){return _0x19a83d||_0x4034cd;},![]);logger['info'](util[_0xc4df('0x1b')](_0xc4df('0x1c'),_0x4315d6['map'](function(_0x24dfdb){return _0x24dfdb[_0xc4df('0x1d')];})[_0xc4df('0x1e')](',\x20'),_0x4315d6['map'](function(_0x4a7283){return _0x4a7283['id'];})[_0xc4df('0x1e')](',\x20')));return _0x1c800c;});}function checkSingleInterval(_0xc077c4,_0x4790f2){return db[_0xc4df('0x6')][_0xc4df('0x1f')](_0xc077c4)['then'](function(_0x19e16b){if(_0x19e16b){logger[_0xc4df('0xe')](util['format'](_0xc4df('0x20'),_0x19e16b[_0xc4df('0x1d')],_0x19e16b['id']));return _0x19e16b[_0xc4df('0x19')](_0x4790f2);}});}exports[_0xc4df('0x21')]=function(_0x525457){var _0x3415e8=_0x525457[_0xc4df('0x22')];var _0x593a8e=Array['isArray'](_0x525457['intervals'])?_0x525457[_0xc4df('0x23')]:typeof _0x525457[_0xc4df('0x23')]===_0xc4df('0x24')?[_0x525457['intervals']]:[];var _0x4e43a2=_0x525457[_0xc4df('0x25')]||undefined;var _0xbd2e84=![];if(_0x593a8e[_0xc4df('0x26')]){logger[_0xc4df('0xe')](util[_0xc4df('0x1b')](_0xc4df('0x27'),_0x593a8e['join'](';\x20')));}if(_0x4e43a2){logger['info'](util['format'](_0xc4df('0x28'),_0x4e43a2));}logger[_0xc4df('0xf')](_0xc4df('0x29'),_0xbd2e84);logger[_0xc4df('0x2a')]('IntervalIftime',_0x525457);return Promise[_0xc4df('0x2b')]()['then'](function(){if(Array[_0xc4df('0x2c')](_0x3415e8)){return checkArrayOfIntervals(_0x3415e8,_0x4e43a2);}else if(_0x3415e8){return checkSingleInterval(_0x3415e8,_0x4e43a2);}})[_0xc4df('0xd')](function(_0xd18739){var _0x108766=_0x593a8e[_0xc4df('0x1a')](function(_0x3e91b8,_0x5dad2e){return _0x3e91b8||iftime(_0x5dad2e,_0x4e43a2);},![]);_0xbd2e84=_0xd18739||_0x108766;return _0xbd2e84;})[_0xc4df('0x16')](function(_0x3ab943){logger[_0xc4df('0x12')](_0xc4df('0x21'),_0x525457,_0x3ab943);throw this[_0xc4df('0x12')](0x1f4,_0x3ab943[_0xc4df('0x11')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2825637..e6ef3cb 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x291e46,_0x5f0ecd){var _0x4232b7=function(_0x44f94d){while(--_0x44f94d){_0x291e46['push'](_0x291e46['shift']());}};_0x4232b7(++_0x5f0ecd);}(_0x2ef3,0xba));var _0x32ef=function(_0x58647d,_0x62b032){_0x58647d=_0x58647d-0x0;var _0x2d5c62=_0x2ef3[_0x58647d];return _0x2d5c62;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0xfeb826,_0x1b4114){var _0x4f44a5=function(_0x58a0e7){while(--_0x58a0e7){_0xfeb826['push'](_0xfeb826['shift']());}};_0x4f44a5(++_0x1b4114);}(_0xdb28,0x106));var _0x8db2=function(_0x243cbc,_0x5b174a){_0x243cbc=_0x243cbc-0x0;var _0x12cc09=_0xdb28[_0x243cbc];return _0x12cc09;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 32e0f86..e67fb4a 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 _0x0444=['newToken','customfield_11503','customfield_11504','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString','setEncoding','data','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','connection','remoteAddress','socket','https','../../config/logger','api','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','fields','customfield_11501'];(function(_0x30edaa,_0x1214d1){var _0x525e53=function(_0x51a98d){while(--_0x51a98d){_0x30edaa['push'](_0x30edaa['shift']());}};_0x525e53(++_0x1214d1);}(_0x0444,0x94));var _0x4044=function(_0x58bd14,_0x13ee8b){_0x58bd14=_0x58bd14-0x0;var _0x5a9e99=_0x0444[_0x58bd14];return _0x5a9e99;};'use strict';var BPromise=require('bluebird');var https=require(_0x4044('0x0'));var logger=require(_0x4044('0x1'))(_0x4044('0x2'));var USERNAME='support';var PASSWORD=_0x4044('0x3');function openIssue(_0x31c5c0,_0x5a8aec){var _0x4f609f={'fields':{'project':{'key':_0x31c5c0['key']||_0x4044('0x4')},'summary':(_0x31c5c0[_0x4044('0x5')]||_0x4044('0x6'))+_0x4044('0x7')+_0x31c5c0['ip'],'description':_0x31c5c0[_0x4044('0x8')]||JSON[_0x4044('0x9')](_0x31c5c0),'issuetype':{'name':_0x31c5c0[_0x4044('0xa')]||_0x4044('0xb')}}};_0x4f609f['fields'][_0x4044('0xc')]=_0x31c5c0[_0x4044('0xd')];_0x4f609f[_0x4044('0xe')][_0x4044('0xf')]=_0x31c5c0['oldToken'];_0x4f609f[_0x4044('0xe')]['customfield_11502']=_0x31c5c0[_0x4044('0x10')];_0x4f609f[_0x4044('0xe')][_0x4044('0x11')]=_0x31c5c0['name'];_0x4f609f['fields'][_0x4044('0x12')]=_0x31c5c0['reason'];_0x4f609f[_0x4044('0xe')][_0x4044('0x13')]=_0x31c5c0['ip'];var _0x1ca3c0={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x4044('0x14'),'method':_0x4044('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x4044('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x4044('0x17')]('base64')}};var _0x2e44cc=JSON[_0x4044('0x9')](_0x4f609f);var _0x5067f3=https['request'](_0x1ca3c0,function(_0xf0307d){_0xf0307d[_0x4044('0x18')]('utf8');var _0x2028b7='';_0xf0307d['on'](_0x4044('0x19'),function(_0x42f114){_0x2028b7+=_0x42f114;});_0xf0307d['on'](_0x4044('0x1a'),function(){if(_0x5a8aec){return _0x5a8aec['status'](_0xf0307d[_0x4044('0x1b')])[_0x4044('0x1c')](JSON[_0x4044('0x1d')](_0x2028b7));}});});_0x5067f3['on'](_0x4044('0x1e'),function(_0x332a37){if(_0x5a8aec){return _0x5a8aec[_0x4044('0x1f')](0x1f4)['json']({'errors':[{'message':_0x4044('0x20'),'type':_0x4044('0x21')}]});}});_0x5067f3[_0x4044('0x22')](_0x2e44cc);_0x5067f3[_0x4044('0x1a')]();}exports[_0x4044('0x23')]=openIssue;exports[_0x4044('0x24')]=function(_0x510d1c,_0x4a495f){_0x510d1c[_0x4044('0x25')]['ip']=_0x510d1c['headers']['x-forwarded-for']||_0x510d1c[_0x4044('0x26')][_0x4044('0x27')]||_0x510d1c[_0x4044('0x28')][_0x4044('0x27')]||_0x510d1c[_0x4044('0x26')][_0x4044('0x28')][_0x4044('0x27')];return openIssue(_0x510d1c[_0x4044('0x25')],_0x4a495f);}; \ No newline at end of file +var _0xef21=['write','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','fields','email','customfield_11502','newToken','customfield_11503','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','stringify','setEncoding','data','end','status','statusCode','json','error'];(function(_0x41fe33,_0x13deb8){var _0x20118e=function(_0x930a16){while(--_0x930a16){_0x41fe33['push'](_0x41fe33['shift']());}};_0x20118e(++_0x13deb8);}(_0xef21,0xa8));var _0x1ef2=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xef21[_0x525c7b];return _0x27b33e;};'use strict';var BPromise=require(_0x1ef2('0x0'));var https=require(_0x1ef2('0x1'));var logger=require(_0x1ef2('0x2'))(_0x1ef2('0x3'));var USERNAME=_0x1ef2('0x4');var PASSWORD=_0x1ef2('0x5');function openIssue(_0x16d9f4,_0x13e719){var _0x4950a4={'fields':{'project':{'key':_0x16d9f4['key']||_0x1ef2('0x6')},'summary':(_0x16d9f4[_0x1ef2('0x7')]||_0x1ef2('0x8'))+_0x1ef2('0x9')+_0x16d9f4['ip'],'description':_0x16d9f4[_0x1ef2('0xa')]||JSON['stringify'](_0x16d9f4),'issuetype':{'name':_0x16d9f4['issuetype']||'Bug'}}};_0x4950a4[_0x1ef2('0xb')]['customfield_11500']=_0x16d9f4[_0x1ef2('0xc')];_0x4950a4[_0x1ef2('0xb')]['customfield_11501']=_0x16d9f4['oldToken'];_0x4950a4[_0x1ef2('0xb')][_0x1ef2('0xd')]=_0x16d9f4[_0x1ef2('0xe')];_0x4950a4['fields'][_0x1ef2('0xf')]=_0x16d9f4['name'];_0x4950a4[_0x1ef2('0xb')][_0x1ef2('0x10')]=_0x16d9f4[_0x1ef2('0x11')];_0x4950a4[_0x1ef2('0xb')]['customfield_10102']=_0x16d9f4['ip'];var _0x57cd31={'host':_0x1ef2('0x12'),'port':0x1bb,'path':_0x1ef2('0x13'),'method':_0x1ef2('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x1ef2('0x15'),'Authorization':_0x1ef2('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x1ef2('0x17')]('base64')}};var _0x4df692=JSON[_0x1ef2('0x18')](_0x4950a4);var _0x2e1ff1=https['request'](_0x57cd31,function(_0x63b1e){_0x63b1e[_0x1ef2('0x19')]('utf8');var _0x3c34ed='';_0x63b1e['on'](_0x1ef2('0x1a'),function(_0x580ff0){_0x3c34ed+=_0x580ff0;});_0x63b1e['on'](_0x1ef2('0x1b'),function(){if(_0x13e719){return _0x13e719[_0x1ef2('0x1c')](_0x63b1e[_0x1ef2('0x1d')])[_0x1ef2('0x1e')](JSON['parse'](_0x3c34ed));}});});_0x2e1ff1['on'](_0x1ef2('0x1f'),function(_0x3b5345){if(_0x13e719){return _0x13e719[_0x1ef2('0x1c')](0x1f4)[_0x1ef2('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x2e1ff1[_0x1ef2('0x20')](_0x4df692);_0x2e1ff1[_0x1ef2('0x1b')]();}exports[_0x1ef2('0x21')]=openIssue;exports[_0x1ef2('0x22')]=function(_0x1ad97f,_0x2e5575){_0x1ad97f[_0x1ef2('0x23')]['ip']=_0x1ad97f['headers'][_0x1ef2('0x24')]||_0x1ad97f['connection'][_0x1ef2('0x25')]||_0x1ad97f[_0x1ef2('0x26')][_0x1ef2('0x25')]||_0x1ad97f[_0x1ef2('0x27')]['socket'][_0x1ef2('0x25')];return openIssue(_0x1ad97f['body'],_0x2e5575);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6027518..1bd41ee 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 _0xf109=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0xf109,0xce));var _0x9f10=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xf109[_0xc8a931];return _0x28bd27;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f10('0x3'));var auth=require(_0x9f10('0x4'));var interaction=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var controller=require(_0x9f10('0x7'));router[_0x9f10('0x8')]('/',auth[_0x9f10('0x9')](),controller[_0x9f10('0xa')]);router[_0x9f10('0x8')](_0x9f10('0xb'),auth[_0x9f10('0x9')](),controller['describe']);router[_0x9f10('0x8')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xd')]);router[_0x9f10('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f10('0xf')]);router[_0x9f10('0x10')](_0x9f10('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9f10('0x11')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller['destroy']);module[_0x9f10('0x12')]=router; \ No newline at end of file +var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x39bfb6,_0x3ad6a6){var _0x131b8b=function(_0x4152d7){while(--_0x4152d7){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x131b8b(++_0x3ad6a6);}(_0xec56,0x1bd));var _0x6ec5=function(_0x2d8e64,_0x143f18){_0x2d8e64=_0x2d8e64-0x0;var _0x31cc7e=_0xec56[_0x2d8e64];return _0x31cc7e;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['post']('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x12')]);router[_0x6ec5('0x13')]('/:id',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x14')]);module[_0x6ec5('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 27dd9fd..c66f57b 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x28f4e3,_0x5c6232){_0x28f4e3=_0x28f4e3-0x0;var _0x242dc1=_0x7a54[_0x28f4e3];return _0x242dc1;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x13c30d,_0x3ee4fd){_0x13c30d=_0x13c30d-0x0;var _0xb3b224=_0x7a54[_0x13c30d];return _0xb3b224;};'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 3f5c078..1dd0877 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 _0x5353=['update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','error','stack','name','send','index','map','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','JscriptyAnswerReport','findAll','rows','catch','show','params','include','create','body'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x5353,0x12f));var _0x3535=function(_0x1c0158,_0x14a823){_0x1c0158=_0x1c0158-0x0;var _0x11360d=_0x5353[_0x1c0158];return _0x11360d;};'use strict';var emlformat=require(_0x3535('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3535('0x1'));var jsonpatch=require(_0x3535('0x2'));var rp=require(_0x3535('0x3'));var moment=require(_0x3535('0x4'));var BPromise=require(_0x3535('0x5'));var Mustache=require(_0x3535('0x6'));var util=require(_0x3535('0x7'));var path=require(_0x3535('0x8'));var sox=require(_0x3535('0x9'));var csv=require(_0x3535('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3535('0xb'));var _=require('lodash');var squel=require(_0x3535('0xc'));var crypto=require(_0x3535('0xd'));var jsforce=require(_0x3535('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3535('0xa'));var querystring=require(_0x3535('0xf'));var Papa=require(_0x3535('0x10'));var Redis=require(_0x3535('0x11'));var authService=require(_0x3535('0x12'));var qs=require(_0x3535('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3535('0x14'));var logger=require(_0x3535('0x15'))('api');var utils=require(_0x3535('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3535('0x17'))['db'];function respondWithStatusCode(_0xff9aa8,_0xe7c052){_0xe7c052=_0xe7c052||0xcc;return function(_0x46b5c1){if(_0x46b5c1){return _0xff9aa8[_0x3535('0x18')](_0xe7c052);}return _0xff9aa8[_0x3535('0x19')](_0xe7c052)[_0x3535('0x1a')]();};}function respondWithResult(_0x5115bd,_0x2f4e64){_0x2f4e64=_0x2f4e64||0xc8;return function(_0x501016){if(_0x501016){return _0x5115bd[_0x3535('0x19')](_0x2f4e64)[_0x3535('0x1b')](_0x501016);}};}function respondWithFilteredResult(_0xf87404,_0x4c704f){return function(_0x1f18da){if(_0x1f18da){var _0x4b7c81=typeof _0x4c704f[_0x3535('0x1c')]==='undefined'&&typeof _0x4c704f['limit']===_0x3535('0x1d');var _0x222937=_0x1f18da[_0x3535('0x1e')];var _0x298235=_0x4b7c81?0x0:_0x4c704f[_0x3535('0x1c')];var _0x2a1705=_0x4b7c81?_0x1f18da[_0x3535('0x1e')]:_0x4c704f[_0x3535('0x1c')]+_0x4c704f[_0x3535('0x1f')];var _0x1fca4f;if(_0x2a1705>=_0x222937){_0x2a1705=_0x222937;_0x1fca4f=0xc8;}else{_0x1fca4f=0xce;}_0xf87404[_0x3535('0x19')](_0x1fca4f);return _0xf87404[_0x3535('0x20')]('Content-Range',_0x298235+'-'+_0x2a1705+'/'+_0x222937)['json'](_0x1f18da);}return null;};}function patchUpdates(_0xfea414){return function(_0x4e76c5){try{jsonpatch['apply'](_0x4e76c5,_0xfea414,!![]);}catch(_0x23f5b6){return BPromise[_0x3535('0x21')](_0x23f5b6);}return _0x4e76c5[_0x3535('0x22')]();};}function saveUpdates(_0x56db66,_0x52f0e3){return function(_0x3d73d2){if(_0x3d73d2){return _0x3d73d2['update'](_0x56db66)[_0x3535('0x23')](function(_0x542372){return _0x542372;});}return null;};}function removeEntity(_0x44fc44,_0x4d372e){return function(_0x450250){if(_0x450250){return _0x450250['destroy']()['then'](function(){_0x44fc44[_0x3535('0x19')](0xcc)[_0x3535('0x1a')]();});}};}function handleEntityNotFound(_0x5a25d1,_0x14e803){return function(_0x213f35){if(!_0x213f35){_0x5a25d1[_0x3535('0x18')](0x194);}return _0x213f35;};}function handleError(_0xefa28c,_0x51ba08){_0x51ba08=_0x51ba08||0x1f4;return function(_0x2bbe00){logger[_0x3535('0x24')](_0x2bbe00[_0x3535('0x25')]);if(_0x2bbe00[_0x3535('0x26')]){delete _0x2bbe00[_0x3535('0x26')];}_0xefa28c[_0x3535('0x19')](_0x51ba08)[_0x3535('0x27')](_0x2bbe00);};}exports[_0x3535('0x28')]=function(_0x4c993a,_0x167e64){var _0x17e2a0={},_0x4cf180={},_0x2594d7={'count':0x0,'rows':[]};var _0x2a84e0=_[_0x3535('0x29')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x3e8a1e){return{'name':_0x3e8a1e[_0x3535('0x2a')],'type':_0x3e8a1e['type'][_0x3535('0x2b')]};});_0x4cf180[_0x3535('0x2c')]=_[_0x3535('0x29')](_0x2a84e0,_0x3535('0x26'));_0x4cf180['query']=_[_0x3535('0x2d')](_0x4c993a[_0x3535('0x2e')]);_0x4cf180['filters']=_[_0x3535('0x2f')](_0x4cf180[_0x3535('0x2c')],_0x4cf180[_0x3535('0x2e')]);_0x17e2a0[_0x3535('0x30')]=_[_0x3535('0x2f')](_0x4cf180[_0x3535('0x2c')],qs[_0x3535('0x31')](_0x4c993a['query']['fields']));_0x17e2a0[_0x3535('0x30')]=_0x17e2a0[_0x3535('0x30')][_0x3535('0x32')]?_0x17e2a0[_0x3535('0x30')]:_0x4cf180[_0x3535('0x2c')];if(!_0x4c993a[_0x3535('0x2e')][_0x3535('0x33')](_0x3535('0x34'))){_0x17e2a0['limit']=qs[_0x3535('0x1f')](_0x4c993a[_0x3535('0x2e')][_0x3535('0x1f')]);_0x17e2a0[_0x3535('0x1c')]=qs[_0x3535('0x1c')](_0x4c993a[_0x3535('0x2e')]['offset']);}_0x17e2a0[_0x3535('0x35')]=qs['sort'](_0x4c993a[_0x3535('0x2e')][_0x3535('0x36')]);_0x17e2a0['where']=qs[_0x3535('0x37')](_[_0x3535('0x38')](_0x4c993a[_0x3535('0x2e')],_0x4cf180[_0x3535('0x37')]),_0x2a84e0);if(_0x4c993a['query']['filter']){_0x17e2a0[_0x3535('0x39')]=_[_0x3535('0x3a')](_0x17e2a0[_0x3535('0x39')],{'$or':_[_0x3535('0x29')](_0x2a84e0,function(_0x32d907){if(_0x32d907[_0x3535('0x3b')]!==_0x3535('0x3c')){var _0x396fd9={};_0x396fd9[_0x32d907[_0x3535('0x26')]]={'$like':'%'+_0x4c993a[_0x3535('0x2e')][_0x3535('0x3d')]+'%'};return _0x396fd9;}})});}_0x17e2a0=_[_0x3535('0x3a')]({},_0x17e2a0,_0x4c993a['options']);var _0x46aabb={'where':_0x17e2a0[_0x3535('0x39')]};return db['JscriptyAnswerReport'][_0x3535('0x1e')](_0x46aabb)[_0x3535('0x23')](function(_0x5c4c2f){_0x2594d7[_0x3535('0x1e')]=_0x5c4c2f;if(_0x4c993a[_0x3535('0x2e')][_0x3535('0x3e')]){_0x17e2a0['include']=[{'all':!![]}];}return db[_0x3535('0x3f')][_0x3535('0x40')](_0x17e2a0);})[_0x3535('0x23')](function(_0x5258cc){_0x2594d7[_0x3535('0x41')]=_0x5258cc;return _0x2594d7;})[_0x3535('0x23')](respondWithFilteredResult(_0x167e64,_0x17e2a0))[_0x3535('0x42')](handleError(_0x167e64,null));};exports[_0x3535('0x43')]=function(_0x6c896c,_0x139ed6){var _0x347777={'raw':!![],'where':{'id':_0x6c896c[_0x3535('0x44')]['id']}},_0x2d12cc={};_0x2d12cc[_0x3535('0x2c')]=_[_0x3535('0x2d')](db[_0x3535('0x3f')]['rawAttributes']);_0x2d12cc[_0x3535('0x2e')]=_['keys'](_0x6c896c[_0x3535('0x2e')]);_0x2d12cc['filters']=_[_0x3535('0x2f')](_0x2d12cc[_0x3535('0x2c')],_0x2d12cc[_0x3535('0x2e')]);_0x347777[_0x3535('0x30')]=_[_0x3535('0x2f')](_0x2d12cc['model'],qs[_0x3535('0x31')](_0x6c896c[_0x3535('0x2e')]['fields']));_0x347777[_0x3535('0x30')]=_0x347777[_0x3535('0x30')][_0x3535('0x32')]?_0x347777[_0x3535('0x30')]:_0x2d12cc[_0x3535('0x2c')];if(_0x6c896c[_0x3535('0x2e')]['includeAll']){_0x347777[_0x3535('0x45')]=[{'all':!![]}];}_0x347777=_[_0x3535('0x3a')]({},_0x347777,_0x6c896c['options']);return db[_0x3535('0x3f')]['find'](_0x347777)[_0x3535('0x23')](handleEntityNotFound(_0x139ed6,null))[_0x3535('0x23')](respondWithResult(_0x139ed6,null))[_0x3535('0x42')](handleError(_0x139ed6,null));};exports[_0x3535('0x46')]=function(_0x2d8769,_0x45eb1b){return db[_0x3535('0x3f')][_0x3535('0x46')](_0x2d8769[_0x3535('0x47')],{})[_0x3535('0x23')](respondWithResult(_0x45eb1b,0xc9))[_0x3535('0x42')](handleError(_0x45eb1b,null));};exports[_0x3535('0x48')]=function(_0x5c881d,_0x2bd81b){if(_0x5c881d[_0x3535('0x47')]['id']){delete _0x5c881d[_0x3535('0x47')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5c881d[_0x3535('0x44')]['id']}})[_0x3535('0x23')](handleEntityNotFound(_0x2bd81b,null))[_0x3535('0x23')](saveUpdates(_0x5c881d[_0x3535('0x47')],null))[_0x3535('0x23')](respondWithResult(_0x2bd81b,null))[_0x3535('0x42')](handleError(_0x2bd81b,null));};exports['destroy']=function(_0x1f17ed,_0x399f30){return db[_0x3535('0x3f')][_0x3535('0x49')]({'where':{'id':_0x1f17ed['params']['id']}})['then'](handleEntityNotFound(_0x399f30,null))['then'](removeEntity(_0x399f30,null))[_0x3535('0x42')](handleError(_0x399f30,null));};exports[_0x3535('0x4a')]=function(_0x10d4e6,_0x1c17f4){return db[_0x3535('0x3f')][_0x3535('0x4a')]()[_0x3535('0x23')](respondWithResult(_0x1c17f4,null))[_0x3535('0x42')](handleError(_0x1c17f4,null));}; \ No newline at end of file +var _0x4279=['mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','JscriptyAnswerReport','includeAll','include','findAll','rows','show','params','catch','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x4279,0x8d));var _0x9427=function(_0x5d8f50,_0x5236ed){_0x5d8f50=_0x5d8f50-0x0;var _0x177588=_0x4279[_0x5d8f50];return _0x177588;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9427('0x0'));var zipdir=require(_0x9427('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9427('0x2'));var moment=require(_0x9427('0x3'));var BPromise=require(_0x9427('0x4'));var Mustache=require(_0x9427('0x5'));var util=require('util');var path=require(_0x9427('0x6'));var sox=require('sox');var csv=require(_0x9427('0x7'));var ejs=require(_0x9427('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9427('0x9'));var squel=require(_0x9427('0xa'));var crypto=require(_0x9427('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9427('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9427('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9427('0xe'));var qs=require(_0x9427('0xf'));var as=require(_0x9427('0x10'));var hardwareService=require(_0x9427('0x11'));var logger=require(_0x9427('0x12'))(_0x9427('0x13'));var utils=require(_0x9427('0x14'));var config=require(_0x9427('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9427('0x16'))['db'];function respondWithStatusCode(_0x1ceb46,_0x44bd4e){_0x44bd4e=_0x44bd4e||0xcc;return function(_0x17eb26){if(_0x17eb26){return _0x1ceb46[_0x9427('0x17')](_0x44bd4e);}return _0x1ceb46[_0x9427('0x18')](_0x44bd4e)[_0x9427('0x19')]();};}function respondWithResult(_0x1f6b92,_0x250144){_0x250144=_0x250144||0xc8;return function(_0x3a2956){if(_0x3a2956){return _0x1f6b92[_0x9427('0x18')](_0x250144)[_0x9427('0x1a')](_0x3a2956);}};}function respondWithFilteredResult(_0x418e37,_0x5cbf67){return function(_0x3a6f84){if(_0x3a6f84){var _0x1a41eb=typeof _0x5cbf67[_0x9427('0x1b')]==='undefined'&&typeof _0x5cbf67['limit']===_0x9427('0x1c');var _0x567da4=_0x3a6f84[_0x9427('0x1d')];var _0x20de12=_0x1a41eb?0x0:_0x5cbf67['offset'];var _0x5177e2=_0x1a41eb?_0x3a6f84[_0x9427('0x1d')]:_0x5cbf67[_0x9427('0x1b')]+_0x5cbf67[_0x9427('0x1e')];var _0x11fcd4;if(_0x5177e2>=_0x567da4){_0x5177e2=_0x567da4;_0x11fcd4=0xc8;}else{_0x11fcd4=0xce;}_0x418e37[_0x9427('0x18')](_0x11fcd4);return _0x418e37[_0x9427('0x1f')](_0x9427('0x20'),_0x20de12+'-'+_0x5177e2+'/'+_0x567da4)[_0x9427('0x1a')](_0x3a6f84);}return null;};}function patchUpdates(_0xa9da31){return function(_0x97800f){try{jsonpatch[_0x9427('0x21')](_0x97800f,_0xa9da31,!![]);}catch(_0x374291){return BPromise[_0x9427('0x22')](_0x374291);}return _0x97800f[_0x9427('0x23')]();};}function saveUpdates(_0xac18ea,_0x3e8743){return function(_0x4c6c09){if(_0x4c6c09){return _0x4c6c09['update'](_0xac18ea)[_0x9427('0x24')](function(_0x3cde1e){return _0x3cde1e;});}return null;};}function removeEntity(_0x1db2cf,_0x40d8cb){return function(_0x437dda){if(_0x437dda){return _0x437dda[_0x9427('0x25')]()[_0x9427('0x24')](function(){_0x1db2cf[_0x9427('0x18')](0xcc)[_0x9427('0x19')]();});}};}function handleEntityNotFound(_0x1ecd67,_0xb43f57){return function(_0x32a68a){if(!_0x32a68a){_0x1ecd67['sendStatus'](0x194);}return _0x32a68a;};}function handleError(_0x2a9a0c,_0x5d1829){_0x5d1829=_0x5d1829||0x1f4;return function(_0x2ed9b5){logger[_0x9427('0x26')](_0x2ed9b5['stack']);if(_0x2ed9b5[_0x9427('0x27')]){delete _0x2ed9b5[_0x9427('0x27')];}_0x2a9a0c[_0x9427('0x18')](_0x5d1829)[_0x9427('0x28')](_0x2ed9b5);};}exports[_0x9427('0x29')]=function(_0x58c7a2,_0x8e8955){var _0x2a0263={},_0x5947d0={},_0x51a356={'count':0x0,'rows':[]};var _0x2362f0=_[_0x9427('0x2a')](db['JscriptyAnswerReport'][_0x9427('0x2b')],function(_0x127572){return{'name':_0x127572[_0x9427('0x2c')],'type':_0x127572[_0x9427('0x2d')][_0x9427('0x2e')]};});_0x5947d0['model']=_['map'](_0x2362f0,_0x9427('0x27'));_0x5947d0[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x58c7a2['query']);_0x5947d0[_0x9427('0x31')]=_[_0x9427('0x32')](_0x5947d0[_0x9427('0x33')],_0x5947d0['query']);_0x2a0263['attributes']=_[_0x9427('0x32')](_0x5947d0['model'],qs[_0x9427('0x34')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x34')]));_0x2a0263['attributes']=_0x2a0263[_0x9427('0x35')][_0x9427('0x36')]?_0x2a0263[_0x9427('0x35')]:_0x5947d0[_0x9427('0x33')];if(!_0x58c7a2[_0x9427('0x2f')][_0x9427('0x37')]('nolimit')){_0x2a0263['limit']=qs[_0x9427('0x1e')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x1e')]);_0x2a0263[_0x9427('0x1b')]=qs[_0x9427('0x1b')](_0x58c7a2['query'][_0x9427('0x1b')]);}_0x2a0263[_0x9427('0x38')]=qs[_0x9427('0x39')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x39')]);_0x2a0263[_0x9427('0x3a')]=qs[_0x9427('0x31')](_['pick'](_0x58c7a2[_0x9427('0x2f')],_0x5947d0['filters']),_0x2362f0);if(_0x58c7a2['query'][_0x9427('0x3b')]){_0x2a0263[_0x9427('0x3a')]=_[_0x9427('0x3c')](_0x2a0263[_0x9427('0x3a')],{'$or':_[_0x9427('0x2a')](_0x2362f0,function(_0x34915f){if(_0x34915f['type']!=='VIRTUAL'){var _0x689284={};_0x689284[_0x34915f['name']]={'$like':'%'+_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3b')]+'%'};return _0x689284;}})});}_0x2a0263=_['merge']({},_0x2a0263,_0x58c7a2[_0x9427('0x3d')]);var _0xff3674={'where':_0x2a0263['where']};return db[_0x9427('0x3e')][_0x9427('0x1d')](_0xff3674)['then'](function(_0x18b5c4){_0x51a356['count']=_0x18b5c4;if(_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3f')]){_0x2a0263[_0x9427('0x40')]=[{'all':!![]}];}return db[_0x9427('0x3e')][_0x9427('0x41')](_0x2a0263);})[_0x9427('0x24')](function(_0x14e137){_0x51a356[_0x9427('0x42')]=_0x14e137;return _0x51a356;})[_0x9427('0x24')](respondWithFilteredResult(_0x8e8955,_0x2a0263))['catch'](handleError(_0x8e8955,null));};exports[_0x9427('0x43')]=function(_0x234092,_0x4a5c19){var _0x4988f8={'raw':!![],'where':{'id':_0x234092[_0x9427('0x44')]['id']}},_0x17eb62={};_0x17eb62[_0x9427('0x33')]=_[_0x9427('0x30')](db[_0x9427('0x3e')]['rawAttributes']);_0x17eb62[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x234092[_0x9427('0x2f')]);_0x17eb62[_0x9427('0x31')]=_['intersection'](_0x17eb62['model'],_0x17eb62[_0x9427('0x2f')]);_0x4988f8[_0x9427('0x35')]=_[_0x9427('0x32')](_0x17eb62[_0x9427('0x33')],qs[_0x9427('0x34')](_0x234092['query'][_0x9427('0x34')]));_0x4988f8[_0x9427('0x35')]=_0x4988f8['attributes'][_0x9427('0x36')]?_0x4988f8['attributes']:_0x17eb62['model'];if(_0x234092['query']['includeAll']){_0x4988f8['include']=[{'all':!![]}];}_0x4988f8=_['merge']({},_0x4988f8,_0x234092[_0x9427('0x3d')]);return db['JscriptyAnswerReport']['find'](_0x4988f8)['then'](handleEntityNotFound(_0x4a5c19,null))[_0x9427('0x24')](respondWithResult(_0x4a5c19,null))[_0x9427('0x45')](handleError(_0x4a5c19,null));};exports['create']=function(_0x590673,_0x1d3818){return db[_0x9427('0x3e')]['create'](_0x590673['body'],{})[_0x9427('0x24')](respondWithResult(_0x1d3818,0xc9))[_0x9427('0x45')](handleError(_0x1d3818,null));};exports['update']=function(_0x44a0a2,_0x442755){if(_0x44a0a2[_0x9427('0x46')]['id']){delete _0x44a0a2['body']['id'];}return db[_0x9427('0x3e')]['find']({'where':{'id':_0x44a0a2[_0x9427('0x44')]['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x442755,null))[_0x9427('0x24')](saveUpdates(_0x44a0a2[_0x9427('0x46')],null))['then'](respondWithResult(_0x442755,null))[_0x9427('0x45')](handleError(_0x442755,null));};exports[_0x9427('0x25')]=function(_0xe2cac7,_0x664bdc){return db[_0x9427('0x3e')][_0x9427('0x47')]({'where':{'id':_0xe2cac7['params']['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x664bdc,null))[_0x9427('0x24')](removeEntity(_0x664bdc,null))[_0x9427('0x45')](handleError(_0x664bdc,null));};exports[_0x9427('0x48')]=function(_0x1f3530,_0x453be2){return db[_0x9427('0x3e')][_0x9427('0x48')]()[_0x9427('0x24')](respondWithResult(_0x453be2,null))['catch'](handleError(_0x453be2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 2d22ec9..fc562ef 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 _0x811d=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','request-promise','rimraf','./jscriptyAnswerReport.attributes','define'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x811d,0x1e2));var _0xd811=function(_0x258a67,_0x22dae0){_0x258a67=_0x258a67-0x0;var _0x196ced=_0x811d[_0x258a67];return _0x196ced;};'use strict';var _=require(_0xd811('0x0'));var util=require(_0xd811('0x1'));var logger=require(_0xd811('0x2'))(_0xd811('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd811('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd811('0x5'));var config=require('../../config/environment');var attributes=require(_0xd811('0x6'));module['exports']=function(_0x3e1758,_0x4c2d5e){return _0x3e1758[_0xd811('0x7')](_0xd811('0x8'),attributes,{'tableName':_0xd811('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x565a=['bluebird','request-promise','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment'];(function(_0x4cedbe,_0x17c16d){var _0x47aee5=function(_0x24150d){while(--_0x24150d){_0x4cedbe['push'](_0x4cedbe['shift']());}};_0x47aee5(++_0x17c16d);}(_0x565a,0xa5));var _0xa565=function(_0x1c9aa9,_0x195286){_0x1c9aa9=_0x1c9aa9-0x0;var _0x3c2713=_0x565a[_0x1c9aa9];return _0x3c2713;};'use strict';var _=require(_0xa565('0x0'));var util=require(_0xa565('0x1'));var logger=require(_0xa565('0x2'))(_0xa565('0x3'));var moment=require(_0xa565('0x4'));var BPromise=require(_0xa565('0x5'));var rp=require(_0xa565('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa565('0x7'));module[_0xa565('0x8')]=function(_0x186925,_0x49d72f){return _0x186925['define'](_0xa565('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 6bf78f4..ebd6b83 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 _0xa164=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x21b931,_0x356c25){var _0x5a954d=function(_0xe4cf18){while(--_0xe4cf18){_0x21b931['push'](_0x21b931['shift']());}};_0x5a954d(++_0x356c25);}(_0xa164,0x19e));var _0x4a16=function(_0x457b88,_0x40ee3e){_0x457b88=_0x457b88-0x0;var _0x1fb7d3=_0xa164[_0x457b88];return _0x1fb7d3;};'use strict';var _=require('lodash');var util=require(_0x4a16('0x0'));var moment=require(_0x4a16('0x1'));var BPromise=require(_0x4a16('0x2'));var rs=require(_0x4a16('0x3'));var fs=require('fs');var Redis=require(_0x4a16('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4a16('0x5'))(_0x4a16('0x6'));var config=require(_0x4a16('0x7'));var jayson=require(_0x4a16('0x8'));var client=jayson[_0x4a16('0x9')][_0x4a16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55a3e0,_0x425324,_0x35681f){return new BPromise(function(_0x158f4e,_0x5ee06a){return client[_0x4a16('0xb')](_0x55a3e0,_0x35681f)[_0x4a16('0xc')](function(_0x33b2ea){logger[_0x4a16('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x425324,_0x4a16('0xe'));logger['debug'](_0x4a16('0xf'),_0x425324,_0x4a16('0xe'),JSON[_0x4a16('0x10')](_0x33b2ea));if(_0x33b2ea[_0x4a16('0x11')]){if(_0x33b2ea['error']['code']===0x1f4){logger[_0x4a16('0x11')](_0x4a16('0x12'),_0x425324,_0x33b2ea[_0x4a16('0x11')][_0x4a16('0x13')]);return _0x5ee06a(_0x33b2ea[_0x4a16('0x11')][_0x4a16('0x13')]);}logger[_0x4a16('0x11')](_0x4a16('0x12'),_0x425324,_0x33b2ea[_0x4a16('0x11')][_0x4a16('0x13')]);return _0x158f4e(_0x33b2ea[_0x4a16('0x11')][_0x4a16('0x13')]);}else{logger[_0x4a16('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x425324,_0x4a16('0xe'));_0x158f4e(_0x33b2ea[_0x4a16('0x14')][_0x4a16('0x13')]);}})['catch'](function(_0x1f484d){logger[_0x4a16('0x11')](_0x4a16('0x12'),_0x425324,_0x1f484d);_0x5ee06a(_0x1f484d);});});} \ No newline at end of file +var _0x5476=['jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5476,0x148));var _0x6547=function(_0x30eb75,_0x49209a){_0x30eb75=_0x30eb75-0x0;var _0x2f134a=_0x5476[_0x30eb75];return _0x2f134a;};'use strict';var _=require(_0x6547('0x0'));var util=require('util');var moment=require(_0x6547('0x1'));var BPromise=require(_0x6547('0x2'));var rs=require(_0x6547('0x3'));var fs=require('fs');var Redis=require(_0x6547('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6547('0x5'));var logger=require(_0x6547('0x6'))('rpc');var config=require(_0x6547('0x7'));var jayson=require(_0x6547('0x8'));var client=jayson[_0x6547('0x9')][_0x6547('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128f0a,_0x139899,_0x5d4c8f){return new BPromise(function(_0x26d346,_0x3e588a){return client['request'](_0x128f0a,_0x5d4c8f)[_0x6547('0xb')](function(_0x4d0265){logger[_0x6547('0xc')](_0x6547('0xd'),_0x139899,_0x6547('0xe'));logger[_0x6547('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x139899,_0x6547('0xe'),JSON[_0x6547('0x10')](_0x4d0265));if(_0x4d0265[_0x6547('0x11')]){if(_0x4d0265['error'][_0x6547('0x12')]===0x1f4){logger['error'](_0x6547('0xd'),_0x139899,_0x4d0265[_0x6547('0x11')]['message']);return _0x3e588a(_0x4d0265['error'][_0x6547('0x13')]);}logger[_0x6547('0x11')](_0x6547('0xd'),_0x139899,_0x4d0265[_0x6547('0x11')][_0x6547('0x13')]);return _0x26d346(_0x4d0265[_0x6547('0x11')][_0x6547('0x13')]);}else{logger[_0x6547('0xc')](_0x6547('0xd'),_0x139899,_0x6547('0xe'));_0x26d346(_0x4d0265[_0x6547('0x14')][_0x6547('0x13')]);}})['catch'](function(_0x32c34a){logger['error'](_0x6547('0xd'),_0x139899,_0x32c34a);_0x3e588a(_0x32c34a);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 347d16b..ad7679b 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 _0x7222=['getSummary','post','create','/:id/clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','/:id/summary','30s'];(function(_0x1f53e7,_0x530918){var _0x35f3d7=function(_0x2c6f29){while(--_0x2c6f29){_0x1f53e7['push'](_0x1f53e7['shift']());}};_0x35f3d7(++_0x530918);}(_0x7222,0x127));var _0x2722=function(_0x447ce1,_0x11cf0b){_0x447ce1=_0x447ce1-0x0;var _0x4c1e7a=_0x7222[_0x447ce1];return _0x4c1e7a;};'use strict';var multer=require(_0x2722('0x0'));var util=require(_0x2722('0x1'));var path=require(_0x2722('0x2'));var timeout=require(_0x2722('0x3'));var express=require(_0x2722('0x4'));var router=express[_0x2722('0x5')]();var fs_extra=require(_0x2722('0x6'));var auth=require(_0x2722('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2722('0x8'));router[_0x2722('0x9')]('/',auth[_0x2722('0xa')](),controller[_0x2722('0xb')]);router['get'](_0x2722('0xc'),auth['isAuthenticated'](),controller[_0x2722('0xd')]);router[_0x2722('0x9')]('/:id/sessions',auth[_0x2722('0xa')](),controller[_0x2722('0xe')]);router[_0x2722('0x9')]('/:id/answers',auth[_0x2722('0xa')](),controller['getAnswers']);router[_0x2722('0x9')](_0x2722('0xf'),auth[_0x2722('0xa')](),timeout(_0x2722('0x10')),controller[_0x2722('0x11')]);router[_0x2722('0x12')]('/',auth[_0x2722('0xa')](),controller[_0x2722('0x13')]);router[_0x2722('0x12')](_0x2722('0x14'),auth['isAuthenticated'](),controller['clone']);router[_0x2722('0x15')](_0x2722('0xc'),auth[_0x2722('0xa')](),controller[_0x2722('0x16')]);router[_0x2722('0x17')](_0x2722('0xc'),auth[_0x2722('0xa')](),controller[_0x2722('0x18')]);module[_0x2722('0x19')]=router; \ No newline at end of file +var _0xb5cd=['../../config/environment','get','isAuthenticated','/:id','show','/:id/sessions','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x55dbd0,_0x499fe1){var _0x90466f=function(_0x2c9d7f){while(--_0x2c9d7f){_0x55dbd0['push'](_0x55dbd0['shift']());}};_0x90466f(++_0x499fe1);}(_0xb5cd,0xd1));var _0xdb5c=function(_0x379efd,_0x5139f1){_0x379efd=_0x379efd-0x0;var _0x401426=_0xb5cd[_0x379efd];return _0x401426;};'use strict';var multer=require(_0xdb5c('0x0'));var util=require('util');var path=require(_0xdb5c('0x1'));var timeout=require(_0xdb5c('0x2'));var express=require(_0xdb5c('0x3'));var router=express[_0xdb5c('0x4')]();var fs_extra=require(_0xdb5c('0x5'));var auth=require(_0xdb5c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb5c('0x7'));var controller=require('./jscriptyProject.controller');router[_0xdb5c('0x8')]('/',auth[_0xdb5c('0x9')](),controller['index']);router[_0xdb5c('0x8')](_0xdb5c('0xa'),auth[_0xdb5c('0x9')](),controller[_0xdb5c('0xb')]);router[_0xdb5c('0x8')](_0xdb5c('0xc'),auth[_0xdb5c('0x9')](),controller['getSessions']);router['get']('/:id/answers',auth[_0xdb5c('0x9')](),controller[_0xdb5c('0xd')]);router[_0xdb5c('0x8')](_0xdb5c('0xe'),auth['isAuthenticated'](),timeout(_0xdb5c('0xf')),controller[_0xdb5c('0x10')]);router[_0xdb5c('0x11')]('/',auth[_0xdb5c('0x9')](),controller['create']);router['post'](_0xdb5c('0x12'),auth[_0xdb5c('0x9')](),controller[_0xdb5c('0x13')]);router['put'](_0xdb5c('0xa'),auth['isAuthenticated'](),controller[_0xdb5c('0x14')]);router[_0xdb5c('0x15')](_0xdb5c('0xa'),auth['isAuthenticated'](),controller[_0xdb5c('0x16')]);module[_0xdb5c('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a8baa6a..0552af9 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 _0xaae7=['sequelize','lodash','exports','STRING','name','TEXT','isObjectLike','formData','format','getDataValue','description','BOOLEAN'];(function(_0x2d21cc,_0x27ef2a){var _0x7ab87e=function(_0xa7b1f0){while(--_0xa7b1f0){_0x2d21cc['push'](_0x2d21cc['shift']());}};_0x7ab87e(++_0x27ef2a);}(_0xaae7,0x78));var _0x7aae=function(_0x1d3534,_0x2837e5){_0x1d3534=_0x1d3534-0x0;var _0xaa8739=_0xaae7[_0x1d3534];return _0xaa8739;};'use strict';var Sequelize=require(_0x7aae('0x0'));var _=require(_0x7aae('0x1'));var util=require('util');module[_0x7aae('0x2')]={'name':{'type':Sequelize[_0x7aae('0x3')],'unique':_0x7aae('0x4')},'description':{'type':Sequelize[_0x7aae('0x3')]},'formData':{'type':Sequelize[_0x7aae('0x5')]('long'),'set':function(_0x562a41){if(_[_0x7aae('0x6')](_0x562a41)){this['setDataValue'](_0x7aae('0x7'),JSON['stringify'](_0x562a41));}else if(_['isString'](_0x562a41)){this['setDataValue'](_0x7aae('0x7'),_0x562a41);}else{this['setDataValue'](_0x7aae('0x7'),util[_0x7aae('0x8')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x7aae('0x4'))||'',this[_0x7aae('0x9')](_0x7aae('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7aae('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7aae('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x846d=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','util','exports','STRING','TEXT','setDataValue','formData','stringify','isString'];(function(_0x157ddb,_0x232cdf){var _0x4c8f4e=function(_0x3ddc4a){while(--_0x3ddc4a){_0x157ddb['push'](_0x157ddb['shift']());}};_0x4c8f4e(++_0x232cdf);}(_0x846d,0x1d7));var _0xd846=function(_0x1a5687,_0xc2188f){_0x1a5687=_0x1a5687-0x0;var _0x257d5c=_0x846d[_0x1a5687];return _0x257d5c;};'use strict';var Sequelize=require(_0xd846('0x0'));var _=require('lodash');var util=require(_0xd846('0x1'));module[_0xd846('0x2')]={'name':{'type':Sequelize[_0xd846('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd846('0x4')]('long'),'set':function(_0x3c20ff){if(_['isObjectLike'](_0x3c20ff)){this[_0xd846('0x5')](_0xd846('0x6'),JSON[_0xd846('0x7')](_0x3c20ff));}else if(_[_0xd846('0x8')](_0x3c20ff)){this['setDataValue'](_0xd846('0x6'),_0x3c20ff);}else{this['setDataValue'](_0xd846('0x6'),util[_0xd846('0x9')](_0xd846('0xa'),this[_0xd846('0xb')](_0xd846('0xc'))||'',this[_0xd846('0xb')](_0xd846('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd846('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd846('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 7f60261..5132fbd 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 _0x9ab9=['include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','destroy','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','Projects','UserProfileResource','error','name','map','JscriptyProject','fieldName','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options'];(function(_0xd5bbd2,_0x378ea2){var _0x39f9a4=function(_0x4bd83d){while(--_0x4bd83d){_0xd5bbd2['push'](_0xd5bbd2['shift']());}};_0x39f9a4(++_0x378ea2);}(_0x9ab9,0x19d));var _0x99ab=function(_0x1553ca,_0x417e4d){_0x1553ca=_0x1553ca-0x0;var _0x4c720d=_0x9ab9[_0x1553ca];return _0x4c720d;};'use strict';var emlformat=require(_0x99ab('0x0'));var rimraf=require(_0x99ab('0x1'));var zipdir=require(_0x99ab('0x2'));var jsonpatch=require(_0x99ab('0x3'));var rp=require(_0x99ab('0x4'));var moment=require('moment');var BPromise=require(_0x99ab('0x5'));var Mustache=require(_0x99ab('0x6'));var util=require('util');var path=require(_0x99ab('0x7'));var sox=require('sox');var csv=require(_0x99ab('0x8'));var ejs=require(_0x99ab('0x9'));var fs=require('fs');var fs_extra=require(_0x99ab('0xa'));var _=require(_0x99ab('0xb'));var squel=require(_0x99ab('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99ab('0xd'));var toCsv=require(_0x99ab('0x8'));var querystring=require('querystring');var Papa=require(_0x99ab('0xe'));var Redis=require(_0x99ab('0xf'));var authService=require(_0x99ab('0x10'));var qs=require(_0x99ab('0x11'));var as=require(_0x99ab('0x12'));var hardwareService=require(_0x99ab('0x13'));var logger=require('../../config/logger')(_0x99ab('0x14'));var utils=require(_0x99ab('0x15'));var config=require(_0x99ab('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xed2100,_0x24229c){_0x24229c=_0x24229c||0xcc;return function(_0x3739fb){if(_0x3739fb){return _0xed2100[_0x99ab('0x17')](_0x24229c);}return _0xed2100[_0x99ab('0x18')](_0x24229c)[_0x99ab('0x19')]();};}function respondWithResult(_0x584744,_0x97639f){_0x97639f=_0x97639f||0xc8;return function(_0x5bf382){if(_0x5bf382){return _0x584744['status'](_0x97639f)[_0x99ab('0x1a')](_0x5bf382);}};}function respondWithFilteredResult(_0x36d89e,_0xa60b53){return function(_0x4b11f1){if(_0x4b11f1){var _0x4299ae=typeof _0xa60b53[_0x99ab('0x1b')]===_0x99ab('0x1c')&&typeof _0xa60b53[_0x99ab('0x1d')]===_0x99ab('0x1c');var _0x2a5e0e=_0x4b11f1[_0x99ab('0x1e')];var _0x2c24c9=_0x4299ae?0x0:_0xa60b53['offset'];var _0x14a515=_0x4299ae?_0x4b11f1[_0x99ab('0x1e')]:_0xa60b53[_0x99ab('0x1b')]+_0xa60b53[_0x99ab('0x1d')];var _0x34e694;if(_0x14a515>=_0x2a5e0e){_0x14a515=_0x2a5e0e;_0x34e694=0xc8;}else{_0x34e694=0xce;}_0x36d89e[_0x99ab('0x18')](_0x34e694);return _0x36d89e[_0x99ab('0x1f')](_0x99ab('0x20'),_0x2c24c9+'-'+_0x14a515+'/'+_0x2a5e0e)[_0x99ab('0x1a')](_0x4b11f1);}return null;};}function patchUpdates(_0x51ded6){return function(_0x5ab547){try{jsonpatch[_0x99ab('0x21')](_0x5ab547,_0x51ded6,!![]);}catch(_0x26d94a){return BPromise[_0x99ab('0x22')](_0x26d94a);}return _0x5ab547['save']();};}function saveUpdates(_0x2e0464,_0x3a0897){return function(_0xa3cf1e){if(_0xa3cf1e){return _0xa3cf1e[_0x99ab('0x23')](_0x2e0464)[_0x99ab('0x24')](function(_0x15fea0){return _0x15fea0;});}return null;};}function removeEntity(_0x2fd2df,_0x5411a6){return function(_0x5de675){if(_0x5de675){return _0x5de675['destroy']()[_0x99ab('0x24')](function(){var _0x56bdb7=_0x5de675['get']({'plain':!![]});var _0x2d3281=_0x99ab('0x25');return db[_0x99ab('0x26')]['destroy']({'where':{'type':_0x2d3281,'resourceId':_0x56bdb7['id']}})[_0x99ab('0x24')](function(){return _0x5de675;});})[_0x99ab('0x24')](function(){_0x2fd2df[_0x99ab('0x18')](0xcc)[_0x99ab('0x19')]();});}};}function handleEntityNotFound(_0x36414c,_0x45d50e){return function(_0x970ce7){if(!_0x970ce7){_0x36414c[_0x99ab('0x17')](0x194);}return _0x970ce7;};}function handleError(_0xe3945b,_0x4ce5ce){_0x4ce5ce=_0x4ce5ce||0x1f4;return function(_0x37182e){logger[_0x99ab('0x27')](_0x37182e['stack']);if(_0x37182e[_0x99ab('0x28')]){delete _0x37182e[_0x99ab('0x28')];}_0xe3945b[_0x99ab('0x18')](_0x4ce5ce)['send'](_0x37182e);};}exports['index']=function(_0x415276,_0x2cadac){var _0x1aeca3={},_0x3efd67={},_0x16b405={'count':0x0,'rows':[]};var _0x36c0f1=_[_0x99ab('0x29')](db[_0x99ab('0x2a')]['rawAttributes'],function(_0x44bf54){return{'name':_0x44bf54[_0x99ab('0x2b')],'type':_0x44bf54['type'][_0x99ab('0x2c')]};});_0x3efd67[_0x99ab('0x2d')]=_['map'](_0x36c0f1,'name');_0x3efd67[_0x99ab('0x2e')]=_[_0x99ab('0x2f')](_0x415276[_0x99ab('0x2e')]);_0x3efd67['filters']=_['intersection'](_0x3efd67['model'],_0x3efd67['query']);_0x1aeca3['attributes']=_['intersection'](_0x3efd67[_0x99ab('0x2d')],qs[_0x99ab('0x30')](_0x415276[_0x99ab('0x2e')]['fields']));_0x1aeca3[_0x99ab('0x31')]=_0x1aeca3[_0x99ab('0x31')][_0x99ab('0x32')]?_0x1aeca3['attributes']:_0x3efd67[_0x99ab('0x2d')];if(!_0x415276[_0x99ab('0x2e')][_0x99ab('0x33')](_0x99ab('0x34'))){_0x1aeca3[_0x99ab('0x1d')]=qs[_0x99ab('0x1d')](_0x415276[_0x99ab('0x2e')]['limit']);_0x1aeca3['offset']=qs[_0x99ab('0x1b')](_0x415276[_0x99ab('0x2e')]['offset']);}_0x1aeca3[_0x99ab('0x35')]=qs[_0x99ab('0x36')](_0x415276[_0x99ab('0x2e')]['sort']);_0x1aeca3[_0x99ab('0x37')]=qs[_0x99ab('0x38')](_[_0x99ab('0x39')](_0x415276[_0x99ab('0x2e')],_0x3efd67[_0x99ab('0x38')]),_0x36c0f1);if(_0x415276['query'][_0x99ab('0x3a')]){_0x1aeca3[_0x99ab('0x37')]=_['merge'](_0x1aeca3[_0x99ab('0x37')],{'$or':_['map'](_0x36c0f1,function(_0xb62fd6){if(_0xb62fd6[_0x99ab('0x3b')]!==_0x99ab('0x3c')){var _0x67fefb={};_0x67fefb[_0xb62fd6[_0x99ab('0x28')]]={'$like':'%'+_0x415276[_0x99ab('0x2e')][_0x99ab('0x3a')]+'%'};return _0x67fefb;}})});}_0x1aeca3=_[_0x99ab('0x3d')]({},_0x1aeca3,_0x415276[_0x99ab('0x3e')]);var _0x2c4f29={'where':_0x1aeca3['where']};return db[_0x99ab('0x2a')][_0x99ab('0x1e')](_0x2c4f29)['then'](function(_0x13c94f){_0x16b405['count']=_0x13c94f;if(_0x415276[_0x99ab('0x2e')]['includeAll']){_0x1aeca3[_0x99ab('0x3f')]=[{'all':!![]}];}return db[_0x99ab('0x2a')][_0x99ab('0x40')](_0x1aeca3);})[_0x99ab('0x24')](function(_0x5aac8f){_0x16b405[_0x99ab('0x41')]=_0x5aac8f;return _0x16b405;})[_0x99ab('0x24')](respondWithFilteredResult(_0x2cadac,_0x1aeca3))[_0x99ab('0x42')](handleError(_0x2cadac,null));};exports[_0x99ab('0x43')]=function(_0x29b073,_0x3bdfbc){var _0x402120={'raw':![],'where':{'id':_0x29b073[_0x99ab('0x44')]['id']}},_0x35ac49={};_0x35ac49[_0x99ab('0x2d')]=_[_0x99ab('0x2f')](db[_0x99ab('0x2a')][_0x99ab('0x45')]);_0x35ac49[_0x99ab('0x2e')]=_[_0x99ab('0x2f')](_0x29b073['query']);_0x35ac49[_0x99ab('0x38')]=_[_0x99ab('0x46')](_0x35ac49['model'],_0x35ac49[_0x99ab('0x2e')]);_0x402120[_0x99ab('0x31')]=_[_0x99ab('0x46')](_0x35ac49[_0x99ab('0x2d')],qs[_0x99ab('0x30')](_0x29b073[_0x99ab('0x2e')][_0x99ab('0x30')]));_0x402120[_0x99ab('0x31')]=_0x402120[_0x99ab('0x31')][_0x99ab('0x32')]?_0x402120[_0x99ab('0x31')]:_0x35ac49['model'];if(_0x29b073[_0x99ab('0x2e')][_0x99ab('0x47')]){_0x402120[_0x99ab('0x3f')]=[{'all':!![]}];}_0x402120=_[_0x99ab('0x3d')]({},_0x402120,_0x29b073['options']);return db['JscriptyProject'][_0x99ab('0x48')](_0x402120)['then'](handleEntityNotFound(_0x3bdfbc,null))[_0x99ab('0x24')](respondWithResult(_0x3bdfbc,null))[_0x99ab('0x42')](handleError(_0x3bdfbc,null));};exports[_0x99ab('0x49')]=function(_0x3953dc,_0x167607){return db[_0x99ab('0x2a')][_0x99ab('0x49')](_0x3953dc['body'],{})[_0x99ab('0x24')](function(_0x452f0f){var _0x78eb5e=_0x3953dc[_0x99ab('0x4a')][_0x99ab('0x4b')]({'plain':!![]});if(!_0x78eb5e)throw new Error(_0x99ab('0x4c'));if(_0x78eb5e[_0x99ab('0x4d')]===_0x99ab('0x4a')){var _0x3b6e32=_0x452f0f[_0x99ab('0x4b')]({'plain':!![]});var _0x4d5e00=_0x99ab('0x25');return db[_0x99ab('0x4e')]['find']({'where':{'name':_0x4d5e00,'userProfileId':_0x78eb5e[_0x99ab('0x4f')]},'raw':!![]})[_0x99ab('0x24')](function(_0x1288c3){if(_0x1288c3&&_0x1288c3[_0x99ab('0x50')]===0x0){return db[_0x99ab('0x26')][_0x99ab('0x49')]({'name':_0x3b6e32[_0x99ab('0x28')],'resourceId':_0x3b6e32['id'],'type':_0x1288c3['name'],'sectionId':_0x1288c3['id']},{})[_0x99ab('0x24')](function(){return _0x452f0f;});}else{return _0x452f0f;}})[_0x99ab('0x42')](function(_0x46814a){logger[_0x99ab('0x27')](_0x99ab('0x51'),_0x46814a);throw _0x46814a;});}return _0x452f0f;})['then'](respondWithResult(_0x167607,0xc9))['catch'](handleError(_0x167607,null));};exports[_0x99ab('0x52')]=function(_0x36ac2c,_0x284aee){var _0x24e2a3={'where':{'id':_0x36ac2c[_0x99ab('0x44')]['id']}},_0x5af4a6={};_0x5af4a6['model']=_[_0x99ab('0x2f')](db[_0x99ab('0x2a')]['rawAttributes']);_0x24e2a3[_0x99ab('0x31')]=_[_0x99ab('0x46')](_0x5af4a6[_0x99ab('0x2d')],qs['fields'](_0x36ac2c[_0x99ab('0x2e')][_0x99ab('0x30')]));_0x24e2a3['attributes']=_0x24e2a3[_0x99ab('0x31')][_0x99ab('0x32')]?_0x24e2a3[_0x99ab('0x31')]:_0x5af4a6[_0x99ab('0x2d')];if(_0x36ac2c[_0x99ab('0x2e')][_0x99ab('0x47')]){_0x24e2a3[_0x99ab('0x3f')]=[{'all':!![]}];}_0x24e2a3=_[_0x99ab('0x3d')]({},_0x24e2a3,_0x36ac2c[_0x99ab('0x3e')]);return db[_0x99ab('0x2a')][_0x99ab('0x48')](_0x24e2a3)[_0x99ab('0x24')](handleEntityNotFound(_0x284aee,null))['then'](function(_0x59d71d){if(_0x59d71d){var _0x1099aa=_0x59d71d[_0x99ab('0x4b')]({'plain':!![]});_0x1099aa=qs[_0x99ab('0x53')](_0x1099aa,['id','createdAt',_0x99ab('0x54')]);_0x36ac2c[_0x99ab('0x55')]=_[_0x99ab('0x53')](_0x36ac2c[_0x99ab('0x55')],['id',_0x99ab('0x56'),_0x99ab('0x54')]);return db[_0x99ab('0x2a')][_0x99ab('0x49')](_[_0x99ab('0x3d')](_0x1099aa,_0x36ac2c[_0x99ab('0x55')]),{'include':_0x36ac2c[_0x99ab('0x2e')][_0x99ab('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0xc48650){var _0x261317=_0x36ac2c[_0x99ab('0x4a')][_0x99ab('0x4b')]({'plain':!![]});if(!_0x261317)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x261317[_0x99ab('0x4d')]===_0x99ab('0x4a')){var _0x27ad91=_0xc48650['get']({'plain':!![]});var _0x32f963=_0x99ab('0x25');return db['UserProfileSection'][_0x99ab('0x48')]({'where':{'name':_0x32f963,'userProfileId':_0x261317[_0x99ab('0x4f')]},'raw':!![]})['then'](function(_0x11b781){if(_0x11b781&&_0x11b781[_0x99ab('0x50')]===0x0){return db[_0x99ab('0x26')][_0x99ab('0x49')]({'name':_0x27ad91[_0x99ab('0x28')],'resourceId':_0x27ad91['id'],'type':_0x11b781['name'],'sectionId':_0x11b781['id']},{})['then'](function(){return _0xc48650;});}else{return _0xc48650;}})[_0x99ab('0x42')](function(_0x1225e7){logger['error'](_0x99ab('0x51'),_0x1225e7);throw _0x1225e7;});}return _0xc48650;});}})['then'](respondWithResult(_0x284aee,0xc9))[_0x99ab('0x42')](handleError(_0x284aee,null));};exports[_0x99ab('0x23')]=function(_0x1faa9c,_0x42509a){if(_0x1faa9c[_0x99ab('0x55')]['id']){delete _0x1faa9c[_0x99ab('0x55')]['id'];}return db['JscriptyProject'][_0x99ab('0x48')]({'where':{'id':_0x1faa9c[_0x99ab('0x44')]['id']}})[_0x99ab('0x24')](handleEntityNotFound(_0x42509a,null))[_0x99ab('0x24')](saveUpdates(_0x1faa9c['body'],null))[_0x99ab('0x24')](respondWithResult(_0x42509a,null))['catch'](handleError(_0x42509a,null));};exports[_0x99ab('0x57')]=function(_0x354b3,_0xa7bb91){return db[_0x99ab('0x2a')]['find']({'where':{'id':_0x354b3[_0x99ab('0x44')]['id']}})[_0x99ab('0x24')](handleEntityNotFound(_0xa7bb91,null))['then'](removeEntity(_0xa7bb91,null))[_0x99ab('0x42')](handleError(_0xa7bb91,null));};exports[_0x99ab('0x58')]=function(_0x10e4c4,_0xa3f3de,_0x1ab16a){var _0xac4126={'raw':!![],'where':{}};var _0x38d34c={};var _0x794b87={'count':0x0,'rows':[]};return db[_0x99ab('0x2a')][_0x99ab('0x59')]({'where':{'id':_0x10e4c4[_0x99ab('0x44')]['id']}})[_0x99ab('0x24')](handleEntityNotFound(_0xa3f3de,null))[_0x99ab('0x24')](function(_0x1ffc72){if(_0x1ffc72){_0x38d34c[_0x99ab('0x2d')]=_['keys'](db[_0x99ab('0x5a')][_0x99ab('0x45')]);_0x38d34c[_0x99ab('0x2e')]=_[_0x99ab('0x2f')](_0x10e4c4['query']);_0x38d34c[_0x99ab('0x38')]=_['intersection'](_0x38d34c[_0x99ab('0x2d')],_0x38d34c['query']);_0xac4126['attributes']=_[_0x99ab('0x46')](_0x38d34c[_0x99ab('0x2d')],qs[_0x99ab('0x30')](_0x10e4c4[_0x99ab('0x2e')][_0x99ab('0x30')]));_0xac4126[_0x99ab('0x31')]=_0xac4126['attributes']['length']?_0xac4126[_0x99ab('0x31')]:_0x38d34c[_0x99ab('0x2d')];if(!_0x10e4c4[_0x99ab('0x2e')][_0x99ab('0x33')](_0x99ab('0x34'))){_0xac4126[_0x99ab('0x1d')]=qs['limit'](_0x10e4c4['query'][_0x99ab('0x1d')]);_0xac4126[_0x99ab('0x1b')]=qs['offset'](_0x10e4c4[_0x99ab('0x2e')][_0x99ab('0x1b')]);}_0xac4126[_0x99ab('0x35')]=qs[_0x99ab('0x36')](_0x10e4c4[_0x99ab('0x2e')][_0x99ab('0x36')]);_0xac4126[_0x99ab('0x37')]=qs[_0x99ab('0x38')](_[_0x99ab('0x39')](_0x10e4c4['query'],_0x38d34c[_0x99ab('0x38')]));_0xac4126['where'][_0x99ab('0x5b')]=_0x1ffc72['id'];if(_0x10e4c4[_0x99ab('0x2e')][_0x99ab('0x3a')]){_0xac4126['where']=_[_0x99ab('0x3d')](_0xac4126[_0x99ab('0x37')],{'$or':_[_0x99ab('0x29')](_0xac4126[_0x99ab('0x31')],function(_0x16a809){var _0x3ba901={};_0x3ba901[_0x16a809]={'$like':'%'+_0x10e4c4['query'][_0x99ab('0x3a')]+'%'};return _0x3ba901;})});}_0xac4126=_[_0x99ab('0x3d')]({},_0xac4126,_0x10e4c4[_0x99ab('0x3e')]);return db[_0x99ab('0x5a')][_0x99ab('0x1e')]({'where':_0xac4126[_0x99ab('0x37')]})[_0x99ab('0x24')](function(_0x3c1f91){_0x794b87['count']=_0x3c1f91;if(_0x10e4c4[_0x99ab('0x2e')][_0x99ab('0x47')]){_0xac4126['include']=[{'all':!![]}];}return db[_0x99ab('0x5a')][_0x99ab('0x40')](_0xac4126);})[_0x99ab('0x24')](function(_0xed620e){_0x794b87[_0x99ab('0x41')]=_0xed620e;return _0x794b87;});}})['then'](respondWithFilteredResult(_0xa3f3de,_0xac4126))[_0x99ab('0x42')](handleError(_0xa3f3de,null));};exports[_0x99ab('0x5c')]=function(_0x237baf,_0x57f707,_0x39ac46){var _0x59642f={'raw':!![],'where':{}};var _0x44fafb={};var _0x3980e7={'count':0x0,'rows':[]};return db[_0x99ab('0x2a')]['findOne']({'where':{'id':_0x237baf[_0x99ab('0x44')]['id']}})['then'](handleEntityNotFound(_0x57f707,null))['then'](function(_0x378f3f){if(_0x378f3f){_0x44fafb[_0x99ab('0x2d')]=_['keys'](db[_0x99ab('0x5d')][_0x99ab('0x45')]);_0x44fafb[_0x99ab('0x2e')]=_[_0x99ab('0x2f')](_0x237baf[_0x99ab('0x2e')]);_0x44fafb['filters']=_[_0x99ab('0x46')](_0x44fafb[_0x99ab('0x2d')],_0x44fafb[_0x99ab('0x2e')]);_0x59642f[_0x99ab('0x31')]=_[_0x99ab('0x46')](_0x44fafb[_0x99ab('0x2d')],qs[_0x99ab('0x30')](_0x237baf[_0x99ab('0x2e')][_0x99ab('0x30')]));_0x59642f['attributes']=_0x59642f['attributes'][_0x99ab('0x32')]?_0x59642f['attributes']:_0x44fafb[_0x99ab('0x2d')];if(!_0x237baf[_0x99ab('0x2e')][_0x99ab('0x33')](_0x99ab('0x34'))){_0x59642f[_0x99ab('0x1d')]=qs['limit'](_0x237baf[_0x99ab('0x2e')][_0x99ab('0x1d')]);_0x59642f[_0x99ab('0x1b')]=qs[_0x99ab('0x1b')](_0x237baf[_0x99ab('0x2e')]['offset']);}_0x59642f['order']=qs['sort'](_0x237baf['query'][_0x99ab('0x36')]);_0x59642f[_0x99ab('0x37')]=qs[_0x99ab('0x38')](_[_0x99ab('0x39')](_0x237baf[_0x99ab('0x2e')],_0x44fafb[_0x99ab('0x38')]));_0x59642f[_0x99ab('0x37')]['ProjectId']=_0x378f3f['id'];if(_0x237baf[_0x99ab('0x2e')][_0x99ab('0x3a')]){_0x59642f[_0x99ab('0x37')]=_[_0x99ab('0x3d')](_0x59642f[_0x99ab('0x37')],{'$or':_['map'](_0x59642f[_0x99ab('0x31')],function(_0x55f95b){var _0x5de77b={};_0x5de77b[_0x55f95b]={'$like':'%'+_0x237baf[_0x99ab('0x2e')]['filter']+'%'};return _0x5de77b;})});}_0x59642f=_[_0x99ab('0x3d')]({},_0x59642f,_0x237baf['options']);return db['JscriptyAnswerReport'][_0x99ab('0x1e')]({'where':_0x59642f[_0x99ab('0x37')]})['then'](function(_0x13e8e6){_0x3980e7[_0x99ab('0x1e')]=_0x13e8e6;if(_0x237baf[_0x99ab('0x2e')][_0x99ab('0x47')]){_0x59642f['include']=[{'all':!![]}];}return db[_0x99ab('0x5d')][_0x99ab('0x40')](_0x59642f);})['then'](function(_0x1a3f3b){_0x3980e7[_0x99ab('0x41')]=_0x1a3f3b;return _0x3980e7;});}})[_0x99ab('0x24')](respondWithFilteredResult(_0x57f707,_0x59642f))[_0x99ab('0x42')](handleError(_0x57f707,null));};function char(_0x2c9448){return'number'===typeof _0x2c9448?String[_0x99ab('0x5e')][_0x99ab('0x21')](null,arguments):_0x2c9448;}function needsEncapsulation(_0x47d8a0){return!!_0x47d8a0&&(_0x47d8a0[_0x99ab('0x5f')]()['indexOf'](char(0xd))>=0x0||_0x47d8a0[_0x99ab('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x47d8a0['toString']()[_0x99ab('0x60')](char(0x2c))>=0x0||_0x47d8a0['toString']()[_0x99ab('0x60')](char(0x22))>=0x0);}function encapsulate(_0x1365e1){var _0x4845c7=char(0x22),_0x598fe4='\x5c'+char(0x22),_0x15c015=_0x1365e1[_0x99ab('0x5f')]()[_0x99ab('0x61')](new RegExp(_0x4845c7,'g'),_0x598fe4);return _0x4845c7+_0x15c015+_0x4845c7;}exports[_0x99ab('0x62')]=function(_0x1bc1c0,_0x196df3,_0xc553af){var _0x5310d4,_0x2e2a1e;var _0x4d2bc8={'where':{'ProjectId':_0x1bc1c0[_0x99ab('0x44')]['id']}};if(_0x1bc1c0['query'][_0x99ab('0x63')]){_0x4d2bc8[_0x99ab('0x37')][_0x99ab('0x64')]=JSON[_0x99ab('0x65')](_0x1bc1c0[_0x99ab('0x2e')][_0x99ab('0x63')]);}return db[_0x99ab('0x5a')][_0x99ab('0x40')](_0x4d2bc8)[_0x99ab('0x24')](handleEntityNotFound(_0x196df3,null))[_0x99ab('0x24')](function(_0x63e6a7){if(_0x63e6a7){_0x5310d4=_0x63e6a7;return db[_0x99ab('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0x99ab('0x29')](_0x5310d4,'id')},'ProjectId':_0x1bc1c0[_0x99ab('0x44')]['id']},'order':'-createdAt'});}})[_0x99ab('0x24')](handleEntityNotFound(_0x196df3,null))[_0x99ab('0x24')](function(_0x388f71){if(_0x388f71){_0x2e2a1e=_0x388f71;var _0x1dbff3={};for(var _0x17f1b5=0x0,_0x305f24=_0x2e2a1e[_0x99ab('0x32')];_0x17f1b5<_0x305f24;_0x17f1b5++){if(!_0x1dbff3['hasOwnProperty'](_0x2e2a1e[_0x17f1b5]['questionId'])){_0x1dbff3[_0x2e2a1e[_0x17f1b5][_0x99ab('0x67')]]=needsEncapsulation(_0x2e2a1e[_0x17f1b5][_0x99ab('0x68')])?encapsulate(_0x2e2a1e[_0x17f1b5][_0x99ab('0x68')]):_0x2e2a1e[_0x17f1b5]['question'];}}var _0x342bb7=[],_0x20f909={};for(var _0x21b08f=0x0,_0x10790b=_0x5310d4[_0x99ab('0x32')];_0x21b08f<_0x10790b;_0x21b08f++){_0x20f909={'ProjectId':_0x1bc1c0[_0x99ab('0x44')]['id'],'SessionId':_0x5310d4[_0x21b08f]['id'],'StartTime':moment(_0x5310d4[_0x21b08f][_0x99ab('0x64')])[_0x99ab('0x69')](_0x99ab('0x6a'))};for(var _0x56a795=0x0,_0xbd13be=_0x2e2a1e[_0x99ab('0x32')];_0x56a795<_0xbd13be;_0x56a795++){if(_0x2e2a1e[_0x56a795][_0x99ab('0x6b')]==_0x5310d4[_0x21b08f]['id']&&_0x1dbff3[_0x99ab('0x33')](_0x2e2a1e[_0x56a795][_0x99ab('0x67')])){_0x20f909[_0x1dbff3[_0x2e2a1e[_0x56a795][_0x99ab('0x67')]]]=_0x2e2a1e[_0x56a795][_0x99ab('0x6c')];}}for(var _0x55b0f5 in _0x1dbff3){if(!_0x20f909['hasOwnProperty'](_0x1dbff3[_0x55b0f5])){_0x20f909[_0x1dbff3[_0x55b0f5]]=null;}}_0x342bb7['push'](_0x20f909);}return _0x342bb7;}})[_0x99ab('0x24')](function(_0x4caf0d){if(!_[_0x99ab('0x6d')](_0x4caf0d)){var _0x5691bc=toCsv(_0x4caf0d);var _0x4b873e=Date[_0x99ab('0x6e')]();fs[_0x99ab('0x6f')](util[_0x99ab('0x69')](_0x99ab('0x70'),_0x1bc1c0[_0x99ab('0x44')]['id'],_0x4b873e),_0x5691bc);_0x196df3['setHeader'](_0x99ab('0x71'),_0x99ab('0x72')+util[_0x99ab('0x69')](_0x99ab('0x73'),_0x1bc1c0[_0x99ab('0x44')]['id'],_0x4b873e));_0x196df3[_0x99ab('0x74')]('Content-type',_0x99ab('0x75'));return _0x196df3[_0x99ab('0x76')](util[_0x99ab('0x69')](_0x99ab('0x70'),_0x1bc1c0[_0x99ab('0x44')]['id'],_0x4b873e));}else{return _0x196df3[_0x99ab('0x17')](0xcc);}})[_0x99ab('0x42')](handleError(_0x196df3,null));}; \ No newline at end of file +var _0x08ca=['fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','Projects','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','toString','indexOf','replace','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','model','query','keys','intersection','attributes'];(function(_0x75903a,_0x4ae82e){var _0x38b122=function(_0x4c7555){while(--_0x4c7555){_0x75903a['push'](_0x75903a['shift']());}};_0x38b122(++_0x4ae82e);}(_0x08ca,0xb2));var _0xa08c=function(_0x3e0e4a,_0x10b5e9){_0x3e0e4a=_0x3e0e4a-0x0;var _0x147f71=_0x08ca[_0x3e0e4a];return _0x147f71;};'use strict';var emlformat=require(_0xa08c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa08c('0x1'));var jsonpatch=require(_0xa08c('0x2'));var rp=require(_0xa08c('0x3'));var moment=require(_0xa08c('0x4'));var BPromise=require(_0xa08c('0x5'));var Mustache=require(_0xa08c('0x6'));var util=require(_0xa08c('0x7'));var path=require(_0xa08c('0x8'));var sox=require(_0xa08c('0x9'));var csv=require(_0xa08c('0xa'));var ejs=require(_0xa08c('0xb'));var fs=require('fs');var fs_extra=require(_0xa08c('0xc'));var _=require('lodash');var squel=require(_0xa08c('0xd'));var crypto=require(_0xa08c('0xe'));var jsforce=require(_0xa08c('0xf'));var deskjs=require(_0xa08c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa08c('0x11'));var Papa=require('papaparse');var Redis=require(_0xa08c('0x12'));var authService=require(_0xa08c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa08c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa08c('0x15'));var utils=require(_0xa08c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa08c('0x17'));var db=require(_0xa08c('0x18'))['db'];function respondWithStatusCode(_0x441998,_0x4ed55f){_0x4ed55f=_0x4ed55f||0xcc;return function(_0x1fda54){if(_0x1fda54){return _0x441998[_0xa08c('0x19')](_0x4ed55f);}return _0x441998['status'](_0x4ed55f)[_0xa08c('0x1a')]();};}function respondWithResult(_0x2e5629,_0x15186a){_0x15186a=_0x15186a||0xc8;return function(_0x306435){if(_0x306435){return _0x2e5629[_0xa08c('0x1b')](_0x15186a)[_0xa08c('0x1c')](_0x306435);}};}function respondWithFilteredResult(_0xff73e7,_0x26e44e){return function(_0x1a2d32){if(_0x1a2d32){var _0x41d1f0=typeof _0x26e44e['offset']===_0xa08c('0x1d')&&typeof _0x26e44e[_0xa08c('0x1e')]===_0xa08c('0x1d');var _0x42c5ea=_0x1a2d32[_0xa08c('0x1f')];var _0x1b2097=_0x41d1f0?0x0:_0x26e44e[_0xa08c('0x20')];var _0x3ea4f3=_0x41d1f0?_0x1a2d32[_0xa08c('0x1f')]:_0x26e44e[_0xa08c('0x20')]+_0x26e44e[_0xa08c('0x1e')];var _0x294a75;if(_0x3ea4f3>=_0x42c5ea){_0x3ea4f3=_0x42c5ea;_0x294a75=0xc8;}else{_0x294a75=0xce;}_0xff73e7['status'](_0x294a75);return _0xff73e7[_0xa08c('0x21')]('Content-Range',_0x1b2097+'-'+_0x3ea4f3+'/'+_0x42c5ea)[_0xa08c('0x1c')](_0x1a2d32);}return null;};}function patchUpdates(_0x43236b){return function(_0x153b1a){try{jsonpatch[_0xa08c('0x22')](_0x153b1a,_0x43236b,!![]);}catch(_0x5dac00){return BPromise[_0xa08c('0x23')](_0x5dac00);}return _0x153b1a[_0xa08c('0x24')]();};}function saveUpdates(_0x500bd4,_0x456d45){return function(_0x22ed38){if(_0x22ed38){return _0x22ed38[_0xa08c('0x25')](_0x500bd4)['then'](function(_0x34fa7b){return _0x34fa7b;});}return null;};}function removeEntity(_0x5473b8,_0x561b0c){return function(_0x3c46fc){if(_0x3c46fc){return _0x3c46fc[_0xa08c('0x26')]()['then'](function(){var _0x381821=_0x3c46fc[_0xa08c('0x27')]({'plain':!![]});var _0x491cb0='Projects';return db[_0xa08c('0x28')][_0xa08c('0x26')]({'where':{'type':_0x491cb0,'resourceId':_0x381821['id']}})[_0xa08c('0x29')](function(){return _0x3c46fc;});})['then'](function(){_0x5473b8[_0xa08c('0x1b')](0xcc)[_0xa08c('0x1a')]();});}};}function handleEntityNotFound(_0x22dc7c,_0x415291){return function(_0x2dbd27){if(!_0x2dbd27){_0x22dc7c[_0xa08c('0x19')](0x194);}return _0x2dbd27;};}function handleError(_0x494823,_0x5bb673){_0x5bb673=_0x5bb673||0x1f4;return function(_0x22260e){logger['error'](_0x22260e[_0xa08c('0x2a')]);if(_0x22260e[_0xa08c('0x2b')]){delete _0x22260e[_0xa08c('0x2b')];}_0x494823[_0xa08c('0x1b')](_0x5bb673)[_0xa08c('0x2c')](_0x22260e);};}exports[_0xa08c('0x2d')]=function(_0x3e8d8d,_0x9eaddd){var _0x35d3bc={},_0x56c0ca={},_0x300430={'count':0x0,'rows':[]};var _0x4ea6fb=_[_0xa08c('0x2e')](db[_0xa08c('0x2f')][_0xa08c('0x30')],function(_0x5780de){return{'name':_0x5780de['fieldName'],'type':_0x5780de[_0xa08c('0x31')][_0xa08c('0x32')]};});_0x56c0ca[_0xa08c('0x33')]=_[_0xa08c('0x2e')](_0x4ea6fb,_0xa08c('0x2b'));_0x56c0ca[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3e8d8d[_0xa08c('0x34')]);_0x56c0ca['filters']=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],_0x56c0ca['query']);_0x35d3bc[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x3e8d8d[_0xa08c('0x34')]['fields']));_0x35d3bc[_0xa08c('0x37')]=_0x35d3bc[_0xa08c('0x37')][_0xa08c('0x39')]?_0x35d3bc[_0xa08c('0x37')]:_0x56c0ca[_0xa08c('0x33')];if(!_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x35d3bc[_0xa08c('0x1e')]=qs['limit'](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x35d3bc[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x35d3bc['order']=qs[_0xa08c('0x3c')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x35d3bc['where']=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x3e8d8d[_0xa08c('0x34')],_0x56c0ca[_0xa08c('0x3d')]),_0x4ea6fb);if(_0x3e8d8d['query'][_0xa08c('0x3f')]){_0x35d3bc['where']=_[_0xa08c('0x40')](_0x35d3bc[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4ea6fb,function(_0x58a43b){if(_0x58a43b[_0xa08c('0x31')]!==_0xa08c('0x42')){var _0x12e787={};_0x12e787[_0x58a43b[_0xa08c('0x2b')]]={'$like':'%'+_0x3e8d8d['query'][_0xa08c('0x3f')]+'%'};return _0x12e787;}})});}_0x35d3bc=_[_0xa08c('0x40')]({},_0x35d3bc,_0x3e8d8d[_0xa08c('0x43')]);var _0x19cf46={'where':_0x35d3bc['where']};return db[_0xa08c('0x2f')][_0xa08c('0x1f')](_0x19cf46)[_0xa08c('0x29')](function(_0x39b313){_0x300430[_0xa08c('0x1f')]=_0x39b313;if(_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x44')]){_0x35d3bc[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyProject'][_0xa08c('0x46')](_0x35d3bc);})['then'](function(_0x250cea){_0x300430[_0xa08c('0x47')]=_0x250cea;return _0x300430;})[_0xa08c('0x29')](respondWithFilteredResult(_0x9eaddd,_0x35d3bc))[_0xa08c('0x48')](handleError(_0x9eaddd,null));};exports['show']=function(_0x3b7e00,_0x37d10b){var _0x4ca408={'raw':![],'where':{'id':_0x3b7e00['params']['id']}},_0x5111d6={};_0x5111d6[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')][_0xa08c('0x30')]);_0x5111d6[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3b7e00[_0xa08c('0x34')]);_0x5111d6['filters']=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],_0x5111d6[_0xa08c('0x34')]);_0x4ca408[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],qs['fields'](_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x38')]));_0x4ca408[_0xa08c('0x37')]=_0x4ca408[_0xa08c('0x37')][_0xa08c('0x39')]?_0x4ca408[_0xa08c('0x37')]:_0x5111d6[_0xa08c('0x33')];if(_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4ca408[_0xa08c('0x45')]=[{'all':!![]}];}_0x4ca408=_[_0xa08c('0x40')]({},_0x4ca408,_0x3b7e00[_0xa08c('0x43')]);return db['JscriptyProject'][_0xa08c('0x49')](_0x4ca408)[_0xa08c('0x29')](handleEntityNotFound(_0x37d10b,null))[_0xa08c('0x29')](respondWithResult(_0x37d10b,null))['catch'](handleError(_0x37d10b,null));};exports[_0xa08c('0x4a')]=function(_0x186fce,_0x1c8234){return db['JscriptyProject'][_0xa08c('0x4a')](_0x186fce[_0xa08c('0x4b')],{})[_0xa08c('0x29')](function(_0x160b22){var _0x225e28=_0x186fce[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x225e28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x225e28[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0x303396=_0x160b22['get']({'plain':!![]});var _0x586885='Projects';return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x586885,'userProfileId':_0x225e28[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x39f70f){if(_0x39f70f&&_0x39f70f[_0xa08c('0x50')]===0x0){return db['UserProfileResource'][_0xa08c('0x4a')]({'name':_0x303396[_0xa08c('0x2b')],'resourceId':_0x303396['id'],'type':_0x39f70f['name'],'sectionId':_0x39f70f['id']},{})['then'](function(){return _0x160b22;});}else{return _0x160b22;}})[_0xa08c('0x48')](function(_0x4544d6){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x4544d6);throw _0x4544d6;});}return _0x160b22;})[_0xa08c('0x29')](respondWithResult(_0x1c8234,0xc9))[_0xa08c('0x48')](handleError(_0x1c8234,null));};exports[_0xa08c('0x53')]=function(_0x437e35,_0x1acc1e){var _0xde5fe8={'where':{'id':_0x437e35[_0xa08c('0x54')]['id']}},_0x59a387={};_0x59a387[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')]['rawAttributes']);_0xde5fe8['attributes']=_[_0xa08c('0x36')](_0x59a387[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x437e35[_0xa08c('0x34')][_0xa08c('0x38')]));_0xde5fe8[_0xa08c('0x37')]=_0xde5fe8[_0xa08c('0x37')][_0xa08c('0x39')]?_0xde5fe8['attributes']:_0x59a387[_0xa08c('0x33')];if(_0x437e35[_0xa08c('0x34')][_0xa08c('0x44')]){_0xde5fe8[_0xa08c('0x45')]=[{'all':!![]}];}_0xde5fe8=_[_0xa08c('0x40')]({},_0xde5fe8,_0x437e35[_0xa08c('0x43')]);return db[_0xa08c('0x2f')][_0xa08c('0x49')](_0xde5fe8)[_0xa08c('0x29')](handleEntityNotFound(_0x1acc1e,null))[_0xa08c('0x29')](function(_0x1271a4){if(_0x1271a4){var _0x492ff1=_0x1271a4[_0xa08c('0x27')]({'plain':!![]});_0x492ff1=qs['omit'](_0x492ff1,['id',_0xa08c('0x55'),_0xa08c('0x56')]);_0x437e35[_0xa08c('0x4b')]=_[_0xa08c('0x57')](_0x437e35['body'],['id',_0xa08c('0x55'),'updatedAt']);return db['JscriptyProject'][_0xa08c('0x4a')](_['merge'](_0x492ff1,_0x437e35[_0xa08c('0x4b')]),{'include':_0x437e35[_0xa08c('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xa08c('0x29')](function(_0x544745){var _0x85a661=_0x437e35[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x85a661)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x85a661[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0xed8059=_0x544745[_0xa08c('0x27')]({'plain':!![]});var _0x1029f7=_0xa08c('0x58');return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x1029f7,'userProfileId':_0x85a661[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x184506){if(_0x184506&&_0x184506['autoAssociation']===0x0){return db[_0xa08c('0x28')][_0xa08c('0x4a')]({'name':_0xed8059[_0xa08c('0x2b')],'resourceId':_0xed8059['id'],'type':_0x184506[_0xa08c('0x2b')],'sectionId':_0x184506['id']},{})[_0xa08c('0x29')](function(){return _0x544745;});}else{return _0x544745;}})['catch'](function(_0x49d5ef){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x49d5ef);throw _0x49d5ef;});}return _0x544745;});}})['then'](respondWithResult(_0x1acc1e,0xc9))['catch'](handleError(_0x1acc1e,null));};exports[_0xa08c('0x25')]=function(_0x25248d,_0x2f296a){if(_0x25248d[_0xa08c('0x4b')]['id']){delete _0x25248d[_0xa08c('0x4b')]['id'];}return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x25248d[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2f296a,null))[_0xa08c('0x29')](saveUpdates(_0x25248d[_0xa08c('0x4b')],null))[_0xa08c('0x29')](respondWithResult(_0x2f296a,null))[_0xa08c('0x48')](handleError(_0x2f296a,null));};exports['destroy']=function(_0x565b71,_0x3d9715){return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x565b71[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x3d9715,null))['then'](removeEntity(_0x3d9715,null))[_0xa08c('0x48')](handleError(_0x3d9715,null));};exports[_0xa08c('0x59')]=function(_0x98a2f0,_0x1207bb,_0x102c39){var _0x4c14a0={'raw':!![],'where':{}};var _0x358104={};var _0x42d715={'count':0x0,'rows':[]};return db[_0xa08c('0x2f')][_0xa08c('0x5a')]({'where':{'id':_0x98a2f0[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x1207bb,null))['then'](function(_0x18473f){if(_0x18473f){_0x358104[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5b')][_0xa08c('0x30')]);_0x358104[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x98a2f0[_0xa08c('0x34')]);_0x358104[_0xa08c('0x3d')]=_['intersection'](_0x358104[_0xa08c('0x33')],_0x358104[_0xa08c('0x34')]);_0x4c14a0[_0xa08c('0x37')]=_['intersection'](_0x358104['model'],qs[_0xa08c('0x38')](_0x98a2f0['query'][_0xa08c('0x38')]));_0x4c14a0[_0xa08c('0x37')]=_0x4c14a0['attributes'][_0xa08c('0x39')]?_0x4c14a0[_0xa08c('0x37')]:_0x358104[_0xa08c('0x33')];if(!_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x4c14a0[_0xa08c('0x1e')]=qs[_0xa08c('0x1e')](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x4c14a0[_0xa08c('0x20')]=qs['offset'](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x4c14a0[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x98a2f0[_0xa08c('0x34')]['sort']);_0x4c14a0[_0xa08c('0x41')]=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x98a2f0[_0xa08c('0x34')],_0x358104[_0xa08c('0x3d')]));_0x4c14a0[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x18473f['id'];if(_0x98a2f0['query'][_0xa08c('0x3f')]){_0x4c14a0[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x4c14a0[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4c14a0['attributes'],function(_0x3d14d8){var _0x2e563a={};_0x2e563a[_0x3d14d8]={'$like':'%'+_0x98a2f0['query'][_0xa08c('0x3f')]+'%'};return _0x2e563a;})});}_0x4c14a0=_[_0xa08c('0x40')]({},_0x4c14a0,_0x98a2f0[_0xa08c('0x43')]);return db[_0xa08c('0x5b')][_0xa08c('0x1f')]({'where':_0x4c14a0[_0xa08c('0x41')]})['then'](function(_0x48009a){_0x42d715[_0xa08c('0x1f')]=_0x48009a;if(_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4c14a0[_0xa08c('0x45')]=[{'all':!![]}];}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x4c14a0);})[_0xa08c('0x29')](function(_0x4b6116){_0x42d715[_0xa08c('0x47')]=_0x4b6116;return _0x42d715;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x1207bb,_0x4c14a0))['catch'](handleError(_0x1207bb,null));};exports['getAnswers']=function(_0x2949de,_0x2dd1fa,_0x128ba1){var _0x1e5491={'raw':!![],'where':{}};var _0x107c27={};var _0x23ec21={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2949de[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2dd1fa,null))[_0xa08c('0x29')](function(_0x4fbffa){if(_0x4fbffa){_0x107c27[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5e')][_0xa08c('0x30')]);_0x107c27[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x2949de[_0xa08c('0x34')]);_0x107c27[_0xa08c('0x3d')]=_[_0xa08c('0x36')](_0x107c27[_0xa08c('0x33')],_0x107c27['query']);_0x1e5491[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x107c27['model'],qs[_0xa08c('0x38')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x38')]));_0x1e5491[_0xa08c('0x37')]=_0x1e5491[_0xa08c('0x37')][_0xa08c('0x39')]?_0x1e5491[_0xa08c('0x37')]:_0x107c27[_0xa08c('0x33')];if(!_0x2949de[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x1e5491['limit']=qs['limit'](_0x2949de[_0xa08c('0x34')]['limit']);_0x1e5491[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x1e5491[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x1e5491[_0xa08c('0x41')]=qs['filters'](_[_0xa08c('0x3e')](_0x2949de[_0xa08c('0x34')],_0x107c27[_0xa08c('0x3d')]));_0x1e5491[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x4fbffa['id'];if(_0x2949de[_0xa08c('0x34')][_0xa08c('0x3f')]){_0x1e5491[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x1e5491[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x1e5491[_0xa08c('0x37')],function(_0x442ce7){var _0x13ab6a={};_0x13ab6a[_0x442ce7]={'$like':'%'+_0x2949de['query']['filter']+'%'};return _0x13ab6a;})});}_0x1e5491=_['merge']({},_0x1e5491,_0x2949de[_0xa08c('0x43')]);return db[_0xa08c('0x5e')]['count']({'where':_0x1e5491['where']})['then'](function(_0x3309f0){_0x23ec21[_0xa08c('0x1f')]=_0x3309f0;if(_0x2949de[_0xa08c('0x34')]['includeAll']){_0x1e5491[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa08c('0x46')](_0x1e5491);})[_0xa08c('0x29')](function(_0x4a015f){_0x23ec21['rows']=_0x4a015f;return _0x23ec21;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x2dd1fa,_0x1e5491))[_0xa08c('0x48')](handleError(_0x2dd1fa,null));};function char(_0x252d4c){return'number'===typeof _0x252d4c?String['fromCharCode'][_0xa08c('0x22')](null,arguments):_0x252d4c;}function needsEncapsulation(_0x4a1f5c){return!!_0x4a1f5c&&(_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xd))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xa))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x4a1f5c['toString']()[_0xa08c('0x60')](char(0x22))>=0x0);}function encapsulate(_0x53c520){var _0x3b808d=char(0x22),_0x50a1da='\x5c'+char(0x22),_0x5b9ed5=_0x53c520[_0xa08c('0x5f')]()[_0xa08c('0x61')](new RegExp(_0x3b808d,'g'),_0x50a1da);return _0x3b808d+_0x5b9ed5+_0x3b808d;}exports['getSummary']=function(_0x2ef363,_0x412a10,_0x4b7038){var _0x3c1a39,_0x244f3f;var _0x44ebbb={'where':{'ProjectId':_0x2ef363[_0xa08c('0x54')]['id']}};if(_0x2ef363['query']['startTime']){_0x44ebbb[_0xa08c('0x41')]['starttime']=JSON[_0xa08c('0x62')](_0x2ef363['query'][_0xa08c('0x63')]);}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x44ebbb)[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x1374bc){if(_0x1374bc){_0x3c1a39=_0x1374bc;return db[_0xa08c('0x64')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x3c1a39,'id')},'ProjectId':_0x2ef363['params']['id']},'order':_0xa08c('0x65')});}})[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x10058a){if(_0x10058a){_0x244f3f=_0x10058a;var _0x55a278={};for(var _0x5559b6=0x0,_0x37e501=_0x244f3f[_0xa08c('0x39')];_0x5559b6<_0x37e501;_0x5559b6++){if(!_0x55a278['hasOwnProperty'](_0x244f3f[_0x5559b6][_0xa08c('0x66')])){_0x55a278[_0x244f3f[_0x5559b6][_0xa08c('0x66')]]=needsEncapsulation(_0x244f3f[_0x5559b6][_0xa08c('0x67')])?encapsulate(_0x244f3f[_0x5559b6][_0xa08c('0x67')]):_0x244f3f[_0x5559b6][_0xa08c('0x67')];}}var _0x5a208e=[],_0x479f6a={};for(var _0x23a17a=0x0,_0x5c7843=_0x3c1a39[_0xa08c('0x39')];_0x23a17a<_0x5c7843;_0x23a17a++){_0x479f6a={'ProjectId':_0x2ef363['params']['id'],'SessionId':_0x3c1a39[_0x23a17a]['id'],'StartTime':moment(_0x3c1a39[_0x23a17a][_0xa08c('0x68')])[_0xa08c('0x69')](_0xa08c('0x6a'))};for(var _0x419595=0x0,_0x2602a3=_0x244f3f[_0xa08c('0x39')];_0x419595<_0x2602a3;_0x419595++){if(_0x244f3f[_0x419595][_0xa08c('0x6b')]==_0x3c1a39[_0x23a17a]['id']&&_0x55a278[_0xa08c('0x3a')](_0x244f3f[_0x419595][_0xa08c('0x66')])){_0x479f6a[_0x55a278[_0x244f3f[_0x419595]['questionId']]]=_0x244f3f[_0x419595][_0xa08c('0x6c')];}}for(var _0x3ae665 in _0x55a278){if(!_0x479f6a[_0xa08c('0x3a')](_0x55a278[_0x3ae665])){_0x479f6a[_0x55a278[_0x3ae665]]=null;}}_0x5a208e[_0xa08c('0x6d')](_0x479f6a);}return _0x5a208e;}})['then'](function(_0x10c02b){if(!_['isEmpty'](_0x10c02b)){var _0x3d5c77=toCsv(_0x10c02b);var _0x2ae318=Date[_0xa08c('0x6e')]();fs['writeFileSync'](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318),_0x3d5c77);_0x412a10[_0xa08c('0x70')]('Content-disposition','attachment;\x20filename='+util[_0xa08c('0x69')](_0xa08c('0x71'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));_0x412a10[_0xa08c('0x70')](_0xa08c('0x72'),_0xa08c('0x73'));return _0x412a10[_0xa08c('0x74')](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));}else{return _0x412a10[_0xa08c('0x19')](0xcc);}})['catch'](handleError(_0x412a10,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 02481ba..5b735fd 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 _0x4c4e=['moment','request-promise','path','rimraf','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4c4e,0x152));var _0xe4c4=function(_0x582ce3,_0x42a739){_0x582ce3=_0x582ce3-0x0;var _0x401433=_0x4c4e[_0x582ce3];return _0x401433;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x55ca,0x126));var _0xa55c=function(_0x421e3a,_0xd69d11){_0x421e3a=_0x421e3a-0x0;var _0x3f9abd=_0x55ca[_0x421e3a];return _0x3f9abd;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('JscriptyProject',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index ae52b62..cf8f7d2 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1b07a0,_0x1d150c){var _0x4ed63e=function(_0x4d8936){while(--_0x4d8936){_0x1b07a0['push'](_0x1b07a0['shift']());}};_0x4ed63e(++_0x1d150c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4961da,_0x3a0350){_0x4961da=_0x4961da-0x0;var _0x1ed6fe=_0xb43b[_0x4961da];return _0x1ed6fe;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ee6eeb8..6dc99b0 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 _0x3fc1=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x523c78,_0x14129e){var _0x116745=function(_0x430e7b){while(--_0x430e7b){_0x523c78['push'](_0x523c78['shift']());}};_0x116745(++_0x14129e);}(_0x3fc1,0x19f));var _0x13fc=function(_0x359bec,_0x258df1){_0x359bec=_0x359bec-0x0;var _0x3a247b=_0x3fc1[_0x359bec];return _0x3a247b;};'use strict';var multer=require(_0x13fc('0x0'));var util=require(_0x13fc('0x1'));var path=require('path');var timeout=require(_0x13fc('0x2'));var express=require(_0x13fc('0x3'));var router=express['Router']();var fs_extra=require(_0x13fc('0x4'));var auth=require(_0x13fc('0x5'));var interaction=require(_0x13fc('0x6'));var config=require('../../config/environment');var controller=require(_0x13fc('0x7'));router[_0x13fc('0x8')]('/',auth[_0x13fc('0x9')](),controller[_0x13fc('0xa')]);router[_0x13fc('0x8')](_0x13fc('0xb'),auth[_0x13fc('0x9')](),controller['describe']);router[_0x13fc('0x8')](_0x13fc('0xc'),auth[_0x13fc('0x9')](),controller['show']);router[_0x13fc('0xd')]('/',auth['isAuthenticated'](),controller[_0x13fc('0xe')]);router[_0x13fc('0xf')]('/:id',auth[_0x13fc('0x9')](),controller[_0x13fc('0x10')]);router[_0x13fc('0x11')](_0x13fc('0xc'),auth[_0x13fc('0x9')](),controller[_0x13fc('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa2ae=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','post','create','update'];(function(_0x6b1406,_0x45724e){var _0x492019=function(_0x4bcf87){while(--_0x4bcf87){_0x6b1406['push'](_0x6b1406['shift']());}};_0x492019(++_0x45724e);}(_0xa2ae,0x74));var _0xea2a=function(_0x4c075b,_0x56c2e7){_0x4c075b=_0x4c075b-0x0;var _0x228448=_0xa2ae[_0x4c075b];return _0x228448;};'use strict';var multer=require(_0xea2a('0x0'));var util=require(_0xea2a('0x1'));var path=require(_0xea2a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xea2a('0x3')]();var fs_extra=require(_0xea2a('0x4'));var auth=require(_0xea2a('0x5'));var interaction=require(_0xea2a('0x6'));var config=require(_0xea2a('0x7'));var controller=require(_0xea2a('0x8'));router[_0xea2a('0x9')]('/',auth[_0xea2a('0xa')](),controller[_0xea2a('0xb')]);router[_0xea2a('0x9')]('/describe',auth[_0xea2a('0xa')](),controller[_0xea2a('0xc')]);router[_0xea2a('0x9')](_0xea2a('0xd'),auth[_0xea2a('0xa')](),controller['show']);router[_0xea2a('0xe')]('/',auth[_0xea2a('0xa')](),controller[_0xea2a('0xf')]);router['put'](_0xea2a('0xd'),auth[_0xea2a('0xa')](),controller[_0xea2a('0x10')]);router['delete'](_0xea2a('0xd'),auth[_0xea2a('0xa')](),controller[_0xea2a('0x11')]);module[_0xea2a('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ad23ab0..733542a 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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x260a46,_0x272139){_0x260a46=_0x260a46-0x0;var _0xfd68dd=_0x7a54[_0x260a46];return _0xfd68dd;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x136c54,_0x49dce1){_0x136c54=_0x136c54-0x0;var _0x1f9174=_0x7a54[_0x136c54];return _0x1f9174;};'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 6df6d37..07c2c04 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 _0x34f4=['reject','then','destroy','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','catch','show','params','includeAll','include','create','body','update','find','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x34f4,0xbc));var _0x434f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x34f4[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x434f('0x0'));var zipdir=require(_0x434f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x434f('0x2'));var BPromise=require(_0x434f('0x3'));var Mustache=require(_0x434f('0x4'));var util=require(_0x434f('0x5'));var path=require(_0x434f('0x6'));var sox=require(_0x434f('0x7'));var csv=require(_0x434f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x434f('0x9'));var _=require(_0x434f('0xa'));var squel=require(_0x434f('0xb'));var crypto=require('crypto');var jsforce=require(_0x434f('0xc'));var deskjs=require(_0x434f('0xd'));var toCsv=require(_0x434f('0x8'));var querystring=require(_0x434f('0xe'));var Papa=require('papaparse');var Redis=require(_0x434f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x434f('0x10'));var hardwareService=require(_0x434f('0x11'));var logger=require(_0x434f('0x12'))(_0x434f('0x13'));var utils=require(_0x434f('0x14'));var config=require(_0x434f('0x15'));var licenseUtil=require(_0x434f('0x16'));var db=require(_0x434f('0x17'))['db'];function respondWithStatusCode(_0x5c0874,_0xf64d6d){_0xf64d6d=_0xf64d6d||0xcc;return function(_0x102c92){if(_0x102c92){return _0x5c0874[_0x434f('0x18')](_0xf64d6d);}return _0x5c0874[_0x434f('0x19')](_0xf64d6d)[_0x434f('0x1a')]();};}function respondWithResult(_0x3b8d46,_0x22b673){_0x22b673=_0x22b673||0xc8;return function(_0x4f6f23){if(_0x4f6f23){return _0x3b8d46[_0x434f('0x19')](_0x22b673)['json'](_0x4f6f23);}};}function respondWithFilteredResult(_0x225400,_0x4e459e){return function(_0x25d24c){if(_0x25d24c){var _0x413a6d=typeof _0x4e459e[_0x434f('0x1b')]===_0x434f('0x1c')&&typeof _0x4e459e[_0x434f('0x1d')]===_0x434f('0x1c');var _0x45f9c5=_0x25d24c[_0x434f('0x1e')];var _0x26f166=_0x413a6d?0x0:_0x4e459e[_0x434f('0x1b')];var _0xaa7bd3=_0x413a6d?_0x25d24c[_0x434f('0x1e')]:_0x4e459e[_0x434f('0x1b')]+_0x4e459e['limit'];var _0x9b85e5;if(_0xaa7bd3>=_0x45f9c5){_0xaa7bd3=_0x45f9c5;_0x9b85e5=0xc8;}else{_0x9b85e5=0xce;}_0x225400[_0x434f('0x19')](_0x9b85e5);return _0x225400['set'](_0x434f('0x1f'),_0x26f166+'-'+_0xaa7bd3+'/'+_0x45f9c5)[_0x434f('0x20')](_0x25d24c);}return null;};}function patchUpdates(_0x322ab9){return function(_0x72650d){try{jsonpatch[_0x434f('0x21')](_0x72650d,_0x322ab9,!![]);}catch(_0x5e8e10){return BPromise[_0x434f('0x22')](_0x5e8e10);}return _0x72650d['save']();};}function saveUpdates(_0x4b06be,_0x4786c0){return function(_0x512e69){if(_0x512e69){return _0x512e69['update'](_0x4b06be)[_0x434f('0x23')](function(_0x4248ee){return _0x4248ee;});}return null;};}function removeEntity(_0x2b5741,_0x50cf0b){return function(_0x2fcb06){if(_0x2fcb06){return _0x2fcb06[_0x434f('0x24')]()[_0x434f('0x23')](function(){_0x2b5741[_0x434f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1230d5,_0x7032ae){return function(_0x335fa7){if(!_0x335fa7){_0x1230d5[_0x434f('0x18')](0x194);}return _0x335fa7;};}function handleError(_0x1c5a82,_0x54cd97){_0x54cd97=_0x54cd97||0x1f4;return function(_0xbc1c38){logger['error'](_0xbc1c38[_0x434f('0x25')]);if(_0xbc1c38[_0x434f('0x26')]){delete _0xbc1c38[_0x434f('0x26')];}_0x1c5a82['status'](_0x54cd97)[_0x434f('0x27')](_0xbc1c38);};}exports[_0x434f('0x28')]=function(_0x296dc0,_0x32e4fa){var _0x5e5eb5={},_0x3416e0={},_0xdfdfc4={'count':0x0,'rows':[]};var _0x487998=_[_0x434f('0x29')](db[_0x434f('0x2a')][_0x434f('0x2b')],function(_0x472bdf){return{'name':_0x472bdf[_0x434f('0x2c')],'type':_0x472bdf[_0x434f('0x2d')][_0x434f('0x2e')]};});_0x3416e0[_0x434f('0x2f')]=_[_0x434f('0x29')](_0x487998,_0x434f('0x26'));_0x3416e0[_0x434f('0x30')]=_[_0x434f('0x31')](_0x296dc0[_0x434f('0x30')]);_0x3416e0[_0x434f('0x32')]=_[_0x434f('0x33')](_0x3416e0[_0x434f('0x2f')],_0x3416e0[_0x434f('0x30')]);_0x5e5eb5[_0x434f('0x34')]=_[_0x434f('0x33')](_0x3416e0[_0x434f('0x2f')],qs[_0x434f('0x35')](_0x296dc0['query'][_0x434f('0x35')]));_0x5e5eb5[_0x434f('0x34')]=_0x5e5eb5['attributes'][_0x434f('0x36')]?_0x5e5eb5['attributes']:_0x3416e0[_0x434f('0x2f')];if(!_0x296dc0['query'][_0x434f('0x37')]('nolimit')){_0x5e5eb5['limit']=qs[_0x434f('0x1d')](_0x296dc0[_0x434f('0x30')][_0x434f('0x1d')]);_0x5e5eb5['offset']=qs[_0x434f('0x1b')](_0x296dc0[_0x434f('0x30')][_0x434f('0x1b')]);}_0x5e5eb5[_0x434f('0x38')]=qs[_0x434f('0x39')](_0x296dc0[_0x434f('0x30')]['sort']);_0x5e5eb5[_0x434f('0x3a')]=qs['filters'](_[_0x434f('0x3b')](_0x296dc0[_0x434f('0x30')],_0x3416e0[_0x434f('0x32')]),_0x487998);if(_0x296dc0[_0x434f('0x30')]['filter']){_0x5e5eb5[_0x434f('0x3a')]=_[_0x434f('0x3c')](_0x5e5eb5[_0x434f('0x3a')],{'$or':_['map'](_0x487998,function(_0x1ac6ff){if(_0x1ac6ff[_0x434f('0x2d')]!==_0x434f('0x3d')){var _0x5ec4aa={};_0x5ec4aa[_0x1ac6ff['name']]={'$like':'%'+_0x296dc0[_0x434f('0x30')][_0x434f('0x3e')]+'%'};return _0x5ec4aa;}})});}_0x5e5eb5=_['merge']({},_0x5e5eb5,_0x296dc0[_0x434f('0x3f')]);var _0x34641d={'where':_0x5e5eb5[_0x434f('0x3a')]};return db['JscriptyQuestionReport'][_0x434f('0x1e')](_0x34641d)[_0x434f('0x23')](function(_0xfa2f){_0xdfdfc4['count']=_0xfa2f;if(_0x296dc0[_0x434f('0x30')]['includeAll']){_0x5e5eb5['include']=[{'all':!![]}];}return db[_0x434f('0x2a')]['findAll'](_0x5e5eb5);})[_0x434f('0x23')](function(_0x42fb34){_0xdfdfc4['rows']=_0x42fb34;return _0xdfdfc4;})[_0x434f('0x23')](respondWithFilteredResult(_0x32e4fa,_0x5e5eb5))[_0x434f('0x40')](handleError(_0x32e4fa,null));};exports[_0x434f('0x41')]=function(_0x42ec57,_0x219e9e){var _0x22d347={'raw':!![],'where':{'id':_0x42ec57[_0x434f('0x42')]['id']}},_0x281bd3={};_0x281bd3[_0x434f('0x2f')]=_['keys'](db[_0x434f('0x2a')]['rawAttributes']);_0x281bd3[_0x434f('0x30')]=_[_0x434f('0x31')](_0x42ec57[_0x434f('0x30')]);_0x281bd3[_0x434f('0x32')]=_['intersection'](_0x281bd3[_0x434f('0x2f')],_0x281bd3[_0x434f('0x30')]);_0x22d347[_0x434f('0x34')]=_['intersection'](_0x281bd3[_0x434f('0x2f')],qs[_0x434f('0x35')](_0x42ec57['query'][_0x434f('0x35')]));_0x22d347[_0x434f('0x34')]=_0x22d347[_0x434f('0x34')]['length']?_0x22d347[_0x434f('0x34')]:_0x281bd3['model'];if(_0x42ec57['query'][_0x434f('0x43')]){_0x22d347[_0x434f('0x44')]=[{'all':!![]}];}_0x22d347=_[_0x434f('0x3c')]({},_0x22d347,_0x42ec57[_0x434f('0x3f')]);return db[_0x434f('0x2a')]['find'](_0x22d347)['then'](handleEntityNotFound(_0x219e9e,null))[_0x434f('0x23')](respondWithResult(_0x219e9e,null))[_0x434f('0x40')](handleError(_0x219e9e,null));};exports['create']=function(_0x443dec,_0x9d95fc){return db[_0x434f('0x2a')][_0x434f('0x45')](_0x443dec[_0x434f('0x46')],{})[_0x434f('0x23')](respondWithResult(_0x9d95fc,0xc9))[_0x434f('0x40')](handleError(_0x9d95fc,null));};exports[_0x434f('0x47')]=function(_0x127744,_0x3d69b6){if(_0x127744[_0x434f('0x46')]['id']){delete _0x127744[_0x434f('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x434f('0x48')]({'where':{'id':_0x127744[_0x434f('0x42')]['id']}})[_0x434f('0x23')](handleEntityNotFound(_0x3d69b6,null))[_0x434f('0x23')](saveUpdates(_0x127744[_0x434f('0x46')],null))[_0x434f('0x23')](respondWithResult(_0x3d69b6,null))[_0x434f('0x40')](handleError(_0x3d69b6,null));};exports[_0x434f('0x24')]=function(_0xfff129,_0x231054){return db[_0x434f('0x2a')][_0x434f('0x48')]({'where':{'id':_0xfff129['params']['id']}})['then'](handleEntityNotFound(_0x231054,null))[_0x434f('0x23')](removeEntity(_0x231054,null))[_0x434f('0x40')](handleError(_0x231054,null));};exports[_0x434f('0x49')]=function(_0x458818,_0xb0bd08){return db[_0x434f('0x2a')][_0x434f('0x49')]()[_0x434f('0x23')](respondWithResult(_0xb0bd08,null))[_0x434f('0x40')](handleError(_0xb0bd08,null));}; \ No newline at end of file +var _0x76e4=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','JscriptyQuestionReport','type','key','model','keys','filters','intersection','query','attributes','fields'];(function(_0x45480f,_0x387f04){var _0xb81c36=function(_0x4744ca){while(--_0x4744ca){_0x45480f['push'](_0x45480f['shift']());}};_0xb81c36(++_0x387f04);}(_0x76e4,0x1dd));var _0x476e=function(_0x36bff2,_0x3b4469){_0x36bff2=_0x36bff2-0x0;var _0xc5e74f=_0x76e4[_0x36bff2];return _0xc5e74f;};'use strict';var emlformat=require(_0x476e('0x0'));var rimraf=require(_0x476e('0x1'));var zipdir=require(_0x476e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x476e('0x3'));var moment=require(_0x476e('0x4'));var BPromise=require(_0x476e('0x5'));var Mustache=require(_0x476e('0x6'));var util=require(_0x476e('0x7'));var path=require(_0x476e('0x8'));var sox=require('sox');var csv=require(_0x476e('0x9'));var ejs=require(_0x476e('0xa'));var fs=require('fs');var fs_extra=require(_0x476e('0xb'));var _=require('lodash');var squel=require(_0x476e('0xc'));var crypto=require(_0x476e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x476e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x476e('0xf'));var Papa=require(_0x476e('0x10'));var Redis=require(_0x476e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x476e('0x12'));var as=require(_0x476e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x476e('0x14'))(_0x476e('0x15'));var utils=require(_0x476e('0x16'));var config=require(_0x476e('0x17'));var licenseUtil=require(_0x476e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501bce,_0x321656){_0x321656=_0x321656||0xcc;return function(_0x419aeb){if(_0x419aeb){return _0x501bce['sendStatus'](_0x321656);}return _0x501bce[_0x476e('0x19')](_0x321656)[_0x476e('0x1a')]();};}function respondWithResult(_0xe17fe7,_0x230064){_0x230064=_0x230064||0xc8;return function(_0x45d02b){if(_0x45d02b){return _0xe17fe7[_0x476e('0x19')](_0x230064)[_0x476e('0x1b')](_0x45d02b);}};}function respondWithFilteredResult(_0x5e0958,_0x3b6ed8){return function(_0x2f998d){if(_0x2f998d){var _0x4284a=typeof _0x3b6ed8[_0x476e('0x1c')]===_0x476e('0x1d')&&typeof _0x3b6ed8[_0x476e('0x1e')]===_0x476e('0x1d');var _0x5eaf57=_0x2f998d[_0x476e('0x1f')];var _0x29e9b2=_0x4284a?0x0:_0x3b6ed8[_0x476e('0x1c')];var _0x50ab10=_0x4284a?_0x2f998d[_0x476e('0x1f')]:_0x3b6ed8['offset']+_0x3b6ed8[_0x476e('0x1e')];var _0x449dd7;if(_0x50ab10>=_0x5eaf57){_0x50ab10=_0x5eaf57;_0x449dd7=0xc8;}else{_0x449dd7=0xce;}_0x5e0958[_0x476e('0x19')](_0x449dd7);return _0x5e0958['set'](_0x476e('0x20'),_0x29e9b2+'-'+_0x50ab10+'/'+_0x5eaf57)[_0x476e('0x1b')](_0x2f998d);}return null;};}function patchUpdates(_0x34d281){return function(_0x1240f0){try{jsonpatch[_0x476e('0x21')](_0x1240f0,_0x34d281,!![]);}catch(_0x270c82){return BPromise[_0x476e('0x22')](_0x270c82);}return _0x1240f0[_0x476e('0x23')]();};}function saveUpdates(_0x3ca452,_0x1dc913){return function(_0x3dfc6e){if(_0x3dfc6e){return _0x3dfc6e[_0x476e('0x24')](_0x3ca452)[_0x476e('0x25')](function(_0x37ec2d){return _0x37ec2d;});}return null;};}function removeEntity(_0x50d475,_0x1e5fd0){return function(_0x3472f9){if(_0x3472f9){return _0x3472f9[_0x476e('0x26')]()[_0x476e('0x25')](function(){_0x50d475['status'](0xcc)[_0x476e('0x1a')]();});}};}function handleEntityNotFound(_0x2d7d40,_0x5eb5f0){return function(_0x4628de){if(!_0x4628de){_0x2d7d40[_0x476e('0x27')](0x194);}return _0x4628de;};}function handleError(_0x1fede1,_0x447e5e){_0x447e5e=_0x447e5e||0x1f4;return function(_0x3789ff){logger[_0x476e('0x28')](_0x3789ff[_0x476e('0x29')]);if(_0x3789ff[_0x476e('0x2a')]){delete _0x3789ff[_0x476e('0x2a')];}_0x1fede1['status'](_0x447e5e)['send'](_0x3789ff);};}exports[_0x476e('0x2b')]=function(_0x3e8694,_0x4c05f6){var _0x3bf9ef={},_0x570e34={},_0x5cc7c8={'count':0x0,'rows':[]};var _0xb7ed71=_[_0x476e('0x2c')](db[_0x476e('0x2d')]['rawAttributes'],function(_0x4593a7){return{'name':_0x4593a7['fieldName'],'type':_0x4593a7[_0x476e('0x2e')][_0x476e('0x2f')]};});_0x570e34[_0x476e('0x30')]=_['map'](_0xb7ed71,'name');_0x570e34['query']=_[_0x476e('0x31')](_0x3e8694['query']);_0x570e34[_0x476e('0x32')]=_[_0x476e('0x33')](_0x570e34[_0x476e('0x30')],_0x570e34[_0x476e('0x34')]);_0x3bf9ef[_0x476e('0x35')]=_['intersection'](_0x570e34[_0x476e('0x30')],qs[_0x476e('0x36')](_0x3e8694[_0x476e('0x34')][_0x476e('0x36')]));_0x3bf9ef['attributes']=_0x3bf9ef[_0x476e('0x35')][_0x476e('0x37')]?_0x3bf9ef[_0x476e('0x35')]:_0x570e34[_0x476e('0x30')];if(!_0x3e8694[_0x476e('0x34')][_0x476e('0x38')](_0x476e('0x39'))){_0x3bf9ef[_0x476e('0x1e')]=qs['limit'](_0x3e8694[_0x476e('0x34')]['limit']);_0x3bf9ef[_0x476e('0x1c')]=qs[_0x476e('0x1c')](_0x3e8694[_0x476e('0x34')][_0x476e('0x1c')]);}_0x3bf9ef[_0x476e('0x3a')]=qs[_0x476e('0x3b')](_0x3e8694[_0x476e('0x34')]['sort']);_0x3bf9ef[_0x476e('0x3c')]=qs[_0x476e('0x32')](_['pick'](_0x3e8694['query'],_0x570e34['filters']),_0xb7ed71);if(_0x3e8694[_0x476e('0x34')]['filter']){_0x3bf9ef['where']=_['merge'](_0x3bf9ef[_0x476e('0x3c')],{'$or':_[_0x476e('0x2c')](_0xb7ed71,function(_0x2aa6c7){if(_0x2aa6c7[_0x476e('0x2e')]!=='VIRTUAL'){var _0x17561d={};_0x17561d[_0x2aa6c7[_0x476e('0x2a')]]={'$like':'%'+_0x3e8694['query'][_0x476e('0x3d')]+'%'};return _0x17561d;}})});}_0x3bf9ef=_[_0x476e('0x3e')]({},_0x3bf9ef,_0x3e8694[_0x476e('0x3f')]);var _0xb72d4b={'where':_0x3bf9ef[_0x476e('0x3c')]};return db[_0x476e('0x2d')][_0x476e('0x1f')](_0xb72d4b)['then'](function(_0x2b49af){_0x5cc7c8[_0x476e('0x1f')]=_0x2b49af;if(_0x3e8694[_0x476e('0x34')]['includeAll']){_0x3bf9ef[_0x476e('0x40')]=[{'all':!![]}];}return db[_0x476e('0x2d')][_0x476e('0x41')](_0x3bf9ef);})[_0x476e('0x25')](function(_0x286acf){_0x5cc7c8[_0x476e('0x42')]=_0x286acf;return _0x5cc7c8;})[_0x476e('0x25')](respondWithFilteredResult(_0x4c05f6,_0x3bf9ef))[_0x476e('0x43')](handleError(_0x4c05f6,null));};exports[_0x476e('0x44')]=function(_0x1f91cd,_0x1b1bec){var _0x45e68d={'raw':!![],'where':{'id':_0x1f91cd[_0x476e('0x45')]['id']}},_0x4309f8={};_0x4309f8[_0x476e('0x30')]=_[_0x476e('0x31')](db[_0x476e('0x2d')][_0x476e('0x46')]);_0x4309f8[_0x476e('0x34')]=_[_0x476e('0x31')](_0x1f91cd['query']);_0x4309f8[_0x476e('0x32')]=_[_0x476e('0x33')](_0x4309f8['model'],_0x4309f8[_0x476e('0x34')]);_0x45e68d[_0x476e('0x35')]=_[_0x476e('0x33')](_0x4309f8[_0x476e('0x30')],qs['fields'](_0x1f91cd[_0x476e('0x34')][_0x476e('0x36')]));_0x45e68d[_0x476e('0x35')]=_0x45e68d[_0x476e('0x35')][_0x476e('0x37')]?_0x45e68d['attributes']:_0x4309f8['model'];if(_0x1f91cd[_0x476e('0x34')][_0x476e('0x47')]){_0x45e68d[_0x476e('0x40')]=[{'all':!![]}];}_0x45e68d=_['merge']({},_0x45e68d,_0x1f91cd[_0x476e('0x3f')]);return db[_0x476e('0x2d')][_0x476e('0x48')](_0x45e68d)[_0x476e('0x25')](handleEntityNotFound(_0x1b1bec,null))[_0x476e('0x25')](respondWithResult(_0x1b1bec,null))[_0x476e('0x43')](handleError(_0x1b1bec,null));};exports[_0x476e('0x49')]=function(_0x48566e,_0x31b224){return db[_0x476e('0x2d')][_0x476e('0x49')](_0x48566e[_0x476e('0x4a')],{})['then'](respondWithResult(_0x31b224,0xc9))[_0x476e('0x43')](handleError(_0x31b224,null));};exports[_0x476e('0x24')]=function(_0x39c907,_0x34bd6c){if(_0x39c907[_0x476e('0x4a')]['id']){delete _0x39c907[_0x476e('0x4a')]['id'];}return db[_0x476e('0x2d')][_0x476e('0x48')]({'where':{'id':_0x39c907[_0x476e('0x45')]['id']}})[_0x476e('0x25')](handleEntityNotFound(_0x34bd6c,null))[_0x476e('0x25')](saveUpdates(_0x39c907[_0x476e('0x4a')],null))[_0x476e('0x25')](respondWithResult(_0x34bd6c,null))[_0x476e('0x43')](handleError(_0x34bd6c,null));};exports[_0x476e('0x26')]=function(_0x137443,_0x887d0){return db[_0x476e('0x2d')]['find']({'where':{'id':_0x137443['params']['id']}})[_0x476e('0x25')](handleEntityNotFound(_0x887d0,null))[_0x476e('0x25')](removeEntity(_0x887d0,null))[_0x476e('0x43')](handleError(_0x887d0,null));};exports[_0x476e('0x4b')]=function(_0xc44fe3,_0x191a80){return db[_0x476e('0x2d')]['describe']()[_0x476e('0x25')](respondWithResult(_0x191a80,null))[_0x476e('0x43')](handleError(_0x191a80,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index b784982..971c20f 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 _0xe6fb=['api','moment','bluebird','path','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x2a18dc,_0x4ce218){var _0x726534=function(_0x40d88e){while(--_0x40d88e){_0x2a18dc['push'](_0x2a18dc['shift']());}};_0x726534(++_0x4ce218);}(_0xe6fb,0x11d));var _0xbe6f=function(_0x27f204,_0x2214fa){_0x27f204=_0x27f204-0x0;var _0x2f409c=_0xe6fb[_0x27f204];return _0x2f409c;};'use strict';var _=require(_0xbe6f('0x0'));var util=require(_0xbe6f('0x1'));var logger=require(_0xbe6f('0x2'))(_0xbe6f('0x3'));var moment=require(_0xbe6f('0x4'));var BPromise=require(_0xbe6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe6f('0x6'));var rimraf=require('rimraf');var config=require(_0xbe6f('0x7'));var attributes=require(_0xbe6f('0x8'));module['exports']=function(_0xa67095,_0x1ea909){return _0xa67095[_0xbe6f('0x9')](_0xbe6f('0xa'),attributes,{'tableName':_0xbe6f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe81c=['util','../../config/logger','bluebird','path','rimraf','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe81c,0x1ee));var _0xce81=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0xe81c[_0xff5df6];return _0x2634bb;};'use strict';var _=require(_0xce81('0x0'));var util=require(_0xce81('0x1'));var logger=require(_0xce81('0x2'))('api');var moment=require('moment');var BPromise=require(_0xce81('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce81('0x4'));var rimraf=require(_0xce81('0x5'));var config=require('../../config/environment');var attributes=require(_0xce81('0x6'));module['exports']=function(_0x4bc632,_0x3e41be){return _0x4bc632[_0xce81('0x7')](_0xce81('0x8'),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 218843a..16fa0b5 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 _0xb312=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xb312,0x1c1));var _0x2b31=function(_0x2a8ef3,_0xabf7c6){_0x2a8ef3=_0x2a8ef3-0x0;var _0x18e2e7=_0xb312[_0x2a8ef3];return _0x18e2e7;};'use strict';var _=require(_0x2b31('0x0'));var util=require(_0x2b31('0x1'));var moment=require(_0x2b31('0x2'));var BPromise=require(_0x2b31('0x3'));var rs=require(_0x2b31('0x4'));var fs=require('fs');var Redis=require(_0x2b31('0x5'));var db=require(_0x2b31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b31('0x7'))(_0x2b31('0x8'));var config=require(_0x2b31('0x9'));var jayson=require(_0x2b31('0xa'));var client=jayson[_0x2b31('0xb')][_0x2b31('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x426a20,_0x472def,_0x3914e6){return new BPromise(function(_0x49f234,_0xdb0adf){return client[_0x2b31('0xd')](_0x426a20,_0x3914e6)[_0x2b31('0xe')](function(_0x354b64){logger[_0x2b31('0xf')](_0x2b31('0x10'),_0x472def,_0x2b31('0x11'));logger[_0x2b31('0x12')](_0x2b31('0x13'),_0x472def,_0x2b31('0x11'),JSON[_0x2b31('0x14')](_0x354b64));if(_0x354b64[_0x2b31('0x15')]){if(_0x354b64['error'][_0x2b31('0x16')]===0x1f4){logger[_0x2b31('0x15')](_0x2b31('0x10'),_0x472def,_0x354b64[_0x2b31('0x15')][_0x2b31('0x17')]);return _0xdb0adf(_0x354b64[_0x2b31('0x15')][_0x2b31('0x17')]);}logger['error'](_0x2b31('0x10'),_0x472def,_0x354b64[_0x2b31('0x15')]['message']);return _0x49f234(_0x354b64[_0x2b31('0x15')][_0x2b31('0x17')]);}else{logger[_0x2b31('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x472def,'request\x20sent');_0x49f234(_0x354b64[_0x2b31('0x18')][_0x2b31('0x17')]);}})[_0x2b31('0x19')](function(_0x246c44){logger[_0x2b31('0x15')](_0x2b31('0x10'),_0x472def,_0x246c44);_0xdb0adf(_0x246c44);});});} \ No newline at end of file +var _0xf9dc=['error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x44e5f6,_0x1cdb43){var _0x350e0e=function(_0x329ed1){while(--_0x329ed1){_0x44e5f6['push'](_0x44e5f6['shift']());}};_0x350e0e(++_0x1cdb43);}(_0xf9dc,0x67));var _0xcf9d=function(_0x4dbf11,_0x36a91f){_0x4dbf11=_0x4dbf11-0x0;var _0x571bf9=_0xf9dc[_0x4dbf11];return _0x571bf9;};'use strict';var _=require(_0xcf9d('0x0'));var util=require('util');var moment=require(_0xcf9d('0x1'));var BPromise=require(_0xcf9d('0x2'));var rs=require(_0xcf9d('0x3'));var fs=require('fs');var Redis=require(_0xcf9d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf9d('0x5'));var logger=require(_0xcf9d('0x6'))(_0xcf9d('0x7'));var config=require(_0xcf9d('0x8'));var jayson=require(_0xcf9d('0x9'));var client=jayson[_0xcf9d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x112a7a,_0x29d9bd,_0x5c7cc5){return new BPromise(function(_0xa236d8,_0x2d98a9){return client[_0xcf9d('0xb')](_0x112a7a,_0x5c7cc5)[_0xcf9d('0xc')](function(_0xe2d5f8){logger[_0xcf9d('0xd')](_0xcf9d('0xe'),_0x29d9bd,_0xcf9d('0xf'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x29d9bd,_0xcf9d('0xf'),JSON[_0xcf9d('0x10')](_0xe2d5f8));if(_0xe2d5f8[_0xcf9d('0x11')]){if(_0xe2d5f8[_0xcf9d('0x11')][_0xcf9d('0x12')]===0x1f4){logger[_0xcf9d('0x11')](_0xcf9d('0xe'),_0x29d9bd,_0xe2d5f8[_0xcf9d('0x11')]['message']);return _0x2d98a9(_0xe2d5f8[_0xcf9d('0x11')][_0xcf9d('0x13')]);}logger[_0xcf9d('0x11')](_0xcf9d('0xe'),_0x29d9bd,_0xe2d5f8[_0xcf9d('0x11')][_0xcf9d('0x13')]);return _0xa236d8(_0xe2d5f8['error']['message']);}else{logger[_0xcf9d('0xd')](_0xcf9d('0xe'),_0x29d9bd,_0xcf9d('0xf'));_0xa236d8(_0xe2d5f8['result'][_0xcf9d('0x13')]);}})['catch'](function(_0x529ad4){logger[_0xcf9d('0x11')](_0xcf9d('0xe'),_0x29d9bd,_0x529ad4);_0x2d98a9(_0x529ad4);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9056478..b27d039 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 _0x6011=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x179b73,_0x5807e8){var _0x2d9e53=function(_0x37a646){while(--_0x37a646){_0x179b73['push'](_0x179b73['shift']());}};_0x2d9e53(++_0x5807e8);}(_0x6011,0x1cc));var _0x1601=function(_0x32a0ff,_0x2183c4){_0x32a0ff=_0x32a0ff-0x0;var _0x5c0837=_0x6011[_0x32a0ff];return _0x5c0837;};'use strict';var multer=require(_0x1601('0x0'));var util=require(_0x1601('0x1'));var path=require('path');var timeout=require(_0x1601('0x2'));var express=require(_0x1601('0x3'));var router=express['Router']();var fs_extra=require(_0x1601('0x4'));var auth=require(_0x1601('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1601('0x6'));var controller=require(_0x1601('0x7'));router[_0x1601('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1601('0x9'),auth[_0x1601('0xa')](),controller[_0x1601('0xb')]);router['get'](_0x1601('0xc'),auth[_0x1601('0xa')](),controller[_0x1601('0xd')]);router[_0x1601('0x8')](_0x1601('0xe'),auth[_0x1601('0xa')](),controller['getQuestions']);router[_0x1601('0xf')]('/',auth[_0x1601('0xa')](),controller[_0x1601('0x10')]);router[_0x1601('0x11')]('/:id',auth[_0x1601('0xa')](),controller['update']);router[_0x1601('0x12')]('/:id',auth[_0x1601('0xa')](),controller[_0x1601('0x13')]);module[_0x1601('0x14')]=router; \ No newline at end of file +var _0xd275=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','/:id/questions','getQuestions','post','put'];(function(_0x3f2621,_0x569366){var _0x43018c=function(_0x441a01){while(--_0x441a01){_0x3f2621['push'](_0x3f2621['shift']());}};_0x43018c(++_0x569366);}(_0xd275,0x66));var _0x5d27=function(_0x976a8,_0x3035e8){_0x976a8=_0x976a8-0x0;var _0x17bef2=_0xd275[_0x976a8];return _0x17bef2;};'use strict';var multer=require(_0x5d27('0x0'));var util=require(_0x5d27('0x1'));var path=require('path');var timeout=require(_0x5d27('0x2'));var express=require(_0x5d27('0x3'));var router=express[_0x5d27('0x4')]();var fs_extra=require(_0x5d27('0x5'));var auth=require(_0x5d27('0x6'));var interaction=require(_0x5d27('0x7'));var config=require(_0x5d27('0x8'));var controller=require(_0x5d27('0x9'));router[_0x5d27('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5d27('0xa')]('/describe',auth[_0x5d27('0xb')](),controller[_0x5d27('0xc')]);router[_0x5d27('0xa')](_0x5d27('0xd'),auth[_0x5d27('0xb')](),controller['show']);router[_0x5d27('0xa')](_0x5d27('0xe'),auth[_0x5d27('0xb')](),controller[_0x5d27('0xf')]);router[_0x5d27('0x10')]('/',auth[_0x5d27('0xb')](),controller['create']);router[_0x5d27('0x11')](_0x5d27('0xd'),auth[_0x5d27('0xb')](),controller['update']);router[_0x5d27('0x12')](_0x5d27('0xd'),auth[_0x5d27('0xb')](),controller['destroy']);module[_0x5d27('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index abe29c0..61c79ef 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 _0x5eff=['STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x12654,_0x262f7f){var _0x3f1543=function(_0xa0fe1b){while(--_0xa0fe1b){_0x12654['push'](_0x12654['shift']());}};_0x3f1543(++_0x262f7f);}(_0x5eff,0xa7));var _0xf5ef=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x5eff[_0x565ed7];return _0x183ad7;};'use strict';var moment=require(_0xf5ef('0x0'));var Sequelize=require(_0xf5ef('0x1'));module[_0xf5ef('0x2')]={'starttime':{'type':Sequelize[_0xf5ef('0x3')],'set':function(_0x17ef34){this[_0xf5ef('0x4')](_0xf5ef('0x5'),_0x17ef34);this[_0xf5ef('0x4')](_0xf5ef('0x6'),moment()[_0xf5ef('0x7')](_0xf5ef('0x8')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xf5ef('0x9')]},'projectname':{'type':Sequelize[_0xf5ef('0x9')]},'queue':{'type':Sequelize[_0xf5ef('0x9')]},'uniqueid':{'type':Sequelize[_0xf5ef('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf5ef('0x9')]},'completed':{'type':Sequelize[_0xf5ef('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0xc4f6=['starttime','endtime','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue'];(function(_0x5ef1ae,_0x10c6a8){var _0x312033=function(_0x4d72a0){while(--_0x4d72a0){_0x5ef1ae['push'](_0x5ef1ae['shift']());}};_0x312033(++_0x10c6a8);}(_0xc4f6,0x64));var _0x6c4f=function(_0xeed2dc,_0x7597c1){_0xeed2dc=_0xeed2dc-0x0;var _0x114bdc=_0xc4f6[_0xeed2dc];return _0x114bdc;};'use strict';var moment=require(_0x6c4f('0x0'));var Sequelize=require(_0x6c4f('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x6c4f('0x2')],'set':function(_0x46612a){this[_0x6c4f('0x3')](_0x6c4f('0x4'),_0x46612a);this[_0x6c4f('0x3')](_0x6c4f('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x6c4f('0x2')]},'membername':{'type':Sequelize[_0x6c4f('0x6')]},'projectname':{'type':Sequelize[_0x6c4f('0x6')]},'queue':{'type':Sequelize[_0x6c4f('0x6')]},'uniqueid':{'type':Sequelize[_0x6c4f('0x6')]},'calleridname':{'type':Sequelize[_0x6c4f('0x6')]},'calleridnum':{'type':Sequelize[_0x6c4f('0x6')]},'completed':{'type':Sequelize[_0x6c4f('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 722cf0c..2ae7546 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 _0xbcd2=['attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','JscriptySessionReport','count','includeAll','include','findAll','rows','show','rawAttributes','keys','find','catch','create','body','params','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','squel','crypto','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','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','model','query','filters','intersection','fields'];(function(_0x116345,_0x3fb003){var _0x1fa48d=function(_0x1fdf43){while(--_0x1fdf43){_0x116345['push'](_0x116345['shift']());}};_0x1fa48d(++_0x3fb003);}(_0xbcd2,0xbc));var _0x2bcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcd2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2bcd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2bcd('0x1'));var jsonpatch=require(_0x2bcd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2bcd('0x3'));var Mustache=require(_0x2bcd('0x4'));var util=require('util');var path=require(_0x2bcd('0x5'));var sox=require(_0x2bcd('0x6'));var csv=require(_0x2bcd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2bcd('0x8'));var crypto=require(_0x2bcd('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2bcd('0xa'));var toCsv=require(_0x2bcd('0x7'));var querystring=require(_0x2bcd('0xb'));var Papa=require(_0x2bcd('0xc'));var Redis=require(_0x2bcd('0xd'));var authService=require(_0x2bcd('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2bcd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bcd('0x10'))(_0x2bcd('0x11'));var utils=require(_0x2bcd('0x12'));var config=require(_0x2bcd('0x13'));var licenseUtil=require(_0x2bcd('0x14'));var db=require(_0x2bcd('0x15'))['db'];function respondWithStatusCode(_0x17bbbd,_0x34a8f6){_0x34a8f6=_0x34a8f6||0xcc;return function(_0xead254){if(_0xead254){return _0x17bbbd[_0x2bcd('0x16')](_0x34a8f6);}return _0x17bbbd[_0x2bcd('0x17')](_0x34a8f6)[_0x2bcd('0x18')]();};}function respondWithResult(_0x2ceeb4,_0x4428b3){_0x4428b3=_0x4428b3||0xc8;return function(_0x6e5bb2){if(_0x6e5bb2){return _0x2ceeb4[_0x2bcd('0x17')](_0x4428b3)['json'](_0x6e5bb2);}};}function respondWithFilteredResult(_0xcde5a4,_0x17d3f0){return function(_0x14c924){if(_0x14c924){var _0x3e2bdf=typeof _0x17d3f0[_0x2bcd('0x19')]===_0x2bcd('0x1a')&&typeof _0x17d3f0['limit']==='undefined';var _0x27df86=_0x14c924['count'];var _0x21231d=_0x3e2bdf?0x0:_0x17d3f0[_0x2bcd('0x19')];var _0x1cd84e=_0x3e2bdf?_0x14c924['count']:_0x17d3f0['offset']+_0x17d3f0[_0x2bcd('0x1b')];var _0x4de447;if(_0x1cd84e>=_0x27df86){_0x1cd84e=_0x27df86;_0x4de447=0xc8;}else{_0x4de447=0xce;}_0xcde5a4[_0x2bcd('0x17')](_0x4de447);return _0xcde5a4[_0x2bcd('0x1c')](_0x2bcd('0x1d'),_0x21231d+'-'+_0x1cd84e+'/'+_0x27df86)[_0x2bcd('0x1e')](_0x14c924);}return null;};}function patchUpdates(_0x1ffeee){return function(_0x4f3d1a){try{jsonpatch[_0x2bcd('0x1f')](_0x4f3d1a,_0x1ffeee,!![]);}catch(_0x33e539){return BPromise[_0x2bcd('0x20')](_0x33e539);}return _0x4f3d1a[_0x2bcd('0x21')]();};}function saveUpdates(_0xa5de56,_0x2d191f){return function(_0x307224){if(_0x307224){return _0x307224[_0x2bcd('0x22')](_0xa5de56)[_0x2bcd('0x23')](function(_0x84ee3a){return _0x84ee3a;});}return null;};}function removeEntity(_0xa9560e,_0x53026e){return function(_0x4f8710){if(_0x4f8710){return _0x4f8710[_0x2bcd('0x24')]()['then'](function(){_0xa9560e[_0x2bcd('0x17')](0xcc)[_0x2bcd('0x18')]();});}};}function handleEntityNotFound(_0x148cea,_0x47ff93){return function(_0x5e462c){if(!_0x5e462c){_0x148cea[_0x2bcd('0x16')](0x194);}return _0x5e462c;};}function handleError(_0x46512a,_0x56918c){_0x56918c=_0x56918c||0x1f4;return function(_0x1cfee1){logger[_0x2bcd('0x25')](_0x1cfee1[_0x2bcd('0x26')]);if(_0x1cfee1[_0x2bcd('0x27')]){delete _0x1cfee1[_0x2bcd('0x27')];}_0x46512a['status'](_0x56918c)[_0x2bcd('0x28')](_0x1cfee1);};}exports[_0x2bcd('0x29')]=function(_0xeea4e2,_0xe08d88){var _0x35766d={},_0x5de31f={},_0xbb113b={'count':0x0,'rows':[]};var _0x97409f=_[_0x2bcd('0x2a')](db['JscriptySessionReport']['rawAttributes'],function(_0x1d28a0){return{'name':_0x1d28a0['fieldName'],'type':_0x1d28a0[_0x2bcd('0x2b')]['key']};});_0x5de31f[_0x2bcd('0x2c')]=_[_0x2bcd('0x2a')](_0x97409f,_0x2bcd('0x27'));_0x5de31f[_0x2bcd('0x2d')]=_['keys'](_0xeea4e2[_0x2bcd('0x2d')]);_0x5de31f[_0x2bcd('0x2e')]=_[_0x2bcd('0x2f')](_0x5de31f['model'],_0x5de31f[_0x2bcd('0x2d')]);_0x35766d['attributes']=_[_0x2bcd('0x2f')](_0x5de31f[_0x2bcd('0x2c')],qs[_0x2bcd('0x30')](_0xeea4e2['query'][_0x2bcd('0x30')]));_0x35766d[_0x2bcd('0x31')]=_0x35766d[_0x2bcd('0x31')][_0x2bcd('0x32')]?_0x35766d[_0x2bcd('0x31')]:_0x5de31f[_0x2bcd('0x2c')];if(!_0xeea4e2['query'][_0x2bcd('0x33')](_0x2bcd('0x34'))){_0x35766d['limit']=qs[_0x2bcd('0x1b')](_0xeea4e2[_0x2bcd('0x2d')][_0x2bcd('0x1b')]);_0x35766d[_0x2bcd('0x19')]=qs['offset'](_0xeea4e2[_0x2bcd('0x2d')][_0x2bcd('0x19')]);}_0x35766d['order']=qs[_0x2bcd('0x35')](_0xeea4e2[_0x2bcd('0x2d')]['sort']);_0x35766d[_0x2bcd('0x36')]=qs[_0x2bcd('0x2e')](_[_0x2bcd('0x37')](_0xeea4e2['query'],_0x5de31f['filters']),_0x97409f);if(_0xeea4e2[_0x2bcd('0x2d')]['filter']){_0x35766d['where']=_[_0x2bcd('0x38')](_0x35766d[_0x2bcd('0x36')],{'$or':_[_0x2bcd('0x2a')](_0x97409f,function(_0x34525c){if(_0x34525c[_0x2bcd('0x2b')]!==_0x2bcd('0x39')){var _0x5ec8e7={};_0x5ec8e7[_0x34525c['name']]={'$like':'%'+_0xeea4e2[_0x2bcd('0x2d')][_0x2bcd('0x3a')]+'%'};return _0x5ec8e7;}})});}_0x35766d=_[_0x2bcd('0x38')]({},_0x35766d,_0xeea4e2[_0x2bcd('0x3b')]);var _0x1eac87={'where':_0x35766d[_0x2bcd('0x36')]};return db[_0x2bcd('0x3c')][_0x2bcd('0x3d')](_0x1eac87)[_0x2bcd('0x23')](function(_0x6420fa){_0xbb113b[_0x2bcd('0x3d')]=_0x6420fa;if(_0xeea4e2[_0x2bcd('0x2d')][_0x2bcd('0x3e')]){_0x35766d[_0x2bcd('0x3f')]=[{'all':!![]}];}return db[_0x2bcd('0x3c')][_0x2bcd('0x40')](_0x35766d);})['then'](function(_0x39b9fa){_0xbb113b[_0x2bcd('0x41')]=_0x39b9fa;return _0xbb113b;})[_0x2bcd('0x23')](respondWithFilteredResult(_0xe08d88,_0x35766d))['catch'](handleError(_0xe08d88,null));};exports[_0x2bcd('0x42')]=function(_0x171741,_0x353729){var _0x3ebca4={'raw':!![],'where':{'id':_0x171741['params']['id']}},_0xfb040d={};_0xfb040d[_0x2bcd('0x2c')]=_['keys'](db[_0x2bcd('0x3c')][_0x2bcd('0x43')]);_0xfb040d[_0x2bcd('0x2d')]=_[_0x2bcd('0x44')](_0x171741['query']);_0xfb040d['filters']=_[_0x2bcd('0x2f')](_0xfb040d[_0x2bcd('0x2c')],_0xfb040d[_0x2bcd('0x2d')]);_0x3ebca4['attributes']=_[_0x2bcd('0x2f')](_0xfb040d[_0x2bcd('0x2c')],qs['fields'](_0x171741[_0x2bcd('0x2d')][_0x2bcd('0x30')]));_0x3ebca4['attributes']=_0x3ebca4[_0x2bcd('0x31')][_0x2bcd('0x32')]?_0x3ebca4['attributes']:_0xfb040d[_0x2bcd('0x2c')];if(_0x171741['query'][_0x2bcd('0x3e')]){_0x3ebca4['include']=[{'all':!![]}];}_0x3ebca4=_[_0x2bcd('0x38')]({},_0x3ebca4,_0x171741['options']);return db[_0x2bcd('0x3c')][_0x2bcd('0x45')](_0x3ebca4)[_0x2bcd('0x23')](handleEntityNotFound(_0x353729,null))['then'](respondWithResult(_0x353729,null))[_0x2bcd('0x46')](handleError(_0x353729,null));};exports['create']=function(_0x2e1171,_0x38efd6){return db[_0x2bcd('0x3c')][_0x2bcd('0x47')](_0x2e1171[_0x2bcd('0x48')],{})[_0x2bcd('0x23')](respondWithResult(_0x38efd6,0xc9))[_0x2bcd('0x46')](handleError(_0x38efd6,null));};exports[_0x2bcd('0x22')]=function(_0x6a1b4,_0x3e7cdb){if(_0x6a1b4[_0x2bcd('0x48')]['id']){delete _0x6a1b4[_0x2bcd('0x48')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x6a1b4[_0x2bcd('0x49')]['id']}})[_0x2bcd('0x23')](handleEntityNotFound(_0x3e7cdb,null))[_0x2bcd('0x23')](saveUpdates(_0x6a1b4['body'],null))[_0x2bcd('0x23')](respondWithResult(_0x3e7cdb,null))[_0x2bcd('0x46')](handleError(_0x3e7cdb,null));};exports[_0x2bcd('0x24')]=function(_0x33c9ee,_0x5733cc){return db['JscriptySessionReport'][_0x2bcd('0x45')]({'where':{'id':_0x33c9ee[_0x2bcd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5733cc,null))[_0x2bcd('0x23')](removeEntity(_0x5733cc,null))['catch'](handleError(_0x5733cc,null));};exports['describe']=function(_0x1e3e70,_0x32ab5a){return db[_0x2bcd('0x3c')]['describe']()[_0x2bcd('0x23')](respondWithResult(_0x32ab5a,null))[_0x2bcd('0x46')](handleError(_0x32ab5a,null));};exports[_0x2bcd('0x4a')]=function(_0x3dc436,_0x9ec38d,_0xb79832){var _0x2f5dcd={'raw':!![],'where':{}};var _0x145ccf={};var _0x45636b={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x2bcd('0x4b')]({'where':{'id':_0x3dc436[_0x2bcd('0x49')]['id']}})[_0x2bcd('0x23')](handleEntityNotFound(_0x9ec38d,null))['then'](function(_0x3cf318){if(_0x3cf318){_0x145ccf[_0x2bcd('0x2c')]=_[_0x2bcd('0x44')](db['JscriptyQuestionReport'][_0x2bcd('0x43')]);_0x145ccf[_0x2bcd('0x2d')]=_[_0x2bcd('0x44')](_0x3dc436[_0x2bcd('0x2d')]);_0x145ccf[_0x2bcd('0x2e')]=_[_0x2bcd('0x2f')](_0x145ccf[_0x2bcd('0x2c')],_0x145ccf['query']);_0x2f5dcd[_0x2bcd('0x31')]=_[_0x2bcd('0x2f')](_0x145ccf[_0x2bcd('0x2c')],qs['fields'](_0x3dc436['query']['fields']));_0x2f5dcd[_0x2bcd('0x31')]=_0x2f5dcd[_0x2bcd('0x31')][_0x2bcd('0x32')]?_0x2f5dcd['attributes']:_0x145ccf[_0x2bcd('0x2c')];if(!_0x3dc436[_0x2bcd('0x2d')][_0x2bcd('0x33')]('nolimit')){_0x2f5dcd[_0x2bcd('0x1b')]=qs['limit'](_0x3dc436['query']['limit']);_0x2f5dcd['offset']=qs[_0x2bcd('0x19')](_0x3dc436[_0x2bcd('0x2d')][_0x2bcd('0x19')]);}_0x2f5dcd[_0x2bcd('0x4c')]=qs['sort'](_0x3dc436['query'][_0x2bcd('0x35')]);_0x2f5dcd[_0x2bcd('0x36')]=qs[_0x2bcd('0x2e')](_[_0x2bcd('0x37')](_0x3dc436[_0x2bcd('0x2d')],_0x145ccf[_0x2bcd('0x2e')]));_0x2f5dcd[_0x2bcd('0x36')][_0x2bcd('0x4d')]=_0x3cf318['id'];if(_0x3dc436['query'][_0x2bcd('0x3a')]){_0x2f5dcd[_0x2bcd('0x36')]=_[_0x2bcd('0x38')](_0x2f5dcd[_0x2bcd('0x36')],{'$or':_[_0x2bcd('0x2a')](_0x2f5dcd[_0x2bcd('0x31')],function(_0x479552){var _0xc0f1ea={};_0xc0f1ea[_0x479552]={'$like':'%'+_0x3dc436['query'][_0x2bcd('0x3a')]+'%'};return _0xc0f1ea;})});}_0x2f5dcd=_[_0x2bcd('0x38')]({},_0x2f5dcd,_0x3dc436['options']);return db[_0x2bcd('0x4e')][_0x2bcd('0x3d')]({'where':_0x2f5dcd[_0x2bcd('0x36')]})[_0x2bcd('0x23')](function(_0x1ec2a1){_0x45636b['count']=_0x1ec2a1;if(_0x3dc436[_0x2bcd('0x2d')][_0x2bcd('0x3e')]){_0x2f5dcd['include']=[{'all':!![]}];}return db[_0x2bcd('0x4e')][_0x2bcd('0x40')](_0x2f5dcd);})[_0x2bcd('0x23')](function(_0x309628){_0x45636b[_0x2bcd('0x41')]=_0x309628;return _0x45636b;});}})[_0x2bcd('0x23')](respondWithFilteredResult(_0x9ec38d,_0x2f5dcd))[_0x2bcd('0x46')](handleError(_0x9ec38d,null));}; \ No newline at end of file +var _0x47a9=['update','then','destroy','error','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','getQuestions','JscriptyQuestionReport','keys','hasOwnProperty','SessionId','options','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','reject','save'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x47a9,0x7a));var _0x947a=function(_0x505d16,_0x2533d0){_0x505d16=_0x505d16-0x0;var _0x72f929=_0x47a9[_0x505d16];return _0x72f929;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x947a('0x0'));var zipdir=require(_0x947a('0x1'));var jsonpatch=require(_0x947a('0x2'));var rp=require('request-promise');var moment=require(_0x947a('0x3'));var BPromise=require(_0x947a('0x4'));var Mustache=require(_0x947a('0x5'));var util=require(_0x947a('0x6'));var path=require(_0x947a('0x7'));var sox=require('sox');var csv=require(_0x947a('0x8'));var ejs=require(_0x947a('0x9'));var fs=require('fs');var fs_extra=require(_0x947a('0xa'));var _=require(_0x947a('0xb'));var squel=require(_0x947a('0xc'));var crypto=require(_0x947a('0xd'));var jsforce=require(_0x947a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x947a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x947a('0xf'));var authService=require(_0x947a('0x10'));var qs=require(_0x947a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x947a('0x12'));var logger=require(_0x947a('0x13'))(_0x947a('0x14'));var utils=require('../../config/utils');var config=require(_0x947a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x947a('0x16'))['db'];function respondWithStatusCode(_0x5a4703,_0x801e07){_0x801e07=_0x801e07||0xcc;return function(_0x4fa4e1){if(_0x4fa4e1){return _0x5a4703[_0x947a('0x17')](_0x801e07);}return _0x5a4703[_0x947a('0x18')](_0x801e07)[_0x947a('0x19')]();};}function respondWithResult(_0x1f6f19,_0x2be4cf){_0x2be4cf=_0x2be4cf||0xc8;return function(_0x26e5cf){if(_0x26e5cf){return _0x1f6f19[_0x947a('0x18')](_0x2be4cf)['json'](_0x26e5cf);}};}function respondWithFilteredResult(_0x37865b,_0x47be1d){return function(_0x2d3742){if(_0x2d3742){var _0x5444cd=typeof _0x47be1d['offset']===_0x947a('0x1a')&&typeof _0x47be1d['limit']===_0x947a('0x1a');var _0x414a1c=_0x2d3742[_0x947a('0x1b')];var _0xf3ce6b=_0x5444cd?0x0:_0x47be1d[_0x947a('0x1c')];var _0x5a5080=_0x5444cd?_0x2d3742[_0x947a('0x1b')]:_0x47be1d[_0x947a('0x1c')]+_0x47be1d[_0x947a('0x1d')];var _0x40ebda;if(_0x5a5080>=_0x414a1c){_0x5a5080=_0x414a1c;_0x40ebda=0xc8;}else{_0x40ebda=0xce;}_0x37865b[_0x947a('0x18')](_0x40ebda);return _0x37865b['set'](_0x947a('0x1e'),_0xf3ce6b+'-'+_0x5a5080+'/'+_0x414a1c)['json'](_0x2d3742);}return null;};}function patchUpdates(_0x47aa45){return function(_0xb73239){try{jsonpatch[_0x947a('0x1f')](_0xb73239,_0x47aa45,!![]);}catch(_0x40f051){return BPromise[_0x947a('0x20')](_0x40f051);}return _0xb73239[_0x947a('0x21')]();};}function saveUpdates(_0x4d880d,_0x196c84){return function(_0x4a0c08){if(_0x4a0c08){return _0x4a0c08[_0x947a('0x22')](_0x4d880d)[_0x947a('0x23')](function(_0x4341b3){return _0x4341b3;});}return null;};}function removeEntity(_0x7bf7a5,_0x3348e2){return function(_0xaffbda){if(_0xaffbda){return _0xaffbda[_0x947a('0x24')]()[_0x947a('0x23')](function(){_0x7bf7a5[_0x947a('0x18')](0xcc)[_0x947a('0x19')]();});}};}function handleEntityNotFound(_0x5402b0,_0x3b41f8){return function(_0x5cb993){if(!_0x5cb993){_0x5402b0['sendStatus'](0x194);}return _0x5cb993;};}function handleError(_0x5ea8f8,_0x13051f){_0x13051f=_0x13051f||0x1f4;return function(_0x565867){logger[_0x947a('0x25')](_0x565867['stack']);if(_0x565867[_0x947a('0x26')]){delete _0x565867[_0x947a('0x26')];}_0x5ea8f8[_0x947a('0x18')](_0x13051f)['send'](_0x565867);};}exports[_0x947a('0x27')]=function(_0x36accb,_0x58a168){var _0x42b861={},_0x9eb17f={},_0x7dad95={'count':0x0,'rows':[]};var _0x3e3fdd=_[_0x947a('0x28')](db[_0x947a('0x29')][_0x947a('0x2a')],function(_0x1f5e98){return{'name':_0x1f5e98[_0x947a('0x2b')],'type':_0x1f5e98[_0x947a('0x2c')][_0x947a('0x2d')]};});_0x9eb17f[_0x947a('0x2e')]=_[_0x947a('0x28')](_0x3e3fdd,_0x947a('0x26'));_0x9eb17f[_0x947a('0x2f')]=_['keys'](_0x36accb[_0x947a('0x2f')]);_0x9eb17f['filters']=_[_0x947a('0x30')](_0x9eb17f[_0x947a('0x2e')],_0x9eb17f['query']);_0x42b861[_0x947a('0x31')]=_[_0x947a('0x30')](_0x9eb17f[_0x947a('0x2e')],qs[_0x947a('0x32')](_0x36accb[_0x947a('0x2f')]['fields']));_0x42b861[_0x947a('0x31')]=_0x42b861[_0x947a('0x31')][_0x947a('0x33')]?_0x42b861['attributes']:_0x9eb17f[_0x947a('0x2e')];if(!_0x36accb['query']['hasOwnProperty'](_0x947a('0x34'))){_0x42b861[_0x947a('0x1d')]=qs['limit'](_0x36accb[_0x947a('0x2f')][_0x947a('0x1d')]);_0x42b861[_0x947a('0x1c')]=qs[_0x947a('0x1c')](_0x36accb[_0x947a('0x2f')][_0x947a('0x1c')]);}_0x42b861[_0x947a('0x35')]=qs['sort'](_0x36accb[_0x947a('0x2f')][_0x947a('0x36')]);_0x42b861['where']=qs['filters'](_[_0x947a('0x37')](_0x36accb[_0x947a('0x2f')],_0x9eb17f[_0x947a('0x38')]),_0x3e3fdd);if(_0x36accb[_0x947a('0x2f')][_0x947a('0x39')]){_0x42b861[_0x947a('0x3a')]=_[_0x947a('0x3b')](_0x42b861[_0x947a('0x3a')],{'$or':_[_0x947a('0x28')](_0x3e3fdd,function(_0x4dff58){if(_0x4dff58['type']!==_0x947a('0x3c')){var _0x1ffeef={};_0x1ffeef[_0x4dff58[_0x947a('0x26')]]={'$like':'%'+_0x36accb[_0x947a('0x2f')]['filter']+'%'};return _0x1ffeef;}})});}_0x42b861=_['merge']({},_0x42b861,_0x36accb['options']);var _0x49026b={'where':_0x42b861[_0x947a('0x3a')]};return db[_0x947a('0x29')]['count'](_0x49026b)[_0x947a('0x23')](function(_0x391fcd){_0x7dad95[_0x947a('0x1b')]=_0x391fcd;if(_0x36accb[_0x947a('0x2f')][_0x947a('0x3d')]){_0x42b861[_0x947a('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x947a('0x3f')](_0x42b861);})[_0x947a('0x23')](function(_0x457a55){_0x7dad95[_0x947a('0x40')]=_0x457a55;return _0x7dad95;})[_0x947a('0x23')](respondWithFilteredResult(_0x58a168,_0x42b861))['catch'](handleError(_0x58a168,null));};exports[_0x947a('0x41')]=function(_0x4507be,_0x92f246){var _0x960726={'raw':!![],'where':{'id':_0x4507be['params']['id']}},_0x569073={};_0x569073[_0x947a('0x2e')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x569073[_0x947a('0x2f')]=_['keys'](_0x4507be[_0x947a('0x2f')]);_0x569073[_0x947a('0x38')]=_[_0x947a('0x30')](_0x569073['model'],_0x569073[_0x947a('0x2f')]);_0x960726[_0x947a('0x31')]=_[_0x947a('0x30')](_0x569073[_0x947a('0x2e')],qs[_0x947a('0x32')](_0x4507be[_0x947a('0x2f')][_0x947a('0x32')]));_0x960726[_0x947a('0x31')]=_0x960726[_0x947a('0x31')]['length']?_0x960726[_0x947a('0x31')]:_0x569073[_0x947a('0x2e')];if(_0x4507be[_0x947a('0x2f')][_0x947a('0x3d')]){_0x960726[_0x947a('0x3e')]=[{'all':!![]}];}_0x960726=_[_0x947a('0x3b')]({},_0x960726,_0x4507be['options']);return db[_0x947a('0x29')][_0x947a('0x42')](_0x960726)[_0x947a('0x23')](handleEntityNotFound(_0x92f246,null))[_0x947a('0x23')](respondWithResult(_0x92f246,null))[_0x947a('0x43')](handleError(_0x92f246,null));};exports[_0x947a('0x44')]=function(_0x12dc44,_0x116081){return db[_0x947a('0x29')][_0x947a('0x44')](_0x12dc44[_0x947a('0x45')],{})[_0x947a('0x23')](respondWithResult(_0x116081,0xc9))[_0x947a('0x43')](handleError(_0x116081,null));};exports['update']=function(_0x1b80b0,_0x235dc6){if(_0x1b80b0[_0x947a('0x45')]['id']){delete _0x1b80b0['body']['id'];}return db['JscriptySessionReport'][_0x947a('0x42')]({'where':{'id':_0x1b80b0[_0x947a('0x46')]['id']}})[_0x947a('0x23')](handleEntityNotFound(_0x235dc6,null))[_0x947a('0x23')](saveUpdates(_0x1b80b0[_0x947a('0x45')],null))[_0x947a('0x23')](respondWithResult(_0x235dc6,null))['catch'](handleError(_0x235dc6,null));};exports[_0x947a('0x24')]=function(_0x5a38b3,_0x553680){return db[_0x947a('0x29')][_0x947a('0x42')]({'where':{'id':_0x5a38b3[_0x947a('0x46')]['id']}})[_0x947a('0x23')](handleEntityNotFound(_0x553680,null))[_0x947a('0x23')](removeEntity(_0x553680,null))[_0x947a('0x43')](handleError(_0x553680,null));};exports[_0x947a('0x47')]=function(_0x259e53,_0x3e9cd6){return db[_0x947a('0x29')][_0x947a('0x47')]()['then'](respondWithResult(_0x3e9cd6,null))[_0x947a('0x43')](handleError(_0x3e9cd6,null));};exports[_0x947a('0x48')]=function(_0x298053,_0x3d5d3b,_0xfc7882){var _0x27d6ed={'raw':!![],'where':{}};var _0x1e2b99={};var _0x57cd4c={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x298053[_0x947a('0x46')]['id']}})[_0x947a('0x23')](handleEntityNotFound(_0x3d5d3b,null))[_0x947a('0x23')](function(_0x16b277){if(_0x16b277){_0x1e2b99[_0x947a('0x2e')]=_['keys'](db[_0x947a('0x49')][_0x947a('0x2a')]);_0x1e2b99[_0x947a('0x2f')]=_[_0x947a('0x4a')](_0x298053[_0x947a('0x2f')]);_0x1e2b99[_0x947a('0x38')]=_[_0x947a('0x30')](_0x1e2b99[_0x947a('0x2e')],_0x1e2b99['query']);_0x27d6ed['attributes']=_['intersection'](_0x1e2b99[_0x947a('0x2e')],qs[_0x947a('0x32')](_0x298053[_0x947a('0x2f')][_0x947a('0x32')]));_0x27d6ed['attributes']=_0x27d6ed[_0x947a('0x31')]['length']?_0x27d6ed[_0x947a('0x31')]:_0x1e2b99[_0x947a('0x2e')];if(!_0x298053[_0x947a('0x2f')][_0x947a('0x4b')](_0x947a('0x34'))){_0x27d6ed[_0x947a('0x1d')]=qs[_0x947a('0x1d')](_0x298053[_0x947a('0x2f')][_0x947a('0x1d')]);_0x27d6ed['offset']=qs[_0x947a('0x1c')](_0x298053[_0x947a('0x2f')]['offset']);}_0x27d6ed[_0x947a('0x35')]=qs['sort'](_0x298053[_0x947a('0x2f')][_0x947a('0x36')]);_0x27d6ed[_0x947a('0x3a')]=qs[_0x947a('0x38')](_[_0x947a('0x37')](_0x298053[_0x947a('0x2f')],_0x1e2b99[_0x947a('0x38')]));_0x27d6ed[_0x947a('0x3a')][_0x947a('0x4c')]=_0x16b277['id'];if(_0x298053[_0x947a('0x2f')][_0x947a('0x39')]){_0x27d6ed[_0x947a('0x3a')]=_[_0x947a('0x3b')](_0x27d6ed[_0x947a('0x3a')],{'$or':_[_0x947a('0x28')](_0x27d6ed[_0x947a('0x31')],function(_0x1debbb){var _0x101405={};_0x101405[_0x1debbb]={'$like':'%'+_0x298053[_0x947a('0x2f')][_0x947a('0x39')]+'%'};return _0x101405;})});}_0x27d6ed=_['merge']({},_0x27d6ed,_0x298053[_0x947a('0x4d')]);return db[_0x947a('0x49')][_0x947a('0x1b')]({'where':_0x27d6ed[_0x947a('0x3a')]})[_0x947a('0x23')](function(_0x1da922){_0x57cd4c[_0x947a('0x1b')]=_0x1da922;if(_0x298053[_0x947a('0x2f')][_0x947a('0x3d')]){_0x27d6ed[_0x947a('0x3e')]=[{'all':!![]}];}return db[_0x947a('0x49')][_0x947a('0x3f')](_0x27d6ed);})[_0x947a('0x23')](function(_0x44dc93){_0x57cd4c[_0x947a('0x40')]=_0x44dc93;return _0x57cd4c;});}})[_0x947a('0x23')](respondWithFilteredResult(_0x3d5d3b,_0x27d6ed))['catch'](handleError(_0x3d5d3b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 5be1cbd..e62480f 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 _0x687b=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x536c66,_0x570b6b){var _0x221d57=function(_0x34af51){while(--_0x34af51){_0x536c66['push'](_0x536c66['shift']());}};_0x221d57(++_0x570b6b);}(_0x687b,0x14a));var _0xb687=function(_0x3a49ed,_0x5942c0){_0x3a49ed=_0x3a49ed-0x0;var _0xfc681=_0x687b[_0x3a49ed];return _0xfc681;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa3f=['rimraf','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x430817,_0x3b9c40){var _0x50b655=function(_0x26146f){while(--_0x26146f){_0x430817['push'](_0x430817['shift']());}};_0x50b655(++_0x3b9c40);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x441e30,_0x420dd5){_0x441e30=_0x441e30-0x0;var _0x31e650=_0xaa3f[_0x441e30];return _0x31e650;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require(_0xfaa3('0x5'));var rp=require(_0xfaa3('0x6'));var fs=require('fs');var path=require(_0xfaa3('0x7'));var rimraf=require(_0xfaa3('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'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 5cb3352..9a9858b 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 _0x9582=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x38ee11,_0x2dce24){var _0xc329b8=function(_0x1ce02d){while(--_0x1ce02d){_0x38ee11['push'](_0x38ee11['shift']());}};_0xc329b8(++_0x2dce24);}(_0x9582,0x95));var _0x2958=function(_0x258b8f,_0x5d035e){_0x258b8f=_0x258b8f-0x0;var _0x4b30e2=_0x9582[_0x258b8f];return _0x4b30e2;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});} \ No newline at end of file +var _0xb016=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1c72a0,_0x3e6dff){var _0x4d4a77=function(_0x200022){while(--_0x200022){_0x1c72a0['push'](_0x1c72a0['shift']());}};_0x4d4a77(++_0x3e6dff);}(_0xb016,0x159));var _0x6b01=function(_0x4d79b4,_0x22e76e){_0x4d79b4=_0x4d79b4-0x0;var _0xbf93e7=_0xb016[_0x4d79b4];return _0xbf93e7;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index c08c6fd..ac149bc 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 _0xd57f=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','path'];(function(_0x2f6b38,_0x3f519c){var _0x1ca601=function(_0x1cb945){while(--_0x1cb945){_0x2f6b38['push'](_0x2f6b38['shift']());}};_0x1ca601(++_0x3f519c);}(_0xd57f,0x139));var _0xfd57=function(_0x95bf3b,_0xea5f44){_0x95bf3b=_0x95bf3b-0x0;var _0x211b12=_0xd57f[_0x95bf3b];return _0x211b12;};'use strict';var multer=require(_0xfd57('0x0'));var util=require('util');var path=require(_0xfd57('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd57('0x2'));var router=express[_0xfd57('0x3')]();var fs_extra=require(_0xfd57('0x4'));var auth=require(_0xfd57('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfd57('0x6'));var controller=require(_0xfd57('0x7'));router[_0xfd57('0x8')]('/',controller[_0xfd57('0x9')]);router['put']('/:id',auth[_0xfd57('0xa')](),controller[_0xfd57('0xb')]);router['get'](_0xfd57('0xc'),auth[_0xfd57('0xa')](),controller[_0xfd57('0xd')]);module[_0xfd57('0xe')]=router; \ No newline at end of file +var _0x3ec3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','path','connect-timeout'];(function(_0x50500a,_0x33030a){var _0x47f177=function(_0x21634a){while(--_0x21634a){_0x50500a['push'](_0x50500a['shift']());}};_0x47f177(++_0x33030a);}(_0x3ec3,0x136));var _0x33ec=function(_0x4a98d1,_0x2bef6d){_0x4a98d1=_0x4a98d1-0x0;var _0x279f64=_0x3ec3[_0x4a98d1];return _0x279f64;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x33ec('0x0'));var timeout=require(_0x33ec('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x33ec('0x2'));var interaction=require(_0x33ec('0x3'));var config=require(_0x33ec('0x4'));var controller=require(_0x33ec('0x5'));router[_0x33ec('0x6')]('/',controller[_0x33ec('0x7')]);router['put'](_0x33ec('0x8'),auth['isAuthenticated'](),controller[_0x33ec('0x9')]);router['get'](_0x33ec('0xa'),auth[_0x33ec('0xb')](),controller[_0x33ec('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b985aa1..6e1516e 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 _0x2a53=['INTEGER','sequelize','TEXT'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2a53,0x196));var _0x32a5=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0x2a53[_0x575b72];return _0x561c57;};'use strict';var Sequelize=require(_0x32a5('0x0'));module['exports']={'license':{'type':Sequelize[_0x32a5('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x32a5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb4b7=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x5e831d,_0x4b1003){var _0x17eca9=function(_0x2e55e6){while(--_0x2e55e6){_0x5e831d['push'](_0x5e831d['shift']());}};_0x17eca9(++_0x4b1003);}(_0xb4b7,0x1c2));var _0x7b4b=function(_0x5f08b9,_0xb953ed){_0x5f08b9=_0x5f08b9-0x0;var _0x147aae=_0xb4b7[_0x5f08b9];return _0x147aae;};'use strict';var Sequelize=require(_0x7b4b('0x0'));module[_0x7b4b('0x1')]={'license':{'type':Sequelize[_0x7b4b('0x2')]},'data1':{'type':Sequelize[_0x7b4b('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x7b4b('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 689a7dc..7580d54 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 _0x1e30=['../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','send','index','model','License','query','keys','filters','intersection','attributes','fields','merge','options','catch','params','checkLicense','body','key','demo','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x194d20,_0x31893d){var _0x13f715=function(_0x193f5e){while(--_0x193f5e){_0x194d20['push'](_0x194d20['shift']());}};_0x13f715(++_0x31893d);}(_0x1e30,0x197));var _0x01e3=function(_0x5debab,_0x2abef8){_0x5debab=_0x5debab-0x0;var _0x20333e=_0x1e30[_0x5debab];return _0x20333e;};'use strict';var emlformat=require(_0x01e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01e3('0x1'));var jsonpatch=require(_0x01e3('0x2'));var rp=require(_0x01e3('0x3'));var moment=require('moment');var BPromise=require(_0x01e3('0x4'));var Mustache=require(_0x01e3('0x5'));var util=require(_0x01e3('0x6'));var path=require(_0x01e3('0x7'));var sox=require(_0x01e3('0x8'));var csv=require(_0x01e3('0x9'));var ejs=require(_0x01e3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01e3('0xb'));var squel=require(_0x01e3('0xc'));var crypto=require(_0x01e3('0xd'));var jsforce=require(_0x01e3('0xe'));var deskjs=require(_0x01e3('0xf'));var toCsv=require(_0x01e3('0x9'));var querystring=require('querystring');var Papa=require(_0x01e3('0x10'));var Redis=require(_0x01e3('0x11'));var authService=require(_0x01e3('0x12'));var qs=require(_0x01e3('0x13'));var as=require(_0x01e3('0x14'));var hardwareService=require(_0x01e3('0x15'));var logger=require(_0x01e3('0x16'))(_0x01e3('0x17'));var utils=require(_0x01e3('0x18'));var config=require(_0x01e3('0x19'));var licenseUtil=require(_0x01e3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a418b,_0x3e3a52){_0x3e3a52=_0x3e3a52||0xcc;return function(_0x378573){if(_0x378573){return _0x5a418b[_0x01e3('0x1b')](_0x3e3a52);}return _0x5a418b['status'](_0x3e3a52)[_0x01e3('0x1c')]();};}function respondWithResult(_0x26a6d,_0x34ccd4){_0x34ccd4=_0x34ccd4||0xc8;return function(_0x3e3cc){if(_0x3e3cc){return _0x26a6d['status'](_0x34ccd4)[_0x01e3('0x1d')](_0x3e3cc);}};}function respondWithFilteredResult(_0x2a5c41,_0x3b400e){return function(_0x243656){if(_0x243656){var _0x3a6e16=typeof _0x3b400e[_0x01e3('0x1e')]===_0x01e3('0x1f')&&typeof _0x3b400e[_0x01e3('0x20')]===_0x01e3('0x1f');var _0x11768b=_0x243656[_0x01e3('0x21')];var _0x156614=_0x3a6e16?0x0:_0x3b400e['offset'];var _0x2e5421=_0x3a6e16?_0x243656[_0x01e3('0x21')]:_0x3b400e[_0x01e3('0x1e')]+_0x3b400e['limit'];var _0x479178;if(_0x2e5421>=_0x11768b){_0x2e5421=_0x11768b;_0x479178=0xc8;}else{_0x479178=0xce;}_0x2a5c41[_0x01e3('0x22')](_0x479178);return _0x2a5c41[_0x01e3('0x23')](_0x01e3('0x24'),_0x156614+'-'+_0x2e5421+'/'+_0x11768b)[_0x01e3('0x1d')](_0x243656);}return null;};}function patchUpdates(_0x594b83){return function(_0x47ebec){try{jsonpatch[_0x01e3('0x25')](_0x47ebec,_0x594b83,!![]);}catch(_0x41d267){return BPromise[_0x01e3('0x26')](_0x41d267);}return _0x47ebec[_0x01e3('0x27')]();};}function saveUpdates(_0x898d62,_0x4e177c){return function(_0x4508fb){if(_0x4508fb){return _0x4508fb[_0x01e3('0x28')](_0x898d62)[_0x01e3('0x29')](function(_0xbd5104){return _0xbd5104;});}return null;};}function removeEntity(_0xd51812,_0x425dd0){return function(_0x5d66a6){if(_0x5d66a6){return _0x5d66a6['destroy']()['then'](function(){_0xd51812[_0x01e3('0x22')](0xcc)[_0x01e3('0x1c')]();});}};}function handleEntityNotFound(_0x327fad,_0x42ec30){return function(_0x33b7bd){if(!_0x33b7bd){_0x327fad[_0x01e3('0x1b')](0x194);}return _0x33b7bd;};}function handleError(_0x3008ed,_0x2b2ec0){_0x2b2ec0=_0x2b2ec0||0x1f4;return function(_0x4d972d){logger[_0x01e3('0x2a')](_0x4d972d['stack']);if(_0x4d972d['name']){delete _0x4d972d['name'];}_0x3008ed[_0x01e3('0x22')](_0x2b2ec0)[_0x01e3('0x2b')](_0x4d972d);};}var utilLicense=require(_0x01e3('0x1a'));exports[_0x01e3('0x2c')]=function(_0x2d0e61,_0x305f40){var _0x31127d={'raw':!![],'where':{'id':0x1}},_0x4f2e6b={};_0x4f2e6b[_0x01e3('0x2d')]=_['keys'](db[_0x01e3('0x2e')]['rawAttributes']);_0x4f2e6b[_0x01e3('0x2f')]=_[_0x01e3('0x30')](_0x2d0e61[_0x01e3('0x2f')]);_0x4f2e6b[_0x01e3('0x31')]=_[_0x01e3('0x32')](_0x4f2e6b['model'],_0x4f2e6b[_0x01e3('0x2f')]);_0x31127d[_0x01e3('0x33')]=_[_0x01e3('0x32')](_0x4f2e6b[_0x01e3('0x2d')],qs['fields'](_0x2d0e61[_0x01e3('0x2f')][_0x01e3('0x34')]));_0x31127d['attributes']=_0x31127d['attributes']['length']?_0x31127d[_0x01e3('0x33')]:_0x4f2e6b['model'];_0x31127d=_[_0x01e3('0x35')]({},_0x31127d,_0x2d0e61[_0x01e3('0x36')]);return utilLicense['getLicense'](_0x31127d)[_0x01e3('0x29')](respondWithResult(_0x305f40,null))[_0x01e3('0x37')](handleError(_0x305f40,null));};exports[_0x01e3('0x28')]=function(_0x37b2e3,_0x33b458){if(_0x37b2e3['body']['id']){delete _0x37b2e3['body']['id'];}return db[_0x01e3('0x2e')]['find']({'where':{'id':_0x37b2e3[_0x01e3('0x38')]['id']}})[_0x01e3('0x29')](handleEntityNotFound(_0x33b458,null))[_0x01e3('0x29')](function(_0x1ba2d0){var _0x5a1232=_0x1ba2d0['get']({'plain':!![]});return utilLicense[_0x01e3('0x39')](_0x5a1232,_0x37b2e3[_0x01e3('0x3a')][_0x01e3('0x3b')]);})['then'](function(_0x3d5cdf){if(!_0x3d5cdf[_0x01e3('0x3c')]){return saveUpdates(_0x37b2e3['body'],null);}return _0x3d5cdf;})[_0x01e3('0x29')](respondWithResult(_0x33b458,null))[_0x01e3('0x37')](handleError(_0x33b458,null));};exports[_0x01e3('0x3d')]=function(_0x37239e,_0x12d818){var _0x52f8b7='license-info.log';var _0x4cbace=path[_0x01e3('0x3e')](_0x01e3('0x3f'),_0x01e3('0x40'),_0x01e3('0x41'),_0x52f8b7);_0x12d818[_0x01e3('0x42')](_0x01e3('0x43'),_0x01e3('0x44')+_0x52f8b7);_0x12d818[_0x01e3('0x23')](_0x01e3('0x45'),_0x01e3('0x46'));_0x12d818[_0x01e3('0x47')](_0x4cbace);}; \ No newline at end of file +var _0xc3c2=['attachment;\x20filename=','text/plain','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../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','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','getLicense','catch','body','find','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition'];(function(_0x3672ad,_0x338096){var _0x10ac1d=function(_0xaf97b1){while(--_0xaf97b1){_0x3672ad['push'](_0x3672ad['shift']());}};_0x10ac1d(++_0x338096);}(_0xc3c2,0x11a));var _0x2c3c=function(_0x480285,_0x2072ad){_0x480285=_0x480285-0x0;var _0x44c235=_0xc3c2[_0x480285];return _0x44c235;};'use strict';var emlformat=require(_0x2c3c('0x0'));var rimraf=require(_0x2c3c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c3c('0x2'));var rp=require(_0x2c3c('0x3'));var moment=require(_0x2c3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2c3c('0x5'));var util=require(_0x2c3c('0x6'));var path=require(_0x2c3c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2c3c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c3c('0x9'));var squel=require('squel');var crypto=require(_0x2c3c('0xa'));var jsforce=require(_0x2c3c('0xb'));var deskjs=require(_0x2c3c('0xc'));var toCsv=require(_0x2c3c('0xd'));var querystring=require(_0x2c3c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2c3c('0xf'));var qs=require(_0x2c3c('0x10'));var as=require(_0x2c3c('0x11'));var hardwareService=require(_0x2c3c('0x12'));var logger=require(_0x2c3c('0x13'))(_0x2c3c('0x14'));var utils=require(_0x2c3c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2c3c('0x16'));var db=require(_0x2c3c('0x17'))['db'];function respondWithStatusCode(_0x3ec78c,_0x33119c){_0x33119c=_0x33119c||0xcc;return function(_0x25db8d){if(_0x25db8d){return _0x3ec78c[_0x2c3c('0x18')](_0x33119c);}return _0x3ec78c[_0x2c3c('0x19')](_0x33119c)['end']();};}function respondWithResult(_0x2aec38,_0x2fc14c){_0x2fc14c=_0x2fc14c||0xc8;return function(_0x2d5821){if(_0x2d5821){return _0x2aec38['status'](_0x2fc14c)[_0x2c3c('0x1a')](_0x2d5821);}};}function respondWithFilteredResult(_0x4fe566,_0x36037c){return function(_0x3f9fe5){if(_0x3f9fe5){var _0x5af530=typeof _0x36037c[_0x2c3c('0x1b')]===_0x2c3c('0x1c')&&typeof _0x36037c[_0x2c3c('0x1d')]===_0x2c3c('0x1c');var _0x3519b8=_0x3f9fe5[_0x2c3c('0x1e')];var _0x29be1a=_0x5af530?0x0:_0x36037c['offset'];var _0x271a39=_0x5af530?_0x3f9fe5[_0x2c3c('0x1e')]:_0x36037c[_0x2c3c('0x1b')]+_0x36037c[_0x2c3c('0x1d')];var _0x3e5deb;if(_0x271a39>=_0x3519b8){_0x271a39=_0x3519b8;_0x3e5deb=0xc8;}else{_0x3e5deb=0xce;}_0x4fe566[_0x2c3c('0x19')](_0x3e5deb);return _0x4fe566['set'](_0x2c3c('0x1f'),_0x29be1a+'-'+_0x271a39+'/'+_0x3519b8)[_0x2c3c('0x1a')](_0x3f9fe5);}return null;};}function patchUpdates(_0x453858){return function(_0x902e36){try{jsonpatch[_0x2c3c('0x20')](_0x902e36,_0x453858,!![]);}catch(_0x39fee2){return BPromise[_0x2c3c('0x21')](_0x39fee2);}return _0x902e36[_0x2c3c('0x22')]();};}function saveUpdates(_0x52cc70,_0xae3414){return function(_0x44b210){if(_0x44b210){return _0x44b210[_0x2c3c('0x23')](_0x52cc70)['then'](function(_0x1fd192){return _0x1fd192;});}return null;};}function removeEntity(_0x267324,_0x5263c6){return function(_0x2ce79a){if(_0x2ce79a){return _0x2ce79a[_0x2c3c('0x24')]()[_0x2c3c('0x25')](function(){_0x267324['status'](0xcc)[_0x2c3c('0x26')]();});}};}function handleEntityNotFound(_0x47746f,_0x382c78){return function(_0x113d88){if(!_0x113d88){_0x47746f[_0x2c3c('0x18')](0x194);}return _0x113d88;};}function handleError(_0x5d6a67,_0x1138f2){_0x1138f2=_0x1138f2||0x1f4;return function(_0xfbdeab){logger[_0x2c3c('0x27')](_0xfbdeab[_0x2c3c('0x28')]);if(_0xfbdeab[_0x2c3c('0x29')]){delete _0xfbdeab[_0x2c3c('0x29')];}_0x5d6a67['status'](_0x1138f2)[_0x2c3c('0x2a')](_0xfbdeab);};}var utilLicense=require(_0x2c3c('0x16'));exports[_0x2c3c('0x2b')]=function(_0x2f6770,_0x3fd0e4){var _0x5e56da={'raw':!![],'where':{'id':0x1}},_0xdd5995={};_0xdd5995[_0x2c3c('0x2c')]=_[_0x2c3c('0x2d')](db[_0x2c3c('0x2e')][_0x2c3c('0x2f')]);_0xdd5995['query']=_['keys'](_0x2f6770[_0x2c3c('0x30')]);_0xdd5995[_0x2c3c('0x31')]=_[_0x2c3c('0x32')](_0xdd5995[_0x2c3c('0x2c')],_0xdd5995['query']);_0x5e56da['attributes']=_['intersection'](_0xdd5995['model'],qs[_0x2c3c('0x33')](_0x2f6770[_0x2c3c('0x30')][_0x2c3c('0x33')]));_0x5e56da[_0x2c3c('0x34')]=_0x5e56da[_0x2c3c('0x34')]['length']?_0x5e56da['attributes']:_0xdd5995[_0x2c3c('0x2c')];_0x5e56da=_['merge']({},_0x5e56da,_0x2f6770['options']);return utilLicense[_0x2c3c('0x35')](_0x5e56da)[_0x2c3c('0x25')](respondWithResult(_0x3fd0e4,null))[_0x2c3c('0x36')](handleError(_0x3fd0e4,null));};exports[_0x2c3c('0x23')]=function(_0x522c65,_0x1c4c31){if(_0x522c65['body']['id']){delete _0x522c65[_0x2c3c('0x37')]['id'];}return db['License'][_0x2c3c('0x38')]({'where':{'id':_0x522c65['params']['id']}})['then'](handleEntityNotFound(_0x1c4c31,null))[_0x2c3c('0x25')](function(_0x102f7f){var _0x3d7d27=_0x102f7f[_0x2c3c('0x39')]({'plain':!![]});return utilLicense[_0x2c3c('0x3a')](_0x3d7d27,_0x522c65[_0x2c3c('0x37')][_0x2c3c('0x3b')]);})[_0x2c3c('0x25')](function(_0x27831d){if(!_0x27831d[_0x2c3c('0x3c')]){return saveUpdates(_0x522c65[_0x2c3c('0x37')],null);}return _0x27831d;})[_0x2c3c('0x25')](respondWithResult(_0x1c4c31,null))['catch'](handleError(_0x1c4c31,null));};exports[_0x2c3c('0x3d')]=function(_0x76a482,_0x5f151d){var _0x5245a5=_0x2c3c('0x3e');var _0x3e763c=path[_0x2c3c('0x3f')](_0x2c3c('0x40'),_0x2c3c('0x41'),_0x2c3c('0x42'),_0x5245a5);_0x5f151d['setHeader'](_0x2c3c('0x43'),_0x2c3c('0x44')+_0x5245a5);_0x5f151d['set']('Content-Type',_0x2c3c('0x45'));_0x5f151d['download'](_0x3e763c);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index d3640fe..5be4725 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 _0xd29b=['define','license','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xd29b,0x167));var _0xbd29=function(_0x5052ea,_0x22247c){_0x5052ea=_0x5052ea-0x0;var _0x44765d=_0xd29b[_0x5052ea];return _0x44765d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbd29('0x0'))('api');var moment=require(_0xbd29('0x1'));var BPromise=require(_0xbd29('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd29('0x3'));var config=require(_0xbd29('0x4'));var attributes=require('./license.attributes');module['exports']=function(_0x5cd5bd,_0x17cea1){return _0x5cd5bd[_0xbd29('0x5')]('License',attributes,{'tableName':_0xbd29('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd1c=['api','moment','request-promise','path','./license.attributes','define','License','license','lodash','../../config/logger'];(function(_0x137b58,_0x198e21){var _0x17bcb1=function(_0x304ac9){while(--_0x304ac9){_0x137b58['push'](_0x137b58['shift']());}};_0x17bcb1(++_0x198e21);}(_0xbd1c,0x166));var _0xcbd1=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xbd1c[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xcbd1('0x0'));var util=require('util');var logger=require(_0xcbd1('0x1'))(_0xcbd1('0x2'));var moment=require(_0xcbd1('0x3'));var BPromise=require('bluebird');var rp=require(_0xcbd1('0x4'));var fs=require('fs');var path=require(_0xcbd1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbd1('0x6'));module['exports']=function(_0x1163fd,_0x2b2785){return _0x1163fd[_0xcbd1('0x7')](_0xcbd1('0x8'),attributes,{'tableName':_0xcbd1('0x9'),'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 cfffba6..c53f0d1 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 _0xe9e5=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe9e5,0xb8));var _0x5e9e=function(_0x1e60fe,_0x30395e){_0x1e60fe=_0x1e60fe-0x0;var _0x491901=_0xe9e5[_0x1e60fe];return _0x491901;};'use strict';var _=require(_0x5e9e('0x0'));var util=require(_0x5e9e('0x1'));var moment=require(_0x5e9e('0x2'));var BPromise=require(_0x5e9e('0x3'));var rs=require(_0x5e9e('0x4'));var fs=require('fs');var Redis=require(_0x5e9e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5e9e('0x6'))(_0x5e9e('0x7'));var config=require(_0x5e9e('0x8'));var jayson=require(_0x5e9e('0x9'));var client=jayson[_0x5e9e('0xa')][_0x5e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b637a,_0x359cb5,_0x5d5d45){return new BPromise(function(_0x465bfd,_0x2a50a9){return client[_0x5e9e('0xc')](_0x3b637a,_0x5d5d45)[_0x5e9e('0xd')](function(_0x404ccb){logger['info']('License,\x20%s,\x20%s',_0x359cb5,_0x5e9e('0xe'));logger[_0x5e9e('0xf')](_0x5e9e('0x10'),_0x359cb5,_0x5e9e('0xe'),JSON[_0x5e9e('0x11')](_0x404ccb));if(_0x404ccb[_0x5e9e('0x12')]){if(_0x404ccb[_0x5e9e('0x12')]['code']===0x1f4){logger[_0x5e9e('0x12')](_0x5e9e('0x13'),_0x359cb5,_0x404ccb['error'][_0x5e9e('0x14')]);return _0x2a50a9(_0x404ccb[_0x5e9e('0x12')][_0x5e9e('0x14')]);}logger['error']('License,\x20%s,\x20%s',_0x359cb5,_0x404ccb[_0x5e9e('0x12')][_0x5e9e('0x14')]);return _0x465bfd(_0x404ccb[_0x5e9e('0x12')][_0x5e9e('0x14')]);}else{logger[_0x5e9e('0x15')](_0x5e9e('0x13'),_0x359cb5,_0x5e9e('0xe'));_0x465bfd(_0x404ccb[_0x5e9e('0x16')]['message']);}})[_0x5e9e('0x17')](function(_0x2b58a0){logger[_0x5e9e('0x12')](_0x5e9e('0x13'),_0x359cb5,_0x2b58a0);_0x2a50a9(_0x2b58a0);});});} \ No newline at end of file +var _0xefed=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','message','catch','lodash'];(function(_0x458bd0,_0x5f54ad){var _0x1f5916=function(_0xc412ff){while(--_0xc412ff){_0x458bd0['push'](_0x458bd0['shift']());}};_0x1f5916(++_0x5f54ad);}(_0xefed,0x19d));var _0xdefe=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0xefed[_0x52ea08];return _0x28d546;};'use strict';var _=require(_0xdefe('0x0'));var util=require(_0xdefe('0x1'));var moment=require(_0xdefe('0x2'));var BPromise=require(_0xdefe('0x3'));var rs=require(_0xdefe('0x4'));var fs=require('fs');var Redis=require(_0xdefe('0x5'));var db=require(_0xdefe('0x6'))['db'];var utils=require(_0xdefe('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xdefe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdefe('0x9')][_0xdefe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51ce82,_0x3c370a,_0x9c8316){return new BPromise(function(_0x486657,_0x25a5d8){return client['request'](_0x51ce82,_0x9c8316)[_0xdefe('0xb')](function(_0x5e6887){logger['info'](_0xdefe('0xc'),_0x3c370a,_0xdefe('0xd'));logger[_0xdefe('0xe')](_0xdefe('0xf'),_0x3c370a,_0xdefe('0xd'),JSON[_0xdefe('0x10')](_0x5e6887));if(_0x5e6887[_0xdefe('0x11')]){if(_0x5e6887[_0xdefe('0x11')][_0xdefe('0x12')]===0x1f4){logger['error'](_0xdefe('0xc'),_0x3c370a,_0x5e6887['error']['message']);return _0x25a5d8(_0x5e6887[_0xdefe('0x11')]['message']);}logger[_0xdefe('0x11')](_0xdefe('0xc'),_0x3c370a,_0x5e6887['error']['message']);return _0x486657(_0x5e6887[_0xdefe('0x11')]['message']);}else{logger[_0xdefe('0x13')](_0xdefe('0xc'),_0x3c370a,_0xdefe('0xd'));_0x486657(_0x5e6887[_0xdefe('0x14')][_0xdefe('0x15')]);}})[_0xdefe('0x16')](function(_0x449d91){logger[_0xdefe('0x11')](_0xdefe('0xc'),_0x3c370a,_0x449d91);_0x25a5d8(_0x449d91);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9ea02e6..cfed439 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 _0x5b47=['../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','send','/:id/users','put','removeAnswers','delete','removeImap','/:id','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5b47,0x13c));var _0x75b4=function(_0x3388c7,_0x55ff2a){_0x3388c7=_0x3388c7-0x0;var _0xc2af7f=_0x5b47[_0x3388c7];return _0xc2af7f;};'use strict';var multer=require(_0x75b4('0x0'));var util=require(_0x75b4('0x1'));var path=require(_0x75b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x75b4('0x3'));var router=express[_0x75b4('0x4')]();var fs_extra=require(_0x75b4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x75b4('0x6'));var config=require(_0x75b4('0x7'));var controller=require(_0x75b4('0x8'));router[_0x75b4('0x9')]('/',auth[_0x75b4('0xa')](),controller['index']);router[_0x75b4('0x9')](_0x75b4('0xb'),auth[_0x75b4('0xa')](),controller[_0x75b4('0xc')]);router['get']('/:id',auth[_0x75b4('0xa')](),controller[_0x75b4('0xd')]);router[_0x75b4('0x9')](_0x75b4('0xe'),auth[_0x75b4('0xa')](),controller[_0x75b4('0xf')]);router['get'](_0x75b4('0x10'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x11')]);router[_0x75b4('0x9')]('/:id/in_servers',auth[_0x75b4('0xa')](),controller[_0x75b4('0x12')]);router[_0x75b4('0x9')](_0x75b4('0x13'),auth['isAuthenticated'](),controller[_0x75b4('0x14')]);router[_0x75b4('0x9')](_0x75b4('0x15'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x16')]);router[_0x75b4('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x75b4('0x17')]);router[_0x75b4('0x9')](_0x75b4('0x18'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x19')]);router['get'](_0x75b4('0x1a'),auth['isAuthenticated'](),controller[_0x75b4('0x1b')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x75b4('0x1c')](_0x75b4('0xe'),auth[_0x75b4('0xa')](),controller['addDisposition']);router[_0x75b4('0x1c')](_0x75b4('0x10'),auth['isAuthenticated'](),controller[_0x75b4('0x1d')]);router[_0x75b4('0x1c')]('/',auth[_0x75b4('0xa')](),controller[_0x75b4('0x1e')]);router[_0x75b4('0x1c')](_0x75b4('0x1f'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x20')]);router['post'](_0x75b4('0x13'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x21')]);router[_0x75b4('0x1c')](_0x75b4('0x15'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x22')]);router['post']('/:id/applications',auth[_0x75b4('0xa')](),controller['addApplications']);router['post'](_0x75b4('0x23'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x24')]);router[_0x75b4('0x1c')](_0x75b4('0x25'),auth[_0x75b4('0xa')](),controller['addAgents']);router[_0x75b4('0x26')]('/:id',auth[_0x75b4('0xa')](),controller['update']);router['delete'](_0x75b4('0xe'),auth[_0x75b4('0xa')](),controller['removeDispositions']);router['delete'](_0x75b4('0x10'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x27')]);router[_0x75b4('0x28')](_0x75b4('0x1f'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x29')]);router[_0x75b4('0x28')](_0x75b4('0x13'),auth['isAuthenticated'](),controller['removeSmtp']);router['delete'](_0x75b4('0x2a'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x2b')]);router['delete'](_0x75b4('0x25'),auth[_0x75b4('0xa')](),controller[_0x75b4('0x2c')]);module[_0x75b4('0x2d')]=router; \ No newline at end of file +var _0xb335=['verifySmtp','/:id/users','post','addDisposition','addAnswer','addImap','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','addApplications','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0xb335,0xa4));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5b33('0x0'));var util=require(_0x5b33('0x1'));var path=require(_0x5b33('0x2'));var timeout=require(_0x5b33('0x3'));var express=require(_0x5b33('0x4'));var router=express['Router']();var fs_extra=require(_0x5b33('0x5'));var auth=require(_0x5b33('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5b33('0x7'));var controller=require(_0x5b33('0x8'));router[_0x5b33('0x9')]('/',auth[_0x5b33('0xa')](),controller[_0x5b33('0xb')]);router[_0x5b33('0x9')](_0x5b33('0xc'),auth[_0x5b33('0xa')](),controller[_0x5b33('0xd')]);router['get'](_0x5b33('0xe'),auth[_0x5b33('0xa')](),controller[_0x5b33('0xf')]);router['get'](_0x5b33('0x10'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x11')]);router[_0x5b33('0x9')](_0x5b33('0x12'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x13')]);router['get'](_0x5b33('0x14'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x15')]);router[_0x5b33('0x9')]('/:id/out_servers',auth[_0x5b33('0xa')](),controller[_0x5b33('0x16')]);router[_0x5b33('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5b33('0x17')]);router[_0x5b33('0x9')](_0x5b33('0x18'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x19')]);router['get']('/:id/messages',auth[_0x5b33('0xa')](),controller[_0x5b33('0x1a')]);router[_0x5b33('0x9')](_0x5b33('0x1b'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x1c')]);router[_0x5b33('0x9')](_0x5b33('0x1d'),auth[_0x5b33('0xa')](),controller['getAgents']);router[_0x5b33('0x1e')](_0x5b33('0x10'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x1f')]);router['post'](_0x5b33('0x12'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x20')]);router[_0x5b33('0x1e')]('/',auth[_0x5b33('0xa')](),controller['create']);router[_0x5b33('0x1e')](_0x5b33('0x14'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x21')]);router[_0x5b33('0x1e')](_0x5b33('0x22'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x23')]);router['post'](_0x5b33('0x24'),auth['isAuthenticated'](),controller[_0x5b33('0x25')]);router[_0x5b33('0x1e')]('/:id/applications',auth[_0x5b33('0xa')](),controller[_0x5b33('0x26')]);router[_0x5b33('0x1e')]('/:id/send',auth[_0x5b33('0xa')](),controller['send']);router['post']('/:id/users',auth[_0x5b33('0xa')](),controller['addAgents']);router[_0x5b33('0x27')]('/:id',auth[_0x5b33('0xa')](),controller['update']);router[_0x5b33('0x28')](_0x5b33('0x10'),auth['isAuthenticated'](),controller[_0x5b33('0x29')]);router[_0x5b33('0x28')](_0x5b33('0x12'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2a')]);router[_0x5b33('0x28')](_0x5b33('0x14'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2b')]);router[_0x5b33('0x28')](_0x5b33('0x22'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2c')]);router[_0x5b33('0x28')](_0x5b33('0xe'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2d')]);router['delete'](_0x5b33('0x1d'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2e')]);module[_0x5b33('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index c73bcde..62e2ff7 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 _0x63ed=['setDataValue','mandatoryDisposition','gmail','yahoo','outlook365','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x63ed,0x103));var _0xd63e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x63ed[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0xd63e('0x0'));module[_0xd63e('0x1')]={'description':{'type':Sequelize[_0xd63e('0x2')]},'name':{'type':Sequelize[_0xd63e('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xd63e('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd63e('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xd63e('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xd63e('0x4')]},'markAsUnread':{'type':Sequelize[_0xd63e('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd63e('0x2')],'allowNull':![],'defaultValue':_0xd63e('0x5')},'fontSize':{'type':Sequelize[_0xd63e('0x6')](0x2)[_0xd63e('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd63e('0x4')],'defaultValue':function(){return _0xd63e('0x8');}},'notificationSound':{'type':Sequelize[_0xd63e('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd63e('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd63e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd63e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd63e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd63e('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd63e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd63e('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd63e('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xd63e('0x3')],'defaultValue':![],'comment':_0xd63e('0xa'),'set':function(_0x2f5190){if(!_0x2f5190)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xd63e('0xb')](_0xd63e('0xc'),_0x2f5190);}},'provider':{'type':Sequelize['ENUM'](_0xd63e('0xd'),'hotmail',_0xd63e('0xe'),_0xd63e('0xf')),'defaultValue':null,'get':function(){var _0x439f50=this['getDataValue'](_0xd63e('0x10'));return _0x439f50||_0xd63e('0x11');},'set':function(_0x8966cf){if(_0x8966cf===_0xd63e('0x11')){_0x8966cf=null;}return this[_0xd63e('0xb')](_0xd63e('0x10'),_0x8966cf);}}}; \ No newline at end of file +var _0x75b4=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','outlook365','custom','setDataValue','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0x4e7e66,_0x1a1921){var _0x3213c=function(_0x14bebe){while(--_0x14bebe){_0x4e7e66['push'](_0x4e7e66['shift']());}};_0x3213c(++_0x1a1921);}(_0x75b4,0xbe));var _0x475b=function(_0x1f799b,_0x505426){_0x1f799b=_0x1f799b-0x0;var _0xbe4c43=_0x75b4[_0x1f799b];return _0xbe4c43;};'use strict';var Sequelize=require(_0x475b('0x0'));module[_0x475b('0x1')]={'description':{'type':Sequelize[_0x475b('0x2')]},'name':{'type':Sequelize[_0x475b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x475b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x475b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x475b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x475b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x475b('0x4')]},'markAsUnread':{'type':Sequelize[_0x475b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x475b('0x5')},'fontSize':{'type':Sequelize[_0x475b('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x475b('0x4')],'defaultValue':function(){return _0x475b('0x7');}},'notificationSound':{'type':Sequelize[_0x475b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x475b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x475b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x475b('0x9'),'set':function(_0x2d9c52){if(!_0x2d9c52)this['setDataValue'](_0x475b('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x2d9c52);}},'provider':{'type':Sequelize[_0x475b('0xb')](_0x475b('0xc'),_0x475b('0xd'),'yahoo',_0x475b('0xe')),'defaultValue':null,'get':function(){var _0x13bf26=this['getDataValue']('provider');return _0x13bf26||_0x475b('0xf');},'set':function(_0x3f01c7){if(_0x3f01c7===_0x475b('0xf')){_0x3f01c7=null;}return this[_0x475b('0x10')](_0x475b('0x11'),_0x3f01c7);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 37239b2..afb0b3d 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 _0xcb6e=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','sendMail','messageId','subject','attach','out','Interaction','Messages','CloudProvider','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','User','moment','bluebird','util','path','juice','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','update','destroy','get','MailAccounts','UserProfileResource','stack','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','secure','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','options','fields','includeAll','include','merge','body','provider','custom','find','params','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','create','getDispositions','MailAccountId','findAll','rows','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','key','email','ListId','isNil','active','description'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xcb6e,0x102));var _0xecb6=function(_0x3c071b,_0x5bef46){_0x3c071b=_0x3c071b-0x0;var _0x449219=_0xcb6e[_0x3c071b];return _0x449219;};'use strict';var moment=require(_0xecb6('0x0'));var BPromise=require(_0xecb6('0x1'));var util=require(_0xecb6('0x2'));var path=require(_0xecb6('0x3'));var _=require('lodash');var juice=require(_0xecb6('0x4'));var Redis=require('ioredis');var qs=require(_0xecb6('0x5'));var logger=require(_0xecb6('0x6'))(_0xecb6('0x7'));var config=require('../../config/environment');var db=require(_0xecb6('0x8'))['db'];config[_0xecb6('0x9')]=_[_0xecb6('0xa')](config[_0xecb6('0x9')],{'host':_0xecb6('0xb'),'port':0x18eb});var socket=require(_0xecb6('0xc'))(new Redis(config[_0xecb6('0x9')]));require('./mailAccount.socket')[_0xecb6('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0xecb6('0xe')][_0xecb6('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x183c1a,_0x402486,_0x3f4d80,_0x524232){return new BPromise(function(_0x191869,_0x4764c3){var _0x40e5ee=_0x524232||client;return _0x40e5ee[_0xecb6('0x10')](_0x183c1a,_0x3f4d80)[_0xecb6('0x11')](function(_0x5cebbf){logger[_0xecb6('0x12')](_0xecb6('0x13'),_0x402486,_0xecb6('0x14'));logger[_0xecb6('0x15')](_0xecb6('0x16'),_0x402486,'request\x20sent',JSON['stringify'](_0x5cebbf));if(_0x5cebbf[_0xecb6('0x17')]){if(_0x5cebbf[_0xecb6('0x17')]['code']===0x1f4){logger[_0xecb6('0x17')](_0xecb6('0x13'),_0x402486,_0x5cebbf[_0xecb6('0x17')][_0xecb6('0x18')]);return _0x4764c3(_0x5cebbf[_0xecb6('0x17')][_0xecb6('0x18')]);}logger['error'](_0xecb6('0x13'),_0x402486,_0x5cebbf['error'][_0xecb6('0x18')]);return _0x191869(_0x5cebbf['error']['message']);}else{logger['info'](_0xecb6('0x13'),_0x402486,_0xecb6('0x14'));_0x191869(_0x5cebbf[_0xecb6('0x19')][_0xecb6('0x18')]);}})[_0xecb6('0x1a')](function(_0x35638a){logger[_0xecb6('0x17')](_0xecb6('0x13'),_0x402486,_0x35638a);_0x4764c3(_0x35638a);});});}function respondWithStatusCode(_0x19f43f,_0x584454){_0x584454=_0x584454||0xcc;return function(_0x437f16){if(_0x437f16){return _0x19f43f[_0xecb6('0x1b')](_0x584454);}return _0x19f43f['status'](_0x584454)[_0xecb6('0x1c')]();};}function respondWithResult(_0x960c1a,_0x1902cd){_0x1902cd=_0x1902cd||0xc8;return function(_0x53b225){if(_0x53b225){return _0x960c1a['status'](_0x1902cd)[_0xecb6('0x1d')](_0x53b225);}};}function respondWithFilteredResult(_0xadabed,_0x4a8f61){return function(_0x5222f2){if(_0x5222f2){var _0x1c0751=typeof _0x4a8f61[_0xecb6('0x1e')]===_0xecb6('0x1f')&&typeof _0x4a8f61[_0xecb6('0x20')]==='undefined';var _0x28a017=_0x5222f2[_0xecb6('0x21')];var _0x1e74b5=_0x1c0751?0x0:_0x4a8f61[_0xecb6('0x1e')];var _0x4889e7=_0x1c0751?_0x5222f2['count']:_0x4a8f61[_0xecb6('0x1e')]+_0x4a8f61[_0xecb6('0x20')];var _0x37869a;if(_0x4889e7>=_0x28a017){_0x4889e7=_0x28a017;_0x37869a=0xc8;}else{_0x37869a=0xce;}_0xadabed[_0xecb6('0x22')](_0x37869a);return _0xadabed[_0xecb6('0x23')]('Content-Range',_0x1e74b5+'-'+_0x4889e7+'/'+_0x28a017)[_0xecb6('0x1d')](_0x5222f2);}return null;};}function saveUpdates(_0x471743){return function(_0x4fd3ad){if(_0x4fd3ad){return _0x4fd3ad[_0xecb6('0x24')](_0x471743)[_0xecb6('0x11')](function(_0x515880){return _0x515880;});}return null;};}function removeEntity(_0xbe622f){return function(_0x5063cf){if(_0x5063cf){return _0x5063cf[_0xecb6('0x25')]()[_0xecb6('0x11')](function(){var _0x4b3ed6=_0x5063cf[_0xecb6('0x26')]({'plain':!![]});var _0x4af455=_0xecb6('0x27');return db[_0xecb6('0x28')][_0xecb6('0x25')]({'where':{'type':_0x4af455,'resourceId':_0x4b3ed6['id']}})[_0xecb6('0x11')](function(){return _0x5063cf;});})[_0xecb6('0x11')](function(){_0xbe622f[_0xecb6('0x22')](0xcc)[_0xecb6('0x1c')]();});}};}function handleEntityNotFound(_0x29eb32){return function(_0x535ee0){if(!_0x535ee0){_0x29eb32['sendStatus'](0x194);}return _0x535ee0;};}function handleError(_0x3f24ef,_0x4dedd4){_0x4dedd4=_0x4dedd4||0x1f4;return function(_0x5729ac){logger['error'](_0x5729ac[_0xecb6('0x29')]);if(_0x5729ac['name']){delete _0x5729ac['name'];}_0x3f24ef[_0xecb6('0x22')](_0x4dedd4)[_0xecb6('0x2a')](_0x5729ac);};}function getImapHost(_0x26a7ff){switch(_0x26a7ff){case _0xecb6('0x2b'):return _0xecb6('0x2c');case _0xecb6('0x2d'):return _0xecb6('0x2e');case _0xecb6('0x2f'):return _0xecb6('0x30');case _0xecb6('0x31'):return _0xecb6('0x32');}throw new Error(_0xecb6('0x33'),_0x26a7ff);}function getSmtpHost(_0x40a584){switch(_0x40a584){case'gmail':return _0xecb6('0x34');case _0xecb6('0x2d'):return _0xecb6('0x35');case'hotmail':return'smtp-mail.outlook.com';case _0xecb6('0x31'):return _0xecb6('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x40a584);}function getAuthenticationOptions(_0x239fde,_0x5f1709){var _0x39bf3d={};var _0x2b0382={};if(_0x239fde){_0x39bf3d[_0xecb6('0x37')]=_0x2b0382[_0xecb6('0x37')]=_0x5f1709[_0xecb6('0x38')];_0x39bf3d['password']=_0x2b0382[_0xecb6('0x39')]=_0x5f1709[_0xecb6('0x3a')];if(_0x5f1709[_0xecb6('0x3b')]){_0x39bf3d[_0xecb6('0x3b')]=_0x2b0382[_0xecb6('0x3b')]=!![];_0x39bf3d[_0xecb6('0x3c')]=_0x2b0382[_0xecb6('0x3c')]=_0x5f1709[_0xecb6('0x3c')];_0x39bf3d[_0xecb6('0x3a')]=_0x2b0382['pass']=null;}else{_0x39bf3d[_0xecb6('0x3c')]=_0x2b0382[_0xecb6('0x3c')]=null;}_0x39bf3d[_0xecb6('0x3d')]=getImapHost(_0x239fde);_0x39bf3d[_0xecb6('0x3e')]=0x3e1;_0x2b0382[_0xecb6('0x3d')]=getSmtpHost(_0x239fde);_0x2b0382[_0xecb6('0x3e')]=0x24b;_0x2b0382[_0xecb6('0x3f')]=![];_0x39bf3d['service']=_0x2b0382['service']=null;}else{if(_0x5f1709[_0xecb6('0x40')]){_0x39bf3d[_0xecb6('0x37')]=_0x2b0382[_0xecb6('0x37')]=_0x5f1709[_0xecb6('0x38')];_0x39bf3d['password']=_0x2b0382[_0xecb6('0x39')]=_0x5f1709[_0xecb6('0x3a')];}else{_0x39bf3d[_0xecb6('0x40')]=_0x2b0382['authentication']=![];_0x39bf3d['user']=_0x2b0382[_0xecb6('0x37')]=null;_0x39bf3d[_0xecb6('0x3a')]=_0x2b0382[_0xecb6('0x39')]=null;}_0x39bf3d['host']=_0x5f1709[_0xecb6('0x41')][_0xecb6('0x3d')];_0x39bf3d[_0xecb6('0x3e')]=_0x5f1709[_0xecb6('0x41')][_0xecb6('0x3e')];_0x2b0382[_0xecb6('0x3d')]=_0x5f1709['Smtp'][_0xecb6('0x3d')];_0x2b0382[_0xecb6('0x3e')]=_0x5f1709[_0xecb6('0x42')][_0xecb6('0x3e')];}return{'Imap':_0x39bf3d,'Smtp':_0x2b0382};}exports[_0xecb6('0x43')]=function(_0x38358f,_0x52c7b3){var _0x8efb2f={'include':[{'model':db[_0xecb6('0x44')],'as':'Imap'},{'model':db[_0xecb6('0x45')],'as':'Smtp'},{'model':db[_0xecb6('0x46')],'as':_0xecb6('0x47')}]},_0x57215f={},_0x15e1da={'count':0x0,'rows':[]};var _0x3f27f8=_[_0xecb6('0x48')](db[_0xecb6('0x49')][_0xecb6('0x4a')],function(_0x2c23a1){return{'name':_0x2c23a1[_0xecb6('0x4b')],'type':_0x2c23a1[_0xecb6('0x4c')]['key']};});_0x57215f[_0xecb6('0x4d')]=_[_0xecb6('0x48')](_0x3f27f8,_0xecb6('0x4e'));_0x57215f['query']=_[_0xecb6('0x4f')](_0x38358f['query']);_0x57215f[_0xecb6('0x50')]=_[_0xecb6('0x51')](_0x57215f[_0xecb6('0x4d')],_0x57215f[_0xecb6('0x52')]);_0x8efb2f[_0xecb6('0x53')]=_[_0xecb6('0x51')](_0x57215f[_0xecb6('0x4d')],qs['fields'](_0x38358f[_0xecb6('0x52')]['fields']));_0x8efb2f[_0xecb6('0x53')]=_0x8efb2f[_0xecb6('0x53')][_0xecb6('0x54')]?_0x8efb2f['attributes']:_0x57215f[_0xecb6('0x4d')];if(!_0x38358f[_0xecb6('0x52')][_0xecb6('0x55')](_0xecb6('0x56'))){_0x8efb2f['limit']=qs[_0xecb6('0x20')](_0x38358f[_0xecb6('0x52')][_0xecb6('0x20')]);_0x8efb2f[_0xecb6('0x1e')]=qs['offset'](_0x38358f[_0xecb6('0x52')][_0xecb6('0x1e')]);}_0x8efb2f[_0xecb6('0x57')]=qs[_0xecb6('0x58')](_0x38358f[_0xecb6('0x52')][_0xecb6('0x58')]);_0x8efb2f['where']=qs[_0xecb6('0x50')](_[_0xecb6('0x59')](_0x38358f[_0xecb6('0x52')],_0x57215f[_0xecb6('0x50')]),_0x3f27f8);if(_0x38358f[_0xecb6('0x52')]['filter']){_0x8efb2f[_0xecb6('0x5a')]=_['merge'](_0x8efb2f['where'],{'$or':_[_0xecb6('0x48')](_0x3f27f8,function(_0x404426){if(_0x404426[_0xecb6('0x4c')]!==_0xecb6('0x5b')){var _0x132c22={};_0x132c22[_0x404426['name']]={'$like':'%'+_0x38358f[_0xecb6('0x52')][_0xecb6('0x5c')]+'%'};return _0x132c22;}})});}_0x8efb2f=_['merge']({},_0x8efb2f,_0x38358f[_0xecb6('0x5d')]);var _0x340587={'where':_0x8efb2f[_0xecb6('0x5a')]};return db[_0xecb6('0x49')][_0xecb6('0x21')](_0x340587)[_0xecb6('0x11')](function(_0x3f8a64){_0x15e1da['count']=_0x3f8a64;if(_0x38358f['query']['includeAll']){_0x8efb2f['include']=[{'all':!![]}];}return db[_0xecb6('0x49')]['findAll'](_0x8efb2f);})[_0xecb6('0x11')](function(_0x17de5d){_0x15e1da['rows']=_0x17de5d;return _0x15e1da;})['then'](respondWithFilteredResult(_0x52c7b3,_0x8efb2f))[_0xecb6('0x1a')](handleError(_0x52c7b3,null));};exports['show']=function(_0x5da236,_0x214ee4){var _0x24bb16={'raw':![],'where':{'id':_0x5da236['params']['id']},'include':[{'model':db[_0xecb6('0x44')],'as':_0xecb6('0x41')},{'model':db[_0xecb6('0x45')],'as':_0xecb6('0x42')},{'model':db[_0xecb6('0x46')],'as':_0xecb6('0x47')}]},_0x4e6529={};_0x4e6529[_0xecb6('0x4d')]=_[_0xecb6('0x4f')](db['MailAccount']['rawAttributes']);_0x4e6529[_0xecb6('0x52')]=_['keys'](_0x5da236['query']);_0x4e6529[_0xecb6('0x50')]=_[_0xecb6('0x51')](_0x4e6529['model'],_0x4e6529['query']);_0x24bb16['attributes']=_[_0xecb6('0x51')](_0x4e6529['model'],qs[_0xecb6('0x5e')](_0x5da236[_0xecb6('0x52')][_0xecb6('0x5e')]));_0x24bb16['attributes']=_0x24bb16['attributes']['length']?_0x24bb16[_0xecb6('0x53')]:_0x4e6529[_0xecb6('0x4d')];if(_0x5da236[_0xecb6('0x52')][_0xecb6('0x5f')]){_0x24bb16[_0xecb6('0x60')]=[{'all':!![]}];}_0x24bb16=_[_0xecb6('0x61')]({},_0x24bb16,_0x5da236['options']);return db['MailAccount']['find'](_0x24bb16)['then'](handleEntityNotFound(_0x214ee4,null))[_0xecb6('0x11')](respondWithResult(_0x214ee4,null))[_0xecb6('0x1a')](handleError(_0x214ee4,null));};exports[_0xecb6('0x24')]=function(_0x2f9e42,_0x580743){if(_0x2f9e42[_0xecb6('0x62')]['id']){delete _0x2f9e42['body']['id'];}var _0xda7d08=_0x2f9e42[_0xecb6('0x62')][_0xecb6('0x63')]===_0xecb6('0x64')?null:_0x2f9e42[_0xecb6('0x62')][_0xecb6('0x63')];var _0x161dce=_0x2f9e42[_0xecb6('0x62')]['Imap']||{};var _0x14f6e7=_0x2f9e42['body'][_0xecb6('0x42')]||{};if(_0xda7d08){_0x161dce[_0xecb6('0x3d')]=getImapHost(_0xda7d08);_0x161dce[_0xecb6('0x3e')]=0x3e1;_0x14f6e7['host']=getSmtpHost(_0xda7d08);_0x14f6e7[_0xecb6('0x3e')]=0x24b;_0x14f6e7['secure']=![];}if(_0x14f6e7[_0xecb6('0x3b')]){_0x14f6e7[_0xecb6('0x3f')]=![];}else{_0x14f6e7[_0xecb6('0x3c')]=null;}if(!_0x161dce[_0xecb6('0x3b')])_0x161dce[_0xecb6('0x3c')]=null;_0x2f9e42[_0xecb6('0x62')][_0xecb6('0x41')]=_0x161dce;_0x2f9e42[_0xecb6('0x62')][_0xecb6('0x42')]=_0x14f6e7;return db['MailAccount'][_0xecb6('0x65')]({'where':{'id':_0x2f9e42[_0xecb6('0x66')]['id']},'include':[{'model':db[_0xecb6('0x44')],'as':'Imap'},{'model':db[_0xecb6('0x45')],'as':_0xecb6('0x42')},{'model':db[_0xecb6('0x46')],'as':_0xecb6('0x47')}]})[_0xecb6('0x11')](handleEntityNotFound(_0x580743,null))[_0xecb6('0x11')](function(_0x487a82){if(!_0x487a82)throw new Error(_0xecb6('0x67'));if(_0x487a82['service'])delete _0x2f9e42['body'][_0xecb6('0x41')];return _0x487a82;})[_0xecb6('0x11')](saveUpdates(_0x2f9e42['body'],null))[_0xecb6('0x11')](function(_0x567adb){if(!_0x2f9e42['body'][_0xecb6('0x41')])return _0x567adb;return db['MailServerIn']['update'](_0x2f9e42['body'][_0xecb6('0x41')],{'where':{'MailAccountId':_0x567adb['id']}})[_0xecb6('0x11')](function(){return _0x567adb;});})[_0xecb6('0x11')](function(_0x2a9745){if(!_0x2f9e42[_0xecb6('0x62')]['Smtp'])return _0x2a9745;return db['MailServerOut'][_0xecb6('0x24')](_0x2f9e42['body'][_0xecb6('0x42')],{'where':{'MailAccountId':_0x2a9745['id']}})[_0xecb6('0x11')](function(){return _0x2a9745;});})[_0xecb6('0x11')](respondWithResult(_0x580743,null))[_0xecb6('0x1a')](handleError(_0x580743,null));};exports['describe']=function(_0x2a5d84,_0x1eae26){return db[_0xecb6('0x49')][_0xecb6('0x68')]()[_0xecb6('0x11')](respondWithResult(_0x1eae26,null))[_0xecb6('0x1a')](handleError(_0x1eae26,null));};exports[_0xecb6('0x69')]=function(_0x2d2da6,_0x4615a4){if(_0x2d2da6[_0xecb6('0x62')]['id']){delete _0x2d2da6[_0xecb6('0x62')]['id'];}return db[_0xecb6('0x49')][_0xecb6('0x65')]({'where':{'id':_0x2d2da6[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x4615a4,null))[_0xecb6('0x11')](function(_0x53844a){if(_0x53844a){_0x2d2da6[_0xecb6('0x62')]['MailAccountId']=_0x53844a['id'];return db[_0xecb6('0x6a')][_0xecb6('0x6b')](_0x2d2da6[_0xecb6('0x62')]);}})[_0xecb6('0x11')](respondWithResult(_0x4615a4,null))[_0xecb6('0x1a')](handleError(_0x4615a4,null));};exports[_0xecb6('0x6c')]=function(_0x3398f9,_0x5b685b){var _0x517a1f={'raw':![],'where':{}};var _0x474ad9={};var _0x10ee59={'count':0x0,'rows':[]};return db[_0xecb6('0x49')]['findOne']({'where':{'id':_0x3398f9[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x5b685b,null))['then'](function(_0x18f4e0){if(_0x18f4e0){_0x474ad9['model']=_[_0xecb6('0x4f')](db['Disposition']['rawAttributes']);_0x474ad9[_0xecb6('0x52')]=_[_0xecb6('0x4f')](_0x3398f9[_0xecb6('0x52')]);_0x474ad9[_0xecb6('0x50')]=_['intersection'](_0x474ad9[_0xecb6('0x4d')],_0x474ad9[_0xecb6('0x52')]);_0x517a1f[_0xecb6('0x53')]=_[_0xecb6('0x51')](_0x474ad9['model'],qs[_0xecb6('0x5e')](_0x3398f9['query'][_0xecb6('0x5e')]));_0x517a1f[_0xecb6('0x53')]=_0x517a1f[_0xecb6('0x53')][_0xecb6('0x54')]?_0x517a1f[_0xecb6('0x53')]:_0x474ad9[_0xecb6('0x4d')];if(!_0x3398f9[_0xecb6('0x52')][_0xecb6('0x55')]('nolimit')){_0x517a1f[_0xecb6('0x20')]=qs[_0xecb6('0x20')](_0x3398f9['query'][_0xecb6('0x20')]);_0x517a1f[_0xecb6('0x1e')]=qs['offset'](_0x3398f9['query'][_0xecb6('0x1e')]);}_0x517a1f[_0xecb6('0x57')]=qs['sort'](_0x3398f9[_0xecb6('0x52')][_0xecb6('0x58')]);_0x517a1f[_0xecb6('0x5a')]=qs[_0xecb6('0x50')](_[_0xecb6('0x59')](_0x3398f9[_0xecb6('0x52')],_0x474ad9[_0xecb6('0x50')]));_0x517a1f[_0xecb6('0x5a')][_0xecb6('0x6d')]=_0x18f4e0['id'];if(_0x3398f9[_0xecb6('0x52')][_0xecb6('0x5c')]){_0x517a1f[_0xecb6('0x5a')]=_[_0xecb6('0x61')](_0x517a1f[_0xecb6('0x5a')],{'$or':_[_0xecb6('0x48')](_0x517a1f[_0xecb6('0x53')],function(_0x48e8e8){var _0x546666={};_0x546666[_0x48e8e8]={'$like':'%'+_0x3398f9[_0xecb6('0x52')][_0xecb6('0x5c')]+'%'};return _0x546666;})});}_0x517a1f=_[_0xecb6('0x61')]({},_0x517a1f,_0x3398f9['options']);return db[_0xecb6('0x6a')][_0xecb6('0x21')]({'where':_0x517a1f['where']})[_0xecb6('0x11')](function(_0x283909){_0x10ee59[_0xecb6('0x21')]=_0x283909;if(_0x3398f9[_0xecb6('0x52')][_0xecb6('0x5f')]){_0x517a1f[_0xecb6('0x60')]=[{'all':!![]}];}return db[_0xecb6('0x6a')][_0xecb6('0x6e')](_0x517a1f);})[_0xecb6('0x11')](function(_0x4f02a4){_0x10ee59[_0xecb6('0x6f')]=_0x4f02a4;return _0x10ee59;});}})[_0xecb6('0x11')](respondWithFilteredResult(_0x5b685b,_0x517a1f))[_0xecb6('0x1a')](handleError(_0x5b685b,null));};exports[_0xecb6('0x70')]=function(_0x2db373,_0xfaa09c){return db['MailAccount']['find']({'where':{'id':_0x2db373[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0xfaa09c,null))[_0xecb6('0x11')](function(_0x5838a4){if(_0x5838a4){return _0x5838a4[_0xecb6('0x70')](_0x2db373[_0xecb6('0x52')][_0xecb6('0x71')]);}})[_0xecb6('0x11')](respondWithStatusCode(_0xfaa09c,null))['catch'](handleError(_0xfaa09c,null));};exports['addAnswer']=function(_0x52997f,_0x1a0bac){if(_0x52997f[_0xecb6('0x62')]['id']){delete _0x52997f['body']['id'];}return db[_0xecb6('0x49')][_0xecb6('0x65')]({'where':{'id':_0x52997f[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x1a0bac,null))[_0xecb6('0x11')](function(_0x233400){if(_0x233400){_0x52997f['body'][_0xecb6('0x6d')]=_0x233400['id'];return db['CannedAnswer'][_0xecb6('0x6b')](_0x52997f['body']);}})[_0xecb6('0x11')](respondWithResult(_0x1a0bac,null))[_0xecb6('0x1a')](handleError(_0x1a0bac,null));};exports[_0xecb6('0x72')]=function(_0x4535bf,_0xf55e7d){var _0x5d9c1f={'raw':![],'where':{}};var _0x1fc28a={};var _0x54810e={'count':0x0,'rows':[]};return db[_0xecb6('0x49')][_0xecb6('0x73')]({'where':{'id':_0x4535bf[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0xf55e7d,null))[_0xecb6('0x11')](function(_0x2e27cb){if(_0x2e27cb){_0x1fc28a[_0xecb6('0x4d')]=_[_0xecb6('0x4f')](db[_0xecb6('0x74')][_0xecb6('0x4a')]);_0x1fc28a[_0xecb6('0x52')]=_[_0xecb6('0x4f')](_0x4535bf[_0xecb6('0x52')]);_0x1fc28a[_0xecb6('0x50')]=_['intersection'](_0x1fc28a['model'],_0x1fc28a['query']);_0x5d9c1f[_0xecb6('0x53')]=_[_0xecb6('0x51')](_0x1fc28a[_0xecb6('0x4d')],qs[_0xecb6('0x5e')](_0x4535bf[_0xecb6('0x52')][_0xecb6('0x5e')]));_0x5d9c1f['attributes']=_0x5d9c1f[_0xecb6('0x53')][_0xecb6('0x54')]?_0x5d9c1f[_0xecb6('0x53')]:_0x1fc28a['model'];if(!_0x4535bf[_0xecb6('0x52')][_0xecb6('0x55')]('nolimit')){_0x5d9c1f[_0xecb6('0x20')]=qs[_0xecb6('0x20')](_0x4535bf[_0xecb6('0x52')]['limit']);_0x5d9c1f[_0xecb6('0x1e')]=qs['offset'](_0x4535bf[_0xecb6('0x52')][_0xecb6('0x1e')]);}_0x5d9c1f['order']=qs[_0xecb6('0x58')](_0x4535bf[_0xecb6('0x52')][_0xecb6('0x58')]);_0x5d9c1f['where']=qs[_0xecb6('0x50')](_['pick'](_0x4535bf[_0xecb6('0x52')],_0x1fc28a[_0xecb6('0x50')]));_0x5d9c1f[_0xecb6('0x5a')][_0xecb6('0x6d')]=_0x2e27cb['id'];if(_0x4535bf[_0xecb6('0x52')][_0xecb6('0x5c')]){_0x5d9c1f['where']=_[_0xecb6('0x61')](_0x5d9c1f['where'],{'$or':_['map'](_0x5d9c1f[_0xecb6('0x53')],function(_0x37436d){var _0x3e3e9d={};_0x3e3e9d[_0x37436d]={'$like':'%'+_0x4535bf[_0xecb6('0x52')][_0xecb6('0x5c')]+'%'};return _0x3e3e9d;})});}_0x5d9c1f=_['merge']({},_0x5d9c1f,_0x4535bf['options']);return db[_0xecb6('0x74')][_0xecb6('0x21')]({'where':_0x5d9c1f['where']})['then'](function(_0x19eb62){_0x54810e['count']=_0x19eb62;if(_0x4535bf['query'][_0xecb6('0x5f')]){_0x5d9c1f['include']=[{'all':!![]}];}return db[_0xecb6('0x74')][_0xecb6('0x6e')](_0x5d9c1f);})[_0xecb6('0x11')](function(_0x5cec2d){_0x54810e[_0xecb6('0x6f')]=_0x5cec2d;return _0x54810e;});}})[_0xecb6('0x11')](respondWithFilteredResult(_0xf55e7d,_0x5d9c1f))[_0xecb6('0x1a')](handleError(_0xf55e7d,null));};exports[_0xecb6('0x75')]=function(_0x49bab6,_0xf2c387){return db['MailAccount'][_0xecb6('0x65')]({'where':{'id':_0x49bab6[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0xf2c387,null))[_0xecb6('0x11')](function(_0x317b33){if(_0x317b33){return _0x317b33['removeAnswers'](_0x49bab6[_0xecb6('0x52')][_0xecb6('0x71')]);}})['then'](respondWithStatusCode(_0xf2c387,null))[_0xecb6('0x1a')](handleError(_0xf2c387,null));};exports[_0xecb6('0x6b')]=function(_0x598992,_0x4511d0){var _0xc75df8={'name':_0x598992[_0xecb6('0x62')][_0xecb6('0x4e')],'key':_0x598992['body'][_0xecb6('0x76')],'provider':_0x598992[_0xecb6('0x62')][_0xecb6('0x63')]==='custom'?null:_0x598992[_0xecb6('0x62')][_0xecb6('0x63')],'email':_0x598992['body'][_0xecb6('0x77')],'ListId':_0x598992[_0xecb6('0x62')][_0xecb6('0x78')],'active':!_[_0xecb6('0x79')](_0x598992[_0xecb6('0x62')][_0xecb6('0x7a')])?_0x598992[_0xecb6('0x62')][_0xecb6('0x7a')]:!![],'description':_0x598992['body'][_0xecb6('0x7b')]||null};var _0x911ffb=getAuthenticationOptions(_0xc75df8[_0xecb6('0x63')],_0x598992['body']);_0xc75df8[_0xecb6('0x41')]=_0x911ffb[_0xecb6('0x41')];_0xc75df8['Smtp']=_0x911ffb['Smtp'];return db[_0xecb6('0x49')][_0xecb6('0x6b')](_0xc75df8,{'include':[{'model':db['MailServerOut'],'as':_0xecb6('0x42')},{'model':db['MailServerIn'],'as':_0xecb6('0x41')}]})[_0xecb6('0x11')](function(_0x493d66){var _0x4b4467=_0x598992[_0xecb6('0x37')][_0xecb6('0x26')]({'plain':!![]});if(!_0x4b4467)throw new Error(_0xecb6('0x7c'));if(_0x4b4467[_0xecb6('0x7d')]===_0xecb6('0x37')){var _0x37494a=_0x493d66[_0xecb6('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xecb6('0x65')]({'where':{'name':'MailAccounts','userProfileId':_0x4b4467['userProfileId']},'raw':!![]})[_0xecb6('0x11')](function(_0x173d78){if(_0x173d78&&_0x173d78[_0xecb6('0x7e')]===0x0){return db[_0xecb6('0x28')][_0xecb6('0x6b')]({'name':_0x37494a[_0xecb6('0x4e')],'resourceId':_0x37494a['id'],'type':_0x173d78[_0xecb6('0x4e')],'sectionId':_0x173d78['id']},{})[_0xecb6('0x11')](function(){return _0x493d66;});}else{return _0x493d66;}})[_0xecb6('0x1a')](function(_0x37a721){logger[_0xecb6('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37a721);throw _0x37a721;});}return _0x493d66;})[_0xecb6('0x11')](respondWithResult(_0x4511d0,0xc9))[_0xecb6('0x1a')](handleError(_0x4511d0,null));};exports[_0xecb6('0x7f')]=function(_0x2c5fff,_0x59fdd3){return db[_0xecb6('0x49')][_0xecb6('0x73')]({'where':{'id':_0x2c5fff[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x59fdd3,null))[_0xecb6('0x11')](function(_0x103997){if(_0x103997){return _0x103997[_0xecb6('0x7f')]();}return null;})[_0xecb6('0x11')](respondWithResult(_0x59fdd3,null))['catch'](handleError(_0x59fdd3,null));};exports[_0xecb6('0x80')]=function(_0x510157,_0xd24fc0){if(_0x510157[_0xecb6('0x62')]['id']){delete _0x510157[_0xecb6('0x62')]['id'];}return db[_0xecb6('0x49')][_0xecb6('0x65')]({'where':{'id':_0x510157[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0xd24fc0,null))[_0xecb6('0x11')](function(_0x162311){if(_0x162311){_0x510157[_0xecb6('0x62')][_0xecb6('0x6d')]=_0x162311['id'];return db[_0xecb6('0x44')][_0xecb6('0x6b')](_0x510157[_0xecb6('0x62')]);}})[_0xecb6('0x11')](respondWithResult(_0xd24fc0,null))[_0xecb6('0x1a')](handleError(_0xd24fc0,null));};exports[_0xecb6('0x81')]=function(_0x2d17d3,_0x14b2a3){return db[_0xecb6('0x49')][_0xecb6('0x73')]({'where':{'id':_0x2d17d3[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x14b2a3,null))[_0xecb6('0x11')](function(_0x33a334){if(_0x33a334){return _0x33a334[_0xecb6('0x82')](null);}return null;})[_0xecb6('0x11')](respondWithStatusCode(_0x14b2a3,null))[_0xecb6('0x1a')](handleError(_0x14b2a3,null));};exports[_0xecb6('0x83')]=function(_0x2d9c90,_0x5593c7){return db['MailAccount'][_0xecb6('0x73')]({'where':{'id':_0x2d9c90[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x5593c7,null))[_0xecb6('0x11')](function(_0x4a0d32){if(_0x4a0d32){return _0x4a0d32['getSmtp']();}return null;})['then'](respondWithResult(_0x5593c7,null))[_0xecb6('0x1a')](handleError(_0x5593c7,null));};exports[_0xecb6('0x84')]=function(_0x282b4e,_0x2d9885){if(_0x282b4e['body']['id']){delete _0x282b4e[_0xecb6('0x62')]['id'];}return db[_0xecb6('0x49')][_0xecb6('0x65')]({'where':{'id':_0x282b4e[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x2d9885,null))[_0xecb6('0x11')](function(_0x140843){if(_0x140843){_0x282b4e[_0xecb6('0x62')]['MailAccountId']=_0x140843['id'];return db[_0xecb6('0x45')][_0xecb6('0x6b')](_0x282b4e[_0xecb6('0x62')]);}})['then'](respondWithResult(_0x2d9885,null))[_0xecb6('0x1a')](handleError(_0x2d9885,null));};exports['removeSmtp']=function(_0x2e5745,_0x2f32f6){return db['MailAccount'][_0xecb6('0x73')]({'where':{'id':_0x2e5745[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x2f32f6,null))['then'](function(_0x2ff232){if(_0x2ff232){return _0x2ff232[_0xecb6('0x85')](null);}return null;})[_0xecb6('0x11')](respondWithStatusCode(_0x2f32f6,null))['catch'](handleError(_0x2f32f6,null));};exports[_0xecb6('0x86')]=function(_0x516903,_0x4101a0){return db[_0xecb6('0x87')][_0xecb6('0x65')]({'where':{'id':_0x516903['params']['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x4101a0,null))['then'](function(_0x1a8a82){if(_0x1a8a82){return _0x1a8a82[_0xecb6('0x86')](_0x516903[_0xecb6('0x62')][_0xecb6('0x71')],_[_0xecb6('0x88')](_0x516903[_0xecb6('0x62')],[_0xecb6('0x71'),'id'])||{});}})[_0xecb6('0x11')](respondWithResult(_0x4101a0,null))[_0xecb6('0x1a')](handleError(_0x4101a0,null));};exports[_0xecb6('0x89')]=function(_0x200e18,_0x31b685){var _0x34d7e9={'raw':![],'where':{}};var _0x181c10={};var _0x3e6da6={'count':0x0,'rows':[]};return db[_0xecb6('0x49')][_0xecb6('0x73')]({'where':{'id':_0x200e18[_0xecb6('0x66')]['id']}})['then'](handleEntityNotFound(_0x31b685,null))[_0xecb6('0x11')](function(_0x19b621){if(_0x19b621){_0x181c10['model']=_[_0xecb6('0x4f')](db[_0xecb6('0x87')]['rawAttributes']);_0x181c10['query']=_[_0xecb6('0x4f')](_0x200e18['query']);_0x181c10['filters']=_[_0xecb6('0x51')](_0x181c10[_0xecb6('0x4d')],_0x181c10[_0xecb6('0x52')]);_0x34d7e9[_0xecb6('0x53')]=_[_0xecb6('0x51')](_0x181c10[_0xecb6('0x4d')],qs[_0xecb6('0x5e')](_0x200e18['query'][_0xecb6('0x5e')]));_0x34d7e9['attributes']=_0x34d7e9[_0xecb6('0x53')][_0xecb6('0x54')]?_0x34d7e9[_0xecb6('0x53')]:_0x181c10['model'];if(!_0x200e18[_0xecb6('0x52')]['hasOwnProperty'](_0xecb6('0x56'))){_0x34d7e9[_0xecb6('0x20')]=qs[_0xecb6('0x20')](_0x200e18['query'][_0xecb6('0x20')]);_0x34d7e9[_0xecb6('0x1e')]=qs[_0xecb6('0x1e')](_0x200e18[_0xecb6('0x52')][_0xecb6('0x1e')]);}_0x34d7e9[_0xecb6('0x57')]=qs[_0xecb6('0x58')](_0x200e18[_0xecb6('0x52')][_0xecb6('0x58')]);_0x34d7e9[_0xecb6('0x5a')]=qs[_0xecb6('0x50')](_[_0xecb6('0x59')](_0x200e18['query'],_0x181c10[_0xecb6('0x50')]));_0x34d7e9[_0xecb6('0x5a')][_0xecb6('0x6d')]=_0x19b621['id'];if(_0x200e18[_0xecb6('0x52')][_0xecb6('0x5c')]){_0x34d7e9[_0xecb6('0x5a')]=_[_0xecb6('0x61')](_0x34d7e9[_0xecb6('0x5a')],{'$or':_[_0xecb6('0x48')](_0x34d7e9[_0xecb6('0x53')],function(_0x1a4561){var _0x25cc77={};_0x25cc77[_0x1a4561]={'$like':'%'+_0x200e18[_0xecb6('0x52')][_0xecb6('0x5c')]+'%'};return _0x25cc77;})});}_0x34d7e9=_['merge']({},_0x34d7e9,_0x200e18[_0xecb6('0x5d')]);return db[_0xecb6('0x87')]['count']({'where':_0x34d7e9[_0xecb6('0x5a')]})[_0xecb6('0x11')](function(_0x4d6220){_0x3e6da6[_0xecb6('0x21')]=_0x4d6220;if(_0x200e18[_0xecb6('0x52')]['includeAll']){_0x34d7e9[_0xecb6('0x60')]=[{'model':db['CmContact'],'as':_0xecb6('0x8a'),'required':![]},{'model':db['User'],'as':_0xecb6('0x8b'),'attributes':[_0xecb6('0x4e'),'fullname',_0xecb6('0x8c')],'required':![]},{'model':db[_0xecb6('0x8d')],'as':_0xecb6('0x8e'),'attributes':['id',_0xecb6('0x4e'),'color'],'where':_0x200e18[_0xecb6('0x52')][_0xecb6('0x8f')]?{'id':_0x200e18[_0xecb6('0x52')][_0xecb6('0x8f')]}:undefined,'required':_0x200e18[_0xecb6('0x52')]['tag']?!![]:![]}];}return db[_0xecb6('0x87')][_0xecb6('0x6e')](_0x34d7e9);})['then'](function(_0x986c5){_0x3e6da6[_0xecb6('0x6f')]=_0x986c5;return _0x3e6da6;});}})['then'](respondWithFilteredResult(_0x31b685,_0x34d7e9))[_0xecb6('0x1a')](handleError(_0x31b685,null));};exports[_0xecb6('0x90')]=function addApplications(_0x21eefb,_0x254779){var _0x228661=_0x21eefb['params']['id'];var _0x1d767e=_0x21eefb[_0xecb6('0x62')];var _0x333864=0xc8;var _0x50af05=null;return db[_0xecb6('0x91')][_0xecb6('0x92')]({'isolationLevel':db[_0xecb6('0x91')][_0xecb6('0x93')]['ISOLATION_LEVELS'][_0xecb6('0x94')]},function(_0x539c4b){return db['MailAccount'][_0xecb6('0x73')]({'where':{'id':_0x228661},'transaction':_0x539c4b})[_0xecb6('0x11')](function(_0x150ed6){if(_0x150ed6){return db[_0xecb6('0x95')][_0xecb6('0x25')]({'where':{'MailAccountId':_0x228661},'transaction':_0x539c4b})['then'](function(){var _0x412835=_[_0xecb6('0x48')](_0x1d767e,function(_0x3c867b){_0x3c867b[_0xecb6('0x6d')]=_0x228661;return _0x3c867b;});return db[_0xecb6('0x95')]['bulkCreate'](_0x412835,{'transaction':_0x539c4b});});}else{_0x333864=0x194;_0x50af05=[];}});})[_0xecb6('0x11')](function(){if(_0x333864!==0x194){return db[_0xecb6('0x95')][_0xecb6('0x96')]({'where':{'MailAccountId':_0x228661},'order':_0xecb6('0x97')})[_0xecb6('0x11')](function(_0x4ca0e0){_0x50af05=_0x4ca0e0;});}})[_0xecb6('0x1a')](function(_0x33ad1e){_0x333864=0x1f4;logger[_0xecb6('0x17')](_0x33ad1e[_0xecb6('0x29')]);if(_0x33ad1e['name']){delete _0x33ad1e[_0xecb6('0x4e')];}_0x50af05=_0x33ad1e;})['finally'](function(){if(_0x50af05===null){_0x254779['sendStatus'](_0x333864);}else{if(_0x333864===0x1f4){_0x254779[_0xecb6('0x22')](_0x333864)[_0xecb6('0x2a')](_0x50af05);}else{_0x254779[_0xecb6('0x22')](_0x333864)[_0xecb6('0x1d')](_0x50af05);}}});};exports['getApplications']=function(_0x318684,_0x52f5f7){var _0x2ecd25={};var _0x5bff05={};var _0x29a8f1;var _0x5c8a19;return db['MailAccount']['findOne']({'where':{'id':_0x318684[_0xecb6('0x66')]['id']}})['then'](handleEntityNotFound(_0x52f5f7,null))[_0xecb6('0x11')](function(_0x508973){if(_0x508973){_0x29a8f1=_0x508973;_0x5bff05['model']=_[_0xecb6('0x4f')](db[_0xecb6('0x95')][_0xecb6('0x4a')]);_0x5bff05[_0xecb6('0x52')]=_[_0xecb6('0x4f')](_0x318684[_0xecb6('0x52')]);_0x5bff05[_0xecb6('0x50')]=_[_0xecb6('0x51')](_0x5bff05[_0xecb6('0x4d')],_0x5bff05['query']);_0x2ecd25[_0xecb6('0x53')]=_[_0xecb6('0x51')](_0x5bff05['model'],qs[_0xecb6('0x5e')](_0x318684[_0xecb6('0x52')][_0xecb6('0x5e')]));_0x2ecd25[_0xecb6('0x53')]=_0x2ecd25[_0xecb6('0x53')][_0xecb6('0x54')]?_0x2ecd25[_0xecb6('0x53')]:_0x5bff05[_0xecb6('0x4d')];_0x2ecd25[_0xecb6('0x57')]=qs['sort'](_0x318684[_0xecb6('0x52')][_0xecb6('0x58')]);_0x2ecd25[_0xecb6('0x5a')]=qs[_0xecb6('0x50')](_[_0xecb6('0x59')](_0x318684[_0xecb6('0x52')],_0x5bff05[_0xecb6('0x50')]));if(_0x318684['query'][_0xecb6('0x5c')]){_0x2ecd25[_0xecb6('0x5a')]=_[_0xecb6('0x61')](_0x2ecd25[_0xecb6('0x5a')],{'$or':_['map'](_0x2ecd25[_0xecb6('0x53')],function(_0x154f73){var _0x4b4ea2={};_0x4b4ea2[_0x154f73]={'$like':'%'+_0x318684[_0xecb6('0x52')][_0xecb6('0x5c')]+'%'};return _0x4b4ea2;})});}_0x2ecd25=_['merge']({},_0x2ecd25,_0x318684[_0xecb6('0x5d')]);return _0x29a8f1['getApplications'](_0x2ecd25);}})[_0xecb6('0x11')](function(_0x5b6560){if(_0x5b6560){_0x5c8a19=_0x5b6560[_0xecb6('0x54')];if(!_0x318684['query'][_0xecb6('0x55')](_0xecb6('0x56'))){_0x2ecd25[_0xecb6('0x20')]=qs[_0xecb6('0x20')](_0x318684['query']['limit']);_0x2ecd25[_0xecb6('0x1e')]=qs[_0xecb6('0x1e')](_0x318684['query']['offset']);}return _0x29a8f1[_0xecb6('0x98')](_0x2ecd25);}})[_0xecb6('0x11')](function(_0x3f76f9){if(_0x3f76f9){return _0x3f76f9?{'count':_0x5c8a19,'rows':_0x3f76f9}:null;}})['then'](respondWithResult(_0x52f5f7,null))[_0xecb6('0x1a')](handleError(_0x52f5f7,null));};exports[_0xecb6('0x99')]=function(_0x524e17,_0x4bd1da){var _0x704b57={'raw':!![],'where':{}};var _0x134d0c={};var _0x1955e5={'count':0x0,'rows':[]};return db[_0xecb6('0x49')][_0xecb6('0x73')]({'where':{'id':_0x524e17[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x4bd1da,null))[_0xecb6('0x11')](function(_0x25c959){if(_0x25c959){_0x134d0c[_0xecb6('0x4d')]=_[_0xecb6('0x4f')](db['MailMessage'][_0xecb6('0x4a')]);_0x134d0c[_0xecb6('0x52')]=_['keys'](_0x524e17[_0xecb6('0x52')]);_0x134d0c[_0xecb6('0x50')]=_['intersection'](_0x134d0c[_0xecb6('0x4d')],_0x134d0c[_0xecb6('0x52')]);_0x704b57['attributes']=_['intersection'](_0x134d0c[_0xecb6('0x4d')],qs[_0xecb6('0x5e')](_0x524e17[_0xecb6('0x52')][_0xecb6('0x5e')]));_0x704b57[_0xecb6('0x53')]=_0x704b57['attributes'][_0xecb6('0x54')]?_0x704b57['attributes']:_0x134d0c['model'];if(!_0x524e17[_0xecb6('0x52')][_0xecb6('0x55')]('nolimit')){_0x704b57[_0xecb6('0x20')]=qs['limit'](_0x524e17[_0xecb6('0x52')][_0xecb6('0x20')]);_0x704b57[_0xecb6('0x1e')]=qs['offset'](_0x524e17[_0xecb6('0x52')]['offset']);}_0x704b57[_0xecb6('0x57')]=qs['sort'](_0x524e17[_0xecb6('0x52')][_0xecb6('0x58')]);_0x704b57[_0xecb6('0x5a')]=qs['filters'](_['pick'](_0x524e17[_0xecb6('0x52')],_0x134d0c[_0xecb6('0x50')]));_0x704b57[_0xecb6('0x5a')][_0xecb6('0x6d')]=_0x25c959['id'];if(_0x524e17[_0xecb6('0x52')][_0xecb6('0x5c')]){_0x704b57[_0xecb6('0x5a')]=_['merge'](_0x704b57[_0xecb6('0x5a')],{'$or':_['map'](_0x704b57[_0xecb6('0x53')],function(_0x14ba4d){var _0x3eaf25={};_0x3eaf25[_0x14ba4d]={'$like':'%'+_0x524e17[_0xecb6('0x52')]['filter']+'%'};return _0x3eaf25;})});}if(_0x524e17['query'][_0xecb6('0x9a')]){var _0xd58428=_0x524e17[_0xecb6('0x52')]['$gte'][_0xecb6('0x9b')](',');var _0x4834f2={};_0x4834f2[_0xd58428[0x0]]={'$gte':moment(_0xd58428[0x1])['format'](_0xecb6('0x9c'))};_0x704b57[_0xecb6('0x5a')]=_[_0xecb6('0x61')](_0x704b57[_0xecb6('0x5a')],_0x4834f2);}_0x704b57=_[_0xecb6('0x61')]({},_0x704b57,_0x524e17[_0xecb6('0x5d')]);return db['MailMessage'][_0xecb6('0x21')]({'where':_0x704b57['where']})['then'](function(_0xf8032){_0x1955e5[_0xecb6('0x21')]=_0xf8032;if(_0x524e17[_0xecb6('0x52')][_0xecb6('0x5f')]){_0x704b57[_0xecb6('0x60')]=[{'all':!![]}];}return db[_0xecb6('0x9d')][_0xecb6('0x6e')](_0x704b57);})[_0xecb6('0x11')](function(_0x334a83){if(_0x524e17[_0xecb6('0x52')][_0xecb6('0x9e')]==='true'){for(var _0x1f72b2=0x0;_0x1f72b2<_0x334a83['length'];_0x1f72b2++){_0x334a83[_0x1f72b2]['body']=juice(_0x334a83[_0x1f72b2][_0xecb6('0x62')]);}}_0x1955e5[_0xecb6('0x6f')]=_0x334a83;return _0x1955e5;});}})[_0xecb6('0x11')](respondWithFilteredResult(_0x4bd1da,_0x704b57))[_0xecb6('0x1a')](handleError(_0x4bd1da,null));};exports['send']=function(_0x58858d,_0x584af0){var _0x1a53cb,_0x72caa4={},_0x574fa1;if(_0x58858d[_0xecb6('0x62')]['to']){_0x574fa1=_0x58858d[_0xecb6('0x62')]['to'][_0xecb6('0x9b')](',')[0x0];}return db[_0xecb6('0x49')][_0xecb6('0x65')]({'where':{'id':_0x58858d[_0xecb6('0x66')]['id']},'include':[{'model':db[_0xecb6('0x9f')],'as':_0xecb6('0xa0'),'include':[{'model':db['CmContact'],'as':_0xecb6('0xa1'),'where':{'email':_0x574fa1},'limit':0x1,'order':[[_0xecb6('0xa2'),_0xecb6('0xa3')]]}]},{'model':db[_0xecb6('0x45')],'as':_0xecb6('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xecb6('0x11')](handleEntityNotFound(_0x584af0,null))[_0xecb6('0x11')](function(_0x3b68af){if(!_0x3b68af)return;_0x1a53cb=_0x3b68af;if(!_0x3b68af[_0xecb6('0x42')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0xecb6('0x79')](_0x58858d[_0xecb6('0x62')][_0xecb6('0xa4')])){_0x58858d['body'][_0xecb6('0xa4')]=util[_0xecb6('0xa5')](_0xecb6('0xa6'),_0x3b68af[_0xecb6('0x4e')],_0x3b68af[_0xecb6('0x77')]||_0x3b68af[_0xecb6('0x42')][_0xecb6('0x37')]);}if(_0x58858d[_0xecb6('0x62')]['attachments']&&_0x58858d[_0xecb6('0x62')][_0xecb6('0xa7')][_0xecb6('0x54')]){for(var _0x7a1500=0x0;_0x7a1500<_0x58858d[_0xecb6('0x62')][_0xecb6('0xa7')]['length'];_0x7a1500+=0x1){_0x58858d[_0xecb6('0x62')][_0xecb6('0xa7')][_0x7a1500]={'filename':_0x58858d[_0xecb6('0x62')][_0xecb6('0xa7')][_0x7a1500][_0xecb6('0x4e')],'path':path[_0xecb6('0xa8')](config[_0xecb6('0xa9')],_0xecb6('0xaa'),_0x58858d[_0xecb6('0x62')][_0xecb6('0xa7')][_0x7a1500][_0xecb6('0xab')])};}}var _0x58f36d=_0x3b68af[_0xecb6('0xac')]();return respondWithRpcPromise('SendMail',_0xecb6('0xad'),{'account':_0x58f36d,'message':_0x58858d['body']});})[_0xecb6('0x11')](function(_0x577d34){if(!_0x577d34)return;_0x72caa4=_0x577d34;if(!_0x1a53cb['List'])throw new Error('List\x20not\x20found');if(_0x1a53cb['List'][_0xecb6('0xa1')][_0xecb6('0x54')])return _0x1a53cb['List']['Contacts'][0x0];return db['CmContact'][_0xecb6('0x6b')](_[_0xecb6('0xa')](_0x58858d['body'],{'firstName':_0x58858d[_0xecb6('0x62')]['to'],'email':_0x58858d['body']['to'],'phone':_0x58858d['body']['to'],'ListId':_0x1a53cb['ListId']}));})[_0xecb6('0x11')](function(_0x4e0803){if(!_0x4e0803)return;var _0x1b0703={'UserId':_0x58858d[_0xecb6('0x37')]['id'],'ContactId':_0x4e0803['id'],'MailAccountId':_0x1a53cb['id'],'inReplyTo':_0x72caa4[_0xecb6('0xae')],'to':_0x58858d['body'][_0xecb6('0xa4')],'cc':_0x58858d[_0xecb6('0x62')]['cc'],'subject':_0x58858d[_0xecb6('0x62')][_0xecb6('0xaf')],'attach':_0x58858d[_0xecb6('0x62')][_0xecb6('0xb0')],'firstMsgDirection':_0xecb6('0xb1'),'lastMsgAt':moment()['format'](_0xecb6('0x9c')),'lastMsgDirection':_0xecb6('0xb1'),'Messages':[_[_0xecb6('0x61')](_0x58858d[_0xecb6('0x62')],{'messageId':_0x72caa4[_0xecb6('0xae')],'sentAt':moment()[_0xecb6('0xa5')](_0xecb6('0x9c')),'read':!![],'MailAccountId':_0x1a53cb['id'],'UserId':_0x58858d[_0xecb6('0x37')]['id'],'ContactId':_0x4e0803['id']})]};if(_0x58858d[_0xecb6('0x62')]['Interaction']){_0x1b0703=_[_0xecb6('0x61')](_0x1b0703,_0x58858d[_0xecb6('0x62')][_0xecb6('0xb2')]);}return db[_0xecb6('0x87')][_0xecb6('0x6b')](_0x1b0703,{'include':[{'model':db[_0xecb6('0x9d')],'as':_0xecb6('0xb3')}]});})[_0xecb6('0x11')](respondWithResult(_0x584af0,null))[_0xecb6('0x1a')](handleError(_0x584af0,null));};exports['verifySmtp']=function(_0x491d75,_0x487683){return db[_0xecb6('0x49')][_0xecb6('0x65')]({'where':{'id':_0x491d75[_0xecb6('0x66')]['id']},'include':[{'model':db[_0xecb6('0x45')],'as':_0xecb6('0x42'),'raw':!![],'include':[{'model':db[_0xecb6('0xb4')],'as':_0xecb6('0xb4'),'raw':!![]}]}]})[_0xecb6('0x11')](handleEntityNotFound(_0x487683,null))[_0xecb6('0x11')](function(_0x5383d0){if(!_0x5383d0[_0xecb6('0x42')])return;var _0x5f5bad=_0x5383d0[_0xecb6('0xac')]();return respondWithRpcPromise('VerifySmtp',_0xecb6('0xb5'),{'account':_0x5f5bad});})['then'](respondWithResult(_0x487683,null))[_0xecb6('0x1a')](handleError(_0x487683,null));};exports['destroy']=function(_0x2af37c,_0x148257){return db[_0xecb6('0x49')][_0xecb6('0x65')]({'where':{'id':_0x2af37c[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x148257,null))['then'](function(_0x3b187c){if(_0x3b187c&&_0x3b187c['service']){throw new db[(_0xecb6('0xb6'))][(_0xecb6('0xb7'))](_0xecb6('0xb8'));}return _0x3b187c;})[_0xecb6('0x11')](removeEntity(_0x148257,null))[_0xecb6('0x1a')](handleError(_0x148257,null));};exports[_0xecb6('0xb9')]=function(_0xc79daa,_0x2fd67f){return db[_0xecb6('0x49')]['find']({'where':{'id':_0xc79daa[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x2fd67f,null))[_0xecb6('0x11')](function(_0x2f46cf){if(_0x2f46cf){return _0x2f46cf[_0xecb6('0xb9')](_0xc79daa['body'][_0xecb6('0x71')],_[_0xecb6('0x88')](_0xc79daa[_0xecb6('0x62')],['ids','id'])||{})['spread'](function(_0x3e5ad5){for(var _0x24357c=0x0;_0x24357c<_0xc79daa[_0xecb6('0x62')][_0xecb6('0x71')][_0xecb6('0x54')];_0x24357c+=0x1){socket[_0xecb6('0xba')]('userMailAccount:save',{'UserId':Number(_0xc79daa[_0xecb6('0x62')]['ids'][_0x24357c]),'MailAccountId':Number(_0xc79daa[_0xecb6('0x66')]['id'])});}return _0x3e5ad5;});}})['then'](respondWithResult(_0x2fd67f,null))[_0xecb6('0x1a')](handleError(_0x2fd67f,null));};exports['removeAgents']=function(_0x1fcd1d,_0x1b4261){return db[_0xecb6('0x49')]['find']({'where':{'id':_0x1fcd1d[_0xecb6('0x66')]['id']}})[_0xecb6('0x11')](handleEntityNotFound(_0x1b4261,null))[_0xecb6('0x11')](function(_0x571823){if(_0x571823){return _0x571823[_0xecb6('0xbb')](_0x1fcd1d[_0xecb6('0x52')][_0xecb6('0x71')])[_0xecb6('0x11')](function(){if(_[_0xecb6('0xbc')](_0x1fcd1d[_0xecb6('0x52')][_0xecb6('0x71')])){for(var _0x224453=0x0;_0x224453<_0x1fcd1d[_0xecb6('0x52')][_0xecb6('0x71')][_0xecb6('0x54')];_0x224453+=0x1){socket[_0xecb6('0xba')](_0xecb6('0xbd'),{'UserId':Number(_0x1fcd1d['query'][_0xecb6('0x71')][_0x224453]),'MailAccountId':Number(_0x1fcd1d[_0xecb6('0x66')]['id'])});}}else{socket[_0xecb6('0xba')](_0xecb6('0xbd'),{'UserId':Number(_0x1fcd1d[_0xecb6('0x52')]['ids']),'MailAccountId':Number(_0x1fcd1d[_0xecb6('0x66')]['id'])});}});}})[_0xecb6('0x11')](respondWithStatusCode(_0x1b4261,null))[_0xecb6('0x1a')](handleError(_0x1b4261,null));};exports['getAgents']=function(_0x37a092,_0x240774){var _0x55da4f={};var _0x2c5045={};var _0x1d697c;var _0x4875dd;return db[_0xecb6('0x49')][_0xecb6('0x73')]({'where':{'id':_0x37a092[_0xecb6('0x66')]['id']}})['then'](handleEntityNotFound(_0x240774,null))[_0xecb6('0x11')](function(_0x3f7344){if(_0x3f7344){_0x1d697c=_0x3f7344;_0x2c5045[_0xecb6('0x4d')]=_[_0xecb6('0x4f')](db[_0xecb6('0xbe')][_0xecb6('0x4a')]);_0x2c5045[_0xecb6('0x52')]=_['keys'](_0x37a092[_0xecb6('0x52')]);_0x2c5045[_0xecb6('0x50')]=_['intersection'](_0x2c5045[_0xecb6('0x4d')],_0x2c5045[_0xecb6('0x52')]);_0x55da4f[_0xecb6('0x53')]=_[_0xecb6('0x51')](_0x2c5045[_0xecb6('0x4d')],qs[_0xecb6('0x5e')](_0x37a092[_0xecb6('0x52')][_0xecb6('0x5e')]));_0x55da4f['attributes']=_0x55da4f[_0xecb6('0x53')][_0xecb6('0x54')]?_0x55da4f[_0xecb6('0x53')]:_0x2c5045[_0xecb6('0x4d')];_0x55da4f[_0xecb6('0x57')]=qs[_0xecb6('0x58')](_0x37a092[_0xecb6('0x52')][_0xecb6('0x58')]);_0x55da4f[_0xecb6('0x5a')]=qs[_0xecb6('0x50')](_[_0xecb6('0x59')](_0x37a092[_0xecb6('0x52')],_0x2c5045[_0xecb6('0x50')]));if(_0x37a092[_0xecb6('0x52')]['filter']){_0x55da4f[_0xecb6('0x5a')]=_[_0xecb6('0x61')](_0x55da4f['where'],{'$or':_['map'](_0x55da4f[_0xecb6('0x53')],function(_0x32e63a){var _0x11d17d={};_0x11d17d[_0x32e63a]={'$like':'%'+_0x37a092[_0xecb6('0x52')][_0xecb6('0x5c')]+'%'};return _0x11d17d;})});}_0x55da4f=_['merge']({},_0x55da4f,_0x37a092['options']);return _0x1d697c['getAgents'](_0x55da4f);}})[_0xecb6('0x11')](function(_0x5236d1){if(_0x5236d1){_0x4875dd=_0x5236d1['length'];if(!_0x37a092['query']['hasOwnProperty'](_0xecb6('0x56'))){_0x55da4f[_0xecb6('0x20')]=qs['limit'](_0x37a092[_0xecb6('0x52')][_0xecb6('0x20')]);_0x55da4f[_0xecb6('0x1e')]=qs[_0xecb6('0x1e')](_0x37a092[_0xecb6('0x52')][_0xecb6('0x1e')]);}return _0x1d697c['getAgents'](_0x55da4f);}})[_0xecb6('0x11')](function(_0x231d12){if(_0x231d12){return _0x231d12?{'count':_0x4875dd,'rows':_0x231d12}:null;}})['then'](respondWithResult(_0x240774,null))[_0xecb6('0x1a')](handleError(_0x240774,null));}; \ No newline at end of file +var _0xb694=['modernAuthentication','CloudProviderId','host','service','authentication','Imap','port','Smtp','MailServerOut','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','MailAccount','include','findAll','catch','show','params','mandatoryDispositionPause','rawAttributes','includeAll','find','body','provider','custom','MailServerIn','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','rows','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','color','tag','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','Contacts','updatedAt','DESC','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','server/files/attachments','getSmtpOptions','List','List\x20not\x20found','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','CloudProvider','VerifySmtp','Sequelize','ValidationError','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','moment','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','sendStatus','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','user','username','pass','password'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xb694,0x144));var _0x4b69=function(_0x362916,_0x46268a){_0x362916=_0x362916-0x0;var _0x8cb45a=_0xb694[_0x362916];return _0x8cb45a;};'use strict';var moment=require(_0x4b69('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x4b69('0x1'));var _=require('lodash');var juice=require('juice');var Redis=require(_0x4b69('0x2'));var qs=require(_0x4b69('0x3'));var logger=require(_0x4b69('0x4'))(_0x4b69('0x5'));var config=require(_0x4b69('0x6'));var db=require(_0x4b69('0x7'))['db'];config[_0x4b69('0x8')]=_[_0x4b69('0x9')](config[_0x4b69('0x8')],{'host':_0x4b69('0xa'),'port':0x18eb});var socket=require(_0x4b69('0xb'))(new Redis(config[_0x4b69('0x8')]));require(_0x4b69('0xc'))[_0x4b69('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4b69('0xe')][_0x4b69('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x2db054,_0x18c07c,_0x1674ea,_0x4e5315){return new BPromise(function(_0x3a8bd6,_0x5b1d3c){var _0x29bc84=_0x4e5315||client;return _0x29bc84[_0x4b69('0x10')](_0x2db054,_0x1674ea)[_0x4b69('0x11')](function(_0x4d1bcc){logger[_0x4b69('0x12')](_0x4b69('0x13'),_0x18c07c,_0x4b69('0x14'));logger['debug'](_0x4b69('0x15'),_0x18c07c,_0x4b69('0x14'),JSON[_0x4b69('0x16')](_0x4d1bcc));if(_0x4d1bcc[_0x4b69('0x17')]){if(_0x4d1bcc[_0x4b69('0x17')][_0x4b69('0x18')]===0x1f4){logger[_0x4b69('0x17')]('MailAccount,\x20%s,\x20%s',_0x18c07c,_0x4d1bcc[_0x4b69('0x17')]['message']);return _0x5b1d3c(_0x4d1bcc[_0x4b69('0x17')]['message']);}logger[_0x4b69('0x17')](_0x4b69('0x13'),_0x18c07c,_0x4d1bcc[_0x4b69('0x17')]['message']);return _0x3a8bd6(_0x4d1bcc[_0x4b69('0x17')][_0x4b69('0x19')]);}else{logger[_0x4b69('0x12')](_0x4b69('0x13'),_0x18c07c,_0x4b69('0x14'));_0x3a8bd6(_0x4d1bcc[_0x4b69('0x1a')]['message']);}})['catch'](function(_0x1014b7){logger[_0x4b69('0x17')](_0x4b69('0x13'),_0x18c07c,_0x1014b7);_0x5b1d3c(_0x1014b7);});});}function respondWithStatusCode(_0xff6649,_0x3c0575){_0x3c0575=_0x3c0575||0xcc;return function(_0x5052c0){if(_0x5052c0){return _0xff6649['sendStatus'](_0x3c0575);}return _0xff6649['status'](_0x3c0575)['end']();};}function respondWithResult(_0x4dc347,_0x450d30){_0x450d30=_0x450d30||0xc8;return function(_0x4cc704){if(_0x4cc704){return _0x4dc347[_0x4b69('0x1b')](_0x450d30)[_0x4b69('0x1c')](_0x4cc704);}};}function respondWithFilteredResult(_0x1290f7,_0x2e6de0){return function(_0x77091a){if(_0x77091a){var _0x52ed2b=typeof _0x2e6de0[_0x4b69('0x1d')]===_0x4b69('0x1e')&&typeof _0x2e6de0[_0x4b69('0x1f')]===_0x4b69('0x1e');var _0x332ec2=_0x77091a[_0x4b69('0x20')];var _0x11fad9=_0x52ed2b?0x0:_0x2e6de0[_0x4b69('0x1d')];var _0x321296=_0x52ed2b?_0x77091a[_0x4b69('0x20')]:_0x2e6de0[_0x4b69('0x1d')]+_0x2e6de0[_0x4b69('0x1f')];var _0x3fcada;if(_0x321296>=_0x332ec2){_0x321296=_0x332ec2;_0x3fcada=0xc8;}else{_0x3fcada=0xce;}_0x1290f7[_0x4b69('0x1b')](_0x3fcada);return _0x1290f7['set'](_0x4b69('0x21'),_0x11fad9+'-'+_0x321296+'/'+_0x332ec2)['json'](_0x77091a);}return null;};}function saveUpdates(_0x4ed40e){return function(_0x5d24ed){if(_0x5d24ed){return _0x5d24ed[_0x4b69('0x22')](_0x4ed40e)[_0x4b69('0x11')](function(_0x3ca2c0){return _0x3ca2c0;});}return null;};}function removeEntity(_0x3a515e){return function(_0x1559f3){if(_0x1559f3){return _0x1559f3[_0x4b69('0x23')]()[_0x4b69('0x11')](function(){var _0x15e2b7=_0x1559f3['get']({'plain':!![]});var _0x165cbf='MailAccounts';return db['UserProfileResource'][_0x4b69('0x23')]({'where':{'type':_0x165cbf,'resourceId':_0x15e2b7['id']}})[_0x4b69('0x11')](function(){return _0x1559f3;});})['then'](function(){_0x3a515e[_0x4b69('0x1b')](0xcc)[_0x4b69('0x24')]();});}};}function handleEntityNotFound(_0x36c049){return function(_0x4b8fd1){if(!_0x4b8fd1){_0x36c049[_0x4b69('0x25')](0x194);}return _0x4b8fd1;};}function handleError(_0x450e17,_0x430485){_0x430485=_0x430485||0x1f4;return function(_0x562a53){logger[_0x4b69('0x17')](_0x562a53[_0x4b69('0x26')]);if(_0x562a53[_0x4b69('0x27')]){delete _0x562a53[_0x4b69('0x27')];}_0x450e17[_0x4b69('0x1b')](_0x430485)[_0x4b69('0x28')](_0x562a53);};}function getImapHost(_0x562728){switch(_0x562728){case _0x4b69('0x29'):return _0x4b69('0x2a');case _0x4b69('0x2b'):return'imap.mail.yahoo.com';case _0x4b69('0x2c'):return _0x4b69('0x2d');case'outlook365':return _0x4b69('0x2e');}throw new Error(_0x4b69('0x2f'),_0x562728);}function getSmtpHost(_0x19f4c6){switch(_0x19f4c6){case'gmail':return _0x4b69('0x30');case'yahoo':return _0x4b69('0x31');case'hotmail':return _0x4b69('0x32');case _0x4b69('0x33'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x19f4c6);}function getAuthenticationOptions(_0xb9686b,_0x5b04ed){var _0x24db83={};var _0x2e7d4d={};if(_0xb9686b){_0x24db83[_0x4b69('0x34')]=_0x2e7d4d[_0x4b69('0x34')]=_0x5b04ed[_0x4b69('0x35')];_0x24db83['password']=_0x2e7d4d[_0x4b69('0x36')]=_0x5b04ed[_0x4b69('0x37')];if(_0x5b04ed[_0x4b69('0x38')]){_0x24db83[_0x4b69('0x38')]=_0x2e7d4d['modernAuthentication']=!![];_0x24db83[_0x4b69('0x39')]=_0x2e7d4d[_0x4b69('0x39')]=_0x5b04ed[_0x4b69('0x39')];_0x24db83['password']=_0x2e7d4d[_0x4b69('0x36')]=null;}else{_0x24db83['CloudProviderId']=_0x2e7d4d[_0x4b69('0x39')]=null;}_0x24db83[_0x4b69('0x3a')]=getImapHost(_0xb9686b);_0x24db83['port']=0x3e1;_0x2e7d4d['host']=getSmtpHost(_0xb9686b);_0x2e7d4d['port']=0x24b;_0x2e7d4d['secure']=![];_0x24db83[_0x4b69('0x3b')]=_0x2e7d4d[_0x4b69('0x3b')]=null;}else{if(_0x5b04ed['authentication']){_0x24db83[_0x4b69('0x34')]=_0x2e7d4d[_0x4b69('0x34')]=_0x5b04ed[_0x4b69('0x35')];_0x24db83['password']=_0x2e7d4d[_0x4b69('0x36')]=_0x5b04ed[_0x4b69('0x37')];}else{_0x24db83[_0x4b69('0x3c')]=_0x2e7d4d[_0x4b69('0x3c')]=![];_0x24db83[_0x4b69('0x34')]=_0x2e7d4d[_0x4b69('0x34')]=null;_0x24db83[_0x4b69('0x37')]=_0x2e7d4d[_0x4b69('0x36')]=null;}_0x24db83[_0x4b69('0x3a')]=_0x5b04ed[_0x4b69('0x3d')][_0x4b69('0x3a')];_0x24db83[_0x4b69('0x3e')]=_0x5b04ed[_0x4b69('0x3d')][_0x4b69('0x3e')];_0x2e7d4d[_0x4b69('0x3a')]=_0x5b04ed[_0x4b69('0x3f')][_0x4b69('0x3a')];_0x2e7d4d[_0x4b69('0x3e')]=_0x5b04ed[_0x4b69('0x3f')][_0x4b69('0x3e')];}return{'Imap':_0x24db83,'Smtp':_0x2e7d4d};}exports['index']=function(_0x4c7806,_0x2cd66f){var _0xe2a681={'include':[{'model':db['MailServerIn'],'as':_0x4b69('0x3d')},{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5cfc2b={},_0x1a70c0={'count':0x0,'rows':[]};var _0x95c418=_['map'](db['MailAccount']['rawAttributes'],function(_0x12e67c){return{'name':_0x12e67c[_0x4b69('0x41')],'type':_0x12e67c[_0x4b69('0x42')][_0x4b69('0x43')]};});_0x5cfc2b['model']=_[_0x4b69('0x44')](_0x95c418,_0x4b69('0x27'));_0x5cfc2b[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x4c7806['query']);_0x5cfc2b['filters']=_[_0x4b69('0x47')](_0x5cfc2b[_0x4b69('0x48')],_0x5cfc2b['query']);_0xe2a681['attributes']=_[_0x4b69('0x47')](_0x5cfc2b[_0x4b69('0x48')],qs[_0x4b69('0x49')](_0x4c7806[_0x4b69('0x45')][_0x4b69('0x49')]));_0xe2a681[_0x4b69('0x4a')]=_0xe2a681['attributes'][_0x4b69('0x4b')]?_0xe2a681['attributes']:_0x5cfc2b['model'];if(!_0x4c7806[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0xe2a681[_0x4b69('0x1f')]=qs['limit'](_0x4c7806[_0x4b69('0x45')]['limit']);_0xe2a681[_0x4b69('0x1d')]=qs[_0x4b69('0x1d')](_0x4c7806[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0xe2a681[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x4c7806[_0x4b69('0x45')][_0x4b69('0x4f')]);_0xe2a681[_0x4b69('0x50')]=qs['filters'](_[_0x4b69('0x51')](_0x4c7806[_0x4b69('0x45')],_0x5cfc2b[_0x4b69('0x52')]),_0x95c418);if(_0x4c7806[_0x4b69('0x45')][_0x4b69('0x53')]){_0xe2a681[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0xe2a681[_0x4b69('0x50')],{'$or':_['map'](_0x95c418,function(_0x27a5cf){if(_0x27a5cf[_0x4b69('0x42')]!=='VIRTUAL'){var _0x2db6d6={};_0x2db6d6[_0x27a5cf[_0x4b69('0x27')]]={'$like':'%'+_0x4c7806[_0x4b69('0x45')]['filter']+'%'};return _0x2db6d6;}})});}_0xe2a681=_[_0x4b69('0x54')]({},_0xe2a681,_0x4c7806[_0x4b69('0x55')]);var _0x324d9a={'where':_0xe2a681[_0x4b69('0x50')]};return db[_0x4b69('0x56')][_0x4b69('0x20')](_0x324d9a)[_0x4b69('0x11')](function(_0x1aca1f){_0x1a70c0['count']=_0x1aca1f;if(_0x4c7806[_0x4b69('0x45')]['includeAll']){_0xe2a681[_0x4b69('0x57')]=[{'all':!![]}];}return db[_0x4b69('0x56')][_0x4b69('0x58')](_0xe2a681);})[_0x4b69('0x11')](function(_0x3b409f){_0x1a70c0['rows']=_0x3b409f;return _0x1a70c0;})['then'](respondWithFilteredResult(_0x2cd66f,_0xe2a681))[_0x4b69('0x59')](handleError(_0x2cd66f,null));};exports[_0x4b69('0x5a')]=function(_0x514324,_0x15cb2c){var _0x726b9e={'raw':![],'where':{'id':_0x514324[_0x4b69('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x4b69('0x3d')},{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f')},{'model':db['Pause'],'as':_0x4b69('0x5c')}]},_0x14cbde={};_0x14cbde[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x56')][_0x4b69('0x5d')]);_0x14cbde[_0x4b69('0x45')]=_['keys'](_0x514324[_0x4b69('0x45')]);_0x14cbde[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x14cbde[_0x4b69('0x48')],_0x14cbde['query']);_0x726b9e['attributes']=_[_0x4b69('0x47')](_0x14cbde['model'],qs['fields'](_0x514324[_0x4b69('0x45')][_0x4b69('0x49')]));_0x726b9e[_0x4b69('0x4a')]=_0x726b9e['attributes'][_0x4b69('0x4b')]?_0x726b9e['attributes']:_0x14cbde[_0x4b69('0x48')];if(_0x514324['query'][_0x4b69('0x5e')]){_0x726b9e['include']=[{'all':!![]}];}_0x726b9e=_[_0x4b69('0x54')]({},_0x726b9e,_0x514324[_0x4b69('0x55')]);return db[_0x4b69('0x56')][_0x4b69('0x5f')](_0x726b9e)[_0x4b69('0x11')](handleEntityNotFound(_0x15cb2c,null))[_0x4b69('0x11')](respondWithResult(_0x15cb2c,null))[_0x4b69('0x59')](handleError(_0x15cb2c,null));};exports[_0x4b69('0x22')]=function(_0x5d75b4,_0x3f275d){if(_0x5d75b4[_0x4b69('0x60')]['id']){delete _0x5d75b4[_0x4b69('0x60')]['id'];}var _0x39aa0b=_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x61')]===_0x4b69('0x62')?null:_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x61')];var _0x4c255e=_0x5d75b4[_0x4b69('0x60')]['Imap']||{};var _0x5ac073=_0x5d75b4['body'][_0x4b69('0x3f')]||{};if(_0x39aa0b){_0x4c255e[_0x4b69('0x3a')]=getImapHost(_0x39aa0b);_0x4c255e[_0x4b69('0x3e')]=0x3e1;_0x5ac073['host']=getSmtpHost(_0x39aa0b);_0x5ac073[_0x4b69('0x3e')]=0x24b;_0x5ac073['secure']=![];}if(_0x5ac073[_0x4b69('0x38')]){_0x5ac073['secure']=![];}else{_0x5ac073[_0x4b69('0x39')]=null;}if(!_0x4c255e[_0x4b69('0x38')])_0x4c255e[_0x4b69('0x39')]=null;_0x5d75b4['body'][_0x4b69('0x3d')]=_0x4c255e;_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x3f')]=_0x5ac073;return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x5d75b4[_0x4b69('0x5b')]['id']},'include':[{'model':db[_0x4b69('0x63')],'as':_0x4b69('0x3d')},{'model':db['MailServerOut'],'as':_0x4b69('0x3f')},{'model':db['Pause'],'as':_0x4b69('0x5c')}]})[_0x4b69('0x11')](handleEntityNotFound(_0x3f275d,null))[_0x4b69('0x11')](function(_0x31d9eb){if(!_0x31d9eb)throw new Error('Mail\x20Account\x20not\x20found');if(_0x31d9eb[_0x4b69('0x3b')])delete _0x5d75b4[_0x4b69('0x60')][_0x4b69('0x3d')];return _0x31d9eb;})[_0x4b69('0x11')](saveUpdates(_0x5d75b4[_0x4b69('0x60')],null))['then'](function(_0x1856a5){if(!_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x3d')])return _0x1856a5;return db[_0x4b69('0x63')]['update'](_0x5d75b4['body'][_0x4b69('0x3d')],{'where':{'MailAccountId':_0x1856a5['id']}})[_0x4b69('0x11')](function(){return _0x1856a5;});})['then'](function(_0x294484){if(!_0x5d75b4['body'][_0x4b69('0x3f')])return _0x294484;return db['MailServerOut'][_0x4b69('0x22')](_0x5d75b4['body'][_0x4b69('0x3f')],{'where':{'MailAccountId':_0x294484['id']}})[_0x4b69('0x11')](function(){return _0x294484;});})['then'](respondWithResult(_0x3f275d,null))['catch'](handleError(_0x3f275d,null));};exports[_0x4b69('0x64')]=function(_0x148d3e,_0x490943){return db['MailAccount'][_0x4b69('0x64')]()['then'](respondWithResult(_0x490943,null))[_0x4b69('0x59')](handleError(_0x490943,null));};exports[_0x4b69('0x65')]=function(_0x46f19a,_0x232e7b){if(_0x46f19a[_0x4b69('0x60')]['id']){delete _0x46f19a['body']['id'];}return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x46f19a['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x232e7b,null))['then'](function(_0x5b5fe3){if(_0x5b5fe3){_0x46f19a[_0x4b69('0x60')][_0x4b69('0x66')]=_0x5b5fe3['id'];return db['Disposition'][_0x4b69('0x67')](_0x46f19a[_0x4b69('0x60')]);}})['then'](respondWithResult(_0x232e7b,null))[_0x4b69('0x59')](handleError(_0x232e7b,null));};exports[_0x4b69('0x68')]=function(_0x120105,_0x57799d){var _0x5ab5d7={'raw':![],'where':{}};var _0x2d2caf={};var _0x299460={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x120105[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x57799d,null))['then'](function(_0x34f87e){if(_0x34f87e){_0x2d2caf['model']=_[_0x4b69('0x46')](db['Disposition'][_0x4b69('0x5d')]);_0x2d2caf[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x120105[_0x4b69('0x45')]);_0x2d2caf[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x2d2caf[_0x4b69('0x48')],_0x2d2caf[_0x4b69('0x45')]);_0x5ab5d7['attributes']=_['intersection'](_0x2d2caf[_0x4b69('0x48')],qs['fields'](_0x120105[_0x4b69('0x45')]['fields']));_0x5ab5d7[_0x4b69('0x4a')]=_0x5ab5d7[_0x4b69('0x4a')][_0x4b69('0x4b')]?_0x5ab5d7[_0x4b69('0x4a')]:_0x2d2caf[_0x4b69('0x48')];if(!_0x120105[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x5ab5d7[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x120105[_0x4b69('0x45')][_0x4b69('0x1f')]);_0x5ab5d7[_0x4b69('0x1d')]=qs[_0x4b69('0x1d')](_0x120105[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0x5ab5d7['order']=qs[_0x4b69('0x4f')](_0x120105[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x5ab5d7[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x120105[_0x4b69('0x45')],_0x2d2caf['filters']));_0x5ab5d7[_0x4b69('0x50')]['MailAccountId']=_0x34f87e['id'];if(_0x120105[_0x4b69('0x45')][_0x4b69('0x53')]){_0x5ab5d7[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0x5ab5d7[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x5ab5d7[_0x4b69('0x4a')],function(_0x5b9f3c){var _0x18ac78={};_0x18ac78[_0x5b9f3c]={'$like':'%'+_0x120105[_0x4b69('0x45')][_0x4b69('0x53')]+'%'};return _0x18ac78;})});}_0x5ab5d7=_[_0x4b69('0x54')]({},_0x5ab5d7,_0x120105[_0x4b69('0x55')]);return db['Disposition']['count']({'where':_0x5ab5d7[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x4c7f54){_0x299460[_0x4b69('0x20')]=_0x4c7f54;if(_0x120105[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x5ab5d7[_0x4b69('0x57')]=[{'all':!![]}];}return db[_0x4b69('0x69')][_0x4b69('0x58')](_0x5ab5d7);})[_0x4b69('0x11')](function(_0x3c6be6){_0x299460[_0x4b69('0x6a')]=_0x3c6be6;return _0x299460;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x57799d,_0x5ab5d7))[_0x4b69('0x59')](handleError(_0x57799d,null));};exports[_0x4b69('0x6b')]=function(_0x1f3b55,_0x483ce7){return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x1f3b55[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x483ce7,null))['then'](function(_0x148d95){if(_0x148d95){return _0x148d95[_0x4b69('0x6b')](_0x1f3b55['query']['ids']);}})[_0x4b69('0x11')](respondWithStatusCode(_0x483ce7,null))[_0x4b69('0x59')](handleError(_0x483ce7,null));};exports[_0x4b69('0x6c')]=function(_0x4368d4,_0x3af8e1){if(_0x4368d4['body']['id']){delete _0x4368d4['body']['id'];}return db['MailAccount'][_0x4b69('0x5f')]({'where':{'id':_0x4368d4[_0x4b69('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3af8e1,null))[_0x4b69('0x11')](function(_0x56ba96){if(_0x56ba96){_0x4368d4['body']['MailAccountId']=_0x56ba96['id'];return db['CannedAnswer'][_0x4b69('0x67')](_0x4368d4['body']);}})[_0x4b69('0x11')](respondWithResult(_0x3af8e1,null))[_0x4b69('0x59')](handleError(_0x3af8e1,null));};exports[_0x4b69('0x6d')]=function(_0x5a6eff,_0x360bab){var _0x1f1acf={'raw':![],'where':{}};var _0x13eebb={};var _0x22d938={'count':0x0,'rows':[]};return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x5a6eff[_0x4b69('0x5b')]['id']}})['then'](handleEntityNotFound(_0x360bab,null))['then'](function(_0x3434c6){if(_0x3434c6){_0x13eebb[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x6f')]['rawAttributes']);_0x13eebb[_0x4b69('0x45')]=_['keys'](_0x5a6eff[_0x4b69('0x45')]);_0x13eebb[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x13eebb['model'],_0x13eebb['query']);_0x1f1acf[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x13eebb[_0x4b69('0x48')],qs['fields'](_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x49')]));_0x1f1acf[_0x4b69('0x4a')]=_0x1f1acf[_0x4b69('0x4a')][_0x4b69('0x4b')]?_0x1f1acf['attributes']:_0x13eebb['model'];if(!_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x1f1acf[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x5a6eff[_0x4b69('0x45')]['limit']);_0x1f1acf['offset']=qs[_0x4b69('0x1d')](_0x5a6eff['query'][_0x4b69('0x1d')]);}_0x1f1acf[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x1f1acf['where']=qs[_0x4b69('0x52')](_['pick'](_0x5a6eff['query'],_0x13eebb[_0x4b69('0x52')]));_0x1f1acf[_0x4b69('0x50')][_0x4b69('0x66')]=_0x3434c6['id'];if(_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x53')]){_0x1f1acf['where']=_[_0x4b69('0x54')](_0x1f1acf[_0x4b69('0x50')],{'$or':_['map'](_0x1f1acf[_0x4b69('0x4a')],function(_0x31d5d1){var _0x4e5dae={};_0x4e5dae[_0x31d5d1]={'$like':'%'+_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x53')]+'%'};return _0x4e5dae;})});}_0x1f1acf=_['merge']({},_0x1f1acf,_0x5a6eff[_0x4b69('0x55')]);return db[_0x4b69('0x6f')]['count']({'where':_0x1f1acf[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x2a9673){_0x22d938[_0x4b69('0x20')]=_0x2a9673;if(_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x1f1acf['include']=[{'all':!![]}];}return db[_0x4b69('0x6f')][_0x4b69('0x58')](_0x1f1acf);})[_0x4b69('0x11')](function(_0x37d013){_0x22d938[_0x4b69('0x6a')]=_0x37d013;return _0x22d938;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x360bab,_0x1f1acf))[_0x4b69('0x59')](handleError(_0x360bab,null));};exports[_0x4b69('0x70')]=function(_0x33a92e,_0x4c3e1f){return db[_0x4b69('0x56')]['find']({'where':{'id':_0x33a92e[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x4c3e1f,null))[_0x4b69('0x11')](function(_0x29afa2){if(_0x29afa2){return _0x29afa2[_0x4b69('0x70')](_0x33a92e[_0x4b69('0x45')][_0x4b69('0x71')]);}})[_0x4b69('0x11')](respondWithStatusCode(_0x4c3e1f,null))[_0x4b69('0x59')](handleError(_0x4c3e1f,null));};exports[_0x4b69('0x67')]=function(_0x529fed,_0x3c3842){var _0x4e8403={'name':_0x529fed[_0x4b69('0x60')][_0x4b69('0x27')],'key':_0x529fed['body'][_0x4b69('0x43')],'provider':_0x529fed[_0x4b69('0x60')]['provider']==='custom'?null:_0x529fed[_0x4b69('0x60')][_0x4b69('0x61')],'email':_0x529fed[_0x4b69('0x60')][_0x4b69('0x72')],'ListId':_0x529fed['body'][_0x4b69('0x73')],'active':!_[_0x4b69('0x74')](_0x529fed[_0x4b69('0x60')][_0x4b69('0x75')])?_0x529fed[_0x4b69('0x60')][_0x4b69('0x75')]:!![],'description':_0x529fed[_0x4b69('0x60')][_0x4b69('0x76')]||null};var _0xbc931e=getAuthenticationOptions(_0x4e8403[_0x4b69('0x61')],_0x529fed[_0x4b69('0x60')]);_0x4e8403[_0x4b69('0x3d')]=_0xbc931e['Imap'];_0x4e8403['Smtp']=_0xbc931e[_0x4b69('0x3f')];return db[_0x4b69('0x56')]['create'](_0x4e8403,{'include':[{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f')},{'model':db['MailServerIn'],'as':_0x4b69('0x3d')}]})[_0x4b69('0x11')](function(_0x143c50){var _0x9c509b=_0x529fed[_0x4b69('0x34')]['get']({'plain':!![]});if(!_0x9c509b)throw new Error(_0x4b69('0x77'));if(_0x9c509b[_0x4b69('0x78')]===_0x4b69('0x34')){var _0x3c83bc=_0x143c50[_0x4b69('0x79')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x4b69('0x7a'),'userProfileId':_0x9c509b[_0x4b69('0x7b')]},'raw':!![]})[_0x4b69('0x11')](function(_0x5333b4){if(_0x5333b4&&_0x5333b4[_0x4b69('0x7c')]===0x0){return db[_0x4b69('0x7d')]['create']({'name':_0x3c83bc[_0x4b69('0x27')],'resourceId':_0x3c83bc['id'],'type':_0x5333b4[_0x4b69('0x27')],'sectionId':_0x5333b4['id']},{})[_0x4b69('0x11')](function(){return _0x143c50;});}else{return _0x143c50;}})['catch'](function(_0x336d06){logger[_0x4b69('0x17')](_0x4b69('0x7e'),_0x336d06);throw _0x336d06;});}return _0x143c50;})['then'](respondWithResult(_0x3c3842,0xc9))[_0x4b69('0x59')](handleError(_0x3c3842,null));};exports[_0x4b69('0x7f')]=function(_0x58960d,_0x55d882){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x58960d[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x55d882,null))[_0x4b69('0x11')](function(_0x45e24c){if(_0x45e24c){return _0x45e24c[_0x4b69('0x7f')]();}return null;})[_0x4b69('0x11')](respondWithResult(_0x55d882,null))[_0x4b69('0x59')](handleError(_0x55d882,null));};exports[_0x4b69('0x80')]=function(_0x3507c3,_0x589e7f){if(_0x3507c3[_0x4b69('0x60')]['id']){delete _0x3507c3[_0x4b69('0x60')]['id'];}return db[_0x4b69('0x56')]['find']({'where':{'id':_0x3507c3[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x589e7f,null))[_0x4b69('0x11')](function(_0x42c6a4){if(_0x42c6a4){_0x3507c3[_0x4b69('0x60')][_0x4b69('0x66')]=_0x42c6a4['id'];return db['MailServerIn'][_0x4b69('0x67')](_0x3507c3['body']);}})[_0x4b69('0x11')](respondWithResult(_0x589e7f,null))[_0x4b69('0x59')](handleError(_0x589e7f,null));};exports['removeImap']=function(_0xb4dac8,_0x5eaf34){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0xb4dac8[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x5eaf34,null))['then'](function(_0x42c46f){if(_0x42c46f){return _0x42c46f[_0x4b69('0x81')](null);}return null;})['then'](respondWithStatusCode(_0x5eaf34,null))[_0x4b69('0x59')](handleError(_0x5eaf34,null));};exports[_0x4b69('0x82')]=function(_0x1711d7,_0x4e05ab){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x1711d7['params']['id']}})['then'](handleEntityNotFound(_0x4e05ab,null))[_0x4b69('0x11')](function(_0x5c22a9){if(_0x5c22a9){return _0x5c22a9['getSmtp']();}return null;})[_0x4b69('0x11')](respondWithResult(_0x4e05ab,null))[_0x4b69('0x59')](handleError(_0x4e05ab,null));};exports[_0x4b69('0x83')]=function(_0x1d2d41,_0x393ea7){if(_0x1d2d41[_0x4b69('0x60')]['id']){delete _0x1d2d41[_0x4b69('0x60')]['id'];}return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x1d2d41['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x393ea7,null))['then'](function(_0x16b2b5){if(_0x16b2b5){_0x1d2d41[_0x4b69('0x60')][_0x4b69('0x66')]=_0x16b2b5['id'];return db['MailServerOut']['create'](_0x1d2d41[_0x4b69('0x60')]);}})[_0x4b69('0x11')](respondWithResult(_0x393ea7,null))[_0x4b69('0x59')](handleError(_0x393ea7,null));};exports['removeSmtp']=function(_0x4114dc,_0x3f1de6){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x4114dc[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x3f1de6,null))['then'](function(_0x4ea92a){if(_0x4ea92a){return _0x4ea92a['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x3f1de6,null))[_0x4b69('0x59')](handleError(_0x3f1de6,null));};exports['addInteraction']=function(_0x1cd75b,_0x59a933){return db[_0x4b69('0x84')][_0x4b69('0x5f')]({'where':{'id':_0x1cd75b[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x59a933,null))['then'](function(_0x51c5cb){if(_0x51c5cb){return _0x51c5cb[_0x4b69('0x85')](_0x1cd75b[_0x4b69('0x60')][_0x4b69('0x71')],_[_0x4b69('0x86')](_0x1cd75b[_0x4b69('0x60')],[_0x4b69('0x71'),'id'])||{});}})['then'](respondWithResult(_0x59a933,null))[_0x4b69('0x59')](handleError(_0x59a933,null));};exports[_0x4b69('0x87')]=function(_0x4ddbe7,_0x3d2efc){var _0x3c670f={'raw':![],'where':{}};var _0x3dcf56={};var _0x4f45d8={'count':0x0,'rows':[]};return db['MailAccount'][_0x4b69('0x6e')]({'where':{'id':_0x4ddbe7[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x3d2efc,null))[_0x4b69('0x11')](function(_0x305b24){if(_0x305b24){_0x3dcf56[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x84')][_0x4b69('0x5d')]);_0x3dcf56[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x4ddbe7[_0x4b69('0x45')]);_0x3dcf56[_0x4b69('0x52')]=_['intersection'](_0x3dcf56[_0x4b69('0x48')],_0x3dcf56['query']);_0x3c670f[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x3dcf56['model'],qs[_0x4b69('0x49')](_0x4ddbe7['query'][_0x4b69('0x49')]));_0x3c670f['attributes']=_0x3c670f[_0x4b69('0x4a')][_0x4b69('0x4b')]?_0x3c670f['attributes']:_0x3dcf56[_0x4b69('0x48')];if(!_0x4ddbe7['query'][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x3c670f[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x1f')]);_0x3c670f[_0x4b69('0x1d')]=qs['offset'](_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0x3c670f[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x3c670f[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x4ddbe7[_0x4b69('0x45')],_0x3dcf56[_0x4b69('0x52')]));_0x3c670f[_0x4b69('0x50')][_0x4b69('0x66')]=_0x305b24['id'];if(_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x53')]){_0x3c670f[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0x3c670f[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x3c670f[_0x4b69('0x4a')],function(_0x5d9d76){var _0x5e3073={};_0x5e3073[_0x5d9d76]={'$like':'%'+_0x4ddbe7['query'][_0x4b69('0x53')]+'%'};return _0x5e3073;})});}_0x3c670f=_['merge']({},_0x3c670f,_0x4ddbe7[_0x4b69('0x55')]);return db[_0x4b69('0x84')][_0x4b69('0x20')]({'where':_0x3c670f[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x3b795a){_0x4f45d8['count']=_0x3b795a;if(_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x3c670f[_0x4b69('0x57')]=[{'model':db[_0x4b69('0x88')],'as':_0x4b69('0x89'),'required':![]},{'model':db[_0x4b69('0x8a')],'as':_0x4b69('0x8b'),'attributes':['name','fullname',_0x4b69('0x8c')],'required':![]},{'model':db[_0x4b69('0x8d')],'as':'Tags','attributes':['id',_0x4b69('0x27'),_0x4b69('0x8e')],'where':_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x8f')]?{'id':_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x8f')]}:undefined,'required':_0x4ddbe7[_0x4b69('0x45')]['tag']?!![]:![]}];}return db[_0x4b69('0x84')][_0x4b69('0x58')](_0x3c670f);})[_0x4b69('0x11')](function(_0x5cff65){_0x4f45d8[_0x4b69('0x6a')]=_0x5cff65;return _0x4f45d8;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x3d2efc,_0x3c670f))[_0x4b69('0x59')](handleError(_0x3d2efc,null));};exports[_0x4b69('0x90')]=function addApplications(_0x53ed56,_0x4511cd){var _0xd508b0=_0x53ed56['params']['id'];var _0x3e922c=_0x53ed56[_0x4b69('0x60')];var _0x5b686f=0xc8;var _0x10868b=null;return db['sequelize'][_0x4b69('0x91')]({'isolationLevel':db['sequelize'][_0x4b69('0x92')][_0x4b69('0x93')][_0x4b69('0x94')]},function(_0x34052c){return db['MailAccount'][_0x4b69('0x6e')]({'where':{'id':_0xd508b0},'transaction':_0x34052c})[_0x4b69('0x11')](function(_0xdab191){if(_0xdab191){return db[_0x4b69('0x95')][_0x4b69('0x23')]({'where':{'MailAccountId':_0xd508b0},'transaction':_0x34052c})[_0x4b69('0x11')](function(){var _0x3a7804=_[_0x4b69('0x44')](_0x3e922c,function(_0x50c751){_0x50c751['MailAccountId']=_0xd508b0;return _0x50c751;});return db[_0x4b69('0x95')][_0x4b69('0x96')](_0x3a7804,{'transaction':_0x34052c});});}else{_0x5b686f=0x194;_0x10868b=[];}});})[_0x4b69('0x11')](function(){if(_0x5b686f!==0x194){return db[_0x4b69('0x95')][_0x4b69('0x97')]({'where':{'MailAccountId':_0xd508b0},'order':_0x4b69('0x98')})[_0x4b69('0x11')](function(_0xa8a5cb){_0x10868b=_0xa8a5cb;});}})[_0x4b69('0x59')](function(_0x536400){_0x5b686f=0x1f4;logger[_0x4b69('0x17')](_0x536400[_0x4b69('0x26')]);if(_0x536400[_0x4b69('0x27')]){delete _0x536400[_0x4b69('0x27')];}_0x10868b=_0x536400;})[_0x4b69('0x99')](function(){if(_0x10868b===null){_0x4511cd[_0x4b69('0x25')](_0x5b686f);}else{if(_0x5b686f===0x1f4){_0x4511cd['status'](_0x5b686f)[_0x4b69('0x28')](_0x10868b);}else{_0x4511cd[_0x4b69('0x1b')](_0x5b686f)[_0x4b69('0x1c')](_0x10868b);}}});};exports[_0x4b69('0x9a')]=function(_0x38744e,_0x3f201b){var _0x39c225={};var _0x159ca8={};var _0x34642b;var _0x220aaa;return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x38744e['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x3f201b,null))[_0x4b69('0x11')](function(_0x1e7413){if(_0x1e7413){_0x34642b=_0x1e7413;_0x159ca8[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x95')][_0x4b69('0x5d')]);_0x159ca8[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x38744e[_0x4b69('0x45')]);_0x159ca8[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x159ca8[_0x4b69('0x48')],_0x159ca8[_0x4b69('0x45')]);_0x39c225[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x159ca8['model'],qs[_0x4b69('0x49')](_0x38744e[_0x4b69('0x45')][_0x4b69('0x49')]));_0x39c225[_0x4b69('0x4a')]=_0x39c225[_0x4b69('0x4a')]['length']?_0x39c225[_0x4b69('0x4a')]:_0x159ca8[_0x4b69('0x48')];_0x39c225[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x38744e[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x39c225[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x38744e[_0x4b69('0x45')],_0x159ca8[_0x4b69('0x52')]));if(_0x38744e[_0x4b69('0x45')][_0x4b69('0x53')]){_0x39c225['where']=_['merge'](_0x39c225[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x39c225[_0x4b69('0x4a')],function(_0x551385){var _0xea7aad={};_0xea7aad[_0x551385]={'$like':'%'+_0x38744e['query']['filter']+'%'};return _0xea7aad;})});}_0x39c225=_[_0x4b69('0x54')]({},_0x39c225,_0x38744e[_0x4b69('0x55')]);return _0x34642b[_0x4b69('0x9a')](_0x39c225);}})[_0x4b69('0x11')](function(_0x206900){if(_0x206900){_0x220aaa=_0x206900[_0x4b69('0x4b')];if(!_0x38744e[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x39c225[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x38744e[_0x4b69('0x45')]['limit']);_0x39c225[_0x4b69('0x1d')]=qs[_0x4b69('0x1d')](_0x38744e[_0x4b69('0x45')][_0x4b69('0x1d')]);}return _0x34642b[_0x4b69('0x9a')](_0x39c225);}})[_0x4b69('0x11')](function(_0x3a377f){if(_0x3a377f){return _0x3a377f?{'count':_0x220aaa,'rows':_0x3a377f}:null;}})[_0x4b69('0x11')](respondWithResult(_0x3f201b,null))[_0x4b69('0x59')](handleError(_0x3f201b,null));};exports[_0x4b69('0x9b')]=function(_0x1cb285,_0x67739f){var _0x5bb787={'raw':!![],'where':{}};var _0x4e8b37={};var _0xdd6757={'count':0x0,'rows':[]};return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x1cb285[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x67739f,null))[_0x4b69('0x11')](function(_0x199a41){if(_0x199a41){_0x4e8b37[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x9c')][_0x4b69('0x5d')]);_0x4e8b37['query']=_[_0x4b69('0x46')](_0x1cb285[_0x4b69('0x45')]);_0x4e8b37[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x4e8b37[_0x4b69('0x48')],_0x4e8b37['query']);_0x5bb787[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x4e8b37[_0x4b69('0x48')],qs[_0x4b69('0x49')](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x49')]));_0x5bb787[_0x4b69('0x4a')]=_0x5bb787['attributes'][_0x4b69('0x4b')]?_0x5bb787[_0x4b69('0x4a')]:_0x4e8b37[_0x4b69('0x48')];if(!_0x1cb285[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x5bb787[_0x4b69('0x1f')]=qs['limit'](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x1f')]);_0x5bb787[_0x4b69('0x1d')]=qs['offset'](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0x5bb787[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x5bb787[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x1cb285['query'],_0x4e8b37[_0x4b69('0x52')]));_0x5bb787[_0x4b69('0x50')][_0x4b69('0x66')]=_0x199a41['id'];if(_0x1cb285['query'][_0x4b69('0x53')]){_0x5bb787['where']=_[_0x4b69('0x54')](_0x5bb787[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x5bb787[_0x4b69('0x4a')],function(_0x48ef4f){var _0x41565c={};_0x41565c[_0x48ef4f]={'$like':'%'+_0x1cb285['query'][_0x4b69('0x53')]+'%'};return _0x41565c;})});}if(_0x1cb285[_0x4b69('0x45')][_0x4b69('0x9d')]){var _0x4027ba=_0x1cb285[_0x4b69('0x45')]['$gte'][_0x4b69('0x9e')](',');var _0x1822c3={};_0x1822c3[_0x4027ba[0x0]]={'$gte':moment(_0x4027ba[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5bb787[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0x5bb787[_0x4b69('0x50')],_0x1822c3);}_0x5bb787=_['merge']({},_0x5bb787,_0x1cb285['options']);return db[_0x4b69('0x9c')][_0x4b69('0x20')]({'where':_0x5bb787[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x23492a){_0xdd6757[_0x4b69('0x20')]=_0x23492a;if(_0x1cb285[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x5bb787['include']=[{'all':!![]}];}return db['MailMessage'][_0x4b69('0x58')](_0x5bb787);})[_0x4b69('0x11')](function(_0x174fd4){if(_0x1cb285[_0x4b69('0x45')][_0x4b69('0x9f')]===_0x4b69('0xa0')){for(var _0xb82e58=0x0;_0xb82e58<_0x174fd4[_0x4b69('0x4b')];_0xb82e58++){_0x174fd4[_0xb82e58][_0x4b69('0x60')]=juice(_0x174fd4[_0xb82e58][_0x4b69('0x60')]);}}_0xdd6757[_0x4b69('0x6a')]=_0x174fd4;return _0xdd6757;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x67739f,_0x5bb787))['catch'](handleError(_0x67739f,null));};exports[_0x4b69('0x28')]=function(_0x286e14,_0x3516c9){var _0x1f29a4,_0x34d3f9={},_0x24edf0;if(_0x286e14[_0x4b69('0x60')]['to']){_0x24edf0=_0x286e14[_0x4b69('0x60')]['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x286e14['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4b69('0x88')],'as':_0x4b69('0xa1'),'where':{'email':_0x24edf0},'limit':0x1,'order':[[_0x4b69('0xa2'),_0x4b69('0xa3')]]}]},{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x4b69('0x11')](handleEntityNotFound(_0x3516c9,null))['then'](function(_0x3fad8b){if(!_0x3fad8b)return;_0x1f29a4=_0x3fad8b;if(!_0x3fad8b[_0x4b69('0x3f')])throw new Error(_0x4b69('0xa4'));if(_[_0x4b69('0x74')](_0x286e14[_0x4b69('0x60')][_0x4b69('0xa5')])){_0x286e14[_0x4b69('0x60')]['from']=util[_0x4b69('0xa6')](_0x4b69('0xa7'),_0x3fad8b[_0x4b69('0x27')],_0x3fad8b['email']||_0x3fad8b[_0x4b69('0x3f')][_0x4b69('0x34')]);}if(_0x286e14['body']['attachments']&&_0x286e14['body'][_0x4b69('0xa8')][_0x4b69('0x4b')]){for(var _0x4c7b8d=0x0;_0x4c7b8d<_0x286e14[_0x4b69('0x60')][_0x4b69('0xa8')]['length'];_0x4c7b8d+=0x1){_0x286e14[_0x4b69('0x60')][_0x4b69('0xa8')][_0x4c7b8d]={'filename':_0x286e14['body']['attachments'][_0x4c7b8d][_0x4b69('0x27')],'path':path['join'](config['root'],_0x4b69('0xa9'),_0x286e14[_0x4b69('0x60')]['attachments'][_0x4c7b8d]['basename'])};}}var _0x49f2e1=_0x3fad8b[_0x4b69('0xaa')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x49f2e1,'message':_0x286e14[_0x4b69('0x60')]});})[_0x4b69('0x11')](function(_0x2fe6b1){if(!_0x2fe6b1)return;_0x34d3f9=_0x2fe6b1;if(!_0x1f29a4[_0x4b69('0xab')])throw new Error(_0x4b69('0xac'));if(_0x1f29a4[_0x4b69('0xab')][_0x4b69('0xa1')][_0x4b69('0x4b')])return _0x1f29a4[_0x4b69('0xab')][_0x4b69('0xa1')][0x0];return db['CmContact']['create'](_[_0x4b69('0x9')](_0x286e14['body'],{'firstName':_0x286e14[_0x4b69('0x60')]['to'],'email':_0x286e14[_0x4b69('0x60')]['to'],'phone':_0x286e14[_0x4b69('0x60')]['to'],'ListId':_0x1f29a4[_0x4b69('0x73')]}));})[_0x4b69('0x11')](function(_0xa98782){if(!_0xa98782)return;var _0x4c7390={'UserId':_0x286e14[_0x4b69('0x34')]['id'],'ContactId':_0xa98782['id'],'MailAccountId':_0x1f29a4['id'],'inReplyTo':_0x34d3f9[_0x4b69('0xad')],'to':_0x286e14[_0x4b69('0x60')][_0x4b69('0xa5')],'cc':_0x286e14['body']['cc'],'subject':_0x286e14[_0x4b69('0x60')][_0x4b69('0xae')],'attach':_0x286e14[_0x4b69('0x60')][_0x4b69('0xaf')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x4b69('0xa6')](_0x4b69('0xb0')),'lastMsgDirection':'out','Messages':[_['merge'](_0x286e14['body'],{'messageId':_0x34d3f9[_0x4b69('0xad')],'sentAt':moment()[_0x4b69('0xa6')](_0x4b69('0xb0')),'read':!![],'MailAccountId':_0x1f29a4['id'],'UserId':_0x286e14[_0x4b69('0x34')]['id'],'ContactId':_0xa98782['id']})]};if(_0x286e14['body'][_0x4b69('0xb1')]){_0x4c7390=_['merge'](_0x4c7390,_0x286e14['body'][_0x4b69('0xb1')]);}return db[_0x4b69('0x84')][_0x4b69('0x67')](_0x4c7390,{'include':[{'model':db[_0x4b69('0x9c')],'as':_0x4b69('0xb2')}]});})[_0x4b69('0x11')](respondWithResult(_0x3516c9,null))['catch'](handleError(_0x3516c9,null));};exports[_0x4b69('0xb3')]=function(_0x2320e9,_0x5c4aef){return db[_0x4b69('0x56')]['find']({'where':{'id':_0x2320e9['params']['id']},'include':[{'model':db[_0x4b69('0x40')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4b69('0xb4')],'as':'CloudProvider','raw':!![]}]}]})[_0x4b69('0x11')](handleEntityNotFound(_0x5c4aef,null))[_0x4b69('0x11')](function(_0x55c332){if(!_0x55c332['Smtp'])return;var _0x310b14=_0x55c332[_0x4b69('0xaa')]();return respondWithRpcPromise(_0x4b69('0xb5'),'verifySmtp',{'account':_0x310b14});})['then'](respondWithResult(_0x5c4aef,null))[_0x4b69('0x59')](handleError(_0x5c4aef,null));};exports['destroy']=function(_0x20078b,_0x126010){return db['MailAccount'][_0x4b69('0x5f')]({'where':{'id':_0x20078b[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x126010,null))[_0x4b69('0x11')](function(_0x5d01fd){if(_0x5d01fd&&_0x5d01fd[_0x4b69('0x3b')]){throw new db[(_0x4b69('0xb6'))][(_0x4b69('0xb7'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5d01fd;})[_0x4b69('0x11')](removeEntity(_0x126010,null))[_0x4b69('0x59')](handleError(_0x126010,null));};exports['addAgents']=function(_0x4d8b2c,_0x365d0a){return db['MailAccount'][_0x4b69('0x5f')]({'where':{'id':_0x4d8b2c[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x365d0a,null))[_0x4b69('0x11')](function(_0x1565dc){if(_0x1565dc){return _0x1565dc['addAgents'](_0x4d8b2c['body']['ids'],_['omit'](_0x4d8b2c[_0x4b69('0x60')],[_0x4b69('0x71'),'id'])||{})[_0x4b69('0xb8')](function(_0x40eb89){for(var _0x4468ac=0x0;_0x4468ac<_0x4d8b2c['body'][_0x4b69('0x71')][_0x4b69('0x4b')];_0x4468ac+=0x1){socket['emit'](_0x4b69('0xb9'),{'UserId':Number(_0x4d8b2c[_0x4b69('0x60')][_0x4b69('0x71')][_0x4468ac]),'MailAccountId':Number(_0x4d8b2c['params']['id'])});}return _0x40eb89;});}})['then'](respondWithResult(_0x365d0a,null))['catch'](handleError(_0x365d0a,null));};exports[_0x4b69('0xba')]=function(_0x451ffb,_0x44fced){return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x451ffb['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x44fced,null))['then'](function(_0x431413){if(_0x431413){return _0x431413[_0x4b69('0xba')](_0x451ffb[_0x4b69('0x45')][_0x4b69('0x71')])[_0x4b69('0x11')](function(){if(_['isArray'](_0x451ffb[_0x4b69('0x45')]['ids'])){for(var _0x298d5c=0x0;_0x298d5c<_0x451ffb[_0x4b69('0x45')][_0x4b69('0x71')][_0x4b69('0x4b')];_0x298d5c+=0x1){socket[_0x4b69('0xbb')](_0x4b69('0xbc'),{'UserId':Number(_0x451ffb['query'][_0x4b69('0x71')][_0x298d5c]),'MailAccountId':Number(_0x451ffb[_0x4b69('0x5b')]['id'])});}}else{socket[_0x4b69('0xbb')](_0x4b69('0xbc'),{'UserId':Number(_0x451ffb[_0x4b69('0x45')][_0x4b69('0x71')]),'MailAccountId':Number(_0x451ffb['params']['id'])});}});}})[_0x4b69('0x11')](respondWithStatusCode(_0x44fced,null))['catch'](handleError(_0x44fced,null));};exports[_0x4b69('0xbd')]=function(_0x1aa07b,_0x402849){var _0x1e0f10={};var _0x287f5e={};var _0x37c28e;var _0x2ac17f;return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x1aa07b[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x402849,null))[_0x4b69('0x11')](function(_0x26b611){if(_0x26b611){_0x37c28e=_0x26b611;_0x287f5e['model']=_[_0x4b69('0x46')](db['User'][_0x4b69('0x5d')]);_0x287f5e[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x1aa07b['query']);_0x287f5e[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x287f5e['model'],_0x287f5e['query']);_0x1e0f10[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x287f5e[_0x4b69('0x48')],qs[_0x4b69('0x49')](_0x1aa07b[_0x4b69('0x45')][_0x4b69('0x49')]));_0x1e0f10[_0x4b69('0x4a')]=_0x1e0f10[_0x4b69('0x4a')]['length']?_0x1e0f10[_0x4b69('0x4a')]:_0x287f5e[_0x4b69('0x48')];_0x1e0f10['order']=qs[_0x4b69('0x4f')](_0x1aa07b['query'][_0x4b69('0x4f')]);_0x1e0f10[_0x4b69('0x50')]=qs['filters'](_['pick'](_0x1aa07b[_0x4b69('0x45')],_0x287f5e['filters']));if(_0x1aa07b[_0x4b69('0x45')]['filter']){_0x1e0f10['where']=_[_0x4b69('0x54')](_0x1e0f10['where'],{'$or':_['map'](_0x1e0f10[_0x4b69('0x4a')],function(_0x12c127){var _0x28cbdb={};_0x28cbdb[_0x12c127]={'$like':'%'+_0x1aa07b[_0x4b69('0x45')][_0x4b69('0x53')]+'%'};return _0x28cbdb;})});}_0x1e0f10=_[_0x4b69('0x54')]({},_0x1e0f10,_0x1aa07b[_0x4b69('0x55')]);return _0x37c28e[_0x4b69('0xbd')](_0x1e0f10);}})[_0x4b69('0x11')](function(_0x76a936){if(_0x76a936){_0x2ac17f=_0x76a936['length'];if(!_0x1aa07b[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x1e0f10['limit']=qs['limit'](_0x1aa07b[_0x4b69('0x45')]['limit']);_0x1e0f10[_0x4b69('0x1d')]=qs['offset'](_0x1aa07b[_0x4b69('0x45')]['offset']);}return _0x37c28e[_0x4b69('0xbd')](_0x1e0f10);}})[_0x4b69('0x11')](function(_0xdc3fdc){if(_0xdc3fdc){return _0xdc3fdc?{'count':_0x2ac17f,'rows':_0xdc3fdc}:null;}})[_0x4b69('0x11')](respondWithResult(_0x402849,null))[_0x4b69('0x59')](handleError(_0x402849,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index f54dd1e..9372c43 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 _0x7f59=['setMaxListeners','save','update','remove','hook','exports','events','../../mysqldb'];(function(_0x5056f1,_0x1f932f){var _0x12020e=function(_0x3daf83){while(--_0x3daf83){_0x5056f1['push'](_0x5056f1['shift']());}};_0x12020e(++_0x1f932f);}(_0x7f59,0x12e));var _0x97f5=function(_0x208293,_0x33fbb0){_0x208293=_0x208293-0x0;var _0x28ea69=_0x7f59[_0x208293];return _0x28ea69;};'use strict';var EventEmitter=require(_0x97f5('0x0'));var MailAccount=require(_0x97f5('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x97f5('0x2')](0x0);var events={'afterCreate':_0x97f5('0x3'),'afterUpdate':_0x97f5('0x4'),'afterDestroy':_0x97f5('0x5')};function emitEvent(_0x2b37b0){return function(_0x18d4c3,_0x29af72,_0x5e6215){MailAccountEvents['emit'](_0x2b37b0+':'+_0x18d4c3['id'],_0x18d4c3);MailAccountEvents['emit'](_0x2b37b0,_0x18d4c3);_0x5e6215(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x97f5('0x6')](e,emitEvent(event));}}module[_0x97f5('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x099f=['exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x57b0c6,_0x5ec400){var _0x22c772=function(_0x39e0ad){while(--_0x39e0ad){_0x57b0c6['push'](_0x57b0c6['shift']());}};_0x22c772(++_0x5ec400);}(_0x099f,0x133));var _0xf099=function(_0x57e940,_0x1a3a3f){_0x57e940=_0x57e940-0x0;var _0x2f48dc=_0x099f[_0x57e940];return _0x2f48dc;};'use strict';var EventEmitter=require(_0xf099('0x0'));var MailAccount=require(_0xf099('0x1'))['db'][_0xf099('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf099('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf099('0x4'),'afterDestroy':_0xf099('0x5')};function emitEvent(_0x8c3488){return function(_0x24270f,_0x3f46c0,_0x35a43a){MailAccountEvents[_0xf099('0x6')](_0x8c3488+':'+_0x24270f['id'],_0x24270f);MailAccountEvents['emit'](_0x8c3488,_0x24270f);_0x35a43a(null);};}for(var e in events){if(events[_0xf099('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xf099('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index fe557ac..be19dc0 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 _0x4d6c=['define','MailAccount','provider','custom','service','Smtp','host','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','CloudProvider','data5','./mailAccount.attributes'];(function(_0x4bff3e,_0x394138){var _0x1f78d6=function(_0x510417){while(--_0x510417){_0x4bff3e['push'](_0x4bff3e['shift']());}};_0x1f78d6(++_0x394138);}(_0x4d6c,0x1a8));var _0xc4d6=function(_0x57b7a9,_0x318526){_0x57b7a9=_0x57b7a9-0x0;var _0x30648b=_0x4d6c[_0x57b7a9];return _0x30648b;};'use strict';var attributes=require(_0xc4d6('0x0'));module['exports']=function(_0x3dc018){return _0x3dc018[_0xc4d6('0x1')](_0xc4d6('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x31148f=this;var _0x49aee4={'id':_0x31148f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x31148f[_0xc4d6('0x3')]!==_0xc4d6('0x4')){_0x49aee4[_0xc4d6('0x5')]=_0x31148f['provider'];}else{_0x49aee4['host']=_0x31148f[_0xc4d6('0x6')][_0xc4d6('0x7')];_0x49aee4['port']=_0x31148f['Smtp'][_0xc4d6('0x8')];_0x49aee4[_0xc4d6('0x9')]=_0x31148f[_0xc4d6('0x6')][_0xc4d6('0x9')];}if(_0x31148f[_0xc4d6('0x6')][_0xc4d6('0xa')]){if(_0x31148f[_0xc4d6('0x6')][_0xc4d6('0xb')]){if(!_0x31148f[_0xc4d6('0x6')]['CloudProvider'])throw new Error(_0xc4d6('0xc'));_0x49aee4['auth']={'type':_0xc4d6('0xd'),'user':_0x31148f[_0xc4d6('0x6')][_0xc4d6('0xe')],'accessToken':_0x31148f[_0xc4d6('0x6')][_0xc4d6('0xf')][_0xc4d6('0x10')]};}else{_0x49aee4['auth']={'user':_0x31148f[_0xc4d6('0x6')]['user'],'pass':_0x31148f[_0xc4d6('0x6')]['pass']};}}return _0x49aee4;}}});}; \ No newline at end of file +var _0x7f8d=['OAuth2','user','data5','auth','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','service','provider','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0xa5ac3a,_0x47e561){var _0x467486=function(_0x5456c5){while(--_0x5456c5){_0xa5ac3a['push'](_0xa5ac3a['shift']());}};_0x467486(++_0x47e561);}(_0x7f8d,0x8a));var _0xd7f8=function(_0xbf0a97,_0x1692ef){_0xbf0a97=_0xbf0a97-0x0;var _0x5c0e21=_0x7f8d[_0xbf0a97];return _0x5c0e21;};'use strict';var attributes=require(_0xd7f8('0x0'));module[_0xd7f8('0x1')]=function(_0x55a0f4){return _0x55a0f4['define'](_0xd7f8('0x2'),attributes,{'tableName':_0xd7f8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xe274e0=this;var _0xfca19e={'id':_0xe274e0['id'],'tls':{'rejectUnauthorized':![]}};if(_0xe274e0['provider']!=='custom'){_0xfca19e[_0xd7f8('0x4')]=_0xe274e0[_0xd7f8('0x5')];}else{_0xfca19e[_0xd7f8('0x6')]=_0xe274e0['Smtp']['host'];_0xfca19e[_0xd7f8('0x7')]=_0xe274e0[_0xd7f8('0x8')]['port'];_0xfca19e['secure']=_0xe274e0['Smtp'][_0xd7f8('0x9')];}if(_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xa')]){if(_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xb')]){if(!_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xc')])throw new Error(_0xd7f8('0xd'));_0xfca19e['auth']={'type':_0xd7f8('0xe'),'user':_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xf')],'accessToken':_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xc')][_0xd7f8('0x10')]};}else{_0xfca19e[_0xd7f8('0x11')]={'user':_0xe274e0['Smtp'][_0xd7f8('0xf')],'pass':_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0x12')]};}}return _0xfca19e;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index bd11c92..6e41ba5 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 _0xba18=['attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','update','subject','interaction','created','contact','attachments','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','options','raw','where','attributes','limit','include','map','model','catch','find','smtp','setDataValue','ShowMailAccount','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','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','account','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','smtpOptions','getSmtpOptions','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','messageId','generate'];(function(_0xd4c2ad,_0x28645a){var _0x555df1=function(_0x2e6ebc){while(--_0x2e6ebc){_0xd4c2ad['push'](_0xd4c2ad['shift']());}};_0x555df1(++_0x28645a);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var moment=require(_0x8ba1('0x1'));var BPromise=require(_0x8ba1('0x2'));var rs=require(_0x8ba1('0x3'));var Redis=require(_0x8ba1('0x4'));var db=require(_0x8ba1('0x5'))['db'];var logger=require(_0x8ba1('0x6'))(_0x8ba1('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ba1('0x8'));var client=jayson[_0x8ba1('0x9')][_0x8ba1('0xa')]({'port':0x232c});config[_0x8ba1('0xb')]=_[_0x8ba1('0xc')](config[_0x8ba1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ba1('0xd'))(new Redis(config[_0x8ba1('0xb')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4aa3e3,_0x4609ce,_0x141a88){return new BPromise(function(_0x4d9f8b,_0x457158){return client[_0x8ba1('0xe')](_0x4aa3e3,_0x141a88)[_0x8ba1('0xf')](function(_0x443ec3){logger[_0x8ba1('0x10')]('MailAccount,\x20%s,\x20%s',_0x4609ce,_0x8ba1('0x11'));logger[_0x8ba1('0x12')](_0x8ba1('0x13'),_0x4609ce,_0x8ba1('0x11'),JSON[_0x8ba1('0x14')](_0x443ec3));if(_0x443ec3[_0x8ba1('0x15')]){if(_0x443ec3['error'][_0x8ba1('0x16')]===0x1f4){logger[_0x8ba1('0x15')](_0x8ba1('0x17'),_0x4609ce,_0x443ec3[_0x8ba1('0x15')]['message']);return _0x457158(_0x443ec3['error']['message']);}logger[_0x8ba1('0x15')](_0x8ba1('0x17'),_0x4609ce,_0x443ec3[_0x8ba1('0x15')][_0x8ba1('0x18')]);return _0x4d9f8b(_0x443ec3[_0x8ba1('0x15')][_0x8ba1('0x18')]);}else{logger[_0x8ba1('0x10')](_0x8ba1('0x17'),_0x4609ce,_0x8ba1('0x11'));_0x4d9f8b(_0x443ec3[_0x8ba1('0x19')]['message']);}})['catch'](function(_0x1a48fa){logger[_0x8ba1('0x15')]('MailAccount,\x20%s,\x20%s',_0x4609ce,_0x1a48fa);_0x457158(_0x1a48fa);});});}exports[_0x8ba1('0x1a')]=function(_0x2e5fba){var _0x3fadfc=this;return new Promise(function(_0x3355c8,_0x1dc1b4){return db[_0x8ba1('0x1b')]['findAll']({'raw':_0x2e5fba[_0x8ba1('0x1c')]?_0x2e5fba['options'][_0x8ba1('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e5fba[_0x8ba1('0x1c')]?_0x2e5fba[_0x8ba1('0x1c')][_0x8ba1('0x1e')]||null:null,'attributes':_0x2e5fba['options']?_0x2e5fba[_0x8ba1('0x1c')][_0x8ba1('0x1f')]||null:null,'limit':_0x2e5fba[_0x8ba1('0x1c')]?_0x2e5fba[_0x8ba1('0x1c')][_0x8ba1('0x20')]||null:null,'include':_0x2e5fba[_0x8ba1('0x1c')]?_0x2e5fba[_0x8ba1('0x1c')][_0x8ba1('0x21')]?_[_0x8ba1('0x22')](_0x2e5fba[_0x8ba1('0x1c')][_0x8ba1('0x21')],function(_0x550d33){return{'model':db[_0x550d33['model']],'as':_0x550d33['as'],'attributes':_0x550d33[_0x8ba1('0x1f')],'include':_0x550d33[_0x8ba1('0x21')]?_['map'](_0x550d33[_0x8ba1('0x21')],function(_0xef508d){return{'model':db[_0xef508d[_0x8ba1('0x23')]],'as':_0xef508d['as'],'attributes':_0xef508d[_0x8ba1('0x1f')],'include':_0xef508d[_0x8ba1('0x21')]?_[_0x8ba1('0x22')](_0xef508d[_0x8ba1('0x21')],function(_0x26288a){return{'model':db[_0x26288a[_0x8ba1('0x23')]],'as':_0x26288a['as'],'attributes':_0x26288a[_0x8ba1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8ba1('0xf')](function(_0x136eef){logger[_0x8ba1('0x10')](_0x8ba1('0x1a'),_0x2e5fba);logger['debug'](_0x8ba1('0x1a'),_0x2e5fba,JSON[_0x8ba1('0x14')](_0x136eef));_0x3355c8(_0x136eef);})[_0x8ba1('0x24')](function(_0x3c37fd){logger[_0x8ba1('0x15')](_0x8ba1('0x1a'),_0x3c37fd['message'],_0x2e5fba);_0x1dc1b4(_0x3fadfc[_0x8ba1('0x15')](0x1f4,_0x3c37fd[_0x8ba1('0x18')]));});});};exports['ShowMailAccount']=function(_0x1015c8){var _0x580b4a=this;return new Promise(function(_0x1fb817,_0x18db21){return db['MailAccount'][_0x8ba1('0x25')]({'raw':_0x1015c8[_0x8ba1('0x1c')]?_0x1015c8[_0x8ba1('0x1c')][_0x8ba1('0x1d')]===undefined?!![]:![]:!![],'where':_0x1015c8[_0x8ba1('0x1c')]?_0x1015c8['options'][_0x8ba1('0x1e')]||null:null,'attributes':_0x1015c8[_0x8ba1('0x1c')]?_0x1015c8[_0x8ba1('0x1c')][_0x8ba1('0x1f')]||null:null,'include':_0x1015c8[_0x8ba1('0x1c')]?_0x1015c8[_0x8ba1('0x1c')][_0x8ba1('0x21')]?_[_0x8ba1('0x22')](_0x1015c8['options'][_0x8ba1('0x21')],function(_0x162bae){return{'model':db[_0x162bae[_0x8ba1('0x23')]],'as':_0x162bae['as'],'attributes':_0x162bae[_0x8ba1('0x1f')],'include':_0x162bae[_0x8ba1('0x21')]?_[_0x8ba1('0x22')](_0x162bae[_0x8ba1('0x21')],function(_0x36c8c3){return{'model':db[_0x36c8c3[_0x8ba1('0x23')]],'as':_0x36c8c3['as'],'attributes':_0x36c8c3[_0x8ba1('0x1f')],'include':_0x36c8c3['include']?_[_0x8ba1('0x22')](_0x36c8c3[_0x8ba1('0x21')],function(_0x146104){return{'model':db[_0x146104[_0x8ba1('0x23')]],'as':_0x146104['as'],'attributes':_0x146104[_0x8ba1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8ba1('0xf')](function(_0x3034aa){if(_0x1015c8[_0x8ba1('0x1c')][_0x8ba1('0x26')]===!![])_0x3034aa[_0x8ba1('0x27')]('smtpOptions',_0x3034aa['getSmtpOptions']());logger[_0x8ba1('0x10')](_0x8ba1('0x28'),_0x1015c8);logger[_0x8ba1('0x12')](_0x8ba1('0x28'),_0x1015c8,JSON[_0x8ba1('0x14')](_0x3034aa));_0x1fb817(_0x3034aa);})[_0x8ba1('0x24')](function(_0x414412){logger[_0x8ba1('0x15')](_0x8ba1('0x28'),_0x414412[_0x8ba1('0x18')],_0x1015c8);_0x18db21(_0x580b4a[_0x8ba1('0x15')](0x1f4,_0x414412[_0x8ba1('0x18')]));});});};exports[_0x8ba1('0x29')]=function(_0x2a4cd8){var _0x4af57b=this;return new Promise(function(_0xf8c3b,_0x45e09d){var _0x849fbe={'body':_0x2a4cd8[_0x8ba1('0x2a')],'channel':'mail'};var _0x5828bf=_[_0x8ba1('0x2b')](_[_0x8ba1('0x2c')](db[_0x8ba1('0x2d')][_0x8ba1('0x2e')]),[_0x8ba1('0x2f'),'updatedAt',_0x8ba1('0x30'),_0x8ba1('0x31')]);var _0x16bdb1=![];if(_0x2a4cd8['body']['id']){delete _0x2a4cd8[_0x8ba1('0x2a')]['id'];}if(_[_0x8ba1('0x32')](_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x33')])){return _0x45e09d(_0x4af57b[_0x8ba1('0x15')](0x1f4,_0x8ba1('0x34')));}if(_['isNil'](_0x2a4cd8[_0x8ba1('0x2a')]['body'])||_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x2a')]===''){return _0x45e09d(_0x4af57b[_0x8ba1('0x15')](0x1f4,_0x8ba1('0x35')));}if(_[_0x8ba1('0x32')](_0x2a4cd8[_0x8ba1('0x2a')]['mapKey'])){return _0x45e09d(_0x4af57b[_0x8ba1('0x15')](0x1f4,_0x8ba1('0x36')+_0x5828bf));}if(!_['includes'](_0x5828bf,_0x2a4cd8['body'][_0x8ba1('0x37')])){return _0x45e09d(_0x4af57b[_0x8ba1('0x15')](0x1f4,_0x8ba1('0x38')+_0x5828bf));}var _0x12e53e={};_0x12e53e[_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x37')]]=_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x33')];return db[_0x8ba1('0x1b')][_0x8ba1('0x25')]({'where':{'id':_0x2a4cd8[_0x8ba1('0x39')]['id']},'include':[{'model':db[_0x8ba1('0x3a')],'as':_0x8ba1('0x3b'),'include':[{'model':db['CmContact'],'as':_0x8ba1('0x3c'),'where':_0x12e53e,'limit':0x1,'order':[[_0x8ba1('0x3d'),_0x8ba1('0x3e')]]}]},{'model':db[_0x8ba1('0x3f')],'as':_0x8ba1('0x40')},{'model':db[_0x8ba1('0x41')],'as':_0x8ba1('0x42'),'include':[{'model':db[_0x8ba1('0x43')],'as':_0x8ba1('0x43')}]}]})[_0x8ba1('0xf')](function(_0xae04af){if(_0xae04af&&_0xae04af[_0x8ba1('0x3b')]){var _0x35772c=_0xae04af[_0x8ba1('0x44')]({'plain':!![]});_0x849fbe['account']=_[_0x8ba1('0x45')](_0x35772c,[_0x8ba1('0x40'),'List']);_0x849fbe[_0x8ba1('0x39')][_0x8ba1('0x46')]=_0xae04af[_0x8ba1('0x47')]();_0x849fbe[_0x8ba1('0x48')]=_0x35772c[_0x8ba1('0x40')];_0x849fbe['list']=_0x35772c['List'];_0x849fbe[_0x8ba1('0x48')]=_[_0x8ba1('0x49')](_0x849fbe['applications'],[_0x8ba1('0x4a')],[_0x8ba1('0x4b')]);if(_0x849fbe[_0x8ba1('0x39')]&&_0x849fbe['account'][_0x8ba1('0x4c')]){_0x849fbe[_0x8ba1('0x48')][_0x8ba1('0x4d')]({'id':0x0,'priority':_0x849fbe['applications'][_0x8ba1('0x4e')]+0x1,'app':_0x8ba1('0x4f'),'appdata':_0x8ba1('0x4c'),'interval':_0x8ba1('0x50')});}if(_0x849fbe['account'][_0x8ba1('0x40')]){delete _0x849fbe[_0x8ba1('0x39')][_0x8ba1('0x40')];}if(_0x849fbe[_0x8ba1('0x39')][_0x8ba1('0x3b')]){delete _0x849fbe['account'][_0x8ba1('0x3b')];}if(_0x35772c[_0x8ba1('0x3b')][_0x8ba1('0x3c')][_0x8ba1('0x4e')]){return _0x35772c['List'][_0x8ba1('0x3c')][0x0];}var _0x118f5f=_[_0x8ba1('0xc')](_0x2a4cd8[_0x8ba1('0x2a')],{'firstName':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x33')],'ListId':_0x35772c['ListId']});_0x118f5f[_0x2a4cd8[_0x8ba1('0x2a')]['mapKey']]=_0x2a4cd8['body'][_0x8ba1('0x33')];return db['CmContact'][_0x8ba1('0x51')](_0x118f5f);}else{throw new Error(_0x8ba1('0x52'));}})['then'](function(_0x446976){_0x849fbe['contact']=_0x446976;if(_0x446976){if(!_0x2a4cd8['body'][_0x8ba1('0x18')]['messageId']){_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')][_0x8ba1('0x53')]=rs[_0x8ba1('0x54')]()+'\x20'+_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')]['from'];}var _0x2238d5={'ContactId':_0x446976['id'],'MailAccountId':_0x2a4cd8['account']['id'],'inReplyTo':_0x2a4cd8[_0x8ba1('0x2a')]['message'][_0x8ba1('0x53')],'to':_0x2a4cd8['body'][_0x8ba1('0x18')][_0x8ba1('0x33')],'cc':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')]['cc'],'subject':_0x2a4cd8[_0x8ba1('0x2a')]['message']['subject'],'attach':_0x2a4cd8['body']['message'][_0x8ba1('0x55')],'lastMsgAt':moment()[_0x8ba1('0x56')](_0x8ba1('0x57')),'lastMsgDirection':'in'};return db[_0x8ba1('0x58')]['find']({'where':{'closed':![],'MailAccountId':_0x2a4cd8[_0x8ba1('0x39')]['id']},'include':[{'model':db[_0x8ba1('0x59')],'as':_0x8ba1('0x5a'),'attributes':[_0x8ba1('0x53')],'where':{'messageId':_0x2a4cd8['body']['message']['inReplyTo']}}]})[_0x8ba1('0xf')](function(_0x5d19a8){if(_0x5d19a8){return[_0x5d19a8,![]];}return db[_0x8ba1('0x58')][_0x8ba1('0x51')](_0x2238d5)[_0x8ba1('0xf')](function(_0x5717b3){return[_0x5717b3,!![]];});});}else{throw new Error(_0x8ba1('0x5b'));}})['spread'](function(_0xb7dac4,_0x26bb89){if(_0xb7dac4){_0x16bdb1=_0x26bb89;if(!_0x26bb89){return _0xb7dac4[_0x8ba1('0x5c')]({'inReplyTo':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')][_0x8ba1('0x53')],'to':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')][_0x8ba1('0x33')],'cc':_0x2a4cd8['body'][_0x8ba1('0x18')]['cc'],'subject':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')][_0x8ba1('0x5d')],'attach':_0xb7dac4[_0x8ba1('0x55')]?_0xb7dac4[_0x8ba1('0x55')]:_0x2a4cd8['body'][_0x8ba1('0x18')][_0x8ba1('0x55')],'substatus':null,'substatusAt':moment()['format'](_0x8ba1('0x57')),'lastMsgAt':moment()[_0x8ba1('0x56')](_0x8ba1('0x57')),'lastMsgDirection':'in'});}else{return _0xb7dac4;}}})[_0x8ba1('0xf')](function(_0x5c7fe2){_0x849fbe[_0x8ba1('0x5e')]=_0x5c7fe2[_0x8ba1('0x44')]({'plain':!![]});_0x849fbe[_0x8ba1('0x5e')][_0x8ba1('0x5f')]=_0x16bdb1;return db[_0x8ba1('0x59')][_0x8ba1('0x51')]({'body':_0x2a4cd8['body'][_0x8ba1('0x2a')],'MailAccountId':_0x2a4cd8[_0x8ba1('0x39')]['id'],'MailInteractionId':_0x5c7fe2['id'],'direction':'in','ContactId':_0x849fbe[_0x8ba1('0x60')]['id'],'messageId':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')][_0x8ba1('0x53')],'from':_0x2a4cd8[_0x8ba1('0x2a')]['message'][_0x8ba1('0x33')],'to':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')]['to'],'cc':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')]['cc'],'subject':_0x2a4cd8[_0x8ba1('0x2a')]['message'][_0x8ba1('0x5d')],'attach':_0x2a4cd8['body'][_0x8ba1('0x18')]['attach'],'Attachments':_0x2a4cd8['body']['message'][_0x8ba1('0x61')],'originTo':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')]['originTo'],'originCc':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')][_0x8ba1('0x62')],'bcc':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')][_0x8ba1('0x63')],'ChatWebsiteId':_0x2a4cd8[_0x8ba1('0x2a')][_0x8ba1('0x18')]['ChatWebsiteId']||null,'originChannel':_0x2a4cd8[_0x8ba1('0x2a')]['message'][_0x8ba1('0x64')]||_0x8ba1('0x65'),'ChatOfflineMessageId':_0x2a4cd8[_0x8ba1('0x2a')]['message'][_0x8ba1('0x66')]||null},{'include':[{'model':db[_0x8ba1('0x67')],'as':_0x8ba1('0x68')}]});})[_0x8ba1('0xf')](function(_0x99dd9e){_0x849fbe[_0x8ba1('0x18')]=_0x99dd9e;if(!_0x849fbe['interaction'][_0x8ba1('0x69')]){return;}return db[_0x8ba1('0x6a')]['find']({'attributes':['id',_0x8ba1('0x6b')],'where':{'id':_0x849fbe[_0x8ba1('0x5e')][_0x8ba1('0x69')]}});})[_0x8ba1('0xf')](function(_0x472c72){if(_0x472c72){_0x849fbe['applications'][_0x8ba1('0x6c')]({'id':0x0,'priority':0x0,'app':_0x8ba1('0x6d'),'appdata':_0x472c72[_0x8ba1('0x6b')]+','+(_0x849fbe[_0x8ba1('0x39')][_0x8ba1('0x6e')]||0xa),'interval':_0x8ba1('0x50')});}if(!_0x849fbe[_0x8ba1('0x5e')][_0x8ba1('0x6f')]){return;}return db['MailQueue'][_0x8ba1('0x25')]({'attributes':['id',_0x8ba1('0x6b')],'where':{'id':_0x849fbe['interaction'][_0x8ba1('0x6f')]}});})[_0x8ba1('0xf')](function(_0x4876cd){if(_0x4876cd){_0x849fbe['applications'][_0x8ba1('0x6c')]({'id':0x0,'priority':0x1,'app':_0x8ba1('0x70'),'appdata':_0x4876cd[_0x8ba1('0x6b')]+','+(_0x849fbe['account'][_0x8ba1('0x71')]||0x12c),'interval':_0x8ba1('0x50')});}return respondWithRpcPromise('Start',_0x8ba1('0x72'),_0x849fbe);})[_0x8ba1('0xf')](function(_0x365f15){_0xf8c3b(_0x365f15);})[_0x8ba1('0x24')](function(_0x531104){_0x45e09d(_0x4af57b['error'](0x1f4,_0x531104[_0x8ba1('0x18')]));});});}; \ No newline at end of file +var _0x7c09=['applications','push','length','close','*,*,*,*','defaults','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','Contact\x20not\x20found','spread','update','format','interaction','get','created','MailMessage','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments','User','name','UserId','unshift','agent','queueId','Start','startRouting','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','options','raw','where','attributes','include','map','model','MailAccount','find','smtp','setDataValue','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List','Contacts','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','list','priority','asc','autoclose'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7c09,0x102));var _0x97c0=function(_0x50c342,_0x26d8f1){_0x50c342=_0x50c342-0x0;var _0x6cf313=_0x7c09[_0x50c342];return _0x6cf313;};'use strict';var _=require('lodash');var moment=require(_0x97c0('0x0'));var BPromise=require(_0x97c0('0x1'));var rs=require('randomstring');var Redis=require(_0x97c0('0x2'));var db=require(_0x97c0('0x3'))['db'];var logger=require(_0x97c0('0x4'))(_0x97c0('0x5'));var config=require(_0x97c0('0x6'));var jayson=require(_0x97c0('0x7'));var client=jayson[_0x97c0('0x8')]['http']({'port':0x232c});config['redis']=_['defaults'](config[_0x97c0('0x9')],{'host':_0x97c0('0xa'),'port':0x18eb});var socket=require(_0x97c0('0xb'))(new Redis(config[_0x97c0('0x9')]));require(_0x97c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x205520,_0x4ac5f1,_0x2d5507){return new BPromise(function(_0x28cac4,_0x52bce2){return client['request'](_0x205520,_0x2d5507)[_0x97c0('0xd')](function(_0x340112){logger[_0x97c0('0xe')](_0x97c0('0xf'),_0x4ac5f1,_0x97c0('0x10'));logger[_0x97c0('0x11')](_0x97c0('0x12'),_0x4ac5f1,_0x97c0('0x10'),JSON[_0x97c0('0x13')](_0x340112));if(_0x340112[_0x97c0('0x14')]){if(_0x340112[_0x97c0('0x14')][_0x97c0('0x15')]===0x1f4){logger[_0x97c0('0x14')]('MailAccount,\x20%s,\x20%s',_0x4ac5f1,_0x340112[_0x97c0('0x14')][_0x97c0('0x16')]);return _0x52bce2(_0x340112[_0x97c0('0x14')]['message']);}logger[_0x97c0('0x14')](_0x97c0('0xf'),_0x4ac5f1,_0x340112[_0x97c0('0x14')][_0x97c0('0x16')]);return _0x28cac4(_0x340112[_0x97c0('0x14')][_0x97c0('0x16')]);}else{logger['info'](_0x97c0('0xf'),_0x4ac5f1,_0x97c0('0x10'));_0x28cac4(_0x340112['result'][_0x97c0('0x16')]);}})[_0x97c0('0x17')](function(_0x179d43){logger[_0x97c0('0x14')](_0x97c0('0xf'),_0x4ac5f1,_0x179d43);_0x52bce2(_0x179d43);});});}exports[_0x97c0('0x18')]=function(_0x4fed42){var _0x1eeaf0=this;return new Promise(function(_0x432705,_0x323863){return db['MailAccount']['findAll']({'raw':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x4fed42['options']?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1b')]||null:null,'attributes':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1c')]||null:null,'limit':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')]['limit']||null:null,'include':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x4fed42['options'][_0x97c0('0x1d')],function(_0x14cada){return{'model':db[_0x14cada['model']],'as':_0x14cada['as'],'attributes':_0x14cada[_0x97c0('0x1c')],'include':_0x14cada[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x14cada['include'],function(_0x4f11ba){return{'model':db[_0x4f11ba['model']],'as':_0x4f11ba['as'],'attributes':_0x4f11ba[_0x97c0('0x1c')],'include':_0x4f11ba[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x4f11ba[_0x97c0('0x1d')],function(_0x26939e){return{'model':db[_0x26939e[_0x97c0('0x1f')]],'as':_0x26939e['as'],'attributes':_0x26939e['attributes']};}):[]};}):[]};}):[]:[]})[_0x97c0('0xd')](function(_0x1c183f){logger[_0x97c0('0xe')]('GetMailAccount',_0x4fed42);logger[_0x97c0('0x11')](_0x97c0('0x18'),_0x4fed42,JSON[_0x97c0('0x13')](_0x1c183f));_0x432705(_0x1c183f);})[_0x97c0('0x17')](function(_0x2a7b2b){logger['error']('GetMailAccount',_0x2a7b2b[_0x97c0('0x16')],_0x4fed42);_0x323863(_0x1eeaf0[_0x97c0('0x14')](0x1f4,_0x2a7b2b[_0x97c0('0x16')]));});});};exports['ShowMailAccount']=function(_0xdedd82){var _0x1cebe7=this;return new Promise(function(_0x52bdfe,_0x30147b){return db[_0x97c0('0x20')][_0x97c0('0x21')]({'raw':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1a')]===undefined?!![]:![]:!![],'where':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1b')]||null:null,'attributes':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1c')]||null:null,'include':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1d')]?_['map'](_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1d')],function(_0x2b7f9a){return{'model':db[_0x2b7f9a[_0x97c0('0x1f')]],'as':_0x2b7f9a['as'],'attributes':_0x2b7f9a[_0x97c0('0x1c')],'include':_0x2b7f9a[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x2b7f9a[_0x97c0('0x1d')],function(_0x582828){return{'model':db[_0x582828[_0x97c0('0x1f')]],'as':_0x582828['as'],'attributes':_0x582828['attributes'],'include':_0x582828[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x582828[_0x97c0('0x1d')],function(_0x3988d3){return{'model':db[_0x3988d3[_0x97c0('0x1f')]],'as':_0x3988d3['as'],'attributes':_0x3988d3[_0x97c0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97c0('0xd')](function(_0x225ca4){if(_0xdedd82[_0x97c0('0x19')][_0x97c0('0x22')]===!![])_0x225ca4[_0x97c0('0x23')]('smtpOptions',_0x225ca4[_0x97c0('0x24')]());logger[_0x97c0('0xe')]('ShowMailAccount',_0xdedd82);logger[_0x97c0('0x11')](_0x97c0('0x25'),_0xdedd82,JSON[_0x97c0('0x13')](_0x225ca4));_0x52bdfe(_0x225ca4);})[_0x97c0('0x17')](function(_0x59a9d8){logger[_0x97c0('0x14')]('ShowMailAccount',_0x59a9d8[_0x97c0('0x16')],_0xdedd82);_0x30147b(_0x1cebe7[_0x97c0('0x14')](0x1f4,_0x59a9d8['message']));});});};exports[_0x97c0('0x26')]=function(_0x163ebb){var _0xd728dd=this;return new Promise(function(_0xb13649,_0x33b034){var _0x2121e8={'body':_0x163ebb[_0x97c0('0x27')],'channel':_0x97c0('0x28')};var _0x1fd594=_[_0x97c0('0x29')](_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')]),['createdAt',_0x97c0('0x2d'),_0x97c0('0x2e'),_0x97c0('0x2f')]);var _0x142421=![];if(_0x163ebb[_0x97c0('0x27')]['id']){delete _0x163ebb[_0x97c0('0x27')]['id'];}if(_[_0x97c0('0x30')](_0x163ebb['body']['from'])){return _0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x97c0('0x31')));}if(_[_0x97c0('0x30')](_0x163ebb[_0x97c0('0x27')][_0x97c0('0x27')])||_0x163ebb['body']['body']===''){return _0x33b034(_0xd728dd['error'](0x1f4,_0x97c0('0x32')));}if(_['isNil'](_0x163ebb['body'][_0x97c0('0x33')])){return _0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x97c0('0x34')+_0x1fd594));}if(!_[_0x97c0('0x35')](_0x1fd594,_0x163ebb[_0x97c0('0x27')]['mapKey'])){return _0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x97c0('0x36')+_0x1fd594));}var _0x342eeb={};_0x342eeb[_0x163ebb[_0x97c0('0x27')][_0x97c0('0x33')]]=_0x163ebb[_0x97c0('0x27')][_0x97c0('0x37')];return db[_0x97c0('0x20')][_0x97c0('0x21')]({'where':{'id':_0x163ebb[_0x97c0('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x97c0('0x39'),'include':[{'model':db[_0x97c0('0x2b')],'as':_0x97c0('0x3a'),'where':_0x342eeb,'limit':0x1,'order':[[_0x97c0('0x2d'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x97c0('0x3b')},{'model':db[_0x97c0('0x3c')],'as':_0x97c0('0x3d'),'include':[{'model':db['CloudProvider'],'as':_0x97c0('0x3e')}]}]})[_0x97c0('0xd')](function(_0x240f68){if(_0x240f68&&_0x240f68[_0x97c0('0x39')]){var _0x122524=_0x240f68['get']({'plain':!![]});_0x2121e8[_0x97c0('0x38')]=_[_0x97c0('0x3f')](_0x122524,[_0x97c0('0x3b'),'List']);_0x2121e8['account'][_0x97c0('0x40')]=_0x240f68['getSmtpOptions']();_0x2121e8['applications']=_0x122524[_0x97c0('0x3b')];_0x2121e8[_0x97c0('0x41')]=_0x122524[_0x97c0('0x39')];_0x2121e8['applications']=_['orderBy'](_0x2121e8['applications'],[_0x97c0('0x42')],[_0x97c0('0x43')]);if(_0x2121e8[_0x97c0('0x38')]&&_0x2121e8[_0x97c0('0x38')][_0x97c0('0x44')]){_0x2121e8[_0x97c0('0x45')][_0x97c0('0x46')]({'id':0x0,'priority':_0x2121e8['applications'][_0x97c0('0x47')]+0x1,'app':_0x97c0('0x48'),'appdata':_0x97c0('0x44'),'interval':_0x97c0('0x49')});}if(_0x2121e8[_0x97c0('0x38')][_0x97c0('0x3b')]){delete _0x2121e8['account'][_0x97c0('0x3b')];}if(_0x2121e8[_0x97c0('0x38')]['List']){delete _0x2121e8[_0x97c0('0x38')][_0x97c0('0x39')];}if(_0x122524[_0x97c0('0x39')][_0x97c0('0x3a')][_0x97c0('0x47')]){return _0x122524[_0x97c0('0x39')][_0x97c0('0x3a')][0x0];}var _0x4e2cec=_[_0x97c0('0x4a')](_0x163ebb[_0x97c0('0x27')],{'firstName':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x37')],'ListId':_0x122524[_0x97c0('0x2f')]});_0x4e2cec[_0x163ebb[_0x97c0('0x27')][_0x97c0('0x33')]]=_0x163ebb[_0x97c0('0x27')][_0x97c0('0x37')];return db[_0x97c0('0x2b')][_0x97c0('0x4b')](_0x4e2cec);}else{throw new Error(_0x97c0('0x4c'));}})[_0x97c0('0xd')](function(_0x57766f){_0x2121e8[_0x97c0('0x4d')]=_0x57766f;if(_0x57766f){if(!_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x4e')]){_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['messageId']=rs[_0x97c0('0x4f')]()+'\x20'+_0x163ebb[_0x97c0('0x27')]['message'][_0x97c0('0x37')];}var _0x3c9f09={'ContactId':_0x57766f['id'],'MailAccountId':_0x163ebb[_0x97c0('0x38')]['id'],'inReplyTo':_0x163ebb['body'][_0x97c0('0x16')]['messageId'],'to':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x37')],'cc':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['cc'],'subject':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x50')],'attach':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x51')],'lastMsgAt':moment()['format'](_0x97c0('0x52')),'lastMsgDirection':'in'};return db[_0x97c0('0x53')][_0x97c0('0x21')]({'where':{'closed':![],'MailAccountId':_0x163ebb[_0x97c0('0x38')]['id']},'include':[{'model':db['MailMessage'],'as':_0x97c0('0x54'),'attributes':[_0x97c0('0x4e')],'where':{'messageId':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['inReplyTo']}}]})[_0x97c0('0xd')](function(_0x3c4c27){if(_0x3c4c27){return[_0x3c4c27,![]];}return db[_0x97c0('0x53')]['create'](_0x3c9f09)[_0x97c0('0xd')](function(_0x1f8ea9){return[_0x1f8ea9,!![]];});});}else{throw new Error(_0x97c0('0x55'));}})[_0x97c0('0x56')](function(_0x373c34,_0x1838c9){if(_0x373c34){_0x142421=_0x1838c9;if(!_0x1838c9){return _0x373c34[_0x97c0('0x57')]({'inReplyTo':_0x163ebb['body']['message'][_0x97c0('0x4e')],'to':_0x163ebb[_0x97c0('0x27')]['message'][_0x97c0('0x37')],'cc':_0x163ebb['body']['message']['cc'],'subject':_0x163ebb[_0x97c0('0x27')]['message'][_0x97c0('0x50')],'attach':_0x373c34[_0x97c0('0x51')]?_0x373c34['attach']:_0x163ebb['body']['message'][_0x97c0('0x51')],'substatus':null,'substatusAt':moment()['format'](_0x97c0('0x52')),'lastMsgAt':moment()[_0x97c0('0x58')](_0x97c0('0x52')),'lastMsgDirection':'in'});}else{return _0x373c34;}}})[_0x97c0('0xd')](function(_0x400a8d){_0x2121e8[_0x97c0('0x59')]=_0x400a8d[_0x97c0('0x5a')]({'plain':!![]});_0x2121e8[_0x97c0('0x59')][_0x97c0('0x5b')]=_0x142421;return db[_0x97c0('0x5c')][_0x97c0('0x4b')]({'body':_0x163ebb['body'][_0x97c0('0x27')],'MailAccountId':_0x163ebb[_0x97c0('0x38')]['id'],'MailInteractionId':_0x400a8d['id'],'direction':'in','ContactId':_0x2121e8[_0x97c0('0x4d')]['id'],'messageId':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['messageId'],'from':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['from'],'to':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['to'],'cc':_0x163ebb[_0x97c0('0x27')]['message']['cc'],'subject':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x50')],'attach':_0x163ebb[_0x97c0('0x27')]['message']['attach'],'Attachments':_0x163ebb['body'][_0x97c0('0x16')][_0x97c0('0x5d')],'originTo':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x5e')],'originCc':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x5f')],'bcc':_0x163ebb['body']['message'][_0x97c0('0x60')],'ChatWebsiteId':_0x163ebb['body']['message']['ChatWebsiteId']||null,'originChannel':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x61')]||_0x97c0('0x62'),'ChatOfflineMessageId':_0x163ebb[_0x97c0('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x97c0('0x63')],'as':_0x97c0('0x64')}]});})[_0x97c0('0xd')](function(_0x3a8ac0){_0x2121e8['message']=_0x3a8ac0;if(!_0x2121e8[_0x97c0('0x59')]['UserId']){return;}return db[_0x97c0('0x65')][_0x97c0('0x21')]({'attributes':['id',_0x97c0('0x66')],'where':{'id':_0x2121e8[_0x97c0('0x59')][_0x97c0('0x67')]}});})[_0x97c0('0xd')](function(_0x2c00c4){if(_0x2c00c4){_0x2121e8[_0x97c0('0x45')][_0x97c0('0x68')]({'id':0x0,'priority':0x0,'app':_0x97c0('0x69'),'appdata':_0x2c00c4['name']+','+(_0x2121e8[_0x97c0('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x2121e8[_0x97c0('0x59')][_0x97c0('0x6a')]){return;}return db['MailQueue'][_0x97c0('0x21')]({'attributes':['id','name'],'where':{'id':_0x2121e8[_0x97c0('0x59')][_0x97c0('0x6a')]}});})['then'](function(_0x2d5b54){if(_0x2d5b54){_0x2121e8['applications']['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2d5b54[_0x97c0('0x66')]+','+(_0x2121e8[_0x97c0('0x38')]['waitForTheAssignedQueue']||0x12c),'interval':_0x97c0('0x49')});}return respondWithRpcPromise(_0x97c0('0x6b'),_0x97c0('0x6c'),_0x2121e8);})[_0x97c0('0xd')](function(_0x41b864){_0xb13649(_0x41b864);})[_0x97c0('0x17')](function(_0x10f3cb){_0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x10f3cb['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 146477c..dbc2f01 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 _0x1573=['mailAccount:','./mailAccount.events','update','emit','removeListener','register'];(function(_0x503254,_0x29e551){var _0x383dcc=function(_0x3c27fb){while(--_0x3c27fb){_0x503254['push'](_0x503254['shift']());}};_0x383dcc(++_0x29e551);}(_0x1573,0x193));var _0x3157=function(_0x445024,_0x36dca6){_0x445024=_0x445024-0x0;var _0x5ab19a=_0x1573[_0x445024];return _0x5ab19a;};'use strict';var MailAccountEvents=require(_0x3157('0x0'));var events=['save','remove',_0x3157('0x1')];function createListener(_0xd6db29,_0x3e1885){return function(_0x444ccd){_0x3e1885[_0x3157('0x2')](_0xd6db29,_0x444ccd);};}function removeListener(_0x279839,_0x42275e){return function(){MailAccountEvents[_0x3157('0x3')](_0x279839,_0x42275e);};}exports[_0x3157('0x4')]=function(_0x5f223f){for(var _0x56d6f2=0x0,_0x241180=events['length'];_0x56d6f2<_0x241180;_0x56d6f2++){var _0xdf0242=events[_0x56d6f2];var _0x50d21d=createListener(_0x3157('0x5')+_0xdf0242,_0x5f223f);MailAccountEvents['on'](_0xdf0242,_0x50d21d);}}; \ No newline at end of file +var _0x709b=['update','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x2db522,_0x52e4e2){var _0x5c9a1c=function(_0x502e82){while(--_0x502e82){_0x2db522['push'](_0x2db522['shift']());}};_0x5c9a1c(++_0x52e4e2);}(_0x709b,0x97));var _0xb709=function(_0x2b96d6,_0x4e620d){_0x2b96d6=_0x2b96d6-0x0;var _0x3848e5=_0x709b[_0x2b96d6];return _0x3848e5;};'use strict';var MailAccountEvents=require(_0xb709('0x0'));var events=[_0xb709('0x1'),_0xb709('0x2'),_0xb709('0x3')];function createListener(_0x15c796,_0x2c2572){return function(_0x32da58){_0x2c2572['emit'](_0x15c796,_0x32da58);};}function removeListener(_0x10e687,_0x5a90d4){return function(){MailAccountEvents['removeListener'](_0x10e687,_0x5a90d4);};}exports[_0xb709('0x4')]=function(_0x30ac18){for(var _0x54aaaf=0x0,_0x35ca0b=events[_0xb709('0x5')];_0x54aaaf<_0x35ca0b;_0x54aaaf++){var _0x3ab9c2=events[_0x54aaaf];var _0x269330=createListener(_0xb709('0x6')+_0x3ab9c2,_0x30ac18);MailAccountEvents['on'](_0x3ab9c2,_0x269330);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9cacacf..63b1471 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 _0xc04e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x39f138,_0x2cbae5){var _0x2fa49b=function(_0x388472){while(--_0x388472){_0x39f138['push'](_0x39f138['shift']());}};_0x2fa49b(++_0x2cbae5);}(_0xc04e,0x10b));var _0xec04=function(_0x860d6b,_0x458396){_0x860d6b=_0x860d6b-0x0;var _0x33323d=_0xc04e[_0x860d6b];return _0x33323d;};'use strict';var multer=require(_0xec04('0x0'));var util=require(_0xec04('0x1'));var path=require('path');var timeout=require(_0xec04('0x2'));var express=require('express');var router=express[_0xec04('0x3')]();var fs_extra=require(_0xec04('0x4'));var auth=require(_0xec04('0x5'));var interaction=require(_0xec04('0x6'));var config=require(_0xec04('0x7'));var controller=require(_0xec04('0x8'));router[_0xec04('0x9')]('/:id',auth[_0xec04('0xa')](),controller[_0xec04('0xb')]);router[_0xec04('0xc')](_0xec04('0xd'),auth[_0xec04('0xa')](),controller[_0xec04('0xe')]);router[_0xec04('0xf')](_0xec04('0xd'),auth['isAuthenticated'](),controller[_0xec04('0x10')]);module[_0xec04('0x11')]=router; \ No newline at end of file +var _0x0d72=['path','express','Router','fs-extra','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x0d72,0x1b2));var _0x20d7=function(_0x314768,_0x454d9b){_0x314768=_0x314768-0x0;var _0x440e99=_0x0d72[_0x314768];return _0x440e99;};'use strict';var multer=require('multer');var util=require(_0x20d7('0x0'));var path=require(_0x20d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x20d7('0x2'));var router=express[_0x20d7('0x3')]();var fs_extra=require(_0x20d7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20d7('0x5'));var controller=require(_0x20d7('0x6'));router['get'](_0x20d7('0x7'),auth[_0x20d7('0x8')](),controller[_0x20d7('0x9')]);router[_0x20d7('0xa')](_0x20d7('0x7'),auth[_0x20d7('0x8')](),controller[_0x20d7('0xb')]);router[_0x20d7('0xc')]('/:id',auth[_0x20d7('0x8')](),controller[_0x20d7('0xd')]);module[_0x20d7('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 202ad07..3cdd76a 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 _0x6589=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x4abfae,_0x200993){var _0x27a19a=function(_0x21ff52){while(--_0x21ff52){_0x4abfae['push'](_0x4abfae['shift']());}};_0x27a19a(++_0x200993);}(_0x6589,0xd7));var _0x9658=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x6589[_0xf0ec6e];return _0x8bbc27;};'use strict';var Sequelize=require(_0x9658('0x0'));module[_0x9658('0x1')]={'priority':{'type':Sequelize[_0x9658('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9658('0x3')],'allowNull':![],'defaultValue':_0x9658('0x4')},'appdata':{'type':Sequelize[_0x9658('0x5')]()},'description':{'type':Sequelize[_0x9658('0x3')]},'interval':{'type':Sequelize[_0x9658('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8770=['*,*,*,*','sequelize','exports','STRING'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x8770,0x1b1));var _0x0877=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8770[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x0877('0x0'));module[_0x0877('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0877('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0877('0x2')]},'interval':{'type':Sequelize[_0x0877('0x2')],'defaultValue':_0x0877('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 157972a..3a97221 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 _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x248713,_0x88a1dd){var _0x265647=function(_0x4f3324){while(--_0x4f3324){_0x248713['push'](_0x248713['shift']());}};_0x265647(++_0x88a1dd);}(_0xda3f,0xec));var _0xfda3=function(_0x46c519,_0x4f63a3){_0x46c519=_0x46c519-0x0;var _0x3e4a7d=_0xda3f[_0x46c519];return _0x3e4a7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file +var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x52348e,_0x2c69b0){var _0x8c7069=function(_0x27539d){while(--_0x27539d){_0x52348e['push'](_0x52348e['shift']());}};_0x8c7069(++_0x2c69b0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49d540,_0x494e7c){_0x49d540=_0x49d540-0x0;var _0x234b28=_0xb43b[_0x49d540];return _0x234b28;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a7d55e0..a2e5dd0 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 _0x2fc1=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4'];(function(_0x380575,_0xc72d46){var _0x15080a=function(_0x5f1ac5){while(--_0x5f1ac5){_0x380575['push'](_0x380575['shift']());}};_0x15080a(++_0xc72d46);}(_0x2fc1,0xdc));var _0x12fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x12fc('0x0'));var util=require(_0x12fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x12fc('0x2'));var BPromise=require(_0x12fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12fc('0x4'));var rimraf=require(_0x12fc('0x5'));var config=require(_0x12fc('0x6'));var attributes=require(_0x12fc('0x7'));module[_0x12fc('0x8')]=function(_0x184f6e,_0x19bafc){return _0x184f6e['define']('MailApplication',attributes,{'tableName':_0x12fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12fc('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc74b=['bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xc74b,0x18b));var _0xbc74=function(_0x2386a2,_0x36193d){_0x2386a2=_0x2386a2-0x0;var _0x17c157=_0xc74b[_0x2386a2];return _0x17c157;};'use strict';var _=require(_0xbc74('0x0'));var util=require(_0xbc74('0x1'));var logger=require(_0xbc74('0x2'))(_0xbc74('0x3'));var moment=require(_0xbc74('0x4'));var BPromise=require(_0xbc74('0x5'));var rp=require(_0xbc74('0x6'));var fs=require('fs');var path=require(_0xbc74('0x7'));var rimraf=require(_0xbc74('0x8'));var config=require(_0xbc74('0x9'));var attributes=require(_0xbc74('0xa'));module[_0xbc74('0xb')]=function(_0x30f051,_0x223988){return _0x30f051[_0xbc74('0xc')](_0xbc74('0xd'),attributes,{'tableName':_0xbc74('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc74('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f175c1b..845232a 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 _0x5333=['request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailApplication','body','options','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client'];(function(_0x58ae29,_0x390f56){var _0x7dd07d=function(_0x4217dd){while(--_0x4217dd){_0x58ae29['push'](_0x58ae29['shift']());}};_0x7dd07d(++_0x390f56);}(_0x5333,0x13c));var _0x3533=function(_0x257e30,_0x1b70f9){_0x257e30=_0x257e30-0x0;var _0x40cea4=_0x5333[_0x257e30];return _0x40cea4;};'use strict';var _=require(_0x3533('0x0'));var util=require(_0x3533('0x1'));var moment=require(_0x3533('0x2'));var BPromise=require(_0x3533('0x3'));var rs=require(_0x3533('0x4'));var fs=require('fs');var Redis=require(_0x3533('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3533('0x6'))('rpc');var config=require(_0x3533('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3533('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dfbde,_0x5f244c,_0x549e79){return new BPromise(function(_0x470c0c,_0x1b74e1){return client[_0x3533('0x9')](_0x1dfbde,_0x549e79)[_0x3533('0xa')](function(_0xd004ec){logger[_0x3533('0xb')](_0x3533('0xc'),_0x5f244c,_0x3533('0xd'));logger[_0x3533('0xe')](_0x3533('0xf'),_0x5f244c,_0x3533('0xd'),JSON[_0x3533('0x10')](_0xd004ec));if(_0xd004ec[_0x3533('0x11')]){if(_0xd004ec['error'][_0x3533('0x12')]===0x1f4){logger[_0x3533('0x11')](_0x3533('0xc'),_0x5f244c,_0xd004ec['error']['message']);return _0x1b74e1(_0xd004ec['error'][_0x3533('0x13')]);}logger[_0x3533('0x11')](_0x3533('0xc'),_0x5f244c,_0xd004ec[_0x3533('0x11')]['message']);return _0x470c0c(_0xd004ec[_0x3533('0x11')]['message']);}else{logger[_0x3533('0xb')]('MailApplication,\x20%s,\x20%s',_0x5f244c,_0x3533('0xd'));_0x470c0c(_0xd004ec['result'][_0x3533('0x13')]);}})[_0x3533('0x14')](function(_0x1799eb){logger[_0x3533('0x11')](_0x3533('0xc'),_0x5f244c,_0x1799eb);_0x1b74e1(_0x1799eb);});});}exports[_0x3533('0x15')]=function(_0x40f162){var _0x5d8253=this;return new Promise(function(_0x17057f,_0x54cb45){return db['MailApplication']['update'](_0x40f162[_0x3533('0x16')],{'raw':_0x40f162[_0x3533('0x17')]?_0x40f162['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40f162['options']?_0x40f162[_0x3533('0x17')][_0x3533('0x18')]||null:null,'attributes':_0x40f162[_0x3533('0x17')]?_0x40f162[_0x3533('0x17')]['attributes']||null:null,'limit':_0x40f162[_0x3533('0x17')]?_0x40f162['options']['limit']||null:null})[_0x3533('0xa')](function(_0x364218){logger[_0x3533('0xb')](_0x3533('0x15'),_0x40f162);logger[_0x3533('0xe')]('UpdateMailApplication',_0x40f162,JSON[_0x3533('0x10')](_0x364218));_0x17057f(_0x364218);})[_0x3533('0x14')](function(_0x1d7e1e){logger[_0x3533('0x11')](_0x3533('0x15'),_0x1d7e1e[_0x3533('0x13')],_0x40f162);_0x54cb45(_0x5d8253[_0x3533('0x11')](0x1f4,_0x1d7e1e[_0x3533('0x13')]));});});}; \ No newline at end of file +var _0x5681=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','MailApplication,\x20%s,\x20%s','message','result','MailApplication','update','body','options','raw','where','attributes','UpdateMailApplication','stringify','lodash','moment','bluebird'];(function(_0x5feebd,_0x5aded6){var _0x3ed1e7=function(_0x501676){while(--_0x501676){_0x5feebd['push'](_0x5feebd['shift']());}};_0x3ed1e7(++_0x5aded6);}(_0x5681,0x190));var _0x1568=function(_0x1bcea3,_0x133219){_0x1bcea3=_0x1bcea3-0x0;var _0x12940c=_0x5681[_0x1bcea3];return _0x12940c;};'use strict';var _=require(_0x1568('0x0'));var util=require('util');var moment=require(_0x1568('0x1'));var BPromise=require(_0x1568('0x2'));var rs=require(_0x1568('0x3'));var fs=require('fs');var Redis=require(_0x1568('0x4'));var db=require(_0x1568('0x5'))['db'];var utils=require(_0x1568('0x6'));var logger=require(_0x1568('0x7'))(_0x1568('0x8'));var config=require(_0x1568('0x9'));var jayson=require(_0x1568('0xa'));var client=jayson[_0x1568('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b8fb1,_0x3a22d2,_0x2206ec){return new BPromise(function(_0x4ab05b,_0x366fdd){return client[_0x1568('0xc')](_0x4b8fb1,_0x2206ec)[_0x1568('0xd')](function(_0x58807c){logger[_0x1568('0xe')]('MailApplication,\x20%s,\x20%s',_0x3a22d2,_0x1568('0xf'));logger[_0x1568('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3a22d2,_0x1568('0xf'),JSON['stringify'](_0x58807c));if(_0x58807c[_0x1568('0x11')]){if(_0x58807c[_0x1568('0x11')][_0x1568('0x12')]===0x1f4){logger[_0x1568('0x11')](_0x1568('0x13'),_0x3a22d2,_0x58807c['error'][_0x1568('0x14')]);return _0x366fdd(_0x58807c['error'][_0x1568('0x14')]);}logger['error'](_0x1568('0x13'),_0x3a22d2,_0x58807c['error']['message']);return _0x4ab05b(_0x58807c[_0x1568('0x11')][_0x1568('0x14')]);}else{logger[_0x1568('0xe')](_0x1568('0x13'),_0x3a22d2,_0x1568('0xf'));_0x4ab05b(_0x58807c[_0x1568('0x15')][_0x1568('0x14')]);}})['catch'](function(_0xc3ce91){logger[_0x1568('0x11')](_0x1568('0x13'),_0x3a22d2,_0xc3ce91);_0x366fdd(_0xc3ce91);});});}exports['UpdateMailApplication']=function(_0xee3fcd){var _0x489c52=this;return new Promise(function(_0x36ad13,_0x364f10){return db[_0x1568('0x16')][_0x1568('0x17')](_0xee3fcd[_0x1568('0x18')],{'raw':_0xee3fcd['options']?_0xee3fcd[_0x1568('0x19')][_0x1568('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xee3fcd[_0x1568('0x19')]?_0xee3fcd[_0x1568('0x19')][_0x1568('0x1b')]||null:null,'attributes':_0xee3fcd[_0x1568('0x19')]?_0xee3fcd[_0x1568('0x19')][_0x1568('0x1c')]||null:null,'limit':_0xee3fcd[_0x1568('0x19')]?_0xee3fcd['options']['limit']||null:null})['then'](function(_0x579a5d){logger[_0x1568('0xe')](_0x1568('0x1d'),_0xee3fcd);logger[_0x1568('0x10')](_0x1568('0x1d'),_0xee3fcd,JSON[_0x1568('0x1e')](_0x579a5d));_0x36ad13(_0x579a5d);})['catch'](function(_0x3c970f){logger[_0x1568('0x11')](_0x1568('0x1d'),_0x3c970f[_0x1568('0x14')],_0xee3fcd);_0x364f10(_0x489c52['error'](0x1f4,_0x3c970f[_0x1568('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a0f1c70..291d613 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 _0x1695=['express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','update','destroy','delete','exports'];(function(_0xec81b1,_0x265975){var _0x9d4e74=function(_0x1483d3){while(--_0x1483d3){_0xec81b1['push'](_0xec81b1['shift']());}};_0x9d4e74(++_0x265975);}(_0x1695,0x138));var _0x5169=function(_0x5455cc,_0xb1f2a0){_0x5455cc=_0x5455cc-0x0;var _0x33d313=_0x1695[_0x5455cc];return _0x33d313;};'use strict';var express=require(_0x5169('0x0'));var router=express[_0x5169('0x1')]();var auth=require(_0x5169('0x2'));var interaction=require(_0x5169('0x3'));var controller=require(_0x5169('0x4'));router['get']('/',auth[_0x5169('0x5')](),controller['index']);router[_0x5169('0x6')](_0x5169('0x7'),auth[_0x5169('0x5')](),controller['describe']);router[_0x5169('0x6')](_0x5169('0x8'),auth['isAuthenticated'](),controller[_0x5169('0x9')]);router[_0x5169('0x6')](_0x5169('0xa'),auth[_0x5169('0x5')](),controller[_0x5169('0xb')]);router[_0x5169('0x6')](_0x5169('0xc'),auth[_0x5169('0x5')](),controller['download']);router[_0x5169('0xd')]('/',auth[_0x5169('0x5')](),controller[_0x5169('0xe')]);router[_0x5169('0xd')](_0x5169('0xa'),auth[_0x5169('0x5')](),controller[_0x5169('0xf')]);router[_0x5169('0xd')](_0x5169('0x10'),auth[_0x5169('0x5')](),interaction[_0x5169('0x11')](_0x5169('0x12'),'mailinteraction:addtags'),controller[_0x5169('0x13')]);router[_0x5169('0x14')](_0x5169('0x8'),auth[_0x5169('0x5')](),interaction[_0x5169('0x11')](_0x5169('0x12'),_0x5169('0x15')),controller[_0x5169('0x16')]);router['delete']('/:id',auth[_0x5169('0x5')](),interaction['tracked'](_0x5169('0x12'),'mailinteraction:destroy'),controller[_0x5169('0x17')]);router[_0x5169('0x18')](_0x5169('0x10'),auth[_0x5169('0x5')](),controller['removeTags']);module[_0x5169('0x19')]=router; \ No newline at end of file +var _0xd4e8=['getMessages','/:id/download','download','post','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','mailinteraction:update','update','delete','destroy','exports','express','Router','../../components/auth/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x4a10fe,_0x16124d){var _0x372c12=function(_0x28d306){while(--_0x28d306){_0x4a10fe['push'](_0x4a10fe['shift']());}};_0x372c12(++_0x16124d);}(_0xd4e8,0x116));var _0x8d4e=function(_0x1b4b25,_0x314c18){_0x1b4b25=_0x1b4b25-0x0;var _0x47a055=_0xd4e8[_0x1b4b25];return _0x47a055;};'use strict';var express=require(_0x8d4e('0x0'));var router=express[_0x8d4e('0x1')]();var auth=require(_0x8d4e('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x8d4e('0x3'));router['get']('/',auth[_0x8d4e('0x4')](),controller['index']);router[_0x8d4e('0x5')](_0x8d4e('0x6'),auth[_0x8d4e('0x4')](),controller[_0x8d4e('0x7')]);router[_0x8d4e('0x5')](_0x8d4e('0x8'),auth[_0x8d4e('0x4')](),controller[_0x8d4e('0x9')]);router[_0x8d4e('0x5')]('/:id/messages',auth[_0x8d4e('0x4')](),controller[_0x8d4e('0xa')]);router[_0x8d4e('0x5')](_0x8d4e('0xb'),auth[_0x8d4e('0x4')](),controller[_0x8d4e('0xc')]);router['post']('/',auth[_0x8d4e('0x4')](),controller['create']);router[_0x8d4e('0xd')](_0x8d4e('0xe'),auth[_0x8d4e('0x4')](),controller['addMessage']);router['post'](_0x8d4e('0xf'),auth[_0x8d4e('0x4')](),interaction[_0x8d4e('0x10')](_0x8d4e('0x11'),_0x8d4e('0x12')),controller['addTags']);router['put'](_0x8d4e('0x8'),auth[_0x8d4e('0x4')](),interaction[_0x8d4e('0x10')](_0x8d4e('0x11'),_0x8d4e('0x13')),controller[_0x8d4e('0x14')]);router[_0x8d4e('0x15')]('/:id',auth[_0x8d4e('0x4')](),interaction[_0x8d4e('0x10')](_0x8d4e('0x11'),'mailinteraction:destroy'),controller[_0x8d4e('0x16')]);router[_0x8d4e('0x15')](_0x8d4e('0xf'),auth[_0x8d4e('0x4')](),controller['removeTags']);module[_0x8d4e('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 0987f04..ec88d8f 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 _0x3c5f=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','INTEGER'];(function(_0x428b4a,_0xd7e78c){var _0x1cf605=function(_0x22e116){while(--_0x22e116){_0x428b4a['push'](_0x428b4a['shift']());}};_0x1cf605(++_0xd7e78c);}(_0x3c5f,0x140));var _0xf3c5=function(_0x578b5c,_0x2a1777){_0x578b5c=_0x578b5c-0x0;var _0x197c13=_0x3c5f[_0x578b5c];return _0x197c13;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xf3c5('0x0'));module[_0xf3c5('0x1')]={'closed':{'type':Sequelize[_0xf3c5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf3c5('0x3')]},'disposition':{'type':Sequelize[_0xf3c5('0x4')]},'secondDisposition':{'type':Sequelize[_0xf3c5('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf3c5('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf3c5('0x4')]},'cc':{'type':Sequelize[_0xf3c5('0x5')](_0xf3c5('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xf3c5('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf3c5('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xf3c5('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf3c5('0x7')]('in',_0xf3c5('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf3c5('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf3c5('0x7')]('in',_0xf3c5('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf3c5('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf3c5('0x9')]}}; \ No newline at end of file +var _0xaf47=['out','ENUM','INTEGER','iconv','BOOLEAN','DATE','STRING','TEXT'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0xaf47,0x11b));var _0x7af4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf47[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x7af4('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7af4('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7af4('0x2')]},'disposition':{'type':Sequelize[_0x7af4('0x3')]},'secondDisposition':{'type':Sequelize[_0x7af4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7af4('0x3')](0x1fe)},'to':{'type':Sequelize[_0x7af4('0x3')]},'cc':{'type':Sequelize[_0x7af4('0x4')]('long')},'subject':{'type':Sequelize[_0x7af4('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7af4('0x2')]},'substatus':{'type':Sequelize[_0x7af4('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7af4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7af4('0x6')]('in',_0x7af4('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7af4('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7af4('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 90b773b..8a6239b 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 _0x4412=['transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','headers','Bcc','Attachments','basename','readFileSync','writeFileSync','message%d.eml','rimraf','zip-dir','moment','bluebird','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','defaults','localhost','redis','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','error','name','index','map','rawAttributes','fieldName','type','key','mail','query','user','catch','params','model','keys','filters','attributes','intersection','fields','length','merge','options','MailInteraction','find','create','body','destroy','describe','addMessage','ids','omit','getMessages','MailMessage','nolimit','order','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','inlineCss','true','rows','spread','Tag','color','mailInteractionTags:save','download','unix','toString','join','server','tmp','root','files','attachments','format'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4412,0x158));var _0x2441=function(_0x19504f,_0x1573c0){_0x19504f=_0x19504f-0x0;var _0x561d9b=_0x4412[_0x19504f];return _0x561d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2441('0x0'));var zipdir=require(_0x2441('0x1'));var moment=require(_0x2441('0x2'));var BPromise=require(_0x2441('0x3'));var util=require('util');var path=require(_0x2441('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x2441('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x2441('0x6'));var logger=require(_0x2441('0x7'))(_0x2441('0x8'));var config=require(_0x2441('0x9'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x2441('0xa'));config['redis']=_[_0x2441('0xb')](config['redis'],{'host':_0x2441('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2441('0xd')]));require(_0x2441('0xe'))[_0x2441('0xf')](socket);function respondWithStatusCode(_0x2574c2,_0x5323c0){_0x5323c0=_0x5323c0||0xcc;return function(_0x16652e){if(_0x16652e){return _0x2574c2[_0x2441('0x10')](_0x5323c0);}return _0x2574c2[_0x2441('0x11')](_0x5323c0)[_0x2441('0x12')]();};}function respondWithResult(_0x5950d1,_0x3a2a02){_0x3a2a02=_0x3a2a02||0xc8;return function(_0x2de0c4){if(_0x2de0c4){return _0x5950d1[_0x2441('0x11')](_0x3a2a02)[_0x2441('0x13')](_0x2de0c4);}};}function respondWithFilteredResult(_0x3883e9,_0x2ac284){return function(_0x477f80){if(_0x477f80){var _0x2e6679=typeof _0x2ac284[_0x2441('0x14')]===_0x2441('0x15')&&typeof _0x2ac284[_0x2441('0x16')]==='undefined';var _0x4a3653=_0x477f80[_0x2441('0x17')];var _0x59481d=_0x2e6679?0x0:_0x2ac284[_0x2441('0x14')];var _0x2dd799=_0x2e6679?_0x477f80[_0x2441('0x17')]:_0x2ac284['offset']+_0x2ac284['limit'];var _0x408d3a;if(_0x2dd799>=_0x4a3653){_0x2dd799=_0x4a3653;_0x408d3a=0xc8;}else{_0x408d3a=0xce;}_0x3883e9[_0x2441('0x11')](_0x408d3a);return _0x3883e9['set'](_0x2441('0x18'),_0x59481d+'-'+_0x2dd799+'/'+_0x4a3653)[_0x2441('0x13')](_0x477f80);}return null;};}function saveUpdates(_0x4fca0e){return function(_0x1b7a81){if(_0x1b7a81){return _0x1b7a81[_0x2441('0x19')](_0x4fca0e)[_0x2441('0x1a')](function(_0x5a1a6a){return _0x5a1a6a;});}return null;};}function removeEntity(_0x12e70d){return function(_0x4414bf){if(_0x4414bf){return _0x4414bf['destroy']()[_0x2441('0x1a')](function(){_0x12e70d[_0x2441('0x11')](0xcc)[_0x2441('0x12')]();});}};}function handleEntityNotFound(_0x19f621){return function(_0x56d3eb){if(!_0x56d3eb){_0x19f621[_0x2441('0x10')](0x194);}return _0x56d3eb;};}function handleError(_0xf90243,_0x27eb04){_0x27eb04=_0x27eb04||0x1f4;return function(_0x40339e){logger[_0x2441('0x1b')](_0x40339e['stack']);if(_0x40339e[_0x2441('0x1c')]){delete _0x40339e[_0x2441('0x1c')];}_0xf90243[_0x2441('0x11')](_0x27eb04)['send'](_0x40339e);};}exports[_0x2441('0x1d')]=function(_0x158b2a,_0x2b7494){var _0x500119={};var _0x56f4ae=_[_0x2441('0x1e')](db['MailInteraction'][_0x2441('0x1f')],function(_0xc11f55){return{'name':_0xc11f55[_0x2441('0x20')],'type':_0xc11f55[_0x2441('0x21')][_0x2441('0x22')]};});_0x500119=qs['getOptions'](_0x56f4ae,_0x158b2a);return interaction['findAll'](_0x2441('0x23'),_0x158b2a[_0x2441('0x24')],_0x158b2a[_0x2441('0x25')],_0x500119,_0x56f4ae)[_0x2441('0x1a')](respondWithFilteredResult(_0x2b7494,_0x500119))[_0x2441('0x26')](handleError(_0x2b7494,null));};exports['show']=function(_0x14b7ff,_0xe124bc){var _0x81d49c={'raw':![],'where':{'id':_0x14b7ff[_0x2441('0x27')]['id']}},_0x279e6d={};_0x279e6d[_0x2441('0x28')]=_['keys'](db['MailInteraction'][_0x2441('0x1f')]);_0x279e6d[_0x2441('0x24')]=_[_0x2441('0x29')](_0x14b7ff[_0x2441('0x24')]);_0x279e6d[_0x2441('0x2a')]=_['intersection'](_0x279e6d[_0x2441('0x28')],_0x279e6d[_0x2441('0x24')]);_0x81d49c[_0x2441('0x2b')]=_[_0x2441('0x2c')](_0x279e6d[_0x2441('0x28')],qs[_0x2441('0x2d')](_0x14b7ff['query'][_0x2441('0x2d')]));_0x81d49c['attributes']=_0x81d49c[_0x2441('0x2b')][_0x2441('0x2e')]?_0x81d49c[_0x2441('0x2b')]:_0x279e6d['model'];if(_0x14b7ff['query']['includeAll']){_0x81d49c['include']=[{'all':!![]}];}_0x81d49c=_[_0x2441('0x2f')]({},_0x81d49c,_0x14b7ff[_0x2441('0x30')]);return db[_0x2441('0x31')][_0x2441('0x32')](_0x81d49c)['then'](handleEntityNotFound(_0xe124bc,null))[_0x2441('0x1a')](respondWithResult(_0xe124bc,null))[_0x2441('0x26')](handleError(_0xe124bc,null));};exports['create']=function(_0x8886ea,_0x3688c8){return db['MailInteraction'][_0x2441('0x33')](_0x8886ea['body'],{})[_0x2441('0x1a')](respondWithResult(_0x3688c8,0xc9))[_0x2441('0x26')](handleError(_0x3688c8,null));};exports[_0x2441('0x19')]=function(_0x281a19,_0x1f3c5f){if(_0x281a19[_0x2441('0x34')]['id']){delete _0x281a19[_0x2441('0x34')]['id'];}return db[_0x2441('0x31')][_0x2441('0x32')]({'where':{'id':_0x281a19[_0x2441('0x27')]['id']}})[_0x2441('0x1a')](handleEntityNotFound(_0x1f3c5f,null))['then'](saveUpdates(_0x281a19['body'],null))[_0x2441('0x1a')](respondWithResult(_0x1f3c5f,null))[_0x2441('0x26')](handleError(_0x1f3c5f,null));};exports[_0x2441('0x35')]=function(_0x5597b1,_0x166d33){return db[_0x2441('0x31')]['find']({'where':{'id':_0x5597b1[_0x2441('0x27')]['id']}})[_0x2441('0x1a')](handleEntityNotFound(_0x166d33,null))[_0x2441('0x1a')](removeEntity(_0x166d33,null))[_0x2441('0x26')](handleError(_0x166d33,null));};exports[_0x2441('0x36')]=function(_0x553da6,_0x540874){return db['MailInteraction']['describe']()[_0x2441('0x1a')](respondWithResult(_0x540874,null))[_0x2441('0x26')](handleError(_0x540874,null));};exports[_0x2441('0x37')]=function(_0x5cca7d,_0x557ba6){return db['MailMessage'][_0x2441('0x32')]({'where':{'id':_0x5cca7d[_0x2441('0x27')]['id']}})[_0x2441('0x1a')](handleEntityNotFound(_0x557ba6,null))[_0x2441('0x1a')](function(_0x1f6c66){if(_0x1f6c66){return _0x1f6c66[_0x2441('0x37')](_0x5cca7d[_0x2441('0x34')][_0x2441('0x38')],_[_0x2441('0x39')](_0x5cca7d['body'],['ids','id'])||{});}})[_0x2441('0x1a')](respondWithResult(_0x557ba6,null))['catch'](handleError(_0x557ba6,null));};exports[_0x2441('0x3a')]=function(_0x2300bc,_0x253ff0){var _0x3d7d0b={'raw':![],'where':{}};var _0x132fca={};var _0x139c41={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x2300bc['params']['id']}})['then'](handleEntityNotFound(_0x253ff0,null))['then'](function(_0x4f13d7){if(_0x4f13d7){_0x132fca[_0x2441('0x28')]=_[_0x2441('0x29')](db[_0x2441('0x3b')]['rawAttributes']);_0x132fca[_0x2441('0x24')]=_[_0x2441('0x29')](_0x2300bc['query']);_0x132fca[_0x2441('0x2a')]=_[_0x2441('0x2c')](_0x132fca[_0x2441('0x28')],_0x132fca[_0x2441('0x24')]);_0x3d7d0b['attributes']=_[_0x2441('0x2c')](_0x132fca[_0x2441('0x28')],qs[_0x2441('0x2d')](_0x2300bc[_0x2441('0x24')]['fields']));_0x3d7d0b[_0x2441('0x2b')]=_0x3d7d0b[_0x2441('0x2b')][_0x2441('0x2e')]?_0x3d7d0b['attributes']:_0x132fca[_0x2441('0x28')];if(!_0x2300bc[_0x2441('0x24')]['hasOwnProperty'](_0x2441('0x3c'))){_0x3d7d0b[_0x2441('0x16')]=qs['limit'](_0x2300bc[_0x2441('0x24')][_0x2441('0x16')]);_0x3d7d0b[_0x2441('0x14')]=qs[_0x2441('0x14')](_0x2300bc[_0x2441('0x24')][_0x2441('0x14')]);}_0x3d7d0b[_0x2441('0x3d')]=qs[_0x2441('0x3e')](_0x2300bc['query']['sort']);_0x3d7d0b['where']=qs[_0x2441('0x2a')](_['pick'](_0x2300bc[_0x2441('0x24')],_0x132fca[_0x2441('0x2a')]));_0x3d7d0b[_0x2441('0x3f')]['MailInteractionId']=_0x4f13d7['id'];if(_0x2300bc[_0x2441('0x24')]['filter']){_0x3d7d0b[_0x2441('0x3f')]=_[_0x2441('0x2f')](_0x3d7d0b[_0x2441('0x3f')],{'$or':_[_0x2441('0x1e')](_0x3d7d0b[_0x2441('0x2b')],function(_0x18281f){var _0xace09a={};_0xace09a[_0x18281f]={'$like':'%'+_0x2300bc[_0x2441('0x24')][_0x2441('0x40')]+'%'};return _0xace09a;})});}if(_0x2300bc[_0x2441('0x24')]['$gte']){var _0xd5ec66=_0x2300bc['query'][_0x2441('0x41')][_0x2441('0x42')](',');var _0x5a6260={};_0x5a6260[_0xd5ec66[0x0]]={'$gte':moment(_0xd5ec66[0x1])['format'](_0x2441('0x43'))};_0x3d7d0b[_0x2441('0x3f')]=_[_0x2441('0x2f')](_0x3d7d0b['where'],_0x5a6260);}_0x3d7d0b=_[_0x2441('0x2f')]({},_0x3d7d0b,_0x2300bc['options']);return db[_0x2441('0x3b')][_0x2441('0x17')]({'where':_0x3d7d0b[_0x2441('0x3f')]})[_0x2441('0x1a')](function(_0x369404){_0x139c41[_0x2441('0x17')]=_0x369404;if(_0x2300bc[_0x2441('0x24')][_0x2441('0x44')]){_0x3d7d0b[_0x2441('0x45')]=[{'all':!![]}];}return db[_0x2441('0x3b')][_0x2441('0x46')](_0x3d7d0b);})[_0x2441('0x1a')](function(_0x517189){if(_0x2300bc[_0x2441('0x24')][_0x2441('0x47')]===_0x2441('0x48')){for(var _0x16371c=0x0;_0x16371c<_0x517189[_0x2441('0x2e')];_0x16371c++){_0x517189[_0x16371c][_0x2441('0x34')]=juice(_0x517189[_0x16371c][_0x2441('0x34')]);}}_0x139c41[_0x2441('0x49')]=_0x517189;return _0x139c41;});}})[_0x2441('0x1a')](respondWithFilteredResult(_0x253ff0,_0x3d7d0b))[_0x2441('0x26')](handleError(_0x253ff0,null));};exports['addTags']=function(_0x36a28e,_0x157658){return db[_0x2441('0x31')][_0x2441('0x32')]({'where':{'id':_0x36a28e[_0x2441('0x27')]['id']}})[_0x2441('0x1a')](handleEntityNotFound(_0x157658,null))['then'](function(_0x2c2f25){if(_0x2c2f25){return _0x2c2f25['setTags'](_0x36a28e[_0x2441('0x34')][_0x2441('0x38')],_[_0x2441('0x39')](_0x36a28e[_0x2441('0x34')],[_0x2441('0x38'),'id'])||{})[_0x2441('0x4a')](function(){return db[_0x2441('0x4b')][_0x2441('0x46')]({'attributes':['id',_0x2441('0x1c'),_0x2441('0x4c')],'where':{'id':_0x36a28e[_0x2441('0x34')][_0x2441('0x38')]}});})['then'](function(_0x22a473){socket['emit'](_0x2441('0x4d'),{'id':Number(_0x36a28e[_0x2441('0x27')]['id']),'tags':_0x22a473||[]});return{'id':Number(_0x36a28e[_0x2441('0x27')]['id']),'tags':_0x22a473||[]};});}})[_0x2441('0x1a')](respondWithResult(_0x157658,null))['catch'](handleError(_0x157658,null));};exports['removeTags']=function(_0x174fe7,_0x101a3b){return db[_0x2441('0x31')][_0x2441('0x32')]({'where':{'id':_0x174fe7[_0x2441('0x27')]['id']}})[_0x2441('0x1a')](handleEntityNotFound(_0x101a3b,null))[_0x2441('0x1a')](function(_0x118bb1){if(_0x118bb1){return _0x118bb1['removeTags'](_0x174fe7[_0x2441('0x24')][_0x2441('0x38')]);}})['then'](respondWithStatusCode(_0x101a3b,null))[_0x2441('0x26')](handleError(_0x101a3b,null));};exports[_0x2441('0x4e')]=function(_0x51943a,_0x28003f){var _0x4dd8e5=moment()[_0x2441('0x4f')]()[_0x2441('0x50')]();var _0x2b29af=path[_0x2441('0x51')](config['root'],_0x2441('0x52'),'files',_0x2441('0x53'));var _0x768aaa=path[_0x2441('0x51')](config[_0x2441('0x54')],_0x2441('0x52'),_0x2441('0x55'),_0x2441('0x56'));var _0x429c51=path[_0x2441('0x51')](_0x2b29af,_0x4dd8e5);var _0x18b7e4=util[_0x2441('0x57')](_0x2441('0x58'),_0x51943a['params']['id'],_0x4dd8e5);var _0x233c24=path['join'](_0x2b29af,_0x18b7e4);var _0x1b512c=[];if(_0x51943a[_0x2441('0x24')][_0x2441('0x56')]){_0x1b512c[_0x2441('0x59')]({'model':db[_0x2441('0x5a')],'as':'Attachments','raw':!![]});}var _0x6aae56=[{'model':db[_0x2441('0x3b')],'as':_0x2441('0x5b'),'attributes':['id','body',_0x2441('0x5c'),'to','cc',_0x2441('0x5d'),_0x2441('0x5e'),_0x2441('0x5f')],'where':{'secret':![]},'order':qs[_0x2441('0x3e')]('id'),'include':_0x1b512c}];return db[_0x2441('0x31')][_0x2441('0x32')]({'where':{'id':_0x51943a[_0x2441('0x27')]['id']},'include':_0x6aae56})[_0x2441('0x1a')](handleEntityNotFound(_0x28003f,null))['then'](function(_0x19e095){if(_0x19e095&&_0x19e095[_0x2441('0x5b')]){var _0x29580d=_0x19e095[_0x2441('0x60')]({'plain':!![]});fs[_0x2441('0x61')](_0x429c51);return BPromise[_0x2441('0x62')](_0x29580d[_0x2441('0x5b')],function(_0x253cf9,_0x16469f){var _0x55af49={'from':_0x253cf9[_0x2441('0x5c')],'to':_0x253cf9['to']||_0x2441('0x63'),'subject':_0x253cf9[_0x2441('0x5e')],'html':htmlEntities[_0x2441('0x64')](_0x253cf9[_0x2441('0x34')]),'headers':{'Date':moment(_0x253cf9[_0x2441('0x5f')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x253cf9['cc']){_0x55af49[_0x2441('0x65')]['Cc']=_0x253cf9['cc'];}if(_0x253cf9['bcc']){_0x55af49[_0x2441('0x65')][_0x2441('0x66')]=_0x253cf9[_0x2441('0x5d')];}return new BPromise(function(_0x392e7b,_0x1cfcdd){if(_0x253cf9['Attachments']){for(var _0xa92015=0x0;_0xa92015<_0x253cf9[_0x2441('0x67')]['length'];_0xa92015++){var _0x5054e3=_0x253cf9[_0x2441('0x67')][_0xa92015];var _0x3b0c15=path[_0x2441('0x51')](_0x768aaa,_0x5054e3[_0x2441('0x68')]);if(fs['existsSync'](_0x3b0c15)){_0x55af49[_0x2441('0x56')][_0x2441('0x59')]({'name':_0x5054e3[_0x2441('0x1c')],'contentType':_0x5054e3[_0x2441('0x21')],'data':fs[_0x2441('0x69')](_0x3b0c15)});}}}emlformat['build'](_0x55af49,function(_0x198c5f,_0xcc5b08){if(_0x198c5f)return _0x1cfcdd(_0x198c5f);fs[_0x2441('0x6a')](path['join'](_0x429c51,util['format'](_0x2441('0x6b'),_0x16469f)),_0xcc5b08);return _0x392e7b(_0xcc5b08);});});})[_0x2441('0x1a')](function(){return new BPromise(function(_0x229b2d,_0x17295d){zipdir(_0x429c51,{'saveTo':_0x233c24},function(_0x4405fc,_0xb9a58f){if(_0x4405fc)return _0x17295d(_0x4405fc);return _0x229b2d(_0xb9a58f);});})[_0x2441('0x1a')](function(){return new BPromise(function(_0x31e7d6,_0x268d5c){rimraf(_0x429c51,function(_0x164b81){if(_0x164b81)_0x268d5c(_0x164b81);return _0x31e7d6();});});})['then'](function(){return _0x28003f[_0x2441('0x4e')](_0x233c24,_0x18b7e4,function(_0x4d6465){if(!_0x4d6465)fs['unlinkSync'](_0x233c24);});});});}else{return _0x28003f[_0x2441('0x10')](0xc8);}})['catch'](handleError(_0x28003f,null));}; \ No newline at end of file +var _0x2f31=['omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','include','true','rows','addTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','join','files','root','attachments','push','Attachment','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','existsSync','type','readFileSync','download','unlinkSync','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','html-entities','redis','defaults','localhost','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','stack','name','send','map','MailInteraction','fieldName','key','findAll','mail','query','user','catch','params','model','keys','rawAttributes','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','describe','addMessage','MailMessage','ids'];(function(_0xe5d1,_0x294879){var _0x1a94f6=function(_0x5b0114){while(--_0x5b0114){_0xe5d1['push'](_0xe5d1['shift']());}};_0x1a94f6(++_0x294879);}(_0x2f31,0x9f));var _0x12f3=function(_0x2d75e3,_0x633f3d){_0x2d75e3=_0x2d75e3-0x0;var _0x5d4ef3=_0x2f31[_0x2d75e3];return _0x5d4ef3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x12f3('0x0'));var moment=require(_0x12f3('0x1'));var BPromise=require(_0x12f3('0x2'));var util=require(_0x12f3('0x3'));var path=require(_0x12f3('0x4'));var fs=require('fs');var _=require(_0x12f3('0x5'));var juice=require(_0x12f3('0x6'));var Redis=require(_0x12f3('0x7'));var interaction=require(_0x12f3('0x8'));var qs=require(_0x12f3('0x9'));var logger=require(_0x12f3('0xa'))(_0x12f3('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x12f3('0xc'));config[_0x12f3('0xd')]=_[_0x12f3('0xe')](config[_0x12f3('0xd')],{'host':_0x12f3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x12f3('0x10')](socket);function respondWithStatusCode(_0x4cf60c,_0x48f42f){_0x48f42f=_0x48f42f||0xcc;return function(_0x7100bf){if(_0x7100bf){return _0x4cf60c[_0x12f3('0x11')](_0x48f42f);}return _0x4cf60c[_0x12f3('0x12')](_0x48f42f)[_0x12f3('0x13')]();};}function respondWithResult(_0x2ae621,_0x1a1b8e){_0x1a1b8e=_0x1a1b8e||0xc8;return function(_0x5f3015){if(_0x5f3015){return _0x2ae621[_0x12f3('0x12')](_0x1a1b8e)[_0x12f3('0x14')](_0x5f3015);}};}function respondWithFilteredResult(_0x484bcc,_0x24570d){return function(_0x53d757){if(_0x53d757){var _0x54c01a=typeof _0x24570d[_0x12f3('0x15')]==='undefined'&&typeof _0x24570d[_0x12f3('0x16')]==='undefined';var _0x2e06d6=_0x53d757[_0x12f3('0x17')];var _0x148e4d=_0x54c01a?0x0:_0x24570d['offset'];var _0x187c22=_0x54c01a?_0x53d757['count']:_0x24570d[_0x12f3('0x15')]+_0x24570d[_0x12f3('0x16')];var _0x409079;if(_0x187c22>=_0x2e06d6){_0x187c22=_0x2e06d6;_0x409079=0xc8;}else{_0x409079=0xce;}_0x484bcc['status'](_0x409079);return _0x484bcc[_0x12f3('0x18')](_0x12f3('0x19'),_0x148e4d+'-'+_0x187c22+'/'+_0x2e06d6)[_0x12f3('0x14')](_0x53d757);}return null;};}function saveUpdates(_0x3b3cfd){return function(_0x18e1d8){if(_0x18e1d8){return _0x18e1d8[_0x12f3('0x1a')](_0x3b3cfd)[_0x12f3('0x1b')](function(_0x52cf83){return _0x52cf83;});}return null;};}function removeEntity(_0x428838){return function(_0x12e5a4){if(_0x12e5a4){return _0x12e5a4[_0x12f3('0x1c')]()[_0x12f3('0x1b')](function(){_0x428838[_0x12f3('0x12')](0xcc)[_0x12f3('0x13')]();});}};}function handleEntityNotFound(_0x54139e){return function(_0x5a3c2b){if(!_0x5a3c2b){_0x54139e[_0x12f3('0x11')](0x194);}return _0x5a3c2b;};}function handleError(_0x29a631,_0x319bd3){_0x319bd3=_0x319bd3||0x1f4;return function(_0x5a1820){logger['error'](_0x5a1820[_0x12f3('0x1d')]);if(_0x5a1820[_0x12f3('0x1e')]){delete _0x5a1820[_0x12f3('0x1e')];}_0x29a631[_0x12f3('0x12')](_0x319bd3)[_0x12f3('0x1f')](_0x5a1820);};}exports['index']=function(_0xca9829,_0x31e4b9){var _0x119739={};var _0x30b232=_[_0x12f3('0x20')](db[_0x12f3('0x21')]['rawAttributes'],function(_0x3aebc5){return{'name':_0x3aebc5[_0x12f3('0x22')],'type':_0x3aebc5['type'][_0x12f3('0x23')]};});_0x119739=qs['getOptions'](_0x30b232,_0xca9829);return interaction[_0x12f3('0x24')](_0x12f3('0x25'),_0xca9829[_0x12f3('0x26')],_0xca9829[_0x12f3('0x27')],_0x119739,_0x30b232)[_0x12f3('0x1b')](respondWithFilteredResult(_0x31e4b9,_0x119739))[_0x12f3('0x28')](handleError(_0x31e4b9,null));};exports['show']=function(_0x289189,_0x2fa8f5){var _0x3e0626={'raw':![],'where':{'id':_0x289189[_0x12f3('0x29')]['id']}},_0x3ab5c3={};_0x3ab5c3[_0x12f3('0x2a')]=_[_0x12f3('0x2b')](db[_0x12f3('0x21')][_0x12f3('0x2c')]);_0x3ab5c3[_0x12f3('0x26')]=_[_0x12f3('0x2b')](_0x289189[_0x12f3('0x26')]);_0x3ab5c3['filters']=_['intersection'](_0x3ab5c3[_0x12f3('0x2a')],_0x3ab5c3[_0x12f3('0x26')]);_0x3e0626['attributes']=_[_0x12f3('0x2d')](_0x3ab5c3[_0x12f3('0x2a')],qs[_0x12f3('0x2e')](_0x289189[_0x12f3('0x26')][_0x12f3('0x2e')]));_0x3e0626[_0x12f3('0x2f')]=_0x3e0626[_0x12f3('0x2f')][_0x12f3('0x30')]?_0x3e0626[_0x12f3('0x2f')]:_0x3ab5c3['model'];if(_0x289189['query'][_0x12f3('0x31')]){_0x3e0626['include']=[{'all':!![]}];}_0x3e0626=_[_0x12f3('0x32')]({},_0x3e0626,_0x289189[_0x12f3('0x33')]);return db[_0x12f3('0x21')][_0x12f3('0x34')](_0x3e0626)[_0x12f3('0x1b')](handleEntityNotFound(_0x2fa8f5,null))[_0x12f3('0x1b')](respondWithResult(_0x2fa8f5,null))[_0x12f3('0x28')](handleError(_0x2fa8f5,null));};exports[_0x12f3('0x35')]=function(_0x12cbd6,_0x470a1a){return db[_0x12f3('0x21')][_0x12f3('0x35')](_0x12cbd6[_0x12f3('0x36')],{})['then'](respondWithResult(_0x470a1a,0xc9))[_0x12f3('0x28')](handleError(_0x470a1a,null));};exports[_0x12f3('0x1a')]=function(_0x2e00e9,_0x23fe9a){if(_0x2e00e9[_0x12f3('0x36')]['id']){delete _0x2e00e9[_0x12f3('0x36')]['id'];}return db['MailInteraction'][_0x12f3('0x34')]({'where':{'id':_0x2e00e9['params']['id']}})['then'](handleEntityNotFound(_0x23fe9a,null))[_0x12f3('0x1b')](saveUpdates(_0x2e00e9[_0x12f3('0x36')],null))[_0x12f3('0x1b')](respondWithResult(_0x23fe9a,null))['catch'](handleError(_0x23fe9a,null));};exports[_0x12f3('0x1c')]=function(_0x1f66b5,_0x17bbf0){return db['MailInteraction'][_0x12f3('0x34')]({'where':{'id':_0x1f66b5[_0x12f3('0x29')]['id']}})['then'](handleEntityNotFound(_0x17bbf0,null))[_0x12f3('0x1b')](removeEntity(_0x17bbf0,null))['catch'](handleError(_0x17bbf0,null));};exports[_0x12f3('0x37')]=function(_0x1f608d,_0x2cf8ca){return db['MailInteraction']['describe']()['then'](respondWithResult(_0x2cf8ca,null))[_0x12f3('0x28')](handleError(_0x2cf8ca,null));};exports[_0x12f3('0x38')]=function(_0x576c02,_0x470ff2){return db[_0x12f3('0x39')]['find']({'where':{'id':_0x576c02['params']['id']}})[_0x12f3('0x1b')](handleEntityNotFound(_0x470ff2,null))[_0x12f3('0x1b')](function(_0x361553){if(_0x361553){return _0x361553[_0x12f3('0x38')](_0x576c02[_0x12f3('0x36')][_0x12f3('0x3a')],_[_0x12f3('0x3b')](_0x576c02[_0x12f3('0x36')],[_0x12f3('0x3a'),'id'])||{});}})[_0x12f3('0x1b')](respondWithResult(_0x470ff2,null))[_0x12f3('0x28')](handleError(_0x470ff2,null));};exports[_0x12f3('0x3c')]=function(_0x34aba8,_0x184804){var _0x42f7e0={'raw':![],'where':{}};var _0x54b1ac={};var _0xa86bd8={'count':0x0,'rows':[]};return db[_0x12f3('0x21')][_0x12f3('0x3d')]({'where':{'id':_0x34aba8[_0x12f3('0x29')]['id']}})[_0x12f3('0x1b')](handleEntityNotFound(_0x184804,null))[_0x12f3('0x1b')](function(_0x14a42c){if(_0x14a42c){_0x54b1ac[_0x12f3('0x2a')]=_[_0x12f3('0x2b')](db[_0x12f3('0x39')]['rawAttributes']);_0x54b1ac['query']=_['keys'](_0x34aba8['query']);_0x54b1ac[_0x12f3('0x3e')]=_[_0x12f3('0x2d')](_0x54b1ac[_0x12f3('0x2a')],_0x54b1ac[_0x12f3('0x26')]);_0x42f7e0['attributes']=_[_0x12f3('0x2d')](_0x54b1ac[_0x12f3('0x2a')],qs['fields'](_0x34aba8[_0x12f3('0x26')][_0x12f3('0x2e')]));_0x42f7e0[_0x12f3('0x2f')]=_0x42f7e0[_0x12f3('0x2f')][_0x12f3('0x30')]?_0x42f7e0[_0x12f3('0x2f')]:_0x54b1ac[_0x12f3('0x2a')];if(!_0x34aba8['query'][_0x12f3('0x3f')](_0x12f3('0x40'))){_0x42f7e0[_0x12f3('0x16')]=qs['limit'](_0x34aba8[_0x12f3('0x26')]['limit']);_0x42f7e0[_0x12f3('0x15')]=qs['offset'](_0x34aba8[_0x12f3('0x26')][_0x12f3('0x15')]);}_0x42f7e0[_0x12f3('0x41')]=qs[_0x12f3('0x42')](_0x34aba8['query']['sort']);_0x42f7e0[_0x12f3('0x43')]=qs[_0x12f3('0x3e')](_[_0x12f3('0x44')](_0x34aba8['query'],_0x54b1ac[_0x12f3('0x3e')]));_0x42f7e0[_0x12f3('0x43')][_0x12f3('0x45')]=_0x14a42c['id'];if(_0x34aba8[_0x12f3('0x26')][_0x12f3('0x46')]){_0x42f7e0[_0x12f3('0x43')]=_[_0x12f3('0x32')](_0x42f7e0[_0x12f3('0x43')],{'$or':_['map'](_0x42f7e0[_0x12f3('0x2f')],function(_0x26ffa9){var _0x5440c2={};_0x5440c2[_0x26ffa9]={'$like':'%'+_0x34aba8[_0x12f3('0x26')][_0x12f3('0x46')]+'%'};return _0x5440c2;})});}if(_0x34aba8['query']['$gte']){var _0x5db4ae=_0x34aba8[_0x12f3('0x26')]['$gte'][_0x12f3('0x47')](',');var _0x118c4f={};_0x118c4f[_0x5db4ae[0x0]]={'$gte':moment(_0x5db4ae[0x1])[_0x12f3('0x48')](_0x12f3('0x49'))};_0x42f7e0['where']=_[_0x12f3('0x32')](_0x42f7e0[_0x12f3('0x43')],_0x118c4f);}_0x42f7e0=_['merge']({},_0x42f7e0,_0x34aba8['options']);return db[_0x12f3('0x39')]['count']({'where':_0x42f7e0['where']})[_0x12f3('0x1b')](function(_0x451bfc){_0xa86bd8[_0x12f3('0x17')]=_0x451bfc;if(_0x34aba8[_0x12f3('0x26')]['includeAll']){_0x42f7e0[_0x12f3('0x4a')]=[{'all':!![]}];}return db['MailMessage'][_0x12f3('0x24')](_0x42f7e0);})['then'](function(_0xb06fe3){if(_0x34aba8[_0x12f3('0x26')]['inlineCss']===_0x12f3('0x4b')){for(var _0x585bad=0x0;_0x585bad<_0xb06fe3['length'];_0x585bad++){_0xb06fe3[_0x585bad]['body']=juice(_0xb06fe3[_0x585bad][_0x12f3('0x36')]);}}_0xa86bd8[_0x12f3('0x4c')]=_0xb06fe3;return _0xa86bd8;});}})[_0x12f3('0x1b')](respondWithFilteredResult(_0x184804,_0x42f7e0))['catch'](handleError(_0x184804,null));};exports[_0x12f3('0x4d')]=function(_0x13598b,_0x1b59f9){return db[_0x12f3('0x21')][_0x12f3('0x34')]({'where':{'id':_0x13598b[_0x12f3('0x29')]['id']}})[_0x12f3('0x1b')](handleEntityNotFound(_0x1b59f9,null))[_0x12f3('0x1b')](function(_0x361185){if(_0x361185){return _0x361185['setTags'](_0x13598b[_0x12f3('0x36')][_0x12f3('0x3a')],_[_0x12f3('0x3b')](_0x13598b[_0x12f3('0x36')],['ids','id'])||{})[_0x12f3('0x4e')](function(){return db[_0x12f3('0x4f')]['findAll']({'attributes':['id',_0x12f3('0x1e'),_0x12f3('0x50')],'where':{'id':_0x13598b['body'][_0x12f3('0x3a')]}});})['then'](function(_0x4f3c56){socket[_0x12f3('0x51')](_0x12f3('0x52'),{'id':Number(_0x13598b[_0x12f3('0x29')]['id']),'tags':_0x4f3c56||[]});return{'id':Number(_0x13598b[_0x12f3('0x29')]['id']),'tags':_0x4f3c56||[]};});}})[_0x12f3('0x1b')](respondWithResult(_0x1b59f9,null))['catch'](handleError(_0x1b59f9,null));};exports[_0x12f3('0x53')]=function(_0x43325b,_0x708bc3){return db[_0x12f3('0x21')][_0x12f3('0x34')]({'where':{'id':_0x43325b[_0x12f3('0x29')]['id']}})['then'](handleEntityNotFound(_0x708bc3,null))[_0x12f3('0x1b')](function(_0x368d75){if(_0x368d75){return _0x368d75[_0x12f3('0x53')](_0x43325b[_0x12f3('0x26')][_0x12f3('0x3a')]);}})['then'](respondWithStatusCode(_0x708bc3,null))[_0x12f3('0x28')](handleError(_0x708bc3,null));};exports['download']=function(_0x1d3367,_0x21fec0){var _0x16d423=moment()[_0x12f3('0x54')]()[_0x12f3('0x55')]();var _0x2684d3=path[_0x12f3('0x56')](config['root'],'server',_0x12f3('0x57'),'tmp');var _0xe4c074=path[_0x12f3('0x56')](config[_0x12f3('0x58')],'server','files',_0x12f3('0x59'));var _0x16cf16=path['join'](_0x2684d3,_0x16d423);var _0x57fa38=util['format']('transcript-%d-%s.zip',_0x1d3367[_0x12f3('0x29')]['id'],_0x16d423);var _0x228dc3=path[_0x12f3('0x56')](_0x2684d3,_0x57fa38);var _0x34fab5=[];if(_0x1d3367[_0x12f3('0x26')][_0x12f3('0x59')]){_0x34fab5[_0x12f3('0x5a')]({'model':db[_0x12f3('0x5b')],'as':'Attachments','raw':!![]});}var _0x1dbe5b=[{'model':db[_0x12f3('0x39')],'as':_0x12f3('0x5c'),'attributes':['id',_0x12f3('0x36'),_0x12f3('0x5d'),'to','cc',_0x12f3('0x5e'),_0x12f3('0x5f'),_0x12f3('0x60')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x34fab5}];return db[_0x12f3('0x21')][_0x12f3('0x34')]({'where':{'id':_0x1d3367[_0x12f3('0x29')]['id']},'include':_0x1dbe5b})[_0x12f3('0x1b')](handleEntityNotFound(_0x21fec0,null))[_0x12f3('0x1b')](function(_0x3c6137){if(_0x3c6137&&_0x3c6137[_0x12f3('0x5c')]){var _0x4fdafa=_0x3c6137[_0x12f3('0x61')]({'plain':!![]});fs[_0x12f3('0x62')](_0x16cf16);return BPromise[_0x12f3('0x63')](_0x4fdafa[_0x12f3('0x5c')],function(_0xb38b89,_0x92d04a){var _0x31bebc={'from':_0xb38b89[_0x12f3('0x5d')],'to':_0xb38b89['to']||'missing.recipient@your.company.com','subject':_0xb38b89[_0x12f3('0x5f')],'html':htmlEntities['decode'](_0xb38b89[_0x12f3('0x36')]),'headers':{'Date':moment(_0xb38b89[_0x12f3('0x60')])[_0x12f3('0x48')](_0x12f3('0x64'))},'attachments':[]};if(_0xb38b89['cc']){_0x31bebc['headers']['Cc']=_0xb38b89['cc'];}if(_0xb38b89[_0x12f3('0x5e')]){_0x31bebc[_0x12f3('0x65')]['Bcc']=_0xb38b89[_0x12f3('0x5e')];}return new BPromise(function(_0x4c6eaa,_0x3fcdc2){if(_0xb38b89[_0x12f3('0x66')]){for(var _0x4fab41=0x0;_0x4fab41<_0xb38b89['Attachments'][_0x12f3('0x30')];_0x4fab41++){var _0x40c696=_0xb38b89[_0x12f3('0x66')][_0x4fab41];var _0x1b5dca=path['join'](_0xe4c074,_0x40c696[_0x12f3('0x67')]);if(fs[_0x12f3('0x68')](_0x1b5dca)){_0x31bebc['attachments'][_0x12f3('0x5a')]({'name':_0x40c696[_0x12f3('0x1e')],'contentType':_0x40c696[_0x12f3('0x69')],'data':fs[_0x12f3('0x6a')](_0x1b5dca)});}}}emlformat['build'](_0x31bebc,function(_0x140cb4,_0x3b40eb){if(_0x140cb4)return _0x3fcdc2(_0x140cb4);fs['writeFileSync'](path[_0x12f3('0x56')](_0x16cf16,util[_0x12f3('0x48')]('message%d.eml',_0x92d04a)),_0x3b40eb);return _0x4c6eaa(_0x3b40eb);});});})[_0x12f3('0x1b')](function(){return new BPromise(function(_0x2a2bd3,_0x3951de){zipdir(_0x16cf16,{'saveTo':_0x228dc3},function(_0x5b8164,_0x5b4d42){if(_0x5b8164)return _0x3951de(_0x5b8164);return _0x2a2bd3(_0x5b4d42);});})[_0x12f3('0x1b')](function(){return new BPromise(function(_0x5f5628,_0x1106de){rimraf(_0x16cf16,function(_0x3d0426){if(_0x3d0426)_0x1106de(_0x3d0426);return _0x5f5628();});});})['then'](function(){return _0x21fec0[_0x12f3('0x6b')](_0x228dc3,_0x57fa38,function(_0x1affec){if(!_0x1affec)fs[_0x12f3('0x6c')](_0x228dc3);});});});}else{return _0x21fec0[_0x12f3('0x11')](0xc8);}})['catch'](handleError(_0x21fec0,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 5b36f01..7eedc37 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 _0xdd2d=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x478c62,_0x382a37){var _0xb5cec8=function(_0x5146d8){while(--_0x5146d8){_0x478c62['push'](_0x478c62['shift']());}};_0xb5cec8(++_0x382a37);}(_0xdd2d,0xae));var _0xddd2=function(_0x4d4ad6,_0x58d5a2){_0x4d4ad6=_0x4d4ad6-0x0;var _0x1f1898=_0xdd2d[_0x4d4ad6];return _0x1f1898;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xddd2('0x0'))['db']['MailInteraction'];var MailMessage=require(_0xddd2('0x0'))['db'][_0xddd2('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xddd2('0x2')](0x0);var events={'afterCreate':_0xddd2('0x3'),'afterUpdate':_0xddd2('0x4'),'afterDestroy':_0xddd2('0x5')};function emitEvent(_0x57c13c){return function(_0x2ad065,_0x4da28f,_0xac90e1){_0x2ad065[_0xddd2('0x6')]({'attributes':['id'],'raw':!![]})[_0xddd2('0x7')](function(_0x3dc2eb){_0x2ad065[_0xddd2('0x8')](_0xddd2('0x9'),_0x3dc2eb[_0xddd2('0xa')](function(_0x455145){return{'id':_0x455145['id']};}));return MailMessage[_0xddd2('0xb')]({'where':{'MailInteractionId':_0x2ad065['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x21fc46){_0x2ad065[_0xddd2('0x8')](_0xddd2('0xc'),_0x21fc46[_0xddd2('0xd')]);MailInteractionEvents[_0xddd2('0xe')](_0x57c13c+':'+_0x2ad065['id'],_0x2ad065);MailInteractionEvents[_0xddd2('0xe')](_0x57c13c,_0x2ad065);_0xac90e1(null);})[_0xddd2('0xf')](_0xac90e1(null));};}for(var e in events){if(events[_0xddd2('0x10')](e)){var event=events[e];MailInteraction[_0xddd2('0x11')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x287b=['map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x287b,0x67));var _0xb287=function(_0x332998,_0x2d99c7){_0x332998=_0x332998-0x0;var _0x460be7=_0x287b[_0x332998];return _0x460be7;};'use strict';var EventEmitter=require(_0xb287('0x0'));var MailInteraction=require(_0xb287('0x1'))['db'][_0xb287('0x2')];var MailMessage=require(_0xb287('0x1'))['db'][_0xb287('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb287('0x4')](0x0);var events={'afterCreate':_0xb287('0x5'),'afterUpdate':'update','afterDestroy':_0xb287('0x6')};function emitEvent(_0x58414e){return function(_0x2ae796,_0x308253,_0x100e32){_0x2ae796[_0xb287('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x45cd75){_0x2ae796[_0xb287('0x8')]('Users',_0x45cd75[_0xb287('0x9')](function(_0x5c32d8){return{'id':_0x5c32d8['id']};}));return MailMessage[_0xb287('0xa')]({'where':{'MailInteractionId':_0x2ae796['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x33e4fc){_0x2ae796[_0xb287('0x8')]('unreadMessages',_0x33e4fc[_0xb287('0xb')]);MailInteractionEvents[_0xb287('0xc')](_0x58414e+':'+_0x2ae796['id'],_0x2ae796);MailInteractionEvents[_0xb287('0xc')](_0x58414e,_0x2ae796);_0x100e32(null);})[_0xb287('0xd')](_0x100e32(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xb287('0xe')](e,emitEvent(event));}}module[_0xb287('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 451799a..cfdebf3 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 _0x4676=['FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','MailMessage','update','then','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','fti_mail_interactions','subject'];(function(_0x15e91b,_0x4e6939){var _0x1b1f61=function(_0x57ab55){while(--_0x57ab55){_0x15e91b['push'](_0x15e91b['shift']());}};_0x1b1f61(++_0x4e6939);}(_0x4676,0x178));var _0x6467=function(_0xddac5b,_0xe895ef){_0xddac5b=_0xddac5b-0x0;var _0x320956=_0x4676[_0xddac5b];return _0x320956;};'use strict';var _=require(_0x6467('0x0'));var util=require(_0x6467('0x1'));var logger=require('../../config/logger')(_0x6467('0x2'));var moment=require(_0x6467('0x3'));var BPromise=require(_0x6467('0x4'));var rp=require(_0x6467('0x5'));var fs=require('fs');var path=require(_0x6467('0x6'));var rimraf=require(_0x6467('0x7'));var config=require(_0x6467('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x6467('0x9')]=function(_0x620843,_0x4e7d8d){return _0x620843[_0x6467('0xa')](_0x6467('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x6467('0xc'),'fields':[_0x6467('0xd'),'to'],'type':_0x6467('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x34ec01,_0x4dcfd8,_0x4e11b4){if(_0x34ec01[_0x6467('0xf')]){_0x34ec01[_0x6467('0x10')]=moment()['format'](_0x6467('0x11'));}if(_0x34ec01[_0x6467('0x12')]){_0x34ec01[_0x6467('0x13')]=moment()[_0x6467('0x14')](_0x6467('0x11'));}_0x4e11b4(null,_0x4dcfd8);},'beforeUpdate':function(_0x57508a,_0x1d57d2,_0x150312){if(_0x57508a[_0x6467('0x15')](_0x6467('0xf'))){_0x57508a[_0x6467('0x10')]=_0x57508a[_0x6467('0xf')]?moment()[_0x6467('0x14')](_0x6467('0x11')):null;}if(_0x57508a['changed']('closed')){_0x57508a['closedAt']=moment()[_0x6467('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x57508a[_0x6467('0xf')]=null;_0x57508a[_0x6467('0x10')]=null;}_0x150312(null,_0x57508a);},'afterUpdate':function(_0x1426cd,_0x16acb8,_0x254449){var _0x445ec9=_0x620843['models'];var _0x5a3210=_0x1426cd['get']({'plain':!![]});if(_0x5a3210[_0x6467('0x12')]){return _0x445ec9[_0x6467('0x16')][_0x6467('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x5a3210['id']}})[_0x6467('0x18')](function(){_0x254449();})['catch'](function(_0x37157f){_0x254449(_0x37157f);});}else{_0x254449();}}},'charset':'utf8mb4','collate':_0x6467('0x19')});}; \ No newline at end of file +var _0x1ca2=['path','rimraf','../../config/environment','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','models','get','MailMessage','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xec05f0,_0x561575){var _0x21f61c=function(_0x27c4e9){while(--_0x27c4e9){_0xec05f0['push'](_0xec05f0['shift']());}};_0x21f61c(++_0x561575);}(_0x1ca2,0x182));var _0x21ca=function(_0x1e2b91,_0x4360f0){_0x1e2b91=_0x1e2b91-0x0;var _0x40f517=_0x1ca2[_0x1e2b91];return _0x40f517;};'use strict';var _=require(_0x21ca('0x0'));var util=require(_0x21ca('0x1'));var logger=require(_0x21ca('0x2'))(_0x21ca('0x3'));var moment=require(_0x21ca('0x4'));var BPromise=require(_0x21ca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21ca('0x6'));var rimraf=require(_0x21ca('0x7'));var config=require(_0x21ca('0x8'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x202b1a,_0x4781d3){return _0x202b1a[_0x21ca('0x9')](_0x21ca('0xa'),attributes,{'tableName':_0x21ca('0xb'),'paranoid':![],'indexes':[{'name':_0x21ca('0xc'),'fields':[_0x21ca('0xd'),'to'],'type':_0x21ca('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4198f6,_0x399c8d,_0x29f2a2){if(_0x4198f6[_0x21ca('0xf')]){_0x4198f6[_0x21ca('0x10')]=moment()[_0x21ca('0x11')](_0x21ca('0x12'));}if(_0x4198f6['closed']){_0x4198f6['closedAt']=moment()['format'](_0x21ca('0x12'));}_0x29f2a2(null,_0x399c8d);},'beforeUpdate':function(_0x2b2e37,_0x15107f,_0x4ca596){if(_0x2b2e37[_0x21ca('0x13')](_0x21ca('0xf'))){_0x2b2e37[_0x21ca('0x10')]=_0x2b2e37['substatus']?moment()[_0x21ca('0x11')](_0x21ca('0x12')):null;}if(_0x2b2e37[_0x21ca('0x13')](_0x21ca('0x14'))){_0x2b2e37[_0x21ca('0x15')]=moment()[_0x21ca('0x11')](_0x21ca('0x12'));_0x2b2e37[_0x21ca('0xf')]=null;_0x2b2e37['substatusAt']=null;}_0x4ca596(null,_0x2b2e37);},'afterUpdate':function(_0x18dec6,_0x5203af,_0x5130e6){var _0xa305b5=_0x202b1a[_0x21ca('0x16')];var _0x1943d6=_0x18dec6[_0x21ca('0x17')]({'plain':!![]});if(_0x1943d6[_0x21ca('0x14')]){return _0xa305b5[_0x21ca('0x18')][_0x21ca('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x1943d6['id']}})['then'](function(){_0x5130e6();})['catch'](function(_0x51f3aa){_0x5130e6(_0x51f3aa);});}else{_0x5130e6();}}},'charset':_0x21ca('0x1a'),'collate':_0x21ca('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b250f69..460c4cf 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 _0xd8fa=['limit','stringify','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','error','code','message','MailInteraction,\x20%s,\x20%s','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes'];(function(_0x4d7cf6,_0x9aed28){var _0x392276=function(_0x530548){while(--_0x530548){_0x4d7cf6['push'](_0x4d7cf6['shift']());}};_0x392276(++_0x9aed28);}(_0xd8fa,0x159));var _0xad8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xad8f('0x0'));var util=require(_0xad8f('0x1'));var moment=require('moment');var BPromise=require(_0xad8f('0x2'));var rs=require(_0xad8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad8f('0x4'));var logger=require(_0xad8f('0x5'))(_0xad8f('0x6'));var config=require(_0xad8f('0x7'));var jayson=require(_0xad8f('0x8'));var client=jayson[_0xad8f('0x9')]['http']({'port':0x232a});config[_0xad8f('0xa')]=_[_0xad8f('0xb')](config['redis'],{'host':_0xad8f('0xc'),'port':0x18eb});var socket=require(_0xad8f('0xd'))(new Redis(config[_0xad8f('0xa')]));require(_0xad8f('0xe'))[_0xad8f('0xf')](socket);function respondWithRpcPromise(_0x5d17c5,_0x2742be,_0x5e3239){return new BPromise(function(_0x312fea,_0x48947a){return client[_0xad8f('0x10')](_0x5d17c5,_0x5e3239)[_0xad8f('0x11')](function(_0x2ae92e){logger[_0xad8f('0x12')]('MailInteraction,\x20%s,\x20%s',_0x2742be,_0xad8f('0x13'));logger[_0xad8f('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2742be,_0xad8f('0x13'),JSON['stringify'](_0x2ae92e));if(_0x2ae92e[_0xad8f('0x15')]){if(_0x2ae92e[_0xad8f('0x15')][_0xad8f('0x16')]===0x1f4){logger[_0xad8f('0x15')]('MailInteraction,\x20%s,\x20%s',_0x2742be,_0x2ae92e['error'][_0xad8f('0x17')]);return _0x48947a(_0x2ae92e[_0xad8f('0x15')][_0xad8f('0x17')]);}logger[_0xad8f('0x15')](_0xad8f('0x18'),_0x2742be,_0x2ae92e['error'][_0xad8f('0x17')]);return _0x312fea(_0x2ae92e['error']['message']);}else{logger[_0xad8f('0x12')](_0xad8f('0x18'),_0x2742be,_0xad8f('0x13'));_0x312fea(_0x2ae92e['result'][_0xad8f('0x17')]);}})[_0xad8f('0x19')](function(_0x265c39){logger['error'](_0xad8f('0x18'),_0x2742be,_0x265c39);_0x48947a(_0x265c39);});});}exports[_0xad8f('0x1a')]=function(_0x46543d){var _0xdbc98=this;return new Promise(function(_0x283cfb,_0x1e430d){return db[_0xad8f('0x1b')]['update'](_0x46543d[_0xad8f('0x1c')],{'raw':_0x46543d[_0xad8f('0x1d')]?_0x46543d['options'][_0xad8f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46543d['options']?_0x46543d[_0xad8f('0x1d')][_0xad8f('0x1f')]||null:null,'attributes':_0x46543d[_0xad8f('0x1d')]?_0x46543d[_0xad8f('0x1d')][_0xad8f('0x20')]||null:null,'limit':_0x46543d[_0xad8f('0x1d')]?_0x46543d[_0xad8f('0x1d')][_0xad8f('0x21')]||null:null})[_0xad8f('0x11')](function(_0x4c9b0f){logger[_0xad8f('0x12')](_0xad8f('0x1a'),_0x46543d);logger[_0xad8f('0x14')](_0xad8f('0x1a'),_0x46543d,JSON[_0xad8f('0x22')](_0x4c9b0f));_0x283cfb(_0x4c9b0f);})['catch'](function(_0x38612b){logger[_0xad8f('0x15')](_0xad8f('0x1a'),_0x38612b[_0xad8f('0x17')],_0x46543d);_0x1e430d(_0xdbc98[_0xad8f('0x15')](0x1f4,_0x38612b[_0xad8f('0x17')]));});});};exports[_0xad8f('0x23')]=function(_0x1442ce){return new Promise(function(_0x4649e9,_0x4df9cd){return db['MailInteraction'][_0xad8f('0x24')]({'where':_0x1442ce['options']?_0x1442ce[_0xad8f('0x1d')][_0xad8f('0x1f')]||null:null})[_0xad8f('0x11')](function(_0xe71ca1){if(_0xe71ca1){return _0xe71ca1[_0xad8f('0x25')](_0x1442ce['body'][_0xad8f('0x26')],_[_0xad8f('0x27')](_0x1442ce[_0xad8f('0x1c')],[_0xad8f('0x26'),'id'])||{});}})[_0xad8f('0x28')](function(_0x1caf92){logger['info'](_0xad8f('0x29'),_0x1442ce);logger[_0xad8f('0x14')]('AddTags',_0x1442ce,JSON[_0xad8f('0x22')](_0x1caf92));_0x4649e9(_0x1caf92);})[_0xad8f('0x19')](function(_0x11a1c4){logger[_0xad8f('0x15')]('AddTags',_0x11a1c4[_0xad8f('0x17')],_0x1442ce);_0x4df9cd(_this[_0xad8f('0x15')](0x1f4,_0x11a1c4[_0xad8f('0x17')]));});});}; \ No newline at end of file +var _0xbdb9=['AddTagsToMailInteraction','find','addTags','body','ids','omit','AddTags','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','then','catch'];(function(_0x565475,_0x1a04b0){var _0x15757f=function(_0x490487){while(--_0x490487){_0x565475['push'](_0x565475['shift']());}};_0x15757f(++_0x1a04b0);}(_0xbdb9,0xac));var _0x9bdb=function(_0x1f8c67,_0x241b75){_0x1f8c67=_0x1f8c67-0x0;var _0x3af03f=_0xbdb9[_0x1f8c67];return _0x3af03f;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var moment=require(_0x9bdb('0x2'));var BPromise=require(_0x9bdb('0x3'));var rs=require(_0x9bdb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9bdb('0x6'));var client=jayson['client'][_0x9bdb('0x7')]({'port':0x232a});config['redis']=_[_0x9bdb('0x8')](config[_0x9bdb('0x9')],{'host':_0x9bdb('0xa'),'port':0x18eb});var socket=require(_0x9bdb('0xb'))(new Redis(config[_0x9bdb('0x9')]));require(_0x9bdb('0xc'))[_0x9bdb('0xd')](socket);function respondWithRpcPromise(_0x58812d,_0x118bb1,_0x355bad){return new BPromise(function(_0x274dee,_0x35a5b9){return client[_0x9bdb('0xe')](_0x58812d,_0x355bad)['then'](function(_0x5af5d6){logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));logger[_0x9bdb('0x12')](_0x9bdb('0x13'),_0x118bb1,_0x9bdb('0x11'),JSON['stringify'](_0x5af5d6));if(_0x5af5d6[_0x9bdb('0x14')]){if(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x15')]===0x1f4){logger[_0x9bdb('0x14')](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6['error'][_0x9bdb('0x16')]);return _0x35a5b9(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}logger['error'](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);return _0x274dee(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}else{logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));_0x274dee(_0x5af5d6[_0x9bdb('0x17')][_0x9bdb('0x16')]);}})['catch'](function(_0x37837d){logger[_0x9bdb('0x14')]('MailInteraction,\x20%s,\x20%s',_0x118bb1,_0x37837d);_0x35a5b9(_0x37837d);});});}exports[_0x9bdb('0x18')]=function(_0x16a953){var _0x2fb1f3=this;return new Promise(function(_0x582a46,_0xdaab91){return db[_0x9bdb('0x19')][_0x9bdb('0x1a')](_0x16a953['body'],{'raw':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1d')]||null:null,'attributes':_0x16a953['options']?_0x16a953['options'][_0x9bdb('0x1e')]||null:null,'limit':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')]['limit']||null:null})[_0x9bdb('0x1f')](function(_0x2d9cfd){logger[_0x9bdb('0xf')](_0x9bdb('0x18'),_0x16a953);logger['debug'](_0x9bdb('0x18'),_0x16a953,JSON['stringify'](_0x2d9cfd));_0x582a46(_0x2d9cfd);})[_0x9bdb('0x20')](function(_0x3c2ad6){logger[_0x9bdb('0x14')]('UpdateMailInteraction',_0x3c2ad6[_0x9bdb('0x16')],_0x16a953);_0xdaab91(_0x2fb1f3[_0x9bdb('0x14')](0x1f4,_0x3c2ad6[_0x9bdb('0x16')]));});});};exports[_0x9bdb('0x21')]=function(_0x4368c4){return new Promise(function(_0x14fb6a,_0x426390){return db[_0x9bdb('0x19')][_0x9bdb('0x22')]({'where':_0x4368c4[_0x9bdb('0x1b')]?_0x4368c4['options'][_0x9bdb('0x1d')]||null:null})[_0x9bdb('0x1f')](function(_0x15edd5){if(_0x15edd5){return _0x15edd5[_0x9bdb('0x23')](_0x4368c4[_0x9bdb('0x24')][_0x9bdb('0x25')],_[_0x9bdb('0x26')](_0x4368c4['body'],[_0x9bdb('0x25'),'id'])||{});}})['spread'](function(_0x26a174){logger[_0x9bdb('0xf')](_0x9bdb('0x27'),_0x4368c4);logger[_0x9bdb('0x12')](_0x9bdb('0x27'),_0x4368c4,JSON[_0x9bdb('0x28')](_0x26a174));_0x14fb6a(_0x26a174);})[_0x9bdb('0x20')](function(_0x5f4d21){logger[_0x9bdb('0x14')](_0x9bdb('0x27'),_0x5f4d21[_0x9bdb('0x16')],_0x4368c4);_0x426390(_this['error'](0x1f4,_0x5f4d21['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 286ff3c..6214f55 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 _0x4519=['length','./mailInteraction.events','remove','update','emit','removeListener'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x4519,0x1c3));var _0x9451=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4519[_0x3ab51d];return _0x29a04e;};'use strict';var MailInteractionEvents=require(_0x9451('0x0'));var events=['save',_0x9451('0x1'),_0x9451('0x2')];function createListener(_0x1ddef6,_0x4b86bb){return function(_0x4a15b4){_0x4b86bb[_0x9451('0x3')](_0x1ddef6,_0x4a15b4);};}function removeListener(_0x3a9c8a,_0x4be6c7){return function(){MailInteractionEvents[_0x9451('0x4')](_0x3a9c8a,_0x4be6c7);};}exports['register']=function(_0x22d1c4){for(var _0x457308=0x0,_0x3e2240=events[_0x9451('0x5')];_0x457308<_0x3e2240;_0x457308++){var _0x466e33=events[_0x457308];var _0x37d1bd=createListener('mailInteraction:'+_0x466e33,_0x22d1c4);MailInteractionEvents['on'](_0x466e33,_0x37d1bd);}}; \ No newline at end of file +var _0xaece=['emit','removeListener','length','mailInteraction:','remove','update'];(function(_0x43cb42,_0x5752cb){var _0x8ccbe8=function(_0xc0d60d){while(--_0xc0d60d){_0x43cb42['push'](_0x43cb42['shift']());}};_0x8ccbe8(++_0x5752cb);}(_0xaece,0xf4));var _0xeaec=function(_0x5943c0,_0x4f64b9){_0x5943c0=_0x5943c0-0x0;var _0x3a1051=_0xaece[_0x5943c0];return _0x3a1051;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xeaec('0x0'),_0xeaec('0x1')];function createListener(_0x3c7e3b,_0x4c3560){return function(_0x2a6f7e){_0x4c3560[_0xeaec('0x2')](_0x3c7e3b,_0x2a6f7e);};}function removeListener(_0x318c06,_0x41f7fd){return function(){MailInteractionEvents[_0xeaec('0x3')](_0x318c06,_0x41f7fd);};}exports['register']=function(_0x136158){for(var _0x7ee9d7=0x0,_0x378bad=events[_0xeaec('0x4')];_0x7ee9d7<_0x378bad;_0x7ee9d7++){var _0x122613=events[_0x7ee9d7];var _0x44da8e=createListener(_0xeaec('0x5')+_0x122613,_0x136158);MailInteractionEvents['on'](_0x122613,_0x44da8e);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index ef94370..683c346 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 _0x37e9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','put','update','/:id/accept','/:id/reject','reject','destroy'];(function(_0x3ca513,_0x49175b){var _0x447abe=function(_0x33ccfc){while(--_0x33ccfc){_0x3ca513['push'](_0x3ca513['shift']());}};_0x447abe(++_0x49175b);}(_0x37e9,0x1e7));var _0x937e=function(_0x14c5d2,_0x180a73){_0x14c5d2=_0x14c5d2-0x0;var _0x341bd2=_0x37e9[_0x14c5d2];return _0x341bd2;};'use strict';var multer=require(_0x937e('0x0'));var util=require(_0x937e('0x1'));var path=require(_0x937e('0x2'));var timeout=require(_0x937e('0x3'));var express=require(_0x937e('0x4'));var router=express[_0x937e('0x5')]();var fs_extra=require(_0x937e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x937e('0x7'));var config=require(_0x937e('0x8'));var controller=require(_0x937e('0x9'));router[_0x937e('0xa')]('/',auth[_0x937e('0xb')](),controller[_0x937e('0xc')]);router['get'](_0x937e('0xd'),auth[_0x937e('0xb')](),controller[_0x937e('0xe')]);router[_0x937e('0xa')](_0x937e('0xf'),auth[_0x937e('0xb')](),controller['show']);router['get'](_0x937e('0x10'),auth[_0x937e('0xb')](),controller[_0x937e('0x11')]);router[_0x937e('0x12')]('/',auth[_0x937e('0xb')](),interaction[_0x937e('0x13')]('mail','mailmessage:create'),controller['create']);router[_0x937e('0x14')](_0x937e('0xf'),auth['isAuthenticated'](),controller[_0x937e('0x15')]);router[_0x937e('0x14')](_0x937e('0x16'),auth[_0x937e('0xb')](),controller['accept']);router[_0x937e('0x14')](_0x937e('0x17'),auth[_0x937e('0xb')](),controller[_0x937e('0x18')]);router['delete'](_0x937e('0xf'),auth[_0x937e('0xb')](),controller[_0x937e('0x19')]);module[_0x937e('0x1a')]=router; \ No newline at end of file +var _0x3495=['reject','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject'];(function(_0x3551b7,_0x1d9c0f){var _0x51bf2b=function(_0x51ec19){while(--_0x51ec19){_0x3551b7['push'](_0x3551b7['shift']());}};_0x51bf2b(++_0x1d9c0f);}(_0x3495,0x1de));var _0x5349=function(_0x5c148b,_0x42d885){_0x5c148b=_0x5c148b-0x0;var _0x567538=_0x3495[_0x5c148b];return _0x567538;};'use strict';var multer=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var path=require(_0x5349('0x2'));var timeout=require(_0x5349('0x3'));var express=require(_0x5349('0x4'));var router=express[_0x5349('0x5')]();var fs_extra=require(_0x5349('0x6'));var auth=require(_0x5349('0x7'));var interaction=require(_0x5349('0x8'));var config=require('../../config/environment');var controller=require(_0x5349('0x9'));router[_0x5349('0xa')]('/',auth['isAuthenticated'](),controller[_0x5349('0xb')]);router['get'](_0x5349('0xc'),auth['isAuthenticated'](),controller[_0x5349('0xd')]);router['get'](_0x5349('0xe'),auth[_0x5349('0xf')](),controller[_0x5349('0x10')]);router[_0x5349('0xa')](_0x5349('0x11'),auth[_0x5349('0xf')](),controller[_0x5349('0x12')]);router['post']('/',auth[_0x5349('0xf')](),interaction['tracked'](_0x5349('0x13'),_0x5349('0x14')),controller[_0x5349('0x15')]);router[_0x5349('0x16')](_0x5349('0xe'),auth[_0x5349('0xf')](),controller[_0x5349('0x17')]);router[_0x5349('0x16')](_0x5349('0x18'),auth[_0x5349('0xf')](),controller['accept']);router[_0x5349('0x16')](_0x5349('0x19'),auth['isAuthenticated'](),controller[_0x5349('0x1a')]);router[_0x5349('0x1b')](_0x5349('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index c182268..75b2791 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 _0xd786=['Chat','Email','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER'];(function(_0x1428c1,_0xe9b7ce){var _0x17e0fe=function(_0x3580bc){while(--_0x3580bc){_0x1428c1['push'](_0x1428c1['shift']());}};_0x17e0fe(++_0xe9b7ce);}(_0xd786,0x18a));var _0x6d78=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xd786[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x6d78('0x0'));var _=require(_0x6d78('0x1'));module[_0x6d78('0x2')]={'body':{'type':Sequelize[_0x6d78('0x3')](_0x6d78('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6d78('0x3')](_0x6d78('0x5'))},'read':{'type':Sequelize[_0x6d78('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6d78('0x7')]('in',_0x6d78('0x8')),'defaultValue':_0x6d78('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6d78('0x9')](0x1fe)},'from':{'type':Sequelize[_0x6d78('0x9')]},'to':{'type':Sequelize[_0x6d78('0x3')](_0x6d78('0x4'))},'cc':{'type':Sequelize[_0x6d78('0x3')](_0x6d78('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x6d78('0x4'))},'subject':{'type':Sequelize[_0x6d78('0x3')]},'sentAt':{'type':Sequelize[_0x6d78('0xa')]},'attach':{'type':Sequelize[_0x6d78('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6d78('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6d78('0xa')]},'originTo':{'type':Sequelize[_0x6d78('0x3')]('long')},'originCc':{'type':Sequelize[_0x6d78('0x3')]('long')},'originChannel':{'type':Sequelize[_0x6d78('0x7')]('Email',_0x6d78('0xc')),'defaultValue':_0x6d78('0xd'),'allowNull':![]}}; \ No newline at end of file +var _0x7eb8=['ENUM','out','STRING','long','DATE','INTEGER','Email','Chat','lodash','exports','TEXT','medium','BOOLEAN'];(function(_0xc65142,_0x338c38){var _0x51722c=function(_0x3e0fdc){while(--_0x3e0fdc){_0xc65142['push'](_0xc65142['shift']());}};_0x51722c(++_0x338c38);}(_0x7eb8,0x10c));var _0x87eb=function(_0x230139,_0x6f62e4){_0x230139=_0x230139-0x0;var _0x4a8d70=_0x7eb8[_0x230139];return _0x4a8d70;};'use strict';var Sequelize=require('sequelize');var _=require(_0x87eb('0x0'));module[_0x87eb('0x1')]={'body':{'type':Sequelize[_0x87eb('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x3'))},'read':{'type':Sequelize[_0x87eb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x87eb('0x5')]('in',_0x87eb('0x6')),'defaultValue':_0x87eb('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x87eb('0x7')](0x1fe)},'from':{'type':Sequelize[_0x87eb('0x7')]},'to':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x8'))},'cc':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x8'))},'bcc':{'type':Sequelize['TEXT'](_0x87eb('0x8'))},'subject':{'type':Sequelize[_0x87eb('0x2')]},'sentAt':{'type':Sequelize[_0x87eb('0x9')]},'attach':{'type':Sequelize[_0x87eb('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x87eb('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x87eb('0x9')]},'originTo':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x8'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x87eb('0x5')](_0x87eb('0xb'),_0x87eb('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 3de8074..0baef40 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 _0xceba=['Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','user','agent','find','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','email','rejectmessage','toString','server','files','tmp','message-%s.eml','bcc','subject','Attachment','Attachments','from','createdAt','headers','Bcc','existsSync','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','json','undefined','limit','count','offset','update','destroy','end','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','describe','create','direction','out','secret','body','findOne','CmList','List','CmContact'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xceba,0xed));var _0xaceb=function(_0x1a3d41,_0x32c310){_0x1a3d41=_0x1a3d41-0x0;var _0x4a3256=_0xceba[_0x1a3d41];return _0x4a3256;};'use strict';var emlformat=require(_0xaceb('0x0'));var moment=require(_0xaceb('0x1'));var BPromise=require(_0xaceb('0x2'));var util=require(_0xaceb('0x3'));var path=require(_0xaceb('0x4'));var fs=require('fs');var _=require(_0xaceb('0x5'));var Redis=require(_0xaceb('0x6'));var htmlToText=require(_0xaceb('0x7'));var qs=require(_0xaceb('0x8'));var logger=require('../../config/logger')('api');var interaction_log=require(_0xaceb('0x9'))(_0xaceb('0xa'));var config=require('../../config/environment');var db=require(_0xaceb('0xb'))['db'];config[_0xaceb('0xc')]=_[_0xaceb('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaceb('0xc')]));var htmlEntities=require(_0xaceb('0xe'));require(_0xaceb('0xf'))['register'](socket);var jayson=require(_0xaceb('0x10'));var client=jayson['client'][_0xaceb('0x11')]({'port':0x232c});var client9003=jayson[_0xaceb('0x12')][_0xaceb('0x11')]({'port':0x232b});var client9002=jayson['client'][_0xaceb('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x36161a,_0x596686,_0xea867f,_0xd56e08){return new BPromise(function(_0xebd139,_0x3ca5b1){var _0x43e091=_0xd56e08||client;return _0x43e091[_0xaceb('0x13')](_0x36161a,_0xea867f)[_0xaceb('0x14')](function(_0x5d2034){logger[_0xaceb('0x15')](_0xaceb('0x16'),_0x596686,_0xaceb('0x17'));logger['debug'](_0xaceb('0x18'),_0x596686,_0xaceb('0x17'),JSON[_0xaceb('0x19')](_0x5d2034));if(_0x5d2034[_0xaceb('0x1a')]){if(_0x5d2034['error'][_0xaceb('0x1b')]===0x1f4){logger[_0xaceb('0x1a')]('MailMessage,\x20%s,\x20%s',_0x596686,_0x5d2034[_0xaceb('0x1a')][_0xaceb('0x1c')]);return _0x3ca5b1(_0x5d2034['error']['message']);}logger[_0xaceb('0x1a')](_0xaceb('0x16'),_0x596686,_0x5d2034[_0xaceb('0x1a')][_0xaceb('0x1c')]);return _0xebd139(_0x5d2034['error'][_0xaceb('0x1c')]);}else{logger[_0xaceb('0x15')]('MailMessage,\x20%s,\x20%s',_0x596686,_0xaceb('0x17'));_0xebd139(_0x5d2034['result'][_0xaceb('0x1c')]);}})['catch'](function(_0x59b8b7){logger[_0xaceb('0x1a')](_0xaceb('0x16'),_0x596686,_0x59b8b7);_0x3ca5b1(_0x59b8b7);});});}function respondWithResult(_0x1cb7a9,_0x21ccd5){_0x21ccd5=_0x21ccd5||0xc8;return function(_0x3124b4){if(_0x3124b4){return _0x1cb7a9[_0xaceb('0x1d')](_0x21ccd5)[_0xaceb('0x1e')](_0x3124b4);}};}function respondWithFilteredResult(_0x4feb26,_0x4460b5){return function(_0x457ddb){if(_0x457ddb){var _0xde15e1=typeof _0x4460b5['offset']===_0xaceb('0x1f')&&typeof _0x4460b5[_0xaceb('0x20')]===_0xaceb('0x1f');var _0x17fcfa=_0x457ddb[_0xaceb('0x21')];var _0xbad8c5=_0xde15e1?0x0:_0x4460b5['offset'];var _0x4d6d61=_0xde15e1?_0x457ddb['count']:_0x4460b5[_0xaceb('0x22')]+_0x4460b5['limit'];var _0x49dedd;if(_0x4d6d61>=_0x17fcfa){_0x4d6d61=_0x17fcfa;_0x49dedd=0xc8;}else{_0x49dedd=0xce;}_0x4feb26['status'](_0x49dedd);return _0x4feb26['set']('Content-Range',_0xbad8c5+'-'+_0x4d6d61+'/'+_0x17fcfa)[_0xaceb('0x1e')](_0x457ddb);}return null;};}function saveUpdates(_0x37d887){return function(_0x3d731){if(_0x3d731){return _0x3d731[_0xaceb('0x23')](_0x37d887)[_0xaceb('0x14')](function(_0x394a88){return _0x394a88;});}return null;};}function removeEntity(_0x2d6f0d){return function(_0x50d7cf){if(_0x50d7cf){return _0x50d7cf[_0xaceb('0x24')]()['then'](function(){_0x2d6f0d[_0xaceb('0x1d')](0xcc)[_0xaceb('0x25')]();});}};}function handleEntityNotFound(_0x45c797){return function(_0x3d349c){if(!_0x3d349c){_0x45c797['sendStatus'](0x194);}return _0x3d349c;};}function handleError(_0x20fc3f,_0xc7272b){_0xc7272b=_0xc7272b||0x1f4;return function(_0x2eef94){logger[_0xaceb('0x1a')](_0x2eef94[_0xaceb('0x26')]);if(_0x2eef94[_0xaceb('0x27')]){delete _0x2eef94[_0xaceb('0x27')];}_0x20fc3f['status'](_0xc7272b)[_0xaceb('0x28')](_0x2eef94);};}exports[_0xaceb('0x29')]=function(_0x57f04d,_0x2bb3ee){var _0x38dcab={},_0x28eb5c={},_0x45f48d={'count':0x0,'rows':[]};var _0x5d8144=_['map'](db[_0xaceb('0x2a')][_0xaceb('0x2b')],function(_0x2dd9bd){return{'name':_0x2dd9bd[_0xaceb('0x2c')],'type':_0x2dd9bd[_0xaceb('0x2d')][_0xaceb('0x2e')]};});_0x28eb5c['model']=_['map'](_0x5d8144,_0xaceb('0x27'));_0x28eb5c[_0xaceb('0x2f')]=_[_0xaceb('0x30')](_0x57f04d['query']);_0x28eb5c[_0xaceb('0x31')]=_[_0xaceb('0x32')](_0x28eb5c[_0xaceb('0x33')],_0x28eb5c[_0xaceb('0x2f')]);_0x38dcab['attributes']=_['intersection'](_0x28eb5c[_0xaceb('0x33')],qs[_0xaceb('0x34')](_0x57f04d['query'][_0xaceb('0x34')]));_0x38dcab[_0xaceb('0x35')]=_0x38dcab['attributes'][_0xaceb('0x36')]?_0x38dcab['attributes']:_0x28eb5c[_0xaceb('0x33')];if(!_0x57f04d[_0xaceb('0x2f')][_0xaceb('0x37')](_0xaceb('0x38'))){_0x38dcab[_0xaceb('0x20')]=qs[_0xaceb('0x20')](_0x57f04d[_0xaceb('0x2f')][_0xaceb('0x20')]);_0x38dcab[_0xaceb('0x22')]=qs[_0xaceb('0x22')](_0x57f04d[_0xaceb('0x2f')][_0xaceb('0x22')]);}_0x38dcab[_0xaceb('0x39')]=qs[_0xaceb('0x3a')](_0x57f04d[_0xaceb('0x2f')][_0xaceb('0x3a')]);_0x38dcab[_0xaceb('0x3b')]=qs['filters'](_[_0xaceb('0x3c')](_0x57f04d[_0xaceb('0x2f')],_0x28eb5c[_0xaceb('0x31')]),_0x5d8144);if(_0x57f04d[_0xaceb('0x2f')][_0xaceb('0x3d')]){_0x38dcab['where']=_[_0xaceb('0x3e')](_0x38dcab['where'],{'$or':_['map'](_0x5d8144,function(_0x370787){if(_0x370787[_0xaceb('0x2d')]!=='VIRTUAL'){var _0xbf84f3={};_0xbf84f3[_0x370787[_0xaceb('0x27')]]={'$like':'%'+_0x57f04d[_0xaceb('0x2f')]['filter']+'%'};return _0xbf84f3;}})});}_0x38dcab=_[_0xaceb('0x3e')]({},_0x38dcab,_0x57f04d[_0xaceb('0x3f')]);var _0x4daac2={'where':_0x38dcab[_0xaceb('0x3b')]};return db['MailMessage'][_0xaceb('0x21')](_0x4daac2)['then'](function(_0x101b42){_0x45f48d[_0xaceb('0x21')]=_0x101b42;if(_0x57f04d['query'][_0xaceb('0x40')]){_0x38dcab[_0xaceb('0x41')]=[{'all':!![]}];}return db[_0xaceb('0x2a')][_0xaceb('0x42')](_0x38dcab);})[_0xaceb('0x14')](function(_0x5ac2e7){_0x45f48d[_0xaceb('0x43')]=_0x5ac2e7;return _0x45f48d;})[_0xaceb('0x14')](respondWithFilteredResult(_0x2bb3ee,_0x38dcab))[_0xaceb('0x44')](handleError(_0x2bb3ee,null));};exports[_0xaceb('0x45')]=function(_0x3d3495,_0x53c12b){var _0x336104={'raw':!![],'where':{'id':_0x3d3495[_0xaceb('0x46')]['id']}},_0x3541f9={};_0x3541f9[_0xaceb('0x33')]=_[_0xaceb('0x30')](db[_0xaceb('0x2a')][_0xaceb('0x2b')]);_0x3541f9[_0xaceb('0x2f')]=_[_0xaceb('0x30')](_0x3d3495[_0xaceb('0x2f')]);_0x3541f9[_0xaceb('0x31')]=_[_0xaceb('0x32')](_0x3541f9['model'],_0x3541f9['query']);_0x336104['attributes']=_[_0xaceb('0x32')](_0x3541f9[_0xaceb('0x33')],qs['fields'](_0x3d3495[_0xaceb('0x2f')][_0xaceb('0x34')]));_0x336104[_0xaceb('0x35')]=_0x336104[_0xaceb('0x35')][_0xaceb('0x36')]?_0x336104[_0xaceb('0x35')]:_0x3541f9[_0xaceb('0x33')];if(_0x3d3495['query'][_0xaceb('0x40')]){_0x336104[_0xaceb('0x41')]=[{'all':!![]}];}_0x336104=_[_0xaceb('0x3e')]({},_0x336104,_0x3d3495['options']);return db[_0xaceb('0x2a')]['find'](_0x336104)['then'](handleEntityNotFound(_0x53c12b,null))[_0xaceb('0x14')](respondWithResult(_0x53c12b,null))['catch'](handleError(_0x53c12b,null));};exports[_0xaceb('0x23')]=function(_0x6f2ecb,_0x331cfa){if(_0x6f2ecb['body']['id']){delete _0x6f2ecb['body']['id'];}return db[_0xaceb('0x2a')]['find']({'where':{'id':_0x6f2ecb[_0xaceb('0x46')]['id']}})[_0xaceb('0x14')](handleEntityNotFound(_0x331cfa,null))[_0xaceb('0x14')](saveUpdates(_0x6f2ecb['body'],null))[_0xaceb('0x14')](respondWithResult(_0x331cfa,null))[_0xaceb('0x44')](handleError(_0x331cfa,null));};exports[_0xaceb('0x24')]=function(_0x4aa228,_0x331dad){return db[_0xaceb('0x2a')]['find']({'where':{'id':_0x4aa228[_0xaceb('0x46')]['id']}})['then'](handleEntityNotFound(_0x331dad,null))[_0xaceb('0x14')](removeEntity(_0x331dad,null))[_0xaceb('0x44')](handleError(_0x331dad,null));};exports[_0xaceb('0x47')]=function(_0x403fc4,_0x13a1b4){return db[_0xaceb('0x2a')][_0xaceb('0x47')]()[_0xaceb('0x14')](respondWithResult(_0x13a1b4,null))[_0xaceb('0x44')](handleError(_0x13a1b4,null));};exports[_0xaceb('0x48')]=function(_0x13f6d7,_0x4c85ac){return db['MailMessage'][_0xaceb('0x48')](_0x13f6d7['body'])['then'](function(_0x56b3a3){if(_0x56b3a3){if(_0x56b3a3[_0xaceb('0x49')]===_0xaceb('0x4a')&&!_0x56b3a3[_0xaceb('0x4b')]){var _0x2e2b77,_0x27f2d7,_0x359ba5;if(_0x13f6d7[_0xaceb('0x4c')]['to']){_0x27f2d7=_0x13f6d7['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0xaceb('0x4d')]({'where':{'id':_0x56b3a3['MailAccountId']},'include':[{'model':db[_0xaceb('0x4e')],'as':_0xaceb('0x4f'),'include':[{'model':db[_0xaceb('0x50')],'as':_0xaceb('0x51'),'where':{'email':_0x27f2d7},'limit':0x1,'order':[[_0xaceb('0x52'),_0xaceb('0x53')]]}]},{'model':db[_0xaceb('0x54')],'as':_0xaceb('0x55'),'raw':!![],'include':[{'model':db[_0xaceb('0x56')],'as':'CloudProvider','raw':!![]}]}]})[_0xaceb('0x14')](function(_0x2ded43){_0x2e2b77=_0x2ded43;if(!_0x2e2b77||!_0x2e2b77['Smtp'])return;var _0x3a54a1=_0x2e2b77[_0xaceb('0x57')]();if(_0x13f6d7['body']['attachments']&&_0x13f6d7[_0xaceb('0x4c')][_0xaceb('0x58')]['length']){for(var _0x17918a=0x0;_0x17918a<_0x13f6d7[_0xaceb('0x4c')][_0xaceb('0x58')][_0xaceb('0x36')];_0x17918a+=0x1){_0x13f6d7[_0xaceb('0x4c')][_0xaceb('0x58')][_0x17918a]={'filename':_0x13f6d7[_0xaceb('0x4c')][_0xaceb('0x58')][_0x17918a][_0xaceb('0x27')],'path':path[_0xaceb('0x59')](config[_0xaceb('0x5a')],_0xaceb('0x5b'),_0x13f6d7[_0xaceb('0x4c')][_0xaceb('0x58')][_0x17918a][_0xaceb('0x5c')])};}}_0x359ba5={'account':_0x3a54a1,'message':_0x13f6d7[_0xaceb('0x4c')]};return;})['then'](function(){if(_0x2e2b77['List']){if(_0x2e2b77[_0xaceb('0x4f')][_0xaceb('0x51')][_0xaceb('0x36')]){return _0x2e2b77[_0xaceb('0x4f')]['Contacts'][0x0];}else{return db[_0xaceb('0x50')][_0xaceb('0x48')](_[_0xaceb('0xd')](_0x13f6d7[_0xaceb('0x4c')],{'firstName':_0x13f6d7['body']['to'],'email':_0x13f6d7['body']['to'],'phone':_0x13f6d7[_0xaceb('0x4c')]['to'],'ListId':_0x2e2b77['ListId']}));}}else{throw new Error(_0xaceb('0x5d'));}})[_0xaceb('0x14')](function(){if(_0x359ba5){return respondWithRpcPromise(_0xaceb('0x5e'),'sendMail',_0x359ba5,client9003)[_0xaceb('0x14')](function(_0x331506){return _0x56b3a3[_0xaceb('0x23')]({'read':!![],'messageId':_0x331506[_0xaceb('0x5f')],'sentAt':moment()['format'](_0xaceb('0x60'))});})[_0xaceb('0x44')](function(_0x331758){logger[_0xaceb('0x1a')]('%s',JSON['stringify'](_0x331758));return _0x56b3a3;});}return _0x56b3a3;});}return _0x56b3a3;}})[_0xaceb('0x14')](respondWithResult(_0x4c85ac,0xc9))[_0xaceb('0x44')](handleError(_0x4c85ac,null));};exports[_0xaceb('0x61')]=function(_0x2356af,_0x3e89ff){var _0x3ebd52={'agent':{},'channel':_0xaceb('0x62')};if(_0x2356af[_0xaceb('0x4c')]['id']){delete _0x2356af[_0xaceb('0x4c')]['id'];}_0x2356af[_0xaceb('0x4c')][_0xaceb('0x63')]=!![];_0x2356af['body'][_0xaceb('0x64')]=moment()[_0xaceb('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x2356af[_0xaceb('0x4c')][_0xaceb('0x66')]=_0x2356af[_0xaceb('0x4c')][_0xaceb('0x66')]||_0x2356af[_0xaceb('0x67')]['id'];_0x3ebd52[_0xaceb('0x68')]['id']=_0x2356af[_0xaceb('0x4c')][_0xaceb('0x66')];return db[_0xaceb('0x2a')][_0xaceb('0x69')]({'where':{'id':_0x2356af[_0xaceb('0x46')]['id'],'UserId':null}})[_0xaceb('0x14')](handleEntityNotFound(_0x3e89ff,null))[_0xaceb('0x14')](saveUpdates(_0x2356af[_0xaceb('0x4c')],null))['then'](function(_0x35a50e){if(_0x35a50e){_0x3ebd52['message']=_0x35a50e[_0xaceb('0x6a')]({'plain':!![]});return db[_0xaceb('0x6b')][_0xaceb('0x69')]({'where':{'id':_0x35a50e[_0xaceb('0x6c')]}});}return null;})[_0xaceb('0x14')](handleEntityNotFound(_0x3e89ff,null))[_0xaceb('0x14')](function(_0xa813fc){if(_0xa813fc){return _0xa813fc[_0xaceb('0x23')]({'UserId':_0x2356af[_0xaceb('0x4c')][_0xaceb('0x66')],'read1stAt':_['isNil'](_0xa813fc[_0xaceb('0x6d')])?moment()[_0xaceb('0x65')](_0xaceb('0x60')):undefined});}return null;})[_0xaceb('0x14')](function(_0x55ab0d){if(_0x55ab0d){_0x3ebd52[_0xaceb('0x6e')]=_0x55ab0d[_0xaceb('0x6a')]({'plain':!![]});interaction_log[_0xaceb('0x15')](_0xaceb('0x6f'),_0x2356af[_0xaceb('0x67')]['id'],_0x2356af[_0xaceb('0x67')][_0xaceb('0x27')],_0x2356af[_0xaceb('0x67')][_0xaceb('0x70')],_0x3ebd52[_0xaceb('0x6e')]['id'],_0x2356af[_0xaceb('0x4c')]?JSON[_0xaceb('0x19')](_0x2356af[_0xaceb('0x4c')]):_0xaceb('0x71'));return respondWithRpcPromise(_0xaceb('0x72'),_0xaceb('0x73'),_0x3ebd52);}return null;})[_0xaceb('0x14')](function(_0x4e8aaa){var _0x235c0d=_0xaceb('0x74')+_0x4e8aaa[_0xaceb('0x1c')][_0xaceb('0x75')];return db[_0xaceb('0x76')][_0xaceb('0x2f')](_0x235c0d,{'type':db[_0xaceb('0x77')][_0xaceb('0x78')]['SELECT'],'raw':!![]})[_0xaceb('0x14')](function(_0x52520f){return _0x52520f;});})[_0xaceb('0x14')](function(_0x2d7800){if(_0x2d7800){_0x3ebd52['message'][_0xaceb('0x79')]=_0x2d7800[0x0];if(!_0x2356af['body'][_0xaceb('0x66')])return;return db[_0xaceb('0x7a')][_0xaceb('0x69')]({'where':{'id':_0x2356af[_0xaceb('0x4c')]['UserId'],'role':'agent'},'attributes':['id',_0xaceb('0x27'),_0xaceb('0x7b'),'email',_0xaceb('0x7c')],'raw':!![]});}return null;})[_0xaceb('0x14')](function(_0x47d146){if(!_0x47d146)return null;_0x3ebd52[_0xaceb('0x1c')]['agent']=_0x47d146;return _0x3ebd52;})[_0xaceb('0x14')](function(_0x5ee4c1){if(_0x5ee4c1){if(_0x2356af[_0xaceb('0x4c')][_0xaceb('0x7d')]){_0x3ebd52[_0xaceb('0x1c')][_0xaceb('0x7e')]=util['format'](_0xaceb('0x7f'),_0x2356af[_0xaceb('0x67')]['name']);_0x3ebd52[_0xaceb('0x1c')]['channel']=_0x3ebd52[_0xaceb('0x80')];_0x3ebd52[_0xaceb('0x1c')][_0xaceb('0x81')]=_0x3ebd52[_0xaceb('0x80')];_0x3ebd52[_0xaceb('0x1c')]['event']=_0xaceb('0x61');_0x3ebd52['message'][_0xaceb('0x4c')]=htmlToText[_0xaceb('0x82')](_0x3ebd52[_0xaceb('0x1c')]['body']);return respondWithRpcPromise(_0xaceb('0x83'),'EventManager',{'event':_0xaceb('0x84'),'message':_0x3ebd52['message']},client9002)[_0xaceb('0x14')](function(){return _0x3ebd52;});}return _0x3ebd52;}return null;})[_0xaceb('0x14')](respondWithResult(_0x3e89ff,null))['catch'](handleError(_0x3e89ff,null));};exports[_0xaceb('0x85')]=function(_0x2cbf9a,_0x43fa42){var _0x48926e={'agent':{},'channel':_0xaceb('0x62')};if(_0x2cbf9a[_0xaceb('0x4c')]['id']){delete _0x2cbf9a['body']['id'];}_0x2cbf9a[_0xaceb('0x4c')][_0xaceb('0x66')]=_0x2cbf9a[_0xaceb('0x4c')][_0xaceb('0x66')]||_0x2cbf9a[_0xaceb('0x67')]['id'];_0x48926e[_0xaceb('0x68')]['id']=_0x2cbf9a[_0xaceb('0x4c')]['UserId'];return db[_0xaceb('0x2a')][_0xaceb('0x69')]({'where':{'id':_0x2cbf9a[_0xaceb('0x46')]['id'],'UserId':null}})[_0xaceb('0x14')](handleEntityNotFound(_0x43fa42,null))['then'](function(_0x1610a9){if(_0x1610a9){_0x48926e[_0xaceb('0x1c')]=_0x1610a9[_0xaceb('0x6a')]({'plain':!![]});return db[_0xaceb('0x6b')][_0xaceb('0x69')]({'where':{'id':_0x1610a9[_0xaceb('0x6c')]}});}return null;})[_0xaceb('0x14')](handleEntityNotFound(_0x43fa42,null))['then'](function(_0x4d571a){if(_0x4d571a){_0x48926e[_0xaceb('0x6e')]=_0x4d571a[_0xaceb('0x6a')]({'plain':!![]});interaction_log['info'](_0xaceb('0x86'),_0x2cbf9a[_0xaceb('0x67')]['id'],_0x2cbf9a['user']['name'],_0x2cbf9a[_0xaceb('0x67')][_0xaceb('0x70')],_0x48926e[_0xaceb('0x6e')]['id'],_0x2cbf9a[_0xaceb('0x4c')]?JSON['stringify'](_0x2cbf9a[_0xaceb('0x4c')]):_0xaceb('0x71'));return respondWithRpcPromise(_0xaceb('0x87'),_0xaceb('0x88'),_0x48926e);}return null;})[_0xaceb('0x14')](function(_0x23a21f){var _0x4d2982=_0xaceb('0x74')+_0x23a21f['message'][_0xaceb('0x75')];return db[_0xaceb('0x76')][_0xaceb('0x2f')](_0x4d2982,{'type':db[_0xaceb('0x77')][_0xaceb('0x78')][_0xaceb('0x89')],'raw':!![]})[_0xaceb('0x14')](function(_0x45d3c6){return _0x45d3c6;});})['then'](function(_0x17b277){if(_0x17b277){_0x48926e['message'][_0xaceb('0x79')]=_0x17b277[0x0];if(!_0x2cbf9a[_0xaceb('0x4c')]['UserId'])return;return db[_0xaceb('0x7a')][_0xaceb('0x69')]({'where':{'id':_0x2cbf9a[_0xaceb('0x4c')]['UserId'],'role':'agent'},'attributes':['id',_0xaceb('0x27'),_0xaceb('0x7b'),_0xaceb('0x8a'),_0xaceb('0x7c')],'raw':!![]});}return null;})['then'](function(_0x39019d){if(!_0x39019d)return null;_0x48926e[_0xaceb('0x1c')]['agent']=_0x39019d;return _0x48926e;})['then'](function(_0x49e4c1){if(_0x49e4c1){_0x49e4c1[_0xaceb('0x1c')][_0xaceb('0x7e')]=util[_0xaceb('0x65')]('SIP/%s',_0x2cbf9a[_0xaceb('0x67')][_0xaceb('0x27')]);_0x49e4c1['message'][_0xaceb('0x80')]=_0x48926e[_0xaceb('0x80')];_0x49e4c1[_0xaceb('0x1c')][_0xaceb('0x81')]=_0x48926e[_0xaceb('0x80')];_0x49e4c1[_0xaceb('0x1c')]['event']=_0xaceb('0x85');_0x49e4c1[_0xaceb('0x1c')][_0xaceb('0x4c')]=htmlToText[_0xaceb('0x82')](_0x48926e[_0xaceb('0x1c')][_0xaceb('0x4c')]);respondWithRpcPromise(_0xaceb('0x83'),_0xaceb('0x83'),{'event':_0xaceb('0x8b'),'message':_0x49e4c1[_0xaceb('0x1c')]},client9002);return _0x48926e;}return null;})[_0xaceb('0x14')](respondWithResult(_0x43fa42,null))['catch'](handleError(_0x43fa42,null));};exports['download']=function(_0x3265b9,_0x4af68f){var _0x3ce98e=moment()['unix']()[_0xaceb('0x8c')]();var _0x91bb61=path[_0xaceb('0x59')](config[_0xaceb('0x5a')],_0xaceb('0x8d'),_0xaceb('0x8e'),_0xaceb('0x8f'));var _0x5a7d69=path[_0xaceb('0x59')](config['root'],_0xaceb('0x8d'),_0xaceb('0x8e'),_0xaceb('0x58'));var _0x39e464=util[_0xaceb('0x65')](_0xaceb('0x90'),_0x3ce98e);return db[_0xaceb('0x2a')][_0xaceb('0x69')]({'where':{'id':_0x3265b9['params']['id']},'attributes':['id','body','from','to','cc',_0xaceb('0x91'),_0xaceb('0x92'),'createdAt'],'include':_0x3265b9['query'][_0xaceb('0x58')]?[{'model':db[_0xaceb('0x93')],'as':_0xaceb('0x94')}]:undefined})[_0xaceb('0x14')](handleEntityNotFound(_0x4af68f,null))[_0xaceb('0x14')](function(_0x447f5d){if(_0x447f5d){var _0x2d6d47=_0x447f5d;var _0xb31fb2={'from':_0x2d6d47[_0xaceb('0x95')],'to':_0x2d6d47['to'],'subject':_0x2d6d47['subject'],'html':htmlEntities['decode'](_0x2d6d47[_0xaceb('0x4c')]),'headers':{'Date':moment(_0x2d6d47[_0xaceb('0x96')])[_0xaceb('0x65')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x447f5d['cc']){_0xb31fb2[_0xaceb('0x97')]['Cc']=_0x447f5d['cc'];}if(_0x447f5d[_0xaceb('0x91')]){_0xb31fb2['headers'][_0xaceb('0x98')]=_0x447f5d[_0xaceb('0x91')];}return new BPromise(function(_0x3e977c,_0x4d9a09){if(_0x447f5d[_0xaceb('0x94')]){for(var _0xcd7ef8=0x0;_0xcd7ef8<_0x447f5d['Attachments']['length'];_0xcd7ef8++){var _0x2c3485=_0x447f5d['Attachments'][_0xcd7ef8];var _0x5ec68f=path[_0xaceb('0x59')](_0x5a7d69,_0x2c3485['basename']);if(fs[_0xaceb('0x99')](_0x5ec68f)){_0xb31fb2['attachments']['push']({'name':_0x2c3485[_0xaceb('0x27')],'contentType':_0x2c3485['type'],'data':fs[_0xaceb('0x9a')](_0x5ec68f)});}}}emlformat[_0xaceb('0x9b')](_0xb31fb2,function(_0x163d54,_0x5c0fe0){if(_0x163d54)return _0x4d9a09(_0x163d54);fs[_0xaceb('0x9c')](path[_0xaceb('0x59')](_0x91bb61,_0x39e464),_0x5c0fe0);return _0x3e977c(_0x5c0fe0);});});}})[_0xaceb('0x14')](function(_0xeaeab4){if(_0xeaeab4){return _0x4af68f[_0xaceb('0x9d')](path[_0xaceb('0x59')](_0x91bb61,_0x39e464),_0x39e464,function(_0x4cdd92){if(!_0x4cdd92)fs[_0xaceb('0x9e')](path['join'](_0x91bb61,_0x39e464));});}})[_0xaceb('0x44')](handleError(_0x4af68f,null));}; \ No newline at end of file +var _0xa06d=['motionChannel','download','unix','toString','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','unlinkSync','eml-format','moment','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','status','undefined','offset','limit','Content-Range','update','end','sendStatus','stack','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','catch','params','keys','body','find','describe','create','direction','out','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','format','UserId','user','agent','get','MailInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','channel','event','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','interface'];(function(_0x43dd52,_0x16d5f5){var _0x398a00=function(_0xa3db1a){while(--_0xa3db1a){_0x43dd52['push'](_0x43dd52['shift']());}};_0x398a00(++_0x16d5f5);}(_0xa06d,0x144));var _0xda06=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa06d[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xda06('0x0'));var moment=require(_0xda06('0x1'));var BPromise=require('bluebird');var util=require(_0xda06('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xda06('0x3'));var Redis=require(_0xda06('0x4'));var htmlToText=require(_0xda06('0x5'));var qs=require(_0xda06('0x6'));var logger=require(_0xda06('0x7'))(_0xda06('0x8'));var interaction_log=require(_0xda06('0x7'))('mail-interactions');var config=require(_0xda06('0x9'));var db=require('../../mysqldb')['db'];config[_0xda06('0xa')]=_[_0xda06('0xb')](config[_0xda06('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda06('0xa')]));var htmlEntities=require(_0xda06('0xc'));require(_0xda06('0xd'))[_0xda06('0xe')](socket);var jayson=require(_0xda06('0xf'));var client=jayson[_0xda06('0x10')][_0xda06('0x11')]({'port':0x232c});var client9003=jayson[_0xda06('0x10')][_0xda06('0x11')]({'port':0x232b});var client9002=jayson[_0xda06('0x10')][_0xda06('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x2500bc,_0x5d7e3a,_0x5276e3,_0x54acdd){return new BPromise(function(_0x37884b,_0x3cf498){var _0x5d78d8=_0x54acdd||client;return _0x5d78d8[_0xda06('0x12')](_0x2500bc,_0x5276e3)[_0xda06('0x13')](function(_0x13c265){logger[_0xda06('0x14')](_0xda06('0x15'),_0x5d7e3a,_0xda06('0x16'));logger['debug'](_0xda06('0x17'),_0x5d7e3a,'request\x20sent',JSON['stringify'](_0x13c265));if(_0x13c265['error']){if(_0x13c265[_0xda06('0x18')]['code']===0x1f4){logger[_0xda06('0x18')](_0xda06('0x15'),_0x5d7e3a,_0x13c265[_0xda06('0x18')][_0xda06('0x19')]);return _0x3cf498(_0x13c265['error'][_0xda06('0x19')]);}logger[_0xda06('0x18')](_0xda06('0x15'),_0x5d7e3a,_0x13c265[_0xda06('0x18')][_0xda06('0x19')]);return _0x37884b(_0x13c265[_0xda06('0x18')][_0xda06('0x19')]);}else{logger[_0xda06('0x14')](_0xda06('0x15'),_0x5d7e3a,'request\x20sent');_0x37884b(_0x13c265[_0xda06('0x1a')][_0xda06('0x19')]);}})['catch'](function(_0x4c3668){logger['error'](_0xda06('0x15'),_0x5d7e3a,_0x4c3668);_0x3cf498(_0x4c3668);});});}function respondWithResult(_0x54d27c,_0x41b99e){_0x41b99e=_0x41b99e||0xc8;return function(_0x53f9db){if(_0x53f9db){return _0x54d27c[_0xda06('0x1b')](_0x41b99e)['json'](_0x53f9db);}};}function respondWithFilteredResult(_0xb761ff,_0x1ff92a){return function(_0x3a2047){if(_0x3a2047){var _0x20240c=typeof _0x1ff92a['offset']===_0xda06('0x1c')&&typeof _0x1ff92a['limit']===_0xda06('0x1c');var _0x41996f=_0x3a2047['count'];var _0x14b9b4=_0x20240c?0x0:_0x1ff92a['offset'];var _0x18596c=_0x20240c?_0x3a2047['count']:_0x1ff92a[_0xda06('0x1d')]+_0x1ff92a[_0xda06('0x1e')];var _0x388c3d;if(_0x18596c>=_0x41996f){_0x18596c=_0x41996f;_0x388c3d=0xc8;}else{_0x388c3d=0xce;}_0xb761ff[_0xda06('0x1b')](_0x388c3d);return _0xb761ff['set'](_0xda06('0x1f'),_0x14b9b4+'-'+_0x18596c+'/'+_0x41996f)['json'](_0x3a2047);}return null;};}function saveUpdates(_0x4c3145){return function(_0x15af04){if(_0x15af04){return _0x15af04[_0xda06('0x20')](_0x4c3145)[_0xda06('0x13')](function(_0x551437){return _0x551437;});}return null;};}function removeEntity(_0x5aed10){return function(_0x406b4f){if(_0x406b4f){return _0x406b4f['destroy']()[_0xda06('0x13')](function(){_0x5aed10[_0xda06('0x1b')](0xcc)[_0xda06('0x21')]();});}};}function handleEntityNotFound(_0x222825){return function(_0x440fbe){if(!_0x440fbe){_0x222825[_0xda06('0x22')](0x194);}return _0x440fbe;};}function handleError(_0x68c3de,_0x276725){_0x276725=_0x276725||0x1f4;return function(_0x4b1b1d){logger[_0xda06('0x18')](_0x4b1b1d[_0xda06('0x23')]);if(_0x4b1b1d['name']){delete _0x4b1b1d['name'];}_0x68c3de['status'](_0x276725)[_0xda06('0x24')](_0x4b1b1d);};}exports[_0xda06('0x25')]=function(_0x35f061,_0x3dc9f5){var _0x1eb431={},_0x336537={},_0x2ef32a={'count':0x0,'rows':[]};var _0x279651=_[_0xda06('0x26')](db[_0xda06('0x27')][_0xda06('0x28')],function(_0x58a8c2){return{'name':_0x58a8c2[_0xda06('0x29')],'type':_0x58a8c2[_0xda06('0x2a')][_0xda06('0x2b')]};});_0x336537[_0xda06('0x2c')]=_[_0xda06('0x26')](_0x279651,_0xda06('0x2d'));_0x336537[_0xda06('0x2e')]=_['keys'](_0x35f061['query']);_0x336537[_0xda06('0x2f')]=_[_0xda06('0x30')](_0x336537[_0xda06('0x2c')],_0x336537[_0xda06('0x2e')]);_0x1eb431[_0xda06('0x31')]=_['intersection'](_0x336537[_0xda06('0x2c')],qs[_0xda06('0x32')](_0x35f061[_0xda06('0x2e')][_0xda06('0x32')]));_0x1eb431[_0xda06('0x31')]=_0x1eb431[_0xda06('0x31')][_0xda06('0x33')]?_0x1eb431['attributes']:_0x336537['model'];if(!_0x35f061['query']['hasOwnProperty'](_0xda06('0x34'))){_0x1eb431[_0xda06('0x1e')]=qs[_0xda06('0x1e')](_0x35f061[_0xda06('0x2e')][_0xda06('0x1e')]);_0x1eb431[_0xda06('0x1d')]=qs['offset'](_0x35f061[_0xda06('0x2e')][_0xda06('0x1d')]);}_0x1eb431[_0xda06('0x35')]=qs['sort'](_0x35f061[_0xda06('0x2e')][_0xda06('0x36')]);_0x1eb431['where']=qs[_0xda06('0x2f')](_[_0xda06('0x37')](_0x35f061[_0xda06('0x2e')],_0x336537[_0xda06('0x2f')]),_0x279651);if(_0x35f061[_0xda06('0x2e')][_0xda06('0x38')]){_0x1eb431[_0xda06('0x39')]=_['merge'](_0x1eb431[_0xda06('0x39')],{'$or':_['map'](_0x279651,function(_0x28dc37){if(_0x28dc37[_0xda06('0x2a')]!=='VIRTUAL'){var _0x52814b={};_0x52814b[_0x28dc37['name']]={'$like':'%'+_0x35f061[_0xda06('0x2e')][_0xda06('0x38')]+'%'};return _0x52814b;}})});}_0x1eb431=_[_0xda06('0x3a')]({},_0x1eb431,_0x35f061[_0xda06('0x3b')]);var _0x244456={'where':_0x1eb431[_0xda06('0x39')]};return db[_0xda06('0x27')][_0xda06('0x3c')](_0x244456)[_0xda06('0x13')](function(_0x26577b){_0x2ef32a['count']=_0x26577b;if(_0x35f061[_0xda06('0x2e')][_0xda06('0x3d')]){_0x1eb431[_0xda06('0x3e')]=[{'all':!![]}];}return db[_0xda06('0x27')][_0xda06('0x3f')](_0x1eb431);})[_0xda06('0x13')](function(_0x58ad86){_0x2ef32a['rows']=_0x58ad86;return _0x2ef32a;})[_0xda06('0x13')](respondWithFilteredResult(_0x3dc9f5,_0x1eb431))[_0xda06('0x40')](handleError(_0x3dc9f5,null));};exports['show']=function(_0xbb8834,_0xb9312c){var _0x242b44={'raw':!![],'where':{'id':_0xbb8834[_0xda06('0x41')]['id']}},_0x54f55f={};_0x54f55f[_0xda06('0x2c')]=_[_0xda06('0x42')](db[_0xda06('0x27')]['rawAttributes']);_0x54f55f['query']=_[_0xda06('0x42')](_0xbb8834['query']);_0x54f55f[_0xda06('0x2f')]=_['intersection'](_0x54f55f[_0xda06('0x2c')],_0x54f55f['query']);_0x242b44[_0xda06('0x31')]=_[_0xda06('0x30')](_0x54f55f[_0xda06('0x2c')],qs['fields'](_0xbb8834[_0xda06('0x2e')][_0xda06('0x32')]));_0x242b44[_0xda06('0x31')]=_0x242b44[_0xda06('0x31')][_0xda06('0x33')]?_0x242b44[_0xda06('0x31')]:_0x54f55f[_0xda06('0x2c')];if(_0xbb8834['query'][_0xda06('0x3d')]){_0x242b44['include']=[{'all':!![]}];}_0x242b44=_[_0xda06('0x3a')]({},_0x242b44,_0xbb8834[_0xda06('0x3b')]);return db[_0xda06('0x27')]['find'](_0x242b44)['then'](handleEntityNotFound(_0xb9312c,null))[_0xda06('0x13')](respondWithResult(_0xb9312c,null))[_0xda06('0x40')](handleError(_0xb9312c,null));};exports[_0xda06('0x20')]=function(_0x5ab9f5,_0x17a03c){if(_0x5ab9f5[_0xda06('0x43')]['id']){delete _0x5ab9f5[_0xda06('0x43')]['id'];}return db['MailMessage'][_0xda06('0x44')]({'where':{'id':_0x5ab9f5[_0xda06('0x41')]['id']}})[_0xda06('0x13')](handleEntityNotFound(_0x17a03c,null))[_0xda06('0x13')](saveUpdates(_0x5ab9f5[_0xda06('0x43')],null))[_0xda06('0x13')](respondWithResult(_0x17a03c,null))[_0xda06('0x40')](handleError(_0x17a03c,null));};exports['destroy']=function(_0x32d2df,_0x55513b){return db[_0xda06('0x27')]['find']({'where':{'id':_0x32d2df[_0xda06('0x41')]['id']}})[_0xda06('0x13')](handleEntityNotFound(_0x55513b,null))[_0xda06('0x13')](removeEntity(_0x55513b,null))['catch'](handleError(_0x55513b,null));};exports['describe']=function(_0xbf80cc,_0x37695a){return db['MailMessage'][_0xda06('0x45')]()['then'](respondWithResult(_0x37695a,null))[_0xda06('0x40')](handleError(_0x37695a,null));};exports[_0xda06('0x46')]=function(_0x83eb8c,_0xe16b2e){return db[_0xda06('0x27')][_0xda06('0x46')](_0x83eb8c[_0xda06('0x43')])[_0xda06('0x13')](function(_0x364b5f){if(_0x364b5f){if(_0x364b5f[_0xda06('0x47')]===_0xda06('0x48')&&!_0x364b5f['secret']){var _0x25c2c4,_0x4200c2,_0x1b3ba3;if(_0x83eb8c[_0xda06('0x43')]['to']){_0x4200c2=_0x83eb8c[_0xda06('0x43')]['to']['split'](',')[0x0];}return db[_0xda06('0x49')][_0xda06('0x4a')]({'where':{'id':_0x364b5f[_0xda06('0x4b')]},'include':[{'model':db[_0xda06('0x4c')],'as':_0xda06('0x4d'),'include':[{'model':db[_0xda06('0x4e')],'as':_0xda06('0x4f'),'where':{'email':_0x4200c2},'limit':0x1,'order':[[_0xda06('0x50'),_0xda06('0x51')]]}]},{'model':db[_0xda06('0x52')],'as':_0xda06('0x53'),'raw':!![],'include':[{'model':db[_0xda06('0x54')],'as':'CloudProvider','raw':!![]}]}]})[_0xda06('0x13')](function(_0x16cc75){_0x25c2c4=_0x16cc75;if(!_0x25c2c4||!_0x25c2c4[_0xda06('0x53')])return;var _0x3f9753=_0x25c2c4[_0xda06('0x55')]();if(_0x83eb8c[_0xda06('0x43')]['attachments']&&_0x83eb8c[_0xda06('0x43')][_0xda06('0x56')][_0xda06('0x33')]){for(var _0x5a2f0c=0x0;_0x5a2f0c<_0x83eb8c[_0xda06('0x43')][_0xda06('0x56')][_0xda06('0x33')];_0x5a2f0c+=0x1){_0x83eb8c[_0xda06('0x43')][_0xda06('0x56')][_0x5a2f0c]={'filename':_0x83eb8c[_0xda06('0x43')]['attachments'][_0x5a2f0c][_0xda06('0x2d')],'path':path[_0xda06('0x57')](config[_0xda06('0x58')],_0xda06('0x59'),_0x83eb8c['body'][_0xda06('0x56')][_0x5a2f0c][_0xda06('0x5a')])};}}_0x1b3ba3={'account':_0x3f9753,'message':_0x83eb8c['body']};return;})[_0xda06('0x13')](function(){if(_0x25c2c4[_0xda06('0x4d')]){if(_0x25c2c4[_0xda06('0x4d')][_0xda06('0x4f')][_0xda06('0x33')]){return _0x25c2c4[_0xda06('0x4d')]['Contacts'][0x0];}else{return db[_0xda06('0x4e')][_0xda06('0x46')](_[_0xda06('0xb')](_0x83eb8c['body'],{'firstName':_0x83eb8c['body']['to'],'email':_0x83eb8c[_0xda06('0x43')]['to'],'phone':_0x83eb8c[_0xda06('0x43')]['to'],'ListId':_0x25c2c4['ListId']}));}}else{throw new Error(_0xda06('0x5b'));}})[_0xda06('0x13')](function(){if(_0x1b3ba3){return respondWithRpcPromise(_0xda06('0x5c'),'sendMail',_0x1b3ba3,client9003)[_0xda06('0x13')](function(_0x4b2bfa){return _0x364b5f[_0xda06('0x20')]({'read':!![],'messageId':_0x4b2bfa['messageId'],'sentAt':moment()['format'](_0xda06('0x5d'))});})[_0xda06('0x40')](function(_0x385b20){logger[_0xda06('0x18')]('%s',JSON[_0xda06('0x5e')](_0x385b20));return _0x364b5f;});}return _0x364b5f;});}return _0x364b5f;}})[_0xda06('0x13')](respondWithResult(_0xe16b2e,0xc9))['catch'](handleError(_0xe16b2e,null));};exports[_0xda06('0x5f')]=function(_0x2e8091,_0x24c344){var _0x16d82b={'agent':{},'channel':_0xda06('0x60')};if(_0x2e8091[_0xda06('0x43')]['id']){delete _0x2e8091[_0xda06('0x43')]['id'];}_0x2e8091['body']['read']=!![];_0x2e8091[_0xda06('0x43')][_0xda06('0x61')]=moment()[_0xda06('0x62')](_0xda06('0x5d'));_0x2e8091['body']['UserId']=_0x2e8091[_0xda06('0x43')][_0xda06('0x63')]||_0x2e8091[_0xda06('0x64')]['id'];_0x16d82b[_0xda06('0x65')]['id']=_0x2e8091[_0xda06('0x43')][_0xda06('0x63')];return db['MailMessage']['find']({'where':{'id':_0x2e8091[_0xda06('0x41')]['id'],'UserId':null}})[_0xda06('0x13')](handleEntityNotFound(_0x24c344,null))[_0xda06('0x13')](saveUpdates(_0x2e8091[_0xda06('0x43')],null))['then'](function(_0x56402a){if(_0x56402a){_0x16d82b['message']=_0x56402a[_0xda06('0x66')]({'plain':!![]});return db[_0xda06('0x67')][_0xda06('0x44')]({'where':{'id':_0x56402a['MailInteractionId']}});}return null;})[_0xda06('0x13')](handleEntityNotFound(_0x24c344,null))[_0xda06('0x13')](function(_0x3a991f){if(_0x3a991f){return _0x3a991f[_0xda06('0x20')]({'UserId':_0x2e8091[_0xda06('0x43')]['UserId'],'read1stAt':_[_0xda06('0x68')](_0x3a991f[_0xda06('0x69')])?moment()[_0xda06('0x62')](_0xda06('0x5d')):undefined});}return null;})[_0xda06('0x13')](function(_0xf7f9be){if(_0xf7f9be){_0x16d82b[_0xda06('0x6a')]=_0xf7f9be['get']({'plain':!![]});interaction_log[_0xda06('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e8091[_0xda06('0x64')]['id'],_0x2e8091[_0xda06('0x64')]['name'],_0x2e8091[_0xda06('0x64')][_0xda06('0x6b')],_0x16d82b[_0xda06('0x6a')]['id'],_0x2e8091[_0xda06('0x43')]?JSON[_0xda06('0x5e')](_0x2e8091[_0xda06('0x43')]):_0xda06('0x6c'));return respondWithRpcPromise(_0xda06('0x6d'),_0xda06('0x6e'),_0x16d82b);}return null;})['then'](function(_0x13746d){var _0x273ebc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13746d[_0xda06('0x19')][_0xda06('0x6f')];return db['sequelize'][_0xda06('0x2e')](_0x273ebc,{'type':db[_0xda06('0x70')]['QueryTypes'][_0xda06('0x71')],'raw':!![]})[_0xda06('0x13')](function(_0x13d483){return _0x13d483;});})[_0xda06('0x13')](function(_0x3dac7a){if(_0x3dac7a){_0x16d82b[_0xda06('0x19')][_0xda06('0x72')]=_0x3dac7a[0x0];if(!_0x2e8091[_0xda06('0x43')]['UserId'])return;return db[_0xda06('0x73')][_0xda06('0x44')]({'where':{'id':_0x2e8091[_0xda06('0x43')][_0xda06('0x63')],'role':_0xda06('0x65')},'attributes':['id',_0xda06('0x2d'),_0xda06('0x74'),_0xda06('0x75'),_0xda06('0x76')],'raw':!![]});}return null;})[_0xda06('0x13')](function(_0x2c9b6a){if(!_0x2c9b6a)return null;_0x16d82b[_0xda06('0x19')][_0xda06('0x65')]=_0x2c9b6a;return _0x16d82b;})[_0xda06('0x13')](function(_0x4695f5){if(_0x4695f5){if(_0x2e8091[_0xda06('0x43')][_0xda06('0x77')]){_0x16d82b['message']['interface']=util[_0xda06('0x62')]('SIP/%s',_0x2e8091[_0xda06('0x64')][_0xda06('0x2d')]);_0x16d82b[_0xda06('0x19')][_0xda06('0x78')]=_0x16d82b[_0xda06('0x78')];_0x16d82b['message']['motionChannel']=_0x16d82b[_0xda06('0x78')];_0x16d82b[_0xda06('0x19')][_0xda06('0x79')]=_0xda06('0x5f');_0x16d82b[_0xda06('0x19')][_0xda06('0x43')]=htmlToText[_0xda06('0x7a')](_0x16d82b['message'][_0xda06('0x43')]);return respondWithRpcPromise(_0xda06('0x7b'),_0xda06('0x7b'),{'event':'acceptmessage','message':_0x16d82b[_0xda06('0x19')]},client9002)[_0xda06('0x13')](function(){return _0x16d82b;});}return _0x16d82b;}return null;})[_0xda06('0x13')](respondWithResult(_0x24c344,null))[_0xda06('0x40')](handleError(_0x24c344,null));};exports[_0xda06('0x7c')]=function(_0xb6afe,_0x4deaf8){var _0x10357d={'agent':{},'channel':_0xda06('0x60')};if(_0xb6afe[_0xda06('0x43')]['id']){delete _0xb6afe[_0xda06('0x43')]['id'];}_0xb6afe[_0xda06('0x43')][_0xda06('0x63')]=_0xb6afe[_0xda06('0x43')]['UserId']||_0xb6afe['user']['id'];_0x10357d[_0xda06('0x65')]['id']=_0xb6afe[_0xda06('0x43')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0xb6afe['params']['id'],'UserId':null}})[_0xda06('0x13')](handleEntityNotFound(_0x4deaf8,null))['then'](function(_0x52aa71){if(_0x52aa71){_0x10357d[_0xda06('0x19')]=_0x52aa71[_0xda06('0x66')]({'plain':!![]});return db[_0xda06('0x67')][_0xda06('0x44')]({'where':{'id':_0x52aa71[_0xda06('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x4deaf8,null))[_0xda06('0x13')](function(_0x2f72c7){if(_0x2f72c7){_0x10357d[_0xda06('0x6a')]=_0x2f72c7[_0xda06('0x66')]({'plain':!![]});interaction_log[_0xda06('0x14')](_0xda06('0x7e'),_0xb6afe[_0xda06('0x64')]['id'],_0xb6afe['user'][_0xda06('0x2d')],_0xb6afe[_0xda06('0x64')][_0xda06('0x6b')],_0x10357d[_0xda06('0x6a')]['id'],_0xb6afe['body']?JSON[_0xda06('0x5e')](_0xb6afe['body']):_0xda06('0x6c'));return respondWithRpcPromise(_0xda06('0x7f'),'rejectMessage',_0x10357d);}return null;})['then'](function(_0x3f7f0c){var _0x1cb98b=_0xda06('0x80')+_0x3f7f0c[_0xda06('0x19')][_0xda06('0x6f')];return db[_0xda06('0x81')][_0xda06('0x2e')](_0x1cb98b,{'type':db[_0xda06('0x70')][_0xda06('0x82')][_0xda06('0x71')],'raw':!![]})[_0xda06('0x13')](function(_0x5c3d60){return _0x5c3d60;});})[_0xda06('0x13')](function(_0x4438c7){if(_0x4438c7){_0x10357d['message'][_0xda06('0x72')]=_0x4438c7[0x0];if(!_0xb6afe[_0xda06('0x43')][_0xda06('0x63')])return;return db['User']['find']({'where':{'id':_0xb6afe[_0xda06('0x43')][_0xda06('0x63')],'role':_0xda06('0x65')},'attributes':['id',_0xda06('0x2d'),_0xda06('0x74'),_0xda06('0x75'),_0xda06('0x76')],'raw':!![]});}return null;})['then'](function(_0xcfbcf3){if(!_0xcfbcf3)return null;_0x10357d[_0xda06('0x19')][_0xda06('0x65')]=_0xcfbcf3;return _0x10357d;})['then'](function(_0x330544){if(_0x330544){_0x330544[_0xda06('0x19')][_0xda06('0x83')]=util[_0xda06('0x62')]('SIP/%s',_0xb6afe[_0xda06('0x64')]['name']);_0x330544[_0xda06('0x19')][_0xda06('0x78')]=_0x10357d[_0xda06('0x78')];_0x330544[_0xda06('0x19')][_0xda06('0x84')]=_0x10357d[_0xda06('0x78')];_0x330544['message'][_0xda06('0x79')]=_0xda06('0x7c');_0x330544[_0xda06('0x19')][_0xda06('0x43')]=htmlToText['fromString'](_0x10357d[_0xda06('0x19')][_0xda06('0x43')]);respondWithRpcPromise(_0xda06('0x7b'),_0xda06('0x7b'),{'event':'rejectmessage','message':_0x330544[_0xda06('0x19')]},client9002);return _0x10357d;}return null;})[_0xda06('0x13')](respondWithResult(_0x4deaf8,null))['catch'](handleError(_0x4deaf8,null));};exports[_0xda06('0x85')]=function(_0x2d30b2,_0x7c9af8){var _0x547a3a=moment()[_0xda06('0x86')]()[_0xda06('0x87')]();var _0x540eb0=path[_0xda06('0x57')](config[_0xda06('0x58')],'server',_0xda06('0x88'),_0xda06('0x89'));var _0x1bd96d=path[_0xda06('0x57')](config['root'],'server',_0xda06('0x88'),'attachments');var _0x1fdb52=util[_0xda06('0x62')](_0xda06('0x8a'),_0x547a3a);return db[_0xda06('0x27')][_0xda06('0x44')]({'where':{'id':_0x2d30b2[_0xda06('0x41')]['id']},'attributes':['id',_0xda06('0x43'),_0xda06('0x8b'),'to','cc',_0xda06('0x8c'),_0xda06('0x8d'),_0xda06('0x8e')],'include':_0x2d30b2[_0xda06('0x2e')]['attachments']?[{'model':db[_0xda06('0x8f')],'as':_0xda06('0x90')}]:undefined})[_0xda06('0x13')](handleEntityNotFound(_0x7c9af8,null))[_0xda06('0x13')](function(_0x25c453){if(_0x25c453){var _0x29af54=_0x25c453;var _0x5183d9={'from':_0x29af54['from'],'to':_0x29af54['to'],'subject':_0x29af54[_0xda06('0x8d')],'html':htmlEntities[_0xda06('0x91')](_0x29af54['body']),'headers':{'Date':moment(_0x29af54[_0xda06('0x8e')])['format'](_0xda06('0x92'))},'attachments':[]};if(_0x25c453['cc']){_0x5183d9[_0xda06('0x93')]['Cc']=_0x25c453['cc'];}if(_0x25c453[_0xda06('0x8c')]){_0x5183d9['headers']['Bcc']=_0x25c453[_0xda06('0x8c')];}return new BPromise(function(_0x857778,_0x50443){if(_0x25c453[_0xda06('0x90')]){for(var _0x4050b3=0x0;_0x4050b3<_0x25c453[_0xda06('0x90')][_0xda06('0x33')];_0x4050b3++){var _0x4d06a3=_0x25c453[_0xda06('0x90')][_0x4050b3];var _0x5465e9=path['join'](_0x1bd96d,_0x4d06a3['basename']);if(fs[_0xda06('0x94')](_0x5465e9)){_0x5183d9['attachments'][_0xda06('0x95')]({'name':_0x4d06a3[_0xda06('0x2d')],'contentType':_0x4d06a3['type'],'data':fs['readFileSync'](_0x5465e9)});}}}emlformat[_0xda06('0x96')](_0x5183d9,function(_0x1ac96d,_0x5ba7f9){if(_0x1ac96d)return _0x50443(_0x1ac96d);fs['writeFileSync'](path['join'](_0x540eb0,_0x1fdb52),_0x5ba7f9);return _0x857778(_0x5ba7f9);});});}})[_0xda06('0x13')](function(_0x6938de){if(_0x6938de){return _0x7c9af8[_0xda06('0x85')](path[_0xda06('0x57')](_0x540eb0,_0x1fdb52),_0x1fdb52,function(_0x16bec5){if(!_0x16bec5)fs[_0xda06('0x97')](path['join'](_0x540eb0,_0x1fdb52));});}})['catch'](handleError(_0x7c9af8,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index c257738..176d551 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 _0x09c6=['hasOwnProperty','exports','events','../../mysqldb','MailMessage','save','update','remove','emit'];(function(_0x5b33ad,_0x2a7d55){var _0x16ec00=function(_0x1caf48){while(--_0x1caf48){_0x5b33ad['push'](_0x5b33ad['shift']());}};_0x16ec00(++_0x2a7d55);}(_0x09c6,0xb6));var _0x609c=function(_0x4af0e3,_0x4d66f1){_0x4af0e3=_0x4af0e3-0x0;var _0xd38efb=_0x09c6[_0x4af0e3];return _0xd38efb;};'use strict';var EventEmitter=require(_0x609c('0x0'));var MailMessage=require(_0x609c('0x1'))['db'][_0x609c('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x609c('0x3'),'afterUpdate':_0x609c('0x4'),'afterDestroy':_0x609c('0x5')};function emitEvent(_0x378275){return function(_0x5f5663,_0x14bdad,_0x54ab72){MailMessageEvents[_0x609c('0x6')](_0x378275+':'+_0x5f5663['id'],_0x5f5663);MailMessageEvents[_0x609c('0x6')](_0x378275,_0x5f5663);_0x54ab72(null);};}for(var e in events){if(events[_0x609c('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x609c('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x4d38=['emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x348750,_0x34af3d){var _0x1a4563=function(_0x129a62){while(--_0x129a62){_0x348750['push'](_0x348750['shift']());}};_0x1a4563(++_0x34af3d);}(_0x4d38,0x13b));var _0x84d3=function(_0x4fab79,_0x4f76dc){_0x4fab79=_0x4fab79-0x0;var _0x31ec8e=_0x4d38[_0x4fab79];return _0x31ec8e;};'use strict';var EventEmitter=require(_0x84d3('0x0'));var MailMessage=require(_0x84d3('0x1'))['db'][_0x84d3('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x84d3('0x3')](0x0);var events={'afterCreate':_0x84d3('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x54036a){return function(_0x1f01cb,_0xc03d0e,_0x34678b){MailMessageEvents[_0x84d3('0x5')](_0x54036a+':'+_0x1f01cb['id'],_0x1f01cb);MailMessageEvents['emit'](_0x54036a,_0x1f01cb);_0x34678b(null);};}for(var e in events){if(events[_0x84d3('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x84d3('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 15ad452..46ee00b 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 _0x0f78=['models','get','direction','toLowerCase','UserId','MailInteraction','MailInteractionId','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString'];(function(_0xb27296,_0x1d2823){var _0x496766=function(_0x41bba2){while(--_0x41bba2){_0xb27296['push'](_0xb27296['shift']());}};_0x496766(++_0x1d2823);}(_0x0f78,0x68));var _0x80f7=function(_0x5d0c47,_0x417bcb){_0x5d0c47=_0x5d0c47-0x0;var _0x199bf8=_0x0f78[_0x5d0c47];return _0x199bf8;};'use strict';var _=require(_0x80f7('0x0'));var util=require(_0x80f7('0x1'));var logger=require(_0x80f7('0x2'))(_0x80f7('0x3'));var moment=require(_0x80f7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x80f7('0x5'));var fs=require('fs');var path=require(_0x80f7('0x6'));var rimraf=require(_0x80f7('0x7'));var config=require(_0x80f7('0x8'));var attributes=require(_0x80f7('0x9'));module['exports']=function(_0x5f4a46,_0x45eee3){return _0x5f4a46[_0x80f7('0xa')](_0x80f7('0xb'),attributes,{'tableName':_0x80f7('0xc'),'paranoid':![],'indexes':[{'name':_0x80f7('0xd'),'fields':[_0x80f7('0xd')]},{'name':_0x80f7('0xe'),'fields':[_0x80f7('0xf'),_0x80f7('0x10')],'type':_0x80f7('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ddc72,_0x4f39cb,_0x395220){if(_0x5ddc72[_0x80f7('0x12')]){_0x5ddc72[_0x80f7('0xf')]=htmlToText[_0x80f7('0x13')](_0x5ddc72[_0x80f7('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x395220(null,_0x4f39cb);},'afterCreate':function(_0x369ea9,_0x578384,_0x291fc3){var _0x348bcf=_0x5f4a46[_0x80f7('0x14')];var _0x350906=_0x369ea9[_0x80f7('0x15')]({'plain':!![]});if(_0x350906[_0x80f7('0x16')][_0x80f7('0x17')]()==='in'||_0x350906[_0x80f7('0x16')][_0x80f7('0x17')]()==='out'&&!_0x350906['secret']&&!_['isNil'](_0x350906[_0x80f7('0x18')])){_0x348bcf[_0x80f7('0x19')]['findOne']({'where':{'id':_0x350906[_0x80f7('0x1a')]}})['then'](function(_0x2cb6ba){if(_0x2cb6ba){_0x2cb6ba[_0x80f7('0x1b')]({'lastMsgAt':_0x350906[_0x80f7('0x1c')],'lastMsgDirection':_0x350906[_0x80f7('0x16')]['toLowerCase']()});}})['catch'](function(_0x4916bd){console[_0x80f7('0x1d')](_0x4916bd);});}_0x291fc3();}},'charset':_0x80f7('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8049=['error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT','fromString','body','models','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch'];(function(_0x3c9e07,_0x4566a0){var _0x551585=function(_0x494ba5){while(--_0x494ba5){_0x3c9e07['push'](_0x3c9e07['shift']());}};_0x551585(++_0x4566a0);}(_0x8049,0x16e));var _0x9804=function(_0x6f13d7,_0x290fd1){_0x6f13d7=_0x6f13d7-0x0;var _0x35e3e4=_0x8049[_0x6f13d7];return _0x35e3e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9804('0x0'))('api');var moment=require(_0x9804('0x1'));var BPromise=require(_0x9804('0x2'));var rp=require(_0x9804('0x3'));var htmlToText=require(_0x9804('0x4'));var fs=require('fs');var path=require(_0x9804('0x5'));var rimraf=require(_0x9804('0x6'));var config=require(_0x9804('0x7'));var attributes=require(_0x9804('0x8'));module[_0x9804('0x9')]=function(_0x42c9af,_0x5d6cd1){return _0x42c9af[_0x9804('0xa')](_0x9804('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9804('0xc')]},{'name':'fti_mail_messages','fields':[_0x9804('0xd'),_0x9804('0xe')],'type':_0x9804('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x56fbf8,_0x92e9d8,_0x2d5e88){if(_0x56fbf8['body']){_0x56fbf8[_0x9804('0xd')]=htmlToText[_0x9804('0x10')](_0x56fbf8[_0x9804('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2d5e88(null,_0x92e9d8);},'afterCreate':function(_0x247694,_0x7923d7,_0x5e3c89){var _0x10f8b0=_0x42c9af[_0x9804('0x12')];var _0x2e8266=_0x247694['get']({'plain':!![]});if(_0x2e8266[_0x9804('0x13')]['toLowerCase']()==='in'||_0x2e8266['direction'][_0x9804('0x14')]()===_0x9804('0x15')&&!_0x2e8266['secret']&&!_[_0x9804('0x16')](_0x2e8266[_0x9804('0x17')])){_0x10f8b0[_0x9804('0x18')][_0x9804('0x19')]({'where':{'id':_0x2e8266[_0x9804('0x1a')]}})[_0x9804('0x1b')](function(_0x4becfe){if(_0x4becfe){_0x4becfe[_0x9804('0x1c')]({'lastMsgAt':_0x2e8266['createdAt'],'lastMsgDirection':_0x2e8266[_0x9804('0x13')][_0x9804('0x14')]()});}})[_0x9804('0x1d')](function(_0x3c3c12){console[_0x9804('0x1e')](_0x3c3c12);});}_0x5e3c89();}},'charset':_0x9804('0x1f'),'collate':_0x9804('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 82229b6..264f230 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 _0x58a4=['create','body','options','raw','CreateMailMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58a4,0xbf));var _0x458a=function(_0x331639,_0x3ceeaa){_0x331639=_0x331639-0x0;var _0x5420ea=_0x58a4[_0x331639];return _0x5420ea;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var moment=require(_0x458a('0x2'));var BPromise=require(_0x458a('0x3'));var rs=require(_0x458a('0x4'));var fs=require('fs');var Redis=require(_0x458a('0x5'));var db=require(_0x458a('0x6'))['db'];var utils=require(_0x458a('0x7'));var logger=require(_0x458a('0x8'))(_0x458a('0x9'));var config=require(_0x458a('0xa'));var jayson=require(_0x458a('0xb'));var client=jayson[_0x458a('0xc')]['http']({'port':0x232a});config['redis']=_[_0x458a('0xd')](config[_0x458a('0xe')],{'host':_0x458a('0xf'),'port':0x18eb});var socket=require(_0x458a('0x10'))(new Redis(config[_0x458a('0xe')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x185c5f,_0x45b79b,_0xaad5bf){return new BPromise(function(_0x2e1d67,_0x1ff87d){return client['request'](_0x185c5f,_0xaad5bf)[_0x458a('0x11')](function(_0x804e01){logger['info'](_0x458a('0x12'),_0x45b79b,_0x458a('0x13'));logger[_0x458a('0x14')](_0x458a('0x15'),_0x45b79b,_0x458a('0x13'),JSON['stringify'](_0x804e01));if(_0x804e01['error']){if(_0x804e01[_0x458a('0x16')]['code']===0x1f4){logger[_0x458a('0x16')](_0x458a('0x12'),_0x45b79b,_0x804e01[_0x458a('0x16')][_0x458a('0x17')]);return _0x1ff87d(_0x804e01[_0x458a('0x16')][_0x458a('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x45b79b,_0x804e01['error'][_0x458a('0x17')]);return _0x2e1d67(_0x804e01[_0x458a('0x16')][_0x458a('0x17')]);}else{logger['info'](_0x458a('0x12'),_0x45b79b,_0x458a('0x13'));_0x2e1d67(_0x804e01[_0x458a('0x18')][_0x458a('0x17')]);}})[_0x458a('0x19')](function(_0x4df9ef){logger['error'](_0x458a('0x12'),_0x45b79b,_0x4df9ef);_0x1ff87d(_0x4df9ef);});});}exports['CreateMailMessage']=function(_0x3302b7){var _0x398ff2=this;return new Promise(function(_0x47a202,_0x468416){return db['MailMessage'][_0x458a('0x1a')](_0x3302b7[_0x458a('0x1b')],{'raw':_0x3302b7['options']?_0x3302b7[_0x458a('0x1c')][_0x458a('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xa6b8ff){logger['info'](_0x458a('0x1e'),_0x3302b7);logger['debug'](_0x458a('0x1e'),_0x3302b7,JSON['stringify'](_0xa6b8ff));_0x47a202(_0xa6b8ff);})[_0x458a('0x19')](function(_0x911eaf){logger[_0x458a('0x16')](_0x458a('0x1e'),_0x911eaf[_0x458a('0x17')],_0x3302b7);_0x468416(_0x398ff2[_0x458a('0x16')](0x1f4,_0x911eaf[_0x458a('0x17')]));});});}; \ No newline at end of file +var _0x9f0e=['MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14d20c,_0x410053){var _0x9f4d94=function(_0x25581a){while(--_0x25581a){_0x14d20c['push'](_0x14d20c['shift']());}};_0x9f4d94(++_0x410053);}(_0x9f0e,0x116));var _0xe9f0=function(_0x51a18d,_0x2e5adf){_0x51a18d=_0x51a18d-0x0;var _0x5e2c28=_0x9f0e[_0x51a18d];return _0x5e2c28;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9f0('0xa')]=_[_0xe9f0('0xb')](config[_0xe9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config[_0xe9f0('0xa')]));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0xa523c0,_0x240932,_0x807322){return new BPromise(function(_0x3724f4,_0x6acfb){return client['request'](_0xa523c0,_0x807322)[_0xe9f0('0xf')](function(_0x329ecd){logger[_0xe9f0('0x10')]('MailMessage,\x20%s,\x20%s',_0x240932,_0xe9f0('0x11'));logger['debug'](_0xe9f0('0x12'),_0x240932,_0xe9f0('0x11'),JSON[_0xe9f0('0x13')](_0x329ecd));if(_0x329ecd[_0xe9f0('0x14')]){if(_0x329ecd['error'][_0xe9f0('0x15')]===0x1f4){logger['error'](_0xe9f0('0x16'),_0x240932,_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);return _0x6acfb(_0x329ecd['error'][_0xe9f0('0x17')]);}logger[_0xe9f0('0x14')](_0xe9f0('0x16'),_0x240932,_0x329ecd['error'][_0xe9f0('0x17')]);return _0x3724f4(_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);}else{logger[_0xe9f0('0x10')](_0xe9f0('0x16'),_0x240932,_0xe9f0('0x11'));_0x3724f4(_0x329ecd[_0xe9f0('0x18')]['message']);}})[_0xe9f0('0x19')](function(_0x19e090){logger[_0xe9f0('0x14')]('MailMessage,\x20%s,\x20%s',_0x240932,_0x19e090);_0x6acfb(_0x19e090);});});}exports[_0xe9f0('0x1a')]=function(_0x30b8c7){var _0x1698cf=this;return new Promise(function(_0x43f399,_0x5ba788){return db[_0xe9f0('0x1b')][_0xe9f0('0x1c')](_0x30b8c7['body'],{'raw':_0x30b8c7['options']?_0x30b8c7['options'][_0xe9f0('0x1d')]===undefined?!![]:![]:!![]})[_0xe9f0('0xf')](function(_0x1211ae){logger[_0xe9f0('0x10')](_0xe9f0('0x1a'),_0x30b8c7);logger['debug'](_0xe9f0('0x1a'),_0x30b8c7,JSON[_0xe9f0('0x13')](_0x1211ae));_0x43f399(_0x1211ae);})[_0xe9f0('0x19')](function(_0x10801b){logger[_0xe9f0('0x14')](_0xe9f0('0x1a'),_0x10801b[_0xe9f0('0x17')],_0x30b8c7);_0x5ba788(_0x1698cf[_0xe9f0('0x14')](0x1f4,_0x10801b[_0xe9f0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index da2daf1..809b539 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 _0x64f6=['save','remove','update','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x27f54c,_0x218280){var _0x4f2aee=function(_0x3c3260){while(--_0x3c3260){_0x27f54c['push'](_0x27f54c['shift']());}};_0x4f2aee(++_0x218280);}(_0x64f6,0xb3));var _0x664f=function(_0x204e8f,_0x551d92){_0x204e8f=_0x204e8f-0x0;var _0x75770=_0x64f6[_0x204e8f];return _0x75770;};'use strict';var MailMessageEvents=require(_0x664f('0x0'));var events=[_0x664f('0x1'),_0x664f('0x2'),_0x664f('0x3')];function createListener(_0x5afe2b,_0x488b8c){return function(_0x353573){_0x488b8c[_0x664f('0x4')](_0x5afe2b,_0x353573);};}function removeListener(_0x28d93b,_0x444e4f){return function(){MailMessageEvents[_0x664f('0x5')](_0x28d93b,_0x444e4f);};}exports[_0x664f('0x6')]=function(_0x36f127){for(var _0x269125=0x0,_0x511a77=events[_0x664f('0x7')];_0x269125<_0x511a77;_0x269125++){var _0x3085db=events[_0x269125];var _0x59b6c0=createListener(_0x664f('0x8')+_0x3085db,_0x36f127);MailMessageEvents['on'](_0x3085db,_0x59b6c0);}}; \ No newline at end of file +var _0x2baf=['./mailMessage.events','save','remove','update','emit','register','length'];(function(_0x337e9c,_0x9e75f4){var _0x2a924a=function(_0x4b8292){while(--_0x4b8292){_0x337e9c['push'](_0x337e9c['shift']());}};_0x2a924a(++_0x9e75f4);}(_0x2baf,0xe7));var _0xf2ba=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0x2baf[_0x7538c5];return _0x8b56be;};'use strict';var MailMessageEvents=require(_0xf2ba('0x0'));var events=[_0xf2ba('0x1'),_0xf2ba('0x2'),_0xf2ba('0x3')];function createListener(_0x5ef28a,_0x3c1a93){return function(_0x50fb90){_0x3c1a93[_0xf2ba('0x4')](_0x5ef28a,_0x50fb90);};}function removeListener(_0x50c172,_0x3f335c){return function(){MailMessageEvents['removeListener'](_0x50c172,_0x3f335c);};}exports[_0xf2ba('0x5')]=function(_0x5cc617){for(var _0x218117=0x0,_0x4dc01f=events[_0xf2ba('0x6')];_0x218117<_0x4dc01f;_0x218117++){var _0x47bbe7=events[_0x218117];var _0x22b39f=createListener('mailMessage:'+_0x47bbe7,_0x5cc617);MailMessageEvents['on'](_0x47bbe7,_0x22b39f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index ed5437d..ad24ce2 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 _0x354c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','util','express'];(function(_0x3cc5f8,_0x44f0f6){var _0x557801=function(_0x35470b){while(--_0x35470b){_0x3cc5f8['push'](_0x3cc5f8['shift']());}};_0x557801(++_0x44f0f6);}(_0x354c,0xb1));var _0xc354=function(_0x586c98,_0x4ef03f){_0x586c98=_0x586c98-0x0;var _0x3ea9f5=_0x354c[_0x586c98];return _0x3ea9f5;};'use strict';var multer=require(_0xc354('0x0'));var util=require(_0xc354('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc354('0x2'));var router=express[_0xc354('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc354('0x4'));var interaction=require(_0xc354('0x5'));var config=require(_0xc354('0x6'));var controller=require(_0xc354('0x7'));router[_0xc354('0x8')]('/',auth[_0xc354('0x9')](),controller[_0xc354('0xa')]);router['get'](_0xc354('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xc354('0x8')](_0xc354('0xc'),auth[_0xc354('0x9')](),controller[_0xc354('0xd')]);router[_0xc354('0x8')](_0xc354('0xe'),auth['isAuthenticated'](),controller[_0xc354('0xf')]);router[_0xc354('0x8')]('/:id/teams',auth[_0xc354('0x9')](),controller[_0xc354('0x10')]);router[_0xc354('0x8')](_0xc354('0x11'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xc354('0x9')](),controller[_0xc354('0x12')]);router[_0xc354('0x13')]('/:id/teams',auth[_0xc354('0x9')](),controller[_0xc354('0x14')]);router[_0xc354('0x13')](_0xc354('0x11'),auth['isAuthenticated'](),controller[_0xc354('0x15')]);router[_0xc354('0x16')](_0xc354('0xc'),auth['isAuthenticated'](),controller[_0xc354('0x17')]);router[_0xc354('0x18')](_0xc354('0xc'),auth[_0xc354('0x9')](),controller[_0xc354('0x19')]);router[_0xc354('0x18')](_0xc354('0x1a'),auth[_0xc354('0x9')](),controller[_0xc354('0x1b')]);router[_0xc354('0x18')](_0xc354('0x11'),auth[_0xc354('0x9')](),controller[_0xc354('0x1c')]);module[_0xc354('0x1d')]=router; \ No newline at end of file +var _0xf749=['describe','/:id','show','/:id/users','post','create','addAgents','put','update','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','./mailQueue.controller','get','isAuthenticated'];(function(_0x576bdb,_0x1683f7){var _0x52209a=function(_0x337f1b){while(--_0x337f1b){_0x576bdb['push'](_0x576bdb['shift']());}};_0x52209a(++_0x1683f7);}(_0xf749,0x98));var _0x9f74=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf749[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x9f74('0x0'));var util=require(_0x9f74('0x1'));var path=require(_0x9f74('0x2'));var timeout=require(_0x9f74('0x3'));var express=require(_0x9f74('0x4'));var router=express[_0x9f74('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f74('0x6'));router[_0x9f74('0x7')]('/',auth[_0x9f74('0x8')](),controller['index']);router[_0x9f74('0x7')]('/describe',auth[_0x9f74('0x8')](),controller[_0x9f74('0x9')]);router[_0x9f74('0x7')](_0x9f74('0xa'),auth[_0x9f74('0x8')](),controller[_0x9f74('0xb')]);router[_0x9f74('0x7')]('/:id/members',auth[_0x9f74('0x8')](),controller['getMembers']);router[_0x9f74('0x7')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x9f74('0x7')](_0x9f74('0xc'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9f74('0xd')]('/',auth[_0x9f74('0x8')](),controller[_0x9f74('0xe')]);router[_0x9f74('0xd')]('/:id/teams',auth[_0x9f74('0x8')](),controller['addTeams']);router[_0x9f74('0xd')]('/:id/users',auth[_0x9f74('0x8')](),controller[_0x9f74('0xf')]);router[_0x9f74('0x10')]('/:id',auth[_0x9f74('0x8')](),controller[_0x9f74('0x11')]);router[_0x9f74('0x12')]('/:id',auth[_0x9f74('0x8')](),controller['destroy']);router['delete'](_0x9f74('0x13'),auth[_0x9f74('0x8')](),controller[_0x9f74('0x14')]);router[_0x9f74('0x12')](_0x9f74('0xc'),auth['isAuthenticated'](),controller[_0x9f74('0x15')]);module[_0x9f74('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 0bc6ba6..8461277 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 _0xe41b=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x5df127,_0x2b8380){var _0x59e152=function(_0x318659){while(--_0x318659){_0x5df127['push'](_0x5df127['shift']());}};_0x59e152(++_0x2b8380);}(_0xe41b,0x15a));var _0xbe41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe41b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbe41('0x0'));module[_0xbe41('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbe41('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbe41('0x3')]},'timeout':{'type':Sequelize[_0xbe41('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbe41('0x5')](_0xbe41('0x6'),_0xbe41('0x7'),_0xbe41('0x8'))}}; \ No newline at end of file +var _0xa6b2=['roundrobin','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x4481c4,_0x4495d6){var _0x533bd1=function(_0x1fd3fe){while(--_0x1fd3fe){_0x4481c4['push'](_0x4481c4['shift']());}};_0x533bd1(++_0x4495d6);}(_0xa6b2,0x1a5));var _0x2a6b=function(_0x3114ab,_0x53b5ad){_0x3114ab=_0x3114ab-0x0;var _0x914def=_0xa6b2[_0x3114ab];return _0x914def;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2a6b('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2a6b('0x1')]},'timeout':{'type':Sequelize[_0x2a6b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2a6b('0x3')](_0x2a6b('0x4'),_0x2a6b('0x5'),_0x2a6b('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index e34afe2..a5184e0 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 _0x41cf=['type','key','getOptions','include','findAll','rows','catch','show','params','query','keys','filters','model','intersection','fields','attributes','length','includeAll','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','order','sort','pick','MailQueueId','filter','where','map','User','findAndCountAll','UserId','mailPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','rawAttributes','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','removeAgents','userMailQueue:remove','addAgents','omit','userMailQueue:save','isArray','getAgents','nolimit','bluebird','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','MailQueues','UserProfileResource','sendStatus','stack','name','send','MailQueue'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x41cf,0xd3));var _0xf41c=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x41cf[_0x2fd69d];return _0x5d5ef3;};'use strict';var BPromise=require(_0xf41c('0x0'));var util=require('util');var _=require(_0xf41c('0x1'));var squel=require(_0xf41c('0x2'));var Redis=require(_0xf41c('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xf41c('0x4'))(_0xf41c('0x5'));var config=require('../../config/environment');var db=require(_0xf41c('0x6'))['db'];config[_0xf41c('0x7')]=_['defaults'](config['redis'],{'host':_0xf41c('0x8'),'port':0x18eb});var socket=require(_0xf41c('0x9'))(new Redis(config['redis']));require(_0xf41c('0xa'))[_0xf41c('0xb')](socket);function respondWithStatusCode(_0x555ed4,_0x1a9a70){_0x1a9a70=_0x1a9a70||0xcc;return function(_0x54b22a){if(_0x54b22a){return _0x555ed4['sendStatus'](_0x1a9a70);}return _0x555ed4[_0xf41c('0xc')](_0x1a9a70)[_0xf41c('0xd')]();};}function respondWithResult(_0x3caade,_0x54df08){_0x54df08=_0x54df08||0xc8;return function(_0x5c07f7){if(_0x5c07f7){return _0x3caade['status'](_0x54df08)[_0xf41c('0xe')](_0x5c07f7);}};}function respondWithFilteredResult(_0x4ebe5f,_0x4df882){return function(_0x30cbcd){if(_0x30cbcd){var _0x25eaa2=typeof _0x4df882['offset']===_0xf41c('0xf')&&typeof _0x4df882[_0xf41c('0x10')]===_0xf41c('0xf');var _0x5d2343=_0x30cbcd[_0xf41c('0x11')];var _0x558f58=_0x25eaa2?0x0:_0x4df882[_0xf41c('0x12')];var _0x10229f=_0x25eaa2?_0x30cbcd[_0xf41c('0x11')]:_0x4df882[_0xf41c('0x12')]+_0x4df882['limit'];var _0xf9ca23;if(_0x10229f>=_0x5d2343){_0x10229f=_0x5d2343;_0xf9ca23=0xc8;}else{_0xf9ca23=0xce;}_0x4ebe5f[_0xf41c('0xc')](_0xf9ca23);return _0x4ebe5f[_0xf41c('0x13')](_0xf41c('0x14'),_0x558f58+'-'+_0x10229f+'/'+_0x5d2343)[_0xf41c('0xe')](_0x30cbcd);}return null;};}function saveUpdates(_0x119e61){return function(_0x44260f){if(_0x44260f){return _0x44260f[_0xf41c('0x15')](_0x119e61)[_0xf41c('0x16')](function(_0x465af5){return _0x465af5;});}return null;};}function removeEntity(_0x2610c3){return function(_0x38c43b){if(_0x38c43b){return _0x38c43b[_0xf41c('0x17')]()[_0xf41c('0x16')](function(){var _0x3e3d27=_0x38c43b['get']({'plain':!![]});var _0x46684c=_0xf41c('0x18');return db[_0xf41c('0x19')][_0xf41c('0x17')]({'where':{'type':_0x46684c,'resourceId':_0x3e3d27['id']}})[_0xf41c('0x16')](function(){return _0x38c43b;});})['then'](function(){_0x2610c3[_0xf41c('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea9d1){return function(_0x582b28){if(!_0x582b28){_0x1ea9d1[_0xf41c('0x1a')](0x194);}return _0x582b28;};}function handleError(_0x36a35a,_0x170118){_0x170118=_0x170118||0x1f4;return function(_0x243fd5){logger['error'](_0x243fd5[_0xf41c('0x1b')]);if(_0x243fd5[_0xf41c('0x1c')]){delete _0x243fd5[_0xf41c('0x1c')];}_0x36a35a[_0xf41c('0xc')](_0x170118)[_0xf41c('0x1d')](_0x243fd5);};}exports['index']=function(_0x4471d7,_0x19c06a){var _0x3178a6={};var _0x2885fe={'count':0x0,'rows':[]};var _0x2d6d09=_['map'](db[_0xf41c('0x1e')]['rawAttributes'],function(_0x29e76d){return{'name':_0x29e76d['fieldName'],'type':_0x29e76d[_0xf41c('0x1f')][_0xf41c('0x20')]};});_0x3178a6=qs[_0xf41c('0x21')](_0x2d6d09,_0x4471d7);var _0x3861f5={'where':_0x3178a6['where']};return db[_0xf41c('0x1e')][_0xf41c('0x11')](_0x3861f5)[_0xf41c('0x16')](function(_0x59a4fc){_0x2885fe[_0xf41c('0x11')]=_0x59a4fc;_0x3178a6[_0xf41c('0x22')]=qs[_0xf41c('0x22')](_0x4471d7['query']);return db[_0xf41c('0x1e')][_0xf41c('0x23')](_0x3178a6);})[_0xf41c('0x16')](function(_0x13b122){_0x2885fe[_0xf41c('0x24')]=_0x13b122;return _0x2885fe;})['then'](respondWithFilteredResult(_0x19c06a,_0x3178a6))[_0xf41c('0x25')](handleError(_0x19c06a,null));};exports[_0xf41c('0x26')]=function(_0x214097,_0x38dc07){var _0x5363c8={'raw':!![],'where':{'id':_0x214097[_0xf41c('0x27')]['id']}},_0x166ddc={};_0x166ddc['model']=_['keys'](db[_0xf41c('0x1e')]['rawAttributes']);_0x166ddc[_0xf41c('0x28')]=_[_0xf41c('0x29')](_0x214097[_0xf41c('0x28')]);_0x166ddc[_0xf41c('0x2a')]=_['intersection'](_0x166ddc[_0xf41c('0x2b')],_0x166ddc[_0xf41c('0x28')]);_0x5363c8['attributes']=_[_0xf41c('0x2c')](_0x166ddc['model'],qs[_0xf41c('0x2d')](_0x214097['query'][_0xf41c('0x2d')]));_0x5363c8[_0xf41c('0x2e')]=_0x5363c8[_0xf41c('0x2e')][_0xf41c('0x2f')]?_0x5363c8['attributes']:_0x166ddc['model'];if(_0x214097[_0xf41c('0x28')][_0xf41c('0x30')]){_0x5363c8[_0xf41c('0x22')]=[{'all':!![]}];}_0x5363c8=_[_0xf41c('0x31')]({},_0x5363c8,_0x214097[_0xf41c('0x32')]);return db[_0xf41c('0x1e')]['find'](_0x5363c8)['then'](handleEntityNotFound(_0x38dc07,null))['then'](respondWithResult(_0x38dc07,null))[_0xf41c('0x25')](handleError(_0x38dc07,null));};exports[_0xf41c('0x33')]=function(_0x4d9781,_0x4caf74){return db['MailQueue'][_0xf41c('0x33')](_0x4d9781[_0xf41c('0x34')],{})[_0xf41c('0x16')](function(_0x2614f9){var _0x5f4acc=_0x4d9781[_0xf41c('0x35')][_0xf41c('0x36')]({'plain':!![]});if(!_0x5f4acc)throw new Error(_0xf41c('0x37'));if(_0x5f4acc['role']===_0xf41c('0x35')){var _0x5b65ef=_0x2614f9[_0xf41c('0x36')]({'plain':!![]});var _0x1ab270='MailQueues';return db[_0xf41c('0x38')][_0xf41c('0x39')]({'where':{'name':_0x1ab270,'userProfileId':_0x5f4acc[_0xf41c('0x3a')]},'raw':!![]})[_0xf41c('0x16')](function(_0x5a24ef){if(_0x5a24ef&&_0x5a24ef[_0xf41c('0x3b')]===0x0){return db[_0xf41c('0x19')]['create']({'name':_0x5b65ef['name'],'resourceId':_0x5b65ef['id'],'type':_0x5a24ef[_0xf41c('0x1c')],'sectionId':_0x5a24ef['id']},{})[_0xf41c('0x16')](function(){return _0x2614f9;});}else{return _0x2614f9;}})['catch'](function(_0x107b5f){logger[_0xf41c('0x3c')](_0xf41c('0x3d'),_0x107b5f);throw _0x107b5f;});}return _0x2614f9;})[_0xf41c('0x16')](respondWithResult(_0x4caf74,0xc9))[_0xf41c('0x25')](handleError(_0x4caf74,null));};exports['update']=function(_0x103d6f,_0x33505b){if(_0x103d6f['body']['id']){delete _0x103d6f[_0xf41c('0x34')]['id'];}return db[_0xf41c('0x1e')][_0xf41c('0x39')]({'where':{'id':_0x103d6f[_0xf41c('0x27')]['id']}})[_0xf41c('0x16')](handleEntityNotFound(_0x33505b,null))['then'](saveUpdates(_0x103d6f[_0xf41c('0x34')],null))[_0xf41c('0x16')](respondWithResult(_0x33505b,null))[_0xf41c('0x25')](handleError(_0x33505b,null));};exports[_0xf41c('0x17')]=function(_0x40cf44,_0x11a275){return db[_0xf41c('0x1e')]['find']({'where':{'id':_0x40cf44[_0xf41c('0x27')]['id']}})[_0xf41c('0x16')](handleEntityNotFound(_0x11a275,null))[_0xf41c('0x16')](removeEntity(_0x11a275,null))[_0xf41c('0x25')](handleError(_0x11a275,null));};exports[_0xf41c('0x3e')]=function(_0x2eefff,_0x5e7ba6){return db[_0xf41c('0x1e')]['describe']()[_0xf41c('0x16')](respondWithResult(_0x5e7ba6,null))['catch'](handleError(_0x5e7ba6,null));};exports[_0xf41c('0x3f')]=function(_0x436c46,_0x5c9129){var _0x23e0ea={'raw':!![],'where':{}},_0x44ce13={},_0x7a566f;return db[_0xf41c('0x1e')][_0xf41c('0x40')]({'where':{'id':_0x436c46[_0xf41c('0x27')]['id']}})['then'](handleEntityNotFound(_0x5c9129,null))[_0xf41c('0x16')](function(_0x4ff414){if(_0x4ff414){_0x7a566f=_0x4ff414[_0xf41c('0x36')]({'plain':!![]});_0x44ce13['model']=_[_0xf41c('0x29')](db[_0xf41c('0x41')]['rawAttributes']);_0x44ce13['query']=_[_0xf41c('0x29')](_0x436c46[_0xf41c('0x28')]);_0x44ce13[_0xf41c('0x2a')]=_[_0xf41c('0x2c')](_0x44ce13[_0xf41c('0x2b')],_0x44ce13[_0xf41c('0x28')]);_0x23e0ea[_0xf41c('0x2e')]=_[_0xf41c('0x2c')](_0x44ce13['model'],qs['fields'](_0x436c46['query']['fields']));_0x23e0ea[_0xf41c('0x2e')]=_0x23e0ea[_0xf41c('0x2e')][_0xf41c('0x2f')]?_0x23e0ea['attributes']:_0x44ce13[_0xf41c('0x2b')];if(!_0x436c46['query'][_0xf41c('0x42')]('nolimit')){_0x23e0ea[_0xf41c('0x10')]=qs[_0xf41c('0x10')](_0x436c46[_0xf41c('0x28')][_0xf41c('0x10')]);_0x23e0ea[_0xf41c('0x12')]=qs['offset'](_0x436c46[_0xf41c('0x28')]['offset']);}_0x23e0ea[_0xf41c('0x43')]=qs[_0xf41c('0x44')](_0x436c46[_0xf41c('0x28')][_0xf41c('0x44')]);_0x23e0ea['where']=qs[_0xf41c('0x2a')](_[_0xf41c('0x45')](_0x436c46[_0xf41c('0x28')],_0x44ce13[_0xf41c('0x2a')]));_0x23e0ea['where'][_0xf41c('0x46')]=_0x4ff414['id'];if(_0x436c46[_0xf41c('0x28')][_0xf41c('0x47')]){_0x23e0ea[_0xf41c('0x48')]=_[_0xf41c('0x31')](_0x23e0ea[_0xf41c('0x48')],{'$or':_[_0xf41c('0x49')](_0x23e0ea[_0xf41c('0x2e')],function(_0x5be767){var _0x49542d={};_0x49542d[_0x5be767]={'$like':'%'+_0x436c46[_0xf41c('0x28')][_0xf41c('0x47')]+'%'};return _0x49542d;})});}_0x23e0ea=_['merge']({},_0x23e0ea,_0x436c46[_0xf41c('0x32')]);return db[_0xf41c('0x41')][_0xf41c('0x23')](_0x23e0ea);}})[_0xf41c('0x16')](function(_0x3e5a3e){if(_0x3e5a3e){return db[_0xf41c('0x4a')][_0xf41c('0x4b')]({'where':{'id':_[_0xf41c('0x49')](_0x3e5a3e,_0xf41c('0x4c')),'role':'agent'},'attributes':['id',_0xf41c('0x1c'),_0xf41c('0x4d'),'updatedAt','createdAt']});}})[_0xf41c('0x16')](function(_0x5de043){if(_0x5de043){return{'count':_0x5de043[_0xf41c('0x11')],'rows':_['map'](_0x5de043[_0xf41c('0x24')],function(_0x22db38){return{'membername':_0x22db38[_0xf41c('0x1c')],'UserId':_0x22db38['id'],'queue_name':_0x7a566f[_0xf41c('0x1c')],'MailQueueId':_0x7a566f['id'],'interface':util[_0xf41c('0x4e')](_0xf41c('0x4f'),_0xf41c('0x50'),_0x22db38[_0xf41c('0x1c')]),'penalty':0x0,'paused':_0x22db38[_0xf41c('0x4d')],'createdAt':_0x22db38[_0xf41c('0x51')],'updatedAt':_0x22db38[_0xf41c('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf41c('0x16')](respondWithFilteredResult(_0x5c9129,_0x23e0ea))[_0xf41c('0x25')](handleError(_0x5c9129,null));};exports[_0xf41c('0x53')]=function(_0x11d40f,_0x2b5db1){var _0x76e92f={};var _0x24ca33={};var _0x4ccc29;var _0x2b19c9;return db[_0xf41c('0x1e')][_0xf41c('0x40')]({'where':{'id':_0x11d40f[_0xf41c('0x27')]['id']}})[_0xf41c('0x16')](handleEntityNotFound(_0x2b5db1,null))[_0xf41c('0x16')](function(_0x39c7f0){if(_0x39c7f0){_0x4ccc29=_0x39c7f0;_0x24ca33[_0xf41c('0x2b')]=_['keys'](db[_0xf41c('0x54')][_0xf41c('0x55')]);_0x24ca33['query']=_[_0xf41c('0x29')](_0x11d40f['query']);_0x24ca33[_0xf41c('0x2a')]=_[_0xf41c('0x2c')](_0x24ca33[_0xf41c('0x2b')],_0x24ca33['query']);_0x76e92f[_0xf41c('0x2e')]=_[_0xf41c('0x2c')](_0x24ca33[_0xf41c('0x2b')],qs['fields'](_0x11d40f[_0xf41c('0x28')][_0xf41c('0x2d')]));_0x76e92f[_0xf41c('0x2e')]=_0x76e92f[_0xf41c('0x2e')][_0xf41c('0x2f')]?_0x76e92f[_0xf41c('0x2e')]:_0x24ca33[_0xf41c('0x2b')];_0x76e92f['order']=qs['sort'](_0x11d40f[_0xf41c('0x28')]['sort']);_0x76e92f[_0xf41c('0x48')]=qs[_0xf41c('0x2a')](_['pick'](_0x11d40f[_0xf41c('0x28')],_0x24ca33[_0xf41c('0x2a')]));if(_0x11d40f['query']['filter']){_0x76e92f[_0xf41c('0x48')]=_[_0xf41c('0x31')](_0x76e92f[_0xf41c('0x48')],{'$or':_['map'](_0x76e92f[_0xf41c('0x2e')],function(_0x3b2f87){var _0x5ec853={};_0x5ec853[_0x3b2f87]={'$like':'%'+_0x11d40f[_0xf41c('0x28')][_0xf41c('0x47')]+'%'};return _0x5ec853;})});}_0x76e92f=_['merge']({},_0x76e92f,_0x11d40f[_0xf41c('0x32')]);return _0x4ccc29[_0xf41c('0x53')](_0x76e92f);}})[_0xf41c('0x16')](function(_0x302a08){if(_0x302a08){_0x2b19c9=_0x302a08[_0xf41c('0x2f')];if(!_0x11d40f[_0xf41c('0x28')][_0xf41c('0x42')]('nolimit')){_0x76e92f['limit']=qs[_0xf41c('0x10')](_0x11d40f[_0xf41c('0x28')]['limit']);_0x76e92f['offset']=qs[_0xf41c('0x12')](_0x11d40f[_0xf41c('0x28')]['offset']);}return _0x4ccc29[_0xf41c('0x53')](_0x76e92f);}})[_0xf41c('0x16')](function(_0x24e05a){if(_0x24e05a){return _0x24e05a?{'count':_0x2b19c9,'rows':_0x24e05a}:null;}})[_0xf41c('0x16')](respondWithResult(_0x2b5db1,null))['catch'](handleError(_0x2b5db1,null));};exports[_0xf41c('0x56')]=function(_0x2f0430,_0x434a50){var _0x4d8814=_0x2f0430[_0xf41c('0x34')]['ids'];return db['Team']['findAll']({'where':{'id':_0x4d8814},'attributes':['id'],'include':[{'model':db[_0xf41c('0x4a')],'as':_0xf41c('0x57'),'attributes':['id','name',_0xf41c('0x58'),'voicePause',_0xf41c('0x59')],'raw':!![]}]})[_0xf41c('0x16')](function(_0x50aacb){if(_0x50aacb){var _0x585de9=_[_0xf41c('0x5a')](_0x50aacb,function(_0x517739){var _0x3efb90=_0x517739['get']({'plain':!![]});return _0x3efb90[_0xf41c('0x57')];});return db[_0xf41c('0x1e')][_0xf41c('0x39')]({'where':{'id':_0x2f0430[_0xf41c('0x27')]['id']}})['then'](function(_0x3c1b78){return db[_0xf41c('0x5b')][_0xf41c('0x5c')](function(_0x37dc79){return _0x3c1b78[_0xf41c('0x56')](_0x4d8814,{'transaction':_0x37dc79})[_0xf41c('0x16')](function(){return BPromise[_0xf41c('0x5d')](_0x585de9,function(_0x46b9b6){return db[_0xf41c('0x41')][_0xf41c('0x5e')]({'where':{'UserId':_0x46b9b6['id'],'MailQueueId':_0x2f0430['params']['id']},'transaction':_0x37dc79});});})['then'](function(){_0x585de9[_0xf41c('0x5f')](function(_0x2e3686){socket[_0xf41c('0x60')]('userMailQueue:save',{'UserId':_0x2e3686['id'],'MailQueueId':_0x3c1b78['id']});});});});});}})[_0xf41c('0x16')](respondWithStatusCode(_0x434a50,null))[_0xf41c('0x25')](handleError(_0x434a50,null));};exports[_0xf41c('0x61')]=function(_0x4e41a8,_0x52ae21){return db[_0xf41c('0x54')][_0xf41c('0x23')]({'where':{'id':_0x4e41a8[_0xf41c('0x28')][_0xf41c('0x62')]},'attributes':['id'],'include':[{'model':db[_0xf41c('0x4a')],'as':_0xf41c('0x57'),'attributes':['id'],'raw':!![]}]})[_0xf41c('0x16')](handleEntityNotFound(_0x52ae21,null))[_0xf41c('0x16')](function(_0xf802be){var _0x1ed776=_[_0xf41c('0x49')](_0xf802be,'id');var _0x3e4bdd=[];var _0x56a007=[];var _0x497dae=squel[_0xf41c('0x63')]();_0x497dae['field'](_0xf41c('0x64'))[_0xf41c('0x65')](_0xf41c('0x66'),'tq')[_0xf41c('0x67')]('user_has_teams','ut',_0xf41c('0x68'))[_0xf41c('0x48')](_0xf41c('0x69'),_0x4e41a8[_0xf41c('0x27')]['id']);for(var _0x407e2f=0x0;_0x407e2f<_0xf802be['length'];_0x407e2f+=0x1){let _0x3161ad=_0xf802be[_0x407e2f];for(var _0x427ba9=0x0;_0x427ba9<_0x3161ad[_0xf41c('0x57')][_0xf41c('0x2f')];_0x427ba9+=0x1){let _0x51946f=_0x3161ad[_0xf41c('0x57')][_0x427ba9];var _0x117798=_0x497dae['clone']();_0x117798[_0xf41c('0x48')]('ut.UserId\x20=\x20?',_0x51946f['id']);_0x56a007[_0xf41c('0x6a')](db[_0xf41c('0x5b')][_0xf41c('0x28')](_0x117798[_0xf41c('0x6b')](),{'type':db['sequelize'][_0xf41c('0x6c')][_0xf41c('0x6d')]})[_0xf41c('0x16')](function(_0x180229){if(_0x180229[_0xf41c('0x2f')]===0x1){return _0x51946f['id'];}else{var _0x1456fe=_[_0xf41c('0x6e')](_[_0xf41c('0x49')](_0x180229,'TeamId'),function(_0x349191){return _[_0xf41c('0x6f')](_0x1ed776,_0x349191);});if(_0x1456fe){return _0x51946f['id'];}}}));}}return BPromise['all'](_0x56a007)['then'](function(_0x3a2ccf){_0x3e4bdd=_(_0x3e4bdd)[_0xf41c('0x70')](_0x3a2ccf)['compact']()['value']();return db[_0xf41c('0x1e')][_0xf41c('0x39')]({'where':{'id':_0x4e41a8[_0xf41c('0x27')]['id']}})[_0xf41c('0x16')](function(_0x285f96){return db[_0xf41c('0x5b')]['transaction'](function(_0x1cb899){return _0x285f96[_0xf41c('0x61')](_0x4e41a8[_0xf41c('0x28')][_0xf41c('0x62')],{'transaction':_0x1cb899})['then'](function(){if(!_['isEmpty'](_0x3e4bdd)){return _0x285f96[_0xf41c('0x71')](_0x3e4bdd,{'transaction':_0x1cb899});}})['then'](function(){_0x3e4bdd[_0xf41c('0x5f')](function(_0x1afd06){socket['emit'](_0xf41c('0x72'),{'UserId':_0x1afd06,'MailQueueId':_0x285f96['id']});});});});});});})[_0xf41c('0x16')](respondWithStatusCode(_0x52ae21,null))[_0xf41c('0x25')](handleError(_0x52ae21,null));};exports['addAgents']=function(_0x23bce6,_0x9dc14d){return db[_0xf41c('0x1e')][_0xf41c('0x39')]({'where':{'id':_0x23bce6['params']['id']}})[_0xf41c('0x16')](handleEntityNotFound(_0x9dc14d,null))[_0xf41c('0x16')](function(_0x8eafeb){if(_0x8eafeb){return _0x8eafeb[_0xf41c('0x73')](_0x23bce6['body'][_0xf41c('0x62')],_[_0xf41c('0x74')](_0x23bce6[_0xf41c('0x34')],[_0xf41c('0x62'),'id'])||{})['spread'](function(_0x2c3d85){for(var _0x3b922d=0x0;_0x3b922d<_0x23bce6[_0xf41c('0x34')][_0xf41c('0x62')][_0xf41c('0x2f')];_0x3b922d+=0x1){socket[_0xf41c('0x60')](_0xf41c('0x75'),{'UserId':Number(_0x23bce6[_0xf41c('0x34')][_0xf41c('0x62')][_0x3b922d]),'MailQueueId':Number(_0x23bce6['params']['id'])});}return _0x2c3d85;});}})[_0xf41c('0x16')](respondWithResult(_0x9dc14d,null))[_0xf41c('0x25')](handleError(_0x9dc14d,null));};exports[_0xf41c('0x71')]=function(_0x31396f,_0x428fb6){return db['MailQueue'][_0xf41c('0x39')]({'where':{'id':_0x31396f[_0xf41c('0x27')]['id']}})[_0xf41c('0x16')](handleEntityNotFound(_0x428fb6,null))[_0xf41c('0x16')](function(_0x7f97a7){if(_0x7f97a7){return _0x7f97a7['removeAgents'](_0x31396f[_0xf41c('0x28')][_0xf41c('0x62')])[_0xf41c('0x16')](function(){if(_[_0xf41c('0x76')](_0x31396f[_0xf41c('0x28')][_0xf41c('0x62')])){for(var _0x187032=0x0;_0x187032<_0x31396f[_0xf41c('0x28')][_0xf41c('0x62')][_0xf41c('0x2f')];_0x187032+=0x1){socket[_0xf41c('0x60')](_0xf41c('0x72'),{'UserId':Number(_0x31396f[_0xf41c('0x28')][_0xf41c('0x62')][_0x187032]),'MailQueueId':Number(_0x31396f[_0xf41c('0x27')]['id'])});}}else{socket[_0xf41c('0x60')](_0xf41c('0x72'),{'UserId':Number(_0x31396f[_0xf41c('0x28')]['ids']),'MailQueueId':Number(_0x31396f[_0xf41c('0x27')]['id'])});}});}})[_0xf41c('0x16')](respondWithStatusCode(_0x428fb6,null))[_0xf41c('0x25')](handleError(_0x428fb6,null));};exports[_0xf41c('0x77')]=function(_0x1e808f,_0xbff8da){var _0x91091f={};var _0x20fd19={};var _0x464fb9;var _0x46ae59;return db[_0xf41c('0x1e')][_0xf41c('0x40')]({'where':{'id':_0x1e808f[_0xf41c('0x27')]['id']}})['then'](handleEntityNotFound(_0xbff8da,null))['then'](function(_0x14f5de){if(_0x14f5de){_0x464fb9=_0x14f5de;_0x20fd19['model']=_[_0xf41c('0x29')](db['User'][_0xf41c('0x55')]);_0x20fd19[_0xf41c('0x28')]=_[_0xf41c('0x29')](_0x1e808f[_0xf41c('0x28')]);_0x20fd19[_0xf41c('0x2a')]=_[_0xf41c('0x2c')](_0x20fd19[_0xf41c('0x2b')],_0x20fd19[_0xf41c('0x28')]);_0x91091f['attributes']=_[_0xf41c('0x2c')](_0x20fd19[_0xf41c('0x2b')],qs[_0xf41c('0x2d')](_0x1e808f[_0xf41c('0x28')][_0xf41c('0x2d')]));_0x91091f[_0xf41c('0x2e')]=_0x91091f[_0xf41c('0x2e')][_0xf41c('0x2f')]?_0x91091f['attributes']:_0x20fd19['model'];_0x91091f[_0xf41c('0x43')]=qs[_0xf41c('0x44')](_0x1e808f[_0xf41c('0x28')][_0xf41c('0x44')]);_0x91091f['where']=qs['filters'](_[_0xf41c('0x45')](_0x1e808f[_0xf41c('0x28')],_0x20fd19[_0xf41c('0x2a')]));if(_0x1e808f[_0xf41c('0x28')]['filter']){_0x91091f[_0xf41c('0x48')]=_['merge'](_0x91091f[_0xf41c('0x48')],{'$or':_[_0xf41c('0x49')](_0x91091f[_0xf41c('0x2e')],function(_0x14b95a){var _0x3b550f={};_0x3b550f[_0x14b95a]={'$like':'%'+_0x1e808f['query'][_0xf41c('0x47')]+'%'};return _0x3b550f;})});}_0x91091f=_[_0xf41c('0x31')]({},_0x91091f,_0x1e808f['options']);return _0x464fb9[_0xf41c('0x77')](_0x91091f);}})[_0xf41c('0x16')](function(_0x179c9f){if(_0x179c9f){_0x46ae59=_0x179c9f['length'];if(!_0x1e808f[_0xf41c('0x28')][_0xf41c('0x42')](_0xf41c('0x78'))){_0x91091f[_0xf41c('0x10')]=qs[_0xf41c('0x10')](_0x1e808f['query'][_0xf41c('0x10')]);_0x91091f[_0xf41c('0x12')]=qs[_0xf41c('0x12')](_0x1e808f[_0xf41c('0x28')][_0xf41c('0x12')]);}return _0x464fb9['getAgents'](_0x91091f);}})[_0xf41c('0x16')](function(_0x246959){if(_0x246959){return _0x246959?{'count':_0x46ae59,'rows':_0x246959}:null;}})[_0xf41c('0x16')](respondWithResult(_0xbff8da,null))[_0xf41c('0x25')](handleError(_0xbff8da,null));}; \ No newline at end of file +var _0xa183=['intersection','fields','attributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','order','sort','filters','pick','MailQueueId','filter','map','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','nolimit','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','MailQueues','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','type','key','getOptions','where','MailQueue','include','query','rows','catch','show','params','model','keys'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xa183,0x163));var _0x3a18=function(_0x17ac28,_0x1d75ee){_0x17ac28=_0x17ac28-0x0;var _0xf29082=_0xa183[_0x17ac28];return _0xf29082;};'use strict';var BPromise=require(_0x3a18('0x0'));var util=require(_0x3a18('0x1'));var _=require(_0x3a18('0x2'));var squel=require(_0x3a18('0x3'));var Redis=require(_0x3a18('0x4'));var qs=require(_0x3a18('0x5'));var logger=require(_0x3a18('0x6'))(_0x3a18('0x7'));var config=require(_0x3a18('0x8'));var db=require(_0x3a18('0x9'))['db'];config['redis']=_[_0x3a18('0xa')](config[_0x3a18('0xb')],{'host':_0x3a18('0xc'),'port':0x18eb});var socket=require(_0x3a18('0xd'))(new Redis(config['redis']));require(_0x3a18('0xe'))[_0x3a18('0xf')](socket);function respondWithStatusCode(_0x347a54,_0x2c2a8b){_0x2c2a8b=_0x2c2a8b||0xcc;return function(_0x8183b6){if(_0x8183b6){return _0x347a54['sendStatus'](_0x2c2a8b);}return _0x347a54[_0x3a18('0x10')](_0x2c2a8b)[_0x3a18('0x11')]();};}function respondWithResult(_0x96cf3b,_0x231a97){_0x231a97=_0x231a97||0xc8;return function(_0x2f00b5){if(_0x2f00b5){return _0x96cf3b[_0x3a18('0x10')](_0x231a97)[_0x3a18('0x12')](_0x2f00b5);}};}function respondWithFilteredResult(_0x4d6cad,_0x452fec){return function(_0x5d2b58){if(_0x5d2b58){var _0x7afc08=typeof _0x452fec[_0x3a18('0x13')]===_0x3a18('0x14')&&typeof _0x452fec[_0x3a18('0x15')]===_0x3a18('0x14');var _0x2e8b46=_0x5d2b58[_0x3a18('0x16')];var _0x4987e4=_0x7afc08?0x0:_0x452fec['offset'];var _0x2f1af7=_0x7afc08?_0x5d2b58[_0x3a18('0x16')]:_0x452fec[_0x3a18('0x13')]+_0x452fec[_0x3a18('0x15')];var _0x2264dc;if(_0x2f1af7>=_0x2e8b46){_0x2f1af7=_0x2e8b46;_0x2264dc=0xc8;}else{_0x2264dc=0xce;}_0x4d6cad[_0x3a18('0x10')](_0x2264dc);return _0x4d6cad[_0x3a18('0x17')](_0x3a18('0x18'),_0x4987e4+'-'+_0x2f1af7+'/'+_0x2e8b46)[_0x3a18('0x12')](_0x5d2b58);}return null;};}function saveUpdates(_0x5099d0){return function(_0x4db493){if(_0x4db493){return _0x4db493[_0x3a18('0x19')](_0x5099d0)['then'](function(_0x582cc3){return _0x582cc3;});}return null;};}function removeEntity(_0x223745){return function(_0x478587){if(_0x478587){return _0x478587[_0x3a18('0x1a')]()[_0x3a18('0x1b')](function(){var _0x19d77d=_0x478587[_0x3a18('0x1c')]({'plain':!![]});var _0x283c3e=_0x3a18('0x1d');return db[_0x3a18('0x1e')][_0x3a18('0x1a')]({'where':{'type':_0x283c3e,'resourceId':_0x19d77d['id']}})['then'](function(){return _0x478587;});})['then'](function(){_0x223745[_0x3a18('0x10')](0xcc)[_0x3a18('0x11')]();});}};}function handleEntityNotFound(_0x5a4278){return function(_0x50e2e1){if(!_0x50e2e1){_0x5a4278[_0x3a18('0x1f')](0x194);}return _0x50e2e1;};}function handleError(_0x589ac0,_0x15b2a9){_0x15b2a9=_0x15b2a9||0x1f4;return function(_0x397676){logger[_0x3a18('0x20')](_0x397676['stack']);if(_0x397676[_0x3a18('0x21')]){delete _0x397676[_0x3a18('0x21')];}_0x589ac0[_0x3a18('0x10')](_0x15b2a9)[_0x3a18('0x22')](_0x397676);};}exports[_0x3a18('0x23')]=function(_0x4bf16c,_0x2000eb){var _0x438ce6={};var _0x4f2970={'count':0x0,'rows':[]};var _0x184a9e=_['map'](db['MailQueue'][_0x3a18('0x24')],function(_0x1041a9){return{'name':_0x1041a9['fieldName'],'type':_0x1041a9[_0x3a18('0x25')][_0x3a18('0x26')]};});_0x438ce6=qs[_0x3a18('0x27')](_0x184a9e,_0x4bf16c);var _0x58011e={'where':_0x438ce6[_0x3a18('0x28')]};return db[_0x3a18('0x29')]['count'](_0x58011e)[_0x3a18('0x1b')](function(_0x2701f3){_0x4f2970[_0x3a18('0x16')]=_0x2701f3;_0x438ce6[_0x3a18('0x2a')]=qs['include'](_0x4bf16c[_0x3a18('0x2b')]);return db[_0x3a18('0x29')]['findAll'](_0x438ce6);})['then'](function(_0x3b39ba){_0x4f2970[_0x3a18('0x2c')]=_0x3b39ba;return _0x4f2970;})[_0x3a18('0x1b')](respondWithFilteredResult(_0x2000eb,_0x438ce6))[_0x3a18('0x2d')](handleError(_0x2000eb,null));};exports[_0x3a18('0x2e')]=function(_0x392644,_0x3e8f5f){var _0x4f356d={'raw':!![],'where':{'id':_0x392644[_0x3a18('0x2f')]['id']}},_0x4e509a={};_0x4e509a[_0x3a18('0x30')]=_['keys'](db[_0x3a18('0x29')][_0x3a18('0x24')]);_0x4e509a['query']=_[_0x3a18('0x31')](_0x392644[_0x3a18('0x2b')]);_0x4e509a['filters']=_[_0x3a18('0x32')](_0x4e509a[_0x3a18('0x30')],_0x4e509a[_0x3a18('0x2b')]);_0x4f356d['attributes']=_[_0x3a18('0x32')](_0x4e509a[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x392644[_0x3a18('0x2b')][_0x3a18('0x33')]));_0x4f356d[_0x3a18('0x34')]=_0x4f356d[_0x3a18('0x34')][_0x3a18('0x35')]?_0x4f356d['attributes']:_0x4e509a['model'];if(_0x392644[_0x3a18('0x2b')]['includeAll']){_0x4f356d[_0x3a18('0x2a')]=[{'all':!![]}];}_0x4f356d=_[_0x3a18('0x36')]({},_0x4f356d,_0x392644[_0x3a18('0x37')]);return db['MailQueue'][_0x3a18('0x38')](_0x4f356d)[_0x3a18('0x1b')](handleEntityNotFound(_0x3e8f5f,null))[_0x3a18('0x1b')](respondWithResult(_0x3e8f5f,null))['catch'](handleError(_0x3e8f5f,null));};exports['create']=function(_0x6028af,_0x537ff7){return db[_0x3a18('0x29')][_0x3a18('0x39')](_0x6028af[_0x3a18('0x3a')],{})[_0x3a18('0x1b')](function(_0x4d090c){var _0x284ec5=_0x6028af[_0x3a18('0x3b')][_0x3a18('0x1c')]({'plain':!![]});if(!_0x284ec5)throw new Error(_0x3a18('0x3c'));if(_0x284ec5[_0x3a18('0x3d')]==='user'){var _0x5458a2=_0x4d090c[_0x3a18('0x1c')]({'plain':!![]});var _0x4262c6='MailQueues';return db[_0x3a18('0x3e')][_0x3a18('0x38')]({'where':{'name':_0x4262c6,'userProfileId':_0x284ec5[_0x3a18('0x3f')]},'raw':!![]})[_0x3a18('0x1b')](function(_0x2cedf3){if(_0x2cedf3&&_0x2cedf3[_0x3a18('0x40')]===0x0){return db[_0x3a18('0x1e')]['create']({'name':_0x5458a2['name'],'resourceId':_0x5458a2['id'],'type':_0x2cedf3['name'],'sectionId':_0x2cedf3['id']},{})[_0x3a18('0x1b')](function(){return _0x4d090c;});}else{return _0x4d090c;}})['catch'](function(_0x19929d){logger['error'](_0x3a18('0x41'),_0x19929d);throw _0x19929d;});}return _0x4d090c;})['then'](respondWithResult(_0x537ff7,0xc9))['catch'](handleError(_0x537ff7,null));};exports[_0x3a18('0x19')]=function(_0x3efcbd,_0x4a5572){if(_0x3efcbd['body']['id']){delete _0x3efcbd['body']['id'];}return db[_0x3a18('0x29')][_0x3a18('0x38')]({'where':{'id':_0x3efcbd[_0x3a18('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4a5572,null))[_0x3a18('0x1b')](saveUpdates(_0x3efcbd[_0x3a18('0x3a')],null))[_0x3a18('0x1b')](respondWithResult(_0x4a5572,null))[_0x3a18('0x2d')](handleError(_0x4a5572,null));};exports['destroy']=function(_0x5d7ebf,_0x3e17e9){return db[_0x3a18('0x29')]['find']({'where':{'id':_0x5d7ebf[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x3e17e9,null))[_0x3a18('0x1b')](removeEntity(_0x3e17e9,null))[_0x3a18('0x2d')](handleError(_0x3e17e9,null));};exports[_0x3a18('0x42')]=function(_0x3672ec,_0x1f442b){return db[_0x3a18('0x29')][_0x3a18('0x42')]()[_0x3a18('0x1b')](respondWithResult(_0x1f442b,null))['catch'](handleError(_0x1f442b,null));};exports[_0x3a18('0x43')]=function(_0x3e8852,_0x30e999){var _0x5c07a5={'raw':!![],'where':{}},_0x9286ba={},_0x2d91ac;return db['MailQueue'][_0x3a18('0x44')]({'where':{'id':_0x3e8852[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x30e999,null))['then'](function(_0xe17741){if(_0xe17741){_0x2d91ac=_0xe17741[_0x3a18('0x1c')]({'plain':!![]});_0x9286ba['model']=_[_0x3a18('0x31')](db[_0x3a18('0x45')][_0x3a18('0x24')]);_0x9286ba[_0x3a18('0x2b')]=_[_0x3a18('0x31')](_0x3e8852[_0x3a18('0x2b')]);_0x9286ba['filters']=_['intersection'](_0x9286ba[_0x3a18('0x30')],_0x9286ba['query']);_0x5c07a5[_0x3a18('0x34')]=_[_0x3a18('0x32')](_0x9286ba[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x3e8852[_0x3a18('0x2b')][_0x3a18('0x33')]));_0x5c07a5['attributes']=_0x5c07a5[_0x3a18('0x34')][_0x3a18('0x35')]?_0x5c07a5[_0x3a18('0x34')]:_0x9286ba['model'];if(!_0x3e8852[_0x3a18('0x2b')][_0x3a18('0x46')]('nolimit')){_0x5c07a5[_0x3a18('0x15')]=qs[_0x3a18('0x15')](_0x3e8852['query'][_0x3a18('0x15')]);_0x5c07a5['offset']=qs['offset'](_0x3e8852['query'][_0x3a18('0x13')]);}_0x5c07a5[_0x3a18('0x47')]=qs[_0x3a18('0x48')](_0x3e8852['query'][_0x3a18('0x48')]);_0x5c07a5[_0x3a18('0x28')]=qs[_0x3a18('0x49')](_[_0x3a18('0x4a')](_0x3e8852['query'],_0x9286ba['filters']));_0x5c07a5[_0x3a18('0x28')][_0x3a18('0x4b')]=_0xe17741['id'];if(_0x3e8852[_0x3a18('0x2b')][_0x3a18('0x4c')]){_0x5c07a5[_0x3a18('0x28')]=_[_0x3a18('0x36')](_0x5c07a5[_0x3a18('0x28')],{'$or':_[_0x3a18('0x4d')](_0x5c07a5[_0x3a18('0x34')],function(_0xb2be04){var _0x5e58b0={};_0x5e58b0[_0xb2be04]={'$like':'%'+_0x3e8852['query'][_0x3a18('0x4c')]+'%'};return _0x5e58b0;})});}_0x5c07a5=_['merge']({},_0x5c07a5,_0x3e8852[_0x3a18('0x37')]);return db[_0x3a18('0x45')]['findAll'](_0x5c07a5);}})['then'](function(_0x67d626){if(_0x67d626){return db[_0x3a18('0x4e')][_0x3a18('0x4f')]({'where':{'id':_['map'](_0x67d626,'UserId'),'role':_0x3a18('0x50')},'attributes':['id','name','mailPause',_0x3a18('0x51'),_0x3a18('0x52')]});}})[_0x3a18('0x1b')](function(_0x448554){if(_0x448554){return{'count':_0x448554[_0x3a18('0x16')],'rows':_['map'](_0x448554[_0x3a18('0x2c')],function(_0x15664d){return{'membername':_0x15664d[_0x3a18('0x21')],'UserId':_0x15664d['id'],'queue_name':_0x2d91ac[_0x3a18('0x21')],'MailQueueId':_0x2d91ac['id'],'interface':util[_0x3a18('0x53')](_0x3a18('0x54'),_0x3a18('0x55'),_0x15664d[_0x3a18('0x21')]),'penalty':0x0,'paused':_0x15664d[_0x3a18('0x56')],'createdAt':_0x15664d[_0x3a18('0x52')],'updatedAt':_0x15664d[_0x3a18('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3a18('0x1b')](respondWithFilteredResult(_0x30e999,_0x5c07a5))[_0x3a18('0x2d')](handleError(_0x30e999,null));};exports[_0x3a18('0x57')]=function(_0x2aff0a,_0x108785){var _0x35d5bf={};var _0x460738={};var _0x16cb7c;var _0x2ca970;return db[_0x3a18('0x29')]['findOne']({'where':{'id':_0x2aff0a[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x108785,null))[_0x3a18('0x1b')](function(_0x49f91c){if(_0x49f91c){_0x16cb7c=_0x49f91c;_0x460738[_0x3a18('0x30')]=_[_0x3a18('0x31')](db[_0x3a18('0x58')]['rawAttributes']);_0x460738[_0x3a18('0x2b')]=_[_0x3a18('0x31')](_0x2aff0a[_0x3a18('0x2b')]);_0x460738['filters']=_['intersection'](_0x460738[_0x3a18('0x30')],_0x460738['query']);_0x35d5bf[_0x3a18('0x34')]=_[_0x3a18('0x32')](_0x460738[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x2aff0a[_0x3a18('0x2b')][_0x3a18('0x33')]));_0x35d5bf[_0x3a18('0x34')]=_0x35d5bf[_0x3a18('0x34')]['length']?_0x35d5bf[_0x3a18('0x34')]:_0x460738['model'];_0x35d5bf[_0x3a18('0x47')]=qs[_0x3a18('0x48')](_0x2aff0a[_0x3a18('0x2b')][_0x3a18('0x48')]);_0x35d5bf[_0x3a18('0x28')]=qs[_0x3a18('0x49')](_['pick'](_0x2aff0a[_0x3a18('0x2b')],_0x460738[_0x3a18('0x49')]));if(_0x2aff0a[_0x3a18('0x2b')]['filter']){_0x35d5bf['where']=_['merge'](_0x35d5bf[_0x3a18('0x28')],{'$or':_[_0x3a18('0x4d')](_0x35d5bf[_0x3a18('0x34')],function(_0x2b6e67){var _0x4bf31b={};_0x4bf31b[_0x2b6e67]={'$like':'%'+_0x2aff0a[_0x3a18('0x2b')][_0x3a18('0x4c')]+'%'};return _0x4bf31b;})});}_0x35d5bf=_[_0x3a18('0x36')]({},_0x35d5bf,_0x2aff0a['options']);return _0x16cb7c['getTeams'](_0x35d5bf);}})['then'](function(_0x583c49){if(_0x583c49){_0x2ca970=_0x583c49[_0x3a18('0x35')];if(!_0x2aff0a['query'][_0x3a18('0x46')](_0x3a18('0x59'))){_0x35d5bf[_0x3a18('0x15')]=qs[_0x3a18('0x15')](_0x2aff0a['query']['limit']);_0x35d5bf['offset']=qs[_0x3a18('0x13')](_0x2aff0a['query']['offset']);}return _0x16cb7c[_0x3a18('0x57')](_0x35d5bf);}})['then'](function(_0x19a2d0){if(_0x19a2d0){return _0x19a2d0?{'count':_0x2ca970,'rows':_0x19a2d0}:null;}})[_0x3a18('0x1b')](respondWithResult(_0x108785,null))[_0x3a18('0x2d')](handleError(_0x108785,null));};exports[_0x3a18('0x5a')]=function(_0x56fffc,_0x5703d8){var _0xd96cec=_0x56fffc[_0x3a18('0x3a')][_0x3a18('0x5b')];return db[_0x3a18('0x58')][_0x3a18('0x5c')]({'where':{'id':_0xd96cec},'attributes':['id'],'include':[{'model':db[_0x3a18('0x4e')],'as':'Agents','attributes':['id',_0x3a18('0x21'),_0x3a18('0x5d'),_0x3a18('0x5e'),_0x3a18('0x5f')],'raw':!![]}]})['then'](function(_0x2f5b57){if(_0x2f5b57){var _0x384302=_[_0x3a18('0x60')](_0x2f5b57,function(_0x47e170){var _0x4bd674=_0x47e170[_0x3a18('0x1c')]({'plain':!![]});return _0x4bd674[_0x3a18('0x61')];});return db[_0x3a18('0x29')][_0x3a18('0x38')]({'where':{'id':_0x56fffc[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](function(_0x46a998){return db['sequelize'][_0x3a18('0x62')](function(_0x3922b9){return _0x46a998[_0x3a18('0x5a')](_0xd96cec,{'transaction':_0x3922b9})[_0x3a18('0x1b')](function(){return BPromise[_0x3a18('0x63')](_0x384302,function(_0x47268){return db[_0x3a18('0x45')][_0x3a18('0x64')]({'where':{'UserId':_0x47268['id'],'MailQueueId':_0x56fffc[_0x3a18('0x2f')]['id']},'transaction':_0x3922b9});});})[_0x3a18('0x1b')](function(){_0x384302[_0x3a18('0x65')](function(_0x5b1a38){socket[_0x3a18('0x66')](_0x3a18('0x67'),{'UserId':_0x5b1a38['id'],'MailQueueId':_0x46a998['id']});});});});});}})['then'](respondWithStatusCode(_0x5703d8,null))[_0x3a18('0x2d')](handleError(_0x5703d8,null));};exports[_0x3a18('0x68')]=function(_0x2a061c,_0x3834ef){return db['Team'][_0x3a18('0x5c')]({'where':{'id':_0x2a061c['query'][_0x3a18('0x5b')]},'attributes':['id'],'include':[{'model':db[_0x3a18('0x4e')],'as':_0x3a18('0x61'),'attributes':['id'],'raw':!![]}]})[_0x3a18('0x1b')](handleEntityNotFound(_0x3834ef,null))[_0x3a18('0x1b')](function(_0x1c0dc8){var _0x22b641=_[_0x3a18('0x4d')](_0x1c0dc8,'id');var _0xe47473=[];var _0x30c909=[];var _0x5c2017=squel[_0x3a18('0x69')]();_0x5c2017[_0x3a18('0x6a')]('tq.TeamId')[_0x3a18('0x6b')](_0x3a18('0x6c'),'tq')[_0x3a18('0x6d')](_0x3a18('0x6e'),'ut',_0x3a18('0x6f'))[_0x3a18('0x28')](_0x3a18('0x70'),_0x2a061c['params']['id']);for(var _0x5c4914=0x0;_0x5c4914<_0x1c0dc8[_0x3a18('0x35')];_0x5c4914+=0x1){let _0x1c841a=_0x1c0dc8[_0x5c4914];for(var _0x32a919=0x0;_0x32a919<_0x1c841a[_0x3a18('0x61')]['length'];_0x32a919+=0x1){let _0x3c14f9=_0x1c841a[_0x3a18('0x61')][_0x32a919];var _0x283f22=_0x5c2017[_0x3a18('0x71')]();_0x283f22['where'](_0x3a18('0x72'),_0x3c14f9['id']);_0x30c909[_0x3a18('0x73')](db['sequelize']['query'](_0x283f22[_0x3a18('0x74')](),{'type':db[_0x3a18('0x75')][_0x3a18('0x76')][_0x3a18('0x77')]})[_0x3a18('0x1b')](function(_0x228ea4){if(_0x228ea4[_0x3a18('0x35')]===0x1){return _0x3c14f9['id'];}else{var _0xafd54d=_[_0x3a18('0x78')](_['map'](_0x228ea4,_0x3a18('0x79')),function(_0x424ea1){return _[_0x3a18('0x7a')](_0x22b641,_0x424ea1);});if(_0xafd54d){return _0x3c14f9['id'];}}}));}}return BPromise[_0x3a18('0x7b')](_0x30c909)[_0x3a18('0x1b')](function(_0x1c9d5f){_0xe47473=_(_0xe47473)[_0x3a18('0x7c')](_0x1c9d5f)[_0x3a18('0x7d')]()[_0x3a18('0x7e')]();return db['MailQueue']['find']({'where':{'id':_0x2a061c[_0x3a18('0x2f')]['id']}})['then'](function(_0x3205c2){return db[_0x3a18('0x75')][_0x3a18('0x62')](function(_0xcb25ff){return _0x3205c2[_0x3a18('0x68')](_0x2a061c['query'][_0x3a18('0x5b')],{'transaction':_0xcb25ff})[_0x3a18('0x1b')](function(){if(!_[_0x3a18('0x7f')](_0xe47473)){return _0x3205c2['removeAgents'](_0xe47473,{'transaction':_0xcb25ff});}})['then'](function(){_0xe47473[_0x3a18('0x65')](function(_0x138c72){socket['emit'](_0x3a18('0x80'),{'UserId':_0x138c72,'MailQueueId':_0x3205c2['id']});});});});});});})['then'](respondWithStatusCode(_0x3834ef,null))[_0x3a18('0x2d')](handleError(_0x3834ef,null));};exports[_0x3a18('0x81')]=function(_0x526baa,_0x21c15b){return db[_0x3a18('0x29')][_0x3a18('0x38')]({'where':{'id':_0x526baa[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x21c15b,null))[_0x3a18('0x1b')](function(_0x2be8e6){if(_0x2be8e6){return _0x2be8e6[_0x3a18('0x81')](_0x526baa[_0x3a18('0x3a')][_0x3a18('0x5b')],_[_0x3a18('0x82')](_0x526baa[_0x3a18('0x3a')],[_0x3a18('0x5b'),'id'])||{})[_0x3a18('0x83')](function(_0x123fba){for(var _0x2b35b6=0x0;_0x2b35b6<_0x526baa[_0x3a18('0x3a')][_0x3a18('0x5b')][_0x3a18('0x35')];_0x2b35b6+=0x1){socket[_0x3a18('0x66')]('userMailQueue:save',{'UserId':Number(_0x526baa[_0x3a18('0x3a')]['ids'][_0x2b35b6]),'MailQueueId':Number(_0x526baa[_0x3a18('0x2f')]['id'])});}return _0x123fba;});}})[_0x3a18('0x1b')](respondWithResult(_0x21c15b,null))[_0x3a18('0x2d')](handleError(_0x21c15b,null));};exports[_0x3a18('0x84')]=function(_0x193615,_0x10344a){return db[_0x3a18('0x29')]['find']({'where':{'id':_0x193615[_0x3a18('0x2f')]['id']}})['then'](handleEntityNotFound(_0x10344a,null))[_0x3a18('0x1b')](function(_0x575e0f){if(_0x575e0f){return _0x575e0f['removeAgents'](_0x193615[_0x3a18('0x2b')][_0x3a18('0x5b')])['then'](function(){if(_[_0x3a18('0x85')](_0x193615[_0x3a18('0x2b')][_0x3a18('0x5b')])){for(var _0x553670=0x0;_0x553670<_0x193615[_0x3a18('0x2b')]['ids'][_0x3a18('0x35')];_0x553670+=0x1){socket[_0x3a18('0x66')]('userMailQueue:remove',{'UserId':Number(_0x193615['query']['ids'][_0x553670]),'MailQueueId':Number(_0x193615[_0x3a18('0x2f')]['id'])});}}else{socket[_0x3a18('0x66')]('userMailQueue:remove',{'UserId':Number(_0x193615[_0x3a18('0x2b')][_0x3a18('0x5b')]),'MailQueueId':Number(_0x193615[_0x3a18('0x2f')]['id'])});}});}})[_0x3a18('0x1b')](respondWithStatusCode(_0x10344a,null))[_0x3a18('0x2d')](handleError(_0x10344a,null));};exports[_0x3a18('0x86')]=function(_0x572e14,_0x3305f5){var _0x5bf999={};var _0x3b0299={};var _0x2ffac8;var _0x4c45f1;return db[_0x3a18('0x29')][_0x3a18('0x44')]({'where':{'id':_0x572e14['params']['id']}})['then'](handleEntityNotFound(_0x3305f5,null))[_0x3a18('0x1b')](function(_0x181b09){if(_0x181b09){_0x2ffac8=_0x181b09;_0x3b0299[_0x3a18('0x30')]=_['keys'](db['User']['rawAttributes']);_0x3b0299['query']=_[_0x3a18('0x31')](_0x572e14[_0x3a18('0x2b')]);_0x3b0299[_0x3a18('0x49')]=_[_0x3a18('0x32')](_0x3b0299[_0x3a18('0x30')],_0x3b0299[_0x3a18('0x2b')]);_0x5bf999[_0x3a18('0x34')]=_[_0x3a18('0x32')](_0x3b0299[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x572e14[_0x3a18('0x2b')]['fields']));_0x5bf999['attributes']=_0x5bf999[_0x3a18('0x34')]['length']?_0x5bf999[_0x3a18('0x34')]:_0x3b0299[_0x3a18('0x30')];_0x5bf999[_0x3a18('0x47')]=qs[_0x3a18('0x48')](_0x572e14[_0x3a18('0x2b')]['sort']);_0x5bf999[_0x3a18('0x28')]=qs[_0x3a18('0x49')](_['pick'](_0x572e14[_0x3a18('0x2b')],_0x3b0299[_0x3a18('0x49')]));if(_0x572e14[_0x3a18('0x2b')][_0x3a18('0x4c')]){_0x5bf999[_0x3a18('0x28')]=_['merge'](_0x5bf999[_0x3a18('0x28')],{'$or':_[_0x3a18('0x4d')](_0x5bf999[_0x3a18('0x34')],function(_0x7e5ea1){var _0x99d63c={};_0x99d63c[_0x7e5ea1]={'$like':'%'+_0x572e14['query'][_0x3a18('0x4c')]+'%'};return _0x99d63c;})});}_0x5bf999=_[_0x3a18('0x36')]({},_0x5bf999,_0x572e14['options']);return _0x2ffac8[_0x3a18('0x86')](_0x5bf999);}})['then'](function(_0x2fd12f){if(_0x2fd12f){_0x4c45f1=_0x2fd12f[_0x3a18('0x35')];if(!_0x572e14[_0x3a18('0x2b')][_0x3a18('0x46')]('nolimit')){_0x5bf999[_0x3a18('0x15')]=qs[_0x3a18('0x15')](_0x572e14[_0x3a18('0x2b')][_0x3a18('0x15')]);_0x5bf999[_0x3a18('0x13')]=qs['offset'](_0x572e14[_0x3a18('0x2b')][_0x3a18('0x13')]);}return _0x2ffac8[_0x3a18('0x86')](_0x5bf999);}})[_0x3a18('0x1b')](function(_0x397316){if(_0x397316){return _0x397316?{'count':_0x4c45f1,'rows':_0x397316}:null;}})[_0x3a18('0x1b')](respondWithResult(_0x3305f5,null))[_0x3a18('0x2d')](handleError(_0x3305f5,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 65c69b7..f450fe3 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 _0xfc85=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4ce103,_0xa680c0){var _0x1efbb5=function(_0x2dd3e9){while(--_0x2dd3e9){_0x4ce103['push'](_0x4ce103['shift']());}};_0x1efbb5(++_0xa680c0);}(_0xfc85,0x9a));var _0x5fc8=function(_0x51b35d,_0x3faac3){_0x51b35d=_0x51b35d-0x0;var _0x121d18=_0xfc85[_0x51b35d];return _0x121d18;};'use strict';var EventEmitter=require(_0x5fc8('0x0'));var MailQueue=require(_0x5fc8('0x1'))['db'][_0x5fc8('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5fc8('0x3')](0x0);var events={'afterCreate':_0x5fc8('0x4'),'afterUpdate':_0x5fc8('0x5'),'afterDestroy':_0x5fc8('0x6')};function emitEvent(_0x596914){return function(_0x1dfbe5,_0x409568,_0x2316c){MailQueueEvents[_0x5fc8('0x7')](_0x596914+':'+_0x1dfbe5['id'],_0x1dfbe5);MailQueueEvents[_0x5fc8('0x7')](_0x596914,_0x1dfbe5);_0x2316c(null);};}for(var e in events){if(events[_0x5fc8('0x8')](e)){var event=events[e];MailQueue[_0x5fc8('0x9')](e,emitEvent(event));}}module[_0x5fc8('0xa')]=MailQueueEvents; \ No newline at end of file +var _0xcd26=['hook','exports','events','MailQueue','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x46f677,_0x18ddaf){var _0x2b661e=function(_0x29080f){while(--_0x29080f){_0x46f677['push'](_0x46f677['shift']());}};_0x2b661e(++_0x18ddaf);}(_0xcd26,0x110));var _0x6cd2=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0xcd26[_0x1e8f35];return _0x446c13;};'use strict';var EventEmitter=require(_0x6cd2('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x6cd2('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6cd2('0x2')](0x0);var events={'afterCreate':_0x6cd2('0x3'),'afterUpdate':_0x6cd2('0x4'),'afterDestroy':_0x6cd2('0x5')};function emitEvent(_0x6a2e65){return function(_0x1ce288,_0x81e7e9,_0x4b0f98){MailQueueEvents['emit'](_0x6a2e65+':'+_0x1ce288['id'],_0x1ce288);MailQueueEvents['emit'](_0x6a2e65,_0x1ce288);_0x4b0f98(null);};}for(var e in events){if(events[_0x6cd2('0x6')](e)){var event=events[e];MailQueue[_0x6cd2('0x7')](e,emitEvent(event));}}module[_0x6cd2('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 85ac30b..525b2c0 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 _0x841e=['bluebird','path','../../config/environment','define','mail_queues','lodash','../../config/logger','api','moment'];(function(_0x5ec608,_0x1214bb){var _0x7deeb8=function(_0x4b4f1b){while(--_0x4b4f1b){_0x5ec608['push'](_0x5ec608['shift']());}};_0x7deeb8(++_0x1214bb);}(_0x841e,0x1d9));var _0xe841=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x841e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xe841('0x0'));var util=require('util');var logger=require(_0xe841('0x1'))(_0xe841('0x2'));var moment=require(_0xe841('0x3'));var BPromise=require(_0xe841('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe841('0x5'));var rimraf=require('rimraf');var config=require(_0xe841('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x441990,_0x5be4fe){return _0x441990[_0xe841('0x7')]('MailQueue',attributes,{'tableName':_0xe841('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef07=['exports','define','MailQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x2894c3,_0x5ccc2a){var _0x4295ab=function(_0x3d3c28){while(--_0x3d3c28){_0x2894c3['push'](_0x2894c3['shift']());}};_0x4295ab(++_0x5ccc2a);}(_0xef07,0x1b0));var _0x7ef0=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0xef07[_0xf1af27];return _0x46b274;};'use strict';var _=require(_0x7ef0('0x0'));var util=require(_0x7ef0('0x1'));var logger=require('../../config/logger')(_0x7ef0('0x2'));var moment=require(_0x7ef0('0x3'));var BPromise=require(_0x7ef0('0x4'));var rp=require(_0x7ef0('0x5'));var fs=require('fs');var path=require(_0x7ef0('0x6'));var rimraf=require(_0x7ef0('0x7'));var config=require(_0x7ef0('0x8'));var attributes=require(_0x7ef0('0x9'));module[_0x7ef0('0xa')]=function(_0x5460e6,_0x5309e1){return _0x5460e6[_0x7ef0('0xb')](_0x7ef0('0xc'),attributes,{'tableName':'mail_queues','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 3c9594c..90712ca 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 _0x6be1=['util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailQueue','findAll','options','attributes','limit','include','map','model','catch','ShowMailQueue','find','where','lodash'];(function(_0x5e0648,_0x5c3164){var _0x33d820=function(_0x12ee35){while(--_0x12ee35){_0x5e0648['push'](_0x5e0648['shift']());}};_0x33d820(++_0x5c3164);}(_0x6be1,0x12f));var _0x16be=function(_0x110746,_0x38221b){_0x110746=_0x110746-0x0;var _0x5d6fdc=_0x6be1[_0x110746];return _0x5d6fdc;};'use strict';var _=require(_0x16be('0x0'));var util=require(_0x16be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16be('0x2'))['db'];var utils=require(_0x16be('0x3'));var logger=require(_0x16be('0x4'))(_0x16be('0x5'));var config=require(_0x16be('0x6'));var jayson=require(_0x16be('0x7'));var client=jayson[_0x16be('0x8')][_0x16be('0x9')]({'port':0x232a});config[_0x16be('0xa')]=_[_0x16be('0xb')](config['redis'],{'host':_0x16be('0xc'),'port':0x18eb});var socket=require(_0x16be('0xd'))(new Redis(config[_0x16be('0xa')]));require(_0x16be('0xe'))[_0x16be('0xf')](socket);function respondWithRpcPromise(_0x3227ca,_0xbace4f,_0x2a5ab3){return new BPromise(function(_0x1a1a06,_0x34dfe8){return client[_0x16be('0x10')](_0x3227ca,_0x2a5ab3)[_0x16be('0x11')](function(_0x1ee9f3){logger[_0x16be('0x12')](_0x16be('0x13'),_0xbace4f,_0x16be('0x14'));logger['debug'](_0x16be('0x15'),_0xbace4f,_0x16be('0x14'),JSON[_0x16be('0x16')](_0x1ee9f3));if(_0x1ee9f3[_0x16be('0x17')]){if(_0x1ee9f3[_0x16be('0x17')]['code']===0x1f4){logger[_0x16be('0x17')](_0x16be('0x13'),_0xbace4f,_0x1ee9f3['error'][_0x16be('0x18')]);return _0x34dfe8(_0x1ee9f3['error']['message']);}logger['error'](_0x16be('0x13'),_0xbace4f,_0x1ee9f3[_0x16be('0x17')][_0x16be('0x18')]);return _0x1a1a06(_0x1ee9f3['error'][_0x16be('0x18')]);}else{logger['info'](_0x16be('0x13'),_0xbace4f,_0x16be('0x14'));_0x1a1a06(_0x1ee9f3[_0x16be('0x19')][_0x16be('0x18')]);}})['catch'](function(_0x2e1055){logger[_0x16be('0x17')]('MailQueue,\x20%s,\x20%s',_0xbace4f,_0x2e1055);_0x34dfe8(_0x2e1055);});});}exports[_0x16be('0x1a')]=function(_0x3d4e0c){var _0x5dbca0=this;return new Promise(function(_0x13018c,_0xac15db){return db['MailQueue'][_0x16be('0x1b')]({'raw':_0x3d4e0c[_0x16be('0x1c')]?_0x3d4e0c['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d4e0c[_0x16be('0x1c')]?_0x3d4e0c[_0x16be('0x1c')]['where']||null:null,'attributes':_0x3d4e0c[_0x16be('0x1c')]?_0x3d4e0c[_0x16be('0x1c')][_0x16be('0x1d')]||null:null,'limit':_0x3d4e0c[_0x16be('0x1c')]?_0x3d4e0c['options'][_0x16be('0x1e')]||null:null,'include':_0x3d4e0c[_0x16be('0x1c')]?_0x3d4e0c['options'][_0x16be('0x1f')]?_['map'](_0x3d4e0c['options'][_0x16be('0x1f')],function(_0x2feb94){return{'model':db[_0x2feb94['model']],'as':_0x2feb94['as'],'attributes':_0x2feb94[_0x16be('0x1d')],'include':_0x2feb94[_0x16be('0x1f')]?_[_0x16be('0x20')](_0x2feb94[_0x16be('0x1f')],function(_0x2900fc){return{'model':db[_0x2900fc[_0x16be('0x21')]],'as':_0x2900fc['as'],'attributes':_0x2900fc[_0x16be('0x1d')],'include':_0x2900fc[_0x16be('0x1f')]?_['map'](_0x2900fc[_0x16be('0x1f')],function(_0x5b0921){return{'model':db[_0x5b0921[_0x16be('0x21')]],'as':_0x5b0921['as'],'attributes':_0x5b0921[_0x16be('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x16be('0x11')](function(_0x94f5d){logger[_0x16be('0x12')](_0x16be('0x1a'),_0x3d4e0c);logger['debug']('GetMailQueue',_0x3d4e0c,JSON[_0x16be('0x16')](_0x94f5d));_0x13018c(_0x94f5d);})[_0x16be('0x22')](function(_0x1e56d1){logger[_0x16be('0x17')]('GetMailQueue',_0x1e56d1[_0x16be('0x18')],_0x3d4e0c);_0xac15db(_0x5dbca0['error'](0x1f4,_0x1e56d1[_0x16be('0x18')]));});});};exports[_0x16be('0x23')]=function(_0x32d810){var _0x307e68=this;return new Promise(function(_0x35b14a,_0x2c2f5d){return db['MailQueue'][_0x16be('0x24')]({'raw':_0x32d810[_0x16be('0x1c')]?_0x32d810[_0x16be('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32d810['options']?_0x32d810[_0x16be('0x1c')][_0x16be('0x25')]||null:null,'attributes':_0x32d810[_0x16be('0x1c')]?_0x32d810[_0x16be('0x1c')][_0x16be('0x1d')]||null:null,'include':_0x32d810[_0x16be('0x1c')]?_0x32d810[_0x16be('0x1c')]['include']?_['map'](_0x32d810[_0x16be('0x1c')][_0x16be('0x1f')],function(_0xe49eac){return{'model':db[_0xe49eac[_0x16be('0x21')]],'as':_0xe49eac['as'],'attributes':_0xe49eac['attributes'],'include':_0xe49eac[_0x16be('0x1f')]?_[_0x16be('0x20')](_0xe49eac[_0x16be('0x1f')],function(_0x1f4bcb){return{'model':db[_0x1f4bcb['model']],'as':_0x1f4bcb['as'],'attributes':_0x1f4bcb[_0x16be('0x1d')],'include':_0x1f4bcb['include']?_['map'](_0x1f4bcb[_0x16be('0x1f')],function(_0x1a215c){return{'model':db[_0x1a215c['model']],'as':_0x1a215c['as'],'attributes':_0x1a215c[_0x16be('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x16be('0x11')](function(_0x3d9546){logger[_0x16be('0x12')](_0x16be('0x23'),_0x32d810);logger['debug'](_0x16be('0x23'),_0x32d810,JSON['stringify'](_0x3d9546));_0x35b14a(_0x3d9546);})['catch'](function(_0x20a403){logger[_0x16be('0x17')](_0x16be('0x23'),_0x20a403['message'],_0x32d810);_0x2c2f5d(_0x307e68[_0x16be('0x17')](0x1f4,_0x20a403[_0x16be('0x18')]));});});}; \ No newline at end of file +var _0x823c=['find','where','ShowMailQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./mailQueue.socket','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','findAll','options','raw','include','map','model','attributes','MailQueue'];(function(_0x5391c9,_0x5aac63){var _0x297911=function(_0x5cec1f){while(--_0x5cec1f){_0x5391c9['push'](_0x5391c9['shift']());}};_0x297911(++_0x5aac63);}(_0x823c,0x143));var _0xc823=function(_0x869341,_0x2706ad){_0x869341=_0x869341-0x0;var _0x5ca37c=_0x823c[_0x869341];return _0x5ca37c;};'use strict';var _=require(_0xc823('0x0'));var util=require('util');var moment=require(_0xc823('0x1'));var BPromise=require(_0xc823('0x2'));var rs=require(_0xc823('0x3'));var fs=require('fs');var Redis=require(_0xc823('0x4'));var db=require(_0xc823('0x5'))['db'];var utils=require(_0xc823('0x6'));var logger=require('../../config/logger')(_0xc823('0x7'));var config=require(_0xc823('0x8'));var jayson=require(_0xc823('0x9'));var client=jayson[_0xc823('0xa')][_0xc823('0xb')]({'port':0x232a});config['redis']=_[_0xc823('0xc')](config[_0xc823('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc823('0xd')]));require(_0xc823('0xe'))['register'](socket);function respondWithRpcPromise(_0x43bbd8,_0x2716a0,_0x5c214c){return new BPromise(function(_0x4dbd5b,_0x409ae1){return client[_0xc823('0xf')](_0x43bbd8,_0x5c214c)[_0xc823('0x10')](function(_0x35afbd){logger[_0xc823('0x11')]('MailQueue,\x20%s,\x20%s',_0x2716a0,_0xc823('0x12'));logger[_0xc823('0x13')](_0xc823('0x14'),_0x2716a0,_0xc823('0x12'),JSON[_0xc823('0x15')](_0x35afbd));if(_0x35afbd[_0xc823('0x16')]){if(_0x35afbd['error'][_0xc823('0x17')]===0x1f4){logger[_0xc823('0x16')](_0xc823('0x18'),_0x2716a0,_0x35afbd[_0xc823('0x16')]['message']);return _0x409ae1(_0x35afbd['error']['message']);}logger['error'](_0xc823('0x18'),_0x2716a0,_0x35afbd['error'][_0xc823('0x19')]);return _0x4dbd5b(_0x35afbd[_0xc823('0x16')][_0xc823('0x19')]);}else{logger[_0xc823('0x11')](_0xc823('0x18'),_0x2716a0,_0xc823('0x12'));_0x4dbd5b(_0x35afbd[_0xc823('0x1a')]['message']);}})[_0xc823('0x1b')](function(_0x4a713a){logger[_0xc823('0x16')](_0xc823('0x18'),_0x2716a0,_0x4a713a);_0x409ae1(_0x4a713a);});});}exports[_0xc823('0x1c')]=function(_0x4fa275){var _0xf2fc30=this;return new Promise(function(_0x2cacfd,_0x3a3fcd){return db['MailQueue'][_0xc823('0x1d')]({'raw':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')][_0xc823('0x1f')]===undefined?!![]:![]:!![],'where':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')]['where']||null:null,'attributes':_0x4fa275[_0xc823('0x1e')]?_0x4fa275['options']['attributes']||null:null,'limit':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')]['limit']||null:null,'include':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')][_0xc823('0x20')]?_[_0xc823('0x21')](_0x4fa275[_0xc823('0x1e')][_0xc823('0x20')],function(_0x19594e){return{'model':db[_0x19594e[_0xc823('0x22')]],'as':_0x19594e['as'],'attributes':_0x19594e[_0xc823('0x23')],'include':_0x19594e[_0xc823('0x20')]?_['map'](_0x19594e[_0xc823('0x20')],function(_0x533560){return{'model':db[_0x533560['model']],'as':_0x533560['as'],'attributes':_0x533560[_0xc823('0x23')],'include':_0x533560[_0xc823('0x20')]?_[_0xc823('0x21')](_0x533560[_0xc823('0x20')],function(_0x20d2b1){return{'model':db[_0x20d2b1[_0xc823('0x22')]],'as':_0x20d2b1['as'],'attributes':_0x20d2b1[_0xc823('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc823('0x10')](function(_0x12f061){logger[_0xc823('0x11')](_0xc823('0x1c'),_0x4fa275);logger[_0xc823('0x13')](_0xc823('0x1c'),_0x4fa275,JSON[_0xc823('0x15')](_0x12f061));_0x2cacfd(_0x12f061);})[_0xc823('0x1b')](function(_0x52bd31){logger[_0xc823('0x16')](_0xc823('0x1c'),_0x52bd31[_0xc823('0x19')],_0x4fa275);_0x3a3fcd(_0xf2fc30[_0xc823('0x16')](0x1f4,_0x52bd31[_0xc823('0x19')]));});});};exports['ShowMailQueue']=function(_0x4e8312){var _0x5c6921=this;return new Promise(function(_0x35ba13,_0x176ad8){return db[_0xc823('0x24')][_0xc823('0x25')]({'raw':_0x4e8312['options']?_0x4e8312[_0xc823('0x1e')][_0xc823('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e8312[_0xc823('0x1e')]?_0x4e8312[_0xc823('0x1e')][_0xc823('0x26')]||null:null,'attributes':_0x4e8312[_0xc823('0x1e')]?_0x4e8312[_0xc823('0x1e')][_0xc823('0x23')]||null:null,'include':_0x4e8312[_0xc823('0x1e')]?_0x4e8312[_0xc823('0x1e')][_0xc823('0x20')]?_[_0xc823('0x21')](_0x4e8312[_0xc823('0x1e')]['include'],function(_0x13caa5){return{'model':db[_0x13caa5[_0xc823('0x22')]],'as':_0x13caa5['as'],'attributes':_0x13caa5[_0xc823('0x23')],'include':_0x13caa5[_0xc823('0x20')]?_[_0xc823('0x21')](_0x13caa5[_0xc823('0x20')],function(_0x48f688){return{'model':db[_0x48f688[_0xc823('0x22')]],'as':_0x48f688['as'],'attributes':_0x48f688[_0xc823('0x23')],'include':_0x48f688['include']?_[_0xc823('0x21')](_0x48f688['include'],function(_0x114045){return{'model':db[_0x114045[_0xc823('0x22')]],'as':_0x114045['as'],'attributes':_0x114045['attributes']};}):[]};}):[]};}):[]:[]})[_0xc823('0x10')](function(_0x27bb6c){logger[_0xc823('0x11')](_0xc823('0x27'),_0x4e8312);logger[_0xc823('0x13')](_0xc823('0x27'),_0x4e8312,JSON[_0xc823('0x15')](_0x27bb6c));_0x35ba13(_0x27bb6c);})['catch'](function(_0x4e8ac9){logger['error'](_0xc823('0x27'),_0x4e8ac9[_0xc823('0x19')],_0x4e8312);_0x176ad8(_0x5c6921[_0xc823('0x16')](0x1f4,_0x4e8ac9[_0xc823('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 36f100b..4301299 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 _0xfc04=['register','length','./mailQueue.events','remove','update','emit'];(function(_0x1ce5e4,_0x30fb0c){var _0x5b3d21=function(_0x5ca0b7){while(--_0x5ca0b7){_0x1ce5e4['push'](_0x1ce5e4['shift']());}};_0x5b3d21(++_0x30fb0c);}(_0xfc04,0xa4));var _0x4fc0=function(_0x3a743f,_0xe789a8){_0x3a743f=_0x3a743f-0x0;var _0x233196=_0xfc04[_0x3a743f];return _0x233196;};'use strict';var MailQueueEvents=require(_0x4fc0('0x0'));var events=['save',_0x4fc0('0x1'),_0x4fc0('0x2')];function createListener(_0x27f419,_0x215db1){return function(_0x1b9044){_0x215db1[_0x4fc0('0x3')](_0x27f419,_0x1b9044);};}function removeListener(_0x285864,_0x173b5c){return function(){MailQueueEvents['removeListener'](_0x285864,_0x173b5c);};}exports[_0x4fc0('0x4')]=function(_0x89df1d){for(var _0x3129d8=0x0,_0x537cd6=events[_0x4fc0('0x5')];_0x3129d8<_0x537cd6;_0x3129d8++){var _0x53e085=events[_0x3129d8];var _0x591600=createListener('mailQueue:'+_0x53e085,_0x89df1d);MailQueueEvents['on'](_0x53e085,_0x591600);}}; \ No newline at end of file +var _0x4ea0=['length','mailQueue:','./mailQueue.events','remove','emit','removeListener','register'];(function(_0x1ad725,_0x2292ab){var _0x41c63b=function(_0x20d5be){while(--_0x20d5be){_0x1ad725['push'](_0x1ad725['shift']());}};_0x41c63b(++_0x2292ab);}(_0x4ea0,0x8e));var _0x04ea=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x4ea0[_0x41382c];return _0x4da35b;};'use strict';var MailQueueEvents=require(_0x04ea('0x0'));var events=['save',_0x04ea('0x1'),'update'];function createListener(_0x59d230,_0x3a3822){return function(_0x4c732a){_0x3a3822[_0x04ea('0x2')](_0x59d230,_0x4c732a);};}function removeListener(_0x3e12f2,_0x2bba27){return function(){MailQueueEvents[_0x04ea('0x3')](_0x3e12f2,_0x2bba27);};}exports[_0x04ea('0x4')]=function(_0x155701){for(var _0x6b99b=0x0,_0x214821=events[_0x04ea('0x5')];_0x6b99b<_0x214821;_0x6b99b++){var _0x4be120=events[_0x6b99b];var _0x465e4f=createListener(_0x04ea('0x6')+_0x4be120,_0x155701);MailQueueEvents['on'](_0x4be120,_0x465e4f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0d74d3c..fd687f2 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 _0xf133=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','put','update','destroy','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf133,0x77));var _0x3f13=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf133[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x3f13('0x0'));var util=require(_0x3f13('0x1'));var path=require(_0x3f13('0x2'));var timeout=require(_0x3f13('0x3'));var express=require('express');var router=express[_0x3f13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3f13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3f13('0x6'));var controller=require('./mailQueueReport.controller');router[_0x3f13('0x7')]('/',auth[_0x3f13('0x8')](),controller[_0x3f13('0x9')]);router[_0x3f13('0x7')](_0x3f13('0xa'),auth[_0x3f13('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3f13('0xb')]);router[_0x3f13('0xc')]('/',auth[_0x3f13('0x8')](),controller['create']);router[_0x3f13('0xd')]('/:id',auth[_0x3f13('0x8')](),controller[_0x3f13('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3f13('0xf')]);module[_0x3f13('0x10')]=router; \ No newline at end of file +var _0xc589=['isAuthenticated','index','/describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc589,0xf2));var _0x9c58=function(_0x232fee,_0x41f4b8){_0x232fee=_0x232fee-0x0;var _0x3e34f5=_0xc589[_0x232fee];return _0x3e34f5;};'use strict';var multer=require(_0x9c58('0x0'));var util=require(_0x9c58('0x1'));var path=require(_0x9c58('0x2'));var timeout=require(_0x9c58('0x3'));var express=require('express');var router=express[_0x9c58('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c58('0x5'));var interaction=require(_0x9c58('0x6'));var config=require(_0x9c58('0x7'));var controller=require(_0x9c58('0x8'));router[_0x9c58('0x9')]('/',auth[_0x9c58('0xa')](),controller[_0x9c58('0xb')]);router[_0x9c58('0x9')](_0x9c58('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x9c58('0xa')](),controller[_0x9c58('0xd')]);router[_0x9c58('0xe')]('/',auth[_0x9c58('0xa')](),controller[_0x9c58('0xf')]);router[_0x9c58('0x10')](_0x9c58('0x11'),auth[_0x9c58('0xa')](),controller['update']);router[_0x9c58('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9c58('0x13')]);module[_0x9c58('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 d2a183a..25e47b0 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 _0x91cc=['STRING','moment','sequelize','exports','DATE'];(function(_0x5731ec,_0x47096b){var _0x3e43cf=function(_0x152f0c){while(--_0x152f0c){_0x5731ec['push'](_0x5731ec['shift']());}};_0x3e43cf(++_0x47096b);}(_0x91cc,0x128));var _0xc91c=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x91cc[_0x1fc122];return _0xa2cb13;};'use strict';var moment=require(_0xc91c('0x0'));var Sequelize=require(_0xc91c('0x1'));module[_0xc91c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc91c('0x3')]},'acceptAt':{'type':Sequelize[_0xc91c('0x3')]},'exitAt':{'type':Sequelize[_0xc91c('0x3')]},'reason':{'type':Sequelize[_0xc91c('0x4')]}}; \ No newline at end of file +var _0xae1c=['DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae1c,0xff));var _0xcae1=function(_0x9fa734,_0x1b128e){_0x9fa734=_0x9fa734-0x0;var _0x14c91b=_0xae1c[_0x9fa734];return _0x14c91b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcae1('0x0')]},'joinAt':{'type':Sequelize[_0xcae1('0x1')]},'leaveAt':{'type':Sequelize[_0xcae1('0x1')]},'acceptAt':{'type':Sequelize[_0xcae1('0x1')]},'exitAt':{'type':Sequelize[_0xcae1('0x1')]},'reason':{'type':Sequelize[_0xcae1('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e217035..df45511 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 _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','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','apply','reject','save','then','destroy','end','error','name','send','index','map','MailQueueReport','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x43830d,_0x111c8c){var _0xf29995=function(_0x37cabd){while(--_0x37cabd){_0x43830d['push'](_0x43830d['shift']());}};_0xf29995(++_0x111c8c);}(_0xb016,0x159));var _0x6b01=function(_0x5ec12e,_0xd4a136){_0x5ec12e=_0x5ec12e-0x0;var _0x152511=_0xb016[_0x5ec12e];return _0x152511;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':!![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['MailQueueReport'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));}; \ No newline at end of file +var _0xe5af=['length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','catch','params','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe5af,0x9c));var _0xfe5a=function(_0x51d964,_0x2f6bdc){_0x51d964=_0x51d964-0x0;var _0x3e5905=_0xe5af[_0x51d964];return _0x3e5905;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe5a('0x0'));var zipdir=require(_0xfe5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe5a('0x2'));var moment=require(_0xfe5a('0x3'));var BPromise=require(_0xfe5a('0x4'));var Mustache=require('mustache');var util=require(_0xfe5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfe5a('0x6'));var ejs=require(_0xfe5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfe5a('0x8'));var crypto=require(_0xfe5a('0x9'));var jsforce=require(_0xfe5a('0xa'));var deskjs=require(_0xfe5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfe5a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe5a('0xd'));var qs=require(_0xfe5a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe5a('0xf'));var logger=require(_0xfe5a('0x10'))(_0xfe5a('0x11'));var utils=require(_0xfe5a('0x12'));var config=require(_0xfe5a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe5a('0x14'))['db'];function respondWithStatusCode(_0x9d1f4f,_0x20b206){_0x20b206=_0x20b206||0xcc;return function(_0x374ded){if(_0x374ded){return _0x9d1f4f[_0xfe5a('0x15')](_0x20b206);}return _0x9d1f4f['status'](_0x20b206)[_0xfe5a('0x16')]();};}function respondWithResult(_0x17bbbe,_0x42969b){_0x42969b=_0x42969b||0xc8;return function(_0x362115){if(_0x362115){return _0x17bbbe[_0xfe5a('0x17')](_0x42969b)[_0xfe5a('0x18')](_0x362115);}};}function respondWithFilteredResult(_0x375380,_0xeb454){return function(_0x111d4d){if(_0x111d4d){var _0x18c57b=typeof _0xeb454[_0xfe5a('0x19')]===_0xfe5a('0x1a')&&typeof _0xeb454[_0xfe5a('0x1b')]===_0xfe5a('0x1a');var _0x3edcab=_0x111d4d[_0xfe5a('0x1c')];var _0x5bf597=_0x18c57b?0x0:_0xeb454[_0xfe5a('0x19')];var _0x456707=_0x18c57b?_0x111d4d['count']:_0xeb454[_0xfe5a('0x19')]+_0xeb454[_0xfe5a('0x1b')];var _0x39d905;if(_0x456707>=_0x3edcab){_0x456707=_0x3edcab;_0x39d905=0xc8;}else{_0x39d905=0xce;}_0x375380['status'](_0x39d905);return _0x375380['set'](_0xfe5a('0x1d'),_0x5bf597+'-'+_0x456707+'/'+_0x3edcab)[_0xfe5a('0x18')](_0x111d4d);}return null;};}function patchUpdates(_0xded538){return function(_0x3b3022){try{jsonpatch[_0xfe5a('0x1e')](_0x3b3022,_0xded538,!![]);}catch(_0x355869){return BPromise['reject'](_0x355869);}return _0x3b3022[_0xfe5a('0x1f')]();};}function saveUpdates(_0x592521,_0x3dfa57){return function(_0x39d825){if(_0x39d825){return _0x39d825[_0xfe5a('0x20')](_0x592521)['then'](function(_0x4bbef1){return _0x4bbef1;});}return null;};}function removeEntity(_0x247be4,_0x3e55fd){return function(_0x494df3){if(_0x494df3){return _0x494df3[_0xfe5a('0x21')]()[_0xfe5a('0x22')](function(){_0x247be4['status'](0xcc)[_0xfe5a('0x16')]();});}};}function handleEntityNotFound(_0x3a4f3c,_0x31cc60){return function(_0x2b4f1c){if(!_0x2b4f1c){_0x3a4f3c['sendStatus'](0x194);}return _0x2b4f1c;};}function handleError(_0x42136e,_0x2f5d04){_0x2f5d04=_0x2f5d04||0x1f4;return function(_0x24481f){logger[_0xfe5a('0x23')](_0x24481f[_0xfe5a('0x24')]);if(_0x24481f[_0xfe5a('0x25')]){delete _0x24481f[_0xfe5a('0x25')];}_0x42136e[_0xfe5a('0x17')](_0x2f5d04)['send'](_0x24481f);};}exports['index']=function(_0x712b44,_0x485f9d){var _0xc53869={},_0xfcb05b={},_0x11bf97={'count':0x0,'rows':[]};var _0x482a35=_['map'](db['MailQueueReport'][_0xfe5a('0x26')],function(_0x582f2d){return{'name':_0x582f2d['fieldName'],'type':_0x582f2d['type'][_0xfe5a('0x27')]};});_0xfcb05b[_0xfe5a('0x28')]=_[_0xfe5a('0x29')](_0x482a35,_0xfe5a('0x25'));_0xfcb05b[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x712b44[_0xfe5a('0x2a')]);_0xfcb05b[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],_0xfcb05b[_0xfe5a('0x2a')]);_0xc53869['attributes']=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],qs['fields'](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0xc53869[_0xfe5a('0x2f')]=_0xc53869[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0xc53869['attributes']:_0xfcb05b['model'];if(!_0x712b44[_0xfe5a('0x2a')]['hasOwnProperty'](_0xfe5a('0x31'))){_0xc53869[_0xfe5a('0x1b')]=qs[_0xfe5a('0x1b')](_0x712b44[_0xfe5a('0x2a')]['limit']);_0xc53869[_0xfe5a('0x19')]=qs[_0xfe5a('0x19')](_0x712b44[_0xfe5a('0x2a')]['offset']);}_0xc53869[_0xfe5a('0x32')]=qs[_0xfe5a('0x33')](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x33')]);_0xc53869['where']=qs[_0xfe5a('0x2c')](_['pick'](_0x712b44[_0xfe5a('0x2a')],_0xfcb05b[_0xfe5a('0x2c')]),_0x482a35);if(_0x712b44['query'][_0xfe5a('0x34')]){_0xc53869[_0xfe5a('0x35')]=_[_0xfe5a('0x36')](_0xc53869[_0xfe5a('0x35')],{'$or':_['map'](_0x482a35,function(_0x193ce0){if(_0x193ce0[_0xfe5a('0x37')]!==_0xfe5a('0x38')){var _0x560088={};_0x560088[_0x193ce0[_0xfe5a('0x25')]]={'$like':'%'+_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x34')]+'%'};return _0x560088;}})});}_0xc53869=_[_0xfe5a('0x36')]({},_0xc53869,_0x712b44[_0xfe5a('0x39')]);var _0x162c48={'where':_0xc53869[_0xfe5a('0x35')]};return db[_0xfe5a('0x3a')][_0xfe5a('0x1c')](_0x162c48)[_0xfe5a('0x22')](function(_0x20da14){_0x11bf97['count']=_0x20da14;if(_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0xc53869[_0xfe5a('0x3c')]=[{'all':!![]}];}return db[_0xfe5a('0x3a')][_0xfe5a('0x3d')](_0xc53869);})[_0xfe5a('0x22')](function(_0x3475fb){_0x11bf97['rows']=_0x3475fb;return _0x11bf97;})[_0xfe5a('0x22')](respondWithFilteredResult(_0x485f9d,_0xc53869))[_0xfe5a('0x3e')](handleError(_0x485f9d,null));};exports['show']=function(_0x59caa1,_0x252904){var _0x4c17fd={'raw':!![],'where':{'id':_0x59caa1[_0xfe5a('0x3f')]['id']}},_0x54096d={};_0x54096d[_0xfe5a('0x28')]=_['keys'](db[_0xfe5a('0x3a')]['rawAttributes']);_0x54096d[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x59caa1[_0xfe5a('0x2a')]);_0x54096d[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],_0x54096d['query']);_0x4c17fd[_0xfe5a('0x2f')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],qs[_0xfe5a('0x2e')](_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0x4c17fd[_0xfe5a('0x2f')]=_0x4c17fd[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0x4c17fd[_0xfe5a('0x2f')]:_0x54096d[_0xfe5a('0x28')];if(_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0x4c17fd[_0xfe5a('0x3c')]=[{'all':!![]}];}_0x4c17fd=_['merge']({},_0x4c17fd,_0x59caa1[_0xfe5a('0x39')]);return db[_0xfe5a('0x3a')]['find'](_0x4c17fd)['then'](handleEntityNotFound(_0x252904,null))[_0xfe5a('0x22')](respondWithResult(_0x252904,null))[_0xfe5a('0x3e')](handleError(_0x252904,null));};exports[_0xfe5a('0x40')]=function(_0x3ccf98,_0x3cf1b5){return db[_0xfe5a('0x3a')][_0xfe5a('0x40')](_0x3ccf98['body'],{})[_0xfe5a('0x22')](respondWithResult(_0x3cf1b5,0xc9))['catch'](handleError(_0x3cf1b5,null));};exports[_0xfe5a('0x20')]=function(_0x5a807e,_0x433562){if(_0x5a807e[_0xfe5a('0x41')]['id']){delete _0x5a807e[_0xfe5a('0x41')]['id'];}return db[_0xfe5a('0x3a')]['find']({'where':{'id':_0x5a807e[_0xfe5a('0x3f')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x433562,null))['then'](saveUpdates(_0x5a807e[_0xfe5a('0x41')],null))['then'](respondWithResult(_0x433562,null))['catch'](handleError(_0x433562,null));};exports[_0xfe5a('0x21')]=function(_0x4e02c9,_0x374ce5){return db[_0xfe5a('0x3a')][_0xfe5a('0x42')]({'where':{'id':_0x4e02c9[_0xfe5a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x374ce5,null))[_0xfe5a('0x22')](removeEntity(_0x374ce5,null))['catch'](handleError(_0x374ce5,null));};exports[_0xfe5a('0x43')]=function(_0x38409b,_0x149132){return db['MailQueueReport'][_0xfe5a('0x43')]()[_0xfe5a('0x22')](respondWithResult(_0x149132,null))['catch'](handleError(_0x149132,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 01b9694..580728b 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 _0xbdf3=['path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','uniqueid','util','api','moment','bluebird'];(function(_0x23fbf0,_0x505f60){var _0x443648=function(_0x310c10){while(--_0x310c10){_0x23fbf0['push'](_0x23fbf0['shift']());}};_0x443648(++_0x505f60);}(_0xbdf3,0x17d));var _0x3bdf=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xbdf3[_0x215e65];return _0xa85842;};'use strict';var _=require('lodash');var util=require(_0x3bdf('0x0'));var logger=require('../../config/logger')(_0x3bdf('0x1'));var moment=require(_0x3bdf('0x2'));var BPromise=require(_0x3bdf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bdf('0x4'));var rimraf=require(_0x3bdf('0x5'));var config=require(_0x3bdf('0x6'));var attributes=require(_0x3bdf('0x7'));module['exports']=function(_0x1b0d98,_0x1899af){return _0x1b0d98[_0x3bdf('0x8')](_0x3bdf('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x3bdf('0xa'),'fields':[_0x3bdf('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x43d6=['define','report_mail_queue','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes'];(function(_0x543df8,_0x426282){var _0x4becac=function(_0x296512){while(--_0x296512){_0x543df8['push'](_0x543df8['shift']());}};_0x4becac(++_0x426282);}(_0x43d6,0xe9));var _0x643d=function(_0x5bba4d,_0x36c9b2){_0x5bba4d=_0x5bba4d-0x0;var _0x4f51fd=_0x43d6[_0x5bba4d];return _0x4f51fd;};'use strict';var _=require(_0x643d('0x0'));var util=require('util');var logger=require(_0x643d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x643d('0x2'));var rp=require(_0x643d('0x3'));var fs=require('fs');var path=require(_0x643d('0x4'));var rimraf=require(_0x643d('0x5'));var config=require('../../config/environment');var attributes=require(_0x643d('0x6'));module['exports']=function(_0x4a1c3c,_0x364e32){return _0x4a1c3c[_0x643d('0x7')]('MailQueueReport',attributes,{'tableName':_0x643d('0x8'),'paranoid':![],'indexes':[{'name':_0x643d('0x9'),'fields':[_0x643d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 090c962..3c4bdba 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x58f679,_0x11e21e){var _0x578cf7=function(_0x533088){while(--_0x533088){_0x58f679['push'](_0x58f679['shift']());}};_0x578cf7(++_0x11e21e);}(_0xdb28,0x106));var _0x8db2=function(_0x47d2a6,_0x5488fb){_0x47d2a6=_0x47d2a6-0x0;var _0x3dcd0a=_0xdb28[_0x47d2a6];return _0x3dcd0a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ee476,_0x1ddf71){var _0x6757=function(_0x547a11){while(--_0x547a11){_0x5ee476['push'](_0x5ee476['shift']());}};_0x6757(++_0x1ddf71);}(_0x326f,0xd1));var _0xf326=function(_0x24afcc,_0x485be3){_0x24afcc=_0x24afcc-0x0;var _0x4d5180=_0x326f[_0x24afcc];return _0x4d5180;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index d156960..8adeabe 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x55b222,_0x184f18){var _0x2d4aee=function(_0x51fcf0){while(--_0x51fcf0){_0x55b222['push'](_0x55b222['shift']());}};_0x2d4aee(++_0x184f18);}(_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(_0x26e105,_0x821a88){var _0x534f19=function(_0x3cbc79){while(--_0x3cbc79){_0x26e105['push'](_0x26e105['shift']());}};_0x534f19(++_0x821a88);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 26096db..7164d77 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 _0x88fa=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x266bd1,_0x3934e3){var _0x377302=function(_0x578fec){while(--_0x578fec){_0x266bd1['push'](_0x266bd1['shift']());}};_0x377302(++_0x3934e3);}(_0x88fa,0x8a));var _0xa88f=function(_0x1f1cc7,_0x26f365){_0x1f1cc7=_0x1f1cc7-0x0;var _0x5f49e9=_0x88fa[_0x1f1cc7];return _0x5f49e9;};'use strict';var Sequelize=require(_0xa88f('0x0'));module['exports']={'description':{'type':Sequelize[_0xa88f('0x1')]},'host':{'type':Sequelize[_0xa88f('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xa88f('0x1')]},'password':{'type':Sequelize[_0xa88f('0x1')]},'port':{'type':Sequelize[_0xa88f('0x2')]},'tls':{'type':Sequelize[_0xa88f('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa88f('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xa88f('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa88f('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa88f('0x1')]},'modernAuthentication':{'type':Sequelize[_0xa88f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x41ff=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x41ff,0x68));var _0xf41f=function(_0x1e1df4,_0x5be6d7){_0x1e1df4=_0x1e1df4-0x0;var _0x29e7f2=_0x41ff[_0x1e1df4];return _0x29e7f2;};'use strict';var Sequelize=require(_0xf41f('0x0'));module[_0xf41f('0x1')]={'description':{'type':Sequelize[_0xf41f('0x2')]},'host':{'type':Sequelize[_0xf41f('0x2')]},'authentication':{'type':Sequelize[_0xf41f('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf41f('0x2')]},'port':{'type':Sequelize[_0xf41f('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf41f('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf41f('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf41f('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf41f('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 d0ee1a7..1ea2096 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 _0x2975=['request-promise','path','../../config/environment','exports','define','MailServerIn','lodash','util','../../config/logger','bluebird'];(function(_0x1d0dd8,_0x1555c5){var _0x1241b9=function(_0x3e3615){while(--_0x3e3615){_0x1d0dd8['push'](_0x1d0dd8['shift']());}};_0x1241b9(++_0x1555c5);}(_0x2975,0x196));var _0x5297=function(_0x4ba5a5,_0x27d82a){_0x4ba5a5=_0x4ba5a5-0x0;var _0x254ea3=_0x2975[_0x4ba5a5];return _0x254ea3;};'use strict';var _=require(_0x5297('0x0'));var util=require(_0x5297('0x1'));var logger=require(_0x5297('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5297('0x3'));var rp=require(_0x5297('0x4'));var fs=require('fs');var path=require(_0x5297('0x5'));var rimraf=require('rimraf');var config=require(_0x5297('0x6'));var attributes=require('./mailServerIn.attributes');module[_0x5297('0x7')]=function(_0x4ec9bf,_0x1290c2){return _0x4ec9bf[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbcc=['path','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','api','moment','bluebird'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xdbcc,0x1d4));var _0xcdbc=function(_0x121a97,_0x4fb277){_0x121a97=_0x121a97-0x0;var _0x2d16b4=_0xdbcc[_0x121a97];return _0x2d16b4;};'use strict';var _=require('lodash');var util=require(_0xcdbc('0x0'));var logger=require(_0xcdbc('0x1'))(_0xcdbc('0x2'));var moment=require(_0xcdbc('0x3'));var BPromise=require(_0xcdbc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdbc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdbc('0x6'));module[_0xcdbc('0x7')]=function(_0x13be2d,_0x18ebcc){return _0x13be2d[_0xcdbc('0x8')](_0xcdbc('0x9'),attributes,{'tableName':_0xcdbc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index cee6e30..31f8133 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 _0x5eec=['../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','result','MailServerIn','findAll','raw','options','where','attributes','limit','map','include','model','GetMailServerIn','stringify','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x5cb10e,_0x220503){var _0x36a1d5=function(_0x440a23){while(--_0x440a23){_0x5cb10e['push'](_0x5cb10e['shift']());}};_0x36a1d5(++_0x220503);}(_0x5eec,0x11b));var _0xc5ee=function(_0xd381d4,_0x1aaf30){_0xd381d4=_0xd381d4-0x0;var _0x169805=_0x5eec[_0xd381d4];return _0x169805;};'use strict';var _=require(_0xc5ee('0x0'));var util=require('util');var moment=require(_0xc5ee('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5ee('0x3'))['db'];var utils=require(_0xc5ee('0x4'));var logger=require(_0xc5ee('0x5'))('rpc');var config=require(_0xc5ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc5ee('0x7')][_0xc5ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a877f,_0x4fec5d,_0x447d12){return new BPromise(function(_0x43c03a,_0x5add42){return client[_0xc5ee('0x9')](_0x2a877f,_0x447d12)[_0xc5ee('0xa')](function(_0x2ecff5){logger[_0xc5ee('0xb')]('MailServerIn,\x20%s,\x20%s',_0x4fec5d,_0xc5ee('0xc'));logger[_0xc5ee('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4fec5d,_0xc5ee('0xc'),JSON['stringify'](_0x2ecff5));if(_0x2ecff5[_0xc5ee('0xe')]){if(_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0xf')]===0x1f4){logger[_0xc5ee('0xe')](_0xc5ee('0x10'),_0x4fec5d,_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0x11')]);return _0x5add42(_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0x11')]);}logger[_0xc5ee('0xe')](_0xc5ee('0x10'),_0x4fec5d,_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0x11')]);return _0x43c03a(_0x2ecff5['error'][_0xc5ee('0x11')]);}else{logger['info'](_0xc5ee('0x10'),_0x4fec5d,_0xc5ee('0xc'));_0x43c03a(_0x2ecff5[_0xc5ee('0x12')][_0xc5ee('0x11')]);}})['catch'](function(_0x429e27){logger[_0xc5ee('0xe')](_0xc5ee('0x10'),_0x4fec5d,_0x429e27);_0x5add42(_0x429e27);});});}exports['GetMailServerIn']=function(_0x466387){var _0x363c16=this;return new Promise(function(_0x35a4f8,_0x1b244d){return db[_0xc5ee('0x13')][_0xc5ee('0x14')]({'raw':_0x466387['options']?_0x466387['options'][_0xc5ee('0x15')]===undefined?!![]:![]:!![],'where':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')][_0xc5ee('0x17')]||null:null,'attributes':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')][_0xc5ee('0x18')]||null:null,'limit':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')][_0xc5ee('0x19')]||null:null,'include':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')]['include']?_[_0xc5ee('0x1a')](_0x466387[_0xc5ee('0x16')][_0xc5ee('0x1b')],function(_0xa328){return{'model':db[_0xa328['model']],'as':_0xa328['as'],'attributes':_0xa328[_0xc5ee('0x18')],'include':_0xa328['include']?_[_0xc5ee('0x1a')](_0xa328[_0xc5ee('0x1b')],function(_0x59ae89){return{'model':db[_0x59ae89[_0xc5ee('0x1c')]],'as':_0x59ae89['as'],'attributes':_0x59ae89[_0xc5ee('0x18')],'include':_0x59ae89[_0xc5ee('0x1b')]?_[_0xc5ee('0x1a')](_0x59ae89[_0xc5ee('0x1b')],function(_0x1a34a4){return{'model':db[_0x1a34a4[_0xc5ee('0x1c')]],'as':_0x1a34a4['as'],'attributes':_0x1a34a4[_0xc5ee('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52ccaf){logger[_0xc5ee('0xb')](_0xc5ee('0x1d'),_0x466387);logger[_0xc5ee('0xd')]('GetMailServerIn',_0x466387,JSON[_0xc5ee('0x1e')](_0x52ccaf));_0x35a4f8(_0x52ccaf);})[_0xc5ee('0x1f')](function(_0x48c33e){logger['error'](_0xc5ee('0x1d'),_0x48c33e[_0xc5ee('0x11')],_0x466387);_0x1b244d(_0x363c16[_0xc5ee('0xe')](0x1f4,_0x48c33e['message']));});});}; \ No newline at end of file +var _0x74b8=['raw','where','map','include','model','attributes','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','findAll','options'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x74b8,0x86));var _0x874b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x74b8[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x874b('0x0'));var BPromise=require(_0x874b('0x1'));var rs=require(_0x874b('0x2'));var fs=require('fs');var Redis=require(_0x874b('0x3'));var db=require(_0x874b('0x4'))['db'];var utils=require(_0x874b('0x5'));var logger=require(_0x874b('0x6'))(_0x874b('0x7'));var config=require(_0x874b('0x8'));var jayson=require(_0x874b('0x9'));var client=jayson[_0x874b('0xa')][_0x874b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x356933,_0x305917,_0x2c3119){return new BPromise(function(_0x254c8b,_0x22341b){return client['request'](_0x356933,_0x2c3119)[_0x874b('0xc')](function(_0x2dc006){logger[_0x874b('0xd')](_0x874b('0xe'),_0x305917,_0x874b('0xf'));logger[_0x874b('0x10')](_0x874b('0x11'),_0x305917,'request\x20sent',JSON[_0x874b('0x12')](_0x2dc006));if(_0x2dc006[_0x874b('0x13')]){if(_0x2dc006[_0x874b('0x13')][_0x874b('0x14')]===0x1f4){logger['error'](_0x874b('0xe'),_0x305917,_0x2dc006[_0x874b('0x13')][_0x874b('0x15')]);return _0x22341b(_0x2dc006[_0x874b('0x13')]['message']);}logger[_0x874b('0x13')](_0x874b('0xe'),_0x305917,_0x2dc006[_0x874b('0x13')][_0x874b('0x15')]);return _0x254c8b(_0x2dc006[_0x874b('0x13')]['message']);}else{logger[_0x874b('0xd')](_0x874b('0xe'),_0x305917,_0x874b('0xf'));_0x254c8b(_0x2dc006['result'][_0x874b('0x15')]);}})[_0x874b('0x16')](function(_0x49c787){logger[_0x874b('0x13')](_0x874b('0xe'),_0x305917,_0x49c787);_0x22341b(_0x49c787);});});}exports[_0x874b('0x17')]=function(_0x27d943){var _0x4c2ffb=this;return new Promise(function(_0x14ad57,_0x4859e5){return db['MailServerIn'][_0x874b('0x18')]({'raw':_0x27d943[_0x874b('0x19')]?_0x27d943[_0x874b('0x19')][_0x874b('0x1a')]===undefined?!![]:![]:!![],'where':_0x27d943[_0x874b('0x19')]?_0x27d943[_0x874b('0x19')][_0x874b('0x1b')]||null:null,'attributes':_0x27d943['options']?_0x27d943[_0x874b('0x19')]['attributes']||null:null,'limit':_0x27d943['options']?_0x27d943[_0x874b('0x19')]['limit']||null:null,'include':_0x27d943[_0x874b('0x19')]?_0x27d943[_0x874b('0x19')]['include']?_[_0x874b('0x1c')](_0x27d943[_0x874b('0x19')][_0x874b('0x1d')],function(_0x28dfb6){return{'model':db[_0x28dfb6[_0x874b('0x1e')]],'as':_0x28dfb6['as'],'attributes':_0x28dfb6[_0x874b('0x1f')],'include':_0x28dfb6[_0x874b('0x1d')]?_[_0x874b('0x1c')](_0x28dfb6[_0x874b('0x1d')],function(_0x5bcb28){return{'model':db[_0x5bcb28[_0x874b('0x1e')]],'as':_0x5bcb28['as'],'attributes':_0x5bcb28['attributes'],'include':_0x5bcb28[_0x874b('0x1d')]?_[_0x874b('0x1c')](_0x5bcb28[_0x874b('0x1d')],function(_0x4f8d74){return{'model':db[_0x4f8d74['model']],'as':_0x4f8d74['as'],'attributes':_0x4f8d74[_0x874b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14c612){logger[_0x874b('0xd')](_0x874b('0x17'),_0x27d943);logger[_0x874b('0x10')](_0x874b('0x17'),_0x27d943,JSON[_0x874b('0x12')](_0x14c612));_0x14ad57(_0x14c612);})[_0x874b('0x16')](function(_0xc87f74){logger[_0x874b('0x13')](_0x874b('0x17'),_0xc87f74[_0x874b('0x15')],_0x27d943);_0x4859e5(_0x4c2ffb[_0x874b('0x13')](0x1f4,_0xc87f74[_0x874b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 18b8773..22b186b 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7a54,0x106));var _0x47a5=function(_0x43e0af,_0x330303){_0x43e0af=_0x43e0af-0x0;var _0x265ce0=_0x7a54[_0x43e0af];return _0x265ce0;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a54,0x106));var _0x47a5=function(_0x485554,_0x202e73){_0x485554=_0x485554-0x0;var _0x25ec74=_0x7a54[_0x485554];return _0x25ec74;};'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 67d7c0f..c10aef9 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 _0x6cb4=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x221f59,_0x49c62f){var _0x1538b1=function(_0x57a86f){while(--_0x57a86f){_0x221f59['push'](_0x221f59['shift']());}};_0x1538b1(++_0x49c62f);}(_0x6cb4,0xff));var _0x46cb=function(_0x789464,_0x33a950){_0x789464=_0x789464-0x0;var _0x2f31ec=_0x6cb4[_0x789464];return _0x2f31ec;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'description':{'type':Sequelize[_0x46cb('0x2')]},'host':{'type':Sequelize[_0x46cb('0x2')]},'user':{'type':Sequelize[_0x46cb('0x2')]},'pass':{'type':Sequelize[_0x46cb('0x2')]},'port':{'type':Sequelize[_0x46cb('0x3')]},'secure':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x46cb('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x69d3=['exports','STRING','sequelize'];(function(_0x3111ca,_0x4258a0){var _0x2c8bf5=function(_0x57024f){while(--_0x57024f){_0x3111ca['push'](_0x3111ca['shift']());}};_0x2c8bf5(++_0x4258a0);}(_0x69d3,0xda));var _0x369d=function(_0x316bea,_0x99a1b){_0x316bea=_0x316bea-0x0;var _0x501d3f=_0x69d3[_0x316bea];return _0x501d3f;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'description':{'type':Sequelize[_0x369d('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x369d('0x2')]},'pass':{'type':Sequelize[_0x369d('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x369d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'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 9d0824e..89d25ed 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 _0x6a85=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','map','MailServerOut','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x342f6d,_0x3ee317){var _0x3d316c=function(_0x2affaa){while(--_0x2affaa){_0x342f6d['push'](_0x342f6d['shift']());}};_0x3d316c(++_0x3ee317);}(_0x6a85,0x1c2));var _0x56a8=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x6a85[_0x59bcb1];return _0x4a737f;};'use strict';var emlformat=require(_0x56a8('0x0'));var rimraf=require(_0x56a8('0x1'));var zipdir=require(_0x56a8('0x2'));var jsonpatch=require(_0x56a8('0x3'));var rp=require(_0x56a8('0x4'));var moment=require(_0x56a8('0x5'));var BPromise=require(_0x56a8('0x6'));var Mustache=require(_0x56a8('0x7'));var util=require(_0x56a8('0x8'));var path=require(_0x56a8('0x9'));var sox=require(_0x56a8('0xa'));var csv=require(_0x56a8('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56a8('0xc'));var _=require(_0x56a8('0xd'));var squel=require(_0x56a8('0xe'));var crypto=require(_0x56a8('0xf'));var jsforce=require(_0x56a8('0x10'));var deskjs=require(_0x56a8('0x11'));var toCsv=require(_0x56a8('0xb'));var querystring=require(_0x56a8('0x12'));var Papa=require(_0x56a8('0x13'));var Redis=require(_0x56a8('0x14'));var authService=require(_0x56a8('0x15'));var qs=require(_0x56a8('0x16'));var as=require(_0x56a8('0x17'));var hardwareService=require(_0x56a8('0x18'));var logger=require(_0x56a8('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x56a8('0x1a'));var licenseUtil=require(_0x56a8('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fe269,_0xb77d8c){_0xb77d8c=_0xb77d8c||0xcc;return function(_0x40a129){if(_0x40a129){return _0x3fe269[_0x56a8('0x1c')](_0xb77d8c);}return _0x3fe269['status'](_0xb77d8c)[_0x56a8('0x1d')]();};}function respondWithResult(_0x58e30c,_0x32b048){_0x32b048=_0x32b048||0xc8;return function(_0x8b93ad){if(_0x8b93ad){return _0x58e30c[_0x56a8('0x1e')](_0x32b048)[_0x56a8('0x1f')](_0x8b93ad);}};}function respondWithFilteredResult(_0x2a071e,_0xd56fac){return function(_0x1dd710){if(_0x1dd710){var _0x42722c=typeof _0xd56fac[_0x56a8('0x20')]===_0x56a8('0x21')&&typeof _0xd56fac[_0x56a8('0x22')]===_0x56a8('0x21');var _0x47b43a=_0x1dd710[_0x56a8('0x23')];var _0x4f189d=_0x42722c?0x0:_0xd56fac['offset'];var _0x5a655c=_0x42722c?_0x1dd710[_0x56a8('0x23')]:_0xd56fac[_0x56a8('0x20')]+_0xd56fac[_0x56a8('0x22')];var _0xc64680;if(_0x5a655c>=_0x47b43a){_0x5a655c=_0x47b43a;_0xc64680=0xc8;}else{_0xc64680=0xce;}_0x2a071e[_0x56a8('0x1e')](_0xc64680);return _0x2a071e[_0x56a8('0x24')](_0x56a8('0x25'),_0x4f189d+'-'+_0x5a655c+'/'+_0x47b43a)[_0x56a8('0x1f')](_0x1dd710);}return null;};}function patchUpdates(_0x4daba7){return function(_0xa95682){try{jsonpatch[_0x56a8('0x26')](_0xa95682,_0x4daba7,!![]);}catch(_0x2823f9){return BPromise['reject'](_0x2823f9);}return _0xa95682[_0x56a8('0x27')]();};}function saveUpdates(_0x35ed8f,_0x18a2ed){return function(_0x2489bd){if(_0x2489bd){return _0x2489bd[_0x56a8('0x28')](_0x35ed8f)['then'](function(_0x3f0f0e){return _0x3f0f0e;});}return null;};}function removeEntity(_0x8f42bc,_0x523b54){return function(_0x1624d2){if(_0x1624d2){return _0x1624d2[_0x56a8('0x29')]()[_0x56a8('0x2a')](function(){_0x8f42bc[_0x56a8('0x1e')](0xcc)[_0x56a8('0x1d')]();});}};}function handleEntityNotFound(_0x459a1b,_0x3eb832){return function(_0x3ffe95){if(!_0x3ffe95){_0x459a1b[_0x56a8('0x1c')](0x194);}return _0x3ffe95;};}function handleError(_0x4f0eec,_0x5d1913){_0x5d1913=_0x5d1913||0x1f4;return function(_0x4e7c40){logger[_0x56a8('0x2b')](_0x4e7c40['stack']);if(_0x4e7c40[_0x56a8('0x2c')]){delete _0x4e7c40[_0x56a8('0x2c')];}_0x4f0eec['status'](_0x5d1913)[_0x56a8('0x2d')](_0x4e7c40);};}exports[_0x56a8('0x2e')]=function(_0x2e0923,_0x390792){var _0x31cbcc={},_0x29be77={},_0x6e34e4={'count':0x0,'rows':[]};var _0x19851d=_[_0x56a8('0x2f')](db[_0x56a8('0x30')][_0x56a8('0x31')],function(_0xa58785){return{'name':_0xa58785['fieldName'],'type':_0xa58785[_0x56a8('0x32')][_0x56a8('0x33')]};});_0x29be77['model']=_[_0x56a8('0x2f')](_0x19851d,_0x56a8('0x2c'));_0x29be77[_0x56a8('0x34')]=_[_0x56a8('0x35')](_0x2e0923[_0x56a8('0x34')]);_0x29be77[_0x56a8('0x36')]=_['intersection'](_0x29be77['model'],_0x29be77[_0x56a8('0x34')]);_0x31cbcc[_0x56a8('0x37')]=_[_0x56a8('0x38')](_0x29be77[_0x56a8('0x39')],qs['fields'](_0x2e0923[_0x56a8('0x34')]['fields']));_0x31cbcc[_0x56a8('0x37')]=_0x31cbcc[_0x56a8('0x37')][_0x56a8('0x3a')]?_0x31cbcc[_0x56a8('0x37')]:_0x29be77[_0x56a8('0x39')];if(!_0x2e0923[_0x56a8('0x34')]['hasOwnProperty'](_0x56a8('0x3b'))){_0x31cbcc[_0x56a8('0x22')]=qs['limit'](_0x2e0923[_0x56a8('0x34')][_0x56a8('0x22')]);_0x31cbcc[_0x56a8('0x20')]=qs[_0x56a8('0x20')](_0x2e0923[_0x56a8('0x34')][_0x56a8('0x20')]);}_0x31cbcc[_0x56a8('0x3c')]=qs['sort'](_0x2e0923[_0x56a8('0x34')][_0x56a8('0x3d')]);_0x31cbcc[_0x56a8('0x3e')]=qs[_0x56a8('0x36')](_[_0x56a8('0x3f')](_0x2e0923['query'],_0x29be77[_0x56a8('0x36')]),_0x19851d);if(_0x2e0923['query']['filter']){_0x31cbcc[_0x56a8('0x3e')]=_[_0x56a8('0x40')](_0x31cbcc[_0x56a8('0x3e')],{'$or':_[_0x56a8('0x2f')](_0x19851d,function(_0x2c9dc4){if(_0x2c9dc4[_0x56a8('0x32')]!==_0x56a8('0x41')){var _0x2d5b39={};_0x2d5b39[_0x2c9dc4['name']]={'$like':'%'+_0x2e0923[_0x56a8('0x34')][_0x56a8('0x42')]+'%'};return _0x2d5b39;}})});}_0x31cbcc=_[_0x56a8('0x40')]({},_0x31cbcc,_0x2e0923[_0x56a8('0x43')]);var _0x50061c={'where':_0x31cbcc['where']};return db[_0x56a8('0x30')]['count'](_0x50061c)[_0x56a8('0x2a')](function(_0x55f36f){_0x6e34e4['count']=_0x55f36f;if(_0x2e0923[_0x56a8('0x34')][_0x56a8('0x44')]){_0x31cbcc[_0x56a8('0x45')]=[{'all':!![]}];}return db[_0x56a8('0x30')][_0x56a8('0x46')](_0x31cbcc);})[_0x56a8('0x2a')](function(_0x58b363){_0x6e34e4[_0x56a8('0x47')]=_0x58b363;return _0x6e34e4;})[_0x56a8('0x2a')](respondWithFilteredResult(_0x390792,_0x31cbcc))[_0x56a8('0x48')](handleError(_0x390792,null));};exports[_0x56a8('0x49')]=function(_0x15f647,_0x56e6f7){var _0x5344a4={'raw':!![],'where':{'id':_0x15f647[_0x56a8('0x4a')]['id']}},_0x5b5b3d={};_0x5b5b3d[_0x56a8('0x39')]=_['keys'](db[_0x56a8('0x30')]['rawAttributes']);_0x5b5b3d['query']=_['keys'](_0x15f647[_0x56a8('0x34')]);_0x5b5b3d[_0x56a8('0x36')]=_[_0x56a8('0x38')](_0x5b5b3d[_0x56a8('0x39')],_0x5b5b3d[_0x56a8('0x34')]);_0x5344a4[_0x56a8('0x37')]=_[_0x56a8('0x38')](_0x5b5b3d['model'],qs['fields'](_0x15f647['query'][_0x56a8('0x4b')]));_0x5344a4['attributes']=_0x5344a4[_0x56a8('0x37')][_0x56a8('0x3a')]?_0x5344a4[_0x56a8('0x37')]:_0x5b5b3d['model'];if(_0x15f647[_0x56a8('0x34')][_0x56a8('0x44')]){_0x5344a4[_0x56a8('0x45')]=[{'all':!![]}];}_0x5344a4=_[_0x56a8('0x40')]({},_0x5344a4,_0x15f647[_0x56a8('0x43')]);return db['MailServerOut'][_0x56a8('0x4c')](_0x5344a4)[_0x56a8('0x2a')](handleEntityNotFound(_0x56e6f7,null))[_0x56a8('0x2a')](respondWithResult(_0x56e6f7,null))[_0x56a8('0x48')](handleError(_0x56e6f7,null));};exports['create']=function(_0x1e23c2,_0x377c2a){return db[_0x56a8('0x30')][_0x56a8('0x4d')](_0x1e23c2['body'],{})['then'](respondWithResult(_0x377c2a,0xc9))[_0x56a8('0x48')](handleError(_0x377c2a,null));};exports[_0x56a8('0x28')]=function(_0x1096b8,_0x517333){if(_0x1096b8['body']['id']){delete _0x1096b8[_0x56a8('0x4e')]['id'];}return db[_0x56a8('0x30')][_0x56a8('0x4c')]({'where':{'id':_0x1096b8[_0x56a8('0x4a')]['id']}})[_0x56a8('0x2a')](handleEntityNotFound(_0x517333,null))['then'](saveUpdates(_0x1096b8['body'],null))['then'](respondWithResult(_0x517333,null))[_0x56a8('0x48')](handleError(_0x517333,null));};exports[_0x56a8('0x29')]=function(_0x495623,_0x5797c0){return db['MailServerOut'][_0x56a8('0x4c')]({'where':{'id':_0x495623[_0x56a8('0x4a')]['id']}})[_0x56a8('0x2a')](handleEntityNotFound(_0x5797c0,null))[_0x56a8('0x2a')](removeEntity(_0x5797c0,null))['catch'](handleError(_0x5797c0,null));}; \ No newline at end of file +var _0xaab5=['intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','params','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','undefined','limit','count','offset','status','Content-Range','apply','save','update','destroy','error','send','MailServerOut','rawAttributes','fieldName','type','key','model','map','name','query','keys','attributes'];(function(_0xf3f0cc,_0x5a6ff3){var _0x30935a=function(_0x180114){while(--_0x180114){_0xf3f0cc['push'](_0xf3f0cc['shift']());}};_0x30935a(++_0x5a6ff3);}(_0xaab5,0x1d4));var _0x5aab=function(_0xd81555,_0x436e83){_0xd81555=_0xd81555-0x0;var _0x144c9f=_0xaab5[_0xd81555];return _0x144c9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5aab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5aab('0x1'));var rp=require(_0x5aab('0x2'));var moment=require(_0x5aab('0x3'));var BPromise=require(_0x5aab('0x4'));var Mustache=require('mustache');var util=require(_0x5aab('0x5'));var path=require(_0x5aab('0x6'));var sox=require(_0x5aab('0x7'));var csv=require(_0x5aab('0x8'));var ejs=require(_0x5aab('0x9'));var fs=require('fs');var fs_extra=require(_0x5aab('0xa'));var _=require('lodash');var squel=require(_0x5aab('0xb'));var crypto=require(_0x5aab('0xc'));var jsforce=require(_0x5aab('0xd'));var deskjs=require(_0x5aab('0xe'));var toCsv=require(_0x5aab('0x8'));var querystring=require('querystring');var Papa=require(_0x5aab('0xf'));var Redis=require(_0x5aab('0x10'));var authService=require(_0x5aab('0x11'));var qs=require(_0x5aab('0x12'));var as=require(_0x5aab('0x13'));var hardwareService=require(_0x5aab('0x14'));var logger=require(_0x5aab('0x15'))('api');var utils=require(_0x5aab('0x16'));var config=require(_0x5aab('0x17'));var licenseUtil=require(_0x5aab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45d174,_0x5458ea){_0x5458ea=_0x5458ea||0xcc;return function(_0x2bc5a0){if(_0x2bc5a0){return _0x45d174[_0x5aab('0x19')](_0x5458ea);}return _0x45d174['status'](_0x5458ea)['end']();};}function respondWithResult(_0x21c24b,_0x21e75){_0x21e75=_0x21e75||0xc8;return function(_0x4589ec){if(_0x4589ec){return _0x21c24b['status'](_0x21e75)[_0x5aab('0x1a')](_0x4589ec);}};}function respondWithFilteredResult(_0x77dc54,_0x3d0e94){return function(_0x1ed308){if(_0x1ed308){var _0x716ac9=typeof _0x3d0e94['offset']===_0x5aab('0x1b')&&typeof _0x3d0e94[_0x5aab('0x1c')]==='undefined';var _0x57cdb2=_0x1ed308[_0x5aab('0x1d')];var _0x5b8b26=_0x716ac9?0x0:_0x3d0e94[_0x5aab('0x1e')];var _0x7cc984=_0x716ac9?_0x1ed308['count']:_0x3d0e94[_0x5aab('0x1e')]+_0x3d0e94['limit'];var _0x41c345;if(_0x7cc984>=_0x57cdb2){_0x7cc984=_0x57cdb2;_0x41c345=0xc8;}else{_0x41c345=0xce;}_0x77dc54[_0x5aab('0x1f')](_0x41c345);return _0x77dc54['set'](_0x5aab('0x20'),_0x5b8b26+'-'+_0x7cc984+'/'+_0x57cdb2)[_0x5aab('0x1a')](_0x1ed308);}return null;};}function patchUpdates(_0x1be5ba){return function(_0x599be0){try{jsonpatch[_0x5aab('0x21')](_0x599be0,_0x1be5ba,!![]);}catch(_0x2a790a){return BPromise['reject'](_0x2a790a);}return _0x599be0[_0x5aab('0x22')]();};}function saveUpdates(_0x541175,_0x1f4872){return function(_0x26747b){if(_0x26747b){return _0x26747b[_0x5aab('0x23')](_0x541175)['then'](function(_0x4e0fb8){return _0x4e0fb8;});}return null;};}function removeEntity(_0x425afb,_0x4eb2b3){return function(_0x1b461e){if(_0x1b461e){return _0x1b461e[_0x5aab('0x24')]()['then'](function(){_0x425afb[_0x5aab('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523c78,_0x3a2af0){return function(_0xea8b28){if(!_0xea8b28){_0x523c78['sendStatus'](0x194);}return _0xea8b28;};}function handleError(_0x5e056b,_0x159533){_0x159533=_0x159533||0x1f4;return function(_0x1b9fb2){logger[_0x5aab('0x25')](_0x1b9fb2['stack']);if(_0x1b9fb2['name']){delete _0x1b9fb2['name'];}_0x5e056b['status'](_0x159533)[_0x5aab('0x26')](_0x1b9fb2);};}exports['index']=function(_0x2161db,_0x129ccd){var _0x5bf22a={},_0x56884b={},_0x4345e8={'count':0x0,'rows':[]};var _0x1ec544=_['map'](db[_0x5aab('0x27')][_0x5aab('0x28')],function(_0x581db7){return{'name':_0x581db7[_0x5aab('0x29')],'type':_0x581db7[_0x5aab('0x2a')][_0x5aab('0x2b')]};});_0x56884b[_0x5aab('0x2c')]=_[_0x5aab('0x2d')](_0x1ec544,_0x5aab('0x2e'));_0x56884b[_0x5aab('0x2f')]=_[_0x5aab('0x30')](_0x2161db[_0x5aab('0x2f')]);_0x56884b['filters']=_['intersection'](_0x56884b[_0x5aab('0x2c')],_0x56884b['query']);_0x5bf22a[_0x5aab('0x31')]=_[_0x5aab('0x32')](_0x56884b[_0x5aab('0x2c')],qs['fields'](_0x2161db[_0x5aab('0x2f')][_0x5aab('0x33')]));_0x5bf22a[_0x5aab('0x31')]=_0x5bf22a['attributes']['length']?_0x5bf22a[_0x5aab('0x31')]:_0x56884b[_0x5aab('0x2c')];if(!_0x2161db['query'][_0x5aab('0x34')](_0x5aab('0x35'))){_0x5bf22a[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x2161db['query']['limit']);_0x5bf22a['offset']=qs['offset'](_0x2161db[_0x5aab('0x2f')][_0x5aab('0x1e')]);}_0x5bf22a[_0x5aab('0x36')]=qs['sort'](_0x2161db['query'][_0x5aab('0x37')]);_0x5bf22a[_0x5aab('0x38')]=qs[_0x5aab('0x39')](_['pick'](_0x2161db['query'],_0x56884b[_0x5aab('0x39')]),_0x1ec544);if(_0x2161db[_0x5aab('0x2f')][_0x5aab('0x3a')]){_0x5bf22a[_0x5aab('0x38')]=_[_0x5aab('0x3b')](_0x5bf22a[_0x5aab('0x38')],{'$or':_['map'](_0x1ec544,function(_0x269f9d){if(_0x269f9d['type']!==_0x5aab('0x3c')){var _0x96b80e={};_0x96b80e[_0x269f9d[_0x5aab('0x2e')]]={'$like':'%'+_0x2161db[_0x5aab('0x2f')]['filter']+'%'};return _0x96b80e;}})});}_0x5bf22a=_[_0x5aab('0x3b')]({},_0x5bf22a,_0x2161db[_0x5aab('0x3d')]);var _0x55b6ab={'where':_0x5bf22a[_0x5aab('0x38')]};return db[_0x5aab('0x27')][_0x5aab('0x1d')](_0x55b6ab)['then'](function(_0x26232f){_0x4345e8[_0x5aab('0x1d')]=_0x26232f;if(_0x2161db['query'][_0x5aab('0x3e')]){_0x5bf22a[_0x5aab('0x3f')]=[{'all':!![]}];}return db[_0x5aab('0x27')][_0x5aab('0x40')](_0x5bf22a);})['then'](function(_0x207e8b){_0x4345e8[_0x5aab('0x41')]=_0x207e8b;return _0x4345e8;})[_0x5aab('0x42')](respondWithFilteredResult(_0x129ccd,_0x5bf22a))[_0x5aab('0x43')](handleError(_0x129ccd,null));};exports[_0x5aab('0x44')]=function(_0x195961,_0x23aae1){var _0x17fda2={'raw':!![],'where':{'id':_0x195961[_0x5aab('0x45')]['id']}},_0x3be389={};_0x3be389[_0x5aab('0x2c')]=_['keys'](db[_0x5aab('0x27')][_0x5aab('0x28')]);_0x3be389[_0x5aab('0x2f')]=_[_0x5aab('0x30')](_0x195961[_0x5aab('0x2f')]);_0x3be389[_0x5aab('0x39')]=_[_0x5aab('0x32')](_0x3be389[_0x5aab('0x2c')],_0x3be389[_0x5aab('0x2f')]);_0x17fda2['attributes']=_['intersection'](_0x3be389[_0x5aab('0x2c')],qs[_0x5aab('0x33')](_0x195961[_0x5aab('0x2f')][_0x5aab('0x33')]));_0x17fda2['attributes']=_0x17fda2[_0x5aab('0x31')][_0x5aab('0x46')]?_0x17fda2[_0x5aab('0x31')]:_0x3be389['model'];if(_0x195961['query'][_0x5aab('0x3e')]){_0x17fda2[_0x5aab('0x3f')]=[{'all':!![]}];}_0x17fda2=_['merge']({},_0x17fda2,_0x195961[_0x5aab('0x3d')]);return db[_0x5aab('0x27')][_0x5aab('0x47')](_0x17fda2)['then'](handleEntityNotFound(_0x23aae1,null))[_0x5aab('0x42')](respondWithResult(_0x23aae1,null))['catch'](handleError(_0x23aae1,null));};exports[_0x5aab('0x48')]=function(_0x2034d1,_0xda668b){return db[_0x5aab('0x27')]['create'](_0x2034d1[_0x5aab('0x49')],{})[_0x5aab('0x42')](respondWithResult(_0xda668b,0xc9))[_0x5aab('0x43')](handleError(_0xda668b,null));};exports[_0x5aab('0x23')]=function(_0x2f628a,_0x31c13c){if(_0x2f628a[_0x5aab('0x49')]['id']){delete _0x2f628a[_0x5aab('0x49')]['id'];}return db[_0x5aab('0x27')][_0x5aab('0x47')]({'where':{'id':_0x2f628a[_0x5aab('0x45')]['id']}})['then'](handleEntityNotFound(_0x31c13c,null))['then'](saveUpdates(_0x2f628a[_0x5aab('0x49')],null))[_0x5aab('0x42')](respondWithResult(_0x31c13c,null))[_0x5aab('0x43')](handleError(_0x31c13c,null));};exports['destroy']=function(_0x5104ef,_0x99cc1f){return db['MailServerOut'][_0x5aab('0x47')]({'where':{'id':_0x5104ef['params']['id']}})['then'](handleEntityNotFound(_0x99cc1f,null))[_0x5aab('0x42')](removeEntity(_0x99cc1f,null))['catch'](handleError(_0x99cc1f,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 03d2454..a90be76 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 _0x7174=['bluebird','path','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api'];(function(_0x529db5,_0x1f30a3){var _0xfce542=function(_0x149ed1){while(--_0x149ed1){_0x529db5['push'](_0x529db5['shift']());}};_0xfce542(++_0x1f30a3);}(_0x7174,0x19f));var _0x4717=function(_0x5d865c,_0x1bac54){_0x5d865c=_0x5d865c-0x0;var _0x59439d=_0x7174[_0x5d865c];return _0x59439d;};'use strict';var _=require(_0x4717('0x0'));var util=require('util');var logger=require(_0x4717('0x1'))(_0x4717('0x2'));var moment=require('moment');var BPromise=require(_0x4717('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4717('0x4'));var rimraf=require(_0x4717('0x5'));var config=require(_0x4717('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x4717('0x7')]=function(_0x5f0d2d,_0x170f6c){return _0x5f0d2d[_0x4717('0x8')](_0x4717('0x9'),attributes,{'tableName':_0x4717('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e57=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger'];(function(_0x3a6b02,_0x589d4d){var _0x5acb58=function(_0x20bea4){while(--_0x20bea4){_0x3a6b02['push'](_0x3a6b02['shift']());}};_0x5acb58(++_0x589d4d);}(_0x7e57,0xa5));var _0x77e5=function(_0x3bf278,_0x5d4aa9){_0x3bf278=_0x3bf278-0x0;var _0x4789da=_0x7e57[_0x3bf278];return _0x4789da;};'use strict';var _=require(_0x77e5('0x0'));var util=require(_0x77e5('0x1'));var logger=require(_0x77e5('0x2'))(_0x77e5('0x3'));var moment=require(_0x77e5('0x4'));var BPromise=require(_0x77e5('0x5'));var rp=require(_0x77e5('0x6'));var fs=require('fs');var path=require(_0x77e5('0x7'));var rimraf=require(_0x77e5('0x8'));var config=require(_0x77e5('0x9'));var attributes=require(_0x77e5('0xa'));module[_0x77e5('0xb')]=function(_0x488f12,_0x167461){return _0x488f12[_0x77e5('0xc')](_0x77e5('0xd'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index d10e03c..4d2c0bf 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(_0x1c3c19,_0x1e3700){var _0x1f2612=function(_0x14af0c){while(--_0x14af0c){_0x1c3c19['push'](_0x1c3c19['shift']());}};_0x1f2612(++_0x1e3700);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x25d0ce,_0x5d2896){var _0x4304b7=function(_0x8419ef){while(--_0x8419ef){_0x25d0ce['push'](_0x25d0ce['shift']());}};_0x4304b7(++_0x5d2896);}(_0x1261,0x144));var _0x1126=function(_0x251fde,_0x384469){_0x251fde=_0x251fde-0x0;var _0x350af6=_0x1261[_0x251fde];return _0x350af6;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 5a265fc..218e5e5 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 _0xb167=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2ccd37,_0x525695){var _0x20b408=function(_0x5ba8fe){while(--_0x5ba8fe){_0x2ccd37['push'](_0x2ccd37['shift']());}};_0x20b408(++_0x525695);}(_0xb167,0x10b));var _0x7b16=function(_0x343e76,_0x5593cb){_0x343e76=_0x343e76-0x0;var _0x47537f=_0xb167[_0x343e76];return _0x47537f;};'use strict';var multer=require(_0x7b16('0x0'));var util=require(_0x7b16('0x1'));var path=require(_0x7b16('0x2'));var timeout=require(_0x7b16('0x3'));var express=require('express');var router=express[_0x7b16('0x4')]();var fs_extra=require(_0x7b16('0x5'));var auth=require(_0x7b16('0x6'));var interaction=require(_0x7b16('0x7'));var config=require(_0x7b16('0x8'));var controller=require(_0x7b16('0x9'));router[_0x7b16('0xa')]('/',auth['isAuthenticated'](),controller[_0x7b16('0xb')]);router[_0x7b16('0xa')]('/describe',auth[_0x7b16('0xc')](),controller['describe']);router['get'](_0x7b16('0xd'),auth['isAuthenticated'](),controller[_0x7b16('0xe')]);router['post']('/',auth[_0x7b16('0xc')](),controller[_0x7b16('0xf')]);router[_0x7b16('0x10')](_0x7b16('0xd'),auth['isAuthenticated'](),controller[_0x7b16('0x11')]);router[_0x7b16('0x12')](_0x7b16('0xd'),auth[_0x7b16('0xc')](),controller[_0x7b16('0x13')]);module[_0x7b16('0x14')]=router; \ No newline at end of file +var _0x262d=['update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x50d80b,_0x2ab639){var _0x527039=function(_0x310a58){while(--_0x310a58){_0x50d80b['push'](_0x50d80b['shift']());}};_0x527039(++_0x2ab639);}(_0x262d,0x10c));var _0xd262=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x262d[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0xd262('0x0'));var util=require(_0xd262('0x1'));var path=require(_0xd262('0x2'));var timeout=require(_0xd262('0x3'));var express=require(_0xd262('0x4'));var router=express[_0xd262('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd262('0x6'));var config=require(_0xd262('0x7'));var controller=require(_0xd262('0x8'));router[_0xd262('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xd262('0xa')](),controller[_0xd262('0xb')]);router[_0xd262('0x9')](_0xd262('0xc'),auth[_0xd262('0xa')](),controller[_0xd262('0xd')]);router[_0xd262('0xe')]('/',auth[_0xd262('0xa')](),controller[_0xd262('0xf')]);router[_0xd262('0x10')](_0xd262('0xc'),auth['isAuthenticated'](),controller[_0xd262('0x11')]);router[_0xd262('0x12')](_0xd262('0xc'),auth[_0xd262('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index c1c4002..7199e5b 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 _0x6b8f=['exports','name'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x4b5a5d,_0x37d75e){_0x4b5a5d=_0x4b5a5d-0x0;var _0x55a380=_0x6b8f[_0x4b5a5d];return _0x55a380;};'use strict';var Sequelize=require('sequelize');module[_0xf6b8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6b8('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6f44=['name','STRING','sequelize','exports'];(function(_0x2d1e1e,_0x57724a){var _0x8d81ae=function(_0xc45770){while(--_0xc45770){_0x2d1e1e['push'](_0x2d1e1e['shift']());}};_0x8d81ae(++_0x57724a);}(_0x6f44,0x1ea));var _0x46f4=function(_0x1140db,_0x3ef85e){_0x1140db=_0x1140db-0x0;var _0x53234a=_0x6f44[_0x1140db];return _0x53234a;};'use strict';var Sequelize=require(_0x46f4('0x0'));module[_0x46f4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x46f4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x46f4('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index b3a2d4a..41919ba 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 _0x25db=['then','sendStatus','stack','name','send','map','MailSubstatus','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','rows','catch','show','includeAll','include','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/environment','status','end','json','offset','undefined','count','limit','set','apply','reject','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25db,0xa4));var _0xb25d=function(_0xdd21de,_0x4a9635){_0xdd21de=_0xdd21de-0x0;var _0x10f0ef=_0x25db[_0xdd21de];return _0x10f0ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb25d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb25d('0x1'));var rp=require(_0xb25d('0x2'));var moment=require(_0xb25d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb25d('0x4'));var path=require(_0xb25d('0x5'));var sox=require(_0xb25d('0x6'));var csv=require(_0xb25d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb25d('0x8'));var squel=require('squel');var crypto=require(_0xb25d('0x9'));var jsforce=require(_0xb25d('0xa'));var deskjs=require(_0xb25d('0xb'));var toCsv=require(_0xb25d('0x7'));var querystring=require(_0xb25d('0xc'));var Papa=require('papaparse');var Redis=require(_0xb25d('0xd'));var authService=require(_0xb25d('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb25d('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xb25d('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbb737b,_0x7f7c7a){_0x7f7c7a=_0x7f7c7a||0xcc;return function(_0x3ae5f1){if(_0x3ae5f1){return _0xbb737b['sendStatus'](_0x7f7c7a);}return _0xbb737b[_0xb25d('0x11')](_0x7f7c7a)[_0xb25d('0x12')]();};}function respondWithResult(_0x4df67a,_0x166f9f){_0x166f9f=_0x166f9f||0xc8;return function(_0x55c15d){if(_0x55c15d){return _0x4df67a[_0xb25d('0x11')](_0x166f9f)[_0xb25d('0x13')](_0x55c15d);}};}function respondWithFilteredResult(_0x4b7a02,_0x90a5ac){return function(_0x1df1bf){if(_0x1df1bf){var _0x1b87e4=typeof _0x90a5ac[_0xb25d('0x14')]===_0xb25d('0x15')&&typeof _0x90a5ac['limit']===_0xb25d('0x15');var _0xc3ea79=_0x1df1bf[_0xb25d('0x16')];var _0x24bb2d=_0x1b87e4?0x0:_0x90a5ac[_0xb25d('0x14')];var _0x5baeaf=_0x1b87e4?_0x1df1bf[_0xb25d('0x16')]:_0x90a5ac['offset']+_0x90a5ac[_0xb25d('0x17')];var _0x14369a;if(_0x5baeaf>=_0xc3ea79){_0x5baeaf=_0xc3ea79;_0x14369a=0xc8;}else{_0x14369a=0xce;}_0x4b7a02[_0xb25d('0x11')](_0x14369a);return _0x4b7a02[_0xb25d('0x18')]('Content-Range',_0x24bb2d+'-'+_0x5baeaf+'/'+_0xc3ea79)[_0xb25d('0x13')](_0x1df1bf);}return null;};}function patchUpdates(_0x1a2892){return function(_0x686887){try{jsonpatch[_0xb25d('0x19')](_0x686887,_0x1a2892,!![]);}catch(_0x3ef314){return BPromise[_0xb25d('0x1a')](_0x3ef314);}return _0x686887['save']();};}function saveUpdates(_0x4dc8ec,_0x42cd86){return function(_0x41a96f){if(_0x41a96f){return _0x41a96f[_0xb25d('0x1b')](_0x4dc8ec)['then'](function(_0x469bc9){return _0x469bc9;});}return null;};}function removeEntity(_0x5b9e76,_0x1424ef){return function(_0x22cf0a){if(_0x22cf0a){return _0x22cf0a['destroy']()[_0xb25d('0x1c')](function(){_0x5b9e76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf87445,_0x1ac6b5){return function(_0x1a9b6f){if(!_0x1a9b6f){_0xf87445[_0xb25d('0x1d')](0x194);}return _0x1a9b6f;};}function handleError(_0x4bb3b9,_0x18658c){_0x18658c=_0x18658c||0x1f4;return function(_0x1b5832){logger['error'](_0x1b5832[_0xb25d('0x1e')]);if(_0x1b5832['name']){delete _0x1b5832[_0xb25d('0x1f')];}_0x4bb3b9['status'](_0x18658c)[_0xb25d('0x20')](_0x1b5832);};}exports['index']=function(_0x1323d9,_0x300977){var _0x4c3894={},_0x4b5728={},_0x4b8a1c={'count':0x0,'rows':[]};var _0x5c3495=_[_0xb25d('0x21')](db[_0xb25d('0x22')]['rawAttributes'],function(_0x561480){return{'name':_0x561480[_0xb25d('0x23')],'type':_0x561480['type'][_0xb25d('0x24')]};});_0x4b5728[_0xb25d('0x25')]=_[_0xb25d('0x21')](_0x5c3495,'name');_0x4b5728['query']=_[_0xb25d('0x26')](_0x1323d9[_0xb25d('0x27')]);_0x4b5728['filters']=_['intersection'](_0x4b5728[_0xb25d('0x25')],_0x4b5728['query']);_0x4c3894[_0xb25d('0x28')]=_[_0xb25d('0x29')](_0x4b5728[_0xb25d('0x25')],qs[_0xb25d('0x2a')](_0x1323d9[_0xb25d('0x27')][_0xb25d('0x2a')]));_0x4c3894['attributes']=_0x4c3894[_0xb25d('0x28')][_0xb25d('0x2b')]?_0x4c3894['attributes']:_0x4b5728[_0xb25d('0x25')];if(!_0x1323d9['query'][_0xb25d('0x2c')](_0xb25d('0x2d'))){_0x4c3894[_0xb25d('0x17')]=qs['limit'](_0x1323d9['query'][_0xb25d('0x17')]);_0x4c3894[_0xb25d('0x14')]=qs['offset'](_0x1323d9['query'][_0xb25d('0x14')]);}_0x4c3894[_0xb25d('0x2e')]=qs['sort'](_0x1323d9[_0xb25d('0x27')][_0xb25d('0x2f')]);_0x4c3894[_0xb25d('0x30')]=qs[_0xb25d('0x31')](_[_0xb25d('0x32')](_0x1323d9['query'],_0x4b5728[_0xb25d('0x31')]),_0x5c3495);if(_0x1323d9[_0xb25d('0x27')][_0xb25d('0x33')]){_0x4c3894[_0xb25d('0x30')]=_[_0xb25d('0x34')](_0x4c3894[_0xb25d('0x30')],{'$or':_[_0xb25d('0x21')](_0x5c3495,function(_0x2770c0){if(_0x2770c0['type']!==_0xb25d('0x35')){var _0x6fcae1={};_0x6fcae1[_0x2770c0[_0xb25d('0x1f')]]={'$like':'%'+_0x1323d9[_0xb25d('0x27')]['filter']+'%'};return _0x6fcae1;}})});}_0x4c3894=_[_0xb25d('0x34')]({},_0x4c3894,_0x1323d9['options']);var _0xb19b99={'where':_0x4c3894[_0xb25d('0x30')]};return db[_0xb25d('0x22')][_0xb25d('0x16')](_0xb19b99)[_0xb25d('0x1c')](function(_0x192656){_0x4b8a1c[_0xb25d('0x16')]=_0x192656;if(_0x1323d9[_0xb25d('0x27')]['includeAll']){_0x4c3894['include']=[{'all':!![]}];}return db[_0xb25d('0x22')]['findAll'](_0x4c3894);})[_0xb25d('0x1c')](function(_0xb755f2){_0x4b8a1c[_0xb25d('0x36')]=_0xb755f2;return _0x4b8a1c;})[_0xb25d('0x1c')](respondWithFilteredResult(_0x300977,_0x4c3894))[_0xb25d('0x37')](handleError(_0x300977,null));};exports[_0xb25d('0x38')]=function(_0x26281e,_0x223e30){var _0x264fae={'raw':!![],'where':{'id':_0x26281e['params']['id']}},_0x253dad={};_0x253dad['model']=_[_0xb25d('0x26')](db[_0xb25d('0x22')]['rawAttributes']);_0x253dad[_0xb25d('0x27')]=_[_0xb25d('0x26')](_0x26281e[_0xb25d('0x27')]);_0x253dad[_0xb25d('0x31')]=_['intersection'](_0x253dad[_0xb25d('0x25')],_0x253dad[_0xb25d('0x27')]);_0x264fae[_0xb25d('0x28')]=_['intersection'](_0x253dad[_0xb25d('0x25')],qs[_0xb25d('0x2a')](_0x26281e[_0xb25d('0x27')][_0xb25d('0x2a')]));_0x264fae[_0xb25d('0x28')]=_0x264fae[_0xb25d('0x28')][_0xb25d('0x2b')]?_0x264fae[_0xb25d('0x28')]:_0x253dad[_0xb25d('0x25')];if(_0x26281e[_0xb25d('0x27')][_0xb25d('0x39')]){_0x264fae[_0xb25d('0x3a')]=[{'all':!![]}];}_0x264fae=_[_0xb25d('0x34')]({},_0x264fae,_0x26281e['options']);return db['MailSubstatus'][_0xb25d('0x3b')](_0x264fae)['then'](handleEntityNotFound(_0x223e30,null))['then'](respondWithResult(_0x223e30,null))['catch'](handleError(_0x223e30,null));};exports[_0xb25d('0x3c')]=function(_0x6a714d,_0x25021b){return db[_0xb25d('0x22')][_0xb25d('0x3c')](_0x6a714d[_0xb25d('0x3d')],{})['then'](respondWithResult(_0x25021b,0xc9))[_0xb25d('0x37')](handleError(_0x25021b,null));};exports[_0xb25d('0x1b')]=function(_0x1a7c64,_0x1633ab){if(_0x1a7c64['body']['id']){delete _0x1a7c64['body']['id'];}return db[_0xb25d('0x22')][_0xb25d('0x3b')]({'where':{'id':_0x1a7c64['params']['id']}})[_0xb25d('0x1c')](handleEntityNotFound(_0x1633ab,null))[_0xb25d('0x1c')](saveUpdates(_0x1a7c64[_0xb25d('0x3d')],null))[_0xb25d('0x1c')](respondWithResult(_0x1633ab,null))[_0xb25d('0x37')](handleError(_0x1633ab,null));};exports['destroy']=function(_0x417f3c,_0x58e7d7){return db[_0xb25d('0x22')][_0xb25d('0x3b')]({'where':{'id':_0x417f3c[_0xb25d('0x3e')]['id']}})[_0xb25d('0x1c')](handleEntityNotFound(_0x58e7d7,null))[_0xb25d('0x1c')](removeEntity(_0x58e7d7,null))[_0xb25d('0x37')](handleError(_0x58e7d7,null));};exports[_0xb25d('0x3f')]=function(_0xb3a20e,_0x1fe912){return db[_0xb25d('0x22')][_0xb25d('0x3f')]()['then'](respondWithResult(_0x1fe912,null))[_0xb25d('0x37')](handleError(_0x1fe912,null));}; \ No newline at end of file +var _0xb33b=['type','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','destroy','describe','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','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','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','MailSubstatus','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x7d6806,_0x5a61a3){var _0x2c9ced=function(_0x3c5e42){while(--_0x3c5e42){_0x7d6806['push'](_0x7d6806['shift']());}};_0x2c9ced(++_0x5a61a3);}(_0xb33b,0x1d0));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb33('0x0'));var zipdir=require(_0xbb33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbb33('0x2'));var Mustache=require(_0xbb33('0x3'));var util=require(_0xbb33('0x4'));var path=require(_0xbb33('0x5'));var sox=require(_0xbb33('0x6'));var csv=require(_0xbb33('0x7'));var ejs=require(_0xbb33('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbb33('0x9'));var crypto=require(_0xbb33('0xa'));var jsforce=require(_0xbb33('0xb'));var deskjs=require(_0xbb33('0xc'));var toCsv=require(_0xbb33('0x7'));var querystring=require(_0xbb33('0xd'));var Papa=require(_0xbb33('0xe'));var Redis=require(_0xbb33('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbb33('0x10'));var as=require(_0xbb33('0x11'));var hardwareService=require(_0xbb33('0x12'));var logger=require(_0xbb33('0x13'))(_0xbb33('0x14'));var utils=require(_0xbb33('0x15'));var config=require(_0xbb33('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb33('0x17'))['db'];function respondWithStatusCode(_0x442354,_0x5caa04){_0x5caa04=_0x5caa04||0xcc;return function(_0x17ca00){if(_0x17ca00){return _0x442354[_0xbb33('0x18')](_0x5caa04);}return _0x442354[_0xbb33('0x19')](_0x5caa04)[_0xbb33('0x1a')]();};}function respondWithResult(_0x13b25e,_0x25934d){_0x25934d=_0x25934d||0xc8;return function(_0x1feb78){if(_0x1feb78){return _0x13b25e['status'](_0x25934d)[_0xbb33('0x1b')](_0x1feb78);}};}function respondWithFilteredResult(_0x48e43d,_0x21c18b){return function(_0x17e3b8){if(_0x17e3b8){var _0x523429=typeof _0x21c18b[_0xbb33('0x1c')]===_0xbb33('0x1d')&&typeof _0x21c18b[_0xbb33('0x1e')]===_0xbb33('0x1d');var _0x409f9b=_0x17e3b8[_0xbb33('0x1f')];var _0x556a62=_0x523429?0x0:_0x21c18b[_0xbb33('0x1c')];var _0x299521=_0x523429?_0x17e3b8[_0xbb33('0x1f')]:_0x21c18b[_0xbb33('0x1c')]+_0x21c18b[_0xbb33('0x1e')];var _0x579406;if(_0x299521>=_0x409f9b){_0x299521=_0x409f9b;_0x579406=0xc8;}else{_0x579406=0xce;}_0x48e43d[_0xbb33('0x19')](_0x579406);return _0x48e43d['set'](_0xbb33('0x20'),_0x556a62+'-'+_0x299521+'/'+_0x409f9b)['json'](_0x17e3b8);}return null;};}function patchUpdates(_0xa020ce){return function(_0x2abea9){try{jsonpatch[_0xbb33('0x21')](_0x2abea9,_0xa020ce,!![]);}catch(_0x13faca){return BPromise[_0xbb33('0x22')](_0x13faca);}return _0x2abea9[_0xbb33('0x23')]();};}function saveUpdates(_0x2aa5ee,_0x3f6c8e){return function(_0x193ecc){if(_0x193ecc){return _0x193ecc[_0xbb33('0x24')](_0x2aa5ee)[_0xbb33('0x25')](function(_0x8565d7){return _0x8565d7;});}return null;};}function removeEntity(_0x2df1f5,_0x88356){return function(_0x322469){if(_0x322469){return _0x322469['destroy']()[_0xbb33('0x25')](function(){_0x2df1f5[_0xbb33('0x19')](0xcc)[_0xbb33('0x1a')]();});}};}function handleEntityNotFound(_0x2dff1b,_0x5af038){return function(_0xabcefa){if(!_0xabcefa){_0x2dff1b[_0xbb33('0x18')](0x194);}return _0xabcefa;};}function handleError(_0x2b75fd,_0x43af43){_0x43af43=_0x43af43||0x1f4;return function(_0xc0a5ed){logger[_0xbb33('0x26')](_0xc0a5ed[_0xbb33('0x27')]);if(_0xc0a5ed[_0xbb33('0x28')]){delete _0xc0a5ed['name'];}_0x2b75fd[_0xbb33('0x19')](_0x43af43)['send'](_0xc0a5ed);};}exports[_0xbb33('0x29')]=function(_0x96597a,_0x2c5678){var _0x34a359={},_0x45bad0={},_0x279a09={'count':0x0,'rows':[]};var _0x358983=_['map'](db[_0xbb33('0x2a')][_0xbb33('0x2b')],function(_0x15975a){return{'name':_0x15975a[_0xbb33('0x2c')],'type':_0x15975a['type']['key']};});_0x45bad0[_0xbb33('0x2d')]=_['map'](_0x358983,_0xbb33('0x28'));_0x45bad0[_0xbb33('0x2e')]=_[_0xbb33('0x2f')](_0x96597a['query']);_0x45bad0[_0xbb33('0x30')]=_[_0xbb33('0x31')](_0x45bad0[_0xbb33('0x2d')],_0x45bad0[_0xbb33('0x2e')]);_0x34a359[_0xbb33('0x32')]=_[_0xbb33('0x31')](_0x45bad0[_0xbb33('0x2d')],qs['fields'](_0x96597a[_0xbb33('0x2e')][_0xbb33('0x33')]));_0x34a359[_0xbb33('0x32')]=_0x34a359[_0xbb33('0x32')][_0xbb33('0x34')]?_0x34a359[_0xbb33('0x32')]:_0x45bad0[_0xbb33('0x2d')];if(!_0x96597a[_0xbb33('0x2e')][_0xbb33('0x35')](_0xbb33('0x36'))){_0x34a359['limit']=qs[_0xbb33('0x1e')](_0x96597a[_0xbb33('0x2e')][_0xbb33('0x1e')]);_0x34a359[_0xbb33('0x1c')]=qs['offset'](_0x96597a[_0xbb33('0x2e')][_0xbb33('0x1c')]);}_0x34a359[_0xbb33('0x37')]=qs[_0xbb33('0x38')](_0x96597a['query'][_0xbb33('0x38')]);_0x34a359['where']=qs[_0xbb33('0x30')](_[_0xbb33('0x39')](_0x96597a[_0xbb33('0x2e')],_0x45bad0['filters']),_0x358983);if(_0x96597a[_0xbb33('0x2e')][_0xbb33('0x3a')]){_0x34a359[_0xbb33('0x3b')]=_[_0xbb33('0x3c')](_0x34a359['where'],{'$or':_['map'](_0x358983,function(_0x1a913a){if(_0x1a913a[_0xbb33('0x3d')]!==_0xbb33('0x3e')){var _0xbbfeb6={};_0xbbfeb6[_0x1a913a['name']]={'$like':'%'+_0x96597a[_0xbb33('0x2e')][_0xbb33('0x3a')]+'%'};return _0xbbfeb6;}})});}_0x34a359=_[_0xbb33('0x3c')]({},_0x34a359,_0x96597a['options']);var _0x16011d={'where':_0x34a359[_0xbb33('0x3b')]};return db[_0xbb33('0x2a')][_0xbb33('0x1f')](_0x16011d)['then'](function(_0x46bb7a){_0x279a09[_0xbb33('0x1f')]=_0x46bb7a;if(_0x96597a[_0xbb33('0x2e')][_0xbb33('0x3f')]){_0x34a359[_0xbb33('0x40')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x34a359);})['then'](function(_0x1e945d){_0x279a09[_0xbb33('0x41')]=_0x1e945d;return _0x279a09;})['then'](respondWithFilteredResult(_0x2c5678,_0x34a359))[_0xbb33('0x42')](handleError(_0x2c5678,null));};exports[_0xbb33('0x43')]=function(_0x110564,_0x1a2c61){var _0x3cbfdd={'raw':!![],'where':{'id':_0x110564['params']['id']}},_0xe2a849={};_0xe2a849[_0xbb33('0x2d')]=_[_0xbb33('0x2f')](db[_0xbb33('0x2a')]['rawAttributes']);_0xe2a849['query']=_[_0xbb33('0x2f')](_0x110564['query']);_0xe2a849[_0xbb33('0x30')]=_[_0xbb33('0x31')](_0xe2a849[_0xbb33('0x2d')],_0xe2a849[_0xbb33('0x2e')]);_0x3cbfdd[_0xbb33('0x32')]=_[_0xbb33('0x31')](_0xe2a849['model'],qs[_0xbb33('0x33')](_0x110564[_0xbb33('0x2e')][_0xbb33('0x33')]));_0x3cbfdd['attributes']=_0x3cbfdd[_0xbb33('0x32')][_0xbb33('0x34')]?_0x3cbfdd[_0xbb33('0x32')]:_0xe2a849['model'];if(_0x110564[_0xbb33('0x2e')]['includeAll']){_0x3cbfdd[_0xbb33('0x40')]=[{'all':!![]}];}_0x3cbfdd=_['merge']({},_0x3cbfdd,_0x110564[_0xbb33('0x44')]);return db['MailSubstatus'][_0xbb33('0x45')](_0x3cbfdd)[_0xbb33('0x25')](handleEntityNotFound(_0x1a2c61,null))[_0xbb33('0x25')](respondWithResult(_0x1a2c61,null))['catch'](handleError(_0x1a2c61,null));};exports[_0xbb33('0x46')]=function(_0x3f631c,_0x75fc9f){return db[_0xbb33('0x2a')][_0xbb33('0x46')](_0x3f631c[_0xbb33('0x47')],{})['then'](respondWithResult(_0x75fc9f,0xc9))[_0xbb33('0x42')](handleError(_0x75fc9f,null));};exports[_0xbb33('0x24')]=function(_0x24845e,_0x23c1a7){if(_0x24845e[_0xbb33('0x47')]['id']){delete _0x24845e[_0xbb33('0x47')]['id'];}return db['MailSubstatus'][_0xbb33('0x45')]({'where':{'id':_0x24845e[_0xbb33('0x48')]['id']}})['then'](handleEntityNotFound(_0x23c1a7,null))[_0xbb33('0x25')](saveUpdates(_0x24845e[_0xbb33('0x47')],null))['then'](respondWithResult(_0x23c1a7,null))[_0xbb33('0x42')](handleError(_0x23c1a7,null));};exports[_0xbb33('0x49')]=function(_0x169ab1,_0x572e94){return db[_0xbb33('0x2a')][_0xbb33('0x45')]({'where':{'id':_0x169ab1[_0xbb33('0x48')]['id']}})[_0xbb33('0x25')](handleEntityNotFound(_0x572e94,null))['then'](removeEntity(_0x572e94,null))[_0xbb33('0x42')](handleError(_0x572e94,null));};exports[_0xbb33('0x4a')]=function(_0x359608,_0xc0d80b){return db[_0xbb33('0x2a')][_0xbb33('0x4a')]()[_0xbb33('0x25')](respondWithResult(_0xc0d80b,null))[_0xbb33('0x42')](handleError(_0xc0d80b,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index ba76b8b..642ba4f 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 _0x7c1d=['events','../../mysqldb','MailSubstatus','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x26c58e,_0x393e96){var _0x4c503c=function(_0x241cab){while(--_0x241cab){_0x26c58e['push'](_0x26c58e['shift']());}};_0x4c503c(++_0x393e96);}(_0x7c1d,0x188));var _0xd7c1=function(_0xdd1978,_0x211935){_0xdd1978=_0xdd1978-0x0;var _0x4f3584=_0x7c1d[_0xdd1978];return _0x4f3584;};'use strict';var EventEmitter=require(_0xd7c1('0x0'));var MailSubstatus=require(_0xd7c1('0x1'))['db'][_0xd7c1('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd7c1('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x241023){return function(_0x4bfd85,_0x2296c9,_0x1ea00b){MailSubstatusEvents[_0xd7c1('0x4')](_0x241023+':'+_0x4bfd85['id'],_0x4bfd85);MailSubstatusEvents['emit'](_0x241023,_0x4bfd85);_0x1ea00b(null);};}for(var e in events){if(events[_0xd7c1('0x5')](e)){var event=events[e];MailSubstatus[_0xd7c1('0x6')](e,emitEvent(event));}}module[_0xd7c1('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xac8a=['emit','hasOwnProperty','hook','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x1d895d,_0x3e5c93){var _0x2dae23=function(_0x443cd0){while(--_0x443cd0){_0x1d895d['push'](_0x1d895d['shift']());}};_0x2dae23(++_0x3e5c93);}(_0xac8a,0xce));var _0xaac8=function(_0x2f934c,_0x46770d){_0x2f934c=_0x2f934c-0x0;var _0x24a2df=_0xac8a[_0x2f934c];return _0x24a2df;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xaac8('0x0'))['db'][_0xaac8('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xaac8('0x2')](0x0);var events={'afterUpdate':_0xaac8('0x3')};function emitEvent(_0x25b482){return function(_0x21c5d9,_0x30e96d,_0xfe06dc){MailSubstatusEvents[_0xaac8('0x4')](_0x25b482+':'+_0x21c5d9['id'],_0x21c5d9);MailSubstatusEvents['emit'](_0x25b482,_0x21c5d9);_0xfe06dc(null);};}for(var e in events){if(events[_0xaac8('0x5')](e)){var event=events[e];MailSubstatus[_0xaac8('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 8886a7e..501ca40 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 _0x5632=['name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition'];(function(_0x355648,_0x21b4c9){var _0x2493ca=function(_0x1e9a34){while(--_0x1e9a34){_0x355648['push'](_0x355648['shift']());}};_0x2493ca(++_0x21b4c9);}(_0x5632,0xeb));var _0x2563=function(_0x114a5e,_0x5cfc99){_0x114a5e=_0x114a5e-0x0;var _0x100112=_0x5632[_0x114a5e];return _0x100112;};'use strict';var attributes=require(_0x2563('0x0'));module[_0x2563('0x1')]=function(_0x25c6b8){var _0x1b7248=_0x25c6b8[_0x2563('0x2')];return _0x25c6b8[_0x2563('0x3')](_0x2563('0x4'),attributes,{'tableName':_0x2563('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x497b21,_0x5f5c1f,_0xb1d122){return _0x1b7248[_0x2563('0x6')]['update']({'value':_0x497b21[_0x2563('0x7')]},{'where':{'field':_0x2563('0x8'),'value':_0x497b21['_previousDataValues'][_0x2563('0x7')]}})[_0x2563('0x9')](function(){_0xb1d122();})[_0x2563('0xa')](function(_0x51d382){_0xb1d122(_0x51d382);});}}});}; \ No newline at end of file +var _0xe3b9=['_previousDataValues','./mailSubstatus.attributes','exports','models','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x16c419,_0x371fc8){var _0x3147d2=function(_0x17775c){while(--_0x17775c){_0x16c419['push'](_0x16c419['shift']());}};_0x3147d2(++_0x371fc8);}(_0xe3b9,0x1f0));var _0x9e3b=function(_0xa4729c,_0x360afe){_0xa4729c=_0xa4729c-0x0;var _0x10a08f=_0xe3b9[_0xa4729c];return _0x10a08f;};'use strict';var attributes=require(_0x9e3b('0x0'));module[_0x9e3b('0x1')]=function(_0x32d8de){var _0x3cefd9=_0x32d8de[_0x9e3b('0x2')];return _0x32d8de['define']('MailSubstatus',attributes,{'tableName':_0x9e3b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x31a49e,_0x5cdea2,_0x20b797){return _0x3cefd9[_0x9e3b('0x4')][_0x9e3b('0x5')]({'value':_0x31a49e[_0x9e3b('0x6')]},{'where':{'field':_0x9e3b('0x7'),'value':_0x31a49e[_0x9e3b('0x8')][_0x9e3b('0x6')]}})['then'](function(){_0x20b797();})['catch'](function(_0x204de8){_0x20b797(_0x204de8);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6e8d3b5..f4b1793 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 _0x86ea=['ioredis','../../config/utils','../../config/logger','rpc','client','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird'];(function(_0x43da6b,_0x242f72){var _0x1eb064=function(_0x564a86){while(--_0x564a86){_0x43da6b['push'](_0x43da6b['shift']());}};_0x1eb064(++_0x242f72);}(_0x86ea,0x86));var _0xa86e=function(_0x36a4a1,_0x56de60){_0x36a4a1=_0x36a4a1-0x0;var _0x9f670a=_0x86ea[_0x36a4a1];return _0x9f670a;};'use strict';var _=require(_0xa86e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa86e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa86e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa86e('0x3'));var logger=require(_0xa86e('0x4'))(_0xa86e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa86e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x213b0f,_0x28e8b3,_0x3b5dd2){return new BPromise(function(_0x457c11,_0x5ce2f0){return client[_0xa86e('0x7')](_0x213b0f,_0x3b5dd2)['then'](function(_0x4684bd){logger[_0xa86e('0x8')](_0xa86e('0x9'),_0x28e8b3,_0xa86e('0xa'));logger[_0xa86e('0xb')](_0xa86e('0xc'),_0x28e8b3,_0xa86e('0xa'),JSON[_0xa86e('0xd')](_0x4684bd));if(_0x4684bd[_0xa86e('0xe')]){if(_0x4684bd[_0xa86e('0xe')]['code']===0x1f4){logger[_0xa86e('0xe')](_0xa86e('0x9'),_0x28e8b3,_0x4684bd['error']['message']);return _0x5ce2f0(_0x4684bd[_0xa86e('0xe')][_0xa86e('0xf')]);}logger[_0xa86e('0xe')](_0xa86e('0x9'),_0x28e8b3,_0x4684bd[_0xa86e('0xe')][_0xa86e('0xf')]);return _0x457c11(_0x4684bd[_0xa86e('0xe')][_0xa86e('0xf')]);}else{logger[_0xa86e('0x8')]('MailSubstatus,\x20%s,\x20%s',_0x28e8b3,_0xa86e('0xa'));_0x457c11(_0x4684bd[_0xa86e('0x10')][_0xa86e('0xf')]);}})['catch'](function(_0x122806){logger['error'](_0xa86e('0x9'),_0x28e8b3,_0x122806);_0x5ce2f0(_0x122806);});});} \ No newline at end of file +var _0x93b6=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x517607,_0x12f81f){var _0x1002d7=function(_0x4f9a34){while(--_0x4f9a34){_0x517607['push'](_0x517607['shift']());}};_0x1002d7(++_0x12f81f);}(_0x93b6,0x151));var _0x693b=function(_0xc6e1ce,_0x56402e){_0xc6e1ce=_0xc6e1ce-0x0;var _0x22c4bf=_0x93b6[_0xc6e1ce];return _0x22c4bf;};'use strict';var _=require(_0x693b('0x0'));var util=require(_0x693b('0x1'));var moment=require('moment');var BPromise=require(_0x693b('0x2'));var rs=require(_0x693b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x693b('0x4'))['db'];var utils=require(_0x693b('0x5'));var logger=require(_0x693b('0x6'))(_0x693b('0x7'));var config=require(_0x693b('0x8'));var jayson=require(_0x693b('0x9'));var client=jayson[_0x693b('0xa')][_0x693b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e2cd4,_0x2a8ec8,_0x484f5b){return new BPromise(function(_0x4a3466,_0x54ae5c){return client[_0x693b('0xc')](_0x3e2cd4,_0x484f5b)[_0x693b('0xd')](function(_0x1f41e8){logger[_0x693b('0xe')](_0x693b('0xf'),_0x2a8ec8,_0x693b('0x10'));logger[_0x693b('0x11')](_0x693b('0x12'),_0x2a8ec8,'request\x20sent',JSON[_0x693b('0x13')](_0x1f41e8));if(_0x1f41e8[_0x693b('0x14')]){if(_0x1f41e8[_0x693b('0x14')]['code']===0x1f4){logger[_0x693b('0x14')](_0x693b('0xf'),_0x2a8ec8,_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);return _0x54ae5c(_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);}logger[_0x693b('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x2a8ec8,_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);return _0x4a3466(_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);}else{logger[_0x693b('0xe')](_0x693b('0xf'),_0x2a8ec8,_0x693b('0x10'));_0x4a3466(_0x1f41e8[_0x693b('0x16')][_0x693b('0x15')]);}})[_0x693b('0x17')](function(_0x34a178){logger[_0x693b('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x2a8ec8,_0x34a178);_0x54ae5c(_0x34a178);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ce2cacb..ce24c39 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 _0x7ad5=['describe','/:id','post','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x4e524c,_0x3c69e3){var _0xcb85ca=function(_0x4d8ee){while(--_0x4d8ee){_0x4e524c['push'](_0x4e524c['shift']());}};_0xcb85ca(++_0x3c69e3);}(_0x7ad5,0x8b));var _0x57ad=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7ad5[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x57ad('0x0'));var util=require(_0x57ad('0x1'));var path=require('path');var timeout=require(_0x57ad('0x2'));var express=require(_0x57ad('0x3'));var router=express[_0x57ad('0x4')]();var fs_extra=require(_0x57ad('0x5'));var auth=require(_0x57ad('0x6'));var interaction=require(_0x57ad('0x7'));var config=require(_0x57ad('0x8'));var controller=require(_0x57ad('0x9'));router[_0x57ad('0xa')]('/',auth[_0x57ad('0xb')](),controller[_0x57ad('0xc')]);router['get']('/describe',auth[_0x57ad('0xb')](),controller[_0x57ad('0xd')]);router[_0x57ad('0xa')](_0x57ad('0xe'),auth[_0x57ad('0xb')](),controller['show']);router[_0x57ad('0xf')]('/',auth[_0x57ad('0xb')](),controller['create']);router[_0x57ad('0x10')](_0x57ad('0xe'),auth[_0x57ad('0xb')](),controller['update']);router[_0x57ad('0x11')](_0x57ad('0xe'),auth[_0x57ad('0xb')](),controller[_0x57ad('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5784=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','delete','/:id','exports','multer'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0x5784,0x13f));var _0x4578=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5784[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x4578('0x0'));var util=require(_0x4578('0x1'));var path=require(_0x4578('0x2'));var timeout=require(_0x4578('0x3'));var express=require(_0x4578('0x4'));var router=express[_0x4578('0x5')]();var fs_extra=require(_0x4578('0x6'));var auth=require(_0x4578('0x7'));var interaction=require(_0x4578('0x8'));var config=require(_0x4578('0x9'));var controller=require('./mailTransferReport.controller');router[_0x4578('0xa')]('/',auth[_0x4578('0xb')](),controller[_0x4578('0xc')]);router['get']('/describe',auth[_0x4578('0xb')](),controller['describe']);router[_0x4578('0xa')]('/:id',auth[_0x4578('0xb')](),controller['show']);router[_0x4578('0xd')]('/',auth[_0x4578('0xb')](),controller[_0x4578('0xe')]);router[_0x4578('0xf')]('/:id',auth[_0x4578('0xb')](),controller[_0x4578('0x10')]);router[_0x4578('0x11')](_0x4578('0x12'),auth[_0x4578('0xb')](),controller['destroy']);module[_0x4578('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index ed0ed0c..7212f88 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1da9ca,_0xce5aa0){var _0x304fb3=function(_0x56ef5f){while(--_0x56ef5f){_0x1da9ca['push'](_0x1da9ca['shift']());}};_0x304fb3(++_0xce5aa0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x47ea51,_0x120b71){var _0x2d260b=function(_0x4a033d){while(--_0x4a033d){_0x47ea51['push'](_0x47ea51['shift']());}};_0x2d260b(++_0x120b71);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0xf3cd[_0x4c8a8f];return _0x404500;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 28ddc34..43e89d6 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 _0xa1c0=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','end','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x408923,_0x4c8e75){var _0x392307=function(_0x27ca41){while(--_0x27ca41){_0x408923['push'](_0x408923['shift']());}};_0x392307(++_0x4c8e75);}(_0xa1c0,0x7d));var _0x0a1c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa1c0[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x0a1c('0x0'));var rimraf=require(_0x0a1c('0x1'));var zipdir=require(_0x0a1c('0x2'));var jsonpatch=require(_0x0a1c('0x3'));var rp=require(_0x0a1c('0x4'));var moment=require('moment');var BPromise=require(_0x0a1c('0x5'));var Mustache=require(_0x0a1c('0x6'));var util=require(_0x0a1c('0x7'));var path=require('path');var sox=require(_0x0a1c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a1c('0x9'));var _=require(_0x0a1c('0xa'));var squel=require(_0x0a1c('0xb'));var crypto=require(_0x0a1c('0xc'));var jsforce=require(_0x0a1c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0a1c('0xe'));var querystring=require(_0x0a1c('0xf'));var Papa=require(_0x0a1c('0x10'));var Redis=require(_0x0a1c('0x11'));var authService=require(_0x0a1c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0a1c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a1c('0x14'))(_0x0a1c('0x15'));var utils=require('../../config/utils');var config=require(_0x0a1c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b451b,_0x339577){_0x339577=_0x339577||0xcc;return function(_0x45ff99){if(_0x45ff99){return _0x1b451b[_0x0a1c('0x17')](_0x339577);}return _0x1b451b[_0x0a1c('0x18')](_0x339577)['end']();};}function respondWithResult(_0x571623,_0x22ee50){_0x22ee50=_0x22ee50||0xc8;return function(_0xc0f073){if(_0xc0f073){return _0x571623['status'](_0x22ee50)[_0x0a1c('0x19')](_0xc0f073);}};}function respondWithFilteredResult(_0x5dd113,_0xb8ce8d){return function(_0x4dda5f){if(_0x4dda5f){var _0x4c8029=typeof _0xb8ce8d[_0x0a1c('0x1a')]===_0x0a1c('0x1b')&&typeof _0xb8ce8d[_0x0a1c('0x1c')]===_0x0a1c('0x1b');var _0x157f3a=_0x4dda5f[_0x0a1c('0x1d')];var _0x5d7948=_0x4c8029?0x0:_0xb8ce8d[_0x0a1c('0x1a')];var _0x3e4618=_0x4c8029?_0x4dda5f[_0x0a1c('0x1d')]:_0xb8ce8d['offset']+_0xb8ce8d[_0x0a1c('0x1c')];var _0x57d88e;if(_0x3e4618>=_0x157f3a){_0x3e4618=_0x157f3a;_0x57d88e=0xc8;}else{_0x57d88e=0xce;}_0x5dd113[_0x0a1c('0x18')](_0x57d88e);return _0x5dd113[_0x0a1c('0x1e')](_0x0a1c('0x1f'),_0x5d7948+'-'+_0x3e4618+'/'+_0x157f3a)[_0x0a1c('0x19')](_0x4dda5f);}return null;};}function patchUpdates(_0x1cee76){return function(_0x35c942){try{jsonpatch['apply'](_0x35c942,_0x1cee76,!![]);}catch(_0x2124f4){return BPromise[_0x0a1c('0x20')](_0x2124f4);}return _0x35c942['save']();};}function saveUpdates(_0x262a75,_0x206cd4){return function(_0x119df0){if(_0x119df0){return _0x119df0['update'](_0x262a75)['then'](function(_0x145700){return _0x145700;});}return null;};}function removeEntity(_0x58577d,_0x3475f3){return function(_0x45dbdf){if(_0x45dbdf){return _0x45dbdf['destroy']()[_0x0a1c('0x21')](function(){_0x58577d['status'](0xcc)[_0x0a1c('0x22')]();});}};}function handleEntityNotFound(_0x41c56c,_0x908e26){return function(_0x3812c9){if(!_0x3812c9){_0x41c56c[_0x0a1c('0x17')](0x194);}return _0x3812c9;};}function handleError(_0x5c9a90,_0x55d284){_0x55d284=_0x55d284||0x1f4;return function(_0x4edfea){logger[_0x0a1c('0x23')](_0x4edfea[_0x0a1c('0x24')]);if(_0x4edfea[_0x0a1c('0x25')]){delete _0x4edfea[_0x0a1c('0x25')];}_0x5c9a90[_0x0a1c('0x18')](_0x55d284)[_0x0a1c('0x26')](_0x4edfea);};}exports[_0x0a1c('0x27')]=function(_0x1a8f91,_0x1e57a5){var _0x1a87ca={},_0x344da7={},_0x25e2df={'count':0x0,'rows':[]};var _0x51e3b0=_[_0x0a1c('0x28')](db[_0x0a1c('0x29')][_0x0a1c('0x2a')],function(_0x548238){return{'name':_0x548238[_0x0a1c('0x2b')],'type':_0x548238['type'][_0x0a1c('0x2c')]};});_0x344da7[_0x0a1c('0x2d')]=_[_0x0a1c('0x28')](_0x51e3b0,_0x0a1c('0x25'));_0x344da7[_0x0a1c('0x2e')]=_[_0x0a1c('0x2f')](_0x1a8f91[_0x0a1c('0x2e')]);_0x344da7[_0x0a1c('0x30')]=_[_0x0a1c('0x31')](_0x344da7[_0x0a1c('0x2d')],_0x344da7[_0x0a1c('0x2e')]);_0x1a87ca[_0x0a1c('0x32')]=_[_0x0a1c('0x31')](_0x344da7[_0x0a1c('0x2d')],qs[_0x0a1c('0x33')](_0x1a8f91[_0x0a1c('0x2e')][_0x0a1c('0x33')]));_0x1a87ca['attributes']=_0x1a87ca[_0x0a1c('0x32')][_0x0a1c('0x34')]?_0x1a87ca[_0x0a1c('0x32')]:_0x344da7[_0x0a1c('0x2d')];if(!_0x1a8f91[_0x0a1c('0x2e')][_0x0a1c('0x35')]('nolimit')){_0x1a87ca[_0x0a1c('0x1c')]=qs[_0x0a1c('0x1c')](_0x1a8f91['query']['limit']);_0x1a87ca[_0x0a1c('0x1a')]=qs[_0x0a1c('0x1a')](_0x1a8f91[_0x0a1c('0x2e')][_0x0a1c('0x1a')]);}_0x1a87ca[_0x0a1c('0x36')]=qs[_0x0a1c('0x37')](_0x1a8f91[_0x0a1c('0x2e')]['sort']);_0x1a87ca[_0x0a1c('0x38')]=qs[_0x0a1c('0x30')](_[_0x0a1c('0x39')](_0x1a8f91[_0x0a1c('0x2e')],_0x344da7['filters']),_0x51e3b0);if(_0x1a8f91[_0x0a1c('0x2e')][_0x0a1c('0x3a')]){_0x1a87ca['where']=_[_0x0a1c('0x3b')](_0x1a87ca[_0x0a1c('0x38')],{'$or':_[_0x0a1c('0x28')](_0x51e3b0,function(_0xcb1c4c){if(_0xcb1c4c[_0x0a1c('0x3c')]!=='VIRTUAL'){var _0x21b3c8={};_0x21b3c8[_0xcb1c4c[_0x0a1c('0x25')]]={'$like':'%'+_0x1a8f91[_0x0a1c('0x2e')][_0x0a1c('0x3a')]+'%'};return _0x21b3c8;}})});}_0x1a87ca=_['merge']({},_0x1a87ca,_0x1a8f91[_0x0a1c('0x3d')]);var _0x5d78e0={'where':_0x1a87ca['where']};return db[_0x0a1c('0x29')]['count'](_0x5d78e0)['then'](function(_0x55381b){_0x25e2df[_0x0a1c('0x1d')]=_0x55381b;if(_0x1a8f91[_0x0a1c('0x2e')][_0x0a1c('0x3e')]){_0x1a87ca[_0x0a1c('0x3f')]=[{'all':!![]}];}return db[_0x0a1c('0x29')]['findAll'](_0x1a87ca);})[_0x0a1c('0x21')](function(_0x4321a2){_0x25e2df[_0x0a1c('0x40')]=_0x4321a2;return _0x25e2df;})[_0x0a1c('0x21')](respondWithFilteredResult(_0x1e57a5,_0x1a87ca))[_0x0a1c('0x41')](handleError(_0x1e57a5,null));};exports['show']=function(_0x196a12,_0x5461e1){var _0x2b7786={'raw':!![],'where':{'id':_0x196a12[_0x0a1c('0x42')]['id']}},_0x517b66={};_0x517b66['model']=_[_0x0a1c('0x2f')](db[_0x0a1c('0x29')][_0x0a1c('0x2a')]);_0x517b66[_0x0a1c('0x2e')]=_[_0x0a1c('0x2f')](_0x196a12[_0x0a1c('0x2e')]);_0x517b66[_0x0a1c('0x30')]=_['intersection'](_0x517b66[_0x0a1c('0x2d')],_0x517b66['query']);_0x2b7786['attributes']=_[_0x0a1c('0x31')](_0x517b66[_0x0a1c('0x2d')],qs['fields'](_0x196a12['query']['fields']));_0x2b7786['attributes']=_0x2b7786[_0x0a1c('0x32')]['length']?_0x2b7786[_0x0a1c('0x32')]:_0x517b66['model'];if(_0x196a12[_0x0a1c('0x2e')]['includeAll']){_0x2b7786[_0x0a1c('0x3f')]=[{'all':!![]}];}_0x2b7786=_[_0x0a1c('0x3b')]({},_0x2b7786,_0x196a12[_0x0a1c('0x3d')]);return db[_0x0a1c('0x29')][_0x0a1c('0x43')](_0x2b7786)['then'](handleEntityNotFound(_0x5461e1,null))[_0x0a1c('0x21')](respondWithResult(_0x5461e1,null))[_0x0a1c('0x41')](handleError(_0x5461e1,null));};exports[_0x0a1c('0x44')]=function(_0x3863b1,_0x58ffb4){return db[_0x0a1c('0x29')]['create'](_0x3863b1[_0x0a1c('0x45')],{})[_0x0a1c('0x21')](respondWithResult(_0x58ffb4,0xc9))[_0x0a1c('0x41')](handleError(_0x58ffb4,null));};exports['update']=function(_0x12bdac,_0x2c6fb1){if(_0x12bdac[_0x0a1c('0x45')]['id']){delete _0x12bdac[_0x0a1c('0x45')]['id'];}return db[_0x0a1c('0x29')]['find']({'where':{'id':_0x12bdac['params']['id']}})[_0x0a1c('0x21')](handleEntityNotFound(_0x2c6fb1,null))[_0x0a1c('0x21')](saveUpdates(_0x12bdac[_0x0a1c('0x45')],null))[_0x0a1c('0x21')](respondWithResult(_0x2c6fb1,null))[_0x0a1c('0x41')](handleError(_0x2c6fb1,null));};exports[_0x0a1c('0x46')]=function(_0x40b141,_0x428f70){return db['MailTransferReport'][_0x0a1c('0x43')]({'where':{'id':_0x40b141['params']['id']}})[_0x0a1c('0x21')](handleEntityNotFound(_0x428f70,null))[_0x0a1c('0x21')](removeEntity(_0x428f70,null))['catch'](handleError(_0x428f70,null));};exports[_0x0a1c('0x47')]=function(_0x96ac05,_0x8f9db){return db[_0x0a1c('0x29')][_0x0a1c('0x47')]()[_0x0a1c('0x21')](respondWithResult(_0x8f9db,null))['catch'](handleError(_0x8f9db,null));}; \ No newline at end of file +var _0x717b=['rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','MailTransferReport','rows','catch','params','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','map'];(function(_0x1b489f,_0xbe7814){var _0x4cdc4e=function(_0x3d8aca){while(--_0x3d8aca){_0x1b489f['push'](_0x1b489f['shift']());}};_0x4cdc4e(++_0xbe7814);}(_0x717b,0xf7));var _0xb717=function(_0x34bc4c,_0x4b4bb9){_0x34bc4c=_0x34bc4c-0x0;var _0x1ea628=_0x717b[_0x34bc4c];return _0x1ea628;};'use strict';var emlformat=require(_0xb717('0x0'));var rimraf=require(_0xb717('0x1'));var zipdir=require(_0xb717('0x2'));var jsonpatch=require(_0xb717('0x3'));var rp=require(_0xb717('0x4'));var moment=require(_0xb717('0x5'));var BPromise=require(_0xb717('0x6'));var Mustache=require(_0xb717('0x7'));var util=require(_0xb717('0x8'));var path=require(_0xb717('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb717('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb717('0xb'));var squel=require('squel');var crypto=require(_0xb717('0xc'));var jsforce=require(_0xb717('0xd'));var deskjs=require(_0xb717('0xe'));var toCsv=require(_0xb717('0xf'));var querystring=require(_0xb717('0x10'));var Papa=require(_0xb717('0x11'));var Redis=require(_0xb717('0x12'));var authService=require(_0xb717('0x13'));var qs=require(_0xb717('0x14'));var as=require(_0xb717('0x15'));var hardwareService=require(_0xb717('0x16'));var logger=require(_0xb717('0x17'))('api');var utils=require(_0xb717('0x18'));var config=require(_0xb717('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53ae9f,_0x10878f){_0x10878f=_0x10878f||0xcc;return function(_0x3d51a7){if(_0x3d51a7){return _0x53ae9f[_0xb717('0x1a')](_0x10878f);}return _0x53ae9f['status'](_0x10878f)['end']();};}function respondWithResult(_0x157b48,_0x56e654){_0x56e654=_0x56e654||0xc8;return function(_0x5d6008){if(_0x5d6008){return _0x157b48[_0xb717('0x1b')](_0x56e654)[_0xb717('0x1c')](_0x5d6008);}};}function respondWithFilteredResult(_0x229cb2,_0x18c187){return function(_0x43e4b1){if(_0x43e4b1){var _0x4494e8=typeof _0x18c187[_0xb717('0x1d')]===_0xb717('0x1e')&&typeof _0x18c187['limit']===_0xb717('0x1e');var _0x259981=_0x43e4b1['count'];var _0x41f53a=_0x4494e8?0x0:_0x18c187[_0xb717('0x1d')];var _0xe0d66c=_0x4494e8?_0x43e4b1[_0xb717('0x1f')]:_0x18c187[_0xb717('0x1d')]+_0x18c187[_0xb717('0x20')];var _0x3ac84e;if(_0xe0d66c>=_0x259981){_0xe0d66c=_0x259981;_0x3ac84e=0xc8;}else{_0x3ac84e=0xce;}_0x229cb2[_0xb717('0x1b')](_0x3ac84e);return _0x229cb2['set'](_0xb717('0x21'),_0x41f53a+'-'+_0xe0d66c+'/'+_0x259981)[_0xb717('0x1c')](_0x43e4b1);}return null;};}function patchUpdates(_0x3f38a6){return function(_0x180bd7){try{jsonpatch[_0xb717('0x22')](_0x180bd7,_0x3f38a6,!![]);}catch(_0x198522){return BPromise[_0xb717('0x23')](_0x198522);}return _0x180bd7[_0xb717('0x24')]();};}function saveUpdates(_0x2036a5,_0x41c6f4){return function(_0x16d407){if(_0x16d407){return _0x16d407[_0xb717('0x25')](_0x2036a5)['then'](function(_0x5984c9){return _0x5984c9;});}return null;};}function removeEntity(_0x421d70,_0x478ce8){return function(_0x200f68){if(_0x200f68){return _0x200f68[_0xb717('0x26')]()[_0xb717('0x27')](function(){_0x421d70[_0xb717('0x1b')](0xcc)[_0xb717('0x28')]();});}};}function handleEntityNotFound(_0x3e7f1c,_0x279ce6){return function(_0x56aea8){if(!_0x56aea8){_0x3e7f1c[_0xb717('0x1a')](0x194);}return _0x56aea8;};}function handleError(_0x56cece,_0x1ffdb0){_0x1ffdb0=_0x1ffdb0||0x1f4;return function(_0x1fe537){logger[_0xb717('0x29')](_0x1fe537[_0xb717('0x2a')]);if(_0x1fe537[_0xb717('0x2b')]){delete _0x1fe537[_0xb717('0x2b')];}_0x56cece[_0xb717('0x1b')](_0x1ffdb0)['send'](_0x1fe537);};}exports['index']=function(_0x222bde,_0x2be57f){var _0x84e2ec={},_0x526fee={},_0x25c6bb={'count':0x0,'rows':[]};var _0x8173d4=_[_0xb717('0x2c')](db['MailTransferReport'][_0xb717('0x2d')],function(_0x43c066){return{'name':_0x43c066[_0xb717('0x2e')],'type':_0x43c066['type']['key']};});_0x526fee[_0xb717('0x2f')]=_['map'](_0x8173d4,_0xb717('0x2b'));_0x526fee[_0xb717('0x30')]=_[_0xb717('0x31')](_0x222bde[_0xb717('0x30')]);_0x526fee[_0xb717('0x32')]=_['intersection'](_0x526fee[_0xb717('0x2f')],_0x526fee['query']);_0x84e2ec[_0xb717('0x33')]=_[_0xb717('0x34')](_0x526fee[_0xb717('0x2f')],qs['fields'](_0x222bde[_0xb717('0x30')][_0xb717('0x35')]));_0x84e2ec[_0xb717('0x33')]=_0x84e2ec[_0xb717('0x33')][_0xb717('0x36')]?_0x84e2ec[_0xb717('0x33')]:_0x526fee[_0xb717('0x2f')];if(!_0x222bde[_0xb717('0x30')][_0xb717('0x37')]('nolimit')){_0x84e2ec[_0xb717('0x20')]=qs[_0xb717('0x20')](_0x222bde[_0xb717('0x30')][_0xb717('0x20')]);_0x84e2ec[_0xb717('0x1d')]=qs[_0xb717('0x1d')](_0x222bde['query'][_0xb717('0x1d')]);}_0x84e2ec[_0xb717('0x38')]=qs[_0xb717('0x39')](_0x222bde[_0xb717('0x30')][_0xb717('0x39')]);_0x84e2ec[_0xb717('0x3a')]=qs['filters'](_['pick'](_0x222bde[_0xb717('0x30')],_0x526fee['filters']),_0x8173d4);if(_0x222bde[_0xb717('0x30')][_0xb717('0x3b')]){_0x84e2ec[_0xb717('0x3a')]=_['merge'](_0x84e2ec[_0xb717('0x3a')],{'$or':_[_0xb717('0x2c')](_0x8173d4,function(_0x2c1424){if(_0x2c1424[_0xb717('0x3c')]!==_0xb717('0x3d')){var _0x20be51={};_0x20be51[_0x2c1424[_0xb717('0x2b')]]={'$like':'%'+_0x222bde[_0xb717('0x30')][_0xb717('0x3b')]+'%'};return _0x20be51;}})});}_0x84e2ec=_['merge']({},_0x84e2ec,_0x222bde[_0xb717('0x3e')]);var _0x153b75={'where':_0x84e2ec[_0xb717('0x3a')]};return db['MailTransferReport'][_0xb717('0x1f')](_0x153b75)[_0xb717('0x27')](function(_0x53c1f0){_0x25c6bb[_0xb717('0x1f')]=_0x53c1f0;if(_0x222bde[_0xb717('0x30')][_0xb717('0x3f')]){_0x84e2ec[_0xb717('0x40')]=[{'all':!![]}];}return db[_0xb717('0x41')]['findAll'](_0x84e2ec);})[_0xb717('0x27')](function(_0x837f89){_0x25c6bb[_0xb717('0x42')]=_0x837f89;return _0x25c6bb;})[_0xb717('0x27')](respondWithFilteredResult(_0x2be57f,_0x84e2ec))[_0xb717('0x43')](handleError(_0x2be57f,null));};exports['show']=function(_0x801c85,_0x4b75c7){var _0x46ec23={'raw':!![],'where':{'id':_0x801c85[_0xb717('0x44')]['id']}},_0x45a07e={};_0x45a07e[_0xb717('0x2f')]=_[_0xb717('0x31')](db[_0xb717('0x41')]['rawAttributes']);_0x45a07e[_0xb717('0x30')]=_[_0xb717('0x31')](_0x801c85[_0xb717('0x30')]);_0x45a07e[_0xb717('0x32')]=_[_0xb717('0x34')](_0x45a07e[_0xb717('0x2f')],_0x45a07e[_0xb717('0x30')]);_0x46ec23['attributes']=_[_0xb717('0x34')](_0x45a07e[_0xb717('0x2f')],qs[_0xb717('0x35')](_0x801c85['query']['fields']));_0x46ec23['attributes']=_0x46ec23[_0xb717('0x33')]['length']?_0x46ec23[_0xb717('0x33')]:_0x45a07e[_0xb717('0x2f')];if(_0x801c85['query']['includeAll']){_0x46ec23[_0xb717('0x40')]=[{'all':!![]}];}_0x46ec23=_[_0xb717('0x45')]({},_0x46ec23,_0x801c85[_0xb717('0x3e')]);return db[_0xb717('0x41')][_0xb717('0x46')](_0x46ec23)['then'](handleEntityNotFound(_0x4b75c7,null))[_0xb717('0x27')](respondWithResult(_0x4b75c7,null))[_0xb717('0x43')](handleError(_0x4b75c7,null));};exports[_0xb717('0x47')]=function(_0x216f50,_0x46e399){return db[_0xb717('0x41')][_0xb717('0x47')](_0x216f50[_0xb717('0x48')],{})['then'](respondWithResult(_0x46e399,0xc9))[_0xb717('0x43')](handleError(_0x46e399,null));};exports[_0xb717('0x25')]=function(_0x31665c,_0xf42fe5){if(_0x31665c[_0xb717('0x48')]['id']){delete _0x31665c['body']['id'];}return db[_0xb717('0x41')][_0xb717('0x46')]({'where':{'id':_0x31665c[_0xb717('0x44')]['id']}})['then'](handleEntityNotFound(_0xf42fe5,null))[_0xb717('0x27')](saveUpdates(_0x31665c[_0xb717('0x48')],null))['then'](respondWithResult(_0xf42fe5,null))[_0xb717('0x43')](handleError(_0xf42fe5,null));};exports[_0xb717('0x26')]=function(_0x3c07bb,_0x1a4321){return db[_0xb717('0x41')]['find']({'where':{'id':_0x3c07bb['params']['id']}})[_0xb717('0x27')](handleEntityNotFound(_0x1a4321,null))['then'](removeEntity(_0x1a4321,null))[_0xb717('0x43')](handleError(_0x1a4321,null));};exports['describe']=function(_0x42720c,_0x41a785){return db['MailTransferReport']['describe']()[_0xb717('0x27')](respondWithResult(_0x41a785,null))['catch'](handleError(_0x41a785,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 238a883..8a95df4 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 _0xce1a=['report_mail_transfer','lodash','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','define','MailTransferReport'];(function(_0x3abe91,_0x41d1d8){var _0x1c2e99=function(_0x487630){while(--_0x487630){_0x3abe91['push'](_0x3abe91['shift']());}};_0x1c2e99(++_0x41d1d8);}(_0xce1a,0xbf));var _0xace1=function(_0x4ad762,_0x3e7464){_0x4ad762=_0x4ad762-0x0;var _0x56f931=_0xce1a[_0x4ad762];return _0x56f931;};'use strict';var _=require(_0xace1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xace1('0x1'));var BPromise=require(_0xace1('0x2'));var rp=require(_0xace1('0x3'));var fs=require('fs');var path=require(_0xace1('0x4'));var rimraf=require(_0xace1('0x5'));var config=require('../../config/environment');var attributes=require(_0xace1('0x6'));module['exports']=function(_0x4becaf,_0x55bc3e){return _0x4becaf[_0xace1('0x7')](_0xace1('0x8'),attributes,{'tableName':_0xace1('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb5ec=['request-promise','path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x11a206,_0x296fd6){var _0x5bab3c=function(_0x3fbf7a){while(--_0x3fbf7a){_0x11a206['push'](_0x11a206['shift']());}};_0x5bab3c(++_0x296fd6);}(_0xb5ec,0x97));var _0xcb5e=function(_0x500948,_0x219347){_0x500948=_0x500948-0x0;var _0xb2f173=_0xb5ec[_0x500948];return _0xb2f173;};'use strict';var _=require(_0xcb5e('0x0'));var util=require(_0xcb5e('0x1'));var logger=require(_0xcb5e('0x2'))(_0xcb5e('0x3'));var moment=require('moment');var BPromise=require(_0xcb5e('0x4'));var rp=require(_0xcb5e('0x5'));var fs=require('fs');var path=require(_0xcb5e('0x6'));var rimraf=require('rimraf');var config=require(_0xcb5e('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xcb5e('0x8')]=function(_0xfbd838,_0x38fd3e){return _0xfbd838[_0xcb5e('0x9')](_0xcb5e('0xa'),attributes,{'tableName':_0xcb5e('0xb'),'paranoid':![],'indexes':[{'name':_0xcb5e('0xc'),'fields':[_0xcb5e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 0c6d3e8..db3c38e 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 _0xc858=['MailTransferReport,\x20%s,\x20%s','message','request\x20sent','result','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc858,0x121));var _0x8c85=function(_0x58f261,_0x10e8de){_0x58f261=_0x58f261-0x0;var _0x5e8172=_0xc858[_0x58f261];return _0x5e8172;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c85('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c85('0x1'));var db=require(_0x8c85('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c85('0x3'));var config=require(_0x8c85('0x4'));var jayson=require(_0x8c85('0x5'));var client=jayson[_0x8c85('0x6')][_0x8c85('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x457c11,_0x2b918a,_0x5940cd){return new BPromise(function(_0x3275c6,_0x541ef0){return client[_0x8c85('0x8')](_0x457c11,_0x5940cd)[_0x8c85('0x9')](function(_0x255ca3){logger[_0x8c85('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x2b918a,'request\x20sent');logger[_0x8c85('0xb')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2b918a,'request\x20sent',JSON[_0x8c85('0xc')](_0x255ca3));if(_0x255ca3[_0x8c85('0xd')]){if(_0x255ca3[_0x8c85('0xd')][_0x8c85('0xe')]===0x1f4){logger[_0x8c85('0xd')](_0x8c85('0xf'),_0x2b918a,_0x255ca3[_0x8c85('0xd')]['message']);return _0x541ef0(_0x255ca3['error'][_0x8c85('0x10')]);}logger[_0x8c85('0xd')](_0x8c85('0xf'),_0x2b918a,_0x255ca3['error'][_0x8c85('0x10')]);return _0x3275c6(_0x255ca3[_0x8c85('0xd')][_0x8c85('0x10')]);}else{logger[_0x8c85('0xa')](_0x8c85('0xf'),_0x2b918a,_0x8c85('0x11'));_0x3275c6(_0x255ca3[_0x8c85('0x12')][_0x8c85('0x10')]);}})['catch'](function(_0x445494){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2b918a,_0x445494);_0x541ef0(_0x445494);});});} \ No newline at end of file +var _0xe2b6=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x549d31,_0x599bd7){var _0x48c83f=function(_0x57d9ec){while(--_0x57d9ec){_0x549d31['push'](_0x549d31['shift']());}};_0x48c83f(++_0x599bd7);}(_0xe2b6,0x8d));var _0x6e2b=function(_0x47423c,_0x49871b){_0x47423c=_0x47423c-0x0;var _0xd34166=_0xe2b6[_0x47423c];return _0xd34166;};'use strict';var _=require(_0x6e2b('0x0'));var util=require('util');var moment=require(_0x6e2b('0x1'));var BPromise=require(_0x6e2b('0x2'));var rs=require(_0x6e2b('0x3'));var fs=require('fs');var Redis=require(_0x6e2b('0x4'));var db=require(_0x6e2b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e2b('0x6'))('rpc');var config=require(_0x6e2b('0x7'));var jayson=require(_0x6e2b('0x8'));var client=jayson[_0x6e2b('0x9')][_0x6e2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a2b45,_0x4074a0,_0x51b23e){return new BPromise(function(_0x1f86d0,_0x152e4c){return client['request'](_0x2a2b45,_0x51b23e)[_0x6e2b('0xb')](function(_0x36b4b4){logger[_0x6e2b('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x4074a0,'request\x20sent');logger['debug'](_0x6e2b('0xd'),_0x4074a0,_0x6e2b('0xe'),JSON[_0x6e2b('0xf')](_0x36b4b4));if(_0x36b4b4[_0x6e2b('0x10')]){if(_0x36b4b4['error'][_0x6e2b('0x11')]===0x1f4){logger[_0x6e2b('0x10')](_0x6e2b('0x12'),_0x4074a0,_0x36b4b4[_0x6e2b('0x10')]['message']);return _0x152e4c(_0x36b4b4[_0x6e2b('0x10')][_0x6e2b('0x13')]);}logger[_0x6e2b('0x10')](_0x6e2b('0x12'),_0x4074a0,_0x36b4b4[_0x6e2b('0x10')][_0x6e2b('0x13')]);return _0x1f86d0(_0x36b4b4[_0x6e2b('0x10')][_0x6e2b('0x13')]);}else{logger[_0x6e2b('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x4074a0,_0x6e2b('0xe'));_0x1f86d0(_0x36b4b4[_0x6e2b('0x14')][_0x6e2b('0x13')]);}})[_0x6e2b('0x15')](function(_0x5d3ee8){logger[_0x6e2b('0x10')](_0x6e2b('0x12'),_0x4074a0,_0x5d3ee8);_0x152e4c(_0x5d3ee8);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a875593..3cf7bcf 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 _0x61bd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x1863be,_0x3fb18f){var _0x5835e1=function(_0xaa0e92){while(--_0xaa0e92){_0x1863be['push'](_0x1863be['shift']());}};_0x5835e1(++_0x3fb18f);}(_0x61bd,0x1c7));var _0xd61b=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x61bd[_0x2dbce7];return _0x3a3ed0;};'use strict';var multer=require(_0xd61b('0x0'));var util=require(_0xd61b('0x1'));var path=require(_0xd61b('0x2'));var timeout=require(_0xd61b('0x3'));var express=require('express');var router=express[_0xd61b('0x4')]();var fs_extra=require(_0xd61b('0x5'));var auth=require(_0xd61b('0x6'));var interaction=require(_0xd61b('0x7'));var config=require(_0xd61b('0x8'));var controller=require(_0xd61b('0x9'));router['get']('/',auth[_0xd61b('0xa')](),controller[_0xd61b('0xb')]);router['get'](_0xd61b('0xc'),auth[_0xd61b('0xa')](),controller['describe']);router[_0xd61b('0xd')](_0xd61b('0xe'),auth['isAuthenticated'](),controller[_0xd61b('0xf')]);router[_0xd61b('0x10')]('/',auth[_0xd61b('0xa')](),controller[_0xd61b('0x11')]);router[_0xd61b('0x12')](_0xd61b('0xe'),auth[_0xd61b('0xa')](),controller[_0xd61b('0x13')]);router[_0xd61b('0x14')](_0xd61b('0xe'),auth['isAuthenticated'](),controller[_0xd61b('0x15')]);module[_0xd61b('0x16')]=router; \ No newline at end of file +var _0x2198=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./memberReport.controller','index','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2198,0x17c));var _0x8219=function(_0x3ed4d7,_0x3783e0){_0x3ed4d7=_0x3ed4d7-0x0;var _0x2be1a4=_0x2198[_0x3ed4d7];return _0x2be1a4;};'use strict';var multer=require(_0x8219('0x0'));var util=require(_0x8219('0x1'));var path=require(_0x8219('0x2'));var timeout=require(_0x8219('0x3'));var express=require(_0x8219('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8219('0x5'));var interaction=require(_0x8219('0x6'));var config=require('../../config/environment');var controller=require(_0x8219('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8219('0x8')]);router[_0x8219('0x9')]('/describe',auth[_0x8219('0xa')](),controller[_0x8219('0xb')]);router[_0x8219('0x9')](_0x8219('0xc'),auth[_0x8219('0xa')](),controller[_0x8219('0xd')]);router[_0x8219('0xe')]('/',auth['isAuthenticated'](),controller[_0x8219('0xf')]);router[_0x8219('0x10')](_0x8219('0xc'),auth[_0x8219('0xa')](),controller[_0x8219('0x11')]);router['delete']('/:id',auth[_0x8219('0xa')](),controller[_0x8219('0x12')]);module[_0x8219('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c0619c0..453afed 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 _0x95bc=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x581d43,_0x2c8a96){var _0x4a11de=function(_0x200747){while(--_0x200747){_0x581d43['push'](_0x581d43['shift']());}};_0x4a11de(++_0x2c8a96);}(_0x95bc,0x17b));var _0xc95b=function(_0x5312bb,_0x41224b){_0x5312bb=_0x5312bb-0x0;var _0x4d4154=_0x95bc[_0x5312bb];return _0x4d4154;};'use strict';var Sequelize=require(_0xc95b('0x0'));var moment=require(_0xc95b('0x1'));module[_0xc95b('0x2')]={'channel':{'type':Sequelize[_0xc95b('0x3')]},'membername':{'type':Sequelize[_0xc95b('0x3')]},'interface':{'type':Sequelize[_0xc95b('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xc95b('0x4')},'duration':{'type':Sequelize[_0xc95b('0x5')]},'enterAt':{'type':Sequelize[_0xc95b('0x6')]},'exitAt':{'type':Sequelize[_0xc95b('0x6')],'set':function(_0x5aa37a){var _0x322f07=moment(_0x5aa37a);var _0x4d9229=moment(this[_0xc95b('0x7')](_0xc95b('0x8')));var _0x1c19ef=_0x322f07[_0xc95b('0x9')](_0x4d9229,_0xc95b('0xa'));this[_0xc95b('0xb')](_0xc95b('0xc'),_0x5aa37a);this[_0xc95b('0xb')](_0xc95b('0xd'),_0x1c19ef>=0x0?_0x1c19ef:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xc95b('0xe')},'data2':{'type':Sequelize[_0xc95b('0x3')],'comment':_0xc95b('0xf')},'data3':{'type':Sequelize[_0xc95b('0x3')],'comment':_0xc95b('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0xc95b('0x11')},'data5':{'type':Sequelize[_0xc95b('0x3')],'comment':_0xc95b('0x12')},'role':{'type':Sequelize[_0xc95b('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xc95b('0x3')]}}; \ No newline at end of file +var _0x8be1=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x2826b0,_0x46d50a){var _0x9a3f49=function(_0x24c993){while(--_0x24c993){_0x2826b0['push'](_0x2826b0['shift']());}};_0x9a3f49(++_0x46d50a);}(_0x8be1,0x8b));var _0x18be=function(_0x1a2d60,_0x2c9aef){_0x1a2d60=_0x1a2d60-0x0;var _0x4f2276=_0x8be1[_0x1a2d60];return _0x4f2276;};'use strict';var Sequelize=require(_0x18be('0x0'));var moment=require(_0x18be('0x1'));module[_0x18be('0x2')]={'channel':{'type':Sequelize[_0x18be('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x18be('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x18be('0x4'),'comment':_0x18be('0x5')},'duration':{'type':Sequelize[_0x18be('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x18be('0x7')],'set':function(_0x1b9d29){var _0x115368=moment(_0x1b9d29);var _0xa53352=moment(this[_0x18be('0x8')](_0x18be('0x9')));var _0x221ae4=_0x115368[_0x18be('0xa')](_0xa53352,_0x18be('0xb'));this[_0x18be('0xc')](_0x18be('0xd'),_0x1b9d29);this[_0x18be('0xc')]('duration',_0x221ae4>=0x0?_0x221ae4:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x18be('0xe')},'data2':{'type':Sequelize[_0x18be('0x3')],'comment':_0x18be('0xf')},'data3':{'type':Sequelize[_0x18be('0x3')],'comment':_0x18be('0x10')},'data4':{'type':Sequelize[_0x18be('0x3')],'comment':_0x18be('0x11')},'data5':{'type':Sequelize[_0x18be('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x18be('0x3')]},'internal':{'type':Sequelize[_0x18be('0x6')]},'uniqueid':{'type':Sequelize[_0x18be('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 3837fe7..1daec93 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x25e761,_0xe5c435){_0x25e761=_0x25e761-0x0;var _0x2740af=_0x55ca[_0x25e761];return _0x2740af;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x329502,_0x2c7184){var _0x7f91b6=function(_0x532df2){while(--_0x532df2){_0x329502['push'](_0x329502['shift']());}};_0x7f91b6(++_0x2c7184);}(_0x3e74,0x175));var _0x43e7=function(_0x310af5,_0x3d69ef){_0x310af5=_0x310af5-0x0;var _0x5a7956=_0x3e74[_0x310af5];return _0x5a7956;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 9352ef8..7cfd458 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 _0x5fe0=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername','interface','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5fe0,0xe8));var _0x05fe=function(_0x280401,_0x25bd58){_0x280401=_0x280401-0x0;var _0xce41ca=_0x5fe0[_0x280401];return _0xce41ca;};'use strict';var _=require(_0x05fe('0x0'));var util=require(_0x05fe('0x1'));var logger=require(_0x05fe('0x2'))('api');var moment=require(_0x05fe('0x3'));var BPromise=require(_0x05fe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x05fe('0x5'));var config=require(_0x05fe('0x6'));var attributes=require(_0x05fe('0x7'));module[_0x05fe('0x8')]=function(_0x5166fe,_0x5ab75f){return _0x5166fe[_0x05fe('0x9')]('MemberReport',attributes,{'tableName':_0x05fe('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x05fe('0xb'),_0x05fe('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87d3=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./memberReport.attributes','exports'];(function(_0x499b78,_0x4ed368){var _0x5e4e9e=function(_0x19a0c6){while(--_0x19a0c6){_0x499b78['push'](_0x499b78['shift']());}};_0x5e4e9e(++_0x4ed368);}(_0x87d3,0x86));var _0x387d=function(_0x21fe11,_0x52f846){_0x21fe11=_0x21fe11-0x0;var _0x5eb704=_0x87d3[_0x21fe11];return _0x5eb704;};'use strict';var _=require(_0x387d('0x0'));var util=require(_0x387d('0x1'));var logger=require(_0x387d('0x2'))(_0x387d('0x3'));var moment=require(_0x387d('0x4'));var BPromise=require(_0x387d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x387d('0x6'));var rimraf=require('rimraf');var config=require(_0x387d('0x7'));var attributes=require(_0x387d('0x8'));module[_0x387d('0x9')]=function(_0x49d349,_0x3e0d03){return _0x49d349[_0x387d('0xa')](_0x387d('0xb'),attributes,{'tableName':_0x387d('0xc'),'paranoid':![],'indexes':[{'name':_0x387d('0xd'),'fields':[_0x387d('0xe'),_0x387d('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 e4bf77a..213fc1c 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 _0x7c49=['GetMemberReport','MemberReport','options','raw','where','limit','include','map','model','attributes','debug','CreateMemberReport','create','body','UpdateMemberReport','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5a3a38,_0x128673){var _0x292773=function(_0x366220){while(--_0x366220){_0x5a3a38['push'](_0x5a3a38['shift']());}};_0x292773(++_0x128673);}(_0x7c49,0x141));var _0x97c4=function(_0x47714b,_0x5159a7){_0x47714b=_0x47714b-0x0;var _0x4b7bda=_0x7c49[_0x47714b];return _0x4b7bda;};'use strict';var _=require(_0x97c4('0x0'));var util=require(_0x97c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x97c4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97c4('0x3'))['db'];var utils=require(_0x97c4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x97c4('0x5'));var jayson=require(_0x97c4('0x6'));var client=jayson[_0x97c4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x249c86,_0x165334,_0x585222){return new BPromise(function(_0x373855,_0x339817){return client[_0x97c4('0x8')](_0x249c86,_0x585222)[_0x97c4('0x9')](function(_0x12e98d){logger[_0x97c4('0xa')](_0x97c4('0xb'),_0x165334,_0x97c4('0xc'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x165334,_0x97c4('0xc'),JSON[_0x97c4('0xd')](_0x12e98d));if(_0x12e98d['error']){if(_0x12e98d[_0x97c4('0xe')][_0x97c4('0xf')]===0x1f4){logger[_0x97c4('0xe')]('MemberReport,\x20%s,\x20%s',_0x165334,_0x12e98d['error'][_0x97c4('0x10')]);return _0x339817(_0x12e98d[_0x97c4('0xe')]['message']);}logger[_0x97c4('0xe')]('MemberReport,\x20%s,\x20%s',_0x165334,_0x12e98d[_0x97c4('0xe')][_0x97c4('0x10')]);return _0x373855(_0x12e98d[_0x97c4('0xe')][_0x97c4('0x10')]);}else{logger[_0x97c4('0xa')](_0x97c4('0xb'),_0x165334,'request\x20sent');_0x373855(_0x12e98d[_0x97c4('0x11')]['message']);}})[_0x97c4('0x12')](function(_0x465c79){logger[_0x97c4('0xe')](_0x97c4('0xb'),_0x165334,_0x465c79);_0x339817(_0x465c79);});});}exports[_0x97c4('0x13')]=function(_0x142f94){var _0xdeb273=this;return new Promise(function(_0x1ce103,_0x3057f0){return db[_0x97c4('0x14')]['findAll']({'raw':_0x142f94[_0x97c4('0x15')]?_0x142f94[_0x97c4('0x15')][_0x97c4('0x16')]===undefined?!![]:![]:!![],'where':_0x142f94['options']?_0x142f94[_0x97c4('0x15')][_0x97c4('0x17')]||null:null,'attributes':_0x142f94[_0x97c4('0x15')]?_0x142f94['options']['attributes']||null:null,'limit':_0x142f94['options']?_0x142f94['options'][_0x97c4('0x18')]||null:null,'include':_0x142f94[_0x97c4('0x15')]?_0x142f94[_0x97c4('0x15')][_0x97c4('0x19')]?_[_0x97c4('0x1a')](_0x142f94[_0x97c4('0x15')][_0x97c4('0x19')],function(_0x3c00aa){return{'model':db[_0x3c00aa[_0x97c4('0x1b')]],'as':_0x3c00aa['as'],'attributes':_0x3c00aa[_0x97c4('0x1c')],'include':_0x3c00aa[_0x97c4('0x19')]?_[_0x97c4('0x1a')](_0x3c00aa[_0x97c4('0x19')],function(_0x4afb57){return{'model':db[_0x4afb57[_0x97c4('0x1b')]],'as':_0x4afb57['as'],'attributes':_0x4afb57[_0x97c4('0x1c')],'include':_0x4afb57[_0x97c4('0x19')]?_['map'](_0x4afb57[_0x97c4('0x19')],function(_0x531c31){return{'model':db[_0x531c31[_0x97c4('0x1b')]],'as':_0x531c31['as'],'attributes':_0x531c31[_0x97c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97c4('0x9')](function(_0x40be2d){logger[_0x97c4('0xa')](_0x97c4('0x13'),_0x142f94);logger[_0x97c4('0x1d')](_0x97c4('0x13'),_0x142f94,JSON[_0x97c4('0xd')](_0x40be2d));_0x1ce103(_0x40be2d);})[_0x97c4('0x12')](function(_0x3bc0d2){logger['error'](_0x97c4('0x13'),_0x3bc0d2[_0x97c4('0x10')],_0x142f94);_0x3057f0(_0xdeb273['error'](0x1f4,_0x3bc0d2['message']));});});};exports[_0x97c4('0x1e')]=function(_0x4b7ed9){var _0x282b50=this;return new Promise(function(_0x4f361e,_0x338254){return db[_0x97c4('0x14')][_0x97c4('0x1f')](_0x4b7ed9[_0x97c4('0x20')],{'raw':_0x4b7ed9[_0x97c4('0x15')]?_0x4b7ed9[_0x97c4('0x15')][_0x97c4('0x16')]===undefined?!![]:![]:!![]})[_0x97c4('0x9')](function(_0x41d5bc){logger['info']('CreateMemberReport',_0x4b7ed9);logger[_0x97c4('0x1d')](_0x97c4('0x1e'),_0x4b7ed9,JSON[_0x97c4('0xd')](_0x41d5bc));_0x4f361e(_0x41d5bc);})[_0x97c4('0x12')](function(_0x36a066){logger[_0x97c4('0xe')](_0x97c4('0x1e'),_0x36a066[_0x97c4('0x10')],_0x4b7ed9);_0x338254(_0x282b50['error'](0x1f4,_0x36a066[_0x97c4('0x10')]));});});};exports[_0x97c4('0x21')]=function(_0xa9b340){var _0x44412f=this;return new Promise(function(_0x288b76,_0x2d391d){return db[_0x97c4('0x14')]['update'](_0xa9b340[_0x97c4('0x20')],{'raw':_0xa9b340['options']?_0xa9b340['options'][_0x97c4('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa9b340[_0x97c4('0x15')]?_0xa9b340[_0x97c4('0x15')][_0x97c4('0x17')]||null:null,'attributes':_0xa9b340[_0x97c4('0x15')]?_0xa9b340['options']['attributes']||null:null,'limit':_0xa9b340['options']?_0xa9b340['options'][_0x97c4('0x18')]||null:null})[_0x97c4('0x9')](function(_0x3ecf7b){logger[_0x97c4('0xa')](_0x97c4('0x21'),_0xa9b340);logger[_0x97c4('0x1d')](_0x97c4('0x21'),_0xa9b340,JSON['stringify'](_0x3ecf7b));_0x288b76(_0x3ecf7b);})['catch'](function(_0x10a807){logger[_0x97c4('0xe')]('UpdateMemberReport',_0x10a807[_0x97c4('0x10')],_0xa9b340);_0x2d391d(_0x44412f['error'](0x1f4,_0x10a807[_0x97c4('0x10')]));});});}; \ No newline at end of file +var _0xd206=['attributes','limit','map','include','model','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','MemberReport,\x20%s,\x20%s','info','result','catch','GetMemberReport','findAll','options','raw','where'];(function(_0x53b30b,_0x4240cd){var _0xec1d7c=function(_0x8359ae){while(--_0x8359ae){_0x53b30b['push'](_0x53b30b['shift']());}};_0xec1d7c(++_0x4240cd);}(_0xd206,0x107));var _0x6d20=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xd206[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var moment=require('moment');var BPromise=require(_0x6d20('0x2'));var rs=require(_0x6d20('0x3'));var fs=require('fs');var Redis=require(_0x6d20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d20('0x5'));var logger=require(_0x6d20('0x6'))(_0x6d20('0x7'));var config=require(_0x6d20('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d20('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc981,_0x125a39,_0x3080fb){return new BPromise(function(_0x5b4154,_0x2b338c){return client['request'](_0x4dc981,_0x3080fb)[_0x6d20('0xa')](function(_0x4222dc){logger['info']('MemberReport,\x20%s,\x20%s',_0x125a39,'request\x20sent');logger[_0x6d20('0xb')](_0x6d20('0xc'),_0x125a39,'request\x20sent',JSON[_0x6d20('0xd')](_0x4222dc));if(_0x4222dc['error']){if(_0x4222dc[_0x6d20('0xe')]['code']===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x125a39,_0x4222dc['error'][_0x6d20('0xf')]);return _0x2b338c(_0x4222dc[_0x6d20('0xe')][_0x6d20('0xf')]);}logger[_0x6d20('0xe')](_0x6d20('0x10'),_0x125a39,_0x4222dc[_0x6d20('0xe')]['message']);return _0x5b4154(_0x4222dc[_0x6d20('0xe')]['message']);}else{logger[_0x6d20('0x11')](_0x6d20('0x10'),_0x125a39,'request\x20sent');_0x5b4154(_0x4222dc[_0x6d20('0x12')][_0x6d20('0xf')]);}})[_0x6d20('0x13')](function(_0x133cd0){logger['error']('MemberReport,\x20%s,\x20%s',_0x125a39,_0x133cd0);_0x2b338c(_0x133cd0);});});}exports[_0x6d20('0x14')]=function(_0x12fad7){var _0x4f938f=this;return new Promise(function(_0x10b87,_0x5040df){return db['MemberReport'][_0x6d20('0x15')]({'raw':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x17')]===undefined?!![]:![]:!![],'where':_0x12fad7['options']?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x18')]||null:null,'attributes':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x19')]||null:null,'limit':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x1a')]||null:null,'include':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')]['include']?_[_0x6d20('0x1b')](_0x12fad7['options'][_0x6d20('0x1c')],function(_0x4db5ba){return{'model':db[_0x4db5ba[_0x6d20('0x1d')]],'as':_0x4db5ba['as'],'attributes':_0x4db5ba[_0x6d20('0x19')],'include':_0x4db5ba[_0x6d20('0x1c')]?_[_0x6d20('0x1b')](_0x4db5ba[_0x6d20('0x1c')],function(_0x20054c){return{'model':db[_0x20054c[_0x6d20('0x1d')]],'as':_0x20054c['as'],'attributes':_0x20054c[_0x6d20('0x19')],'include':_0x20054c[_0x6d20('0x1c')]?_[_0x6d20('0x1b')](_0x20054c[_0x6d20('0x1c')],function(_0x5a50a9){return{'model':db[_0x5a50a9[_0x6d20('0x1d')]],'as':_0x5a50a9['as'],'attributes':_0x5a50a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d20('0xa')](function(_0x29c2d3){logger[_0x6d20('0x11')](_0x6d20('0x14'),_0x12fad7);logger[_0x6d20('0xb')]('GetMemberReport',_0x12fad7,JSON[_0x6d20('0xd')](_0x29c2d3));_0x10b87(_0x29c2d3);})[_0x6d20('0x13')](function(_0x4f9c49){logger[_0x6d20('0xe')]('GetMemberReport',_0x4f9c49[_0x6d20('0xf')],_0x12fad7);_0x5040df(_0x4f938f[_0x6d20('0xe')](0x1f4,_0x4f9c49[_0x6d20('0xf')]));});});};exports['CreateMemberReport']=function(_0xbb5adc){var _0x1bbf05=this;return new Promise(function(_0x404921,_0x3cbb12){return db[_0x6d20('0x1e')][_0x6d20('0x1f')](_0xbb5adc[_0x6d20('0x20')],{'raw':_0xbb5adc[_0x6d20('0x16')]?_0xbb5adc[_0x6d20('0x16')][_0x6d20('0x17')]===undefined?!![]:![]:!![]})[_0x6d20('0xa')](function(_0x3b1894){logger['info'](_0x6d20('0x21'),_0xbb5adc);logger[_0x6d20('0xb')](_0x6d20('0x21'),_0xbb5adc,JSON[_0x6d20('0xd')](_0x3b1894));_0x404921(_0x3b1894);})['catch'](function(_0x4cb4d5){logger[_0x6d20('0xe')](_0x6d20('0x21'),_0x4cb4d5[_0x6d20('0xf')],_0xbb5adc);_0x3cbb12(_0x1bbf05[_0x6d20('0xe')](0x1f4,_0x4cb4d5['message']));});});};exports[_0x6d20('0x22')]=function(_0x374fba){var _0x191fee=this;return new Promise(function(_0x414cf2,_0x3b0156){return db[_0x6d20('0x1e')][_0x6d20('0x23')](_0x374fba[_0x6d20('0x20')],{'raw':_0x374fba['options']?_0x374fba[_0x6d20('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x374fba[_0x6d20('0x16')]?_0x374fba[_0x6d20('0x16')][_0x6d20('0x18')]||null:null,'attributes':_0x374fba[_0x6d20('0x16')]?_0x374fba['options'][_0x6d20('0x19')]||null:null,'limit':_0x374fba['options']?_0x374fba[_0x6d20('0x16')][_0x6d20('0x1a')]||null:null})[_0x6d20('0xa')](function(_0x24ae33){logger[_0x6d20('0x11')](_0x6d20('0x22'),_0x374fba);logger['debug'](_0x6d20('0x22'),_0x374fba,JSON['stringify'](_0x24ae33));_0x414cf2(_0x24ae33);})[_0x6d20('0x13')](function(_0x16dbbc){logger['error'](_0x6d20('0x22'),_0x16dbbc[_0x6d20('0xf')],_0x374fba);_0x3b0156(_0x191fee['error'](0x1f4,_0x16dbbc[_0x6d20('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index cbc0506..f1690a4 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 _0xa8fb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','connect-timeout'];(function(_0x536f67,_0x29cf60){var _0x1d91f3=function(_0x474336){while(--_0x474336){_0x536f67['push'](_0x536f67['shift']());}};_0x1d91f3(++_0x29cf60);}(_0xa8fb,0x172));var _0xba8f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa8fb[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xba8f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba8f('0x1'));var express=require(_0xba8f('0x2'));var router=express[_0xba8f('0x3')]();var fs_extra=require(_0xba8f('0x4'));var auth=require(_0xba8f('0x5'));var interaction=require(_0xba8f('0x6'));var config=require(_0xba8f('0x7'));var controller=require(_0xba8f('0x8'));router[_0xba8f('0x9')]('/',controller[_0xba8f('0xa')]);module[_0xba8f('0xb')]=router; \ No newline at end of file +var _0x8e52=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util'];(function(_0x290115,_0x16b8da){var _0x1f59b8=function(_0x3f4d32){while(--_0x3f4d32){_0x290115['push'](_0x290115['shift']());}};_0x1f59b8(++_0x16b8da);}(_0x8e52,0x1c6));var _0x28e5=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x8e52[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require(_0x28e5('0x0'));var path=require(_0x28e5('0x1'));var timeout=require(_0x28e5('0x2'));var express=require(_0x28e5('0x3'));var router=express[_0x28e5('0x4')]();var fs_extra=require(_0x28e5('0x5'));var auth=require(_0x28e5('0x6'));var interaction=require(_0x28e5('0x7'));var config=require(_0x28e5('0x8'));var controller=require(_0x28e5('0x9'));router[_0x28e5('0xa')]('/',controller[_0x28e5('0xb')]);module[_0x28e5('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 0bf3cc8..d000212 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 _0x01f2=['exports','STRING','version','sequelize'];(function(_0x52c08d,_0x17891c){var _0x42e3da=function(_0x40881c){while(--_0x40881c){_0x52c08d['push'](_0x52c08d['shift']());}};_0x42e3da(++_0x17891c);}(_0x01f2,0x6f));var _0x201f=function(_0xa5e70,_0x30b401){_0xa5e70=_0xa5e70-0x0;var _0x70c601=_0x01f2[_0xa5e70];return _0x70c601;};'use strict';var Sequelize=require(_0x201f('0x0'));module[_0x201f('0x1')]={'version':{'type':Sequelize[_0x201f('0x2')],'unique':_0x201f('0x3')}}; \ No newline at end of file +var _0x6cea=['sequelize','exports'];(function(_0xeeb156,_0x5392f4){var _0x4b7c74=function(_0x5705bb){while(--_0x5705bb){_0xeeb156['push'](_0xeeb156['shift']());}};_0x4b7c74(++_0x5392f4);}(_0x6cea,0xd2));var _0xa6ce=function(_0x95e80c,_0x46381c){_0x95e80c=_0x95e80c-0x0;var _0x12c4cf=_0x6cea[_0x95e80c];return _0x12c4cf;};'use strict';var Sequelize=require(_0xa6ce('0x0'));module[_0xa6ce('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 69ccaeb..d4909eb 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 _0xfe35=['hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','Migration','fieldName','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x24e733,_0x30f0f4){var _0x47fe8a=function(_0x4b02e5){while(--_0x4b02e5){_0x24e733['push'](_0x24e733['shift']());}};_0x47fe8a(++_0x30f0f4);}(_0xfe35,0x187));var _0x5fe3=function(_0x37a1a6,_0x33ae6d){_0x37a1a6=_0x37a1a6-0x0;var _0x10c5bb=_0xfe35[_0x37a1a6];return _0x10c5bb;};'use strict';var emlformat=require(_0x5fe3('0x0'));var rimraf=require(_0x5fe3('0x1'));var zipdir=require(_0x5fe3('0x2'));var jsonpatch=require(_0x5fe3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5fe3('0x4'));var path=require(_0x5fe3('0x5'));var sox=require(_0x5fe3('0x6'));var csv=require(_0x5fe3('0x7'));var ejs=require(_0x5fe3('0x8'));var fs=require('fs');var fs_extra=require(_0x5fe3('0x9'));var _=require(_0x5fe3('0xa'));var squel=require(_0x5fe3('0xb'));var crypto=require('crypto');var jsforce=require(_0x5fe3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5fe3('0x7'));var querystring=require(_0x5fe3('0xd'));var Papa=require(_0x5fe3('0xe'));var Redis=require(_0x5fe3('0xf'));var authService=require(_0x5fe3('0x10'));var qs=require(_0x5fe3('0x11'));var as=require(_0x5fe3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5fe3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5fe3('0x14'));var db=require(_0x5fe3('0x15'))['db'];function respondWithStatusCode(_0x38124e,_0xc1f867){_0xc1f867=_0xc1f867||0xcc;return function(_0x31ae03){if(_0x31ae03){return _0x38124e['sendStatus'](_0xc1f867);}return _0x38124e[_0x5fe3('0x16')](_0xc1f867)[_0x5fe3('0x17')]();};}function respondWithResult(_0x2937e9,_0x1dde92){_0x1dde92=_0x1dde92||0xc8;return function(_0x36b77e){if(_0x36b77e){return _0x2937e9[_0x5fe3('0x16')](_0x1dde92)[_0x5fe3('0x18')](_0x36b77e);}};}function respondWithFilteredResult(_0x170fbf,_0x4db3d7){return function(_0x1c9226){if(_0x1c9226){var _0x1e37d6=typeof _0x4db3d7[_0x5fe3('0x19')]===_0x5fe3('0x1a')&&typeof _0x4db3d7[_0x5fe3('0x1b')]===_0x5fe3('0x1a');var _0x5daf88=_0x1c9226[_0x5fe3('0x1c')];var _0xf0ba05=_0x1e37d6?0x0:_0x4db3d7[_0x5fe3('0x19')];var _0x534762=_0x1e37d6?_0x1c9226[_0x5fe3('0x1c')]:_0x4db3d7['offset']+_0x4db3d7[_0x5fe3('0x1b')];var _0x4bbb7d;if(_0x534762>=_0x5daf88){_0x534762=_0x5daf88;_0x4bbb7d=0xc8;}else{_0x4bbb7d=0xce;}_0x170fbf[_0x5fe3('0x16')](_0x4bbb7d);return _0x170fbf['set'](_0x5fe3('0x1d'),_0xf0ba05+'-'+_0x534762+'/'+_0x5daf88)[_0x5fe3('0x18')](_0x1c9226);}return null;};}function patchUpdates(_0x383433){return function(_0x2b2240){try{jsonpatch['apply'](_0x2b2240,_0x383433,!![]);}catch(_0x51b35e){return BPromise[_0x5fe3('0x1e')](_0x51b35e);}return _0x2b2240[_0x5fe3('0x1f')]();};}function saveUpdates(_0x40700c,_0x233a0d){return function(_0x35ba7a){if(_0x35ba7a){return _0x35ba7a[_0x5fe3('0x20')](_0x40700c)[_0x5fe3('0x21')](function(_0x66d347){return _0x66d347;});}return null;};}function removeEntity(_0x569e6f,_0xbd0766){return function(_0x466f00){if(_0x466f00){return _0x466f00[_0x5fe3('0x22')]()['then'](function(){_0x569e6f[_0x5fe3('0x16')](0xcc)[_0x5fe3('0x17')]();});}};}function handleEntityNotFound(_0x313b43,_0x3fbf51){return function(_0x1fb513){if(!_0x1fb513){_0x313b43['sendStatus'](0x194);}return _0x1fb513;};}function handleError(_0x200106,_0x312347){_0x312347=_0x312347||0x1f4;return function(_0x3e983e){logger[_0x5fe3('0x23')](_0x3e983e[_0x5fe3('0x24')]);if(_0x3e983e[_0x5fe3('0x25')]){delete _0x3e983e[_0x5fe3('0x25')];}_0x200106[_0x5fe3('0x16')](_0x312347)['send'](_0x3e983e);};}exports[_0x5fe3('0x26')]=function(_0x20b8c8,_0x535367){var _0x24856d={},_0x35d48a={},_0x3a727b={'count':0x0,'rows':[]};var _0x33bffb=_[_0x5fe3('0x27')](db[_0x5fe3('0x28')]['rawAttributes'],function(_0x1c47cd){return{'name':_0x1c47cd[_0x5fe3('0x29')],'type':_0x1c47cd['type'][_0x5fe3('0x2a')]};});_0x35d48a['model']=_['map'](_0x33bffb,_0x5fe3('0x25'));_0x35d48a[_0x5fe3('0x2b')]=_[_0x5fe3('0x2c')](_0x20b8c8[_0x5fe3('0x2b')]);_0x35d48a[_0x5fe3('0x2d')]=_[_0x5fe3('0x2e')](_0x35d48a[_0x5fe3('0x2f')],_0x35d48a[_0x5fe3('0x2b')]);_0x24856d[_0x5fe3('0x30')]=_['intersection'](_0x35d48a[_0x5fe3('0x2f')],qs[_0x5fe3('0x31')](_0x20b8c8['query']['fields']));_0x24856d[_0x5fe3('0x30')]=_0x24856d[_0x5fe3('0x30')]['length']?_0x24856d[_0x5fe3('0x30')]:_0x35d48a[_0x5fe3('0x2f')];if(!_0x20b8c8[_0x5fe3('0x2b')][_0x5fe3('0x32')]('nolimit')){_0x24856d[_0x5fe3('0x1b')]=qs[_0x5fe3('0x1b')](_0x20b8c8[_0x5fe3('0x2b')][_0x5fe3('0x1b')]);_0x24856d[_0x5fe3('0x19')]=qs[_0x5fe3('0x19')](_0x20b8c8[_0x5fe3('0x2b')][_0x5fe3('0x19')]);}_0x24856d[_0x5fe3('0x33')]=qs[_0x5fe3('0x34')](_0x20b8c8[_0x5fe3('0x2b')][_0x5fe3('0x34')]);_0x24856d['where']=qs[_0x5fe3('0x2d')](_['pick'](_0x20b8c8[_0x5fe3('0x2b')],_0x35d48a[_0x5fe3('0x2d')]),_0x33bffb);if(_0x20b8c8[_0x5fe3('0x2b')][_0x5fe3('0x35')]){_0x24856d[_0x5fe3('0x36')]=_[_0x5fe3('0x37')](_0x24856d['where'],{'$or':_[_0x5fe3('0x27')](_0x33bffb,function(_0x38bb1b){if(_0x38bb1b[_0x5fe3('0x38')]!==_0x5fe3('0x39')){var _0x1b219e={};_0x1b219e[_0x38bb1b[_0x5fe3('0x25')]]={'$like':'%'+_0x20b8c8[_0x5fe3('0x2b')]['filter']+'%'};return _0x1b219e;}})});}_0x24856d=_[_0x5fe3('0x37')]({},_0x24856d,_0x20b8c8[_0x5fe3('0x3a')]);var _0x1ff069={'where':_0x24856d[_0x5fe3('0x36')]};return db[_0x5fe3('0x28')][_0x5fe3('0x1c')](_0x1ff069)[_0x5fe3('0x21')](function(_0x5b8e3f){_0x3a727b['count']=_0x5b8e3f;if(_0x20b8c8[_0x5fe3('0x2b')][_0x5fe3('0x3b')]){_0x24856d['include']=[{'all':!![]}];}return db['Migration'][_0x5fe3('0x3c')](_0x24856d);})[_0x5fe3('0x21')](function(_0x1f9f86){_0x3a727b[_0x5fe3('0x3d')]=_0x1f9f86;return _0x3a727b;})[_0x5fe3('0x21')](respondWithFilteredResult(_0x535367,_0x24856d))[_0x5fe3('0x3e')](handleError(_0x535367,null));}; \ No newline at end of file +var _0xa069=['lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','sendStatus','error','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra'];(function(_0x3e1c79,_0x101dd6){var _0x1bd364=function(_0x1c0870){while(--_0x1c0870){_0x3e1c79['push'](_0x3e1c79['shift']());}};_0x1bd364(++_0x101dd6);}(_0xa069,0x12d));var _0x9a06=function(_0x1e3a7e,_0x22c00f){_0x1e3a7e=_0x1e3a7e-0x0;var _0x54414d=_0xa069[_0x1e3a7e];return _0x54414d;};'use strict';var emlformat=require(_0x9a06('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a06('0x2'));var moment=require(_0x9a06('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9a06('0x4'));var path=require(_0x9a06('0x5'));var sox=require(_0x9a06('0x6'));var csv=require(_0x9a06('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a06('0x8'));var _=require(_0x9a06('0x9'));var squel=require(_0x9a06('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a06('0xb'));var deskjs=require(_0x9a06('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9a06('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a06('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a06('0xf'));var logger=require(_0x9a06('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x9a06('0x11'));var licenseUtil=require(_0x9a06('0x12'));var db=require(_0x9a06('0x13'))['db'];function respondWithStatusCode(_0x46f90f,_0x28be66){_0x28be66=_0x28be66||0xcc;return function(_0x890d49){if(_0x890d49){return _0x46f90f['sendStatus'](_0x28be66);}return _0x46f90f[_0x9a06('0x14')](_0x28be66)[_0x9a06('0x15')]();};}function respondWithResult(_0x2538f0,_0x4a9a9d){_0x4a9a9d=_0x4a9a9d||0xc8;return function(_0x50bd1d){if(_0x50bd1d){return _0x2538f0['status'](_0x4a9a9d)[_0x9a06('0x16')](_0x50bd1d);}};}function respondWithFilteredResult(_0xa723d4,_0xed2f56){return function(_0x20ab4b){if(_0x20ab4b){var _0x27860d=typeof _0xed2f56[_0x9a06('0x17')]===_0x9a06('0x18')&&typeof _0xed2f56[_0x9a06('0x19')]===_0x9a06('0x18');var _0x21b169=_0x20ab4b[_0x9a06('0x1a')];var _0xbecd07=_0x27860d?0x0:_0xed2f56[_0x9a06('0x17')];var _0x414217=_0x27860d?_0x20ab4b[_0x9a06('0x1a')]:_0xed2f56[_0x9a06('0x17')]+_0xed2f56[_0x9a06('0x19')];var _0x1753fc;if(_0x414217>=_0x21b169){_0x414217=_0x21b169;_0x1753fc=0xc8;}else{_0x1753fc=0xce;}_0xa723d4[_0x9a06('0x14')](_0x1753fc);return _0xa723d4[_0x9a06('0x1b')]('Content-Range',_0xbecd07+'-'+_0x414217+'/'+_0x21b169)[_0x9a06('0x16')](_0x20ab4b);}return null;};}function patchUpdates(_0x11d79a){return function(_0x50edd0){try{jsonpatch[_0x9a06('0x1c')](_0x50edd0,_0x11d79a,!![]);}catch(_0x4b08ca){return BPromise['reject'](_0x4b08ca);}return _0x50edd0['save']();};}function saveUpdates(_0xf8401a,_0x2ad7c6){return function(_0x5190b0){if(_0x5190b0){return _0x5190b0[_0x9a06('0x1d')](_0xf8401a)[_0x9a06('0x1e')](function(_0x48cc61){return _0x48cc61;});}return null;};}function removeEntity(_0x107d4e,_0x2a987b){return function(_0x2e4ed9){if(_0x2e4ed9){return _0x2e4ed9[_0x9a06('0x1f')]()['then'](function(){_0x107d4e[_0x9a06('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3651,_0xccef54){return function(_0x16f4a6){if(!_0x16f4a6){_0x1f3651[_0x9a06('0x20')](0x194);}return _0x16f4a6;};}function handleError(_0x45676c,_0x5d2288){_0x5d2288=_0x5d2288||0x1f4;return function(_0x60d9f7){logger[_0x9a06('0x21')](_0x60d9f7['stack']);if(_0x60d9f7[_0x9a06('0x22')]){delete _0x60d9f7[_0x9a06('0x22')];}_0x45676c[_0x9a06('0x14')](_0x5d2288)[_0x9a06('0x23')](_0x60d9f7);};}exports[_0x9a06('0x24')]=function(_0x4cb464,_0x2bcd41){var _0x58104b={},_0xd40e77={},_0x2fe0da={'count':0x0,'rows':[]};var _0x30dd53=_[_0x9a06('0x25')](db[_0x9a06('0x26')][_0x9a06('0x27')],function(_0x33a4fe){return{'name':_0x33a4fe[_0x9a06('0x28')],'type':_0x33a4fe[_0x9a06('0x29')]['key']};});_0xd40e77[_0x9a06('0x2a')]=_[_0x9a06('0x25')](_0x30dd53,_0x9a06('0x22'));_0xd40e77[_0x9a06('0x2b')]=_[_0x9a06('0x2c')](_0x4cb464[_0x9a06('0x2b')]);_0xd40e77[_0x9a06('0x2d')]=_[_0x9a06('0x2e')](_0xd40e77[_0x9a06('0x2a')],_0xd40e77[_0x9a06('0x2b')]);_0x58104b['attributes']=_[_0x9a06('0x2e')](_0xd40e77[_0x9a06('0x2a')],qs[_0x9a06('0x2f')](_0x4cb464['query'][_0x9a06('0x2f')]));_0x58104b[_0x9a06('0x30')]=_0x58104b[_0x9a06('0x30')][_0x9a06('0x31')]?_0x58104b['attributes']:_0xd40e77[_0x9a06('0x2a')];if(!_0x4cb464['query'][_0x9a06('0x32')](_0x9a06('0x33'))){_0x58104b[_0x9a06('0x19')]=qs['limit'](_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x19')]);_0x58104b['offset']=qs[_0x9a06('0x17')](_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x17')]);}_0x58104b['order']=qs[_0x9a06('0x34')](_0x4cb464['query'][_0x9a06('0x34')]);_0x58104b[_0x9a06('0x35')]=qs[_0x9a06('0x2d')](_['pick'](_0x4cb464['query'],_0xd40e77[_0x9a06('0x2d')]),_0x30dd53);if(_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x36')]){_0x58104b[_0x9a06('0x35')]=_['merge'](_0x58104b[_0x9a06('0x35')],{'$or':_['map'](_0x30dd53,function(_0x270525){if(_0x270525[_0x9a06('0x29')]!==_0x9a06('0x37')){var _0x29bb37={};_0x29bb37[_0x270525[_0x9a06('0x22')]]={'$like':'%'+_0x4cb464['query'][_0x9a06('0x36')]+'%'};return _0x29bb37;}})});}_0x58104b=_[_0x9a06('0x38')]({},_0x58104b,_0x4cb464[_0x9a06('0x39')]);var _0x21a353={'where':_0x58104b[_0x9a06('0x35')]};return db['Migration']['count'](_0x21a353)[_0x9a06('0x1e')](function(_0x4e7438){_0x2fe0da[_0x9a06('0x1a')]=_0x4e7438;if(_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x3a')]){_0x58104b['include']=[{'all':!![]}];}return db[_0x9a06('0x26')][_0x9a06('0x3b')](_0x58104b);})['then'](function(_0x214929){_0x2fe0da[_0x9a06('0x3c')]=_0x214929;return _0x2fe0da;})[_0x9a06('0x1e')](respondWithFilteredResult(_0x2bcd41,_0x58104b))[_0x9a06('0x3d')](handleError(_0x2bcd41,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 0beb7a6..dfda1a8 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 _0x0083=['request-promise','./migration.attributes','exports','Migration','migrations','util','../../config/logger','api','bluebird'];(function(_0x37b61f,_0x10d723){var _0x19e25b=function(_0x42e801){while(--_0x42e801){_0x37b61f['push'](_0x37b61f['shift']());}};_0x19e25b(++_0x10d723);}(_0x0083,0x71));var _0x3008=function(_0x257579,_0x627180){_0x257579=_0x257579-0x0;var _0x1a329d=_0x0083[_0x257579];return _0x1a329d;};'use strict';var _=require('lodash');var util=require(_0x3008('0x0'));var logger=require(_0x3008('0x1'))(_0x3008('0x2'));var moment=require('moment');var BPromise=require(_0x3008('0x3'));var rp=require(_0x3008('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3008('0x5'));module[_0x3008('0x6')]=function(_0x434bd6,_0x17195d){return _0x434bd6['define'](_0x3008('0x7'),attributes,{'tableName':_0x3008('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ce8=['moment','bluebird','../../config/environment','./migration.attributes','Migration','migrations','lodash','util','../../config/logger','api'];(function(_0x3effcc,_0x389120){var _0x260966=function(_0x5dcbf9){while(--_0x5dcbf9){_0x3effcc['push'](_0x3effcc['shift']());}};_0x260966(++_0x389120);}(_0x6ce8,0x146));var _0x86ce=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x6ce8[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x86ce('0x0'));var util=require(_0x86ce('0x1'));var logger=require(_0x86ce('0x2'))(_0x86ce('0x3'));var moment=require(_0x86ce('0x4'));var BPromise=require(_0x86ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x86ce('0x6'));var attributes=require(_0x86ce('0x7'));module['exports']=function(_0x2de79b,_0x550cef){return _0x2de79b['define'](_0x86ce('0x8'),attributes,{'tableName':_0x86ce('0x9'),'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 b6d74bd..b255b96 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 _0x3d9c=['rpc','../../config/environment','jayson/promise','client','request','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a2771,_0x594afc){var _0x1031e1=function(_0x44849a){while(--_0x44849a){_0x2a2771['push'](_0x2a2771['shift']());}};_0x1031e1(++_0x594afc);}(_0x3d9c,0x134));var _0xc3d9=function(_0x2c3f5d,_0x3f9cd4){_0x2c3f5d=_0x2c3f5d-0x0;var _0x130751=_0x3d9c[_0x2c3f5d];return _0x130751;};'use strict';var _=require(_0xc3d9('0x0'));var util=require('util');var moment=require(_0xc3d9('0x1'));var BPromise=require(_0xc3d9('0x2'));var rs=require(_0xc3d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3d9('0x4'))['db'];var utils=require(_0xc3d9('0x5'));var logger=require(_0xc3d9('0x6'))(_0xc3d9('0x7'));var config=require(_0xc3d9('0x8'));var jayson=require(_0xc3d9('0x9'));var client=jayson[_0xc3d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375380,_0x46704e,_0x4ecff0){return new BPromise(function(_0x3c0a2f,_0x50bfe8){return client[_0xc3d9('0xb')](_0x375380,_0x4ecff0)[_0xc3d9('0xc')](function(_0x3f04bf){logger['info'](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));logger['debug'](_0xc3d9('0xf'),_0x46704e,_0xc3d9('0xe'),JSON[_0xc3d9('0x10')](_0x3f04bf));if(_0x3f04bf[_0xc3d9('0x11')]){if(_0x3f04bf['error'][_0xc3d9('0x12')]===0x1f4){logger['error'](_0xc3d9('0xd'),_0x46704e,_0x3f04bf[_0xc3d9('0x11')][_0xc3d9('0x13')]);return _0x50bfe8(_0x3f04bf['error'][_0xc3d9('0x13')]);}logger[_0xc3d9('0x11')]('Migration,\x20%s,\x20%s',_0x46704e,_0x3f04bf['error'][_0xc3d9('0x13')]);return _0x3c0a2f(_0x3f04bf['error'][_0xc3d9('0x13')]);}else{logger[_0xc3d9('0x14')](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));_0x3c0a2f(_0x3f04bf['result']['message']);}})['catch'](function(_0x143194){logger[_0xc3d9('0x11')](_0xc3d9('0xd'),_0x46704e,_0x143194);_0x50bfe8(_0x143194);});});} \ No newline at end of file +var _0x2cbd=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x335fa8,_0x1773b6){var _0x2e6259=function(_0x590539){while(--_0x590539){_0x335fa8['push'](_0x335fa8['shift']());}};_0x2e6259(++_0x1773b6);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x2cbd[_0x35181c];return _0xe14bf9;};'use strict';var _=require(_0xd2cb('0x0'));var util=require(_0xd2cb('0x1'));var moment=require('moment');var BPromise=require(_0xd2cb('0x2'));var rs=require(_0xd2cb('0x3'));var fs=require('fs');var Redis=require(_0xd2cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2cb('0x5'));var logger=require(_0xd2cb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd2cb('0x7'));var client=jayson[_0xd2cb('0x8')][_0xd2cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ae725,_0x4c3593,_0x2c1ead){return new BPromise(function(_0x5ef97c,_0x173a87){return client['request'](_0x1ae725,_0x2c1ead)[_0xd2cb('0xa')](function(_0xd591f7){logger['info'](_0xd2cb('0xb'),_0x4c3593,_0xd2cb('0xc'));logger['debug'](_0xd2cb('0xd'),_0x4c3593,_0xd2cb('0xc'),JSON[_0xd2cb('0xe')](_0xd591f7));if(_0xd591f7[_0xd2cb('0xf')]){if(_0xd591f7[_0xd2cb('0xf')]['code']===0x1f4){logger[_0xd2cb('0xf')](_0xd2cb('0xb'),_0x4c3593,_0xd591f7[_0xd2cb('0xf')][_0xd2cb('0x10')]);return _0x173a87(_0xd591f7[_0xd2cb('0xf')]['message']);}logger[_0xd2cb('0xf')](_0xd2cb('0xb'),_0x4c3593,_0xd591f7[_0xd2cb('0xf')]['message']);return _0x5ef97c(_0xd591f7[_0xd2cb('0xf')][_0xd2cb('0x10')]);}else{logger['info'](_0xd2cb('0xb'),_0x4c3593,'request\x20sent');_0x5ef97c(_0xd591f7['result'][_0xd2cb('0x10')]);}})[_0xd2cb('0x11')](function(_0x1a24ac){logger[_0xd2cb('0xf')]('Migration,\x20%s,\x20%s',_0x4c3593,_0x1a24ac);_0x173a87(_0x1a24ac);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index c6a12a0..33e9595 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 _0xd046=['isAuthenticated','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./network.controller','index','get','show','post','put'];(function(_0x295c6d,_0x11a9fb){var _0xa31b90=function(_0x454527){while(--_0x454527){_0x295c6d['push'](_0x295c6d['shift']());}};_0xa31b90(++_0x11a9fb);}(_0xd046,0x129));var _0x6d04=function(_0x481980,_0x377e00){_0x481980=_0x481980-0x0;var _0xadb13b=_0xd046[_0x481980];return _0xadb13b;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6d04('0xa')]('/:id',auth[_0x6d04('0xb')](),controller['update']);router['delete']('/:id',auth[_0x6d04('0xb')](),controller[_0x6d04('0xc')]);module[_0x6d04('0xd')]=router; \ No newline at end of file +var _0xbb8d=['delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','create','update'];(function(_0x1520e0,_0xe74d2b){var _0x1d217d=function(_0xbdaf47){while(--_0xbdaf47){_0x1520e0['push'](_0x1520e0['shift']());}};_0x1d217d(++_0xe74d2b);}(_0xbb8d,0x146));var _0xdbb8=function(_0x26f908,_0x26cbc7){_0x26f908=_0x26f908-0x0;var _0xbbc2d3=_0xbb8d[_0x26f908];return _0xbbc2d3;};'use strict';var multer=require(_0xdbb8('0x0'));var util=require('util');var path=require(_0xdbb8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdbb8('0x2'));var auth=require(_0xdbb8('0x3'));var interaction=require(_0xdbb8('0x4'));var config=require(_0xdbb8('0x5'));var controller=require(_0xdbb8('0x6'));router['get']('/',auth[_0xdbb8('0x7')](),controller[_0xdbb8('0x8')]);router[_0xdbb8('0x9')](_0xdbb8('0xa'),auth['isAuthenticated'](),controller[_0xdbb8('0xb')]);router['post']('/',auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xc')]);router['put'](_0xdbb8('0xa'),auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xd')]);router[_0xdbb8('0xe')](_0xdbb8('0xa'),auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xf')]);module[_0xdbb8('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index db5c424..2f5cb53 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 _0x93a7=['externip','turn','STRING','ENUM','localnet'];(function(_0x2ea432,_0x57768e){var _0x306431=function(_0x5e2645){while(--_0x5e2645){_0x2ea432['push'](_0x2ea432['shift']());}};_0x306431(++_0x57768e);}(_0x93a7,0xe9));var _0x793a=function(_0x182d89,_0xc8d85c){_0x182d89=_0x182d89-0x0;var _0x188f64=_0x93a7[_0x182d89];return _0x188f64;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x793a('0x0')](_0x793a('0x1'),_0x793a('0x2'),'stun',_0x793a('0x3'))},'value':{'type':Sequelize[_0x793a('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x793a('0x4')]}}; \ No newline at end of file +var _0x4ab6=['localnet','externip','stun','STRING','sequelize'];(function(_0x5a4023,_0x23c755){var _0x3c3165=function(_0x31dc78){while(--_0x31dc78){_0x5a4023['push'](_0x5a4023['shift']());}};_0x3c3165(++_0x23c755);}(_0x4ab6,0x1cb));var _0x64ab=function(_0x485c9f,_0x399a20){_0x485c9f=_0x485c9f-0x0;var _0x2ba76e=_0x4ab6[_0x485c9f];return _0x2ba76e;};'use strict';var Sequelize=require(_0x64ab('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x64ab('0x1'),_0x64ab('0x2'),_0x64ab('0x3'),'turn')},'value':{'type':Sequelize[_0x64ab('0x4')]},'username':{'type':Sequelize[_0x64ab('0x4')]},'password':{'type':Sequelize[_0x64ab('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 040fc13..d95bc3e 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 _0x21dd=['undefined','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','find','create','body','findAll','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','Reload','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','chan_sip.so','path','ejs','lodash','../../components/parsers/qs','api','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','status','offset','limit'];(function(_0xf20f2d,_0x2bfce4){var _0x439d76=function(_0x4b5674){while(--_0x4b5674){_0xf20f2d['push'](_0xf20f2d['shift']());}};_0x439d76(++_0x2bfce4);}(_0x21dd,0x144));var _0xd21d=function(_0x37550a,_0x467ee9){_0x37550a=_0x37550a-0x0;var _0x48870a=_0x21dd[_0x37550a];return _0x48870a;};'use strict';var util=require('util');var path=require(_0xd21d('0x0'));var ejs=require(_0xd21d('0x1'));var fs=require('fs');var _=require(_0xd21d('0x2'));var qs=require(_0xd21d('0x3'));var logger=require('../../config/logger')(_0xd21d('0x4'));var config=require('../../config/environment');var db=require(_0xd21d('0x5'))['db'];var jayson=require(_0xd21d('0x6'));var client=jayson[_0xd21d('0x7')][_0xd21d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x205a69,_0x35ece8,_0x3cd499,_0x24ce4a){return new Promise(function(_0x227d6a,_0x475466){var _0x913795=_0x24ce4a||client;return _0x913795[_0xd21d('0x9')](_0x205a69,_0x3cd499)[_0xd21d('0xa')](function(_0xb79042){logger[_0xd21d('0xb')]('Network,\x20%s,\x20%s',_0x35ece8,_0xd21d('0xc'));logger[_0xd21d('0xd')](_0xd21d('0xe'),_0x35ece8,_0xd21d('0xc'),JSON[_0xd21d('0xf')](_0xb79042));if(_0xb79042[_0xd21d('0x10')]){if(_0xb79042[_0xd21d('0x10')][_0xd21d('0x11')]===0x1f4){logger['error'](_0xd21d('0x12'),_0x35ece8,_0xb79042[_0xd21d('0x10')][_0xd21d('0x13')]);return _0x475466(_0xb79042['error'][_0xd21d('0x13')]);}logger[_0xd21d('0x10')](_0xd21d('0x12'),_0x35ece8,_0xb79042[_0xd21d('0x10')][_0xd21d('0x13')]);return _0x227d6a(_0xb79042[_0xd21d('0x10')]['message']);}else{logger[_0xd21d('0xb')](_0xd21d('0x12'),_0x35ece8,_0xd21d('0xc'));_0x227d6a(_0xb79042[_0xd21d('0x14')]['message']);}})['catch'](function(_0x4cf166){logger[_0xd21d('0x10')](_0xd21d('0x12'),_0x35ece8,_0x4cf166);_0x475466(_0x4cf166);});});}function respondWithResult(_0x5c8efc,_0x56da83){_0x56da83=_0x56da83||0xc8;return function(_0x21a0c0){if(_0x21a0c0){return _0x5c8efc[_0xd21d('0x15')](_0x56da83)['json'](_0x21a0c0);}};}function respondWithFilteredResult(_0x5f428b,_0x5ab47f){return function(_0x48608f){if(_0x48608f){var _0x4791ce=typeof _0x5ab47f[_0xd21d('0x16')]==='undefined'&&typeof _0x5ab47f[_0xd21d('0x17')]===_0xd21d('0x18');var _0x5d6815=_0x48608f[_0xd21d('0x19')];var _0x4694f5=_0x4791ce?0x0:_0x5ab47f[_0xd21d('0x16')];var _0xad6dab=_0x4791ce?_0x48608f[_0xd21d('0x19')]:_0x5ab47f[_0xd21d('0x16')]+_0x5ab47f[_0xd21d('0x17')];var _0x21f10e;if(_0xad6dab>=_0x5d6815){_0xad6dab=_0x5d6815;_0x21f10e=0xc8;}else{_0x21f10e=0xce;}_0x5f428b['status'](_0x21f10e);return _0x5f428b[_0xd21d('0x1a')](_0xd21d('0x1b'),_0x4694f5+'-'+_0xad6dab+'/'+_0x5d6815)['json'](_0x48608f);}return null;};}function saveUpdates(_0x5cf15e){return function(_0xf7bfb4){if(_0xf7bfb4){return _0xf7bfb4[_0xd21d('0x1c')](_0x5cf15e)['then'](function(_0x47370e){return _0x47370e;});}return null;};}function removeEntity(_0x257024){return function(_0x14e665){if(_0x14e665){return _0x14e665[_0xd21d('0x1d')]()['then'](function(){_0x257024[_0xd21d('0x15')](0xcc)[_0xd21d('0x1e')]();});}};}function handleEntityNotFound(_0x3239b3){return function(_0x457dc9){if(!_0x457dc9){_0x3239b3[_0xd21d('0x1f')](0x194);}return _0x457dc9;};}function handleError(_0xf6d92f,_0x4b3596){_0x4b3596=_0x4b3596||0x1f4;return function(_0x2e2a9f){logger[_0xd21d('0x10')](_0x2e2a9f['stack']);if(_0x2e2a9f[_0xd21d('0x20')]){delete _0x2e2a9f[_0xd21d('0x20')];}_0xf6d92f[_0xd21d('0x15')](_0x4b3596)[_0xd21d('0x21')](_0x2e2a9f);};}exports[_0xd21d('0x22')]=function(_0x517ff6,_0x5e25c8){var _0x19e365={},_0x23f8e7={},_0x563958={'count':0x0,'rows':[]};var _0x425592=_[_0xd21d('0x23')](db[_0xd21d('0x24')][_0xd21d('0x25')],function(_0x2f0ff3){return{'name':_0x2f0ff3[_0xd21d('0x26')],'type':_0x2f0ff3[_0xd21d('0x27')][_0xd21d('0x28')]};});_0x23f8e7[_0xd21d('0x29')]=_[_0xd21d('0x23')](_0x425592,'name');_0x23f8e7[_0xd21d('0x2a')]=_[_0xd21d('0x2b')](_0x517ff6['query']);_0x23f8e7[_0xd21d('0x2c')]=_[_0xd21d('0x2d')](_0x23f8e7[_0xd21d('0x29')],_0x23f8e7['query']);_0x19e365[_0xd21d('0x2e')]=_[_0xd21d('0x2d')](_0x23f8e7[_0xd21d('0x29')],qs[_0xd21d('0x2f')](_0x517ff6[_0xd21d('0x2a')][_0xd21d('0x2f')]));_0x19e365[_0xd21d('0x2e')]=_0x19e365[_0xd21d('0x2e')][_0xd21d('0x30')]?_0x19e365[_0xd21d('0x2e')]:_0x23f8e7['model'];if(!_0x517ff6['query'][_0xd21d('0x31')](_0xd21d('0x32'))){_0x19e365['limit']=qs[_0xd21d('0x17')](_0x517ff6[_0xd21d('0x2a')][_0xd21d('0x17')]);_0x19e365[_0xd21d('0x16')]=qs['offset'](_0x517ff6[_0xd21d('0x2a')][_0xd21d('0x16')]);}_0x19e365[_0xd21d('0x33')]=qs[_0xd21d('0x34')](_0x517ff6[_0xd21d('0x2a')]['sort']);_0x19e365[_0xd21d('0x35')]=qs['filters'](_[_0xd21d('0x36')](_0x517ff6['query'],_0x23f8e7[_0xd21d('0x2c')]),_0x425592);if(_0x517ff6['query']['filter']){_0x19e365[_0xd21d('0x35')]=_[_0xd21d('0x37')](_0x19e365[_0xd21d('0x35')],{'$or':_['map'](_0x425592,function(_0x39b88f){if(_0x39b88f[_0xd21d('0x27')]!==_0xd21d('0x38')){var _0x2cbe08={};_0x2cbe08[_0x39b88f[_0xd21d('0x20')]]={'$like':'%'+_0x517ff6[_0xd21d('0x2a')][_0xd21d('0x39')]+'%'};return _0x2cbe08;}})});}_0x19e365=_[_0xd21d('0x37')]({},_0x19e365,_0x517ff6[_0xd21d('0x3a')]);var _0xb2f8cc={'where':_0x19e365[_0xd21d('0x35')]};return db['Network'][_0xd21d('0x19')](_0xb2f8cc)[_0xd21d('0xa')](function(_0x3ffa08){_0x563958['count']=_0x3ffa08;if(_0x517ff6[_0xd21d('0x2a')][_0xd21d('0x3b')]){_0x19e365[_0xd21d('0x3c')]=[{'all':!![]}];}return db[_0xd21d('0x24')]['findAll'](_0x19e365);})[_0xd21d('0xa')](function(_0x2d06af){_0x563958['rows']=_0x2d06af;return _0x563958;})[_0xd21d('0xa')](respondWithFilteredResult(_0x5e25c8,_0x19e365))[_0xd21d('0x3d')](handleError(_0x5e25c8,null));};exports[_0xd21d('0x3e')]=function(_0x4fc748,_0x2681e7){var _0x3b4342={'raw':!![],'where':{'id':_0x4fc748[_0xd21d('0x3f')]['id']}},_0x3f6d54={};_0x3f6d54[_0xd21d('0x29')]=_[_0xd21d('0x2b')](db['Network'][_0xd21d('0x25')]);_0x3f6d54[_0xd21d('0x2a')]=_[_0xd21d('0x2b')](_0x4fc748['query']);_0x3f6d54[_0xd21d('0x2c')]=_[_0xd21d('0x2d')](_0x3f6d54[_0xd21d('0x29')],_0x3f6d54[_0xd21d('0x2a')]);_0x3b4342[_0xd21d('0x2e')]=_[_0xd21d('0x2d')](_0x3f6d54['model'],qs['fields'](_0x4fc748['query']['fields']));_0x3b4342[_0xd21d('0x2e')]=_0x3b4342['attributes'][_0xd21d('0x30')]?_0x3b4342[_0xd21d('0x2e')]:_0x3f6d54[_0xd21d('0x29')];if(_0x4fc748[_0xd21d('0x2a')]['includeAll']){_0x3b4342[_0xd21d('0x3c')]=[{'all':!![]}];}_0x3b4342=_['merge']({},_0x3b4342,_0x4fc748[_0xd21d('0x3a')]);return db[_0xd21d('0x24')][_0xd21d('0x40')](_0x3b4342)[_0xd21d('0xa')](handleEntityNotFound(_0x2681e7,null))[_0xd21d('0xa')](respondWithResult(_0x2681e7,null))[_0xd21d('0x3d')](handleError(_0x2681e7,null));};exports[_0xd21d('0x41')]=function(_0x2a824b,_0x33560b){var _0x5042c7;return db[_0xd21d('0x24')][_0xd21d('0x41')](_0x2a824b[_0xd21d('0x42')],{'raw':!![]})[_0xd21d('0xa')](function(_0x1c0c5a){_0x5042c7=_0x1c0c5a;return db[_0xd21d('0x24')][_0xd21d('0x43')]({'where':{'type':_0x2a824b[_0xd21d('0x42')][_0xd21d('0x27')]},'raw':!![]});})[_0xd21d('0xa')](function(_0x2a8d1e){if(_0x5042c7[_0xd21d('0x27')][_0xd21d('0x44')]()=='STUN'){var _0x1fab6c=fs[_0xd21d('0x45')](path[_0xd21d('0x46')](config[_0xd21d('0x47')],_0xd21d('0x48')),_0xd21d('0x49'));var _0x34331e=ejs[_0xd21d('0x4a')](_0x1fab6c,{'networks':_0x2a8d1e||[]});fs[_0xd21d('0x4b')](_0xd21d('0x4c'),_0x34331e);return respondWithRpcPromise('Reload',_0xd21d('0x41'),{'module':_0xd21d('0x4d')});}else if(_0x5042c7[_0xd21d('0x27')]['toUpperCase']()==_0xd21d('0x4e')){var _0x41cdd5=fs[_0xd21d('0x45')](path['join'](config[_0xd21d('0x47')],'server/files/templates/turn_multiple.ejs'),_0xd21d('0x49'));var _0x402eba=ejs[_0xd21d('0x4a')](_0x41cdd5,{'networks':_0x2a8d1e||[]});fs[_0xd21d('0x4b')]('/etc/asterisk/turn_xcally.conf',_0x402eba);return respondWithRpcPromise(_0xd21d('0x4f'),_0xd21d('0x41'),{'module':_0xd21d('0x4d')});}else{var _0x213b1c=fs[_0xd21d('0x45')](path[_0xd21d('0x46')](config[_0xd21d('0x47')],'server/files/templates/network.ejs'),_0xd21d('0x49'));var _0x543f19=ejs[_0xd21d('0x4a')](_0x213b1c,{'networks':_0x2a8d1e||[]});fs[_0xd21d('0x4b')](util[_0xd21d('0x50')](_0xd21d('0x51'),_0x2a824b['body'][_0xd21d('0x27')][_0xd21d('0x52')]()),_0x543f19);return respondWithRpcPromise('Reload',_0xd21d('0x41'),{'module':'chan_sip.so'});}})[_0xd21d('0xa')](function(){return _0x5042c7;})['then'](respondWithResult(_0x33560b,0xc9))[_0xd21d('0x3d')](handleError(_0x33560b,null));};exports['update']=function(_0x3da792,_0x409286){var _0x55bfa0;return db[_0xd21d('0x24')][_0xd21d('0x40')]({'where':{'id':_0x3da792['params']['id']}})[_0xd21d('0xa')](handleEntityNotFound(_0x409286,null))[_0xd21d('0xa')](saveUpdates(_0x3da792['body'],null))[_0xd21d('0xa')](function(_0x2ef5cf){if(_0x2ef5cf){_0x55bfa0=_0x2ef5cf;return db[_0xd21d('0x24')]['findAll']({'where':{'type':_0x55bfa0[_0xd21d('0x27')]},'raw':!![]});}return null;})[_0xd21d('0xa')](function(_0xbf8990){if(_0x55bfa0[_0xd21d('0x27')][_0xd21d('0x44')]()=='STUN'){var _0x1398e7=fs[_0xd21d('0x45')](path[_0xd21d('0x46')](config[_0xd21d('0x47')],_0xd21d('0x48')),_0xd21d('0x49'));var _0x56a09d=ejs[_0xd21d('0x4a')](_0x1398e7,{'networks':_0xbf8990||[]});fs[_0xd21d('0x4b')]('/etc/asterisk/stun_xcally.conf',_0x56a09d);return respondWithRpcPromise('Reload',_0xd21d('0x1c'),{'module':_0xd21d('0x4d')});}else if(_0x55bfa0[_0xd21d('0x27')][_0xd21d('0x44')]()=='TURN'){var _0x2f5e51=fs[_0xd21d('0x45')](path[_0xd21d('0x46')](config[_0xd21d('0x47')],_0xd21d('0x53')),_0xd21d('0x49'));var _0x2dfc9b=ejs[_0xd21d('0x4a')](_0x2f5e51,{'networks':_0xbf8990||[]});fs[_0xd21d('0x4b')](_0xd21d('0x54'),_0x2dfc9b);return respondWithRpcPromise(_0xd21d('0x4f'),_0xd21d('0x1c'),{'module':_0xd21d('0x4d')});}else{var _0x559bca=fs['readFileSync'](path['join'](config['root'],_0xd21d('0x55')),'utf8');var _0x3acca2=ejs[_0xd21d('0x4a')](_0x559bca,{'networks':_0xbf8990||[]});fs[_0xd21d('0x4b')](util[_0xd21d('0x50')](_0xd21d('0x51'),_0x3da792[_0xd21d('0x42')]['type'][_0xd21d('0x52')]()),_0x3acca2);return respondWithRpcPromise(_0xd21d('0x4f'),_0xd21d('0x1c'),{'module':_0xd21d('0x56')});}})[_0xd21d('0xa')](function(_0x5ebb6e){if(_0x5ebb6e){return _0x55bfa0;}return null;})[_0xd21d('0xa')](respondWithResult(_0x409286,null))[_0xd21d('0x3d')](handleError(_0x409286,null));};exports[_0xd21d('0x1d')]=function(_0x11999e,_0x3c5331){var _0x30008d;return db[_0xd21d('0x24')][_0xd21d('0x40')]({'where':{'id':_0x11999e[_0xd21d('0x3f')]['id']}})[_0xd21d('0xa')](function(_0x3c7181){_0x30008d=_0x3c7181;return _0x3c7181;})[_0xd21d('0xa')](handleEntityNotFound(_0x3c5331,null))[_0xd21d('0xa')](removeEntity(_0x3c5331,null))[_0xd21d('0xa')](function(){if(_0x30008d){return db['Network'][_0xd21d('0x43')]({'where':{'type':_0x30008d[_0xd21d('0x27')]},'raw':!![]});}})[_0xd21d('0xa')](function(_0x625573){if(_0x30008d[_0xd21d('0x27')][_0xd21d('0x44')]()=='STUN'){var _0x22b643=fs[_0xd21d('0x45')](path['join'](config[_0xd21d('0x47')],'server/files/templates/stun_multiple.ejs'),_0xd21d('0x49'));var _0x2556f7=ejs[_0xd21d('0x4a')](_0x22b643,{'networks':_0x625573||[]});fs[_0xd21d('0x4b')](_0xd21d('0x4c'),_0x2556f7);return respondWithRpcPromise(_0xd21d('0x4f'),'destroy',{'module':_0xd21d('0x4d')});}else if(_0x30008d[_0xd21d('0x27')]['toUpperCase']()==_0xd21d('0x4e')){var _0x278fc4=fs['readFileSync'](path[_0xd21d('0x46')](config[_0xd21d('0x47')],_0xd21d('0x53')),_0xd21d('0x49'));var _0x472fcb=ejs['render'](_0x278fc4,{'networks':_0x625573||[]});fs[_0xd21d('0x4b')](_0xd21d('0x54'),_0x472fcb);return respondWithRpcPromise(_0xd21d('0x4f'),_0xd21d('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x3a7f87=fs[_0xd21d('0x45')](path['join'](config[_0xd21d('0x47')],_0xd21d('0x55')),_0xd21d('0x49'));var _0x376ce0=ejs['render'](_0x3a7f87,{'networks':_0x625573||[]});fs['writeFileSync'](util[_0xd21d('0x50')]('/etc/asterisk/sip_xcally_%s.conf',_0x30008d[_0xd21d('0x27')][_0xd21d('0x52')]()),_0x376ce0);return respondWithRpcPromise(_0xd21d('0x4f'),_0xd21d('0x1d'),{'module':_0xd21d('0x56')});}})[_0xd21d('0x3d')](handleError(_0x3c5331,null));}; \ No newline at end of file +var _0x922a=['type','key','model','query','keys','attributes','fields','length','order','sort','where','filters','pick','filter','merge','Network','includeAll','include','findAll','rows','show','params','intersection','options','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','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','chan_sip.so','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x922a,0x1cd));var _0xa922=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x922a[_0x15bc81];return _0x59440e;};'use strict';var util=require('util');var path=require(_0xa922('0x0'));var ejs=require(_0xa922('0x1'));var fs=require('fs');var _=require(_0xa922('0x2'));var qs=require(_0xa922('0x3'));var logger=require(_0xa922('0x4'))('api');var config=require(_0xa922('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa922('0x6'));var client=jayson[_0xa922('0x7')][_0xa922('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x157c31,_0x28ce60,_0x1969ba,_0x11613a){return new Promise(function(_0x4abf76,_0x703d0d){var _0x793b3d=_0x11613a||client;return _0x793b3d['request'](_0x157c31,_0x1969ba)[_0xa922('0x9')](function(_0x1a3ae5){logger[_0xa922('0xa')](_0xa922('0xb'),_0x28ce60,_0xa922('0xc'));logger[_0xa922('0xd')](_0xa922('0xe'),_0x28ce60,_0xa922('0xc'),JSON['stringify'](_0x1a3ae5));if(_0x1a3ae5[_0xa922('0xf')]){if(_0x1a3ae5['error']['code']===0x1f4){logger[_0xa922('0xf')](_0xa922('0xb'),_0x28ce60,_0x1a3ae5[_0xa922('0xf')][_0xa922('0x10')]);return _0x703d0d(_0x1a3ae5[_0xa922('0xf')][_0xa922('0x10')]);}logger['error']('Network,\x20%s,\x20%s',_0x28ce60,_0x1a3ae5[_0xa922('0xf')]['message']);return _0x4abf76(_0x1a3ae5[_0xa922('0xf')][_0xa922('0x10')]);}else{logger[_0xa922('0xa')](_0xa922('0xb'),_0x28ce60,_0xa922('0xc'));_0x4abf76(_0x1a3ae5[_0xa922('0x11')][_0xa922('0x10')]);}})[_0xa922('0x12')](function(_0x7cfa2d){logger['error'](_0xa922('0xb'),_0x28ce60,_0x7cfa2d);_0x703d0d(_0x7cfa2d);});});}function respondWithResult(_0x427b9d,_0xd02630){_0xd02630=_0xd02630||0xc8;return function(_0x450138){if(_0x450138){return _0x427b9d['status'](_0xd02630)[_0xa922('0x13')](_0x450138);}};}function respondWithFilteredResult(_0x2223a5,_0x1273ae){return function(_0x33d0b3){if(_0x33d0b3){var _0x53ae16=typeof _0x1273ae[_0xa922('0x14')]===_0xa922('0x15')&&typeof _0x1273ae[_0xa922('0x16')]===_0xa922('0x15');var _0x5a2195=_0x33d0b3['count'];var _0x556c06=_0x53ae16?0x0:_0x1273ae[_0xa922('0x14')];var _0x191007=_0x53ae16?_0x33d0b3[_0xa922('0x17')]:_0x1273ae[_0xa922('0x14')]+_0x1273ae[_0xa922('0x16')];var _0xfb6444;if(_0x191007>=_0x5a2195){_0x191007=_0x5a2195;_0xfb6444=0xc8;}else{_0xfb6444=0xce;}_0x2223a5[_0xa922('0x18')](_0xfb6444);return _0x2223a5[_0xa922('0x19')](_0xa922('0x1a'),_0x556c06+'-'+_0x191007+'/'+_0x5a2195)[_0xa922('0x13')](_0x33d0b3);}return null;};}function saveUpdates(_0x2b7039){return function(_0x34e037){if(_0x34e037){return _0x34e037[_0xa922('0x1b')](_0x2b7039)[_0xa922('0x9')](function(_0x5c2cf5){return _0x5c2cf5;});}return null;};}function removeEntity(_0x5ecaf2){return function(_0x1c673d){if(_0x1c673d){return _0x1c673d[_0xa922('0x1c')]()[_0xa922('0x9')](function(){_0x5ecaf2[_0xa922('0x18')](0xcc)[_0xa922('0x1d')]();});}};}function handleEntityNotFound(_0x50ef32){return function(_0x3b7ae8){if(!_0x3b7ae8){_0x50ef32[_0xa922('0x1e')](0x194);}return _0x3b7ae8;};}function handleError(_0x45eaa9,_0x4fb86e){_0x4fb86e=_0x4fb86e||0x1f4;return function(_0x217b7d){logger['error'](_0x217b7d['stack']);if(_0x217b7d[_0xa922('0x1f')]){delete _0x217b7d[_0xa922('0x1f')];}_0x45eaa9[_0xa922('0x18')](_0x4fb86e)[_0xa922('0x20')](_0x217b7d);};}exports[_0xa922('0x21')]=function(_0x4e6483,_0x1dafbd){var _0x3e6555={},_0x2381a9={},_0x32ff41={'count':0x0,'rows':[]};var _0x5e6da7=_[_0xa922('0x22')](db['Network'][_0xa922('0x23')],function(_0x97cdfb){return{'name':_0x97cdfb[_0xa922('0x24')],'type':_0x97cdfb[_0xa922('0x25')][_0xa922('0x26')]};});_0x2381a9[_0xa922('0x27')]=_[_0xa922('0x22')](_0x5e6da7,_0xa922('0x1f'));_0x2381a9[_0xa922('0x28')]=_[_0xa922('0x29')](_0x4e6483[_0xa922('0x28')]);_0x2381a9['filters']=_['intersection'](_0x2381a9['model'],_0x2381a9[_0xa922('0x28')]);_0x3e6555[_0xa922('0x2a')]=_['intersection'](_0x2381a9[_0xa922('0x27')],qs[_0xa922('0x2b')](_0x4e6483['query']['fields']));_0x3e6555[_0xa922('0x2a')]=_0x3e6555['attributes'][_0xa922('0x2c')]?_0x3e6555['attributes']:_0x2381a9[_0xa922('0x27')];if(!_0x4e6483[_0xa922('0x28')]['hasOwnProperty']('nolimit')){_0x3e6555[_0xa922('0x16')]=qs['limit'](_0x4e6483[_0xa922('0x28')][_0xa922('0x16')]);_0x3e6555['offset']=qs[_0xa922('0x14')](_0x4e6483[_0xa922('0x28')][_0xa922('0x14')]);}_0x3e6555[_0xa922('0x2d')]=qs[_0xa922('0x2e')](_0x4e6483['query']['sort']);_0x3e6555[_0xa922('0x2f')]=qs[_0xa922('0x30')](_[_0xa922('0x31')](_0x4e6483[_0xa922('0x28')],_0x2381a9[_0xa922('0x30')]),_0x5e6da7);if(_0x4e6483['query'][_0xa922('0x32')]){_0x3e6555[_0xa922('0x2f')]=_[_0xa922('0x33')](_0x3e6555[_0xa922('0x2f')],{'$or':_[_0xa922('0x22')](_0x5e6da7,function(_0x4e9286){if(_0x4e9286[_0xa922('0x25')]!=='VIRTUAL'){var _0xd43e85={};_0xd43e85[_0x4e9286[_0xa922('0x1f')]]={'$like':'%'+_0x4e6483['query'][_0xa922('0x32')]+'%'};return _0xd43e85;}})});}_0x3e6555=_['merge']({},_0x3e6555,_0x4e6483['options']);var _0x4b4903={'where':_0x3e6555[_0xa922('0x2f')]};return db[_0xa922('0x34')][_0xa922('0x17')](_0x4b4903)[_0xa922('0x9')](function(_0xb38db1){_0x32ff41[_0xa922('0x17')]=_0xb38db1;if(_0x4e6483[_0xa922('0x28')][_0xa922('0x35')]){_0x3e6555[_0xa922('0x36')]=[{'all':!![]}];}return db['Network'][_0xa922('0x37')](_0x3e6555);})[_0xa922('0x9')](function(_0x56964c){_0x32ff41[_0xa922('0x38')]=_0x56964c;return _0x32ff41;})[_0xa922('0x9')](respondWithFilteredResult(_0x1dafbd,_0x3e6555))[_0xa922('0x12')](handleError(_0x1dafbd,null));};exports[_0xa922('0x39')]=function(_0xdeecc4,_0x4d89fb){var _0x1f32a9={'raw':!![],'where':{'id':_0xdeecc4[_0xa922('0x3a')]['id']}},_0x1b61d5={};_0x1b61d5[_0xa922('0x27')]=_['keys'](db[_0xa922('0x34')][_0xa922('0x23')]);_0x1b61d5[_0xa922('0x28')]=_[_0xa922('0x29')](_0xdeecc4[_0xa922('0x28')]);_0x1b61d5[_0xa922('0x30')]=_[_0xa922('0x3b')](_0x1b61d5[_0xa922('0x27')],_0x1b61d5['query']);_0x1f32a9[_0xa922('0x2a')]=_['intersection'](_0x1b61d5[_0xa922('0x27')],qs[_0xa922('0x2b')](_0xdeecc4[_0xa922('0x28')]['fields']));_0x1f32a9['attributes']=_0x1f32a9[_0xa922('0x2a')][_0xa922('0x2c')]?_0x1f32a9[_0xa922('0x2a')]:_0x1b61d5[_0xa922('0x27')];if(_0xdeecc4[_0xa922('0x28')][_0xa922('0x35')]){_0x1f32a9[_0xa922('0x36')]=[{'all':!![]}];}_0x1f32a9=_[_0xa922('0x33')]({},_0x1f32a9,_0xdeecc4[_0xa922('0x3c')]);return db[_0xa922('0x34')][_0xa922('0x3d')](_0x1f32a9)['then'](handleEntityNotFound(_0x4d89fb,null))['then'](respondWithResult(_0x4d89fb,null))[_0xa922('0x12')](handleError(_0x4d89fb,null));};exports['create']=function(_0x1410b3,_0xaf6c85){var _0x55f37a;return db[_0xa922('0x34')][_0xa922('0x3e')](_0x1410b3[_0xa922('0x3f')],{'raw':!![]})['then'](function(_0x2015cd){_0x55f37a=_0x2015cd;return db['Network'][_0xa922('0x37')]({'where':{'type':_0x1410b3[_0xa922('0x3f')]['type']},'raw':!![]});})[_0xa922('0x9')](function(_0x3c5d59){if(_0x55f37a[_0xa922('0x25')][_0xa922('0x40')]()==_0xa922('0x41')){var _0x5389c1=fs[_0xa922('0x42')](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x45')),_0xa922('0x46'));var _0x5c9eaa=ejs[_0xa922('0x47')](_0x5389c1,{'networks':_0x3c5d59||[]});fs[_0xa922('0x48')](_0xa922('0x49'),_0x5c9eaa);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x3e'),{'module':_0xa922('0x4b')});}else if(_0x55f37a[_0xa922('0x25')][_0xa922('0x40')]()==_0xa922('0x4c')){var _0x30514c=fs[_0xa922('0x42')](path['join'](config[_0xa922('0x44')],_0xa922('0x4d')),_0xa922('0x46'));var _0x1ffe66=ejs[_0xa922('0x47')](_0x30514c,{'networks':_0x3c5d59||[]});fs[_0xa922('0x48')](_0xa922('0x4e'),_0x1ffe66);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x3e'),{'module':_0xa922('0x4b')});}else{var _0x305d71=fs[_0xa922('0x42')](path[_0xa922('0x43')](config['root'],_0xa922('0x4f')),_0xa922('0x46'));var _0x4dccc1=ejs[_0xa922('0x47')](_0x305d71,{'networks':_0x3c5d59||[]});fs[_0xa922('0x48')](util[_0xa922('0x50')](_0xa922('0x51'),_0x1410b3[_0xa922('0x3f')]['type']['toLowerCase']()),_0x4dccc1);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x3e'),{'module':_0xa922('0x52')});}})['then'](function(){return _0x55f37a;})[_0xa922('0x9')](respondWithResult(_0xaf6c85,0xc9))[_0xa922('0x12')](handleError(_0xaf6c85,null));};exports['update']=function(_0x498356,_0x195511){var _0x637acf;return db[_0xa922('0x34')]['find']({'where':{'id':_0x498356[_0xa922('0x3a')]['id']}})[_0xa922('0x9')](handleEntityNotFound(_0x195511,null))[_0xa922('0x9')](saveUpdates(_0x498356['body'],null))[_0xa922('0x9')](function(_0x51a2f4){if(_0x51a2f4){_0x637acf=_0x51a2f4;return db[_0xa922('0x34')][_0xa922('0x37')]({'where':{'type':_0x637acf[_0xa922('0x25')]},'raw':!![]});}return null;})[_0xa922('0x9')](function(_0x5050f5){if(_0x637acf[_0xa922('0x25')]['toUpperCase']()==_0xa922('0x41')){var _0x3653dd=fs['readFileSync'](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x45')),_0xa922('0x46'));var _0x59aa3c=ejs[_0xa922('0x47')](_0x3653dd,{'networks':_0x5050f5||[]});fs['writeFileSync'](_0xa922('0x49'),_0x59aa3c);return respondWithRpcPromise(_0xa922('0x4a'),'update',{'module':_0xa922('0x4b')});}else if(_0x637acf[_0xa922('0x25')][_0xa922('0x40')]()=='TURN'){var _0x46532a=fs[_0xa922('0x42')](path[_0xa922('0x43')](config['root'],_0xa922('0x4d')),_0xa922('0x46'));var _0xfe1eef=ejs['render'](_0x46532a,{'networks':_0x5050f5||[]});fs[_0xa922('0x48')](_0xa922('0x4e'),_0xfe1eef);return respondWithRpcPromise('Reload',_0xa922('0x1b'),{'module':'res_stun_monitor.so'});}else{var _0xee168b=fs[_0xa922('0x42')](path[_0xa922('0x43')](config['root'],'server/files/templates/network.ejs'),_0xa922('0x46'));var _0x3a682c=ejs[_0xa922('0x47')](_0xee168b,{'networks':_0x5050f5||[]});fs[_0xa922('0x48')](util[_0xa922('0x50')](_0xa922('0x51'),_0x498356[_0xa922('0x3f')][_0xa922('0x25')]['toLowerCase']()),_0x3a682c);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1b'),{'module':_0xa922('0x52')});}})[_0xa922('0x9')](function(_0xd8d73a){if(_0xd8d73a){return _0x637acf;}return null;})[_0xa922('0x9')](respondWithResult(_0x195511,null))[_0xa922('0x12')](handleError(_0x195511,null));};exports[_0xa922('0x1c')]=function(_0x285a14,_0x38495b){var _0x2c24cd;return db[_0xa922('0x34')][_0xa922('0x3d')]({'where':{'id':_0x285a14[_0xa922('0x3a')]['id']}})['then'](function(_0x4cd4da){_0x2c24cd=_0x4cd4da;return _0x4cd4da;})['then'](handleEntityNotFound(_0x38495b,null))['then'](removeEntity(_0x38495b,null))[_0xa922('0x9')](function(){if(_0x2c24cd){return db['Network'][_0xa922('0x37')]({'where':{'type':_0x2c24cd[_0xa922('0x25')]},'raw':!![]});}})[_0xa922('0x9')](function(_0x3eb6e1){if(_0x2c24cd['type'][_0xa922('0x40')]()==_0xa922('0x41')){var _0x308441=fs[_0xa922('0x42')](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x45')),_0xa922('0x46'));var _0x2f360a=ejs[_0xa922('0x47')](_0x308441,{'networks':_0x3eb6e1||[]});fs[_0xa922('0x48')](_0xa922('0x49'),_0x2f360a);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1c'),{'module':_0xa922('0x4b')});}else if(_0x2c24cd[_0xa922('0x25')][_0xa922('0x40')]()==_0xa922('0x4c')){var _0x143f0c=fs[_0xa922('0x42')](path['join'](config[_0xa922('0x44')],_0xa922('0x4d')),_0xa922('0x46'));var _0x297352=ejs['render'](_0x143f0c,{'networks':_0x3eb6e1||[]});fs[_0xa922('0x48')](_0xa922('0x4e'),_0x297352);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x1a0c99=fs['readFileSync'](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x4f')),'utf8');var _0x13333f=ejs['render'](_0x1a0c99,{'networks':_0x3eb6e1||[]});fs['writeFileSync'](util[_0xa922('0x50')](_0xa922('0x51'),_0x2c24cd[_0xa922('0x25')]['toLowerCase']()),_0x13333f);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1c'),{'module':_0xa922('0x52')});}})[_0xa922('0x12')](handleError(_0x38495b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 60aba57..69d3509 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 _0x2750=['rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2bd0db,_0x1509b8){var _0x5dafba=function(_0x512f6e){while(--_0x512f6e){_0x2bd0db['push'](_0x2bd0db['shift']());}};_0x5dafba(++_0x1509b8);}(_0x2750,0x13b));var _0x0275=function(_0x1f2fd4,_0x4b52cf){_0x1f2fd4=_0x1f2fd4-0x0;var _0x200b42=_0x2750[_0x1f2fd4];return _0x200b42;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bca=['Network','network','util','moment','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x1d8fae,_0x4ad3ba){var _0x15df1e=function(_0x4d7aa7){while(--_0x4d7aa7){_0x1d8fae['push'](_0x1d8fae['shift']());}};_0x15df1e(++_0x4ad3ba);}(_0x1bca,0xb6));var _0xa1bc=function(_0xf37500,_0x56d524){_0xf37500=_0xf37500-0x0;var _0x362bb3=_0x1bca[_0xf37500];return _0x362bb3;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa1bc('0x1'));var BPromise=require('bluebird');var rp=require(_0xa1bc('0x2'));var fs=require('fs');var path=require(_0xa1bc('0x3'));var rimraf=require(_0xa1bc('0x4'));var config=require('../../config/environment');var attributes=require(_0xa1bc('0x5'));module[_0xa1bc('0x6')]=function(_0x168b44,_0x268ced){return _0x168b44['define'](_0xa1bc('0x7'),attributes,{'tableName':_0xa1bc('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 37ba709..31b8546 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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x5201d5,_0x17028f){_0x5201d5=_0x5201d5-0x0;var _0xdf2170=_0x7a54[_0x5201d5];return _0xdf2170;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x594388,_0x2ed7a0){var _0x5c099c=function(_0x1a6bdf){while(--_0x1a6bdf){_0x594388['push'](_0x594388['shift']());}};_0x5c099c(++_0x2ed7a0);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 53b854c..3be835a 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 _0x8470=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','isAuthenticated','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','notify','/:id/send','send','put','update','destroy','delete','removeDispositions','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x18e84d,_0x400654){var _0x154f7c=function(_0xbb4ecb){while(--_0xbb4ecb){_0x18e84d['push'](_0x18e84d['shift']());}};_0x154f7c(++_0x400654);}(_0x8470,0x1ee));var _0x0847=function(_0x389a70,_0x30357b){_0x389a70=_0x389a70-0x0;var _0x5b56e5=_0x8470[_0x389a70];return _0x5b56e5;};'use strict';var multer=require(_0x0847('0x0'));var util=require(_0x0847('0x1'));var path=require(_0x0847('0x2'));var timeout=require(_0x0847('0x3'));var express=require('express');var router=express[_0x0847('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0847('0x5'));var interaction=require(_0x0847('0x6'));var config=require(_0x0847('0x7'));var controller=require(_0x0847('0x8'));router[_0x0847('0x9')]('/',auth['isAuthenticated'](),controller[_0x0847('0xa')]);router['get'](_0x0847('0xb'),auth['isAuthenticated'](),controller[_0x0847('0xc')]);router[_0x0847('0x9')](_0x0847('0xd'),auth['isAuthenticated'](),controller[_0x0847('0xe')]);router[_0x0847('0x9')](_0x0847('0xf'),auth['isAuthenticated'](),controller[_0x0847('0x10')]);router[_0x0847('0x9')](_0x0847('0x11'),auth[_0x0847('0x12')](),controller['getAnswers']);router['get'](_0x0847('0x13'),auth[_0x0847('0x12')](),controller[_0x0847('0x14')]);router[_0x0847('0x9')](_0x0847('0x15'),auth[_0x0847('0x12')](),controller[_0x0847('0x16')]);router[_0x0847('0x9')](_0x0847('0x17'),auth['isAuthenticated'](),controller[_0x0847('0x18')]);router[_0x0847('0x19')]('/',auth[_0x0847('0x12')](),controller[_0x0847('0x1a')]);router['post'](_0x0847('0xf'),auth[_0x0847('0x12')](),controller[_0x0847('0x1b')]);router[_0x0847('0x19')](_0x0847('0x11'),auth[_0x0847('0x12')](),controller['addAnswer']);router[_0x0847('0x19')]('/:id/notify',controller[_0x0847('0x1c')]);router[_0x0847('0x19')](_0x0847('0x13'),auth['isAuthenticated'](),controller['addApplications']);router[_0x0847('0x19')](_0x0847('0x17'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x0847('0x1d'),auth['isAuthenticated'](),controller[_0x0847('0x1e')]);router[_0x0847('0x1f')](_0x0847('0xd'),auth[_0x0847('0x12')](),controller[_0x0847('0x20')]);router['delete'](_0x0847('0xd'),auth[_0x0847('0x12')](),controller[_0x0847('0x21')]);router[_0x0847('0x22')](_0x0847('0xf'),auth[_0x0847('0x12')](),controller[_0x0847('0x23')]);router['delete']('/:id/canned_answers',auth[_0x0847('0x12')](),controller['removeAnswers']);router[_0x0847('0x22')](_0x0847('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x33f4=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','describe','/:id','show','getDispositions','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addApplications','/:id/users','send','put','delete','/:id/canned_answers','removeAnswers','removeAgents','exports'];(function(_0x2a744b,_0x393bbc){var _0x430a5e=function(_0x4d34e9){while(--_0x4d34e9){_0x2a744b['push'](_0x2a744b['shift']());}};_0x430a5e(++_0x393bbc);}(_0x33f4,0xd8));var _0x433f=function(_0x263a65,_0x1838dc){_0x263a65=_0x263a65-0x0;var _0x5b5292=_0x33f4[_0x263a65];return _0x5b5292;};'use strict';var multer=require(_0x433f('0x0'));var util=require(_0x433f('0x1'));var path=require(_0x433f('0x2'));var timeout=require(_0x433f('0x3'));var express=require(_0x433f('0x4'));var router=express['Router']();var fs_extra=require(_0x433f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x433f('0x6'));var config=require(_0x433f('0x7'));var controller=require(_0x433f('0x8'));router['get']('/',auth[_0x433f('0x9')](),controller[_0x433f('0xa')]);router[_0x433f('0xb')]('/describe',auth[_0x433f('0x9')](),controller[_0x433f('0xc')]);router[_0x433f('0xb')](_0x433f('0xd'),auth['isAuthenticated'](),controller[_0x433f('0xe')]);router[_0x433f('0xb')]('/:id/dispositions',auth[_0x433f('0x9')](),controller[_0x433f('0xf')]);router[_0x433f('0xb')]('/:id/canned_answers',auth[_0x433f('0x9')](),controller[_0x433f('0x10')]);router['get'](_0x433f('0x11'),auth['isAuthenticated'](),controller[_0x433f('0x12')]);router[_0x433f('0xb')]('/:id/interactions',auth[_0x433f('0x9')](),controller[_0x433f('0x13')]);router[_0x433f('0xb')]('/:id/users',auth[_0x433f('0x9')](),controller[_0x433f('0x14')]);router[_0x433f('0x15')]('/',auth[_0x433f('0x9')](),controller[_0x433f('0x16')]);router[_0x433f('0x15')](_0x433f('0x17'),auth['isAuthenticated'](),controller[_0x433f('0x18')]);router[_0x433f('0x15')]('/:id/canned_answers',auth[_0x433f('0x9')](),controller[_0x433f('0x19')]);router[_0x433f('0x15')](_0x433f('0x1a'),controller['notify']);router[_0x433f('0x15')]('/:id/applications',auth[_0x433f('0x9')](),controller[_0x433f('0x1b')]);router[_0x433f('0x15')](_0x433f('0x1c'),auth[_0x433f('0x9')](),controller['addAgents']);router[_0x433f('0x15')]('/:id/send',auth[_0x433f('0x9')](),controller[_0x433f('0x1d')]);router[_0x433f('0x1e')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x433f('0x1f')](_0x433f('0xd'),auth[_0x433f('0x9')](),controller['destroy']);router[_0x433f('0x1f')]('/:id/dispositions',auth[_0x433f('0x9')](),controller['removeDispositions']);router[_0x433f('0x1f')](_0x433f('0x20'),auth[_0x433f('0x9')](),controller[_0x433f('0x21')]);router[_0x433f('0x1f')](_0x433f('0x1c'),auth['isAuthenticated'](),controller[_0x433f('0x22')]);module[_0x433f('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2971069..4003904 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 _0x6dcc=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x1059cb,_0x427828){var _0x13a07d=function(_0x4d1776){while(--_0x4d1776){_0x1059cb['push'](_0x1059cb['shift']());}};_0x13a07d(++_0x427828);}(_0x6dcc,0x86));var _0xc6dc=function(_0x4c901c,_0x30716){_0x4c901c=_0x4c901c-0x0;var _0x269caa=_0x6dcc[_0x4c901c];return _0x269caa;};'use strict';var Sequelize=require(_0xc6dc('0x0'));var rs=require(_0xc6dc('0x1'));module[_0xc6dc('0x2')]={'name':{'type':Sequelize[_0xc6dc('0x3')],'unique':_0xc6dc('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xc6dc('0x3')]},'token':{'type':Sequelize[_0xc6dc('0x3')],'defaultValue':function(){return rs[_0xc6dc('0x5')]();}},'replyUri':{'type':Sequelize[_0xc6dc('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc6dc('0x6');}},'notificationSound':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc6dc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc6dc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc6dc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc6dc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc6dc('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xc6dc('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d43c0){if(!_0x2d43c0)this[_0xc6dc('0xa')](_0xc6dc('0xb'),null);this[_0xc6dc('0xa')](_0xc6dc('0xc'),_0x2d43c0);}}}; \ No newline at end of file +var _0xab8e=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','generate'];(function(_0x5fcf45,_0x1933e4){var _0x5718ef=function(_0x245b92){while(--_0x245b92){_0x5fcf45['push'](_0x5fcf45['shift']());}};_0x5718ef(++_0x1933e4);}(_0xab8e,0x159));var _0xeab8=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xab8e[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xeab8('0x0'));module['exports']={'name':{'type':Sequelize[_0xeab8('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xeab8('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xeab8('0x2')]();}},'replyUri':{'type':Sequelize[_0xeab8('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xeab8('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xeab8('0x3')],'defaultValue':function(){return _0xeab8('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xeab8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xeab8('0x1')]},'queueTransfer':{'type':Sequelize[_0xeab8('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeab8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeab8('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeab8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeab8('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xeab8('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xeab8('0x6')],'defaultValue':![],'comment':_0xeab8('0x8'),'set':function(_0x4f1c0c){if(!_0x4f1c0c)this[_0xeab8('0x9')](_0xeab8('0xa'),null);this[_0xeab8('0x9')](_0xeab8('0xb'),_0x4f1c0c);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8015244..c26edc9 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 _0x3baf=['lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','firstName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','waitForTheAssignedAgent','queueId','unshift','queue','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','OpenchannelApplication','bulkCreate','finally','send','json','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','spread','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','offset','count','limit','set','Content-Range','apply','save','destroy','get','OpenchannelAccounts','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Applications','List','applications','orderBy','priority','asc','account','Contacts','contact'];(function(_0x2ddce7,_0x3b6942){var _0x7dcc87=function(_0x340be4){while(--_0x340be4){_0x2ddce7['push'](_0x2ddce7['shift']());}};_0x7dcc87(++_0x3b6942);}(_0x3baf,0xf7));var _0xf3ba=function(_0x568781,_0x45539f){_0x568781=_0x568781-0x0;var _0x3ca732=_0x3baf[_0x568781];return _0x3ca732;};'use strict';var emlformat=require(_0xf3ba('0x0'));var rimraf=require(_0xf3ba('0x1'));var zipdir=require(_0xf3ba('0x2'));var jsonpatch=require(_0xf3ba('0x3'));var rp=require(_0xf3ba('0x4'));var moment=require(_0xf3ba('0x5'));var BPromise=require(_0xf3ba('0x6'));var Mustache=require(_0xf3ba('0x7'));var util=require(_0xf3ba('0x8'));var path=require(_0xf3ba('0x9'));var sox=require(_0xf3ba('0xa'));var csv=require(_0xf3ba('0xb'));var ejs=require(_0xf3ba('0xc'));var fs=require('fs');var fs_extra=require(_0xf3ba('0xd'));var _=require(_0xf3ba('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf3ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3ba('0x10'));var Papa=require(_0xf3ba('0x11'));var Redis=require(_0xf3ba('0x12'));var authService=require(_0xf3ba('0x13'));var qs=require(_0xf3ba('0x14'));var as=require(_0xf3ba('0x15'));var hardwareService=require(_0xf3ba('0x16'));var logger=require(_0xf3ba('0x17'))(_0xf3ba('0x18'));var utils=require(_0xf3ba('0x19'));var config=require(_0xf3ba('0x1a'));var licenseUtil=require(_0xf3ba('0x1b'));var db=require(_0xf3ba('0x1c'))['db'];config[_0xf3ba('0x1d')]=_[_0xf3ba('0x1e')](config[_0xf3ba('0x1d')],{'host':_0xf3ba('0x1f'),'port':0x18eb});var socket=require(_0xf3ba('0x20'))(new Redis(config['redis']));require(_0xf3ba('0x21'))['register'](socket);var jayson=require(_0xf3ba('0x22'));var client=jayson[_0xf3ba('0x23')][_0xf3ba('0x24')]({'port':0x232c});var client9002=jayson[_0xf3ba('0x23')][_0xf3ba('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x53f848,_0x301856,_0x29e45b,_0x13d899){return new BPromise(function(_0x550dd3,_0x292ebb){var _0x11fbd2=_0x13d899||client;return _0x11fbd2[_0xf3ba('0x25')](_0x53f848,_0x29e45b)[_0xf3ba('0x26')](function(_0x4d3c0a){logger[_0xf3ba('0x27')](_0xf3ba('0x28'),_0x301856,'request\x20sent');logger['debug'](_0xf3ba('0x29'),_0x301856,_0xf3ba('0x2a'),JSON[_0xf3ba('0x2b')](_0x4d3c0a));if(_0x4d3c0a['error']){if(_0x4d3c0a[_0xf3ba('0x2c')][_0xf3ba('0x2d')]===0x1f4){logger[_0xf3ba('0x2c')](_0xf3ba('0x28'),_0x301856,_0x4d3c0a[_0xf3ba('0x2c')][_0xf3ba('0x2e')]);return _0x292ebb(_0x4d3c0a[_0xf3ba('0x2c')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x301856,_0x4d3c0a[_0xf3ba('0x2c')][_0xf3ba('0x2e')]);return _0x550dd3(_0x4d3c0a[_0xf3ba('0x2c')][_0xf3ba('0x2e')]);}else{logger[_0xf3ba('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x301856,'request\x20sent');_0x550dd3(_0x4d3c0a[_0xf3ba('0x2f')][_0xf3ba('0x2e')]);}})['catch'](function(_0x1c9d6a){logger[_0xf3ba('0x2c')]('OpenchannelAccount,\x20%s,\x20%s',_0x301856,_0x1c9d6a);_0x292ebb(_0x1c9d6a);});});}function respondWithStatusCode(_0x4932b9,_0x396089){_0x396089=_0x396089||0xcc;return function(_0x7effa1){if(_0x7effa1){return _0x4932b9['sendStatus'](_0x396089);}return _0x4932b9[_0xf3ba('0x30')](_0x396089)[_0xf3ba('0x31')]();};}function respondWithResult(_0x15ac44,_0x5a880e){_0x5a880e=_0x5a880e||0xc8;return function(_0x29ed57){if(_0x29ed57){return _0x15ac44['status'](_0x5a880e)['json'](_0x29ed57);}};}function respondWithFilteredResult(_0x7c1a60,_0x19ef2c){return function(_0x5b4e0d){if(_0x5b4e0d){var _0x41c4b1=typeof _0x19ef2c[_0xf3ba('0x32')]==='undefined'&&typeof _0x19ef2c['limit']==='undefined';var _0x1c6062=_0x5b4e0d[_0xf3ba('0x33')];var _0x47c15f=_0x41c4b1?0x0:_0x19ef2c[_0xf3ba('0x32')];var _0x5b2f0d=_0x41c4b1?_0x5b4e0d['count']:_0x19ef2c[_0xf3ba('0x32')]+_0x19ef2c[_0xf3ba('0x34')];var _0x26b6e9;if(_0x5b2f0d>=_0x1c6062){_0x5b2f0d=_0x1c6062;_0x26b6e9=0xc8;}else{_0x26b6e9=0xce;}_0x7c1a60[_0xf3ba('0x30')](_0x26b6e9);return _0x7c1a60[_0xf3ba('0x35')](_0xf3ba('0x36'),_0x47c15f+'-'+_0x5b2f0d+'/'+_0x1c6062)['json'](_0x5b4e0d);}return null;};}function patchUpdates(_0x21c300){return function(_0x487ed6){try{jsonpatch[_0xf3ba('0x37')](_0x487ed6,_0x21c300,!![]);}catch(_0x44c489){return BPromise['reject'](_0x44c489);}return _0x487ed6[_0xf3ba('0x38')]();};}function saveUpdates(_0x36b6a1,_0x23ccad){return function(_0xab4960){if(_0xab4960){return _0xab4960['update'](_0x36b6a1)[_0xf3ba('0x26')](function(_0x553573){return _0x553573;});}return null;};}function removeEntity(_0x5e7536,_0x48854d){return function(_0x22fde8){if(_0x22fde8){return _0x22fde8[_0xf3ba('0x39')]()[_0xf3ba('0x26')](function(){var _0x38e691=_0x22fde8[_0xf3ba('0x3a')]({'plain':!![]});var _0x55b29b=_0xf3ba('0x3b');return db['UserProfileResource'][_0xf3ba('0x39')]({'where':{'type':_0x55b29b,'resourceId':_0x38e691['id']}})['then'](function(){return _0x22fde8;});})[_0xf3ba('0x26')](function(){_0x5e7536[_0xf3ba('0x30')](0xcc)[_0xf3ba('0x31')]();});}};}function handleEntityNotFound(_0x1607a4,_0x55d9be){return function(_0x2a4c16){if(!_0x2a4c16){_0x1607a4[_0xf3ba('0x3c')](0x194);}return _0x2a4c16;};}function handleError(_0x5a1536,_0x3d844d){_0x3d844d=_0x3d844d||0x1f4;return function(_0x2405e5){logger[_0xf3ba('0x2c')](_0x2405e5[_0xf3ba('0x3d')]);if(_0x2405e5[_0xf3ba('0x3e')]){delete _0x2405e5[_0xf3ba('0x3e')];}_0x5a1536[_0xf3ba('0x30')](_0x3d844d)['send'](_0x2405e5);};}exports[_0xf3ba('0x3f')]=function(_0x527092,_0x4307db){var _0x5a5ed3={'include':[{'model':db[_0xf3ba('0x40')],'as':_0xf3ba('0x41')}]},_0x1db835={},_0x2de8bf={'count':0x0,'rows':[]};var _0x2cbfca=_['map'](db['OpenchannelAccount'][_0xf3ba('0x42')],function(_0x27b810){return{'name':_0x27b810[_0xf3ba('0x43')],'type':_0x27b810[_0xf3ba('0x44')][_0xf3ba('0x45')]};});_0x1db835[_0xf3ba('0x46')]=_['map'](_0x2cbfca,_0xf3ba('0x3e'));_0x1db835['query']=_[_0xf3ba('0x47')](_0x527092[_0xf3ba('0x48')]);_0x1db835[_0xf3ba('0x49')]=_[_0xf3ba('0x4a')](_0x1db835[_0xf3ba('0x46')],_0x1db835[_0xf3ba('0x48')]);_0x5a5ed3[_0xf3ba('0x4b')]=_[_0xf3ba('0x4a')](_0x1db835['model'],qs[_0xf3ba('0x4c')](_0x527092[_0xf3ba('0x48')][_0xf3ba('0x4c')]));_0x5a5ed3[_0xf3ba('0x4b')]=_0x5a5ed3[_0xf3ba('0x4b')][_0xf3ba('0x4d')]?_0x5a5ed3[_0xf3ba('0x4b')]:_0x1db835['model'];if(!_0x527092[_0xf3ba('0x48')][_0xf3ba('0x4e')]('nolimit')){_0x5a5ed3[_0xf3ba('0x34')]=qs[_0xf3ba('0x34')](_0x527092[_0xf3ba('0x48')][_0xf3ba('0x34')]);_0x5a5ed3[_0xf3ba('0x32')]=qs[_0xf3ba('0x32')](_0x527092[_0xf3ba('0x48')][_0xf3ba('0x32')]);}_0x5a5ed3[_0xf3ba('0x4f')]=qs[_0xf3ba('0x50')](_0x527092[_0xf3ba('0x48')][_0xf3ba('0x50')]);_0x5a5ed3[_0xf3ba('0x51')]=qs[_0xf3ba('0x49')](_[_0xf3ba('0x52')](_0x527092[_0xf3ba('0x48')],_0x1db835[_0xf3ba('0x49')]),_0x2cbfca);if(_0x527092[_0xf3ba('0x48')]['filter']){_0x5a5ed3[_0xf3ba('0x51')]=_[_0xf3ba('0x53')](_0x5a5ed3['where'],{'$or':_[_0xf3ba('0x54')](_0x2cbfca,function(_0x3675ea){if(_0x3675ea[_0xf3ba('0x44')]!==_0xf3ba('0x55')){var _0x52ef61={};_0x52ef61[_0x3675ea['name']]={'$like':'%'+_0x527092[_0xf3ba('0x48')][_0xf3ba('0x56')]+'%'};return _0x52ef61;}})});}_0x5a5ed3=_[_0xf3ba('0x53')]({},_0x5a5ed3,_0x527092[_0xf3ba('0x57')]);var _0x502483={'where':_0x5a5ed3[_0xf3ba('0x51')]};return db[_0xf3ba('0x58')][_0xf3ba('0x33')](_0x502483)['then'](function(_0x8f2340){_0x2de8bf[_0xf3ba('0x33')]=_0x8f2340;if(_0x527092[_0xf3ba('0x48')][_0xf3ba('0x59')]){_0x5a5ed3[_0xf3ba('0x5a')]=[{'all':!![]}];}return db[_0xf3ba('0x58')][_0xf3ba('0x5b')](_0x5a5ed3);})[_0xf3ba('0x26')](function(_0x4620c0){_0x2de8bf[_0xf3ba('0x5c')]=_0x4620c0;return _0x2de8bf;})['then'](respondWithFilteredResult(_0x4307db,_0x5a5ed3))[_0xf3ba('0x5d')](handleError(_0x4307db,null));};exports[_0xf3ba('0x5e')]=function(_0x41c4c6,_0x3bbf79){var _0x47cb4f={'raw':![],'where':{'id':_0x41c4c6['params']['id']},'include':[{'model':db['Pause'],'as':_0xf3ba('0x41')}]},_0x443845={};_0x443845[_0xf3ba('0x46')]=_[_0xf3ba('0x47')](db[_0xf3ba('0x58')][_0xf3ba('0x42')]);_0x443845[_0xf3ba('0x48')]=_[_0xf3ba('0x47')](_0x41c4c6[_0xf3ba('0x48')]);_0x443845['filters']=_[_0xf3ba('0x4a')](_0x443845[_0xf3ba('0x46')],_0x443845[_0xf3ba('0x48')]);_0x47cb4f[_0xf3ba('0x4b')]=_['intersection'](_0x443845['model'],qs[_0xf3ba('0x4c')](_0x41c4c6[_0xf3ba('0x48')][_0xf3ba('0x4c')]));_0x47cb4f[_0xf3ba('0x4b')]=_0x47cb4f[_0xf3ba('0x4b')]['length']?_0x47cb4f[_0xf3ba('0x4b')]:_0x443845['model'];if(_0x41c4c6[_0xf3ba('0x48')]['includeAll']){_0x47cb4f[_0xf3ba('0x5a')]=[{'all':!![]}];}_0x47cb4f=_['merge']({},_0x47cb4f,_0x41c4c6[_0xf3ba('0x57')]);return db[_0xf3ba('0x58')][_0xf3ba('0x5f')](_0x47cb4f)[_0xf3ba('0x26')](handleEntityNotFound(_0x3bbf79,null))[_0xf3ba('0x26')](respondWithResult(_0x3bbf79,null))['catch'](handleError(_0x3bbf79,null));};exports[_0xf3ba('0x60')]=function(_0x461e80,_0xe7cb69){return db['OpenchannelAccount'][_0xf3ba('0x60')](_0x461e80['body'],{})[_0xf3ba('0x26')](function(_0x14b7b1){var _0x471f81=_0x461e80[_0xf3ba('0x61')][_0xf3ba('0x3a')]({'plain':!![]});if(!_0x471f81)throw new Error(_0xf3ba('0x62'));if(_0x471f81[_0xf3ba('0x63')]===_0xf3ba('0x61')){var _0xc39733=_0x14b7b1[_0xf3ba('0x3a')]({'plain':!![]});var _0x10cc72='OpenchannelAccounts';return db[_0xf3ba('0x64')]['find']({'where':{'name':_0x10cc72,'userProfileId':_0x471f81[_0xf3ba('0x65')]},'raw':!![]})[_0xf3ba('0x26')](function(_0x122e14){if(_0x122e14&&_0x122e14[_0xf3ba('0x66')]===0x0){return db['UserProfileResource'][_0xf3ba('0x60')]({'name':_0xc39733[_0xf3ba('0x3e')],'resourceId':_0xc39733['id'],'type':_0x122e14[_0xf3ba('0x3e')],'sectionId':_0x122e14['id']},{})[_0xf3ba('0x26')](function(){return _0x14b7b1;});}else{return _0x14b7b1;}})[_0xf3ba('0x5d')](function(_0x3e79a2){logger[_0xf3ba('0x2c')](_0xf3ba('0x67'),_0x3e79a2);throw _0x3e79a2;});}return _0x14b7b1;})[_0xf3ba('0x26')](respondWithResult(_0xe7cb69,0xc9))[_0xf3ba('0x5d')](handleError(_0xe7cb69,null));};exports['update']=function(_0x4f8aa0,_0x597e2c){if(_0x4f8aa0['body']['id']){delete _0x4f8aa0[_0xf3ba('0x68')]['id'];}return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x4f8aa0['params']['id']},'include':[{'model':db[_0xf3ba('0x40')],'as':'mandatoryDispositionPause'}]})[_0xf3ba('0x26')](handleEntityNotFound(_0x597e2c,null))[_0xf3ba('0x26')](saveUpdates(_0x4f8aa0['body'],null))['then'](respondWithResult(_0x597e2c,null))[_0xf3ba('0x5d')](handleError(_0x597e2c,null));};exports['destroy']=function(_0x2c0d34,_0x4b4422){return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x2c0d34[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x4b4422,null))['then'](removeEntity(_0x4b4422,null))[_0xf3ba('0x5d')](handleError(_0x4b4422,null));};exports['describe']=function(_0x5471fb,_0x469c8f){return db[_0xf3ba('0x58')][_0xf3ba('0x6a')]()[_0xf3ba('0x26')](respondWithResult(_0x469c8f,null))[_0xf3ba('0x5d')](handleError(_0x469c8f,null));};exports[_0xf3ba('0x6b')]=function(_0x50d113,_0x2b9399,_0x10dd29){if(_0x50d113[_0xf3ba('0x68')]['id']){delete _0x50d113['body']['id'];}return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x50d113[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x2b9399,null))['then'](function(_0x143ceb){if(_0x143ceb){_0x50d113[_0xf3ba('0x68')][_0xf3ba('0x6c')]=_0x143ceb['id'];return db[_0xf3ba('0x6d')][_0xf3ba('0x60')](_0x50d113['body']);}})[_0xf3ba('0x26')](respondWithResult(_0x2b9399,null))[_0xf3ba('0x5d')](handleError(_0x2b9399,null));};exports[_0xf3ba('0x6e')]=function(_0x1d5d2a,_0x33047b,_0x33020b){var _0x191868={'raw':![],'where':{}};var _0x637e51={};var _0x4e20c0={'count':0x0,'rows':[]};return db[_0xf3ba('0x58')][_0xf3ba('0x6f')]({'where':{'id':_0x1d5d2a[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x33047b,null))['then'](function(_0x36a466){if(_0x36a466){_0x637e51['model']=_[_0xf3ba('0x47')](db[_0xf3ba('0x6d')][_0xf3ba('0x42')]);_0x637e51[_0xf3ba('0x48')]=_[_0xf3ba('0x47')](_0x1d5d2a[_0xf3ba('0x48')]);_0x637e51[_0xf3ba('0x49')]=_[_0xf3ba('0x4a')](_0x637e51['model'],_0x637e51[_0xf3ba('0x48')]);_0x191868[_0xf3ba('0x4b')]=_[_0xf3ba('0x4a')](_0x637e51['model'],qs[_0xf3ba('0x4c')](_0x1d5d2a[_0xf3ba('0x48')][_0xf3ba('0x4c')]));_0x191868[_0xf3ba('0x4b')]=_0x191868[_0xf3ba('0x4b')][_0xf3ba('0x4d')]?_0x191868[_0xf3ba('0x4b')]:_0x637e51[_0xf3ba('0x46')];if(!_0x1d5d2a[_0xf3ba('0x48')]['hasOwnProperty']('nolimit')){_0x191868[_0xf3ba('0x34')]=qs[_0xf3ba('0x34')](_0x1d5d2a['query'][_0xf3ba('0x34')]);_0x191868['offset']=qs[_0xf3ba('0x32')](_0x1d5d2a['query'][_0xf3ba('0x32')]);}_0x191868[_0xf3ba('0x4f')]=qs['sort'](_0x1d5d2a[_0xf3ba('0x48')]['sort']);_0x191868[_0xf3ba('0x51')]=qs[_0xf3ba('0x49')](_[_0xf3ba('0x52')](_0x1d5d2a[_0xf3ba('0x48')],_0x637e51[_0xf3ba('0x49')]));_0x191868[_0xf3ba('0x51')][_0xf3ba('0x6c')]=_0x36a466['id'];if(_0x1d5d2a[_0xf3ba('0x48')][_0xf3ba('0x56')]){_0x191868['where']=_[_0xf3ba('0x53')](_0x191868[_0xf3ba('0x51')],{'$or':_[_0xf3ba('0x54')](_0x191868[_0xf3ba('0x4b')],function(_0x2cd4f6){var _0x1e9f14={};_0x1e9f14[_0x2cd4f6]={'$like':'%'+_0x1d5d2a['query'][_0xf3ba('0x56')]+'%'};return _0x1e9f14;})});}_0x191868=_[_0xf3ba('0x53')]({},_0x191868,_0x1d5d2a[_0xf3ba('0x57')]);return db['Disposition'][_0xf3ba('0x33')]({'where':_0x191868[_0xf3ba('0x51')]})[_0xf3ba('0x26')](function(_0x43ef9f){_0x4e20c0[_0xf3ba('0x33')]=_0x43ef9f;if(_0x1d5d2a[_0xf3ba('0x48')]['includeAll']){_0x191868[_0xf3ba('0x5a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x191868);})[_0xf3ba('0x26')](function(_0x368540){_0x4e20c0['rows']=_0x368540;return _0x4e20c0;});}})['then'](respondWithFilteredResult(_0x33047b,_0x191868))[_0xf3ba('0x5d')](handleError(_0x33047b,null));};exports[_0xf3ba('0x70')]=function(_0x385141,_0xf366be,_0x17842e){return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x385141['params']['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0xf366be,null))[_0xf3ba('0x26')](function(_0x4de6d1){if(_0x4de6d1){return _0x4de6d1[_0xf3ba('0x70')](_0x385141[_0xf3ba('0x48')][_0xf3ba('0x71')]);}})[_0xf3ba('0x26')](respondWithStatusCode(_0xf366be,null))[_0xf3ba('0x5d')](handleError(_0xf366be,null));};exports[_0xf3ba('0x72')]=function(_0x850d1a,_0x25c496,_0x499ac3){if(_0x850d1a['body']['id']){delete _0x850d1a['body']['id'];}return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x850d1a['params']['id']}})['then'](handleEntityNotFound(_0x25c496,null))['then'](function(_0x39a22f){if(_0x39a22f){_0x850d1a[_0xf3ba('0x68')]['OpenchannelAccountId']=_0x39a22f['id'];return db[_0xf3ba('0x73')][_0xf3ba('0x60')](_0x850d1a[_0xf3ba('0x68')]);}})[_0xf3ba('0x26')](respondWithResult(_0x25c496,null))[_0xf3ba('0x5d')](handleError(_0x25c496,null));};exports[_0xf3ba('0x74')]=function(_0x14d350,_0x3bc463,_0x7dc26){var _0x4e7560={'raw':![],'where':{}};var _0x113240={};var _0x9142b4={'count':0x0,'rows':[]};return db[_0xf3ba('0x58')][_0xf3ba('0x6f')]({'where':{'id':_0x14d350[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x3bc463,null))[_0xf3ba('0x26')](function(_0x28b3cb){if(_0x28b3cb){_0x113240[_0xf3ba('0x46')]=_[_0xf3ba('0x47')](db[_0xf3ba('0x73')][_0xf3ba('0x42')]);_0x113240[_0xf3ba('0x48')]=_[_0xf3ba('0x47')](_0x14d350['query']);_0x113240[_0xf3ba('0x49')]=_[_0xf3ba('0x4a')](_0x113240[_0xf3ba('0x46')],_0x113240[_0xf3ba('0x48')]);_0x4e7560[_0xf3ba('0x4b')]=_[_0xf3ba('0x4a')](_0x113240['model'],qs[_0xf3ba('0x4c')](_0x14d350[_0xf3ba('0x48')][_0xf3ba('0x4c')]));_0x4e7560[_0xf3ba('0x4b')]=_0x4e7560[_0xf3ba('0x4b')]['length']?_0x4e7560[_0xf3ba('0x4b')]:_0x113240[_0xf3ba('0x46')];if(!_0x14d350['query'][_0xf3ba('0x4e')](_0xf3ba('0x75'))){_0x4e7560['limit']=qs[_0xf3ba('0x34')](_0x14d350[_0xf3ba('0x48')]['limit']);_0x4e7560[_0xf3ba('0x32')]=qs[_0xf3ba('0x32')](_0x14d350[_0xf3ba('0x48')][_0xf3ba('0x32')]);}_0x4e7560['order']=qs[_0xf3ba('0x50')](_0x14d350[_0xf3ba('0x48')][_0xf3ba('0x50')]);_0x4e7560['where']=qs[_0xf3ba('0x49')](_[_0xf3ba('0x52')](_0x14d350[_0xf3ba('0x48')],_0x113240[_0xf3ba('0x49')]));_0x4e7560[_0xf3ba('0x51')][_0xf3ba('0x6c')]=_0x28b3cb['id'];if(_0x14d350[_0xf3ba('0x48')]['filter']){_0x4e7560['where']=_[_0xf3ba('0x53')](_0x4e7560[_0xf3ba('0x51')],{'$or':_['map'](_0x4e7560['attributes'],function(_0x51dc63){var _0x463bf0={};_0x463bf0[_0x51dc63]={'$like':'%'+_0x14d350[_0xf3ba('0x48')]['filter']+'%'};return _0x463bf0;})});}_0x4e7560=_[_0xf3ba('0x53')]({},_0x4e7560,_0x14d350[_0xf3ba('0x57')]);return db[_0xf3ba('0x73')][_0xf3ba('0x33')]({'where':_0x4e7560[_0xf3ba('0x51')]})['then'](function(_0x1898b2){_0x9142b4[_0xf3ba('0x33')]=_0x1898b2;if(_0x14d350['query']['includeAll']){_0x4e7560[_0xf3ba('0x5a')]=[{'all':!![]}];}return db[_0xf3ba('0x73')][_0xf3ba('0x5b')](_0x4e7560);})[_0xf3ba('0x26')](function(_0x4dbc51){_0x9142b4[_0xf3ba('0x5c')]=_0x4dbc51;return _0x9142b4;});}})['then'](respondWithFilteredResult(_0x3bc463,_0x4e7560))['catch'](handleError(_0x3bc463,null));};exports['removeAnswers']=function(_0x4a164e,_0xac1066,_0x3dda7a){return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x4a164e[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0xac1066,null))['then'](function(_0x303108){if(_0x303108){return _0x303108['removeAnswers'](_0x4a164e[_0xf3ba('0x48')][_0xf3ba('0x71')]);}})[_0xf3ba('0x26')](respondWithStatusCode(_0xac1066,null))['catch'](handleError(_0xac1066,null));};exports[_0xf3ba('0x76')]=function(_0x40c86d,_0x507082,_0x160c47){var _0x28e585={'body':_0x40c86d['body'],'channel':_0xf3ba('0x77')};var _0x319abe=[];var _0x17bf7f=[];var _0x13458f={};var _0x5b6965=![];return db[_0xf3ba('0x78')][_0xf3ba('0x6a')]()[_0xf3ba('0x26')](function(_0x125aee){if(!_0x125aee){throw new db[(_0xf3ba('0x79'))][(_0xf3ba('0x7a'))]('no\x20available\x20attributes');}_0x319abe=_['difference'](_[_0xf3ba('0x47')](_0x125aee),[_0xf3ba('0x7b'),_0xf3ba('0x7c')]);_0x17bf7f=_['difference'](_['keys'](_0x125aee),[_0xf3ba('0x7b'),_0xf3ba('0x7c'),'CompanyId',_0xf3ba('0x7d')]);if(_0x40c86d['body']['id']){delete _0x40c86d[_0xf3ba('0x68')]['id'];}if(_['isNil'](_0x40c86d[_0xf3ba('0x68')]['from'])){throw new db[(_0xf3ba('0x79'))][(_0xf3ba('0x7a'))](_0xf3ba('0x7e'));}if(_['isNil'](_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x68')])||_0x40c86d[_0xf3ba('0x68')]['body']===''){throw new db[(_0xf3ba('0x79'))]['ValidationError'](_0xf3ba('0x7f'));}if(_[_0xf3ba('0x80')](_0x40c86d['body'][_0xf3ba('0x81')])){throw new db[(_0xf3ba('0x79'))][(_0xf3ba('0x7a'))](_0xf3ba('0x82')+_0x17bf7f);}if(!_['includes'](_0x17bf7f,_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x81')])){throw new db[(_0xf3ba('0x79'))][(_0xf3ba('0x7a'))](_0xf3ba('0x83')+_0x17bf7f);}_0x13458f[_0x40c86d[_0xf3ba('0x68')]['mapKey']]=_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x84')];})[_0xf3ba('0x26')](function(){return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x40c86d[_0xf3ba('0x69')]['id']},'include':[{'model':db[_0xf3ba('0x85')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x13458f,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xf3ba('0x86')}]});})[_0xf3ba('0x26')](handleEntityNotFound(_0x507082,null))[_0xf3ba('0x26')](function(_0x49a913){if(_0x49a913&&_0x49a913[_0xf3ba('0x87')]){_0x28e585['account']=_0x49a913;_0x28e585[_0xf3ba('0x88')]=_0x49a913[_0xf3ba('0x86')];_0x28e585['list']=_0x49a913['List'];_0x28e585[_0xf3ba('0x88')]=_[_0xf3ba('0x89')](_0x28e585[_0xf3ba('0x88')],[_0xf3ba('0x8a')],[_0xf3ba('0x8b')]);if(_0x28e585['account'][_0xf3ba('0x86')]){delete _0x28e585[_0xf3ba('0x8c')][_0xf3ba('0x86')];}if(_0x28e585[_0xf3ba('0x8c')][_0xf3ba('0x87')]&&_0x28e585['account']['List']['Contacts'][_0xf3ba('0x4d')]){return _0x28e585[_0xf3ba('0x8c')]['List'][_0xf3ba('0x8d')][0x0];}var _0x549914=_[_0xf3ba('0x1e')](_0x40c86d[_0xf3ba('0x68')],{'firstName':_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x84')],'ListId':_0x49a913[_0xf3ba('0x7d')]});_0x549914[_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x81')]]=_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x84')];return db[_0xf3ba('0x78')][_0xf3ba('0x60')](_0x549914,{'fields':_0x319abe,'raw':!![]});}})[_0xf3ba('0x26')](handleEntityNotFound(_0x507082,null))['then'](function(_0x405e0b){_0x28e585[_0xf3ba('0x8e')]=_0x405e0b;if(_0x405e0b){var _0xf683d9={'ContactId':_0x405e0b['id'],'OpenchannelAccountId':_0x40c86d['params']['id'],'from':(_0x405e0b['firstName']||'')+'\x20'+(_0x405e0b[_0xf3ba('0x8f')]||'')};var _0x3d9fe0={'OpenchannelAccountId':_0x40c86d['params']['id'],'closed':![]};if(_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x90')]){_0x3d9fe0[_0xf3ba('0x90')]=_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x90')];return db[_0xf3ba('0x91')][_0xf3ba('0x5f')]({'where':_0x3d9fe0})[_0xf3ba('0x26')](function(_0x2284e2){if(_0x2284e2){return[_0x2284e2,![]];}_0xf683d9[_0xf3ba('0x90')]=_0x40c86d['body'][_0xf3ba('0x90')];_0xf683d9[_0xf3ba('0x92')]=_0x40c86d['body']['externalUrl'];return db['OpenchannelInteraction'][_0xf3ba('0x60')](_0xf683d9)['then'](function(_0x5e07f0){return[_0x5e07f0,!![]];});});}else{_0x3d9fe0[_0xf3ba('0x90')]=null;}_0x3d9fe0[_0xf3ba('0x93')]=_0x405e0b['id'];return db[_0xf3ba('0x91')][_0xf3ba('0x5f')]({'where':_0x3d9fe0})[_0xf3ba('0x26')](function(_0x2ee5e1){if(_0x2ee5e1){return[_0x2ee5e1,![]];}return db['OpenchannelInteraction'][_0xf3ba('0x60')](_0xf683d9)['then'](function(_0x5b95cd){return[_0x5b95cd,!![]];});});}})['spread'](function(_0x181f3c,_0xa9c1e3){if(_0x181f3c){_0x5b6965=_0xa9c1e3;if(!_0xa9c1e3){var _0x207d03={'from':(_0x28e585[_0xf3ba('0x8e')][_0xf3ba('0x94')]||'')+'\x20'+(_0x28e585[_0xf3ba('0x8e')][_0xf3ba('0x8f')]||'')};if(_0x40c86d['body'][_0xf3ba('0x90')]&&_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x95')]&&_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x90')]!=_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x95')]){_0x207d03['threadId']=_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x95')];}return _0x181f3c['update'](_0x207d03);}else{return _0x181f3c;}}})[_0xf3ba('0x26')](function(_0x2f23be){_0x28e585[_0xf3ba('0x96')]=_0x2f23be[_0xf3ba('0x3a')]({'plain':!![]});_0x28e585[_0xf3ba('0x96')][_0xf3ba('0x97')]=_0x5b6965;if(_0x28e585[_0xf3ba('0x96')][_0xf3ba('0x97')]){if(_0x28e585[_0xf3ba('0x8c')][_0xf3ba('0x98')]){_0x28e585[_0xf3ba('0x88')][_0xf3ba('0x99')]({'id':0x0,'priority':_0x28e585[_0xf3ba('0x88')][_0xf3ba('0x4d')]+0x1,'app':'close','appdata':_0xf3ba('0x9a'),'interval':_0xf3ba('0x9b')});}}return db[_0xf3ba('0x9c')][_0xf3ba('0x60')]({'body':_0x40c86d[_0xf3ba('0x68')][_0xf3ba('0x68')],'OpenchannelAccountId':_0x40c86d['params']['id'],'OpenchannelInteractionId':_0x2f23be['id'],'direction':'in','ContactId':_0x28e585[_0xf3ba('0x8e')]['id'],'AttachmentId':_0x40c86d['body'][_0xf3ba('0x9d')]});})[_0xf3ba('0x26')](function(_0x48f933){_0x28e585[_0xf3ba('0x2e')]=_0x48f933;if(!_0x28e585[_0xf3ba('0x96')]['UserId'])return;return db[_0xf3ba('0x9e')][_0xf3ba('0x5f')]({'attributes':['id',_0xf3ba('0x3e')],'where':{'id':_0x28e585['interaction'][_0xf3ba('0x9f')]}});})[_0xf3ba('0x26')](function(_0x3015de){if(_0x3015de){_0x28e585[_0xf3ba('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3015de[_0xf3ba('0x3e')]+','+(_0x28e585[_0xf3ba('0x8c')][_0xf3ba('0xa0')]||0xa),'interval':'*,*,*,*'});}if(!_0x28e585['interaction'][_0xf3ba('0xa1')])return;return db['OpenchannelQueue'][_0xf3ba('0x5f')]({'attributes':['id',_0xf3ba('0x3e')],'where':{'id':_0x28e585['interaction'][_0xf3ba('0xa1')]}});})[_0xf3ba('0x26')](function(_0x525348){if(_0x525348){_0x28e585['applications'][_0xf3ba('0xa2')]({'id':0x0,'priority':0x1,'app':_0xf3ba('0xa3'),'appdata':_0x525348['name']+','+(_0x28e585['account']['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xf3ba('0xa4'),_0x28e585);})[_0xf3ba('0x26')](function(_0x2ac957){respondWithRpcPromise(_0xf3ba('0xa5'),_0xf3ba('0xa5'),{'event':'notify','message':_0x2ac957},client9002);return _0x2ac957;})['then'](respondWithResult(_0x507082,null))['catch'](handleError(_0x507082,null));};exports[_0xf3ba('0xa6')]=function(_0x5e4721,_0x5e7ef9){var _0x4a4bfa=_0x5e4721[_0xf3ba('0x69')]['id'];var _0x4852c0=_0x5e4721[_0xf3ba('0x68')];var _0x3d889d=0xc8;var _0x522f87=null;return db[_0xf3ba('0xa7')][_0xf3ba('0xa8')]({'isolationLevel':db[_0xf3ba('0xa7')][_0xf3ba('0xa9')]['ISOLATION_LEVELS'][_0xf3ba('0xaa')]},function(_0x3a0291){return db[_0xf3ba('0x58')][_0xf3ba('0x6f')]({'where':{'id':_0x4a4bfa},'transaction':_0x3a0291})['then'](function(_0x22e4b9){if(_0x22e4b9){return db[_0xf3ba('0xab')]['destroy']({'where':{'OpenchannelAccountId':_0x4a4bfa},'transaction':_0x3a0291})[_0xf3ba('0x26')](function(){var _0x5670b9=_[_0xf3ba('0x54')](_0x4852c0,function(_0x1db73f){_0x1db73f[_0xf3ba('0x6c')]=_0x4a4bfa;return _0x1db73f;});return db[_0xf3ba('0xab')][_0xf3ba('0xac')](_0x5670b9,{'transaction':_0x3a0291});});}else{_0x3d889d=0x194;_0x522f87=[];}});})[_0xf3ba('0x26')](function(){if(_0x3d889d!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4a4bfa},'order':_0xf3ba('0x8a')})[_0xf3ba('0x26')](function(_0x5d0734){_0x522f87=_0x5d0734;});}})[_0xf3ba('0x5d')](function(_0x53a56c){_0x3d889d=0x1f4;logger[_0xf3ba('0x2c')](_0x53a56c['stack']);if(_0x53a56c[_0xf3ba('0x3e')]){delete _0x53a56c['name'];}_0x522f87=_0x53a56c;})[_0xf3ba('0xad')](function(){if(_0x522f87===null){_0x5e7ef9[_0xf3ba('0x3c')](_0x3d889d);}else{if(_0x3d889d===0x1f4){_0x5e7ef9[_0xf3ba('0x30')](_0x3d889d)[_0xf3ba('0xae')](_0x522f87);}else{_0x5e7ef9[_0xf3ba('0x30')](_0x3d889d)[_0xf3ba('0xaf')](_0x522f87);}}});};exports[_0xf3ba('0xb0')]=function(_0xd94e2e,_0x2a48e3,_0x467c95){var _0x5b598b={};var _0x360d34={};var _0xd2993d;var _0x3202a9;return db[_0xf3ba('0x58')][_0xf3ba('0x6f')]({'where':{'id':_0xd94e2e[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x2a48e3,null))[_0xf3ba('0x26')](function(_0x581fc0){if(_0x581fc0){_0xd2993d=_0x581fc0;_0x360d34[_0xf3ba('0x46')]=_[_0xf3ba('0x47')](db[_0xf3ba('0xab')][_0xf3ba('0x42')]);_0x360d34['query']=_[_0xf3ba('0x47')](_0xd94e2e['query']);_0x360d34[_0xf3ba('0x49')]=_['intersection'](_0x360d34['model'],_0x360d34[_0xf3ba('0x48')]);_0x5b598b[_0xf3ba('0x4b')]=_[_0xf3ba('0x4a')](_0x360d34[_0xf3ba('0x46')],qs[_0xf3ba('0x4c')](_0xd94e2e[_0xf3ba('0x48')][_0xf3ba('0x4c')]));_0x5b598b[_0xf3ba('0x4b')]=_0x5b598b[_0xf3ba('0x4b')][_0xf3ba('0x4d')]?_0x5b598b['attributes']:_0x360d34[_0xf3ba('0x46')];_0x5b598b[_0xf3ba('0x4f')]=qs['sort'](_0xd94e2e[_0xf3ba('0x48')][_0xf3ba('0x50')]);_0x5b598b[_0xf3ba('0x51')]=qs[_0xf3ba('0x49')](_[_0xf3ba('0x52')](_0xd94e2e['query'],_0x360d34[_0xf3ba('0x49')]));if(_0xd94e2e[_0xf3ba('0x48')][_0xf3ba('0x56')]){_0x5b598b[_0xf3ba('0x51')]=_[_0xf3ba('0x53')](_0x5b598b[_0xf3ba('0x51')],{'$or':_[_0xf3ba('0x54')](_0x5b598b[_0xf3ba('0x4b')],function(_0xb886dc){var _0x1a783b={};_0x1a783b[_0xb886dc]={'$like':'%'+_0xd94e2e[_0xf3ba('0x48')][_0xf3ba('0x56')]+'%'};return _0x1a783b;})});}_0x5b598b=_['merge']({},_0x5b598b,_0xd94e2e['options']);return _0xd2993d[_0xf3ba('0xb0')](_0x5b598b);}})[_0xf3ba('0x26')](function(_0x446c82){if(_0x446c82){_0x3202a9=_0x446c82['length'];if(!_0xd94e2e[_0xf3ba('0x48')][_0xf3ba('0x4e')]('nolimit')){_0x5b598b[_0xf3ba('0x34')]=qs[_0xf3ba('0x34')](_0xd94e2e[_0xf3ba('0x48')][_0xf3ba('0x34')]);_0x5b598b['offset']=qs['offset'](_0xd94e2e[_0xf3ba('0x48')]['offset']);}return _0xd2993d[_0xf3ba('0xb0')](_0x5b598b);}})['then'](function(_0x42a0fa){if(_0x42a0fa){return _0x42a0fa?{'count':_0x3202a9,'rows':_0x42a0fa}:null;}})['then'](respondWithResult(_0x2a48e3,null))['catch'](handleError(_0x2a48e3,null));};exports[_0xf3ba('0xb1')]=function(_0x4ee7b0,_0x5ab1b6,_0x347a34){var _0x5a7212={'raw':![],'where':{}};var _0xbf2647={};var _0x34db87={'count':0x0,'rows':[]};return db[_0xf3ba('0x58')][_0xf3ba('0x6f')]({'where':{'id':_0x4ee7b0[_0xf3ba('0x69')]['id']}})['then'](handleEntityNotFound(_0x5ab1b6,null))[_0xf3ba('0x26')](function(_0x53cdb1){if(_0x53cdb1){_0xbf2647[_0xf3ba('0x46')]=_['keys'](db[_0xf3ba('0x91')][_0xf3ba('0x42')]);_0xbf2647[_0xf3ba('0x48')]=_[_0xf3ba('0x47')](_0x4ee7b0['query']);_0xbf2647[_0xf3ba('0x49')]=_[_0xf3ba('0x4a')](_0xbf2647[_0xf3ba('0x46')],_0xbf2647[_0xf3ba('0x48')]);_0x5a7212['attributes']=_['intersection'](_0xbf2647['model'],qs[_0xf3ba('0x4c')](_0x4ee7b0[_0xf3ba('0x48')][_0xf3ba('0x4c')]));_0x5a7212[_0xf3ba('0x4b')]=_0x5a7212['attributes'][_0xf3ba('0x4d')]?_0x5a7212[_0xf3ba('0x4b')]:_0xbf2647[_0xf3ba('0x46')];if(!_0x4ee7b0[_0xf3ba('0x48')][_0xf3ba('0x4e')](_0xf3ba('0x75'))){_0x5a7212[_0xf3ba('0x34')]=qs['limit'](_0x4ee7b0[_0xf3ba('0x48')][_0xf3ba('0x34')]);_0x5a7212[_0xf3ba('0x32')]=qs[_0xf3ba('0x32')](_0x4ee7b0['query'][_0xf3ba('0x32')]);}_0x5a7212[_0xf3ba('0x4f')]=qs[_0xf3ba('0x50')](_0x4ee7b0[_0xf3ba('0x48')][_0xf3ba('0x50')]);_0x5a7212[_0xf3ba('0x51')]=qs[_0xf3ba('0x49')](_[_0xf3ba('0x52')](_0x4ee7b0[_0xf3ba('0x48')],_0xbf2647[_0xf3ba('0x49')]));_0x5a7212[_0xf3ba('0x51')][_0xf3ba('0x6c')]=_0x53cdb1['id'];if(_0x4ee7b0[_0xf3ba('0x48')][_0xf3ba('0x56')]){_0x5a7212[_0xf3ba('0x51')]=_['merge'](_0x5a7212[_0xf3ba('0x51')],{'$or':_[_0xf3ba('0x54')](_0x5a7212[_0xf3ba('0x4b')],function(_0x1ed4e3){var _0x38bde8={};_0x38bde8[_0x1ed4e3]={'$like':'%'+_0x4ee7b0['query'][_0xf3ba('0x56')]+'%'};return _0x38bde8;})});}_0x5a7212=_[_0xf3ba('0x53')]({},_0x5a7212,_0x4ee7b0['options']);return db[_0xf3ba('0x91')][_0xf3ba('0x33')]({'where':_0x5a7212[_0xf3ba('0x51')]})[_0xf3ba('0x26')](function(_0x37738e){_0x34db87[_0xf3ba('0x33')]=_0x37738e;if(_0x4ee7b0[_0xf3ba('0x48')]['includeAll']){_0x5a7212[_0xf3ba('0x5a')]=[{'model':db[_0xf3ba('0x78')],'as':_0xf3ba('0xb2'),'required':![]},{'model':db[_0xf3ba('0x9e')],'as':_0xf3ba('0xb3'),'attributes':['name',_0xf3ba('0xb4'),_0xf3ba('0xb5')],'required':![]},{'model':db['Tag'],'as':_0xf3ba('0xb6'),'attributes':['id',_0xf3ba('0x3e'),_0xf3ba('0xb7')],'where':_0x4ee7b0[_0xf3ba('0x48')][_0xf3ba('0xb8')]?{'id':_0x4ee7b0[_0xf3ba('0x48')][_0xf3ba('0xb8')]}:undefined,'required':_0x4ee7b0['query'][_0xf3ba('0xb8')]?!![]:![]}];}return db[_0xf3ba('0x91')][_0xf3ba('0x5b')](_0x5a7212);})[_0xf3ba('0x26')](function(_0x49eaa5){_0x34db87['rows']=_0x49eaa5;return _0x34db87;});}})[_0xf3ba('0x26')](respondWithFilteredResult(_0x5ab1b6,_0x5a7212))[_0xf3ba('0x5d')](handleError(_0x5ab1b6,null));};exports['addAgents']=function(_0x5ad438,_0x506f3d,_0x54e8df){return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x5ad438[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x506f3d,null))[_0xf3ba('0x26')](function(_0x215e86){if(_0x215e86){return _0x215e86['addAgents'](_0x5ad438['body'][_0xf3ba('0x71')],_['omit'](_0x5ad438[_0xf3ba('0x68')],[_0xf3ba('0x71'),'id'])||{})[_0xf3ba('0xb9')](function(_0x16864e){for(var _0x5919e=0x0;_0x5919e<_0x5ad438['body'][_0xf3ba('0x71')][_0xf3ba('0x4d')];_0x5919e+=0x1){socket[_0xf3ba('0xba')](_0xf3ba('0xbb'),{'UserId':Number(_0x5ad438[_0xf3ba('0x68')][_0xf3ba('0x71')][_0x5919e]),'OpenchannelAccountId':Number(_0x5ad438[_0xf3ba('0x69')]['id'])});}return _0x16864e;});}})['then'](respondWithResult(_0x506f3d,null))['catch'](handleError(_0x506f3d,null));};exports['removeAgents']=function(_0x4ddfc5,_0xffbdab,_0x1e801d){return db[_0xf3ba('0x58')][_0xf3ba('0x5f')]({'where':{'id':_0x4ddfc5[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0xffbdab,null))['then'](function(_0x9e10b4){if(_0x9e10b4){return _0x9e10b4['removeAgents'](_0x4ddfc5[_0xf3ba('0x48')]['ids'])[_0xf3ba('0x26')](function(){if(_[_0xf3ba('0xbc')](_0x4ddfc5[_0xf3ba('0x48')][_0xf3ba('0x71')])){for(var _0x2789d5=0x0;_0x2789d5<_0x4ddfc5[_0xf3ba('0x48')][_0xf3ba('0x71')]['length'];_0x2789d5+=0x1){socket[_0xf3ba('0xba')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4ddfc5[_0xf3ba('0x48')]['ids'][_0x2789d5]),'OpenchannelAccountId':Number(_0x4ddfc5['params']['id'])});}}else{socket['emit'](_0xf3ba('0xbd'),{'UserId':Number(_0x4ddfc5['query'][_0xf3ba('0x71')]),'OpenchannelAccountId':Number(_0x4ddfc5[_0xf3ba('0x69')]['id'])});}});}})['then'](respondWithStatusCode(_0xffbdab,null))[_0xf3ba('0x5d')](handleError(_0xffbdab,null));};exports[_0xf3ba('0xbe')]=function(_0x525fc7,_0x57a368,_0x5ee4ea){var _0xd87fc7={};var _0x4b7913={};var _0x181e98;var _0x5b2243;return db[_0xf3ba('0x58')][_0xf3ba('0x6f')]({'where':{'id':_0x525fc7[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x57a368,null))[_0xf3ba('0x26')](function(_0x34d839){if(_0x34d839){_0x181e98=_0x34d839;_0x4b7913[_0xf3ba('0x46')]=_[_0xf3ba('0x47')](db[_0xf3ba('0x9e')][_0xf3ba('0x42')]);_0x4b7913[_0xf3ba('0x48')]=_[_0xf3ba('0x47')](_0x525fc7[_0xf3ba('0x48')]);_0x4b7913[_0xf3ba('0x49')]=_['intersection'](_0x4b7913['model'],_0x4b7913['query']);_0xd87fc7[_0xf3ba('0x4b')]=_['intersection'](_0x4b7913[_0xf3ba('0x46')],qs[_0xf3ba('0x4c')](_0x525fc7[_0xf3ba('0x48')][_0xf3ba('0x4c')]));_0xd87fc7[_0xf3ba('0x4b')]=_0xd87fc7[_0xf3ba('0x4b')]['length']?_0xd87fc7[_0xf3ba('0x4b')]:_0x4b7913[_0xf3ba('0x46')];_0xd87fc7[_0xf3ba('0x4f')]=qs[_0xf3ba('0x50')](_0x525fc7[_0xf3ba('0x48')][_0xf3ba('0x50')]);_0xd87fc7[_0xf3ba('0x51')]=qs[_0xf3ba('0x49')](_[_0xf3ba('0x52')](_0x525fc7[_0xf3ba('0x48')],_0x4b7913[_0xf3ba('0x49')]));if(_0x525fc7['query'][_0xf3ba('0x56')]){_0xd87fc7['where']=_[_0xf3ba('0x53')](_0xd87fc7['where'],{'$or':_['map'](_0xd87fc7[_0xf3ba('0x4b')],function(_0x22ac1e){var _0x384a1e={};_0x384a1e[_0x22ac1e]={'$like':'%'+_0x525fc7['query']['filter']+'%'};return _0x384a1e;})});}_0xd87fc7=_['merge']({},_0xd87fc7,_0x525fc7[_0xf3ba('0x57')]);return _0x181e98[_0xf3ba('0xbe')](_0xd87fc7);}})['then'](function(_0x4dd127){if(_0x4dd127){_0x5b2243=_0x4dd127[_0xf3ba('0x4d')];if(!_0x525fc7[_0xf3ba('0x48')][_0xf3ba('0x4e')](_0xf3ba('0x75'))){_0xd87fc7[_0xf3ba('0x34')]=qs[_0xf3ba('0x34')](_0x525fc7[_0xf3ba('0x48')]['limit']);_0xd87fc7[_0xf3ba('0x32')]=qs[_0xf3ba('0x32')](_0x525fc7[_0xf3ba('0x48')]['offset']);}return _0x181e98[_0xf3ba('0xbe')](_0xd87fc7);}})['then'](function(_0x4feb89){if(_0x4feb89){return _0x4feb89?{'count':_0x5b2243,'rows':_0x4feb89}:null;}})['then'](respondWithResult(_0x57a368,null))['catch'](handleError(_0x57a368,null));};exports[_0xf3ba('0xae')]=function(_0x3e4475,_0x3f6da4,_0x3e0535){var _0x10d917,_0x124e46,_0x5c0216;if(_['isNil'](_0x3e4475['body'][_0xf3ba('0x68')])||_0x3e4475[_0xf3ba('0x68')][_0xf3ba('0x68')]===''){throw new db[(_0xf3ba('0x79'))]['ValidationError'](_0xf3ba('0x7f'));}if(_[_0xf3ba('0x80')](_0x3e4475[_0xf3ba('0x68')]['to'])){}_0x10d917=_0x3e4475['body']['to'];return db[_0xf3ba('0x58')][_0xf3ba('0x6f')]({'where':{'id':_0x3e4475[_0xf3ba('0x69')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x3f6da4,null))[_0xf3ba('0x26')](function(_0x59e295){if(_0x59e295){return db['OpenchannelAccount'][_0xf3ba('0x5f')]({'where':{'id':_0x59e295['id']},'include':[{'model':db[_0xf3ba('0x85')],'as':_0xf3ba('0x87'),'include':[{'model':db[_0xf3ba('0x78')],'as':'Contacts','where':{[_0x59e295[_0xf3ba('0x81')]]:_0x10d917},'limit':0x1,'order':[[_0xf3ba('0x7c'),_0xf3ba('0xbf')]]}]}]})[_0xf3ba('0x26')](handleEntityNotFound(_0x3f6da4,null))['then'](function(_0x41bbe6){if(_0x41bbe6&&_0x41bbe6[_0xf3ba('0x87')]){_0x124e46=_0x41bbe6[_0xf3ba('0x3a')]({'plain':!![]});if(_0x124e46[_0xf3ba('0x87')]&&_0x124e46['List'][_0xf3ba('0x8d')][_0xf3ba('0x4d')]){return _0x124e46['List'][_0xf3ba('0x8d')][0x0];}return db['CmContact'][_0xf3ba('0x60')](_[_0xf3ba('0x1e')](_0x3e4475[_0xf3ba('0x68')],{'firstName':_0x10d917,[_0x41bbe6[_0xf3ba('0x81')]]:_0x10d917,'phone':_0x10d917,'ListId':_0x124e46[_0xf3ba('0x7d')]}));}})[_0xf3ba('0x26')](handleEntityNotFound(_0x3f6da4,null))[_0xf3ba('0x26')](function(_0x3051b1){if(_0x3051b1){_0x5c0216=_0x3051b1;return db[_0xf3ba('0x91')][_0xf3ba('0x5f')]({'where':{'ContactId':_0x5c0216['id'],'closed':![],'OpenchannelAccountId':_0x124e46['id']}})[_0xf3ba('0x26')](function(_0x5a7245){if(_0x5a7245){return[_0x5a7245,![]];}return db[_0xf3ba('0x91')]['create']({'UserId':_0x3e4475['user']['id'],'ContactId':_0x5c0216['id'],'OpenchannelAccountId':_0x124e46['id'],'lastMsgDirection':_0xf3ba('0xc0'),'firstMsgDirection':_0xf3ba('0xc0'),'Messages':[_[_0xf3ba('0x53')](_0x3e4475[_0xf3ba('0x68')],{'read':![],'body':_0x3e4475[_0xf3ba('0x68')][_0xf3ba('0x68')],'OpenchannelAccountId':_0x124e46['id'],'UserId':_0x3e4475[_0xf3ba('0x61')]['id'],'ContactId':_0x5c0216['id']})]},{'include':[{'model':db[_0xf3ba('0x9c')],'as':_0xf3ba('0xc1')}]})['then'](function(_0x2b703c){return[_0x2b703c,!![]];});});}})[_0xf3ba('0xb9')](function(_0x43be1e,_0xe42a88){if(_0xe42a88){return _0x43be1e;}return db['OpenchannelMessage'][_0xf3ba('0x60')](_[_0xf3ba('0x53')](_0x3e4475['body'],{'read':![],'body':_0x3e4475[_0xf3ba('0x68')][_0xf3ba('0x68')],'OpenchannelAccountId':_0x124e46['id'],'OpenchannelInteractionId':_0x43be1e['id'],'UserId':_0x3e4475['user']['id'],'ContactId':_0x5c0216['id']}))[_0xf3ba('0x26')](function(_0x2316a8){_0x43be1e[_0xf3ba('0xc2')][_0xf3ba('0xc1')]=[];_0x43be1e[_0xf3ba('0xc2')]['Messages']['push'](_0x2316a8['dataValues']);return _0x43be1e;});});}})[_0xf3ba('0x26')](respondWithResult(_0x3f6da4,null))[_0xf3ba('0x5d')](handleError(_0x3f6da4,null));}; \ No newline at end of file +var _0xc51e=['addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','addAgents','omit','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','dataValues','Messages','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','params','fields','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','OpenchannelApplication','Applications','account','list','applications','orderBy','asc','Contacts','defaults','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','startRouting','notify'];(function(_0x5217e4,_0x58ce7b){var _0x4e0fcc=function(_0x54a574){while(--_0x54a574){_0x5217e4['push'](_0x5217e4['shift']());}};_0x4e0fcc(++_0x58ce7b);}(_0xc51e,0x1a0));var _0xec51=function(_0x67b075,_0x43557d){_0x67b075=_0x67b075-0x0;var _0x39d030=_0xc51e[_0x67b075];return _0x39d030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec51('0x0'));var zipdir=require(_0xec51('0x1'));var jsonpatch=require(_0xec51('0x2'));var rp=require('request-promise');var moment=require(_0xec51('0x3'));var BPromise=require(_0xec51('0x4'));var Mustache=require('mustache');var util=require(_0xec51('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xec51('0x6'));var ejs=require(_0xec51('0x7'));var fs=require('fs');var fs_extra=require(_0xec51('0x8'));var _=require('lodash');var squel=require(_0xec51('0x9'));var crypto=require('crypto');var jsforce=require(_0xec51('0xa'));var deskjs=require(_0xec51('0xb'));var toCsv=require(_0xec51('0x6'));var querystring=require('querystring');var Papa=require(_0xec51('0xc'));var Redis=require(_0xec51('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xec51('0xe'));var as=require(_0xec51('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec51('0x10'))('api');var utils=require(_0xec51('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xec51('0x12'));var db=require(_0xec51('0x13'))['db'];config[_0xec51('0x14')]=_['defaults'](config[_0xec51('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xec51('0x15'))(new Redis(config[_0xec51('0x14')]));require(_0xec51('0x16'))[_0xec51('0x17')](socket);var jayson=require(_0xec51('0x18'));var client=jayson[_0xec51('0x19')][_0xec51('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xec51('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x450e84,_0x2239d2,_0xda8f73,_0x31c97f){return new BPromise(function(_0x1cc125,_0x43f077){var _0x89edf8=_0x31c97f||client;return _0x89edf8[_0xec51('0x1b')](_0x450e84,_0xda8f73)[_0xec51('0x1c')](function(_0x1a07a9){logger['info'](_0xec51('0x1d'),_0x2239d2,'request\x20sent');logger[_0xec51('0x1e')](_0xec51('0x1f'),_0x2239d2,_0xec51('0x20'),JSON[_0xec51('0x21')](_0x1a07a9));if(_0x1a07a9[_0xec51('0x22')]){if(_0x1a07a9[_0xec51('0x22')]['code']===0x1f4){logger[_0xec51('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x2239d2,_0x1a07a9[_0xec51('0x22')][_0xec51('0x23')]);return _0x43f077(_0x1a07a9['error'][_0xec51('0x23')]);}logger[_0xec51('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x2239d2,_0x1a07a9[_0xec51('0x22')][_0xec51('0x23')]);return _0x1cc125(_0x1a07a9[_0xec51('0x22')][_0xec51('0x23')]);}else{logger[_0xec51('0x24')](_0xec51('0x1d'),_0x2239d2,_0xec51('0x20'));_0x1cc125(_0x1a07a9['result'][_0xec51('0x23')]);}})[_0xec51('0x25')](function(_0x2e4c7b){logger['error'](_0xec51('0x1d'),_0x2239d2,_0x2e4c7b);_0x43f077(_0x2e4c7b);});});}function respondWithStatusCode(_0x2b0053,_0x2dee87){_0x2dee87=_0x2dee87||0xcc;return function(_0x2c5b08){if(_0x2c5b08){return _0x2b0053['sendStatus'](_0x2dee87);}return _0x2b0053['status'](_0x2dee87)[_0xec51('0x26')]();};}function respondWithResult(_0x38feec,_0x18bf78){_0x18bf78=_0x18bf78||0xc8;return function(_0x196971){if(_0x196971){return _0x38feec[_0xec51('0x27')](_0x18bf78)[_0xec51('0x28')](_0x196971);}};}function respondWithFilteredResult(_0x2fe405,_0x200dda){return function(_0x347e95){if(_0x347e95){var _0x5080a6=typeof _0x200dda[_0xec51('0x29')]===_0xec51('0x2a')&&typeof _0x200dda[_0xec51('0x2b')]===_0xec51('0x2a');var _0x366b85=_0x347e95[_0xec51('0x2c')];var _0x217aee=_0x5080a6?0x0:_0x200dda[_0xec51('0x29')];var _0x1e706a=_0x5080a6?_0x347e95[_0xec51('0x2c')]:_0x200dda['offset']+_0x200dda[_0xec51('0x2b')];var _0xb1f54c;if(_0x1e706a>=_0x366b85){_0x1e706a=_0x366b85;_0xb1f54c=0xc8;}else{_0xb1f54c=0xce;}_0x2fe405[_0xec51('0x27')](_0xb1f54c);return _0x2fe405['set'](_0xec51('0x2d'),_0x217aee+'-'+_0x1e706a+'/'+_0x366b85)[_0xec51('0x28')](_0x347e95);}return null;};}function patchUpdates(_0x144d3d){return function(_0x3b7a1b){try{jsonpatch[_0xec51('0x2e')](_0x3b7a1b,_0x144d3d,!![]);}catch(_0x2f27ae){return BPromise[_0xec51('0x2f')](_0x2f27ae);}return _0x3b7a1b[_0xec51('0x30')]();};}function saveUpdates(_0x35fa16,_0x7309aa){return function(_0x31b262){if(_0x31b262){return _0x31b262[_0xec51('0x31')](_0x35fa16)[_0xec51('0x1c')](function(_0x3c2294){return _0x3c2294;});}return null;};}function removeEntity(_0x5d2786,_0x2870e6){return function(_0x47b8c5){if(_0x47b8c5){return _0x47b8c5[_0xec51('0x32')]()[_0xec51('0x1c')](function(){var _0x19710d=_0x47b8c5[_0xec51('0x33')]({'plain':!![]});var _0x301056=_0xec51('0x34');return db['UserProfileResource'][_0xec51('0x32')]({'where':{'type':_0x301056,'resourceId':_0x19710d['id']}})[_0xec51('0x1c')](function(){return _0x47b8c5;});})[_0xec51('0x1c')](function(){_0x5d2786['status'](0xcc)[_0xec51('0x26')]();});}};}function handleEntityNotFound(_0x52adc9,_0x35826d){return function(_0x4c6181){if(!_0x4c6181){_0x52adc9[_0xec51('0x35')](0x194);}return _0x4c6181;};}function handleError(_0x1fe4d1,_0xc9caa){_0xc9caa=_0xc9caa||0x1f4;return function(_0x1c6021){logger[_0xec51('0x22')](_0x1c6021['stack']);if(_0x1c6021[_0xec51('0x36')]){delete _0x1c6021['name'];}_0x1fe4d1[_0xec51('0x27')](_0xc9caa)[_0xec51('0x37')](_0x1c6021);};}exports[_0xec51('0x38')]=function(_0x33fbcb,_0x4b5179){var _0x1d1686={'include':[{'model':db[_0xec51('0x39')],'as':_0xec51('0x3a')}]},_0x284de3={},_0x322450={'count':0x0,'rows':[]};var _0x33bd36=_[_0xec51('0x3b')](db[_0xec51('0x3c')][_0xec51('0x3d')],function(_0x2c590e){return{'name':_0x2c590e[_0xec51('0x3e')],'type':_0x2c590e[_0xec51('0x3f')]['key']};});_0x284de3[_0xec51('0x40')]=_['map'](_0x33bd36,_0xec51('0x36'));_0x284de3[_0xec51('0x41')]=_[_0xec51('0x42')](_0x33fbcb[_0xec51('0x41')]);_0x284de3[_0xec51('0x43')]=_[_0xec51('0x44')](_0x284de3[_0xec51('0x40')],_0x284de3[_0xec51('0x41')]);_0x1d1686[_0xec51('0x45')]=_[_0xec51('0x44')](_0x284de3[_0xec51('0x40')],qs['fields'](_0x33fbcb[_0xec51('0x41')]['fields']));_0x1d1686[_0xec51('0x45')]=_0x1d1686[_0xec51('0x45')][_0xec51('0x46')]?_0x1d1686['attributes']:_0x284de3[_0xec51('0x40')];if(!_0x33fbcb[_0xec51('0x41')][_0xec51('0x47')](_0xec51('0x48'))){_0x1d1686['limit']=qs[_0xec51('0x2b')](_0x33fbcb[_0xec51('0x41')][_0xec51('0x2b')]);_0x1d1686[_0xec51('0x29')]=qs['offset'](_0x33fbcb['query']['offset']);}_0x1d1686['order']=qs['sort'](_0x33fbcb['query'][_0xec51('0x49')]);_0x1d1686[_0xec51('0x4a')]=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x33fbcb[_0xec51('0x41')],_0x284de3[_0xec51('0x43')]),_0x33bd36);if(_0x33fbcb['query'][_0xec51('0x4c')]){_0x1d1686[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x1d1686[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x33bd36,function(_0x33d30d){if(_0x33d30d[_0xec51('0x3f')]!=='VIRTUAL'){var _0x5859b1={};_0x5859b1[_0x33d30d[_0xec51('0x36')]]={'$like':'%'+_0x33fbcb[_0xec51('0x41')]['filter']+'%'};return _0x5859b1;}})});}_0x1d1686=_[_0xec51('0x4d')]({},_0x1d1686,_0x33fbcb['options']);var _0x5ef21c={'where':_0x1d1686[_0xec51('0x4a')]};return db[_0xec51('0x3c')]['count'](_0x5ef21c)[_0xec51('0x1c')](function(_0x2222b9){_0x322450['count']=_0x2222b9;if(_0x33fbcb[_0xec51('0x41')][_0xec51('0x4e')]){_0x1d1686['include']=[{'all':!![]}];}return db[_0xec51('0x3c')][_0xec51('0x4f')](_0x1d1686);})[_0xec51('0x1c')](function(_0x56034d){_0x322450[_0xec51('0x50')]=_0x56034d;return _0x322450;})[_0xec51('0x1c')](respondWithFilteredResult(_0x4b5179,_0x1d1686))[_0xec51('0x25')](handleError(_0x4b5179,null));};exports['show']=function(_0x5c8c50,_0x511c72){var _0x504b00={'raw':![],'where':{'id':_0x5c8c50[_0xec51('0x51')]['id']},'include':[{'model':db[_0xec51('0x39')],'as':_0xec51('0x3a')}]},_0x3c493e={};_0x3c493e[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0x3c')][_0xec51('0x3d')]);_0x3c493e[_0xec51('0x41')]=_[_0xec51('0x42')](_0x5c8c50[_0xec51('0x41')]);_0x3c493e[_0xec51('0x43')]=_[_0xec51('0x44')](_0x3c493e['model'],_0x3c493e[_0xec51('0x41')]);_0x504b00[_0xec51('0x45')]=_[_0xec51('0x44')](_0x3c493e[_0xec51('0x40')],qs[_0xec51('0x52')](_0x5c8c50[_0xec51('0x41')]['fields']));_0x504b00['attributes']=_0x504b00[_0xec51('0x45')][_0xec51('0x46')]?_0x504b00[_0xec51('0x45')]:_0x3c493e[_0xec51('0x40')];if(_0x5c8c50[_0xec51('0x41')][_0xec51('0x4e')]){_0x504b00[_0xec51('0x53')]=[{'all':!![]}];}_0x504b00=_[_0xec51('0x4d')]({},_0x504b00,_0x5c8c50[_0xec51('0x54')]);return db['OpenchannelAccount']['find'](_0x504b00)[_0xec51('0x1c')](handleEntityNotFound(_0x511c72,null))[_0xec51('0x1c')](respondWithResult(_0x511c72,null))[_0xec51('0x25')](handleError(_0x511c72,null));};exports[_0xec51('0x55')]=function(_0x303e57,_0x5ec913){return db[_0xec51('0x3c')][_0xec51('0x55')](_0x303e57[_0xec51('0x56')],{})[_0xec51('0x1c')](function(_0x134c8a){var _0x498ff1=_0x303e57[_0xec51('0x57')]['get']({'plain':!![]});if(!_0x498ff1)throw new Error(_0xec51('0x58'));if(_0x498ff1[_0xec51('0x59')]===_0xec51('0x57')){var _0x2f132e=_0x134c8a[_0xec51('0x33')]({'plain':!![]});var _0x20991f=_0xec51('0x34');return db[_0xec51('0x5a')][_0xec51('0x5b')]({'where':{'name':_0x20991f,'userProfileId':_0x498ff1[_0xec51('0x5c')]},'raw':!![]})['then'](function(_0x534644){if(_0x534644&&_0x534644[_0xec51('0x5d')]===0x0){return db[_0xec51('0x5e')][_0xec51('0x55')]({'name':_0x2f132e[_0xec51('0x36')],'resourceId':_0x2f132e['id'],'type':_0x534644[_0xec51('0x36')],'sectionId':_0x534644['id']},{})['then'](function(){return _0x134c8a;});}else{return _0x134c8a;}})[_0xec51('0x25')](function(_0x23f4fe){logger[_0xec51('0x22')](_0xec51('0x5f'),_0x23f4fe);throw _0x23f4fe;});}return _0x134c8a;})[_0xec51('0x1c')](respondWithResult(_0x5ec913,0xc9))[_0xec51('0x25')](handleError(_0x5ec913,null));};exports['update']=function(_0x2624cf,_0x4213d1){if(_0x2624cf[_0xec51('0x56')]['id']){delete _0x2624cf['body']['id'];}return db['OpenchannelAccount'][_0xec51('0x5b')]({'where':{'id':_0x2624cf[_0xec51('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0xec51('0x3a')}]})[_0xec51('0x1c')](handleEntityNotFound(_0x4213d1,null))[_0xec51('0x1c')](saveUpdates(_0x2624cf[_0xec51('0x56')],null))[_0xec51('0x1c')](respondWithResult(_0x4213d1,null))[_0xec51('0x25')](handleError(_0x4213d1,null));};exports[_0xec51('0x32')]=function(_0xebcd67,_0xfe5a8e){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0xebcd67[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0xfe5a8e,null))[_0xec51('0x1c')](removeEntity(_0xfe5a8e,null))[_0xec51('0x25')](handleError(_0xfe5a8e,null));};exports[_0xec51('0x60')]=function(_0xc6560c,_0x6f65ef){return db[_0xec51('0x3c')][_0xec51('0x60')]()[_0xec51('0x1c')](respondWithResult(_0x6f65ef,null))[_0xec51('0x25')](handleError(_0x6f65ef,null));};exports['addDisposition']=function(_0x393ab6,_0x3acb46,_0x116c8c){if(_0x393ab6[_0xec51('0x56')]['id']){delete _0x393ab6[_0xec51('0x56')]['id'];}return db[_0xec51('0x3c')]['find']({'where':{'id':_0x393ab6[_0xec51('0x51')]['id']}})['then'](handleEntityNotFound(_0x3acb46,null))[_0xec51('0x1c')](function(_0x342da9){if(_0x342da9){_0x393ab6['body']['OpenchannelAccountId']=_0x342da9['id'];return db[_0xec51('0x61')]['create'](_0x393ab6[_0xec51('0x56')]);}})[_0xec51('0x1c')](respondWithResult(_0x3acb46,null))[_0xec51('0x25')](handleError(_0x3acb46,null));};exports['getDispositions']=function(_0x3aed7b,_0x4445c5,_0x281e26){var _0x2cc4f6={'raw':![],'where':{}};var _0xf5167e={};var _0x2dd8df={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xec51('0x62')]({'where':{'id':_0x3aed7b[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x4445c5,null))[_0xec51('0x1c')](function(_0x2eb506){if(_0x2eb506){_0xf5167e['model']=_['keys'](db[_0xec51('0x61')]['rawAttributes']);_0xf5167e[_0xec51('0x41')]=_[_0xec51('0x42')](_0x3aed7b[_0xec51('0x41')]);_0xf5167e[_0xec51('0x43')]=_['intersection'](_0xf5167e[_0xec51('0x40')],_0xf5167e['query']);_0x2cc4f6['attributes']=_[_0xec51('0x44')](_0xf5167e[_0xec51('0x40')],qs[_0xec51('0x52')](_0x3aed7b[_0xec51('0x41')][_0xec51('0x52')]));_0x2cc4f6['attributes']=_0x2cc4f6[_0xec51('0x45')][_0xec51('0x46')]?_0x2cc4f6[_0xec51('0x45')]:_0xf5167e[_0xec51('0x40')];if(!_0x3aed7b[_0xec51('0x41')]['hasOwnProperty']('nolimit')){_0x2cc4f6[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x3aed7b[_0xec51('0x41')]['limit']);_0x2cc4f6[_0xec51('0x29')]=qs['offset'](_0x3aed7b[_0xec51('0x41')]['offset']);}_0x2cc4f6['order']=qs['sort'](_0x3aed7b[_0xec51('0x41')][_0xec51('0x49')]);_0x2cc4f6['where']=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x3aed7b[_0xec51('0x41')],_0xf5167e[_0xec51('0x43')]));_0x2cc4f6[_0xec51('0x4a')][_0xec51('0x63')]=_0x2eb506['id'];if(_0x3aed7b[_0xec51('0x41')][_0xec51('0x4c')]){_0x2cc4f6[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x2cc4f6[_0xec51('0x4a')],{'$or':_['map'](_0x2cc4f6[_0xec51('0x45')],function(_0x56320b){var _0x2651a7={};_0x2651a7[_0x56320b]={'$like':'%'+_0x3aed7b[_0xec51('0x41')]['filter']+'%'};return _0x2651a7;})});}_0x2cc4f6=_[_0xec51('0x4d')]({},_0x2cc4f6,_0x3aed7b['options']);return db[_0xec51('0x61')][_0xec51('0x2c')]({'where':_0x2cc4f6[_0xec51('0x4a')]})[_0xec51('0x1c')](function(_0x1e6973){_0x2dd8df[_0xec51('0x2c')]=_0x1e6973;if(_0x3aed7b[_0xec51('0x41')][_0xec51('0x4e')]){_0x2cc4f6[_0xec51('0x53')]=[{'all':!![]}];}return db[_0xec51('0x61')][_0xec51('0x4f')](_0x2cc4f6);})['then'](function(_0x3ed3e1){_0x2dd8df[_0xec51('0x50')]=_0x3ed3e1;return _0x2dd8df;});}})[_0xec51('0x1c')](respondWithFilteredResult(_0x4445c5,_0x2cc4f6))['catch'](handleError(_0x4445c5,null));};exports[_0xec51('0x64')]=function(_0x5a1365,_0x51fc1e,_0x2cb8c6){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x5a1365['params']['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x51fc1e,null))[_0xec51('0x1c')](function(_0x2ebcd4){if(_0x2ebcd4){return _0x2ebcd4[_0xec51('0x64')](_0x5a1365[_0xec51('0x41')][_0xec51('0x65')]);}})['then'](respondWithStatusCode(_0x51fc1e,null))[_0xec51('0x25')](handleError(_0x51fc1e,null));};exports[_0xec51('0x66')]=function(_0x8a909d,_0x470f94,_0xac8c0){if(_0x8a909d[_0xec51('0x56')]['id']){delete _0x8a909d['body']['id'];}return db['OpenchannelAccount'][_0xec51('0x5b')]({'where':{'id':_0x8a909d[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x470f94,null))[_0xec51('0x1c')](function(_0x1ba93f){if(_0x1ba93f){_0x8a909d[_0xec51('0x56')][_0xec51('0x63')]=_0x1ba93f['id'];return db['CannedAnswer'][_0xec51('0x55')](_0x8a909d['body']);}})['then'](respondWithResult(_0x470f94,null))[_0xec51('0x25')](handleError(_0x470f94,null));};exports[_0xec51('0x67')]=function(_0x12bba4,_0x3630f5,_0xf30ff7){var _0x9d7eef={'raw':![],'where':{}};var _0x210b5b={};var _0x29d593={'count':0x0,'rows':[]};return db[_0xec51('0x3c')]['findOne']({'where':{'id':_0x12bba4['params']['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x3630f5,null))['then'](function(_0x428813){if(_0x428813){_0x210b5b['model']=_[_0xec51('0x42')](db[_0xec51('0x68')][_0xec51('0x3d')]);_0x210b5b[_0xec51('0x41')]=_[_0xec51('0x42')](_0x12bba4[_0xec51('0x41')]);_0x210b5b[_0xec51('0x43')]=_[_0xec51('0x44')](_0x210b5b[_0xec51('0x40')],_0x210b5b['query']);_0x9d7eef[_0xec51('0x45')]=_[_0xec51('0x44')](_0x210b5b['model'],qs[_0xec51('0x52')](_0x12bba4['query'][_0xec51('0x52')]));_0x9d7eef[_0xec51('0x45')]=_0x9d7eef['attributes'][_0xec51('0x46')]?_0x9d7eef[_0xec51('0x45')]:_0x210b5b['model'];if(!_0x12bba4[_0xec51('0x41')][_0xec51('0x47')]('nolimit')){_0x9d7eef['limit']=qs[_0xec51('0x2b')](_0x12bba4[_0xec51('0x41')][_0xec51('0x2b')]);_0x9d7eef[_0xec51('0x29')]=qs[_0xec51('0x29')](_0x12bba4[_0xec51('0x41')][_0xec51('0x29')]);}_0x9d7eef[_0xec51('0x69')]=qs[_0xec51('0x49')](_0x12bba4[_0xec51('0x41')][_0xec51('0x49')]);_0x9d7eef[_0xec51('0x4a')]=qs['filters'](_[_0xec51('0x4b')](_0x12bba4[_0xec51('0x41')],_0x210b5b[_0xec51('0x43')]));_0x9d7eef[_0xec51('0x4a')][_0xec51('0x63')]=_0x428813['id'];if(_0x12bba4[_0xec51('0x41')][_0xec51('0x4c')]){_0x9d7eef[_0xec51('0x4a')]=_['merge'](_0x9d7eef['where'],{'$or':_[_0xec51('0x3b')](_0x9d7eef[_0xec51('0x45')],function(_0x3c79fd){var _0x419031={};_0x419031[_0x3c79fd]={'$like':'%'+_0x12bba4['query'][_0xec51('0x4c')]+'%'};return _0x419031;})});}_0x9d7eef=_[_0xec51('0x4d')]({},_0x9d7eef,_0x12bba4[_0xec51('0x54')]);return db[_0xec51('0x68')][_0xec51('0x2c')]({'where':_0x9d7eef['where']})[_0xec51('0x1c')](function(_0x4fa2b0){_0x29d593[_0xec51('0x2c')]=_0x4fa2b0;if(_0x12bba4[_0xec51('0x41')][_0xec51('0x4e')]){_0x9d7eef['include']=[{'all':!![]}];}return db[_0xec51('0x68')][_0xec51('0x4f')](_0x9d7eef);})[_0xec51('0x1c')](function(_0x599e25){_0x29d593[_0xec51('0x50')]=_0x599e25;return _0x29d593;});}})[_0xec51('0x1c')](respondWithFilteredResult(_0x3630f5,_0x9d7eef))[_0xec51('0x25')](handleError(_0x3630f5,null));};exports[_0xec51('0x6a')]=function(_0x1fe54b,_0x5932e6,_0x5c6873){return db[_0xec51('0x3c')]['find']({'where':{'id':_0x1fe54b[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x5932e6,null))[_0xec51('0x1c')](function(_0x17e8e0){if(_0x17e8e0){return _0x17e8e0['removeAnswers'](_0x1fe54b[_0xec51('0x41')]['ids']);}})[_0xec51('0x1c')](respondWithStatusCode(_0x5932e6,null))[_0xec51('0x25')](handleError(_0x5932e6,null));};exports['notify']=function(_0x25d406,_0x54e947,_0x74c7d0){var _0x4d7a59={'body':_0x25d406[_0xec51('0x56')],'channel':_0xec51('0x6b')};var _0x46f841=[];var _0x33c2da=[];var _0x43ab9f={};var _0x2ba6f8=![];return db[_0xec51('0x6c')][_0xec51('0x60')]()['then'](function(_0x4870fd){if(!_0x4870fd){throw new db[(_0xec51('0x6d'))][(_0xec51('0x6e'))]('no\x20available\x20attributes');}_0x46f841=_['difference'](_['keys'](_0x4870fd),[_0xec51('0x6f'),_0xec51('0x70')]);_0x33c2da=_[_0xec51('0x71')](_[_0xec51('0x42')](_0x4870fd),['createdAt',_0xec51('0x70'),_0xec51('0x72'),_0xec51('0x73')]);if(_0x25d406[_0xec51('0x56')]['id']){delete _0x25d406[_0xec51('0x56')]['id'];}if(_[_0xec51('0x74')](_0x25d406[_0xec51('0x56')]['from'])){throw new db['Sequelize']['ValidationError'](_0xec51('0x75'));}if(_[_0xec51('0x74')](_0x25d406[_0xec51('0x56')][_0xec51('0x56')])||_0x25d406[_0xec51('0x56')]['body']===''){throw new db[(_0xec51('0x6d'))][(_0xec51('0x6e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x25d406[_0xec51('0x56')][_0xec51('0x76')])){throw new db[(_0xec51('0x6d'))][(_0xec51('0x6e'))](_0xec51('0x77')+_0x33c2da);}if(!_[_0xec51('0x78')](_0x33c2da,_0x25d406[_0xec51('0x56')][_0xec51('0x76')])){throw new db[(_0xec51('0x6d'))]['ValidationError'](_0xec51('0x79')+_0x33c2da);}_0x43ab9f[_0x25d406[_0xec51('0x56')][_0xec51('0x76')]]=_0x25d406['body']['from'];})[_0xec51('0x1c')](function(){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x25d406['params']['id']},'include':[{'model':db['CmList'],'as':_0xec51('0x7a'),'include':[{'model':db[_0xec51('0x6c')],'as':'Contacts','where':_0x43ab9f,'limit':0x1,'order':[[_0xec51('0x70'),'DESC']]}]},{'model':db[_0xec51('0x7b')],'as':_0xec51('0x7c')}]});})['then'](handleEntityNotFound(_0x54e947,null))['then'](function(_0x48d453){if(_0x48d453&&_0x48d453['List']){_0x4d7a59[_0xec51('0x7d')]=_0x48d453;_0x4d7a59['applications']=_0x48d453['Applications'];_0x4d7a59[_0xec51('0x7e')]=_0x48d453[_0xec51('0x7a')];_0x4d7a59[_0xec51('0x7f')]=_[_0xec51('0x80')](_0x4d7a59[_0xec51('0x7f')],['priority'],[_0xec51('0x81')]);if(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x7c')]){delete _0x4d7a59[_0xec51('0x7d')][_0xec51('0x7c')];}if(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x7a')]&&_0x4d7a59[_0xec51('0x7d')][_0xec51('0x7a')][_0xec51('0x82')][_0xec51('0x46')]){return _0x4d7a59[_0xec51('0x7d')][_0xec51('0x7a')][_0xec51('0x82')][0x0];}var _0x5b9e11=_[_0xec51('0x83')](_0x25d406[_0xec51('0x56')],{'firstName':_0x25d406[_0xec51('0x56')][_0xec51('0x84')],'ListId':_0x48d453['ListId']});_0x5b9e11[_0x25d406[_0xec51('0x56')][_0xec51('0x76')]]=_0x25d406[_0xec51('0x56')][_0xec51('0x84')];return db[_0xec51('0x6c')][_0xec51('0x55')](_0x5b9e11,{'fields':_0x46f841,'raw':!![]});}})[_0xec51('0x1c')](handleEntityNotFound(_0x54e947,null))[_0xec51('0x1c')](function(_0x49524d){_0x4d7a59[_0xec51('0x85')]=_0x49524d;if(_0x49524d){var _0x1292da={'ContactId':_0x49524d['id'],'OpenchannelAccountId':_0x25d406['params']['id'],'from':(_0x49524d[_0xec51('0x86')]||'')+'\x20'+(_0x49524d[_0xec51('0x87')]||'')};var _0x36b241={'OpenchannelAccountId':_0x25d406[_0xec51('0x51')]['id'],'closed':![]};if(_0x25d406[_0xec51('0x56')][_0xec51('0x88')]){_0x36b241[_0xec51('0x88')]=_0x25d406[_0xec51('0x56')][_0xec51('0x88')];return db[_0xec51('0x89')]['find']({'where':_0x36b241})[_0xec51('0x1c')](function(_0x325635){if(_0x325635){return[_0x325635,![]];}_0x1292da[_0xec51('0x88')]=_0x25d406[_0xec51('0x56')][_0xec51('0x88')];_0x1292da[_0xec51('0x8a')]=_0x25d406[_0xec51('0x56')][_0xec51('0x8a')];return db['OpenchannelInteraction'][_0xec51('0x55')](_0x1292da)[_0xec51('0x1c')](function(_0xce11f0){return[_0xce11f0,!![]];});});}else{_0x36b241[_0xec51('0x88')]=null;}_0x36b241[_0xec51('0x8b')]=_0x49524d['id'];return db[_0xec51('0x89')][_0xec51('0x5b')]({'where':_0x36b241})[_0xec51('0x1c')](function(_0x24fb8c){if(_0x24fb8c){return[_0x24fb8c,![]];}return db[_0xec51('0x89')]['create'](_0x1292da)['then'](function(_0x2011dd){return[_0x2011dd,!![]];});});}})[_0xec51('0x8c')](function(_0x554646,_0x2aa587){if(_0x554646){_0x2ba6f8=_0x2aa587;if(!_0x2aa587){var _0x273161={'from':(_0x4d7a59[_0xec51('0x85')][_0xec51('0x86')]||'')+'\x20'+(_0x4d7a59[_0xec51('0x85')][_0xec51('0x87')]||'')};if(_0x25d406[_0xec51('0x56')][_0xec51('0x88')]&&_0x25d406['body'][_0xec51('0x8d')]&&_0x25d406[_0xec51('0x56')][_0xec51('0x88')]!=_0x25d406[_0xec51('0x56')][_0xec51('0x8d')]){_0x273161[_0xec51('0x88')]=_0x25d406[_0xec51('0x56')][_0xec51('0x8d')];}return _0x554646['update'](_0x273161);}else{return _0x554646;}}})[_0xec51('0x1c')](function(_0x1d6504){_0x4d7a59[_0xec51('0x8e')]=_0x1d6504[_0xec51('0x33')]({'plain':!![]});_0x4d7a59[_0xec51('0x8e')][_0xec51('0x8f')]=_0x2ba6f8;if(_0x4d7a59[_0xec51('0x8e')][_0xec51('0x8f')]){if(_0x4d7a59['account'][_0xec51('0x90')]){_0x4d7a59['applications'][_0xec51('0x91')]({'id':0x0,'priority':_0x4d7a59[_0xec51('0x7f')][_0xec51('0x46')]+0x1,'app':_0xec51('0x92'),'appdata':_0xec51('0x93'),'interval':_0xec51('0x94')});}}return db[_0xec51('0x95')][_0xec51('0x55')]({'body':_0x25d406[_0xec51('0x56')][_0xec51('0x56')],'OpenchannelAccountId':_0x25d406[_0xec51('0x51')]['id'],'OpenchannelInteractionId':_0x1d6504['id'],'direction':'in','ContactId':_0x4d7a59['contact']['id'],'AttachmentId':_0x25d406[_0xec51('0x56')][_0xec51('0x96')]});})['then'](function(_0x19b69a){_0x4d7a59[_0xec51('0x23')]=_0x19b69a;if(!_0x4d7a59[_0xec51('0x8e')][_0xec51('0x97')])return;return db['User'][_0xec51('0x5b')]({'attributes':['id',_0xec51('0x36')],'where':{'id':_0x4d7a59[_0xec51('0x8e')]['UserId']}});})[_0xec51('0x1c')](function(_0x502f73){if(_0x502f73){_0x4d7a59[_0xec51('0x7f')][_0xec51('0x98')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x502f73['name']+','+(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x99')]||0xa),'interval':'*,*,*,*'});}if(!_0x4d7a59['interaction'][_0xec51('0x9a')])return;return db[_0xec51('0x9b')][_0xec51('0x5b')]({'attributes':['id',_0xec51('0x36')],'where':{'id':_0x4d7a59['interaction']['queueId']}});})['then'](function(_0x53128d){if(_0x53128d){_0x4d7a59[_0xec51('0x7f')][_0xec51('0x98')]({'id':0x0,'priority':0x1,'app':_0xec51('0x9c'),'appdata':_0x53128d[_0xec51('0x36')]+','+(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x9d')]||0x12c),'interval':_0xec51('0x94')});}return respondWithRpcPromise('Start',_0xec51('0x9e'),_0x4d7a59);})['then'](function(_0x3690c1){respondWithRpcPromise('EventManager','EventManager',{'event':_0xec51('0x9f'),'message':_0x3690c1},client9002);return _0x3690c1;})[_0xec51('0x1c')](respondWithResult(_0x54e947,null))['catch'](handleError(_0x54e947,null));};exports[_0xec51('0xa0')]=function(_0x707d96,_0x324fa3){var _0xd21c0b=_0x707d96[_0xec51('0x51')]['id'];var _0x383647=_0x707d96[_0xec51('0x56')];var _0x5386f6=0xc8;var _0x87c8a9=null;return db[_0xec51('0xa1')][_0xec51('0xa2')]({'isolationLevel':db[_0xec51('0xa1')][_0xec51('0xa3')][_0xec51('0xa4')][_0xec51('0xa5')]},function(_0x41c197){return db['OpenchannelAccount']['findOne']({'where':{'id':_0xd21c0b},'transaction':_0x41c197})[_0xec51('0x1c')](function(_0x9cbcaf){if(_0x9cbcaf){return db['OpenchannelApplication'][_0xec51('0x32')]({'where':{'OpenchannelAccountId':_0xd21c0b},'transaction':_0x41c197})[_0xec51('0x1c')](function(){var _0x4b3cf2=_['map'](_0x383647,function(_0x3ab7fb){_0x3ab7fb[_0xec51('0x63')]=_0xd21c0b;return _0x3ab7fb;});return db['OpenchannelApplication']['bulkCreate'](_0x4b3cf2,{'transaction':_0x41c197});});}else{_0x5386f6=0x194;_0x87c8a9=[];}});})['then'](function(){if(_0x5386f6!==0x194){return db['OpenchannelApplication'][_0xec51('0xa6')]({'where':{'OpenchannelAccountId':_0xd21c0b},'order':_0xec51('0xa7')})['then'](function(_0x4ce895){_0x87c8a9=_0x4ce895;});}})[_0xec51('0x25')](function(_0x1c435d){_0x5386f6=0x1f4;logger['error'](_0x1c435d[_0xec51('0xa8')]);if(_0x1c435d['name']){delete _0x1c435d[_0xec51('0x36')];}_0x87c8a9=_0x1c435d;})[_0xec51('0xa9')](function(){if(_0x87c8a9===null){_0x324fa3['sendStatus'](_0x5386f6);}else{if(_0x5386f6===0x1f4){_0x324fa3[_0xec51('0x27')](_0x5386f6)[_0xec51('0x37')](_0x87c8a9);}else{_0x324fa3[_0xec51('0x27')](_0x5386f6)[_0xec51('0x28')](_0x87c8a9);}}});};exports['getApplications']=function(_0x1e5b9d,_0x51726d,_0x217941){var _0x1d9210={};var _0x467d2c={};var _0x4e2958;var _0x66f555;return db[_0xec51('0x3c')][_0xec51('0x62')]({'where':{'id':_0x1e5b9d[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x51726d,null))['then'](function(_0x2ffbcd){if(_0x2ffbcd){_0x4e2958=_0x2ffbcd;_0x467d2c[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0x7b')]['rawAttributes']);_0x467d2c[_0xec51('0x41')]=_[_0xec51('0x42')](_0x1e5b9d[_0xec51('0x41')]);_0x467d2c[_0xec51('0x43')]=_[_0xec51('0x44')](_0x467d2c['model'],_0x467d2c['query']);_0x1d9210['attributes']=_[_0xec51('0x44')](_0x467d2c['model'],qs['fields'](_0x1e5b9d['query'][_0xec51('0x52')]));_0x1d9210[_0xec51('0x45')]=_0x1d9210[_0xec51('0x45')][_0xec51('0x46')]?_0x1d9210['attributes']:_0x467d2c[_0xec51('0x40')];_0x1d9210['order']=qs[_0xec51('0x49')](_0x1e5b9d[_0xec51('0x41')][_0xec51('0x49')]);_0x1d9210['where']=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x1e5b9d[_0xec51('0x41')],_0x467d2c['filters']));if(_0x1e5b9d[_0xec51('0x41')][_0xec51('0x4c')]){_0x1d9210[_0xec51('0x4a')]=_['merge'](_0x1d9210[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x1d9210['attributes'],function(_0x56e753){var _0x3cd40e={};_0x3cd40e[_0x56e753]={'$like':'%'+_0x1e5b9d[_0xec51('0x41')][_0xec51('0x4c')]+'%'};return _0x3cd40e;})});}_0x1d9210=_[_0xec51('0x4d')]({},_0x1d9210,_0x1e5b9d[_0xec51('0x54')]);return _0x4e2958[_0xec51('0xaa')](_0x1d9210);}})[_0xec51('0x1c')](function(_0x4d3ed1){if(_0x4d3ed1){_0x66f555=_0x4d3ed1[_0xec51('0x46')];if(!_0x1e5b9d[_0xec51('0x41')][_0xec51('0x47')](_0xec51('0x48'))){_0x1d9210[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x1e5b9d[_0xec51('0x41')][_0xec51('0x2b')]);_0x1d9210[_0xec51('0x29')]=qs['offset'](_0x1e5b9d[_0xec51('0x41')][_0xec51('0x29')]);}return _0x4e2958[_0xec51('0xaa')](_0x1d9210);}})[_0xec51('0x1c')](function(_0x5df392){if(_0x5df392){return _0x5df392?{'count':_0x66f555,'rows':_0x5df392}:null;}})[_0xec51('0x1c')](respondWithResult(_0x51726d,null))[_0xec51('0x25')](handleError(_0x51726d,null));};exports[_0xec51('0xab')]=function(_0x22493c,_0x3d105f,_0x7ece0){var _0x49af0b={'raw':![],'where':{}};var _0x2f0859={};var _0xa92149={'count':0x0,'rows':[]};return db[_0xec51('0x3c')][_0xec51('0x62')]({'where':{'id':_0x22493c[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x3d105f,null))['then'](function(_0x1f4c93){if(_0x1f4c93){_0x2f0859[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0x89')][_0xec51('0x3d')]);_0x2f0859['query']=_[_0xec51('0x42')](_0x22493c[_0xec51('0x41')]);_0x2f0859[_0xec51('0x43')]=_[_0xec51('0x44')](_0x2f0859[_0xec51('0x40')],_0x2f0859['query']);_0x49af0b[_0xec51('0x45')]=_[_0xec51('0x44')](_0x2f0859[_0xec51('0x40')],qs['fields'](_0x22493c[_0xec51('0x41')][_0xec51('0x52')]));_0x49af0b['attributes']=_0x49af0b['attributes'][_0xec51('0x46')]?_0x49af0b[_0xec51('0x45')]:_0x2f0859['model'];if(!_0x22493c['query'][_0xec51('0x47')](_0xec51('0x48'))){_0x49af0b[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x22493c['query'][_0xec51('0x2b')]);_0x49af0b[_0xec51('0x29')]=qs[_0xec51('0x29')](_0x22493c[_0xec51('0x41')][_0xec51('0x29')]);}_0x49af0b[_0xec51('0x69')]=qs[_0xec51('0x49')](_0x22493c[_0xec51('0x41')][_0xec51('0x49')]);_0x49af0b['where']=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x22493c[_0xec51('0x41')],_0x2f0859[_0xec51('0x43')]));_0x49af0b[_0xec51('0x4a')][_0xec51('0x63')]=_0x1f4c93['id'];if(_0x22493c['query'][_0xec51('0x4c')]){_0x49af0b[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x49af0b[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x49af0b[_0xec51('0x45')],function(_0x249357){var _0x48cb12={};_0x48cb12[_0x249357]={'$like':'%'+_0x22493c[_0xec51('0x41')][_0xec51('0x4c')]+'%'};return _0x48cb12;})});}_0x49af0b=_[_0xec51('0x4d')]({},_0x49af0b,_0x22493c[_0xec51('0x54')]);return db[_0xec51('0x89')][_0xec51('0x2c')]({'where':_0x49af0b['where']})['then'](function(_0x57b9ed){_0xa92149[_0xec51('0x2c')]=_0x57b9ed;if(_0x22493c[_0xec51('0x41')][_0xec51('0x4e')]){_0x49af0b['include']=[{'model':db[_0xec51('0x6c')],'as':_0xec51('0xac'),'required':![]},{'model':db[_0xec51('0xad')],'as':'Owner','attributes':['name',_0xec51('0xae'),_0xec51('0xaf')],'required':![]},{'model':db[_0xec51('0xb0')],'as':_0xec51('0xb1'),'attributes':['id',_0xec51('0x36'),_0xec51('0xb2')],'where':_0x22493c[_0xec51('0x41')][_0xec51('0xb3')]?{'id':_0x22493c[_0xec51('0x41')][_0xec51('0xb3')]}:undefined,'required':_0x22493c[_0xec51('0x41')][_0xec51('0xb3')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xec51('0x4f')](_0x49af0b);})[_0xec51('0x1c')](function(_0x46a1fe){_0xa92149[_0xec51('0x50')]=_0x46a1fe;return _0xa92149;});}})[_0xec51('0x1c')](respondWithFilteredResult(_0x3d105f,_0x49af0b))[_0xec51('0x25')](handleError(_0x3d105f,null));};exports[_0xec51('0xb4')]=function(_0x14df11,_0xf55e77,_0x314be9){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x14df11[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0xf55e77,null))[_0xec51('0x1c')](function(_0x18c963){if(_0x18c963){return _0x18c963['addAgents'](_0x14df11[_0xec51('0x56')][_0xec51('0x65')],_[_0xec51('0xb5')](_0x14df11[_0xec51('0x56')],['ids','id'])||{})[_0xec51('0x8c')](function(_0x416142){for(var _0x39bcff=0x0;_0x39bcff<_0x14df11[_0xec51('0x56')]['ids'][_0xec51('0x46')];_0x39bcff+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x14df11[_0xec51('0x56')][_0xec51('0x65')][_0x39bcff]),'OpenchannelAccountId':Number(_0x14df11[_0xec51('0x51')]['id'])});}return _0x416142;});}})['then'](respondWithResult(_0xf55e77,null))[_0xec51('0x25')](handleError(_0xf55e77,null));};exports[_0xec51('0xb6')]=function(_0x386ec3,_0x3bc5c2,_0x3c3b9b){return db['OpenchannelAccount']['find']({'where':{'id':_0x386ec3[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x3bc5c2,null))[_0xec51('0x1c')](function(_0x143f0c){if(_0x143f0c){return _0x143f0c['removeAgents'](_0x386ec3[_0xec51('0x41')][_0xec51('0x65')])[_0xec51('0x1c')](function(){if(_[_0xec51('0xb7')](_0x386ec3[_0xec51('0x41')][_0xec51('0x65')])){for(var _0x4e545f=0x0;_0x4e545f<_0x386ec3['query'][_0xec51('0x65')][_0xec51('0x46')];_0x4e545f+=0x1){socket[_0xec51('0xb8')](_0xec51('0xb9'),{'UserId':Number(_0x386ec3[_0xec51('0x41')]['ids'][_0x4e545f]),'OpenchannelAccountId':Number(_0x386ec3[_0xec51('0x51')]['id'])});}}else{socket[_0xec51('0xb8')](_0xec51('0xb9'),{'UserId':Number(_0x386ec3[_0xec51('0x41')][_0xec51('0x65')]),'OpenchannelAccountId':Number(_0x386ec3[_0xec51('0x51')]['id'])});}});}})[_0xec51('0x1c')](respondWithStatusCode(_0x3bc5c2,null))[_0xec51('0x25')](handleError(_0x3bc5c2,null));};exports[_0xec51('0xba')]=function(_0x28c39e,_0x254e20,_0x5e9780){var _0x2ec87b={};var _0x470c8e={};var _0x48969c;var _0x1b0b66;return db[_0xec51('0x3c')]['findOne']({'where':{'id':_0x28c39e[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x254e20,null))[_0xec51('0x1c')](function(_0x3782a8){if(_0x3782a8){_0x48969c=_0x3782a8;_0x470c8e[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0xad')][_0xec51('0x3d')]);_0x470c8e[_0xec51('0x41')]=_[_0xec51('0x42')](_0x28c39e[_0xec51('0x41')]);_0x470c8e[_0xec51('0x43')]=_['intersection'](_0x470c8e[_0xec51('0x40')],_0x470c8e[_0xec51('0x41')]);_0x2ec87b['attributes']=_[_0xec51('0x44')](_0x470c8e[_0xec51('0x40')],qs['fields'](_0x28c39e[_0xec51('0x41')]['fields']));_0x2ec87b[_0xec51('0x45')]=_0x2ec87b[_0xec51('0x45')][_0xec51('0x46')]?_0x2ec87b[_0xec51('0x45')]:_0x470c8e[_0xec51('0x40')];_0x2ec87b[_0xec51('0x69')]=qs['sort'](_0x28c39e['query'][_0xec51('0x49')]);_0x2ec87b[_0xec51('0x4a')]=qs['filters'](_[_0xec51('0x4b')](_0x28c39e[_0xec51('0x41')],_0x470c8e['filters']));if(_0x28c39e[_0xec51('0x41')][_0xec51('0x4c')]){_0x2ec87b[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x2ec87b[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x2ec87b['attributes'],function(_0x44eeb0){var _0x37ed1f={};_0x37ed1f[_0x44eeb0]={'$like':'%'+_0x28c39e[_0xec51('0x41')][_0xec51('0x4c')]+'%'};return _0x37ed1f;})});}_0x2ec87b=_[_0xec51('0x4d')]({},_0x2ec87b,_0x28c39e[_0xec51('0x54')]);return _0x48969c[_0xec51('0xba')](_0x2ec87b);}})[_0xec51('0x1c')](function(_0x21c0bf){if(_0x21c0bf){_0x1b0b66=_0x21c0bf['length'];if(!_0x28c39e['query'][_0xec51('0x47')]('nolimit')){_0x2ec87b[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x28c39e[_0xec51('0x41')][_0xec51('0x2b')]);_0x2ec87b[_0xec51('0x29')]=qs['offset'](_0x28c39e[_0xec51('0x41')][_0xec51('0x29')]);}return _0x48969c[_0xec51('0xba')](_0x2ec87b);}})[_0xec51('0x1c')](function(_0x3b92de){if(_0x3b92de){return _0x3b92de?{'count':_0x1b0b66,'rows':_0x3b92de}:null;}})[_0xec51('0x1c')](respondWithResult(_0x254e20,null))[_0xec51('0x25')](handleError(_0x254e20,null));};exports[_0xec51('0x37')]=function(_0x47ccfc,_0x42194f,_0x365ce4){var _0x1c6c44,_0x55eecf,_0x38fed7;if(_[_0xec51('0x74')](_0x47ccfc[_0xec51('0x56')][_0xec51('0x56')])||_0x47ccfc['body'][_0xec51('0x56')]===''){throw new db[(_0xec51('0x6d'))]['ValidationError'](_0xec51('0xbb'));}if(_[_0xec51('0x74')](_0x47ccfc[_0xec51('0x56')]['to'])){}_0x1c6c44=_0x47ccfc[_0xec51('0x56')]['to'];return db[_0xec51('0x3c')][_0xec51('0x62')]({'where':{'id':_0x47ccfc['params']['id']}})['then'](handleEntityNotFound(_0x42194f,null))[_0xec51('0x1c')](function(_0x1890cd){if(_0x1890cd){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x1890cd['id']},'include':[{'model':db['CmList'],'as':_0xec51('0x7a'),'include':[{'model':db[_0xec51('0x6c')],'as':_0xec51('0x82'),'where':{[_0x1890cd[_0xec51('0x76')]]:_0x1c6c44},'limit':0x1,'order':[[_0xec51('0x70'),_0xec51('0xbc')]]}]}]})[_0xec51('0x1c')](handleEntityNotFound(_0x42194f,null))['then'](function(_0x4a0698){if(_0x4a0698&&_0x4a0698['List']){_0x55eecf=_0x4a0698['get']({'plain':!![]});if(_0x55eecf[_0xec51('0x7a')]&&_0x55eecf[_0xec51('0x7a')][_0xec51('0x82')]['length']){return _0x55eecf['List'][_0xec51('0x82')][0x0];}return db[_0xec51('0x6c')]['create'](_[_0xec51('0x83')](_0x47ccfc[_0xec51('0x56')],{'firstName':_0x1c6c44,[_0x4a0698[_0xec51('0x76')]]:_0x1c6c44,'phone':_0x1c6c44,'ListId':_0x55eecf[_0xec51('0x73')]}));}})[_0xec51('0x1c')](handleEntityNotFound(_0x42194f,null))[_0xec51('0x1c')](function(_0x511f84){if(_0x511f84){_0x38fed7=_0x511f84;return db[_0xec51('0x89')][_0xec51('0x5b')]({'where':{'ContactId':_0x38fed7['id'],'closed':![],'OpenchannelAccountId':_0x55eecf['id']}})['then'](function(_0xdbdf2b){if(_0xdbdf2b){return[_0xdbdf2b,![]];}return db[_0xec51('0x89')][_0xec51('0x55')]({'UserId':_0x47ccfc[_0xec51('0x57')]['id'],'ContactId':_0x38fed7['id'],'OpenchannelAccountId':_0x55eecf['id'],'lastMsgDirection':'out','firstMsgDirection':_0xec51('0xbd'),'Messages':[_['merge'](_0x47ccfc[_0xec51('0x56')],{'read':![],'body':_0x47ccfc['body'][_0xec51('0x56')],'OpenchannelAccountId':_0x55eecf['id'],'UserId':_0x47ccfc[_0xec51('0x57')]['id'],'ContactId':_0x38fed7['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xec51('0x1c')](function(_0x1f0587){return[_0x1f0587,!![]];});});}})[_0xec51('0x8c')](function(_0x2c5c72,_0x40d531){if(_0x40d531){return _0x2c5c72;}return db[_0xec51('0x95')]['create'](_[_0xec51('0x4d')](_0x47ccfc[_0xec51('0x56')],{'read':![],'body':_0x47ccfc[_0xec51('0x56')][_0xec51('0x56')],'OpenchannelAccountId':_0x55eecf['id'],'OpenchannelInteractionId':_0x2c5c72['id'],'UserId':_0x47ccfc['user']['id'],'ContactId':_0x38fed7['id']}))[_0xec51('0x1c')](function(_0x34a1bc){_0x2c5c72[_0xec51('0xbe')][_0xec51('0xbf')]=[];_0x2c5c72['dataValues']['Messages'][_0xec51('0x91')](_0x34a1bc[_0xec51('0xbe')]);return _0x2c5c72;});});}})[_0xec51('0x1c')](respondWithResult(_0x42194f,null))[_0xec51('0x25')](handleError(_0x42194f,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 01c298b..c02007a 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 _0x6c76=['update','emit','hook','events','../../mysqldb','OpenchannelAccount','save'];(function(_0x5c8770,_0x46b8cf){var _0x528655=function(_0x50eea4){while(--_0x50eea4){_0x5c8770['push'](_0x5c8770['shift']());}};_0x528655(++_0x46b8cf);}(_0x6c76,0x184));var _0x66c7=function(_0x469ac0,_0x2a13c7){_0x469ac0=_0x469ac0-0x0;var _0x806df5=_0x6c76[_0x469ac0];return _0x806df5;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var OpenchannelAccount=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x66c7('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x41bb=['../../mysqldb','setMaxListeners','update','remove','emit','events'];(function(_0x5ddafe,_0x5646dd){var _0x7d2555=function(_0x22387a){while(--_0x22387a){_0x5ddafe['push'](_0x5ddafe['shift']());}};_0x7d2555(++_0x5646dd);}(_0x41bb,0xc5));var _0xb41b=function(_0x3e9b51,_0x146374){_0x3e9b51=_0x3e9b51-0x0;var _0x333349=_0x41bb[_0x3e9b51];return _0x333349;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var OpenchannelAccount=require(_0xb41b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41b('0x3'),'afterDestroy':_0xb41b('0x4')};function emitEvent(_0x148333){return function(_0x448c8e,_0x4ee21b,_0x12cea3){OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333+':'+_0x448c8e['id'],_0x448c8e);OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333,_0x448c8e);_0x12cea3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 1bdf6b4..b1b720d 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(_0x486587,_0x3095dc){var _0x11b9b2=function(_0x4a1759){while(--_0x4a1759){_0x486587['push'](_0x486587['shift']());}};_0x11b9b2(++_0x3095dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x4f4057,_0x483729){var _0x497b0d=function(_0xdd17e0){while(--_0xdd17e0){_0x4f4057['push'](_0x4f4057['shift']());}};_0x497b0d(++_0x483729);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 562a43c..d3c8a29 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 _0xbdb7=['http','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','error','code','message','OpenchannelAccount,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x289876,_0x24e1ab){var _0x303d78=function(_0x5e91a2){while(--_0x5e91a2){_0x289876['push'](_0x289876['shift']());}};_0x303d78(++_0x24e1ab);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0xbdb7[_0x3e8930];return _0x15b38f;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});config[_0x7bdb('0xb')]=_['defaults'](config['redis'],{'host':_0x7bdb('0xc'),'port':0x18eb});var socket=require(_0x7bdb('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x7bdb('0xe')](socket);function respondWithRpcPromise(_0x1a6b61,_0x2cb569,_0x2c328e){return new BPromise(function(_0x27297d,_0x144ff7){return client[_0x7bdb('0xf')](_0x1a6b61,_0x2c328e)[_0x7bdb('0x10')](function(_0x5462da){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2cb569,_0x7bdb('0x11'));logger[_0x7bdb('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2cb569,_0x7bdb('0x11'),JSON['stringify'](_0x5462da));if(_0x5462da['error']){if(_0x5462da[_0x7bdb('0x13')][_0x7bdb('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2cb569,_0x5462da['error'][_0x7bdb('0x15')]);return _0x144ff7(_0x5462da[_0x7bdb('0x13')][_0x7bdb('0x15')]);}logger[_0x7bdb('0x13')](_0x7bdb('0x16'),_0x2cb569,_0x5462da[_0x7bdb('0x13')][_0x7bdb('0x15')]);return _0x27297d(_0x5462da[_0x7bdb('0x13')]['message']);}else{logger[_0x7bdb('0x17')](_0x7bdb('0x16'),_0x2cb569,_0x7bdb('0x11'));_0x27297d(_0x5462da[_0x7bdb('0x18')]['message']);}})[_0x7bdb('0x19')](function(_0x23e9eb){logger['error'](_0x7bdb('0x16'),_0x2cb569,_0x23e9eb);_0x144ff7(_0x23e9eb);});});} \ No newline at end of file +var _0x7462=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7462,0x165));var _0x2746=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0x7462[_0x1d30a3];return _0x32bba1;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});config[_0x2746('0x9')]=_[_0x2746('0xa')](config[_0x2746('0x9')],{'host':_0x2746('0xb'),'port':0x18eb});var socket=require(_0x2746('0xc'))(new Redis(config['redis']));require(_0x2746('0xd'))[_0x2746('0xe')](socket);function respondWithRpcPromise(_0x4f9eb7,_0x19bec3,_0x1a6329){return new BPromise(function(_0x2ea416,_0x5aef7e){return client[_0x2746('0xf')](_0x4f9eb7,_0x1a6329)[_0x2746('0x10')](function(_0x1a6d97){logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));logger[_0x2746('0x14')](_0x2746('0x15'),_0x19bec3,_0x2746('0x13'),JSON[_0x2746('0x16')](_0x1a6d97));if(_0x1a6d97[_0x2746('0x17')]){if(_0x1a6d97['error']['code']===0x1f4){logger[_0x2746('0x17')](_0x2746('0x12'),_0x19bec3,_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);return _0x5aef7e(_0x1a6d97['error'][_0x2746('0x18')]);}logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x1a6d97['error'][_0x2746('0x18')]);return _0x2ea416(_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);}else{logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));_0x2ea416(_0x1a6d97[_0x2746('0x19')][_0x2746('0x18')]);}})[_0x2746('0x1a')](function(_0x509879){logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x509879);_0x5aef7e(_0x509879);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 8b139a5..08662ea 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 _0xfd3a=['save','remove','update','emit','removeListener','length','./openchannelAccount.events'];(function(_0x47bf9f,_0x3220af){var _0x126ad9=function(_0x4e1465){while(--_0x4e1465){_0x47bf9f['push'](_0x47bf9f['shift']());}};_0x126ad9(++_0x3220af);}(_0xfd3a,0x179));var _0xafd3=function(_0x9ff536,_0xf80c5e){_0x9ff536=_0x9ff536-0x0;var _0x2f19bd=_0xfd3a[_0x9ff536];return _0x2f19bd;};'use strict';var OpenchannelAccountEvents=require(_0xafd3('0x0'));var events=[_0xafd3('0x1'),_0xafd3('0x2'),_0xafd3('0x3')];function createListener(_0x4ce05e,_0x488608){return function(_0x160b0d){_0x488608[_0xafd3('0x4')](_0x4ce05e,_0x160b0d);};}function removeListener(_0x328118,_0x415217){return function(){OpenchannelAccountEvents[_0xafd3('0x5')](_0x328118,_0x415217);};}exports['register']=function(_0x9db715){for(var _0x1a72eb=0x0,_0x1f7e16=events[_0xafd3('0x6')];_0x1a72eb<_0x1f7e16;_0x1a72eb++){var _0xd2d780=events[_0x1a72eb];var _0x4c4dcd=createListener('openchannelAccount:'+_0xd2d780,_0x9db715);OpenchannelAccountEvents['on'](_0xd2d780,_0x4c4dcd);}}; \ No newline at end of file +var _0x1094=['openchannelAccount:','./openchannelAccount.events','save','update','emit','register','length'];(function(_0x364cf8,_0x146b9b){var _0x6a59ee=function(_0x3d81eb){while(--_0x3d81eb){_0x364cf8['push'](_0x364cf8['shift']());}};_0x6a59ee(++_0x146b9b);}(_0x1094,0x143));var _0x4109=function(_0x579baf,_0x4aaafa){_0x579baf=_0x579baf-0x0;var _0x4c601a=_0x1094[_0x579baf];return _0x4c601a;};'use strict';var OpenchannelAccountEvents=require(_0x4109('0x0'));var events=[_0x4109('0x1'),'remove',_0x4109('0x2')];function createListener(_0x52b156,_0x42557f){return function(_0x32d6c3){_0x42557f[_0x4109('0x3')](_0x52b156,_0x32d6c3);};}function removeListener(_0x181d79,_0x36e917){return function(){OpenchannelAccountEvents['removeListener'](_0x181d79,_0x36e917);};}exports[_0x4109('0x4')]=function(_0x12fdda){for(var _0x40e398=0x0,_0x36c3e9=events[_0x4109('0x5')];_0x40e398<_0x36c3e9;_0x40e398++){var _0x2c34f=events[_0x40e398];var _0x5512e8=createListener(_0x4109('0x6')+_0x2c34f,_0x12fdda);OpenchannelAccountEvents['on'](_0x2c34f,_0x5512e8);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index b0f1170..527d89e 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 _0x35af=['isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x11b22d,_0x3fd878){var _0x41fea1=function(_0x40e679){while(--_0x40e679){_0x11b22d['push'](_0x11b22d['shift']());}};_0x41fea1(++_0x3fd878);}(_0x35af,0x14c));var _0xf35a=function(_0x199659,_0x3e5a3b){_0x199659=_0x199659-0x0;var _0x39c471=_0x35af[_0x199659];return _0x39c471;};'use strict';var multer=require(_0xf35a('0x0'));var util=require('util');var path=require(_0xf35a('0x1'));var timeout=require(_0xf35a('0x2'));var express=require('express');var router=express[_0xf35a('0x3')]();var fs_extra=require(_0xf35a('0x4'));var auth=require(_0xf35a('0x5'));var interaction=require(_0xf35a('0x6'));var config=require(_0xf35a('0x7'));var controller=require(_0xf35a('0x8'));router[_0xf35a('0x9')]('/',auth[_0xf35a('0xa')](),controller['index']);router['get'](_0xf35a('0xb'),auth[_0xf35a('0xa')](),controller['show']);router['post']('/',auth[_0xf35a('0xa')](),controller[_0xf35a('0xc')]);router[_0xf35a('0xd')](_0xf35a('0xb'),auth[_0xf35a('0xa')](),controller[_0xf35a('0xe')]);router[_0xf35a('0xf')]('/:id',auth[_0xf35a('0xa')](),controller[_0xf35a('0x10')]);module[_0xf35a('0x11')]=router; \ No newline at end of file +var _0x9a8a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','/:id','show','put','delete','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x3cd7d4,_0x3b1d6e){var _0x4d5822=function(_0x3aad97){while(--_0x3aad97){_0x3cd7d4['push'](_0x3cd7d4['shift']());}};_0x4d5822(++_0x3b1d6e);}(_0x9a8a,0x6b));var _0xa9a8=function(_0x2e99d3,_0x4054a3){_0x2e99d3=_0x2e99d3-0x0;var _0x160eff=_0x9a8a[_0x2e99d3];return _0x160eff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa9a8('0x0'));var timeout=require(_0xa9a8('0x1'));var express=require(_0xa9a8('0x2'));var router=express[_0xa9a8('0x3')]();var fs_extra=require(_0xa9a8('0x4'));var auth=require(_0xa9a8('0x5'));var interaction=require(_0xa9a8('0x6'));var config=require(_0xa9a8('0x7'));var controller=require(_0xa9a8('0x8'));router['get']('/',auth[_0xa9a8('0x9')](),controller['index']);router[_0xa9a8('0xa')](_0xa9a8('0xb'),auth[_0xa9a8('0x9')](),controller[_0xa9a8('0xc')]);router['post']('/',auth[_0xa9a8('0x9')](),controller['create']);router[_0xa9a8('0xd')](_0xa9a8('0xb'),auth[_0xa9a8('0x9')](),controller['update']);router[_0xa9a8('0xe')]('/:id',auth[_0xa9a8('0x9')](),controller['destroy']);module[_0xa9a8('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index cbaab6f..50f79b5 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 _0x8303=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x25bf53,_0x29ea0a){var _0xd0868a=function(_0x39a7f7){while(--_0x39a7f7){_0x25bf53['push'](_0x25bf53['shift']());}};_0xd0868a(++_0x29ea0a);}(_0x8303,0x150));var _0x3830=function(_0x5ec6b5,_0x5d5285){_0x5ec6b5=_0x5ec6b5-0x0;var _0x24a68a=_0x8303[_0x5ec6b5];return _0x24a68a;};'use strict';var Sequelize=require(_0x3830('0x0'));module[_0x3830('0x1')]={'priority':{'type':Sequelize[_0x3830('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3830('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3830('0x4')]()},'description':{'type':Sequelize[_0x3830('0x3')]},'interval':{'type':Sequelize[_0x3830('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd55e=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd55e,0xdf));var _0xed55=function(_0x50c525,_0x3438af){_0x50c525=_0x50c525-0x0;var _0x2ac69a=_0xd55e[_0x50c525];return _0x2ac69a;};'use strict';var Sequelize=require(_0xed55('0x0'));module[_0xed55('0x1')]={'priority':{'type':Sequelize[_0xed55('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xed55('0x3')],'allowNull':![],'defaultValue':_0xed55('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xed55('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 3e52718..7760bc1 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 _0x4ffb=['hasOwnProperty','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','OpenchannelApplication','findAll','rows','catch','params','keys','include','find','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','end','error','name','send','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length'];(function(_0x2cf6a3,_0x35167c){var _0x804c50=function(_0xd59305){while(--_0xd59305){_0x2cf6a3['push'](_0x2cf6a3['shift']());}};_0x804c50(++_0x35167c);}(_0x4ffb,0xf6));var _0xb4ff=function(_0x13a275,_0x3959a5){_0x13a275=_0x13a275-0x0;var _0x45919a=_0x4ffb[_0x13a275];return _0x45919a;};'use strict';var emlformat=require(_0xb4ff('0x0'));var rimraf=require(_0xb4ff('0x1'));var zipdir=require(_0xb4ff('0x2'));var jsonpatch=require(_0xb4ff('0x3'));var rp=require('request-promise');var moment=require(_0xb4ff('0x4'));var BPromise=require(_0xb4ff('0x5'));var Mustache=require(_0xb4ff('0x6'));var util=require(_0xb4ff('0x7'));var path=require('path');var sox=require(_0xb4ff('0x8'));var csv=require(_0xb4ff('0x9'));var ejs=require(_0xb4ff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4ff('0xb'));var squel=require(_0xb4ff('0xc'));var crypto=require(_0xb4ff('0xd'));var jsforce=require(_0xb4ff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb4ff('0x9'));var querystring=require(_0xb4ff('0xf'));var Papa=require(_0xb4ff('0x10'));var Redis=require(_0xb4ff('0x11'));var authService=require(_0xb4ff('0x12'));var qs=require(_0xb4ff('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4ff('0x14'));var logger=require(_0xb4ff('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb4ff('0x16'));var licenseUtil=require(_0xb4ff('0x17'));var db=require(_0xb4ff('0x18'))['db'];function respondWithStatusCode(_0x5c4768,_0x318b4c){_0x318b4c=_0x318b4c||0xcc;return function(_0x493660){if(_0x493660){return _0x5c4768[_0xb4ff('0x19')](_0x318b4c);}return _0x5c4768['status'](_0x318b4c)['end']();};}function respondWithResult(_0x4fdd7c,_0x354d80){_0x354d80=_0x354d80||0xc8;return function(_0x29e011){if(_0x29e011){return _0x4fdd7c[_0xb4ff('0x1a')](_0x354d80)[_0xb4ff('0x1b')](_0x29e011);}};}function respondWithFilteredResult(_0x4a0be1,_0x125c94){return function(_0x25b66b){if(_0x25b66b){var _0x329045=typeof _0x125c94[_0xb4ff('0x1c')]==='undefined'&&typeof _0x125c94[_0xb4ff('0x1d')]===_0xb4ff('0x1e');var _0x549eb2=_0x25b66b[_0xb4ff('0x1f')];var _0x520cad=_0x329045?0x0:_0x125c94['offset'];var _0x57c25a=_0x329045?_0x25b66b['count']:_0x125c94[_0xb4ff('0x1c')]+_0x125c94['limit'];var _0x205086;if(_0x57c25a>=_0x549eb2){_0x57c25a=_0x549eb2;_0x205086=0xc8;}else{_0x205086=0xce;}_0x4a0be1[_0xb4ff('0x1a')](_0x205086);return _0x4a0be1[_0xb4ff('0x20')](_0xb4ff('0x21'),_0x520cad+'-'+_0x57c25a+'/'+_0x549eb2)[_0xb4ff('0x1b')](_0x25b66b);}return null;};}function patchUpdates(_0x2f16e0){return function(_0x1b675a){try{jsonpatch[_0xb4ff('0x22')](_0x1b675a,_0x2f16e0,!![]);}catch(_0x4b27a8){return BPromise[_0xb4ff('0x23')](_0x4b27a8);}return _0x1b675a[_0xb4ff('0x24')]();};}function saveUpdates(_0x52e723,_0x34e1ae){return function(_0x355995){if(_0x355995){return _0x355995['update'](_0x52e723)[_0xb4ff('0x25')](function(_0x9f8ad1){return _0x9f8ad1;});}return null;};}function removeEntity(_0x2e9dda,_0x5afaaf){return function(_0x45ed89){if(_0x45ed89){return _0x45ed89['destroy']()[_0xb4ff('0x25')](function(){_0x2e9dda[_0xb4ff('0x1a')](0xcc)[_0xb4ff('0x26')]();});}};}function handleEntityNotFound(_0x3693b7,_0x54109f){return function(_0x16b9e0){if(!_0x16b9e0){_0x3693b7['sendStatus'](0x194);}return _0x16b9e0;};}function handleError(_0x535ccf,_0x2cb9c5){_0x2cb9c5=_0x2cb9c5||0x1f4;return function(_0x3297ce){logger[_0xb4ff('0x27')](_0x3297ce['stack']);if(_0x3297ce[_0xb4ff('0x28')]){delete _0x3297ce['name'];}_0x535ccf[_0xb4ff('0x1a')](_0x2cb9c5)[_0xb4ff('0x29')](_0x3297ce);};}exports[_0xb4ff('0x2a')]=function(_0x1cfb2d,_0x270b87){var _0x33c155={},_0x214a9c={},_0x46786a={'count':0x0,'rows':[]};var _0x32657b=_['map'](db['OpenchannelApplication'][_0xb4ff('0x2b')],function(_0x3df3c3){return{'name':_0x3df3c3[_0xb4ff('0x2c')],'type':_0x3df3c3['type'][_0xb4ff('0x2d')]};});_0x214a9c['model']=_[_0xb4ff('0x2e')](_0x32657b,'name');_0x214a9c[_0xb4ff('0x2f')]=_['keys'](_0x1cfb2d[_0xb4ff('0x2f')]);_0x214a9c[_0xb4ff('0x30')]=_[_0xb4ff('0x31')](_0x214a9c[_0xb4ff('0x32')],_0x214a9c['query']);_0x33c155[_0xb4ff('0x33')]=_['intersection'](_0x214a9c[_0xb4ff('0x32')],qs['fields'](_0x1cfb2d[_0xb4ff('0x2f')][_0xb4ff('0x34')]));_0x33c155['attributes']=_0x33c155[_0xb4ff('0x33')][_0xb4ff('0x35')]?_0x33c155[_0xb4ff('0x33')]:_0x214a9c[_0xb4ff('0x32')];if(!_0x1cfb2d[_0xb4ff('0x2f')][_0xb4ff('0x36')](_0xb4ff('0x37'))){_0x33c155['limit']=qs[_0xb4ff('0x1d')](_0x1cfb2d[_0xb4ff('0x2f')][_0xb4ff('0x1d')]);_0x33c155[_0xb4ff('0x1c')]=qs[_0xb4ff('0x1c')](_0x1cfb2d[_0xb4ff('0x2f')][_0xb4ff('0x1c')]);}_0x33c155['order']=qs[_0xb4ff('0x38')](_0x1cfb2d[_0xb4ff('0x2f')]['sort']);_0x33c155['where']=qs[_0xb4ff('0x30')](_[_0xb4ff('0x39')](_0x1cfb2d[_0xb4ff('0x2f')],_0x214a9c['filters']),_0x32657b);if(_0x1cfb2d[_0xb4ff('0x2f')]['filter']){_0x33c155[_0xb4ff('0x3a')]=_[_0xb4ff('0x3b')](_0x33c155['where'],{'$or':_['map'](_0x32657b,function(_0x392e91){if(_0x392e91[_0xb4ff('0x3c')]!==_0xb4ff('0x3d')){var _0x4d8f3f={};_0x4d8f3f[_0x392e91[_0xb4ff('0x28')]]={'$like':'%'+_0x1cfb2d[_0xb4ff('0x2f')][_0xb4ff('0x3e')]+'%'};return _0x4d8f3f;}})});}_0x33c155=_[_0xb4ff('0x3b')]({},_0x33c155,_0x1cfb2d['options']);var _0x24d5bb={'where':_0x33c155[_0xb4ff('0x3a')]};return db[_0xb4ff('0x3f')][_0xb4ff('0x1f')](_0x24d5bb)[_0xb4ff('0x25')](function(_0x37f42b){_0x46786a[_0xb4ff('0x1f')]=_0x37f42b;if(_0x1cfb2d[_0xb4ff('0x2f')]['includeAll']){_0x33c155['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xb4ff('0x40')](_0x33c155);})[_0xb4ff('0x25')](function(_0x29dd9a){_0x46786a[_0xb4ff('0x41')]=_0x29dd9a;return _0x46786a;})['then'](respondWithFilteredResult(_0x270b87,_0x33c155))[_0xb4ff('0x42')](handleError(_0x270b87,null));};exports['show']=function(_0x389d5e,_0xea3b56){var _0x32ec05={'raw':!![],'where':{'id':_0x389d5e[_0xb4ff('0x43')]['id']}},_0x11f281={};_0x11f281[_0xb4ff('0x32')]=_[_0xb4ff('0x44')](db[_0xb4ff('0x3f')][_0xb4ff('0x2b')]);_0x11f281['query']=_[_0xb4ff('0x44')](_0x389d5e[_0xb4ff('0x2f')]);_0x11f281[_0xb4ff('0x30')]=_['intersection'](_0x11f281['model'],_0x11f281[_0xb4ff('0x2f')]);_0x32ec05['attributes']=_[_0xb4ff('0x31')](_0x11f281['model'],qs['fields'](_0x389d5e[_0xb4ff('0x2f')]['fields']));_0x32ec05['attributes']=_0x32ec05[_0xb4ff('0x33')][_0xb4ff('0x35')]?_0x32ec05[_0xb4ff('0x33')]:_0x11f281[_0xb4ff('0x32')];if(_0x389d5e['query']['includeAll']){_0x32ec05[_0xb4ff('0x45')]=[{'all':!![]}];}_0x32ec05=_[_0xb4ff('0x3b')]({},_0x32ec05,_0x389d5e['options']);return db[_0xb4ff('0x3f')][_0xb4ff('0x46')](_0x32ec05)[_0xb4ff('0x25')](handleEntityNotFound(_0xea3b56,null))[_0xb4ff('0x25')](respondWithResult(_0xea3b56,null))[_0xb4ff('0x42')](handleError(_0xea3b56,null));};exports[_0xb4ff('0x47')]=function(_0x37476b,_0x2a689b){return db[_0xb4ff('0x3f')][_0xb4ff('0x47')](_0x37476b['body'],{})[_0xb4ff('0x25')](respondWithResult(_0x2a689b,0xc9))[_0xb4ff('0x42')](handleError(_0x2a689b,null));};exports[_0xb4ff('0x48')]=function(_0x2144ac,_0x10a5be){if(_0x2144ac[_0xb4ff('0x49')]['id']){delete _0x2144ac[_0xb4ff('0x49')]['id'];}return db[_0xb4ff('0x3f')]['find']({'where':{'id':_0x2144ac[_0xb4ff('0x43')]['id']}})[_0xb4ff('0x25')](handleEntityNotFound(_0x10a5be,null))['then'](saveUpdates(_0x2144ac[_0xb4ff('0x49')],null))[_0xb4ff('0x25')](respondWithResult(_0x10a5be,null))[_0xb4ff('0x42')](handleError(_0x10a5be,null));};exports[_0xb4ff('0x4a')]=function(_0x13c365,_0x460431){return db[_0xb4ff('0x3f')][_0xb4ff('0x46')]({'where':{'id':_0x13c365['params']['id']}})[_0xb4ff('0x25')](handleEntityNotFound(_0x460431,null))[_0xb4ff('0x25')](removeEntity(_0x460431,null))['catch'](handleError(_0x460431,null));}; \ No newline at end of file +var _0xb446=['sort','filters','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','keys','include','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd3cf,_0x476713){var _0x32c550=function(_0x5a0394){while(--_0x5a0394){_0x3dd3cf['push'](_0x3dd3cf['shift']());}};_0x32c550(++_0x476713);}(_0xb446,0x127));var _0x6b44=function(_0x353a30,_0x50c68a){_0x353a30=_0x353a30-0x0;var _0x213161=_0xb446[_0x353a30];return _0x213161;};'use strict';var emlformat=require(_0x6b44('0x0'));var rimraf=require(_0x6b44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b44('0x2'));var rp=require(_0x6b44('0x3'));var moment=require(_0x6b44('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6b44('0x5'));var util=require(_0x6b44('0x6'));var path=require('path');var sox=require(_0x6b44('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b44('0x8'));var _=require(_0x6b44('0x9'));var squel=require(_0x6b44('0xa'));var crypto=require(_0x6b44('0xb'));var jsforce=require(_0x6b44('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6b44('0xd'));var querystring=require(_0x6b44('0xe'));var Papa=require(_0x6b44('0xf'));var Redis=require(_0x6b44('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6b44('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b44('0x12'));var logger=require(_0x6b44('0x13'))(_0x6b44('0x14'));var utils=require('../../config/utils');var config=require(_0x6b44('0x15'));var licenseUtil=require(_0x6b44('0x16'));var db=require(_0x6b44('0x17'))['db'];function respondWithStatusCode(_0x57ce25,_0xce0535){_0xce0535=_0xce0535||0xcc;return function(_0x2b1aa8){if(_0x2b1aa8){return _0x57ce25[_0x6b44('0x18')](_0xce0535);}return _0x57ce25[_0x6b44('0x19')](_0xce0535)[_0x6b44('0x1a')]();};}function respondWithResult(_0x15510c,_0x1ad989){_0x1ad989=_0x1ad989||0xc8;return function(_0x4ee35c){if(_0x4ee35c){return _0x15510c[_0x6b44('0x19')](_0x1ad989)[_0x6b44('0x1b')](_0x4ee35c);}};}function respondWithFilteredResult(_0x24f7ef,_0x20a7e7){return function(_0x380dc3){if(_0x380dc3){var _0x34d02a=typeof _0x20a7e7[_0x6b44('0x1c')]===_0x6b44('0x1d')&&typeof _0x20a7e7[_0x6b44('0x1e')]===_0x6b44('0x1d');var _0x4d68ec=_0x380dc3['count'];var _0x37175b=_0x34d02a?0x0:_0x20a7e7[_0x6b44('0x1c')];var _0x41f76f=_0x34d02a?_0x380dc3[_0x6b44('0x1f')]:_0x20a7e7[_0x6b44('0x1c')]+_0x20a7e7[_0x6b44('0x1e')];var _0x344bba;if(_0x41f76f>=_0x4d68ec){_0x41f76f=_0x4d68ec;_0x344bba=0xc8;}else{_0x344bba=0xce;}_0x24f7ef['status'](_0x344bba);return _0x24f7ef['set']('Content-Range',_0x37175b+'-'+_0x41f76f+'/'+_0x4d68ec)[_0x6b44('0x1b')](_0x380dc3);}return null;};}function patchUpdates(_0x5eb68b){return function(_0x174275){try{jsonpatch['apply'](_0x174275,_0x5eb68b,!![]);}catch(_0x433225){return BPromise[_0x6b44('0x20')](_0x433225);}return _0x174275[_0x6b44('0x21')]();};}function saveUpdates(_0x5374b9,_0x4cc518){return function(_0x592899){if(_0x592899){return _0x592899[_0x6b44('0x22')](_0x5374b9)[_0x6b44('0x23')](function(_0x26d7c3){return _0x26d7c3;});}return null;};}function removeEntity(_0x3aaee5,_0x268e48){return function(_0x446c34){if(_0x446c34){return _0x446c34[_0x6b44('0x24')]()[_0x6b44('0x23')](function(){_0x3aaee5[_0x6b44('0x19')](0xcc)[_0x6b44('0x1a')]();});}};}function handleEntityNotFound(_0x37f58f,_0x21535d){return function(_0x7c2037){if(!_0x7c2037){_0x37f58f[_0x6b44('0x18')](0x194);}return _0x7c2037;};}function handleError(_0x1770da,_0xab3919){_0xab3919=_0xab3919||0x1f4;return function(_0x14e256){logger['error'](_0x14e256[_0x6b44('0x25')]);if(_0x14e256[_0x6b44('0x26')]){delete _0x14e256[_0x6b44('0x26')];}_0x1770da[_0x6b44('0x19')](_0xab3919)[_0x6b44('0x27')](_0x14e256);};}exports[_0x6b44('0x28')]=function(_0x4b8f46,_0x1158c4){var _0x1741e1={},_0x3d2de4={},_0x9594bd={'count':0x0,'rows':[]};var _0x16a4bf=_[_0x6b44('0x29')](db[_0x6b44('0x2a')][_0x6b44('0x2b')],function(_0x50252b){return{'name':_0x50252b[_0x6b44('0x2c')],'type':_0x50252b[_0x6b44('0x2d')][_0x6b44('0x2e')]};});_0x3d2de4[_0x6b44('0x2f')]=_[_0x6b44('0x29')](_0x16a4bf,_0x6b44('0x26'));_0x3d2de4[_0x6b44('0x30')]=_['keys'](_0x4b8f46[_0x6b44('0x30')]);_0x3d2de4['filters']=_[_0x6b44('0x31')](_0x3d2de4[_0x6b44('0x2f')],_0x3d2de4[_0x6b44('0x30')]);_0x1741e1[_0x6b44('0x32')]=_['intersection'](_0x3d2de4[_0x6b44('0x2f')],qs[_0x6b44('0x33')](_0x4b8f46[_0x6b44('0x30')]['fields']));_0x1741e1[_0x6b44('0x32')]=_0x1741e1[_0x6b44('0x32')][_0x6b44('0x34')]?_0x1741e1[_0x6b44('0x32')]:_0x3d2de4[_0x6b44('0x2f')];if(!_0x4b8f46['query'][_0x6b44('0x35')](_0x6b44('0x36'))){_0x1741e1[_0x6b44('0x1e')]=qs[_0x6b44('0x1e')](_0x4b8f46['query'][_0x6b44('0x1e')]);_0x1741e1[_0x6b44('0x1c')]=qs[_0x6b44('0x1c')](_0x4b8f46[_0x6b44('0x30')][_0x6b44('0x1c')]);}_0x1741e1['order']=qs[_0x6b44('0x37')](_0x4b8f46[_0x6b44('0x30')][_0x6b44('0x37')]);_0x1741e1['where']=qs[_0x6b44('0x38')](_['pick'](_0x4b8f46[_0x6b44('0x30')],_0x3d2de4[_0x6b44('0x38')]),_0x16a4bf);if(_0x4b8f46['query'][_0x6b44('0x39')]){_0x1741e1[_0x6b44('0x3a')]=_[_0x6b44('0x3b')](_0x1741e1[_0x6b44('0x3a')],{'$or':_[_0x6b44('0x29')](_0x16a4bf,function(_0x907bd7){if(_0x907bd7[_0x6b44('0x2d')]!==_0x6b44('0x3c')){var _0x23f6f9={};_0x23f6f9[_0x907bd7[_0x6b44('0x26')]]={'$like':'%'+_0x4b8f46['query'][_0x6b44('0x39')]+'%'};return _0x23f6f9;}})});}_0x1741e1=_[_0x6b44('0x3b')]({},_0x1741e1,_0x4b8f46['options']);var _0x5541af={'where':_0x1741e1[_0x6b44('0x3a')]};return db[_0x6b44('0x2a')][_0x6b44('0x1f')](_0x5541af)[_0x6b44('0x23')](function(_0x37f1dc){_0x9594bd[_0x6b44('0x1f')]=_0x37f1dc;if(_0x4b8f46['query'][_0x6b44('0x3d')]){_0x1741e1['include']=[{'all':!![]}];}return db[_0x6b44('0x2a')][_0x6b44('0x3e')](_0x1741e1);})[_0x6b44('0x23')](function(_0x5b0232){_0x9594bd[_0x6b44('0x3f')]=_0x5b0232;return _0x9594bd;})[_0x6b44('0x23')](respondWithFilteredResult(_0x1158c4,_0x1741e1))[_0x6b44('0x40')](handleError(_0x1158c4,null));};exports['show']=function(_0x2cb94d,_0x31f109){var _0x1f6588={'raw':!![],'where':{'id':_0x2cb94d[_0x6b44('0x41')]['id']}},_0x253c05={};_0x253c05[_0x6b44('0x2f')]=_['keys'](db[_0x6b44('0x2a')][_0x6b44('0x2b')]);_0x253c05[_0x6b44('0x30')]=_[_0x6b44('0x42')](_0x2cb94d[_0x6b44('0x30')]);_0x253c05[_0x6b44('0x38')]=_['intersection'](_0x253c05['model'],_0x253c05[_0x6b44('0x30')]);_0x1f6588[_0x6b44('0x32')]=_[_0x6b44('0x31')](_0x253c05[_0x6b44('0x2f')],qs[_0x6b44('0x33')](_0x2cb94d[_0x6b44('0x30')][_0x6b44('0x33')]));_0x1f6588[_0x6b44('0x32')]=_0x1f6588['attributes'][_0x6b44('0x34')]?_0x1f6588[_0x6b44('0x32')]:_0x253c05['model'];if(_0x2cb94d[_0x6b44('0x30')][_0x6b44('0x3d')]){_0x1f6588[_0x6b44('0x43')]=[{'all':!![]}];}_0x1f6588=_['merge']({},_0x1f6588,_0x2cb94d['options']);return db[_0x6b44('0x2a')][_0x6b44('0x44')](_0x1f6588)[_0x6b44('0x23')](handleEntityNotFound(_0x31f109,null))[_0x6b44('0x23')](respondWithResult(_0x31f109,null))['catch'](handleError(_0x31f109,null));};exports['create']=function(_0x17fea1,_0x1a0189){return db[_0x6b44('0x2a')]['create'](_0x17fea1[_0x6b44('0x45')],{})['then'](respondWithResult(_0x1a0189,0xc9))['catch'](handleError(_0x1a0189,null));};exports[_0x6b44('0x22')]=function(_0x54df62,_0x2753b0){if(_0x54df62[_0x6b44('0x45')]['id']){delete _0x54df62[_0x6b44('0x45')]['id'];}return db[_0x6b44('0x2a')][_0x6b44('0x44')]({'where':{'id':_0x54df62[_0x6b44('0x41')]['id']}})['then'](handleEntityNotFound(_0x2753b0,null))[_0x6b44('0x23')](saveUpdates(_0x54df62[_0x6b44('0x45')],null))['then'](respondWithResult(_0x2753b0,null))[_0x6b44('0x40')](handleError(_0x2753b0,null));};exports[_0x6b44('0x24')]=function(_0x50f641,_0x25bf65){return db[_0x6b44('0x2a')][_0x6b44('0x44')]({'where':{'id':_0x50f641[_0x6b44('0x41')]['id']}})[_0x6b44('0x23')](handleEntityNotFound(_0x25bf65,null))[_0x6b44('0x23')](removeEntity(_0x25bf65,null))['catch'](handleError(_0x25bf65,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index f03afc3..4fc7dea 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 _0x1129=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x1129,0x1bc));var _0x9112=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1129[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9112('0x0'));var util=require('util');var logger=require(_0x9112('0x1'))(_0x9112('0x2'));var moment=require(_0x9112('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9112('0x4'));var rimraf=require(_0x9112('0x5'));var config=require(_0x9112('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x9112('0x7')]=function(_0x376512,_0xd7a50c){return _0x376512['define'](_0x9112('0x8'),attributes,{'tableName':_0x9112('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9112('0xa'),'collate':_0x9112('0xb')});}; \ No newline at end of file +var _0x8cde=['../../config/environment','exports','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x4b2975,_0x2be462){var _0x3bc9e8=function(_0x4d1a7e){while(--_0x4d1a7e){_0x4b2975['push'](_0x4b2975['shift']());}};_0x3bc9e8(++_0x2be462);}(_0x8cde,0x13f));var _0xe8cd=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0x8cde[_0x565c4e];return _0x4a167f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe8cd('0x0'))(_0xe8cd('0x1'));var moment=require(_0xe8cd('0x2'));var BPromise=require('bluebird');var rp=require(_0xe8cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8cd('0x4'));var config=require(_0xe8cd('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0xe8cd('0x6')]=function(_0x4ba0f8,_0x5b54cc){return _0x4ba0f8['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe8cd('0x7'),'collate':_0xe8cd('0x8')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5d937c5..abbf8b8 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 _0x4dbc=['util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','UpdateOpenchannelApplication','lodash'];(function(_0x543c28,_0x3d4feb){var _0xa675af=function(_0x2c0f7f){while(--_0x2c0f7f){_0x543c28['push'](_0x543c28['shift']());}};_0xa675af(++_0x3d4feb);}(_0x4dbc,0x178));var _0xc4db=function(_0x437e33,_0x13da19){_0x437e33=_0x437e33-0x0;var _0x413ed5=_0x4dbc[_0x437e33];return _0x413ed5;};'use strict';var _=require(_0xc4db('0x0'));var util=require(_0xc4db('0x1'));var moment=require(_0xc4db('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4db('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4db('0x4'));var logger=require('../../config/logger')(_0xc4db('0x5'));var config=require(_0xc4db('0x6'));var jayson=require(_0xc4db('0x7'));var client=jayson[_0xc4db('0x8')][_0xc4db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11dc38,_0x1a24d9,_0x420cdc){return new BPromise(function(_0x409776,_0x16eb29){return client['request'](_0x11dc38,_0x420cdc)['then'](function(_0x47cd64){logger[_0xc4db('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a24d9,_0xc4db('0xb'));logger[_0xc4db('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x1a24d9,'request\x20sent',JSON[_0xc4db('0xd')](_0x47cd64));if(_0x47cd64[_0xc4db('0xe')]){if(_0x47cd64[_0xc4db('0xe')][_0xc4db('0xf')]===0x1f4){logger[_0xc4db('0xe')](_0xc4db('0x10'),_0x1a24d9,_0x47cd64[_0xc4db('0xe')][_0xc4db('0x11')]);return _0x16eb29(_0x47cd64['error'][_0xc4db('0x11')]);}logger[_0xc4db('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a24d9,_0x47cd64[_0xc4db('0xe')][_0xc4db('0x11')]);return _0x409776(_0x47cd64['error']['message']);}else{logger[_0xc4db('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a24d9,'request\x20sent');_0x409776(_0x47cd64['result'][_0xc4db('0x11')]);}})[_0xc4db('0x12')](function(_0x164c57){logger[_0xc4db('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a24d9,_0x164c57);_0x16eb29(_0x164c57);});});}exports['UpdateOpenchannelApplication']=function(_0x177908){var _0x15b093=this;return new Promise(function(_0x2fcd9c,_0x38dd46){return db[_0xc4db('0x13')][_0xc4db('0x14')](_0x177908[_0xc4db('0x15')],{'raw':_0x177908[_0xc4db('0x16')]?_0x177908['options'][_0xc4db('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x177908['options']?_0x177908[_0xc4db('0x16')][_0xc4db('0x18')]||null:null,'attributes':_0x177908[_0xc4db('0x16')]?_0x177908['options'][_0xc4db('0x19')]||null:null,'limit':_0x177908[_0xc4db('0x16')]?_0x177908[_0xc4db('0x16')][_0xc4db('0x1a')]||null:null})[_0xc4db('0x1b')](function(_0x773302){logger[_0xc4db('0xa')]('UpdateOpenchannelApplication',_0x177908);logger[_0xc4db('0xc')](_0xc4db('0x1c'),_0x177908,JSON[_0xc4db('0xd')](_0x773302));_0x2fcd9c(_0x773302);})[_0xc4db('0x12')](function(_0x3322bc){logger[_0xc4db('0xe')](_0xc4db('0x1c'),_0x3322bc[_0xc4db('0x11')],_0x177908);_0x38dd46(_0x15b093[_0xc4db('0xe')](0x1f4,_0x3322bc[_0xc4db('0x11')]));});});}; \ No newline at end of file +var _0x9292=['stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then'];(function(_0x7b070d,_0x3c38ed){var _0x39761=function(_0xfe2dd3){while(--_0xfe2dd3){_0x7b070d['push'](_0x7b070d['shift']());}};_0x39761(++_0x3c38ed);}(_0x9292,0xf9));var _0x2929=function(_0x161e04,_0x5a7eb6){_0x161e04=_0x161e04-0x0;var _0x373028=_0x9292[_0x161e04];return _0x373028;};'use strict';var _=require('lodash');var util=require(_0x2929('0x0'));var moment=require(_0x2929('0x1'));var BPromise=require(_0x2929('0x2'));var rs=require(_0x2929('0x3'));var fs=require('fs');var Redis=require(_0x2929('0x4'));var db=require(_0x2929('0x5'))['db'];var utils=require(_0x2929('0x6'));var logger=require('../../config/logger')(_0x2929('0x7'));var config=require(_0x2929('0x8'));var jayson=require(_0x2929('0x9'));var client=jayson[_0x2929('0xa')][_0x2929('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f3d61,_0x379c8d,_0x97bf80){return new BPromise(function(_0x5db10b,_0x1e6ef5){return client[_0x2929('0xc')](_0x4f3d61,_0x97bf80)['then'](function(_0x366294){logger[_0x2929('0xd')](_0x2929('0xe'),_0x379c8d,_0x2929('0xf'));logger[_0x2929('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x379c8d,'request\x20sent',JSON['stringify'](_0x366294));if(_0x366294[_0x2929('0x11')]){if(_0x366294[_0x2929('0x11')]['code']===0x1f4){logger['error'](_0x2929('0xe'),_0x379c8d,_0x366294[_0x2929('0x11')][_0x2929('0x12')]);return _0x1e6ef5(_0x366294[_0x2929('0x11')][_0x2929('0x12')]);}logger['error'](_0x2929('0xe'),_0x379c8d,_0x366294[_0x2929('0x11')]['message']);return _0x5db10b(_0x366294[_0x2929('0x11')][_0x2929('0x12')]);}else{logger[_0x2929('0xd')](_0x2929('0xe'),_0x379c8d,_0x2929('0xf'));_0x5db10b(_0x366294[_0x2929('0x13')][_0x2929('0x12')]);}})['catch'](function(_0x12e97b){logger[_0x2929('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x379c8d,_0x12e97b);_0x1e6ef5(_0x12e97b);});});}exports[_0x2929('0x14')]=function(_0x479d70){var _0x454636=this;return new Promise(function(_0x2b704e,_0xb27e10){return db[_0x2929('0x15')][_0x2929('0x16')](_0x479d70[_0x2929('0x17')],{'raw':_0x479d70[_0x2929('0x18')]?_0x479d70[_0x2929('0x18')][_0x2929('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x479d70[_0x2929('0x18')]?_0x479d70[_0x2929('0x18')][_0x2929('0x1a')]||null:null,'attributes':_0x479d70[_0x2929('0x18')]?_0x479d70[_0x2929('0x18')][_0x2929('0x1b')]||null:null,'limit':_0x479d70[_0x2929('0x18')]?_0x479d70['options'][_0x2929('0x1c')]||null:null})[_0x2929('0x1d')](function(_0x21f0df){logger[_0x2929('0xd')](_0x2929('0x14'),_0x479d70);logger['debug'](_0x2929('0x14'),_0x479d70,JSON[_0x2929('0x1e')](_0x21f0df));_0x2b704e(_0x21f0df);})['catch'](function(_0x58c100){logger['error'](_0x2929('0x14'),_0x58c100['message'],_0x479d70);_0xb27e10(_0x454636[_0x2929('0x11')](0x1f4,_0x58c100[_0x2929('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 05fc7a8..43f7d58 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 _0x9a71=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','tracked','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path'];(function(_0x49e015,_0x61b784){var _0x588bbb=function(_0x456f50){while(--_0x456f50){_0x49e015['push'](_0x49e015['shift']());}};_0x588bbb(++_0x61b784);}(_0x9a71,0x81));var _0x19a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a71[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x19a7('0x0'));var util=require(_0x19a7('0x1'));var path=require(_0x19a7('0x2'));var timeout=require(_0x19a7('0x3'));var express=require(_0x19a7('0x4'));var router=express[_0x19a7('0x5')]();var fs_extra=require(_0x19a7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x19a7('0x7'));var config=require(_0x19a7('0x8'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x19a7('0x9')](),controller['index']);router[_0x19a7('0xa')](_0x19a7('0xb'),auth['isAuthenticated'](),controller[_0x19a7('0xc')]);router[_0x19a7('0xa')](_0x19a7('0xd'),auth[_0x19a7('0x9')](),controller[_0x19a7('0xe')]);router['get'](_0x19a7('0xf'),auth[_0x19a7('0x9')](),controller[_0x19a7('0x10')]);router[_0x19a7('0xa')](_0x19a7('0x11'),auth[_0x19a7('0x9')](),controller[_0x19a7('0x12')]);router[_0x19a7('0x13')]('/',auth[_0x19a7('0x9')](),controller[_0x19a7('0x14')]);router['post']('/:id/messages',auth[_0x19a7('0x9')](),controller['addMessage']);router['post'](_0x19a7('0x15'),auth[_0x19a7('0x9')](),interaction['tracked'](_0x19a7('0x16'),_0x19a7('0x17')),controller[_0x19a7('0x18')]);router['put'](_0x19a7('0xd'),auth[_0x19a7('0x9')](),interaction[_0x19a7('0x19')](_0x19a7('0x16'),_0x19a7('0x1a')),controller[_0x19a7('0x1b')]);router['delete']('/:id',auth[_0x19a7('0x9')](),interaction[_0x19a7('0x19')](_0x19a7('0x16'),_0x19a7('0x1c')),controller[_0x19a7('0x1d')]);router[_0x19a7('0x1e')](_0x19a7('0x15'),auth[_0x19a7('0x9')](),controller[_0x19a7('0x1f')]);module[_0x19a7('0x20')]=router; \ No newline at end of file +var _0xbd87=['delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','tracked','openchannel','addTags','put','update','openchannelinteraction:destroy'];(function(_0x391007,_0x4db5ef){var _0x41d7c6=function(_0x4190f0){while(--_0x4190f0){_0x391007['push'](_0x391007['shift']());}};_0x41d7c6(++_0x4db5ef);}(_0xbd87,0x11b));var _0x7bd8=function(_0x24355a,_0x401e18){_0x24355a=_0x24355a-0x0;var _0x5df365=_0xbd87[_0x24355a];return _0x5df365;};'use strict';var multer=require(_0x7bd8('0x0'));var util=require(_0x7bd8('0x1'));var path=require(_0x7bd8('0x2'));var timeout=require(_0x7bd8('0x3'));var express=require(_0x7bd8('0x4'));var router=express[_0x7bd8('0x5')]();var fs_extra=require(_0x7bd8('0x6'));var auth=require(_0x7bd8('0x7'));var interaction=require(_0x7bd8('0x8'));var config=require(_0x7bd8('0x9'));var controller=require('./openchannelInteraction.controller');router[_0x7bd8('0xa')]('/',auth[_0x7bd8('0xb')](),controller['index']);router[_0x7bd8('0xa')](_0x7bd8('0xc'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0xd')]);router['get'](_0x7bd8('0xe'),auth[_0x7bd8('0xb')](),controller['show']);router[_0x7bd8('0xa')](_0x7bd8('0xf'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x10')]);router['get'](_0x7bd8('0x11'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x12')]);router[_0x7bd8('0x13')]('/',auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x14')]);router[_0x7bd8('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x7bd8('0x13')]('/:id/tags',auth[_0x7bd8('0xb')](),interaction[_0x7bd8('0x15')](_0x7bd8('0x16'),'openchannelinteraction:addtags'),controller[_0x7bd8('0x17')]);router[_0x7bd8('0x18')](_0x7bd8('0xe'),auth[_0x7bd8('0xb')](),interaction['tracked'](_0x7bd8('0x16'),'openchannelinteraction:update'),controller[_0x7bd8('0x19')]);router['delete'](_0x7bd8('0xe'),auth[_0x7bd8('0xb')](),interaction['tracked'](_0x7bd8('0x16'),_0x7bd8('0x1a')),controller['destroy']);router[_0x7bd8('0x1b')](_0x7bd8('0x1c'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x1d')]);module[_0x7bd8('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 50ea6e3..de82058 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 _0xbecf=['BOOLEAN','DATE','STRING','out','ENUM','INTEGER'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0xbecf,0x15c));var _0xfbec=function(_0x5e7f41,_0xd195ae){_0x5e7f41=_0x5e7f41-0x0;var _0x22b9b7=_0xbecf[_0x5e7f41];return _0x22b9b7;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xfbec('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfbec('0x1')]},'disposition':{'type':Sequelize[_0xfbec('0x2')]},'secondDisposition':{'type':Sequelize[_0xfbec('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfbec('0x2')]},'read1stAt':{'type':Sequelize[_0xfbec('0x1')]},'threadId':{'type':Sequelize[_0xfbec('0x2')]},'externalUrl':{'type':Sequelize[_0xfbec('0x2')]},'lastMsgAt':{'type':Sequelize[_0xfbec('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfbec('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xfbec('0x4')]('in',_0xfbec('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfbec('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xfbec('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfbec('0x5')]}}; \ No newline at end of file +var _0x20df=['STRING','out','ENUM','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x273e8d,_0x36e9a7){var _0x269e77=function(_0x1439f5){while(--_0x1439f5){_0x273e8d['push'](_0x273e8d['shift']());}};_0x269e77(++_0x36e9a7);}(_0x20df,0x7c));var _0xf20d=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x20df[_0x267c52];return _0x46c47b;};'use strict';var Sequelize=require(_0xf20d('0x0'));module[_0xf20d('0x1')]={'closed':{'type':Sequelize[_0xf20d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf20d('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf20d('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf20d('0x4')]},'note':{'type':Sequelize[_0xf20d('0x4')]},'read1stAt':{'type':Sequelize[_0xf20d('0x3')]},'threadId':{'type':Sequelize[_0xf20d('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xf20d('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf20d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xf20d('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf20d('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf20d('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index d1af708..db677c9 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 _0x7430=['offset','undefined','limit','Content-Range','update','then','destroy','error','name','send','index','map','OpenchannelInteraction','rawAttributes','type','getOptions','findAll','openchannel','query','user','catch','from','params','model','keys','intersection','fields','attributes','length','include','merge','options','create','body','find','describe','OpenchannelMessage','addMessage','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','includeAll','rows','addTags','setTags','ids','spread','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','server','root','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','read','OpenchannelAccount','Account','Owner','N.A.','closed','threadId','Public','Private','Messages','existsSync','pipe','System','basename','out','secret','renderFile','downloadInteraction.ejs','transcript-','Openchannel','rimraf','zip-dir','moment','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json'];(function(_0x13effd,_0x72361){var _0x2611df=function(_0x204e9b){while(--_0x204e9b){_0x13effd['push'](_0x13effd['shift']());}};_0x2611df(++_0x72361);}(_0x7430,0x155));var _0x0743=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7430[_0x502c7d];return _0x30b7ed;};'use strict';var rimraf=require(_0x0743('0x0'));var zipdir=require(_0x0743('0x1'));var moment=require(_0x0743('0x2'));var util=require(_0x0743('0x3'));var path=require(_0x0743('0x4'));var ejs=require(_0x0743('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x0743('0x6'));var qs=require(_0x0743('0x7'));var pdf=require(_0x0743('0x8'));var logger=require('../../config/logger')(_0x0743('0x9'));var config=require(_0x0743('0xa'));var db=require(_0x0743('0xb'))['db'];config[_0x0743('0xc')]=_[_0x0743('0xd')](config[_0x0743('0xc')],{'host':_0x0743('0xe'),'port':0x18eb});var socket=require(_0x0743('0xf'))(new Redis(config['redis']));require(_0x0743('0x10'))[_0x0743('0x11')](socket);function respondWithStatusCode(_0x434229,_0x232177){_0x232177=_0x232177||0xcc;return function(_0x3f22b1){if(_0x3f22b1){return _0x434229[_0x0743('0x12')](_0x232177);}return _0x434229[_0x0743('0x13')](_0x232177)[_0x0743('0x14')]();};}function respondWithResult(_0x509c9b,_0x2a1c9d){_0x2a1c9d=_0x2a1c9d||0xc8;return function(_0x10363a){if(_0x10363a){return _0x509c9b['status'](_0x2a1c9d)[_0x0743('0x15')](_0x10363a);}};}function respondWithFilteredResult(_0x27c124,_0x3a41e1){return function(_0x531694){if(_0x531694){var _0x413ef4=typeof _0x3a41e1[_0x0743('0x16')]===_0x0743('0x17')&&typeof _0x3a41e1[_0x0743('0x18')]==='undefined';var _0x1cb869=_0x531694['count'];var _0x3450ee=_0x413ef4?0x0:_0x3a41e1[_0x0743('0x16')];var _0x20e9d7=_0x413ef4?_0x531694['count']:_0x3a41e1[_0x0743('0x16')]+_0x3a41e1['limit'];var _0x432564;if(_0x20e9d7>=_0x1cb869){_0x20e9d7=_0x1cb869;_0x432564=0xc8;}else{_0x432564=0xce;}_0x27c124[_0x0743('0x13')](_0x432564);return _0x27c124['set'](_0x0743('0x19'),_0x3450ee+'-'+_0x20e9d7+'/'+_0x1cb869)[_0x0743('0x15')](_0x531694);}return null;};}function saveUpdates(_0x5c850d){return function(_0x4c33f4){if(_0x4c33f4){return _0x4c33f4[_0x0743('0x1a')](_0x5c850d)[_0x0743('0x1b')](function(_0x547265){return _0x547265;});}return null;};}function removeEntity(_0x5d7a81){return function(_0x126f18){if(_0x126f18){return _0x126f18[_0x0743('0x1c')]()[_0x0743('0x1b')](function(){_0x5d7a81[_0x0743('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6705d8){return function(_0x811c6d){if(!_0x811c6d){_0x6705d8[_0x0743('0x12')](0x194);}return _0x811c6d;};}function handleError(_0x16fc1a,_0x18236c){_0x18236c=_0x18236c||0x1f4;return function(_0x16badd){logger[_0x0743('0x1d')](_0x16badd['stack']);if(_0x16badd[_0x0743('0x1e')]){delete _0x16badd[_0x0743('0x1e')];}_0x16fc1a[_0x0743('0x13')](_0x18236c)[_0x0743('0x1f')](_0x16badd);};}exports[_0x0743('0x20')]=function(_0x387b8d,_0x30d23e){var _0x1501d2={};var _0xde8d41=_[_0x0743('0x21')](db[_0x0743('0x22')][_0x0743('0x23')],function(_0x255e67){return{'name':_0x255e67['fieldName'],'type':_0x255e67[_0x0743('0x24')]['key']};});_0x1501d2=qs[_0x0743('0x25')](_0xde8d41,_0x387b8d);return interaction[_0x0743('0x26')](_0x0743('0x27'),_0x387b8d[_0x0743('0x28')],_0x387b8d[_0x0743('0x29')],_0x1501d2,_0xde8d41)[_0x0743('0x1b')](respondWithFilteredResult(_0x30d23e,_0x1501d2))[_0x0743('0x2a')](handleError(_0x30d23e,null));};exports['show']=function(_0x3b5019,_0x290090){var _0x4717fe={};if(_0x3b5019[_0x0743('0x28')]['type']&&_0x3b5019[_0x0743('0x28')]['type']===_0x0743('0x2b')){_0x4717fe[_0x0743('0x2b')]=_0x3b5019[_0x0743('0x2c')]['id'];}else{_0x4717fe['id']=_0x3b5019[_0x0743('0x2c')]['id'];}var _0x28d7b0={'raw':![],'where':_0x4717fe},_0x3d76e4={};_0x3d76e4[_0x0743('0x2d')]=_[_0x0743('0x2e')](db[_0x0743('0x22')]['rawAttributes']);_0x3d76e4[_0x0743('0x28')]=_[_0x0743('0x2e')](_0x3b5019['query']);_0x3d76e4['filters']=_[_0x0743('0x2f')](_0x3d76e4['model'],_0x3d76e4[_0x0743('0x28')]);_0x28d7b0['attributes']=_[_0x0743('0x2f')](_0x3d76e4[_0x0743('0x2d')],qs[_0x0743('0x30')](_0x3b5019['query'][_0x0743('0x30')]));_0x28d7b0[_0x0743('0x31')]=_0x28d7b0[_0x0743('0x31')][_0x0743('0x32')]?_0x28d7b0[_0x0743('0x31')]:_0x3d76e4[_0x0743('0x2d')];if(_0x3b5019['query']['includeAll']){_0x28d7b0[_0x0743('0x33')]=[{'all':!![]}];}_0x28d7b0=_[_0x0743('0x34')]({},_0x28d7b0,_0x3b5019[_0x0743('0x35')]);return db[_0x0743('0x22')]['find'](_0x28d7b0)[_0x0743('0x1b')](handleEntityNotFound(_0x290090,null))[_0x0743('0x1b')](respondWithResult(_0x290090,null))[_0x0743('0x2a')](handleError(_0x290090,null));};exports['create']=function(_0xb469fc,_0x1a8386){return db['OpenchannelInteraction'][_0x0743('0x36')](_0xb469fc[_0x0743('0x37')],{})['then'](respondWithResult(_0x1a8386,0xc9))[_0x0743('0x2a')](handleError(_0x1a8386,null));};exports[_0x0743('0x1a')]=function(_0x1610f2,_0x3e446f){if(_0x1610f2['body']['id']){delete _0x1610f2[_0x0743('0x37')]['id'];}return db[_0x0743('0x22')]['find']({'where':{'id':_0x1610f2[_0x0743('0x2c')]['id']}})[_0x0743('0x1b')](handleEntityNotFound(_0x3e446f,null))['then'](saveUpdates(_0x1610f2[_0x0743('0x37')],null))[_0x0743('0x1b')](respondWithResult(_0x3e446f,null))['catch'](handleError(_0x3e446f,null));};exports[_0x0743('0x1c')]=function(_0x4aa021,_0x506e32){return db[_0x0743('0x22')][_0x0743('0x38')]({'where':{'id':_0x4aa021['params']['id']}})['then'](handleEntityNotFound(_0x506e32,null))[_0x0743('0x1b')](removeEntity(_0x506e32,null))['catch'](handleError(_0x506e32,null));};exports[_0x0743('0x39')]=function(_0x25d55c,_0x422579){return db[_0x0743('0x22')][_0x0743('0x39')]()[_0x0743('0x1b')](respondWithResult(_0x422579,null))[_0x0743('0x2a')](handleError(_0x422579,null));};exports['addMessage']=function(_0x36528c,_0x4ff5c8){return db[_0x0743('0x3a')][_0x0743('0x38')]({'where':{'id':_0x36528c[_0x0743('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4ff5c8,null))[_0x0743('0x1b')](function(_0x24c840){if(_0x24c840){return _0x24c840[_0x0743('0x3b')](_0x36528c['body']['ids'],_[_0x0743('0x3c')](_0x36528c[_0x0743('0x37')],['ids','id'])||{});}})[_0x0743('0x1b')](respondWithResult(_0x4ff5c8,null))['catch'](handleError(_0x4ff5c8,null));};exports[_0x0743('0x3d')]=function(_0xf51815,_0x1eb57a){var _0xeecbac={'raw':![],'where':{}};var _0x3c0f5d={};var _0x331b12={'count':0x0,'rows':[]};return db[_0x0743('0x22')][_0x0743('0x3e')]({'where':{'id':_0xf51815[_0x0743('0x2c')]['id']}})[_0x0743('0x1b')](handleEntityNotFound(_0x1eb57a,null))[_0x0743('0x1b')](function(_0x3ea178){if(_0x3ea178){_0x3c0f5d[_0x0743('0x2d')]=_[_0x0743('0x2e')](db[_0x0743('0x3a')][_0x0743('0x23')]);_0x3c0f5d[_0x0743('0x28')]=_['keys'](_0xf51815[_0x0743('0x28')]);_0x3c0f5d[_0x0743('0x3f')]=_[_0x0743('0x2f')](_0x3c0f5d[_0x0743('0x2d')],_0x3c0f5d['query']);_0xeecbac[_0x0743('0x31')]=_[_0x0743('0x2f')](_0x3c0f5d[_0x0743('0x2d')],qs[_0x0743('0x30')](_0xf51815[_0x0743('0x28')]['fields']));_0xeecbac[_0x0743('0x31')]=_0xeecbac[_0x0743('0x31')][_0x0743('0x32')]?_0xeecbac[_0x0743('0x31')]:_0x3c0f5d['model'];if(!_0xf51815[_0x0743('0x28')][_0x0743('0x40')](_0x0743('0x41'))){_0xeecbac[_0x0743('0x18')]=qs[_0x0743('0x18')](_0xf51815['query'][_0x0743('0x18')]);_0xeecbac['offset']=qs[_0x0743('0x16')](_0xf51815[_0x0743('0x28')][_0x0743('0x16')]);}_0xeecbac[_0x0743('0x42')]=qs['sort'](_0xf51815[_0x0743('0x28')]['sort']);_0xeecbac[_0x0743('0x43')]=qs[_0x0743('0x3f')](_['pick'](_0xf51815[_0x0743('0x28')],_0x3c0f5d[_0x0743('0x3f')]));_0xeecbac[_0x0743('0x43')]['OpenchannelInteractionId']=_0x3ea178['id'];if(_0xf51815[_0x0743('0x28')]['filter']){_0xeecbac[_0x0743('0x43')]=_[_0x0743('0x34')](_0xeecbac[_0x0743('0x43')],{'$or':_[_0x0743('0x21')](_0xeecbac[_0x0743('0x31')],function(_0x4875dd){var _0x3178e5={};_0x3178e5[_0x4875dd]={'$like':'%'+_0xf51815[_0x0743('0x28')][_0x0743('0x44')]+'%'};return _0x3178e5;})});}if(_0xf51815[_0x0743('0x28')][_0x0743('0x45')]){var _0x565ef2=_0xf51815[_0x0743('0x28')][_0x0743('0x45')][_0x0743('0x46')](',');var _0x5f0cb3={};_0x5f0cb3[_0x565ef2[0x0]]={'$gte':moment(_0x565ef2[0x1])[_0x0743('0x47')](_0x0743('0x48'))};_0xeecbac['where']=_[_0x0743('0x34')](_0xeecbac[_0x0743('0x43')],_0x5f0cb3);}_0xeecbac=_[_0x0743('0x34')]({},_0xeecbac,_0xf51815['options']);return db[_0x0743('0x3a')][_0x0743('0x49')]({'where':_0xeecbac[_0x0743('0x43')]})[_0x0743('0x1b')](function(_0x1eb410){_0x331b12[_0x0743('0x49')]=_0x1eb410;if(_0xf51815[_0x0743('0x28')][_0x0743('0x4a')]){_0xeecbac[_0x0743('0x33')]=[{'all':!![]}];}return db[_0x0743('0x3a')]['findAll'](_0xeecbac);})[_0x0743('0x1b')](function(_0xb69c0c){_0x331b12[_0x0743('0x4b')]=_0xb69c0c;return _0x331b12;});}})[_0x0743('0x1b')](respondWithFilteredResult(_0x1eb57a,_0xeecbac))[_0x0743('0x2a')](handleError(_0x1eb57a,null));};exports[_0x0743('0x4c')]=function(_0x495423,_0x29d88a){return db[_0x0743('0x22')][_0x0743('0x38')]({'where':{'id':_0x495423[_0x0743('0x2c')]['id']}})[_0x0743('0x1b')](handleEntityNotFound(_0x29d88a,null))['then'](function(_0x47ba7f){if(_0x47ba7f){return _0x47ba7f[_0x0743('0x4d')](_0x495423[_0x0743('0x37')]['ids'],_[_0x0743('0x3c')](_0x495423[_0x0743('0x37')],[_0x0743('0x4e'),'id'])||{})[_0x0743('0x4f')](function(){return db[_0x0743('0x50')][_0x0743('0x26')]({'attributes':['id',_0x0743('0x1e'),'color'],'where':{'id':_0x495423[_0x0743('0x37')][_0x0743('0x4e')]}});})[_0x0743('0x1b')](function(_0x1a804c){socket[_0x0743('0x51')](_0x0743('0x52'),{'id':Number(_0x495423['params']['id']),'tags':_0x1a804c||[]});return{'id':Number(_0x495423[_0x0743('0x2c')]['id']),'tags':_0x1a804c||[]};});}})[_0x0743('0x1b')](respondWithResult(_0x29d88a,null))[_0x0743('0x2a')](handleError(_0x29d88a,null));};exports[_0x0743('0x53')]=function(_0xc34c93,_0x11bf37){return db[_0x0743('0x22')][_0x0743('0x38')]({'where':{'id':_0xc34c93[_0x0743('0x2c')]['id']}})[_0x0743('0x1b')](handleEntityNotFound(_0x11bf37,null))['then'](function(_0x10ebe0){if(_0x10ebe0){return _0x10ebe0['removeTags'](_0xc34c93[_0x0743('0x28')]['ids']);}})[_0x0743('0x1b')](respondWithStatusCode(_0x11bf37,null))['catch'](handleError(_0x11bf37,null));};exports[_0x0743('0x54')]=function(_0x524526,_0xb79d52){var _0x176173=moment()[_0x0743('0x55')]()[_0x0743('0x56')]();var _0x570f88=path[_0x0743('0x57')](config['root'],_0x0743('0x58'),'files','tmp');var _0x450b21=path['join'](config[_0x0743('0x59')],'server','files',_0x0743('0x5a'));var _0x30cf67=path['join'](_0x570f88,_0x176173);var _0x483c0e=util[_0x0743('0x47')]('transcript-%d-%s.zip',_0x524526[_0x0743('0x2c')]['id'],_0x176173);var _0x367921=path[_0x0743('0x57')](_0x570f88,_0x483c0e);var _0x421e32=[];_0x421e32[_0x0743('0x5b')]({'model':db[_0x0743('0x5c')],'as':_0x0743('0x5c'),'attributes':['id',_0x0743('0x5d')],'raw':!![]});_0x421e32[_0x0743('0x5b')]({'model':db[_0x0743('0x5e')],'as':_0x0743('0x5f'),'attributes':['id',_0x0743('0x60'),_0x0743('0x61')],'raw':!![]});if(_0x524526[_0x0743('0x28')][_0x0743('0x5a')]){_0x421e32['push']({'model':db[_0x0743('0x62')],'as':_0x0743('0x62'),'raw':!![]});}var _0x440c83=[{'model':db[_0x0743('0x3a')],'as':'Messages','attributes':['id',_0x0743('0x37'),_0x0743('0x63'),_0x0743('0x64'),'secret',_0x0743('0x65')],'include':_0x421e32}];_0x440c83[_0x0743('0x5b')]({'model':db[_0x0743('0x66')],'as':_0x0743('0x67'),'attributes':['id','name']});_0x440c83['push']({'model':db[_0x0743('0x5c')],'as':_0x0743('0x68'),'attributes':['id',_0x0743('0x5d')]});return db[_0x0743('0x22')][_0x0743('0x38')]({'where':{'id':_0x524526[_0x0743('0x2c')]['id']},'include':_0x440c83})['then'](handleEntityNotFound(_0xb79d52,null))[_0x0743('0x1b')](function(_0xaab8bb){if(_0xaab8bb){var _0x324eec=_0xaab8bb['get']({'plain':!![]});fs['mkdirSync'](_0x30cf67);var _0x5d60b8={'channel':'Openchannel','account':_0x324eec[_0x0743('0x67')][_0x0743('0x1e')],'agent':_0x324eec['Owner']?_0x324eec[_0x0743('0x68')][_0x0743('0x5d')]:_0x0743('0x69'),'createdAt':moment(_0x324eec[_0x0743('0x63')])['format'](_0x0743('0x48'))[_0x0743('0x56')](),'closedAt':_0x324eec[_0x0743('0x6a')]?moment(_0x324eec['closedAt'])[_0x0743('0x47')](_0x0743('0x48'))[_0x0743('0x56')]():'','disposition':_0x324eec['disposition'],'visibility':_0x324eec[_0x0743('0x6b')]?_0x0743('0x6c'):_0x0743('0x6d'),'messages':_(_0x324eec[_0x0743('0x6e')])[_0x0743('0x44')]({'secret':![]})[_0x0743('0x21')](function(_0x207345){if(_0x207345[_0x0743('0x62')]){var _0x3812d4=path[_0x0743('0x57')](_0x450b21,_0x207345['Attachment']['basename']);if(fs[_0x0743('0x6f')](_0x3812d4)){fs['createReadStream'](_0x3812d4)[_0x0743('0x70')](fs['createWriteStream'](path[_0x0743('0x57')](_0x30cf67,_0x207345[_0x0743('0x62')]['basename'])));}}return{'date':moment(_0x207345[_0x0743('0x63')])[_0x0743('0x47')](_0x0743('0x48'))[_0x0743('0x56')](),'sender':_0x207345[_0x0743('0x64')]==='out'?_0x207345['User']?_0x207345['User'][_0x0743('0x5d')]:_0x0743('0x71'):_0x207345['Contact'][_0x0743('0x60')]+(_0x207345[_0x0743('0x5f')][_0x0743('0x61')]?'\x20'+_0x207345[_0x0743('0x5f')]['lastName']:''),'body':_0x207345[_0x0743('0x62')]?_0x207345['Attachment'][_0x0743('0x72')]:_0x207345[_0x0743('0x37')],'direction':_0x207345[_0x0743('0x64')]===_0x0743('0x73')?'A':'C','secret':_0x207345[_0x0743('0x74')],'read':_0x207345[_0x0743('0x65')],'attachment':_0x207345[_0x0743('0x62')]};})['value']()};return ejs[_0x0743('0x75')](path[_0x0743('0x57')](config['root'],'server','views',_0x0743('0x76')),{'interaction':_0x5d60b8})[_0x0743('0x1b')](function(_0xa6a4b1){var _0x469106=path[_0x0743('0x57')](_0x30cf67,_0x0743('0x77')+_0x324eec['id']+'-'+_0x176173+'.pdf');var _0xb1b7e1={'path':_0x469106,'channel':_0x0743('0x78'),'interactionId':_0x324eec['id']};return pdf['createPdfFromHTML'](_0xa6a4b1,_0xb1b7e1);})[_0x0743('0x1b')](function(){return new Promise(function(_0x26893,_0x2a242d){zipdir(_0x30cf67,{'saveTo':_0x367921},function(_0x370a15,_0x30473b){if(_0x370a15)return _0x2a242d(_0x370a15);return _0x26893(_0x30473b);});})[_0x0743('0x1b')](function(){return new Promise(function(_0x27c203,_0x517b74){rimraf(_0x30cf67,function(_0x58d562){if(_0x58d562)_0x517b74(_0x58d562);return _0x27c203();});});})[_0x0743('0x1b')](function(){return _0xb79d52[_0x0743('0x54')](_0x367921,_0x483c0e,function(_0x33efe9){if(_0x33efe9){logger[_0x0743('0x1d')]('Unable\x20to\x20delete\x20zip\x20file',_0x33efe9);}else{fs['unlinkSync'](_0x367921);}});});});}else{return _0xb79d52[_0x0743('0x12')](0xc8);}})[_0x0743('0x2a')](handleError(_0xb79d52,null));}; \ No newline at end of file +var _0x1598=['OpenchannelMessage','ids','omit','getMessages','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','format','findAll','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','direction','out','System','lastName','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','type','getOptions','query','from','params','keys','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','catch','body','describe','addMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1598,0x1c3));var _0x8159=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1598[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x8159('0x0'));var zipdir=require('zip-dir');var moment=require(_0x8159('0x1'));var util=require(_0x8159('0x2'));var path=require('path');var ejs=require(_0x8159('0x3'));var fs=require('fs');var _=require(_0x8159('0x4'));var Redis=require(_0x8159('0x5'));var interaction=require(_0x8159('0x6'));var qs=require(_0x8159('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x8159('0x8'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x8159('0x9')](config[_0x8159('0xa')],{'host':_0x8159('0xb'),'port':0x18eb});var socket=require(_0x8159('0xc'))(new Redis(config[_0x8159('0xa')]));require(_0x8159('0xd'))[_0x8159('0xe')](socket);function respondWithStatusCode(_0x5c0355,_0x4eddfc){_0x4eddfc=_0x4eddfc||0xcc;return function(_0x4a80ee){if(_0x4a80ee){return _0x5c0355['sendStatus'](_0x4eddfc);}return _0x5c0355[_0x8159('0xf')](_0x4eddfc)[_0x8159('0x10')]();};}function respondWithResult(_0x4cccca,_0x56fdb7){_0x56fdb7=_0x56fdb7||0xc8;return function(_0x33783b){if(_0x33783b){return _0x4cccca['status'](_0x56fdb7)['json'](_0x33783b);}};}function respondWithFilteredResult(_0x297fa3,_0x1db5df){return function(_0x3f8b8c){if(_0x3f8b8c){var _0x29dbe8=typeof _0x1db5df[_0x8159('0x11')]===_0x8159('0x12')&&typeof _0x1db5df[_0x8159('0x13')]===_0x8159('0x12');var _0x392583=_0x3f8b8c[_0x8159('0x14')];var _0x34471c=_0x29dbe8?0x0:_0x1db5df['offset'];var _0x311402=_0x29dbe8?_0x3f8b8c[_0x8159('0x14')]:_0x1db5df[_0x8159('0x11')]+_0x1db5df['limit'];var _0x406fa6;if(_0x311402>=_0x392583){_0x311402=_0x392583;_0x406fa6=0xc8;}else{_0x406fa6=0xce;}_0x297fa3[_0x8159('0xf')](_0x406fa6);return _0x297fa3[_0x8159('0x15')](_0x8159('0x16'),_0x34471c+'-'+_0x311402+'/'+_0x392583)[_0x8159('0x17')](_0x3f8b8c);}return null;};}function saveUpdates(_0x52f576){return function(_0x13cb0e){if(_0x13cb0e){return _0x13cb0e[_0x8159('0x18')](_0x52f576)[_0x8159('0x19')](function(_0x4bddb4){return _0x4bddb4;});}return null;};}function removeEntity(_0x578ccc){return function(_0x50b615){if(_0x50b615){return _0x50b615[_0x8159('0x1a')]()[_0x8159('0x19')](function(){_0x578ccc[_0x8159('0xf')](0xcc)[_0x8159('0x10')]();});}};}function handleEntityNotFound(_0x5abbf9){return function(_0x1e50b8){if(!_0x1e50b8){_0x5abbf9[_0x8159('0x1b')](0x194);}return _0x1e50b8;};}function handleError(_0x52f5e7,_0x26ea83){_0x26ea83=_0x26ea83||0x1f4;return function(_0x48cd72){logger[_0x8159('0x1c')](_0x48cd72[_0x8159('0x1d')]);if(_0x48cd72[_0x8159('0x1e')]){delete _0x48cd72[_0x8159('0x1e')];}_0x52f5e7['status'](_0x26ea83)[_0x8159('0x1f')](_0x48cd72);};}exports[_0x8159('0x20')]=function(_0x3f412a,_0x305614){var _0x113023={};var _0xe09666=_[_0x8159('0x21')](db[_0x8159('0x22')][_0x8159('0x23')],function(_0x5acd9f){return{'name':_0x5acd9f['fieldName'],'type':_0x5acd9f[_0x8159('0x24')]['key']};});_0x113023=qs[_0x8159('0x25')](_0xe09666,_0x3f412a);return interaction['findAll']('openchannel',_0x3f412a['query'],_0x3f412a['user'],_0x113023,_0xe09666)[_0x8159('0x19')](respondWithFilteredResult(_0x305614,_0x113023))['catch'](handleError(_0x305614,null));};exports['show']=function(_0x1ac088,_0x142d60){var _0x11efdc={};if(_0x1ac088[_0x8159('0x26')][_0x8159('0x24')]&&_0x1ac088[_0x8159('0x26')][_0x8159('0x24')]===_0x8159('0x27')){_0x11efdc[_0x8159('0x27')]=_0x1ac088[_0x8159('0x28')]['id'];}else{_0x11efdc['id']=_0x1ac088[_0x8159('0x28')]['id'];}var _0x72bf9e={'raw':![],'where':_0x11efdc},_0x429942={};_0x429942['model']=_[_0x8159('0x29')](db[_0x8159('0x22')][_0x8159('0x23')]);_0x429942[_0x8159('0x26')]=_[_0x8159('0x29')](_0x1ac088[_0x8159('0x26')]);_0x429942[_0x8159('0x2a')]=_[_0x8159('0x2b')](_0x429942['model'],_0x429942[_0x8159('0x26')]);_0x72bf9e[_0x8159('0x2c')]=_[_0x8159('0x2b')](_0x429942[_0x8159('0x2d')],qs['fields'](_0x1ac088[_0x8159('0x26')][_0x8159('0x2e')]));_0x72bf9e[_0x8159('0x2c')]=_0x72bf9e[_0x8159('0x2c')][_0x8159('0x2f')]?_0x72bf9e[_0x8159('0x2c')]:_0x429942['model'];if(_0x1ac088[_0x8159('0x26')][_0x8159('0x30')]){_0x72bf9e[_0x8159('0x31')]=[{'all':!![]}];}_0x72bf9e=_[_0x8159('0x32')]({},_0x72bf9e,_0x1ac088[_0x8159('0x33')]);return db[_0x8159('0x22')][_0x8159('0x34')](_0x72bf9e)[_0x8159('0x19')](handleEntityNotFound(_0x142d60,null))[_0x8159('0x19')](respondWithResult(_0x142d60,null))[_0x8159('0x35')](handleError(_0x142d60,null));};exports['create']=function(_0x3fcdac,_0x327333){return db[_0x8159('0x22')]['create'](_0x3fcdac[_0x8159('0x36')],{})[_0x8159('0x19')](respondWithResult(_0x327333,0xc9))[_0x8159('0x35')](handleError(_0x327333,null));};exports['update']=function(_0x4f1ae2,_0x4cbb9a){if(_0x4f1ae2['body']['id']){delete _0x4f1ae2[_0x8159('0x36')]['id'];}return db['OpenchannelInteraction'][_0x8159('0x34')]({'where':{'id':_0x4f1ae2[_0x8159('0x28')]['id']}})['then'](handleEntityNotFound(_0x4cbb9a,null))[_0x8159('0x19')](saveUpdates(_0x4f1ae2['body'],null))[_0x8159('0x19')](respondWithResult(_0x4cbb9a,null))[_0x8159('0x35')](handleError(_0x4cbb9a,null));};exports[_0x8159('0x1a')]=function(_0x13d97d,_0x680a32){return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x13d97d[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x680a32,null))['then'](removeEntity(_0x680a32,null))['catch'](handleError(_0x680a32,null));};exports['describe']=function(_0x2f6053,_0xc5a13f){return db[_0x8159('0x22')][_0x8159('0x37')]()[_0x8159('0x19')](respondWithResult(_0xc5a13f,null))[_0x8159('0x35')](handleError(_0xc5a13f,null));};exports[_0x8159('0x38')]=function(_0x4fd894,_0x268760){return db[_0x8159('0x39')]['find']({'where':{'id':_0x4fd894[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x268760,null))[_0x8159('0x19')](function(_0x54b6f8){if(_0x54b6f8){return _0x54b6f8['addMessage'](_0x4fd894[_0x8159('0x36')][_0x8159('0x3a')],_[_0x8159('0x3b')](_0x4fd894['body'],[_0x8159('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x268760,null))[_0x8159('0x35')](handleError(_0x268760,null));};exports[_0x8159('0x3c')]=function(_0x3d9d9d,_0x3b40b5){var _0x9e67ae={'raw':![],'where':{}};var _0x311d02={};var _0x1bb64e={'count':0x0,'rows':[]};return db[_0x8159('0x22')]['findOne']({'where':{'id':_0x3d9d9d[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x3b40b5,null))['then'](function(_0x5725be){if(_0x5725be){_0x311d02['model']=_['keys'](db[_0x8159('0x39')][_0x8159('0x23')]);_0x311d02[_0x8159('0x26')]=_[_0x8159('0x29')](_0x3d9d9d[_0x8159('0x26')]);_0x311d02[_0x8159('0x2a')]=_[_0x8159('0x2b')](_0x311d02[_0x8159('0x2d')],_0x311d02[_0x8159('0x26')]);_0x9e67ae[_0x8159('0x2c')]=_['intersection'](_0x311d02['model'],qs[_0x8159('0x2e')](_0x3d9d9d[_0x8159('0x26')][_0x8159('0x2e')]));_0x9e67ae['attributes']=_0x9e67ae[_0x8159('0x2c')][_0x8159('0x2f')]?_0x9e67ae[_0x8159('0x2c')]:_0x311d02[_0x8159('0x2d')];if(!_0x3d9d9d['query']['hasOwnProperty'](_0x8159('0x3d'))){_0x9e67ae[_0x8159('0x13')]=qs[_0x8159('0x13')](_0x3d9d9d[_0x8159('0x26')][_0x8159('0x13')]);_0x9e67ae['offset']=qs['offset'](_0x3d9d9d['query'][_0x8159('0x11')]);}_0x9e67ae[_0x8159('0x3e')]=qs[_0x8159('0x3f')](_0x3d9d9d[_0x8159('0x26')][_0x8159('0x3f')]);_0x9e67ae[_0x8159('0x40')]=qs['filters'](_['pick'](_0x3d9d9d[_0x8159('0x26')],_0x311d02['filters']));_0x9e67ae[_0x8159('0x40')][_0x8159('0x41')]=_0x5725be['id'];if(_0x3d9d9d[_0x8159('0x26')][_0x8159('0x42')]){_0x9e67ae['where']=_[_0x8159('0x32')](_0x9e67ae[_0x8159('0x40')],{'$or':_[_0x8159('0x21')](_0x9e67ae['attributes'],function(_0x4b99c8){var _0x19c938={};_0x19c938[_0x4b99c8]={'$like':'%'+_0x3d9d9d['query'][_0x8159('0x42')]+'%'};return _0x19c938;})});}if(_0x3d9d9d['query'][_0x8159('0x43')]){var _0x469e0d=_0x3d9d9d[_0x8159('0x26')][_0x8159('0x43')][_0x8159('0x44')](',');var _0x42ca19={};_0x42ca19[_0x469e0d[0x0]]={'$gte':moment(_0x469e0d[0x1])[_0x8159('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9e67ae[_0x8159('0x40')]=_[_0x8159('0x32')](_0x9e67ae[_0x8159('0x40')],_0x42ca19);}_0x9e67ae=_[_0x8159('0x32')]({},_0x9e67ae,_0x3d9d9d['options']);return db[_0x8159('0x39')]['count']({'where':_0x9e67ae[_0x8159('0x40')]})['then'](function(_0x210bc1){_0x1bb64e[_0x8159('0x14')]=_0x210bc1;if(_0x3d9d9d[_0x8159('0x26')]['includeAll']){_0x9e67ae['include']=[{'all':!![]}];}return db[_0x8159('0x39')][_0x8159('0x46')](_0x9e67ae);})[_0x8159('0x19')](function(_0x22ea76){_0x1bb64e[_0x8159('0x47')]=_0x22ea76;return _0x1bb64e;});}})[_0x8159('0x19')](respondWithFilteredResult(_0x3b40b5,_0x9e67ae))[_0x8159('0x35')](handleError(_0x3b40b5,null));};exports[_0x8159('0x48')]=function(_0x3797b9,_0x33154b){return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x3797b9[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x33154b,null))[_0x8159('0x19')](function(_0x4d6c0a){if(_0x4d6c0a){return _0x4d6c0a[_0x8159('0x49')](_0x3797b9[_0x8159('0x36')]['ids'],_[_0x8159('0x3b')](_0x3797b9[_0x8159('0x36')],[_0x8159('0x3a'),'id'])||{})[_0x8159('0x4a')](function(){return db[_0x8159('0x4b')][_0x8159('0x46')]({'attributes':['id',_0x8159('0x1e'),_0x8159('0x4c')],'where':{'id':_0x3797b9[_0x8159('0x36')][_0x8159('0x3a')]}});})['then'](function(_0x388c23){socket[_0x8159('0x4d')](_0x8159('0x4e'),{'id':Number(_0x3797b9[_0x8159('0x28')]['id']),'tags':_0x388c23||[]});return{'id':Number(_0x3797b9[_0x8159('0x28')]['id']),'tags':_0x388c23||[]};});}})['then'](respondWithResult(_0x33154b,null))[_0x8159('0x35')](handleError(_0x33154b,null));};exports[_0x8159('0x4f')]=function(_0x1fd7fd,_0x41b97d){return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x1fd7fd[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x41b97d,null))[_0x8159('0x19')](function(_0x10cfd7){if(_0x10cfd7){return _0x10cfd7[_0x8159('0x4f')](_0x1fd7fd[_0x8159('0x26')][_0x8159('0x3a')]);}})[_0x8159('0x19')](respondWithStatusCode(_0x41b97d,null))[_0x8159('0x35')](handleError(_0x41b97d,null));};exports[_0x8159('0x50')]=function(_0x73c120,_0x3df6d2){var _0x1c1f06=moment()[_0x8159('0x51')]()[_0x8159('0x52')]();var _0x5bec06=path[_0x8159('0x53')](config[_0x8159('0x54')],_0x8159('0x55'),_0x8159('0x56'),'tmp');var _0x3cd6c3=path['join'](config[_0x8159('0x54')],_0x8159('0x55'),_0x8159('0x56'),_0x8159('0x57'));var _0x1fe18d=path['join'](_0x5bec06,_0x1c1f06);var _0x47641b=util[_0x8159('0x45')](_0x8159('0x58'),_0x73c120[_0x8159('0x28')]['id'],_0x1c1f06);var _0x444236=path[_0x8159('0x53')](_0x5bec06,_0x47641b);var _0xfc8bc8=[];_0xfc8bc8['push']({'model':db[_0x8159('0x59')],'as':_0x8159('0x59'),'attributes':['id',_0x8159('0x5a')],'raw':!![]});_0xfc8bc8[_0x8159('0x5b')]({'model':db[_0x8159('0x5c')],'as':_0x8159('0x5d'),'attributes':['id',_0x8159('0x5e'),'lastName'],'raw':!![]});if(_0x73c120[_0x8159('0x26')]['attachments']){_0xfc8bc8[_0x8159('0x5b')]({'model':db[_0x8159('0x5f')],'as':_0x8159('0x5f'),'raw':!![]});}var _0x19a709=[{'model':db[_0x8159('0x39')],'as':_0x8159('0x60'),'attributes':['id','body',_0x8159('0x61'),'direction',_0x8159('0x62'),_0x8159('0x63')],'include':_0xfc8bc8}];_0x19a709['push']({'model':db[_0x8159('0x64')],'as':_0x8159('0x65'),'attributes':['id',_0x8159('0x1e')]});_0x19a709[_0x8159('0x5b')]({'model':db[_0x8159('0x59')],'as':'Owner','attributes':['id',_0x8159('0x5a')]});return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x73c120[_0x8159('0x28')]['id']},'include':_0x19a709})['then'](handleEntityNotFound(_0x3df6d2,null))[_0x8159('0x19')](function(_0x1a7856){if(_0x1a7856){var _0x56dc09=_0x1a7856[_0x8159('0x66')]({'plain':!![]});fs['mkdirSync'](_0x1fe18d);var _0x10d8b={'channel':_0x8159('0x67'),'account':_0x56dc09[_0x8159('0x65')][_0x8159('0x1e')],'agent':_0x56dc09[_0x8159('0x68')]?_0x56dc09[_0x8159('0x68')][_0x8159('0x5a')]:_0x8159('0x69'),'createdAt':moment(_0x56dc09[_0x8159('0x61')])['format'](_0x8159('0x6a'))[_0x8159('0x52')](),'closedAt':_0x56dc09[_0x8159('0x6b')]?moment(_0x56dc09[_0x8159('0x6c')])[_0x8159('0x45')](_0x8159('0x6a'))[_0x8159('0x52')]():'','disposition':_0x56dc09['disposition'],'visibility':_0x56dc09[_0x8159('0x6d')]?_0x8159('0x6e'):_0x8159('0x6f'),'messages':_(_0x56dc09[_0x8159('0x60')])[_0x8159('0x42')]({'secret':![]})[_0x8159('0x21')](function(_0x558356){if(_0x558356['Attachment']){var _0x1081b8=path[_0x8159('0x53')](_0x3cd6c3,_0x558356[_0x8159('0x5f')][_0x8159('0x70')]);if(fs['existsSync'](_0x1081b8)){fs[_0x8159('0x71')](_0x1081b8)[_0x8159('0x72')](fs[_0x8159('0x73')](path[_0x8159('0x53')](_0x1fe18d,_0x558356[_0x8159('0x5f')][_0x8159('0x70')])));}}return{'date':moment(_0x558356['createdAt'])[_0x8159('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8159('0x52')](),'sender':_0x558356[_0x8159('0x74')]===_0x8159('0x75')?_0x558356[_0x8159('0x59')]?_0x558356['User']['fullname']:_0x8159('0x76'):_0x558356[_0x8159('0x5d')]['firstName']+(_0x558356[_0x8159('0x5d')]['lastName']?'\x20'+_0x558356[_0x8159('0x5d')][_0x8159('0x77')]:''),'body':_0x558356[_0x8159('0x5f')]?_0x558356[_0x8159('0x5f')][_0x8159('0x70')]:_0x558356['body'],'direction':_0x558356[_0x8159('0x74')]===_0x8159('0x75')?'A':'C','secret':_0x558356['secret'],'read':_0x558356[_0x8159('0x63')],'attachment':_0x558356[_0x8159('0x5f')]};})[_0x8159('0x78')]()};return ejs[_0x8159('0x79')](path[_0x8159('0x53')](config['root'],_0x8159('0x55'),_0x8159('0x7a'),'downloadInteraction.ejs'),{'interaction':_0x10d8b})[_0x8159('0x19')](function(_0x36b605){var _0x5701d7=path[_0x8159('0x53')](_0x1fe18d,_0x8159('0x7b')+_0x56dc09['id']+'-'+_0x1c1f06+_0x8159('0x7c'));var _0x5ccff7={'path':_0x5701d7,'channel':'Openchannel','interactionId':_0x56dc09['id']};return pdf[_0x8159('0x7d')](_0x36b605,_0x5ccff7);})['then'](function(){return new Promise(function(_0x35f640,_0x1cd835){zipdir(_0x1fe18d,{'saveTo':_0x444236},function(_0x175760,_0x31dacf){if(_0x175760)return _0x1cd835(_0x175760);return _0x35f640(_0x31dacf);});})[_0x8159('0x19')](function(){return new Promise(function(_0x47ab1c,_0x2fa54c){rimraf(_0x1fe18d,function(_0x3962c0){if(_0x3962c0)_0x2fa54c(_0x3962c0);return _0x47ab1c();});});})[_0x8159('0x19')](function(){return _0x3df6d2[_0x8159('0x50')](_0x444236,_0x47641b,function(_0x2824e1){if(_0x2824e1){logger[_0x8159('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x2824e1);}else{fs[_0x8159('0x7e')](_0x444236);}});});});}else{return _0x3df6d2[_0x8159('0x1b')](0xc8);}})[_0x8159('0x35')](handleError(_0x3df6d2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 7cb3011..fd06ebb 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 _0x0ce5=['length','emit','catch','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove','then','Users','map','findAll','setDataValue','unreadMessages'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0ce5,0x115));var _0x50ce=function(_0x2ecbfd,_0x5bacbc){_0x2ecbfd=_0x2ecbfd-0x0;var _0x2c65a2=_0x0ce5[_0x2ecbfd];return _0x2c65a2;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x50ce('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x50ce('0x1')](0x0);var events={'afterCreate':_0x50ce('0x2'),'afterUpdate':_0x50ce('0x3'),'afterDestroy':_0x50ce('0x4')};function emitEvent(_0x264082){return function(_0x4b9a4c,_0xe5e90,_0x3eba77){_0x4b9a4c['getUsers']({'attributes':['id'],'raw':!![]})[_0x50ce('0x5')](function(_0x3749cd){_0x4b9a4c['setDataValue'](_0x50ce('0x6'),_0x3749cd[_0x50ce('0x7')](function(_0x368719){return{'id':_0x368719['id']};}));return OpenchannelMessage[_0x50ce('0x8')]({'where':{'OpenchannelInteractionId':_0x4b9a4c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x50ce('0x5')](function(_0x4df983){_0x4b9a4c[_0x50ce('0x9')](_0x50ce('0xa'),_0x4df983[_0x50ce('0xb')]);OpenchannelInteractionEvents['emit'](_0x264082+':'+_0x4b9a4c['id'],_0x4b9a4c);OpenchannelInteractionEvents[_0x50ce('0xc')](_0x264082,_0x4b9a4c);_0x3eba77(null);})[_0x50ce('0xd')](_0x3eba77(null));};}for(var e in events){if(events[_0x50ce('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x50ce('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x39ed=['unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map'];(function(_0x4c2006,_0x398e61){var _0x4a37da=function(_0x4632c8){while(--_0x4632c8){_0x4c2006['push'](_0x4c2006['shift']());}};_0x4a37da(++_0x398e61);}(_0x39ed,0x155));var _0xd39e=function(_0x24cfa6,_0x3933b6){_0x24cfa6=_0x24cfa6-0x0;var _0x3e89c6=_0x39ed[_0x24cfa6];return _0x3e89c6;};'use strict';var EventEmitter=require(_0xd39e('0x0'));var OpenchannelInteraction=require(_0xd39e('0x1'))['db'][_0xd39e('0x2')];var OpenchannelMessage=require(_0xd39e('0x1'))['db'][_0xd39e('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd39e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd39e('0x5')};function emitEvent(_0x23a554){return function(_0x388a51,_0x5151d7,_0x597f52){_0x388a51[_0xd39e('0x6')]({'attributes':['id'],'raw':!![]})[_0xd39e('0x7')](function(_0x2bdf39){_0x388a51[_0xd39e('0x8')](_0xd39e('0x9'),_0x2bdf39[_0xd39e('0xa')](function(_0x25125e){return{'id':_0x25125e['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x388a51['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd39e('0x7')](function(_0x596d5d){_0x388a51['setDataValue'](_0xd39e('0xb'),_0x596d5d['length']);OpenchannelInteractionEvents[_0xd39e('0xc')](_0x23a554+':'+_0x388a51['id'],_0x388a51);OpenchannelInteractionEvents[_0xd39e('0xc')](_0x23a554,_0x388a51);_0x597f52(null);})['catch'](_0x597f52(null));};}for(var e in events){if(events[_0xd39e('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xd39e('0xe')](e,emitEvent(event));}}module[_0xd39e('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 72f9cb8..5753ec2 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 _0x2302=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','path','rimraf','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4_unicode_ci'];(function(_0x38332c,_0x4c3176){var _0x3ada7b=function(_0x4d14b9){while(--_0x4d14b9){_0x38332c['push'](_0x38332c['shift']());}};_0x3ada7b(++_0x4c3176);}(_0x2302,0x11d));var _0x2230=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x2302[_0x383356];return _0x32ee5a;};'use strict';var _=require('lodash');var util=require(_0x2230('0x0'));var logger=require(_0x2230('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2230('0x2'));var rimraf=require(_0x2230('0x3'));var config=require('../../config/environment');var attributes=require(_0x2230('0x4'));module[_0x2230('0x5')]=function(_0x4bc647,_0x182515){return _0x4bc647[_0x2230('0x6')]('OpenchannelInteraction',attributes,{'tableName':_0x2230('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2230('0x8'),'hooks':{'beforeUpdate':function(_0x1cf2a0,_0x1c9e09,_0x4f7d04){if(_0x1cf2a0[_0x2230('0x9')](_0x2230('0xa'))){_0x1cf2a0[_0x2230('0xb')]=moment()[_0x2230('0xc')](_0x2230('0xd'));}_0x4f7d04(null,_0x1cf2a0);}}});}; \ No newline at end of file +var _0xa348=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x9a9370,_0x25cd69){var _0x1418af=function(_0x6bdf7d){while(--_0x6bdf7d){_0x9a9370['push'](_0x9a9370['shift']());}};_0x1418af(++_0x25cd69);}(_0xa348,0x79));var _0x8a34=function(_0x4d4320,_0x19b3c1){_0x4d4320=_0x4d4320-0x0;var _0x4642b2=_0xa348[_0x4d4320];return _0x4642b2;};'use strict';var _=require(_0x8a34('0x0'));var util=require(_0x8a34('0x1'));var logger=require('../../config/logger')(_0x8a34('0x2'));var moment=require('moment');var BPromise=require(_0x8a34('0x3'));var rp=require(_0x8a34('0x4'));var fs=require('fs');var path=require(_0x8a34('0x5'));var rimraf=require('rimraf');var config=require(_0x8a34('0x6'));var attributes=require(_0x8a34('0x7'));module[_0x8a34('0x8')]=function(_0x2822af,_0x5cc579){return _0x2822af[_0x8a34('0x9')](_0x8a34('0xa'),attributes,{'tableName':_0x8a34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a34('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x9f4962,_0x557d59,_0x54a0a4){if(_0x9f4962[_0x8a34('0xd')]('closed')){_0x9f4962['closedAt']=moment()[_0x8a34('0xe')](_0x8a34('0xf'));}_0x54a0a4(null,_0x9f4962);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e229b7b..4989783 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 _0x5106=['limit','then','debug','stringify','catch','AddTagsToOpenchannelInteraction','find','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x5106,0xed));var _0x6510=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5106[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6510('0x0'));var util=require(_0x6510('0x1'));var moment=require(_0x6510('0x2'));var BPromise=require(_0x6510('0x3'));var rs=require(_0x6510('0x4'));var fs=require('fs');var Redis=require(_0x6510('0x5'));var db=require(_0x6510('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6510('0x7'))('rpc');var config=require(_0x6510('0x8'));var jayson=require(_0x6510('0x9'));var client=jayson[_0x6510('0xa')][_0x6510('0xb')]({'port':0x232a});config[_0x6510('0xc')]=_[_0x6510('0xd')](config[_0x6510('0xc')],{'host':_0x6510('0xe'),'port':0x18eb});var socket=require(_0x6510('0xf'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x6510('0x10')](socket);function respondWithRpcPromise(_0x3b24ea,_0x5df6f6,_0x1cee4a){return new BPromise(function(_0x3b55ab,_0x367630){return client[_0x6510('0x11')](_0x3b24ea,_0x1cee4a)['then'](function(_0x5a1480){logger[_0x6510('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5df6f6,_0x6510('0x13'));logger['debug'](_0x6510('0x14'),_0x5df6f6,_0x6510('0x13'),JSON['stringify'](_0x5a1480));if(_0x5a1480[_0x6510('0x15')]){if(_0x5a1480[_0x6510('0x15')][_0x6510('0x16')]===0x1f4){logger[_0x6510('0x15')](_0x6510('0x17'),_0x5df6f6,_0x5a1480[_0x6510('0x15')][_0x6510('0x18')]);return _0x367630(_0x5a1480[_0x6510('0x15')][_0x6510('0x18')]);}logger[_0x6510('0x15')](_0x6510('0x17'),_0x5df6f6,_0x5a1480['error'][_0x6510('0x18')]);return _0x3b55ab(_0x5a1480[_0x6510('0x15')][_0x6510('0x18')]);}else{logger[_0x6510('0x12')](_0x6510('0x17'),_0x5df6f6,_0x6510('0x13'));_0x3b55ab(_0x5a1480[_0x6510('0x19')]['message']);}})['catch'](function(_0x2b6281){logger['error'](_0x6510('0x17'),_0x5df6f6,_0x2b6281);_0x367630(_0x2b6281);});});}exports[_0x6510('0x1a')]=function(_0x4e2cad){var _0x3b44e0=this;return new Promise(function(_0x38b8f9,_0x5b4161){return db[_0x6510('0x1b')][_0x6510('0x1c')](_0x4e2cad['body'],{'raw':_0x4e2cad['options']?_0x4e2cad[_0x6510('0x1d')][_0x6510('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e2cad[_0x6510('0x1d')]?_0x4e2cad['options'][_0x6510('0x1f')]||null:null,'attributes':_0x4e2cad[_0x6510('0x1d')]?_0x4e2cad['options'][_0x6510('0x20')]||null:null,'limit':_0x4e2cad['options']?_0x4e2cad['options'][_0x6510('0x21')]||null:null})[_0x6510('0x22')](function(_0x1874ff){logger[_0x6510('0x12')](_0x6510('0x1a'),_0x4e2cad);logger[_0x6510('0x23')](_0x6510('0x1a'),_0x4e2cad,JSON[_0x6510('0x24')](_0x1874ff));_0x38b8f9(_0x1874ff);})[_0x6510('0x25')](function(_0x492b2d){logger['error'](_0x6510('0x1a'),_0x492b2d['message'],_0x4e2cad);_0x5b4161(_0x3b44e0[_0x6510('0x15')](0x1f4,_0x492b2d['message']));});});};exports[_0x6510('0x26')]=function(_0x5087ae){return new Promise(function(_0x349e36,_0x410a3e){return db[_0x6510('0x1b')][_0x6510('0x27')]({'where':_0x5087ae[_0x6510('0x1d')]?_0x5087ae[_0x6510('0x1d')][_0x6510('0x1f')]||null:null})['then'](function(_0x557bb4){if(_0x557bb4){return _0x557bb4['addTags'](_0x5087ae[_0x6510('0x28')][_0x6510('0x29')],_[_0x6510('0x2a')](_0x5087ae[_0x6510('0x28')],[_0x6510('0x29'),'id'])||{});}})[_0x6510('0x2b')](function(_0x30759d){logger[_0x6510('0x12')](_0x6510('0x2c'),_0x5087ae);logger[_0x6510('0x23')]('AddTags',_0x5087ae,JSON[_0x6510('0x24')](_0x30759d));_0x349e36(_0x30759d);})[_0x6510('0x25')](function(_0x453810){logger[_0x6510('0x15')](_0x6510('0x2c'),_0x453810[_0x6510('0x18')],_0x5087ae);_0x410a3e(_this[_0x6510('0x15')](0x1f4,_0x453810[_0x6510('0x18')]));});});}; \ No newline at end of file +var _0x4a4c=['OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','limit','info','AddTagsToOpenchannelInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then'];(function(_0x42aabd,_0x217ade){var _0x2e83fb=function(_0x1508d8){while(--_0x1508d8){_0x42aabd['push'](_0x42aabd['shift']());}};_0x2e83fb(++_0x217ade);}(_0x4a4c,0x1e4));var _0xc4a4=function(_0x251664,_0x59f13d){_0x251664=_0x251664-0x0;var _0x449eb9=_0x4a4c[_0x251664];return _0x449eb9;};'use strict';var _=require(_0xc4a4('0x0'));var util=require(_0xc4a4('0x1'));var moment=require(_0xc4a4('0x2'));var BPromise=require(_0xc4a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4a4('0x4'));var db=require(_0xc4a4('0x5'))['db'];var utils=require(_0xc4a4('0x6'));var logger=require(_0xc4a4('0x7'))(_0xc4a4('0x8'));var config=require(_0xc4a4('0x9'));var jayson=require(_0xc4a4('0xa'));var client=jayson[_0xc4a4('0xb')][_0xc4a4('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc4a4('0xd')],{'host':_0xc4a4('0xe'),'port':0x18eb});var socket=require(_0xc4a4('0xf'))(new Redis(config[_0xc4a4('0xd')]));require(_0xc4a4('0x10'))[_0xc4a4('0x11')](socket);function respondWithRpcPromise(_0xf8c94a,_0x239d2f,_0x3d0c26){return new BPromise(function(_0x31934a,_0x432352){return client[_0xc4a4('0x12')](_0xf8c94a,_0x3d0c26)[_0xc4a4('0x13')](function(_0x47acd7){logger['info'](_0xc4a4('0x14'),_0x239d2f,_0xc4a4('0x15'));logger[_0xc4a4('0x16')](_0xc4a4('0x17'),_0x239d2f,_0xc4a4('0x15'),JSON[_0xc4a4('0x18')](_0x47acd7));if(_0x47acd7[_0xc4a4('0x19')]){if(_0x47acd7[_0xc4a4('0x19')]['code']===0x1f4){logger['error'](_0xc4a4('0x14'),_0x239d2f,_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);return _0x432352(_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);}logger[_0xc4a4('0x19')](_0xc4a4('0x14'),_0x239d2f,_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);return _0x31934a(_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x239d2f,'request\x20sent');_0x31934a(_0x47acd7['result'][_0xc4a4('0x1a')]);}})[_0xc4a4('0x1b')](function(_0x42ffc2){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x239d2f,_0x42ffc2);_0x432352(_0x42ffc2);});});}exports[_0xc4a4('0x1c')]=function(_0x2c20f5){var _0x1607b2=this;return new Promise(function(_0x20edb9,_0x5a4e03){return db[_0xc4a4('0x1d')]['update'](_0x2c20f5['body'],{'raw':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5['options'][_0xc4a4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5['options'][_0xc4a4('0x20')]||null:null,'attributes':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5['options']['attributes']||null:null,'limit':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5[_0xc4a4('0x1e')][_0xc4a4('0x21')]||null:null})[_0xc4a4('0x13')](function(_0x338eaf){logger[_0xc4a4('0x22')](_0xc4a4('0x1c'),_0x2c20f5);logger[_0xc4a4('0x16')](_0xc4a4('0x1c'),_0x2c20f5,JSON[_0xc4a4('0x18')](_0x338eaf));_0x20edb9(_0x338eaf);})['catch'](function(_0x10107d){logger[_0xc4a4('0x19')](_0xc4a4('0x1c'),_0x10107d['message'],_0x2c20f5);_0x5a4e03(_0x1607b2['error'](0x1f4,_0x10107d['message']));});});};exports[_0xc4a4('0x23')]=function(_0x43696d){return new Promise(function(_0x3ba0a0,_0x114f29){return db[_0xc4a4('0x1d')][_0xc4a4('0x24')]({'where':_0x43696d[_0xc4a4('0x1e')]?_0x43696d['options'][_0xc4a4('0x20')]||null:null})[_0xc4a4('0x13')](function(_0x295d20){if(_0x295d20){return _0x295d20[_0xc4a4('0x25')](_0x43696d[_0xc4a4('0x26')][_0xc4a4('0x27')],_['omit'](_0x43696d['body'],[_0xc4a4('0x27'),'id'])||{});}})[_0xc4a4('0x28')](function(_0x52cabd){logger['info'](_0xc4a4('0x29'),_0x43696d);logger[_0xc4a4('0x16')](_0xc4a4('0x29'),_0x43696d,JSON[_0xc4a4('0x18')](_0x52cabd));_0x3ba0a0(_0x52cabd);})[_0xc4a4('0x1b')](function(_0x4026fb){logger[_0xc4a4('0x19')](_0xc4a4('0x29'),_0x4026fb[_0xc4a4('0x1a')],_0x43696d);_0x114f29(_this['error'](0x1f4,_0x4026fb[_0xc4a4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 010738d..7313c56 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 _0x1121=['register','length','openchannelInteraction:','save','remove','update','emit'];(function(_0x5436ea,_0xa8d6f1){var _0x2c0c75=function(_0x2c4b36){while(--_0x2c4b36){_0x5436ea['push'](_0x5436ea['shift']());}};_0x2c0c75(++_0xa8d6f1);}(_0x1121,0x88));var _0x1112=function(_0x13eaff,_0x30aec3){_0x13eaff=_0x13eaff-0x0;var _0x1a729b=_0x1121[_0x13eaff];return _0x1a729b;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x1112('0x0'),_0x1112('0x1'),_0x1112('0x2')];function createListener(_0xfcad28,_0x403252){return function(_0x3f53f0){_0x403252[_0x1112('0x3')](_0xfcad28,_0x3f53f0);};}function removeListener(_0x2348b0,_0x55681c){return function(){OpenchannelInteractionEvents['removeListener'](_0x2348b0,_0x55681c);};}exports[_0x1112('0x4')]=function(_0x3a2b62){for(var _0x1927e5=0x0,_0x59bb72=events[_0x1112('0x5')];_0x1927e5<_0x59bb72;_0x1927e5++){var _0x4b3602=events[_0x1927e5];var _0x1840b1=createListener(_0x1112('0x6')+_0x4b3602,_0x3a2b62);OpenchannelInteractionEvents['on'](_0x4b3602,_0x1840b1);}}; \ No newline at end of file +var _0xa046=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xa046,0x1ec));var _0x6a04=function(_0x52758d,_0x622cbe){_0x52758d=_0x52758d-0x0;var _0x5f2a18=_0xa046[_0x52758d];return _0x5f2a18;};'use strict';var OpenchannelInteractionEvents=require(_0x6a04('0x0'));var events=[_0x6a04('0x1'),_0x6a04('0x2'),_0x6a04('0x3')];function createListener(_0x3af2fc,_0x2fab26){return function(_0x22e6af){_0x2fab26['emit'](_0x3af2fc,_0x22e6af);};}function removeListener(_0x7ce75,_0xb56434){return function(){OpenchannelInteractionEvents[_0x6a04('0x4')](_0x7ce75,_0xb56434);};}exports[_0x6a04('0x5')]=function(_0x14594c){for(var _0x2d948e=0x0,_0x35f302=events[_0x6a04('0x6')];_0x2d948e<_0x35f302;_0x2d948e++){var _0x11fd28=events[_0x2d948e];var _0x376afd=createListener(_0x6a04('0x7')+_0x11fd28,_0x14594c);OpenchannelInteractionEvents['on'](_0x11fd28,_0x376afd);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ae6f260..8d027c1 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x352580,_0x40db47){var _0x459385=function(_0x40b0ef){while(--_0x40b0ef){_0x352580['push'](_0x352580['shift']());}};_0x459385(++_0x40db47);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x2f269f,_0xaddcad){var _0x4f433b=function(_0x54a7fb){while(--_0x54a7fb){_0x2f269f['push'](_0x2f269f['shift']());}};_0x4f433b(++_0xaddcad);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f6f30,_0x31daaf){_0x1f6f30=_0x1f6f30-0x0;var _0x5bbe91=_0xedd9[_0x1f6f30];return _0x5bbe91;};'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['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 462013c..a1ad714 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 _0x4b17=['STRING','sequelize','TEXT','BOOLEAN','out'];(function(_0x212b80,_0x4054db){var _0x2a90f9=function(_0x3dbf02){while(--_0x3dbf02){_0x212b80['push'](_0x212b80['shift']());}};_0x2a90f9(++_0x4054db);}(_0x4b17,0x10f));var _0x74b1=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0x4b17[_0x547ff4];return _0xe41057;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'body':{'type':Sequelize[_0x74b1('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x74b1('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x74b1('0x4')]},'providerResponse':{'type':Sequelize[_0x74b1('0x1')]}}; \ No newline at end of file +var _0x867f=['ENUM','out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x187d72,_0xa3a82){var _0x3b3fea=function(_0x45ee56){while(--_0x45ee56){_0x187d72['push'](_0x187d72['shift']());}};_0x3b3fea(++_0xa3a82);}(_0x867f,0xdc));var _0xf867=function(_0x47024a,_0x2cc60a){_0x47024a=_0x47024a-0x0;var _0xc021b8=_0x867f[_0x47024a];return _0xc021b8;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'body':{'type':Sequelize[_0xf867('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf867('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf867('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf867('0x4')]('in','out'),'defaultValue':_0xf867('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xf867('0x6')]},'providerResponse':{'type':Sequelize[_0xf867('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 63cc6f6..bc0cb32 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 _0x4318=['QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','openchannel','RejectMessage','rejectMessage','sequelize','Sequelize','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','intersection','find','body','params','describe','openchannel-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0x1fd109,_0x15d6e1){var _0x2e4afe=function(_0x1bf7fe){while(--_0x1bf7fe){_0x1fd109['push'](_0x1fd109['shift']());}};_0x2e4afe(++_0x15d6e1);}(_0x4318,0x1a7));var _0x8431=function(_0x1e0132,_0x4badee){_0x1e0132=_0x1e0132-0x0;var _0x12e956=_0x4318[_0x1e0132];return _0x12e956;};'use strict';var emlformat=require(_0x8431('0x0'));var rimraf=require(_0x8431('0x1'));var zipdir=require(_0x8431('0x2'));var jsonpatch=require(_0x8431('0x3'));var rp=require(_0x8431('0x4'));var moment=require(_0x8431('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8431('0x6'));var util=require(_0x8431('0x7'));var path=require(_0x8431('0x8'));var sox=require('sox');var csv=require(_0x8431('0x9'));var ejs=require(_0x8431('0xa'));var fs=require('fs');var fs_extra=require(_0x8431('0xb'));var _=require(_0x8431('0xc'));var squel=require(_0x8431('0xd'));var crypto=require(_0x8431('0xe'));var jsforce=require(_0x8431('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8431('0x9'));var querystring=require(_0x8431('0x10'));var Papa=require(_0x8431('0x11'));var Redis=require(_0x8431('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8431('0x13'));var as=require(_0x8431('0x14'));var hardwareService=require(_0x8431('0x15'));var logger=require(_0x8431('0x16'))(_0x8431('0x17'));var utils=require(_0x8431('0x18'));var config=require(_0x8431('0x19'));var licenseUtil=require(_0x8431('0x1a'));var db=require(_0x8431('0x1b'))['db'];config['redis']=_[_0x8431('0x1c')](config[_0x8431('0x1d')],{'host':_0x8431('0x1e'),'port':0x18eb});var socket=require(_0x8431('0x1f'))(new Redis(config[_0x8431('0x1d')]));require('./openchannelMessage.socket')[_0x8431('0x20')](socket);var jayson=require(_0x8431('0x21'));var client=jayson[_0x8431('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x8431('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x231be9,_0x210e7c,_0x2ebc6d,_0x551b9b){return new BPromise(function(_0x1fa3c4,_0x21f15b){var _0x5c051b=_0x551b9b||client;return _0x5c051b['request'](_0x231be9,_0x2ebc6d)[_0x8431('0x23')](function(_0x41cbf5){logger['info'](_0x8431('0x24'),_0x210e7c,_0x8431('0x25'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x210e7c,_0x8431('0x25'),JSON['stringify'](_0x41cbf5));if(_0x41cbf5[_0x8431('0x26')]){if(_0x41cbf5[_0x8431('0x26')][_0x8431('0x27')]===0x1f4){logger['error'](_0x8431('0x24'),_0x210e7c,_0x41cbf5[_0x8431('0x26')][_0x8431('0x28')]);return _0x21f15b(_0x41cbf5[_0x8431('0x26')][_0x8431('0x28')]);}logger[_0x8431('0x26')](_0x8431('0x24'),_0x210e7c,_0x41cbf5['error'][_0x8431('0x28')]);return _0x1fa3c4(_0x41cbf5['error']['message']);}else{logger[_0x8431('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x210e7c,_0x8431('0x25'));_0x1fa3c4(_0x41cbf5[_0x8431('0x2a')]['message']);}})[_0x8431('0x2b')](function(_0x5e5d41){logger[_0x8431('0x26')](_0x8431('0x24'),_0x210e7c,_0x5e5d41);_0x21f15b(_0x5e5d41);});});}function respondWithStatusCode(_0x871f01,_0x1cabaa){_0x1cabaa=_0x1cabaa||0xcc;return function(_0xcc3008){if(_0xcc3008){return _0x871f01['sendStatus'](_0x1cabaa);}return _0x871f01['status'](_0x1cabaa)[_0x8431('0x2c')]();};}function respondWithResult(_0x27b22e,_0x4c6c15){_0x4c6c15=_0x4c6c15||0xc8;return function(_0x5c2ca3){if(_0x5c2ca3){return _0x27b22e[_0x8431('0x2d')](_0x4c6c15)['json'](_0x5c2ca3);}};}function respondWithFilteredResult(_0x4829a4,_0x208bf8){return function(_0x3b6c7d){if(_0x3b6c7d){var _0x381d71=typeof _0x208bf8[_0x8431('0x2e')]===_0x8431('0x2f')&&typeof _0x208bf8['limit']===_0x8431('0x2f');var _0x342f76=_0x3b6c7d['count'];var _0x5acff9=_0x381d71?0x0:_0x208bf8[_0x8431('0x2e')];var _0x492a95=_0x381d71?_0x3b6c7d[_0x8431('0x30')]:_0x208bf8[_0x8431('0x2e')]+_0x208bf8[_0x8431('0x31')];var _0x567fdf;if(_0x492a95>=_0x342f76){_0x492a95=_0x342f76;_0x567fdf=0xc8;}else{_0x567fdf=0xce;}_0x4829a4['status'](_0x567fdf);return _0x4829a4[_0x8431('0x32')](_0x8431('0x33'),_0x5acff9+'-'+_0x492a95+'/'+_0x342f76)[_0x8431('0x34')](_0x3b6c7d);}return null;};}function patchUpdates(_0x8b9051){return function(_0x19d446){try{jsonpatch[_0x8431('0x35')](_0x19d446,_0x8b9051,!![]);}catch(_0x54fec3){return BPromise['reject'](_0x54fec3);}return _0x19d446[_0x8431('0x36')]();};}function saveUpdates(_0x247567,_0x4f3c75){return function(_0x143c6a){if(_0x143c6a){return _0x143c6a[_0x8431('0x37')](_0x247567)[_0x8431('0x23')](function(_0x435db9){return _0x435db9;});}return null;};}function removeEntity(_0x186cbd,_0x124def){return function(_0xff4654){if(_0xff4654){return _0xff4654[_0x8431('0x38')]()['then'](function(){_0x186cbd[_0x8431('0x2d')](0xcc)[_0x8431('0x2c')]();});}};}function handleEntityNotFound(_0x9b4a3c,_0x30185f){return function(_0x3a1407){if(!_0x3a1407){_0x9b4a3c['sendStatus'](0x194);}return _0x3a1407;};}function handleError(_0x5f0972,_0x158379){_0x158379=_0x158379||0x1f4;return function(_0x136d75){logger[_0x8431('0x26')](_0x136d75[_0x8431('0x39')]);if(_0x136d75[_0x8431('0x3a')]){delete _0x136d75[_0x8431('0x3a')];}_0x5f0972['status'](_0x158379)[_0x8431('0x3b')](_0x136d75);};}exports[_0x8431('0x3c')]=function(_0x544b43,_0x5ba4f2){var _0x3f5589={},_0x16719e={},_0x2d2442={'count':0x0,'rows':[]};var _0x4559dd=_[_0x8431('0x3d')](db[_0x8431('0x3e')]['rawAttributes'],function(_0x41d10e){return{'name':_0x41d10e[_0x8431('0x3f')],'type':_0x41d10e[_0x8431('0x40')]['key']};});_0x16719e[_0x8431('0x41')]=_[_0x8431('0x3d')](_0x4559dd,_0x8431('0x3a'));_0x16719e[_0x8431('0x42')]=_[_0x8431('0x43')](_0x544b43[_0x8431('0x42')]);_0x16719e[_0x8431('0x44')]=_['intersection'](_0x16719e['model'],_0x16719e['query']);_0x3f5589[_0x8431('0x45')]=_['intersection'](_0x16719e['model'],qs[_0x8431('0x46')](_0x544b43['query'][_0x8431('0x46')]));_0x3f5589[_0x8431('0x45')]=_0x3f5589['attributes'][_0x8431('0x47')]?_0x3f5589['attributes']:_0x16719e[_0x8431('0x41')];if(!_0x544b43[_0x8431('0x42')][_0x8431('0x48')](_0x8431('0x49'))){_0x3f5589[_0x8431('0x31')]=qs[_0x8431('0x31')](_0x544b43[_0x8431('0x42')][_0x8431('0x31')]);_0x3f5589[_0x8431('0x2e')]=qs[_0x8431('0x2e')](_0x544b43[_0x8431('0x42')][_0x8431('0x2e')]);}_0x3f5589[_0x8431('0x4a')]=qs[_0x8431('0x4b')](_0x544b43[_0x8431('0x42')][_0x8431('0x4b')]);_0x3f5589[_0x8431('0x4c')]=qs[_0x8431('0x44')](_[_0x8431('0x4d')](_0x544b43[_0x8431('0x42')],_0x16719e[_0x8431('0x44')]),_0x4559dd);if(_0x544b43['query'][_0x8431('0x4e')]){_0x3f5589[_0x8431('0x4c')]=_[_0x8431('0x4f')](_0x3f5589[_0x8431('0x4c')],{'$or':_[_0x8431('0x3d')](_0x4559dd,function(_0x27cefa){if(_0x27cefa[_0x8431('0x40')]!==_0x8431('0x50')){var _0x103b3d={};_0x103b3d[_0x27cefa[_0x8431('0x3a')]]={'$like':'%'+_0x544b43[_0x8431('0x42')][_0x8431('0x4e')]+'%'};return _0x103b3d;}})});}_0x3f5589=_['merge']({},_0x3f5589,_0x544b43[_0x8431('0x51')]);var _0x3046b2={'where':_0x3f5589[_0x8431('0x4c')]};return db[_0x8431('0x3e')][_0x8431('0x30')](_0x3046b2)[_0x8431('0x23')](function(_0xa813f8){_0x2d2442[_0x8431('0x30')]=_0xa813f8;if(_0x544b43[_0x8431('0x42')][_0x8431('0x52')]){_0x3f5589[_0x8431('0x53')]=[{'all':!![]}];}return db[_0x8431('0x3e')][_0x8431('0x54')](_0x3f5589);})[_0x8431('0x23')](function(_0x1fc19b){_0x2d2442[_0x8431('0x55')]=_0x1fc19b;return _0x2d2442;})[_0x8431('0x23')](respondWithFilteredResult(_0x5ba4f2,_0x3f5589))[_0x8431('0x2b')](handleError(_0x5ba4f2,null));};exports[_0x8431('0x56')]=function(_0x3df380,_0x36ce75){var _0x4cb951={'raw':!![],'where':{'id':_0x3df380['params']['id']}},_0x13b683={};_0x13b683[_0x8431('0x41')]=_[_0x8431('0x43')](db[_0x8431('0x3e')][_0x8431('0x57')]);_0x13b683[_0x8431('0x42')]=_[_0x8431('0x43')](_0x3df380[_0x8431('0x42')]);_0x13b683[_0x8431('0x44')]=_[_0x8431('0x58')](_0x13b683[_0x8431('0x41')],_0x13b683[_0x8431('0x42')]);_0x4cb951['attributes']=_['intersection'](_0x13b683['model'],qs[_0x8431('0x46')](_0x3df380[_0x8431('0x42')][_0x8431('0x46')]));_0x4cb951[_0x8431('0x45')]=_0x4cb951[_0x8431('0x45')][_0x8431('0x47')]?_0x4cb951[_0x8431('0x45')]:_0x13b683[_0x8431('0x41')];if(_0x3df380[_0x8431('0x42')][_0x8431('0x52')]){_0x4cb951[_0x8431('0x53')]=[{'all':!![]}];}_0x4cb951=_[_0x8431('0x4f')]({},_0x4cb951,_0x3df380[_0x8431('0x51')]);return db[_0x8431('0x3e')][_0x8431('0x59')](_0x4cb951)[_0x8431('0x23')](handleEntityNotFound(_0x36ce75,null))[_0x8431('0x23')](respondWithResult(_0x36ce75,null))[_0x8431('0x2b')](handleError(_0x36ce75,null));};exports['create']=function(_0x1b7d3d,_0x3c0763){return db[_0x8431('0x3e')]['create'](_0x1b7d3d[_0x8431('0x5a')],{})['then'](respondWithResult(_0x3c0763,0xc9))['catch'](handleError(_0x3c0763,null));};exports[_0x8431('0x37')]=function(_0x274121,_0x412dd9){if(_0x274121[_0x8431('0x5a')]['id']){delete _0x274121[_0x8431('0x5a')]['id'];}return db[_0x8431('0x3e')]['find']({'where':{'id':_0x274121[_0x8431('0x5b')]['id']}})[_0x8431('0x23')](handleEntityNotFound(_0x412dd9,null))['then'](saveUpdates(_0x274121[_0x8431('0x5a')],null))[_0x8431('0x23')](respondWithResult(_0x412dd9,null))[_0x8431('0x2b')](handleError(_0x412dd9,null));};exports['destroy']=function(_0x49e8c9,_0x970a9b){return db['OpenchannelMessage'][_0x8431('0x59')]({'where':{'id':_0x49e8c9[_0x8431('0x5b')]['id']}})[_0x8431('0x23')](handleEntityNotFound(_0x970a9b,null))[_0x8431('0x23')](removeEntity(_0x970a9b,null))[_0x8431('0x2b')](handleError(_0x970a9b,null));};exports[_0x8431('0x5c')]=function(_0x4c6bbf,_0x291d06){return db[_0x8431('0x3e')][_0x8431('0x5c')]()['then'](respondWithResult(_0x291d06,null))['catch'](handleError(_0x291d06,null));};var interaction_log=require(_0x8431('0x16'))(_0x8431('0x5d'));exports['accept']=function(_0x56eac2,_0x71ed50,_0x4b2c85){var _0x53ab28={'agent':{},'channel':'openchannel'};if(_0x56eac2[_0x8431('0x5a')]['id']){delete _0x56eac2[_0x8431('0x5a')]['id'];}_0x56eac2['body'][_0x8431('0x5e')]=!![];_0x56eac2[_0x8431('0x5a')][_0x8431('0x5f')]=moment()[_0x8431('0x60')](_0x8431('0x61'));_0x56eac2['body'][_0x8431('0x62')]=_0x56eac2[_0x8431('0x5a')]['UserId']||_0x56eac2[_0x8431('0x63')]['id'];_0x53ab28[_0x8431('0x64')]['id']=_0x56eac2[_0x8431('0x5a')][_0x8431('0x62')];return db[_0x8431('0x3e')][_0x8431('0x59')]({'where':{'id':_0x56eac2[_0x8431('0x5b')]['id'],'UserId':null}})[_0x8431('0x23')](handleEntityNotFound(_0x71ed50,null))[_0x8431('0x23')](saveUpdates(_0x56eac2[_0x8431('0x5a')],null))[_0x8431('0x23')](function(_0x2a2399){if(_0x2a2399){_0x53ab28['message']=_0x2a2399[_0x8431('0x65')]({'plain':!![]});return db[_0x8431('0x66')][_0x8431('0x59')]({'where':{'id':_0x2a2399[_0x8431('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x71ed50,null))['then'](function(_0x1f8d47){if(_0x1f8d47){return _0x1f8d47[_0x8431('0x37')]({'UserId':_0x56eac2[_0x8431('0x5a')][_0x8431('0x62')],'read1stAt':_['isNil'](_0x1f8d47[_0x8431('0x68')])?moment()[_0x8431('0x60')](_0x8431('0x61')):undefined});}return null;})['then'](function(_0x2821bb){if(_0x2821bb){_0x53ab28[_0x8431('0x69')]=_0x2821bb[_0x8431('0x65')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x56eac2[_0x8431('0x63')]['id'],_0x56eac2[_0x8431('0x63')][_0x8431('0x3a')],_0x56eac2[_0x8431('0x63')][_0x8431('0x6a')],_0x53ab28[_0x8431('0x69')]['id'],_0x56eac2[_0x8431('0x5a')]?JSON[_0x8431('0x6b')](_0x56eac2[_0x8431('0x5a')]):_0x8431('0x6c'));return respondWithRpcPromise(_0x8431('0x6d'),_0x8431('0x6e'),_0x53ab28);}return null;})['then'](function(_0x3dda3f){var _0x4696b0=_0x8431('0x6f')+_0x3dda3f[_0x8431('0x28')][_0x8431('0x70')];return db['sequelize'][_0x8431('0x42')](_0x4696b0,{'type':db['Sequelize'][_0x8431('0x71')][_0x8431('0x72')],'raw':!![]})[_0x8431('0x23')](function(_0x32cb18){return _0x32cb18;});})[_0x8431('0x23')](function(_0x51fa5b){if(_0x51fa5b){_0x53ab28[_0x8431('0x28')]['contact']=_0x51fa5b[0x0];if(!_0x56eac2[_0x8431('0x5a')]['UserId'])return;return db['User'][_0x8431('0x59')]({'where':{'id':_0x56eac2[_0x8431('0x5a')][_0x8431('0x62')],'role':_0x8431('0x64')},'attributes':['id',_0x8431('0x3a'),_0x8431('0x73'),_0x8431('0x74'),_0x8431('0x75')],'raw':!![]});}return null;})['then'](function(_0x5c6968){if(!_0x5c6968)return null;_0x53ab28[_0x8431('0x28')]['agent']=_0x5c6968;return _0x53ab28;})[_0x8431('0x23')](function(_0x482ef7){if(_0x482ef7){if(_0x56eac2['body'][_0x8431('0x76')]){_0x53ab28[_0x8431('0x28')][_0x8431('0x77')]=util[_0x8431('0x60')](_0x8431('0x78'),_0x56eac2['user']['name']);_0x53ab28[_0x8431('0x28')][_0x8431('0x79')]=_0x53ab28['channel'];_0x53ab28[_0x8431('0x28')][_0x8431('0x7a')]=_0x53ab28[_0x8431('0x79')];_0x53ab28[_0x8431('0x28')][_0x8431('0x7b')]=_0x8431('0x7c');return respondWithRpcPromise(_0x8431('0x7d'),_0x8431('0x7d'),{'event':_0x8431('0x7e'),'message':_0x53ab28[_0x8431('0x28')]},client9002)[_0x8431('0x23')](function(){return _0x53ab28;});}return _0x53ab28;}return null;})[_0x8431('0x23')](respondWithResult(_0x71ed50,null))[_0x8431('0x2b')](handleError(_0x71ed50,null));};var interaction_log=require(_0x8431('0x16'))('openchannel-interactions');exports[_0x8431('0x7f')]=function(_0x1d2445,_0x102795,_0x16c449){var _0x2e8467={'agent':{},'channel':_0x8431('0x80')};if(_0x1d2445['body']['id']){delete _0x1d2445[_0x8431('0x5a')]['id'];}_0x1d2445['body'][_0x8431('0x62')]=_0x1d2445[_0x8431('0x5a')][_0x8431('0x62')]||_0x1d2445[_0x8431('0x63')]['id'];_0x2e8467[_0x8431('0x64')]['id']=_0x1d2445['body']['UserId'];return db[_0x8431('0x3e')]['find']({'where':{'id':_0x1d2445[_0x8431('0x5b')]['id'],'UserId':null}})[_0x8431('0x23')](handleEntityNotFound(_0x102795,null))[_0x8431('0x23')](function(_0x1a6841){if(_0x1a6841){_0x2e8467[_0x8431('0x28')]=_0x1a6841[_0x8431('0x65')]({'plain':!![]});return db[_0x8431('0x66')][_0x8431('0x59')]({'where':{'id':_0x1a6841['OpenchannelInteractionId']}});}return null;})[_0x8431('0x23')](handleEntityNotFound(_0x102795,null))['then'](function(_0x4964a6){if(_0x4964a6){_0x2e8467['interaction']=_0x4964a6[_0x8431('0x65')]({'plain':!![]});interaction_log[_0x8431('0x29')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d2445[_0x8431('0x63')]['id'],_0x1d2445[_0x8431('0x63')]['name'],_0x1d2445['user'][_0x8431('0x6a')],_0x2e8467[_0x8431('0x69')]['id'],_0x1d2445[_0x8431('0x5a')]?JSON[_0x8431('0x6b')](_0x1d2445[_0x8431('0x5a')]):_0x8431('0x6c'));return respondWithRpcPromise(_0x8431('0x81'),_0x8431('0x82'),_0x2e8467);}return null;})[_0x8431('0x23')](function(_0x437ca6){var _0x471418=_0x8431('0x6f')+_0x437ca6[_0x8431('0x28')][_0x8431('0x70')];return db[_0x8431('0x83')][_0x8431('0x42')](_0x471418,{'type':db[_0x8431('0x84')][_0x8431('0x71')][_0x8431('0x72')],'raw':!![]})[_0x8431('0x23')](function(_0x36cd99){return _0x36cd99;});})[_0x8431('0x23')](function(_0x3b70a3){if(_0x3b70a3){_0x2e8467['message']['contact']=_0x3b70a3[0x0];if(!_0x1d2445[_0x8431('0x5a')][_0x8431('0x62')])return;return db[_0x8431('0x85')][_0x8431('0x59')]({'where':{'id':_0x1d2445['body']['UserId'],'role':'agent'},'attributes':['id',_0x8431('0x3a'),_0x8431('0x73'),_0x8431('0x74'),_0x8431('0x75')],'raw':!![]});}return null;})[_0x8431('0x23')](function(_0x2b2654){if(!_0x2b2654)return null;_0x2e8467[_0x8431('0x28')]['agent']=_0x2b2654;return _0x2e8467;})[_0x8431('0x23')](function(_0x2a1ab5){if(_0x2a1ab5){_0x2a1ab5['message'][_0x8431('0x77')]=util['format']('SIP/%s',_0x1d2445[_0x8431('0x63')][_0x8431('0x3a')]);_0x2a1ab5[_0x8431('0x28')][_0x8431('0x79')]=_0x2e8467['channel'];_0x2a1ab5[_0x8431('0x28')][_0x8431('0x7a')]=_0x2e8467[_0x8431('0x79')];_0x2a1ab5[_0x8431('0x28')]['event']=_0x8431('0x7f');respondWithRpcPromise('EventManager',_0x8431('0x7d'),{'event':'rejectmessage','message':_0x2a1ab5['message']},client9002);return _0x2e8467;}return null;})[_0x8431('0x23')](respondWithResult(_0x102795,null))[_0x8431('0x2b')](handleError(_0x102795,null));}; \ No newline at end of file +var _0x1b50=['Sequelize','QueryTypes','SELECT','User','fullname','internal','interface','channel','motionChannel','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','contact','email','SIP/%s','event','EventManager','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','then','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','filter','options','count','include','findAll','rows','show','params','includeAll','find','body','update','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0x3240a1,_0xc43fb5){var _0x11f3d6=function(_0x2aaca2){while(--_0x2aaca2){_0x3240a1['push'](_0x3240a1['shift']());}};_0x11f3d6(++_0xc43fb5);}(_0x1b50,0x94));var _0x01b5=function(_0x370859,_0x350459){_0x370859=_0x370859-0x0;var _0x1d7dae=_0x1b50[_0x370859];return _0x1d7dae;};'use strict';var emlformat=require(_0x01b5('0x0'));var rimraf=require(_0x01b5('0x1'));var zipdir=require(_0x01b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x01b5('0x3'));var moment=require(_0x01b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x01b5('0x5'));var util=require(_0x01b5('0x6'));var path=require(_0x01b5('0x7'));var sox=require(_0x01b5('0x8'));var csv=require(_0x01b5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x01b5('0xa'));var crypto=require(_0x01b5('0xb'));var jsforce=require(_0x01b5('0xc'));var deskjs=require(_0x01b5('0xd'));var toCsv=require(_0x01b5('0x9'));var querystring=require(_0x01b5('0xe'));var Papa=require(_0x01b5('0xf'));var Redis=require(_0x01b5('0x10'));var authService=require(_0x01b5('0x11'));var qs=require(_0x01b5('0x12'));var as=require(_0x01b5('0x13'));var hardwareService=require(_0x01b5('0x14'));var logger=require('../../config/logger')(_0x01b5('0x15'));var utils=require(_0x01b5('0x16'));var config=require(_0x01b5('0x17'));var licenseUtil=require(_0x01b5('0x18'));var db=require(_0x01b5('0x19'))['db'];config[_0x01b5('0x1a')]=_[_0x01b5('0x1b')](config[_0x01b5('0x1a')],{'host':_0x01b5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01b5('0x1a')]));require(_0x01b5('0x1d'))['register'](socket);var jayson=require(_0x01b5('0x1e'));var client=jayson[_0x01b5('0x1f')][_0x01b5('0x20')]({'port':0x232c});var client9002=jayson[_0x01b5('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56562f,_0x347501,_0x4878a9,_0xcf3422){return new BPromise(function(_0x4518be,_0x1fe13b){var _0x553806=_0xcf3422||client;return _0x553806[_0x01b5('0x21')](_0x56562f,_0x4878a9)['then'](function(_0x4b03ae){logger[_0x01b5('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x01b5('0x23'));logger[_0x01b5('0x24')](_0x01b5('0x25'),_0x347501,'request\x20sent',JSON[_0x01b5('0x26')](_0x4b03ae));if(_0x4b03ae[_0x01b5('0x27')]){if(_0x4b03ae[_0x01b5('0x27')][_0x01b5('0x28')]===0x1f4){logger[_0x01b5('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x4b03ae['error']['message']);return _0x1fe13b(_0x4b03ae[_0x01b5('0x27')]['message']);}logger[_0x01b5('0x27')](_0x01b5('0x29'),_0x347501,_0x4b03ae[_0x01b5('0x27')][_0x01b5('0x2a')]);return _0x4518be(_0x4b03ae['error'][_0x01b5('0x2a')]);}else{logger[_0x01b5('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x01b5('0x23'));_0x4518be(_0x4b03ae['result']['message']);}})[_0x01b5('0x2b')](function(_0x17e9ec){logger[_0x01b5('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x17e9ec);_0x1fe13b(_0x17e9ec);});});}function respondWithStatusCode(_0x3a8045,_0x34c4ee){_0x34c4ee=_0x34c4ee||0xcc;return function(_0x4125de){if(_0x4125de){return _0x3a8045[_0x01b5('0x2c')](_0x34c4ee);}return _0x3a8045[_0x01b5('0x2d')](_0x34c4ee)[_0x01b5('0x2e')]();};}function respondWithResult(_0x8fbcff,_0x287b2f){_0x287b2f=_0x287b2f||0xc8;return function(_0x114005){if(_0x114005){return _0x8fbcff[_0x01b5('0x2d')](_0x287b2f)['json'](_0x114005);}};}function respondWithFilteredResult(_0xbf007,_0x3e8fa0){return function(_0x1e824e){if(_0x1e824e){var _0x9fdda2=typeof _0x3e8fa0[_0x01b5('0x2f')]===_0x01b5('0x30')&&typeof _0x3e8fa0[_0x01b5('0x31')]===_0x01b5('0x30');var _0xb682ff=_0x1e824e['count'];var _0x437e92=_0x9fdda2?0x0:_0x3e8fa0['offset'];var _0x3deb7b=_0x9fdda2?_0x1e824e['count']:_0x3e8fa0[_0x01b5('0x2f')]+_0x3e8fa0[_0x01b5('0x31')];var _0x3745f5;if(_0x3deb7b>=_0xb682ff){_0x3deb7b=_0xb682ff;_0x3745f5=0xc8;}else{_0x3745f5=0xce;}_0xbf007[_0x01b5('0x2d')](_0x3745f5);return _0xbf007[_0x01b5('0x32')]('Content-Range',_0x437e92+'-'+_0x3deb7b+'/'+_0xb682ff)[_0x01b5('0x33')](_0x1e824e);}return null;};}function patchUpdates(_0x28850c){return function(_0x168e36){try{jsonpatch[_0x01b5('0x34')](_0x168e36,_0x28850c,!![]);}catch(_0x23f1db){return BPromise[_0x01b5('0x35')](_0x23f1db);}return _0x168e36['save']();};}function saveUpdates(_0x46d808,_0x58a119){return function(_0x2cdbc4){if(_0x2cdbc4){return _0x2cdbc4['update'](_0x46d808)[_0x01b5('0x36')](function(_0x1a0dab){return _0x1a0dab;});}return null;};}function removeEntity(_0x89e2a5,_0x10f205){return function(_0x58a37e){if(_0x58a37e){return _0x58a37e['destroy']()[_0x01b5('0x36')](function(){_0x89e2a5[_0x01b5('0x2d')](0xcc)[_0x01b5('0x2e')]();});}};}function handleEntityNotFound(_0xeb4532,_0x2128c1){return function(_0x3012ea){if(!_0x3012ea){_0xeb4532[_0x01b5('0x2c')](0x194);}return _0x3012ea;};}function handleError(_0x1ef41e,_0x4cb73a){_0x4cb73a=_0x4cb73a||0x1f4;return function(_0x2fe29f){logger[_0x01b5('0x27')](_0x2fe29f[_0x01b5('0x37')]);if(_0x2fe29f['name']){delete _0x2fe29f[_0x01b5('0x38')];}_0x1ef41e[_0x01b5('0x2d')](_0x4cb73a)[_0x01b5('0x39')](_0x2fe29f);};}exports[_0x01b5('0x3a')]=function(_0x59f2a8,_0x2952c7){var _0x539f2e={},_0x2b1d46={},_0x265dda={'count':0x0,'rows':[]};var _0x26103f=_[_0x01b5('0x3b')](db[_0x01b5('0x3c')][_0x01b5('0x3d')],function(_0x529949){return{'name':_0x529949['fieldName'],'type':_0x529949[_0x01b5('0x3e')]['key']};});_0x2b1d46[_0x01b5('0x3f')]=_[_0x01b5('0x3b')](_0x26103f,_0x01b5('0x38'));_0x2b1d46[_0x01b5('0x40')]=_[_0x01b5('0x41')](_0x59f2a8[_0x01b5('0x40')]);_0x2b1d46[_0x01b5('0x42')]=_[_0x01b5('0x43')](_0x2b1d46[_0x01b5('0x3f')],_0x2b1d46[_0x01b5('0x40')]);_0x539f2e['attributes']=_[_0x01b5('0x43')](_0x2b1d46[_0x01b5('0x3f')],qs[_0x01b5('0x44')](_0x59f2a8[_0x01b5('0x40')]['fields']));_0x539f2e[_0x01b5('0x45')]=_0x539f2e[_0x01b5('0x45')][_0x01b5('0x46')]?_0x539f2e[_0x01b5('0x45')]:_0x2b1d46[_0x01b5('0x3f')];if(!_0x59f2a8['query']['hasOwnProperty'](_0x01b5('0x47'))){_0x539f2e['limit']=qs['limit'](_0x59f2a8[_0x01b5('0x40')]['limit']);_0x539f2e['offset']=qs[_0x01b5('0x2f')](_0x59f2a8[_0x01b5('0x40')][_0x01b5('0x2f')]);}_0x539f2e[_0x01b5('0x48')]=qs['sort'](_0x59f2a8[_0x01b5('0x40')]['sort']);_0x539f2e[_0x01b5('0x49')]=qs[_0x01b5('0x42')](_[_0x01b5('0x4a')](_0x59f2a8[_0x01b5('0x40')],_0x2b1d46[_0x01b5('0x42')]),_0x26103f);if(_0x59f2a8[_0x01b5('0x40')]['filter']){_0x539f2e[_0x01b5('0x49')]=_[_0x01b5('0x4b')](_0x539f2e['where'],{'$or':_[_0x01b5('0x3b')](_0x26103f,function(_0x13b389){if(_0x13b389[_0x01b5('0x3e')]!=='VIRTUAL'){var _0x4d5878={};_0x4d5878[_0x13b389[_0x01b5('0x38')]]={'$like':'%'+_0x59f2a8[_0x01b5('0x40')][_0x01b5('0x4c')]+'%'};return _0x4d5878;}})});}_0x539f2e=_['merge']({},_0x539f2e,_0x59f2a8[_0x01b5('0x4d')]);var _0x1ce947={'where':_0x539f2e[_0x01b5('0x49')]};return db['OpenchannelMessage']['count'](_0x1ce947)['then'](function(_0x19f0fb){_0x265dda[_0x01b5('0x4e')]=_0x19f0fb;if(_0x59f2a8[_0x01b5('0x40')]['includeAll']){_0x539f2e[_0x01b5('0x4f')]=[{'all':!![]}];}return db[_0x01b5('0x3c')][_0x01b5('0x50')](_0x539f2e);})['then'](function(_0x243739){_0x265dda[_0x01b5('0x51')]=_0x243739;return _0x265dda;})['then'](respondWithFilteredResult(_0x2952c7,_0x539f2e))['catch'](handleError(_0x2952c7,null));};exports[_0x01b5('0x52')]=function(_0x379611,_0x4964e9){var _0x333eb9={'raw':!![],'where':{'id':_0x379611[_0x01b5('0x53')]['id']}},_0x598991={};_0x598991['model']=_['keys'](db[_0x01b5('0x3c')][_0x01b5('0x3d')]);_0x598991[_0x01b5('0x40')]=_[_0x01b5('0x41')](_0x379611[_0x01b5('0x40')]);_0x598991[_0x01b5('0x42')]=_[_0x01b5('0x43')](_0x598991[_0x01b5('0x3f')],_0x598991[_0x01b5('0x40')]);_0x333eb9[_0x01b5('0x45')]=_[_0x01b5('0x43')](_0x598991[_0x01b5('0x3f')],qs[_0x01b5('0x44')](_0x379611[_0x01b5('0x40')]['fields']));_0x333eb9[_0x01b5('0x45')]=_0x333eb9[_0x01b5('0x45')]['length']?_0x333eb9[_0x01b5('0x45')]:_0x598991['model'];if(_0x379611[_0x01b5('0x40')][_0x01b5('0x54')]){_0x333eb9[_0x01b5('0x4f')]=[{'all':!![]}];}_0x333eb9=_[_0x01b5('0x4b')]({},_0x333eb9,_0x379611[_0x01b5('0x4d')]);return db[_0x01b5('0x3c')][_0x01b5('0x55')](_0x333eb9)[_0x01b5('0x36')](handleEntityNotFound(_0x4964e9,null))[_0x01b5('0x36')](respondWithResult(_0x4964e9,null))[_0x01b5('0x2b')](handleError(_0x4964e9,null));};exports['create']=function(_0x1c2050,_0x2f8fa8){return db[_0x01b5('0x3c')]['create'](_0x1c2050[_0x01b5('0x56')],{})[_0x01b5('0x36')](respondWithResult(_0x2f8fa8,0xc9))[_0x01b5('0x2b')](handleError(_0x2f8fa8,null));};exports[_0x01b5('0x57')]=function(_0x452d81,_0x4cfdf4){if(_0x452d81[_0x01b5('0x56')]['id']){delete _0x452d81[_0x01b5('0x56')]['id'];}return db[_0x01b5('0x3c')]['find']({'where':{'id':_0x452d81[_0x01b5('0x53')]['id']}})['then'](handleEntityNotFound(_0x4cfdf4,null))[_0x01b5('0x36')](saveUpdates(_0x452d81[_0x01b5('0x56')],null))[_0x01b5('0x36')](respondWithResult(_0x4cfdf4,null))[_0x01b5('0x2b')](handleError(_0x4cfdf4,null));};exports[_0x01b5('0x58')]=function(_0x7e9b9d,_0x48f9b8){return db[_0x01b5('0x3c')][_0x01b5('0x55')]({'where':{'id':_0x7e9b9d[_0x01b5('0x53')]['id']}})[_0x01b5('0x36')](handleEntityNotFound(_0x48f9b8,null))[_0x01b5('0x36')](removeEntity(_0x48f9b8,null))['catch'](handleError(_0x48f9b8,null));};exports['describe']=function(_0x1acad6,_0x5a4096){return db[_0x01b5('0x3c')][_0x01b5('0x59')]()[_0x01b5('0x36')](respondWithResult(_0x5a4096,null))[_0x01b5('0x2b')](handleError(_0x5a4096,null));};var interaction_log=require('../../config/logger')(_0x01b5('0x5a'));exports[_0x01b5('0x5b')]=function(_0x3a944e,_0x5d0475,_0x494fde){var _0x3a414c={'agent':{},'channel':_0x01b5('0x5c')};if(_0x3a944e[_0x01b5('0x56')]['id']){delete _0x3a944e['body']['id'];}_0x3a944e[_0x01b5('0x56')][_0x01b5('0x5d')]=!![];_0x3a944e[_0x01b5('0x56')][_0x01b5('0x5e')]=moment()[_0x01b5('0x5f')](_0x01b5('0x60'));_0x3a944e[_0x01b5('0x56')][_0x01b5('0x61')]=_0x3a944e[_0x01b5('0x56')][_0x01b5('0x61')]||_0x3a944e[_0x01b5('0x62')]['id'];_0x3a414c[_0x01b5('0x63')]['id']=_0x3a944e['body'][_0x01b5('0x61')];return db['OpenchannelMessage'][_0x01b5('0x55')]({'where':{'id':_0x3a944e[_0x01b5('0x53')]['id'],'UserId':null}})[_0x01b5('0x36')](handleEntityNotFound(_0x5d0475,null))['then'](saveUpdates(_0x3a944e[_0x01b5('0x56')],null))['then'](function(_0x24880c){if(_0x24880c){_0x3a414c[_0x01b5('0x2a')]=_0x24880c[_0x01b5('0x64')]({'plain':!![]});return db[_0x01b5('0x65')][_0x01b5('0x55')]({'where':{'id':_0x24880c[_0x01b5('0x66')]}});}return null;})[_0x01b5('0x36')](handleEntityNotFound(_0x5d0475,null))[_0x01b5('0x36')](function(_0x1da475){if(_0x1da475){return _0x1da475[_0x01b5('0x57')]({'UserId':_0x3a944e[_0x01b5('0x56')]['UserId'],'read1stAt':_[_0x01b5('0x67')](_0x1da475[_0x01b5('0x68')])?moment()[_0x01b5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x01b5('0x36')](function(_0x3206d4){if(_0x3206d4){_0x3a414c['interaction']=_0x3206d4[_0x01b5('0x64')]({'plain':!![]});interaction_log[_0x01b5('0x22')](_0x01b5('0x69'),_0x3a944e[_0x01b5('0x62')]['id'],_0x3a944e[_0x01b5('0x62')][_0x01b5('0x38')],_0x3a944e[_0x01b5('0x62')][_0x01b5('0x6a')],_0x3a414c[_0x01b5('0x6b')]['id'],_0x3a944e[_0x01b5('0x56')]?JSON[_0x01b5('0x26')](_0x3a944e[_0x01b5('0x56')]):'null');return respondWithRpcPromise(_0x01b5('0x6c'),_0x01b5('0x6d'),_0x3a414c);}return null;})['then'](function(_0x3b066a){var _0xf576bd=_0x01b5('0x6e')+_0x3b066a[_0x01b5('0x2a')][_0x01b5('0x6f')];return db['sequelize'][_0x01b5('0x40')](_0xf576bd,{'type':db[_0x01b5('0x70')][_0x01b5('0x71')][_0x01b5('0x72')],'raw':!![]})[_0x01b5('0x36')](function(_0x32fd68){return _0x32fd68;});})[_0x01b5('0x36')](function(_0x330f49){if(_0x330f49){_0x3a414c[_0x01b5('0x2a')]['contact']=_0x330f49[0x0];if(!_0x3a944e[_0x01b5('0x56')]['UserId'])return;return db[_0x01b5('0x73')]['find']({'where':{'id':_0x3a944e[_0x01b5('0x56')][_0x01b5('0x61')],'role':_0x01b5('0x63')},'attributes':['id','name',_0x01b5('0x74'),'email',_0x01b5('0x75')],'raw':!![]});}return null;})[_0x01b5('0x36')](function(_0xd06c7c){if(!_0xd06c7c)return null;_0x3a414c[_0x01b5('0x2a')][_0x01b5('0x63')]=_0xd06c7c;return _0x3a414c;})['then'](function(_0x2d492a){if(_0x2d492a){if(_0x3a944e[_0x01b5('0x56')]['manual']){_0x3a414c[_0x01b5('0x2a')][_0x01b5('0x76')]=util[_0x01b5('0x5f')]('SIP/%s',_0x3a944e[_0x01b5('0x62')][_0x01b5('0x38')]);_0x3a414c[_0x01b5('0x2a')][_0x01b5('0x77')]=_0x3a414c[_0x01b5('0x77')];_0x3a414c['message'][_0x01b5('0x78')]=_0x3a414c[_0x01b5('0x77')];_0x3a414c['message']['event']=_0x01b5('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x01b5('0x79'),'message':_0x3a414c[_0x01b5('0x2a')]},client9002)[_0x01b5('0x36')](function(){return _0x3a414c;});}return _0x3a414c;}return null;})[_0x01b5('0x36')](respondWithResult(_0x5d0475,null))[_0x01b5('0x2b')](handleError(_0x5d0475,null));};var interaction_log=require('../../config/logger')(_0x01b5('0x5a'));exports['reject']=function(_0x5cf6b9,_0x2c29c7,_0x10fa1a){var _0x14b414={'agent':{},'channel':_0x01b5('0x5c')};if(_0x5cf6b9['body']['id']){delete _0x5cf6b9['body']['id'];}_0x5cf6b9[_0x01b5('0x56')]['UserId']=_0x5cf6b9[_0x01b5('0x56')][_0x01b5('0x61')]||_0x5cf6b9['user']['id'];_0x14b414[_0x01b5('0x63')]['id']=_0x5cf6b9[_0x01b5('0x56')]['UserId'];return db[_0x01b5('0x3c')][_0x01b5('0x55')]({'where':{'id':_0x5cf6b9[_0x01b5('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2c29c7,null))[_0x01b5('0x36')](function(_0x43c194){if(_0x43c194){_0x14b414[_0x01b5('0x2a')]=_0x43c194[_0x01b5('0x64')]({'plain':!![]});return db[_0x01b5('0x65')]['find']({'where':{'id':_0x43c194[_0x01b5('0x66')]}});}return null;})[_0x01b5('0x36')](handleEntityNotFound(_0x2c29c7,null))['then'](function(_0x3bba0f){if(_0x3bba0f){_0x14b414[_0x01b5('0x6b')]=_0x3bba0f[_0x01b5('0x64')]({'plain':!![]});interaction_log[_0x01b5('0x22')](_0x01b5('0x7a'),_0x5cf6b9['user']['id'],_0x5cf6b9[_0x01b5('0x62')]['name'],_0x5cf6b9[_0x01b5('0x62')][_0x01b5('0x6a')],_0x14b414['interaction']['id'],_0x5cf6b9['body']?JSON[_0x01b5('0x26')](_0x5cf6b9['body']):_0x01b5('0x7b'));return respondWithRpcPromise(_0x01b5('0x7c'),'rejectMessage',_0x14b414);}return null;})[_0x01b5('0x36')](function(_0x5c4077){var _0x73a871=_0x01b5('0x6e')+_0x5c4077['message']['ContactId'];return db['sequelize']['query'](_0x73a871,{'type':db['Sequelize'][_0x01b5('0x71')][_0x01b5('0x72')],'raw':!![]})[_0x01b5('0x36')](function(_0x2ff2fa){return _0x2ff2fa;});})['then'](function(_0x324ac5){if(_0x324ac5){_0x14b414[_0x01b5('0x2a')][_0x01b5('0x7d')]=_0x324ac5[0x0];if(!_0x5cf6b9[_0x01b5('0x56')][_0x01b5('0x61')])return;return db[_0x01b5('0x73')][_0x01b5('0x55')]({'where':{'id':_0x5cf6b9[_0x01b5('0x56')][_0x01b5('0x61')],'role':'agent'},'attributes':['id',_0x01b5('0x38'),_0x01b5('0x74'),_0x01b5('0x7e'),_0x01b5('0x75')],'raw':!![]});}return null;})[_0x01b5('0x36')](function(_0x1b9cdb){if(!_0x1b9cdb)return null;_0x14b414[_0x01b5('0x2a')]['agent']=_0x1b9cdb;return _0x14b414;})[_0x01b5('0x36')](function(_0x29ddf1){if(_0x29ddf1){_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x76')]=util[_0x01b5('0x5f')](_0x01b5('0x7f'),_0x5cf6b9['user'][_0x01b5('0x38')]);_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x77')]=_0x14b414[_0x01b5('0x77')];_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x78')]=_0x14b414[_0x01b5('0x77')];_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x80')]=_0x01b5('0x35');respondWithRpcPromise(_0x01b5('0x81'),_0x01b5('0x81'),{'event':'rejectmessage','message':_0x29ddf1[_0x01b5('0x2a')]},client9002);return _0x14b414;}return null;})['then'](respondWithResult(_0x2c29c7,null))[_0x01b5('0x2b')](handleError(_0x2c29c7,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ddaff95..6398e7c 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 _0xcaab=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2638fa,_0x57bcc9){var _0x3978c8=function(_0x1b027b){while(--_0x1b027b){_0x2638fa['push'](_0x2638fa['shift']());}};_0x3978c8(++_0x57bcc9);}(_0xcaab,0xc0));var _0xbcaa=function(_0x106a7f,_0x1ab3bb){_0x106a7f=_0x106a7f-0x0;var _0x44d984=_0xcaab[_0x106a7f];return _0x44d984;};'use strict';var EventEmitter=require(_0xbcaa('0x0'));var OpenchannelMessage=require(_0xbcaa('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xbcaa('0x2')](0x0);var events={'afterCreate':_0xbcaa('0x3'),'afterUpdate':_0xbcaa('0x4'),'afterDestroy':_0xbcaa('0x5')};function emitEvent(_0x323630){return function(_0x59ee09,_0x558b64,_0x282c0e){OpenchannelMessageEvents[_0xbcaa('0x6')](_0x323630+':'+_0x59ee09['id'],_0x59ee09);OpenchannelMessageEvents['emit'](_0x323630,_0x59ee09);_0x282c0e(null);};}for(var e in events){if(events[_0xbcaa('0x7')](e)){var event=events[e];OpenchannelMessage[_0xbcaa('0x8')](e,emitEvent(event));}}module[_0xbcaa('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xe823=['update','remove','hook','exports','events','../../mysqldb','OpenchannelMessage','save'];(function(_0x547e09,_0x357128){var _0x250d75=function(_0x1a29a1){while(--_0x1a29a1){_0x547e09['push'](_0x547e09['shift']());}};_0x250d75(++_0x357128);}(_0xe823,0xc4));var _0x3e82=function(_0x1cbe1f,_0x2fa510){_0x1cbe1f=_0x1cbe1f-0x0;var _0x100179=_0xe823[_0x1cbe1f];return _0x100179;};'use strict';var EventEmitter=require(_0x3e82('0x0'));var OpenchannelMessage=require(_0x3e82('0x1'))['db'][_0x3e82('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e82('0x3'),'afterUpdate':_0x3e82('0x4'),'afterDestroy':_0x3e82('0x5')};function emitEvent(_0x2e7173){return function(_0x48259b,_0x5a62c8,_0x4fbb37){OpenchannelMessageEvents['emit'](_0x2e7173+':'+_0x48259b['id'],_0x48259b);OpenchannelMessageEvents['emit'](_0x2e7173,_0x48259b);_0x4fbb37(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x3e82('0x6')](e,emitEvent(event));}}module[_0x3e82('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 3439047..a1b08a9 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 _0x84a5=['info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','error','inspect','finally','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','toLowerCase','catch','OpenchannelAccount','find','Interactions','CmContact','Contact','replyUri'];(function(_0x16baef,_0x43ffd0){var _0x4cb852=function(_0x16eb03){while(--_0x16eb03){_0x16baef['push'](_0x16baef['shift']());}};_0x4cb852(++_0x43ffd0);}(_0x84a5,0xd4));var _0x584a=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x84a5[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x584a('0x0'));var util=require('util');var logger=require(_0x584a('0x1'))('api');var moment=require(_0x584a('0x2'));var BPromise=require('bluebird');var rp=require(_0x584a('0x3'));var fs=require('fs');var path=require(_0x584a('0x4'));var rimraf=require(_0x584a('0x5'));var config=require(_0x584a('0x6'));var attributes=require(_0x584a('0x7'));module[_0x584a('0x8')]=function(_0xd8b76,_0x2c8ca6){return _0xd8b76[_0x584a('0x9')](_0x584a('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x584a('0xb'),'fields':[_0x584a('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x371154,_0x222b47,_0x47bbae){var _0x1a9b36=_0xd8b76[_0x584a('0xd')];var _0xf60230=_0x371154[_0x584a('0xe')]({'plain':!![]});if(_0xf60230[_0x584a('0xf')]['toLowerCase']()==='in'||_0xf60230['direction']['toLowerCase']()===_0x584a('0x10')&&!_0xf60230[_0x584a('0x11')]&&!_[_0x584a('0x12')](_0xf60230[_0x584a('0x13')])){_0x1a9b36[_0x584a('0x14')][_0x584a('0x15')]({'where':{'id':_0xf60230[_0x584a('0x16')]}})[_0x584a('0x17')](function(_0x52df45){if(_0x52df45){_0x52df45[_0x584a('0x18')]({'lastMsgAt':_0xf60230['createdAt'],'lastMsgDirection':_0xf60230[_0x584a('0xf')][_0x584a('0x19')]()});}})[_0x584a('0x1a')](function(_0x131dee){console['error'](_0x131dee);});}if(_0xf60230[_0x584a('0xf')]===_0x584a('0x10')&&!_0xf60230[_0x584a('0x11')]){var _0x57acd7;_0x1a9b36['CmContact']['describe']()[_0x584a('0x17')](function(_0x5b5088){return _0x1a9b36[_0x584a('0x1b')][_0x584a('0x1c')]({'where':{'id':_0xf60230['OpenchannelAccountId']},'include':[{'model':_0x1a9b36[_0x584a('0x14')],'as':_0x584a('0x1d'),'where':{'id':_0xf60230[_0x584a('0x16')]},'limit':0x1,'include':[{'model':_0x1a9b36[_0x584a('0x1e')],'as':_0x584a('0x1f'),'attributes':_['keys'](_0x5b5088)}]}]});})[_0x584a('0x17')](function(_0x18758f){_0x57acd7=_0x18758f[_0x584a('0xe')]({'plain':!![]});if(_0x57acd7&&_0x57acd7[_0x584a('0x20')]){logger[_0x584a('0x21')](_0x584a('0x22'),_0x584a('0x23'),util['format'](_0x584a('0x24'),_0xf60230['id'],_0x57acd7[_0x584a('0x20')]));if(_0x57acd7['Interactions']&&_0x57acd7['Interactions'][_0x584a('0x25')]){_0xf60230['Interaction']=_[_0x584a('0x26')](_0x57acd7[_0x584a('0x1d')][0x0],_0x584a('0x1f'));_0xf60230[_0x584a('0x1f')]=_0x57acd7['Interactions'][0x0][_0x584a('0x1f')];}var _0x222b47={'method':_0x584a('0x27'),'uri':encodeURI(_0x57acd7[_0x584a('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x222b47[_0x584a('0x28')]){case _0x584a('0x29'):_0x222b47['qs']=_0xf60230;break;case'POST':_0x222b47['body']=_0xf60230;break;}return rp(_0x222b47)[_0x584a('0x17')](function(_0x460d3e){logger['info'](_0x584a('0x22'),'afterCreate',util[_0x584a('0x2a')](_0x584a('0x2b'),_0xf60230['id'],_0x57acd7[_0x584a('0x20')]));if(_0x460d3e[_0x584a('0xc')][_0x584a('0x2c')]&&_0x460d3e[_0x584a('0xc')][_0x584a('0x2c')]!=_0xf60230[_0x584a('0x2d')][_0x584a('0x2c')]){return _0x1a9b36[_0x584a('0x14')][_0x584a('0x18')]({'threadId':_0x460d3e[_0x584a('0xc')][_0x584a('0x2c')]},{'where':{'id':_0xf60230[_0x584a('0x2d')]['id']}});}else{return;}})[_0x584a('0x17')](function(){return _0x371154[_0x584a('0x18')]({'read':!![]});})[_0x584a('0x1a')](function(_0x586c09){logger[_0x584a('0x2e')](_0x584a('0x22'),_0x584a('0x23'),util[_0x584a('0x2f')](_0x586c09,{'showHidden':![],'depth':null}));_0x47bbae();});}else{_0x47bbae();}})[_0x584a('0x30')](function(){_0x47bbae();});}else{_0x47bbae();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf3f7=['replyUri','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','catch','error','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment','./openchannelMessage.attributes','define','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','CmContact','describe','then','OpenchannelAccount','Interactions','keys'];(function(_0x15dcf1,_0x326ff9){var _0x118008=function(_0x35b8b0){while(--_0x35b8b0){_0x15dcf1['push'](_0x15dcf1['shift']());}};_0x118008(++_0x326ff9);}(_0xf3f7,0x16a));var _0x7f3f=function(_0x491697,_0x206414){_0x491697=_0x491697-0x0;var _0x2ae2e8=_0xf3f7[_0x491697];return _0x2ae2e8;};'use strict';var _=require(_0x7f3f('0x0'));var util=require(_0x7f3f('0x1'));var logger=require(_0x7f3f('0x2'))('api');var moment=require(_0x7f3f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f3f('0x4'));var rimraf=require('rimraf');var config=require(_0x7f3f('0x5'));var attributes=require(_0x7f3f('0x6'));module['exports']=function(_0x5306d5,_0x2de776){return _0x5306d5[_0x7f3f('0x7')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x7f3f('0x8'),'fields':[_0x7f3f('0x9')],'type':_0x7f3f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31cbba,_0x3d45be,_0x41316f){var _0x1ce39c=_0x5306d5[_0x7f3f('0xb')];var _0x25b20d=_0x31cbba[_0x7f3f('0xc')]({'plain':!![]});if(_0x25b20d['direction'][_0x7f3f('0xd')]()==='in'||_0x25b20d[_0x7f3f('0xe')]['toLowerCase']()===_0x7f3f('0xf')&&!_0x25b20d[_0x7f3f('0x10')]&&!_[_0x7f3f('0x11')](_0x25b20d[_0x7f3f('0x12')])){_0x1ce39c[_0x7f3f('0x13')][_0x7f3f('0x14')]({'where':{'id':_0x25b20d[_0x7f3f('0x15')]}})['then'](function(_0x1c5205){if(_0x1c5205){_0x1c5205[_0x7f3f('0x16')]({'lastMsgAt':_0x25b20d[_0x7f3f('0x17')],'lastMsgDirection':_0x25b20d[_0x7f3f('0xe')][_0x7f3f('0xd')]()});}})['catch'](function(_0x1c4a58){console['error'](_0x1c4a58);});}if(_0x25b20d[_0x7f3f('0xe')]===_0x7f3f('0xf')&&!_0x25b20d['secret']){var _0x4b5d3e;_0x1ce39c[_0x7f3f('0x18')][_0x7f3f('0x19')]()[_0x7f3f('0x1a')](function(_0x366076){return _0x1ce39c[_0x7f3f('0x1b')]['find']({'where':{'id':_0x25b20d['OpenchannelAccountId']},'include':[{'model':_0x1ce39c[_0x7f3f('0x13')],'as':_0x7f3f('0x1c'),'where':{'id':_0x25b20d[_0x7f3f('0x15')]},'limit':0x1,'include':[{'model':_0x1ce39c[_0x7f3f('0x18')],'as':'Contact','attributes':_[_0x7f3f('0x1d')](_0x366076)}]}]});})['then'](function(_0x54f40d){_0x4b5d3e=_0x54f40d[_0x7f3f('0xc')]({'plain':!![]});if(_0x4b5d3e&&_0x4b5d3e[_0x7f3f('0x1e')]){logger[_0x7f3f('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x7f3f('0x20'),util['format'](_0x7f3f('0x21'),_0x25b20d['id'],_0x4b5d3e['replyUri']));if(_0x4b5d3e[_0x7f3f('0x1c')]&&_0x4b5d3e[_0x7f3f('0x1c')][_0x7f3f('0x22')]){_0x25b20d['Interaction']=_[_0x7f3f('0x23')](_0x4b5d3e['Interactions'][0x0],_0x7f3f('0x24'));_0x25b20d['Contact']=_0x4b5d3e[_0x7f3f('0x1c')][0x0][_0x7f3f('0x24')];}var _0x3d45be={'method':_0x7f3f('0x25'),'uri':encodeURI(_0x4b5d3e[_0x7f3f('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3d45be[_0x7f3f('0x26')]){case'GET':_0x3d45be['qs']=_0x25b20d;break;case _0x7f3f('0x25'):_0x3d45be['body']=_0x25b20d;break;}return rp(_0x3d45be)['then'](function(_0x2571fe){logger['info'](_0x7f3f('0x27'),'afterCreate',util[_0x7f3f('0x28')](_0x7f3f('0x29'),_0x25b20d['id'],_0x4b5d3e['replyUri']));if(_0x2571fe[_0x7f3f('0x9')][_0x7f3f('0x2a')]&&_0x2571fe[_0x7f3f('0x9')][_0x7f3f('0x2a')]!=_0x25b20d[_0x7f3f('0x2b')][_0x7f3f('0x2a')]){return _0x1ce39c[_0x7f3f('0x13')][_0x7f3f('0x16')]({'threadId':_0x2571fe[_0x7f3f('0x9')]['threadId']},{'where':{'id':_0x25b20d[_0x7f3f('0x2b')]['id']}});}else{return;}})[_0x7f3f('0x1a')](function(){return _0x31cbba['update']({'read':!![]});})[_0x7f3f('0x2c')](function(_0x11a62b){logger[_0x7f3f('0x2d')](_0x7f3f('0x27'),_0x7f3f('0x20'),util['inspect'](_0x11a62b,{'showHidden':![],'depth':null}));_0x41316f();});}else{_0x41316f();}})[_0x7f3f('0x2e')](function(){_0x41316f();});}else{_0x41316f();}}},'charset':_0x7f3f('0x2f'),'collate':_0x7f3f('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 8132613..0f5473d 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 _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x35e7f9,_0x384ace){var _0x491096=function(_0x4ff7e5){while(--_0x4ff7e5){_0x35e7f9['push'](_0x35e7f9['shift']());}};_0x491096(++_0x384ace);}(_0x5f2f,0x73));var _0xf5f2=function(_0x43644b,_0xeee395){_0x43644b=_0x43644b-0x0;var _0x46627c=_0x5f2f[_0x43644b];return _0x46627c;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +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(_0x3cafb8,_0x32860e){var _0x4b7f85=function(_0x31b11d){while(--_0x31b11d){_0x3cafb8['push'](_0x3cafb8['shift']());}};_0x4b7f85(++_0x32860e);}(_0x2ef3,0xba));var _0x32ef=function(_0x30963e,_0x548d55){_0x30963e=_0x30963e-0x0;var _0x184c64=_0x2ef3[_0x30963e];return _0x184c64;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ede77b5..d96ce29 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 _0x1c23=['update','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x1c23,0x1d5));var _0x31c2=function(_0x4dac5f,_0x34286c){_0x4dac5f=_0x4dac5f-0x0;var _0x31e2ce=_0x1c23[_0x4dac5f];return _0x31e2ce;};'use strict';var OpenchannelMessageEvents=require(_0x31c2('0x0'));var events=[_0x31c2('0x1'),_0x31c2('0x2'),_0x31c2('0x3')];function createListener(_0x97567,_0x10d5c0){return function(_0x4af174){_0x10d5c0[_0x31c2('0x4')](_0x97567,_0x4af174);};}function removeListener(_0x2da7ad,_0x55e8c3){return function(){OpenchannelMessageEvents[_0x31c2('0x5')](_0x2da7ad,_0x55e8c3);};}exports[_0x31c2('0x6')]=function(_0x12c3d3){for(var _0x21dbdc=0x0,_0x2ffcfb=events['length'];_0x21dbdc<_0x2ffcfb;_0x21dbdc++){var _0x3b8308=events[_0x21dbdc];var _0x2f98e5=createListener(_0x31c2('0x7')+_0x3b8308,_0x12c3d3);OpenchannelMessageEvents['on'](_0x3b8308,_0x2f98e5);}}; \ No newline at end of file +var _0x0e50=['removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit'];(function(_0x280ba3,_0x50076b){var _0x308074=function(_0x39221f){while(--_0x39221f){_0x280ba3['push'](_0x280ba3['shift']());}};_0x308074(++_0x50076b);}(_0x0e50,0x168));var _0x00e5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0e50[_0x4b055c];return _0x4b62bb;};'use strict';var OpenchannelMessageEvents=require(_0x00e5('0x0'));var events=[_0x00e5('0x1'),_0x00e5('0x2'),'update'];function createListener(_0x1b3523,_0xa345ef){return function(_0x4a0533){_0xa345ef[_0x00e5('0x3')](_0x1b3523,_0x4a0533);};}function removeListener(_0x3d2263,_0x4f38ad){return function(){OpenchannelMessageEvents[_0x00e5('0x4')](_0x3d2263,_0x4f38ad);};}exports['register']=function(_0x3efbe7){for(var _0xeb6242=0x0,_0x255aec=events[_0x00e5('0x5')];_0xeb6242<_0x255aec;_0xeb6242++){var _0x40b93e=events[_0xeb6242];var _0x4c91eb=createListener(_0x00e5('0x6')+_0x40b93e,_0x3efbe7);OpenchannelMessageEvents['on'](_0x40b93e,_0x4c91eb);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 76f4c3e..a01753e 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 _0xebf0=['getAgents','post','create','/:id/teams','addTeams','update','delete','destroy','removeTeams','removeAgents','multer','path','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','getMembers','getTeams','/:id/users'];(function(_0x1d1075,_0x37aa65){var _0x27c56a=function(_0x24c20a){while(--_0x24c20a){_0x1d1075['push'](_0x1d1075['shift']());}};_0x27c56a(++_0x37aa65);}(_0xebf0,0xb2));var _0x0ebf=function(_0x46c5f2,_0x1d3146){_0x46c5f2=_0x46c5f2-0x0;var _0x28c4eb=_0xebf0[_0x46c5f2];return _0x28c4eb;};'use strict';var multer=require(_0x0ebf('0x0'));var util=require('util');var path=require(_0x0ebf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0ebf('0x2')]();var fs_extra=require(_0x0ebf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0ebf('0x4'));var controller=require('./openchannelQueue.controller');router[_0x0ebf('0x5')]('/',auth['isAuthenticated'](),controller[_0x0ebf('0x6')]);router[_0x0ebf('0x5')](_0x0ebf('0x7'),auth[_0x0ebf('0x8')](),controller['describe']);router['get'](_0x0ebf('0x9'),auth['isAuthenticated'](),controller[_0x0ebf('0xa')]);router[_0x0ebf('0x5')]('/:id/members',auth[_0x0ebf('0x8')](),controller[_0x0ebf('0xb')]);router[_0x0ebf('0x5')]('/:id/teams',auth[_0x0ebf('0x8')](),controller[_0x0ebf('0xc')]);router[_0x0ebf('0x5')](_0x0ebf('0xd'),auth['isAuthenticated'](),controller[_0x0ebf('0xe')]);router[_0x0ebf('0xf')]('/',auth['isAuthenticated'](),controller[_0x0ebf('0x10')]);router[_0x0ebf('0xf')](_0x0ebf('0x11'),auth[_0x0ebf('0x8')](),controller[_0x0ebf('0x12')]);router['post']('/:id/users',auth[_0x0ebf('0x8')](),controller['addAgents']);router['put'](_0x0ebf('0x9'),auth['isAuthenticated'](),controller[_0x0ebf('0x13')]);router[_0x0ebf('0x14')](_0x0ebf('0x9'),auth[_0x0ebf('0x8')](),controller[_0x0ebf('0x15')]);router[_0x0ebf('0x14')]('/:id/teams',auth[_0x0ebf('0x8')](),controller[_0x0ebf('0x16')]);router['delete'](_0x0ebf('0xd'),auth[_0x0ebf('0x8')](),controller[_0x0ebf('0x17')]);module['exports']=router; \ No newline at end of file +var _0xb6b6=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers'];(function(_0x146b60,_0x549b45){var _0x57bab3=function(_0x3efd0c){while(--_0x3efd0c){_0x146b60['push'](_0x146b60['shift']());}};_0x57bab3(++_0x549b45);}(_0xb6b6,0x16d));var _0x6b6b=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb6b6[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6b6b('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6b6b('0x1'));var interaction=require(_0x6b6b('0x2'));var config=require(_0x6b6b('0x3'));var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6b6b('0x4')]);router['get'](_0x6b6b('0x5'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x7')]);router[_0x6b6b('0x8')](_0x6b6b('0x9'),auth['isAuthenticated'](),controller[_0x6b6b('0xa')]);router[_0x6b6b('0x8')](_0x6b6b('0xb'),auth['isAuthenticated'](),controller[_0x6b6b('0xc')]);router['get'](_0x6b6b('0xd'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0xe')]);router[_0x6b6b('0x8')](_0x6b6b('0xf'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x10')]);router[_0x6b6b('0x11')]('/',auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x12')]);router['post'](_0x6b6b('0xd'),auth[_0x6b6b('0x6')](),controller['addTeams']);router[_0x6b6b('0x11')](_0x6b6b('0xf'),auth['isAuthenticated'](),controller[_0x6b6b('0x13')]);router[_0x6b6b('0x14')]('/:id',auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x15')]);router['delete'](_0x6b6b('0x9'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x16')]);router['delete'](_0x6b6b('0xd'),auth['isAuthenticated'](),controller[_0x6b6b('0x17')]);router[_0x6b6b('0x18')](_0x6b6b('0xf'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x19')]);module[_0x6b6b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 55d3e53..7efc15a 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 _0xe843=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0xe843,0x11c));var _0x3e84=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe843[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3e84('0x0'));module[_0x3e84('0x1')]={'name':{'type':Sequelize[_0x3e84('0x2')],'unique':_0x3e84('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e84('0x2')]},'timeout':{'type':Sequelize[_0x3e84('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3e84('0x5'),_0x3e84('0x6'),_0x3e84('0x7'))}}; \ No newline at end of file +var _0x9dfd=['name','INTEGER','ENUM','roundrobin','sequelize','STRING'];(function(_0x26c093,_0x24eec1){var _0x34393d=function(_0x3a02f7){while(--_0x3a02f7){_0x26c093['push'](_0x26c093['shift']());}};_0x34393d(++_0x24eec1);}(_0x9dfd,0xe2));var _0xd9df=function(_0x17a360,_0x3a36f5){_0x17a360=_0x17a360-0x0;var _0x5c252f=_0x9dfd[_0x17a360];return _0x5c252f;};'use strict';var Sequelize=require(_0xd9df('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9df('0x1')],'unique':_0xd9df('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd9df('0x1')]},'timeout':{'type':Sequelize[_0xd9df('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd9df('0x4')]('rrmemory','beepall',_0xd9df('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index a96a7b3..28fdda1 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 _0x7e4c=['api','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','then','OpenchannelQueues','UserProfileResource','error','stack','name','index','map','OpenchannelQueue','fieldName','type','getOptions','where','include','query','show','params','model','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','order','sort','pick','OpenchannelQueueId','filter','findAll','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','findOne','merge','nolimit','ids','Team','Agents','online','voicePause','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','sequelize','isEmpty','removeAgents','userOpenchannelQueue:remove','omit','spread','getAgents','keys','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x7e4c,0x1e2));var _0xc7e4=function(_0x4e35d2,_0x516864){_0x4e35d2=_0x4e35d2-0x0;var _0x384964=_0x7e4c[_0x4e35d2];return _0x384964;};'use strict';var BPromise=require(_0xc7e4('0x0'));var util=require(_0xc7e4('0x1'));var _=require(_0xc7e4('0x2'));var squel=require('squel');var Redis=require(_0xc7e4('0x3'));var qs=require(_0xc7e4('0x4'));var logger=require(_0xc7e4('0x5'))(_0xc7e4('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xc7e4('0x7')](config[_0xc7e4('0x8')],{'host':_0xc7e4('0x9'),'port':0x18eb});var socket=require(_0xc7e4('0xa'))(new Redis(config['redis']));require(_0xc7e4('0xb'))[_0xc7e4('0xc')](socket);function respondWithStatusCode(_0x30647b,_0x181527){_0x181527=_0x181527||0xcc;return function(_0x471591){if(_0x471591){return _0x30647b[_0xc7e4('0xd')](_0x181527);}return _0x30647b[_0xc7e4('0xe')](_0x181527)[_0xc7e4('0xf')]();};}function respondWithResult(_0x538a78,_0x114e7c){_0x114e7c=_0x114e7c||0xc8;return function(_0x5756d4){if(_0x5756d4){return _0x538a78['status'](_0x114e7c)[_0xc7e4('0x10')](_0x5756d4);}};}function respondWithFilteredResult(_0x1b4316,_0x2493bc){return function(_0x8cbd68){if(_0x8cbd68){var _0x17aa88=typeof _0x2493bc[_0xc7e4('0x11')]===_0xc7e4('0x12')&&typeof _0x2493bc[_0xc7e4('0x13')]==='undefined';var _0x3e3c4f=_0x8cbd68[_0xc7e4('0x14')];var _0x40f931=_0x17aa88?0x0:_0x2493bc[_0xc7e4('0x11')];var _0x4e9bde=_0x17aa88?_0x8cbd68['count']:_0x2493bc[_0xc7e4('0x11')]+_0x2493bc[_0xc7e4('0x13')];var _0x3a3072;if(_0x4e9bde>=_0x3e3c4f){_0x4e9bde=_0x3e3c4f;_0x3a3072=0xc8;}else{_0x3a3072=0xce;}_0x1b4316['status'](_0x3a3072);return _0x1b4316['set'](_0xc7e4('0x15'),_0x40f931+'-'+_0x4e9bde+'/'+_0x3e3c4f)[_0xc7e4('0x10')](_0x8cbd68);}return null;};}function saveUpdates(_0x1a2662){return function(_0x20e1d5){if(_0x20e1d5){return _0x20e1d5[_0xc7e4('0x16')](_0x1a2662)['then'](function(_0x33fc7b){return _0x33fc7b;});}return null;};}function removeEntity(_0x56906a){return function(_0x9273c2){if(_0x9273c2){return _0x9273c2[_0xc7e4('0x17')]()[_0xc7e4('0x18')](function(){var _0x29dc7c=_0x9273c2['get']({'plain':!![]});var _0x18702e=_0xc7e4('0x19');return db[_0xc7e4('0x1a')][_0xc7e4('0x17')]({'where':{'type':_0x18702e,'resourceId':_0x29dc7c['id']}})[_0xc7e4('0x18')](function(){return _0x9273c2;});})[_0xc7e4('0x18')](function(){_0x56906a[_0xc7e4('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9951){return function(_0x407ae4){if(!_0x407ae4){_0x2b9951[_0xc7e4('0xd')](0x194);}return _0x407ae4;};}function handleError(_0x5a03bd,_0x541abe){_0x541abe=_0x541abe||0x1f4;return function(_0x1dbd5c){logger[_0xc7e4('0x1b')](_0x1dbd5c[_0xc7e4('0x1c')]);if(_0x1dbd5c[_0xc7e4('0x1d')]){delete _0x1dbd5c[_0xc7e4('0x1d')];}_0x5a03bd['status'](_0x541abe)['send'](_0x1dbd5c);};}exports[_0xc7e4('0x1e')]=function(_0x2d6803,_0x22ff62){var _0x1d4ed2={};var _0x46e057={'count':0x0,'rows':[]};var _0x46df30=_[_0xc7e4('0x1f')](db[_0xc7e4('0x20')]['rawAttributes'],function(_0x526f04){return{'name':_0x526f04[_0xc7e4('0x21')],'type':_0x526f04[_0xc7e4('0x22')]['key']};});_0x1d4ed2=qs[_0xc7e4('0x23')](_0x46df30,_0x2d6803);var _0x50fbc6={'where':_0x1d4ed2[_0xc7e4('0x24')]};return db['OpenchannelQueue'][_0xc7e4('0x14')](_0x50fbc6)['then'](function(_0x5936a3){_0x46e057[_0xc7e4('0x14')]=_0x5936a3;_0x1d4ed2[_0xc7e4('0x25')]=qs[_0xc7e4('0x25')](_0x2d6803[_0xc7e4('0x26')]);return db[_0xc7e4('0x20')]['findAll'](_0x1d4ed2);})[_0xc7e4('0x18')](function(_0x30c608){_0x46e057['rows']=_0x30c608;return _0x46e057;})[_0xc7e4('0x18')](respondWithFilteredResult(_0x22ff62,_0x1d4ed2))['catch'](handleError(_0x22ff62,null));};exports[_0xc7e4('0x27')]=function(_0x1fe4da,_0x4f3884){var _0x3cb742={'raw':!![],'where':{'id':_0x1fe4da[_0xc7e4('0x28')]['id']}},_0x39a49a={};_0x39a49a[_0xc7e4('0x29')]=_['keys'](db[_0xc7e4('0x20')][_0xc7e4('0x2a')]);_0x39a49a[_0xc7e4('0x26')]=_['keys'](_0x1fe4da[_0xc7e4('0x26')]);_0x39a49a[_0xc7e4('0x2b')]=_[_0xc7e4('0x2c')](_0x39a49a[_0xc7e4('0x29')],_0x39a49a[_0xc7e4('0x26')]);_0x3cb742[_0xc7e4('0x2d')]=_['intersection'](_0x39a49a[_0xc7e4('0x29')],qs['fields'](_0x1fe4da['query'][_0xc7e4('0x2e')]));_0x3cb742['attributes']=_0x3cb742[_0xc7e4('0x2d')][_0xc7e4('0x2f')]?_0x3cb742['attributes']:_0x39a49a['model'];if(_0x1fe4da[_0xc7e4('0x26')][_0xc7e4('0x30')]){_0x3cb742['include']=[{'all':!![]}];}_0x3cb742=_['merge']({},_0x3cb742,_0x1fe4da[_0xc7e4('0x31')]);return db[_0xc7e4('0x20')][_0xc7e4('0x32')](_0x3cb742)[_0xc7e4('0x18')](handleEntityNotFound(_0x4f3884,null))['then'](respondWithResult(_0x4f3884,null))[_0xc7e4('0x33')](handleError(_0x4f3884,null));};exports[_0xc7e4('0x34')]=function(_0x40eca9,_0xe7f959){return db[_0xc7e4('0x20')][_0xc7e4('0x34')](_0x40eca9[_0xc7e4('0x35')],{})['then'](function(_0x155fa7){var _0x4d94e5=_0x40eca9[_0xc7e4('0x36')][_0xc7e4('0x37')]({'plain':!![]});if(!_0x4d94e5)throw new Error(_0xc7e4('0x38'));if(_0x4d94e5['role']==='user'){var _0xc1aa10=_0x155fa7['get']({'plain':!![]});var _0x47fd98=_0xc7e4('0x19');return db[_0xc7e4('0x39')][_0xc7e4('0x32')]({'where':{'name':_0x47fd98,'userProfileId':_0x4d94e5[_0xc7e4('0x3a')]},'raw':!![]})[_0xc7e4('0x18')](function(_0x3f6b72){if(_0x3f6b72&&_0x3f6b72[_0xc7e4('0x3b')]===0x0){return db[_0xc7e4('0x1a')]['create']({'name':_0xc1aa10['name'],'resourceId':_0xc1aa10['id'],'type':_0x3f6b72[_0xc7e4('0x1d')],'sectionId':_0x3f6b72['id']},{})[_0xc7e4('0x18')](function(){return _0x155fa7;});}else{return _0x155fa7;}})[_0xc7e4('0x33')](function(_0x53f611){logger[_0xc7e4('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f611);throw _0x53f611;});}return _0x155fa7;})[_0xc7e4('0x18')](respondWithResult(_0xe7f959,0xc9))['catch'](handleError(_0xe7f959,null));};exports[_0xc7e4('0x16')]=function(_0x34380d,_0x5a64b5){if(_0x34380d[_0xc7e4('0x35')]['id']){delete _0x34380d[_0xc7e4('0x35')]['id'];}return db['OpenchannelQueue'][_0xc7e4('0x32')]({'where':{'id':_0x34380d[_0xc7e4('0x28')]['id']}})[_0xc7e4('0x18')](handleEntityNotFound(_0x5a64b5,null))[_0xc7e4('0x18')](saveUpdates(_0x34380d['body'],null))['then'](respondWithResult(_0x5a64b5,null))[_0xc7e4('0x33')](handleError(_0x5a64b5,null));};exports[_0xc7e4('0x17')]=function(_0x106623,_0x5af906){return db['OpenchannelQueue']['find']({'where':{'id':_0x106623[_0xc7e4('0x28')]['id']}})['then'](handleEntityNotFound(_0x5af906,null))[_0xc7e4('0x18')](removeEntity(_0x5af906,null))[_0xc7e4('0x33')](handleError(_0x5af906,null));};exports[_0xc7e4('0x3c')]=function(_0x5dbd70,_0x1e6282){return db[_0xc7e4('0x20')][_0xc7e4('0x3c')]()[_0xc7e4('0x18')](respondWithResult(_0x1e6282,null))[_0xc7e4('0x33')](handleError(_0x1e6282,null));};exports[_0xc7e4('0x3d')]=function(_0x3c8cf9,_0x2b2334){var _0x239098={'raw':!![],'where':{}},_0x5dda24={},_0x4e5330;return db[_0xc7e4('0x20')]['findOne']({'where':{'id':_0x3c8cf9['params']['id']}})[_0xc7e4('0x18')](handleEntityNotFound(_0x2b2334,null))[_0xc7e4('0x18')](function(_0x1dba7c){if(_0x1dba7c){_0x4e5330=_0x1dba7c[_0xc7e4('0x37')]({'plain':!![]});_0x5dda24[_0xc7e4('0x29')]=_['keys'](db[_0xc7e4('0x3e')][_0xc7e4('0x2a')]);_0x5dda24[_0xc7e4('0x26')]=_['keys'](_0x3c8cf9[_0xc7e4('0x26')]);_0x5dda24[_0xc7e4('0x2b')]=_[_0xc7e4('0x2c')](_0x5dda24[_0xc7e4('0x29')],_0x5dda24[_0xc7e4('0x26')]);_0x239098['attributes']=_[_0xc7e4('0x2c')](_0x5dda24[_0xc7e4('0x29')],qs[_0xc7e4('0x2e')](_0x3c8cf9[_0xc7e4('0x26')][_0xc7e4('0x2e')]));_0x239098[_0xc7e4('0x2d')]=_0x239098['attributes'][_0xc7e4('0x2f')]?_0x239098[_0xc7e4('0x2d')]:_0x5dda24[_0xc7e4('0x29')];if(!_0x3c8cf9[_0xc7e4('0x26')][_0xc7e4('0x3f')]('nolimit')){_0x239098['limit']=qs[_0xc7e4('0x13')](_0x3c8cf9[_0xc7e4('0x26')][_0xc7e4('0x13')]);_0x239098['offset']=qs[_0xc7e4('0x11')](_0x3c8cf9[_0xc7e4('0x26')][_0xc7e4('0x11')]);}_0x239098[_0xc7e4('0x40')]=qs['sort'](_0x3c8cf9['query'][_0xc7e4('0x41')]);_0x239098[_0xc7e4('0x24')]=qs[_0xc7e4('0x2b')](_[_0xc7e4('0x42')](_0x3c8cf9[_0xc7e4('0x26')],_0x5dda24[_0xc7e4('0x2b')]));_0x239098[_0xc7e4('0x24')][_0xc7e4('0x43')]=_0x1dba7c['id'];if(_0x3c8cf9[_0xc7e4('0x26')][_0xc7e4('0x44')]){_0x239098[_0xc7e4('0x24')]=_['merge'](_0x239098[_0xc7e4('0x24')],{'$or':_['map'](_0x239098[_0xc7e4('0x2d')],function(_0x20860b){var _0x51a5b7={};_0x51a5b7[_0x20860b]={'$like':'%'+_0x3c8cf9[_0xc7e4('0x26')][_0xc7e4('0x44')]+'%'};return _0x51a5b7;})});}_0x239098=_['merge']({},_0x239098,_0x3c8cf9[_0xc7e4('0x31')]);return db['UserOpenchannelQueue'][_0xc7e4('0x45')](_0x239098);}})[_0xc7e4('0x18')](function(_0x1700db){if(_0x1700db){return db[_0xc7e4('0x46')][_0xc7e4('0x47')]({'where':{'id':_[_0xc7e4('0x1f')](_0x1700db,_0xc7e4('0x48')),'role':'agent'},'attributes':['id','name',_0xc7e4('0x49'),_0xc7e4('0x4a'),_0xc7e4('0x4b')]});}})['then'](function(_0x18ac31){if(_0x18ac31){return{'count':_0x18ac31['count'],'rows':_[_0xc7e4('0x1f')](_0x18ac31[_0xc7e4('0x4c')],function(_0x4583bd){return{'membername':_0x4583bd[_0xc7e4('0x1d')],'UserId':_0x4583bd['id'],'queue_name':_0x4e5330['name'],'OpenchannelQueueId':_0x4e5330['id'],'interface':util[_0xc7e4('0x4d')](_0xc7e4('0x4e'),'SIP',_0x4583bd['name']),'penalty':0x0,'paused':_0x4583bd[_0xc7e4('0x49')],'createdAt':_0x4583bd[_0xc7e4('0x4b')],'updatedAt':_0x4583bd[_0xc7e4('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7e4('0x18')](respondWithFilteredResult(_0x2b2334,_0x239098))[_0xc7e4('0x33')](handleError(_0x2b2334,null));};exports[_0xc7e4('0x4f')]=function(_0x6f01ed,_0x3658ef){var _0x3128e6={};var _0x55a953={};var _0x57a399;var _0x164f77;return db[_0xc7e4('0x20')][_0xc7e4('0x50')]({'where':{'id':_0x6f01ed[_0xc7e4('0x28')]['id']}})[_0xc7e4('0x18')](handleEntityNotFound(_0x3658ef,null))['then'](function(_0x3ec2af){if(_0x3ec2af){_0x57a399=_0x3ec2af;_0x55a953['model']=_['keys'](db['Team']['rawAttributes']);_0x55a953['query']=_['keys'](_0x6f01ed['query']);_0x55a953[_0xc7e4('0x2b')]=_['intersection'](_0x55a953[_0xc7e4('0x29')],_0x55a953[_0xc7e4('0x26')]);_0x3128e6[_0xc7e4('0x2d')]=_[_0xc7e4('0x2c')](_0x55a953[_0xc7e4('0x29')],qs[_0xc7e4('0x2e')](_0x6f01ed['query'][_0xc7e4('0x2e')]));_0x3128e6[_0xc7e4('0x2d')]=_0x3128e6['attributes'][_0xc7e4('0x2f')]?_0x3128e6['attributes']:_0x55a953['model'];_0x3128e6[_0xc7e4('0x40')]=qs[_0xc7e4('0x41')](_0x6f01ed['query'][_0xc7e4('0x41')]);_0x3128e6[_0xc7e4('0x24')]=qs[_0xc7e4('0x2b')](_[_0xc7e4('0x42')](_0x6f01ed['query'],_0x55a953[_0xc7e4('0x2b')]));if(_0x6f01ed[_0xc7e4('0x26')][_0xc7e4('0x44')]){_0x3128e6[_0xc7e4('0x24')]=_[_0xc7e4('0x51')](_0x3128e6['where'],{'$or':_[_0xc7e4('0x1f')](_0x3128e6[_0xc7e4('0x2d')],function(_0x580193){var _0x4b92b1={};_0x4b92b1[_0x580193]={'$like':'%'+_0x6f01ed[_0xc7e4('0x26')]['filter']+'%'};return _0x4b92b1;})});}_0x3128e6=_['merge']({},_0x3128e6,_0x6f01ed[_0xc7e4('0x31')]);return _0x57a399[_0xc7e4('0x4f')](_0x3128e6);}})[_0xc7e4('0x18')](function(_0x2d0b26){if(_0x2d0b26){_0x164f77=_0x2d0b26[_0xc7e4('0x2f')];if(!_0x6f01ed[_0xc7e4('0x26')][_0xc7e4('0x3f')](_0xc7e4('0x52'))){_0x3128e6[_0xc7e4('0x13')]=qs[_0xc7e4('0x13')](_0x6f01ed[_0xc7e4('0x26')][_0xc7e4('0x13')]);_0x3128e6['offset']=qs['offset'](_0x6f01ed['query'][_0xc7e4('0x11')]);}return _0x57a399[_0xc7e4('0x4f')](_0x3128e6);}})['then'](function(_0x4da444){if(_0x4da444){return _0x4da444?{'count':_0x164f77,'rows':_0x4da444}:null;}})['then'](respondWithResult(_0x3658ef,null))['catch'](handleError(_0x3658ef,null));};exports['addTeams']=function(_0x1a9dd7,_0x5c4c04){var _0x236883=_0x1a9dd7[_0xc7e4('0x35')][_0xc7e4('0x53')];return db[_0xc7e4('0x54')][_0xc7e4('0x45')]({'where':{'id':_0x236883},'attributes':['id'],'include':[{'model':db[_0xc7e4('0x46')],'as':_0xc7e4('0x55'),'attributes':['id','name',_0xc7e4('0x56'),_0xc7e4('0x57'),'interface'],'raw':!![]}]})[_0xc7e4('0x18')](function(_0x418c80){if(_0x418c80){var _0x3e2a2b=_[_0xc7e4('0x58')](_0x418c80,function(_0x273cda){var _0x2ed8af=_0x273cda[_0xc7e4('0x37')]({'plain':!![]});return _0x2ed8af[_0xc7e4('0x55')];});return db[_0xc7e4('0x20')][_0xc7e4('0x32')]({'where':{'id':_0x1a9dd7['params']['id']}})[_0xc7e4('0x18')](function(_0x333988){return db['sequelize'][_0xc7e4('0x59')](function(_0x6d59ba){return _0x333988[_0xc7e4('0x5a')](_0x236883,{'transaction':_0x6d59ba})[_0xc7e4('0x18')](function(){return BPromise[_0xc7e4('0x5b')](_0x3e2a2b,function(_0x4776a6){return db[_0xc7e4('0x3e')][_0xc7e4('0x5c')]({'where':{'UserId':_0x4776a6['id'],'OpenchannelQueueId':_0x1a9dd7['params']['id']},'transaction':_0x6d59ba});});})['then'](function(){_0x3e2a2b[_0xc7e4('0x5d')](function(_0xa3ecdf){socket[_0xc7e4('0x5e')](_0xc7e4('0x5f'),{'UserId':_0xa3ecdf['id'],'OpenchannelQueueId':_0x333988['id']});});});});});}})[_0xc7e4('0x18')](respondWithStatusCode(_0x5c4c04,null))['catch'](handleError(_0x5c4c04,null));};exports[_0xc7e4('0x60')]=function(_0x4fff80,_0x179ba2){return db['Team'][_0xc7e4('0x45')]({'where':{'id':_0x4fff80[_0xc7e4('0x26')][_0xc7e4('0x53')]},'attributes':['id'],'include':[{'model':db[_0xc7e4('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc7e4('0x18')](handleEntityNotFound(_0x179ba2,null))['then'](function(_0x39cc0e){var _0x22305a=_['map'](_0x39cc0e,'id');var _0x4bab91=[];var _0x3fb374=[];var _0x2c3a4b=squel[_0xc7e4('0x61')]();_0x2c3a4b[_0xc7e4('0x62')](_0xc7e4('0x63'))[_0xc7e4('0x64')](_0xc7e4('0x65'),'tq')[_0xc7e4('0x66')](_0xc7e4('0x67'),'ut',_0xc7e4('0x68'))[_0xc7e4('0x24')](_0xc7e4('0x69'),_0x4fff80[_0xc7e4('0x28')]['id']);for(var _0xfd7959=0x0;_0xfd7959<_0x39cc0e[_0xc7e4('0x2f')];_0xfd7959+=0x1){let _0x433023=_0x39cc0e[_0xfd7959];for(var _0x567ff1=0x0;_0x567ff1<_0x433023[_0xc7e4('0x55')][_0xc7e4('0x2f')];_0x567ff1+=0x1){let _0x4a9578=_0x433023[_0xc7e4('0x55')][_0x567ff1];var _0x2f01d5=_0x2c3a4b['clone']();_0x2f01d5[_0xc7e4('0x24')](_0xc7e4('0x6a'),_0x4a9578['id']);_0x3fb374[_0xc7e4('0x6b')](db['sequelize']['query'](_0x2f01d5[_0xc7e4('0x6c')](),{'type':db['sequelize'][_0xc7e4('0x6d')][_0xc7e4('0x6e')]})[_0xc7e4('0x18')](function(_0x28660b){if(_0x28660b['length']===0x1){return _0x4a9578['id'];}else{var _0x80b043=_[_0xc7e4('0x6f')](_['map'](_0x28660b,_0xc7e4('0x70')),function(_0x2cdf56){return _['includes'](_0x22305a,_0x2cdf56);});if(_0x80b043){return _0x4a9578['id'];}}}));}}return BPromise[_0xc7e4('0x71')](_0x3fb374)['then'](function(_0x404b76){_0x4bab91=_(_0x4bab91)['union'](_0x404b76)['compact']()['value']();return db[_0xc7e4('0x20')][_0xc7e4('0x32')]({'where':{'id':_0x4fff80[_0xc7e4('0x28')]['id']}})[_0xc7e4('0x18')](function(_0x5be352){return db[_0xc7e4('0x72')]['transaction'](function(_0x4d3556){return _0x5be352[_0xc7e4('0x60')](_0x4fff80[_0xc7e4('0x26')]['ids'],{'transaction':_0x4d3556})[_0xc7e4('0x18')](function(){if(!_[_0xc7e4('0x73')](_0x4bab91)){return _0x5be352[_0xc7e4('0x74')](_0x4bab91,{'transaction':_0x4d3556});}})[_0xc7e4('0x18')](function(){_0x4bab91[_0xc7e4('0x5d')](function(_0x489335){socket[_0xc7e4('0x5e')](_0xc7e4('0x75'),{'UserId':_0x489335,'OpenchannelQueueId':_0x5be352['id']});});});});});});})[_0xc7e4('0x18')](respondWithStatusCode(_0x179ba2,null))[_0xc7e4('0x33')](handleError(_0x179ba2,null));};exports['addAgents']=function(_0x215c8e,_0x55f5e5){return db['OpenchannelQueue']['find']({'where':{'id':_0x215c8e['params']['id']}})[_0xc7e4('0x18')](handleEntityNotFound(_0x55f5e5,null))[_0xc7e4('0x18')](function(_0xd043e1){if(_0xd043e1){return _0xd043e1['addAgents'](_0x215c8e['body'][_0xc7e4('0x53')],_[_0xc7e4('0x76')](_0x215c8e[_0xc7e4('0x35')],[_0xc7e4('0x53'),'id'])||{})[_0xc7e4('0x77')](function(_0x1c897e){for(var _0x505929=0x0;_0x505929<_0x215c8e[_0xc7e4('0x35')]['ids'][_0xc7e4('0x2f')];_0x505929+=0x1){socket[_0xc7e4('0x5e')]('userOpenchannelQueue:save',{'UserId':Number(_0x215c8e[_0xc7e4('0x35')][_0xc7e4('0x53')][_0x505929]),'OpenchannelQueueId':Number(_0x215c8e[_0xc7e4('0x28')]['id'])});}return _0x1c897e;});}})['then'](respondWithResult(_0x55f5e5,null))[_0xc7e4('0x33')](handleError(_0x55f5e5,null));};exports[_0xc7e4('0x74')]=function(_0xceb824,_0x295ce8){return db[_0xc7e4('0x20')]['find']({'where':{'id':_0xceb824[_0xc7e4('0x28')]['id']}})[_0xc7e4('0x18')](handleEntityNotFound(_0x295ce8,null))[_0xc7e4('0x18')](function(_0x8e49c0){if(_0x8e49c0){return _0x8e49c0[_0xc7e4('0x74')](_0xceb824[_0xc7e4('0x26')]['ids'])[_0xc7e4('0x18')](function(){if(_['isArray'](_0xceb824[_0xc7e4('0x26')]['ids'])){for(var _0x191f97=0x0;_0x191f97<_0xceb824[_0xc7e4('0x26')][_0xc7e4('0x53')][_0xc7e4('0x2f')];_0x191f97+=0x1){socket[_0xc7e4('0x5e')](_0xc7e4('0x75'),{'UserId':Number(_0xceb824[_0xc7e4('0x26')]['ids'][_0x191f97]),'OpenchannelQueueId':Number(_0xceb824[_0xc7e4('0x28')]['id'])});}}else{socket[_0xc7e4('0x5e')](_0xc7e4('0x75'),{'UserId':Number(_0xceb824[_0xc7e4('0x26')][_0xc7e4('0x53')]),'OpenchannelQueueId':Number(_0xceb824[_0xc7e4('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x295ce8,null))[_0xc7e4('0x33')](handleError(_0x295ce8,null));};exports[_0xc7e4('0x78')]=function(_0x334b8f,_0x496334){var _0x2a3ad4={};var _0x93b130={};var _0x15a58f;var _0x547768;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x334b8f[_0xc7e4('0x28')]['id']}})[_0xc7e4('0x18')](handleEntityNotFound(_0x496334,null))[_0xc7e4('0x18')](function(_0x1f0b1d){if(_0x1f0b1d){_0x15a58f=_0x1f0b1d;_0x93b130[_0xc7e4('0x29')]=_[_0xc7e4('0x79')](db[_0xc7e4('0x46')]['rawAttributes']);_0x93b130[_0xc7e4('0x26')]=_['keys'](_0x334b8f[_0xc7e4('0x26')]);_0x93b130[_0xc7e4('0x2b')]=_['intersection'](_0x93b130[_0xc7e4('0x29')],_0x93b130[_0xc7e4('0x26')]);_0x2a3ad4[_0xc7e4('0x2d')]=_['intersection'](_0x93b130[_0xc7e4('0x29')],qs[_0xc7e4('0x2e')](_0x334b8f[_0xc7e4('0x26')][_0xc7e4('0x2e')]));_0x2a3ad4['attributes']=_0x2a3ad4[_0xc7e4('0x2d')][_0xc7e4('0x2f')]?_0x2a3ad4['attributes']:_0x93b130[_0xc7e4('0x29')];_0x2a3ad4['order']=qs[_0xc7e4('0x41')](_0x334b8f[_0xc7e4('0x26')]['sort']);_0x2a3ad4[_0xc7e4('0x24')]=qs[_0xc7e4('0x2b')](_[_0xc7e4('0x42')](_0x334b8f[_0xc7e4('0x26')],_0x93b130[_0xc7e4('0x2b')]));if(_0x334b8f[_0xc7e4('0x26')][_0xc7e4('0x44')]){_0x2a3ad4['where']=_[_0xc7e4('0x51')](_0x2a3ad4[_0xc7e4('0x24')],{'$or':_[_0xc7e4('0x1f')](_0x2a3ad4[_0xc7e4('0x2d')],function(_0x5ec4b1){var _0x386a9d={};_0x386a9d[_0x5ec4b1]={'$like':'%'+_0x334b8f['query'][_0xc7e4('0x44')]+'%'};return _0x386a9d;})});}_0x2a3ad4=_[_0xc7e4('0x51')]({},_0x2a3ad4,_0x334b8f['options']);return _0x15a58f[_0xc7e4('0x78')](_0x2a3ad4);}})[_0xc7e4('0x18')](function(_0x4f053c){if(_0x4f053c){_0x547768=_0x4f053c[_0xc7e4('0x2f')];if(!_0x334b8f[_0xc7e4('0x26')]['hasOwnProperty'](_0xc7e4('0x52'))){_0x2a3ad4['limit']=qs[_0xc7e4('0x13')](_0x334b8f[_0xc7e4('0x26')][_0xc7e4('0x13')]);_0x2a3ad4[_0xc7e4('0x11')]=qs[_0xc7e4('0x11')](_0x334b8f[_0xc7e4('0x26')]['offset']);}return _0x15a58f[_0xc7e4('0x78')](_0x2a3ad4);}})[_0xc7e4('0x18')](function(_0x56a6cf){if(_0x56a6cf){return _0x56a6cf?{'count':_0x547768,'rows':_0x56a6cf}:null;}})['then'](respondWithResult(_0x496334,null))[_0xc7e4('0x33')](handleError(_0x496334,null));}; \ No newline at end of file +var _0x42ac=['all','union','compact','value','transaction','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','userOpenchannelQueue:save','removeAgents','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','json','undefined','limit','count','offset','set','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','sendStatus','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','sort','filter','User','findAndCountAll','UserId','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','order','pick','Agents','online','voicePause','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','ids','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId'];(function(_0x1de92c,_0x191fa6){var _0x1c9677=function(_0x54f756){while(--_0x54f756){_0x1de92c['push'](_0x1de92c['shift']());}};_0x1c9677(++_0x191fa6);}(_0x42ac,0x1e9));var _0xc42a=function(_0x4cfee9,_0x28859e){_0x4cfee9=_0x4cfee9-0x0;var _0x11457f=_0x42ac[_0x4cfee9];return _0x11457f;};'use strict';var BPromise=require(_0xc42a('0x0'));var util=require(_0xc42a('0x1'));var _=require('lodash');var squel=require(_0xc42a('0x2'));var Redis=require(_0xc42a('0x3'));var qs=require(_0xc42a('0x4'));var logger=require(_0xc42a('0x5'))('api');var config=require(_0xc42a('0x6'));var db=require(_0xc42a('0x7'))['db'];config[_0xc42a('0x8')]=_['defaults'](config[_0xc42a('0x8')],{'host':_0xc42a('0x9'),'port':0x18eb});var socket=require(_0xc42a('0xa'))(new Redis(config[_0xc42a('0x8')]));require(_0xc42a('0xb'))[_0xc42a('0xc')](socket);function respondWithStatusCode(_0x136c5a,_0x2f52ca){_0x2f52ca=_0x2f52ca||0xcc;return function(_0x4a983f){if(_0x4a983f){return _0x136c5a['sendStatus'](_0x2f52ca);}return _0x136c5a[_0xc42a('0xd')](_0x2f52ca)['end']();};}function respondWithResult(_0x37c3d8,_0x57be79){_0x57be79=_0x57be79||0xc8;return function(_0xe03e57){if(_0xe03e57){return _0x37c3d8[_0xc42a('0xd')](_0x57be79)[_0xc42a('0xe')](_0xe03e57);}};}function respondWithFilteredResult(_0x8392f2,_0x530b51){return function(_0x12e17a){if(_0x12e17a){var _0x2e3f36=typeof _0x530b51['offset']===_0xc42a('0xf')&&typeof _0x530b51[_0xc42a('0x10')]===_0xc42a('0xf');var _0x58578=_0x12e17a[_0xc42a('0x11')];var _0x320a3d=_0x2e3f36?0x0:_0x530b51[_0xc42a('0x12')];var _0x5ef659=_0x2e3f36?_0x12e17a[_0xc42a('0x11')]:_0x530b51['offset']+_0x530b51['limit'];var _0x5b8e17;if(_0x5ef659>=_0x58578){_0x5ef659=_0x58578;_0x5b8e17=0xc8;}else{_0x5b8e17=0xce;}_0x8392f2[_0xc42a('0xd')](_0x5b8e17);return _0x8392f2[_0xc42a('0x13')]('Content-Range',_0x320a3d+'-'+_0x5ef659+'/'+_0x58578)[_0xc42a('0xe')](_0x12e17a);}return null;};}function saveUpdates(_0x2bcbd5){return function(_0x26dab3){if(_0x26dab3){return _0x26dab3[_0xc42a('0x14')](_0x2bcbd5)[_0xc42a('0x15')](function(_0x1e74e7){return _0x1e74e7;});}return null;};}function removeEntity(_0x914758){return function(_0x11586b){if(_0x11586b){return _0x11586b[_0xc42a('0x16')]()[_0xc42a('0x15')](function(){var _0x1fb10c=_0x11586b[_0xc42a('0x17')]({'plain':!![]});var _0x279572=_0xc42a('0x18');return db[_0xc42a('0x19')][_0xc42a('0x16')]({'where':{'type':_0x279572,'resourceId':_0x1fb10c['id']}})['then'](function(){return _0x11586b;});})[_0xc42a('0x15')](function(){_0x914758[_0xc42a('0xd')](0xcc)[_0xc42a('0x1a')]();});}};}function handleEntityNotFound(_0x544771){return function(_0x5cae2c){if(!_0x5cae2c){_0x544771[_0xc42a('0x1b')](0x194);}return _0x5cae2c;};}function handleError(_0x3b5d30,_0xdd5a82){_0xdd5a82=_0xdd5a82||0x1f4;return function(_0x54b790){logger[_0xc42a('0x1c')](_0x54b790[_0xc42a('0x1d')]);if(_0x54b790[_0xc42a('0x1e')]){delete _0x54b790[_0xc42a('0x1e')];}_0x3b5d30[_0xc42a('0xd')](_0xdd5a82)['send'](_0x54b790);};}exports[_0xc42a('0x1f')]=function(_0x4394e5,_0x221a95){var _0x36e551={};var _0x1d9f57={'count':0x0,'rows':[]};var _0x31b308=_[_0xc42a('0x20')](db[_0xc42a('0x21')][_0xc42a('0x22')],function(_0x5ac227){return{'name':_0x5ac227[_0xc42a('0x23')],'type':_0x5ac227[_0xc42a('0x24')][_0xc42a('0x25')]};});_0x36e551=qs[_0xc42a('0x26')](_0x31b308,_0x4394e5);var _0x249374={'where':_0x36e551[_0xc42a('0x27')]};return db[_0xc42a('0x21')][_0xc42a('0x11')](_0x249374)[_0xc42a('0x15')](function(_0x2b6319){_0x1d9f57[_0xc42a('0x11')]=_0x2b6319;_0x36e551[_0xc42a('0x28')]=qs['include'](_0x4394e5[_0xc42a('0x29')]);return db[_0xc42a('0x21')][_0xc42a('0x2a')](_0x36e551);})['then'](function(_0x298ec5){_0x1d9f57[_0xc42a('0x2b')]=_0x298ec5;return _0x1d9f57;})[_0xc42a('0x15')](respondWithFilteredResult(_0x221a95,_0x36e551))[_0xc42a('0x2c')](handleError(_0x221a95,null));};exports['show']=function(_0x27c255,_0x1efd5b){var _0x38ed4d={'raw':!![],'where':{'id':_0x27c255[_0xc42a('0x2d')]['id']}},_0x1c0133={};_0x1c0133[_0xc42a('0x2e')]=_[_0xc42a('0x2f')](db[_0xc42a('0x21')]['rawAttributes']);_0x1c0133[_0xc42a('0x29')]=_['keys'](_0x27c255[_0xc42a('0x29')]);_0x1c0133[_0xc42a('0x30')]=_[_0xc42a('0x31')](_0x1c0133['model'],_0x1c0133[_0xc42a('0x29')]);_0x38ed4d[_0xc42a('0x32')]=_[_0xc42a('0x31')](_0x1c0133[_0xc42a('0x2e')],qs[_0xc42a('0x33')](_0x27c255[_0xc42a('0x29')][_0xc42a('0x33')]));_0x38ed4d[_0xc42a('0x32')]=_0x38ed4d[_0xc42a('0x32')]['length']?_0x38ed4d[_0xc42a('0x32')]:_0x1c0133[_0xc42a('0x2e')];if(_0x27c255[_0xc42a('0x29')][_0xc42a('0x34')]){_0x38ed4d[_0xc42a('0x28')]=[{'all':!![]}];}_0x38ed4d=_[_0xc42a('0x35')]({},_0x38ed4d,_0x27c255[_0xc42a('0x36')]);return db['OpenchannelQueue'][_0xc42a('0x37')](_0x38ed4d)['then'](handleEntityNotFound(_0x1efd5b,null))[_0xc42a('0x15')](respondWithResult(_0x1efd5b,null))['catch'](handleError(_0x1efd5b,null));};exports[_0xc42a('0x38')]=function(_0x17d90f,_0x2c2b64){return db[_0xc42a('0x21')][_0xc42a('0x38')](_0x17d90f[_0xc42a('0x39')],{})[_0xc42a('0x15')](function(_0x4baa23){var _0x3f7b0d=_0x17d90f[_0xc42a('0x3a')][_0xc42a('0x17')]({'plain':!![]});if(!_0x3f7b0d)throw new Error(_0xc42a('0x3b'));if(_0x3f7b0d['role']===_0xc42a('0x3a')){var _0x5664d1=_0x4baa23[_0xc42a('0x17')]({'plain':!![]});var _0x2d8ba7='OpenchannelQueues';return db['UserProfileSection'][_0xc42a('0x37')]({'where':{'name':_0x2d8ba7,'userProfileId':_0x3f7b0d[_0xc42a('0x3c')]},'raw':!![]})['then'](function(_0x4c15e4){if(_0x4c15e4&&_0x4c15e4['autoAssociation']===0x0){return db['UserProfileResource'][_0xc42a('0x38')]({'name':_0x5664d1[_0xc42a('0x1e')],'resourceId':_0x5664d1['id'],'type':_0x4c15e4[_0xc42a('0x1e')],'sectionId':_0x4c15e4['id']},{})[_0xc42a('0x15')](function(){return _0x4baa23;});}else{return _0x4baa23;}})['catch'](function(_0x2a9ebd){logger[_0xc42a('0x1c')](_0xc42a('0x3d'),_0x2a9ebd);throw _0x2a9ebd;});}return _0x4baa23;})['then'](respondWithResult(_0x2c2b64,0xc9))[_0xc42a('0x2c')](handleError(_0x2c2b64,null));};exports['update']=function(_0x19f419,_0x477026){if(_0x19f419[_0xc42a('0x39')]['id']){delete _0x19f419[_0xc42a('0x39')]['id'];}return db[_0xc42a('0x21')][_0xc42a('0x37')]({'where':{'id':_0x19f419['params']['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x477026,null))[_0xc42a('0x15')](saveUpdates(_0x19f419[_0xc42a('0x39')],null))['then'](respondWithResult(_0x477026,null))[_0xc42a('0x2c')](handleError(_0x477026,null));};exports[_0xc42a('0x16')]=function(_0x397b96,_0x3864b2){return db[_0xc42a('0x21')]['find']({'where':{'id':_0x397b96['params']['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x3864b2,null))['then'](removeEntity(_0x3864b2,null))[_0xc42a('0x2c')](handleError(_0x3864b2,null));};exports[_0xc42a('0x3e')]=function(_0x566298,_0x59ff7c){return db[_0xc42a('0x21')][_0xc42a('0x3e')]()[_0xc42a('0x15')](respondWithResult(_0x59ff7c,null))['catch'](handleError(_0x59ff7c,null));};exports[_0xc42a('0x3f')]=function(_0x18b5c4,_0x112bb5){var _0x33cee9={'raw':!![],'where':{}},_0x2eff57={},_0x2059d2;return db[_0xc42a('0x21')][_0xc42a('0x40')]({'where':{'id':_0x18b5c4[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x112bb5,null))[_0xc42a('0x15')](function(_0x110b86){if(_0x110b86){_0x2059d2=_0x110b86['get']({'plain':!![]});_0x2eff57[_0xc42a('0x2e')]=_['keys'](db[_0xc42a('0x41')][_0xc42a('0x22')]);_0x2eff57[_0xc42a('0x29')]=_[_0xc42a('0x2f')](_0x18b5c4[_0xc42a('0x29')]);_0x2eff57['filters']=_[_0xc42a('0x31')](_0x2eff57[_0xc42a('0x2e')],_0x2eff57[_0xc42a('0x29')]);_0x33cee9[_0xc42a('0x32')]=_['intersection'](_0x2eff57[_0xc42a('0x2e')],qs[_0xc42a('0x33')](_0x18b5c4['query'][_0xc42a('0x33')]));_0x33cee9[_0xc42a('0x32')]=_0x33cee9[_0xc42a('0x32')][_0xc42a('0x42')]?_0x33cee9[_0xc42a('0x32')]:_0x2eff57['model'];if(!_0x18b5c4[_0xc42a('0x29')][_0xc42a('0x43')](_0xc42a('0x44'))){_0x33cee9[_0xc42a('0x10')]=qs['limit'](_0x18b5c4['query'][_0xc42a('0x10')]);_0x33cee9[_0xc42a('0x12')]=qs[_0xc42a('0x12')](_0x18b5c4['query'][_0xc42a('0x12')]);}_0x33cee9['order']=qs[_0xc42a('0x45')](_0x18b5c4[_0xc42a('0x29')]['sort']);_0x33cee9[_0xc42a('0x27')]=qs[_0xc42a('0x30')](_['pick'](_0x18b5c4[_0xc42a('0x29')],_0x2eff57[_0xc42a('0x30')]));_0x33cee9[_0xc42a('0x27')]['OpenchannelQueueId']=_0x110b86['id'];if(_0x18b5c4[_0xc42a('0x29')][_0xc42a('0x46')]){_0x33cee9[_0xc42a('0x27')]=_[_0xc42a('0x35')](_0x33cee9[_0xc42a('0x27')],{'$or':_[_0xc42a('0x20')](_0x33cee9[_0xc42a('0x32')],function(_0x4412bd){var _0x4fa93e={};_0x4fa93e[_0x4412bd]={'$like':'%'+_0x18b5c4[_0xc42a('0x29')]['filter']+'%'};return _0x4fa93e;})});}_0x33cee9=_['merge']({},_0x33cee9,_0x18b5c4[_0xc42a('0x36')]);return db[_0xc42a('0x41')][_0xc42a('0x2a')](_0x33cee9);}})[_0xc42a('0x15')](function(_0x2c123c){if(_0x2c123c){return db[_0xc42a('0x47')][_0xc42a('0x48')]({'where':{'id':_[_0xc42a('0x20')](_0x2c123c,_0xc42a('0x49')),'role':'agent'},'attributes':['id',_0xc42a('0x1e'),_0xc42a('0x4a'),'updatedAt',_0xc42a('0x4b')]});}})[_0xc42a('0x15')](function(_0x221d0c){if(_0x221d0c){return{'count':_0x221d0c[_0xc42a('0x11')],'rows':_[_0xc42a('0x20')](_0x221d0c['rows'],function(_0x2fa0e9){return{'membername':_0x2fa0e9['name'],'UserId':_0x2fa0e9['id'],'queue_name':_0x2059d2['name'],'OpenchannelQueueId':_0x2059d2['id'],'interface':util['format'](_0xc42a('0x4c'),_0xc42a('0x4d'),_0x2fa0e9['name']),'penalty':0x0,'paused':_0x2fa0e9[_0xc42a('0x4a')],'createdAt':_0x2fa0e9[_0xc42a('0x4b')],'updatedAt':_0x2fa0e9[_0xc42a('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc42a('0x15')](respondWithFilteredResult(_0x112bb5,_0x33cee9))[_0xc42a('0x2c')](handleError(_0x112bb5,null));};exports[_0xc42a('0x4f')]=function(_0x21870c,_0x204d53){var _0x5578aa={};var _0x139ed3={};var _0x33435b;var _0x1fb93b;return db[_0xc42a('0x21')][_0xc42a('0x40')]({'where':{'id':_0x21870c[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x204d53,null))[_0xc42a('0x15')](function(_0x2cca9d){if(_0x2cca9d){_0x33435b=_0x2cca9d;_0x139ed3[_0xc42a('0x2e')]=_[_0xc42a('0x2f')](db[_0xc42a('0x50')][_0xc42a('0x22')]);_0x139ed3[_0xc42a('0x29')]=_['keys'](_0x21870c['query']);_0x139ed3[_0xc42a('0x30')]=_[_0xc42a('0x31')](_0x139ed3[_0xc42a('0x2e')],_0x139ed3['query']);_0x5578aa['attributes']=_[_0xc42a('0x31')](_0x139ed3['model'],qs[_0xc42a('0x33')](_0x21870c[_0xc42a('0x29')][_0xc42a('0x33')]));_0x5578aa[_0xc42a('0x32')]=_0x5578aa['attributes'][_0xc42a('0x42')]?_0x5578aa[_0xc42a('0x32')]:_0x139ed3[_0xc42a('0x2e')];_0x5578aa[_0xc42a('0x51')]=qs[_0xc42a('0x45')](_0x21870c[_0xc42a('0x29')]['sort']);_0x5578aa[_0xc42a('0x27')]=qs[_0xc42a('0x30')](_[_0xc42a('0x52')](_0x21870c[_0xc42a('0x29')],_0x139ed3[_0xc42a('0x30')]));if(_0x21870c[_0xc42a('0x29')]['filter']){_0x5578aa[_0xc42a('0x27')]=_['merge'](_0x5578aa[_0xc42a('0x27')],{'$or':_[_0xc42a('0x20')](_0x5578aa[_0xc42a('0x32')],function(_0x236843){var _0x1a70ea={};_0x1a70ea[_0x236843]={'$like':'%'+_0x21870c[_0xc42a('0x29')][_0xc42a('0x46')]+'%'};return _0x1a70ea;})});}_0x5578aa=_[_0xc42a('0x35')]({},_0x5578aa,_0x21870c[_0xc42a('0x36')]);return _0x33435b['getTeams'](_0x5578aa);}})[_0xc42a('0x15')](function(_0x42e399){if(_0x42e399){_0x1fb93b=_0x42e399[_0xc42a('0x42')];if(!_0x21870c['query'][_0xc42a('0x43')](_0xc42a('0x44'))){_0x5578aa['limit']=qs[_0xc42a('0x10')](_0x21870c[_0xc42a('0x29')][_0xc42a('0x10')]);_0x5578aa['offset']=qs[_0xc42a('0x12')](_0x21870c[_0xc42a('0x29')][_0xc42a('0x12')]);}return _0x33435b[_0xc42a('0x4f')](_0x5578aa);}})[_0xc42a('0x15')](function(_0xd13a34){if(_0xd13a34){return _0xd13a34?{'count':_0x1fb93b,'rows':_0xd13a34}:null;}})[_0xc42a('0x15')](respondWithResult(_0x204d53,null))['catch'](handleError(_0x204d53,null));};exports['addTeams']=function(_0x56cde6,_0x5a1245){var _0x4a99e0=_0x56cde6[_0xc42a('0x39')]['ids'];return db['Team'][_0xc42a('0x2a')]({'where':{'id':_0x4a99e0},'attributes':['id'],'include':[{'model':db[_0xc42a('0x47')],'as':_0xc42a('0x53'),'attributes':['id',_0xc42a('0x1e'),_0xc42a('0x54'),_0xc42a('0x55'),'interface'],'raw':!![]}]})[_0xc42a('0x15')](function(_0x33ba59){if(_0x33ba59){var _0x20b661=_[_0xc42a('0x56')](_0x33ba59,function(_0x2b9d7a){var _0x49a7cf=_0x2b9d7a[_0xc42a('0x17')]({'plain':!![]});return _0x49a7cf[_0xc42a('0x53')];});return db[_0xc42a('0x21')]['find']({'where':{'id':_0x56cde6[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](function(_0x3233ed){return db[_0xc42a('0x57')]['transaction'](function(_0x335dfa){return _0x3233ed[_0xc42a('0x58')](_0x4a99e0,{'transaction':_0x335dfa})['then'](function(){return BPromise[_0xc42a('0x59')](_0x20b661,function(_0xabf80b){return db['UserOpenchannelQueue'][_0xc42a('0x5a')]({'where':{'UserId':_0xabf80b['id'],'OpenchannelQueueId':_0x56cde6[_0xc42a('0x2d')]['id']},'transaction':_0x335dfa});});})['then'](function(){_0x20b661[_0xc42a('0x5b')](function(_0x361981){socket[_0xc42a('0x5c')]('userOpenchannelQueue:save',{'UserId':_0x361981['id'],'OpenchannelQueueId':_0x3233ed['id']});});});});});}})[_0xc42a('0x15')](respondWithStatusCode(_0x5a1245,null))[_0xc42a('0x2c')](handleError(_0x5a1245,null));};exports['removeTeams']=function(_0x22fe92,_0x3ca67d){return db[_0xc42a('0x50')]['findAll']({'where':{'id':_0x22fe92[_0xc42a('0x29')][_0xc42a('0x5d')]},'attributes':['id'],'include':[{'model':db[_0xc42a('0x47')],'as':_0xc42a('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3ca67d,null))[_0xc42a('0x15')](function(_0xf22386){var _0x5b3f9d=_[_0xc42a('0x20')](_0xf22386,'id');var _0x18cfbe=[];var _0x478805=[];var _0x99038e=squel['select']();_0x99038e['field'](_0xc42a('0x5e'))[_0xc42a('0x5f')](_0xc42a('0x60'),'tq')[_0xc42a('0x61')](_0xc42a('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc42a('0x27')](_0xc42a('0x63'),_0x22fe92[_0xc42a('0x2d')]['id']);for(var _0x2485a3=0x0;_0x2485a3<_0xf22386[_0xc42a('0x42')];_0x2485a3+=0x1){let _0x23621e=_0xf22386[_0x2485a3];for(var _0x386b2f=0x0;_0x386b2f<_0x23621e[_0xc42a('0x53')]['length'];_0x386b2f+=0x1){let _0x865e78=_0x23621e[_0xc42a('0x53')][_0x386b2f];var _0x52749f=_0x99038e[_0xc42a('0x64')]();_0x52749f[_0xc42a('0x27')](_0xc42a('0x65'),_0x865e78['id']);_0x478805['push'](db[_0xc42a('0x57')][_0xc42a('0x29')](_0x52749f[_0xc42a('0x66')](),{'type':db[_0xc42a('0x57')]['QueryTypes'][_0xc42a('0x67')]})[_0xc42a('0x15')](function(_0x36badc){if(_0x36badc['length']===0x1){return _0x865e78['id'];}else{var _0x1ff5a9=_[_0xc42a('0x68')](_[_0xc42a('0x20')](_0x36badc,_0xc42a('0x69')),function(_0x4c5414){return _['includes'](_0x5b3f9d,_0x4c5414);});if(_0x1ff5a9){return _0x865e78['id'];}}}));}}return BPromise[_0xc42a('0x6a')](_0x478805)[_0xc42a('0x15')](function(_0x2d526c){_0x18cfbe=_(_0x18cfbe)[_0xc42a('0x6b')](_0x2d526c)[_0xc42a('0x6c')]()[_0xc42a('0x6d')]();return db['OpenchannelQueue'][_0xc42a('0x37')]({'where':{'id':_0x22fe92['params']['id']}})[_0xc42a('0x15')](function(_0x35206c){return db['sequelize'][_0xc42a('0x6e')](function(_0x3e0775){return _0x35206c[_0xc42a('0x6f')](_0x22fe92[_0xc42a('0x29')][_0xc42a('0x5d')],{'transaction':_0x3e0775})[_0xc42a('0x15')](function(){if(!_[_0xc42a('0x70')](_0x18cfbe)){return _0x35206c['removeAgents'](_0x18cfbe,{'transaction':_0x3e0775});}})[_0xc42a('0x15')](function(){_0x18cfbe[_0xc42a('0x5b')](function(_0x15da2c){socket[_0xc42a('0x5c')](_0xc42a('0x71'),{'UserId':_0x15da2c,'OpenchannelQueueId':_0x35206c['id']});});});});});});})[_0xc42a('0x15')](respondWithStatusCode(_0x3ca67d,null))[_0xc42a('0x2c')](handleError(_0x3ca67d,null));};exports[_0xc42a('0x72')]=function(_0xc9313b,_0x54bc86){return db['OpenchannelQueue']['find']({'where':{'id':_0xc9313b[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x54bc86,null))[_0xc42a('0x15')](function(_0x5391a4){if(_0x5391a4){return _0x5391a4[_0xc42a('0x72')](_0xc9313b['body'][_0xc42a('0x5d')],_['omit'](_0xc9313b[_0xc42a('0x39')],[_0xc42a('0x5d'),'id'])||{})['spread'](function(_0x1a6590){for(var _0x2b8cde=0x0;_0x2b8cde<_0xc9313b[_0xc42a('0x39')]['ids'][_0xc42a('0x42')];_0x2b8cde+=0x1){socket[_0xc42a('0x5c')](_0xc42a('0x73'),{'UserId':Number(_0xc9313b[_0xc42a('0x39')][_0xc42a('0x5d')][_0x2b8cde]),'OpenchannelQueueId':Number(_0xc9313b[_0xc42a('0x2d')]['id'])});}return _0x1a6590;});}})[_0xc42a('0x15')](respondWithResult(_0x54bc86,null))['catch'](handleError(_0x54bc86,null));};exports[_0xc42a('0x74')]=function(_0x2b13fd,_0x44c6ef){return db[_0xc42a('0x21')][_0xc42a('0x37')]({'where':{'id':_0x2b13fd[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x44c6ef,null))[_0xc42a('0x15')](function(_0x426962){if(_0x426962){return _0x426962['removeAgents'](_0x2b13fd[_0xc42a('0x29')][_0xc42a('0x5d')])[_0xc42a('0x15')](function(){if(_[_0xc42a('0x75')](_0x2b13fd[_0xc42a('0x29')][_0xc42a('0x5d')])){for(var _0x4ae068=0x0;_0x4ae068<_0x2b13fd[_0xc42a('0x29')]['ids'][_0xc42a('0x42')];_0x4ae068+=0x1){socket[_0xc42a('0x5c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2b13fd[_0xc42a('0x29')]['ids'][_0x4ae068]),'OpenchannelQueueId':Number(_0x2b13fd[_0xc42a('0x2d')]['id'])});}}else{socket[_0xc42a('0x5c')](_0xc42a('0x71'),{'UserId':Number(_0x2b13fd['query'][_0xc42a('0x5d')]),'OpenchannelQueueId':Number(_0x2b13fd[_0xc42a('0x2d')]['id'])});}});}})[_0xc42a('0x15')](respondWithStatusCode(_0x44c6ef,null))[_0xc42a('0x2c')](handleError(_0x44c6ef,null));};exports['getAgents']=function(_0x3c7991,_0x54fb22){var _0x17af3d={};var _0x4b47de={};var _0x4e9574;var _0x5be72f;return db['OpenchannelQueue'][_0xc42a('0x40')]({'where':{'id':_0x3c7991[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x54fb22,null))[_0xc42a('0x15')](function(_0x2f0024){if(_0x2f0024){_0x4e9574=_0x2f0024;_0x4b47de[_0xc42a('0x2e')]=_[_0xc42a('0x2f')](db[_0xc42a('0x47')]['rawAttributes']);_0x4b47de[_0xc42a('0x29')]=_[_0xc42a('0x2f')](_0x3c7991[_0xc42a('0x29')]);_0x4b47de[_0xc42a('0x30')]=_[_0xc42a('0x31')](_0x4b47de[_0xc42a('0x2e')],_0x4b47de[_0xc42a('0x29')]);_0x17af3d[_0xc42a('0x32')]=_['intersection'](_0x4b47de['model'],qs[_0xc42a('0x33')](_0x3c7991[_0xc42a('0x29')]['fields']));_0x17af3d[_0xc42a('0x32')]=_0x17af3d['attributes'][_0xc42a('0x42')]?_0x17af3d[_0xc42a('0x32')]:_0x4b47de['model'];_0x17af3d[_0xc42a('0x51')]=qs[_0xc42a('0x45')](_0x3c7991[_0xc42a('0x29')]['sort']);_0x17af3d['where']=qs[_0xc42a('0x30')](_['pick'](_0x3c7991[_0xc42a('0x29')],_0x4b47de['filters']));if(_0x3c7991[_0xc42a('0x29')][_0xc42a('0x46')]){_0x17af3d['where']=_['merge'](_0x17af3d[_0xc42a('0x27')],{'$or':_[_0xc42a('0x20')](_0x17af3d[_0xc42a('0x32')],function(_0x4bdd25){var _0x556b3e={};_0x556b3e[_0x4bdd25]={'$like':'%'+_0x3c7991[_0xc42a('0x29')]['filter']+'%'};return _0x556b3e;})});}_0x17af3d=_[_0xc42a('0x35')]({},_0x17af3d,_0x3c7991[_0xc42a('0x36')]);return _0x4e9574[_0xc42a('0x76')](_0x17af3d);}})[_0xc42a('0x15')](function(_0x99369){if(_0x99369){_0x5be72f=_0x99369[_0xc42a('0x42')];if(!_0x3c7991[_0xc42a('0x29')]['hasOwnProperty'](_0xc42a('0x44'))){_0x17af3d[_0xc42a('0x10')]=qs['limit'](_0x3c7991[_0xc42a('0x29')][_0xc42a('0x10')]);_0x17af3d[_0xc42a('0x12')]=qs[_0xc42a('0x12')](_0x3c7991[_0xc42a('0x29')][_0xc42a('0x12')]);}return _0x4e9574[_0xc42a('0x76')](_0x17af3d);}})[_0xc42a('0x15')](function(_0x4c2dc5){if(_0x4c2dc5){return _0x4c2dc5?{'count':_0x5be72f,'rows':_0x4c2dc5}:null;}})[_0xc42a('0x15')](respondWithResult(_0x54fb22,null))[_0xc42a('0x2c')](handleError(_0x54fb22,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8e10fdc..d04a2d9 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 _0x66f4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66f4,0x184));var _0x466f=function(_0x3d5294,_0x375377){_0x3d5294=_0x3d5294-0x0;var _0x2a4766=_0x66f4[_0x3d5294];return _0x2a4766;};'use strict';var EventEmitter=require(_0x466f('0x0'));var OpenchannelQueue=require(_0x466f('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x466f('0x2')](0x0);var events={'afterCreate':_0x466f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21b9dc){return function(_0x590def,_0x18a865,_0x197192){OpenchannelQueueEvents[_0x466f('0x4')](_0x21b9dc+':'+_0x590def['id'],_0x590def);OpenchannelQueueEvents[_0x466f('0x4')](_0x21b9dc,_0x590def);_0x197192(null);};}for(var e in events){if(events[_0x466f('0x5')](e)){var event=events[e];OpenchannelQueue[_0x466f('0x6')](e,emitEvent(event));}}module[_0x466f('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x27de=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x27de,0x148));var _0xe27d=function(_0x181e32,_0x5ce863){_0x181e32=_0x181e32-0x0;var _0x15ad23=_0x27de[_0x181e32];return _0x15ad23;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xe27d('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe27d('0x1'),'afterUpdate':'update','afterDestroy':_0xe27d('0x2')};function emitEvent(_0x554839){return function(_0x235a40,_0xe9639c,_0x56015a){OpenchannelQueueEvents['emit'](_0x554839+':'+_0x235a40['id'],_0x235a40);OpenchannelQueueEvents[_0xe27d('0x3')](_0x554839,_0x235a40);_0x56015a(null);};}for(var e in events){if(events[_0xe27d('0x4')](e)){var event=events[e];OpenchannelQueue[_0xe27d('0x5')](e,emitEvent(event));}}module[_0xe27d('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 49bf57f..8c95030 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 _0xf806=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a0944,_0x417cbb){var _0x294f6a=function(_0x2b42c6){while(--_0x2b42c6){_0x3a0944['push'](_0x3a0944['shift']());}};_0x294f6a(++_0x417cbb);}(_0xf806,0x173));var _0x6f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf806[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6f80('0x0'));var util=require(_0x6f80('0x1'));var logger=require(_0x6f80('0x2'))(_0x6f80('0x3'));var moment=require(_0x6f80('0x4'));var BPromise=require(_0x6f80('0x5'));var rp=require(_0x6f80('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f80('0x7'));var config=require(_0x6f80('0x8'));var attributes=require(_0x6f80('0x9'));module[_0x6f80('0xa')]=function(_0x3b59a4,_0xe4eb7c){return _0x3b59a4[_0x6f80('0xb')](_0x6f80('0xc'),attributes,{'tableName':_0x6f80('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1728=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','moment'];(function(_0x19318e,_0x46c067){var _0x425540=function(_0xb4e055){while(--_0xb4e055){_0x19318e['push'](_0x19318e['shift']());}};_0x425540(++_0x46c067);}(_0x1728,0x129));var _0x8172=function(_0x148077,_0x1789af){_0x148077=_0x148077-0x0;var _0x21019e=_0x1728[_0x148077];return _0x21019e;};'use strict';var _=require('lodash');var util=require(_0x8172('0x0'));var logger=require(_0x8172('0x1'))('api');var moment=require(_0x8172('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8172('0x3'));var config=require(_0x8172('0x4'));var attributes=require(_0x8172('0x5'));module[_0x8172('0x6')]=function(_0x13d023,_0x2b1dc5){return _0x13d023[_0x8172('0x7')](_0x8172('0x8'),attributes,{'tableName':_0x8172('0x9'),'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 b547273..cc39437 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 _0x6030=['redis','defaults','socket.io-emitter','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','attributes','limit','include','model','map','then','info','find','where','ShowOpenchannelQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x58d446,_0x16d502){var _0x55dc47=function(_0x8202d){while(--_0x8202d){_0x58d446['push'](_0x58d446['shift']());}};_0x55dc47(++_0x16d502);}(_0x6030,0x1a2));var _0x0603=function(_0x5c4101,_0x1abc69){_0x5c4101=_0x5c4101-0x0;var _0x591601=_0x6030[_0x5c4101];return _0x591601;};'use strict';var _=require('lodash');var util=require(_0x0603('0x0'));var moment=require(_0x0603('0x1'));var BPromise=require(_0x0603('0x2'));var rs=require(_0x0603('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0603('0x4'))['db'];var utils=require(_0x0603('0x5'));var logger=require('../../config/logger')(_0x0603('0x6'));var config=require(_0x0603('0x7'));var jayson=require(_0x0603('0x8'));var client=jayson[_0x0603('0x9')][_0x0603('0xa')]({'port':0x232a});config[_0x0603('0xb')]=_[_0x0603('0xc')](config[_0x0603('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0603('0xd'))(new Redis(config[_0x0603('0xb')]));require('./openchannelQueue.socket')[_0x0603('0xe')](socket);function respondWithRpcPromise(_0x5691ae,_0x417636,_0x42915a){return new BPromise(function(_0x1a6dad,_0x5ab655){return client[_0x0603('0xf')](_0x5691ae,_0x42915a)['then'](function(_0x312251){logger['info'](_0x0603('0x10'),_0x417636,_0x0603('0x11'));logger[_0x0603('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x417636,_0x0603('0x11'),JSON[_0x0603('0x13')](_0x312251));if(_0x312251['error']){if(_0x312251[_0x0603('0x14')][_0x0603('0x15')]===0x1f4){logger[_0x0603('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x417636,_0x312251[_0x0603('0x14')][_0x0603('0x16')]);return _0x5ab655(_0x312251[_0x0603('0x14')]['message']);}logger['error'](_0x0603('0x10'),_0x417636,_0x312251['error'][_0x0603('0x16')]);return _0x1a6dad(_0x312251[_0x0603('0x14')][_0x0603('0x16')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x417636,_0x0603('0x11'));_0x1a6dad(_0x312251[_0x0603('0x17')][_0x0603('0x16')]);}})[_0x0603('0x18')](function(_0x198946){logger[_0x0603('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x417636,_0x198946);_0x5ab655(_0x198946);});});}exports[_0x0603('0x19')]=function(_0x49475b){var _0x1c0753=this;return new Promise(function(_0x67ec0a,_0x185541){return db[_0x0603('0x1a')]['findAll']({'raw':_0x49475b[_0x0603('0x1b')]?_0x49475b[_0x0603('0x1b')][_0x0603('0x1c')]===undefined?!![]:![]:!![],'where':_0x49475b[_0x0603('0x1b')]?_0x49475b[_0x0603('0x1b')]['where']||null:null,'attributes':_0x49475b[_0x0603('0x1b')]?_0x49475b[_0x0603('0x1b')][_0x0603('0x1d')]||null:null,'limit':_0x49475b[_0x0603('0x1b')]?_0x49475b[_0x0603('0x1b')][_0x0603('0x1e')]||null:null,'include':_0x49475b[_0x0603('0x1b')]?_0x49475b[_0x0603('0x1b')][_0x0603('0x1f')]?_['map'](_0x49475b[_0x0603('0x1b')]['include'],function(_0x57b957){return{'model':db[_0x57b957[_0x0603('0x20')]],'as':_0x57b957['as'],'attributes':_0x57b957[_0x0603('0x1d')],'include':_0x57b957[_0x0603('0x1f')]?_[_0x0603('0x21')](_0x57b957[_0x0603('0x1f')],function(_0x164017){return{'model':db[_0x164017[_0x0603('0x20')]],'as':_0x164017['as'],'attributes':_0x164017[_0x0603('0x1d')],'include':_0x164017['include']?_[_0x0603('0x21')](_0x164017[_0x0603('0x1f')],function(_0x2fc5f4){return{'model':db[_0x2fc5f4['model']],'as':_0x2fc5f4['as'],'attributes':_0x2fc5f4[_0x0603('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0603('0x22')](function(_0x2bcc79){logger[_0x0603('0x23')]('GetOpenchannelQueue',_0x49475b);logger[_0x0603('0x12')](_0x0603('0x19'),_0x49475b,JSON['stringify'](_0x2bcc79));_0x67ec0a(_0x2bcc79);})[_0x0603('0x18')](function(_0x1922f1){logger['error'](_0x0603('0x19'),_0x1922f1[_0x0603('0x16')],_0x49475b);_0x185541(_0x1c0753[_0x0603('0x14')](0x1f4,_0x1922f1[_0x0603('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x33231a){var _0x2b845e=this;return new Promise(function(_0x143b69,_0x11db22){return db['OpenchannelQueue'][_0x0603('0x24')]({'raw':_0x33231a[_0x0603('0x1b')]?_0x33231a[_0x0603('0x1b')][_0x0603('0x1c')]===undefined?!![]:![]:!![],'where':_0x33231a[_0x0603('0x1b')]?_0x33231a['options'][_0x0603('0x25')]||null:null,'attributes':_0x33231a['options']?_0x33231a[_0x0603('0x1b')][_0x0603('0x1d')]||null:null,'include':_0x33231a['options']?_0x33231a[_0x0603('0x1b')][_0x0603('0x1f')]?_[_0x0603('0x21')](_0x33231a[_0x0603('0x1b')]['include'],function(_0x3b5571){return{'model':db[_0x3b5571[_0x0603('0x20')]],'as':_0x3b5571['as'],'attributes':_0x3b5571[_0x0603('0x1d')],'include':_0x3b5571['include']?_[_0x0603('0x21')](_0x3b5571[_0x0603('0x1f')],function(_0x375ba8){return{'model':db[_0x375ba8['model']],'as':_0x375ba8['as'],'attributes':_0x375ba8[_0x0603('0x1d')],'include':_0x375ba8[_0x0603('0x1f')]?_['map'](_0x375ba8[_0x0603('0x1f')],function(_0x1da5c1){return{'model':db[_0x1da5c1[_0x0603('0x20')]],'as':_0x1da5c1['as'],'attributes':_0x1da5c1[_0x0603('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0603('0x22')](function(_0x4ab224){logger[_0x0603('0x23')](_0x0603('0x26'),_0x33231a);logger['debug'](_0x0603('0x26'),_0x33231a,JSON[_0x0603('0x13')](_0x4ab224));_0x143b69(_0x4ab224);})['catch'](function(_0xd937bb){logger[_0x0603('0x14')]('ShowOpenchannelQueue',_0xd937bb[_0x0603('0x16')],_0x33231a);_0x11db22(_0x2b845e[_0x0603('0x14')](0x1f4,_0xd937bb[_0x0603('0x16')]));});});}; \ No newline at end of file +var _0xf7c7=['error','OpenchannelQueue,\x20%s,\x20%s','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4927fb,_0x3636d1){var _0x2224d9=function(_0x17ccc5){while(--_0x17ccc5){_0x4927fb['push'](_0x4927fb['shift']());}};_0x2224d9(++_0x3636d1);}(_0xf7c7,0x1f2));var _0x7f7c=function(_0x3311a4,_0x1e312c){_0x3311a4=_0x3311a4-0x0;var _0x5e0c86=_0xf7c7[_0x3311a4];return _0x5e0c86;};'use strict';var _=require(_0x7f7c('0x0'));var util=require(_0x7f7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f7c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f7c('0x4'))(_0x7f7c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7f7c('0x6')]({'port':0x232a});config[_0x7f7c('0x7')]=_[_0x7f7c('0x8')](config[_0x7f7c('0x7')],{'host':_0x7f7c('0x9'),'port':0x18eb});var socket=require(_0x7f7c('0xa'))(new Redis(config['redis']));require(_0x7f7c('0xb'))[_0x7f7c('0xc')](socket);function respondWithRpcPromise(_0xc59ab7,_0x19a319,_0xfac39){return new BPromise(function(_0x53c26a,_0x410f6e){return client[_0x7f7c('0xd')](_0xc59ab7,_0xfac39)[_0x7f7c('0xe')](function(_0x374fed){logger[_0x7f7c('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x19a319,'request\x20sent');logger[_0x7f7c('0x10')](_0x7f7c('0x11'),_0x19a319,_0x7f7c('0x12'),JSON[_0x7f7c('0x13')](_0x374fed));if(_0x374fed[_0x7f7c('0x14')]){if(_0x374fed[_0x7f7c('0x14')]['code']===0x1f4){logger[_0x7f7c('0x14')](_0x7f7c('0x15'),_0x19a319,_0x374fed[_0x7f7c('0x14')][_0x7f7c('0x16')]);return _0x410f6e(_0x374fed['error'][_0x7f7c('0x16')]);}logger[_0x7f7c('0x14')](_0x7f7c('0x15'),_0x19a319,_0x374fed[_0x7f7c('0x14')][_0x7f7c('0x16')]);return _0x53c26a(_0x374fed[_0x7f7c('0x14')][_0x7f7c('0x16')]);}else{logger[_0x7f7c('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x19a319,'request\x20sent');_0x53c26a(_0x374fed[_0x7f7c('0x17')][_0x7f7c('0x16')]);}})['catch'](function(_0x199940){logger[_0x7f7c('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x19a319,_0x199940);_0x410f6e(_0x199940);});});}exports[_0x7f7c('0x18')]=function(_0x340cef){var _0x3ea99a=this;return new Promise(function(_0x76f835,_0x1ae032){return db[_0x7f7c('0x19')][_0x7f7c('0x1a')]({'raw':_0x340cef[_0x7f7c('0x1b')]?_0x340cef['options'][_0x7f7c('0x1c')]===undefined?!![]:![]:!![],'where':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x1d')]||null:null,'attributes':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x1e')]||null:null,'limit':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x1f')]||null:null,'include':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x20')]?_[_0x7f7c('0x21')](_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x20')],function(_0x1a9fdd){return{'model':db[_0x1a9fdd[_0x7f7c('0x22')]],'as':_0x1a9fdd['as'],'attributes':_0x1a9fdd[_0x7f7c('0x1e')],'include':_0x1a9fdd['include']?_[_0x7f7c('0x21')](_0x1a9fdd[_0x7f7c('0x20')],function(_0x44ee39){return{'model':db[_0x44ee39[_0x7f7c('0x22')]],'as':_0x44ee39['as'],'attributes':_0x44ee39[_0x7f7c('0x1e')],'include':_0x44ee39['include']?_[_0x7f7c('0x21')](_0x44ee39[_0x7f7c('0x20')],function(_0x3f9483){return{'model':db[_0x3f9483[_0x7f7c('0x22')]],'as':_0x3f9483['as'],'attributes':_0x3f9483[_0x7f7c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x423bc2){logger[_0x7f7c('0xf')](_0x7f7c('0x18'),_0x340cef);logger[_0x7f7c('0x10')](_0x7f7c('0x18'),_0x340cef,JSON[_0x7f7c('0x13')](_0x423bc2));_0x76f835(_0x423bc2);})[_0x7f7c('0x23')](function(_0x149a3a){logger[_0x7f7c('0x14')]('GetOpenchannelQueue',_0x149a3a[_0x7f7c('0x16')],_0x340cef);_0x1ae032(_0x3ea99a[_0x7f7c('0x14')](0x1f4,_0x149a3a[_0x7f7c('0x16')]));});});};exports[_0x7f7c('0x24')]=function(_0x35477e){var _0x25c2c3=this;return new Promise(function(_0x35b29b,_0x565991){return db['OpenchannelQueue']['find']({'raw':_0x35477e[_0x7f7c('0x1b')]?_0x35477e[_0x7f7c('0x1b')][_0x7f7c('0x1c')]===undefined?!![]:![]:!![],'where':_0x35477e[_0x7f7c('0x1b')]?_0x35477e['options']['where']||null:null,'attributes':_0x35477e['options']?_0x35477e[_0x7f7c('0x1b')][_0x7f7c('0x1e')]||null:null,'include':_0x35477e[_0x7f7c('0x1b')]?_0x35477e['options'][_0x7f7c('0x20')]?_[_0x7f7c('0x21')](_0x35477e[_0x7f7c('0x1b')]['include'],function(_0x2262d7){return{'model':db[_0x2262d7[_0x7f7c('0x22')]],'as':_0x2262d7['as'],'attributes':_0x2262d7[_0x7f7c('0x1e')],'include':_0x2262d7[_0x7f7c('0x20')]?_['map'](_0x2262d7[_0x7f7c('0x20')],function(_0x2ca243){return{'model':db[_0x2ca243[_0x7f7c('0x22')]],'as':_0x2ca243['as'],'attributes':_0x2ca243[_0x7f7c('0x1e')],'include':_0x2ca243[_0x7f7c('0x20')]?_[_0x7f7c('0x21')](_0x2ca243[_0x7f7c('0x20')],function(_0x1b8f7e){return{'model':db[_0x1b8f7e['model']],'as':_0x1b8f7e['as'],'attributes':_0x1b8f7e[_0x7f7c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7f7c('0xe')](function(_0x1623c6){logger[_0x7f7c('0xf')](_0x7f7c('0x24'),_0x35477e);logger['debug'](_0x7f7c('0x24'),_0x35477e,JSON[_0x7f7c('0x13')](_0x1623c6));_0x35b29b(_0x1623c6);})['catch'](function(_0x291ade){logger['error'](_0x7f7c('0x24'),_0x291ade[_0x7f7c('0x16')],_0x35477e);_0x565991(_0x25c2c3['error'](0x1f4,_0x291ade[_0x7f7c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 39373bb..6a1f195 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 _0x5314=['remove','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x589190,_0x5eff74){var _0x2b68f9=function(_0x3e956f){while(--_0x3e956f){_0x589190['push'](_0x589190['shift']());}};_0x2b68f9(++_0x5eff74);}(_0x5314,0x194));var _0x4531=function(_0x17d178,_0x32a116){_0x17d178=_0x17d178-0x0;var _0x58b73c=_0x5314[_0x17d178];return _0x58b73c;};'use strict';var OpenchannelQueueEvents=require(_0x4531('0x0'));var events=[_0x4531('0x1'),_0x4531('0x2'),'update'];function createListener(_0x3e2b8f,_0x359629){return function(_0x44e8b0){_0x359629[_0x4531('0x3')](_0x3e2b8f,_0x44e8b0);};}function removeListener(_0x11de06,_0x5ee3b4){return function(){OpenchannelQueueEvents[_0x4531('0x4')](_0x11de06,_0x5ee3b4);};}exports[_0x4531('0x5')]=function(_0xae918e){for(var _0x542c9a=0x0,_0xa75be5=events['length'];_0x542c9a<_0xa75be5;_0x542c9a++){var _0x328d0d=events[_0x542c9a];var _0x1132e0=createListener(_0x4531('0x6')+_0x328d0d,_0xae918e);OpenchannelQueueEvents['on'](_0x328d0d,_0x1132e0);}}; \ No newline at end of file +var _0x2813=['length','openchannelQueue:','save','remove','update','removeListener'];(function(_0x155d46,_0x449942){var _0xc4def1=function(_0x3a49f7){while(--_0x3a49f7){_0x155d46['push'](_0x155d46['shift']());}};_0xc4def1(++_0x449942);}(_0x2813,0x6e));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x3281('0x0'),_0x3281('0x1'),_0x3281('0x2')];function createListener(_0x5be05a,_0x1df386){return function(_0xa382c6){_0x1df386['emit'](_0x5be05a,_0xa382c6);};}function removeListener(_0x1d5525,_0x1686ae){return function(){OpenchannelQueueEvents[_0x3281('0x3')](_0x1d5525,_0x1686ae);};}exports['register']=function(_0x311b4b){for(var _0x416223=0x0,_0xbe4263=events[_0x3281('0x4')];_0x416223<_0xbe4263;_0x416223++){var _0xf5b36e=events[_0x416223];var _0x5d594b=createListener(_0x3281('0x5')+_0xf5b36e,_0x311b4b);OpenchannelQueueEvents['on'](_0xf5b36e,_0x5d594b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3912abd..4a723be 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 _0x8738=['get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8738,0xbe));var _0x8873=function(_0x172f30,_0x42939a){_0x172f30=_0x172f30-0x0;var _0x401a61=_0x8738[_0x172f30];return _0x401a61;};'use strict';var multer=require(_0x8873('0x0'));var util=require('util');var path=require(_0x8873('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8873('0x2')]();var fs_extra=require(_0x8873('0x3'));var auth=require(_0x8873('0x4'));var interaction=require(_0x8873('0x5'));var config=require(_0x8873('0x6'));var controller=require(_0x8873('0x7'));router[_0x8873('0x8')]('/',auth['isAuthenticated'](),controller[_0x8873('0x9')]);router[_0x8873('0x8')](_0x8873('0xa'),auth['isAuthenticated'](),controller[_0x8873('0xb')]);router['get'](_0x8873('0xc'),auth[_0x8873('0xd')](),controller[_0x8873('0xe')]);router[_0x8873('0xf')]('/',auth['isAuthenticated'](),controller[_0x8873('0x10')]);router[_0x8873('0x11')](_0x8873('0xc'),auth[_0x8873('0xd')](),controller[_0x8873('0x12')]);router[_0x8873('0x13')]('/:id',auth[_0x8873('0xd')](),controller[_0x8873('0x14')]);module[_0x8873('0x15')]=router; \ No newline at end of file +var _0x49b0=['get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x56ffec,_0x10a357){var _0x5a9004=function(_0x245a82){while(--_0x245a82){_0x56ffec['push'](_0x56ffec['shift']());}};_0x5a9004(++_0x10a357);}(_0x49b0,0x173));var _0x049b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x49b0[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x049b('0x0'));var util=require(_0x049b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x049b('0x2'));var router=express[_0x049b('0x3')]();var fs_extra=require(_0x049b('0x4'));var auth=require(_0x049b('0x5'));var interaction=require(_0x049b('0x6'));var config=require(_0x049b('0x7'));var controller=require(_0x049b('0x8'));router[_0x049b('0x9')]('/',auth[_0x049b('0xa')](),controller[_0x049b('0xb')]);router['get']('/describe',auth[_0x049b('0xa')](),controller['describe']);router[_0x049b('0x9')](_0x049b('0xc'),auth[_0x049b('0xa')](),controller[_0x049b('0xd')]);router['post']('/',auth[_0x049b('0xa')](),controller['create']);router[_0x049b('0xe')](_0x049b('0xc'),auth['isAuthenticated'](),controller[_0x049b('0xf')]);router[_0x049b('0x10')](_0x049b('0xc'),auth[_0x049b('0xa')](),controller[_0x049b('0x11')]);module[_0x049b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a894b1c..88ef5b2 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 _0x2982=['DATE','moment','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2982,0x8d));var _0x2298=function(_0x55f516,_0x49aef2){_0x55f516=_0x55f516-0x0;var _0xf1db01=_0x2982[_0x55f516];return _0xf1db01;};'use strict';var moment=require(_0x2298('0x0'));var Sequelize=require('sequelize');module[_0x2298('0x1')]={'uniqueid':{'type':Sequelize[_0x2298('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2298('0x2')]},'joinAt':{'type':Sequelize[_0x2298('0x3')]},'leaveAt':{'type':Sequelize[_0x2298('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2298('0x3')]},'reason':{'type':Sequelize[_0x2298('0x2')]}}; \ No newline at end of file +var _0x155e=['DATE','moment','sequelize','exports','STRING'];(function(_0x198247,_0x491c12){var _0x2b18bc=function(_0x4a43e2){while(--_0x4a43e2){_0x198247['push'](_0x198247['shift']());}};_0x2b18bc(++_0x491c12);}(_0x155e,0x9c));var _0xe155=function(_0x5e624f,_0x393089){_0x5e624f=_0x5e624f-0x0;var _0x3c5d04=_0x155e[_0x5e624f];return _0x3c5d04;};'use strict';var moment=require(_0xe155('0x0'));var Sequelize=require(_0xe155('0x1'));module[_0xe155('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe155('0x3')]},'joinAt':{'type':Sequelize[_0xe155('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe155('0x4')]},'exitAt':{'type':Sequelize[_0xe155('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 391dff9..9fc0b26 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 _0x74ec=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','attributes','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','rawAttributes','intersection','length','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x74ec,0x168));var _0xc74e=function(_0x529720,_0x4304e2){_0x529720=_0x529720-0x0;var _0x5a3d94=_0x74ec[_0x529720];return _0x5a3d94;};'use strict';var emlformat=require(_0xc74e('0x0'));var rimraf=require(_0xc74e('0x1'));var zipdir=require(_0xc74e('0x2'));var jsonpatch=require(_0xc74e('0x3'));var rp=require('request-promise');var moment=require(_0xc74e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc74e('0x5'));var util=require('util');var path=require(_0xc74e('0x6'));var sox=require(_0xc74e('0x7'));var csv=require(_0xc74e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc74e('0x9'));var _=require(_0xc74e('0xa'));var squel=require(_0xc74e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc74e('0xc'));var deskjs=require(_0xc74e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc74e('0xe'));var Papa=require(_0xc74e('0xf'));var Redis=require('ioredis');var authService=require(_0xc74e('0x10'));var qs=require(_0xc74e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc74e('0x12'));var logger=require('../../config/logger')(_0xc74e('0x13'));var utils=require(_0xc74e('0x14'));var config=require(_0xc74e('0x15'));var licenseUtil=require(_0xc74e('0x16'));var db=require(_0xc74e('0x17'))['db'];function respondWithStatusCode(_0xca54d1,_0xc3ec15){_0xc3ec15=_0xc3ec15||0xcc;return function(_0x5cfd46){if(_0x5cfd46){return _0xca54d1[_0xc74e('0x18')](_0xc3ec15);}return _0xca54d1['status'](_0xc3ec15)[_0xc74e('0x19')]();};}function respondWithResult(_0x33b21b,_0x403437){_0x403437=_0x403437||0xc8;return function(_0x2d50f1){if(_0x2d50f1){return _0x33b21b[_0xc74e('0x1a')](_0x403437)[_0xc74e('0x1b')](_0x2d50f1);}};}function respondWithFilteredResult(_0x397755,_0x3bebb0){return function(_0x3a936b){if(_0x3a936b){var _0x4f45e5=typeof _0x3bebb0[_0xc74e('0x1c')]===_0xc74e('0x1d')&&typeof _0x3bebb0[_0xc74e('0x1e')]===_0xc74e('0x1d');var _0x3cca1a=_0x3a936b['count'];var _0x357a0b=_0x4f45e5?0x0:_0x3bebb0[_0xc74e('0x1c')];var _0x20654b=_0x4f45e5?_0x3a936b['count']:_0x3bebb0['offset']+_0x3bebb0[_0xc74e('0x1e')];var _0x5146f5;if(_0x20654b>=_0x3cca1a){_0x20654b=_0x3cca1a;_0x5146f5=0xc8;}else{_0x5146f5=0xce;}_0x397755[_0xc74e('0x1a')](_0x5146f5);return _0x397755[_0xc74e('0x1f')](_0xc74e('0x20'),_0x357a0b+'-'+_0x20654b+'/'+_0x3cca1a)[_0xc74e('0x1b')](_0x3a936b);}return null;};}function patchUpdates(_0x5677ac){return function(_0x19946f){try{jsonpatch[_0xc74e('0x21')](_0x19946f,_0x5677ac,!![]);}catch(_0x2297d7){return BPromise[_0xc74e('0x22')](_0x2297d7);}return _0x19946f[_0xc74e('0x23')]();};}function saveUpdates(_0x2b9d9f,_0x388189){return function(_0x3a35b3){if(_0x3a35b3){return _0x3a35b3[_0xc74e('0x24')](_0x2b9d9f)[_0xc74e('0x25')](function(_0x597c3f){return _0x597c3f;});}return null;};}function removeEntity(_0x3cef61,_0x33a08e){return function(_0x3e6ecd){if(_0x3e6ecd){return _0x3e6ecd['destroy']()['then'](function(){_0x3cef61[_0xc74e('0x1a')](0xcc)[_0xc74e('0x19')]();});}};}function handleEntityNotFound(_0x347d0a,_0x340fee){return function(_0x513cb6){if(!_0x513cb6){_0x347d0a[_0xc74e('0x18')](0x194);}return _0x513cb6;};}function handleError(_0x26acf1,_0x2b72e8){_0x2b72e8=_0x2b72e8||0x1f4;return function(_0xe9f3b2){logger['error'](_0xe9f3b2[_0xc74e('0x26')]);if(_0xe9f3b2['name']){delete _0xe9f3b2[_0xc74e('0x27')];}_0x26acf1['status'](_0x2b72e8)['send'](_0xe9f3b2);};}exports[_0xc74e('0x28')]=function(_0x501611,_0x27e0d4){var _0x256e98={},_0x40ed64={},_0x329a5c={'count':0x0,'rows':[]};var _0x168464=_[_0xc74e('0x29')](db[_0xc74e('0x2a')]['rawAttributes'],function(_0x22d7c9){return{'name':_0x22d7c9[_0xc74e('0x2b')],'type':_0x22d7c9[_0xc74e('0x2c')][_0xc74e('0x2d')]};});_0x40ed64[_0xc74e('0x2e')]=_[_0xc74e('0x29')](_0x168464,_0xc74e('0x27'));_0x40ed64[_0xc74e('0x2f')]=_[_0xc74e('0x30')](_0x501611[_0xc74e('0x2f')]);_0x40ed64[_0xc74e('0x31')]=_['intersection'](_0x40ed64[_0xc74e('0x2e')],_0x40ed64[_0xc74e('0x2f')]);_0x256e98[_0xc74e('0x32')]=_['intersection'](_0x40ed64[_0xc74e('0x2e')],qs['fields'](_0x501611[_0xc74e('0x2f')]['fields']));_0x256e98[_0xc74e('0x32')]=_0x256e98[_0xc74e('0x32')]['length']?_0x256e98['attributes']:_0x40ed64[_0xc74e('0x2e')];if(!_0x501611[_0xc74e('0x2f')][_0xc74e('0x33')]('nolimit')){_0x256e98[_0xc74e('0x1e')]=qs[_0xc74e('0x1e')](_0x501611[_0xc74e('0x2f')][_0xc74e('0x1e')]);_0x256e98[_0xc74e('0x1c')]=qs['offset'](_0x501611[_0xc74e('0x2f')]['offset']);}_0x256e98[_0xc74e('0x34')]=qs[_0xc74e('0x35')](_0x501611[_0xc74e('0x2f')][_0xc74e('0x35')]);_0x256e98['where']=qs[_0xc74e('0x31')](_[_0xc74e('0x36')](_0x501611[_0xc74e('0x2f')],_0x40ed64[_0xc74e('0x31')]),_0x168464);if(_0x501611['query']['filter']){_0x256e98[_0xc74e('0x37')]=_[_0xc74e('0x38')](_0x256e98[_0xc74e('0x37')],{'$or':_[_0xc74e('0x29')](_0x168464,function(_0x217ad3){if(_0x217ad3[_0xc74e('0x2c')]!==_0xc74e('0x39')){var _0x316566={};_0x316566[_0x217ad3['name']]={'$like':'%'+_0x501611['query'][_0xc74e('0x3a')]+'%'};return _0x316566;}})});}_0x256e98=_[_0xc74e('0x38')]({},_0x256e98,_0x501611[_0xc74e('0x3b')]);var _0x40ca89={'where':_0x256e98[_0xc74e('0x37')]};return db['OpenchannelQueueReport'][_0xc74e('0x3c')](_0x40ca89)[_0xc74e('0x25')](function(_0x37acb4){_0x329a5c[_0xc74e('0x3c')]=_0x37acb4;if(_0x501611[_0xc74e('0x2f')][_0xc74e('0x3d')]){_0x256e98[_0xc74e('0x3e')]=[{'all':!![]}];}return db[_0xc74e('0x2a')][_0xc74e('0x3f')](_0x256e98);})[_0xc74e('0x25')](function(_0x3b3044){_0x329a5c['rows']=_0x3b3044;return _0x329a5c;})['then'](respondWithFilteredResult(_0x27e0d4,_0x256e98))[_0xc74e('0x40')](handleError(_0x27e0d4,null));};exports[_0xc74e('0x41')]=function(_0x4797d9,_0x39e636){var _0x5609c3={'raw':!![],'where':{'id':_0x4797d9['params']['id']}},_0x4ce9d5={};_0x4ce9d5[_0xc74e('0x2e')]=_[_0xc74e('0x30')](db['OpenchannelQueueReport'][_0xc74e('0x42')]);_0x4ce9d5[_0xc74e('0x2f')]=_[_0xc74e('0x30')](_0x4797d9['query']);_0x4ce9d5[_0xc74e('0x31')]=_[_0xc74e('0x43')](_0x4ce9d5['model'],_0x4ce9d5[_0xc74e('0x2f')]);_0x5609c3['attributes']=_[_0xc74e('0x43')](_0x4ce9d5[_0xc74e('0x2e')],qs['fields'](_0x4797d9[_0xc74e('0x2f')]['fields']));_0x5609c3['attributes']=_0x5609c3[_0xc74e('0x32')][_0xc74e('0x44')]?_0x5609c3[_0xc74e('0x32')]:_0x4ce9d5[_0xc74e('0x2e')];if(_0x4797d9[_0xc74e('0x2f')][_0xc74e('0x3d')]){_0x5609c3[_0xc74e('0x3e')]=[{'all':!![]}];}_0x5609c3=_[_0xc74e('0x38')]({},_0x5609c3,_0x4797d9[_0xc74e('0x3b')]);return db[_0xc74e('0x2a')][_0xc74e('0x45')](_0x5609c3)[_0xc74e('0x25')](handleEntityNotFound(_0x39e636,null))[_0xc74e('0x25')](respondWithResult(_0x39e636,null))[_0xc74e('0x40')](handleError(_0x39e636,null));};exports[_0xc74e('0x46')]=function(_0x2b65b8,_0x549616){return db['OpenchannelQueueReport'][_0xc74e('0x46')](_0x2b65b8[_0xc74e('0x47')],{})[_0xc74e('0x25')](respondWithResult(_0x549616,0xc9))['catch'](handleError(_0x549616,null));};exports['update']=function(_0x2b0489,_0x56f6f0){if(_0x2b0489['body']['id']){delete _0x2b0489['body']['id'];}return db['OpenchannelQueueReport'][_0xc74e('0x45')]({'where':{'id':_0x2b0489['params']['id']}})[_0xc74e('0x25')](handleEntityNotFound(_0x56f6f0,null))[_0xc74e('0x25')](saveUpdates(_0x2b0489[_0xc74e('0x47')],null))[_0xc74e('0x25')](respondWithResult(_0x56f6f0,null))[_0xc74e('0x40')](handleError(_0x56f6f0,null));};exports[_0xc74e('0x48')]=function(_0x1a2bac,_0x1b6ef3){return db[_0xc74e('0x2a')]['find']({'where':{'id':_0x1a2bac[_0xc74e('0x49')]['id']}})[_0xc74e('0x25')](handleEntityNotFound(_0x1b6ef3,null))[_0xc74e('0x25')](removeEntity(_0x1b6ef3,null))['catch'](handleError(_0x1b6ef3,null));};exports[_0xc74e('0x4a')]=function(_0x5e7a03,_0x1ba8aa){return db[_0xc74e('0x2a')]['describe']()[_0xc74e('0x25')](respondWithResult(_0x1ba8aa,null))['catch'](handleError(_0x1ba8aa,null));}; \ No newline at end of file +var _0x3003=['fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','eml-format','rimraf','moment','util','path','to-csv'];(function(_0x3e620d,_0x246b12){var _0x522b2e=function(_0x4f65ee){while(--_0x4f65ee){_0x3e620d['push'](_0x3e620d['shift']());}};_0x522b2e(++_0x246b12);}(_0x3003,0x14e));var _0x3300=function(_0x4bddb0,_0x21fb3e){_0x4bddb0=_0x4bddb0-0x0;var _0x17a7f8=_0x3003[_0x4bddb0];return _0x17a7f8;};'use strict';var emlformat=require(_0x3300('0x0'));var rimraf=require(_0x3300('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3300('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3300('0x3'));var path=require(_0x3300('0x4'));var sox=require('sox');var csv=require(_0x3300('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3300('0x6'));var _=require(_0x3300('0x7'));var squel=require(_0x3300('0x8'));var crypto=require(_0x3300('0x9'));var jsforce=require(_0x3300('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3300('0x5'));var querystring=require('querystring');var Papa=require(_0x3300('0xb'));var Redis=require(_0x3300('0xc'));var authService=require(_0x3300('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3300('0xe'))(_0x3300('0xf'));var utils=require(_0x3300('0x10'));var config=require(_0x3300('0x11'));var licenseUtil=require(_0x3300('0x12'));var db=require(_0x3300('0x13'))['db'];function respondWithStatusCode(_0x22f6d9,_0x3390c8){_0x3390c8=_0x3390c8||0xcc;return function(_0x35077d){if(_0x35077d){return _0x22f6d9[_0x3300('0x14')](_0x3390c8);}return _0x22f6d9[_0x3300('0x15')](_0x3390c8)[_0x3300('0x16')]();};}function respondWithResult(_0x1c30d5,_0x1f4615){_0x1f4615=_0x1f4615||0xc8;return function(_0x4acb8f){if(_0x4acb8f){return _0x1c30d5['status'](_0x1f4615)['json'](_0x4acb8f);}};}function respondWithFilteredResult(_0x1f31fb,_0x69a2cb){return function(_0x4dd08e){if(_0x4dd08e){var _0x8bfee2=typeof _0x69a2cb[_0x3300('0x17')]===_0x3300('0x18')&&typeof _0x69a2cb[_0x3300('0x19')]===_0x3300('0x18');var _0xb3ffcc=_0x4dd08e[_0x3300('0x1a')];var _0x3fd3b5=_0x8bfee2?0x0:_0x69a2cb[_0x3300('0x17')];var _0x46e0c1=_0x8bfee2?_0x4dd08e[_0x3300('0x1a')]:_0x69a2cb[_0x3300('0x17')]+_0x69a2cb['limit'];var _0x397d30;if(_0x46e0c1>=_0xb3ffcc){_0x46e0c1=_0xb3ffcc;_0x397d30=0xc8;}else{_0x397d30=0xce;}_0x1f31fb[_0x3300('0x15')](_0x397d30);return _0x1f31fb['set']('Content-Range',_0x3fd3b5+'-'+_0x46e0c1+'/'+_0xb3ffcc)[_0x3300('0x1b')](_0x4dd08e);}return null;};}function patchUpdates(_0x3b431e){return function(_0xfb8a50){try{jsonpatch['apply'](_0xfb8a50,_0x3b431e,!![]);}catch(_0x2b8b31){return BPromise[_0x3300('0x1c')](_0x2b8b31);}return _0xfb8a50['save']();};}function saveUpdates(_0x32a82a,_0x192a91){return function(_0x222f74){if(_0x222f74){return _0x222f74[_0x3300('0x1d')](_0x32a82a)[_0x3300('0x1e')](function(_0x314593){return _0x314593;});}return null;};}function removeEntity(_0x28eedc,_0x23fac6){return function(_0x4f4809){if(_0x4f4809){return _0x4f4809[_0x3300('0x1f')]()['then'](function(){_0x28eedc[_0x3300('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x123b26,_0x5af978){return function(_0x1c2a14){if(!_0x1c2a14){_0x123b26[_0x3300('0x14')](0x194);}return _0x1c2a14;};}function handleError(_0x27a9c7,_0x4585b2){_0x4585b2=_0x4585b2||0x1f4;return function(_0x235689){logger['error'](_0x235689[_0x3300('0x20')]);if(_0x235689[_0x3300('0x21')]){delete _0x235689[_0x3300('0x21')];}_0x27a9c7[_0x3300('0x15')](_0x4585b2)[_0x3300('0x22')](_0x235689);};}exports[_0x3300('0x23')]=function(_0x4f4795,_0x112a3e){var _0x3b52da={},_0x16eeb5={},_0x204a98={'count':0x0,'rows':[]};var _0x45df1e=_[_0x3300('0x24')](db[_0x3300('0x25')][_0x3300('0x26')],function(_0x2b13b7){return{'name':_0x2b13b7['fieldName'],'type':_0x2b13b7[_0x3300('0x27')][_0x3300('0x28')]};});_0x16eeb5[_0x3300('0x29')]=_[_0x3300('0x24')](_0x45df1e,_0x3300('0x21'));_0x16eeb5[_0x3300('0x2a')]=_['keys'](_0x4f4795[_0x3300('0x2a')]);_0x16eeb5[_0x3300('0x2b')]=_[_0x3300('0x2c')](_0x16eeb5[_0x3300('0x29')],_0x16eeb5[_0x3300('0x2a')]);_0x3b52da[_0x3300('0x2d')]=_['intersection'](_0x16eeb5['model'],qs[_0x3300('0x2e')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x2e')]));_0x3b52da[_0x3300('0x2d')]=_0x3b52da[_0x3300('0x2d')][_0x3300('0x2f')]?_0x3b52da[_0x3300('0x2d')]:_0x16eeb5[_0x3300('0x29')];if(!_0x4f4795[_0x3300('0x2a')][_0x3300('0x30')]('nolimit')){_0x3b52da[_0x3300('0x19')]=qs[_0x3300('0x19')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x19')]);_0x3b52da['offset']=qs[_0x3300('0x17')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x17')]);}_0x3b52da[_0x3300('0x31')]=qs[_0x3300('0x32')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x32')]);_0x3b52da[_0x3300('0x33')]=qs[_0x3300('0x2b')](_[_0x3300('0x34')](_0x4f4795[_0x3300('0x2a')],_0x16eeb5[_0x3300('0x2b')]),_0x45df1e);if(_0x4f4795[_0x3300('0x2a')][_0x3300('0x35')]){_0x3b52da[_0x3300('0x33')]=_[_0x3300('0x36')](_0x3b52da[_0x3300('0x33')],{'$or':_[_0x3300('0x24')](_0x45df1e,function(_0x2354cd){if(_0x2354cd[_0x3300('0x27')]!==_0x3300('0x37')){var _0x392426={};_0x392426[_0x2354cd['name']]={'$like':'%'+_0x4f4795['query'][_0x3300('0x35')]+'%'};return _0x392426;}})});}_0x3b52da=_[_0x3300('0x36')]({},_0x3b52da,_0x4f4795[_0x3300('0x38')]);var _0x250d63={'where':_0x3b52da[_0x3300('0x33')]};return db[_0x3300('0x25')][_0x3300('0x1a')](_0x250d63)['then'](function(_0x3d71c4){_0x204a98[_0x3300('0x1a')]=_0x3d71c4;if(_0x4f4795[_0x3300('0x2a')][_0x3300('0x39')]){_0x3b52da[_0x3300('0x3a')]=[{'all':!![]}];}return db[_0x3300('0x25')][_0x3300('0x3b')](_0x3b52da);})['then'](function(_0x4874f4){_0x204a98[_0x3300('0x3c')]=_0x4874f4;return _0x204a98;})['then'](respondWithFilteredResult(_0x112a3e,_0x3b52da))[_0x3300('0x3d')](handleError(_0x112a3e,null));};exports['show']=function(_0x3d5e61,_0x364aef){var _0x50fe59={'raw':!![],'where':{'id':_0x3d5e61['params']['id']}},_0x250df1={};_0x250df1['model']=_[_0x3300('0x3e')](db['OpenchannelQueueReport'][_0x3300('0x26')]);_0x250df1[_0x3300('0x2a')]=_[_0x3300('0x3e')](_0x3d5e61[_0x3300('0x2a')]);_0x250df1[_0x3300('0x2b')]=_[_0x3300('0x2c')](_0x250df1[_0x3300('0x29')],_0x250df1['query']);_0x50fe59['attributes']=_[_0x3300('0x2c')](_0x250df1[_0x3300('0x29')],qs[_0x3300('0x2e')](_0x3d5e61[_0x3300('0x2a')]['fields']));_0x50fe59['attributes']=_0x50fe59[_0x3300('0x2d')][_0x3300('0x2f')]?_0x50fe59[_0x3300('0x2d')]:_0x250df1['model'];if(_0x3d5e61[_0x3300('0x2a')][_0x3300('0x39')]){_0x50fe59[_0x3300('0x3a')]=[{'all':!![]}];}_0x50fe59=_[_0x3300('0x36')]({},_0x50fe59,_0x3d5e61[_0x3300('0x38')]);return db['OpenchannelQueueReport'][_0x3300('0x3f')](_0x50fe59)[_0x3300('0x1e')](handleEntityNotFound(_0x364aef,null))['then'](respondWithResult(_0x364aef,null))['catch'](handleError(_0x364aef,null));};exports[_0x3300('0x40')]=function(_0x2997b7,_0x44fa5b){return db['OpenchannelQueueReport']['create'](_0x2997b7[_0x3300('0x41')],{})['then'](respondWithResult(_0x44fa5b,0xc9))[_0x3300('0x3d')](handleError(_0x44fa5b,null));};exports[_0x3300('0x1d')]=function(_0x29454d,_0x14b5e9){if(_0x29454d['body']['id']){delete _0x29454d[_0x3300('0x41')]['id'];}return db[_0x3300('0x25')][_0x3300('0x3f')]({'where':{'id':_0x29454d[_0x3300('0x42')]['id']}})[_0x3300('0x1e')](handleEntityNotFound(_0x14b5e9,null))[_0x3300('0x1e')](saveUpdates(_0x29454d[_0x3300('0x41')],null))[_0x3300('0x1e')](respondWithResult(_0x14b5e9,null))[_0x3300('0x3d')](handleError(_0x14b5e9,null));};exports['destroy']=function(_0x551cf5,_0x572caa){return db['OpenchannelQueueReport'][_0x3300('0x3f')]({'where':{'id':_0x551cf5[_0x3300('0x42')]['id']}})[_0x3300('0x1e')](handleEntityNotFound(_0x572caa,null))['then'](removeEntity(_0x572caa,null))[_0x3300('0x3d')](handleError(_0x572caa,null));};exports[_0x3300('0x43')]=function(_0x5d5d90,_0x3246fb){return db[_0x3300('0x25')][_0x3300('0x43')]()['then'](respondWithResult(_0x3246fb,null))[_0x3300('0x3d')](handleError(_0x3246fb,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index bfb01ae..8f46e47 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x218190,_0x12a29c){var _0x3fa736=function(_0x459ca4){while(--_0x459ca4){_0x218190['push'](_0x218190['shift']());}};_0x3fa736(++_0x12a29c);}(_0x2ef3,0xba));var _0x32ef=function(_0x21376d,_0x19f07a){_0x21376d=_0x21376d-0x0;var _0x3c805e=_0x2ef3[_0x21376d];return _0x3c805e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x5385dd,_0x26cdb2){var _0x1830a0=function(_0x126135){while(--_0x126135){_0x5385dd['push'](_0x5385dd['shift']());}};_0x1830a0(++_0x26cdb2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 798f265..1b9bf28 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 _0x06ef=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelQueueReport,\x20%s,\x20%s','body','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','limit','moment','../../config/utils','../../config/logger'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x06ef,0x185));var _0xf06e=function(_0x3c5114,_0x2bb0e2){_0x3c5114=_0x3c5114-0x0;var _0x924124=_0x06ef[_0x3c5114];return _0x924124;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf06e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf06e('0x1'));var logger=require(_0xf06e('0x2'))(_0xf06e('0x3'));var config=require('../../config/environment');var jayson=require(_0xf06e('0x4'));var client=jayson[_0xf06e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b74b,_0x4e05dc,_0x5cddf1){return new BPromise(function(_0x4ccbee,_0x25b56e){return client[_0xf06e('0x6')](_0x59b74b,_0x5cddf1)[_0xf06e('0x7')](function(_0x2bb08c){logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));logger[_0xf06e('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'),JSON[_0xf06e('0xb')](_0x2bb08c));if(_0x2bb08c[_0xf06e('0xc')]){if(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xd')]===0x1f4){logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);return _0x25b56e(_0x2bb08c['error'][_0xf06e('0xe')]);}logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c['error']['message']);return _0x4ccbee(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);}else{logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));_0x4ccbee(_0x2bb08c[_0xf06e('0xf')][_0xf06e('0xe')]);}})[_0xf06e('0x10')](function(_0x44157a){logger[_0xf06e('0xc')](_0xf06e('0x11'),_0x4e05dc,_0x44157a);_0x25b56e(_0x44157a);});});}exports['CreateOpenchannelQueueReport']=function(_0x380c07){var _0x55dabf=this;return new Promise(function(_0x251c9f,_0x7a9f4b){return db['OpenchannelQueueReport']['create'](_0x380c07[_0xf06e('0x12')],{'raw':_0x380c07[_0xf06e('0x13')]?_0x380c07['options']['raw']===undefined?!![]:![]:!![]})[_0xf06e('0x7')](function(_0x211590){logger[_0xf06e('0x8')]('CreateOpenchannelQueueReport',_0x380c07);logger[_0xf06e('0xa')](_0xf06e('0x14'),_0x380c07,JSON['stringify'](_0x211590));_0x251c9f(_0x211590);})[_0xf06e('0x10')](function(_0x1ba130){logger[_0xf06e('0xc')]('CreateOpenchannelQueueReport',_0x1ba130[_0xf06e('0xe')],_0x380c07);_0x7a9f4b(_0x55dabf[_0xf06e('0xc')](0x1f4,_0x1ba130[_0xf06e('0xe')]));});});};exports[_0xf06e('0x15')]=function(_0x3b410e){var _0x4c2d01=this;return new Promise(function(_0x3a969c,_0x4923d3){return db[_0xf06e('0x16')][_0xf06e('0x17')](_0x3b410e[_0xf06e('0x12')],{'raw':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x19')]||null:null,'attributes':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1a')]||null:null,'limit':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1b')]||null:null})[_0xf06e('0x7')](function(_0x89a74f){logger[_0xf06e('0x8')](_0xf06e('0x15'),_0x3b410e);logger['debug'](_0xf06e('0x15'),_0x3b410e,JSON[_0xf06e('0xb')](_0x89a74f));_0x3a969c(_0x89a74f);})[_0xf06e('0x10')](function(_0x5d21f7){logger[_0xf06e('0xc')](_0xf06e('0x15'),_0x5d21f7[_0xf06e('0xe')],_0x3b410e);_0x4923d3(_0x4c2d01[_0xf06e('0xc')](0x1f4,_0x5d21f7[_0xf06e('0xe')]));});});}; \ No newline at end of file +var _0x793b=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x793b,0x189));var _0xb793=function(_0x3adc1e,_0x3d0eb0){_0x3adc1e=_0x3adc1e-0x0;var _0x555c07=_0x793b[_0x3adc1e];return _0x555c07;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require(_0xb793('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb793('0x5'))['db'];var utils=require(_0xb793('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb793('0x7'));var jayson=require(_0xb793('0x8'));var client=jayson[_0xb793('0x9')][_0xb793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f110,_0x42d0c7,_0x134ac4){return new BPromise(function(_0x23a718,_0x149720){return client[_0xb793('0xb')](_0x39f110,_0x134ac4)[_0xb793('0xc')](function(_0x22c9ea){logger[_0xb793('0xd')](_0xb793('0xe'),_0x42d0c7,'request\x20sent');logger[_0xb793('0xf')](_0xb793('0x10'),_0x42d0c7,'request\x20sent',JSON['stringify'](_0x22c9ea));if(_0x22c9ea[_0xb793('0x11')]){if(_0x22c9ea[_0xb793('0x11')]['code']===0x1f4){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea['error'][_0xb793('0x12')]);return _0x149720(_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);}logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);return _0x23a718(_0x22c9ea['error'][_0xb793('0x12')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x42d0c7,_0xb793('0x13'));_0x23a718(_0x22c9ea[_0xb793('0x14')][_0xb793('0x12')]);}})[_0xb793('0x15')](function(_0x38d9f2){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x38d9f2);_0x149720(_0x38d9f2);});});}exports[_0xb793('0x16')]=function(_0x977026){var _0x2914a2=this;return new Promise(function(_0x2c9e87,_0x101162){return db[_0xb793('0x17')][_0xb793('0x18')](_0x977026[_0xb793('0x19')],{'raw':_0x977026[_0xb793('0x1a')]?_0x977026['options'][_0xb793('0x1b')]===undefined?!![]:![]:!![]})[_0xb793('0xc')](function(_0x54bfd4){logger[_0xb793('0xd')](_0xb793('0x16'),_0x977026);logger[_0xb793('0xf')](_0xb793('0x16'),_0x977026,JSON[_0xb793('0x1c')](_0x54bfd4));_0x2c9e87(_0x54bfd4);})['catch'](function(_0x5ecf9c){logger[_0xb793('0x11')](_0xb793('0x16'),_0x5ecf9c[_0xb793('0x12')],_0x977026);_0x101162(_0x2914a2[_0xb793('0x11')](0x1f4,_0x5ecf9c[_0xb793('0x12')]));});});};exports[_0xb793('0x1d')]=function(_0x4d4544){var _0x1e470c=this;return new Promise(function(_0x503d69,_0x10947e){return db[_0xb793('0x17')][_0xb793('0x1e')](_0x4d4544[_0xb793('0x19')],{'raw':_0x4d4544[_0xb793('0x1a')]?_0x4d4544[_0xb793('0x1a')][_0xb793('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d4544['options']?_0x4d4544[_0xb793('0x1a')][_0xb793('0x1f')]||null:null,'attributes':_0x4d4544[_0xb793('0x1a')]?_0x4d4544[_0xb793('0x1a')][_0xb793('0x20')]||null:null,'limit':_0x4d4544[_0xb793('0x1a')]?_0x4d4544['options'][_0xb793('0x21')]||null:null})[_0xb793('0xc')](function(_0x107d78){logger['info'](_0xb793('0x1d'),_0x4d4544);logger[_0xb793('0xf')](_0xb793('0x1d'),_0x4d4544,JSON[_0xb793('0x1c')](_0x107d78));_0x503d69(_0x107d78);})['catch'](function(_0x493a8c){logger[_0xb793('0x11')]('UpdateOpenchannelQueueReport',_0x493a8c['message'],_0x4d4544);_0x10947e(_0x1e470c[_0xb793('0x11')](0x1f4,_0x493a8c[_0xb793('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 4f405c2..c74b253 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 _0x5a6a=['create','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x2385b6,_0x45cd34){var _0x1a7b5a=function(_0x1ab7c3){while(--_0x1ab7c3){_0x2385b6['push'](_0x2385b6['shift']());}};_0x1a7b5a(++_0x45cd34);}(_0x5a6a,0x124));var _0xa5a6=function(_0x1d9f9e,_0x40e5db){_0x1d9f9e=_0x1d9f9e-0x0;var _0x31e239=_0x5a6a[_0x1d9f9e];return _0x31e239;};'use strict';var multer=require(_0xa5a6('0x0'));var util=require(_0xa5a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa5a6('0x2'));var router=express['Router']();var fs_extra=require(_0xa5a6('0x3'));var auth=require(_0xa5a6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa5a6('0x5'));router[_0xa5a6('0x6')]('/',auth[_0xa5a6('0x7')](),controller[_0xa5a6('0x8')]);router[_0xa5a6('0x6')](_0xa5a6('0x9'),auth[_0xa5a6('0x7')](),controller[_0xa5a6('0xa')]);router[_0xa5a6('0x6')](_0xa5a6('0xb'),auth[_0xa5a6('0x7')](),controller[_0xa5a6('0xc')]);router[_0xa5a6('0xd')]('/',auth['isAuthenticated'](),controller[_0xa5a6('0xe')]);router['put']('/:id',auth[_0xa5a6('0x7')](),controller['update']);router[_0xa5a6('0xf')](_0xa5a6('0xb'),auth[_0xa5a6('0x7')](),controller[_0xa5a6('0x10')]);module[_0xa5a6('0x11')]=router; \ No newline at end of file +var _0x8936=['/describe','describe','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated'];(function(_0x1b0307,_0x4336b1){var _0x5c8d34=function(_0x5b1b61){while(--_0x5b1b61){_0x1b0307['push'](_0x1b0307['shift']());}};_0x5c8d34(++_0x4336b1);}(_0x8936,0xcf));var _0x6893=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x8936[_0x218972];return _0x1bb1a8;};'use strict';var multer=require('multer');var util=require(_0x6893('0x0'));var path=require(_0x6893('0x1'));var timeout=require(_0x6893('0x2'));var express=require(_0x6893('0x3'));var router=express['Router']();var fs_extra=require(_0x6893('0x4'));var auth=require(_0x6893('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6893('0x6'));router[_0x6893('0x7')]('/',auth[_0x6893('0x8')](),controller['index']);router[_0x6893('0x7')](_0x6893('0x9'),auth[_0x6893('0x8')](),controller[_0x6893('0xa')]);router[_0x6893('0x7')](_0x6893('0xb'),auth[_0x6893('0x8')](),controller[_0x6893('0xc')]);router['post']('/',auth[_0x6893('0x8')](),controller[_0x6893('0xd')]);router[_0x6893('0xe')](_0x6893('0xb'),auth[_0x6893('0x8')](),controller[_0x6893('0xf')]);router[_0x6893('0x10')](_0x6893('0xb'),auth[_0x6893('0x8')](),controller['destroy']);module[_0x6893('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b157a5c..312797b 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x431249,_0x22e046){var _0x417858=function(_0x4c3c46){while(--_0x4c3c46){_0x431249['push'](_0x431249['shift']());}};_0x417858(++_0x22e046);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2ff986,_0x2cbfc5){_0x2ff986=_0x2ff986-0x0;var _0x100077=_0xf4eb[_0x2ff986];return _0x100077;};'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(_0x3238d2,_0x4b9691){var _0x500f04=function(_0x5aec38){while(--_0x5aec38){_0x3238d2['push'](_0x3238d2['shift']());}};_0x500f04(++_0x4b9691);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1832f6,_0x597799){_0x1832f6=_0x1832f6-0x0;var _0x3c4a88=_0xf4eb[_0x1832f6];return _0x3c4a88;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 038bc90..60cbb5f 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 _0x9889=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9889,0x1e9));var _0x9988=function(_0x1b8cb3,_0x230219){_0x1b8cb3=_0x1b8cb3-0x0;var _0x10e6a0=_0x9889[_0x1b8cb3];return _0x10e6a0;};'use strict';var emlformat=require(_0x9988('0x0'));var rimraf=require(_0x9988('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9988('0x2'));var rp=require(_0x9988('0x3'));var moment=require(_0x9988('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9988('0x5'));var util=require('util');var path=require(_0x9988('0x6'));var sox=require('sox');var csv=require(_0x9988('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9988('0x8'));var _=require(_0x9988('0x9'));var squel=require(_0x9988('0xa'));var crypto=require(_0x9988('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9988('0xc'));var Papa=require(_0x9988('0xd'));var Redis=require(_0x9988('0xe'));var authService=require(_0x9988('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9988('0x10'));var hardwareService=require(_0x9988('0x11'));var logger=require('../../config/logger')(_0x9988('0x12'));var utils=require(_0x9988('0x13'));var config=require(_0x9988('0x14'));var licenseUtil=require(_0x9988('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a4300,_0x3d36d8){_0x3d36d8=_0x3d36d8||0xcc;return function(_0x461791){if(_0x461791){return _0x1a4300[_0x9988('0x16')](_0x3d36d8);}return _0x1a4300['status'](_0x3d36d8)[_0x9988('0x17')]();};}function respondWithResult(_0xe665e,_0x159cc4){_0x159cc4=_0x159cc4||0xc8;return function(_0x20bb73){if(_0x20bb73){return _0xe665e[_0x9988('0x18')](_0x159cc4)[_0x9988('0x19')](_0x20bb73);}};}function respondWithFilteredResult(_0x224c66,_0x189aaa){return function(_0x360483){if(_0x360483){var _0x321269=typeof _0x189aaa[_0x9988('0x1a')]===_0x9988('0x1b')&&typeof _0x189aaa[_0x9988('0x1c')]===_0x9988('0x1b');var _0x401df4=_0x360483[_0x9988('0x1d')];var _0x50a651=_0x321269?0x0:_0x189aaa[_0x9988('0x1a')];var _0x14ea62=_0x321269?_0x360483['count']:_0x189aaa[_0x9988('0x1a')]+_0x189aaa['limit'];var _0x376fd3;if(_0x14ea62>=_0x401df4){_0x14ea62=_0x401df4;_0x376fd3=0xc8;}else{_0x376fd3=0xce;}_0x224c66[_0x9988('0x18')](_0x376fd3);return _0x224c66[_0x9988('0x1e')](_0x9988('0x1f'),_0x50a651+'-'+_0x14ea62+'/'+_0x401df4)[_0x9988('0x19')](_0x360483);}return null;};}function patchUpdates(_0x10d095){return function(_0x11f257){try{jsonpatch[_0x9988('0x20')](_0x11f257,_0x10d095,!![]);}catch(_0x1a823e){return BPromise['reject'](_0x1a823e);}return _0x11f257['save']();};}function saveUpdates(_0x3fcd54,_0x4e2765){return function(_0x3fd62e){if(_0x3fd62e){return _0x3fd62e[_0x9988('0x21')](_0x3fcd54)[_0x9988('0x22')](function(_0x3bed78){return _0x3bed78;});}return null;};}function removeEntity(_0x5804d7,_0x5bfff8){return function(_0x2601a8){if(_0x2601a8){return _0x2601a8[_0x9988('0x23')]()[_0x9988('0x22')](function(){_0x5804d7[_0x9988('0x18')](0xcc)[_0x9988('0x17')]();});}};}function handleEntityNotFound(_0x100414,_0x24c35f){return function(_0xaf28f9){if(!_0xaf28f9){_0x100414[_0x9988('0x16')](0x194);}return _0xaf28f9;};}function handleError(_0x39b7f3,_0x43e9b4){_0x43e9b4=_0x43e9b4||0x1f4;return function(_0x46dda6){logger[_0x9988('0x24')](_0x46dda6[_0x9988('0x25')]);if(_0x46dda6[_0x9988('0x26')]){delete _0x46dda6['name'];}_0x39b7f3[_0x9988('0x18')](_0x43e9b4)['send'](_0x46dda6);};}exports[_0x9988('0x27')]=function(_0x483b47,_0x34960d){var _0x5a5452={},_0x44666e={},_0x49bae9={'count':0x0,'rows':[]};var _0x555aa2=_['map'](db[_0x9988('0x28')][_0x9988('0x29')],function(_0x310be5){return{'name':_0x310be5[_0x9988('0x2a')],'type':_0x310be5[_0x9988('0x2b')][_0x9988('0x2c')]};});_0x44666e[_0x9988('0x2d')]=_['map'](_0x555aa2,'name');_0x44666e[_0x9988('0x2e')]=_[_0x9988('0x2f')](_0x483b47['query']);_0x44666e[_0x9988('0x30')]=_[_0x9988('0x31')](_0x44666e[_0x9988('0x2d')],_0x44666e[_0x9988('0x2e')]);_0x5a5452[_0x9988('0x32')]=_[_0x9988('0x31')](_0x44666e[_0x9988('0x2d')],qs['fields'](_0x483b47['query'][_0x9988('0x33')]));_0x5a5452[_0x9988('0x32')]=_0x5a5452[_0x9988('0x32')][_0x9988('0x34')]?_0x5a5452['attributes']:_0x44666e[_0x9988('0x2d')];if(!_0x483b47[_0x9988('0x2e')][_0x9988('0x35')](_0x9988('0x36'))){_0x5a5452[_0x9988('0x1c')]=qs[_0x9988('0x1c')](_0x483b47[_0x9988('0x2e')]['limit']);_0x5a5452['offset']=qs['offset'](_0x483b47[_0x9988('0x2e')][_0x9988('0x1a')]);}_0x5a5452[_0x9988('0x37')]=qs['sort'](_0x483b47['query']['sort']);_0x5a5452[_0x9988('0x38')]=qs[_0x9988('0x30')](_[_0x9988('0x39')](_0x483b47[_0x9988('0x2e')],_0x44666e[_0x9988('0x30')]),_0x555aa2);if(_0x483b47['query'][_0x9988('0x3a')]){_0x5a5452[_0x9988('0x38')]=_[_0x9988('0x3b')](_0x5a5452[_0x9988('0x38')],{'$or':_[_0x9988('0x3c')](_0x555aa2,function(_0x441880){if(_0x441880[_0x9988('0x2b')]!==_0x9988('0x3d')){var _0x149c9f={};_0x149c9f[_0x441880['name']]={'$like':'%'+_0x483b47[_0x9988('0x2e')][_0x9988('0x3a')]+'%'};return _0x149c9f;}})});}_0x5a5452=_['merge']({},_0x5a5452,_0x483b47[_0x9988('0x3e')]);var _0x3e9a71={'where':_0x5a5452[_0x9988('0x38')]};return db[_0x9988('0x28')]['count'](_0x3e9a71)['then'](function(_0xa86f74){_0x49bae9['count']=_0xa86f74;if(_0x483b47[_0x9988('0x2e')]['includeAll']){_0x5a5452[_0x9988('0x3f')]=[{'all':!![]}];}return db[_0x9988('0x28')]['findAll'](_0x5a5452);})['then'](function(_0x565c4e){_0x49bae9[_0x9988('0x40')]=_0x565c4e;return _0x49bae9;})['then'](respondWithFilteredResult(_0x34960d,_0x5a5452))[_0x9988('0x41')](handleError(_0x34960d,null));};exports[_0x9988('0x42')]=function(_0x690adb,_0x204f64){var _0x2e6af3={'raw':!![],'where':{'id':_0x690adb[_0x9988('0x43')]['id']}},_0x44c4d8={};_0x44c4d8[_0x9988('0x2d')]=_[_0x9988('0x2f')](db[_0x9988('0x28')][_0x9988('0x29')]);_0x44c4d8[_0x9988('0x2e')]=_[_0x9988('0x2f')](_0x690adb['query']);_0x44c4d8[_0x9988('0x30')]=_['intersection'](_0x44c4d8[_0x9988('0x2d')],_0x44c4d8['query']);_0x2e6af3[_0x9988('0x32')]=_['intersection'](_0x44c4d8[_0x9988('0x2d')],qs[_0x9988('0x33')](_0x690adb['query']['fields']));_0x2e6af3['attributes']=_0x2e6af3[_0x9988('0x32')][_0x9988('0x34')]?_0x2e6af3[_0x9988('0x32')]:_0x44c4d8[_0x9988('0x2d')];if(_0x690adb[_0x9988('0x2e')][_0x9988('0x44')]){_0x2e6af3[_0x9988('0x3f')]=[{'all':!![]}];}_0x2e6af3=_['merge']({},_0x2e6af3,_0x690adb[_0x9988('0x3e')]);return db[_0x9988('0x28')][_0x9988('0x45')](_0x2e6af3)['then'](handleEntityNotFound(_0x204f64,null))[_0x9988('0x22')](respondWithResult(_0x204f64,null))[_0x9988('0x41')](handleError(_0x204f64,null));};exports['create']=function(_0x46d9f9,_0x3b9a80){return db['OpenchannelTransferReport']['create'](_0x46d9f9['body'],{})['then'](respondWithResult(_0x3b9a80,0xc9))['catch'](handleError(_0x3b9a80,null));};exports['update']=function(_0x52b079,_0x5c89ef){if(_0x52b079[_0x9988('0x46')]['id']){delete _0x52b079['body']['id'];}return db['OpenchannelTransferReport'][_0x9988('0x45')]({'where':{'id':_0x52b079[_0x9988('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c89ef,null))['then'](saveUpdates(_0x52b079[_0x9988('0x46')],null))[_0x9988('0x22')](respondWithResult(_0x5c89ef,null))[_0x9988('0x41')](handleError(_0x5c89ef,null));};exports['destroy']=function(_0x87adcc,_0x29f9ee){return db[_0x9988('0x28')][_0x9988('0x45')]({'where':{'id':_0x87adcc[_0x9988('0x43')]['id']}})[_0x9988('0x22')](handleEntityNotFound(_0x29f9ee,null))[_0x9988('0x22')](removeEntity(_0x29f9ee,null))[_0x9988('0x41')](handleError(_0x29f9ee,null));};exports[_0x9988('0x47')]=function(_0x42bb85,_0x2c4727){return db[_0x9988('0x28')][_0x9988('0x47')]()[_0x9988('0x22')](respondWithResult(_0x2c4727,null))[_0x9988('0x41')](handleError(_0x2c4727,null));}; \ No newline at end of file +var _0xee15=['where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0xee15,0x1c0));var _0x5ee1=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xee15[_0x4afac5];return _0x2404b3;};'use strict';var emlformat=require(_0x5ee1('0x0'));var rimraf=require(_0x5ee1('0x1'));var zipdir=require(_0x5ee1('0x2'));var jsonpatch=require(_0x5ee1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ee1('0x4'));var Mustache=require('mustache');var util=require(_0x5ee1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5ee1('0x6'));var ejs=require(_0x5ee1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ee1('0x8'));var squel=require(_0x5ee1('0x9'));var crypto=require(_0x5ee1('0xa'));var jsforce=require(_0x5ee1('0xb'));var deskjs=require(_0x5ee1('0xc'));var toCsv=require(_0x5ee1('0x6'));var querystring=require(_0x5ee1('0xd'));var Papa=require(_0x5ee1('0xe'));var Redis=require(_0x5ee1('0xf'));var authService=require(_0x5ee1('0x10'));var qs=require(_0x5ee1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ee1('0x12'));var logger=require(_0x5ee1('0x13'))(_0x5ee1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5ee1('0x15'))['db'];function respondWithStatusCode(_0x5a99cc,_0x37fc2e){_0x37fc2e=_0x37fc2e||0xcc;return function(_0xfb9d30){if(_0xfb9d30){return _0x5a99cc[_0x5ee1('0x16')](_0x37fc2e);}return _0x5a99cc[_0x5ee1('0x17')](_0x37fc2e)[_0x5ee1('0x18')]();};}function respondWithResult(_0x45c068,_0x5a0f6c){_0x5a0f6c=_0x5a0f6c||0xc8;return function(_0x33685d){if(_0x33685d){return _0x45c068[_0x5ee1('0x17')](_0x5a0f6c)[_0x5ee1('0x19')](_0x33685d);}};}function respondWithFilteredResult(_0x82cd8f,_0x1d32ae){return function(_0x5b629d){if(_0x5b629d){var _0x5be8bf=typeof _0x1d32ae[_0x5ee1('0x1a')]===_0x5ee1('0x1b')&&typeof _0x1d32ae['limit']===_0x5ee1('0x1b');var _0x2e9a1b=_0x5b629d[_0x5ee1('0x1c')];var _0x45e6af=_0x5be8bf?0x0:_0x1d32ae[_0x5ee1('0x1a')];var _0x34b9bf=_0x5be8bf?_0x5b629d['count']:_0x1d32ae['offset']+_0x1d32ae[_0x5ee1('0x1d')];var _0x4c4f14;if(_0x34b9bf>=_0x2e9a1b){_0x34b9bf=_0x2e9a1b;_0x4c4f14=0xc8;}else{_0x4c4f14=0xce;}_0x82cd8f[_0x5ee1('0x17')](_0x4c4f14);return _0x82cd8f[_0x5ee1('0x1e')]('Content-Range',_0x45e6af+'-'+_0x34b9bf+'/'+_0x2e9a1b)[_0x5ee1('0x19')](_0x5b629d);}return null;};}function patchUpdates(_0x15f83e){return function(_0xb2745f){try{jsonpatch[_0x5ee1('0x1f')](_0xb2745f,_0x15f83e,!![]);}catch(_0x1adb0f){return BPromise[_0x5ee1('0x20')](_0x1adb0f);}return _0xb2745f[_0x5ee1('0x21')]();};}function saveUpdates(_0x1ece6d,_0x1c9589){return function(_0x4e29e3){if(_0x4e29e3){return _0x4e29e3[_0x5ee1('0x22')](_0x1ece6d)[_0x5ee1('0x23')](function(_0x52e306){return _0x52e306;});}return null;};}function removeEntity(_0x4d7ee6,_0x73446f){return function(_0x2a7865){if(_0x2a7865){return _0x2a7865[_0x5ee1('0x24')]()[_0x5ee1('0x23')](function(){_0x4d7ee6['status'](0xcc)[_0x5ee1('0x18')]();});}};}function handleEntityNotFound(_0x15c7d4,_0x34d9c8){return function(_0x19a439){if(!_0x19a439){_0x15c7d4['sendStatus'](0x194);}return _0x19a439;};}function handleError(_0x34ebf4,_0x31f484){_0x31f484=_0x31f484||0x1f4;return function(_0x4ec6e9){logger[_0x5ee1('0x25')](_0x4ec6e9['stack']);if(_0x4ec6e9[_0x5ee1('0x26')]){delete _0x4ec6e9[_0x5ee1('0x26')];}_0x34ebf4[_0x5ee1('0x17')](_0x31f484)[_0x5ee1('0x27')](_0x4ec6e9);};}exports[_0x5ee1('0x28')]=function(_0x13b81b,_0x517e4c){var _0x567bed={},_0x55233d={},_0x30b780={'count':0x0,'rows':[]};var _0x4ccd6c=_[_0x5ee1('0x29')](db[_0x5ee1('0x2a')][_0x5ee1('0x2b')],function(_0x40c79b){return{'name':_0x40c79b[_0x5ee1('0x2c')],'type':_0x40c79b[_0x5ee1('0x2d')][_0x5ee1('0x2e')]};});_0x55233d[_0x5ee1('0x2f')]=_[_0x5ee1('0x29')](_0x4ccd6c,'name');_0x55233d[_0x5ee1('0x30')]=_[_0x5ee1('0x31')](_0x13b81b[_0x5ee1('0x30')]);_0x55233d[_0x5ee1('0x32')]=_[_0x5ee1('0x33')](_0x55233d[_0x5ee1('0x2f')],_0x55233d[_0x5ee1('0x30')]);_0x567bed[_0x5ee1('0x34')]=_[_0x5ee1('0x33')](_0x55233d[_0x5ee1('0x2f')],qs[_0x5ee1('0x35')](_0x13b81b[_0x5ee1('0x30')]['fields']));_0x567bed[_0x5ee1('0x34')]=_0x567bed[_0x5ee1('0x34')][_0x5ee1('0x36')]?_0x567bed[_0x5ee1('0x34')]:_0x55233d[_0x5ee1('0x2f')];if(!_0x13b81b[_0x5ee1('0x30')]['hasOwnProperty']('nolimit')){_0x567bed[_0x5ee1('0x1d')]=qs[_0x5ee1('0x1d')](_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x1d')]);_0x567bed['offset']=qs['offset'](_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x1a')]);}_0x567bed['order']=qs[_0x5ee1('0x37')](_0x13b81b['query'][_0x5ee1('0x37')]);_0x567bed[_0x5ee1('0x38')]=qs['filters'](_[_0x5ee1('0x39')](_0x13b81b[_0x5ee1('0x30')],_0x55233d[_0x5ee1('0x32')]),_0x4ccd6c);if(_0x13b81b['query'][_0x5ee1('0x3a')]){_0x567bed[_0x5ee1('0x38')]=_[_0x5ee1('0x3b')](_0x567bed[_0x5ee1('0x38')],{'$or':_[_0x5ee1('0x29')](_0x4ccd6c,function(_0x82813f){if(_0x82813f[_0x5ee1('0x2d')]!==_0x5ee1('0x3c')){var _0x537176={};_0x537176[_0x82813f[_0x5ee1('0x26')]]={'$like':'%'+_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x3a')]+'%'};return _0x537176;}})});}_0x567bed=_[_0x5ee1('0x3b')]({},_0x567bed,_0x13b81b[_0x5ee1('0x3d')]);var _0x92a542={'where':_0x567bed['where']};return db[_0x5ee1('0x2a')][_0x5ee1('0x1c')](_0x92a542)[_0x5ee1('0x23')](function(_0x2679a4){_0x30b780[_0x5ee1('0x1c')]=_0x2679a4;if(_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x3e')]){_0x567bed['include']=[{'all':!![]}];}return db[_0x5ee1('0x2a')][_0x5ee1('0x3f')](_0x567bed);})[_0x5ee1('0x23')](function(_0x2dd659){_0x30b780[_0x5ee1('0x40')]=_0x2dd659;return _0x30b780;})[_0x5ee1('0x23')](respondWithFilteredResult(_0x517e4c,_0x567bed))[_0x5ee1('0x41')](handleError(_0x517e4c,null));};exports[_0x5ee1('0x42')]=function(_0x4c66b7,_0x117829){var _0xf5d263={'raw':!![],'where':{'id':_0x4c66b7[_0x5ee1('0x43')]['id']}},_0x1080e7={};_0x1080e7[_0x5ee1('0x2f')]=_[_0x5ee1('0x31')](db['OpenchannelTransferReport'][_0x5ee1('0x2b')]);_0x1080e7[_0x5ee1('0x30')]=_[_0x5ee1('0x31')](_0x4c66b7[_0x5ee1('0x30')]);_0x1080e7[_0x5ee1('0x32')]=_[_0x5ee1('0x33')](_0x1080e7[_0x5ee1('0x2f')],_0x1080e7[_0x5ee1('0x30')]);_0xf5d263[_0x5ee1('0x34')]=_['intersection'](_0x1080e7['model'],qs[_0x5ee1('0x35')](_0x4c66b7['query'][_0x5ee1('0x35')]));_0xf5d263['attributes']=_0xf5d263['attributes'][_0x5ee1('0x36')]?_0xf5d263[_0x5ee1('0x34')]:_0x1080e7[_0x5ee1('0x2f')];if(_0x4c66b7[_0x5ee1('0x30')][_0x5ee1('0x3e')]){_0xf5d263['include']=[{'all':!![]}];}_0xf5d263=_[_0x5ee1('0x3b')]({},_0xf5d263,_0x4c66b7[_0x5ee1('0x3d')]);return db[_0x5ee1('0x2a')][_0x5ee1('0x44')](_0xf5d263)[_0x5ee1('0x23')](handleEntityNotFound(_0x117829,null))[_0x5ee1('0x23')](respondWithResult(_0x117829,null))[_0x5ee1('0x41')](handleError(_0x117829,null));};exports['create']=function(_0x136ba8,_0x58a6d4){return db['OpenchannelTransferReport'][_0x5ee1('0x45')](_0x136ba8[_0x5ee1('0x46')],{})['then'](respondWithResult(_0x58a6d4,0xc9))[_0x5ee1('0x41')](handleError(_0x58a6d4,null));};exports['update']=function(_0xda6972,_0x144d0a){if(_0xda6972['body']['id']){delete _0xda6972[_0x5ee1('0x46')]['id'];}return db['OpenchannelTransferReport'][_0x5ee1('0x44')]({'where':{'id':_0xda6972['params']['id']}})[_0x5ee1('0x23')](handleEntityNotFound(_0x144d0a,null))['then'](saveUpdates(_0xda6972[_0x5ee1('0x46')],null))[_0x5ee1('0x23')](respondWithResult(_0x144d0a,null))[_0x5ee1('0x41')](handleError(_0x144d0a,null));};exports[_0x5ee1('0x24')]=function(_0x18648b,_0x2e411b){return db[_0x5ee1('0x2a')]['find']({'where':{'id':_0x18648b[_0x5ee1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e411b,null))[_0x5ee1('0x23')](removeEntity(_0x2e411b,null))[_0x5ee1('0x41')](handleError(_0x2e411b,null));};exports[_0x5ee1('0x47')]=function(_0x31f2b0,_0x25a722){return db['OpenchannelTransferReport'][_0x5ee1('0x47')]()[_0x5ee1('0x23')](respondWithResult(_0x25a722,null))[_0x5ee1('0x41')](handleError(_0x25a722,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d9f613e..fafb2a4 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 _0x041f=['rimraf','../../config/environment','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20b769,_0x1b070b){var _0x7b936=function(_0x52301a){while(--_0x52301a){_0x20b769['push'](_0x20b769['shift']());}};_0x7b936(++_0x1b070b);}(_0x041f,0x93));var _0xf041=function(_0xccf6ff,_0x15f7bb){_0xccf6ff=_0xccf6ff-0x0;var _0xeb0949=_0x041f[_0xccf6ff];return _0xeb0949;};'use strict';var _=require(_0xf041('0x0'));var util=require('util');var logger=require(_0xf041('0x1'))(_0xf041('0x2'));var moment=require(_0xf041('0x3'));var BPromise=require(_0xf041('0x4'));var rp=require(_0xf041('0x5'));var fs=require('fs');var path=require(_0xf041('0x6'));var rimraf=require(_0xf041('0x7'));var config=require(_0xf041('0x8'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x212ab5,_0x2fa4ad){return _0x212ab5['define']('OpenchannelTransferReport',attributes,{'tableName':_0xf041('0x9'),'paranoid':![],'indexes':[{'name':_0xf041('0xa'),'fields':[_0xf041('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc67f=['exports','define','OpenchannelTransferReport','uniqueid','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc67f,0x158));var _0xfc67=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc67f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc67('0x0'));var util=require(_0xfc67('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfc67('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc67('0x3'));var rimraf=require(_0xfc67('0x4'));var config=require(_0xfc67('0x5'));var attributes=require('./openchannelTransferReport.attributes');module[_0xfc67('0x6')]=function(_0x5b7a4e,_0x1d7102){return _0x5b7a4e[_0xfc67('0x7')](_0xfc67('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xfc67('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 5842e33..956c769 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 _0x83d3=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result'];(function(_0x3dc2ac,_0x4fd91d){var _0x55556a=function(_0x22bb43){while(--_0x22bb43){_0x3dc2ac['push'](_0x3dc2ac['shift']());}};_0x55556a(++_0x4fd91d);}(_0x83d3,0x17c));var _0x383d=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0x83d3[_0x91ed5c];return _0x2387d8;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var moment=require(_0x383d('0x2'));var BPromise=require(_0x383d('0x3'));var rs=require(_0x383d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x383d('0x5'))['db'];var utils=require(_0x383d('0x6'));var logger=require(_0x383d('0x7'))(_0x383d('0x8'));var config=require('../../config/environment');var jayson=require(_0x383d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbc074b,_0x2c3cab,_0x360bee){return new BPromise(function(_0x5641df,_0x303c1d){return client['request'](_0xbc074b,_0x360bee)['then'](function(_0x221079){logger[_0x383d('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));logger[_0x383d('0xc')](_0x383d('0xd'),_0x2c3cab,_0x383d('0xb'),JSON[_0x383d('0xe')](_0x221079));if(_0x221079[_0x383d('0xf')]){if(_0x221079['error']['code']===0x1f4){logger['error'](_0x383d('0x10'),_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x303c1d(_0x221079[_0x383d('0xf')][_0x383d('0x11')]);}logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x5641df(_0x221079['error'][_0x383d('0x11')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));_0x5641df(_0x221079[_0x383d('0x12')]['message']);}})['catch'](function(_0x11c1f9){logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x11c1f9);_0x303c1d(_0x11c1f9);});});} \ No newline at end of file +var _0x979e=['info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x979e,0x195));var _0xe979=function(_0x3efb3f,_0x11ccd4){_0x3efb3f=_0x3efb3f-0x0;var _0x3874f5=_0x979e[_0x3efb3f];return _0x3874f5;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var moment=require(_0xe979('0x2'));var BPromise=require(_0xe979('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe979('0x4'));var db=require(_0xe979('0x5'))['db'];var utils=require(_0xe979('0x6'));var logger=require(_0xe979('0x7'))(_0xe979('0x8'));var config=require('../../config/environment');var jayson=require(_0xe979('0x9'));var client=jayson['client'][_0xe979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a9ee,_0x441ffe,_0xc63524){return new BPromise(function(_0xc79c06,_0x3bbc32){return client[_0xe979('0xb')](_0x13a9ee,_0xc63524)[_0xe979('0xc')](function(_0x431a91){logger[_0xe979('0xd')](_0xe979('0xe'),_0x441ffe,'request\x20sent');logger[_0xe979('0xf')](_0xe979('0x10'),_0x441ffe,_0xe979('0x11'),JSON['stringify'](_0x431a91));if(_0x431a91[_0xe979('0x12')]){if(_0x431a91[_0xe979('0x12')][_0xe979('0x13')]===0x1f4){logger[_0xe979('0x12')](_0xe979('0xe'),_0x441ffe,_0x431a91[_0xe979('0x12')][_0xe979('0x14')]);return _0x3bbc32(_0x431a91[_0xe979('0x12')]['message']);}logger[_0xe979('0x12')](_0xe979('0xe'),_0x441ffe,_0x431a91[_0xe979('0x12')]['message']);return _0xc79c06(_0x431a91['error'][_0xe979('0x14')]);}else{logger[_0xe979('0xd')](_0xe979('0xe'),_0x441ffe,_0xe979('0x11'));_0xc79c06(_0x431a91['result'][_0xe979('0x14')]);}})[_0xe979('0x15')](function(_0xcb7fa1){logger[_0xe979('0x12')](_0xe979('0xe'),_0x441ffe,_0xcb7fa1);_0x3bbc32(_0xcb7fa1);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index d8c1e1b..b9cad8d 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 _0xeaa9=['show','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id'];(function(_0x515408,_0x27993d){var _0x374b70=function(_0x548c99){while(--_0x548c99){_0x515408['push'](_0x515408['shift']());}};_0x374b70(++_0x27993d);}(_0xeaa9,0x8d));var _0x9eaa=function(_0x4fa5e7,_0x42ad59){_0x4fa5e7=_0x4fa5e7-0x0;var _0x5da522=_0xeaa9[_0x4fa5e7];return _0x5da522;};'use strict';var multer=require(_0x9eaa('0x0'));var util=require(_0x9eaa('0x1'));var path=require('path');var timeout=require(_0x9eaa('0x2'));var express=require('express');var router=express[_0x9eaa('0x3')]();var fs_extra=require(_0x9eaa('0x4'));var auth=require(_0x9eaa('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x9eaa('0x6')]('/',auth[_0x9eaa('0x7')](),controller['index']);router[_0x9eaa('0x6')](_0x9eaa('0x8'),auth[_0x9eaa('0x7')](),controller[_0x9eaa('0x9')]);router['post']('/',auth[_0x9eaa('0x7')](),controller['create']);router[_0x9eaa('0xa')](_0x9eaa('0x8'),auth['isAuthenticated'](),controller[_0x9eaa('0xb')]);router[_0x9eaa('0xc')](_0x9eaa('0x8'),auth[_0x9eaa('0x7')](),controller[_0x9eaa('0xd')]);module[_0x9eaa('0xe')]=router; \ No newline at end of file +var _0x47fd=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5c17d8,_0x51cc20){var _0x1841de=function(_0x128311){while(--_0x128311){_0x5c17d8['push'](_0x5c17d8['shift']());}};_0x1841de(++_0x51cc20);}(_0x47fd,0x13c));var _0xd47f=function(_0xdbd1cf,_0x8d319d){_0xdbd1cf=_0xdbd1cf-0x0;var _0x3668c4=_0x47fd[_0xdbd1cf];return _0x3668c4;};'use strict';var multer=require(_0xd47f('0x0'));var util=require(_0xd47f('0x1'));var path=require(_0xd47f('0x2'));var timeout=require(_0xd47f('0x3'));var express=require(_0xd47f('0x4'));var router=express[_0xd47f('0x5')]();var fs_extra=require(_0xd47f('0x6'));var auth=require(_0xd47f('0x7'));var interaction=require(_0xd47f('0x8'));var config=require(_0xd47f('0x9'));var controller=require('./pause.controller');router[_0xd47f('0xa')]('/',auth[_0xd47f('0xb')](),controller['index']);router[_0xd47f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd47f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd47f('0xd')]);router[_0xd47f('0xe')](_0xd47f('0xf'),auth[_0xd47f('0xb')](),controller[_0xd47f('0x10')]);router[_0xd47f('0x11')]('/:id',auth[_0xd47f('0xb')](),controller[_0xd47f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 580bf11..6721a48 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 _0x8584=['name','sequelize','exports','STRING'];(function(_0x11e562,_0x4220e4){var _0x65f26d=function(_0x450371){while(--_0x450371){_0x11e562['push'](_0x11e562['shift']());}};_0x65f26d(++_0x4220e4);}(_0x8584,0x18d));var _0x4858=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x8584[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x4858('0x0'));module[_0x4858('0x1')]={'name':{'type':Sequelize[_0x4858('0x2')],'unique':_0x4858('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x4858('0x2')]}}; \ No newline at end of file +var _0x031c=['name','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x031c,0x1e7));var _0xc031=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x031c[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xc031('0x0')]={'name':{'type':Sequelize[_0xc031('0x1')],'unique':_0xc031('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc031('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 17fea4d..9ddb935 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 _0xf8d8=['params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','Pauses','destroy','error','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x3c42f0,_0x421a98){var _0x2e39da=function(_0x10db75){while(--_0x10db75){_0x3c42f0['push'](_0x3c42f0['shift']());}};_0x2e39da(++_0x421a98);}(_0xf8d8,0xa9));var _0x8f8d=function(_0x56f187,_0x2eec20){_0x56f187=_0x56f187-0x0;var _0x1b8b67=_0xf8d8[_0x56f187];return _0x1b8b67;};'use strict';var emlformat=require(_0x8f8d('0x0'));var rimraf=require(_0x8f8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f8d('0x2'));var rp=require(_0x8f8d('0x3'));var moment=require(_0x8f8d('0x4'));var BPromise=require(_0x8f8d('0x5'));var Mustache=require(_0x8f8d('0x6'));var util=require(_0x8f8d('0x7'));var path=require(_0x8f8d('0x8'));var sox=require('sox');var csv=require(_0x8f8d('0x9'));var ejs=require(_0x8f8d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f8d('0xb'));var squel=require(_0x8f8d('0xc'));var crypto=require(_0x8f8d('0xd'));var jsforce=require(_0x8f8d('0xe'));var deskjs=require(_0x8f8d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8f8d('0x10'));var Papa=require(_0x8f8d('0x11'));var Redis=require('ioredis');var authService=require(_0x8f8d('0x12'));var qs=require(_0x8f8d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f8d('0x14'));var logger=require(_0x8f8d('0x15'))(_0x8f8d('0x16'));var utils=require(_0x8f8d('0x17'));var config=require(_0x8f8d('0x18'));var licenseUtil=require(_0x8f8d('0x19'));var db=require(_0x8f8d('0x1a'))['db'];function respondWithStatusCode(_0x26b7fd,_0x35cd17){_0x35cd17=_0x35cd17||0xcc;return function(_0x5e78db){if(_0x5e78db){return _0x26b7fd[_0x8f8d('0x1b')](_0x35cd17);}return _0x26b7fd[_0x8f8d('0x1c')](_0x35cd17)[_0x8f8d('0x1d')]();};}function respondWithResult(_0x2bf334,_0x57e56c){_0x57e56c=_0x57e56c||0xc8;return function(_0x5688d7){if(_0x5688d7){return _0x2bf334['status'](_0x57e56c)[_0x8f8d('0x1e')](_0x5688d7);}};}function respondWithFilteredResult(_0x268ee5,_0x4df3af){return function(_0x295881){if(_0x295881){var _0x2863a4=typeof _0x4df3af[_0x8f8d('0x1f')]===_0x8f8d('0x20')&&typeof _0x4df3af[_0x8f8d('0x21')]===_0x8f8d('0x20');var _0x32e3ee=_0x295881[_0x8f8d('0x22')];var _0x3c7ce5=_0x2863a4?0x0:_0x4df3af[_0x8f8d('0x1f')];var _0x598d99=_0x2863a4?_0x295881['count']:_0x4df3af['offset']+_0x4df3af['limit'];var _0x253273;if(_0x598d99>=_0x32e3ee){_0x598d99=_0x32e3ee;_0x253273=0xc8;}else{_0x253273=0xce;}_0x268ee5[_0x8f8d('0x1c')](_0x253273);return _0x268ee5[_0x8f8d('0x23')](_0x8f8d('0x24'),_0x3c7ce5+'-'+_0x598d99+'/'+_0x32e3ee)[_0x8f8d('0x1e')](_0x295881);}return null;};}function patchUpdates(_0x5d8e2a){return function(_0x40b557){try{jsonpatch[_0x8f8d('0x25')](_0x40b557,_0x5d8e2a,!![]);}catch(_0x4ab96a){return BPromise['reject'](_0x4ab96a);}return _0x40b557[_0x8f8d('0x26')]();};}function saveUpdates(_0x363872,_0xd5b4c6){return function(_0x754c11){if(_0x754c11){return _0x754c11['update'](_0x363872)['then'](function(_0x39c02c){return _0x39c02c;});}return null;};}function removeEntity(_0x4f29da,_0x527b99){return function(_0x2b36fa){if(_0x2b36fa){return _0x2b36fa['destroy']()[_0x8f8d('0x27')](function(){var _0x4321f8=_0x2b36fa[_0x8f8d('0x28')]({'plain':!![]});var _0x58a471=_0x8f8d('0x29');return db['UserProfileResource'][_0x8f8d('0x2a')]({'where':{'type':_0x58a471,'resourceId':_0x4321f8['id']}})[_0x8f8d('0x27')](function(){return _0x2b36fa;});})['then'](function(){_0x4f29da[_0x8f8d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x350628,_0x3011d9){return function(_0x2e5c76){if(!_0x2e5c76){_0x350628[_0x8f8d('0x1b')](0x194);}return _0x2e5c76;};}function handleError(_0x466504,_0x3ce56e){_0x3ce56e=_0x3ce56e||0x1f4;return function(_0x579490){logger[_0x8f8d('0x2b')](_0x579490[_0x8f8d('0x2c')]);if(_0x579490['name']){delete _0x579490[_0x8f8d('0x2d')];}_0x466504[_0x8f8d('0x1c')](_0x3ce56e)[_0x8f8d('0x2e')](_0x579490);};}exports[_0x8f8d('0x2f')]=function(_0x8e1661,_0xc2e01a){var _0x4cc0f7={},_0x3b5f96={},_0x4c3ee5={'count':0x0,'rows':[]};var _0x1a0435=_['map'](db[_0x8f8d('0x30')][_0x8f8d('0x31')],function(_0x17cab4){return{'name':_0x17cab4[_0x8f8d('0x32')],'type':_0x17cab4[_0x8f8d('0x33')][_0x8f8d('0x34')]};});_0x3b5f96[_0x8f8d('0x35')]=_[_0x8f8d('0x36')](_0x1a0435,_0x8f8d('0x2d'));_0x3b5f96[_0x8f8d('0x37')]=_[_0x8f8d('0x38')](_0x8e1661[_0x8f8d('0x37')]);_0x3b5f96['filters']=_[_0x8f8d('0x39')](_0x3b5f96[_0x8f8d('0x35')],_0x3b5f96['query']);_0x4cc0f7[_0x8f8d('0x3a')]=_[_0x8f8d('0x39')](_0x3b5f96[_0x8f8d('0x35')],qs[_0x8f8d('0x3b')](_0x8e1661['query'][_0x8f8d('0x3b')]));_0x4cc0f7[_0x8f8d('0x3a')]=_0x4cc0f7[_0x8f8d('0x3a')]['length']?_0x4cc0f7[_0x8f8d('0x3a')]:_0x3b5f96[_0x8f8d('0x35')];if(!_0x8e1661[_0x8f8d('0x37')][_0x8f8d('0x3c')]('nolimit')){_0x4cc0f7[_0x8f8d('0x21')]=qs['limit'](_0x8e1661[_0x8f8d('0x37')][_0x8f8d('0x21')]);_0x4cc0f7[_0x8f8d('0x1f')]=qs['offset'](_0x8e1661[_0x8f8d('0x37')][_0x8f8d('0x1f')]);}_0x4cc0f7[_0x8f8d('0x3d')]=qs[_0x8f8d('0x3e')](_0x8e1661[_0x8f8d('0x37')][_0x8f8d('0x3e')]);_0x4cc0f7[_0x8f8d('0x3f')]=qs[_0x8f8d('0x40')](_['pick'](_0x8e1661[_0x8f8d('0x37')],_0x3b5f96['filters']),_0x1a0435);if(_0x8e1661[_0x8f8d('0x37')][_0x8f8d('0x41')]){_0x4cc0f7[_0x8f8d('0x3f')]=_['merge'](_0x4cc0f7[_0x8f8d('0x3f')],{'$or':_[_0x8f8d('0x36')](_0x1a0435,function(_0x1a4f0f){if(_0x1a4f0f['type']!=='VIRTUAL'){var _0x44f68a={};_0x44f68a[_0x1a4f0f[_0x8f8d('0x2d')]]={'$like':'%'+_0x8e1661[_0x8f8d('0x37')][_0x8f8d('0x41')]+'%'};return _0x44f68a;}})});}_0x4cc0f7=_[_0x8f8d('0x42')]({},_0x4cc0f7,_0x8e1661[_0x8f8d('0x43')]);var _0x2f38e2={'where':_0x4cc0f7['where']};return db[_0x8f8d('0x30')][_0x8f8d('0x22')](_0x2f38e2)[_0x8f8d('0x27')](function(_0x3822e5){_0x4c3ee5[_0x8f8d('0x22')]=_0x3822e5;if(_0x8e1661['query'][_0x8f8d('0x44')]){_0x4cc0f7[_0x8f8d('0x45')]=[{'all':!![]}];}return db['Pause'][_0x8f8d('0x46')](_0x4cc0f7);})[_0x8f8d('0x27')](function(_0x1c197f){_0x4c3ee5[_0x8f8d('0x47')]=_0x1c197f;return _0x4c3ee5;})[_0x8f8d('0x27')](respondWithFilteredResult(_0xc2e01a,_0x4cc0f7))[_0x8f8d('0x48')](handleError(_0xc2e01a,null));};exports['show']=function(_0x552b8a,_0x289168){var _0x465eb8={'raw':!![],'where':{'id':_0x552b8a['params']['id']}},_0x5f5d10={};_0x5f5d10['model']=_[_0x8f8d('0x38')](db['Pause'][_0x8f8d('0x31')]);_0x5f5d10[_0x8f8d('0x37')]=_[_0x8f8d('0x38')](_0x552b8a[_0x8f8d('0x37')]);_0x5f5d10['filters']=_[_0x8f8d('0x39')](_0x5f5d10['model'],_0x5f5d10[_0x8f8d('0x37')]);_0x465eb8['attributes']=_[_0x8f8d('0x39')](_0x5f5d10[_0x8f8d('0x35')],qs[_0x8f8d('0x3b')](_0x552b8a['query'][_0x8f8d('0x3b')]));_0x465eb8['attributes']=_0x465eb8[_0x8f8d('0x3a')]['length']?_0x465eb8['attributes']:_0x5f5d10[_0x8f8d('0x35')];if(_0x552b8a[_0x8f8d('0x37')]['includeAll']){_0x465eb8['include']=[{'all':!![]}];}_0x465eb8=_[_0x8f8d('0x42')]({},_0x465eb8,_0x552b8a['options']);return db[_0x8f8d('0x30')][_0x8f8d('0x49')](_0x465eb8)[_0x8f8d('0x27')](handleEntityNotFound(_0x289168,null))['then'](respondWithResult(_0x289168,null))[_0x8f8d('0x48')](handleError(_0x289168,null));};exports[_0x8f8d('0x4a')]=function(_0x3ee0ba,_0x388297){return db['Pause'][_0x8f8d('0x4a')](_0x3ee0ba[_0x8f8d('0x4b')],{})[_0x8f8d('0x27')](function(_0x44494d){var _0x154a2e=_0x3ee0ba[_0x8f8d('0x4c')][_0x8f8d('0x28')]({'plain':!![]});if(!_0x154a2e)throw new Error(_0x8f8d('0x4d'));if(_0x154a2e['role']===_0x8f8d('0x4c')){var _0x109f61=_0x44494d['get']({'plain':!![]});var _0x5f5bcc='Pauses';return db['UserProfileSection'][_0x8f8d('0x49')]({'where':{'name':_0x5f5bcc,'userProfileId':_0x154a2e[_0x8f8d('0x4e')]},'raw':!![]})[_0x8f8d('0x27')](function(_0x181324){if(_0x181324&&_0x181324[_0x8f8d('0x4f')]===0x0){return db[_0x8f8d('0x50')][_0x8f8d('0x4a')]({'name':_0x109f61['name'],'resourceId':_0x109f61['id'],'type':_0x181324[_0x8f8d('0x2d')],'sectionId':_0x181324['id']},{})[_0x8f8d('0x27')](function(){return _0x44494d;});}else{return _0x44494d;}})[_0x8f8d('0x48')](function(_0x51eaf4){logger[_0x8f8d('0x2b')](_0x8f8d('0x51'),_0x51eaf4);throw _0x51eaf4;});}return _0x44494d;})['then'](respondWithResult(_0x388297,0xc9))['catch'](handleError(_0x388297,null));};exports[_0x8f8d('0x52')]=function(_0x4dca3c,_0x572a0b){if(_0x4dca3c[_0x8f8d('0x4b')]['id']){delete _0x4dca3c['body']['id'];}return db[_0x8f8d('0x30')][_0x8f8d('0x49')]({'where':{'id':_0x4dca3c[_0x8f8d('0x53')]['id']}})[_0x8f8d('0x27')](handleEntityNotFound(_0x572a0b,null))[_0x8f8d('0x27')](saveUpdates(_0x4dca3c['body'],null))['then'](respondWithResult(_0x572a0b,null))['catch'](handleError(_0x572a0b,null));};exports[_0x8f8d('0x2a')]=function(_0x33f4bf,_0x36d5f7){return db[_0x8f8d('0x30')][_0x8f8d('0x49')]({'where':{'id':_0x33f4bf[_0x8f8d('0x53')]['id']}})['then'](handleEntityNotFound(_0x36d5f7,null))[_0x8f8d('0x27')](removeEntity(_0x36d5f7,null))['catch'](handleError(_0x36d5f7,null));}; \ No newline at end of file +var _0x6f5f=['util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Pause','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x466e43,_0x3c9412){var _0x2e8152=function(_0x2a0815){while(--_0x2a0815){_0x466e43['push'](_0x466e43['shift']());}};_0x2e8152(++_0x3c9412);}(_0x6f5f,0x146));var _0xf6f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f5f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf6f5('0x0'));var jsonpatch=require(_0xf6f5('0x1'));var rp=require(_0xf6f5('0x2'));var moment=require(_0xf6f5('0x3'));var BPromise=require(_0xf6f5('0x4'));var Mustache=require(_0xf6f5('0x5'));var util=require(_0xf6f5('0x6'));var path=require(_0xf6f5('0x7'));var sox=require(_0xf6f5('0x8'));var csv=require(_0xf6f5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f5('0xa'));var _=require(_0xf6f5('0xb'));var squel=require('squel');var crypto=require(_0xf6f5('0xc'));var jsforce=require(_0xf6f5('0xd'));var deskjs=require(_0xf6f5('0xe'));var toCsv=require(_0xf6f5('0x9'));var querystring=require('querystring');var Papa=require(_0xf6f5('0xf'));var Redis=require(_0xf6f5('0x10'));var authService=require(_0xf6f5('0x11'));var qs=require(_0xf6f5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6f5('0x13'))(_0xf6f5('0x14'));var utils=require(_0xf6f5('0x15'));var config=require(_0xf6f5('0x16'));var licenseUtil=require(_0xf6f5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54e060,_0x19080d){_0x19080d=_0x19080d||0xcc;return function(_0x1cd711){if(_0x1cd711){return _0x54e060['sendStatus'](_0x19080d);}return _0x54e060[_0xf6f5('0x18')](_0x19080d)[_0xf6f5('0x19')]();};}function respondWithResult(_0x31a6a5,_0x570e20){_0x570e20=_0x570e20||0xc8;return function(_0x3e30e9){if(_0x3e30e9){return _0x31a6a5['status'](_0x570e20)[_0xf6f5('0x1a')](_0x3e30e9);}};}function respondWithFilteredResult(_0x5ac901,_0x43f160){return function(_0x544580){if(_0x544580){var _0x21c5bc=typeof _0x43f160['offset']===_0xf6f5('0x1b')&&typeof _0x43f160[_0xf6f5('0x1c')]===_0xf6f5('0x1b');var _0x43fd75=_0x544580[_0xf6f5('0x1d')];var _0x404e59=_0x21c5bc?0x0:_0x43f160[_0xf6f5('0x1e')];var _0x1712e5=_0x21c5bc?_0x544580[_0xf6f5('0x1d')]:_0x43f160[_0xf6f5('0x1e')]+_0x43f160[_0xf6f5('0x1c')];var _0x3dd2ab;if(_0x1712e5>=_0x43fd75){_0x1712e5=_0x43fd75;_0x3dd2ab=0xc8;}else{_0x3dd2ab=0xce;}_0x5ac901['status'](_0x3dd2ab);return _0x5ac901['set']('Content-Range',_0x404e59+'-'+_0x1712e5+'/'+_0x43fd75)[_0xf6f5('0x1a')](_0x544580);}return null;};}function patchUpdates(_0x3013c1){return function(_0x2b2dee){try{jsonpatch[_0xf6f5('0x1f')](_0x2b2dee,_0x3013c1,!![]);}catch(_0xacac33){return BPromise[_0xf6f5('0x20')](_0xacac33);}return _0x2b2dee[_0xf6f5('0x21')]();};}function saveUpdates(_0x417b3b,_0xf47db0){return function(_0x1b7146){if(_0x1b7146){return _0x1b7146['update'](_0x417b3b)[_0xf6f5('0x22')](function(_0x1beaaa){return _0x1beaaa;});}return null;};}function removeEntity(_0xc724b,_0x1419fa){return function(_0x4f1038){if(_0x4f1038){return _0x4f1038['destroy']()['then'](function(){var _0x483772=_0x4f1038[_0xf6f5('0x23')]({'plain':!![]});var _0x3b6963=_0xf6f5('0x24');return db[_0xf6f5('0x25')][_0xf6f5('0x26')]({'where':{'type':_0x3b6963,'resourceId':_0x483772['id']}})['then'](function(){return _0x4f1038;});})[_0xf6f5('0x22')](function(){_0xc724b[_0xf6f5('0x18')](0xcc)[_0xf6f5('0x19')]();});}};}function handleEntityNotFound(_0x551a9d,_0x4653c5){return function(_0xe52cfe){if(!_0xe52cfe){_0x551a9d[_0xf6f5('0x27')](0x194);}return _0xe52cfe;};}function handleError(_0x4ca68f,_0x45a962){_0x45a962=_0x45a962||0x1f4;return function(_0x3e2c9e){logger[_0xf6f5('0x28')](_0x3e2c9e[_0xf6f5('0x29')]);if(_0x3e2c9e[_0xf6f5('0x2a')]){delete _0x3e2c9e[_0xf6f5('0x2a')];}_0x4ca68f[_0xf6f5('0x18')](_0x45a962)[_0xf6f5('0x2b')](_0x3e2c9e);};}exports[_0xf6f5('0x2c')]=function(_0x390fc5,_0x36ecf1){var _0x395168={},_0x406ac={},_0x5cce7b={'count':0x0,'rows':[]};var _0x417790=_[_0xf6f5('0x2d')](db['Pause']['rawAttributes'],function(_0x219214){return{'name':_0x219214[_0xf6f5('0x2e')],'type':_0x219214[_0xf6f5('0x2f')]['key']};});_0x406ac[_0xf6f5('0x30')]=_[_0xf6f5('0x2d')](_0x417790,_0xf6f5('0x2a'));_0x406ac[_0xf6f5('0x31')]=_[_0xf6f5('0x32')](_0x390fc5[_0xf6f5('0x31')]);_0x406ac[_0xf6f5('0x33')]=_[_0xf6f5('0x34')](_0x406ac[_0xf6f5('0x30')],_0x406ac[_0xf6f5('0x31')]);_0x395168[_0xf6f5('0x35')]=_[_0xf6f5('0x34')](_0x406ac[_0xf6f5('0x30')],qs[_0xf6f5('0x36')](_0x390fc5[_0xf6f5('0x31')]['fields']));_0x395168['attributes']=_0x395168['attributes'][_0xf6f5('0x37')]?_0x395168[_0xf6f5('0x35')]:_0x406ac[_0xf6f5('0x30')];if(!_0x390fc5['query'][_0xf6f5('0x38')](_0xf6f5('0x39'))){_0x395168['limit']=qs['limit'](_0x390fc5[_0xf6f5('0x31')]['limit']);_0x395168[_0xf6f5('0x1e')]=qs['offset'](_0x390fc5['query'][_0xf6f5('0x1e')]);}_0x395168[_0xf6f5('0x3a')]=qs[_0xf6f5('0x3b')](_0x390fc5['query']['sort']);_0x395168[_0xf6f5('0x3c')]=qs[_0xf6f5('0x33')](_[_0xf6f5('0x3d')](_0x390fc5[_0xf6f5('0x31')],_0x406ac[_0xf6f5('0x33')]),_0x417790);if(_0x390fc5['query']['filter']){_0x395168[_0xf6f5('0x3c')]=_[_0xf6f5('0x3e')](_0x395168[_0xf6f5('0x3c')],{'$or':_[_0xf6f5('0x2d')](_0x417790,function(_0x5ebe76){if(_0x5ebe76[_0xf6f5('0x2f')]!==_0xf6f5('0x3f')){var _0x211647={};_0x211647[_0x5ebe76[_0xf6f5('0x2a')]]={'$like':'%'+_0x390fc5[_0xf6f5('0x31')][_0xf6f5('0x40')]+'%'};return _0x211647;}})});}_0x395168=_[_0xf6f5('0x3e')]({},_0x395168,_0x390fc5[_0xf6f5('0x41')]);var _0x18e793={'where':_0x395168[_0xf6f5('0x3c')]};return db['Pause'][_0xf6f5('0x1d')](_0x18e793)[_0xf6f5('0x22')](function(_0x4a6a08){_0x5cce7b['count']=_0x4a6a08;if(_0x390fc5[_0xf6f5('0x31')][_0xf6f5('0x42')]){_0x395168[_0xf6f5('0x43')]=[{'all':!![]}];}return db[_0xf6f5('0x44')]['findAll'](_0x395168);})[_0xf6f5('0x22')](function(_0x11d87f){_0x5cce7b[_0xf6f5('0x45')]=_0x11d87f;return _0x5cce7b;})[_0xf6f5('0x22')](respondWithFilteredResult(_0x36ecf1,_0x395168))[_0xf6f5('0x46')](handleError(_0x36ecf1,null));};exports[_0xf6f5('0x47')]=function(_0x282fe2,_0x587b5b){var _0x189e8f={'raw':!![],'where':{'id':_0x282fe2[_0xf6f5('0x48')]['id']}},_0x55522c={};_0x55522c['model']=_[_0xf6f5('0x32')](db[_0xf6f5('0x44')][_0xf6f5('0x49')]);_0x55522c[_0xf6f5('0x31')]=_['keys'](_0x282fe2[_0xf6f5('0x31')]);_0x55522c['filters']=_[_0xf6f5('0x34')](_0x55522c[_0xf6f5('0x30')],_0x55522c[_0xf6f5('0x31')]);_0x189e8f[_0xf6f5('0x35')]=_[_0xf6f5('0x34')](_0x55522c[_0xf6f5('0x30')],qs['fields'](_0x282fe2[_0xf6f5('0x31')][_0xf6f5('0x36')]));_0x189e8f[_0xf6f5('0x35')]=_0x189e8f[_0xf6f5('0x35')][_0xf6f5('0x37')]?_0x189e8f[_0xf6f5('0x35')]:_0x55522c[_0xf6f5('0x30')];if(_0x282fe2[_0xf6f5('0x31')][_0xf6f5('0x42')]){_0x189e8f[_0xf6f5('0x43')]=[{'all':!![]}];}_0x189e8f=_[_0xf6f5('0x3e')]({},_0x189e8f,_0x282fe2[_0xf6f5('0x41')]);return db[_0xf6f5('0x44')][_0xf6f5('0x4a')](_0x189e8f)[_0xf6f5('0x22')](handleEntityNotFound(_0x587b5b,null))[_0xf6f5('0x22')](respondWithResult(_0x587b5b,null))[_0xf6f5('0x46')](handleError(_0x587b5b,null));};exports[_0xf6f5('0x4b')]=function(_0x2b0e30,_0x341a68){return db[_0xf6f5('0x44')][_0xf6f5('0x4b')](_0x2b0e30[_0xf6f5('0x4c')],{})[_0xf6f5('0x22')](function(_0x24cb6f){var _0x62ac17=_0x2b0e30[_0xf6f5('0x4d')][_0xf6f5('0x23')]({'plain':!![]});if(!_0x62ac17)throw new Error(_0xf6f5('0x4e'));if(_0x62ac17[_0xf6f5('0x4f')]===_0xf6f5('0x4d')){var _0x1c895a=_0x24cb6f[_0xf6f5('0x23')]({'plain':!![]});var _0x117116=_0xf6f5('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x117116,'userProfileId':_0x62ac17[_0xf6f5('0x50')]},'raw':!![]})['then'](function(_0x39b7fb){if(_0x39b7fb&&_0x39b7fb[_0xf6f5('0x51')]===0x0){return db[_0xf6f5('0x25')][_0xf6f5('0x4b')]({'name':_0x1c895a[_0xf6f5('0x2a')],'resourceId':_0x1c895a['id'],'type':_0x39b7fb[_0xf6f5('0x2a')],'sectionId':_0x39b7fb['id']},{})[_0xf6f5('0x22')](function(){return _0x24cb6f;});}else{return _0x24cb6f;}})[_0xf6f5('0x46')](function(_0x4c4841){logger[_0xf6f5('0x28')](_0xf6f5('0x52'),_0x4c4841);throw _0x4c4841;});}return _0x24cb6f;})[_0xf6f5('0x22')](respondWithResult(_0x341a68,0xc9))['catch'](handleError(_0x341a68,null));};exports['update']=function(_0x634503,_0x4fe32b){if(_0x634503['body']['id']){delete _0x634503['body']['id'];}return db[_0xf6f5('0x44')][_0xf6f5('0x4a')]({'where':{'id':_0x634503[_0xf6f5('0x48')]['id']}})[_0xf6f5('0x22')](handleEntityNotFound(_0x4fe32b,null))[_0xf6f5('0x22')](saveUpdates(_0x634503[_0xf6f5('0x4c')],null))[_0xf6f5('0x22')](respondWithResult(_0x4fe32b,null))[_0xf6f5('0x46')](handleError(_0x4fe32b,null));};exports['destroy']=function(_0x3c023d,_0x4b5096){return db[_0xf6f5('0x44')]['find']({'where':{'id':_0x3c023d[_0xf6f5('0x48')]['id']}})[_0xf6f5('0x22')](handleEntityNotFound(_0x4b5096,null))[_0xf6f5('0x22')](removeEntity(_0x4b5096,null))['catch'](handleError(_0x4b5096,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 1f1bb7d..6b269a9 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x2be5ed,_0x2875f0){var _0x3bb8b9=function(_0xb8d6ba){while(--_0xb8d6ba){_0x2be5ed['push'](_0x2be5ed['shift']());}};_0x3bb8b9(++_0x2875f0);}(_0xe14b,0x93));var _0xbe14=function(_0x3ffb4f,_0x32ca5a){_0x3ffb4f=_0x3ffb4f-0x0;var _0x5674f2=_0xe14b[_0x3ffb4f];return _0x5674f2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 4c7b3fb..bfde4c7 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3b902b,_0x5b09d2){var _0x43d02e=function(_0x417bb7){while(--_0x417bb7){_0x3b902b['push'](_0x3b902b['shift']());}};_0x43d02e(++_0x5b09d2);}(_0x7a54,0x106));var _0x47a5=function(_0x3ca6a2,_0x13b177){_0x3ca6a2=_0x3ca6a2-0x0;var _0x212b52=_0x7a54[_0x3ca6a2];return _0x212b52;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2d7e63,_0x1a4782){var _0x493944=function(_0x722446){while(--_0x722446){_0x2d7e63['push'](_0x2d7e63['shift']());}};_0x493944(++_0x1a4782);}(_0x7a54,0x106));var _0x47a5=function(_0x1f9136,_0x37d814){_0x1f9136=_0x1f9136-0x0;var _0x811203=_0x7a54[_0x1f9136];return _0x811203;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 38e30e9..d4bd6dc 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','/webhook','webhookPost'];(function(_0x490208,_0x46f559){var _0x56f3d7=function(_0x5ebd2b){while(--_0x5ebd2b){_0x490208['push'](_0x490208['shift']());}};_0x56f3d7(++_0x46f559);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xb4e6[_0x547456];return _0xc1fd7b;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/webhook',controller['webhookGet']);router[_0x6b4e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router[_0x6b4e('0x9')](_0x6b4e('0xc'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xd')]);var upload=multer({'storage':multer[_0x6b4e('0xe')]({'destination':function(_0x323487,_0x49c734,_0x39b4ec){_0x39b4ec(null,path[_0x6b4e('0xf')](config['root'],_0x6b4e('0x10')));},'filename':function(_0x9cd7da,_0x432399,_0x2b2ce0){_0x432399[_0x6b4e('0x11')]=_0x432399[_0x6b4e('0x11')][_0x6b4e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b2ce0(null,util['format'](_0x6b4e('0x13'),path[_0x6b4e('0x14')](_0x432399['originalname'],path[_0x6b4e('0x15')](_0x432399['originalname'])),Date[_0x6b4e('0x16')](),path[_0x6b4e('0x15')](_0x432399[_0x6b4e('0x11')])));}})});router[_0x6b4e('0x17')]('/',upload[_0x6b4e('0x18')](_0x6b4e('0x19')),controller['upload']);router['post'](_0x6b4e('0x1a'),controller[_0x6b4e('0x1b')]);router[_0x6b4e('0x1c')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1e')]);router[_0x6b4e('0x1f')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1f')]);module[_0x6b4e('0x20')]=router; \ No newline at end of file +var _0xa37e=['../../config/environment','./plugin.controller','get','/:id','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','format','basename','extname','now','post','upload','/webhook','webhookPost','delete','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x831e78,_0x1afec6){var _0x3e7ca0=function(_0x2c59fe){while(--_0x2c59fe){_0x831e78['push'](_0x831e78['shift']());}};_0x3e7ca0(++_0x1afec6);}(_0xa37e,0x97));var _0xea37=function(_0x42010c,_0x487184){_0x42010c=_0x42010c-0x0;var _0x5f3afd=_0xa37e[_0x42010c];return _0x5f3afd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea37('0x0'));var timeout=require(_0xea37('0x1'));var express=require(_0xea37('0x2'));var router=express[_0xea37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea37('0x5'));var controller=require(_0xea37('0x6'));router[_0xea37('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xea37('0x7')]('/webhook',controller['webhookGet']);router[_0xea37('0x7')](_0xea37('0x8'),auth[_0xea37('0x9')](),controller[_0xea37('0xa')]);router['get'](_0xea37('0xb'),auth[_0xea37('0x9')](),controller[_0xea37('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5060cd,_0x9a39cd,_0x117ce1){_0x117ce1(null,path[_0xea37('0xd')](config['root'],_0xea37('0xe')));},'filename':function(_0x2a0460,_0x2a2bcd,_0x589a61){_0x2a2bcd[_0xea37('0xf')]=_0x2a2bcd[_0xea37('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589a61(null,util[_0xea37('0x10')]('%s-%s%s',path[_0xea37('0x11')](_0x2a2bcd['originalname'],path[_0xea37('0x12')](_0x2a2bcd[_0xea37('0xf')])),Date[_0xea37('0x13')](),path[_0xea37('0x12')](_0x2a2bcd['originalname'])));}})});router[_0xea37('0x14')]('/',upload['single']('file'),controller[_0xea37('0x15')]);router['post'](_0xea37('0x16'),controller[_0xea37('0x17')]);router['put'](_0xea37('0x8'),auth[_0xea37('0x9')](),controller['update']);router[_0xea37('0x18')](_0xea37('0x8'),auth[_0xea37('0x9')](),controller[_0xea37('0x18')]);module[_0xea37('0x19')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 754ad1a..21bd3a2 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 _0x1c2a=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c2a,0xfd));var _0xa1c2=function(_0x45f5fa,_0x108728){_0x45f5fa=_0x45f5fa-0x0;var _0x44ead8=_0x1c2a[_0x45f5fa];return _0x44ead8;};'use strict';var Sequelize=require(_0xa1c2('0x0'));module[_0xa1c2('0x1')]={'name':{'type':Sequelize[_0xa1c2('0x2')]},'type':{'type':Sequelize['ENUM']('html',_0xa1c2('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xa1c2('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0xa1c2('0x5')},'active':{'type':Sequelize[_0xa1c2('0x6')],'defaultValue':0x0,'comment':_0xa1c2('0x7')},'sidebar':{'type':Sequelize[_0xa1c2('0x8')](_0xa1c2('0x9'),'agentOnly','always','never'),'defaultValue':_0xa1c2('0xa'),'comment':_0xa1c2('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xa1c2('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xa1c2('0x2')]},'scriptPath':{'type':Sequelize[_0xa1c2('0x2')]}}; \ No newline at end of file +var _0x1942=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always'];(function(_0x1dba49,_0x5815d9){var _0x2ff0c1=function(_0xb2b7ec){while(--_0xb2b7ec){_0x1dba49['push'](_0x1dba49['shift']());}};_0x2ff0c1(++_0x5815d9);}(_0x1942,0x16d));var _0x2194=function(_0x3e265e,_0x5d7cd2){_0x3e265e=_0x3e265e-0x0;var _0x5c7468=_0x1942[_0x3e265e];return _0x5c7468;};'use strict';var Sequelize=require(_0x2194('0x0'));module[_0x2194('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2194('0x2')](_0x2194('0x3'),_0x2194('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x2194('0x5')]},'path':{'type':Sequelize[_0x2194('0x6')],'comment':_0x2194('0x7')},'active':{'type':Sequelize[_0x2194('0x8')],'defaultValue':0x0,'comment':_0x2194('0x9')},'sidebar':{'type':Sequelize[_0x2194('0x2')](_0x2194('0xa'),'agentOnly',_0x2194('0xb'),'never'),'defaultValue':_0x2194('0xb'),'comment':_0x2194('0xc')},'icon':{'type':Sequelize[_0x2194('0x6')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x2194('0x6')]},'scriptName':{'type':Sequelize[_0x2194('0x6')]},'scriptPath':{'type':Sequelize[_0x2194('0x6')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 8b27c26..bd83181 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 _0x142b=['keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch','download','params','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','unlinkSync','Download\x20completed','info','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','agent','scriptPath','icon','admin','Warning:\x20admin\x20view\x20not\x20specified','test','plugins','script','scriptName','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','format','headers','content-length','content-type','endsWith','statusCode','%s%s','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','then','get','Plugins','destroy','error','stack','name','send','index','map','Plugin','fieldName','type','key','model','query'];(function(_0x50cf58,_0x20c020){var _0x45c17b=function(_0x2bbdbf){while(--_0x2bbdbf){_0x50cf58['push'](_0x50cf58['shift']());}};_0x45c17b(++_0x20c020);}(_0x142b,0x6c));var _0xb142=function(_0x41bf51,_0x1a13bc){_0x41bf51=_0x41bf51-0x0;var _0x4c8f47=_0x142b[_0x41bf51];return _0x4c8f47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb142('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb142('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb142('0x2'));var util=require(_0xb142('0x3'));var path=require(_0xb142('0x4'));var sox=require(_0xb142('0x5'));var csv=require(_0xb142('0x6'));var ejs=require(_0xb142('0x7'));var fs=require('fs');var fs_extra=require(_0xb142('0x8'));var _=require(_0xb142('0x9'));var squel=require('squel');var crypto=require(_0xb142('0xa'));var jsforce=require(_0xb142('0xb'));var deskjs=require(_0xb142('0xc'));var toCsv=require(_0xb142('0x6'));var querystring=require(_0xb142('0xd'));var Papa=require('papaparse');var extract=require(_0xb142('0xe'));var rimraf=require('rimraf');var archiver=require(_0xb142('0xf'));var Redis=require(_0xb142('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb142('0x11'));var as=require(_0xb142('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb142('0x13'))(_0xb142('0x14'));var utils=require(_0xb142('0x15'));var config=require(_0xb142('0x16'));var licenseUtil=require(_0xb142('0x17'));var db=require(_0xb142('0x18'))['db'];config[_0xb142('0x19')]=_[_0xb142('0x1a')](config[_0xb142('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb142('0x1b'))(new Redis(config[_0xb142('0x19')]));require('./plugin.socket')[_0xb142('0x1c')](socket);function respondWithStatusCode(_0x4db268,_0x29e9cd){_0x29e9cd=_0x29e9cd||0xcc;return function(_0x1cf7c3){if(_0x1cf7c3){return _0x4db268[_0xb142('0x1d')](_0x29e9cd);}return _0x4db268[_0xb142('0x1e')](_0x29e9cd)[_0xb142('0x1f')]();};}function respondWithResult(_0x42d361,_0x13844f){_0x13844f=_0x13844f||0xc8;return function(_0x2edbb7){if(_0x2edbb7){return _0x42d361[_0xb142('0x1e')](_0x13844f)[_0xb142('0x20')](_0x2edbb7);}};}function respondWithFilteredResult(_0x1ec636,_0x29bf91){return function(_0x300f3e){if(_0x300f3e){var _0xcbb690=typeof _0x29bf91['offset']===_0xb142('0x21')&&typeof _0x29bf91['limit']===_0xb142('0x21');var _0x31a0be=_0x300f3e['count'];var _0x1ed5af=_0xcbb690?0x0:_0x29bf91[_0xb142('0x22')];var _0x3e8536=_0xcbb690?_0x300f3e[_0xb142('0x23')]:_0x29bf91['offset']+_0x29bf91[_0xb142('0x24')];var _0x5e20e0;if(_0x3e8536>=_0x31a0be){_0x3e8536=_0x31a0be;_0x5e20e0=0xc8;}else{_0x5e20e0=0xce;}_0x1ec636[_0xb142('0x1e')](_0x5e20e0);return _0x1ec636[_0xb142('0x25')]('Content-Range',_0x1ed5af+'-'+_0x3e8536+'/'+_0x31a0be)[_0xb142('0x20')](_0x300f3e);}return null;};}function patchUpdates(_0x11ec98){return function(_0x205770){try{jsonpatch[_0xb142('0x26')](_0x205770,_0x11ec98,!![]);}catch(_0x32fb9b){return BPromise[_0xb142('0x27')](_0x32fb9b);}return _0x205770[_0xb142('0x28')]();};}function saveUpdates(_0x5d383e,_0x190372){return function(_0x1d5327){if(_0x1d5327){return _0x1d5327[_0xb142('0x29')](_0x5d383e)[_0xb142('0x2a')](function(_0x1a710e){return _0x1a710e;});}return null;};}function removeEntity(_0x114fc0,_0x3c27bf){return function(_0x31a893){if(_0x31a893){return _0x31a893['destroy']()['then'](function(){var _0xb61857=_0x31a893[_0xb142('0x2b')]({'plain':!![]});var _0x7533c6=_0xb142('0x2c');return db['UserProfileResource'][_0xb142('0x2d')]({'where':{'type':_0x7533c6,'resourceId':_0xb61857['id']}})[_0xb142('0x2a')](function(){return _0x31a893;});})[_0xb142('0x2a')](function(){_0x114fc0[_0xb142('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a4ba,_0x3505ce){return function(_0x5ed805){if(!_0x5ed805){_0x46a4ba['sendStatus'](0x194);}return _0x5ed805;};}function handleError(_0x1d0c62,_0x251362){_0x251362=_0x251362||0x1f4;return function(_0x262a08){logger[_0xb142('0x2e')](_0x262a08[_0xb142('0x2f')]);if(_0x262a08[_0xb142('0x30')]){delete _0x262a08[_0xb142('0x30')];}_0x1d0c62['status'](_0x251362)[_0xb142('0x31')](_0x262a08);};}exports[_0xb142('0x32')]=function(_0x28dea8,_0x320dcc){var _0x3428d7={},_0x23f3e8={},_0x47e0cb={'count':0x0,'rows':[]};var _0x33117a=_[_0xb142('0x33')](db[_0xb142('0x34')]['rawAttributes'],function(_0x2a01de){return{'name':_0x2a01de[_0xb142('0x35')],'type':_0x2a01de[_0xb142('0x36')][_0xb142('0x37')]};});_0x23f3e8[_0xb142('0x38')]=_[_0xb142('0x33')](_0x33117a,_0xb142('0x30'));_0x23f3e8[_0xb142('0x39')]=_[_0xb142('0x3a')](_0x28dea8[_0xb142('0x39')]);_0x23f3e8['filters']=_[_0xb142('0x3b')](_0x23f3e8[_0xb142('0x38')],_0x23f3e8[_0xb142('0x39')]);_0x3428d7[_0xb142('0x3c')]=_[_0xb142('0x3b')](_0x23f3e8[_0xb142('0x38')],qs[_0xb142('0x3d')](_0x28dea8[_0xb142('0x39')][_0xb142('0x3d')]));_0x3428d7[_0xb142('0x3c')]=_0x3428d7[_0xb142('0x3c')][_0xb142('0x3e')]?_0x3428d7['attributes']:_0x23f3e8[_0xb142('0x38')];if(!_0x28dea8[_0xb142('0x39')]['hasOwnProperty'](_0xb142('0x3f'))){_0x3428d7[_0xb142('0x24')]=qs[_0xb142('0x24')](_0x28dea8[_0xb142('0x39')][_0xb142('0x24')]);_0x3428d7[_0xb142('0x22')]=qs[_0xb142('0x22')](_0x28dea8['query'][_0xb142('0x22')]);}_0x3428d7['order']=qs[_0xb142('0x40')](_0x28dea8[_0xb142('0x39')][_0xb142('0x40')]);_0x3428d7[_0xb142('0x41')]=qs[_0xb142('0x42')](_[_0xb142('0x43')](_0x28dea8[_0xb142('0x39')],_0x23f3e8['filters']),_0x33117a);if(_0x28dea8['query'][_0xb142('0x44')]){_0x3428d7[_0xb142('0x41')]=_[_0xb142('0x45')](_0x3428d7['where'],{'$or':_[_0xb142('0x33')](_0x33117a,function(_0x591d66){if(_0x591d66[_0xb142('0x36')]!=='VIRTUAL'){var _0x2748b2={};_0x2748b2[_0x591d66['name']]={'$like':'%'+_0x28dea8[_0xb142('0x39')][_0xb142('0x44')]+'%'};return _0x2748b2;}})});}_0x3428d7=_[_0xb142('0x45')]({},_0x3428d7,_0x28dea8[_0xb142('0x46')]);var _0x4ee79b={'where':_0x3428d7[_0xb142('0x41')]};return db[_0xb142('0x34')][_0xb142('0x23')](_0x4ee79b)[_0xb142('0x2a')](function(_0x123cf5){_0x47e0cb[_0xb142('0x23')]=_0x123cf5;if(_0x28dea8[_0xb142('0x39')][_0xb142('0x47')]){_0x3428d7['include']=[{'all':!![]}];}return db['Plugin'][_0xb142('0x48')](_0x3428d7);})[_0xb142('0x2a')](function(_0x75d5dc){_0x47e0cb[_0xb142('0x49')]=_0x75d5dc;return _0x47e0cb;})[_0xb142('0x2a')](respondWithFilteredResult(_0x320dcc,_0x3428d7))['catch'](handleError(_0x320dcc,null));};exports[_0xb142('0x4a')]=function(_0x402ae4,_0x439ddb){var _0xfbafdb={'raw':!![],'where':{'id':_0x402ae4['params']['id']}},_0x127b1a={};_0x127b1a['model']=_[_0xb142('0x3a')](db[_0xb142('0x34')][_0xb142('0x4b')]);_0x127b1a[_0xb142('0x39')]=_['keys'](_0x402ae4[_0xb142('0x39')]);_0x127b1a['filters']=_[_0xb142('0x3b')](_0x127b1a[_0xb142('0x38')],_0x127b1a[_0xb142('0x39')]);_0xfbafdb[_0xb142('0x3c')]=_[_0xb142('0x3b')](_0x127b1a[_0xb142('0x38')],qs[_0xb142('0x3d')](_0x402ae4[_0xb142('0x39')][_0xb142('0x3d')]));_0xfbafdb['attributes']=_0xfbafdb[_0xb142('0x3c')][_0xb142('0x3e')]?_0xfbafdb[_0xb142('0x3c')]:_0x127b1a[_0xb142('0x38')];if(_0x402ae4['query'][_0xb142('0x47')]){_0xfbafdb[_0xb142('0x4c')]=[{'all':!![]}];}_0xfbafdb=_[_0xb142('0x45')]({},_0xfbafdb,_0x402ae4[_0xb142('0x46')]);return db['Plugin'][_0xb142('0x4d')](_0xfbafdb)['then'](handleEntityNotFound(_0x439ddb,null))[_0xb142('0x2a')](respondWithResult(_0x439ddb,null))[_0xb142('0x4e')](handleError(_0x439ddb,null));};exports[_0xb142('0x4f')]=function(_0x59bf65,_0x1fa9d4,_0xd1af3d){return db[_0xb142('0x34')][_0xb142('0x4d')]({'where':{'id':_0x59bf65[_0xb142('0x50')]['id']},'attributes':[_0xb142('0x30'),'path'],'raw':!![]})[_0xb142('0x2a')](handleEntityNotFound(_0x1fa9d4,null))[_0xb142('0x2a')](function(_0xf85fa7){if(_0xf85fa7){var _0x5204a7=path[_0xb142('0x51')](config[_0xb142('0x52')],_0xb142('0x53'),util['format'](_0xb142('0x54'),path[_0xb142('0x55')](_0xf85fa7['path'])));var _0x51cef8=fs[_0xb142('0x56')](_0x5204a7);var _0x4288f5=archiver(_0xb142('0x57'),{'zlib':{'level':0x9}});_0x4288f5['on'](_0xb142('0x58'),function(_0x3058b5){if(_0x3058b5[_0xb142('0x59')]===_0xb142('0x5a')){logger[_0xb142('0x2e')](_0x3058b5);}else{throw new db[(_0xb142('0x5b'))][(_0xb142('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4288f5['on'](_0xb142('0x2e'),function(_0x494234){throw new db[(_0xb142('0x5b'))][(_0xb142('0x5c'))](_0xb142('0x5d'));});_0x4288f5[_0xb142('0x5e')](_0x51cef8);_0x4288f5[_0xb142('0x5f')](_0xb142('0x60'),{'cwd':path[_0xb142('0x51')](config[_0xb142('0x52')],_0xb142('0x53'),path['dirname'](_0xf85fa7['path'])),'ignore':[path[_0xb142('0x51')](path['basename'](_0xf85fa7[_0xb142('0x4')]),_0xb142('0x61')),path['join'](path[_0xb142('0x55')](_0xf85fa7[_0xb142('0x4')]),_0xb142('0x62'))],'nodir':!![]})[_0xb142('0x63')]();_0x51cef8['on'](_0xb142('0x64'),function(){if(!fs['existsSync'](_0x5204a7)){throw new db[(_0xb142('0x5b'))][(_0xb142('0x5c'))](_0xb142('0x65'));}return _0x1fa9d4['download'](_0x5204a7,util['format'](_0xb142('0x54'),path[_0xb142('0x55')](_0xf85fa7[_0xb142('0x4')])),function(_0x4217e3){if(_0x4217e3){throw new db[(_0xb142('0x5b'))][(_0xb142('0x5c'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xb142('0x66')](_0x5204a7);logger['info'](_0xb142('0x67'));logger[_0xb142('0x68')]('Temporary\x20file\x20removed');});});}return null;})[_0xb142('0x4e')](handleError(_0x1fa9d4,null));};exports[_0xb142('0x69')]=function(_0x723e4f,_0x5e68a9,_0x4310d5){var _0x5cbfdf=path[_0xb142('0x55')](_0x723e4f[_0xb142('0x6a')][_0xb142('0x6b')],path[_0xb142('0x6c')](_0x723e4f[_0xb142('0x6a')][_0xb142('0x6b')]));var _0x55e33a=path[_0xb142('0x51')](config['root'],'server/files/plugins',_0x723e4f[_0xb142('0x6a')][_0xb142('0x6b')]);var _0x2ffeab=path['join'](config[_0xb142('0x52')],_0xb142('0x53'),_0x5cbfdf);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x55e33a);logger[_0xb142('0x68')](_0xb142('0x6d'),_0x2ffeab);try{fs[_0xb142('0x6e')](_0x55e33a,parseInt(_0xb142('0x6f'),0x8));extract(_0x55e33a,{'dir':_0x2ffeab},function(_0x2afe04){if(_0x2afe04){logger[_0xb142('0x2e')](_0x2afe04);handleError(_0x2afe04,!![]);};var _0x2401e8=fs[_0xb142('0x70')](_0x2ffeab);if(_0x2401e8[_0xb142('0x3e')]>0x1){removeReferences(_0x55e33a,_0x2ffeab);logger[_0xb142('0x2e')](_0xb142('0x71'));return _0x4310d5(new Error(_0xb142('0x71')));}var _0x356924=fs[_0xb142('0x72')](path[_0xb142('0x51')](_0x2ffeab,_0x2401e8[0x0]));if(_0x356924[_0xb142('0x73')]()){removeReferences(_0x55e33a,_0x2ffeab);logger['error'](_0xb142('0x71'));return _0x4310d5(new Error(_0xb142('0x71')));}if(_0x356924['isDirectory']()){var _0x213041=fs[_0xb142('0x70')](path[_0xb142('0x51')](_0x2ffeab,_0x2401e8[0x0]));if(_0x213041[_0xb142('0x3e')]===0x0){removeReferences(_0x55e33a,_0x2ffeab);logger['error'](_0xb142('0x71'));return _0x4310d5(new Error(_0xb142('0x71')));}var _0x259d2d=_0x213041[_0xb142('0x74')](function(_0x190f03){return _0x190f03===_0xb142('0x75');});if(!_0x259d2d){return _0x4310d5(new Error(_0xb142('0x76')));}var _0x4af903=fs[_0xb142('0x77')](path[_0xb142('0x51')](_0x2ffeab,_0x2401e8[0x0],'manifest.json'));var _0x18fda4=JSON['parse'](_0x4af903);if('undefined'==typeof _0x18fda4['name']){return _0x4310d5(new Error(_0xb142('0x78')));}if(_0xb142('0x21')==typeof _0x18fda4[_0xb142('0x36')]){return _0x4310d5(new Error(_0xb142('0x79')));}if('undefined'==typeof _0x18fda4[_0xb142('0x7a')]){return _0x4310d5(new Error(_0xb142('0x7b')));}if(_0xb142('0x21')==typeof _0x18fda4[_0xb142('0x7c')]){return _0x4310d5(new Error(_0xb142('0x7d')));}if(_0x18fda4['type']===_0xb142('0x7e')){if('undefined'==typeof _0x18fda4['parameters']['views']){return _0x4310d5(new Error(_0xb142('0x7f')));}if(_0xb142('0x21')==typeof _0x18fda4[_0xb142('0x7c')][_0xb142('0x80')]['admin']&&_0xb142('0x21')==typeof _0x18fda4['parameters'][_0xb142('0x80')][_0xb142('0x81')]){return _0x4310d5(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x18fda4['type']==='script'){if('undefined'==typeof _0x18fda4[_0xb142('0x7c')]['scriptName']){return _0x4310d5(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x18fda4['parameters'][_0xb142('0x82')]){return _0x4310d5(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x4310d5(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x290c04=_0x18fda4[_0xb142('0x30')];var _0x204660=_0x18fda4['description'];var _0x1dca1c=_0x18fda4['type'];var _0x4f685b=_0x18fda4['sidebar']?_0x18fda4['sidebar']:'always';var _0xcfb4a8=_0x18fda4[_0xb142('0x83')]?_0x18fda4[_0xb142('0x83')]:'icon-apps';var _0x4a9ebb='';var _0x412b68='';var _0x57a6dd='';var _0x329169='';var _0x4e86a5=_0x18fda4[_0xb142('0x7a')];if(_0x1dca1c===_0xb142('0x7e')){if(_0xb142('0x21')!=typeof _0x18fda4[_0xb142('0x7c')][_0xb142('0x80')][_0xb142('0x84')]){var _0x1b4ab0=_0x18fda4['parameters'][_0xb142('0x80')][_0xb142('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1b4ab0)){_0x4a9ebb=path['join']('plugins',_0x5cbfdf,_0x2401e8[0x0],_0x1b4ab0);}else{_0x4a9ebb=_0x1b4ab0;}}else{logger[_0xb142('0x68')](_0xb142('0x85'));}if(_0xb142('0x21')!=typeof _0x18fda4[_0xb142('0x7c')][_0xb142('0x80')]['agent']){var _0x396813=_0x18fda4[_0xb142('0x7c')][_0xb142('0x80')][_0xb142('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xb142('0x86')](_0x396813)){_0x412b68=path[_0xb142('0x51')](_0xb142('0x87'),_0x5cbfdf,_0x2401e8[0x0],_0x396813);}else{_0x412b68=_0x396813;}}else{logger[_0xb142('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1dca1c===_0xb142('0x88')){_0x57a6dd=_0x18fda4[_0xb142('0x7c')][_0xb142('0x89')];_0x329169=_0x18fda4[_0xb142('0x7c')][_0xb142('0x82')];if(_0xb142('0x21')!=typeof _0x18fda4['parameters'][_0xb142('0x80')]){if(_0xb142('0x21')!=typeof _0x18fda4[_0xb142('0x7c')]['views'][_0xb142('0x84')]){var _0x1b4ab0=_0x18fda4[_0xb142('0x7c')]['views'][_0xb142('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1b4ab0)){_0x4a9ebb=path['join'](_0xb142('0x87'),_0x5cbfdf,_0x2401e8[0x0],_0x1b4ab0);}else{_0x4a9ebb=_0x1b4ab0;}}if(_0xb142('0x21')!=typeof _0x18fda4['parameters'][_0xb142('0x80')]['agent']){var _0x396813=_0x18fda4[_0xb142('0x7c')][_0xb142('0x80')][_0xb142('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xb142('0x86')](_0x396813)){_0x412b68=path[_0xb142('0x51')]('plugins',_0x5cbfdf,_0x2401e8[0x0],_0x396813);}else{_0x412b68=_0x396813;}}}}var _0x169cb9={'name':_0x290c04,'description':_0x204660,'path':path[_0xb142('0x51')](_0x5cbfdf,_0x2401e8[0x0]),'type':_0x1dca1c,'sidebar':_0x4f685b,'icon':_0xcfb4a8,'adminUrl':_0x4a9ebb,'agentUrl':_0x412b68,'scriptName':_0x57a6dd,'scriptPath':_0x329169,'version':_0x4e86a5};removeReferences(_0x55e33a,null);return db[_0xb142('0x34')]['create'](_0x169cb9)[_0xb142('0x2a')](function(_0x573351){var _0x4d2c27={'role':_0x723e4f[_0xb142('0x8a')][_0xb142('0x8b')],'userProfileId':_0x723e4f['body'][_0xb142('0x8c')]};if(!_0x4d2c27)throw new Error(_0xb142('0x8d'));if(_0x4d2c27['role']===_0xb142('0x8e')){var _0x4bae15=_0x573351['get']({'plain':!![]});return db[_0xb142('0x8f')][_0xb142('0x4d')]({'where':{'name':_0xb142('0x2c'),'userProfileId':_0x4d2c27['userProfileId']},'raw':!![]})['then'](function(_0x1c323b){if(_0x1c323b&&_0x1c323b['autoAssociation']===0x0){return db[_0xb142('0x90')][_0xb142('0x91')]({'name':_0x4bae15[_0xb142('0x30')],'resourceId':_0x4bae15['id'],'type':_0x1c323b[_0xb142('0x30')],'sectionId':_0x1c323b['id']},{})[_0xb142('0x2a')](function(){return _0x573351;});}else{return _0x573351;}})[_0xb142('0x4e')](function(_0x14b36c){logger[_0xb142('0x2e')](_0xb142('0x92'),_0x14b36c);throw _0x14b36c;});}return _0x573351;})[_0xb142('0x2a')](respondWithResult(_0x5e68a9,null))['catch'](handleError(_0x5e68a9,null));}});}catch(_0xab6995){_0x5e68a9[_0xb142('0x1e')](0x1f4)['send'](_0xab6995);}};function removeReferences(_0x34821f,_0x462703){try{if(_0x34821f){fs[_0xb142('0x66')](_0x34821f);logger[_0xb142('0x68')]('Zip\x20archive\x20removed');}if(_0x462703){rimraf(_0x462703,function(){});logger[_0xb142('0x68')](_0xb142('0x93'));}}catch(_0x347f8f){logger[_0xb142('0x2e')](_0x347f8f);}}exports[_0xb142('0x29')]=function(_0x252f1c,_0x3672ea,_0x4a2e92){return db[_0xb142('0x34')]['find']({'where':{'id':_0x252f1c[_0xb142('0x50')]['id']}})[_0xb142('0x2a')](handleEntityNotFound(_0x3672ea,null))[_0xb142('0x2a')](saveUpdates(_0x252f1c['body'],null))[_0xb142('0x2a')](respondWithResult(_0x3672ea,null))[_0xb142('0x4e')](handleError(_0x3672ea,null));};exports[_0xb142('0x94')]=function(_0x1cfbf6,_0x562f7d,_0x7ece2c){return db['Plugin'][_0xb142('0x4d')]({'where':{'id':_0x1cfbf6[_0xb142('0x50')]['id']}})[_0xb142('0x2a')](function(_0xa68935){if(_0xa68935){return _0xa68935[_0xb142('0x2d')]();}})['then'](function(_0x206cf5){rimraf(path['join'](config[_0xb142('0x52')],_0xb142('0x53'),path[_0xb142('0x95')](_0x206cf5['path'])),function(){});return _0x206cf5;})[_0xb142('0x2a')](handleEntityNotFound(_0x562f7d,null))[_0xb142('0x2a')](respondWithStatusCode(_0x562f7d,null))['catch'](handleError(_0x562f7d,null));};exports[_0xb142('0x96')]=function(_0x28b308,_0x194da3,_0xfb47ca){return BPromise[_0xb142('0x97')]()[_0xb142('0x2a')](function(){if(!_0x28b308['query'][_0xb142('0x4')]){throw new Error(_0xb142('0x98'));}if(!_0x28b308[_0xb142('0x39')]['port']){throw new Error(_0xb142('0x99'));}var _0x42a9cf=_0x28b308[_0xb142('0x39')][_0xb142('0x9a')]?_0x28b308[_0xb142('0x39')][_0xb142('0x9a')]+':'+_0x28b308[_0xb142('0x39')][_0xb142('0x9b')]:_0xb142('0x9c')+_0x28b308[_0xb142('0x39')][_0xb142('0x9b')];var _0x18922e=_0x28b308[_0xb142('0x39')][_0xb142('0x20')]?_0x28b308[_0xb142('0x39')]['json']:!![];var _0x5dd662=_0x28b308[_0xb142('0x39')]['encoding']?_0x28b308['query'][_0xb142('0x9d')]:null;var _0x343635={'method':_0x28b308[_0xb142('0x9e')],'uri':util[_0xb142('0x9f')]('%s%s',_0x42a9cf,_0x28b308[_0xb142('0x39')]['path']),'json':_0x18922e,'resolveWithFullResponse':!![],'encoding':_0x5dd662,'qs':_0x28b308[_0xb142('0x39')]};if(_0x28b308[_0xb142('0xa0')]){_0x343635[_0xb142('0xa0')]=_0x28b308[_0xb142('0xa0')];if(_0x343635[_0xb142('0xa0')]['content-length']){delete _0x343635['headers'][_0xb142('0xa1')];}}if(_0x343635[_0xb142('0xa0')][_0xb142('0xa2')]){delete _0x343635[_0xb142('0xa0')][_0xb142('0xa2')];}return rp(_0x343635);})['then'](function(_0x4cf581){if(_0x4cf581){_0x194da3[_0xb142('0x25')](_0x4cf581[_0xb142('0xa0')]);logger[_0xb142('0x68')](_0x4cf581[_0xb142('0x8a')]);if(_[_0xb142('0xa3')](_0x28b308[_0xb142('0x39')][_0xb142('0x4')],_0xb142('0x4f'))&&_0x4cf581[_0xb142('0xa4')]==0x1f4){return _0x194da3[_0xb142('0x1d')](_0x4cf581['statusCode']);}else{return _0x194da3[_0xb142('0x1e')](_0x4cf581[_0xb142('0xa4')])[_0xb142('0x31')](_0x4cf581[_0xb142('0x8a')]);}}else{return _0x194da3[_0xb142('0x1d')](0xc8);}})['catch'](handleError(_0x194da3,null));};exports['webhookPost']=function(_0x3c8d88,_0x55e6f9,_0x2620c5){return BPromise['resolve']()[_0xb142('0x2a')](function(){if(!_0x3c8d88['query']['path']){throw new Error(_0xb142('0x98'));}if(!_0x3c8d88[_0xb142('0x39')]['port']){throw new Error(_0xb142('0x99'));}var _0x7ae873=_0x3c8d88[_0xb142('0x39')][_0xb142('0x9a')]?_0x3c8d88[_0xb142('0x39')][_0xb142('0x9a')]+':'+_0x3c8d88[_0xb142('0x39')][_0xb142('0x9b')]:_0xb142('0x9c')+_0x3c8d88['query']['port'];var _0x193798=_0x3c8d88['query'][_0xb142('0x20')]?_0x3c8d88['query'][_0xb142('0x20')]:!![];var _0xe8cd90=_0x3c8d88[_0xb142('0x39')][_0xb142('0x9d')]?_0x3c8d88['query'][_0xb142('0x9d')]:null;var _0x4b9e87={'method':_0x3c8d88[_0xb142('0x9e')],'uri':util[_0xb142('0x9f')](_0xb142('0xa5'),_0x7ae873,_0x3c8d88[_0xb142('0x39')][_0xb142('0x4')]),'json':_0x193798,'resolveWithFullResponse':!![],'encoding':_0xe8cd90,'body':_0x3c8d88['body']};if(_0x3c8d88[_0xb142('0xa0')]){_0x4b9e87['headers']=_0x3c8d88['headers'];if(_0x4b9e87['headers'][_0xb142('0xa1')]){delete _0x4b9e87[_0xb142('0xa0')][_0xb142('0xa1')];}}if(_0x4b9e87[_0xb142('0xa0')][_0xb142('0xa2')]){delete _0x4b9e87['headers'][_0xb142('0xa2')];}return rp(_0x4b9e87);})[_0xb142('0x2a')](function(_0x568360){if(_0x568360){_0x55e6f9[_0xb142('0x25')](_0x568360[_0xb142('0xa0')]);logger[_0xb142('0x68')](_0x568360[_0xb142('0x8a')]);return _0x55e6f9[_0xb142('0x1e')](_0x568360[_0xb142('0xa4')])[_0xb142('0x31')](_0x568360[_0xb142('0x8a')]);}else{return _0x55e6f9[_0xb142('0x1d')](0xc8);}})['catch'](handleError(_0x55e6f9,null));}; \ No newline at end of file +var _0x3dcf=['Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','set','download','sendStatus','statusCode','webhookPost','resolve','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','status','json','limit','undefined','offset','count','Content-Range','reject','save','then','Plugins','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','show','params','keys','length','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','root','dirname','node_modules/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','catch','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent'];(function(_0xda7bd1,_0x38e959){var _0x5bc7a3=function(_0x44e49e){while(--_0x44e49e){_0xda7bd1['push'](_0xda7bd1['shift']());}};_0x5bc7a3(++_0x38e959);}(_0x3dcf,0x188));var _0xf3dc=function(_0x13040f,_0x191408){_0x13040f=_0x13040f-0x0;var _0x4dd145=_0x3dcf[_0x13040f];return _0x4dd145;};'use strict';var emlformat=require(_0xf3dc('0x0'));var rimraf=require(_0xf3dc('0x1'));var zipdir=require(_0xf3dc('0x2'));var jsonpatch=require(_0xf3dc('0x3'));var rp=require(_0xf3dc('0x4'));var moment=require(_0xf3dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf3dc('0x6'));var util=require('util');var path=require(_0xf3dc('0x7'));var sox=require(_0xf3dc('0x8'));var csv=require(_0xf3dc('0x9'));var ejs=require(_0xf3dc('0xa'));var fs=require('fs');var fs_extra=require(_0xf3dc('0xb'));var _=require(_0xf3dc('0xc'));var squel=require(_0xf3dc('0xd'));var crypto=require(_0xf3dc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf3dc('0xf'));var toCsv=require(_0xf3dc('0x9'));var querystring=require(_0xf3dc('0x10'));var Papa=require(_0xf3dc('0x11'));var extract=require(_0xf3dc('0x12'));var rimraf=require('rimraf');var archiver=require(_0xf3dc('0x13'));var Redis=require('ioredis');var authService=require(_0xf3dc('0x14'));var qs=require(_0xf3dc('0x15'));var as=require(_0xf3dc('0x16'));var hardwareService=require(_0xf3dc('0x17'));var logger=require(_0xf3dc('0x18'))(_0xf3dc('0x19'));var utils=require(_0xf3dc('0x1a'));var config=require(_0xf3dc('0x1b'));var licenseUtil=require(_0xf3dc('0x1c'));var db=require(_0xf3dc('0x1d'))['db'];config[_0xf3dc('0x1e')]=_['defaults'](config[_0xf3dc('0x1e')],{'host':_0xf3dc('0x1f'),'port':0x18eb});var socket=require(_0xf3dc('0x20'))(new Redis(config[_0xf3dc('0x1e')]));require(_0xf3dc('0x21'))[_0xf3dc('0x22')](socket);function respondWithStatusCode(_0x2637dd,_0x2ba384){_0x2ba384=_0x2ba384||0xcc;return function(_0x4ce20c){if(_0x4ce20c){return _0x2637dd['sendStatus'](_0x2ba384);}return _0x2637dd[_0xf3dc('0x23')](_0x2ba384)['end']();};}function respondWithResult(_0x2a403d,_0x25b85e){_0x25b85e=_0x25b85e||0xc8;return function(_0xe5d32c){if(_0xe5d32c){return _0x2a403d['status'](_0x25b85e)[_0xf3dc('0x24')](_0xe5d32c);}};}function respondWithFilteredResult(_0x48bf8e,_0xed7b6){return function(_0x4fdc03){if(_0x4fdc03){var _0x1cafcd=typeof _0xed7b6['offset']==='undefined'&&typeof _0xed7b6[_0xf3dc('0x25')]===_0xf3dc('0x26');var _0x3778a8=_0x4fdc03['count'];var _0x58cbb6=_0x1cafcd?0x0:_0xed7b6[_0xf3dc('0x27')];var _0x2ebe48=_0x1cafcd?_0x4fdc03[_0xf3dc('0x28')]:_0xed7b6[_0xf3dc('0x27')]+_0xed7b6[_0xf3dc('0x25')];var _0x4d771a;if(_0x2ebe48>=_0x3778a8){_0x2ebe48=_0x3778a8;_0x4d771a=0xc8;}else{_0x4d771a=0xce;}_0x48bf8e[_0xf3dc('0x23')](_0x4d771a);return _0x48bf8e['set'](_0xf3dc('0x29'),_0x58cbb6+'-'+_0x2ebe48+'/'+_0x3778a8)[_0xf3dc('0x24')](_0x4fdc03);}return null;};}function patchUpdates(_0x479baa){return function(_0x78abe0){try{jsonpatch['apply'](_0x78abe0,_0x479baa,!![]);}catch(_0x13b833){return BPromise[_0xf3dc('0x2a')](_0x13b833);}return _0x78abe0[_0xf3dc('0x2b')]();};}function saveUpdates(_0x40efe0,_0x549ea9){return function(_0x2f7ec8){if(_0x2f7ec8){return _0x2f7ec8['update'](_0x40efe0)[_0xf3dc('0x2c')](function(_0x291b1b){return _0x291b1b;});}return null;};}function removeEntity(_0x302657,_0x4ba802){return function(_0x3e5f13){if(_0x3e5f13){return _0x3e5f13['destroy']()['then'](function(){var _0x57c1f0=_0x3e5f13['get']({'plain':!![]});var _0x5a7083=_0xf3dc('0x2d');return db[_0xf3dc('0x2e')][_0xf3dc('0x2f')]({'where':{'type':_0x5a7083,'resourceId':_0x57c1f0['id']}})[_0xf3dc('0x2c')](function(){return _0x3e5f13;});})[_0xf3dc('0x2c')](function(){_0x302657[_0xf3dc('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b9b4,_0x5821fe){return function(_0x294897){if(!_0x294897){_0x41b9b4['sendStatus'](0x194);}return _0x294897;};}function handleError(_0x1d862b,_0x57ab79){_0x57ab79=_0x57ab79||0x1f4;return function(_0x4b7770){logger[_0xf3dc('0x30')](_0x4b7770[_0xf3dc('0x31')]);if(_0x4b7770[_0xf3dc('0x32')]){delete _0x4b7770[_0xf3dc('0x32')];}_0x1d862b['status'](_0x57ab79)[_0xf3dc('0x33')](_0x4b7770);};}exports[_0xf3dc('0x34')]=function(_0x109289,_0x17558d){var _0x4d14f2={},_0x356ee7={},_0x29c3f3={'count':0x0,'rows':[]};var _0x8131c1=_[_0xf3dc('0x35')](db['Plugin'][_0xf3dc('0x36')],function(_0x3b508e){return{'name':_0x3b508e[_0xf3dc('0x37')],'type':_0x3b508e['type']['key']};});_0x356ee7[_0xf3dc('0x38')]=_[_0xf3dc('0x35')](_0x8131c1,_0xf3dc('0x32'));_0x356ee7['query']=_['keys'](_0x109289[_0xf3dc('0x39')]);_0x356ee7[_0xf3dc('0x3a')]=_['intersection'](_0x356ee7[_0xf3dc('0x38')],_0x356ee7[_0xf3dc('0x39')]);_0x4d14f2[_0xf3dc('0x3b')]=_[_0xf3dc('0x3c')](_0x356ee7[_0xf3dc('0x38')],qs[_0xf3dc('0x3d')](_0x109289[_0xf3dc('0x39')]['fields']));_0x4d14f2['attributes']=_0x4d14f2[_0xf3dc('0x3b')]['length']?_0x4d14f2[_0xf3dc('0x3b')]:_0x356ee7[_0xf3dc('0x38')];if(!_0x109289[_0xf3dc('0x39')]['hasOwnProperty'](_0xf3dc('0x3e'))){_0x4d14f2[_0xf3dc('0x25')]=qs['limit'](_0x109289[_0xf3dc('0x39')][_0xf3dc('0x25')]);_0x4d14f2[_0xf3dc('0x27')]=qs[_0xf3dc('0x27')](_0x109289['query'][_0xf3dc('0x27')]);}_0x4d14f2['order']=qs[_0xf3dc('0x3f')](_0x109289[_0xf3dc('0x39')][_0xf3dc('0x3f')]);_0x4d14f2['where']=qs[_0xf3dc('0x3a')](_[_0xf3dc('0x40')](_0x109289[_0xf3dc('0x39')],_0x356ee7[_0xf3dc('0x3a')]),_0x8131c1);if(_0x109289[_0xf3dc('0x39')][_0xf3dc('0x41')]){_0x4d14f2['where']=_[_0xf3dc('0x42')](_0x4d14f2[_0xf3dc('0x43')],{'$or':_[_0xf3dc('0x35')](_0x8131c1,function(_0x2544cf){if(_0x2544cf[_0xf3dc('0x44')]!==_0xf3dc('0x45')){var _0x4cc754={};_0x4cc754[_0x2544cf[_0xf3dc('0x32')]]={'$like':'%'+_0x109289[_0xf3dc('0x39')][_0xf3dc('0x41')]+'%'};return _0x4cc754;}})});}_0x4d14f2=_['merge']({},_0x4d14f2,_0x109289[_0xf3dc('0x46')]);var _0xf8d339={'where':_0x4d14f2['where']};return db[_0xf3dc('0x47')]['count'](_0xf8d339)[_0xf3dc('0x2c')](function(_0xeb2ac8){_0x29c3f3[_0xf3dc('0x28')]=_0xeb2ac8;if(_0x109289[_0xf3dc('0x39')][_0xf3dc('0x48')]){_0x4d14f2[_0xf3dc('0x49')]=[{'all':!![]}];}return db['Plugin'][_0xf3dc('0x4a')](_0x4d14f2);})[_0xf3dc('0x2c')](function(_0x538541){_0x29c3f3[_0xf3dc('0x4b')]=_0x538541;return _0x29c3f3;})['then'](respondWithFilteredResult(_0x17558d,_0x4d14f2))['catch'](handleError(_0x17558d,null));};exports[_0xf3dc('0x4c')]=function(_0x183f8b,_0x25f193){var _0x14c83e={'raw':!![],'where':{'id':_0x183f8b[_0xf3dc('0x4d')]['id']}},_0x2adc79={};_0x2adc79['model']=_[_0xf3dc('0x4e')](db[_0xf3dc('0x47')][_0xf3dc('0x36')]);_0x2adc79[_0xf3dc('0x39')]=_[_0xf3dc('0x4e')](_0x183f8b['query']);_0x2adc79[_0xf3dc('0x3a')]=_[_0xf3dc('0x3c')](_0x2adc79[_0xf3dc('0x38')],_0x2adc79[_0xf3dc('0x39')]);_0x14c83e[_0xf3dc('0x3b')]=_['intersection'](_0x2adc79[_0xf3dc('0x38')],qs[_0xf3dc('0x3d')](_0x183f8b[_0xf3dc('0x39')]['fields']));_0x14c83e[_0xf3dc('0x3b')]=_0x14c83e[_0xf3dc('0x3b')][_0xf3dc('0x4f')]?_0x14c83e[_0xf3dc('0x3b')]:_0x2adc79[_0xf3dc('0x38')];if(_0x183f8b['query'][_0xf3dc('0x48')]){_0x14c83e[_0xf3dc('0x49')]=[{'all':!![]}];}_0x14c83e=_[_0xf3dc('0x42')]({},_0x14c83e,_0x183f8b[_0xf3dc('0x46')]);return db[_0xf3dc('0x47')][_0xf3dc('0x50')](_0x14c83e)[_0xf3dc('0x2c')](handleEntityNotFound(_0x25f193,null))[_0xf3dc('0x2c')](respondWithResult(_0x25f193,null))['catch'](handleError(_0x25f193,null));};exports['download']=function(_0x4061e0,_0x54f017,_0x5bdb03){return db[_0xf3dc('0x47')][_0xf3dc('0x50')]({'where':{'id':_0x4061e0[_0xf3dc('0x4d')]['id']},'attributes':[_0xf3dc('0x32'),_0xf3dc('0x7')],'raw':!![]})[_0xf3dc('0x2c')](handleEntityNotFound(_0x54f017,null))[_0xf3dc('0x2c')](function(_0x20ea1c){if(_0x20ea1c){var _0xe8e576=path[_0xf3dc('0x51')](config['root'],_0xf3dc('0x52'),util[_0xf3dc('0x53')](_0xf3dc('0x54'),path[_0xf3dc('0x55')](_0x20ea1c['path'])));var _0x2a05fb=fs[_0xf3dc('0x56')](_0xe8e576);var _0x485af6=archiver(_0xf3dc('0x57'),{'zlib':{'level':0x9}});_0x485af6['on'](_0xf3dc('0x58'),function(_0x3dcec7){if(_0x3dcec7[_0xf3dc('0x59')]===_0xf3dc('0x5a')){logger[_0xf3dc('0x30')](_0x3dcec7);}else{throw new db[(_0xf3dc('0x5b'))][(_0xf3dc('0x5c'))](_0xf3dc('0x5d'));}});_0x485af6['on'](_0xf3dc('0x30'),function(_0xee28c8){throw new db[(_0xf3dc('0x5b'))][(_0xf3dc('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x485af6['pipe'](_0x2a05fb);_0x485af6[_0xf3dc('0x5e')]('**/*',{'cwd':path[_0xf3dc('0x51')](config[_0xf3dc('0x5f')],_0xf3dc('0x52'),path[_0xf3dc('0x60')](_0x20ea1c[_0xf3dc('0x7')])),'ignore':[path[_0xf3dc('0x51')](path['basename'](_0x20ea1c['path']),_0xf3dc('0x61')),path[_0xf3dc('0x51')](path[_0xf3dc('0x55')](_0x20ea1c[_0xf3dc('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xf3dc('0x62')]();_0x2a05fb['on'](_0xf3dc('0x63'),function(){if(!fs['existsSync'](_0xe8e576)){throw new db[(_0xf3dc('0x5b'))][(_0xf3dc('0x5c'))](_0xf3dc('0x64'));}return _0x54f017['download'](_0xe8e576,util[_0xf3dc('0x53')](_0xf3dc('0x54'),path[_0xf3dc('0x55')](_0x20ea1c['path'])),function(_0x3c029b){if(_0x3c029b){throw new db['Sequelize'][(_0xf3dc('0x5c'))](_0xf3dc('0x65'));}fs[_0xf3dc('0x66')](_0xe8e576);logger[_0xf3dc('0x67')](_0xf3dc('0x68'));logger[_0xf3dc('0x67')](_0xf3dc('0x69'));});});}return null;})[_0xf3dc('0x6a')](handleError(_0x54f017,null));};exports['upload']=function(_0x6255e6,_0x30413c,_0x348a6e){var _0x460ab6=path['basename'](_0x6255e6[_0xf3dc('0x6b')]['filename'],path[_0xf3dc('0x6c')](_0x6255e6[_0xf3dc('0x6b')][_0xf3dc('0x6d')]));var _0x13224f=path[_0xf3dc('0x51')](config[_0xf3dc('0x5f')],_0xf3dc('0x52'),_0x6255e6['file'][_0xf3dc('0x6d')]);var _0x2fdfc7=path['join'](config['root'],_0xf3dc('0x52'),_0x460ab6);logger['info'](_0xf3dc('0x6e'),_0x13224f);logger[_0xf3dc('0x67')](_0xf3dc('0x6f'),_0x2fdfc7);try{fs[_0xf3dc('0x70')](_0x13224f,parseInt(_0xf3dc('0x71'),0x8));extract(_0x13224f,{'dir':_0x2fdfc7},function(_0x456a1d){if(_0x456a1d){logger[_0xf3dc('0x30')](_0x456a1d);handleError(_0x456a1d,!![]);};var _0x274dfc=fs[_0xf3dc('0x72')](_0x2fdfc7);if(_0x274dfc[_0xf3dc('0x4f')]>0x1){removeReferences(_0x13224f,_0x2fdfc7);logger['error'](_0xf3dc('0x73'));return _0x348a6e(new Error(_0xf3dc('0x73')));}var _0x51d8b9=fs[_0xf3dc('0x74')](path[_0xf3dc('0x51')](_0x2fdfc7,_0x274dfc[0x0]));if(_0x51d8b9[_0xf3dc('0x75')]()){removeReferences(_0x13224f,_0x2fdfc7);logger[_0xf3dc('0x30')](_0xf3dc('0x73'));return _0x348a6e(new Error('Invalid\x20plugin\x20structure'));}if(_0x51d8b9[_0xf3dc('0x76')]()){var _0x3b6e9f=fs[_0xf3dc('0x72')](path[_0xf3dc('0x51')](_0x2fdfc7,_0x274dfc[0x0]));if(_0x3b6e9f[_0xf3dc('0x4f')]===0x0){removeReferences(_0x13224f,_0x2fdfc7);logger[_0xf3dc('0x30')](_0xf3dc('0x73'));return _0x348a6e(new Error(_0xf3dc('0x73')));}var _0x54b4af=_0x3b6e9f[_0xf3dc('0x77')](function(_0x1adbdd){return _0x1adbdd===_0xf3dc('0x78');});if(!_0x54b4af){return _0x348a6e(new Error(_0xf3dc('0x79')));}var _0x42b19b=fs[_0xf3dc('0x7a')](path['join'](_0x2fdfc7,_0x274dfc[0x0],_0xf3dc('0x78')));var _0x286cdd=JSON[_0xf3dc('0x7b')](_0x42b19b);if(_0xf3dc('0x26')==typeof _0x286cdd[_0xf3dc('0x32')]){return _0x348a6e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x286cdd[_0xf3dc('0x44')]){return _0x348a6e(new Error(_0xf3dc('0x7c')));}if('undefined'==typeof _0x286cdd[_0xf3dc('0x7d')]){return _0x348a6e(new Error(_0xf3dc('0x7e')));}if(_0xf3dc('0x26')==typeof _0x286cdd['parameters']){return _0x348a6e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x286cdd[_0xf3dc('0x44')]===_0xf3dc('0x7f')){if(_0xf3dc('0x26')==typeof _0x286cdd[_0xf3dc('0x80')]['views']){return _0x348a6e(new Error(_0xf3dc('0x81')));}if('undefined'==typeof _0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x83')]&&_0xf3dc('0x26')==typeof _0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x84')]){return _0x348a6e(new Error(_0xf3dc('0x85')));}}else if(_0x286cdd['type']===_0xf3dc('0x86')){if(_0xf3dc('0x26')==typeof _0x286cdd['parameters'][_0xf3dc('0x87')]){return _0x348a6e(new Error(_0xf3dc('0x88')));}if(_0xf3dc('0x26')==typeof _0x286cdd['parameters']['scriptPath']){return _0x348a6e(new Error(_0xf3dc('0x89')));}}else{return _0x348a6e(new Error(_0xf3dc('0x8a')));}var _0x19aa64=_0x286cdd[_0xf3dc('0x32')];var _0xba7786=_0x286cdd[_0xf3dc('0x8b')];var _0x28d97c=_0x286cdd['type'];var _0x5bfff9=_0x286cdd['sidebar']?_0x286cdd[_0xf3dc('0x8c')]:_0xf3dc('0x8d');var _0x352f8b=_0x286cdd['icon']?_0x286cdd['icon']:'icon-apps';var _0xe063ee='';var _0x58c0d0='';var _0x4f58b4='';var _0xc7363f='';var _0x3891b8=_0x286cdd[_0xf3dc('0x7d')];if(_0x28d97c===_0xf3dc('0x7f')){if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')]['views'][_0xf3dc('0x83')]){var _0x3832f8=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xf3dc('0x8e')](_0x3832f8)){_0xe063ee=path['join'](_0xf3dc('0x8f'),_0x460ab6,_0x274dfc[0x0],_0x3832f8);}else{_0xe063ee=_0x3832f8;}}else{logger['info'](_0xf3dc('0x90'));}if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')]['views']['agent']){var _0x114d62=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xf3dc('0x8e')](_0x114d62)){_0x58c0d0=path[_0xf3dc('0x51')](_0xf3dc('0x8f'),_0x460ab6,_0x274dfc[0x0],_0x114d62);}else{_0x58c0d0=_0x114d62;}}else{logger[_0xf3dc('0x67')](_0xf3dc('0x91'));}}else if(_0x28d97c==='script'){_0x4f58b4=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x87')];_0xc7363f=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x92')];if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')]['views']){if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')]['admin']){var _0x3832f8=_0x286cdd['parameters'][_0xf3dc('0x82')][_0xf3dc('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xf3dc('0x8e')](_0x3832f8)){_0xe063ee=path[_0xf3dc('0x51')]('plugins',_0x460ab6,_0x274dfc[0x0],_0x3832f8);}else{_0xe063ee=_0x3832f8;}}if('undefined'!=typeof _0x286cdd[_0xf3dc('0x80')]['views']['agent']){var _0x114d62=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x114d62)){_0x58c0d0=path[_0xf3dc('0x51')](_0xf3dc('0x8f'),_0x460ab6,_0x274dfc[0x0],_0x114d62);}else{_0x58c0d0=_0x114d62;}}}}var _0x434e12={'name':_0x19aa64,'description':_0xba7786,'path':path[_0xf3dc('0x51')](_0x460ab6,_0x274dfc[0x0]),'type':_0x28d97c,'sidebar':_0x5bfff9,'icon':_0x352f8b,'adminUrl':_0xe063ee,'agentUrl':_0x58c0d0,'scriptName':_0x4f58b4,'scriptPath':_0xc7363f,'version':_0x3891b8};removeReferences(_0x13224f,null);return db[_0xf3dc('0x47')][_0xf3dc('0x93')](_0x434e12)['then'](function(_0x10e4ae){var _0x3ac23c={'role':_0x6255e6[_0xf3dc('0x94')][_0xf3dc('0x95')],'userProfileId':_0x6255e6[_0xf3dc('0x94')][_0xf3dc('0x96')]};if(!_0x3ac23c)throw new Error(_0xf3dc('0x97'));if(_0x3ac23c['role']===_0xf3dc('0x98')){var _0x232102=_0x10e4ae['get']({'plain':!![]});return db[_0xf3dc('0x99')][_0xf3dc('0x50')]({'where':{'name':_0xf3dc('0x2d'),'userProfileId':_0x3ac23c[_0xf3dc('0x96')]},'raw':!![]})[_0xf3dc('0x2c')](function(_0x5cc9ab){if(_0x5cc9ab&&_0x5cc9ab[_0xf3dc('0x9a')]===0x0){return db[_0xf3dc('0x2e')][_0xf3dc('0x93')]({'name':_0x232102['name'],'resourceId':_0x232102['id'],'type':_0x5cc9ab[_0xf3dc('0x32')],'sectionId':_0x5cc9ab['id']},{})['then'](function(){return _0x10e4ae;});}else{return _0x10e4ae;}})[_0xf3dc('0x6a')](function(_0x9a143f){logger[_0xf3dc('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9a143f);throw _0x9a143f;});}return _0x10e4ae;})[_0xf3dc('0x2c')](respondWithResult(_0x30413c,null))[_0xf3dc('0x6a')](handleError(_0x30413c,null));}});}catch(_0x4c325f){_0x30413c[_0xf3dc('0x23')](0x1f4)[_0xf3dc('0x33')](_0x4c325f);}};function removeReferences(_0x451d09,_0x1a8963){try{if(_0x451d09){fs[_0xf3dc('0x66')](_0x451d09);logger[_0xf3dc('0x67')](_0xf3dc('0x9b'));}if(_0x1a8963){rimraf(_0x1a8963,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x215e2f){logger[_0xf3dc('0x30')](_0x215e2f);}}exports['update']=function(_0x225bb0,_0x1c1076,_0x5ec930){return db[_0xf3dc('0x47')][_0xf3dc('0x50')]({'where':{'id':_0x225bb0['params']['id']}})['then'](handleEntityNotFound(_0x1c1076,null))[_0xf3dc('0x2c')](saveUpdates(_0x225bb0[_0xf3dc('0x94')],null))[_0xf3dc('0x2c')](respondWithResult(_0x1c1076,null))[_0xf3dc('0x6a')](handleError(_0x1c1076,null));};exports[_0xf3dc('0x9c')]=function(_0x84e61d,_0xda9955,_0x535077){return db[_0xf3dc('0x47')][_0xf3dc('0x50')]({'where':{'id':_0x84e61d[_0xf3dc('0x4d')]['id']}})['then'](function(_0x41ecf5){if(_0x41ecf5){return _0x41ecf5[_0xf3dc('0x2f')]();}})[_0xf3dc('0x2c')](function(_0x2d055d){rimraf(path[_0xf3dc('0x51')](config['root'],_0xf3dc('0x52'),path[_0xf3dc('0x60')](_0x2d055d[_0xf3dc('0x7')])),function(){});return _0x2d055d;})[_0xf3dc('0x2c')](handleEntityNotFound(_0xda9955,null))[_0xf3dc('0x2c')](respondWithStatusCode(_0xda9955,null))['catch'](handleError(_0xda9955,null));};exports[_0xf3dc('0x9d')]=function(_0x5cabda,_0x5d37ab,_0x2bc8e5){return BPromise['resolve']()['then'](function(){if(!_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x7')]){throw new Error(_0xf3dc('0x9e'));}if(!_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x9f')]){throw new Error(_0xf3dc('0xa0'));}var _0x2ff642=_0x5cabda[_0xf3dc('0x39')]['hostname']?_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0xa1')]+':'+_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x9f')]:'http://localhost:'+_0x5cabda[_0xf3dc('0x39')]['port'];var _0x459532=_0x5cabda[_0xf3dc('0x39')]['json']?_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x24')]:!![];var _0x264af0=_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0xa2')]?_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0xa2')]:null;var _0x391c90={'method':_0x5cabda[_0xf3dc('0xa3')],'uri':util[_0xf3dc('0x53')](_0xf3dc('0xa4'),_0x2ff642,_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x7')]),'json':_0x459532,'resolveWithFullResponse':!![],'encoding':_0x264af0,'qs':_0x5cabda['query']};if(_0x5cabda['headers']){_0x391c90[_0xf3dc('0xa5')]=_0x5cabda[_0xf3dc('0xa5')];if(_0x391c90['headers'][_0xf3dc('0xa6')]){delete _0x391c90[_0xf3dc('0xa5')][_0xf3dc('0xa6')];}}if(_0x391c90[_0xf3dc('0xa5')][_0xf3dc('0xa7')]){delete _0x391c90[_0xf3dc('0xa5')][_0xf3dc('0xa7')];}return rp(_0x391c90);})[_0xf3dc('0x2c')](function(_0x3f67ac){if(_0x3f67ac){_0x5d37ab[_0xf3dc('0xa8')](_0x3f67ac[_0xf3dc('0xa5')]);logger[_0xf3dc('0x67')](_0x3f67ac['body']);if(_['endsWith'](_0x5cabda[_0xf3dc('0x39')]['path'],_0xf3dc('0xa9'))&&_0x3f67ac['statusCode']==0x1f4){return _0x5d37ab[_0xf3dc('0xaa')](_0x3f67ac['statusCode']);}else{return _0x5d37ab[_0xf3dc('0x23')](_0x3f67ac[_0xf3dc('0xab')])[_0xf3dc('0x33')](_0x3f67ac[_0xf3dc('0x94')]);}}else{return _0x5d37ab[_0xf3dc('0xaa')](0xc8);}})[_0xf3dc('0x6a')](handleError(_0x5d37ab,null));};exports[_0xf3dc('0xac')]=function(_0x5813d0,_0x21f857,_0x5a6b97){return BPromise[_0xf3dc('0xad')]()['then'](function(){if(!_0x5813d0[_0xf3dc('0x39')]['path']){throw new Error(_0xf3dc('0x9e'));}if(!_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4d55a2=_0x5813d0[_0xf3dc('0x39')]['hostname']?_0x5813d0[_0xf3dc('0x39')]['hostname']+':'+_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0x9f')]:_0xf3dc('0xae')+_0x5813d0[_0xf3dc('0x39')]['port'];var _0x42f236=_0x5813d0[_0xf3dc('0x39')]['json']?_0x5813d0['query'][_0xf3dc('0x24')]:!![];var _0x54caae=_0x5813d0[_0xf3dc('0x39')]['encoding']?_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0xa2')]:null;var _0x45f3a6={'method':_0x5813d0[_0xf3dc('0xa3')],'uri':util[_0xf3dc('0x53')]('%s%s',_0x4d55a2,_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0x7')]),'json':_0x42f236,'resolveWithFullResponse':!![],'encoding':_0x54caae,'body':_0x5813d0[_0xf3dc('0x94')]};if(_0x5813d0[_0xf3dc('0xa5')]){_0x45f3a6[_0xf3dc('0xa5')]=_0x5813d0[_0xf3dc('0xa5')];if(_0x45f3a6[_0xf3dc('0xa5')]['content-length']){delete _0x45f3a6['headers']['content-length'];}}if(_0x45f3a6[_0xf3dc('0xa5')][_0xf3dc('0xa7')]){delete _0x45f3a6[_0xf3dc('0xa5')]['content-type'];}return rp(_0x45f3a6);})['then'](function(_0x14a4a6){if(_0x14a4a6){_0x21f857[_0xf3dc('0xa8')](_0x14a4a6[_0xf3dc('0xa5')]);logger[_0xf3dc('0x67')](_0x14a4a6['body']);return _0x21f857[_0xf3dc('0x23')](_0x14a4a6[_0xf3dc('0xab')])[_0xf3dc('0x33')](_0x14a4a6[_0xf3dc('0x94')]);}else{return _0x21f857['sendStatus'](0xc8);}})[_0xf3dc('0x6a')](handleError(_0x21f857,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 789cf0e..f524618 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 _0x0619=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','update','remove'];(function(_0xd990ab,_0x538aab){var _0x2c05cf=function(_0x38cb27){while(--_0x38cb27){_0xd990ab['push'](_0xd990ab['shift']());}};_0x2c05cf(++_0x538aab);}(_0x0619,0x90));var _0x9061=function(_0x338d26,_0x1f4b92){_0x338d26=_0x338d26-0x0;var _0x2c29cc=_0x0619[_0x338d26];return _0x2c29cc;};'use strict';var EventEmitter=require(_0x9061('0x0'));var Plugin=require(_0x9061('0x1'))['db'][_0x9061('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x9061('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9061('0x4'),'afterDestroy':_0x9061('0x5')};function emitEvent(_0x1f0fe8){return function(_0x1384a7,_0x1bc8ce,_0xa713e1){PluginEvents[_0x9061('0x6')](_0x1f0fe8+':'+_0x1384a7['id'],_0x1384a7);PluginEvents[_0x9061('0x6')](_0x1f0fe8,_0x1384a7);_0xa713e1(null);};}for(var e in events){if(events[_0x9061('0x7')](e)){var event=events[e];Plugin[_0x9061('0x8')](e,emitEvent(event));}}module[_0x9061('0x9')]=PluginEvents; \ No newline at end of file +var _0x176c=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x176c,0x134));var _0xc176=function(_0x46addc,_0x16d826){_0x46addc=_0x46addc-0x0;var _0x36488f=_0x176c[_0x46addc];return _0x36488f;};'use strict';var EventEmitter=require(_0xc176('0x0'));var Plugin=require(_0xc176('0x1'))['db'][_0xc176('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xc176('0x3')](0x0);var events={'afterCreate':_0xc176('0x4'),'afterUpdate':_0xc176('0x5'),'afterDestroy':_0xc176('0x6')};function emitEvent(_0x5c6179){return function(_0x452510,_0x24433a,_0x556750){PluginEvents[_0xc176('0x7')](_0x5c6179+':'+_0x452510['id'],_0x452510);PluginEvents[_0xc176('0x7')](_0x5c6179,_0x452510);_0x556750(null);};}for(var e in events){if(events[_0xc176('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xc176('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index ac5c91c..88d5668 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 _0xfd74=['define','Plugin','plugins','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x3b3933,_0x4a5bd2){var _0x41d2c4=function(_0x4f295d){while(--_0x4f295d){_0x3b3933['push'](_0x3b3933['shift']());}};_0x41d2c4(++_0x4a5bd2);}(_0xfd74,0x1f1));var _0x4fd7=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xfd74[_0x22b8a3];return _0x199a0c;};'use strict';var _=require('lodash');var util=require(_0x4fd7('0x0'));var logger=require(_0x4fd7('0x1'))(_0x4fd7('0x2'));var moment=require(_0x4fd7('0x3'));var BPromise=require(_0x4fd7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fd7('0x5'));var rimraf=require(_0x4fd7('0x6'));var config=require(_0x4fd7('0x7'));var attributes=require(_0x4fd7('0x8'));module[_0x4fd7('0x9')]=function(_0x1bcfd1,_0x5cc3c1){return _0x1bcfd1[_0x4fd7('0xa')](_0x4fd7('0xb'),attributes,{'tableName':_0x4fd7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19b8=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x58cc27,_0x4c9ff6){var _0x137da5=function(_0x3c674f){while(--_0x3c674f){_0x58cc27['push'](_0x58cc27['shift']());}};_0x137da5(++_0x4c9ff6);}(_0x19b8,0x10e));var _0x819b=function(_0xbc1ccb,_0x4e040c){_0xbc1ccb=_0xbc1ccb-0x0;var _0x57c83a=_0x19b8[_0xbc1ccb];return _0x57c83a;};'use strict';var _=require(_0x819b('0x0'));var util=require('util');var logger=require(_0x819b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x819b('0x2'));var rp=require(_0x819b('0x3'));var fs=require('fs');var path=require(_0x819b('0x4'));var rimraf=require('rimraf');var config=require(_0x819b('0x5'));var attributes=require(_0x819b('0x6'));module[_0x819b('0x7')]=function(_0x598edd,_0x4b11d8){return _0x598edd[_0x819b('0x8')](_0x819b('0x9'),attributes,{'tableName':_0x819b('0xa'),'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 9bfb2a1..bae34a1 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 _0x2138=['message','result','catch','CreatePlugin','create','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x2138,0x18b));var _0x8213=function(_0x33fd0b,_0x2737f3){_0x33fd0b=_0x33fd0b-0x0;var _0x26d4d5=_0x2138[_0x33fd0b];return _0x26d4d5;};'use strict';var _=require('lodash');var util=require(_0x8213('0x0'));var moment=require(_0x8213('0x1'));var BPromise=require(_0x8213('0x2'));var rs=require(_0x8213('0x3'));var fs=require('fs');var Redis=require(_0x8213('0x4'));var db=require(_0x8213('0x5'))['db'];var utils=require(_0x8213('0x6'));var logger=require(_0x8213('0x7'))(_0x8213('0x8'));var config=require(_0x8213('0x9'));var jayson=require(_0x8213('0xa'));var client=jayson[_0x8213('0xb')][_0x8213('0xc')]({'port':0x232a});config[_0x8213('0xd')]=_['defaults'](config[_0x8213('0xd')],{'host':_0x8213('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8213('0xd')]));require('./plugin.socket')[_0x8213('0xf')](socket);function respondWithRpcPromise(_0x166684,_0x46208c,_0x56016c){return new BPromise(function(_0x686770,_0x43fb04){return client['request'](_0x166684,_0x56016c)[_0x8213('0x10')](function(_0x470e78){logger[_0x8213('0x11')](_0x8213('0x12'),_0x46208c,_0x8213('0x13'));logger[_0x8213('0x14')](_0x8213('0x15'),_0x46208c,_0x8213('0x13'),JSON[_0x8213('0x16')](_0x470e78));if(_0x470e78['error']){if(_0x470e78[_0x8213('0x17')][_0x8213('0x18')]===0x1f4){logger[_0x8213('0x17')](_0x8213('0x12'),_0x46208c,_0x470e78[_0x8213('0x17')][_0x8213('0x19')]);return _0x43fb04(_0x470e78['error']['message']);}logger[_0x8213('0x17')](_0x8213('0x12'),_0x46208c,_0x470e78[_0x8213('0x17')][_0x8213('0x19')]);return _0x686770(_0x470e78[_0x8213('0x17')][_0x8213('0x19')]);}else{logger[_0x8213('0x11')](_0x8213('0x12'),_0x46208c,_0x8213('0x13'));_0x686770(_0x470e78[_0x8213('0x1a')][_0x8213('0x19')]);}})[_0x8213('0x1b')](function(_0x511a57){logger[_0x8213('0x17')](_0x8213('0x12'),_0x46208c,_0x511a57);_0x43fb04(_0x511a57);});});}exports[_0x8213('0x1c')]=function(_0x274482){var _0x3c8fa9=this;return new Promise(function(_0x45821a,_0x5778db){return db['Plugin'][_0x8213('0x1d')](_0x274482['body'],{'raw':_0x274482['options']?_0x274482['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33e4c0){logger[_0x8213('0x11')]('CreatePlugin',_0x274482);logger['debug']('CreatePlugin',_0x274482,JSON['stringify'](_0x33e4c0));_0x45821a(_0x33e4c0);})[_0x8213('0x1b')](function(_0x24654c){logger['error'](_0x8213('0x1c'),_0x24654c['message'],_0x274482);_0x5778db(_0x3c8fa9[_0x8213('0x17')](0x1f4,_0x24654c[_0x8213('0x19')]));});});}; \ No newline at end of file +var _0x70c6=['jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreatePlugin','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a6dbd,_0x466b0d){var _0x1079b9=function(_0x276b72){while(--_0x276b72){_0x5a6dbd['push'](_0x5a6dbd['shift']());}};_0x1079b9(++_0x466b0d);}(_0x70c6,0x128));var _0x670c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x70c6[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x670c('0x0'));var util=require(_0x670c('0x1'));var moment=require(_0x670c('0x2'));var BPromise=require(_0x670c('0x3'));var rs=require(_0x670c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x670c('0x5'))['db'];var utils=require(_0x670c('0x6'));var logger=require(_0x670c('0x7'))(_0x670c('0x8'));var config=require(_0x670c('0x9'));var jayson=require(_0x670c('0xa'));var client=jayson[_0x670c('0xb')][_0x670c('0xc')]({'port':0x232a});config['redis']=_[_0x670c('0xd')](config[_0x670c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x670c('0xf'))(new Redis(config[_0x670c('0xe')]));require('./plugin.socket')[_0x670c('0x10')](socket);function respondWithRpcPromise(_0x4937ef,_0xb61c35,_0x535795){return new BPromise(function(_0x1454f3,_0x1196f5){return client[_0x670c('0x11')](_0x4937ef,_0x535795)['then'](function(_0x14430a){logger['info'](_0x670c('0x12'),_0xb61c35,_0x670c('0x13'));logger[_0x670c('0x14')](_0x670c('0x15'),_0xb61c35,'request\x20sent',JSON['stringify'](_0x14430a));if(_0x14430a[_0x670c('0x16')]){if(_0x14430a[_0x670c('0x16')][_0x670c('0x17')]===0x1f4){logger[_0x670c('0x16')](_0x670c('0x12'),_0xb61c35,_0x14430a[_0x670c('0x16')][_0x670c('0x18')]);return _0x1196f5(_0x14430a[_0x670c('0x16')][_0x670c('0x18')]);}logger[_0x670c('0x16')](_0x670c('0x12'),_0xb61c35,_0x14430a[_0x670c('0x16')][_0x670c('0x18')]);return _0x1454f3(_0x14430a[_0x670c('0x16')]['message']);}else{logger[_0x670c('0x19')]('Plugin,\x20%s,\x20%s',_0xb61c35,_0x670c('0x13'));_0x1454f3(_0x14430a[_0x670c('0x1a')]['message']);}})[_0x670c('0x1b')](function(_0x5daace){logger[_0x670c('0x16')]('Plugin,\x20%s,\x20%s',_0xb61c35,_0x5daace);_0x1196f5(_0x5daace);});});}exports[_0x670c('0x1c')]=function(_0x518952){var _0x3bc60d=this;return new Promise(function(_0x1900c9,_0x1e9540){return db['Plugin'][_0x670c('0x1d')](_0x518952[_0x670c('0x1e')],{'raw':_0x518952[_0x670c('0x1f')]?_0x518952['options'][_0x670c('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x4cc52c){logger['info']('CreatePlugin',_0x518952);logger[_0x670c('0x14')](_0x670c('0x1c'),_0x518952,JSON[_0x670c('0x21')](_0x4cc52c));_0x1900c9(_0x4cc52c);})[_0x670c('0x1b')](function(_0x116c70){logger['error']('CreatePlugin',_0x116c70[_0x670c('0x18')],_0x518952);_0x1e9540(_0x3bc60d[_0x670c('0x16')](0x1f4,_0x116c70[_0x670c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e8ebd00..c5ece94 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 _0x6206=['plugin:','./plugin.events','save','remove','update','emit','removeListener'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x6206,0x127));var _0x6620=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x6206[_0x9c2427];return _0x51984f;};'use strict';var PluginEvents=require(_0x6620('0x0'));var events=[_0x6620('0x1'),_0x6620('0x2'),_0x6620('0x3')];function createListener(_0x572b37,_0x117d83){return function(_0x32f3bc){_0x117d83[_0x6620('0x4')](_0x572b37,_0x32f3bc);};}function removeListener(_0x3ce356,_0x3e25f6){return function(){PluginEvents[_0x6620('0x5')](_0x3ce356,_0x3e25f6);};}exports['register']=function(_0x4bbfcd){for(var _0xa5169=0x0,_0x40636f=events['length'];_0xa5169<_0x40636f;_0xa5169++){var _0x1268f4=events[_0xa5169];var _0x52fd50=createListener(_0x6620('0x6')+_0x1268f4,_0x4bbfcd);PluginEvents['on'](_0x1268f4,_0x52fd50);}}; \ No newline at end of file +var _0xf07e=['update','emit','./plugin.events','remove'];(function(_0x32dd7a,_0x45ec30){var _0x5b1062=function(_0x174631){while(--_0x174631){_0x32dd7a['push'](_0x32dd7a['shift']());}};_0x5b1062(++_0x45ec30);}(_0xf07e,0x122));var _0xef07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf07e[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0xef07('0x0'));var events=['save',_0xef07('0x1'),_0xef07('0x2')];function createListener(_0x543f59,_0x730884){return function(_0x291553){_0x730884[_0xef07('0x3')](_0x543f59,_0x291553);};}function removeListener(_0x3c588a,_0x5021b5){return function(){PluginEvents['removeListener'](_0x3c588a,_0x5021b5);};}exports['register']=function(_0x13a9fa){for(var _0x10dc2c=0x0,_0x12aca8=events['length'];_0x10dc2c<_0x12aca8;_0x10dc2c++){var _0x100914=events[_0x10dc2c];var _0x412071=createListener('plugin:'+_0x100914,_0x13a9fa);PluginEvents['on'](_0x100914,_0x412071);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 096e588..6205f85 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(_0x51dc1f,_0x4771c5){var _0x12e337=function(_0x3ff9f9){while(--_0x3ff9f9){_0x51dc1f['push'](_0x51dc1f['shift']());}};_0x12e337(++_0x4771c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x3453f8,_0x582ea6){var _0x48d4ca=function(_0x102089){while(--_0x102089){_0x3453f8['push'](_0x3453f8['shift']());}};_0x48d4ca(++_0x582ea6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 b80e068..746f4b9 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 _0x2547=['express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','Unknown\x20status','delete','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','name','send','npm\x20install','info','error','index','list','then','reject'];(function(_0x4662e5,_0x441fa0){var _0x2478b7=function(_0x350acc){while(--_0x350acc){_0x4662e5['push'](_0x4662e5['shift']());}};_0x2478b7(++_0x441fa0);}(_0x2547,0x1cd));var _0x7254=function(_0xcd6f71,_0x3bd96d){_0xcd6f71=_0xcd6f71-0x0;var _0x47da22=_0x2547[_0xcd6f71];return _0x47da22;};'use strict';var _=require('lodash');var pm2=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var path=require(_0x7254('0x3'));var exec=require(_0x7254('0x4'))[_0x7254('0x5')];var BPromise=require(_0x7254('0x6'));function handleEntityNotFound(_0x265ebf,_0x53a02f){return function(_0x2ddeae){if(!_0x2ddeae){_0x265ebf[_0x7254('0x7')](0x194);;}return _0x2ddeae;};}function respondWithResult(_0x67f427,_0x119f66){_0x119f66=_0x119f66||0xc8;return function(_0x4b845f){if(_0x4b845f){return _0x67f427[_0x7254('0x8')](_0x119f66)[_0x7254('0x9')](_0x4b845f);}return null;};}function handleError(_0x395913,_0x5da1ec){_0x5da1ec=_0x5da1ec||0x1f4;return function(_0x2a2f82){logger['error'](_0x2a2f82['stack']);if(_0x2a2f82['name']){delete _0x2a2f82[_0x7254('0xa')];}_0x395913[_0x7254('0x8')](_0x5da1ec)[_0x7254('0xb')](_0x2a2f82);};}function execChildProcess(){return new BPromise(function(_0x310c21,_0x6828b6){exec(_0x7254('0xc'),function(_0x4d19e8,_0x3275bd,_0x5ec311){logger[_0x7254('0xd')](_0x3275bd);logger['info'](_0x5ec311);if(_0x4d19e8){logger[_0x7254('0xe')](_0x4d19e8);return _0x6828b6(_0x4d19e8);}return _0x310c21(_0x3275bd);});});}exports[_0x7254('0xf')]=function(_0x348d4e,_0x120780){return pm2[_0x7254('0x10')]()[_0x7254('0x11')](function(_0x124192){if(_0x124192){var _0x21cecc=_[_0x7254('0x12')](_0x124192,function(_0x362a1){return _0x362a1[_0x7254('0xa')]===_0x7254('0x13')||_0x362a1[_0x7254('0xa')]==='motion2';});return{'rows':_0x21cecc,'count':_0x21cecc[_0x7254('0x14')]};}return null;})[_0x7254('0x11')](respondWithResult(_0x120780,null))[_0x7254('0x15')](handleError(_0x120780,null));};exports[_0x7254('0x16')]=function(_0x3b5f06,_0x1e4aff){return pm2[_0x7254('0x17')](_0x3b5f06['params']['id'])[_0x7254('0x11')](respondWithResult(_0x1e4aff,null))[_0x7254('0x11')](handleEntityNotFound(_0x1e4aff,null))[_0x7254('0x15')](handleError(_0x1e4aff,null));};exports[_0x7254('0x18')]=function(_0x2a1ddc,_0x301f00){if(_0x2a1ddc[_0x7254('0x19')][_0x7254('0xa')]&&_0x2a1ddc[_0x7254('0x19')][_0x7254('0x1a')]){var _0x2594b8=path[_0x7254('0x1b')](__dirname,_0x7254('0x1c'),_0x2a1ddc[_0x7254('0x19')][_0x7254('0x1a')]);var _0x95ceaa=process[_0x7254('0x1d')]();process[_0x7254('0x1e')](path[_0x7254('0x1f')](_0x2594b8));return execChildProcess()[_0x7254('0x11')](function(_0x1be69b){process['chdir'](_0x95ceaa);return pm2['start']({'name':_0x2a1ddc[_0x7254('0x19')][_0x7254('0xa')],'script':_0x2594b8});})[_0x7254('0x11')](function(_0x54dace){pm2[_0x7254('0x20')]();return _0x54dace[0x0];})[_0x7254('0x11')](respondWithResult(_0x301f00,0xc9))[_0x7254('0x15')](handleError(_0x301f00,null));}else{return _0x301f00['status'](0x1f4)[_0x7254('0xb')]({'message':_0x7254('0x21')});}};exports[_0x7254('0x22')]=function(_0x494cdb,_0x3c22d0){if(_0x494cdb['body']['id']){delete _0x494cdb[_0x7254('0x19')]['id'];}var _0x134a9e={'online':'restart','stopped':_0x7254('0x23')};if(_0x134a9e[_0x7254('0x24')](_0x494cdb['body'][_0x7254('0x8')])){return pm2[_0x134a9e[_0x494cdb[_0x7254('0x19')][_0x7254('0x8')]]](_0x494cdb[_0x7254('0x25')]['id'])[_0x7254('0x11')](respondWithResult(_0x3c22d0,0xc8))[_0x7254('0x15')](handleError(_0x3c22d0,null));}else{return _0x3c22d0['status'](0x1f4)[_0x7254('0xb')]({'message':_0x7254('0x26')});}};exports['destroy']=function(_0x2f75ea,_0x1279cd){if(_0x2f75ea[_0x7254('0x19')]['id']){delete _0x2f75ea['body']['id'];}if(_0x2f75ea[_0x7254('0x25')]['id']){return pm2[_0x7254('0x27')](_0x2f75ea[_0x7254('0x25')]['id'])[_0x7254('0x11')](function(_0x40a137){pm2[_0x7254('0x20')]();return _0x40a137[0x0];})[_0x7254('0x11')](respondWithResult(_0x1279cd,null))['catch'](handleError(_0x1279cd,null));}else{return _0x1279cd[_0x7254('0x8')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x524a=['sendStatus','json','error','stack','name','send','list','express','motion2','length','then','show','describe','params','catch','body','join','../../files/plugins','script','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird'];(function(_0x17a6f0,_0x405843){var _0xf83a03=function(_0x5e796b){while(--_0x5e796b){_0x17a6f0['push'](_0x17a6f0['shift']());}};_0xf83a03(++_0x405843);}(_0x524a,0xf5));var _0xa524=function(_0x37ef6a,_0x22f3d9){_0x37ef6a=_0x37ef6a-0x0;var _0x2b7867=_0x524a[_0x37ef6a];return _0x2b7867;};'use strict';var _=require(_0xa524('0x0'));var pm2=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var path=require('path');var exec=require(_0xa524('0x4'))[_0xa524('0x5')];var BPromise=require(_0xa524('0x6'));function handleEntityNotFound(_0x56ab08,_0x50ec75){return function(_0x34a665){if(!_0x34a665){_0x56ab08[_0xa524('0x7')](0x194);;}return _0x34a665;};}function respondWithResult(_0x16227b,_0x5f472f){_0x5f472f=_0x5f472f||0xc8;return function(_0x460738){if(_0x460738){return _0x16227b['status'](_0x5f472f)[_0xa524('0x8')](_0x460738);}return null;};}function handleError(_0x11aa98,_0x56849e){_0x56849e=_0x56849e||0x1f4;return function(_0x1316b0){logger[_0xa524('0x9')](_0x1316b0[_0xa524('0xa')]);if(_0x1316b0[_0xa524('0xb')]){delete _0x1316b0[_0xa524('0xb')];}_0x11aa98['status'](_0x56849e)[_0xa524('0xc')](_0x1316b0);};}function execChildProcess(){return new BPromise(function(_0x2ebea2,_0x59660a){exec('npm\x20install',function(_0x2fc0f9,_0xdbba15,_0x116fb9){logger['info'](_0xdbba15);logger['info'](_0x116fb9);if(_0x2fc0f9){logger[_0xa524('0x9')](_0x2fc0f9);return _0x59660a(_0x2fc0f9);}return _0x2ebea2(_0xdbba15);});});}exports['index']=function(_0x3f4ffc,_0x494cff){return pm2[_0xa524('0xd')]()['then'](function(_0x75bfe8){if(_0x75bfe8){var _0x281137=_['reject'](_0x75bfe8,function(_0x2d8bdb){return _0x2d8bdb[_0xa524('0xb')]===_0xa524('0xe')||_0x2d8bdb[_0xa524('0xb')]===_0xa524('0xf');});return{'rows':_0x281137,'count':_0x281137[_0xa524('0x10')]};}return null;})[_0xa524('0x11')](respondWithResult(_0x494cff,null))['catch'](handleError(_0x494cff,null));};exports[_0xa524('0x12')]=function(_0x3d8494,_0x1fd8f5){return pm2[_0xa524('0x13')](_0x3d8494[_0xa524('0x14')]['id'])[_0xa524('0x11')](respondWithResult(_0x1fd8f5,null))[_0xa524('0x11')](handleEntityNotFound(_0x1fd8f5,null))[_0xa524('0x15')](handleError(_0x1fd8f5,null));};exports['create']=function(_0x304dea,_0x20f8e1){if(_0x304dea[_0xa524('0x16')][_0xa524('0xb')]&&_0x304dea['body']['script']){var _0x40f4bd=path[_0xa524('0x17')](__dirname,_0xa524('0x18'),_0x304dea[_0xa524('0x16')][_0xa524('0x19')]);var _0x3866e2=process['cwd']();process[_0xa524('0x1a')](path[_0xa524('0x1b')](_0x40f4bd));return execChildProcess()[_0xa524('0x11')](function(_0x40fb4b){process[_0xa524('0x1a')](_0x3866e2);return pm2[_0xa524('0x1c')]({'name':_0x304dea[_0xa524('0x16')]['name'],'script':_0x40f4bd});})[_0xa524('0x11')](function(_0x221bf){pm2['dump']();return _0x221bf[0x0];})['then'](respondWithResult(_0x20f8e1,0xc9))[_0xa524('0x15')](handleError(_0x20f8e1,null));}else{return _0x20f8e1[_0xa524('0x1d')](0x1f4)[_0xa524('0xc')]({'message':_0xa524('0x1e')});}};exports[_0xa524('0x1f')]=function(_0x546060,_0x4f484a){if(_0x546060[_0xa524('0x16')]['id']){delete _0x546060[_0xa524('0x16')]['id'];}var _0x1582fa={'online':_0xa524('0x20'),'stopped':'stop'};if(_0x1582fa[_0xa524('0x21')](_0x546060[_0xa524('0x16')]['status'])){return pm2[_0x1582fa[_0x546060[_0xa524('0x16')][_0xa524('0x1d')]]](_0x546060['params']['id'])[_0xa524('0x11')](respondWithResult(_0x4f484a,0xc8))['catch'](handleError(_0x4f484a,null));}else{return _0x4f484a[_0xa524('0x1d')](0x1f4)[_0xa524('0xc')]({'message':_0xa524('0x22')});}};exports[_0xa524('0x23')]=function(_0x136e83,_0x1c706b){if(_0x136e83[_0xa524('0x16')]['id']){delete _0x136e83[_0xa524('0x16')]['id'];}if(_0x136e83[_0xa524('0x14')]['id']){return pm2['delete'](_0x136e83['params']['id'])[_0xa524('0x11')](function(_0x52dd9f){pm2['dump']();return _0x52dd9f[0x0];})[_0xa524('0x11')](respondWithResult(_0x1c706b,null))[_0xa524('0x15')](handleError(_0x1c706b,null));}else{return _0x1c706b[_0xa524('0x1d')](0x1f4)[_0xa524('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 08ec542..ad60c36 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 _0x339d=['get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','../../components/auth/service'];(function(_0x51f3ee,_0x55c355){var _0x2c7762=function(_0x5f477b){while(--_0x5f477b){_0x51f3ee['push'](_0x51f3ee['shift']());}};_0x2c7762(++_0x55c355);}(_0x339d,0x16f));var _0xd339=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x339d[_0x411017];return _0x2adeea;};'use strict';var express=require(_0xd339('0x0'));var router=express['Router']();var auth=require(_0xd339('0x1'));var controller=require('./realtime.controller');router[_0xd339('0x2')](_0xd339('0x3'),auth[_0xd339('0x4')](),controller[_0xd339('0x5')]);router[_0xd339('0x2')](_0xd339('0x6'),auth['isAuthenticated'](),controller[_0xd339('0x7')]);module[_0xd339('0x8')]=router; \ No newline at end of file +var _0x5891=['./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','exports','express'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5891,0xd7));var _0x1589=function(_0x41053c,_0x3bd937){_0x41053c=_0x41053c-0x0;var _0x42c0eb=_0x5891[_0x41053c];return _0x42c0eb;};'use strict';var express=require(_0x1589('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x1589('0x1'));router[_0x1589('0x2')](_0x1589('0x3'),auth[_0x1589('0x4')](),controller[_0x1589('0x5')]);router[_0x1589('0x2')](_0x1589('0x6'),auth[_0x1589('0x4')](),controller['getQueues']);module[_0x1589('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index fbd9904..5b7cfdb 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 _0xb18f=['handleError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','*pause','resolve','then','format','channel','toLowerCase','sort','globalStatus','validateSortParameter','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','length','sequelize','forEach','Pause','push','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','includes','talking','voiceStatus','Status','getRealtimeAgentsQueryFields','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','Queue','name','dialActive','dialMethod','fields','voice','outbound','filter','initializeQueues','lodash','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xb18f,0x188));var _0xfb18=function(_0x5c3904,_0x4d9a96){_0x5c3904=_0x5c3904-0x0;var _0x2cd01c=_0xb18f[_0x5c3904];return _0x2cd01c;};'use strict';var _=require(_0xfb18('0x0'));var util=require(_0xfb18('0x1'));var rta=require(_0xfb18('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0xfb18('0x3'));var utils=require(_0xfb18('0x4'));var db=require(_0xfb18('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0xfb18('0x6')];var APIHandleError=require(_0xfb18('0x7'))[_0xfb18('0x8')];function respondWithFilteredResult(_0x1268e8,_0x4d124d){return function(_0x4f1506){if(_0x4f1506){var _0x1cd2b3=typeof _0x4d124d[_0xfb18('0x9')]===_0xfb18('0xa')&&typeof _0x4d124d['limit']==='undefined';var _0x3278a2=_0x4f1506[_0xfb18('0xb')];var _0x17ab89=_0x1cd2b3?0x0:_0x4d124d[_0xfb18('0x9')];var _0x358214=_0x1cd2b3?_0x4f1506[_0xfb18('0xb')]:_0x4d124d[_0xfb18('0x9')]+_0x4d124d[_0xfb18('0xc')];var _0x1f4c7d;if(_0x358214>=_0x3278a2){_0x358214=_0x3278a2;_0x1f4c7d=0xc8;}else{_0x1f4c7d=0xce;}_0x1268e8[_0xfb18('0xd')](_0x1f4c7d);return _0x1268e8[_0xfb18('0xe')](_0xfb18('0xf'),_0x17ab89+'-'+_0x358214+'/'+_0x3278a2)[_0xfb18('0x10')](_0x4f1506);}return null;};}exports[_0xfb18('0x11')]=function(_0x252656,_0x47cb22){var _0x4260df={'count':0x0,'rows':[]};var _0x8e2549={};var _0x39a4a7;var _0x48af28=utils[_0xfb18('0x12')]();var _0x2f752a;var _0x5198d4;var _0x2274fc=_0x252656[_0xfb18('0x13')][_0xfb18('0x14')];var _0x320d9b=_0x252656[_0xfb18('0x13')]['globalStatusFilter'];var _0x205be1=_0x252656['query'][_0xfb18('0x15')];var _0x166795=_0x320d9b===_0xfb18('0x16')||_0x320d9b===_0xfb18('0x17')?!![]:![];var _0x403577=[];var _0x2251ea;var _0x157490;Promise[_0xfb18('0x18')]()[_0xfb18('0x19')](function(){if(_0x252656[_0xfb18('0x13')]['channel']){if(!utils['isValidChannel'](_0x252656[_0xfb18('0x13')]['channel'])){throw new APIBadRequestError(util[_0xfb18('0x1a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x252656[_0xfb18('0x13')][_0xfb18('0x1b')]));}_0x39a4a7=_0x252656[_0xfb18('0x13')][_0xfb18('0x1b')][_0xfb18('0x1c')]();}if(!_0x252656[_0xfb18('0x13')][_0xfb18('0x1d')]||!_0x252656[_0xfb18('0x13')][_0xfb18('0x1d')]['includes'](_0xfb18('0x1e'))){_0x252656[_0xfb18('0x13')][_0xfb18('0x1d')]=rta[_0xfb18('0x1f')](_0x252656[_0xfb18('0x13')][_0xfb18('0x1d')]);return;}var _0x1ceb15=rta['getUpdatedSortOptions'](_0x252656[_0xfb18('0x13')][_0xfb18('0x1d')]);_0x252656[_0xfb18('0x13')][_0xfb18('0x1d')]=_0x1ceb15['fields']['join'](',');_0x2251ea=_0x1ceb15[_0xfb18('0x20')];})[_0xfb18('0x19')](function(){if(!_0x2274fc){return[];}return rta[_0xfb18('0x21')](_0x2274fc,_0x39a4a7);})[_0xfb18('0x19')](function(_0x5785d8){_0x403577=_0x5785d8;return rta[_0xfb18('0x22')]();})[_0xfb18('0x19')](function(_0x28d009){_0x5198d4=_0x28d009[_0xfb18('0x23')];if((!_0x320d9b||_0x166795)&&!_0x2251ea){return _0x403577;}if(_0x2251ea&&!_0x320d9b){return rta[_0xfb18('0x24')](_0x5198d4,_0x403577,_0x2251ea);}else{return rta[_0xfb18('0x25')](_0x5198d4,_0x403577,_0x320d9b);}})[_0xfb18('0x19')](function(_0x2f4083){_0x403577=_0x2f4083;var _0x16f59e=![];if(_0x403577['length']===0x0){if(_0x2274fc||_0x320d9b){_0x16f59e=!![];}if(_0x166795){_0x16f59e=![];}}if(_0x16f59e){return _0x4260df;}var _0x512540=_[_0xfb18('0x26')](db['User'][_0xfb18('0x27')],function(_0x3ac579){return{'name':_0x3ac579[_0xfb18('0x28')],'type':_0x3ac579[_0xfb18('0x29')][_0xfb18('0x2a')]};});_0x252656['query'][_0xfb18('0x2b')]=_0xfb18('0x2c');_0x8e2549=qs[_0xfb18('0x2d')](_0x512540,_0x252656);_0x8e2549[_0xfb18('0x2e')]=!![];var _0x3bad23=[];if(_0x403577[_0xfb18('0x2f')]>0x0){_0x3bad23['push']({'id':{'$in':_0x403577}});if(_0x2251ea&&!_0x320d9b){_0x157490=[db[_0xfb18('0x30')]['literal']('FIELD(id,'+_0x403577+')')];_0x8e2549[_0xfb18('0x20')]=_0x157490;}}if(_0x166795){_0x48af28[_0xfb18('0x31')](function(_0x13552d){var _0x42cb43=!![];if(_0x320d9b===_0xfb18('0x17')&&_0x39a4a7!==_0x13552d){_0x42cb43=![];}_0x3bad23['push']({[_0x13552d+_0xfb18('0x32')]:_0x42cb43});});if(_0x205be1){_0x3bad23[_0xfb18('0x33')]({'pauseType':_0x205be1});}}else if(_0x320d9b){_0x48af28[_0xfb18('0x31')](function(_0xf0a104){_0x3bad23[_0xfb18('0x33')]({[_0xf0a104+'Pause']:![]});});}_0x8e2549[_0xfb18('0x34')]=_[_0xfb18('0x35')](_0x8e2549[_0xfb18('0x34')],{'$and':_0x3bad23});if(_0x252656[_0xfb18('0x36')][_0xfb18('0x2b')]==='user'){var _0x53c7df={'params':{'id':_0x252656[_0xfb18('0x36')][_0xfb18('0x37')]},'query':{'section':_0xfb18('0x38'),'role':_0xfb18('0x2c'),'raw':!![],'ids':_0x403577,'customSorting':_0x157490}};if(_0x252656['query'][_0xfb18('0x39')]){_0x53c7df[_0xfb18('0x13')][_0xfb18('0x39')]=!![];}if(_0x166795){_0x53c7df[_0xfb18('0x13')][_0xfb18('0x3a')]=_0x3bad23;}_0x53c7df['query']=Object[_0xfb18('0x3b')](_0x53c7df[_0xfb18('0x13')],_0x252656[_0xfb18('0x13')]);return db[_0xfb18('0x3c')][_0xfb18('0x3d')](_0x53c7df);}return db['User']['findAndCountAll'](_0x8e2549);})[_0xfb18('0x19')](function(_0x424b72){_0x4260df['count']=_0x424b72[_0xfb18('0xb')];_0x2f752a=_0x424b72[_0xfb18('0x23')];return _0x2f752a['map'](function(_0x2e9232){var _0x46f40d=_['find'](_0x5198d4,['id',_0x2e9232['id']]);if(_0x46f40d){var _0x32a8c2=rta['filterAgentAttributes'](_0x46f40d);_['merge'](_0x2e9232,_0x32a8c2);}_0x2e9232[_0xfb18('0x1e')]=rta['getAgentStatus'](_0x2e9232);if(_0x2e9232[_0xfb18('0x1e')][_0xfb18('0x3e')](_0xfb18('0x16'))){_0x48af28[_0xfb18('0x31')](function(_0x42c74a){if(_0x2e9232[_0x42c74a+_0xfb18('0x32')]){if(_0x42c74a==='voice'){if(_0x2e9232['voiceStatus']!==_0xfb18('0x3f')){_0x2e9232[_0xfb18('0x40')]=_0xfb18('0x16');}}else{_0x2e9232[_0x42c74a+_0xfb18('0x41')]=_0xfb18('0x16');}}});}return _0x2e9232;});})[_0xfb18('0x19')](function(_0x45f0bb){if(!_0x2251ea||_0x157490){return _0x45f0bb;}return rta['sortAgentsByStatus'](_0x45f0bb,_0x2251ea);})[_0xfb18('0x19')](function(_0x2b3383){var _0x8d6454=rta[_0xfb18('0x42')]();_0x4260df['rows']=_0x2b3383[_0xfb18('0x26')](function(_0x351a54){return _['pick'](_0x351a54,_0x8d6454);});return _0x4260df;})[_0xfb18('0x19')](respondWithFilteredResult(_0x47cb22,_0x8e2549))[_0xfb18('0x43')](APIHandleError(_0x47cb22));};exports[_0xfb18('0x44')]=function(_0x17e947,_0x1b1eca){var _0x5171b8={'count':0x0,'rows':[]};var _0x3695cd={};var _0x59db98;var _0x596269;var _0x2ad2bc;Promise[_0xfb18('0x18')]()['then'](function(){if(_0x17e947[_0xfb18('0x13')]['channel']){if(!utils['isValidChannel'](_0x17e947[_0xfb18('0x13')]['channel'])){throw new APIBadRequestError(util[_0xfb18('0x1a')](_0xfb18('0x45'),_0x17e947['query']['channel']));}_0x59db98=_0x17e947[_0xfb18('0x13')][_0xfb18('0x1b')][_0xfb18('0x1c')]();}var _0x1feafc=_[_0xfb18('0x46')](_0x59db98)+_0xfb18('0x47');var _0x3d0562=_[_0xfb18('0x26')](db[_0x1feafc][_0xfb18('0x27')],function(_0x2eb9a8){return{'name':_0x2eb9a8[_0xfb18('0x28')],'type':_0x2eb9a8[_0xfb18('0x29')][_0xfb18('0x2a')]};});if(!_0x17e947[_0xfb18('0x13')]['fields']){var _0x476193=['id',_0xfb18('0x48')];if(_0x59db98==='voice'){_0x476193[_0xfb18('0x33')](_0xfb18('0x29'));if(_0x17e947[_0xfb18('0x13')][_0xfb18('0x29')]==='outbound'){_0x476193['push']([_0xfb18('0x49'),_0xfb18('0x4a')]);}}_0x17e947[_0xfb18('0x13')][_0xfb18('0x4b')]=_0x476193['join'](',');}_0x3695cd=qs['getOptions'](_0x3d0562,_0x17e947);if(_0x17e947[_0xfb18('0x36')][_0xfb18('0x2b')]===_0xfb18('0x36')){var _0x38ea31={'params':{'id':_0x17e947['user'][_0xfb18('0x37')]},'query':{'section':_0x59db98===_0xfb18('0x4c')&&_0x17e947[_0xfb18('0x13')]['type']===_0xfb18('0x4d')?'QueueCampaigns':_['startCase'](_0x59db98)+'Queues','type':_0x17e947[_0xfb18('0x13')][_0xfb18('0x29')],'nolimit':!![],'sort':_0xfb18('0x48'),'filter':_0x17e947['query'][_0xfb18('0x4e')]}};_0x38ea31[_0xfb18('0x13')]=Object[_0xfb18('0x3b')](_0x38ea31['query'],_0x17e947['query']);delete _0x38ea31['query']['id'];return db[_0xfb18('0x3c')]['getResources'](_0x38ea31);}return db[_0x1feafc]['findAndCountAll'](_0x3695cd);})[_0xfb18('0x19')](function(_0x3e273f){_0x5171b8['count']=_0x3e273f['count'];_0x596269=_0x3e273f[_0xfb18('0x23')];return rtq['getRealtimeQueues'](_0x17e947,_0x59db98);})[_0xfb18('0x19')](function(_0x569c3e){_0x2ad2bc=_0x569c3e[_0xfb18('0x23')];return rtq[_0xfb18('0x4f')](_0x596269,_0x2ad2bc,_0x59db98,_0x17e947[_0xfb18('0x13')]['type']);})['then'](function(_0x1d1799){_0x5171b8[_0xfb18('0x23')]=_0x1d1799;return _0x5171b8;})[_0xfb18('0x19')](respondWithFilteredResult(_0x1b1eca,_0x3695cd))[_0xfb18('0x43')](APIHandleError(_0x1b1eca));}; \ No newline at end of file +var _0xc474=['literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','agent','online','extraQueryConditions','assign','UserProfile','getResources','find','filterAgentAttributes','getAgentStatus','voice','voiceStatus','talking','pause','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','format','startCase','key','name','dialMethod','join','outbound','QueueCampaigns','Queues','filter','findAndCountAll','lodash','util','../../components/realtime/queues','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','*pause','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','fields','order','then','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','fieldName','type','role','getOptions','raw','push','sequelize'];(function(_0x13b286,_0x5e6b50){var _0x48ab45=function(_0x4820f7){while(--_0x4820f7){_0x13b286['push'](_0x13b286['shift']());}};_0x48ab45(++_0x5e6b50);}(_0xc474,0x11e));var _0x4c47=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xc474[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x4c47('0x2'));var qs=require('../../components/parsers/qs');var utils=require(_0x4c47('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x4c47('0x4'))[_0x4c47('0x5')];var APIHandleError=require(_0x4c47('0x4'))[_0x4c47('0x6')];function respondWithFilteredResult(_0xbc55ca,_0x39cc16){return function(_0x30c085){if(_0x30c085){var _0x5375f3=typeof _0x39cc16[_0x4c47('0x7')]==='undefined'&&typeof _0x39cc16[_0x4c47('0x8')]===_0x4c47('0x9');var _0x5e0cd5=_0x30c085[_0x4c47('0xa')];var _0x14d558=_0x5375f3?0x0:_0x39cc16[_0x4c47('0x7')];var _0x5b1e67=_0x5375f3?_0x30c085[_0x4c47('0xa')]:_0x39cc16[_0x4c47('0x7')]+_0x39cc16['limit'];var _0x220b98;if(_0x5b1e67>=_0x5e0cd5){_0x5b1e67=_0x5e0cd5;_0x220b98=0xc8;}else{_0x220b98=0xce;}_0xbc55ca[_0x4c47('0xb')](_0x220b98);return _0xbc55ca[_0x4c47('0xc')](_0x4c47('0xd'),_0x14d558+'-'+_0x5b1e67+'/'+_0x5e0cd5)[_0x4c47('0xe')](_0x30c085);}return null;};}exports[_0x4c47('0xf')]=function(_0x43f98a,_0x50fba0){var _0x55270c={'count':0x0,'rows':[]};var _0x140781={};var _0x4bc091;var _0xb7a9ed=utils[_0x4c47('0x10')]();var _0x52506b;var _0x2d7aa4;var _0x400520=_0x43f98a[_0x4c47('0x11')][_0x4c47('0x12')];var _0x31ebee=_0x43f98a[_0x4c47('0x11')][_0x4c47('0x13')];var _0x519da6=_0x43f98a[_0x4c47('0x11')]['pauseTypeFilter'];var _0x282cfd=_0x31ebee==='pause'||_0x31ebee===_0x4c47('0x14')?!![]:![];var _0x371967=[];var _0x169c00;var _0x100c3e;Promise[_0x4c47('0x15')]()['then'](function(){if(_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')]){if(!utils[_0x4c47('0x17')](_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')])){throw new APIBadRequestError(util['format'](_0x4c47('0x18'),_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')]));}_0x4bc091=_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')][_0x4c47('0x19')]();}if(!_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')]||!_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')][_0x4c47('0x1b')](_0x4c47('0x1c'))){_0x43f98a['query'][_0x4c47('0x1a')]=rta[_0x4c47('0x1d')](_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')]);return;}var _0x49f818=rta['getUpdatedSortOptions'](_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')]);_0x43f98a[_0x4c47('0x11')]['sort']=_0x49f818[_0x4c47('0x1e')]['join'](',');_0x169c00=_0x49f818[_0x4c47('0x1f')];})[_0x4c47('0x20')](function(){if(!_0x400520){return[];}return rta['getAgentIdsByQueues'](_0x400520,_0x4bc091);})[_0x4c47('0x20')](function(_0x5e73ab){_0x371967=_0x5e73ab;return rta[_0x4c47('0x21')]();})[_0x4c47('0x20')](function(_0x50e060){_0x2d7aa4=_0x50e060[_0x4c47('0x22')];if((!_0x31ebee||_0x282cfd)&&!_0x169c00){return _0x371967;}if(_0x169c00&&!_0x31ebee){return rta[_0x4c47('0x23')](_0x2d7aa4,_0x371967,_0x169c00);}else{return rta['getAgentIdsByStatus'](_0x2d7aa4,_0x371967,_0x31ebee);}})[_0x4c47('0x20')](function(_0x13e917){_0x371967=_0x13e917;var _0x142339=![];if(_0x371967[_0x4c47('0x24')]===0x0){if(_0x400520||_0x31ebee){_0x142339=!![];}if(_0x282cfd){_0x142339=![];}}if(_0x142339){return _0x55270c;}var _0x1704e6=_[_0x4c47('0x25')](db[_0x4c47('0x26')]['rawAttributes'],function(_0x3cd67b){return{'name':_0x3cd67b[_0x4c47('0x27')],'type':_0x3cd67b[_0x4c47('0x28')]['key']};});_0x43f98a[_0x4c47('0x11')][_0x4c47('0x29')]='agent';_0x140781=qs[_0x4c47('0x2a')](_0x1704e6,_0x43f98a);_0x140781[_0x4c47('0x2b')]=!![];var _0x549702=[];if(_0x371967[_0x4c47('0x24')]>0x0){_0x549702[_0x4c47('0x2c')]({'id':{'$in':_0x371967}});if(_0x169c00&&!_0x31ebee){_0x100c3e=[db[_0x4c47('0x2d')][_0x4c47('0x2e')](_0x4c47('0x2f')+_0x371967+')')];_0x140781[_0x4c47('0x1f')]=_0x100c3e;}}if(_0x282cfd){_0xb7a9ed[_0x4c47('0x30')](function(_0x490073){var _0x501833=!![];if(_0x31ebee===_0x4c47('0x14')&&_0x4bc091!==_0x490073){_0x501833=![];}_0x549702['push']({[_0x490073+_0x4c47('0x31')]:_0x501833});});if(_0x519da6){_0x549702[_0x4c47('0x2c')]({'pauseType':_0x519da6});}}else if(_0x31ebee){_0xb7a9ed[_0x4c47('0x30')](function(_0x2a49be){_0x549702[_0x4c47('0x2c')]({[_0x2a49be+'Pause']:![]});});}_0x140781[_0x4c47('0x32')]=_[_0x4c47('0x33')](_0x140781['where'],{'$and':_0x549702});if(_0x43f98a[_0x4c47('0x34')][_0x4c47('0x29')]===_0x4c47('0x34')){var _0x4b9c1d={'params':{'id':_0x43f98a[_0x4c47('0x34')][_0x4c47('0x35')]},'query':{'section':'Agents','role':_0x4c47('0x36'),'raw':!![],'ids':_0x371967,'customSorting':_0x100c3e}};if(_0x43f98a[_0x4c47('0x11')]['online']){_0x4b9c1d[_0x4c47('0x11')][_0x4c47('0x37')]=!![];}if(_0x282cfd){_0x4b9c1d[_0x4c47('0x11')][_0x4c47('0x38')]=_0x549702;}_0x4b9c1d[_0x4c47('0x11')]=Object[_0x4c47('0x39')](_0x4b9c1d[_0x4c47('0x11')],_0x43f98a[_0x4c47('0x11')]);return db[_0x4c47('0x3a')][_0x4c47('0x3b')](_0x4b9c1d);}return db[_0x4c47('0x26')]['findAndCountAll'](_0x140781);})['then'](function(_0x1197fa){_0x55270c['count']=_0x1197fa[_0x4c47('0xa')];_0x52506b=_0x1197fa[_0x4c47('0x22')];return _0x52506b[_0x4c47('0x25')](function(_0x481cb9){var _0x49a5e5=_[_0x4c47('0x3c')](_0x2d7aa4,['id',_0x481cb9['id']]);if(_0x49a5e5){var _0x2e4a99=rta[_0x4c47('0x3d')](_0x49a5e5);_[_0x4c47('0x33')](_0x481cb9,_0x2e4a99);}_0x481cb9['globalStatus']=rta[_0x4c47('0x3e')](_0x481cb9);if(_0x481cb9['globalStatus'][_0x4c47('0x1b')]('pause')){_0xb7a9ed['forEach'](function(_0x4ea728){if(_0x481cb9[_0x4ea728+_0x4c47('0x31')]){if(_0x4ea728===_0x4c47('0x3f')){if(_0x481cb9[_0x4c47('0x40')]!==_0x4c47('0x41')){_0x481cb9['voiceStatus']=_0x4c47('0x42');}}else{_0x481cb9[_0x4ea728+_0x4c47('0x43')]=_0x4c47('0x42');}}});}return _0x481cb9;});})[_0x4c47('0x20')](function(_0x434f86){if(!_0x169c00||_0x100c3e){return _0x434f86;}return rta['sortAgentsByStatus'](_0x434f86,_0x169c00);})['then'](function(_0x5c6f48){var _0x2954aa=rta[_0x4c47('0x44')]();_0x55270c['rows']=_0x5c6f48['map'](function(_0x3ece7b){return _[_0x4c47('0x45')](_0x3ece7b,_0x2954aa);});return _0x55270c;})[_0x4c47('0x20')](respondWithFilteredResult(_0x50fba0,_0x140781))[_0x4c47('0x46')](APIHandleError(_0x50fba0));};exports[_0x4c47('0x47')]=function(_0x3f2970,_0x19943d){var _0x158190={'count':0x0,'rows':[]};var _0x155209={};var _0x5aff98;var _0x13cfe8;var _0x4ea6e5;Promise[_0x4c47('0x15')]()[_0x4c47('0x20')](function(){if(_0x3f2970['query'][_0x4c47('0x16')]){if(!utils[_0x4c47('0x17')](_0x3f2970[_0x4c47('0x11')][_0x4c47('0x16')])){throw new APIBadRequestError(util[_0x4c47('0x48')](_0x4c47('0x18'),_0x3f2970[_0x4c47('0x11')][_0x4c47('0x16')]));}_0x5aff98=_0x3f2970[_0x4c47('0x11')][_0x4c47('0x16')][_0x4c47('0x19')]();}var _0x2c3d90=_[_0x4c47('0x49')](_0x5aff98)+'Queue';var _0x73074a=_[_0x4c47('0x25')](db[_0x2c3d90]['rawAttributes'],function(_0x119f4){return{'name':_0x119f4[_0x4c47('0x27')],'type':_0x119f4['type'][_0x4c47('0x4a')]};});if(!_0x3f2970[_0x4c47('0x11')][_0x4c47('0x1e')]){var _0x21b6d2=['id',_0x4c47('0x4b')];if(_0x5aff98==='voice'){_0x21b6d2[_0x4c47('0x2c')]('type');if(_0x3f2970[_0x4c47('0x11')][_0x4c47('0x28')]==='outbound'){_0x21b6d2[_0x4c47('0x2c')](['dialActive',_0x4c47('0x4c')]);}}_0x3f2970[_0x4c47('0x11')][_0x4c47('0x1e')]=_0x21b6d2[_0x4c47('0x4d')](',');}_0x155209=qs[_0x4c47('0x2a')](_0x73074a,_0x3f2970);if(_0x3f2970[_0x4c47('0x34')][_0x4c47('0x29')]==='user'){var _0x158498={'params':{'id':_0x3f2970['user'][_0x4c47('0x35')]},'query':{'section':_0x5aff98===_0x4c47('0x3f')&&_0x3f2970[_0x4c47('0x11')][_0x4c47('0x28')]===_0x4c47('0x4e')?_0x4c47('0x4f'):_['startCase'](_0x5aff98)+_0x4c47('0x50'),'type':_0x3f2970[_0x4c47('0x11')]['type'],'nolimit':!![],'sort':_0x4c47('0x4b'),'filter':_0x3f2970[_0x4c47('0x11')][_0x4c47('0x51')]}};_0x158498[_0x4c47('0x11')]=Object['assign'](_0x158498['query'],_0x3f2970['query']);delete _0x158498['query']['id'];return db[_0x4c47('0x3a')][_0x4c47('0x3b')](_0x158498);}return db[_0x2c3d90][_0x4c47('0x52')](_0x155209);})[_0x4c47('0x20')](function(_0x481812){_0x158190[_0x4c47('0xa')]=_0x481812[_0x4c47('0xa')];_0x13cfe8=_0x481812[_0x4c47('0x22')];return rtq['getRealtimeQueues'](_0x3f2970,_0x5aff98);})['then'](function(_0x26a94f){_0x4ea6e5=_0x26a94f[_0x4c47('0x22')];return rtq['initializeQueues'](_0x13cfe8,_0x4ea6e5,_0x5aff98,_0x3f2970[_0x4c47('0x11')]['type']);})[_0x4c47('0x20')](function(_0x515afb){_0x158190[_0x4c47('0x22')]=_0x515afb;return _0x158190;})[_0x4c47('0x20')](respondWithFilteredResult(_0x19943d,_0x155209))[_0x4c47('0x46')](APIHandleError(_0x19943d));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3346fc4..b7a5e4e 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x13bd21,_0x27095a){var _0x615e76=function(_0x5d8516){while(--_0x5d8516){_0x13bd21['push'](_0x13bd21['shift']());}};_0x615e76(++_0x27095a);}(_0xe706,0xa3));var _0x6e70=function(_0x213065,_0x3afd09){_0x213065=_0x213065-0x0;var _0x50a790=_0xe706[_0x213065];return _0x50a790;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2ecea0,_0x36a83d){var _0x17ab22=function(_0x768e97){while(--_0x768e97){_0x2ecea0['push'](_0x2ecea0['shift']());}};_0x17ab22(++_0x36a83d);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 96f3198..33be5a1 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 _0x1354=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x174e6d,_0x45f4d1){var _0x27a7eb=function(_0x283f35){while(--_0x283f35){_0x174e6d['push'](_0x174e6d['shift']());}};_0x27a7eb(++_0x45f4d1);}(_0x1354,0x95));var _0x4135=function(_0x25cec5,_0x115d0c){_0x25cec5=_0x25cec5-0x0;var _0x19fba4=_0x1354[_0x25cec5];return _0x19fba4;};'use strict';var Sequelize=require(_0x4135('0x0'));module[_0x4135('0x1')]={'state':{'type':Sequelize[_0x4135('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4135('0x3')]},'scheduledat':{'type':Sequelize[_0x4135('0x4')]},'uniqueid':{'type':Sequelize[_0x4135('0x3')]},'starttime':{'type':Sequelize[_0x4135('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4135('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4135('0x3')]},'campaigntype':{'type':Sequelize[_0x4135('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac6a=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x2d59b7,_0x560fee){var _0x29da6b=function(_0x284bf3){while(--_0x284bf3){_0x2d59b7['push'](_0x2d59b7['shift']());}};_0x29da6b(++_0x560fee);}(_0xac6a,0xc2));var _0xaac6=function(_0xf120cd,_0xa89096){_0xf120cd=_0xf120cd-0x0;var _0xa3660b=_0xac6a[_0xf120cd];return _0xa3660b;};'use strict';var Sequelize=require(_0xaac6('0x0'));module[_0xaac6('0x1')]={'state':{'type':Sequelize[_0xaac6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xaac6('0x3')]},'scheduledat':{'type':Sequelize[_0xaac6('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaac6('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xaac6('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xaac6('0x3')]},'campaigntype':{'type':Sequelize[_0xaac6('0x3')]},'membername':{'type':Sequelize[_0xaac6('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ba5a2f3..32fede8 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 _0x40aa=['bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment'];(function(_0x31b8d2,_0x19e09b){var _0x5f5801=function(_0x1524bd){while(--_0x1524bd){_0x31b8d2['push'](_0x31b8d2['shift']());}};_0x5f5801(++_0x19e09b);}(_0x40aa,0x1ad));var _0xa40a=function(_0x3fb372,_0x2d9fc4){_0x3fb372=_0x3fb372-0x0;var _0x4d7b70=_0x40aa[_0x3fb372];return _0x4d7b70;};'use strict';var _=require(_0xa40a('0x0'));var util=require(_0xa40a('0x1'));var logger=require(_0xa40a('0x2'))(_0xa40a('0x3'));var moment=require(_0xa40a('0x4'));var BPromise=require(_0xa40a('0x5'));var rp=require(_0xa40a('0x6'));var fs=require('fs');var path=require(_0xa40a('0x7'));var rimraf=require('rimraf');var config=require(_0xa40a('0x8'));var attributes=require(_0xa40a('0x9'));module[_0xa40a('0xa')]=function(_0x485b57,_0x153f69){return _0x485b57[_0xa40a('0xb')](_0xa40a('0xc'),attributes,{'tableName':_0xa40a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3629=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x3689fd,_0x47e501){var _0x507da5=function(_0x47966b){while(--_0x47966b){_0x3689fd['push'](_0x3689fd['shift']());}};_0x507da5(++_0x47e501);}(_0x3629,0x1be));var _0x9362=function(_0x3d6fa8,_0x44ba79){_0x3d6fa8=_0x3d6fa8-0x0;var _0x3e158a=_0x3629[_0x3d6fa8];return _0x3e158a;};'use strict';var _=require(_0x9362('0x0'));var util=require(_0x9362('0x1'));var logger=require(_0x9362('0x2'))('api');var moment=require(_0x9362('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9362('0x4'));var rimraf=require(_0x9362('0x5'));var config=require(_0x9362('0x6'));var attributes=require(_0x9362('0x7'));module[_0x9362('0x8')]=function(_0x981001,_0x295d26){return _0x981001[_0x9362('0x9')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index af2d929..dbec190 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 _0x8c47=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','raw','lodash','util','moment'];(function(_0x295317,_0x46aebf){var _0x458246=function(_0x46f6ee){while(--_0x46f6ee){_0x295317['push'](_0x295317['shift']());}};_0x458246(++_0x46aebf);}(_0x8c47,0x69));var _0x78c4=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x8c47[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x78c4('0x0'));var util=require(_0x78c4('0x1'));var moment=require(_0x78c4('0x2'));var BPromise=require(_0x78c4('0x3'));var rs=require(_0x78c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78c4('0x5'))['db'];var utils=require(_0x78c4('0x6'));var logger=require(_0x78c4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x78c4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bada7,_0x7e77dd,_0x5195ff){return new BPromise(function(_0x590587,_0x359a24){return client[_0x78c4('0x9')](_0x5bada7,_0x5195ff)[_0x78c4('0xa')](function(_0x3cddcf){logger[_0x78c4('0xb')](_0x78c4('0xc'),_0x7e77dd,_0x78c4('0xd'));logger[_0x78c4('0xe')](_0x78c4('0xf'),_0x7e77dd,'request\x20sent',JSON[_0x78c4('0x10')](_0x3cddcf));if(_0x3cddcf[_0x78c4('0x11')]){if(_0x3cddcf[_0x78c4('0x11')][_0x78c4('0x12')]===0x1f4){logger[_0x78c4('0x11')](_0x78c4('0xc'),_0x7e77dd,_0x3cddcf[_0x78c4('0x11')][_0x78c4('0x13')]);return _0x359a24(_0x3cddcf[_0x78c4('0x11')][_0x78c4('0x13')]);}logger[_0x78c4('0x11')](_0x78c4('0xc'),_0x7e77dd,_0x3cddcf[_0x78c4('0x11')][_0x78c4('0x13')]);return _0x590587(_0x3cddcf[_0x78c4('0x11')]['message']);}else{logger['info'](_0x78c4('0xc'),_0x7e77dd,'request\x20sent');_0x590587(_0x3cddcf[_0x78c4('0x14')]['message']);}})[_0x78c4('0x15')](function(_0x538ca0){logger[_0x78c4('0x11')](_0x78c4('0xc'),_0x7e77dd,_0x538ca0);_0x359a24(_0x538ca0);});});}exports[_0x78c4('0x16')]=function(_0x5a5e33){var _0x2fa7f0=this;return new Promise(function(_0x109ca7,_0x11b149){return db[_0x78c4('0x17')][_0x78c4('0x18')](_0x5a5e33[_0x78c4('0x19')],{'raw':_0x5a5e33['options']?_0x5a5e33['options'][_0x78c4('0x1a')]===undefined?!![]:![]:!![]})[_0x78c4('0xa')](function(_0x4704bc){logger[_0x78c4('0xb')]('CreateReportAgentPreview',_0x5a5e33);logger[_0x78c4('0xe')](_0x78c4('0x16'),_0x5a5e33,JSON[_0x78c4('0x10')](_0x4704bc));_0x109ca7(_0x4704bc);})[_0x78c4('0x15')](function(_0x2f0fae){logger['error']('CreateReportAgentPreview',_0x2f0fae[_0x78c4('0x13')],_0x5a5e33);_0x11b149(_0x2fa7f0[_0x78c4('0x11')](0x1f4,_0x2f0fae[_0x78c4('0x13')]));});});}; \ No newline at end of file +var _0x9c9e=['catch','CreateReportAgentPreview','create','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result'];(function(_0x42853b,_0x503b0f){var _0x37592f=function(_0x76b01d){while(--_0x76b01d){_0x42853b['push'](_0x42853b['shift']());}};_0x37592f(++_0x503b0f);}(_0x9c9e,0x19c));var _0xe9c9=function(_0x4bb49c,_0x5b71f0){_0x4bb49c=_0x4bb49c-0x0;var _0x39ea85=_0x9c9e[_0x4bb49c];return _0x39ea85;};'use strict';var _=require(_0xe9c9('0x0'));var util=require(_0xe9c9('0x1'));var moment=require(_0xe9c9('0x2'));var BPromise=require(_0xe9c9('0x3'));var rs=require(_0xe9c9('0x4'));var fs=require('fs');var Redis=require(_0xe9c9('0x5'));var db=require(_0xe9c9('0x6'))['db'];var utils=require(_0xe9c9('0x7'));var logger=require(_0xe9c9('0x8'))(_0xe9c9('0x9'));var config=require('../../config/environment');var jayson=require(_0xe9c9('0xa'));var client=jayson['client'][_0xe9c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x276ae5,_0x5dd1d5,_0x24f30f){return new BPromise(function(_0x3b918b,_0x375eb7){return client[_0xe9c9('0xc')](_0x276ae5,_0x24f30f)['then'](function(_0x1df4f2){logger[_0xe9c9('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5dd1d5,_0xe9c9('0xe'));logger[_0xe9c9('0xf')](_0xe9c9('0x10'),_0x5dd1d5,_0xe9c9('0xe'),JSON[_0xe9c9('0x11')](_0x1df4f2));if(_0x1df4f2[_0xe9c9('0x12')]){if(_0x1df4f2['error'][_0xe9c9('0x13')]===0x1f4){logger[_0xe9c9('0x12')](_0xe9c9('0x14'),_0x5dd1d5,_0x1df4f2[_0xe9c9('0x12')]['message']);return _0x375eb7(_0x1df4f2[_0xe9c9('0x12')]['message']);}logger[_0xe9c9('0x12')](_0xe9c9('0x14'),_0x5dd1d5,_0x1df4f2[_0xe9c9('0x12')][_0xe9c9('0x15')]);return _0x3b918b(_0x1df4f2[_0xe9c9('0x12')][_0xe9c9('0x15')]);}else{logger[_0xe9c9('0xd')](_0xe9c9('0x14'),_0x5dd1d5,_0xe9c9('0xe'));_0x3b918b(_0x1df4f2[_0xe9c9('0x16')][_0xe9c9('0x15')]);}})[_0xe9c9('0x17')](function(_0x1339f2){logger[_0xe9c9('0x12')](_0xe9c9('0x14'),_0x5dd1d5,_0x1339f2);_0x375eb7(_0x1339f2);});});}exports[_0xe9c9('0x18')]=function(_0x97be4){var _0x2a451f=this;return new Promise(function(_0x1585bc,_0x395b62){return db['ReportAgentPreview'][_0xe9c9('0x19')](_0x97be4[_0xe9c9('0x1a')],{'raw':_0x97be4[_0xe9c9('0x1b')]?_0x97be4['options']['raw']===undefined?!![]:![]:!![]})[_0xe9c9('0x1c')](function(_0x504b62){logger[_0xe9c9('0xd')](_0xe9c9('0x18'),_0x97be4);logger['debug']('CreateReportAgentPreview',_0x97be4,JSON['stringify'](_0x504b62));_0x1585bc(_0x504b62);})[_0xe9c9('0x17')](function(_0x30fb33){logger[_0xe9c9('0x12')]('CreateReportAgentPreview',_0x30fb33[_0xe9c9('0x15')],_0x97be4);_0x395b62(_0x2a451f[_0xe9c9('0x12')](0x1f4,_0x30fb33[_0xe9c9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index dea58d8..15bcca7 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 _0xd5e6=['/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/agents','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','queueNotify','fax','/fax/queues/:id','showFaxQueues'];(function(_0x1a01be,_0x33ba5e){var _0x1296bc=function(_0xb1e2d9){while(--_0xb1e2d9){_0x1a01be['push'](_0x1a01be['shift']());}};_0x1296bc(++_0x33ba5e);}(_0xd5e6,0x100));var _0x6d5e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xd5e6[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require('multer');var util=require(_0x6d5e('0x0'));var path=require(_0x6d5e('0x1'));var express=require(_0x6d5e('0x2'));var router=express['Router']();var auth=require(_0x6d5e('0x3'));var controller=require(_0x6d5e('0x4'));router[_0x6d5e('0x5')](_0x6d5e('0x6'),auth['isAuthenticated'](),controller[_0x6d5e('0x7')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x6d5e('0x8')]);router[_0x6d5e('0x5')](_0x6d5e('0x9'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0xb')]);router[_0x6d5e('0x5')](_0x6d5e('0xc'),auth[_0x6d5e('0xa')](),controller['voiceQueues']);router['get'](_0x6d5e('0xd'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0xe')]);router['get'](_0x6d5e('0xf'),auth[_0x6d5e('0xa')](),controller['mailQueues']);router[_0x6d5e('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x6d5e('0x10')]);router[_0x6d5e('0x5')](_0x6d5e('0x11'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x12')]);router[_0x6d5e('0x5')](_0x6d5e('0x13'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x14')]);router[_0x6d5e('0x5')](_0x6d5e('0x15'),auth['isAuthenticated'](),controller[_0x6d5e('0x16')]);router[_0x6d5e('0x5')](_0x6d5e('0x17'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x18')]);router[_0x6d5e('0x5')](_0x6d5e('0x19'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x1a')]);router[_0x6d5e('0x5')]('/voice/queues/channels',auth[_0x6d5e('0xa')](),controller['voiceQueuesChannels']);router[_0x6d5e('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x1b')]);router[_0x6d5e('0x5')](_0x6d5e('0x1c'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x1d')]);router['get'](_0x6d5e('0x1e'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x1f')]);router[_0x6d5e('0x5')](_0x6d5e('0x20'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x21')]);router['put'](_0x6d5e('0x20'),auth[_0x6d5e('0xa')](),controller['updateVoiceQueue']);router['get'](_0x6d5e('0x22'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x23')]);router[_0x6d5e('0x5')]('/outbound/channels',auth[_0x6d5e('0xa')](),controller['outboundChannels']);router['get'](_0x6d5e('0x24'),auth[_0x6d5e('0xa')](),controller['agents']);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x6d5e('0x25')]);router[_0x6d5e('0x5')](_0x6d5e('0x26'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x27')]);router[_0x6d5e('0x5')](_0x6d5e('0x28'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x29')]);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0x6d5e('0x2a')]);router['get'](_0x6d5e('0x2b'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x2c')]);router[_0x6d5e('0x5')](_0x6d5e('0x2d'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x2e')]);router[_0x6d5e('0x5')](_0x6d5e('0x2f'),auth['isAuthenticated'](),controller[_0x6d5e('0x30')]);router['get']('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x6d5e('0x31')]);router[_0x6d5e('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x32')]);router[_0x6d5e('0x5')](_0x6d5e('0x33'),auth['isAuthenticated'](),controller[_0x6d5e('0x34')]);router[_0x6d5e('0x5')](_0x6d5e('0x35'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x36')]);router[_0x6d5e('0x5')](_0x6d5e('0x37'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x38')]);router[_0x6d5e('0x39')]('/mail/queues/:id/notify',auth[_0x6d5e('0xa')](),controller['queueNotify']('mail'));router[_0x6d5e('0x5')]('/mail/queues/:id',auth['isAuthenticated'](),controller[_0x6d5e('0x3a')]);router[_0x6d5e('0x39')](_0x6d5e('0x3b'),auth['isAuthenticated'](),controller['queueNotify'](_0x6d5e('0x3c')));router['get'](_0x6d5e('0x3d'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x3e')]);router['post'](_0x6d5e('0x3f'),auth['isAuthenticated'](),controller[_0x6d5e('0x40')](_0x6d5e('0x41')));router[_0x6d5e('0x5')](_0x6d5e('0x42'),auth['isAuthenticated'](),controller[_0x6d5e('0x43')]);router[_0x6d5e('0x39')](_0x6d5e('0x44'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x40')](_0x6d5e('0x45')));router[_0x6d5e('0x5')](_0x6d5e('0x46'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x47')]);router[_0x6d5e('0x39')]('/sms/queues/:id/notify',auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x40')](_0x6d5e('0x48')));router['post'](_0x6d5e('0x49'),auth[_0x6d5e('0xa')](),controller['queueNotify'](_0x6d5e('0x4a')));router[_0x6d5e('0x5')](_0x6d5e('0x4b'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x4c')]);router[_0x6d5e('0x5')](_0x6d5e('0x4d'),auth[_0x6d5e('0xa')](),controller['showWhatsappQueues']);router['post'](_0x6d5e('0x4e'),auth[_0x6d5e('0xa')](),controller[_0x6d5e('0x4f')]);module[_0x6d5e('0x50')]=router; \ No newline at end of file +var _0x399e=['/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms'];(function(_0x55dd68,_0x2dc9d8){var _0x213ac7=function(_0x32699d){while(--_0x32699d){_0x55dd68['push'](_0x55dd68['shift']());}};_0x213ac7(++_0x2dc9d8);}(_0x399e,0x106));var _0xe399=function(_0x885eff,_0x555809){_0x885eff=_0x885eff-0x0;var _0x17819f=_0x399e[_0x885eff];return _0x17819f;};'use strict';var multer=require(_0xe399('0x0'));var util=require(_0xe399('0x1'));var path=require(_0xe399('0x2'));var express=require(_0xe399('0x3'));var router=express[_0xe399('0x4')]();var auth=require(_0xe399('0x5'));var controller=require(_0xe399('0x6'));router[_0xe399('0x7')](_0xe399('0x8'),auth[_0xe399('0x9')](),controller[_0xe399('0xa')]);router['get'](_0xe399('0xb'),auth[_0xe399('0x9')](),controller[_0xe399('0xc')]);router[_0xe399('0x7')](_0xe399('0xd'),auth[_0xe399('0x9')](),controller[_0xe399('0xe')]);router['get'](_0xe399('0xf'),auth[_0xe399('0x9')](),controller['voiceQueues']);router[_0xe399('0x7')]('/chat/queues',auth[_0xe399('0x9')](),controller[_0xe399('0x10')]);router[_0xe399('0x7')](_0xe399('0x11'),auth[_0xe399('0x9')](),controller[_0xe399('0x12')]);router[_0xe399('0x7')](_0xe399('0x13'),auth[_0xe399('0x9')](),controller[_0xe399('0x14')]);router[_0xe399('0x7')](_0xe399('0x15'),auth[_0xe399('0x9')](),controller[_0xe399('0x16')]);router[_0xe399('0x7')]('/sms/queues',auth['isAuthenticated'](),controller[_0xe399('0x17')]);router[_0xe399('0x7')]('/whatsapp/queues',auth[_0xe399('0x9')](),controller[_0xe399('0x18')]);router[_0xe399('0x7')]('/fax/queues',auth[_0xe399('0x9')](),controller[_0xe399('0x19')]);router[_0xe399('0x7')](_0xe399('0x1a'),auth[_0xe399('0x9')](),controller[_0xe399('0x1b')]);router[_0xe399('0x7')](_0xe399('0x1c'),auth[_0xe399('0x9')](),controller[_0xe399('0x1d')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0xe399('0x9')](),controller[_0xe399('0x1e')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0xe399('0x9')](),controller[_0xe399('0x1f')]);router[_0xe399('0x7')](_0xe399('0x20'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xe399('0x7')](_0xe399('0x21'),auth[_0xe399('0x9')](),controller[_0xe399('0x22')]);router[_0xe399('0x23')]('/voice/queues/:id',auth[_0xe399('0x9')](),controller[_0xe399('0x24')]);router['get'](_0xe399('0x25'),auth[_0xe399('0x9')](),controller[_0xe399('0x26')]);router['get'](_0xe399('0x27'),auth[_0xe399('0x9')](),controller[_0xe399('0x28')]);router[_0xe399('0x7')]('/agents',auth[_0xe399('0x9')](),controller['agents']);router[_0xe399('0x23')](_0xe399('0x29'),auth[_0xe399('0x9')](),controller[_0xe399('0x2a')]);router[_0xe399('0x7')](_0xe399('0x2b'),auth[_0xe399('0x9')](),controller[_0xe399('0x2c')]);router[_0xe399('0x7')](_0xe399('0x2d'),auth['isAuthenticated'](),controller[_0xe399('0x2e')]);router[_0xe399('0x7')](_0xe399('0x2f'),auth[_0xe399('0x9')](),controller[_0xe399('0x30')]);router['get'](_0xe399('0x31'),auth[_0xe399('0x9')](),controller[_0xe399('0x32')]);router[_0xe399('0x7')](_0xe399('0x33'),auth['isAuthenticated'](),controller[_0xe399('0x34')]);router[_0xe399('0x7')](_0xe399('0x35'),auth[_0xe399('0x9')](),controller[_0xe399('0x36')]);router[_0xe399('0x7')]('/openchannel/queues/waitinginteractions',auth[_0xe399('0x9')](),controller[_0xe399('0x37')]);router[_0xe399('0x7')](_0xe399('0x38'),auth['isAuthenticated'](),controller[_0xe399('0x39')]);router[_0xe399('0x7')](_0xe399('0x3a'),auth['isAuthenticated'](),controller[_0xe399('0x3b')]);router[_0xe399('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0xe399('0x9')](),controller[_0xe399('0x3c')]);router[_0xe399('0x7')]('/fax/queues/waitinginteractions',auth[_0xe399('0x9')](),controller['faxQueuesWaitingInteractions']);router[_0xe399('0x3d')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe399('0x3e')](_0xe399('0x3f')));router[_0xe399('0x7')](_0xe399('0x40'),auth[_0xe399('0x9')](),controller[_0xe399('0x41')]);router[_0xe399('0x3d')](_0xe399('0x42'),auth[_0xe399('0x9')](),controller[_0xe399('0x3e')](_0xe399('0x43')));router['get'](_0xe399('0x44'),auth['isAuthenticated'](),controller[_0xe399('0x45')]);router[_0xe399('0x3d')](_0xe399('0x46'),auth[_0xe399('0x9')](),controller[_0xe399('0x3e')]('fax'));router['get'](_0xe399('0x47'),auth[_0xe399('0x9')](),controller[_0xe399('0x48')]);router['post'](_0xe399('0x49'),auth[_0xe399('0x9')](),controller[_0xe399('0x3e')]('openchannel'));router[_0xe399('0x7')](_0xe399('0x4a'),auth[_0xe399('0x9')](),controller[_0xe399('0x4b')]);router[_0xe399('0x3d')](_0xe399('0x4c'),auth['isAuthenticated'](),controller[_0xe399('0x3e')](_0xe399('0x4d')));router[_0xe399('0x3d')](_0xe399('0x4e'),auth['isAuthenticated'](),controller[_0xe399('0x3e')](_0xe399('0x4f')));router[_0xe399('0x7')](_0xe399('0x50'),auth[_0xe399('0x9')](),controller[_0xe399('0x51')]);router[_0xe399('0x7')]('/whatsapp/queues/:id',auth[_0xe399('0x9')](),controller[_0xe399('0x52')]);router['post'](_0xe399('0x53'),auth['isAuthenticated'](),controller[_0xe399('0x54')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 36ae28c..90d2497 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x4e13c6,_0x4fea81){var _0x4d5eca=function(_0x121c38){while(--_0x121c38){_0x4e13c6['push'](_0x4e13c6['shift']());}};_0x4d5eca(++_0x4fea81);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file +var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x38034b,_0x564ca5){var _0x435bc6=function(_0x13e201){while(--_0x13e201){_0x38034b['push'](_0x38034b['shift']());}};_0x435bc6(++_0x564ca5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index c6e5968..d65d984 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 _0xfde6=['../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','show','get','/:id/run','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x36b88d,_0x4eca6c){var _0x3d22a6=function(_0x28602c){while(--_0x28602c){_0x36b88d['push'](_0x36b88d['shift']());}};_0x3d22a6(++_0x4eca6c);}(_0xfde6,0xb9));var _0x6fde=function(_0x193c83,_0x25e9f6){_0x193c83=_0x193c83-0x0;var _0x392193=_0xfde6[_0x193c83];return _0x392193;};'use strict';var multer=require(_0x6fde('0x0'));var util=require(_0x6fde('0x1'));var path=require('path');var timeout=require(_0x6fde('0x2'));var express=require('express');var router=express[_0x6fde('0x3')]();var fs_extra=require(_0x6fde('0x4'));var auth=require(_0x6fde('0x5'));var interaction=require(_0x6fde('0x6'));var config=require('../../config/environment');var controller=require(_0x6fde('0x7'));router['get']('/',auth[_0x6fde('0x8')](),controller['index']);router['get']('/:id',auth[_0x6fde('0x8')](),controller[_0x6fde('0x9')]);router[_0x6fde('0xa')](_0x6fde('0xb'),auth[_0x6fde('0x8')](),controller['run']);router['post']('/',auth[_0x6fde('0x8')](),controller[_0x6fde('0xc')]);router[_0x6fde('0xd')](_0x6fde('0xe'),auth[_0x6fde('0x8')](),controller[_0x6fde('0xf')]);router[_0x6fde('0x10')](_0x6fde('0xe'),auth[_0x6fde('0x8')](),controller[_0x6fde('0x11')]);module[_0x6fde('0x12')]=router; \ No newline at end of file +var _0xb0e2=['index','get','/:id','show','/:id/run','run','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated'];(function(_0x2db4c1,_0x3d87fd){var _0x3fe1c3=function(_0x85a2d2){while(--_0x85a2d2){_0x2db4c1['push'](_0x2db4c1['shift']());}};_0x3fe1c3(++_0x3d87fd);}(_0xb0e2,0x1ef));var _0x2b0e=function(_0x5aea61,_0x5d8f55){_0x5aea61=_0x5aea61-0x0;var _0x1324f9=_0xb0e2[_0x5aea61];return _0x1324f9;};'use strict';var multer=require(_0x2b0e('0x0'));var util=require(_0x2b0e('0x1'));var path=require(_0x2b0e('0x2'));var timeout=require(_0x2b0e('0x3'));var express=require(_0x2b0e('0x4'));var router=express['Router']();var fs_extra=require(_0x2b0e('0x5'));var auth=require(_0x2b0e('0x6'));var interaction=require(_0x2b0e('0x7'));var config=require(_0x2b0e('0x8'));var controller=require(_0x2b0e('0x9'));router['get']('/',auth[_0x2b0e('0xa')](),controller[_0x2b0e('0xb')]);router[_0x2b0e('0xc')](_0x2b0e('0xd'),auth[_0x2b0e('0xa')](),controller[_0x2b0e('0xe')]);router[_0x2b0e('0xc')](_0x2b0e('0xf'),auth['isAuthenticated'](),controller[_0x2b0e('0x10')]);router['post']('/',auth[_0x2b0e('0xa')](),controller['create']);router[_0x2b0e('0x11')](_0x2b0e('0xd'),auth[_0x2b0e('0xa')](),controller[_0x2b0e('0x12')]);router[_0x2b0e('0x13')](_0x2b0e('0xd'),auth[_0x2b0e('0xa')](),controller[_0x2b0e('0x14')]);module[_0x2b0e('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 82deaa9..c51765f 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 _0x0d9e=['TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','days','minutes','xlsx','csv','custom','default'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x0d9e,0x19f));var _0xe0d9=function(_0x21eb19,_0x146185){_0x21eb19=_0x21eb19-0x0;var _0x43138a=_0x0d9e[_0x21eb19];return _0x43138a;};'use strict';var Sequelize=require(_0xe0d9('0x0'));module[_0xe0d9('0x1')]={'name':{'type':Sequelize[_0xe0d9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe0d9('0x2')]},'active':{'type':Sequelize[_0xe0d9('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe0d9('0x2')],'allowNull':![],'defaultValue':_0xe0d9('0x4')},'startAt':{'type':Sequelize[_0xe0d9('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe0d9('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe0d9('0x6')](_0xe0d9('0x7'),_0xe0d9('0x8'),_0xe0d9('0x9'),_0xe0d9('0xa'),_0xe0d9('0xb'),'hours',_0xe0d9('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xe0d9('0x6')]('csv','pdf',_0xe0d9('0xd')),'allowNull':![],'defaultValue':_0xe0d9('0xe')},'type':{'type':Sequelize['ENUM'](_0xe0d9('0xf'),_0xe0d9('0x10')),'allowNull':![],'defaultValue':_0xe0d9('0xf')},'sendMail':{'type':Sequelize[_0xe0d9('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xe0d9('0x2')]},'cc':{'type':Sequelize[_0xe0d9('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xf447=['DATE','INTEGER','years','months','days','hours','ENUM','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*'];(function(_0x7036d5,_0x3db2dd){var _0x2922d6=function(_0x372778){while(--_0x372778){_0x7036d5['push'](_0x7036d5['shift']());}};_0x2922d6(++_0x3db2dd);}(_0xf447,0xe9));var _0x7f44=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xf447[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x7f44('0x0'));module[_0x7f44('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7f44('0x2')]},'active':{'type':Sequelize[_0x7f44('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7f44('0x2')],'allowNull':![],'defaultValue':_0x7f44('0x4')},'startAt':{'type':Sequelize[_0x7f44('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x7f44('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7f44('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x7f44('0x7'),'quarters',_0x7f44('0x8'),'weeks',_0x7f44('0x9'),_0x7f44('0xa'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x7f44('0xb')](_0x7f44('0xc'),_0x7f44('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x7f44('0xc')},'type':{'type':Sequelize[_0x7f44('0xb')](_0x7f44('0xe'),_0x7f44('0xf')),'allowNull':![],'defaultValue':_0x7f44('0xe')},'sendMail':{'type':Sequelize[_0x7f44('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x7f44('0x10')]},'bcc':{'type':Sequelize[_0x7f44('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x7f44('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 490ce48..fb3594f 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 _0x344e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','type','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x344e,0xea));var _0xe344=function(_0x14e10f,_0x40959c){_0x14e10f=_0x14e10f-0x0;var _0x4b64bf=_0x344e[_0x14e10f];return _0x4b64bf;};'use strict';var emlformat=require(_0xe344('0x0'));var rimraf=require(_0xe344('0x1'));var zipdir=require(_0xe344('0x2'));var jsonpatch=require(_0xe344('0x3'));var rp=require(_0xe344('0x4'));var moment=require(_0xe344('0x5'));var BPromise=require(_0xe344('0x6'));var Mustache=require(_0xe344('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe344('0x8'));var csv=require(_0xe344('0x9'));var ejs=require(_0xe344('0xa'));var fs=require('fs');var fs_extra=require(_0xe344('0xb'));var _=require(_0xe344('0xc'));var squel=require(_0xe344('0xd'));var crypto=require(_0xe344('0xe'));var jsforce=require(_0xe344('0xf'));var deskjs=require(_0xe344('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe344('0x11'));var Papa=require(_0xe344('0x12'));var Redis=require(_0xe344('0x13'));var authService=require(_0xe344('0x14'));var qs=require(_0xe344('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe344('0x16'));var utils=require(_0xe344('0x17'));var config=require(_0xe344('0x18'));var licenseUtil=require(_0xe344('0x19'));var db=require(_0xe344('0x1a'))['db'];function respondWithStatusCode(_0x578684,_0x38f6d5){_0x38f6d5=_0x38f6d5||0xcc;return function(_0x1fd033){if(_0x1fd033){return _0x578684[_0xe344('0x1b')](_0x38f6d5);}return _0x578684['status'](_0x38f6d5)[_0xe344('0x1c')]();};}function respondWithResult(_0x424fcc,_0x7c185f){_0x7c185f=_0x7c185f||0xc8;return function(_0x279d08){if(_0x279d08){return _0x424fcc[_0xe344('0x1d')](_0x7c185f)[_0xe344('0x1e')](_0x279d08);}};}function respondWithFilteredResult(_0x30bda0,_0x180c81){return function(_0x3f96bc){if(_0x3f96bc){var _0x769f6a=typeof _0x180c81['offset']===_0xe344('0x1f')&&typeof _0x180c81['limit']===_0xe344('0x1f');var _0x57bfcc=_0x3f96bc[_0xe344('0x20')];var _0x5ad5d3=_0x769f6a?0x0:_0x180c81[_0xe344('0x21')];var _0x267ba0=_0x769f6a?_0x3f96bc[_0xe344('0x20')]:_0x180c81[_0xe344('0x21')]+_0x180c81[_0xe344('0x22')];var _0x1015da;if(_0x267ba0>=_0x57bfcc){_0x267ba0=_0x57bfcc;_0x1015da=0xc8;}else{_0x1015da=0xce;}_0x30bda0[_0xe344('0x1d')](_0x1015da);return _0x30bda0['set']('Content-Range',_0x5ad5d3+'-'+_0x267ba0+'/'+_0x57bfcc)[_0xe344('0x1e')](_0x3f96bc);}return null;};}function patchUpdates(_0xd95c7d){return function(_0x4e267f){try{jsonpatch[_0xe344('0x23')](_0x4e267f,_0xd95c7d,!![]);}catch(_0x42726f){return BPromise[_0xe344('0x24')](_0x42726f);}return _0x4e267f[_0xe344('0x25')]();};}function saveUpdates(_0x1bd258,_0x589e4d){return function(_0x2997bd){if(_0x2997bd){return _0x2997bd[_0xe344('0x26')](_0x1bd258)[_0xe344('0x27')](function(_0x2bfe4c){return _0x2bfe4c;});}return null;};}function removeEntity(_0x4259b2,_0x1c31a4){return function(_0xbe336a){if(_0xbe336a){return _0xbe336a['destroy']()[_0xe344('0x27')](function(){var _0x272721=_0xbe336a[_0xe344('0x28')]({'plain':!![]});var _0x3f623f=_0xe344('0x29');return db[_0xe344('0x2a')][_0xe344('0x2b')]({'where':{'type':_0x3f623f,'resourceId':_0x272721['id']}})[_0xe344('0x27')](function(){return _0xbe336a;});})[_0xe344('0x27')](function(){_0x4259b2[_0xe344('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23c8dc,_0x5a24da){return function(_0x3eb0fe){if(!_0x3eb0fe){_0x23c8dc['sendStatus'](0x194);}return _0x3eb0fe;};}function handleError(_0x2c6241,_0x2a36c4){_0x2a36c4=_0x2a36c4||0x1f4;return function(_0x3f1ba9){logger['error'](_0x3f1ba9[_0xe344('0x2c')]);if(_0x3f1ba9['name']){delete _0x3f1ba9[_0xe344('0x2d')];}_0x2c6241[_0xe344('0x1d')](_0x2a36c4)[_0xe344('0x2e')](_0x3f1ba9);};}exports[_0xe344('0x2f')]=function(_0x4f40b9,_0x16b888){var _0x423e4e={},_0x20ad4b={},_0x2ccdcb={'count':0x0,'rows':[]};var _0x56e3b9=_[_0xe344('0x30')](db[_0xe344('0x31')][_0xe344('0x32')],function(_0x37f7a1){return{'name':_0x37f7a1[_0xe344('0x33')],'type':_0x37f7a1['type'][_0xe344('0x34')]};});_0x20ad4b[_0xe344('0x35')]=_[_0xe344('0x30')](_0x56e3b9,_0xe344('0x2d'));_0x20ad4b[_0xe344('0x36')]=_[_0xe344('0x37')](_0x4f40b9[_0xe344('0x36')]);_0x20ad4b['filters']=_[_0xe344('0x38')](_0x20ad4b[_0xe344('0x35')],_0x20ad4b['query']);_0x423e4e[_0xe344('0x39')]=_[_0xe344('0x38')](_0x20ad4b[_0xe344('0x35')],qs[_0xe344('0x3a')](_0x4f40b9['query']['fields']));_0x423e4e['attributes']=_0x423e4e[_0xe344('0x39')][_0xe344('0x3b')]?_0x423e4e['attributes']:_0x20ad4b[_0xe344('0x35')];if(!_0x4f40b9[_0xe344('0x36')][_0xe344('0x3c')](_0xe344('0x3d'))){_0x423e4e[_0xe344('0x22')]=qs['limit'](_0x4f40b9[_0xe344('0x36')][_0xe344('0x22')]);_0x423e4e[_0xe344('0x21')]=qs[_0xe344('0x21')](_0x4f40b9[_0xe344('0x36')]['offset']);}_0x423e4e[_0xe344('0x3e')]=qs['sort'](_0x4f40b9[_0xe344('0x36')]['sort']);_0x423e4e[_0xe344('0x3f')]=qs[_0xe344('0x40')](_['pick'](_0x4f40b9['query'],_0x20ad4b[_0xe344('0x40')]),_0x56e3b9);if(_0x4f40b9[_0xe344('0x36')][_0xe344('0x41')]){_0x423e4e[_0xe344('0x3f')]=_[_0xe344('0x42')](_0x423e4e[_0xe344('0x3f')],{'$or':_[_0xe344('0x30')](_0x56e3b9,function(_0x17030d){if(_0x17030d[_0xe344('0x43')]!=='VIRTUAL'){var _0x1550ed={};_0x1550ed[_0x17030d[_0xe344('0x2d')]]={'$like':'%'+_0x4f40b9[_0xe344('0x36')][_0xe344('0x41')]+'%'};return _0x1550ed;}})});}_0x423e4e=_['merge']({},_0x423e4e,_0x4f40b9['options']);var _0x12d38f={'where':_0x423e4e['where']};return db[_0xe344('0x31')][_0xe344('0x20')](_0x12d38f)[_0xe344('0x27')](function(_0x6da28b){_0x2ccdcb[_0xe344('0x20')]=_0x6da28b;if(_0x4f40b9['query'][_0xe344('0x44')]){_0x423e4e[_0xe344('0x45')]=[{'all':!![]}];}return db['Schedule'][_0xe344('0x46')](_0x423e4e);})[_0xe344('0x27')](function(_0x4c0de9){_0x2ccdcb['rows']=_0x4c0de9;return _0x2ccdcb;})[_0xe344('0x27')](respondWithFilteredResult(_0x16b888,_0x423e4e))[_0xe344('0x47')](handleError(_0x16b888,null));};exports[_0xe344('0x48')]=function(_0x24778e,_0x246ed2){var _0x10fd80={'raw':![],'where':{'id':_0x24778e[_0xe344('0x49')]['id']}},_0x613f5a={};_0x613f5a[_0xe344('0x35')]=_[_0xe344('0x37')](db[_0xe344('0x31')][_0xe344('0x32')]);_0x613f5a[_0xe344('0x36')]=_[_0xe344('0x37')](_0x24778e[_0xe344('0x36')]);_0x613f5a[_0xe344('0x40')]=_[_0xe344('0x38')](_0x613f5a['model'],_0x613f5a['query']);_0x10fd80[_0xe344('0x39')]=_[_0xe344('0x38')](_0x613f5a[_0xe344('0x35')],qs[_0xe344('0x3a')](_0x24778e['query'][_0xe344('0x3a')]));_0x10fd80[_0xe344('0x39')]=_0x10fd80['attributes'][_0xe344('0x3b')]?_0x10fd80[_0xe344('0x39')]:_0x613f5a['model'];if(_0x24778e[_0xe344('0x36')]['includeAll']){_0x10fd80['include']=[{'all':!![]}];}_0x10fd80=_[_0xe344('0x42')]({},_0x10fd80,_0x24778e[_0xe344('0x4a')]);return db['Schedule'][_0xe344('0x4b')](_0x10fd80)[_0xe344('0x27')](handleEntityNotFound(_0x246ed2,null))['then'](respondWithResult(_0x246ed2,null))['catch'](handleError(_0x246ed2,null));};exports[_0xe344('0x4c')]=function(_0x3139b4,_0x28421c){return db[_0xe344('0x31')]['create'](_0x3139b4[_0xe344('0x4d')],{})[_0xe344('0x27')](function(_0x3b829a){var _0x2d9713=_0x3139b4[_0xe344('0x4e')][_0xe344('0x28')]({'plain':!![]});if(!_0x2d9713)throw new Error(_0xe344('0x4f'));if(_0x2d9713['role']===_0xe344('0x4e')){var _0x2427f4=_0x3b829a[_0xe344('0x28')]({'plain':!![]});var _0x229736=_0xe344('0x29');return db[_0xe344('0x50')][_0xe344('0x4b')]({'where':{'name':_0x229736,'userProfileId':_0x2d9713[_0xe344('0x51')]},'raw':!![]})['then'](function(_0x55a949){if(_0x55a949&&_0x55a949[_0xe344('0x52')]===0x0){return db[_0xe344('0x2a')][_0xe344('0x4c')]({'name':_0x2427f4[_0xe344('0x2d')],'resourceId':_0x2427f4['id'],'type':_0x55a949['name'],'sectionId':_0x55a949['id']},{})['then'](function(){return _0x3b829a;});}else{return _0x3b829a;}})[_0xe344('0x47')](function(_0x2eefff){logger[_0xe344('0x53')](_0xe344('0x54'),_0x2eefff);throw _0x2eefff;});}return _0x3b829a;})['then'](respondWithResult(_0x28421c,0xc9))[_0xe344('0x47')](handleError(_0x28421c,null));};exports[_0xe344('0x26')]=function(_0x42f95e,_0x357cc2){if(_0x42f95e[_0xe344('0x4d')]['id']){delete _0x42f95e['body']['id'];}return db[_0xe344('0x31')][_0xe344('0x4b')]({'where':{'id':_0x42f95e[_0xe344('0x49')]['id']}})[_0xe344('0x27')](handleEntityNotFound(_0x357cc2,null))[_0xe344('0x27')](saveUpdates(_0x42f95e[_0xe344('0x4d')],null))['then'](respondWithResult(_0x357cc2,null))[_0xe344('0x47')](handleError(_0x357cc2,null));};exports['destroy']=function(_0x15c1cd,_0x3abc0a){return db[_0xe344('0x31')][_0xe344('0x4b')]({'where':{'id':_0x15c1cd[_0xe344('0x49')]['id']}})[_0xe344('0x27')](handleEntityNotFound(_0x3abc0a,null))['then'](removeEntity(_0x3abc0a,null))[_0xe344('0x47')](handleError(_0x3abc0a,null));};exports[_0xe344('0x55')]=function(_0x46c5c5,_0x54ee5f,_0x30b828){var _0x28ffd5=require('../../config/schedule');return db[_0xe344('0x31')][_0xe344('0x4b')]({'where':{'id':_0x46c5c5[_0xe344('0x49')]['id']},'raw':!![]})[_0xe344('0x27')](handleEntityNotFound(_0x54ee5f,null))[_0xe344('0x27')](function(){_0x28ffd5[_0xe344('0x55')](_0x46c5c5[_0xe344('0x49')]['id']);})[_0xe344('0x27')](respondWithStatusCode(_0x54ee5f,null))['catch'](handleError(_0x54ee5f,null));}; \ No newline at end of file +var _0xce68=['path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','offset','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','Scheduler','UserProfileResource','end','sendStatus','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0xce68,0x15c));var _0x8ce6=function(_0x5b4c34,_0x59e7cd){_0x5b4c34=_0x5b4c34-0x0;var _0x11dc43=_0xce68[_0x5b4c34];return _0x11dc43;};'use strict';var emlformat=require(_0x8ce6('0x0'));var rimraf=require(_0x8ce6('0x1'));var zipdir=require(_0x8ce6('0x2'));var jsonpatch=require(_0x8ce6('0x3'));var rp=require(_0x8ce6('0x4'));var moment=require(_0x8ce6('0x5'));var BPromise=require(_0x8ce6('0x6'));var Mustache=require('mustache');var util=require(_0x8ce6('0x7'));var path=require(_0x8ce6('0x8'));var sox=require(_0x8ce6('0x9'));var csv=require(_0x8ce6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ce6('0xb'));var squel=require(_0x8ce6('0xc'));var crypto=require(_0x8ce6('0xd'));var jsforce=require(_0x8ce6('0xe'));var deskjs=require(_0x8ce6('0xf'));var toCsv=require(_0x8ce6('0xa'));var querystring=require(_0x8ce6('0x10'));var Papa=require(_0x8ce6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ce6('0x12'));var as=require(_0x8ce6('0x13'));var hardwareService=require(_0x8ce6('0x14'));var logger=require(_0x8ce6('0x15'))(_0x8ce6('0x16'));var utils=require(_0x8ce6('0x17'));var config=require(_0x8ce6('0x18'));var licenseUtil=require(_0x8ce6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x311bd5,_0x161d5b){_0x161d5b=_0x161d5b||0xcc;return function(_0x2cd128){if(_0x2cd128){return _0x311bd5['sendStatus'](_0x161d5b);}return _0x311bd5['status'](_0x161d5b)['end']();};}function respondWithResult(_0x5bd6a2,_0x5fd1e0){_0x5fd1e0=_0x5fd1e0||0xc8;return function(_0x1976e4){if(_0x1976e4){return _0x5bd6a2['status'](_0x5fd1e0)['json'](_0x1976e4);}};}function respondWithFilteredResult(_0x4d4a67,_0x290aa5){return function(_0x5a433e){if(_0x5a433e){var _0x5e6ea1=typeof _0x290aa5[_0x8ce6('0x1a')]==='undefined'&&typeof _0x290aa5[_0x8ce6('0x1b')]==='undefined';var _0x27fb6e=_0x5a433e[_0x8ce6('0x1c')];var _0x4e1e00=_0x5e6ea1?0x0:_0x290aa5[_0x8ce6('0x1a')];var _0x38da28=_0x5e6ea1?_0x5a433e['count']:_0x290aa5['offset']+_0x290aa5[_0x8ce6('0x1b')];var _0xbf0370;if(_0x38da28>=_0x27fb6e){_0x38da28=_0x27fb6e;_0xbf0370=0xc8;}else{_0xbf0370=0xce;}_0x4d4a67[_0x8ce6('0x1d')](_0xbf0370);return _0x4d4a67[_0x8ce6('0x1e')](_0x8ce6('0x1f'),_0x4e1e00+'-'+_0x38da28+'/'+_0x27fb6e)[_0x8ce6('0x20')](_0x5a433e);}return null;};}function patchUpdates(_0x3df8aa){return function(_0x587cab){try{jsonpatch[_0x8ce6('0x21')](_0x587cab,_0x3df8aa,!![]);}catch(_0x10e4f0){return BPromise[_0x8ce6('0x22')](_0x10e4f0);}return _0x587cab[_0x8ce6('0x23')]();};}function saveUpdates(_0x33713a,_0x2627c0){return function(_0x5b150b){if(_0x5b150b){return _0x5b150b['update'](_0x33713a)[_0x8ce6('0x24')](function(_0xad5c9b){return _0xad5c9b;});}return null;};}function removeEntity(_0x266bb0,_0xcdf7fb){return function(_0x4fb80f){if(_0x4fb80f){return _0x4fb80f[_0x8ce6('0x25')]()['then'](function(){var _0x37ab56=_0x4fb80f['get']({'plain':!![]});var _0x543ca9=_0x8ce6('0x26');return db[_0x8ce6('0x27')][_0x8ce6('0x25')]({'where':{'type':_0x543ca9,'resourceId':_0x37ab56['id']}})['then'](function(){return _0x4fb80f;});})[_0x8ce6('0x24')](function(){_0x266bb0[_0x8ce6('0x1d')](0xcc)[_0x8ce6('0x28')]();});}};}function handleEntityNotFound(_0x590200,_0x33a623){return function(_0x496590){if(!_0x496590){_0x590200[_0x8ce6('0x29')](0x194);}return _0x496590;};}function handleError(_0x264182,_0xab345){_0xab345=_0xab345||0x1f4;return function(_0x450d05){logger[_0x8ce6('0x2a')](_0x450d05[_0x8ce6('0x2b')]);if(_0x450d05['name']){delete _0x450d05[_0x8ce6('0x2c')];}_0x264182['status'](_0xab345)[_0x8ce6('0x2d')](_0x450d05);};}exports['index']=function(_0x225c59,_0x56ad64){var _0x1ad49f={},_0x53307d={},_0x57f969={'count':0x0,'rows':[]};var _0x274985=_[_0x8ce6('0x2e')](db['Schedule']['rawAttributes'],function(_0x27347c){return{'name':_0x27347c[_0x8ce6('0x2f')],'type':_0x27347c[_0x8ce6('0x30')][_0x8ce6('0x31')]};});_0x53307d[_0x8ce6('0x32')]=_[_0x8ce6('0x2e')](_0x274985,_0x8ce6('0x2c'));_0x53307d[_0x8ce6('0x33')]=_[_0x8ce6('0x34')](_0x225c59[_0x8ce6('0x33')]);_0x53307d[_0x8ce6('0x35')]=_[_0x8ce6('0x36')](_0x53307d[_0x8ce6('0x32')],_0x53307d['query']);_0x1ad49f[_0x8ce6('0x37')]=_['intersection'](_0x53307d[_0x8ce6('0x32')],qs[_0x8ce6('0x38')](_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x38')]));_0x1ad49f[_0x8ce6('0x37')]=_0x1ad49f[_0x8ce6('0x37')][_0x8ce6('0x39')]?_0x1ad49f[_0x8ce6('0x37')]:_0x53307d[_0x8ce6('0x32')];if(!_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x3a')](_0x8ce6('0x3b'))){_0x1ad49f[_0x8ce6('0x1b')]=qs[_0x8ce6('0x1b')](_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x1b')]);_0x1ad49f[_0x8ce6('0x1a')]=qs[_0x8ce6('0x1a')](_0x225c59['query'][_0x8ce6('0x1a')]);}_0x1ad49f[_0x8ce6('0x3c')]=qs[_0x8ce6('0x3d')](_0x225c59['query'][_0x8ce6('0x3d')]);_0x1ad49f[_0x8ce6('0x3e')]=qs[_0x8ce6('0x35')](_[_0x8ce6('0x3f')](_0x225c59['query'],_0x53307d[_0x8ce6('0x35')]),_0x274985);if(_0x225c59['query'][_0x8ce6('0x40')]){_0x1ad49f['where']=_[_0x8ce6('0x41')](_0x1ad49f['where'],{'$or':_[_0x8ce6('0x2e')](_0x274985,function(_0x31ffb9){if(_0x31ffb9[_0x8ce6('0x30')]!==_0x8ce6('0x42')){var _0x3553b3={};_0x3553b3[_0x31ffb9[_0x8ce6('0x2c')]]={'$like':'%'+_0x225c59['query']['filter']+'%'};return _0x3553b3;}})});}_0x1ad49f=_[_0x8ce6('0x41')]({},_0x1ad49f,_0x225c59[_0x8ce6('0x43')]);var _0x211e1c={'where':_0x1ad49f[_0x8ce6('0x3e')]};return db[_0x8ce6('0x44')][_0x8ce6('0x1c')](_0x211e1c)['then'](function(_0xba7ae7){_0x57f969[_0x8ce6('0x1c')]=_0xba7ae7;if(_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x45')]){_0x1ad49f[_0x8ce6('0x46')]=[{'all':!![]}];}return db[_0x8ce6('0x44')][_0x8ce6('0x47')](_0x1ad49f);})[_0x8ce6('0x24')](function(_0x462bec){_0x57f969[_0x8ce6('0x48')]=_0x462bec;return _0x57f969;})['then'](respondWithFilteredResult(_0x56ad64,_0x1ad49f))[_0x8ce6('0x49')](handleError(_0x56ad64,null));};exports[_0x8ce6('0x4a')]=function(_0x1a7828,_0x2cdd20){var _0x5f0ed2={'raw':![],'where':{'id':_0x1a7828[_0x8ce6('0x4b')]['id']}},_0x2056c6={};_0x2056c6[_0x8ce6('0x32')]=_['keys'](db[_0x8ce6('0x44')][_0x8ce6('0x4c')]);_0x2056c6[_0x8ce6('0x33')]=_[_0x8ce6('0x34')](_0x1a7828['query']);_0x2056c6['filters']=_[_0x8ce6('0x36')](_0x2056c6[_0x8ce6('0x32')],_0x2056c6[_0x8ce6('0x33')]);_0x5f0ed2[_0x8ce6('0x37')]=_['intersection'](_0x2056c6[_0x8ce6('0x32')],qs[_0x8ce6('0x38')](_0x1a7828[_0x8ce6('0x33')][_0x8ce6('0x38')]));_0x5f0ed2[_0x8ce6('0x37')]=_0x5f0ed2[_0x8ce6('0x37')][_0x8ce6('0x39')]?_0x5f0ed2[_0x8ce6('0x37')]:_0x2056c6[_0x8ce6('0x32')];if(_0x1a7828[_0x8ce6('0x33')][_0x8ce6('0x45')]){_0x5f0ed2[_0x8ce6('0x46')]=[{'all':!![]}];}_0x5f0ed2=_[_0x8ce6('0x41')]({},_0x5f0ed2,_0x1a7828[_0x8ce6('0x43')]);return db['Schedule'][_0x8ce6('0x4d')](_0x5f0ed2)[_0x8ce6('0x24')](handleEntityNotFound(_0x2cdd20,null))[_0x8ce6('0x24')](respondWithResult(_0x2cdd20,null))['catch'](handleError(_0x2cdd20,null));};exports[_0x8ce6('0x4e')]=function(_0x562133,_0x5ebb56){return db[_0x8ce6('0x44')][_0x8ce6('0x4e')](_0x562133['body'],{})[_0x8ce6('0x24')](function(_0x5aa7b4){var _0x378b78=_0x562133[_0x8ce6('0x4f')][_0x8ce6('0x50')]({'plain':!![]});if(!_0x378b78)throw new Error(_0x8ce6('0x51'));if(_0x378b78[_0x8ce6('0x52')]===_0x8ce6('0x4f')){var _0x181169=_0x5aa7b4[_0x8ce6('0x50')]({'plain':!![]});var _0x29eae5=_0x8ce6('0x26');return db[_0x8ce6('0x53')][_0x8ce6('0x4d')]({'where':{'name':_0x29eae5,'userProfileId':_0x378b78[_0x8ce6('0x54')]},'raw':!![]})[_0x8ce6('0x24')](function(_0x5746f9){if(_0x5746f9&&_0x5746f9[_0x8ce6('0x55')]===0x0){return db['UserProfileResource'][_0x8ce6('0x4e')]({'name':_0x181169[_0x8ce6('0x2c')],'resourceId':_0x181169['id'],'type':_0x5746f9[_0x8ce6('0x2c')],'sectionId':_0x5746f9['id']},{})[_0x8ce6('0x24')](function(){return _0x5aa7b4;});}else{return _0x5aa7b4;}})['catch'](function(_0x14e3df){logger[_0x8ce6('0x2a')](_0x8ce6('0x56'),_0x14e3df);throw _0x14e3df;});}return _0x5aa7b4;})[_0x8ce6('0x24')](respondWithResult(_0x5ebb56,0xc9))[_0x8ce6('0x49')](handleError(_0x5ebb56,null));};exports['update']=function(_0x1bb77b,_0x45f6ba){if(_0x1bb77b[_0x8ce6('0x57')]['id']){delete _0x1bb77b[_0x8ce6('0x57')]['id'];}return db[_0x8ce6('0x44')][_0x8ce6('0x4d')]({'where':{'id':_0x1bb77b[_0x8ce6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45f6ba,null))[_0x8ce6('0x24')](saveUpdates(_0x1bb77b[_0x8ce6('0x57')],null))[_0x8ce6('0x24')](respondWithResult(_0x45f6ba,null))[_0x8ce6('0x49')](handleError(_0x45f6ba,null));};exports[_0x8ce6('0x25')]=function(_0x56c399,_0x47e645){return db[_0x8ce6('0x44')]['find']({'where':{'id':_0x56c399[_0x8ce6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47e645,null))[_0x8ce6('0x24')](removeEntity(_0x47e645,null))[_0x8ce6('0x49')](handleError(_0x47e645,null));};exports[_0x8ce6('0x58')]=function(_0x32af96,_0x35a0f2,_0x52d5c2){var _0x1eeb51=require('../../config/schedule');return db[_0x8ce6('0x44')][_0x8ce6('0x4d')]({'where':{'id':_0x32af96['params']['id']},'raw':!![]})[_0x8ce6('0x24')](handleEntityNotFound(_0x35a0f2,null))[_0x8ce6('0x24')](function(){_0x1eeb51[_0x8ce6('0x58')](_0x32af96[_0x8ce6('0x4b')]['id']);})[_0x8ce6('0x24')](respondWithStatusCode(_0x35a0f2,null))['catch'](handleError(_0x35a0f2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index de15b1c..cd57d38 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 _0xedc7=['lodash','../../config/logger','moment','bluebird','../../config/environment','./schedule.attributes','exports','define','tools_schedules'];(function(_0x25bce8,_0x28a1b8){var _0x2453c2=function(_0x570a59){while(--_0x570a59){_0x25bce8['push'](_0x25bce8['shift']());}};_0x2453c2(++_0x28a1b8);}(_0xedc7,0xa2));var _0x7edc=function(_0x2f6495,_0x5a9c10){_0x2f6495=_0x2f6495-0x0;var _0x52fae6=_0xedc7[_0x2f6495];return _0x52fae6;};'use strict';var _=require(_0x7edc('0x0'));var util=require('util');var logger=require(_0x7edc('0x1'))('api');var moment=require(_0x7edc('0x2'));var BPromise=require(_0x7edc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7edc('0x4'));var attributes=require(_0x7edc('0x5'));module[_0x7edc('0x6')]=function(_0xc03ce7,_0x2b6c7b){return _0xc03ce7[_0x7edc('0x7')]('Schedule',attributes,{'tableName':_0x7edc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf88d=['util','../../config/logger','moment','request-promise','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x499f08,_0x3d398d){var _0x301401=function(_0x541ae1){while(--_0x541ae1){_0x499f08['push'](_0x499f08['shift']());}};_0x301401(++_0x3d398d);}(_0xf88d,0x10e));var _0xdf88=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xf88d[_0xe73080];return _0x12cbc4;};'use strict';var _=require('lodash');var util=require(_0xdf88('0x0'));var logger=require(_0xdf88('0x1'))('api');var moment=require(_0xdf88('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf88('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf88('0x4'));var attributes=require(_0xdf88('0x5'));module[_0xdf88('0x6')]=function(_0xee1667,_0xe9d865){return _0xee1667[_0xdf88('0x7')](_0xdf88('0x8'),attributes,{'tableName':'tools_schedules','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 c974f5b..2945ef8 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 _0xf3bc=['../../mysqldb','../../config/logger','../../config/environment','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring'];(function(_0x224a1d,_0x5043a3){var _0xb5d001=function(_0x4e0f32){while(--_0x4e0f32){_0x224a1d['push'](_0x224a1d['shift']());}};_0xb5d001(++_0x5043a3);}(_0xf3bc,0xe7));var _0xcf3b=function(_0x3c77a3,_0x5285e3){_0x3c77a3=_0x3c77a3-0x0;var _0x15579f=_0xf3bc[_0x3c77a3];return _0x15579f;};'use strict';var _=require('lodash');var util=require(_0xcf3b('0x0'));var moment=require(_0xcf3b('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf3b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf3b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf3b('0x4'))('rpc');var config=require(_0xcf3b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcf3b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x136502,_0x4fe2f9,_0x571c87){return new BPromise(function(_0x3731e4,_0x23712d){return client[_0xcf3b('0x7')](_0x136502,_0x571c87)['then'](function(_0x49037c){logger[_0xcf3b('0x8')](_0xcf3b('0x9'),_0x4fe2f9,_0xcf3b('0xa'));logger[_0xcf3b('0xb')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4fe2f9,_0xcf3b('0xa'),JSON[_0xcf3b('0xc')](_0x49037c));if(_0x49037c[_0xcf3b('0xd')]){if(_0x49037c['error'][_0xcf3b('0xe')]===0x1f4){logger[_0xcf3b('0xd')](_0xcf3b('0x9'),_0x4fe2f9,_0x49037c[_0xcf3b('0xd')]['message']);return _0x23712d(_0x49037c['error'][_0xcf3b('0xf')]);}logger[_0xcf3b('0xd')](_0xcf3b('0x9'),_0x4fe2f9,_0x49037c[_0xcf3b('0xd')][_0xcf3b('0xf')]);return _0x3731e4(_0x49037c[_0xcf3b('0xd')][_0xcf3b('0xf')]);}else{logger[_0xcf3b('0x8')]('Schedule,\x20%s,\x20%s',_0x4fe2f9,_0xcf3b('0xa'));_0x3731e4(_0x49037c[_0xcf3b('0x10')]['message']);}})[_0xcf3b('0x11')](function(_0x3ff5a5){logger[_0xcf3b('0xd')](_0xcf3b('0x9'),_0x4fe2f9,_0x3ff5a5);_0x23712d(_0x3ff5a5);});});} \ No newline at end of file +var _0xbe3e=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http'];(function(_0x506b3a,_0x4897a6){var _0x15ffeb=function(_0x3097a7){while(--_0x3097a7){_0x506b3a['push'](_0x506b3a['shift']());}};_0x15ffeb(++_0x4897a6);}(_0xbe3e,0x147));var _0xebe3=function(_0x5b21a8,_0x35701f){_0x5b21a8=_0x5b21a8-0x0;var _0x5f6aaa=_0xbe3e[_0x5b21a8];return _0x5f6aaa;};'use strict';var _=require(_0xebe3('0x0'));var util=require(_0xebe3('0x1'));var moment=require('moment');var BPromise=require(_0xebe3('0x2'));var rs=require(_0xebe3('0x3'));var fs=require('fs');var Redis=require(_0xebe3('0x4'));var db=require(_0xebe3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xebe3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xebe3('0x7')][_0xebe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326a08,_0x6a0992,_0x2518a2){return new BPromise(function(_0x2f7108,_0x297b0f){return client[_0xebe3('0x9')](_0x326a08,_0x2518a2)[_0xebe3('0xa')](function(_0x2518c6){logger[_0xebe3('0xb')](_0xebe3('0xc'),_0x6a0992,_0xebe3('0xd'));logger[_0xebe3('0xe')](_0xebe3('0xf'),_0x6a0992,_0xebe3('0xd'),JSON['stringify'](_0x2518c6));if(_0x2518c6['error']){if(_0x2518c6['error'][_0xebe3('0x10')]===0x1f4){logger[_0xebe3('0x11')](_0xebe3('0xc'),_0x6a0992,_0x2518c6['error']['message']);return _0x297b0f(_0x2518c6[_0xebe3('0x11')]['message']);}logger['error'](_0xebe3('0xc'),_0x6a0992,_0x2518c6[_0xebe3('0x11')]['message']);return _0x2f7108(_0x2518c6['error'][_0xebe3('0x12')]);}else{logger['info'](_0xebe3('0xc'),_0x6a0992,_0xebe3('0xd'));_0x2f7108(_0x2518c6[_0xebe3('0x13')]['message']);}})[_0xebe3('0x14')](function(_0x3ecca6){logger[_0xebe3('0x11')]('Schedule,\x20%s,\x20%s',_0x6a0992,_0x3ecca6);_0x297b0f(_0x3ecca6);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index fa8b92f..6805d81 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 _0xc9ff=['index','/describe','describe','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x35b24b,_0x2b359d){var _0xa4f7bf=function(_0x3e1fda){while(--_0x3e1fda){_0x35b24b['push'](_0x35b24b['shift']());}};_0xa4f7bf(++_0x2b359d);}(_0xc9ff,0x109));var _0xfc9f=function(_0x4a39aa,_0x51214e){_0x4a39aa=_0x4a39aa-0x0;var _0x4ad859=_0xc9ff[_0x4a39aa];return _0x4ad859;};'use strict';var multer=require('multer');var util=require(_0xfc9f('0x0'));var path=require('path');var timeout=require(_0xfc9f('0x1'));var express=require(_0xfc9f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfc9f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfc9f('0x4'));var controller=require(_0xfc9f('0x5'));router[_0xfc9f('0x6')]('/',auth[_0xfc9f('0x7')](),controller[_0xfc9f('0x8')]);router[_0xfc9f('0x6')](_0xfc9f('0x9'),auth[_0xfc9f('0x7')](),controller[_0xfc9f('0xa')]);router[_0xfc9f('0x6')](_0xfc9f('0xb'),auth[_0xfc9f('0x7')](),controller[_0xfc9f('0xc')]);router[_0xfc9f('0x6')](_0xfc9f('0xd'),auth[_0xfc9f('0x7')](),controller[_0xfc9f('0xe')]);router['post']('/',auth[_0xfc9f('0x7')](),controller[_0xfc9f('0xf')]);router[_0xfc9f('0x10')](_0xfc9f('0xb'),auth[_0xfc9f('0x7')](),controller[_0xfc9f('0x11')]);router[_0xfc9f('0x12')](_0xfc9f('0xb'),auth[_0xfc9f('0x7')](),controller[_0xfc9f('0x13')]);module[_0xfc9f('0x14')]=router; \ No newline at end of file +var _0x847f=['create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post'];(function(_0x5b38a8,_0x9e9558){var _0xb74f1d=function(_0x56ffaa){while(--_0x56ffaa){_0x5b38a8['push'](_0x5b38a8['shift']());}};_0xb74f1d(++_0x9e9558);}(_0x847f,0x125));var _0xf847=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0x847f[_0x2803ab];return _0x3d6e8e;};'use strict';var multer=require(_0xf847('0x0'));var util=require(_0xf847('0x1'));var path=require(_0xf847('0x2'));var timeout=require(_0xf847('0x3'));var express=require('express');var router=express[_0xf847('0x4')]();var fs_extra=require(_0xf847('0x5'));var auth=require(_0xf847('0x6'));var interaction=require(_0xf847('0x7'));var config=require(_0xf847('0x8'));var controller=require(_0xf847('0x9'));router[_0xf847('0xa')]('/',auth[_0xf847('0xb')](),controller[_0xf847('0xc')]);router['get'](_0xf847('0xd'),auth[_0xf847('0xb')](),controller[_0xf847('0xe')]);router['get'](_0xf847('0xf'),auth[_0xf847('0xb')](),controller['show']);router['get'](_0xf847('0x10'),auth[_0xf847('0xb')](),controller[_0xf847('0x11')]);router[_0xf847('0x12')]('/',auth[_0xf847('0xb')](),controller[_0xf847('0x13')]);router[_0xf847('0x14')]('/:id',auth[_0xf847('0xb')](),controller[_0xf847('0x15')]);router[_0xf847('0x16')](_0xf847('0xf'),auth['isAuthenticated'](),controller[_0xf847('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1759260..f46b15e 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 _0x9b0d=['extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','moment','path','../../config/environment','exports','getDataValue','value'];(function(_0x1e55a6,_0x22ac86){var _0xbd2caa=function(_0x7671a1){while(--_0x7671a1){_0x1e55a6['push'](_0x1e55a6['shift']());}};_0xbd2caa(++_0x22ac86);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x11de9d,_0xb5fe40){_0x11de9d=_0x11de9d-0x0;var _0x11c0c9=_0x9b0d[_0x11de9d];return _0x11c0c9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd9b0('0x0'));var path=require(_0xd9b0('0x1'));var config=require(_0xd9b0('0x2'));module[_0xd9b0('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd9b0('0x4')](_0xd9b0('0x5'))?path[_0xd9b0('0x6')](this[_0xd9b0('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xd9b0('0x7')]},'channel':{'type':Sequelize[_0xd9b0('0x7')]},'value':{'type':Sequelize[_0xd9b0('0x7')],'set':function(_0x31c012){var _0x58bd64=_0x31c012[_0xd9b0('0x8')](/\\/g,'/');this[_0xd9b0('0x9')]('value',_0x58bd64);}},'rating':{'type':Sequelize[_0xd9b0('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd9b0('0xa')],'set':function(_0x48181a){this[_0xd9b0('0x9')]('startedAt',moment()[_0xd9b0('0xb')](_0x48181a,'ms'));this['setDataValue'](_0xd9b0('0xc'),moment());this[_0xd9b0('0x9')](_0xd9b0('0xd'),_0x48181a);}},'startedAt':{'type':Sequelize[_0xd9b0('0xe')],'get':function(){return moment(this[_0xd9b0('0x4')](_0xd9b0('0xf')))['format'](_0xd9b0('0x10'))[_0xd9b0('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd9b0('0x4')](_0xd9b0('0xc')))[_0xd9b0('0x12')](_0xd9b0('0x10'))[_0xd9b0('0x11')]();}},'createdAt':{'type':Sequelize[_0xd9b0('0xe')],'get':function(){return moment(this['getDataValue'](_0xd9b0('0x13')))['format'](_0xd9b0('0x10'))[_0xd9b0('0x11')]();}},'updatedAt':{'type':Sequelize[_0xd9b0('0xe')],'get':function(){return moment(this[_0xd9b0('0x4')](_0xd9b0('0x14')))[_0xd9b0('0x12')](_0xd9b0('0x10'))['toString']();}}}; \ No newline at end of file +var _0x2b29=['value','extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','../../config/environment','exports','getDataValue'];(function(_0x285c78,_0xc1816){var _0x5b48c3=function(_0x14bbdd){while(--_0x14bbdd){_0x285c78['push'](_0x285c78['shift']());}};_0x5b48c3(++_0xc1816);}(_0x2b29,0x163));var _0x92b2=function(_0x116cce,_0x59666a){_0x116cce=_0x116cce-0x0;var _0x2a7ceb=_0x2b29[_0x116cce];return _0x2a7ceb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x92b2('0x0'));var path=require(_0x92b2('0x1'));var config=require(_0x92b2('0x2'));module[_0x92b2('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x92b2('0x4')](_0x92b2('0x5'))?path[_0x92b2('0x6')](this[_0x92b2('0x4')](_0x92b2('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x92b2('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x92b2('0x7')],'set':function(_0x536e21){var _0x29f183=_0x536e21[_0x92b2('0x8')](/\\/g,'/');this['setDataValue'](_0x92b2('0x5'),_0x29f183);}},'rating':{'type':Sequelize[_0x92b2('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x92b2('0x9')],'set':function(_0x465011){this['setDataValue'](_0x92b2('0xa'),moment()[_0x92b2('0xb')](_0x465011,'ms'));this[_0x92b2('0xc')](_0x92b2('0xd'),moment());this[_0x92b2('0xc')](_0x92b2('0xe'),_0x465011);}},'startedAt':{'type':Sequelize[_0x92b2('0xf')],'get':function(){return moment(this['getDataValue'](_0x92b2('0xa')))[_0x92b2('0x10')](_0x92b2('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0x92b2('0xf')],'get':function(){return moment(this[_0x92b2('0x4')](_0x92b2('0xd')))[_0x92b2('0x10')](_0x92b2('0x11'))[_0x92b2('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x92b2('0x4')]('createdAt'))[_0x92b2('0x10')](_0x92b2('0x11'))[_0x92b2('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x92b2('0x13')))['format'](_0x92b2('0x11'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index f882178..15fe699 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 _0x00bb=['json','undefined','limit','offset','apply','reject','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ScreenRecording','count','then','includeAll','include','rows','catch','show','params','length','options','find','body','createdAt','closedAt','value','describe','download','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status'];(function(_0xb4f6ea,_0x1ba8b8){var _0x1a4c40=function(_0x558cce){while(--_0x558cce){_0xb4f6ea['push'](_0xb4f6ea['shift']());}};_0x1a4c40(++_0x1ba8b8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x00bb[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){_0x2896d1[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();});}};}function handleEntityNotFound(_0x3c9500,_0x8caadf){return function(_0x520e55){if(!_0x520e55){_0x3c9500['sendStatus'](0x194);}return _0x520e55;};}function handleError(_0x3785e9,_0x490380){_0x490380=_0x490380||0x1f4;return function(_0x550587){logger['error'](_0x550587[_0xb00b('0x20')]);if(_0x550587[_0xb00b('0x21')]){delete _0x550587[_0xb00b('0x21')];}_0x3785e9[_0xb00b('0x16')](_0x490380)[_0xb00b('0x22')](_0x550587);};}exports[_0xb00b('0x23')]=function(_0x15d3b9,_0x4a8d2b){var _0x22c22d={},_0x503c9c={},_0x450129={'count':0x0,'rows':[]};var _0x348165=_[_0xb00b('0x24')](db['ScreenRecording'][_0xb00b('0x25')],function(_0x280ed3){return{'name':_0x280ed3[_0xb00b('0x26')],'type':_0x280ed3[_0xb00b('0x27')][_0xb00b('0x28')]};});_0x503c9c[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_[_0xb00b('0x24')](_0x348165,_0xb00b('0x21')),['format']);_0x503c9c[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x15d3b9['query']);_0x503c9c[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x503c9c['model'],_0x503c9c[_0xb00b('0x2b')]);_0x22c22d['attributes']=_[_0xb00b('0x2e')](_0x503c9c[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x22c22d[_0xb00b('0x30')]=_0x22c22d[_0xb00b('0x30')]['length']?_0x22c22d['attributes']:_0x503c9c['model'];if(!_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x22c22d[_0xb00b('0x19')]=qs['limit'](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x22c22d[_0xb00b('0x1a')]=qs[_0xb00b('0x1a')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x1a')]);}_0x22c22d[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x15d3b9['query']['sort']);_0x22c22d[_0xb00b('0x35')]=qs['filters'](_[_0xb00b('0x36')](_0x15d3b9[_0xb00b('0x2b')],_0x503c9c[_0xb00b('0x2d')]),_0x348165);if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x22c22d[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x22c22d['where'],{'$or':_[_0xb00b('0x24')](_0x348165,function(_0x25578e){if(_0x25578e[_0xb00b('0x27')]!==_0xb00b('0x39')){var _0x2496e2={};_0x2496e2[_0x25578e[_0xb00b('0x21')]]={'$like':'%'+_0x15d3b9['query'][_0xb00b('0x37')]+'%'};return _0x2496e2;}})});}_0x22c22d=_[_0xb00b('0x38')]({},_0x22c22d,_0x15d3b9['options']);var _0x17ff34={'where':_0x22c22d[_0xb00b('0x35')]};return db[_0xb00b('0x3a')][_0xb00b('0x3b')](_0x17ff34)[_0xb00b('0x3c')](function(_0x5636b1){_0x450129[_0xb00b('0x3b')]=_0x5636b1;if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x3d')]){_0x22c22d[_0xb00b('0x3e')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x22c22d);})[_0xb00b('0x3c')](function(_0xf6ae0c){_0x450129[_0xb00b('0x3f')]=_0xf6ae0c;return _0x450129;})[_0xb00b('0x3c')](respondWithFilteredResult(_0x4a8d2b,_0x22c22d))[_0xb00b('0x40')](handleError(_0x4a8d2b,null));};exports[_0xb00b('0x41')]=function(_0x275664,_0x493841){var _0x36200d={'raw':![],'where':{'id':_0x275664[_0xb00b('0x42')]['id']}},_0x3b72c4={};_0x3b72c4[_0xb00b('0x29')]=_[_0xb00b('0x2c')](db[_0xb00b('0x3a')][_0xb00b('0x25')]);_0x3b72c4[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x275664[_0xb00b('0x2b')]);_0x3b72c4[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x3b72c4['model'],_0x3b72c4[_0xb00b('0x2b')]);_0x36200d[_0xb00b('0x30')]=_[_0xb00b('0x2e')](_0x3b72c4[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x275664[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x36200d[_0xb00b('0x30')]=_0x36200d[_0xb00b('0x30')][_0xb00b('0x43')]?_0x36200d[_0xb00b('0x30')]:_0x3b72c4[_0xb00b('0x29')];if(_0x275664['query']['includeAll']){_0x36200d['include']=[{'all':!![]}];}_0x36200d=_[_0xb00b('0x38')]({},_0x36200d,_0x275664[_0xb00b('0x44')]);return db['ScreenRecording'][_0xb00b('0x45')](_0x36200d)[_0xb00b('0x3c')](handleEntityNotFound(_0x493841,null))[_0xb00b('0x3c')](respondWithResult(_0x493841,null))[_0xb00b('0x40')](handleError(_0x493841,null));};exports['create']=function(_0x58e9cb,_0x172729){return db[_0xb00b('0x3a')]['create'](_0x58e9cb['body'],{})[_0xb00b('0x3c')](respondWithResult(_0x172729,0xc9))[_0xb00b('0x40')](handleError(_0x172729,null));};exports['update']=function(_0x2228e9,_0x47a814){if(_0x2228e9['body']['id']){delete _0x2228e9['body']['id'];}delete _0x2228e9[_0xb00b('0x46')]['duration'];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x47')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x48')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x49')];return db['ScreenRecording']['find']({'where':{'id':_0x2228e9[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](handleEntityNotFound(_0x47a814,null))['then'](saveUpdates(_0x2228e9[_0xb00b('0x46')],null))[_0xb00b('0x3c')](respondWithResult(_0x47a814,null))['catch'](handleError(_0x47a814,null));};exports[_0xb00b('0x4a')]=function(_0x10e066,_0x3b5d82){return db['ScreenRecording']['describe']()[_0xb00b('0x3c')](respondWithResult(_0x3b5d82,null))[_0xb00b('0x40')](handleError(_0x3b5d82,null));};exports[_0xb00b('0x4b')]=function(_0xde3cc1,_0x489b49,_0x380acb){var _0x3f31e5=require('../../components/encryptor');var _0x4cd9fd=![];var _0x160965={};if(_0xde3cc1['query'][_0xb00b('0x27')]&&_0xde3cc1[_0xb00b('0x2b')][_0xb00b('0x27')]===_0xb00b('0x4c')){_0x160965[_0xb00b('0x4c')]=_0xde3cc1[_0xb00b('0x42')]['id'];}else{_0x160965['id']=_0xde3cc1['params']['id'];}return db[_0xb00b('0x3a')]['find']({'where':_0x160965,'attributes':['id',_0xb00b('0x49')],'raw':!![]})[_0xb00b('0x3c')](handleEntityNotFound(_0x489b49,null))[_0xb00b('0x3c')](function(_0x5ac79e){if(_0x5ac79e){var _0x248335=path[_0xb00b('0x4d')](config[_0xb00b('0x4e')],'server/files/screen_recordings',_0x5ac79e[_0xb00b('0x49')]);var _0x309ae6=util[_0xb00b('0x4f')](_0xb00b('0x50'),_0x248335);if(fs[_0xb00b('0x51')](_0x309ae6)){_0x4cd9fd=!![];return _0x3f31e5[_0xb00b('0x52')](_0x309ae6,_0x248335,config[_0xb00b('0x53')][_0xb00b('0x54')])['then'](function(){return _0x5ac79e;});}return _0x5ac79e;}})[_0xb00b('0x3c')](function(_0x2cbe80){if(_0x2cbe80){var _0x1b4860=path['join'](config[_0xb00b('0x4e')],_0xb00b('0x55'),_0x2cbe80[_0xb00b('0x49')]);if(!fs[_0xb00b('0x51')](_0x1b4860)){throw new db[(_0xb00b('0x56'))]['ValidationError'](_0xb00b('0x57'));}if(_0x2cbe80[_0xb00b('0x58')]){return _0x489b49[_0xb00b('0x4b')](_0x1b4860,_0x2cbe80[_0xb00b('0x58')]+path['extname'](_0x1b4860),function(){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}else{return _0x489b49[_0xb00b('0x4b')](_0x1b4860,function(_0x2c93db){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}}})[_0xb00b('0x40')](function(_0x1e5ed8){if(_0x1e5ed8[_0xb00b('0x5a')]==='ScreenRecording\x20not\x20found'){_0x489b49[_0xb00b('0x16')](0x194)['send'](_0xb00b('0x5b'));}else{return handleError(_0x489b49,null);}});};exports['destroy']=function(_0x3b3272,_0x530d4a){return db[_0xb00b('0x3a')]['find']({'where':{'id':_0x3b3272[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](function(_0x3bae02){if(_['isNil'](_0x3bae02)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3bae02;})['then'](function(_0x21a53d){var _0x3126be=path[_0xb00b('0x4d')](config['root'],_0xb00b('0x55'),_0x21a53d[_0xb00b('0x49')]);logger[_0xb00b('0x5c')](_0xb00b('0x5d'),_0x3126be);if(!_[_0xb00b('0x5e')](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')]('File:\x20\x22'+_0x3126be+_0xb00b('0x5f'));fs[_0xb00b('0x60')](_0x3126be);}_0x3126be=_0x3126be+_0xb00b('0x61');if(!_['isNil'](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')](_0xb00b('0x62')+_0x3126be+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3126be);}return _0x21a53d;})['then'](function(_0x5e9677){if(!_0x5e9677)throw new InternalError();return _0x5e9677[_0xb00b('0x1e')]();})['then'](function(){_0x530d4a[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();})['catch'](handleError(_0x530d4a,null));}; \ No newline at end of file +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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_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 f07a756..4976248 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 _0xe28f=['rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','path'];(function(_0x5198fa,_0x16b951){var _0x7e841f=function(_0x4b8a1a){while(--_0x4b8a1a){_0x5198fa['push'](_0x5198fa['shift']());}};_0x7e841f(++_0x16b951);}(_0xe28f,0x1ac));var _0xfe28=function(_0x5d39b8,_0x2001fe){_0x5d39b8=_0x5d39b8-0x0;var _0x4340fb=_0xe28f[_0x5d39b8];return _0x4340fb;};'use strict';var _=require(_0xfe28('0x0'));var util=require(_0xfe28('0x1'));var logger=require(_0xfe28('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe28('0x3'));var rimraf=require(_0xfe28('0x4'));var config=require(_0xfe28('0x5'));var attributes=require(_0xfe28('0x6'));module[_0xfe28('0x7')]=function(_0x43c8f4,_0x279ce5){return _0x43c8f4[_0xfe28('0x8')](_0xfe28('0x9'),attributes,{'tableName':_0xfe28('0xa'),'paranoid':![],'indexes':[{'name':_0xfe28('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x05d8=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5c48aa,_0x1dd271){var _0xb24efa=function(_0x4812d2){while(--_0x4812d2){_0x5c48aa['push'](_0x5c48aa['shift']());}};_0xb24efa(++_0x1dd271);}(_0x05d8,0x145));var _0x805d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x05d8[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x805d('0x0'));var util=require(_0x805d('0x1'));var logger=require(_0x805d('0x2'))(_0x805d('0x3'));var moment=require(_0x805d('0x4'));var BPromise=require(_0x805d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x805d('0x6'));var rimraf=require(_0x805d('0x7'));var config=require(_0x805d('0x8'));var attributes=require('./screenRecording.attributes');module[_0x805d('0x9')]=function(_0x3495cc,_0x14cb75){return _0x3495cc[_0x805d('0xa')](_0x805d('0xb'),attributes,{'tableName':_0x805d('0xc'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x805d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 2d9404a..bfc67ac 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 _0x8408=['then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0x8408,0x184));var _0x8840=function(_0xd04b50,_0x3d635d){_0xd04b50=_0xd04b50-0x0;var _0x5de236=_0x8408[_0xd04b50];return _0x5de236;};'use strict';var _=require(_0x8840('0x0'));var util=require(_0x8840('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8840('0x2'));var db=require(_0x8840('0x3'))['db'];var utils=require(_0x8840('0x4'));var logger=require(_0x8840('0x5'))(_0x8840('0x6'));var config=require(_0x8840('0x7'));var jayson=require(_0x8840('0x8'));var client=jayson[_0x8840('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5159,_0x19de9b,_0x8ded13){return new BPromise(function(_0x1b7993,_0x485891){return client[_0x8840('0xa')](_0x2d5159,_0x8ded13)[_0x8840('0xb')](function(_0x4c0b0c){logger[_0x8840('0xc')](_0x8840('0xd'),_0x19de9b,'request\x20sent');logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x19de9b,_0x8840('0xe'),JSON[_0x8840('0xf')](_0x4c0b0c));if(_0x4c0b0c[_0x8840('0x10')]){if(_0x4c0b0c[_0x8840('0x10')][_0x8840('0x11')]===0x1f4){logger[_0x8840('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x19de9b,_0x4c0b0c[_0x8840('0x10')][_0x8840('0x12')]);return _0x485891(_0x4c0b0c[_0x8840('0x10')]['message']);}logger[_0x8840('0x10')](_0x8840('0xd'),_0x19de9b,_0x4c0b0c[_0x8840('0x10')]['message']);return _0x1b7993(_0x4c0b0c[_0x8840('0x10')][_0x8840('0x12')]);}else{logger[_0x8840('0xc')](_0x8840('0xd'),_0x19de9b,_0x8840('0xe'));_0x1b7993(_0x4c0b0c['result'][_0x8840('0x12')]);}})['catch'](function(_0x1262c7){logger[_0x8840('0x10')](_0x8840('0xd'),_0x19de9b,_0x1262c7);_0x485891(_0x1262c7);});});} \ No newline at end of file +var _0x3a3c=['rpc','../../config/environment','client','request','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x494164,_0x6b6852){var _0x4fad9f=function(_0xd47e30){while(--_0xd47e30){_0x494164['push'](_0x494164['shift']());}};_0x4fad9f(++_0x6b6852);}(_0x3a3c,0x174));var _0xc3a3=function(_0x36481f,_0x22de05){_0x36481f=_0x36481f-0x0;var _0x20c275=_0x3a3c[_0x36481f];return _0x20c275;};'use strict';var _=require(_0xc3a3('0x0'));var util=require(_0xc3a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc3a3('0x2'));var fs=require('fs');var Redis=require(_0xc3a3('0x3'));var db=require(_0xc3a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3a3('0x5'))(_0xc3a3('0x6'));var config=require(_0xc3a3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc3a3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d0c3f,_0x11fa5b,_0x4bb3d4){return new BPromise(function(_0x327c54,_0x5f0643){return client[_0xc3a3('0x9')](_0x2d0c3f,_0x4bb3d4)['then'](function(_0x416600){logger[_0xc3a3('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x11fa5b,_0xc3a3('0xb'));logger[_0xc3a3('0xc')](_0xc3a3('0xd'),_0x11fa5b,_0xc3a3('0xb'),JSON[_0xc3a3('0xe')](_0x416600));if(_0x416600[_0xc3a3('0xf')]){if(_0x416600['error'][_0xc3a3('0x10')]===0x1f4){logger[_0xc3a3('0xf')](_0xc3a3('0x11'),_0x11fa5b,_0x416600[_0xc3a3('0xf')][_0xc3a3('0x12')]);return _0x5f0643(_0x416600[_0xc3a3('0xf')][_0xc3a3('0x12')]);}logger[_0xc3a3('0xf')](_0xc3a3('0x11'),_0x11fa5b,_0x416600[_0xc3a3('0xf')][_0xc3a3('0x12')]);return _0x327c54(_0x416600['error'][_0xc3a3('0x12')]);}else{logger['info'](_0xc3a3('0x11'),_0x11fa5b,'request\x20sent');_0x327c54(_0x416600[_0xc3a3('0x13')][_0xc3a3('0x12')]);}})[_0xc3a3('0x14')](function(_0x4b9d8e){logger[_0xc3a3('0xf')](_0xc3a3('0x11'),_0x11fa5b,_0x4b9d8e);_0x5f0643(_0x4b9d8e);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d9946ed..052b3d5 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 _0xdbe9=['diskStorage','join','root','%s%s','logo','extname','originalname','post','single','file','addLogo','server/files/images/logos/','format','logologin','addPreferred','favicon','/:id/favicon','addFavicon','/:id','update','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon'];(function(_0x515699,_0x172324){var _0x3f2c37=function(_0x1a8cdf){while(--_0x1a8cdf){_0x515699['push'](_0x515699['shift']());}};_0x3f2c37(++_0x172324);}(_0xdbe9,0x13a));var _0x9dbe=function(_0x3b90e4,_0x133080){_0x3b90e4=_0x3b90e4-0x0;var _0x5d3ece=_0xdbe9[_0x3b90e4];return _0x5d3ece;};'use strict';var multer=require(_0x9dbe('0x0'));var util=require(_0x9dbe('0x1'));var path=require('path');var timeout=require(_0x9dbe('0x2'));var express=require('express');var router=express[_0x9dbe('0x3')]();var fs_extra=require(_0x9dbe('0x4'));var auth=require(_0x9dbe('0x5'));var interaction=require(_0x9dbe('0x6'));var config=require(_0x9dbe('0x7'));var controller=require(_0x9dbe('0x8'));router[_0x9dbe('0x9')]('/',auth[_0x9dbe('0xa')](),controller['index']);router[_0x9dbe('0x9')](_0x9dbe('0xb'),controller['getDate']);router[_0x9dbe('0x9')]('/:id',controller[_0x9dbe('0xc')]);router['get'](_0x9dbe('0xd'),controller[_0x9dbe('0xe')]);router[_0x9dbe('0x9')](_0x9dbe('0xf'),controller[_0x9dbe('0x10')]);router[_0x9dbe('0x9')](_0x9dbe('0x11'),controller[_0x9dbe('0x12')]);router['get'](_0x9dbe('0x13'),controller[_0x9dbe('0x14')]);router[_0x9dbe('0x9')]('/:id/favicon',controller[_0x9dbe('0x15')]);var upload=multer({'storage':multer[_0x9dbe('0x16')]({'destination':function(_0x357860,_0x5b106f,_0x501166){_0x501166(null,path[_0x9dbe('0x17')](config[_0x9dbe('0x18')],'server/files/images/logos/'));},'filename':function(_0x20bb6e,_0x2c6209,_0x5d96d2){_0x5d96d2(null,util['format'](_0x9dbe('0x19'),_0x9dbe('0x1a'),path[_0x9dbe('0x1b')](_0x2c6209[_0x9dbe('0x1c')])));}})});router[_0x9dbe('0x1d')](_0x9dbe('0xd'),upload[_0x9dbe('0x1e')](_0x9dbe('0x1f')),controller[_0x9dbe('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x135e19,_0x134c9d,_0x4d2754){_0x4d2754(null,path[_0x9dbe('0x17')](config[_0x9dbe('0x18')],_0x9dbe('0x21')));},'filename':function(_0x106cbd,_0x5d6ff8,_0x3599ff){_0x3599ff(null,util[_0x9dbe('0x22')](_0x9dbe('0x19'),_0x9dbe('0x23'),path[_0x9dbe('0x1b')](_0x5d6ff8[_0x9dbe('0x1c')])));}})});router['post'](_0x9dbe('0xf'),upload[_0x9dbe('0x1e')](_0x9dbe('0x1f')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x9dbe('0x16')]({'destination':function(_0x26da44,_0x199264,_0x544e3b){_0x544e3b(null,path['join'](config[_0x9dbe('0x18')],_0x9dbe('0x21')));},'filename':function(_0x388e18,_0x741c51,_0x96244){_0x96244(null,util[_0x9dbe('0x22')](_0x9dbe('0x19'),'preferred',path[_0x9dbe('0x1b')](_0x741c51[_0x9dbe('0x1c')])));}})});router[_0x9dbe('0x1d')](_0x9dbe('0x13'),upload[_0x9dbe('0x1e')](_0x9dbe('0x1f')),controller[_0x9dbe('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c837b,_0x2b2afb,_0x492cbe){_0x492cbe(null,path[_0x9dbe('0x17')](config[_0x9dbe('0x18')],_0x9dbe('0x21')));},'filename':function(_0x594288,_0x44e877,_0x5860af){_0x5860af(null,util[_0x9dbe('0x22')](_0x9dbe('0x19'),_0x9dbe('0x25'),path[_0x9dbe('0x1b')](_0x44e877[_0x9dbe('0x1c')])));}})});router[_0x9dbe('0x1d')](_0x9dbe('0x26'),upload[_0x9dbe('0x1e')]('file'),controller[_0x9dbe('0x27')]);router['put'](_0x9dbe('0x28'),auth[_0x9dbe('0xa')](),controller[_0x9dbe('0x29')]);module['exports']=router; \ No newline at end of file +var _0xd038=['index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','%s%s','logo','originalname','post','file','addLogo','root','format','extname','single','addLogoLogin','server/files/images/logos/','preferred','/:id/preferred','addPreferred','favicon','put','isAuthenticated','exports','path','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get'];(function(_0x1c655c,_0x43486e){var _0x3a3299=function(_0x486fbb){while(--_0x486fbb){_0x1c655c['push'](_0x1c655c['shift']());}};_0x3a3299(++_0x43486e);}(_0xd038,0x17f));var _0x8d03=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0xd038[_0x954b3a];return _0x3a313e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d03('0x0'));var timeout=require('connect-timeout');var express=require(_0x8d03('0x1'));var router=express[_0x8d03('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8d03('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8d03('0x4'));var controller=require(_0x8d03('0x5'));router[_0x8d03('0x6')]('/',auth['isAuthenticated'](),controller[_0x8d03('0x7')]);router[_0x8d03('0x6')](_0x8d03('0x8'),controller[_0x8d03('0x9')]);router['get'](_0x8d03('0xa'),controller[_0x8d03('0xb')]);router[_0x8d03('0x6')](_0x8d03('0xc'),controller['getLogo']);router[_0x8d03('0x6')](_0x8d03('0xd'),controller['getLogoLogin']);router[_0x8d03('0x6')](_0x8d03('0xe'),controller['gdpr']);router[_0x8d03('0x6')]('/:id/preferred',controller[_0x8d03('0xf')]);router['get'](_0x8d03('0x10'),controller[_0x8d03('0x11')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x4753e3,_0x3c48e6,_0x2abcca){_0x2abcca(null,path[_0x8d03('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2f082d,_0x194c4b,_0x4902e2){_0x4902e2(null,util['format'](_0x8d03('0x14'),_0x8d03('0x15'),path['extname'](_0x194c4b[_0x8d03('0x16')])));}})});router[_0x8d03('0x17')](_0x8d03('0xc'),upload['single'](_0x8d03('0x18')),controller[_0x8d03('0x19')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x30fc94,_0x27ee66,_0x141c74){_0x141c74(null,path[_0x8d03('0x13')](config[_0x8d03('0x1a')],'server/files/images/logos/'));},'filename':function(_0x5bb7e9,_0xe172ed,_0xe24c65){_0xe24c65(null,util[_0x8d03('0x1b')]('%s%s','logologin',path[_0x8d03('0x1c')](_0xe172ed[_0x8d03('0x16')])));}})});router[_0x8d03('0x17')](_0x8d03('0xd'),upload[_0x8d03('0x1d')](_0x8d03('0x18')),controller[_0x8d03('0x1e')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x1f4f13,_0x288212,_0x5653bf){_0x5653bf(null,path[_0x8d03('0x13')](config[_0x8d03('0x1a')],_0x8d03('0x1f')));},'filename':function(_0x547781,_0x494515,_0x11483a){_0x11483a(null,util[_0x8d03('0x1b')](_0x8d03('0x14'),_0x8d03('0x20'),path[_0x8d03('0x1c')](_0x494515['originalname'])));}})});router['post'](_0x8d03('0x21'),upload[_0x8d03('0x1d')](_0x8d03('0x18')),controller[_0x8d03('0x22')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x30cdd1,_0x553ab5,_0x15d715){_0x15d715(null,path[_0x8d03('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5aa8bd,_0x58abbb,_0x40403d){_0x40403d(null,util[_0x8d03('0x1b')](_0x8d03('0x14'),_0x8d03('0x23'),path['extname'](_0x58abbb[_0x8d03('0x16')])));}})});router[_0x8d03('0x17')](_0x8d03('0x10'),upload[_0x8d03('0x1d')](_0x8d03('0x18')),controller['addFavicon']);router[_0x8d03('0x24')](_0x8d03('0xa'),auth[_0x8d03('0x25')](),controller['update']);module[_0x8d03('0x26')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 516512f..bfdd893 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 _0xe868=['sequelize','exports','min_mailbox','INTEGER','STRING','BOOLEAN','alternate','UNSIGNED'];(function(_0x3f3a00,_0x210dd8){var _0x108947=function(_0x5c1b66){while(--_0x5c1b66){_0x3f3a00['push'](_0x3f3a00['shift']());}};_0x108947(++_0x210dd8);}(_0xe868,0xa0));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8e86('0x0'));module[_0x8e86('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8e86('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8e86('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8e86('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x8e86('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x8e86('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8e86('0x4')]},'turnaddr':{'type':Sequelize[_0x8e86('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8e86('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8e86('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8e86('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8e86('0x4')],'defaultValue':_0x8e86('0x6')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8e86('0x4')]},'defaultPreferred':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8e86('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8e86('0x4')]},'defaultFavicon':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8e86('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8e86('0x3')]},'transcribeRegion':{'type':Sequelize[_0x8e86('0x4')]},'sentiment':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8e86('0x3')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8e86('0x4')]},'bucket':{'type':Sequelize[_0x8e86('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x8e86('0x3')](0x2)[_0x8e86('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8e86('0x3')](0x2)[_0x8e86('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8e86('0x3')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x8e86('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8e86('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8e86('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8e86('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x8e86('0x3')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x8e86('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x10b4=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x10b4,0xba));var _0x410b=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x10b4[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x410b('0x0'));module[_0x410b('0x1')]={'min_internal':{'type':Sequelize[_0x410b('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x410b('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x410b('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x410b('0x3')],'defaultValue':_0x410b('0x4')},'logo':{'type':Sequelize[_0x410b('0x3')]},'defaultLogo':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x410b('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x410b('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x410b('0x3')]},'turnusername':{'type':Sequelize[_0x410b('0x3')]},'turnpassword':{'type':Sequelize[_0x410b('0x3')]},'pageTitle':{'type':Sequelize[_0x410b('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x410b('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x410b('0x6')},'enableEmailPreview':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x410b('0x3')],'defaultValue':_0x410b('0x7')},'chatTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x410b('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x410b('0x3')]},'defaultFavicon':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x410b('0x2')]},'transcribeRegion':{'type':Sequelize[_0x410b('0x3')]},'sentiment':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x410b('0x2')]},'sentimentRegion':{'type':Sequelize[_0x410b('0x3')]},'language':{'type':Sequelize[_0x410b('0x3')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 1f5d62b..d1f242f 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 _0x9489=['intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','catch','params','length','options','find','body','addLogo','file','filename','logo','getLogo','server/files/images/logos','getLicense','loginLogo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','preferred','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','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/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9489,0xb2));var _0x9948=function(_0x56811d,_0x2a4ac7){_0x56811d=_0x56811d-0x0;var _0x38e02c=_0x9489[_0x56811d];return _0x38e02c;};'use strict';var emlformat=require(_0x9948('0x0'));var rimraf=require(_0x9948('0x1'));var zipdir=require(_0x9948('0x2'));var jsonpatch=require(_0x9948('0x3'));var rp=require(_0x9948('0x4'));var moment=require(_0x9948('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9948('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9948('0x7'));var ejs=require(_0x9948('0x8'));var fs=require('fs');var fs_extra=require(_0x9948('0x9'));var _=require(_0x9948('0xa'));var squel=require(_0x9948('0xb'));var crypto=require(_0x9948('0xc'));var jsforce=require(_0x9948('0xd'));var deskjs=require(_0x9948('0xe'));var toCsv=require(_0x9948('0x7'));var querystring=require('querystring');var Papa=require(_0x9948('0xf'));var Redis=require(_0x9948('0x10'));var authService=require(_0x9948('0x11'));var qs=require(_0x9948('0x12'));var as=require(_0x9948('0x13'));var hardwareService=require(_0x9948('0x14'));var logger=require(_0x9948('0x15'))(_0x9948('0x16'));var utils=require(_0x9948('0x17'));var config=require(_0x9948('0x18'));var licenseUtil=require(_0x9948('0x19'));var db=require(_0x9948('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9948('0x1b')][_0x9948('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x52dc7f,_0x3217f7,_0x5e2e54,_0x132167){return new BPromise(function(_0xca0c9e,_0x532e72){var _0x470726=_0x132167||client;return _0x470726[_0x9948('0x1d')](_0x52dc7f,_0x5e2e54)[_0x9948('0x1e')](function(_0xd0b595){logger[_0x9948('0x1f')](_0x9948('0x20'),_0x3217f7,'request\x20sent');logger[_0x9948('0x21')](_0x9948('0x22'),_0x3217f7,'request\x20sent',JSON[_0x9948('0x23')](_0xd0b595));if(_0xd0b595['error']){if(_0xd0b595['error'][_0x9948('0x24')]===0x1f4){logger[_0x9948('0x25')](_0x9948('0x20'),_0x3217f7,_0xd0b595[_0x9948('0x25')][_0x9948('0x26')]);return _0x532e72(_0xd0b595[_0x9948('0x25')][_0x9948('0x26')]);}logger[_0x9948('0x25')](_0x9948('0x20'),_0x3217f7,_0xd0b595['error'][_0x9948('0x26')]);return _0xca0c9e(_0xd0b595[_0x9948('0x25')][_0x9948('0x26')]);}else{logger[_0x9948('0x1f')](_0x9948('0x20'),_0x3217f7,_0x9948('0x27'));_0xca0c9e(_0xd0b595['result'][_0x9948('0x26')]);}})['catch'](function(_0x1bd8e8){logger[_0x9948('0x25')](_0x9948('0x20'),_0x3217f7,_0x1bd8e8);_0x532e72(_0x1bd8e8);});});}function respondWithStatusCode(_0x4242c4,_0x3aa4c9){_0x3aa4c9=_0x3aa4c9||0xcc;return function(_0x327816){if(_0x327816){return _0x4242c4[_0x9948('0x28')](_0x3aa4c9);}return _0x4242c4['status'](_0x3aa4c9)[_0x9948('0x29')]();};}function respondWithResult(_0x166440,_0x3cfb54){_0x3cfb54=_0x3cfb54||0xc8;return function(_0x262436){if(_0x262436){return _0x166440[_0x9948('0x2a')](_0x3cfb54)[_0x9948('0x2b')](_0x262436);}};}function respondWithFilteredResult(_0x1509fd,_0x5c74fc){return function(_0x56afbe){if(_0x56afbe){var _0x3e4621=typeof _0x5c74fc[_0x9948('0x2c')]===_0x9948('0x2d')&&typeof _0x5c74fc[_0x9948('0x2e')]==='undefined';var _0x47c13a=_0x56afbe['count'];var _0x35cd34=_0x3e4621?0x0:_0x5c74fc['offset'];var _0x16cfc8=_0x3e4621?_0x56afbe[_0x9948('0x2f')]:_0x5c74fc['offset']+_0x5c74fc[_0x9948('0x2e')];var _0x5bb2b7;if(_0x16cfc8>=_0x47c13a){_0x16cfc8=_0x47c13a;_0x5bb2b7=0xc8;}else{_0x5bb2b7=0xce;}_0x1509fd[_0x9948('0x2a')](_0x5bb2b7);return _0x1509fd[_0x9948('0x30')]('Content-Range',_0x35cd34+'-'+_0x16cfc8+'/'+_0x47c13a)[_0x9948('0x2b')](_0x56afbe);}return null;};}function patchUpdates(_0x5e93f0){return function(_0x21b4bf){try{jsonpatch[_0x9948('0x31')](_0x21b4bf,_0x5e93f0,!![]);}catch(_0x478a98){return BPromise[_0x9948('0x32')](_0x478a98);}return _0x21b4bf[_0x9948('0x33')]();};}function saveUpdates(_0x41eb76,_0x3b4fe6){return function(_0x3f79e5){if(_0x3f79e5){return _0x3f79e5[_0x9948('0x34')](_0x41eb76)['then'](function(_0x1016e3){return _0x1016e3;});}return null;};}function removeEntity(_0x249188,_0x2dd60c){return function(_0x4e1ab7){if(_0x4e1ab7){return _0x4e1ab7[_0x9948('0x35')]()[_0x9948('0x1e')](function(){_0x249188[_0x9948('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30b25a,_0x16fb85){return function(_0x134038){if(!_0x134038){_0x30b25a[_0x9948('0x28')](0x194);}return _0x134038;};}function handleError(_0x26cbf6,_0x1317da){_0x1317da=_0x1317da||0x1f4;return function(_0x902b55){logger['error'](_0x902b55[_0x9948('0x36')]);if(_0x902b55['name']){delete _0x902b55[_0x9948('0x37')];}_0x26cbf6[_0x9948('0x2a')](_0x1317da)[_0x9948('0x38')](_0x902b55);};}exports[_0x9948('0x39')]=function(_0x5464cb,_0x532a78){var _0x5ac738={},_0x14a0cd={},_0x3c8f57={'count':0x0,'rows':[]};var _0x3d0a07=_[_0x9948('0x3a')](db[_0x9948('0x3b')][_0x9948('0x3c')],function(_0x38401a){return{'name':_0x38401a[_0x9948('0x3d')],'type':_0x38401a[_0x9948('0x3e')][_0x9948('0x3f')]};});_0x14a0cd[_0x9948('0x40')]=_[_0x9948('0x3a')](_0x3d0a07,_0x9948('0x37'));_0x14a0cd[_0x9948('0x41')]=_[_0x9948('0x42')](_0x5464cb[_0x9948('0x41')]);_0x14a0cd[_0x9948('0x43')]=_[_0x9948('0x44')](_0x14a0cd[_0x9948('0x40')],_0x14a0cd[_0x9948('0x41')]);_0x5ac738['attributes']=_[_0x9948('0x44')](_0x14a0cd[_0x9948('0x40')],qs['fields'](_0x5464cb[_0x9948('0x41')][_0x9948('0x45')]));_0x5ac738[_0x9948('0x46')]=_0x5ac738[_0x9948('0x46')]['length']?_0x5ac738[_0x9948('0x46')]:_0x14a0cd[_0x9948('0x40')];if(!_0x5464cb[_0x9948('0x41')][_0x9948('0x47')](_0x9948('0x48'))){_0x5ac738[_0x9948('0x2e')]=qs['limit'](_0x5464cb[_0x9948('0x41')]['limit']);_0x5ac738['offset']=qs[_0x9948('0x2c')](_0x5464cb['query'][_0x9948('0x2c')]);}_0x5ac738['order']=qs[_0x9948('0x49')](_0x5464cb[_0x9948('0x41')]['sort']);_0x5ac738[_0x9948('0x4a')]=qs[_0x9948('0x43')](_[_0x9948('0x4b')](_0x5464cb[_0x9948('0x41')],_0x14a0cd[_0x9948('0x43')]),_0x3d0a07);if(_0x5464cb[_0x9948('0x41')][_0x9948('0x4c')]){_0x5ac738[_0x9948('0x4a')]=_[_0x9948('0x4d')](_0x5ac738[_0x9948('0x4a')],{'$or':_['map'](_0x3d0a07,function(_0x105eff){if(_0x105eff['type']!=='VIRTUAL'){var _0x570ac7={};_0x570ac7[_0x105eff[_0x9948('0x37')]]={'$like':'%'+_0x5464cb[_0x9948('0x41')][_0x9948('0x4c')]+'%'};return _0x570ac7;}})});}_0x5ac738=_['merge']({},_0x5ac738,_0x5464cb['options']);var _0x3b4f18={'where':_0x5ac738[_0x9948('0x4a')]};return db[_0x9948('0x3b')][_0x9948('0x2f')](_0x3b4f18)[_0x9948('0x1e')](function(_0x4d0bdb){_0x3c8f57[_0x9948('0x2f')]=_0x4d0bdb;if(_0x5464cb[_0x9948('0x41')][_0x9948('0x4e')]){_0x5ac738[_0x9948('0x4f')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x5ac738);})[_0x9948('0x1e')](function(_0x362e54){_0x3c8f57['rows']=_0x362e54;return _0x3c8f57;})['then'](respondWithFilteredResult(_0x532a78,_0x5ac738))[_0x9948('0x50')](handleError(_0x532a78,null));};exports['show']=function(_0x367ef,_0xec09c9){var _0x4e4fdd={'raw':![],'where':{'id':_0x367ef[_0x9948('0x51')]['id']}},_0x179681={};_0x179681[_0x9948('0x40')]=_['keys'](db['Setting'][_0x9948('0x3c')]);_0x179681[_0x9948('0x41')]=_[_0x9948('0x42')](_0x367ef[_0x9948('0x41')]);_0x179681[_0x9948('0x43')]=_[_0x9948('0x44')](_0x179681[_0x9948('0x40')],_0x179681[_0x9948('0x41')]);_0x4e4fdd[_0x9948('0x46')]=_[_0x9948('0x44')](_0x179681[_0x9948('0x40')],qs['fields'](_0x367ef[_0x9948('0x41')][_0x9948('0x45')]));_0x4e4fdd[_0x9948('0x46')]=_0x4e4fdd[_0x9948('0x46')][_0x9948('0x52')]?_0x4e4fdd['attributes']:_0x179681[_0x9948('0x40')];if(_0x367ef['query'][_0x9948('0x4e')]){_0x4e4fdd[_0x9948('0x4f')]=[{'all':!![]}];}_0x4e4fdd=_[_0x9948('0x4d')]({},_0x4e4fdd,_0x367ef[_0x9948('0x53')]);return db[_0x9948('0x3b')][_0x9948('0x54')](_0x4e4fdd)[_0x9948('0x1e')](handleEntityNotFound(_0xec09c9,null))[_0x9948('0x1e')](respondWithResult(_0xec09c9,null))[_0x9948('0x50')](handleError(_0xec09c9,null));};exports['update']=function(_0x489fd4,_0x4ae030){if(_0x489fd4[_0x9948('0x55')]['id']){delete _0x489fd4[_0x9948('0x55')]['id'];}return db['Setting'][_0x9948('0x54')]({'where':{'id':_0x489fd4['params']['id']}})[_0x9948('0x1e')](handleEntityNotFound(_0x4ae030,null))['then'](saveUpdates(_0x489fd4[_0x9948('0x55')],null))['then'](respondWithResult(_0x4ae030,null))['catch'](handleError(_0x4ae030,null));};exports[_0x9948('0x56')]=function(_0x4e73c5,_0x2b7691,_0x5afbb0){if(_0x4e73c5['file']&&_0x4e73c5[_0x9948('0x57')][_0x9948('0x58')]){_0x4e73c5['body'][_0x9948('0x59')]=_0x4e73c5[_0x9948('0x57')][_0x9948('0x58')];}return db[_0x9948('0x3b')][_0x9948('0x54')]({'where':{'id':_0x4e73c5[_0x9948('0x51')]['id']}})[_0x9948('0x1e')](handleEntityNotFound(_0x2b7691,null))[_0x9948('0x1e')](saveUpdates(_0x4e73c5[_0x9948('0x55')],null))[_0x9948('0x1e')](respondWithResult(_0x2b7691,null))['catch'](handleError(_0x2b7691,null));};exports['addLogoLogin']=function(_0x27a874,_0x5dc745,_0x359b17){if(_0x27a874[_0x9948('0x57')]&&_0x27a874[_0x9948('0x57')][_0x9948('0x58')]){_0x27a874[_0x9948('0x55')]['loginLogo']=_0x27a874[_0x9948('0x57')]['filename'];}return db[_0x9948('0x3b')]['find']({'where':{'id':_0x27a874[_0x9948('0x51')]['id']}})[_0x9948('0x1e')](handleEntityNotFound(_0x5dc745,null))[_0x9948('0x1e')](saveUpdates(_0x27a874['body'],null))[_0x9948('0x1e')](respondWithResult(_0x5dc745,null))[_0x9948('0x50')](handleError(_0x5dc745,null));};var utilLicense=require(_0x9948('0x19'));exports[_0x9948('0x5a')]=function(_0x326f03,_0x3c56f3,_0x26d6e4){var _0x1fba3b=_0x9948('0x5b');var _0x17a436={'custom':![]};return utilLicense[_0x9948('0x5c')]()[_0x9948('0x1e')](function(_0x526069){if(_0x526069){_0x17a436=_0x526069;}return db[_0x9948('0x3b')][_0x9948('0x54')]({'where':{'id':_0x326f03[_0x9948('0x51')]['id']},'attributes':[_0x9948('0x59'),_0x9948('0x5d'),'preferred',_0x9948('0x5e'),_0x9948('0x5f'),_0x9948('0x60'),_0x9948('0x61'),'defaultFavicon'],'raw':!![]});})[_0x9948('0x1e')](handleEntityNotFound(_0x3c56f3,null))[_0x9948('0x1e')](function(_0x61e41e){if(_0x61e41e){var _0x3025eb=_0x61e41e[_0x9948('0x59')]&&fs[_0x9948('0x62')](path['join'](config[_0x9948('0x63')],_0x1fba3b,_[_0x9948('0x64')](_0x61e41e[_0x9948('0x59')])))?path[_0x9948('0x65')](config[_0x9948('0x63')],_0x1fba3b,_[_0x9948('0x64')](_0x61e41e[_0x9948('0x59')])):path[_0x9948('0x65')](config['root'],_0x1fba3b,_[_0x9948('0x64')](_0x9948('0x66')));var _0x71ea6c=_0x9948('0x67')+_[_0x9948('0x68')](_0x9948('0x59'));if(_0x61e41e[_0x71ea6c]||!_0x17a436[_0x9948('0x69')]){_0x3025eb=path[_0x9948('0x65')](config[_0x9948('0x63')],_0x1fba3b,_[_0x9948('0x64')](_0x9948('0x66')));}if(!fs[_0x9948('0x62')](_0x3025eb)){throw new db[(_0x9948('0x6a'))][(_0x9948('0x6b'))](_['upperFirst'](_0x9948('0x59'))+_0x9948('0x6c'));}return _0x3c56f3[_0x9948('0x6d')](_0x3025eb);}})[_0x9948('0x50')](handleError(_0x3c56f3,null));};var utilLicense=require('../../config/license/util');exports[_0x9948('0x6e')]=function(_0x386d06,_0x17a42b,_0x11ac72){var _0x4c2b15='server/files/images/logos';var _0x27eeaf={'custom':![]};return utilLicense[_0x9948('0x5c')]()['then'](function(_0x524f80){if(_0x524f80){_0x27eeaf=_0x524f80;}return db[_0x9948('0x3b')]['find']({'where':{'id':_0x386d06[_0x9948('0x51')]['id']},'attributes':[_0x9948('0x59'),_0x9948('0x5d'),_0x9948('0x6f'),_0x9948('0x5e'),_0x9948('0x5f'),'defaultLoginLogo',_0x9948('0x61'),_0x9948('0x70')],'raw':!![]});})[_0x9948('0x1e')](handleEntityNotFound(_0x17a42b,null))[_0x9948('0x1e')](function(_0x53314d){if(_0x53314d){var _0x20bca1=_0x53314d[_0x9948('0x5d')]&&fs[_0x9948('0x62')](path[_0x9948('0x65')](config['root'],_0x4c2b15,_[_0x9948('0x64')](_0x53314d['loginLogo'])))?path[_0x9948('0x65')](config['root'],_0x4c2b15,_[_0x9948('0x64')](_0x53314d[_0x9948('0x5d')])):path['join'](config[_0x9948('0x63')],_0x4c2b15,_[_0x9948('0x64')](_0x9948('0x71')));var _0x2d8eac=_0x9948('0x67')+_['upperFirst']('loginLogo');if(_0x53314d[_0x2d8eac]||!_0x27eeaf[_0x9948('0x69')]){_0x20bca1=path[_0x9948('0x65')](config[_0x9948('0x63')],_0x4c2b15,_[_0x9948('0x64')](_0x9948('0x71')));}if(!fs[_0x9948('0x62')](_0x20bca1)){throw new db['Sequelize']['ValidationError'](_[_0x9948('0x68')](_0x9948('0x5d'))+'\x20not\x20found');}return _0x17a42b['download'](_0x20bca1);}})['catch'](handleError(_0x17a42b,null));};exports[_0x9948('0x72')]=function(_0x551d7f,_0x557aa8){return db[_0x9948('0x3b')][_0x9948('0x54')]({'where':{'id':_0x551d7f['params']['id']},'attributes':[_0x9948('0x73')]})[_0x9948('0x1e')](respondWithResult(_0x557aa8,null))[_0x9948('0x50')](handleError(_0x557aa8,null));};exports[_0x9948('0x74')]=function(_0x33a8d7,_0x18a4a6,_0x170043){if(_0x33a8d7[_0x9948('0x57')]&&_0x33a8d7[_0x9948('0x57')][_0x9948('0x58')]){_0x33a8d7[_0x9948('0x55')][_0x9948('0x6f')]=_0x33a8d7[_0x9948('0x57')][_0x9948('0x58')];}return db[_0x9948('0x3b')][_0x9948('0x54')]({'where':{'id':_0x33a8d7[_0x9948('0x51')]['id']}})[_0x9948('0x1e')](handleEntityNotFound(_0x18a4a6,null))['then'](saveUpdates(_0x33a8d7['body'],null))[_0x9948('0x1e')](respondWithResult(_0x18a4a6,null))[_0x9948('0x50')](handleError(_0x18a4a6,null));};var utilLicense=require(_0x9948('0x19'));exports['getPreferred']=function(_0x5adb4c,_0x5d3692,_0x5cb87c){var _0x1f4f05='server/files/images/logos';var _0x97a33a={'custom':![]};return utilLicense['getLicense']()[_0x9948('0x1e')](function(_0x451d18){if(_0x451d18){_0x97a33a=_0x451d18;}return db[_0x9948('0x3b')][_0x9948('0x54')]({'where':{'id':_0x5adb4c['params']['id']},'attributes':['logo',_0x9948('0x5d'),_0x9948('0x6f'),_0x9948('0x5e'),_0x9948('0x5f'),_0x9948('0x60'),_0x9948('0x61'),_0x9948('0x70')],'raw':!![]});})[_0x9948('0x1e')](handleEntityNotFound(_0x5d3692,null))[_0x9948('0x1e')](function(_0x4da767){if(_0x4da767){var _0x5800d2=_0x4da767['preferred']&&fs[_0x9948('0x62')](path[_0x9948('0x65')](config[_0x9948('0x63')],_0x1f4f05,_[_0x9948('0x64')](_0x4da767['preferred'])))?path['join'](config[_0x9948('0x63')],_0x1f4f05,_[_0x9948('0x64')](_0x4da767[_0x9948('0x6f')])):path['join'](config[_0x9948('0x63')],_0x1f4f05,_[_0x9948('0x64')]('default_preferred.png'));var _0x47d839=_0x9948('0x67')+_[_0x9948('0x68')](_0x9948('0x6f'));if(_0x4da767[_0x47d839]||!_0x97a33a[_0x9948('0x69')]||!_0x97a33a[_0x9948('0x6f')]){_0x5800d2=path[_0x9948('0x65')](config[_0x9948('0x63')],_0x1f4f05,_[_0x9948('0x64')]('default_preferred.png'));}if(!fs[_0x9948('0x62')](_0x5800d2)){throw new db[(_0x9948('0x6a'))][(_0x9948('0x6b'))](_[_0x9948('0x68')]('preferred')+'\x20not\x20found');}return _0x5d3692[_0x9948('0x6d')](_0x5800d2);}})[_0x9948('0x50')](handleError(_0x5d3692,null));};exports[_0x9948('0x75')]=function(_0x6632f6,_0x11b396,_0x3441b5){if(_0x6632f6['file']&&_0x6632f6[_0x9948('0x57')][_0x9948('0x58')]){_0x6632f6[_0x9948('0x55')][_0x9948('0x5e')]=_0x6632f6[_0x9948('0x57')][_0x9948('0x58')];}return db[_0x9948('0x3b')][_0x9948('0x54')]({'where':{'id':_0x6632f6[_0x9948('0x51')]['id']}})[_0x9948('0x1e')](handleEntityNotFound(_0x11b396,null))[_0x9948('0x1e')](saveUpdates(_0x6632f6[_0x9948('0x55')],null))['then'](respondWithResult(_0x11b396,null))[_0x9948('0x50')](handleError(_0x11b396,null));};var utilLicense=require(_0x9948('0x19'));exports[_0x9948('0x76')]=function(_0x4e0c97,_0x5b4998,_0x1b5e3b){var _0x43e9e2=_0x9948('0x5b');var _0x25ce26={'custom':![]};return utilLicense[_0x9948('0x5c')]()[_0x9948('0x1e')](function(_0x24d35f){if(_0x24d35f){_0x25ce26=_0x24d35f;}return db[_0x9948('0x3b')]['find']({'where':{'id':_0x4e0c97[_0x9948('0x51')]['id']},'attributes':[_0x9948('0x59'),'loginLogo',_0x9948('0x6f'),'favicon',_0x9948('0x5f'),'defaultLoginLogo',_0x9948('0x61'),_0x9948('0x70')],'raw':!![]});})[_0x9948('0x1e')](handleEntityNotFound(_0x5b4998,null))[_0x9948('0x1e')](function(_0x327293){if(_0x327293){var _0x56c81a=_0x327293[_0x9948('0x5e')]&&fs[_0x9948('0x62')](path['join'](config[_0x9948('0x63')],_0x43e9e2,_[_0x9948('0x64')](_0x327293['favicon'])))?path[_0x9948('0x65')](config[_0x9948('0x63')],_0x43e9e2,_[_0x9948('0x64')](_0x327293['favicon'])):path[_0x9948('0x65')](config[_0x9948('0x63')],_0x43e9e2,_[_0x9948('0x64')](_0x9948('0x77')));var _0x1269c5='default'+_[_0x9948('0x68')](_0x9948('0x5e'));if(_0x327293[_0x1269c5]||!_0x25ce26[_0x9948('0x69')]){_0x56c81a=path[_0x9948('0x65')](config[_0x9948('0x63')],_0x43e9e2,_['toLower'](_0x9948('0x77')));}if(!fs[_0x9948('0x62')](_0x56c81a)){throw new db[(_0x9948('0x6a'))][(_0x9948('0x6b'))](_['upperFirst']('favicon')+_0x9948('0x6c'));}return _0x5b4998['download'](_0x56c81a);}})['catch'](handleError(_0x5b4998,null));};exports['getDate']=function(_0x4c8707,_0x557fe8){var _0x337665={'offset':moment()[_0x9948('0x78')]()};_0x337665[_0x9948('0x79')]=moment()[_0x9948('0x78')](_0x337665[_0x9948('0x2c')])['format'](_0x9948('0x7a'));return _0x557fe8[_0x9948('0x2a')](0xc8)[_0x9948('0x38')](_0x337665);}; \ No newline at end of file +var _0x8ce3=['destroy','then','stack','name','status','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','include','catch','show','params','includeAll','options','body','find','addLogo','file','filename','logo','loginLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','favicon','defaultLoginLogo','default_loginLogo.svg','\x20not\x20found','gdpr','addPreferred','default_preferred.png','addFavicon','default_favicon.ico','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x21f995,_0x4460e6){var _0x40db0f=function(_0x37b9c1){while(--_0x37b9c1){_0x21f995['push'](_0x21f995['shift']());}};_0x40db0f(++_0x4460e6);}(_0x8ce3,0xc3));var _0x38ce=function(_0x4a6339,_0x30cd3a){_0x4a6339=_0x4a6339-0x0;var _0x5e9a19=_0x8ce3[_0x4a6339];return _0x5e9a19;};'use strict';var emlformat=require(_0x38ce('0x0'));var rimraf=require(_0x38ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ce('0x2'));var rp=require(_0x38ce('0x3'));var moment=require(_0x38ce('0x4'));var BPromise=require(_0x38ce('0x5'));var Mustache=require(_0x38ce('0x6'));var util=require(_0x38ce('0x7'));var path=require(_0x38ce('0x8'));var sox=require(_0x38ce('0x9'));var csv=require('to-csv');var ejs=require(_0x38ce('0xa'));var fs=require('fs');var fs_extra=require(_0x38ce('0xb'));var _=require('lodash');var squel=require(_0x38ce('0xc'));var crypto=require(_0x38ce('0xd'));var jsforce=require(_0x38ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38ce('0xf'));var querystring=require('querystring');var Papa=require(_0x38ce('0x10'));var Redis=require('ioredis');var authService=require(_0x38ce('0x11'));var qs=require(_0x38ce('0x12'));var as=require(_0x38ce('0x13'));var hardwareService=require(_0x38ce('0x14'));var logger=require(_0x38ce('0x15'))(_0x38ce('0x16'));var utils=require(_0x38ce('0x17'));var config=require(_0x38ce('0x18'));var licenseUtil=require(_0x38ce('0x19'));var db=require(_0x38ce('0x1a'))['db'];var jayson=require(_0x38ce('0x1b'));var client=jayson[_0x38ce('0x1c')][_0x38ce('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x263d6f,_0x2e661b,_0x2cf066,_0x56a09f){return new BPromise(function(_0x48ba7c,_0x3c4d7f){var _0x2aabd8=_0x56a09f||client;return _0x2aabd8[_0x38ce('0x1e')](_0x263d6f,_0x2cf066)['then'](function(_0x2f3b99){logger['info'](_0x38ce('0x1f'),_0x2e661b,_0x38ce('0x20'));logger['debug'](_0x38ce('0x21'),_0x2e661b,_0x38ce('0x20'),JSON[_0x38ce('0x22')](_0x2f3b99));if(_0x2f3b99['error']){if(_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x24')]===0x1f4){logger[_0x38ce('0x23')](_0x38ce('0x1f'),_0x2e661b,_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x25')]);return _0x3c4d7f(_0x2f3b99[_0x38ce('0x23')]['message']);}logger[_0x38ce('0x23')](_0x38ce('0x1f'),_0x2e661b,_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x25')]);return _0x48ba7c(_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x25')]);}else{logger[_0x38ce('0x26')](_0x38ce('0x1f'),_0x2e661b,_0x38ce('0x20'));_0x48ba7c(_0x2f3b99[_0x38ce('0x27')][_0x38ce('0x25')]);}})['catch'](function(_0x1cc10b){logger[_0x38ce('0x23')](_0x38ce('0x1f'),_0x2e661b,_0x1cc10b);_0x3c4d7f(_0x1cc10b);});});}function respondWithStatusCode(_0xcf5d9e,_0x4a56b0){_0x4a56b0=_0x4a56b0||0xcc;return function(_0x2c85e6){if(_0x2c85e6){return _0xcf5d9e[_0x38ce('0x28')](_0x4a56b0);}return _0xcf5d9e['status'](_0x4a56b0)[_0x38ce('0x29')]();};}function respondWithResult(_0x38cf83,_0x43b479){_0x43b479=_0x43b479||0xc8;return function(_0x5b330c){if(_0x5b330c){return _0x38cf83['status'](_0x43b479)[_0x38ce('0x2a')](_0x5b330c);}};}function respondWithFilteredResult(_0x28ab4c,_0x142d72){return function(_0x21d4e7){if(_0x21d4e7){var _0x264cf0=typeof _0x142d72[_0x38ce('0x2b')]===_0x38ce('0x2c')&&typeof _0x142d72[_0x38ce('0x2d')]===_0x38ce('0x2c');var _0x4649be=_0x21d4e7[_0x38ce('0x2e')];var _0x381703=_0x264cf0?0x0:_0x142d72['offset'];var _0x1212dd=_0x264cf0?_0x21d4e7[_0x38ce('0x2e')]:_0x142d72['offset']+_0x142d72[_0x38ce('0x2d')];var _0x3cbead;if(_0x1212dd>=_0x4649be){_0x1212dd=_0x4649be;_0x3cbead=0xc8;}else{_0x3cbead=0xce;}_0x28ab4c['status'](_0x3cbead);return _0x28ab4c[_0x38ce('0x2f')](_0x38ce('0x30'),_0x381703+'-'+_0x1212dd+'/'+_0x4649be)['json'](_0x21d4e7);}return null;};}function patchUpdates(_0x28d775){return function(_0x53f2c9){try{jsonpatch[_0x38ce('0x31')](_0x53f2c9,_0x28d775,!![]);}catch(_0x336f8c){return BPromise[_0x38ce('0x32')](_0x336f8c);}return _0x53f2c9[_0x38ce('0x33')]();};}function saveUpdates(_0x444b93,_0x23019f){return function(_0x34262a){if(_0x34262a){return _0x34262a[_0x38ce('0x34')](_0x444b93)['then'](function(_0x4e5bf6){return _0x4e5bf6;});}return null;};}function removeEntity(_0x469b65,_0xc4dd0f){return function(_0x3cba20){if(_0x3cba20){return _0x3cba20[_0x38ce('0x35')]()[_0x38ce('0x36')](function(){_0x469b65['status'](0xcc)[_0x38ce('0x29')]();});}};}function handleEntityNotFound(_0x12c68b,_0x37f696){return function(_0xb19f75){if(!_0xb19f75){_0x12c68b[_0x38ce('0x28')](0x194);}return _0xb19f75;};}function handleError(_0x231268,_0x3d7f64){_0x3d7f64=_0x3d7f64||0x1f4;return function(_0x54050a){logger[_0x38ce('0x23')](_0x54050a[_0x38ce('0x37')]);if(_0x54050a['name']){delete _0x54050a[_0x38ce('0x38')];}_0x231268[_0x38ce('0x39')](_0x3d7f64)[_0x38ce('0x3a')](_0x54050a);};}exports[_0x38ce('0x3b')]=function(_0x1eb47e,_0x3d6838){var _0x2f9173={},_0xa3ccce={},_0x4b779b={'count':0x0,'rows':[]};var _0x3d2c8c=_[_0x38ce('0x3c')](db[_0x38ce('0x3d')][_0x38ce('0x3e')],function(_0x49ff68){return{'name':_0x49ff68[_0x38ce('0x3f')],'type':_0x49ff68['type'][_0x38ce('0x40')]};});_0xa3ccce[_0x38ce('0x41')]=_[_0x38ce('0x3c')](_0x3d2c8c,_0x38ce('0x38'));_0xa3ccce[_0x38ce('0x42')]=_[_0x38ce('0x43')](_0x1eb47e['query']);_0xa3ccce[_0x38ce('0x44')]=_['intersection'](_0xa3ccce[_0x38ce('0x41')],_0xa3ccce[_0x38ce('0x42')]);_0x2f9173[_0x38ce('0x45')]=_[_0x38ce('0x46')](_0xa3ccce[_0x38ce('0x41')],qs[_0x38ce('0x47')](_0x1eb47e['query'][_0x38ce('0x47')]));_0x2f9173[_0x38ce('0x45')]=_0x2f9173[_0x38ce('0x45')][_0x38ce('0x48')]?_0x2f9173[_0x38ce('0x45')]:_0xa3ccce[_0x38ce('0x41')];if(!_0x1eb47e['query']['hasOwnProperty'](_0x38ce('0x49'))){_0x2f9173[_0x38ce('0x2d')]=qs[_0x38ce('0x2d')](_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x2d')]);_0x2f9173[_0x38ce('0x2b')]=qs[_0x38ce('0x2b')](_0x1eb47e['query'][_0x38ce('0x2b')]);}_0x2f9173[_0x38ce('0x4a')]=qs['sort'](_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x4b')]);_0x2f9173[_0x38ce('0x4c')]=qs['filters'](_[_0x38ce('0x4d')](_0x1eb47e[_0x38ce('0x42')],_0xa3ccce[_0x38ce('0x44')]),_0x3d2c8c);if(_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x4e')]){_0x2f9173[_0x38ce('0x4c')]=_['merge'](_0x2f9173[_0x38ce('0x4c')],{'$or':_[_0x38ce('0x3c')](_0x3d2c8c,function(_0x33d2e1){if(_0x33d2e1[_0x38ce('0x4f')]!==_0x38ce('0x50')){var _0x6cf4d9={};_0x6cf4d9[_0x33d2e1['name']]={'$like':'%'+_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x4e')]+'%'};return _0x6cf4d9;}})});}_0x2f9173=_['merge']({},_0x2f9173,_0x1eb47e['options']);var _0x5833a2={'where':_0x2f9173[_0x38ce('0x4c')]};return db[_0x38ce('0x3d')]['count'](_0x5833a2)['then'](function(_0x2e8d94){_0x4b779b['count']=_0x2e8d94;if(_0x1eb47e[_0x38ce('0x42')]['includeAll']){_0x2f9173[_0x38ce('0x51')]=[{'all':!![]}];}return db[_0x38ce('0x3d')]['findAll'](_0x2f9173);})[_0x38ce('0x36')](function(_0x17a8cf){_0x4b779b['rows']=_0x17a8cf;return _0x4b779b;})[_0x38ce('0x36')](respondWithFilteredResult(_0x3d6838,_0x2f9173))[_0x38ce('0x52')](handleError(_0x3d6838,null));};exports[_0x38ce('0x53')]=function(_0x5ce80e,_0x98e046){var _0x25a299={'raw':![],'where':{'id':_0x5ce80e[_0x38ce('0x54')]['id']}},_0x58cc6f={};_0x58cc6f[_0x38ce('0x41')]=_['keys'](db[_0x38ce('0x3d')][_0x38ce('0x3e')]);_0x58cc6f[_0x38ce('0x42')]=_[_0x38ce('0x43')](_0x5ce80e[_0x38ce('0x42')]);_0x58cc6f[_0x38ce('0x44')]=_[_0x38ce('0x46')](_0x58cc6f['model'],_0x58cc6f[_0x38ce('0x42')]);_0x25a299[_0x38ce('0x45')]=_[_0x38ce('0x46')](_0x58cc6f[_0x38ce('0x41')],qs[_0x38ce('0x47')](_0x5ce80e[_0x38ce('0x42')]['fields']));_0x25a299['attributes']=_0x25a299[_0x38ce('0x45')][_0x38ce('0x48')]?_0x25a299[_0x38ce('0x45')]:_0x58cc6f[_0x38ce('0x41')];if(_0x5ce80e[_0x38ce('0x42')][_0x38ce('0x55')]){_0x25a299['include']=[{'all':!![]}];}_0x25a299=_['merge']({},_0x25a299,_0x5ce80e[_0x38ce('0x56')]);return db['Setting']['find'](_0x25a299)[_0x38ce('0x36')](handleEntityNotFound(_0x98e046,null))[_0x38ce('0x36')](respondWithResult(_0x98e046,null))[_0x38ce('0x52')](handleError(_0x98e046,null));};exports[_0x38ce('0x34')]=function(_0xd031c0,_0x56b466){if(_0xd031c0[_0x38ce('0x57')]['id']){delete _0xd031c0[_0x38ce('0x57')]['id'];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0xd031c0[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x56b466,null))[_0x38ce('0x36')](saveUpdates(_0xd031c0[_0x38ce('0x57')],null))[_0x38ce('0x36')](respondWithResult(_0x56b466,null))[_0x38ce('0x52')](handleError(_0x56b466,null));};exports[_0x38ce('0x59')]=function(_0x56d63e,_0x5d1df1,_0x40564c){if(_0x56d63e[_0x38ce('0x5a')]&&_0x56d63e[_0x38ce('0x5a')][_0x38ce('0x5b')]){_0x56d63e['body'][_0x38ce('0x5c')]=_0x56d63e[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x56d63e[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x5d1df1,null))['then'](saveUpdates(_0x56d63e[_0x38ce('0x57')],null))[_0x38ce('0x36')](respondWithResult(_0x5d1df1,null))['catch'](handleError(_0x5d1df1,null));};exports['addLogoLogin']=function(_0x201294,_0x3ce5c0,_0x158532){if(_0x201294['file']&&_0x201294['file'][_0x38ce('0x5b')]){_0x201294['body'][_0x38ce('0x5d')]=_0x201294[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')]['find']({'where':{'id':_0x201294[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x3ce5c0,null))[_0x38ce('0x36')](saveUpdates(_0x201294['body'],null))[_0x38ce('0x36')](respondWithResult(_0x3ce5c0,null))[_0x38ce('0x52')](handleError(_0x3ce5c0,null));};var utilLicense=require(_0x38ce('0x19'));exports['getLogo']=function(_0x389b23,_0x50dcfb,_0xaabec0){var _0x51adaa=_0x38ce('0x5e');var _0x167ec1={'custom':![]};return utilLicense[_0x38ce('0x5f')]()[_0x38ce('0x36')](function(_0x587e62){if(_0x587e62){_0x167ec1=_0x587e62;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x389b23[_0x38ce('0x54')]['id']},'attributes':[_0x38ce('0x5c'),_0x38ce('0x5d'),_0x38ce('0x60'),'favicon',_0x38ce('0x61'),'defaultLoginLogo',_0x38ce('0x62'),_0x38ce('0x63')],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x50dcfb,null))[_0x38ce('0x36')](function(_0x32290f){if(_0x32290f){var _0x3a6945=_0x32290f[_0x38ce('0x5c')]&&fs[_0x38ce('0x64')](path['join'](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x32290f[_0x38ce('0x5c')])))?path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x32290f[_0x38ce('0x5c')])):path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x38ce('0x68')));var _0x77855d=_0x38ce('0x69')+_[_0x38ce('0x6a')](_0x38ce('0x5c'));if(_0x32290f[_0x77855d]||!_0x167ec1[_0x38ce('0x6b')]){_0x3a6945=path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x38ce('0x68')));}if(!fs['existsSync'](_0x3a6945)){throw new db[(_0x38ce('0x6c'))][(_0x38ce('0x6d'))](_[_0x38ce('0x6a')]('logo')+'\x20not\x20found');}return _0x50dcfb[_0x38ce('0x6e')](_0x3a6945);}})[_0x38ce('0x52')](handleError(_0x50dcfb,null));};var utilLicense=require('../../config/license/util');exports[_0x38ce('0x6f')]=function(_0x37ec69,_0x59a6be,_0x4ffa7b){var _0x1f7d08=_0x38ce('0x5e');var _0x59741c={'custom':![]};return utilLicense[_0x38ce('0x5f')]()[_0x38ce('0x36')](function(_0x158ba7){if(_0x158ba7){_0x59741c=_0x158ba7;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x37ec69[_0x38ce('0x54')]['id']},'attributes':[_0x38ce('0x5c'),_0x38ce('0x5d'),'preferred',_0x38ce('0x70'),_0x38ce('0x61'),_0x38ce('0x71'),_0x38ce('0x62'),_0x38ce('0x63')],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x59a6be,null))[_0x38ce('0x36')](function(_0x595d81){if(_0x595d81){var _0x5a74d1=_0x595d81['loginLogo']&&fs[_0x38ce('0x64')](path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x1f7d08,_[_0x38ce('0x66')](_0x595d81[_0x38ce('0x5d')])))?path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x1f7d08,_['toLower'](_0x595d81[_0x38ce('0x5d')])):path['join'](config['root'],_0x1f7d08,_['toLower'](_0x38ce('0x72')));var _0x1025c0=_0x38ce('0x69')+_['upperFirst'](_0x38ce('0x5d'));if(_0x595d81[_0x1025c0]||!_0x59741c[_0x38ce('0x6b')]){_0x5a74d1=path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x1f7d08,_[_0x38ce('0x66')]('default_loginLogo.svg'));}if(!fs[_0x38ce('0x64')](_0x5a74d1)){throw new db['Sequelize'][(_0x38ce('0x6d'))](_[_0x38ce('0x6a')]('loginLogo')+_0x38ce('0x73'));}return _0x59a6be[_0x38ce('0x6e')](_0x5a74d1);}})[_0x38ce('0x52')](handleError(_0x59a6be,null));};exports[_0x38ce('0x74')]=function(_0x5b22cb,_0x5e0006){return db['Setting']['find']({'where':{'id':_0x5b22cb['params']['id']},'attributes':['securePassword']})[_0x38ce('0x36')](respondWithResult(_0x5e0006,null))[_0x38ce('0x52')](handleError(_0x5e0006,null));};exports[_0x38ce('0x75')]=function(_0x3e493b,_0x524a4b,_0x5be2e5){if(_0x3e493b[_0x38ce('0x5a')]&&_0x3e493b['file'][_0x38ce('0x5b')]){_0x3e493b[_0x38ce('0x57')][_0x38ce('0x60')]=_0x3e493b[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x3e493b[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x524a4b,null))['then'](saveUpdates(_0x3e493b[_0x38ce('0x57')],null))[_0x38ce('0x36')](respondWithResult(_0x524a4b,null))[_0x38ce('0x52')](handleError(_0x524a4b,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x4fa65f,_0x2b9106,_0x147e81){var _0xb4b8ef=_0x38ce('0x5e');var _0x347037={'custom':![]};return utilLicense[_0x38ce('0x5f')]()[_0x38ce('0x36')](function(_0x345ba4){if(_0x345ba4){_0x347037=_0x345ba4;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x4fa65f[_0x38ce('0x54')]['id']},'attributes':[_0x38ce('0x5c'),_0x38ce('0x5d'),_0x38ce('0x60'),_0x38ce('0x70'),_0x38ce('0x61'),_0x38ce('0x71'),_0x38ce('0x62'),_0x38ce('0x63')],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x2b9106,null))['then'](function(_0x160f75){if(_0x160f75){var _0xe96ede=_0x160f75[_0x38ce('0x60')]&&fs['existsSync'](path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0xb4b8ef,_[_0x38ce('0x66')](_0x160f75[_0x38ce('0x60')])))?path['join'](config[_0x38ce('0x65')],_0xb4b8ef,_[_0x38ce('0x66')](_0x160f75[_0x38ce('0x60')])):path[_0x38ce('0x67')](config['root'],_0xb4b8ef,_[_0x38ce('0x66')](_0x38ce('0x76')));var _0x2952f6=_0x38ce('0x69')+_[_0x38ce('0x6a')](_0x38ce('0x60'));if(_0x160f75[_0x2952f6]||!_0x347037[_0x38ce('0x6b')]||!_0x347037[_0x38ce('0x60')]){_0xe96ede=path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0xb4b8ef,_[_0x38ce('0x66')](_0x38ce('0x76')));}if(!fs['existsSync'](_0xe96ede)){throw new db[(_0x38ce('0x6c'))][(_0x38ce('0x6d'))](_[_0x38ce('0x6a')](_0x38ce('0x60'))+_0x38ce('0x73'));}return _0x2b9106['download'](_0xe96ede);}})['catch'](handleError(_0x2b9106,null));};exports[_0x38ce('0x77')]=function(_0x5f0091,_0xed7dcc,_0x217454){if(_0x5f0091['file']&&_0x5f0091[_0x38ce('0x5a')][_0x38ce('0x5b')]){_0x5f0091['body'][_0x38ce('0x70')]=_0x5f0091[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x5f0091[_0x38ce('0x54')]['id']}})['then'](handleEntityNotFound(_0xed7dcc,null))[_0x38ce('0x36')](saveUpdates(_0x5f0091[_0x38ce('0x57')],null))['then'](respondWithResult(_0xed7dcc,null))['catch'](handleError(_0xed7dcc,null));};var utilLicense=require(_0x38ce('0x19'));exports['getFavicon']=function(_0x26b55e,_0x38d230,_0x384d74){var _0x35e4d2=_0x38ce('0x5e');var _0x20e6a4={'custom':![]};return utilLicense[_0x38ce('0x5f')]()['then'](function(_0x43dee2){if(_0x43dee2){_0x20e6a4=_0x43dee2;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x26b55e['params']['id']},'attributes':[_0x38ce('0x5c'),'loginLogo',_0x38ce('0x60'),_0x38ce('0x70'),'defaultLogo','defaultLoginLogo',_0x38ce('0x62'),'defaultFavicon'],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x38d230,null))[_0x38ce('0x36')](function(_0x44ec34){if(_0x44ec34){var _0x2e0c77=_0x44ec34[_0x38ce('0x70')]&&fs['existsSync'](path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x35e4d2,_[_0x38ce('0x66')](_0x44ec34['favicon'])))?path['join'](config[_0x38ce('0x65')],_0x35e4d2,_[_0x38ce('0x66')](_0x44ec34[_0x38ce('0x70')])):path[_0x38ce('0x67')](config['root'],_0x35e4d2,_[_0x38ce('0x66')](_0x38ce('0x78')));var _0x2954d0=_0x38ce('0x69')+_['upperFirst'](_0x38ce('0x70'));if(_0x44ec34[_0x2954d0]||!_0x20e6a4[_0x38ce('0x6b')]){_0x2e0c77=path['join'](config[_0x38ce('0x65')],_0x35e4d2,_['toLower'](_0x38ce('0x78')));}if(!fs['existsSync'](_0x2e0c77)){throw new db[(_0x38ce('0x6c'))][(_0x38ce('0x6d'))](_['upperFirst'](_0x38ce('0x70'))+'\x20not\x20found');}return _0x38d230[_0x38ce('0x6e')](_0x2e0c77);}})[_0x38ce('0x52')](handleError(_0x38d230,null));};exports['getDate']=function(_0xb5b839,_0x422c8e){var _0x519a35={'offset':moment()['utcOffset']()};_0x519a35[_0x38ce('0x79')]=moment()['utcOffset'](_0x519a35['offset'])[_0x38ce('0x7a')](_0x38ce('0x7b'));return _0x422c8e[_0x38ce('0x39')](0xc8)['send'](_0x519a35);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 83897d2..26b41c6 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x3cc9c9,_0x3748dc){var _0x2c6246=function(_0x229445){while(--_0x229445){_0x3cc9c9['push'](_0x3cc9c9['shift']());}};_0x2c6246(++_0x3748dc);}(_0xedd9,0xfc));var _0x9edd=function(_0x596986,_0x2797d0){_0x596986=_0x596986-0x0;var _0x51fc86=_0xedd9[_0x596986];return _0x51fc86;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 876d825..2aaf10b 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 _0x7b2c=['error','code','message','result','ShowSetting','Setting','find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x7b2c,0x140));var _0xc7b2=function(_0x267ecc,_0x21fc77){_0x267ecc=_0x267ecc-0x0;var _0x565e6b=_0x7b2c[_0x267ecc];return _0x565e6b;};'use strict';var _=require(_0xc7b2('0x0'));var util=require(_0xc7b2('0x1'));var moment=require(_0xc7b2('0x2'));var BPromise=require(_0xc7b2('0x3'));var rs=require(_0xc7b2('0x4'));var fs=require('fs');var Redis=require(_0xc7b2('0x5'));var db=require(_0xc7b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7b2('0x7'))('rpc');var config=require(_0xc7b2('0x8'));var jayson=require(_0xc7b2('0x9'));var client=jayson[_0xc7b2('0xa')][_0xc7b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2955b2,_0xdc12c3,_0x44cbdc){return new BPromise(function(_0x280cd8,_0x3da29c){return client[_0xc7b2('0xc')](_0x2955b2,_0x44cbdc)[_0xc7b2('0xd')](function(_0x1706a9){logger[_0xc7b2('0xe')](_0xc7b2('0xf'),_0xdc12c3,_0xc7b2('0x10'));logger[_0xc7b2('0x11')](_0xc7b2('0x12'),_0xdc12c3,'request\x20sent',JSON[_0xc7b2('0x13')](_0x1706a9));if(_0x1706a9[_0xc7b2('0x14')]){if(_0x1706a9['error'][_0xc7b2('0x15')]===0x1f4){logger[_0xc7b2('0x14')](_0xc7b2('0xf'),_0xdc12c3,_0x1706a9[_0xc7b2('0x14')][_0xc7b2('0x16')]);return _0x3da29c(_0x1706a9[_0xc7b2('0x14')][_0xc7b2('0x16')]);}logger[_0xc7b2('0x14')](_0xc7b2('0xf'),_0xdc12c3,_0x1706a9[_0xc7b2('0x14')]['message']);return _0x280cd8(_0x1706a9['error']['message']);}else{logger['info'](_0xc7b2('0xf'),_0xdc12c3,'request\x20sent');_0x280cd8(_0x1706a9[_0xc7b2('0x17')][_0xc7b2('0x16')]);}})['catch'](function(_0x3bdc72){logger[_0xc7b2('0x14')](_0xc7b2('0xf'),_0xdc12c3,_0x3bdc72);_0x3da29c(_0x3bdc72);});});}exports[_0xc7b2('0x18')]=function(_0x5515eb){var _0x2da7f4=this;return new Promise(function(_0x1ba6c3,_0x5508fa){return db[_0xc7b2('0x19')][_0xc7b2('0x1a')]({'raw':_0x5515eb[_0xc7b2('0x1b')]?_0x5515eb[_0xc7b2('0x1b')][_0xc7b2('0x1c')]===undefined?!![]:![]:!![],'where':_0x5515eb[_0xc7b2('0x1b')]?_0x5515eb[_0xc7b2('0x1b')][_0xc7b2('0x1d')]||null:null,'attributes':_0x5515eb[_0xc7b2('0x1b')]?_0x5515eb['options']['attributes']||null:null,'include':_0x5515eb[_0xc7b2('0x1b')]?_0x5515eb[_0xc7b2('0x1b')][_0xc7b2('0x1e')]?_[_0xc7b2('0x1f')](_0x5515eb[_0xc7b2('0x1b')][_0xc7b2('0x1e')],function(_0x5c255a){return{'model':db[_0x5c255a[_0xc7b2('0x20')]],'as':_0x5c255a['as'],'attributes':_0x5c255a[_0xc7b2('0x21')],'include':_0x5c255a[_0xc7b2('0x1e')]?_['map'](_0x5c255a['include'],function(_0x537409){return{'model':db[_0x537409[_0xc7b2('0x20')]],'as':_0x537409['as'],'attributes':_0x537409[_0xc7b2('0x21')],'include':_0x537409[_0xc7b2('0x1e')]?_[_0xc7b2('0x1f')](_0x537409['include'],function(_0xab127b){return{'model':db[_0xab127b[_0xc7b2('0x20')]],'as':_0xab127b['as'],'attributes':_0xab127b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc7b2('0xd')](function(_0x47e99b){logger['info'](_0xc7b2('0x18'),_0x5515eb);logger['debug'](_0xc7b2('0x18'),_0x5515eb,JSON[_0xc7b2('0x13')](_0x47e99b));_0x1ba6c3(_0x47e99b);})['catch'](function(_0x4656f1){logger[_0xc7b2('0x14')](_0xc7b2('0x18'),_0x4656f1[_0xc7b2('0x16')],_0x5515eb);_0x5508fa(_0x2da7f4[_0xc7b2('0x14')](0x1f4,_0x4656f1[_0xc7b2('0x16')]));});});}; \ No newline at end of file +var _0xfe65=['request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSetting','Setting','options','raw','map','include','model','attributes','then','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16019c,_0x38a631){var _0x2ee09e=function(_0x234527){while(--_0x234527){_0x16019c['push'](_0x16019c['shift']());}};_0x2ee09e(++_0x38a631);}(_0xfe65,0xab));var _0x5fe6=function(_0x554eea,_0x337f0a){_0x554eea=_0x554eea-0x0;var _0x4e5045=_0xfe65[_0x554eea];return _0x4e5045;};'use strict';var _=require('lodash');var util=require(_0x5fe6('0x0'));var moment=require(_0x5fe6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fe6('0x2'));var db=require(_0x5fe6('0x3'))['db'];var utils=require(_0x5fe6('0x4'));var logger=require(_0x5fe6('0x5'))(_0x5fe6('0x6'));var config=require(_0x5fe6('0x7'));var jayson=require(_0x5fe6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8d58,_0xed4d16,_0x2662fe){return new BPromise(function(_0x3e173f,_0x140486){return client[_0x5fe6('0x9')](_0x5d8d58,_0x2662fe)['then'](function(_0x5e3bd9){logger['info'](_0x5fe6('0xa'),_0xed4d16,_0x5fe6('0xb'));logger[_0x5fe6('0xc')](_0x5fe6('0xd'),_0xed4d16,'request\x20sent',JSON[_0x5fe6('0xe')](_0x5e3bd9));if(_0x5e3bd9[_0x5fe6('0xf')]){if(_0x5e3bd9[_0x5fe6('0xf')][_0x5fe6('0x10')]===0x1f4){logger[_0x5fe6('0xf')](_0x5fe6('0xa'),_0xed4d16,_0x5e3bd9[_0x5fe6('0xf')][_0x5fe6('0x11')]);return _0x140486(_0x5e3bd9['error'][_0x5fe6('0x11')]);}logger[_0x5fe6('0xf')]('Setting,\x20%s,\x20%s',_0xed4d16,_0x5e3bd9['error'][_0x5fe6('0x11')]);return _0x3e173f(_0x5e3bd9[_0x5fe6('0xf')][_0x5fe6('0x11')]);}else{logger[_0x5fe6('0x12')](_0x5fe6('0xa'),_0xed4d16,_0x5fe6('0xb'));_0x3e173f(_0x5e3bd9[_0x5fe6('0x13')][_0x5fe6('0x11')]);}})[_0x5fe6('0x14')](function(_0x373429){logger['error'](_0x5fe6('0xa'),_0xed4d16,_0x373429);_0x140486(_0x373429);});});}exports[_0x5fe6('0x15')]=function(_0x10b7d0){var _0x225836=this;return new Promise(function(_0x5b6de9,_0x293445){return db[_0x5fe6('0x16')]['find']({'raw':_0x10b7d0['options']?_0x10b7d0[_0x5fe6('0x17')][_0x5fe6('0x18')]===undefined?!![]:![]:!![],'where':_0x10b7d0[_0x5fe6('0x17')]?_0x10b7d0[_0x5fe6('0x17')]['where']||null:null,'attributes':_0x10b7d0[_0x5fe6('0x17')]?_0x10b7d0[_0x5fe6('0x17')]['attributes']||null:null,'include':_0x10b7d0[_0x5fe6('0x17')]?_0x10b7d0[_0x5fe6('0x17')]['include']?_[_0x5fe6('0x19')](_0x10b7d0['options'][_0x5fe6('0x1a')],function(_0x14f3a9){return{'model':db[_0x14f3a9[_0x5fe6('0x1b')]],'as':_0x14f3a9['as'],'attributes':_0x14f3a9[_0x5fe6('0x1c')],'include':_0x14f3a9[_0x5fe6('0x1a')]?_[_0x5fe6('0x19')](_0x14f3a9['include'],function(_0x23198c){return{'model':db[_0x23198c[_0x5fe6('0x1b')]],'as':_0x23198c['as'],'attributes':_0x23198c[_0x5fe6('0x1c')],'include':_0x23198c[_0x5fe6('0x1a')]?_[_0x5fe6('0x19')](_0x23198c['include'],function(_0x31657f){return{'model':db[_0x31657f['model']],'as':_0x31657f['as'],'attributes':_0x31657f[_0x5fe6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5fe6('0x1d')](function(_0x265538){logger[_0x5fe6('0x12')](_0x5fe6('0x15'),_0x10b7d0);logger[_0x5fe6('0xc')](_0x5fe6('0x15'),_0x10b7d0,JSON['stringify'](_0x265538));_0x5b6de9(_0x265538);})[_0x5fe6('0x14')](function(_0x2dc06c){logger[_0x5fe6('0xf')]('ShowSetting',_0x2dc06c[_0x5fe6('0x11')],_0x10b7d0);_0x293445(_0x225836[_0x5fe6('0xf')](0x1f4,_0x2dc06c['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b4f90fb..5c676e3 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(_0x1cb35c,_0x4d9d57){var _0x19a8a4=function(_0x153eff){while(--_0x153eff){_0x1cb35c['push'](_0x1cb35c['shift']());}};_0x19a8a4(++_0x4d9d57);}(_0x7a54,0x106));var _0x47a5=function(_0x331208,_0x19c574){_0x331208=_0x331208-0x0;var _0x279797=_0x7a54[_0x331208];return _0x279797;};'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(_0x48b3b0,_0x1bda9b){var _0x25e101=function(_0x1466ff){while(--_0x1466ff){_0x48b3b0['push'](_0x48b3b0['shift']());}};_0x25e101(++_0x1bda9b);}(_0x7a54,0x106));var _0x47a5=function(_0x765b78,_0x119afb){_0x765b78=_0x765b78-0x0;var _0x44cc63=_0x7a54[_0x765b78];return _0x44cc63;};'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 b6fb913..c6247d6 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 _0x2dc1=['setDataValue','mandatoryDispositionPauseId','sequelize','STRING','name','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2aee23,_0x46786d){var _0x1dd854=function(_0x20673b){while(--_0x20673b){_0x2aee23['push'](_0x2aee23['shift']());}};_0x1dd854(++_0x46786d);}(_0x2dc1,0x167));var _0x12dc=function(_0x29e655,_0x4ff781){_0x29e655=_0x29e655-0x0;var _0x14e3e6=_0x2dc1[_0x29e655];return _0x14e3e6;};'use strict';var Sequelize=require(_0x12dc('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x12dc('0x1')],'unique':_0x12dc('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x12dc('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x12dc('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x12dc('0x1')],'defaultValue':function(){return rs[_0x12dc('0x3')]();}},'phone':{'type':Sequelize[_0x12dc('0x1')]},'type':{'type':Sequelize[_0x12dc('0x4')]('twilio',_0x12dc('0x5'),_0x12dc('0x6'),_0x12dc('0x7'),_0x12dc('0x8'),_0x12dc('0x9'),_0x12dc('0xa'),_0x12dc('0xb'),_0x12dc('0xc'),_0x12dc('0xd'))},'accountSid':{'type':Sequelize[_0x12dc('0x1')]},'authId':{'type':Sequelize[_0x12dc('0x1')]},'authToken':{'type':Sequelize[_0x12dc('0x1')]},'smsMethod':{'type':Sequelize[_0x12dc('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x12dc('0x1')]},'password':{'type':Sequelize[_0x12dc('0x1')]},'apiKey':{'type':Sequelize[_0x12dc('0x1')]},'applicationId':{'type':Sequelize[_0x12dc('0x1')]},'accountId':{'type':Sequelize[_0x12dc('0x1')]},'senderString':{'type':Sequelize[_0x12dc('0x1')]},'deliveryReport':{'type':Sequelize[_0x12dc('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x12dc('0x1')]},'notificationTemplate':{'type':Sequelize[_0x12dc('0xf')],'defaultValue':function(){return _0x12dc('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x12dc('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x12dc('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x12dc('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x12dc('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x12dc('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x12dc('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x12dc('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x12dc('0xe')],'defaultValue':![],'comment':_0x12dc('0x12'),'set':function(_0x3a7389){if(!_0x3a7389)this[_0x12dc('0x13')](_0x12dc('0x14'),null);this[_0x12dc('0x13')]('mandatoryDisposition',_0x3a7389);}}}; \ No newline at end of file +var _0x05b3=['infobip','intelepeer','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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','connectel','clicksend','plivo','clickatell','bandwidth','csc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05b3,0xf1));var _0x305b=function(_0x441db3,_0x10f359){_0x441db3=_0x441db3-0x0;var _0x16c05d=_0x05b3[_0x441db3];return _0x16c05d;};'use strict';var Sequelize=require(_0x305b('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x305b('0x1')],'unique':_0x305b('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x305b('0x1')],'defaultValue':function(){return rs[_0x305b('0x3')]();}},'phone':{'type':Sequelize[_0x305b('0x1')]},'type':{'type':Sequelize[_0x305b('0x4')]('twilio','skebby',_0x305b('0x5'),_0x305b('0x6'),_0x305b('0x7'),_0x305b('0x8'),_0x305b('0x9'),_0x305b('0xa'),_0x305b('0xb'),_0x305b('0xc'))},'accountSid':{'type':Sequelize[_0x305b('0x1')]},'authId':{'type':Sequelize[_0x305b('0x1')]},'authToken':{'type':Sequelize[_0x305b('0x1')]},'smsMethod':{'type':Sequelize[_0x305b('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x305b('0x1')]},'apiKey':{'type':Sequelize[_0x305b('0x1')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x305b('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x305b('0xd')],'defaultValue':function(){return _0x305b('0xe');}},'notificationSound':{'type':Sequelize[_0x305b('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x305b('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x305b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x305b('0x10')],'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['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x305b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x305b('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x305b('0xf')],'defaultValue':![],'comment':_0x305b('0x11'),'set':function(_0xc9ce12){if(!_0xc9ce12)this[_0x305b('0x12')](_0x305b('0x13'),null);this[_0x305b('0x12')](_0x305b('0x14'),_0xc9ce12);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 591510b..1c18b81 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 _0x25ee=['sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','http','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','destroy','then','get','SmsAccounts','UserProfileResource','stack','send','index','map','SmsAccount','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','catch','params','Pause','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','update','describe','Disposition','getDispositions','findOne','rows','removeDispositions','ids','SmsAccountId','CannedAnswer','getAnswers','findAll','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','updatedAt','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','infobip','groupName','DELIVERED','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1e3135,_0x43f424){var _0x39e14f=function(_0x2af35f){while(--_0x2af35f){_0x1e3135['push'](_0x1e3135['shift']());}};_0x39e14f(++_0x43f424);}(_0x25ee,0xe0));var _0xe25e=function(_0x3f35e6,_0x67e16b){_0x3f35e6=_0x3f35e6-0x0;var _0x23ea78=_0x25ee[_0x3f35e6];return _0x23ea78;};'use strict';var emlformat=require(_0xe25e('0x0'));var rimraf=require(_0xe25e('0x1'));var zipdir=require(_0xe25e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe25e('0x3'));var moment=require(_0xe25e('0x4'));var BPromise=require(_0xe25e('0x5'));var Mustache=require(_0xe25e('0x6'));var util=require(_0xe25e('0x7'));var path=require(_0xe25e('0x8'));var sox=require(_0xe25e('0x9'));var csv=require(_0xe25e('0xa'));var ejs=require(_0xe25e('0xb'));var fs=require('fs');var fs_extra=require(_0xe25e('0xc'));var _=require('lodash');var squel=require(_0xe25e('0xd'));var crypto=require(_0xe25e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe25e('0xa'));var querystring=require(_0xe25e('0xf'));var Papa=require(_0xe25e('0x10'));var Redis=require(_0xe25e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe25e('0x12'));var hardwareService=require(_0xe25e('0x13'));var logger=require(_0xe25e('0x14'))(_0xe25e('0x15'));var utils=require(_0xe25e('0x16'));var config=require(_0xe25e('0x17'));var licenseUtil=require(_0xe25e('0x18'));var db=require(_0xe25e('0x19'))['db'];config[_0xe25e('0x1a')]=_[_0xe25e('0x1b')](config[_0xe25e('0x1a')],{'host':_0xe25e('0x1c'),'port':0x18eb});var socket=require(_0xe25e('0x1d'))(new Redis(config[_0xe25e('0x1a')]));require('./smsAccount.socket')[_0xe25e('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe25e('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x10685d,_0x3003b6,_0x17d4f8,_0x4534c6){return new BPromise(function(_0x4ff67f,_0x3a82d2){var _0x1cf005=_0x4534c6||client;return _0x1cf005[_0xe25e('0x20')](_0x10685d,_0x17d4f8)['then'](function(_0x293c42){logger[_0xe25e('0x21')](_0xe25e('0x22'),_0x3003b6,'request\x20sent');logger[_0xe25e('0x23')](_0xe25e('0x24'),_0x3003b6,_0xe25e('0x25'),JSON[_0xe25e('0x26')](_0x293c42));if(_0x293c42[_0xe25e('0x27')]){if(_0x293c42[_0xe25e('0x27')][_0xe25e('0x28')]===0x1f4){logger[_0xe25e('0x27')](_0xe25e('0x22'),_0x3003b6,_0x293c42[_0xe25e('0x27')][_0xe25e('0x29')]);return _0x3a82d2(_0x293c42['error'][_0xe25e('0x29')]);}logger['error'](_0xe25e('0x22'),_0x3003b6,_0x293c42[_0xe25e('0x27')][_0xe25e('0x29')]);return _0x4ff67f(_0x293c42[_0xe25e('0x27')]['message']);}else{logger[_0xe25e('0x21')](_0xe25e('0x22'),_0x3003b6,'request\x20sent');_0x4ff67f(_0x293c42[_0xe25e('0x2a')]['message']);}})['catch'](function(_0x2be0e8){logger[_0xe25e('0x27')](_0xe25e('0x22'),_0x3003b6,_0x2be0e8);_0x3a82d2(_0x2be0e8);});});}function respondWithStatusCode(_0x1463b2,_0x1d119c){_0x1d119c=_0x1d119c||0xcc;return function(_0x28f455){if(_0x28f455){return _0x1463b2[_0xe25e('0x2b')](_0x1d119c);}return _0x1463b2[_0xe25e('0x2c')](_0x1d119c)[_0xe25e('0x2d')]();};}function respondWithResult(_0x1d017e,_0x633b2d){_0x633b2d=_0x633b2d||0xc8;return function(_0x2bdb67){if(_0x2bdb67){return _0x1d017e['status'](_0x633b2d)[_0xe25e('0x2e')](_0x2bdb67);}};}function respondWithFilteredResult(_0x187ca0,_0x2520c1){return function(_0x5ddeed){if(_0x5ddeed){var _0x44eabb=typeof _0x2520c1[_0xe25e('0x2f')]===_0xe25e('0x30')&&typeof _0x2520c1[_0xe25e('0x31')]===_0xe25e('0x30');var _0x21f8d5=_0x5ddeed['count'];var _0x2ac7c2=_0x44eabb?0x0:_0x2520c1[_0xe25e('0x2f')];var _0x3a33a0=_0x44eabb?_0x5ddeed[_0xe25e('0x32')]:_0x2520c1[_0xe25e('0x2f')]+_0x2520c1[_0xe25e('0x31')];var _0x2ec66e;if(_0x3a33a0>=_0x21f8d5){_0x3a33a0=_0x21f8d5;_0x2ec66e=0xc8;}else{_0x2ec66e=0xce;}_0x187ca0['status'](_0x2ec66e);return _0x187ca0['set'](_0xe25e('0x33'),_0x2ac7c2+'-'+_0x3a33a0+'/'+_0x21f8d5)['json'](_0x5ddeed);}return null;};}function patchUpdates(_0x3a9e52){return function(_0x538765){try{jsonpatch['apply'](_0x538765,_0x3a9e52,!![]);}catch(_0x210b04){return BPromise[_0xe25e('0x34')](_0x210b04);}return _0x538765['save']();};}function saveUpdates(_0x592386,_0x2c86cb){return function(_0x464a5f){if(_0x464a5f){return _0x464a5f['update'](_0x592386)['then'](function(_0x47b97e){return _0x47b97e;});}return null;};}function removeEntity(_0x404815,_0x37a0cd){return function(_0x351063){if(_0x351063){return _0x351063[_0xe25e('0x35')]()[_0xe25e('0x36')](function(){var _0x2573f6=_0x351063[_0xe25e('0x37')]({'plain':!![]});var _0x276135=_0xe25e('0x38');return db[_0xe25e('0x39')][_0xe25e('0x35')]({'where':{'type':_0x276135,'resourceId':_0x2573f6['id']}})[_0xe25e('0x36')](function(){return _0x351063;});})[_0xe25e('0x36')](function(){_0x404815['status'](0xcc)[_0xe25e('0x2d')]();});}};}function handleEntityNotFound(_0x4f7a3a,_0x32787b){return function(_0x90754){if(!_0x90754){_0x4f7a3a['sendStatus'](0x194);}return _0x90754;};}function handleError(_0x27ef06,_0xe72315){_0xe72315=_0xe72315||0x1f4;return function(_0x3e0703){logger['error'](_0x3e0703[_0xe25e('0x3a')]);if(_0x3e0703['name']){delete _0x3e0703['name'];}_0x27ef06[_0xe25e('0x2c')](_0xe72315)[_0xe25e('0x3b')](_0x3e0703);};}exports[_0xe25e('0x3c')]=function(_0x42d479,_0x5a2f50){var _0x1c254b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1bbc6c={},_0x132e35={'count':0x0,'rows':[]};var _0xd733eb=_[_0xe25e('0x3d')](db[_0xe25e('0x3e')][_0xe25e('0x3f')],function(_0x1f0b17){return{'name':_0x1f0b17[_0xe25e('0x40')],'type':_0x1f0b17[_0xe25e('0x41')][_0xe25e('0x42')]};});_0x1bbc6c[_0xe25e('0x43')]=_['map'](_0xd733eb,_0xe25e('0x44'));_0x1bbc6c[_0xe25e('0x45')]=_[_0xe25e('0x46')](_0x42d479[_0xe25e('0x45')]);_0x1bbc6c['filters']=_[_0xe25e('0x47')](_0x1bbc6c[_0xe25e('0x43')],_0x1bbc6c[_0xe25e('0x45')]);_0x1c254b[_0xe25e('0x48')]=_[_0xe25e('0x47')](_0x1bbc6c[_0xe25e('0x43')],qs['fields'](_0x42d479[_0xe25e('0x45')][_0xe25e('0x49')]));_0x1c254b[_0xe25e('0x48')]=_0x1c254b[_0xe25e('0x48')][_0xe25e('0x4a')]?_0x1c254b[_0xe25e('0x48')]:_0x1bbc6c[_0xe25e('0x43')];if(!_0x42d479[_0xe25e('0x45')][_0xe25e('0x4b')](_0xe25e('0x4c'))){_0x1c254b[_0xe25e('0x31')]=qs[_0xe25e('0x31')](_0x42d479[_0xe25e('0x45')][_0xe25e('0x31')]);_0x1c254b[_0xe25e('0x2f')]=qs[_0xe25e('0x2f')](_0x42d479[_0xe25e('0x45')][_0xe25e('0x2f')]);}_0x1c254b[_0xe25e('0x4d')]=qs['sort'](_0x42d479['query'][_0xe25e('0x4e')]);_0x1c254b[_0xe25e('0x4f')]=qs[_0xe25e('0x50')](_[_0xe25e('0x51')](_0x42d479[_0xe25e('0x45')],_0x1bbc6c[_0xe25e('0x50')]),_0xd733eb);if(_0x42d479[_0xe25e('0x45')][_0xe25e('0x52')]){_0x1c254b[_0xe25e('0x4f')]=_[_0xe25e('0x53')](_0x1c254b[_0xe25e('0x4f')],{'$or':_[_0xe25e('0x3d')](_0xd733eb,function(_0x46c61b){if(_0x46c61b[_0xe25e('0x41')]!=='VIRTUAL'){var _0x10d88e={};_0x10d88e[_0x46c61b[_0xe25e('0x44')]]={'$like':'%'+_0x42d479[_0xe25e('0x45')]['filter']+'%'};return _0x10d88e;}})});}_0x1c254b=_[_0xe25e('0x53')]({},_0x1c254b,_0x42d479[_0xe25e('0x54')]);var _0xa99711={'where':_0x1c254b[_0xe25e('0x4f')]};return db[_0xe25e('0x3e')][_0xe25e('0x32')](_0xa99711)[_0xe25e('0x36')](function(_0xf140af){_0x132e35[_0xe25e('0x32')]=_0xf140af;if(_0x42d479[_0xe25e('0x45')][_0xe25e('0x55')]){_0x1c254b[_0xe25e('0x56')]=[{'all':!![]}];}return db[_0xe25e('0x3e')]['findAll'](_0x1c254b);})['then'](function(_0x12ee4b){_0x132e35['rows']=_0x12ee4b;return _0x132e35;})[_0xe25e('0x36')](respondWithFilteredResult(_0x5a2f50,_0x1c254b))[_0xe25e('0x57')](handleError(_0x5a2f50,null));};exports['show']=function(_0x19df68,_0x42c2d8){var _0x3c3ff4={'raw':![],'where':{'id':_0x19df68[_0xe25e('0x58')]['id']},'include':[{'model':db[_0xe25e('0x59')],'as':_0xe25e('0x5a')}]},_0x3931b3={};_0x3931b3['model']=_['keys'](db[_0xe25e('0x3e')][_0xe25e('0x3f')]);_0x3931b3['query']=_[_0xe25e('0x46')](_0x19df68[_0xe25e('0x45')]);_0x3931b3[_0xe25e('0x50')]=_[_0xe25e('0x47')](_0x3931b3['model'],_0x3931b3[_0xe25e('0x45')]);_0x3c3ff4[_0xe25e('0x48')]=_[_0xe25e('0x47')](_0x3931b3[_0xe25e('0x43')],qs['fields'](_0x19df68['query']['fields']));_0x3c3ff4['attributes']=_0x3c3ff4[_0xe25e('0x48')][_0xe25e('0x4a')]?_0x3c3ff4[_0xe25e('0x48')]:_0x3931b3['model'];if(_0x19df68[_0xe25e('0x45')][_0xe25e('0x55')]){_0x3c3ff4[_0xe25e('0x56')]=[{'all':!![]}];}_0x3c3ff4=_[_0xe25e('0x53')]({},_0x3c3ff4,_0x19df68[_0xe25e('0x54')]);return db[_0xe25e('0x3e')][_0xe25e('0x5b')](_0x3c3ff4)[_0xe25e('0x36')](handleEntityNotFound(_0x42c2d8,null))[_0xe25e('0x36')](respondWithResult(_0x42c2d8,null))[_0xe25e('0x57')](handleError(_0x42c2d8,null));};exports[_0xe25e('0x5c')]=function(_0x46ab34,_0x15c366){return db[_0xe25e('0x3e')][_0xe25e('0x5c')](_0x46ab34[_0xe25e('0x5d')],{})[_0xe25e('0x36')](function(_0x2c27d1){var _0x2979ab=_0x46ab34[_0xe25e('0x5e')]['get']({'plain':!![]});if(!_0x2979ab)throw new Error(_0xe25e('0x5f'));if(_0x2979ab['role']===_0xe25e('0x5e')){var _0x2b25e1=_0x2c27d1[_0xe25e('0x37')]({'plain':!![]});var _0x271a79=_0xe25e('0x38');return db[_0xe25e('0x60')][_0xe25e('0x5b')]({'where':{'name':_0x271a79,'userProfileId':_0x2979ab[_0xe25e('0x61')]},'raw':!![]})[_0xe25e('0x36')](function(_0x3b87db){if(_0x3b87db&&_0x3b87db['autoAssociation']===0x0){return db[_0xe25e('0x39')]['create']({'name':_0x2b25e1[_0xe25e('0x44')],'resourceId':_0x2b25e1['id'],'type':_0x3b87db['name'],'sectionId':_0x3b87db['id']},{})[_0xe25e('0x36')](function(){return _0x2c27d1;});}else{return _0x2c27d1;}})['catch'](function(_0x22ded3){logger[_0xe25e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22ded3);throw _0x22ded3;});}return _0x2c27d1;})[_0xe25e('0x36')](respondWithResult(_0x15c366,0xc9))[_0xe25e('0x57')](handleError(_0x15c366,null));};exports[_0xe25e('0x62')]=function(_0x231508,_0xc50eac){if(_0x231508[_0xe25e('0x5d')]['id']){delete _0x231508['body']['id'];}return db[_0xe25e('0x3e')][_0xe25e('0x5b')]({'where':{'id':_0x231508[_0xe25e('0x58')]['id']},'include':[{'model':db[_0xe25e('0x59')],'as':_0xe25e('0x5a')}]})['then'](handleEntityNotFound(_0xc50eac,null))['then'](saveUpdates(_0x231508['body'],null))[_0xe25e('0x36')](respondWithResult(_0xc50eac,null))[_0xe25e('0x57')](handleError(_0xc50eac,null));};exports[_0xe25e('0x35')]=function(_0x5745c3,_0x1ed424){return db[_0xe25e('0x3e')][_0xe25e('0x5b')]({'where':{'id':_0x5745c3[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x1ed424,null))[_0xe25e('0x36')](removeEntity(_0x1ed424,null))[_0xe25e('0x57')](handleError(_0x1ed424,null));};exports[_0xe25e('0x63')]=function(_0x46fa40,_0xe980ec){return db['SmsAccount'][_0xe25e('0x63')]()['then'](respondWithResult(_0xe980ec,null))['catch'](handleError(_0xe980ec,null));};exports['addDisposition']=function(_0x4d83e3,_0x45caa5,_0x1d5c06){if(_0x4d83e3['body']['id']){delete _0x4d83e3[_0xe25e('0x5d')]['id'];}return db[_0xe25e('0x3e')][_0xe25e('0x5b')]({'where':{'id':_0x4d83e3[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x45caa5,null))[_0xe25e('0x36')](function(_0x325476){if(_0x325476){_0x4d83e3[_0xe25e('0x5d')]['SmsAccountId']=_0x325476['id'];return db[_0xe25e('0x64')]['create'](_0x4d83e3['body']);}})[_0xe25e('0x36')](respondWithResult(_0x45caa5,null))[_0xe25e('0x57')](handleError(_0x45caa5,null));};exports[_0xe25e('0x65')]=function(_0x229446,_0x3fbfaa,_0x150ff1){var _0x5e123c={'raw':![],'where':{}};var _0x67dede={};var _0x3100b5={'count':0x0,'rows':[]};return db[_0xe25e('0x3e')][_0xe25e('0x66')]({'where':{'id':_0x229446[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x3fbfaa,null))[_0xe25e('0x36')](function(_0x25cbf3){if(_0x25cbf3){_0x67dede[_0xe25e('0x43')]=_[_0xe25e('0x46')](db[_0xe25e('0x64')][_0xe25e('0x3f')]);_0x67dede[_0xe25e('0x45')]=_[_0xe25e('0x46')](_0x229446[_0xe25e('0x45')]);_0x67dede[_0xe25e('0x50')]=_['intersection'](_0x67dede[_0xe25e('0x43')],_0x67dede[_0xe25e('0x45')]);_0x5e123c[_0xe25e('0x48')]=_[_0xe25e('0x47')](_0x67dede[_0xe25e('0x43')],qs[_0xe25e('0x49')](_0x229446[_0xe25e('0x45')][_0xe25e('0x49')]));_0x5e123c[_0xe25e('0x48')]=_0x5e123c['attributes'][_0xe25e('0x4a')]?_0x5e123c[_0xe25e('0x48')]:_0x67dede[_0xe25e('0x43')];if(!_0x229446['query'][_0xe25e('0x4b')](_0xe25e('0x4c'))){_0x5e123c[_0xe25e('0x31')]=qs['limit'](_0x229446[_0xe25e('0x45')]['limit']);_0x5e123c[_0xe25e('0x2f')]=qs[_0xe25e('0x2f')](_0x229446[_0xe25e('0x45')][_0xe25e('0x2f')]);}_0x5e123c[_0xe25e('0x4d')]=qs[_0xe25e('0x4e')](_0x229446[_0xe25e('0x45')][_0xe25e('0x4e')]);_0x5e123c[_0xe25e('0x4f')]=qs[_0xe25e('0x50')](_[_0xe25e('0x51')](_0x229446['query'],_0x67dede[_0xe25e('0x50')]));_0x5e123c[_0xe25e('0x4f')]['SmsAccountId']=_0x25cbf3['id'];if(_0x229446[_0xe25e('0x45')]['filter']){_0x5e123c[_0xe25e('0x4f')]=_[_0xe25e('0x53')](_0x5e123c[_0xe25e('0x4f')],{'$or':_['map'](_0x5e123c[_0xe25e('0x48')],function(_0x5e6491){var _0x2b28cd={};_0x2b28cd[_0x5e6491]={'$like':'%'+_0x229446[_0xe25e('0x45')]['filter']+'%'};return _0x2b28cd;})});}_0x5e123c=_['merge']({},_0x5e123c,_0x229446[_0xe25e('0x54')]);return db[_0xe25e('0x64')]['count']({'where':_0x5e123c['where']})[_0xe25e('0x36')](function(_0x5e4d28){_0x3100b5['count']=_0x5e4d28;if(_0x229446[_0xe25e('0x45')]['includeAll']){_0x5e123c[_0xe25e('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5e123c);})['then'](function(_0x510063){_0x3100b5[_0xe25e('0x67')]=_0x510063;return _0x3100b5;});}})[_0xe25e('0x36')](respondWithFilteredResult(_0x3fbfaa,_0x5e123c))[_0xe25e('0x57')](handleError(_0x3fbfaa,null));};exports[_0xe25e('0x68')]=function(_0x1cc354,_0x4e7cd4,_0x4afc14){return db[_0xe25e('0x3e')][_0xe25e('0x5b')]({'where':{'id':_0x1cc354[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x4e7cd4,null))['then'](function(_0xcf3032){if(_0xcf3032){return _0xcf3032[_0xe25e('0x68')](_0x1cc354[_0xe25e('0x45')][_0xe25e('0x69')]);}})[_0xe25e('0x36')](respondWithStatusCode(_0x4e7cd4,null))['catch'](handleError(_0x4e7cd4,null));};exports['addAnswer']=function(_0x55ad26,_0x4775e4,_0x25bc67){if(_0x55ad26[_0xe25e('0x5d')]['id']){delete _0x55ad26[_0xe25e('0x5d')]['id'];}return db['SmsAccount'][_0xe25e('0x5b')]({'where':{'id':_0x55ad26['params']['id']}})['then'](handleEntityNotFound(_0x4775e4,null))[_0xe25e('0x36')](function(_0x2b439c){if(_0x2b439c){_0x55ad26[_0xe25e('0x5d')][_0xe25e('0x6a')]=_0x2b439c['id'];return db[_0xe25e('0x6b')]['create'](_0x55ad26[_0xe25e('0x5d')]);}})['then'](respondWithResult(_0x4775e4,null))['catch'](handleError(_0x4775e4,null));};exports[_0xe25e('0x6c')]=function(_0x5c2c5e,_0x436ec7,_0x431ebf){var _0x41e921={'raw':![],'where':{}};var _0x4724f0={};var _0x1b5988={'count':0x0,'rows':[]};return db[_0xe25e('0x3e')][_0xe25e('0x66')]({'where':{'id':_0x5c2c5e[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x436ec7,null))[_0xe25e('0x36')](function(_0x1da043){if(_0x1da043){_0x4724f0['model']=_[_0xe25e('0x46')](db['CannedAnswer'][_0xe25e('0x3f')]);_0x4724f0[_0xe25e('0x45')]=_['keys'](_0x5c2c5e[_0xe25e('0x45')]);_0x4724f0[_0xe25e('0x50')]=_['intersection'](_0x4724f0[_0xe25e('0x43')],_0x4724f0[_0xe25e('0x45')]);_0x41e921[_0xe25e('0x48')]=_[_0xe25e('0x47')](_0x4724f0['model'],qs['fields'](_0x5c2c5e[_0xe25e('0x45')][_0xe25e('0x49')]));_0x41e921[_0xe25e('0x48')]=_0x41e921[_0xe25e('0x48')]['length']?_0x41e921[_0xe25e('0x48')]:_0x4724f0['model'];if(!_0x5c2c5e[_0xe25e('0x45')][_0xe25e('0x4b')](_0xe25e('0x4c'))){_0x41e921['limit']=qs[_0xe25e('0x31')](_0x5c2c5e[_0xe25e('0x45')]['limit']);_0x41e921[_0xe25e('0x2f')]=qs[_0xe25e('0x2f')](_0x5c2c5e['query'][_0xe25e('0x2f')]);}_0x41e921['order']=qs[_0xe25e('0x4e')](_0x5c2c5e[_0xe25e('0x45')]['sort']);_0x41e921[_0xe25e('0x4f')]=qs['filters'](_[_0xe25e('0x51')](_0x5c2c5e['query'],_0x4724f0[_0xe25e('0x50')]));_0x41e921[_0xe25e('0x4f')]['SmsAccountId']=_0x1da043['id'];if(_0x5c2c5e[_0xe25e('0x45')][_0xe25e('0x52')]){_0x41e921['where']=_[_0xe25e('0x53')](_0x41e921[_0xe25e('0x4f')],{'$or':_[_0xe25e('0x3d')](_0x41e921[_0xe25e('0x48')],function(_0x13f233){var _0x29e65f={};_0x29e65f[_0x13f233]={'$like':'%'+_0x5c2c5e[_0xe25e('0x45')][_0xe25e('0x52')]+'%'};return _0x29e65f;})});}_0x41e921=_[_0xe25e('0x53')]({},_0x41e921,_0x5c2c5e[_0xe25e('0x54')]);return db[_0xe25e('0x6b')][_0xe25e('0x32')]({'where':_0x41e921[_0xe25e('0x4f')]})[_0xe25e('0x36')](function(_0x47a52e){_0x1b5988['count']=_0x47a52e;if(_0x5c2c5e[_0xe25e('0x45')][_0xe25e('0x55')]){_0x41e921[_0xe25e('0x56')]=[{'all':!![]}];}return db[_0xe25e('0x6b')][_0xe25e('0x6d')](_0x41e921);})[_0xe25e('0x36')](function(_0xdae0d9){_0x1b5988[_0xe25e('0x67')]=_0xdae0d9;return _0x1b5988;});}})[_0xe25e('0x36')](respondWithFilteredResult(_0x436ec7,_0x41e921))[_0xe25e('0x57')](handleError(_0x436ec7,null));};exports[_0xe25e('0x6e')]=function(_0x206596,_0x41da66,_0x242257){return db[_0xe25e('0x3e')][_0xe25e('0x5b')]({'where':{'id':_0x206596['params']['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x41da66,null))[_0xe25e('0x36')](function(_0x50deeb){if(_0x50deeb){return _0x50deeb[_0xe25e('0x6e')](_0x206596[_0xe25e('0x45')][_0xe25e('0x69')]);}})[_0xe25e('0x36')](respondWithStatusCode(_0x41da66,null))['catch'](handleError(_0x41da66,null));};exports['notify']=function(_0x229db4,_0x4adcc2,_0x45b261){var _0x5025fd={'channel':_0xe25e('0x6f')};var _0x5b9d0c=[];var _0x4fdba1=[];var _0x3bb8a5={};return db['SmsAccount'][_0xe25e('0x5b')]({'where':{'id':_0x229db4['params']['id']},'include':[{'model':db[_0xe25e('0x70')],'as':_0xe25e('0x71')}]})[_0xe25e('0x36')](handleEntityNotFound(_0x4adcc2,null))['then'](function(_0x4dbac8){_0x5025fd[_0xe25e('0x72')]=_0x4dbac8;_0x5025fd[_0xe25e('0x73')]=_[_0xe25e('0x74')](_0x4dbac8[_0xe25e('0x71')],[_0xe25e('0x75')],[_0xe25e('0x76')]);if(_0x5025fd['account']['Applications']){delete _0x5025fd['account']['Applications'];}return db['CmContact'][_0xe25e('0x63')]();})[_0xe25e('0x36')](function(_0x56fd3e){if(!_0x56fd3e){throw new db[(_0xe25e('0x77'))][(_0xe25e('0x78'))](_0xe25e('0x79'));}_0x5b9d0c=_['difference'](_[_0xe25e('0x46')](_0x56fd3e),['createdAt','updatedAt']);_0x4fdba1=_['difference'](_[_0xe25e('0x46')](_0x56fd3e),[_0xe25e('0x7a'),'updatedAt',_0xe25e('0x7b'),_0xe25e('0x7c')]);_0x5025fd[_0xe25e('0x5d')]={'mapKey':_0xe25e('0x7d')};if(_0x5025fd[_0xe25e('0x72')]['type']){switch(_0x5025fd[_0xe25e('0x72')][_0xe25e('0x41')]){case _0xe25e('0x7e'):_0x5025fd['body']['from']=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x7f')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x80')];_0x5025fd['body'][_0xe25e('0x81')]=_0x229db4['body'][_0xe25e('0x82')];break;case _0xe25e('0x83'):_0x5025fd['body'][_0xe25e('0x84')]='+'+_0x229db4[_0xe25e('0x5d')][_0xe25e('0x85')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x86')];break;case _0xe25e('0x87'):_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x84')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x29')];break;case'clicksend':_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')]=_0x229db4[_0xe25e('0x5d')]['from'];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x5d')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x81')]=_0x229db4['body'][_0xe25e('0x88')];break;case _0xe25e('0x89'):_0x5025fd['body'][_0xe25e('0x84')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x7f')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x8a')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x81')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x8b')];break;case'infobip':_0x5025fd['body'][_0xe25e('0x84')]='+'+_0x229db4[_0xe25e('0x5d')][_0xe25e('0x8c')][0x0]['from'];_0x5025fd['body'][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x8c')][0x0][_0xe25e('0x86')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x81')]=_0x229db4['body'][_0xe25e('0x8c')][0x0]['messageId'];break;case _0xe25e('0x8d'):_0x5025fd[_0xe25e('0x5d')]['from']=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x8e')];_0x5025fd['body'][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x8f')][_0xe25e('0x29')];break;case _0xe25e('0x90'):_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')]=_0x229db4[_0xe25e('0x5d')]['fromNumber'];_0x5025fd[_0xe25e('0x5d')]['body']=_0x229db4['body'][_0xe25e('0x86')];_0x5025fd[_0xe25e('0x5d')]['messageId']=_0x229db4[_0xe25e('0x5d')]['replyMessageId'];break;case _0xe25e('0x91'):_0x5025fd['body'][_0xe25e('0x81')]=_0x229db4[_0xe25e('0x5d')][0x0]['message']['id'];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')]=_0x229db4[_0xe25e('0x5d')][0x0][_0xe25e('0x29')][_0xe25e('0x84')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')][0x0][_0xe25e('0x29')][_0xe25e('0x86')];break;case'intelepeer':_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')]=_0x229db4[_0xe25e('0x5d')][_0xe25e('0x84')];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')]=_0x229db4[_0xe25e('0x5d')]['message'];_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x81')]=_0x229db4['body'][_0xe25e('0x92')];break;}}if(_0x5025fd['body']['id']){delete _0x5025fd[_0xe25e('0x5d')]['id'];}if(_[_0xe25e('0x93')](_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')])){throw new db['Sequelize'][(_0xe25e('0x78'))](_0xe25e('0x94'));}if(_['isNil'](_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x5d')])||_0x5025fd['body']['body']===''){throw new db[(_0xe25e('0x77'))][(_0xe25e('0x78'))](_0xe25e('0x95'));}if(_[_0xe25e('0x93')](_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x96')])){throw new db['Sequelize'][(_0xe25e('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4fdba1);}if(!_[_0xe25e('0x97')](_0x4fdba1,_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x96')])){throw new db[(_0xe25e('0x77'))][(_0xe25e('0x78'))](_0xe25e('0x98')+_0x4fdba1);}_0x3bb8a5[_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x96')]]=_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')];return db['CmList'][_0xe25e('0x5b')]({'where':{'id':_0x5025fd[_0xe25e('0x72')][_0xe25e('0x7c')]},'include':[{'model':db[_0xe25e('0x99')],'as':_0xe25e('0x9a'),'where':_0x3bb8a5,'limit':0x1,'order':[[_0xe25e('0x9b'),_0xe25e('0x9c')]]}]});})[_0xe25e('0x36')](handleEntityNotFound(_0x4adcc2,null))[_0xe25e('0x36')](function(_0x2e2410){if(_0x2e2410){_0x5025fd[_0xe25e('0x9d')]=_[_0xe25e('0x9e')](_0x2e2410,[_0xe25e('0x9a')]);if(_0x2e2410[_0xe25e('0x9a')][_0xe25e('0x4a')]){return _0x2e2410[_0xe25e('0x9a')][0x0];}var _0x46c527=_[_0xe25e('0x1b')](_0x5025fd[_0xe25e('0x5d')],{'firstName':_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')],'ListId':_0x2e2410['id']});_0x46c527[_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x96')]]=_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')];return db['CmContact'][_0xe25e('0x5c')](_0x46c527,{'fields':_0x5b9d0c,'raw':!![]});}})[_0xe25e('0x36')](handleEntityNotFound(_0x4adcc2,null))[_0xe25e('0x36')](function(_0x2cf389){if(_0x2cf389){_0x5025fd[_0xe25e('0x9f')]=_0x2cf389;var _0x742d7e={'ContactId':_0x2cf389['id'],'phone':_0x5025fd['body'][_0xe25e('0x84')],'SmsAccountId':_0x229db4[_0xe25e('0x58')]['id']};var _0x1943d5={'ContactId':_0x2cf389['id'],'SmsAccountId':_0x229db4[_0xe25e('0x58')]['id'],'closed':![]};return db[_0xe25e('0xa0')][_0xe25e('0x5b')]({'where':_0x1943d5})[_0xe25e('0x36')](function(_0x1e98a2){if(_0x1e98a2){return[_0x1e98a2,![]];}return db[_0xe25e('0xa0')]['create'](_0x742d7e)[_0xe25e('0x36')](function(_0x592afb){return[_0x592afb,!![]];});});}})[_0xe25e('0xa1')](function(_0x38cec6,_0x3372dc){_0x5025fd[_0xe25e('0xa2')]=_0x38cec6[_0xe25e('0x37')]({'plain':!![]});_0x5025fd[_0xe25e('0xa2')][_0xe25e('0xa3')]=![];if(_0x3372dc){if(_0x5025fd[_0xe25e('0x72')][_0xe25e('0xa4')]){_0x5025fd['applications'][_0xe25e('0xa5')]({'id':0x0,'priority':_0x5025fd['applications'][_0xe25e('0x4a')]+0x1,'app':_0xe25e('0xa6'),'appdata':_0xe25e('0xa7'),'interval':_0xe25e('0xa8')});}_0x5025fd[_0xe25e('0xa2')][_0xe25e('0xa3')]=!![];}return db['SmsMessage'][_0xe25e('0x5c')]({'phone':_0x5025fd[_0xe25e('0x5d')][_0xe25e('0x84')],'messageId':_0x5025fd[_0xe25e('0x5d')]['messageId'],'body':_0x5025fd[_0xe25e('0x5d')]['body'],'SmsAccountId':_0x229db4[_0xe25e('0x58')]['id'],'SmsInteractionId':_0x38cec6['id'],'direction':'in','ContactId':_0x38cec6['ContactId'],'AttachmentId':_0x5025fd[_0xe25e('0x5d')][_0xe25e('0xa9')]});})[_0xe25e('0x36')](function(_0x2a9936){_0x5025fd[_0xe25e('0x29')]=_0x2a9936;if(!_0x5025fd[_0xe25e('0xa2')][_0xe25e('0xaa')])return;return db[_0xe25e('0xab')]['find']({'attributes':['id',_0xe25e('0x44')],'where':{'id':_0x5025fd[_0xe25e('0xa2')][_0xe25e('0xaa')]}});})[_0xe25e('0x36')](function(_0x1a2671){if(_0x1a2671){_0x5025fd[_0xe25e('0x73')][_0xe25e('0xac')]({'id':0x0,'priority':0x0,'app':_0xe25e('0xad'),'appdata':_0x1a2671[_0xe25e('0x44')]+','+(_0x5025fd[_0xe25e('0x72')][_0xe25e('0xae')]||0xa),'interval':_0xe25e('0xa8')});}if(!_0x5025fd[_0xe25e('0xa2')][_0xe25e('0xaf')])return;return db[_0xe25e('0xb0')]['find']({'attributes':['id',_0xe25e('0x44')],'where':{'id':_0x5025fd['interaction'][_0xe25e('0xaf')]}});})[_0xe25e('0x36')](function(_0x1f5cac){if(_0x1f5cac){_0x5025fd[_0xe25e('0x73')]['unshift']({'id':0x0,'priority':0x1,'app':_0xe25e('0xb1'),'appdata':_0x1f5cac[_0xe25e('0x44')]+','+(_0x5025fd[_0xe25e('0x72')][_0xe25e('0xb2')]||0x12c),'interval':_0xe25e('0xa8')});}return respondWithRpcPromise('Start','startRouting',_0x5025fd);})['then'](function(_0x372874){if(_0x372874){var _0x5497a5=0xc8;var _0x257877=_0xe25e('0xb3');logger[_0xe25e('0x21')](_0xe25e('0x24'),_0x257877,_0x5497a5,_0xe25e('0xb4'));logger[_0xe25e('0x23')](_0xe25e('0xb5'),_0x257877,_0x5497a5,_0xe25e('0xb4'),JSON['stringify'](_0x372874));if(_0x5025fd[_0xe25e('0x72')][_0xe25e('0x41')]===_0xe25e('0x7e')){return _0x4adcc2['status'](_0x5497a5)[_0xe25e('0xb6')]('Content-Type',_0xe25e('0xb7'))['send'](_0xe25e('0xb8'));}else{return _0x4adcc2[_0xe25e('0x2c')](_0x5497a5)['json'](_0x372874);}}})[_0xe25e('0x57')](handleError(_0x4adcc2,null));};exports[_0xe25e('0xb9')]=function(_0x1843e9,_0x295c82){var _0x77b96f=_0x1843e9[_0xe25e('0x58')]['id'];var _0x8c11ec=_0x1843e9[_0xe25e('0x5d')];var _0x3db867=0xc8;var _0x37e650=null;return db[_0xe25e('0xba')][_0xe25e('0xbb')]({'isolationLevel':db[_0xe25e('0xba')][_0xe25e('0xbc')][_0xe25e('0xbd')]['READ_COMMITTED']},function(_0xf335ac){return db[_0xe25e('0x3e')][_0xe25e('0x66')]({'where':{'id':_0x77b96f},'transaction':_0xf335ac})[_0xe25e('0x36')](function(_0x52e7c8){if(_0x52e7c8){return db['SmsApplication'][_0xe25e('0x35')]({'where':{'SmsAccountId':_0x77b96f},'transaction':_0xf335ac})[_0xe25e('0x36')](function(){var _0x1e7e85=_[_0xe25e('0x3d')](_0x8c11ec,function(_0x3a8925){_0x3a8925[_0xe25e('0x6a')]=_0x77b96f;return _0x3a8925;});return db[_0xe25e('0x70')]['bulkCreate'](_0x1e7e85,{'transaction':_0xf335ac});});}else{_0x3db867=0x194;_0x37e650=[];}});})[_0xe25e('0x36')](function(){if(_0x3db867!==0x194){return db['SmsApplication'][_0xe25e('0xbe')]({'where':{'SmsAccountId':_0x77b96f},'order':_0xe25e('0x75')})[_0xe25e('0x36')](function(_0x2a87e5){_0x37e650=_0x2a87e5;});}})[_0xe25e('0x57')](function(_0xc63a5a){_0x3db867=0x1f4;logger[_0xe25e('0x27')](_0xc63a5a['stack']);if(_0xc63a5a[_0xe25e('0x44')]){delete _0xc63a5a[_0xe25e('0x44')];}_0x37e650=_0xc63a5a;})[_0xe25e('0xbf')](function(){if(_0x37e650===null){_0x295c82[_0xe25e('0x2b')](_0x3db867);}else{if(_0x3db867===0x1f4){_0x295c82[_0xe25e('0x2c')](_0x3db867)['send'](_0x37e650);}else{_0x295c82[_0xe25e('0x2c')](_0x3db867)['json'](_0x37e650);}}});};exports[_0xe25e('0xc0')]=function(_0x1de4b2,_0x216e01,_0x2fba33){var _0x2776c9={};var _0x18dcfc={};var _0x2b2bef;var _0x2146f6;return db['SmsAccount']['findOne']({'where':{'id':_0x1de4b2[_0xe25e('0x58')]['id']}})['then'](handleEntityNotFound(_0x216e01,null))[_0xe25e('0x36')](function(_0x52fd8e){if(_0x52fd8e){_0x2b2bef=_0x52fd8e;_0x18dcfc[_0xe25e('0x43')]=_[_0xe25e('0x46')](db['SmsApplication']['rawAttributes']);_0x18dcfc[_0xe25e('0x45')]=_['keys'](_0x1de4b2['query']);_0x18dcfc[_0xe25e('0x50')]=_['intersection'](_0x18dcfc[_0xe25e('0x43')],_0x18dcfc[_0xe25e('0x45')]);_0x2776c9[_0xe25e('0x48')]=_['intersection'](_0x18dcfc[_0xe25e('0x43')],qs['fields'](_0x1de4b2['query']['fields']));_0x2776c9['attributes']=_0x2776c9['attributes'][_0xe25e('0x4a')]?_0x2776c9['attributes']:_0x18dcfc[_0xe25e('0x43')];_0x2776c9[_0xe25e('0x4d')]=qs[_0xe25e('0x4e')](_0x1de4b2['query']['sort']);_0x2776c9[_0xe25e('0x4f')]=qs[_0xe25e('0x50')](_[_0xe25e('0x51')](_0x1de4b2[_0xe25e('0x45')],_0x18dcfc[_0xe25e('0x50')]));if(_0x1de4b2['query'][_0xe25e('0x52')]){_0x2776c9[_0xe25e('0x4f')]=_['merge'](_0x2776c9[_0xe25e('0x4f')],{'$or':_['map'](_0x2776c9[_0xe25e('0x48')],function(_0x5821b6){var _0x55dae8={};_0x55dae8[_0x5821b6]={'$like':'%'+_0x1de4b2['query']['filter']+'%'};return _0x55dae8;})});}_0x2776c9=_[_0xe25e('0x53')]({},_0x2776c9,_0x1de4b2[_0xe25e('0x54')]);return _0x2b2bef['getApplications'](_0x2776c9);}})[_0xe25e('0x36')](function(_0x267e05){if(_0x267e05){_0x2146f6=_0x267e05[_0xe25e('0x4a')];if(!_0x1de4b2[_0xe25e('0x45')][_0xe25e('0x4b')](_0xe25e('0x4c'))){_0x2776c9['limit']=qs[_0xe25e('0x31')](_0x1de4b2[_0xe25e('0x45')]['limit']);_0x2776c9['offset']=qs[_0xe25e('0x2f')](_0x1de4b2[_0xe25e('0x45')]['offset']);}return _0x2b2bef[_0xe25e('0xc0')](_0x2776c9);}})[_0xe25e('0x36')](function(_0x1a1a6f){if(_0x1a1a6f){return _0x1a1a6f?{'count':_0x2146f6,'rows':_0x1a1a6f}:null;}})[_0xe25e('0x36')](respondWithResult(_0x216e01,null))[_0xe25e('0x57')](handleError(_0x216e01,null));};exports[_0xe25e('0xc1')]=function(_0x266bb3,_0x4b060f,_0x179f89){var _0x2e1cab={'raw':![],'where':{}};var _0xe1c4db={};var _0x596c48={'count':0x0,'rows':[]};return db[_0xe25e('0x3e')][_0xe25e('0x66')]({'where':{'id':_0x266bb3[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x4b060f,null))['then'](function(_0x3491ef){if(_0x3491ef){_0xe1c4db['model']=_[_0xe25e('0x46')](db[_0xe25e('0xa0')]['rawAttributes']);_0xe1c4db[_0xe25e('0x45')]=_[_0xe25e('0x46')](_0x266bb3['query']);_0xe1c4db['filters']=_[_0xe25e('0x47')](_0xe1c4db['model'],_0xe1c4db[_0xe25e('0x45')]);_0x2e1cab[_0xe25e('0x48')]=_['intersection'](_0xe1c4db[_0xe25e('0x43')],qs['fields'](_0x266bb3['query'][_0xe25e('0x49')]));_0x2e1cab[_0xe25e('0x48')]=_0x2e1cab[_0xe25e('0x48')][_0xe25e('0x4a')]?_0x2e1cab[_0xe25e('0x48')]:_0xe1c4db[_0xe25e('0x43')];if(!_0x266bb3['query'][_0xe25e('0x4b')](_0xe25e('0x4c'))){_0x2e1cab[_0xe25e('0x31')]=qs[_0xe25e('0x31')](_0x266bb3[_0xe25e('0x45')][_0xe25e('0x31')]);_0x2e1cab[_0xe25e('0x2f')]=qs['offset'](_0x266bb3[_0xe25e('0x45')]['offset']);}_0x2e1cab['order']=qs['sort'](_0x266bb3[_0xe25e('0x45')][_0xe25e('0x4e')]);_0x2e1cab[_0xe25e('0x4f')]=qs[_0xe25e('0x50')](_[_0xe25e('0x51')](_0x266bb3['query'],_0xe1c4db[_0xe25e('0x50')]));_0x2e1cab[_0xe25e('0x4f')]['SmsAccountId']=_0x3491ef['id'];if(_0x266bb3[_0xe25e('0x45')][_0xe25e('0x52')]){_0x2e1cab['where']=_[_0xe25e('0x53')](_0x2e1cab[_0xe25e('0x4f')],{'$or':_[_0xe25e('0x3d')](_0x2e1cab[_0xe25e('0x48')],function(_0x375735){var _0x3cce77={};_0x3cce77[_0x375735]={'$like':'%'+_0x266bb3[_0xe25e('0x45')][_0xe25e('0x52')]+'%'};return _0x3cce77;})});}_0x2e1cab=_[_0xe25e('0x53')]({},_0x2e1cab,_0x266bb3[_0xe25e('0x54')]);return db[_0xe25e('0xa0')][_0xe25e('0x32')]({'where':_0x2e1cab['where']})[_0xe25e('0x36')](function(_0x171c8f){_0x596c48[_0xe25e('0x32')]=_0x171c8f;if(_0x266bb3['query'][_0xe25e('0x55')]){_0x2e1cab['include']=[{'model':db[_0xe25e('0x99')],'as':_0xe25e('0xc2'),'required':![]},{'model':db[_0xe25e('0xab')],'as':_0xe25e('0xc3'),'attributes':[_0xe25e('0x44'),'fullname',_0xe25e('0xc4')],'required':![]},{'model':db[_0xe25e('0xc5')],'as':_0xe25e('0xc6'),'attributes':['id',_0xe25e('0x44'),_0xe25e('0xc7')],'where':_0x266bb3[_0xe25e('0x45')][_0xe25e('0xc8')]?{'id':_0x266bb3[_0xe25e('0x45')][_0xe25e('0xc8')]}:undefined,'required':_0x266bb3['query'][_0xe25e('0xc8')]?!![]:![]}];}return db['SmsInteraction'][_0xe25e('0x6d')](_0x2e1cab);})['then'](function(_0x441401){_0x596c48[_0xe25e('0x67')]=_0x441401;return _0x596c48;});}})[_0xe25e('0x36')](respondWithFilteredResult(_0x4b060f,_0x2e1cab))[_0xe25e('0x57')](handleError(_0x4b060f,null));};exports[_0xe25e('0x3b')]=function(_0x484993,_0x44f0b2,_0x143664){var _0x12ba10,_0x197af9,_0x4dc78b;if(_[_0xe25e('0x93')](_0x484993['body'][_0xe25e('0x5d')])||_0x484993[_0xe25e('0x5d')]['body']===''){throw new db[(_0xe25e('0x77'))][(_0xe25e('0x78'))](_0xe25e('0x95'));}if(_[_0xe25e('0x93')](_0x484993['body']['to'])){throw new db[(_0xe25e('0x77'))][(_0xe25e('0x78'))](_0xe25e('0xc9'));}_0x12ba10=_0x484993[_0xe25e('0x5d')]['to'];return db[_0xe25e('0x3e')][_0xe25e('0x5b')]({'where':{'id':_0x484993['params']['id']},'include':[{'model':db[_0xe25e('0xca')],'as':'List','include':[{'model':db[_0xe25e('0x99')],'as':_0xe25e('0x9a'),'where':{'mobile':_0x12ba10},'limit':0x1,'order':[[_0xe25e('0x9b'),'DESC']]}]}]})[_0xe25e('0x36')](handleEntityNotFound(_0x44f0b2,null))[_0xe25e('0x36')](function(_0xd0cff2){if(_0xd0cff2&&_0xd0cff2[_0xe25e('0xcb')]){_0x197af9=_0xd0cff2['get']({'plain':!![]});if(_0x197af9['List']&&_0x197af9[_0xe25e('0xcb')][_0xe25e('0x9a')][_0xe25e('0x4a')]){return _0x197af9['List'][_0xe25e('0x9a')][0x0];}return db['CmContact']['create'](_[_0xe25e('0x1b')](_0x484993[_0xe25e('0x5d')],{'firstName':_0x12ba10,'mobile':_0x12ba10,'phone':_0x12ba10,'ListId':_0x197af9[_0xe25e('0x7c')]}));}})[_0xe25e('0x36')](handleEntityNotFound(_0x44f0b2,null))[_0xe25e('0x36')](function(_0x43a746){if(_0x43a746){_0x4dc78b=_0x43a746;return db[_0xe25e('0xa0')][_0xe25e('0x5b')]({'where':{'ContactId':_0x4dc78b['id'],'closed':![],'SmsAccountId':_0x197af9['id']}})[_0xe25e('0x36')](function(_0x30e357){if(_0x30e357){return[_0x30e357,![]];}return db[_0xe25e('0xa0')][_0xe25e('0x5c')]({'UserId':_0x484993[_0xe25e('0x5e')]['id'],'ContactId':_0x4dc78b['id'],'SmsAccountId':_0x197af9['id'],'phone':_0x12ba10,'firstMsgDirection':_0xe25e('0xcc'),'Messages':[_[_0xe25e('0x53')](_0x484993[_0xe25e('0x5d')],{'read':![],'body':_0x484993[_0xe25e('0x5d')][_0xe25e('0x5d')],'phone':_0x12ba10,'SmsAccountId':_0x197af9['id'],'UserId':_0x484993[_0xe25e('0x5e')]['id'],'ContactId':_0x4dc78b['id']})]},{'include':[{'model':db[_0xe25e('0xcd')],'as':'Messages'}]})[_0xe25e('0x36')](function(_0x28a6e3){return[_0x28a6e3,!![]];});});}})[_0xe25e('0xa1')](function(_0x3ca92e,_0x1a4610){if(_0x1a4610){return _0x3ca92e;}return db[_0xe25e('0xcd')]['create'](_[_0xe25e('0x53')](_0x484993[_0xe25e('0x5d')],{'read':![],'body':_0x484993[_0xe25e('0x5d')][_0xe25e('0x5d')],'phone':_0x12ba10,'SmsAccountId':_0x197af9['id'],'SmsInteractionId':_0x3ca92e['id'],'UserId':_0x484993[_0xe25e('0x5e')]['id'],'ContactId':_0x4dc78b['id']}))[_0xe25e('0x36')](function(_0x55c4e7){_0x3ca92e[_0xe25e('0xce')][_0xe25e('0xcf')]=[];_0x3ca92e[_0xe25e('0xce')][_0xe25e('0xcf')][_0xe25e('0xa5')](_0x55c4e7[_0xe25e('0xce')]);return _0x3ca92e;});})[_0xe25e('0x36')](respondWithResult(_0x44f0b2,null))[_0xe25e('0x57')](handleError(_0x44f0b2,null));};exports[_0xe25e('0x2c')]=function(_0x1e9f6d,_0x5071d2,_0x1e6a09){if(_0x1e9f6d['body']['id']){delete _0x1e9f6d['body']['id'];}var _0x15a775,_0x2cd464,_0x574751;return db['SmsAccount']['find']({'where':{'id':_0x1e9f6d[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x5071d2,null))[_0xe25e('0x36')](function(_0x32e69d){if(_0x32e69d){_0x574751=_0x32e69d;logger['debug'](_0xe25e('0x24'),_0xe25e('0x2c'),_0xe25e('0xd0'),_0x32e69d[_0xe25e('0x41')],util[_0xe25e('0xd1')](_0x1e9f6d[_0xe25e('0x5d')],{'showHidden':![],'depth':null}));switch(_0x32e69d['type']){case _0xe25e('0x83'):if(_0x1e9f6d['body'][_0xe25e('0xd2')]&&_0x1e9f6d[_0xe25e('0x5d')]['status']){_0x2cd464=_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x2c')];return db[_0xe25e('0xcd')]['find']({'where':{'messageId':_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0xd2')]}});}break;case _0xe25e('0x87'):if(_0x1e9f6d['body']['requestid']&&_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0xd3')]){_0x2cd464=_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0xd3')];return db['SmsMessage']['find']({'where':{'messageId':_0x1e9f6d['body'][_0xe25e('0xd4')]}});}break;case _0xe25e('0xd5'):if(_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x88')]&&_0x1e9f6d[_0xe25e('0x5d')]['status_code']){_0x2cd464=_0x1e9f6d['body'][_0xe25e('0xd6')];return db[_0xe25e('0xcd')][_0xe25e('0x5b')]({'where':{'messageId':_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x88')]}});}break;case _0xe25e('0xd7'):var _0x5a4e71=_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x8c')][0x0];if(_0x5a4e71[_0xe25e('0x81')]&&_0x5a4e71[_0xe25e('0x2c')][_0xe25e('0xd8')]===_0xe25e('0xd9')){_0x2cd464=_0x5a4e71[_0xe25e('0x2c')][_0xe25e('0xd8')];return db[_0xe25e('0xcd')]['find']({'where':{'messageId':_0x5a4e71[_0xe25e('0x81')]}});}break;case _0xe25e('0x90'):if(_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x81')]&&_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x2c')]){_0x2cd464=_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x2c')];return db[_0xe25e('0xcd')][_0xe25e('0x5b')]({'where':{'messageId':_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x81')]}});}break;case _0xe25e('0x91'):if(_0x1e9f6d[_0xe25e('0x5d')][0x0]['message']['id']){_0x2cd464=_0x1e9f6d[_0xe25e('0x5d')][0x0][_0xe25e('0x41')];return db[_0xe25e('0xcd')][_0xe25e('0x5b')]({'where':{'messageId':_0x1e9f6d[_0xe25e('0x5d')][0x0][_0xe25e('0x29')]['id']}});}break;case _0xe25e('0xda'):if(_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0xdb')]&&_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0x2c')]){_0x2cd464=_0x1e9f6d['body'][_0xe25e('0x2c')];return db['SmsMessage'][_0xe25e('0x5b')]({'where':{'messageId':_0x1e9f6d[_0xe25e('0x5d')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x5071d2,null))['then'](function(_0x305596){if(_0x305596){_0x15a775=_0x305596;switch(_0x574751['type']){case _0xe25e('0x83'):if(_0x2cd464===_0xe25e('0xd9')){return _0x15a775[_0xe25e('0x62')]({'read':!![]});}else{logger[_0xe25e('0x27')](_0xe25e('0x24'),_0xe25e('0x2c'),_0xe25e('0x83'),util['inspect'](_0x1e9f6d[_0xe25e('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xe25e('0x87'):if(_0x2cd464==='1'){return _0x15a775['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe25e('0x83'),util[_0xe25e('0xd1')](_0x1e9f6d[_0xe25e('0x5d')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1e9f6d[_0xe25e('0x5d')][_0xe25e('0xdc')]&&_0x2cd464>=0xc8&&_0x2cd464<=0xce){return _0x15a775['update']({'read':!![]});}else{logger[_0xe25e('0x27')](_0xe25e('0x24'),_0xe25e('0x2c'),_0xe25e('0xd5'),util[_0xe25e('0xd1')](_0x1e9f6d['body'],{'showHidden':![],'depth':null}));}break;case _0xe25e('0xd7'):var _0x1f1d93=_0x1e9f6d['body']['results'][0x0];if(_0x1f1d93[_0xe25e('0x2c')][_0xe25e('0xd8')]===_0xe25e('0xd9')){return _0x15a775['update']({'read':!![]});}else{logger[_0xe25e('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe25e('0x2c'),_0xe25e('0xd7'),util[_0xe25e('0xd1')](_0x1e9f6d['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2cd464==_0xe25e('0xdd')||_0x2cd464=='RECEIVED_BY_RECIPIENT'){return _0x15a775[_0xe25e('0x62')]({'read':!![]});}else{logger['error'](_0xe25e('0x24'),'status','clickatell',util[_0xe25e('0xd1')](_0x1e9f6d['body'],{'showHidden':![],'depth':null}));}break;case _0xe25e('0x91'):if(_0x2cd464==_0xe25e('0xde')){return _0x15a775['update']({'read':!![]});}else{logger[_0xe25e('0x27')](_0xe25e('0x24'),'status',_0xe25e('0x91'),util[_0xe25e('0xd1')](_0x1e9f6d[_0xe25e('0x5d')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2cd464==='DELIVRD'||_0x2cd464===_0xe25e('0xdf')){return _0x15a775['update']({'read':!![]});}else{logger['error'](_0xe25e('0x24'),_0xe25e('0x2c'),_0xe25e('0xda'),util[_0xe25e('0xd1')](_0x1e9f6d[_0xe25e('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x15a775;}})[_0xe25e('0x36')](respondWithResult(_0x5071d2,null))[_0xe25e('0x57')](handleError(_0x5071d2,null));};exports[_0xe25e('0xe0')]=function(_0x52dc7d,_0x17406d,_0x4fe6d3){var _0x2562ae,_0x3becde,_0x437a92;return db['SmsAccount'][_0xe25e('0x5b')]({'where':{'id':_0x52dc7d[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x17406d,null))[_0xe25e('0x36')](function(_0x55c893){if(_0x55c893){_0x437a92=_0x55c893;logger[_0xe25e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe25e('0x2c'),_0xe25e('0xd0'),_0x55c893[_0xe25e('0x41')],util['inspect'](_0x52dc7d['query'],{'showHidden':![],'depth':null}));switch(_0x55c893[_0xe25e('0x41')]){case _0xe25e('0x8d'):if(_0x52dc7d['query'][_0xe25e('0xe1')]&&_0x52dc7d['query'][_0xe25e('0xe2')]){_0x3becde=_0x52dc7d[_0xe25e('0x45')][_0xe25e('0xe2')];return db[_0xe25e('0xcd')][_0xe25e('0x5b')]({'where':{'messageId':_0x52dc7d[_0xe25e('0x45')]['message-id']}});}break;}}})[_0xe25e('0x36')](handleEntityNotFound(_0x17406d,null))[_0xe25e('0x36')](function(_0x2a2a0f){if(_0x2a2a0f){_0x2562ae=_0x2a2a0f;switch(_0x437a92[_0xe25e('0x41')]){case _0xe25e('0x8d'):if(_0x3becde==='2'||_0x3becde==='6'){return _0x2562ae['update']({'read':!![]});}else{logger[_0xe25e('0x27')](_0xe25e('0x24'),_0xe25e('0x2c'),_0xe25e('0x8d'),util[_0xe25e('0xd1')](_0x52dc7d[_0xe25e('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x2562ae;}})[_0xe25e('0x36')](respondWithResult(_0x17406d,null))[_0xe25e('0x57')](handleError(_0x17406d,null));};exports[_0xe25e('0xe3')]=function(_0x59f910,_0x4311f8,_0x1a0e6b){return db['SmsAccount'][_0xe25e('0x5b')]({'where':{'id':_0x59f910[_0xe25e('0x58')]['id']}})['then'](handleEntityNotFound(_0x4311f8,null))[_0xe25e('0x36')](function(_0x4e7182){if(_0x4e7182){return _0x4e7182[_0xe25e('0xe3')](_0x59f910[_0xe25e('0x5d')]['ids'],_[_0xe25e('0x9e')](_0x59f910[_0xe25e('0x5d')],[_0xe25e('0x69'),'id'])||{})[_0xe25e('0xa1')](function(_0xdc43a4){for(var _0x74eab4=0x0;_0x74eab4<_0x59f910[_0xe25e('0x5d')][_0xe25e('0x69')][_0xe25e('0x4a')];_0x74eab4+=0x1){socket['emit'](_0xe25e('0xe4'),{'UserId':Number(_0x59f910[_0xe25e('0x5d')][_0xe25e('0x69')][_0x74eab4]),'SmsAccountId':Number(_0x59f910[_0xe25e('0x58')]['id'])});}return _0xdc43a4;});}})[_0xe25e('0x36')](respondWithResult(_0x4311f8,null))['catch'](handleError(_0x4311f8,null));};exports[_0xe25e('0xe5')]=function(_0x5c486e,_0x2417f7,_0x523e9e){return db['SmsAccount'][_0xe25e('0x5b')]({'where':{'id':_0x5c486e[_0xe25e('0x58')]['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0x2417f7,null))[_0xe25e('0x36')](function(_0x525d18){if(_0x525d18){return _0x525d18['removeAgents'](_0x5c486e['query']['ids'])[_0xe25e('0x36')](function(){if(_[_0xe25e('0xe6')](_0x5c486e[_0xe25e('0x45')][_0xe25e('0x69')])){for(var _0x15b150=0x0;_0x15b150<_0x5c486e[_0xe25e('0x45')][_0xe25e('0x69')][_0xe25e('0x4a')];_0x15b150+=0x1){socket['emit'](_0xe25e('0xe7'),{'UserId':Number(_0x5c486e[_0xe25e('0x45')][_0xe25e('0x69')][_0x15b150]),'SmsAccountId':Number(_0x5c486e[_0xe25e('0x58')]['id'])});}}else{socket['emit'](_0xe25e('0xe7'),{'UserId':Number(_0x5c486e[_0xe25e('0x45')]['ids']),'SmsAccountId':Number(_0x5c486e['params']['id'])});}});}})[_0xe25e('0x36')](respondWithStatusCode(_0x2417f7,null))[_0xe25e('0x57')](handleError(_0x2417f7,null));};exports[_0xe25e('0xe8')]=function(_0x1cafec,_0xd57c2b,_0x9812){var _0x15ac32={};var _0x5361af={};var _0x3eb632;var _0x5d1bf2;return db[_0xe25e('0x3e')][_0xe25e('0x66')]({'where':{'id':_0x1cafec['params']['id']}})[_0xe25e('0x36')](handleEntityNotFound(_0xd57c2b,null))[_0xe25e('0x36')](function(_0x4a2099){if(_0x4a2099){_0x3eb632=_0x4a2099;_0x5361af[_0xe25e('0x43')]=_[_0xe25e('0x46')](db['User'][_0xe25e('0x3f')]);_0x5361af['query']=_[_0xe25e('0x46')](_0x1cafec['query']);_0x5361af[_0xe25e('0x50')]=_[_0xe25e('0x47')](_0x5361af[_0xe25e('0x43')],_0x5361af['query']);_0x15ac32['attributes']=_[_0xe25e('0x47')](_0x5361af[_0xe25e('0x43')],qs[_0xe25e('0x49')](_0x1cafec[_0xe25e('0x45')][_0xe25e('0x49')]));_0x15ac32[_0xe25e('0x48')]=_0x15ac32[_0xe25e('0x48')][_0xe25e('0x4a')]?_0x15ac32['attributes']:_0x5361af['model'];_0x15ac32['order']=qs[_0xe25e('0x4e')](_0x1cafec[_0xe25e('0x45')]['sort']);_0x15ac32[_0xe25e('0x4f')]=qs[_0xe25e('0x50')](_[_0xe25e('0x51')](_0x1cafec[_0xe25e('0x45')],_0x5361af[_0xe25e('0x50')]));if(_0x1cafec[_0xe25e('0x45')][_0xe25e('0x52')]){_0x15ac32[_0xe25e('0x4f')]=_[_0xe25e('0x53')](_0x15ac32[_0xe25e('0x4f')],{'$or':_[_0xe25e('0x3d')](_0x15ac32['attributes'],function(_0x5a6099){var _0x4a4cda={};_0x4a4cda[_0x5a6099]={'$like':'%'+_0x1cafec['query'][_0xe25e('0x52')]+'%'};return _0x4a4cda;})});}_0x15ac32=_[_0xe25e('0x53')]({},_0x15ac32,_0x1cafec['options']);return _0x3eb632[_0xe25e('0xe8')](_0x15ac32);}})[_0xe25e('0x36')](function(_0x30c4bb){if(_0x30c4bb){_0x5d1bf2=_0x30c4bb[_0xe25e('0x4a')];if(!_0x1cafec[_0xe25e('0x45')]['hasOwnProperty'](_0xe25e('0x4c'))){_0x15ac32[_0xe25e('0x31')]=qs['limit'](_0x1cafec[_0xe25e('0x45')][_0xe25e('0x31')]);_0x15ac32[_0xe25e('0x2f')]=qs[_0xe25e('0x2f')](_0x1cafec[_0xe25e('0x45')][_0xe25e('0x2f')]);}return _0x3eb632[_0xe25e('0xe8')](_0x15ac32);}})[_0xe25e('0x36')](function(_0x23c8e8){if(_0x23c8e8){return _0x23c8e8?{'count':_0x5d1bf2,'rows':_0x23c8e8}:null;}})[_0xe25e('0x36')](respondWithResult(_0xd57c2b,null))[_0xe25e('0x57')](handleError(_0xd57c2b,null));}; \ No newline at end of file +var _0x57af=['describe','SmsAccountId','Disposition','getDispositions','findOne','nolimit','includeAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','account','orderBy','priority','asc','Applications','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','Body','MessageSid','skebby','from','connectel','clicksend','message_id','plivo','Text','messageId','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','omit','Contacts','contact','SmsInteraction','spread','created','autoclose','applications','push','close','*,*,*,*','interaction','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Owner','fullname','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','groupName','DELIVERED','clickatell','bandwidth','redif','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','destroy','get','SmsAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','type','model','query','keys','intersection','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','params','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x283196,_0x36bfc4){var _0x56980e=function(_0x441c24){while(--_0x441c24){_0x283196['push'](_0x283196['shift']());}};_0x56980e(++_0x36bfc4);}(_0x57af,0x81));var _0xf57a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x57af[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0xf57a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf57a('0x1'));var moment=require(_0xf57a('0x2'));var BPromise=require(_0xf57a('0x3'));var Mustache=require(_0xf57a('0x4'));var util=require(_0xf57a('0x5'));var path=require(_0xf57a('0x6'));var sox=require(_0xf57a('0x7'));var csv=require(_0xf57a('0x8'));var ejs=require(_0xf57a('0x9'));var fs=require('fs');var fs_extra=require(_0xf57a('0xa'));var _=require(_0xf57a('0xb'));var squel=require(_0xf57a('0xc'));var crypto=require(_0xf57a('0xd'));var jsforce=require(_0xf57a('0xe'));var deskjs=require(_0xf57a('0xf'));var toCsv=require(_0xf57a('0x8'));var querystring=require('querystring');var Papa=require(_0xf57a('0x10'));var Redis=require(_0xf57a('0x11'));var authService=require(_0xf57a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf57a('0x13'));var logger=require('../../config/logger')(_0xf57a('0x14'));var utils=require(_0xf57a('0x15'));var config=require(_0xf57a('0x16'));var licenseUtil=require(_0xf57a('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf57a('0x18')](config[_0xf57a('0x19')],{'host':_0xf57a('0x1a'),'port':0x18eb});var socket=require(_0xf57a('0x1b'))(new Redis(config[_0xf57a('0x19')]));require(_0xf57a('0x1c'))[_0xf57a('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf57a('0x1e')][_0xf57a('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x14905e,_0x766cfe,_0x4b6832,_0xbc8bba){return new BPromise(function(_0x31be47,_0x413278){var _0x501bd6=_0xbc8bba||client;return _0x501bd6[_0xf57a('0x20')](_0x14905e,_0x4b6832)[_0xf57a('0x21')](function(_0x470f6e){logger[_0xf57a('0x22')](_0xf57a('0x23'),_0x766cfe,'request\x20sent');logger[_0xf57a('0x24')](_0xf57a('0x25'),_0x766cfe,_0xf57a('0x26'),JSON[_0xf57a('0x27')](_0x470f6e));if(_0x470f6e[_0xf57a('0x28')]){if(_0x470f6e[_0xf57a('0x28')][_0xf57a('0x29')]===0x1f4){logger[_0xf57a('0x28')](_0xf57a('0x23'),_0x766cfe,_0x470f6e[_0xf57a('0x28')][_0xf57a('0x2a')]);return _0x413278(_0x470f6e[_0xf57a('0x28')]['message']);}logger['error'](_0xf57a('0x23'),_0x766cfe,_0x470f6e[_0xf57a('0x28')][_0xf57a('0x2a')]);return _0x31be47(_0x470f6e[_0xf57a('0x28')][_0xf57a('0x2a')]);}else{logger[_0xf57a('0x22')]('SmsAccount,\x20%s,\x20%s',_0x766cfe,_0xf57a('0x26'));_0x31be47(_0x470f6e['result'][_0xf57a('0x2a')]);}})[_0xf57a('0x2b')](function(_0x303f4e){logger[_0xf57a('0x28')](_0xf57a('0x23'),_0x766cfe,_0x303f4e);_0x413278(_0x303f4e);});});}function respondWithStatusCode(_0x3f5b5c,_0x34d34f){_0x34d34f=_0x34d34f||0xcc;return function(_0x1618e3){if(_0x1618e3){return _0x3f5b5c[_0xf57a('0x2c')](_0x34d34f);}return _0x3f5b5c[_0xf57a('0x2d')](_0x34d34f)[_0xf57a('0x2e')]();};}function respondWithResult(_0x20b172,_0x2619cc){_0x2619cc=_0x2619cc||0xc8;return function(_0x1aac89){if(_0x1aac89){return _0x20b172[_0xf57a('0x2d')](_0x2619cc)[_0xf57a('0x2f')](_0x1aac89);}};}function respondWithFilteredResult(_0x1f3246,_0x2b350c){return function(_0x4b3b34){if(_0x4b3b34){var _0x34a433=typeof _0x2b350c['offset']===_0xf57a('0x30')&&typeof _0x2b350c[_0xf57a('0x31')]===_0xf57a('0x30');var _0x28b1fc=_0x4b3b34[_0xf57a('0x32')];var _0x1ce3e4=_0x34a433?0x0:_0x2b350c[_0xf57a('0x33')];var _0x48d34c=_0x34a433?_0x4b3b34[_0xf57a('0x32')]:_0x2b350c['offset']+_0x2b350c[_0xf57a('0x31')];var _0x50a8f9;if(_0x48d34c>=_0x28b1fc){_0x48d34c=_0x28b1fc;_0x50a8f9=0xc8;}else{_0x50a8f9=0xce;}_0x1f3246[_0xf57a('0x2d')](_0x50a8f9);return _0x1f3246[_0xf57a('0x34')]('Content-Range',_0x1ce3e4+'-'+_0x48d34c+'/'+_0x28b1fc)['json'](_0x4b3b34);}return null;};}function patchUpdates(_0x35ece3){return function(_0xb410ad){try{jsonpatch[_0xf57a('0x35')](_0xb410ad,_0x35ece3,!![]);}catch(_0x22352d){return BPromise['reject'](_0x22352d);}return _0xb410ad[_0xf57a('0x36')]();};}function saveUpdates(_0xd8a281,_0x24acd2){return function(_0x476a4e){if(_0x476a4e){return _0x476a4e['update'](_0xd8a281)[_0xf57a('0x21')](function(_0x341d7b){return _0x341d7b;});}return null;};}function removeEntity(_0x43fa14,_0x31e289){return function(_0x2dd168){if(_0x2dd168){return _0x2dd168[_0xf57a('0x37')]()['then'](function(){var _0x5e3296=_0x2dd168[_0xf57a('0x38')]({'plain':!![]});var _0x1f3175=_0xf57a('0x39');return db[_0xf57a('0x3a')][_0xf57a('0x37')]({'where':{'type':_0x1f3175,'resourceId':_0x5e3296['id']}})[_0xf57a('0x21')](function(){return _0x2dd168;});})[_0xf57a('0x21')](function(){_0x43fa14['status'](0xcc)[_0xf57a('0x2e')]();});}};}function handleEntityNotFound(_0x274ad0,_0x1a4245){return function(_0x47e04b){if(!_0x47e04b){_0x274ad0[_0xf57a('0x2c')](0x194);}return _0x47e04b;};}function handleError(_0x134eb0,_0xbbdd2e){_0xbbdd2e=_0xbbdd2e||0x1f4;return function(_0x2eac11){logger[_0xf57a('0x28')](_0x2eac11['stack']);if(_0x2eac11[_0xf57a('0x3b')]){delete _0x2eac11[_0xf57a('0x3b')];}_0x134eb0[_0xf57a('0x2d')](_0xbbdd2e)[_0xf57a('0x3c')](_0x2eac11);};}exports[_0xf57a('0x3d')]=function(_0x52bf3b,_0x3afeac){var _0x803bec={'include':[{'model':db[_0xf57a('0x3e')],'as':_0xf57a('0x3f')}]},_0x38b1b4={},_0x2739eb={'count':0x0,'rows':[]};var _0x4a6589=_[_0xf57a('0x40')](db[_0xf57a('0x41')]['rawAttributes'],function(_0x48fdf2){return{'name':_0x48fdf2['fieldName'],'type':_0x48fdf2[_0xf57a('0x42')]['key']};});_0x38b1b4[_0xf57a('0x43')]=_[_0xf57a('0x40')](_0x4a6589,_0xf57a('0x3b'));_0x38b1b4[_0xf57a('0x44')]=_[_0xf57a('0x45')](_0x52bf3b['query']);_0x38b1b4['filters']=_[_0xf57a('0x46')](_0x38b1b4[_0xf57a('0x43')],_0x38b1b4[_0xf57a('0x44')]);_0x803bec[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x38b1b4[_0xf57a('0x43')],qs['fields'](_0x52bf3b[_0xf57a('0x44')]['fields']));_0x803bec['attributes']=_0x803bec[_0xf57a('0x47')]['length']?_0x803bec[_0xf57a('0x47')]:_0x38b1b4[_0xf57a('0x43')];if(!_0x52bf3b[_0xf57a('0x44')][_0xf57a('0x48')]('nolimit')){_0x803bec[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x52bf3b[_0xf57a('0x44')]['limit']);_0x803bec['offset']=qs['offset'](_0x52bf3b[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x803bec[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x52bf3b[_0xf57a('0x44')][_0xf57a('0x4a')]);_0x803bec[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x52bf3b[_0xf57a('0x44')],_0x38b1b4['filters']),_0x4a6589);if(_0x52bf3b[_0xf57a('0x44')]['filter']){_0x803bec[_0xf57a('0x4b')]=_['merge'](_0x803bec[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x4a6589,function(_0x48bfb5){if(_0x48bfb5[_0xf57a('0x42')]!=='VIRTUAL'){var _0x54d06a={};_0x54d06a[_0x48bfb5[_0xf57a('0x3b')]]={'$like':'%'+_0x52bf3b['query'][_0xf57a('0x4e')]+'%'};return _0x54d06a;}})});}_0x803bec=_[_0xf57a('0x4f')]({},_0x803bec,_0x52bf3b[_0xf57a('0x50')]);var _0x25b9ac={'where':_0x803bec[_0xf57a('0x4b')]};return db[_0xf57a('0x41')][_0xf57a('0x32')](_0x25b9ac)[_0xf57a('0x21')](function(_0x3269bc){_0x2739eb[_0xf57a('0x32')]=_0x3269bc;if(_0x52bf3b['query']['includeAll']){_0x803bec[_0xf57a('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0xf57a('0x52')](_0x803bec);})[_0xf57a('0x21')](function(_0x39f9b4){_0x2739eb[_0xf57a('0x53')]=_0x39f9b4;return _0x2739eb;})['then'](respondWithFilteredResult(_0x3afeac,_0x803bec))['catch'](handleError(_0x3afeac,null));};exports['show']=function(_0x2c24e0,_0x569e99){var _0x467ac6={'raw':![],'where':{'id':_0x2c24e0[_0xf57a('0x54')]['id']},'include':[{'model':db[_0xf57a('0x3e')],'as':_0xf57a('0x3f')}]},_0xc2ad0c={};_0xc2ad0c[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0x41')][_0xf57a('0x55')]);_0xc2ad0c[_0xf57a('0x44')]=_['keys'](_0x2c24e0[_0xf57a('0x44')]);_0xc2ad0c[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0xc2ad0c[_0xf57a('0x43')],_0xc2ad0c[_0xf57a('0x44')]);_0x467ac6[_0xf57a('0x47')]=_['intersection'](_0xc2ad0c[_0xf57a('0x43')],qs['fields'](_0x2c24e0[_0xf57a('0x44')][_0xf57a('0x56')]));_0x467ac6['attributes']=_0x467ac6[_0xf57a('0x47')][_0xf57a('0x57')]?_0x467ac6[_0xf57a('0x47')]:_0xc2ad0c[_0xf57a('0x43')];if(_0x2c24e0[_0xf57a('0x44')]['includeAll']){_0x467ac6[_0xf57a('0x51')]=[{'all':!![]}];}_0x467ac6=_[_0xf57a('0x4f')]({},_0x467ac6,_0x2c24e0[_0xf57a('0x50')]);return db[_0xf57a('0x41')][_0xf57a('0x58')](_0x467ac6)[_0xf57a('0x21')](handleEntityNotFound(_0x569e99,null))[_0xf57a('0x21')](respondWithResult(_0x569e99,null))[_0xf57a('0x2b')](handleError(_0x569e99,null));};exports['create']=function(_0x121c59,_0x55602f){return db[_0xf57a('0x41')][_0xf57a('0x59')](_0x121c59[_0xf57a('0x5a')],{})[_0xf57a('0x21')](function(_0x386a2c){var _0x269cc0=_0x121c59[_0xf57a('0x5b')][_0xf57a('0x38')]({'plain':!![]});if(!_0x269cc0)throw new Error(_0xf57a('0x5c'));if(_0x269cc0[_0xf57a('0x5d')]===_0xf57a('0x5b')){var _0x31cfe5=_0x386a2c[_0xf57a('0x38')]({'plain':!![]});var _0x369bc6=_0xf57a('0x39');return db[_0xf57a('0x5e')][_0xf57a('0x58')]({'where':{'name':_0x369bc6,'userProfileId':_0x269cc0[_0xf57a('0x5f')]},'raw':!![]})[_0xf57a('0x21')](function(_0x139490){if(_0x139490&&_0x139490[_0xf57a('0x60')]===0x0){return db[_0xf57a('0x3a')]['create']({'name':_0x31cfe5[_0xf57a('0x3b')],'resourceId':_0x31cfe5['id'],'type':_0x139490[_0xf57a('0x3b')],'sectionId':_0x139490['id']},{})[_0xf57a('0x21')](function(){return _0x386a2c;});}else{return _0x386a2c;}})['catch'](function(_0x1f4b7a){logger[_0xf57a('0x28')](_0xf57a('0x61'),_0x1f4b7a);throw _0x1f4b7a;});}return _0x386a2c;})[_0xf57a('0x21')](respondWithResult(_0x55602f,0xc9))[_0xf57a('0x2b')](handleError(_0x55602f,null));};exports[_0xf57a('0x62')]=function(_0x402a63,_0x192c99){if(_0x402a63[_0xf57a('0x5a')]['id']){delete _0x402a63[_0xf57a('0x5a')]['id'];}return db[_0xf57a('0x41')]['find']({'where':{'id':_0x402a63[_0xf57a('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xf57a('0x3f')}]})[_0xf57a('0x21')](handleEntityNotFound(_0x192c99,null))['then'](saveUpdates(_0x402a63[_0xf57a('0x5a')],null))['then'](respondWithResult(_0x192c99,null))[_0xf57a('0x2b')](handleError(_0x192c99,null));};exports[_0xf57a('0x37')]=function(_0x22d388,_0x444bf2){return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x22d388[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x444bf2,null))[_0xf57a('0x21')](removeEntity(_0x444bf2,null))['catch'](handleError(_0x444bf2,null));};exports[_0xf57a('0x63')]=function(_0x3e2c7d,_0x45a3b2){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x45a3b2,null))[_0xf57a('0x2b')](handleError(_0x45a3b2,null));};exports['addDisposition']=function(_0x3eb83f,_0x2e0aa2,_0x230758){if(_0x3eb83f[_0xf57a('0x5a')]['id']){delete _0x3eb83f[_0xf57a('0x5a')]['id'];}return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x3eb83f[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2e0aa2,null))[_0xf57a('0x21')](function(_0x840ea){if(_0x840ea){_0x3eb83f['body'][_0xf57a('0x64')]=_0x840ea['id'];return db[_0xf57a('0x65')][_0xf57a('0x59')](_0x3eb83f[_0xf57a('0x5a')]);}})[_0xf57a('0x21')](respondWithResult(_0x2e0aa2,null))[_0xf57a('0x2b')](handleError(_0x2e0aa2,null));};exports[_0xf57a('0x66')]=function(_0x165040,_0x2be1ad,_0x3bb8d9){var _0x3ebc04={'raw':![],'where':{}};var _0x2fb0d1={};var _0x27d8f6={'count':0x0,'rows':[]};return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x165040['params']['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2be1ad,null))[_0xf57a('0x21')](function(_0x57de7c){if(_0x57de7c){_0x2fb0d1[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0x65')][_0xf57a('0x55')]);_0x2fb0d1['query']=_[_0xf57a('0x45')](_0x165040['query']);_0x2fb0d1[_0xf57a('0x4c')]=_['intersection'](_0x2fb0d1['model'],_0x2fb0d1[_0xf57a('0x44')]);_0x3ebc04[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x2fb0d1[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x165040['query'][_0xf57a('0x56')]));_0x3ebc04['attributes']=_0x3ebc04['attributes'][_0xf57a('0x57')]?_0x3ebc04['attributes']:_0x2fb0d1['model'];if(!_0x165040[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x3ebc04[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x165040['query'][_0xf57a('0x31')]);_0x3ebc04[_0xf57a('0x33')]=qs[_0xf57a('0x33')](_0x165040[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x3ebc04[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x165040[_0xf57a('0x44')][_0xf57a('0x4a')]);_0x3ebc04['where']=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x165040[_0xf57a('0x44')],_0x2fb0d1[_0xf57a('0x4c')]));_0x3ebc04['where'][_0xf57a('0x64')]=_0x57de7c['id'];if(_0x165040[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x3ebc04['where']=_[_0xf57a('0x4f')](_0x3ebc04[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x3ebc04[_0xf57a('0x47')],function(_0x32123f){var _0x5610c8={};_0x5610c8[_0x32123f]={'$like':'%'+_0x165040['query']['filter']+'%'};return _0x5610c8;})});}_0x3ebc04=_[_0xf57a('0x4f')]({},_0x3ebc04,_0x165040[_0xf57a('0x50')]);return db['Disposition'][_0xf57a('0x32')]({'where':_0x3ebc04[_0xf57a('0x4b')]})[_0xf57a('0x21')](function(_0x4e5f69){_0x27d8f6[_0xf57a('0x32')]=_0x4e5f69;if(_0x165040[_0xf57a('0x44')][_0xf57a('0x69')]){_0x3ebc04[_0xf57a('0x51')]=[{'all':!![]}];}return db[_0xf57a('0x65')][_0xf57a('0x52')](_0x3ebc04);})['then'](function(_0x5a754f){_0x27d8f6[_0xf57a('0x53')]=_0x5a754f;return _0x27d8f6;});}})[_0xf57a('0x21')](respondWithFilteredResult(_0x2be1ad,_0x3ebc04))[_0xf57a('0x2b')](handleError(_0x2be1ad,null));};exports[_0xf57a('0x6a')]=function(_0x4df9c7,_0x359725,_0x29052e){return db['SmsAccount'][_0xf57a('0x58')]({'where':{'id':_0x4df9c7[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x359725,null))[_0xf57a('0x21')](function(_0x54d449){if(_0x54d449){return _0x54d449['removeDispositions'](_0x4df9c7[_0xf57a('0x44')][_0xf57a('0x6b')]);}})['then'](respondWithStatusCode(_0x359725,null))[_0xf57a('0x2b')](handleError(_0x359725,null));};exports['addAnswer']=function(_0x80b262,_0x3fe708,_0x2029be){if(_0x80b262[_0xf57a('0x5a')]['id']){delete _0x80b262[_0xf57a('0x5a')]['id'];}return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x80b262[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x3fe708,null))[_0xf57a('0x21')](function(_0x50591a){if(_0x50591a){_0x80b262['body'][_0xf57a('0x64')]=_0x50591a['id'];return db['CannedAnswer'][_0xf57a('0x59')](_0x80b262[_0xf57a('0x5a')]);}})['then'](respondWithResult(_0x3fe708,null))['catch'](handleError(_0x3fe708,null));};exports[_0xf57a('0x6c')]=function(_0x20f25e,_0x2eba8d,_0x413af0){var _0x5943c1={'raw':![],'where':{}};var _0x21880b={};var _0x1f55b3={'count':0x0,'rows':[]};return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x20f25e[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2eba8d,null))[_0xf57a('0x21')](function(_0x87fec3){if(_0x87fec3){_0x21880b[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0x6d')][_0xf57a('0x55')]);_0x21880b[_0xf57a('0x44')]=_[_0xf57a('0x45')](_0x20f25e[_0xf57a('0x44')]);_0x21880b[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x21880b[_0xf57a('0x43')],_0x21880b[_0xf57a('0x44')]);_0x5943c1[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x21880b[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x20f25e[_0xf57a('0x44')][_0xf57a('0x56')]));_0x5943c1[_0xf57a('0x47')]=_0x5943c1[_0xf57a('0x47')]['length']?_0x5943c1[_0xf57a('0x47')]:_0x21880b['model'];if(!_0x20f25e[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x5943c1['limit']=qs[_0xf57a('0x31')](_0x20f25e[_0xf57a('0x44')][_0xf57a('0x31')]);_0x5943c1[_0xf57a('0x33')]=qs[_0xf57a('0x33')](_0x20f25e[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x5943c1['order']=qs[_0xf57a('0x4a')](_0x20f25e[_0xf57a('0x44')]['sort']);_0x5943c1[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x20f25e[_0xf57a('0x44')],_0x21880b[_0xf57a('0x4c')]));_0x5943c1['where'][_0xf57a('0x64')]=_0x87fec3['id'];if(_0x20f25e[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x5943c1[_0xf57a('0x4b')]=_[_0xf57a('0x4f')](_0x5943c1[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x5943c1[_0xf57a('0x47')],function(_0x18a729){var _0x5662fd={};_0x5662fd[_0x18a729]={'$like':'%'+_0x20f25e[_0xf57a('0x44')][_0xf57a('0x4e')]+'%'};return _0x5662fd;})});}_0x5943c1=_[_0xf57a('0x4f')]({},_0x5943c1,_0x20f25e['options']);return db['CannedAnswer'][_0xf57a('0x32')]({'where':_0x5943c1[_0xf57a('0x4b')]})[_0xf57a('0x21')](function(_0x216733){_0x1f55b3[_0xf57a('0x32')]=_0x216733;if(_0x20f25e[_0xf57a('0x44')][_0xf57a('0x69')]){_0x5943c1[_0xf57a('0x51')]=[{'all':!![]}];}return db[_0xf57a('0x6d')][_0xf57a('0x52')](_0x5943c1);})[_0xf57a('0x21')](function(_0x447fdb){_0x1f55b3[_0xf57a('0x53')]=_0x447fdb;return _0x1f55b3;});}})[_0xf57a('0x21')](respondWithFilteredResult(_0x2eba8d,_0x5943c1))[_0xf57a('0x2b')](handleError(_0x2eba8d,null));};exports[_0xf57a('0x6e')]=function(_0x1cf752,_0x95249b,_0x44f885){return db[_0xf57a('0x41')]['find']({'where':{'id':_0x1cf752['params']['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x95249b,null))[_0xf57a('0x21')](function(_0x39fb47){if(_0x39fb47){return _0x39fb47[_0xf57a('0x6e')](_0x1cf752[_0xf57a('0x44')]['ids']);}})[_0xf57a('0x21')](respondWithStatusCode(_0x95249b,null))['catch'](handleError(_0x95249b,null));};exports['notify']=function(_0x25d924,_0x47e40d,_0x26060d){var _0x2590d4={'channel':'sms'};var _0x2e2d2d=[];var _0x63783=[];var _0x271a54={};return db['SmsAccount'][_0xf57a('0x58')]({'where':{'id':_0x25d924[_0xf57a('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0xf57a('0x21')](handleEntityNotFound(_0x47e40d,null))[_0xf57a('0x21')](function(_0x134de8){_0x2590d4[_0xf57a('0x6f')]=_0x134de8;_0x2590d4['applications']=_[_0xf57a('0x70')](_0x134de8['Applications'],[_0xf57a('0x71')],[_0xf57a('0x72')]);if(_0x2590d4['account'][_0xf57a('0x73')]){delete _0x2590d4[_0xf57a('0x6f')][_0xf57a('0x73')];}return db[_0xf57a('0x74')][_0xf57a('0x63')]();})[_0xf57a('0x21')](function(_0x583206){if(!_0x583206){throw new db[(_0xf57a('0x75'))]['ValidationError'](_0xf57a('0x76'));}_0x2e2d2d=_[_0xf57a('0x77')](_['keys'](_0x583206),[_0xf57a('0x78'),'updatedAt']);_0x63783=_[_0xf57a('0x77')](_[_0xf57a('0x45')](_0x583206),[_0xf57a('0x78'),_0xf57a('0x79'),_0xf57a('0x7a'),_0xf57a('0x7b')]);_0x2590d4[_0xf57a('0x5a')]={'mapKey':'mobile'};if(_0x2590d4[_0xf57a('0x6f')][_0xf57a('0x42')]){switch(_0x2590d4[_0xf57a('0x6f')][_0xf57a('0x42')]){case _0xf57a('0x7c'):_0x2590d4[_0xf57a('0x5a')]['from']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x7d')];_0x2590d4['body'][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x7e')];_0x2590d4[_0xf57a('0x5a')]['messageId']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x7f')];break;case _0xf57a('0x80'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]='+'+_0x25d924[_0xf57a('0x5a')]['sender'];_0x2590d4[_0xf57a('0x5a')]['body']=_0x25d924[_0xf57a('0x5a')]['text'];break;case _0xf57a('0x82'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x2a')];break;case _0xf57a('0x83'):_0x2590d4['body'][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x5a')];_0x2590d4[_0xf57a('0x5a')]['messageId']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x84')];break;case _0xf57a('0x85'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924['body'][_0xf57a('0x7d')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924['body'][_0xf57a('0x86')];_0x2590d4['body'][_0xf57a('0x87')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x88')];break;case'infobip':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]='+'+_0x25d924[_0xf57a('0x5a')][_0xf57a('0x89')][0x0][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x89')][0x0][_0xf57a('0x8a')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x87')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x89')][0x0]['messageId'];break;case _0xf57a('0x8b'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x8c')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x8d')][_0xf57a('0x2a')];break;case'clickatell':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x8e')];_0x2590d4['body']['body']=_0x25d924['body'][_0xf57a('0x8a')];_0x2590d4['body'][_0xf57a('0x87')]=_0x25d924['body'][_0xf57a('0x8f')];break;case'bandwidth':_0x2590d4['body']['messageId']=_0x25d924[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')]['id'];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')]['body']=_0x25d924[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')][_0xf57a('0x8a')];break;case _0xf57a('0x90'):_0x2590d4[_0xf57a('0x5a')]['from']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x81')];_0x2590d4['body'][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x2a')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x87')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x91')];break;}}if(_0x2590d4['body']['id']){delete _0x2590d4[_0xf57a('0x5a')]['id'];}if(_[_0xf57a('0x92')](_0x2590d4['body'][_0xf57a('0x81')])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0x94'));}if(_[_0xf57a('0x92')](_0x2590d4[_0xf57a('0x5a')]['body'])||_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]===''){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf57a('0x92')](_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x95')])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0x96')+_0x63783);}if(!_[_0xf57a('0x97')](_0x63783,_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x95')])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0x98')+_0x63783);}_0x271a54[_0x2590d4['body'][_0xf57a('0x95')]]=_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')];return db[_0xf57a('0x99')]['find']({'where':{'id':_0x2590d4[_0xf57a('0x6f')][_0xf57a('0x7b')]},'include':[{'model':db[_0xf57a('0x74')],'as':'Contacts','where':_0x271a54,'limit':0x1,'order':[[_0xf57a('0x79'),_0xf57a('0x9a')]]}]});})[_0xf57a('0x21')](handleEntityNotFound(_0x47e40d,null))['then'](function(_0x3f1e4f){if(_0x3f1e4f){_0x2590d4['list']=_[_0xf57a('0x9b')](_0x3f1e4f,['Contacts']);if(_0x3f1e4f[_0xf57a('0x9c')]['length']){return _0x3f1e4f[_0xf57a('0x9c')][0x0];}var _0x2d9d0f=_[_0xf57a('0x18')](_0x2590d4[_0xf57a('0x5a')],{'firstName':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')],'ListId':_0x3f1e4f['id']});_0x2d9d0f[_0x2590d4['body']['mapKey']]=_0x2590d4['body'][_0xf57a('0x81')];return db['CmContact'][_0xf57a('0x59')](_0x2d9d0f,{'fields':_0x2e2d2d,'raw':!![]});}})[_0xf57a('0x21')](handleEntityNotFound(_0x47e40d,null))[_0xf57a('0x21')](function(_0x339654){if(_0x339654){_0x2590d4[_0xf57a('0x9d')]=_0x339654;var _0x2656bb={'ContactId':_0x339654['id'],'phone':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')],'SmsAccountId':_0x25d924['params']['id']};var _0x1e7f77={'ContactId':_0x339654['id'],'SmsAccountId':_0x25d924[_0xf57a('0x54')]['id'],'closed':![]};return db[_0xf57a('0x9e')]['find']({'where':_0x1e7f77})[_0xf57a('0x21')](function(_0x47239a){if(_0x47239a){return[_0x47239a,![]];}return db[_0xf57a('0x9e')][_0xf57a('0x59')](_0x2656bb)[_0xf57a('0x21')](function(_0x506e6e){return[_0x506e6e,!![]];});});}})[_0xf57a('0x9f')](function(_0x5c5ea4,_0x482b40){_0x2590d4['interaction']=_0x5c5ea4[_0xf57a('0x38')]({'plain':!![]});_0x2590d4['interaction'][_0xf57a('0xa0')]=![];if(_0x482b40){if(_0x2590d4['account'][_0xf57a('0xa1')]){_0x2590d4[_0xf57a('0xa2')][_0xf57a('0xa3')]({'id':0x0,'priority':_0x2590d4['applications'][_0xf57a('0x57')]+0x1,'app':_0xf57a('0xa4'),'appdata':'unmanaged','interval':_0xf57a('0xa5')});}_0x2590d4[_0xf57a('0xa6')]['created']=!![];}return db[_0xf57a('0xa7')]['create']({'phone':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')],'messageId':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x87')],'body':_0x2590d4['body'][_0xf57a('0x5a')],'SmsAccountId':_0x25d924[_0xf57a('0x54')]['id'],'SmsInteractionId':_0x5c5ea4['id'],'direction':'in','ContactId':_0x5c5ea4[_0xf57a('0xa8')],'AttachmentId':_0x2590d4[_0xf57a('0x5a')]['AttachmentId']});})['then'](function(_0x5c6799){_0x2590d4[_0xf57a('0x2a')]=_0x5c6799;if(!_0x2590d4[_0xf57a('0xa6')][_0xf57a('0xa9')])return;return db[_0xf57a('0xaa')]['find']({'attributes':['id',_0xf57a('0x3b')],'where':{'id':_0x2590d4['interaction'][_0xf57a('0xa9')]}});})[_0xf57a('0x21')](function(_0x53996c){if(_0x53996c){_0x2590d4[_0xf57a('0xa2')][_0xf57a('0xab')]({'id':0x0,'priority':0x0,'app':_0xf57a('0xac'),'appdata':_0x53996c[_0xf57a('0x3b')]+','+(_0x2590d4[_0xf57a('0x6f')][_0xf57a('0xad')]||0xa),'interval':'*,*,*,*'});}if(!_0x2590d4[_0xf57a('0xa6')]['queueId'])return;return db['SmsQueue'][_0xf57a('0x58')]({'attributes':['id','name'],'where':{'id':_0x2590d4[_0xf57a('0xa6')][_0xf57a('0xae')]}});})[_0xf57a('0x21')](function(_0x1187d9){if(_0x1187d9){_0x2590d4[_0xf57a('0xa2')][_0xf57a('0xab')]({'id':0x0,'priority':0x1,'app':_0xf57a('0xaf'),'appdata':_0x1187d9['name']+','+(_0x2590d4['account'][_0xf57a('0xb0')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf57a('0xb1'),'startRouting',_0x2590d4);})[_0xf57a('0x21')](function(_0x21baa2){if(_0x21baa2){var _0x2cbafa=0xc8;var _0x469fc5='receiveMessage';logger[_0xf57a('0x22')](_0xf57a('0x25'),_0x469fc5,_0x2cbafa,'entity\x20found');logger[_0xf57a('0x24')](_0xf57a('0xb2'),_0x469fc5,_0x2cbafa,_0xf57a('0xb3'),JSON[_0xf57a('0x27')](_0x21baa2));if(_0x2590d4['account'][_0xf57a('0x42')]===_0xf57a('0x7c')){return _0x47e40d[_0xf57a('0x2d')](_0x2cbafa)[_0xf57a('0x34')](_0xf57a('0xb4'),'text/xml')[_0xf57a('0x3c')](_0xf57a('0xb5'));}else{return _0x47e40d[_0xf57a('0x2d')](_0x2cbafa)['json'](_0x21baa2);}}})[_0xf57a('0x2b')](handleError(_0x47e40d,null));};exports[_0xf57a('0xb6')]=function(_0x498e40,_0x4fb2bf){var _0x542bf3=_0x498e40['params']['id'];var _0x2fe0fd=_0x498e40['body'];var _0x35e7a6=0xc8;var _0x47fb94=null;return db[_0xf57a('0xb7')][_0xf57a('0xb8')]({'isolationLevel':db[_0xf57a('0xb7')]['Transaction']['ISOLATION_LEVELS'][_0xf57a('0xb9')]},function(_0x939df9){return db['SmsAccount']['findOne']({'where':{'id':_0x542bf3},'transaction':_0x939df9})[_0xf57a('0x21')](function(_0x21fdb8){if(_0x21fdb8){return db[_0xf57a('0xba')][_0xf57a('0x37')]({'where':{'SmsAccountId':_0x542bf3},'transaction':_0x939df9})['then'](function(){var _0x44fb0c=_[_0xf57a('0x40')](_0x2fe0fd,function(_0x324b0b){_0x324b0b['SmsAccountId']=_0x542bf3;return _0x324b0b;});return db['SmsApplication'][_0xf57a('0xbb')](_0x44fb0c,{'transaction':_0x939df9});});}else{_0x35e7a6=0x194;_0x47fb94=[];}});})[_0xf57a('0x21')](function(){if(_0x35e7a6!==0x194){return db[_0xf57a('0xba')][_0xf57a('0xbc')]({'where':{'SmsAccountId':_0x542bf3},'order':_0xf57a('0x71')})[_0xf57a('0x21')](function(_0x18527e){_0x47fb94=_0x18527e;});}})[_0xf57a('0x2b')](function(_0x1e8e24){_0x35e7a6=0x1f4;logger[_0xf57a('0x28')](_0x1e8e24[_0xf57a('0xbd')]);if(_0x1e8e24['name']){delete _0x1e8e24[_0xf57a('0x3b')];}_0x47fb94=_0x1e8e24;})[_0xf57a('0xbe')](function(){if(_0x47fb94===null){_0x4fb2bf[_0xf57a('0x2c')](_0x35e7a6);}else{if(_0x35e7a6===0x1f4){_0x4fb2bf[_0xf57a('0x2d')](_0x35e7a6)[_0xf57a('0x3c')](_0x47fb94);}else{_0x4fb2bf[_0xf57a('0x2d')](_0x35e7a6)[_0xf57a('0x2f')](_0x47fb94);}}});};exports['getApplications']=function(_0x31f462,_0x5ecf1d,_0x50e734){var _0x31002f={};var _0x140fc5={};var _0x2e71cb;var _0x102cad;return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x31f462['params']['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x5ecf1d,null))[_0xf57a('0x21')](function(_0x5139e2){if(_0x5139e2){_0x2e71cb=_0x5139e2;_0x140fc5[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0xba')]['rawAttributes']);_0x140fc5[_0xf57a('0x44')]=_['keys'](_0x31f462[_0xf57a('0x44')]);_0x140fc5[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x140fc5[_0xf57a('0x43')],_0x140fc5['query']);_0x31002f[_0xf57a('0x47')]=_['intersection'](_0x140fc5['model'],qs[_0xf57a('0x56')](_0x31f462[_0xf57a('0x44')][_0xf57a('0x56')]));_0x31002f[_0xf57a('0x47')]=_0x31002f[_0xf57a('0x47')]['length']?_0x31002f['attributes']:_0x140fc5[_0xf57a('0x43')];_0x31002f[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x31f462[_0xf57a('0x44')]['sort']);_0x31002f[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x31f462[_0xf57a('0x44')],_0x140fc5[_0xf57a('0x4c')]));if(_0x31f462['query'][_0xf57a('0x4e')]){_0x31002f[_0xf57a('0x4b')]=_[_0xf57a('0x4f')](_0x31002f[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x31002f[_0xf57a('0x47')],function(_0x5cf14a){var _0x16c1c7={};_0x16c1c7[_0x5cf14a]={'$like':'%'+_0x31f462['query'][_0xf57a('0x4e')]+'%'};return _0x16c1c7;})});}_0x31002f=_['merge']({},_0x31002f,_0x31f462['options']);return _0x2e71cb[_0xf57a('0xbf')](_0x31002f);}})['then'](function(_0x5de24f){if(_0x5de24f){_0x102cad=_0x5de24f[_0xf57a('0x57')];if(!_0x31f462[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x31002f[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x31f462[_0xf57a('0x44')][_0xf57a('0x31')]);_0x31002f['offset']=qs[_0xf57a('0x33')](_0x31f462[_0xf57a('0x44')][_0xf57a('0x33')]);}return _0x2e71cb[_0xf57a('0xbf')](_0x31002f);}})['then'](function(_0x4efad0){if(_0x4efad0){return _0x4efad0?{'count':_0x102cad,'rows':_0x4efad0}:null;}})[_0xf57a('0x21')](respondWithResult(_0x5ecf1d,null))[_0xf57a('0x2b')](handleError(_0x5ecf1d,null));};exports[_0xf57a('0xc0')]=function(_0x5d39b7,_0x21277a,_0x58d84d){var _0x27d963={'raw':![],'where':{}};var _0x59236e={};var _0x404749={'count':0x0,'rows':[]};return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x5d39b7[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x21277a,null))[_0xf57a('0x21')](function(_0x26cf1d){if(_0x26cf1d){_0x59236e['model']=_[_0xf57a('0x45')](db['SmsInteraction'][_0xf57a('0x55')]);_0x59236e[_0xf57a('0x44')]=_[_0xf57a('0x45')](_0x5d39b7[_0xf57a('0x44')]);_0x59236e[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x59236e[_0xf57a('0x43')],_0x59236e[_0xf57a('0x44')]);_0x27d963['attributes']=_[_0xf57a('0x46')](_0x59236e[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x5d39b7[_0xf57a('0x44')]['fields']));_0x27d963[_0xf57a('0x47')]=_0x27d963[_0xf57a('0x47')][_0xf57a('0x57')]?_0x27d963[_0xf57a('0x47')]:_0x59236e[_0xf57a('0x43')];if(!_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x27d963['limit']=qs[_0xf57a('0x31')](_0x5d39b7['query'][_0xf57a('0x31')]);_0x27d963['offset']=qs[_0xf57a('0x33')](_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x27d963[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x5d39b7[_0xf57a('0x44')]['sort']);_0x27d963[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_['pick'](_0x5d39b7[_0xf57a('0x44')],_0x59236e[_0xf57a('0x4c')]));_0x27d963[_0xf57a('0x4b')]['SmsAccountId']=_0x26cf1d['id'];if(_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x27d963[_0xf57a('0x4b')]=_[_0xf57a('0x4f')](_0x27d963['where'],{'$or':_[_0xf57a('0x40')](_0x27d963[_0xf57a('0x47')],function(_0x1ba3a1){var _0x3cda84={};_0x3cda84[_0x1ba3a1]={'$like':'%'+_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x4e')]+'%'};return _0x3cda84;})});}_0x27d963=_['merge']({},_0x27d963,_0x5d39b7[_0xf57a('0x50')]);return db[_0xf57a('0x9e')][_0xf57a('0x32')]({'where':_0x27d963[_0xf57a('0x4b')]})[_0xf57a('0x21')](function(_0x3d3361){_0x404749[_0xf57a('0x32')]=_0x3d3361;if(_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x69')]){_0x27d963[_0xf57a('0x51')]=[{'model':db[_0xf57a('0x74')],'as':'Contact','required':![]},{'model':db[_0xf57a('0xaa')],'as':_0xf57a('0xc1'),'attributes':[_0xf57a('0x3b'),_0xf57a('0xc2'),_0xf57a('0xc3')],'required':![]},{'model':db['Tag'],'as':_0xf57a('0xc4'),'attributes':['id','name',_0xf57a('0xc5')],'where':_0x5d39b7[_0xf57a('0x44')]['tag']?{'id':_0x5d39b7[_0xf57a('0x44')][_0xf57a('0xc6')]}:undefined,'required':_0x5d39b7[_0xf57a('0x44')][_0xf57a('0xc6')]?!![]:![]}];}return db[_0xf57a('0x9e')][_0xf57a('0x52')](_0x27d963);})[_0xf57a('0x21')](function(_0x44b408){_0x404749['rows']=_0x44b408;return _0x404749;});}})[_0xf57a('0x21')](respondWithFilteredResult(_0x21277a,_0x27d963))[_0xf57a('0x2b')](handleError(_0x21277a,null));};exports[_0xf57a('0x3c')]=function(_0x23f620,_0x8b100d,_0x1ed45d){var _0x5dc12f,_0x53bc1d,_0x41b777;if(_['isNil'](_0x23f620[_0xf57a('0x5a')][_0xf57a('0x5a')])||_0x23f620[_0xf57a('0x5a')][_0xf57a('0x5a')]===''){throw new db['Sequelize']['ValidationError'](_0xf57a('0xc7'));}if(_[_0xf57a('0x92')](_0x23f620[_0xf57a('0x5a')]['to'])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0xc8'));}_0x5dc12f=_0x23f620[_0xf57a('0x5a')]['to'];return db[_0xf57a('0x41')]['find']({'where':{'id':_0x23f620[_0xf57a('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0xf57a('0xc9'),'include':[{'model':db[_0xf57a('0x74')],'as':_0xf57a('0x9c'),'where':{'mobile':_0x5dc12f},'limit':0x1,'order':[[_0xf57a('0x79'),_0xf57a('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x8b100d,null))[_0xf57a('0x21')](function(_0x12ced9){if(_0x12ced9&&_0x12ced9[_0xf57a('0xc9')]){_0x53bc1d=_0x12ced9[_0xf57a('0x38')]({'plain':!![]});if(_0x53bc1d[_0xf57a('0xc9')]&&_0x53bc1d['List'][_0xf57a('0x9c')][_0xf57a('0x57')]){return _0x53bc1d[_0xf57a('0xc9')][_0xf57a('0x9c')][0x0];}return db[_0xf57a('0x74')]['create'](_['defaults'](_0x23f620[_0xf57a('0x5a')],{'firstName':_0x5dc12f,'mobile':_0x5dc12f,'phone':_0x5dc12f,'ListId':_0x53bc1d[_0xf57a('0x7b')]}));}})[_0xf57a('0x21')](handleEntityNotFound(_0x8b100d,null))[_0xf57a('0x21')](function(_0x2b368d){if(_0x2b368d){_0x41b777=_0x2b368d;return db[_0xf57a('0x9e')][_0xf57a('0x58')]({'where':{'ContactId':_0x41b777['id'],'closed':![],'SmsAccountId':_0x53bc1d['id']}})['then'](function(_0x17a8a9){if(_0x17a8a9){return[_0x17a8a9,![]];}return db[_0xf57a('0x9e')][_0xf57a('0x59')]({'UserId':_0x23f620[_0xf57a('0x5b')]['id'],'ContactId':_0x41b777['id'],'SmsAccountId':_0x53bc1d['id'],'phone':_0x5dc12f,'firstMsgDirection':'out','Messages':[_[_0xf57a('0x4f')](_0x23f620['body'],{'read':![],'body':_0x23f620[_0xf57a('0x5a')][_0xf57a('0x5a')],'phone':_0x5dc12f,'SmsAccountId':_0x53bc1d['id'],'UserId':_0x23f620['user']['id'],'ContactId':_0x41b777['id']})]},{'include':[{'model':db[_0xf57a('0xa7')],'as':'Messages'}]})['then'](function(_0x2dfaca){return[_0x2dfaca,!![]];});});}})['spread'](function(_0x4e332c,_0x1c3edf){if(_0x1c3edf){return _0x4e332c;}return db[_0xf57a('0xa7')][_0xf57a('0x59')](_[_0xf57a('0x4f')](_0x23f620['body'],{'read':![],'body':_0x23f620[_0xf57a('0x5a')]['body'],'phone':_0x5dc12f,'SmsAccountId':_0x53bc1d['id'],'SmsInteractionId':_0x4e332c['id'],'UserId':_0x23f620['user']['id'],'ContactId':_0x41b777['id']}))[_0xf57a('0x21')](function(_0x24d823){_0x4e332c['dataValues'][_0xf57a('0xca')]=[];_0x4e332c[_0xf57a('0xcb')]['Messages'][_0xf57a('0xa3')](_0x24d823[_0xf57a('0xcb')]);return _0x4e332c;});})[_0xf57a('0x21')](respondWithResult(_0x8b100d,null))[_0xf57a('0x2b')](handleError(_0x8b100d,null));};exports[_0xf57a('0x2d')]=function(_0xfb9d58,_0x39293e,_0xc8ff7a){if(_0xfb9d58[_0xf57a('0x5a')]['id']){delete _0xfb9d58[_0xf57a('0x5a')]['id'];}var _0x5210c5,_0x38cd8f,_0x16b41a;return db[_0xf57a('0x41')]['find']({'where':{'id':_0xfb9d58[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x39293e,null))['then'](function(_0x5f22d6){if(_0x5f22d6){_0x16b41a=_0x5f22d6;logger['debug'](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0xcc'),_0x5f22d6['type'],util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5f22d6[_0xf57a('0x42')]){case _0xf57a('0x80'):if(_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0xce')]&&_0xfb9d58['body'][_0xf57a('0x2d')]){_0x38cd8f=_0xfb9d58['body'][_0xf57a('0x2d')];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0xfb9d58['body'][_0xf57a('0xce')]}});}break;case _0xf57a('0x82'):if(_0xfb9d58['body'][_0xf57a('0xcf')]&&_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0xd0')]){_0x38cd8f=_0xfb9d58['body'][_0xf57a('0xd0')];return db[_0xf57a('0xa7')]['find']({'where':{'messageId':_0xfb9d58['body'][_0xf57a('0xcf')]}});}break;case _0xf57a('0x83'):if(_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x84')]&&_0xfb9d58[_0xf57a('0x5a')]['status_code']){_0x38cd8f=_0xfb9d58[_0xf57a('0x5a')]['status_code'];return db[_0xf57a('0xa7')]['find']({'where':{'messageId':_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x84')]}});}break;case'infobip':var _0x3fca61=_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x89')][0x0];if(_0x3fca61[_0xf57a('0x87')]&&_0x3fca61[_0xf57a('0x2d')][_0xf57a('0xd1')]===_0xf57a('0xd2')){_0x38cd8f=_0x3fca61[_0xf57a('0x2d')][_0xf57a('0xd1')];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0x3fca61[_0xf57a('0x87')]}});}break;case _0xf57a('0xd3'):if(_0xfb9d58[_0xf57a('0x5a')]['messageId']&&_0xfb9d58[_0xf57a('0x5a')]['status']){_0x38cd8f=_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x2d')];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x87')]}});}break;case _0xf57a('0xd4'):if(_0xfb9d58[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')]['id']){_0x38cd8f=_0xfb9d58['body'][0x0]['type'];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0xfb9d58['body'][0x0][_0xf57a('0x2a')]['id']}});}break;case _0xf57a('0x90'):if(_0xfb9d58['body'][_0xf57a('0xd5')]&&_0xfb9d58['body']['status']){_0x38cd8f=_0xfb9d58['body'][_0xf57a('0x2d')];return db['SmsMessage']['find']({'where':{'messageId':_0xfb9d58['body'][_0xf57a('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x39293e,null))[_0xf57a('0x21')](function(_0x1420f5){if(_0x1420f5){_0x5210c5=_0x1420f5;switch(_0x16b41a[_0xf57a('0x42')]){case'skebby':if(_0x38cd8f===_0xf57a('0xd2')){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),'status',_0xf57a('0x80'),util[_0xf57a('0xcd')](_0xfb9d58['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x38cd8f==='1'){return _0x5210c5['update']({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0x80'),util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf57a('0x83'):if(!_0xfb9d58[_0xf57a('0x5a')]['error_code']&&_0x38cd8f>=0xc8&&_0x38cd8f<=0xce){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),'clicksend',util[_0xf57a('0xcd')](_0xfb9d58['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x30dbaf=_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x89')][0x0];if(_0x30dbaf['status']['groupName']===_0xf57a('0xd2')){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger['error'](_0xf57a('0x25'),_0xf57a('0x2d'),'infobip',util['inspect'](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf57a('0xd3'):if(_0x38cd8f==_0xf57a('0xd6')||_0x38cd8f=='RECEIVED_BY_RECIPIENT'){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0xd3'),util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x38cd8f==_0xf57a('0xd7')){return _0x5210c5['update']({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0xd4'),util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf57a('0x90'):if(_0x38cd8f===_0xf57a('0xd8')||_0x38cd8f===_0xf57a('0xd9')){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0x90'),util[_0xf57a('0xcd')](_0xfb9d58['body'],{'showHidden':![],'depth':null}));}break;}return _0x5210c5;}})[_0xf57a('0x21')](respondWithResult(_0x39293e,null))[_0xf57a('0x2b')](handleError(_0x39293e,null));};exports[_0xf57a('0xda')]=function(_0x506a95,_0xf55020,_0x261f55){var _0x4cd4f4,_0x18b2cd,_0x239bf8;return db[_0xf57a('0x41')]['find']({'where':{'id':_0x506a95[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0xf55020,null))[_0xf57a('0x21')](function(_0x15b6cb){if(_0x15b6cb){_0x239bf8=_0x15b6cb;logger[_0xf57a('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf57a('0x2d'),_0xf57a('0xcc'),_0x15b6cb[_0xf57a('0x42')],util['inspect'](_0x506a95[_0xf57a('0x44')],{'showHidden':![],'depth':null}));switch(_0x15b6cb[_0xf57a('0x42')]){case'csc':if(_0x506a95[_0xf57a('0x44')][_0xf57a('0xdb')]&&_0x506a95[_0xf57a('0x44')][_0xf57a('0xdc')]){_0x18b2cd=_0x506a95[_0xf57a('0x44')][_0xf57a('0xdc')];return db[_0xf57a('0xa7')]['find']({'where':{'messageId':_0x506a95[_0xf57a('0x44')][_0xf57a('0xdb')]}});}break;}}})[_0xf57a('0x21')](handleEntityNotFound(_0xf55020,null))['then'](function(_0x26e691){if(_0x26e691){_0x4cd4f4=_0x26e691;switch(_0x239bf8[_0xf57a('0x42')]){case _0xf57a('0x8b'):if(_0x18b2cd==='2'||_0x18b2cd==='6'){return _0x4cd4f4[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),'status',_0xf57a('0x8b'),util[_0xf57a('0xcd')](_0x506a95['query'],{'showHidden':![],'depth':null}));};break;}return _0x4cd4f4;}})[_0xf57a('0x21')](respondWithResult(_0xf55020,null))[_0xf57a('0x2b')](handleError(_0xf55020,null));};exports['addAgents']=function(_0x585b31,_0x462452,_0x38d418){return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x585b31[_0xf57a('0x54')]['id']}})['then'](handleEntityNotFound(_0x462452,null))[_0xf57a('0x21')](function(_0x5043dd){if(_0x5043dd){return _0x5043dd[_0xf57a('0xdd')](_0x585b31[_0xf57a('0x5a')][_0xf57a('0x6b')],_['omit'](_0x585b31['body'],['ids','id'])||{})[_0xf57a('0x9f')](function(_0x319971){for(var _0x17c296=0x0;_0x17c296<_0x585b31[_0xf57a('0x5a')][_0xf57a('0x6b')][_0xf57a('0x57')];_0x17c296+=0x1){socket[_0xf57a('0xde')](_0xf57a('0xdf'),{'UserId':Number(_0x585b31[_0xf57a('0x5a')]['ids'][_0x17c296]),'SmsAccountId':Number(_0x585b31['params']['id'])});}return _0x319971;});}})[_0xf57a('0x21')](respondWithResult(_0x462452,null))[_0xf57a('0x2b')](handleError(_0x462452,null));};exports[_0xf57a('0xe0')]=function(_0x2c8780,_0x35d78f,_0x38e106){return db['SmsAccount'][_0xf57a('0x58')]({'where':{'id':_0x2c8780[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x35d78f,null))[_0xf57a('0x21')](function(_0x33244e){if(_0x33244e){return _0x33244e[_0xf57a('0xe0')](_0x2c8780[_0xf57a('0x44')]['ids'])[_0xf57a('0x21')](function(){if(_[_0xf57a('0xe1')](_0x2c8780['query']['ids'])){for(var _0x4f73d5=0x0;_0x4f73d5<_0x2c8780['query'][_0xf57a('0x6b')][_0xf57a('0x57')];_0x4f73d5+=0x1){socket['emit'](_0xf57a('0xe2'),{'UserId':Number(_0x2c8780[_0xf57a('0x44')][_0xf57a('0x6b')][_0x4f73d5]),'SmsAccountId':Number(_0x2c8780['params']['id'])});}}else{socket[_0xf57a('0xde')](_0xf57a('0xe2'),{'UserId':Number(_0x2c8780[_0xf57a('0x44')][_0xf57a('0x6b')]),'SmsAccountId':Number(_0x2c8780[_0xf57a('0x54')]['id'])});}});}})[_0xf57a('0x21')](respondWithStatusCode(_0x35d78f,null))[_0xf57a('0x2b')](handleError(_0x35d78f,null));};exports['getAgents']=function(_0x238575,_0x2b80c0,_0x38baed){var _0x14e52b={};var _0x35b224={};var _0xd22131;var _0x3b51cd;return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x238575[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2b80c0,null))[_0xf57a('0x21')](function(_0x43d97b){if(_0x43d97b){_0xd22131=_0x43d97b;_0x35b224[_0xf57a('0x43')]=_[_0xf57a('0x45')](db['User'][_0xf57a('0x55')]);_0x35b224[_0xf57a('0x44')]=_['keys'](_0x238575[_0xf57a('0x44')]);_0x35b224[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x35b224[_0xf57a('0x43')],_0x35b224[_0xf57a('0x44')]);_0x14e52b[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x35b224[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x238575[_0xf57a('0x44')][_0xf57a('0x56')]));_0x14e52b[_0xf57a('0x47')]=_0x14e52b['attributes'][_0xf57a('0x57')]?_0x14e52b[_0xf57a('0x47')]:_0x35b224[_0xf57a('0x43')];_0x14e52b[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x238575[_0xf57a('0x44')]['sort']);_0x14e52b[_0xf57a('0x4b')]=qs['filters'](_[_0xf57a('0x4d')](_0x238575[_0xf57a('0x44')],_0x35b224['filters']));if(_0x238575[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x14e52b['where']=_['merge'](_0x14e52b['where'],{'$or':_[_0xf57a('0x40')](_0x14e52b['attributes'],function(_0x401113){var _0x43f5c1={};_0x43f5c1[_0x401113]={'$like':'%'+_0x238575['query'][_0xf57a('0x4e')]+'%'};return _0x43f5c1;})});}_0x14e52b=_[_0xf57a('0x4f')]({},_0x14e52b,_0x238575[_0xf57a('0x50')]);return _0xd22131[_0xf57a('0xe3')](_0x14e52b);}})[_0xf57a('0x21')](function(_0x80f2da){if(_0x80f2da){_0x3b51cd=_0x80f2da['length'];if(!_0x238575[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x14e52b[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x238575[_0xf57a('0x44')][_0xf57a('0x31')]);_0x14e52b[_0xf57a('0x33')]=qs[_0xf57a('0x33')](_0x238575[_0xf57a('0x44')]['offset']);}return _0xd22131[_0xf57a('0xe3')](_0x14e52b);}})[_0xf57a('0x21')](function(_0x4dbc6b){if(_0x4dbc6b){return _0x4dbc6b?{'count':_0x3b51cd,'rows':_0x4dbc6b}:null;}})[_0xf57a('0x21')](respondWithResult(_0x2b80c0,null))[_0xf57a('0x2b')](handleError(_0x2b80c0,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a717c8f..94ff1a2 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 _0x5ace=['emit','hasOwnProperty','events','../../mysqldb','SmsAccount','save','update','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5ace,0x82));var _0xe5ac=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x5ace[_0x69a451];return _0x3d6ef5;};'use strict';var EventEmitter=require(_0xe5ac('0x0'));var SmsAccount=require(_0xe5ac('0x1'))['db'][_0xe5ac('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe5ac('0x3'),'afterUpdate':_0xe5ac('0x4'),'afterDestroy':_0xe5ac('0x5')};function emitEvent(_0x2b1f79){return function(_0x1d7459,_0x1240d2,_0x10e0e2){SmsAccountEvents[_0xe5ac('0x6')](_0x2b1f79+':'+_0x1d7459['id'],_0x1d7459);SmsAccountEvents['emit'](_0x2b1f79,_0x1d7459);_0x10e0e2(null);};}for(var e in events){if(events[_0xe5ac('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xaf57=['events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty','exports'];(function(_0x1e211f,_0x385af7){var _0x52304e=function(_0x4a0259){while(--_0x4a0259){_0x1e211f['push'](_0x1e211f['shift']());}};_0x52304e(++_0x385af7);}(_0xaf57,0x168));var _0x7af5=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xaf57[_0xbd08b4];return _0x314f1e;};'use strict';var EventEmitter=require(_0x7af5('0x0'));var SmsAccount=require(_0x7af5('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7af5('0x2')](0x0);var events={'afterCreate':_0x7af5('0x3'),'afterUpdate':_0x7af5('0x4'),'afterDestroy':_0x7af5('0x5')};function emitEvent(_0x4f8cb6){return function(_0x13582c,_0x30316e,_0x3abfda){SmsAccountEvents['emit'](_0x4f8cb6+':'+_0x13582c['id'],_0x13582c);SmsAccountEvents['emit'](_0x4f8cb6,_0x13582c);_0x3abfda(null);};}for(var e in events){if(events[_0x7af5('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x7af5('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 52b5a89..8cbbdbd 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 _0xc0a7=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc0a7,0x1ba));var _0x7c0a=function(_0x37c45f,_0x5bc42e){_0x37c45f=_0x37c45f-0x0;var _0x300ac1=_0xc0a7[_0x37c45f];return _0x300ac1;};'use strict';var _=require(_0x7c0a('0x0'));var util=require(_0x7c0a('0x1'));var logger=require(_0x7c0a('0x2'))(_0x7c0a('0x3'));var moment=require(_0x7c0a('0x4'));var BPromise=require(_0x7c0a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c0a('0x6'));var rimraf=require(_0x7c0a('0x7'));var config=require(_0x7c0a('0x8'));var attributes=require(_0x7c0a('0x9'));module[_0x7c0a('0xa')]=function(_0x29f426,_0x54c580){return _0x29f426[_0x7c0a('0xb')](_0x7c0a('0xc'),attributes,{'tableName':_0x7c0a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2a2=['./smsAccount.attributes','exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0xc2a2,0x84));var _0x2c2a=function(_0x34feac,_0x1a0af7){_0x34feac=_0x34feac-0x0;var _0x396baa=_0xc2a2[_0x34feac];return _0x396baa;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var logger=require(_0x2c2a('0x2'))(_0x2c2a('0x3'));var moment=require('moment');var BPromise=require(_0x2c2a('0x4'));var rp=require(_0x2c2a('0x5'));var fs=require('fs');var path=require(_0x2c2a('0x6'));var rimraf=require('rimraf');var config=require(_0x2c2a('0x7'));var attributes=require(_0x2c2a('0x8'));module[_0x2c2a('0x9')]=function(_0x17db27,_0x51c919){return _0x17db27['define']('SmsAccount',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 21412e1..1a231c1 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 _0x8dda=['map','include','model','debug','stringify','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowSmsAccount','SmsAccount','options','attributes'];(function(_0x5f57ab,_0x41abe7){var _0x5c80ce=function(_0x5e9be0){while(--_0x5e9be0){_0x5f57ab['push'](_0x5f57ab['shift']());}};_0x5c80ce(++_0x41abe7);}(_0x8dda,0xd1));var _0xa8dd=function(_0x47cd6a,_0x1f7850){_0x47cd6a=_0x47cd6a-0x0;var _0x17c5cc=_0x8dda[_0x47cd6a];return _0x17c5cc;};'use strict';var _=require(_0xa8dd('0x0'));var util=require('util');var moment=require(_0xa8dd('0x1'));var BPromise=require(_0xa8dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8dd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8dd('0x4'));var logger=require(_0xa8dd('0x5'))(_0xa8dd('0x6'));var config=require(_0xa8dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa8dd('0x8')][_0xa8dd('0x9')]({'port':0x232a});config[_0xa8dd('0xa')]=_['defaults'](config['redis'],{'host':_0xa8dd('0xb'),'port':0x18eb});var socket=require(_0xa8dd('0xc'))(new Redis(config[_0xa8dd('0xa')]));require(_0xa8dd('0xd'))[_0xa8dd('0xe')](socket);function respondWithRpcPromise(_0x153e9f,_0x4020e3,_0x9ad58c){return new BPromise(function(_0x580fca,_0x78109b){return client[_0xa8dd('0xf')](_0x153e9f,_0x9ad58c)[_0xa8dd('0x10')](function(_0x4bed98){logger[_0xa8dd('0x11')](_0xa8dd('0x12'),_0x4020e3,'request\x20sent');logger['debug'](_0xa8dd('0x13'),_0x4020e3,_0xa8dd('0x14'),JSON['stringify'](_0x4bed98));if(_0x4bed98[_0xa8dd('0x15')]){if(_0x4bed98[_0xa8dd('0x15')]['code']===0x1f4){logger[_0xa8dd('0x15')](_0xa8dd('0x12'),_0x4020e3,_0x4bed98[_0xa8dd('0x15')]['message']);return _0x78109b(_0x4bed98[_0xa8dd('0x15')][_0xa8dd('0x16')]);}logger[_0xa8dd('0x15')]('SmsAccount,\x20%s,\x20%s',_0x4020e3,_0x4bed98[_0xa8dd('0x15')][_0xa8dd('0x16')]);return _0x580fca(_0x4bed98[_0xa8dd('0x15')][_0xa8dd('0x16')]);}else{logger[_0xa8dd('0x11')]('SmsAccount,\x20%s,\x20%s',_0x4020e3,_0xa8dd('0x14'));_0x580fca(_0x4bed98[_0xa8dd('0x17')][_0xa8dd('0x16')]);}})[_0xa8dd('0x18')](function(_0x262fc3){logger[_0xa8dd('0x15')]('SmsAccount,\x20%s,\x20%s',_0x4020e3,_0x262fc3);_0x78109b(_0x262fc3);});});}exports[_0xa8dd('0x19')]=function(_0x3cb19f){var _0x2c56c1=this;return new Promise(function(_0x4371e5,_0x2e1f29){return db[_0xa8dd('0x1a')]['find']({'raw':_0x3cb19f[_0xa8dd('0x1b')]?_0x3cb19f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3cb19f[_0xa8dd('0x1b')]?_0x3cb19f['options']['where']||null:null,'attributes':_0x3cb19f['options']?_0x3cb19f['options'][_0xa8dd('0x1c')]||null:null,'include':_0x3cb19f['options']?_0x3cb19f['options']['include']?_[_0xa8dd('0x1d')](_0x3cb19f[_0xa8dd('0x1b')][_0xa8dd('0x1e')],function(_0x560795){return{'model':db[_0x560795[_0xa8dd('0x1f')]],'as':_0x560795['as'],'attributes':_0x560795['attributes'],'include':_0x560795[_0xa8dd('0x1e')]?_[_0xa8dd('0x1d')](_0x560795[_0xa8dd('0x1e')],function(_0x2d9d64){return{'model':db[_0x2d9d64[_0xa8dd('0x1f')]],'as':_0x2d9d64['as'],'attributes':_0x2d9d64[_0xa8dd('0x1c')],'include':_0x2d9d64[_0xa8dd('0x1e')]?_[_0xa8dd('0x1d')](_0x2d9d64[_0xa8dd('0x1e')],function(_0x3b250c){return{'model':db[_0x3b250c[_0xa8dd('0x1f')]],'as':_0x3b250c['as'],'attributes':_0x3b250c[_0xa8dd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa8dd('0x10')](function(_0x4d5a6f){logger['info'](_0xa8dd('0x19'),_0x3cb19f);logger[_0xa8dd('0x20')](_0xa8dd('0x19'),_0x3cb19f,JSON[_0xa8dd('0x21')](_0x4d5a6f));_0x4371e5(_0x4d5a6f);})['catch'](function(_0x34a8f7){logger['error'](_0xa8dd('0x19'),_0x34a8f7[_0xa8dd('0x16')],_0x3cb19f);_0x2e1f29(_0x2c56c1['error'](0x1f4,_0x34a8f7[_0xa8dd('0x16')]));});});}; \ No newline at end of file +var _0x6070=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x6070,0xb9));var _0x0607=function(_0x48a2ec,_0x5e8d2c){_0x48a2ec=_0x48a2ec-0x0;var _0x128697=_0x6070[_0x48a2ec];return _0x128697;};'use strict';var _=require(_0x0607('0x0'));var util=require(_0x0607('0x1'));var moment=require(_0x0607('0x2'));var BPromise=require(_0x0607('0x3'));var rs=require(_0x0607('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0607('0x5'))['db'];var utils=require(_0x0607('0x6'));var logger=require(_0x0607('0x7'))(_0x0607('0x8'));var config=require('../../config/environment');var jayson=require(_0x0607('0x9'));var client=jayson[_0x0607('0xa')][_0x0607('0xb')]({'port':0x232a});config[_0x0607('0xc')]=_[_0x0607('0xd')](config[_0x0607('0xc')],{'host':_0x0607('0xe'),'port':0x18eb});var socket=require(_0x0607('0xf'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x0607('0x10')](socket);function respondWithRpcPromise(_0x10a1f7,_0x1cc662,_0x3dd594){return new BPromise(function(_0x28bd41,_0x10b831){return client[_0x0607('0x11')](_0x10a1f7,_0x3dd594)[_0x0607('0x12')](function(_0x2cbf44){logger[_0x0607('0x13')](_0x0607('0x14'),_0x1cc662,_0x0607('0x15'));logger[_0x0607('0x16')](_0x0607('0x17'),_0x1cc662,_0x0607('0x15'),JSON['stringify'](_0x2cbf44));if(_0x2cbf44[_0x0607('0x18')]){if(_0x2cbf44[_0x0607('0x18')][_0x0607('0x19')]===0x1f4){logger[_0x0607('0x18')](_0x0607('0x14'),_0x1cc662,_0x2cbf44['error'][_0x0607('0x1a')]);return _0x10b831(_0x2cbf44[_0x0607('0x18')][_0x0607('0x1a')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1cc662,_0x2cbf44[_0x0607('0x18')][_0x0607('0x1a')]);return _0x28bd41(_0x2cbf44[_0x0607('0x18')][_0x0607('0x1a')]);}else{logger[_0x0607('0x13')]('SmsAccount,\x20%s,\x20%s',_0x1cc662,_0x0607('0x15'));_0x28bd41(_0x2cbf44['result'][_0x0607('0x1a')]);}})[_0x0607('0x1b')](function(_0x410da6){logger['error']('SmsAccount,\x20%s,\x20%s',_0x1cc662,_0x410da6);_0x10b831(_0x410da6);});});}exports[_0x0607('0x1c')]=function(_0x26b596){var _0x42b6fd=this;return new Promise(function(_0x2d6953,_0x28dc58){return db[_0x0607('0x1d')]['find']({'raw':_0x26b596[_0x0607('0x1e')]?_0x26b596['options'][_0x0607('0x1f')]===undefined?!![]:![]:!![],'where':_0x26b596[_0x0607('0x1e')]?_0x26b596[_0x0607('0x1e')][_0x0607('0x20')]||null:null,'attributes':_0x26b596[_0x0607('0x1e')]?_0x26b596[_0x0607('0x1e')][_0x0607('0x21')]||null:null,'include':_0x26b596[_0x0607('0x1e')]?_0x26b596[_0x0607('0x1e')][_0x0607('0x22')]?_[_0x0607('0x23')](_0x26b596[_0x0607('0x1e')][_0x0607('0x22')],function(_0x356c25){return{'model':db[_0x356c25[_0x0607('0x24')]],'as':_0x356c25['as'],'attributes':_0x356c25[_0x0607('0x21')],'include':_0x356c25[_0x0607('0x22')]?_[_0x0607('0x23')](_0x356c25[_0x0607('0x22')],function(_0x39bcce){return{'model':db[_0x39bcce[_0x0607('0x24')]],'as':_0x39bcce['as'],'attributes':_0x39bcce[_0x0607('0x21')],'include':_0x39bcce[_0x0607('0x22')]?_['map'](_0x39bcce[_0x0607('0x22')],function(_0x3529a4){return{'model':db[_0x3529a4['model']],'as':_0x3529a4['as'],'attributes':_0x3529a4[_0x0607('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1027da){logger[_0x0607('0x13')](_0x0607('0x1c'),_0x26b596);logger['debug'](_0x0607('0x1c'),_0x26b596,JSON[_0x0607('0x25')](_0x1027da));_0x2d6953(_0x1027da);})[_0x0607('0x1b')](function(_0x127b3c){logger[_0x0607('0x18')](_0x0607('0x1c'),_0x127b3c[_0x0607('0x1a')],_0x26b596);_0x28dc58(_0x42b6fd[_0x0607('0x18')](0x1f4,_0x127b3c[_0x0607('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index fe1435a..f13a795 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index e520ccb..ad0df3b 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(_0x4f1749,_0x998e73){var _0x9a9ab3=function(_0x37ee0b){while(--_0x37ee0b){_0x4f1749['push'](_0x4f1749['shift']());}};_0x9a9ab3(++_0x998e73);}(_0x34e8,0x12c));var _0x834e=function(_0x55d068,_0x1bcb28){_0x55d068=_0x55d068-0x0;var _0x1b6199=_0x34e8[_0x55d068];return _0x1b6199;};'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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x50a651,_0x276aaf){var _0x429c51=function(_0x41e3e9){while(--_0x41e3e9){_0x50a651['push'](_0x50a651['shift']());}};_0x429c51(++_0x276aaf);}(_0xedd9,0xfc));var _0x9edd=function(_0xf67a65,_0x4f9b5f){_0xf67a65=_0xf67a65-0x0;var _0x160786=_0xedd9[_0xf67a65];return _0x160786;};'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('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 14c3a32..89cc02f 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 _0xf429=['noop','STRING','*,*,*,*','exports'];(function(_0x57228f,_0x240343){var _0x143d5d=function(_0x2e239f){while(--_0x2e239f){_0x57228f['push'](_0x57228f['shift']());}};_0x143d5d(++_0x240343);}(_0xf429,0x1bf));var _0x9f42=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xf429[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require('sequelize');module[_0x9f42('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f42('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9f42('0x2')]},'interval':{'type':Sequelize[_0x9f42('0x2')],'defaultValue':_0x9f42('0x3')}}; \ No newline at end of file +var _0x47f7=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0xe8f13d,_0x5eea30){var _0x337ae8=function(_0xeb2260){while(--_0xeb2260){_0xe8f13d['push'](_0xe8f13d['shift']());}};_0x337ae8(++_0x5eea30);}(_0x47f7,0x199));var _0x747f=function(_0x151840,_0x35200b){_0x151840=_0x151840-0x0;var _0x17b368=_0x47f7[_0x151840];return _0x17b368;};'use strict';var Sequelize=require(_0x747f('0x0'));module[_0x747f('0x1')]={'priority':{'type':Sequelize[_0x747f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x747f('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x747f('0x4')]},'interval':{'type':Sequelize[_0x747f('0x4')],'defaultValue':_0x747f('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 500303b..5472821 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 _0x748c=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','include','catch','create','body','find','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0xdaf71a,_0x312595){var _0x34453c=function(_0x35c02f){while(--_0x35c02f){_0xdaf71a['push'](_0xdaf71a['shift']());}};_0x34453c(++_0x312595);}(_0x748c,0x82));var _0xc748=function(_0x5a4989,_0x3e4e79){_0x5a4989=_0x5a4989-0x0;var _0x2731f4=_0x748c[_0x5a4989];return _0x2731f4;};'use strict';var emlformat=require(_0xc748('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc748('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc748('0x2'));var Mustache=require(_0xc748('0x3'));var util=require(_0xc748('0x4'));var path=require(_0xc748('0x5'));var sox=require(_0xc748('0x6'));var csv=require(_0xc748('0x7'));var ejs=require(_0xc748('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc748('0x9'));var squel=require(_0xc748('0xa'));var crypto=require(_0xc748('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc748('0xc'));var toCsv=require(_0xc748('0x7'));var querystring=require(_0xc748('0xd'));var Papa=require('papaparse');var Redis=require(_0xc748('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc748('0xf'));var as=require(_0xc748('0x10'));var hardwareService=require(_0xc748('0x11'));var logger=require(_0xc748('0x12'))('api');var utils=require(_0xc748('0x13'));var config=require(_0xc748('0x14'));var licenseUtil=require(_0xc748('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32d8ca,_0x3a8b40){_0x3a8b40=_0x3a8b40||0xcc;return function(_0x58c62e){if(_0x58c62e){return _0x32d8ca[_0xc748('0x16')](_0x3a8b40);}return _0x32d8ca['status'](_0x3a8b40)[_0xc748('0x17')]();};}function respondWithResult(_0x3ba602,_0x48df6a){_0x48df6a=_0x48df6a||0xc8;return function(_0x56024f){if(_0x56024f){return _0x3ba602[_0xc748('0x18')](_0x48df6a)['json'](_0x56024f);}};}function respondWithFilteredResult(_0x1212b1,_0x2282a4){return function(_0x5d7d84){if(_0x5d7d84){var _0x1c5ec6=typeof _0x2282a4[_0xc748('0x19')]===_0xc748('0x1a')&&typeof _0x2282a4['limit']==='undefined';var _0x8bb4f8=_0x5d7d84[_0xc748('0x1b')];var _0x143995=_0x1c5ec6?0x0:_0x2282a4[_0xc748('0x19')];var _0x4545ec=_0x1c5ec6?_0x5d7d84[_0xc748('0x1b')]:_0x2282a4['offset']+_0x2282a4[_0xc748('0x1c')];var _0x3073ae;if(_0x4545ec>=_0x8bb4f8){_0x4545ec=_0x8bb4f8;_0x3073ae=0xc8;}else{_0x3073ae=0xce;}_0x1212b1[_0xc748('0x18')](_0x3073ae);return _0x1212b1[_0xc748('0x1d')]('Content-Range',_0x143995+'-'+_0x4545ec+'/'+_0x8bb4f8)['json'](_0x5d7d84);}return null;};}function patchUpdates(_0x39e778){return function(_0x583d3d){try{jsonpatch[_0xc748('0x1e')](_0x583d3d,_0x39e778,!![]);}catch(_0x210136){return BPromise[_0xc748('0x1f')](_0x210136);}return _0x583d3d[_0xc748('0x20')]();};}function saveUpdates(_0x389202,_0x3ea58a){return function(_0x177571){if(_0x177571){return _0x177571[_0xc748('0x21')](_0x389202)['then'](function(_0x36e0b6){return _0x36e0b6;});}return null;};}function removeEntity(_0x2f1509,_0x21fbc8){return function(_0x283b69){if(_0x283b69){return _0x283b69[_0xc748('0x22')]()[_0xc748('0x23')](function(){_0x2f1509[_0xc748('0x18')](0xcc)[_0xc748('0x17')]();});}};}function handleEntityNotFound(_0x1d1207,_0x3ecc89){return function(_0x64b5bd){if(!_0x64b5bd){_0x1d1207[_0xc748('0x16')](0x194);}return _0x64b5bd;};}function handleError(_0x10cac3,_0x48ae0d){_0x48ae0d=_0x48ae0d||0x1f4;return function(_0x58d253){logger['error'](_0x58d253['stack']);if(_0x58d253[_0xc748('0x24')]){delete _0x58d253[_0xc748('0x24')];}_0x10cac3[_0xc748('0x18')](_0x48ae0d)['send'](_0x58d253);};}exports[_0xc748('0x25')]=function(_0x59c660,_0x192a16){var _0x516760={},_0x364c6a={},_0x35557a={'count':0x0,'rows':[]};var _0x578430=_[_0xc748('0x26')](db[_0xc748('0x27')][_0xc748('0x28')],function(_0x27ce97){return{'name':_0x27ce97[_0xc748('0x29')],'type':_0x27ce97[_0xc748('0x2a')][_0xc748('0x2b')]};});_0x364c6a[_0xc748('0x2c')]=_[_0xc748('0x26')](_0x578430,'name');_0x364c6a[_0xc748('0x2d')]=_[_0xc748('0x2e')](_0x59c660[_0xc748('0x2d')]);_0x364c6a[_0xc748('0x2f')]=_[_0xc748('0x30')](_0x364c6a[_0xc748('0x2c')],_0x364c6a[_0xc748('0x2d')]);_0x516760['attributes']=_[_0xc748('0x30')](_0x364c6a[_0xc748('0x2c')],qs[_0xc748('0x31')](_0x59c660['query'][_0xc748('0x31')]));_0x516760[_0xc748('0x32')]=_0x516760[_0xc748('0x32')][_0xc748('0x33')]?_0x516760[_0xc748('0x32')]:_0x364c6a['model'];if(!_0x59c660[_0xc748('0x2d')][_0xc748('0x34')](_0xc748('0x35'))){_0x516760[_0xc748('0x1c')]=qs[_0xc748('0x1c')](_0x59c660[_0xc748('0x2d')][_0xc748('0x1c')]);_0x516760['offset']=qs[_0xc748('0x19')](_0x59c660[_0xc748('0x2d')][_0xc748('0x19')]);}_0x516760[_0xc748('0x36')]=qs[_0xc748('0x37')](_0x59c660['query'][_0xc748('0x37')]);_0x516760[_0xc748('0x38')]=qs[_0xc748('0x2f')](_[_0xc748('0x39')](_0x59c660[_0xc748('0x2d')],_0x364c6a[_0xc748('0x2f')]),_0x578430);if(_0x59c660[_0xc748('0x2d')][_0xc748('0x3a')]){_0x516760['where']=_['merge'](_0x516760[_0xc748('0x38')],{'$or':_[_0xc748('0x26')](_0x578430,function(_0x11aca9){if(_0x11aca9[_0xc748('0x2a')]!==_0xc748('0x3b')){var _0x27fc9f={};_0x27fc9f[_0x11aca9[_0xc748('0x24')]]={'$like':'%'+_0x59c660[_0xc748('0x2d')][_0xc748('0x3a')]+'%'};return _0x27fc9f;}})});}_0x516760=_[_0xc748('0x3c')]({},_0x516760,_0x59c660[_0xc748('0x3d')]);var _0x3eb7fd={'where':_0x516760['where']};return db[_0xc748('0x27')][_0xc748('0x1b')](_0x3eb7fd)['then'](function(_0x58a3e8){_0x35557a[_0xc748('0x1b')]=_0x58a3e8;if(_0x59c660['query'][_0xc748('0x3e')]){_0x516760['include']=[{'all':!![]}];}return db['SmsApplication'][_0xc748('0x3f')](_0x516760);})[_0xc748('0x23')](function(_0x43695a){_0x35557a['rows']=_0x43695a;return _0x35557a;})[_0xc748('0x23')](respondWithFilteredResult(_0x192a16,_0x516760))['catch'](handleError(_0x192a16,null));};exports[_0xc748('0x40')]=function(_0x3116ed,_0x2f5ce0){var _0x47db42={'raw':!![],'where':{'id':_0x3116ed[_0xc748('0x41')]['id']}},_0x1951c3={};_0x1951c3['model']=_[_0xc748('0x2e')](db[_0xc748('0x27')]['rawAttributes']);_0x1951c3[_0xc748('0x2d')]=_[_0xc748('0x2e')](_0x3116ed[_0xc748('0x2d')]);_0x1951c3[_0xc748('0x2f')]=_['intersection'](_0x1951c3[_0xc748('0x2c')],_0x1951c3[_0xc748('0x2d')]);_0x47db42['attributes']=_['intersection'](_0x1951c3[_0xc748('0x2c')],qs['fields'](_0x3116ed['query'][_0xc748('0x31')]));_0x47db42[_0xc748('0x32')]=_0x47db42[_0xc748('0x32')]['length']?_0x47db42['attributes']:_0x1951c3[_0xc748('0x2c')];if(_0x3116ed['query']['includeAll']){_0x47db42[_0xc748('0x42')]=[{'all':!![]}];}_0x47db42=_[_0xc748('0x3c')]({},_0x47db42,_0x3116ed['options']);return db[_0xc748('0x27')]['find'](_0x47db42)[_0xc748('0x23')](handleEntityNotFound(_0x2f5ce0,null))[_0xc748('0x23')](respondWithResult(_0x2f5ce0,null))[_0xc748('0x43')](handleError(_0x2f5ce0,null));};exports['create']=function(_0x3566cd,_0x19a087){return db[_0xc748('0x27')][_0xc748('0x44')](_0x3566cd['body'],{})[_0xc748('0x23')](respondWithResult(_0x19a087,0xc9))['catch'](handleError(_0x19a087,null));};exports[_0xc748('0x21')]=function(_0x1f9a69,_0x7868b2){if(_0x1f9a69[_0xc748('0x45')]['id']){delete _0x1f9a69['body']['id'];}return db[_0xc748('0x27')]['find']({'where':{'id':_0x1f9a69['params']['id']}})[_0xc748('0x23')](handleEntityNotFound(_0x7868b2,null))[_0xc748('0x23')](saveUpdates(_0x1f9a69[_0xc748('0x45')],null))[_0xc748('0x23')](respondWithResult(_0x7868b2,null))['catch'](handleError(_0x7868b2,null));};exports[_0xc748('0x22')]=function(_0x7f6d55,_0x48d053){return db[_0xc748('0x27')][_0xc748('0x46')]({'where':{'id':_0x7f6d55['params']['id']}})[_0xc748('0x23')](handleEntityNotFound(_0x48d053,null))[_0xc748('0x23')](removeEntity(_0x48d053,null))['catch'](handleError(_0x48d053,null));}; \ No newline at end of file +var _0x05f6=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x05f6,0x7c));var _0x605f=function(_0x22d3a8,_0x5a93e6){_0x22d3a8=_0x22d3a8-0x0;var _0x1fc8df=_0x05f6[_0x22d3a8];return _0x1fc8df;};'use strict';var emlformat=require(_0x605f('0x0'));var rimraf=require(_0x605f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x605f('0x2'));var Mustache=require(_0x605f('0x3'));var util=require(_0x605f('0x4'));var path=require(_0x605f('0x5'));var sox=require(_0x605f('0x6'));var csv=require(_0x605f('0x7'));var ejs=require(_0x605f('0x8'));var fs=require('fs');var fs_extra=require(_0x605f('0x9'));var _=require('lodash');var squel=require(_0x605f('0xa'));var crypto=require(_0x605f('0xb'));var jsforce=require(_0x605f('0xc'));var deskjs=require(_0x605f('0xd'));var toCsv=require(_0x605f('0x7'));var querystring=require(_0x605f('0xe'));var Papa=require(_0x605f('0xf'));var Redis=require(_0x605f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x605f('0x11'));var as=require(_0x605f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x605f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x605f('0x14'));var licenseUtil=require(_0x605f('0x15'));var db=require(_0x605f('0x16'))['db'];function respondWithStatusCode(_0x3af7a4,_0x953c25){_0x953c25=_0x953c25||0xcc;return function(_0x4399d7){if(_0x4399d7){return _0x3af7a4['sendStatus'](_0x953c25);}return _0x3af7a4[_0x605f('0x17')](_0x953c25)[_0x605f('0x18')]();};}function respondWithResult(_0x29743b,_0x52ce52){_0x52ce52=_0x52ce52||0xc8;return function(_0x57b150){if(_0x57b150){return _0x29743b['status'](_0x52ce52)[_0x605f('0x19')](_0x57b150);}};}function respondWithFilteredResult(_0x546db7,_0x24495b){return function(_0x3523f){if(_0x3523f){var _0xa42cca=typeof _0x24495b[_0x605f('0x1a')]==='undefined'&&typeof _0x24495b[_0x605f('0x1b')]===_0x605f('0x1c');var _0x2bf52d=_0x3523f['count'];var _0x1fe8b5=_0xa42cca?0x0:_0x24495b[_0x605f('0x1a')];var _0x543a8f=_0xa42cca?_0x3523f[_0x605f('0x1d')]:_0x24495b['offset']+_0x24495b[_0x605f('0x1b')];var _0x2dea4f;if(_0x543a8f>=_0x2bf52d){_0x543a8f=_0x2bf52d;_0x2dea4f=0xc8;}else{_0x2dea4f=0xce;}_0x546db7['status'](_0x2dea4f);return _0x546db7['set']('Content-Range',_0x1fe8b5+'-'+_0x543a8f+'/'+_0x2bf52d)[_0x605f('0x19')](_0x3523f);}return null;};}function patchUpdates(_0x4537cf){return function(_0x136429){try{jsonpatch[_0x605f('0x1e')](_0x136429,_0x4537cf,!![]);}catch(_0x13010c){return BPromise[_0x605f('0x1f')](_0x13010c);}return _0x136429[_0x605f('0x20')]();};}function saveUpdates(_0xc689c2,_0x1724f1){return function(_0x84573c){if(_0x84573c){return _0x84573c[_0x605f('0x21')](_0xc689c2)[_0x605f('0x22')](function(_0x394fd8){return _0x394fd8;});}return null;};}function removeEntity(_0x2b0704,_0x3a337b){return function(_0x1df415){if(_0x1df415){return _0x1df415[_0x605f('0x23')]()['then'](function(){_0x2b0704[_0x605f('0x17')](0xcc)[_0x605f('0x18')]();});}};}function handleEntityNotFound(_0x180d84,_0x8aae4f){return function(_0x150cd4){if(!_0x150cd4){_0x180d84[_0x605f('0x24')](0x194);}return _0x150cd4;};}function handleError(_0x4cf4b3,_0x2c5ba6){_0x2c5ba6=_0x2c5ba6||0x1f4;return function(_0x19eefe){logger[_0x605f('0x25')](_0x19eefe[_0x605f('0x26')]);if(_0x19eefe['name']){delete _0x19eefe[_0x605f('0x27')];}_0x4cf4b3[_0x605f('0x17')](_0x2c5ba6)[_0x605f('0x28')](_0x19eefe);};}exports['index']=function(_0x56d86d,_0x2de92f){var _0x372f71={},_0x54bd5e={},_0x2dfa41={'count':0x0,'rows':[]};var _0xb8fdd3=_[_0x605f('0x29')](db[_0x605f('0x2a')][_0x605f('0x2b')],function(_0x37eccd){return{'name':_0x37eccd[_0x605f('0x2c')],'type':_0x37eccd[_0x605f('0x2d')][_0x605f('0x2e')]};});_0x54bd5e[_0x605f('0x2f')]=_[_0x605f('0x29')](_0xb8fdd3,_0x605f('0x27'));_0x54bd5e[_0x605f('0x30')]=_[_0x605f('0x31')](_0x56d86d['query']);_0x54bd5e[_0x605f('0x32')]=_[_0x605f('0x33')](_0x54bd5e['model'],_0x54bd5e[_0x605f('0x30')]);_0x372f71[_0x605f('0x34')]=_[_0x605f('0x33')](_0x54bd5e['model'],qs[_0x605f('0x35')](_0x56d86d[_0x605f('0x30')]['fields']));_0x372f71[_0x605f('0x34')]=_0x372f71[_0x605f('0x34')][_0x605f('0x36')]?_0x372f71[_0x605f('0x34')]:_0x54bd5e[_0x605f('0x2f')];if(!_0x56d86d[_0x605f('0x30')]['hasOwnProperty'](_0x605f('0x37'))){_0x372f71['limit']=qs[_0x605f('0x1b')](_0x56d86d[_0x605f('0x30')][_0x605f('0x1b')]);_0x372f71[_0x605f('0x1a')]=qs[_0x605f('0x1a')](_0x56d86d['query'][_0x605f('0x1a')]);}_0x372f71[_0x605f('0x38')]=qs[_0x605f('0x39')](_0x56d86d[_0x605f('0x30')][_0x605f('0x39')]);_0x372f71[_0x605f('0x3a')]=qs['filters'](_[_0x605f('0x3b')](_0x56d86d[_0x605f('0x30')],_0x54bd5e[_0x605f('0x32')]),_0xb8fdd3);if(_0x56d86d[_0x605f('0x30')]['filter']){_0x372f71['where']=_[_0x605f('0x3c')](_0x372f71[_0x605f('0x3a')],{'$or':_[_0x605f('0x29')](_0xb8fdd3,function(_0x4308e5){if(_0x4308e5[_0x605f('0x2d')]!==_0x605f('0x3d')){var _0x434cc5={};_0x434cc5[_0x4308e5[_0x605f('0x27')]]={'$like':'%'+_0x56d86d[_0x605f('0x30')]['filter']+'%'};return _0x434cc5;}})});}_0x372f71=_[_0x605f('0x3c')]({},_0x372f71,_0x56d86d[_0x605f('0x3e')]);var _0x4c8936={'where':_0x372f71[_0x605f('0x3a')]};return db[_0x605f('0x2a')][_0x605f('0x1d')](_0x4c8936)[_0x605f('0x22')](function(_0xcdc5b1){_0x2dfa41['count']=_0xcdc5b1;if(_0x56d86d[_0x605f('0x30')][_0x605f('0x3f')]){_0x372f71[_0x605f('0x40')]=[{'all':!![]}];}return db[_0x605f('0x2a')][_0x605f('0x41')](_0x372f71);})['then'](function(_0x886976){_0x2dfa41[_0x605f('0x42')]=_0x886976;return _0x2dfa41;})['then'](respondWithFilteredResult(_0x2de92f,_0x372f71))[_0x605f('0x43')](handleError(_0x2de92f,null));};exports['show']=function(_0x3043a5,_0x4b0117){var _0x2251a4={'raw':!![],'where':{'id':_0x3043a5[_0x605f('0x44')]['id']}},_0x3ccb45={};_0x3ccb45[_0x605f('0x2f')]=_[_0x605f('0x31')](db[_0x605f('0x2a')][_0x605f('0x2b')]);_0x3ccb45[_0x605f('0x30')]=_[_0x605f('0x31')](_0x3043a5[_0x605f('0x30')]);_0x3ccb45[_0x605f('0x32')]=_['intersection'](_0x3ccb45[_0x605f('0x2f')],_0x3ccb45[_0x605f('0x30')]);_0x2251a4[_0x605f('0x34')]=_[_0x605f('0x33')](_0x3ccb45[_0x605f('0x2f')],qs['fields'](_0x3043a5[_0x605f('0x30')]['fields']));_0x2251a4[_0x605f('0x34')]=_0x2251a4[_0x605f('0x34')][_0x605f('0x36')]?_0x2251a4[_0x605f('0x34')]:_0x3ccb45['model'];if(_0x3043a5[_0x605f('0x30')][_0x605f('0x3f')]){_0x2251a4[_0x605f('0x40')]=[{'all':!![]}];}_0x2251a4=_['merge']({},_0x2251a4,_0x3043a5[_0x605f('0x3e')]);return db[_0x605f('0x2a')][_0x605f('0x45')](_0x2251a4)['then'](handleEntityNotFound(_0x4b0117,null))[_0x605f('0x22')](respondWithResult(_0x4b0117,null))['catch'](handleError(_0x4b0117,null));};exports[_0x605f('0x46')]=function(_0x4b951d,_0x2f82b2){return db[_0x605f('0x2a')]['create'](_0x4b951d[_0x605f('0x47')],{})['then'](respondWithResult(_0x2f82b2,0xc9))['catch'](handleError(_0x2f82b2,null));};exports[_0x605f('0x21')]=function(_0xa45917,_0x4c523a){if(_0xa45917[_0x605f('0x47')]['id']){delete _0xa45917['body']['id'];}return db['SmsApplication'][_0x605f('0x45')]({'where':{'id':_0xa45917[_0x605f('0x44')]['id']}})[_0x605f('0x22')](handleEntityNotFound(_0x4c523a,null))[_0x605f('0x22')](saveUpdates(_0xa45917[_0x605f('0x47')],null))['then'](respondWithResult(_0x4c523a,null))[_0x605f('0x43')](handleError(_0x4c523a,null));};exports[_0x605f('0x23')]=function(_0x4be478,_0x423d08){return db[_0x605f('0x2a')][_0x605f('0x45')]({'where':{'id':_0x4be478[_0x605f('0x44')]['id']}})['then'](handleEntityNotFound(_0x423d08,null))[_0x605f('0x22')](removeEntity(_0x423d08,null))[_0x605f('0x43')](handleError(_0x423d08,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ce068c1..1fe1486 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 _0x3b86=['path','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','lodash','api','bluebird','request-promise'];(function(_0x317cc5,_0x3b6179){var _0x44fe81=function(_0x3b43b5){while(--_0x3b43b5){_0x317cc5['push'](_0x317cc5['shift']());}};_0x44fe81(++_0x3b6179);}(_0x3b86,0xa1));var _0x63b8=function(_0x343798,_0x4ac30e){_0x343798=_0x343798-0x0;var _0x170c87=_0x3b86[_0x343798];return _0x170c87;};'use strict';var _=require(_0x63b8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x63b8('0x1'));var moment=require('moment');var BPromise=require(_0x63b8('0x2'));var rp=require(_0x63b8('0x3'));var fs=require('fs');var path=require(_0x63b8('0x4'));var rimraf=require('rimraf');var config=require(_0x63b8('0x5'));var attributes=require(_0x63b8('0x6'));module[_0x63b8('0x7')]=function(_0x2ea44f,_0x10014a){return _0x2ea44f['define'](_0x63b8('0x8'),attributes,{'tableName':_0x63b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x63b8('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8f12=['SmsApplication','sms_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x2adaab,_0x4d19ec){var _0x279699=function(_0x13444a){while(--_0x13444a){_0x2adaab['push'](_0x2adaab['shift']());}};_0x279699(++_0x4d19ec);}(_0x8f12,0x196));var _0x28f1=function(_0x53377b,_0x166f23){_0x53377b=_0x53377b-0x0;var _0x39cba9=_0x8f12[_0x53377b];return _0x39cba9;};'use strict';var _=require('lodash');var util=require(_0x28f1('0x0'));var logger=require('../../config/logger')(_0x28f1('0x1'));var moment=require(_0x28f1('0x2'));var BPromise=require(_0x28f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28f1('0x4'));var rimraf=require(_0x28f1('0x5'));var config=require(_0x28f1('0x6'));var attributes=require(_0x28f1('0x7'));module[_0x28f1('0x8')]=function(_0xeda3f8,_0x3f1532){return _0xeda3f8[_0x28f1('0x9')](_0x28f1('0xa'),attributes,{'tableName':_0x28f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x28f1('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 065f306..ae570f1 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 _0xa30a=['stringify','error','code','message','request\x20sent','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x15822a,_0x1062e2){var _0x54675d=function(_0x3e51eb){while(--_0x3e51eb){_0x15822a['push'](_0x15822a['shift']());}};_0x54675d(++_0x1062e2);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});} \ No newline at end of file +var _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsApplication,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x505d,0x93));var _0xd505=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x505d[_0x240261];return _0x45c332;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('SmsApplication,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('SmsApplication,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 86e271b..9510ee0 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 _0x757a=['smsinteraction:update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','post','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x757a,0xde));var _0xa757=function(_0xb13237,_0x23e97a){_0xb13237=_0xb13237-0x0;var _0x4d90a8=_0x757a[_0xb13237];return _0x4d90a8;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa757('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x12')),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x15')),controller['update']);router[_0xa757('0x16')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction['tracked']('sms',_0xa757('0x17')),controller[_0xa757('0x18')]);router[_0xa757('0x16')](_0xa757('0x19'),auth[_0xa757('0x9')](),controller[_0xa757('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21eb0f,_0x367c19){var _0xacf857=function(_0x39c559){while(--_0x39c559){_0x21eb0f['push'](_0x21eb0f['shift']());}};_0xacf857(++_0x367c19);}(_0xe605,0x92));var _0x5e60=function(_0x11db82,_0x441c0e){_0x11db82=_0x11db82-0x0;var _0x2ff2d9=_0xe605[_0x11db82];return _0x2ff2d9;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('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 7b7accd..88b7408 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 _0x9c9b=['STRING','out','ENUM','INTEGER','moment','exports','BOOLEAN','DATE'];(function(_0x4f566f,_0x4ea9cb){var _0x3aa43f=function(_0x519139){while(--_0x519139){_0x4f566f['push'](_0x4f566f['shift']());}};_0x3aa43f(++_0x4ea9cb);}(_0x9c9b,0x194));var _0xb9c9=function(_0x4c58d4,_0x5c991d){_0x4c58d4=_0x4c58d4-0x0;var _0x1811f0=_0x9c9b[_0x4c58d4];return _0x1811f0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb9c9('0x0'));module[_0xb9c9('0x1')]={'closed':{'type':Sequelize[_0xb9c9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb9c9('0x3')]},'disposition':{'type':Sequelize[_0xb9c9('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb9c9('0x4')]},'note':{'type':Sequelize[_0xb9c9('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb9c9('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb9c9('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb9c9('0x6')]('in',_0xb9c9('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb9c9('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xb9c9('0x7')]}}; \ No newline at end of file +var _0x1a85=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x20be9a,_0x2cca1c){var _0x32d407=function(_0x3059c2){while(--_0x3059c2){_0x20be9a['push'](_0x20be9a['shift']());}};_0x32d407(++_0x2cca1c);}(_0x1a85,0x178));var _0x51a8=function(_0x25dfdf,_0x542333){_0x25dfdf=_0x25dfdf-0x0;var _0x5220da=_0x1a85[_0x25dfdf];return _0x5220da;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x51a8('0x0')]={'closed':{'type':Sequelize[_0x51a8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x51a8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x51a8('0x3')]},'note':{'type':Sequelize[_0x51a8('0x3')]},'phone':{'type':Sequelize[_0x51a8('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x51a8('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x51a8('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x51a8('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x51a8('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 7c15fa1..0586324 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 _0x38f6=['send','map','SmsInteraction','rawAttributes','fieldName','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','body','describe','addMessage','ids','omit','findOne','SmsMessage','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','spread','color','emit','smsInteractionTags:save','download','unix','toString','server','files','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','SmsAccount','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','direction','System','secret','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','err','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','destroy','then','error','stack','name'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x38f6,0x1b6));var _0x638f=function(_0x2b9c8e,_0x481857){_0x2b9c8e=_0x2b9c8e-0x0;var _0x3e6953=_0x38f6[_0x2b9c8e];return _0x3e6953;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x638f('0x0'));var BPromise=require('bluebird');var util=require(_0x638f('0x1'));var path=require(_0x638f('0x2'));var ejs=require(_0x638f('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x638f('0x4'));var interaction=require(_0x638f('0x5'));var qs=require(_0x638f('0x6'));var pdf=require(_0x638f('0x7'));var logger=require(_0x638f('0x8'))(_0x638f('0x9'));var config=require(_0x638f('0xa'));var db=require(_0x638f('0xb'))['db'];config[_0x638f('0xc')]=_[_0x638f('0xd')](config[_0x638f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x638f('0xe'))(new Redis(config[_0x638f('0xc')]));require(_0x638f('0xf'))['register'](socket);function respondWithStatusCode(_0x2c4e56,_0x5373d1){_0x5373d1=_0x5373d1||0xcc;return function(_0x32ac12){if(_0x32ac12){return _0x2c4e56[_0x638f('0x10')](_0x5373d1);}return _0x2c4e56['status'](_0x5373d1)[_0x638f('0x11')]();};}function respondWithResult(_0x7edb74,_0x4c0053){_0x4c0053=_0x4c0053||0xc8;return function(_0x497ad1){if(_0x497ad1){return _0x7edb74[_0x638f('0x12')](_0x4c0053)[_0x638f('0x13')](_0x497ad1);}};}function respondWithFilteredResult(_0x440c43,_0x472486){return function(_0x2aaaa7){if(_0x2aaaa7){var _0x59b0ae=typeof _0x472486[_0x638f('0x14')]==='undefined'&&typeof _0x472486[_0x638f('0x15')]===_0x638f('0x16');var _0x257d3c=_0x2aaaa7[_0x638f('0x17')];var _0x4c0ae5=_0x59b0ae?0x0:_0x472486['offset'];var _0x18c9ed=_0x59b0ae?_0x2aaaa7['count']:_0x472486[_0x638f('0x14')]+_0x472486[_0x638f('0x15')];var _0x2eb1d9;if(_0x18c9ed>=_0x257d3c){_0x18c9ed=_0x257d3c;_0x2eb1d9=0xc8;}else{_0x2eb1d9=0xce;}_0x440c43[_0x638f('0x12')](_0x2eb1d9);return _0x440c43['set'](_0x638f('0x18'),_0x4c0ae5+'-'+_0x18c9ed+'/'+_0x257d3c)[_0x638f('0x13')](_0x2aaaa7);}return null;};}function saveUpdates(_0x163f2b){return function(_0x3e3fa2){if(_0x3e3fa2){return _0x3e3fa2['update'](_0x163f2b)['then'](function(_0x581bdb){return _0x581bdb;});}return null;};}function removeEntity(_0x5f0fca){return function(_0x1d32c9){if(_0x1d32c9){return _0x1d32c9[_0x638f('0x19')]()[_0x638f('0x1a')](function(){_0x5f0fca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x591a27){return function(_0x1f1de6){if(!_0x1f1de6){_0x591a27[_0x638f('0x10')](0x194);}return _0x1f1de6;};}function handleError(_0x23b7a3,_0x31ce10){_0x31ce10=_0x31ce10||0x1f4;return function(_0x4cd5c4){logger[_0x638f('0x1b')](_0x4cd5c4[_0x638f('0x1c')]);if(_0x4cd5c4[_0x638f('0x1d')]){delete _0x4cd5c4['name'];}_0x23b7a3['status'](_0x31ce10)[_0x638f('0x1e')](_0x4cd5c4);};}exports['index']=function(_0x1b5f49,_0x1756fb){var _0x476133={};var _0x441b3c=_[_0x638f('0x1f')](db[_0x638f('0x20')][_0x638f('0x21')],function(_0x402e43){return{'name':_0x402e43[_0x638f('0x22')],'type':_0x402e43['type'][_0x638f('0x23')]};});_0x476133=qs[_0x638f('0x24')](_0x441b3c,_0x1b5f49);return interaction[_0x638f('0x25')](_0x638f('0x26'),_0x1b5f49[_0x638f('0x27')],_0x1b5f49[_0x638f('0x28')],_0x476133,_0x441b3c)[_0x638f('0x1a')](respondWithFilteredResult(_0x1756fb,_0x476133))[_0x638f('0x29')](handleError(_0x1756fb,null));};exports[_0x638f('0x2a')]=function(_0x1b602a,_0x735872){var _0x5f555d={'raw':![],'where':{'id':_0x1b602a[_0x638f('0x2b')]['id']}},_0x5ce283={};_0x5ce283[_0x638f('0x2c')]=_[_0x638f('0x2d')](db['SmsInteraction'][_0x638f('0x21')]);_0x5ce283[_0x638f('0x27')]=_[_0x638f('0x2d')](_0x1b602a[_0x638f('0x27')]);_0x5ce283[_0x638f('0x2e')]=_[_0x638f('0x2f')](_0x5ce283[_0x638f('0x2c')],_0x5ce283[_0x638f('0x27')]);_0x5f555d[_0x638f('0x30')]=_[_0x638f('0x2f')](_0x5ce283[_0x638f('0x2c')],qs[_0x638f('0x31')](_0x1b602a[_0x638f('0x27')][_0x638f('0x31')]));_0x5f555d[_0x638f('0x30')]=_0x5f555d[_0x638f('0x30')][_0x638f('0x32')]?_0x5f555d[_0x638f('0x30')]:_0x5ce283['model'];if(_0x1b602a['query'][_0x638f('0x33')]){_0x5f555d[_0x638f('0x34')]=[{'all':!![]}];}_0x5f555d=_['merge']({},_0x5f555d,_0x1b602a['options']);return db[_0x638f('0x20')][_0x638f('0x35')](_0x5f555d)[_0x638f('0x1a')](handleEntityNotFound(_0x735872,null))[_0x638f('0x1a')](respondWithResult(_0x735872,null))['catch'](handleError(_0x735872,null));};exports[_0x638f('0x36')]=function(_0x115dc6,_0x466886){return db[_0x638f('0x20')]['create'](_0x115dc6[_0x638f('0x37')],{})[_0x638f('0x1a')](respondWithResult(_0x466886,0xc9))[_0x638f('0x29')](handleError(_0x466886,null));};exports['update']=function(_0xe76160,_0x2f2242){if(_0xe76160[_0x638f('0x37')]['id']){delete _0xe76160[_0x638f('0x37')]['id'];}return db[_0x638f('0x20')][_0x638f('0x35')]({'where':{'id':_0xe76160[_0x638f('0x2b')]['id']}})[_0x638f('0x1a')](handleEntityNotFound(_0x2f2242,null))[_0x638f('0x1a')](saveUpdates(_0xe76160[_0x638f('0x37')],null))['then'](respondWithResult(_0x2f2242,null))[_0x638f('0x29')](handleError(_0x2f2242,null));};exports[_0x638f('0x19')]=function(_0x51a103,_0x958127){return db[_0x638f('0x20')][_0x638f('0x35')]({'where':{'id':_0x51a103[_0x638f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x958127,null))['then'](removeEntity(_0x958127,null))['catch'](handleError(_0x958127,null));};exports['describe']=function(_0x2972a3,_0x5a3ecd){return db['SmsInteraction'][_0x638f('0x38')]()[_0x638f('0x1a')](respondWithResult(_0x5a3ecd,null))[_0x638f('0x29')](handleError(_0x5a3ecd,null));};exports[_0x638f('0x39')]=function(_0x1c1818,_0x335e9c){return db['SmsMessage'][_0x638f('0x35')]({'where':{'id':_0x1c1818[_0x638f('0x2b')]['id']}})[_0x638f('0x1a')](handleEntityNotFound(_0x335e9c,null))[_0x638f('0x1a')](function(_0x2038e6){if(_0x2038e6){return _0x2038e6[_0x638f('0x39')](_0x1c1818[_0x638f('0x37')][_0x638f('0x3a')],_[_0x638f('0x3b')](_0x1c1818[_0x638f('0x37')],[_0x638f('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x335e9c,null))['catch'](handleError(_0x335e9c,null));};exports['getMessages']=function(_0x12e629,_0x5bef8c){var _0x138a4d={'raw':![],'where':{}};var _0x3870be={};var _0xa629dd={'count':0x0,'rows':[]};return db[_0x638f('0x20')][_0x638f('0x3c')]({'where':{'id':_0x12e629['params']['id']}})[_0x638f('0x1a')](handleEntityNotFound(_0x5bef8c,null))[_0x638f('0x1a')](function(_0x490c3b){if(_0x490c3b){_0x3870be[_0x638f('0x2c')]=_['keys'](db[_0x638f('0x3d')][_0x638f('0x21')]);_0x3870be['query']=_['keys'](_0x12e629['query']);_0x3870be['filters']=_[_0x638f('0x2f')](_0x3870be[_0x638f('0x2c')],_0x3870be[_0x638f('0x27')]);_0x138a4d[_0x638f('0x30')]=_['intersection'](_0x3870be[_0x638f('0x2c')],qs[_0x638f('0x31')](_0x12e629['query']['fields']));_0x138a4d[_0x638f('0x30')]=_0x138a4d[_0x638f('0x30')][_0x638f('0x32')]?_0x138a4d[_0x638f('0x30')]:_0x3870be[_0x638f('0x2c')];if(!_0x12e629[_0x638f('0x27')][_0x638f('0x3e')](_0x638f('0x3f'))){_0x138a4d[_0x638f('0x15')]=qs[_0x638f('0x15')](_0x12e629[_0x638f('0x27')][_0x638f('0x15')]);_0x138a4d['offset']=qs[_0x638f('0x14')](_0x12e629[_0x638f('0x27')]['offset']);}_0x138a4d[_0x638f('0x40')]=qs[_0x638f('0x41')](_0x12e629[_0x638f('0x27')][_0x638f('0x41')]);_0x138a4d[_0x638f('0x42')]=qs[_0x638f('0x2e')](_[_0x638f('0x43')](_0x12e629[_0x638f('0x27')],_0x3870be['filters']));_0x138a4d[_0x638f('0x42')][_0x638f('0x44')]=_0x490c3b['id'];if(_0x12e629['query'][_0x638f('0x45')]){_0x138a4d['where']=_[_0x638f('0x46')](_0x138a4d[_0x638f('0x42')],{'$or':_[_0x638f('0x1f')](_0x138a4d[_0x638f('0x30')],function(_0x112c11){var _0x26b292={};_0x26b292[_0x112c11]={'$like':'%'+_0x12e629['query'][_0x638f('0x45')]+'%'};return _0x26b292;})});}if(_0x12e629[_0x638f('0x27')][_0x638f('0x47')]){var _0x38d97a=_0x12e629[_0x638f('0x27')][_0x638f('0x47')][_0x638f('0x48')](',');var _0x4718e5={};_0x4718e5[_0x38d97a[0x0]]={'$gte':moment(_0x38d97a[0x1])[_0x638f('0x49')](_0x638f('0x4a'))};_0x138a4d[_0x638f('0x42')]=_[_0x638f('0x46')](_0x138a4d[_0x638f('0x42')],_0x4718e5);}_0x138a4d=_[_0x638f('0x46')]({},_0x138a4d,_0x12e629[_0x638f('0x4b')]);return db[_0x638f('0x3d')]['count']({'where':_0x138a4d[_0x638f('0x42')]})['then'](function(_0x3919be){_0xa629dd[_0x638f('0x17')]=_0x3919be;if(_0x12e629[_0x638f('0x27')]['includeAll']){_0x138a4d[_0x638f('0x34')]=[{'all':!![]}];}return db[_0x638f('0x3d')][_0x638f('0x25')](_0x138a4d);})[_0x638f('0x1a')](function(_0x5856bb){_0xa629dd['rows']=_0x5856bb;return _0xa629dd;});}})[_0x638f('0x1a')](respondWithFilteredResult(_0x5bef8c,_0x138a4d))[_0x638f('0x29')](handleError(_0x5bef8c,null));};exports[_0x638f('0x4c')]=function(_0x4d1afb,_0x564de4){return db[_0x638f('0x20')]['find']({'where':{'id':_0x4d1afb[_0x638f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x564de4,null))['then'](function(_0x4b8ba8){if(_0x4b8ba8){return _0x4b8ba8['setTags'](_0x4d1afb[_0x638f('0x37')][_0x638f('0x3a')],_[_0x638f('0x3b')](_0x4d1afb[_0x638f('0x37')],['ids','id'])||{})[_0x638f('0x4d')](function(){return db['Tag'][_0x638f('0x25')]({'attributes':['id',_0x638f('0x1d'),_0x638f('0x4e')],'where':{'id':_0x4d1afb[_0x638f('0x37')]['ids']}});})[_0x638f('0x1a')](function(_0x566a02){socket[_0x638f('0x4f')](_0x638f('0x50'),{'id':Number(_0x4d1afb['params']['id']),'tags':_0x566a02||[]});return{'id':Number(_0x4d1afb[_0x638f('0x2b')]['id']),'tags':_0x566a02||[]};});}})['then'](respondWithResult(_0x564de4,null))[_0x638f('0x29')](handleError(_0x564de4,null));};exports['removeTags']=function(_0x50f371,_0x32c692){return db['SmsInteraction'][_0x638f('0x35')]({'where':{'id':_0x50f371[_0x638f('0x2b')]['id']}})[_0x638f('0x1a')](handleEntityNotFound(_0x32c692,null))[_0x638f('0x1a')](function(_0x5caa35){if(_0x5caa35){return _0x5caa35['removeTags'](_0x50f371[_0x638f('0x27')][_0x638f('0x3a')]);}})['then'](respondWithStatusCode(_0x32c692,null))[_0x638f('0x29')](handleError(_0x32c692,null));};exports[_0x638f('0x51')]=function(_0x4876de,_0x2d90fe){var _0x5f3fd0=moment()[_0x638f('0x52')]()[_0x638f('0x53')]();var _0x7cdde9=path['join'](config['root'],_0x638f('0x54'),_0x638f('0x55'),'tmp');var _0x4f3b61=path[_0x638f('0x56')](_0x7cdde9,_0x5f3fd0);var _0xd65742=util[_0x638f('0x49')](_0x638f('0x57'),_0x4876de['params']['id'],_0x5f3fd0);var _0x397130=path[_0x638f('0x56')](_0x7cdde9,_0xd65742);var _0x3c215b=[];_0x3c215b[_0x638f('0x58')]({'model':db['User'],'as':_0x638f('0x59'),'attributes':['id',_0x638f('0x5a')],'raw':!![]});_0x3c215b['push']({'model':db[_0x638f('0x5b')],'as':_0x638f('0x5c'),'attributes':['id',_0x638f('0x5d'),_0x638f('0x5e')],'raw':!![]});var _0x42452e=[{'model':db[_0x638f('0x3d')],'as':_0x638f('0x5f'),'attributes':['id',_0x638f('0x37'),_0x638f('0x60'),'direction','secret','read'],'include':_0x3c215b}];_0x42452e[_0x638f('0x58')]({'model':db[_0x638f('0x61')],'as':_0x638f('0x62'),'attributes':['id','name']});_0x42452e[_0x638f('0x58')]({'model':db[_0x638f('0x59')],'as':_0x638f('0x63'),'attributes':['id',_0x638f('0x5a')]});return db[_0x638f('0x20')][_0x638f('0x35')]({'where':{'id':_0x4876de[_0x638f('0x2b')]['id']},'include':_0x42452e})[_0x638f('0x1a')](handleEntityNotFound(_0x2d90fe,null))['then'](function(_0x16fb2a){if(_0x16fb2a){var _0x3b1b04=_0x16fb2a[_0x638f('0x64')]({'plain':!![]});fs[_0x638f('0x65')](_0x4f3b61);var _0x5c2fa0={'channel':'Sms','account':_0x3b1b04[_0x638f('0x62')]['name'],'agent':_0x3b1b04[_0x638f('0x63')]?_0x3b1b04[_0x638f('0x63')][_0x638f('0x5a')]:_0x638f('0x66'),'createdAt':moment(_0x3b1b04[_0x638f('0x60')])[_0x638f('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x638f('0x53')](),'closedAt':_0x3b1b04[_0x638f('0x67')]?moment(_0x3b1b04[_0x638f('0x68')])[_0x638f('0x49')](_0x638f('0x4a'))[_0x638f('0x53')]():'','disposition':_0x3b1b04[_0x638f('0x69')],'messages':_(_0x3b1b04[_0x638f('0x5f')])[_0x638f('0x45')]({'secret':![]})['map'](function(_0x3fda36){return{'date':moment(_0x3fda36[_0x638f('0x60')])[_0x638f('0x49')](_0x638f('0x4a'))[_0x638f('0x53')](),'sender':_0x3fda36[_0x638f('0x6a')]==='out'?_0x3fda36['User']?_0x3fda36['User'][_0x638f('0x5a')]:_0x638f('0x6b'):_0x3fda36[_0x638f('0x5c')][_0x638f('0x5d')]+(_0x3fda36[_0x638f('0x5c')][_0x638f('0x5e')]?'\x20'+_0x3fda36[_0x638f('0x5c')][_0x638f('0x5e')]:''),'body':_0x3fda36[_0x638f('0x37')],'direction':_0x3fda36[_0x638f('0x6a')]==='out'?'A':'C','secret':_0x3fda36[_0x638f('0x6c')],'read':_0x3fda36[_0x638f('0x6d')]};})[_0x638f('0x6e')]()};return ejs[_0x638f('0x6f')](path[_0x638f('0x56')](config['root'],_0x638f('0x54'),'views',_0x638f('0x70')),{'interaction':_0x5c2fa0})[_0x638f('0x1a')](function(_0x14f7c3){var _0x5b1dad=path[_0x638f('0x56')](_0x4f3b61,_0x638f('0x71')+_0x3b1b04['id']+'-'+_0x5f3fd0+_0x638f('0x72'));var _0xc1ecfb={'path':_0x5b1dad,'channel':'Sms','interactionId':_0x3b1b04['id']};return pdf['createPdfFromHTML'](_0x14f7c3,_0xc1ecfb);})['then'](function(){return new BPromise(function(_0x487337,_0x84be5){zipdir(_0x4f3b61,{'saveTo':_0x397130},function(_0x56c5f9,_0x37bf7a){if(_0x56c5f9)return _0x84be5(_0x56c5f9);return _0x487337(_0x37bf7a);});})[_0x638f('0x1a')](function(){return new BPromise(function(_0xfddaa3,_0x4c5df9){rimraf(_0x4f3b61,function(_0x1f7381){if(_0x1f7381)_0x4c5df9(_0x1f7381);return _0xfddaa3();});});})['then'](function(){return _0x2d90fe[_0x638f('0x51')](_0x397130,_0xd65742,function(_0x5839ab){if(_0x5839ab){console[_0x638f('0x73')](_0x638f('0x74'),_0x5839ab);}else{fs['unlinkSync'](_0x397130);}});});});}else{return _0x2d90fe['sendStatus'](0xc8);}})['catch'](handleError(_0x2d90fe,null));}; \ No newline at end of file +var _0x0c7b=['$gte','split','format','rows','addTags','spread','color','removeTags','download','unix','toString','join','server','files','tmp','transcript-%d-%s.zip','push','User','lastName','Messages','direction','secret','Owner','get','mkdirSync','Account','fullname','N.A.','createdAt','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','out','System','Contact','firstName','value','renderFile','root','Sms','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','update','destroy','then','error','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','findAll','user','catch','show','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','SmsMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x0c7b,0x189));var _0xb0c7=function(_0x55173e,_0x3be3a1){_0x55173e=_0x55173e-0x0;var _0x2ec83e=_0x0c7b[_0x55173e];return _0x2ec83e;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb0c7('0x0'));var moment=require(_0xb0c7('0x1'));var BPromise=require(_0xb0c7('0x2'));var util=require(_0xb0c7('0x3'));var path=require('path');var ejs=require(_0xb0c7('0x4'));var fs=require('fs');var _=require(_0xb0c7('0x5'));var Redis=require('ioredis');var interaction=require(_0xb0c7('0x6'));var qs=require(_0xb0c7('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0xb0c7('0x8'))(_0xb0c7('0x9'));var config=require(_0xb0c7('0xa'));var db=require(_0xb0c7('0xb'))['db'];config[_0xb0c7('0xc')]=_[_0xb0c7('0xd')](config[_0xb0c7('0xc')],{'host':_0xb0c7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0c7('0xc')]));require(_0xb0c7('0xf'))[_0xb0c7('0x10')](socket);function respondWithStatusCode(_0x44ba22,_0x59cf4e){_0x59cf4e=_0x59cf4e||0xcc;return function(_0x14ace1){if(_0x14ace1){return _0x44ba22[_0xb0c7('0x11')](_0x59cf4e);}return _0x44ba22[_0xb0c7('0x12')](_0x59cf4e)[_0xb0c7('0x13')]();};}function respondWithResult(_0x1b9c7a,_0x2060a8){_0x2060a8=_0x2060a8||0xc8;return function(_0x5ddea7){if(_0x5ddea7){return _0x1b9c7a[_0xb0c7('0x12')](_0x2060a8)[_0xb0c7('0x14')](_0x5ddea7);}};}function respondWithFilteredResult(_0x50476e,_0x475767){return function(_0x28f868){if(_0x28f868){var _0x142461=typeof _0x475767['offset']===_0xb0c7('0x15')&&typeof _0x475767[_0xb0c7('0x16')]===_0xb0c7('0x15');var _0x83deb7=_0x28f868[_0xb0c7('0x17')];var _0x58e0a1=_0x142461?0x0:_0x475767[_0xb0c7('0x18')];var _0x5bc7b1=_0x142461?_0x28f868[_0xb0c7('0x17')]:_0x475767[_0xb0c7('0x18')]+_0x475767[_0xb0c7('0x16')];var _0x350297;if(_0x5bc7b1>=_0x83deb7){_0x5bc7b1=_0x83deb7;_0x350297=0xc8;}else{_0x350297=0xce;}_0x50476e[_0xb0c7('0x12')](_0x350297);return _0x50476e['set']('Content-Range',_0x58e0a1+'-'+_0x5bc7b1+'/'+_0x83deb7)[_0xb0c7('0x14')](_0x28f868);}return null;};}function saveUpdates(_0x562d28){return function(_0x105714){if(_0x105714){return _0x105714[_0xb0c7('0x19')](_0x562d28)['then'](function(_0x1390a6){return _0x1390a6;});}return null;};}function removeEntity(_0x40ab8f){return function(_0xa8e3f4){if(_0xa8e3f4){return _0xa8e3f4[_0xb0c7('0x1a')]()[_0xb0c7('0x1b')](function(){_0x40ab8f[_0xb0c7('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c19db){return function(_0x488722){if(!_0x488722){_0x2c19db['sendStatus'](0x194);}return _0x488722;};}function handleError(_0x4f3b28,_0x11cae7){_0x11cae7=_0x11cae7||0x1f4;return function(_0x428d05){logger[_0xb0c7('0x1c')](_0x428d05['stack']);if(_0x428d05[_0xb0c7('0x1d')]){delete _0x428d05[_0xb0c7('0x1d')];}_0x4f3b28['status'](_0x11cae7)[_0xb0c7('0x1e')](_0x428d05);};}exports[_0xb0c7('0x1f')]=function(_0x2984a9,_0x44efbd){var _0x3bc3a9={};var _0x366328=_[_0xb0c7('0x20')](db[_0xb0c7('0x21')][_0xb0c7('0x22')],function(_0x45d2a0){return{'name':_0x45d2a0[_0xb0c7('0x23')],'type':_0x45d2a0[_0xb0c7('0x24')][_0xb0c7('0x25')]};});_0x3bc3a9=qs['getOptions'](_0x366328,_0x2984a9);return interaction[_0xb0c7('0x26')]('sms',_0x2984a9['query'],_0x2984a9[_0xb0c7('0x27')],_0x3bc3a9,_0x366328)[_0xb0c7('0x1b')](respondWithFilteredResult(_0x44efbd,_0x3bc3a9))[_0xb0c7('0x28')](handleError(_0x44efbd,null));};exports[_0xb0c7('0x29')]=function(_0x30e2a2,_0x475790){var _0x1deef0={'raw':![],'where':{'id':_0x30e2a2['params']['id']}},_0x5a90e5={};_0x5a90e5[_0xb0c7('0x2a')]=_[_0xb0c7('0x2b')](db[_0xb0c7('0x21')]['rawAttributes']);_0x5a90e5[_0xb0c7('0x2c')]=_[_0xb0c7('0x2b')](_0x30e2a2[_0xb0c7('0x2c')]);_0x5a90e5[_0xb0c7('0x2d')]=_[_0xb0c7('0x2e')](_0x5a90e5['model'],_0x5a90e5['query']);_0x1deef0[_0xb0c7('0x2f')]=_[_0xb0c7('0x2e')](_0x5a90e5[_0xb0c7('0x2a')],qs[_0xb0c7('0x30')](_0x30e2a2[_0xb0c7('0x2c')][_0xb0c7('0x30')]));_0x1deef0['attributes']=_0x1deef0[_0xb0c7('0x2f')][_0xb0c7('0x31')]?_0x1deef0[_0xb0c7('0x2f')]:_0x5a90e5[_0xb0c7('0x2a')];if(_0x30e2a2[_0xb0c7('0x2c')][_0xb0c7('0x32')]){_0x1deef0[_0xb0c7('0x33')]=[{'all':!![]}];}_0x1deef0=_[_0xb0c7('0x34')]({},_0x1deef0,_0x30e2a2[_0xb0c7('0x35')]);return db[_0xb0c7('0x21')][_0xb0c7('0x36')](_0x1deef0)[_0xb0c7('0x1b')](handleEntityNotFound(_0x475790,null))[_0xb0c7('0x1b')](respondWithResult(_0x475790,null))[_0xb0c7('0x28')](handleError(_0x475790,null));};exports[_0xb0c7('0x37')]=function(_0x536d66,_0x5bd7d5){return db[_0xb0c7('0x21')]['create'](_0x536d66['body'],{})[_0xb0c7('0x1b')](respondWithResult(_0x5bd7d5,0xc9))[_0xb0c7('0x28')](handleError(_0x5bd7d5,null));};exports[_0xb0c7('0x19')]=function(_0x1bc694,_0x46c781){if(_0x1bc694[_0xb0c7('0x38')]['id']){delete _0x1bc694['body']['id'];}return db['SmsInteraction'][_0xb0c7('0x36')]({'where':{'id':_0x1bc694[_0xb0c7('0x39')]['id']}})[_0xb0c7('0x1b')](handleEntityNotFound(_0x46c781,null))[_0xb0c7('0x1b')](saveUpdates(_0x1bc694[_0xb0c7('0x38')],null))[_0xb0c7('0x1b')](respondWithResult(_0x46c781,null))[_0xb0c7('0x28')](handleError(_0x46c781,null));};exports['destroy']=function(_0x18493a,_0x30bf0c){return db[_0xb0c7('0x21')]['find']({'where':{'id':_0x18493a['params']['id']}})[_0xb0c7('0x1b')](handleEntityNotFound(_0x30bf0c,null))[_0xb0c7('0x1b')](removeEntity(_0x30bf0c,null))[_0xb0c7('0x28')](handleError(_0x30bf0c,null));};exports[_0xb0c7('0x3a')]=function(_0x41f822,_0x8e6e91){return db[_0xb0c7('0x21')][_0xb0c7('0x3a')]()[_0xb0c7('0x1b')](respondWithResult(_0x8e6e91,null))[_0xb0c7('0x28')](handleError(_0x8e6e91,null));};exports[_0xb0c7('0x3b')]=function(_0x1639a2,_0x2aeca0){return db[_0xb0c7('0x3c')][_0xb0c7('0x36')]({'where':{'id':_0x1639a2[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x2aeca0,null))['then'](function(_0x367bb8){if(_0x367bb8){return _0x367bb8[_0xb0c7('0x3b')](_0x1639a2['body'][_0xb0c7('0x3d')],_[_0xb0c7('0x3e')](_0x1639a2[_0xb0c7('0x38')],[_0xb0c7('0x3d'),'id'])||{});}})[_0xb0c7('0x1b')](respondWithResult(_0x2aeca0,null))['catch'](handleError(_0x2aeca0,null));};exports[_0xb0c7('0x3f')]=function(_0xa5897,_0x57c4d7){var _0x48c20b={'raw':![],'where':{}};var _0x305995={};var _0x385c80={'count':0x0,'rows':[]};return db[_0xb0c7('0x21')]['findOne']({'where':{'id':_0xa5897[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x57c4d7,null))[_0xb0c7('0x1b')](function(_0x10bd0b){if(_0x10bd0b){_0x305995[_0xb0c7('0x2a')]=_[_0xb0c7('0x2b')](db['SmsMessage'][_0xb0c7('0x22')]);_0x305995[_0xb0c7('0x2c')]=_[_0xb0c7('0x2b')](_0xa5897[_0xb0c7('0x2c')]);_0x305995['filters']=_[_0xb0c7('0x2e')](_0x305995[_0xb0c7('0x2a')],_0x305995[_0xb0c7('0x2c')]);_0x48c20b['attributes']=_[_0xb0c7('0x2e')](_0x305995[_0xb0c7('0x2a')],qs[_0xb0c7('0x30')](_0xa5897[_0xb0c7('0x2c')][_0xb0c7('0x30')]));_0x48c20b[_0xb0c7('0x2f')]=_0x48c20b[_0xb0c7('0x2f')][_0xb0c7('0x31')]?_0x48c20b['attributes']:_0x305995['model'];if(!_0xa5897['query'][_0xb0c7('0x40')](_0xb0c7('0x41'))){_0x48c20b['limit']=qs[_0xb0c7('0x16')](_0xa5897[_0xb0c7('0x2c')]['limit']);_0x48c20b['offset']=qs[_0xb0c7('0x18')](_0xa5897[_0xb0c7('0x2c')]['offset']);}_0x48c20b[_0xb0c7('0x42')]=qs['sort'](_0xa5897['query'][_0xb0c7('0x43')]);_0x48c20b[_0xb0c7('0x44')]=qs[_0xb0c7('0x2d')](_['pick'](_0xa5897[_0xb0c7('0x2c')],_0x305995[_0xb0c7('0x2d')]));_0x48c20b[_0xb0c7('0x44')][_0xb0c7('0x45')]=_0x10bd0b['id'];if(_0xa5897[_0xb0c7('0x2c')][_0xb0c7('0x46')]){_0x48c20b['where']=_[_0xb0c7('0x34')](_0x48c20b[_0xb0c7('0x44')],{'$or':_[_0xb0c7('0x20')](_0x48c20b['attributes'],function(_0x3d23a5){var _0x3f88f0={};_0x3f88f0[_0x3d23a5]={'$like':'%'+_0xa5897['query'][_0xb0c7('0x46')]+'%'};return _0x3f88f0;})});}if(_0xa5897[_0xb0c7('0x2c')][_0xb0c7('0x47')]){var _0x440463=_0xa5897[_0xb0c7('0x2c')]['$gte'][_0xb0c7('0x48')](',');var _0x3378ac={};_0x3378ac[_0x440463[0x0]]={'$gte':moment(_0x440463[0x1])[_0xb0c7('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x48c20b[_0xb0c7('0x44')]=_['merge'](_0x48c20b[_0xb0c7('0x44')],_0x3378ac);}_0x48c20b=_[_0xb0c7('0x34')]({},_0x48c20b,_0xa5897[_0xb0c7('0x35')]);return db[_0xb0c7('0x3c')][_0xb0c7('0x17')]({'where':_0x48c20b[_0xb0c7('0x44')]})[_0xb0c7('0x1b')](function(_0x3e3da0){_0x385c80[_0xb0c7('0x17')]=_0x3e3da0;if(_0xa5897[_0xb0c7('0x2c')]['includeAll']){_0x48c20b[_0xb0c7('0x33')]=[{'all':!![]}];}return db[_0xb0c7('0x3c')]['findAll'](_0x48c20b);})['then'](function(_0xffab9a){_0x385c80[_0xb0c7('0x4a')]=_0xffab9a;return _0x385c80;});}})[_0xb0c7('0x1b')](respondWithFilteredResult(_0x57c4d7,_0x48c20b))[_0xb0c7('0x28')](handleError(_0x57c4d7,null));};exports[_0xb0c7('0x4b')]=function(_0x139e9f,_0x36843d){return db[_0xb0c7('0x21')][_0xb0c7('0x36')]({'where':{'id':_0x139e9f[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x36843d,null))['then'](function(_0x5d0913){if(_0x5d0913){return _0x5d0913['setTags'](_0x139e9f[_0xb0c7('0x38')][_0xb0c7('0x3d')],_[_0xb0c7('0x3e')](_0x139e9f[_0xb0c7('0x38')],[_0xb0c7('0x3d'),'id'])||{})[_0xb0c7('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb0c7('0x1d'),_0xb0c7('0x4d')],'where':{'id':_0x139e9f[_0xb0c7('0x38')]['ids']}});})[_0xb0c7('0x1b')](function(_0xaa6135){socket['emit']('smsInteractionTags:save',{'id':Number(_0x139e9f['params']['id']),'tags':_0xaa6135||[]});return{'id':Number(_0x139e9f[_0xb0c7('0x39')]['id']),'tags':_0xaa6135||[]};});}})[_0xb0c7('0x1b')](respondWithResult(_0x36843d,null))[_0xb0c7('0x28')](handleError(_0x36843d,null));};exports[_0xb0c7('0x4e')]=function(_0x4b6b4c,_0x1bade3){return db[_0xb0c7('0x21')][_0xb0c7('0x36')]({'where':{'id':_0x4b6b4c[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x1bade3,null))[_0xb0c7('0x1b')](function(_0x286ebc){if(_0x286ebc){return _0x286ebc[_0xb0c7('0x4e')](_0x4b6b4c['query'][_0xb0c7('0x3d')]);}})[_0xb0c7('0x1b')](respondWithStatusCode(_0x1bade3,null))['catch'](handleError(_0x1bade3,null));};exports[_0xb0c7('0x4f')]=function(_0x578cae,_0x344ff6){var _0x30f094=moment()[_0xb0c7('0x50')]()[_0xb0c7('0x51')]();var _0x5f5bb9=path[_0xb0c7('0x52')](config['root'],_0xb0c7('0x53'),_0xb0c7('0x54'),_0xb0c7('0x55'));var _0x2688fe=path[_0xb0c7('0x52')](_0x5f5bb9,_0x30f094);var _0x511bb5=util[_0xb0c7('0x49')](_0xb0c7('0x56'),_0x578cae['params']['id'],_0x30f094);var _0x302be2=path[_0xb0c7('0x52')](_0x5f5bb9,_0x511bb5);var _0x37962f=[];_0x37962f[_0xb0c7('0x57')]({'model':db['User'],'as':_0xb0c7('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x37962f[_0xb0c7('0x57')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0xb0c7('0x59')],'raw':!![]});var _0x36300b=[{'model':db['SmsMessage'],'as':_0xb0c7('0x5a'),'attributes':['id',_0xb0c7('0x38'),'createdAt',_0xb0c7('0x5b'),_0xb0c7('0x5c'),'read'],'include':_0x37962f}];_0x36300b['push']({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xb0c7('0x1d')]});_0x36300b['push']({'model':db[_0xb0c7('0x58')],'as':_0xb0c7('0x5d'),'attributes':['id','fullname']});return db[_0xb0c7('0x21')][_0xb0c7('0x36')]({'where':{'id':_0x578cae['params']['id']},'include':_0x36300b})['then'](handleEntityNotFound(_0x344ff6,null))[_0xb0c7('0x1b')](function(_0x1ef51b){if(_0x1ef51b){var _0x546480=_0x1ef51b[_0xb0c7('0x5e')]({'plain':!![]});fs[_0xb0c7('0x5f')](_0x2688fe);var _0x24409a={'channel':'Sms','account':_0x546480[_0xb0c7('0x60')][_0xb0c7('0x1d')],'agent':_0x546480[_0xb0c7('0x5d')]?_0x546480[_0xb0c7('0x5d')][_0xb0c7('0x61')]:_0xb0c7('0x62'),'createdAt':moment(_0x546480[_0xb0c7('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x546480[_0xb0c7('0x64')]?moment(_0x546480[_0xb0c7('0x65')])[_0xb0c7('0x49')](_0xb0c7('0x66'))[_0xb0c7('0x51')]():'','disposition':_0x546480[_0xb0c7('0x67')],'messages':_(_0x546480['Messages'])[_0xb0c7('0x46')]({'secret':![]})[_0xb0c7('0x20')](function(_0x291d6a){return{'date':moment(_0x291d6a[_0xb0c7('0x63')])[_0xb0c7('0x49')](_0xb0c7('0x66'))['toString'](),'sender':_0x291d6a[_0xb0c7('0x5b')]===_0xb0c7('0x68')?_0x291d6a[_0xb0c7('0x58')]?_0x291d6a['User'][_0xb0c7('0x61')]:_0xb0c7('0x69'):_0x291d6a[_0xb0c7('0x6a')][_0xb0c7('0x6b')]+(_0x291d6a[_0xb0c7('0x6a')]['lastName']?'\x20'+_0x291d6a[_0xb0c7('0x6a')][_0xb0c7('0x59')]:''),'body':_0x291d6a[_0xb0c7('0x38')],'direction':_0x291d6a[_0xb0c7('0x5b')]===_0xb0c7('0x68')?'A':'C','secret':_0x291d6a[_0xb0c7('0x5c')],'read':_0x291d6a['read']};})[_0xb0c7('0x6c')]()};return ejs[_0xb0c7('0x6d')](path[_0xb0c7('0x52')](config[_0xb0c7('0x6e')],_0xb0c7('0x53'),'views','downloadInteraction.ejs'),{'interaction':_0x24409a})[_0xb0c7('0x1b')](function(_0x284796){var _0x4d9e7b=path[_0xb0c7('0x52')](_0x2688fe,'transcript-'+_0x546480['id']+'-'+_0x30f094+'.pdf');var _0x3891ce={'path':_0x4d9e7b,'channel':_0xb0c7('0x6f'),'interactionId':_0x546480['id']};return pdf[_0xb0c7('0x70')](_0x284796,_0x3891ce);})[_0xb0c7('0x1b')](function(){return new BPromise(function(_0x226f51,_0x34915b){zipdir(_0x2688fe,{'saveTo':_0x302be2},function(_0x255ecc,_0x576bac){if(_0x255ecc)return _0x34915b(_0x255ecc);return _0x226f51(_0x576bac);});})[_0xb0c7('0x1b')](function(){return new BPromise(function(_0x2f1c5d,_0x14ee92){rimraf(_0x2688fe,function(_0x20fb47){if(_0x20fb47)_0x14ee92(_0x20fb47);return _0x2f1c5d();});});})['then'](function(){return _0x344ff6[_0xb0c7('0x4f')](_0x302be2,_0x511bb5,function(_0x4a325b){if(_0x4a325b){console[_0xb0c7('0x71')](_0xb0c7('0x72'),_0x4a325b);}else{fs[_0xb0c7('0x73')](_0x302be2);}});});});}else{return _0x344ff6[_0xb0c7('0x11')](0xc8);}})['catch'](handleError(_0x344ff6,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index cf44ffa..953a92a 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 _0x6d11=['../../mysqldb','SmsInteraction','SmsMessage','save','update','getUsers','then','setDataValue','findAll','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x51e49d,_0x8c7140){var _0x2c320c=function(_0x47790e){while(--_0x47790e){_0x51e49d['push'](_0x51e49d['shift']());}};_0x2c320c(++_0x8c7140);}(_0x6d11,0xbf));var _0x16d1=function(_0x5c4423,_0x4043a9){_0x5c4423=_0x5c4423-0x0;var _0x38e00b=_0x6d11[_0x5c4423];return _0x38e00b;};'use strict';var EventEmitter=require(_0x16d1('0x0'));var SmsInteraction=require(_0x16d1('0x1'))['db'][_0x16d1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x16d1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16d1('0x4'),'afterUpdate':_0x16d1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48754e){return function(_0x3e0e86,_0x46f7d7,_0x3eb9e2){_0x3e0e86[_0x16d1('0x6')]({'attributes':['id'],'raw':!![]})[_0x16d1('0x7')](function(_0x150217){_0x3e0e86[_0x16d1('0x8')]('Users',_0x150217['map'](function(_0x4fca47){return{'id':_0x4fca47['id']};}));return SmsMessage[_0x16d1('0x9')]({'where':{'SmsInteractionId':_0x3e0e86['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16d1('0x7')](function(_0xe67758){_0x3e0e86[_0x16d1('0x8')]('unreadMessages',_0xe67758[_0x16d1('0xa')]);SmsInteractionEvents[_0x16d1('0xb')](_0x48754e+':'+_0x3e0e86['id'],_0x3e0e86);SmsInteractionEvents[_0x16d1('0xb')](_0x48754e,_0x3e0e86);_0x3eb9e2(null);})[_0x16d1('0xc')](_0x3eb9e2(null));};}for(var e in events){if(events[_0x16d1('0xd')](e)){var event=events[e];SmsInteraction[_0x16d1('0xe')](e,emitEvent(event));}}module[_0x16d1('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x475094,_0x3e9c29){var _0x150dcc=function(_0x46768a){while(--_0x46768a){_0x475094['push'](_0x475094['shift']());}};_0x150dcc(++_0x3e9c29);}(_0x236c,0x155));var _0xc236=function(_0x429737,_0x31316d){_0x429737=_0x429737-0x0;var _0x22e8a4=_0x236c[_0x429737];return _0x22e8a4;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('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 d606200..1d25033 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 _0x01b9=['moment','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','lodash','util','../../config/logger','api'];(function(_0x57db9d,_0x36e2bf){var _0x3367d5=function(_0xf365c6){while(--_0xf365c6){_0x57db9d['push'](_0x57db9d['shift']());}};_0x3367d5(++_0x36e2bf);}(_0x01b9,0x146));var _0x901b=function(_0x1ec4cc,_0x220aed){_0x1ec4cc=_0x1ec4cc-0x0;var _0x56df02=_0x01b9[_0x1ec4cc];return _0x56df02;};'use strict';var _=require(_0x901b('0x0'));var util=require(_0x901b('0x1'));var logger=require(_0x901b('0x2'))(_0x901b('0x3'));var moment=require(_0x901b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x901b('0x5'));var rimraf=require(_0x901b('0x6'));var config=require(_0x901b('0x7'));var attributes=require('./smsInteraction.attributes');module[_0x901b('0x8')]=function(_0xb8cccc,_0x60258){return _0xb8cccc[_0x901b('0x9')](_0x901b('0xa'),attributes,{'tableName':_0x901b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fc382,_0x4dd8c8,_0x1a9153){if(_0x1fc382[_0x901b('0xc')](_0x901b('0xd'))){_0x1fc382[_0x901b('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1a9153(null,_0x1fc382);}}});}; \ No newline at end of file +var _0x2ad1=['request-promise','rimraf','./smsInteraction.attributes','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x50fcfb,_0x2f1558){var _0x271dc4=function(_0x241862){while(--_0x241862){_0x50fcfb['push'](_0x50fcfb['shift']());}};_0x271dc4(++_0x2f1558);}(_0x2ad1,0x141));var _0x12ad=function(_0xc5ed9,_0x435e78){_0xc5ed9=_0xc5ed9-0x0;var _0x4c7db7=_0x2ad1[_0xc5ed9];return _0x4c7db7;};'use strict';var _=require('lodash');var util=require(_0x12ad('0x0'));var logger=require(_0x12ad('0x1'))(_0x12ad('0x2'));var moment=require(_0x12ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x12ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12ad('0x5'));var config=require('../../config/environment');var attributes=require(_0x12ad('0x6'));module['exports']=function(_0x31d42f,_0x30d2a4){return _0x31d42f[_0x12ad('0x7')](_0x12ad('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b4044,_0x1c3f1f,_0x3cb25d){if(_0x3b4044[_0x12ad('0x9')]('closed')){_0x3b4044[_0x12ad('0xa')]=moment()[_0x12ad('0xb')](_0x12ad('0xc'));}_0x3cb25d(null,_0x3b4044);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 73d864b..5575cda 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 _0x612e=['SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateSmsInteraction','update','options','where','attributes','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','omit','body','spread','AddTags','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x1026af,_0xf9dce6){var _0x4c1080=function(_0x2c0fe1){while(--_0x2c0fe1){_0x1026af['push'](_0x1026af['shift']());}};_0x4c1080(++_0xf9dce6);}(_0x612e,0xff));var _0xe612=function(_0x1304e3,_0x536432){_0x1304e3=_0x1304e3-0x0;var _0x14d917=_0x612e[_0x1304e3];return _0x14d917;};'use strict';var _=require('lodash');var util=require(_0xe612('0x0'));var moment=require(_0xe612('0x1'));var BPromise=require('bluebird');var rs=require(_0xe612('0x2'));var fs=require('fs');var Redis=require(_0xe612('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe612('0x4'));var logger=require(_0xe612('0x5'))('rpc');var config=require(_0xe612('0x6'));var jayson=require(_0xe612('0x7'));var client=jayson[_0xe612('0x8')][_0xe612('0x9')]({'port':0x232a});config[_0xe612('0xa')]=_[_0xe612('0xb')](config[_0xe612('0xa')],{'host':_0xe612('0xc'),'port':0x18eb});var socket=require(_0xe612('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xe612('0xe')](socket);function respondWithRpcPromise(_0x43ceb8,_0x4c4aac,_0x1919f6){return new BPromise(function(_0x19197b,_0x27e051){return client[_0xe612('0xf')](_0x43ceb8,_0x1919f6)[_0xe612('0x10')](function(_0x1c351c){logger[_0xe612('0x11')](_0xe612('0x12'),_0x4c4aac,_0xe612('0x13'));logger[_0xe612('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x4c4aac,'request\x20sent',JSON[_0xe612('0x15')](_0x1c351c));if(_0x1c351c[_0xe612('0x16')]){if(_0x1c351c['error']['code']===0x1f4){logger[_0xe612('0x16')](_0xe612('0x12'),_0x4c4aac,_0x1c351c['error'][_0xe612('0x17')]);return _0x27e051(_0x1c351c[_0xe612('0x16')]['message']);}logger['error'](_0xe612('0x12'),_0x4c4aac,_0x1c351c['error']['message']);return _0x19197b(_0x1c351c[_0xe612('0x16')][_0xe612('0x17')]);}else{logger[_0xe612('0x11')](_0xe612('0x12'),_0x4c4aac,'request\x20sent');_0x19197b(_0x1c351c[_0xe612('0x18')][_0xe612('0x17')]);}})[_0xe612('0x19')](function(_0x477f7b){logger[_0xe612('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x4c4aac,_0x477f7b);_0x27e051(_0x477f7b);});});}exports[_0xe612('0x1a')]=function(_0xc09268){var _0x4005b8=this;return new Promise(function(_0x355a6e,_0x3d5790){return db['SmsInteraction'][_0xe612('0x1b')](_0xc09268['body'],{'raw':_0xc09268[_0xe612('0x1c')]?_0xc09268[_0xe612('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc09268['options']?_0xc09268['options'][_0xe612('0x1d')]||null:null,'attributes':_0xc09268[_0xe612('0x1c')]?_0xc09268[_0xe612('0x1c')][_0xe612('0x1e')]||null:null,'limit':_0xc09268['options']?_0xc09268[_0xe612('0x1c')]['limit']||null:null})[_0xe612('0x10')](function(_0x41fcf0){logger['info'](_0xe612('0x1a'),_0xc09268);logger[_0xe612('0x14')](_0xe612('0x1a'),_0xc09268,JSON[_0xe612('0x15')](_0x41fcf0));_0x355a6e(_0x41fcf0);})[_0xe612('0x19')](function(_0x311228){logger['error'](_0xe612('0x1a'),_0x311228['message'],_0xc09268);_0x3d5790(_0x4005b8[_0xe612('0x16')](0x1f4,_0x311228[_0xe612('0x17')]));});});};exports[_0xe612('0x1f')]=function(_0x1ffa8d){return new Promise(function(_0x5b0b19,_0x316aa8){return db[_0xe612('0x20')]['find']({'where':_0x1ffa8d[_0xe612('0x1c')]?_0x1ffa8d['options'][_0xe612('0x1d')]||null:null})[_0xe612('0x10')](function(_0xa98981){if(_0xa98981){return _0xa98981[_0xe612('0x21')](_0x1ffa8d['body'][_0xe612('0x22')],_[_0xe612('0x23')](_0x1ffa8d[_0xe612('0x24')],[_0xe612('0x22'),'id'])||{});}})[_0xe612('0x25')](function(_0x4e492d){logger[_0xe612('0x11')](_0xe612('0x26'),_0x1ffa8d);logger[_0xe612('0x14')](_0xe612('0x26'),_0x1ffa8d,JSON[_0xe612('0x15')](_0x4e492d));_0x5b0b19(_0x4e492d);})[_0xe612('0x19')](function(_0x4046d0){logger['error']('AddTags',_0x4046d0[_0xe612('0x17')],_0x1ffa8d);_0x316aa8(_this[_0xe612('0x16')](0x1f4,_0x4046d0[_0xe612('0x17')]));});});}; \ No newline at end of file +var _0x9ea1=['randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','limit','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x1bd3a2,_0x6b37a7){var _0x1bb4b7=function(_0x2376f9){while(--_0x2376f9){_0x1bd3a2['push'](_0x1bd3a2['shift']());}};_0x1bb4b7(++_0x6b37a7);}(_0x9ea1,0x15b));var _0x19ea=function(_0x195cb2,_0x250e8d){_0x195cb2=_0x195cb2-0x0;var _0x1b45ea=_0x9ea1[_0x195cb2];return _0x1b45ea;};'use strict';var _=require(_0x19ea('0x0'));var util=require(_0x19ea('0x1'));var moment=require(_0x19ea('0x2'));var BPromise=require(_0x19ea('0x3'));var rs=require(_0x19ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19ea('0x5'))['db'];var utils=require(_0x19ea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x19ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x19ea('0x8')][_0x19ea('0x9')]({'port':0x232a});config[_0x19ea('0xa')]=_['defaults'](config[_0x19ea('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x19ea('0xb'))(new Redis(config[_0x19ea('0xa')]));require(_0x19ea('0xc'))[_0x19ea('0xd')](socket);function respondWithRpcPromise(_0xaa9448,_0x50e328,_0x13f3ff){return new BPromise(function(_0x535b23,_0x5d6e5f){return client[_0x19ea('0xe')](_0xaa9448,_0x13f3ff)[_0x19ea('0xf')](function(_0x5c68ae){logger[_0x19ea('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x50e328,_0x19ea('0x11'));logger[_0x19ea('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x50e328,_0x19ea('0x11'),JSON[_0x19ea('0x13')](_0x5c68ae));if(_0x5c68ae[_0x19ea('0x14')]){if(_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x15')]===0x1f4){logger['error'](_0x19ea('0x16'),_0x50e328,_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);return _0x5d6e5f(_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);}logger[_0x19ea('0x14')](_0x19ea('0x16'),_0x50e328,_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);return _0x535b23(_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);}else{logger['info'](_0x19ea('0x16'),_0x50e328,'request\x20sent');_0x535b23(_0x5c68ae[_0x19ea('0x18')][_0x19ea('0x17')]);}})[_0x19ea('0x19')](function(_0x22fa38){logger[_0x19ea('0x14')](_0x19ea('0x16'),_0x50e328,_0x22fa38);_0x5d6e5f(_0x22fa38);});});}exports[_0x19ea('0x1a')]=function(_0x28cae4){var _0x2ab510=this;return new Promise(function(_0x996016,_0x9cf439){return db[_0x19ea('0x1b')][_0x19ea('0x1c')](_0x28cae4[_0x19ea('0x1d')],{'raw':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4[_0x19ea('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4['options'][_0x19ea('0x1f')]||null:null,'attributes':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4['options']['attributes']||null:null,'limit':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4[_0x19ea('0x1e')][_0x19ea('0x20')]||null:null})['then'](function(_0x5bf42b){logger[_0x19ea('0x10')](_0x19ea('0x1a'),_0x28cae4);logger[_0x19ea('0x12')](_0x19ea('0x1a'),_0x28cae4,JSON[_0x19ea('0x13')](_0x5bf42b));_0x996016(_0x5bf42b);})[_0x19ea('0x19')](function(_0x479f86){logger[_0x19ea('0x14')](_0x19ea('0x1a'),_0x479f86[_0x19ea('0x17')],_0x28cae4);_0x9cf439(_0x2ab510['error'](0x1f4,_0x479f86[_0x19ea('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x4dc7d1){return new Promise(function(_0x4154b6,_0x47360a){return db[_0x19ea('0x1b')][_0x19ea('0x21')]({'where':_0x4dc7d1[_0x19ea('0x1e')]?_0x4dc7d1[_0x19ea('0x1e')]['where']||null:null})[_0x19ea('0xf')](function(_0x159e06){if(_0x159e06){return _0x159e06[_0x19ea('0x22')](_0x4dc7d1['body']['ids'],_[_0x19ea('0x23')](_0x4dc7d1[_0x19ea('0x1d')],[_0x19ea('0x24'),'id'])||{});}})[_0x19ea('0x25')](function(_0x3b881a){logger[_0x19ea('0x10')](_0x19ea('0x26'),_0x4dc7d1);logger[_0x19ea('0x12')](_0x19ea('0x26'),_0x4dc7d1,JSON[_0x19ea('0x13')](_0x3b881a));_0x4154b6(_0x3b881a);})[_0x19ea('0x19')](function(_0x431585){logger[_0x19ea('0x14')](_0x19ea('0x26'),_0x431585[_0x19ea('0x17')],_0x4dc7d1);_0x47360a(_this[_0x19ea('0x14')](0x1f4,_0x431585['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 13a12aa..aceb76a 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 _0xa2fe=['remove','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xa2fe,0x16f));var _0xea2f=function(_0x3e954d,_0x4cc3a0){_0x3e954d=_0x3e954d-0x0;var _0x59649b=_0xa2fe[_0x3e954d];return _0x59649b;};'use strict';var SmsInteractionEvents=require(_0xea2f('0x0'));var events=[_0xea2f('0x1'),_0xea2f('0x2'),_0xea2f('0x3')];function createListener(_0x1f73c8,_0x1bc6bd){return function(_0x20b00d){_0x1bc6bd[_0xea2f('0x4')](_0x1f73c8,_0x20b00d);};}function removeListener(_0x38da4e,_0x4796b7){return function(){SmsInteractionEvents[_0xea2f('0x5')](_0x38da4e,_0x4796b7);};}exports[_0xea2f('0x6')]=function(_0x5b4e9b){for(var _0x2b7c73=0x0,_0x548f18=events[_0xea2f('0x7')];_0x2b7c73<_0x548f18;_0x2b7c73++){var _0x567c42=events[_0x2b7c73];var _0x53133e=createListener(_0xea2f('0x8')+_0x567c42,_0x5b4e9b);SmsInteractionEvents['on'](_0x567c42,_0x53133e);}}; \ No newline at end of file +var _0x8481=['register','length','smsInteraction:','save','remove'];(function(_0x261832,_0x5a24e6){var _0x186143=function(_0x54e5d8){while(--_0x54e5d8){_0x261832['push'](_0x261832['shift']());}};_0x186143(++_0x5a24e6);}(_0x8481,0x157));var _0x1848=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x8481[_0x2389bc];return _0x170548;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x1848('0x0'),_0x1848('0x1'),'update'];function createListener(_0x1a4afa,_0x2041ba){return function(_0x583af7){_0x2041ba['emit'](_0x1a4afa,_0x583af7);};}function removeListener(_0x1503a7,_0x4042fb){return function(){SmsInteractionEvents['removeListener'](_0x1503a7,_0x4042fb);};}exports[_0x1848('0x2')]=function(_0x4c8f1c){for(var _0x51fe4a=0x0,_0x3df820=events[_0x1848('0x3')];_0x51fe4a<_0x3df820;_0x51fe4a++){var _0x1bdbc2=events[_0x51fe4a];var _0x424209=createListener(_0x1848('0x4')+_0x1bdbc2,_0x4c8f1c);SmsInteractionEvents['on'](_0x1bdbc2,_0x424209);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 6a1c118..07665c1 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 _0xa883=['fs-extra','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','sms','smsmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa883,0x1f2));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3a88('0x0'));var util=require(_0x3a88('0x1'));var path=require(_0x3a88('0x2'));var timeout=require(_0x3a88('0x3'));var express=require(_0x3a88('0x4'));var router=express[_0x3a88('0x5')]();var fs_extra=require(_0x3a88('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a88('0x7'));var controller=require(_0x3a88('0x8'));router['get']('/',auth[_0x3a88('0x9')](),controller[_0x3a88('0xa')]);router[_0x3a88('0xb')](_0x3a88('0xc'),auth[_0x3a88('0x9')](),controller[_0x3a88('0xd')]);router['get'](_0x3a88('0xe'),auth[_0x3a88('0x9')](),controller[_0x3a88('0xf')]);router[_0x3a88('0x10')]('/',auth[_0x3a88('0x9')](),interaction['tracked'](_0x3a88('0x11'),_0x3a88('0x12')),controller[_0x3a88('0x13')]);router[_0x3a88('0x10')]('/:id/status',controller['status']);router[_0x3a88('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3a88('0x15')]);router[_0x3a88('0x14')]('/:id/accept',auth[_0x3a88('0x9')](),controller[_0x3a88('0x16')]);router[_0x3a88('0x14')](_0x3a88('0x17'),auth[_0x3a88('0x9')](),controller[_0x3a88('0x18')]);router[_0x3a88('0x19')]('/:id',auth[_0x3a88('0x9')](),controller[_0x3a88('0x1a')]);module[_0x3a88('0x1b')]=router; \ No newline at end of file +var _0x7c13=['./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','tracked','sms','create','post','/:id/status','status','put','update','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x490bab,_0x2113d0){var _0x35c724=function(_0x26a753){while(--_0x26a753){_0x490bab['push'](_0x490bab['shift']());}};_0x35c724(++_0x2113d0);}(_0x7c13,0xfd));var _0x37c1=function(_0x4057f9,_0x17c5b5){_0x4057f9=_0x4057f9-0x0;var _0x5552b7=_0x7c13[_0x4057f9];return _0x5552b7;};'use strict';var multer=require(_0x37c1('0x0'));var util=require(_0x37c1('0x1'));var path=require('path');var timeout=require(_0x37c1('0x2'));var express=require(_0x37c1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37c1('0x4'));var interaction=require(_0x37c1('0x5'));var config=require(_0x37c1('0x6'));var controller=require(_0x37c1('0x7'));router[_0x37c1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x37c1('0x9'),auth[_0x37c1('0xa')](),controller[_0x37c1('0xb')]);router['get'](_0x37c1('0xc'),auth[_0x37c1('0xa')](),controller['show']);router['post']('/',auth[_0x37c1('0xa')](),interaction[_0x37c1('0xd')](_0x37c1('0xe'),'smsmessage:create'),controller[_0x37c1('0xf')]);router[_0x37c1('0x10')](_0x37c1('0x11'),controller[_0x37c1('0x12')]);router[_0x37c1('0x13')]('/:id',auth[_0x37c1('0xa')](),controller[_0x37c1('0x14')]);router[_0x37c1('0x13')]('/:id/accept',auth[_0x37c1('0xa')](),controller[_0x37c1('0x15')]);router['put'](_0x37c1('0x16'),auth[_0x37c1('0xa')](),controller[_0x37c1('0x17')]);router[_0x37c1('0x18')](_0x37c1('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x37c1('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 2f05da8..9b20c82 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 _0x51f2=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x51f2,0xeb));var _0x251f=function(_0x579e2a,_0x181de3){_0x579e2a=_0x579e2a-0x0;var _0x575a69=_0x51f2[_0x579e2a];return _0x575a69;};'use strict';var Sequelize=require(_0x251f('0x0'));module[_0x251f('0x1')]={'body':{'type':Sequelize[_0x251f('0x2')](_0x251f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x251f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x251f('0x5')]('in',_0x251f('0x6')),'defaultValue':_0x251f('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x251f('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x251f('0x8')]},'secret':{'type':Sequelize[_0x251f('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x251f('0x7')]},'providerResponse':{'type':Sequelize[_0x251f('0x2')]}}; \ No newline at end of file +var _0x0411=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x476504,_0x24727e){var _0xa3f7a2=function(_0x4090b1){while(--_0x4090b1){_0x476504['push'](_0x476504['shift']());}};_0xa3f7a2(++_0x24727e);}(_0x0411,0x15d));var _0x1041=function(_0x2b7e9c,_0x236531){_0x2b7e9c=_0x2b7e9c-0x0;var _0x39ac82=_0x0411[_0x2b7e9c];return _0x39ac82;};'use strict';var Sequelize=require(_0x1041('0x0'));module[_0x1041('0x1')]={'body':{'type':Sequelize[_0x1041('0x2')](_0x1041('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1041('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1041('0x5')]('in',_0x1041('0x6')),'defaultValue':_0x1041('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1041('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1041('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1041('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 7c1c67e..da1aea3 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 _0x1485=['defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','info','debug','request\x20sent','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','keys','length','includeAll','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','sequelize','SELECT','User','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','delivered','plivio','infobip','groupName','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x1485,0x77));var _0x5148=function(_0x57402d,_0x2b5fd9){_0x57402d=_0x57402d-0x0;var _0x5f4905=_0x1485[_0x57402d];return _0x5f4905;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5148('0x0'));var zipdir=require(_0x5148('0x1'));var jsonpatch=require(_0x5148('0x2'));var rp=require('request-promise');var moment=require(_0x5148('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5148('0x4'));var util=require(_0x5148('0x5'));var path=require(_0x5148('0x6'));var sox=require(_0x5148('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5148('0x8'));var _=require(_0x5148('0x9'));var squel=require(_0x5148('0xa'));var crypto=require(_0x5148('0xb'));var jsforce=require(_0x5148('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5148('0xd'));var querystring=require(_0x5148('0xe'));var Papa=require(_0x5148('0xf'));var Redis=require(_0x5148('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5148('0x11'));var as=require(_0x5148('0x12'));var hardwareService=require(_0x5148('0x13'));var logger=require(_0x5148('0x14'))('api');var utils=require(_0x5148('0x15'));var config=require(_0x5148('0x16'));var licenseUtil=require(_0x5148('0x17'));var db=require(_0x5148('0x18'))['db'];config[_0x5148('0x19')]=_[_0x5148('0x1a')](config[_0x5148('0x19')],{'host':_0x5148('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5148('0x1c'))[_0x5148('0x1d')](socket);var jayson=require(_0x5148('0x1e'));var client=jayson[_0x5148('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x5148('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x22c875,_0xb4fd64,_0x1b378,_0x3c6d51){return new BPromise(function(_0x5e45c1,_0x19dc96){var _0x34a7b9=_0x3c6d51||client;return _0x34a7b9[_0x5148('0x21')](_0x22c875,_0x1b378)['then'](function(_0x5802c2){logger[_0x5148('0x22')]('SmsMessage,\x20%s,\x20%s',_0xb4fd64,'request\x20sent');logger[_0x5148('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd64,_0x5148('0x24'),JSON['stringify'](_0x5802c2));if(_0x5802c2[_0x5148('0x25')]){if(_0x5802c2[_0x5148('0x25')]['code']===0x1f4){logger[_0x5148('0x25')](_0x5148('0x26'),_0xb4fd64,_0x5802c2[_0x5148('0x25')][_0x5148('0x27')]);return _0x19dc96(_0x5802c2[_0x5148('0x25')][_0x5148('0x27')]);}logger[_0x5148('0x25')](_0x5148('0x26'),_0xb4fd64,_0x5802c2[_0x5148('0x25')]['message']);return _0x5e45c1(_0x5802c2[_0x5148('0x25')][_0x5148('0x27')]);}else{logger[_0x5148('0x22')](_0x5148('0x26'),_0xb4fd64,_0x5148('0x24'));_0x5e45c1(_0x5802c2[_0x5148('0x28')][_0x5148('0x27')]);}})[_0x5148('0x29')](function(_0x211be4){logger[_0x5148('0x25')](_0x5148('0x26'),_0xb4fd64,_0x211be4);_0x19dc96(_0x211be4);});});}function respondWithStatusCode(_0x2c97b8,_0x317915){_0x317915=_0x317915||0xcc;return function(_0x45ef9f){if(_0x45ef9f){return _0x2c97b8[_0x5148('0x2a')](_0x317915);}return _0x2c97b8[_0x5148('0x2b')](_0x317915)[_0x5148('0x2c')]();};}function respondWithResult(_0x18226c,_0x2da4a9){_0x2da4a9=_0x2da4a9||0xc8;return function(_0x5236de){if(_0x5236de){return _0x18226c[_0x5148('0x2b')](_0x2da4a9)[_0x5148('0x2d')](_0x5236de);}};}function respondWithFilteredResult(_0x2007d0,_0x55b4f2){return function(_0x1e9123){if(_0x1e9123){var _0x2a37aa=typeof _0x55b4f2['offset']===_0x5148('0x2e')&&typeof _0x55b4f2[_0x5148('0x2f')]===_0x5148('0x2e');var _0x1b01bd=_0x1e9123['count'];var _0xfe6a1a=_0x2a37aa?0x0:_0x55b4f2[_0x5148('0x30')];var _0x55ad9f=_0x2a37aa?_0x1e9123[_0x5148('0x31')]:_0x55b4f2[_0x5148('0x30')]+_0x55b4f2[_0x5148('0x2f')];var _0x52013c;if(_0x55ad9f>=_0x1b01bd){_0x55ad9f=_0x1b01bd;_0x52013c=0xc8;}else{_0x52013c=0xce;}_0x2007d0[_0x5148('0x2b')](_0x52013c);return _0x2007d0[_0x5148('0x32')](_0x5148('0x33'),_0xfe6a1a+'-'+_0x55ad9f+'/'+_0x1b01bd)['json'](_0x1e9123);}return null;};}function patchUpdates(_0x1ba60c){return function(_0x433d40){try{jsonpatch[_0x5148('0x34')](_0x433d40,_0x1ba60c,!![]);}catch(_0x260a9c){return BPromise[_0x5148('0x35')](_0x260a9c);}return _0x433d40[_0x5148('0x36')]();};}function saveUpdates(_0x1e74fe,_0x3119c0){return function(_0x387482){if(_0x387482){return _0x387482[_0x5148('0x37')](_0x1e74fe)[_0x5148('0x38')](function(_0x4771f0){return _0x4771f0;});}return null;};}function removeEntity(_0x3ed584,_0x10a72b){return function(_0x595cc7){if(_0x595cc7){return _0x595cc7[_0x5148('0x39')]()[_0x5148('0x38')](function(){_0x3ed584['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8af3e1,_0x220748){return function(_0x3c6460){if(!_0x3c6460){_0x8af3e1['sendStatus'](0x194);}return _0x3c6460;};}function handleError(_0x5e474b,_0x3ae0e0){_0x3ae0e0=_0x3ae0e0||0x1f4;return function(_0x53f7a8){logger['error'](_0x53f7a8[_0x5148('0x3a')]);if(_0x53f7a8[_0x5148('0x3b')]){delete _0x53f7a8[_0x5148('0x3b')];}_0x5e474b[_0x5148('0x2b')](_0x3ae0e0)[_0x5148('0x3c')](_0x53f7a8);};}exports[_0x5148('0x3d')]=function(_0x405878,_0x2cf7e4){var _0x10e9d6={},_0x482c44={},_0x2601bc={'count':0x0,'rows':[]};var _0x7bc149=_[_0x5148('0x3e')](db[_0x5148('0x3f')][_0x5148('0x40')],function(_0xe681b1){return{'name':_0xe681b1[_0x5148('0x41')],'type':_0xe681b1[_0x5148('0x42')]['key']};});_0x482c44[_0x5148('0x43')]=_['map'](_0x7bc149,_0x5148('0x3b'));_0x482c44[_0x5148('0x44')]=_['keys'](_0x405878['query']);_0x482c44[_0x5148('0x45')]=_[_0x5148('0x46')](_0x482c44[_0x5148('0x43')],_0x482c44[_0x5148('0x44')]);_0x10e9d6['attributes']=_[_0x5148('0x46')](_0x482c44['model'],qs[_0x5148('0x47')](_0x405878[_0x5148('0x44')][_0x5148('0x47')]));_0x10e9d6[_0x5148('0x48')]=_0x10e9d6[_0x5148('0x48')]['length']?_0x10e9d6[_0x5148('0x48')]:_0x482c44['model'];if(!_0x405878[_0x5148('0x44')][_0x5148('0x49')](_0x5148('0x4a'))){_0x10e9d6['limit']=qs[_0x5148('0x2f')](_0x405878['query'][_0x5148('0x2f')]);_0x10e9d6['offset']=qs['offset'](_0x405878['query']['offset']);}_0x10e9d6['order']=qs[_0x5148('0x4b')](_0x405878[_0x5148('0x44')][_0x5148('0x4b')]);_0x10e9d6['where']=qs[_0x5148('0x45')](_[_0x5148('0x4c')](_0x405878[_0x5148('0x44')],_0x482c44[_0x5148('0x45')]),_0x7bc149);if(_0x405878[_0x5148('0x44')][_0x5148('0x4d')]){_0x10e9d6[_0x5148('0x4e')]=_[_0x5148('0x4f')](_0x10e9d6[_0x5148('0x4e')],{'$or':_[_0x5148('0x3e')](_0x7bc149,function(_0x553aff){if(_0x553aff[_0x5148('0x42')]!==_0x5148('0x50')){var _0x2a7c3c={};_0x2a7c3c[_0x553aff['name']]={'$like':'%'+_0x405878['query'][_0x5148('0x4d')]+'%'};return _0x2a7c3c;}})});}_0x10e9d6=_['merge']({},_0x10e9d6,_0x405878[_0x5148('0x51')]);var _0xc642e7={'where':_0x10e9d6['where']};return db[_0x5148('0x3f')][_0x5148('0x31')](_0xc642e7)[_0x5148('0x38')](function(_0x329f93){_0x2601bc['count']=_0x329f93;if(_0x405878['query']['includeAll']){_0x10e9d6[_0x5148('0x52')]=[{'all':!![]}];}return db[_0x5148('0x3f')][_0x5148('0x53')](_0x10e9d6);})['then'](function(_0x5085bb){_0x2601bc['rows']=_0x5085bb;return _0x2601bc;})[_0x5148('0x38')](respondWithFilteredResult(_0x2cf7e4,_0x10e9d6))[_0x5148('0x29')](handleError(_0x2cf7e4,null));};exports[_0x5148('0x54')]=function(_0x519e20,_0x1cad2a){var _0x29265e={'raw':!![],'where':{'id':_0x519e20[_0x5148('0x55')]['id']}},_0x423cbb={};_0x423cbb['model']=_[_0x5148('0x56')](db['SmsMessage'][_0x5148('0x40')]);_0x423cbb[_0x5148('0x44')]=_[_0x5148('0x56')](_0x519e20[_0x5148('0x44')]);_0x423cbb[_0x5148('0x45')]=_['intersection'](_0x423cbb[_0x5148('0x43')],_0x423cbb[_0x5148('0x44')]);_0x29265e[_0x5148('0x48')]=_[_0x5148('0x46')](_0x423cbb[_0x5148('0x43')],qs[_0x5148('0x47')](_0x519e20[_0x5148('0x44')][_0x5148('0x47')]));_0x29265e[_0x5148('0x48')]=_0x29265e[_0x5148('0x48')][_0x5148('0x57')]?_0x29265e['attributes']:_0x423cbb['model'];if(_0x519e20[_0x5148('0x44')][_0x5148('0x58')]){_0x29265e[_0x5148('0x52')]=[{'all':!![]}];}_0x29265e=_[_0x5148('0x4f')]({},_0x29265e,_0x519e20[_0x5148('0x51')]);return db[_0x5148('0x3f')]['find'](_0x29265e)[_0x5148('0x38')](handleEntityNotFound(_0x1cad2a,null))[_0x5148('0x38')](respondWithResult(_0x1cad2a,null))[_0x5148('0x29')](handleError(_0x1cad2a,null));};exports[_0x5148('0x59')]=function(_0x4fa1b6,_0x194be2){return db[_0x5148('0x3f')][_0x5148('0x59')](_0x4fa1b6[_0x5148('0x5a')],{})[_0x5148('0x38')](respondWithResult(_0x194be2,0xc9))[_0x5148('0x29')](handleError(_0x194be2,null));};exports[_0x5148('0x37')]=function(_0x5931bf,_0x37fdca){if(_0x5931bf['body']['id']){delete _0x5931bf['body']['id'];}return db[_0x5148('0x3f')][_0x5148('0x5b')]({'where':{'id':_0x5931bf[_0x5148('0x55')]['id']}})[_0x5148('0x38')](handleEntityNotFound(_0x37fdca,null))[_0x5148('0x38')](saveUpdates(_0x5931bf[_0x5148('0x5a')],null))[_0x5148('0x38')](respondWithResult(_0x37fdca,null))[_0x5148('0x29')](handleError(_0x37fdca,null));};exports[_0x5148('0x39')]=function(_0x5e753e,_0x2f858c){return db[_0x5148('0x3f')][_0x5148('0x5b')]({'where':{'id':_0x5e753e[_0x5148('0x55')]['id']}})[_0x5148('0x38')](handleEntityNotFound(_0x2f858c,null))[_0x5148('0x38')](removeEntity(_0x2f858c,null))[_0x5148('0x29')](handleError(_0x2f858c,null));};exports[_0x5148('0x5c')]=function(_0x300c80,_0x1f9e9d){return db[_0x5148('0x3f')][_0x5148('0x5c')]()[_0x5148('0x38')](respondWithResult(_0x1f9e9d,null))['catch'](handleError(_0x1f9e9d,null));};var interaction_log=require(_0x5148('0x14'))(_0x5148('0x5d'));exports[_0x5148('0x5e')]=function(_0x43ab76,_0x5de4db,_0x571495){var _0x20180c={'agent':{},'channel':_0x5148('0x5f')};if(_0x43ab76[_0x5148('0x5a')]['id']){delete _0x43ab76[_0x5148('0x5a')]['id'];}_0x43ab76[_0x5148('0x5a')][_0x5148('0x60')]=!![];_0x43ab76[_0x5148('0x5a')][_0x5148('0x61')]=moment()[_0x5148('0x62')](_0x5148('0x63'));_0x43ab76['body'][_0x5148('0x64')]=_0x43ab76[_0x5148('0x5a')]['UserId']||_0x43ab76[_0x5148('0x65')]['id'];_0x20180c[_0x5148('0x66')]['id']=_0x43ab76[_0x5148('0x5a')]['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x43ab76[_0x5148('0x55')]['id'],'UserId':null}})[_0x5148('0x38')](handleEntityNotFound(_0x5de4db,null))[_0x5148('0x38')](saveUpdates(_0x43ab76[_0x5148('0x5a')],null))[_0x5148('0x38')](function(_0x299c3b){if(_0x299c3b){_0x20180c['message']=_0x299c3b[_0x5148('0x67')]({'plain':!![]});return db[_0x5148('0x68')][_0x5148('0x5b')]({'where':{'id':_0x299c3b[_0x5148('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x5de4db,null))[_0x5148('0x38')](function(_0x45570b){if(_0x45570b){return _0x45570b[_0x5148('0x37')]({'UserId':_0x43ab76['body'][_0x5148('0x64')],'read1stAt':_['isNil'](_0x45570b[_0x5148('0x6a')])?moment()[_0x5148('0x62')](_0x5148('0x63')):undefined});}return null;})[_0x5148('0x38')](function(_0x264d7e){if(_0x264d7e){_0x20180c['interaction']=_0x264d7e[_0x5148('0x67')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43ab76[_0x5148('0x65')]['id'],_0x43ab76[_0x5148('0x65')][_0x5148('0x3b')],_0x43ab76['user']['role'],_0x20180c['interaction']['id'],_0x43ab76['body']?JSON[_0x5148('0x6b')](_0x43ab76['body']):'null');return respondWithRpcPromise(_0x5148('0x6c'),'acceptMessage',_0x20180c);}return null;})[_0x5148('0x38')](function(_0x2eab58){var _0x20ae0b=_0x5148('0x6d')+_0x2eab58[_0x5148('0x27')]['ContactId'];return db['sequelize']['query'](_0x20ae0b,{'type':db[_0x5148('0x6e')][_0x5148('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x180909){return _0x180909;});})[_0x5148('0x38')](function(_0x47bfe0){if(_0x47bfe0){_0x20180c[_0x5148('0x27')][_0x5148('0x70')]=_0x47bfe0[0x0];if(!_0x43ab76['body'][_0x5148('0x64')])return;return db['User'][_0x5148('0x5b')]({'where':{'id':_0x43ab76[_0x5148('0x5a')][_0x5148('0x64')],'role':_0x5148('0x66')},'attributes':['id',_0x5148('0x3b'),_0x5148('0x71'),_0x5148('0x72'),_0x5148('0x73')],'raw':!![]});}return null;})[_0x5148('0x38')](function(_0x103bcd){if(!_0x103bcd)return null;_0x20180c['message']['agent']=_0x103bcd;return _0x20180c;})[_0x5148('0x38')](function(_0x27ddbd){if(_0x27ddbd){if(_0x43ab76['body']['manual']){_0x20180c[_0x5148('0x27')]['interface']=util[_0x5148('0x62')](_0x5148('0x74'),_0x43ab76[_0x5148('0x65')][_0x5148('0x3b')]);_0x20180c[_0x5148('0x27')][_0x5148('0x75')]=_0x20180c[_0x5148('0x75')];_0x20180c['message'][_0x5148('0x76')]=_0x20180c['channel'];_0x20180c['message'][_0x5148('0x77')]=_0x5148('0x5e');return respondWithRpcPromise(_0x5148('0x78'),_0x5148('0x78'),{'event':_0x5148('0x79'),'message':_0x20180c[_0x5148('0x27')]},client9002)[_0x5148('0x38')](function(){return _0x20180c;});}return _0x20180c;}return null;})[_0x5148('0x38')](respondWithResult(_0x5de4db,null))['catch'](handleError(_0x5de4db,null));};var interaction_log=require(_0x5148('0x14'))(_0x5148('0x5d'));exports[_0x5148('0x35')]=function(_0x3365d3,_0x3224bd,_0x99aae6){var _0x394d36={'agent':{},'channel':_0x5148('0x5f')};if(_0x3365d3['body']['id']){delete _0x3365d3[_0x5148('0x5a')]['id'];}_0x3365d3[_0x5148('0x5a')][_0x5148('0x64')]=_0x3365d3[_0x5148('0x5a')]['UserId']||_0x3365d3['user']['id'];_0x394d36['agent']['id']=_0x3365d3[_0x5148('0x5a')]['UserId'];return db[_0x5148('0x3f')][_0x5148('0x5b')]({'where':{'id':_0x3365d3[_0x5148('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3224bd,null))[_0x5148('0x38')](function(_0x174743){if(_0x174743){_0x394d36[_0x5148('0x27')]=_0x174743[_0x5148('0x67')]({'plain':!![]});return db[_0x5148('0x68')][_0x5148('0x5b')]({'where':{'id':_0x174743[_0x5148('0x69')]}});}return null;})[_0x5148('0x38')](handleEntityNotFound(_0x3224bd,null))[_0x5148('0x38')](function(_0x24f43d){if(_0x24f43d){_0x394d36['interaction']=_0x24f43d['get']({'plain':!![]});interaction_log[_0x5148('0x22')](_0x5148('0x7a'),_0x3365d3[_0x5148('0x65')]['id'],_0x3365d3[_0x5148('0x65')][_0x5148('0x3b')],_0x3365d3[_0x5148('0x65')][_0x5148('0x7b')],_0x394d36['interaction']['id'],_0x3365d3[_0x5148('0x5a')]?JSON[_0x5148('0x6b')](_0x3365d3[_0x5148('0x5a')]):_0x5148('0x7c'));return respondWithRpcPromise(_0x5148('0x7d'),_0x5148('0x7e'),_0x394d36);}return null;})[_0x5148('0x38')](function(_0x3343dd){var _0x50fd20=_0x5148('0x6d')+_0x3343dd[_0x5148('0x27')][_0x5148('0x7f')];return db[_0x5148('0x80')][_0x5148('0x44')](_0x50fd20,{'type':db['Sequelize']['QueryTypes'][_0x5148('0x81')],'raw':!![]})[_0x5148('0x38')](function(_0x2d6a10){return _0x2d6a10;});})['then'](function(_0x16d91d){if(_0x16d91d){_0x394d36[_0x5148('0x27')][_0x5148('0x70')]=_0x16d91d[0x0];if(!_0x3365d3[_0x5148('0x5a')][_0x5148('0x64')])return;return db[_0x5148('0x82')][_0x5148('0x5b')]({'where':{'id':_0x3365d3[_0x5148('0x5a')][_0x5148('0x64')],'role':_0x5148('0x66')},'attributes':['id',_0x5148('0x3b'),_0x5148('0x71'),_0x5148('0x72'),_0x5148('0x73')],'raw':!![]});}return null;})['then'](function(_0x561266){if(!_0x561266)return null;_0x394d36[_0x5148('0x27')]['agent']=_0x561266;return _0x394d36;})[_0x5148('0x38')](function(_0x5425e2){if(_0x5425e2){_0x5425e2[_0x5148('0x27')]['interface']=util[_0x5148('0x62')]('SIP/%s',_0x3365d3[_0x5148('0x65')][_0x5148('0x3b')]);_0x5425e2[_0x5148('0x27')][_0x5148('0x75')]=_0x394d36[_0x5148('0x75')];_0x5425e2[_0x5148('0x27')][_0x5148('0x76')]=_0x394d36[_0x5148('0x75')];_0x5425e2[_0x5148('0x27')]['event']=_0x5148('0x35');respondWithRpcPromise('EventManager',_0x5148('0x78'),{'event':'rejectmessage','message':_0x5425e2['message']},client9002);return _0x394d36;}return null;})['then'](respondWithResult(_0x3224bd,null))[_0x5148('0x29')](handleError(_0x3224bd,null));};exports[_0x5148('0x2b')]=function(_0x41e8d4,_0x140487,_0x2760a2){if(_0x41e8d4[_0x5148('0x5a')]['id']){delete _0x41e8d4[_0x5148('0x5a')]['id'];}var _0x1d1708;return db[_0x5148('0x3f')][_0x5148('0x5b')]({'where':{'id':_0x41e8d4['params']['id']}})[_0x5148('0x38')](handleEntityNotFound(_0x140487,null))['then'](function(_0x23639a){if(_0x23639a){_0x1d1708=_0x23639a;return db['SmsAccount']['find']({'where':{'id':_0x23639a['SmsAccountId']}});}})[_0x5148('0x38')](handleEntityNotFound(_0x140487,null))[_0x5148('0x38')](function(_0x597c4c){if(_0x597c4c){logger[_0x5148('0x23')](_0x5148('0x83'),_0x5148('0x2b'),_0x5148('0x84'),_0x597c4c[_0x5148('0x42')],util[_0x5148('0x85')](_0x41e8d4['body'],{'showHidden':![],'depth':null}));switch(_0x597c4c[_0x5148('0x42')]){case _0x5148('0x86'):if(_0x41e8d4[_0x5148('0x5a')][_0x5148('0x87')]&&_0x41e8d4[_0x5148('0x5a')][_0x5148('0x87')]===_0x1d1708['messageId']){return _0x1d1708[_0x5148('0x37')]({'read':!![]});}else{logger[_0x5148('0x25')](_0x5148('0x88'),_0x5148('0x2b'),'twilio',util[_0x5148('0x85')](_0x41e8d4[_0x5148('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x5148('0x89'):if(_0x41e8d4[_0x5148('0x5a')]['MessageUUID']&&_0x41e8d4[_0x5148('0x5a')][_0x5148('0x8a')]===_0x1d1708[_0x5148('0x8b')]&&_[_0x5148('0x8c')](['sent',_0x5148('0x8d')],_0x41e8d4['body']['Status'])>=0x0){return _0x1d1708['update']({'read':!![]});}else{logger['error'](_0x5148('0x88'),_0x5148('0x2b'),_0x5148('0x8e'),util['inspect'](_0x41e8d4[_0x5148('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x5148('0x8f'):var _0x162e80=_0x41e8d4['body']['results'][0x0];if(_0x162e80[_0x5148('0x2b')][_0x5148('0x90')]==='DELIVERED'){return _0x1d1708[_0x5148('0x37')]({'read':!![]});}else{logger[_0x5148('0x25')](_0x5148('0x88'),_0x5148('0x2b'),_0x5148('0x8f'),util[_0x5148('0x85')](_0x41e8d4[_0x5148('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x1d1708;}})[_0x5148('0x38')](respondWithResult(_0x140487,null))[_0x5148('0x29')](handleError(_0x140487,null));}; \ No newline at end of file +var _0x9e69=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','fullname','internal','rejectmessage','SmsAccount','inspect','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','client','http','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','json','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','count','findAll','show','params','include','find','create','body','describe','sms-interactions','accept','sms','readAt','format'];(function(_0x490d09,_0x4d9eed){var _0x5a9666=function(_0x12672a){while(--_0x12672a){_0x490d09['push'](_0x490d09['shift']());}};_0x5a9666(++_0x4d9eed);}(_0x9e69,0x150));var _0x99e6=function(_0x56b3e7,_0x175766){_0x56b3e7=_0x56b3e7-0x0;var _0x4ccd6d=_0x9e69[_0x56b3e7];return _0x4ccd6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99e6('0x0'));var zipdir=require(_0x99e6('0x1'));var jsonpatch=require(_0x99e6('0x2'));var rp=require(_0x99e6('0x3'));var moment=require('moment');var BPromise=require(_0x99e6('0x4'));var Mustache=require(_0x99e6('0x5'));var util=require('util');var path=require(_0x99e6('0x6'));var sox=require(_0x99e6('0x7'));var csv=require(_0x99e6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99e6('0x9'));var _=require(_0x99e6('0xa'));var squel=require(_0x99e6('0xb'));var crypto=require('crypto');var jsforce=require(_0x99e6('0xc'));var deskjs=require(_0x99e6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x99e6('0xe'));var Papa=require(_0x99e6('0xf'));var Redis=require('ioredis');var authService=require(_0x99e6('0x10'));var qs=require(_0x99e6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99e6('0x12'))(_0x99e6('0x13'));var utils=require(_0x99e6('0x14'));var config=require(_0x99e6('0x15'));var licenseUtil=require(_0x99e6('0x16'));var db=require(_0x99e6('0x17'))['db'];config['redis']=_[_0x99e6('0x18')](config[_0x99e6('0x19')],{'host':_0x99e6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99e6('0x19')]));require(_0x99e6('0x1b'))[_0x99e6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x99e6('0x1d')][_0x99e6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1d910a,_0x5d5cd5,_0x18fa86,_0x38fcdd){return new BPromise(function(_0xebfd62,_0x2ac3bd){var _0x3a302d=_0x38fcdd||client;return _0x3a302d['request'](_0x1d910a,_0x18fa86)[_0x99e6('0x1f')](function(_0x4e84f4){logger[_0x99e6('0x20')](_0x99e6('0x21'),_0x5d5cd5,'request\x20sent');logger[_0x99e6('0x22')](_0x99e6('0x23'),_0x5d5cd5,_0x99e6('0x24'),JSON[_0x99e6('0x25')](_0x4e84f4));if(_0x4e84f4[_0x99e6('0x26')]){if(_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x27')]===0x1f4){logger[_0x99e6('0x26')](_0x99e6('0x21'),_0x5d5cd5,_0x4e84f4[_0x99e6('0x26')]['message']);return _0x2ac3bd(_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x28')]);}logger[_0x99e6('0x26')](_0x99e6('0x21'),_0x5d5cd5,_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x28')]);return _0xebfd62(_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x28')]);}else{logger[_0x99e6('0x20')](_0x99e6('0x21'),_0x5d5cd5,_0x99e6('0x24'));_0xebfd62(_0x4e84f4[_0x99e6('0x29')][_0x99e6('0x28')]);}})[_0x99e6('0x2a')](function(_0x210b02){logger[_0x99e6('0x26')](_0x99e6('0x21'),_0x5d5cd5,_0x210b02);_0x2ac3bd(_0x210b02);});});}function respondWithStatusCode(_0x57815a,_0x43038d){_0x43038d=_0x43038d||0xcc;return function(_0x5390b3){if(_0x5390b3){return _0x57815a[_0x99e6('0x2b')](_0x43038d);}return _0x57815a[_0x99e6('0x2c')](_0x43038d)[_0x99e6('0x2d')]();};}function respondWithResult(_0x52c7da,_0x3a1325){_0x3a1325=_0x3a1325||0xc8;return function(_0x5724bf){if(_0x5724bf){return _0x52c7da[_0x99e6('0x2c')](_0x3a1325)['json'](_0x5724bf);}};}function respondWithFilteredResult(_0x39ca5d,_0x46343f){return function(_0x4b58c7){if(_0x4b58c7){var _0x4d6b19=typeof _0x46343f[_0x99e6('0x2e')]===_0x99e6('0x2f')&&typeof _0x46343f[_0x99e6('0x30')]===_0x99e6('0x2f');var _0x3f821a=_0x4b58c7['count'];var _0x1220d7=_0x4d6b19?0x0:_0x46343f[_0x99e6('0x2e')];var _0x30f8ec=_0x4d6b19?_0x4b58c7['count']:_0x46343f['offset']+_0x46343f[_0x99e6('0x30')];var _0x51885f;if(_0x30f8ec>=_0x3f821a){_0x30f8ec=_0x3f821a;_0x51885f=0xc8;}else{_0x51885f=0xce;}_0x39ca5d['status'](_0x51885f);return _0x39ca5d[_0x99e6('0x31')]('Content-Range',_0x1220d7+'-'+_0x30f8ec+'/'+_0x3f821a)[_0x99e6('0x32')](_0x4b58c7);}return null;};}function patchUpdates(_0x34f671){return function(_0xf11b8){try{jsonpatch['apply'](_0xf11b8,_0x34f671,!![]);}catch(_0x46cd0a){return BPromise[_0x99e6('0x33')](_0x46cd0a);}return _0xf11b8[_0x99e6('0x34')]();};}function saveUpdates(_0x3f78a8,_0x5b1a1e){return function(_0x172940){if(_0x172940){return _0x172940[_0x99e6('0x35')](_0x3f78a8)[_0x99e6('0x1f')](function(_0x2a035a){return _0x2a035a;});}return null;};}function removeEntity(_0x754964,_0x40e298){return function(_0x4e16be){if(_0x4e16be){return _0x4e16be[_0x99e6('0x36')]()['then'](function(){_0x754964['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x290bfe,_0x2d8a0e){return function(_0x4cf592){if(!_0x4cf592){_0x290bfe[_0x99e6('0x2b')](0x194);}return _0x4cf592;};}function handleError(_0x66bcd3,_0x224449){_0x224449=_0x224449||0x1f4;return function(_0xcdc5a2){logger[_0x99e6('0x26')](_0xcdc5a2[_0x99e6('0x37')]);if(_0xcdc5a2['name']){delete _0xcdc5a2[_0x99e6('0x38')];}_0x66bcd3[_0x99e6('0x2c')](_0x224449)[_0x99e6('0x39')](_0xcdc5a2);};}exports[_0x99e6('0x3a')]=function(_0x579e74,_0x3cc682){var _0xd42d29={},_0x24b05c={},_0x1ea6dd={'count':0x0,'rows':[]};var _0x2c3587=_[_0x99e6('0x3b')](db[_0x99e6('0x3c')]['rawAttributes'],function(_0x4b888c){return{'name':_0x4b888c['fieldName'],'type':_0x4b888c[_0x99e6('0x3d')][_0x99e6('0x3e')]};});_0x24b05c['model']=_[_0x99e6('0x3b')](_0x2c3587,_0x99e6('0x38'));_0x24b05c[_0x99e6('0x3f')]=_[_0x99e6('0x40')](_0x579e74[_0x99e6('0x3f')]);_0x24b05c[_0x99e6('0x41')]=_[_0x99e6('0x42')](_0x24b05c[_0x99e6('0x43')],_0x24b05c[_0x99e6('0x3f')]);_0xd42d29[_0x99e6('0x44')]=_[_0x99e6('0x42')](_0x24b05c['model'],qs[_0x99e6('0x45')](_0x579e74[_0x99e6('0x3f')][_0x99e6('0x45')]));_0xd42d29[_0x99e6('0x44')]=_0xd42d29[_0x99e6('0x44')][_0x99e6('0x46')]?_0xd42d29[_0x99e6('0x44')]:_0x24b05c[_0x99e6('0x43')];if(!_0x579e74[_0x99e6('0x3f')]['hasOwnProperty']('nolimit')){_0xd42d29['limit']=qs['limit'](_0x579e74['query'][_0x99e6('0x30')]);_0xd42d29[_0x99e6('0x2e')]=qs['offset'](_0x579e74[_0x99e6('0x3f')][_0x99e6('0x2e')]);}_0xd42d29[_0x99e6('0x47')]=qs[_0x99e6('0x48')](_0x579e74[_0x99e6('0x3f')][_0x99e6('0x48')]);_0xd42d29['where']=qs[_0x99e6('0x41')](_[_0x99e6('0x49')](_0x579e74[_0x99e6('0x3f')],_0x24b05c[_0x99e6('0x41')]),_0x2c3587);if(_0x579e74[_0x99e6('0x3f')][_0x99e6('0x4a')]){_0xd42d29[_0x99e6('0x4b')]=_[_0x99e6('0x4c')](_0xd42d29[_0x99e6('0x4b')],{'$or':_[_0x99e6('0x3b')](_0x2c3587,function(_0xb97a84){if(_0xb97a84[_0x99e6('0x3d')]!==_0x99e6('0x4d')){var _0x260a4d={};_0x260a4d[_0xb97a84['name']]={'$like':'%'+_0x579e74['query']['filter']+'%'};return _0x260a4d;}})});}_0xd42d29=_['merge']({},_0xd42d29,_0x579e74[_0x99e6('0x4e')]);var _0x2e5932={'where':_0xd42d29[_0x99e6('0x4b')]};return db[_0x99e6('0x3c')][_0x99e6('0x4f')](_0x2e5932)['then'](function(_0x558d09){_0x1ea6dd[_0x99e6('0x4f')]=_0x558d09;if(_0x579e74[_0x99e6('0x3f')]['includeAll']){_0xd42d29['include']=[{'all':!![]}];}return db[_0x99e6('0x3c')][_0x99e6('0x50')](_0xd42d29);})['then'](function(_0x2bf0c2){_0x1ea6dd['rows']=_0x2bf0c2;return _0x1ea6dd;})[_0x99e6('0x1f')](respondWithFilteredResult(_0x3cc682,_0xd42d29))[_0x99e6('0x2a')](handleError(_0x3cc682,null));};exports[_0x99e6('0x51')]=function(_0x4d2c91,_0x1835d9){var _0x6b597c={'raw':!![],'where':{'id':_0x4d2c91[_0x99e6('0x52')]['id']}},_0x503cc0={};_0x503cc0[_0x99e6('0x43')]=_[_0x99e6('0x40')](db['SmsMessage']['rawAttributes']);_0x503cc0[_0x99e6('0x3f')]=_[_0x99e6('0x40')](_0x4d2c91['query']);_0x503cc0[_0x99e6('0x41')]=_[_0x99e6('0x42')](_0x503cc0[_0x99e6('0x43')],_0x503cc0[_0x99e6('0x3f')]);_0x6b597c[_0x99e6('0x44')]=_[_0x99e6('0x42')](_0x503cc0[_0x99e6('0x43')],qs['fields'](_0x4d2c91[_0x99e6('0x3f')][_0x99e6('0x45')]));_0x6b597c['attributes']=_0x6b597c[_0x99e6('0x44')][_0x99e6('0x46')]?_0x6b597c['attributes']:_0x503cc0[_0x99e6('0x43')];if(_0x4d2c91[_0x99e6('0x3f')]['includeAll']){_0x6b597c[_0x99e6('0x53')]=[{'all':!![]}];}_0x6b597c=_['merge']({},_0x6b597c,_0x4d2c91[_0x99e6('0x4e')]);return db[_0x99e6('0x3c')][_0x99e6('0x54')](_0x6b597c)[_0x99e6('0x1f')](handleEntityNotFound(_0x1835d9,null))[_0x99e6('0x1f')](respondWithResult(_0x1835d9,null))[_0x99e6('0x2a')](handleError(_0x1835d9,null));};exports[_0x99e6('0x55')]=function(_0x3745f0,_0x2a4ede){return db[_0x99e6('0x3c')][_0x99e6('0x55')](_0x3745f0[_0x99e6('0x56')],{})[_0x99e6('0x1f')](respondWithResult(_0x2a4ede,0xc9))['catch'](handleError(_0x2a4ede,null));};exports[_0x99e6('0x35')]=function(_0x3e13a9,_0x303ca3){if(_0x3e13a9[_0x99e6('0x56')]['id']){delete _0x3e13a9[_0x99e6('0x56')]['id'];}return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0x3e13a9[_0x99e6('0x52')]['id']}})[_0x99e6('0x1f')](handleEntityNotFound(_0x303ca3,null))[_0x99e6('0x1f')](saveUpdates(_0x3e13a9[_0x99e6('0x56')],null))[_0x99e6('0x1f')](respondWithResult(_0x303ca3,null))[_0x99e6('0x2a')](handleError(_0x303ca3,null));};exports[_0x99e6('0x36')]=function(_0x40f68a,_0x292c23){return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0x40f68a[_0x99e6('0x52')]['id']}})[_0x99e6('0x1f')](handleEntityNotFound(_0x292c23,null))['then'](removeEntity(_0x292c23,null))[_0x99e6('0x2a')](handleError(_0x292c23,null));};exports[_0x99e6('0x57')]=function(_0x2aa609,_0x31d730){return db['SmsMessage'][_0x99e6('0x57')]()[_0x99e6('0x1f')](respondWithResult(_0x31d730,null))[_0x99e6('0x2a')](handleError(_0x31d730,null));};var interaction_log=require('../../config/logger')(_0x99e6('0x58'));exports[_0x99e6('0x59')]=function(_0xaca434,_0x503938,_0x44a34e){var _0x51aa3e={'agent':{},'channel':_0x99e6('0x5a')};if(_0xaca434[_0x99e6('0x56')]['id']){delete _0xaca434[_0x99e6('0x56')]['id'];}_0xaca434['body']['read']=!![];_0xaca434[_0x99e6('0x56')][_0x99e6('0x5b')]=moment()[_0x99e6('0x5c')](_0x99e6('0x5d'));_0xaca434['body'][_0x99e6('0x5e')]=_0xaca434[_0x99e6('0x56')][_0x99e6('0x5e')]||_0xaca434[_0x99e6('0x5f')]['id'];_0x51aa3e['agent']['id']=_0xaca434[_0x99e6('0x56')][_0x99e6('0x5e')];return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0xaca434[_0x99e6('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x503938,null))[_0x99e6('0x1f')](saveUpdates(_0xaca434[_0x99e6('0x56')],null))[_0x99e6('0x1f')](function(_0x51d37d){if(_0x51d37d){_0x51aa3e[_0x99e6('0x28')]=_0x51d37d[_0x99e6('0x60')]({'plain':!![]});return db[_0x99e6('0x61')]['find']({'where':{'id':_0x51d37d['SmsInteractionId']}});}return null;})[_0x99e6('0x1f')](handleEntityNotFound(_0x503938,null))['then'](function(_0x2390d0){if(_0x2390d0){return _0x2390d0[_0x99e6('0x35')]({'UserId':_0xaca434['body']['UserId'],'read1stAt':_[_0x99e6('0x62')](_0x2390d0[_0x99e6('0x63')])?moment()[_0x99e6('0x5c')](_0x99e6('0x5d')):undefined});}return null;})[_0x99e6('0x1f')](function(_0xfb14ca){if(_0xfb14ca){_0x51aa3e[_0x99e6('0x64')]=_0xfb14ca['get']({'plain':!![]});interaction_log[_0x99e6('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xaca434['user']['id'],_0xaca434[_0x99e6('0x5f')]['name'],_0xaca434[_0x99e6('0x5f')][_0x99e6('0x65')],_0x51aa3e[_0x99e6('0x64')]['id'],_0xaca434[_0x99e6('0x56')]?JSON[_0x99e6('0x25')](_0xaca434['body']):_0x99e6('0x66'));return respondWithRpcPromise(_0x99e6('0x67'),'acceptMessage',_0x51aa3e);}return null;})[_0x99e6('0x1f')](function(_0x277b79){var _0x48ec89=_0x99e6('0x68')+_0x277b79[_0x99e6('0x28')][_0x99e6('0x69')];return db[_0x99e6('0x6a')][_0x99e6('0x3f')](_0x48ec89,{'type':db[_0x99e6('0x6b')][_0x99e6('0x6c')][_0x99e6('0x6d')],'raw':!![]})[_0x99e6('0x1f')](function(_0x33f862){return _0x33f862;});})[_0x99e6('0x1f')](function(_0xde0ee9){if(_0xde0ee9){_0x51aa3e[_0x99e6('0x28')]['contact']=_0xde0ee9[0x0];if(!_0xaca434['body'][_0x99e6('0x5e')])return;return db[_0x99e6('0x6e')][_0x99e6('0x54')]({'where':{'id':_0xaca434[_0x99e6('0x56')]['UserId'],'role':_0x99e6('0x6f')},'attributes':['id',_0x99e6('0x38'),'fullname',_0x99e6('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2d32de){if(!_0x2d32de)return null;_0x51aa3e[_0x99e6('0x28')]['agent']=_0x2d32de;return _0x51aa3e;})[_0x99e6('0x1f')](function(_0x264ea6){if(_0x264ea6){if(_0xaca434[_0x99e6('0x56')][_0x99e6('0x71')]){_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x72')]=util[_0x99e6('0x5c')](_0x99e6('0x73'),_0xaca434[_0x99e6('0x5f')][_0x99e6('0x38')]);_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x74')]=_0x51aa3e['channel'];_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x75')]=_0x51aa3e[_0x99e6('0x74')];_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x76')]='accept';return respondWithRpcPromise(_0x99e6('0x77'),_0x99e6('0x77'),{'event':_0x99e6('0x78'),'message':_0x51aa3e[_0x99e6('0x28')]},client9002)[_0x99e6('0x1f')](function(){return _0x51aa3e;});}return _0x51aa3e;}return null;})[_0x99e6('0x1f')](respondWithResult(_0x503938,null))['catch'](handleError(_0x503938,null));};var interaction_log=require(_0x99e6('0x12'))(_0x99e6('0x58'));exports[_0x99e6('0x33')]=function(_0x3b9126,_0x20172d,_0x4637f0){var _0x244d98={'agent':{},'channel':_0x99e6('0x5a')};if(_0x3b9126['body']['id']){delete _0x3b9126[_0x99e6('0x56')]['id'];}_0x3b9126['body'][_0x99e6('0x5e')]=_0x3b9126['body'][_0x99e6('0x5e')]||_0x3b9126[_0x99e6('0x5f')]['id'];_0x244d98[_0x99e6('0x6f')]['id']=_0x3b9126[_0x99e6('0x56')]['UserId'];return db['SmsMessage'][_0x99e6('0x54')]({'where':{'id':_0x3b9126[_0x99e6('0x52')]['id'],'UserId':null}})[_0x99e6('0x1f')](handleEntityNotFound(_0x20172d,null))[_0x99e6('0x1f')](function(_0x1cdf12){if(_0x1cdf12){_0x244d98[_0x99e6('0x28')]=_0x1cdf12[_0x99e6('0x60')]({'plain':!![]});return db[_0x99e6('0x61')][_0x99e6('0x54')]({'where':{'id':_0x1cdf12[_0x99e6('0x79')]}});}return null;})[_0x99e6('0x1f')](handleEntityNotFound(_0x20172d,null))[_0x99e6('0x1f')](function(_0xd4e10d){if(_0xd4e10d){_0x244d98['interaction']=_0xd4e10d['get']({'plain':!![]});interaction_log['info'](_0x99e6('0x7a'),_0x3b9126[_0x99e6('0x5f')]['id'],_0x3b9126[_0x99e6('0x5f')]['name'],_0x3b9126[_0x99e6('0x5f')][_0x99e6('0x65')],_0x244d98[_0x99e6('0x64')]['id'],_0x3b9126[_0x99e6('0x56')]?JSON[_0x99e6('0x25')](_0x3b9126[_0x99e6('0x56')]):'null');return respondWithRpcPromise(_0x99e6('0x7b'),'rejectMessage',_0x244d98);}return null;})[_0x99e6('0x1f')](function(_0x3b1141){var _0x806044='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b1141[_0x99e6('0x28')][_0x99e6('0x69')];return db[_0x99e6('0x6a')][_0x99e6('0x3f')](_0x806044,{'type':db[_0x99e6('0x6b')]['QueryTypes'][_0x99e6('0x6d')],'raw':!![]})[_0x99e6('0x1f')](function(_0x1c8020){return _0x1c8020;});})[_0x99e6('0x1f')](function(_0x4c5afa){if(_0x4c5afa){_0x244d98[_0x99e6('0x28')][_0x99e6('0x7c')]=_0x4c5afa[0x0];if(!_0x3b9126[_0x99e6('0x56')][_0x99e6('0x5e')])return;return db[_0x99e6('0x6e')][_0x99e6('0x54')]({'where':{'id':_0x3b9126['body'][_0x99e6('0x5e')],'role':_0x99e6('0x6f')},'attributes':['id',_0x99e6('0x38'),_0x99e6('0x7d'),'email',_0x99e6('0x7e')],'raw':!![]});}return null;})[_0x99e6('0x1f')](function(_0xe19ac6){if(!_0xe19ac6)return null;_0x244d98[_0x99e6('0x28')]['agent']=_0xe19ac6;return _0x244d98;})[_0x99e6('0x1f')](function(_0x3a0e4d){if(_0x3a0e4d){_0x3a0e4d['message'][_0x99e6('0x72')]=util['format'](_0x99e6('0x73'),_0x3b9126['user'][_0x99e6('0x38')]);_0x3a0e4d[_0x99e6('0x28')][_0x99e6('0x74')]=_0x244d98[_0x99e6('0x74')];_0x3a0e4d[_0x99e6('0x28')][_0x99e6('0x75')]=_0x244d98['channel'];_0x3a0e4d['message'][_0x99e6('0x76')]=_0x99e6('0x33');respondWithRpcPromise(_0x99e6('0x77'),_0x99e6('0x77'),{'event':_0x99e6('0x7f'),'message':_0x3a0e4d[_0x99e6('0x28')]},client9002);return _0x244d98;}return null;})[_0x99e6('0x1f')](respondWithResult(_0x20172d,null))[_0x99e6('0x2a')](handleError(_0x20172d,null));};exports[_0x99e6('0x2c')]=function(_0x5570f3,_0x595a20,_0xa2e4f4){if(_0x5570f3[_0x99e6('0x56')]['id']){delete _0x5570f3[_0x99e6('0x56')]['id'];}var _0x4243d4;return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0x5570f3[_0x99e6('0x52')]['id']}})[_0x99e6('0x1f')](handleEntityNotFound(_0x595a20,null))[_0x99e6('0x1f')](function(_0x13a146){if(_0x13a146){_0x4243d4=_0x13a146;return db[_0x99e6('0x80')]['find']({'where':{'id':_0x13a146['SmsAccountId']}});}})[_0x99e6('0x1f')](handleEntityNotFound(_0x595a20,null))['then'](function(_0x73c37d){if(_0x73c37d){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x99e6('0x2c'),'received\x20delivery\x20report\x20from',_0x73c37d[_0x99e6('0x3d')],util[_0x99e6('0x81')](_0x5570f3[_0x99e6('0x56')],{'showHidden':![],'depth':null}));switch(_0x73c37d[_0x99e6('0x3d')]){case _0x99e6('0x82'):if(_0x5570f3[_0x99e6('0x56')][_0x99e6('0x83')]&&_0x5570f3['body'][_0x99e6('0x83')]===_0x4243d4[_0x99e6('0x84')]){return _0x4243d4[_0x99e6('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x99e6('0x2c'),'twilio',util[_0x99e6('0x81')](_0x5570f3['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5570f3[_0x99e6('0x56')][_0x99e6('0x85')]&&_0x5570f3[_0x99e6('0x56')][_0x99e6('0x85')]===_0x4243d4[_0x99e6('0x84')]&&_[_0x99e6('0x86')]([_0x99e6('0x87'),_0x99e6('0x88')],_0x5570f3[_0x99e6('0x56')][_0x99e6('0x89')])>=0x0){return _0x4243d4[_0x99e6('0x35')]({'read':!![]});}else{logger[_0x99e6('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x99e6('0x8a'),util[_0x99e6('0x81')](_0x5570f3[_0x99e6('0x56')],{'showHidden':![],'depth':null}));}break;case _0x99e6('0x8b'):var _0x412496=_0x5570f3['body'][_0x99e6('0x8c')][0x0];if(_0x412496[_0x99e6('0x2c')][_0x99e6('0x8d')]===_0x99e6('0x8e')){return _0x4243d4['update']({'read':!![]});}else{logger[_0x99e6('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x99e6('0x2c'),_0x99e6('0x8b'),util[_0x99e6('0x81')](_0x5570f3[_0x99e6('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x4243d4;}})[_0x99e6('0x1f')](respondWithResult(_0x595a20,null))[_0x99e6('0x2a')](handleError(_0x595a20,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index e053d3c..9cd7741 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 _0x06a5=['hasOwnProperty','events','setMaxListeners','update','emit'];(function(_0x10e8ed,_0x384a0d){var _0x4aea4a=function(_0x486ad1){while(--_0x486ad1){_0x10e8ed['push'](_0x10e8ed['shift']());}};_0x4aea4a(++_0x384a0d);}(_0x06a5,0x1e1));var _0x506a=function(_0x8eb48a,_0x2f4383){_0x8eb48a=_0x8eb48a-0x0;var _0x41bc06=_0x06a5[_0x8eb48a];return _0x41bc06;};'use strict';var EventEmitter=require(_0x506a('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x506a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x506a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x339463){return function(_0x4e21f8,_0x286479,_0x492d96){SmsMessageEvents[_0x506a('0x3')](_0x339463+':'+_0x4e21f8['id'],_0x4e21f8);SmsMessageEvents[_0x506a('0x3')](_0x339463,_0x4e21f8);_0x492d96(null);};}for(var e in events){if(events[_0x506a('0x4')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xc361=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x57549b,_0x30e0c4){var _0x26e1fd=function(_0x5e9c5a){while(--_0x5e9c5a){_0x57549b['push'](_0x57549b['shift']());}};_0x26e1fd(++_0x30e0c4);}(_0xc361,0x1a2));var _0x1c36=function(_0x547b53,_0x5ea6cb){_0x547b53=_0x547b53-0x0;var _0x166225=_0xc361[_0x547b53];return _0x166225;};'use strict';var EventEmitter=require(_0x1c36('0x0'));var SmsMessage=require(_0x1c36('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1c36('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1c36('0x3'),'afterDestroy':_0x1c36('0x4')};function emitEvent(_0x3d5397){return function(_0x3ecc3b,_0x3219ae,_0x21e5e7){SmsMessageEvents[_0x1c36('0x5')](_0x3d5397+':'+_0x3ecc3b['id'],_0x3ecc3b);SmsMessageEvents[_0x1c36('0x5')](_0x3d5397,_0x3ecc3b);_0x21e5e7(null);};}for(var e in events){if(events[_0x1c36('0x6')](e)){var event=events[e];SmsMessage[_0x1c36('0x7')](e,emitEvent(event));}}module[_0x1c36('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 876322c..d7eabc5 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 _0x0c13=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','messages','create','body','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','GET','split','POST','user_key','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','authToken','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','username','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','sender','text','timestamp','sort','length','createHash','digest','signature=','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','apiKey','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci'];(function(_0x31aac8,_0x1ac0e3){var _0x55448d=function(_0x396c5f){while(--_0x396c5f){_0x31aac8['push'](_0x31aac8['shift']());}};_0x55448d(++_0x1ac0e3);}(_0x0c13,0x1ec));var _0x30c1=function(_0x5be98f,_0x291688){_0x5be98f=_0x5be98f-0x0;var _0x1f66b4=_0x0c13[_0x5be98f];return _0x1f66b4;};'use strict';var _=require(_0x30c1('0x0'));var util=require(_0x30c1('0x1'));var logger=require(_0x30c1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x30c1('0x3'));var rp=require(_0x30c1('0x4'));var fs=require('fs');var path=require(_0x30c1('0x5'));var rimraf=require(_0x30c1('0x6'));var config=require('../../config/environment');var attributes=require(_0x30c1('0x7'));module[_0x30c1('0x8')]=function(_0x32bb20,_0x605208){return _0x32bb20['define'](_0x30c1('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x30c1('0xa'),'fields':[_0x30c1('0xa')]},{'name':_0x30c1('0xb'),'fields':['body'],'type':_0x30c1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c2fdf,_0x417637,_0x186150){var _0x3e0927=_0x32bb20[_0x30c1('0xd')];var _0x476a21=_0x2c2fdf[_0x30c1('0xe')]({'plain':!![]});if(_0x476a21[_0x30c1('0xf')][_0x30c1('0x10')]()==='in'||_0x476a21[_0x30c1('0xf')][_0x30c1('0x10')]()===_0x30c1('0x11')&&!_0x476a21[_0x30c1('0x12')]&&!_[_0x30c1('0x13')](_0x476a21['UserId'])&&!_[_0x30c1('0x13')](_0x476a21['SmsInteractionId'])){_0x3e0927['SmsInteraction']['findOne']({'where':{'id':_0x476a21[_0x30c1('0x14')]}})[_0x30c1('0x15')](function(_0x11efa4){if(_0x11efa4){_0x11efa4[_0x30c1('0x16')]({'lastMsgAt':_0x476a21[_0x30c1('0x17')],'lastMsgDirection':_0x476a21[_0x30c1('0xf')][_0x30c1('0x10')]()});}})[_0x30c1('0x18')](function(_0x39ff7c){console[_0x30c1('0x19')](_0x39ff7c);});}if(_0x476a21[_0x30c1('0xf')]===_0x30c1('0x11')&&!_0x476a21[_0x30c1('0x12')]){var _0x43904b;_0x3e0927[_0x30c1('0x1a')][_0x30c1('0x1b')]({'where':{'id':_0x476a21[_0x30c1('0x1c')]},'raw':!![]})[_0x30c1('0x15')](function(_0x640630){_0x43904b=_0x640630;if(_0x43904b&&_0x43904b[_0x30c1('0x1d')]){switch(_0x43904b[_0x30c1('0x1d')]){case _0x30c1('0x1e'):var _0x5eefa5=require(_0x30c1('0x1e'));if(_0x43904b[_0x30c1('0x1f')]&&_0x43904b['authToken']&&_0x43904b[_0x30c1('0x20')]){var _0x3f1220=new _0x5eefa5(_0x43904b['accountSid'],_0x43904b['authToken']);_0x3f1220[_0x30c1('0x21')][_0x30c1('0x22')]({'body':_0x476a21[_0x30c1('0x23')],'to':_0x476a21['phone'],'from':_0x43904b[_0x30c1('0x20')],'statusCallback':_0x43904b[_0x30c1('0x24')]+'/api/sms/messages/'+_0x476a21['id']+_0x30c1('0x25')+_0x43904b[_0x30c1('0x26')]})[_0x30c1('0x15')](function(_0x42bdee){if(_0x42bdee[_0x30c1('0x27')]){return _0x2c2fdf[_0x30c1('0x16')]({'messageId':_0x42bdee[_0x30c1('0x27')]});}})[_0x30c1('0x18')](function(_0x2ee6f1){logger[_0x30c1('0x19')](_0x30c1('0x28'),'afterCreate',_0x30c1('0x1e'),util[_0x30c1('0x29')](_0x2ee6f1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x1e'),_0x30c1('0x2b'));}break;case _0x30c1('0x2c'):var _0x4b61c4=_0x30c1('0x2d');if(_0x43904b['username']&&_0x43904b[_0x30c1('0x2e')]){var _0x2096f7={'recipient':[_0x476a21['phone']],'message':_0x476a21['body'],'message_type':_0x43904b['smsMethod']};if(_0x43904b['smsMethod']&&_0x43904b[_0x30c1('0x2f')]!=='SI'){_0x2096f7['sender']=_0x43904b['phone'];}var _0xb70ea4={'url':_0x4b61c4+_0x30c1('0x30')+_0x43904b['username']+'&password='+_0x43904b[_0x30c1('0x2e')],'method':_0x30c1('0x31')};rp(_0xb70ea4)['then'](function(_0x30d75e){var _0x5b9367=_0x30d75e[_0x30c1('0x32')](';');var _0x1c2045={'user_key':_0x5b9367[0x0],'session_key':_0x5b9367[0x1]};_0xb70ea4={'url':_0x4b61c4+'sms','method':_0x30c1('0x33'),'headers':{'user_key':_0x1c2045[_0x30c1('0x34')],'Session_key':_0x1c2045[_0x30c1('0x35')]},'json':!![],'body':_0x2096f7};return rp(_0xb70ea4);})[_0x30c1('0x15')](function(_0x277566){if(_0x277566[_0x30c1('0x36')]>=0x1){var _0x2149bb={'messageId':_0x277566['internal_order_id']};if(_0x43904b['smsMethod']!=='GP'||!_0x43904b[_0x30c1('0x37')]){_0x2149bb['read']=!![];}return _0x2c2fdf['update'](_0x2149bb);}else{return logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x2c'),util[_0x30c1('0x29')](_0x277566,{'showHidden':![],'depth':null}));}})[_0x30c1('0x18')](function(_0x5cef78){return logger['error'](_0x30c1('0x28'),'afterCreate','skebby',util[_0x30c1('0x29')](_0x5cef78,{'showHidden':![],'depth':null}));});}else{logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),_0x30c1('0x2c'),_0x30c1('0x38'));}break;case _0x30c1('0x39'):if(_0x43904b[_0x30c1('0x3a')]){var _0x494f14={'recipient':_0x476a21[_0x30c1('0x20')],'message':_0x476a21['body'],'sender':_0x43904b[_0x30c1('0x3b')]||_0x43904b['phone'],'authorization':_0x43904b[_0x30c1('0x3a')]};var _0x417637={'method':'POST','uri':_0x30c1('0x3c'),'body':_0x494f14,'json':!![]};rp(_0x417637)[_0x30c1('0x15')](function(_0x270afc){var _0x4b6e73={'messageId':_0x270afc[_0x30c1('0x3d')]};if(!_0x43904b[_0x30c1('0x37')]){_0x4b6e73[_0x30c1('0x3e')]=!![];}return _0x2c2fdf[_0x30c1('0x16')](_0x4b6e73);})[_0x30c1('0x18')](function(_0x32029e){logger[_0x30c1('0x19')](_0x30c1('0x28'),'afterCreate',_0x30c1('0x39'),util[_0x30c1('0x29')](_0x32029e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),_0x30c1('0x39'),_0x30c1('0x3f'));}break;case _0x30c1('0x40'):if(_0x43904b[_0x30c1('0x41')]&&_0x43904b['password']){var _0x494f14={'messages':[{'source':_0x30c1('0x42'),'to':_0x476a21['phone'],'body':_0x476a21[_0x30c1('0x23')],'from':_0x43904b['senderString']||_0x43904b[_0x30c1('0x20')]}]};var _0x278674=util[_0x30c1('0x43')](_0x30c1('0x44'),_0x43904b[_0x30c1('0x41')],_0x43904b['password']);var _0x417637={'method':_0x30c1('0x33'),'uri':_0x30c1('0x45'),'body':_0x494f14,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x278674)['toString'](_0x30c1('0x46')))},'json':!![]};rp(_0x417637)[_0x30c1('0x15')](function(_0xe5d06e){if(_0xe5d06e[_0x30c1('0x47')]>=0xc8&&_0xe5d06e[_0x30c1('0x47')]<=0xce){if(_0xe5d06e[_0x30c1('0x48')]&&_0xe5d06e[_0x30c1('0x48')][_0x30c1('0x49')]>0x0){var _0x1c8073=_[_0x30c1('0x4a')](_0xe5d06e[_0x30c1('0x48')][_0x30c1('0x21')]);var _0x627930={'messageId':_0x1c8073[_0x30c1('0x4b')]};if(!_0x43904b['deliveryReport']){_0x627930[_0x30c1('0x3e')]=!![];}return _0x2c2fdf['update'](_0x627930);}else{logger[_0x30c1('0x19')](_0x30c1('0x28'),'afterCreate','clickSend',util['inspect'](_0xe5d06e,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0xe5d06e,{'showHidden':![],'depth':null}));}})[_0x30c1('0x18')](function(_0x4f7c22){logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),_0x30c1('0x4c'),util[_0x30c1('0x29')](_0x4f7c22,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),'clickSend',_0x30c1('0x38'));}break;case _0x30c1('0x4d'):if(_0x43904b[_0x30c1('0x4e')]&&_0x43904b[_0x30c1('0x3a')]){var _0x494f14={'dst':_0x476a21[_0x30c1('0x20')],'text':_0x476a21['body'],'src':_0x43904b[_0x30c1('0x3b')]||_0x43904b[_0x30c1('0x20')],'url':_0x43904b['remote']+'/api/sms/messages/'+_0x476a21['id']+_0x30c1('0x25')+_0x43904b['token']};var _0x278674=util['format'](_0x30c1('0x44'),_0x43904b['authId'],_0x43904b['authToken']);var _0x417637={'method':_0x30c1('0x33'),'uri':util[_0x30c1('0x43')](_0x30c1('0x4f'),_0x43904b[_0x30c1('0x4e')]),'body':_0x494f14,'headers':{'Authorization':util[_0x30c1('0x43')](_0x30c1('0x50'),new Buffer(_0x278674)[_0x30c1('0x51')](_0x30c1('0x46')))},'json':!![]};rp(_0x417637)[_0x30c1('0x15')](function(_0xea5f26){var _0x3267de={'messageId':_0xea5f26['message_uuid'][0x0]};return _0x2c2fdf['update'](_0x3267de);})[_0x30c1('0x18')](function(_0x2f6c5d){logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),_0x30c1('0x4d'),util['inspect'](_0x2f6c5d,{'showHidden':![],'depth':null}));});}else{logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),_0x30c1('0x4d'),_0x30c1('0x52'));}break;case _0x30c1('0x53'):if(_0x43904b['username']&&_0x43904b[_0x30c1('0x2e')]){if(_0x43904b[_0x30c1('0x54')]){var _0x4d34b1={'method':_0x30c1('0x33'),'uri':_0x43904b[_0x30c1('0x54')]+_0x30c1('0x55'),'body':{'username':_0x43904b[_0x30c1('0x41')],'password':_0x43904b['password']},'json':!![]};return rp(_0x4d34b1)['then'](function(_0x4bca7b){var _0x1908b2={'method':_0x30c1('0x33'),'uri':_0x43904b[_0x30c1('0x54')]+_0x30c1('0x56'),'body':{'messages':[{'from':_0x43904b['phone'],'destinations':[{'to':_0x476a21[_0x30c1('0x20')]}],'text':_0x476a21[_0x30c1('0x23')],'notifyUrl':_0x43904b['remote']+'/api/sms/messages/'+_0x476a21['id']+'/status?token='+_0x43904b[_0x30c1('0x26')],'notifyContentType':_0x30c1('0x57'),'callbackData':_0x43904b[_0x30c1('0x20')]+';'+_0x476a21[_0x30c1('0x23')]}]},'headers':{'Authorization':_0x30c1('0x58')+_0x4bca7b[_0x30c1('0x26')]},'json':!![]};return rp(_0x1908b2)[_0x30c1('0x15')](function(_0x42831f){if(_0x42831f[_0x30c1('0x21')]){var _0x1a045f={'messageId':_0x42831f['messages'][0x0][_0x30c1('0xa')]};if(!_0x43904b[_0x30c1('0x37')]){_0x1a045f[_0x30c1('0x3e')]=!![];}return _0x2c2fdf[_0x30c1('0x16')](_0x1a045f);}else{return logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x53'),util[_0x30c1('0x29')](_0x42831f,{'showHidden':![],'depth':null}));}});})[_0x30c1('0x18')](function(_0x5dcb13){return logger[_0x30c1('0x19')](_0x30c1('0x28'),'afterCreate','infobip',util[_0x30c1('0x29')](_0x5dcb13,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x53'),_0x30c1('0x59'));}}else{logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x53'),_0x30c1('0x38'));}break;case'csc':var _0x4c5c4a=require(_0x30c1('0x5a'));if(_0x43904b['apiKey']){var _0x28a6e0={};_0x28a6e0[_0x30c1('0x5b')]=_0x43904b[_0x30c1('0x41')];_0x28a6e0['phone']=_0x476a21['phone'];_0x28a6e0[_0x30c1('0x5c')]=_0x43904b[_0x30c1('0x20')];_0x28a6e0[_0x30c1('0x5d')]=_0x476a21[_0x30c1('0x23')];_0x28a6e0[_0x30c1('0x5e')]=+new Date();var _0x17df76='';var _0x37754e='';var _0x33cb35=Object['keys'](_0x28a6e0);_0x33cb35[_0x30c1('0x5f')]();for(var _0x173e77=0x0;_0x173e77<_0x33cb35[_0x30c1('0x60')];_0x173e77++){if(_0x17df76!=''){_0x17df76+='&';}_0x17df76+=_0x33cb35[_0x173e77]+'='+encodeURIComponent(_0x28a6e0[_0x33cb35[_0x173e77]]);_0x37754e+=_0x28a6e0[_0x33cb35[_0x173e77]];}_0x37754e+=_0x43904b['apiKey'];_0x37754e=_0x4c5c4a[_0x30c1('0x61')]('md5')[_0x30c1('0x16')](_0x37754e)[_0x30c1('0x62')]('hex');if(_0x17df76!==''){_0x17df76+='&';}_0x17df76+=_0x30c1('0x63')+_0x37754e;var _0xb70ea4={'method':_0x30c1('0x31'),'uri':_0x43904b['baseUrl']+'/external/get/send.php?'+_0x17df76,'json':!![]};return rp(_0xb70ea4)[_0x30c1('0x15')](function(_0x409d15){var _0x50f8ad=Object[_0x30c1('0x64')](_0x409d15);if(_0x409d15[_0x50f8ad[0x0]][_0x30c1('0x19')]&&parseInt(_0x409d15[_0x50f8ad[0x0]][_0x30c1('0x19')])===0x0){var _0xb04b2d={'messageId':_0x409d15[_0x50f8ad[0x0]][_0x30c1('0x65')]};if(!_0x43904b['deliveryReport']){_0xb04b2d[_0x30c1('0x3e')]=!![];}return _0x2c2fdf[_0x30c1('0x16')](_0xb04b2d);}else{return logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x66'),util[_0x30c1('0x29')](_0x409d15[_0x30c1('0x19')],{'showHidden':![],'depth':null}));}})[_0x30c1('0x18')](function(_0x170a9f){return logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x30c1('0x66'),util[_0x30c1('0x29')](_0x170a9f,{'showHidden':![],'depth':null}));});}else{logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),'csc',_0x30c1('0x67'));}break;case'clickatell':if(_0x43904b[_0x30c1('0x68')]){var _0x438644={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x43904b['apiKey']},'body':{'content':_0x476a21[_0x30c1('0x23')],'to':[_0x476a21[_0x30c1('0x20')]],'from':_0x43904b[_0x30c1('0x20')],'binary':![],'clientMessageId':_0x30c1('0x69'),'charset':_0x30c1('0x6a')},'json':!![]};rp(_0x438644)['then'](function(_0x24d9d9){if(!_0x24d9d9[_0x30c1('0x19')]){var _0x1e81c2={'messageId':_0x24d9d9[_0x30c1('0x21')][0x0][_0x30c1('0x6b')]};if(!_0x43904b['deliveryReport']){_0x1e81c2[_0x30c1('0x3e')]=!![];}return _0x2c2fdf['update'](_0x1e81c2);}else{return logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x6c'),util[_0x30c1('0x29')](_0x24d9d9[_0x30c1('0x19')],{'showHidden':![],'depth':null}));}})[_0x30c1('0x18')](function(_0x5ddd58){return logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x6c'),util[_0x30c1('0x29')](_0x5ddd58,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x6c'),_0x30c1('0x67'));}break;case _0x30c1('0x6d'):if(_0x43904b[_0x30c1('0x41')]&&_0x43904b[_0x30c1('0x2e')]){var _0x278674=util[_0x30c1('0x43')]('%s:%s',_0x43904b[_0x30c1('0x41')],_0x43904b[_0x30c1('0x2e')]);var _0x417637={'method':_0x30c1('0x33'),'uri':_0x30c1('0x6e')+_0x43904b[_0x30c1('0x6f')]+'/messages','body':{'to':[_0x476a21[_0x30c1('0x20')]],'text':_0x476a21[_0x30c1('0x23')],'from':_0x43904b['phone'],'applicationId':_0x43904b[_0x30c1('0x70')]},'headers':{'Authorization':util[_0x30c1('0x43')](_0x30c1('0x50'),new Buffer(_0x278674)[_0x30c1('0x51')](_0x30c1('0x46')))},'json':!![]};rp(_0x417637)[_0x30c1('0x15')](function(_0x1e86a3){if(_0x1e86a3['id']){var _0x458510={'messageId':_0x1e86a3['id']};return _0x2c2fdf['update'](_0x458510);}else{logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),'bandwidth',util[_0x30c1('0x29')](_0x1e86a3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x6cc3e4){logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x30c1('0x2a'),_0x30c1('0x6d'),util[_0x30c1('0x29')](_0x6cc3e4,{'showHidden':![],'depth':null}));});}else{logger[_0x30c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x30c1('0x6d'),_0x30c1('0x38'));}break;case _0x30c1('0x71'):if(_0x43904b['apiKey']){var _0xbaef20={};var _0xb70ea4={'method':_0x30c1('0x33'),'uri':_0x30c1('0x72'),'headers':{'Authorization':_0x30c1('0x73')+_0x43904b[_0x30c1('0x68')],'Content-Type':_0x30c1('0x57')},'body':{'from':_0x43904b[_0x30c1('0x20')],'to':_0x476a21[_0x30c1('0x20')],'text':_0x476a21[_0x30c1('0x23')]},'json':!![]};return rp(_0xb70ea4)['then'](function(_0x2a295b){if(_0x2a295b['code']==0xca){_0xbaef20[_0x30c1('0x74')]=_0x2a295b;var _0x3438cf={'method':_0x30c1('0x33'),'uri':_0x30c1('0x75'),'headers':{'Authorization':_0x30c1('0x73')+_0x43904b['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0xbaef20[_0x30c1('0x74')][_0x30c1('0x76')]},'json':!![]};return rp(_0x3438cf)[_0x30c1('0x15')](function(_0x4e77d7){_0xbaef20[_0x30c1('0x77')]=_0x4e77d7;var _0x2e2987={'messageId':_0xbaef20[_0x30c1('0x74')][_0x30c1('0x76')],'read':!![]};return _0x2c2fdf['update'](_0x2e2987);});}else{return logger[_0x30c1('0x19')](_0x30c1('0x28'),'afterCreate',_0x30c1('0x71'),util[_0x30c1('0x29')](_0x2a295b,{'showHidden':![],'depth':null}));}})[_0x30c1('0x18')](function(_0x5cf9ab){return logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x71'),util[_0x30c1('0x29')](_0x5cf9ab,{'showHidden':![],'depth':null}));});}else{return logger[_0x30c1('0x19')](_0x30c1('0x28'),_0x30c1('0x2a'),_0x30c1('0x71'),_0x30c1('0x78'));}break;}}})['finally'](function(){_0x186150();});}else{_0x186150();}}},'charset':_0x30c1('0x79'),'collate':_0x30c1('0x7a')});}; \ No newline at end of file +var _0x85bb=['keys','length','createHash','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','accountId','/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','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','GET','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','format','%s:%s','Basic\x20%s','toString','base64','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp'];(function(_0x2e17a7,_0x5b5efa){var _0x443505=function(_0x1bc24d){while(--_0x1bc24d){_0x2e17a7['push'](_0x2e17a7['shift']());}};_0x443505(++_0x5b5efa);}(_0x85bb,0x97));var _0xb85b=function(_0x4f34bb,_0x1cae26){_0x4f34bb=_0x4f34bb-0x0;var _0x43e3ab=_0x85bb[_0x4f34bb];return _0x43e3ab;};'use strict';var _=require('lodash');var util=require(_0xb85b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb85b('0x1'));var BPromise=require(_0xb85b('0x2'));var rp=require(_0xb85b('0x3'));var fs=require('fs');var path=require(_0xb85b('0x4'));var rimraf=require(_0xb85b('0x5'));var config=require(_0xb85b('0x6'));var attributes=require(_0xb85b('0x7'));module[_0xb85b('0x8')]=function(_0xc8efbd,_0x51256c){return _0xc8efbd[_0xb85b('0x9')](_0xb85b('0xa'),attributes,{'tableName':_0xb85b('0xb'),'paranoid':![],'indexes':[{'name':_0xb85b('0xc'),'fields':[_0xb85b('0xc')]},{'name':_0xb85b('0xd'),'fields':[_0xb85b('0xe')],'type':_0xb85b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20a18b,_0x41b350,_0x209fd0){var _0x20fffe=_0xc8efbd[_0xb85b('0x10')];var _0x178b23=_0x20a18b[_0xb85b('0x11')]({'plain':!![]});if(_0x178b23['direction'][_0xb85b('0x12')]()==='in'||_0x178b23[_0xb85b('0x13')]['toLowerCase']()===_0xb85b('0x14')&&!_0x178b23[_0xb85b('0x15')]&&!_['isNil'](_0x178b23[_0xb85b('0x16')])&&!_[_0xb85b('0x17')](_0x178b23[_0xb85b('0x18')])){_0x20fffe[_0xb85b('0x19')][_0xb85b('0x1a')]({'where':{'id':_0x178b23['SmsInteractionId']}})[_0xb85b('0x1b')](function(_0x2f6ab6){if(_0x2f6ab6){_0x2f6ab6[_0xb85b('0x1c')]({'lastMsgAt':_0x178b23[_0xb85b('0x1d')],'lastMsgDirection':_0x178b23[_0xb85b('0x13')][_0xb85b('0x12')]()});}})['catch'](function(_0x5741ef){console[_0xb85b('0x1e')](_0x5741ef);});}if(_0x178b23[_0xb85b('0x13')]===_0xb85b('0x14')&&!_0x178b23[_0xb85b('0x15')]){var _0x3c2d0e;_0x20fffe[_0xb85b('0x1f')]['find']({'where':{'id':_0x178b23[_0xb85b('0x20')]},'raw':!![]})['then'](function(_0x47195a){_0x3c2d0e=_0x47195a;if(_0x3c2d0e&&_0x3c2d0e[_0xb85b('0x21')]){switch(_0x3c2d0e[_0xb85b('0x21')]){case _0xb85b('0x22'):var _0x2af4cf=require(_0xb85b('0x22'));if(_0x3c2d0e[_0xb85b('0x23')]&&_0x3c2d0e['authToken']&&_0x3c2d0e['phone']){var _0x588dca=new _0x2af4cf(_0x3c2d0e[_0xb85b('0x23')],_0x3c2d0e[_0xb85b('0x24')]);_0x588dca[_0xb85b('0x25')][_0xb85b('0x26')]({'body':_0x178b23[_0xb85b('0xe')],'to':_0x178b23[_0xb85b('0x27')],'from':_0x3c2d0e['phone'],'statusCallback':_0x3c2d0e[_0xb85b('0x28')]+_0xb85b('0x29')+_0x178b23['id']+_0xb85b('0x2a')+_0x3c2d0e['token']})[_0xb85b('0x1b')](function(_0x5a81f2){if(_0x5a81f2[_0xb85b('0x2b')]){return _0x20a18b[_0xb85b('0x1c')]({'messageId':_0x5a81f2[_0xb85b('0x2b')]});}})[_0xb85b('0x2c')](function(_0x4cb0cc){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x22'),util[_0xb85b('0x2f')](_0x4cb0cc,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x22'),_0xb85b('0x30'));}break;case _0xb85b('0x31'):var _0x47ad28='https://api.skebby.it/API/v1.0/REST/';if(_0x3c2d0e[_0xb85b('0x32')]&&_0x3c2d0e['password']){var _0x2f9c96={'recipient':[_0x178b23[_0xb85b('0x27')]],'message':_0x178b23[_0xb85b('0xe')],'message_type':_0x3c2d0e[_0xb85b('0x33')]};if(_0x3c2d0e[_0xb85b('0x33')]&&_0x3c2d0e[_0xb85b('0x33')]!=='SI'){_0x2f9c96[_0xb85b('0x34')]=_0x3c2d0e[_0xb85b('0x27')];}var _0x120863={'url':_0x47ad28+_0xb85b('0x35')+_0x3c2d0e[_0xb85b('0x32')]+_0xb85b('0x36')+_0x3c2d0e[_0xb85b('0x37')],'method':_0xb85b('0x38')};rp(_0x120863)['then'](function(_0x1124da){var _0x12dcc3=_0x1124da['split'](';');var _0x51cec4={'user_key':_0x12dcc3[0x0],'session_key':_0x12dcc3[0x1]};_0x120863={'url':_0x47ad28+_0xb85b('0x39'),'method':_0xb85b('0x3a'),'headers':{'user_key':_0x51cec4['user_key'],'Session_key':_0x51cec4[_0xb85b('0x3b')]},'json':!![],'body':_0x2f9c96};return rp(_0x120863);})[_0xb85b('0x1b')](function(_0x304b6e){if(_0x304b6e[_0xb85b('0x3c')]>=0x1){var _0x5b08ec={'messageId':_0x304b6e[_0xb85b('0x3d')]};if(_0x3c2d0e[_0xb85b('0x33')]!=='GP'||!_0x3c2d0e[_0xb85b('0x3e')]){_0x5b08ec[_0xb85b('0x3f')]=!![];}return _0x20a18b[_0xb85b('0x1c')](_0x5b08ec);}else{return logger['error'](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x31'),util[_0xb85b('0x2f')](_0x304b6e,{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x3368c3){return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),'afterCreate','skebby',util[_0xb85b('0x2f')](_0x3368c3,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x3c2d0e[_0xb85b('0x24')]){var _0x20d14a={'recipient':_0x178b23['phone'],'message':_0x178b23[_0xb85b('0xe')],'sender':_0x3c2d0e['senderString']||_0x3c2d0e[_0xb85b('0x27')],'authorization':_0x3c2d0e[_0xb85b('0x24')]};var _0x41b350={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x20d14a,'json':!![]};rp(_0x41b350)[_0xb85b('0x1b')](function(_0x306a2f){var _0x3dde45={'messageId':_0x306a2f['requestid']};if(!_0x3c2d0e['deliveryReport']){_0x3dde45[_0xb85b('0x3f')]=!![];}return _0x20a18b[_0xb85b('0x1c')](_0x3dde45);})['catch'](function(_0x20c5ed){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x40'),util[_0xb85b('0x2f')](_0x20c5ed,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x3c2d0e[_0xb85b('0x32')]&&_0x3c2d0e[_0xb85b('0x37')]){var _0x20d14a={'messages':[{'source':'xCALLY\x20Motion','to':_0x178b23[_0xb85b('0x27')],'body':_0x178b23[_0xb85b('0xe')],'from':_0x3c2d0e[_0xb85b('0x41')]||_0x3c2d0e['phone']}]};var _0x22e0c5=util[_0xb85b('0x42')](_0xb85b('0x43'),_0x3c2d0e[_0xb85b('0x32')],_0x3c2d0e[_0xb85b('0x37')]);var _0x41b350={'method':_0xb85b('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x20d14a,'headers':{'Authorization':util[_0xb85b('0x42')](_0xb85b('0x44'),new Buffer(_0x22e0c5)[_0xb85b('0x45')](_0xb85b('0x46')))},'json':!![]};rp(_0x41b350)[_0xb85b('0x1b')](function(_0x1fca84){if(_0x1fca84['http_code']>=0xc8&&_0x1fca84['http_code']<=0xce){if(_0x1fca84[_0xb85b('0x47')]&&_0x1fca84[_0xb85b('0x47')][_0xb85b('0x48')]>0x0){var _0x47aa78=_[_0xb85b('0x49')](_0x1fca84['data'][_0xb85b('0x25')]);var _0x320638={'messageId':_0x47aa78['message_id']};if(!_0x3c2d0e['deliveryReport']){_0x320638[_0xb85b('0x3f')]=!![];}return _0x20a18b['update'](_0x320638);}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x4a'),util[_0xb85b('0x2f')](_0x1fca84,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb85b('0x2d'),_0xb85b('0x2e'),'clickSend',util[_0xb85b('0x2f')](_0x1fca84,{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x390316){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x4a'),util['inspect'](_0x390316,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),'afterCreate','clickSend',_0xb85b('0x4b'));}break;case _0xb85b('0x4c'):if(_0x3c2d0e[_0xb85b('0x4d')]&&_0x3c2d0e[_0xb85b('0x24')]){var _0x20d14a={'dst':_0x178b23[_0xb85b('0x27')],'text':_0x178b23[_0xb85b('0xe')],'src':_0x3c2d0e[_0xb85b('0x41')]||_0x3c2d0e[_0xb85b('0x27')],'url':_0x3c2d0e[_0xb85b('0x28')]+_0xb85b('0x29')+_0x178b23['id']+_0xb85b('0x2a')+_0x3c2d0e[_0xb85b('0x4e')]};var _0x22e0c5=util['format']('%s:%s',_0x3c2d0e[_0xb85b('0x4d')],_0x3c2d0e['authToken']);var _0x41b350={'method':_0xb85b('0x3a'),'uri':util[_0xb85b('0x42')](_0xb85b('0x4f'),_0x3c2d0e[_0xb85b('0x4d')]),'body':_0x20d14a,'headers':{'Authorization':util[_0xb85b('0x42')](_0xb85b('0x44'),new Buffer(_0x22e0c5)['toString'](_0xb85b('0x46')))},'json':!![]};rp(_0x41b350)[_0xb85b('0x1b')](function(_0x45e420){var _0x2c166e={'messageId':_0x45e420[_0xb85b('0x50')][0x0]};return _0x20a18b[_0xb85b('0x1c')](_0x2c166e);})[_0xb85b('0x2c')](function(_0x61e50){logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x4c'),util[_0xb85b('0x2f')](_0x61e50,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xb85b('0x51'):if(_0x3c2d0e['username']&&_0x3c2d0e[_0xb85b('0x37')]){if(_0x3c2d0e[_0xb85b('0x52')]){var _0x2d3784={'method':'POST','uri':_0x3c2d0e[_0xb85b('0x52')]+_0xb85b('0x53'),'body':{'username':_0x3c2d0e[_0xb85b('0x32')],'password':_0x3c2d0e[_0xb85b('0x37')]},'json':!![]};return rp(_0x2d3784)[_0xb85b('0x1b')](function(_0x3ef26b){var _0x468ef8={'method':'POST','uri':_0x3c2d0e['baseUrl']+_0xb85b('0x54'),'body':{'messages':[{'from':_0x3c2d0e[_0xb85b('0x27')],'destinations':[{'to':_0x178b23['phone']}],'text':_0x178b23[_0xb85b('0xe')],'notifyUrl':_0x3c2d0e[_0xb85b('0x28')]+_0xb85b('0x29')+_0x178b23['id']+'/status?token='+_0x3c2d0e['token'],'notifyContentType':_0xb85b('0x55'),'callbackData':_0x3c2d0e[_0xb85b('0x27')]+';'+_0x178b23[_0xb85b('0xe')]}]},'headers':{'Authorization':_0xb85b('0x56')+_0x3ef26b[_0xb85b('0x4e')]},'json':!![]};return rp(_0x468ef8)[_0xb85b('0x1b')](function(_0x1b6632){if(_0x1b6632[_0xb85b('0x25')]){var _0xaddb8d={'messageId':_0x1b6632[_0xb85b('0x25')][0x0]['messageId']};if(!_0x3c2d0e[_0xb85b('0x3e')]){_0xaddb8d[_0xb85b('0x3f')]=!![];}return _0x20a18b[_0xb85b('0x1c')](_0xaddb8d);}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x51'),util[_0xb85b('0x2f')](_0x1b6632,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x56b48d){return logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x51'),util['inspect'](_0x56b48d,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x51'),_0xb85b('0x57'));}}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),'afterCreate','infobip',_0xb85b('0x4b'));}break;case'csc':var _0x53d0c3=require(_0xb85b('0x58'));if(_0x3c2d0e[_0xb85b('0x59')]){var _0x22de2b={};_0x22de2b[_0xb85b('0x5a')]=_0x3c2d0e['username'];_0x22de2b['phone']=_0x178b23['phone'];_0x22de2b['sender']=_0x3c2d0e[_0xb85b('0x27')];_0x22de2b[_0xb85b('0x5b')]=_0x178b23[_0xb85b('0xe')];_0x22de2b[_0xb85b('0x5c')]=+new Date();var _0x4af3bf='';var _0x45d2b8='';var _0x2f4eaa=Object[_0xb85b('0x5d')](_0x22de2b);_0x2f4eaa['sort']();for(var _0x52adbf=0x0;_0x52adbf<_0x2f4eaa[_0xb85b('0x5e')];_0x52adbf++){if(_0x4af3bf!=''){_0x4af3bf+='&';}_0x4af3bf+=_0x2f4eaa[_0x52adbf]+'='+encodeURIComponent(_0x22de2b[_0x2f4eaa[_0x52adbf]]);_0x45d2b8+=_0x22de2b[_0x2f4eaa[_0x52adbf]];}_0x45d2b8+=_0x3c2d0e[_0xb85b('0x59')];_0x45d2b8=_0x53d0c3[_0xb85b('0x5f')]('md5')[_0xb85b('0x1c')](_0x45d2b8)['digest'](_0xb85b('0x60'));if(_0x4af3bf!==''){_0x4af3bf+='&';}_0x4af3bf+=_0xb85b('0x61')+_0x45d2b8;var _0x120863={'method':_0xb85b('0x38'),'uri':_0x3c2d0e['baseUrl']+_0xb85b('0x62')+_0x4af3bf,'json':!![]};return rp(_0x120863)[_0xb85b('0x1b')](function(_0x250ba8){var _0x452ebd=Object[_0xb85b('0x5d')](_0x250ba8);if(_0x250ba8[_0x452ebd[0x0]]['error']&&parseInt(_0x250ba8[_0x452ebd[0x0]][_0xb85b('0x1e')])===0x0){var _0x31d9be={'messageId':_0x250ba8[_0x452ebd[0x0]][_0xb85b('0x63')]};if(!_0x3c2d0e['deliveryReport']){_0x31d9be['read']=!![];}return _0x20a18b[_0xb85b('0x1c')](_0x31d9be);}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x64'),util['inspect'](_0x250ba8[_0xb85b('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x40dd8b){return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x64'),util[_0xb85b('0x2f')](_0x40dd8b,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb85b('0x64'),_0xb85b('0x65'));}break;case _0xb85b('0x66'):if(_0x3c2d0e[_0xb85b('0x59')]){var _0x5baeba={'method':_0xb85b('0x3a'),'uri':_0xb85b('0x67'),'headers':{'Authorization':_0x3c2d0e['apiKey']},'body':{'content':_0x178b23[_0xb85b('0xe')],'to':[_0x178b23[_0xb85b('0x27')]],'from':_0x3c2d0e[_0xb85b('0x27')],'binary':![],'clientMessageId':_0xb85b('0x68'),'charset':_0xb85b('0x69')},'json':!![]};rp(_0x5baeba)[_0xb85b('0x1b')](function(_0x559cdd){if(!_0x559cdd[_0xb85b('0x1e')]){var _0xacfdf1={'messageId':_0x559cdd[_0xb85b('0x25')][0x0]['apiMessageId']};if(!_0x3c2d0e['deliveryReport']){_0xacfdf1['read']=!![];}return _0x20a18b['update'](_0xacfdf1);}else{return logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0xb85b('0x2f')](_0x559cdd['error'],{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x3e13b3){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x66'),util[_0xb85b('0x2f')](_0x3e13b3,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x66'),_0xb85b('0x65'));}break;case _0xb85b('0x6a'):if(_0x3c2d0e[_0xb85b('0x32')]&&_0x3c2d0e['password']){var _0x22e0c5=util[_0xb85b('0x42')](_0xb85b('0x43'),_0x3c2d0e[_0xb85b('0x32')],_0x3c2d0e[_0xb85b('0x37')]);var _0x41b350={'method':_0xb85b('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3c2d0e[_0xb85b('0x6b')]+_0xb85b('0x6c'),'body':{'to':[_0x178b23[_0xb85b('0x27')]],'text':_0x178b23[_0xb85b('0xe')],'from':_0x3c2d0e[_0xb85b('0x27')],'applicationId':_0x3c2d0e[_0xb85b('0x6d')]},'headers':{'Authorization':util[_0xb85b('0x42')](_0xb85b('0x44'),new Buffer(_0x22e0c5)[_0xb85b('0x45')](_0xb85b('0x46')))},'json':!![]};rp(_0x41b350)['then'](function(_0x2ec314){if(_0x2ec314['id']){var _0x369448={'messageId':_0x2ec314['id']};return _0x20a18b[_0xb85b('0x1c')](_0x369448);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x6a'),util[_0xb85b('0x2f')](_0x2ec314,{'showHidden':![],'depth':null}));}})['catch'](function(_0x39fbbe){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x6a'),util[_0xb85b('0x2f')](_0x39fbbe,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x6a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb85b('0x6e'):if(_0x3c2d0e[_0xb85b('0x59')]){var _0x5dead0={};var _0x120863={'method':_0xb85b('0x3a'),'uri':_0xb85b('0x6f'),'headers':{'Authorization':_0xb85b('0x70')+_0x3c2d0e[_0xb85b('0x59')],'Content-Type':_0xb85b('0x55')},'body':{'from':_0x3c2d0e['phone'],'to':_0x178b23['phone'],'text':_0x178b23[_0xb85b('0xe')]},'json':!![]};return rp(_0x120863)[_0xb85b('0x1b')](function(_0x31d403){if(_0x31d403[_0xb85b('0x71')]==0xca){_0x5dead0[_0xb85b('0x72')]=_0x31d403;var _0x4e128f={'method':_0xb85b('0x3a'),'uri':_0xb85b('0x73'),'headers':{'Authorization':_0xb85b('0x70')+_0x3c2d0e['apiKey'],'Content-Type':_0xb85b('0x55')},'body':{'refid':_0x5dead0[_0xb85b('0x72')][_0xb85b('0x74')]},'json':!![]};return rp(_0x4e128f)['then'](function(_0x493b01){_0x5dead0[_0xb85b('0x75')]=_0x493b01;var _0x4e9ab2={'messageId':_0x5dead0[_0xb85b('0x72')][_0xb85b('0x74')],'read':!![]};return _0x20a18b[_0xb85b('0x1c')](_0x4e9ab2);});}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x6e'),util[_0xb85b('0x2f')](_0x31d403,{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x464367){return logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x6e'),util[_0xb85b('0x2f')](_0x464367,{'showHidden':![],'depth':null}));});}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),'intelepeer',_0xb85b('0x76'));}break;}}})[_0xb85b('0x77')](function(){_0x209fd0();});}else{_0x209fd0();}}},'charset':_0xb85b('0x78'),'collate':_0xb85b('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index cebb13b..d98635e 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 _0x14df=['http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','create','body','options','raw','CreateSmsMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x35cfe2,_0x1765b1){var _0x46b553=function(_0x7376a5){while(--_0x7376a5){_0x35cfe2['push'](_0x35cfe2['shift']());}};_0x46b553(++_0x1765b1);}(_0x14df,0xe2));var _0xf14d=function(_0x520e13,_0x1a7084){_0x520e13=_0x520e13-0x0;var _0x5a3975=_0x14df[_0x520e13];return _0x5a3975;};'use strict';var _=require(_0xf14d('0x0'));var util=require(_0xf14d('0x1'));var moment=require(_0xf14d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf14d('0x3'));var fs=require('fs');var Redis=require(_0xf14d('0x4'));var db=require(_0xf14d('0x5'))['db'];var utils=require(_0xf14d('0x6'));var logger=require(_0xf14d('0x7'))(_0xf14d('0x8'));var config=require(_0xf14d('0x9'));var jayson=require(_0xf14d('0xa'));var client=jayson[_0xf14d('0xb')][_0xf14d('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf14d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf14d('0xe'))(new Redis(config[_0xf14d('0xd')]));require(_0xf14d('0xf'))[_0xf14d('0x10')](socket);function respondWithRpcPromise(_0x5852b8,_0x17ea92,_0x28b9ae){return new BPromise(function(_0xfcd681,_0x54963f){return client[_0xf14d('0x11')](_0x5852b8,_0x28b9ae)[_0xf14d('0x12')](function(_0x1d8ffe){logger['info'](_0xf14d('0x13'),_0x17ea92,_0xf14d('0x14'));logger[_0xf14d('0x15')](_0xf14d('0x16'),_0x17ea92,_0xf14d('0x14'),JSON['stringify'](_0x1d8ffe));if(_0x1d8ffe['error']){if(_0x1d8ffe[_0xf14d('0x17')]['code']===0x1f4){logger[_0xf14d('0x17')]('SmsMessage,\x20%s,\x20%s',_0x17ea92,_0x1d8ffe[_0xf14d('0x17')][_0xf14d('0x18')]);return _0x54963f(_0x1d8ffe['error'][_0xf14d('0x18')]);}logger[_0xf14d('0x17')](_0xf14d('0x13'),_0x17ea92,_0x1d8ffe[_0xf14d('0x17')]['message']);return _0xfcd681(_0x1d8ffe[_0xf14d('0x17')][_0xf14d('0x18')]);}else{logger[_0xf14d('0x19')](_0xf14d('0x13'),_0x17ea92,_0xf14d('0x14'));_0xfcd681(_0x1d8ffe[_0xf14d('0x1a')][_0xf14d('0x18')]);}})[_0xf14d('0x1b')](function(_0x14aa72){logger['error'](_0xf14d('0x13'),_0x17ea92,_0x14aa72);_0x54963f(_0x14aa72);});});}exports['CreateSmsMessage']=function(_0x17e61a){var _0x433adf=this;return new Promise(function(_0x237c97,_0x2ad34a){return db['SmsMessage'][_0xf14d('0x1c')](_0x17e61a[_0xf14d('0x1d')],{'raw':_0x17e61a[_0xf14d('0x1e')]?_0x17e61a[_0xf14d('0x1e')][_0xf14d('0x1f')]===undefined?!![]:![]:!![]})[_0xf14d('0x12')](function(_0x2bf0e2){logger['info']('CreateSmsMessage',_0x17e61a);logger[_0xf14d('0x15')](_0xf14d('0x20'),_0x17e61a,JSON[_0xf14d('0x21')](_0x2bf0e2));_0x237c97(_0x2bf0e2);})[_0xf14d('0x1b')](function(_0x4dfdc9){logger[_0xf14d('0x17')]('CreateSmsMessage',_0x4dfdc9[_0xf14d('0x18')],_0x17e61a);_0x2ad34a(_0x433adf[_0xf14d('0x17')](0x1f4,_0x4dfdc9[_0xf14d('0x18')]));});});}; \ No newline at end of file +var _0xb574=['request\x20sent','error','code','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb574,0x9a));var _0x4b57=function(_0x3f16f3,_0x3e067a){_0x3f16f3=_0x3f16f3-0x0;var _0x292838=_0xb574[_0x3f16f3];return _0x292838;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require(_0x4b57('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require(_0x4b57('0x4'));var db=require(_0x4b57('0x5'))['db'];var utils=require(_0x4b57('0x6'));var logger=require(_0x4b57('0x7'))(_0x4b57('0x8'));var config=require(_0x4b57('0x9'));var jayson=require(_0x4b57('0xa'));var client=jayson[_0x4b57('0xb')][_0x4b57('0xc')]({'port':0x232a});config[_0x4b57('0xd')]=_[_0x4b57('0xe')](config[_0x4b57('0xd')],{'host':_0x4b57('0xf'),'port':0x18eb});var socket=require(_0x4b57('0x10'))(new Redis(config[_0x4b57('0xd')]));require('./smsMessage.socket')[_0x4b57('0x11')](socket);function respondWithRpcPromise(_0x2090e0,_0xabe7ef,_0x2a0aba){return new BPromise(function(_0x199eac,_0x59f836){return client['request'](_0x2090e0,_0x2a0aba)[_0x4b57('0x12')](function(_0x5598b3){logger[_0x4b57('0x13')](_0x4b57('0x14'),_0xabe7ef,_0x4b57('0x15'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xabe7ef,'request\x20sent',JSON['stringify'](_0x5598b3));if(_0x5598b3[_0x4b57('0x16')]){if(_0x5598b3['error'][_0x4b57('0x17')]===0x1f4){logger[_0x4b57('0x16')](_0x4b57('0x14'),_0xabe7ef,_0x5598b3['error'][_0x4b57('0x18')]);return _0x59f836(_0x5598b3[_0x4b57('0x16')][_0x4b57('0x18')]);}logger['error'](_0x4b57('0x14'),_0xabe7ef,_0x5598b3[_0x4b57('0x16')]['message']);return _0x199eac(_0x5598b3[_0x4b57('0x16')][_0x4b57('0x18')]);}else{logger[_0x4b57('0x13')]('SmsMessage,\x20%s,\x20%s',_0xabe7ef,_0x4b57('0x15'));_0x199eac(_0x5598b3[_0x4b57('0x19')]['message']);}})[_0x4b57('0x1a')](function(_0x161deb){logger['error'](_0x4b57('0x14'),_0xabe7ef,_0x161deb);_0x59f836(_0x161deb);});});}exports['CreateSmsMessage']=function(_0x33050a){var _0x3c19c6=this;return new Promise(function(_0x1a4330,_0x4950e0){return db[_0x4b57('0x1b')][_0x4b57('0x1c')](_0x33050a[_0x4b57('0x1d')],{'raw':_0x33050a[_0x4b57('0x1e')]?_0x33050a['options'][_0x4b57('0x1f')]===undefined?!![]:![]:!![]})[_0x4b57('0x12')](function(_0x4a3b1b){logger['info'](_0x4b57('0x20'),_0x33050a);logger[_0x4b57('0x21')](_0x4b57('0x20'),_0x33050a,JSON[_0x4b57('0x22')](_0x4a3b1b));_0x1a4330(_0x4a3b1b);})[_0x4b57('0x1a')](function(_0x3c9cf0){logger[_0x4b57('0x16')]('CreateSmsMessage',_0x3c9cf0[_0x4b57('0x18')],_0x33050a);_0x4950e0(_0x3c19c6[_0x4b57('0x16')](0x1f4,_0x3c9cf0[_0x4b57('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index b4d58c4..0d5df0a 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 _0xb05b=['update','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x66296d,_0x1c5b7a){var _0x3e4882=function(_0x21c889){while(--_0x21c889){_0x66296d['push'](_0x66296d['shift']());}};_0x3e4882(++_0x1c5b7a);}(_0xb05b,0x1c5));var _0xbb05=function(_0x8962d6,_0x503ed6){_0x8962d6=_0x8962d6-0x0;var _0x566f25=_0xb05b[_0x8962d6];return _0x566f25;};'use strict';var SmsMessageEvents=require(_0xbb05('0x0'));var events=[_0xbb05('0x1'),_0xbb05('0x2'),_0xbb05('0x3')];function createListener(_0x7c2f53,_0x14c7a9){return function(_0x5114e1){_0x14c7a9['emit'](_0x7c2f53,_0x5114e1);};}function removeListener(_0x40185a,_0x5ced1c){return function(){SmsMessageEvents[_0xbb05('0x4')](_0x40185a,_0x5ced1c);};}exports[_0xbb05('0x5')]=function(_0x1f1c36){for(var _0x27f93c=0x0,_0x2d15c9=events[_0xbb05('0x6')];_0x27f93c<_0x2d15c9;_0x27f93c++){var _0x3b085f=events[_0x27f93c];var _0x4f85d9=createListener(_0xbb05('0x7')+_0x3b085f,_0x1f1c36);SmsMessageEvents['on'](_0x3b085f,_0x4f85d9);}}; \ No newline at end of file +var _0x68e0=['length','smsMessage:','./smsMessage.events','save','remove','update','emit','register'];(function(_0x3c1c35,_0x12e8b6){var _0x43a965=function(_0x543bcc){while(--_0x543bcc){_0x3c1c35['push'](_0x3c1c35['shift']());}};_0x43a965(++_0x12e8b6);}(_0x68e0,0x122));var _0x068e=function(_0x465145,_0x47c352){_0x465145=_0x465145-0x0;var _0x55e404=_0x68e0[_0x465145];return _0x55e404;};'use strict';var SmsMessageEvents=require(_0x068e('0x0'));var events=[_0x068e('0x1'),_0x068e('0x2'),_0x068e('0x3')];function createListener(_0xbf1c45,_0x1d08a0){return function(_0x176cc1){_0x1d08a0[_0x068e('0x4')](_0xbf1c45,_0x176cc1);};}function removeListener(_0x249b75,_0x56058f){return function(){SmsMessageEvents['removeListener'](_0x249b75,_0x56058f);};}exports[_0x068e('0x5')]=function(_0x2c2cb8){for(var _0x36c854=0x0,_0x160a07=events[_0x068e('0x6')];_0x36c854<_0x160a07;_0x36c854++){var _0x9d40b9=events[_0x36c854];var _0x5d1269=createListener(_0x068e('0x7')+_0x9d40b9,_0x2c2cb8);SmsMessageEvents['on'](_0x9d40b9,_0x5d1269);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 8e9e781..8b658db 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 _0x9a8c=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','getTeams','/:id/users','addTeams','post','put','/:id','update','destroy','/:id/teams','removeTeams','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x185743,_0x449bf8){var _0x153e9c=function(_0x1a15a6){while(--_0x1a15a6){_0x185743['push'](_0x185743['shift']());}};_0x153e9c(++_0x449bf8);}(_0x9a8c,0x18e));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc9a8('0x0'));var util=require(_0xc9a8('0x1'));var path=require('path');var timeout=require(_0xc9a8('0x2'));var express=require('express');var router=express[_0xc9a8('0x3')]();var fs_extra=require(_0xc9a8('0x4'));var auth=require(_0xc9a8('0x5'));var interaction=require(_0xc9a8('0x6'));var config=require(_0xc9a8('0x7'));var controller=require('./smsQueue.controller');router[_0xc9a8('0x8')]('/',auth[_0xc9a8('0x9')](),controller[_0xc9a8('0xa')]);router['get'](_0xc9a8('0xb'),auth['isAuthenticated'](),controller[_0xc9a8('0xc')]);router[_0xc9a8('0x8')]('/:id',auth[_0xc9a8('0x9')](),controller['show']);router[_0xc9a8('0x8')](_0xc9a8('0xd'),auth[_0xc9a8('0x9')](),controller[_0xc9a8('0xe')]);router[_0xc9a8('0x8')]('/:id/teams',auth[_0xc9a8('0x9')](),controller[_0xc9a8('0xf')]);router[_0xc9a8('0x8')](_0xc9a8('0x10'),auth[_0xc9a8('0x9')](),controller['getAgents']);router['post']('/',auth[_0xc9a8('0x9')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xc9a8('0x11')]);router[_0xc9a8('0x12')](_0xc9a8('0x10'),auth[_0xc9a8('0x9')](),controller['addAgents']);router[_0xc9a8('0x13')](_0xc9a8('0x14'),auth['isAuthenticated'](),controller[_0xc9a8('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc9a8('0x16')]);router['delete'](_0xc9a8('0x17'),auth['isAuthenticated'](),controller[_0xc9a8('0x18')]);router[_0xc9a8('0x19')](_0xc9a8('0x10'),auth[_0xc9a8('0x9')](),controller['removeAgents']);module[_0xc9a8('0x1a')]=router; \ No newline at end of file +var _0x481c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','getTeams','/:id/users','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xdaa67e,_0x3f2c22){var _0x1bd67c=function(_0x5d762d){while(--_0x5d762d){_0xdaa67e['push'](_0xdaa67e['shift']());}};_0x1bd67c(++_0x3f2c22);}(_0x481c,0xae));var _0xc481=function(_0x4017aa,_0x16d04f){_0x4017aa=_0x4017aa-0x0;var _0x53c895=_0x481c[_0x4017aa];return _0x53c895;};'use strict';var multer=require(_0xc481('0x0'));var util=require(_0xc481('0x1'));var path=require(_0xc481('0x2'));var timeout=require(_0xc481('0x3'));var express=require(_0xc481('0x4'));var router=express[_0xc481('0x5')]();var fs_extra=require(_0xc481('0x6'));var auth=require(_0xc481('0x7'));var interaction=require(_0xc481('0x8'));var config=require(_0xc481('0x9'));var controller=require(_0xc481('0xa'));router[_0xc481('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc481('0xb')]('/describe',auth[_0xc481('0xc')](),controller[_0xc481('0xd')]);router['get'](_0xc481('0xe'),auth[_0xc481('0xc')](),controller[_0xc481('0xf')]);router[_0xc481('0xb')]('/:id/members',auth[_0xc481('0xc')](),controller[_0xc481('0x10')]);router[_0xc481('0xb')]('/:id/teams',auth[_0xc481('0xc')](),controller[_0xc481('0x11')]);router['get'](_0xc481('0x12'),auth[_0xc481('0xc')](),controller['getAgents']);router['post']('/',auth[_0xc481('0xc')](),controller[_0xc481('0x13')]);router['post'](_0xc481('0x14'),auth['isAuthenticated'](),controller[_0xc481('0x15')]);router['post'](_0xc481('0x12'),auth['isAuthenticated'](),controller[_0xc481('0x16')]);router[_0xc481('0x17')](_0xc481('0xe'),auth[_0xc481('0xc')](),controller[_0xc481('0x18')]);router[_0xc481('0x19')](_0xc481('0xe'),auth[_0xc481('0xc')](),controller[_0xc481('0x1a')]);router[_0xc481('0x19')](_0xc481('0x14'),auth[_0xc481('0xc')](),controller[_0xc481('0x1b')]);router['delete']('/:id/users',auth[_0xc481('0xc')](),controller[_0xc481('0x1c')]);module[_0xc481('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index b000a7c..d3b959e 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 _0x9811=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x5ae4b6,_0x31540b){var _0x26ad27=function(_0x189703){while(--_0x189703){_0x5ae4b6['push'](_0x5ae4b6['shift']());}};_0x26ad27(++_0x31540b);}(_0x9811,0xe9));var _0x1981=function(_0x461d00,_0x8f6f52){_0x461d00=_0x461d00-0x0;var _0x4c3748=_0x9811[_0x461d00];return _0x4c3748;};'use strict';var Sequelize=require(_0x1981('0x0'));module[_0x1981('0x1')]={'name':{'type':Sequelize[_0x1981('0x2')],'unique':_0x1981('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1981('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1981('0x4')](_0x1981('0x5'),_0x1981('0x6'),_0x1981('0x7'))}}; \ No newline at end of file +var _0xab40=['exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xab40,0x167));var _0x0ab4=function(_0x3f8557,_0x1b8bd9){_0x3f8557=_0x3f8557-0x0;var _0x5a8534=_0xab40[_0x3f8557];return _0x5a8534;};'use strict';var Sequelize=require(_0x0ab4('0x0'));module[_0x0ab4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0ab4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0ab4('0x3')]},'timeout':{'type':Sequelize[_0x0ab4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0ab4('0x5'),_0x0ab4('0x6'),_0x0ab4('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 692427f..9d2d685 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 _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(_0x364cf8,_0x146b9b){var _0x6a59ee=function(_0x3d81eb){while(--_0x3d81eb){_0x364cf8['push'](_0x364cf8['shift']());}};_0x6a59ee(++_0x146b9b);}(_0xadb5,0xad));var _0x5adb=function(_0x44a633,_0x27f51f){_0x44a633=_0x44a633-0x0;var _0x19e8b8=_0xadb5[_0x44a633];return _0x19e8b8;};'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 +var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x197047,_0x4d3f9d){var _0x58fd0a=function(_0x470d2a){while(--_0x470d2a){_0x197047['push'](_0x197047['shift']());}};_0x58fd0a(++_0x4d3f9d);}(_0x7a54,0x106));var _0x47a5=function(_0x20ad93,_0x5587ae){_0x20ad93=_0x20ad93-0x0;var _0x52bf60=_0x7a54[_0x20ad93];return _0x52bf60;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 175bb32..6ceab7d 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 _0x3e2e=['hasOwnProperty','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x45d2f7,_0x521546){var _0x4c2cc3=function(_0x216ebb){while(--_0x216ebb){_0x45d2f7['push'](_0x45d2f7['shift']());}};_0x4c2cc3(++_0x521546);}(_0x3e2e,0xda));var _0xe3e2=function(_0x49fab2,_0x556a7d){_0x49fab2=_0x49fab2-0x0;var _0x586d2e=_0x3e2e[_0x49fab2];return _0x586d2e;};'use strict';var EventEmitter=require(_0xe3e2('0x0'));var SmsQueue=require(_0xe3e2('0x1'))['db'][_0xe3e2('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe3e2('0x3')](0x0);var events={'afterCreate':_0xe3e2('0x4'),'afterUpdate':_0xe3e2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x55a093){return function(_0x57aea0,_0xa9d3bb,_0x3d588e){SmsQueueEvents['emit'](_0x55a093+':'+_0x57aea0['id'],_0x57aea0);SmsQueueEvents['emit'](_0x55a093,_0x57aea0);_0x3d588e(null);};}for(var e in events){if(events[_0xe3e2('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xe3e2('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x7c8c=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x112e44,_0x209d45){var _0x2b849d=function(_0x5050db){while(--_0x5050db){_0x112e44['push'](_0x112e44['shift']());}};_0x2b849d(++_0x209d45);}(_0x7c8c,0x16d));var _0xc7c8=function(_0xe6746a,_0x4a0320){_0xe6746a=_0xe6746a-0x0;var _0x5b7b13=_0x7c8c[_0xe6746a];return _0x5b7b13;};'use strict';var EventEmitter=require(_0xc7c8('0x0'));var SmsQueue=require(_0xc7c8('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc7c8('0x2')](0x0);var events={'afterCreate':_0xc7c8('0x3'),'afterUpdate':_0xc7c8('0x4'),'afterDestroy':_0xc7c8('0x5')};function emitEvent(_0x2455cf){return function(_0x5ab593,_0x109c9a,_0x4360bc){SmsQueueEvents['emit'](_0x2455cf+':'+_0x5ab593['id'],_0x5ab593);SmsQueueEvents[_0xc7c8('0x6')](_0x2455cf,_0x5ab593);_0x4360bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xc7c8('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b60cd64..659a24f 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 _0xc990=['bluebird','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','../../config/logger','api','moment'];(function(_0x23dd3b,_0x4ad27c){var _0x5aeb91=function(_0x59b3a6){while(--_0x59b3a6){_0x23dd3b['push'](_0x23dd3b['shift']());}};_0x5aeb91(++_0x4ad27c);}(_0xc990,0x151));var _0x0c99=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xc990[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0x0c99('0x0'));var util=require('util');var logger=require(_0x0c99('0x1'))(_0x0c99('0x2'));var moment=require(_0x0c99('0x3'));var BPromise=require(_0x0c99('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c99('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c99('0x6'));module[_0x0c99('0x7')]=function(_0x53bead,_0x1ab620){return _0x53bead[_0x0c99('0x8')](_0x0c99('0x9'),attributes,{'tableName':_0x0c99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2277=['sms_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x618bc2,_0x57686f){var _0x2fbb1e=function(_0x13c21b){while(--_0x13c21b){_0x618bc2['push'](_0x618bc2['shift']());}};_0x2fbb1e(++_0x57686f);}(_0x2277,0xde));var _0x7227=function(_0x433d56,_0x123393){_0x433d56=_0x433d56-0x0;var _0x3368f3=_0x2277[_0x433d56];return _0x3368f3;};'use strict';var _=require(_0x7227('0x0'));var util=require(_0x7227('0x1'));var logger=require('../../config/logger')(_0x7227('0x2'));var moment=require(_0x7227('0x3'));var BPromise=require(_0x7227('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7227('0x5'));var rimraf=require(_0x7227('0x6'));var config=require(_0x7227('0x7'));var attributes=require(_0x7227('0x8'));module[_0x7227('0x9')]=function(_0x5f412e,_0x4023b2){return _0x5f412e[_0x7227('0xa')](_0x7227('0xb'),attributes,{'tableName':_0x7227('0xc'),'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 10883c7..47a1385 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 _0x104c=['options','raw','attributes','limit','include','map','then','ShowSmsQueue','find','where','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll'];(function(_0xcb07af,_0x38fed1){var _0x501d64=function(_0x4094a7){while(--_0x4094a7){_0xcb07af['push'](_0xcb07af['shift']());}};_0x501d64(++_0x38fed1);}(_0x104c,0x107));var _0xc104=function(_0x265a9a,_0x5ef035){_0x265a9a=_0x265a9a-0x0;var _0x3134e6=_0x104c[_0x265a9a];return _0x3134e6;};'use strict';var _=require('lodash');var util=require(_0xc104('0x0'));var moment=require(_0xc104('0x1'));var BPromise=require('bluebird');var rs=require(_0xc104('0x2'));var fs=require('fs');var Redis=require(_0xc104('0x3'));var db=require(_0xc104('0x4'))['db'];var utils=require(_0xc104('0x5'));var logger=require(_0xc104('0x6'))(_0xc104('0x7'));var config=require(_0xc104('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc104('0x9')][_0xc104('0xa')]({'port':0x232a});config['redis']=_[_0xc104('0xb')](config[_0xc104('0xc')],{'host':_0xc104('0xd'),'port':0x18eb});var socket=require(_0xc104('0xe'))(new Redis(config[_0xc104('0xc')]));require(_0xc104('0xf'))[_0xc104('0x10')](socket);function respondWithRpcPromise(_0x1f75d8,_0x1a9f5b,_0x173fc6){return new BPromise(function(_0x57eab0,_0x527c04){return client[_0xc104('0x11')](_0x1f75d8,_0x173fc6)['then'](function(_0x36cb9c){logger[_0xc104('0x12')]('SmsQueue,\x20%s,\x20%s',_0x1a9f5b,_0xc104('0x13'));logger[_0xc104('0x14')](_0xc104('0x15'),_0x1a9f5b,_0xc104('0x13'),JSON[_0xc104('0x16')](_0x36cb9c));if(_0x36cb9c[_0xc104('0x17')]){if(_0x36cb9c['error']['code']===0x1f4){logger[_0xc104('0x17')](_0xc104('0x18'),_0x1a9f5b,_0x36cb9c[_0xc104('0x17')][_0xc104('0x19')]);return _0x527c04(_0x36cb9c[_0xc104('0x17')][_0xc104('0x19')]);}logger[_0xc104('0x17')](_0xc104('0x18'),_0x1a9f5b,_0x36cb9c[_0xc104('0x17')][_0xc104('0x19')]);return _0x57eab0(_0x36cb9c['error']['message']);}else{logger[_0xc104('0x12')]('SmsQueue,\x20%s,\x20%s',_0x1a9f5b,_0xc104('0x13'));_0x57eab0(_0x36cb9c[_0xc104('0x1a')][_0xc104('0x19')]);}})[_0xc104('0x1b')](function(_0x30f0d1){logger['error'](_0xc104('0x18'),_0x1a9f5b,_0x30f0d1);_0x527c04(_0x30f0d1);});});}exports[_0xc104('0x1c')]=function(_0x24520b){var _0x45af01=this;return new Promise(function(_0x489127,_0x2e6385){return db[_0xc104('0x1d')][_0xc104('0x1e')]({'raw':_0x24520b[_0xc104('0x1f')]?_0x24520b['options'][_0xc104('0x20')]===undefined?!![]:![]:!![],'where':_0x24520b[_0xc104('0x1f')]?_0x24520b[_0xc104('0x1f')]['where']||null:null,'attributes':_0x24520b['options']?_0x24520b['options'][_0xc104('0x21')]||null:null,'limit':_0x24520b[_0xc104('0x1f')]?_0x24520b['options'][_0xc104('0x22')]||null:null,'include':_0x24520b[_0xc104('0x1f')]?_0x24520b[_0xc104('0x1f')][_0xc104('0x23')]?_['map'](_0x24520b['options'][_0xc104('0x23')],function(_0x2952b7){return{'model':db[_0x2952b7['model']],'as':_0x2952b7['as'],'attributes':_0x2952b7[_0xc104('0x21')],'include':_0x2952b7[_0xc104('0x23')]?_[_0xc104('0x24')](_0x2952b7[_0xc104('0x23')],function(_0x409739){return{'model':db[_0x409739['model']],'as':_0x409739['as'],'attributes':_0x409739[_0xc104('0x21')],'include':_0x409739[_0xc104('0x23')]?_['map'](_0x409739[_0xc104('0x23')],function(_0x10eae2){return{'model':db[_0x10eae2['model']],'as':_0x10eae2['as'],'attributes':_0x10eae2[_0xc104('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc104('0x25')](function(_0x4d3289){logger[_0xc104('0x12')](_0xc104('0x1c'),_0x24520b);logger[_0xc104('0x14')]('GetSmsQueue',_0x24520b,JSON[_0xc104('0x16')](_0x4d3289));_0x489127(_0x4d3289);})[_0xc104('0x1b')](function(_0x273e9a){logger['error'](_0xc104('0x1c'),_0x273e9a[_0xc104('0x19')],_0x24520b);_0x2e6385(_0x45af01[_0xc104('0x17')](0x1f4,_0x273e9a[_0xc104('0x19')]));});});};exports[_0xc104('0x26')]=function(_0x28de19){var _0x224b0b=this;return new Promise(function(_0x229a82,_0x288ca2){return db[_0xc104('0x1d')][_0xc104('0x27')]({'raw':_0x28de19[_0xc104('0x1f')]?_0x28de19[_0xc104('0x1f')][_0xc104('0x20')]===undefined?!![]:![]:!![],'where':_0x28de19['options']?_0x28de19['options'][_0xc104('0x28')]||null:null,'attributes':_0x28de19[_0xc104('0x1f')]?_0x28de19[_0xc104('0x1f')][_0xc104('0x21')]||null:null,'include':_0x28de19['options']?_0x28de19[_0xc104('0x1f')][_0xc104('0x23')]?_[_0xc104('0x24')](_0x28de19['options']['include'],function(_0x3b10d0){return{'model':db[_0x3b10d0[_0xc104('0x29')]],'as':_0x3b10d0['as'],'attributes':_0x3b10d0['attributes'],'include':_0x3b10d0[_0xc104('0x23')]?_[_0xc104('0x24')](_0x3b10d0[_0xc104('0x23')],function(_0xfc1189){return{'model':db[_0xfc1189['model']],'as':_0xfc1189['as'],'attributes':_0xfc1189[_0xc104('0x21')],'include':_0xfc1189['include']?_[_0xc104('0x24')](_0xfc1189[_0xc104('0x23')],function(_0x2281d4){return{'model':db[_0x2281d4['model']],'as':_0x2281d4['as'],'attributes':_0x2281d4[_0xc104('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4164b7){logger['info'](_0xc104('0x26'),_0x28de19);logger[_0xc104('0x14')]('ShowSmsQueue',_0x28de19,JSON[_0xc104('0x16')](_0x4164b7));_0x229a82(_0x4164b7);})['catch'](function(_0x376a93){logger['error']('ShowSmsQueue',_0x376a93[_0xc104('0x19')],_0x28de19);_0x288ca2(_0x224b0b['error'](0x1f4,_0x376a93[_0xc104('0x19')]));});});}; \ No newline at end of file +var _0x8869=['register','request','then','info','SmsQueue,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','map','model','include','debug','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x3ae633,_0x5bd768){var _0x2250c3=function(_0x450c70){while(--_0x450c70){_0x3ae633['push'](_0x3ae633['shift']());}};_0x2250c3(++_0x5bd768);}(_0x8869,0x6f));var _0x9886=function(_0x1d5f74,_0xbd8360){_0x1d5f74=_0x1d5f74-0x0;var _0x303c6a=_0x8869[_0x1d5f74];return _0x303c6a;};'use strict';var _=require(_0x9886('0x0'));var util=require(_0x9886('0x1'));var moment=require(_0x9886('0x2'));var BPromise=require(_0x9886('0x3'));var rs=require(_0x9886('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9886('0x5'))['db'];var utils=require(_0x9886('0x6'));var logger=require(_0x9886('0x7'))(_0x9886('0x8'));var config=require(_0x9886('0x9'));var jayson=require(_0x9886('0xa'));var client=jayson[_0x9886('0xb')][_0x9886('0xc')]({'port':0x232a});config[_0x9886('0xd')]=_[_0x9886('0xe')](config[_0x9886('0xd')],{'host':_0x9886('0xf'),'port':0x18eb});var socket=require(_0x9886('0x10'))(new Redis(config['redis']));require(_0x9886('0x11'))[_0x9886('0x12')](socket);function respondWithRpcPromise(_0x752bd3,_0x181534,_0x469bdb){return new BPromise(function(_0xa6834e,_0x127e05){return client[_0x9886('0x13')](_0x752bd3,_0x469bdb)[_0x9886('0x14')](function(_0x180a01){logger[_0x9886('0x15')](_0x9886('0x16'),_0x181534,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x181534,'request\x20sent',JSON[_0x9886('0x17')](_0x180a01));if(_0x180a01[_0x9886('0x18')]){if(_0x180a01[_0x9886('0x18')][_0x9886('0x19')]===0x1f4){logger[_0x9886('0x18')](_0x9886('0x16'),_0x181534,_0x180a01['error'][_0x9886('0x1a')]);return _0x127e05(_0x180a01[_0x9886('0x18')]['message']);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x181534,_0x180a01['error'][_0x9886('0x1a')]);return _0xa6834e(_0x180a01[_0x9886('0x18')][_0x9886('0x1a')]);}else{logger[_0x9886('0x15')]('SmsQueue,\x20%s,\x20%s',_0x181534,_0x9886('0x1b'));_0xa6834e(_0x180a01[_0x9886('0x1c')][_0x9886('0x1a')]);}})[_0x9886('0x1d')](function(_0x2239da){logger[_0x9886('0x18')](_0x9886('0x16'),_0x181534,_0x2239da);_0x127e05(_0x2239da);});});}exports[_0x9886('0x1e')]=function(_0x51f7cf){var _0x4db9bf=this;return new Promise(function(_0x24c5d3,_0x209cfc){return db[_0x9886('0x1f')][_0x9886('0x20')]({'raw':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf[_0x9886('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf[_0x9886('0x21')][_0x9886('0x22')]||null:null,'attributes':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf['options'][_0x9886('0x23')]||null:null,'limit':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf[_0x9886('0x21')][_0x9886('0x24')]||null:null,'include':_0x51f7cf['options']?_0x51f7cf['options']['include']?_[_0x9886('0x25')](_0x51f7cf[_0x9886('0x21')]['include'],function(_0xa54811){return{'model':db[_0xa54811[_0x9886('0x26')]],'as':_0xa54811['as'],'attributes':_0xa54811[_0x9886('0x23')],'include':_0xa54811[_0x9886('0x27')]?_[_0x9886('0x25')](_0xa54811[_0x9886('0x27')],function(_0x3e7cfe){return{'model':db[_0x3e7cfe[_0x9886('0x26')]],'as':_0x3e7cfe['as'],'attributes':_0x3e7cfe[_0x9886('0x23')],'include':_0x3e7cfe['include']?_[_0x9886('0x25')](_0x3e7cfe[_0x9886('0x27')],function(_0x3a8151){return{'model':db[_0x3a8151['model']],'as':_0x3a8151['as'],'attributes':_0x3a8151['attributes']};}):[]};}):[]};}):[]:[]})[_0x9886('0x14')](function(_0x46fa94){logger['info']('GetSmsQueue',_0x51f7cf);logger[_0x9886('0x28')](_0x9886('0x1e'),_0x51f7cf,JSON[_0x9886('0x17')](_0x46fa94));_0x24c5d3(_0x46fa94);})['catch'](function(_0x181c8e){logger[_0x9886('0x18')](_0x9886('0x1e'),_0x181c8e[_0x9886('0x1a')],_0x51f7cf);_0x209cfc(_0x4db9bf['error'](0x1f4,_0x181c8e['message']));});});};exports[_0x9886('0x29')]=function(_0x435cd7){var _0x269229=this;return new Promise(function(_0x1a7b4d,_0x4f0b08){return db['SmsQueue'][_0x9886('0x2a')]({'raw':_0x435cd7[_0x9886('0x21')]?_0x435cd7[_0x9886('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x435cd7[_0x9886('0x21')]?_0x435cd7['options']['where']||null:null,'attributes':_0x435cd7[_0x9886('0x21')]?_0x435cd7[_0x9886('0x21')][_0x9886('0x23')]||null:null,'include':_0x435cd7['options']?_0x435cd7[_0x9886('0x21')][_0x9886('0x27')]?_['map'](_0x435cd7[_0x9886('0x21')][_0x9886('0x27')],function(_0x3185e9){return{'model':db[_0x3185e9[_0x9886('0x26')]],'as':_0x3185e9['as'],'attributes':_0x3185e9['attributes'],'include':_0x3185e9[_0x9886('0x27')]?_['map'](_0x3185e9[_0x9886('0x27')],function(_0x204796){return{'model':db[_0x204796[_0x9886('0x26')]],'as':_0x204796['as'],'attributes':_0x204796[_0x9886('0x23')],'include':_0x204796[_0x9886('0x27')]?_['map'](_0x204796[_0x9886('0x27')],function(_0x26b742){return{'model':db[_0x26b742['model']],'as':_0x26b742['as'],'attributes':_0x26b742[_0x9886('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9886('0x14')](function(_0x535a33){logger['info'](_0x9886('0x29'),_0x435cd7);logger[_0x9886('0x28')](_0x9886('0x29'),_0x435cd7,JSON[_0x9886('0x17')](_0x535a33));_0x1a7b4d(_0x535a33);})[_0x9886('0x1d')](function(_0x42d6a1){logger[_0x9886('0x18')](_0x9886('0x29'),_0x42d6a1[_0x9886('0x1a')],_0x435cd7);_0x4f0b08(_0x269229[_0x9886('0x18')](0x1f4,_0x42d6a1[_0x9886('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d63df9b..44f5786 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 _0x97db=['emit','removeListener','length','smsQueue:','./smsQueue.events','save','update'];(function(_0x18aa94,_0x1a2753){var _0x4facea=function(_0x5a0bfc){while(--_0x5a0bfc){_0x18aa94['push'](_0x18aa94['shift']());}};_0x4facea(++_0x1a2753);}(_0x97db,0xa5));var _0xb97d=function(_0x52805a,_0x20bf0f){_0x52805a=_0x52805a-0x0;var _0xe1ca55=_0x97db[_0x52805a];return _0xe1ca55;};'use strict';var SmsQueueEvents=require(_0xb97d('0x0'));var events=[_0xb97d('0x1'),'remove',_0xb97d('0x2')];function createListener(_0x575ac3,_0x35afaf){return function(_0x54c69d){_0x35afaf[_0xb97d('0x3')](_0x575ac3,_0x54c69d);};}function removeListener(_0x254441,_0x5c408d){return function(){SmsQueueEvents[_0xb97d('0x4')](_0x254441,_0x5c408d);};}exports['register']=function(_0x3315a5){for(var _0x3a93d5=0x0,_0x30315d=events[_0xb97d('0x5')];_0x3a93d5<_0x30315d;_0x3a93d5++){var _0x516750=events[_0x3a93d5];var _0x2939ab=createListener(_0xb97d('0x6')+_0x516750,_0x3315a5);SmsQueueEvents['on'](_0x516750,_0x2939ab);}}; \ No newline at end of file +var _0x291d=['remove','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x33a581,_0x76ad5f){var _0x2ecd7f=function(_0x2a9f8f){while(--_0x2a9f8f){_0x33a581['push'](_0x33a581['shift']());}};_0x2ecd7f(++_0x76ad5f);}(_0x291d,0x139));var _0xd291=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x291d[_0x2dea24];return _0x309d58;};'use strict';var SmsQueueEvents=require(_0xd291('0x0'));var events=[_0xd291('0x1'),_0xd291('0x2'),'update'];function createListener(_0x1eb772,_0x364cac){return function(_0x468c18){_0x364cac['emit'](_0x1eb772,_0x468c18);};}function removeListener(_0x35e065,_0x125c45){return function(){SmsQueueEvents[_0xd291('0x3')](_0x35e065,_0x125c45);};}exports[_0xd291('0x4')]=function(_0x5df33f){for(var _0x5abfb8=0x0,_0xc383aa=events[_0xd291('0x5')];_0x5abfb8<_0xc383aa;_0x5abfb8++){var _0x47baee=events[_0x5abfb8];var _0x32fdc9=createListener(_0xd291('0x6')+_0x47baee,_0x5df33f);SmsQueueEvents['on'](_0x47baee,_0x32fdc9);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 38b5205..97f20f4 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 _0xf5dc=['isAuthenticated','index','/describe','describe','post','/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x46e523,_0xe6fccb){var _0x5da0ee=function(_0x396682){while(--_0x396682){_0x46e523['push'](_0x46e523['shift']());}};_0x5da0ee(++_0xe6fccb);}(_0xf5dc,0x117));var _0xcf5d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf5dc[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcf5d('0x0'));var timeout=require(_0xcf5d('0x1'));var express=require('express');var router=express[_0xcf5d('0x2')]();var fs_extra=require(_0xcf5d('0x3'));var auth=require(_0xcf5d('0x4'));var interaction=require(_0xcf5d('0x5'));var config=require(_0xcf5d('0x6'));var controller=require(_0xcf5d('0x7'));router[_0xcf5d('0x8')]('/',auth[_0xcf5d('0x9')](),controller[_0xcf5d('0xa')]);router[_0xcf5d('0x8')](_0xcf5d('0xb'),auth[_0xcf5d('0x9')](),controller[_0xcf5d('0xc')]);router[_0xcf5d('0x8')]('/:id',auth[_0xcf5d('0x9')](),controller['show']);router[_0xcf5d('0xd')]('/',auth[_0xcf5d('0x9')](),controller['create']);router['put'](_0xcf5d('0xe'),auth[_0xcf5d('0x9')](),controller[_0xcf5d('0xf')]);router['delete'](_0xcf5d('0xe'),auth[_0xcf5d('0x9')](),controller[_0xcf5d('0x10')]);module[_0xcf5d('0x11')]=router; \ No newline at end of file +var _0xeb1c=['index','get','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xeb1c,0x185));var _0xceb1=function(_0x462586,_0x1b28ee){_0x462586=_0x462586-0x0;var _0x99fc57=_0xeb1c[_0x462586];return _0x99fc57;};'use strict';var multer=require(_0xceb1('0x0'));var util=require(_0xceb1('0x1'));var path=require(_0xceb1('0x2'));var timeout=require('connect-timeout');var express=require(_0xceb1('0x3'));var router=express['Router']();var fs_extra=require(_0xceb1('0x4'));var auth=require(_0xceb1('0x5'));var interaction=require(_0xceb1('0x6'));var config=require(_0xceb1('0x7'));var controller=require(_0xceb1('0x8'));router['get']('/',auth[_0xceb1('0x9')](),controller[_0xceb1('0xa')]);router[_0xceb1('0xb')](_0xceb1('0xc'),auth[_0xceb1('0x9')](),controller[_0xceb1('0xd')]);router[_0xceb1('0xb')]('/:id',auth[_0xceb1('0x9')](),controller[_0xceb1('0xe')]);router[_0xceb1('0xf')]('/',auth[_0xceb1('0x9')](),controller['create']);router[_0xceb1('0x10')](_0xceb1('0x11'),auth[_0xceb1('0x9')](),controller[_0xceb1('0x12')]);router[_0xceb1('0x13')](_0xceb1('0x11'),auth[_0xceb1('0x9')](),controller[_0xceb1('0x14')]);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 82b06ef..f1c480e 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 _0x7e95=['moment','sequelize','exports','STRING','DATE'];(function(_0x400beb,_0x5a2d86){var _0x295317=function(_0x3626c6){while(--_0x3626c6){_0x400beb['push'](_0x400beb['shift']());}};_0x295317(++_0x5a2d86);}(_0x7e95,0x1d6));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x57e9('0x0'));var Sequelize=require(_0x57e9('0x1'));module[_0x57e9('0x2')]={'uniqueid':{'type':Sequelize[_0x57e9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x57e9('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x57e9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x57e9('0x3')]}}; \ No newline at end of file +var _0xb096=['STRING','DATE','moment','sequelize','exports'];(function(_0x8c2e66,_0xf79589){var _0x31492f=function(_0xfe56f){while(--_0xfe56f){_0x8c2e66['push'](_0x8c2e66['shift']());}};_0x31492f(++_0xf79589);}(_0xb096,0x156));var _0x6b09=function(_0x5a8915,_0x137df8){_0x5a8915=_0x5a8915-0x0;var _0x2e1151=_0xb096[_0x5a8915];return _0x2e1151;};'use strict';var moment=require(_0x6b09('0x0'));var Sequelize=require(_0x6b09('0x1'));module[_0x6b09('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6b09('0x3')]},'joinAt':{'type':Sequelize[_0x6b09('0x4')]},'leaveAt':{'type':Sequelize[_0x6b09('0x4')]},'acceptAt':{'type':Sequelize[_0x6b09('0x4')]},'exitAt':{'type':Sequelize[_0x6b09('0x4')]},'reason':{'type':Sequelize[_0x6b09('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 65fd5b1..935d49e 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 _0xb3a0=['../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','fields','length','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x32d553,_0x12f5e8){var _0x1707a4=function(_0x13f463){while(--_0x13f463){_0x32d553['push'](_0x32d553['shift']());}};_0x1707a4(++_0x12f5e8);}(_0xb3a0,0xc2));var _0x0b3a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb3a0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b3a('0x0'));var zipdir=require(_0x0b3a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b3a('0x2'));var moment=require('moment');var BPromise=require(_0x0b3a('0x3'));var Mustache=require(_0x0b3a('0x4'));var util=require(_0x0b3a('0x5'));var path=require(_0x0b3a('0x6'));var sox=require(_0x0b3a('0x7'));var csv=require('to-csv');var ejs=require(_0x0b3a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b3a('0x9'));var squel=require('squel');var crypto=require(_0x0b3a('0xa'));var jsforce=require(_0x0b3a('0xb'));var deskjs=require(_0x0b3a('0xc'));var toCsv=require(_0x0b3a('0xd'));var querystring=require(_0x0b3a('0xe'));var Papa=require(_0x0b3a('0xf'));var Redis=require('ioredis');var authService=require(_0x0b3a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0b3a('0x11'));var hardwareService=require(_0x0b3a('0x12'));var logger=require(_0x0b3a('0x13'))(_0x0b3a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b3a('0x15'));var db=require(_0x0b3a('0x16'))['db'];function respondWithStatusCode(_0x1ff75b,_0x4de856){_0x4de856=_0x4de856||0xcc;return function(_0x5e48de){if(_0x5e48de){return _0x1ff75b[_0x0b3a('0x17')](_0x4de856);}return _0x1ff75b['status'](_0x4de856)[_0x0b3a('0x18')]();};}function respondWithResult(_0x69e9da,_0x225ed1){_0x225ed1=_0x225ed1||0xc8;return function(_0x2c142a){if(_0x2c142a){return _0x69e9da[_0x0b3a('0x19')](_0x225ed1)[_0x0b3a('0x1a')](_0x2c142a);}};}function respondWithFilteredResult(_0x12e15a,_0x397943){return function(_0x1ac571){if(_0x1ac571){var _0x2ccd87=typeof _0x397943[_0x0b3a('0x1b')]==='undefined'&&typeof _0x397943['limit']===_0x0b3a('0x1c');var _0x5155b1=_0x1ac571[_0x0b3a('0x1d')];var _0x57094e=_0x2ccd87?0x0:_0x397943['offset'];var _0xdd7bb2=_0x2ccd87?_0x1ac571[_0x0b3a('0x1d')]:_0x397943[_0x0b3a('0x1b')]+_0x397943[_0x0b3a('0x1e')];var _0x6bd6ce;if(_0xdd7bb2>=_0x5155b1){_0xdd7bb2=_0x5155b1;_0x6bd6ce=0xc8;}else{_0x6bd6ce=0xce;}_0x12e15a['status'](_0x6bd6ce);return _0x12e15a[_0x0b3a('0x1f')]('Content-Range',_0x57094e+'-'+_0xdd7bb2+'/'+_0x5155b1)[_0x0b3a('0x1a')](_0x1ac571);}return null;};}function patchUpdates(_0x2a6265){return function(_0xa54f8f){try{jsonpatch[_0x0b3a('0x20')](_0xa54f8f,_0x2a6265,!![]);}catch(_0x18ee94){return BPromise['reject'](_0x18ee94);}return _0xa54f8f[_0x0b3a('0x21')]();};}function saveUpdates(_0x31c446,_0x1e11a9){return function(_0x40b5ab){if(_0x40b5ab){return _0x40b5ab[_0x0b3a('0x22')](_0x31c446)[_0x0b3a('0x23')](function(_0x34c058){return _0x34c058;});}return null;};}function removeEntity(_0x513bed,_0x4ae29f){return function(_0x3f2b7e){if(_0x3f2b7e){return _0x3f2b7e['destroy']()[_0x0b3a('0x23')](function(){_0x513bed[_0x0b3a('0x19')](0xcc)[_0x0b3a('0x18')]();});}};}function handleEntityNotFound(_0x13e311,_0x2d73ea){return function(_0x431e93){if(!_0x431e93){_0x13e311[_0x0b3a('0x17')](0x194);}return _0x431e93;};}function handleError(_0x22b3f5,_0x3b7aa1){_0x3b7aa1=_0x3b7aa1||0x1f4;return function(_0x30936d){logger[_0x0b3a('0x24')](_0x30936d['stack']);if(_0x30936d['name']){delete _0x30936d['name'];}_0x22b3f5[_0x0b3a('0x19')](_0x3b7aa1)[_0x0b3a('0x25')](_0x30936d);};}exports[_0x0b3a('0x26')]=function(_0x4c4882,_0x463114){var _0x8e3277={},_0x478f65={},_0x4b2225={'count':0x0,'rows':[]};var _0x473b2e=_[_0x0b3a('0x27')](db[_0x0b3a('0x28')][_0x0b3a('0x29')],function(_0x186cf2){return{'name':_0x186cf2[_0x0b3a('0x2a')],'type':_0x186cf2[_0x0b3a('0x2b')]['key']};});_0x478f65['model']=_[_0x0b3a('0x27')](_0x473b2e,_0x0b3a('0x2c'));_0x478f65[_0x0b3a('0x2d')]=_[_0x0b3a('0x2e')](_0x4c4882[_0x0b3a('0x2d')]);_0x478f65[_0x0b3a('0x2f')]=_[_0x0b3a('0x30')](_0x478f65['model'],_0x478f65[_0x0b3a('0x2d')]);_0x8e3277['attributes']=_['intersection'](_0x478f65[_0x0b3a('0x31')],qs['fields'](_0x4c4882[_0x0b3a('0x2d')]['fields']));_0x8e3277['attributes']=_0x8e3277['attributes']['length']?_0x8e3277[_0x0b3a('0x32')]:_0x478f65['model'];if(!_0x4c4882['query'][_0x0b3a('0x33')](_0x0b3a('0x34'))){_0x8e3277[_0x0b3a('0x1e')]=qs[_0x0b3a('0x1e')](_0x4c4882['query'][_0x0b3a('0x1e')]);_0x8e3277[_0x0b3a('0x1b')]=qs[_0x0b3a('0x1b')](_0x4c4882[_0x0b3a('0x2d')][_0x0b3a('0x1b')]);}_0x8e3277['order']=qs[_0x0b3a('0x35')](_0x4c4882[_0x0b3a('0x2d')]['sort']);_0x8e3277[_0x0b3a('0x36')]=qs['filters'](_[_0x0b3a('0x37')](_0x4c4882[_0x0b3a('0x2d')],_0x478f65[_0x0b3a('0x2f')]),_0x473b2e);if(_0x4c4882[_0x0b3a('0x2d')][_0x0b3a('0x38')]){_0x8e3277[_0x0b3a('0x36')]=_[_0x0b3a('0x39')](_0x8e3277[_0x0b3a('0x36')],{'$or':_[_0x0b3a('0x27')](_0x473b2e,function(_0x2537c5){if(_0x2537c5[_0x0b3a('0x2b')]!=='VIRTUAL'){var _0x142c0c={};_0x142c0c[_0x2537c5['name']]={'$like':'%'+_0x4c4882['query']['filter']+'%'};return _0x142c0c;}})});}_0x8e3277=_['merge']({},_0x8e3277,_0x4c4882[_0x0b3a('0x3a')]);var _0x710037={'where':_0x8e3277[_0x0b3a('0x36')]};return db['SmsQueueReport'][_0x0b3a('0x1d')](_0x710037)[_0x0b3a('0x23')](function(_0x3016df){_0x4b2225[_0x0b3a('0x1d')]=_0x3016df;if(_0x4c4882[_0x0b3a('0x2d')][_0x0b3a('0x3b')]){_0x8e3277[_0x0b3a('0x3c')]=[{'all':!![]}];}return db[_0x0b3a('0x28')]['findAll'](_0x8e3277);})[_0x0b3a('0x23')](function(_0x5e9ac1){_0x4b2225[_0x0b3a('0x3d')]=_0x5e9ac1;return _0x4b2225;})['then'](respondWithFilteredResult(_0x463114,_0x8e3277))[_0x0b3a('0x3e')](handleError(_0x463114,null));};exports['show']=function(_0x3c618a,_0x4b50b4){var _0x4ea03c={'raw':!![],'where':{'id':_0x3c618a[_0x0b3a('0x3f')]['id']}},_0x24ed4d={};_0x24ed4d[_0x0b3a('0x31')]=_[_0x0b3a('0x2e')](db[_0x0b3a('0x28')]['rawAttributes']);_0x24ed4d['query']=_['keys'](_0x3c618a[_0x0b3a('0x2d')]);_0x24ed4d[_0x0b3a('0x2f')]=_['intersection'](_0x24ed4d['model'],_0x24ed4d[_0x0b3a('0x2d')]);_0x4ea03c[_0x0b3a('0x32')]=_[_0x0b3a('0x30')](_0x24ed4d[_0x0b3a('0x31')],qs[_0x0b3a('0x40')](_0x3c618a[_0x0b3a('0x2d')][_0x0b3a('0x40')]));_0x4ea03c['attributes']=_0x4ea03c[_0x0b3a('0x32')][_0x0b3a('0x41')]?_0x4ea03c[_0x0b3a('0x32')]:_0x24ed4d[_0x0b3a('0x31')];if(_0x3c618a[_0x0b3a('0x2d')][_0x0b3a('0x3b')]){_0x4ea03c[_0x0b3a('0x3c')]=[{'all':!![]}];}_0x4ea03c=_['merge']({},_0x4ea03c,_0x3c618a['options']);return db[_0x0b3a('0x28')][_0x0b3a('0x42')](_0x4ea03c)[_0x0b3a('0x23')](handleEntityNotFound(_0x4b50b4,null))['then'](respondWithResult(_0x4b50b4,null))[_0x0b3a('0x3e')](handleError(_0x4b50b4,null));};exports[_0x0b3a('0x43')]=function(_0x299249,_0x4334a2){return db[_0x0b3a('0x28')][_0x0b3a('0x43')](_0x299249[_0x0b3a('0x44')],{})['then'](respondWithResult(_0x4334a2,0xc9))[_0x0b3a('0x3e')](handleError(_0x4334a2,null));};exports['update']=function(_0x1f0af6,_0x1a6c69){if(_0x1f0af6[_0x0b3a('0x44')]['id']){delete _0x1f0af6['body']['id'];}return db[_0x0b3a('0x28')][_0x0b3a('0x42')]({'where':{'id':_0x1f0af6[_0x0b3a('0x3f')]['id']}})[_0x0b3a('0x23')](handleEntityNotFound(_0x1a6c69,null))[_0x0b3a('0x23')](saveUpdates(_0x1f0af6[_0x0b3a('0x44')],null))[_0x0b3a('0x23')](respondWithResult(_0x1a6c69,null))[_0x0b3a('0x3e')](handleError(_0x1a6c69,null));};exports[_0x0b3a('0x45')]=function(_0x5091c3,_0x148e2c){return db[_0x0b3a('0x28')][_0x0b3a('0x42')]({'where':{'id':_0x5091c3[_0x0b3a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x148e2c,null))[_0x0b3a('0x23')](removeEntity(_0x148e2c,null))[_0x0b3a('0x3e')](handleError(_0x148e2c,null));};exports[_0x0b3a('0x46')]=function(_0x384d55,_0x583604){return db['SmsQueueReport']['describe']()[_0x0b3a('0x23')](respondWithResult(_0x583604,null))[_0x0b3a('0x3e')](handleError(_0x583604,null));}; \ No newline at end of file +var _0x213b=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','params','include','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch'];(function(_0x96d000,_0x1830c3){var _0xc96352=function(_0x525197){while(--_0x525197){_0x96d000['push'](_0x96d000['shift']());}};_0xc96352(++_0x1830c3);}(_0x213b,0xcc));var _0xb213=function(_0x479ff1,_0xa3fcd2){_0x479ff1=_0x479ff1-0x0;var _0x502089=_0x213b[_0x479ff1];return _0x502089;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb213('0x0'));var zipdir=require(_0xb213('0x1'));var jsonpatch=require(_0xb213('0x2'));var rp=require(_0xb213('0x3'));var moment=require(_0xb213('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb213('0x5'));var util=require(_0xb213('0x6'));var path=require(_0xb213('0x7'));var sox=require('sox');var csv=require(_0xb213('0x8'));var ejs=require(_0xb213('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb213('0xa'));var squel=require(_0xb213('0xb'));var crypto=require(_0xb213('0xc'));var jsforce=require(_0xb213('0xd'));var deskjs=require(_0xb213('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb213('0xf'));var Papa=require('papaparse');var Redis=require(_0xb213('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb213('0x11'));var hardwareService=require(_0xb213('0x12'));var logger=require('../../config/logger')(_0xb213('0x13'));var utils=require(_0xb213('0x14'));var config=require(_0xb213('0x15'));var licenseUtil=require(_0xb213('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102513,_0x483bf3){_0x483bf3=_0x483bf3||0xcc;return function(_0x2f0198){if(_0x2f0198){return _0x102513[_0xb213('0x17')](_0x483bf3);}return _0x102513[_0xb213('0x18')](_0x483bf3)[_0xb213('0x19')]();};}function respondWithResult(_0x3f76d8,_0x3db055){_0x3db055=_0x3db055||0xc8;return function(_0x577cfe){if(_0x577cfe){return _0x3f76d8['status'](_0x3db055)[_0xb213('0x1a')](_0x577cfe);}};}function respondWithFilteredResult(_0x4dcc86,_0x52510b){return function(_0x7ad317){if(_0x7ad317){var _0x162180=typeof _0x52510b['offset']===_0xb213('0x1b')&&typeof _0x52510b[_0xb213('0x1c')]==='undefined';var _0x145a07=_0x7ad317[_0xb213('0x1d')];var _0x4a1000=_0x162180?0x0:_0x52510b['offset'];var _0x321570=_0x162180?_0x7ad317[_0xb213('0x1d')]:_0x52510b['offset']+_0x52510b[_0xb213('0x1c')];var _0x1cd532;if(_0x321570>=_0x145a07){_0x321570=_0x145a07;_0x1cd532=0xc8;}else{_0x1cd532=0xce;}_0x4dcc86[_0xb213('0x18')](_0x1cd532);return _0x4dcc86['set'](_0xb213('0x1e'),_0x4a1000+'-'+_0x321570+'/'+_0x145a07)[_0xb213('0x1a')](_0x7ad317);}return null;};}function patchUpdates(_0x4e3f5d){return function(_0x5ba1b6){try{jsonpatch[_0xb213('0x1f')](_0x5ba1b6,_0x4e3f5d,!![]);}catch(_0x10c1b5){return BPromise[_0xb213('0x20')](_0x10c1b5);}return _0x5ba1b6[_0xb213('0x21')]();};}function saveUpdates(_0x433418,_0x49c9e9){return function(_0x4ef4ce){if(_0x4ef4ce){return _0x4ef4ce[_0xb213('0x22')](_0x433418)[_0xb213('0x23')](function(_0x2739b1){return _0x2739b1;});}return null;};}function removeEntity(_0x1779cc,_0x12ac2a){return function(_0x5dd73f){if(_0x5dd73f){return _0x5dd73f[_0xb213('0x24')]()[_0xb213('0x23')](function(){_0x1779cc['status'](0xcc)[_0xb213('0x19')]();});}};}function handleEntityNotFound(_0x38b46d,_0x2d2092){return function(_0x182d2c){if(!_0x182d2c){_0x38b46d[_0xb213('0x17')](0x194);}return _0x182d2c;};}function handleError(_0x40579e,_0x11f9ba){_0x11f9ba=_0x11f9ba||0x1f4;return function(_0x28eb88){logger[_0xb213('0x25')](_0x28eb88[_0xb213('0x26')]);if(_0x28eb88[_0xb213('0x27')]){delete _0x28eb88[_0xb213('0x27')];}_0x40579e[_0xb213('0x18')](_0x11f9ba)[_0xb213('0x28')](_0x28eb88);};}exports[_0xb213('0x29')]=function(_0x1c36aa,_0x156e37){var _0x5028b0={},_0x30257d={},_0x4517a2={'count':0x0,'rows':[]};var _0x554186=_[_0xb213('0x2a')](db[_0xb213('0x2b')]['rawAttributes'],function(_0x286d05){return{'name':_0x286d05[_0xb213('0x2c')],'type':_0x286d05[_0xb213('0x2d')][_0xb213('0x2e')]};});_0x30257d[_0xb213('0x2f')]=_[_0xb213('0x2a')](_0x554186,'name');_0x30257d['query']=_[_0xb213('0x30')](_0x1c36aa[_0xb213('0x31')]);_0x30257d[_0xb213('0x32')]=_[_0xb213('0x33')](_0x30257d[_0xb213('0x2f')],_0x30257d[_0xb213('0x31')]);_0x5028b0[_0xb213('0x34')]=_[_0xb213('0x33')](_0x30257d[_0xb213('0x2f')],qs['fields'](_0x1c36aa[_0xb213('0x31')][_0xb213('0x35')]));_0x5028b0['attributes']=_0x5028b0[_0xb213('0x34')][_0xb213('0x36')]?_0x5028b0['attributes']:_0x30257d[_0xb213('0x2f')];if(!_0x1c36aa[_0xb213('0x31')][_0xb213('0x37')](_0xb213('0x38'))){_0x5028b0['limit']=qs[_0xb213('0x1c')](_0x1c36aa['query'][_0xb213('0x1c')]);_0x5028b0['offset']=qs['offset'](_0x1c36aa[_0xb213('0x31')][_0xb213('0x39')]);}_0x5028b0[_0xb213('0x3a')]=qs[_0xb213('0x3b')](_0x1c36aa['query'][_0xb213('0x3b')]);_0x5028b0[_0xb213('0x3c')]=qs[_0xb213('0x32')](_[_0xb213('0x3d')](_0x1c36aa['query'],_0x30257d[_0xb213('0x32')]),_0x554186);if(_0x1c36aa[_0xb213('0x31')][_0xb213('0x3e')]){_0x5028b0[_0xb213('0x3c')]=_['merge'](_0x5028b0[_0xb213('0x3c')],{'$or':_[_0xb213('0x2a')](_0x554186,function(_0x299708){if(_0x299708[_0xb213('0x2d')]!==_0xb213('0x3f')){var _0x388fce={};_0x388fce[_0x299708['name']]={'$like':'%'+_0x1c36aa[_0xb213('0x31')]['filter']+'%'};return _0x388fce;}})});}_0x5028b0=_[_0xb213('0x40')]({},_0x5028b0,_0x1c36aa[_0xb213('0x41')]);var _0x31cc34={'where':_0x5028b0['where']};return db[_0xb213('0x2b')][_0xb213('0x1d')](_0x31cc34)[_0xb213('0x23')](function(_0x133af4){_0x4517a2['count']=_0x133af4;if(_0x1c36aa[_0xb213('0x31')][_0xb213('0x42')]){_0x5028b0['include']=[{'all':!![]}];}return db[_0xb213('0x2b')]['findAll'](_0x5028b0);})['then'](function(_0x274eb6){_0x4517a2['rows']=_0x274eb6;return _0x4517a2;})[_0xb213('0x23')](respondWithFilteredResult(_0x156e37,_0x5028b0))['catch'](handleError(_0x156e37,null));};exports['show']=function(_0x151b57,_0x4e54bc){var _0x1ae9f1={'raw':!![],'where':{'id':_0x151b57[_0xb213('0x43')]['id']}},_0x27778c={};_0x27778c[_0xb213('0x2f')]=_[_0xb213('0x30')](db[_0xb213('0x2b')]['rawAttributes']);_0x27778c[_0xb213('0x31')]=_[_0xb213('0x30')](_0x151b57[_0xb213('0x31')]);_0x27778c[_0xb213('0x32')]=_[_0xb213('0x33')](_0x27778c['model'],_0x27778c[_0xb213('0x31')]);_0x1ae9f1[_0xb213('0x34')]=_[_0xb213('0x33')](_0x27778c[_0xb213('0x2f')],qs['fields'](_0x151b57[_0xb213('0x31')]['fields']));_0x1ae9f1[_0xb213('0x34')]=_0x1ae9f1['attributes']['length']?_0x1ae9f1['attributes']:_0x27778c['model'];if(_0x151b57['query'][_0xb213('0x42')]){_0x1ae9f1[_0xb213('0x44')]=[{'all':!![]}];}_0x1ae9f1=_[_0xb213('0x40')]({},_0x1ae9f1,_0x151b57[_0xb213('0x41')]);return db[_0xb213('0x2b')][_0xb213('0x45')](_0x1ae9f1)['then'](handleEntityNotFound(_0x4e54bc,null))['then'](respondWithResult(_0x4e54bc,null))['catch'](handleError(_0x4e54bc,null));};exports[_0xb213('0x46')]=function(_0x130bb8,_0x12cc21){return db[_0xb213('0x2b')][_0xb213('0x46')](_0x130bb8[_0xb213('0x47')],{})[_0xb213('0x23')](respondWithResult(_0x12cc21,0xc9))[_0xb213('0x48')](handleError(_0x12cc21,null));};exports['update']=function(_0x254e7a,_0x505949){if(_0x254e7a[_0xb213('0x47')]['id']){delete _0x254e7a['body']['id'];}return db['SmsQueueReport'][_0xb213('0x45')]({'where':{'id':_0x254e7a[_0xb213('0x43')]['id']}})[_0xb213('0x23')](handleEntityNotFound(_0x505949,null))['then'](saveUpdates(_0x254e7a[_0xb213('0x47')],null))[_0xb213('0x23')](respondWithResult(_0x505949,null))[_0xb213('0x48')](handleError(_0x505949,null));};exports['destroy']=function(_0xb7b3b4,_0x2729f1){return db[_0xb213('0x2b')][_0xb213('0x45')]({'where':{'id':_0xb7b3b4[_0xb213('0x43')]['id']}})[_0xb213('0x23')](handleEntityNotFound(_0x2729f1,null))[_0xb213('0x23')](removeEntity(_0x2729f1,null))['catch'](handleError(_0x2729f1,null));};exports[_0xb213('0x49')]=function(_0x4bc6b5,_0xddd68a){return db[_0xb213('0x2b')]['describe']()[_0xb213('0x23')](respondWithResult(_0xddd68a,null))[_0xb213('0x48')](handleError(_0xddd68a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index fb9a826..63790d4 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 _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x3042e6,_0x19b95f){var _0x31f6e2=function(_0x3caf3e){while(--_0x3caf3e){_0x3042e6['push'](_0x3042e6['shift']());}};_0x31f6e2(++_0x19b95f);}(_0x70e0,0x17b));var _0x070e=function(_0x39d357,_0x4f59ad){_0x39d357=_0x39d357-0x0;var _0x4aabaa=_0x70e0[_0x39d357];return _0x4aabaa;};'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']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_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 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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 31eb5ec..f674773 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 _0xb4e3=['update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport'];(function(_0x91f542,_0x22e349){var _0x595495=function(_0x2fc3e7){while(--_0x2fc3e7){_0x91f542['push'](_0x91f542['shift']());}};_0x595495(++_0x22e349);}(_0xb4e3,0x98));var _0x3b4e=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xb4e3[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x3b4e('0x0'));var util=require(_0x3b4e('0x1'));var moment=require('moment');var BPromise=require(_0x3b4e('0x2'));var rs=require(_0x3b4e('0x3'));var fs=require('fs');var Redis=require(_0x3b4e('0x4'));var db=require(_0x3b4e('0x5'))['db'];var utils=require(_0x3b4e('0x6'));var logger=require(_0x3b4e('0x7'))(_0x3b4e('0x8'));var config=require(_0x3b4e('0x9'));var jayson=require(_0x3b4e('0xa'));var client=jayson[_0x3b4e('0xb')][_0x3b4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2df915,_0x18b1f8,_0xeaa2ea){return new BPromise(function(_0x9a5f0c,_0x1b19a9){return client[_0x3b4e('0xd')](_0x2df915,_0xeaa2ea)[_0x3b4e('0xe')](function(_0xa3b4b8){logger[_0x3b4e('0xf')](_0x3b4e('0x10'),_0x18b1f8,_0x3b4e('0x11'));logger[_0x3b4e('0x12')](_0x3b4e('0x13'),_0x18b1f8,_0x3b4e('0x11'),JSON[_0x3b4e('0x14')](_0xa3b4b8));if(_0xa3b4b8[_0x3b4e('0x15')]){if(_0xa3b4b8[_0x3b4e('0x15')][_0x3b4e('0x16')]===0x1f4){logger['error'](_0x3b4e('0x10'),_0x18b1f8,_0xa3b4b8[_0x3b4e('0x15')][_0x3b4e('0x17')]);return _0x1b19a9(_0xa3b4b8[_0x3b4e('0x15')][_0x3b4e('0x17')]);}logger['error'](_0x3b4e('0x10'),_0x18b1f8,_0xa3b4b8[_0x3b4e('0x15')]['message']);return _0x9a5f0c(_0xa3b4b8[_0x3b4e('0x15')][_0x3b4e('0x17')]);}else{logger[_0x3b4e('0xf')](_0x3b4e('0x10'),_0x18b1f8,_0x3b4e('0x11'));_0x9a5f0c(_0xa3b4b8[_0x3b4e('0x18')][_0x3b4e('0x17')]);}})[_0x3b4e('0x19')](function(_0x391483){logger[_0x3b4e('0x15')](_0x3b4e('0x10'),_0x18b1f8,_0x391483);_0x1b19a9(_0x391483);});});}exports[_0x3b4e('0x1a')]=function(_0xfbc668){var _0x220c95=this;return new Promise(function(_0x422bef,_0x4f0f4a){return db[_0x3b4e('0x1b')][_0x3b4e('0x1c')](_0xfbc668[_0x3b4e('0x1d')],{'raw':_0xfbc668[_0x3b4e('0x1e')]?_0xfbc668[_0x3b4e('0x1e')][_0x3b4e('0x1f')]===undefined?!![]:![]:!![]})[_0x3b4e('0xe')](function(_0x4245ef){logger[_0x3b4e('0xf')]('CreateSmsQueueReport',_0xfbc668);logger[_0x3b4e('0x12')]('CreateSmsQueueReport',_0xfbc668,JSON['stringify'](_0x4245ef));_0x422bef(_0x4245ef);})['catch'](function(_0x1b91f8){logger[_0x3b4e('0x15')](_0x3b4e('0x1a'),_0x1b91f8[_0x3b4e('0x17')],_0xfbc668);_0x4f0f4a(_0x220c95[_0x3b4e('0x15')](0x1f4,_0x1b91f8[_0x3b4e('0x17')]));});});};exports[_0x3b4e('0x20')]=function(_0x5f0c86){var _0x28a19a=this;return new Promise(function(_0x1875ec,_0x17790d){return db[_0x3b4e('0x1b')][_0x3b4e('0x21')](_0x5f0c86[_0x3b4e('0x1d')],{'raw':_0x5f0c86['options']?_0x5f0c86[_0x3b4e('0x1e')][_0x3b4e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f0c86[_0x3b4e('0x1e')]?_0x5f0c86[_0x3b4e('0x1e')][_0x3b4e('0x22')]||null:null,'attributes':_0x5f0c86[_0x3b4e('0x1e')]?_0x5f0c86[_0x3b4e('0x1e')][_0x3b4e('0x23')]||null:null,'limit':_0x5f0c86[_0x3b4e('0x1e')]?_0x5f0c86['options'][_0x3b4e('0x24')]||null:null})['then'](function(_0xe30c87){logger[_0x3b4e('0xf')](_0x3b4e('0x20'),_0x5f0c86);logger['debug'](_0x3b4e('0x20'),_0x5f0c86,JSON[_0x3b4e('0x14')](_0xe30c87));_0x1875ec(_0xe30c87);})[_0x3b4e('0x19')](function(_0x3ba472){logger[_0x3b4e('0x15')]('UpdateSmsQueueReport',_0x3ba472[_0x3b4e('0x17')],_0x5f0c86);_0x17790d(_0x28a19a[_0x3b4e('0x15')](0x1f4,_0x3ba472['message']));});});}; \ No newline at end of file +var _0x2e61=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x2e61,0x16b));var _0x12e6=function(_0x38c2a5,_0x2fbbca){_0x38c2a5=_0x38c2a5-0x0;var _0x5a2154=_0x2e61[_0x38c2a5];return _0x5a2154;};'use strict';var _=require(_0x12e6('0x0'));var util=require(_0x12e6('0x1'));var moment=require(_0x12e6('0x2'));var BPromise=require(_0x12e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12e6('0x4'));var db=require(_0x12e6('0x5'))['db'];var utils=require(_0x12e6('0x6'));var logger=require('../../config/logger')(_0x12e6('0x7'));var config=require(_0x12e6('0x8'));var jayson=require(_0x12e6('0x9'));var client=jayson[_0x12e6('0xa')][_0x12e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc6b4,_0x1dbe6f,_0x2bd972){return new BPromise(function(_0x2ff279,_0x1751b5){return client[_0x12e6('0xc')](_0x5bc6b4,_0x2bd972)[_0x12e6('0xd')](function(_0x14ccae){logger[_0x12e6('0xe')](_0x12e6('0xf'),_0x1dbe6f,_0x12e6('0x10'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1dbe6f,_0x12e6('0x10'),JSON[_0x12e6('0x11')](_0x14ccae));if(_0x14ccae[_0x12e6('0x12')]){if(_0x14ccae[_0x12e6('0x12')]['code']===0x1f4){logger['error'](_0x12e6('0xf'),_0x1dbe6f,_0x14ccae['error']['message']);return _0x1751b5(_0x14ccae[_0x12e6('0x12')][_0x12e6('0x13')]);}logger[_0x12e6('0x12')](_0x12e6('0xf'),_0x1dbe6f,_0x14ccae[_0x12e6('0x12')][_0x12e6('0x13')]);return _0x2ff279(_0x14ccae[_0x12e6('0x12')][_0x12e6('0x13')]);}else{logger[_0x12e6('0xe')](_0x12e6('0xf'),_0x1dbe6f,_0x12e6('0x10'));_0x2ff279(_0x14ccae[_0x12e6('0x14')][_0x12e6('0x13')]);}})['catch'](function(_0x51e724){logger[_0x12e6('0x12')](_0x12e6('0xf'),_0x1dbe6f,_0x51e724);_0x1751b5(_0x51e724);});});}exports[_0x12e6('0x15')]=function(_0x83adf6){var _0x2ba061=this;return new Promise(function(_0x17d640,_0x29545d){return db[_0x12e6('0x16')][_0x12e6('0x17')](_0x83adf6[_0x12e6('0x18')],{'raw':_0x83adf6[_0x12e6('0x19')]?_0x83adf6[_0x12e6('0x19')][_0x12e6('0x1a')]===undefined?!![]:![]:!![]})[_0x12e6('0xd')](function(_0x5c4954){logger[_0x12e6('0xe')]('CreateSmsQueueReport',_0x83adf6);logger['debug']('CreateSmsQueueReport',_0x83adf6,JSON[_0x12e6('0x11')](_0x5c4954));_0x17d640(_0x5c4954);})[_0x12e6('0x1b')](function(_0x4f04d2){logger[_0x12e6('0x12')](_0x12e6('0x15'),_0x4f04d2['message'],_0x83adf6);_0x29545d(_0x2ba061[_0x12e6('0x12')](0x1f4,_0x4f04d2['message']));});});};exports[_0x12e6('0x1c')]=function(_0x45147d){var _0xa1bc9b=this;return new Promise(function(_0x185200,_0x17ef3c){return db[_0x12e6('0x16')][_0x12e6('0x1d')](_0x45147d[_0x12e6('0x18')],{'raw':_0x45147d[_0x12e6('0x19')]?_0x45147d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45147d[_0x12e6('0x19')]?_0x45147d[_0x12e6('0x19')][_0x12e6('0x1e')]||null:null,'attributes':_0x45147d[_0x12e6('0x19')]?_0x45147d['options'][_0x12e6('0x1f')]||null:null,'limit':_0x45147d[_0x12e6('0x19')]?_0x45147d['options'][_0x12e6('0x20')]||null:null})[_0x12e6('0xd')](function(_0x2bb641){logger['info'](_0x12e6('0x1c'),_0x45147d);logger[_0x12e6('0x21')](_0x12e6('0x1c'),_0x45147d,JSON[_0x12e6('0x11')](_0x2bb641));_0x185200(_0x2bb641);})[_0x12e6('0x1b')](function(_0x21fe58){logger[_0x12e6('0x12')](_0x12e6('0x1c'),_0x21fe58[_0x12e6('0x13')],_0x45147d);_0x17ef3c(_0xa1bc9b['error'](0x1f4,_0x21fe58[_0x12e6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index db7b14b..ab8538e 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 _0x2d17=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','update','delete'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x2d17,0x17e));var _0x72d1=function(_0x411043,_0x222632){_0x411043=_0x411043-0x0;var _0x3cb9c8=_0x2d17[_0x411043];return _0x3cb9c8;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./smsTransferReport.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/describe',auth[_0x72d1('0x9')](),controller[_0x72d1('0xa')]);router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x9')](),controller[_0x72d1('0xb')]);router[_0x72d1('0xc')]('/',auth['isAuthenticated'](),controller[_0x72d1('0xd')]);router[_0x72d1('0xe')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x11')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x12')]);module[_0x72d1('0x13')]=router; \ No newline at end of file +var _0xfd87=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x3729dc,_0x2573c7){var _0x4a2ebd=function(_0x835d93){while(--_0x835d93){_0x3729dc['push'](_0x3729dc['shift']());}};_0x4a2ebd(++_0x2573c7);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')](_0x7fd8('0x10'),auth['isAuthenticated'](),controller[_0x7fd8('0x11')]);router[_0x7fd8('0x12')]('/',auth[_0x7fd8('0xb')](),controller['create']);router['put']('/:id',auth[_0x7fd8('0xb')](),controller['update']);router[_0x7fd8('0x13')](_0x7fd8('0x10'),auth[_0x7fd8('0xb')](),controller['destroy']);module[_0x7fd8('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a608707..491d4aa 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x30b710,_0x4477d1){var _0x205edf=function(_0x4e02cc){while(--_0x4e02cc){_0x30b710['push'](_0x30b710['shift']());}};_0x205edf(++_0x4477d1);}(_0x34e8,0x12c));var _0x834e=function(_0x5f210a,_0x222b03){_0x5f210a=_0x5f210a-0x0;var _0x17a30e=_0x34e8[_0x5f210a];return _0x17a30e;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x48b8ad,_0xe28403){var _0x4d1bae=function(_0x5d13b2){while(--_0x5d13b2){_0x48b8ad['push'](_0x48b8ad['shift']());}};_0x4d1bae(++_0xe28403);}(_0x54ef,0x112));var _0xf54e=function(_0x1406ef,_0x31d04a){_0x1406ef=_0x1406ef-0x0;var _0x420b67=_0x54ef[_0x1406ef];return _0x420b67;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 623d4ca..6df9f5d 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 _0x81aa=['name','send','index','SmsTransferReport','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack'];(function(_0x3a931e,_0x583292){var _0x4fd6b6=function(_0x287a64){while(--_0x287a64){_0x3a931e['push'](_0x3a931e['shift']());}};_0x4fd6b6(++_0x583292);}(_0x81aa,0x157));var _0xa81a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x81aa[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa81a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa81a('0x1'));var BPromise=require(_0xa81a('0x2'));var Mustache=require(_0xa81a('0x3'));var util=require(_0xa81a('0x4'));var path=require(_0xa81a('0x5'));var sox=require(_0xa81a('0x6'));var csv=require(_0xa81a('0x7'));var ejs=require(_0xa81a('0x8'));var fs=require('fs');var fs_extra=require(_0xa81a('0x9'));var _=require(_0xa81a('0xa'));var squel=require('squel');var crypto=require(_0xa81a('0xb'));var jsforce=require(_0xa81a('0xc'));var deskjs=require(_0xa81a('0xd'));var toCsv=require(_0xa81a('0x7'));var querystring=require(_0xa81a('0xe'));var Papa=require(_0xa81a('0xf'));var Redis=require('ioredis');var authService=require(_0xa81a('0x10'));var qs=require(_0xa81a('0x11'));var as=require(_0xa81a('0x12'));var hardwareService=require(_0xa81a('0x13'));var logger=require(_0xa81a('0x14'))(_0xa81a('0x15'));var utils=require(_0xa81a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa81a('0x17'));var db=require(_0xa81a('0x18'))['db'];function respondWithStatusCode(_0x720bc8,_0x2fc667){_0x2fc667=_0x2fc667||0xcc;return function(_0x53b2a0){if(_0x53b2a0){return _0x720bc8[_0xa81a('0x19')](_0x2fc667);}return _0x720bc8['status'](_0x2fc667)[_0xa81a('0x1a')]();};}function respondWithResult(_0x1965e2,_0x45175d){_0x45175d=_0x45175d||0xc8;return function(_0x5da7d8){if(_0x5da7d8){return _0x1965e2[_0xa81a('0x1b')](_0x45175d)[_0xa81a('0x1c')](_0x5da7d8);}};}function respondWithFilteredResult(_0x423f34,_0x5a78d7){return function(_0x4f3e32){if(_0x4f3e32){var _0x5fe7ea=typeof _0x5a78d7[_0xa81a('0x1d')]===_0xa81a('0x1e')&&typeof _0x5a78d7[_0xa81a('0x1f')]===_0xa81a('0x1e');var _0x1c8472=_0x4f3e32[_0xa81a('0x20')];var _0x255ac9=_0x5fe7ea?0x0:_0x5a78d7[_0xa81a('0x1d')];var _0x4421b3=_0x5fe7ea?_0x4f3e32[_0xa81a('0x20')]:_0x5a78d7[_0xa81a('0x1d')]+_0x5a78d7[_0xa81a('0x1f')];var _0x6c8de3;if(_0x4421b3>=_0x1c8472){_0x4421b3=_0x1c8472;_0x6c8de3=0xc8;}else{_0x6c8de3=0xce;}_0x423f34[_0xa81a('0x1b')](_0x6c8de3);return _0x423f34[_0xa81a('0x21')]('Content-Range',_0x255ac9+'-'+_0x4421b3+'/'+_0x1c8472)[_0xa81a('0x1c')](_0x4f3e32);}return null;};}function patchUpdates(_0x29b668){return function(_0x5484fc){try{jsonpatch[_0xa81a('0x22')](_0x5484fc,_0x29b668,!![]);}catch(_0x36b952){return BPromise[_0xa81a('0x23')](_0x36b952);}return _0x5484fc[_0xa81a('0x24')]();};}function saveUpdates(_0x295f6b,_0x535197){return function(_0x439d5d){if(_0x439d5d){return _0x439d5d[_0xa81a('0x25')](_0x295f6b)[_0xa81a('0x26')](function(_0x4253f4){return _0x4253f4;});}return null;};}function removeEntity(_0x343212,_0x2e2c7f){return function(_0x24122a){if(_0x24122a){return _0x24122a[_0xa81a('0x27')]()[_0xa81a('0x26')](function(){_0x343212['status'](0xcc)[_0xa81a('0x1a')]();});}};}function handleEntityNotFound(_0x521201,_0xc43054){return function(_0x1ebb32){if(!_0x1ebb32){_0x521201[_0xa81a('0x19')](0x194);}return _0x1ebb32;};}function handleError(_0x4a3be8,_0x36db34){_0x36db34=_0x36db34||0x1f4;return function(_0x1d1de3){logger[_0xa81a('0x28')](_0x1d1de3[_0xa81a('0x29')]);if(_0x1d1de3[_0xa81a('0x2a')]){delete _0x1d1de3[_0xa81a('0x2a')];}_0x4a3be8['status'](_0x36db34)[_0xa81a('0x2b')](_0x1d1de3);};}exports[_0xa81a('0x2c')]=function(_0x45797f,_0x57134c){var _0x444291={},_0x5a71e5={},_0x564a42={'count':0x0,'rows':[]};var _0x25ff8a=_['map'](db[_0xa81a('0x2d')]['rawAttributes'],function(_0x38808b){return{'name':_0x38808b['fieldName'],'type':_0x38808b[_0xa81a('0x2e')]['key']};});_0x5a71e5[_0xa81a('0x2f')]=_[_0xa81a('0x30')](_0x25ff8a,_0xa81a('0x2a'));_0x5a71e5[_0xa81a('0x31')]=_[_0xa81a('0x32')](_0x45797f[_0xa81a('0x31')]);_0x5a71e5[_0xa81a('0x33')]=_[_0xa81a('0x34')](_0x5a71e5[_0xa81a('0x2f')],_0x5a71e5['query']);_0x444291[_0xa81a('0x35')]=_['intersection'](_0x5a71e5['model'],qs['fields'](_0x45797f[_0xa81a('0x31')][_0xa81a('0x36')]));_0x444291[_0xa81a('0x35')]=_0x444291['attributes'][_0xa81a('0x37')]?_0x444291[_0xa81a('0x35')]:_0x5a71e5['model'];if(!_0x45797f[_0xa81a('0x31')][_0xa81a('0x38')]('nolimit')){_0x444291['limit']=qs['limit'](_0x45797f[_0xa81a('0x31')][_0xa81a('0x1f')]);_0x444291['offset']=qs[_0xa81a('0x1d')](_0x45797f[_0xa81a('0x31')][_0xa81a('0x1d')]);}_0x444291[_0xa81a('0x39')]=qs[_0xa81a('0x3a')](_0x45797f[_0xa81a('0x31')][_0xa81a('0x3a')]);_0x444291[_0xa81a('0x3b')]=qs[_0xa81a('0x33')](_[_0xa81a('0x3c')](_0x45797f['query'],_0x5a71e5[_0xa81a('0x33')]),_0x25ff8a);if(_0x45797f[_0xa81a('0x31')][_0xa81a('0x3d')]){_0x444291[_0xa81a('0x3b')]=_[_0xa81a('0x3e')](_0x444291['where'],{'$or':_['map'](_0x25ff8a,function(_0xfab690){if(_0xfab690[_0xa81a('0x2e')]!==_0xa81a('0x3f')){var _0x49fec4={};_0x49fec4[_0xfab690[_0xa81a('0x2a')]]={'$like':'%'+_0x45797f[_0xa81a('0x31')]['filter']+'%'};return _0x49fec4;}})});}_0x444291=_[_0xa81a('0x3e')]({},_0x444291,_0x45797f[_0xa81a('0x40')]);var _0x357a18={'where':_0x444291[_0xa81a('0x3b')]};return db[_0xa81a('0x2d')][_0xa81a('0x20')](_0x357a18)[_0xa81a('0x26')](function(_0x3f00c4){_0x564a42[_0xa81a('0x20')]=_0x3f00c4;if(_0x45797f[_0xa81a('0x31')][_0xa81a('0x41')]){_0x444291[_0xa81a('0x42')]=[{'all':!![]}];}return db[_0xa81a('0x2d')][_0xa81a('0x43')](_0x444291);})['then'](function(_0x52d148){_0x564a42[_0xa81a('0x44')]=_0x52d148;return _0x564a42;})['then'](respondWithFilteredResult(_0x57134c,_0x444291))['catch'](handleError(_0x57134c,null));};exports[_0xa81a('0x45')]=function(_0x1f613b,_0x202dd3){var _0x277510={'raw':!![],'where':{'id':_0x1f613b[_0xa81a('0x46')]['id']}},_0x546a18={};_0x546a18[_0xa81a('0x2f')]=_[_0xa81a('0x32')](db[_0xa81a('0x2d')][_0xa81a('0x47')]);_0x546a18[_0xa81a('0x31')]=_['keys'](_0x1f613b[_0xa81a('0x31')]);_0x546a18[_0xa81a('0x33')]=_['intersection'](_0x546a18[_0xa81a('0x2f')],_0x546a18['query']);_0x277510[_0xa81a('0x35')]=_['intersection'](_0x546a18['model'],qs[_0xa81a('0x36')](_0x1f613b[_0xa81a('0x31')][_0xa81a('0x36')]));_0x277510[_0xa81a('0x35')]=_0x277510[_0xa81a('0x35')][_0xa81a('0x37')]?_0x277510[_0xa81a('0x35')]:_0x546a18[_0xa81a('0x2f')];if(_0x1f613b[_0xa81a('0x31')][_0xa81a('0x41')]){_0x277510['include']=[{'all':!![]}];}_0x277510=_[_0xa81a('0x3e')]({},_0x277510,_0x1f613b['options']);return db[_0xa81a('0x2d')][_0xa81a('0x48')](_0x277510)[_0xa81a('0x26')](handleEntityNotFound(_0x202dd3,null))['then'](respondWithResult(_0x202dd3,null))[_0xa81a('0x49')](handleError(_0x202dd3,null));};exports['create']=function(_0x298fdf,_0x54b20c){return db[_0xa81a('0x2d')][_0xa81a('0x4a')](_0x298fdf[_0xa81a('0x4b')],{})[_0xa81a('0x26')](respondWithResult(_0x54b20c,0xc9))[_0xa81a('0x49')](handleError(_0x54b20c,null));};exports[_0xa81a('0x25')]=function(_0x2f6877,_0x18fa3a){if(_0x2f6877[_0xa81a('0x4b')]['id']){delete _0x2f6877['body']['id'];}return db['SmsTransferReport'][_0xa81a('0x48')]({'where':{'id':_0x2f6877[_0xa81a('0x46')]['id']}})[_0xa81a('0x26')](handleEntityNotFound(_0x18fa3a,null))[_0xa81a('0x26')](saveUpdates(_0x2f6877['body'],null))['then'](respondWithResult(_0x18fa3a,null))[_0xa81a('0x49')](handleError(_0x18fa3a,null));};exports[_0xa81a('0x27')]=function(_0x2dfd3c,_0x87a672){return db[_0xa81a('0x2d')][_0xa81a('0x48')]({'where':{'id':_0x2dfd3c['params']['id']}})[_0xa81a('0x26')](handleEntityNotFound(_0x87a672,null))[_0xa81a('0x26')](removeEntity(_0x87a672,null))['catch'](handleError(_0x87a672,null));};exports[_0xa81a('0x4c')]=function(_0x1f7148,_0x3f0cdd){return db[_0xa81a('0x2d')]['describe']()[_0xa81a('0x26')](respondWithResult(_0x3f0cdd,null))['catch'](handleError(_0x3f0cdd,null));}; \ No newline at end of file +var _0xf0de=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0xf0de,0x13f));var _0xef0d=function(_0x1cd281,_0x3c7cb6){_0x1cd281=_0x1cd281-0x0;var _0x339c6e=_0xf0de[_0x1cd281];return _0x339c6e;};'use strict';var emlformat=require(_0xef0d('0x0'));var rimraf=require(_0xef0d('0x1'));var zipdir=require(_0xef0d('0x2'));var jsonpatch=require(_0xef0d('0x3'));var rp=require(_0xef0d('0x4'));var moment=require('moment');var BPromise=require(_0xef0d('0x5'));var Mustache=require('mustache');var util=require(_0xef0d('0x6'));var path=require(_0xef0d('0x7'));var sox=require('sox');var csv=require(_0xef0d('0x8'));var ejs=require(_0xef0d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef0d('0xa'));var squel=require(_0xef0d('0xb'));var crypto=require(_0xef0d('0xc'));var jsforce=require(_0xef0d('0xd'));var deskjs=require(_0xef0d('0xe'));var toCsv=require(_0xef0d('0x8'));var querystring=require(_0xef0d('0xf'));var Papa=require('papaparse');var Redis=require(_0xef0d('0x10'));var authService=require(_0xef0d('0x11'));var qs=require(_0xef0d('0x12'));var as=require(_0xef0d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef0d('0x14'))(_0xef0d('0x15'));var utils=require('../../config/utils');var config=require(_0xef0d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xef0d('0x17'))['db'];function respondWithStatusCode(_0x57bf09,_0x4f29a1){_0x4f29a1=_0x4f29a1||0xcc;return function(_0x54f929){if(_0x54f929){return _0x57bf09[_0xef0d('0x18')](_0x4f29a1);}return _0x57bf09[_0xef0d('0x19')](_0x4f29a1)[_0xef0d('0x1a')]();};}function respondWithResult(_0xe25ea,_0x1e85b6){_0x1e85b6=_0x1e85b6||0xc8;return function(_0x1d53e2){if(_0x1d53e2){return _0xe25ea['status'](_0x1e85b6)[_0xef0d('0x1b')](_0x1d53e2);}};}function respondWithFilteredResult(_0x4af3ba,_0x3e065d){return function(_0xbee4d7){if(_0xbee4d7){var _0x3f2a4f=typeof _0x3e065d[_0xef0d('0x1c')]===_0xef0d('0x1d')&&typeof _0x3e065d[_0xef0d('0x1e')]==='undefined';var _0x55937d=_0xbee4d7[_0xef0d('0x1f')];var _0x1e3031=_0x3f2a4f?0x0:_0x3e065d['offset'];var _0x42d934=_0x3f2a4f?_0xbee4d7['count']:_0x3e065d[_0xef0d('0x1c')]+_0x3e065d['limit'];var _0x4f5f07;if(_0x42d934>=_0x55937d){_0x42d934=_0x55937d;_0x4f5f07=0xc8;}else{_0x4f5f07=0xce;}_0x4af3ba['status'](_0x4f5f07);return _0x4af3ba[_0xef0d('0x20')]('Content-Range',_0x1e3031+'-'+_0x42d934+'/'+_0x55937d)[_0xef0d('0x1b')](_0xbee4d7);}return null;};}function patchUpdates(_0x353c5c){return function(_0x2fa3ee){try{jsonpatch[_0xef0d('0x21')](_0x2fa3ee,_0x353c5c,!![]);}catch(_0x229dd8){return BPromise[_0xef0d('0x22')](_0x229dd8);}return _0x2fa3ee[_0xef0d('0x23')]();};}function saveUpdates(_0x15a8ab,_0x39aeb2){return function(_0x406432){if(_0x406432){return _0x406432['update'](_0x15a8ab)[_0xef0d('0x24')](function(_0x5107fa){return _0x5107fa;});}return null;};}function removeEntity(_0x2ba8ee,_0xb6433e){return function(_0x4cf4a4){if(_0x4cf4a4){return _0x4cf4a4[_0xef0d('0x25')]()[_0xef0d('0x24')](function(){_0x2ba8ee['status'](0xcc)[_0xef0d('0x1a')]();});}};}function handleEntityNotFound(_0x2fe83b,_0x17b81a){return function(_0x455f74){if(!_0x455f74){_0x2fe83b[_0xef0d('0x18')](0x194);}return _0x455f74;};}function handleError(_0x2841d1,_0xab6b53){_0xab6b53=_0xab6b53||0x1f4;return function(_0x4e2925){logger[_0xef0d('0x26')](_0x4e2925[_0xef0d('0x27')]);if(_0x4e2925[_0xef0d('0x28')]){delete _0x4e2925[_0xef0d('0x28')];}_0x2841d1[_0xef0d('0x19')](_0xab6b53)['send'](_0x4e2925);};}exports['index']=function(_0x3fd9b0,_0x4e1cb2){var _0x159eb3={},_0x26e259={},_0x8c399f={'count':0x0,'rows':[]};var _0x1900d2=_[_0xef0d('0x29')](db[_0xef0d('0x2a')][_0xef0d('0x2b')],function(_0x24bfc4){return{'name':_0x24bfc4[_0xef0d('0x2c')],'type':_0x24bfc4[_0xef0d('0x2d')][_0xef0d('0x2e')]};});_0x26e259[_0xef0d('0x2f')]=_[_0xef0d('0x29')](_0x1900d2,'name');_0x26e259[_0xef0d('0x30')]=_[_0xef0d('0x31')](_0x3fd9b0[_0xef0d('0x30')]);_0x26e259[_0xef0d('0x32')]=_['intersection'](_0x26e259[_0xef0d('0x2f')],_0x26e259['query']);_0x159eb3[_0xef0d('0x33')]=_[_0xef0d('0x34')](_0x26e259[_0xef0d('0x2f')],qs[_0xef0d('0x35')](_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x35')]));_0x159eb3[_0xef0d('0x33')]=_0x159eb3[_0xef0d('0x33')][_0xef0d('0x36')]?_0x159eb3[_0xef0d('0x33')]:_0x26e259[_0xef0d('0x2f')];if(!_0x3fd9b0[_0xef0d('0x30')]['hasOwnProperty'](_0xef0d('0x37'))){_0x159eb3['limit']=qs[_0xef0d('0x1e')](_0x3fd9b0['query'][_0xef0d('0x1e')]);_0x159eb3[_0xef0d('0x1c')]=qs[_0xef0d('0x1c')](_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x1c')]);}_0x159eb3[_0xef0d('0x38')]=qs[_0xef0d('0x39')](_0x3fd9b0[_0xef0d('0x30')]['sort']);_0x159eb3[_0xef0d('0x3a')]=qs['filters'](_[_0xef0d('0x3b')](_0x3fd9b0[_0xef0d('0x30')],_0x26e259[_0xef0d('0x32')]),_0x1900d2);if(_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x3c')]){_0x159eb3[_0xef0d('0x3a')]=_[_0xef0d('0x3d')](_0x159eb3[_0xef0d('0x3a')],{'$or':_[_0xef0d('0x29')](_0x1900d2,function(_0x5af91b){if(_0x5af91b[_0xef0d('0x2d')]!==_0xef0d('0x3e')){var _0x36cd30={};_0x36cd30[_0x5af91b['name']]={'$like':'%'+_0x3fd9b0['query'][_0xef0d('0x3c')]+'%'};return _0x36cd30;}})});}_0x159eb3=_['merge']({},_0x159eb3,_0x3fd9b0[_0xef0d('0x3f')]);var _0x174e8a={'where':_0x159eb3[_0xef0d('0x3a')]};return db[_0xef0d('0x2a')][_0xef0d('0x1f')](_0x174e8a)[_0xef0d('0x24')](function(_0x574498){_0x8c399f['count']=_0x574498;if(_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x40')]){_0x159eb3[_0xef0d('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xef0d('0x42')](_0x159eb3);})[_0xef0d('0x24')](function(_0xd3a209){_0x8c399f[_0xef0d('0x43')]=_0xd3a209;return _0x8c399f;})[_0xef0d('0x24')](respondWithFilteredResult(_0x4e1cb2,_0x159eb3))['catch'](handleError(_0x4e1cb2,null));};exports[_0xef0d('0x44')]=function(_0x23d48f,_0x30eac7){var _0x595f6a={'raw':!![],'where':{'id':_0x23d48f[_0xef0d('0x45')]['id']}},_0x3e2889={};_0x3e2889['model']=_[_0xef0d('0x31')](db['SmsTransferReport'][_0xef0d('0x2b')]);_0x3e2889[_0xef0d('0x30')]=_[_0xef0d('0x31')](_0x23d48f[_0xef0d('0x30')]);_0x3e2889[_0xef0d('0x32')]=_[_0xef0d('0x34')](_0x3e2889['model'],_0x3e2889[_0xef0d('0x30')]);_0x595f6a[_0xef0d('0x33')]=_[_0xef0d('0x34')](_0x3e2889[_0xef0d('0x2f')],qs[_0xef0d('0x35')](_0x23d48f[_0xef0d('0x30')][_0xef0d('0x35')]));_0x595f6a[_0xef0d('0x33')]=_0x595f6a[_0xef0d('0x33')][_0xef0d('0x36')]?_0x595f6a['attributes']:_0x3e2889[_0xef0d('0x2f')];if(_0x23d48f[_0xef0d('0x30')][_0xef0d('0x40')]){_0x595f6a[_0xef0d('0x41')]=[{'all':!![]}];}_0x595f6a=_['merge']({},_0x595f6a,_0x23d48f[_0xef0d('0x3f')]);return db[_0xef0d('0x2a')][_0xef0d('0x46')](_0x595f6a)['then'](handleEntityNotFound(_0x30eac7,null))[_0xef0d('0x24')](respondWithResult(_0x30eac7,null))[_0xef0d('0x47')](handleError(_0x30eac7,null));};exports[_0xef0d('0x48')]=function(_0x1a0b95,_0x3670a3){return db[_0xef0d('0x2a')][_0xef0d('0x48')](_0x1a0b95['body'],{})['then'](respondWithResult(_0x3670a3,0xc9))[_0xef0d('0x47')](handleError(_0x3670a3,null));};exports['update']=function(_0x4f3e0e,_0x45eda0){if(_0x4f3e0e['body']['id']){delete _0x4f3e0e[_0xef0d('0x49')]['id'];}return db[_0xef0d('0x2a')][_0xef0d('0x46')]({'where':{'id':_0x4f3e0e[_0xef0d('0x45')]['id']}})[_0xef0d('0x24')](handleEntityNotFound(_0x45eda0,null))[_0xef0d('0x24')](saveUpdates(_0x4f3e0e['body'],null))[_0xef0d('0x24')](respondWithResult(_0x45eda0,null))['catch'](handleError(_0x45eda0,null));};exports[_0xef0d('0x25')]=function(_0x4dc29b,_0x56d902){return db[_0xef0d('0x2a')][_0xef0d('0x46')]({'where':{'id':_0x4dc29b[_0xef0d('0x45')]['id']}})[_0xef0d('0x24')](handleEntityNotFound(_0x56d902,null))[_0xef0d('0x24')](removeEntity(_0x56d902,null))[_0xef0d('0x47')](handleError(_0x56d902,null));};exports['describe']=function(_0x5a25cc,_0x42058f){return db['SmsTransferReport'][_0xef0d('0x4a')]()['then'](respondWithResult(_0x42058f,null))['catch'](handleError(_0x42058f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index dff1e16..5fb238d 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 _0xf0ba=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x2b8549,_0x28f62a){var _0x337bc8=function(_0x3560d4){while(--_0x3560d4){_0x2b8549['push'](_0x2b8549['shift']());}};_0x337bc8(++_0x28f62a);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var logger=require(_0xaf0b('0x2'))(_0xaf0b('0x3'));var moment=require(_0xaf0b('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf0b('0x5'));var fs=require('fs');var path=require(_0xaf0b('0x6'));var rimraf=require('rimraf');var config=require(_0xaf0b('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xaf0b('0x8')]=function(_0x4b3b85,_0x4d1479){return _0x4b3b85[_0xaf0b('0x9')](_0xaf0b('0xa'),attributes,{'tableName':_0xaf0b('0xb'),'paranoid':![],'indexes':[{'name':_0xaf0b('0xc'),'fields':[_0xaf0b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbfb=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x3f5c0e,_0x22f6cb){var _0x5189ae=function(_0x5d507a){while(--_0x5d507a){_0x3f5c0e['push'](_0x3f5c0e['shift']());}};_0x5189ae(++_0x22f6cb);}(_0xdbfb,0x16b));var _0xbdbf=function(_0x457a1b,_0x13b741){_0x457a1b=_0x457a1b-0x0;var _0x2e4f6d=_0xdbfb[_0x457a1b];return _0x2e4f6d;};'use strict';var _=require(_0xbdbf('0x0'));var util=require(_0xbdbf('0x1'));var logger=require('../../config/logger')(_0xbdbf('0x2'));var moment=require(_0xbdbf('0x3'));var BPromise=require('bluebird');var rp=require(_0xbdbf('0x4'));var fs=require('fs');var path=require(_0xbdbf('0x5'));var rimraf=require(_0xbdbf('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0xbdbf('0x7')]=function(_0x1dd17f,_0x37e176){return _0x1dd17f[_0xbdbf('0x8')](_0xbdbf('0x9'),attributes,{'tableName':_0xbdbf('0xa'),'paranoid':![],'indexes':[{'name':_0xbdbf('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 67475a2..aecb794 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 _0xed1f=['request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x217f48,_0x3d4384){var _0x2428f7=function(_0x5f1b2a){while(--_0x5f1b2a){_0x217f48['push'](_0x217f48['shift']());}};_0x2428f7(++_0x3d4384);}(_0xed1f,0x6a));var _0xfed1=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xed1f[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('SmsTransferReport,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('SmsTransferReport,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('SmsTransferReport,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0x078c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x1b66bb,_0x3a6255){var _0x29f4dc=function(_0x48eaae){while(--_0x48eaae){_0x1b66bb['push'](_0x1b66bb['shift']());}};_0x29f4dc(++_0x3a6255);}(_0x078c,0x19f));var _0xc078=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x078c[_0x2389bc];return _0x170548;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var moment=require(_0xc078('0x1'));var BPromise=require(_0xc078('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc078('0x3'));var db=require(_0xc078('0x4'))['db'];var utils=require(_0xc078('0x5'));var logger=require(_0xc078('0x6'))('rpc');var config=require(_0xc078('0x7'));var jayson=require(_0xc078('0x8'));var client=jayson[_0xc078('0x9')][_0xc078('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40e428,_0x1705b0,_0x22661e){return new BPromise(function(_0x4030b1,_0x4d56df){return client['request'](_0x40e428,_0x22661e)['then'](function(_0x28dc54){logger[_0xc078('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x1705b0,_0xc078('0xc'));logger[_0xc078('0xd')](_0xc078('0xe'),_0x1705b0,_0xc078('0xc'),JSON[_0xc078('0xf')](_0x28dc54));if(_0x28dc54['error']){if(_0x28dc54['error'][_0xc078('0x10')]===0x1f4){logger[_0xc078('0x11')](_0xc078('0x12'),_0x1705b0,_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);return _0x4d56df(_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);}logger[_0xc078('0x11')](_0xc078('0x12'),_0x1705b0,_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);return _0x4030b1(_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);}else{logger[_0xc078('0xb')](_0xc078('0x12'),_0x1705b0,'request\x20sent');_0x4030b1(_0x28dc54[_0xc078('0x14')][_0xc078('0x13')]);}})[_0xc078('0x15')](function(_0x595b14){logger[_0xc078('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1705b0,_0x595b14);_0x4d56df(_0x595b14);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 55a83dd..5ee98b1 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 _0x2e12=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','isAuthenticated','show','/:id/download','download','join','server/files/sounds/original/','originalname','replace','%s-%s%s','extname','now','single','file','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x1ac38e,_0x2d4f22){var _0x3fbd1a=function(_0x300915){while(--_0x300915){_0x1ac38e['push'](_0x1ac38e['shift']());}};_0x3fbd1a(++_0x2d4f22);}(_0x2e12,0xeb));var _0x22e1=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x2e12[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x22e1('0x0'));var util=require(_0x22e1('0x1'));var path=require(_0x22e1('0x2'));var timeout=require(_0x22e1('0x3'));var express=require(_0x22e1('0x4'));var router=express[_0x22e1('0x5')]();var fs_extra=require(_0x22e1('0x6'));var auth=require(_0x22e1('0x7'));var interaction=require(_0x22e1('0x8'));var config=require(_0x22e1('0x9'));var controller=require(_0x22e1('0xa'));router[_0x22e1('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x22e1('0xc'),auth[_0x22e1('0xd')](),controller[_0x22e1('0xe')]);router[_0x22e1('0xb')](_0x22e1('0xf'),auth['isAuthenticated'](),controller[_0x22e1('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d2305,_0x5781bf,_0x41c383){_0x41c383(null,path[_0x22e1('0x11')](config['root'],_0x22e1('0x12')));},'filename':function(_0xffde7a,_0x44efbf,_0x48ef04){_0x44efbf[_0x22e1('0x13')]=_0x44efbf[_0x22e1('0x13')][_0x22e1('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48ef04(null,util['format'](_0x22e1('0x15'),path['basename'](_0x44efbf[_0x22e1('0x13')],path[_0x22e1('0x16')](_0x44efbf[_0x22e1('0x13')])),Date[_0x22e1('0x17')](),path[_0x22e1('0x16')](_0x44efbf[_0x22e1('0x13')])));}})});router['post']('/',upload[_0x22e1('0x18')](_0x22e1('0x19')),controller['create']);router[_0x22e1('0x1a')](_0x22e1('0xc'),auth[_0x22e1('0xd')](),controller[_0x22e1('0x1b')]);router[_0x22e1('0x1c')](_0x22e1('0xc'),auth[_0x22e1('0xd')](),controller[_0x22e1('0x1c')]);module[_0x22e1('0x1d')]=router; \ No newline at end of file +var _0xf6c4=['/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','now','extname','post','single','file','create','update','delete','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index'];(function(_0x35f75a,_0x33b47c){var _0x3c9ac0=function(_0x2c83ce){while(--_0x2c83ce){_0x35f75a['push'](_0x35f75a['shift']());}};_0x3c9ac0(++_0x33b47c);}(_0xf6c4,0x195));var _0x4f6c=function(_0x397619,_0x22ca4c){_0x397619=_0x397619-0x0;var _0x40f95a=_0xf6c4[_0x397619];return _0x40f95a;};'use strict';var multer=require(_0x4f6c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f6c('0x1'));var router=express[_0x4f6c('0x2')]();var fs_extra=require(_0x4f6c('0x3'));var auth=require(_0x4f6c('0x4'));var interaction=require(_0x4f6c('0x5'));var config=require(_0x4f6c('0x6'));var controller=require(_0x4f6c('0x7'));router[_0x4f6c('0x8')]('/',auth[_0x4f6c('0x9')](),controller[_0x4f6c('0xa')]);router['get'](_0x4f6c('0xb'),auth[_0x4f6c('0x9')](),controller[_0x4f6c('0xc')]);router[_0x4f6c('0x8')](_0x4f6c('0xd'),auth[_0x4f6c('0x9')](),controller[_0x4f6c('0xe')]);var upload=multer({'storage':multer[_0x4f6c('0xf')]({'destination':function(_0x732d15,_0xdd8fc9,_0x2f9190){_0x2f9190(null,path[_0x4f6c('0x10')](config[_0x4f6c('0x11')],_0x4f6c('0x12')));},'filename':function(_0x57c40a,_0x584ce0,_0x3c15d6){_0x584ce0['originalname']=_0x584ce0[_0x4f6c('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c15d6(null,util[_0x4f6c('0x14')](_0x4f6c('0x15'),path[_0x4f6c('0x16')](_0x584ce0[_0x4f6c('0x13')],path['extname'](_0x584ce0[_0x4f6c('0x13')])),Date[_0x4f6c('0x17')](),path[_0x4f6c('0x18')](_0x584ce0['originalname'])));}})});router[_0x4f6c('0x19')]('/',upload[_0x4f6c('0x1a')](_0x4f6c('0x1b')),controller[_0x4f6c('0x1c')]);router['put'](_0x4f6c('0xb'),auth[_0x4f6c('0x9')](),controller[_0x4f6c('0x1d')]);router['delete']('/:id',auth[_0x4f6c('0x9')](),controller[_0x4f6c('0x1e')]);module[_0x4f6c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index bed46cb..c1aca28 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 _0xcf29=['BIGINT','sequelize','exports','STRING','name','INTEGER','FLOAT'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xcf29,0x14a));var _0x9cf2=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0xcf29[_0x19aa84];return _0x536146;};'use strict';var Sequelize=require(_0x9cf2('0x0'));module[_0x9cf2('0x1')]={'name':{'type':Sequelize[_0x9cf2('0x2')],'unique':_0x9cf2('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x9cf2('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x9cf2('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x9cf2('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x9cf2('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x9cf2('0x6')]},'converted_channelCount':{'type':Sequelize[_0x9cf2('0x4')]},'converted_bitRate':{'type':Sequelize[_0x9cf2('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x9cf2('0x4')]}}; \ No newline at end of file +var _0xed2e=['name','BIGINT','INTEGER','FLOAT','sequelize','exports','STRING'];(function(_0x1e1106,_0x511117){var _0x213026=function(_0x331b42){while(--_0x331b42){_0x1e1106['push'](_0x1e1106['shift']());}};_0x213026(++_0x511117);}(_0xed2e,0x12a));var _0xeed2=function(_0x1bb6fd,_0x5f2b72){_0x1bb6fd=_0x1bb6fd-0x0;var _0x243b60=_0xed2e[_0x1bb6fd];return _0x243b60;};'use strict';var Sequelize=require(_0xeed2('0x0'));module[_0xeed2('0x1')]={'name':{'type':Sequelize[_0xeed2('0x2')],'unique':_0xeed2('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xeed2('0x2')]},'display_name':{'type':Sequelize[_0xeed2('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xeed2('0x2')]},'original_format':{'type':Sequelize[_0xeed2('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xeed2('0x4')]},'original_channelCount':{'type':Sequelize[_0xeed2('0x5')]},'original_bitRate':{'type':Sequelize[_0xeed2('0x4')]},'original_sampleRate':{'type':Sequelize[_0xeed2('0x5')]},'converted_format':{'type':Sequelize[_0xeed2('0x2')]},'converted_duration':{'type':Sequelize[_0xeed2('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xeed2('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xeed2('0x4')]},'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 e09b87d..30ae4ad 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 _0x9032=['fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','Sounds','UserProfileResource','end','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','send','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','channelCount','converted_bitRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1798cb,_0xafe39f){var _0x4a68ed=function(_0x2e9265){while(--_0x2e9265){_0x1798cb['push'](_0x1798cb['shift']());}};_0x4a68ed(++_0xafe39f);}(_0x9032,0x78));var _0x2903=function(_0x1c5ecd,_0x323ec9){_0x1c5ecd=_0x1c5ecd-0x0;var _0x394d5b=_0x9032[_0x1c5ecd];return _0x394d5b;};'use strict';var emlformat=require(_0x2903('0x0'));var rimraf=require(_0x2903('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2903('0x2'));var rp=require(_0x2903('0x3'));var moment=require(_0x2903('0x4'));var BPromise=require(_0x2903('0x5'));var Mustache=require(_0x2903('0x6'));var util=require(_0x2903('0x7'));var path=require(_0x2903('0x8'));var sox=require(_0x2903('0x9'));var csv=require(_0x2903('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2903('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2903('0xc'));var jsforce=require(_0x2903('0xd'));var deskjs=require(_0x2903('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2903('0xf'));var Papa=require('papaparse');var Redis=require(_0x2903('0x10'));var authService=require(_0x2903('0x11'));var qs=require(_0x2903('0x12'));var as=require(_0x2903('0x13'));var hardwareService=require(_0x2903('0x14'));var logger=require(_0x2903('0x15'))(_0x2903('0x16'));var utils=require(_0x2903('0x17'));var config=require(_0x2903('0x18'));var licenseUtil=require(_0x2903('0x19'));var db=require(_0x2903('0x1a'))['db'];function respondWithStatusCode(_0x6edcde,_0x5e6672){_0x5e6672=_0x5e6672||0xcc;return function(_0x42eb3b){if(_0x42eb3b){return _0x6edcde[_0x2903('0x1b')](_0x5e6672);}return _0x6edcde[_0x2903('0x1c')](_0x5e6672)['end']();};}function respondWithResult(_0x1e6ced,_0x3915c7){_0x3915c7=_0x3915c7||0xc8;return function(_0x5e6b9c){if(_0x5e6b9c){return _0x1e6ced[_0x2903('0x1c')](_0x3915c7)[_0x2903('0x1d')](_0x5e6b9c);}};}function respondWithFilteredResult(_0x4e1059,_0x1fec49){return function(_0x25b978){if(_0x25b978){var _0x4279b2=typeof _0x1fec49[_0x2903('0x1e')]===_0x2903('0x1f')&&typeof _0x1fec49['limit']===_0x2903('0x1f');var _0x13e153=_0x25b978[_0x2903('0x20')];var _0x3cf902=_0x4279b2?0x0:_0x1fec49[_0x2903('0x1e')];var _0x63b139=_0x4279b2?_0x25b978[_0x2903('0x20')]:_0x1fec49['offset']+_0x1fec49[_0x2903('0x21')];var _0x1f0567;if(_0x63b139>=_0x13e153){_0x63b139=_0x13e153;_0x1f0567=0xc8;}else{_0x1f0567=0xce;}_0x4e1059[_0x2903('0x1c')](_0x1f0567);return _0x4e1059[_0x2903('0x22')](_0x2903('0x23'),_0x3cf902+'-'+_0x63b139+'/'+_0x13e153)[_0x2903('0x1d')](_0x25b978);}return null;};}function patchUpdates(_0x4a8c67){return function(_0x5d031f){try{jsonpatch['apply'](_0x5d031f,_0x4a8c67,!![]);}catch(_0x750841){return BPromise[_0x2903('0x24')](_0x750841);}return _0x5d031f[_0x2903('0x25')]();};}function saveUpdates(_0x526fc5,_0x356328){return function(_0x4d13a9){if(_0x4d13a9){return _0x4d13a9[_0x2903('0x26')](_0x526fc5)['then'](function(_0x23dc22){return _0x23dc22;});}return null;};}function removeEntity(_0x3f73f0,_0x4a1185){return function(_0x11f560){if(_0x11f560){return _0x11f560[_0x2903('0x27')]()[_0x2903('0x28')](function(){var _0x14dc76=_0x11f560[_0x2903('0x29')]({'plain':!![]});var _0x2df249=_0x2903('0x2a');return db[_0x2903('0x2b')][_0x2903('0x27')]({'where':{'type':_0x2df249,'resourceId':_0x14dc76['id']}})[_0x2903('0x28')](function(){return _0x11f560;});})[_0x2903('0x28')](function(){_0x3f73f0['status'](0xcc)[_0x2903('0x2c')]();});}};}function handleEntityNotFound(_0x42d50f,_0x3078bb){return function(_0x180d32){if(!_0x180d32){_0x42d50f['sendStatus'](0x194);}return _0x180d32;};}function handleError(_0xcccf8b,_0x3c8dd5){_0x3c8dd5=_0x3c8dd5||0x1f4;return function(_0x88ae58){logger[_0x2903('0x2d')](_0x88ae58[_0x2903('0x2e')]);if(_0x88ae58['name']){delete _0x88ae58[_0x2903('0x2f')];}_0xcccf8b[_0x2903('0x1c')](_0x3c8dd5)['send'](_0x88ae58);};}exports[_0x2903('0x30')]=function(_0x592c55,_0x52089f){var _0x2e9c13={},_0x2214e8={},_0x4acfff={'count':0x0,'rows':[]};var _0xc9d12e=_[_0x2903('0x31')](db[_0x2903('0x32')][_0x2903('0x33')],function(_0x587dbe){return{'name':_0x587dbe[_0x2903('0x34')],'type':_0x587dbe[_0x2903('0x35')][_0x2903('0x36')]};});_0x2214e8[_0x2903('0x37')]=_[_0x2903('0x31')](_0xc9d12e,_0x2903('0x2f'));_0x2214e8['query']=_['keys'](_0x592c55[_0x2903('0x38')]);_0x2214e8[_0x2903('0x39')]=_[_0x2903('0x3a')](_0x2214e8[_0x2903('0x37')],_0x2214e8[_0x2903('0x38')]);_0x2e9c13[_0x2903('0x3b')]=_[_0x2903('0x3a')](_0x2214e8[_0x2903('0x37')],qs[_0x2903('0x3c')](_0x592c55['query'][_0x2903('0x3c')]));_0x2e9c13[_0x2903('0x3b')]=_0x2e9c13[_0x2903('0x3b')][_0x2903('0x3d')]?_0x2e9c13[_0x2903('0x3b')]:_0x2214e8[_0x2903('0x37')];if(!_0x592c55[_0x2903('0x38')][_0x2903('0x3e')](_0x2903('0x3f'))){_0x2e9c13[_0x2903('0x21')]=qs[_0x2903('0x21')](_0x592c55[_0x2903('0x38')][_0x2903('0x21')]);_0x2e9c13[_0x2903('0x1e')]=qs[_0x2903('0x1e')](_0x592c55['query']['offset']);}_0x2e9c13[_0x2903('0x40')]=qs['sort'](_0x592c55[_0x2903('0x38')][_0x2903('0x41')]);_0x2e9c13[_0x2903('0x42')]=qs[_0x2903('0x39')](_['pick'](_0x592c55[_0x2903('0x38')],_0x2214e8['filters']),_0xc9d12e);if(_0x592c55[_0x2903('0x38')]['filter']){_0x2e9c13['where']=_[_0x2903('0x43')](_0x2e9c13[_0x2903('0x42')],{'$or':_[_0x2903('0x31')](_0xc9d12e,function(_0x361958){if(_0x361958[_0x2903('0x35')]!==_0x2903('0x44')){var _0x1a70d7={};_0x1a70d7[_0x361958[_0x2903('0x2f')]]={'$like':'%'+_0x592c55[_0x2903('0x38')][_0x2903('0x45')]+'%'};return _0x1a70d7;}})});}_0x2e9c13=_[_0x2903('0x43')]({},_0x2e9c13,_0x592c55['options']);var _0xa2179e={'where':_0x2e9c13[_0x2903('0x42')]};return db['Sound'][_0x2903('0x20')](_0xa2179e)[_0x2903('0x28')](function(_0x44a312){_0x4acfff['count']=_0x44a312;if(_0x592c55[_0x2903('0x38')][_0x2903('0x46')]){_0x2e9c13[_0x2903('0x47')]=[{'all':!![]}];}return db['Sound'][_0x2903('0x48')](_0x2e9c13);})[_0x2903('0x28')](function(_0x3d105b){_0x4acfff['rows']=_0x3d105b;return _0x4acfff;})[_0x2903('0x28')](respondWithFilteredResult(_0x52089f,_0x2e9c13))[_0x2903('0x49')](handleError(_0x52089f,null));};exports[_0x2903('0x4a')]=function(_0x311b2e,_0x3c13f7){var _0x4e1ff7={'raw':!![],'where':{'id':_0x311b2e[_0x2903('0x4b')]['id']}},_0x360bec={};_0x360bec[_0x2903('0x37')]=_[_0x2903('0x4c')](db['Sound']['rawAttributes']);_0x360bec[_0x2903('0x38')]=_['keys'](_0x311b2e[_0x2903('0x38')]);_0x360bec[_0x2903('0x39')]=_[_0x2903('0x3a')](_0x360bec[_0x2903('0x37')],_0x360bec[_0x2903('0x38')]);_0x4e1ff7[_0x2903('0x3b')]=_[_0x2903('0x3a')](_0x360bec[_0x2903('0x37')],qs[_0x2903('0x3c')](_0x311b2e[_0x2903('0x38')][_0x2903('0x3c')]));_0x4e1ff7['attributes']=_0x4e1ff7['attributes'][_0x2903('0x3d')]?_0x4e1ff7[_0x2903('0x3b')]:_0x360bec[_0x2903('0x37')];if(_0x311b2e[_0x2903('0x38')][_0x2903('0x46')]){_0x4e1ff7[_0x2903('0x47')]=[{'all':!![]}];}_0x4e1ff7=_['merge']({},_0x4e1ff7,_0x311b2e['options']);return db[_0x2903('0x32')]['find'](_0x4e1ff7)['then'](handleEntityNotFound(_0x3c13f7,null))[_0x2903('0x28')](respondWithResult(_0x3c13f7,null))[_0x2903('0x49')](handleError(_0x3c13f7,null));};exports[_0x2903('0x4d')]=function(_0x1bd260,_0xda6f02,_0x108452){return db['Sound']['find']({'where':{'id':_0x1bd260[_0x2903('0x4b')]['id']},'attributes':['name',_0x2903('0x4e'),_0x2903('0x4f')],'raw':!![]})[_0x2903('0x28')](handleEntityNotFound(_0xda6f02,null))[_0x2903('0x28')](function(_0x5e3f11){if(_0x5e3f11){if(!fs[_0x2903('0x50')](path[_0x2903('0x51')](config[_0x2903('0x52')],_0x2903('0x53'),_0x5e3f11[_0x2903('0x4e')]+'.'+_0x5e3f11[_0x2903('0x4f')]))){throw new db[(_0x2903('0x54'))][(_0x2903('0x55'))](_0x2903('0x56'));}return _0xda6f02['download'](path[_0x2903('0x51')](config[_0x2903('0x52')],_0x2903('0x53'),util[_0x2903('0x57')](_0x2903('0x58'),_0x5e3f11[_0x2903('0x4e')],_0x5e3f11[_0x2903('0x4f')])),util[_0x2903('0x57')](_0x2903('0x58'),_0x5e3f11['name'],_0x5e3f11[_0x2903('0x4f')]));}return null;})[_0x2903('0x49')](handleError(_0xda6f02,null));};exports[_0x2903('0x59')]=function(_0x367671,_0x395ba1,_0x40c24e){var _0x43d37c={'name':path[_0x2903('0x5a')](_0x367671[_0x2903('0x5b')][_0x2903('0x5c')],path[_0x2903('0x5d')](_0x367671['file'][_0x2903('0x5c')])),'save_name':path[_0x2903('0x5a')](_0x367671[_0x2903('0x5b')][_0x2903('0x5e')],path['extname'](_0x367671[_0x2903('0x5b')][_0x2903('0x5e')])),'original_format':path[_0x2903('0x5d')](_0x367671[_0x2903('0x5b')][_0x2903('0x5c')])[_0x2903('0x5f')](0x1),'converted_format':_0x2903('0x60')};var _0x4f091a=path[_0x2903('0x51')](config['root'],_0x2903('0x61'),_0x367671[_0x2903('0x5b')]['filename']);var _0x3f0e73=path[_0x2903('0x51')](config['root'],_0x2903('0x53'),util['format'](_0x2903('0x58'),path[_0x2903('0x5a')](_0x367671[_0x2903('0x5b')][_0x2903('0x5e')],path['extname'](_0x367671[_0x2903('0x5b')]['filename'])),_0x43d37c[_0x2903('0x4f')]));logger['info'](_0x2903('0x62'),_0x4f091a);logger[_0x2903('0x63')](_0x2903('0x64'),_0x3f0e73);try{fs['chmodSync'](_0x4f091a,parseInt(_0x2903('0x65'),0x8));var _0x35e191=sox['transcode'](_0x4f091a,_0x3f0e73,{'sampleRate':0x1f40,'format':_0x2903('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x35e191['on'](_0x2903('0x2d'),function(_0x2dcebb){fs[_0x2903('0x66')](_0x4f091a);_0x395ba1['status'](0x1f4)[_0x2903('0x67')](_0x2dcebb);});_0x35e191['on']('src',function(_0x4ad159){_0x43d37c[_0x2903('0x68')]=isNaN(_0x4ad159[_0x2903('0x69')])?null:_0x4ad159[_0x2903('0x69')]*0x3e8;_0x43d37c[_0x2903('0x6a')]=isNaN(_0x4ad159[_0x2903('0x6b')])?null:_0x4ad159[_0x2903('0x6b')];_0x43d37c[_0x2903('0x6c')]=isNaN(_0x4ad159['channelCount'])?null:_0x4ad159['channelCount'];_0x43d37c[_0x2903('0x6d')]=isNaN(_0x4ad159[_0x2903('0x6e')])?null:_0x4ad159['bitRate'];_0x43d37c[_0x2903('0x6f')]=isNaN(_0x4ad159['sampleRate'])?null:_0x4ad159[_0x2903('0x70')];});_0x35e191['on'](_0x2903('0x71'),function(_0x197b23){_0x43d37c[_0x2903('0x72')]=isNaN(_0x197b23[_0x2903('0x69')])?null:_0x197b23[_0x2903('0x69')]*0x3e8;_0x43d37c['converted_sampleCount']=isNaN(_0x197b23['sampleCount'])?null:_0x197b23['sampleCount'];_0x43d37c[_0x2903('0x73')]=isNaN(_0x197b23[_0x2903('0x74')])?null:_0x197b23['channelCount'];_0x43d37c[_0x2903('0x75')]=isNaN(_0x197b23[_0x2903('0x6e')])?null:_0x197b23[_0x2903('0x6e')];_0x43d37c['converted_sampleRate']=isNaN(_0x197b23[_0x2903('0x70')])?null:_0x197b23[_0x2903('0x70')];});_0x35e191['on'](_0x2903('0x2c'),function(){fs[_0x2903('0x76')](_0x3f0e73,parseInt(_0x2903('0x65'),0x8));return db['Sound'][_0x2903('0x59')](_0x43d37c)[_0x2903('0x28')](function(_0x533195){var _0x71f429={'role':_0x367671[_0x2903('0x77')][_0x2903('0x78')],'userProfileId':_0x367671[_0x2903('0x77')][_0x2903('0x79')]};if(!_0x71f429)throw new Error(_0x2903('0x7a'));if(_0x71f429[_0x2903('0x78')]===_0x2903('0x7b')){var _0x318520=_0x533195[_0x2903('0x29')]({'plain':!![]});return db[_0x2903('0x7c')]['find']({'where':{'name':_0x2903('0x2a'),'userProfileId':_0x71f429[_0x2903('0x79')]},'raw':!![]})[_0x2903('0x28')](function(_0x3f9ffd){if(_0x3f9ffd&&_0x3f9ffd[_0x2903('0x7d')]===0x0){return db[_0x2903('0x2b')][_0x2903('0x59')]({'name':_0x318520[_0x2903('0x2f')],'resourceId':_0x318520['id'],'type':_0x3f9ffd[_0x2903('0x2f')],'sectionId':_0x3f9ffd['id']},{})[_0x2903('0x28')](function(){return _0x533195;});}else{return _0x533195;}})[_0x2903('0x49')](function(_0x2f1bae){logger[_0x2903('0x2d')](_0x2903('0x7e'),_0x2f1bae);throw _0x2f1bae;});}return _0x533195;})[_0x2903('0x28')](respondWithResult(_0x395ba1,null))[_0x2903('0x49')](handleError(_0x395ba1,null));});_0x35e191[_0x2903('0x7f')]();}catch(_0x51be07){_0x395ba1[_0x2903('0x1c')](0x1f4)[_0x2903('0x67')](_0x51be07);}};exports[_0x2903('0x26')]=function(_0x431b88,_0x33da37,_0x3bc9db){return db[_0x2903('0x32')]['find']({'where':{'id':_0x431b88[_0x2903('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33da37,null))[_0x2903('0x28')](saveUpdates(_['pick'](_0x431b88['body'],[_0x2903('0x2f'),_0x2903('0x80')]),null))[_0x2903('0x28')](respondWithResult(_0x33da37,null))[_0x2903('0x49')](handleError(_0x33da37,null));};exports[_0x2903('0x81')]=function(_0x2f70ed,_0x391aa3,_0x11c055){return db[_0x2903('0x32')]['find']({'where':{'id':_0x2f70ed[_0x2903('0x4b')]['id']}})[_0x2903('0x28')](function(_0x396036){if(_0x396036){return _0x396036[_0x2903('0x27')]();}})['then'](function(_0x21eac2){var _0xd4fefc=path[_0x2903('0x51')](config['root'],_0x2903('0x61'),util[_0x2903('0x57')](_0x2903('0x58'),_0x21eac2[_0x2903('0x4e')],_0x21eac2[_0x2903('0x82')]));var _0x38d8fd=path[_0x2903('0x51')](config[_0x2903('0x52')],_0x2903('0x53'),util[_0x2903('0x57')]('%s.%s',_0x21eac2[_0x2903('0x4e')],_0x21eac2['converted_format']));fs[_0x2903('0x66')](_0xd4fefc);fs[_0x2903('0x66')](_0x38d8fd);return _0x21eac2;})[_0x2903('0x28')](function(_0x1d55e1){if(_0x1d55e1){return _0x391aa3['status'](0xcc)['end']();}})[_0x2903('0x28')](handleEntityNotFound(_0x391aa3,null))[_0x2903('0x49')](handleError(_0x391aa3,null));}; \ No newline at end of file +var _0xfe91=['unlinkSync','eml-format','rimraf','request-promise','moment','sox','ejs','fs-extra','lodash','squel','crypto','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','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','name','send','index','map','Sound','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','params','find','download','save_name','existsSync','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','join','%s.%s','format','create','basename','file','originalname','extname','substring','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_channelCount','converted_bitRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format'];(function(_0x427e51,_0x3d2c88){var _0x341e36=function(_0x33eabc){while(--_0x33eabc){_0x427e51['push'](_0x427e51['shift']());}};_0x341e36(++_0x3d2c88);}(_0xfe91,0xf9));var _0x1fe9=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0xfe91[_0x39ffd1];return _0x31267e;};'use strict';var emlformat=require(_0x1fe9('0x0'));var rimraf=require(_0x1fe9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1fe9('0x2'));var moment=require(_0x1fe9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1fe9('0x4'));var csv=require('to-csv');var ejs=require(_0x1fe9('0x5'));var fs=require('fs');var fs_extra=require(_0x1fe9('0x6'));var _=require(_0x1fe9('0x7'));var squel=require(_0x1fe9('0x8'));var crypto=require(_0x1fe9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1fe9('0xa'));var toCsv=require(_0x1fe9('0xb'));var querystring=require(_0x1fe9('0xc'));var Papa=require(_0x1fe9('0xd'));var Redis=require(_0x1fe9('0xe'));var authService=require(_0x1fe9('0xf'));var qs=require(_0x1fe9('0x10'));var as=require(_0x1fe9('0x11'));var hardwareService=require(_0x1fe9('0x12'));var logger=require('../../config/logger')(_0x1fe9('0x13'));var utils=require(_0x1fe9('0x14'));var config=require(_0x1fe9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fe9('0x16'))['db'];function respondWithStatusCode(_0x1c94a4,_0x5bc9f3){_0x5bc9f3=_0x5bc9f3||0xcc;return function(_0x1765e0){if(_0x1765e0){return _0x1c94a4['sendStatus'](_0x5bc9f3);}return _0x1c94a4[_0x1fe9('0x17')](_0x5bc9f3)[_0x1fe9('0x18')]();};}function respondWithResult(_0x1b3e23,_0x35b0a9){_0x35b0a9=_0x35b0a9||0xc8;return function(_0x15f61c){if(_0x15f61c){return _0x1b3e23[_0x1fe9('0x17')](_0x35b0a9)['json'](_0x15f61c);}};}function respondWithFilteredResult(_0x9ddafb,_0x2d3a16){return function(_0x1889e4){if(_0x1889e4){var _0x4cbb4b=typeof _0x2d3a16[_0x1fe9('0x19')]===_0x1fe9('0x1a')&&typeof _0x2d3a16['limit']===_0x1fe9('0x1a');var _0x1abc1c=_0x1889e4[_0x1fe9('0x1b')];var _0xfc9af8=_0x4cbb4b?0x0:_0x2d3a16[_0x1fe9('0x19')];var _0x3fdd6b=_0x4cbb4b?_0x1889e4[_0x1fe9('0x1b')]:_0x2d3a16[_0x1fe9('0x19')]+_0x2d3a16[_0x1fe9('0x1c')];var _0x3b0d0;if(_0x3fdd6b>=_0x1abc1c){_0x3fdd6b=_0x1abc1c;_0x3b0d0=0xc8;}else{_0x3b0d0=0xce;}_0x9ddafb['status'](_0x3b0d0);return _0x9ddafb[_0x1fe9('0x1d')](_0x1fe9('0x1e'),_0xfc9af8+'-'+_0x3fdd6b+'/'+_0x1abc1c)['json'](_0x1889e4);}return null;};}function patchUpdates(_0x2029f0){return function(_0x1fd5e5){try{jsonpatch[_0x1fe9('0x1f')](_0x1fd5e5,_0x2029f0,!![]);}catch(_0x219154){return BPromise[_0x1fe9('0x20')](_0x219154);}return _0x1fd5e5[_0x1fe9('0x21')]();};}function saveUpdates(_0x3f3009,_0x7db33){return function(_0x28c9a3){if(_0x28c9a3){return _0x28c9a3[_0x1fe9('0x22')](_0x3f3009)[_0x1fe9('0x23')](function(_0x3ff4ed){return _0x3ff4ed;});}return null;};}function removeEntity(_0x5ea846,_0x1994f3){return function(_0x5a16f2){if(_0x5a16f2){return _0x5a16f2[_0x1fe9('0x24')]()[_0x1fe9('0x23')](function(){var _0x1a6d47=_0x5a16f2[_0x1fe9('0x25')]({'plain':!![]});var _0x8dd9dc=_0x1fe9('0x26');return db[_0x1fe9('0x27')][_0x1fe9('0x24')]({'where':{'type':_0x8dd9dc,'resourceId':_0x1a6d47['id']}})['then'](function(){return _0x5a16f2;});})['then'](function(){_0x5ea846[_0x1fe9('0x17')](0xcc)[_0x1fe9('0x18')]();});}};}function handleEntityNotFound(_0x417bcf,_0x9a0155){return function(_0x5d16c9){if(!_0x5d16c9){_0x417bcf[_0x1fe9('0x28')](0x194);}return _0x5d16c9;};}function handleError(_0x437135,_0x58965a){_0x58965a=_0x58965a||0x1f4;return function(_0x335f4d){logger[_0x1fe9('0x29')](_0x335f4d['stack']);if(_0x335f4d[_0x1fe9('0x2a')]){delete _0x335f4d[_0x1fe9('0x2a')];}_0x437135[_0x1fe9('0x17')](_0x58965a)[_0x1fe9('0x2b')](_0x335f4d);};}exports[_0x1fe9('0x2c')]=function(_0x1cf4da,_0x3cc593){var _0x530b47={},_0x56fea7={},_0x29ee73={'count':0x0,'rows':[]};var _0x24d624=_[_0x1fe9('0x2d')](db[_0x1fe9('0x2e')][_0x1fe9('0x2f')],function(_0x20efa5){return{'name':_0x20efa5[_0x1fe9('0x30')],'type':_0x20efa5['type'][_0x1fe9('0x31')]};});_0x56fea7[_0x1fe9('0x32')]=_['map'](_0x24d624,_0x1fe9('0x2a'));_0x56fea7['query']=_[_0x1fe9('0x33')](_0x1cf4da['query']);_0x56fea7[_0x1fe9('0x34')]=_['intersection'](_0x56fea7[_0x1fe9('0x32')],_0x56fea7[_0x1fe9('0x35')]);_0x530b47[_0x1fe9('0x36')]=_[_0x1fe9('0x37')](_0x56fea7['model'],qs[_0x1fe9('0x38')](_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x38')]));_0x530b47[_0x1fe9('0x36')]=_0x530b47[_0x1fe9('0x36')][_0x1fe9('0x39')]?_0x530b47[_0x1fe9('0x36')]:_0x56fea7[_0x1fe9('0x32')];if(!_0x1cf4da['query'][_0x1fe9('0x3a')](_0x1fe9('0x3b'))){_0x530b47['limit']=qs['limit'](_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x1c')]);_0x530b47[_0x1fe9('0x19')]=qs[_0x1fe9('0x19')](_0x1cf4da['query'][_0x1fe9('0x19')]);}_0x530b47[_0x1fe9('0x3c')]=qs['sort'](_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x3d')]);_0x530b47[_0x1fe9('0x3e')]=qs[_0x1fe9('0x34')](_[_0x1fe9('0x3f')](_0x1cf4da[_0x1fe9('0x35')],_0x56fea7[_0x1fe9('0x34')]),_0x24d624);if(_0x1cf4da['query'][_0x1fe9('0x40')]){_0x530b47[_0x1fe9('0x3e')]=_[_0x1fe9('0x41')](_0x530b47[_0x1fe9('0x3e')],{'$or':_[_0x1fe9('0x2d')](_0x24d624,function(_0x5820c1){if(_0x5820c1[_0x1fe9('0x42')]!=='VIRTUAL'){var _0x500226={};_0x500226[_0x5820c1[_0x1fe9('0x2a')]]={'$like':'%'+_0x1cf4da[_0x1fe9('0x35')]['filter']+'%'};return _0x500226;}})});}_0x530b47=_[_0x1fe9('0x41')]({},_0x530b47,_0x1cf4da[_0x1fe9('0x43')]);var _0x50ec21={'where':_0x530b47[_0x1fe9('0x3e')]};return db[_0x1fe9('0x2e')][_0x1fe9('0x1b')](_0x50ec21)['then'](function(_0x4fa477){_0x29ee73[_0x1fe9('0x1b')]=_0x4fa477;if(_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x44')]){_0x530b47[_0x1fe9('0x45')]=[{'all':!![]}];}return db[_0x1fe9('0x2e')]['findAll'](_0x530b47);})['then'](function(_0x4ff192){_0x29ee73[_0x1fe9('0x46')]=_0x4ff192;return _0x29ee73;})[_0x1fe9('0x23')](respondWithFilteredResult(_0x3cc593,_0x530b47))[_0x1fe9('0x47')](handleError(_0x3cc593,null));};exports['show']=function(_0x50b4ab,_0x5d3062){var _0x17a6c4={'raw':!![],'where':{'id':_0x50b4ab[_0x1fe9('0x48')]['id']}},_0x2acc7f={};_0x2acc7f[_0x1fe9('0x32')]=_[_0x1fe9('0x33')](db[_0x1fe9('0x2e')]['rawAttributes']);_0x2acc7f[_0x1fe9('0x35')]=_['keys'](_0x50b4ab['query']);_0x2acc7f[_0x1fe9('0x34')]=_['intersection'](_0x2acc7f[_0x1fe9('0x32')],_0x2acc7f[_0x1fe9('0x35')]);_0x17a6c4['attributes']=_[_0x1fe9('0x37')](_0x2acc7f['model'],qs['fields'](_0x50b4ab[_0x1fe9('0x35')][_0x1fe9('0x38')]));_0x17a6c4[_0x1fe9('0x36')]=_0x17a6c4[_0x1fe9('0x36')][_0x1fe9('0x39')]?_0x17a6c4['attributes']:_0x2acc7f['model'];if(_0x50b4ab[_0x1fe9('0x35')][_0x1fe9('0x44')]){_0x17a6c4[_0x1fe9('0x45')]=[{'all':!![]}];}_0x17a6c4=_[_0x1fe9('0x41')]({},_0x17a6c4,_0x50b4ab[_0x1fe9('0x43')]);return db['Sound'][_0x1fe9('0x49')](_0x17a6c4)['then'](handleEntityNotFound(_0x5d3062,null))[_0x1fe9('0x23')](respondWithResult(_0x5d3062,null))[_0x1fe9('0x47')](handleError(_0x5d3062,null));};exports[_0x1fe9('0x4a')]=function(_0x4f37b2,_0x11daa5,_0x3e7f9c){return db[_0x1fe9('0x2e')][_0x1fe9('0x49')]({'where':{'id':_0x4f37b2['params']['id']},'attributes':['name',_0x1fe9('0x4b'),'converted_format'],'raw':!![]})[_0x1fe9('0x23')](handleEntityNotFound(_0x11daa5,null))[_0x1fe9('0x23')](function(_0x1a16f2){if(_0x1a16f2){if(!fs[_0x1fe9('0x4c')](path['join'](config[_0x1fe9('0x4d')],_0x1fe9('0x4e'),_0x1a16f2['save_name']+'.'+_0x1a16f2[_0x1fe9('0x4f')]))){throw new db[(_0x1fe9('0x50'))][(_0x1fe9('0x51'))]('Sound\x20not\x20found');}return _0x11daa5[_0x1fe9('0x4a')](path[_0x1fe9('0x52')](config[_0x1fe9('0x4d')],_0x1fe9('0x4e'),util['format'](_0x1fe9('0x53'),_0x1a16f2[_0x1fe9('0x4b')],_0x1a16f2['converted_format'])),util[_0x1fe9('0x54')](_0x1fe9('0x53'),_0x1a16f2['name'],_0x1a16f2[_0x1fe9('0x4f')]));}return null;})[_0x1fe9('0x47')](handleError(_0x11daa5,null));};exports[_0x1fe9('0x55')]=function(_0x2bba8b,_0x389e16,_0x2c4e00){var _0x32df68={'name':path[_0x1fe9('0x56')](_0x2bba8b[_0x1fe9('0x57')][_0x1fe9('0x58')],path[_0x1fe9('0x59')](_0x2bba8b['file'][_0x1fe9('0x58')])),'save_name':path[_0x1fe9('0x56')](_0x2bba8b[_0x1fe9('0x57')]['filename'],path[_0x1fe9('0x59')](_0x2bba8b[_0x1fe9('0x57')]['filename'])),'original_format':path['extname'](_0x2bba8b['file'][_0x1fe9('0x58')])[_0x1fe9('0x5a')](0x1),'converted_format':'wav'};var _0x321466=path[_0x1fe9('0x52')](config['root'],_0x1fe9('0x5b'),_0x2bba8b[_0x1fe9('0x57')]['filename']);var _0x17a87a=path[_0x1fe9('0x52')](config['root'],'server/files/sounds/converted',util[_0x1fe9('0x54')](_0x1fe9('0x53'),path['basename'](_0x2bba8b['file'][_0x1fe9('0x5c')],path[_0x1fe9('0x59')](_0x2bba8b['file']['filename'])),_0x32df68['converted_format']));logger[_0x1fe9('0x5d')](_0x1fe9('0x5e'),_0x321466);logger[_0x1fe9('0x5d')](_0x1fe9('0x5f'),_0x17a87a);try{fs[_0x1fe9('0x60')](_0x321466,parseInt(_0x1fe9('0x61'),0x8));var _0x4061eb=sox['transcode'](_0x321466,_0x17a87a,{'sampleRate':0x1f40,'format':_0x1fe9('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4061eb['on'](_0x1fe9('0x29'),function(_0x4a480d){fs['unlinkSync'](_0x321466);_0x389e16['status'](0x1f4)['send'](_0x4a480d);});_0x4061eb['on'](_0x1fe9('0x63'),function(_0x2fd6c9){_0x32df68[_0x1fe9('0x64')]=isNaN(_0x2fd6c9[_0x1fe9('0x65')])?null:_0x2fd6c9[_0x1fe9('0x65')]*0x3e8;_0x32df68[_0x1fe9('0x66')]=isNaN(_0x2fd6c9['sampleCount'])?null:_0x2fd6c9[_0x1fe9('0x67')];_0x32df68['original_channelCount']=isNaN(_0x2fd6c9['channelCount'])?null:_0x2fd6c9[_0x1fe9('0x68')];_0x32df68[_0x1fe9('0x69')]=isNaN(_0x2fd6c9[_0x1fe9('0x6a')])?null:_0x2fd6c9[_0x1fe9('0x6a')];_0x32df68[_0x1fe9('0x6b')]=isNaN(_0x2fd6c9['sampleRate'])?null:_0x2fd6c9[_0x1fe9('0x6c')];});_0x4061eb['on']('dest',function(_0x30f5ba){_0x32df68[_0x1fe9('0x6d')]=isNaN(_0x30f5ba[_0x1fe9('0x65')])?null:_0x30f5ba[_0x1fe9('0x65')]*0x3e8;_0x32df68['converted_sampleCount']=isNaN(_0x30f5ba[_0x1fe9('0x67')])?null:_0x30f5ba[_0x1fe9('0x67')];_0x32df68[_0x1fe9('0x6e')]=isNaN(_0x30f5ba[_0x1fe9('0x68')])?null:_0x30f5ba['channelCount'];_0x32df68[_0x1fe9('0x6f')]=isNaN(_0x30f5ba['bitRate'])?null:_0x30f5ba[_0x1fe9('0x6a')];_0x32df68['converted_sampleRate']=isNaN(_0x30f5ba[_0x1fe9('0x6c')])?null:_0x30f5ba[_0x1fe9('0x6c')];});_0x4061eb['on'](_0x1fe9('0x18'),function(){fs['chmodSync'](_0x17a87a,parseInt(_0x1fe9('0x61'),0x8));return db[_0x1fe9('0x2e')][_0x1fe9('0x55')](_0x32df68)[_0x1fe9('0x23')](function(_0x49599c){var _0x31a8be={'role':_0x2bba8b[_0x1fe9('0x70')][_0x1fe9('0x71')],'userProfileId':_0x2bba8b[_0x1fe9('0x70')]['userProfileId']};if(!_0x31a8be)throw new Error(_0x1fe9('0x72'));if(_0x31a8be[_0x1fe9('0x71')]===_0x1fe9('0x73')){var _0x370e69=_0x49599c[_0x1fe9('0x25')]({'plain':!![]});return db[_0x1fe9('0x74')][_0x1fe9('0x49')]({'where':{'name':_0x1fe9('0x26'),'userProfileId':_0x31a8be[_0x1fe9('0x75')]},'raw':!![]})[_0x1fe9('0x23')](function(_0x480633){if(_0x480633&&_0x480633[_0x1fe9('0x76')]===0x0){return db[_0x1fe9('0x27')][_0x1fe9('0x55')]({'name':_0x370e69['name'],'resourceId':_0x370e69['id'],'type':_0x480633[_0x1fe9('0x2a')],'sectionId':_0x480633['id']},{})[_0x1fe9('0x23')](function(){return _0x49599c;});}else{return _0x49599c;}})['catch'](function(_0x341fd6){logger[_0x1fe9('0x29')](_0x1fe9('0x77'),_0x341fd6);throw _0x341fd6;});}return _0x49599c;})[_0x1fe9('0x23')](respondWithResult(_0x389e16,null))['catch'](handleError(_0x389e16,null));});_0x4061eb['start']();}catch(_0x1efad5){_0x389e16['status'](0x1f4)[_0x1fe9('0x2b')](_0x1efad5);}};exports[_0x1fe9('0x22')]=function(_0x1ec9d6,_0xb5d6d0,_0xb3f35c){return db[_0x1fe9('0x2e')][_0x1fe9('0x49')]({'where':{'id':_0x1ec9d6[_0x1fe9('0x48')]['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0xb5d6d0,null))[_0x1fe9('0x23')](saveUpdates(_['pick'](_0x1ec9d6[_0x1fe9('0x70')],['name',_0x1fe9('0x78')]),null))['then'](respondWithResult(_0xb5d6d0,null))['catch'](handleError(_0xb5d6d0,null));};exports[_0x1fe9('0x79')]=function(_0x1753b8,_0x1acfb6,_0x43bb59){return db[_0x1fe9('0x2e')][_0x1fe9('0x49')]({'where':{'id':_0x1753b8[_0x1fe9('0x48')]['id']}})[_0x1fe9('0x23')](function(_0x58745b){if(_0x58745b){return _0x58745b[_0x1fe9('0x24')]();}})[_0x1fe9('0x23')](function(_0xf7cc77){var _0x12da8f=path[_0x1fe9('0x52')](config[_0x1fe9('0x4d')],_0x1fe9('0x5b'),util[_0x1fe9('0x54')]('%s.%s',_0xf7cc77['save_name'],_0xf7cc77[_0x1fe9('0x7a')]));var _0x6a3591=path['join'](config[_0x1fe9('0x4d')],'server/files/sounds/converted',util[_0x1fe9('0x54')](_0x1fe9('0x53'),_0xf7cc77['save_name'],_0xf7cc77[_0x1fe9('0x4f')]));fs[_0x1fe9('0x7b')](_0x12da8f);fs['unlinkSync'](_0x6a3591);return _0xf7cc77;})[_0x1fe9('0x23')](function(_0x4e55fa){if(_0x4e55fa){return _0x1acfb6['status'](0xcc)[_0x1fe9('0x18')]();}})[_0x1fe9('0x23')](handleEntityNotFound(_0x1acfb6,null))[_0x1fe9('0x47')](handleError(_0x1acfb6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 3cac126..740dbc5 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 _0x4c5d=['path','rimraf','../../config/environment','./sound.attributes','exports','tools_sounds','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x330153,_0x4461c2){var _0x79c88d=function(_0x2d1285){while(--_0x2d1285){_0x330153['push'](_0x330153['shift']());}};_0x79c88d(++_0x4461c2);}(_0x4c5d,0x1aa));var _0xd4c5=function(_0xa4ffc9,_0x274cbe){_0xa4ffc9=_0xa4ffc9-0x0;var _0x46265f=_0x4c5d[_0xa4ffc9];return _0x46265f;};'use strict';var _=require(_0xd4c5('0x0'));var util=require(_0xd4c5('0x1'));var logger=require(_0xd4c5('0x2'))(_0xd4c5('0x3'));var moment=require('moment');var BPromise=require(_0xd4c5('0x4'));var rp=require(_0xd4c5('0x5'));var fs=require('fs');var path=require(_0xd4c5('0x6'));var rimraf=require(_0xd4c5('0x7'));var config=require(_0xd4c5('0x8'));var attributes=require(_0xd4c5('0x9'));module[_0xd4c5('0xa')]=function(_0x261e7e,_0xbc7ce0){return _0x261e7e['define']('Sound',attributes,{'tableName':_0xd4c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5587=['../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4b2331,_0x3dcd93){var _0x3005df=function(_0x47f6a7){while(--_0x47f6a7){_0x4b2331['push'](_0x4b2331['shift']());}};_0x3005df(++_0x3dcd93);}(_0x5587,0x132));var _0x7558=function(_0x174a72,_0x2d395e){_0x174a72=_0x174a72-0x0;var _0x2135a9=_0x5587[_0x174a72];return _0x2135a9;};'use strict';var _=require(_0x7558('0x0'));var util=require('util');var logger=require(_0x7558('0x1'))('api');var moment=require(_0x7558('0x2'));var BPromise=require(_0x7558('0x3'));var rp=require(_0x7558('0x4'));var fs=require('fs');var path=require(_0x7558('0x5'));var rimraf=require('rimraf');var config=require(_0x7558('0x6'));var attributes=require(_0x7558('0x7'));module[_0x7558('0x8')]=function(_0x8540c1,_0x37e37a){return _0x8540c1[_0x7558('0x9')](_0x7558('0xa'),attributes,{'tableName':_0x7558('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 56ffe5f..e749deb 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 _0xc2cd=['../../config/utils','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','attributes','include','model','map','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1b98ca,_0x455f53){var _0x2b95db=function(_0xa72a8f){while(--_0xa72a8f){_0x1b98ca['push'](_0x1b98ca['shift']());}};_0x2b95db(++_0x455f53);}(_0xc2cd,0x126));var _0xdc2c=function(_0x526463,_0x1c1a49){_0x526463=_0x526463-0x0;var _0x4431ce=_0xc2cd[_0x526463];return _0x4431ce;};'use strict';var _=require(_0xdc2c('0x0'));var util=require(_0xdc2c('0x1'));var moment=require(_0xdc2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc2c('0x3'));var fs=require('fs');var Redis=require(_0xdc2c('0x4'));var db=require(_0xdc2c('0x5'))['db'];var utils=require(_0xdc2c('0x6'));var logger=require('../../config/logger')(_0xdc2c('0x7'));var config=require(_0xdc2c('0x8'));var jayson=require(_0xdc2c('0x9'));var client=jayson['client'][_0xdc2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df293,_0x542560,_0x547218){return new BPromise(function(_0x5c4586,_0x2665f7){return client['request'](_0x3df293,_0x547218)['then'](function(_0x51dc6e){logger[_0xdc2c('0xb')](_0xdc2c('0xc'),_0x542560,'request\x20sent');logger[_0xdc2c('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x542560,_0xdc2c('0xe'),JSON[_0xdc2c('0xf')](_0x51dc6e));if(_0x51dc6e[_0xdc2c('0x10')]){if(_0x51dc6e['error'][_0xdc2c('0x11')]===0x1f4){logger[_0xdc2c('0x10')](_0xdc2c('0xc'),_0x542560,_0x51dc6e[_0xdc2c('0x10')][_0xdc2c('0x12')]);return _0x2665f7(_0x51dc6e[_0xdc2c('0x10')][_0xdc2c('0x12')]);}logger[_0xdc2c('0x10')](_0xdc2c('0xc'),_0x542560,_0x51dc6e[_0xdc2c('0x10')]['message']);return _0x5c4586(_0x51dc6e['error'][_0xdc2c('0x12')]);}else{logger['info'](_0xdc2c('0xc'),_0x542560,_0xdc2c('0xe'));_0x5c4586(_0x51dc6e[_0xdc2c('0x13')][_0xdc2c('0x12')]);}})[_0xdc2c('0x14')](function(_0x3e2cf9){logger['error']('Sound,\x20%s,\x20%s',_0x542560,_0x3e2cf9);_0x2665f7(_0x3e2cf9);});});}exports[_0xdc2c('0x15')]=function(_0x103870){var _0x58a00a=this;return new Promise(function(_0x412abf,_0x1d157a){return db[_0xdc2c('0x16')][_0xdc2c('0x17')]({'raw':_0x103870[_0xdc2c('0x18')]?_0x103870['options']['raw']===undefined?!![]:![]:!![],'where':_0x103870[_0xdc2c('0x18')]?_0x103870[_0xdc2c('0x18')][_0xdc2c('0x19')]||null:null,'attributes':_0x103870['options']?_0x103870[_0xdc2c('0x18')][_0xdc2c('0x1a')]||null:null,'include':_0x103870[_0xdc2c('0x18')]?_0x103870[_0xdc2c('0x18')][_0xdc2c('0x1b')]?_['map'](_0x103870['options'][_0xdc2c('0x1b')],function(_0x308c3c){return{'model':db[_0x308c3c[_0xdc2c('0x1c')]],'as':_0x308c3c['as'],'attributes':_0x308c3c[_0xdc2c('0x1a')],'include':_0x308c3c[_0xdc2c('0x1b')]?_[_0xdc2c('0x1d')](_0x308c3c['include'],function(_0x5a0dca){return{'model':db[_0x5a0dca[_0xdc2c('0x1c')]],'as':_0x5a0dca['as'],'attributes':_0x5a0dca['attributes'],'include':_0x5a0dca[_0xdc2c('0x1b')]?_[_0xdc2c('0x1d')](_0x5a0dca['include'],function(_0x513481){return{'model':db[_0x513481[_0xdc2c('0x1c')]],'as':_0x513481['as'],'attributes':_0x513481[_0xdc2c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fa643){logger[_0xdc2c('0xb')](_0xdc2c('0x15'),_0x103870);logger[_0xdc2c('0xd')](_0xdc2c('0x15'),_0x103870,JSON[_0xdc2c('0xf')](_0x2fa643));_0x412abf(_0x2fa643);})[_0xdc2c('0x14')](function(_0x505b59){logger[_0xdc2c('0x10')]('ShowSound',_0x505b59[_0xdc2c('0x12')],_0x103870);_0x1d157a(_0x58a00a[_0xdc2c('0x10')](0x1f4,_0x505b59[_0xdc2c('0x12')]));});});}; \ No newline at end of file +var _0xd9c7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','util','moment'];(function(_0x57ceb7,_0x244640){var _0x3ccc91=function(_0x20071a){while(--_0x20071a){_0x57ceb7['push'](_0x57ceb7['shift']());}};_0x3ccc91(++_0x244640);}(_0xd9c7,0x13e));var _0x7d9c=function(_0x11f226,_0x963733){_0x11f226=_0x11f226-0x0;var _0x408874=_0xd9c7[_0x11f226];return _0x408874;};'use strict';var _=require('lodash');var util=require(_0x7d9c('0x0'));var moment=require(_0x7d9c('0x1'));var BPromise=require(_0x7d9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d9c('0x3'));var db=require(_0x7d9c('0x4'))['db'];var utils=require(_0x7d9c('0x5'));var logger=require(_0x7d9c('0x6'))(_0x7d9c('0x7'));var config=require(_0x7d9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d9c('0x9')][_0x7d9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56cada,_0x353a11,_0x49ddc8){return new BPromise(function(_0x42876b,_0x8620c2){return client['request'](_0x56cada,_0x49ddc8)[_0x7d9c('0xb')](function(_0x3e3961){logger['info'](_0x7d9c('0xc'),_0x353a11,_0x7d9c('0xd'));logger[_0x7d9c('0xe')](_0x7d9c('0xf'),_0x353a11,'request\x20sent',JSON[_0x7d9c('0x10')](_0x3e3961));if(_0x3e3961[_0x7d9c('0x11')]){if(_0x3e3961[_0x7d9c('0x11')][_0x7d9c('0x12')]===0x1f4){logger[_0x7d9c('0x11')](_0x7d9c('0xc'),_0x353a11,_0x3e3961[_0x7d9c('0x11')][_0x7d9c('0x13')]);return _0x8620c2(_0x3e3961['error'][_0x7d9c('0x13')]);}logger[_0x7d9c('0x11')](_0x7d9c('0xc'),_0x353a11,_0x3e3961['error']['message']);return _0x42876b(_0x3e3961[_0x7d9c('0x11')][_0x7d9c('0x13')]);}else{logger[_0x7d9c('0x14')](_0x7d9c('0xc'),_0x353a11,_0x7d9c('0xd'));_0x42876b(_0x3e3961[_0x7d9c('0x15')][_0x7d9c('0x13')]);}})[_0x7d9c('0x16')](function(_0x3ae30){logger[_0x7d9c('0x11')](_0x7d9c('0xc'),_0x353a11,_0x3ae30);_0x8620c2(_0x3ae30);});});}exports[_0x7d9c('0x17')]=function(_0x485740){var _0xf626fc=this;return new Promise(function(_0x346fd3,_0x14940e){return db['Sound'][_0x7d9c('0x18')]({'raw':_0x485740['options']?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1a')]===undefined?!![]:![]:!![],'where':_0x485740[_0x7d9c('0x19')]?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1b')]||null:null,'attributes':_0x485740[_0x7d9c('0x19')]?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1c')]||null:null,'include':_0x485740[_0x7d9c('0x19')]?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1d')]?_[_0x7d9c('0x1e')](_0x485740['options'][_0x7d9c('0x1d')],function(_0x5a5e14){return{'model':db[_0x5a5e14['model']],'as':_0x5a5e14['as'],'attributes':_0x5a5e14[_0x7d9c('0x1c')],'include':_0x5a5e14[_0x7d9c('0x1d')]?_[_0x7d9c('0x1e')](_0x5a5e14[_0x7d9c('0x1d')],function(_0x2f3e72){return{'model':db[_0x2f3e72[_0x7d9c('0x1f')]],'as':_0x2f3e72['as'],'attributes':_0x2f3e72[_0x7d9c('0x1c')],'include':_0x2f3e72[_0x7d9c('0x1d')]?_['map'](_0x2f3e72['include'],function(_0x23be7f){return{'model':db[_0x23be7f[_0x7d9c('0x1f')]],'as':_0x23be7f['as'],'attributes':_0x23be7f[_0x7d9c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7d9c('0xb')](function(_0x518890){logger[_0x7d9c('0x14')](_0x7d9c('0x17'),_0x485740);logger['debug'](_0x7d9c('0x17'),_0x485740,JSON['stringify'](_0x518890));_0x346fd3(_0x518890);})['catch'](function(_0x3b79f5){logger[_0x7d9c('0x11')](_0x7d9c('0x17'),_0x3b79f5[_0x7d9c('0x13')],_0x485740);_0x14940e(_0xf626fc[_0x7d9c('0x11')](0x1f4,_0x3b79f5[_0x7d9c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 10a7229..567d6ff 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(_0x4834c7,_0x320620){var _0x597940=function(_0x58ece4){while(--_0x58ece4){_0x4834c7['push'](_0x4834c7['shift']());}};_0x597940(++_0x320620);}(_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('./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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x54445f,_0x37ee99){var _0xfcb525=function(_0x3dfbd1){while(--_0x3dfbd1){_0x54445f['push'](_0x54445f['shift']());}};_0xfcb525(++_0x37ee99);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 9769178..96d1cf7 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 _0x2891=['ENUM','out','exports','STRING','TEXT','medium'];(function(_0x26a933,_0x218e0f){var _0x1720e7=function(_0x5e0fc3){while(--_0x5e0fc3){_0x26a933['push'](_0x26a933['shift']());}};_0x1720e7(++_0x218e0f);}(_0x2891,0x1f4));var _0x1289=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2891[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x1289('0x0')]={'uniqueid':{'type':Sequelize[_0x1289('0x1')]},'body':{'type':Sequelize[_0x1289('0x2')](_0x1289('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x1289('0x4')]('in',_0x1289('0x5')),'defaultValue':_0x1289('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x1289('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8958=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x8958,0x1a0));var _0x8895=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0x8958[_0x90f34f];return _0x4b18cf;};'use strict';var Sequelize=require(_0x8895('0x0'));module[_0x8895('0x1')]={'uniqueid':{'type':Sequelize[_0x8895('0x2')]},'body':{'type':Sequelize[_0x8895('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x8895('0x4')]('in',_0x8895('0x5')),'defaultValue':_0x8895('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x8895('0x2')]},'providerResponse':{'type':Sequelize[_0x8895('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 4ab93d5..25a7bab 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 _0x5da3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','SquareMessage','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','rimraf'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0x5da3,0x123));var _0x35da=function(_0x37bfba,_0x39a80e){_0x37bfba=_0x37bfba-0x0;var _0x2d2e6e=_0x5da3[_0x37bfba];return _0x2d2e6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35da('0x0'));var zipdir=require(_0x35da('0x1'));var jsonpatch=require(_0x35da('0x2'));var rp=require(_0x35da('0x3'));var moment=require(_0x35da('0x4'));var BPromise=require(_0x35da('0x5'));var Mustache=require(_0x35da('0x6'));var util=require(_0x35da('0x7'));var path=require('path');var sox=require(_0x35da('0x8'));var csv=require(_0x35da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35da('0xa'));var _=require(_0x35da('0xb'));var squel=require(_0x35da('0xc'));var crypto=require(_0x35da('0xd'));var jsforce=require(_0x35da('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x35da('0xf'));var Papa=require(_0x35da('0x10'));var Redis=require(_0x35da('0x11'));var authService=require(_0x35da('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x35da('0x13'));var hardwareService=require(_0x35da('0x14'));var logger=require(_0x35da('0x15'))(_0x35da('0x16'));var utils=require(_0x35da('0x17'));var config=require(_0x35da('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x35da('0x19'))['db'];function respondWithStatusCode(_0x4e5d90,_0x4b21f1){_0x4b21f1=_0x4b21f1||0xcc;return function(_0x453230){if(_0x453230){return _0x4e5d90[_0x35da('0x1a')](_0x4b21f1);}return _0x4e5d90[_0x35da('0x1b')](_0x4b21f1)[_0x35da('0x1c')]();};}function respondWithResult(_0x340ee3,_0x2fc8ef){_0x2fc8ef=_0x2fc8ef||0xc8;return function(_0x564238){if(_0x564238){return _0x340ee3[_0x35da('0x1b')](_0x2fc8ef)[_0x35da('0x1d')](_0x564238);}};}function respondWithFilteredResult(_0x2993c7,_0x7eff42){return function(_0x332dc8){if(_0x332dc8){var _0x2e56db=typeof _0x7eff42[_0x35da('0x1e')]===_0x35da('0x1f')&&typeof _0x7eff42['limit']===_0x35da('0x1f');var _0x3079d3=_0x332dc8[_0x35da('0x20')];var _0x2d5b2f=_0x2e56db?0x0:_0x7eff42[_0x35da('0x1e')];var _0x140d2e=_0x2e56db?_0x332dc8[_0x35da('0x20')]:_0x7eff42[_0x35da('0x1e')]+_0x7eff42['limit'];var _0x8428b1;if(_0x140d2e>=_0x3079d3){_0x140d2e=_0x3079d3;_0x8428b1=0xc8;}else{_0x8428b1=0xce;}_0x2993c7[_0x35da('0x1b')](_0x8428b1);return _0x2993c7[_0x35da('0x21')](_0x35da('0x22'),_0x2d5b2f+'-'+_0x140d2e+'/'+_0x3079d3)[_0x35da('0x1d')](_0x332dc8);}return null;};}function patchUpdates(_0x3f83ca){return function(_0x175874){try{jsonpatch[_0x35da('0x23')](_0x175874,_0x3f83ca,!![]);}catch(_0x105bf1){return BPromise[_0x35da('0x24')](_0x105bf1);}return _0x175874[_0x35da('0x25')]();};}function saveUpdates(_0x42d1e1,_0x357693){return function(_0x17b1bd){if(_0x17b1bd){return _0x17b1bd[_0x35da('0x26')](_0x42d1e1)[_0x35da('0x27')](function(_0x3b9221){return _0x3b9221;});}return null;};}function removeEntity(_0x3c2d5f,_0x45415f){return function(_0x2bc4f8){if(_0x2bc4f8){return _0x2bc4f8['destroy']()[_0x35da('0x27')](function(){_0x3c2d5f[_0x35da('0x1b')](0xcc)[_0x35da('0x1c')]();});}};}function handleEntityNotFound(_0x96b758,_0x5044ae){return function(_0x55a4f5){if(!_0x55a4f5){_0x96b758[_0x35da('0x1a')](0x194);}return _0x55a4f5;};}function handleError(_0x252b0e,_0xbcfda2){_0xbcfda2=_0xbcfda2||0x1f4;return function(_0x4f0b9e){logger['error'](_0x4f0b9e[_0x35da('0x28')]);if(_0x4f0b9e['name']){delete _0x4f0b9e[_0x35da('0x29')];}_0x252b0e['status'](_0xbcfda2)['send'](_0x4f0b9e);};}exports[_0x35da('0x2a')]=function(_0x38d3fc,_0x2d3ca2){var _0x4c2746={},_0x2d03f6={},_0x2805dd={'count':0x0,'rows':[]};var _0xeb6cae=_[_0x35da('0x2b')](db[_0x35da('0x2c')][_0x35da('0x2d')],function(_0x14b23e){return{'name':_0x14b23e['fieldName'],'type':_0x14b23e[_0x35da('0x2e')]['key']};});_0x2d03f6[_0x35da('0x2f')]=_[_0x35da('0x2b')](_0xeb6cae,_0x35da('0x29'));_0x2d03f6['query']=_[_0x35da('0x30')](_0x38d3fc[_0x35da('0x31')]);_0x2d03f6[_0x35da('0x32')]=_[_0x35da('0x33')](_0x2d03f6[_0x35da('0x2f')],_0x2d03f6[_0x35da('0x31')]);_0x4c2746[_0x35da('0x34')]=_[_0x35da('0x33')](_0x2d03f6[_0x35da('0x2f')],qs['fields'](_0x38d3fc['query'][_0x35da('0x35')]));_0x4c2746[_0x35da('0x34')]=_0x4c2746[_0x35da('0x34')][_0x35da('0x36')]?_0x4c2746['attributes']:_0x2d03f6[_0x35da('0x2f')];if(!_0x38d3fc[_0x35da('0x31')][_0x35da('0x37')]('nolimit')){_0x4c2746[_0x35da('0x38')]=qs[_0x35da('0x38')](_0x38d3fc[_0x35da('0x31')][_0x35da('0x38')]);_0x4c2746['offset']=qs[_0x35da('0x1e')](_0x38d3fc[_0x35da('0x31')]['offset']);}_0x4c2746[_0x35da('0x39')]=qs[_0x35da('0x3a')](_0x38d3fc[_0x35da('0x31')][_0x35da('0x3a')]);_0x4c2746[_0x35da('0x3b')]=qs[_0x35da('0x32')](_['pick'](_0x38d3fc[_0x35da('0x31')],_0x2d03f6['filters']),_0xeb6cae);if(_0x38d3fc[_0x35da('0x31')][_0x35da('0x3c')]){_0x4c2746['where']=_[_0x35da('0x3d')](_0x4c2746[_0x35da('0x3b')],{'$or':_['map'](_0xeb6cae,function(_0xc69c53){if(_0xc69c53['type']!=='VIRTUAL'){var _0x503156={};_0x503156[_0xc69c53[_0x35da('0x29')]]={'$like':'%'+_0x38d3fc[_0x35da('0x31')][_0x35da('0x3c')]+'%'};return _0x503156;}})});}_0x4c2746=_[_0x35da('0x3d')]({},_0x4c2746,_0x38d3fc['options']);var _0x3cdcaf={'where':_0x4c2746[_0x35da('0x3b')]};return db[_0x35da('0x2c')][_0x35da('0x20')](_0x3cdcaf)[_0x35da('0x27')](function(_0x37c1f1){_0x2805dd[_0x35da('0x20')]=_0x37c1f1;if(_0x38d3fc[_0x35da('0x31')][_0x35da('0x3e')]){_0x4c2746[_0x35da('0x3f')]=[{'all':!![]}];}return db[_0x35da('0x2c')][_0x35da('0x40')](_0x4c2746);})['then'](function(_0x2f4b2c){_0x2805dd[_0x35da('0x41')]=_0x2f4b2c;return _0x2805dd;})[_0x35da('0x27')](respondWithFilteredResult(_0x2d3ca2,_0x4c2746))[_0x35da('0x42')](handleError(_0x2d3ca2,null));};exports[_0x35da('0x43')]=function(_0x54df29,_0x1f121f){var _0x2b8390={'raw':!![],'where':{'id':_0x54df29[_0x35da('0x44')]['id']}},_0x57b9c2={};_0x57b9c2[_0x35da('0x2f')]=_['keys'](db[_0x35da('0x2c')][_0x35da('0x2d')]);_0x57b9c2[_0x35da('0x31')]=_[_0x35da('0x30')](_0x54df29[_0x35da('0x31')]);_0x57b9c2['filters']=_['intersection'](_0x57b9c2[_0x35da('0x2f')],_0x57b9c2[_0x35da('0x31')]);_0x2b8390[_0x35da('0x34')]=_[_0x35da('0x33')](_0x57b9c2[_0x35da('0x2f')],qs[_0x35da('0x35')](_0x54df29['query'][_0x35da('0x35')]));_0x2b8390[_0x35da('0x34')]=_0x2b8390[_0x35da('0x34')][_0x35da('0x36')]?_0x2b8390['attributes']:_0x57b9c2[_0x35da('0x2f')];if(_0x54df29[_0x35da('0x31')][_0x35da('0x3e')]){_0x2b8390['include']=[{'all':!![]}];}_0x2b8390=_[_0x35da('0x3d')]({},_0x2b8390,_0x54df29[_0x35da('0x45')]);return db[_0x35da('0x2c')]['find'](_0x2b8390)[_0x35da('0x27')](handleEntityNotFound(_0x1f121f,null))[_0x35da('0x27')](respondWithResult(_0x1f121f,null))[_0x35da('0x42')](handleError(_0x1f121f,null));};exports[_0x35da('0x46')]=function(_0x535204,_0x246e96){return db['SquareMessage'][_0x35da('0x46')](_0x535204[_0x35da('0x47')],{})['then'](respondWithResult(_0x246e96,0xc9))[_0x35da('0x42')](handleError(_0x246e96,null));};exports[_0x35da('0x26')]=function(_0x27a543,_0x47d128){if(_0x27a543[_0x35da('0x47')]['id']){delete _0x27a543[_0x35da('0x47')]['id'];}return db[_0x35da('0x2c')][_0x35da('0x48')]({'where':{'id':_0x27a543[_0x35da('0x44')]['id']}})[_0x35da('0x27')](handleEntityNotFound(_0x47d128,null))[_0x35da('0x27')](saveUpdates(_0x27a543['body'],null))[_0x35da('0x27')](respondWithResult(_0x47d128,null))[_0x35da('0x42')](handleError(_0x47d128,null));};exports['destroy']=function(_0x210a29,_0x21eaa1){return db[_0x35da('0x2c')][_0x35da('0x48')]({'where':{'id':_0x210a29[_0x35da('0x44')]['id']}})[_0x35da('0x27')](handleEntityNotFound(_0x21eaa1,null))['then'](removeEntity(_0x21eaa1,null))[_0x35da('0x42')](handleError(_0x21eaa1,null));}; \ No newline at end of file +var _0xc771=['type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','options','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','reject','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName'];(function(_0x2e6915,_0x6867d5){var _0x104401=function(_0x259790){while(--_0x259790){_0x2e6915['push'](_0x2e6915['shift']());}};_0x104401(++_0x6867d5);}(_0xc771,0x1d9));var _0x1c77=function(_0x4abf64,_0x5339dc){_0x4abf64=_0x4abf64-0x0;var _0x1a9114=_0xc771[_0x4abf64];return _0x1a9114;};'use strict';var emlformat=require(_0x1c77('0x0'));var rimraf=require(_0x1c77('0x1'));var zipdir=require(_0x1c77('0x2'));var jsonpatch=require(_0x1c77('0x3'));var rp=require('request-promise');var moment=require(_0x1c77('0x4'));var BPromise=require(_0x1c77('0x5'));var Mustache=require(_0x1c77('0x6'));var util=require(_0x1c77('0x7'));var path=require(_0x1c77('0x8'));var sox=require('sox');var csv=require(_0x1c77('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c77('0xa'));var _=require('lodash');var squel=require(_0x1c77('0xb'));var crypto=require(_0x1c77('0xc'));var jsforce=require(_0x1c77('0xd'));var deskjs=require(_0x1c77('0xe'));var toCsv=require(_0x1c77('0x9'));var querystring=require(_0x1c77('0xf'));var Papa=require(_0x1c77('0x10'));var Redis=require(_0x1c77('0x11'));var authService=require(_0x1c77('0x12'));var qs=require(_0x1c77('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c77('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1c77('0x15'));var config=require(_0x1c77('0x16'));var licenseUtil=require(_0x1c77('0x17'));var db=require(_0x1c77('0x18'))['db'];function respondWithStatusCode(_0x6430cc,_0x2cbffe){_0x2cbffe=_0x2cbffe||0xcc;return function(_0x2a067b){if(_0x2a067b){return _0x6430cc[_0x1c77('0x19')](_0x2cbffe);}return _0x6430cc[_0x1c77('0x1a')](_0x2cbffe)[_0x1c77('0x1b')]();};}function respondWithResult(_0x24fe42,_0x1a29ee){_0x1a29ee=_0x1a29ee||0xc8;return function(_0x1855ec){if(_0x1855ec){return _0x24fe42['status'](_0x1a29ee)['json'](_0x1855ec);}};}function respondWithFilteredResult(_0x4bde72,_0x1493b5){return function(_0x38b8b3){if(_0x38b8b3){var _0x20ae91=typeof _0x1493b5[_0x1c77('0x1c')]===_0x1c77('0x1d')&&typeof _0x1493b5['limit']===_0x1c77('0x1d');var _0x3f06ff=_0x38b8b3[_0x1c77('0x1e')];var _0x109226=_0x20ae91?0x0:_0x1493b5[_0x1c77('0x1c')];var _0x5b66ae=_0x20ae91?_0x38b8b3[_0x1c77('0x1e')]:_0x1493b5[_0x1c77('0x1c')]+_0x1493b5['limit'];var _0x39d1bd;if(_0x5b66ae>=_0x3f06ff){_0x5b66ae=_0x3f06ff;_0x39d1bd=0xc8;}else{_0x39d1bd=0xce;}_0x4bde72[_0x1c77('0x1a')](_0x39d1bd);return _0x4bde72['set'](_0x1c77('0x1f'),_0x109226+'-'+_0x5b66ae+'/'+_0x3f06ff)[_0x1c77('0x20')](_0x38b8b3);}return null;};}function patchUpdates(_0x18d0a8){return function(_0xc0ae6){try{jsonpatch['apply'](_0xc0ae6,_0x18d0a8,!![]);}catch(_0x1be9d3){return BPromise[_0x1c77('0x21')](_0x1be9d3);}return _0xc0ae6['save']();};}function saveUpdates(_0x4407c9,_0x46a2cc){return function(_0x4bcfe1){if(_0x4bcfe1){return _0x4bcfe1['update'](_0x4407c9)[_0x1c77('0x22')](function(_0x2e28dd){return _0x2e28dd;});}return null;};}function removeEntity(_0x37a721,_0x3a70ad){return function(_0x491e9a){if(_0x491e9a){return _0x491e9a[_0x1c77('0x23')]()[_0x1c77('0x22')](function(){_0x37a721['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5286bf,_0x497914){return function(_0x20d21e){if(!_0x20d21e){_0x5286bf[_0x1c77('0x19')](0x194);}return _0x20d21e;};}function handleError(_0x15d62b,_0xe607b6){_0xe607b6=_0xe607b6||0x1f4;return function(_0x1d5b14){logger[_0x1c77('0x24')](_0x1d5b14[_0x1c77('0x25')]);if(_0x1d5b14[_0x1c77('0x26')]){delete _0x1d5b14[_0x1c77('0x26')];}_0x15d62b['status'](_0xe607b6)[_0x1c77('0x27')](_0x1d5b14);};}exports[_0x1c77('0x28')]=function(_0x32ebe8,_0x4db479){var _0x1fad3d={},_0x3c311c={},_0x4194fa={'count':0x0,'rows':[]};var _0x5bd0cb=_[_0x1c77('0x29')](db[_0x1c77('0x2a')][_0x1c77('0x2b')],function(_0x4904c9){return{'name':_0x4904c9[_0x1c77('0x2c')],'type':_0x4904c9[_0x1c77('0x2d')][_0x1c77('0x2e')]};});_0x3c311c[_0x1c77('0x2f')]=_[_0x1c77('0x29')](_0x5bd0cb,_0x1c77('0x26'));_0x3c311c['query']=_[_0x1c77('0x30')](_0x32ebe8[_0x1c77('0x31')]);_0x3c311c[_0x1c77('0x32')]=_[_0x1c77('0x33')](_0x3c311c[_0x1c77('0x2f')],_0x3c311c['query']);_0x1fad3d[_0x1c77('0x34')]=_[_0x1c77('0x33')](_0x3c311c[_0x1c77('0x2f')],qs[_0x1c77('0x35')](_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x35')]));_0x1fad3d[_0x1c77('0x34')]=_0x1fad3d[_0x1c77('0x34')][_0x1c77('0x36')]?_0x1fad3d[_0x1c77('0x34')]:_0x3c311c[_0x1c77('0x2f')];if(!_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x37')]('nolimit')){_0x1fad3d[_0x1c77('0x38')]=qs[_0x1c77('0x38')](_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x38')]);_0x1fad3d[_0x1c77('0x1c')]=qs[_0x1c77('0x1c')](_0x32ebe8['query'][_0x1c77('0x1c')]);}_0x1fad3d[_0x1c77('0x39')]=qs[_0x1c77('0x3a')](_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x3a')]);_0x1fad3d[_0x1c77('0x3b')]=qs[_0x1c77('0x32')](_[_0x1c77('0x3c')](_0x32ebe8[_0x1c77('0x31')],_0x3c311c[_0x1c77('0x32')]),_0x5bd0cb);if(_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x3d')]){_0x1fad3d[_0x1c77('0x3b')]=_[_0x1c77('0x3e')](_0x1fad3d[_0x1c77('0x3b')],{'$or':_[_0x1c77('0x29')](_0x5bd0cb,function(_0x424f3c){if(_0x424f3c[_0x1c77('0x2d')]!=='VIRTUAL'){var _0x1e96f4={};_0x1e96f4[_0x424f3c[_0x1c77('0x26')]]={'$like':'%'+_0x32ebe8[_0x1c77('0x31')]['filter']+'%'};return _0x1e96f4;}})});}_0x1fad3d=_[_0x1c77('0x3e')]({},_0x1fad3d,_0x32ebe8['options']);var _0x328b29={'where':_0x1fad3d['where']};return db[_0x1c77('0x2a')]['count'](_0x328b29)[_0x1c77('0x22')](function(_0x3f43ac){_0x4194fa[_0x1c77('0x1e')]=_0x3f43ac;if(_0x32ebe8[_0x1c77('0x31')]['includeAll']){_0x1fad3d[_0x1c77('0x3f')]=[{'all':!![]}];}return db['SquareMessage'][_0x1c77('0x40')](_0x1fad3d);})[_0x1c77('0x22')](function(_0x12df90){_0x4194fa[_0x1c77('0x41')]=_0x12df90;return _0x4194fa;})[_0x1c77('0x22')](respondWithFilteredResult(_0x4db479,_0x1fad3d))[_0x1c77('0x42')](handleError(_0x4db479,null));};exports[_0x1c77('0x43')]=function(_0x4ab4ac,_0x3669f4){var _0x32c1f4={'raw':!![],'where':{'id':_0x4ab4ac['params']['id']}},_0x1bf60f={};_0x1bf60f[_0x1c77('0x2f')]=_[_0x1c77('0x30')](db[_0x1c77('0x2a')]['rawAttributes']);_0x1bf60f['query']=_[_0x1c77('0x30')](_0x4ab4ac[_0x1c77('0x31')]);_0x1bf60f[_0x1c77('0x32')]=_[_0x1c77('0x33')](_0x1bf60f[_0x1c77('0x2f')],_0x1bf60f['query']);_0x32c1f4['attributes']=_[_0x1c77('0x33')](_0x1bf60f[_0x1c77('0x2f')],qs[_0x1c77('0x35')](_0x4ab4ac[_0x1c77('0x31')][_0x1c77('0x35')]));_0x32c1f4[_0x1c77('0x34')]=_0x32c1f4[_0x1c77('0x34')][_0x1c77('0x36')]?_0x32c1f4[_0x1c77('0x34')]:_0x1bf60f[_0x1c77('0x2f')];if(_0x4ab4ac[_0x1c77('0x31')]['includeAll']){_0x32c1f4[_0x1c77('0x3f')]=[{'all':!![]}];}_0x32c1f4=_[_0x1c77('0x3e')]({},_0x32c1f4,_0x4ab4ac[_0x1c77('0x44')]);return db[_0x1c77('0x2a')][_0x1c77('0x45')](_0x32c1f4)[_0x1c77('0x22')](handleEntityNotFound(_0x3669f4,null))[_0x1c77('0x22')](respondWithResult(_0x3669f4,null))[_0x1c77('0x42')](handleError(_0x3669f4,null));};exports[_0x1c77('0x46')]=function(_0x2c5981,_0xad81e4){return db['SquareMessage'][_0x1c77('0x46')](_0x2c5981[_0x1c77('0x47')],{})[_0x1c77('0x22')](respondWithResult(_0xad81e4,0xc9))[_0x1c77('0x42')](handleError(_0xad81e4,null));};exports[_0x1c77('0x48')]=function(_0x4a54bd,_0x3f2707){if(_0x4a54bd[_0x1c77('0x47')]['id']){delete _0x4a54bd[_0x1c77('0x47')]['id'];}return db[_0x1c77('0x2a')][_0x1c77('0x45')]({'where':{'id':_0x4a54bd[_0x1c77('0x49')]['id']}})[_0x1c77('0x22')](handleEntityNotFound(_0x3f2707,null))[_0x1c77('0x22')](saveUpdates(_0x4a54bd[_0x1c77('0x47')],null))[_0x1c77('0x22')](respondWithResult(_0x3f2707,null))[_0x1c77('0x42')](handleError(_0x3f2707,null));};exports[_0x1c77('0x23')]=function(_0x4d7c5a,_0x5700e5){return db['SquareMessage'][_0x1c77('0x45')]({'where':{'id':_0x4d7c5a[_0x1c77('0x49')]['id']}})[_0x1c77('0x22')](handleEntityNotFound(_0x5700e5,null))[_0x1c77('0x22')](removeEntity(_0x5700e5,null))[_0x1c77('0x42')](handleError(_0x5700e5,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 6f5e575..a9bf626 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 _0x9938=['../../config/logger','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','square_messages','lodash','util'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9938,0xf8));var _0x8993=function(_0x2d699a,_0x1e3b3f){_0x2d699a=_0x2d699a-0x0;var _0x40df66=_0x9938[_0x2d699a];return _0x40df66;};'use strict';var _=require(_0x8993('0x0'));var util=require(_0x8993('0x1'));var logger=require(_0x8993('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8993('0x3'));var fs=require('fs');var path=require(_0x8993('0x4'));var rimraf=require(_0x8993('0x5'));var config=require(_0x8993('0x6'));var attributes=require(_0x8993('0x7'));module[_0x8993('0x8')]=function(_0x173772,_0x43a0f4){return _0x173772['define']('SquareMessage',attributes,{'tableName':_0x8993('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6d5=['request-promise','exports','SquareMessage','square_messages','lodash','util','../../config/logger','api'];(function(_0x5cacbe,_0x2f7a79){var _0x30200b=function(_0x55279f){while(--_0x55279f){_0x5cacbe['push'](_0x5cacbe['shift']());}};_0x30200b(++_0x2f7a79);}(_0xe6d5,0x1d4));var _0x5e6d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xe6d5[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x5e6d('0x0'));var util=require(_0x5e6d('0x1'));var logger=require(_0x5e6d('0x2'))(_0x5e6d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x5e6d('0x5')]=function(_0x44eb75,_0x3fec74){return _0x44eb75['define'](_0x5e6d('0x6'),attributes,{'tableName':_0x5e6d('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 b656607..41a650e 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 _0xafd9=['debug','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xafd9,0x12d));var _0x9afd=function(_0x41ab78,_0x19cca0){_0x41ab78=_0x41ab78-0x0;var _0x836e66=_0xafd9[_0x41ab78];return _0x836e66;};'use strict';var _=require(_0x9afd('0x0'));var util=require('util');var moment=require(_0x9afd('0x1'));var BPromise=require(_0x9afd('0x2'));var rs=require(_0x9afd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9afd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9afd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afd('0x6'));var client=jayson[_0x9afd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e44ac,_0x4828f5,_0x23c357){return new BPromise(function(_0x8c99fa,_0x32d51d){return client['request'](_0x5e44ac,_0x23c357)[_0x9afd('0x8')](function(_0x53482){logger[_0x9afd('0x9')](_0x9afd('0xa'),_0x4828f5,'request\x20sent');logger[_0x9afd('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4828f5,_0x9afd('0xc'),JSON[_0x9afd('0xd')](_0x53482));if(_0x53482[_0x9afd('0xe')]){if(_0x53482[_0x9afd('0xe')][_0x9afd('0xf')]===0x1f4){logger[_0x9afd('0xe')](_0x9afd('0xa'),_0x4828f5,_0x53482[_0x9afd('0xe')][_0x9afd('0x10')]);return _0x32d51d(_0x53482[_0x9afd('0xe')]['message']);}logger[_0x9afd('0xe')](_0x9afd('0xa'),_0x4828f5,_0x53482[_0x9afd('0xe')][_0x9afd('0x10')]);return _0x8c99fa(_0x53482[_0x9afd('0xe')][_0x9afd('0x10')]);}else{logger[_0x9afd('0x9')](_0x9afd('0xa'),_0x4828f5,_0x9afd('0xc'));_0x8c99fa(_0x53482[_0x9afd('0x11')]['message']);}})[_0x9afd('0x12')](function(_0x13547f){logger['error'](_0x9afd('0xa'),_0x4828f5,_0x13547f);_0x32d51d(_0x13547f);});});}exports[_0x9afd('0x13')]=function(_0x283e35){var _0x558c8b=this;return new Promise(function(_0x461075,_0x56255c){return db[_0x9afd('0x14')][_0x9afd('0x15')](_0x283e35[_0x9afd('0x16')],{'raw':_0x283e35['options']?_0x283e35['options'][_0x9afd('0x17')]===undefined?!![]:![]:!![]})[_0x9afd('0x8')](function(_0x4d5cd1){logger[_0x9afd('0x9')](_0x9afd('0x13'),_0x283e35);logger[_0x9afd('0xb')](_0x9afd('0x13'),_0x283e35,JSON[_0x9afd('0xd')](_0x4d5cd1));_0x461075(_0x4d5cd1);})[_0x9afd('0x12')](function(_0x2652d1){logger[_0x9afd('0xe')](_0x9afd('0x13'),_0x2652d1['message'],_0x283e35);_0x56255c(_0x558c8b['error'](0x1f4,_0x2652d1[_0x9afd('0x10')]));});});}; \ No newline at end of file +var _0x3503=['debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3503,0x158));var _0x3350=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x3503[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x3350('0x0'));var util=require(_0x3350('0x1'));var moment=require(_0x3350('0x2'));var BPromise=require(_0x3350('0x3'));var rs=require(_0x3350('0x4'));var fs=require('fs');var Redis=require(_0x3350('0x5'));var db=require(_0x3350('0x6'))['db'];var utils=require(_0x3350('0x7'));var logger=require(_0x3350('0x8'))('rpc');var config=require(_0x3350('0x9'));var jayson=require(_0x3350('0xa'));var client=jayson['client'][_0x3350('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eb733,_0x2e6dfc,_0x1a0bc2){return new BPromise(function(_0x2b7c24,_0x437de5){return client[_0x3350('0xc')](_0x3eb733,_0x1a0bc2)['then'](function(_0x14272d){logger[_0x3350('0xd')](_0x3350('0xe'),_0x2e6dfc,_0x3350('0xf'));logger[_0x3350('0x10')](_0x3350('0x11'),_0x2e6dfc,_0x3350('0xf'),JSON[_0x3350('0x12')](_0x14272d));if(_0x14272d[_0x3350('0x13')]){if(_0x14272d[_0x3350('0x13')]['code']===0x1f4){logger[_0x3350('0x13')](_0x3350('0xe'),_0x2e6dfc,_0x14272d[_0x3350('0x13')][_0x3350('0x14')]);return _0x437de5(_0x14272d['error'][_0x3350('0x14')]);}logger['error'](_0x3350('0xe'),_0x2e6dfc,_0x14272d[_0x3350('0x13')][_0x3350('0x14')]);return _0x2b7c24(_0x14272d[_0x3350('0x13')][_0x3350('0x14')]);}else{logger[_0x3350('0xd')]('SquareMessage,\x20%s,\x20%s',_0x2e6dfc,_0x3350('0xf'));_0x2b7c24(_0x14272d[_0x3350('0x15')]['message']);}})[_0x3350('0x16')](function(_0x49399e){logger[_0x3350('0x13')](_0x3350('0xe'),_0x2e6dfc,_0x49399e);_0x437de5(_0x49399e);});});}exports[_0x3350('0x17')]=function(_0x5c6909){var _0x320706=this;return new Promise(function(_0x2bdd68,_0x391be9){return db[_0x3350('0x18')][_0x3350('0x19')](_0x5c6909[_0x3350('0x1a')],{'raw':_0x5c6909['options']?_0x5c6909[_0x3350('0x1b')][_0x3350('0x1c')]===undefined?!![]:![]:!![]})[_0x3350('0x1d')](function(_0x5c6506){logger[_0x3350('0xd')]('CreateSquareMessage',_0x5c6909);logger[_0x3350('0x10')](_0x3350('0x17'),_0x5c6909,JSON['stringify'](_0x5c6506));_0x2bdd68(_0x5c6506);})['catch'](function(_0x461b8f){logger[_0x3350('0x13')](_0x3350('0x17'),_0x461b8f[_0x3350('0x14')],_0x5c6909);_0x391be9(_0x320706[_0x3350('0x13')](0x1f4,_0x461b8f[_0x3350('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d3f1cbf..1c7fd0b 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 _0xfdc3=['./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','test','post','create','put','/:id','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x343911,_0x114d03){var _0x5d8386=function(_0x177c32){while(--_0x177c32){_0x343911['push'](_0x343911['shift']());}};_0x5d8386(++_0x114d03);}(_0xfdc3,0x1df));var _0x3fdc=function(_0x3074a3,_0x5cfa1e){_0x3074a3=_0x3074a3-0x0;var _0x1eed7e=_0xfdc3[_0x3074a3];return _0x1eed7e;};'use strict';var multer=require('multer');var util=require(_0x3fdc('0x0'));var path=require(_0x3fdc('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fdc('0x2'));var router=express[_0x3fdc('0x3')]();var fs_extra=require(_0x3fdc('0x4'));var auth=require(_0x3fdc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3fdc('0x6'));var controller=require(_0x3fdc('0x7'));router[_0x3fdc('0x8')]('/',auth[_0x3fdc('0x9')](),controller[_0x3fdc('0xa')]);router[_0x3fdc('0x8')]('/:id',auth[_0x3fdc('0x9')](),controller[_0x3fdc('0xb')]);router[_0x3fdc('0x8')](_0x3fdc('0xc'),auth[_0x3fdc('0x9')](),timeout('15s'),controller[_0x3fdc('0xd')]);router[_0x3fdc('0xe')]('/',auth['isAuthenticated'](),controller[_0x3fdc('0xf')]);router[_0x3fdc('0x10')]('/:id',auth[_0x3fdc('0x9')](),controller['update']);router['delete'](_0x3fdc('0x11'),auth[_0x3fdc('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd875=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/test','15s','post','create','put','update','delete','/:id','destroy'];(function(_0x4b48af,_0x4ad5b9){var _0x64ac44=function(_0x268837){while(--_0x268837){_0x4b48af['push'](_0x4b48af['shift']());}};_0x64ac44(++_0x4ad5b9);}(_0xd875,0xf2));var _0x5d87=function(_0x54d164,_0x3be5ba){_0x54d164=_0x54d164-0x0;var _0xf58243=_0xd875[_0x54d164];return _0xf58243;};'use strict';var multer=require(_0x5d87('0x0'));var util=require(_0x5d87('0x1'));var path=require('path');var timeout=require(_0x5d87('0x2'));var express=require(_0x5d87('0x3'));var router=express[_0x5d87('0x4')]();var fs_extra=require(_0x5d87('0x5'));var auth=require(_0x5d87('0x6'));var interaction=require(_0x5d87('0x7'));var config=require(_0x5d87('0x8'));var controller=require('./squareOdbc.controller');router[_0x5d87('0x9')]('/',auth['isAuthenticated'](),controller[_0x5d87('0xa')]);router[_0x5d87('0x9')]('/:id',auth[_0x5d87('0xb')](),controller[_0x5d87('0xc')]);router['get'](_0x5d87('0xd'),auth[_0x5d87('0xb')](),timeout(_0x5d87('0xe')),controller['test']);router[_0x5d87('0xf')]('/',auth['isAuthenticated'](),controller[_0x5d87('0x10')]);router[_0x5d87('0x11')]('/:id',auth[_0x5d87('0xb')](),controller[_0x5d87('0x12')]);router[_0x5d87('0x13')](_0x5d87('0x14'),auth[_0x5d87('0xb')](),controller[_0x5d87('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c051c1f..d3302a1 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 _0x86e5=['name','sequelize','exports','STRING'];(function(_0x469104,_0x42c4ae){var _0x3f4a27=function(_0x2ec8de){while(--_0x2ec8de){_0x469104['push'](_0x469104['shift']());}};_0x3f4a27(++_0x42c4ae);}(_0x86e5,0x1e5));var _0x586e=function(_0x4eef5c,_0x495a8f){_0x4eef5c=_0x4eef5c-0x0;var _0x431053=_0x86e5[_0x4eef5c];return _0x431053;};'use strict';var Sequelize=require(_0x586e('0x0'));module[_0x586e('0x1')]={'name':{'type':Sequelize[_0x586e('0x2')],'unique':_0x586e('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x586e('0x2')]},'description':{'type':Sequelize[_0x586e('0x2')]}}; \ No newline at end of file +var _0x636b=['name','STRING','sequelize','exports'];(function(_0x40b2a1,_0x26b1bb){var _0x534a3e=function(_0x5660c0){while(--_0x5660c0){_0x40b2a1['push'](_0x40b2a1['shift']());}};_0x534a3e(++_0x26b1bb);}(_0x636b,0x146));var _0xb636=function(_0xb36288,_0x102f2e){_0xb36288=_0xb36288-0x0;var _0x28f1b6=_0x636b[_0xb36288];return _0x28f1b6;};'use strict';var Sequelize=require(_0xb636('0x0'));module[_0xb636('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb636('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb636('0x3')]},'description':{'type':Sequelize[_0xb636('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index ce20712..a3ec88a 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 _0x990d=['closeSync','eml-format','rimraf','zip-dir','fast-json-patch','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/utils','../../config/license/util','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','SquareOdbc','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','test','dsn','odbc','openSync'];(function(_0x7f4dbc,_0x344984){var _0x3229c9=function(_0x4589c6){while(--_0x4589c6){_0x7f4dbc['push'](_0x7f4dbc['shift']());}};_0x3229c9(++_0x344984);}(_0x990d,0x1c8));var _0xd990=function(_0x51fd1f,_0x453dfb){_0x51fd1f=_0x51fd1f-0x0;var _0x4f314b=_0x990d[_0x51fd1f];return _0x4f314b;};'use strict';var emlformat=require(_0xd990('0x0'));var rimraf=require(_0xd990('0x1'));var zipdir=require(_0xd990('0x2'));var jsonpatch=require(_0xd990('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd990('0x4'));var path=require(_0xd990('0x5'));var sox=require(_0xd990('0x6'));var csv=require('to-csv');var ejs=require(_0xd990('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd990('0x8'));var squel=require(_0xd990('0x9'));var crypto=require(_0xd990('0xa'));var jsforce=require(_0xd990('0xb'));var deskjs=require(_0xd990('0xc'));var toCsv=require(_0xd990('0xd'));var querystring=require('querystring');var Papa=require(_0xd990('0xe'));var Redis=require(_0xd990('0xf'));var authService=require(_0xd990('0x10'));var qs=require(_0xd990('0x11'));var as=require(_0xd990('0x12'));var hardwareService=require(_0xd990('0x13'));var logger=require(_0xd990('0x14'))(_0xd990('0x15'));var utils=require(_0xd990('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd990('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c51e2,_0x5c369a){_0x5c369a=_0x5c369a||0xcc;return function(_0x13fc60){if(_0x13fc60){return _0x5c51e2[_0xd990('0x18')](_0x5c369a);}return _0x5c51e2[_0xd990('0x19')](_0x5c369a)['end']();};}function respondWithResult(_0x4e9284,_0x5ae969){_0x5ae969=_0x5ae969||0xc8;return function(_0xeaa866){if(_0xeaa866){return _0x4e9284['status'](_0x5ae969)[_0xd990('0x1a')](_0xeaa866);}};}function respondWithFilteredResult(_0x32f6d6,_0x487f6b){return function(_0xebdac1){if(_0xebdac1){var _0x362fee=typeof _0x487f6b['offset']===_0xd990('0x1b')&&typeof _0x487f6b['limit']===_0xd990('0x1b');var _0x4fa843=_0xebdac1[_0xd990('0x1c')];var _0x4a685e=_0x362fee?0x0:_0x487f6b[_0xd990('0x1d')];var _0x5517b6=_0x362fee?_0xebdac1[_0xd990('0x1c')]:_0x487f6b[_0xd990('0x1d')]+_0x487f6b['limit'];var _0x543b70;if(_0x5517b6>=_0x4fa843){_0x5517b6=_0x4fa843;_0x543b70=0xc8;}else{_0x543b70=0xce;}_0x32f6d6[_0xd990('0x19')](_0x543b70);return _0x32f6d6[_0xd990('0x1e')](_0xd990('0x1f'),_0x4a685e+'-'+_0x5517b6+'/'+_0x4fa843)[_0xd990('0x1a')](_0xebdac1);}return null;};}function patchUpdates(_0x4c21a0){return function(_0x3f3ac7){try{jsonpatch[_0xd990('0x20')](_0x3f3ac7,_0x4c21a0,!![]);}catch(_0x4f8cbb){return BPromise[_0xd990('0x21')](_0x4f8cbb);}return _0x3f3ac7[_0xd990('0x22')]();};}function saveUpdates(_0x376cca,_0x1e39af){return function(_0x48d2eb){if(_0x48d2eb){return _0x48d2eb[_0xd990('0x23')](_0x376cca)[_0xd990('0x24')](function(_0xdf25f2){return _0xdf25f2;});}return null;};}function removeEntity(_0x5a823a,_0x259bf5){return function(_0x262d4f){if(_0x262d4f){return _0x262d4f['destroy']()[_0xd990('0x24')](function(){var _0x5531e7=_0x262d4f[_0xd990('0x25')]({'plain':!![]});var _0x3456c4=_0xd990('0x26');return db[_0xd990('0x27')]['destroy']({'where':{'type':_0x3456c4,'resourceId':_0x5531e7['id']}})[_0xd990('0x24')](function(){return _0x262d4f;});})[_0xd990('0x24')](function(){_0x5a823a[_0xd990('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a369,_0x430a7c){return function(_0x3a6312){if(!_0x3a6312){_0x56a369[_0xd990('0x18')](0x194);}return _0x3a6312;};}function handleError(_0xb7cc6f,_0x4d7490){_0x4d7490=_0x4d7490||0x1f4;return function(_0x4c9807){logger[_0xd990('0x28')](_0x4c9807['stack']);if(_0x4c9807['name']){delete _0x4c9807[_0xd990('0x29')];}_0xb7cc6f['status'](_0x4d7490)[_0xd990('0x2a')](_0x4c9807);};}exports[_0xd990('0x2b')]=function(_0x574c04,_0x3f1849){var _0x2b61e2={},_0x3c942d={},_0x2925be={'count':0x0,'rows':[]};var _0x4ae4c4=_['map'](db['SquareOdbc'][_0xd990('0x2c')],function(_0xc2e43b){return{'name':_0xc2e43b[_0xd990('0x2d')],'type':_0xc2e43b[_0xd990('0x2e')][_0xd990('0x2f')]};});_0x3c942d['model']=_[_0xd990('0x30')](_0x4ae4c4,_0xd990('0x29'));_0x3c942d[_0xd990('0x31')]=_[_0xd990('0x32')](_0x574c04[_0xd990('0x31')]);_0x3c942d[_0xd990('0x33')]=_[_0xd990('0x34')](_0x3c942d['model'],_0x3c942d['query']);_0x2b61e2[_0xd990('0x35')]=_[_0xd990('0x34')](_0x3c942d[_0xd990('0x36')],qs[_0xd990('0x37')](_0x574c04[_0xd990('0x31')][_0xd990('0x37')]));_0x2b61e2[_0xd990('0x35')]=_0x2b61e2[_0xd990('0x35')][_0xd990('0x38')]?_0x2b61e2[_0xd990('0x35')]:_0x3c942d['model'];if(!_0x574c04[_0xd990('0x31')][_0xd990('0x39')](_0xd990('0x3a'))){_0x2b61e2[_0xd990('0x3b')]=qs['limit'](_0x574c04[_0xd990('0x31')]['limit']);_0x2b61e2['offset']=qs[_0xd990('0x1d')](_0x574c04[_0xd990('0x31')][_0xd990('0x1d')]);}_0x2b61e2[_0xd990('0x3c')]=qs['sort'](_0x574c04['query'][_0xd990('0x3d')]);_0x2b61e2['where']=qs[_0xd990('0x33')](_[_0xd990('0x3e')](_0x574c04[_0xd990('0x31')],_0x3c942d[_0xd990('0x33')]),_0x4ae4c4);if(_0x574c04[_0xd990('0x31')][_0xd990('0x3f')]){_0x2b61e2['where']=_['merge'](_0x2b61e2[_0xd990('0x40')],{'$or':_['map'](_0x4ae4c4,function(_0x3a79a4){if(_0x3a79a4[_0xd990('0x2e')]!==_0xd990('0x41')){var _0x1b266a={};_0x1b266a[_0x3a79a4['name']]={'$like':'%'+_0x574c04[_0xd990('0x31')][_0xd990('0x3f')]+'%'};return _0x1b266a;}})});}_0x2b61e2=_[_0xd990('0x42')]({},_0x2b61e2,_0x574c04[_0xd990('0x43')]);var _0x3b36ed={'where':_0x2b61e2[_0xd990('0x40')]};return db[_0xd990('0x44')][_0xd990('0x1c')](_0x3b36ed)[_0xd990('0x24')](function(_0x3178e8){_0x2925be[_0xd990('0x1c')]=_0x3178e8;if(_0x574c04[_0xd990('0x31')][_0xd990('0x45')]){_0x2b61e2['include']=[{'all':!![]}];}return db[_0xd990('0x44')][_0xd990('0x46')](_0x2b61e2);})['then'](function(_0x3ca15c){_0x2925be[_0xd990('0x47')]=_0x3ca15c;return _0x2925be;})['then'](respondWithFilteredResult(_0x3f1849,_0x2b61e2))[_0xd990('0x48')](handleError(_0x3f1849,null));};exports[_0xd990('0x49')]=function(_0xdba521,_0x370b69){var _0x578cdd={'raw':!![],'where':{'id':_0xdba521[_0xd990('0x4a')]['id']}},_0x2f2e31={};_0x2f2e31[_0xd990('0x36')]=_[_0xd990('0x32')](db[_0xd990('0x44')][_0xd990('0x2c')]);_0x2f2e31[_0xd990('0x31')]=_['keys'](_0xdba521[_0xd990('0x31')]);_0x2f2e31[_0xd990('0x33')]=_[_0xd990('0x34')](_0x2f2e31['model'],_0x2f2e31[_0xd990('0x31')]);_0x578cdd[_0xd990('0x35')]=_[_0xd990('0x34')](_0x2f2e31[_0xd990('0x36')],qs[_0xd990('0x37')](_0xdba521[_0xd990('0x31')][_0xd990('0x37')]));_0x578cdd[_0xd990('0x35')]=_0x578cdd[_0xd990('0x35')][_0xd990('0x38')]?_0x578cdd[_0xd990('0x35')]:_0x2f2e31[_0xd990('0x36')];if(_0xdba521[_0xd990('0x31')][_0xd990('0x45')]){_0x578cdd[_0xd990('0x4b')]=[{'all':!![]}];}_0x578cdd=_['merge']({},_0x578cdd,_0xdba521[_0xd990('0x43')]);return db[_0xd990('0x44')][_0xd990('0x4c')](_0x578cdd)[_0xd990('0x24')](handleEntityNotFound(_0x370b69,null))[_0xd990('0x24')](respondWithResult(_0x370b69,null))[_0xd990('0x48')](handleError(_0x370b69,null));};exports[_0xd990('0x4d')]=function(_0x56af46,_0x3a078a){return db[_0xd990('0x44')][_0xd990('0x4d')](_0x56af46['body'],{})[_0xd990('0x24')](function(_0x5cea97){var _0x2f0fb1=_0x56af46[_0xd990('0x4e')][_0xd990('0x25')]({'plain':!![]});if(!_0x2f0fb1)throw new Error(_0xd990('0x4f'));if(_0x2f0fb1[_0xd990('0x50')]===_0xd990('0x4e')){var _0x2a7284=_0x5cea97[_0xd990('0x25')]({'plain':!![]});var _0x3fffd6=_0xd990('0x26');return db[_0xd990('0x51')]['find']({'where':{'name':_0x3fffd6,'userProfileId':_0x2f0fb1[_0xd990('0x52')]},'raw':!![]})[_0xd990('0x24')](function(_0x13ce26){if(_0x13ce26&&_0x13ce26['autoAssociation']===0x0){return db[_0xd990('0x27')][_0xd990('0x4d')]({'name':_0x2a7284[_0xd990('0x29')],'resourceId':_0x2a7284['id'],'type':_0x13ce26['name'],'sectionId':_0x13ce26['id']},{})[_0xd990('0x24')](function(){return _0x5cea97;});}else{return _0x5cea97;}})[_0xd990('0x48')](function(_0x5b47f9){logger[_0xd990('0x28')](_0xd990('0x53'),_0x5b47f9);throw _0x5b47f9;});}return _0x5cea97;})[_0xd990('0x24')](respondWithResult(_0x3a078a,0xc9))['catch'](handleError(_0x3a078a,null));};exports[_0xd990('0x23')]=function(_0xdcca6e,_0x228540){if(_0xdcca6e[_0xd990('0x54')]['id']){delete _0xdcca6e[_0xd990('0x54')]['id'];}return db[_0xd990('0x44')][_0xd990('0x4c')]({'where':{'id':_0xdcca6e[_0xd990('0x4a')]['id']}})[_0xd990('0x24')](handleEntityNotFound(_0x228540,null))['then'](saveUpdates(_0xdcca6e[_0xd990('0x54')],null))[_0xd990('0x24')](respondWithResult(_0x228540,null))['catch'](handleError(_0x228540,null));};exports[_0xd990('0x55')]=function(_0x106397,_0x29843d){return db[_0xd990('0x44')]['find']({'where':{'id':_0x106397[_0xd990('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29843d,null))['then'](removeEntity(_0x29843d,null))[_0xd990('0x48')](handleError(_0x29843d,null));};exports[_0xd990('0x56')]=function(_0x11b7d2,_0x5abdd8,_0x518811){var _0x18a38f;return db[_0xd990('0x44')][_0xd990('0x4c')]({'where':{'id':_0x11b7d2[_0xd990('0x4a')]['id']},'attributes':['id',_0xd990('0x57')]})[_0xd990('0x24')](handleEntityNotFound(_0x5abdd8,null))[_0xd990('0x24')](function(_0x1352ce){if(_0x1352ce){var _0x59982=require(_0xd990('0x58'))();_0x59982[_0xd990('0x59')](_0x1352ce['dsn']);_0x59982[_0xd990('0x5a')]();return _0x1352ce;}})[_0xd990('0x24')](respondWithResult(_0x5abdd8,null))[_0xd990('0x48')](handleError(_0x5abdd8,null));}; \ No newline at end of file +var _0xdb3b=['params','rawAttributes','fields','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','catch'];(function(_0x20aca8,_0x52cc){var _0x4bb2e4=function(_0x5c49fc){while(--_0x5c49fc){_0x20aca8['push'](_0x20aca8['shift']());}};_0x4bb2e4(++_0x52cc);}(_0xdb3b,0xfe));var _0xbdb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdb3b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbdb3('0x0'));var rimraf=require(_0xbdb3('0x1'));var zipdir=require(_0xbdb3('0x2'));var jsonpatch=require(_0xbdb3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbdb3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbdb3('0x5'));var csv=require('to-csv');var ejs=require(_0xbdb3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbdb3('0x7'));var crypto=require(_0xbdb3('0x8'));var jsforce=require(_0xbdb3('0x9'));var deskjs=require(_0xbdb3('0xa'));var toCsv=require(_0xbdb3('0xb'));var querystring=require(_0xbdb3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbdb3('0xd'));var qs=require(_0xbdb3('0xe'));var as=require(_0xbdb3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbdb3('0x10'))(_0xbdb3('0x11'));var utils=require(_0xbdb3('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbdb3('0x13'));var db=require(_0xbdb3('0x14'))['db'];function respondWithStatusCode(_0x37d5fa,_0x5938ec){_0x5938ec=_0x5938ec||0xcc;return function(_0x5cd716){if(_0x5cd716){return _0x37d5fa[_0xbdb3('0x15')](_0x5938ec);}return _0x37d5fa[_0xbdb3('0x16')](_0x5938ec)[_0xbdb3('0x17')]();};}function respondWithResult(_0x53912c,_0x2b46ac){_0x2b46ac=_0x2b46ac||0xc8;return function(_0x39bac9){if(_0x39bac9){return _0x53912c['status'](_0x2b46ac)[_0xbdb3('0x18')](_0x39bac9);}};}function respondWithFilteredResult(_0xb39ccb,_0x5b1ec5){return function(_0x5d7b56){if(_0x5d7b56){var _0x49335a=typeof _0x5b1ec5[_0xbdb3('0x19')]==='undefined'&&typeof _0x5b1ec5[_0xbdb3('0x1a')]===_0xbdb3('0x1b');var _0x11061c=_0x5d7b56[_0xbdb3('0x1c')];var _0x5231a7=_0x49335a?0x0:_0x5b1ec5['offset'];var _0x15868a=_0x49335a?_0x5d7b56[_0xbdb3('0x1c')]:_0x5b1ec5[_0xbdb3('0x19')]+_0x5b1ec5[_0xbdb3('0x1a')];var _0xcd7e44;if(_0x15868a>=_0x11061c){_0x15868a=_0x11061c;_0xcd7e44=0xc8;}else{_0xcd7e44=0xce;}_0xb39ccb[_0xbdb3('0x16')](_0xcd7e44);return _0xb39ccb[_0xbdb3('0x1d')](_0xbdb3('0x1e'),_0x5231a7+'-'+_0x15868a+'/'+_0x11061c)[_0xbdb3('0x18')](_0x5d7b56);}return null;};}function patchUpdates(_0x43bf54){return function(_0x329091){try{jsonpatch[_0xbdb3('0x1f')](_0x329091,_0x43bf54,!![]);}catch(_0x203695){return BPromise[_0xbdb3('0x20')](_0x203695);}return _0x329091[_0xbdb3('0x21')]();};}function saveUpdates(_0x3e7cbe,_0x5c4c8e){return function(_0x134d45){if(_0x134d45){return _0x134d45['update'](_0x3e7cbe)[_0xbdb3('0x22')](function(_0x452408){return _0x452408;});}return null;};}function removeEntity(_0x560b1c,_0x13343a){return function(_0x3b64b9){if(_0x3b64b9){return _0x3b64b9[_0xbdb3('0x23')]()[_0xbdb3('0x22')](function(){var _0x154127=_0x3b64b9[_0xbdb3('0x24')]({'plain':!![]});var _0x4aacf5=_0xbdb3('0x25');return db[_0xbdb3('0x26')][_0xbdb3('0x23')]({'where':{'type':_0x4aacf5,'resourceId':_0x154127['id']}})[_0xbdb3('0x22')](function(){return _0x3b64b9;});})['then'](function(){_0x560b1c[_0xbdb3('0x16')](0xcc)[_0xbdb3('0x17')]();});}};}function handleEntityNotFound(_0x2a332b,_0x7300e4){return function(_0x2053b1){if(!_0x2053b1){_0x2a332b['sendStatus'](0x194);}return _0x2053b1;};}function handleError(_0x51d517,_0xf888da){_0xf888da=_0xf888da||0x1f4;return function(_0x1aef81){logger['error'](_0x1aef81[_0xbdb3('0x27')]);if(_0x1aef81[_0xbdb3('0x28')]){delete _0x1aef81[_0xbdb3('0x28')];}_0x51d517['status'](_0xf888da)[_0xbdb3('0x29')](_0x1aef81);};}exports[_0xbdb3('0x2a')]=function(_0x58d481,_0x46f0b4){var _0x13730c={},_0x565838={},_0x2b4722={'count':0x0,'rows':[]};var _0x366e09=_[_0xbdb3('0x2b')](db['SquareOdbc']['rawAttributes'],function(_0x5e173b){return{'name':_0x5e173b[_0xbdb3('0x2c')],'type':_0x5e173b[_0xbdb3('0x2d')]['key']};});_0x565838[_0xbdb3('0x2e')]=_[_0xbdb3('0x2b')](_0x366e09,'name');_0x565838[_0xbdb3('0x2f')]=_[_0xbdb3('0x30')](_0x58d481['query']);_0x565838[_0xbdb3('0x31')]=_['intersection'](_0x565838[_0xbdb3('0x2e')],_0x565838[_0xbdb3('0x2f')]);_0x13730c['attributes']=_[_0xbdb3('0x32')](_0x565838['model'],qs['fields'](_0x58d481[_0xbdb3('0x2f')]['fields']));_0x13730c['attributes']=_0x13730c[_0xbdb3('0x33')]['length']?_0x13730c[_0xbdb3('0x33')]:_0x565838[_0xbdb3('0x2e')];if(!_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x34')](_0xbdb3('0x35'))){_0x13730c[_0xbdb3('0x1a')]=qs['limit'](_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x1a')]);_0x13730c[_0xbdb3('0x19')]=qs[_0xbdb3('0x19')](_0x58d481['query']['offset']);}_0x13730c['order']=qs[_0xbdb3('0x36')](_0x58d481['query'][_0xbdb3('0x36')]);_0x13730c[_0xbdb3('0x37')]=qs[_0xbdb3('0x31')](_[_0xbdb3('0x38')](_0x58d481[_0xbdb3('0x2f')],_0x565838['filters']),_0x366e09);if(_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x39')]){_0x13730c[_0xbdb3('0x37')]=_[_0xbdb3('0x3a')](_0x13730c[_0xbdb3('0x37')],{'$or':_[_0xbdb3('0x2b')](_0x366e09,function(_0x437e16){if(_0x437e16[_0xbdb3('0x2d')]!==_0xbdb3('0x3b')){var _0x5c5b15={};_0x5c5b15[_0x437e16[_0xbdb3('0x28')]]={'$like':'%'+_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x39')]+'%'};return _0x5c5b15;}})});}_0x13730c=_[_0xbdb3('0x3a')]({},_0x13730c,_0x58d481[_0xbdb3('0x3c')]);var _0x3ac7f2={'where':_0x13730c[_0xbdb3('0x37')]};return db[_0xbdb3('0x3d')][_0xbdb3('0x1c')](_0x3ac7f2)[_0xbdb3('0x22')](function(_0x2c8e89){_0x2b4722['count']=_0x2c8e89;if(_0x58d481['query'][_0xbdb3('0x3e')]){_0x13730c[_0xbdb3('0x3f')]=[{'all':!![]}];}return db[_0xbdb3('0x3d')][_0xbdb3('0x40')](_0x13730c);})[_0xbdb3('0x22')](function(_0x456fd2){_0x2b4722['rows']=_0x456fd2;return _0x2b4722;})[_0xbdb3('0x22')](respondWithFilteredResult(_0x46f0b4,_0x13730c))[_0xbdb3('0x41')](handleError(_0x46f0b4,null));};exports['show']=function(_0x1e32f3,_0x3eef92){var _0x231b33={'raw':!![],'where':{'id':_0x1e32f3[_0xbdb3('0x42')]['id']}},_0x2dc74={};_0x2dc74[_0xbdb3('0x2e')]=_['keys'](db[_0xbdb3('0x3d')][_0xbdb3('0x43')]);_0x2dc74['query']=_[_0xbdb3('0x30')](_0x1e32f3[_0xbdb3('0x2f')]);_0x2dc74['filters']=_[_0xbdb3('0x32')](_0x2dc74['model'],_0x2dc74['query']);_0x231b33[_0xbdb3('0x33')]=_['intersection'](_0x2dc74[_0xbdb3('0x2e')],qs[_0xbdb3('0x44')](_0x1e32f3['query'][_0xbdb3('0x44')]));_0x231b33[_0xbdb3('0x33')]=_0x231b33[_0xbdb3('0x33')][_0xbdb3('0x45')]?_0x231b33[_0xbdb3('0x33')]:_0x2dc74[_0xbdb3('0x2e')];if(_0x1e32f3[_0xbdb3('0x2f')][_0xbdb3('0x3e')]){_0x231b33['include']=[{'all':!![]}];}_0x231b33=_[_0xbdb3('0x3a')]({},_0x231b33,_0x1e32f3['options']);return db[_0xbdb3('0x3d')][_0xbdb3('0x46')](_0x231b33)[_0xbdb3('0x22')](handleEntityNotFound(_0x3eef92,null))['then'](respondWithResult(_0x3eef92,null))[_0xbdb3('0x41')](handleError(_0x3eef92,null));};exports[_0xbdb3('0x47')]=function(_0x34361f,_0x5b4318){return db[_0xbdb3('0x3d')][_0xbdb3('0x47')](_0x34361f['body'],{})[_0xbdb3('0x22')](function(_0x533512){var _0xef2c33=_0x34361f[_0xbdb3('0x48')]['get']({'plain':!![]});if(!_0xef2c33)throw new Error(_0xbdb3('0x49'));if(_0xef2c33[_0xbdb3('0x4a')]==='user'){var _0x51b0f8=_0x533512[_0xbdb3('0x24')]({'plain':!![]});var _0x5dc5be=_0xbdb3('0x25');return db['UserProfileSection'][_0xbdb3('0x46')]({'where':{'name':_0x5dc5be,'userProfileId':_0xef2c33[_0xbdb3('0x4b')]},'raw':!![]})[_0xbdb3('0x22')](function(_0xe08670){if(_0xe08670&&_0xe08670['autoAssociation']===0x0){return db[_0xbdb3('0x26')]['create']({'name':_0x51b0f8[_0xbdb3('0x28')],'resourceId':_0x51b0f8['id'],'type':_0xe08670[_0xbdb3('0x28')],'sectionId':_0xe08670['id']},{})['then'](function(){return _0x533512;});}else{return _0x533512;}})['catch'](function(_0x261bc9){logger['error'](_0xbdb3('0x4c'),_0x261bc9);throw _0x261bc9;});}return _0x533512;})[_0xbdb3('0x22')](respondWithResult(_0x5b4318,0xc9))['catch'](handleError(_0x5b4318,null));};exports[_0xbdb3('0x4d')]=function(_0x18da28,_0xbcf80){if(_0x18da28['body']['id']){delete _0x18da28[_0xbdb3('0x4e')]['id'];}return db[_0xbdb3('0x3d')][_0xbdb3('0x46')]({'where':{'id':_0x18da28['params']['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0xbcf80,null))[_0xbdb3('0x22')](saveUpdates(_0x18da28['body'],null))[_0xbdb3('0x22')](respondWithResult(_0xbcf80,null))[_0xbdb3('0x41')](handleError(_0xbcf80,null));};exports[_0xbdb3('0x23')]=function(_0x3f1482,_0x4391fd){return db[_0xbdb3('0x3d')]['find']({'where':{'id':_0x3f1482[_0xbdb3('0x42')]['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0x4391fd,null))[_0xbdb3('0x22')](removeEntity(_0x4391fd,null))['catch'](handleError(_0x4391fd,null));};exports[_0xbdb3('0x4f')]=function(_0x1b4f81,_0x1dc784,_0x44fe93){var _0x17d8a8;return db[_0xbdb3('0x3d')][_0xbdb3('0x46')]({'where':{'id':_0x1b4f81[_0xbdb3('0x42')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x1dc784,null))[_0xbdb3('0x22')](function(_0x2cba80){if(_0x2cba80){var _0x5bdd48=require('odbc')();_0x5bdd48['openSync'](_0x2cba80['dsn']);_0x5bdd48['closeSync']();return _0x2cba80;}})[_0xbdb3('0x22')](respondWithResult(_0x1dc784,null))[_0xbdb3('0x41')](handleError(_0x1dc784,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8335852..70761b6 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 _0xbfa0=['rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','request-promise'];(function(_0xf29c9d,_0xa0ffd){var _0x1b6e30=function(_0x3d127c){while(--_0x3d127c){_0xf29c9d['push'](_0xf29c9d['shift']());}};_0x1b6e30(++_0xa0ffd);}(_0xbfa0,0x1d2));var _0x0bfa=function(_0x135f15,_0xaaf8a3){_0x135f15=_0x135f15-0x0;var _0x57058d=_0xbfa0[_0x135f15];return _0x57058d;};'use strict';var _=require(_0x0bfa('0x0'));var util=require('util');var logger=require(_0x0bfa('0x1'))(_0x0bfa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0bfa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0bfa('0x4'));var config=require('../../config/environment');var attributes=require(_0x0bfa('0x5'));module[_0x0bfa('0x6')]=function(_0x30a5aa,_0x2fe595){return _0x30a5aa[_0x0bfa('0x7')](_0x0bfa('0x8'),attributes,{'tableName':_0x0bfa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x10d79b,_0x40e651){var _0x348f39=function(_0x45b959){while(--_0x45b959){_0x10d79b['push'](_0x10d79b['shift']());}};_0x348f39(++_0x40e651);}(_0xfcf0,0x138));var _0x0fcf=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xfcf0[_0x235482];return _0x5f5bea;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 4855396..38f98b5 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 _0x7d79=['model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','where','include','map','attributes'];(function(_0x4a73c0,_0x1072e3){var _0x3b4fa3=function(_0x20e2b6){while(--_0x20e2b6){_0x4a73c0['push'](_0x4a73c0['shift']());}};_0x3b4fa3(++_0x1072e3);}(_0x7d79,0x12d));var _0x97d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7d79[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x97d7('0x0'));var util=require(_0x97d7('0x1'));var moment=require(_0x97d7('0x2'));var BPromise=require('bluebird');var rs=require(_0x97d7('0x3'));var fs=require('fs');var Redis=require(_0x97d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97d7('0x5'));var logger=require(_0x97d7('0x6'))(_0x97d7('0x7'));var config=require(_0x97d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x97d7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ca20f,_0x44bc10,_0x3c5137){return new BPromise(function(_0x1585cf,_0x46808a){return client[_0x97d7('0xa')](_0x1ca20f,_0x3c5137)[_0x97d7('0xb')](function(_0xf6594e){logger['info'](_0x97d7('0xc'),_0x44bc10,'request\x20sent');logger[_0x97d7('0xd')](_0x97d7('0xe'),_0x44bc10,_0x97d7('0xf'),JSON[_0x97d7('0x10')](_0xf6594e));if(_0xf6594e['error']){if(_0xf6594e[_0x97d7('0x11')]['code']===0x1f4){logger[_0x97d7('0x11')](_0x97d7('0xc'),_0x44bc10,_0xf6594e[_0x97d7('0x11')]['message']);return _0x46808a(_0xf6594e[_0x97d7('0x11')][_0x97d7('0x12')]);}logger[_0x97d7('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x44bc10,_0xf6594e[_0x97d7('0x11')][_0x97d7('0x12')]);return _0x1585cf(_0xf6594e[_0x97d7('0x11')][_0x97d7('0x12')]);}else{logger[_0x97d7('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x44bc10,_0x97d7('0xf'));_0x1585cf(_0xf6594e['result'][_0x97d7('0x12')]);}})[_0x97d7('0x14')](function(_0x536a5e){logger[_0x97d7('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x44bc10,_0x536a5e);_0x46808a(_0x536a5e);});});}exports[_0x97d7('0x15')]=function(_0x39ad96){var _0x314212=this;return new Promise(function(_0x2f985c,_0x39c80a){return db[_0x97d7('0x16')][_0x97d7('0x17')]({'raw':_0x39ad96['options']?_0x39ad96['options']['raw']===undefined?!![]:![]:!![],'where':_0x39ad96[_0x97d7('0x18')]?_0x39ad96[_0x97d7('0x18')][_0x97d7('0x19')]||null:null,'attributes':_0x39ad96[_0x97d7('0x18')]?_0x39ad96['options']['attributes']||null:null,'include':_0x39ad96[_0x97d7('0x18')]?_0x39ad96[_0x97d7('0x18')][_0x97d7('0x1a')]?_[_0x97d7('0x1b')](_0x39ad96['options'][_0x97d7('0x1a')],function(_0x199a92){return{'model':db[_0x199a92['model']],'as':_0x199a92['as'],'attributes':_0x199a92[_0x97d7('0x1c')],'include':_0x199a92['include']?_['map'](_0x199a92['include'],function(_0x5e00de){return{'model':db[_0x5e00de[_0x97d7('0x1d')]],'as':_0x5e00de['as'],'attributes':_0x5e00de[_0x97d7('0x1c')],'include':_0x5e00de['include']?_[_0x97d7('0x1b')](_0x5e00de[_0x97d7('0x1a')],function(_0x1c1d01){return{'model':db[_0x1c1d01['model']],'as':_0x1c1d01['as'],'attributes':_0x1c1d01[_0x97d7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97d7('0xb')](function(_0x127a6b){logger[_0x97d7('0x13')](_0x97d7('0x15'),_0x39ad96);logger[_0x97d7('0xd')]('ShowSquareOdbc',_0x39ad96,JSON[_0x97d7('0x10')](_0x127a6b));_0x2f985c(_0x127a6b);})['catch'](function(_0x5d39c4){logger[_0x97d7('0x11')](_0x97d7('0x15'),_0x5d39c4[_0x97d7('0x12')],_0x39ad96);_0x39c80a(_0x314212[_0x97d7('0x11')](0x1f4,_0x5d39c4['message']));});});}; \ No newline at end of file +var _0x067c=['error','code','message','SquareOdbc,\x20%s,\x20%s','catch','ShowSquareOdbc','options','where','attributes','map','include','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5f2dea,_0x3775e0){var _0x5cb3db=function(_0x335be4){while(--_0x335be4){_0x5f2dea['push'](_0x5f2dea['shift']());}};_0x5cb3db(++_0x3775e0);}(_0x067c,0xa7));var _0xc067=function(_0x3dee92,_0x55e1eb){_0x3dee92=_0x3dee92-0x0;var _0x44d36e=_0x067c[_0x3dee92];return _0x44d36e;};'use strict';var _=require('lodash');var util=require(_0xc067('0x0'));var moment=require(_0xc067('0x1'));var BPromise=require(_0xc067('0x2'));var rs=require(_0xc067('0x3'));var fs=require('fs');var Redis=require(_0xc067('0x4'));var db=require(_0xc067('0x5'))['db'];var utils=require(_0xc067('0x6'));var logger=require('../../config/logger')(_0xc067('0x7'));var config=require(_0xc067('0x8'));var jayson=require(_0xc067('0x9'));var client=jayson[_0xc067('0xa')][_0xc067('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48a856,_0xb7865c,_0x307903){return new BPromise(function(_0x25f636,_0x29e299){return client[_0xc067('0xc')](_0x48a856,_0x307903)[_0xc067('0xd')](function(_0x29f3d6){logger[_0xc067('0xe')]('SquareOdbc,\x20%s,\x20%s',_0xb7865c,'request\x20sent');logger[_0xc067('0xf')](_0xc067('0x10'),_0xb7865c,_0xc067('0x11'),JSON[_0xc067('0x12')](_0x29f3d6));if(_0x29f3d6[_0xc067('0x13')]){if(_0x29f3d6[_0xc067('0x13')][_0xc067('0x14')]===0x1f4){logger[_0xc067('0x13')]('SquareOdbc,\x20%s,\x20%s',_0xb7865c,_0x29f3d6[_0xc067('0x13')][_0xc067('0x15')]);return _0x29e299(_0x29f3d6[_0xc067('0x13')][_0xc067('0x15')]);}logger[_0xc067('0x13')](_0xc067('0x16'),_0xb7865c,_0x29f3d6['error'][_0xc067('0x15')]);return _0x25f636(_0x29f3d6[_0xc067('0x13')][_0xc067('0x15')]);}else{logger[_0xc067('0xe')]('SquareOdbc,\x20%s,\x20%s',_0xb7865c,_0xc067('0x11'));_0x25f636(_0x29f3d6['result'][_0xc067('0x15')]);}})[_0xc067('0x17')](function(_0x54aa96){logger[_0xc067('0x13')](_0xc067('0x16'),_0xb7865c,_0x54aa96);_0x29e299(_0x54aa96);});});}exports[_0xc067('0x18')]=function(_0x13d46d){var _0x2285fa=this;return new Promise(function(_0x25c7c3,_0x5edf9f){return db['SquareOdbc']['find']({'raw':_0x13d46d['options']?_0x13d46d['options']['raw']===undefined?!![]:![]:!![],'where':_0x13d46d[_0xc067('0x19')]?_0x13d46d[_0xc067('0x19')][_0xc067('0x1a')]||null:null,'attributes':_0x13d46d['options']?_0x13d46d['options'][_0xc067('0x1b')]||null:null,'include':_0x13d46d['options']?_0x13d46d[_0xc067('0x19')]['include']?_[_0xc067('0x1c')](_0x13d46d['options'][_0xc067('0x1d')],function(_0x5964bb){return{'model':db[_0x5964bb[_0xc067('0x1e')]],'as':_0x5964bb['as'],'attributes':_0x5964bb[_0xc067('0x1b')],'include':_0x5964bb['include']?_[_0xc067('0x1c')](_0x5964bb['include'],function(_0x194d75){return{'model':db[_0x194d75['model']],'as':_0x194d75['as'],'attributes':_0x194d75[_0xc067('0x1b')],'include':_0x194d75['include']?_[_0xc067('0x1c')](_0x194d75[_0xc067('0x1d')],function(_0x55876f){return{'model':db[_0x55876f['model']],'as':_0x55876f['as'],'attributes':_0x55876f[_0xc067('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc067('0xd')](function(_0x116885){logger[_0xc067('0xe')](_0xc067('0x18'),_0x13d46d);logger[_0xc067('0xf')](_0xc067('0x18'),_0x13d46d,JSON[_0xc067('0x12')](_0x116885));_0x25c7c3(_0x116885);})['catch'](function(_0xb18e12){logger[_0xc067('0x13')]('ShowSquareOdbc',_0xb18e12[_0xc067('0x15')],_0x13d46d);_0x5edf9f(_0x2285fa[_0xc067('0x13')](0x1f4,_0xb18e12[_0xc067('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index a4bf5a6..0653643 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 _0x3c2f=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x44a0ef,_0x371632){var _0x33d8d5=function(_0x4f4443){while(--_0x4f4443){_0x44a0ef['push'](_0x44a0ef['shift']());}};_0x33d8d5(++_0x371632);}(_0x3c2f,0x98));var _0xf3c2=function(_0x1dd6e7,_0x1cda2b){_0x1dd6e7=_0x1dd6e7-0x0;var _0xb53aa4=_0x3c2f[_0x1dd6e7];return _0xb53aa4;};'use strict';var multer=require(_0xf3c2('0x0'));var util=require(_0xf3c2('0x1'));var path=require('path');var timeout=require(_0xf3c2('0x2'));var express=require(_0xf3c2('0x3'));var router=express['Router']();var fs_extra=require(_0xf3c2('0x4'));var auth=require(_0xf3c2('0x5'));var interaction=require(_0xf3c2('0x6'));var config=require(_0xf3c2('0x7'));var controller=require(_0xf3c2('0x8'));router[_0xf3c2('0x9')]('/',auth[_0xf3c2('0xa')](),controller[_0xf3c2('0xb')]);router[_0xf3c2('0x9')](_0xf3c2('0xc'),auth[_0xf3c2('0xa')](),controller[_0xf3c2('0xd')]);router[_0xf3c2('0xe')]('/',auth[_0xf3c2('0xa')](),controller[_0xf3c2('0xf')]);router[_0xf3c2('0x10')](_0xf3c2('0xc'),auth[_0xf3c2('0xa')](),controller[_0xf3c2('0x11')]);router[_0xf3c2('0x12')](_0xf3c2('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0da2=['Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x30c60a,_0x3b4bf0){var _0x5a90d2=function(_0x4ed353){while(--_0x4ed353){_0x30c60a['push'](_0x30c60a['shift']());}};_0x5a90d2(++_0x3b4bf0);}(_0x0da2,0x1cf));var _0x20da=function(_0x43f283,_0x5a69d2){_0x43f283=_0x43f283-0x0;var _0x20fd0b=_0x0da2[_0x43f283];return _0x20fd0b;};'use strict';var multer=require(_0x20da('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20da('0x1')]();var fs_extra=require(_0x20da('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x20da('0x3'));var config=require(_0x20da('0x4'));var controller=require(_0x20da('0x5'));router['get']('/',auth[_0x20da('0x6')](),controller[_0x20da('0x7')]);router['get'](_0x20da('0x8'),auth['isAuthenticated'](),controller[_0x20da('0x9')]);router['post']('/',auth[_0x20da('0x6')](),controller[_0x20da('0xa')]);router[_0x20da('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x20da('0xc')]);router[_0x20da('0xd')](_0x20da('0x8'),auth[_0x20da('0x6')](),controller[_0x20da('0xe')]);module[_0x20da('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 602bd55..4760735 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 _0xd1d4=['getDataValue','preproduction','toString','utf8','BLOB','production','DATE','STRING','name','TEXT','long'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd1d4,0x104));var _0x4d1d=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xd1d4[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4d1d('0x0')],'unique':_0x4d1d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4d1d('0x0')]},'notes':{'type':Sequelize[_0x4d1d('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0x4d1d('0x3')),'get':function(){if(this[_0x4d1d('0x4')](_0x4d1d('0x5'))){return this[_0x4d1d('0x4')](_0x4d1d('0x5'))[_0x4d1d('0x6')](_0x4d1d('0x7'));}}},'production':{'type':Sequelize[_0x4d1d('0x8')](_0x4d1d('0x3')),'get':function(){if(this['getDataValue'](_0x4d1d('0x9'))){return this[_0x4d1d('0x4')](_0x4d1d('0x9'))[_0x4d1d('0x6')](_0x4d1d('0x7'));}}},'savedAt':{'type':Sequelize[_0x4d1d('0xa')]},'publishedAt':{'type':Sequelize[_0x4d1d('0xa')]}}; \ No newline at end of file +var _0x2563=['name','TEXT','long','getDataValue','preproduction','utf8','BLOB','production','DATE','sequelize','exports','STRING'];(function(_0x3cadd1,_0x4d68a5){var _0x2fee81=function(_0x4fdd22){while(--_0x4fdd22){_0x3cadd1['push'](_0x3cadd1['shift']());}};_0x2fee81(++_0x4d68a5);}(_0x2563,0x75));var _0x3256=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2563[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3256('0x0'));module[_0x3256('0x1')]={'name':{'type':Sequelize[_0x3256('0x2')],'unique':_0x3256('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3256('0x2')]},'notes':{'type':Sequelize[_0x3256('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x3256('0x5')),'get':function(){if(this[_0x3256('0x6')]('preproduction')){return this[_0x3256('0x6')](_0x3256('0x7'))['toString'](_0x3256('0x8'));}}},'production':{'type':Sequelize[_0x3256('0x9')](_0x3256('0x5')),'get':function(){if(this[_0x3256('0x6')](_0x3256('0xa'))){return this['getDataValue']('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x3256('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 b410a41..4aa990d 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 _0xc9db=['lodash','ioredis','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','offset','undefined','limit','count','json','update','then','destroy','get','SquareProjects','UserProfileResource','stringify','error','stack','name','status','send','index','SquareProject','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','publish','agi'];(function(_0x264dba,_0x1b1201){var _0x120656=function(_0x1986a4){while(--_0x1986a4){_0x264dba['push'](_0x264dba['shift']());}};_0x120656(++_0x1b1201);}(_0xc9db,0x14f));var _0xbc9d=function(_0x38dd10,_0x311bc5){_0x38dd10=_0x38dd10-0x0;var _0x503ef0=_0xc9db[_0x38dd10];return _0x503ef0;};'use strict';var _=require(_0xbc9d('0x0'));var Redis=require(_0xbc9d('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xbc9d('0x2'));var db=require(_0xbc9d('0x3'))['db'];config['redis']=_[_0xbc9d('0x4')](config[_0xbc9d('0x5')],{'host':_0xbc9d('0x6'),'port':0x18eb});var socket=require(_0xbc9d('0x7'))(new Redis(config[_0xbc9d('0x5')]));require(_0xbc9d('0x8'))['register'](socket);function respondWithResult(_0x2e4174,_0x3412ef){_0x3412ef=_0x3412ef||0xc8;return function(_0x5023c7){if(_0x5023c7){return _0x2e4174['status'](_0x3412ef)['json'](_0x5023c7);}};}function respondWithFilteredResult(_0x4ce03c,_0x46ee27){return function(_0x48af5f){if(_0x48af5f){var _0x289ab1=typeof _0x46ee27[_0xbc9d('0x9')]===_0xbc9d('0xa')&&typeof _0x46ee27[_0xbc9d('0xb')]===_0xbc9d('0xa');var _0x3247d4=_0x48af5f[_0xbc9d('0xc')];var _0x1a12f9=_0x289ab1?0x0:_0x46ee27[_0xbc9d('0x9')];var _0x49e696=_0x289ab1?_0x48af5f[_0xbc9d('0xc')]:_0x46ee27[_0xbc9d('0x9')]+_0x46ee27[_0xbc9d('0xb')];var _0x469afc;if(_0x49e696>=_0x3247d4){_0x49e696=_0x3247d4;_0x469afc=0xc8;}else{_0x469afc=0xce;}_0x4ce03c['status'](_0x469afc);return _0x4ce03c['set']('Content-Range',_0x1a12f9+'-'+_0x49e696+'/'+_0x3247d4)[_0xbc9d('0xd')](_0x48af5f);}return null;};}function saveUpdates(_0x29850c){return function(_0x543b89){if(_0x543b89){return _0x543b89[_0xbc9d('0xe')](_0x29850c)[_0xbc9d('0xf')](function(_0xa26e12){return _0xa26e12;});}return null;};}function removeEntity(_0x51180c){return function(_0x319d93){if(_0x319d93){return _0x319d93[_0xbc9d('0x10')]()[_0xbc9d('0xf')](function(){var _0x48b454=_0x319d93[_0xbc9d('0x11')]({'plain':!![]});var _0x224ff4=_0xbc9d('0x12');return db[_0xbc9d('0x13')][_0xbc9d('0x10')]({'where':{'type':_0x224ff4,'resourceId':_0x48b454['id']}})['then'](function(){return _0x319d93;});})['then'](function(){var _0x3df021=new Redis(config[_0xbc9d('0x5')]);_0x3df021['publish']('agi',JSON[_0xbc9d('0x14')]({'id':_0x319d93['id'],'deleted':!![]}));})[_0xbc9d('0xf')](function(){_0x51180c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49e4aa){return function(_0x1da3e5){if(!_0x1da3e5){_0x49e4aa['sendStatus'](0x194);}return _0x1da3e5;};}function handleError(_0x3ba4b7,_0x616109){_0x616109=_0x616109||0x1f4;return function(_0x2bb707){logger[_0xbc9d('0x15')](_0x2bb707[_0xbc9d('0x16')]);if(_0x2bb707[_0xbc9d('0x17')]){delete _0x2bb707['name'];}_0x3ba4b7[_0xbc9d('0x18')](_0x616109)[_0xbc9d('0x19')](_0x2bb707);};}exports[_0xbc9d('0x1a')]=function(_0xced0bb,_0x47440e){var _0x1d2753={},_0x34fcaf={},_0x2e5603={'count':0x0,'rows':[]};var _0x4f0677=_['map'](db[_0xbc9d('0x1b')][_0xbc9d('0x1c')],function(_0x466736){return{'name':_0x466736[_0xbc9d('0x1d')],'type':_0x466736[_0xbc9d('0x1e')][_0xbc9d('0x1f')]};});_0x34fcaf[_0xbc9d('0x20')]=_[_0xbc9d('0x21')](_0x4f0677,_0xbc9d('0x17'));_0x34fcaf['query']=_['keys'](_0xced0bb[_0xbc9d('0x22')]);_0x34fcaf[_0xbc9d('0x23')]=_['intersection'](_0x34fcaf['model'],_0x34fcaf[_0xbc9d('0x22')]);_0x1d2753[_0xbc9d('0x24')]=_[_0xbc9d('0x25')](_0x34fcaf[_0xbc9d('0x20')],qs[_0xbc9d('0x26')](_0xced0bb[_0xbc9d('0x22')][_0xbc9d('0x26')]));_0x1d2753['attributes']=_0x1d2753['attributes'][_0xbc9d('0x27')]?_0x1d2753[_0xbc9d('0x24')]:_0x34fcaf[_0xbc9d('0x20')];if(!_0xced0bb[_0xbc9d('0x22')][_0xbc9d('0x28')]('nolimit')){_0x1d2753['limit']=qs[_0xbc9d('0xb')](_0xced0bb['query'][_0xbc9d('0xb')]);_0x1d2753[_0xbc9d('0x9')]=qs[_0xbc9d('0x9')](_0xced0bb[_0xbc9d('0x22')]['offset']);}_0x1d2753['order']=qs[_0xbc9d('0x29')](_0xced0bb['query'][_0xbc9d('0x29')]);_0x1d2753[_0xbc9d('0x2a')]=qs[_0xbc9d('0x23')](_[_0xbc9d('0x2b')](_0xced0bb['query'],_0x34fcaf['filters']),_0x4f0677);if(_0xced0bb['query'][_0xbc9d('0x2c')]){_0x1d2753['where']=_[_0xbc9d('0x2d')](_0x1d2753[_0xbc9d('0x2a')],{'$or':_[_0xbc9d('0x21')](_0x4f0677,function(_0x12e55c){if(_0x12e55c[_0xbc9d('0x1e')]!==_0xbc9d('0x2e')){var _0x2fa9ff={};_0x2fa9ff[_0x12e55c[_0xbc9d('0x17')]]={'$like':'%'+_0xced0bb[_0xbc9d('0x22')][_0xbc9d('0x2c')]+'%'};return _0x2fa9ff;}})});}_0x1d2753=_[_0xbc9d('0x2d')]({},_0x1d2753,_0xced0bb[_0xbc9d('0x2f')]);var _0x4f8002={'where':_0x1d2753['where']};return db[_0xbc9d('0x1b')][_0xbc9d('0xc')](_0x4f8002)[_0xbc9d('0xf')](function(_0x48c97c){_0x2e5603[_0xbc9d('0xc')]=_0x48c97c;if(_0xced0bb[_0xbc9d('0x22')][_0xbc9d('0x30')]){_0x1d2753[_0xbc9d('0x31')]=[{'all':!![]}];}return db[_0xbc9d('0x1b')][_0xbc9d('0x32')](_0x1d2753);})['then'](function(_0x4f613b){_0x2e5603[_0xbc9d('0x33')]=_0x4f613b;return _0x2e5603;})[_0xbc9d('0xf')](respondWithFilteredResult(_0x47440e,_0x1d2753))[_0xbc9d('0x34')](handleError(_0x47440e,null));};exports[_0xbc9d('0x35')]=function(_0x5204be,_0x20d36c){var _0x931aa4={'raw':![],'where':{'id':_0x5204be[_0xbc9d('0x36')]['id']}},_0x1b6076={};_0x1b6076[_0xbc9d('0x20')]=_[_0xbc9d('0x37')](db[_0xbc9d('0x1b')]['rawAttributes']);_0x1b6076[_0xbc9d('0x22')]=_[_0xbc9d('0x37')](_0x5204be[_0xbc9d('0x22')]);_0x1b6076[_0xbc9d('0x23')]=_['intersection'](_0x1b6076[_0xbc9d('0x20')],_0x1b6076['query']);_0x931aa4[_0xbc9d('0x24')]=_[_0xbc9d('0x25')](_0x1b6076[_0xbc9d('0x20')],qs[_0xbc9d('0x26')](_0x5204be[_0xbc9d('0x22')][_0xbc9d('0x26')]));_0x931aa4['attributes']=_0x931aa4['attributes'][_0xbc9d('0x27')]?_0x931aa4[_0xbc9d('0x24')]:_0x1b6076['model'];if(_0x5204be[_0xbc9d('0x22')][_0xbc9d('0x30')]){_0x931aa4[_0xbc9d('0x31')]=[{'all':!![]}];}_0x931aa4=_[_0xbc9d('0x2d')]({},_0x931aa4,_0x5204be[_0xbc9d('0x2f')]);return db[_0xbc9d('0x1b')][_0xbc9d('0x38')](_0x931aa4)['then'](handleEntityNotFound(_0x20d36c,null))['then'](respondWithResult(_0x20d36c,null))[_0xbc9d('0x34')](handleError(_0x20d36c,null));};exports[_0xbc9d('0x39')]=function(_0x52082e,_0x55b4d9){return db['SquareProject'][_0xbc9d('0x39')](_0x52082e['body'],{})[_0xbc9d('0xf')](function(_0x232355){var _0x314859=_0x52082e[_0xbc9d('0x3a')][_0xbc9d('0x11')]({'plain':!![]});if(!_0x314859)throw new Error(_0xbc9d('0x3b'));if(_0x314859['role']===_0xbc9d('0x3a')){var _0x330a1c=_0x232355[_0xbc9d('0x11')]({'plain':!![]});var _0x5f1a5b=_0xbc9d('0x12');return db[_0xbc9d('0x3c')][_0xbc9d('0x38')]({'where':{'name':_0x5f1a5b,'userProfileId':_0x314859[_0xbc9d('0x3d')]},'raw':!![]})[_0xbc9d('0xf')](function(_0x5912df){if(_0x5912df&&_0x5912df[_0xbc9d('0x3e')]===0x0){return db[_0xbc9d('0x13')][_0xbc9d('0x39')]({'name':_0x330a1c[_0xbc9d('0x17')],'resourceId':_0x330a1c['id'],'type':_0x5912df[_0xbc9d('0x17')],'sectionId':_0x5912df['id']},{})[_0xbc9d('0xf')](function(){return _0x232355;});}else{return _0x232355;}})['catch'](function(_0x566f4d){logger['error'](_0xbc9d('0x3f'),_0x566f4d);throw _0x566f4d;});}return _0x232355;})[_0xbc9d('0xf')](respondWithResult(_0x55b4d9,0xc9))['catch'](handleError(_0x55b4d9,null));};exports[_0xbc9d('0xe')]=function(_0x2e5903,_0x5554f2){if(_0x2e5903[_0xbc9d('0x40')]['id']){delete _0x2e5903[_0xbc9d('0x40')]['id'];}return db[_0xbc9d('0x1b')][_0xbc9d('0x38')]({'where':{'id':_0x2e5903[_0xbc9d('0x36')]['id']}})[_0xbc9d('0xf')](handleEntityNotFound(_0x5554f2,null))[_0xbc9d('0xf')](saveUpdates(_0x2e5903['body'],null))[_0xbc9d('0xf')](function(_0x6c82f0){if(!_0x6c82f0)return;var _0x300ed2=_0x6c82f0['get']({'plain':!![]});return _0x300ed2;})[_0xbc9d('0xf')](function(_0x3c6bc7){var _0x1ef3cd=new Redis(config[_0xbc9d('0x5')]);_0x1ef3cd[_0xbc9d('0x41')](_0xbc9d('0x42'),JSON[_0xbc9d('0x14')](_[_0xbc9d('0x2b')](_0x3c6bc7,['id',_0xbc9d('0x17'),'production'])));return _0x3c6bc7;})[_0xbc9d('0xf')](respondWithResult(_0x5554f2,null))['catch'](handleError(_0x5554f2,null));};exports['destroy']=function(_0x87b10a,_0x557e0b){return db['SquareProject'][_0xbc9d('0x38')]({'where':{'id':_0x87b10a['params']['id']}})[_0xbc9d('0xf')](handleEntityNotFound(_0x557e0b,null))['then'](removeEntity(_0x557e0b,null))['catch'](handleError(_0x557e0b,null));}; \ No newline at end of file +var _0x8414=['UserProfileResource','agi','stringify','end','sendStatus','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','publish','pick','production','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./squareProject.socket','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','SquareProjects'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8414,0x109));var _0x4841=function(_0x2e2eab,_0x2e609a){_0x2e2eab=_0x2e2eab-0x0;var _0x2357bc=_0x8414[_0x2e2eab];return _0x2357bc;};'use strict';var _=require(_0x4841('0x0'));var Redis=require(_0x4841('0x1'));var qs=require(_0x4841('0x2'));var logger=require('../../config/logger')(_0x4841('0x3'));var config=require(_0x4841('0x4'));var db=require(_0x4841('0x5'))['db'];config['redis']=_[_0x4841('0x6')](config[_0x4841('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x4841('0x8'))(new Redis(config[_0x4841('0x7')]));require(_0x4841('0x9'))['register'](socket);function respondWithResult(_0x1128cb,_0x296c90){_0x296c90=_0x296c90||0xc8;return function(_0xf76593){if(_0xf76593){return _0x1128cb[_0x4841('0xa')](_0x296c90)[_0x4841('0xb')](_0xf76593);}};}function respondWithFilteredResult(_0x19ee14,_0x2188a9){return function(_0x444a7b){if(_0x444a7b){var _0x3ea877=typeof _0x2188a9['offset']===_0x4841('0xc')&&typeof _0x2188a9[_0x4841('0xd')]==='undefined';var _0x269adb=_0x444a7b[_0x4841('0xe')];var _0x40b31f=_0x3ea877?0x0:_0x2188a9[_0x4841('0xf')];var _0x31ff36=_0x3ea877?_0x444a7b[_0x4841('0xe')]:_0x2188a9[_0x4841('0xf')]+_0x2188a9[_0x4841('0xd')];var _0x3372c7;if(_0x31ff36>=_0x269adb){_0x31ff36=_0x269adb;_0x3372c7=0xc8;}else{_0x3372c7=0xce;}_0x19ee14[_0x4841('0xa')](_0x3372c7);return _0x19ee14[_0x4841('0x10')](_0x4841('0x11'),_0x40b31f+'-'+_0x31ff36+'/'+_0x269adb)['json'](_0x444a7b);}return null;};}function saveUpdates(_0x5206f5){return function(_0x578f9f){if(_0x578f9f){return _0x578f9f[_0x4841('0x12')](_0x5206f5)[_0x4841('0x13')](function(_0x3b753a){return _0x3b753a;});}return null;};}function removeEntity(_0x3a6cd3){return function(_0x44fe60){if(_0x44fe60){return _0x44fe60[_0x4841('0x14')]()[_0x4841('0x13')](function(){var _0x150a93=_0x44fe60[_0x4841('0x15')]({'plain':!![]});var _0x50210c=_0x4841('0x16');return db[_0x4841('0x17')][_0x4841('0x14')]({'where':{'type':_0x50210c,'resourceId':_0x150a93['id']}})[_0x4841('0x13')](function(){return _0x44fe60;});})['then'](function(){var _0x58517e=new Redis(config['redis']);_0x58517e['publish'](_0x4841('0x18'),JSON[_0x4841('0x19')]({'id':_0x44fe60['id'],'deleted':!![]}));})['then'](function(){_0x3a6cd3['status'](0xcc)[_0x4841('0x1a')]();});}};}function handleEntityNotFound(_0x36a06b){return function(_0x53e52e){if(!_0x53e52e){_0x36a06b[_0x4841('0x1b')](0x194);}return _0x53e52e;};}function handleError(_0x13c150,_0x558cc3){_0x558cc3=_0x558cc3||0x1f4;return function(_0x554eac){logger['error'](_0x554eac[_0x4841('0x1c')]);if(_0x554eac[_0x4841('0x1d')]){delete _0x554eac['name'];}_0x13c150['status'](_0x558cc3)[_0x4841('0x1e')](_0x554eac);};}exports[_0x4841('0x1f')]=function(_0x30265c,_0x3371bd){var _0x4659d9={},_0x34959e={},_0x124579={'count':0x0,'rows':[]};var _0x551e4f=_[_0x4841('0x20')](db[_0x4841('0x21')][_0x4841('0x22')],function(_0x389806){return{'name':_0x389806[_0x4841('0x23')],'type':_0x389806[_0x4841('0x24')][_0x4841('0x25')]};});_0x34959e[_0x4841('0x26')]=_[_0x4841('0x20')](_0x551e4f,_0x4841('0x1d'));_0x34959e['query']=_['keys'](_0x30265c[_0x4841('0x27')]);_0x34959e[_0x4841('0x28')]=_['intersection'](_0x34959e[_0x4841('0x26')],_0x34959e[_0x4841('0x27')]);_0x4659d9[_0x4841('0x29')]=_[_0x4841('0x2a')](_0x34959e[_0x4841('0x26')],qs[_0x4841('0x2b')](_0x30265c[_0x4841('0x27')][_0x4841('0x2b')]));_0x4659d9[_0x4841('0x29')]=_0x4659d9[_0x4841('0x29')][_0x4841('0x2c')]?_0x4659d9['attributes']:_0x34959e[_0x4841('0x26')];if(!_0x30265c[_0x4841('0x27')][_0x4841('0x2d')](_0x4841('0x2e'))){_0x4659d9['limit']=qs['limit'](_0x30265c[_0x4841('0x27')]['limit']);_0x4659d9[_0x4841('0xf')]=qs['offset'](_0x30265c[_0x4841('0x27')][_0x4841('0xf')]);}_0x4659d9[_0x4841('0x2f')]=qs[_0x4841('0x30')](_0x30265c[_0x4841('0x27')]['sort']);_0x4659d9[_0x4841('0x31')]=qs['filters'](_['pick'](_0x30265c['query'],_0x34959e[_0x4841('0x28')]),_0x551e4f);if(_0x30265c['query']['filter']){_0x4659d9[_0x4841('0x31')]=_[_0x4841('0x32')](_0x4659d9[_0x4841('0x31')],{'$or':_[_0x4841('0x20')](_0x551e4f,function(_0x5a1799){if(_0x5a1799[_0x4841('0x24')]!==_0x4841('0x33')){var _0x2eef2a={};_0x2eef2a[_0x5a1799[_0x4841('0x1d')]]={'$like':'%'+_0x30265c[_0x4841('0x27')][_0x4841('0x34')]+'%'};return _0x2eef2a;}})});}_0x4659d9=_[_0x4841('0x32')]({},_0x4659d9,_0x30265c['options']);var _0x50caca={'where':_0x4659d9[_0x4841('0x31')]};return db[_0x4841('0x21')][_0x4841('0xe')](_0x50caca)['then'](function(_0x540e88){_0x124579[_0x4841('0xe')]=_0x540e88;if(_0x30265c[_0x4841('0x27')][_0x4841('0x35')]){_0x4659d9['include']=[{'all':!![]}];}return db['SquareProject'][_0x4841('0x36')](_0x4659d9);})[_0x4841('0x13')](function(_0x5b8445){_0x124579[_0x4841('0x37')]=_0x5b8445;return _0x124579;})[_0x4841('0x13')](respondWithFilteredResult(_0x3371bd,_0x4659d9))['catch'](handleError(_0x3371bd,null));};exports[_0x4841('0x38')]=function(_0xebf7d2,_0x479eb2){var _0x220812={'raw':![],'where':{'id':_0xebf7d2[_0x4841('0x39')]['id']}},_0x187813={};_0x187813[_0x4841('0x26')]=_[_0x4841('0x3a')](db['SquareProject'][_0x4841('0x22')]);_0x187813['query']=_['keys'](_0xebf7d2['query']);_0x187813[_0x4841('0x28')]=_[_0x4841('0x2a')](_0x187813[_0x4841('0x26')],_0x187813['query']);_0x220812['attributes']=_[_0x4841('0x2a')](_0x187813['model'],qs[_0x4841('0x2b')](_0xebf7d2[_0x4841('0x27')]['fields']));_0x220812[_0x4841('0x29')]=_0x220812['attributes'][_0x4841('0x2c')]?_0x220812[_0x4841('0x29')]:_0x187813[_0x4841('0x26')];if(_0xebf7d2[_0x4841('0x27')][_0x4841('0x35')]){_0x220812['include']=[{'all':!![]}];}_0x220812=_['merge']({},_0x220812,_0xebf7d2[_0x4841('0x3b')]);return db['SquareProject'][_0x4841('0x3c')](_0x220812)[_0x4841('0x13')](handleEntityNotFound(_0x479eb2,null))[_0x4841('0x13')](respondWithResult(_0x479eb2,null))[_0x4841('0x3d')](handleError(_0x479eb2,null));};exports['create']=function(_0x397536,_0x2e3ee3){return db[_0x4841('0x21')][_0x4841('0x3e')](_0x397536[_0x4841('0x3f')],{})[_0x4841('0x13')](function(_0xf46851){var _0x170334=_0x397536[_0x4841('0x40')][_0x4841('0x15')]({'plain':!![]});if(!_0x170334)throw new Error(_0x4841('0x41'));if(_0x170334[_0x4841('0x42')]==='user'){var _0x24ba03=_0xf46851['get']({'plain':!![]});var _0x5c609b=_0x4841('0x16');return db['UserProfileSection'][_0x4841('0x3c')]({'where':{'name':_0x5c609b,'userProfileId':_0x170334[_0x4841('0x43')]},'raw':!![]})[_0x4841('0x13')](function(_0x88379a){if(_0x88379a&&_0x88379a[_0x4841('0x44')]===0x0){return db[_0x4841('0x17')][_0x4841('0x3e')]({'name':_0x24ba03[_0x4841('0x1d')],'resourceId':_0x24ba03['id'],'type':_0x88379a['name'],'sectionId':_0x88379a['id']},{})[_0x4841('0x13')](function(){return _0xf46851;});}else{return _0xf46851;}})[_0x4841('0x3d')](function(_0x789f1e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x789f1e);throw _0x789f1e;});}return _0xf46851;})[_0x4841('0x13')](respondWithResult(_0x2e3ee3,0xc9))['catch'](handleError(_0x2e3ee3,null));};exports[_0x4841('0x12')]=function(_0x5a132b,_0x37624b){if(_0x5a132b[_0x4841('0x3f')]['id']){delete _0x5a132b[_0x4841('0x3f')]['id'];}return db[_0x4841('0x21')][_0x4841('0x3c')]({'where':{'id':_0x5a132b[_0x4841('0x39')]['id']}})['then'](handleEntityNotFound(_0x37624b,null))['then'](saveUpdates(_0x5a132b[_0x4841('0x3f')],null))[_0x4841('0x13')](function(_0x4fbe7e){if(!_0x4fbe7e)return;var _0x20befb=_0x4fbe7e['get']({'plain':!![]});return _0x20befb;})[_0x4841('0x13')](function(_0xe21fca){var _0x5b041c=new Redis(config[_0x4841('0x7')]);_0x5b041c[_0x4841('0x45')](_0x4841('0x18'),JSON[_0x4841('0x19')](_[_0x4841('0x46')](_0xe21fca,['id',_0x4841('0x1d'),_0x4841('0x47')])));return _0xe21fca;})[_0x4841('0x13')](respondWithResult(_0x37624b,null))[_0x4841('0x3d')](handleError(_0x37624b,null));};exports[_0x4841('0x14')]=function(_0x1511ea,_0x37bf0f){return db[_0x4841('0x21')][_0x4841('0x3c')]({'where':{'id':_0x1511ea[_0x4841('0x39')]['id']}})[_0x4841('0x13')](handleEntityNotFound(_0x37bf0f,null))[_0x4841('0x13')](removeEntity(_0x37bf0f,null))['catch'](handleError(_0x37bf0f,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 90cc48e..1f5fcc1 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 _0x9cfd=['exports','../../mysqldb','SquareProject','setMaxListeners','remove','emit','hook'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x9cfd,0x1a5));var _0xd9cf=function(_0x1ba155,_0x23466d){_0x1ba155=_0x1ba155-0x0;var _0x10ffb5=_0x9cfd[_0x1ba155];return _0x10ffb5;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xd9cf('0x0'))['db'][_0xd9cf('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd9cf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd9cf('0x3')};function emitEvent(_0x218431){return function(_0x470177,_0x5db25e,_0x4d101c){SquareProjectEvents[_0xd9cf('0x4')](_0x218431+':'+_0x470177['id'],_0x470177);SquareProjectEvents[_0xd9cf('0x4')](_0x218431,_0x470177);_0x4d101c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xd9cf('0x5')](e,emitEvent(event));}}module[_0xd9cf('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x8ab4=['setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ab4,0x6d));var _0x48ab=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x8ab4[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require(_0x48ab('0x0'));var SquareProject=require(_0x48ab('0x1'))['db'][_0x48ab('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x48ab('0x3')](0x0);var events={'afterCreate':_0x48ab('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x39fbff){return function(_0x5e36bc,_0x459d43,_0x55f228){SquareProjectEvents[_0x48ab('0x5')](_0x39fbff+':'+_0x5e36bc['id'],_0x5e36bc);SquareProjectEvents[_0x48ab('0x5')](_0x39fbff,_0x5e36bc);_0x55f228(null);};}for(var e in events){if(events[_0x48ab('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x48ab('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index d81c4de..17b6bfe 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 _0xf34c=['SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x5e7e66,_0x358d66){var _0x1fa296=function(_0x2be8a9){while(--_0x2be8a9){_0x5e7e66['push'](_0x5e7e66['shift']());}};_0x1fa296(++_0x358d66);}(_0xf34c,0x1d8));var _0xcf34=function(_0xe9540f,_0x1d9dde){_0xe9540f=_0xe9540f-0x0;var _0xccf3fc=_0xf34c[_0xe9540f];return _0xccf3fc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf34('0x0'))(_0xcf34('0x1'));var moment=require(_0xcf34('0x2'));var BPromise=require(_0xcf34('0x3'));var rp=require(_0xcf34('0x4'));var fs=require('fs');var path=require(_0xcf34('0x5'));var rimraf=require(_0xcf34('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x41ee8d,_0x2f81f6){return _0x41ee8d[_0xcf34('0x7')](_0xcf34('0x8'),attributes,{'tableName':_0xcf34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2086b6,_0x15e2ba,_0x52fccd){if(_0x2086b6[_0xcf34('0xa')](_0xcf34('0xb'))){_0x2086b6[_0xcf34('0xc')]=moment()['format'](_0xcf34('0xd'));}if(_0x2086b6[_0xcf34('0xa')]('production')){_0x2086b6[_0xcf34('0xe')]=moment()[_0xcf34('0xf')](_0xcf34('0xd'));}_0x52fccd(null,_0x2086b6);}}});}; \ No newline at end of file +var _0x6f5d=['api','moment','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util'];(function(_0x4cdba5,_0x5373a7){var _0x3be43d=function(_0x5e007c){while(--_0x5e007c){_0x4cdba5['push'](_0x4cdba5['shift']());}};_0x3be43d(++_0x5373a7);}(_0x6f5d,0x142));var _0xd6f5=function(_0x1c5d70,_0x3f0c19){_0x1c5d70=_0x1c5d70-0x0;var _0x530b53=_0x6f5d[_0x1c5d70];return _0x530b53;};'use strict';var _=require(_0xd6f5('0x0'));var util=require(_0xd6f5('0x1'));var logger=require('../../config/logger')(_0xd6f5('0x2'));var moment=require(_0xd6f5('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f5('0x4'));var fs=require('fs');var path=require(_0xd6f5('0x5'));var rimraf=require(_0xd6f5('0x6'));var config=require(_0xd6f5('0x7'));var attributes=require(_0xd6f5('0x8'));module[_0xd6f5('0x9')]=function(_0x2385c2,_0x5117ab){return _0x2385c2['define']('SquareProject',attributes,{'tableName':_0xd6f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39d3fb,_0x5baf8d,_0x1d9a41){if(_0x39d3fb['changed'](_0xd6f5('0xb'))){_0x39d3fb[_0xd6f5('0xc')]=moment()[_0xd6f5('0xd')](_0xd6f5('0xe'));}if(_0x39d3fb[_0xd6f5('0xf')](_0xd6f5('0x10'))){_0x39d3fb[_0xd6f5('0x11')]=moment()[_0xd6f5('0xd')](_0xd6f5('0xe'));}_0x1d9a41(null,_0x39d3fb);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 18b6ad3..a2ee2f0 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 _0xfd53=['ShowSquareProject','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','register','SquareProject','findAll','options','where','attributes','limit','include','map','model','then','info','GetSquareProjects','stringify','catch','error','message','raw','debug'];(function(_0x224ad2,_0x370f4e){var _0x401747=function(_0x18f5d5){while(--_0x18f5d5){_0x224ad2['push'](_0x224ad2['shift']());}};_0x401747(++_0x370f4e);}(_0xfd53,0xe9));var _0x3fd5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xfd53[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var Redis=require(_0x3fd5('0x0'));var db=require(_0x3fd5('0x1'))['db'];var logger=require(_0x3fd5('0x2'))(_0x3fd5('0x3'));var config=require(_0x3fd5('0x4'));config[_0x3fd5('0x5')]=_[_0x3fd5('0x6')](config[_0x3fd5('0x5')],{'host':_0x3fd5('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fd5('0x5')]));require(_0x3fd5('0x8'))[_0x3fd5('0x9')](socket);exports['GetSquareProjects']=function(_0x5c2703){var _0x3c5005=this;return new Promise(function(_0x4b26b9,_0x8492e2){return db[_0x3fd5('0xa')][_0x3fd5('0xb')]({'raw':_0x5c2703[_0x3fd5('0xc')]?_0x5c2703[_0x3fd5('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x5c2703['options']?_0x5c2703['options'][_0x3fd5('0xd')]||null:null,'attributes':_0x5c2703[_0x3fd5('0xc')]?_0x5c2703[_0x3fd5('0xc')][_0x3fd5('0xe')]||null:null,'limit':_0x5c2703[_0x3fd5('0xc')]?_0x5c2703[_0x3fd5('0xc')][_0x3fd5('0xf')]||null:null,'include':_0x5c2703[_0x3fd5('0xc')]?_0x5c2703[_0x3fd5('0xc')][_0x3fd5('0x10')]?_[_0x3fd5('0x11')](_0x5c2703[_0x3fd5('0xc')][_0x3fd5('0x10')],function(_0x327b10){return{'model':db[_0x327b10['model']],'as':_0x327b10['as'],'attributes':_0x327b10[_0x3fd5('0xe')],'include':_0x327b10[_0x3fd5('0x10')]?_[_0x3fd5('0x11')](_0x327b10[_0x3fd5('0x10')],function(_0x2e0819){return{'model':db[_0x2e0819['model']],'as':_0x2e0819['as'],'attributes':_0x2e0819[_0x3fd5('0xe')],'include':_0x2e0819[_0x3fd5('0x10')]?_[_0x3fd5('0x11')](_0x2e0819[_0x3fd5('0x10')],function(_0x20fb09){return{'model':db[_0x20fb09[_0x3fd5('0x12')]],'as':_0x20fb09['as'],'attributes':_0x20fb09[_0x3fd5('0xe')]};}):[]};}):[]};}):[]:[]})[_0x3fd5('0x13')](function(_0x50e326){logger[_0x3fd5('0x14')](_0x3fd5('0x15'),_0x5c2703);logger['debug'](_0x3fd5('0x15'),_0x5c2703,JSON[_0x3fd5('0x16')](_0x50e326));_0x4b26b9(_0x50e326);})[_0x3fd5('0x17')](function(_0x2cb80a){logger[_0x3fd5('0x18')](_0x3fd5('0x15'),_0x2cb80a[_0x3fd5('0x19')],_0x5c2703);_0x8492e2(_0x3c5005[_0x3fd5('0x18')](0x1f4,_0x2cb80a[_0x3fd5('0x19')]));});});};exports['ShowSquareProject']=function(_0x21cd2b){var _0x361b54=this;return new Promise(function(_0x3514ff,_0x12971e){return db[_0x3fd5('0xa')]['find']({'raw':_0x21cd2b[_0x3fd5('0xc')]?_0x21cd2b[_0x3fd5('0xc')][_0x3fd5('0x1a')]===undefined?!![]:![]:!![],'where':_0x21cd2b['options']?_0x21cd2b[_0x3fd5('0xc')][_0x3fd5('0xd')]||null:null,'attributes':_0x21cd2b[_0x3fd5('0xc')]?_0x21cd2b['options']['attributes']||null:null,'include':_0x21cd2b[_0x3fd5('0xc')]?_0x21cd2b[_0x3fd5('0xc')][_0x3fd5('0x10')]?_[_0x3fd5('0x11')](_0x21cd2b[_0x3fd5('0xc')][_0x3fd5('0x10')],function(_0x14d67f){return{'model':db[_0x14d67f[_0x3fd5('0x12')]],'as':_0x14d67f['as'],'attributes':_0x14d67f[_0x3fd5('0xe')],'include':_0x14d67f[_0x3fd5('0x10')]?_['map'](_0x14d67f[_0x3fd5('0x10')],function(_0x3e85a5){return{'model':db[_0x3e85a5[_0x3fd5('0x12')]],'as':_0x3e85a5['as'],'attributes':_0x3e85a5[_0x3fd5('0xe')],'include':_0x3e85a5[_0x3fd5('0x10')]?_['map'](_0x3e85a5[_0x3fd5('0x10')],function(_0x4ddc3c){return{'model':db[_0x4ddc3c['model']],'as':_0x4ddc3c['as'],'attributes':_0x4ddc3c[_0x3fd5('0xe')]};}):[]};}):[]};}):[]:[]})[_0x3fd5('0x13')](function(_0x5b7ae1){logger['info']('ShowSquareProject',_0x21cd2b);logger[_0x3fd5('0x1b')]('ShowSquareProject',_0x21cd2b,JSON['stringify'](_0x5b7ae1));_0x3514ff(_0x5b7ae1);})[_0x3fd5('0x17')](function(_0x2d1e99){logger['error'](_0x3fd5('0x1c'),_0x2d1e99[_0x3fd5('0x19')],_0x21cd2b);_0x12971e(_0x361b54[_0x3fd5('0x18')](0x1f4,_0x2d1e99[_0x3fd5('0x19')]));});});}; \ No newline at end of file +var _0x3a23=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','error','ShowSquareProject','find','info','catch','message','ioredis','../../mysqldb'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x3a23,0xa6));var _0x33a2=function(_0xe14dce,_0x226436){_0xe14dce=_0xe14dce-0x0;var _0x396c9e=_0x3a23[_0xe14dce];return _0x396c9e;};'use strict';var _=require('lodash');var Redis=require(_0x33a2('0x0'));var db=require(_0x33a2('0x1'))['db'];var logger=require(_0x33a2('0x2'))(_0x33a2('0x3'));var config=require(_0x33a2('0x4'));config[_0x33a2('0x5')]=_[_0x33a2('0x6')](config[_0x33a2('0x5')],{'host':_0x33a2('0x7'),'port':0x18eb});var socket=require(_0x33a2('0x8'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);exports[_0x33a2('0x9')]=function(_0xb4ded8){var _0x5ba79d=this;return new Promise(function(_0x55f1aa,_0x16d8d6){return db[_0x33a2('0xa')]['findAll']({'raw':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xc')]===undefined?!![]:![]:!![],'where':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xd')]||null:null,'attributes':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xe')]||null:null,'limit':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xf')]||null:null,'include':_0xb4ded8['options']?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0x10')]?_[_0x33a2('0x11')](_0xb4ded8[_0x33a2('0xb')][_0x33a2('0x10')],function(_0x4d54cc){return{'model':db[_0x4d54cc[_0x33a2('0x12')]],'as':_0x4d54cc['as'],'attributes':_0x4d54cc['attributes'],'include':_0x4d54cc[_0x33a2('0x10')]?_[_0x33a2('0x11')](_0x4d54cc[_0x33a2('0x10')],function(_0x452dfc){return{'model':db[_0x452dfc[_0x33a2('0x12')]],'as':_0x452dfc['as'],'attributes':_0x452dfc[_0x33a2('0xe')],'include':_0x452dfc['include']?_[_0x33a2('0x11')](_0x452dfc[_0x33a2('0x10')],function(_0x56891b){return{'model':db[_0x56891b[_0x33a2('0x12')]],'as':_0x56891b['as'],'attributes':_0x56891b[_0x33a2('0xe')]};}):[]};}):[]};}):[]:[]})[_0x33a2('0x13')](function(_0x3a8710){logger['info'](_0x33a2('0x9'),_0xb4ded8);logger[_0x33a2('0x14')]('GetSquareProjects',_0xb4ded8,JSON[_0x33a2('0x15')](_0x3a8710));_0x55f1aa(_0x3a8710);})['catch'](function(_0x281dc1){logger[_0x33a2('0x16')](_0x33a2('0x9'),_0x281dc1['message'],_0xb4ded8);_0x16d8d6(_0x5ba79d['error'](0x1f4,_0x281dc1['message']));});});};exports[_0x33a2('0x17')]=function(_0x1be97f){var _0x2f1be1=this;return new Promise(function(_0x6e4546,_0x1f04a6){return db[_0x33a2('0xa')][_0x33a2('0x18')]({'raw':_0x1be97f[_0x33a2('0xb')]?_0x1be97f[_0x33a2('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x1be97f[_0x33a2('0xb')]?_0x1be97f[_0x33a2('0xb')][_0x33a2('0xd')]||null:null,'attributes':_0x1be97f['options']?_0x1be97f[_0x33a2('0xb')][_0x33a2('0xe')]||null:null,'include':_0x1be97f[_0x33a2('0xb')]?_0x1be97f['options'][_0x33a2('0x10')]?_[_0x33a2('0x11')](_0x1be97f['options'][_0x33a2('0x10')],function(_0x2cae74){return{'model':db[_0x2cae74[_0x33a2('0x12')]],'as':_0x2cae74['as'],'attributes':_0x2cae74['attributes'],'include':_0x2cae74[_0x33a2('0x10')]?_[_0x33a2('0x11')](_0x2cae74[_0x33a2('0x10')],function(_0x43eac7){return{'model':db[_0x43eac7[_0x33a2('0x12')]],'as':_0x43eac7['as'],'attributes':_0x43eac7[_0x33a2('0xe')],'include':_0x43eac7[_0x33a2('0x10')]?_['map'](_0x43eac7[_0x33a2('0x10')],function(_0x5cb150){return{'model':db[_0x5cb150[_0x33a2('0x12')]],'as':_0x5cb150['as'],'attributes':_0x5cb150[_0x33a2('0xe')]};}):[]};}):[]};}):[]:[]})[_0x33a2('0x13')](function(_0x276162){logger[_0x33a2('0x19')]('ShowSquareProject',_0x1be97f);logger[_0x33a2('0x14')](_0x33a2('0x17'),_0x1be97f,JSON[_0x33a2('0x15')](_0x276162));_0x6e4546(_0x276162);})[_0x33a2('0x1a')](function(_0x3c83cb){logger['error'](_0x33a2('0x17'),_0x3c83cb['message'],_0x1be97f);_0x1f04a6(_0x2f1be1[_0x33a2('0x16')](0x1f4,_0x3c83cb[_0x33a2('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 65a79c0..121945d 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 _0x997a=['emit','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x324961,_0x428afa){var _0x14a054=function(_0x4c6bd0){while(--_0x4c6bd0){_0x324961['push'](_0x324961['shift']());}};_0x14a054(++_0x428afa);}(_0x997a,0x74));var _0xa997=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x997a[_0x17d9e3];return _0x14192d;};'use strict';var SquareProjectEvents=require(_0xa997('0x0'));var events=[_0xa997('0x1'),_0xa997('0x2'),_0xa997('0x3')];function createListener(_0x3734c3,_0xa89abf){return function(_0x199ac2){_0xa89abf[_0xa997('0x4')](_0x3734c3,_0x199ac2);};}function removeListener(_0x1a1b5b,_0x405847){return function(){SquareProjectEvents['removeListener'](_0x1a1b5b,_0x405847);};}exports[_0xa997('0x5')]=function(_0x239291){for(var _0x43672e=0x0,_0x409d42=events[_0xa997('0x6')];_0x43672e<_0x409d42;_0x43672e++){var _0x47ef47=events[_0x43672e];var _0x3e72ff=createListener(_0xa997('0x7')+_0x47ef47,_0x239291);SquareProjectEvents['on'](_0x47ef47,_0x3e72ff);}}; \ No newline at end of file +var _0x9ca6=['removeListener','length','squareProject:','save','remove','update','emit'];(function(_0x460d3c,_0x3786ee){var _0x205e7e=function(_0x1009eb){while(--_0x1009eb){_0x460d3c['push'](_0x460d3c['shift']());}};_0x205e7e(++_0x3786ee);}(_0x9ca6,0x1ca));var _0x69ca=function(_0x3c2662,_0x2117ba){_0x3c2662=_0x3c2662-0x0;var _0x497079=_0x9ca6[_0x3c2662];return _0x497079;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x69ca('0x0'),_0x69ca('0x1'),_0x69ca('0x2')];function createListener(_0xcbc095,_0x33637b){return function(_0x3c65ed){_0x33637b[_0x69ca('0x3')](_0xcbc095,_0x3c65ed);};}function removeListener(_0x21d872,_0x495f41){return function(){SquareProjectEvents[_0x69ca('0x4')](_0x21d872,_0x495f41);};}exports['register']=function(_0x15f4c7){for(var _0x4d195a=0x0,_0x159ebd=events[_0x69ca('0x5')];_0x4d195a<_0x159ebd;_0x4d195a++){var _0x3305b4=events[_0x4d195a];var _0x5eab2f=createListener(_0x69ca('0x6')+_0x3305b4,_0x15f4c7);SquareProjectEvents['on'](_0x3305b4,_0x5eab2f);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 20c3e11..f7275a0 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0x326f,0xd1));var _0xf326=function(_0x15fc42,_0x1f0db1){_0x15fc42=_0x15fc42-0x0;var _0x21a38d=_0x326f[_0x15fc42];return _0x21a38d;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x45f011,_0x1a4f4c){var _0x32ffa8=function(_0x4edee5){while(--_0x4edee5){_0x45f011['push'](_0x45f011['shift']());}};_0x32ffa8(++_0x1a4f4c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21a60b,_0x1108bf){_0x21a60b=_0x21a60b-0x0;var _0x369d41=_0x1cb9[_0x21a60b];return _0x369d41;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 0210ed2..5f909d7 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 _0x7dfd=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','savePath'];(function(_0x206dff,_0x5b9498){var _0x1b0310=function(_0x4f32ac){while(--_0x4f32ac){_0x206dff['push'](_0x206dff['shift']());}};_0x1b0310(++_0x5b9498);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'callerid':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'extension':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'dnid':{'type':Sequelize[_0xd7df('0x2')]},'projectName':{'type':Sequelize[_0xd7df('0x2')]},'saveName':{'type':Sequelize[_0xd7df('0x2')]},'filename':{'type':Sequelize[_0xd7df('0x2')]},'savePath':{'type':Sequelize[_0xd7df('0x2')]},'format':{'type':Sequelize[_0xd7df('0x3')],'get':function(){var _0x16e50='';var _0x2c48a4=this['getDataValue'](_0xd7df('0x4'));if(_0x2c48a4){_0x16e50=_0x2c48a4[_0xd7df('0x5')](_0x2c48a4[_0xd7df('0x6')]('.'));}return _0x16e50;}}}; \ No newline at end of file +var _0x98a8=['exports','STRING','VIRTUAL','savePath','substring','lastIndexOf','sequelize'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0x98a8,0x12c));var _0x898a=function(_0x57fe9f,_0x2375e8){_0x57fe9f=_0x57fe9f-0x0;var _0x3f38b9=_0x98a8[_0x57fe9f];return _0x3f38b9;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'callerid':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'extension':{'type':Sequelize[_0x898a('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'dnid':{'type':Sequelize[_0x898a('0x2')]},'projectName':{'type':Sequelize[_0x898a('0x2')]},'saveName':{'type':Sequelize[_0x898a('0x2')]},'filename':{'type':Sequelize[_0x898a('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x898a('0x3')],'get':function(){var _0x564583='';var _0xfa8c50=this['getDataValue'](_0x898a('0x4'));if(_0xfa8c50){_0x564583=_0xfa8c50[_0x898a('0x5')](_0xfa8c50[_0x898a('0x6')]('.'));}return _0x564583;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a6fd013..20a54bd 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 _0xba84=['error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','length','create','body','find','params','uniqueid','savePath','format','secrets','recording','existsSync','ValidationError','filename','download','unlink','message','isNil','Entity\x20not\x20found','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x22bda1,_0x115e8a){var _0x47fce7=function(_0x23c164){while(--_0x23c164){_0x22bda1['push'](_0x22bda1['shift']());}};_0x47fce7(++_0x115e8a);}(_0xba84,0x1a7));var _0x4ba8=function(_0x3e4091,_0x2f5f74){_0x3e4091=_0x3e4091-0x0;var _0x511ec7=_0xba84[_0x3e4091];return _0x511ec7;};'use strict';var emlformat=require(_0x4ba8('0x0'));var rimraf=require(_0x4ba8('0x1'));var zipdir=require(_0x4ba8('0x2'));var jsonpatch=require(_0x4ba8('0x3'));var rp=require('request-promise');var moment=require(_0x4ba8('0x4'));var BPromise=require(_0x4ba8('0x5'));var Mustache=require('mustache');var util=require(_0x4ba8('0x6'));var path=require(_0x4ba8('0x7'));var sox=require('sox');var csv=require(_0x4ba8('0x8'));var ejs=require(_0x4ba8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ba8('0xa'));var squel=require(_0x4ba8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ba8('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ba8('0xd'));var Redis=require(_0x4ba8('0xe'));var authService=require(_0x4ba8('0xf'));var qs=require(_0x4ba8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ba8('0x11'))('api');var utils=require(_0x4ba8('0x12'));var config=require(_0x4ba8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ba8('0x14'))['db'];function respondWithStatusCode(_0x4087a9,_0x28cf33){_0x28cf33=_0x28cf33||0xcc;return function(_0x32561f){if(_0x32561f){return _0x4087a9[_0x4ba8('0x15')](_0x28cf33);}return _0x4087a9[_0x4ba8('0x16')](_0x28cf33)[_0x4ba8('0x17')]();};}function respondWithResult(_0x250355,_0x3017c0){_0x3017c0=_0x3017c0||0xc8;return function(_0x4c502e){if(_0x4c502e){return _0x250355['status'](_0x3017c0)[_0x4ba8('0x18')](_0x4c502e);}};}function respondWithFilteredResult(_0x428ad4,_0x1f8fc7){return function(_0x3b4d77){if(_0x3b4d77){var _0x2d9704=typeof _0x1f8fc7[_0x4ba8('0x19')]===_0x4ba8('0x1a')&&typeof _0x1f8fc7['limit']===_0x4ba8('0x1a');var _0x4cc7d8=_0x3b4d77[_0x4ba8('0x1b')];var _0x4a973d=_0x2d9704?0x0:_0x1f8fc7[_0x4ba8('0x19')];var _0x5ee196=_0x2d9704?_0x3b4d77[_0x4ba8('0x1b')]:_0x1f8fc7[_0x4ba8('0x19')]+_0x1f8fc7[_0x4ba8('0x1c')];var _0x37e14a;if(_0x5ee196>=_0x4cc7d8){_0x5ee196=_0x4cc7d8;_0x37e14a=0xc8;}else{_0x37e14a=0xce;}_0x428ad4[_0x4ba8('0x16')](_0x37e14a);return _0x428ad4[_0x4ba8('0x1d')](_0x4ba8('0x1e'),_0x4a973d+'-'+_0x5ee196+'/'+_0x4cc7d8)[_0x4ba8('0x18')](_0x3b4d77);}return null;};}function patchUpdates(_0x454bc0){return function(_0x50642e){try{jsonpatch[_0x4ba8('0x1f')](_0x50642e,_0x454bc0,!![]);}catch(_0xf7c785){return BPromise[_0x4ba8('0x20')](_0xf7c785);}return _0x50642e[_0x4ba8('0x21')]();};}function saveUpdates(_0x1a22e0,_0x43246f){return function(_0x563e9a){if(_0x563e9a){return _0x563e9a[_0x4ba8('0x22')](_0x1a22e0)[_0x4ba8('0x23')](function(_0x2fdcae){return _0x2fdcae;});}return null;};}function removeEntity(_0x1778b1,_0x54cb9f){return function(_0x270d24){if(_0x270d24){return _0x270d24[_0x4ba8('0x24')]()[_0x4ba8('0x23')](function(){_0x1778b1['status'](0xcc)[_0x4ba8('0x17')]();});}};}function handleEntityNotFound(_0x1006b1,_0x352890){return function(_0x3f564f){if(!_0x3f564f){_0x1006b1['sendStatus'](0x194);}return _0x3f564f;};}function handleError(_0x3bacc5,_0x113589){_0x113589=_0x113589||0x1f4;return function(_0x5721d8){logger[_0x4ba8('0x25')](_0x5721d8[_0x4ba8('0x26')]);if(_0x5721d8[_0x4ba8('0x27')]){delete _0x5721d8[_0x4ba8('0x27')];}_0x3bacc5[_0x4ba8('0x16')](_0x113589)[_0x4ba8('0x28')](_0x5721d8);};}exports[_0x4ba8('0x29')]=function(_0x1acee5,_0x360ac3){var _0x43d64c={},_0x3227a1={},_0x30ec33={'count':0x0,'rows':[]};var _0x41a5b4=_[_0x4ba8('0x2a')](db[_0x4ba8('0x2b')][_0x4ba8('0x2c')],function(_0x3a184d){return{'name':_0x3a184d[_0x4ba8('0x2d')],'type':_0x3a184d[_0x4ba8('0x2e')][_0x4ba8('0x2f')]};});_0x3227a1[_0x4ba8('0x30')]=_['map'](_0x41a5b4,_0x4ba8('0x27'));_0x3227a1['query']=_[_0x4ba8('0x31')](_0x1acee5[_0x4ba8('0x32')]);_0x3227a1['filters']=_[_0x4ba8('0x33')](_0x3227a1[_0x4ba8('0x30')],_0x3227a1[_0x4ba8('0x32')]);_0x43d64c['attributes']=_[_0x4ba8('0x33')](_0x3227a1[_0x4ba8('0x30')],qs['fields'](_0x1acee5[_0x4ba8('0x32')][_0x4ba8('0x34')]));_0x43d64c['attributes']=_0x43d64c[_0x4ba8('0x35')]['length']?_0x43d64c[_0x4ba8('0x35')]:_0x3227a1[_0x4ba8('0x30')];if(!_0x1acee5[_0x4ba8('0x32')]['hasOwnProperty'](_0x4ba8('0x36'))){_0x43d64c[_0x4ba8('0x1c')]=qs['limit'](_0x1acee5[_0x4ba8('0x32')][_0x4ba8('0x1c')]);_0x43d64c['offset']=qs[_0x4ba8('0x19')](_0x1acee5['query']['offset']);}_0x43d64c[_0x4ba8('0x37')]=qs[_0x4ba8('0x38')](_0x1acee5[_0x4ba8('0x32')][_0x4ba8('0x38')]);_0x43d64c[_0x4ba8('0x39')]=qs[_0x4ba8('0x3a')](_[_0x4ba8('0x3b')](_0x1acee5[_0x4ba8('0x32')],_0x3227a1[_0x4ba8('0x3a')]),_0x41a5b4);if(_0x1acee5[_0x4ba8('0x32')][_0x4ba8('0x3c')]){_0x43d64c[_0x4ba8('0x39')]=_[_0x4ba8('0x3d')](_0x43d64c[_0x4ba8('0x39')],{'$or':_[_0x4ba8('0x2a')](_0x41a5b4,function(_0x3b5e86){if(_0x3b5e86[_0x4ba8('0x2e')]!==_0x4ba8('0x3e')){var _0x2d7fad={};_0x2d7fad[_0x3b5e86[_0x4ba8('0x27')]]={'$like':'%'+_0x1acee5[_0x4ba8('0x32')][_0x4ba8('0x3c')]+'%'};return _0x2d7fad;}})});}_0x43d64c=_[_0x4ba8('0x3d')]({},_0x43d64c,_0x1acee5[_0x4ba8('0x3f')]);var _0xcb3a87={'where':_0x43d64c[_0x4ba8('0x39')]};return db['SquareRecording'][_0x4ba8('0x1b')](_0xcb3a87)[_0x4ba8('0x23')](function(_0x3d924b){_0x30ec33['count']=_0x3d924b;if(_0x1acee5[_0x4ba8('0x32')][_0x4ba8('0x40')]){_0x43d64c[_0x4ba8('0x41')]=[{'all':!![]}];}return db[_0x4ba8('0x2b')]['findAll'](_0x43d64c);})[_0x4ba8('0x23')](function(_0x281b4a){_0x30ec33[_0x4ba8('0x42')]=_0x281b4a;return _0x30ec33;})[_0x4ba8('0x23')](respondWithFilteredResult(_0x360ac3,_0x43d64c))[_0x4ba8('0x43')](handleError(_0x360ac3,null));};exports[_0x4ba8('0x44')]=function(_0x7e4da6,_0x2cd13a){var _0x17e975={'raw':!![],'where':{'id':_0x7e4da6['params']['id']}},_0x125ee3={};_0x125ee3[_0x4ba8('0x30')]=_['keys'](db[_0x4ba8('0x2b')]['rawAttributes']);_0x125ee3['query']=_[_0x4ba8('0x31')](_0x7e4da6['query']);_0x125ee3[_0x4ba8('0x3a')]=_['intersection'](_0x125ee3[_0x4ba8('0x30')],_0x125ee3[_0x4ba8('0x32')]);_0x17e975['attributes']=_[_0x4ba8('0x33')](_0x125ee3[_0x4ba8('0x30')],qs[_0x4ba8('0x34')](_0x7e4da6['query'][_0x4ba8('0x34')]));_0x17e975[_0x4ba8('0x35')]=_0x17e975[_0x4ba8('0x35')][_0x4ba8('0x45')]?_0x17e975[_0x4ba8('0x35')]:_0x125ee3[_0x4ba8('0x30')];if(_0x7e4da6[_0x4ba8('0x32')][_0x4ba8('0x40')]){_0x17e975[_0x4ba8('0x41')]=[{'all':!![]}];}_0x17e975=_['merge']({},_0x17e975,_0x7e4da6[_0x4ba8('0x3f')]);return db[_0x4ba8('0x2b')]['find'](_0x17e975)[_0x4ba8('0x23')](handleEntityNotFound(_0x2cd13a,null))[_0x4ba8('0x23')](respondWithResult(_0x2cd13a,null))['catch'](handleError(_0x2cd13a,null));};exports['create']=function(_0x5ca76e,_0x1b9eee){return db[_0x4ba8('0x2b')][_0x4ba8('0x46')](_0x5ca76e[_0x4ba8('0x47')],{})['then'](respondWithResult(_0x1b9eee,0xc9))[_0x4ba8('0x43')](handleError(_0x1b9eee,null));};exports['update']=function(_0x284bc6,_0x1eec7a){if(_0x284bc6[_0x4ba8('0x47')]['id']){delete _0x284bc6[_0x4ba8('0x47')]['id'];}return db[_0x4ba8('0x2b')][_0x4ba8('0x48')]({'where':{'id':_0x284bc6[_0x4ba8('0x49')]['id']}})['then'](handleEntityNotFound(_0x1eec7a,null))['then'](saveUpdates(_0x284bc6[_0x4ba8('0x47')],null))[_0x4ba8('0x23')](respondWithResult(_0x1eec7a,null))[_0x4ba8('0x43')](handleError(_0x1eec7a,null));};exports['download']=function(_0x20efdd,_0x143799,_0x48d497){var _0x47b841=require('../../components/encryptor');var _0x576ff6=![];var _0x24fe10={};if(_0x20efdd[_0x4ba8('0x32')][_0x4ba8('0x2e')]&&_0x20efdd[_0x4ba8('0x32')][_0x4ba8('0x2e')]===_0x4ba8('0x4a')){_0x24fe10[_0x4ba8('0x4a')]=_0x20efdd[_0x4ba8('0x49')]['id'];}else{_0x24fe10['id']=_0x20efdd[_0x4ba8('0x49')]['id'];}return db[_0x4ba8('0x2b')][_0x4ba8('0x48')]({'where':_0x24fe10,'attributes':['id',_0x4ba8('0x4b'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x143799,null))['then'](function(_0x5de2f5){if(_0x5de2f5){var _0x308f01=_0x5de2f5[_0x4ba8('0x4b')];var _0x31da50=util[_0x4ba8('0x4c')]('%s.cypher',_0x308f01);if(fs['existsSync'](_0x31da50)){_0x576ff6=!![];return _0x47b841['decryptFile'](_0x31da50,_0x308f01,config[_0x4ba8('0x4d')][_0x4ba8('0x4e')])[_0x4ba8('0x23')](function(){return _0x5de2f5;});}return _0x5de2f5;}})[_0x4ba8('0x23')](function(_0x453595){if(_0x453595){var _0x27277d=_0x453595[_0x4ba8('0x4b')];if(!fs[_0x4ba8('0x4f')](_0x27277d)){throw new db['Sequelize'][(_0x4ba8('0x50'))]('SquareRecording\x20not\x20found');}if(_0x453595[_0x4ba8('0x51')]){return _0x143799[_0x4ba8('0x52')](_0x27277d,_0x453595['filename']+path['extname'](_0x27277d),function(){if(_0x576ff6){fs[_0x4ba8('0x53')](_0x27277d);}});}else{return _0x143799[_0x4ba8('0x52')](_0x27277d,function(_0xa8ccab){if(_0x576ff6){fs[_0x4ba8('0x53')](_0x27277d);}});}}})[_0x4ba8('0x43')](function(_0x380d12){if(_0x380d12[_0x4ba8('0x54')]==='SquareRecording\x20not\x20found'){_0x143799['status'](0x194)[_0x4ba8('0x28')]('Not\x20found');}else{return handleError(_0x143799,null);}});};exports['destroy']=function(_0x4556a5,_0x2adf56){return db['SquareRecording'][_0x4ba8('0x48')]({'where':{'id':_0x4556a5[_0x4ba8('0x49')]['id']}})[_0x4ba8('0x23')](function(_0x1aad56){if(_[_0x4ba8('0x55')](_0x1aad56)){throw new ReferenceError(_0x4ba8('0x56'));}return _0x1aad56;})[_0x4ba8('0x23')](function(_0x135e8d){var _0x24f3af=_0x135e8d[_0x4ba8('0x4b')];logger[_0x4ba8('0x57')]('cancellazione\x20fisica\x20documento\x20%s',_0x24f3af);if(!_[_0x4ba8('0x55')](_0x135e8d['savePath'])&&fs[_0x4ba8('0x4f')](_0x24f3af)){logger[_0x4ba8('0x57')](_0x4ba8('0x58')+_0x24f3af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x24f3af);}_0x24f3af=_0x24f3af+_0x4ba8('0x59');if(!_[_0x4ba8('0x55')](_0x135e8d[_0x4ba8('0x4b')])&&fs[_0x4ba8('0x4f')](_0x24f3af)){logger['info'](_0x4ba8('0x58')+_0x24f3af+_0x4ba8('0x5a'));fs[_0x4ba8('0x5b')](_0x24f3af);}return _0x135e8d;})[_0x4ba8('0x23')](function(_0xe67a85){if(!_0xe67a85)throw new InternalError();return _0xe67a85[_0x4ba8('0x24')]();})[_0x4ba8('0x23')](function(){_0x2adf56[_0x4ba8('0x16')](0xcc)[_0x4ba8('0x17')]();})[_0x4ba8('0x43')](handleError(_0x2adf56,null));}; \ No newline at end of file +var _0x40cd=['info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../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','save','update','then','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','download','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found'];(function(_0x52bd81,_0x5f33d8){var _0x4731a4=function(_0x479723){while(--_0x479723){_0x52bd81['push'](_0x52bd81['shift']());}};_0x4731a4(++_0x5f33d8);}(_0x40cd,0x189));var _0xd40c=function(_0x322719,_0x1e53d5){_0x322719=_0x322719-0x0;var _0x3695b9=_0x40cd[_0x322719];return _0x3695b9;};'use strict';var emlformat=require(_0xd40c('0x0'));var rimraf=require(_0xd40c('0x1'));var zipdir=require(_0xd40c('0x2'));var jsonpatch=require(_0xd40c('0x3'));var rp=require(_0xd40c('0x4'));var moment=require(_0xd40c('0x5'));var BPromise=require(_0xd40c('0x6'));var Mustache=require(_0xd40c('0x7'));var util=require(_0xd40c('0x8'));var path=require(_0xd40c('0x9'));var sox=require(_0xd40c('0xa'));var csv=require(_0xd40c('0xb'));var ejs=require(_0xd40c('0xc'));var fs=require('fs');var fs_extra=require(_0xd40c('0xd'));var _=require(_0xd40c('0xe'));var squel=require(_0xd40c('0xf'));var crypto=require(_0xd40c('0x10'));var jsforce=require(_0xd40c('0x11'));var deskjs=require(_0xd40c('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd40c('0x13'));var Redis=require(_0xd40c('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd40c('0x15'));var hardwareService=require(_0xd40c('0x16'));var logger=require('../../config/logger')(_0xd40c('0x17'));var utils=require(_0xd40c('0x18'));var config=require(_0xd40c('0x19'));var licenseUtil=require(_0xd40c('0x1a'));var db=require(_0xd40c('0x1b'))['db'];function respondWithStatusCode(_0xae0eff,_0x3b2a95){_0x3b2a95=_0x3b2a95||0xcc;return function(_0xdccb3e){if(_0xdccb3e){return _0xae0eff[_0xd40c('0x1c')](_0x3b2a95);}return _0xae0eff[_0xd40c('0x1d')](_0x3b2a95)[_0xd40c('0x1e')]();};}function respondWithResult(_0x4f53d3,_0x48de2e){_0x48de2e=_0x48de2e||0xc8;return function(_0x1ed10f){if(_0x1ed10f){return _0x4f53d3[_0xd40c('0x1d')](_0x48de2e)[_0xd40c('0x1f')](_0x1ed10f);}};}function respondWithFilteredResult(_0x144909,_0x1ef546){return function(_0x116c05){if(_0x116c05){var _0x103b8c=typeof _0x1ef546[_0xd40c('0x20')]===_0xd40c('0x21')&&typeof _0x1ef546[_0xd40c('0x22')]===_0xd40c('0x21');var _0x51f085=_0x116c05[_0xd40c('0x23')];var _0x240a57=_0x103b8c?0x0:_0x1ef546[_0xd40c('0x20')];var _0x2fb729=_0x103b8c?_0x116c05['count']:_0x1ef546[_0xd40c('0x20')]+_0x1ef546['limit'];var _0xa8647a;if(_0x2fb729>=_0x51f085){_0x2fb729=_0x51f085;_0xa8647a=0xc8;}else{_0xa8647a=0xce;}_0x144909['status'](_0xa8647a);return _0x144909[_0xd40c('0x24')](_0xd40c('0x25'),_0x240a57+'-'+_0x2fb729+'/'+_0x51f085)[_0xd40c('0x1f')](_0x116c05);}return null;};}function patchUpdates(_0x28d9cd){return function(_0x24a1a4){try{jsonpatch['apply'](_0x24a1a4,_0x28d9cd,!![]);}catch(_0x3695da){return BPromise['reject'](_0x3695da);}return _0x24a1a4[_0xd40c('0x26')]();};}function saveUpdates(_0x551160,_0x3796c5){return function(_0x3b1f92){if(_0x3b1f92){return _0x3b1f92[_0xd40c('0x27')](_0x551160)[_0xd40c('0x28')](function(_0x11d495){return _0x11d495;});}return null;};}function removeEntity(_0x131a3d,_0x2a21d3){return function(_0x2a64d8){if(_0x2a64d8){return _0x2a64d8['destroy']()[_0xd40c('0x28')](function(){_0x131a3d[_0xd40c('0x1d')](0xcc)[_0xd40c('0x1e')]();});}};}function handleEntityNotFound(_0xbd105c,_0x7a68ed){return function(_0xff99fc){if(!_0xff99fc){_0xbd105c[_0xd40c('0x1c')](0x194);}return _0xff99fc;};}function handleError(_0x33cc4d,_0x27a56d){_0x27a56d=_0x27a56d||0x1f4;return function(_0x58e3e6){logger['error'](_0x58e3e6[_0xd40c('0x29')]);if(_0x58e3e6[_0xd40c('0x2a')]){delete _0x58e3e6[_0xd40c('0x2a')];}_0x33cc4d['status'](_0x27a56d)[_0xd40c('0x2b')](_0x58e3e6);};}exports[_0xd40c('0x2c')]=function(_0xb99a8d,_0x538313){var _0x1c3c80={},_0x4829e4={},_0x9cf44b={'count':0x0,'rows':[]};var _0x369302=_[_0xd40c('0x2d')](db[_0xd40c('0x2e')][_0xd40c('0x2f')],function(_0x4b04da){return{'name':_0x4b04da[_0xd40c('0x30')],'type':_0x4b04da[_0xd40c('0x31')]['key']};});_0x4829e4['model']=_[_0xd40c('0x2d')](_0x369302,_0xd40c('0x2a'));_0x4829e4[_0xd40c('0x32')]=_[_0xd40c('0x33')](_0xb99a8d[_0xd40c('0x32')]);_0x4829e4['filters']=_[_0xd40c('0x34')](_0x4829e4[_0xd40c('0x35')],_0x4829e4[_0xd40c('0x32')]);_0x1c3c80['attributes']=_[_0xd40c('0x34')](_0x4829e4[_0xd40c('0x35')],qs[_0xd40c('0x36')](_0xb99a8d[_0xd40c('0x32')]['fields']));_0x1c3c80[_0xd40c('0x37')]=_0x1c3c80[_0xd40c('0x37')][_0xd40c('0x38')]?_0x1c3c80[_0xd40c('0x37')]:_0x4829e4['model'];if(!_0xb99a8d[_0xd40c('0x32')]['hasOwnProperty'](_0xd40c('0x39'))){_0x1c3c80['limit']=qs['limit'](_0xb99a8d[_0xd40c('0x32')][_0xd40c('0x22')]);_0x1c3c80[_0xd40c('0x20')]=qs[_0xd40c('0x20')](_0xb99a8d[_0xd40c('0x32')][_0xd40c('0x20')]);}_0x1c3c80[_0xd40c('0x3a')]=qs['sort'](_0xb99a8d['query'][_0xd40c('0x3b')]);_0x1c3c80[_0xd40c('0x3c')]=qs[_0xd40c('0x3d')](_['pick'](_0xb99a8d[_0xd40c('0x32')],_0x4829e4[_0xd40c('0x3d')]),_0x369302);if(_0xb99a8d['query'][_0xd40c('0x3e')]){_0x1c3c80['where']=_[_0xd40c('0x3f')](_0x1c3c80[_0xd40c('0x3c')],{'$or':_[_0xd40c('0x2d')](_0x369302,function(_0x3a26e3){if(_0x3a26e3['type']!==_0xd40c('0x40')){var _0x3738b2={};_0x3738b2[_0x3a26e3['name']]={'$like':'%'+_0xb99a8d[_0xd40c('0x32')][_0xd40c('0x3e')]+'%'};return _0x3738b2;}})});}_0x1c3c80=_[_0xd40c('0x3f')]({},_0x1c3c80,_0xb99a8d[_0xd40c('0x41')]);var _0x37e87c={'where':_0x1c3c80[_0xd40c('0x3c')]};return db[_0xd40c('0x2e')][_0xd40c('0x23')](_0x37e87c)[_0xd40c('0x28')](function(_0x504968){_0x9cf44b[_0xd40c('0x23')]=_0x504968;if(_0xb99a8d['query'][_0xd40c('0x42')]){_0x1c3c80[_0xd40c('0x43')]=[{'all':!![]}];}return db['SquareRecording'][_0xd40c('0x44')](_0x1c3c80);})[_0xd40c('0x28')](function(_0x1f7e65){_0x9cf44b['rows']=_0x1f7e65;return _0x9cf44b;})[_0xd40c('0x28')](respondWithFilteredResult(_0x538313,_0x1c3c80))['catch'](handleError(_0x538313,null));};exports['show']=function(_0x340405,_0x336685){var _0x413c00={'raw':!![],'where':{'id':_0x340405[_0xd40c('0x45')]['id']}},_0x1e5f98={};_0x1e5f98[_0xd40c('0x35')]=_['keys'](db['SquareRecording'][_0xd40c('0x2f')]);_0x1e5f98[_0xd40c('0x32')]=_[_0xd40c('0x33')](_0x340405[_0xd40c('0x32')]);_0x1e5f98[_0xd40c('0x3d')]=_[_0xd40c('0x34')](_0x1e5f98[_0xd40c('0x35')],_0x1e5f98[_0xd40c('0x32')]);_0x413c00[_0xd40c('0x37')]=_['intersection'](_0x1e5f98[_0xd40c('0x35')],qs['fields'](_0x340405[_0xd40c('0x32')][_0xd40c('0x36')]));_0x413c00[_0xd40c('0x37')]=_0x413c00[_0xd40c('0x37')][_0xd40c('0x38')]?_0x413c00['attributes']:_0x1e5f98['model'];if(_0x340405[_0xd40c('0x32')]['includeAll']){_0x413c00[_0xd40c('0x43')]=[{'all':!![]}];}_0x413c00=_[_0xd40c('0x3f')]({},_0x413c00,_0x340405[_0xd40c('0x41')]);return db['SquareRecording'][_0xd40c('0x46')](_0x413c00)[_0xd40c('0x28')](handleEntityNotFound(_0x336685,null))[_0xd40c('0x28')](respondWithResult(_0x336685,null))[_0xd40c('0x47')](handleError(_0x336685,null));};exports[_0xd40c('0x48')]=function(_0x331b5c,_0x19a89){return db['SquareRecording'][_0xd40c('0x48')](_0x331b5c[_0xd40c('0x49')],{})[_0xd40c('0x28')](respondWithResult(_0x19a89,0xc9))[_0xd40c('0x47')](handleError(_0x19a89,null));};exports[_0xd40c('0x27')]=function(_0x44ffea,_0x2e0abb){if(_0x44ffea[_0xd40c('0x49')]['id']){delete _0x44ffea['body']['id'];}return db[_0xd40c('0x2e')]['find']({'where':{'id':_0x44ffea['params']['id']}})[_0xd40c('0x28')](handleEntityNotFound(_0x2e0abb,null))['then'](saveUpdates(_0x44ffea[_0xd40c('0x49')],null))[_0xd40c('0x28')](respondWithResult(_0x2e0abb,null))['catch'](handleError(_0x2e0abb,null));};exports[_0xd40c('0x4a')]=function(_0x53dad5,_0xe815bb,_0x363735){var _0x1f1a8e=require('../../components/encryptor');var _0x83df8b=![];var _0x3474b6={};if(_0x53dad5['query']['type']&&_0x53dad5[_0xd40c('0x32')][_0xd40c('0x31')]===_0xd40c('0x4b')){_0x3474b6[_0xd40c('0x4b')]=_0x53dad5[_0xd40c('0x45')]['id'];}else{_0x3474b6['id']=_0x53dad5[_0xd40c('0x45')]['id'];}return db['SquareRecording'][_0xd40c('0x46')]({'where':_0x3474b6,'attributes':['id',_0xd40c('0x4c'),_0xd40c('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xe815bb,null))[_0xd40c('0x28')](function(_0x12f7f9){if(_0x12f7f9){var _0x2ac6dd=_0x12f7f9[_0xd40c('0x4c')];var _0x3d6ba6=util['format'](_0xd40c('0x4e'),_0x2ac6dd);if(fs[_0xd40c('0x4f')](_0x3d6ba6)){_0x83df8b=!![];return _0x1f1a8e[_0xd40c('0x50')](_0x3d6ba6,_0x2ac6dd,config[_0xd40c('0x51')][_0xd40c('0x52')])[_0xd40c('0x28')](function(){return _0x12f7f9;});}return _0x12f7f9;}})[_0xd40c('0x28')](function(_0x1ff36c){if(_0x1ff36c){var _0xe95e80=_0x1ff36c['savePath'];if(!fs[_0xd40c('0x4f')](_0xe95e80)){throw new db[(_0xd40c('0x53'))][(_0xd40c('0x54'))](_0xd40c('0x55'));}if(_0x1ff36c['filename']){return _0xe815bb['download'](_0xe95e80,_0x1ff36c[_0xd40c('0x4d')]+path['extname'](_0xe95e80),function(){if(_0x83df8b){fs[_0xd40c('0x56')](_0xe95e80);}});}else{return _0xe815bb['download'](_0xe95e80,function(_0x3f55f3){if(_0x83df8b){fs[_0xd40c('0x56')](_0xe95e80);}});}}})['catch'](function(_0x32e52c){if(_0x32e52c[_0xd40c('0x57')]==='SquareRecording\x20not\x20found'){_0xe815bb['status'](0x194)['send'](_0xd40c('0x58'));}else{return handleError(_0xe815bb,null);}});};exports[_0xd40c('0x59')]=function(_0x3dc9ea,_0x381dcc){return db['SquareRecording'][_0xd40c('0x46')]({'where':{'id':_0x3dc9ea[_0xd40c('0x45')]['id']}})[_0xd40c('0x28')](function(_0x93467b){if(_[_0xd40c('0x5a')](_0x93467b)){throw new ReferenceError(_0xd40c('0x5b'));}return _0x93467b;})[_0xd40c('0x28')](function(_0x50eef4){var _0x188dc3=_0x50eef4[_0xd40c('0x4c')];logger[_0xd40c('0x5c')]('cancellazione\x20fisica\x20documento\x20%s',_0x188dc3);if(!_[_0xd40c('0x5a')](_0x50eef4[_0xd40c('0x4c')])&&fs[_0xd40c('0x4f')](_0x188dc3)){logger[_0xd40c('0x5c')](_0xd40c('0x5d')+_0x188dc3+_0xd40c('0x5e'));fs['unlinkSync'](_0x188dc3);}_0x188dc3=_0x188dc3+_0xd40c('0x5f');if(!_[_0xd40c('0x5a')](_0x50eef4[_0xd40c('0x4c')])&&fs[_0xd40c('0x4f')](_0x188dc3)){logger[_0xd40c('0x5c')](_0xd40c('0x5d')+_0x188dc3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd40c('0x60')](_0x188dc3);}return _0x50eef4;})[_0xd40c('0x28')](function(_0x2324f3){if(!_0x2324f3)throw new InternalError();return _0x2324f3[_0xd40c('0x59')]();})[_0xd40c('0x28')](function(){_0x381dcc[_0xd40c('0x1d')](0xcc)[_0xd40c('0x1e')]();})[_0xd40c('0x47')](handleError(_0x381dcc,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index dfb4a4d..8364d77 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 _0xb7f0=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash'];(function(_0xc826e8,_0x8e2321){var _0x494d04=function(_0x149e18){while(--_0x149e18){_0xc826e8['push'](_0xc826e8['shift']());}};_0x494d04(++_0x8e2321);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x1b2763,_0x49e0b5){_0x1b2763=_0x1b2763-0x0;var _0x5a02a5=_0xb7f0[_0x1b2763];return _0x5a02a5;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var logger=require(_0x0b7f('0x2'))(_0x0b7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0b7f('0x4'));var fs=require('fs');var path=require(_0x0b7f('0x5'));var rimraf=require(_0x0b7f('0x6'));var config=require(_0x0b7f('0x7'));var attributes=require(_0x0b7f('0x8'));module[_0x0b7f('0x9')]=function(_0x1c3c26,_0x1ba1e8){return _0x1c3c26[_0x0b7f('0xa')](_0x0b7f('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd916=['../../config/logger','api','moment','request-promise','path','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0xd916,0x18a));var _0x6d91=function(_0x35bb4b,_0x3a004a){_0x35bb4b=_0x35bb4b-0x0;var _0x1ccc40=_0xd916[_0x35bb4b];return _0x1ccc40;};'use strict';var _=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var logger=require(_0x6d91('0x2'))(_0x6d91('0x3'));var moment=require(_0x6d91('0x4'));var BPromise=require('bluebird');var rp=require(_0x6d91('0x5'));var fs=require('fs');var path=require(_0x6d91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d91('0x7'));module[_0x6d91('0x8')]=function(_0x59c589,_0x1f5cfc){return _0x59c589[_0x6d91('0x9')](_0x6d91('0xa'),attributes,{'tableName':_0x6d91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 84e7ffd..61b58a1 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 _0x753e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x222ca3,_0x5a7c18){var _0xc73bd8=function(_0x146476){while(--_0x146476){_0x222ca3['push'](_0x222ca3['shift']());}};_0xc73bd8(++_0x5a7c18);}(_0x753e,0xf2));var _0xe753=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x753e[_0x243b59];return _0x3e1676;};'use strict';var _=require('lodash');var util=require(_0xe753('0x0'));var moment=require(_0xe753('0x1'));var BPromise=require(_0xe753('0x2'));var rs=require(_0xe753('0x3'));var fs=require('fs');var Redis=require(_0xe753('0x4'));var db=require(_0xe753('0x5'))['db'];var utils=require(_0xe753('0x6'));var logger=require(_0xe753('0x7'))(_0xe753('0x8'));var config=require(_0xe753('0x9'));var jayson=require(_0xe753('0xa'));var client=jayson[_0xe753('0xb')][_0xe753('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50c14,_0x2a0052,_0x49f918){return new BPromise(function(_0x5e2653,_0x2d5a73){return client[_0xe753('0xd')](_0x50c14,_0x49f918)['then'](function(_0x365600){logger[_0xe753('0xe')](_0xe753('0xf'),_0x2a0052,'request\x20sent');logger[_0xe753('0x10')](_0xe753('0x11'),_0x2a0052,_0xe753('0x12'),JSON[_0xe753('0x13')](_0x365600));if(_0x365600[_0xe753('0x14')]){if(_0x365600['error'][_0xe753('0x15')]===0x1f4){logger[_0xe753('0x14')](_0xe753('0xf'),_0x2a0052,_0x365600['error'][_0xe753('0x16')]);return _0x2d5a73(_0x365600[_0xe753('0x14')][_0xe753('0x16')]);}logger[_0xe753('0x14')](_0xe753('0xf'),_0x2a0052,_0x365600[_0xe753('0x14')][_0xe753('0x16')]);return _0x5e2653(_0x365600[_0xe753('0x14')][_0xe753('0x16')]);}else{logger[_0xe753('0xe')](_0xe753('0xf'),_0x2a0052,_0xe753('0x12'));_0x5e2653(_0x365600['result'][_0xe753('0x16')]);}})[_0xe753('0x17')](function(_0x3e4493){logger[_0xe753('0x14')](_0xe753('0xf'),_0x2a0052,_0x3e4493);_0x2d5a73(_0x3e4493);});});}exports[_0xe753('0x18')]=function(_0xa562a8){var _0x2d0388=this;return new Promise(function(_0x75b4db,_0x522046){return db[_0xe753('0x19')][_0xe753('0x1a')](_0xa562a8[_0xe753('0x1b')],{'raw':_0xa562a8[_0xe753('0x1c')]?_0xa562a8[_0xe753('0x1c')][_0xe753('0x1d')]===undefined?!![]:![]:!![]})[_0xe753('0x1e')](function(_0x23b6a8){logger[_0xe753('0xe')]('CreateSquareRecording',_0xa562a8);logger[_0xe753('0x10')]('CreateSquareRecording',_0xa562a8,JSON[_0xe753('0x13')](_0x23b6a8));_0x75b4db(_0x23b6a8);})[_0xe753('0x17')](function(_0x16493c){logger['error'](_0xe753('0x18'),_0x16493c[_0xe753('0x16')],_0xa562a8);_0x522046(_0x2d0388['error'](0x1f4,_0x16493c[_0xe753('0x16')]));});});}; \ No newline at end of file +var _0x9da4=['code','message','result','catch','CreateSquareRecording','SquareRecording','body','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x161872,_0xea11d4){var _0x259cdd=function(_0x39378f){while(--_0x39378f){_0x161872['push'](_0x161872['shift']());}};_0x259cdd(++_0xea11d4);}(_0x9da4,0x70));var _0x49da=function(_0x110ea1,_0x46f592){_0x110ea1=_0x110ea1-0x0;var _0x4debae=_0x9da4[_0x110ea1];return _0x4debae;};'use strict';var _=require(_0x49da('0x0'));var util=require(_0x49da('0x1'));var moment=require(_0x49da('0x2'));var BPromise=require('bluebird');var rs=require(_0x49da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x49da('0x5'))('rpc');var config=require(_0x49da('0x6'));var jayson=require(_0x49da('0x7'));var client=jayson[_0x49da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbf544d,_0x1b37f8,_0x4bc914){return new BPromise(function(_0x44117c,_0xfdc363){return client[_0x49da('0x9')](_0xbf544d,_0x4bc914)[_0x49da('0xa')](function(_0x36d286){logger[_0x49da('0xb')](_0x49da('0xc'),_0x1b37f8,_0x49da('0xd'));logger[_0x49da('0xe')](_0x49da('0xf'),_0x1b37f8,_0x49da('0xd'),JSON[_0x49da('0x10')](_0x36d286));if(_0x36d286[_0x49da('0x11')]){if(_0x36d286[_0x49da('0x11')][_0x49da('0x12')]===0x1f4){logger['error'](_0x49da('0xc'),_0x1b37f8,_0x36d286[_0x49da('0x11')][_0x49da('0x13')]);return _0xfdc363(_0x36d286['error'][_0x49da('0x13')]);}logger[_0x49da('0x11')](_0x49da('0xc'),_0x1b37f8,_0x36d286[_0x49da('0x11')]['message']);return _0x44117c(_0x36d286[_0x49da('0x11')]['message']);}else{logger[_0x49da('0xb')]('SquareRecording,\x20%s,\x20%s',_0x1b37f8,'request\x20sent');_0x44117c(_0x36d286[_0x49da('0x14')][_0x49da('0x13')]);}})[_0x49da('0x15')](function(_0x208ff5){logger['error'](_0x49da('0xc'),_0x1b37f8,_0x208ff5);_0xfdc363(_0x208ff5);});});}exports[_0x49da('0x16')]=function(_0x3af81b){var _0x3b9055=this;return new Promise(function(_0x3d9ecd,_0x129741){return db[_0x49da('0x17')]['create'](_0x3af81b[_0x49da('0x18')],{'raw':_0x3af81b['options']?_0x3af81b['options'][_0x49da('0x19')]===undefined?!![]:![]:!![]})[_0x49da('0xa')](function(_0x545544){logger['info'](_0x49da('0x16'),_0x3af81b);logger[_0x49da('0xe')]('CreateSquareRecording',_0x3af81b,JSON[_0x49da('0x10')](_0x545544));_0x3d9ecd(_0x545544);})[_0x49da('0x15')](function(_0x47416b){logger[_0x49da('0x11')](_0x49da('0x16'),_0x47416b[_0x49da('0x13')],_0x3af81b);_0x129741(_0x3b9055[_0x49da('0x11')](0x1f4,_0x47416b[_0x49da('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 945c0c7..0cb4f68 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x10a18e,_0x24447c){var _0x65a58f=function(_0x564f86){while(--_0x564f86){_0x10a18e['push'](_0x10a18e['shift']());}};_0x65a58f(++_0x24447c);}(_0xe706,0xa3));var _0x6e70=function(_0x6c40ba,_0x5e39fa){_0x6c40ba=_0x6c40ba-0x0;var _0x7a54dd=_0xe706[_0x6c40ba];return _0x7a54dd;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x56c24a,_0x1787b8){var _0x1e3bdf=function(_0x25762d){while(--_0x25762d){_0x56c24a['push'](_0x56c24a['shift']());}};_0x1e3bdf(++_0x1787b8);}(_0xe706,0xa3));var _0x6e70=function(_0x9d58e0,_0x5ee515){_0x9d58e0=_0x9d58e0-0x0;var _0x5eab07=_0xe706[_0x9d58e0];return _0x5eab07;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));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 3a2097d..5320eb3 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 _0x647b=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x647b,0x7c));var _0xb647=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x647b[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xb647('0x0'));module[_0xb647('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xb647('0x2')]},'request':{'type':Sequelize[_0xb647('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb647('0x2')]},'type':{'type':Sequelize[_0xb647('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xb647('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb647('0x2')]},'callingpres':{'type':Sequelize[_0xb647('0x2')]},'callingani2':{'type':Sequelize[_0xb647('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xb647('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xb647('0x2')]},'context':{'type':Sequelize[_0xb647('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb647('0x2')]},'enhanced':{'type':Sequelize[_0xb647('0x2')]},'accountcode':{'type':Sequelize[_0xb647('0x2')]},'threadid':{'type':Sequelize[_0xb647('0x2')]},'project_name':{'type':Sequelize[_0xb647('0x2')]},'joinAt':{'type':Sequelize[_0xb647('0x3')]},'leaveAt':{'type':Sequelize[_0xb647('0x3')]},'bot':{'type':Sequelize[_0xb647('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf8a0=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0xf8a0,0xe4));var _0x0f8a=function(_0x26c7d3,_0x31be42){_0x26c7d3=_0x26c7d3-0x0;var _0x430566=_0xf8a0[_0x26c7d3];return _0x430566;};'use strict';var Sequelize=require(_0x0f8a('0x0'));module['exports']={'network':{'type':Sequelize[_0x0f8a('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x0f8a('0x1')]},'channel':{'type':Sequelize[_0x0f8a('0x1')]},'language':{'type':Sequelize[_0x0f8a('0x1')]},'type':{'type':Sequelize[_0x0f8a('0x1')]},'uniqueid':{'type':Sequelize[_0x0f8a('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0f8a('0x1')]},'callingpres':{'type':Sequelize[_0x0f8a('0x1')]},'callingani2':{'type':Sequelize[_0x0f8a('0x1')]},'callington':{'type':Sequelize[_0x0f8a('0x1')]},'callingtns':{'type':Sequelize[_0x0f8a('0x1')]},'dnid':{'type':Sequelize[_0x0f8a('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0f8a('0x1')]},'extension':{'type':Sequelize[_0x0f8a('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x0f8a('0x1')]},'accountcode':{'type':Sequelize[_0x0f8a('0x1')]},'threadid':{'type':Sequelize[_0x0f8a('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0f8a('0x2')]},'leaveAt':{'type':Sequelize[_0x0f8a('0x2')]},'bot':{'type':Sequelize[_0x0f8a('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 debc913..5c250a6 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 _0xa4ea=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','include','catch','show','params','includeAll','find','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','stack','name','send','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x3a8757,_0xf867ed){var _0x1e5700=function(_0x3bce06){while(--_0x3bce06){_0x3a8757['push'](_0x3a8757['shift']());}};_0x1e5700(++_0xf867ed);}(_0xa4ea,0x1d2));var _0xaa4e=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xa4ea[_0x42f009];return _0x22a1e0;};'use strict';var emlformat=require(_0xaa4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa4e('0x1'));var jsonpatch=require(_0xaa4e('0x2'));var rp=require(_0xaa4e('0x3'));var moment=require(_0xaa4e('0x4'));var BPromise=require(_0xaa4e('0x5'));var Mustache=require(_0xaa4e('0x6'));var util=require('util');var path=require(_0xaa4e('0x7'));var sox=require(_0xaa4e('0x8'));var csv=require(_0xaa4e('0x9'));var ejs=require(_0xaa4e('0xa'));var fs=require('fs');var fs_extra=require(_0xaa4e('0xb'));var _=require(_0xaa4e('0xc'));var squel=require(_0xaa4e('0xd'));var crypto=require(_0xaa4e('0xe'));var jsforce=require(_0xaa4e('0xf'));var deskjs=require(_0xaa4e('0x10'));var toCsv=require(_0xaa4e('0x9'));var querystring=require(_0xaa4e('0x11'));var Papa=require('papaparse');var Redis=require(_0xaa4e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xaa4e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa4e('0x14'));var logger=require(_0xaa4e('0x15'))(_0xaa4e('0x16'));var utils=require(_0xaa4e('0x17'));var config=require(_0xaa4e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa4e('0x19'))['db'];function respondWithStatusCode(_0x573e8b,_0x2cbf7a){_0x2cbf7a=_0x2cbf7a||0xcc;return function(_0x5d6483){if(_0x5d6483){return _0x573e8b[_0xaa4e('0x1a')](_0x2cbf7a);}return _0x573e8b[_0xaa4e('0x1b')](_0x2cbf7a)[_0xaa4e('0x1c')]();};}function respondWithResult(_0x5199d5,_0x2c4117){_0x2c4117=_0x2c4117||0xc8;return function(_0x41d268){if(_0x41d268){return _0x5199d5[_0xaa4e('0x1b')](_0x2c4117)[_0xaa4e('0x1d')](_0x41d268);}};}function respondWithFilteredResult(_0xe08aa3,_0x50c820){return function(_0x426cec){if(_0x426cec){var _0x4c5e83=typeof _0x50c820['offset']===_0xaa4e('0x1e')&&typeof _0x50c820[_0xaa4e('0x1f')]===_0xaa4e('0x1e');var _0x3b5b72=_0x426cec[_0xaa4e('0x20')];var _0x2441b2=_0x4c5e83?0x0:_0x50c820['offset'];var _0x1b4650=_0x4c5e83?_0x426cec['count']:_0x50c820[_0xaa4e('0x21')]+_0x50c820['limit'];var _0x44ac7a;if(_0x1b4650>=_0x3b5b72){_0x1b4650=_0x3b5b72;_0x44ac7a=0xc8;}else{_0x44ac7a=0xce;}_0xe08aa3[_0xaa4e('0x1b')](_0x44ac7a);return _0xe08aa3[_0xaa4e('0x22')](_0xaa4e('0x23'),_0x2441b2+'-'+_0x1b4650+'/'+_0x3b5b72)[_0xaa4e('0x1d')](_0x426cec);}return null;};}function patchUpdates(_0x4507b0){return function(_0x5c1dee){try{jsonpatch[_0xaa4e('0x24')](_0x5c1dee,_0x4507b0,!![]);}catch(_0x56c5ef){return BPromise['reject'](_0x56c5ef);}return _0x5c1dee[_0xaa4e('0x25')]();};}function saveUpdates(_0x6e1f50,_0x6b30ec){return function(_0xe57220){if(_0xe57220){return _0xe57220['update'](_0x6e1f50)['then'](function(_0x2b6969){return _0x2b6969;});}return null;};}function removeEntity(_0x49bea0,_0x2dbd3f){return function(_0x1a503b){if(_0x1a503b){return _0x1a503b[_0xaa4e('0x26')]()['then'](function(){_0x49bea0[_0xaa4e('0x1b')](0xcc)[_0xaa4e('0x1c')]();});}};}function handleEntityNotFound(_0x1b0837,_0x5e78a5){return function(_0x2b951e){if(!_0x2b951e){_0x1b0837[_0xaa4e('0x1a')](0x194);}return _0x2b951e;};}function handleError(_0x5d62dd,_0x522e40){_0x522e40=_0x522e40||0x1f4;return function(_0x197ca4){logger['error'](_0x197ca4[_0xaa4e('0x27')]);if(_0x197ca4[_0xaa4e('0x28')]){delete _0x197ca4[_0xaa4e('0x28')];}_0x5d62dd[_0xaa4e('0x1b')](_0x522e40)[_0xaa4e('0x29')](_0x197ca4);};}exports['index']=function(_0x488e49,_0x5ac163){var _0x1ff34e={},_0x4a68e4={},_0x51da0b={'count':0x0,'rows':[]};var _0x44032a=_[_0xaa4e('0x2a')](db[_0xaa4e('0x2b')][_0xaa4e('0x2c')],function(_0x265183){return{'name':_0x265183[_0xaa4e('0x2d')],'type':_0x265183[_0xaa4e('0x2e')]['key']};});_0x4a68e4[_0xaa4e('0x2f')]=_[_0xaa4e('0x2a')](_0x44032a,_0xaa4e('0x28'));_0x4a68e4[_0xaa4e('0x30')]=_[_0xaa4e('0x31')](_0x488e49[_0xaa4e('0x30')]);_0x4a68e4[_0xaa4e('0x32')]=_[_0xaa4e('0x33')](_0x4a68e4[_0xaa4e('0x2f')],_0x4a68e4[_0xaa4e('0x30')]);_0x1ff34e[_0xaa4e('0x34')]=_['intersection'](_0x4a68e4[_0xaa4e('0x2f')],qs[_0xaa4e('0x35')](_0x488e49[_0xaa4e('0x30')][_0xaa4e('0x35')]));_0x1ff34e[_0xaa4e('0x34')]=_0x1ff34e[_0xaa4e('0x34')][_0xaa4e('0x36')]?_0x1ff34e[_0xaa4e('0x34')]:_0x4a68e4['model'];if(!_0x488e49[_0xaa4e('0x30')][_0xaa4e('0x37')](_0xaa4e('0x38'))){_0x1ff34e[_0xaa4e('0x1f')]=qs[_0xaa4e('0x1f')](_0x488e49[_0xaa4e('0x30')][_0xaa4e('0x1f')]);_0x1ff34e[_0xaa4e('0x21')]=qs[_0xaa4e('0x21')](_0x488e49['query'][_0xaa4e('0x21')]);}_0x1ff34e['order']=qs[_0xaa4e('0x39')](_0x488e49[_0xaa4e('0x30')][_0xaa4e('0x39')]);_0x1ff34e[_0xaa4e('0x3a')]=qs[_0xaa4e('0x32')](_[_0xaa4e('0x3b')](_0x488e49[_0xaa4e('0x30')],_0x4a68e4[_0xaa4e('0x32')]),_0x44032a);if(_0x488e49[_0xaa4e('0x30')][_0xaa4e('0x3c')]){_0x1ff34e[_0xaa4e('0x3a')]=_[_0xaa4e('0x3d')](_0x1ff34e['where'],{'$or':_[_0xaa4e('0x2a')](_0x44032a,function(_0x21e3c6){if(_0x21e3c6[_0xaa4e('0x2e')]!==_0xaa4e('0x3e')){var _0xe3cb23={};_0xe3cb23[_0x21e3c6[_0xaa4e('0x28')]]={'$like':'%'+_0x488e49[_0xaa4e('0x30')][_0xaa4e('0x3c')]+'%'};return _0xe3cb23;}})});}_0x1ff34e=_[_0xaa4e('0x3d')]({},_0x1ff34e,_0x488e49[_0xaa4e('0x3f')]);var _0x3bd6fe={'where':_0x1ff34e['where']};return db[_0xaa4e('0x2b')][_0xaa4e('0x20')](_0x3bd6fe)[_0xaa4e('0x40')](function(_0x14d91f){_0x51da0b[_0xaa4e('0x20')]=_0x14d91f;if(_0x488e49[_0xaa4e('0x30')]['includeAll']){_0x1ff34e[_0xaa4e('0x41')]=[{'all':!![]}];}return db[_0xaa4e('0x2b')]['findAll'](_0x1ff34e);})[_0xaa4e('0x40')](function(_0x1edc87){_0x51da0b['rows']=_0x1edc87;return _0x51da0b;})[_0xaa4e('0x40')](respondWithFilteredResult(_0x5ac163,_0x1ff34e))[_0xaa4e('0x42')](handleError(_0x5ac163,null));};exports[_0xaa4e('0x43')]=function(_0x11bd4f,_0x1aefbd){var _0x2bc555={'raw':!![],'where':{'id':_0x11bd4f[_0xaa4e('0x44')]['id']}},_0x4cf21a={};_0x4cf21a['model']=_[_0xaa4e('0x31')](db['SquareReport'][_0xaa4e('0x2c')]);_0x4cf21a[_0xaa4e('0x30')]=_['keys'](_0x11bd4f[_0xaa4e('0x30')]);_0x4cf21a['filters']=_[_0xaa4e('0x33')](_0x4cf21a[_0xaa4e('0x2f')],_0x4cf21a[_0xaa4e('0x30')]);_0x2bc555[_0xaa4e('0x34')]=_[_0xaa4e('0x33')](_0x4cf21a[_0xaa4e('0x2f')],qs[_0xaa4e('0x35')](_0x11bd4f[_0xaa4e('0x30')][_0xaa4e('0x35')]));_0x2bc555['attributes']=_0x2bc555[_0xaa4e('0x34')][_0xaa4e('0x36')]?_0x2bc555[_0xaa4e('0x34')]:_0x4cf21a[_0xaa4e('0x2f')];if(_0x11bd4f['query'][_0xaa4e('0x45')]){_0x2bc555[_0xaa4e('0x41')]=[{'all':!![]}];}_0x2bc555=_[_0xaa4e('0x3d')]({},_0x2bc555,_0x11bd4f[_0xaa4e('0x3f')]);return db['SquareReport'][_0xaa4e('0x46')](_0x2bc555)[_0xaa4e('0x40')](handleEntityNotFound(_0x1aefbd,null))[_0xaa4e('0x40')](respondWithResult(_0x1aefbd,null))['catch'](handleError(_0x1aefbd,null));};exports[_0xaa4e('0x47')]=function(_0x1a35cc,_0x40db38){return db[_0xaa4e('0x2b')][_0xaa4e('0x47')](_0x1a35cc['body'],{})['then'](respondWithResult(_0x40db38,0xc9))[_0xaa4e('0x42')](handleError(_0x40db38,null));};exports[_0xaa4e('0x48')]=function(_0x68f85f,_0xb3fa6){if(_0x68f85f[_0xaa4e('0x49')]['id']){delete _0x68f85f[_0xaa4e('0x49')]['id'];}return db['SquareReport'][_0xaa4e('0x46')]({'where':{'id':_0x68f85f['params']['id']}})[_0xaa4e('0x40')](handleEntityNotFound(_0xb3fa6,null))[_0xaa4e('0x40')](saveUpdates(_0x68f85f['body'],null))[_0xaa4e('0x40')](respondWithResult(_0xb3fa6,null))[_0xaa4e('0x42')](handleError(_0xb3fa6,null));};exports[_0xaa4e('0x26')]=function(_0x28d8f2,_0xe0dbdc){return db[_0xaa4e('0x2b')]['find']({'where':{'id':_0x28d8f2[_0xaa4e('0x44')]['id']}})[_0xaa4e('0x40')](handleEntityNotFound(_0xe0dbdc,null))[_0xaa4e('0x40')](removeEntity(_0xe0dbdc,null))['catch'](handleError(_0xe0dbdc,null));};exports['describe']=function(_0x1dc9c0,_0x151558){return db['SquareReport']['describe']()['then'](respondWithResult(_0x151558,null))['catch'](handleError(_0x151558,null));}; \ No newline at end of file +var _0x8f1d=['end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','SquareReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus'];(function(_0x4493ef,_0x3b999b){var _0x2de519=function(_0x4615f9){while(--_0x4615f9){_0x4493ef['push'](_0x4493ef['shift']());}};_0x2de519(++_0x3b999b);}(_0x8f1d,0xc3));var _0xd8f1=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0x8f1d[_0x102b0c];return _0x9b15ca;};'use strict';var emlformat=require(_0xd8f1('0x0'));var rimraf=require(_0xd8f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f1('0x2'));var rp=require(_0xd8f1('0x3'));var moment=require(_0xd8f1('0x4'));var BPromise=require(_0xd8f1('0x5'));var Mustache=require(_0xd8f1('0x6'));var util=require('util');var path=require(_0xd8f1('0x7'));var sox=require(_0xd8f1('0x8'));var csv=require(_0xd8f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8f1('0xa'));var squel=require(_0xd8f1('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8f1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd8f1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8f1('0xd'));var authService=require(_0xd8f1('0xe'));var qs=require(_0xd8f1('0xf'));var as=require(_0xd8f1('0x10'));var hardwareService=require(_0xd8f1('0x11'));var logger=require(_0xd8f1('0x12'))(_0xd8f1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xccbb19,_0x3d5dfd){_0x3d5dfd=_0x3d5dfd||0xcc;return function(_0x2effc8){if(_0x2effc8){return _0xccbb19[_0xd8f1('0x14')](_0x3d5dfd);}return _0xccbb19['status'](_0x3d5dfd)[_0xd8f1('0x15')]();};}function respondWithResult(_0xd45361,_0x3f7289){_0x3f7289=_0x3f7289||0xc8;return function(_0x199ec8){if(_0x199ec8){return _0xd45361[_0xd8f1('0x16')](_0x3f7289)['json'](_0x199ec8);}};}function respondWithFilteredResult(_0x15f09f,_0x27d7ff){return function(_0x40e393){if(_0x40e393){var _0x3fb518=typeof _0x27d7ff['offset']===_0xd8f1('0x17')&&typeof _0x27d7ff[_0xd8f1('0x18')]===_0xd8f1('0x17');var _0x3c31cd=_0x40e393['count'];var _0x556971=_0x3fb518?0x0:_0x27d7ff['offset'];var _0x2669c7=_0x3fb518?_0x40e393[_0xd8f1('0x19')]:_0x27d7ff[_0xd8f1('0x1a')]+_0x27d7ff[_0xd8f1('0x18')];var _0x142961;if(_0x2669c7>=_0x3c31cd){_0x2669c7=_0x3c31cd;_0x142961=0xc8;}else{_0x142961=0xce;}_0x15f09f[_0xd8f1('0x16')](_0x142961);return _0x15f09f[_0xd8f1('0x1b')]('Content-Range',_0x556971+'-'+_0x2669c7+'/'+_0x3c31cd)[_0xd8f1('0x1c')](_0x40e393);}return null;};}function patchUpdates(_0xfe2cb0){return function(_0x11fba2){try{jsonpatch[_0xd8f1('0x1d')](_0x11fba2,_0xfe2cb0,!![]);}catch(_0x12a87){return BPromise[_0xd8f1('0x1e')](_0x12a87);}return _0x11fba2[_0xd8f1('0x1f')]();};}function saveUpdates(_0x2acb4a,_0x2f9b07){return function(_0x199d4e){if(_0x199d4e){return _0x199d4e[_0xd8f1('0x20')](_0x2acb4a)[_0xd8f1('0x21')](function(_0x2013f1){return _0x2013f1;});}return null;};}function removeEntity(_0x35cfb6,_0x38db26){return function(_0x1f0451){if(_0x1f0451){return _0x1f0451[_0xd8f1('0x22')]()[_0xd8f1('0x21')](function(){_0x35cfb6[_0xd8f1('0x16')](0xcc)[_0xd8f1('0x15')]();});}};}function handleEntityNotFound(_0x279c6a,_0x3f1511){return function(_0x1c0390){if(!_0x1c0390){_0x279c6a[_0xd8f1('0x14')](0x194);}return _0x1c0390;};}function handleError(_0x36da8c,_0x1bd022){_0x1bd022=_0x1bd022||0x1f4;return function(_0xf3efe0){logger[_0xd8f1('0x23')](_0xf3efe0['stack']);if(_0xf3efe0[_0xd8f1('0x24')]){delete _0xf3efe0[_0xd8f1('0x24')];}_0x36da8c['status'](_0x1bd022)[_0xd8f1('0x25')](_0xf3efe0);};}exports[_0xd8f1('0x26')]=function(_0x1640a4,_0x5985b3){var _0x5b3f3c={},_0x1327de={},_0x38f6e1={'count':0x0,'rows':[]};var _0x5cffb8=_[_0xd8f1('0x27')](db['SquareReport'][_0xd8f1('0x28')],function(_0x1fae2c){return{'name':_0x1fae2c[_0xd8f1('0x29')],'type':_0x1fae2c['type']['key']};});_0x1327de[_0xd8f1('0x2a')]=_[_0xd8f1('0x27')](_0x5cffb8,'name');_0x1327de[_0xd8f1('0x2b')]=_[_0xd8f1('0x2c')](_0x1640a4[_0xd8f1('0x2b')]);_0x1327de[_0xd8f1('0x2d')]=_[_0xd8f1('0x2e')](_0x1327de[_0xd8f1('0x2a')],_0x1327de[_0xd8f1('0x2b')]);_0x5b3f3c[_0xd8f1('0x2f')]=_['intersection'](_0x1327de[_0xd8f1('0x2a')],qs[_0xd8f1('0x30')](_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x30')]));_0x5b3f3c[_0xd8f1('0x2f')]=_0x5b3f3c[_0xd8f1('0x2f')][_0xd8f1('0x31')]?_0x5b3f3c[_0xd8f1('0x2f')]:_0x1327de[_0xd8f1('0x2a')];if(!_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x32')](_0xd8f1('0x33'))){_0x5b3f3c[_0xd8f1('0x18')]=qs[_0xd8f1('0x18')](_0x1640a4[_0xd8f1('0x2b')]['limit']);_0x5b3f3c['offset']=qs[_0xd8f1('0x1a')](_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x1a')]);}_0x5b3f3c['order']=qs['sort'](_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x34')]);_0x5b3f3c[_0xd8f1('0x35')]=qs['filters'](_[_0xd8f1('0x36')](_0x1640a4[_0xd8f1('0x2b')],_0x1327de['filters']),_0x5cffb8);if(_0x1640a4['query'][_0xd8f1('0x37')]){_0x5b3f3c[_0xd8f1('0x35')]=_[_0xd8f1('0x38')](_0x5b3f3c[_0xd8f1('0x35')],{'$or':_['map'](_0x5cffb8,function(_0x705881){if(_0x705881[_0xd8f1('0x39')]!==_0xd8f1('0x3a')){var _0x1b5336={};_0x1b5336[_0x705881['name']]={'$like':'%'+_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x37')]+'%'};return _0x1b5336;}})});}_0x5b3f3c=_[_0xd8f1('0x38')]({},_0x5b3f3c,_0x1640a4['options']);var _0x985e4b={'where':_0x5b3f3c[_0xd8f1('0x35')]};return db[_0xd8f1('0x3b')][_0xd8f1('0x19')](_0x985e4b)[_0xd8f1('0x21')](function(_0x105d16){_0x38f6e1[_0xd8f1('0x19')]=_0x105d16;if(_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x3c')]){_0x5b3f3c[_0xd8f1('0x3d')]=[{'all':!![]}];}return db[_0xd8f1('0x3b')][_0xd8f1('0x3e')](_0x5b3f3c);})[_0xd8f1('0x21')](function(_0x32396d){_0x38f6e1[_0xd8f1('0x3f')]=_0x32396d;return _0x38f6e1;})['then'](respondWithFilteredResult(_0x5985b3,_0x5b3f3c))[_0xd8f1('0x40')](handleError(_0x5985b3,null));};exports[_0xd8f1('0x41')]=function(_0x3adc9f,_0x1ecfbb){var _0x5c42d1={'raw':!![],'where':{'id':_0x3adc9f[_0xd8f1('0x42')]['id']}},_0x5886d={};_0x5886d[_0xd8f1('0x2a')]=_[_0xd8f1('0x2c')](db[_0xd8f1('0x3b')]['rawAttributes']);_0x5886d[_0xd8f1('0x2b')]=_['keys'](_0x3adc9f[_0xd8f1('0x2b')]);_0x5886d[_0xd8f1('0x2d')]=_[_0xd8f1('0x2e')](_0x5886d[_0xd8f1('0x2a')],_0x5886d[_0xd8f1('0x2b')]);_0x5c42d1[_0xd8f1('0x2f')]=_[_0xd8f1('0x2e')](_0x5886d['model'],qs['fields'](_0x3adc9f[_0xd8f1('0x2b')][_0xd8f1('0x30')]));_0x5c42d1['attributes']=_0x5c42d1['attributes'][_0xd8f1('0x31')]?_0x5c42d1[_0xd8f1('0x2f')]:_0x5886d[_0xd8f1('0x2a')];if(_0x3adc9f['query'][_0xd8f1('0x3c')]){_0x5c42d1[_0xd8f1('0x3d')]=[{'all':!![]}];}_0x5c42d1=_[_0xd8f1('0x38')]({},_0x5c42d1,_0x3adc9f[_0xd8f1('0x43')]);return db['SquareReport'][_0xd8f1('0x44')](_0x5c42d1)[_0xd8f1('0x21')](handleEntityNotFound(_0x1ecfbb,null))[_0xd8f1('0x21')](respondWithResult(_0x1ecfbb,null))[_0xd8f1('0x40')](handleError(_0x1ecfbb,null));};exports[_0xd8f1('0x45')]=function(_0x44fd27,_0x1f4981){return db[_0xd8f1('0x3b')][_0xd8f1('0x45')](_0x44fd27[_0xd8f1('0x46')],{})[_0xd8f1('0x21')](respondWithResult(_0x1f4981,0xc9))['catch'](handleError(_0x1f4981,null));};exports['update']=function(_0x5ae09f,_0x334191){if(_0x5ae09f['body']['id']){delete _0x5ae09f[_0xd8f1('0x46')]['id'];}return db[_0xd8f1('0x3b')]['find']({'where':{'id':_0x5ae09f['params']['id']}})[_0xd8f1('0x21')](handleEntityNotFound(_0x334191,null))[_0xd8f1('0x21')](saveUpdates(_0x5ae09f['body'],null))[_0xd8f1('0x21')](respondWithResult(_0x334191,null))[_0xd8f1('0x40')](handleError(_0x334191,null));};exports[_0xd8f1('0x22')]=function(_0x19a780,_0x1720b0){return db[_0xd8f1('0x3b')][_0xd8f1('0x44')]({'where':{'id':_0x19a780[_0xd8f1('0x42')]['id']}})[_0xd8f1('0x21')](handleEntityNotFound(_0x1720b0,null))[_0xd8f1('0x21')](removeEntity(_0x1720b0,null))[_0xd8f1('0x40')](handleError(_0x1720b0,null));};exports['describe']=function(_0x354b20,_0x5e16e7){return db[_0xd8f1('0x3b')][_0xd8f1('0x47')]()[_0xd8f1('0x21')](respondWithResult(_0x5e16e7,null))[_0xd8f1('0x40')](handleError(_0x5e16e7,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 0b85029..ea6c946 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 _0xea3d=['report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x4f7288,_0x37d9ce){var _0x2719f6=function(_0x342b82){while(--_0x342b82){_0x4f7288['push'](_0x4f7288['shift']());}};_0x2719f6(++_0x37d9ce);}(_0xea3d,0xb0));var _0xdea3=function(_0x520265,_0x26df7c){_0x520265=_0x520265-0x0;var _0x15ce42=_0xea3d[_0x520265];return _0x15ce42;};'use strict';var _=require(_0xdea3('0x0'));var util=require(_0xdea3('0x1'));var logger=require(_0xdea3('0x2'))(_0xdea3('0x3'));var moment=require(_0xdea3('0x4'));var BPromise=require(_0xdea3('0x5'));var rp=require(_0xdea3('0x6'));var fs=require('fs');var path=require(_0xdea3('0x7'));var rimraf=require(_0xdea3('0x8'));var config=require(_0xdea3('0x9'));var attributes=require(_0xdea3('0xa'));module[_0xdea3('0xb')]=function(_0x5bd557,_0x127f8c){return _0x5bd557[_0xdea3('0xc')](_0xdea3('0xd'),attributes,{'tableName':_0xdea3('0xe'),'paranoid':![],'indexes':[{'name':_0xdea3('0xf'),'fields':[_0xdea3('0x10'),_0xdea3('0x11')]},{'name':_0xdea3('0x12'),'fields':[_0xdea3('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21a9=['SquareReport','report_square','uid_pname','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x21a9,0xa9));var _0x921a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x21a9[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x921a('0x0'));var util=require(_0x921a('0x1'));var logger=require(_0x921a('0x2'))(_0x921a('0x3'));var moment=require(_0x921a('0x4'));var BPromise=require(_0x921a('0x5'));var rp=require(_0x921a('0x6'));var fs=require('fs');var path=require(_0x921a('0x7'));var rimraf=require('rimraf');var config=require(_0x921a('0x8'));var attributes=require(_0x921a('0x9'));module[_0x921a('0xa')]=function(_0x18b4e4,_0x2f16d2){return _0x18b4e4['define'](_0x921a('0xb'),attributes,{'tableName':_0x921a('0xc'),'paranoid':![],'indexes':[{'name':_0x921a('0xd'),'fields':['uniqueid','project_name']},{'name':_0x921a('0xe'),'fields':[_0x921a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 691600b..84a20ea 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 _0x06a9=['where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','create','body','options','CreateSquareReport','UpdateSquareReport','SquareReport','update','raw'];(function(_0x411e5d,_0x450c00){var _0x58298=function(_0x268e16){while(--_0x268e16){_0x411e5d['push'](_0x411e5d['shift']());}};_0x58298(++_0x450c00);}(_0x06a9,0x1a2));var _0x906a=function(_0x55e111,_0x391f5a){_0x55e111=_0x55e111-0x0;var _0x30d69c=_0x06a9[_0x55e111];return _0x30d69c;};'use strict';var _=require(_0x906a('0x0'));var util=require(_0x906a('0x1'));var moment=require('moment');var BPromise=require(_0x906a('0x2'));var rs=require(_0x906a('0x3'));var fs=require('fs');var Redis=require(_0x906a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x906a('0x5'));var logger=require(_0x906a('0x6'))(_0x906a('0x7'));var config=require(_0x906a('0x8'));var jayson=require(_0x906a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3677ff,_0x27263c,_0x53fbe5){return new BPromise(function(_0x5eff71,_0x513bf6){return client[_0x906a('0xa')](_0x3677ff,_0x53fbe5)[_0x906a('0xb')](function(_0x52aed1){logger['info'](_0x906a('0xc'),_0x27263c,_0x906a('0xd'));logger[_0x906a('0xe')](_0x906a('0xf'),_0x27263c,_0x906a('0xd'),JSON[_0x906a('0x10')](_0x52aed1));if(_0x52aed1['error']){if(_0x52aed1[_0x906a('0x11')]['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x27263c,_0x52aed1['error'][_0x906a('0x12')]);return _0x513bf6(_0x52aed1['error']['message']);}logger[_0x906a('0x11')](_0x906a('0xc'),_0x27263c,_0x52aed1[_0x906a('0x11')][_0x906a('0x12')]);return _0x5eff71(_0x52aed1[_0x906a('0x11')][_0x906a('0x12')]);}else{logger[_0x906a('0x13')](_0x906a('0xc'),_0x27263c,_0x906a('0xd'));_0x5eff71(_0x52aed1[_0x906a('0x14')][_0x906a('0x12')]);}})[_0x906a('0x15')](function(_0x3f6ff2){logger[_0x906a('0x11')]('SquareReport,\x20%s,\x20%s',_0x27263c,_0x3f6ff2);_0x513bf6(_0x3f6ff2);});});}exports['CreateSquareReport']=function(_0x34836f){var _0xc29597=this;return new Promise(function(_0x5dda56,_0x3909bc){return db['SquareReport'][_0x906a('0x16')](_0x34836f[_0x906a('0x17')],{'raw':_0x34836f[_0x906a('0x18')]?_0x34836f['options']['raw']===undefined?!![]:![]:!![]})[_0x906a('0xb')](function(_0x5ed4ee){logger[_0x906a('0x13')](_0x906a('0x19'),_0x34836f);logger[_0x906a('0xe')](_0x906a('0x19'),_0x34836f,JSON['stringify'](_0x5ed4ee));_0x5dda56(_0x5ed4ee);})['catch'](function(_0x36dc02){logger[_0x906a('0x11')](_0x906a('0x19'),_0x36dc02[_0x906a('0x12')],_0x34836f);_0x3909bc(_0xc29597[_0x906a('0x11')](0x1f4,_0x36dc02['message']));});});};exports[_0x906a('0x1a')]=function(_0x7d1d9b){var _0x23526d=this;return new Promise(function(_0x59af7c,_0x17b28a){return db[_0x906a('0x1b')][_0x906a('0x1c')](_0x7d1d9b['body'],{'raw':_0x7d1d9b[_0x906a('0x18')]?_0x7d1d9b['options'][_0x906a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7d1d9b[_0x906a('0x18')]?_0x7d1d9b[_0x906a('0x18')][_0x906a('0x1e')]||null:null,'attributes':_0x7d1d9b['options']?_0x7d1d9b[_0x906a('0x18')]['attributes']||null:null,'limit':_0x7d1d9b[_0x906a('0x18')]?_0x7d1d9b[_0x906a('0x18')][_0x906a('0x1f')]||null:null})['then'](function(_0x366a55){logger[_0x906a('0x13')]('UpdateSquareReport',_0x7d1d9b);logger['debug']('UpdateSquareReport',_0x7d1d9b,JSON['stringify'](_0x366a55));_0x59af7c(_0x366a55);})[_0x906a('0x15')](function(_0x510fa7){logger[_0x906a('0x11')](_0x906a('0x1a'),_0x510fa7[_0x906a('0x12')],_0x7d1d9b);_0x17b28a(_0x23526d[_0x906a('0x11')](0x1f4,_0x510fa7[_0x906a('0x12')]));});});}; \ No newline at end of file +var _0x218b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateSquareReport','create','body','options','catch','UpdateSquareReport','SquareReport','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1ec7bb,_0x287217){var _0x13abfe=function(_0x541a67){while(--_0x541a67){_0x1ec7bb['push'](_0x1ec7bb['shift']());}};_0x13abfe(++_0x287217);}(_0x218b,0x124));var _0xb218=function(_0x1f9328,_0x3c43d7){_0x1f9328=_0x1f9328-0x0;var _0x25bd6f=_0x218b[_0x1f9328];return _0x25bd6f;};'use strict';var _=require(_0xb218('0x0'));var util=require('util');var moment=require(_0xb218('0x1'));var BPromise=require(_0xb218('0x2'));var rs=require(_0xb218('0x3'));var fs=require('fs');var Redis=require(_0xb218('0x4'));var db=require(_0xb218('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb218('0x6'))(_0xb218('0x7'));var config=require(_0xb218('0x8'));var jayson=require(_0xb218('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb8a5,_0x3f30e1,_0xe92ebe){return new BPromise(function(_0x214503,_0x3bd9c6){return client[_0xb218('0xa')](_0x2bb8a5,_0xe92ebe)[_0xb218('0xb')](function(_0x3e967a){logger['info'](_0xb218('0xc'),_0x3f30e1,'request\x20sent');logger[_0xb218('0xd')](_0xb218('0xe'),_0x3f30e1,_0xb218('0xf'),JSON[_0xb218('0x10')](_0x3e967a));if(_0x3e967a[_0xb218('0x11')]){if(_0x3e967a[_0xb218('0x11')][_0xb218('0x12')]===0x1f4){logger[_0xb218('0x11')](_0xb218('0xc'),_0x3f30e1,_0x3e967a[_0xb218('0x11')][_0xb218('0x13')]);return _0x3bd9c6(_0x3e967a[_0xb218('0x11')]['message']);}logger[_0xb218('0x11')](_0xb218('0xc'),_0x3f30e1,_0x3e967a['error'][_0xb218('0x13')]);return _0x214503(_0x3e967a[_0xb218('0x11')][_0xb218('0x13')]);}else{logger[_0xb218('0x14')](_0xb218('0xc'),_0x3f30e1,_0xb218('0xf'));_0x214503(_0x3e967a[_0xb218('0x15')]['message']);}})['catch'](function(_0x1cd356){logger[_0xb218('0x11')](_0xb218('0xc'),_0x3f30e1,_0x1cd356);_0x3bd9c6(_0x1cd356);});});}exports[_0xb218('0x16')]=function(_0x188661){var _0x155063=this;return new Promise(function(_0x262bad,_0x182a85){return db['SquareReport'][_0xb218('0x17')](_0x188661[_0xb218('0x18')],{'raw':_0x188661[_0xb218('0x19')]?_0x188661['options']['raw']===undefined?!![]:![]:!![]})[_0xb218('0xb')](function(_0x820cd4){logger[_0xb218('0x14')](_0xb218('0x16'),_0x188661);logger[_0xb218('0xd')](_0xb218('0x16'),_0x188661,JSON[_0xb218('0x10')](_0x820cd4));_0x262bad(_0x820cd4);})[_0xb218('0x1a')](function(_0x1b09c7){logger[_0xb218('0x11')](_0xb218('0x16'),_0x1b09c7['message'],_0x188661);_0x182a85(_0x155063[_0xb218('0x11')](0x1f4,_0x1b09c7[_0xb218('0x13')]));});});};exports[_0xb218('0x1b')]=function(_0x24ab44){var _0x4a9a3d=this;return new Promise(function(_0x60dace,_0x59e5f0){return db[_0xb218('0x1c')]['update'](_0x24ab44[_0xb218('0x18')],{'raw':_0x24ab44[_0xb218('0x19')]?_0x24ab44[_0xb218('0x19')][_0xb218('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24ab44[_0xb218('0x19')]?_0x24ab44[_0xb218('0x19')][_0xb218('0x1e')]||null:null,'attributes':_0x24ab44['options']?_0x24ab44[_0xb218('0x19')][_0xb218('0x1f')]||null:null,'limit':_0x24ab44[_0xb218('0x19')]?_0x24ab44[_0xb218('0x19')][_0xb218('0x20')]||null:null})['then'](function(_0x594653){logger[_0xb218('0x14')](_0xb218('0x1b'),_0x24ab44);logger[_0xb218('0xd')](_0xb218('0x1b'),_0x24ab44,JSON[_0xb218('0x10')](_0x594653));_0x60dace(_0x594653);})[_0xb218('0x1a')](function(_0x38ac1d){logger[_0xb218('0x11')](_0xb218('0x1b'),_0x38ac1d[_0xb218('0x13')],_0x24ab44);_0x59e5f0(_0x4a9a3d[_0xb218('0x11')](0x1f4,_0x38ac1d[_0xb218('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index f998bea..93fb171 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 _0xb957=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','show','create','put','/:id','update','delete','exports'];(function(_0x30152a,_0x55a652){var _0x5e4a4c=function(_0x573b99){while(--_0x573b99){_0x30152a['push'](_0x30152a['shift']());}};_0x5e4a4c(++_0x55a652);}(_0xb957,0x10e));var _0x7b95=function(_0x5cd15a,_0x315f7c){_0x5cd15a=_0x5cd15a-0x0;var _0x5af28d=_0xb957[_0x5cd15a];return _0x5af28d;};'use strict';var multer=require('multer');var util=require(_0x7b95('0x0'));var path=require(_0x7b95('0x1'));var timeout=require(_0x7b95('0x2'));var express=require(_0x7b95('0x3'));var router=express[_0x7b95('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7b95('0x5'));var config=require(_0x7b95('0x6'));var controller=require(_0x7b95('0x7'));router[_0x7b95('0x8')]('/',auth[_0x7b95('0x9')](),controller['index']);router[_0x7b95('0x8')](_0x7b95('0xa'),auth[_0x7b95('0x9')](),controller['describe']);router[_0x7b95('0x8')]('/:id',auth[_0x7b95('0x9')](),controller[_0x7b95('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b95('0xc')]);router[_0x7b95('0xd')](_0x7b95('0xe'),auth[_0x7b95('0x9')](),controller[_0x7b95('0xf')]);router[_0x7b95('0x10')](_0x7b95('0xe'),auth[_0x7b95('0x9')](),controller['destroy']);module[_0x7b95('0x11')]=router; \ No newline at end of file +var _0x6a52=['./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','/:id','show','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2ad1b8,_0x1ea09b){var _0x52547d=function(_0x33b77c){while(--_0x33b77c){_0x2ad1b8['push'](_0x2ad1b8['shift']());}};_0x52547d(++_0x1ea09b);}(_0x6a52,0xc0));var _0x26a5=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x6a52[_0xb8cfbe];return _0x227d51;};'use strict';var multer=require('multer');var util=require(_0x26a5('0x0'));var path=require('path');var timeout=require(_0x26a5('0x1'));var express=require(_0x26a5('0x2'));var router=express[_0x26a5('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(_0x26a5('0x4'));router['get']('/',auth[_0x26a5('0x5')](),controller[_0x26a5('0x6')]);router[_0x26a5('0x7')](_0x26a5('0x8'),auth[_0x26a5('0x5')](),controller[_0x26a5('0x9')]);router[_0x26a5('0x7')](_0x26a5('0xa'),auth[_0x26a5('0x5')](),controller[_0x26a5('0xb')]);router['post']('/',auth[_0x26a5('0x5')](),controller['create']);router['put'](_0x26a5('0xa'),auth[_0x26a5('0x5')](),controller['update']);router['delete'](_0x26a5('0xa'),auth[_0x26a5('0x5')](),controller[_0x26a5('0xc')]);module[_0x26a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 06cbcf4..dcf4046 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 _0x014b=['TEXT','sequelize','exports','STRING'];(function(_0x4c139d,_0xf5e7bf){var _0x5d7bb1=function(_0x2ddf30){while(--_0x2ddf30){_0x4c139d['push'](_0x4c139d['shift']());}};_0x5d7bb1(++_0xf5e7bf);}(_0x014b,0x141));var _0xb014=function(_0x481e42,_0x2a19ad){_0x481e42=_0x481e42-0x0;var _0x306e4e=_0x014b[_0x481e42];return _0x306e4e;};'use strict';var Sequelize=require(_0xb014('0x0'));module[_0xb014('0x1')]={'uniqueid':{'type':Sequelize[_0xb014('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xb014('0x2')]},'data':{'type':Sequelize[_0xb014('0x3')]},'project_name':{'type':Sequelize[_0xb014('0x2')]},'callerid':{'type':Sequelize[_0xb014('0x2')]}}; \ No newline at end of file +var _0x2d7a=['exports','STRING','TEXT','sequelize'];(function(_0x4e5015,_0x440b70){var _0x2e9ab4=function(_0x2fdc4c){while(--_0x2fdc4c){_0x4e5015['push'](_0x4e5015['shift']());}};_0x2e9ab4(++_0x440b70);}(_0x2d7a,0x153));var _0xa2d7=function(_0x3c77f9,_0x2abb07){_0x3c77f9=_0x3c77f9-0x0;var _0x41790a=_0x2d7a[_0x3c77f9];return _0x41790a;};'use strict';var Sequelize=require(_0xa2d7('0x0'));module[_0xa2d7('0x1')]={'uniqueid':{'type':Sequelize[_0xa2d7('0x2')]},'node':{'type':Sequelize[_0xa2d7('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa2d7('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 6aad71f..ddc18fa 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 _0xbe15=['attributes','fields','length','nolimit','order','sort','where','filter','merge','options','include','rows','show','params','includeAll','create','body','find','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x208388,_0xab6397){var _0x4c7475=function(_0xe6c0ab){while(--_0xe6c0ab){_0x208388['push'](_0x208388['shift']());}};_0x4c7475(++_0xab6397);}(_0xbe15,0xaa));var _0x5be1=function(_0xd8b9d6,_0xd16149){_0xd8b9d6=_0xd8b9d6-0x0;var _0x11ffdb=_0xbe15[_0xd8b9d6];return _0x11ffdb;};'use strict';var emlformat=require(_0x5be1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5be1('0x1'));var jsonpatch=require(_0x5be1('0x2'));var rp=require(_0x5be1('0x3'));var moment=require(_0x5be1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5be1('0x5'));var util=require(_0x5be1('0x6'));var path=require(_0x5be1('0x7'));var sox=require(_0x5be1('0x8'));var csv=require(_0x5be1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5be1('0xa'));var _=require(_0x5be1('0xb'));var squel=require('squel');var crypto=require(_0x5be1('0xc'));var jsforce=require(_0x5be1('0xd'));var deskjs=require(_0x5be1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5be1('0xf'));var Papa=require(_0x5be1('0x10'));var Redis=require('ioredis');var authService=require(_0x5be1('0x11'));var qs=require(_0x5be1('0x12'));var as=require(_0x5be1('0x13'));var hardwareService=require(_0x5be1('0x14'));var logger=require(_0x5be1('0x15'))(_0x5be1('0x16'));var utils=require(_0x5be1('0x17'));var config=require(_0x5be1('0x18'));var licenseUtil=require(_0x5be1('0x19'));var db=require(_0x5be1('0x1a'))['db'];function respondWithStatusCode(_0x1d595f,_0xb73a1d){_0xb73a1d=_0xb73a1d||0xcc;return function(_0x515e0f){if(_0x515e0f){return _0x1d595f[_0x5be1('0x1b')](_0xb73a1d);}return _0x1d595f[_0x5be1('0x1c')](_0xb73a1d)[_0x5be1('0x1d')]();};}function respondWithResult(_0x59055a,_0x26921e){_0x26921e=_0x26921e||0xc8;return function(_0x5db6d1){if(_0x5db6d1){return _0x59055a[_0x5be1('0x1c')](_0x26921e)[_0x5be1('0x1e')](_0x5db6d1);}};}function respondWithFilteredResult(_0x39c51f,_0x389b23){return function(_0x272dd6){if(_0x272dd6){var _0x3ee7a1=typeof _0x389b23['offset']===_0x5be1('0x1f')&&typeof _0x389b23[_0x5be1('0x20')]==='undefined';var _0x992b57=_0x272dd6[_0x5be1('0x21')];var _0x53f627=_0x3ee7a1?0x0:_0x389b23[_0x5be1('0x22')];var _0x1076e8=_0x3ee7a1?_0x272dd6[_0x5be1('0x21')]:_0x389b23['offset']+_0x389b23[_0x5be1('0x20')];var _0x26766f;if(_0x1076e8>=_0x992b57){_0x1076e8=_0x992b57;_0x26766f=0xc8;}else{_0x26766f=0xce;}_0x39c51f[_0x5be1('0x1c')](_0x26766f);return _0x39c51f['set'](_0x5be1('0x23'),_0x53f627+'-'+_0x1076e8+'/'+_0x992b57)['json'](_0x272dd6);}return null;};}function patchUpdates(_0x166088){return function(_0x561388){try{jsonpatch[_0x5be1('0x24')](_0x561388,_0x166088,!![]);}catch(_0x49dcd6){return BPromise[_0x5be1('0x25')](_0x49dcd6);}return _0x561388['save']();};}function saveUpdates(_0x44867b,_0x25c030){return function(_0x3662f6){if(_0x3662f6){return _0x3662f6[_0x5be1('0x26')](_0x44867b)[_0x5be1('0x27')](function(_0x3f0d68){return _0x3f0d68;});}return null;};}function removeEntity(_0x1ca4f4,_0x3330f4){return function(_0x462859){if(_0x462859){return _0x462859[_0x5be1('0x28')]()[_0x5be1('0x27')](function(){_0x1ca4f4[_0x5be1('0x1c')](0xcc)[_0x5be1('0x1d')]();});}};}function handleEntityNotFound(_0x4695dd,_0x3ae48e){return function(_0x51f506){if(!_0x51f506){_0x4695dd['sendStatus'](0x194);}return _0x51f506;};}function handleError(_0x14b0a3,_0x1befd2){_0x1befd2=_0x1befd2||0x1f4;return function(_0x5da41a){logger[_0x5be1('0x29')](_0x5da41a[_0x5be1('0x2a')]);if(_0x5da41a[_0x5be1('0x2b')]){delete _0x5da41a['name'];}_0x14b0a3[_0x5be1('0x1c')](_0x1befd2)['send'](_0x5da41a);};}exports[_0x5be1('0x2c')]=function(_0xf37ad7,_0x2c408c){var _0x24ff45={},_0x429ac5={},_0x2c4278={'count':0x0,'rows':[]};var _0x20acd5=_[_0x5be1('0x2d')](db[_0x5be1('0x2e')][_0x5be1('0x2f')],function(_0xd4c43e){return{'name':_0xd4c43e[_0x5be1('0x30')],'type':_0xd4c43e[_0x5be1('0x31')][_0x5be1('0x32')]};});_0x429ac5[_0x5be1('0x33')]=_[_0x5be1('0x2d')](_0x20acd5,_0x5be1('0x2b'));_0x429ac5[_0x5be1('0x34')]=_[_0x5be1('0x35')](_0xf37ad7['query']);_0x429ac5['filters']=_[_0x5be1('0x36')](_0x429ac5[_0x5be1('0x33')],_0x429ac5[_0x5be1('0x34')]);_0x24ff45[_0x5be1('0x37')]=_[_0x5be1('0x36')](_0x429ac5[_0x5be1('0x33')],qs[_0x5be1('0x38')](_0xf37ad7['query'][_0x5be1('0x38')]));_0x24ff45[_0x5be1('0x37')]=_0x24ff45[_0x5be1('0x37')][_0x5be1('0x39')]?_0x24ff45[_0x5be1('0x37')]:_0x429ac5[_0x5be1('0x33')];if(!_0xf37ad7['query']['hasOwnProperty'](_0x5be1('0x3a'))){_0x24ff45[_0x5be1('0x20')]=qs[_0x5be1('0x20')](_0xf37ad7[_0x5be1('0x34')]['limit']);_0x24ff45[_0x5be1('0x22')]=qs[_0x5be1('0x22')](_0xf37ad7['query'][_0x5be1('0x22')]);}_0x24ff45[_0x5be1('0x3b')]=qs[_0x5be1('0x3c')](_0xf37ad7[_0x5be1('0x34')][_0x5be1('0x3c')]);_0x24ff45[_0x5be1('0x3d')]=qs['filters'](_['pick'](_0xf37ad7[_0x5be1('0x34')],_0x429ac5['filters']),_0x20acd5);if(_0xf37ad7[_0x5be1('0x34')][_0x5be1('0x3e')]){_0x24ff45[_0x5be1('0x3d')]=_['merge'](_0x24ff45[_0x5be1('0x3d')],{'$or':_[_0x5be1('0x2d')](_0x20acd5,function(_0x1c2654){if(_0x1c2654[_0x5be1('0x31')]!=='VIRTUAL'){var _0x2d67d7={};_0x2d67d7[_0x1c2654[_0x5be1('0x2b')]]={'$like':'%'+_0xf37ad7[_0x5be1('0x34')][_0x5be1('0x3e')]+'%'};return _0x2d67d7;}})});}_0x24ff45=_[_0x5be1('0x3f')]({},_0x24ff45,_0xf37ad7[_0x5be1('0x40')]);var _0x345b54={'where':_0x24ff45[_0x5be1('0x3d')]};return db['SquareDetailsReport']['count'](_0x345b54)[_0x5be1('0x27')](function(_0x16f1ca){_0x2c4278[_0x5be1('0x21')]=_0x16f1ca;if(_0xf37ad7['query']['includeAll']){_0x24ff45[_0x5be1('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x24ff45);})[_0x5be1('0x27')](function(_0x275241){_0x2c4278[_0x5be1('0x42')]=_0x275241;return _0x2c4278;})['then'](respondWithFilteredResult(_0x2c408c,_0x24ff45))['catch'](handleError(_0x2c408c,null));};exports[_0x5be1('0x43')]=function(_0x190249,_0x418b61){var _0x3ea026={'raw':!![],'where':{'id':_0x190249[_0x5be1('0x44')]['id']}},_0x871091={};_0x871091[_0x5be1('0x33')]=_[_0x5be1('0x35')](db[_0x5be1('0x2e')][_0x5be1('0x2f')]);_0x871091[_0x5be1('0x34')]=_['keys'](_0x190249[_0x5be1('0x34')]);_0x871091['filters']=_[_0x5be1('0x36')](_0x871091[_0x5be1('0x33')],_0x871091['query']);_0x3ea026[_0x5be1('0x37')]=_[_0x5be1('0x36')](_0x871091[_0x5be1('0x33')],qs[_0x5be1('0x38')](_0x190249[_0x5be1('0x34')][_0x5be1('0x38')]));_0x3ea026[_0x5be1('0x37')]=_0x3ea026['attributes']['length']?_0x3ea026[_0x5be1('0x37')]:_0x871091[_0x5be1('0x33')];if(_0x190249['query'][_0x5be1('0x45')]){_0x3ea026[_0x5be1('0x41')]=[{'all':!![]}];}_0x3ea026=_[_0x5be1('0x3f')]({},_0x3ea026,_0x190249[_0x5be1('0x40')]);return db[_0x5be1('0x2e')]['find'](_0x3ea026)[_0x5be1('0x27')](handleEntityNotFound(_0x418b61,null))['then'](respondWithResult(_0x418b61,null))['catch'](handleError(_0x418b61,null));};exports[_0x5be1('0x46')]=function(_0x1a10e7,_0x42f0b6){return db['SquareDetailsReport'][_0x5be1('0x46')](_0x1a10e7['body'],{})[_0x5be1('0x27')](respondWithResult(_0x42f0b6,0xc9))['catch'](handleError(_0x42f0b6,null));};exports[_0x5be1('0x26')]=function(_0x416a3f,_0x4d2b01){if(_0x416a3f[_0x5be1('0x47')]['id']){delete _0x416a3f[_0x5be1('0x47')]['id'];}return db[_0x5be1('0x2e')][_0x5be1('0x48')]({'where':{'id':_0x416a3f[_0x5be1('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d2b01,null))['then'](saveUpdates(_0x416a3f[_0x5be1('0x47')],null))['then'](respondWithResult(_0x4d2b01,null))[_0x5be1('0x49')](handleError(_0x4d2b01,null));};exports[_0x5be1('0x28')]=function(_0x245f26,_0x5e64a5){return db[_0x5be1('0x2e')][_0x5be1('0x48')]({'where':{'id':_0x245f26['params']['id']}})['then'](handleEntityNotFound(_0x5e64a5,null))[_0x5be1('0x27')](removeEntity(_0x5e64a5,null))[_0x5be1('0x49')](handleError(_0x5e64a5,null));};exports[_0x5be1('0x4a')]=function(_0x1d9c9f,_0xc6cc06){return db[_0x5be1('0x2e')][_0x5be1('0x4a')]()[_0x5be1('0x27')](respondWithResult(_0xc6cc06,null))[_0x5be1('0x49')](handleError(_0xc6cc06,null));}; \ No newline at end of file +var _0x721a=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','include','findAll','catch','show','intersection','includeAll','find','create','body','params','describe','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3a70b0,_0x22a325){var _0x1f8bc0=function(_0x4dcd68){while(--_0x4dcd68){_0x3a70b0['push'](_0x3a70b0['shift']());}};_0x1f8bc0(++_0x22a325);}(_0x721a,0x1b8));var _0xa721=function(_0x12395b,_0x2a11e9){_0x12395b=_0x12395b-0x0;var _0x55546=_0x721a[_0x12395b];return _0x55546;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa721('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa721('0x1'));var moment=require('moment');var BPromise=require(_0xa721('0x2'));var Mustache=require(_0xa721('0x3'));var util=require(_0xa721('0x4'));var path=require(_0xa721('0x5'));var sox=require(_0xa721('0x6'));var csv=require(_0xa721('0x7'));var ejs=require(_0xa721('0x8'));var fs=require('fs');var fs_extra=require(_0xa721('0x9'));var _=require(_0xa721('0xa'));var squel=require(_0xa721('0xb'));var crypto=require(_0xa721('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa721('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa721('0xe'));var Papa=require(_0xa721('0xf'));var Redis=require(_0xa721('0x10'));var authService=require(_0xa721('0x11'));var qs=require(_0xa721('0x12'));var as=require(_0xa721('0x13'));var hardwareService=require(_0xa721('0x14'));var logger=require(_0xa721('0x15'))('api');var utils=require(_0xa721('0x16'));var config=require(_0xa721('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa721('0x18'))['db'];function respondWithStatusCode(_0x53bf75,_0x37776a){_0x37776a=_0x37776a||0xcc;return function(_0x1df3ec){if(_0x1df3ec){return _0x53bf75[_0xa721('0x19')](_0x37776a);}return _0x53bf75['status'](_0x37776a)['end']();};}function respondWithResult(_0x1bb08e,_0x3a2057){_0x3a2057=_0x3a2057||0xc8;return function(_0x1013a4){if(_0x1013a4){return _0x1bb08e['status'](_0x3a2057)[_0xa721('0x1a')](_0x1013a4);}};}function respondWithFilteredResult(_0x470f12,_0x18de6e){return function(_0x3182d8){if(_0x3182d8){var _0x1a5063=typeof _0x18de6e[_0xa721('0x1b')]===_0xa721('0x1c')&&typeof _0x18de6e[_0xa721('0x1d')]===_0xa721('0x1c');var _0x3b053f=_0x3182d8['count'];var _0x4a77f4=_0x1a5063?0x0:_0x18de6e['offset'];var _0x5e8665=_0x1a5063?_0x3182d8[_0xa721('0x1e')]:_0x18de6e['offset']+_0x18de6e['limit'];var _0x37be02;if(_0x5e8665>=_0x3b053f){_0x5e8665=_0x3b053f;_0x37be02=0xc8;}else{_0x37be02=0xce;}_0x470f12[_0xa721('0x1f')](_0x37be02);return _0x470f12['set'](_0xa721('0x20'),_0x4a77f4+'-'+_0x5e8665+'/'+_0x3b053f)[_0xa721('0x1a')](_0x3182d8);}return null;};}function patchUpdates(_0x388c3f){return function(_0x512242){try{jsonpatch[_0xa721('0x21')](_0x512242,_0x388c3f,!![]);}catch(_0x524c47){return BPromise[_0xa721('0x22')](_0x524c47);}return _0x512242[_0xa721('0x23')]();};}function saveUpdates(_0x28c575,_0x4d3220){return function(_0x5d1031){if(_0x5d1031){return _0x5d1031[_0xa721('0x24')](_0x28c575)[_0xa721('0x25')](function(_0x5b5dc8){return _0x5b5dc8;});}return null;};}function removeEntity(_0x2d8699,_0xa6ec96){return function(_0x278f15){if(_0x278f15){return _0x278f15[_0xa721('0x26')]()[_0xa721('0x25')](function(){_0x2d8699[_0xa721('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf3e7,_0x3eaee6){return function(_0x273f84){if(!_0x273f84){_0x1bf3e7[_0xa721('0x19')](0x194);}return _0x273f84;};}function handleError(_0x179b24,_0x30f122){_0x30f122=_0x30f122||0x1f4;return function(_0x81c0a5){logger[_0xa721('0x27')](_0x81c0a5[_0xa721('0x28')]);if(_0x81c0a5[_0xa721('0x29')]){delete _0x81c0a5[_0xa721('0x29')];}_0x179b24[_0xa721('0x1f')](_0x30f122)[_0xa721('0x2a')](_0x81c0a5);};}exports[_0xa721('0x2b')]=function(_0x33db9a,_0x26f545){var _0x1a729a={},_0x377842={},_0x4ea476={'count':0x0,'rows':[]};var _0x3c15f3=_[_0xa721('0x2c')](db['SquareDetailsReport'][_0xa721('0x2d')],function(_0x12f0a9){return{'name':_0x12f0a9['fieldName'],'type':_0x12f0a9[_0xa721('0x2e')][_0xa721('0x2f')]};});_0x377842['model']=_[_0xa721('0x2c')](_0x3c15f3,_0xa721('0x29'));_0x377842[_0xa721('0x30')]=_[_0xa721('0x31')](_0x33db9a['query']);_0x377842[_0xa721('0x32')]=_['intersection'](_0x377842[_0xa721('0x33')],_0x377842[_0xa721('0x30')]);_0x1a729a[_0xa721('0x34')]=_['intersection'](_0x377842[_0xa721('0x33')],qs['fields'](_0x33db9a['query'][_0xa721('0x35')]));_0x1a729a[_0xa721('0x34')]=_0x1a729a[_0xa721('0x34')][_0xa721('0x36')]?_0x1a729a[_0xa721('0x34')]:_0x377842['model'];if(!_0x33db9a['query'][_0xa721('0x37')](_0xa721('0x38'))){_0x1a729a[_0xa721('0x1d')]=qs[_0xa721('0x1d')](_0x33db9a['query'][_0xa721('0x1d')]);_0x1a729a[_0xa721('0x1b')]=qs[_0xa721('0x1b')](_0x33db9a['query'][_0xa721('0x1b')]);}_0x1a729a[_0xa721('0x39')]=qs[_0xa721('0x3a')](_0x33db9a[_0xa721('0x30')]['sort']);_0x1a729a[_0xa721('0x3b')]=qs[_0xa721('0x32')](_[_0xa721('0x3c')](_0x33db9a[_0xa721('0x30')],_0x377842[_0xa721('0x32')]),_0x3c15f3);if(_0x33db9a['query'][_0xa721('0x3d')]){_0x1a729a[_0xa721('0x3b')]=_[_0xa721('0x3e')](_0x1a729a[_0xa721('0x3b')],{'$or':_[_0xa721('0x2c')](_0x3c15f3,function(_0x4aa88a){if(_0x4aa88a['type']!==_0xa721('0x3f')){var _0x6f184e={};_0x6f184e[_0x4aa88a[_0xa721('0x29')]]={'$like':'%'+_0x33db9a[_0xa721('0x30')][_0xa721('0x3d')]+'%'};return _0x6f184e;}})});}_0x1a729a=_[_0xa721('0x3e')]({},_0x1a729a,_0x33db9a[_0xa721('0x40')]);var _0x476955={'where':_0x1a729a[_0xa721('0x3b')]};return db[_0xa721('0x41')][_0xa721('0x1e')](_0x476955)[_0xa721('0x25')](function(_0x571d23){_0x4ea476[_0xa721('0x1e')]=_0x571d23;if(_0x33db9a[_0xa721('0x30')]['includeAll']){_0x1a729a[_0xa721('0x42')]=[{'all':!![]}];}return db[_0xa721('0x41')][_0xa721('0x43')](_0x1a729a);})[_0xa721('0x25')](function(_0x168e1d){_0x4ea476['rows']=_0x168e1d;return _0x4ea476;})[_0xa721('0x25')](respondWithFilteredResult(_0x26f545,_0x1a729a))[_0xa721('0x44')](handleError(_0x26f545,null));};exports[_0xa721('0x45')]=function(_0x215ca7,_0x4a56a4){var _0x877c29={'raw':!![],'where':{'id':_0x215ca7['params']['id']}},_0x352ad8={};_0x352ad8[_0xa721('0x33')]=_[_0xa721('0x31')](db['SquareDetailsReport']['rawAttributes']);_0x352ad8[_0xa721('0x30')]=_['keys'](_0x215ca7[_0xa721('0x30')]);_0x352ad8[_0xa721('0x32')]=_[_0xa721('0x46')](_0x352ad8[_0xa721('0x33')],_0x352ad8[_0xa721('0x30')]);_0x877c29[_0xa721('0x34')]=_['intersection'](_0x352ad8['model'],qs[_0xa721('0x35')](_0x215ca7[_0xa721('0x30')][_0xa721('0x35')]));_0x877c29[_0xa721('0x34')]=_0x877c29[_0xa721('0x34')][_0xa721('0x36')]?_0x877c29['attributes']:_0x352ad8['model'];if(_0x215ca7[_0xa721('0x30')][_0xa721('0x47')]){_0x877c29[_0xa721('0x42')]=[{'all':!![]}];}_0x877c29=_[_0xa721('0x3e')]({},_0x877c29,_0x215ca7['options']);return db[_0xa721('0x41')][_0xa721('0x48')](_0x877c29)[_0xa721('0x25')](handleEntityNotFound(_0x4a56a4,null))[_0xa721('0x25')](respondWithResult(_0x4a56a4,null))['catch'](handleError(_0x4a56a4,null));};exports[_0xa721('0x49')]=function(_0x1e54ea,_0x384963){return db['SquareDetailsReport'][_0xa721('0x49')](_0x1e54ea[_0xa721('0x4a')],{})[_0xa721('0x25')](respondWithResult(_0x384963,0xc9))[_0xa721('0x44')](handleError(_0x384963,null));};exports[_0xa721('0x24')]=function(_0xc73fe9,_0x3c5ea8){if(_0xc73fe9[_0xa721('0x4a')]['id']){delete _0xc73fe9[_0xa721('0x4a')]['id'];}return db[_0xa721('0x41')][_0xa721('0x48')]({'where':{'id':_0xc73fe9['params']['id']}})[_0xa721('0x25')](handleEntityNotFound(_0x3c5ea8,null))[_0xa721('0x25')](saveUpdates(_0xc73fe9[_0xa721('0x4a')],null))[_0xa721('0x25')](respondWithResult(_0x3c5ea8,null))['catch'](handleError(_0x3c5ea8,null));};exports[_0xa721('0x26')]=function(_0x383ca9,_0xe0890a){return db[_0xa721('0x41')][_0xa721('0x48')]({'where':{'id':_0x383ca9[_0xa721('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe0890a,null))[_0xa721('0x25')](removeEntity(_0xe0890a,null))[_0xa721('0x44')](handleError(_0xe0890a,null));};exports['describe']=function(_0x534482,_0x48fc0e){return db[_0xa721('0x41')][_0xa721('0x4c')]()[_0xa721('0x25')](respondWithResult(_0x48fc0e,null))[_0xa721('0x44')](handleError(_0x48fc0e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8e38ac2..6ef4270 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 _0xc47d=['util','api','request-promise','path','../../config/environment','exports','define','SquareDetailsReport','lodash'];(function(_0x772d7d,_0x2d354b){var _0x5b90a7=function(_0x3439e8){while(--_0x3439e8){_0x772d7d['push'](_0x772d7d['shift']());}};_0x5b90a7(++_0x2d354b);}(_0xc47d,0xd7));var _0xdc47=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xc47d[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0xdc47('0x0'));var util=require(_0xdc47('0x1'));var logger=require('../../config/logger')(_0xdc47('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdc47('0x3'));var fs=require('fs');var path=require(_0xdc47('0x4'));var rimraf=require('rimraf');var config=require(_0xdc47('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0xdc47('0x6')]=function(_0x412bf0,_0x149dc3){return _0x412bf0[_0xdc47('0x7')](_0xdc47('0x8'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66d8=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b3178,_0x77d69e){var _0x3c79cc=function(_0x342cd1){while(--_0x342cd1){_0x1b3178['push'](_0x1b3178['shift']());}};_0x3c79cc(++_0x77d69e);}(_0x66d8,0x163));var _0x866d=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x66d8[_0x31a938];return _0x1bf341;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x866d('0x0'))(_0x866d('0x1'));var moment=require(_0x866d('0x2'));var BPromise=require(_0x866d('0x3'));var rp=require(_0x866d('0x4'));var fs=require('fs');var path=require(_0x866d('0x5'));var rimraf=require(_0x866d('0x6'));var config=require(_0x866d('0x7'));var attributes=require(_0x866d('0x8'));module[_0x866d('0x9')]=function(_0x3796b9,_0x1f2d81){return _0x3796b9['define'](_0x866d('0xa'),attributes,{'tableName':_0x866d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 5c9d602..3fe49f0 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 _0xe9e8=['info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','options','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe9e8,0x6b));var _0x8e9e=function(_0xaac80b,_0x51239f){_0xaac80b=_0xaac80b-0x0;var _0x1e554f=_0xe9e8[_0xaac80b];return _0x1e554f;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))(_0x8e9e('0x8'));var config=require(_0x8e9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e9e('0xa')][_0x8e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x204f5c,_0x1fb8d3,_0x58f822){return new BPromise(function(_0x3b5d21,_0x2ae896){return client[_0x8e9e('0xc')](_0x204f5c,_0x58f822)['then'](function(_0x39f5e5){logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1fb8d3,_0x8e9e('0x11'),JSON[_0x8e9e('0x12')](_0x39f5e5));if(_0x39f5e5[_0x8e9e('0x13')]){if(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x14')]===0x1f4){logger['error'](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5['error'][_0x8e9e('0x15')]);return _0x2ae896(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);}logger[_0x8e9e('0x13')](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);return _0x3b5d21(_0x39f5e5['error']['message']);}else{logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');_0x3b5d21(_0x39f5e5[_0x8e9e('0x16')][_0x8e9e('0x15')]);}})[_0x8e9e('0x17')](function(_0x22b2c7){logger[_0x8e9e('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x1fb8d3,_0x22b2c7);_0x2ae896(_0x22b2c7);});});}exports['CreateSquareDetailsReport']=function(_0x42f8e8){var _0x40f4fd=this;return new Promise(function(_0x41cdc0,_0x28584b){return db[_0x8e9e('0x18')][_0x8e9e('0x19')](_0x42f8e8[_0x8e9e('0x1a')],{'raw':_0x42f8e8['options']?_0x42f8e8[_0x8e9e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8e9e('0x1c')](function(_0x19a890){logger['info'](_0x8e9e('0x1d'),_0x42f8e8);logger[_0x8e9e('0xf')](_0x8e9e('0x1d'),_0x42f8e8,JSON[_0x8e9e('0x12')](_0x19a890));_0x41cdc0(_0x19a890);})[_0x8e9e('0x17')](function(_0x6a311b){logger[_0x8e9e('0x13')](_0x8e9e('0x1d'),_0x6a311b['message'],_0x42f8e8);_0x28584b(_0x40f4fd['error'](0x1f4,_0x6a311b[_0x8e9e('0x15')]));});});}; \ No newline at end of file +var _0xaa5e=['CreateSquareDetailsReport','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','SquareDetailsReport','create','options','raw'];(function(_0x3aa29f,_0x2dcdc9){var _0x10dc77=function(_0x31d659){while(--_0x31d659){_0x3aa29f['push'](_0x3aa29f['shift']());}};_0x10dc77(++_0x2dcdc9);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x2351b5,_0xb94eb4){_0x2351b5=_0x2351b5-0x0;var _0x222a4f=_0xaa5e[_0x2351b5];return _0x222a4f;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d405e,_0x2f9041,_0x2c9696){return new BPromise(function(_0x50cb62,_0x2e35c3){return client[_0xeaa5('0xb')](_0x4d405e,_0x2c9696)['then'](function(_0x2e9ca6){logger['info'](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));logger['debug'](_0xeaa5('0xe'),_0x2f9041,_0xeaa5('0xd'),JSON[_0xeaa5('0xf')](_0x2e9ca6));if(_0x2e9ca6[_0xeaa5('0x10')]){if(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x11')]===0x1f4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x2e35c3(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x12')]);}logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x50cb62(_0x2e9ca6[_0xeaa5('0x10')]['message']);}else{logger[_0xeaa5('0x13')](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));_0x50cb62(_0x2e9ca6['result'][_0xeaa5('0x12')]);}})['catch'](function(_0x44e4b4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x44e4b4);_0x2e35c3(_0x44e4b4);});});}exports['CreateSquareDetailsReport']=function(_0x1877a6){var _0x50256a=this;return new Promise(function(_0x222da7,_0x85fb44){return db[_0xeaa5('0x14')][_0xeaa5('0x15')](_0x1877a6['body'],{'raw':_0x1877a6[_0xeaa5('0x16')]?_0x1877a6[_0xeaa5('0x16')][_0xeaa5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x11ace2){logger[_0xeaa5('0x13')](_0xeaa5('0x18'),_0x1877a6);logger[_0xeaa5('0x19')](_0xeaa5('0x18'),_0x1877a6,JSON['stringify'](_0x11ace2));_0x222da7(_0x11ace2);})[_0xeaa5('0x1a')](function(_0x5f2d83){logger[_0xeaa5('0x10')](_0xeaa5('0x18'),_0x5f2d83[_0xeaa5('0x12')],_0x1877a6);_0x85fb44(_0x50256a[_0xeaa5('0x10')](0x1f4,_0x5f2d83[_0xeaa5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 7ae7d9f..e465c93 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 _0x6f3e=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','express','Router','../../components/auth/service'];(function(_0x560867,_0x5b249c){var _0x480f67=function(_0xa7eb11){while(--_0xa7eb11){_0x560867['push'](_0x560867['shift']());}};_0x480f67(++_0x5b249c);}(_0x6f3e,0xc3));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xe6f3('0x0'));var router=express[_0xe6f3('0x1')]();var auth=require(_0xe6f3('0x2'));var controller=require(_0xe6f3('0x3'));router[_0xe6f3('0x4')]('/',auth[_0xe6f3('0x5')](),controller[_0xe6f3('0x6')]);router[_0xe6f3('0x4')](_0xe6f3('0x7'),auth[_0xe6f3('0x5')](),controller[_0xe6f3('0x8')]);module['exports']=router; \ No newline at end of file +var _0x2c16=['../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess','exports','Router'];(function(_0x1529e4,_0xd432f5){var _0x541f99=function(_0x57ffb2){while(--_0x57ffb2){_0x1529e4['push'](_0x1529e4['shift']());}};_0x541f99(++_0xd432f5);}(_0x2c16,0x1a7));var _0x62c1=function(_0x476909,_0xb0f092){_0x476909=_0x476909-0x0;var _0x12e03a=_0x2c16[_0x476909];return _0x12e03a;};'use strict';var express=require('express');var router=express[_0x62c1('0x0')]();var auth=require(_0x62c1('0x1'));var controller=require(_0x62c1('0x2'));router[_0x62c1('0x3')]('/',auth[_0x62c1('0x4')](),controller[_0x62c1('0x5')]);router['get']('/process/:pid/kill',auth[_0x62c1('0x4')](),controller[_0x62c1('0x6')]);module[_0x62c1('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 31d0aad..07608b1 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 _0xd827=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','api','util','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','json','catch','status','killProcess','format','params','pid','then','split','length','kill','SIGINT'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd827,0x8d));var _0x7d82=function(_0x1202a2,_0x2912d9){_0x1202a2=_0x1202a2-0x0;var _0x3a8ac6=_0xd827[_0x1202a2];return _0x3a8ac6;};'use strict';var info=require(_0x7d82('0x0'));var exec=require('child_process')[_0x7d82('0x1')];var logger=require('../../config/logger')(_0x7d82('0x2'));var util=require(_0x7d82('0x3'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x252bc6,_0x2ca5e5,_0x4d534f){_0x2ca5e5=_0x2ca5e5||0x1f4;return function(_0x4669fa){logger['error'](_0x7d82('0x4'),_0x4d534f,_0x2ca5e5,util[_0x7d82('0x5')](_0x4669fa,{'showHidden':![],'depth':null}));delete _0x4669fa['name'];_0x252bc6['status'](_0x2ca5e5)[_0x7d82('0x6')](_0x4669fa);};}exports['index']=function(_0x2af1f6,_0x50ba3a){return info['getAllData']()['then'](function(_0x9f781c){return _0x50ba3a['status'](0xc8)[_0x7d82('0x7')](_0x9f781c);})[_0x7d82('0x8')](function(_0xd5f9eb){return _0x50ba3a[_0x7d82('0x9')](0x1f4)[_0x7d82('0x7')](_0xd5f9eb);});};exports[_0x7d82('0xa')]=function(_0x7e9065,_0x4b7f9b){var _0x578f88=['components/import/cm'];return new BPromise(function(_0x4ba3b0,_0x56339f){return exec(util[_0x7d82('0xb')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x7e9065[_0x7d82('0xc')][_0x7d82('0xd')]),function(_0x9ce66e,_0x11ce3b,_0x510eb9){if(_0x9ce66e){return _0x56339f(_0x9ce66e);}return _0x4ba3b0(_0x11ce3b);});})[_0x7d82('0xe')](function(_0x4a1cc0){var _0x382532=![];var _0x343373=_0x4a1cc0[_0x7d82('0xf')](/\n/);for(var _0x505d86=0x0,_0x15d4e9=_0x578f88[_0x7d82('0x10')];_0x505d86<_0x15d4e9,_0x382532===![];_0x505d86+=0x1){if(_0x4a1cc0['indexOf'](_0x578f88[_0x505d86])>=0x0){_0x382532=!![];}}if(!_0x382532){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x7e9065[_0x7d82('0xc')][_0x7d82('0xd')]));}process[_0x7d82('0x11')](_0x7e9065['params'][_0x7d82('0xd')],_0x7d82('0x12'));return _0x4b7f9b[_0x7d82('0x9')](0xc8)[_0x7d82('0x7')]({'message':util[_0x7d82('0xb')](_0x7d82('0x13'),_0x7e9065[_0x7d82('0xc')][_0x7d82('0xd')])});})[_0x7d82('0x8')](handleError(_0x4b7f9b,null,_0x7d82('0xa')));}; \ No newline at end of file +var _0x44ea=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','lodash','error','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','pid','length','indexOf'];(function(_0x34fcba,_0x2a0bee){var _0x5c4f41=function(_0x44b38b){while(--_0x44b38b){_0x34fcba['push'](_0x34fcba['shift']());}};_0x5c4f41(++_0x2a0bee);}(_0x44ea,0xb2));var _0xa44e=function(_0x5c3883,_0x300d94){_0x5c3883=_0x5c3883-0x0;var _0x37a1c9=_0x44ea[_0x5c3883];return _0x37a1c9;};'use strict';var info=require(_0xa44e('0x0'));var exec=require('child_process')[_0xa44e('0x1')];var logger=require(_0xa44e('0x2'))('api');var util=require('util');var BPromise=require('bluebird');var _=require(_0xa44e('0x3'));function handleError(_0x42c8d4,_0x62c439,_0x329b76){_0x62c439=_0x62c439||0x1f4;return function(_0x199c85){logger[_0xa44e('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x329b76,_0x62c439,util[_0xa44e('0x5')](_0x199c85,{'showHidden':![],'depth':null}));delete _0x199c85[_0xa44e('0x6')];_0x42c8d4[_0xa44e('0x7')](_0x62c439)[_0xa44e('0x8')](_0x199c85);};}exports[_0xa44e('0x9')]=function(_0xa3aada,_0x34c726){return info[_0xa44e('0xa')]()[_0xa44e('0xb')](function(_0x52e0dc){return _0x34c726[_0xa44e('0x7')](0xc8)[_0xa44e('0xc')](_0x52e0dc);})[_0xa44e('0xd')](function(_0x250a1a){return _0x34c726['status'](0x1f4)[_0xa44e('0xc')](_0x250a1a);});};exports[_0xa44e('0xe')]=function(_0xe901cb,_0x3b7191){var _0x9eaaed=[_0xa44e('0xf')];return new BPromise(function(_0x41c083,_0x3852e7){return exec(util[_0xa44e('0x10')](_0xa44e('0x11'),_0xe901cb[_0xa44e('0x12')][_0xa44e('0x13')]),function(_0x3a814c,_0x40c971,_0x2b9b29){if(_0x3a814c){return _0x3852e7(_0x3a814c);}return _0x41c083(_0x40c971);});})[_0xa44e('0xb')](function(_0x44531e){var _0x3d9f0b=![];var _0x1cae0c=_0x44531e['split'](/\n/);for(var _0x560955=0x0,_0x20f5c9=_0x9eaaed[_0xa44e('0x14')];_0x560955<_0x20f5c9,_0x3d9f0b===![];_0x560955+=0x1){if(_0x44531e[_0xa44e('0x15')](_0x9eaaed[_0x560955])>=0x0){_0x3d9f0b=!![];}}if(!_0x3d9f0b){throw new Error(util['format'](_0xa44e('0x16'),_0xe901cb['params'][_0xa44e('0x13')]));}process[_0xa44e('0x17')](_0xe901cb[_0xa44e('0x12')]['pid'],'SIGINT');return _0x3b7191['status'](0xc8)[_0xa44e('0xc')]({'message':util[_0xa44e('0x10')](_0xa44e('0x18'),_0xe901cb[_0xa44e('0x12')][_0xa44e('0x13')])});})[_0xa44e('0xd')](handleError(_0x3b7191,null,_0xa44e('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c3ee3ee..ba0d336 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 _0x5204=['/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5b6be3,_0x1f28c6){var _0x2d1990=function(_0xcedb3d){while(--_0xcedb3d){_0x5b6be3['push'](_0x5b6be3['shift']());}};_0x2d1990(++_0x1f28c6);}(_0x5204,0xdf));var _0x4520=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x5204[_0x115d5b];return _0x6cfc50;};'use strict';var multer=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var path=require('path');var timeout=require(_0x4520('0x2'));var express=require(_0x4520('0x3'));var router=express[_0x4520('0x4')]();var fs_extra=require(_0x4520('0x5'));var auth=require(_0x4520('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4520('0x7'));var controller=require('./tag.controller');router[_0x4520('0x8')]('/',auth[_0x4520('0x9')](),controller[_0x4520('0xa')]);router[_0x4520('0x8')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0xc')]);router['post']('/',auth[_0x4520('0x9')](),controller['create']);router[_0x4520('0xd')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0xe')]);router[_0x4520('0xf')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0x10')]);module[_0x4520('0x11')]=router; \ No newline at end of file +var _0x0a1f=['delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x18cebc,_0x51bb41){var _0x5d9079=function(_0x3c6d2e){while(--_0x3c6d2e){_0x18cebc['push'](_0x18cebc['shift']());}};_0x5d9079(++_0x51bb41);}(_0x0a1f,0x88));var _0xf0a1=function(_0x39377a,_0x471865){_0x39377a=_0x39377a-0x0;var _0x6172fa=_0x0a1f[_0x39377a];return _0x6172fa;};'use strict';var multer=require('multer');var util=require(_0xf0a1('0x0'));var path=require(_0xf0a1('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0a1('0x2'));var router=express[_0xf0a1('0x3')]();var fs_extra=require(_0xf0a1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0a1('0x5'));var controller=require(_0xf0a1('0x6'));router[_0xf0a1('0x7')]('/',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x9')]);router[_0xf0a1('0x7')](_0xf0a1('0xa'),auth['isAuthenticated'](),controller[_0xf0a1('0xb')]);router[_0xf0a1('0xc')]('/',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0xd')]);router[_0xf0a1('0xe')](_0xf0a1('0xa'),auth['isAuthenticated'](),controller[_0xf0a1('0xf')]);router[_0xf0a1('0x10')](_0xf0a1('0xa'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x11')]);module[_0xf0a1('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 445c1ea..2a45e92 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 _0xde9f=['STRING','sequelize','name'];(function(_0x142c85,_0x3013b4){var _0x31bff0=function(_0x313d4c){while(--_0x313d4c){_0x142c85['push'](_0x142c85['shift']());}};_0x31bff0(++_0x3013b4);}(_0xde9f,0x118));var _0xfde9=function(_0x106214,_0x454b8d){_0x106214=_0x106214-0x0;var _0x5f5cea=_0xde9f[_0x106214];return _0x5f5cea;};'use strict';var Sequelize=require(_0xfde9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xfde9('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xfde9('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xfde9('0x2')]}}; \ No newline at end of file +var _0x867f=['sequelize','exports','STRING','#0091EA'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x867f,0xdc));var _0xf867=function(_0x383552,_0x5db2de){_0x383552=_0x383552-0x0;var _0x338ff7=_0x867f[_0x383552];return _0x338ff7;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'name':{'type':Sequelize[_0xf867('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf867('0x2')],'defaultValue':_0xf867('0x3')},'description':{'type':Sequelize[_0xf867('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 752b366..2c7a3ea 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 _0xd64b=['Tags','stack','name','send','index','map','Tag','rawAttributes','type','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','merge','filter','options','includeAll','include','findAll','catch','params','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','get'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0xd64b,0xc1));var _0xbd64=function(_0xca5256,_0x578467){_0xca5256=_0xca5256-0x0;var _0x1fe79d=_0xd64b[_0xca5256];return _0x1fe79d;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){var _0x33452d=_0x4afaff[_0xbd64('0x22')]({'plain':!![]});var _0x3d12a0=_0xbd64('0x23');return db['UserProfileResource'][_0xbd64('0x21')]({'where':{'type':_0x3d12a0,'resourceId':_0x33452d['id']}})[_0xbd64('0x20')](function(){return _0x4afaff;});})[_0xbd64('0x20')](function(){_0x51d118[_0xbd64('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8719,_0x29c9c8){return function(_0x49eac5){if(!_0x49eac5){_0x4e8719['sendStatus'](0x194);}return _0x49eac5;};}function handleError(_0xfa918,_0x5aacdd){_0x5aacdd=_0x5aacdd||0x1f4;return function(_0x3cf5b7){logger['error'](_0x3cf5b7[_0xbd64('0x24')]);if(_0x3cf5b7['name']){delete _0x3cf5b7[_0xbd64('0x25')];}_0xfa918[_0xbd64('0x17')](_0x5aacdd)[_0xbd64('0x26')](_0x3cf5b7);};}exports[_0xbd64('0x27')]=function(_0x306f19,_0x207ffc){var _0x4ed44a={},_0x35bdd5={},_0xe876c9={'count':0x0,'rows':[]};var _0xc44280=_[_0xbd64('0x28')](db[_0xbd64('0x29')][_0xbd64('0x2a')],function(_0x5e70d3){return{'name':_0x5e70d3['fieldName'],'type':_0x5e70d3[_0xbd64('0x2b')]['key']};});_0x35bdd5[_0xbd64('0x2c')]=_[_0xbd64('0x28')](_0xc44280,'name');_0x35bdd5['query']=_[_0xbd64('0x2d')](_0x306f19['query']);_0x35bdd5['filters']=_[_0xbd64('0x2e')](_0x35bdd5[_0xbd64('0x2c')],_0x35bdd5[_0xbd64('0x2f')]);_0x4ed44a['attributes']=_[_0xbd64('0x2e')](_0x35bdd5['model'],qs[_0xbd64('0x30')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x4ed44a[_0xbd64('0x31')]=_0x4ed44a[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4ed44a['attributes']:_0x35bdd5['model'];if(!_0x306f19[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x4ed44a[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x306f19[_0xbd64('0x2f')]['limit']);_0x4ed44a['offset']=qs[_0xbd64('0x1c')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4ed44a['order']=qs['sort'](_0x306f19[_0xbd64('0x2f')]['sort']);_0x4ed44a[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x306f19[_0xbd64('0x2f')],_0x35bdd5['filters']),_0xc44280);if(_0x306f19[_0xbd64('0x2f')]['filter']){_0x4ed44a['where']=_[_0xbd64('0x38')](_0x4ed44a[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0xc44280,function(_0x52f401){if(_0x52f401['type']!=='VIRTUAL'){var _0x344d46={};_0x344d46[_0x52f401[_0xbd64('0x25')]]={'$like':'%'+_0x306f19['query'][_0xbd64('0x39')]+'%'};return _0x344d46;}})});}_0x4ed44a=_[_0xbd64('0x38')]({},_0x4ed44a,_0x306f19[_0xbd64('0x3a')]);var _0x27fd12={'where':_0x4ed44a['where']};return db['Tag'][_0xbd64('0x1b')](_0x27fd12)['then'](function(_0x595a91){_0xe876c9[_0xbd64('0x1b')]=_0x595a91;if(_0x306f19[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x4ed44a[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x29')][_0xbd64('0x3d')](_0x4ed44a);})[_0xbd64('0x20')](function(_0x762380){_0xe876c9['rows']=_0x762380;return _0xe876c9;})[_0xbd64('0x20')](respondWithFilteredResult(_0x207ffc,_0x4ed44a))[_0xbd64('0x3e')](handleError(_0x207ffc,null));};exports['show']=function(_0x41b27a,_0x1e4983){var _0xe5b069={'raw':!![],'where':{'id':_0x41b27a[_0xbd64('0x3f')]['id']}},_0x2bc972={};_0x2bc972[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['Tag'][_0xbd64('0x2a')]);_0x2bc972['query']=_[_0xbd64('0x2d')](_0x41b27a['query']);_0x2bc972[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2bc972[_0xbd64('0x2c')],_0x2bc972['query']);_0xe5b069[_0xbd64('0x31')]=_['intersection'](_0x2bc972['model'],qs['fields'](_0x41b27a[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xe5b069[_0xbd64('0x31')]=_0xe5b069[_0xbd64('0x31')][_0xbd64('0x32')]?_0xe5b069[_0xbd64('0x31')]:_0x2bc972[_0xbd64('0x2c')];if(_0x41b27a['query'][_0xbd64('0x3b')]){_0xe5b069[_0xbd64('0x3c')]=[{'all':!![]}];}_0xe5b069=_[_0xbd64('0x38')]({},_0xe5b069,_0x41b27a['options']);return db[_0xbd64('0x29')][_0xbd64('0x41')](_0xe5b069)[_0xbd64('0x20')](handleEntityNotFound(_0x1e4983,null))[_0xbd64('0x20')](respondWithResult(_0x1e4983,null))[_0xbd64('0x3e')](handleError(_0x1e4983,null));};exports['create']=function(_0x283699,_0x1a9ec8){return db[_0xbd64('0x29')][_0xbd64('0x42')](_0x283699['body'],{})['then'](function(_0x1e008f){var _0x2a7eec=_0x283699[_0xbd64('0x43')][_0xbd64('0x22')]({'plain':!![]});if(!_0x2a7eec)throw new Error(_0xbd64('0x44'));if(_0x2a7eec[_0xbd64('0x45')]===_0xbd64('0x43')){var _0x3807a7=_0x1e008f[_0xbd64('0x22')]({'plain':!![]});var _0x2709b2=_0xbd64('0x23');return db[_0xbd64('0x46')][_0xbd64('0x41')]({'where':{'name':_0x2709b2,'userProfileId':_0x2a7eec[_0xbd64('0x47')]},'raw':!![]})[_0xbd64('0x20')](function(_0x5bd444){if(_0x5bd444&&_0x5bd444[_0xbd64('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3807a7['name'],'resourceId':_0x3807a7['id'],'type':_0x5bd444['name'],'sectionId':_0x5bd444['id']},{})[_0xbd64('0x20')](function(){return _0x1e008f;});}else{return _0x1e008f;}})[_0xbd64('0x3e')](function(_0x5480f5){logger[_0xbd64('0x49')](_0xbd64('0x4a'),_0x5480f5);throw _0x5480f5;});}return _0x1e008f;})[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,0xc9))['catch'](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x1f')]=function(_0x371bad,_0x44cd4f){if(_0x371bad[_0xbd64('0x4b')]['id']){delete _0x371bad[_0xbd64('0x4b')]['id'];}return db[_0xbd64('0x29')]['find']({'where':{'id':_0x371bad['params']['id']}})['then'](handleEntityNotFound(_0x44cd4f,null))[_0xbd64('0x20')](saveUpdates(_0x371bad[_0xbd64('0x4b')],null))[_0xbd64('0x20')](respondWithResult(_0x44cd4f,null))[_0xbd64('0x3e')](handleError(_0x44cd4f,null));};exports['destroy']=function(_0x1d0d9f,_0x20b275){return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x1d0d9f[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x20b275,null))['then'](removeEntity(_0x20b275,null))[_0xbd64('0x3e')](handleError(_0x20b275,null));}; \ No newline at end of file +var _0xb6b1=['apply','reject','save','update','then','UserProfileResource','destroy','end','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xb6b1[_0x3ceb54];return _0x26d8a6;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){var _0xc9554d=_0x4efab0['get']({'plain':!![]});var _0x6a317c='Tags';return db[_0x1b6b('0x24')][_0x1b6b('0x25')]({'where':{'type':_0x6a317c,'resourceId':_0xc9554d['id']}})[_0x1b6b('0x23')](function(){return _0x4efab0;});})[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)[_0x1b6b('0x26')]();});}};}function handleEntityNotFound(_0x5d0a0a,_0xe8b7b5){return function(_0x1bb7f3){if(!_0x1bb7f3){_0x5d0a0a[_0x1b6b('0x16')](0x194);}return _0x1bb7f3;};}function handleError(_0x3b33d4,_0x4bd5b8){_0x4bd5b8=_0x4bd5b8||0x1f4;return function(_0x23dac4){logger['error'](_0x23dac4['stack']);if(_0x23dac4[_0x1b6b('0x27')]){delete _0x23dac4['name'];}_0x3b33d4[_0x1b6b('0x17')](_0x4bd5b8)[_0x1b6b('0x28')](_0x23dac4);};}exports['index']=function(_0x4c42a9,_0x36878c){var _0x1f8925={},_0x53d5ec={},_0x56c2cd={'count':0x0,'rows':[]};var _0xf9672d=_[_0x1b6b('0x29')](db[_0x1b6b('0x2a')][_0x1b6b('0x2b')],function(_0x56f31b){return{'name':_0x56f31b[_0x1b6b('0x2c')],'type':_0x56f31b[_0x1b6b('0x2d')][_0x1b6b('0x2e')]};});_0x53d5ec[_0x1b6b('0x2f')]=_[_0x1b6b('0x29')](_0xf9672d,_0x1b6b('0x27'));_0x53d5ec[_0x1b6b('0x30')]=_[_0x1b6b('0x31')](_0x4c42a9[_0x1b6b('0x30')]);_0x53d5ec['filters']=_[_0x1b6b('0x32')](_0x53d5ec[_0x1b6b('0x2f')],_0x53d5ec[_0x1b6b('0x30')]);_0x1f8925[_0x1b6b('0x33')]=_['intersection'](_0x53d5ec[_0x1b6b('0x2f')],qs['fields'](_0x4c42a9[_0x1b6b('0x30')]['fields']));_0x1f8925['attributes']=_0x1f8925[_0x1b6b('0x33')][_0x1b6b('0x34')]?_0x1f8925[_0x1b6b('0x33')]:_0x53d5ec['model'];if(!_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x35')](_0x1b6b('0x36'))){_0x1f8925[_0x1b6b('0x1b')]=qs[_0x1b6b('0x1b')](_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x1b')]);_0x1f8925[_0x1b6b('0x19')]=qs[_0x1b6b('0x19')](_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x19')]);}_0x1f8925[_0x1b6b('0x37')]=qs[_0x1b6b('0x38')](_0x4c42a9[_0x1b6b('0x30')]['sort']);_0x1f8925[_0x1b6b('0x39')]=qs[_0x1b6b('0x3a')](_['pick'](_0x4c42a9[_0x1b6b('0x30')],_0x53d5ec['filters']),_0xf9672d);if(_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x3b')]){_0x1f8925[_0x1b6b('0x39')]=_['merge'](_0x1f8925[_0x1b6b('0x39')],{'$or':_[_0x1b6b('0x29')](_0xf9672d,function(_0x401069){if(_0x401069['type']!==_0x1b6b('0x3c')){var _0x478287={};_0x478287[_0x401069[_0x1b6b('0x27')]]={'$like':'%'+_0x4c42a9['query']['filter']+'%'};return _0x478287;}})});}_0x1f8925=_['merge']({},_0x1f8925,_0x4c42a9[_0x1b6b('0x3d')]);var _0xd8b86={'where':_0x1f8925[_0x1b6b('0x39')]};return db[_0x1b6b('0x2a')][_0x1b6b('0x1c')](_0xd8b86)[_0x1b6b('0x23')](function(_0xe8bea5){_0x56c2cd['count']=_0xe8bea5;if(_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x3e')]){_0x1f8925[_0x1b6b('0x3f')]=[{'all':!![]}];}return db[_0x1b6b('0x2a')][_0x1b6b('0x40')](_0x1f8925);})[_0x1b6b('0x23')](function(_0x5cb83a){_0x56c2cd[_0x1b6b('0x41')]=_0x5cb83a;return _0x56c2cd;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x36878c,_0x1f8925))[_0x1b6b('0x42')](handleError(_0x36878c,null));};exports[_0x1b6b('0x43')]=function(_0x27f41f,_0x24c3e5){var _0x1c86ce={'raw':!![],'where':{'id':_0x27f41f[_0x1b6b('0x44')]['id']}},_0x393a56={};_0x393a56[_0x1b6b('0x2f')]=_[_0x1b6b('0x31')](db[_0x1b6b('0x2a')]['rawAttributes']);_0x393a56[_0x1b6b('0x30')]=_[_0x1b6b('0x31')](_0x27f41f[_0x1b6b('0x30')]);_0x393a56[_0x1b6b('0x3a')]=_[_0x1b6b('0x32')](_0x393a56[_0x1b6b('0x2f')],_0x393a56['query']);_0x1c86ce['attributes']=_[_0x1b6b('0x32')](_0x393a56['model'],qs[_0x1b6b('0x45')](_0x27f41f['query'][_0x1b6b('0x45')]));_0x1c86ce[_0x1b6b('0x33')]=_0x1c86ce[_0x1b6b('0x33')][_0x1b6b('0x34')]?_0x1c86ce['attributes']:_0x393a56[_0x1b6b('0x2f')];if(_0x27f41f['query']['includeAll']){_0x1c86ce[_0x1b6b('0x3f')]=[{'all':!![]}];}_0x1c86ce=_[_0x1b6b('0x46')]({},_0x1c86ce,_0x27f41f[_0x1b6b('0x3d')]);return db[_0x1b6b('0x2a')]['find'](_0x1c86ce)[_0x1b6b('0x23')](handleEntityNotFound(_0x24c3e5,null))['then'](respondWithResult(_0x24c3e5,null))[_0x1b6b('0x42')](handleError(_0x24c3e5,null));};exports[_0x1b6b('0x47')]=function(_0x281f19,_0x4b0b47){return db[_0x1b6b('0x2a')]['create'](_0x281f19[_0x1b6b('0x48')],{})['then'](function(_0x30bf9b){var _0x21245d=_0x281f19[_0x1b6b('0x49')][_0x1b6b('0x4a')]({'plain':!![]});if(!_0x21245d)throw new Error(_0x1b6b('0x4b'));if(_0x21245d[_0x1b6b('0x4c')]==='user'){var _0x4c1e02=_0x30bf9b[_0x1b6b('0x4a')]({'plain':!![]});var _0x2967b7='Tags';return db[_0x1b6b('0x4d')][_0x1b6b('0x4e')]({'where':{'name':_0x2967b7,'userProfileId':_0x21245d[_0x1b6b('0x4f')]},'raw':!![]})[_0x1b6b('0x23')](function(_0x2085ab){if(_0x2085ab&&_0x2085ab['autoAssociation']===0x0){return db[_0x1b6b('0x24')]['create']({'name':_0x4c1e02[_0x1b6b('0x27')],'resourceId':_0x4c1e02['id'],'type':_0x2085ab[_0x1b6b('0x27')],'sectionId':_0x2085ab['id']},{})[_0x1b6b('0x23')](function(){return _0x30bf9b;});}else{return _0x30bf9b;}})[_0x1b6b('0x42')](function(_0x3667ce){logger[_0x1b6b('0x50')](_0x1b6b('0x51'),_0x3667ce);throw _0x3667ce;});}return _0x30bf9b;})[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,0xc9))[_0x1b6b('0x42')](handleError(_0x4b0b47,null));};exports['update']=function(_0x4f6dbf,_0x58c7e7){if(_0x4f6dbf[_0x1b6b('0x48')]['id']){delete _0x4f6dbf['body']['id'];}return db['Tag'][_0x1b6b('0x4e')]({'where':{'id':_0x4f6dbf[_0x1b6b('0x44')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x58c7e7,null))[_0x1b6b('0x23')](saveUpdates(_0x4f6dbf['body'],null))[_0x1b6b('0x23')](respondWithResult(_0x58c7e7,null))[_0x1b6b('0x42')](handleError(_0x58c7e7,null));};exports[_0x1b6b('0x25')]=function(_0x4e3226,_0x4df1e4){return db[_0x1b6b('0x2a')][_0x1b6b('0x4e')]({'where':{'id':_0x4e3226[_0x1b6b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4df1e4,null))['then'](removeEntity(_0x4df1e4,null))['catch'](handleError(_0x4df1e4,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 71e57ac..01e264b 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 _0xb8b2=['path','./tag.attributes','tools_tags','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x211b69,_0x47a39a){var _0x1b5e8f=function(_0xa40e41){while(--_0xa40e41){_0x211b69['push'](_0x211b69['shift']());}};_0x1b5e8f(++_0x47a39a);}(_0xb8b2,0xb7));var _0x2b8b=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb8b2[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x2b8b('0x0'));var util=require(_0x2b8b('0x1'));var logger=require(_0x2b8b('0x2'))(_0x2b8b('0x3'));var moment=require(_0x2b8b('0x4'));var BPromise=require(_0x2b8b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b8b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2b8b('0x7'));module['exports']=function(_0x5e0b6f,_0x41b76a){return _0x5e0b6f['define']('Tag',attributes,{'tableName':_0x2b8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5051=['exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x4179c9,_0x5330a2){var _0x1f3a00=function(_0x538d58){while(--_0x538d58){_0x4179c9['push'](_0x4179c9['shift']());}};_0x1f3a00(++_0x5330a2);}(_0x5051,0x1b7));var _0x1505=function(_0x22d5de,_0x49fe19){_0x22d5de=_0x22d5de-0x0;var _0x3cf129=_0x5051[_0x22d5de];return _0x3cf129;};'use strict';var _=require(_0x1505('0x0'));var util=require(_0x1505('0x1'));var logger=require(_0x1505('0x2'))(_0x1505('0x3'));var moment=require(_0x1505('0x4'));var BPromise=require(_0x1505('0x5'));var rp=require(_0x1505('0x6'));var fs=require('fs');var path=require(_0x1505('0x7'));var rimraf=require(_0x1505('0x8'));var config=require(_0x1505('0x9'));var attributes=require(_0x1505('0xa'));module[_0x1505('0xb')]=function(_0x2d475d,_0x44aa85){return _0x2d475d[_0x1505('0xc')](_0x1505('0xd'),attributes,{'tableName':_0x1505('0xe'),'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 3ad4565..890b817 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 _0xb07f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3670cb,_0x56352d){var _0x2de357=function(_0x198bd6){while(--_0x198bd6){_0x3670cb['push'](_0x3670cb['shift']());}};_0x2de357(++_0x56352d);}(_0xb07f,0x109));var _0xfb07=function(_0xc3ba31,_0x34c038){_0xc3ba31=_0xc3ba31-0x0;var _0x207709=_0xb07f[_0xc3ba31];return _0x207709;};'use strict';var _=require(_0xfb07('0x0'));var util=require(_0xfb07('0x1'));var moment=require(_0xfb07('0x2'));var BPromise=require(_0xfb07('0x3'));var rs=require(_0xfb07('0x4'));var fs=require('fs');var Redis=require(_0xfb07('0x5'));var db=require(_0xfb07('0x6'))['db'];var utils=require(_0xfb07('0x7'));var logger=require(_0xfb07('0x8'))(_0xfb07('0x9'));var config=require(_0xfb07('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xfb07('0xb')][_0xfb07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14fc69,_0x1efe64,_0x41d73a){return new BPromise(function(_0x3bb9cf,_0x2b5000){return client[_0xfb07('0xd')](_0x14fc69,_0x41d73a)[_0xfb07('0xe')](function(_0x3d7220){logger[_0xfb07('0xf')](_0xfb07('0x10'),_0x1efe64,'request\x20sent');logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x1efe64,_0xfb07('0x11'),JSON[_0xfb07('0x12')](_0x3d7220));if(_0x3d7220['error']){if(_0x3d7220[_0xfb07('0x13')][_0xfb07('0x14')]===0x1f4){logger[_0xfb07('0x13')](_0xfb07('0x10'),_0x1efe64,_0x3d7220[_0xfb07('0x13')][_0xfb07('0x15')]);return _0x2b5000(_0x3d7220[_0xfb07('0x13')]['message']);}logger[_0xfb07('0x13')](_0xfb07('0x10'),_0x1efe64,_0x3d7220[_0xfb07('0x13')][_0xfb07('0x15')]);return _0x3bb9cf(_0x3d7220[_0xfb07('0x13')][_0xfb07('0x15')]);}else{logger[_0xfb07('0xf')](_0xfb07('0x10'),_0x1efe64,_0xfb07('0x11'));_0x3bb9cf(_0x3d7220[_0xfb07('0x16')][_0xfb07('0x15')]);}})[_0xfb07('0x17')](function(_0x1e42c4){logger[_0xfb07('0x13')]('Tag,\x20%s,\x20%s',_0x1efe64,_0x1e42c4);_0x2b5000(_0x1e42c4);});});} \ No newline at end of file +var _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x5089,0x1bb));var _0x9508=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0x5089[_0x2242a1];return _0x2c298b;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('Tag,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c257372..e10d060 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_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('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 ece21bd..309d678 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x314139,_0x3d585c){var _0x149ac7=function(_0x4c5441){while(--_0x4c5441){_0x314139['push'](_0x314139['shift']());}};_0x149ac7(++_0x3d585c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x73d0c4,_0xc1727e){var _0x3c8bd6=function(_0x14f4f3){while(--_0x14f4f3){_0x73d0c4['push'](_0x73d0c4['shift']());}};_0x3c8bd6(++_0xc1727e);}(_0xb10b,0x12a));var _0xbb10=function(_0x109946,_0x3494b7){_0x109946=_0x109946-0x0;var _0x4ed20b=_0xb10b[_0x109946];return _0x4ed20b;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 663c1c6..e6a55f4 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 _0xd838=['User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','removeAgents','Mail','Queue:remove','VoicePrefixId','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','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','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','end','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','add','removeQueues','remove','ids','addAgents','isArray','Chat','Sms','Fax','Whatsapp','transaction','Voice','penalty','QueueId','defaults','TeamVoiceQueue'];(function(_0x178a12,_0x252a6f){var _0x47f1bb=function(_0x3e7287){while(--_0x3e7287){_0x178a12['push'](_0x178a12['shift']());}};_0x47f1bb(++_0x252a6f);}(_0xd838,0x156));var _0x8d83=function(_0x2fa93c,_0x47bfdb){_0x2fa93c=_0x2fa93c-0x0;var _0x1ddb81=_0xd838[_0x2fa93c];return _0x1ddb81;};'use strict';var emlformat=require(_0x8d83('0x0'));var rimraf=require(_0x8d83('0x1'));var zipdir=require(_0x8d83('0x2'));var jsonpatch=require(_0x8d83('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d83('0x4'));var Mustache=require(_0x8d83('0x5'));var util=require(_0x8d83('0x6'));var path=require(_0x8d83('0x7'));var sox=require(_0x8d83('0x8'));var csv=require(_0x8d83('0x9'));var ejs=require(_0x8d83('0xa'));var fs=require('fs');var fs_extra=require(_0x8d83('0xb'));var _=require(_0x8d83('0xc'));var squel=require(_0x8d83('0xd'));var crypto=require(_0x8d83('0xe'));var jsforce=require(_0x8d83('0xf'));var deskjs=require(_0x8d83('0x10'));var toCsv=require(_0x8d83('0x9'));var querystring=require(_0x8d83('0x11'));var Papa=require(_0x8d83('0x12'));var Redis=require('ioredis');var authService=require(_0x8d83('0x13'));var qs=require(_0x8d83('0x14'));var as=require(_0x8d83('0x15'));var hardwareService=require(_0x8d83('0x16'));var logger=require(_0x8d83('0x17'))(_0x8d83('0x18'));var utils=require(_0x8d83('0x19'));var config=require(_0x8d83('0x1a'));var licenseUtil=require(_0x8d83('0x1b'));var db=require(_0x8d83('0x1c'))['db'];config['redis']=_['defaults'](config[_0x8d83('0x1d')],{'host':_0x8d83('0x1e'),'port':0x18eb});var socket=require(_0x8d83('0x1f'))(new Redis(config[_0x8d83('0x1d')]));require(_0x8d83('0x20'))[_0x8d83('0x21')](socket);function respondWithStatusCode(_0x3f8001,_0x2575f8){_0x2575f8=_0x2575f8||0xcc;return function(_0xdae944){if(_0xdae944){return _0x3f8001[_0x8d83('0x22')](_0x2575f8);}return _0x3f8001['status'](_0x2575f8)['end']();};}function respondWithResult(_0x394807,_0x5f24f4){_0x5f24f4=_0x5f24f4||0xc8;return function(_0x3f0a6f){if(_0x3f0a6f){return _0x394807[_0x8d83('0x23')](_0x5f24f4)[_0x8d83('0x24')](_0x3f0a6f);}};}function respondWithFilteredResult(_0x34e407,_0x339e58){return function(_0xaa706a){if(_0xaa706a){var _0x5a508c=typeof _0x339e58[_0x8d83('0x25')]===_0x8d83('0x26')&&typeof _0x339e58[_0x8d83('0x27')]===_0x8d83('0x26');var _0x517802=_0xaa706a[_0x8d83('0x28')];var _0x1860e0=_0x5a508c?0x0:_0x339e58[_0x8d83('0x25')];var _0x4d9c38=_0x5a508c?_0xaa706a[_0x8d83('0x28')]:_0x339e58[_0x8d83('0x25')]+_0x339e58[_0x8d83('0x27')];var _0x32942c;if(_0x4d9c38>=_0x517802){_0x4d9c38=_0x517802;_0x32942c=0xc8;}else{_0x32942c=0xce;}_0x34e407[_0x8d83('0x23')](_0x32942c);return _0x34e407['set'](_0x8d83('0x29'),_0x1860e0+'-'+_0x4d9c38+'/'+_0x517802)[_0x8d83('0x24')](_0xaa706a);}return null;};}function patchUpdates(_0x404025){return function(_0x266c05){try{jsonpatch['apply'](_0x266c05,_0x404025,!![]);}catch(_0x524c20){return BPromise['reject'](_0x524c20);}return _0x266c05['save']();};}function saveUpdates(_0x1004eb,_0x50834a){return function(_0x5d4e23){if(_0x5d4e23){return _0x5d4e23[_0x8d83('0x2a')](_0x1004eb)[_0x8d83('0x2b')](function(_0xe3ed65){return _0xe3ed65;});}return null;};}function handleEntityNotFound(_0x176d9f,_0x39ebbc){return function(_0x1687fa){if(!_0x1687fa){_0x176d9f['sendStatus'](0x194);}return _0x1687fa;};}function handleError(_0x4c24d2,_0x3c773b){_0x3c773b=_0x3c773b||0x1f4;return function(_0x1e70c0){logger[_0x8d83('0x2c')](_0x1e70c0[_0x8d83('0x2d')]);if(_0x1e70c0[_0x8d83('0x2e')]){delete _0x1e70c0[_0x8d83('0x2e')];}_0x4c24d2['status'](_0x3c773b)[_0x8d83('0x2f')](_0x1e70c0);};}exports[_0x8d83('0x30')]=function(_0xc94630,_0x3ec8b8){var _0x1ca189={},_0x237f69={},_0x350e78={'count':0x0,'rows':[]};var _0x53aceb=_[_0x8d83('0x31')](db[_0x8d83('0x32')][_0x8d83('0x33')],function(_0x2fa822){return{'name':_0x2fa822[_0x8d83('0x34')],'type':_0x2fa822[_0x8d83('0x35')][_0x8d83('0x36')]};});_0x237f69[_0x8d83('0x37')]=_[_0x8d83('0x31')](_0x53aceb,'name');_0x237f69[_0x8d83('0x38')]=_[_0x8d83('0x39')](_0xc94630['query']);_0x237f69[_0x8d83('0x3a')]=_['intersection'](_0x237f69[_0x8d83('0x37')],_0x237f69[_0x8d83('0x38')]);_0x1ca189[_0x8d83('0x3b')]=_[_0x8d83('0x3c')](_0x237f69['model'],qs[_0x8d83('0x3d')](_0xc94630[_0x8d83('0x38')][_0x8d83('0x3d')]));_0x1ca189['attributes']=_0x1ca189[_0x8d83('0x3b')]['length']?_0x1ca189[_0x8d83('0x3b')]:_0x237f69[_0x8d83('0x37')];if(!_0xc94630[_0x8d83('0x38')][_0x8d83('0x3e')](_0x8d83('0x3f'))){_0x1ca189[_0x8d83('0x27')]=qs['limit'](_0xc94630[_0x8d83('0x38')]['limit']);_0x1ca189['offset']=qs['offset'](_0xc94630['query'][_0x8d83('0x25')]);}_0x1ca189[_0x8d83('0x40')]=qs[_0x8d83('0x41')](_0xc94630[_0x8d83('0x38')][_0x8d83('0x41')]);_0x1ca189[_0x8d83('0x42')]=qs['filters'](_[_0x8d83('0x43')](_0xc94630[_0x8d83('0x38')],_0x237f69[_0x8d83('0x3a')]),_0x53aceb);if(_0xc94630['query'][_0x8d83('0x44')]){_0x1ca189[_0x8d83('0x42')]=_[_0x8d83('0x45')](_0x1ca189['where'],{'$or':_[_0x8d83('0x31')](_0x53aceb,function(_0xc16d7f){if(_0xc16d7f[_0x8d83('0x35')]!==_0x8d83('0x46')){var _0x159209={};_0x159209[_0xc16d7f['name']]={'$like':'%'+_0xc94630[_0x8d83('0x38')][_0x8d83('0x44')]+'%'};return _0x159209;}})});}_0x1ca189=_[_0x8d83('0x45')]({},_0x1ca189,_0xc94630[_0x8d83('0x47')]);var _0x3865b9={'where':_0x1ca189[_0x8d83('0x42')]};return db['Team'][_0x8d83('0x28')](_0x3865b9)[_0x8d83('0x2b')](function(_0xe5a421){_0x350e78[_0x8d83('0x28')]=_0xe5a421;if(_0xc94630['query']['includeAll']){_0x1ca189['include']=[{'all':!![]}];}return db['Team'][_0x8d83('0x48')](_0x1ca189);})[_0x8d83('0x2b')](function(_0x52ec37){_0x350e78[_0x8d83('0x49')]=_0x52ec37;return _0x350e78;})[_0x8d83('0x2b')](respondWithFilteredResult(_0x3ec8b8,_0x1ca189))[_0x8d83('0x4a')](handleError(_0x3ec8b8,null));};exports[_0x8d83('0x4b')]=function(_0xf19f73,_0x5267cc){var _0x57a86e={'raw':![],'where':{'id':_0xf19f73[_0x8d83('0x4c')]['id']}},_0x206f56={};_0x206f56[_0x8d83('0x37')]=_[_0x8d83('0x39')](db[_0x8d83('0x32')][_0x8d83('0x33')]);_0x206f56[_0x8d83('0x38')]=_['keys'](_0xf19f73[_0x8d83('0x38')]);_0x206f56[_0x8d83('0x3a')]=_[_0x8d83('0x3c')](_0x206f56[_0x8d83('0x37')],_0x206f56[_0x8d83('0x38')]);_0x57a86e[_0x8d83('0x3b')]=_[_0x8d83('0x3c')](_0x206f56[_0x8d83('0x37')],qs[_0x8d83('0x3d')](_0xf19f73[_0x8d83('0x38')]['fields']));_0x57a86e['attributes']=_0x57a86e[_0x8d83('0x3b')][_0x8d83('0x4d')]?_0x57a86e[_0x8d83('0x3b')]:_0x206f56[_0x8d83('0x37')];if(_0xf19f73[_0x8d83('0x38')][_0x8d83('0x4e')]){_0x57a86e[_0x8d83('0x4f')]=[{'all':!![]}];}_0x57a86e=_[_0x8d83('0x45')]({},_0x57a86e,_0xf19f73['options']);return db[_0x8d83('0x32')][_0x8d83('0x50')](_0x57a86e)[_0x8d83('0x2b')](handleEntityNotFound(_0x5267cc,null))[_0x8d83('0x2b')](respondWithResult(_0x5267cc,null))[_0x8d83('0x4a')](handleError(_0x5267cc,null));};exports[_0x8d83('0x51')]=function(_0x22b692,_0x5ecabc){return db[_0x8d83('0x32')][_0x8d83('0x51')](_0x22b692[_0x8d83('0x52')],{})[_0x8d83('0x2b')](function(_0x679841){var _0x4daf62=_0x22b692['user']['get']({'plain':!![]});if(!_0x4daf62)throw new Error(_0x8d83('0x53'));if(_0x4daf62[_0x8d83('0x54')]==='user'){var _0x5b0af7=_0x679841[_0x8d83('0x55')]({'plain':!![]});var _0x4b9e36=_0x8d83('0x56');return db[_0x8d83('0x57')][_0x8d83('0x50')]({'where':{'name':_0x4b9e36,'userProfileId':_0x4daf62[_0x8d83('0x58')]},'raw':!![]})[_0x8d83('0x2b')](function(_0x3193c4){if(_0x3193c4&&_0x3193c4[_0x8d83('0x59')]===0x0){return db[_0x8d83('0x5a')][_0x8d83('0x51')]({'name':_0x5b0af7['name'],'resourceId':_0x5b0af7['id'],'type':_0x3193c4['name'],'sectionId':_0x3193c4['id']},{})['then'](function(){return _0x679841;});}else{return _0x679841;}})['catch'](function(_0x549613){logger[_0x8d83('0x2c')](_0x8d83('0x5b'),_0x549613);throw _0x549613;});}return _0x679841;})[_0x8d83('0x2b')](respondWithResult(_0x5ecabc,0xc9))[_0x8d83('0x4a')](handleError(_0x5ecabc,null));};exports[_0x8d83('0x2a')]=function(_0x5ebfd1,_0x4e8adb){if(_0x5ebfd1['body']['id']){delete _0x5ebfd1[_0x8d83('0x52')]['id'];}return db['Team'][_0x8d83('0x50')]({'where':{'id':_0x5ebfd1[_0x8d83('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e8adb,null))[_0x8d83('0x2b')](saveUpdates(_0x5ebfd1[_0x8d83('0x52')],null))[_0x8d83('0x2b')](respondWithResult(_0x4e8adb,null))[_0x8d83('0x4a')](handleError(_0x4e8adb,null));};exports[_0x8d83('0x5c')]=function(_0x52a51b,_0x507d13){var _0x42af30=_0x52a51b[_0x8d83('0x4c')]['id'];var _0x1f6be0=[];return db['sequelize']['transaction'](function(_0x3d7b6f){var _0xd2c10e=_0x8d83('0x5d')+_0x42af30;return db[_0x8d83('0x5e')][_0x8d83('0x38')](_0xd2c10e,{'type':db[_0x8d83('0x5f')]['QueryTypes'][_0x8d83('0x60')],'raw':!![],'transaction':_0x3d7b6f})[_0x8d83('0x2b')](function(_0x5b07da){_0x1f6be0=_[_0x8d83('0x31')](_0x5b07da,function(_0x5f790a){return Number(_0x5f790a[_0x8d83('0x61')]);});})[_0x8d83('0x2b')](function(){var _0x5db2ef=_0x8d83('0x62')+_0x42af30;return db[_0x8d83('0x5e')][_0x8d83('0x38')](_0x5db2ef,{'type':db[_0x8d83('0x5f')][_0x8d83('0x63')][_0x8d83('0x60')],'raw':!![],'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(_0x596af1){var _0x3e4d90=_[_0x8d83('0x31')](_0x596af1,function(_0xad044a){return Number(_0xad044a[_0x8d83('0x64')]);});return db[_0x8d83('0x65')][_0x8d83('0x5c')]({'where':{'UserId':{'$in':_0x1f6be0},'VoiceQueueId':{'$in':_0x3e4d90}},'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(){var _0xb004f7=_0x8d83('0x66')+_0x42af30;return db['sequelize'][_0x8d83('0x38')](_0xb004f7,{'type':db[_0x8d83('0x5f')][_0x8d83('0x63')][_0x8d83('0x60')],'raw':!![],'transaction':_0x3d7b6f});})['then'](function(_0x1423cc){var _0x33c5ed=_['map'](_0x1423cc,function(_0x36662f){return Number(_0x36662f['MailQueueId']);});return db[_0x8d83('0x67')][_0x8d83('0x5c')]({'where':{'UserId':{'$in':_0x1f6be0},'MailQueueId':{'$in':_0x33c5ed}},'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(){var _0x558cd3=_0x8d83('0x68')+_0x42af30;return db['sequelize'][_0x8d83('0x38')](_0x558cd3,{'type':db['Sequelize'][_0x8d83('0x63')][_0x8d83('0x60')],'raw':!![],'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(_0x182247){var _0x5675a6=_['map'](_0x182247,function(_0x56d79c){return Number(_0x56d79c['SmsQueueId']);});return db['UserSmsQueue'][_0x8d83('0x5c')]({'where':{'UserId':{'$in':_0x1f6be0},'SmsQueueId':{'$in':_0x5675a6}},'transaction':_0x3d7b6f});})['then'](function(){var _0x1679b3=_0x8d83('0x69')+_0x42af30;return db[_0x8d83('0x5e')]['query'](_0x1679b3,{'type':db[_0x8d83('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3d7b6f});})['then'](function(_0x2d1165){var _0x3dcd67=_['map'](_0x2d1165,function(_0x45ff2d){return Number(_0x45ff2d[_0x8d83('0x6a')]);});return db[_0x8d83('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x1f6be0},'ChatQueueId':{'$in':_0x3dcd67}},'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(){var _0x1a4205=_0x8d83('0x6c')+_0x42af30;return db['sequelize'][_0x8d83('0x38')](_0x1a4205,{'type':db[_0x8d83('0x5f')][_0x8d83('0x63')][_0x8d83('0x60')],'raw':!![],'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(_0x5f1f2b){var _0x16cbfd=_[_0x8d83('0x31')](_0x5f1f2b,function(_0x2925f1){return Number(_0x2925f1[_0x8d83('0x6d')]);});return db[_0x8d83('0x6e')][_0x8d83('0x5c')]({'where':{'UserId':{'$in':_0x1f6be0},'FaxQueueId':{'$in':_0x16cbfd}},'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(){var _0x2a78a0=_0x8d83('0x6f')+_0x42af30;return db[_0x8d83('0x5e')][_0x8d83('0x38')](_0x2a78a0,{'type':db[_0x8d83('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(_0x5576e5){var _0x492eac=_['map'](_0x5576e5,function(_0x242efb){return Number(_0x242efb[_0x8d83('0x70')]);});return db['UserOpenchannelQueue'][_0x8d83('0x5c')]({'where':{'UserId':{'$in':_0x1f6be0},'OpenchannelQueueId':{'$in':_0x492eac}},'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(){var _0x5374e2=_0x8d83('0x71')+_0x42af30;return db[_0x8d83('0x5e')]['query'](_0x5374e2,{'type':db['Sequelize'][_0x8d83('0x63')][_0x8d83('0x60')],'raw':!![],'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(_0xe59eb1){var _0x5de523=_['map'](_0xe59eb1,function(_0x5e59d2){return Number(_0x5e59d2[_0x8d83('0x72')]);});return db['UserWhatsappQueue'][_0x8d83('0x5c')]({'where':{'UserId':{'$in':_0x1f6be0},'WhatsappQueueId':{'$in':_0x5de523}},'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(){return db[_0x8d83('0x73')][_0x8d83('0x50')]({'where':{'TeamId':_0x42af30}});})[_0x8d83('0x2b')](function(_0x26b49d){if(_0x26b49d===null){return;}return db[_0x8d83('0x74')][_0x8d83('0x5c')]({'where':{'UserId':{'$in':_0x1f6be0},'VoicePrefixId':_0x26b49d['VoicePrefixId']},'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(){return db[_0x8d83('0x32')][_0x8d83('0x5c')]({'where':{'id':_0x42af30},'cascade':!![],'transaction':_0x3d7b6f});})[_0x8d83('0x2b')](function(_0x4027ac){if(_0x4027ac===0x0){_0x507d13[_0x8d83('0x22')](0x194);}else{return db['UserProfileResource'][_0x8d83('0x5c')]({'where':{'type':'Teams','resourceId':_0x42af30},'cascade':!![],'transaction':_0x3d7b6f})[_0x8d83('0x2b')](function(){_0x507d13[_0x8d83('0x23')](0xcc)[_0x8d83('0x75')]();});}})['catch'](function(_0x218b6a){_0x507d13[_0x8d83('0x23')](0x1f4)['send'](_0x218b6a);});});};exports['getQueues']=function(_0x19517a,_0x49845f,_0x59facf){return db[_0x8d83('0x32')][_0x8d83('0x76')]({'where':{'id':_0x19517a[_0x8d83('0x4c')]['id']}})[_0x8d83('0x2b')](handleEntityNotFound(_0x49845f,null))['then'](function(_0x508ed2){if(!_0x19517a[_0x8d83('0x38')][_0x8d83('0x77')]||!utils['isValidChannel'](_0x19517a['query'][_0x8d83('0x77')])){throw new db[(_0x8d83('0x5f'))][(_0x8d83('0x78'))](_0x8d83('0x79'));}var _0x23db3f={};var _0x1d6478={};_0x1d6478['model']=_['keys'](db[_[_0x8d83('0x7a')](_0x19517a[_0x8d83('0x38')][_0x8d83('0x77')][_0x8d83('0x7b')]())+_0x8d83('0x7c')][_0x8d83('0x33')]);_0x1d6478[_0x8d83('0x38')]=_[_0x8d83('0x39')](_0x19517a['query']);_0x1d6478[_0x8d83('0x3a')]=_['intersection'](_0x1d6478[_0x8d83('0x37')],_0x1d6478['query']);_0x23db3f[_0x8d83('0x3b')]=_[_0x8d83('0x3c')](_0x1d6478[_0x8d83('0x37')],qs[_0x8d83('0x3d')](_0x19517a[_0x8d83('0x38')]['fields']));_0x23db3f['attributes']=_0x23db3f[_0x8d83('0x3b')]['length']?_0x23db3f[_0x8d83('0x3b')]:_0x1d6478[_0x8d83('0x37')];_0x23db3f[_0x8d83('0x27')]=qs[_0x8d83('0x27')](_0x19517a['query'][_0x8d83('0x27')]);_0x23db3f[_0x8d83('0x25')]=qs[_0x8d83('0x25')](_0x19517a[_0x8d83('0x38')][_0x8d83('0x25')]);_0x23db3f[_0x8d83('0x40')]=qs[_0x8d83('0x41')](_0x19517a['query'][_0x8d83('0x41')]);_0x23db3f[_0x8d83('0x42')]=qs[_0x8d83('0x3a')](_[_0x8d83('0x43')](_0x19517a[_0x8d83('0x38')],_0x1d6478['filters']));_0x23db3f=_[_0x8d83('0x45')]({},_0x23db3f,_0x19517a[_0x8d83('0x47')]);return _0x508ed2['get'+_[_0x8d83('0x7a')](_0x19517a[_0x8d83('0x38')][_0x8d83('0x77')][_0x8d83('0x7b')]())+_0x8d83('0x7d')](_0x23db3f);})[_0x8d83('0x2b')](respondWithResult(_0x49845f,null))[_0x8d83('0x4a')](handleError(_0x49845f,null));};exports[_0x8d83('0x7e')]=function(_0x259f7a,_0x32bb53,_0x108d7f){return db[_0x8d83('0x32')]['findOne']({'where':{'id':_0x259f7a[_0x8d83('0x4c')]['id']}})[_0x8d83('0x2b')](function(_0x540d1e){if(_0x540d1e){if(!_0x259f7a[_0x8d83('0x52')][_0x8d83('0x77')]||!utils[_0x8d83('0x7f')](_0x259f7a['body'][_0x8d83('0x77')])){throw new db['Sequelize'][(_0x8d83('0x78'))](_0x8d83('0x79'));}return _0x540d1e[_0x8d83('0x80')+_[_0x8d83('0x7a')](_0x259f7a[_0x8d83('0x52')]['channel'][_0x8d83('0x7b')]())+'Queues'](_0x259f7a[_0x8d83('0x52')]['ids']);}return null;})[_0x8d83('0x2b')](handleEntityNotFound(_0x32bb53,null))['then'](respondWithStatusCode(_0x32bb53,null))[_0x8d83('0x4a')](handleError(_0x32bb53,null));};exports[_0x8d83('0x81')]=function(_0x1c20d1,_0x5878e6,_0x23d053){return db[_0x8d83('0x32')][_0x8d83('0x76')]({'where':{'id':_0x1c20d1[_0x8d83('0x4c')]['id']}})[_0x8d83('0x2b')](function(_0x38716f){if(_0x38716f){if(!_0x1c20d1['query'][_0x8d83('0x77')]||!utils[_0x8d83('0x7f')](_0x1c20d1[_0x8d83('0x38')][_0x8d83('0x77')])){throw new db['Sequelize'][(_0x8d83('0x78'))](_0x8d83('0x79'));}return _0x38716f[_0x8d83('0x82')+_[_0x8d83('0x7a')](_0x1c20d1[_0x8d83('0x38')][_0x8d83('0x77')]['toLowerCase']())+_0x8d83('0x7d')](_0x1c20d1[_0x8d83('0x38')][_0x8d83('0x83')]);}return null;})[_0x8d83('0x2b')](handleEntityNotFound(_0x5878e6,null))[_0x8d83('0x2b')](respondWithStatusCode(_0x5878e6,null))[_0x8d83('0x4a')](handleError(_0x5878e6,null));};exports[_0x8d83('0x84')]=function(_0x24718b,_0x162ffc){var _0x4de731=_[_0x8d83('0x85')](_0x24718b[_0x8d83('0x52')][_0x8d83('0x83')])?_0x24718b[_0x8d83('0x52')][_0x8d83('0x83')]:[_0x24718b['body']['ids']];var _0x4b720f=_0x24718b[_0x8d83('0x4c')]['id'];return db[_0x8d83('0x32')][_0x8d83('0x50')]({'where':{'id':_0x4b720f}})[_0x8d83('0x2b')](handleEntityNotFound(_0x162ffc,null))[_0x8d83('0x2b')](function(_0x3a18a2){if(_0x3a18a2){var _0x4b904f=['Voice',_0x8d83('0x86'),'Mail',_0x8d83('0x87'),_0x8d83('0x88'),'Openchannel',_0x8d83('0x89')];return db[_0x8d83('0x5e')][_0x8d83('0x8a')](function(_0x5e4eeb){var _0x296aa2=_[_0x8d83('0x31')](_0x4b904f,function(_0x339231){var _0x3d6462={'attributes':['id',_0x8d83('0x2e')]};if(_0x339231===_0x8d83('0x8b')){_0x3d6462['through']={'attributes':[_0x8d83('0x8c')]};}return _0x3a18a2[_0x8d83('0x55')+_0x339231+'Queues'](_0x3d6462)[_0x8d83('0x2b')](function(_0x52e82d){var _0x58273b=_[_0x8d83('0x31')](_0x52e82d,function(_0x12a1a9){var _0x42fa24=_[_0x8d83('0x31')](_0x4de731,function(_0x275aec){var _0x5b5b1d={'where':{'UserId':_0x275aec,[_0x339231+_0x8d83('0x8d')]:_0x12a1a9['id']},'transaction':_0x5e4eeb};if(_0x339231===_0x8d83('0x8b')){_0x5b5b1d[_0x8d83('0x8e')]={'penalty':_0x12a1a9[_0x8d83('0x8f')]['penalty']};}return db[_0x8d83('0x90')+_0x339231+_0x8d83('0x7c')][_0x8d83('0x91')](_0x5b5b1d)[_0x8d83('0x2b')](function(){socket[_0x8d83('0x92')]('user'+_0x339231+_0x8d83('0x93'),{'UserId':_0x275aec,[_0x339231+'QueueId']:_0x12a1a9['id']});if(_0x339231!==_0x8d83('0x8b')){return;}return db[_0x8d83('0x90')][_0x8d83('0x48')]({'where':{'id':_0x4de731,'online':0x1},'attributes':['id','name',_0x8d83('0x94'),_0x8d83('0x95'),'interface'],'raw':!![]})[_0x8d83('0x2b')](function(_0x4e3795){var _0x4255a9=_[_0x8d83('0x31')](_0x4e3795,function(_0x1620dd){return db[_0x8d83('0x96')][_0x8d83('0x97')]({'membername':_0x1620dd[_0x8d83('0x2e')],'UserId':_0x1620dd['id'],'queue_name':_0x12a1a9[_0x8d83('0x2e')],'VoiceQueueId':_0x12a1a9['id'],'interface':_[_0x8d83('0x98')](_0x1620dd[_0x8d83('0x99')])?util[_0x8d83('0x9a')](_0x8d83('0x9b'),_0x1620dd[_0x8d83('0x2e')]):_0x1620dd[_0x8d83('0x99')],'paused':_0x1620dd[_0x8d83('0x95')]||![],'penalty':_0x12a1a9[_0x8d83('0x8f')][_0x8d83('0x8c')]},{'transaction':_0x5e4eeb});});return Promise['all'](_0x4255a9);});});});return Promise[_0x8d83('0x9c')](_0x42fa24);});return Promise[_0x8d83('0x9c')](_0x58273b);})['then'](function(){return db[_0x8d83('0x73')][_0x8d83('0x76')]({'where':{'teamId':_0x4b720f}})['then'](function(_0x2d370f){if(_0x2d370f){var _0x55d462=_[_0x8d83('0x31')](_0x4de731,function(_0x1d1a68){db[_0x8d83('0x74')][_0x8d83('0x97')]({'UserId':_0x1d1a68,'VoicePrefixId':_0x2d370f['VoicePrefixId']});});return Promise[_0x8d83('0x9c')](_0x55d462);}});});});return Promise[_0x8d83('0x9c')](_0x296aa2)['then'](function(){return _0x3a18a2['addAgents'](_0x4de731,{'transaction':_0x5e4eeb})['spread'](function(_0x102994){return _0x102994;});});});}})[_0x8d83('0x2b')](respondWithResult(_0x162ffc,null))[_0x8d83('0x4a')](handleError(_0x162ffc,null));};exports[_0x8d83('0x9d')]=function(_0x51e4c0,_0x135918){var _0x66aa2c=_[_0x8d83('0x85')](_0x51e4c0[_0x8d83('0x38')][_0x8d83('0x83')])?_0x51e4c0[_0x8d83('0x38')][_0x8d83('0x83')]:[_0x51e4c0[_0x8d83('0x38')][_0x8d83('0x83')]];var _0x4d936a=_0x51e4c0[_0x8d83('0x4c')]['id'];return db[_0x8d83('0x32')]['find']({'where':{'id':_0x4d936a}})[_0x8d83('0x2b')](handleEntityNotFound(_0x135918,null))['then'](function(_0x1d6e44){if(_0x1d6e44){var _0x5021c1=['Voice','Chat',_0x8d83('0x9e'),_0x8d83('0x87'),'Fax','Openchannel',_0x8d83('0x89')];return db[_0x8d83('0x5e')]['transaction'](function(_0xe51989){var _0x81db18=_[_0x8d83('0x31')](_0x5021c1,function(_0x3182ed){var _0x12389e={'attributes':['id',_0x8d83('0x2e')]};return _0x1d6e44['get'+_0x3182ed+_0x8d83('0x7d')](_0x12389e)[_0x8d83('0x2b')](function(_0x3d1e55){var _0x2b82e7=_['map'](_0x3d1e55,function(_0x591f56){return _0x591f56[_0x8d83('0x9d')](_0x66aa2c,{'transaction':_0xe51989})[_0x8d83('0x2b')](function(){var _0x532788=_[_0x8d83('0x31')](_0x66aa2c,function(_0x27bf51){socket[_0x8d83('0x92')]('user'+_0x3182ed+_0x8d83('0x9f'),{'UserId':Number(_0x27bf51),[_0x3182ed+'QueueId']:_0x591f56['id']});if(_0x3182ed!=='Voice'){return;}return db[_0x8d83('0x96')][_0x8d83('0x5c')]({'where':{'VoiceQueueId':_0x591f56['id'],'UserId':_0x27bf51},'transaction':_0xe51989});});return Promise[_0x8d83('0x9c')](_0x532788);});});return Promise[_0x8d83('0x9c')](_0x2b82e7);});});return Promise[_0x8d83('0x9c')](_0x81db18)['then'](function(){return _0x1d6e44[_0x8d83('0x9d')](_0x66aa2c,{'transaction':_0xe51989});})[_0x8d83('0x2b')](function(){return db[_0x8d83('0x73')][_0x8d83('0x76')]({'where':{'teamId':_0x4d936a}})[_0x8d83('0x2b')](function(_0x5c99c5){if(_0x5c99c5){var _0x54c072=_[_0x8d83('0x31')](_0x66aa2c,function(_0x5aea53){db['UserVoicePrefix'][_0x8d83('0x5c')]({'where':{'UserId':_0x5aea53,'VoicePrefixId':_0x5c99c5[_0x8d83('0xa0')]}});});return Promise[_0x8d83('0x9c')](_0x54c072);}});});});}})[_0x8d83('0x2b')](respondWithStatusCode(_0x135918,null))['catch'](handleError(_0x135918,null));};exports[_0x8d83('0xa1')]=function(_0x312c13,_0xaafcf5,_0x33bca8){var _0x255793={};var _0x5afbb0={};var _0xfaa7f6;var _0x185a2e;return db[_0x8d83('0x32')][_0x8d83('0x76')]({'where':{'id':_0x312c13[_0x8d83('0x4c')]['id']}})['then'](handleEntityNotFound(_0xaafcf5,null))[_0x8d83('0x2b')](function(_0x391fd2){if(_0x391fd2){_0xfaa7f6=_0x391fd2;_0x5afbb0[_0x8d83('0x37')]=_[_0x8d83('0x39')](db[_0x8d83('0x90')][_0x8d83('0x33')]);_0x5afbb0[_0x8d83('0x38')]=_['keys'](_0x312c13[_0x8d83('0x38')]);_0x5afbb0[_0x8d83('0x3a')]=_[_0x8d83('0x3c')](_0x5afbb0['model'],_0x5afbb0[_0x8d83('0x38')]);_0x255793[_0x8d83('0x3b')]=_[_0x8d83('0x3c')](_0x5afbb0[_0x8d83('0x37')],qs['fields'](_0x312c13['query']['fields']));_0x255793[_0x8d83('0x3b')]=_0x255793[_0x8d83('0x3b')]['length']?_0x255793[_0x8d83('0x3b')]:_0x5afbb0[_0x8d83('0x37')];_0x255793[_0x8d83('0x40')]=qs[_0x8d83('0x41')](_0x312c13[_0x8d83('0x38')]['sort']);_0x255793['where']=qs[_0x8d83('0x3a')](_['pick'](_0x312c13[_0x8d83('0x38')],_0x5afbb0[_0x8d83('0x3a')]));if(_0x312c13['query']['filter']){_0x255793[_0x8d83('0x42')]=_[_0x8d83('0x45')](_0x255793[_0x8d83('0x42')],{'$or':_[_0x8d83('0x31')](_0x255793['attributes'],function(_0x17ef91){var _0xafaa82={};_0xafaa82[_0x17ef91]={'$like':'%'+_0x312c13[_0x8d83('0x38')]['filter']+'%'};return _0xafaa82;})});}_0x255793=_[_0x8d83('0x45')]({},_0x255793,_0x312c13[_0x8d83('0x47')]);return _0xfaa7f6[_0x8d83('0xa1')](_0x255793);}})[_0x8d83('0x2b')](function(_0x37003e){if(_0x37003e){_0x185a2e=_0x37003e[_0x8d83('0x4d')];if(!_0x312c13[_0x8d83('0x38')]['hasOwnProperty'](_0x8d83('0x3f'))){_0x255793[_0x8d83('0x27')]=qs[_0x8d83('0x27')](_0x312c13[_0x8d83('0x38')][_0x8d83('0x27')]);_0x255793[_0x8d83('0x25')]=qs[_0x8d83('0x25')](_0x312c13['query'][_0x8d83('0x25')]);}return _0xfaa7f6[_0x8d83('0xa1')](_0x255793);}})[_0x8d83('0x2b')](function(_0x4237fd){if(_0x4237fd){return _0x4237fd?{'count':_0x185a2e,'rows':_0x4237fd}:null;}})[_0x8d83('0x2b')](respondWithResult(_0xaafcf5,null))[_0x8d83('0x4a')](handleError(_0xaafcf5,null));}; \ No newline at end of file +var _0x556e=['transaction','through','penalty','QueueId','TeamVoiceQueue','Queue','Queue:save','findAll','online','voicePause','upsert','isNil','interface','format','SIP/%s','all','spread','removeAgents','Mail','emit','Queue:remove','UserVoiceQueueRt','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','error','stack','name','send','index','Team','rawAttributes','fieldName','type','key','map','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','include','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','sequelize','Sequelize','UserId','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','destroy','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','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','channel','toLowerCase','capitalize','Queues','findOne','ValidationError','Unknown\x20channel','add','ids','removeQueues','isValidChannel','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x556e,0x158));var _0xe556=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x556e[_0x218994];return _0x3f350b;};'use strict';var emlformat=require(_0xe556('0x0'));var rimraf=require(_0xe556('0x1'));var zipdir=require(_0xe556('0x2'));var jsonpatch=require(_0xe556('0x3'));var rp=require(_0xe556('0x4'));var moment=require(_0xe556('0x5'));var BPromise=require(_0xe556('0x6'));var Mustache=require(_0xe556('0x7'));var util=require(_0xe556('0x8'));var path=require(_0xe556('0x9'));var sox=require(_0xe556('0xa'));var csv=require(_0xe556('0xb'));var ejs=require(_0xe556('0xc'));var fs=require('fs');var fs_extra=require(_0xe556('0xd'));var _=require('lodash');var squel=require(_0xe556('0xe'));var crypto=require(_0xe556('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe556('0x10'));var toCsv=require(_0xe556('0xb'));var querystring=require(_0xe556('0x11'));var Papa=require(_0xe556('0x12'));var Redis=require(_0xe556('0x13'));var authService=require(_0xe556('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe556('0x15'));var logger=require(_0xe556('0x16'))(_0xe556('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe556('0x18'));var db=require(_0xe556('0x19'))['db'];config[_0xe556('0x1a')]=_[_0xe556('0x1b')](config[_0xe556('0x1a')],{'host':_0xe556('0x1c'),'port':0x18eb});var socket=require(_0xe556('0x1d'))(new Redis(config[_0xe556('0x1a')]));require(_0xe556('0x1e'))['register'](socket);function respondWithStatusCode(_0x4b16cc,_0x2669a8){_0x2669a8=_0x2669a8||0xcc;return function(_0x300907){if(_0x300907){return _0x4b16cc[_0xe556('0x1f')](_0x2669a8);}return _0x4b16cc[_0xe556('0x20')](_0x2669a8)['end']();};}function respondWithResult(_0x540c4c,_0x34439a){_0x34439a=_0x34439a||0xc8;return function(_0x1812c6){if(_0x1812c6){return _0x540c4c[_0xe556('0x20')](_0x34439a)[_0xe556('0x21')](_0x1812c6);}};}function respondWithFilteredResult(_0x2a53bc,_0x1882db){return function(_0x10105b){if(_0x10105b){var _0x2e75bd=typeof _0x1882db[_0xe556('0x22')]===_0xe556('0x23')&&typeof _0x1882db[_0xe556('0x24')]===_0xe556('0x23');var _0x1bf6f=_0x10105b[_0xe556('0x25')];var _0x55a815=_0x2e75bd?0x0:_0x1882db[_0xe556('0x22')];var _0x2b1bd5=_0x2e75bd?_0x10105b[_0xe556('0x25')]:_0x1882db[_0xe556('0x22')]+_0x1882db[_0xe556('0x24')];var _0xf43706;if(_0x2b1bd5>=_0x1bf6f){_0x2b1bd5=_0x1bf6f;_0xf43706=0xc8;}else{_0xf43706=0xce;}_0x2a53bc['status'](_0xf43706);return _0x2a53bc[_0xe556('0x26')]('Content-Range',_0x55a815+'-'+_0x2b1bd5+'/'+_0x1bf6f)[_0xe556('0x21')](_0x10105b);}return null;};}function patchUpdates(_0xe36cb8){return function(_0x549e7b){try{jsonpatch[_0xe556('0x27')](_0x549e7b,_0xe36cb8,!![]);}catch(_0x7a1509){return BPromise[_0xe556('0x28')](_0x7a1509);}return _0x549e7b['save']();};}function saveUpdates(_0x5bfe2a,_0xe95cd8){return function(_0x365af1){if(_0x365af1){return _0x365af1[_0xe556('0x29')](_0x5bfe2a)['then'](function(_0x3bc255){return _0x3bc255;});}return null;};}function handleEntityNotFound(_0x7aa200,_0x185aff){return function(_0x38ca94){if(!_0x38ca94){_0x7aa200['sendStatus'](0x194);}return _0x38ca94;};}function handleError(_0x50a19e,_0x5abe25){_0x5abe25=_0x5abe25||0x1f4;return function(_0x48e452){logger[_0xe556('0x2a')](_0x48e452[_0xe556('0x2b')]);if(_0x48e452[_0xe556('0x2c')]){delete _0x48e452[_0xe556('0x2c')];}_0x50a19e[_0xe556('0x20')](_0x5abe25)[_0xe556('0x2d')](_0x48e452);};}exports[_0xe556('0x2e')]=function(_0x295fc2,_0x21bf13){var _0x514677={},_0x4ed4a={},_0x501f8a={'count':0x0,'rows':[]};var _0x365242=_['map'](db[_0xe556('0x2f')][_0xe556('0x30')],function(_0xa76ab5){return{'name':_0xa76ab5[_0xe556('0x31')],'type':_0xa76ab5[_0xe556('0x32')][_0xe556('0x33')]};});_0x4ed4a['model']=_[_0xe556('0x34')](_0x365242,_0xe556('0x2c'));_0x4ed4a['query']=_[_0xe556('0x35')](_0x295fc2[_0xe556('0x36')]);_0x4ed4a['filters']=_[_0xe556('0x37')](_0x4ed4a['model'],_0x4ed4a[_0xe556('0x36')]);_0x514677[_0xe556('0x38')]=_[_0xe556('0x37')](_0x4ed4a[_0xe556('0x39')],qs[_0xe556('0x3a')](_0x295fc2[_0xe556('0x36')][_0xe556('0x3a')]));_0x514677[_0xe556('0x38')]=_0x514677['attributes'][_0xe556('0x3b')]?_0x514677[_0xe556('0x38')]:_0x4ed4a[_0xe556('0x39')];if(!_0x295fc2[_0xe556('0x36')][_0xe556('0x3c')](_0xe556('0x3d'))){_0x514677[_0xe556('0x24')]=qs[_0xe556('0x24')](_0x295fc2[_0xe556('0x36')]['limit']);_0x514677[_0xe556('0x22')]=qs[_0xe556('0x22')](_0x295fc2[_0xe556('0x36')][_0xe556('0x22')]);}_0x514677[_0xe556('0x3e')]=qs[_0xe556('0x3f')](_0x295fc2[_0xe556('0x36')][_0xe556('0x3f')]);_0x514677['where']=qs[_0xe556('0x40')](_[_0xe556('0x41')](_0x295fc2['query'],_0x4ed4a[_0xe556('0x40')]),_0x365242);if(_0x295fc2[_0xe556('0x36')][_0xe556('0x42')]){_0x514677[_0xe556('0x43')]=_[_0xe556('0x44')](_0x514677[_0xe556('0x43')],{'$or':_['map'](_0x365242,function(_0x1d9231){if(_0x1d9231[_0xe556('0x32')]!==_0xe556('0x45')){var _0x5a075d={};_0x5a075d[_0x1d9231[_0xe556('0x2c')]]={'$like':'%'+_0x295fc2[_0xe556('0x36')][_0xe556('0x42')]+'%'};return _0x5a075d;}})});}_0x514677=_[_0xe556('0x44')]({},_0x514677,_0x295fc2[_0xe556('0x46')]);var _0x3f40f1={'where':_0x514677[_0xe556('0x43')]};return db[_0xe556('0x2f')][_0xe556('0x25')](_0x3f40f1)[_0xe556('0x47')](function(_0x3d92d8){_0x501f8a[_0xe556('0x25')]=_0x3d92d8;if(_0x295fc2[_0xe556('0x36')]['includeAll']){_0x514677[_0xe556('0x48')]=[{'all':!![]}];}return db['Team']['findAll'](_0x514677);})[_0xe556('0x47')](function(_0x342630){_0x501f8a['rows']=_0x342630;return _0x501f8a;})[_0xe556('0x47')](respondWithFilteredResult(_0x21bf13,_0x514677))['catch'](handleError(_0x21bf13,null));};exports[_0xe556('0x49')]=function(_0x5433d5,_0x3eecf4){var _0x2c244d={'raw':![],'where':{'id':_0x5433d5['params']['id']}},_0x592442={};_0x592442[_0xe556('0x39')]=_[_0xe556('0x35')](db[_0xe556('0x2f')][_0xe556('0x30')]);_0x592442['query']=_[_0xe556('0x35')](_0x5433d5[_0xe556('0x36')]);_0x592442[_0xe556('0x40')]=_[_0xe556('0x37')](_0x592442[_0xe556('0x39')],_0x592442[_0xe556('0x36')]);_0x2c244d[_0xe556('0x38')]=_[_0xe556('0x37')](_0x592442[_0xe556('0x39')],qs[_0xe556('0x3a')](_0x5433d5['query']['fields']));_0x2c244d['attributes']=_0x2c244d[_0xe556('0x38')][_0xe556('0x3b')]?_0x2c244d['attributes']:_0x592442[_0xe556('0x39')];if(_0x5433d5['query']['includeAll']){_0x2c244d[_0xe556('0x48')]=[{'all':!![]}];}_0x2c244d=_[_0xe556('0x44')]({},_0x2c244d,_0x5433d5[_0xe556('0x46')]);return db['Team']['find'](_0x2c244d)['then'](handleEntityNotFound(_0x3eecf4,null))[_0xe556('0x47')](respondWithResult(_0x3eecf4,null))[_0xe556('0x4a')](handleError(_0x3eecf4,null));};exports[_0xe556('0x4b')]=function(_0x36333e,_0x26566e){return db[_0xe556('0x2f')][_0xe556('0x4b')](_0x36333e[_0xe556('0x4c')],{})[_0xe556('0x47')](function(_0xe7b328){var _0x3397a7=_0x36333e[_0xe556('0x4d')]['get']({'plain':!![]});if(!_0x3397a7)throw new Error(_0xe556('0x4e'));if(_0x3397a7[_0xe556('0x4f')]==='user'){var _0xbf5205=_0xe7b328[_0xe556('0x50')]({'plain':!![]});var _0x3949db='Teams';return db[_0xe556('0x51')][_0xe556('0x52')]({'where':{'name':_0x3949db,'userProfileId':_0x3397a7[_0xe556('0x53')]},'raw':!![]})[_0xe556('0x47')](function(_0x281f3d){if(_0x281f3d&&_0x281f3d[_0xe556('0x54')]===0x0){return db[_0xe556('0x55')][_0xe556('0x4b')]({'name':_0xbf5205[_0xe556('0x2c')],'resourceId':_0xbf5205['id'],'type':_0x281f3d[_0xe556('0x2c')],'sectionId':_0x281f3d['id']},{})['then'](function(){return _0xe7b328;});}else{return _0xe7b328;}})['catch'](function(_0x32c4f5){logger[_0xe556('0x2a')](_0xe556('0x56'),_0x32c4f5);throw _0x32c4f5;});}return _0xe7b328;})[_0xe556('0x47')](respondWithResult(_0x26566e,0xc9))[_0xe556('0x4a')](handleError(_0x26566e,null));};exports['update']=function(_0x5d5c2b,_0x6e4221){if(_0x5d5c2b[_0xe556('0x4c')]['id']){delete _0x5d5c2b['body']['id'];}return db[_0xe556('0x2f')]['find']({'where':{'id':_0x5d5c2b['params']['id']}})['then'](handleEntityNotFound(_0x6e4221,null))[_0xe556('0x47')](saveUpdates(_0x5d5c2b['body'],null))[_0xe556('0x47')](respondWithResult(_0x6e4221,null))[_0xe556('0x4a')](handleError(_0x6e4221,null));};exports['destroy']=function(_0x1aba9b,_0x4ab138){var _0xe7b99e=_0x1aba9b[_0xe556('0x57')]['id'];var _0x50542b=[];return db[_0xe556('0x58')]['transaction'](function(_0xb084b7){var _0x3e35d9='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x3e35d9,{'type':db[_0xe556('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xb084b7})[_0xe556('0x47')](function(_0x17c34d){_0x50542b=_[_0xe556('0x34')](_0x17c34d,function(_0x345c61){return Number(_0x345c61[_0xe556('0x5a')]);});})[_0xe556('0x47')](function(){var _0x51b2a5='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x51b2a5,{'type':db[_0xe556('0x59')][_0xe556('0x5b')][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})[_0xe556('0x47')](function(_0x407a60){var _0x2ef58e=_[_0xe556('0x34')](_0x407a60,function(_0x1bc2de){return Number(_0x1bc2de[_0xe556('0x5d')]);});return db[_0xe556('0x5e')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'VoiceQueueId':{'$in':_0x2ef58e}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x51202f=_0xe556('0x60')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x51202f,{'type':db[_0xe556('0x59')]['QueryTypes'][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x4c22d2){var _0x43fb96=_[_0xe556('0x34')](_0x4c22d2,function(_0x26d629){return Number(_0x26d629[_0xe556('0x61')]);});return db[_0xe556('0x62')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'MailQueueId':{'$in':_0x43fb96}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x3225f0=_0xe556('0x63')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x3225f0,{'type':db[_0xe556('0x59')]['QueryTypes'][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x16488c){var _0x4462ab=_[_0xe556('0x34')](_0x16488c,function(_0x520db1){return Number(_0x520db1[_0xe556('0x64')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x50542b},'SmsQueueId':{'$in':_0x4462ab}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x19a2f4=_0xe556('0x65')+_0xe7b99e;return db['sequelize'][_0xe556('0x36')](_0x19a2f4,{'type':db[_0xe556('0x59')][_0xe556('0x5b')]['SELECT'],'raw':!![],'transaction':_0xb084b7});})[_0xe556('0x47')](function(_0x14d557){var _0x1163c7=_[_0xe556('0x34')](_0x14d557,function(_0x459b10){return Number(_0x459b10['ChatQueueId']);});return db[_0xe556('0x66')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'ChatQueueId':{'$in':_0x1163c7}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0xf5199b=_0xe556('0x67')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0xf5199b,{'type':db['Sequelize']['QueryTypes'][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x4c4dbd){var _0x4c5cf4=_[_0xe556('0x34')](_0x4c4dbd,function(_0x968a0e){return Number(_0x968a0e[_0xe556('0x68')]);});return db[_0xe556('0x69')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'FaxQueueId':{'$in':_0x4c5cf4}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x44afd2=_0xe556('0x6a')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x44afd2,{'type':db[_0xe556('0x59')][_0xe556('0x5b')][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x27c1d2){var _0x7a0399=_[_0xe556('0x34')](_0x27c1d2,function(_0x1a9fc2){return Number(_0x1a9fc2[_0xe556('0x6b')]);});return db[_0xe556('0x6c')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'OpenchannelQueueId':{'$in':_0x7a0399}},'transaction':_0xb084b7});})['then'](function(){var _0x5c54f3=_0xe556('0x6d')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x5c54f3,{'type':db['Sequelize'][_0xe556('0x5b')][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x3075c0){var _0x4ceac5=_[_0xe556('0x34')](_0x3075c0,function(_0x5e0453){return Number(_0x5e0453[_0xe556('0x6e')]);});return db[_0xe556('0x6f')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'WhatsappQueueId':{'$in':_0x4ceac5}},'transaction':_0xb084b7});})['then'](function(){return db[_0xe556('0x70')][_0xe556('0x52')]({'where':{'TeamId':_0xe7b99e}});})[_0xe556('0x47')](function(_0x55c5f9){if(_0x55c5f9===null){return;}return db[_0xe556('0x71')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'VoicePrefixId':_0x55c5f9[_0xe556('0x72')]},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){return db[_0xe556('0x2f')][_0xe556('0x5f')]({'where':{'id':_0xe7b99e},'cascade':!![],'transaction':_0xb084b7});})[_0xe556('0x47')](function(_0x427b65){if(_0x427b65===0x0){_0x4ab138[_0xe556('0x1f')](0x194);}else{return db['UserProfileResource'][_0xe556('0x5f')]({'where':{'type':_0xe556('0x73'),'resourceId':_0xe7b99e},'cascade':!![],'transaction':_0xb084b7})[_0xe556('0x47')](function(){_0x4ab138[_0xe556('0x20')](0xcc)['end']();});}})['catch'](function(_0x4b38d8){_0x4ab138[_0xe556('0x20')](0x1f4)[_0xe556('0x2d')](_0x4b38d8);});});};exports['getQueues']=function(_0x30a074,_0x31689b,_0x3d6281){return db['Team']['findOne']({'where':{'id':_0x30a074['params']['id']}})[_0xe556('0x47')](handleEntityNotFound(_0x31689b,null))[_0xe556('0x47')](function(_0x3826e5){if(!_0x30a074[_0xe556('0x36')][_0xe556('0x74')]||!utils['isValidChannel'](_0x30a074[_0xe556('0x36')][_0xe556('0x74')])){throw new db[(_0xe556('0x59'))]['ValidationError']('Unknown\x20channel');}var _0x4276db={};var _0x46137d={};_0x46137d[_0xe556('0x39')]=_[_0xe556('0x35')](db[_['capitalize'](_0x30a074[_0xe556('0x36')][_0xe556('0x74')][_0xe556('0x75')]())+'Queue'][_0xe556('0x30')]);_0x46137d[_0xe556('0x36')]=_[_0xe556('0x35')](_0x30a074[_0xe556('0x36')]);_0x46137d[_0xe556('0x40')]=_[_0xe556('0x37')](_0x46137d[_0xe556('0x39')],_0x46137d['query']);_0x4276db[_0xe556('0x38')]=_[_0xe556('0x37')](_0x46137d[_0xe556('0x39')],qs['fields'](_0x30a074[_0xe556('0x36')][_0xe556('0x3a')]));_0x4276db[_0xe556('0x38')]=_0x4276db[_0xe556('0x38')][_0xe556('0x3b')]?_0x4276db[_0xe556('0x38')]:_0x46137d[_0xe556('0x39')];_0x4276db[_0xe556('0x24')]=qs[_0xe556('0x24')](_0x30a074[_0xe556('0x36')]['limit']);_0x4276db[_0xe556('0x22')]=qs[_0xe556('0x22')](_0x30a074['query'][_0xe556('0x22')]);_0x4276db[_0xe556('0x3e')]=qs[_0xe556('0x3f')](_0x30a074[_0xe556('0x36')]['sort']);_0x4276db['where']=qs[_0xe556('0x40')](_[_0xe556('0x41')](_0x30a074[_0xe556('0x36')],_0x46137d[_0xe556('0x40')]));_0x4276db=_[_0xe556('0x44')]({},_0x4276db,_0x30a074[_0xe556('0x46')]);return _0x3826e5[_0xe556('0x50')+_[_0xe556('0x76')](_0x30a074[_0xe556('0x36')][_0xe556('0x74')][_0xe556('0x75')]())+_0xe556('0x77')](_0x4276db);})[_0xe556('0x47')](respondWithResult(_0x31689b,null))['catch'](handleError(_0x31689b,null));};exports['addQueues']=function(_0x516959,_0x4da569,_0x3eb9bf){return db['Team'][_0xe556('0x78')]({'where':{'id':_0x516959[_0xe556('0x57')]['id']}})[_0xe556('0x47')](function(_0x2a5068){if(_0x2a5068){if(!_0x516959[_0xe556('0x4c')]['channel']||!utils['isValidChannel'](_0x516959[_0xe556('0x4c')][_0xe556('0x74')])){throw new db['Sequelize'][(_0xe556('0x79'))](_0xe556('0x7a'));}return _0x2a5068[_0xe556('0x7b')+_[_0xe556('0x76')](_0x516959[_0xe556('0x4c')][_0xe556('0x74')][_0xe556('0x75')]())+_0xe556('0x77')](_0x516959[_0xe556('0x4c')][_0xe556('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x4da569,null))['then'](respondWithStatusCode(_0x4da569,null))[_0xe556('0x4a')](handleError(_0x4da569,null));};exports[_0xe556('0x7d')]=function(_0x3be4e1,_0x588500,_0xe0878){return db[_0xe556('0x2f')]['findOne']({'where':{'id':_0x3be4e1[_0xe556('0x57')]['id']}})['then'](function(_0x1c747e){if(_0x1c747e){if(!_0x3be4e1['query']['channel']||!utils[_0xe556('0x7e')](_0x3be4e1['query'][_0xe556('0x74')])){throw new db[(_0xe556('0x59'))][(_0xe556('0x79'))]('Unknown\x20channel');}return _0x1c747e[_0xe556('0x7f')+_[_0xe556('0x76')](_0x3be4e1[_0xe556('0x36')][_0xe556('0x74')][_0xe556('0x75')]())+_0xe556('0x77')](_0x3be4e1[_0xe556('0x36')][_0xe556('0x7c')]);}return null;})[_0xe556('0x47')](handleEntityNotFound(_0x588500,null))[_0xe556('0x47')](respondWithStatusCode(_0x588500,null))[_0xe556('0x4a')](handleError(_0x588500,null));};exports[_0xe556('0x80')]=function(_0x3c0cdb,_0x273480){var _0x5e1b2b=_[_0xe556('0x81')](_0x3c0cdb[_0xe556('0x4c')][_0xe556('0x7c')])?_0x3c0cdb['body']['ids']:[_0x3c0cdb[_0xe556('0x4c')][_0xe556('0x7c')]];var _0x2523e2=_0x3c0cdb[_0xe556('0x57')]['id'];return db['Team']['find']({'where':{'id':_0x2523e2}})['then'](handleEntityNotFound(_0x273480,null))[_0xe556('0x47')](function(_0x5baa7e){if(_0x5baa7e){var _0x42e3c7=[_0xe556('0x82'),_0xe556('0x83'),'Mail',_0xe556('0x84'),_0xe556('0x85'),_0xe556('0x86'),_0xe556('0x87')];return db[_0xe556('0x58')][_0xe556('0x88')](function(_0x4c18e5){var _0x298ddd=_[_0xe556('0x34')](_0x42e3c7,function(_0x1d27f0){var _0x36ffdd={'attributes':['id',_0xe556('0x2c')]};if(_0x1d27f0===_0xe556('0x82')){_0x36ffdd[_0xe556('0x89')]={'attributes':[_0xe556('0x8a')]};}return _0x5baa7e['get'+_0x1d27f0+_0xe556('0x77')](_0x36ffdd)['then'](function(_0x2c4527){var _0x72cfe6=_['map'](_0x2c4527,function(_0x529b01){var _0x23bdb0=_[_0xe556('0x34')](_0x5e1b2b,function(_0x557031){var _0x2d724c={'where':{'UserId':_0x557031,[_0x1d27f0+_0xe556('0x8b')]:_0x529b01['id']},'transaction':_0x4c18e5};if(_0x1d27f0===_0xe556('0x82')){_0x2d724c[_0xe556('0x1b')]={'penalty':_0x529b01[_0xe556('0x8c')][_0xe556('0x8a')]};}return db['User'+_0x1d27f0+_0xe556('0x8d')]['findOrCreate'](_0x2d724c)[_0xe556('0x47')](function(){socket['emit'](_0xe556('0x4d')+_0x1d27f0+_0xe556('0x8e'),{'UserId':_0x557031,[_0x1d27f0+_0xe556('0x8b')]:_0x529b01['id']});if(_0x1d27f0!==_0xe556('0x82')){return;}return db['User'][_0xe556('0x8f')]({'where':{'id':_0x5e1b2b,'online':0x1},'attributes':['id','name',_0xe556('0x90'),_0xe556('0x91'),'interface'],'raw':!![]})['then'](function(_0x573ac4){var _0x441112=_[_0xe556('0x34')](_0x573ac4,function(_0x29558d){return db['UserVoiceQueueRt'][_0xe556('0x92')]({'membername':_0x29558d['name'],'UserId':_0x29558d['id'],'queue_name':_0x529b01[_0xe556('0x2c')],'VoiceQueueId':_0x529b01['id'],'interface':_[_0xe556('0x93')](_0x29558d[_0xe556('0x94')])?util[_0xe556('0x95')](_0xe556('0x96'),_0x29558d[_0xe556('0x2c')]):_0x29558d['interface'],'paused':_0x29558d[_0xe556('0x91')]||![],'penalty':_0x529b01[_0xe556('0x8c')][_0xe556('0x8a')]},{'transaction':_0x4c18e5});});return Promise[_0xe556('0x97')](_0x441112);});});});return Promise[_0xe556('0x97')](_0x23bdb0);});return Promise[_0xe556('0x97')](_0x72cfe6);})[_0xe556('0x47')](function(){return db[_0xe556('0x70')]['findOne']({'where':{'teamId':_0x2523e2}})[_0xe556('0x47')](function(_0x2a2729){if(_0x2a2729){var _0x1edc3f=_[_0xe556('0x34')](_0x5e1b2b,function(_0x3ae632){db['UserVoicePrefix'][_0xe556('0x92')]({'UserId':_0x3ae632,'VoicePrefixId':_0x2a2729[_0xe556('0x72')]});});return Promise['all'](_0x1edc3f);}});});});return Promise[_0xe556('0x97')](_0x298ddd)[_0xe556('0x47')](function(){return _0x5baa7e['addAgents'](_0x5e1b2b,{'transaction':_0x4c18e5})[_0xe556('0x98')](function(_0x1dc76d){return _0x1dc76d;});});});}})[_0xe556('0x47')](respondWithResult(_0x273480,null))[_0xe556('0x4a')](handleError(_0x273480,null));};exports[_0xe556('0x99')]=function(_0x169cc8,_0x1731fa){var _0x20acad=_[_0xe556('0x81')](_0x169cc8[_0xe556('0x36')]['ids'])?_0x169cc8[_0xe556('0x36')]['ids']:[_0x169cc8[_0xe556('0x36')]['ids']];var _0x36c595=_0x169cc8['params']['id'];return db[_0xe556('0x2f')]['find']({'where':{'id':_0x36c595}})['then'](handleEntityNotFound(_0x1731fa,null))[_0xe556('0x47')](function(_0x2de076){if(_0x2de076){var _0x3d67ad=[_0xe556('0x82'),_0xe556('0x83'),_0xe556('0x9a'),_0xe556('0x84'),_0xe556('0x85'),_0xe556('0x86'),'Whatsapp'];return db[_0xe556('0x58')][_0xe556('0x88')](function(_0x1ac02e){var _0x3de6e0=_[_0xe556('0x34')](_0x3d67ad,function(_0x17a8d1){var _0x522a5c={'attributes':['id',_0xe556('0x2c')]};return _0x2de076[_0xe556('0x50')+_0x17a8d1+_0xe556('0x77')](_0x522a5c)[_0xe556('0x47')](function(_0x175221){var _0x3a30d8=_[_0xe556('0x34')](_0x175221,function(_0x525a10){return _0x525a10[_0xe556('0x99')](_0x20acad,{'transaction':_0x1ac02e})['then'](function(){var _0x361539=_[_0xe556('0x34')](_0x20acad,function(_0x5289ea){socket[_0xe556('0x9b')]('user'+_0x17a8d1+_0xe556('0x9c'),{'UserId':Number(_0x5289ea),[_0x17a8d1+_0xe556('0x8b')]:_0x525a10['id']});if(_0x17a8d1!==_0xe556('0x82')){return;}return db[_0xe556('0x9d')][_0xe556('0x5f')]({'where':{'VoiceQueueId':_0x525a10['id'],'UserId':_0x5289ea},'transaction':_0x1ac02e});});return Promise[_0xe556('0x97')](_0x361539);});});return Promise[_0xe556('0x97')](_0x3a30d8);});});return Promise[_0xe556('0x97')](_0x3de6e0)['then'](function(){return _0x2de076[_0xe556('0x99')](_0x20acad,{'transaction':_0x1ac02e});})[_0xe556('0x47')](function(){return db[_0xe556('0x70')][_0xe556('0x78')]({'where':{'teamId':_0x36c595}})[_0xe556('0x47')](function(_0x127829){if(_0x127829){var _0x594453=_[_0xe556('0x34')](_0x20acad,function(_0x161988){db[_0xe556('0x71')][_0xe556('0x5f')]({'where':{'UserId':_0x161988,'VoicePrefixId':_0x127829[_0xe556('0x72')]}});});return Promise[_0xe556('0x97')](_0x594453);}});});});}})[_0xe556('0x47')](respondWithStatusCode(_0x1731fa,null))[_0xe556('0x4a')](handleError(_0x1731fa,null));};exports[_0xe556('0x9e')]=function(_0xc3e56c,_0x2923cb,_0x317d36){var _0x29ec5e={};var _0xa2fa3c={};var _0xc2d72b;var _0x4e7587;return db[_0xe556('0x2f')][_0xe556('0x78')]({'where':{'id':_0xc3e56c[_0xe556('0x57')]['id']}})[_0xe556('0x47')](handleEntityNotFound(_0x2923cb,null))['then'](function(_0x84c34f){if(_0x84c34f){_0xc2d72b=_0x84c34f;_0xa2fa3c[_0xe556('0x39')]=_[_0xe556('0x35')](db[_0xe556('0x9f')][_0xe556('0x30')]);_0xa2fa3c[_0xe556('0x36')]=_[_0xe556('0x35')](_0xc3e56c[_0xe556('0x36')]);_0xa2fa3c['filters']=_[_0xe556('0x37')](_0xa2fa3c[_0xe556('0x39')],_0xa2fa3c[_0xe556('0x36')]);_0x29ec5e[_0xe556('0x38')]=_[_0xe556('0x37')](_0xa2fa3c[_0xe556('0x39')],qs['fields'](_0xc3e56c[_0xe556('0x36')]['fields']));_0x29ec5e[_0xe556('0x38')]=_0x29ec5e[_0xe556('0x38')]['length']?_0x29ec5e[_0xe556('0x38')]:_0xa2fa3c['model'];_0x29ec5e[_0xe556('0x3e')]=qs[_0xe556('0x3f')](_0xc3e56c[_0xe556('0x36')][_0xe556('0x3f')]);_0x29ec5e[_0xe556('0x43')]=qs[_0xe556('0x40')](_[_0xe556('0x41')](_0xc3e56c[_0xe556('0x36')],_0xa2fa3c[_0xe556('0x40')]));if(_0xc3e56c[_0xe556('0x36')][_0xe556('0x42')]){_0x29ec5e[_0xe556('0x43')]=_[_0xe556('0x44')](_0x29ec5e[_0xe556('0x43')],{'$or':_[_0xe556('0x34')](_0x29ec5e[_0xe556('0x38')],function(_0x507e70){var _0x4481c1={};_0x4481c1[_0x507e70]={'$like':'%'+_0xc3e56c[_0xe556('0x36')]['filter']+'%'};return _0x4481c1;})});}_0x29ec5e=_[_0xe556('0x44')]({},_0x29ec5e,_0xc3e56c['options']);return _0xc2d72b['getAgents'](_0x29ec5e);}})['then'](function(_0x281568){if(_0x281568){_0x4e7587=_0x281568[_0xe556('0x3b')];if(!_0xc3e56c['query'][_0xe556('0x3c')](_0xe556('0x3d'))){_0x29ec5e[_0xe556('0x24')]=qs[_0xe556('0x24')](_0xc3e56c[_0xe556('0x36')][_0xe556('0x24')]);_0x29ec5e[_0xe556('0x22')]=qs[_0xe556('0x22')](_0xc3e56c[_0xe556('0x36')][_0xe556('0x22')]);}return _0xc2d72b['getAgents'](_0x29ec5e);}})[_0xe556('0x47')](function(_0x3ab684){if(_0x3ab684){return _0x3ab684?{'count':_0x4e7587,'rows':_0x3ab684}:null;}})['then'](respondWithResult(_0x2923cb,null))[_0xe556('0x4a')](handleError(_0x2923cb,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 08e1c25..49c4d1f 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 _0xd773=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x214935,_0x6f6da8){var _0x5ab52c=function(_0x574a57){while(--_0x574a57){_0x214935['push'](_0x214935['shift']());}};_0x5ab52c(++_0x6f6da8);}(_0xd773,0xfa));var _0x3d77=function(_0x467fe0,_0x5d192f){_0x467fe0=_0x467fe0-0x0;var _0xab58d=_0xd773[_0x467fe0];return _0xab58d;};'use strict';var EventEmitter=require(_0x3d77('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x3d77('0x1')](0x0);var events={'afterCreate':_0x3d77('0x2'),'afterUpdate':_0x3d77('0x3'),'afterDestroy':_0x3d77('0x4')};function emitEvent(_0x5eaa2e){return function(_0x3620d8,_0x12330a,_0x3092e9){TeamEvents[_0x3d77('0x5')](_0x5eaa2e+':'+_0x3620d8['id'],_0x3620d8);TeamEvents[_0x3d77('0x5')](_0x5eaa2e,_0x3620d8);_0x3092e9(null);};}for(var e in events){if(events[_0x3d77('0x6')](e)){var event=events[e];Team[_0x3d77('0x7')](e,emitEvent(event));}}module[_0x3d77('0x8')]=TeamEvents; \ No newline at end of file +var _0x3581=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x3581,0x113));var _0x1358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3581[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1358('0x0'));var Team=require(_0x1358('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x1358('0x2')](0x0);var events={'afterCreate':_0x1358('0x3'),'afterUpdate':_0x1358('0x4'),'afterDestroy':_0x1358('0x5')};function emitEvent(_0x4f18c3){return function(_0x1654e1,_0x120595,_0xeeef6e){TeamEvents[_0x1358('0x6')](_0x4f18c3+':'+_0x1654e1['id'],_0x1654e1);TeamEvents[_0x1358('0x6')](_0x4f18c3,_0x1654e1);_0xeeef6e(null);};}for(var e in events){if(events[_0x1358('0x7')](e)){var event=events[e];Team[_0x1358('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 7425fba..18c565a 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 _0x8b8f=['Whatsapp','resolve','lodash','get','Queues','then','map','channel','catch','define','Team','Chat','Fax','Openchannel','Sms','Voice'];(function(_0x381b36,_0x1118d9){var _0x5d6cdb=function(_0x15c10a){while(--_0x15c10a){_0x381b36['push'](_0x381b36['shift']());}};_0x5d6cdb(++_0x1118d9);}(_0x8b8f,0xe2));var _0xf8b8=function(_0xefdd14,_0xd2ca45){_0xefdd14=_0xefdd14-0x0;var _0x160544=_0x8b8f[_0xefdd14];return _0x160544;};'use strict';var _=require(_0xf8b8('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x31fb4a,_0x2854a0){var _0x9ca96e=_0xf8b8('0x1')+_0x2854a0+_0xf8b8('0x2');return _0x31fb4a[_0x9ca96e]()[_0xf8b8('0x3')](function(_0x2635b2){return _[_0xf8b8('0x4')](_0x2635b2,function(_0x409649){_0x409649['setDataValue'](_0xf8b8('0x5'),_0x2854a0);return _0x409649;});})[_0xf8b8('0x6')](function(_0x1a5e67){throw _0x1a5e67;});}module['exports']=function(_0x1c3559){return _0x1c3559[_0xf8b8('0x7')](_0xf8b8('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x326181=this;var _0x1b0677=[_0xf8b8('0x9'),_0xf8b8('0xa'),'Mail',_0xf8b8('0xb'),_0xf8b8('0xc'),_0xf8b8('0xd'),_0xf8b8('0xe')];return Promise[_0xf8b8('0xf')]()['then'](function(){var _0x2770e3=_[_0xf8b8('0x4')](_0x1b0677,function(_0x1530ba){return getQueuesByChannel(_0x326181,_0x1530ba);});return Promise['all'](_0x2770e3);})['catch'](function(_0x2b825d){throw _0x2b825d;});}}});}; \ No newline at end of file +var _0xb669=['Mail','Openchannel','Sms','Voice','Whatsapp','then','all','./team.attributes','get','Queues','map','catch','define','Team','Chat','Fax'];(function(_0x1cdabe,_0x286194){var _0x3dcc9c=function(_0x5aa9c7){while(--_0x5aa9c7){_0x1cdabe['push'](_0x1cdabe['shift']());}};_0x3dcc9c(++_0x286194);}(_0xb669,0x1c7));var _0x9b66=function(_0x107ae2,_0xaf1dd){_0x107ae2=_0x107ae2-0x0;var _0x402224=_0xb669[_0x107ae2];return _0x402224;};'use strict';var _=require('lodash');var attributes=require(_0x9b66('0x0'));function getQueuesByChannel(_0x21a11f,_0x2bdb6c){var _0x1eaa13=_0x9b66('0x1')+_0x2bdb6c+_0x9b66('0x2');return _0x21a11f[_0x1eaa13]()['then'](function(_0x26ea67){return _[_0x9b66('0x3')](_0x26ea67,function(_0x57a429){_0x57a429['setDataValue']('channel',_0x2bdb6c);return _0x57a429;});})[_0x9b66('0x4')](function(_0x530135){throw _0x530135;});}module['exports']=function(_0x115889){return _0x115889[_0x9b66('0x5')](_0x9b66('0x6'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x21cf94=this;var _0x1ffd84=[_0x9b66('0x7'),_0x9b66('0x8'),_0x9b66('0x9'),_0x9b66('0xa'),_0x9b66('0xb'),_0x9b66('0xc'),_0x9b66('0xd')];return Promise['resolve']()[_0x9b66('0xe')](function(){var _0x49a14f=_[_0x9b66('0x3')](_0x1ffd84,function(_0x5d998b){return getQueuesByChannel(_0x21cf94,_0x5d998b);});return Promise[_0x9b66('0xf')](_0x49a14f);})[_0x9b66('0x4')](function(_0x5df284){throw _0x5df284;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 7e0d510..c11df63 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 _0x08d7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x531b10,_0x37f3f0){var _0x2b1371=function(_0x34a4ea){while(--_0x34a4ea){_0x531b10['push'](_0x531b10['shift']());}};_0x2b1371(++_0x37f3f0);}(_0x08d7,0x14f));var _0x708d=function(_0x162f0a,_0xdc0d95){_0x162f0a=_0x162f0a-0x0;var _0x5d941d=_0x08d7[_0x162f0a];return _0x5d941d;};'use strict';var _=require(_0x708d('0x0'));var util=require(_0x708d('0x1'));var moment=require(_0x708d('0x2'));var BPromise=require(_0x708d('0x3'));var rs=require(_0x708d('0x4'));var fs=require('fs');var Redis=require(_0x708d('0x5'));var db=require(_0x708d('0x6'))['db'];var utils=require(_0x708d('0x7'));var logger=require(_0x708d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x708d('0x9')][_0x708d('0xa')]({'port':0x232a});config[_0x708d('0xb')]=_[_0x708d('0xc')](config[_0x708d('0xb')],{'host':_0x708d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x708d('0xb')]));require(_0x708d('0xe'))[_0x708d('0xf')](socket);function respondWithRpcPromise(_0x2b146b,_0x14bbc5,_0x4d719a){return new BPromise(function(_0x2932b8,_0x1875ef){return client['request'](_0x2b146b,_0x4d719a)[_0x708d('0x10')](function(_0x47ade7){logger[_0x708d('0x11')](_0x708d('0x12'),_0x14bbc5,_0x708d('0x13'));logger['debug'](_0x708d('0x14'),_0x14bbc5,_0x708d('0x13'),JSON[_0x708d('0x15')](_0x47ade7));if(_0x47ade7['error']){if(_0x47ade7[_0x708d('0x16')][_0x708d('0x17')]===0x1f4){logger[_0x708d('0x16')](_0x708d('0x12'),_0x14bbc5,_0x47ade7['error'][_0x708d('0x18')]);return _0x1875ef(_0x47ade7[_0x708d('0x16')]['message']);}logger['error'](_0x708d('0x12'),_0x14bbc5,_0x47ade7['error']['message']);return _0x2932b8(_0x47ade7['error']['message']);}else{logger[_0x708d('0x11')]('Team,\x20%s,\x20%s',_0x14bbc5,_0x708d('0x13'));_0x2932b8(_0x47ade7['result'][_0x708d('0x18')]);}})[_0x708d('0x19')](function(_0x1e900c){logger[_0x708d('0x16')](_0x708d('0x12'),_0x14bbc5,_0x1e900c);_0x1875ef(_0x1e900c);});});} \ No newline at end of file +var _0x5726=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x439793,_0x26cb2c){var _0x50db30=function(_0x4c522f){while(--_0x4c522f){_0x439793['push'](_0x439793['shift']());}};_0x50db30(++_0x26cb2c);}(_0x5726,0xd1));var _0x6572=function(_0x58305a,_0x6536a3){_0x58305a=_0x58305a-0x0;var _0x18a9ea=_0x5726[_0x58305a];return _0x18a9ea;};'use strict';var _=require(_0x6572('0x0'));var util=require(_0x6572('0x1'));var moment=require(_0x6572('0x2'));var BPromise=require(_0x6572('0x3'));var rs=require(_0x6572('0x4'));var fs=require('fs');var Redis=require(_0x6572('0x5'));var db=require(_0x6572('0x6'))['db'];var utils=require(_0x6572('0x7'));var logger=require(_0x6572('0x8'))(_0x6572('0x9'));var config=require(_0x6572('0xa'));var jayson=require(_0x6572('0xb'));var client=jayson[_0x6572('0xc')][_0x6572('0xd')]({'port':0x232a});config[_0x6572('0xe')]=_['defaults'](config['redis'],{'host':_0x6572('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6572('0xe')]));require('./team.socket')[_0x6572('0x10')](socket);function respondWithRpcPromise(_0x277c73,_0x1a48da,_0x44166f){return new BPromise(function(_0x3621a4,_0x171868){return client[_0x6572('0x11')](_0x277c73,_0x44166f)['then'](function(_0x1566c4){logger['info'](_0x6572('0x12'),_0x1a48da,'request\x20sent');logger[_0x6572('0x13')](_0x6572('0x14'),_0x1a48da,'request\x20sent',JSON[_0x6572('0x15')](_0x1566c4));if(_0x1566c4[_0x6572('0x16')]){if(_0x1566c4[_0x6572('0x16')][_0x6572('0x17')]===0x1f4){logger[_0x6572('0x16')](_0x6572('0x12'),_0x1a48da,_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);return _0x171868(_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);}logger[_0x6572('0x16')](_0x6572('0x12'),_0x1a48da,_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);return _0x3621a4(_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);}else{logger['info'](_0x6572('0x12'),_0x1a48da,'request\x20sent');_0x3621a4(_0x1566c4[_0x6572('0x19')][_0x6572('0x18')]);}})[_0x6572('0x1a')](function(_0x49746e){logger[_0x6572('0x16')](_0x6572('0x12'),_0x1a48da,_0x49746e);_0x171868(_0x49746e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 066fae3..a8e542d 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 _0xff17=['emit','removeListener','length','team:','./team.events','save','update'];(function(_0x4ec911,_0x3534a0){var _0x13ab51=function(_0x3ced5c){while(--_0x3ced5c){_0x4ec911['push'](_0x4ec911['shift']());}};_0x13ab51(++_0x3534a0);}(_0xff17,0x1ee));var _0x7ff1=function(_0x37c925,_0x50d20e){_0x37c925=_0x37c925-0x0;var _0x182ad2=_0xff17[_0x37c925];return _0x182ad2;};'use strict';var TeamEvents=require(_0x7ff1('0x0'));var events=[_0x7ff1('0x1'),'remove',_0x7ff1('0x2')];function createListener(_0x248152,_0x47868a){return function(_0x196860){_0x47868a[_0x7ff1('0x3')](_0x248152,_0x196860);};}function removeListener(_0x57fbfc,_0x4167c1){return function(){TeamEvents[_0x7ff1('0x4')](_0x57fbfc,_0x4167c1);};}exports['register']=function(_0x503ae2){for(var _0x2fa878=0x0,_0x2c473f=events[_0x7ff1('0x5')];_0x2fa878<_0x2c473f;_0x2fa878++){var _0x8fd530=events[_0x2fa878];var _0x26f8c9=createListener(_0x7ff1('0x6')+_0x8fd530,_0x503ae2);TeamEvents['on'](_0x8fd530,_0x26f8c9);}}; \ No newline at end of file +var _0x43ae=['removeListener','register','length','./team.events','save','update','emit'];(function(_0x19d57e,_0xb5854f){var _0x1b4466=function(_0x19a25c){while(--_0x19a25c){_0x19d57e['push'](_0x19d57e['shift']());}};_0x1b4466(++_0xb5854f);}(_0x43ae,0x199));var _0xe43a=function(_0x43ff5d,_0x2d3055){_0x43ff5d=_0x43ff5d-0x0;var _0x51778b=_0x43ae[_0x43ff5d];return _0x51778b;};'use strict';var TeamEvents=require(_0xe43a('0x0'));var events=[_0xe43a('0x1'),'remove',_0xe43a('0x2')];function createListener(_0x34612a,_0x5b702a){return function(_0x1dbba9){_0x5b702a[_0xe43a('0x3')](_0x34612a,_0x1dbba9);};}function removeListener(_0x281d7c,_0x4c20a8){return function(){TeamEvents[_0xe43a('0x4')](_0x281d7c,_0x4c20a8);};}exports[_0xe43a('0x5')]=function(_0x30dc38){for(var _0x2d2dca=0x0,_0x1913ad=events[_0xe43a('0x6')];_0x2d2dca<_0x1913ad;_0x2d2dca++){var _0x19acaf=events[_0x2d2dca];var _0x5ab977=createListener('team:'+_0x19acaf,_0x30dc38);TeamEvents['on'](_0x19acaf,_0x5ab977);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1c2ff73..53a1f6c 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 _0x5265=['INTEGER','sequelize','exports'];(function(_0x15ca02,_0x386f7c){var _0x5ef92f=function(_0x19a2c1){while(--_0x19a2c1){_0x15ca02['push'](_0x15ca02['shift']());}};_0x5ef92f(++_0x386f7c);}(_0x5265,0x10c));var _0x5526=function(_0xa17be0,_0x1ee209){_0xa17be0=_0xa17be0-0x0;var _0x3a9341=_0x5265[_0xa17be0];return _0x3a9341;};'use strict';var Sequelize=require(_0x5526('0x0'));module[_0x5526('0x1')]={'TeamId':{'type':Sequelize[_0x5526('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa9e5=['sequelize','exports','INTEGER'];(function(_0x22f2a0,_0x3a8c8d){var _0x1188ad=function(_0x59ac96){while(--_0x59ac96){_0x22f2a0['push'](_0x22f2a0['shift']());}};_0x1188ad(++_0x3a8c8d);}(_0xa9e5,0x8a));var _0x5a9e=function(_0x28ed6c,_0x126ef0){_0x28ed6c=_0x28ed6c-0x0;var _0x5351ae=_0xa9e5[_0x28ed6c];return _0x5351ae;};'use strict';var Sequelize=require(_0x5a9e('0x0'));module[_0x5a9e('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x5a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 685f9bc..414453e 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 _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','TeamVoicePrefix'];(function(_0x3bd595,_0x2a8f16){var _0x40828c=function(_0x3665ab){while(--_0x3665ab){_0x3bd595['push'](_0x3bd595['shift']());}};_0x40828c(++_0x2a8f16);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1422dd,_0x4465cf){_0x1422dd=_0x1422dd-0x0;var _0x304e54=_0x8f4c[_0x1422dd];return _0x304e54;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x608a=['path','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5b24ce,_0x472918){var _0x5b5721=function(_0x1ebfde){while(--_0x1ebfde){_0x5b24ce['push'](_0x5b24ce['shift']());}};_0x5b5721(++_0x472918);}(_0x608a,0xff));var _0xa608=function(_0x67b060,_0x5b2995){_0x67b060=_0x67b060-0x0;var _0x947671=_0x608a[_0x67b060];return _0x947671;};'use strict';var _=require('lodash');var util=require(_0xa608('0x0'));var logger=require(_0xa608('0x1'))('api');var moment=require(_0xa608('0x2'));var BPromise=require(_0xa608('0x3'));var rp=require(_0xa608('0x4'));var fs=require('fs');var path=require(_0xa608('0x5'));var rimraf=require('rimraf');var config=require(_0xa608('0x6'));var attributes=require(_0xa608('0x7'));module['exports']=function(_0x4e24d6,_0x3b0f4e){return _0x4e24d6['define'](_0xa608('0x8'),attributes,{'tableName':_0xa608('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index a5cc82c..cf2b19a 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1c16a4,_0xbba97c){var _0xa47eb7=function(_0x3f4893){while(--_0x3f4893){_0x1c16a4['push'](_0x1c16a4['shift']());}};_0xa47eb7(++_0xbba97c);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xf93b08,_0x2559d7){var _0x12f72e=function(_0x30534b){while(--_0x30534b){_0xf93b08['push'](_0xf93b08['shift']());}};_0x12f72e(++_0x2559d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 05a77dc..7def145 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 _0xc7e4=['INTEGER','sequelize','exports'];(function(_0x354fdc,_0x1abbaa){var _0x16e710=function(_0x2c9d17){while(--_0x2c9d17){_0x354fdc['push'](_0x354fdc['shift']());}};_0x16e710(++_0x1abbaa);}(_0xc7e4,0x193));var _0x4c7e=function(_0x14ccae,_0x6b138f){_0x14ccae=_0x14ccae-0x0;var _0x317cc6=_0xc7e4[_0x14ccae];return _0x317cc6;};'use strict';var Sequelize=require(_0x4c7e('0x0'));module[_0x4c7e('0x1')]={'penalty':{'type':Sequelize[_0x4c7e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4a3=['INTEGER','sequelize','exports'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0xc4a3,0x7f));var _0x3c4a=function(_0xe74c2,_0x398738){_0xe74c2=_0xe74c2-0x0;var _0x115f1f=_0xc4a3[_0xe74c2];return _0x115f1f;};'use strict';var Sequelize=require(_0x3c4a('0x0'));module[_0x3c4a('0x1')]={'penalty':{'type':Sequelize[_0x3c4a('0x2')],'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 a63f256..4f524c9 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 _0xaf5a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x567b21,_0x240ffd){var _0x40fb0f=function(_0x2f5f2e){while(--_0x2f5f2e){_0x567b21['push'](_0x567b21['shift']());}};_0x40fb0f(++_0x240ffd);}(_0xaf5a,0x144));var _0xaaf5=function(_0x54e333,_0x4ba478){_0x54e333=_0x54e333-0x0;var _0x47279e=_0xaf5a[_0x54e333];return _0x47279e;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var logger=require('../../config/logger')(_0xaaf5('0x1'));var moment=require(_0xaaf5('0x2'));var BPromise=require(_0xaaf5('0x3'));var rp=require(_0xaaf5('0x4'));var fs=require('fs');var path=require(_0xaaf5('0x5'));var rimraf=require(_0xaaf5('0x6'));var config=require(_0xaaf5('0x7'));var attributes=require(_0xaaf5('0x8'));module['exports']=function(_0x3b1281,_0x5b9ec4){return _0x3b1281[_0xaaf5('0x9')](_0xaaf5('0xa'),attributes,{'tableName':_0xaaf5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa566=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','team_has_voice_queues','lodash'];(function(_0x24dfd2,_0x504fac){var _0x3abda1=function(_0x55bc85){while(--_0x55bc85){_0x24dfd2['push'](_0x24dfd2['shift']());}};_0x3abda1(++_0x504fac);}(_0xa566,0x1c1));var _0x6a56=function(_0x20e451,_0x389d0a){_0x20e451=_0x20e451-0x0;var _0x2bd75d=_0xa566[_0x20e451];return _0x2bd75d;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var logger=require(_0x6a56('0x2'))('api');var moment=require(_0x6a56('0x3'));var BPromise=require(_0x6a56('0x4'));var rp=require(_0x6a56('0x5'));var fs=require('fs');var path=require(_0x6a56('0x6'));var rimraf=require('rimraf');var config=require(_0x6a56('0x7'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x4c58b0,_0x47ecb8){return _0x4c58b0[_0x6a56('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0x6a56('0x9'),'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 80e6839..d4a87de 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 _0x8e18=['message','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x4ad6fe,_0x97cd4c){var _0x43ef2d=function(_0x8a93d3){while(--_0x8a93d3){_0x4ad6fe['push'](_0x4ad6fe['shift']());}};_0x43ef2d(++_0x97cd4c);}(_0x8e18,0x1ba));var _0x88e1=function(_0x5948e6,_0x618459){_0x5948e6=_0x5948e6-0x0;var _0x17d5a5=_0x8e18[_0x5948e6];return _0x17d5a5;};'use strict';var _=require('lodash');var util=require(_0x88e1('0x0'));var moment=require('moment');var BPromise=require(_0x88e1('0x1'));var rs=require(_0x88e1('0x2'));var fs=require('fs');var Redis=require(_0x88e1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88e1('0x4'))(_0x88e1('0x5'));var config=require(_0x88e1('0x6'));var jayson=require(_0x88e1('0x7'));var client=jayson[_0x88e1('0x8')][_0x88e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36a047,_0x2f6b89,_0x506574){return new BPromise(function(_0x3fe006,_0x4ec530){return client[_0x88e1('0xa')](_0x36a047,_0x506574)['then'](function(_0x3d6413){logger[_0x88e1('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2f6b89,_0x88e1('0xc'));logger[_0x88e1('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2f6b89,_0x88e1('0xc'),JSON[_0x88e1('0xe')](_0x3d6413));if(_0x3d6413[_0x88e1('0xf')]){if(_0x3d6413[_0x88e1('0xf')][_0x88e1('0x10')]===0x1f4){logger['error'](_0x88e1('0x11'),_0x2f6b89,_0x3d6413[_0x88e1('0xf')]['message']);return _0x4ec530(_0x3d6413[_0x88e1('0xf')]['message']);}logger[_0x88e1('0xf')](_0x88e1('0x11'),_0x2f6b89,_0x3d6413[_0x88e1('0xf')][_0x88e1('0x12')]);return _0x3fe006(_0x3d6413['error'][_0x88e1('0x12')]);}else{logger['info'](_0x88e1('0x11'),_0x2f6b89,_0x88e1('0xc'));_0x3fe006(_0x3d6413['result']['message']);}})[_0x88e1('0x13')](function(_0x363932){logger[_0x88e1('0xf')](_0x88e1('0x11'),_0x2f6b89,_0x363932);_0x4ec530(_0x363932);});});} \ No newline at end of file +var _0xa0e7=['request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../config/logger','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa0e7,0xaa));var _0x7a0e=function(_0x329595,_0x71ddda){_0x329595=_0x329595-0x0;var _0x53e5f0=_0xa0e7[_0x329595];return _0x53e5f0;};'use strict';var _=require(_0x7a0e('0x0'));var util=require(_0x7a0e('0x1'));var moment=require('moment');var BPromise=require(_0x7a0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a0e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7a0e('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a0e('0x5')][_0x7a0e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3ec1d7,_0x12ff84,_0xe574fc){return new BPromise(function(_0x519761,_0x486b59){return client[_0x7a0e('0x7')](_0x3ec1d7,_0xe574fc)['then'](function(_0x382e72){logger[_0x7a0e('0x8')](_0x7a0e('0x9'),_0x12ff84,_0x7a0e('0xa'));logger[_0x7a0e('0xb')](_0x7a0e('0xc'),_0x12ff84,_0x7a0e('0xa'),JSON[_0x7a0e('0xd')](_0x382e72));if(_0x382e72[_0x7a0e('0xe')]){if(_0x382e72[_0x7a0e('0xe')][_0x7a0e('0xf')]===0x1f4){logger[_0x7a0e('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x12ff84,_0x382e72[_0x7a0e('0xe')]['message']);return _0x486b59(_0x382e72[_0x7a0e('0xe')][_0x7a0e('0x10')]);}logger[_0x7a0e('0xe')](_0x7a0e('0x9'),_0x12ff84,_0x382e72[_0x7a0e('0xe')][_0x7a0e('0x10')]);return _0x519761(_0x382e72[_0x7a0e('0xe')][_0x7a0e('0x10')]);}else{logger[_0x7a0e('0x8')](_0x7a0e('0x9'),_0x12ff84,'request\x20sent');_0x519761(_0x382e72[_0x7a0e('0x11')][_0x7a0e('0x10')]);}})['catch'](function(_0x489c0c){logger[_0x7a0e('0xe')](_0x7a0e('0x9'),_0x12ff84,_0x489c0c);_0x486b59(_0x489c0c);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9b17d4e..bce84ec 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 _0xb1ad=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x5ba74f,_0x200bf4){var _0x534d79=function(_0x50521a){while(--_0x50521a){_0x5ba74f['push'](_0x5ba74f['shift']());}};_0x534d79(++_0x200bf4);}(_0xb1ad,0x184));var _0xdb1a=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xb1ad[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0xdb1a('0x0'));var util=require(_0xdb1a('0x1'));var path=require(_0xdb1a('0x2'));var timeout=require(_0xdb1a('0x3'));var express=require(_0xdb1a('0x4'));var router=express[_0xdb1a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdb1a('0x6'));var interaction=require(_0xdb1a('0x7'));var config=require(_0xdb1a('0x8'));var controller=require(_0xdb1a('0x9'));router[_0xdb1a('0xa')]('/',auth[_0xdb1a('0xb')](),controller[_0xdb1a('0xc')]);router[_0xdb1a('0xa')](_0xdb1a('0xd'),auth[_0xdb1a('0xb')](),controller[_0xdb1a('0xe')]);router[_0xdb1a('0xf')]('/',auth[_0xdb1a('0xb')](),controller[_0xdb1a('0x10')]);router[_0xdb1a('0x11')]('/:id',auth[_0xdb1a('0xb')](),controller[_0xdb1a('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xdb1a('0x13')]);module[_0xdb1a('0x14')]=router; \ No newline at end of file +var _0x9962=['express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x9962,0xb8));var _0x2996=function(_0x29ef77,_0x4c00a4){_0x29ef77=_0x29ef77-0x0;var _0x410958=_0x9962[_0x29ef77];return _0x410958;};'use strict';var multer=require(_0x2996('0x0'));var util=require('util');var path=require(_0x2996('0x1'));var timeout=require(_0x2996('0x2'));var express=require(_0x2996('0x3'));var router=express['Router']();var fs_extra=require(_0x2996('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2996('0x5'));var config=require(_0x2996('0x6'));var controller=require('./template.controller');router[_0x2996('0x7')]('/',auth[_0x2996('0x8')](),controller['index']);router[_0x2996('0x7')](_0x2996('0x9'),auth[_0x2996('0x8')](),controller[_0x2996('0xa')]);router[_0x2996('0xb')]('/',auth['isAuthenticated'](),controller[_0x2996('0xc')]);router['put'](_0x2996('0x9'),auth[_0x2996('0x8')](),controller[_0x2996('0xd')]);router[_0x2996('0xe')]('/:id',auth[_0x2996('0x8')](),controller[_0x2996('0xf')]);module[_0x2996('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index fbca883..eff534c 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 _0x634f=['STRING','sequelize','exports'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x634f,0xf1));var _0xf634=function(_0x25e95c,_0x503d33){_0x25e95c=_0x25e95c-0x0;var _0x22da27=_0x634f[_0x25e95c];return _0x22da27;};'use strict';var Sequelize=require(_0xf634('0x0'));module[_0xf634('0x1')]={'name':{'type':Sequelize[_0xf634('0x2')]},'description':{'type':Sequelize[_0xf634('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdd52=['sequelize','TEXT'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0xdd52,0x1e4));var _0x2dd5=function(_0xf08866,_0x5d404c){_0xf08866=_0xf08866-0x0;var _0x1d171c=_0xdd52[_0xf08866];return _0x1d171c;};'use strict';var Sequelize=require(_0x2dd5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x2dd5('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index e1afcaf..ddc4ff6 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 _0xce02=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','save','update','get','Templates','UserProfileResource','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','Template','findAll','catch','show','params','keys','length','includeAll','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash'];(function(_0x1c62fd,_0x43f49a){var _0x10d829=function(_0xa4e7d4){while(--_0xa4e7d4){_0x1c62fd['push'](_0x1c62fd['shift']());}};_0x10d829(++_0x43f49a);}(_0xce02,0x99));var _0x2ce0=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xce02[_0x531d15];return _0x271a18;};'use strict';var emlformat=require(_0x2ce0('0x0'));var rimraf=require(_0x2ce0('0x1'));var zipdir=require(_0x2ce0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ce0('0x3'));var moment=require('moment');var BPromise=require(_0x2ce0('0x4'));var Mustache=require(_0x2ce0('0x5'));var util=require(_0x2ce0('0x6'));var path=require(_0x2ce0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2ce0('0x8'));var fs=require('fs');var fs_extra=require(_0x2ce0('0x9'));var _=require(_0x2ce0('0xa'));var squel=require('squel');var crypto=require(_0x2ce0('0xb'));var jsforce=require(_0x2ce0('0xc'));var deskjs=require(_0x2ce0('0xd'));var toCsv=require(_0x2ce0('0xe'));var querystring=require('querystring');var Papa=require(_0x2ce0('0xf'));var Redis=require(_0x2ce0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2ce0('0x11'));var as=require(_0x2ce0('0x12'));var hardwareService=require(_0x2ce0('0x13'));var logger=require(_0x2ce0('0x14'))(_0x2ce0('0x15'));var utils=require(_0x2ce0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2ce0('0x17'));var db=require(_0x2ce0('0x18'))['db'];function respondWithStatusCode(_0x45560f,_0x362ff4){_0x362ff4=_0x362ff4||0xcc;return function(_0x566ecd){if(_0x566ecd){return _0x45560f[_0x2ce0('0x19')](_0x362ff4);}return _0x45560f[_0x2ce0('0x1a')](_0x362ff4)[_0x2ce0('0x1b')]();};}function respondWithResult(_0x3def63,_0x32d22d){_0x32d22d=_0x32d22d||0xc8;return function(_0x19b5ef){if(_0x19b5ef){return _0x3def63[_0x2ce0('0x1a')](_0x32d22d)[_0x2ce0('0x1c')](_0x19b5ef);}};}function respondWithFilteredResult(_0xab1063,_0x344cb2){return function(_0x458db3){if(_0x458db3){var _0x5eb6c6=typeof _0x344cb2[_0x2ce0('0x1d')]==='undefined'&&typeof _0x344cb2[_0x2ce0('0x1e')]==='undefined';var _0x4c0717=_0x458db3['count'];var _0x4c951b=_0x5eb6c6?0x0:_0x344cb2['offset'];var _0x346df8=_0x5eb6c6?_0x458db3[_0x2ce0('0x1f')]:_0x344cb2[_0x2ce0('0x1d')]+_0x344cb2[_0x2ce0('0x1e')];var _0x55e4f9;if(_0x346df8>=_0x4c0717){_0x346df8=_0x4c0717;_0x55e4f9=0xc8;}else{_0x55e4f9=0xce;}_0xab1063[_0x2ce0('0x1a')](_0x55e4f9);return _0xab1063[_0x2ce0('0x20')]('Content-Range',_0x4c951b+'-'+_0x346df8+'/'+_0x4c0717)[_0x2ce0('0x1c')](_0x458db3);}return null;};}function patchUpdates(_0x4a2102){return function(_0x47ce2e){try{jsonpatch['apply'](_0x47ce2e,_0x4a2102,!![]);}catch(_0x2d7e0e){return BPromise[_0x2ce0('0x21')](_0x2d7e0e);}return _0x47ce2e[_0x2ce0('0x22')]();};}function saveUpdates(_0x4a7278,_0x24db37){return function(_0x448b7c){if(_0x448b7c){return _0x448b7c[_0x2ce0('0x23')](_0x4a7278)['then'](function(_0x15b407){return _0x15b407;});}return null;};}function removeEntity(_0x4c2c09,_0x237a08){return function(_0x8a44a9){if(_0x8a44a9){return _0x8a44a9['destroy']()['then'](function(){var _0x33d953=_0x8a44a9[_0x2ce0('0x24')]({'plain':!![]});var _0x24fa07=_0x2ce0('0x25');return db[_0x2ce0('0x26')]['destroy']({'where':{'type':_0x24fa07,'resourceId':_0x33d953['id']}})[_0x2ce0('0x27')](function(){return _0x8a44a9;});})[_0x2ce0('0x27')](function(){_0x4c2c09['status'](0xcc)[_0x2ce0('0x1b')]();});}};}function handleEntityNotFound(_0x8f4208,_0x44418f){return function(_0x2d44f4){if(!_0x2d44f4){_0x8f4208[_0x2ce0('0x19')](0x194);}return _0x2d44f4;};}function handleError(_0x493154,_0x4496c5){_0x4496c5=_0x4496c5||0x1f4;return function(_0x453ea5){logger['error'](_0x453ea5[_0x2ce0('0x28')]);if(_0x453ea5[_0x2ce0('0x29')]){delete _0x453ea5[_0x2ce0('0x29')];}_0x493154[_0x2ce0('0x1a')](_0x4496c5)[_0x2ce0('0x2a')](_0x453ea5);};}exports[_0x2ce0('0x2b')]=function(_0x195ed1,_0x3fce3b){var _0x2db535={},_0x4b7d5a={},_0x3cbc48={'count':0x0,'rows':[]};var _0x10d75c=_[_0x2ce0('0x2c')](db['Template'][_0x2ce0('0x2d')],function(_0x63971d){return{'name':_0x63971d[_0x2ce0('0x2e')],'type':_0x63971d['type'][_0x2ce0('0x2f')]};});_0x4b7d5a[_0x2ce0('0x30')]=_['map'](_0x10d75c,_0x2ce0('0x29'));_0x4b7d5a[_0x2ce0('0x31')]=_['keys'](_0x195ed1['query']);_0x4b7d5a[_0x2ce0('0x32')]=_['intersection'](_0x4b7d5a[_0x2ce0('0x30')],_0x4b7d5a['query']);_0x2db535[_0x2ce0('0x33')]=_[_0x2ce0('0x34')](_0x4b7d5a[_0x2ce0('0x30')],qs[_0x2ce0('0x35')](_0x195ed1[_0x2ce0('0x31')][_0x2ce0('0x35')]));_0x2db535[_0x2ce0('0x33')]=_0x2db535[_0x2ce0('0x33')]['length']?_0x2db535[_0x2ce0('0x33')]:_0x4b7d5a['model'];if(!_0x195ed1['query'][_0x2ce0('0x36')](_0x2ce0('0x37'))){_0x2db535[_0x2ce0('0x1e')]=qs[_0x2ce0('0x1e')](_0x195ed1[_0x2ce0('0x31')][_0x2ce0('0x1e')]);_0x2db535['offset']=qs['offset'](_0x195ed1[_0x2ce0('0x31')][_0x2ce0('0x1d')]);}_0x2db535[_0x2ce0('0x38')]=qs[_0x2ce0('0x39')](_0x195ed1[_0x2ce0('0x31')][_0x2ce0('0x39')]);_0x2db535['where']=qs['filters'](_[_0x2ce0('0x3a')](_0x195ed1['query'],_0x4b7d5a[_0x2ce0('0x32')]),_0x10d75c);if(_0x195ed1[_0x2ce0('0x31')][_0x2ce0('0x3b')]){_0x2db535[_0x2ce0('0x3c')]=_[_0x2ce0('0x3d')](_0x2db535[_0x2ce0('0x3c')],{'$or':_[_0x2ce0('0x2c')](_0x10d75c,function(_0x4f682b){if(_0x4f682b[_0x2ce0('0x3e')]!=='VIRTUAL'){var _0xd29118={};_0xd29118[_0x4f682b[_0x2ce0('0x29')]]={'$like':'%'+_0x195ed1[_0x2ce0('0x31')][_0x2ce0('0x3b')]+'%'};return _0xd29118;}})});}_0x2db535=_[_0x2ce0('0x3d')]({},_0x2db535,_0x195ed1[_0x2ce0('0x3f')]);var _0x13ccd4={'where':_0x2db535[_0x2ce0('0x3c')]};return db[_0x2ce0('0x40')][_0x2ce0('0x1f')](_0x13ccd4)[_0x2ce0('0x27')](function(_0x3a20c4){_0x3cbc48['count']=_0x3a20c4;if(_0x195ed1[_0x2ce0('0x31')]['includeAll']){_0x2db535['include']=[{'all':!![]}];}return db['Template'][_0x2ce0('0x41')](_0x2db535);})[_0x2ce0('0x27')](function(_0x370296){_0x3cbc48['rows']=_0x370296;return _0x3cbc48;})[_0x2ce0('0x27')](respondWithFilteredResult(_0x3fce3b,_0x2db535))[_0x2ce0('0x42')](handleError(_0x3fce3b,null));};exports[_0x2ce0('0x43')]=function(_0x3b1a64,_0xef4400){var _0x2285bd={'raw':!![],'where':{'id':_0x3b1a64[_0x2ce0('0x44')]['id']}},_0x3ffe86={};_0x3ffe86[_0x2ce0('0x30')]=_[_0x2ce0('0x45')](db[_0x2ce0('0x40')][_0x2ce0('0x2d')]);_0x3ffe86[_0x2ce0('0x31')]=_[_0x2ce0('0x45')](_0x3b1a64[_0x2ce0('0x31')]);_0x3ffe86[_0x2ce0('0x32')]=_[_0x2ce0('0x34')](_0x3ffe86[_0x2ce0('0x30')],_0x3ffe86[_0x2ce0('0x31')]);_0x2285bd[_0x2ce0('0x33')]=_[_0x2ce0('0x34')](_0x3ffe86[_0x2ce0('0x30')],qs[_0x2ce0('0x35')](_0x3b1a64[_0x2ce0('0x31')][_0x2ce0('0x35')]));_0x2285bd['attributes']=_0x2285bd['attributes'][_0x2ce0('0x46')]?_0x2285bd[_0x2ce0('0x33')]:_0x3ffe86['model'];if(_0x3b1a64[_0x2ce0('0x31')][_0x2ce0('0x47')]){_0x2285bd['include']=[{'all':!![]}];}_0x2285bd=_[_0x2ce0('0x3d')]({},_0x2285bd,_0x3b1a64['options']);return db[_0x2ce0('0x40')][_0x2ce0('0x48')](_0x2285bd)['then'](handleEntityNotFound(_0xef4400,null))['then'](respondWithResult(_0xef4400,null))[_0x2ce0('0x42')](handleError(_0xef4400,null));};exports[_0x2ce0('0x49')]=function(_0x4672fd,_0x719c81){return db[_0x2ce0('0x40')]['create'](_0x4672fd['body'],{})[_0x2ce0('0x27')](function(_0x12de2a){var _0x1bd1f7=_0x4672fd[_0x2ce0('0x4a')][_0x2ce0('0x24')]({'plain':!![]});if(!_0x1bd1f7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bd1f7['role']===_0x2ce0('0x4a')){var _0x1e1eb3=_0x12de2a[_0x2ce0('0x24')]({'plain':!![]});var _0x295418='Templates';return db[_0x2ce0('0x4b')][_0x2ce0('0x48')]({'where':{'name':_0x295418,'userProfileId':_0x1bd1f7[_0x2ce0('0x4c')]},'raw':!![]})['then'](function(_0x1181dd){if(_0x1181dd&&_0x1181dd[_0x2ce0('0x4d')]===0x0){return db[_0x2ce0('0x26')]['create']({'name':_0x1e1eb3[_0x2ce0('0x29')],'resourceId':_0x1e1eb3['id'],'type':_0x1181dd[_0x2ce0('0x29')],'sectionId':_0x1181dd['id']},{})[_0x2ce0('0x27')](function(){return _0x12de2a;});}else{return _0x12de2a;}})[_0x2ce0('0x42')](function(_0x26dfc3){logger[_0x2ce0('0x4e')](_0x2ce0('0x4f'),_0x26dfc3);throw _0x26dfc3;});}return _0x12de2a;})['then'](respondWithResult(_0x719c81,0xc9))[_0x2ce0('0x42')](handleError(_0x719c81,null));};exports[_0x2ce0('0x23')]=function(_0xe25205,_0x5845bb){if(_0xe25205[_0x2ce0('0x50')]['id']){delete _0xe25205[_0x2ce0('0x50')]['id'];}return db[_0x2ce0('0x40')][_0x2ce0('0x48')]({'where':{'id':_0xe25205['params']['id']}})['then'](handleEntityNotFound(_0x5845bb,null))[_0x2ce0('0x27')](saveUpdates(_0xe25205['body'],null))[_0x2ce0('0x27')](respondWithResult(_0x5845bb,null))[_0x2ce0('0x42')](handleError(_0x5845bb,null));};exports[_0x2ce0('0x51')]=function(_0x5b6fea,_0x487917){return db[_0x2ce0('0x40')][_0x2ce0('0x48')]({'where':{'id':_0x5b6fea['params']['id']}})[_0x2ce0('0x27')](handleEntityNotFound(_0x487917,null))[_0x2ce0('0x27')](removeEntity(_0x487917,null))[_0x2ce0('0x42')](handleError(_0x487917,null));}; \ No newline at end of file +var _0xab4a=['UserProfileResource','destroy','end','sendStatus','error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','count','set','reject','save','then','Templates'];(function(_0x52aeba,_0xa253fb){var _0x30a265=function(_0x3a9147){while(--_0x3a9147){_0x52aeba['push'](_0x52aeba['shift']());}};_0x30a265(++_0xa253fb);}(_0xab4a,0x182));var _0xaab4=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xab4a[_0xc82d1a];return _0x32fad2;};'use strict';var emlformat=require(_0xaab4('0x0'));var rimraf=require(_0xaab4('0x1'));var zipdir=require(_0xaab4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaab4('0x3'));var moment=require(_0xaab4('0x4'));var BPromise=require(_0xaab4('0x5'));var Mustache=require(_0xaab4('0x6'));var util=require('util');var path=require(_0xaab4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaab4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaab4('0x9'));var squel=require('squel');var crypto=require(_0xaab4('0xa'));var jsforce=require(_0xaab4('0xb'));var deskjs=require(_0xaab4('0xc'));var toCsv=require(_0xaab4('0xd'));var querystring=require('querystring');var Papa=require(_0xaab4('0xe'));var Redis=require(_0xaab4('0xf'));var authService=require(_0xaab4('0x10'));var qs=require(_0xaab4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaab4('0x12'));var logger=require(_0xaab4('0x13'))(_0xaab4('0x14'));var utils=require(_0xaab4('0x15'));var config=require(_0xaab4('0x16'));var licenseUtil=require(_0xaab4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x60e8be,_0x133e83){_0x133e83=_0x133e83||0xcc;return function(_0x44bdc0){if(_0x44bdc0){return _0x60e8be['sendStatus'](_0x133e83);}return _0x60e8be[_0xaab4('0x18')](_0x133e83)['end']();};}function respondWithResult(_0x189f5e,_0x58e9b4){_0x58e9b4=_0x58e9b4||0xc8;return function(_0x122ef1){if(_0x122ef1){return _0x189f5e[_0xaab4('0x18')](_0x58e9b4)[_0xaab4('0x19')](_0x122ef1);}};}function respondWithFilteredResult(_0x5447d9,_0x68cd44){return function(_0x72d77e){if(_0x72d77e){var _0x26d990=typeof _0x68cd44['offset']===_0xaab4('0x1a')&&typeof _0x68cd44[_0xaab4('0x1b')]===_0xaab4('0x1a');var _0x58d191=_0x72d77e[_0xaab4('0x1c')];var _0x5d257c=_0x26d990?0x0:_0x68cd44['offset'];var _0x220af2=_0x26d990?_0x72d77e[_0xaab4('0x1c')]:_0x68cd44['offset']+_0x68cd44[_0xaab4('0x1b')];var _0x5cb4e8;if(_0x220af2>=_0x58d191){_0x220af2=_0x58d191;_0x5cb4e8=0xc8;}else{_0x5cb4e8=0xce;}_0x5447d9['status'](_0x5cb4e8);return _0x5447d9[_0xaab4('0x1d')]('Content-Range',_0x5d257c+'-'+_0x220af2+'/'+_0x58d191)['json'](_0x72d77e);}return null;};}function patchUpdates(_0x23fafd){return function(_0x3d4e1d){try{jsonpatch['apply'](_0x3d4e1d,_0x23fafd,!![]);}catch(_0x934163){return BPromise[_0xaab4('0x1e')](_0x934163);}return _0x3d4e1d[_0xaab4('0x1f')]();};}function saveUpdates(_0x2050df,_0x44862c){return function(_0x2063b3){if(_0x2063b3){return _0x2063b3['update'](_0x2050df)['then'](function(_0x37c7fc){return _0x37c7fc;});}return null;};}function removeEntity(_0x3c4f70,_0x43412a){return function(_0x77e051){if(_0x77e051){return _0x77e051['destroy']()[_0xaab4('0x20')](function(){var _0xe24433=_0x77e051['get']({'plain':!![]});var _0x1371c4=_0xaab4('0x21');return db[_0xaab4('0x22')][_0xaab4('0x23')]({'where':{'type':_0x1371c4,'resourceId':_0xe24433['id']}})[_0xaab4('0x20')](function(){return _0x77e051;});})[_0xaab4('0x20')](function(){_0x3c4f70['status'](0xcc)[_0xaab4('0x24')]();});}};}function handleEntityNotFound(_0x13df93,_0x967d28){return function(_0xc7409e){if(!_0xc7409e){_0x13df93[_0xaab4('0x25')](0x194);}return _0xc7409e;};}function handleError(_0x55ba36,_0x3679c1){_0x3679c1=_0x3679c1||0x1f4;return function(_0x14ebd7){logger[_0xaab4('0x26')](_0x14ebd7[_0xaab4('0x27')]);if(_0x14ebd7[_0xaab4('0x28')]){delete _0x14ebd7['name'];}_0x55ba36[_0xaab4('0x18')](_0x3679c1)['send'](_0x14ebd7);};}exports[_0xaab4('0x29')]=function(_0x7845d0,_0x196bf9){var _0x3491c6={},_0x3c130f={},_0x115e77={'count':0x0,'rows':[]};var _0xac120a=_[_0xaab4('0x2a')](db[_0xaab4('0x2b')][_0xaab4('0x2c')],function(_0x16c60c){return{'name':_0x16c60c[_0xaab4('0x2d')],'type':_0x16c60c[_0xaab4('0x2e')][_0xaab4('0x2f')]};});_0x3c130f['model']=_['map'](_0xac120a,_0xaab4('0x28'));_0x3c130f[_0xaab4('0x30')]=_[_0xaab4('0x31')](_0x7845d0[_0xaab4('0x30')]);_0x3c130f[_0xaab4('0x32')]=_[_0xaab4('0x33')](_0x3c130f[_0xaab4('0x34')],_0x3c130f[_0xaab4('0x30')]);_0x3491c6[_0xaab4('0x35')]=_[_0xaab4('0x33')](_0x3c130f[_0xaab4('0x34')],qs[_0xaab4('0x36')](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x36')]));_0x3491c6['attributes']=_0x3491c6[_0xaab4('0x35')][_0xaab4('0x37')]?_0x3491c6['attributes']:_0x3c130f[_0xaab4('0x34')];if(!_0x7845d0[_0xaab4('0x30')][_0xaab4('0x38')]('nolimit')){_0x3491c6[_0xaab4('0x1b')]=qs[_0xaab4('0x1b')](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x1b')]);_0x3491c6[_0xaab4('0x39')]=qs[_0xaab4('0x39')](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x39')]);}_0x3491c6[_0xaab4('0x3a')]=qs['sort'](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x3b')]);_0x3491c6[_0xaab4('0x3c')]=qs[_0xaab4('0x32')](_[_0xaab4('0x3d')](_0x7845d0[_0xaab4('0x30')],_0x3c130f[_0xaab4('0x32')]),_0xac120a);if(_0x7845d0[_0xaab4('0x30')][_0xaab4('0x3e')]){_0x3491c6[_0xaab4('0x3c')]=_[_0xaab4('0x3f')](_0x3491c6['where'],{'$or':_[_0xaab4('0x2a')](_0xac120a,function(_0x57231a){if(_0x57231a[_0xaab4('0x2e')]!==_0xaab4('0x40')){var _0x4c13a3={};_0x4c13a3[_0x57231a[_0xaab4('0x28')]]={'$like':'%'+_0x7845d0[_0xaab4('0x30')][_0xaab4('0x3e')]+'%'};return _0x4c13a3;}})});}_0x3491c6=_[_0xaab4('0x3f')]({},_0x3491c6,_0x7845d0[_0xaab4('0x41')]);var _0x2879fc={'where':_0x3491c6[_0xaab4('0x3c')]};return db[_0xaab4('0x2b')][_0xaab4('0x1c')](_0x2879fc)[_0xaab4('0x20')](function(_0x42e098){_0x115e77[_0xaab4('0x1c')]=_0x42e098;if(_0x7845d0['query'][_0xaab4('0x42')]){_0x3491c6['include']=[{'all':!![]}];}return db[_0xaab4('0x2b')][_0xaab4('0x43')](_0x3491c6);})[_0xaab4('0x20')](function(_0x576aea){_0x115e77[_0xaab4('0x44')]=_0x576aea;return _0x115e77;})['then'](respondWithFilteredResult(_0x196bf9,_0x3491c6))['catch'](handleError(_0x196bf9,null));};exports['show']=function(_0x4ab2e4,_0x468bbc){var _0x1b2ac6={'raw':!![],'where':{'id':_0x4ab2e4[_0xaab4('0x45')]['id']}},_0x1d2bf8={};_0x1d2bf8[_0xaab4('0x34')]=_[_0xaab4('0x31')](db[_0xaab4('0x2b')][_0xaab4('0x2c')]);_0x1d2bf8['query']=_[_0xaab4('0x31')](_0x4ab2e4[_0xaab4('0x30')]);_0x1d2bf8[_0xaab4('0x32')]=_[_0xaab4('0x33')](_0x1d2bf8[_0xaab4('0x34')],_0x1d2bf8[_0xaab4('0x30')]);_0x1b2ac6[_0xaab4('0x35')]=_[_0xaab4('0x33')](_0x1d2bf8[_0xaab4('0x34')],qs[_0xaab4('0x36')](_0x4ab2e4[_0xaab4('0x30')][_0xaab4('0x36')]));_0x1b2ac6[_0xaab4('0x35')]=_0x1b2ac6[_0xaab4('0x35')][_0xaab4('0x37')]?_0x1b2ac6['attributes']:_0x1d2bf8[_0xaab4('0x34')];if(_0x4ab2e4['query'][_0xaab4('0x42')]){_0x1b2ac6[_0xaab4('0x46')]=[{'all':!![]}];}_0x1b2ac6=_[_0xaab4('0x3f')]({},_0x1b2ac6,_0x4ab2e4['options']);return db['Template'][_0xaab4('0x47')](_0x1b2ac6)[_0xaab4('0x20')](handleEntityNotFound(_0x468bbc,null))[_0xaab4('0x20')](respondWithResult(_0x468bbc,null))[_0xaab4('0x48')](handleError(_0x468bbc,null));};exports[_0xaab4('0x49')]=function(_0x489032,_0x3e20ee){return db['Template']['create'](_0x489032['body'],{})[_0xaab4('0x20')](function(_0x38f54d){var _0x1cfb71=_0x489032[_0xaab4('0x4a')]['get']({'plain':!![]});if(!_0x1cfb71)throw new Error(_0xaab4('0x4b'));if(_0x1cfb71[_0xaab4('0x4c')]===_0xaab4('0x4a')){var _0x5ebf8e=_0x38f54d[_0xaab4('0x4d')]({'plain':!![]});var _0x340025='Templates';return db[_0xaab4('0x4e')][_0xaab4('0x47')]({'where':{'name':_0x340025,'userProfileId':_0x1cfb71[_0xaab4('0x4f')]},'raw':!![]})['then'](function(_0x251225){if(_0x251225&&_0x251225[_0xaab4('0x50')]===0x0){return db[_0xaab4('0x22')][_0xaab4('0x49')]({'name':_0x5ebf8e[_0xaab4('0x28')],'resourceId':_0x5ebf8e['id'],'type':_0x251225[_0xaab4('0x28')],'sectionId':_0x251225['id']},{})[_0xaab4('0x20')](function(){return _0x38f54d;});}else{return _0x38f54d;}})['catch'](function(_0x451820){logger[_0xaab4('0x26')](_0xaab4('0x51'),_0x451820);throw _0x451820;});}return _0x38f54d;})[_0xaab4('0x20')](respondWithResult(_0x3e20ee,0xc9))[_0xaab4('0x48')](handleError(_0x3e20ee,null));};exports[_0xaab4('0x52')]=function(_0x593ed6,_0x3e8b78){if(_0x593ed6[_0xaab4('0x53')]['id']){delete _0x593ed6[_0xaab4('0x53')]['id'];}return db[_0xaab4('0x2b')][_0xaab4('0x47')]({'where':{'id':_0x593ed6[_0xaab4('0x45')]['id']}})[_0xaab4('0x20')](handleEntityNotFound(_0x3e8b78,null))[_0xaab4('0x20')](saveUpdates(_0x593ed6['body'],null))[_0xaab4('0x20')](respondWithResult(_0x3e8b78,null))[_0xaab4('0x48')](handleError(_0x3e8b78,null));};exports[_0xaab4('0x23')]=function(_0x2b4e49,_0x273730){return db[_0xaab4('0x2b')][_0xaab4('0x47')]({'where':{'id':_0x2b4e49[_0xaab4('0x45')]['id']}})[_0xaab4('0x20')](handleEntityNotFound(_0x273730,null))['then'](removeEntity(_0x273730,null))[_0xaab4('0x48')](handleError(_0x273730,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index a0feaf8..e29c417 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 _0x5f74=['../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x10efd8,_0x53899e){var _0x2a7897=function(_0x11674c){while(--_0x11674c){_0x10efd8['push'](_0x10efd8['shift']());}};_0x2a7897(++_0x53899e);}(_0x5f74,0x139));var _0x45f7=function(_0xb883b,_0x54e9f2){_0xb883b=_0xb883b-0x0;var _0x4ccec=_0x5f74[_0xb883b];return _0x4ccec;};'use strict';var _=require(_0x45f7('0x0'));var util=require(_0x45f7('0x1'));var logger=require(_0x45f7('0x2'))(_0x45f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x45f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45f7('0x5'));var config=require(_0x45f7('0x6'));var attributes=require(_0x45f7('0x7'));module[_0x45f7('0x8')]=function(_0x6550f4,_0xfa0346){return _0x6550f4['define'](_0x45f7('0x9'),attributes,{'tableName':_0x45f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47d3=['path','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x47d3,0x1b4));var _0x347d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47d3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x347d('0x0'));var util=require('util');var logger=require(_0x347d('0x1'))(_0x347d('0x2'));var moment=require(_0x347d('0x3'));var BPromise=require(_0x347d('0x4'));var rp=require(_0x347d('0x5'));var fs=require('fs');var path=require(_0x347d('0x6'));var rimraf=require(_0x347d('0x7'));var config=require('../../config/environment');var attributes=require(_0x347d('0x8'));module[_0x347d('0x9')]=function(_0x2f0d40,_0x509899){return _0x2f0d40[_0x347d('0xa')](_0x347d('0xb'),attributes,{'tableName':_0x347d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 029b204..8741e6e 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 _0x8c97=['client','request','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x386f83,_0xedf9a0){var _0x1ae994=function(_0x153f80){while(--_0x153f80){_0x386f83['push'](_0x386f83['shift']());}};_0x1ae994(++_0xedf9a0);}(_0x8c97,0x7a));var _0x78c9=function(_0x264bf4,_0x465b4d){_0x264bf4=_0x264bf4-0x0;var _0xae40e5=_0x8c97[_0x264bf4];return _0xae40e5;};'use strict';var _=require(_0x78c9('0x0'));var util=require(_0x78c9('0x1'));var moment=require(_0x78c9('0x2'));var BPromise=require(_0x78c9('0x3'));var rs=require(_0x78c9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78c9('0x5'))['db'];var utils=require(_0x78c9('0x6'));var logger=require(_0x78c9('0x7'))('rpc');var config=require(_0x78c9('0x8'));var jayson=require(_0x78c9('0x9'));var client=jayson[_0x78c9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b6131,_0x35eef1,_0x35c1f0){return new BPromise(function(_0x100471,_0x28fdf4){return client[_0x78c9('0xb')](_0x2b6131,_0x35c1f0)['then'](function(_0x38a130){logger[_0x78c9('0xc')]('Template,\x20%s,\x20%s',_0x35eef1,_0x78c9('0xd'));logger[_0x78c9('0xe')](_0x78c9('0xf'),_0x35eef1,'request\x20sent',JSON[_0x78c9('0x10')](_0x38a130));if(_0x38a130[_0x78c9('0x11')]){if(_0x38a130['error'][_0x78c9('0x12')]===0x1f4){logger['error'](_0x78c9('0x13'),_0x35eef1,_0x38a130[_0x78c9('0x11')][_0x78c9('0x14')]);return _0x28fdf4(_0x38a130[_0x78c9('0x11')][_0x78c9('0x14')]);}logger[_0x78c9('0x11')](_0x78c9('0x13'),_0x35eef1,_0x38a130[_0x78c9('0x11')][_0x78c9('0x14')]);return _0x100471(_0x38a130['error'][_0x78c9('0x14')]);}else{logger[_0x78c9('0xc')](_0x78c9('0x13'),_0x35eef1,_0x78c9('0xd'));_0x100471(_0x38a130[_0x78c9('0x15')][_0x78c9('0x14')]);}})[_0x78c9('0x16')](function(_0x3fba31){logger[_0x78c9('0x11')](_0x78c9('0x13'),_0x35eef1,_0x3fba31);_0x28fdf4(_0x3fba31);});});}exports[_0x78c9('0x17')]=function(_0x1544a7){var _0x34145d=this;return new Promise(function(_0x462432,_0x23a95a){return db[_0x78c9('0x18')][_0x78c9('0x19')]({'raw':_0x1544a7[_0x78c9('0x1a')]?_0x1544a7[_0x78c9('0x1a')][_0x78c9('0x1b')]===undefined?!![]:![]:!![],'where':_0x1544a7[_0x78c9('0x1a')]?_0x1544a7[_0x78c9('0x1a')][_0x78c9('0x1c')]||null:null,'attributes':_0x1544a7[_0x78c9('0x1a')]?_0x1544a7[_0x78c9('0x1a')][_0x78c9('0x1d')]||null:null,'limit':_0x1544a7[_0x78c9('0x1a')]?_0x1544a7[_0x78c9('0x1a')]['limit']||null:null,'include':_0x1544a7[_0x78c9('0x1a')]?_0x1544a7[_0x78c9('0x1a')]['include']?_['map'](_0x1544a7[_0x78c9('0x1a')][_0x78c9('0x1e')],function(_0x4c1020){return{'model':db[_0x4c1020[_0x78c9('0x1f')]],'as':_0x4c1020['as'],'attributes':_0x4c1020[_0x78c9('0x1d')],'include':_0x4c1020[_0x78c9('0x1e')]?_[_0x78c9('0x20')](_0x4c1020[_0x78c9('0x1e')],function(_0x29ea9b){return{'model':db[_0x29ea9b[_0x78c9('0x1f')]],'as':_0x29ea9b['as'],'attributes':_0x29ea9b[_0x78c9('0x1d')],'include':_0x29ea9b['include']?_[_0x78c9('0x20')](_0x29ea9b[_0x78c9('0x1e')],function(_0x3bdff8){return{'model':db[_0x3bdff8[_0x78c9('0x1f')]],'as':_0x3bdff8['as'],'attributes':_0x3bdff8[_0x78c9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37cc47){logger['info']('GetTemplate',_0x1544a7);logger[_0x78c9('0xe')](_0x78c9('0x17'),_0x1544a7,JSON['stringify'](_0x37cc47));_0x462432(_0x37cc47);})[_0x78c9('0x16')](function(_0x58e234){logger[_0x78c9('0x11')](_0x78c9('0x17'),_0x58e234[_0x78c9('0x14')],_0x1544a7);_0x23a95a(_0x34145d[_0x78c9('0x11')](0x1f4,_0x58e234[_0x78c9('0x14')]));});});}; \ No newline at end of file +var _0x21f8=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','attributes','limit','map','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0x21f8,0x71));var _0x821f=function(_0x44c974,_0x1bcfde){_0x44c974=_0x44c974-0x0;var _0x5214c6=_0x21f8[_0x44c974];return _0x5214c6;};'use strict';var _=require(_0x821f('0x0'));var util=require(_0x821f('0x1'));var moment=require(_0x821f('0x2'));var BPromise=require(_0x821f('0x3'));var rs=require(_0x821f('0x4'));var fs=require('fs');var Redis=require(_0x821f('0x5'));var db=require(_0x821f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x821f('0x7'));var jayson=require(_0x821f('0x8'));var client=jayson[_0x821f('0x9')][_0x821f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cd13a,_0x3a42fe,_0x1b9945){return new BPromise(function(_0xfcb0a,_0x4e260d){return client['request'](_0x3cd13a,_0x1b9945)[_0x821f('0xb')](function(_0x15b547){logger[_0x821f('0xc')]('Template,\x20%s,\x20%s',_0x3a42fe,_0x821f('0xd'));logger[_0x821f('0xe')](_0x821f('0xf'),_0x3a42fe,_0x821f('0xd'),JSON[_0x821f('0x10')](_0x15b547));if(_0x15b547[_0x821f('0x11')]){if(_0x15b547[_0x821f('0x11')][_0x821f('0x12')]===0x1f4){logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x15b547['error']['message']);return _0x4e260d(_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);}logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);return _0xfcb0a(_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);}else{logger[_0x821f('0xc')](_0x821f('0x13'),_0x3a42fe,'request\x20sent');_0xfcb0a(_0x15b547[_0x821f('0x15')]['message']);}})[_0x821f('0x16')](function(_0x497c37){logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x497c37);_0x4e260d(_0x497c37);});});}exports[_0x821f('0x17')]=function(_0x27c41c){var _0x5e8c54=this;return new Promise(function(_0x1c015a,_0x34d89c){return db['Template'][_0x821f('0x18')]({'raw':_0x27c41c['options']?_0x27c41c[_0x821f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x27c41c[_0x821f('0x19')]?_0x27c41c[_0x821f('0x19')]['where']||null:null,'attributes':_0x27c41c['options']?_0x27c41c[_0x821f('0x19')][_0x821f('0x1a')]||null:null,'limit':_0x27c41c[_0x821f('0x19')]?_0x27c41c['options'][_0x821f('0x1b')]||null:null,'include':_0x27c41c[_0x821f('0x19')]?_0x27c41c[_0x821f('0x19')]['include']?_[_0x821f('0x1c')](_0x27c41c[_0x821f('0x19')]['include'],function(_0x4ef246){return{'model':db[_0x4ef246['model']],'as':_0x4ef246['as'],'attributes':_0x4ef246['attributes'],'include':_0x4ef246[_0x821f('0x1d')]?_['map'](_0x4ef246['include'],function(_0x21c1d9){return{'model':db[_0x21c1d9['model']],'as':_0x21c1d9['as'],'attributes':_0x21c1d9['attributes'],'include':_0x21c1d9[_0x821f('0x1d')]?_[_0x821f('0x1c')](_0x21c1d9[_0x821f('0x1d')],function(_0x368a74){return{'model':db[_0x368a74['model']],'as':_0x368a74['as'],'attributes':_0x368a74[_0x821f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x821f('0xb')](function(_0x183535){logger[_0x821f('0xc')]('GetTemplate',_0x27c41c);logger[_0x821f('0xe')](_0x821f('0x17'),_0x27c41c,JSON[_0x821f('0x10')](_0x183535));_0x1c015a(_0x183535);})[_0x821f('0x16')](function(_0x53d87e){logger[_0x821f('0x11')]('GetTemplate',_0x53d87e['message'],_0x27c41c);_0x34d89c(_0x5e8c54[_0x821f('0x11')](0x1f4,_0x53d87e[_0x821f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 116fd49..0f89553 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 _0x595d=['get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller'];(function(_0x21294f,_0x1e03a5){var _0x32de9b=function(_0x5be1c2){while(--_0x5be1c2){_0x21294f['push'](_0x21294f['shift']());}};_0x32de9b(++_0x1e03a5);}(_0x595d,0x1ef));var _0xd595=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x595d[_0x421cf8];return _0x145c48;};'use strict';var multer=require('multer');var util=require(_0xd595('0x0'));var path=require(_0xd595('0x1'));var timeout=require(_0xd595('0x2'));var express=require(_0xd595('0x3'));var router=express['Router']();var fs_extra=require(_0xd595('0x4'));var auth=require(_0xd595('0x5'));var interaction=require(_0xd595('0x6'));var config=require(_0xd595('0x7'));var controller=require(_0xd595('0x8'));router[_0xd595('0x9')]('/',auth[_0xd595('0xa')](),controller[_0xd595('0xb')]);router[_0xd595('0x9')](_0xd595('0xc'),auth[_0xd595('0xa')](),controller[_0xd595('0xd')]);router[_0xd595('0x9')](_0xd595('0xe'),auth[_0xd595('0xa')](),controller['getAllConditions']);router[_0xd595('0x9')](_0xd595('0xf'),auth[_0xd595('0xa')](),controller[_0xd595('0x10')]);router[_0xd595('0x9')](_0xd595('0x11'),auth[_0xd595('0xa')](),controller[_0xd595('0x12')]);router[_0xd595('0x13')]('/',auth['isAuthenticated'](),controller[_0xd595('0x14')]);router[_0xd595('0x13')](_0xd595('0xe'),auth[_0xd595('0xa')](),controller['addAllCondition']);router[_0xd595('0x13')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xd595('0x15')]);router[_0xd595('0x13')](_0xd595('0x11'),auth[_0xd595('0xa')](),controller[_0xd595('0x16')]);router[_0xd595('0x17')]('/:id',auth[_0xd595('0xa')](),controller[_0xd595('0x18')]);router[_0xd595('0x19')](_0xd595('0xc'),auth[_0xd595('0xa')](),controller[_0xd595('0x1a')]);module[_0xd595('0x1b')]=router; \ No newline at end of file +var _0x6245=['fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x5bb8e0,_0x3f4030){var _0x254f79=function(_0x198e95){while(--_0x198e95){_0x5bb8e0['push'](_0x5bb8e0['shift']());}};_0x254f79(++_0x3f4030);}(_0x6245,0xe5));var _0x5624=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x6245[_0x52085a];return _0x5afc1a;};'use strict';var multer=require(_0x5624('0x0'));var util=require(_0x5624('0x1'));var path=require(_0x5624('0x2'));var timeout=require(_0x5624('0x3'));var express=require('express');var router=express[_0x5624('0x4')]();var fs_extra=require(_0x5624('0x5'));var auth=require(_0x5624('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5624('0x7'));var controller=require(_0x5624('0x8'));router['get']('/',auth[_0x5624('0x9')](),controller[_0x5624('0xa')]);router[_0x5624('0xb')](_0x5624('0xc'),auth[_0x5624('0x9')](),controller[_0x5624('0xd')]);router[_0x5624('0xb')](_0x5624('0xe'),auth[_0x5624('0x9')](),controller['getAllConditions']);router[_0x5624('0xb')](_0x5624('0xf'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x5624('0xb')](_0x5624('0x10'),auth['isAuthenticated'](),controller[_0x5624('0x11')]);router[_0x5624('0x12')]('/',auth[_0x5624('0x9')](),controller['create']);router['post'](_0x5624('0xe'),auth[_0x5624('0x9')](),controller[_0x5624('0x13')]);router['post'](_0x5624('0xf'),auth[_0x5624('0x9')](),controller['addAnyCondition']);router['post'](_0x5624('0x10'),auth[_0x5624('0x9')](),controller[_0x5624('0x14')]);router[_0x5624('0x15')](_0x5624('0xc'),auth['isAuthenticated'](),controller[_0x5624('0x16')]);router[_0x5624('0x17')](_0x5624('0xc'),auth[_0x5624('0x9')](),controller[_0x5624('0x18')]);module[_0x5624('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index cc9f275..b5fcf1b 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 _0x8fc1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x8fc1,0x193));var _0x18fc=function(_0x5e58c5,_0x4a9762){_0x5e58c5=_0x5e58c5-0x0;var _0x259a0a=_0x8fc1[_0x5e58c5];return _0x259a0a;};'use strict';var Sequelize=require(_0x18fc('0x0'));module[_0x18fc('0x1')]={'name':{'type':Sequelize[_0x18fc('0x2')]},'channel':{'type':Sequelize[_0x18fc('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x18fc('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe107=['sequelize','exports','STRING','BOOLEAN'];(function(_0x929c7e,_0x38c4cc){var _0x5de099=function(_0xc4e8d8){while(--_0xc4e8d8){_0x929c7e['push'](_0x929c7e['shift']());}};_0x5de099(++_0x38c4cc);}(_0xe107,0x1d0));var _0x7e10=function(_0x489bd2,_0x5b9f55){_0x489bd2=_0x489bd2-0x0;var _0x280eec=_0xe107[_0x489bd2];return _0x280eec;};'use strict';var Sequelize=require(_0x7e10('0x0'));module[_0x7e10('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7e10('0x2')]},'description':{'type':Sequelize[_0x7e10('0x2')]},'status':{'type':Sequelize[_0x7e10('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 d877f1c..d4698ca 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 _0x4394=['addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','length','pick','filter','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','destroy','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','include','findAll','rows','catch','params','rawAttributes','intersection','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0xf6fe87,_0x362081){var _0x312bdd=function(_0x22cf01){while(--_0x22cf01){_0xf6fe87['push'](_0xf6fe87['shift']());}};_0x312bdd(++_0x362081);}(_0x4394,0xcd));var _0x4439=function(_0x2c944e,_0x26f659){_0x2c944e=_0x2c944e-0x0;var _0x2cc529=_0x4394[_0x2c944e];return _0x2cc529;};'use strict';var emlformat=require(_0x4439('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4439('0x1'));var jsonpatch=require(_0x4439('0x2'));var rp=require(_0x4439('0x3'));var moment=require('moment');var BPromise=require(_0x4439('0x4'));var Mustache=require(_0x4439('0x5'));var util=require(_0x4439('0x6'));var path=require(_0x4439('0x7'));var sox=require(_0x4439('0x8'));var csv=require(_0x4439('0x9'));var ejs=require(_0x4439('0xa'));var fs=require('fs');var fs_extra=require(_0x4439('0xb'));var _=require(_0x4439('0xc'));var squel=require(_0x4439('0xd'));var crypto=require('crypto');var jsforce=require(_0x4439('0xe'));var deskjs=require(_0x4439('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4439('0x10'));var Papa=require(_0x4439('0x11'));var Redis=require(_0x4439('0x12'));var authService=require(_0x4439('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4439('0x14'));var hardwareService=require(_0x4439('0x15'));var logger=require(_0x4439('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4439('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4439('0x18'))['db'];function respondWithStatusCode(_0x3ac5e0,_0x33613a){_0x33613a=_0x33613a||0xcc;return function(_0x40f74c){if(_0x40f74c){return _0x3ac5e0[_0x4439('0x19')](_0x33613a);}return _0x3ac5e0[_0x4439('0x1a')](_0x33613a)[_0x4439('0x1b')]();};}function respondWithResult(_0x413ff6,_0x46db06){_0x46db06=_0x46db06||0xc8;return function(_0x51b254){if(_0x51b254){return _0x413ff6[_0x4439('0x1a')](_0x46db06)['json'](_0x51b254);}};}function respondWithFilteredResult(_0x423cc2,_0x2b4f48){return function(_0x37e0f8){if(_0x37e0f8){var _0x47ee2a=typeof _0x2b4f48[_0x4439('0x1c')]===_0x4439('0x1d')&&typeof _0x2b4f48[_0x4439('0x1e')]===_0x4439('0x1d');var _0x27b0d1=_0x37e0f8['count'];var _0x153a8c=_0x47ee2a?0x0:_0x2b4f48[_0x4439('0x1c')];var _0x553881=_0x47ee2a?_0x37e0f8[_0x4439('0x1f')]:_0x2b4f48['offset']+_0x2b4f48[_0x4439('0x1e')];var _0xfdf57e;if(_0x553881>=_0x27b0d1){_0x553881=_0x27b0d1;_0xfdf57e=0xc8;}else{_0xfdf57e=0xce;}_0x423cc2['status'](_0xfdf57e);return _0x423cc2[_0x4439('0x20')]('Content-Range',_0x153a8c+'-'+_0x553881+'/'+_0x27b0d1)[_0x4439('0x21')](_0x37e0f8);}return null;};}function patchUpdates(_0xa26ee1){return function(_0x107faa){try{jsonpatch['apply'](_0x107faa,_0xa26ee1,!![]);}catch(_0x39426a){return BPromise[_0x4439('0x22')](_0x39426a);}return _0x107faa['save']();};}function saveUpdates(_0x2f194a,_0x527ddb){return function(_0x2a3a2b){if(_0x2a3a2b){return _0x2a3a2b[_0x4439('0x23')](_0x2f194a)[_0x4439('0x24')](function(_0x1c4772){return _0x1c4772;});}return null;};}function removeEntity(_0x1503d0,_0x48c0a7){return function(_0x734222){if(_0x734222){return _0x734222[_0x4439('0x25')]()[_0x4439('0x24')](function(){var _0xb434d4=_0x734222['get']({'plain':!![]});var _0x1391aa=_0x4439('0x26');return db[_0x4439('0x27')][_0x4439('0x25')]({'where':{'type':_0x1391aa,'resourceId':_0xb434d4['id']}})[_0x4439('0x24')](function(){return _0x734222;});})[_0x4439('0x24')](function(){_0x1503d0[_0x4439('0x1a')](0xcc)[_0x4439('0x1b')]();});}};}function handleEntityNotFound(_0x4c86e3,_0x3b3ee){return function(_0x5ba7c0){if(!_0x5ba7c0){_0x4c86e3['sendStatus'](0x194);}return _0x5ba7c0;};}function handleError(_0x42f7bc,_0x44a30b){_0x44a30b=_0x44a30b||0x1f4;return function(_0x19431a){logger[_0x4439('0x28')](_0x19431a[_0x4439('0x29')]);if(_0x19431a[_0x4439('0x2a')]){delete _0x19431a[_0x4439('0x2a')];}_0x42f7bc[_0x4439('0x1a')](_0x44a30b)[_0x4439('0x2b')](_0x19431a);};}exports[_0x4439('0x2c')]=function(_0x4a8cee,_0x9e0fa4){var _0x2af87f={},_0xe420cd={},_0x14bad5={'count':0x0,'rows':[]};var _0x5826f5=_[_0x4439('0x2d')](db[_0x4439('0x2e')]['rawAttributes'],function(_0x101965){return{'name':_0x101965['fieldName'],'type':_0x101965[_0x4439('0x2f')][_0x4439('0x30')]};});_0xe420cd[_0x4439('0x31')]=_[_0x4439('0x2d')](_0x5826f5,'name');_0xe420cd[_0x4439('0x32')]=_[_0x4439('0x33')](_0x4a8cee[_0x4439('0x32')]);_0xe420cd[_0x4439('0x34')]=_['intersection'](_0xe420cd['model'],_0xe420cd[_0x4439('0x32')]);_0x2af87f[_0x4439('0x35')]=_['intersection'](_0xe420cd[_0x4439('0x31')],qs[_0x4439('0x36')](_0x4a8cee['query'][_0x4439('0x36')]));_0x2af87f[_0x4439('0x35')]=_0x2af87f[_0x4439('0x35')]['length']?_0x2af87f[_0x4439('0x35')]:_0xe420cd[_0x4439('0x31')];if(!_0x4a8cee[_0x4439('0x32')][_0x4439('0x37')](_0x4439('0x38'))){_0x2af87f[_0x4439('0x1e')]=qs[_0x4439('0x1e')](_0x4a8cee[_0x4439('0x32')][_0x4439('0x1e')]);_0x2af87f[_0x4439('0x1c')]=qs['offset'](_0x4a8cee[_0x4439('0x32')]['offset']);}_0x2af87f[_0x4439('0x39')]=qs[_0x4439('0x3a')](_0x4a8cee[_0x4439('0x32')][_0x4439('0x3a')]);_0x2af87f[_0x4439('0x3b')]=qs[_0x4439('0x34')](_['pick'](_0x4a8cee[_0x4439('0x32')],_0xe420cd['filters']),_0x5826f5);if(_0x4a8cee[_0x4439('0x32')]['filter']){_0x2af87f[_0x4439('0x3b')]=_[_0x4439('0x3c')](_0x2af87f[_0x4439('0x3b')],{'$or':_['map'](_0x5826f5,function(_0x4e1448){if(_0x4e1448[_0x4439('0x2f')]!=='VIRTUAL'){var _0x36b947={};_0x36b947[_0x4e1448[_0x4439('0x2a')]]={'$like':'%'+_0x4a8cee[_0x4439('0x32')]['filter']+'%'};return _0x36b947;}})});}_0x2af87f=_[_0x4439('0x3c')]({},_0x2af87f,_0x4a8cee['options']);var _0x272508={'where':_0x2af87f[_0x4439('0x3b')]};return db[_0x4439('0x2e')]['count'](_0x272508)[_0x4439('0x24')](function(_0x1b8fba){_0x14bad5[_0x4439('0x1f')]=_0x1b8fba;if(_0x4a8cee[_0x4439('0x32')]['includeAll']){_0x2af87f[_0x4439('0x3d')]=[{'all':!![]}];}return db[_0x4439('0x2e')][_0x4439('0x3e')](_0x2af87f);})['then'](function(_0x4f908b){_0x14bad5[_0x4439('0x3f')]=_0x4f908b;return _0x14bad5;})[_0x4439('0x24')](respondWithFilteredResult(_0x9e0fa4,_0x2af87f))[_0x4439('0x40')](handleError(_0x9e0fa4,null));};exports['show']=function(_0x139a7b,_0x589ad3){var _0x1c0865={'raw':![],'where':{'id':_0x139a7b[_0x4439('0x41')]['id']}},_0x5d8fab={};_0x5d8fab['model']=_['keys'](db['Trigger'][_0x4439('0x42')]);_0x5d8fab[_0x4439('0x32')]=_[_0x4439('0x33')](_0x139a7b['query']);_0x5d8fab[_0x4439('0x34')]=_['intersection'](_0x5d8fab['model'],_0x5d8fab[_0x4439('0x32')]);_0x1c0865['attributes']=_[_0x4439('0x43')](_0x5d8fab[_0x4439('0x31')],qs[_0x4439('0x36')](_0x139a7b['query'][_0x4439('0x36')]));_0x1c0865[_0x4439('0x35')]=_0x1c0865[_0x4439('0x35')]['length']?_0x1c0865[_0x4439('0x35')]:_0x5d8fab[_0x4439('0x31')];if(_0x139a7b[_0x4439('0x32')][_0x4439('0x44')]){_0x1c0865['include']=[{'all':!![]}];}_0x1c0865=_[_0x4439('0x3c')]({},_0x1c0865,_0x139a7b[_0x4439('0x45')]);return db[_0x4439('0x2e')][_0x4439('0x46')](_0x1c0865)[_0x4439('0x24')](handleEntityNotFound(_0x589ad3,null))['then'](respondWithResult(_0x589ad3,null))['catch'](handleError(_0x589ad3,null));};exports['create']=function(_0x56200f,_0x2c4706){return db[_0x4439('0x2e')][_0x4439('0x47')](_0x56200f['body'],{})[_0x4439('0x24')](function(_0x4d17a5){var _0x4e13a8=_0x56200f[_0x4439('0x48')][_0x4439('0x49')]({'plain':!![]});if(!_0x4e13a8)throw new Error(_0x4439('0x4a'));if(_0x4e13a8[_0x4439('0x4b')]===_0x4439('0x48')){var _0x5d2658=_0x4d17a5['get']({'plain':!![]});var _0x43fe8d=_0x4439('0x26');return db[_0x4439('0x4c')][_0x4439('0x46')]({'where':{'name':_0x43fe8d,'userProfileId':_0x4e13a8['userProfileId']},'raw':!![]})['then'](function(_0x34ae7d){if(_0x34ae7d&&_0x34ae7d[_0x4439('0x4d')]===0x0){return db[_0x4439('0x27')][_0x4439('0x47')]({'name':_0x5d2658[_0x4439('0x2a')],'resourceId':_0x5d2658['id'],'type':_0x34ae7d['name'],'sectionId':_0x34ae7d['id']},{})[_0x4439('0x24')](function(){return _0x4d17a5;});}else{return _0x4d17a5;}})['catch'](function(_0x460b9d){logger[_0x4439('0x28')](_0x4439('0x4e'),_0x460b9d);throw _0x460b9d;});}return _0x4d17a5;})[_0x4439('0x24')](respondWithResult(_0x2c4706,0xc9))[_0x4439('0x40')](handleError(_0x2c4706,null));};exports[_0x4439('0x23')]=function(_0x1cb221,_0x3f6c19){if(_0x1cb221['body']['id']){delete _0x1cb221[_0x4439('0x4f')]['id'];}return db['Trigger'][_0x4439('0x46')]({'where':{'id':_0x1cb221[_0x4439('0x41')]['id']}})[_0x4439('0x24')](handleEntityNotFound(_0x3f6c19,null))[_0x4439('0x24')](saveUpdates(_0x1cb221[_0x4439('0x4f')],null))[_0x4439('0x24')](respondWithResult(_0x3f6c19,null))['catch'](handleError(_0x3f6c19,null));};exports['destroy']=function(_0x3db155,_0x5c1942){return db[_0x4439('0x2e')][_0x4439('0x46')]({'where':{'id':_0x3db155[_0x4439('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c1942,null))[_0x4439('0x24')](removeEntity(_0x5c1942,null))['catch'](handleError(_0x5c1942,null));};exports[_0x4439('0x50')]=function(_0x4343f7,_0x5829d0,_0x291ca4){if(_0x4343f7['body']['id']){delete _0x4343f7[_0x4439('0x4f')]['id'];}return db[_0x4439('0x2e')][_0x4439('0x46')]({'where':{'id':_0x4343f7['params']['id']}})['then'](handleEntityNotFound(_0x5829d0,null))['then'](function(_0x2f5549){if(_0x2f5549){_0x4343f7[_0x4439('0x4f')][_0x4439('0x51')]=_0x2f5549['id'];return db[_0x4439('0x52')]['create'](_0x4343f7[_0x4439('0x4f')]);}})['then'](respondWithResult(_0x5829d0,null))[_0x4439('0x40')](handleError(_0x5829d0,null));};exports[_0x4439('0x53')]=function(_0x16876f,_0x2c20d4,_0x5ab339){if(_0x16876f[_0x4439('0x4f')]['id']){delete _0x16876f[_0x4439('0x4f')]['id'];}return db[_0x4439('0x2e')]['find']({'where':{'id':_0x16876f[_0x4439('0x41')]['id']}})[_0x4439('0x24')](handleEntityNotFound(_0x2c20d4,null))['then'](function(_0xbac4ea){if(_0xbac4ea){_0x16876f['body'][_0x4439('0x54')]=_0xbac4ea['id'];return db[_0x4439('0x52')][_0x4439('0x47')](_0x16876f[_0x4439('0x4f')]);}})['then'](respondWithResult(_0x2c20d4,null))[_0x4439('0x40')](handleError(_0x2c20d4,null));};exports[_0x4439('0x55')]=function(_0x6d2d33,_0x15457c,_0x38fd48){var _0x103d6b={};var _0x1c5d6e={};var _0x2dc6f8;var _0x4b6c0b;return db['Trigger']['findOne']({'where':{'id':_0x6d2d33['params']['id']}})[_0x4439('0x24')](handleEntityNotFound(_0x15457c,null))[_0x4439('0x24')](function(_0x2d16ca){if(_0x2d16ca){_0x2dc6f8=_0x2d16ca;_0x1c5d6e[_0x4439('0x31')]=_[_0x4439('0x33')](db[_0x4439('0x52')][_0x4439('0x42')]);_0x1c5d6e[_0x4439('0x32')]=_[_0x4439('0x33')](_0x6d2d33[_0x4439('0x32')]);_0x1c5d6e[_0x4439('0x34')]=_[_0x4439('0x43')](_0x1c5d6e[_0x4439('0x31')],_0x1c5d6e[_0x4439('0x32')]);_0x103d6b[_0x4439('0x35')]=_[_0x4439('0x43')](_0x1c5d6e[_0x4439('0x31')],qs[_0x4439('0x36')](_0x6d2d33[_0x4439('0x32')][_0x4439('0x36')]));_0x103d6b[_0x4439('0x35')]=_0x103d6b[_0x4439('0x35')][_0x4439('0x56')]?_0x103d6b[_0x4439('0x35')]:_0x1c5d6e['model'];_0x103d6b[_0x4439('0x39')]=qs[_0x4439('0x3a')](_0x6d2d33['query'][_0x4439('0x3a')]);_0x103d6b[_0x4439('0x3b')]=qs[_0x4439('0x34')](_[_0x4439('0x57')](_0x6d2d33[_0x4439('0x32')],_0x1c5d6e[_0x4439('0x34')]));if(_0x6d2d33[_0x4439('0x32')][_0x4439('0x58')]){_0x103d6b[_0x4439('0x3b')]=_[_0x4439('0x3c')](_0x103d6b['where'],{'$or':_[_0x4439('0x2d')](_0x103d6b[_0x4439('0x35')],function(_0x13139f){var _0x277f79={};_0x277f79[_0x13139f]={'$like':'%'+_0x6d2d33[_0x4439('0x32')][_0x4439('0x58')]+'%'};return _0x277f79;})});}_0x103d6b=_[_0x4439('0x3c')]({},_0x103d6b,_0x6d2d33[_0x4439('0x45')]);return _0x2dc6f8[_0x4439('0x55')](_0x103d6b);}})[_0x4439('0x24')](function(_0x324a4c){if(_0x324a4c){_0x4b6c0b=_0x324a4c[_0x4439('0x56')];if(!_0x6d2d33[_0x4439('0x32')][_0x4439('0x37')](_0x4439('0x38'))){_0x103d6b['limit']=qs[_0x4439('0x1e')](_0x6d2d33['query'][_0x4439('0x1e')]);_0x103d6b['offset']=qs['offset'](_0x6d2d33[_0x4439('0x32')][_0x4439('0x1c')]);}return _0x2dc6f8[_0x4439('0x55')](_0x103d6b);}})[_0x4439('0x24')](function(_0x39b6fe){if(_0x39b6fe){return _0x39b6fe?{'count':_0x4b6c0b,'rows':_0x39b6fe}:null;}})[_0x4439('0x24')](respondWithResult(_0x15457c,null))[_0x4439('0x40')](handleError(_0x15457c,null));};exports[_0x4439('0x59')]=function(_0x2c94cd,_0x12da5d,_0x356bdf){var _0x3bcff1={};var _0x1663dd={};var _0x37f186;var _0x3cd386;return db[_0x4439('0x2e')][_0x4439('0x5a')]({'where':{'id':_0x2c94cd['params']['id']}})[_0x4439('0x24')](handleEntityNotFound(_0x12da5d,null))['then'](function(_0x119eea){if(_0x119eea){_0x37f186=_0x119eea;_0x1663dd[_0x4439('0x31')]=_[_0x4439('0x33')](db['Condition'][_0x4439('0x42')]);_0x1663dd[_0x4439('0x32')]=_[_0x4439('0x33')](_0x2c94cd[_0x4439('0x32')]);_0x1663dd[_0x4439('0x34')]=_['intersection'](_0x1663dd[_0x4439('0x31')],_0x1663dd[_0x4439('0x32')]);_0x3bcff1[_0x4439('0x35')]=_[_0x4439('0x43')](_0x1663dd[_0x4439('0x31')],qs[_0x4439('0x36')](_0x2c94cd[_0x4439('0x32')]['fields']));_0x3bcff1[_0x4439('0x35')]=_0x3bcff1[_0x4439('0x35')][_0x4439('0x56')]?_0x3bcff1[_0x4439('0x35')]:_0x1663dd[_0x4439('0x31')];_0x3bcff1[_0x4439('0x39')]=qs[_0x4439('0x3a')](_0x2c94cd[_0x4439('0x32')][_0x4439('0x3a')]);_0x3bcff1[_0x4439('0x3b')]=qs[_0x4439('0x34')](_['pick'](_0x2c94cd['query'],_0x1663dd[_0x4439('0x34')]));if(_0x2c94cd[_0x4439('0x32')][_0x4439('0x58')]){_0x3bcff1[_0x4439('0x3b')]=_['merge'](_0x3bcff1['where'],{'$or':_[_0x4439('0x2d')](_0x3bcff1[_0x4439('0x35')],function(_0xe0aad4){var _0xbd43a4={};_0xbd43a4[_0xe0aad4]={'$like':'%'+_0x2c94cd[_0x4439('0x32')][_0x4439('0x58')]+'%'};return _0xbd43a4;})});}_0x3bcff1=_[_0x4439('0x3c')]({},_0x3bcff1,_0x2c94cd[_0x4439('0x45')]);return _0x37f186[_0x4439('0x59')](_0x3bcff1);}})[_0x4439('0x24')](function(_0x22ae59){if(_0x22ae59){_0x3cd386=_0x22ae59['length'];if(!_0x2c94cd['query'][_0x4439('0x37')](_0x4439('0x38'))){_0x3bcff1['limit']=qs[_0x4439('0x1e')](_0x2c94cd['query'][_0x4439('0x1e')]);_0x3bcff1[_0x4439('0x1c')]=qs[_0x4439('0x1c')](_0x2c94cd[_0x4439('0x32')][_0x4439('0x1c')]);}return _0x37f186['getAnyConditions'](_0x3bcff1);}})[_0x4439('0x24')](function(_0x1e906a){if(_0x1e906a){return _0x1e906a?{'count':_0x3cd386,'rows':_0x1e906a}:null;}})[_0x4439('0x24')](respondWithResult(_0x12da5d,null))[_0x4439('0x40')](handleError(_0x12da5d,null));};exports[_0x4439('0x5b')]=function(_0x556d00,_0x5df4a0,_0x27362f){if(_0x556d00[_0x4439('0x4f')]['id']){delete _0x556d00[_0x4439('0x4f')]['id'];}return db['Trigger'][_0x4439('0x46')]({'where':{'id':_0x556d00['params']['id']}})[_0x4439('0x24')](handleEntityNotFound(_0x5df4a0,null))['then'](function(_0x5e9ba4){if(_0x5e9ba4){_0x556d00[_0x4439('0x4f')][_0x4439('0x5c')]=_0x5e9ba4['id'];return db[_0x4439('0x5d')][_0x4439('0x47')](_0x556d00[_0x4439('0x4f')]);}})[_0x4439('0x24')](respondWithResult(_0x5df4a0,null))[_0x4439('0x40')](handleError(_0x5df4a0,null));};exports['getActions']=function(_0x35c479,_0x5ad412,_0x49ed51){var _0x521a96={};var _0x4b2f80={};var _0x36686c;var _0x48568d;return db[_0x4439('0x2e')]['findOne']({'where':{'id':_0x35c479[_0x4439('0x41')]['id']}})[_0x4439('0x24')](handleEntityNotFound(_0x5ad412,null))[_0x4439('0x24')](function(_0x70e85a){if(_0x70e85a){_0x36686c=_0x70e85a;_0x4b2f80[_0x4439('0x31')]=_['keys'](db['Action'][_0x4439('0x42')]);_0x4b2f80['query']=_[_0x4439('0x33')](_0x35c479['query']);_0x4b2f80[_0x4439('0x34')]=_['intersection'](_0x4b2f80[_0x4439('0x31')],_0x4b2f80[_0x4439('0x32')]);_0x521a96[_0x4439('0x35')]=_[_0x4439('0x43')](_0x4b2f80[_0x4439('0x31')],qs[_0x4439('0x36')](_0x35c479[_0x4439('0x32')][_0x4439('0x36')]));_0x521a96[_0x4439('0x35')]=_0x521a96[_0x4439('0x35')][_0x4439('0x56')]?_0x521a96[_0x4439('0x35')]:_0x4b2f80[_0x4439('0x31')];_0x521a96[_0x4439('0x39')]=qs[_0x4439('0x3a')](_0x35c479[_0x4439('0x32')][_0x4439('0x3a')]);_0x521a96[_0x4439('0x3b')]=qs[_0x4439('0x34')](_[_0x4439('0x57')](_0x35c479['query'],_0x4b2f80[_0x4439('0x34')]));if(_0x35c479[_0x4439('0x32')][_0x4439('0x58')]){_0x521a96[_0x4439('0x3b')]=_[_0x4439('0x3c')](_0x521a96[_0x4439('0x3b')],{'$or':_['map'](_0x521a96[_0x4439('0x35')],function(_0x256878){var _0x458604={};_0x458604[_0x256878]={'$like':'%'+_0x35c479['query'][_0x4439('0x58')]+'%'};return _0x458604;})});}_0x521a96=_[_0x4439('0x3c')]({},_0x521a96,_0x35c479[_0x4439('0x45')]);return _0x36686c[_0x4439('0x5e')](_0x521a96);}})['then'](function(_0x2ce502){if(_0x2ce502){_0x48568d=_0x2ce502['length'];if(!_0x35c479[_0x4439('0x32')][_0x4439('0x37')](_0x4439('0x38'))){_0x521a96['limit']=qs['limit'](_0x35c479[_0x4439('0x32')]['limit']);_0x521a96['offset']=qs[_0x4439('0x1c')](_0x35c479[_0x4439('0x32')]['offset']);}return _0x36686c['getActions'](_0x521a96);}})[_0x4439('0x24')](function(_0x5ea570){if(_0x5ea570){return _0x5ea570?{'count':_0x48568d,'rows':_0x5ea570}:null;}})[_0x4439('0x24')](respondWithResult(_0x5ad412,null))[_0x4439('0x40')](handleError(_0x5ad412,null));}; \ No newline at end of file +var _0x2e8e=['getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','Triggers','UserProfileResource','end','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Trigger','then','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions'];(function(_0x5a117a,_0x247779){var _0x173ef6=function(_0x5e652a){while(--_0x5e652a){_0x5a117a['push'](_0x5a117a['shift']());}};_0x173ef6(++_0x247779);}(_0x2e8e,0x1e4));var _0xe2e8=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x2e8e[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0xe2e8('0x0'));var rimraf=require(_0xe2e8('0x1'));var zipdir=require(_0xe2e8('0x2'));var jsonpatch=require(_0xe2e8('0x3'));var rp=require(_0xe2e8('0x4'));var moment=require(_0xe2e8('0x5'));var BPromise=require(_0xe2e8('0x6'));var Mustache=require(_0xe2e8('0x7'));var util=require(_0xe2e8('0x8'));var path=require('path');var sox=require(_0xe2e8('0x9'));var csv=require('to-csv');var ejs=require(_0xe2e8('0xa'));var fs=require('fs');var fs_extra=require(_0xe2e8('0xb'));var _=require('lodash');var squel=require(_0xe2e8('0xc'));var crypto=require(_0xe2e8('0xd'));var jsforce=require(_0xe2e8('0xe'));var deskjs=require(_0xe2e8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe2e8('0x10'));var Papa=require(_0xe2e8('0x11'));var Redis=require(_0xe2e8('0x12'));var authService=require(_0xe2e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe2e8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2e8('0x15'))(_0xe2e8('0x16'));var utils=require(_0xe2e8('0x17'));var config=require(_0xe2e8('0x18'));var licenseUtil=require(_0xe2e8('0x19'));var db=require(_0xe2e8('0x1a'))['db'];function respondWithStatusCode(_0xb6febe,_0x5f35d7){_0x5f35d7=_0x5f35d7||0xcc;return function(_0x17efdc){if(_0x17efdc){return _0xb6febe[_0xe2e8('0x1b')](_0x5f35d7);}return _0xb6febe[_0xe2e8('0x1c')](_0x5f35d7)['end']();};}function respondWithResult(_0x2a9e4a,_0x519447){_0x519447=_0x519447||0xc8;return function(_0x452a65){if(_0x452a65){return _0x2a9e4a[_0xe2e8('0x1c')](_0x519447)[_0xe2e8('0x1d')](_0x452a65);}};}function respondWithFilteredResult(_0x22ff04,_0x14974e){return function(_0x435fa4){if(_0x435fa4){var _0x2c8b6b=typeof _0x14974e[_0xe2e8('0x1e')]===_0xe2e8('0x1f')&&typeof _0x14974e[_0xe2e8('0x20')]==='undefined';var _0xccd92=_0x435fa4['count'];var _0x470678=_0x2c8b6b?0x0:_0x14974e[_0xe2e8('0x1e')];var _0x1e3dbc=_0x2c8b6b?_0x435fa4[_0xe2e8('0x21')]:_0x14974e[_0xe2e8('0x1e')]+_0x14974e[_0xe2e8('0x20')];var _0x117ec5;if(_0x1e3dbc>=_0xccd92){_0x1e3dbc=_0xccd92;_0x117ec5=0xc8;}else{_0x117ec5=0xce;}_0x22ff04['status'](_0x117ec5);return _0x22ff04[_0xe2e8('0x22')](_0xe2e8('0x23'),_0x470678+'-'+_0x1e3dbc+'/'+_0xccd92)[_0xe2e8('0x1d')](_0x435fa4);}return null;};}function patchUpdates(_0x6fc966){return function(_0x327748){try{jsonpatch[_0xe2e8('0x24')](_0x327748,_0x6fc966,!![]);}catch(_0x4c456f){return BPromise['reject'](_0x4c456f);}return _0x327748[_0xe2e8('0x25')]();};}function saveUpdates(_0x17e686,_0x25c342){return function(_0x4681a4){if(_0x4681a4){return _0x4681a4['update'](_0x17e686)['then'](function(_0x56bf27){return _0x56bf27;});}return null;};}function removeEntity(_0x659443,_0x5ca3c9){return function(_0x244563){if(_0x244563){return _0x244563[_0xe2e8('0x26')]()['then'](function(){var _0x2e7cb1=_0x244563[_0xe2e8('0x27')]({'plain':!![]});var _0x3f1d76=_0xe2e8('0x28');return db[_0xe2e8('0x29')][_0xe2e8('0x26')]({'where':{'type':_0x3f1d76,'resourceId':_0x2e7cb1['id']}})['then'](function(){return _0x244563;});})['then'](function(){_0x659443[_0xe2e8('0x1c')](0xcc)[_0xe2e8('0x2a')]();});}};}function handleEntityNotFound(_0x555562,_0x5deafa){return function(_0x1358cb){if(!_0x1358cb){_0x555562[_0xe2e8('0x1b')](0x194);}return _0x1358cb;};}function handleError(_0x5d158f,_0x516315){_0x516315=_0x516315||0x1f4;return function(_0x2aa660){logger[_0xe2e8('0x2b')](_0x2aa660[_0xe2e8('0x2c')]);if(_0x2aa660[_0xe2e8('0x2d')]){delete _0x2aa660['name'];}_0x5d158f[_0xe2e8('0x1c')](_0x516315)['send'](_0x2aa660);};}exports[_0xe2e8('0x2e')]=function(_0x3a78a7,_0x2d9bc3){var _0x3310d1={},_0x127201={},_0xcbcf36={'count':0x0,'rows':[]};var _0x46cca7=_[_0xe2e8('0x2f')](db['Trigger'][_0xe2e8('0x30')],function(_0x16768e){return{'name':_0x16768e['fieldName'],'type':_0x16768e[_0xe2e8('0x31')][_0xe2e8('0x32')]};});_0x127201[_0xe2e8('0x33')]=_[_0xe2e8('0x2f')](_0x46cca7,_0xe2e8('0x2d'));_0x127201[_0xe2e8('0x34')]=_[_0xe2e8('0x35')](_0x3a78a7[_0xe2e8('0x34')]);_0x127201[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x127201[_0xe2e8('0x33')],_0x127201[_0xe2e8('0x34')]);_0x3310d1[_0xe2e8('0x38')]=_[_0xe2e8('0x37')](_0x127201['model'],qs[_0xe2e8('0x39')](_0x3a78a7['query']['fields']));_0x3310d1[_0xe2e8('0x38')]=_0x3310d1['attributes']['length']?_0x3310d1[_0xe2e8('0x38')]:_0x127201[_0xe2e8('0x33')];if(!_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x3a')](_0xe2e8('0x3b'))){_0x3310d1[_0xe2e8('0x20')]=qs['limit'](_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x20')]);_0x3310d1['offset']=qs[_0xe2e8('0x1e')](_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x1e')]);}_0x3310d1[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x3d')]);_0x3310d1[_0xe2e8('0x3e')]=qs[_0xe2e8('0x36')](_[_0xe2e8('0x3f')](_0x3a78a7[_0xe2e8('0x34')],_0x127201[_0xe2e8('0x36')]),_0x46cca7);if(_0x3a78a7['query'][_0xe2e8('0x40')]){_0x3310d1[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x3310d1['where'],{'$or':_['map'](_0x46cca7,function(_0xe888fe){if(_0xe888fe[_0xe2e8('0x31')]!=='VIRTUAL'){var _0x4b5e8f={};_0x4b5e8f[_0xe888fe[_0xe2e8('0x2d')]]={'$like':'%'+_0x3a78a7['query'][_0xe2e8('0x40')]+'%'};return _0x4b5e8f;}})});}_0x3310d1=_[_0xe2e8('0x41')]({},_0x3310d1,_0x3a78a7[_0xe2e8('0x42')]);var _0x42ef1d={'where':_0x3310d1['where']};return db[_0xe2e8('0x43')][_0xe2e8('0x21')](_0x42ef1d)[_0xe2e8('0x44')](function(_0x5ac667){_0xcbcf36[_0xe2e8('0x21')]=_0x5ac667;if(_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x45')]){_0x3310d1[_0xe2e8('0x46')]=[{'all':!![]}];}return db[_0xe2e8('0x43')][_0xe2e8('0x47')](_0x3310d1);})[_0xe2e8('0x44')](function(_0x258557){_0xcbcf36['rows']=_0x258557;return _0xcbcf36;})[_0xe2e8('0x44')](respondWithFilteredResult(_0x2d9bc3,_0x3310d1))[_0xe2e8('0x48')](handleError(_0x2d9bc3,null));};exports[_0xe2e8('0x49')]=function(_0x41ecb2,_0x2ab575){var _0x367b02={'raw':![],'where':{'id':_0x41ecb2[_0xe2e8('0x4a')]['id']}},_0x2582fb={};_0x2582fb[_0xe2e8('0x33')]=_[_0xe2e8('0x35')](db[_0xe2e8('0x43')]['rawAttributes']);_0x2582fb[_0xe2e8('0x34')]=_[_0xe2e8('0x35')](_0x41ecb2[_0xe2e8('0x34')]);_0x2582fb[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x2582fb['model'],_0x2582fb[_0xe2e8('0x34')]);_0x367b02[_0xe2e8('0x38')]=_['intersection'](_0x2582fb[_0xe2e8('0x33')],qs[_0xe2e8('0x39')](_0x41ecb2[_0xe2e8('0x34')][_0xe2e8('0x39')]));_0x367b02['attributes']=_0x367b02['attributes'][_0xe2e8('0x4b')]?_0x367b02[_0xe2e8('0x38')]:_0x2582fb[_0xe2e8('0x33')];if(_0x41ecb2[_0xe2e8('0x34')]['includeAll']){_0x367b02[_0xe2e8('0x46')]=[{'all':!![]}];}_0x367b02=_[_0xe2e8('0x41')]({},_0x367b02,_0x41ecb2[_0xe2e8('0x42')]);return db[_0xe2e8('0x43')][_0xe2e8('0x4c')](_0x367b02)[_0xe2e8('0x44')](handleEntityNotFound(_0x2ab575,null))['then'](respondWithResult(_0x2ab575,null))[_0xe2e8('0x48')](handleError(_0x2ab575,null));};exports[_0xe2e8('0x4d')]=function(_0x4ec776,_0x724f5f){return db[_0xe2e8('0x43')][_0xe2e8('0x4d')](_0x4ec776[_0xe2e8('0x4e')],{})[_0xe2e8('0x44')](function(_0x2f344e){var _0x30f1e6=_0x4ec776[_0xe2e8('0x4f')][_0xe2e8('0x27')]({'plain':!![]});if(!_0x30f1e6)throw new Error(_0xe2e8('0x50'));if(_0x30f1e6['role']===_0xe2e8('0x4f')){var _0x33abca=_0x2f344e[_0xe2e8('0x27')]({'plain':!![]});var _0xad67e2=_0xe2e8('0x28');return db[_0xe2e8('0x51')][_0xe2e8('0x4c')]({'where':{'name':_0xad67e2,'userProfileId':_0x30f1e6['userProfileId']},'raw':!![]})[_0xe2e8('0x44')](function(_0x3fe344){if(_0x3fe344&&_0x3fe344[_0xe2e8('0x52')]===0x0){return db[_0xe2e8('0x29')][_0xe2e8('0x4d')]({'name':_0x33abca[_0xe2e8('0x2d')],'resourceId':_0x33abca['id'],'type':_0x3fe344[_0xe2e8('0x2d')],'sectionId':_0x3fe344['id']},{})['then'](function(){return _0x2f344e;});}else{return _0x2f344e;}})['catch'](function(_0x380e5b){logger['error'](_0xe2e8('0x53'),_0x380e5b);throw _0x380e5b;});}return _0x2f344e;})[_0xe2e8('0x44')](respondWithResult(_0x724f5f,0xc9))[_0xe2e8('0x48')](handleError(_0x724f5f,null));};exports[_0xe2e8('0x54')]=function(_0x229288,_0x4798d4){if(_0x229288[_0xe2e8('0x4e')]['id']){delete _0x229288['body']['id'];}return db[_0xe2e8('0x43')]['find']({'where':{'id':_0x229288['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x4798d4,null))[_0xe2e8('0x44')](saveUpdates(_0x229288[_0xe2e8('0x4e')],null))[_0xe2e8('0x44')](respondWithResult(_0x4798d4,null))[_0xe2e8('0x48')](handleError(_0x4798d4,null));};exports['destroy']=function(_0x2cc47a,_0x3c6531){return db[_0xe2e8('0x43')][_0xe2e8('0x4c')]({'where':{'id':_0x2cc47a[_0xe2e8('0x4a')]['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x3c6531,null))['then'](removeEntity(_0x3c6531,null))[_0xe2e8('0x48')](handleError(_0x3c6531,null));};exports[_0xe2e8('0x55')]=function(_0x4acff8,_0x11f02e,_0xc034c9){if(_0x4acff8[_0xe2e8('0x4e')]['id']){delete _0x4acff8[_0xe2e8('0x4e')]['id'];}return db[_0xe2e8('0x43')][_0xe2e8('0x4c')]({'where':{'id':_0x4acff8['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x11f02e,null))[_0xe2e8('0x44')](function(_0x1ca3c6){if(_0x1ca3c6){_0x4acff8[_0xe2e8('0x4e')][_0xe2e8('0x56')]=_0x1ca3c6['id'];return db[_0xe2e8('0x57')][_0xe2e8('0x4d')](_0x4acff8['body']);}})[_0xe2e8('0x44')](respondWithResult(_0x11f02e,null))[_0xe2e8('0x48')](handleError(_0x11f02e,null));};exports[_0xe2e8('0x58')]=function(_0x3ee8b4,_0x5bd4e9,_0x4b500c){if(_0x3ee8b4['body']['id']){delete _0x3ee8b4[_0xe2e8('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x3ee8b4['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x5bd4e9,null))['then'](function(_0x2f0097){if(_0x2f0097){_0x3ee8b4[_0xe2e8('0x4e')][_0xe2e8('0x59')]=_0x2f0097['id'];return db[_0xe2e8('0x57')][_0xe2e8('0x4d')](_0x3ee8b4[_0xe2e8('0x4e')]);}})['then'](respondWithResult(_0x5bd4e9,null))[_0xe2e8('0x48')](handleError(_0x5bd4e9,null));};exports['getAllConditions']=function(_0x2dd13e,_0x3ec02a,_0x101625){var _0x5329f1={};var _0x30e2d0={};var _0x1b80cb;var _0xe22a76;return db[_0xe2e8('0x43')][_0xe2e8('0x5a')]({'where':{'id':_0x2dd13e['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x3ec02a,null))[_0xe2e8('0x44')](function(_0x423433){if(_0x423433){_0x1b80cb=_0x423433;_0x30e2d0[_0xe2e8('0x33')]=_[_0xe2e8('0x35')](db[_0xe2e8('0x57')][_0xe2e8('0x30')]);_0x30e2d0['query']=_[_0xe2e8('0x35')](_0x2dd13e[_0xe2e8('0x34')]);_0x30e2d0['filters']=_[_0xe2e8('0x37')](_0x30e2d0[_0xe2e8('0x33')],_0x30e2d0[_0xe2e8('0x34')]);_0x5329f1[_0xe2e8('0x38')]=_[_0xe2e8('0x37')](_0x30e2d0[_0xe2e8('0x33')],qs['fields'](_0x2dd13e[_0xe2e8('0x34')]['fields']));_0x5329f1[_0xe2e8('0x38')]=_0x5329f1[_0xe2e8('0x38')][_0xe2e8('0x4b')]?_0x5329f1['attributes']:_0x30e2d0[_0xe2e8('0x33')];_0x5329f1[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x2dd13e['query']['sort']);_0x5329f1['where']=qs[_0xe2e8('0x36')](_[_0xe2e8('0x3f')](_0x2dd13e[_0xe2e8('0x34')],_0x30e2d0[_0xe2e8('0x36')]));if(_0x2dd13e['query']['filter']){_0x5329f1[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x5329f1[_0xe2e8('0x3e')],{'$or':_[_0xe2e8('0x2f')](_0x5329f1[_0xe2e8('0x38')],function(_0x54f6a4){var _0x2c3f14={};_0x2c3f14[_0x54f6a4]={'$like':'%'+_0x2dd13e[_0xe2e8('0x34')][_0xe2e8('0x40')]+'%'};return _0x2c3f14;})});}_0x5329f1=_[_0xe2e8('0x41')]({},_0x5329f1,_0x2dd13e['options']);return _0x1b80cb[_0xe2e8('0x5b')](_0x5329f1);}})[_0xe2e8('0x44')](function(_0x2dd4ae){if(_0x2dd4ae){_0xe22a76=_0x2dd4ae[_0xe2e8('0x4b')];if(!_0x2dd13e[_0xe2e8('0x34')][_0xe2e8('0x3a')]('nolimit')){_0x5329f1[_0xe2e8('0x20')]=qs[_0xe2e8('0x20')](_0x2dd13e['query'][_0xe2e8('0x20')]);_0x5329f1[_0xe2e8('0x1e')]=qs[_0xe2e8('0x1e')](_0x2dd13e[_0xe2e8('0x34')]['offset']);}return _0x1b80cb['getAllConditions'](_0x5329f1);}})[_0xe2e8('0x44')](function(_0x4a90eb){if(_0x4a90eb){return _0x4a90eb?{'count':_0xe22a76,'rows':_0x4a90eb}:null;}})[_0xe2e8('0x44')](respondWithResult(_0x3ec02a,null))[_0xe2e8('0x48')](handleError(_0x3ec02a,null));};exports[_0xe2e8('0x5c')]=function(_0x484b19,_0x5a474c,_0x437bab){var _0x58ad50={};var _0x19f75a={};var _0x5e109e;var _0x210fb3;return db[_0xe2e8('0x43')][_0xe2e8('0x5a')]({'where':{'id':_0x484b19[_0xe2e8('0x4a')]['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x5a474c,null))[_0xe2e8('0x44')](function(_0x5d147d){if(_0x5d147d){_0x5e109e=_0x5d147d;_0x19f75a[_0xe2e8('0x33')]=_['keys'](db['Condition'][_0xe2e8('0x30')]);_0x19f75a['query']=_['keys'](_0x484b19['query']);_0x19f75a[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x19f75a[_0xe2e8('0x33')],_0x19f75a[_0xe2e8('0x34')]);_0x58ad50['attributes']=_[_0xe2e8('0x37')](_0x19f75a['model'],qs[_0xe2e8('0x39')](_0x484b19[_0xe2e8('0x34')][_0xe2e8('0x39')]));_0x58ad50[_0xe2e8('0x38')]=_0x58ad50[_0xe2e8('0x38')][_0xe2e8('0x4b')]?_0x58ad50[_0xe2e8('0x38')]:_0x19f75a['model'];_0x58ad50[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x484b19['query']['sort']);_0x58ad50[_0xe2e8('0x3e')]=qs['filters'](_[_0xe2e8('0x3f')](_0x484b19[_0xe2e8('0x34')],_0x19f75a['filters']));if(_0x484b19[_0xe2e8('0x34')]['filter']){_0x58ad50[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x58ad50['where'],{'$or':_['map'](_0x58ad50[_0xe2e8('0x38')],function(_0x584224){var _0x13dd25={};_0x13dd25[_0x584224]={'$like':'%'+_0x484b19[_0xe2e8('0x34')][_0xe2e8('0x40')]+'%'};return _0x13dd25;})});}_0x58ad50=_['merge']({},_0x58ad50,_0x484b19['options']);return _0x5e109e['getAnyConditions'](_0x58ad50);}})['then'](function(_0x3300a0){if(_0x3300a0){_0x210fb3=_0x3300a0[_0xe2e8('0x4b')];if(!_0x484b19['query'][_0xe2e8('0x3a')](_0xe2e8('0x3b'))){_0x58ad50[_0xe2e8('0x20')]=qs['limit'](_0x484b19['query'][_0xe2e8('0x20')]);_0x58ad50[_0xe2e8('0x1e')]=qs[_0xe2e8('0x1e')](_0x484b19[_0xe2e8('0x34')][_0xe2e8('0x1e')]);}return _0x5e109e[_0xe2e8('0x5c')](_0x58ad50);}})[_0xe2e8('0x44')](function(_0x2f07fb){if(_0x2f07fb){return _0x2f07fb?{'count':_0x210fb3,'rows':_0x2f07fb}:null;}})['then'](respondWithResult(_0x5a474c,null))[_0xe2e8('0x48')](handleError(_0x5a474c,null));};exports['addAction']=function(_0x1ca21b,_0x13e89c,_0x5558e0){if(_0x1ca21b[_0xe2e8('0x4e')]['id']){delete _0x1ca21b[_0xe2e8('0x4e')]['id'];}return db[_0xe2e8('0x43')][_0xe2e8('0x4c')]({'where':{'id':_0x1ca21b['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x13e89c,null))[_0xe2e8('0x44')](function(_0x13dcc1){if(_0x13dcc1){_0x1ca21b[_0xe2e8('0x4e')][_0xe2e8('0x5d')]=_0x13dcc1['id'];return db[_0xe2e8('0x5e')][_0xe2e8('0x4d')](_0x1ca21b[_0xe2e8('0x4e')]);}})['then'](respondWithResult(_0x13e89c,null))[_0xe2e8('0x48')](handleError(_0x13e89c,null));};exports[_0xe2e8('0x5f')]=function(_0x492d3f,_0x2b680a,_0x308ae3){var _0x22cb7b={};var _0x3299f4={};var _0x32b54b;var _0x2d5b31;return db[_0xe2e8('0x43')][_0xe2e8('0x5a')]({'where':{'id':_0x492d3f['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x2b680a,null))[_0xe2e8('0x44')](function(_0x387366){if(_0x387366){_0x32b54b=_0x387366;_0x3299f4[_0xe2e8('0x33')]=_[_0xe2e8('0x35')](db[_0xe2e8('0x5e')][_0xe2e8('0x30')]);_0x3299f4[_0xe2e8('0x34')]=_[_0xe2e8('0x35')](_0x492d3f[_0xe2e8('0x34')]);_0x3299f4[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x3299f4['model'],_0x3299f4[_0xe2e8('0x34')]);_0x22cb7b[_0xe2e8('0x38')]=_[_0xe2e8('0x37')](_0x3299f4[_0xe2e8('0x33')],qs['fields'](_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x39')]));_0x22cb7b[_0xe2e8('0x38')]=_0x22cb7b[_0xe2e8('0x38')]['length']?_0x22cb7b['attributes']:_0x3299f4[_0xe2e8('0x33')];_0x22cb7b[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x3d')]);_0x22cb7b['where']=qs[_0xe2e8('0x36')](_[_0xe2e8('0x3f')](_0x492d3f[_0xe2e8('0x34')],_0x3299f4['filters']));if(_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x40')]){_0x22cb7b[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x22cb7b[_0xe2e8('0x3e')],{'$or':_[_0xe2e8('0x2f')](_0x22cb7b[_0xe2e8('0x38')],function(_0xae2b3b){var _0x1bad41={};_0x1bad41[_0xae2b3b]={'$like':'%'+_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x40')]+'%'};return _0x1bad41;})});}_0x22cb7b=_[_0xe2e8('0x41')]({},_0x22cb7b,_0x492d3f[_0xe2e8('0x42')]);return _0x32b54b[_0xe2e8('0x5f')](_0x22cb7b);}})[_0xe2e8('0x44')](function(_0x17b805){if(_0x17b805){_0x2d5b31=_0x17b805[_0xe2e8('0x4b')];if(!_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x3a')]('nolimit')){_0x22cb7b[_0xe2e8('0x20')]=qs[_0xe2e8('0x20')](_0x492d3f[_0xe2e8('0x34')]['limit']);_0x22cb7b['offset']=qs[_0xe2e8('0x1e')](_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x1e')]);}return _0x32b54b[_0xe2e8('0x5f')](_0x22cb7b);}})[_0xe2e8('0x44')](function(_0x324e6f){if(_0x324e6f){return _0x324e6f?{'count':_0x2d5b31,'rows':_0x324e6f}:null;}})[_0xe2e8('0x44')](respondWithResult(_0x2b680a,null))['catch'](handleError(_0x2b680a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 3fc8d94..037b01e 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 _0x7f90=['rimraf','./trigger.attributes','exports','define','lodash','util','../../config/logger','api','moment','path'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x7f90,0xf4));var _0x07f9=function(_0x1ef7aa,_0xed2016){_0x1ef7aa=_0x1ef7aa-0x0;var _0xc179e9=_0x7f90[_0x1ef7aa];return _0xc179e9;};'use strict';var _=require(_0x07f9('0x0'));var util=require(_0x07f9('0x1'));var logger=require(_0x07f9('0x2'))(_0x07f9('0x3'));var moment=require(_0x07f9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07f9('0x5'));var rimraf=require(_0x07f9('0x6'));var config=require('../../config/environment');var attributes=require(_0x07f9('0x7'));module[_0x07f9('0x8')]=function(_0x46f86e,_0x449544){return _0x46f86e[_0x07f9('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb18=['../../config/environment','./trigger.attributes','exports','define','tools_triggers','../../config/logger','moment','request-promise','path','rimraf'];(function(_0xb4f9be,_0x17e944){var _0x1c550c=function(_0x1707b8){while(--_0x1707b8){_0xb4f9be['push'](_0xb4f9be['shift']());}};_0x1c550c(++_0x17e944);}(_0xcb18,0x159));var _0x8cb1=function(_0x1c2cd9,_0x308877){_0x1c2cd9=_0x1c2cd9-0x0;var _0x32aab9=_0xcb18[_0x1c2cd9];return _0x32aab9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8cb1('0x0'))('api');var moment=require(_0x8cb1('0x1'));var BPromise=require('bluebird');var rp=require(_0x8cb1('0x2'));var fs=require('fs');var path=require(_0x8cb1('0x3'));var rimraf=require(_0x8cb1('0x4'));var config=require(_0x8cb1('0x5'));var attributes=require(_0x8cb1('0x6'));module[_0x8cb1('0x7')]=function(_0x503927,_0x355d91){return _0x503927[_0x8cb1('0x8')]('Trigger',attributes,{'tableName':_0x8cb1('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 24d90e1..749538b 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 _0xf02e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','where','attributes','include','map','model','ShowTrigger','find','raw','lodash','util','../../config/utils'];(function(_0x2bdf29,_0x40cab0){var _0x60cb83=function(_0x4bc761){while(--_0x4bc761){_0x2bdf29['push'](_0x2bdf29['shift']());}};_0x60cb83(++_0x40cab0);}(_0xf02e,0x189));var _0xef02=function(_0x62613f,_0x3548e8){_0x62613f=_0x62613f-0x0;var _0x31fdd5=_0xf02e[_0x62613f];return _0x31fdd5;};'use strict';var _=require(_0xef02('0x0'));var util=require(_0xef02('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xef02('0x2'));var logger=require(_0xef02('0x3'))(_0xef02('0x4'));var config=require(_0xef02('0x5'));var jayson=require(_0xef02('0x6'));var client=jayson[_0xef02('0x7')][_0xef02('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x256fa4,_0x29d51f,_0x167391){return new BPromise(function(_0x2e7916,_0x40e3a3){return client[_0xef02('0x9')](_0x256fa4,_0x167391)['then'](function(_0x49cd16){logger[_0xef02('0xa')]('Trigger,\x20%s,\x20%s',_0x29d51f,'request\x20sent');logger[_0xef02('0xb')](_0xef02('0xc'),_0x29d51f,_0xef02('0xd'),JSON[_0xef02('0xe')](_0x49cd16));if(_0x49cd16['error']){if(_0x49cd16[_0xef02('0xf')][_0xef02('0x10')]===0x1f4){logger[_0xef02('0xf')](_0xef02('0x11'),_0x29d51f,_0x49cd16['error'][_0xef02('0x12')]);return _0x40e3a3(_0x49cd16['error'][_0xef02('0x12')]);}logger[_0xef02('0xf')](_0xef02('0x11'),_0x29d51f,_0x49cd16[_0xef02('0xf')][_0xef02('0x12')]);return _0x2e7916(_0x49cd16[_0xef02('0xf')][_0xef02('0x12')]);}else{logger[_0xef02('0xa')](_0xef02('0x11'),_0x29d51f,_0xef02('0xd'));_0x2e7916(_0x49cd16[_0xef02('0x13')][_0xef02('0x12')]);}})[_0xef02('0x14')](function(_0x5b3c60){logger[_0xef02('0xf')](_0xef02('0x11'),_0x29d51f,_0x5b3c60);_0x40e3a3(_0x5b3c60);});});}exports[_0xef02('0x15')]=function(_0x5e1e88){var _0x3bcbce=this;return new Promise(function(_0x47d18b,_0x2f7f4a){return db[_0xef02('0x16')][_0xef02('0x17')]({'raw':_0x5e1e88['options']?_0x5e1e88[_0xef02('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5e1e88[_0xef02('0x18')]?_0x5e1e88['options'][_0xef02('0x19')]||null:null,'attributes':_0x5e1e88['options']?_0x5e1e88['options'][_0xef02('0x1a')]||null:null,'limit':_0x5e1e88['options']?_0x5e1e88[_0xef02('0x18')]['limit']||null:null,'include':_0x5e1e88[_0xef02('0x18')]?_0x5e1e88[_0xef02('0x18')][_0xef02('0x1b')]?_[_0xef02('0x1c')](_0x5e1e88[_0xef02('0x18')][_0xef02('0x1b')],function(_0x4369ad){return{'model':db[_0x4369ad['model']],'as':_0x4369ad['as'],'attributes':_0x4369ad[_0xef02('0x1a')],'include':_0x4369ad[_0xef02('0x1b')]?_[_0xef02('0x1c')](_0x4369ad[_0xef02('0x1b')],function(_0x2cc965){return{'model':db[_0x2cc965[_0xef02('0x1d')]],'as':_0x2cc965['as'],'attributes':_0x2cc965[_0xef02('0x1a')],'include':_0x2cc965['include']?_[_0xef02('0x1c')](_0x2cc965[_0xef02('0x1b')],function(_0x539079){return{'model':db[_0x539079[_0xef02('0x1d')]],'as':_0x539079['as'],'attributes':_0x539079[_0xef02('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36b59b){logger['info'](_0xef02('0x15'),_0x5e1e88);logger[_0xef02('0xb')](_0xef02('0x15'),_0x5e1e88,JSON[_0xef02('0xe')](_0x36b59b));_0x47d18b(_0x36b59b);})['catch'](function(_0x5b51ae){logger[_0xef02('0xf')](_0xef02('0x15'),_0x5b51ae[_0xef02('0x12')],_0x5e1e88);_0x2f7f4a(_0x3bcbce[_0xef02('0xf')](0x1f4,_0x5b51ae[_0xef02('0x12')]));});});};exports[_0xef02('0x1e')]=function(_0x2befb5){var _0x58a91d=this;return new Promise(function(_0x5de5b6,_0x48e61d){return db['Trigger'][_0xef02('0x1f')]({'raw':_0x2befb5['options']?_0x2befb5[_0xef02('0x18')][_0xef02('0x20')]===undefined?!![]:![]:!![],'where':_0x2befb5[_0xef02('0x18')]?_0x2befb5[_0xef02('0x18')][_0xef02('0x19')]||null:null,'attributes':_0x2befb5[_0xef02('0x18')]?_0x2befb5[_0xef02('0x18')][_0xef02('0x1a')]||null:null,'include':_0x2befb5[_0xef02('0x18')]?_0x2befb5['options'][_0xef02('0x1b')]?_[_0xef02('0x1c')](_0x2befb5[_0xef02('0x18')]['include'],function(_0x5ae198){return{'model':db[_0x5ae198[_0xef02('0x1d')]],'as':_0x5ae198['as'],'attributes':_0x5ae198['attributes'],'include':_0x5ae198[_0xef02('0x1b')]?_[_0xef02('0x1c')](_0x5ae198[_0xef02('0x1b')],function(_0x1bc388){return{'model':db[_0x1bc388[_0xef02('0x1d')]],'as':_0x1bc388['as'],'attributes':_0x1bc388[_0xef02('0x1a')],'include':_0x1bc388[_0xef02('0x1b')]?_[_0xef02('0x1c')](_0x1bc388[_0xef02('0x1b')],function(_0x295ac8){return{'model':db[_0x295ac8[_0xef02('0x1d')]],'as':_0x295ac8['as'],'attributes':_0x295ac8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9429ff){logger[_0xef02('0xa')](_0xef02('0x1e'),_0x2befb5);logger[_0xef02('0xb')]('ShowTrigger',_0x2befb5,JSON[_0xef02('0xe')](_0x9429ff));_0x5de5b6(_0x9429ff);})[_0xef02('0x14')](function(_0x575685){logger[_0xef02('0xf')](_0xef02('0x1e'),_0x575685[_0xef02('0x12')],_0x2befb5);_0x48e61d(_0x58a91d['error'](0x1f4,_0x575685[_0xef02('0x12')]));});});}; \ No newline at end of file +var _0x1099=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trigger,\x20%s,\x20%s','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','map','include','model','ShowTrigger'];(function(_0x127f59,_0xd73cb0){var _0x332601=function(_0x3f0ec2){while(--_0x3f0ec2){_0x127f59['push'](_0x127f59['shift']());}};_0x332601(++_0xd73cb0);}(_0x1099,0x168));var _0x9109=function(_0x28591e,_0x40983b){_0x28591e=_0x28591e-0x0;var _0x3017e3=_0x1099[_0x28591e];return _0x3017e3;};'use strict';var _=require(_0x9109('0x0'));var util=require(_0x9109('0x1'));var moment=require('moment');var BPromise=require(_0x9109('0x2'));var rs=require(_0x9109('0x3'));var fs=require('fs');var Redis=require(_0x9109('0x4'));var db=require(_0x9109('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9109('0x6'))(_0x9109('0x7'));var config=require(_0x9109('0x8'));var jayson=require(_0x9109('0x9'));var client=jayson['client'][_0x9109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ba0bf,_0x4bb98e,_0x28ab02){return new BPromise(function(_0x3599f9,_0x338e31){return client[_0x9109('0xb')](_0x5ba0bf,_0x28ab02)[_0x9109('0xc')](function(_0x2add91){logger[_0x9109('0xd')]('Trigger,\x20%s,\x20%s',_0x4bb98e,_0x9109('0xe'));logger[_0x9109('0xf')](_0x9109('0x10'),_0x4bb98e,_0x9109('0xe'),JSON[_0x9109('0x11')](_0x2add91));if(_0x2add91['error']){if(_0x2add91[_0x9109('0x12')][_0x9109('0x13')]===0x1f4){logger[_0x9109('0x12')]('Trigger,\x20%s,\x20%s',_0x4bb98e,_0x2add91[_0x9109('0x12')][_0x9109('0x14')]);return _0x338e31(_0x2add91[_0x9109('0x12')][_0x9109('0x14')]);}logger[_0x9109('0x12')](_0x9109('0x15'),_0x4bb98e,_0x2add91[_0x9109('0x12')]['message']);return _0x3599f9(_0x2add91[_0x9109('0x12')][_0x9109('0x14')]);}else{logger[_0x9109('0xd')](_0x9109('0x15'),_0x4bb98e,'request\x20sent');_0x3599f9(_0x2add91[_0x9109('0x16')][_0x9109('0x14')]);}})[_0x9109('0x17')](function(_0x4c7c16){logger[_0x9109('0x12')](_0x9109('0x15'),_0x4bb98e,_0x4c7c16);_0x338e31(_0x4c7c16);});});}exports[_0x9109('0x18')]=function(_0x502d2a){var _0x54875f=this;return new Promise(function(_0x5dd25b,_0x1ebccf){return db[_0x9109('0x19')][_0x9109('0x1a')]({'raw':_0x502d2a['options']?_0x502d2a[_0x9109('0x1b')][_0x9109('0x1c')]===undefined?!![]:![]:!![],'where':_0x502d2a[_0x9109('0x1b')]?_0x502d2a[_0x9109('0x1b')][_0x9109('0x1d')]||null:null,'attributes':_0x502d2a[_0x9109('0x1b')]?_0x502d2a['options'][_0x9109('0x1e')]||null:null,'limit':_0x502d2a[_0x9109('0x1b')]?_0x502d2a[_0x9109('0x1b')][_0x9109('0x1f')]||null:null,'include':_0x502d2a[_0x9109('0x1b')]?_0x502d2a[_0x9109('0x1b')]['include']?_[_0x9109('0x20')](_0x502d2a[_0x9109('0x1b')][_0x9109('0x21')],function(_0xc810be){return{'model':db[_0xc810be[_0x9109('0x22')]],'as':_0xc810be['as'],'attributes':_0xc810be[_0x9109('0x1e')],'include':_0xc810be[_0x9109('0x21')]?_[_0x9109('0x20')](_0xc810be[_0x9109('0x21')],function(_0x2f0767){return{'model':db[_0x2f0767[_0x9109('0x22')]],'as':_0x2f0767['as'],'attributes':_0x2f0767[_0x9109('0x1e')],'include':_0x2f0767[_0x9109('0x21')]?_[_0x9109('0x20')](_0x2f0767['include'],function(_0x4ba84e){return{'model':db[_0x4ba84e[_0x9109('0x22')]],'as':_0x4ba84e['as'],'attributes':_0x4ba84e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9109('0xc')](function(_0x489fb9){logger[_0x9109('0xd')](_0x9109('0x18'),_0x502d2a);logger['debug'](_0x9109('0x18'),_0x502d2a,JSON['stringify'](_0x489fb9));_0x5dd25b(_0x489fb9);})[_0x9109('0x17')](function(_0x459701){logger[_0x9109('0x12')](_0x9109('0x18'),_0x459701[_0x9109('0x14')],_0x502d2a);_0x1ebccf(_0x54875f['error'](0x1f4,_0x459701[_0x9109('0x14')]));});});};exports[_0x9109('0x23')]=function(_0x24329f){var _0x298e9b=this;return new Promise(function(_0x4a76ea,_0x1c85cd){return db['Trigger']['find']({'raw':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x1c')]===undefined?!![]:![]:!![],'where':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x1d')]||null:null,'attributes':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x1e')]||null:null,'include':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x21')]?_['map'](_0x24329f[_0x9109('0x1b')][_0x9109('0x21')],function(_0x16a583){return{'model':db[_0x16a583[_0x9109('0x22')]],'as':_0x16a583['as'],'attributes':_0x16a583[_0x9109('0x1e')],'include':_0x16a583['include']?_[_0x9109('0x20')](_0x16a583[_0x9109('0x21')],function(_0x4e6f0c){return{'model':db[_0x4e6f0c[_0x9109('0x22')]],'as':_0x4e6f0c['as'],'attributes':_0x4e6f0c[_0x9109('0x1e')],'include':_0x4e6f0c['include']?_['map'](_0x4e6f0c[_0x9109('0x21')],function(_0x38d231){return{'model':db[_0x38d231[_0x9109('0x22')]],'as':_0x38d231['as'],'attributes':_0x38d231[_0x9109('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4664dd){logger['info'](_0x9109('0x23'),_0x24329f);logger[_0x9109('0xf')](_0x9109('0x23'),_0x24329f,JSON[_0x9109('0x11')](_0x4664dd));_0x4a76ea(_0x4664dd);})[_0x9109('0x17')](function(_0x46f026){logger[_0x9109('0x12')](_0x9109('0x23'),_0x46f026['message'],_0x24329f);_0x1c85cd(_0x298e9b[_0x9109('0x12')](0x1f4,_0x46f026['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 372c49f..f9d1a82 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 _0x9edb=['../../config/environment','./trunk.controller','get','isAuthenticated','index','show','post','/:id/clone','clone','create','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0x9edb,0x116));var _0xb9ed=function(_0x48420f,_0x12b937){_0x48420f=_0x48420f-0x0;var _0xb0c4f3=_0x9edb[_0x48420f];return _0xb0c4f3;};'use strict';var multer=require(_0xb9ed('0x0'));var util=require('util');var path=require(_0xb9ed('0x1'));var timeout=require(_0xb9ed('0x2'));var express=require(_0xb9ed('0x3'));var router=express[_0xb9ed('0x4')]();var fs_extra=require(_0xb9ed('0x5'));var auth=require(_0xb9ed('0x6'));var interaction=require(_0xb9ed('0x7'));var config=require(_0xb9ed('0x8'));var controller=require(_0xb9ed('0x9'));router[_0xb9ed('0xa')]('/',auth[_0xb9ed('0xb')](),controller[_0xb9ed('0xc')]);router[_0xb9ed('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb9ed('0xd')]);router[_0xb9ed('0xe')](_0xb9ed('0xf'),auth[_0xb9ed('0xb')](),controller[_0xb9ed('0x10')]);router[_0xb9ed('0xe')]('/',auth[_0xb9ed('0xb')](),controller[_0xb9ed('0x11')]);router['put']('/:id',auth[_0xb9ed('0xb')](),controller[_0xb9ed('0x12')]);router[_0xb9ed('0x13')](_0xb9ed('0x14'),auth[_0xb9ed('0xb')](),controller[_0xb9ed('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf2c8=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2c8,0x117));var _0x8f2c=function(_0x30b893,_0x39de2c){_0x30b893=_0x30b893-0x0;var _0x4b8747=_0xf2c8[_0x30b893];return _0x4b8747;};'use strict';var multer=require('multer');var util=require(_0x8f2c('0x0'));var path=require(_0x8f2c('0x1'));var timeout=require(_0x8f2c('0x2'));var express=require(_0x8f2c('0x3'));var router=express['Router']();var fs_extra=require(_0x8f2c('0x4'));var auth=require(_0x8f2c('0x5'));var interaction=require(_0x8f2c('0x6'));var config=require(_0x8f2c('0x7'));var controller=require(_0x8f2c('0x8'));router[_0x8f2c('0x9')]('/',auth[_0x8f2c('0xa')](),controller[_0x8f2c('0xb')]);router[_0x8f2c('0x9')](_0x8f2c('0xc'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0xd')]);router[_0x8f2c('0xe')](_0x8f2c('0xf'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x10')]);router['post']('/',auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x11')]);router[_0x8f2c('0x12')](_0x8f2c('0xc'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x13')]);router[_0x8f2c('0x14')](_0x8f2c('0xc'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x15')]);module[_0x8f2c('0x16')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 02633c6..b5b9b19 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 _0xed80=['outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','refuse','uas','pai','fingerprint','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update'];(function(_0x45d9f9,_0x27ef0c){var _0x3d8da6=function(_0x39a6eb){while(--_0x39a6eb){_0x45d9f9['push'](_0x45d9f9['shift']());}};_0x3d8da6(++_0x27ef0c);}(_0xed80,0x116));var _0x0ed8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xed80[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x0ed8('0x0'));module[_0x0ed8('0x1')]={'name':{'type':Sequelize[_0x0ed8('0x2')],'allowNull':![],'unique':_0x0ed8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0ed8('0x4')]('friend',_0x0ed8('0x5'),_0x0ed8('0x6')),'allowNull':![],'defaultValue':_0x0ed8('0x7')},'context':{'type':Sequelize[_0x0ed8('0x2')],'allowNull':![],'defaultValue':_0x0ed8('0x8')},'callingpres':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x9'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x0ed8('0xa'),_0x0ed8('0xb'),_0x0ed8('0xc'),_0x0ed8('0xd'),_0x0ed8('0xe'))},'deny':{'type':Sequelize[_0x0ed8('0x2')]},'permit':{'type':Sequelize[_0x0ed8('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x0ed8('0x2')]},'remotesecret':{'type':Sequelize[_0x0ed8('0x2')]},'transport':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':'udp','set':function(_0x38da2a){this[_0x0ed8('0xf')](_0x0ed8('0x10'),_0x38da2a?_0x38da2a[_0x0ed8('0x11')](','):null);},'get':function(){return this[_0x0ed8('0x12')](_0x0ed8('0x10'))?this[_0x0ed8('0x12')](_0x0ed8('0x10'))['split'](','):null;},'comment':_0x0ed8('0x13')},'dtmfmode':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x14'),_0x0ed8('0x15'),_0x0ed8('0x16'),_0x0ed8('0x17'),_0x0ed8('0x18')),'defaultValue':_0x0ed8('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x0ed8('0x19'),'no',_0x0ed8('0x1a'),_0x0ed8('0x1b'),_0x0ed8('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0ed8('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0ed8('0x2')]},'directmediadeny':{'type':Sequelize[_0x0ed8('0x2')]},'nat':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':_0x0ed8('0x1d'),'set':function(_0x538de8){this['setDataValue']('nat',_0x538de8?_0x538de8[_0x0ed8('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x0ed8('0x1e'))?this[_0x0ed8('0x12')](_0x0ed8('0x1e'))[_0x0ed8('0x1f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0ed8('0x2')]},'namedcallgroup':{'type':Sequelize[_0x0ed8('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0ed8('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':_0x0ed8('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3dd681){this[_0x0ed8('0xf')]('allow',_0x3dd681?_0x3dd681[_0x0ed8('0x11')](';'):_0x0ed8('0x21'));},'get':function(){return this[_0x0ed8('0x12')](_0x0ed8('0x22'))?this[_0x0ed8('0x12')](_0x0ed8('0x22'))[_0x0ed8('0x1f')](';'):null;},'comment':_0x0ed8('0x23')},'autoframing':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'insecure':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':'port,invite','set':function(_0x39da4d){this[_0x0ed8('0xf')](_0x0ed8('0x24'),_0x39da4d?_0x39da4d[_0x0ed8('0x11')](','):null);},'get':function(){return this[_0x0ed8('0x12')](_0x0ed8('0x24'))?this[_0x0ed8('0x12')](_0x0ed8('0x24'))['split'](','):null;},'comment':_0x0ed8('0x25')},'trustrpid':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x0ed8('0x19'),'no',_0x0ed8('0x26'))},'promiscredir':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x0ed8('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'setvar':{'type':Sequelize[_0x0ed8('0x2')]},'callerid':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0ed8('0x2')]},'callcounter':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no'),'defaultValue':_0x0ed8('0x19')},'busylevel':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x0ed8('0x2')]},'template':{'type':Sequelize[_0x0ed8('0x2')]},'videosupport':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0ed8('0x19'),'no')},'mailbox':{'type':Sequelize[_0x0ed8('0x2')]},'session_timers':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x28'),_0x0ed8('0x29'),'originate')},'session_expires':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x0ed8('0x4')]('uac','uas'),'defaultValue':_0x0ed8('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x0ed8('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x0ed8('0x2')]},'fromuser':{'type':Sequelize[_0x0ed8('0x2')]},'port':{'type':Sequelize[_0x0ed8('0x27')](0x5)},'qualify':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x0ed8('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x0ed8('0x4')]('yes','no',_0x0ed8('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0ed8('0x2')]},'callbackextension':{'type':Sequelize[_0x0ed8('0x2')]},'timert1':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'timerb':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x0ed8('0x2')]},'contactdeny':{'type':Sequelize[_0x0ed8('0x2')]},'contactacl':{'type':Sequelize[_0x0ed8('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x0ed8('0x2')]},'use_q850_reason':{'type':Sequelize[_0x0ed8('0x2')]},'maxforwards':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'encryption':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'force_avp':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'icesupport':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0ed8('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x0ed8('0x4')]('yes','no',_0x0ed8('0x2c'),_0x0ed8('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x0ed8('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0ed8('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x0ed8('0x2')]},'dtlscipher':{'type':Sequelize[_0x0ed8('0x2')]},'dtlscafile':{'type':Sequelize[_0x0ed8('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x2e'),'passive',_0x0ed8('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0ed8('0x2')]},'usereqphone':{'type':Sequelize[_0x0ed8('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0ed8('0x2')]},'recordofffeature':{'type':Sequelize[_0x0ed8('0x2')]},'call_limit':{'type':Sequelize[_0x0ed8('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0ed8('0x4')](_0x0ed8('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x0ed8('0x4')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x0ed8('0x2')]},'mohsuggest':{'type':Sequelize[_0x0ed8('0x2')]},'parkinglot':{'type':Sequelize[_0x0ed8('0x2')]},'description':{'type':Sequelize[_0x0ed8('0x2')]},'host':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':_0x0ed8('0x30')},'canreinvite':{'type':Sequelize['ENUM'](_0x0ed8('0x19'),'no',_0x0ed8('0x1a'),_0x0ed8('0x1b'),_0x0ed8('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x0ed8('0x2')]},'active':{'type':Sequelize[_0x0ed8('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0ed8('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xe986=['allow','ulaw;alaw;gsm','split','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','ENUM','friend','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x523a60,_0x98c8de){var _0x5b6cd8=function(_0x2f6709){while(--_0x2f6709){_0x523a60['push'](_0x523a60['shift']());}};_0x5b6cd8(++_0x98c8de);}(_0xe986,0x184));var _0x6e98=function(_0x274360,_0x16159d){_0x274360=_0x274360-0x0;var _0x403653=_0xe986[_0x274360];return _0x403653;};'use strict';var Sequelize=require(_0x6e98('0x0'));module[_0x6e98('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x3'),'user',_0x6e98('0x4')),'allowNull':![],'defaultValue':_0x6e98('0x3')},'context':{'type':Sequelize[_0x6e98('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x6e98('0x2')]('ALLOWED_NOT_SCREENED',_0x6e98('0x6'),_0x6e98('0x7'),_0x6e98('0x8'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x6e98('0x9'),'PROHIB')},'deny':{'type':Sequelize[_0x6e98('0x5')]},'permit':{'type':Sequelize[_0x6e98('0x5')]},'secret':{'type':Sequelize[_0x6e98('0x5')]},'md5secret':{'type':Sequelize[_0x6e98('0x5')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x6e98('0xa'),'set':function(_0x14965a){this[_0x6e98('0xb')]('transport',_0x14965a?_0x14965a[_0x6e98('0xc')](','):null);},'get':function(){return this[_0x6e98('0xd')](_0x6e98('0xe'))?this[_0x6e98('0xd')]('transport')['split'](','):null;},'comment':_0x6e98('0xf')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x6e98('0x10'),_0x6e98('0x11'),_0x6e98('0x12')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no',_0x6e98('0x14'),_0x6e98('0x15'),_0x6e98('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e98('0x5')]},'directmediadeny':{'type':Sequelize[_0x6e98('0x5')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x6e98('0x17'),'set':function(_0x1e2d4b){this[_0x6e98('0xb')](_0x6e98('0x18'),_0x1e2d4b?_0x1e2d4b[_0x6e98('0xc')](','):null);},'get':function(){return this[_0x6e98('0xd')](_0x6e98('0x18'))?this[_0x6e98('0xd')]('nat')['split'](','):null;},'comment':_0x6e98('0x19')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x6e98('0x5')]},'pickupgroup':{'type':Sequelize[_0x6e98('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x6e98('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x6e98('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x45272e){this[_0x6e98('0xb')](_0x6e98('0x1a'),_0x45272e?_0x45272e[_0x6e98('0xc')](';'):_0x6e98('0x1b'));},'get':function(){return this['getDataValue'](_0x6e98('0x1a'))?this['getDataValue'](_0x6e98('0x1a'))[_0x6e98('0x1c')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'insecure':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':_0x6e98('0x1d'),'set':function(_0xf8a879){this['setDataValue'](_0x6e98('0x1e'),_0xf8a879?_0xf8a879['join'](','):null);},'get':function(){return this['getDataValue'](_0x6e98('0x1e'))?this[_0x6e98('0xd')](_0x6e98('0x1e'))['split'](','):null;},'comment':_0x6e98('0x1f')},'trustrpid':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e98('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e98('0x2')]('yes','no',_0x6e98('0x20'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x6e98('0x5')]},'callerid':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':_0x6e98('0x21')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x6e98('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x6e98('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x6e98('0x2')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e98('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'mailbox':{'type':Sequelize[_0x6e98('0x5')]},'session_timers':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x23'),_0x6e98('0x24'),_0x6e98('0x25'))},'session_expires':{'type':Sequelize[_0x6e98('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x6e98('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x26'),_0x6e98('0x27')),'defaultValue':_0x6e98('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x6e98('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x6e98('0x5')]},'fromuser':{'type':Sequelize[_0x6e98('0x5')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x6e98('0x5')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6e98('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6e98('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e98('0x5')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x6e98('0x22')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x6e98('0x22')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x6e98('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x6e98('0x5')]},'use_q850_reason':{'type':Sequelize[_0x6e98('0x5')]},'maxforwards':{'type':Sequelize[_0x6e98('0x22')](0xb)},'encryption':{'type':Sequelize[_0x6e98('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'force_avp':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'icesupport':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no',_0x6e98('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x6e98('0x22')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x6e98('0x5')]},'dtlscipher':{'type':Sequelize[_0x6e98('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x6e98('0x5')]},'dtlssetup':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x29'),_0x6e98('0x2a'),_0x6e98('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e98('0x5')]},'usereqphone':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e98('0x5')]},'recordofffeature':{'type':Sequelize[_0x6e98('0x5')]},'call_limit':{'type':Sequelize[_0x6e98('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x6e98('0x13'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x6e98('0x5')]},'mohinterpret':{'type':Sequelize[_0x6e98('0x5')]},'mohsuggest':{'type':Sequelize[_0x6e98('0x5')]},'parkinglot':{'type':Sequelize[_0x6e98('0x5')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x6e98('0x13'),'no',_0x6e98('0x14'),'update',_0x6e98('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6e98('0x5')]},'otherFields':{'type':Sequelize[_0x6e98('0x5')]},'active':{'type':Sequelize[_0x6e98('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6e98('0x5')],'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 bf436b5..2183921 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 _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0xe5b3,0x133));var _0x3e5b=function(_0x377949,_0x24acce){_0x377949=_0x377949-0x0;var _0xbcaa4d=_0xe5b3[_0x377949];return _0xbcaa4d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file +var _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 94f5480..7c02659 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 _0x7d2d=['./trunk.attributes','exports','util','api','bluebird','path','rimraf','../../config/environment'];(function(_0x1da436,_0x2fab9d){var _0xe4468d=function(_0x7d74bd){while(--_0x7d74bd){_0x1da436['push'](_0x1da436['shift']());}};_0xe4468d(++_0x2fab9d);}(_0x7d2d,0x10a));var _0xd7d2=function(_0x596bc4,_0x774b74){_0x596bc4=_0x596bc4-0x0;var _0x499b9a=_0x7d2d[_0x596bc4];return _0x499b9a;};'use strict';var _=require('lodash');var util=require(_0xd7d2('0x0'));var logger=require('../../config/logger')(_0xd7d2('0x1'));var moment=require('moment');var BPromise=require(_0xd7d2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7d2('0x3'));var rimraf=require(_0xd7d2('0x4'));var config=require(_0xd7d2('0x5'));var attributes=require(_0xd7d2('0x6'));module[_0xd7d2('0x7')]=function(_0x2e1ca1,_0x412fc1){return _0x2e1ca1['define']('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ffb=['path','rimraf','../../config/environment','./trunk.attributes','exports','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x7c6894,_0x411905){var _0x5431d3=function(_0x9d9b12){while(--_0x9d9b12){_0x7c6894['push'](_0x7c6894['shift']());}};_0x5431d3(++_0x411905);}(_0x8ffb,0x18c));var _0xb8ff=function(_0x908598,_0x4dc0c4){_0x908598=_0x908598-0x0;var _0x202e00=_0x8ffb[_0x908598];return _0x202e00;};'use strict';var _=require(_0xb8ff('0x0'));var util=require(_0xb8ff('0x1'));var logger=require(_0xb8ff('0x2'))(_0xb8ff('0x3'));var moment=require(_0xb8ff('0x4'));var BPromise=require(_0xb8ff('0x5'));var rp=require(_0xb8ff('0x6'));var fs=require('fs');var path=require(_0xb8ff('0x7'));var rimraf=require(_0xb8ff('0x8'));var config=require(_0xb8ff('0x9'));var attributes=require(_0xb8ff('0xa'));module[_0xb8ff('0xb')]=function(_0x1b9500,_0x4ac956){return _0x1b9500['define']('Trunk',attributes,{'tableName':_0xb8ff('0xc'),'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 3bc500c..880b3ac 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 _0xe381=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','model','map','debug','raw','ShowTrunk','lodash','util'];(function(_0x1b45c8,_0x5b9f32){var _0x76f48e=function(_0x927282){while(--_0x927282){_0x1b45c8['push'](_0x1b45c8['shift']());}};_0x76f48e(++_0x5b9f32);}(_0xe381,0x142));var _0x1e38=function(_0x38a6c6,_0x4062ca){_0x38a6c6=_0x38a6c6-0x0;var _0x142f0a=_0xe381[_0x38a6c6];return _0x142f0a;};'use strict';var _=require(_0x1e38('0x0'));var util=require(_0x1e38('0x1'));var moment=require('moment');var BPromise=require(_0x1e38('0x2'));var rs=require(_0x1e38('0x3'));var fs=require('fs');var Redis=require(_0x1e38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1e38('0x5'));var logger=require(_0x1e38('0x6'))(_0x1e38('0x7'));var config=require(_0x1e38('0x8'));var jayson=require(_0x1e38('0x9'));var client=jayson[_0x1e38('0xa')][_0x1e38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb3b375,_0x5e9465,_0x58615f){return new BPromise(function(_0x29cd13,_0x2583f5){return client[_0x1e38('0xc')](_0xb3b375,_0x58615f)[_0x1e38('0xd')](function(_0x154e93){logger[_0x1e38('0xe')]('Trunk,\x20%s,\x20%s',_0x5e9465,_0x1e38('0xf'));logger['debug'](_0x1e38('0x10'),_0x5e9465,'request\x20sent',JSON[_0x1e38('0x11')](_0x154e93));if(_0x154e93['error']){if(_0x154e93[_0x1e38('0x12')][_0x1e38('0x13')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x5e9465,_0x154e93[_0x1e38('0x12')]['message']);return _0x2583f5(_0x154e93[_0x1e38('0x12')][_0x1e38('0x14')]);}logger[_0x1e38('0x12')](_0x1e38('0x15'),_0x5e9465,_0x154e93[_0x1e38('0x12')][_0x1e38('0x14')]);return _0x29cd13(_0x154e93[_0x1e38('0x12')][_0x1e38('0x14')]);}else{logger[_0x1e38('0xe')](_0x1e38('0x15'),_0x5e9465,_0x1e38('0xf'));_0x29cd13(_0x154e93['result']['message']);}})[_0x1e38('0x16')](function(_0x2ab854){logger['error'](_0x1e38('0x15'),_0x5e9465,_0x2ab854);_0x2583f5(_0x2ab854);});});}exports[_0x1e38('0x17')]=function(_0x56d123){var _0x2dc534=this;return new Promise(function(_0xad5ff4,_0x104b01){return db[_0x1e38('0x18')][_0x1e38('0x19')]({'raw':_0x56d123[_0x1e38('0x1a')]?_0x56d123[_0x1e38('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x56d123['options']?_0x56d123['options'][_0x1e38('0x1b')]||null:null,'attributes':_0x56d123[_0x1e38('0x1a')]?_0x56d123[_0x1e38('0x1a')][_0x1e38('0x1c')]||null:null,'limit':_0x56d123[_0x1e38('0x1a')]?_0x56d123['options'][_0x1e38('0x1d')]||null:null,'include':_0x56d123[_0x1e38('0x1a')]?_0x56d123[_0x1e38('0x1a')][_0x1e38('0x1e')]?_['map'](_0x56d123[_0x1e38('0x1a')][_0x1e38('0x1e')],function(_0x4929bb){return{'model':db[_0x4929bb[_0x1e38('0x1f')]],'as':_0x4929bb['as'],'attributes':_0x4929bb['attributes'],'include':_0x4929bb[_0x1e38('0x1e')]?_[_0x1e38('0x20')](_0x4929bb[_0x1e38('0x1e')],function(_0x42b23d){return{'model':db[_0x42b23d[_0x1e38('0x1f')]],'as':_0x42b23d['as'],'attributes':_0x42b23d['attributes'],'include':_0x42b23d[_0x1e38('0x1e')]?_[_0x1e38('0x20')](_0x42b23d['include'],function(_0x32836d){return{'model':db[_0x32836d[_0x1e38('0x1f')]],'as':_0x32836d['as'],'attributes':_0x32836d[_0x1e38('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e38('0xd')](function(_0x513c3b){logger[_0x1e38('0xe')]('GetTrunk',_0x56d123);logger[_0x1e38('0x21')](_0x1e38('0x17'),_0x56d123,JSON[_0x1e38('0x11')](_0x513c3b));_0xad5ff4(_0x513c3b);})[_0x1e38('0x16')](function(_0x4a60f0){logger[_0x1e38('0x12')](_0x1e38('0x17'),_0x4a60f0['message'],_0x56d123);_0x104b01(_0x2dc534[_0x1e38('0x12')](0x1f4,_0x4a60f0[_0x1e38('0x14')]));});});};exports['ShowTrunk']=function(_0x5c9afa){var _0x4ac849=this;return new Promise(function(_0xba1341,_0x3e855d){return db[_0x1e38('0x18')]['find']({'raw':_0x5c9afa['options']?_0x5c9afa[_0x1e38('0x1a')][_0x1e38('0x22')]===undefined?!![]:![]:!![],'where':_0x5c9afa[_0x1e38('0x1a')]?_0x5c9afa[_0x1e38('0x1a')]['where']||null:null,'attributes':_0x5c9afa[_0x1e38('0x1a')]?_0x5c9afa[_0x1e38('0x1a')]['attributes']||null:null,'include':_0x5c9afa['options']?_0x5c9afa[_0x1e38('0x1a')]['include']?_[_0x1e38('0x20')](_0x5c9afa[_0x1e38('0x1a')][_0x1e38('0x1e')],function(_0x3ccc55){return{'model':db[_0x3ccc55[_0x1e38('0x1f')]],'as':_0x3ccc55['as'],'attributes':_0x3ccc55[_0x1e38('0x1c')],'include':_0x3ccc55['include']?_[_0x1e38('0x20')](_0x3ccc55[_0x1e38('0x1e')],function(_0x32ae9e){return{'model':db[_0x32ae9e['model']],'as':_0x32ae9e['as'],'attributes':_0x32ae9e[_0x1e38('0x1c')],'include':_0x32ae9e[_0x1e38('0x1e')]?_[_0x1e38('0x20')](_0x32ae9e[_0x1e38('0x1e')],function(_0x3a3090){return{'model':db[_0x3a3090[_0x1e38('0x1f')]],'as':_0x3a3090['as'],'attributes':_0x3a3090[_0x1e38('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e38('0xd')](function(_0x626f41){logger[_0x1e38('0xe')](_0x1e38('0x23'),_0x5c9afa);logger[_0x1e38('0x21')](_0x1e38('0x23'),_0x5c9afa,JSON[_0x1e38('0x11')](_0x626f41));_0xba1341(_0x626f41);})[_0x1e38('0x16')](function(_0x161087){logger[_0x1e38('0x12')]('ShowTrunk',_0x161087[_0x1e38('0x14')],_0x5c9afa);_0x3e855d(_0x4ac849[_0x1e38('0x12')](0x1f4,_0x161087['message']));});});}; \ No newline at end of file +var _0xbde1=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','catch','ShowTrunk','find'];(function(_0x990749,_0x325cbd){var _0x43de5a=function(_0x48b8c0){while(--_0x48b8c0){_0x990749['push'](_0x990749['shift']());}};_0x43de5a(++_0x325cbd);}(_0xbde1,0x6f));var _0x1bde=function(_0x3a8c32,_0x4b025b){_0x3a8c32=_0x3a8c32-0x0;var _0x2119f0=_0xbde1[_0x3a8c32];return _0x2119f0;};'use strict';var _=require('lodash');var util=require(_0x1bde('0x0'));var moment=require(_0x1bde('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bde('0x2'));var db=require(_0x1bde('0x3'))['db'];var utils=require(_0x1bde('0x4'));var logger=require(_0x1bde('0x5'))(_0x1bde('0x6'));var config=require(_0x1bde('0x7'));var jayson=require(_0x1bde('0x8'));var client=jayson[_0x1bde('0x9')][_0x1bde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47eb1b,_0x4b1cef,_0x50f779){return new BPromise(function(_0x3ef4ff,_0x8ca13d){return client[_0x1bde('0xb')](_0x47eb1b,_0x50f779)[_0x1bde('0xc')](function(_0x23d38b){logger['info'](_0x1bde('0xd'),_0x4b1cef,_0x1bde('0xe'));logger['debug'](_0x1bde('0xf'),_0x4b1cef,'request\x20sent',JSON[_0x1bde('0x10')](_0x23d38b));if(_0x23d38b[_0x1bde('0x11')]){if(_0x23d38b[_0x1bde('0x11')][_0x1bde('0x12')]===0x1f4){logger[_0x1bde('0x11')](_0x1bde('0xd'),_0x4b1cef,_0x23d38b[_0x1bde('0x11')][_0x1bde('0x13')]);return _0x8ca13d(_0x23d38b[_0x1bde('0x11')][_0x1bde('0x13')]);}logger[_0x1bde('0x11')](_0x1bde('0xd'),_0x4b1cef,_0x23d38b[_0x1bde('0x11')]['message']);return _0x3ef4ff(_0x23d38b[_0x1bde('0x11')]['message']);}else{logger['info'](_0x1bde('0xd'),_0x4b1cef,_0x1bde('0xe'));_0x3ef4ff(_0x23d38b[_0x1bde('0x14')]['message']);}})['catch'](function(_0x169f82){logger[_0x1bde('0x11')](_0x1bde('0xd'),_0x4b1cef,_0x169f82);_0x8ca13d(_0x169f82);});});}exports[_0x1bde('0x15')]=function(_0x34ce31){var _0x324073=this;return new Promise(function(_0x1fadaf,_0x328031){return db[_0x1bde('0x16')][_0x1bde('0x17')]({'raw':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x19')]===undefined?!![]:![]:!![],'where':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1a')]||null:null,'attributes':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1b')]||null:null,'limit':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1c')]||null:null,'include':_0x34ce31['options']?_0x34ce31['options'][_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1d')],function(_0x4198aa){return{'model':db[_0x4198aa['model']],'as':_0x4198aa['as'],'attributes':_0x4198aa[_0x1bde('0x1b')],'include':_0x4198aa[_0x1bde('0x1d')]?_['map'](_0x4198aa[_0x1bde('0x1d')],function(_0x160ffc){return{'model':db[_0x160ffc['model']],'as':_0x160ffc['as'],'attributes':_0x160ffc[_0x1bde('0x1b')],'include':_0x160ffc[_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x160ffc[_0x1bde('0x1d')],function(_0x525d5e){return{'model':db[_0x525d5e[_0x1bde('0x1f')]],'as':_0x525d5e['as'],'attributes':_0x525d5e[_0x1bde('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1bde('0xc')](function(_0x5744d9){logger[_0x1bde('0x20')](_0x1bde('0x15'),_0x34ce31);logger[_0x1bde('0x21')](_0x1bde('0x15'),_0x34ce31,JSON['stringify'](_0x5744d9));_0x1fadaf(_0x5744d9);})[_0x1bde('0x22')](function(_0x3bb6e1){logger[_0x1bde('0x11')](_0x1bde('0x15'),_0x3bb6e1[_0x1bde('0x13')],_0x34ce31);_0x328031(_0x324073[_0x1bde('0x11')](0x1f4,_0x3bb6e1[_0x1bde('0x13')]));});});};exports[_0x1bde('0x23')]=function(_0x477612){var _0x904cfe=this;return new Promise(function(_0x54962f,_0x34c6f7){return db[_0x1bde('0x16')][_0x1bde('0x24')]({'raw':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')][_0x1bde('0x1a')]||null:null,'attributes':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')][_0x1bde('0x1b')]||null:null,'include':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')][_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x477612[_0x1bde('0x18')]['include'],function(_0x352a85){return{'model':db[_0x352a85[_0x1bde('0x1f')]],'as':_0x352a85['as'],'attributes':_0x352a85['attributes'],'include':_0x352a85['include']?_['map'](_0x352a85[_0x1bde('0x1d')],function(_0x486f53){return{'model':db[_0x486f53['model']],'as':_0x486f53['as'],'attributes':_0x486f53[_0x1bde('0x1b')],'include':_0x486f53[_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x486f53['include'],function(_0x4f4a0b){return{'model':db[_0x4f4a0b[_0x1bde('0x1f')]],'as':_0x4f4a0b['as'],'attributes':_0x4f4a0b[_0x1bde('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1bde('0xc')](function(_0x237006){logger[_0x1bde('0x20')]('ShowTrunk',_0x477612);logger['debug'](_0x1bde('0x23'),_0x477612,JSON[_0x1bde('0x10')](_0x237006));_0x54962f(_0x237006);})['catch'](function(_0x1e94ad){logger[_0x1bde('0x11')](_0x1bde('0x23'),_0x1e94ad[_0x1bde('0x13')],_0x477612);_0x34c6f7(_0x904cfe[_0x1bde('0x11')](0x1f4,_0x1e94ad['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 377d71a..6dc2cb8 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 _0xa5c7=['../../components/auth/service','put','/:id','isAuthenticated','update','exports','Router'];(function(_0x5c65f7,_0x1c5cc3){var _0x1f2990=function(_0x205d12){while(--_0x205d12){_0x5c65f7['push'](_0x5c65f7['shift']());}};_0x1f2990(++_0x1c5cc3);}(_0xa5c7,0x16b));var _0x7a5c=function(_0xec7277,_0x292391){_0xec7277=_0xec7277-0x0;var _0x51f23c=_0xa5c7[_0xec7277];return _0x51f23c;};'use strict';var express=require('express');var router=express[_0x7a5c('0x0')]();var auth=require(_0x7a5c('0x1'));var controller=require('./user-setting.controller');router[_0x7a5c('0x2')](_0x7a5c('0x3'),auth[_0x7a5c('0x4')](),controller[_0x7a5c('0x5')]);module[_0x7a5c('0x6')]=router; \ No newline at end of file +var _0xd4dc=['express','Router','put','update'];(function(_0xe9fc75,_0x301b64){var _0x482b79=function(_0x842fc6){while(--_0x842fc6){_0xe9fc75['push'](_0xe9fc75['shift']());}};_0x482b79(++_0x301b64);}(_0xd4dc,0x194));var _0xcd4d=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xd4dc[_0x39e84d];return _0x1991bc;};'use strict';var express=require(_0xcd4d('0x0'));var router=express[_0xcd4d('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0xcd4d('0x2')]('/:id',auth['isAuthenticated'](),controller[_0xcd4d('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index ee5be80..eac36c8 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 _0xb63c=['info','debug','exports','ENUM','BOOLEAN','error','warning'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0xb63c,0x1e8));var _0xcb63=function(_0x49e96a,_0x5305a0){_0x49e96a=_0x49e96a-0x0;var _0x36a29c=_0xb63c[_0x49e96a];return _0x36a29c;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xcb63('0x0'),_0xcb63('0x1'),_0xcb63('0x2'),_0xcb63('0x3')];module[_0xcb63('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xcb63('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xcb63('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xcb63('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x2ff4=['exports','ENUM','DATE','INTEGER','UserId','error','warning','debug'];(function(_0x513297,_0x251087){var _0x1bca1f=function(_0x560ab0){while(--_0x560ab0){_0x513297['push'](_0x513297['shift']());}};_0x1bca1f(++_0x251087);}(_0x2ff4,0x65));var _0x42ff=function(_0x4ce260,_0x2a5e2d){_0x4ce260=_0x4ce260-0x0;var _0x110812=_0x2ff4[_0x4ce260];return _0x110812;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x42ff('0x0'),_0x42ff('0x1'),'info',_0x42ff('0x2')];module[_0x42ff('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x42ff('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x42ff('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x42ff('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x42ff('0x6')],'unique':_0x42ff('0x7')}}; \ 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 c9003fe..c5770f3 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 _0x851e=['Unauthorized','params','find','body','lodash','ioredis','../../config/logger','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','update','then','sendStatus','stack','name','user','admin'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x851e,0x1e8));var _0xe851=function(_0xe957e3,_0x2f333e){_0xe957e3=_0xe957e3-0x0;var _0x21e397=_0x851e[_0xe957e3];return _0x21e397;};'use strict';var _=require(_0xe851('0x0'));var Redis=require(_0xe851('0x1'));var logger=require(_0xe851('0x2'))('api');var config=require('../../config/environment');var db=require(_0xe851('0x3'))['db'];var socket=require(_0xe851('0x4'))(new Redis(config[_0xe851('0x5')]));require(_0xe851('0x6'))[_0xe851('0x7')](socket);config['redis']=_[_0xe851('0x8')](config[_0xe851('0x5')],{'host':_0xe851('0x9'),'port':0x18eb});function respondWithResult(_0x37ac0b,_0x1a2b24){_0x1a2b24=_0x1a2b24||0xc8;return function(_0x4e1c59){if(_0x4e1c59){return _0x37ac0b[_0xe851('0xa')](_0x1a2b24)['json'](_0x4e1c59);}};}function saveUpdates(_0x570514){return function(_0x111ba8){if(_0x111ba8){return _0x111ba8[_0xe851('0xb')](_0x570514)[_0xe851('0xc')](function(_0xe0cb8d){return _0xe0cb8d;});}return null;};}function handleEntityNotFound(_0x4e5eca){return function(_0x3325f5){if(!_0x3325f5){_0x4e5eca[_0xe851('0xd')](0x194);}return _0x3325f5;};}function handleError(_0x3d373c,_0x4e360f){_0x4e360f=_0x4e360f||0x1f4;return function(_0xeedf07){logger['error'](_0xeedf07[_0xe851('0xe')]);if(_0xeedf07[_0xe851('0xf')]){delete _0xeedf07['name'];}_0x3d373c[_0xe851('0xa')](_0x4e360f)['send'](_0xeedf07);};}exports[_0xe851('0xb')]=function(_0x48671c,_0x3e5b19){if(_0x48671c[_0xe851('0x10')]['role']!==_0xe851('0x11'))throw new Error(_0xe851('0x12'));if(isNaN(Number(_0x48671c[_0xe851('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0xe851('0x14')]({'where':{'id':_0x48671c[_0xe851('0x13')]['id']}})[_0xe851('0xc')](handleEntityNotFound(_0x3e5b19,null))[_0xe851('0xc')](saveUpdates(_0x48671c[_0xe851('0x15')],null))[_0xe851('0xc')](respondWithResult(_0x3e5b19,null))['catch'](handleError(_0x3e5b19,null));}; \ No newline at end of file +var _0xce9b=['body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','json','update','then','sendStatus','error','stack','name','status','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0xce9b,0xc6));var _0xbce9=function(_0x54f96d,_0x237631){_0x54f96d=_0x54f96d-0x0;var _0x587bfb=_0xce9b[_0x54f96d];return _0x587bfb;};'use strict';var _=require(_0xbce9('0x0'));var Redis=require(_0xbce9('0x1'));var logger=require(_0xbce9('0x2'))(_0xbce9('0x3'));var config=require(_0xbce9('0x4'));var db=require(_0xbce9('0x5'))['db'];var socket=require(_0xbce9('0x6'))(new Redis(config[_0xbce9('0x7')]));require('./user-setting.socket')[_0xbce9('0x8')](socket);config[_0xbce9('0x7')]=_[_0xbce9('0x9')](config[_0xbce9('0x7')],{'host':_0xbce9('0xa'),'port':0x18eb});function respondWithResult(_0x2c336a,_0x10a645){_0x10a645=_0x10a645||0xc8;return function(_0x562634){if(_0x562634){return _0x2c336a['status'](_0x10a645)[_0xbce9('0xb')](_0x562634);}};}function saveUpdates(_0x1d9a99){return function(_0x5a5542){if(_0x5a5542){return _0x5a5542[_0xbce9('0xc')](_0x1d9a99)[_0xbce9('0xd')](function(_0x572128){return _0x572128;});}return null;};}function handleEntityNotFound(_0x5b766a){return function(_0x2073ea){if(!_0x2073ea){_0x5b766a[_0xbce9('0xe')](0x194);}return _0x2073ea;};}function handleError(_0x1b980c,_0x4dc9a9){_0x4dc9a9=_0x4dc9a9||0x1f4;return function(_0x48a272){logger[_0xbce9('0xf')](_0x48a272[_0xbce9('0x10')]);if(_0x48a272[_0xbce9('0x11')]){delete _0x48a272[_0xbce9('0x11')];}_0x1b980c[_0xbce9('0x12')](_0x4dc9a9)[_0xbce9('0x13')](_0x48a272);};}exports[_0xbce9('0xc')]=function(_0x540886,_0xa6903c){if(_0x540886[_0xbce9('0x14')]['role']!==_0xbce9('0x15'))throw new Error(_0xbce9('0x16'));if(isNaN(Number(_0x540886[_0xbce9('0x17')]['id'])))throw new Error(_0xbce9('0x18'));return db[_0xbce9('0x19')]['find']({'where':{'id':_0x540886[_0xbce9('0x17')]['id']}})[_0xbce9('0xd')](handleEntityNotFound(_0xa6903c,null))[_0xbce9('0xd')](saveUpdates(_0x540886[_0xbce9('0x1a')],null))[_0xbce9('0xd')](respondWithResult(_0xa6903c,null))[_0xbce9('0x1b')](handleError(_0xa6903c,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 7c46585..4cf8443 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 _0x542f=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x10f859,_0x190513){var _0x39e46e=function(_0x10e765){while(--_0x10e765){_0x10f859['push'](_0x10f859['shift']());}};_0x39e46e(++_0x190513);}(_0x542f,0x15f));var _0xf542=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0x542f[_0x265003];return _0x33c743;};'use strict';var EventEmitter=require(_0xf542('0x0'));var UserSetting=require(_0xf542('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xf542('0x2')](0x0);var events={'afterCreate':_0xf542('0x3'),'afterUpdate':_0xf542('0x4'),'afterDestroy':_0xf542('0x5')};function emitEvent(_0x3ebb1d){return function(_0x13b6ef,_0x5e6f3b,_0x478c3a){UserSettingEvents['emit'](_0x3ebb1d+':'+_0x13b6ef['id'],_0x13b6ef);UserSettingEvents[_0xf542('0x6')](_0x3ebb1d,_0x13b6ef);_0x478c3a(null);};}for(var e in events){if(events[_0xf542('0x7')](e)){var event=events[e];UserSetting[_0xf542('0x8')](e,emitEvent(event));}}module[_0xf542('0x9')]=UserSettingEvents; \ No newline at end of file +var _0x29d2=['hasOwnProperty','hook','events','UserSetting','setMaxListeners','update','remove','emit'];(function(_0x6e0ac3,_0xb0ad99){var _0x381be3=function(_0x1358a3){while(--_0x1358a3){_0x6e0ac3['push'](_0x6e0ac3['shift']());}};_0x381be3(++_0xb0ad99);}(_0x29d2,0xb2));var _0x229d=function(_0x2de2f8,_0x371b7d){_0x2de2f8=_0x2de2f8-0x0;var _0x535508=_0x29d2[_0x2de2f8];return _0x535508;};'use strict';var EventEmitter=require(_0x229d('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x229d('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x229d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x229d('0x3'),'afterDestroy':_0x229d('0x4')};function emitEvent(_0x2561e4){return function(_0x27a55a,_0x517b5f,_0x3f7549){UserSettingEvents[_0x229d('0x5')](_0x2561e4+':'+_0x27a55a['id'],_0x27a55a);UserSettingEvents[_0x229d('0x5')](_0x2561e4,_0x27a55a);_0x3f7549(null);};}for(var e in events){if(events[_0x229d('0x6')](e)){var event=events[e];UserSetting[_0x229d('0x7')](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 822e15b..bca2074 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 _0x0c1a=['./user-setting.attributes','exports','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x58f3e0,_0x52da28){var _0x5255dc=function(_0x548cd6){while(--_0x548cd6){_0x58f3e0['push'](_0x58f3e0['shift']());}};_0x5255dc(++_0x52da28);}(_0x0c1a,0x127));var _0xa0c1=function(_0x1bc028,_0xb6ae8b){_0x1bc028=_0x1bc028-0x0;var _0x497376=_0x0c1a[_0x1bc028];return _0x497376;};'use strict';var attributes=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]=function(_0x403058){return _0x403058['define']('UserSetting',attributes,{'tableName':_0xa0c1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d4cdc){if(!_0x4d4cdc[_0xa0c1('0x3')])_0x4d4cdc[_0xa0c1('0x4')]=null;else if(_0x4d4cdc[_0xa0c1('0x4')]===null)_0x4d4cdc[_0xa0c1('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x6ea9=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x10b95d,_0x1fd349){var _0x174cde=function(_0xebfe08){while(--_0xebfe08){_0x10b95d['push'](_0x10b95d['shift']());}};_0x174cde(++_0x1fd349);}(_0x6ea9,0x89));var _0x96ea=function(_0x59cb38,_0x55c699){_0x59cb38=_0x59cb38-0x0;var _0x2d2e07=_0x6ea9[_0x59cb38];return _0x2d2e07;};'use strict';var attributes=require(_0x96ea('0x0'));module[_0x96ea('0x1')]=function(_0x27c316){return _0x27c316[_0x96ea('0x2')](_0x96ea('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fb6c1){if(!_0x1fb6c1[_0x96ea('0x4')])_0x1fb6c1[_0x96ea('0x5')]=null;else if(_0x1fb6c1['clientSideLoggingEnabledSince']===null)_0x1fb6c1[_0x96ea('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index cd85030..3d37e31 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 _0x464a=['remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x464a,0x127));var _0xa464=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x464a[_0x19e35c];return _0x3e1fe8;};'use strict';var UserSettingEvents=require(_0xa464('0x0'));var events=[_0xa464('0x1'),_0xa464('0x2'),_0xa464('0x3')];function createListener(_0x5bcd5f,_0x4ffb6b){return function(_0x38353f){_0x4ffb6b[_0xa464('0x4')](_0x5bcd5f,_0x38353f);if(_0x5bcd5f===_0xa464('0x5')){_0x4ffb6b[_0xa464('0x4')](_0xa464('0x6')+_0x38353f[_0xa464('0x7')],_0x38353f);}};}exports[_0xa464('0x8')]=function(_0x46894a){for(var _0x1ab664=0x0,_0x495130=events[_0xa464('0x9')];_0x1ab664<_0x495130;_0x1ab664++){var _0x4c6959=events[_0x1ab664];var _0x213ea7=createListener(_0xa464('0xa')+_0x4c6959,_0x46894a);UserSettingEvents['on'](_0x4c6959,_0x213ea7);}}; \ No newline at end of file +var _0x8b2a=['./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:'];(function(_0x231bf2,_0x41bc52){var _0x3b99cf=function(_0x421814){while(--_0x421814){_0x231bf2['push'](_0x231bf2['shift']());}};_0x3b99cf(++_0x41bc52);}(_0x8b2a,0x1ce));var _0xa8b2=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x8b2a[_0x59c301];return _0x3866b9;};'use strict';var UserSettingEvents=require(_0xa8b2('0x0'));var events=[_0xa8b2('0x1'),_0xa8b2('0x2'),_0xa8b2('0x3')];function createListener(_0x428bc0,_0x2593d2){return function(_0x382a1f){_0x2593d2[_0xa8b2('0x4')](_0x428bc0,_0x382a1f);if(_0x428bc0===_0xa8b2('0x5')){_0x2593d2['emit'](_0xa8b2('0x6')+_0x382a1f[_0xa8b2('0x7')],_0x382a1f);}};}exports[_0xa8b2('0x8')]=function(_0x48ca0e){for(var _0x47b780=0x0,_0x69f91c=events[_0xa8b2('0x9')];_0x47b780<_0x69f91c;_0x47b780++){var _0x2aa57e=events[_0x47b780];var _0x5e7c95=createListener(_0xa8b2('0xa')+_0x2aa57e,_0x48ca0e);UserSettingEvents['on'](_0x2aa57e,_0x5e7c95);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c170924..e32bdf0 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 _0x4358=['addSmsAccounts','addChatWebsites','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/whoami','/presence','getPresence','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','addContacts','post','create','/create_many','bulkCreate','diskStorage','join','root','now','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts'];(function(_0x594534,_0x1e7f87){var _0x1ad7bf=function(_0x45f5e7){while(--_0x45f5e7){_0x594534['push'](_0x594534['shift']());}};_0x1ad7bf(++_0x1e7f87);}(_0x4358,0xf4));var _0x8435=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x4358[_0x4a53d];return _0x27410e;};'use strict';var multer=require('multer');var util=require(_0x8435('0x0'));var path=require(_0x8435('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8435('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8435('0x3'));var config=require(_0x8435('0x4'));var controller=require(_0x8435('0x5'));router[_0x8435('0x6')]('/',auth[_0x8435('0x7')](),controller['index']);router[_0x8435('0x6')]('/describe',auth[_0x8435('0x7')](),controller['describe']);router[_0x8435('0x6')](_0x8435('0x8'),auth[_0x8435('0x7')](),controller['whoami']);router[_0x8435('0x6')](_0x8435('0x9'),auth[_0x8435('0x7')](),controller[_0x8435('0xa')]);router[_0x8435('0x6')](_0x8435('0xb'),auth[_0x8435('0x7')](),controller['show']);router[_0x8435('0x6')](_0x8435('0xc'),controller['getAvatar']);router['get'](_0x8435('0xd'),auth['isAuthenticated'](),controller[_0x8435('0xe')]);router['get'](_0x8435('0xf'),auth[_0x8435('0x7')](),controller[_0x8435('0x10')]);router[_0x8435('0x6')](_0x8435('0x11'),auth[_0x8435('0x7')](),controller['getQueues']);router[_0x8435('0x6')](_0x8435('0x12'),auth[_0x8435('0x7')](),controller[_0x8435('0x13')]);router[_0x8435('0x6')](_0x8435('0x14'),auth[_0x8435('0x7')](),controller['getGroups']);router['get'](_0x8435('0x15'),auth[_0x8435('0x7')](),controller['getRecordings']);router[_0x8435('0x6')](_0x8435('0x16'),auth[_0x8435('0x7')](),controller['getScreenRecordings']);router[_0x8435('0x6')](_0x8435('0x17'),auth[_0x8435('0x7')](),controller[_0x8435('0x18')]);router[_0x8435('0x6')]('/:id/openchannel/interactions',auth[_0x8435('0x7')](),controller[_0x8435('0x19')]);router[_0x8435('0x6')](_0x8435('0x1a'),auth[_0x8435('0x7')](),controller[_0x8435('0x1b')]);router['get'](_0x8435('0x1c'),auth[_0x8435('0x7')](),controller[_0x8435('0x1d')]);router[_0x8435('0x6')]('/:id/fax/interactions',auth[_0x8435('0x7')](),controller[_0x8435('0x1e')]);router[_0x8435('0x6')](_0x8435('0x1f'),auth[_0x8435('0x7')](),controller[_0x8435('0x20')]);router[_0x8435('0x6')]('/:id/teams',auth[_0x8435('0x7')](),controller['getTeams']);router[_0x8435('0x6')](_0x8435('0x21'),auth[_0x8435('0x7')](),controller[_0x8435('0x22')]);router['get'](_0x8435('0x23'),auth[_0x8435('0x7')](),controller[_0x8435('0x24')]);router[_0x8435('0x6')](_0x8435('0x25'),auth[_0x8435('0x7')](),controller[_0x8435('0x26')]);router[_0x8435('0x6')](_0x8435('0x27'),auth[_0x8435('0x7')](),controller[_0x8435('0x28')]);router[_0x8435('0x6')](_0x8435('0x29'),auth['isAuthenticated'](),controller[_0x8435('0x2a')]);router[_0x8435('0x6')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x8435('0x2b')]);router['get'](_0x8435('0x2c'),auth[_0x8435('0x7')](),controller[_0x8435('0x2d')]);router[_0x8435('0x6')](_0x8435('0x2e'),auth[_0x8435('0x7')](),controller[_0x8435('0x2f')]);router[_0x8435('0x6')](_0x8435('0x30'),auth['isAuthenticated'](),controller[_0x8435('0x31')]);router[_0x8435('0x6')](_0x8435('0x32'),auth[_0x8435('0x7')](),controller[_0x8435('0x33')]);router[_0x8435('0x6')](_0x8435('0x34'),auth[_0x8435('0x7')](),controller['getApiKey']);router['post'](_0x8435('0xf'),auth[_0x8435('0x7')](),controller[_0x8435('0x35')]);router[_0x8435('0x36')]('/',auth[_0x8435('0x7')](),controller[_0x8435('0x37')]);router[_0x8435('0x36')](_0x8435('0x38'),auth[_0x8435('0x7')](),controller[_0x8435('0x39')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x8435('0x3a')]({'destination':function(_0x1a047d,_0x2c8935,_0x43db52){_0x43db52(null,path[_0x8435('0x3b')](config[_0x8435('0x3c')],'server/files/images/'));},'filename':function(_0x581bd0,_0x12f664,_0x3f6274){_0x3f6274(null,util['format']('%s-%s',Date[_0x8435('0x3d')](),_0x12f664[_0x8435('0x3e')]));}})});router['post'](_0x8435('0xc'),upload[_0x8435('0x3f')]('file'),controller[_0x8435('0x40')]);router['post'](_0x8435('0x41'),auth[_0x8435('0x7')](),controller[_0x8435('0x42')]);router[_0x8435('0x36')](_0x8435('0x43'),auth[_0x8435('0x7')](),controller[_0x8435('0x44')]);router[_0x8435('0x36')]('/:id/pause',auth[_0x8435('0x7')](),controller[_0x8435('0x45')]);router[_0x8435('0x36')](_0x8435('0x46'),auth['isAuthenticated'](),controller['unpause']);router[_0x8435('0x36')](_0x8435('0x47'),auth['isAuthenticated'](),controller[_0x8435('0x48')]);router[_0x8435('0x36')](_0x8435('0x49'),auth[_0x8435('0x7')](),controller[_0x8435('0x4a')]);router[_0x8435('0x36')](_0x8435('0x4b'),auth[_0x8435('0x7')](),controller[_0x8435('0x4c')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x8435('0x4d')]);router[_0x8435('0x36')](_0x8435('0x4e'),auth[_0x8435('0x7')](),controller['addSmsInteractions']);router[_0x8435('0x36')](_0x8435('0x4f'),auth[_0x8435('0x7')](),controller[_0x8435('0x50')]);router[_0x8435('0x36')](_0x8435('0x51'),auth['isAuthenticated'](),controller[_0x8435('0x52')]);router[_0x8435('0x36')](_0x8435('0x27'),auth[_0x8435('0x7')](),controller['addFaxAccounts']);router[_0x8435('0x36')](_0x8435('0x29'),auth[_0x8435('0x7')](),controller[_0x8435('0x53')]);router[_0x8435('0x36')](_0x8435('0x54'),auth[_0x8435('0x7')](),controller[_0x8435('0x55')]);router[_0x8435('0x36')]('/:id/sms_accounts',auth[_0x8435('0x7')](),controller[_0x8435('0x56')]);router[_0x8435('0x36')](_0x8435('0x2e'),auth[_0x8435('0x7')](),controller[_0x8435('0x57')]);router['post'](_0x8435('0x30'),auth[_0x8435('0x7')](),controller['addWhatsappAccounts']);router[_0x8435('0x36')]('/:id/api_key',auth[_0x8435('0x7')](),controller['createApiKey']);router[_0x8435('0x58')](_0x8435('0xb'),auth[_0x8435('0x7')](),controller[_0x8435('0x59')]);router[_0x8435('0x58')]('/:id/password',auth[_0x8435('0x7')](),controller[_0x8435('0x5a')]);router[_0x8435('0x5b')](_0x8435('0x11'),auth[_0x8435('0x7')](),controller[_0x8435('0x5c')]);router[_0x8435('0x5b')](_0x8435('0x47'),auth['isAuthenticated'](),controller[_0x8435('0x5d')]);router[_0x8435('0x5b')](_0x8435('0xb'),auth[_0x8435('0x7')](),controller[_0x8435('0x5e')]);router[_0x8435('0x5b')](_0x8435('0x49'),auth['isAuthenticated'](),controller[_0x8435('0x5f')]);router['delete']('/:id/mail_interactions',auth[_0x8435('0x7')](),controller[_0x8435('0x60')]);router['delete'](_0x8435('0x61'),auth[_0x8435('0x7')](),controller[_0x8435('0x62')]);router[_0x8435('0x5b')](_0x8435('0x4e'),auth['isAuthenticated'](),controller[_0x8435('0x63')]);router[_0x8435('0x5b')]('/:id/openchannel_interactions',auth[_0x8435('0x7')](),controller[_0x8435('0x64')]);router[_0x8435('0x5b')](_0x8435('0x51'),auth[_0x8435('0x7')](),controller[_0x8435('0x65')]);router[_0x8435('0x5b')]('/:id/fax_accounts',auth[_0x8435('0x7')](),controller[_0x8435('0x66')]);router[_0x8435('0x5b')](_0x8435('0x29'),auth[_0x8435('0x7')](),controller[_0x8435('0x67')]);router[_0x8435('0x5b')]('/:id/openchannel_accounts',auth[_0x8435('0x7')](),controller['removeOpenchannelAccounts']);router['delete'](_0x8435('0x2c'),auth['isAuthenticated'](),controller[_0x8435('0x68')]);router[_0x8435('0x5b')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x8435('0x69')]);router[_0x8435('0x5b')](_0x8435('0x30'),auth[_0x8435('0x7')](),controller[_0x8435('0x6a')]);router[_0x8435('0x5b')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8435('0x6b')]);router['post']('/:id/messengerSoundNotification',auth[_0x8435('0x7')](),controller[_0x8435('0x6c')]);module[_0x8435('0x6d')]=router; \ No newline at end of file +var _0xb5b9=['removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/scheduled_calls','getScheduledCalls','post','create','/create_many','addQueues','diskStorage','join','format','%s-%s','now','originalname','file','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','put','update','/:id/password','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts'];(function(_0x2bd264,_0x53a5d4){var _0x3cd2e3=function(_0x125cd0){while(--_0x125cd0){_0x2bd264['push'](_0x2bd264['shift']());}};_0x3cd2e3(++_0x53a5d4);}(_0xb5b9,0x153));var _0x9b5b=function(_0x460a50,_0x14d5d0){_0x460a50=_0x460a50-0x0;var _0x5df934=_0xb5b9[_0x460a50];return _0x5df934;};'use strict';var multer=require(_0x9b5b('0x0'));var util=require(_0x9b5b('0x1'));var path=require(_0x9b5b('0x2'));var timeout=require(_0x9b5b('0x3'));var express=require(_0x9b5b('0x4'));var router=express[_0x9b5b('0x5')]();var fs_extra=require(_0x9b5b('0x6'));var auth=require(_0x9b5b('0x7'));var interaction=require(_0x9b5b('0x8'));var config=require(_0x9b5b('0x9'));var controller=require(_0x9b5b('0xa'));router['get']('/',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0xc')]);router[_0x9b5b('0xd')](_0x9b5b('0xe'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0xf')]);router[_0x9b5b('0xd')](_0x9b5b('0x10'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x11')]);router[_0x9b5b('0xd')](_0x9b5b('0x12'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x13')]);router[_0x9b5b('0xd')](_0x9b5b('0x14'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x15')]);router['get'](_0x9b5b('0x16'),controller[_0x9b5b('0x17')]);router[_0x9b5b('0xd')](_0x9b5b('0x18'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x9b5b('0xd')](_0x9b5b('0x19'),auth[_0x9b5b('0xb')](),controller['getContacts']);router['get'](_0x9b5b('0x1a'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x1b')]);router[_0x9b5b('0xd')](_0x9b5b('0x1c'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x1d')]);router['get'](_0x9b5b('0x1e'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x1f')]);router[_0x9b5b('0xd')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x9b5b('0x20')]);router[_0x9b5b('0xd')](_0x9b5b('0x21'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x22')]);router[_0x9b5b('0xd')](_0x9b5b('0x23'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x24')]);router[_0x9b5b('0xd')]('/:id/openchannel/interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x25')]);router[_0x9b5b('0xd')](_0x9b5b('0x26'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x27')]);router[_0x9b5b('0xd')](_0x9b5b('0x28'),auth[_0x9b5b('0xb')](),controller['getSmsInteractions']);router[_0x9b5b('0xd')](_0x9b5b('0x29'),auth['isAuthenticated'](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x2a')]);router[_0x9b5b('0xd')](_0x9b5b('0x2b'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x9b5b('0x2c'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x2d')]);router[_0x9b5b('0xd')]('/:id/agents',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x2e')]);router[_0x9b5b('0xd')](_0x9b5b('0x2f'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x30')]);router[_0x9b5b('0xd')]('/:id/fax_accounts',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x31')]);router[_0x9b5b('0xd')](_0x9b5b('0x32'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x33')]);router[_0x9b5b('0xd')](_0x9b5b('0x34'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x35')]);router['get'](_0x9b5b('0x36'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x37')]);router['get'](_0x9b5b('0x38'),auth[_0x9b5b('0xb')](),controller['getChatWebsites']);router[_0x9b5b('0xd')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x9b5b('0xd')](_0x9b5b('0x39'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x3a')]);router['get']('/:id/api_key',auth[_0x9b5b('0xb')](),controller['getApiKey']);router[_0x9b5b('0x3b')]('/:id/contacts',auth[_0x9b5b('0xb')](),controller['addContacts']);router[_0x9b5b('0x3b')]('/',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x3c')]);router['post'](_0x9b5b('0x3d'),auth[_0x9b5b('0xb')](),controller['bulkCreate']);router[_0x9b5b('0x3b')](_0x9b5b('0x1a'),auth['isAuthenticated'](),controller[_0x9b5b('0x3e')]);var upload=multer({'storage':multer[_0x9b5b('0x3f')]({'destination':function(_0x2f44d0,_0x59eb3d,_0x2b7380){_0x2b7380(null,path[_0x9b5b('0x40')](config['root'],'server/files/images/'));},'filename':function(_0x16ae02,_0x25837c,_0x4a589a){_0x4a589a(null,util[_0x9b5b('0x41')](_0x9b5b('0x42'),Date[_0x9b5b('0x43')](),_0x25837c[_0x9b5b('0x44')]));}})});router[_0x9b5b('0x3b')](_0x9b5b('0x16'),upload['single'](_0x9b5b('0x45')),controller['addAvatar']);router[_0x9b5b('0x3b')](_0x9b5b('0x46'),auth['isAuthenticated'](),controller[_0x9b5b('0x47')]);router[_0x9b5b('0x3b')](_0x9b5b('0x48'),auth[_0x9b5b('0xb')](),controller['logout']);router[_0x9b5b('0x3b')](_0x9b5b('0x49'),auth['isAuthenticated'](),controller[_0x9b5b('0x4a')]);router['post'](_0x9b5b('0x4b'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x4c')]);router[_0x9b5b('0x3b')](_0x9b5b('0x2b'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x4d')]);router[_0x9b5b('0x3b')]('/:id/chat_interactions',auth[_0x9b5b('0xb')](),controller['addChatInteractions']);router[_0x9b5b('0x3b')]('/:id/mail_interactions',auth[_0x9b5b('0xb')](),controller['addMailInteractions']);router[_0x9b5b('0x3b')](_0x9b5b('0x4e'),auth['isAuthenticated'](),controller[_0x9b5b('0x4f')]);router[_0x9b5b('0x3b')](_0x9b5b('0x50'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x51')]);router[_0x9b5b('0x3b')](_0x9b5b('0x52'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x53')]);router[_0x9b5b('0x3b')]('/:id/whatsapp_interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x54')]);router[_0x9b5b('0x3b')](_0x9b5b('0x55'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x56')]);router[_0x9b5b('0x3b')](_0x9b5b('0x32'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x9b5b('0x3b')](_0x9b5b('0x34'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x57')]);router['post']('/:id/sms_accounts',auth[_0x9b5b('0xb')](),controller['addSmsAccounts']);router['post'](_0x9b5b('0x38'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x58')]);router[_0x9b5b('0x3b')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x9b5b('0x59')]);router[_0x9b5b('0x3b')]('/:id/api_key',auth[_0x9b5b('0xb')](),controller['createApiKey']);router[_0x9b5b('0x5a')](_0x9b5b('0x14'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x5b')]);router[_0x9b5b('0x5a')](_0x9b5b('0x5c'),auth[_0x9b5b('0xb')](),controller['changePassword']);router[_0x9b5b('0x5d')](_0x9b5b('0x1a'),auth['isAuthenticated'](),controller[_0x9b5b('0x5e')]);router['delete'](_0x9b5b('0x2b'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x5f')]);router['delete'](_0x9b5b('0x14'),auth[_0x9b5b('0xb')](),controller['destroy']);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x9b5b('0x60')]);router[_0x9b5b('0x5d')]('/:id/mail_interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x61')]);router[_0x9b5b('0x5d')](_0x9b5b('0x4e'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x62')]);router[_0x9b5b('0x5d')](_0x9b5b('0x50'),auth['isAuthenticated'](),controller[_0x9b5b('0x63')]);router[_0x9b5b('0x5d')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x9b5b('0x64')]);router[_0x9b5b('0x5d')]('/:id/whatsapp_interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x65')]);router[_0x9b5b('0x5d')](_0x9b5b('0x55'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x66')]);router['delete'](_0x9b5b('0x32'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x67')]);router['delete'](_0x9b5b('0x34'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x68')]);router['delete'](_0x9b5b('0x36'),auth[_0x9b5b('0xb')](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x69')]);router['delete'](_0x9b5b('0x6a'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x6b')]);router[_0x9b5b('0x5d')]('/:id/api_key',auth[_0x9b5b('0xb')](),controller['removeApiKey']);router[_0x9b5b('0x3b')](_0x9b5b('0x6c'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x6d')]);module[_0x9b5b('0x6e')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index fa391f1..746b0bb 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 _0x57c3=['ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','force_rport,comedia','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]','never','\x22\x22\x20<>','accept','refuse','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','TEXT','showWebBar','get','wss','udp','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','rtcp_mux','encryption','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','moment','util','lodash','exports','STRING','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','ENUM','admin','user','agent','telephone','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','ALLOWED_NOT_SCREENED'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x57c3,0x1a1));var _0x357c=function(_0x4c375a,_0x2683f2){_0x4c375a=_0x4c375a-0x0;var _0xd766f3=_0x57c3[_0x4c375a];return _0xd766f3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x357c('0x0'));var util=require(_0x357c('0x1'));var _=require(_0x357c('0x2'));module[_0x357c('0x3')]={'name':{'type':Sequelize[_0x357c('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xb2d703){this[_0x357c('0x5')]('name',_0xb2d703);this[_0x357c('0x5')]('defaultuser',_0xb2d703);},'comment':_0x357c('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x6eaa5e){this[_0x357c('0x5')](_0x357c('0x7'),_0x6eaa5e);this[_0x357c('0x5')](_0x357c('0x8'),util[_0x357c('0x9')](_0x357c('0xa'),_0x6eaa5e,this[_0x357c('0xb')]('internal')));}},'alias':{'type':Sequelize[_0x357c('0x4')]},'email':{'type':Sequelize[_0x357c('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4dce5){if(_0x4dce5){this[_0x357c('0x5')](_0x357c('0xc'),_0x4dce5['toLowerCase']());}}},'role':{'type':Sequelize[_0x357c('0xd')](_0x357c('0xe'),_0x357c('0xf'),_0x357c('0x10'),_0x357c('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x357c('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x357c('0x12'),'set':function(_0x2f96d0){this[_0x357c('0x5')](_0x357c('0x12'),_0x2f96d0);this[_0x357c('0x5')](_0x357c('0x13'),_0x2f96d0);this[_0x357c('0x5')]('callerid',util[_0x357c('0x9')](_0x357c('0xa'),this[_0x357c('0xb')](_0x357c('0x7')),_0x2f96d0));}},'salt':{'type':Sequelize[_0x357c('0x4')]},'phone':{'type':Sequelize[_0x357c('0x4')]},'mobile':{'type':Sequelize[_0x357c('0x4')]},'address':{'type':Sequelize[_0x357c('0x4')]},'zipcode':{'type':Sequelize[_0x357c('0x4')]},'userpic':{'type':Sequelize[_0x357c('0x4')]},'city':{'type':Sequelize[_0x357c('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x357c('0x15')]},'voicePause':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x357c('0x4')],'defaultValue':_0x357c('0x16')},'lastPauseAt':{'type':Sequelize[_0x357c('0x15')]},'chatCapacity':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x357c('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x357c('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![],'defaultValue':_0x357c('0x18')},'ipaddr':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x19'),_0x357c('0xf'),_0x357c('0x1a')),'allowNull':!![],'defaultValue':_0x357c('0x19')},'context':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0x357c('0x1b'),_0x357c('0x1c'),'ALLOWED_FAILED_SCREEN',_0x357c('0x1d'),'PROHIB_NOT_SCREENED',_0x357c('0x1e'),'PROHIB_FAILED_SCREEN',_0x357c('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x282bad){this[_0x357c('0x5')](_0x357c('0x20'),_0x282bad?_0x282bad[_0x357c('0x21')](','):null);},'get':function(){return this[_0x357c('0xb')](_0x357c('0x20'))?this[_0x357c('0xb')]('transport')[_0x357c('0x22')](','):null;},'comment':_0x357c('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x357c('0x24'),_0x357c('0x25'),_0x357c('0x26'),_0x357c('0x27'),'auto'),'allowNull':!![],'defaultValue':_0x357c('0x24')},'directmedia':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no',_0x357c('0x29'),'update',_0x357c('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x357c('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![],'defaultValue':_0x357c('0x2b'),'set':function(_0x2d12f7){this[_0x357c('0x5')](_0x357c('0x2c'),_0x2d12f7?_0x2d12f7[_0x357c('0x21')](','):null);},'get':function(){return this[_0x357c('0xb')](_0x357c('0x2c'))?this[_0x357c('0xb')](_0x357c('0x2c'))[_0x357c('0x22')](','):null;},'comment':_0x357c('0x2d')},'callgroup':{'type':Sequelize[_0x357c('0x4')]},'namedcallgroup':{'type':Sequelize[_0x357c('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x357c('0x4')]},'language':{'type':Sequelize[_0x357c('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x357c('0x4')],'allowNull':![],'defaultValue':_0x357c('0x2e'),'set':function(_0x58ab1e){this[_0x357c('0x5')](_0x357c('0x2f'),_0x58ab1e?_0x58ab1e[_0x357c('0x21')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x357c('0xb')]('allow')?this[_0x357c('0xb')](_0x357c('0x2f'))[_0x357c('0x22')](';'):null;},'comment':_0x357c('0x30')},'autoframing':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0xd2857e){this[_0x357c('0x5')](_0x357c('0x31'),_0xd2857e?_0xd2857e['join'](','):null);},'get':function(){return this[_0x357c('0xb')](_0x357c('0x31'))?this[_0x357c('0xb')]('insecure')[_0x357c('0x22')](','):null;},'comment':_0x357c('0x32')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x357c('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x357c('0xd')]('yes','no',_0x357c('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x357c('0x34')},'amaflags':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![],'defaultValue':_0x357c('0x28')},'busylevel':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x357c('0xd')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x35'),_0x357c('0x36'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x357c('0xd')]('uac',_0x357c('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x357c('0x28'),'no'),'allowNull':!![],'defaultValue':_0x357c('0x28')},'keepalive':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x357c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x357c('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x357c('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no',_0x357c('0x38'),_0x357c('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x357c('0x3a'),_0x357c('0x3b'),_0x357c('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x357c('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no',_0x357c('0x29'),_0x357c('0x3d'),_0x357c('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x357c('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x357c('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x357c('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x53bc9c){this[_0x357c('0x5')](_0x357c('0x40'),_0x53bc9c);var _0x10b3d5=this[_0x357c('0x41')]({'plain':!![]});switch(_0x53bc9c){case 0x0:case 0x1:var _0x8aa99e=_0x10b3d5[_0x357c('0x20')]?_['isArray'](_0x10b3d5['transport'])?_0x10b3d5['transport'][_0x357c('0x21')]():_0x10b3d5['transport']:'udp';if(_0x8aa99e===_0x357c('0x42')){_0x8aa99e=_0x357c('0x43');}this[_0x357c('0x5')](_0x357c('0x20'),_0x8aa99e);this[_0x357c('0x5')]('encryption','no');this[_0x357c('0x5')](_0x357c('0x44'),null);this[_0x357c('0x5')]('force_avp',null);this[_0x357c('0x5')](_0x357c('0x45'),null);this[_0x357c('0x5')](_0x357c('0x46'),null);this[_0x357c('0x5')](_0x357c('0x47'),null);this[_0x357c('0x5')](_0x357c('0x48'),null);this[_0x357c('0x5')]('dtlscertfile',null);this[_0x357c('0x5')]('dtlsprivatekey',null);this['setDataValue'](_0x357c('0x49'),'no');break;case 0x2:this[_0x357c('0x5')]('transport','wss');this['setDataValue'](_0x357c('0x4a'),_0x357c('0x28'));this[_0x357c('0x5')](_0x357c('0x44'),_0x357c('0x28'));this[_0x357c('0x5')](_0x357c('0x4b'),_0x357c('0x28'));this[_0x357c('0x5')](_0x357c('0x45'),_0x357c('0x28'));this[_0x357c('0x5')](_0x357c('0x46'),'yes');this[_0x357c('0x5')]('dtlsverify','no');this[_0x357c('0x5')](_0x357c('0x48'),_0x357c('0x3c'));this[_0x357c('0x5')](_0x357c('0x4c'),_0x10b3d5[_0x357c('0x4c')]||_0x357c('0x4d'));this[_0x357c('0x5')]('dtlsprivatekey',_0x10b3d5[_0x357c('0x4e')]||'/etc/pki/tls/private/motion.key');this[_0x357c('0x5')]('rtcp_mux',_0x357c('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x357c('0x3f')],'set':function(_0x5ea576){this[_0x357c('0x5')](_0x357c('0x4f'),_0x5ea576?_0x5ea576[_0x357c('0x21')](','):[]);},'get':function(){return this['getDataValue'](_0x357c('0x4f'))?_[_0x357c('0x50')](this[_0x357c('0xb')](_0x357c('0x4f'))[_0x357c('0x22')](','),function(_0x351496){return parseInt(_0x351496,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x357c('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x357c('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x357c('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x357c('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x357c('0xd')](_0x357c('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x357c('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x357c('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x357c('0x51')],'get':function(){return this[_0x357c('0xb')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x357c('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x357c('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x15f727){if(typeof _0x15f727===_0x357c('0x52')){var _0x21fa17=_0x15f727==='1'?!![]:_0x15f727==='0'?![]:_0x15f727===_0x357c('0x53')?!![]:_0x15f727===_0x357c('0x54')?![]:![];this[_0x357c('0x5')](_0x357c('0x55'),_0x21fa17);}else{this[_0x357c('0x5')]('screenrecording',_0x15f727);}}},'blocked':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![],'set':function(_0x4d630a){this[_0x357c('0x5')](_0x357c('0x56'),_0x4d630a);if(_0x4d630a===!![]){this['setDataValue']('blockedAt',moment());this['setDataValue'](_0x357c('0x57'),0x0);}else{this[_0x357c('0x5')](_0x357c('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x357c('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x357c('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x357c('0x17')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x357c('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x357c('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x357c('0x17')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x357c('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0x1a3f=['/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','UNSIGNED','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','format','getDataValue','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','callerid','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','join','split','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','isArray','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','icesupport'];(function(_0x1fdd82,_0x1d85dc){var _0x448740=function(_0xf3f7c0){while(--_0xf3f7c0){_0x1fdd82['push'](_0x1fdd82['shift']());}};_0x448740(++_0x1d85dc);}(_0x1a3f,0x1d3));var _0xf1a3=function(_0x4926c5,_0x113462){_0x4926c5=_0x4926c5-0x0;var _0x2422b5=_0x1a3f[_0x4926c5];return _0x2422b5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf1a3('0x0'));var util=require(_0xf1a3('0x1'));var _=require('lodash');module[_0xf1a3('0x2')]={'name':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'unique':_0xf1a3('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4e5ef){this[_0xf1a3('0x5')]('name',_0x4e5ef);this[_0xf1a3('0x5')](_0xf1a3('0x6'),_0x4e5ef);},'comment':_0xf1a3('0x7')},'fullname':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'set':function(_0x314344){this[_0xf1a3('0x5')]('fullname',_0x314344);this['setDataValue']('callerid',util[_0xf1a3('0x8')]('\x22%s\x22\x20<%s>',_0x314344,this[_0xf1a3('0x9')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'unique':_0xf1a3('0xa'),'validate':{'isEmail':!![]},'set':function(_0xa6815e){if(_0xa6815e){this[_0xf1a3('0x5')](_0xf1a3('0xa'),_0xa6815e[_0xf1a3('0xb')]());}}},'role':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0xd'),'user',_0xf1a3('0xe'),_0xf1a3('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':_0xf1a3('0x10')},'internal':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':![],'unique':'internal','set':function(_0xb416c1){this[_0xf1a3('0x5')]('internal',_0xb416c1);this[_0xf1a3('0x5')](_0xf1a3('0x12'),_0xb416c1);this[_0xf1a3('0x5')](_0xf1a3('0x13'),util['format']('\x22%s\x22\x20<%s>',this[_0xf1a3('0x9')](_0xf1a3('0x14')),_0xb416c1));}},'salt':{'type':Sequelize[_0xf1a3('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf1a3('0x3')]},'address':{'type':Sequelize[_0xf1a3('0x3')]},'zipcode':{'type':Sequelize[_0xf1a3('0x3')]},'userpic':{'type':Sequelize[_0xf1a3('0x3')]},'city':{'type':Sequelize[_0xf1a3('0x3')]},'country':{'type':Sequelize[_0xf1a3('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':_0xf1a3('0x16')},'lastPauseAt':{'type':Sequelize[_0xf1a3('0x17')]},'chatCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf1a3('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf1a3('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x18'),'user',_0xf1a3('0x19')),'allowNull':!![],'defaultValue':_0xf1a3('0x18')},'context':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0xf1a3('0x1a'),_0xf1a3('0x1b'),_0xf1a3('0x1c'),_0xf1a3('0x1d'),_0xf1a3('0x1e'),_0xf1a3('0x1f'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':_0xf1a3('0x20'),'set':function(_0x542306){this[_0xf1a3('0x5')](_0xf1a3('0x21'),_0x542306?_0x542306[_0xf1a3('0x22')](','):null);},'get':function(){return this[_0xf1a3('0x9')](_0xf1a3('0x21'))?this['getDataValue'](_0xf1a3('0x21'))[_0xf1a3('0x23')](','):null;},'comment':_0xf1a3('0x24')},'dtmfmode':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x25'),_0xf1a3('0x26'),_0xf1a3('0x27'),_0xf1a3('0x28'),_0xf1a3('0x29')),'allowNull':!![],'defaultValue':_0xf1a3('0x25')},'directmedia':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no',_0xf1a3('0x2b'),_0xf1a3('0x2c'),_0xf1a3('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf1a3('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':_0xf1a3('0x2e'),'set':function(_0x169d35){this[_0xf1a3('0x5')](_0xf1a3('0x2f'),_0x169d35?_0x169d35[_0xf1a3('0x22')](','):null);},'get':function(){return this['getDataValue'](_0xf1a3('0x2f'))?this[_0xf1a3('0x9')](_0xf1a3('0x2f'))[_0xf1a3('0x23')](','):null;},'comment':_0xf1a3('0x30')},'callgroup':{'type':Sequelize[_0xf1a3('0x3')]},'namedcallgroup':{'type':Sequelize[_0xf1a3('0x3')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xf1a3('0x3')]},'language':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf1a3('0x3')]},'disallow':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'defaultValue':_0xf1a3('0x31')},'allow':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'defaultValue':_0xf1a3('0x32'),'set':function(_0x1fe59f){this['setDataValue'](_0xf1a3('0x33'),_0x1fe59f?_0x1fe59f['join'](';'):_0xf1a3('0x32'));},'get':function(){return this['getDataValue'](_0xf1a3('0x33'))?this[_0xf1a3('0x9')](_0xf1a3('0x33'))[_0xf1a3('0x23')](';'):null;},'comment':_0xf1a3('0x34')},'autoframing':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'set':function(_0x5c073d){this[_0xf1a3('0x5')]('insecure',_0x5c073d?_0x5c073d[_0xf1a3('0x22')](','):null);},'get':function(){return this[_0xf1a3('0x9')]('insecure')?this['getDataValue'](_0xf1a3('0x35'))['split'](','):null;},'comment':_0xf1a3('0x36')},'trustrpid':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf1a3('0xc')]('yes','no',_0xf1a3('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':_0xf1a3('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf1a3('0xc')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no',_0xf1a3('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x3a'),_0xf1a3('0x3b'),_0xf1a3('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf1a3('0xc')]('uac',_0xf1a3('0x3d')),'allowNull':!![],'defaultValue':_0xf1a3('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf1a3('0x2a')},'keepalive':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no','fingerprint',_0xf1a3('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x3f'),_0xf1a3('0x40'),_0xf1a3('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf1a3('0xc')]('yes','no',_0xf1a3('0x2b'),_0xf1a3('0x2c'),_0xf1a3('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf1a3('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xf1a3('0x17')]},'passwordResetAt':{'type':Sequelize[_0xf1a3('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf1a3('0x43')]},'showWebBar':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0,'set':function(_0x38bfcf){this['setDataValue'](_0xf1a3('0x44'),_0x38bfcf);var _0x49e9a8=this['get']({'plain':!![]});switch(_0x38bfcf){case 0x0:case 0x1:var _0x2a335d=_0x49e9a8[_0xf1a3('0x21')]?_[_0xf1a3('0x45')](_0x49e9a8[_0xf1a3('0x21')])?_0x49e9a8[_0xf1a3('0x21')][_0xf1a3('0x22')]():_0x49e9a8[_0xf1a3('0x21')]:_0xf1a3('0x20');if(_0x2a335d===_0xf1a3('0x46')){_0x2a335d=_0xf1a3('0x20');}this[_0xf1a3('0x5')]('transport',_0x2a335d);this['setDataValue']('encryption','no');this[_0xf1a3('0x5')](_0xf1a3('0x47'),null);this[_0xf1a3('0x5')](_0xf1a3('0x48'),null);this[_0xf1a3('0x5')]('icesupport',null);this['setDataValue'](_0xf1a3('0x49'),null);this[_0xf1a3('0x5')](_0xf1a3('0x4a'),null);this[_0xf1a3('0x5')](_0xf1a3('0x4b'),null);this[_0xf1a3('0x5')](_0xf1a3('0x4c'),null);this[_0xf1a3('0x5')]('dtlsprivatekey',null);this['setDataValue'](_0xf1a3('0x4d'),'no');break;case 0x2:this[_0xf1a3('0x5')](_0xf1a3('0x21'),'wss');this['setDataValue']('encryption',_0xf1a3('0x2a'));this['setDataValue'](_0xf1a3('0x47'),_0xf1a3('0x2a'));this[_0xf1a3('0x5')](_0xf1a3('0x48'),_0xf1a3('0x2a'));this[_0xf1a3('0x5')](_0xf1a3('0x4e'),_0xf1a3('0x2a'));this['setDataValue']('dtlsenable','yes');this['setDataValue'](_0xf1a3('0x4a'),'no');this[_0xf1a3('0x5')]('dtlssetup',_0xf1a3('0x41'));this[_0xf1a3('0x5')](_0xf1a3('0x4c'),_0x49e9a8[_0xf1a3('0x4c')]||_0xf1a3('0x4f'));this['setDataValue'](_0xf1a3('0x50'),_0x49e9a8[_0xf1a3('0x50')]||_0xf1a3('0x51'));this['setDataValue']('rtcp_mux',_0xf1a3('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xf1a3('0x43')],'set':function(_0x21dd6d){this[_0xf1a3('0x5')](_0xf1a3('0x52'),_0x21dd6d?_0x21dd6d[_0xf1a3('0x22')](','):[]);},'get':function(){return this[_0xf1a3('0x9')](_0xf1a3('0x52'))?_['map'](this[_0xf1a3('0x9')]('permissions')[_0xf1a3('0x23')](','),function(_0x190e43){return parseInt(_0x190e43,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf1a3('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xf1a3('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf1a3('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf1a3('0x53')],'get':function(){return this[_0xf1a3('0x9')](_0xf1a3('0x54'))?this[_0xf1a3('0x9')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![],'set':function(_0x374780){if(typeof _0x374780==='string'){var _0x4028c7=_0x374780==='1'?!![]:_0x374780==='0'?![]:_0x374780===_0xf1a3('0x55')?!![]:_0x374780===_0xf1a3('0x56')?![]:![];this[_0xf1a3('0x5')](_0xf1a3('0x57'),_0x4028c7);}else{this['setDataValue']('screenrecording',_0x374780);}}},'blocked':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![],'set':function(_0x11a983){this[_0xf1a3('0x5')](_0xf1a3('0x58'),_0x11a983);if(_0x11a983===!![]){this[_0xf1a3('0x5')](_0xf1a3('0x59'),moment());this[_0xf1a3('0x5')]('loginAttempts',0x0);}else{this[_0xf1a3('0x5')](_0xf1a3('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xf1a3('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xf1a3('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 3fd03c6..ddeea92 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 _0x1033=['You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','phone','CmContact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','idle','unknown','ringing','teams','inbound','flatten','toString','lower','col','asc','desc','substring','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','messengerSoundNotification','enabled','moment','path','ioredis','../../components/auth/service','../../components/realtime/agents','../../config/logger','../../config/utils','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','role','agent','emit','destroy','then','get','admin','Users','user','Agents','Telephones','telephone','filter','map','value','includes','find','name','UserProfileResource','error','stack','send','User','rawAttributes','fieldName','type','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','getOptions','where','includeAll','query','userSetting','include','UserSetting','attributes','openTabs','true','length','push','sms','rows','dataValues','fax','mail','openchannel','whatsapp','catch','merge','options','chat','body','params','describe','addContacts','internal','Setting','findById','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','101','103','113','104','106','108','109','100','111','114','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','create','UserProfileSection','userProfileId','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','all','findAll','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','securePassword','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','add','toLowerCase','Queues','ids','penalty','spread','capitalize','Queue:save','voice','VoiceQueue','format','UserVoiceQueueRt','upsert','isValidChannel','isArray','QueueId','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','getOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','getContacts','findOne','CmList','List','Tag','Tags','color','getQueues','model','keys','filters','intersection','fields','order','Queue','Unknown\x20role','hasOwnProperty','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','sort','pick','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','resolve','logout','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','chatPause','faxPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addTeams','Team','getAssociatedQueues','flattenDeep','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','removeAgent','Voice','getLists','getAgents','getVoiceQueues','values'];(function(_0x32b3c2,_0xe56fd){var _0x40a313=function(_0x51ba92){while(--_0x51ba92){_0x32b3c2['push'](_0x32b3c2['shift']());}};_0x40a313(++_0xe56fd);}(_0x1033,0x71));var _0x3103=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1033[_0x13b02f];return _0x12e9a6;};'use strict';var moment=require(_0x3103('0x0'));var util=require('util');var path=require(_0x3103('0x1'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Redis=require(_0x3103('0x2'));var authService=require(_0x3103('0x3'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var rta=require(_0x3103('0x4'));var logger=require(_0x3103('0x5'))('api');var utils=require(_0x3103('0x6'));var config=require('../../config/environment');var licenseUtil=require(_0x3103('0x7'));var APIBadRequestError=require('../../errors/api')[_0x3103('0x8')];var APINotFoundError=require(_0x3103('0x9'))[_0x3103('0xa')];var APIHandleError=require(_0x3103('0x9'))[_0x3103('0xb')];var db=require(_0x3103('0xc'))['db'];var socket=require(_0x3103('0xd'))(new Redis(config[_0x3103('0xe')]));require(_0x3103('0xf'))[_0x3103('0x10')](socket);config['redis']=_[_0x3103('0x11')](config['redis'],{'host':_0x3103('0x12'),'port':0x18eb});var values;function respondWithStatusCode(_0xa0af15,_0x25a40b){_0x25a40b=_0x25a40b||0xcc;return function(_0x24cf40){if(_0x24cf40){return _0xa0af15[_0x3103('0x13')](_0x25a40b);}return _0xa0af15[_0x3103('0x14')](_0x25a40b)[_0x3103('0x15')]();};}function respondWithResult(_0x2f561b,_0x2a427b){_0x2a427b=_0x2a427b||0xc8;return function(_0x7a1c31){if(_0x7a1c31){return _0x2f561b['status'](_0x2a427b)[_0x3103('0x16')](_0x7a1c31);}};}function respondWithFilteredResult(_0x1c5a99,_0x2dc1dc){return function(_0x2d03cd){if(_0x2d03cd){var _0x3bf0b3=typeof _0x2dc1dc[_0x3103('0x17')]===_0x3103('0x18')&&typeof _0x2dc1dc[_0x3103('0x19')]===_0x3103('0x18');var _0x2023d5=_0x2d03cd[_0x3103('0x1a')];var _0x435e30=_0x3bf0b3?0x0:_0x2dc1dc[_0x3103('0x17')];var _0xc5f03b=_0x3bf0b3?_0x2d03cd[_0x3103('0x1a')]:_0x2dc1dc[_0x3103('0x17')]+_0x2dc1dc['limit'];var _0x32e750;if(_0xc5f03b>=_0x2023d5){_0xc5f03b=_0x2023d5;_0x32e750=0xc8;}else{_0x32e750=0xce;}_0x1c5a99[_0x3103('0x14')](_0x32e750);return _0x1c5a99[_0x3103('0x1b')](_0x3103('0x1c'),_0x435e30+'-'+_0xc5f03b+'/'+_0x2023d5)[_0x3103('0x16')](_0x2d03cd);}return null;};}function saveUpdates(_0x4f14ba){return function(_0xc42787){if(_0xc42787){return _0xc42787[_0x3103('0x1d')](_0x4f14ba)['then'](function(_0x4886b3){if(_0x4886b3[_0x3103('0x1e')]===_0x3103('0x1f')){socket[_0x3103('0x20')]('userNotification:recalc:'+_0x4886b3['id'],_0x4886b3);}return _0x4886b3;});}return null;};}function removeEntity(_0x1a395b){return function(_0x683d6){if(_0x683d6){return _0x683d6[_0x3103('0x21')]()[_0x3103('0x22')](function(){var _0x553012=_0x683d6[_0x3103('0x23')]({'plain':!![]});if(_0x553012['role']===_0x3103('0x24'))return;var _0x1b4a2f=[{'name':_0x3103('0x25'),'value':_0x3103('0x26'),'ignore':!![]},{'name':_0x3103('0x27'),'value':_0x3103('0x1f'),'ignore':![]},{'name':_0x3103('0x28'),'value':_0x3103('0x29'),'ignore':![]}];var _0x5128e3=_(_0x1b4a2f)[_0x3103('0x2a')]('ignore')[_0x3103('0x2b')](_0x3103('0x2c'))[_0x3103('0x2c')]();if(_[_0x3103('0x2d')](_0x5128e3,_0x553012[_0x3103('0x1e')])){return;}var _0x18a86e=_[_0x3103('0x2e')](_0x1b4a2f,[_0x3103('0x2c'),_0x553012[_0x3103('0x1e')]])[_0x3103('0x2f')];return db[_0x3103('0x30')][_0x3103('0x21')]({'where':{'type':_0x18a86e,'resourceId':_0x553012['id']}})['then'](function(){return _0x683d6;});})['then'](function(){_0x1a395b[_0x3103('0x14')](0xcc)[_0x3103('0x15')]();});}};}function handleEntityNotFound(_0x60ff16){return function(_0x14ff3a){if(!_0x14ff3a){_0x60ff16[_0x3103('0x13')](0x194);}return _0x14ff3a;};}function handleError(_0x3d1432,_0x2717bc){_0x2717bc=_0x2717bc||0x1f4;return function(_0x4a0454){logger[_0x3103('0x31')](_0x4a0454[_0x3103('0x32')]);if(_0x4a0454[_0x3103('0x2f')]){delete _0x4a0454[_0x3103('0x2f')];}_0x3d1432[_0x3103('0x14')](_0x2717bc)[_0x3103('0x33')](_0x4a0454);};}function getUserAttributes(){return _(db[_0x3103('0x34')][_0x3103('0x35')])[_0x3103('0x2b')](function(_0x26e944){return{'name':_0x26e944[_0x3103('0x36')],'type':_0x26e944[_0x3103('0x37')]['key']};})[_0x3103('0x2a')](function(_0x480e61){return![_0x3103('0x38'),_0x3103('0x39'),_0x3103('0x3a'),_0x3103('0x3b'),_0x3103('0x3c'),_0x3103('0x3d')][_0x3103('0x2d')](_0x480e61[_0x3103('0x2f')]);})[_0x3103('0x2c')]();}exports[_0x3103('0x3e')]=function(_0xf9c48e,_0x315755){var _0x2a6cc8={},_0x11b894={'count':0x0,'rows':[]};var _0x3944d4=getUserAttributes();_0x2a6cc8=qs[_0x3103('0x3f')](_0x3944d4,_0xf9c48e);var _0x488b99={'where':_0x2a6cc8[_0x3103('0x40')]};return db[_0x3103('0x34')][_0x3103('0x1a')](_0x488b99)['then'](function(_0x2c9afa){_0x11b894['count']=_0x2c9afa;if(_0xf9c48e['query'][_0x3103('0x41')]){_0x2a6cc8['include']=[{'all':!![]}];}if(_0xf9c48e[_0x3103('0x42')][_0x3103('0x43')]==='true'){_0x2a6cc8[_0x3103('0x44')]=[{'model':db[_0x3103('0x45')],'as':_0x3103('0x43')}];}if(!_[_0x3103('0x2d')](_0x2a6cc8[_0x3103('0x46')],'id')){_0x2a6cc8[_0x3103('0x46')]['push']('id');}return db[_0x3103('0x34')]['findAll'](_0x2a6cc8);})[_0x3103('0x22')](function(_0x130cb0){_0x11b894['rows']=_0x130cb0;if(_0xf9c48e[_0x3103('0x42')][_0x3103('0x47')]===_0x3103('0x48')){var _0x2b1aaa=[];for(var _0x54cf55=0x0;_0x54cf55<_0x11b894['rows'][_0x3103('0x49')];_0x54cf55++){_0x2b1aaa[_0x3103('0x4a')](get_open_tabs('chat',_0x11b894['rows'][_0x54cf55]['dataValues']));_0x2b1aaa['push'](get_open_tabs(_0x3103('0x4b'),_0x11b894[_0x3103('0x4c')][_0x54cf55][_0x3103('0x4d')]));_0x2b1aaa[_0x3103('0x4a')](get_open_tabs(_0x3103('0x4e'),_0x11b894[_0x3103('0x4c')][_0x54cf55]['dataValues']));_0x2b1aaa[_0x3103('0x4a')](get_open_tabs(_0x3103('0x4f'),_0x11b894[_0x3103('0x4c')][_0x54cf55][_0x3103('0x4d')]));_0x2b1aaa[_0x3103('0x4a')](get_open_tabs(_0x3103('0x50'),_0x11b894[_0x3103('0x4c')][_0x54cf55][_0x3103('0x4d')]));_0x2b1aaa[_0x3103('0x4a')](get_open_tabs(_0x3103('0x51'),_0x11b894[_0x3103('0x4c')][_0x54cf55][_0x3103('0x4d')]));}return Promise['all'](_0x2b1aaa)[_0x3103('0x22')](function(){return _0x11b894;});}else{return _0x11b894;}})['then'](respondWithFilteredResult(_0x315755,_0x2a6cc8))[_0x3103('0x52')](handleError(_0x315755,null));};exports['show']=function(_0x3b1471,_0x5360ff){var _0x413e55=getUserAttributes();_0x3b1471[_0x3103('0x42')]['id']=_0x3b1471['params']['id'];var _0x33b6de=qs['getOptions'](_0x413e55,_0x3b1471);if(_0x3b1471[_0x3103('0x42')][_0x3103('0x41')]){_0x33b6de[_0x3103('0x44')]=[{'all':!![]}];}if(_0x3b1471[_0x3103('0x42')][_0x3103('0x43')]==='true'){_0x33b6de[_0x3103('0x44')]=[{'model':db['UserSetting'],'as':_0x3103('0x43')}];}_0x33b6de=_[_0x3103('0x53')]({},_0x33b6de,_0x3b1471[_0x3103('0x54')]);if(!_[_0x3103('0x2d')](_0x33b6de[_0x3103('0x46')],'id')){_0x33b6de[_0x3103('0x46')][_0x3103('0x4a')]('id');}return db[_0x3103('0x34')]['find'](_0x33b6de)[_0x3103('0x22')](handleEntityNotFound(_0x5360ff,null))[_0x3103('0x22')](function(_0x113f77){var _0xa6cadc=[];values=_0x113f77;if(_0x3b1471[_0x3103('0x42')][_0x3103('0x47')]===_0x3103('0x48')){_0xa6cadc[_0x3103('0x4a')](get_open_tabs(_0x3103('0x55'),_0x113f77[_0x3103('0x4d')]));_0xa6cadc[_0x3103('0x4a')](get_open_tabs(_0x3103('0x4b'),_0x113f77[_0x3103('0x4d')]));_0xa6cadc[_0x3103('0x4a')](get_open_tabs(_0x3103('0x50'),_0x113f77[_0x3103('0x4d')]));_0xa6cadc[_0x3103('0x4a')](get_open_tabs(_0x3103('0x51'),_0x113f77[_0x3103('0x4d')]));_0xa6cadc[_0x3103('0x4a')](get_open_tabs(_0x3103('0x4e'),_0x113f77[_0x3103('0x4d')]));_0xa6cadc[_0x3103('0x4a')](get_open_tabs('mail',_0x113f77[_0x3103('0x4d')]));return Promise['all'](_0xa6cadc);}else{return values;}})[_0x3103('0x22')](function(){return values;})['then'](respondWithResult(_0x5360ff,null))[_0x3103('0x52')](handleError(_0x5360ff,null));};exports[_0x3103('0x1d')]=function(_0x14ad95,_0x1fb68e){if(_0x14ad95[_0x3103('0x56')]['id']){delete _0x14ad95[_0x3103('0x56')]['id'];}delete _0x14ad95[_0x3103('0x56')][_0x3103('0x1e')];return db['User'][_0x3103('0x2e')]({'where':{'id':_0x14ad95[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x1fb68e,null))['then'](saveUpdates(_0x14ad95[_0x3103('0x56')],null))[_0x3103('0x22')](respondWithResult(_0x1fb68e,null))['catch'](handleError(_0x1fb68e,null));};exports[_0x3103('0x58')]=function(_0x4e5faf,_0x27d3c6){return db[_0x3103('0x34')]['describe']()[_0x3103('0x22')](respondWithResult(_0x27d3c6,null))[_0x3103('0x52')](handleError(_0x27d3c6,null));};exports[_0x3103('0x59')]=function(_0x78d305,_0x5568c4){return db[_0x3103('0x34')][_0x3103('0x2e')]({'where':{'id':_0x78d305[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x5568c4,null))[_0x3103('0x22')](function(_0x494e5f){if(_0x494e5f){return _0x494e5f[_0x3103('0x59')](_0x78d305[_0x3103('0x56')]['ids'],_['omit'](_0x78d305[_0x3103('0x56')],['ids','id'])||{});}})[_0x3103('0x22')](respondWithResult(_0x5568c4,null))[_0x3103('0x52')](handleError(_0x5568c4,null));};function validateUser(_0x257292){return new Promise(function(_0x2ef61a,_0x54cada){if(_0x257292[_0x3103('0x5a')])return _0x2ef61a(_0x257292);return db[_0x3103('0x5b')][_0x3103('0x5c')](0x1)[_0x3103('0x22')](function(_0x450437){if(_0x450437['securePassword'])authService['validatePasswordPattern'](_0x257292[_0x3103('0x38')]);db[_0x3103('0x34')]['max'](_0x3103('0x5a'))[_0x3103('0x22')](function(_0x3b13a4){if(_[_0x3103('0x5d')](_0x3b13a4)){_0x257292[_0x3103('0x5a')]=_0x450437['min_internal']||0x1;return;}if(_['isNil'](_0x450437[_0x3103('0x5e')])||_0x450437[_0x3103('0x5e')]===_0x3b13a4){_0x257292[_0x3103('0x5a')]=_0x3b13a4+0x1;return;}if(_0x450437[_0x3103('0x5e')]>_0x3b13a4){_0x257292[_0x3103('0x5a')]=_0x450437[_0x3103('0x5e')];return;}return db[_0x3103('0x5f')]['query'](_0x3103('0x60'),{'type':db['sequelize'][_0x3103('0x61')][_0x3103('0x62')]})[_0x3103('0x22')](function(_0x418780){if(_0x418780&&_0x418780[_0x3103('0x49')]){for(var _0x463893=0x0,_0x2b09c8=_0x418780[_0x3103('0x49')];_0x463893<_0x2b09c8&&_['isNil'](_0x257292[_0x3103('0x5a')]);_0x463893++){if(_0x450437[_0x3103('0x5e')]<=_0x418780[_0x463893][_0x3103('0x63')]){_0x257292['internal']=_0x418780[_0x463893]['from'];}else if(_0x450437[_0x3103('0x5e')]>_0x418780[_0x463893]['from']&&_0x450437['min_internal']<=_0x418780[_0x463893]['to']){_0x257292[_0x3103('0x5a')]=_0x450437[_0x3103('0x5e')];}}}if(_[_0x3103('0x5d')](_0x257292[_0x3103('0x5a')])){_0x257292[_0x3103('0x5a')]=_0x3b13a4+0x1;}return _0x2ef61a(_0x257292);});});})['catch'](function(_0x3426b3){_0x54cada(_0x3426b3);});});}function updateUser(_0x47f12d){return new Promise(function(_0x3272ac,_0x3eeb0e){try{if(_0x47f12d['voicemail']){_0x47f12d[_0x3103('0x64')]=_0x47f12d[_0x3103('0x5a')];_0x47f12d[_0x3103('0x65')]={'mailbox':_0x47f12d['internal'],'password':_0x47f12d['password'],'fullname':_0x47f12d['fullname'],'email':_0x47f12d['email']};}if(_0x47f12d[_0x3103('0x1e')]===_0x3103('0x1f')){if(!_0x47f12d['permissions'])_0x47f12d['permissions']=[_0x3103('0x66'),'102',_0x3103('0x67'),_0x3103('0x68'),'110',_0x3103('0x69'),'105',_0x3103('0x6a'),'107',_0x3103('0x6b'),_0x3103('0x6c'),_0x3103('0x6d'),_0x3103('0x6e'),_0x3103('0x6f'),'115'];}_0x3272ac(_0x47f12d);}catch(_0x201d1d){_0x3eeb0e(_0x201d1d);}});}exports['create']=function(_0x1712b4,_0x434357){if(_0x1712b4[_0x3103('0x26')][_0x3103('0x1e')]===_0x3103('0x1f'))throw new Error(_0x3103('0x70'));if(_0x1712b4[_0x3103('0x56')]['role']===_0x3103('0x26')&&_0x1712b4[_0x3103('0x26')][_0x3103('0x1e')]!=='admin'){throw new Error(_0x3103('0x71'));}if(_0x1712b4['body'][_0x3103('0x1e')]===_0x3103('0x24')&&_0x1712b4[_0x3103('0x26')][_0x3103('0x1e')]!=='admin'){throw new Error(_0x3103('0x72'));}return licenseUtil['checkUserLimits']([_0x1712b4[_0x3103('0x56')]])['then'](function(){return validateUser(_0x1712b4[_0x3103('0x56')]);})[_0x3103('0x22')](function(_0x3ef555){return updateUser(_0x3ef555)['then'](function(_0x2c7269){if(_0x2c7269[_0x3103('0x1e')]===_0x3103('0x24')){_0x2c7269['settingsEnabled']=_0x1712b4[_0x3103('0x26')][_0x3103('0x73')];delete _0x2c7269['userProfileId'];}return _0x2c7269;});})[_0x3103('0x22')](function(_0x5cf16c){return db[_0x3103('0x34')][_0x3103('0x74')](_0x5cf16c,{'include':[{'model':db[_0x3103('0x65')],'as':_0x3103('0x65')}]});})['then'](function(_0x16074e){if(_0x1712b4[_0x3103('0x56')][_0x3103('0x1e')]==='user')return _0x16074e;if(_0x1712b4[_0x3103('0x26')][_0x3103('0x1e')]!=='user')return _0x16074e;return db[_0x3103('0x75')][_0x3103('0x2e')]({'where':{'name':_0x16074e[_0x3103('0x1e')]===_0x3103('0x1f')?'Agents':_0x3103('0x28'),'userProfileId':_0x1712b4[_0x3103('0x26')][_0x3103('0x76')]},'raw':!![]})[_0x3103('0x22')](function(_0x4d02db){if(!_0x4d02db||_0x4d02db[_0x3103('0x77')]!=0x0)return _0x16074e;return db[_0x3103('0x30')][_0x3103('0x74')]({'name':_0x16074e[_0x3103('0x2f')],'resourceId':_0x16074e['id'],'type':_0x4d02db[_0x3103('0x2f')],'sectionId':_0x4d02db['id']},{})[_0x3103('0x22')](function(){return _0x16074e;});})[_0x3103('0x52')](function(_0x50723a){logger[_0x3103('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50723a);throw _0x50723a;});})[_0x3103('0x22')](respondWithResult(_0x434357,0xc9))[_0x3103('0x52')](handleError(_0x434357,null));};exports[_0x3103('0x78')]=function(_0x2d5c74,_0x281623){var _0x48312a=_0x2d5c74[_0x3103('0x56')];var _0xbec691=[];if(_0x2d5c74[_0x3103('0x26')][_0x3103('0x1e')]===_0x3103('0x1f'))throw new Error(_0x3103('0x70'));if(_[_0x3103('0x79')](_0x48312a,['role',_0x3103('0x26')])&&_0x2d5c74[_0x3103('0x26')][_0x3103('0x1e')]!==_0x3103('0x24')){throw new Error(_0x3103('0x71'));}if(_['some'](_0x48312a,[_0x3103('0x1e'),_0x3103('0x24')])&&_0x2d5c74[_0x3103('0x26')][_0x3103('0x1e')]!=='admin'){throw new Error(_0x3103('0x7a'));}return licenseUtil[_0x3103('0x7b')](_0x48312a)[_0x3103('0x22')](function(){return validateUser(_0x48312a[0x0]);})['then'](function(){for(var _0x31cf84=0x1;_0x31cf84<_0x48312a['length'];_0x31cf84++){var _0x593e81=_0x48312a[_0x31cf84-0x1]['internal'];if(!_0x48312a[_0x31cf84][_0x3103('0x5a')])_0x48312a[_0x31cf84][_0x3103('0x5a')]=_0x593e81+0x1;_0xbec691[_0x3103('0x4a')](validateUser(_0x48312a[_0x31cf84]));}return Promise[_0x3103('0x7c')](_0xbec691);})['then'](function(){_0xbec691=[];for(var _0x2f4fb1=0x0;_0x2f4fb1<_0x48312a[_0x3103('0x49')];_0x2f4fb1++){_0xbec691[_0x3103('0x4a')](updateUser(_0x48312a[_0x2f4fb1]));}return Promise[_0x3103('0x7c')](_0xbec691);})[_0x3103('0x22')](function(){_0xbec691=_0x48312a[_0x3103('0x2b')](function(_0x178c0a){return db[_0x3103('0x34')][_0x3103('0x74')](_0x178c0a,{'include':[{'model':db[_0x3103('0x65')],'as':_0x3103('0x65')}]})['then'](function(_0x26cfd9){_0x178c0a['id']=_0x26cfd9['id'];return _0x178c0a;});});return Promise[_0x3103('0x7c')](_0xbec691);})[_0x3103('0x22')](function(_0x3eb07d){if(_0x2d5c74[_0x3103('0x56')][_0x3103('0x1e')]===_0x3103('0x26'))return _0x3eb07d;if(_0x2d5c74[_0x3103('0x26')][_0x3103('0x1e')]!=='user')return _0x3eb07d;var _0x1dc379=_['some'](_0x3eb07d,function(_0x216b04){return _0x216b04['role']===_0x3103('0x1f')||_0x216b04[_0x3103('0x1e')]===_0x3103('0x29');});if(!_0x1dc379)return _0x3eb07d;return db[_0x3103('0x75')][_0x3103('0x7d')]({'where':{'name':{'$or':[_0x3103('0x27'),'Telephones']},'userProfileId':_0x2d5c74[_0x3103('0x26')][_0x3103('0x76')]},'raw':!![]})[_0x3103('0x22')](function(_0x167578){if(_['isEmpty'](_0x167578)||!_[_0x3103('0x79')](_0x167578,[_0x3103('0x77'),0x0]))return _0x3eb07d;_0xbec691=[];var _0x52a5eb=_(_0x167578)[_0x3103('0x2b')](function(_0x3f838c){if(_0x3f838c[_0x3103('0x77')]===0x1)return;return _0x3f838c[_0x3103('0x2f')]==='Agents'?'agent':'telephone';})['compact']()['value']();for(var _0x1dc8e3=0x0;_0x1dc8e3<_0x3eb07d[_0x3103('0x49')];_0x1dc8e3++){if(!_[_0x3103('0x2d')](_0x52a5eb,_0x3eb07d[_0x1dc8e3][_0x3103('0x1e')]))return;var _0x128e47=_0x3eb07d[_0x1dc8e3]['role']===_0x3103('0x1f')?_0x3103('0x27'):_0x3103('0x28');_0xbec691[_0x3103('0x4a')](db[_0x3103('0x30')][_0x3103('0x74')]({'name':_0x3eb07d[_0x1dc8e3]['name'],'resourceId':_0x3eb07d[_0x1dc8e3]['id'],'type':_0x128e47,'sectionId':_['find'](_0x167578,[_0x3103('0x2f'),_0x128e47])['id']},{}));}return Promise[_0x3103('0x7c')](_0xbec691);});})['then'](respondWithResult(_0x281623,0xc9))[_0x3103('0x52')](handleError(_0x281623,null));};exports[_0x3103('0x7e')]=function(_0x175d97,_0x1355f9){if(_0x175d97[_0x3103('0x56')]['id']){delete _0x175d97[_0x3103('0x56')]['id'];}return db['User'][_0x3103('0x2e')]({'where':{'id':_0x175d97[_0x3103('0x57')]['id']}})[_0x3103('0x22')](function(_0x262f7a){if(!_0x262f7a)return null;if(_0x262f7a['id']===_0x175d97[_0x3103('0x26')]['id']){if(!_0x175d97['body'][_0x3103('0x7f')]||!_0x175d97[_0x3103('0x56')][_0x3103('0x80')]){throw new db[(_0x3103('0x81'))]['ValidationError'](_0x3103('0x82'));}if(!_0x262f7a[_0x3103('0x83')](_0x175d97[_0x3103('0x56')][_0x3103('0x7f')])){throw new db['Sequelize'][(_0x3103('0x84'))]('Wrong\x20credentials');}if(_0x175d97[_0x3103('0x56')][_0x3103('0x7f')]===_0x175d97[_0x3103('0x56')][_0x3103('0x80')]){throw new db['Sequelize'][(_0x3103('0x84'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x175d97['user'][_0x3103('0x1e')]===_0x3103('0x24')){if(!_0x175d97[_0x3103('0x56')][_0x3103('0x80')]){throw new db[(_0x3103('0x81'))][(_0x3103('0x84'))](_0x3103('0x85'));}}else if(_0x175d97[_0x3103('0x26')][_0x3103('0x1e')]===_0x3103('0x26')){if(!_0x175d97[_0x3103('0x56')][_0x3103('0x80')]){throw new db[(_0x3103('0x81'))][(_0x3103('0x84'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x262f7a[_0x3103('0x1e')]!==_0x3103('0x1f')){throw new db[(_0x3103('0x81'))]['ValidationError'](_0x3103('0x70'));}}else{throw new db['Sequelize'][(_0x3103('0x84'))](_0x3103('0x70'));}return _0x262f7a;})[_0x3103('0x22')](handleEntityNotFound(_0x1355f9,null))[_0x3103('0x22')](function(_0x57467b){return db['Setting']['findOne']({'attributes':['id',_0x3103('0x86'),'enforcePasswordHistory',_0x3103('0x87')]})[_0x3103('0x22')](function(_0x31c525){if(_0x31c525[_0x3103('0x86')])authService[_0x3103('0x88')](_0x175d97[_0x3103('0x56')][_0x3103('0x80')]);if(!_0x31c525['enforcePasswordHistory']||!_0x57467b[_0x3103('0x3a')])return _0x57467b;authService[_0x3103('0x89')](_0x175d97[_0x3103('0x56')][_0x3103('0x80')],_0x57467b[_0x3103('0x3a')],_0x31c525['passwordHistoryLimit']);return _0x57467b;})[_0x3103('0x22')](saveUpdates({'password':_0x175d97['body'][_0x3103('0x80')],'passwordResetAt':_0x175d97['user']['id']==_0x175d97['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x175d97[_0x3103('0x56')]['newPassword'],_0x57467b[_0x3103('0x3a')])},null));})[_0x3103('0x22')](respondWithResult(_0x1355f9,null))['catch'](handleError(_0x1355f9,null));};exports[_0x3103('0x8a')]=function(_0x3f622f,_0x44af0a){var _0x302daa=_0x3f622f[_0x3103('0x56')][_0x3103('0x8b')];return db[_0x3103('0x34')][_0x3103('0x2e')]({'where':{'id':_0x3f622f[_0x3103('0x57')]['id']},'attributes':['id',_0x3103('0x2f'),_0x3103('0x1e'),_0x3103('0x8c'),_0x3103('0x8d'),_0x3103('0x8e'),_0x3103('0x8f')]})[_0x3103('0x22')](handleEntityNotFound(_0x44af0a,null))[_0x3103('0x22')](function(_0x1c0ba0){if(_0x1c0ba0){if(!utils['isValidChannel'](_0x302daa)){throw new db[(_0x3103('0x81'))]['ValidationError'](_0x3103('0x90'));}return _0x1c0ba0[_0x3103('0x91')+_['capitalize'](_0x302daa[_0x3103('0x92')]())+_0x3103('0x93')](_0x3f622f[_0x3103('0x56')][_0x3103('0x94')],{'penalty':_0x3f622f[_0x3103('0x56')][_0x3103('0x95')]||0x0})[_0x3103('0x96')](function(_0x466c87){for(var _0x285819=0x0;_0x285819<_0x3f622f['body'][_0x3103('0x94')][_0x3103('0x49')];_0x285819+=0x1){var _0x11e895={'UserId':Number(_0x3f622f[_0x3103('0x57')]['id'])};_0x11e895[_[_0x3103('0x97')](_0x302daa[_0x3103('0x92')]())+'QueueId']=Number(_0x3f622f[_0x3103('0x56')][_0x3103('0x94')][_0x285819]);socket[_0x3103('0x20')](_0x3103('0x26')+_[_0x3103('0x97')](_0x302daa[_0x3103('0x92')]())+_0x3103('0x98'),_0x11e895);}return _0x466c87;})['then'](function(){if(_0x302daa===_0x3103('0x99')){return db[_0x3103('0x9a')][_0x3103('0x7d')]({'where':{'id':_0x3f622f[_0x3103('0x56')][_0x3103('0x94')]||[]},'raw':!![],'attributes':['id',_0x3103('0x2f')]});}})['then'](function(_0x3dc20f){var _0x37dcba=_0x1c0ba0[_0x3103('0x23')]({'plain':!![]});var _0x34d588=[];if(_0x302daa===_0x3103('0x99')&&_0x37dcba[_0x3103('0x1e')]==='agent'&&_0x37dcba[_0x3103('0x8c')]){for(let _0x48f320=0x0;_0x48f320<_0x3dc20f['length'];_0x48f320+=0x1){_0x34d588[_0x3103('0x4a')]({'membername':_0x37dcba[_0x3103('0x2f')],'UserId':_0x37dcba['id'],'queue_name':_0x3dc20f[_0x48f320][_0x3103('0x2f')],'VoiceQueueId':_0x3dc20f[_0x48f320]['id'],'interface':_['isNil'](_0x37dcba['interface'])?util[_0x3103('0x9b')]('SIP/%s',_0x37dcba['name']):_0x37dcba[_0x3103('0x8f')],'paused':_0x37dcba['voicePause']||![],'penalty':_0x3f622f[_0x3103('0x56')][_0x3103('0x95')]||0x0});}return Promise[_0x3103('0x7c')](_0x34d588[_0x3103('0x2b')](function(_0x56aa58){return db[_0x3103('0x9c')][_0x3103('0x9d')](_0x56aa58);}));}return _0x1c0ba0;});}})[_0x3103('0x22')](respondWithStatusCode(_0x44af0a,null))[_0x3103('0x52')](handleError(_0x44af0a,null));};exports['removeQueues']=function(_0x3c4136,_0x5eec35){var _0x340f04,_0x299d72;return db[_0x3103('0x34')][_0x3103('0x2e')]({'where':{'id':_0x3c4136[_0x3103('0x57')]['id']},'attributes':['id',_0x3103('0x2f'),_0x3103('0x1e')]})[_0x3103('0x22')](handleEntityNotFound(_0x5eec35,null))[_0x3103('0x22')](function(_0x2e48cb){if(_0x2e48cb){_0x340f04=_0x2e48cb;if(!_0x3c4136['query'][_0x3103('0x8b')]||!utils[_0x3103('0x9e')](_0x3c4136['query']['channel'])){throw new db[(_0x3103('0x81'))][(_0x3103('0x84'))](_0x3103('0x90'));}return _0x2e48cb['remove'+_[_0x3103('0x97')](_0x3c4136['query'][_0x3103('0x8b')]['toLowerCase']())+_0x3103('0x93')](_0x3c4136[_0x3103('0x42')][_0x3103('0x94')]);}})[_0x3103('0x22')](function(_0x146f84){if(_[_0x3103('0x9f')](_0x3c4136[_0x3103('0x42')]['ids'])){for(var _0x4bbdb8=0x0;_0x4bbdb8<_0x3c4136[_0x3103('0x42')][_0x3103('0x94')][_0x3103('0x49')];_0x4bbdb8+=0x1){_0x299d72={'UserId':Number(_0x3c4136['params']['id'])};_0x299d72[_[_0x3103('0x97')](_0x3c4136[_0x3103('0x42')][_0x3103('0x8b')][_0x3103('0x92')]())+_0x3103('0xa0')]=Number(_0x3c4136[_0x3103('0x42')][_0x3103('0x94')][_0x4bbdb8]);socket[_0x3103('0x20')](_0x3103('0x26')+_['capitalize'](_0x3c4136['query'][_0x3103('0x8b')][_0x3103('0x92')]())+_0x3103('0xa1'),_0x299d72);}}else{_0x299d72={'UserId':Number(_0x3c4136[_0x3103('0x57')]['id'])};_0x299d72[_['capitalize'](_0x3c4136[_0x3103('0x42')][_0x3103('0x8b')][_0x3103('0x92')]())+_0x3103('0xa0')]=Number(_0x3c4136['query'][_0x3103('0x94')]);socket[_0x3103('0x20')](_0x3103('0x26')+_[_0x3103('0x97')](_0x3c4136['query'][_0x3103('0x8b')]['toLowerCase']())+'Queue:remove',_0x299d72);}return _0x146f84;})[_0x3103('0x22')](function(){if(_0x3c4136[_0x3103('0x42')]['channel']==='voice'){return db[_0x3103('0x9c')][_0x3103('0x21')]({'where':{'UserId':_0x3c4136[_0x3103('0x57')]['id'],'VoiceQueueId':_0x3c4136[_0x3103('0x42')][_0x3103('0x94')]},'individualHooks':!![]})[_0x3103('0x22')](function(){return _0x340f04;});}return _0x340f04;})[_0x3103('0x22')](respondWithStatusCode(_0x5eec35,null))[_0x3103('0x52')](handleError(_0x5eec35,null));};exports[_0x3103('0xa2')]=function(_0x28cbca,_0x1d8057){_0x28cbca[_0x3103('0x56')][_0x3103('0xa3')]=_0x28cbca['file'][_0x3103('0xa4')];return db['User'][_0x3103('0x2e')]({'where':{'id':_0x28cbca['params']['id']}})['then'](handleEntityNotFound(_0x1d8057,null))['then'](saveUpdates(_0x28cbca[_0x3103('0x56')],null))['then'](respondWithResult(_0x1d8057,null))['catch'](handleError(_0x1d8057,null));};exports[_0x3103('0xa5')]=function(_0x3df2d8,_0x4b59b6){var _0x81a549=path[_0x3103('0xa6')](config[_0x3103('0xa7')],_0x3103('0xa8'));return db[_0x3103('0x34')]['find']({'where':{'id':_0x3df2d8[_0x3103('0x57')]['id']},'attributes':['id',_0x3103('0xa3')],'raw':!![]})[_0x3103('0x22')](handleEntityNotFound(_0x4b59b6,null))[_0x3103('0x22')](function(_0x347c5c){if(_0x347c5c){if(_[_0x3103('0x5d')](_0x347c5c[_0x3103('0xa3')])){return _0x4b59b6['download'](_0x81a549);}else{if(!fs[_0x3103('0xa9')](path[_0x3103('0xa6')](config[_0x3103('0xa7')],_0x3103('0xaa'),_0x347c5c[_0x3103('0xa3')]))){return _0x4b59b6['download'](_0x81a549);}return _0x4b59b6['download'](path['join'](config[_0x3103('0xa7')],_0x3103('0xaa'),_0x347c5c['userpic']));}}})[_0x3103('0x52')](handleError(_0x4b59b6,null));};exports[_0x3103('0xab')]=function(_0x5ed81e,_0x17f5e9){return db[_0x3103('0x34')][_0x3103('0x2e')]({'where':{'id':_0x5ed81e[_0x3103('0x57')]['id']},'attributes':['id']})[_0x3103('0x22')](handleEntityNotFound(_0x17f5e9,null))[_0x3103('0x22')](function(_0x43f3a1){var _0x2a3576=[];values=_0x43f3a1['dataValues'];_0x2a3576[_0x3103('0x4a')](get_open_tabs(_0x3103('0x55'),_0x43f3a1['dataValues']));_0x2a3576[_0x3103('0x4a')](get_open_tabs('sms',_0x43f3a1[_0x3103('0x4d')]));_0x2a3576[_0x3103('0x4a')](get_open_tabs(_0x3103('0x50'),_0x43f3a1[_0x3103('0x4d')]));_0x2a3576[_0x3103('0x4a')](get_open_tabs(_0x3103('0x51'),_0x43f3a1[_0x3103('0x4d')]));_0x2a3576[_0x3103('0x4a')](get_open_tabs(_0x3103('0x4e'),_0x43f3a1[_0x3103('0x4d')]));_0x2a3576[_0x3103('0x4a')](get_open_tabs('mail',_0x43f3a1[_0x3103('0x4d')]));return Promise[_0x3103('0x7c')](_0x2a3576);})['then'](function(_0x3fc769){if(_0x3fc769){var _0x4622d3=_[_0x3103('0x2b')](values['ChatOpenTabs'],function(_0x57e460){return{'channel':_0x3103('0xac'),'id':_0x57e460['id'],'createdAt':_0x57e460[_0x3103('0xad')]};});var _0xb66033=_['map'](values['FaxOpenTabs'],function(_0x3db6f7){return{'channel':_0x3103('0xae'),'id':_0x3db6f7['id'],'createdAt':_0x3db6f7[_0x3103('0xad')]};});var _0x12bff4=_[_0x3103('0x2b')](values[_0x3103('0xaf')],function(_0x31f5cb){return{'channel':_0x3103('0xb0'),'id':_0x31f5cb['id'],'createdAt':_0x31f5cb[_0x3103('0xad')]};});var _0x14df93=_[_0x3103('0x2b')](values[_0x3103('0xb1')],function(_0x16f342){return{'channel':_0x3103('0xb2'),'id':_0x16f342['id'],'createdAt':_0x16f342[_0x3103('0xad')]};});var _0x118e0d=_['map'](values[_0x3103('0xb3')],function(_0x17c693){return{'channel':_0x3103('0xb4'),'id':_0x17c693['id'],'createdAt':_0x17c693['createdAt']};});var _0x17373e=_[_0x3103('0x2b')](values['WhatsappOpenTabs'],function(_0x35e121){return{'channel':_0x3103('0xb5'),'id':_0x35e121['id'],'createdAt':_0x35e121['createdAt']};});var _0x4dff76=_[_0x3103('0xb6')](_0x4622d3,_0xb66033,_0x12bff4,_0x14df93,_0x118e0d,_0x17373e);var _0x2ce7ca={'count':_0x4dff76[_0x3103('0x49')],'rows':_0x4dff76};return _0x2ce7ca;}else return null;})[_0x3103('0x22')](respondWithResult(_0x17f5e9,null))[_0x3103('0x52')](handleError(_0x17f5e9,null));};exports[_0x3103('0xb7')]=function(_0x3b2f85,_0x4cd463){var _0xa7e0bc={};return db['User'][_0x3103('0xb8')]({'where':{'id':_0x3b2f85[_0x3103('0x57')]['id']}})[_0x3103('0x22')](function(_0x5c4478){if(!_0x5c4478){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x3b2f85[_0x3103('0x57')]['id']));}return contacts['describe']();})['then'](function(_0x1d4e80){_0x3b2f85['query'][_0x3103('0x34')]=_0x3b2f85['params']['id'];_0xa7e0bc=qs['getOptions'](_0x1d4e80,_0x3b2f85);if(_0x3b2f85[_0x3103('0x42')]['hasOwnProperty']('includeAll')){_0xa7e0bc[_0x3103('0x44')]=[{'model':db[_0x3103('0xb9')],'as':_0x3103('0xba'),'required':![]},{'model':db[_0x3103('0xbb')],'as':_0x3103('0xbc'),'attributes':['id',_0x3103('0x2f'),_0x3103('0xbd')],'where':_0x3b2f85[_0x3103('0x42')]['tag']?{'id':_0x3b2f85[_0x3103('0x42')]['tag']}:undefined,'required':_0x3b2f85[_0x3103('0x42')]['tag']?!![]:![]}];}return contacts['findAll'](_0x3b2f85[_0x3103('0x42')],_0x3b2f85[_0x3103('0x26')],_0xa7e0bc,_0x1d4e80);})['then'](respondWithFilteredResult(_0x4cd463,_0xa7e0bc))[_0x3103('0x52')](APIHandleError(_0x4cd463));};exports[_0x3103('0xbe')]=function(_0x457618,_0x135fae){var _0x553fd7;var _0x4c5faa={};var _0x46cc13;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x457618['params']['id']},'attributes':['id','name',_0x3103('0x1e')]})[_0x3103('0x22')](handleEntityNotFound(_0x135fae,null))[_0x3103('0x22')](function(_0x315ffb){if(!utils[_0x3103('0x9e')](_0x457618[_0x3103('0x42')][_0x3103('0x8b')])){throw new db[(_0x3103('0x81'))]['ValidationError'](_0x3103('0x90'));}_0x553fd7=_0x315ffb;var _0x30665a={};_0x30665a[_0x3103('0xbf')]=_[_0x3103('0xc0')](db[_[_0x3103('0x97')](_0x457618[_0x3103('0x42')][_0x3103('0x8b')])+'Queue'][_0x3103('0x35')]);_0x30665a[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x457618[_0x3103('0x42')]);_0x30665a[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x30665a['model'],_0x30665a[_0x3103('0x42')]);_0x4c5faa[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x30665a[_0x3103('0xbf')],qs['fields'](_0x457618[_0x3103('0x42')][_0x3103('0xc3')]));_0x4c5faa[_0x3103('0x46')]=_0x4c5faa['attributes']['length']?_0x4c5faa[_0x3103('0x46')]:_0x30665a[_0x3103('0xbf')];_0x4c5faa[_0x3103('0xc4')]=qs['sort'](_0x457618['query']['sort']);_0x4c5faa[_0x3103('0x40')]=qs[_0x3103('0xc1')](_['pick'](_0x457618[_0x3103('0x42')],_0x30665a[_0x3103('0xc1')]));if(_0x457618[_0x3103('0x42')][_0x3103('0x2a')]){_0x4c5faa[_0x3103('0x40')]=_[_0x3103('0x53')](_0x4c5faa[_0x3103('0x40')],{'$or':_[_0x3103('0x2b')](_0x4c5faa[_0x3103('0x46')],function(_0x4b1a36){var _0x290e57={};_0x290e57[_0x4b1a36]={'$like':'%'+_0x457618['query'][_0x3103('0x2a')]+'%'};return _0x290e57;})});}_0x4c5faa=_[_0x3103('0x53')]({},_0x4c5faa,_0x457618[_0x3103('0x54')]);switch(_0x553fd7[_0x3103('0x1e')]){case'admin':return db[_[_0x3103('0x97')](_0x457618[_0x3103('0x42')][_0x3103('0x8b')])+_0x3103('0xc5')][_0x3103('0x7d')](_0x4c5faa);case _0x3103('0x26'):case _0x3103('0x1f'):return _0x553fd7[_0x3103('0x23')+_['capitalize'](_0x457618[_0x3103('0x42')][_0x3103('0x8b')])+_0x3103('0x93')](_0x4c5faa);default:throw new db[(_0x3103('0x81'))][(_0x3103('0x84'))](_0x3103('0xc6'));}})['then'](function(_0x57371d){_0x46cc13=_0x57371d[_0x3103('0x49')];if(!_0x457618['query'][_0x3103('0xc7')](_0x3103('0xc8'))){_0x4c5faa['limit']=qs[_0x3103('0x19')](_0x457618['query']['limit']);_0x4c5faa[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x457618[_0x3103('0x42')][_0x3103('0x17')]);}switch(_0x553fd7['role']){case'admin':return db[_[_0x3103('0x97')](_0x457618[_0x3103('0x42')]['channel'])+'Queue'][_0x3103('0x7d')](_0x4c5faa);case _0x3103('0x26'):case'agent':return _0x553fd7[_0x3103('0x23')+_[_0x3103('0x97')](_0x457618[_0x3103('0x42')][_0x3103('0x8b')])+_0x3103('0x93')](_0x4c5faa);}})[_0x3103('0x22')](function(_0xf98dd8){return{'count':_0x46cc13,'rows':_0xf98dd8};})[_0x3103('0x22')](respondWithResult(_0x135fae,null))[_0x3103('0x52')](handleError(_0x135fae,null));};exports[_0x3103('0xc9')]=function(_0x49927e,_0x44fee8){var _0x117dce={};var _0x3f60c0={};var _0x3ed69d;var _0x3992d5;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x49927e[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x44fee8,null))[_0x3103('0x22')](function(_0x5025ec){if(_0x5025ec){_0x3ed69d=_0x5025ec;_0x3f60c0[_0x3103('0xbf')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x3f60c0[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x49927e['query']);_0x3f60c0[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x3f60c0[_0x3103('0xbf')],_0x3f60c0[_0x3103('0x42')]);_0x117dce[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x3f60c0['model'],qs[_0x3103('0xc3')](_0x49927e[_0x3103('0x42')]['fields']));_0x117dce[_0x3103('0x46')]=_0x117dce[_0x3103('0x46')]['length']?_0x117dce['attributes']:_0x3f60c0[_0x3103('0xbf')];_0x117dce[_0x3103('0xc4')]=qs['sort'](_0x49927e[_0x3103('0x42')]['sort']);_0x117dce[_0x3103('0x40')]=qs[_0x3103('0xc1')](_['pick'](_0x49927e[_0x3103('0x42')],_0x3f60c0[_0x3103('0xc1')]));if(_0x49927e[_0x3103('0x42')][_0x3103('0x2a')]){_0x117dce[_0x3103('0x40')]=_['merge'](_0x117dce[_0x3103('0x40')],{'$or':_[_0x3103('0x2b')](_0x117dce['attributes'],function(_0x292cdb){var _0x10890f={};_0x10890f[_0x292cdb]={'$like':'%'+_0x49927e[_0x3103('0x42')][_0x3103('0x2a')]+'%'};return _0x10890f;})});}_0x117dce=_[_0x3103('0x53')]({},_0x117dce,_0x49927e['options']);return _0x3ed69d[_0x3103('0xc9')](_0x117dce);}})[_0x3103('0x22')](function(_0x5f1b6a){if(_0x5f1b6a){_0x3992d5=_0x5f1b6a['length'];if(!_0x49927e[_0x3103('0x42')][_0x3103('0xc7')](_0x3103('0xc8'))){_0x117dce[_0x3103('0x19')]=qs[_0x3103('0x19')](_0x49927e[_0x3103('0x42')][_0x3103('0x19')]);_0x117dce[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x49927e[_0x3103('0x42')][_0x3103('0x17')]);}return _0x3ed69d[_0x3103('0xc9')](_0x117dce);}})[_0x3103('0x22')](function(_0x1155fd){if(_0x1155fd){return _0x1155fd?{'count':_0x3992d5,'rows':_0x1155fd}:null;}})['then'](respondWithResult(_0x44fee8,null))[_0x3103('0x52')](handleError(_0x44fee8,null));};exports[_0x3103('0xca')]=function(_0x2ec0ad,_0x4ea3ee){var _0x2840c2={};var _0x3062e6={};var _0x15b555;var _0x3a45eb;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x2ec0ad[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x4ea3ee,null))[_0x3103('0x22')](function(_0x4b072a){if(_0x4b072a){_0x15b555=_0x4b072a;_0x3062e6['model']=_[_0x3103('0xc0')](db[_0x3103('0xcb')][_0x3103('0x35')]);_0x3062e6[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x2ec0ad[_0x3103('0x42')]);_0x3062e6[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x3062e6[_0x3103('0xbf')],_0x3062e6[_0x3103('0x42')]);_0x2840c2[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x3062e6[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x2ec0ad[_0x3103('0x42')][_0x3103('0xc3')]));_0x2840c2[_0x3103('0x46')]=_0x2840c2[_0x3103('0x46')]['length']?_0x2840c2[_0x3103('0x46')]:_0x3062e6[_0x3103('0xbf')];_0x2840c2[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x2ec0ad['query'][_0x3103('0xcc')]);_0x2840c2[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x2ec0ad[_0x3103('0x42')],_0x3062e6[_0x3103('0xc1')]));if(_0x2ec0ad[_0x3103('0x42')]['filter']){_0x2840c2['where']=_[_0x3103('0x53')](_0x2840c2[_0x3103('0x40')],{'$or':_[_0x3103('0x2b')](_0x2840c2[_0x3103('0x46')],function(_0x2334ef){var _0x28f725={};_0x28f725[_0x2334ef]={'$like':'%'+_0x2ec0ad['query'][_0x3103('0x2a')]+'%'};return _0x28f725;})});}_0x2840c2=_[_0x3103('0x53')]({},_0x2840c2,_0x2ec0ad[_0x3103('0x54')]);return _0x15b555[_0x3103('0xca')](_0x2840c2);}})['then'](function(_0x14c5b4){if(_0x14c5b4){_0x3a45eb=_0x14c5b4[_0x3103('0x49')];if(!_0x2ec0ad[_0x3103('0x42')][_0x3103('0xc7')](_0x3103('0xc8'))){_0x2840c2[_0x3103('0x19')]=qs[_0x3103('0x19')](_0x2ec0ad[_0x3103('0x42')][_0x3103('0x19')]);_0x2840c2[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x2ec0ad[_0x3103('0x42')]['offset']);}return _0x15b555[_0x3103('0xca')](_0x2840c2);}})['then'](function(_0x250a33){if(_0x250a33){return _0x250a33?{'count':_0x3a45eb,'rows':_0x250a33}:null;}})[_0x3103('0x22')](respondWithResult(_0x4ea3ee,null))[_0x3103('0x52')](handleError(_0x4ea3ee,null));};exports[_0x3103('0xce')]=function(_0x1f7407,_0xbe8ce8){var _0x31b299={'raw':!![],'where':{}};var _0x3a2bf8={};var _0x56d83b={'count':0x0,'rows':[]};return db['User'][_0x3103('0xb8')]({'where':{'id':_0x1f7407[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0xbe8ce8,null))[_0x3103('0x22')](function(_0x16d407){if(_0x16d407){_0x3a2bf8[_0x3103('0xbf')]=_[_0x3103('0xc0')](db[_0x3103('0xcf')][_0x3103('0x35')]);_0x3a2bf8['query']=_[_0x3103('0xc0')](_0x1f7407[_0x3103('0x42')]);_0x3a2bf8[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x3a2bf8['model'],_0x3a2bf8[_0x3103('0x42')]);_0x31b299[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x3a2bf8[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x1f7407['query'][_0x3103('0xc3')]));_0x31b299[_0x3103('0x46')]=_0x31b299[_0x3103('0x46')][_0x3103('0x49')]?_0x31b299[_0x3103('0x46')]:_0x3a2bf8['model'];if(!_0x1f7407['query'][_0x3103('0xc7')]('nolimit')){_0x31b299['limit']=qs[_0x3103('0x19')](_0x1f7407[_0x3103('0x42')][_0x3103('0x19')]);_0x31b299[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x1f7407[_0x3103('0x42')][_0x3103('0x17')]);}_0x31b299[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x1f7407['query'][_0x3103('0xcc')]);_0x31b299[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x1f7407['query'],_0x3a2bf8[_0x3103('0xc1')]));_0x31b299['where']['UserId']=_0x16d407['id'];if(_0x1f7407['query']['filter']){_0x31b299['where']=_[_0x3103('0x53')](_0x31b299['where'],{'$or':_[_0x3103('0x2b')](_0x31b299[_0x3103('0x46')],function(_0x429d16){var _0x3ddb3e={};_0x3ddb3e[_0x429d16]={'$like':'%'+_0x1f7407[_0x3103('0x42')][_0x3103('0x2a')]+'%'};return _0x3ddb3e;})});}_0x31b299=_[_0x3103('0x53')]({},_0x31b299,_0x1f7407[_0x3103('0x54')]);return db[_0x3103('0xcf')]['count']({'where':_0x31b299[_0x3103('0x40')]})['then'](function(_0x48d673){_0x56d83b[_0x3103('0x1a')]=_0x48d673;if(_0x1f7407[_0x3103('0x42')]['includeAll']){_0x31b299['include']=[{'all':!![]}];}return db[_0x3103('0xcf')][_0x3103('0x7d')](_0x31b299);})[_0x3103('0x22')](function(_0x37eb5a){_0x56d83b[_0x3103('0x4c')]=_0x37eb5a;return _0x56d83b;});}})[_0x3103('0x22')](respondWithFilteredResult(_0xbe8ce8,_0x31b299))[_0x3103('0x52')](handleError(_0xbe8ce8,null));};exports[_0x3103('0xd0')]=function(_0x5afe71,_0x5c2813){var _0x1a3791={'raw':!![],'where':{}};var _0x39b30a={};var _0x5d9d76={'count':0x0,'rows':[]};return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x5afe71['params']['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x5c2813,null))[_0x3103('0x22')](function(_0xa8a5c9){if(_0xa8a5c9){_0x39b30a[_0x3103('0xbf')]=_[_0x3103('0xc0')](db[_0x3103('0xd1')]['rawAttributes']);_0x39b30a[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x5afe71[_0x3103('0x42')]);_0x39b30a[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x39b30a[_0x3103('0xbf')],_0x39b30a['query']);_0x1a3791[_0x3103('0x46')]=_['intersection'](_0x39b30a['model'],qs[_0x3103('0xc3')](_0x5afe71[_0x3103('0x42')][_0x3103('0xc3')]));_0x1a3791[_0x3103('0x46')]=_0x1a3791[_0x3103('0x46')][_0x3103('0x49')]?_0x1a3791[_0x3103('0x46')]:_0x39b30a[_0x3103('0xbf')];if(!_0x5afe71[_0x3103('0x42')][_0x3103('0xc7')](_0x3103('0xc8'))){_0x1a3791['limit']=qs[_0x3103('0x19')](_0x5afe71[_0x3103('0x42')][_0x3103('0x19')]);_0x1a3791[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x5afe71[_0x3103('0x42')][_0x3103('0x17')]);}_0x1a3791[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x5afe71[_0x3103('0x42')]['sort']);_0x1a3791[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x5afe71[_0x3103('0x42')],_0x39b30a[_0x3103('0xc1')]));_0x1a3791[_0x3103('0x40')][_0x3103('0xd2')]=_0xa8a5c9['id'];if(_0x5afe71[_0x3103('0x42')]['filter']){_0x1a3791[_0x3103('0x40')]=_[_0x3103('0x53')](_0x1a3791[_0x3103('0x40')],{'$or':_['map'](_0x1a3791['attributes'],function(_0x2c8aff){var _0x3ea763={};_0x3ea763[_0x2c8aff]={'$like':'%'+_0x5afe71[_0x3103('0x42')]['filter']+'%'};return _0x3ea763;})});}_0x1a3791=_[_0x3103('0x53')]({},_0x1a3791,_0x5afe71['options']);return db[_0x3103('0xd1')]['count']({'where':_0x1a3791[_0x3103('0x40')]})[_0x3103('0x22')](function(_0x2de65e){_0x5d9d76[_0x3103('0x1a')]=_0x2de65e;if(_0x5afe71[_0x3103('0x42')][_0x3103('0x41')]){_0x1a3791[_0x3103('0x44')]=[{'all':!![]}];}return db[_0x3103('0xd1')][_0x3103('0x7d')](_0x1a3791);})['then'](function(_0x558b62){_0x5d9d76[_0x3103('0x4c')]=_0x558b62;return _0x5d9d76;});}})['then'](respondWithFilteredResult(_0x5c2813,_0x1a3791))[_0x3103('0x52')](handleError(_0x5c2813,null));};exports[_0x3103('0xd3')]=function(_0x50f214,_0x5977f3){var _0x2e6c9a={};var _0x578a46={};var _0x59e75d;var _0x5cd6aa;return db['User']['findOne']({'where':{'id':_0x50f214[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x5977f3,null))[_0x3103('0x22')](function(_0x229bb7){if(_0x229bb7){_0x59e75d=_0x229bb7;_0x578a46[_0x3103('0xbf')]=_[_0x3103('0xc0')](db[_0x3103('0xd4')][_0x3103('0x35')]);_0x578a46[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x50f214['query']);_0x578a46[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x578a46[_0x3103('0xbf')],_0x578a46[_0x3103('0x42')]);_0x2e6c9a[_0x3103('0x46')]=_['intersection'](_0x578a46[_0x3103('0xbf')],qs['fields'](_0x50f214[_0x3103('0x42')][_0x3103('0xc3')]));_0x2e6c9a[_0x3103('0x46')]=_0x2e6c9a[_0x3103('0x46')]['length']?_0x2e6c9a[_0x3103('0x46')]:_0x578a46[_0x3103('0xbf')];_0x2e6c9a[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x50f214[_0x3103('0x42')][_0x3103('0xcc')]);_0x2e6c9a[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x50f214['query'],_0x578a46[_0x3103('0xc1')]));if(_0x50f214[_0x3103('0x42')][_0x3103('0x2a')]){_0x2e6c9a[_0x3103('0x40')]=_[_0x3103('0x53')](_0x2e6c9a[_0x3103('0x40')],{'$or':_[_0x3103('0x2b')](_0x2e6c9a[_0x3103('0x46')],function(_0x1da397){var _0x20b628={};_0x20b628[_0x1da397]={'$like':'%'+_0x50f214['query'][_0x3103('0x2a')]+'%'};return _0x20b628;})});}_0x2e6c9a=_[_0x3103('0x53')]({},_0x2e6c9a,_0x50f214[_0x3103('0x54')]);return _0x59e75d[_0x3103('0xd3')](_0x2e6c9a);}})[_0x3103('0x22')](function(_0x2c1236){if(_0x2c1236){_0x5cd6aa=_0x2c1236[_0x3103('0x49')];if(!_0x50f214[_0x3103('0x42')][_0x3103('0xc7')](_0x3103('0xc8'))){_0x2e6c9a['limit']=qs[_0x3103('0x19')](_0x50f214[_0x3103('0x42')]['limit']);_0x2e6c9a[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x50f214[_0x3103('0x42')][_0x3103('0x17')]);}return _0x59e75d[_0x3103('0xd3')](_0x2e6c9a);}})['then'](function(_0x4becf7){if(_0x4becf7){return _0x4becf7?{'count':_0x5cd6aa,'rows':_0x4becf7}:null;}})[_0x3103('0x22')](respondWithResult(_0x5977f3,null))['catch'](handleError(_0x5977f3,null));};exports[_0x3103('0xd5')]=function(_0x2b447f,_0x24de78){var _0x17c7c1={};var _0x5ee6c6={};var _0x2a2f63;var _0x973cb9;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x2b447f[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x24de78,null))['then'](function(_0x35ff0d){if(_0x35ff0d){_0x2a2f63=_0x35ff0d;_0x5ee6c6[_0x3103('0xbf')]=_[_0x3103('0xc0')](db['OpenchannelInteraction'][_0x3103('0x35')]);_0x5ee6c6[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x2b447f[_0x3103('0x42')]);_0x5ee6c6[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x5ee6c6[_0x3103('0xbf')],_0x5ee6c6[_0x3103('0x42')]);_0x17c7c1[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x5ee6c6[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x2b447f[_0x3103('0x42')][_0x3103('0xc3')]));_0x17c7c1[_0x3103('0x46')]=_0x17c7c1[_0x3103('0x46')][_0x3103('0x49')]?_0x17c7c1[_0x3103('0x46')]:_0x5ee6c6[_0x3103('0xbf')];_0x17c7c1[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x2b447f[_0x3103('0x42')][_0x3103('0xcc')]);_0x17c7c1[_0x3103('0x40')]=qs['filters'](_[_0x3103('0xcd')](_0x2b447f['query'],_0x5ee6c6['filters']));if(_0x2b447f[_0x3103('0x42')][_0x3103('0x2a')]){_0x17c7c1[_0x3103('0x40')]=_['merge'](_0x17c7c1[_0x3103('0x40')],{'$or':_['map'](_0x17c7c1[_0x3103('0x46')],function(_0xf861c1){var _0x11a8cc={};_0x11a8cc[_0xf861c1]={'$like':'%'+_0x2b447f['query'][_0x3103('0x2a')]+'%'};return _0x11a8cc;})});}_0x17c7c1=_[_0x3103('0x53')]({},_0x17c7c1,_0x2b447f[_0x3103('0x54')]);return _0x2a2f63[_0x3103('0xd5')](_0x17c7c1);}})['then'](function(_0x2c0fd8){if(_0x2c0fd8){_0x973cb9=_0x2c0fd8[_0x3103('0x49')];if(!_0x2b447f[_0x3103('0x42')][_0x3103('0xc7')](_0x3103('0xc8'))){_0x17c7c1[_0x3103('0x19')]=qs[_0x3103('0x19')](_0x2b447f[_0x3103('0x42')][_0x3103('0x19')]);_0x17c7c1[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x2b447f[_0x3103('0x42')][_0x3103('0x17')]);}return _0x2a2f63[_0x3103('0xd5')](_0x17c7c1);}})['then'](function(_0x5e5edd){if(_0x5e5edd){return _0x5e5edd?{'count':_0x973cb9,'rows':_0x5e5edd}:null;}})[_0x3103('0x22')](respondWithResult(_0x24de78,null))[_0x3103('0x52')](handleError(_0x24de78,null));};exports[_0x3103('0xd6')]=function(_0x20a691,_0x81cfa){var _0xf3e5c3={'raw':!![],'where':{}};var _0x5bd99e={};var _0x5b8b13={'count':0x0,'rows':[]};return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x20a691[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x81cfa,null))[_0x3103('0x22')](function(_0x1cc880){if(_0x1cc880){_0x5bd99e[_0x3103('0xbf')]=_[_0x3103('0xc0')](db[_0x3103('0xd7')][_0x3103('0x35')]);_0x5bd99e[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x20a691['query']);_0x5bd99e[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x5bd99e[_0x3103('0xbf')],_0x5bd99e[_0x3103('0x42')]);_0xf3e5c3[_0x3103('0x46')]=_['intersection'](_0x5bd99e[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x20a691[_0x3103('0x42')][_0x3103('0xc3')]));_0xf3e5c3[_0x3103('0x46')]=_0xf3e5c3[_0x3103('0x46')][_0x3103('0x49')]?_0xf3e5c3['attributes']:_0x5bd99e['model'];if(!_0x20a691[_0x3103('0x42')]['hasOwnProperty'](_0x3103('0xc8'))){_0xf3e5c3[_0x3103('0x19')]=qs[_0x3103('0x19')](_0x20a691[_0x3103('0x42')]['limit']);_0xf3e5c3['offset']=qs[_0x3103('0x17')](_0x20a691['query'][_0x3103('0x17')]);}_0xf3e5c3[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x20a691[_0x3103('0x42')]['sort']);_0xf3e5c3[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x20a691[_0x3103('0x42')],_0x5bd99e['filters']));_0xf3e5c3['where']['UserId']=_0x1cc880['id'];if(_0x20a691[_0x3103('0x42')][_0x3103('0x2a')]){_0xf3e5c3['where']=_[_0x3103('0x53')](_0xf3e5c3[_0x3103('0x40')],{'$or':_[_0x3103('0x2b')](_0xf3e5c3[_0x3103('0x46')],function(_0x5859dd){var _0x14b2a2={};_0x14b2a2[_0x5859dd]={'$like':'%'+_0x20a691['query']['filter']+'%'};return _0x14b2a2;})});}_0xf3e5c3=_[_0x3103('0x53')]({},_0xf3e5c3,_0x20a691[_0x3103('0x54')]);return db[_0x3103('0xd7')][_0x3103('0x1a')]({'where':_0xf3e5c3['where']})[_0x3103('0x22')](function(_0x42998b){_0x5b8b13[_0x3103('0x1a')]=_0x42998b;if(_0x20a691['query'][_0x3103('0x41')]){_0xf3e5c3[_0x3103('0x44')]=[{'all':!![]}];}return db[_0x3103('0xd7')][_0x3103('0x7d')](_0xf3e5c3);})[_0x3103('0x22')](function(_0x5b03d9){_0x5b8b13[_0x3103('0x4c')]=_0x5b03d9;return _0x5b8b13;});}})['then'](respondWithFilteredResult(_0x81cfa,_0xf3e5c3))[_0x3103('0x52')](handleError(_0x81cfa,null));};exports['getSmsInteractions']=function(_0x92499e,_0x22a820){var _0x7f852={};var _0x87312c={};var _0x4ddef1;var _0x5df63a;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x92499e[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x22a820,null))[_0x3103('0x22')](function(_0x35e727){if(_0x35e727){_0x4ddef1=_0x35e727;_0x87312c[_0x3103('0xbf')]=_['keys'](db[_0x3103('0xd8')]['rawAttributes']);_0x87312c[_0x3103('0x42')]=_['keys'](_0x92499e[_0x3103('0x42')]);_0x87312c['filters']=_[_0x3103('0xc2')](_0x87312c[_0x3103('0xbf')],_0x87312c[_0x3103('0x42')]);_0x7f852['attributes']=_[_0x3103('0xc2')](_0x87312c[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x92499e['query'][_0x3103('0xc3')]));_0x7f852[_0x3103('0x46')]=_0x7f852[_0x3103('0x46')]['length']?_0x7f852[_0x3103('0x46')]:_0x87312c[_0x3103('0xbf')];_0x7f852[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x92499e[_0x3103('0x42')][_0x3103('0xcc')]);_0x7f852[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x92499e['query'],_0x87312c[_0x3103('0xc1')]));if(_0x92499e['query'][_0x3103('0x2a')]){_0x7f852[_0x3103('0x40')]=_['merge'](_0x7f852['where'],{'$or':_[_0x3103('0x2b')](_0x7f852[_0x3103('0x46')],function(_0x17eca6){var _0x1cdc3a={};_0x1cdc3a[_0x17eca6]={'$like':'%'+_0x92499e['query'][_0x3103('0x2a')]+'%'};return _0x1cdc3a;})});}_0x7f852=_[_0x3103('0x53')]({},_0x7f852,_0x92499e['options']);return _0x4ddef1[_0x3103('0xd9')](_0x7f852);}})['then'](function(_0x13cb4b){if(_0x13cb4b){_0x5df63a=_0x13cb4b[_0x3103('0x49')];if(!_0x92499e['query'][_0x3103('0xc7')]('nolimit')){_0x7f852[_0x3103('0x19')]=qs[_0x3103('0x19')](_0x92499e['query']['limit']);_0x7f852[_0x3103('0x17')]=qs['offset'](_0x92499e[_0x3103('0x42')]['offset']);}return _0x4ddef1['getSmsInteractions'](_0x7f852);}})['then'](function(_0xabea62){if(_0xabea62){return _0xabea62?{'count':_0x5df63a,'rows':_0xabea62}:null;}})[_0x3103('0x22')](respondWithResult(_0x22a820,null))['catch'](handleError(_0x22a820,null));};exports[_0x3103('0xda')]=function(_0x3586d0,_0x36edca){var _0x1f92e5={};var _0x16fbe6={};var _0x15e2a4;var _0x1352b4;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x3586d0[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x36edca,null))[_0x3103('0x22')](function(_0x232610){if(_0x232610){_0x15e2a4=_0x232610;_0x16fbe6[_0x3103('0xbf')]=_['keys'](db[_0x3103('0xdb')][_0x3103('0x35')]);_0x16fbe6[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x3586d0['query']);_0x16fbe6[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x16fbe6['model'],_0x16fbe6[_0x3103('0x42')]);_0x1f92e5['attributes']=_[_0x3103('0xc2')](_0x16fbe6[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x3586d0['query'][_0x3103('0xc3')]));_0x1f92e5['attributes']=_0x1f92e5[_0x3103('0x46')]['length']?_0x1f92e5['attributes']:_0x16fbe6['model'];_0x1f92e5[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x3586d0[_0x3103('0x42')][_0x3103('0xcc')]);_0x1f92e5[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x3586d0[_0x3103('0x42')],_0x16fbe6[_0x3103('0xc1')]));if(_0x3586d0[_0x3103('0x42')][_0x3103('0x2a')]){_0x1f92e5[_0x3103('0x40')]=_[_0x3103('0x53')](_0x1f92e5['where'],{'$or':_['map'](_0x1f92e5[_0x3103('0x46')],function(_0x17a1cd){var _0x1698b6={};_0x1698b6[_0x17a1cd]={'$like':'%'+_0x3586d0[_0x3103('0x42')][_0x3103('0x2a')]+'%'};return _0x1698b6;})});}_0x1f92e5=_[_0x3103('0x53')]({},_0x1f92e5,_0x3586d0['options']);return _0x15e2a4['getFaxInteractions'](_0x1f92e5);}})['then'](function(_0x286167){if(_0x286167){_0x1352b4=_0x286167['length'];if(!_0x3586d0[_0x3103('0x42')]['hasOwnProperty'](_0x3103('0xc8'))){_0x1f92e5['limit']=qs[_0x3103('0x19')](_0x3586d0['query'][_0x3103('0x19')]);_0x1f92e5[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x3586d0[_0x3103('0x42')][_0x3103('0x17')]);}return _0x15e2a4[_0x3103('0xda')](_0x1f92e5);}})[_0x3103('0x22')](function(_0x33807b){if(_0x33807b){return _0x33807b?{'count':_0x1352b4,'rows':_0x33807b}:null;}})[_0x3103('0x22')](respondWithResult(_0x36edca,null))[_0x3103('0x52')](handleError(_0x36edca,null));};exports[_0x3103('0xdc')]=function(_0x1a6c47,_0xc9ff4c){var _0x27c4e6={};var _0x40c00e={};var _0x285ba3;var _0x2e3c03;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x1a6c47[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0xc9ff4c,null))[_0x3103('0x22')](function(_0x57e858){if(_0x57e858){_0x285ba3=_0x57e858;_0x40c00e['model']=_[_0x3103('0xc0')](db[_0x3103('0xdd')][_0x3103('0x35')]);_0x40c00e[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x1a6c47[_0x3103('0x42')]);_0x40c00e[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x40c00e[_0x3103('0xbf')],_0x40c00e[_0x3103('0x42')]);_0x27c4e6[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x40c00e[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x1a6c47[_0x3103('0x42')][_0x3103('0xc3')]));_0x27c4e6[_0x3103('0x46')]=_0x27c4e6[_0x3103('0x46')][_0x3103('0x49')]?_0x27c4e6['attributes']:_0x40c00e[_0x3103('0xbf')];_0x27c4e6[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x1a6c47[_0x3103('0x42')]['sort']);_0x27c4e6[_0x3103('0x40')]=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0x1a6c47[_0x3103('0x42')],_0x40c00e[_0x3103('0xc1')]));if(_0x1a6c47[_0x3103('0x42')]['filter']){_0x27c4e6[_0x3103('0x40')]=_[_0x3103('0x53')](_0x27c4e6[_0x3103('0x40')],{'$or':_['map'](_0x27c4e6['attributes'],function(_0xd918e6){var _0x525793={};_0x525793[_0xd918e6]={'$like':'%'+_0x1a6c47[_0x3103('0x42')][_0x3103('0x2a')]+'%'};return _0x525793;})});}_0x27c4e6=_[_0x3103('0x53')]({},_0x27c4e6,_0x1a6c47[_0x3103('0x54')]);return _0x285ba3[_0x3103('0xdc')](_0x27c4e6);}})[_0x3103('0x22')](function(_0x19e46c){if(_0x19e46c){_0x2e3c03=_0x19e46c[_0x3103('0x49')];if(!_0x1a6c47[_0x3103('0x42')][_0x3103('0xc7')](_0x3103('0xc8'))){_0x27c4e6[_0x3103('0x19')]=qs[_0x3103('0x19')](_0x1a6c47[_0x3103('0x42')][_0x3103('0x19')]);_0x27c4e6[_0x3103('0x17')]=qs[_0x3103('0x17')](_0x1a6c47[_0x3103('0x42')]['offset']);}return _0x285ba3['getWhatsappInteractions'](_0x27c4e6);}})['then'](function(_0x51298b){if(_0x51298b){return _0x51298b?{'count':_0x2e3c03,'rows':_0x51298b}:null;}})[_0x3103('0x22')](respondWithResult(_0xc9ff4c,null))['catch'](handleError(_0xc9ff4c,null));};exports[_0x3103('0xde')]=function(_0x4ad3f2,_0x1e1ee8,_0x40de4){var _0x47ee53;var _0x388d58;var _0x2ebb8a;var _0x2ee115=!_[_0x3103('0x5d')](_0x4ad3f2['params']['id'])?_0x4ad3f2['params']['id']:!_[_0x3103('0x5d')](_0x4ad3f2['user']['id'])?_0x4ad3f2[_0x3103('0x26')]['id']:null;return db['User'][_0x3103('0x2e')]({'where':{'id':_0x2ee115,'role':{'$or':[_0x3103('0x24'),_0x3103('0x26'),'agent']}},'attributes':['id','name','phone',_0x3103('0xdf'),_0x3103('0x1e'),_0x3103('0x5a'),'loginInPause']})['then'](function(_0xff7201){if(_0xff7201){if(_0xff7201[_0x3103('0x1e')]===_0x3103('0x1f')){_0x47ee53=_0xff7201;if(_0x4ad3f2[_0x3103('0x56')][_0x3103('0x8f')]){_0x2ebb8a=util[_0x3103('0x9b')]('LOCAL/%s@from-sip/n',_0x47ee53[_0x4ad3f2[_0x3103('0x56')][_0x3103('0x8f')]]);}else if(_0x4ad3f2[_0x3103('0x56')][_0x3103('0xe0')]){_0x2ebb8a=util[_0x3103('0x9b')]('SIP/%s',_0x4ad3f2[_0x3103('0x56')]['intrf']);}else{_0x2ebb8a=util[_0x3103('0x9b')](_0x3103('0xe1'),_0x47ee53[_0x3103('0x2f')]);}socket['to'](util['format'](_0x3103('0xe2'),_0x47ee53[_0x3103('0x2f')]))[_0x3103('0x20')](_0x3103('0xe3'),{'user':{'id':_0x47ee53['id'],'name':_0x47ee53[_0x3103('0x2f')]},'ip':_0x4ad3f2[_0x3103('0xe4')][_0x3103('0xe5')]||_0x4ad3f2[_0x3103('0xe6')][_0x3103('0xe7')]||_0x4ad3f2[_0x3103('0xe8')][_0x3103('0xe7')]||_0x4ad3f2[_0x3103('0xe6')][_0x3103('0xe8')]['remoteAddress']});return db['UserVoiceQueueRt'][_0x3103('0x21')]({'where':{'membername':_0x47ee53['name']},'individualHooks':!![]});}}else{throw new db[(_0x3103('0x81'))][(_0x3103('0x84'))](_0x3103('0xe9'));}})[_0x3103('0x22')](function(){if(_0x47ee53){return _0x47ee53['getVoiceQueues']({'raw':!![]});}})[_0x3103('0x22')](function(_0x5afbc4){if(_0x47ee53){if(_0x5afbc4){_0x388d58=_0x5afbc4;if(_0x388d58['length']){var _0x1e1262=_0x388d58[_0x3103('0x2b')](function(_0x1dad86){var _0x46b0cf={'membername':_0x47ee53[_0x3103('0x2f')],'UserId':_0x47ee53['id'],'queue_name':_0x1dad86[_0x3103('0x2f')],'VoiceQueueId':_0x1dad86['id'],'interface':_0x2ebb8a,'paused':_0x47ee53[_0x3103('0x8d')]||![],'penalty':_0x1dad86[_0x3103('0xea')]||0x0};return db['UserVoiceQueueRt'][_0x3103('0x9d')](_0x46b0cf);});return Promise[_0x3103('0x7c')](_0x1e1262);}}}})[_0x3103('0x22')](function(){if(_0x47ee53){return db[_0x3103('0xeb')]['findAll']({'where':{'membername':_0x47ee53[_0x3103('0x2f')],'exitAt':null}});}})['then'](function(_0x498324){if(_0x47ee53){var _0x4e85e5=[];_0x498324[_0x3103('0xec')](function(_0x3879df){_0x4e85e5[_0x3103('0x4a')](_0x3879df[_0x3103('0x1d')]({'exitAt':moment()[_0x3103('0x9b')](_0x3103('0xed'))}));});return Promise[_0x3103('0x7c')](_0x4e85e5);}})['then'](function(){if(_0x47ee53){var _0x5a99ed=[];var _0x1a9e5f=[];var _0x1a53ea=utils['getChannels']();var _0x2a0449={'membername':_0x47ee53[_0x3103('0x2f')],'interface':_0x2ebb8a,'enterAt':moment()['format'](_0x3103('0xed')),'role':_0x47ee53[_0x3103('0x1e')],'internal':_0x47ee53[_0x3103('0x5a')]};_0x1a53ea[_0x3103('0xec')](function(_0x26b44d){_0x5a99ed[_0x3103('0x4a')](_['merge']({'channel':_0x26b44d,'type':_0x3103('0xee'),'data1':_0x4ad3f2['body'][_0x3103('0xef')],'data2':_0x2ebb8a},_0x2a0449));if(_0x47ee53[_0x3103('0x8d')]){_0x1a9e5f['push'](_['merge']({'channel':_0x26b44d,'type':_0x3103('0xf0'),'data1':'LOGININPAUSE'},_0x2a0449));}});return db[_0x3103('0xeb')][_0x3103('0x78')](_0x5a99ed[_0x3103('0xb6')](_0x1a9e5f),{'individualHooks':!![]});}})[_0x3103('0x22')](function(){if(_0x47ee53){return _0x47ee53[_0x3103('0x1d')]({'online':!![],'lastLoginAt':moment()[_0x3103('0x9b')](_0x3103('0xed')),'voicePause':_0x47ee53[_0x3103('0x8d')]||![],'mailPause':_0x47ee53[_0x3103('0x8d')]||![],'chatPause':_0x47ee53[_0x3103('0x8d')]||![],'faxPause':_0x47ee53['loginInPause']||![],'smsPause':_0x47ee53[_0x3103('0x8d')]||![],'openchannelPause':_0x47ee53['loginInPause']||![],'whatsappPause':_0x47ee53[_0x3103('0x8d')]||![],'pauseType':_0x47ee53[_0x3103('0x8d')]?'LOGININPAUSE':null,'interface':_0x2ebb8a,'lastPauseAt':moment()[_0x3103('0x9b')](_0x3103('0xed'))});}})[_0x3103('0x22')](function(_0x46c150){if(_0x4ad3f2['isMiddleware']){return _0x40de4();}else{return Promise[_0x3103('0xf1')](_0x46c150)[_0x3103('0x22')](respondWithResult(_0x1e1ee8,null));}})['catch'](handleError(_0x1e1ee8,null));};exports[_0x3103('0xf2')]=function(_0x2c4117,_0x2444fa){var _0x58b845;return db[_0x3103('0x34')]['find']({'where':{'id':_0x2c4117['params']['id'],'role':_0x3103('0x1f')},'attributes':['id',_0x3103('0x2f'),_0x3103('0x1e')]})[_0x3103('0x22')](handleEntityNotFound(_0x2444fa,null))['then'](function(_0x23f165){if(_0x23f165){_0x58b845=_0x23f165;return db[_0x3103('0x9c')][_0x3103('0x21')]({'where':{'membername':_0x58b845['name']},'individualHooks':!![]});}})[_0x3103('0x22')](function(){return db[_0x3103('0xeb')][_0x3103('0x7d')]({'where':{'membername':_0x58b845[_0x3103('0x2f')],'exitAt':null}});})[_0x3103('0x22')](function(_0x3d894a){var _0x243b60=[];_0x3d894a[_0x3103('0xec')](function(_0x4f3738){_0x243b60[_0x3103('0x4a')](_0x4f3738[_0x3103('0x1d')]({'exitAt':moment()['format'](_0x3103('0xed'))}));});return Promise[_0x3103('0x7c')](_0x243b60);})[_0x3103('0x22')](function(){return _0x58b845[_0x3103('0x1d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x3103('0x22')](respondWithResult(_0x2444fa,null))[_0x3103('0x52')](handleError(_0x2444fa,null));};exports[_0x3103('0xf3')]=function(_0x179264,_0x2ccd68){var _0x2b1ea3;return db[_0x3103('0x9c')][_0x3103('0x1d')]({'paused':0x1},{'where':{'UserId':_0x179264[_0x3103('0x57')]['id']},'individualHooks':!![]})[_0x3103('0x22')](function(){return db[_0x3103('0x34')][_0x3103('0x2e')]({'where':{'id':_0x179264['params']['id'],'role':_0x3103('0x1f')},'attributes':['id','name',_0x3103('0x1e'),_0x3103('0x5a'),_0x3103('0x8f'),'online']});})[_0x3103('0x22')](handleEntityNotFound(_0x2ccd68,null))[_0x3103('0x22')](function(_0x1c17e5){if(_0x1c17e5){_0x2b1ea3=_0x1c17e5;return db['MemberReport']['findAll']({'where':{'membername':_0x2b1ea3['name'],'type':_0x3103('0xf0'),'exitAt':null}});}})['then'](function(_0x5a5842){if(_0x5a5842[_0x3103('0x49')]){var _0x468d50=moment()[_0x3103('0x9b')](_0x3103('0xed'));for(var _0x39384b=0x0,_0x17b9ba=_0x5a5842[_0x3103('0x49')];_0x39384b<_0x17b9ba;_0x39384b++){_0x5a5842[_0x39384b][_0x3103('0xf4')]({'exitAt':_0x468d50});}}})[_0x3103('0x22')](function(){var _0x581cc1=[];var _0x462f95=utils[_0x3103('0xf5')]();_0x462f95[_0x3103('0xec')](function(_0x39eefb){_0x581cc1[_0x3103('0x4a')]({'channel':_0x39eefb,'membername':_0x2b1ea3[_0x3103('0x2f')],'interface':_[_0x3103('0x5d')](_0x2b1ea3['interface'])?util[_0x3103('0x9b')]('SIP/%s',_0x2b1ea3['name']):_0x2b1ea3[_0x3103('0x8f')],'type':'PAUSE','enterAt':moment()[_0x3103('0x9b')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x179264[_0x3103('0x56')][_0x3103('0x37')]||_0x3103('0xf6'),'role':_0x2b1ea3[_0x3103('0x1e')],'internal':_0x2b1ea3[_0x3103('0x5a')]});});return db[_0x3103('0xeb')][_0x3103('0x78')](_0x581cc1,{'individualHooks':!![]});})[_0x3103('0x22')](function(){return _0x2b1ea3[_0x3103('0x1d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x179264['body'][_0x3103('0x37')]||_0x3103('0xf6'),'lastPauseAt':moment()['format'](_0x3103('0xed'))});})[_0x3103('0x22')](respondWithResult(_0x2ccd68,null))['catch'](handleError(_0x2ccd68,null));};exports[_0x3103('0xf7')]=function(_0x5430dd,_0x409369){if(_0x5430dd[_0x3103('0x56')]['channel']&&!utils[_0x3103('0x9e')](_0x5430dd[_0x3103('0x56')][_0x3103('0x8b')])){throw new APIBadRequestError(util[_0x3103('0x9b')](_0x3103('0xf8'),_0x5430dd[_0x3103('0x56')]['channel']));}return db[_0x3103('0x34')][_0x3103('0x2e')]({'where':{'id':_0x5430dd['params']['id']},'attributes':['id',_0x3103('0x2f'),_0x3103('0x1e'),_0x3103('0x5a'),_0x3103('0x8f'),_0x3103('0x8c'),_0x3103('0x8e'),'mailPause',_0x3103('0xf9'),_0x3103('0xfa'),'openchannelPause',_0x3103('0xfb'),_0x3103('0xfc'),_0x3103('0xfd'),_0x3103('0xfe')]})[_0x3103('0x22')](function(_0x238aa6){if(!_0x238aa6){throw new APINotFoundError(util[_0x3103('0x9b')](_0x3103('0xff'),_0x5430dd[_0x3103('0x57')]['id']));}return _0x238aa6[_0x3103('0xf7')](_0x5430dd[_0x3103('0x56')]['channel']);})['then'](respondWithResult(_0x409369,null))[_0x3103('0x52')](APIHandleError(_0x409369));};exports['getTeams']=function(_0xbca471,_0x32bee0){var _0x21e264={};var _0x3c7928={};var _0xc97be8;var _0x4198a8;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0xbca471[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x32bee0,null))[_0x3103('0x22')](function(_0xeed80b){if(_0xeed80b){_0xc97be8=_0xeed80b;_0x3c7928[_0x3103('0xbf')]=_[_0x3103('0xc0')](db['Team']['rawAttributes']);_0x3c7928[_0x3103('0x42')]=_[_0x3103('0xc0')](_0xbca471[_0x3103('0x42')]);_0x3c7928[_0x3103('0xc1')]=_[_0x3103('0xc2')](_0x3c7928[_0x3103('0xbf')],_0x3c7928[_0x3103('0x42')]);_0x21e264[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x3c7928[_0x3103('0xbf')],qs['fields'](_0xbca471[_0x3103('0x42')][_0x3103('0xc3')]));_0x21e264['attributes']=_0x21e264[_0x3103('0x46')]['length']?_0x21e264[_0x3103('0x46')]:_0x3c7928[_0x3103('0xbf')];_0x21e264['order']=qs['sort'](_0xbca471[_0x3103('0x42')][_0x3103('0xcc')]);_0x21e264['where']=qs[_0x3103('0xc1')](_[_0x3103('0xcd')](_0xbca471[_0x3103('0x42')],_0x3c7928['filters']));if(_0xbca471['query']['filter']){_0x21e264[_0x3103('0x40')]=_[_0x3103('0x53')](_0x21e264[_0x3103('0x40')],{'$or':_[_0x3103('0x2b')](_0x21e264[_0x3103('0x46')],function(_0x35aea0){var _0x5648c6={};_0x5648c6[_0x35aea0]={'$like':'%'+_0xbca471[_0x3103('0x42')][_0x3103('0x2a')]+'%'};return _0x5648c6;})});}_0x21e264=_[_0x3103('0x53')]({},_0x21e264,_0xbca471[_0x3103('0x54')]);return _0xc97be8[_0x3103('0x100')](_0x21e264);}})[_0x3103('0x22')](function(_0x18adcc){if(_0x18adcc){_0x4198a8=_0x18adcc['length'];if(!_0xbca471[_0x3103('0x42')]['hasOwnProperty']('nolimit')){_0x21e264[_0x3103('0x19')]=qs[_0x3103('0x19')](_0xbca471[_0x3103('0x42')]['limit']);_0x21e264['offset']=qs[_0x3103('0x17')](_0xbca471[_0x3103('0x42')]['offset']);}return _0xc97be8[_0x3103('0x100')](_0x21e264);}})['then'](function(_0x2a68c1){if(_0x2a68c1){return _0x2a68c1?{'count':_0x4198a8,'rows':_0x2a68c1}:null;}})[_0x3103('0x22')](respondWithResult(_0x32bee0,null))[_0x3103('0x52')](handleError(_0x32bee0,null));};exports['addTeams']=function(_0x3040b0,_0x344146){var _0x501830=_0x3040b0['params']['id'];var _0x13270f=_0x3040b0[_0x3103('0x56')]?_0x3040b0[_0x3103('0x56')][_0x3103('0x94')]:null;var _0x164626=[];return Promise['resolve']()[_0x3103('0x22')](function(){if(!_0x13270f)throw new APIBadRequestError(_0x3103('0x101'));})[_0x3103('0x22')](function(){return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x501830}});})['then'](function(_0x1a629c){if(!_0x1a629c)throw new APINotFoundError(util[_0x3103('0x9b')](_0x3103('0xff'),_0x3040b0[_0x3103('0x57')]['id']));return db[_0x3103('0x5f')][_0x3103('0x102')](function(_0x4c15fb){return _0x1a629c[_0x3103('0x103')](_0x13270f,{'transaction':_0x4c15fb})[_0x3103('0x22')](function(){return db[_0x3103('0x104')][_0x3103('0x7d')]({'where':{'id':{'$in':_0x13270f}}});})[_0x3103('0x22')](function(_0x32e07c){var _0x1098a5=_[_0x3103('0x2b')](_0x32e07c,function(_0x5232ad){return _0x5232ad[_0x3103('0x105')]();});return Promise[_0x3103('0x7c')](_0x1098a5);})['then'](function(_0xf7da85){_0x164626=_[_0x3103('0x106')](_0xf7da85);var _0x24599a=_[_0x3103('0x2b')](_0x164626,function(_0x316c45){return _0x316c45[_0x3103('0x107')](_0x1a629c['id'],{'transaction':_0x4c15fb});});return Promise[_0x3103('0x7c')](_0x24599a);})['then'](function(){if(!_0x1a629c['online'])return;var _0x53f103=_[_0x3103('0x2a')](_0x164626,function(_0x73b5f2){return _0x73b5f2[_0x3103('0x108')](_0x3103('0x8b'))==='Voice';});var _0x40f25d=_[_0x3103('0x2b')](_0x53f103,function(_0x3245a7){return db[_0x3103('0x9c')][_0x3103('0x9d')]({'membername':_0x1a629c[_0x3103('0x2f')],'UserId':_0x1a629c['id'],'queue_name':_0x3245a7[_0x3103('0x2f')],'VoiceQueueId':_0x3245a7['id'],'interface':_[_0x3103('0x5d')](_0x1a629c[_0x3103('0x8f')])?util[_0x3103('0x9b')](_0x3103('0xe1'),_0x1a629c[_0x3103('0x2f')]):_0x1a629c[_0x3103('0x8f')],'paused':_0x1a629c['voicePause']||![],'penalty':_0x1a629c[_0x3103('0x95')]},{'transaction':_0x4c15fb});});return Promise[_0x3103('0x7c')](_0x40f25d);})[_0x3103('0x22')](function(){return db[_0x3103('0x109')][_0x3103('0x7d')]({'where':{'teamId':{'$in':_0x13270f}}});})['then'](function(_0x203d08){var _0x3256dc=_[_0x3103('0x2b')](_0x203d08,function(_0x5f3f53){return db[_0x3103('0x10a')][_0x3103('0x74')]({'UserId':_0x1a629c['id'],'VoicePrefixId':_0x5f3f53[_0x3103('0x10b')]},{'transaction':_0x4c15fb});});return Promise[_0x3103('0x7c')](_0x3256dc);});});})[_0x3103('0x22')](function(){for(var _0x107f73=0x0;_0x107f73<_0x164626[_0x3103('0x49')];_0x107f73++){var _0x4d6457=_0x164626[_0x107f73]['getDataValue'](_0x3103('0x8b'));var _0x5a83e0=_0x4d6457+_0x3103('0xa0');socket[_0x3103('0x20')](_0x3103('0x26')+_0x4d6457+_0x3103('0x98'),{'UserId':_0x501830,['queueField']:_0x164626[_0x107f73]['id']});}})[_0x3103('0x22')](respondWithStatusCode(_0x344146,null))['catch'](APIHandleError(_0x344146));};exports[_0x3103('0x10c')]=function(_0x1db89e,_0x1c93a7){var _0x1e10bd=_0x1db89e[_0x3103('0x57')]['id'];var _0x519cee=null;if(_0x1db89e[_0x3103('0x42')][_0x3103('0x94')]){_0x519cee=_[_0x3103('0x9f')](_0x1db89e[_0x3103('0x42')][_0x3103('0x94')])?_0x1db89e[_0x3103('0x42')][_0x3103('0x94')]:[_0x1db89e[_0x3103('0x42')][_0x3103('0x94')]];}var _0x42dfc8=[];return Promise['resolve']()[_0x3103('0x22')](function(){if(!_0x519cee)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db['User'][_0x3103('0xb8')]({'where':{'id':_0x1e10bd}});})['then'](function(_0x1fe2ee){if(!_0x1fe2ee)throw new APINotFoundError(util[_0x3103('0x9b')](_0x3103('0xff'),_0x1db89e['params']['id']));return db[_0x3103('0x5f')][_0x3103('0x102')](function(_0x3ce852){return _0x1fe2ee[_0x3103('0x10c')](_0x519cee,{'transaction':_0x3ce852})[_0x3103('0x22')](function(){return db['Team'][_0x3103('0x7d')]({'where':{'id':{'$in':_0x519cee}}});})[_0x3103('0x22')](function(_0x2c3deb){var _0x3206fb=_[_0x3103('0x2b')](_0x2c3deb,function(_0x1f1dbd){return _0x1f1dbd['getAssociatedQueues']();});return Promise['all'](_0x3206fb);})['then'](function(_0x32686d){_0x42dfc8=_[_0x3103('0x106')](_0x32686d);var _0x43e46e=_[_0x3103('0x2b')](_0x42dfc8,function(_0x28993a){return _0x28993a[_0x3103('0x10d')](_0x1fe2ee['id'],{'transaction':_0x3ce852});});return Promise[_0x3103('0x7c')](_0x43e46e);})[_0x3103('0x22')](function(){if(!_0x1fe2ee[_0x3103('0x8c')])return;var _0x164f57=_[_0x3103('0x2a')](_0x42dfc8,function(_0x3e0c5d){return _0x3e0c5d['getDataValue'](_0x3103('0x8b'))===_0x3103('0x10e');});var _0x500ab1=_[_0x3103('0x2b')](_0x164f57,function(_0x314849){return db['UserVoiceQueueRt'][_0x3103('0x21')]({'where':{'VoiceQueueId':_0x314849['id'],'UserId':_0x1fe2ee['id']},'transaction':_0x3ce852});});return Promise['all'](_0x500ab1);})[_0x3103('0x22')](function(){return db['TeamVoicePrefix'][_0x3103('0x7d')]({'where':{'teamId':{'$in':_0x519cee}}});})[_0x3103('0x22')](function(_0x2a9656){var _0x53bd44=_[_0x3103('0x2b')](_0x2a9656,function(_0x9a0638){return db[_0x3103('0x10a')]['destroy']({'where':{'UserId':_0x1fe2ee['id'],'VoicePrefixId':_0x9a0638[_0x3103('0x10b')]}},{'transaction':_0x3ce852});});return Promise[_0x3103('0x7c')](_0x53bd44);});});})[_0x3103('0x22')](function(){for(var _0x40c0c0=0x0;_0x40c0c0<_0x42dfc8[_0x3103('0x49')];_0x40c0c0++){var _0x120b72=_0x42dfc8[_0x40c0c0][_0x3103('0x108')](_0x3103('0x8b'));var _0x58c16e=_0x120b72+_0x3103('0xa0');socket[_0x3103('0x20')](_0x3103('0x26')+_0x120b72+'Queue:remove',{'UserId':_0x1e10bd,['queueField']:_0x42dfc8[_0x40c0c0]['id']});}})[_0x3103('0x22')](respondWithStatusCode(_0x1c93a7,null))[_0x3103('0x52')](APIHandleError(_0x1c93a7));};exports[_0x3103('0x10f')]=function(_0x306bea,_0x2ae6b3){var _0xa5434={};var _0x65724f={};var _0xf30416;var _0x459953;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x306bea[_0x3103('0x57')]['id']}})['then'](handleEntityNotFound(_0x2ae6b3,null))['then'](function(_0x26bfe7){if(_0x26bfe7){_0xf30416=_0x26bfe7;_0x65724f[_0x3103('0xbf')]=_[_0x3103('0xc0')](db['CmList']['rawAttributes']);_0x65724f[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x306bea[_0x3103('0x42')]);_0x65724f[_0x3103('0xc1')]=_['intersection'](_0x65724f[_0x3103('0xbf')],_0x65724f[_0x3103('0x42')]);_0xa5434[_0x3103('0x46')]=_[_0x3103('0xc2')](_0x65724f[_0x3103('0xbf')],qs[_0x3103('0xc3')](_0x306bea[_0x3103('0x42')][_0x3103('0xc3')]));_0xa5434[_0x3103('0x46')]=_0xa5434[_0x3103('0x46')][_0x3103('0x49')]?_0xa5434[_0x3103('0x46')]:_0x65724f[_0x3103('0xbf')];_0xa5434[_0x3103('0xc4')]=qs[_0x3103('0xcc')](_0x306bea[_0x3103('0x42')][_0x3103('0xcc')]);_0xa5434[_0x3103('0x40')]=qs['filters'](_[_0x3103('0xcd')](_0x306bea[_0x3103('0x42')],_0x65724f['filters']));if(_0x306bea['query']['filter']){_0xa5434[_0x3103('0x40')]=_[_0x3103('0x53')](_0xa5434[_0x3103('0x40')],{'$or':_[_0x3103('0x2b')](_0xa5434[_0x3103('0x46')],function(_0x3f168a){var _0x14f5d1={};_0x14f5d1[_0x3f168a]={'$like':'%'+_0x306bea[_0x3103('0x42')][_0x3103('0x2a')]+'%'};return _0x14f5d1;})});}_0xa5434=_['merge']({},_0xa5434,_0x306bea[_0x3103('0x54')]);return _0xf30416[_0x3103('0x10f')](_0xa5434);}})[_0x3103('0x22')](function(_0x3c4aeb){if(_0x3c4aeb){_0x459953=_0x3c4aeb[_0x3103('0x49')];if(!_0x306bea[_0x3103('0x42')][_0x3103('0xc7')](_0x3103('0xc8'))){_0xa5434[_0x3103('0x19')]=qs[_0x3103('0x19')](_0x306bea[_0x3103('0x42')][_0x3103('0x19')]);_0xa5434['offset']=qs[_0x3103('0x17')](_0x306bea[_0x3103('0x42')][_0x3103('0x17')]);}return _0xf30416[_0x3103('0x10f')](_0xa5434);}})[_0x3103('0x22')](function(_0x57f249){if(_0x57f249){return _0x57f249?{'count':_0x459953,'rows':_0x57f249}:null;}})[_0x3103('0x22')](respondWithResult(_0x2ae6b3,null))['catch'](handleError(_0x2ae6b3,null));};exports[_0x3103('0x110')]=function(_0x694dd7,_0x3c5919){var _0x4ecbdf={};var _0x6f711b={};var _0x53c4f3;return db[_0x3103('0x34')][_0x3103('0xb8')]({'where':{'id':_0x694dd7[_0x3103('0x57')]['id']}})[_0x3103('0x22')](handleEntityNotFound(_0x3c5919,null))[_0x3103('0x22')](function(_0x3603fe){if(_0x3603fe){_0x53c4f3=_0x3603fe;_0x6f711b['model']=_['keys'](db['User'][_0x3103('0x35')]);_0x6f711b[_0x3103('0x42')]=_[_0x3103('0xc0')](_0x694dd7[_0x3103('0x42')]);_0x6f711b['filters']=_[_0x3103('0xc2')](_0x6f711b[_0x3103('0xbf')],_0x6f711b[_0x3103('0x42')]);_0x4ecbdf[_0x3103('0x46')]=_['intersection'](_0x6f711b['model'],qs[_0x3103('0xc3')](_0x694dd7[_0x3103('0x42')][_0x3103('0xc3')]));_0x4ecbdf[_0x3103('0x46')]=_0x4ecbdf[_0x3103('0x46')][_0x3103('0x49')]?_0x4ecbdf[_0x3103('0x46')]:_0x6f711b['model'];_0x4ecbdf['order']=qs[_0x3103('0xcc')](_0x694dd7[_0x3103('0x42')][_0x3103('0xcc')]);_0x4ecbdf['where']=qs['filters'](_['pick'](_0x694dd7[_0x3103('0x42')],_0x6f711b['filters']));if(_0x694dd7[_0x3103('0x42')]['filter']){_0x4ecbdf['where']=_[_0x3103('0x53')](_0x4ecbdf[_0x3103('0x40')],{'$or':_['map'](_0x4ecbdf[_0x3103('0x46')],function(_0x59e9bf){var _0x230716={};_0x230716[_0x59e9bf]={'$like':'%'+_0x694dd7[_0x3103('0x42')][_0x3103('0x2a')]+'%'};return _0x230716;})});}_0x4ecbdf[_0x3103('0xbf')]=db[_0x3103('0x34')];_0x4ecbdf['as']='Agents';_0x4ecbdf=_['merge']({},_0x4ecbdf,_0x694dd7[_0x3103('0x54')]);return _0x53c4f3[_0x3103('0x111')]({'include':[_0x4ecbdf]});}})[_0x3103('0x22')](function(_0x187413){if(_0x187413){var _0x385353={},_0x24a979=[];for(var _0x31c71c=0x0;_0x31c71c<_0x187413[_0x3103('0x49')];_0x31c71c+=0x1){for(var _0x4660d1=0x0,_0x17c7f6;_0x4660d1<_0x187413[_0x31c71c][_0x3103('0x27')][_0x3103('0x49')];_0x4660d1+=0x1){_0x17c7f6=_0x187413[_0x31c71c]['Agents'][_0x4660d1]['get']({'plain':!![]});_0x385353[_0x17c7f6['id']]=_0x17c7f6;}}_0x385353=_[_0x3103('0x112')](_0x385353);for(var _0x101f18=qs[_0x3103('0x17')](_0x694dd7[_0x3103('0x42')][_0x3103('0x17')]);_0x101f18<_0x385353['length']&&_0x24a979['length']=_0x227272){_0x5c2ba4=_0x227272;_0x26851d=0xc8;}else{_0x26851d=0xce;}_0x3b1f7c[_0x2c0e('0x14')](_0x26851d);return _0x3b1f7c[_0x2c0e('0x19')](_0x2c0e('0x1a'),_0x4a9023+'-'+_0x5c2ba4+'/'+_0x227272)['json'](_0x237962);}return null;};}function saveUpdates(_0x2c403c){return function(_0x5ee695){if(_0x5ee695){return _0x5ee695['update'](_0x2c403c)[_0x2c0e('0x1b')](function(_0x55a336){if(_0x55a336[_0x2c0e('0x1c')]==='agent'){socket[_0x2c0e('0x1d')]('userNotification:recalc:'+_0x55a336['id'],_0x55a336);}return _0x55a336;});}return null;};}function removeEntity(_0x31c0b6){return function(_0x1906cd){if(_0x1906cd){return _0x1906cd['destroy']()[_0x2c0e('0x1b')](function(){var _0x25a526=_0x1906cd[_0x2c0e('0x1e')]({'plain':!![]});if(_0x25a526[_0x2c0e('0x1c')]===_0x2c0e('0x1f'))return;var _0x331f64=[{'name':_0x2c0e('0x20'),'value':_0x2c0e('0x21'),'ignore':!![]},{'name':_0x2c0e('0x22'),'value':_0x2c0e('0x23'),'ignore':![]},{'name':_0x2c0e('0x24'),'value':_0x2c0e('0x25'),'ignore':![]}];var _0x34891d=_(_0x331f64)['filter'](_0x2c0e('0x26'))['map'](_0x2c0e('0x27'))[_0x2c0e('0x27')]();if(_[_0x2c0e('0x28')](_0x34891d,_0x25a526[_0x2c0e('0x1c')])){return;}var _0x5b5ed2=_[_0x2c0e('0x29')](_0x331f64,['value',_0x25a526[_0x2c0e('0x1c')]])['name'];return db['UserProfileResource'][_0x2c0e('0x2a')]({'where':{'type':_0x5b5ed2,'resourceId':_0x25a526['id']}})[_0x2c0e('0x1b')](function(){return _0x1906cd;});})[_0x2c0e('0x1b')](function(){_0x31c0b6[_0x2c0e('0x14')](0xcc)[_0x2c0e('0x15')]();});}};}function handleEntityNotFound(_0x1d547e){return function(_0x45b469){if(!_0x45b469){_0x1d547e['sendStatus'](0x194);}return _0x45b469;};}function handleError(_0x271d7c,_0x3381e8){_0x3381e8=_0x3381e8||0x1f4;return function(_0x5eb5e2){logger[_0x2c0e('0x2b')](_0x5eb5e2[_0x2c0e('0x2c')]);if(_0x5eb5e2['name']){delete _0x5eb5e2['name'];}_0x271d7c['status'](_0x3381e8)['send'](_0x5eb5e2);};}function getUserAttributes(){return _(db[_0x2c0e('0x2d')][_0x2c0e('0x2e')])[_0x2c0e('0x2f')](function(_0x2ec1dd){return{'name':_0x2ec1dd['fieldName'],'type':_0x2ec1dd['type']['key']};})['filter'](function(_0x5d9e69){return![_0x2c0e('0x30'),_0x2c0e('0x31'),_0x2c0e('0x32'),_0x2c0e('0x33'),_0x2c0e('0x34'),_0x2c0e('0x35')][_0x2c0e('0x28')](_0x5d9e69[_0x2c0e('0x36')]);})[_0x2c0e('0x27')]();}exports['index']=function(_0x50b509,_0x2fcc00){var _0xe88821={},_0x148c9b={'count':0x0,'rows':[]};var _0x489909=getUserAttributes();_0xe88821=qs[_0x2c0e('0x37')](_0x489909,_0x50b509);var _0x4a63e7={'where':_0xe88821[_0x2c0e('0x38')]};return db[_0x2c0e('0x2d')][_0x2c0e('0x18')](_0x4a63e7)[_0x2c0e('0x1b')](function(_0x29d315){_0x148c9b[_0x2c0e('0x18')]=_0x29d315;if(_0x50b509[_0x2c0e('0x39')][_0x2c0e('0x3a')]){_0xe88821['include']=[{'all':!![]}];}if(_0x50b509[_0x2c0e('0x39')]['userSetting']===_0x2c0e('0x3b')){_0xe88821['include']=[{'model':db[_0x2c0e('0x3c')],'as':_0x2c0e('0x3d')}];}if(!_[_0x2c0e('0x28')](_0xe88821[_0x2c0e('0x3e')],'id')){_0xe88821['attributes']['push']('id');}return db[_0x2c0e('0x2d')][_0x2c0e('0x3f')](_0xe88821);})[_0x2c0e('0x1b')](function(_0x43b2eb){_0x148c9b[_0x2c0e('0x40')]=_0x43b2eb;if(_0x50b509[_0x2c0e('0x39')]['openTabs']===_0x2c0e('0x3b')){var _0xb9ca0a=[];for(var _0x40c0b3=0x0;_0x40c0b3<_0x148c9b[_0x2c0e('0x40')][_0x2c0e('0x41')];_0x40c0b3++){_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs('chat',_0x148c9b[_0x2c0e('0x40')][_0x40c0b3][_0x2c0e('0x43')]));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x44'),_0x148c9b[_0x2c0e('0x40')][_0x40c0b3][_0x2c0e('0x43')]));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x45'),_0x148c9b[_0x2c0e('0x40')][_0x40c0b3]['dataValues']));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x46'),_0x148c9b['rows'][_0x40c0b3]['dataValues']));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x47'),_0x148c9b['rows'][_0x40c0b3][_0x2c0e('0x43')]));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x48'),_0x148c9b[_0x2c0e('0x40')][_0x40c0b3][_0x2c0e('0x43')]));}return Promise[_0x2c0e('0x49')](_0xb9ca0a)['then'](function(){return _0x148c9b;});}else{return _0x148c9b;}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x2fcc00,_0xe88821))[_0x2c0e('0x4a')](handleError(_0x2fcc00,null));};exports[_0x2c0e('0x4b')]=function(_0x4d934d,_0x15564a){var _0xa5cdd6=getUserAttributes();_0x4d934d[_0x2c0e('0x39')]['id']=_0x4d934d[_0x2c0e('0x4c')]['id'];var _0x5e1a52=qs[_0x2c0e('0x37')](_0xa5cdd6,_0x4d934d);if(_0x4d934d[_0x2c0e('0x39')][_0x2c0e('0x3a')]){_0x5e1a52[_0x2c0e('0x4d')]=[{'all':!![]}];}if(_0x4d934d[_0x2c0e('0x39')][_0x2c0e('0x3d')]==='true'){_0x5e1a52[_0x2c0e('0x4d')]=[{'model':db[_0x2c0e('0x3c')],'as':'userSetting'}];}_0x5e1a52=_[_0x2c0e('0x4e')]({},_0x5e1a52,_0x4d934d['options']);if(!_[_0x2c0e('0x28')](_0x5e1a52[_0x2c0e('0x3e')],'id')){_0x5e1a52['attributes'][_0x2c0e('0x42')]('id');}return db[_0x2c0e('0x2d')][_0x2c0e('0x29')](_0x5e1a52)['then'](handleEntityNotFound(_0x15564a,null))[_0x2c0e('0x1b')](function(_0x1101a6){var _0x526853=[];values=_0x1101a6;if(_0x4d934d['query']['openTabs']===_0x2c0e('0x3b')){_0x526853['push'](get_open_tabs(_0x2c0e('0x4f'),_0x1101a6['dataValues']));_0x526853[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x44'),_0x1101a6['dataValues']));_0x526853[_0x2c0e('0x42')](get_open_tabs('openchannel',_0x1101a6[_0x2c0e('0x43')]));_0x526853[_0x2c0e('0x42')](get_open_tabs('whatsapp',_0x1101a6[_0x2c0e('0x43')]));_0x526853[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x45'),_0x1101a6[_0x2c0e('0x43')]));_0x526853[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x46'),_0x1101a6['dataValues']));return Promise[_0x2c0e('0x49')](_0x526853);}else{return values;}})[_0x2c0e('0x1b')](function(){return values;})[_0x2c0e('0x1b')](respondWithResult(_0x15564a,null))['catch'](handleError(_0x15564a,null));};exports[_0x2c0e('0x50')]=function(_0x3ce1fb,_0x634586){if(_0x3ce1fb[_0x2c0e('0x51')]['id']){delete _0x3ce1fb[_0x2c0e('0x51')]['id'];}delete _0x3ce1fb[_0x2c0e('0x51')][_0x2c0e('0x1c')];return db[_0x2c0e('0x2d')]['find']({'where':{'id':_0x3ce1fb['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x634586,null))[_0x2c0e('0x1b')](saveUpdates(_0x3ce1fb[_0x2c0e('0x51')],null))[_0x2c0e('0x1b')](respondWithResult(_0x634586,null))[_0x2c0e('0x4a')](handleError(_0x634586,null));};exports['describe']=function(_0xbadd64,_0x17ccb9){return db[_0x2c0e('0x2d')][_0x2c0e('0x52')]()['then'](respondWithResult(_0x17ccb9,null))[_0x2c0e('0x4a')](handleError(_0x17ccb9,null));};exports[_0x2c0e('0x53')]=function(_0x594a96,_0x5b111f){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x594a96[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x5b111f,null))[_0x2c0e('0x1b')](function(_0x76c6a3){if(_0x76c6a3){return _0x76c6a3[_0x2c0e('0x53')](_0x594a96[_0x2c0e('0x51')][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x594a96[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{});}})[_0x2c0e('0x1b')](respondWithResult(_0x5b111f,null))['catch'](handleError(_0x5b111f,null));};function validateUser(_0x42c4cb){return new Promise(function(_0xecc59f,_0x38cf26){if(_0x42c4cb[_0x2c0e('0x56')])return _0xecc59f(_0x42c4cb);return db[_0x2c0e('0x57')][_0x2c0e('0x58')](0x1)['then'](function(_0x18fe9b){if(_0x18fe9b[_0x2c0e('0x59')])authService[_0x2c0e('0x5a')](_0x42c4cb[_0x2c0e('0x30')]);db['User'][_0x2c0e('0x5b')](_0x2c0e('0x56'))[_0x2c0e('0x1b')](function(_0x588abc){if(_[_0x2c0e('0x5c')](_0x588abc)){_0x42c4cb[_0x2c0e('0x56')]=_0x18fe9b[_0x2c0e('0x5d')]||0x1;return;}if(_['isNil'](_0x18fe9b[_0x2c0e('0x5d')])||_0x18fe9b[_0x2c0e('0x5d')]===_0x588abc){_0x42c4cb['internal']=_0x588abc+0x1;return;}if(_0x18fe9b[_0x2c0e('0x5d')]>_0x588abc){_0x42c4cb[_0x2c0e('0x56')]=_0x18fe9b['min_internal'];return;}return db['sequelize'][_0x2c0e('0x39')](_0x2c0e('0x5e'),{'type':db['sequelize'][_0x2c0e('0x5f')][_0x2c0e('0x60')]})[_0x2c0e('0x1b')](function(_0x373a2c){if(_0x373a2c&&_0x373a2c['length']){for(var _0x408509=0x0,_0x52ffcf=_0x373a2c[_0x2c0e('0x41')];_0x408509<_0x52ffcf&&_[_0x2c0e('0x5c')](_0x42c4cb[_0x2c0e('0x56')]);_0x408509++){if(_0x18fe9b[_0x2c0e('0x5d')]<=_0x373a2c[_0x408509][_0x2c0e('0x61')]){_0x42c4cb['internal']=_0x373a2c[_0x408509][_0x2c0e('0x61')];}else if(_0x18fe9b[_0x2c0e('0x5d')]>_0x373a2c[_0x408509][_0x2c0e('0x61')]&&_0x18fe9b[_0x2c0e('0x5d')]<=_0x373a2c[_0x408509]['to']){_0x42c4cb['internal']=_0x18fe9b['min_internal'];}}}if(_[_0x2c0e('0x5c')](_0x42c4cb['internal'])){_0x42c4cb['internal']=_0x588abc+0x1;}return _0xecc59f(_0x42c4cb);});});})[_0x2c0e('0x4a')](function(_0x4f5eee){_0x38cf26(_0x4f5eee);});});}function updateUser(_0x5164c5){return new Promise(function(_0x3ebc74,_0x5cc843){try{if(_0x5164c5[_0x2c0e('0x62')]){_0x5164c5[_0x2c0e('0x63')]=_0x5164c5[_0x2c0e('0x56')];_0x5164c5[_0x2c0e('0x64')]={'mailbox':_0x5164c5[_0x2c0e('0x56')],'password':_0x5164c5['password'],'fullname':_0x5164c5['fullname'],'email':_0x5164c5['email']};}if(_0x5164c5[_0x2c0e('0x1c')]===_0x2c0e('0x23')){if(!_0x5164c5[_0x2c0e('0x65')])_0x5164c5[_0x2c0e('0x65')]=[_0x2c0e('0x66'),_0x2c0e('0x67'),_0x2c0e('0x68'),'113',_0x2c0e('0x69'),_0x2c0e('0x6a'),_0x2c0e('0x6b'),_0x2c0e('0x6c'),_0x2c0e('0x6d'),_0x2c0e('0x6e'),_0x2c0e('0x6f'),_0x2c0e('0x70'),_0x2c0e('0x71'),_0x2c0e('0x72'),_0x2c0e('0x73')];}_0x3ebc74(_0x5164c5);}catch(_0x158259){_0x5cc843(_0x158259);}});}exports['create']=function(_0x38a0a4,_0xa87a8a){if(_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x1c')]===_0x2c0e('0x23'))throw new Error(_0x2c0e('0x74'));if(_0x38a0a4[_0x2c0e('0x51')]['role']==='user'&&_0x38a0a4[_0x2c0e('0x21')]['role']!==_0x2c0e('0x1f')){throw new Error(_0x2c0e('0x75'));}if(_0x38a0a4[_0x2c0e('0x51')][_0x2c0e('0x1c')]===_0x2c0e('0x1f')&&_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x1c')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x2c0e('0x76')]([_0x38a0a4[_0x2c0e('0x51')]])['then'](function(){return validateUser(_0x38a0a4[_0x2c0e('0x51')]);})[_0x2c0e('0x1b')](function(_0x5e3e82){return updateUser(_0x5e3e82)[_0x2c0e('0x1b')](function(_0x48a2f6){if(_0x48a2f6[_0x2c0e('0x1c')]===_0x2c0e('0x1f')){_0x48a2f6['settingsEnabled']=_0x38a0a4['user'][_0x2c0e('0x77')];delete _0x48a2f6[_0x2c0e('0x78')];}return _0x48a2f6;});})[_0x2c0e('0x1b')](function(_0x496dbb){return db[_0x2c0e('0x2d')][_0x2c0e('0x79')](_0x496dbb,{'include':[{'model':db[_0x2c0e('0x64')],'as':_0x2c0e('0x64')}]});})['then'](function(_0x9d143a){if(_0x38a0a4[_0x2c0e('0x51')][_0x2c0e('0x1c')]===_0x2c0e('0x21'))return _0x9d143a;if(_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x1c')]!=='user')return _0x9d143a;return db[_0x2c0e('0x7a')][_0x2c0e('0x29')]({'where':{'name':_0x9d143a['role']===_0x2c0e('0x23')?_0x2c0e('0x22'):'Telephones','userProfileId':_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x78')]},'raw':!![]})[_0x2c0e('0x1b')](function(_0x5c70fd){if(!_0x5c70fd||_0x5c70fd[_0x2c0e('0x7b')]!=0x0)return _0x9d143a;return db[_0x2c0e('0x7c')][_0x2c0e('0x79')]({'name':_0x9d143a['name'],'resourceId':_0x9d143a['id'],'type':_0x5c70fd['name'],'sectionId':_0x5c70fd['id']},{})[_0x2c0e('0x1b')](function(){return _0x9d143a;});})[_0x2c0e('0x4a')](function(_0x7af392){logger[_0x2c0e('0x2b')](_0x2c0e('0x7d'),_0x7af392);throw _0x7af392;});})[_0x2c0e('0x1b')](respondWithResult(_0xa87a8a,0xc9))[_0x2c0e('0x4a')](handleError(_0xa87a8a,null));};exports[_0x2c0e('0x7e')]=function(_0x168391,_0x44ba17){var _0x384442=_0x168391[_0x2c0e('0x51')];var _0x414578=[];if(_0x168391['user']['role']===_0x2c0e('0x23'))throw new Error(_0x2c0e('0x74'));if(_['some'](_0x384442,[_0x2c0e('0x1c'),_0x2c0e('0x21')])&&_0x168391['user'][_0x2c0e('0x1c')]!==_0x2c0e('0x1f')){throw new Error(_0x2c0e('0x75'));}if(_[_0x2c0e('0x7f')](_0x384442,[_0x2c0e('0x1c'),'admin'])&&_0x168391['user']['role']!=='admin'){throw new Error(_0x2c0e('0x80'));}return licenseUtil[_0x2c0e('0x76')](_0x384442)['then'](function(){return validateUser(_0x384442[0x0]);})[_0x2c0e('0x1b')](function(){for(var _0x558f07=0x1;_0x558f07<_0x384442[_0x2c0e('0x41')];_0x558f07++){var _0x50813a=_0x384442[_0x558f07-0x1]['internal'];if(!_0x384442[_0x558f07][_0x2c0e('0x56')])_0x384442[_0x558f07][_0x2c0e('0x56')]=_0x50813a+0x1;_0x414578[_0x2c0e('0x42')](validateUser(_0x384442[_0x558f07]));}return Promise['all'](_0x414578);})[_0x2c0e('0x1b')](function(){_0x414578=[];for(var _0x3805e9=0x0;_0x3805e9<_0x384442[_0x2c0e('0x41')];_0x3805e9++){_0x414578[_0x2c0e('0x42')](updateUser(_0x384442[_0x3805e9]));}return Promise['all'](_0x414578);})['then'](function(){_0x414578=_0x384442[_0x2c0e('0x2f')](function(_0x4fcf22){return db[_0x2c0e('0x2d')][_0x2c0e('0x79')](_0x4fcf22,{'include':[{'model':db['VoiceMail'],'as':_0x2c0e('0x64')}]})[_0x2c0e('0x1b')](function(_0x5b4b06){_0x4fcf22['id']=_0x5b4b06['id'];return _0x4fcf22;});});return Promise[_0x2c0e('0x49')](_0x414578);})[_0x2c0e('0x1b')](function(_0x45e16f){if(_0x168391[_0x2c0e('0x51')][_0x2c0e('0x1c')]===_0x2c0e('0x21'))return _0x45e16f;if(_0x168391['user'][_0x2c0e('0x1c')]!==_0x2c0e('0x21'))return _0x45e16f;var _0x2d9b60=_[_0x2c0e('0x7f')](_0x45e16f,function(_0x4051e8){return _0x4051e8['role']===_0x2c0e('0x23')||_0x4051e8['role']==='telephone';});if(!_0x2d9b60)return _0x45e16f;return db['UserProfileSection'][_0x2c0e('0x3f')]({'where':{'name':{'$or':[_0x2c0e('0x22'),'Telephones']},'userProfileId':_0x168391[_0x2c0e('0x21')][_0x2c0e('0x78')]},'raw':!![]})[_0x2c0e('0x1b')](function(_0x46ade9){if(_[_0x2c0e('0x81')](_0x46ade9)||!_[_0x2c0e('0x7f')](_0x46ade9,['autoAssociation',0x0]))return _0x45e16f;_0x414578=[];var _0x5d3267=_(_0x46ade9)['map'](function(_0x4ffd10){if(_0x4ffd10[_0x2c0e('0x7b')]===0x1)return;return _0x4ffd10[_0x2c0e('0x36')]===_0x2c0e('0x22')?_0x2c0e('0x23'):'telephone';})[_0x2c0e('0x82')]()['value']();for(var _0x39fe08=0x0;_0x39fe08<_0x45e16f[_0x2c0e('0x41')];_0x39fe08++){if(!_[_0x2c0e('0x28')](_0x5d3267,_0x45e16f[_0x39fe08][_0x2c0e('0x1c')]))return;var _0x40ac06=_0x45e16f[_0x39fe08][_0x2c0e('0x1c')]===_0x2c0e('0x23')?_0x2c0e('0x22'):_0x2c0e('0x24');_0x414578['push'](db[_0x2c0e('0x7c')][_0x2c0e('0x79')]({'name':_0x45e16f[_0x39fe08][_0x2c0e('0x36')],'resourceId':_0x45e16f[_0x39fe08]['id'],'type':_0x40ac06,'sectionId':_[_0x2c0e('0x29')](_0x46ade9,[_0x2c0e('0x36'),_0x40ac06])['id']},{}));}return Promise[_0x2c0e('0x49')](_0x414578);});})[_0x2c0e('0x1b')](respondWithResult(_0x44ba17,0xc9))[_0x2c0e('0x4a')](handleError(_0x44ba17,null));};exports[_0x2c0e('0x83')]=function(_0xef12e2,_0x471503){if(_0xef12e2['body']['id']){delete _0xef12e2['body']['id'];}return db['User']['find']({'where':{'id':_0xef12e2['params']['id']}})['then'](function(_0x3e5cce){if(!_0x3e5cce)return null;if(_0x3e5cce['id']===_0xef12e2[_0x2c0e('0x21')]['id']){if(!_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x84')]||!_0xef12e2['body'][_0x2c0e('0x85')]){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x88'));}if(!_0x3e5cce['authenticate'](_0xef12e2['body']['oldPassword'])){throw new db['Sequelize'][(_0x2c0e('0x87'))](_0x2c0e('0x89'));}if(_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x84')]===_0xef12e2['body'][_0x2c0e('0x85')]){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x8a'));}}else if(_0xef12e2[_0x2c0e('0x21')][_0x2c0e('0x1c')]==='admin'){if(!_0xef12e2['body'][_0x2c0e('0x85')]){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xef12e2[_0x2c0e('0x21')][_0x2c0e('0x1c')]===_0x2c0e('0x21')){if(!_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')]){throw new db['Sequelize']['ValidationError'](_0x2c0e('0x8b'));}if(_0x3e5cce[_0x2c0e('0x1c')]!==_0x2c0e('0x23')){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x74'));}}else{throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x74'));}return _0x3e5cce;})[_0x2c0e('0x1b')](handleEntityNotFound(_0x471503,null))[_0x2c0e('0x1b')](function(_0x1eeb21){return db[_0x2c0e('0x57')][_0x2c0e('0x8c')]({'attributes':['id',_0x2c0e('0x59'),_0x2c0e('0x8d'),_0x2c0e('0x8e')]})[_0x2c0e('0x1b')](function(_0x189f97){if(_0x189f97[_0x2c0e('0x59')])authService[_0x2c0e('0x5a')](_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')]);if(!_0x189f97[_0x2c0e('0x8d')]||!_0x1eeb21[_0x2c0e('0x32')])return _0x1eeb21;authService[_0x2c0e('0x8f')](_0xef12e2['body']['newPassword'],_0x1eeb21[_0x2c0e('0x32')],_0x189f97['passwordHistoryLimit']);return _0x1eeb21;})[_0x2c0e('0x1b')](saveUpdates({'password':_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')],'passwordResetAt':_0xef12e2[_0x2c0e('0x21')]['id']==_0xef12e2[_0x2c0e('0x4c')]['id']?moment():null,'previousPasswords':authService[_0x2c0e('0x90')](_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')],_0x1eeb21['previousPasswords'])},null));})['then'](respondWithResult(_0x471503,null))[_0x2c0e('0x4a')](handleError(_0x471503,null));};exports[_0x2c0e('0x91')]=function(_0x270997,_0xe4b28d){var _0x57f53d=_0x270997['body']['channel'];return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x270997[_0x2c0e('0x4c')]['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c'),_0x2c0e('0x92'),_0x2c0e('0x93'),_0x2c0e('0x94'),_0x2c0e('0x95')]})[_0x2c0e('0x1b')](handleEntityNotFound(_0xe4b28d,null))[_0x2c0e('0x1b')](function(_0x5a7437){if(_0x5a7437){if(!utils[_0x2c0e('0x96')](_0x57f53d)){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x97'));}return _0x5a7437['add'+_[_0x2c0e('0x98')](_0x57f53d[_0x2c0e('0x99')]())+_0x2c0e('0x9a')](_0x270997[_0x2c0e('0x51')]['ids'],{'penalty':_0x270997[_0x2c0e('0x51')][_0x2c0e('0x9b')]||0x0})[_0x2c0e('0x9c')](function(_0x2c24b1){for(var _0x397981=0x0;_0x397981<_0x270997[_0x2c0e('0x51')][_0x2c0e('0x54')]['length'];_0x397981+=0x1){var _0x2f1362={'UserId':Number(_0x270997[_0x2c0e('0x4c')]['id'])};_0x2f1362[_[_0x2c0e('0x98')](_0x57f53d['toLowerCase']())+'QueueId']=Number(_0x270997['body'][_0x2c0e('0x54')][_0x397981]);socket[_0x2c0e('0x1d')](_0x2c0e('0x21')+_['capitalize'](_0x57f53d[_0x2c0e('0x99')]())+_0x2c0e('0x9d'),_0x2f1362);}return _0x2c24b1;})[_0x2c0e('0x1b')](function(){if(_0x57f53d===_0x2c0e('0x9e')){return db['VoiceQueue'][_0x2c0e('0x3f')]({'where':{'id':_0x270997[_0x2c0e('0x51')]['ids']||[]},'raw':!![],'attributes':['id',_0x2c0e('0x36')]});}})[_0x2c0e('0x1b')](function(_0x4929fb){var _0x41125a=_0x5a7437[_0x2c0e('0x1e')]({'plain':!![]});var _0x7a3fe0=[];if(_0x57f53d===_0x2c0e('0x9e')&&_0x41125a['role']===_0x2c0e('0x23')&&_0x41125a[_0x2c0e('0x92')]){for(let _0x40357c=0x0;_0x40357c<_0x4929fb[_0x2c0e('0x41')];_0x40357c+=0x1){_0x7a3fe0[_0x2c0e('0x42')]({'membername':_0x41125a['name'],'UserId':_0x41125a['id'],'queue_name':_0x4929fb[_0x40357c][_0x2c0e('0x36')],'VoiceQueueId':_0x4929fb[_0x40357c]['id'],'interface':_['isNil'](_0x41125a[_0x2c0e('0x95')])?util['format']('SIP/%s',_0x41125a[_0x2c0e('0x36')]):_0x41125a[_0x2c0e('0x95')],'paused':_0x41125a[_0x2c0e('0x94')]||![],'penalty':_0x270997[_0x2c0e('0x51')][_0x2c0e('0x9b')]||0x0});}return Promise[_0x2c0e('0x49')](_0x7a3fe0[_0x2c0e('0x2f')](function(_0x1af9b2){return db[_0x2c0e('0x9f')][_0x2c0e('0xa0')](_0x1af9b2);}));}return _0x5a7437;});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0xe4b28d,null))[_0x2c0e('0x4a')](handleError(_0xe4b28d,null));};exports[_0x2c0e('0xa1')]=function(_0x52328f,_0x27f0c2){var _0x20b875,_0x48af66;return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x52328f['params']['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c')]})[_0x2c0e('0x1b')](handleEntityNotFound(_0x27f0c2,null))[_0x2c0e('0x1b')](function(_0x4b3640){if(_0x4b3640){_0x20b875=_0x4b3640;if(!_0x52328f[_0x2c0e('0x39')][_0x2c0e('0xa2')]||!utils[_0x2c0e('0x96')](_0x52328f[_0x2c0e('0x39')][_0x2c0e('0xa2')])){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x97'));}return _0x4b3640[_0x2c0e('0xa3')+_[_0x2c0e('0x98')](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+_0x2c0e('0x9a')](_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')]);}})['then'](function(_0x229cef){if(_['isArray'](_0x52328f[_0x2c0e('0x39')]['ids'])){for(var _0x4ee945=0x0;_0x4ee945<_0x52328f[_0x2c0e('0x39')]['ids'][_0x2c0e('0x41')];_0x4ee945+=0x1){_0x48af66={'UserId':Number(_0x52328f[_0x2c0e('0x4c')]['id'])};_0x48af66[_[_0x2c0e('0x98')](_0x52328f[_0x2c0e('0x39')][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+'QueueId']=Number(_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x4ee945]);socket['emit']('user'+_[_0x2c0e('0x98')](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+_0x2c0e('0xa4'),_0x48af66);}}else{_0x48af66={'UserId':Number(_0x52328f['params']['id'])};_0x48af66[_[_0x2c0e('0x98')](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+'QueueId']=Number(_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')]);socket[_0x2c0e('0x1d')]('user'+_['capitalize'](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+'Queue:remove',_0x48af66);}return _0x229cef;})[_0x2c0e('0x1b')](function(){if(_0x52328f['query'][_0x2c0e('0xa2')]==='voice'){return db[_0x2c0e('0x9f')]['destroy']({'where':{'UserId':_0x52328f[_0x2c0e('0x4c')]['id'],'VoiceQueueId':_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')]},'individualHooks':!![]})[_0x2c0e('0x1b')](function(){return _0x20b875;});}return _0x20b875;})[_0x2c0e('0x1b')](respondWithStatusCode(_0x27f0c2,null))['catch'](handleError(_0x27f0c2,null));};exports[_0x2c0e('0xa5')]=function(_0x5a2c14,_0xa35110){_0x5a2c14[_0x2c0e('0x51')][_0x2c0e('0xa6')]=_0x5a2c14[_0x2c0e('0xa7')]['filename'];return db[_0x2c0e('0x2d')]['find']({'where':{'id':_0x5a2c14['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0xa35110,null))[_0x2c0e('0x1b')](saveUpdates(_0x5a2c14[_0x2c0e('0x51')],null))[_0x2c0e('0x1b')](respondWithResult(_0xa35110,null))[_0x2c0e('0x4a')](handleError(_0xa35110,null));};exports[_0x2c0e('0xa8')]=function(_0x824eb9,_0x1bf4ca){var _0x302544=path[_0x2c0e('0xa9')](config[_0x2c0e('0xaa')],_0x2c0e('0xab'));return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x824eb9[_0x2c0e('0x4c')]['id']},'attributes':['id',_0x2c0e('0xa6')],'raw':!![]})['then'](handleEntityNotFound(_0x1bf4ca,null))['then'](function(_0x45982b){if(_0x45982b){if(_['isNil'](_0x45982b[_0x2c0e('0xa6')])){return _0x1bf4ca['download'](_0x302544);}else{if(!fs['existsSync'](path['join'](config[_0x2c0e('0xaa')],_0x2c0e('0xac'),_0x45982b['userpic']))){return _0x1bf4ca[_0x2c0e('0xad')](_0x302544);}return _0x1bf4ca[_0x2c0e('0xad')](path['join'](config[_0x2c0e('0xaa')],_0x2c0e('0xac'),_0x45982b['userpic']));}}})['catch'](handleError(_0x1bf4ca,null));};exports[_0x2c0e('0xae')]=function(_0x8e7eb6,_0x3520fa){return db['User']['find']({'where':{'id':_0x8e7eb6[_0x2c0e('0x4c')]['id']},'attributes':['id']})[_0x2c0e('0x1b')](handleEntityNotFound(_0x3520fa,null))[_0x2c0e('0x1b')](function(_0x49740f){var _0x998251=[];values=_0x49740f[_0x2c0e('0x43')];_0x998251[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x4f'),_0x49740f[_0x2c0e('0x43')]));_0x998251[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x44'),_0x49740f[_0x2c0e('0x43')]));_0x998251[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x47'),_0x49740f[_0x2c0e('0x43')]));_0x998251[_0x2c0e('0x42')](get_open_tabs('whatsapp',_0x49740f[_0x2c0e('0x43')]));_0x998251['push'](get_open_tabs(_0x2c0e('0x45'),_0x49740f[_0x2c0e('0x43')]));_0x998251['push'](get_open_tabs('mail',_0x49740f[_0x2c0e('0x43')]));return Promise[_0x2c0e('0x49')](_0x998251);})[_0x2c0e('0x1b')](function(_0x455d24){if(_0x455d24){var _0x155508=_[_0x2c0e('0x2f')](values['ChatOpenTabs'],function(_0x5eac24){return{'channel':_0x2c0e('0xaf'),'id':_0x5eac24['id'],'createdAt':_0x5eac24[_0x2c0e('0xb0')]};});var _0x37d8b3=_[_0x2c0e('0x2f')](values[_0x2c0e('0xb1')],function(_0x54aac1){return{'channel':_0x2c0e('0xb2'),'id':_0x54aac1['id'],'createdAt':_0x54aac1[_0x2c0e('0xb0')]};});var _0x408ec7=_[_0x2c0e('0x2f')](values[_0x2c0e('0xb3')],function(_0x554014){return{'channel':_0x2c0e('0xb4'),'id':_0x554014['id'],'createdAt':_0x554014[_0x2c0e('0xb0')]};});var _0x5cdf11=_[_0x2c0e('0x2f')](values['MailOpenTabs'],function(_0x121b06){return{'channel':_0x2c0e('0xb5'),'id':_0x121b06['id'],'createdAt':_0x121b06[_0x2c0e('0xb0')]};});var _0x4d63a0=_['map'](values[_0x2c0e('0xb6')],function(_0x352c26){return{'channel':_0x2c0e('0xb7'),'id':_0x352c26['id'],'createdAt':_0x352c26[_0x2c0e('0xb0')]};});var _0x241e34=_[_0x2c0e('0x2f')](values['WhatsappOpenTabs'],function(_0x37d5ad){return{'channel':_0x2c0e('0xb8'),'id':_0x37d5ad['id'],'createdAt':_0x37d5ad[_0x2c0e('0xb0')]};});var _0x3a597b=_[_0x2c0e('0xb9')](_0x155508,_0x37d8b3,_0x408ec7,_0x5cdf11,_0x4d63a0,_0x241e34);var _0x3e5674={'count':_0x3a597b['length'],'rows':_0x3a597b};return _0x3e5674;}else return null;})['then'](respondWithResult(_0x3520fa,null))[_0x2c0e('0x4a')](handleError(_0x3520fa,null));};exports[_0x2c0e('0xba')]=function(_0x727762,_0x5a32c1){var _0xed8651={};return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x727762['params']['id']}})[_0x2c0e('0x1b')](function(_0x5abc0d){if(!_0x5abc0d){throw new APINotFoundError(util[_0x2c0e('0xbb')](_0x2c0e('0xbc'),_0x727762['params']['id']));}return contacts[_0x2c0e('0x52')]();})[_0x2c0e('0x1b')](function(_0x5b3e2f){_0x727762[_0x2c0e('0x39')][_0x2c0e('0x2d')]=_0x727762['params']['id'];_0xed8651=qs[_0x2c0e('0x37')](_0x5b3e2f,_0x727762);if(_0x727762[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0x3a'))){_0xed8651[_0x2c0e('0x4d')]=[{'model':db[_0x2c0e('0xbe')],'as':_0x2c0e('0xbf'),'required':![]},{'model':db['Tag'],'as':_0x2c0e('0xc0'),'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0xc1')],'where':_0x727762[_0x2c0e('0x39')][_0x2c0e('0xc2')]?{'id':_0x727762['query'][_0x2c0e('0xc2')]}:undefined,'required':_0x727762[_0x2c0e('0x39')]['tag']?!![]:![]}];}return contacts[_0x2c0e('0x3f')](_0x727762[_0x2c0e('0x39')],_0x727762[_0x2c0e('0x21')],_0xed8651,_0x5b3e2f);})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x5a32c1,_0xed8651))[_0x2c0e('0x4a')](APIHandleError(_0x5a32c1));};exports['getQueues']=function(_0x5223c6,_0x37ffed){var _0x1a950e;var _0x3936aa={};var _0x59ecc3;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x5223c6['params']['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c')]})[_0x2c0e('0x1b')](handleEntityNotFound(_0x37ffed,null))[_0x2c0e('0x1b')](function(_0x5b9fd0){if(!utils[_0x2c0e('0x96')](_0x5223c6[_0x2c0e('0x39')]['channel'])){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x97'));}_0x1a950e=_0x5b9fd0;var _0x51e695={};_0x51e695[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_['capitalize'](_0x5223c6['query'][_0x2c0e('0xa2')])+_0x2c0e('0xc5')][_0x2c0e('0x2e')]);_0x51e695[_0x2c0e('0x39')]=_['keys'](_0x5223c6[_0x2c0e('0x39')]);_0x51e695[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x51e695[_0x2c0e('0xc3')],_0x51e695[_0x2c0e('0x39')]);_0x3936aa[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x51e695[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x3936aa[_0x2c0e('0x3e')]=_0x3936aa[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x3936aa[_0x2c0e('0x3e')]:_0x51e695[_0x2c0e('0xc3')];_0x3936aa[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x3936aa[_0x2c0e('0x38')]=qs['filters'](_[_0x2c0e('0xcb')](_0x5223c6['query'],_0x51e695[_0x2c0e('0xc6')]));if(_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x3936aa[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x3936aa[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x3936aa[_0x2c0e('0x3e')],function(_0x23aedc){var _0x12e7c4={};_0x12e7c4[_0x23aedc]={'$like':'%'+_0x5223c6['query'][_0x2c0e('0xcc')]+'%'};return _0x12e7c4;})});}_0x3936aa=_['merge']({},_0x3936aa,_0x5223c6[_0x2c0e('0xcd')]);switch(_0x1a950e[_0x2c0e('0x1c')]){case'admin':return db[_[_0x2c0e('0x98')](_0x5223c6[_0x2c0e('0x39')]['channel'])+_0x2c0e('0xc5')][_0x2c0e('0x3f')](_0x3936aa);case'user':case _0x2c0e('0x23'):return _0x1a950e['get'+_['capitalize'](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xa2')])+_0x2c0e('0x9a')](_0x3936aa);default:throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))]('Unknown\x20role');}})[_0x2c0e('0x1b')](function(_0x5c0b90){_0x59ecc3=_0x5c0b90[_0x2c0e('0x41')];if(!_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x3936aa[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x5223c6['query'][_0x2c0e('0xcf')]);_0x3936aa[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x5223c6[_0x2c0e('0x39')]['offset']);}switch(_0x1a950e[_0x2c0e('0x1c')]){case _0x2c0e('0x1f'):return db[_[_0x2c0e('0x98')](_0x5223c6['query']['channel'])+_0x2c0e('0xc5')]['findAll'](_0x3936aa);case _0x2c0e('0x21'):case _0x2c0e('0x23'):return _0x1a950e[_0x2c0e('0x1e')+_['capitalize'](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xa2')])+'Queues'](_0x3936aa);}})[_0x2c0e('0x1b')](function(_0x43cff5){return{'count':_0x59ecc3,'rows':_0x43cff5};})[_0x2c0e('0x1b')](respondWithResult(_0x37ffed,null))[_0x2c0e('0x4a')](handleError(_0x37ffed,null));};exports[_0x2c0e('0xd0')]=function(_0xe8d0f0,_0x519c26){var _0x56b8fb={};var _0x410716={};var _0x5f5b55;var _0x581018;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0xe8d0f0['params']['id']}})['then'](handleEntityNotFound(_0x519c26,null))[_0x2c0e('0x1b')](function(_0x1b8aea){if(_0x1b8aea){_0x5f5b55=_0x1b8aea;_0x410716[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0x9f')]['rawAttributes']);_0x410716[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0xe8d0f0[_0x2c0e('0x39')]);_0x410716['filters']=_[_0x2c0e('0xc7')](_0x410716[_0x2c0e('0xc3')],_0x410716[_0x2c0e('0x39')]);_0x56b8fb['attributes']=_[_0x2c0e('0xc7')](_0x410716[_0x2c0e('0xc3')],qs['fields'](_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x56b8fb['attributes']=_0x56b8fb[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x56b8fb['attributes']:_0x410716[_0x2c0e('0xc3')];_0x56b8fb[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0xe8d0f0[_0x2c0e('0x39')]['sort']);_0x56b8fb[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0xe8d0f0[_0x2c0e('0x39')],_0x410716[_0x2c0e('0xc6')]));if(_0xe8d0f0['query']['filter']){_0x56b8fb[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x56b8fb[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x56b8fb[_0x2c0e('0x3e')],function(_0x2c8f78){var _0x574a1e={};_0x574a1e[_0x2c8f78]={'$like':'%'+_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x574a1e;})});}_0x56b8fb=_[_0x2c0e('0x4e')]({},_0x56b8fb,_0xe8d0f0[_0x2c0e('0xcd')]);return _0x5f5b55[_0x2c0e('0xd0')](_0x56b8fb);}})[_0x2c0e('0x1b')](function(_0x563bea){if(_0x563bea){_0x581018=_0x563bea[_0x2c0e('0x41')];if(!_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x56b8fb[_0x2c0e('0xcf')]=qs['limit'](_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x56b8fb['offset']=qs[_0x2c0e('0x16')](_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x5f5b55[_0x2c0e('0xd0')](_0x56b8fb);}})['then'](function(_0x51f82f){if(_0x51f82f){return _0x51f82f?{'count':_0x581018,'rows':_0x51f82f}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x519c26,null))[_0x2c0e('0x4a')](handleError(_0x519c26,null));};exports[_0x2c0e('0xd1')]=function(_0x3b7752,_0x439ed8){var _0x553afd={};var _0x1a93aa={};var _0x2191fd;var _0x390e47;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x3b7752[_0x2c0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x439ed8,null))[_0x2c0e('0x1b')](function(_0x3ebdff){if(_0x3ebdff){_0x2191fd=_0x3ebdff;_0x1a93aa[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db['ChatGroup'][_0x2c0e('0x2e')]);_0x1a93aa['query']=_[_0x2c0e('0xc4')](_0x3b7752[_0x2c0e('0x39')]);_0x1a93aa['filters']=_[_0x2c0e('0xc7')](_0x1a93aa[_0x2c0e('0xc3')],_0x1a93aa[_0x2c0e('0x39')]);_0x553afd['attributes']=_[_0x2c0e('0xc7')](_0x1a93aa[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x3b7752[_0x2c0e('0x39')]['fields']));_0x553afd['attributes']=_0x553afd[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x553afd[_0x2c0e('0x3e')]:_0x1a93aa[_0x2c0e('0xc3')];_0x553afd[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x3b7752['query']['sort']);_0x553afd[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_['pick'](_0x3b7752[_0x2c0e('0x39')],_0x1a93aa[_0x2c0e('0xc6')]));if(_0x3b7752['query'][_0x2c0e('0xcc')]){_0x553afd[_0x2c0e('0x38')]=_['merge'](_0x553afd['where'],{'$or':_[_0x2c0e('0x2f')](_0x553afd[_0x2c0e('0x3e')],function(_0x455143){var _0x39a833={};_0x39a833[_0x455143]={'$like':'%'+_0x3b7752[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x39a833;})});}_0x553afd=_[_0x2c0e('0x4e')]({},_0x553afd,_0x3b7752[_0x2c0e('0xcd')]);return _0x2191fd[_0x2c0e('0xd1')](_0x553afd);}})['then'](function(_0x3ce2c2){if(_0x3ce2c2){_0x390e47=_0x3ce2c2[_0x2c0e('0x41')];if(!_0x3b7752[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x553afd['limit']=qs[_0x2c0e('0xcf')](_0x3b7752['query'][_0x2c0e('0xcf')]);_0x553afd['offset']=qs[_0x2c0e('0x16')](_0x3b7752[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x2191fd[_0x2c0e('0xd1')](_0x553afd);}})['then'](function(_0x3fef8f){if(_0x3fef8f){return _0x3fef8f?{'count':_0x390e47,'rows':_0x3fef8f}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x439ed8,null))[_0x2c0e('0x4a')](handleError(_0x439ed8,null));};exports['getRecordings']=function(_0x74512c,_0x3b2efb){var _0xbd2ab8={'raw':!![],'where':{}};var _0x5b5547={};var _0x252900={'count':0x0,'rows':[]};return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x74512c[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x3b2efb,null))['then'](function(_0x3ff4a3){if(_0x3ff4a3){_0x5b5547[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db['VoiceRecording'][_0x2c0e('0x2e')]);_0x5b5547['query']=_[_0x2c0e('0xc4')](_0x74512c[_0x2c0e('0x39')]);_0x5b5547[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x5b5547[_0x2c0e('0xc3')],_0x5b5547['query']);_0xbd2ab8[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5b5547[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0xbd2ab8[_0x2c0e('0x3e')]=_0xbd2ab8[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0xbd2ab8['attributes']:_0x5b5547[_0x2c0e('0xc3')];if(!_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0xbd2ab8[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0xbd2ab8[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0x16')]);}_0xbd2ab8['order']=qs[_0x2c0e('0xca')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0xbd2ab8[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x74512c[_0x2c0e('0x39')],_0x5b5547[_0x2c0e('0xc6')]));_0xbd2ab8[_0x2c0e('0x38')][_0x2c0e('0xd2')]=_0x3ff4a3['id'];if(_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0xbd2ab8['where']=_[_0x2c0e('0x4e')](_0xbd2ab8[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0xbd2ab8['attributes'],function(_0x65fbcc){var _0x2ed9db={};_0x2ed9db[_0x65fbcc]={'$like':'%'+_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x2ed9db;})});}_0xbd2ab8=_[_0x2c0e('0x4e')]({},_0xbd2ab8,_0x74512c['options']);return db['VoiceRecording'][_0x2c0e('0x18')]({'where':_0xbd2ab8[_0x2c0e('0x38')]})['then'](function(_0x2a3a08){_0x252900[_0x2c0e('0x18')]=_0x2a3a08;if(_0x74512c['query'][_0x2c0e('0x3a')]){_0xbd2ab8[_0x2c0e('0x4d')]=[{'all':!![]}];}return db['VoiceRecording'][_0x2c0e('0x3f')](_0xbd2ab8);})['then'](function(_0x5cb9f0){_0x252900['rows']=_0x5cb9f0;return _0x252900;});}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x3b2efb,_0xbd2ab8))[_0x2c0e('0x4a')](handleError(_0x3b2efb,null));};exports[_0x2c0e('0xd3')]=function(_0x1df857,_0x1288b6){var _0xbdf08d={'raw':!![],'where':{}};var _0x5e4916={};var _0x3f702c={'count':0x0,'rows':[]};return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x1df857[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x1288b6,null))[_0x2c0e('0x1b')](function(_0x5cfbbd){if(_0x5cfbbd){_0x5e4916[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0xd4')]['rawAttributes']);_0x5e4916[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x1df857[_0x2c0e('0x39')]);_0x5e4916['filters']=_['intersection'](_0x5e4916[_0x2c0e('0xc3')],_0x5e4916[_0x2c0e('0x39')]);_0xbdf08d['attributes']=_['intersection'](_0x5e4916['model'],qs[_0x2c0e('0xc8')](_0x1df857['query']['fields']));_0xbdf08d[_0x2c0e('0x3e')]=_0xbdf08d[_0x2c0e('0x3e')]['length']?_0xbdf08d['attributes']:_0x5e4916[_0x2c0e('0xc3')];if(!_0x1df857[_0x2c0e('0x39')]['hasOwnProperty']('nolimit')){_0xbdf08d[_0x2c0e('0xcf')]=qs['limit'](_0x1df857[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0xbdf08d['offset']=qs[_0x2c0e('0x16')](_0x1df857[_0x2c0e('0x39')][_0x2c0e('0x16')]);}_0xbdf08d[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x1df857[_0x2c0e('0x39')]['sort']);_0xbdf08d[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_['pick'](_0x1df857[_0x2c0e('0x39')],_0x5e4916[_0x2c0e('0xc6')]));_0xbdf08d[_0x2c0e('0x38')][_0x2c0e('0xd2')]=_0x5cfbbd['id'];if(_0x1df857[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0xbdf08d[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0xbdf08d[_0x2c0e('0x38')],{'$or':_['map'](_0xbdf08d[_0x2c0e('0x3e')],function(_0x360cf3){var _0x3e992e={};_0x3e992e[_0x360cf3]={'$like':'%'+_0x1df857['query'][_0x2c0e('0xcc')]+'%'};return _0x3e992e;})});}_0xbdf08d=_[_0x2c0e('0x4e')]({},_0xbdf08d,_0x1df857['options']);return db[_0x2c0e('0xd4')][_0x2c0e('0x18')]({'where':_0xbdf08d['where']})['then'](function(_0x278c01){_0x3f702c[_0x2c0e('0x18')]=_0x278c01;if(_0x1df857[_0x2c0e('0x39')]['includeAll']){_0xbdf08d[_0x2c0e('0x4d')]=[{'all':!![]}];}return db[_0x2c0e('0xd4')][_0x2c0e('0x3f')](_0xbdf08d);})['then'](function(_0x15d85c){_0x3f702c['rows']=_0x15d85c;return _0x3f702c;});}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x1288b6,_0xbdf08d))[_0x2c0e('0x4a')](handleError(_0x1288b6,null));};exports[_0x2c0e('0xd5')]=function(_0xd6005e,_0x216ca6){var _0x2aad69={};var _0x480499={};var _0x2cec7d;var _0x2625a2;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0xd6005e[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x216ca6,null))[_0x2c0e('0x1b')](function(_0x27a594){if(_0x27a594){_0x2cec7d=_0x27a594;_0x480499['model']=_[_0x2c0e('0xc4')](db['ChatInteraction']['rawAttributes']);_0x480499['query']=_['keys'](_0xd6005e[_0x2c0e('0x39')]);_0x480499[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x480499[_0x2c0e('0xc3')],_0x480499[_0x2c0e('0x39')]);_0x2aad69[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x480499[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x2aad69['attributes']=_0x2aad69[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x2aad69['attributes']:_0x480499['model'];_0x2aad69[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x2aad69['where']=qs[_0x2c0e('0xc6')](_['pick'](_0xd6005e[_0x2c0e('0x39')],_0x480499['filters']));if(_0xd6005e[_0x2c0e('0x39')]['filter']){_0x2aad69['where']=_[_0x2c0e('0x4e')](_0x2aad69[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x2aad69[_0x2c0e('0x3e')],function(_0x5669b8){var _0x2a6fbb={};_0x2a6fbb[_0x5669b8]={'$like':'%'+_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x2a6fbb;})});}_0x2aad69=_[_0x2c0e('0x4e')]({},_0x2aad69,_0xd6005e['options']);return _0x2cec7d[_0x2c0e('0xd5')](_0x2aad69);}})[_0x2c0e('0x1b')](function(_0x51c7b0){if(_0x51c7b0){_0x2625a2=_0x51c7b0[_0x2c0e('0x41')];if(!_0xd6005e[_0x2c0e('0x39')]['hasOwnProperty'](_0x2c0e('0xce'))){_0x2aad69[_0x2c0e('0xcf')]=qs['limit'](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x2aad69['offset']=qs[_0x2c0e('0x16')](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x2cec7d[_0x2c0e('0xd5')](_0x2aad69);}})[_0x2c0e('0x1b')](function(_0xdf306f){if(_0xdf306f){return _0xdf306f?{'count':_0x2625a2,'rows':_0xdf306f}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x216ca6,null))['catch'](handleError(_0x216ca6,null));};exports[_0x2c0e('0xd6')]=function(_0x2d77b2,_0x482cb8){var _0x172557={};var _0x5b75bb={};var _0x2de70f;var _0x19b9bb;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x2d77b2[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x482cb8,null))[_0x2c0e('0x1b')](function(_0x5d7871){if(_0x5d7871){_0x2de70f=_0x5d7871;_0x5b75bb['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x5b75bb[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x2d77b2[_0x2c0e('0x39')]);_0x5b75bb['filters']=_[_0x2c0e('0xc7')](_0x5b75bb[_0x2c0e('0xc3')],_0x5b75bb[_0x2c0e('0x39')]);_0x172557[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5b75bb[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x172557['attributes']=_0x172557['attributes'][_0x2c0e('0x41')]?_0x172557[_0x2c0e('0x3e')]:_0x5b75bb['model'];_0x172557[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x2d77b2[_0x2c0e('0x39')]['sort']);_0x172557['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x2d77b2[_0x2c0e('0x39')],_0x5b75bb[_0x2c0e('0xc6')]));if(_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x172557[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x172557[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x172557[_0x2c0e('0x3e')],function(_0x5af14c){var _0x3bcde={};_0x3bcde[_0x5af14c]={'$like':'%'+_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x3bcde;})});}_0x172557=_['merge']({},_0x172557,_0x2d77b2[_0x2c0e('0xcd')]);return _0x2de70f[_0x2c0e('0xd6')](_0x172557);}})[_0x2c0e('0x1b')](function(_0x20dd54){if(_0x20dd54){_0x19b9bb=_0x20dd54[_0x2c0e('0x41')];if(!_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x172557[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x172557['offset']=qs['offset'](_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x2de70f[_0x2c0e('0xd6')](_0x172557);}})[_0x2c0e('0x1b')](function(_0x33c924){if(_0x33c924){return _0x33c924?{'count':_0x19b9bb,'rows':_0x33c924}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x482cb8,null))[_0x2c0e('0x4a')](handleError(_0x482cb8,null));};exports['getMailInteractions']=function(_0x590a7b,_0x1938d7){var _0x4fb5ef={'raw':!![],'where':{}};var _0x53cd0c={};var _0x2739a7={'count':0x0,'rows':[]};return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x590a7b[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x1938d7,null))[_0x2c0e('0x1b')](function(_0x24709a){if(_0x24709a){_0x53cd0c['model']=_['keys'](db[_0x2c0e('0xd7')][_0x2c0e('0x2e')]);_0x53cd0c[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x590a7b['query']);_0x53cd0c['filters']=_[_0x2c0e('0xc7')](_0x53cd0c[_0x2c0e('0xc3')],_0x53cd0c[_0x2c0e('0x39')]);_0x4fb5ef[_0x2c0e('0x3e')]=_['intersection'](_0x53cd0c[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x4fb5ef[_0x2c0e('0x3e')]=_0x4fb5ef[_0x2c0e('0x3e')]['length']?_0x4fb5ef[_0x2c0e('0x3e')]:_0x53cd0c[_0x2c0e('0xc3')];if(!_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x4fb5ef[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x4fb5ef[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0x16')]);}_0x4fb5ef[_0x2c0e('0xc9')]=qs['sort'](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x4fb5ef[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x590a7b[_0x2c0e('0x39')],_0x53cd0c['filters']));_0x4fb5ef[_0x2c0e('0x38')]['UserId']=_0x24709a['id'];if(_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x4fb5ef['where']=_[_0x2c0e('0x4e')](_0x4fb5ef[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x4fb5ef[_0x2c0e('0x3e')],function(_0x5a90ad){var _0x50ed09={};_0x50ed09[_0x5a90ad]={'$like':'%'+_0x590a7b[_0x2c0e('0x39')]['filter']+'%'};return _0x50ed09;})});}_0x4fb5ef=_[_0x2c0e('0x4e')]({},_0x4fb5ef,_0x590a7b[_0x2c0e('0xcd')]);return db['MailInteraction']['count']({'where':_0x4fb5ef['where']})[_0x2c0e('0x1b')](function(_0x2992ca){_0x2739a7[_0x2c0e('0x18')]=_0x2992ca;if(_0x590a7b['query']['includeAll']){_0x4fb5ef[_0x2c0e('0x4d')]=[{'all':!![]}];}return db[_0x2c0e('0xd7')][_0x2c0e('0x3f')](_0x4fb5ef);})[_0x2c0e('0x1b')](function(_0x10c32f){_0x2739a7[_0x2c0e('0x40')]=_0x10c32f;return _0x2739a7;});}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x1938d7,_0x4fb5ef))[_0x2c0e('0x4a')](handleError(_0x1938d7,null));};exports[_0x2c0e('0xd8')]=function(_0x26d121,_0x512225){var _0x37bf34={};var _0x21e477={};var _0xb91f9e;var _0x5ea2c7;return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x26d121[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x512225,null))[_0x2c0e('0x1b')](function(_0x4ab4b6){if(_0x4ab4b6){_0xb91f9e=_0x4ab4b6;_0x21e477[_0x2c0e('0xc3')]=_['keys'](db['SmsInteraction'][_0x2c0e('0x2e')]);_0x21e477['query']=_['keys'](_0x26d121['query']);_0x21e477[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x21e477[_0x2c0e('0xc3')],_0x21e477[_0x2c0e('0x39')]);_0x37bf34[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x21e477[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x26d121['query'][_0x2c0e('0xc8')]));_0x37bf34[_0x2c0e('0x3e')]=_0x37bf34[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x37bf34[_0x2c0e('0x3e')]:_0x21e477[_0x2c0e('0xc3')];_0x37bf34[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x37bf34['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x26d121[_0x2c0e('0x39')],_0x21e477[_0x2c0e('0xc6')]));if(_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x37bf34['where']=_[_0x2c0e('0x4e')](_0x37bf34[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x37bf34[_0x2c0e('0x3e')],function(_0x3a1a51){var _0x129813={};_0x129813[_0x3a1a51]={'$like':'%'+_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x129813;})});}_0x37bf34=_[_0x2c0e('0x4e')]({},_0x37bf34,_0x26d121[_0x2c0e('0xcd')]);return _0xb91f9e[_0x2c0e('0xd8')](_0x37bf34);}})[_0x2c0e('0x1b')](function(_0x4a7291){if(_0x4a7291){_0x5ea2c7=_0x4a7291[_0x2c0e('0x41')];if(!_0x26d121['query'][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x37bf34[_0x2c0e('0xcf')]=qs['limit'](_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x37bf34[_0x2c0e('0x16')]=qs['offset'](_0x26d121['query'][_0x2c0e('0x16')]);}return _0xb91f9e[_0x2c0e('0xd8')](_0x37bf34);}})['then'](function(_0x1df349){if(_0x1df349){return _0x1df349?{'count':_0x5ea2c7,'rows':_0x1df349}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x512225,null))[_0x2c0e('0x4a')](handleError(_0x512225,null));};exports[_0x2c0e('0xd9')]=function(_0x3ace83,_0x249313){var _0x5943a2={};var _0x5e4e5f={};var _0x31414c;var _0x12a47b;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x3ace83[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x249313,null))[_0x2c0e('0x1b')](function(_0x330b3c){if(_0x330b3c){_0x31414c=_0x330b3c;_0x5e4e5f[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0xda')][_0x2c0e('0x2e')]);_0x5e4e5f[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x3ace83[_0x2c0e('0x39')]);_0x5e4e5f[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x5e4e5f[_0x2c0e('0xc3')],_0x5e4e5f[_0x2c0e('0x39')]);_0x5943a2[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5e4e5f[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x3ace83[_0x2c0e('0x39')]['fields']));_0x5943a2[_0x2c0e('0x3e')]=_0x5943a2['attributes'][_0x2c0e('0x41')]?_0x5943a2[_0x2c0e('0x3e')]:_0x5e4e5f[_0x2c0e('0xc3')];_0x5943a2[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x3ace83[_0x2c0e('0x39')]['sort']);_0x5943a2[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x3ace83[_0x2c0e('0x39')],_0x5e4e5f[_0x2c0e('0xc6')]));if(_0x3ace83[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x5943a2['where']=_[_0x2c0e('0x4e')](_0x5943a2[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x5943a2[_0x2c0e('0x3e')],function(_0x302153){var _0x4ba8d0={};_0x4ba8d0[_0x302153]={'$like':'%'+_0x3ace83[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x4ba8d0;})});}_0x5943a2=_[_0x2c0e('0x4e')]({},_0x5943a2,_0x3ace83['options']);return _0x31414c[_0x2c0e('0xd9')](_0x5943a2);}})[_0x2c0e('0x1b')](function(_0x2ed1d2){if(_0x2ed1d2){_0x12a47b=_0x2ed1d2[_0x2c0e('0x41')];if(!_0x3ace83['query'][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x5943a2[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x3ace83['query']['limit']);_0x5943a2[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x3ace83[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x31414c[_0x2c0e('0xd9')](_0x5943a2);}})[_0x2c0e('0x1b')](function(_0x576330){if(_0x576330){return _0x576330?{'count':_0x12a47b,'rows':_0x576330}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x249313,null))[_0x2c0e('0x4a')](handleError(_0x249313,null));};exports[_0x2c0e('0xdb')]=function(_0x54d0b2,_0x180286){var _0x20045c={};var _0x35d087={};var _0x4192d5;var _0x3349dd;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x54d0b2[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x180286,null))[_0x2c0e('0x1b')](function(_0x2f84ba){if(_0x2f84ba){_0x4192d5=_0x2f84ba;_0x35d087[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db['WhatsappInteraction'][_0x2c0e('0x2e')]);_0x35d087[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x54d0b2['query']);_0x35d087[_0x2c0e('0xc6')]=_['intersection'](_0x35d087[_0x2c0e('0xc3')],_0x35d087['query']);_0x20045c[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x35d087['model'],qs[_0x2c0e('0xc8')](_0x54d0b2[_0x2c0e('0x39')]['fields']));_0x20045c['attributes']=_0x20045c[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x20045c[_0x2c0e('0x3e')]:_0x35d087[_0x2c0e('0xc3')];_0x20045c[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x20045c['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x54d0b2[_0x2c0e('0x39')],_0x35d087['filters']));if(_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x20045c[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x20045c[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x20045c[_0x2c0e('0x3e')],function(_0x19cd72){var _0x140f6e={};_0x140f6e[_0x19cd72]={'$like':'%'+_0x54d0b2['query'][_0x2c0e('0xcc')]+'%'};return _0x140f6e;})});}_0x20045c=_[_0x2c0e('0x4e')]({},_0x20045c,_0x54d0b2[_0x2c0e('0xcd')]);return _0x4192d5[_0x2c0e('0xdb')](_0x20045c);}})[_0x2c0e('0x1b')](function(_0x23539b){if(_0x23539b){_0x3349dd=_0x23539b[_0x2c0e('0x41')];if(!_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xbd')]('nolimit')){_0x20045c[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x20045c['offset']=qs['offset'](_0x54d0b2['query']['offset']);}return _0x4192d5[_0x2c0e('0xdb')](_0x20045c);}})[_0x2c0e('0x1b')](function(_0x40bc32){if(_0x40bc32){return _0x40bc32?{'count':_0x3349dd,'rows':_0x40bc32}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x180286,null))[_0x2c0e('0x4a')](handleError(_0x180286,null));};exports[_0x2c0e('0xdc')]=function(_0x40f745,_0xea2938,_0x3a1d1a){var _0x5cd3b8;var _0x61ead5;var _0x1e01c2;var _0x596b05=!_['isNil'](_0x40f745[_0x2c0e('0x4c')]['id'])?_0x40f745[_0x2c0e('0x4c')]['id']:!_[_0x2c0e('0x5c')](_0x40f745[_0x2c0e('0x21')]['id'])?_0x40f745[_0x2c0e('0x21')]['id']:null;return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x596b05,'role':{'$or':[_0x2c0e('0x1f'),_0x2c0e('0x21'),_0x2c0e('0x23')]}},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0xdd'),'mobile',_0x2c0e('0x1c'),_0x2c0e('0x56'),_0x2c0e('0x93')]})[_0x2c0e('0x1b')](function(_0x794a67){if(_0x794a67){if(_0x794a67[_0x2c0e('0x1c')]===_0x2c0e('0x23')){_0x5cd3b8=_0x794a67;if(_0x40f745[_0x2c0e('0x51')][_0x2c0e('0x95')]){_0x1e01c2=util[_0x2c0e('0xbb')]('LOCAL/%s@from-sip/n',_0x5cd3b8[_0x40f745[_0x2c0e('0x51')][_0x2c0e('0x95')]]);}else if(_0x40f745[_0x2c0e('0x51')][_0x2c0e('0xde')]){_0x1e01c2=util['format'](_0x2c0e('0xdf'),_0x40f745[_0x2c0e('0x51')][_0x2c0e('0xde')]);}else{_0x1e01c2=util[_0x2c0e('0xbb')]('SIP/%s',_0x5cd3b8[_0x2c0e('0x36')]);}socket['to'](util['format'](_0x2c0e('0xe0'),_0x5cd3b8['name']))[_0x2c0e('0x1d')](_0x2c0e('0xe1'),{'user':{'id':_0x5cd3b8['id'],'name':_0x5cd3b8['name']},'ip':_0x40f745[_0x2c0e('0xe2')][_0x2c0e('0xe3')]||_0x40f745[_0x2c0e('0xe4')][_0x2c0e('0xe5')]||_0x40f745[_0x2c0e('0xe6')]['remoteAddress']||_0x40f745['connection']['socket'][_0x2c0e('0xe5')]});return db[_0x2c0e('0x9f')][_0x2c0e('0x2a')]({'where':{'membername':_0x5cd3b8[_0x2c0e('0x36')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x2c0e('0x87'))](_0x2c0e('0xe7'));}})[_0x2c0e('0x1b')](function(){if(_0x5cd3b8){return _0x5cd3b8[_0x2c0e('0xe8')]({'raw':!![]});}})[_0x2c0e('0x1b')](function(_0x251674){if(_0x5cd3b8){if(_0x251674){_0x61ead5=_0x251674;if(_0x61ead5[_0x2c0e('0x41')]){var _0xef791f=_0x61ead5[_0x2c0e('0x2f')](function(_0x33e976){var _0x5be9c8={'membername':_0x5cd3b8['name'],'UserId':_0x5cd3b8['id'],'queue_name':_0x33e976['name'],'VoiceQueueId':_0x33e976['id'],'interface':_0x1e01c2,'paused':_0x5cd3b8[_0x2c0e('0x93')]||![],'penalty':_0x33e976[_0x2c0e('0xe9')]||0x0};return db[_0x2c0e('0x9f')][_0x2c0e('0xa0')](_0x5be9c8);});return Promise[_0x2c0e('0x49')](_0xef791f);}}}})['then'](function(){if(_0x5cd3b8){return db[_0x2c0e('0xea')][_0x2c0e('0x3f')]({'where':{'membername':_0x5cd3b8[_0x2c0e('0x36')],'exitAt':null}});}})[_0x2c0e('0x1b')](function(_0x41a864){if(_0x5cd3b8){var _0x545f55=[];_0x41a864[_0x2c0e('0xeb')](function(_0x2ce9c2){_0x545f55[_0x2c0e('0x42')](_0x2ce9c2[_0x2c0e('0x50')]({'exitAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec'))}));});return Promise[_0x2c0e('0x49')](_0x545f55);}})['then'](function(){if(_0x5cd3b8){var _0x53a63c=[];var _0x3584d0=[];var _0x4fb950=utils['getChannels']();var _0x321ac5={'membername':_0x5cd3b8[_0x2c0e('0x36')],'interface':_0x1e01c2,'enterAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec')),'role':_0x5cd3b8[_0x2c0e('0x1c')],'internal':_0x5cd3b8[_0x2c0e('0x56')]};_0x4fb950[_0x2c0e('0xeb')](function(_0x540954){_0x53a63c['push'](_[_0x2c0e('0x4e')]({'channel':_0x540954,'type':_0x2c0e('0xed'),'data1':_0x40f745[_0x2c0e('0x51')][_0x2c0e('0xee')],'data2':_0x1e01c2},_0x321ac5));if(_0x5cd3b8[_0x2c0e('0x93')]){_0x3584d0['push'](_[_0x2c0e('0x4e')]({'channel':_0x540954,'type':'PAUSE','data1':_0x2c0e('0xef')},_0x321ac5));}});return db['MemberReport'][_0x2c0e('0x7e')](_0x53a63c[_0x2c0e('0xb9')](_0x3584d0),{'individualHooks':!![]});}})['then'](function(){if(_0x5cd3b8){return _0x5cd3b8[_0x2c0e('0x50')]({'online':!![],'lastLoginAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec')),'voicePause':_0x5cd3b8[_0x2c0e('0x93')]||![],'mailPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'chatPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'faxPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'smsPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'openchannelPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'whatsappPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'pauseType':_0x5cd3b8['loginInPause']?_0x2c0e('0xef'):null,'interface':_0x1e01c2,'lastPauseAt':moment()[_0x2c0e('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x2c0e('0x1b')](function(_0x10bdf6){if(_0x40f745[_0x2c0e('0xf0')]){return _0x3a1d1a();}else{return Promise['resolve'](_0x10bdf6)[_0x2c0e('0x1b')](respondWithResult(_0xea2938,null));}})[_0x2c0e('0x4a')](handleError(_0xea2938,null));};exports['logout']=function(_0x3a4049,_0x29c778){var _0x1a8953;return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x3a4049[_0x2c0e('0x4c')]['id'],'role':_0x2c0e('0x23')},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c')]})['then'](handleEntityNotFound(_0x29c778,null))[_0x2c0e('0x1b')](function(_0x18eb19){if(_0x18eb19){_0x1a8953=_0x18eb19;return db[_0x2c0e('0x9f')]['destroy']({'where':{'membername':_0x1a8953[_0x2c0e('0x36')]},'individualHooks':!![]});}})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0xea')][_0x2c0e('0x3f')]({'where':{'membername':_0x1a8953[_0x2c0e('0x36')],'exitAt':null}});})[_0x2c0e('0x1b')](function(_0x5b5659){var _0x213e00=[];_0x5b5659[_0x2c0e('0xeb')](function(_0x1c1312){_0x213e00[_0x2c0e('0x42')](_0x1c1312['update']({'exitAt':moment()[_0x2c0e('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x2c0e('0x49')](_0x213e00);})[_0x2c0e('0x1b')](function(){return _0x1a8953[_0x2c0e('0x50')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2c0e('0x1b')](respondWithResult(_0x29c778,null))[_0x2c0e('0x4a')](handleError(_0x29c778,null));};exports[_0x2c0e('0xf1')]=function(_0x2907b5,_0x4d1efa){var _0x467de2;return db[_0x2c0e('0x9f')]['update']({'paused':0x1},{'where':{'UserId':_0x2907b5[_0x2c0e('0x4c')]['id']},'individualHooks':!![]})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x2d')]['find']({'where':{'id':_0x2907b5[_0x2c0e('0x4c')]['id'],'role':'agent'},'attributes':['id','name',_0x2c0e('0x1c'),_0x2c0e('0x56'),'interface',_0x2c0e('0x92')]});})['then'](handleEntityNotFound(_0x4d1efa,null))[_0x2c0e('0x1b')](function(_0x2a7a8f){if(_0x2a7a8f){_0x467de2=_0x2a7a8f;return db[_0x2c0e('0xea')]['findAll']({'where':{'membername':_0x467de2['name'],'type':'PAUSE','exitAt':null}});}})[_0x2c0e('0x1b')](function(_0x54569b){if(_0x54569b['length']){var _0x53ffb1=moment()[_0x2c0e('0xbb')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4d3b90=0x0,_0x4eea84=_0x54569b[_0x2c0e('0x41')];_0x4d3b90<_0x4eea84;_0x4d3b90++){_0x54569b[_0x4d3b90]['updateAttributes']({'exitAt':_0x53ffb1});}}})[_0x2c0e('0x1b')](function(){var _0x15be18=[];var _0x49c09b=utils[_0x2c0e('0xf2')]();_0x49c09b[_0x2c0e('0xeb')](function(_0x5dd2be){_0x15be18['push']({'channel':_0x5dd2be,'membername':_0x467de2[_0x2c0e('0x36')],'interface':_[_0x2c0e('0x5c')](_0x467de2[_0x2c0e('0x95')])?util['format']('SIP/%s',_0x467de2[_0x2c0e('0x36')]):_0x467de2['interface'],'type':_0x2c0e('0xf3'),'enterAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec')),'data1':_0x2907b5[_0x2c0e('0x51')]['type']||'DEFAULT\x20PAUSE','role':_0x467de2[_0x2c0e('0x1c')],'internal':_0x467de2[_0x2c0e('0x56')]});});return db[_0x2c0e('0xea')][_0x2c0e('0x7e')](_0x15be18,{'individualHooks':!![]});})['then'](function(){return _0x467de2[_0x2c0e('0x50')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2907b5[_0x2c0e('0x51')][_0x2c0e('0xf4')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec'))});})[_0x2c0e('0x1b')](respondWithResult(_0x4d1efa,null))[_0x2c0e('0x4a')](handleError(_0x4d1efa,null));};exports[_0x2c0e('0xf5')]=function(_0x4e2ad1,_0x59f3f9){if(_0x4e2ad1[_0x2c0e('0x51')]['channel']&&!utils[_0x2c0e('0x96')](_0x4e2ad1[_0x2c0e('0x51')]['channel'])){throw new APIBadRequestError(util[_0x2c0e('0xbb')](_0x2c0e('0xf6'),_0x4e2ad1[_0x2c0e('0x51')]['channel']));}return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x4e2ad1[_0x2c0e('0x4c')]['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c'),_0x2c0e('0x56'),_0x2c0e('0x95'),_0x2c0e('0x92'),'voicePause','mailPause',_0x2c0e('0xf7'),_0x2c0e('0xf8'),_0x2c0e('0xf9'),'smsPause','whatsappPause',_0x2c0e('0xfa'),_0x2c0e('0xfb')]})[_0x2c0e('0x1b')](function(_0x372eff){if(!_0x372eff){throw new APINotFoundError(util[_0x2c0e('0xbb')](_0x2c0e('0xbc'),_0x4e2ad1['params']['id']));}return _0x372eff[_0x2c0e('0xf5')](_0x4e2ad1[_0x2c0e('0x51')]['channel']);})[_0x2c0e('0x1b')](respondWithResult(_0x59f3f9,null))[_0x2c0e('0x4a')](APIHandleError(_0x59f3f9));};exports[_0x2c0e('0xfc')]=function(_0x5d455c,_0x54162a){var _0x345f06={};var _0x2ff509={};var _0x2133fb;var _0x1d38a9;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x5d455c[_0x2c0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x54162a,null))[_0x2c0e('0x1b')](function(_0x5bd5e0){if(_0x5bd5e0){_0x2133fb=_0x5bd5e0;_0x2ff509[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0xfd')][_0x2c0e('0x2e')]);_0x2ff509[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x5d455c[_0x2c0e('0x39')]);_0x2ff509[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x2ff509['model'],_0x2ff509[_0x2c0e('0x39')]);_0x345f06[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x2ff509[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x345f06['attributes']=_0x345f06[_0x2c0e('0x3e')]['length']?_0x345f06[_0x2c0e('0x3e')]:_0x2ff509[_0x2c0e('0xc3')];_0x345f06[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x345f06[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x5d455c[_0x2c0e('0x39')],_0x2ff509[_0x2c0e('0xc6')]));if(_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x345f06[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x345f06['where'],{'$or':_[_0x2c0e('0x2f')](_0x345f06[_0x2c0e('0x3e')],function(_0x26f63d){var _0x382083={};_0x382083[_0x26f63d]={'$like':'%'+_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x382083;})});}_0x345f06=_[_0x2c0e('0x4e')]({},_0x345f06,_0x5d455c[_0x2c0e('0xcd')]);return _0x2133fb['getTeams'](_0x345f06);}})[_0x2c0e('0x1b')](function(_0x327864){if(_0x327864){_0x1d38a9=_0x327864[_0x2c0e('0x41')];if(!_0x5d455c[_0x2c0e('0x39')]['hasOwnProperty'](_0x2c0e('0xce'))){_0x345f06[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x345f06[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x5d455c['query'][_0x2c0e('0x16')]);}return _0x2133fb[_0x2c0e('0xfc')](_0x345f06);}})['then'](function(_0x24c949){if(_0x24c949){return _0x24c949?{'count':_0x1d38a9,'rows':_0x24c949}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x54162a,null))[_0x2c0e('0x4a')](handleError(_0x54162a,null));};exports[_0x2c0e('0xfe')]=function(_0x43d2a4,_0x48d1ce){var _0x3ede0d=_0x43d2a4['params']['id'];var _0x1f8bfe=_0x43d2a4[_0x2c0e('0x51')]?_0x43d2a4[_0x2c0e('0x51')]['ids']:null;var _0x4c2082=[];return Promise['resolve']()[_0x2c0e('0x1b')](function(){if(!_0x1f8bfe)throw new APIBadRequestError(_0x2c0e('0xff'));})[_0x2c0e('0x1b')](function(){return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x3ede0d}});})[_0x2c0e('0x1b')](function(_0x426080){if(!_0x426080)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x43d2a4[_0x2c0e('0x4c')]['id']));return db[_0x2c0e('0x100')]['transaction'](function(_0x759f25){return _0x426080['addTeams'](_0x1f8bfe,{'transaction':_0x759f25})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0xfd')][_0x2c0e('0x3f')]({'where':{'id':{'$in':_0x1f8bfe}}});})[_0x2c0e('0x1b')](function(_0x43cd8b){var _0x520e9e=_[_0x2c0e('0x2f')](_0x43cd8b,function(_0x267fd2){return _0x267fd2[_0x2c0e('0x101')]();});return Promise[_0x2c0e('0x49')](_0x520e9e);})['then'](function(_0x59ce88){_0x4c2082=_[_0x2c0e('0x102')](_0x59ce88);var _0x4dfc8c=_[_0x2c0e('0x2f')](_0x4c2082,function(_0x16102d){return _0x16102d['addAgent'](_0x426080['id'],{'transaction':_0x759f25});});return Promise[_0x2c0e('0x49')](_0x4dfc8c);})[_0x2c0e('0x1b')](function(){if(!_0x426080['online'])return;var _0x445ee1=_['filter'](_0x4c2082,function(_0x2aa459){return _0x2aa459[_0x2c0e('0x103')](_0x2c0e('0xa2'))===_0x2c0e('0x104');});var _0x96a3b0=_[_0x2c0e('0x2f')](_0x445ee1,function(_0x5526b4){return db['UserVoiceQueueRt'][_0x2c0e('0xa0')]({'membername':_0x426080[_0x2c0e('0x36')],'UserId':_0x426080['id'],'queue_name':_0x5526b4[_0x2c0e('0x36')],'VoiceQueueId':_0x5526b4['id'],'interface':_[_0x2c0e('0x5c')](_0x426080['interface'])?util[_0x2c0e('0xbb')](_0x2c0e('0xdf'),_0x426080[_0x2c0e('0x36')]):_0x426080[_0x2c0e('0x95')],'paused':_0x426080[_0x2c0e('0x94')]||![],'penalty':_0x426080['penalty']},{'transaction':_0x759f25});});return Promise[_0x2c0e('0x49')](_0x96a3b0);})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x105')][_0x2c0e('0x3f')]({'where':{'teamId':{'$in':_0x1f8bfe}}});})['then'](function(_0x367975){var _0xe2233d=_[_0x2c0e('0x2f')](_0x367975,function(_0x23eceb){return db[_0x2c0e('0x106')][_0x2c0e('0x79')]({'UserId':_0x426080['id'],'VoicePrefixId':_0x23eceb[_0x2c0e('0x107')]},{'transaction':_0x759f25});});return Promise['all'](_0xe2233d);});});})[_0x2c0e('0x1b')](function(){for(var _0xd90961=0x0;_0xd90961<_0x4c2082[_0x2c0e('0x41')];_0xd90961++){var _0x23bb51=_0x4c2082[_0xd90961][_0x2c0e('0x103')]('channel');var _0x4305d6=_0x23bb51+_0x2c0e('0x108');socket[_0x2c0e('0x1d')]('user'+_0x23bb51+_0x2c0e('0x9d'),{'UserId':_0x3ede0d,['queueField']:_0x4c2082[_0xd90961]['id']});}})['then'](respondWithStatusCode(_0x48d1ce,null))['catch'](APIHandleError(_0x48d1ce));};exports[_0x2c0e('0x109')]=function(_0x4da0a7,_0x8658df){var _0x2f8ca3=_0x4da0a7[_0x2c0e('0x4c')]['id'];var _0x23ccb1=null;if(_0x4da0a7['query'][_0x2c0e('0x54')]){_0x23ccb1=_['isArray'](_0x4da0a7[_0x2c0e('0x39')][_0x2c0e('0x54')])?_0x4da0a7['query']['ids']:[_0x4da0a7[_0x2c0e('0x39')]['ids']];}var _0x205558=[];return Promise[_0x2c0e('0x10a')]()[_0x2c0e('0x1b')](function(){if(!_0x23ccb1)throw new APIBadRequestError(_0x2c0e('0x10b'));})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x2f8ca3}});})[_0x2c0e('0x1b')](function(_0x3f288a){if(!_0x3f288a)throw new APINotFoundError(util['format'](_0x2c0e('0xbc'),_0x4da0a7['params']['id']));return db[_0x2c0e('0x100')][_0x2c0e('0x10c')](function(_0x185246){return _0x3f288a['removeTeams'](_0x23ccb1,{'transaction':_0x185246})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0xfd')][_0x2c0e('0x3f')]({'where':{'id':{'$in':_0x23ccb1}}});})[_0x2c0e('0x1b')](function(_0x56e937){var _0x1ba57a=_['map'](_0x56e937,function(_0x32e774){return _0x32e774[_0x2c0e('0x101')]();});return Promise[_0x2c0e('0x49')](_0x1ba57a);})[_0x2c0e('0x1b')](function(_0x89e705){_0x205558=_[_0x2c0e('0x102')](_0x89e705);var _0xb093be=_[_0x2c0e('0x2f')](_0x205558,function(_0x27d1f7){return _0x27d1f7[_0x2c0e('0x10d')](_0x3f288a['id'],{'transaction':_0x185246});});return Promise[_0x2c0e('0x49')](_0xb093be);})['then'](function(){if(!_0x3f288a[_0x2c0e('0x92')])return;var _0x546b12=_[_0x2c0e('0xcc')](_0x205558,function(_0x54b447){return _0x54b447[_0x2c0e('0x103')](_0x2c0e('0xa2'))===_0x2c0e('0x104');});var _0x438f95=_[_0x2c0e('0x2f')](_0x546b12,function(_0x533f94){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x533f94['id'],'UserId':_0x3f288a['id']},'transaction':_0x185246});});return Promise[_0x2c0e('0x49')](_0x438f95);})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x105')]['findAll']({'where':{'teamId':{'$in':_0x23ccb1}}});})['then'](function(_0x220b1c){var _0x58528c=_[_0x2c0e('0x2f')](_0x220b1c,function(_0x56ddb7){return db[_0x2c0e('0x106')]['destroy']({'where':{'UserId':_0x3f288a['id'],'VoicePrefixId':_0x56ddb7['VoicePrefixId']}},{'transaction':_0x185246});});return Promise[_0x2c0e('0x49')](_0x58528c);});});})[_0x2c0e('0x1b')](function(){for(var _0x54489e=0x0;_0x54489e<_0x205558['length'];_0x54489e++){var _0x2149c3=_0x205558[_0x54489e][_0x2c0e('0x103')](_0x2c0e('0xa2'));var _0x5ebefe=_0x2149c3+_0x2c0e('0x108');socket[_0x2c0e('0x1d')](_0x2c0e('0x21')+_0x2149c3+'Queue:remove',{'UserId':_0x2f8ca3,['queueField']:_0x205558[_0x54489e]['id']});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x8658df,null))[_0x2c0e('0x4a')](APIHandleError(_0x8658df));};exports[_0x2c0e('0x10e')]=function(_0x3991df,_0xb697d7){var _0x66d1ee={};var _0xf90fba={};var _0x5a857f;var _0x33378c;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x3991df['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0xb697d7,null))['then'](function(_0x1384d7){if(_0x1384d7){_0x5a857f=_0x1384d7;_0xf90fba[_0x2c0e('0xc3')]=_['keys'](db[_0x2c0e('0xbe')][_0x2c0e('0x2e')]);_0xf90fba[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x3991df['query']);_0xf90fba[_0x2c0e('0xc6')]=_['intersection'](_0xf90fba[_0x2c0e('0xc3')],_0xf90fba['query']);_0x66d1ee['attributes']=_[_0x2c0e('0xc7')](_0xf90fba['model'],qs['fields'](_0x3991df[_0x2c0e('0x39')]['fields']));_0x66d1ee[_0x2c0e('0x3e')]=_0x66d1ee['attributes'][_0x2c0e('0x41')]?_0x66d1ee[_0x2c0e('0x3e')]:_0xf90fba[_0x2c0e('0xc3')];_0x66d1ee[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x3991df['query'][_0x2c0e('0xca')]);_0x66d1ee[_0x2c0e('0x38')]=qs['filters'](_['pick'](_0x3991df[_0x2c0e('0x39')],_0xf90fba[_0x2c0e('0xc6')]));if(_0x3991df['query']['filter']){_0x66d1ee[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x66d1ee[_0x2c0e('0x38')],{'$or':_['map'](_0x66d1ee[_0x2c0e('0x3e')],function(_0xc26fb1){var _0x24cb49={};_0x24cb49[_0xc26fb1]={'$like':'%'+_0x3991df[_0x2c0e('0x39')]['filter']+'%'};return _0x24cb49;})});}_0x66d1ee=_[_0x2c0e('0x4e')]({},_0x66d1ee,_0x3991df['options']);return _0x5a857f['getLists'](_0x66d1ee);}})[_0x2c0e('0x1b')](function(_0x5c89f3){if(_0x5c89f3){_0x33378c=_0x5c89f3['length'];if(!_0x3991df[_0x2c0e('0x39')]['hasOwnProperty']('nolimit')){_0x66d1ee[_0x2c0e('0xcf')]=qs['limit'](_0x3991df[_0x2c0e('0x39')]['limit']);_0x66d1ee[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x3991df[_0x2c0e('0x39')]['offset']);}return _0x5a857f[_0x2c0e('0x10e')](_0x66d1ee);}})[_0x2c0e('0x1b')](function(_0x51ca8e){if(_0x51ca8e){return _0x51ca8e?{'count':_0x33378c,'rows':_0x51ca8e}:null;}})['then'](respondWithResult(_0xb697d7,null))['catch'](handleError(_0xb697d7,null));};exports['getAgents']=function(_0x36ca94,_0x5ea195){var _0x5f5148={};var _0x5e52ad={};var _0x31f3bd;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x36ca94['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x5ea195,null))['then'](function(_0x196013){if(_0x196013){_0x31f3bd=_0x196013;_0x5e52ad['model']=_[_0x2c0e('0xc4')](db[_0x2c0e('0x2d')][_0x2c0e('0x2e')]);_0x5e52ad[_0x2c0e('0x39')]=_['keys'](_0x36ca94['query']);_0x5e52ad['filters']=_['intersection'](_0x5e52ad[_0x2c0e('0xc3')],_0x5e52ad['query']);_0x5f5148[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5e52ad['model'],qs[_0x2c0e('0xc8')](_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x5f5148[_0x2c0e('0x3e')]=_0x5f5148['attributes'][_0x2c0e('0x41')]?_0x5f5148['attributes']:_0x5e52ad[_0x2c0e('0xc3')];_0x5f5148[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x36ca94[_0x2c0e('0x39')]['sort']);_0x5f5148[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x36ca94['query'],_0x5e52ad[_0x2c0e('0xc6')]));if(_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x5f5148[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x5f5148[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x5f5148[_0x2c0e('0x3e')],function(_0x41112f){var _0x40631e={};_0x40631e[_0x41112f]={'$like':'%'+_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x40631e;})});}_0x5f5148[_0x2c0e('0xc3')]=db['User'];_0x5f5148['as']=_0x2c0e('0x22');_0x5f5148=_[_0x2c0e('0x4e')]({},_0x5f5148,_0x36ca94[_0x2c0e('0xcd')]);return _0x31f3bd[_0x2c0e('0xe8')]({'include':[_0x5f5148]});}})[_0x2c0e('0x1b')](function(_0x463df){if(_0x463df){var _0x4ba87f={},_0x3faaca=[];for(var _0x50b568=0x0;_0x50b568<_0x463df[_0x2c0e('0x41')];_0x50b568+=0x1){for(var _0x2e4951=0x0,_0x2d021b;_0x2e4951<_0x463df[_0x50b568][_0x2c0e('0x22')][_0x2c0e('0x41')];_0x2e4951+=0x1){_0x2d021b=_0x463df[_0x50b568][_0x2c0e('0x22')][_0x2e4951][_0x2c0e('0x1e')]({'plain':!![]});_0x4ba87f[_0x2d021b['id']]=_0x2d021b;}}_0x4ba87f=_[_0x2c0e('0x10f')](_0x4ba87f);for(var _0x3030ff=qs[_0x2c0e('0x16')](_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0x16')]);_0x3030ff<_0x4ba87f['length']&&_0x3faaca[_0x2c0e('0x41')]=_0x4ffe4c[_0x770c('0x47')]){throw new Error(_0x770c('0x48'));}})['then'](function(){if(_0x3924c3){return db[_0x770c('0x24')]['destroy']({'where':{'membername':_0x3924c3[_0x770c('0x27')]},'individualHooks':!![]});}})[_0x770c('0x15')](function(){if(_0x3924c3){return _0x3924c3[_0x770c('0x49')]({'raw':!![]});}})[_0x770c('0x15')](function(_0x6531eb){if(_0x3924c3){if(_0x6531eb){var _0x2785ca=[];_0xc1fe86=_0x6531eb;if(_0xc1fe86['length']){for(var _0xcf9f77=0x0;_0xcf9f77<_0xc1fe86[_0x770c('0x28')];_0xcf9f77++){_0x2785ca['push'](db[_0x770c('0x24')][_0x770c('0x4a')]({'membername':_0x3924c3[_0x770c('0x27')],'UserId':_0x3924c3['id'],'queue_name':_0xc1fe86[_0xcf9f77]['name'],'VoiceQueueId':_0xc1fe86[_0xcf9f77]['id'],'interface':_0x6a78b9,'paused':_0x3924c3['loginInPause']||![],'penalty':_0xc1fe86[_0xcf9f77][_0x770c('0x4b')]||0x0}));}return BPromise[_0x770c('0x4c')](_0x2785ca);}}}})['then'](function(){if(_0x3924c3){return db[_0x770c('0x26')][_0x770c('0xe')]({'where':{'membername':_0x3924c3['name'],'exitAt':null}});}})['then'](function(_0x326d3c){if(_0x3924c3){if(_0x326d3c&&_0x326d3c[_0x770c('0x28')]){var _0x192d61=[];_0x326d3c['forEach'](function(_0x288ef5){_0x192d61[_0x770c('0x2b')](_0x288ef5['update']({'exitAt':moment()['format'](_0x770c('0x2f'))}));});return BPromise[_0x770c('0x4c')](_0x192d61);}}})[_0x770c('0x15')](function(){if(_0x3924c3){var _0x168bf5=[];var _0xd8274=[];var _0x2b6b5a=utils[_0x770c('0x29')]();var _0x493601={'membername':_0x3924c3['name'],'interface':_0x6a78b9,'enterAt':moment()[_0x770c('0x21')](_0x770c('0x2f')),'role':_0x3924c3[_0x770c('0x1f')],'internal':_0x3924c3[_0x770c('0x38')]};_0x2b6b5a['forEach'](function(_0xb04832){_0x168bf5[_0x770c('0x2b')](_[_0x770c('0x4d')]({'channel':_0xb04832,'type':_0x770c('0x4e'),'data1':_0x770c('0x4f'),'data2':_0x6a78b9},_0x493601));if(_0x3924c3[_0x770c('0x43')]){_0xd8274[_0x770c('0x2b')](_[_0x770c('0x4d')]({'channel':_0xb04832,'type':'PAUSE','data1':_0x770c('0x50')},_0x493601));}});return db['MemberReport'][_0x770c('0x32')](_0x168bf5[_0x770c('0x51')](_0xd8274),{'individualHooks':!![]});}})[_0x770c('0x15')](function(){if(_0x3924c3){return _0x3924c3['update']({'online':!![],'lastLoginAt':moment()[_0x770c('0x21')](_0x770c('0x2f')),'voicePause':_0x3924c3[_0x770c('0x43')]||![],'mailPause':_0x3924c3[_0x770c('0x43')]||![],'chatPause':_0x3924c3[_0x770c('0x43')]||![],'faxPause':_0x3924c3['loginInPause']||![],'smsPause':_0x3924c3[_0x770c('0x43')]||![],'openchannelPause':_0x3924c3['loginInPause']||![],'pauseType':_0x3924c3[_0x770c('0x43')]?_0x770c('0x50'):null,'lastPauseAt':moment()[_0x770c('0x21')](_0x770c('0x2f')),'interface':_0x6a78b9});}})[_0x770c('0x15')](function(_0x2dcfee){_0x45422e(_0x2dcfee);})[_0x770c('0x1e')](function(_0x24daf){_0xb82901(_0x37ee93[_0x770c('0x18')](0x1f4,_0x24daf['message']));});});}; \ No newline at end of file +var _0x5989=['findAll','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','system','LogoutUser','findOne','all','mobile','phone','loginInPause','../../config/license/util','getLicense','agents','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','socket.io-emitter','GetUser','User','raw','options','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowUser','find','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport'];(function(_0x30f8cb,_0x13648b){var _0x2f6f50=function(_0x1e794f){while(--_0x1e794f){_0x30f8cb['push'](_0x30f8cb['shift']());}};_0x2f6f50(++_0x13648b);}(_0x5989,0x7b));var _0x9598=function(_0x2a7e10,_0x190fd2){_0x2a7e10=_0x2a7e10-0x0;var _0x213fdf=_0x5989[_0x2a7e10];return _0x213fdf;};'use strict';var _=require(_0x9598('0x0'));var util=require(_0x9598('0x1'));var moment=require('moment');var BPromise=require(_0x9598('0x2'));var Redis=require(_0x9598('0x3'));var db=require(_0x9598('0x4'))['db'];var utils=require(_0x9598('0x5'));var logger=require(_0x9598('0x6'))(_0x9598('0x7'));var config=require('../../config/environment');config[_0x9598('0x8')]=_[_0x9598('0x9')](config[_0x9598('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9598('0xa'))(new Redis(config['redis']));require('./user.socket')['register'](socket);exports[_0x9598('0xb')]=function(_0x137ae8){var _0x191502=this;return new Promise(function(_0x44fdaa,_0x35a74b){return db[_0x9598('0xc')]['findAll']({'raw':_0x137ae8['options']?_0x137ae8['options'][_0x9598('0xd')]===undefined?!![]:![]:!![],'where':_0x137ae8['options']?_0x137ae8[_0x9598('0xe')][_0x9598('0xf')]||null:null,'attributes':_0x137ae8[_0x9598('0xe')]?_0x137ae8['options'][_0x9598('0x10')]||null:null,'limit':_0x137ae8[_0x9598('0xe')]?_0x137ae8[_0x9598('0xe')][_0x9598('0x11')]||null:null,'include':_0x137ae8['options']?_0x137ae8['options'][_0x9598('0x12')]?_[_0x9598('0x13')](_0x137ae8[_0x9598('0xe')][_0x9598('0x12')],function(_0x5ee7b0){return{'model':db[_0x5ee7b0[_0x9598('0x14')]],'as':_0x5ee7b0['as'],'attributes':_0x5ee7b0[_0x9598('0x10')],'include':_0x5ee7b0[_0x9598('0x12')]?_[_0x9598('0x13')](_0x5ee7b0['include'],function(_0xa99ae2){return{'model':db[_0xa99ae2[_0x9598('0x14')]],'as':_0xa99ae2['as'],'attributes':_0xa99ae2[_0x9598('0x10')],'include':_0xa99ae2[_0x9598('0x12')]?_[_0x9598('0x13')](_0xa99ae2['include'],function(_0x5125c1){return{'model':db[_0x5125c1['model']],'as':_0x5125c1['as'],'attributes':_0x5125c1[_0x9598('0x10')]};}):[]};}):[]};}):[]:[]})[_0x9598('0x15')](function(_0x368630){logger[_0x9598('0x16')](_0x9598('0xb'),_0x137ae8);logger[_0x9598('0x17')]('GetUser',_0x137ae8,JSON[_0x9598('0x18')](_0x368630));_0x44fdaa(_0x368630);})[_0x9598('0x19')](function(_0x19f8c7){logger[_0x9598('0x1a')](_0x9598('0xb'),_0x19f8c7[_0x9598('0x1b')],_0x137ae8);_0x35a74b(_0x191502['error'](0x1f4,_0x19f8c7[_0x9598('0x1b')]));});});};exports[_0x9598('0x1c')]=function(_0x34c22e){var _0x41de8b=this;return new Promise(function(_0x1e21b2,_0x43c141){return db[_0x9598('0xc')][_0x9598('0x1d')]({'raw':_0x34c22e['options']?_0x34c22e[_0x9598('0xe')][_0x9598('0xd')]===undefined?!![]:![]:!![],'where':_0x34c22e[_0x9598('0xe')]?_0x34c22e[_0x9598('0xe')][_0x9598('0xf')]||null:null,'attributes':_0x34c22e['options']?_0x34c22e[_0x9598('0xe')][_0x9598('0x10')]||null:null,'include':_0x34c22e[_0x9598('0xe')]?_0x34c22e['options'][_0x9598('0x12')]?_[_0x9598('0x13')](_0x34c22e[_0x9598('0xe')][_0x9598('0x12')],function(_0x167173){return{'model':db[_0x167173[_0x9598('0x14')]],'as':_0x167173['as'],'attributes':_0x167173[_0x9598('0x10')],'include':_0x167173[_0x9598('0x12')]?_[_0x9598('0x13')](_0x167173[_0x9598('0x12')],function(_0x168689){return{'model':db[_0x168689[_0x9598('0x14')]],'as':_0x168689['as'],'attributes':_0x168689['attributes'],'include':_0x168689[_0x9598('0x12')]?_['map'](_0x168689['include'],function(_0x3d2a43){return{'model':db[_0x3d2a43[_0x9598('0x14')]],'as':_0x3d2a43['as'],'attributes':_0x3d2a43[_0x9598('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cd645){logger[_0x9598('0x16')](_0x9598('0x1c'),_0x34c22e);logger[_0x9598('0x17')](_0x9598('0x1c'),_0x34c22e,JSON[_0x9598('0x18')](_0x2cd645));_0x1e21b2(_0x2cd645);})['catch'](function(_0x179816){logger['error'](_0x9598('0x1c'),_0x179816[_0x9598('0x1b')],_0x34c22e);_0x43c141(_0x41de8b[_0x9598('0x1a')](0x1f4,_0x179816[_0x9598('0x1b')]));});});};exports[_0x9598('0x1e')]=function(_0x2a264f){var _0x6265b;return db[_0x9598('0xc')][_0x9598('0x1d')]({'where':_0x2a264f['options'][_0x9598('0xf')]||{},'attributes':['id',_0x9598('0x1f'),_0x9598('0x20'),_0x9598('0x21'),_0x9598('0x22')]})['then'](function(_0x3e5fdb){if(!_0x3e5fdb){throw new Error(util[_0x9598('0x23')](_0x9598('0x24'),_0x2a264f[_0x9598('0x25')]['id']));}_0x6265b=_0x3e5fdb;return db[_0x9598('0x26')][_0x9598('0x27')]({'paused':0x1},{'where':{'UserId':_0x6265b['id']},'individualHooks':!![]});})[_0x9598('0x15')](function(){return db[_0x9598('0x28')][_0x9598('0x29')]({'where':{'membername':_0x6265b[_0x9598('0x1f')],'type':_0x9598('0x2a'),'exitAt':null}});})[_0x9598('0x15')](function(_0xdc1bb0){if(_0xdc1bb0&&_0xdc1bb0[_0x9598('0x2b')]){var _0x596f24=moment()['format'](_0x9598('0x2c'));for(var _0x36fd3f=0x0,_0x3c9360=_0xdc1bb0[_0x9598('0x2b')];_0x36fd3f<_0x3c9360;_0x36fd3f++){_0xdc1bb0[_0x36fd3f][_0x9598('0x2d')]({'exitAt':_0x596f24});}}})['then'](function(){var _0x3b939a=[];var _0x2b3a52=utils[_0x9598('0x2e')]();_0x2b3a52[_0x9598('0x2f')](function(_0x2feb84){_0x3b939a[_0x9598('0x30')]({'channel':_0x2feb84,'membername':_0x6265b[_0x9598('0x1f')],'interface':_[_0x9598('0x31')](_0x6265b[_0x9598('0x22')])?util[_0x9598('0x23')](_0x9598('0x32'),_0x6265b['name']):_0x6265b[_0x9598('0x22')],'type':_0x9598('0x2a'),'enterAt':moment()[_0x9598('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2a264f[_0x9598('0x33')][_0x9598('0x34')]||_0x9598('0x35'),'role':_0x6265b['role'],'internal':_0x6265b[_0x9598('0x21')],'uniqueid':_0x2a264f['body'][_0x9598('0x36')]||null});});return db[_0x9598('0x28')][_0x9598('0x37')](_0x3b939a,{'individualHooks':!![]});})['then'](function(){return _0x6265b[_0x9598('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2a264f[_0x9598('0x33')][_0x9598('0x34')]||_0x9598('0x35'),'lastPauseAt':moment()['format'](_0x9598('0x2c'))});})[_0x9598('0x19')](function(_0x2fbed1){throw _0x2fbed1;});};exports[_0x9598('0x38')]=function(_0x4aee33){return Promise[_0x9598('0x39')]()['then'](function(){if(_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')]&&!utils['isValidChannel'](_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')])){throw new Error(util[_0x9598('0x23')](_0x9598('0x3b'),_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')]));}return db[_0x9598('0xc')]['findOne']({'where':_0x4aee33[_0x9598('0xe')][_0x9598('0xf')]||{},'attributes':['id',_0x9598('0x1f'),_0x9598('0x20'),'internal',_0x9598('0x22'),_0x9598('0x3c'),_0x9598('0x3d'),_0x9598('0x3e'),'chatPause','faxPause',_0x9598('0x3f'),'smsPause',_0x9598('0x40'),_0x9598('0x41'),_0x9598('0x42')]});})[_0x9598('0x15')](function(_0x6e76ad){if(!_0x6e76ad){throw new Error(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x4aee33[_0x9598('0x25')]['id']));}return _0x6e76ad['unpause'](_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')],_0x9598('0x43'));})[_0x9598('0x19')](function(_0x4c1f81){throw _0x4c1f81;});};exports[_0x9598('0x44')]=function(_0x4420a6){var _0x3fa235=this;return new Promise(function(_0x49a9ec,_0x49d3c7){var _0x37d10a;return db[_0x9598('0xc')][_0x9598('0x45')]({'where':_0x4420a6[_0x9598('0xe')][_0x9598('0xf')]||{},'attributes':['id','name']})[_0x9598('0x15')](function(_0xd9b551){if(_0xd9b551){_0x37d10a=_0xd9b551;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x37d10a['name']},'individualHooks':!![]});}})[_0x9598('0x15')](function(){if(_0x37d10a){return db[_0x9598('0x28')][_0x9598('0x29')]({'where':{'membername':_0x37d10a[_0x9598('0x1f')],'exitAt':null}});}})['then'](function(_0x5432a8){if(_0x37d10a){if(_0x5432a8&&_0x5432a8['length']){var _0x5bb087=[];_0x5432a8['forEach'](function(_0x450c5a){_0x5bb087[_0x9598('0x30')](_0x450c5a[_0x9598('0x27')]({'exitAt':moment()[_0x9598('0x23')](_0x9598('0x2c'))}));});return BPromise[_0x9598('0x46')](_0x5bb087);}}})[_0x9598('0x15')](function(){if(_0x37d10a){return _0x37d10a[_0x9598('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9598('0x15')](function(_0x5b53e9){_0x49a9ec(_0x5b53e9);})[_0x9598('0x19')](function(_0x302b55){_0x49d3c7(_0x3fa235[_0x9598('0x1a')](0x1f4,_0x302b55['message']));});});};exports['LoginUser']=function(_0x311dc9){var _0xfd4f5a=this;return new Promise(function(_0x44a6ea,_0x4780af){var _0x1de1ac;var _0x29d92f;var _0x280149;var _0xf05d20;return db['User'][_0x9598('0x45')]({'where':_0x311dc9[_0x9598('0xe')][_0x9598('0xf')]||{},'attributes':['id','name',_0x9598('0x20'),_0x9598('0x47'),_0x9598('0x48'),_0x9598('0x21'),_0x9598('0x49'),_0x9598('0x22')]})[_0x9598('0x15')](function(_0xba5193){if(_0xba5193){_0x1de1ac=_0xba5193;_0xf05d20=_0x311dc9[_0x9598('0x33')][_0x9598('0x22')]?_0x311dc9[_0x9598('0x33')][_0x9598('0x22')]:util[_0x9598('0x23')]('SIP/%s',_0x1de1ac[_0x9598('0x1f')]);return db[_0x9598('0xc')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1de1ac['id']}}});}})['then'](function(_0x2623d8){if(_0x2623d8){_0x280149=_0x2623d8;return require(_0x9598('0x4a'))[_0x9598('0x4b')]();}})[_0x9598('0x15')](function(_0xd80508){if(_0xd80508&&_0xd80508[_0x9598('0x4c')]&&_0x280149>=_0xd80508[_0x9598('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x9598('0x15')](function(){if(_0x1de1ac){return db[_0x9598('0x26')]['destroy']({'where':{'membername':_0x1de1ac[_0x9598('0x1f')]},'individualHooks':!![]});}})[_0x9598('0x15')](function(){if(_0x1de1ac){return _0x1de1ac[_0x9598('0x4d')]({'raw':!![]});}})[_0x9598('0x15')](function(_0x35723e){if(_0x1de1ac){if(_0x35723e){var _0xcc292d=[];_0x29d92f=_0x35723e;if(_0x29d92f[_0x9598('0x2b')]){for(var _0x14602a=0x0;_0x14602a<_0x29d92f[_0x9598('0x2b')];_0x14602a++){_0xcc292d['push'](db[_0x9598('0x26')]['upsert']({'membername':_0x1de1ac[_0x9598('0x1f')],'UserId':_0x1de1ac['id'],'queue_name':_0x29d92f[_0x14602a]['name'],'VoiceQueueId':_0x29d92f[_0x14602a]['id'],'interface':_0xf05d20,'paused':_0x1de1ac['loginInPause']||![],'penalty':_0x29d92f[_0x14602a][_0x9598('0x4e')]||0x0}));}return BPromise[_0x9598('0x46')](_0xcc292d);}}}})[_0x9598('0x15')](function(){if(_0x1de1ac){return db[_0x9598('0x28')][_0x9598('0x29')]({'where':{'membername':_0x1de1ac[_0x9598('0x1f')],'exitAt':null}});}})[_0x9598('0x15')](function(_0x3d4900){if(_0x1de1ac){if(_0x3d4900&&_0x3d4900[_0x9598('0x2b')]){var _0x5964c8=[];_0x3d4900['forEach'](function(_0x4fea32){_0x5964c8[_0x9598('0x30')](_0x4fea32[_0x9598('0x27')]({'exitAt':moment()['format'](_0x9598('0x2c'))}));});return BPromise['all'](_0x5964c8);}}})[_0x9598('0x15')](function(){if(_0x1de1ac){var _0x30ee6f=[];var _0x362022=[];var _0x47d19f=utils['getChannels']();var _0x490b83={'membername':_0x1de1ac['name'],'interface':_0xf05d20,'enterAt':moment()[_0x9598('0x23')](_0x9598('0x2c')),'role':_0x1de1ac['role'],'internal':_0x1de1ac[_0x9598('0x21')]};_0x47d19f[_0x9598('0x2f')](function(_0x2bd86d){_0x30ee6f[_0x9598('0x30')](_[_0x9598('0x4f')]({'channel':_0x2bd86d,'type':_0x9598('0x50'),'data1':_0x9598('0x51'),'data2':_0xf05d20},_0x490b83));if(_0x1de1ac['loginInPause']){_0x362022[_0x9598('0x30')](_['merge']({'channel':_0x2bd86d,'type':_0x9598('0x2a'),'data1':'LOGININPAUSE'},_0x490b83));}});return db[_0x9598('0x28')][_0x9598('0x37')](_0x30ee6f['concat'](_0x362022),{'individualHooks':!![]});}})[_0x9598('0x15')](function(){if(_0x1de1ac){return _0x1de1ac[_0x9598('0x27')]({'online':!![],'lastLoginAt':moment()[_0x9598('0x23')](_0x9598('0x2c')),'voicePause':_0x1de1ac[_0x9598('0x49')]||![],'mailPause':_0x1de1ac[_0x9598('0x49')]||![],'chatPause':_0x1de1ac['loginInPause']||![],'faxPause':_0x1de1ac[_0x9598('0x49')]||![],'smsPause':_0x1de1ac[_0x9598('0x49')]||![],'openchannelPause':_0x1de1ac[_0x9598('0x49')]||![],'pauseType':_0x1de1ac[_0x9598('0x49')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x9598('0x23')](_0x9598('0x2c')),'interface':_0xf05d20});}})[_0x9598('0x15')](function(_0x2398c8){_0x44a6ea(_0x2398c8);})[_0x9598('0x19')](function(_0xb46b2f){_0x4780af(_0xfd4f5a[_0x9598('0x1a')](0x1f4,_0xb46b2f[_0x9598('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index afbffc9..e85083b 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 _0xacae=['./user.events','save','remove','emit','register','length'];(function(_0x171f0d,_0x3fc8eb){var _0xd45eb5=function(_0x4891e9){while(--_0x4891e9){_0x171f0d['push'](_0x171f0d['shift']());}};_0xd45eb5(++_0x3fc8eb);}(_0xacae,0x1a4));var _0xeaca=function(_0x21c8cf,_0x93644c){_0x21c8cf=_0x21c8cf-0x0;var _0x29ba94=_0xacae[_0x21c8cf];return _0x29ba94;};'use strict';var UserEvents=require(_0xeaca('0x0'));var events=[_0xeaca('0x1'),_0xeaca('0x2'),'update'];function createListener(_0x356968,_0x4e6713){return function(_0x580da4){_0x4e6713[_0xeaca('0x3')](_0x356968,_0x580da4);};}function removeListener(_0x5b5a86,_0x30dd7e){return function(){UserEvents['removeListener'](_0x5b5a86,_0x30dd7e);};}exports[_0xeaca('0x4')]=function(_0x57347a){for(var _0x2998de=0x0,_0x1cd329=events[_0xeaca('0x5')];_0x2998de<_0x1cd329;_0x2998de++){var _0x5110bf=events[_0x2998de];var _0x31ba48=createListener('user:'+_0x5110bf,_0x57347a);UserEvents['on'](_0x5110bf,_0x31ba48);}}; \ No newline at end of file +var _0x61ac=['length','./user.events','remove','update','emit','register'];(function(_0x2f8fe8,_0x45e040){var _0x572e2e=function(_0x3631ae){while(--_0x3631ae){_0x2f8fe8['push'](_0x2f8fe8['shift']());}};_0x572e2e(++_0x45e040);}(_0x61ac,0x13f));var _0xc61a=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0x61ac[_0x1bc762];return _0x40f70c;};'use strict';var UserEvents=require(_0xc61a('0x0'));var events=['save',_0xc61a('0x1'),_0xc61a('0x2')];function createListener(_0xa9d05e,_0x4f10e5){return function(_0x58f722){_0x4f10e5[_0xc61a('0x3')](_0xa9d05e,_0x58f722);};}function removeListener(_0x38799f,_0x3ff5fa){return function(){UserEvents['removeListener'](_0x38799f,_0x3ff5fa);};}exports[_0xc61a('0x4')]=function(_0x48e48e){for(var _0x58ae7e=0x0,_0x4ba0b4=events[_0xc61a('0x5')];_0x58ae7e<_0x4ba0b4;_0x58ae7e++){var _0x3e3c66=events[_0x58ae7e];var _0x46fb0d=createListener('user:'+_0x3e3c66,_0x48e48e);UserEvents['on'](_0x3e3c66,_0x46fb0d);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 79e9b71..999b803 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xb49b00,_0x7dc944){var _0x1a1820=function(_0x3aeb37){while(--_0x3aeb37){_0xb49b00['push'](_0xb49b00['shift']());}};_0x1a1820(++_0x7dc944);}(_0xe706,0xa3));var _0x6e70=function(_0x1c9108,_0x26f835){_0x1c9108=_0x1c9108-0x0;var _0x1ee828=_0xe706[_0x1c9108];return _0x1ee828;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x353a35,_0x19579e){var _0x2cec7d=function(_0x4c950e){while(--_0x4c950e){_0x353a35['push'](_0x353a35['shift']());}};_0x2cec7d(++_0x19579e);}(_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 fe95375..d56e3d3 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 _0xff76=['INTEGER','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xff76,0x125));var _0x6ff7=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xff76[_0x1eda20];return _0x31b953;};'use strict';var Sequelize=require('sequelize');module[_0x6ff7('0x0')]={'penalty':{'type':Sequelize[_0x6ff7('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0162=['INTEGER','sequelize','exports'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x0162,0x184));var _0x2016=function(_0x4c01a1,_0x1b1c2d){_0x4c01a1=_0x4c01a1-0x0;var _0x40ca1b=_0x0162[_0x4c01a1];return _0x40ca1b;};'use strict';var Sequelize=require(_0x2016('0x0'));module[_0x2016('0x1')]={'penalty':{'type':Sequelize[_0x2016('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 8be4c0a..1724d80 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 _0xa272=['UserChatQueue','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','define'];(function(_0x1cfd57,_0x43210c){var _0x3f83bf=function(_0x247021){while(--_0x247021){_0x1cfd57['push'](_0x1cfd57['shift']());}};_0x3f83bf(++_0x43210c);}(_0xa272,0xb5));var _0x2a27=function(_0x597351,_0x5aed9f){_0x597351=_0x597351-0x0;var _0x410cd7=_0xa272[_0x597351];return _0x410cd7;};'use strict';var _=require('lodash');var util=require(_0x2a27('0x0'));var logger=require(_0x2a27('0x1'))(_0x2a27('0x2'));var moment=require('moment');var BPromise=require(_0x2a27('0x3'));var rp=require(_0x2a27('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a27('0x5'));var config=require(_0x2a27('0x6'));var attributes=require(_0x2a27('0x7'));module['exports']=function(_0x7d33a2,_0x7fa5a2){return _0x7d33a2[_0x2a27('0x8')](_0x2a27('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x907a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x3e4f60,_0x17820f){var _0x1df1a3=function(_0x513121){while(--_0x513121){_0x3e4f60['push'](_0x3e4f60['shift']());}};_0x1df1a3(++_0x17820f);}(_0x907a,0xb6));var _0xa907=function(_0x40eab3,_0x189042){_0x40eab3=_0x40eab3-0x0;var _0x2e61a1=_0x907a[_0x40eab3];return _0x2e61a1;};'use strict';var _=require('lodash');var util=require(_0xa907('0x0'));var logger=require(_0xa907('0x1'))(_0xa907('0x2'));var moment=require('moment');var BPromise=require(_0xa907('0x3'));var rp=require(_0xa907('0x4'));var fs=require('fs');var path=require(_0xa907('0x5'));var rimraf=require(_0xa907('0x6'));var config=require(_0xa907('0x7'));var attributes=require(_0xa907('0x8'));module[_0xa907('0x9')]=function(_0x49ff13,_0x5a0778){return _0x49ff13[_0xa907('0xa')](_0xa907('0xb'),attributes,{'tableName':_0xa907('0xc'),'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 3fd10b7..555b02d 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 _0x2b27=['../../config/utils','../../config/logger','rpc','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4ab53a,_0x2c65d3){var _0x211edb=function(_0x2f7a89){while(--_0x2f7a89){_0x4ab53a['push'](_0x4ab53a['shift']());}};_0x211edb(++_0x2c65d3);}(_0x2b27,0x1e8));var _0x72b2=function(_0x2715cf,_0x517bb2){_0x2715cf=_0x2715cf-0x0;var _0x1bdcb8=_0x2b27[_0x2715cf];return _0x1bdcb8;};'use strict';var _=require(_0x72b2('0x0'));var util=require(_0x72b2('0x1'));var moment=require(_0x72b2('0x2'));var BPromise=require(_0x72b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72b2('0x4'));var db=require(_0x72b2('0x5'))['db'];var utils=require(_0x72b2('0x6'));var logger=require(_0x72b2('0x7'))(_0x72b2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x72b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28eb07,_0x2e0dc9,_0x14ad65){return new BPromise(function(_0x348409,_0x39ff3d){return client['request'](_0x28eb07,_0x14ad65)[_0x72b2('0xa')](function(_0xd44a63){logger[_0x72b2('0xb')](_0x72b2('0xc'),_0x2e0dc9,_0x72b2('0xd'));logger[_0x72b2('0xe')](_0x72b2('0xf'),_0x2e0dc9,'request\x20sent',JSON[_0x72b2('0x10')](_0xd44a63));if(_0xd44a63[_0x72b2('0x11')]){if(_0xd44a63[_0x72b2('0x11')]['code']===0x1f4){logger[_0x72b2('0x11')](_0x72b2('0xc'),_0x2e0dc9,_0xd44a63[_0x72b2('0x11')][_0x72b2('0x12')]);return _0x39ff3d(_0xd44a63[_0x72b2('0x11')]['message']);}logger[_0x72b2('0x11')](_0x72b2('0xc'),_0x2e0dc9,_0xd44a63['error'][_0x72b2('0x12')]);return _0x348409(_0xd44a63[_0x72b2('0x11')][_0x72b2('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x2e0dc9,_0x72b2('0xd'));_0x348409(_0xd44a63['result'][_0x72b2('0x12')]);}})['catch'](function(_0x208294){logger[_0x72b2('0x11')](_0x72b2('0xc'),_0x2e0dc9,_0x208294);_0x39ff3d(_0x208294);});});} \ No newline at end of file +var _0x24ca=['../../config/environment','jayson/promise','client','then','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x24ca,0x157));var _0xa24c=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x24ca[_0x305c31];return _0x17f39f;};'use strict';var _=require(_0xa24c('0x0'));var util=require(_0xa24c('0x1'));var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var rs=require(_0xa24c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x5'))['db'];var utils=require(_0xa24c('0x6'));var logger=require(_0xa24c('0x7'))(_0xa24c('0x8'));var config=require(_0xa24c('0x9'));var jayson=require(_0xa24c('0xa'));var client=jayson[_0xa24c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x505148,_0x8f9c1a,_0x507de1){return new BPromise(function(_0x552811,_0x47524f){return client['request'](_0x505148,_0x507de1)[_0xa24c('0xc')](function(_0x161186){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x8f9c1a,'request\x20sent');logger['debug'](_0xa24c('0xd'),_0x8f9c1a,_0xa24c('0xe'),JSON[_0xa24c('0xf')](_0x161186));if(_0x161186['error']){if(_0x161186[_0xa24c('0x10')][_0xa24c('0x11')]===0x1f4){logger['error'](_0xa24c('0x12'),_0x8f9c1a,_0x161186['error'][_0xa24c('0x13')]);return _0x47524f(_0x161186['error'][_0xa24c('0x13')]);}logger[_0xa24c('0x10')](_0xa24c('0x12'),_0x8f9c1a,_0x161186[_0xa24c('0x10')][_0xa24c('0x13')]);return _0x552811(_0x161186['error']['message']);}else{logger['info'](_0xa24c('0x12'),_0x8f9c1a,_0xa24c('0xe'));_0x552811(_0x161186[_0xa24c('0x14')][_0xa24c('0x13')]);}})[_0xa24c('0x15')](function(_0x38965e){logger[_0xa24c('0x10')](_0xa24c('0x12'),_0x8f9c1a,_0x38965e);_0x47524f(_0x38965e);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f6fdf3b..db271ce 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x19e972,_0x165e70){var _0x4756e0=function(_0x96435f){while(--_0x96435f){_0x19e972['push'](_0x19e972['shift']());}};_0x4756e0(++_0x165e70);}(_0xe706,0xa3));var _0x6e70=function(_0x42276c,_0x141d47){_0x42276c=_0x42276c-0x0;var _0x1b5009=_0xe706[_0x42276c];return _0x1b5009;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2c40c9,_0xad237e){var _0xa090d3=function(_0x447a8e){while(--_0x447a8e){_0x2c40c9['push'](_0x2c40c9['shift']());}};_0xa090d3(++_0xad237e);}(_0x70e0,0x17b));var _0x070e=function(_0x260ce2,_0x21d2da){_0x260ce2=_0x260ce2-0x0;var _0x217a56=_0x70e0[_0x260ce2];return _0x217a56;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d8c57ad..02d5b93 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 _0x5267=['INTEGER','STRING','exports'];(function(_0x37e89f,_0x28cf49){var _0x30eda9=function(_0x2c3016){while(--_0x2c3016){_0x37e89f['push'](_0x37e89f['shift']());}};_0x30eda9(++_0x28cf49);}(_0x5267,0xbc));var _0x7526=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5267[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7526('0x0')]={'penalty':{'type':Sequelize[_0x7526('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7526('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7526('0x2')]}}; \ No newline at end of file +var _0xfa66=['exports','INTEGER'];(function(_0x4285b7,_0x11f7fb){var _0x8cb0=function(_0x497eb4){while(--_0x497eb4){_0x4285b7['push'](_0x4285b7['shift']());}};_0x8cb0(++_0x11f7fb);}(_0xfa66,0x1b0));var _0x6fa6=function(_0x1e284f,_0x22724b){_0x1e284f=_0x1e284f-0x0;var _0x427fda=_0xfa66[_0x1e284f];return _0x427fda;};'use strict';var Sequelize=require('sequelize');module[_0x6fa6('0x0')]={'penalty':{'type':Sequelize[_0x6fa6('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'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 3fe3f55..7e9b962 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 _0x4b74=['request-promise','path','rimraf','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4b74,0x96));var _0x44b7=function(_0x5ca2f3,_0x3632f5){_0x5ca2f3=_0x5ca2f3-0x0;var _0x2d6b7f=_0x4b74[_0x5ca2f3];return _0x2d6b7f;};'use strict';var _=require(_0x44b7('0x0'));var util=require('util');var logger=require(_0x44b7('0x1'))(_0x44b7('0x2'));var moment=require(_0x44b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x44b7('0x4'));var fs=require('fs');var path=require(_0x44b7('0x5'));var rimraf=require(_0x44b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x44b7('0x7'));module['exports']=function(_0x206368,_0xd50c91){return _0x206368[_0x44b7('0x8')](_0x44b7('0x9'),attributes,{'tableName':_0x44b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc929=['./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x262e1a,_0x24a491){var _0x306a9c=function(_0x3e163b){while(--_0x3e163b){_0x262e1a['push'](_0x262e1a['shift']());}};_0x306a9c(++_0x24a491);}(_0xc929,0x10c));var _0x9c92=function(_0x274d66,_0x37ca85){_0x274d66=_0x274d66-0x0;var _0x2b3bbb=_0xc929[_0x274d66];return _0x2b3bbb;};'use strict';var _=require(_0x9c92('0x0'));var util=require('util');var logger=require(_0x9c92('0x1'))('api');var moment=require(_0x9c92('0x2'));var BPromise=require(_0x9c92('0x3'));var rp=require(_0x9c92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c92('0x5'));var config=require(_0x9c92('0x6'));var attributes=require(_0x9c92('0x7'));module[_0x9c92('0x8')]=function(_0x20d191,_0xf8ca58){return _0x20d191[_0x9c92('0x9')]('UserFaxQueue',attributes,{'tableName':_0x9c92('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 22eff14..dab44b4 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 _0x1e61=['debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','UserFaxQueue,\x20%s,\x20%s'];(function(_0x37aae2,_0x4a46b7){var _0x4b4a51=function(_0xc9dcd5){while(--_0xc9dcd5){_0x37aae2['push'](_0x37aae2['shift']());}};_0x4b4a51(++_0x4a46b7);}(_0x1e61,0x95));var _0x11e6=function(_0x23bb7f,_0x3be2e9){_0x23bb7f=_0x23bb7f-0x0;var _0x39f1d7=_0x1e61[_0x23bb7f];return _0x39f1d7;};'use strict';var _=require(_0x11e6('0x0'));var util=require(_0x11e6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11e6('0x2'));var fs=require('fs');var Redis=require(_0x11e6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x11e6('0x4'));var logger=require(_0x11e6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x11e6('0x6')][_0x11e6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x199f9f,_0x1c9920,_0x2248db){return new BPromise(function(_0x1a75d9,_0x328c6e){return client[_0x11e6('0x8')](_0x199f9f,_0x2248db)[_0x11e6('0x9')](function(_0x4cc27b){logger['info'](_0x11e6('0xa'),_0x1c9920,'request\x20sent');logger[_0x11e6('0xb')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1c9920,_0x11e6('0xc'),JSON[_0x11e6('0xd')](_0x4cc27b));if(_0x4cc27b[_0x11e6('0xe')]){if(_0x4cc27b[_0x11e6('0xe')][_0x11e6('0xf')]===0x1f4){logger[_0x11e6('0xe')](_0x11e6('0xa'),_0x1c9920,_0x4cc27b[_0x11e6('0xe')][_0x11e6('0x10')]);return _0x328c6e(_0x4cc27b['error'][_0x11e6('0x10')]);}logger[_0x11e6('0xe')](_0x11e6('0xa'),_0x1c9920,_0x4cc27b['error'][_0x11e6('0x10')]);return _0x1a75d9(_0x4cc27b[_0x11e6('0xe')][_0x11e6('0x10')]);}else{logger[_0x11e6('0x11')](_0x11e6('0xa'),_0x1c9920,'request\x20sent');_0x1a75d9(_0x4cc27b[_0x11e6('0x12')]['message']);}})[_0x11e6('0x13')](function(_0x5c218a){logger[_0x11e6('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x1c9920,_0x5c218a);_0x328c6e(_0x5c218a);});});} \ No newline at end of file +var _0x59b8=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result'];(function(_0x42c19c,_0x4dc298){var _0x3dee49=function(_0x105760){while(--_0x105760){_0x42c19c['push'](_0x42c19c['shift']());}};_0x3dee49(++_0x4dc298);}(_0x59b8,0x1a4));var _0x859b=function(_0x1cd0ca,_0x109364){_0x1cd0ca=_0x1cd0ca-0x0;var _0x4a2e20=_0x59b8[_0x1cd0ca];return _0x4a2e20;};'use strict';var _=require(_0x859b('0x0'));var util=require(_0x859b('0x1'));var moment=require(_0x859b('0x2'));var BPromise=require('bluebird');var rs=require(_0x859b('0x3'));var fs=require('fs');var Redis=require(_0x859b('0x4'));var db=require(_0x859b('0x5'))['db'];var utils=require(_0x859b('0x6'));var logger=require(_0x859b('0x7'))(_0x859b('0x8'));var config=require(_0x859b('0x9'));var jayson=require(_0x859b('0xa'));var client=jayson['client'][_0x859b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc581c5,_0xd80f2e,_0x53b0e8){return new BPromise(function(_0x3e0c23,_0x12afdf){return client[_0x859b('0xc')](_0xc581c5,_0x53b0e8)[_0x859b('0xd')](function(_0x308ba0){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0xd80f2e,_0x859b('0xe'));logger[_0x859b('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xd80f2e,_0x859b('0xe'),JSON[_0x859b('0x10')](_0x308ba0));if(_0x308ba0[_0x859b('0x11')]){if(_0x308ba0[_0x859b('0x11')]['code']===0x1f4){logger[_0x859b('0x11')](_0x859b('0x12'),_0xd80f2e,_0x308ba0[_0x859b('0x11')][_0x859b('0x13')]);return _0x12afdf(_0x308ba0['error'][_0x859b('0x13')]);}logger[_0x859b('0x11')](_0x859b('0x12'),_0xd80f2e,_0x308ba0[_0x859b('0x11')][_0x859b('0x13')]);return _0x3e0c23(_0x308ba0[_0x859b('0x11')][_0x859b('0x13')]);}else{logger['info'](_0x859b('0x12'),_0xd80f2e,_0x859b('0xe'));_0x3e0c23(_0x308ba0[_0x859b('0x14')][_0x859b('0x13')]);}})['catch'](function(_0xef8e32){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xd80f2e,_0xef8e32);_0x12afdf(_0xef8e32);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 246de81..b5b2aa4 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x24bd96,_0x260e8f){var _0x5bfdd7=function(_0x3dda59){while(--_0x3dda59){_0x24bd96['push'](_0x24bd96['shift']());}};_0x5bfdd7(++_0x260e8f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1df9f9,_0x5e70b4){var _0x2fe038=function(_0xe1763a){while(--_0xe1763a){_0x1df9f9['push'](_0x1df9f9['shift']());}};_0x2fe038(++_0x5e70b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 84dcade..42d8bb9 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 _0xd6d2=['exports','sequelize'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x48248f,_0x2785b6){_0x48248f=_0x48248f-0x0;var _0x30c619=_0xd6d2[_0x48248f];return _0x30c619;};'use strict';var Sequelize=require(_0x2d6d('0x0'));module[_0x2d6d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x45c5=['exports','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x45c5,0x11c));var _0x545c=function(_0x8a8005,_0x2462e5){_0x8a8005=_0x8a8005-0x0;var _0x5e52f9=_0x45c5[_0x8a8005];return _0x5e52f9;};'use strict';var Sequelize=require(_0x545c('0x0'));module[_0x545c('0x1')]={'penalty':{'type':Sequelize[_0x545c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index e503417..9dbd84f 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 _0x6620=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x32d22e,_0x3f915b){var _0x3b1bbf=function(_0x279b86){while(--_0x279b86){_0x32d22e['push'](_0x32d22e['shift']());}};_0x3b1bbf(++_0x3f915b);}(_0x6620,0x131));var _0x0662=function(_0x3ffbea,_0x5cf32d){_0x3ffbea=_0x3ffbea-0x0;var _0x235242=_0x6620[_0x3ffbea];return _0x235242;};'use strict';var _=require(_0x0662('0x0'));var util=require('util');var logger=require(_0x0662('0x1'))(_0x0662('0x2'));var moment=require('moment');var BPromise=require(_0x0662('0x3'));var rp=require(_0x0662('0x4'));var fs=require('fs');var path=require(_0x0662('0x5'));var rimraf=require(_0x0662('0x6'));var config=require(_0x0662('0x7'));var attributes=require(_0x0662('0x8'));module[_0x0662('0x9')]=function(_0x454d22,_0x12fad1){return _0x454d22[_0x0662('0xa')](_0x0662('0xb'),attributes,{'tableName':_0x0662('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c4d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','lodash'];(function(_0x15f236,_0x59a12b){var _0x3645c0=function(_0x574879){while(--_0x574879){_0x15f236['push'](_0x15f236['shift']());}};_0x3645c0(++_0x59a12b);}(_0x0c4d,0x18b));var _0xd0c4=function(_0x4fe95c,_0x53ed9e){_0x4fe95c=_0x4fe95c-0x0;var _0x125778=_0x0c4d[_0x4fe95c];return _0x125778;};'use strict';var _=require(_0xd0c4('0x0'));var util=require(_0xd0c4('0x1'));var logger=require(_0xd0c4('0x2'))('api');var moment=require(_0xd0c4('0x3'));var BPromise=require(_0xd0c4('0x4'));var rp=require(_0xd0c4('0x5'));var fs=require('fs');var path=require(_0xd0c4('0x6'));var rimraf=require(_0xd0c4('0x7'));var config=require('../../config/environment');var attributes=require(_0xd0c4('0x8'));module['exports']=function(_0x41b23a,_0x492cb9){return _0x41b23a['define']('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','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 cda1b6a..ad119b0 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x36c0b0,_0x1f6827){var _0xdfe66b=function(_0x2580ee){while(--_0x2580ee){_0x36c0b0['push'](_0x36c0b0['shift']());}};_0xdfe66b(++_0x1f6827);}(_0xa41a,0x6b));var _0xaa41=function(_0x5200b1,_0x5cf792){_0x5200b1=_0x5200b1-0x0;var _0x20303e=_0xa41a[_0x5200b1];return _0x20303e;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x49319a,_0x1059cf){var _0x42c021=function(_0x33e735){while(--_0x33e735){_0x49319a['push'](_0x49319a['shift']());}};_0x42c021(++_0x1059cf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index c54a442..2c9a1cd 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 _0x5d0b=['Router','../../components/interaction/service','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express'];(function(_0x40d078,_0x210a77){var _0x46fc81=function(_0x3673da){while(--_0x3673da){_0x40d078['push'](_0x40d078['shift']());}};_0x46fc81(++_0x210a77);}(_0x5d0b,0x1a8));var _0xb5d0=function(_0x1de7d3,_0x50fb04){_0x1de7d3=_0x1de7d3-0x0;var _0x10de57=_0x5d0b[_0x1de7d3];return _0x10de57;};'use strict';var multer=require(_0xb5d0('0x0'));var util=require(_0xb5d0('0x1'));var path=require(_0xb5d0('0x2'));var timeout=require(_0xb5d0('0x3'));var express=require(_0xb5d0('0x4'));var router=express[_0xb5d0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb5d0('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xb5d0('0x7')]('/',auth[_0xb5d0('0x8')](),controller[_0xb5d0('0x9')]);module[_0xb5d0('0xa')]=router; \ No newline at end of file +var _0x0842=['../../components/auth/service','../../components/interaction/service','post','sendUserNotification','multer','util','path','connect-timeout','Router'];(function(_0x52a9af,_0x55fde4){var _0x46b772=function(_0x2347b7){while(--_0x2347b7){_0x52a9af['push'](_0x52a9af['shift']());}};_0x46b772(++_0x55fde4);}(_0x0842,0x1a2));var _0x2084=function(_0x1262ab,_0xab8c7a){_0x1262ab=_0x1262ab-0x0;var _0x206d24=_0x0842[_0x1262ab];return _0x206d24;};'use strict';var multer=require(_0x2084('0x0'));var util=require(_0x2084('0x1'));var path=require(_0x2084('0x2'));var timeout=require(_0x2084('0x3'));var express=require('express');var router=express[_0x2084('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2084('0x5'));var interaction=require(_0x2084('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x2084('0x7')]('/',auth['isAuthenticated'](),controller[_0x2084('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3685fba..cfc93f2 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 _0xdea2=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x2692a7,_0x3027e5){var _0x5f30d2=function(_0x24e820){while(--_0x24e820){_0x2692a7['push'](_0x2692a7['shift']());}};_0x5f30d2(++_0x3027e5);}(_0xdea2,0x15b));var _0x2dea=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xdea2[_0x4aa4e6];return _0x322588;};'use strict';var Sequelize=require(_0x2dea('0x0'));module[_0x2dea('0x1')]={'body':{'type':Sequelize[_0x2dea('0x2')]},'senderName':{'type':Sequelize[_0x2dea('0x3')]},'recipientsId':{'type':Sequelize[_0x2dea('0x2')]},'recipientsDescription':{'type':Sequelize[_0x2dea('0x3')]},'beep':{'type':Sequelize[_0x2dea('0x4')]}}; \ No newline at end of file +var _0xe778=['exports','TEXT','STRING'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xe778,0xfc));var _0x8e77=function(_0x30c3e7,_0x5c1995){_0x30c3e7=_0x30c3e7-0x0;var _0x45cc9e=_0xe778[_0x30c3e7];return _0x45cc9e;};'use strict';var Sequelize=require('sequelize');module[_0x8e77('0x0')]={'body':{'type':Sequelize[_0x8e77('0x1')]},'senderName':{'type':Sequelize[_0x8e77('0x2')]},'recipientsId':{'type':Sequelize[_0x8e77('0x1')]},'recipientsDescription':{'type':Sequelize[_0x8e77('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 50f8ed8..0d52336 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 _0x6982=['ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','smsqueue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','recipientsId','sortBy','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','union','queue','replace','Queue','ids','push','all','findOne','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','status','stack','name','body','text','hasOwnProperty','TemplateId'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x6982,0xf6));var _0x2698=function(_0x1937b5,_0x3d5ea7){_0x1937b5=_0x1937b5-0x0;var _0x3c8dc8=_0x6982[_0x1937b5];return _0x3c8dc8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2698('0x0'));var zipdir=require(_0x2698('0x1'));var jsonpatch=require(_0x2698('0x2'));var rp=require(_0x2698('0x3'));var moment=require(_0x2698('0x4'));var BPromise=require(_0x2698('0x5'));var Mustache=require(_0x2698('0x6'));var util=require(_0x2698('0x7'));var path=require(_0x2698('0x8'));var sox=require(_0x2698('0x9'));var csv=require(_0x2698('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2698('0xb'));var _=require(_0x2698('0xc'));var squel=require(_0x2698('0xd'));var crypto=require(_0x2698('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2698('0xf'));var toCsv=require(_0x2698('0xa'));var querystring=require(_0x2698('0x10'));var Papa=require(_0x2698('0x11'));var Redis=require(_0x2698('0x12'));var authService=require(_0x2698('0x13'));var qs=require(_0x2698('0x14'));var as=require(_0x2698('0x15'));var hardwareService=require(_0x2698('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2698('0x17'));var licenseUtil=require(_0x2698('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2698('0x19')](config[_0x2698('0x1a')],{'host':_0x2698('0x1b'),'port':0x18eb});var socket=require(_0x2698('0x1c'))(new Redis(config[_0x2698('0x1a')]));require(_0x2698('0x1d'))['register'](socket);function respondWithStatusCode(_0x51ec53,_0x4db7ee){_0x4db7ee=_0x4db7ee||0xcc;return function(_0x3bbf37){if(_0x3bbf37){return _0x51ec53[_0x2698('0x1e')](_0x4db7ee);}return _0x51ec53['status'](_0x4db7ee)[_0x2698('0x1f')]();};}function respondWithResult(_0x2676bd,_0x3f17b8){_0x3f17b8=_0x3f17b8||0xc8;return function(_0x51ef26){if(_0x51ef26){return _0x2676bd['status'](_0x3f17b8)[_0x2698('0x20')](_0x51ef26);}};}function respondWithFilteredResult(_0x4be564,_0x3ec5d5){return function(_0x2d6c53){if(_0x2d6c53){var _0x2bd519=typeof _0x3ec5d5[_0x2698('0x21')]===_0x2698('0x22')&&typeof _0x3ec5d5[_0x2698('0x23')]===_0x2698('0x22');var _0x4e79b5=_0x2d6c53[_0x2698('0x24')];var _0x5a62d7=_0x2bd519?0x0:_0x3ec5d5[_0x2698('0x21')];var _0xe24cc7=_0x2bd519?_0x2d6c53['count']:_0x3ec5d5[_0x2698('0x21')]+_0x3ec5d5[_0x2698('0x23')];var _0x3a9acf;if(_0xe24cc7>=_0x4e79b5){_0xe24cc7=_0x4e79b5;_0x3a9acf=0xc8;}else{_0x3a9acf=0xce;}_0x4be564['status'](_0x3a9acf);return _0x4be564[_0x2698('0x25')](_0x2698('0x26'),_0x5a62d7+'-'+_0xe24cc7+'/'+_0x4e79b5)[_0x2698('0x20')](_0x2d6c53);}return null;};}function patchUpdates(_0x2bd031){return function(_0x28dec5){try{jsonpatch[_0x2698('0x27')](_0x28dec5,_0x2bd031,!![]);}catch(_0x13ed24){return BPromise['reject'](_0x13ed24);}return _0x28dec5[_0x2698('0x28')]();};}function saveUpdates(_0x18b9bf,_0x26c47c){return function(_0x394c06){if(_0x394c06){return _0x394c06[_0x2698('0x29')](_0x18b9bf)[_0x2698('0x2a')](function(_0x53ab38){return _0x53ab38;});}return null;};}function removeEntity(_0x1dedb5,_0x30dcd5){return function(_0x25e50a){if(_0x25e50a){return _0x25e50a[_0x2698('0x2b')]()[_0x2698('0x2a')](function(){_0x1dedb5[_0x2698('0x2c')](0xcc)[_0x2698('0x1f')]();});}};}function handleEntityNotFound(_0x2f3d7a,_0x28b97b){return function(_0x3d686d){if(!_0x3d686d){_0x2f3d7a['sendStatus'](0x194);}return _0x3d686d;};}function handleError(_0x45cc04,_0x17f1b6){_0x17f1b6=_0x17f1b6||0x1f4;return function(_0x197adc){logger['error'](_0x197adc[_0x2698('0x2d')]);if(_0x197adc[_0x2698('0x2e')]){delete _0x197adc['name'];}_0x45cc04[_0x2698('0x2c')](_0x17f1b6)['send'](_0x197adc);};}exports['sendUserNotification']=function(_0x44f267,_0x4cab47,_0x3f84f7){if(!_0x44f267[_0x2698('0x2f')]['hasOwnProperty'](_0x2698('0x30'))&&!_0x44f267['body'][_0x2698('0x31')](_0x2698('0x32'))){throw new db['Sequelize'][(_0x2698('0x33'))](_0x2698('0x34'));}else{if(_0x44f267[_0x2698('0x2f')]['hasOwnProperty'](_0x2698('0x32'))&&!_0x44f267[_0x2698('0x2f')][_0x2698('0x31')](_0x2698('0x35'))){throw new db['Sequelize']['ValidationError'](_0x2698('0x36'));}if(!_0x44f267['body'][_0x2698('0x31')](_0x2698('0x37'))){throw new db[(_0x2698('0x38'))][(_0x2698('0x33'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x284262=JSON[_0x2698('0x39')](_0x44f267[_0x2698('0x2f')][_0x2698('0x37')]);}catch(_0x55162f){logger['error'](_0x55162f);throw new db[(_0x2698('0x38'))]['ValidationError'](_0x2698('0x3a'));}var _0x5ab4aa=[_0x2698('0x3b'),_0x2698('0x3c'),'mailqueue','openchannelqueue',_0x2698('0x3d'),'voicequeue',_0x2698('0x3e'),_0x2698('0x3f'),_0x2698('0x40')];if(_[_0x2698('0x41')](_0x284262,function(_0x5fd69e){return!_[_0x2698('0x42')](_0x5ab4aa,_0x5fd69e['model'][_0x2698('0x43')]());})){throw new db[(_0x2698('0x38'))]['ValidationError'](_0x2698('0x44'));}}}var _0x495794={};_0x495794[_0x2698('0x45')]=_0x44f267[_0x2698('0x2f')][_0x2698('0x31')]('senderName')?_0x44f267[_0x2698('0x2f')]['senderName']:_0x44f267[_0x2698('0x40')][_0x2698('0x46')];_0x495794['recipientsDescription']=_['isEmpty'](_0x44f267[_0x2698('0x2f')][_0x2698('0x47')])?null:_0x44f267[_0x2698('0x2f')][_0x2698('0x47')];_0x495794[_0x2698('0x48')]=_0x44f267[_0x2698('0x2f')][_0x2698('0x48')]||![];_0x495794['SenderId']=_0x44f267[_0x2698('0x40')]['id'];return getContent(_0x44f267[_0x2698('0x2f')])['then'](function(_0x5bb120){_0x495794[_0x2698('0x2f')]=_0x5bb120;return getRecipients(_0x284262);})[_0x2698('0x2a')](function(_0x99b5c3){_0x495794[_0x2698('0x49')]=_[_0x2698('0x4a')](_0x99b5c3)['join'](',');return db[_0x2698('0x4b')]['transaction'](function(_0x5b6085){return db[_0x2698('0x4c')][_0x2698('0x4d')](_0x495794,{'raw':!![],'transaction':_0x5b6085})[_0x2698('0x2a')](function(_0x5a910f){var _0x530887={'sender':_0x495794[_0x2698('0x45')],'description':_0x495794[_0x2698('0x47')],'content':_0x495794[_0x2698('0x2f')],'beep':_0x495794[_0x2698('0x48')]};_0x99b5c3[_0x2698('0x4e')](function(_0x5193aa){_0x530887[_0x2698('0x4f')]=_0x5193aa;socket[_0x2698('0x50')](_0x2698('0x51'),_0x530887);});return _0x5a910f;});});})['then'](respondWithResult(_0x4cab47,0xc9))[_0x2698('0x52')](handleError(_0x4cab47,null));};function getContent(_0x324e19){return new BPromise(function(_0x5be4e7,_0x117c69){if(_0x324e19[_0x2698('0x30')]){_0x5be4e7(_0x324e19[_0x2698('0x30')]);return;}return db[_0x2698('0x53')]['findOne']({'attributes':[_0x2698('0x54')],'where':{'id':_0x324e19[_0x2698('0x32')]},'raw':!![]})[_0x2698('0x2a')](function(_0x11a554){if(!_0x11a554)throw new db[(_0x2698('0x38'))]['ValidationError'](_0x2698('0x55'));var _0x3a14f5=Mustache[_0x2698('0x56')](_0x11a554[_0x2698('0x54')],_0x324e19['view']);_0x5be4e7(_0x3a14f5);})[_0x2698('0x52')](function(_0x48ad7a){_0x117c69(_0x48ad7a);});});}function getRecipients(_0x2cbcff){return new BPromise(function(_0x3ab483,_0x46e34e){var _0x4a65a3=[];var _0x16de06=[];_0x2cbcff[_0x2698('0x4e')](function(_0x431db7){var _0x4acdae=_[_0x2698('0x57')](_0x431db7[_0x2698('0x58')][_0x2698('0x43')]());if(_0x4acdae==='User'){_0x4a65a3=_[_0x2698('0x59')](_0x4a65a3,_0x431db7['ids']);}else{if(_[_0x2698('0x42')](_0x4acdae,_0x2698('0x5a')))_0x4acdae=_0x4acdae[_0x2698('0x5b')](_0x2698('0x5a'),_0x2698('0x5c'));_0x431db7[_0x2698('0x5d')][_0x2698('0x4e')](function(_0x14a3d0){_0x16de06[_0x2698('0x5e')](getAgents(_0x4acdae,_0x14a3d0));});}});return BPromise[_0x2698('0x5f')](_0x16de06)[_0x2698('0x2a')](function(_0x453141){_0x4a65a3=_[_0x2698('0x59')](_0x4a65a3,_['flatten'](_0x453141));_0x3ab483(_0x4a65a3);})[_0x2698('0x52')](function(_0xd8b0bd){_0x46e34e(_0xd8b0bd);});});}function getAgents(_0x427374,_0x58f834){return new BPromise(function(_0x42e663,_0x219c0b){return db[_0x427374][_0x2698('0x60')]({'where':{'id':_0x58f834}})[_0x2698('0x2a')](function(_0x3a4799){return _0x3a4799[_0x2698('0x61')]({'attributes':['id'],'raw':!![]})[_0x2698('0x2a')](function(_0x44c011){var _0x1b72ff=_[_0x2698('0x62')](_0x44c011,'id');_0x42e663(_0x1b72ff);});})['catch'](function(_0x4b563b){_0x219c0b(_0x4b563b);});});} \ No newline at end of file +var _0x8763=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','team','some','includes','toLowerCase','senderName','user','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','model','User','ids','replace','queue','all','getAgents','map'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x8763,0x68));var _0x3876=function(_0x2c5aa0,_0x5cb545){_0x2c5aa0=_0x2c5aa0-0x0;var _0x2b63d5=_0x8763[_0x2c5aa0];return _0x2b63d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3876('0x0'));var zipdir=require(_0x3876('0x1'));var jsonpatch=require(_0x3876('0x2'));var rp=require(_0x3876('0x3'));var moment=require(_0x3876('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3876('0x5'));var util=require(_0x3876('0x6'));var path=require(_0x3876('0x7'));var sox=require(_0x3876('0x8'));var csv=require(_0x3876('0x9'));var ejs=require(_0x3876('0xa'));var fs=require('fs');var fs_extra=require(_0x3876('0xb'));var _=require(_0x3876('0xc'));var squel=require(_0x3876('0xd'));var crypto=require(_0x3876('0xe'));var jsforce=require(_0x3876('0xf'));var deskjs=require(_0x3876('0x10'));var toCsv=require(_0x3876('0x9'));var querystring=require(_0x3876('0x11'));var Papa=require('papaparse');var Redis=require(_0x3876('0x12'));var authService=require(_0x3876('0x13'));var qs=require(_0x3876('0x14'));var as=require(_0x3876('0x15'));var hardwareService=require(_0x3876('0x16'));var logger=require(_0x3876('0x17'))(_0x3876('0x18'));var utils=require(_0x3876('0x19'));var config=require(_0x3876('0x1a'));var licenseUtil=require(_0x3876('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3876('0x1c')](config['redis'],{'host':_0x3876('0x1d'),'port':0x18eb});var socket=require(_0x3876('0x1e'))(new Redis(config[_0x3876('0x1f')]));require(_0x3876('0x20'))[_0x3876('0x21')](socket);function respondWithStatusCode(_0x53ce93,_0x5c0110){_0x5c0110=_0x5c0110||0xcc;return function(_0x29c1b7){if(_0x29c1b7){return _0x53ce93[_0x3876('0x22')](_0x5c0110);}return _0x53ce93[_0x3876('0x23')](_0x5c0110)[_0x3876('0x24')]();};}function respondWithResult(_0xc08f1f,_0x5c875){_0x5c875=_0x5c875||0xc8;return function(_0x2c6037){if(_0x2c6037){return _0xc08f1f[_0x3876('0x23')](_0x5c875)[_0x3876('0x25')](_0x2c6037);}};}function respondWithFilteredResult(_0x529def,_0x5f4e93){return function(_0x58cde8){if(_0x58cde8){var _0x2d580e=typeof _0x5f4e93['offset']===_0x3876('0x26')&&typeof _0x5f4e93[_0x3876('0x27')]===_0x3876('0x26');var _0x43c611=_0x58cde8[_0x3876('0x28')];var _0x2d8b3a=_0x2d580e?0x0:_0x5f4e93[_0x3876('0x29')];var _0x5197cb=_0x2d580e?_0x58cde8['count']:_0x5f4e93[_0x3876('0x29')]+_0x5f4e93['limit'];var _0x599ea4;if(_0x5197cb>=_0x43c611){_0x5197cb=_0x43c611;_0x599ea4=0xc8;}else{_0x599ea4=0xce;}_0x529def[_0x3876('0x23')](_0x599ea4);return _0x529def[_0x3876('0x2a')](_0x3876('0x2b'),_0x2d8b3a+'-'+_0x5197cb+'/'+_0x43c611)[_0x3876('0x25')](_0x58cde8);}return null;};}function patchUpdates(_0x3e71ce){return function(_0x38d3eb){try{jsonpatch[_0x3876('0x2c')](_0x38d3eb,_0x3e71ce,!![]);}catch(_0x489eba){return BPromise[_0x3876('0x2d')](_0x489eba);}return _0x38d3eb[_0x3876('0x2e')]();};}function saveUpdates(_0x2da467,_0x3c5c99){return function(_0x39907a){if(_0x39907a){return _0x39907a[_0x3876('0x2f')](_0x2da467)[_0x3876('0x30')](function(_0x3b26d7){return _0x3b26d7;});}return null;};}function removeEntity(_0x9c4083,_0x1f9a43){return function(_0x55c64c){if(_0x55c64c){return _0x55c64c['destroy']()[_0x3876('0x30')](function(){_0x9c4083[_0x3876('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e89f0,_0x2ac17b){return function(_0x3bf35d){if(!_0x3bf35d){_0x3e89f0[_0x3876('0x22')](0x194);}return _0x3bf35d;};}function handleError(_0x5e847a,_0x1d5ec6){_0x1d5ec6=_0x1d5ec6||0x1f4;return function(_0x3bfd0e){logger[_0x3876('0x31')](_0x3bfd0e[_0x3876('0x32')]);if(_0x3bfd0e['name']){delete _0x3bfd0e[_0x3876('0x33')];}_0x5e847a[_0x3876('0x23')](_0x1d5ec6)['send'](_0x3bfd0e);};}exports[_0x3876('0x34')]=function(_0x119a97,_0x4b1ffe,_0x35202b){if(!_0x119a97[_0x3876('0x35')][_0x3876('0x36')](_0x3876('0x37'))&&!_0x119a97[_0x3876('0x35')][_0x3876('0x36')](_0x3876('0x38'))){throw new db[(_0x3876('0x39'))][(_0x3876('0x3a'))](_0x3876('0x3b'));}else{if(_0x119a97[_0x3876('0x35')][_0x3876('0x36')](_0x3876('0x38'))&&!_0x119a97['body'][_0x3876('0x36')](_0x3876('0x3c'))){throw new db[(_0x3876('0x39'))]['ValidationError'](_0x3876('0x3d'));}if(!_0x119a97['body'][_0x3876('0x36')](_0x3876('0x3e'))){throw new db['Sequelize'][(_0x3876('0x3a'))](_0x3876('0x3f'));}else{try{var _0x1bce5d=JSON[_0x3876('0x40')](_0x119a97[_0x3876('0x35')]['recipients']);}catch(_0x4ae438){logger[_0x3876('0x31')](_0x4ae438);throw new db[(_0x3876('0x39'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x11c753=[_0x3876('0x41'),_0x3876('0x42'),_0x3876('0x43'),_0x3876('0x44'),_0x3876('0x45'),'voicequeue','whatsappqueue',_0x3876('0x46'),'user'];if(_[_0x3876('0x47')](_0x1bce5d,function(_0x56a753){return!_[_0x3876('0x48')](_0x11c753,_0x56a753['model'][_0x3876('0x49')]());})){throw new db['Sequelize']['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x3ea47f={};_0x3ea47f[_0x3876('0x4a')]=_0x119a97[_0x3876('0x35')][_0x3876('0x36')]('senderName')?_0x119a97[_0x3876('0x35')]['senderName']:_0x119a97[_0x3876('0x4b')][_0x3876('0x4c')];_0x3ea47f[_0x3876('0x4d')]=_[_0x3876('0x4e')](_0x119a97[_0x3876('0x35')]['recipientsDescription'])?null:_0x119a97[_0x3876('0x35')][_0x3876('0x4d')];_0x3ea47f[_0x3876('0x4f')]=_0x119a97['body'][_0x3876('0x4f')]||![];_0x3ea47f['SenderId']=_0x119a97['user']['id'];return getContent(_0x119a97['body'])[_0x3876('0x30')](function(_0x572144){_0x3ea47f[_0x3876('0x35')]=_0x572144;return getRecipients(_0x1bce5d);})[_0x3876('0x30')](function(_0x1cbee7){_0x3ea47f[_0x3876('0x50')]=_[_0x3876('0x51')](_0x1cbee7)['join'](',');return db[_0x3876('0x52')][_0x3876('0x53')](function(_0x1bcbfe){return db[_0x3876('0x54')][_0x3876('0x55')](_0x3ea47f,{'raw':!![],'transaction':_0x1bcbfe})[_0x3876('0x30')](function(_0x361f1b){var _0x363c51={'sender':_0x3ea47f['senderName'],'description':_0x3ea47f[_0x3876('0x4d')],'content':_0x3ea47f[_0x3876('0x35')],'beep':_0x3ea47f[_0x3876('0x4f')]};_0x1cbee7[_0x3876('0x56')](function(_0x2a6204){_0x363c51['recipient']=_0x2a6204;socket[_0x3876('0x57')](_0x3876('0x58'),_0x363c51);});return _0x361f1b;});});})[_0x3876('0x30')](respondWithResult(_0x4b1ffe,0xc9))[_0x3876('0x59')](handleError(_0x4b1ffe,null));};function getContent(_0x6369de){return new BPromise(function(_0xe6faef,_0x3f7ed9){if(_0x6369de['text']){_0xe6faef(_0x6369de[_0x3876('0x37')]);return;}return db[_0x3876('0x5a')][_0x3876('0x5b')]({'attributes':['html'],'where':{'id':_0x6369de[_0x3876('0x38')]},'raw':!![]})[_0x3876('0x30')](function(_0x1ee6cd){if(!_0x1ee6cd)throw new db['Sequelize'][(_0x3876('0x3a'))](_0x3876('0x5c'));var _0x11794f=Mustache[_0x3876('0x5d')](_0x1ee6cd[_0x3876('0x5e')],_0x6369de[_0x3876('0x3c')]);_0xe6faef(_0x11794f);})[_0x3876('0x59')](function(_0xabc6f7){_0x3f7ed9(_0xabc6f7);});});}function getRecipients(_0x5a20a8){return new BPromise(function(_0x3987c7,_0xc1803a){var _0x3b5e36=[];var _0x228fc9=[];_0x5a20a8[_0x3876('0x56')](function(_0x2e6ca5){var _0x4fc7c3=_[_0x3876('0x5f')](_0x2e6ca5[_0x3876('0x60')]['toLowerCase']());if(_0x4fc7c3===_0x3876('0x61')){_0x3b5e36=_['union'](_0x3b5e36,_0x2e6ca5[_0x3876('0x62')]);}else{if(_['includes'](_0x4fc7c3,'queue'))_0x4fc7c3=_0x4fc7c3[_0x3876('0x63')](_0x3876('0x64'),'Queue');_0x2e6ca5[_0x3876('0x62')]['forEach'](function(_0x3f57bb){_0x228fc9['push'](getAgents(_0x4fc7c3,_0x3f57bb));});}});return BPromise[_0x3876('0x65')](_0x228fc9)[_0x3876('0x30')](function(_0x2097f4){_0x3b5e36=_['union'](_0x3b5e36,_['flatten'](_0x2097f4));_0x3987c7(_0x3b5e36);})[_0x3876('0x59')](function(_0x401e5b){_0xc1803a(_0x401e5b);});});}function getAgents(_0x35e63d,_0x4a272b){return new BPromise(function(_0x14c97c,_0x100694){return db[_0x35e63d][_0x3876('0x5b')]({'where':{'id':_0x4a272b}})[_0x3876('0x30')](function(_0xc2a94){return _0xc2a94[_0x3876('0x66')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e2323){var _0x4453bf=_[_0x3876('0x67')](_0x2e2323,'id');_0x14c97c(_0x4453bf);});})[_0x3876('0x59')](function(_0x3b19a1){_0x100694(_0x3b19a1);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index c80cdbe..2677bfa 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 _0x040e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','update','remove'];(function(_0x3a81b5,_0x37b0cf){var _0x13492b=function(_0x153d99){while(--_0x153d99){_0x3a81b5['push'](_0x3a81b5['shift']());}};_0x13492b(++_0x37b0cf);}(_0x040e,0x68));var _0xe040=function(_0x15744d,_0x289064){_0x15744d=_0x15744d-0x0;var _0x4c9e71=_0x040e[_0x15744d];return _0x4c9e71;};'use strict';var EventEmitter=require(_0xe040('0x0'));var UserNotification=require(_0xe040('0x1'))['db'][_0xe040('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe040('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe040('0x4'),'afterDestroy':_0xe040('0x5')};function emitEvent(_0xf10c63){return function(_0x5322a5,_0x183d9f,_0x22eeef){UserNotificationEvents[_0xe040('0x6')](_0xf10c63+':'+_0x5322a5['id'],_0x5322a5);UserNotificationEvents[_0xe040('0x6')](_0xf10c63,_0x5322a5);_0x22eeef(null);};}for(var e in events){if(events[_0xe040('0x7')](e)){var event=events[e];UserNotification[_0xe040('0x8')](e,emitEvent(event));}}module[_0xe040('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xd302=['UserNotification','save','update','emit','exports','events','../../mysqldb'];(function(_0x18ad8b,_0x50f2db){var _0x168ccd=function(_0x1db454){while(--_0x1db454){_0x18ad8b['push'](_0x18ad8b['shift']());}};_0x168ccd(++_0x50f2db);}(_0xd302,0x186));var _0x2d30=function(_0x529892,_0x4f40b0){_0x529892=_0x529892-0x0;var _0x13e1cc=_0xd302[_0x529892];return _0x13e1cc;};'use strict';var EventEmitter=require(_0x2d30('0x0'));var UserNotification=require(_0x2d30('0x1'))['db'][_0x2d30('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d30('0x3'),'afterUpdate':_0x2d30('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8f3344){return function(_0x3bdb6b,_0x2f0e48,_0x2f65a8){UserNotificationEvents['emit'](_0x8f3344+':'+_0x3bdb6b['id'],_0x3bdb6b);UserNotificationEvents[_0x2d30('0x5')](_0x8f3344,_0x3bdb6b);_0x2f65a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x2d30('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 146c87f..02357df 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 _0xe348=['userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserNotification'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xe348,0x137));var _0x8e34=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xe348[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x8e34('0x0'));var util=require(_0x8e34('0x1'));var logger=require('../../config/logger')(_0x8e34('0x2'));var moment=require(_0x8e34('0x3'));var BPromise=require(_0x8e34('0x4'));var rp=require(_0x8e34('0x5'));var fs=require('fs');var path=require(_0x8e34('0x6'));var rimraf=require(_0x8e34('0x7'));var config=require(_0x8e34('0x8'));var attributes=require('./userNotification.attributes');module[_0x8e34('0x9')]=function(_0x139dfe,_0x155a8f){return _0x139dfe['define'](_0x8e34('0xa'),attributes,{'tableName':_0x8e34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e34('0xc'),'collate':_0x8e34('0xd')});}; \ No newline at end of file +var _0xfced=['utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','define','UserNotification','userNotifications'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xfced,0x1a0));var _0xdfce=function(_0x1a9fe7,_0x4b0032){_0x1a9fe7=_0x1a9fe7-0x0;var _0x588bac=_0xfced[_0x1a9fe7];return _0x588bac;};'use strict';var _=require('lodash');var util=require(_0xdfce('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdfce('0x1'));var BPromise=require(_0xdfce('0x2'));var rp=require(_0xdfce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module['exports']=function(_0x36829b,_0x5b47f0){return _0x36829b[_0xdfce('0x4')](_0xdfce('0x5'),attributes,{'tableName':_0xdfce('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdfce('0x7'),'collate':_0xdfce('0x8')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index b73f0b7..28d9f92 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 _0x883e=['../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0x5935eb,_0x82649b){var _0x34b049=function(_0xed1431){while(--_0xed1431){_0x5935eb['push'](_0x5935eb['shift']());}};_0x34b049(++_0x82649b);}(_0x883e,0x1f2));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe883('0x0'));var moment=require(_0xe883('0x1'));var BPromise=require('bluebird');var rs=require(_0xe883('0x2'));var fs=require('fs');var Redis=require(_0xe883('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe883('0x4'))(_0xe883('0x5'));var config=require(_0xe883('0x6'));var jayson=require(_0xe883('0x7'));var client=jayson['client'][_0xe883('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe883('0x9')],{'host':_0xe883('0xa'),'port':0x18eb});var socket=require(_0xe883('0xb'))(new Redis(config[_0xe883('0x9')]));require(_0xe883('0xc'))['register'](socket);function respondWithRpcPromise(_0x4e8d49,_0x23d693,_0xaa85e2){return new BPromise(function(_0x36a183,_0x398ab9){return client[_0xe883('0xd')](_0x4e8d49,_0xaa85e2)[_0xe883('0xe')](function(_0x519168){logger[_0xe883('0xf')]('UserNotification,\x20%s,\x20%s',_0x23d693,_0xe883('0x10'));logger[_0xe883('0x11')](_0xe883('0x12'),_0x23d693,_0xe883('0x10'),JSON['stringify'](_0x519168));if(_0x519168['error']){if(_0x519168[_0xe883('0x13')][_0xe883('0x14')]===0x1f4){logger[_0xe883('0x13')](_0xe883('0x15'),_0x23d693,_0x519168['error']['message']);return _0x398ab9(_0x519168[_0xe883('0x13')]['message']);}logger[_0xe883('0x13')](_0xe883('0x15'),_0x23d693,_0x519168['error'][_0xe883('0x16')]);return _0x36a183(_0x519168[_0xe883('0x13')]['message']);}else{logger[_0xe883('0xf')](_0xe883('0x15'),_0x23d693,'request\x20sent');_0x36a183(_0x519168['result'][_0xe883('0x16')]);}})[_0xe883('0x17')](function(_0x41e2a3){logger[_0xe883('0x13')]('UserNotification,\x20%s,\x20%s',_0x23d693,_0x41e2a3);_0x398ab9(_0x41e2a3);});});} \ No newline at end of file +var _0x4fd1=['message','result','catch','util','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4e60e4,_0x596df4){var _0x248bd2=function(_0x5e4853){while(--_0x5e4853){_0x4e60e4['push'](_0x4e60e4['shift']());}};_0x248bd2(++_0x596df4);}(_0x4fd1,0x16b));var _0x14fd=function(_0x5ccd6e,_0x2e3bfc){_0x5ccd6e=_0x5ccd6e-0x0;var _0x30f3de=_0x4fd1[_0x5ccd6e];return _0x30f3de;};'use strict';var _=require('lodash');var util=require(_0x14fd('0x0'));var moment=require('moment');var BPromise=require(_0x14fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x14fd('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x14fd('0x3'));var jayson=require(_0x14fd('0x4'));var client=jayson[_0x14fd('0x5')][_0x14fd('0x6')]({'port':0x232a});config[_0x14fd('0x7')]=_[_0x14fd('0x8')](config[_0x14fd('0x7')],{'host':_0x14fd('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x14fd('0x7')]));require(_0x14fd('0xa'))[_0x14fd('0xb')](socket);function respondWithRpcPromise(_0x30eb97,_0x3d55a8,_0x1c39b7){return new BPromise(function(_0xc4b3e2,_0x57c6cf){return client[_0x14fd('0xc')](_0x30eb97,_0x1c39b7)[_0x14fd('0xd')](function(_0x449533){logger[_0x14fd('0xe')](_0x14fd('0xf'),_0x3d55a8,_0x14fd('0x10'));logger[_0x14fd('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3d55a8,_0x14fd('0x10'),JSON[_0x14fd('0x12')](_0x449533));if(_0x449533[_0x14fd('0x13')]){if(_0x449533[_0x14fd('0x13')][_0x14fd('0x14')]===0x1f4){logger[_0x14fd('0x13')](_0x14fd('0xf'),_0x3d55a8,_0x449533['error'][_0x14fd('0x15')]);return _0x57c6cf(_0x449533[_0x14fd('0x13')][_0x14fd('0x15')]);}logger[_0x14fd('0x13')](_0x14fd('0xf'),_0x3d55a8,_0x449533['error'][_0x14fd('0x15')]);return _0xc4b3e2(_0x449533[_0x14fd('0x13')]['message']);}else{logger[_0x14fd('0xe')](_0x14fd('0xf'),_0x3d55a8,_0x14fd('0x10'));_0xc4b3e2(_0x449533[_0x14fd('0x16')]['message']);}})[_0x14fd('0x17')](function(_0x4824ae){logger[_0x14fd('0x13')]('UserNotification,\x20%s,\x20%s',_0x3d55a8,_0x4824ae);_0x57c6cf(_0x4824ae);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 21aec8c..9be2eb4 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 _0x5aa4=['emit','removeListener','userNotification:','./userNotification.events','save','remove','update'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x5aa4,0xd5));var _0x45aa=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x5aa4[_0x5c4e16];return _0x36044a;};'use strict';var UserNotificationEvents=require(_0x45aa('0x0'));var events=[_0x45aa('0x1'),_0x45aa('0x2'),_0x45aa('0x3')];function createListener(_0x5e14d0,_0x3c3e42){return function(_0x1b706c){_0x3c3e42[_0x45aa('0x4')](_0x5e14d0,_0x1b706c);};}function removeListener(_0x1e0d61,_0x4dc99f){return function(){UserNotificationEvents[_0x45aa('0x5')](_0x1e0d61,_0x4dc99f);};}exports['register']=function(_0x289655){for(var _0x49480e=0x0,_0x14e796=events['length'];_0x49480e<_0x14e796;_0x49480e++){var _0x10bf39=events[_0x49480e];var _0x2e976c=createListener(_0x45aa('0x6')+_0x10bf39,_0x289655);UserNotificationEvents['on'](_0x10bf39,_0x2e976c);}}; \ No newline at end of file +var _0x656d=['length','userNotification:','save','remove','emit','removeListener','register'];(function(_0x217b40,_0x1ad84d){var _0x4bf4c6=function(_0x290ad5){while(--_0x290ad5){_0x217b40['push'](_0x217b40['shift']());}};_0x4bf4c6(++_0x1ad84d);}(_0x656d,0xe2));var _0xd656=function(_0x33e26a,_0x4a4f89){_0x33e26a=_0x33e26a-0x0;var _0x349767=_0x656d[_0x33e26a];return _0x349767;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xd656('0x0'),_0xd656('0x1'),'update'];function createListener(_0x45de1b,_0x2c3e4a){return function(_0x478a18){_0x2c3e4a[_0xd656('0x2')](_0x45de1b,_0x478a18);};}function removeListener(_0x2fb41d,_0x1e1132){return function(){UserNotificationEvents[_0xd656('0x3')](_0x2fb41d,_0x1e1132);};}exports[_0xd656('0x4')]=function(_0x4caa65){for(var _0x2ff003=0x0,_0x428c8f=events[_0xd656('0x5')];_0x2ff003<_0x428c8f;_0x2ff003++){var _0x445969=events[_0x2ff003];var _0x54f252=createListener(_0xd656('0x6')+_0x445969,_0x4caa65);UserNotificationEvents['on'](_0x445969,_0x54f252);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 60e7b3c..52fa7fc 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x43faa6,_0xab56f3){var _0x40120b=function(_0x442900){while(--_0x442900){_0x43faa6['push'](_0x43faa6['shift']());}};_0x40120b(++_0xab56f3);}(_0x70e0,0x17b));var _0x070e=function(_0x360b3d,_0x4edcf8){_0x360b3d=_0x360b3d-0x0;var _0x981336=_0x70e0[_0x360b3d];return _0x981336;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x29d25b,_0x590ff3){var _0x35f241=function(_0x1ca694){while(--_0x1ca694){_0x29d25b['push'](_0x29d25b['shift']());}};_0x35f241(++_0x590ff3);}(_0x70e0,0x17b));var _0x070e=function(_0x350e0c,_0x40fc08){_0x350e0c=_0x350e0c-0x0;var _0x434abb=_0x70e0[_0x350e0c];return _0x434abb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index afb155d..fda602f 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 _0x2ee5=['exports','sequelize'];(function(_0x3052bc,_0x52e93c){var _0x2a3c35=function(_0xb07990){while(--_0xb07990){_0x3052bc['push'](_0x3052bc['shift']());}};_0x2a3c35(++_0x52e93c);}(_0x2ee5,0x14b));var _0x52ee=function(_0x2e079d,_0x599552){_0x2e079d=_0x2e079d-0x0;var _0x45e51f=_0x2ee5[_0x2e079d];return _0x45e51f;};'use strict';var Sequelize=require(_0x52ee('0x0'));module[_0x52ee('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe3fe=['sequelize','exports'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xe3fe,0xbe));var _0xee3f=function(_0x45f72f,_0x3b8581){_0x45f72f=_0x45f72f-0x0;var _0x3d03ed=_0xe3fe[_0x45f72f];return _0x3d03ed;};'use strict';var Sequelize=require(_0xee3f('0x0'));module[_0xee3f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index feecc26..feabdf0 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 _0xb5dd=['lodash','util','api','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x149041,_0x12dd17){var _0x3528d8=function(_0x5e809a){while(--_0x5e809a){_0x149041['push'](_0x149041['shift']());}};_0x3528d8(++_0x12dd17);}(_0xb5dd,0x84));var _0xdb5d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb5dd[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xdb5d('0x0'));var util=require(_0xdb5d('0x1'));var logger=require('../../config/logger')(_0xdb5d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb5d('0x3'));var rimraf=require(_0xdb5d('0x4'));var config=require(_0xdb5d('0x5'));var attributes=require(_0xdb5d('0x6'));module[_0xdb5d('0x7')]=function(_0x6d828,_0x58e3bb){return _0x6d828[_0xdb5d('0x8')](_0xdb5d('0x9'),attributes,{'tableName':_0xdb5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a9f=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x2a9f,0x15e));var _0xf2a9=function(_0x35e4b3,_0x25aa07){_0x35e4b3=_0x35e4b3-0x0;var _0x355fce=_0x2a9f[_0x35e4b3];return _0x355fce;};'use strict';var _=require(_0xf2a9('0x0'));var util=require('util');var logger=require(_0xf2a9('0x1'))(_0xf2a9('0x2'));var moment=require(_0xf2a9('0x3'));var BPromise=require(_0xf2a9('0x4'));var rp=require(_0xf2a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2a9('0x6'));var config=require(_0xf2a9('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xf2a9('0x8')]=function(_0x41bca7,_0x2d54c2){return _0x41bca7[_0xf2a9('0x9')](_0xf2a9('0xa'),attributes,{'tableName':_0xf2a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index bfd187a..bc56021 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 _0x4059=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf6e15b,_0x6a4b8){var _0x477e71=function(_0x1e79db){while(--_0x1e79db){_0xf6e15b['push'](_0xf6e15b['shift']());}};_0x477e71(++_0x6a4b8);}(_0x4059,0x126));var _0x9405=function(_0x1716da,_0x41efde){_0x1716da=_0x1716da-0x0;var _0x4f390c=_0x4059[_0x1716da];return _0x4f390c;};'use strict';var _=require(_0x9405('0x0'));var util=require(_0x9405('0x1'));var moment=require(_0x9405('0x2'));var BPromise=require(_0x9405('0x3'));var rs=require(_0x9405('0x4'));var fs=require('fs');var Redis=require(_0x9405('0x5'));var db=require(_0x9405('0x6'))['db'];var utils=require(_0x9405('0x7'));var logger=require(_0x9405('0x8'))(_0x9405('0x9'));var config=require(_0x9405('0xa'));var jayson=require(_0x9405('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x176a43,_0x4430d0,_0x2e6e49){return new BPromise(function(_0x229613,_0x5a9813){return client[_0x9405('0xc')](_0x176a43,_0x2e6e49)[_0x9405('0xd')](function(_0x583b7b){logger[_0x9405('0xe')](_0x9405('0xf'),_0x4430d0,_0x9405('0x10'));logger[_0x9405('0x11')](_0x9405('0x12'),_0x4430d0,_0x9405('0x10'),JSON[_0x9405('0x13')](_0x583b7b));if(_0x583b7b[_0x9405('0x14')]){if(_0x583b7b[_0x9405('0x14')][_0x9405('0x15')]===0x1f4){logger[_0x9405('0x14')](_0x9405('0xf'),_0x4430d0,_0x583b7b['error'][_0x9405('0x16')]);return _0x5a9813(_0x583b7b[_0x9405('0x14')]['message']);}logger[_0x9405('0x14')](_0x9405('0xf'),_0x4430d0,_0x583b7b[_0x9405('0x14')][_0x9405('0x16')]);return _0x229613(_0x583b7b['error'][_0x9405('0x16')]);}else{logger[_0x9405('0xe')](_0x9405('0xf'),_0x4430d0,_0x9405('0x10'));_0x229613(_0x583b7b[_0x9405('0x17')]['message']);}})['catch'](function(_0xa6f195){logger[_0x9405('0x14')](_0x9405('0xf'),_0x4430d0,_0xa6f195);_0x5a9813(_0xa6f195);});});} \ No newline at end of file +var _0x733a=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x2520aa,_0x5ebd42){var _0x5d0e9c=function(_0x5547f6){while(--_0x5547f6){_0x2520aa['push'](_0x2520aa['shift']());}};_0x5d0e9c(++_0x5ebd42);}(_0x733a,0x10e));var _0xa733=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x733a[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa733('0x0'));var BPromise=require(_0xa733('0x1'));var rs=require(_0xa733('0x2'));var fs=require('fs');var Redis=require(_0xa733('0x3'));var db=require(_0xa733('0x4'))['db'];var utils=require(_0xa733('0x5'));var logger=require(_0xa733('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa733('0x7'));var client=jayson['client'][_0xa733('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x183f2,_0x43d048,_0x230637){return new BPromise(function(_0x5a4b36,_0x296a18){return client[_0xa733('0x9')](_0x183f2,_0x230637)[_0xa733('0xa')](function(_0x564835){logger[_0xa733('0xb')](_0xa733('0xc'),_0x43d048,_0xa733('0xd'));logger[_0xa733('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x43d048,_0xa733('0xd'),JSON[_0xa733('0xf')](_0x564835));if(_0x564835[_0xa733('0x10')]){if(_0x564835[_0xa733('0x10')][_0xa733('0x11')]===0x1f4){logger['error'](_0xa733('0xc'),_0x43d048,_0x564835['error'][_0xa733('0x12')]);return _0x296a18(_0x564835['error'][_0xa733('0x12')]);}logger[_0xa733('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x43d048,_0x564835[_0xa733('0x10')][_0xa733('0x12')]);return _0x5a4b36(_0x564835['error']['message']);}else{logger[_0xa733('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x43d048,'request\x20sent');_0x5a4b36(_0x564835[_0xa733('0x13')][_0xa733('0x12')]);}})['catch'](function(_0x952ef0){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x43d048,_0x952ef0);_0x296a18(_0x952ef0);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index d2c5a81..1945824 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 _0x8595=['/:id/clone','addResources','put','/:id','update','delete','removeResources','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','show','/:id/sections','getSections','/:id/resources','getResources','post'];(function(_0x14bcd8,_0x233b89){var _0x188c63=function(_0x1cac1d){while(--_0x1cac1d){_0x14bcd8['push'](_0x14bcd8['shift']());}};_0x188c63(++_0x233b89);}(_0x8595,0x1b8));var _0x5859=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x8595[_0x59c301];return _0x3866b9;};'use strict';var multer=require(_0x5859('0x0'));var util=require(_0x5859('0x1'));var path=require(_0x5859('0x2'));var timeout=require('connect-timeout');var express=require(_0x5859('0x3'));var router=express[_0x5859('0x4')]();var fs_extra=require(_0x5859('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5859('0x6'));var config=require(_0x5859('0x7'));var controller=require(_0x5859('0x8'));router['get']('/',auth[_0x5859('0x9')](),controller[_0x5859('0xa')]);router[_0x5859('0xb')](_0x5859('0xc'),auth[_0x5859('0x9')](),controller['describe']);router[_0x5859('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5859('0xd')]);router['get'](_0x5859('0xe'),auth[_0x5859('0x9')](),controller[_0x5859('0xf')]);router['get'](_0x5859('0x10'),auth['isAuthenticated'](),controller[_0x5859('0x11')]);router[_0x5859('0x12')]('/',auth[_0x5859('0x9')](),controller['create']);router[_0x5859('0x12')](_0x5859('0x13'),auth[_0x5859('0x9')](),controller['clone']);router['post'](_0x5859('0xe'),auth['isAuthenticated'](),controller['addSections']);router[_0x5859('0x12')](_0x5859('0x10'),auth[_0x5859('0x9')](),controller[_0x5859('0x14')]);router[_0x5859('0x15')](_0x5859('0x16'),auth[_0x5859('0x9')](),controller[_0x5859('0x17')]);router[_0x5859('0x18')]('/:id',auth[_0x5859('0x9')](),controller['destroy']);router['delete']('/:id/sections',auth[_0x5859('0x9')](),controller['removeSections']);router['delete'](_0x5859('0x10'),auth[_0x5859('0x9')](),controller[_0x5859('0x19')]);module[_0x5859('0x1a')]=router; \ No newline at end of file +var _0x6140=['delete','/:id','destroy','removeSections','removeResources','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','describe','/:id/sections','/:id/resources','create','post','/:id/clone','clone','addResources','update'];(function(_0x31c5c1,_0x472aa9){var _0x24f84d=function(_0x3f264b){while(--_0x3f264b){_0x31c5c1['push'](_0x31c5c1['shift']());}};_0x24f84d(++_0x472aa9);}(_0x6140,0x19b));var _0x0614=function(_0x23fbf0,_0x505f60){_0x23fbf0=_0x23fbf0-0x0;var _0x443648=_0x6140[_0x23fbf0];return _0x443648;};'use strict';var multer=require(_0x0614('0x0'));var util=require('util');var path=require(_0x0614('0x1'));var timeout=require(_0x0614('0x2'));var express=require(_0x0614('0x3'));var router=express[_0x0614('0x4')]();var fs_extra=require(_0x0614('0x5'));var auth=require(_0x0614('0x6'));var interaction=require(_0x0614('0x7'));var config=require(_0x0614('0x8'));var controller=require(_0x0614('0x9'));router[_0x0614('0xa')]('/',auth[_0x0614('0xb')](),controller['index']);router[_0x0614('0xa')]('/describe',auth[_0x0614('0xb')](),controller[_0x0614('0xc')]);router[_0x0614('0xa')]('/:id',auth[_0x0614('0xb')](),controller['show']);router[_0x0614('0xa')](_0x0614('0xd'),auth[_0x0614('0xb')](),controller['getSections']);router[_0x0614('0xa')](_0x0614('0xe'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth['isAuthenticated'](),controller[_0x0614('0xf')]);router[_0x0614('0x10')](_0x0614('0x11'),auth[_0x0614('0xb')](),controller[_0x0614('0x12')]);router['post']('/:id/sections',auth[_0x0614('0xb')](),controller['addSections']);router[_0x0614('0x10')](_0x0614('0xe'),auth[_0x0614('0xb')](),controller[_0x0614('0x13')]);router['put']('/:id',auth[_0x0614('0xb')](),controller[_0x0614('0x14')]);router[_0x0614('0x15')](_0x0614('0x16'),auth['isAuthenticated'](),controller[_0x0614('0x17')]);router['delete']('/:id/sections',auth[_0x0614('0xb')](),controller[_0x0614('0x18')]);router['delete']('/:id/resources',auth['isAuthenticated'](),controller[_0x0614('0x19')]);module[_0x0614('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f5574bd..c572951 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 _0x68b8=['join','getDataValue','BOOLEAN','sequelize','exports','STRING','name','crudPermissions'];(function(_0x162892,_0x4e3564){var _0x59b69c=function(_0x2e6804){while(--_0x2e6804){_0x162892['push'](_0x162892['shift']());}};_0x59b69c(++_0x4e3564);}(_0x68b8,0x1d3));var _0x868b=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x68b8[_0x31ced5];return _0x10d9e5;};'use strict';var Sequelize=require(_0x868b('0x0'));module[_0x868b('0x1')]={'name':{'type':Sequelize[_0x868b('0x2')],'allowNull':![],'unique':_0x868b('0x3')},'crudPermissions':{'type':Sequelize[_0x868b('0x2')],'set':function(_0x515929){this['setDataValue'](_0x868b('0x4'),_0x515929?_0x515929[_0x868b('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x868b('0x4'))?this[_0x868b('0x6')](_0x868b('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x868b('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x868b('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x868b('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x868b('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x868b('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe63c=['join','getDataValue','BOOLEAN','sequelize','STRING','setDataValue'];(function(_0x3b2e83,_0x43962d){var _0x186107=function(_0x123203){while(--_0x123203){_0x3b2e83['push'](_0x3b2e83['shift']());}};_0x186107(++_0x43962d);}(_0xe63c,0x16b));var _0xce63=function(_0x22878e,_0x2a5290){_0x22878e=_0x22878e-0x0;var _0x51e0d8=_0xe63c[_0x22878e];return _0x51e0d8;};'use strict';var Sequelize=require(_0xce63('0x0'));module['exports']={'name':{'type':Sequelize[_0xce63('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xce63('0x1')],'set':function(_0x3ac5af){this[_0xce63('0x2')]('crudPermissions',_0x3ac5af?_0x3ac5af[_0xce63('0x3')](''):[]);},'get':function(){return this[_0xce63('0x4')]('crudPermissions')?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xce63('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 0b8a7e5..25c6858 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 _0x1f3f=['removeSections','getSections','enabled','includes','isEmpty','subsections','concat','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','fields','find','create','body','clone','params','get','createdAt','updatedAt','crudPermissions','omit','sequelize','UserProfileSection','autoAssociation','userProfileId','Resources','UserProfileResource','describe','addSections','transaction','sectionId','each'];(function(_0x5ed094,_0x33d348){var _0xdc45dd=function(_0x282c10){while(--_0x282c10){_0x5ed094['push'](_0x5ed094['shift']());}};_0xdc45dd(++_0x33d348);}(_0x1f3f,0x1d4));var _0xf1f3=function(_0x2f202e,_0x5ed293){_0x2f202e=_0x2f202e-0x0;var _0x398ac6=_0x1f3f[_0x2f202e];return _0x398ac6;};'use strict';var emlformat=require(_0xf1f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf1f3('0x1'));var moment=require('moment');var BPromise=require(_0xf1f3('0x2'));var Mustache=require(_0xf1f3('0x3'));var util=require(_0xf1f3('0x4'));var path=require(_0xf1f3('0x5'));var sox=require(_0xf1f3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1f3('0x7'));var _=require(_0xf1f3('0x8'));var squel=require(_0xf1f3('0x9'));var crypto=require('crypto');var jsforce=require(_0xf1f3('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf1f3('0xb'));var Papa=require('papaparse');var Redis=require(_0xf1f3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xf1f3('0xd'));var as=require(_0xf1f3('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf1f3('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xf1f3('0x10'));var db=require(_0xf1f3('0x11'))['db'];config[_0xf1f3('0x12')]=_[_0xf1f3('0x13')](config['redis'],{'host':_0xf1f3('0x14'),'port':0x18eb});var socket=require(_0xf1f3('0x15'))(new Redis(config[_0xf1f3('0x12')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x15f579,_0x42b80f){_0x42b80f=_0x42b80f||0xcc;return function(_0x42901a){if(_0x42901a){return _0x15f579[_0xf1f3('0x16')](_0x42b80f);}return _0x15f579[_0xf1f3('0x17')](_0x42b80f)[_0xf1f3('0x18')]();};}function respondWithResult(_0x23f7ca,_0x1d0b19){_0x1d0b19=_0x1d0b19||0xc8;return function(_0x2c9448){if(_0x2c9448){return _0x23f7ca[_0xf1f3('0x17')](_0x1d0b19)[_0xf1f3('0x19')](_0x2c9448);}};}function respondWithFilteredResult(_0x12a514,_0x486730){return function(_0x4b91fd){if(_0x4b91fd){var _0x481059=typeof _0x486730['offset']===_0xf1f3('0x1a')&&typeof _0x486730[_0xf1f3('0x1b')]==='undefined';var _0x12bda5=_0x4b91fd[_0xf1f3('0x1c')];var _0x5b2281=_0x481059?0x0:_0x486730['offset'];var _0x42bc3e=_0x481059?_0x4b91fd['count']:_0x486730[_0xf1f3('0x1d')]+_0x486730[_0xf1f3('0x1b')];var _0x369cb6;if(_0x42bc3e>=_0x12bda5){_0x42bc3e=_0x12bda5;_0x369cb6=0xc8;}else{_0x369cb6=0xce;}_0x12a514[_0xf1f3('0x17')](_0x369cb6);return _0x12a514[_0xf1f3('0x1e')](_0xf1f3('0x1f'),_0x5b2281+'-'+_0x42bc3e+'/'+_0x12bda5)[_0xf1f3('0x19')](_0x4b91fd);}return null;};}function patchUpdates(_0x1864a6){return function(_0x486165){try{jsonpatch[_0xf1f3('0x20')](_0x486165,_0x1864a6,!![]);}catch(_0x1cfab2){return BPromise[_0xf1f3('0x21')](_0x1cfab2);}return _0x486165[_0xf1f3('0x22')]();};}function saveUpdates(_0x481ba2,_0x53b019){return function(_0xb23cbb){if(_0xb23cbb){return _0xb23cbb[_0xf1f3('0x23')](_0x481ba2)['then'](function(_0x1235eb){return _0x1235eb;});}return null;};}function removeEntity(_0x4a453a,_0x18148a){return function(_0x2c0bc5){if(_0x2c0bc5){return _0x2c0bc5[_0xf1f3('0x24')]()['then'](function(){_0x4a453a['status'](0xcc)[_0xf1f3('0x18')]();});}};}function handleEntityNotFound(_0x1df393,_0x466daa){return function(_0x45fc9a){if(!_0x45fc9a){_0x1df393[_0xf1f3('0x16')](0x194);}return _0x45fc9a;};}function handleError(_0x105d57,_0x25ae46){_0x25ae46=_0x25ae46||0x1f4;return function(_0x35427b){logger[_0xf1f3('0x25')](_0x35427b[_0xf1f3('0x26')]);if(_0x35427b[_0xf1f3('0x27')]){delete _0x35427b[_0xf1f3('0x27')];}_0x105d57[_0xf1f3('0x17')](_0x25ae46)[_0xf1f3('0x28')](_0x35427b);};}exports[_0xf1f3('0x29')]=function(_0x1eaf9a,_0x54cadb){var _0x57781a={},_0x5d622a={},_0x2e0cba={'count':0x0,'rows':[]};var _0x50a215=_[_0xf1f3('0x2a')](db[_0xf1f3('0x2b')][_0xf1f3('0x2c')],function(_0x42a9d1){return{'name':_0x42a9d1[_0xf1f3('0x2d')],'type':_0x42a9d1[_0xf1f3('0x2e')][_0xf1f3('0x2f')]};});_0x5d622a[_0xf1f3('0x30')]=_['map'](_0x50a215,_0xf1f3('0x27'));_0x5d622a['query']=_[_0xf1f3('0x31')](_0x1eaf9a[_0xf1f3('0x32')]);_0x5d622a[_0xf1f3('0x33')]=_[_0xf1f3('0x34')](_0x5d622a[_0xf1f3('0x30')],_0x5d622a[_0xf1f3('0x32')]);_0x57781a[_0xf1f3('0x35')]=_[_0xf1f3('0x34')](_0x5d622a[_0xf1f3('0x30')],qs['fields'](_0x1eaf9a[_0xf1f3('0x32')]['fields']));_0x57781a[_0xf1f3('0x35')]=_0x57781a['attributes'][_0xf1f3('0x36')]?_0x57781a[_0xf1f3('0x35')]:_0x5d622a[_0xf1f3('0x30')];if(!_0x1eaf9a[_0xf1f3('0x32')][_0xf1f3('0x37')]('nolimit')){_0x57781a[_0xf1f3('0x1b')]=qs['limit'](_0x1eaf9a[_0xf1f3('0x32')]['limit']);_0x57781a[_0xf1f3('0x1d')]=qs[_0xf1f3('0x1d')](_0x1eaf9a[_0xf1f3('0x32')][_0xf1f3('0x1d')]);}_0x57781a[_0xf1f3('0x38')]=qs[_0xf1f3('0x39')](_0x1eaf9a['query'][_0xf1f3('0x39')]);_0x57781a[_0xf1f3('0x3a')]=qs[_0xf1f3('0x33')](_[_0xf1f3('0x3b')](_0x1eaf9a[_0xf1f3('0x32')],_0x5d622a[_0xf1f3('0x33')]),_0x50a215);if(_0x1eaf9a['query'][_0xf1f3('0x3c')]){_0x57781a[_0xf1f3('0x3a')]=_[_0xf1f3('0x3d')](_0x57781a[_0xf1f3('0x3a')],{'$or':_[_0xf1f3('0x2a')](_0x50a215,function(_0x198aa7){if(_0x198aa7['type']!==_0xf1f3('0x3e')){var _0x2b3186={};_0x2b3186[_0x198aa7[_0xf1f3('0x27')]]={'$like':'%'+_0x1eaf9a[_0xf1f3('0x32')]['filter']+'%'};return _0x2b3186;}})});}_0x57781a=_['merge']({},_0x57781a,_0x1eaf9a['options']);var _0x1de3b9={'where':_0x57781a[_0xf1f3('0x3a')]};return db[_0xf1f3('0x2b')][_0xf1f3('0x1c')](_0x1de3b9)[_0xf1f3('0x3f')](function(_0x9d029f){_0x2e0cba[_0xf1f3('0x1c')]=_0x9d029f;if(_0x1eaf9a[_0xf1f3('0x32')][_0xf1f3('0x40')]){_0x57781a[_0xf1f3('0x41')]=[{'all':!![]}];}return db['UserProfile'][_0xf1f3('0x42')](_0x57781a);})[_0xf1f3('0x3f')](function(_0x295f92){_0x2e0cba[_0xf1f3('0x43')]=_0x295f92;return _0x2e0cba;})['then'](respondWithFilteredResult(_0x54cadb,_0x57781a))[_0xf1f3('0x44')](handleError(_0x54cadb,null));};exports[_0xf1f3('0x45')]=function(_0x157989,_0x2c2d29){var _0xb944c4={'raw':![],'where':{'id':_0x157989['params']['id']}},_0x5ced54={};_0x5ced54['model']=_[_0xf1f3('0x31')](db[_0xf1f3('0x2b')][_0xf1f3('0x2c')]);_0x5ced54['query']=_[_0xf1f3('0x31')](_0x157989[_0xf1f3('0x32')]);_0x5ced54[_0xf1f3('0x33')]=_[_0xf1f3('0x34')](_0x5ced54['model'],_0x5ced54[_0xf1f3('0x32')]);_0xb944c4[_0xf1f3('0x35')]=_['intersection'](_0x5ced54[_0xf1f3('0x30')],qs[_0xf1f3('0x46')](_0x157989[_0xf1f3('0x32')][_0xf1f3('0x46')]));_0xb944c4[_0xf1f3('0x35')]=_0xb944c4[_0xf1f3('0x35')][_0xf1f3('0x36')]?_0xb944c4[_0xf1f3('0x35')]:_0x5ced54[_0xf1f3('0x30')];if(_0x157989[_0xf1f3('0x32')][_0xf1f3('0x40')]){_0xb944c4[_0xf1f3('0x41')]=[{'all':!![]}];}_0xb944c4=_[_0xf1f3('0x3d')]({},_0xb944c4,_0x157989['options']);return db['UserProfile'][_0xf1f3('0x47')](_0xb944c4)[_0xf1f3('0x3f')](handleEntityNotFound(_0x2c2d29,null))[_0xf1f3('0x3f')](respondWithResult(_0x2c2d29,null))[_0xf1f3('0x44')](handleError(_0x2c2d29,null));};exports[_0xf1f3('0x48')]=function(_0x46a9ce,_0x35bdcb){return db[_0xf1f3('0x2b')][_0xf1f3('0x48')](_0x46a9ce[_0xf1f3('0x49')],{})[_0xf1f3('0x3f')](respondWithResult(_0x35bdcb,0xc9))['catch'](handleError(_0x35bdcb,null));};exports[_0xf1f3('0x4a')]=function(_0x58f20e,_0xf39a2c){var _0x1de087={'where':{'id':_0x58f20e[_0xf1f3('0x4b')]['id']}},_0x5ba11e={};_0x5ba11e[_0xf1f3('0x30')]=_[_0xf1f3('0x31')](db[_0xf1f3('0x2b')][_0xf1f3('0x2c')]);_0x1de087[_0xf1f3('0x35')]=_[_0xf1f3('0x34')](_0x5ba11e[_0xf1f3('0x30')],qs[_0xf1f3('0x46')](_0x58f20e[_0xf1f3('0x32')][_0xf1f3('0x46')]));_0x1de087[_0xf1f3('0x35')]=_0x1de087[_0xf1f3('0x35')][_0xf1f3('0x36')]?_0x1de087[_0xf1f3('0x35')]:_0x5ba11e[_0xf1f3('0x30')];if(_0x58f20e['query']['includeAll']){_0x1de087[_0xf1f3('0x41')]=[{'all':!![]}];}_0x1de087=_[_0xf1f3('0x3d')]({},_0x1de087,_0x58f20e['options']);return db[_0xf1f3('0x2b')][_0xf1f3('0x47')](_0x1de087)[_0xf1f3('0x3f')](handleEntityNotFound(_0xf39a2c,null))['then'](function(_0x430a86){if(_0x430a86){var _0x331545=_0x430a86[_0xf1f3('0x4c')]({'plain':!![]});_0x331545=qs['omit'](_0x331545,['id',_0xf1f3('0x4d'),_0xf1f3('0x4e'),_0xf1f3('0x4f')]);_0x58f20e['body']=_[_0xf1f3('0x50')](_0x58f20e[_0xf1f3('0x49')],['id',_0xf1f3('0x4d'),_0xf1f3('0x4e')]);return db[_0xf1f3('0x51')]['transaction'](function(_0x511e3a){return db['UserProfile']['create'](_[_0xf1f3('0x3d')](_0x331545,_0x58f20e['body']),{'include':_0x58f20e['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x511e3a})[_0xf1f3('0x3f')](function(_0x3c55d3){var _0xdee1d5=_0x3c55d3[_0xf1f3('0x4c')]({'plain':!![]});return db[_0xf1f3('0x52')][_0xf1f3('0x42')]({'where':{'userProfileId':_0x58f20e[_0xf1f3('0x4b')]['id']},'raw':!![]})[_0xf1f3('0x3f')](function(_0x156365){if(_0x156365){return BPromise['each'](_0x156365,function(_0x34ad43){return new BPromise(function(_0x4a09df,_0x1ea3d2){if(_0x34ad43[_0xf1f3('0x53')]===null||_0x34ad43[_0xf1f3('0x53')]===0x1)_0x4a09df(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x34ad43['id']},'raw':!![]})[_0xf1f3('0x3f')](function(_0x1981bb){var _0x2b124d=_[_0xf1f3('0x2a')](_0x1981bb,function(_0x5dbd9b){return qs[_0xf1f3('0x50')](_0x5dbd9b,['id',_0xf1f3('0x4d'),'updatedAt','sectionId']);});_0x4a09df(_0x2b124d);})[_0xf1f3('0x44')](function(_0x32aaf0){_0x1ea3d2(_0x32aaf0);});})[_0xf1f3('0x3f')](function(_0x4053ef){var _0x4d5d5e=qs[_0xf1f3('0x50')](_0x34ad43,['id',_0xf1f3('0x4d'),_0xf1f3('0x4e')]);_0x4d5d5e[_0xf1f3('0x54')]=_0xdee1d5['id'];if(_0x4053ef)_0x4d5d5e[_0xf1f3('0x55')]=_0x4053ef;return _0x4d5d5e;})['then'](function(_0x55f7d3){return db[_0xf1f3('0x52')][_0xf1f3('0x48')](_0x55f7d3,{'include':[{'model':db[_0xf1f3('0x56')],'as':_0xf1f3('0x55')}],'raw':!![],'transaction':_0x511e3a});});})['then'](function(){return _0xdee1d5;});}});});});}})[_0xf1f3('0x3f')](respondWithResult(_0xf39a2c,0xc9))[_0xf1f3('0x44')](handleError(_0xf39a2c,null));};exports[_0xf1f3('0x23')]=function(_0x510ce7,_0x492684){if(_0x510ce7[_0xf1f3('0x49')]['id']){delete _0x510ce7[_0xf1f3('0x49')]['id'];}return db[_0xf1f3('0x2b')]['find']({'where':{'id':_0x510ce7[_0xf1f3('0x4b')]['id']}})[_0xf1f3('0x3f')](handleEntityNotFound(_0x492684,null))[_0xf1f3('0x3f')](saveUpdates(_0x510ce7[_0xf1f3('0x49')],null))[_0xf1f3('0x3f')](respondWithResult(_0x492684,null))[_0xf1f3('0x44')](handleError(_0x492684,null));};exports[_0xf1f3('0x24')]=function(_0x7c50c4,_0x2c7122){return db[_0xf1f3('0x2b')][_0xf1f3('0x47')]({'where':{'id':_0x7c50c4[_0xf1f3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c7122,null))[_0xf1f3('0x3f')](removeEntity(_0x2c7122,null))['catch'](handleError(_0x2c7122,null));};exports[_0xf1f3('0x57')]=function(_0x22172c,_0x84e977){return db[_0xf1f3('0x2b')]['describe']()[_0xf1f3('0x3f')](respondWithResult(_0x84e977,null))[_0xf1f3('0x44')](handleError(_0x84e977,null));};exports[_0xf1f3('0x58')]=function(_0x299565,_0x355592){var _0x1a1f8e=_0x299565['body'];return db[_0xf1f3('0x2b')]['find']({'where':{'id':_0x299565[_0xf1f3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x355592,null))[_0xf1f3('0x3f')](function(_0x4a92b5){if(_0x4a92b5){return db[_0xf1f3('0x51')][_0xf1f3('0x59')](function(_0x4be822){return db[_0xf1f3('0x52')]['destroy']({'where':{'userProfileId':_0x299565[_0xf1f3('0x4b')]['id'],'sectionId':_[_0xf1f3('0x2a')](_0x1a1f8e,function(_0x54a3b5){return _0x54a3b5[_0xf1f3('0x5a')];})},'transaction':_0x4be822})[_0xf1f3('0x3f')](function(){var _0x18b5a7=_[_0xf1f3('0x2a')](_0x1a1f8e,function(_0x1f1ab9){_0x1f1ab9[_0xf1f3('0x54')]=_0x299565['params']['id'];return _0x1f1ab9;});var _0x56907b=[];return BPromise[_0xf1f3('0x5b')](_0x18b5a7,function(_0x3f1472){return db[_0xf1f3('0x52')][_0xf1f3('0x48')](_0x3f1472,{'include':[{'model':db[_0xf1f3('0x56')],'as':_0xf1f3('0x55')}],'raw':!![],'transaction':_0x4be822})['then'](function(_0x356818){_0x56907b['push'](_0x356818['get']({'plain':!![]}));});})[_0xf1f3('0x3f')](function(){return _0x56907b;});});});}})['then'](function(_0x2ea8c9){return _0x2ea8c9;})[_0xf1f3('0x3f')](respondWithResult(_0x355592,null))[_0xf1f3('0x44')](handleError(_0x355592,null));};exports[_0xf1f3('0x5c')]=function(_0x1a4d45,_0x2e4356){var _0x17728f;return db['UserProfile'][_0xf1f3('0x47')]({'where':{'id':_0x1a4d45['params']['id']},'attributes':['id',_0xf1f3('0x27')]})['then'](handleEntityNotFound(_0x2e4356,null))['then'](function(_0x4bb1cc){if(_0x4bb1cc){_0x17728f=_0x4bb1cc;return db['UserProfileSection'][_0xf1f3('0x24')]({'where':{'userProfileId':_0x1a4d45['params']['id'],'sectionId':_0x1a4d45[_0xf1f3('0x32')]['ids']}});}})[_0xf1f3('0x3f')](function(){return _0x17728f;})[_0xf1f3('0x3f')](respondWithStatusCode(_0x2e4356,null))[_0xf1f3('0x44')](handleError(_0x2e4356,null));};exports[_0xf1f3('0x5d')]=function(_0x3aad74,_0x31675c){var _0x555026=[];var _0x28f313=[];return db[_0xf1f3('0x52')][_0xf1f3('0x42')]({'where':{'userProfileId':_0x3aad74['params']['id']},'raw':!![]})[_0xf1f3('0x3f')](function(_0x15663a){_0x555026=_[_0xf1f3('0x3c')](_0x15663a,function(_0x1b2b4a){return _0x1b2b4a[_0xf1f3('0x5e')]===0x1||_[_0xf1f3('0x5f')]([0x3eb,0x709],_0x1b2b4a[_0xf1f3('0x5a')]);});if(!_[_0xf1f3('0x60')](_0x555026)){return _[_0xf1f3('0x2a')](_0x555026,function(_0x571147){return _0x571147[_0xf1f3('0x5a')];});}else{return;}})[_0xf1f3('0x3f')](function(_0x1815cd){if(_0x1815cd)_0x28f313=_0x1815cd;if(_[_0xf1f3('0x5f')](_0x28f313,0x64)){var _0x235ac1=_[_0xf1f3('0x47')](_0x555026,{'sectionId':0x64});return hasDefaultDashboard(_0x235ac1)[_0xf1f3('0x3f')](function(_0x3a4b81){return _[_0xf1f3('0x2a')](_0x555026,function(_0x131c62){if(_0x131c62[_0xf1f3('0x5a')]===0x64){_0x131c62['subsections']=_0x3a4b81;}return _0x131c62;});});}else{return;}})['then'](function(_0x80ae62){if(_0x80ae62)_0x555026=_0x80ae62;if(_[_0xf1f3('0x5f')](_0x28f313,0x3eb)){var _0x2eb4b4=_[_0xf1f3('0x47')](_0x555026,{'sectionId':0x3eb});return getCustomDashboards(_0x2eb4b4)[_0xf1f3('0x3f')](function(_0x326d44){return _[_0xf1f3('0x2a')](_0x555026,function(_0x20eb2a){if(_0x2eb4b4[_0xf1f3('0x5e')]){if(_0x20eb2a[_0xf1f3('0x5a')]===0x3eb){_0x20eb2a['subsections']=_0x326d44;}}else{if(_0x20eb2a[_0xf1f3('0x5a')]===0x64){if(!_0x20eb2a[_0xf1f3('0x61')]){_0x20eb2a[_0xf1f3('0x61')]=[];}_0x20eb2a[_0xf1f3('0x61')]=_0x20eb2a[_0xf1f3('0x61')][_0xf1f3('0x62')](_0x326d44);}}return _0x20eb2a;});});}else{return;}})['then'](function(_0x2f5aeb){if(_0x2f5aeb)_0x555026=_0x2f5aeb;if(_[_0xf1f3('0x5f')](_0x28f313,0x709)){var _0x30e7c7=_[_0xf1f3('0x47')](_0x555026,{'sectionId':0x709});return getPlugins(_0x30e7c7)[_0xf1f3('0x3f')](function(_0x31b53b){if(_0x30e7c7[_0xf1f3('0x5e')]){return _['map'](_0x555026,function(_0x40b6ea){if(_0x40b6ea[_0xf1f3('0x5a')]===0x709){_0x40b6ea[_0xf1f3('0x61')]=_0x31b53b;}return _0x40b6ea;});}else{var _0x34f219={'sectionId':0x76c,'enabled':0x1,'subsections':_0x31b53b};var _0x1c14ec=_[_0xf1f3('0x2a')](_0x555026);_0x1c14ec[_0xf1f3('0x63')](_0x34f219);return _0x1c14ec;}});}else{return;}})[_0xf1f3('0x3f')](function(_0x17542c){if(_0x17542c)_0x555026=_0x17542c;return _[_0xf1f3('0x3c')](_0x555026,['enabled',0x1]);})[_0xf1f3('0x3f')](respondWithResult(_0x31675c,null))[_0xf1f3('0x44')](handleError(_0x31675c,null));};function hasDefaultDashboard(_0x4c0a25){var _0x739bf9=[0x65];return new BPromise(function(_0x3c8491,_0x54b8ce){try{if(_0x4c0a25[_0xf1f3('0x53')]){_0x3c8491(_0x739bf9);}else{return db[_0xf1f3('0x56')][_0xf1f3('0x64')]({'where':{'sectionId':_0x4c0a25['id']},'raw':!![]})[_0xf1f3('0x3f')](function(_0x463441){_0x463441?_0x3c8491(_0x739bf9):_0x3c8491();});}}catch(_0x27e6bb){_0x54b8ce(_0x27e6bb);}});}function getCustomDashboards(_0x186326){var _0x22f8e7=[];return new BPromise(function(_0x264397,_0x795adc){try{if(_0x186326[_0xf1f3('0x53')]){return db[_0xf1f3('0x65')]['findAll']({'raw':!![]})['then'](function(_0x415f99){_0x415f99[_0xf1f3('0x66')](function(_0x59b2a9){_0x22f8e7[_0xf1f3('0x63')](_0x59b2a9['id']+0x1869f);});_0x264397(_0x22f8e7);});}else{return db[_0xf1f3('0x56')]['findAll']({'where':{'sectionId':_0x186326['id']},'raw':!![]})[_0xf1f3('0x3f')](function(_0x2d7891){_0x2d7891[_0xf1f3('0x66')](function(_0x1615dd){_0x22f8e7[_0xf1f3('0x63')](_0x1615dd[_0xf1f3('0x67')]+0x1869f);});_0x264397(_0x22f8e7);});}}catch(_0x2c9ad){_0x795adc(_0x2c9ad);}});}function getPlugins(_0x14b8f7){var _0x1a3fdd=[];return new BPromise(function(_0xed41ad,_0x236c32){try{if(_0x14b8f7['autoAssociation']){return db[_0xf1f3('0x68')][_0xf1f3('0x42')]({'raw':!![]})[_0xf1f3('0x3f')](function(_0x5281b6){_0x5281b6[_0xf1f3('0x66')](function(_0x18053e){_0x1a3fdd['push'](_0x18053e['id']+0x15b38);});_0xed41ad(_0x1a3fdd);});}else{return db['UserProfileResource'][_0xf1f3('0x42')]({'where':{'sectionId':_0x14b8f7['id']},'raw':!![]})[_0xf1f3('0x3f')](function(_0x266414){_0x266414[_0xf1f3('0x66')](function(_0x15940b){_0x1a3fdd[_0xf1f3('0x63')](_0x15940b[_0xf1f3('0x67')]+0x15b38);});_0xed41ad(_0x1a3fdd);});}}catch(_0xdee716){_0x236c32(_0xdee716);}});}exports[_0xf1f3('0x69')]=function(_0x141dd7,_0x3f7702){return db[_0xf1f3('0x2b')]['find']({'where':{'id':_0x141dd7[_0xf1f3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f7702,null))[_0xf1f3('0x3f')](function(_0x38eabd){if(_0x38eabd){return db[_0xf1f3('0x51')][_0xf1f3('0x59')](function(_0x469101){return db['UserProfileSection'][_0xf1f3('0x42')]({'where':{'userProfileId':_0x141dd7['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x1942a1){if(_0x1942a1){return db['UserProfileSection'][_0xf1f3('0x24')]({'where':{'userProfileId':_0x141dd7[_0xf1f3('0x4b')]['id'],'id':_[_0xf1f3('0x2a')](_0x1942a1,function(_0x33bf0d){return _0x33bf0d['id'];})},'transaction':_0x469101});}})[_0xf1f3('0x3f')](function(_0x29b27f){var _0xba2d67=_[_0xf1f3('0x2a')](_0x141dd7['body'],function(_0xd54fd7){_0xd54fd7[_0xf1f3('0x54')]=_0x141dd7[_0xf1f3('0x4b')]['id'];return _0xd54fd7;});return db[_0xf1f3('0x52')][_0xf1f3('0x6a')](_0xba2d67,{'raw':!![],'transaction':_0x469101});})['then'](function(_0x575611){var _0x1c21fc=_['filter'](_[_0xf1f3('0x2a')](_0x575611,function(_0x4b8f65){return _0x4b8f65[_0xf1f3('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x1c21fc){return db[_0xf1f3('0x52')][_0xf1f3('0x42')]({'where':{'userProfileId':_0x141dd7[_0xf1f3('0x4b')]['id'],'sectionId':_[_0xf1f3('0x2a')](_0x1c21fc,function(_0x9b88aa){return _0x9b88aa[_0xf1f3('0x5a')];})},'attributes':['id',_0xf1f3('0x5a')],'raw':!![]})[_0xf1f3('0x3f')](function(_0x82095c){var _0x2914dc=_[_0xf1f3('0x2a')](_0x141dd7[_0xf1f3('0x49')],function(_0x3d51a1){_0x3d51a1[_0xf1f3('0x54')]=_0x141dd7['params']['id'];return _0x3d51a1;});return db[_0xf1f3('0x56')][_0xf1f3('0x6a')](_0x2914dc,{'raw':!![],'transaction':_0x469101});});}})[_0xf1f3('0x44')](handleError(_0x3f7702,null));});}})[_0xf1f3('0x3f')](function(_0x3f6eaf){var _0x1d660a=_[_0xf1f3('0x2a')](_0x3f6eaf,function(_0xa0c5ec){return _0xa0c5ec[_0xf1f3('0x4c')]({'plain':!![]});});})[_0xf1f3('0x3f')](respondWithResult(_0x3f7702,null))['catch'](handleError(_0x3f7702,null));};exports[_0xf1f3('0x6b')]=function(_0x1d075d,_0x23dd19,_0x2be46f){return db[_0xf1f3('0x2b')][_0xf1f3('0x47')]({'where':{'id':_0x1d075d[_0xf1f3('0x4b')]['id']}})[_0xf1f3('0x3f')](handleEntityNotFound(_0x23dd19,null))[_0xf1f3('0x3f')](function(_0x4f4cf3){if(_0x4f4cf3){return _0x4f4cf3[_0xf1f3('0x6b')](_0x1d075d[_0xf1f3('0x32')]['ids']);}})[_0xf1f3('0x3f')](respondWithStatusCode(_0x23dd19,null))[_0xf1f3('0x44')](handleError(_0x23dd19,null));};exports[_0xf1f3('0x6c')]=function(_0x57a118,_0x1201bb){var _0x33f162={};if(!_0x57a118['query'][_0xf1f3('0x6d')])throw new Error(_0xf1f3('0x6e'));if(!_0x57a118['query'][_0xf1f3('0x37')](_0xf1f3('0x6f'))){_0x33f162[_0xf1f3('0x1b')]=qs[_0xf1f3('0x1b')](_0x57a118[_0xf1f3('0x32')][_0xf1f3('0x1b')]);_0x33f162[_0xf1f3('0x1d')]=qs[_0xf1f3('0x1d')](_0x57a118['query'][_0xf1f3('0x1d')]);}return db[_0xf1f3('0x2b')]['find']({'where':{'id':_0x57a118['params']['id']}})[_0xf1f3('0x3f')](function(_0x125444){if(!_0x125444)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x57a118['params']['id']);return db[_0xf1f3('0x2b')]['getResources'](_0x57a118);})[_0xf1f3('0x3f')](respondWithFilteredResult(_0x1201bb,_0x33f162))[_0xf1f3('0x44')](handleError(_0x1201bb,null));}; \ No newline at end of file +var _0x21f1=['apply','reject','save','then','destroy','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','UserProfile','includeAll','include','findAll','rows','catch','show','params','options','find','body','clone','rawAttributes','get','omit','createdAt','updatedAt','crudPermissions','transaction','create','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','update','describe','addSections','sequelize','Resources','push','removeSections','ids','getSections','includes','isEmpty','enabled','subsections','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x54e9f7,_0x2499d1){var _0x3ee71a=function(_0x36fa50){while(--_0x36fa50){_0x54e9f7['push'](_0x54e9f7['shift']());}};_0x3ee71a(++_0x2499d1);}(_0x21f1,0xc3));var _0x121f=function(_0x1ff0b5,_0x1c30df){_0x1ff0b5=_0x1ff0b5-0x0;var _0x43d117=_0x21f1[_0x1ff0b5];return _0x43d117;};'use strict';var emlformat=require(_0x121f('0x0'));var rimraf=require(_0x121f('0x1'));var zipdir=require(_0x121f('0x2'));var jsonpatch=require(_0x121f('0x3'));var rp=require(_0x121f('0x4'));var moment=require(_0x121f('0x5'));var BPromise=require(_0x121f('0x6'));var Mustache=require('mustache');var util=require(_0x121f('0x7'));var path=require(_0x121f('0x8'));var sox=require(_0x121f('0x9'));var csv=require(_0x121f('0xa'));var ejs=require(_0x121f('0xb'));var fs=require('fs');var fs_extra=require(_0x121f('0xc'));var _=require(_0x121f('0xd'));var squel=require(_0x121f('0xe'));var crypto=require(_0x121f('0xf'));var jsforce=require(_0x121f('0x10'));var deskjs=require(_0x121f('0x11'));var toCsv=require('to-csv');var querystring=require(_0x121f('0x12'));var Papa=require('papaparse');var Redis=require(_0x121f('0x13'));var authService=require(_0x121f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x121f('0x15'));var hardwareService=require(_0x121f('0x16'));var logger=require(_0x121f('0x17'))(_0x121f('0x18'));var utils=require('../../config/utils');var config=require(_0x121f('0x19'));var licenseUtil=require(_0x121f('0x1a'));var db=require(_0x121f('0x1b'))['db'];config[_0x121f('0x1c')]=_[_0x121f('0x1d')](config[_0x121f('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x121f('0x1c')]));require(_0x121f('0x1e'))['register'](socket);function respondWithStatusCode(_0x278093,_0x380b4f){_0x380b4f=_0x380b4f||0xcc;return function(_0x124b69){if(_0x124b69){return _0x278093[_0x121f('0x1f')](_0x380b4f);}return _0x278093[_0x121f('0x20')](_0x380b4f)[_0x121f('0x21')]();};}function respondWithResult(_0x438a7b,_0x234fb0){_0x234fb0=_0x234fb0||0xc8;return function(_0x4cec2b){if(_0x4cec2b){return _0x438a7b[_0x121f('0x20')](_0x234fb0)[_0x121f('0x22')](_0x4cec2b);}};}function respondWithFilteredResult(_0x2572e9,_0x59e017){return function(_0x5f4d4d){if(_0x5f4d4d){var _0x12ec95=typeof _0x59e017[_0x121f('0x23')]===_0x121f('0x24')&&typeof _0x59e017[_0x121f('0x25')]===_0x121f('0x24');var _0x51e315=_0x5f4d4d[_0x121f('0x26')];var _0xb3f8cf=_0x12ec95?0x0:_0x59e017[_0x121f('0x23')];var _0x23a8d2=_0x12ec95?_0x5f4d4d['count']:_0x59e017[_0x121f('0x23')]+_0x59e017[_0x121f('0x25')];var _0xcd73a;if(_0x23a8d2>=_0x51e315){_0x23a8d2=_0x51e315;_0xcd73a=0xc8;}else{_0xcd73a=0xce;}_0x2572e9[_0x121f('0x20')](_0xcd73a);return _0x2572e9[_0x121f('0x27')](_0x121f('0x28'),_0xb3f8cf+'-'+_0x23a8d2+'/'+_0x51e315)[_0x121f('0x22')](_0x5f4d4d);}return null;};}function patchUpdates(_0x19bab0){return function(_0xaba9c8){try{jsonpatch[_0x121f('0x29')](_0xaba9c8,_0x19bab0,!![]);}catch(_0x198880){return BPromise[_0x121f('0x2a')](_0x198880);}return _0xaba9c8[_0x121f('0x2b')]();};}function saveUpdates(_0x121841,_0x555d7d){return function(_0x5d544e){if(_0x5d544e){return _0x5d544e['update'](_0x121841)[_0x121f('0x2c')](function(_0xe54ead){return _0xe54ead;});}return null;};}function removeEntity(_0x3e9045,_0x51b78e){return function(_0x49a81d){if(_0x49a81d){return _0x49a81d[_0x121f('0x2d')]()[_0x121f('0x2c')](function(){_0x3e9045[_0x121f('0x20')](0xcc)[_0x121f('0x21')]();});}};}function handleEntityNotFound(_0x557c23,_0x2a6dfb){return function(_0x2d9007){if(!_0x2d9007){_0x557c23[_0x121f('0x1f')](0x194);}return _0x2d9007;};}function handleError(_0x54c18d,_0x560c4d){_0x560c4d=_0x560c4d||0x1f4;return function(_0x3e065d){logger[_0x121f('0x2e')](_0x3e065d[_0x121f('0x2f')]);if(_0x3e065d['name']){delete _0x3e065d[_0x121f('0x30')];}_0x54c18d[_0x121f('0x20')](_0x560c4d)[_0x121f('0x31')](_0x3e065d);};}exports['index']=function(_0x34c09a,_0x4ace4a){var _0x340c6d={},_0x120361={},_0x12ac37={'count':0x0,'rows':[]};var _0x55293f=_['map'](db['UserProfile']['rawAttributes'],function(_0x5c6dfc){return{'name':_0x5c6dfc[_0x121f('0x32')],'type':_0x5c6dfc[_0x121f('0x33')][_0x121f('0x34')]};});_0x120361[_0x121f('0x35')]=_[_0x121f('0x36')](_0x55293f,_0x121f('0x30'));_0x120361[_0x121f('0x37')]=_[_0x121f('0x38')](_0x34c09a[_0x121f('0x37')]);_0x120361[_0x121f('0x39')]=_[_0x121f('0x3a')](_0x120361['model'],_0x120361[_0x121f('0x37')]);_0x340c6d[_0x121f('0x3b')]=_[_0x121f('0x3a')](_0x120361[_0x121f('0x35')],qs[_0x121f('0x3c')](_0x34c09a[_0x121f('0x37')][_0x121f('0x3c')]));_0x340c6d[_0x121f('0x3b')]=_0x340c6d[_0x121f('0x3b')][_0x121f('0x3d')]?_0x340c6d['attributes']:_0x120361[_0x121f('0x35')];if(!_0x34c09a[_0x121f('0x37')]['hasOwnProperty'](_0x121f('0x3e'))){_0x340c6d[_0x121f('0x25')]=qs['limit'](_0x34c09a[_0x121f('0x37')]['limit']);_0x340c6d[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x34c09a['query'][_0x121f('0x23')]);}_0x340c6d[_0x121f('0x3f')]=qs['sort'](_0x34c09a[_0x121f('0x37')][_0x121f('0x40')]);_0x340c6d[_0x121f('0x41')]=qs[_0x121f('0x39')](_[_0x121f('0x42')](_0x34c09a[_0x121f('0x37')],_0x120361['filters']),_0x55293f);if(_0x34c09a[_0x121f('0x37')][_0x121f('0x43')]){_0x340c6d[_0x121f('0x41')]=_[_0x121f('0x44')](_0x340c6d[_0x121f('0x41')],{'$or':_[_0x121f('0x36')](_0x55293f,function(_0x2d27b3){if(_0x2d27b3[_0x121f('0x33')]!==_0x121f('0x45')){var _0x258097={};_0x258097[_0x2d27b3[_0x121f('0x30')]]={'$like':'%'+_0x34c09a['query'][_0x121f('0x43')]+'%'};return _0x258097;}})});}_0x340c6d=_['merge']({},_0x340c6d,_0x34c09a['options']);var _0x49c3fd={'where':_0x340c6d[_0x121f('0x41')]};return db[_0x121f('0x46')][_0x121f('0x26')](_0x49c3fd)[_0x121f('0x2c')](function(_0x3b56eb){_0x12ac37[_0x121f('0x26')]=_0x3b56eb;if(_0x34c09a['query'][_0x121f('0x47')]){_0x340c6d[_0x121f('0x48')]=[{'all':!![]}];}return db[_0x121f('0x46')][_0x121f('0x49')](_0x340c6d);})[_0x121f('0x2c')](function(_0x1488dc){_0x12ac37[_0x121f('0x4a')]=_0x1488dc;return _0x12ac37;})['then'](respondWithFilteredResult(_0x4ace4a,_0x340c6d))[_0x121f('0x4b')](handleError(_0x4ace4a,null));};exports[_0x121f('0x4c')]=function(_0x1a19e4,_0x541887){var _0x472f2c={'raw':![],'where':{'id':_0x1a19e4[_0x121f('0x4d')]['id']}},_0x480661={};_0x480661[_0x121f('0x35')]=_[_0x121f('0x38')](db[_0x121f('0x46')]['rawAttributes']);_0x480661[_0x121f('0x37')]=_[_0x121f('0x38')](_0x1a19e4[_0x121f('0x37')]);_0x480661[_0x121f('0x39')]=_[_0x121f('0x3a')](_0x480661[_0x121f('0x35')],_0x480661[_0x121f('0x37')]);_0x472f2c['attributes']=_['intersection'](_0x480661[_0x121f('0x35')],qs[_0x121f('0x3c')](_0x1a19e4['query'][_0x121f('0x3c')]));_0x472f2c[_0x121f('0x3b')]=_0x472f2c['attributes'][_0x121f('0x3d')]?_0x472f2c[_0x121f('0x3b')]:_0x480661[_0x121f('0x35')];if(_0x1a19e4[_0x121f('0x37')][_0x121f('0x47')]){_0x472f2c[_0x121f('0x48')]=[{'all':!![]}];}_0x472f2c=_['merge']({},_0x472f2c,_0x1a19e4[_0x121f('0x4e')]);return db[_0x121f('0x46')][_0x121f('0x4f')](_0x472f2c)[_0x121f('0x2c')](handleEntityNotFound(_0x541887,null))[_0x121f('0x2c')](respondWithResult(_0x541887,null))[_0x121f('0x4b')](handleError(_0x541887,null));};exports['create']=function(_0x1cf554,_0x564de4){return db[_0x121f('0x46')]['create'](_0x1cf554[_0x121f('0x50')],{})[_0x121f('0x2c')](respondWithResult(_0x564de4,0xc9))[_0x121f('0x4b')](handleError(_0x564de4,null));};exports[_0x121f('0x51')]=function(_0x4d3460,_0x5729d3){var _0x27ffc1={'where':{'id':_0x4d3460[_0x121f('0x4d')]['id']}},_0x3e1af5={};_0x3e1af5[_0x121f('0x35')]=_[_0x121f('0x38')](db['UserProfile'][_0x121f('0x52')]);_0x27ffc1['attributes']=_[_0x121f('0x3a')](_0x3e1af5[_0x121f('0x35')],qs[_0x121f('0x3c')](_0x4d3460[_0x121f('0x37')][_0x121f('0x3c')]));_0x27ffc1['attributes']=_0x27ffc1['attributes'][_0x121f('0x3d')]?_0x27ffc1['attributes']:_0x3e1af5[_0x121f('0x35')];if(_0x4d3460[_0x121f('0x37')]['includeAll']){_0x27ffc1[_0x121f('0x48')]=[{'all':!![]}];}_0x27ffc1=_['merge']({},_0x27ffc1,_0x4d3460[_0x121f('0x4e')]);return db[_0x121f('0x46')][_0x121f('0x4f')](_0x27ffc1)[_0x121f('0x2c')](handleEntityNotFound(_0x5729d3,null))[_0x121f('0x2c')](function(_0x19b77c){if(_0x19b77c){var _0x51de5e=_0x19b77c[_0x121f('0x53')]({'plain':!![]});_0x51de5e=qs[_0x121f('0x54')](_0x51de5e,['id',_0x121f('0x55'),_0x121f('0x56'),_0x121f('0x57')]);_0x4d3460['body']=_[_0x121f('0x54')](_0x4d3460[_0x121f('0x50')],['id',_0x121f('0x55'),_0x121f('0x56')]);return db['sequelize'][_0x121f('0x58')](function(_0x141cb1){return db[_0x121f('0x46')][_0x121f('0x59')](_['merge'](_0x51de5e,_0x4d3460['body']),{'include':_0x4d3460['query'][_0x121f('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x141cb1})[_0x121f('0x2c')](function(_0x24c69e){var _0x3fa871=_0x24c69e[_0x121f('0x53')]({'plain':!![]});return db[_0x121f('0x5a')][_0x121f('0x49')]({'where':{'userProfileId':_0x4d3460[_0x121f('0x4d')]['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x51b9bd){if(_0x51b9bd){return BPromise[_0x121f('0x5b')](_0x51b9bd,function(_0x585084){return new BPromise(function(_0x2ea6fd,_0x28d5ec){if(_0x585084['autoAssociation']===null||_0x585084[_0x121f('0x5c')]===0x1)_0x2ea6fd(null);return db[_0x121f('0x5d')][_0x121f('0x49')]({'where':{'sectionId':_0x585084['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x26f9e6){var _0x45acee=_['map'](_0x26f9e6,function(_0x5c804e){return qs[_0x121f('0x54')](_0x5c804e,['id',_0x121f('0x55'),_0x121f('0x56'),_0x121f('0x5e')]);});_0x2ea6fd(_0x45acee);})[_0x121f('0x4b')](function(_0x25b834){_0x28d5ec(_0x25b834);});})[_0x121f('0x2c')](function(_0x459b32){var _0x38cc3b=qs[_0x121f('0x54')](_0x585084,['id','createdAt',_0x121f('0x56')]);_0x38cc3b[_0x121f('0x5f')]=_0x3fa871['id'];if(_0x459b32)_0x38cc3b['Resources']=_0x459b32;return _0x38cc3b;})['then'](function(_0x4d71f2){return db['UserProfileSection'][_0x121f('0x59')](_0x4d71f2,{'include':[{'model':db[_0x121f('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x141cb1});});})[_0x121f('0x2c')](function(){return _0x3fa871;});}});});});}})['then'](respondWithResult(_0x5729d3,0xc9))[_0x121f('0x4b')](handleError(_0x5729d3,null));};exports[_0x121f('0x60')]=function(_0x254815,_0x5925f3){if(_0x254815[_0x121f('0x50')]['id']){delete _0x254815['body']['id'];}return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x254815[_0x121f('0x4d')]['id']}})[_0x121f('0x2c')](handleEntityNotFound(_0x5925f3,null))[_0x121f('0x2c')](saveUpdates(_0x254815[_0x121f('0x50')],null))[_0x121f('0x2c')](respondWithResult(_0x5925f3,null))[_0x121f('0x4b')](handleError(_0x5925f3,null));};exports['destroy']=function(_0x5514d2,_0x3245c7){return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x5514d2[_0x121f('0x4d')]['id']}})[_0x121f('0x2c')](handleEntityNotFound(_0x3245c7,null))[_0x121f('0x2c')](removeEntity(_0x3245c7,null))[_0x121f('0x4b')](handleError(_0x3245c7,null));};exports[_0x121f('0x61')]=function(_0x3603ab,_0x42965a){return db['UserProfile'][_0x121f('0x61')]()['then'](respondWithResult(_0x42965a,null))['catch'](handleError(_0x42965a,null));};exports[_0x121f('0x62')]=function(_0x19135f,_0x4feb8e){var _0x3224b4=_0x19135f[_0x121f('0x50')];return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x19135f[_0x121f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4feb8e,null))['then'](function(_0x45e8d0){if(_0x45e8d0){return db[_0x121f('0x63')][_0x121f('0x58')](function(_0x5b2cd3){return db['UserProfileSection'][_0x121f('0x2d')]({'where':{'userProfileId':_0x19135f[_0x121f('0x4d')]['id'],'sectionId':_[_0x121f('0x36')](_0x3224b4,function(_0x2aa56b){return _0x2aa56b[_0x121f('0x5e')];})},'transaction':_0x5b2cd3})[_0x121f('0x2c')](function(){var _0xb0e3f5=_[_0x121f('0x36')](_0x3224b4,function(_0x16d5ac){_0x16d5ac[_0x121f('0x5f')]=_0x19135f[_0x121f('0x4d')]['id'];return _0x16d5ac;});var _0x298a8f=[];return BPromise[_0x121f('0x5b')](_0xb0e3f5,function(_0x5b63e7){return db['UserProfileSection'][_0x121f('0x59')](_0x5b63e7,{'include':[{'model':db[_0x121f('0x5d')],'as':_0x121f('0x64')}],'raw':!![],'transaction':_0x5b2cd3})[_0x121f('0x2c')](function(_0x56a3c1){_0x298a8f[_0x121f('0x65')](_0x56a3c1[_0x121f('0x53')]({'plain':!![]}));});})['then'](function(){return _0x298a8f;});});});}})['then'](function(_0x3b2f39){return _0x3b2f39;})[_0x121f('0x2c')](respondWithResult(_0x4feb8e,null))[_0x121f('0x4b')](handleError(_0x4feb8e,null));};exports[_0x121f('0x66')]=function(_0x4f0c05,_0x3b3c47){var _0x39b13a;return db['UserProfile'][_0x121f('0x4f')]({'where':{'id':_0x4f0c05[_0x121f('0x4d')]['id']},'attributes':['id',_0x121f('0x30')]})['then'](handleEntityNotFound(_0x3b3c47,null))['then'](function(_0xb7340c){if(_0xb7340c){_0x39b13a=_0xb7340c;return db[_0x121f('0x5a')][_0x121f('0x2d')]({'where':{'userProfileId':_0x4f0c05[_0x121f('0x4d')]['id'],'sectionId':_0x4f0c05[_0x121f('0x37')][_0x121f('0x67')]}});}})[_0x121f('0x2c')](function(){return _0x39b13a;})['then'](respondWithStatusCode(_0x3b3c47,null))[_0x121f('0x4b')](handleError(_0x3b3c47,null));};exports[_0x121f('0x68')]=function(_0x73c672,_0x67122f){var _0x443b20=[];var _0x1a24ba=[];return db[_0x121f('0x5a')][_0x121f('0x49')]({'where':{'userProfileId':_0x73c672[_0x121f('0x4d')]['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x4d63b0){_0x443b20=_['filter'](_0x4d63b0,function(_0x121913){return _0x121913['enabled']===0x1||_[_0x121f('0x69')]([0x3eb,0x709],_0x121913[_0x121f('0x5e')]);});if(!_[_0x121f('0x6a')](_0x443b20)){return _[_0x121f('0x36')](_0x443b20,function(_0x37f8fc){return _0x37f8fc[_0x121f('0x5e')];});}else{return;}})[_0x121f('0x2c')](function(_0x120aad){if(_0x120aad)_0x1a24ba=_0x120aad;if(_['includes'](_0x1a24ba,0x64)){var _0x781084=_[_0x121f('0x4f')](_0x443b20,{'sectionId':0x64});return hasDefaultDashboard(_0x781084)[_0x121f('0x2c')](function(_0x324ac5){return _[_0x121f('0x36')](_0x443b20,function(_0x1f8382){if(_0x1f8382[_0x121f('0x5e')]===0x64){_0x1f8382['subsections']=_0x324ac5;}return _0x1f8382;});});}else{return;}})[_0x121f('0x2c')](function(_0x350252){if(_0x350252)_0x443b20=_0x350252;if(_[_0x121f('0x69')](_0x1a24ba,0x3eb)){var _0x1ddbf5=_['find'](_0x443b20,{'sectionId':0x3eb});return getCustomDashboards(_0x1ddbf5)[_0x121f('0x2c')](function(_0x31db14){return _['map'](_0x443b20,function(_0x168969){if(_0x1ddbf5[_0x121f('0x6b')]){if(_0x168969[_0x121f('0x5e')]===0x3eb){_0x168969[_0x121f('0x6c')]=_0x31db14;}}else{if(_0x168969[_0x121f('0x5e')]===0x64){if(!_0x168969[_0x121f('0x6c')]){_0x168969['subsections']=[];}_0x168969[_0x121f('0x6c')]=_0x168969[_0x121f('0x6c')]['concat'](_0x31db14);}}return _0x168969;});});}else{return;}})[_0x121f('0x2c')](function(_0x19b0b9){if(_0x19b0b9)_0x443b20=_0x19b0b9;if(_[_0x121f('0x69')](_0x1a24ba,0x709)){var _0x34f4eb=_['find'](_0x443b20,{'sectionId':0x709});return getPlugins(_0x34f4eb)['then'](function(_0x351238){if(_0x34f4eb['enabled']){return _[_0x121f('0x36')](_0x443b20,function(_0x4414ea){if(_0x4414ea[_0x121f('0x5e')]===0x709){_0x4414ea[_0x121f('0x6c')]=_0x351238;}return _0x4414ea;});}else{var _0x4cc857={'sectionId':0x76c,'enabled':0x1,'subsections':_0x351238};var _0x15fb2f=_[_0x121f('0x36')](_0x443b20);_0x15fb2f[_0x121f('0x65')](_0x4cc857);return _0x15fb2f;}});}else{return;}})[_0x121f('0x2c')](function(_0x1938b3){if(_0x1938b3)_0x443b20=_0x1938b3;return _[_0x121f('0x43')](_0x443b20,[_0x121f('0x6b'),0x1]);})['then'](respondWithResult(_0x67122f,null))[_0x121f('0x4b')](handleError(_0x67122f,null));};function hasDefaultDashboard(_0x350606){var _0x57cce2=[0x65];return new BPromise(function(_0x4400cb,_0xf2aee0){try{if(_0x350606[_0x121f('0x5c')]){_0x4400cb(_0x57cce2);}else{return db[_0x121f('0x5d')][_0x121f('0x6d')]({'where':{'sectionId':_0x350606['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x308211){_0x308211?_0x4400cb(_0x57cce2):_0x4400cb();});}}catch(_0x5f4b2d){_0xf2aee0(_0x5f4b2d);}});}function getCustomDashboards(_0x33554c){var _0x2ee6d4=[];return new BPromise(function(_0x2ef957,_0x1e851c){try{if(_0x33554c[_0x121f('0x5c')]){return db['Dashboard'][_0x121f('0x49')]({'raw':!![]})[_0x121f('0x2c')](function(_0x1ebb0d){_0x1ebb0d[_0x121f('0x6e')](function(_0x34eaf8){_0x2ee6d4[_0x121f('0x65')](_0x34eaf8['id']+0x1869f);});_0x2ef957(_0x2ee6d4);});}else{return db['UserProfileResource'][_0x121f('0x49')]({'where':{'sectionId':_0x33554c['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x437837){_0x437837[_0x121f('0x6e')](function(_0x497296){_0x2ee6d4['push'](_0x497296[_0x121f('0x6f')]+0x1869f);});_0x2ef957(_0x2ee6d4);});}}catch(_0x3348b8){_0x1e851c(_0x3348b8);}});}function getPlugins(_0x359faf){var _0x292833=[];return new BPromise(function(_0x582e7a,_0x2150a3){try{if(_0x359faf[_0x121f('0x5c')]){return db['Plugin']['findAll']({'raw':!![]})[_0x121f('0x2c')](function(_0xfd73dd){_0xfd73dd['forEach'](function(_0x299c53){_0x292833[_0x121f('0x65')](_0x299c53['id']+0x15b38);});_0x582e7a(_0x292833);});}else{return db[_0x121f('0x5d')][_0x121f('0x49')]({'where':{'sectionId':_0x359faf['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x1c6c14){_0x1c6c14[_0x121f('0x6e')](function(_0x13991b){_0x292833['push'](_0x13991b['resourceId']+0x15b38);});_0x582e7a(_0x292833);});}}catch(_0x405077){_0x2150a3(_0x405077);}});}exports[_0x121f('0x70')]=function(_0x14da2b,_0x38e4cf){return db['UserProfile']['find']({'where':{'id':_0x14da2b[_0x121f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x38e4cf,null))['then'](function(_0x55e991){if(_0x55e991){return db['sequelize'][_0x121f('0x58')](function(_0x185b9c){return db[_0x121f('0x5a')]['findAll']({'where':{'userProfileId':_0x14da2b['params']['id']},'attributes':['id'],'raw':!![]})[_0x121f('0x2c')](function(_0x27e0b5){if(_0x27e0b5){return db['UserProfileSection'][_0x121f('0x2d')]({'where':{'userProfileId':_0x14da2b[_0x121f('0x4d')]['id'],'id':_['map'](_0x27e0b5,function(_0x5d4cfd){return _0x5d4cfd['id'];})},'transaction':_0x185b9c});}})['then'](function(_0x53c58d){var _0x58c265=_['map'](_0x14da2b[_0x121f('0x50')],function(_0x1bb7ad){_0x1bb7ad[_0x121f('0x5f')]=_0x14da2b[_0x121f('0x4d')]['id'];return _0x1bb7ad;});return db['UserProfileSection'][_0x121f('0x71')](_0x58c265,{'raw':!![],'transaction':_0x185b9c});})[_0x121f('0x2c')](function(_0x26fc25){var _0x5690f4=_['filter'](_[_0x121f('0x36')](_0x26fc25,function(_0x3380e0){return _0x3380e0['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5690f4){return db[_0x121f('0x5a')]['findAll']({'where':{'userProfileId':_0x14da2b[_0x121f('0x4d')]['id'],'sectionId':_[_0x121f('0x36')](_0x5690f4,function(_0x179281){return _0x179281[_0x121f('0x5e')];})},'attributes':['id',_0x121f('0x5e')],'raw':!![]})[_0x121f('0x2c')](function(_0x380388){var _0x48a6cc=_[_0x121f('0x36')](_0x14da2b[_0x121f('0x50')],function(_0x2789d3){_0x2789d3['userProfileId']=_0x14da2b['params']['id'];return _0x2789d3;});return db[_0x121f('0x5d')][_0x121f('0x71')](_0x48a6cc,{'raw':!![],'transaction':_0x185b9c});});}})[_0x121f('0x4b')](handleError(_0x38e4cf,null));});}})[_0x121f('0x2c')](function(_0x5919e3){var _0x4561f2=_[_0x121f('0x36')](_0x5919e3,function(_0x7e681d){return _0x7e681d[_0x121f('0x53')]({'plain':!![]});});})['then'](respondWithResult(_0x38e4cf,null))[_0x121f('0x4b')](handleError(_0x38e4cf,null));};exports[_0x121f('0x72')]=function(_0x400840,_0x215d38,_0xdb1651){return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x400840[_0x121f('0x4d')]['id']}})[_0x121f('0x2c')](handleEntityNotFound(_0x215d38,null))[_0x121f('0x2c')](function(_0x4ce968){if(_0x4ce968){return _0x4ce968[_0x121f('0x72')](_0x400840['query'][_0x121f('0x67')]);}})[_0x121f('0x2c')](respondWithStatusCode(_0x215d38,null))['catch'](handleError(_0x215d38,null));};exports[_0x121f('0x73')]=function(_0x3e1b13,_0x160c00){var _0x5ce42e={};if(!_0x3e1b13[_0x121f('0x37')]['section'])throw new Error(_0x121f('0x74'));if(!_0x3e1b13['query']['hasOwnProperty'](_0x121f('0x3e'))){_0x5ce42e[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x3e1b13[_0x121f('0x37')]['limit']);_0x5ce42e[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x3e1b13[_0x121f('0x37')][_0x121f('0x23')]);}return db['UserProfile'][_0x121f('0x4f')]({'where':{'id':_0x3e1b13[_0x121f('0x4d')]['id']}})['then'](function(_0x3e580b){if(!_0x3e580b)throw new Error(_0x121f('0x75')+_0x3e1b13[_0x121f('0x4d')]['id']);return db[_0x121f('0x46')][_0x121f('0x73')](_0x3e1b13);})[_0x121f('0x2c')](respondWithFilteredResult(_0x160c00,_0x5ce42e))['catch'](handleError(_0x160c00,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index ae33cf0..0f6a808 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 _0xaf5a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','UserProfile'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0xaf5a,0x116));var _0xaaf5=function(_0x2f31b1,_0x17daa8){_0x2f31b1=_0x2f31b1-0x0;var _0x448988=_0xaf5a[_0x2f31b1];return _0x448988;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xaaf5('0x0'))['db'][_0xaaf5('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaaf5('0x2')](0x0);var events={'afterCreate':_0xaaf5('0x3'),'afterUpdate':_0xaaf5('0x4'),'afterDestroy':_0xaaf5('0x5')};function emitEvent(_0x5c55af){return function(_0x1bdf16,_0x4ae9ed,_0x23fbd9){UserProfileEvents[_0xaaf5('0x6')](_0x5c55af+':'+_0x1bdf16['id'],_0x1bdf16);UserProfileEvents[_0xaaf5('0x6')](_0x5c55af,_0x1bdf16);_0x23fbd9(null);};}for(var e in events){if(events[_0xaaf5('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x4753=['update','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','save'];(function(_0x18b493,_0x1c38c7){var _0x7d9003=function(_0x3760f1){while(--_0x3760f1){_0x18b493['push'](_0x18b493['shift']());}};_0x7d9003(++_0x1c38c7);}(_0x4753,0x1f4));var _0x3475=function(_0x58b575,_0x3d1be9){_0x58b575=_0x58b575-0x0;var _0x38eda5=_0x4753[_0x58b575];return _0x38eda5;};'use strict';var EventEmitter=require(_0x3475('0x0'));var UserProfile=require(_0x3475('0x1'))['db'][_0x3475('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3475('0x3'),'afterUpdate':_0x3475('0x4'),'afterDestroy':'remove'};function emitEvent(_0x212d98){return function(_0x4c6fd2,_0x5a801b,_0x5de37e){UserProfileEvents['emit'](_0x212d98+':'+_0x4c6fd2['id'],_0x4c6fd2);UserProfileEvents[_0x3475('0x5')](_0x212d98,_0x4c6fd2);_0x5de37e(null);};}for(var e in events){if(events[_0x3475('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x3475('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 9d98bd9..cdb4d1a 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 _0x48ad=['QueueCampaigns','outbound','musiconholds','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','AnalyticExtractedReport','reportId','metrics','AnalyticMetric','charAt','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','where','sequelize','query','toString','OpenTabs','raw','section','mergeResources','isEmpty','length','push','UserProfileSection','find','all','ignore','union','rawAttributes','keys','intersection','attributes','fields','limit','offset','order','sort','filters','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','resourceId','squareprojects','childModel','squarerecordings','SquareRecording','parentSections','projectName','JscriptyProject','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','type','inbound'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x48ad,0x13d));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd48a('0x0'));var attributes=require(_0xd48a('0x1'));var squel=require(_0xd48a('0x2'));module[_0xd48a('0x3')]=function(_0x135e0b){var _0x54ff1d=_0x135e0b[_0xd48a('0x4')];function _0x539290(_0x482277,_0x275bae){return new Promise(function(_0xd5da39,_0x4473ec){if(!_0x275bae)return _0xd5da39(null);var _0x2dc7a4=_0x275bae[_0xd48a('0x5')]?{[_0x275bae[_0xd48a('0x5')][_0xd48a('0x6')]]:_0x275bae[_0xd48a('0x5')][_0xd48a('0x7')]}:undefined;return _0x54ff1d[_0x482277][_0xd48a('0x8')]({'where':_0x2dc7a4,'raw':!![]})[_0xd48a('0x9')](function(_0x2683f7){_0x275bae[_0xd48a('0xa')]=_[_0xd48a('0xb')](_0x2683f7,'id');_0xd5da39(_0x275bae);})[_0xd48a('0xc')](function(_0x418b66){_0x4473ec(_0x418b66);});});}function _0x5bc0ee(_0x54ac2a,_0x3de411){return new Promise(function(_0x2cdbb5,_0x33ec72){var _0x49ebfd=_0x54ac2a[_0xd48a('0x5')]?{[_0x54ac2a['filter'][_0xd48a('0x6')]]:_0x54ac2a[_0xd48a('0x5')][_0xd48a('0x7')]}:undefined;return _0x54ff1d[_0x54ac2a[_0xd48a('0xd')]][_0xd48a('0x8')]({'where':_0x49ebfd,'raw':!![]})['then'](function(_0x2a2763){_0x3de411['associatedResources']=_[_0xd48a('0xb')](_0x2a2763,function(_0x1bf686){return _0x1bf686[_0xd48a('0xe')];});_0x2cdbb5(_0x3de411);})['catch'](function(_0x26c87a){_0x33ec72(_0x26c87a);});});}function _0xde314a(_0x35038e,_0x180b2f,_0x41008c){if(!_0x180b2f)return Promise[_0xd48a('0xf')](null);return new Promise(function(_0x405724,_0x15230c){return _0x54ff1d[_0xd48a('0x10')][_0xd48a('0x8')]({'where':{'sectionId':_0x180b2f['id']},'raw':!![]})['then'](function(_0x12473f){if(_0x35038e[_0xd48a('0x6')]&&_0x35038e[_0xd48a('0x6')]!=='id'){_0x180b2f[_0xd48a('0xa')]=_[_0xd48a('0xb')](_0x12473f,function(_0x204150){return _0x204150[_0x35038e[_0xd48a('0x6')]];});}else{if(_0x41008c==='AnalyticExtractedReport'){_0x180b2f[_0xd48a('0xa')]=_[_0xd48a('0xb')](_0x12473f,function(_0x44302f){return{'id':_0x44302f[_0xd48a('0x11')],'type':_0x44302f['type']};});}else{_0x180b2f[_0xd48a('0xa')]=_[_0xd48a('0xb')](_0x12473f,function(_0x4ba43a){return _0x4ba43a[_0xd48a('0x11')];});}}_0x405724(_0x180b2f);})[_0xd48a('0xc')](function(_0x42971a){_0x15230c(_0x42971a);});});}function _0x3cdc52(_0x5bbf74,_0x362c14){var _0x29dda6={'parentSections':[]};switch(_0x5bbf74['toLowerCase']()){case _0xd48a('0x12'):_0x29dda6[_0xd48a('0x13')]='SquareProject';break;case'odbc':_0x29dda6['childModel']='SquareOdbc';break;case _0xd48a('0x14'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x15');_0x29dda6[_0xd48a('0x16')]=[{'name':'SquareProjects','field':_0xd48a('0xe'),'foreignKey':_0xd48a('0x17')}];break;case'projects':_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x18');break;case'contacts':_0x29dda6['childModel']=_0xd48a('0x19');_0x29dda6[_0xd48a('0x16')]=[{'name':_0xd48a('0x1a'),'field':'id','foreignKey':_0xd48a('0x1b')}];break;case _0xd48a('0x1c'):_0x29dda6['childModel']=_0xd48a('0x1d');break;case _0xd48a('0x1e'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x1f');break;case _0xd48a('0x20'):_0x29dda6[_0xd48a('0x13')]='CmCustomField';break;case _0xd48a('0x21'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x22');break;case _0xd48a('0x23'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x24');break;case'faxqueues':_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x25');break;case _0xd48a('0x26'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x27');break;case _0xd48a('0x28'):case _0xd48a('0x29'):case _0xd48a('0x2a'):_0x29dda6['childModel']=_0xd48a('0x2b');break;case'contexts':_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x2c');break;case _0xd48a('0x2d'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x2e');break;case'voicerecordings':_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x2f');_0x29dda6[_0xd48a('0x16')]=[{'name':_0xd48a('0x30'),'field':_0xd48a('0xe'),'foreignKey':_0xd48a('0x31'),'model':_0xd48a('0x32'),'filter':{'field':_0xd48a('0x33'),'value':['agent']}},{'name':_0xd48a('0x34'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':_0xd48a('0x33'),'value':[_0xd48a('0x35')]}},{'name':_0xd48a('0x36'),'field':'name','foreignKey':_0xd48a('0x37'),'model':_0xd48a('0x38'),'filter':{'field':_0xd48a('0x39'),'value':[_0xd48a('0x3a')]}},{'name':_0xd48a('0x3b'),'field':_0xd48a('0xe'),'foreignKey':_0xd48a('0x37'),'model':_0xd48a('0x38'),'filter':{'field':'type','value':[_0xd48a('0x3c')]}}];break;case _0xd48a('0x3d'):_0x29dda6[_0xd48a('0x13')]='VoiceMusicOnHold';break;case'chanspies':_0x29dda6[_0xd48a('0x13')]='VoiceChanSpy';break;case _0xd48a('0x3e'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x3f');break;case _0xd48a('0x40'):_0x29dda6['childModel']=_0xd48a('0x41');break;case'mailqueues':_0x29dda6['childModel']=_0xd48a('0x42');break;case _0xd48a('0x43'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x44');break;case _0xd48a('0x45'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x46');break;case _0xd48a('0x47'):_0x29dda6['childModel']=_0xd48a('0x48');break;case _0xd48a('0x49'):_0x29dda6[_0xd48a('0x13')]='OpenchannelAccount';break;case _0xd48a('0x4a'):_0x29dda6[_0xd48a('0x13')]='SmsQueue';break;case _0xd48a('0x4b'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x4c');break;case _0xd48a('0x4d'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x4e');break;case _0xd48a('0x4f'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x50');break;case _0xd48a('0x51'):_0x29dda6[_0xd48a('0x13')]='Team';break;case _0xd48a('0x52'):case _0xd48a('0x53'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x38');if(_0x362c14){_0x29dda6[_0xd48a('0x16')]=[{'name':'VoiceQueues'},{'name':_0xd48a('0x3b')}];}break;case _0xd48a('0x54'):case _0xd48a('0x55'):case _0xd48a('0x56'):_0x29dda6['childModel']=_0xd48a('0x32');if(_0x362c14){_0x29dda6[_0xd48a('0x16')]=[{'name':_0xd48a('0x57'),'filter':{'field':_0xd48a('0x33'),'value':['admin',_0xd48a('0x58')]},'ignore':!![]},{'name':_0xd48a('0x30')},{'name':_0xd48a('0x34')}];}break;case'zendeskaccounts':_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x59');break;case _0xd48a('0x5a'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x5b');break;case'freshdeskaccounts':_0x29dda6['childModel']=_0xd48a('0x5c');break;case _0xd48a('0x5d'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x5e');break;case _0xd48a('0x5f'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x60');break;case _0xd48a('0x61'):_0x29dda6[_0xd48a('0x13')]='ZohoAccount';break;case'vtigeraccounts':_0x29dda6['childModel']=_0xd48a('0x32');break;case'cannedanswers':_0x29dda6['childModel']=_0xd48a('0x62');break;case _0xd48a('0x63'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x64');break;case _0xd48a('0x65'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x66');break;case _0xd48a('0x67'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x68');break;case _0xd48a('0x69'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x6a');break;case'scheduler':_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x6b');break;case _0xd48a('0x6c'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x6d');break;case _0xd48a('0x6e'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x6f');break;case _0xd48a('0x70'):_0x29dda6[_0xd48a('0x13')]='Template';break;case _0xd48a('0x71'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x72');break;case _0xd48a('0x73'):_0x29dda6['childModel']=_0xd48a('0x74');break;case _0xd48a('0x75'):_0x29dda6['childModel']='Variable';break;case _0xd48a('0x76'):_0x29dda6['childModel']=_0xd48a('0x77');break;case _0xd48a('0x78'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x79');_0x29dda6[_0xd48a('0x16')]=[{'name':'Reports','field':'id','foreignKey':_0xd48a('0x7a')}];break;case _0xd48a('0x7b'):_0x29dda6[_0xd48a('0x13')]=_0xd48a('0x7c');break;}return _0x29dda6;}function _0x102f19(_0x33c115,_0x481bcb){var _0x3c717a=_0x33c115[_0xd48a('0x7d')](0x0)[_0xd48a('0x7e')]()+_0x33c115['slice'](0x1);var _0x2d07e1={'type':_0x54ff1d['Sequelize'][_0xd48a('0x7f')][_0xd48a('0x80')],'raw':!![]};return new Promise(function(_0x4e51e5,_0x2e0d06){var _0x1d590e=squel[_0xd48a('0x81')]()[_0xd48a('0x6')](_0xd48a('0x82')+_0x3c717a+_0xd48a('0x83'),'id')[_0xd48a('0x6')](_0xd48a('0x84'))['from']('user_has_'+_0x33c115+'_interactions','ui')[_0xd48a('0x85')]('ui.UserId\x20=\x20?',_0x481bcb['id']);return _0x54ff1d[_0xd48a('0x86')][_0xd48a('0x87')](_0x1d590e[_0xd48a('0x88')](),_0x2d07e1)['then'](function(_0x526e8a){_0x481bcb[_0x3c717a+_0xd48a('0x89')]=_0x526e8a;_0x4e51e5(_0x526e8a);})[_0xd48a('0xc')](function(_0x1fa4a2){_0x2e0d06(_0x1fa4a2);});});}return _0x135e0b['define']('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x147134){var _0x967d3f=require('../../components/parsers/qs');var _0x39f611={'raw':_0x147134['query'][_0xd48a('0x8a')],'where':{}};var _0x2bf92b={};var _0x4a90dd={'count':0x0,'rows':[]};var _0x4935d0=_0x147134[_0xd48a('0x87')][_0xd48a('0x8b')];var _0x276216=_0x147134[_0xd48a('0x87')][_0xd48a('0x8c')]||![];var _0x68dcae=_0x3cdc52(_0x4935d0,_0x276216);if(!_0x68dcae[_0xd48a('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x4935d0+'\x27');var _0x3713d4=[{'name':_0x4935d0}];if(!_[_0xd48a('0x8d')](_0x68dcae[_0xd48a('0x16')]))_0x3713d4=_0x68dcae[_0xd48a('0x16')];var _0x3bb9a2=[];for(var _0x253af8=0x0;_0x253af8<_0x3713d4[_0xd48a('0x8e')];_0x253af8++){_0x3bb9a2[_0xd48a('0x8f')](_0x54ff1d[_0xd48a('0x90')][_0xd48a('0x91')]({'where':{'userProfileId':_0x147134['params']['id'],'name':_0x3713d4[_0x253af8][_0xd48a('0xe')]},'raw':!![]}));}return Promise[_0xd48a('0x92')](_0x3bb9a2)[_0xd48a('0x9')](function(_0x323ef3){var _0x372bf7=_[_0xd48a('0x5')](_0x323ef3,function(_0xed78ce){return _0xed78ce?_0xed78ce:undefined;});var _0x47a522=_[_0xd48a('0x5')](_0x3713d4,[_0xd48a('0x93'),!![]]);var _0x14fb32=_[_0xd48a('0x8d')](_0x372bf7)&&_[_0xd48a('0x8d')](_0x47a522)?null:_[_0xd48a('0x94')](_0x47a522,_0x372bf7);if(!_0x14fb32)return null;var _0x32efc0=[];for(var _0x153167=0x0;_0x153167<_0x14fb32[_0xd48a('0x8e')];_0x153167++){var _0x5981b2=_[_0xd48a('0x91')](_0x3713d4,function(_0x2dc962){return _0x14fb32[_0x153167]?_0x2dc962[_0xd48a('0xe')]===_0x14fb32[_0x153167][_0xd48a('0xe')]:null;});if(_0x5981b2){if(_0x14fb32[_0x153167][_0xd48a('0x93')]){_0x32efc0[_0xd48a('0x8f')](_0x539290(_0x68dcae[_0xd48a('0x13')],_0x14fb32[_0x153167]));}else{if(!_0x14fb32[_0x153167]['autoAssociation']){_0x32efc0[_0xd48a('0x8f')](_0xde314a(_0x5981b2,_0x14fb32[_0x153167],_0x68dcae[_0xd48a('0x13')]));}else{if(_0x5981b2['model']){_0x32efc0[_0xd48a('0x8f')](_0x5bc0ee(_0x5981b2,_0x14fb32[_0x153167]));}}}}}return Promise[_0xd48a('0x92')](_0x32efc0);})[_0xd48a('0x9')](function(_0x4ab0d5){var _0x17e8b0=_0x4ab0d5;var _0x505b8b=null;if(_0x17e8b0){_0x505b8b=_0x17e8b0[_0xd48a('0x8e')]===0x1?_0x17e8b0[0x0]:null;}if(!_0x505b8b&&!_0x17e8b0)return _0x4a90dd;var _0x3c3862=_0x54ff1d[_0x68dcae[_0xd48a('0x13')]][_0xd48a('0x95')];_0x2bf92b[_0xd48a('0xd')]=_['keys'](_0x3c3862);_0x2bf92b['query']=_[_0xd48a('0x96')](_0x147134[_0xd48a('0x87')]);_0x2bf92b['filters']=_[_0xd48a('0x97')](_0x2bf92b[_0xd48a('0xd')],_0x2bf92b[_0xd48a('0x87')]);_0x39f611[_0xd48a('0x98')]=_[_0xd48a('0x97')](_0x2bf92b[_0xd48a('0xd')],_0x967d3f[_0xd48a('0x99')](_0x147134['query'][_0xd48a('0x99')]));_0x39f611[_0xd48a('0x98')]=_0x39f611[_0xd48a('0x98')]['length']?_0x39f611[_0xd48a('0x98')]:_0x2bf92b['model'];if(!_0x147134[_0xd48a('0x87')]['hasOwnProperty']('nolimit')){_0x39f611[_0xd48a('0x9a')]=_0x967d3f[_0xd48a('0x9a')](_0x147134[_0xd48a('0x87')][_0xd48a('0x9a')]);_0x39f611[_0xd48a('0x9b')]=_0x967d3f[_0xd48a('0x9b')](_0x147134[_0xd48a('0x87')][_0xd48a('0x9b')]);}_0x39f611[_0xd48a('0x9c')]=_0x967d3f['sort'](_0x147134[_0xd48a('0x87')][_0xd48a('0x9d')]);_0x39f611['where']=_0x967d3f[_0xd48a('0x9e')](_['pick'](_0x147134[_0xd48a('0x87')],_0x2bf92b['filters']));if(_0x147134[_0xd48a('0x87')][_0xd48a('0x5')]){_0x39f611[_0xd48a('0x85')]=_[_0xd48a('0x9f')](_0x39f611[_0xd48a('0x85')],{'$or':_['map'](_0x3c3862,function(_0x3eaf45){if(_0x3eaf45[_0xd48a('0x39')][_0xd48a('0xa0')]!==_0xd48a('0xa1')){var _0x3d4f07={};_0x3d4f07[_0x3eaf45['field']]={'$like':'%'+_0x147134['query'][_0xd48a('0x5')]+'%'};return _0x3d4f07;}})});}var _0x2ee3b7=[];var _0x3e3d37=null;var _0x3bddd2={};if(_0x505b8b){_0x3e3d37=_[_0xd48a('0x91')](_0x3713d4,[_0xd48a('0xe'),_0x505b8b['name']]);if(_0x3e3d37[_0xd48a('0x6')]){_0x3bddd2={};if(_0x68dcae[_0xd48a('0x13')]===_0xd48a('0x79')){_0x3bddd2[_0x3e3d37[_0xd48a('0xa2')]]=_[_0xd48a('0xb')](_0x505b8b[_0xd48a('0xa')],'id');}else{_0x3bddd2[_0x3e3d37[_0xd48a('0xa2')]]=_0x505b8b[_0xd48a('0xa')];}_0x2ee3b7[_0xd48a('0x8f')](_0x3bddd2);}else{_0x39f611['where']['id']=_0x505b8b[_0xd48a('0xa')];}}else{for(var _0x55e5c7=0x0;_0x55e5c7<_0x17e8b0['length'];_0x55e5c7++){_0x3e3d37=_[_0xd48a('0x91')](_0x3713d4,['name',_0x17e8b0[_0x55e5c7][_0xd48a('0xe')]]);if(_0x3e3d37['field']){_0x3bddd2={};_0x3bddd2[_0x3e3d37[_0xd48a('0xa2')]]=_0x17e8b0[_0x55e5c7]['associatedResources'];_0x2ee3b7[_0xd48a('0x8f')](_0x3bddd2);}else{if(!_0x39f611[_0xd48a('0x85')]['id'])_0x39f611[_0xd48a('0x85')]['id']=[];_0x17e8b0[_0x55e5c7]['associatedResources'][_0xd48a('0xa3')](function(_0xb0de67){_0x39f611[_0xd48a('0x85')]['id'][_0xd48a('0x8f')](_0xb0de67);});}}}if(!_[_0xd48a('0x8d')](_0x2ee3b7)){_0x39f611[_0xd48a('0x85')]=_[_0xd48a('0x9f')](_0x39f611['where'],{'$and':{'$or':_0x2ee3b7}});}_0x39f611=_[_0xd48a('0x9f')]({},_0x39f611,_0x147134[_0xd48a('0xa4')]);if(_0x505b8b&&!_0x505b8b[_0xd48a('0xa5')]&&_0x68dcae[_0xd48a('0x13')]===_0xd48a('0x79')){if(_0x147134[_0xd48a('0x87')][_0xd48a('0xa6')]){_0x39f611[_0xd48a('0xa7')]=[{'all':!![]}];}return _0x54ff1d[_0x68dcae[_0xd48a('0x13')]][_0xd48a('0x8')](_0x39f611)[_0xd48a('0x9')](function(_0x55af96){var _0x1e981d=[];_0x55af96[_0xd48a('0xa3')](function(_0x1dd4a2){var _0x20c277;switch(_0x1dd4a2[_0xd48a('0xa8')]){case'default':_0x20c277=_['find'](_0x505b8b[_0xd48a('0xa')],function(_0x51a73d){return _0x51a73d['id']===_0x1dd4a2[_0xd48a('0x7a')]&&_0x51a73d[_0xd48a('0x39')]===_0xd48a('0xa9');});break;case _0xd48a('0xaa'):_0x20c277=_[_0xd48a('0x91')](_0x505b8b[_0xd48a('0xa')],function(_0x310517){return _0x310517['id']===_0x1dd4a2[_0xd48a('0x7a')]&&_0x310517[_0xd48a('0x39')]===_0xd48a('0xab');});break;}if(_0x20c277)_0x1e981d['push'](_0x1dd4a2);});_0x4a90dd[_0xd48a('0xac')]=_0x1e981d[_0xd48a('0x8e')];_0x4a90dd[_0xd48a('0xad')]=_0x1e981d;return _0x4a90dd;});}else{if(!_[_0xd48a('0x8d')](_0x147134[_0xd48a('0x87')][_0xd48a('0xae')])){_0x39f611[_0xd48a('0x85')]['id']=_0x39f611['where']['id']?_[_0xd48a('0x97')](_0x39f611[_0xd48a('0x85')]['id'],_0x147134[_0xd48a('0x87')]['ids']):_0x147134['query'][_0xd48a('0xae')];if(_0x147134[_0xd48a('0x87')][_0xd48a('0xaf')]){_0x39f611['order']=_0x147134[_0xd48a('0x87')][_0xd48a('0xaf')];}}if(_0x147134[_0xd48a('0x87')][_0xd48a('0xb0')]){_0x39f611[_0xd48a('0x85')]=_['merge'](_0x39f611[_0xd48a('0x85')],{'$and':_0x147134['query']['extraQueryConditions']});}return _0x54ff1d[_0x68dcae[_0xd48a('0x13')]][_0xd48a('0xac')]({'where':_0x39f611['where']})[_0xd48a('0x9')](function(_0x6cc97f){_0x4a90dd[_0xd48a('0xac')]=_0x6cc97f;if(_0x147134[_0xd48a('0x87')][_0xd48a('0xa6')]){if(_0x68dcae[_0xd48a('0x13')]===_0xd48a('0x19')){_0x39f611[_0xd48a('0xa7')]=[{'model':_0x54ff1d[_0xd48a('0x6f')],'as':_0xd48a('0xb1'),'attributes':['id',_0xd48a('0xe'),_0xd48a('0xb2')],'required':_0x147134['query']['tag']?!![]:![]},{'model':_0x54ff1d[_0xd48a('0x6f')],'as':'ThroughTags','attributes':['id',_0xd48a('0xe'),_0xd48a('0xb2')],'through':_0x147134[_0xd48a('0x87')]['tag']?{'attributes':[],'where':{'TagId':_0x147134['query'][_0xd48a('0xb3')]||undefined}}:{},'required':_0x147134['query']['tag']?!![]:![]}];}else{_0x39f611[_0xd48a('0xa7')]=[{'all':!![]}];}}return _0x54ff1d[_0x68dcae[_0xd48a('0x13')]][_0xd48a('0x8')](_0x39f611);})[_0xd48a('0x9')](function(_0x28c510){_0x4a90dd[_0xd48a('0xad')]=_0x28c510;if(_0x4935d0==='Agents'&&_0x147134[_0xd48a('0x87')]['openTabs']===_0xd48a('0xb4')){var _0x1cdbee=[];for(var _0x4b0b59=0x0;_0x4b0b59<_0x4a90dd[_0xd48a('0xad')][_0xd48a('0x8e')];_0x4b0b59++){_0x1cdbee[_0xd48a('0x8f')](_0x102f19(_0xd48a('0xb5'),_0x4a90dd[_0xd48a('0xad')][_0x4b0b59][_0xd48a('0xb6')]));_0x1cdbee['push'](_0x102f19(_0xd48a('0xb7'),_0x4a90dd[_0xd48a('0xad')][_0x4b0b59]['dataValues']));_0x1cdbee[_0xd48a('0x8f')](_0x102f19(_0xd48a('0xb8'),_0x4a90dd[_0xd48a('0xad')][_0x4b0b59]['dataValues']));_0x1cdbee[_0xd48a('0x8f')](_0x102f19(_0xd48a('0xb9'),_0x4a90dd[_0xd48a('0xad')][_0x4b0b59][_0xd48a('0xb6')]));_0x1cdbee['push'](_0x102f19(_0xd48a('0xba'),_0x4a90dd['rows'][_0x4b0b59][_0xd48a('0xb6')]));_0x1cdbee[_0xd48a('0x8f')](_0x102f19(_0xd48a('0xbb'),_0x4a90dd[_0xd48a('0xad')][_0x4b0b59]['dataValues']));}return Promise[_0xd48a('0x92')](_0x1cdbee)[_0xd48a('0x9')](function(){return _0x4a90dd;});}return _0x4a90dd;});}});}}});}; \ No newline at end of file +var _0x6071=['custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','include','Tags','tag','ThroughTags','color','true','chat','fax','dataValues','./userProfile.attributes','squel','filter','field','value','findAll','associatedResources','model','then','map','resolve','UserProfileResource','AnalyticExtractedReport','toLowerCase','squareprojects','childModel','odbc','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsAccount','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Dashboard','intervals','pauses','sounds','Sound','tags','Tag','templates','Template','Trigger','trunks','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','catch','define','user_profiles','../../components/parsers/qs','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','ignore','union','length','push','autoAssociation','all','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','reportType','default','DefaultReports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x6071,0xcc));var _0x1607=function(_0x4f0fad,_0x30e150){_0x4f0fad=_0x4f0fad-0x0;var _0x56dda7=_0x6071[_0x4f0fad];return _0x56dda7;};'use strict';var _=require('lodash');var attributes=require(_0x1607('0x0'));var squel=require(_0x1607('0x1'));module['exports']=function(_0x56fa7f){var _0x444a28=_0x56fa7f['models'];function _0x2858e7(_0x51c1d9,_0x49d57f){return new Promise(function(_0x3d78eb,_0x59d03d){if(!_0x49d57f)return _0x3d78eb(null);var _0x5a2441=_0x49d57f[_0x1607('0x2')]?{[_0x49d57f[_0x1607('0x2')][_0x1607('0x3')]]:_0x49d57f[_0x1607('0x2')][_0x1607('0x4')]}:undefined;return _0x444a28[_0x51c1d9][_0x1607('0x5')]({'where':_0x5a2441,'raw':!![]})['then'](function(_0x32aa84){_0x49d57f[_0x1607('0x6')]=_['map'](_0x32aa84,'id');_0x3d78eb(_0x49d57f);})['catch'](function(_0x2efcfc){_0x59d03d(_0x2efcfc);});});}function _0x2e98bf(_0x4abd23,_0x8db80b){return new Promise(function(_0x34a63b,_0x5279ab){var _0x59453c=_0x4abd23[_0x1607('0x2')]?{[_0x4abd23['filter']['field']]:_0x4abd23[_0x1607('0x2')][_0x1607('0x4')]}:undefined;return _0x444a28[_0x4abd23[_0x1607('0x7')]]['findAll']({'where':_0x59453c,'raw':!![]})[_0x1607('0x8')](function(_0x2f9fd6){_0x8db80b[_0x1607('0x6')]=_[_0x1607('0x9')](_0x2f9fd6,function(_0x24b003){return _0x24b003['name'];});_0x34a63b(_0x8db80b);})['catch'](function(_0x4f6ff6){_0x5279ab(_0x4f6ff6);});});}function _0x4f360e(_0x487726,_0x47deff,_0x33d700){if(!_0x47deff)return Promise[_0x1607('0xa')](null);return new Promise(function(_0x301c12,_0x8656e){return _0x444a28[_0x1607('0xb')][_0x1607('0x5')]({'where':{'sectionId':_0x47deff['id']},'raw':!![]})[_0x1607('0x8')](function(_0x1b48a1){if(_0x487726[_0x1607('0x3')]&&_0x487726['field']!=='id'){_0x47deff[_0x1607('0x6')]=_[_0x1607('0x9')](_0x1b48a1,function(_0x58a2a4){return _0x58a2a4[_0x487726[_0x1607('0x3')]];});}else{if(_0x33d700===_0x1607('0xc')){_0x47deff[_0x1607('0x6')]=_['map'](_0x1b48a1,function(_0x4b0e70){return{'id':_0x4b0e70['resourceId'],'type':_0x4b0e70['type']};});}else{_0x47deff[_0x1607('0x6')]=_[_0x1607('0x9')](_0x1b48a1,function(_0x26f8eb){return _0x26f8eb['resourceId'];});}}_0x301c12(_0x47deff);})['catch'](function(_0x388920){_0x8656e(_0x388920);});});}function _0x254b2f(_0x354c67,_0x8de1fd){var _0x1a0376={'parentSections':[]};switch(_0x354c67[_0x1607('0xd')]()){case _0x1607('0xe'):_0x1a0376[_0x1607('0xf')]='SquareProject';break;case _0x1607('0x10'):_0x1a0376['childModel']='SquareOdbc';break;case'squarerecordings':_0x1a0376[_0x1607('0xf')]=_0x1607('0x11');_0x1a0376[_0x1607('0x12')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x1607('0x13')}];break;case _0x1607('0x14'):_0x1a0376['childModel']=_0x1607('0x15');break;case _0x1607('0x16'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x17');_0x1a0376['parentSections']=[{'name':_0x1607('0x18'),'field':'id','foreignKey':'ListId'}];break;case _0x1607('0x19'):_0x1a0376['childModel']=_0x1607('0x1a');break;case _0x1607('0x1b'):_0x1a0376['childModel']=_0x1607('0x1c');break;case _0x1607('0x1d'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x1e');break;case _0x1607('0x1f'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x20');break;case _0x1607('0x21'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x22');break;case'faxqueues':_0x1a0376[_0x1607('0xf')]=_0x1607('0x23');break;case _0x1607('0x24'):_0x1a0376['childModel']=_0x1607('0x25');break;case'inboundroutes':case _0x1607('0x26'):case _0x1607('0x27'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x28');break;case'contexts':_0x1a0376[_0x1607('0xf')]=_0x1607('0x29');break;case _0x1607('0x2a'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x2b');break;case _0x1607('0x2c'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x2d');_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x2e'),'field':_0x1607('0x2f'),'foreignKey':_0x1607('0x30'),'model':_0x1607('0x31'),'filter':{'field':_0x1607('0x32'),'value':[_0x1607('0x33')]}},{'name':_0x1607('0x34'),'field':'name','foreignKey':_0x1607('0x30'),'model':'User','filter':{'field':_0x1607('0x32'),'value':[_0x1607('0x35')]}},{'name':_0x1607('0x36'),'field':'name','foreignKey':_0x1607('0x37'),'model':_0x1607('0x38'),'filter':{'field':_0x1607('0x39'),'value':[_0x1607('0x3a')]}},{'name':_0x1607('0x3b'),'field':'name','foreignKey':_0x1607('0x37'),'model':_0x1607('0x38'),'filter':{'field':_0x1607('0x39'),'value':['outbound']}}];break;case'musiconholds':_0x1a0376[_0x1607('0xf')]=_0x1607('0x3c');break;case _0x1607('0x3d'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x3e');break;case'voiceprefixes':_0x1a0376[_0x1607('0xf')]=_0x1607('0x3f');break;case _0x1607('0x40'):_0x1a0376['childModel']=_0x1607('0x41');break;case _0x1607('0x42'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x43');break;case _0x1607('0x44'):_0x1a0376[_0x1607('0xf')]='MailAccount';break;case _0x1607('0x45'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x46');break;case _0x1607('0x47'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x48');break;case _0x1607('0x49'):_0x1a0376['childModel']=_0x1607('0x4a');break;case'smsqueues':_0x1a0376[_0x1607('0xf')]='SmsQueue';break;case'smsaccounts':_0x1a0376[_0x1607('0xf')]=_0x1607('0x4b');break;case'whatsappqueues':_0x1a0376[_0x1607('0xf')]=_0x1607('0x4c');break;case _0x1607('0x4d'):_0x1a0376['childModel']='WhatsappAccount';break;case'teams':_0x1a0376[_0x1607('0xf')]=_0x1607('0x4e');break;case _0x1607('0x4f'):case _0x1607('0x50'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x38');if(_0x8de1fd){_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x36')},{'name':_0x1607('0x3b')}];}break;case _0x1607('0x51'):case _0x1607('0x52'):case _0x1607('0x53'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x31');if(_0x8de1fd){_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x54'),'filter':{'field':'role','value':[_0x1607('0x55'),'user']},'ignore':!![]},{'name':_0x1607('0x2e')},{'name':_0x1607('0x34')}];}break;case _0x1607('0x56'):_0x1a0376['childModel']=_0x1607('0x57');break;case _0x1607('0x58'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x59');break;case _0x1607('0x5a'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x5b');break;case _0x1607('0x5c'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x5d');break;case _0x1607('0x5e'):_0x1a0376['childModel']=_0x1607('0x5f');break;case _0x1607('0x60'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x61');break;case _0x1607('0x62'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x31');break;case _0x1607('0x63'):_0x1a0376[_0x1607('0xf')]='CannedAnswer';break;case _0x1607('0x64'):_0x1a0376['childModel']='Disposition';break;case'customdashboards':_0x1a0376[_0x1607('0xf')]=_0x1607('0x65');break;case _0x1607('0x66'):_0x1a0376['childModel']='Interval';break;case _0x1607('0x67'):_0x1a0376['childModel']='Pause';break;case'scheduler':_0x1a0376[_0x1607('0xf')]='Schedule';break;case _0x1607('0x68'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x69');break;case _0x1607('0x6a'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x6b');break;case _0x1607('0x6c'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x6d');break;case'triggers':_0x1a0376[_0x1607('0xf')]=_0x1607('0x6e');break;case _0x1607('0x6f'):_0x1a0376[_0x1607('0xf')]='Trunk';break;case'variables':_0x1a0376[_0x1607('0xf')]=_0x1607('0x70');break;case _0x1607('0x71'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x72');break;case _0x1607('0x73'):_0x1a0376[_0x1607('0xf')]=_0x1607('0xc');_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x74'),'field':'id','foreignKey':_0x1607('0x75')}];break;case'metrics':_0x1a0376[_0x1607('0xf')]=_0x1607('0x76');break;}return _0x1a0376;}function _0x49672b(_0x3282b9,_0x138be6){var _0x37501a=_0x3282b9['charAt'](0x0)[_0x1607('0x77')]()+_0x3282b9[_0x1607('0x78')](0x1);var _0x2d0bcc={'type':_0x444a28['Sequelize']['QueryTypes'][_0x1607('0x79')],'raw':!![]};return new Promise(function(_0x5567bf,_0x56acf8){var _0x48da74=squel[_0x1607('0x7a')]()['field'](_0x1607('0x7b')+_0x37501a+_0x1607('0x7c'),'id')[_0x1607('0x3')](_0x1607('0x7d'))['from'](_0x1607('0x7e')+_0x3282b9+_0x1607('0x7f'),'ui')[_0x1607('0x80')](_0x1607('0x81'),_0x138be6['id']);return _0x444a28[_0x1607('0x82')][_0x1607('0x83')](_0x48da74[_0x1607('0x84')](),_0x2d0bcc)[_0x1607('0x8')](function(_0x5f1247){_0x138be6[_0x37501a+_0x1607('0x85')]=_0x5f1247;_0x5567bf(_0x5f1247);})[_0x1607('0x86')](function(_0x39a04f){_0x56acf8(_0x39a04f);});});}return _0x56fa7f[_0x1607('0x87')]('UserProfile',attributes,{'tableName':_0x1607('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xd85232){var _0x4b5ef2=require(_0x1607('0x89'));var _0xecbd72={'raw':_0xd85232[_0x1607('0x83')][_0x1607('0x8a')],'where':{}};var _0x5c8a27={};var _0x21f629={'count':0x0,'rows':[]};var _0x59975b=_0xd85232[_0x1607('0x83')]['section'];var _0x2448c9=_0xd85232[_0x1607('0x83')][_0x1607('0x8b')]||![];var _0x4dccaf=_0x254b2f(_0x59975b,_0x2448c9);if(!_0x4dccaf[_0x1607('0xf')])throw new Error(_0x1607('0x8c')+_0x59975b+'\x27');var _0x31453b=[{'name':_0x59975b}];if(!_[_0x1607('0x8d')](_0x4dccaf[_0x1607('0x12')]))_0x31453b=_0x4dccaf[_0x1607('0x12')];var _0x5a6c77=[];for(var _0x48134e=0x0;_0x48134e<_0x31453b['length'];_0x48134e++){_0x5a6c77['push'](_0x444a28[_0x1607('0x8e')][_0x1607('0x8f')]({'where':{'userProfileId':_0xd85232[_0x1607('0x90')]['id'],'name':_0x31453b[_0x48134e]['name']},'raw':!![]}));}return Promise['all'](_0x5a6c77)[_0x1607('0x8')](function(_0x550274){var _0x5b2fd5=_[_0x1607('0x2')](_0x550274,function(_0x5af897){return _0x5af897?_0x5af897:undefined;});var _0x3bc861=_[_0x1607('0x2')](_0x31453b,[_0x1607('0x91'),!![]]);var _0x3aa6f8=_[_0x1607('0x8d')](_0x5b2fd5)&&_[_0x1607('0x8d')](_0x3bc861)?null:_[_0x1607('0x92')](_0x3bc861,_0x5b2fd5);if(!_0x3aa6f8)return null;var _0x214124=[];for(var _0x17ac9e=0x0;_0x17ac9e<_0x3aa6f8[_0x1607('0x93')];_0x17ac9e++){var _0xfbc36f=_[_0x1607('0x8f')](_0x31453b,function(_0x3bcf4a){return _0x3aa6f8[_0x17ac9e]?_0x3bcf4a['name']===_0x3aa6f8[_0x17ac9e][_0x1607('0x2f')]:null;});if(_0xfbc36f){if(_0x3aa6f8[_0x17ac9e][_0x1607('0x91')]){_0x214124[_0x1607('0x94')](_0x2858e7(_0x4dccaf[_0x1607('0xf')],_0x3aa6f8[_0x17ac9e]));}else{if(!_0x3aa6f8[_0x17ac9e][_0x1607('0x95')]){_0x214124[_0x1607('0x94')](_0x4f360e(_0xfbc36f,_0x3aa6f8[_0x17ac9e],_0x4dccaf['childModel']));}else{if(_0xfbc36f[_0x1607('0x7')]){_0x214124['push'](_0x2e98bf(_0xfbc36f,_0x3aa6f8[_0x17ac9e]));}}}}}return Promise[_0x1607('0x96')](_0x214124);})[_0x1607('0x8')](function(_0x1600fa){var _0x1a4071=_0x1600fa;var _0x4d0f13=null;if(_0x1a4071){_0x4d0f13=_0x1a4071[_0x1607('0x93')]===0x1?_0x1a4071[0x0]:null;}if(!_0x4d0f13&&!_0x1a4071)return _0x21f629;var _0x56ef9b=_0x444a28[_0x4dccaf[_0x1607('0xf')]]['rawAttributes'];_0x5c8a27['model']=_[_0x1607('0x97')](_0x56ef9b);_0x5c8a27[_0x1607('0x83')]=_[_0x1607('0x97')](_0xd85232[_0x1607('0x83')]);_0x5c8a27[_0x1607('0x98')]=_[_0x1607('0x99')](_0x5c8a27[_0x1607('0x7')],_0x5c8a27[_0x1607('0x83')]);_0xecbd72[_0x1607('0x9a')]=_[_0x1607('0x99')](_0x5c8a27[_0x1607('0x7')],_0x4b5ef2[_0x1607('0x9b')](_0xd85232[_0x1607('0x83')][_0x1607('0x9b')]));_0xecbd72[_0x1607('0x9a')]=_0xecbd72[_0x1607('0x9a')]['length']?_0xecbd72[_0x1607('0x9a')]:_0x5c8a27[_0x1607('0x7')];if(!_0xd85232[_0x1607('0x83')][_0x1607('0x9c')](_0x1607('0x9d'))){_0xecbd72[_0x1607('0x9e')]=_0x4b5ef2[_0x1607('0x9e')](_0xd85232[_0x1607('0x83')][_0x1607('0x9e')]);_0xecbd72[_0x1607('0x9f')]=_0x4b5ef2[_0x1607('0x9f')](_0xd85232['query'][_0x1607('0x9f')]);}_0xecbd72['order']=_0x4b5ef2[_0x1607('0xa0')](_0xd85232[_0x1607('0x83')][_0x1607('0xa0')]);_0xecbd72[_0x1607('0x80')]=_0x4b5ef2[_0x1607('0x98')](_[_0x1607('0xa1')](_0xd85232[_0x1607('0x83')],_0x5c8a27[_0x1607('0x98')]));if(_0xd85232[_0x1607('0x83')][_0x1607('0x2')]){_0xecbd72[_0x1607('0x80')]=_[_0x1607('0xa2')](_0xecbd72[_0x1607('0x80')],{'$or':_['map'](_0x56ef9b,function(_0x11999a){if(_0x11999a['type'][_0x1607('0xa3')]!==_0x1607('0xa4')){var _0x389a0d={};_0x389a0d[_0x11999a['field']]={'$like':'%'+_0xd85232[_0x1607('0x83')][_0x1607('0x2')]+'%'};return _0x389a0d;}})});}var _0x52d0cf=[];var _0x5b2736=null;var _0x3bcd14={};if(_0x4d0f13){_0x5b2736=_[_0x1607('0x8f')](_0x31453b,['name',_0x4d0f13['name']]);if(_0x5b2736[_0x1607('0x3')]){_0x3bcd14={};if(_0x4dccaf['childModel']===_0x1607('0xc')){_0x3bcd14[_0x5b2736[_0x1607('0xa5')]]=_[_0x1607('0x9')](_0x4d0f13[_0x1607('0x6')],'id');}else{_0x3bcd14[_0x5b2736['foreignKey']]=_0x4d0f13[_0x1607('0x6')];}_0x52d0cf[_0x1607('0x94')](_0x3bcd14);}else{_0xecbd72[_0x1607('0x80')]['id']=_0x4d0f13[_0x1607('0x6')];}}else{for(var _0x712418=0x0;_0x712418<_0x1a4071[_0x1607('0x93')];_0x712418++){_0x5b2736=_[_0x1607('0x8f')](_0x31453b,[_0x1607('0x2f'),_0x1a4071[_0x712418][_0x1607('0x2f')]]);if(_0x5b2736['field']){_0x3bcd14={};_0x3bcd14[_0x5b2736[_0x1607('0xa5')]]=_0x1a4071[_0x712418]['associatedResources'];_0x52d0cf[_0x1607('0x94')](_0x3bcd14);}else{if(!_0xecbd72[_0x1607('0x80')]['id'])_0xecbd72[_0x1607('0x80')]['id']=[];_0x1a4071[_0x712418][_0x1607('0x6')][_0x1607('0xa6')](function(_0x5862a2){_0xecbd72[_0x1607('0x80')]['id'][_0x1607('0x94')](_0x5862a2);});}}}if(!_[_0x1607('0x8d')](_0x52d0cf)){_0xecbd72[_0x1607('0x80')]=_['merge'](_0xecbd72[_0x1607('0x80')],{'$and':{'$or':_0x52d0cf}});}_0xecbd72=_[_0x1607('0xa2')]({},_0xecbd72,_0xd85232['options']);if(_0x4d0f13&&!_0x4d0f13[_0x1607('0x95')]&&_0x4dccaf['childModel']===_0x1607('0xc')){if(_0xd85232['query']['includeAll']){_0xecbd72['include']=[{'all':!![]}];}return _0x444a28[_0x4dccaf[_0x1607('0xf')]][_0x1607('0x5')](_0xecbd72)[_0x1607('0x8')](function(_0x3e584f){var _0x126028=[];_0x3e584f[_0x1607('0xa6')](function(_0x562128){var _0x335c58;switch(_0x562128[_0x1607('0xa7')]){case _0x1607('0xa8'):_0x335c58=_[_0x1607('0x8f')](_0x4d0f13[_0x1607('0x6')],function(_0x3c495b){return _0x3c495b['id']===_0x562128[_0x1607('0x75')]&&_0x3c495b['type']===_0x1607('0xa9');});break;case _0x1607('0xaa'):_0x335c58=_[_0x1607('0x8f')](_0x4d0f13[_0x1607('0x6')],function(_0x9a8e96){return _0x9a8e96['id']===_0x562128[_0x1607('0x75')]&&_0x9a8e96[_0x1607('0x39')]===_0x1607('0xab');});break;}if(_0x335c58)_0x126028[_0x1607('0x94')](_0x562128);});_0x21f629[_0x1607('0xac')]=_0x126028['length'];_0x21f629[_0x1607('0xad')]=_0x126028;return _0x21f629;});}else{if(!_[_0x1607('0x8d')](_0xd85232[_0x1607('0x83')]['ids'])){_0xecbd72[_0x1607('0x80')]['id']=_0xecbd72['where']['id']?_[_0x1607('0x99')](_0xecbd72[_0x1607('0x80')]['id'],_0xd85232[_0x1607('0x83')]['ids']):_0xd85232['query'][_0x1607('0xae')];if(_0xd85232['query'][_0x1607('0xaf')]){_0xecbd72[_0x1607('0xb0')]=_0xd85232['query'][_0x1607('0xaf')];}}if(_0xd85232[_0x1607('0x83')][_0x1607('0xb1')]){_0xecbd72[_0x1607('0x80')]=_[_0x1607('0xa2')](_0xecbd72[_0x1607('0x80')],{'$and':_0xd85232[_0x1607('0x83')]['extraQueryConditions']});}return _0x444a28[_0x4dccaf['childModel']]['count']({'where':_0xecbd72['where']})['then'](function(_0x262375){_0x21f629[_0x1607('0xac')]=_0x262375;if(_0xd85232['query']['includeAll']){if(_0x4dccaf[_0x1607('0xf')]==='CmContact'){_0xecbd72[_0x1607('0xb2')]=[{'model':_0x444a28[_0x1607('0x6b')],'as':_0x1607('0xb3'),'attributes':['id',_0x1607('0x2f'),'color'],'required':_0xd85232['query'][_0x1607('0xb4')]?!![]:![]},{'model':_0x444a28[_0x1607('0x6b')],'as':_0x1607('0xb5'),'attributes':['id','name',_0x1607('0xb6')],'through':_0xd85232[_0x1607('0x83')][_0x1607('0xb4')]?{'attributes':[],'where':{'TagId':_0xd85232[_0x1607('0x83')]['tag']||undefined}}:{},'required':_0xd85232['query'][_0x1607('0xb4')]?!![]:![]}];}else{_0xecbd72[_0x1607('0xb2')]=[{'all':!![]}];}}return _0x444a28[_0x4dccaf[_0x1607('0xf')]][_0x1607('0x5')](_0xecbd72);})[_0x1607('0x8')](function(_0x281f91){_0x21f629[_0x1607('0xad')]=_0x281f91;if(_0x59975b===_0x1607('0x2e')&&_0xd85232[_0x1607('0x83')]['openTabs']===_0x1607('0xb7')){var _0x9c32ac=[];for(var _0x160b57=0x0;_0x160b57<_0x21f629['rows'][_0x1607('0x93')];_0x160b57++){_0x9c32ac[_0x1607('0x94')](_0x49672b(_0x1607('0xb8'),_0x21f629['rows'][_0x160b57]['dataValues']));_0x9c32ac[_0x1607('0x94')](_0x49672b('sms',_0x21f629[_0x1607('0xad')][_0x160b57]['dataValues']));_0x9c32ac[_0x1607('0x94')](_0x49672b(_0x1607('0xb9'),_0x21f629[_0x1607('0xad')][_0x160b57][_0x1607('0xba')]));_0x9c32ac[_0x1607('0x94')](_0x49672b('mail',_0x21f629[_0x1607('0xad')][_0x160b57]['dataValues']));_0x9c32ac['push'](_0x49672b('openchannel',_0x21f629[_0x1607('0xad')][_0x160b57][_0x1607('0xba')]));_0x9c32ac['push'](_0x49672b('whatsapp',_0x21f629[_0x1607('0xad')][_0x160b57]['dataValues']));}return Promise[_0x1607('0x96')](_0x9c32ac)[_0x1607('0x8')](function(){return _0x21f629;});}return _0x21f629;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f806f47..85f7568 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 _0xfd50=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xfd50,0x178));var _0x0fd5=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0xfd50[_0x1646fa];return _0x5a47a5;};'use strict';var _=require('lodash');var util=require(_0x0fd5('0x0'));var moment=require(_0x0fd5('0x1'));var BPromise=require(_0x0fd5('0x2'));var rs=require(_0x0fd5('0x3'));var fs=require('fs');var Redis=require(_0x0fd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fd5('0x5'));var logger=require(_0x0fd5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0fd5('0x7'));var client=jayson[_0x0fd5('0x8')][_0x0fd5('0x9')]({'port':0x232a});config[_0x0fd5('0xa')]=_['defaults'](config[_0x0fd5('0xa')],{'host':_0x0fd5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fd5('0xa')]));require(_0x0fd5('0xc'))[_0x0fd5('0xd')](socket);function respondWithRpcPromise(_0x4705b2,_0x39eda9,_0x1dfd3f){return new BPromise(function(_0x27bfa9,_0x4e4733){return client[_0x0fd5('0xe')](_0x4705b2,_0x1dfd3f)[_0x0fd5('0xf')](function(_0x47c900){logger[_0x0fd5('0x10')](_0x0fd5('0x11'),_0x39eda9,_0x0fd5('0x12'));logger[_0x0fd5('0x13')](_0x0fd5('0x14'),_0x39eda9,_0x0fd5('0x12'),JSON[_0x0fd5('0x15')](_0x47c900));if(_0x47c900['error']){if(_0x47c900['error'][_0x0fd5('0x16')]===0x1f4){logger['error'](_0x0fd5('0x11'),_0x39eda9,_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);return _0x4e4733(_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);}logger['error'](_0x0fd5('0x11'),_0x39eda9,_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);return _0x27bfa9(_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);}else{logger[_0x0fd5('0x10')]('UserProfile,\x20%s,\x20%s',_0x39eda9,_0x0fd5('0x12'));_0x27bfa9(_0x47c900[_0x0fd5('0x19')][_0x0fd5('0x18')]);}})[_0x0fd5('0x1a')](function(_0x1d86f4){logger['error'](_0x0fd5('0x11'),_0x39eda9,_0x1d86f4);_0x4e4733(_0x1d86f4);});});} \ No newline at end of file +var _0x11e5=['../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfile,\x20%s,\x20%s','info','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xa0fb8e,_0x293ed6){var _0xa43fc4=function(_0xbb194d){while(--_0xbb194d){_0xa0fb8e['push'](_0xa0fb8e['shift']());}};_0xa43fc4(++_0x293ed6);}(_0x11e5,0x8b));var _0x511e=function(_0xd88860,_0xe09771){_0xd88860=_0xd88860-0x0;var _0x4aac30=_0x11e5[_0xd88860];return _0x4aac30;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var moment=require(_0x511e('0x1'));var BPromise=require(_0x511e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x511e('0x3'));var db=require(_0x511e('0x4'))['db'];var utils=require(_0x511e('0x5'));var logger=require('../../config/logger')(_0x511e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x511e('0x7')][_0x511e('0x8')]({'port':0x232a});config[_0x511e('0x9')]=_['defaults'](config['redis'],{'host':_0x511e('0xa'),'port':0x18eb});var socket=require(_0x511e('0xb'))(new Redis(config[_0x511e('0x9')]));require(_0x511e('0xc'))[_0x511e('0xd')](socket);function respondWithRpcPromise(_0x30269e,_0x1596b3,_0x50564b){return new BPromise(function(_0x2f547a,_0x1c6def){return client[_0x511e('0xe')](_0x30269e,_0x50564b)['then'](function(_0x7e50db){logger['info']('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x511e('0xf'));logger[_0x511e('0x10')](_0x511e('0x11'),_0x1596b3,_0x511e('0xf'),JSON[_0x511e('0x12')](_0x7e50db));if(_0x7e50db[_0x511e('0x13')]){if(_0x7e50db['error'][_0x511e('0x14')]===0x1f4){logger[_0x511e('0x13')]('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x7e50db[_0x511e('0x13')][_0x511e('0x15')]);return _0x1c6def(_0x7e50db['error'][_0x511e('0x15')]);}logger[_0x511e('0x13')](_0x511e('0x16'),_0x1596b3,_0x7e50db[_0x511e('0x13')]['message']);return _0x2f547a(_0x7e50db[_0x511e('0x13')][_0x511e('0x15')]);}else{logger[_0x511e('0x17')]('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x511e('0xf'));_0x2f547a(_0x7e50db['result'][_0x511e('0x15')]);}})['catch'](function(_0x5821ee){logger[_0x511e('0x13')]('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x5821ee);_0x1c6def(_0x5821ee);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3b045e3..887e634 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 _0x1c4c=['length','./userProfile.events','save','remove','update','emit','removeListener','register'];(function(_0x120e34,_0x12c267){var _0x194705=function(_0x1dbb26){while(--_0x1dbb26){_0x120e34['push'](_0x120e34['shift']());}};_0x194705(++_0x12c267);}(_0x1c4c,0x1e9));var _0xc1c4=function(_0x112e2a,_0x364486){_0x112e2a=_0x112e2a-0x0;var _0x4f8af9=_0x1c4c[_0x112e2a];return _0x4f8af9;};'use strict';var UserProfileEvents=require(_0xc1c4('0x0'));var events=[_0xc1c4('0x1'),_0xc1c4('0x2'),_0xc1c4('0x3')];function createListener(_0x48fcdd,_0x2fd9ff){return function(_0x1c03fb){_0x2fd9ff[_0xc1c4('0x4')](_0x48fcdd,_0x1c03fb);};}function removeListener(_0x3f13c1,_0x3a5471){return function(){UserProfileEvents[_0xc1c4('0x5')](_0x3f13c1,_0x3a5471);};}exports[_0xc1c4('0x6')]=function(_0x1b5382){for(var _0x2cb75c=0x0,_0x444a22=events[_0xc1c4('0x7')];_0x2cb75c<_0x444a22;_0x2cb75c++){var _0xb586df=events[_0x2cb75c];var _0x1b73a5=createListener('userProfile:'+_0xb586df,_0x1b5382);UserProfileEvents['on'](_0xb586df,_0x1b73a5);}}; \ No newline at end of file +var _0x1f80=['./userProfile.events','save','remove','update','emit','removeListener','register','length','userProfile:'];(function(_0x296db4,_0x3244dc){var _0x44e41c=function(_0x3c2119){while(--_0x3c2119){_0x296db4['push'](_0x296db4['shift']());}};_0x44e41c(++_0x3244dc);}(_0x1f80,0x1e6));var _0x01f8=function(_0x3ea7c6,_0x58e36a){_0x3ea7c6=_0x3ea7c6-0x0;var _0x4345a4=_0x1f80[_0x3ea7c6];return _0x4345a4;};'use strict';var UserProfileEvents=require(_0x01f8('0x0'));var events=[_0x01f8('0x1'),_0x01f8('0x2'),_0x01f8('0x3')];function createListener(_0xe5e81e,_0x531611){return function(_0x3df936){_0x531611[_0x01f8('0x4')](_0xe5e81e,_0x3df936);};}function removeListener(_0x17d096,_0x445406){return function(){UserProfileEvents[_0x01f8('0x5')](_0x17d096,_0x445406);};}exports[_0x01f8('0x6')]=function(_0x1f6284){for(var _0x588668=0x0,_0xd7cbe5=events[_0x01f8('0x7')];_0x588668<_0xd7cbe5;_0x588668++){var _0x56d32f=events[_0x588668];var _0xc3a9b4=createListener(_0x01f8('0x8')+_0x56d32f,_0x1f6284);UserProfileEvents['on'](_0x56d32f,_0xc3a9b4);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 9f0be16..bebab80 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 _0x762a=['./userProfileResource.controller','index','/describe','isAuthenticated','describe','get','show','post','/:id','update','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x762a,0x103));var _0xa762=function(_0xadf0d9,_0x5bccc4){_0xadf0d9=_0xadf0d9-0x0;var _0x882d6b=_0x762a[_0xadf0d9];return _0x882d6b;};'use strict';var multer=require('multer');var util=require(_0xa762('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa762('0x1'));var router=express[_0xa762('0x2')]();var fs_extra=require(_0xa762('0x3'));var auth=require(_0xa762('0x4'));var interaction=require(_0xa762('0x5'));var config=require(_0xa762('0x6'));var controller=require(_0xa762('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa762('0x8')]);router['get'](_0xa762('0x9'),auth[_0xa762('0xa')](),controller[_0xa762('0xb')]);router[_0xa762('0xc')]('/:id',auth[_0xa762('0xa')](),controller[_0xa762('0xd')]);router[_0xa762('0xe')]('/',auth[_0xa762('0xa')](),controller['create']);router['put'](_0xa762('0xf'),auth['isAuthenticated'](),controller[_0xa762('0x10')]);router['delete'](_0xa762('0xf'),auth[_0xa762('0xa')](),controller[_0xa762('0x11')]);module[_0xa762('0x12')]=router; \ No newline at end of file +var _0x931e=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','destroy','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x931e,0x87));var _0xe931=function(_0x439db1,_0x2b7db7){_0x439db1=_0x439db1-0x0;var _0x495017=_0x931e[_0x439db1];return _0x495017;};'use strict';var multer=require(_0xe931('0x0'));var util=require('util');var path=require(_0xe931('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe931('0x2'));var auth=require(_0xe931('0x3'));var interaction=require(_0xe931('0x4'));var config=require(_0xe931('0x5'));var controller=require(_0xe931('0x6'));router[_0xe931('0x7')]('/',auth[_0xe931('0x8')](),controller['index']);router['get'](_0xe931('0x9'),auth[_0xe931('0x8')](),controller[_0xe931('0xa')]);router[_0xe931('0x7')](_0xe931('0xb'),auth[_0xe931('0x8')](),controller['show']);router[_0xe931('0xc')]('/',auth[_0xe931('0x8')](),controller[_0xe931('0xd')]);router[_0xe931('0xe')](_0xe931('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe931('0xb'),auth[_0xe931('0x8')](),controller[_0xe931('0xf')]);module[_0xe931('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 666dc4f..891ccaa 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 _0xcb40=['STRING','INTEGER','exports'];(function(_0x453ed1,_0x3f7029){var _0x106504=function(_0x4268df){while(--_0x4268df){_0x453ed1['push'](_0x453ed1['shift']());}};_0x106504(++_0x3f7029);}(_0xcb40,0x1d6));var _0x0cb4=function(_0xac1f23,_0xb4bd41){_0xac1f23=_0xac1f23-0x0;var _0xfd6156=_0xcb40[_0xac1f23];return _0xfd6156;};'use strict';var Sequelize=require('sequelize');module[_0x0cb4('0x0')]={'name':{'type':Sequelize[_0x0cb4('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0cb4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0cb4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa119=['INTEGER','exports','STRING'];(function(_0x1b9438,_0x3be13d){var _0x182cc1=function(_0x439c7a){while(--_0x439c7a){_0x1b9438['push'](_0x1b9438['shift']());}};_0x182cc1(++_0x3be13d);}(_0xa119,0x1c9));var _0x9a11=function(_0x479b9a,_0x2fe1e3){_0x479b9a=_0x479b9a-0x0;var _0x4b5c9c=_0xa119[_0x479b9a];return _0x4b5c9c;};'use strict';var Sequelize=require('sequelize');module[_0x9a11('0x0')]={'name':{'type':Sequelize[_0x9a11('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a11('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9a11('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 3dae8cd..957efdd 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 _0x4888=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','UserProfileResource','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4888,0x198));var _0x8488=function(_0x1e2aae,_0x2349e3){_0x1e2aae=_0x1e2aae-0x0;var _0x4d8a43=_0x4888[_0x1e2aae];return _0x4d8a43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));};exports[_0x8488('0x46')]=function(_0x313e00,_0x186747){return db[_0x8488('0x3a')]['describe']()[_0x8488('0x21')](respondWithResult(_0x186747,null))[_0x8488('0x3e')](handleError(_0x186747,null));}; \ No newline at end of file +var _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','UserProfileResource','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x1c4951,_0x2038ee){var _0x345e1b=function(_0x69ee47){while(--_0x69ee47){_0x1c4951['push'](_0x1c4951['shift']());}};_0x345e1b(++_0x2038ee);}(_0x4c60,0xc1));var _0x04c6=function(_0xbc7f8f,_0x2fc4a6){_0xbc7f8f=_0xbc7f8f-0x0;var _0x30b3b8=_0x4c60[_0xbc7f8f];return _0x30b3b8;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['UserProfileResource'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['UserProfileResource'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['UserProfileResource'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['UserProfileResource'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['UserProfileResource'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 3d71e7a..5766364 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 _0x1aae=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash'];(function(_0x499b56,_0x308586){var _0x2910a4=function(_0x11186d){while(--_0x11186d){_0x499b56['push'](_0x499b56['shift']());}};_0x2910a4(++_0x308586);}(_0x1aae,0x142));var _0xe1aa=function(_0x2f7cf3,_0xd81845){_0x2f7cf3=_0x2f7cf3-0x0;var _0x338250=_0x1aae[_0x2f7cf3];return _0x338250;};'use strict';var _=require(_0xe1aa('0x0'));var util=require(_0xe1aa('0x1'));var logger=require(_0xe1aa('0x2'))(_0xe1aa('0x3'));var moment=require(_0xe1aa('0x4'));var BPromise=require(_0xe1aa('0x5'));var rp=require(_0xe1aa('0x6'));var fs=require('fs');var path=require(_0xe1aa('0x7'));var rimraf=require(_0xe1aa('0x8'));var config=require('../../config/environment');var attributes=require(_0xe1aa('0x9'));module[_0xe1aa('0xa')]=function(_0x9cbece,_0xbb047c){return _0x9cbece[_0xe1aa('0xb')](_0xe1aa('0xc'),attributes,{'tableName':_0xe1aa('0xd'),'paranoid':![],'indexes':[{'name':_0xe1aa('0xe'),'fields':[_0xe1aa('0xf'),_0xe1aa('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5220=['./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x28bbe1,_0x48f04c){var _0x3f41c0=function(_0x1c9c6f){while(--_0x1c9c6f){_0x28bbe1['push'](_0x28bbe1['shift']());}};_0x3f41c0(++_0x48f04c);}(_0x5220,0x164));var _0x0522=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x5220[_0x4fbb86];return _0xb141fe;};'use strict';var _=require('lodash');var util=require(_0x0522('0x0'));var logger=require(_0x0522('0x1'))(_0x0522('0x2'));var moment=require(_0x0522('0x3'));var BPromise=require(_0x0522('0x4'));var rp=require(_0x0522('0x5'));var fs=require('fs');var path=require(_0x0522('0x6'));var rimraf=require(_0x0522('0x7'));var config=require('../../config/environment');var attributes=require(_0x0522('0x8'));module['exports']=function(_0x5971a1,_0x5eb4eb){return _0x5971a1['define'](_0x0522('0x9'),attributes,{'tableName':_0x0522('0xa'),'paranoid':![],'indexes':[{'name':_0x0522('0xb'),'fields':[_0x0522('0xc'),_0x0522('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 5317152..6f380b6 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 _0xdb3d=['then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x3efa18,_0x5c1204){var _0x3a4f59=function(_0x302480){while(--_0x302480){_0x3efa18['push'](_0x3efa18['shift']());}};_0x3a4f59(++_0x5c1204);}(_0xdb3d,0xf1));var _0xddb3=function(_0x30e8a1,_0x55fa82){_0x30e8a1=_0x30e8a1-0x0;var _0x37c6f1=_0xdb3d[_0x30e8a1];return _0x37c6f1;};'use strict';var _=require('lodash');var util=require(_0xddb3('0x0'));var moment=require(_0xddb3('0x1'));var BPromise=require(_0xddb3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddb3('0x3'));var db=require(_0xddb3('0x4'))['db'];var utils=require(_0xddb3('0x5'));var logger=require('../../config/logger')(_0xddb3('0x6'));var config=require(_0xddb3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xddb3('0x8')][_0xddb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13470c,_0x52c880,_0x7c7e0f){return new BPromise(function(_0x430120,_0x289b38){return client[_0xddb3('0xa')](_0x13470c,_0x7c7e0f)[_0xddb3('0xb')](function(_0x4f52e0){logger['info'](_0xddb3('0xc'),_0x52c880,_0xddb3('0xd'));logger[_0xddb3('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x52c880,'request\x20sent',JSON[_0xddb3('0xf')](_0x4f52e0));if(_0x4f52e0['error']){if(_0x4f52e0['error'][_0xddb3('0x10')]===0x1f4){logger[_0xddb3('0x11')](_0xddb3('0xc'),_0x52c880,_0x4f52e0['error']['message']);return _0x289b38(_0x4f52e0[_0xddb3('0x11')][_0xddb3('0x12')]);}logger[_0xddb3('0x11')](_0xddb3('0xc'),_0x52c880,_0x4f52e0[_0xddb3('0x11')][_0xddb3('0x12')]);return _0x430120(_0x4f52e0['error'][_0xddb3('0x12')]);}else{logger[_0xddb3('0x13')](_0xddb3('0xc'),_0x52c880,_0xddb3('0xd'));_0x430120(_0x4f52e0['result'][_0xddb3('0x12')]);}})[_0xddb3('0x14')](function(_0x5997a1){logger[_0xddb3('0x11')](_0xddb3('0xc'),_0x52c880,_0x5997a1);_0x289b38(_0x5997a1);});});} \ No newline at end of file +var _0xb0a7=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s'];(function(_0x69f8c7,_0xdb0ea8){var _0x4c7cc9=function(_0x41a431){while(--_0x41a431){_0x69f8c7['push'](_0x69f8c7['shift']());}};_0x4c7cc9(++_0xdb0ea8);}(_0xb0a7,0x116));var _0x7b0a=function(_0x32c27b,_0x304cd2){_0x32c27b=_0x32c27b-0x0;var _0x52e86d=_0xb0a7[_0x32c27b];return _0x52e86d;};'use strict';var _=require(_0x7b0a('0x0'));var util=require(_0x7b0a('0x1'));var moment=require(_0x7b0a('0x2'));var BPromise=require(_0x7b0a('0x3'));var rs=require(_0x7b0a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b0a('0x5'))['db'];var utils=require(_0x7b0a('0x6'));var logger=require(_0x7b0a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b0a('0x8'));var client=jayson[_0x7b0a('0x9')][_0x7b0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46255b,_0x25ef00,_0x2f28dc){return new BPromise(function(_0x3807df,_0x21bb69){return client['request'](_0x46255b,_0x2f28dc)[_0x7b0a('0xb')](function(_0xa20161){logger[_0x7b0a('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0x7b0a('0xd'));logger[_0x7b0a('0xe')](_0x7b0a('0xf'),_0x25ef00,_0x7b0a('0xd'),JSON[_0x7b0a('0x10')](_0xa20161));if(_0xa20161['error']){if(_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x12')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x13')]);return _0x21bb69(_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x13')]);}logger[_0x7b0a('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0xa20161['error']['message']);return _0x3807df(_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x13')]);}else{logger[_0x7b0a('0xc')](_0x7b0a('0x14'),_0x25ef00,_0x7b0a('0xd'));_0x3807df(_0xa20161[_0x7b0a('0x15')][_0x7b0a('0x13')]);}})[_0x7b0a('0x16')](function(_0x55e6fe){logger[_0x7b0a('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0x55e6fe);_0x21bb69(_0x55e6fe);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index e8d829a..e40f293 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 _0x4592=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x4708ed,_0x1aafbb){var _0xc34b5e=function(_0x5b9450){while(--_0x5b9450){_0x4708ed['push'](_0x4708ed['shift']());}};_0xc34b5e(++_0x1aafbb);}(_0x4592,0xec));var _0x2459=function(_0x1df156,_0x5372ea){_0x1df156=_0x1df156-0x0;var _0x491ff1=_0x4592[_0x1df156];return _0x491ff1;};'use strict';var multer=require(_0x2459('0x0'));var util=require(_0x2459('0x1'));var path=require('path');var timeout=require(_0x2459('0x2'));var express=require(_0x2459('0x3'));var router=express[_0x2459('0x4')]();var fs_extra=require(_0x2459('0x5'));var auth=require(_0x2459('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2459('0x7'));var controller=require(_0x2459('0x8'));router[_0x2459('0x9')]('/',auth[_0x2459('0xa')](),controller[_0x2459('0xb')]);router['get'](_0x2459('0xc'),auth[_0x2459('0xa')](),controller[_0x2459('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2459('0xe')]);router[_0x2459('0xf')]('/',auth[_0x2459('0xa')](),controller[_0x2459('0x10')]);router[_0x2459('0x11')](_0x2459('0x12'),auth[_0x2459('0xa')](),controller[_0x2459('0x13')]);router[_0x2459('0x14')]('/:id',auth[_0x2459('0xa')](),controller[_0x2459('0x15')]);module[_0x2459('0x16')]=router; \ No newline at end of file +var _0x741a=['../../config/environment','./userProfileSection.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xb9591f,_0x2b2134){var _0x59da0c=function(_0x30b0b0){while(--_0x30b0b0){_0xb9591f['push'](_0xb9591f['shift']());}};_0x59da0c(++_0x2b2134);}(_0x741a,0x1e0));var _0xa741=function(_0x29e54f,_0x33535a){_0x29e54f=_0x29e54f-0x0;var _0x4c619f=_0x741a[_0x29e54f];return _0x4c619f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa741('0x0'));var timeout=require(_0xa741('0x1'));var express=require(_0xa741('0x2'));var router=express[_0xa741('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa741('0x4'));var interaction=require(_0xa741('0x5'));var config=require(_0xa741('0x6'));var controller=require(_0xa741('0x7'));router[_0xa741('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa741('0x8')](_0xa741('0x9'),auth[_0xa741('0xa')](),controller[_0xa741('0xb')]);router[_0xa741('0x8')](_0xa741('0xc'),auth[_0xa741('0xa')](),controller[_0xa741('0xd')]);router[_0xa741('0xe')]('/',auth[_0xa741('0xa')](),controller[_0xa741('0xf')]);router[_0xa741('0x10')](_0xa741('0xc'),auth[_0xa741('0xa')](),controller['update']);router['delete'](_0xa741('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa741('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index cf8c361..f96651d 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 _0x1eba=['join','getDataValue','split','sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x1752fd,_0x19c6e5){var _0x4feac4=function(_0x144718){while(--_0x144718){_0x1752fd['push'](_0x1752fd['shift']());}};_0x4feac4(++_0x19c6e5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x1eba[_0x35d4e9];return _0x5c2770;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xa1eb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa1eb('0x2')],'set':function(_0x34be5a){this[_0xa1eb('0x4')](_0xa1eb('0x5'),_0x34be5a?_0x34be5a[_0xa1eb('0x6')](''):[]);},'get':function(){return this[_0xa1eb('0x7')](_0xa1eb('0x5'))?this[_0xa1eb('0x7')](_0xa1eb('0x5'))[_0xa1eb('0x8')](''):[];}}}; \ No newline at end of file +var _0x8f4c=['setDataValue','join','crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x315746,_0x44c105){var _0x533a49=function(_0x2be178){while(--_0x2be178){_0x315746['push'](_0x315746['shift']());}};_0x533a49(++_0x44c105);}(_0x8f4c,0x113));var _0xc8f4=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x8f4c[_0xf9a6cf];return _0x59e2bc;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc8f4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc8f4('0x2')],'set':function(_0x47350d){this[_0xc8f4('0x5')]('crudPermissions',_0x47350d?_0x47350d[_0xc8f4('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xc8f4('0x7'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2a3ef54..b18cf2b 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 _0x0d0d=['desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','squel','jsforce'];(function(_0x30e0a9,_0x13852b){var _0x3716d5=function(_0x1ba032){while(--_0x1ba032){_0x30e0a9['push'](_0x30e0a9['shift']());}};_0x3716d5(++_0x13852b);}(_0x0d0d,0x8c));var _0xd0d0=function(_0x4465dd,_0x5b95e3){_0x4465dd=_0x4465dd-0x0;var _0x4dd362=_0x0d0d[_0x4465dd];return _0x4dd362;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd0d0('0x0'));var jsonpatch=require(_0xd0d0('0x1'));var rp=require(_0xd0d0('0x2'));var moment=require('moment');var BPromise=require(_0xd0d0('0x3'));var Mustache=require(_0xd0d0('0x4'));var util=require(_0xd0d0('0x5'));var path=require(_0xd0d0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0d0('0x7'));var _=require('lodash');var squel=require(_0xd0d0('0x8'));var crypto=require('crypto');var jsforce=require(_0xd0d0('0x9'));var deskjs=require(_0xd0d0('0xa'));var toCsv=require(_0xd0d0('0xb'));var querystring=require(_0xd0d0('0xc'));var Papa=require(_0xd0d0('0xd'));var Redis=require('ioredis');var authService=require(_0xd0d0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd0d0('0xf'));var hardwareService=require(_0xd0d0('0x10'));var logger=require('../../config/logger')(_0xd0d0('0x11'));var utils=require(_0xd0d0('0x12'));var config=require(_0xd0d0('0x13'));var licenseUtil=require(_0xd0d0('0x14'));var db=require(_0xd0d0('0x15'))['db'];function respondWithStatusCode(_0x3f8d1c,_0x16d40b){_0x16d40b=_0x16d40b||0xcc;return function(_0x5dc852){if(_0x5dc852){return _0x3f8d1c['sendStatus'](_0x16d40b);}return _0x3f8d1c['status'](_0x16d40b)[_0xd0d0('0x16')]();};}function respondWithResult(_0x5d08ed,_0x5b185b){_0x5b185b=_0x5b185b||0xc8;return function(_0x489762){if(_0x489762){return _0x5d08ed['status'](_0x5b185b)[_0xd0d0('0x17')](_0x489762);}};}function respondWithFilteredResult(_0x26623f,_0x2474b0){return function(_0x374ea0){if(_0x374ea0){var _0x376f17=typeof _0x2474b0[_0xd0d0('0x18')]===_0xd0d0('0x19')&&typeof _0x2474b0[_0xd0d0('0x1a')]===_0xd0d0('0x19');var _0xc609b2=_0x374ea0[_0xd0d0('0x1b')];var _0x44a1e4=_0x376f17?0x0:_0x2474b0[_0xd0d0('0x18')];var _0x219454=_0x376f17?_0x374ea0[_0xd0d0('0x1b')]:_0x2474b0[_0xd0d0('0x18')]+_0x2474b0['limit'];var _0x4fa23e;if(_0x219454>=_0xc609b2){_0x219454=_0xc609b2;_0x4fa23e=0xc8;}else{_0x4fa23e=0xce;}_0x26623f[_0xd0d0('0x1c')](_0x4fa23e);return _0x26623f[_0xd0d0('0x1d')](_0xd0d0('0x1e'),_0x44a1e4+'-'+_0x219454+'/'+_0xc609b2)[_0xd0d0('0x17')](_0x374ea0);}return null;};}function patchUpdates(_0x448e19){return function(_0x8554e8){try{jsonpatch[_0xd0d0('0x1f')](_0x8554e8,_0x448e19,!![]);}catch(_0x109fdc){return BPromise['reject'](_0x109fdc);}return _0x8554e8[_0xd0d0('0x20')]();};}function saveUpdates(_0x56f0d2,_0x3c13f5){return function(_0x324f3a){if(_0x324f3a){return _0x324f3a[_0xd0d0('0x21')](_0x56f0d2)[_0xd0d0('0x22')](function(_0x52e7b5){return _0x52e7b5;});}return null;};}function removeEntity(_0xd37552,_0x4169e7){return function(_0x412618){if(_0x412618){return _0x412618[_0xd0d0('0x23')]()['then'](function(){_0xd37552[_0xd0d0('0x1c')](0xcc)[_0xd0d0('0x16')]();});}};}function handleEntityNotFound(_0x26881b,_0x5e9288){return function(_0x3b93d4){if(!_0x3b93d4){_0x26881b[_0xd0d0('0x24')](0x194);}return _0x3b93d4;};}function handleError(_0x1f50a8,_0x5d7808){_0x5d7808=_0x5d7808||0x1f4;return function(_0x20b206){logger[_0xd0d0('0x25')](_0x20b206[_0xd0d0('0x26')]);if(_0x20b206[_0xd0d0('0x27')]){delete _0x20b206[_0xd0d0('0x27')];}_0x1f50a8[_0xd0d0('0x1c')](_0x5d7808)[_0xd0d0('0x28')](_0x20b206);};}exports[_0xd0d0('0x29')]=function(_0x30600d,_0x5112f3){var _0x3c1ebc={},_0x5f2dac={},_0x4b8906={'count':0x0,'rows':[]};var _0xb477de=_['map'](db[_0xd0d0('0x2a')][_0xd0d0('0x2b')],function(_0x1adaf4){return{'name':_0x1adaf4[_0xd0d0('0x2c')],'type':_0x1adaf4[_0xd0d0('0x2d')][_0xd0d0('0x2e')]};});_0x5f2dac['model']=_[_0xd0d0('0x2f')](_0xb477de,_0xd0d0('0x27'));_0x5f2dac[_0xd0d0('0x30')]=_[_0xd0d0('0x31')](_0x30600d['query']);_0x5f2dac[_0xd0d0('0x32')]=_[_0xd0d0('0x33')](_0x5f2dac[_0xd0d0('0x34')],_0x5f2dac[_0xd0d0('0x30')]);_0x3c1ebc[_0xd0d0('0x35')]=_[_0xd0d0('0x33')](_0x5f2dac['model'],qs[_0xd0d0('0x36')](_0x30600d['query'][_0xd0d0('0x36')]));_0x3c1ebc[_0xd0d0('0x35')]=_0x3c1ebc[_0xd0d0('0x35')][_0xd0d0('0x37')]?_0x3c1ebc[_0xd0d0('0x35')]:_0x5f2dac[_0xd0d0('0x34')];if(!_0x30600d['query'][_0xd0d0('0x38')]('nolimit')){_0x3c1ebc[_0xd0d0('0x1a')]=qs[_0xd0d0('0x1a')](_0x30600d[_0xd0d0('0x30')][_0xd0d0('0x1a')]);_0x3c1ebc[_0xd0d0('0x18')]=qs[_0xd0d0('0x18')](_0x30600d[_0xd0d0('0x30')][_0xd0d0('0x18')]);}_0x3c1ebc[_0xd0d0('0x39')]=qs[_0xd0d0('0x3a')](_0x30600d['query'][_0xd0d0('0x3a')]);_0x3c1ebc[_0xd0d0('0x3b')]=qs[_0xd0d0('0x32')](_[_0xd0d0('0x3c')](_0x30600d['query'],_0x5f2dac[_0xd0d0('0x32')]),_0xb477de);if(_0x30600d[_0xd0d0('0x30')][_0xd0d0('0x3d')]){_0x3c1ebc[_0xd0d0('0x3b')]=_[_0xd0d0('0x3e')](_0x3c1ebc[_0xd0d0('0x3b')],{'$or':_['map'](_0xb477de,function(_0x573ea9){if(_0x573ea9[_0xd0d0('0x2d')]!==_0xd0d0('0x3f')){var _0x2fcac1={};_0x2fcac1[_0x573ea9[_0xd0d0('0x27')]]={'$like':'%'+_0x30600d['query'][_0xd0d0('0x3d')]+'%'};return _0x2fcac1;}})});}_0x3c1ebc=_['merge']({},_0x3c1ebc,_0x30600d[_0xd0d0('0x40')]);var _0x45a1ae={'where':_0x3c1ebc['where']};return db[_0xd0d0('0x2a')][_0xd0d0('0x1b')](_0x45a1ae)[_0xd0d0('0x22')](function(_0x5709e3){_0x4b8906['count']=_0x5709e3;if(_0x30600d['query'][_0xd0d0('0x41')]){_0x3c1ebc[_0xd0d0('0x42')]=[{'all':!![]}];}return db[_0xd0d0('0x2a')][_0xd0d0('0x43')](_0x3c1ebc);})['then'](function(_0x4bae3f){_0x4b8906[_0xd0d0('0x44')]=_0x4bae3f;return _0x4b8906;})['then'](respondWithFilteredResult(_0x5112f3,_0x3c1ebc))[_0xd0d0('0x45')](handleError(_0x5112f3,null));};exports['show']=function(_0x18df7e,_0x5bed5c){var _0xbadec2={'raw':![],'where':{'id':_0x18df7e[_0xd0d0('0x46')]['id']}},_0x36d2e7={};_0x36d2e7[_0xd0d0('0x34')]=_[_0xd0d0('0x31')](db[_0xd0d0('0x2a')][_0xd0d0('0x2b')]);_0x36d2e7['query']=_[_0xd0d0('0x31')](_0x18df7e[_0xd0d0('0x30')]);_0x36d2e7[_0xd0d0('0x32')]=_[_0xd0d0('0x33')](_0x36d2e7[_0xd0d0('0x34')],_0x36d2e7[_0xd0d0('0x30')]);_0xbadec2[_0xd0d0('0x35')]=_[_0xd0d0('0x33')](_0x36d2e7['model'],qs[_0xd0d0('0x36')](_0x18df7e[_0xd0d0('0x30')][_0xd0d0('0x36')]));_0xbadec2[_0xd0d0('0x35')]=_0xbadec2[_0xd0d0('0x35')]['length']?_0xbadec2['attributes']:_0x36d2e7['model'];if(_0x18df7e[_0xd0d0('0x30')]['includeAll']){_0xbadec2[_0xd0d0('0x42')]=[{'all':!![]}];}_0xbadec2=_[_0xd0d0('0x3e')]({},_0xbadec2,_0x18df7e[_0xd0d0('0x40')]);return db[_0xd0d0('0x2a')][_0xd0d0('0x47')](_0xbadec2)[_0xd0d0('0x22')](handleEntityNotFound(_0x5bed5c,null))[_0xd0d0('0x22')](respondWithResult(_0x5bed5c,null))[_0xd0d0('0x45')](handleError(_0x5bed5c,null));};exports['create']=function(_0x5564b3,_0x3175ae){return db['UserProfileSection'][_0xd0d0('0x48')](_0x5564b3[_0xd0d0('0x49')],{})[_0xd0d0('0x22')](respondWithResult(_0x3175ae,0xc9))[_0xd0d0('0x45')](handleError(_0x3175ae,null));};exports[_0xd0d0('0x21')]=function(_0x2a0bf7,_0x5666d5){if(_0x2a0bf7[_0xd0d0('0x49')]['id']){delete _0x2a0bf7['body']['id'];}return db[_0xd0d0('0x2a')][_0xd0d0('0x47')]({'where':{'id':_0x2a0bf7[_0xd0d0('0x46')]['id']}})['then'](handleEntityNotFound(_0x5666d5,null))[_0xd0d0('0x22')](saveUpdates(_0x2a0bf7['body'],null))[_0xd0d0('0x22')](respondWithResult(_0x5666d5,null))['catch'](handleError(_0x5666d5,null));};exports[_0xd0d0('0x23')]=function(_0x27e381,_0x457df8){return db[_0xd0d0('0x2a')][_0xd0d0('0x47')]({'where':{'id':_0x27e381['params']['id']}})['then'](handleEntityNotFound(_0x457df8,null))['then'](removeEntity(_0x457df8,null))[_0xd0d0('0x45')](handleError(_0x457df8,null));};exports['describe']=function(_0x10ed60,_0x3b519e){return db[_0xd0d0('0x2a')][_0xd0d0('0x4a')]()['then'](respondWithResult(_0x3b519e,null))['catch'](handleError(_0x3b519e,null));}; \ No newline at end of file +var _0xddf5=['name','send','index','map','UserProfileSection','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x4fb51b,_0xe70822){var _0x49cc96=function(_0x41030b){while(--_0x41030b){_0x4fb51b['push'](_0x4fb51b['shift']());}};_0x49cc96(++_0xe70822);}(_0xddf5,0x112));var _0x5ddf=function(_0x1f1f7e,_0x552ba7){_0x1f1f7e=_0x1f1f7e-0x0;var _0x1f55f9=_0xddf5[_0x1f1f7e];return _0x1f55f9;};'use strict';var emlformat=require(_0x5ddf('0x0'));var rimraf=require(_0x5ddf('0x1'));var zipdir=require(_0x5ddf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ddf('0x3'));var moment=require(_0x5ddf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ddf('0x5'));var util=require(_0x5ddf('0x6'));var path=require(_0x5ddf('0x7'));var sox=require(_0x5ddf('0x8'));var csv=require(_0x5ddf('0x9'));var ejs=require(_0x5ddf('0xa'));var fs=require('fs');var fs_extra=require(_0x5ddf('0xb'));var _=require(_0x5ddf('0xc'));var squel=require(_0x5ddf('0xd'));var crypto=require('crypto');var jsforce=require(_0x5ddf('0xe'));var deskjs=require(_0x5ddf('0xf'));var toCsv=require(_0x5ddf('0x9'));var querystring=require(_0x5ddf('0x10'));var Papa=require('papaparse');var Redis=require(_0x5ddf('0x11'));var authService=require(_0x5ddf('0x12'));var qs=require(_0x5ddf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ddf('0x14'));var logger=require(_0x5ddf('0x15'))(_0x5ddf('0x16'));var utils=require('../../config/utils');var config=require(_0x5ddf('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ddf('0x18'))['db'];function respondWithStatusCode(_0x5401b4,_0xeeacf){_0xeeacf=_0xeeacf||0xcc;return function(_0x2042e2){if(_0x2042e2){return _0x5401b4['sendStatus'](_0xeeacf);}return _0x5401b4[_0x5ddf('0x19')](_0xeeacf)[_0x5ddf('0x1a')]();};}function respondWithResult(_0xb7f758,_0x4dd19f){_0x4dd19f=_0x4dd19f||0xc8;return function(_0x3f46db){if(_0x3f46db){return _0xb7f758[_0x5ddf('0x19')](_0x4dd19f)[_0x5ddf('0x1b')](_0x3f46db);}};}function respondWithFilteredResult(_0x6bc2fd,_0x4c78aa){return function(_0x163409){if(_0x163409){var _0x49c15a=typeof _0x4c78aa[_0x5ddf('0x1c')]===_0x5ddf('0x1d')&&typeof _0x4c78aa[_0x5ddf('0x1e')]===_0x5ddf('0x1d');var _0x5df2be=_0x163409[_0x5ddf('0x1f')];var _0x57e401=_0x49c15a?0x0:_0x4c78aa[_0x5ddf('0x1c')];var _0x27ae26=_0x49c15a?_0x163409[_0x5ddf('0x1f')]:_0x4c78aa[_0x5ddf('0x1c')]+_0x4c78aa[_0x5ddf('0x1e')];var _0x59a4bb;if(_0x27ae26>=_0x5df2be){_0x27ae26=_0x5df2be;_0x59a4bb=0xc8;}else{_0x59a4bb=0xce;}_0x6bc2fd[_0x5ddf('0x19')](_0x59a4bb);return _0x6bc2fd[_0x5ddf('0x20')](_0x5ddf('0x21'),_0x57e401+'-'+_0x27ae26+'/'+_0x5df2be)[_0x5ddf('0x1b')](_0x163409);}return null;};}function patchUpdates(_0x1cbe00){return function(_0x1d1433){try{jsonpatch[_0x5ddf('0x22')](_0x1d1433,_0x1cbe00,!![]);}catch(_0x1dfa7d){return BPromise[_0x5ddf('0x23')](_0x1dfa7d);}return _0x1d1433[_0x5ddf('0x24')]();};}function saveUpdates(_0x47d00e,_0x39da32){return function(_0x4d0e6a){if(_0x4d0e6a){return _0x4d0e6a[_0x5ddf('0x25')](_0x47d00e)[_0x5ddf('0x26')](function(_0x85b380){return _0x85b380;});}return null;};}function removeEntity(_0x324b47,_0x29a2c1){return function(_0x64c61a){if(_0x64c61a){return _0x64c61a[_0x5ddf('0x27')]()['then'](function(){_0x324b47['status'](0xcc)[_0x5ddf('0x1a')]();});}};}function handleEntityNotFound(_0x65ac76,_0x28d391){return function(_0x3890f7){if(!_0x3890f7){_0x65ac76[_0x5ddf('0x28')](0x194);}return _0x3890f7;};}function handleError(_0x57ee40,_0x39c85){_0x39c85=_0x39c85||0x1f4;return function(_0x167ae6){logger[_0x5ddf('0x29')](_0x167ae6['stack']);if(_0x167ae6['name']){delete _0x167ae6[_0x5ddf('0x2a')];}_0x57ee40[_0x5ddf('0x19')](_0x39c85)[_0x5ddf('0x2b')](_0x167ae6);};}exports[_0x5ddf('0x2c')]=function(_0x38cf57,_0x11d965){var _0x459321={},_0x3c68e6={},_0x4f5715={'count':0x0,'rows':[]};var _0x398c49=_[_0x5ddf('0x2d')](db[_0x5ddf('0x2e')]['rawAttributes'],function(_0x208f51){return{'name':_0x208f51[_0x5ddf('0x2f')],'type':_0x208f51[_0x5ddf('0x30')]['key']};});_0x3c68e6[_0x5ddf('0x31')]=_[_0x5ddf('0x2d')](_0x398c49,_0x5ddf('0x2a'));_0x3c68e6[_0x5ddf('0x32')]=_[_0x5ddf('0x33')](_0x38cf57[_0x5ddf('0x32')]);_0x3c68e6[_0x5ddf('0x34')]=_['intersection'](_0x3c68e6[_0x5ddf('0x31')],_0x3c68e6['query']);_0x459321[_0x5ddf('0x35')]=_['intersection'](_0x3c68e6[_0x5ddf('0x31')],qs[_0x5ddf('0x36')](_0x38cf57['query'][_0x5ddf('0x36')]));_0x459321[_0x5ddf('0x35')]=_0x459321[_0x5ddf('0x35')]['length']?_0x459321[_0x5ddf('0x35')]:_0x3c68e6['model'];if(!_0x38cf57[_0x5ddf('0x32')][_0x5ddf('0x37')](_0x5ddf('0x38'))){_0x459321[_0x5ddf('0x1e')]=qs[_0x5ddf('0x1e')](_0x38cf57[_0x5ddf('0x32')]['limit']);_0x459321[_0x5ddf('0x1c')]=qs['offset'](_0x38cf57['query'][_0x5ddf('0x1c')]);}_0x459321[_0x5ddf('0x39')]=qs[_0x5ddf('0x3a')](_0x38cf57[_0x5ddf('0x32')]['sort']);_0x459321[_0x5ddf('0x3b')]=qs[_0x5ddf('0x34')](_[_0x5ddf('0x3c')](_0x38cf57[_0x5ddf('0x32')],_0x3c68e6[_0x5ddf('0x34')]),_0x398c49);if(_0x38cf57[_0x5ddf('0x32')][_0x5ddf('0x3d')]){_0x459321[_0x5ddf('0x3b')]=_[_0x5ddf('0x3e')](_0x459321[_0x5ddf('0x3b')],{'$or':_[_0x5ddf('0x2d')](_0x398c49,function(_0x257b5f){if(_0x257b5f[_0x5ddf('0x30')]!==_0x5ddf('0x3f')){var _0x4446e4={};_0x4446e4[_0x257b5f['name']]={'$like':'%'+_0x38cf57['query']['filter']+'%'};return _0x4446e4;}})});}_0x459321=_['merge']({},_0x459321,_0x38cf57['options']);var _0x333418={'where':_0x459321[_0x5ddf('0x3b')]};return db[_0x5ddf('0x2e')][_0x5ddf('0x1f')](_0x333418)[_0x5ddf('0x26')](function(_0x1e25cb){_0x4f5715[_0x5ddf('0x1f')]=_0x1e25cb;if(_0x38cf57[_0x5ddf('0x32')][_0x5ddf('0x40')]){_0x459321[_0x5ddf('0x41')]=[{'all':!![]}];}return db[_0x5ddf('0x2e')][_0x5ddf('0x42')](_0x459321);})[_0x5ddf('0x26')](function(_0x8be300){_0x4f5715[_0x5ddf('0x43')]=_0x8be300;return _0x4f5715;})['then'](respondWithFilteredResult(_0x11d965,_0x459321))[_0x5ddf('0x44')](handleError(_0x11d965,null));};exports[_0x5ddf('0x45')]=function(_0x4e7ea6,_0x2b6107){var _0x5e5b87={'raw':![],'where':{'id':_0x4e7ea6[_0x5ddf('0x46')]['id']}},_0x2b7edc={};_0x2b7edc['model']=_[_0x5ddf('0x33')](db['UserProfileSection'][_0x5ddf('0x47')]);_0x2b7edc[_0x5ddf('0x32')]=_[_0x5ddf('0x33')](_0x4e7ea6[_0x5ddf('0x32')]);_0x2b7edc[_0x5ddf('0x34')]=_['intersection'](_0x2b7edc[_0x5ddf('0x31')],_0x2b7edc[_0x5ddf('0x32')]);_0x5e5b87[_0x5ddf('0x35')]=_[_0x5ddf('0x48')](_0x2b7edc[_0x5ddf('0x31')],qs[_0x5ddf('0x36')](_0x4e7ea6['query'][_0x5ddf('0x36')]));_0x5e5b87[_0x5ddf('0x35')]=_0x5e5b87[_0x5ddf('0x35')][_0x5ddf('0x49')]?_0x5e5b87[_0x5ddf('0x35')]:_0x2b7edc[_0x5ddf('0x31')];if(_0x4e7ea6[_0x5ddf('0x32')][_0x5ddf('0x40')]){_0x5e5b87['include']=[{'all':!![]}];}_0x5e5b87=_[_0x5ddf('0x3e')]({},_0x5e5b87,_0x4e7ea6[_0x5ddf('0x4a')]);return db[_0x5ddf('0x2e')][_0x5ddf('0x4b')](_0x5e5b87)[_0x5ddf('0x26')](handleEntityNotFound(_0x2b6107,null))['then'](respondWithResult(_0x2b6107,null))[_0x5ddf('0x44')](handleError(_0x2b6107,null));};exports[_0x5ddf('0x4c')]=function(_0x4a11c8,_0x801950){return db[_0x5ddf('0x2e')][_0x5ddf('0x4c')](_0x4a11c8[_0x5ddf('0x4d')],{})[_0x5ddf('0x26')](respondWithResult(_0x801950,0xc9))[_0x5ddf('0x44')](handleError(_0x801950,null));};exports[_0x5ddf('0x25')]=function(_0x4d3881,_0x182485){if(_0x4d3881[_0x5ddf('0x4d')]['id']){delete _0x4d3881['body']['id'];}return db['UserProfileSection'][_0x5ddf('0x4b')]({'where':{'id':_0x4d3881[_0x5ddf('0x46')]['id']}})['then'](handleEntityNotFound(_0x182485,null))[_0x5ddf('0x26')](saveUpdates(_0x4d3881[_0x5ddf('0x4d')],null))[_0x5ddf('0x26')](respondWithResult(_0x182485,null))['catch'](handleError(_0x182485,null));};exports[_0x5ddf('0x27')]=function(_0x9d7c4c,_0x4e12d4){return db[_0x5ddf('0x2e')][_0x5ddf('0x4b')]({'where':{'id':_0x9d7c4c[_0x5ddf('0x46')]['id']}})[_0x5ddf('0x26')](handleEntityNotFound(_0x4e12d4,null))[_0x5ddf('0x26')](removeEntity(_0x4e12d4,null))[_0x5ddf('0x44')](handleError(_0x4e12d4,null));};exports[_0x5ddf('0x4e')]=function(_0x1997c5,_0x1d3663){return db[_0x5ddf('0x2e')][_0x5ddf('0x4e')]()[_0x5ddf('0x26')](respondWithResult(_0x1d3663,null))[_0x5ddf('0x44')](handleError(_0x1d3663,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3029214..0dcc8cc 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 _0x8695=['./userProfileSection.attributes','exports','define','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x58c80d,_0x1017a5){var _0x33612e=function(_0x5ce320){while(--_0x5ce320){_0x58c80d['push'](_0x58c80d['shift']());}};_0x33612e(++_0x1017a5);}(_0x8695,0xc5));var _0x5869=function(_0x78d9ed,_0x54c591){_0x78d9ed=_0x78d9ed-0x0;var _0x40254e=_0x8695[_0x78d9ed];return _0x40254e;};'use strict';var _=require(_0x5869('0x0'));var util=require(_0x5869('0x1'));var logger=require(_0x5869('0x2'))('api');var moment=require(_0x5869('0x3'));var BPromise=require(_0x5869('0x4'));var rp=require(_0x5869('0x5'));var fs=require('fs');var path=require(_0x5869('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5869('0x7'));module[_0x5869('0x8')]=function(_0x30cd64,_0x2f391f){return _0x30cd64[_0x5869('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x5869('0xa'),_0x5869('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78a7=['compositeIndex','sectionId','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x2a116a,_0x3dcbbb){var _0x49d0a0=function(_0x2637f0){while(--_0x2637f0){_0x2a116a['push'](_0x2a116a['shift']());}};_0x49d0a0(++_0x3dcbbb);}(_0x78a7,0x80));var _0x778a=function(_0x55bf96,_0x7267a7){_0x55bf96=_0x55bf96-0x0;var _0x5092ef=_0x78a7[_0x55bf96];return _0x5092ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x778a('0x0'))(_0x778a('0x1'));var moment=require(_0x778a('0x2'));var BPromise=require(_0x778a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x778a('0x4'));var rimraf=require(_0x778a('0x5'));var config=require(_0x778a('0x6'));var attributes=require(_0x778a('0x7'));module[_0x778a('0x8')]=function(_0x45f8b4,_0x5e98c9){return _0x45f8b4[_0x778a('0x9')](_0x778a('0xa'),attributes,{'tableName':_0x778a('0xb'),'paranoid':![],'indexes':[{'name':_0x778a('0xc'),'fields':[_0x778a('0xd'),'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 7dcf60a..157ec16 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 _0x6a54=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2dffa9,_0x17989e){var _0x170980=function(_0x45c2a3){while(--_0x45c2a3){_0x2dffa9['push'](_0x2dffa9['shift']());}};_0x170980(++_0x17989e);}(_0x6a54,0xe1));var _0x46a5=function(_0x46e94c,_0x3e897d){_0x46e94c=_0x46e94c-0x0;var _0x4688b6=_0x6a54[_0x46e94c];return _0x4688b6;};'use strict';var _=require(_0x46a5('0x0'));var util=require(_0x46a5('0x1'));var moment=require(_0x46a5('0x2'));var BPromise=require(_0x46a5('0x3'));var rs=require(_0x46a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46a5('0x5'))['db'];var utils=require(_0x46a5('0x6'));var logger=require(_0x46a5('0x7'))(_0x46a5('0x8'));var config=require('../../config/environment');var jayson=require(_0x46a5('0x9'));var client=jayson[_0x46a5('0xa')][_0x46a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d8d49,_0x361201,_0x1f7562){return new BPromise(function(_0x3969aa,_0x47db02){return client[_0x46a5('0xc')](_0x1d8d49,_0x1f7562)[_0x46a5('0xd')](function(_0x490445){logger[_0x46a5('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x361201,'request\x20sent');logger[_0x46a5('0xf')](_0x46a5('0x10'),_0x361201,'request\x20sent',JSON[_0x46a5('0x11')](_0x490445));if(_0x490445[_0x46a5('0x12')]){if(_0x490445[_0x46a5('0x12')][_0x46a5('0x13')]===0x1f4){logger[_0x46a5('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x361201,_0x490445[_0x46a5('0x12')][_0x46a5('0x14')]);return _0x47db02(_0x490445['error'][_0x46a5('0x14')]);}logger[_0x46a5('0x12')](_0x46a5('0x15'),_0x361201,_0x490445[_0x46a5('0x12')][_0x46a5('0x14')]);return _0x3969aa(_0x490445[_0x46a5('0x12')][_0x46a5('0x14')]);}else{logger[_0x46a5('0xe')](_0x46a5('0x15'),_0x361201,_0x46a5('0x16'));_0x3969aa(_0x490445['result']['message']);}})[_0x46a5('0x17')](function(_0x7f136d){logger['error'](_0x46a5('0x15'),_0x361201,_0x7f136d);_0x47db02(_0x7f136d);});});} \ No newline at end of file +var _0xe024=['../../config/environment','jayson/promise','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x2267e9,_0x484306){var _0x46a637=function(_0x2c0ce6){while(--_0x2c0ce6){_0x2267e9['push'](_0x2267e9['shift']());}};_0x46a637(++_0x484306);}(_0xe024,0x161));var _0x4e02=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0xe024[_0x193ddf];return _0x5bc6df;};'use strict';var _=require(_0x4e02('0x0'));var util=require(_0x4e02('0x1'));var moment=require(_0x4e02('0x2'));var BPromise=require(_0x4e02('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e02('0x4'));var db=require(_0x4e02('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e02('0x6'));var config=require(_0x4e02('0x7'));var jayson=require(_0x4e02('0x8'));var client=jayson[_0x4e02('0x9')][_0x4e02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dc13b,_0x4651bf,_0x304fe2){return new BPromise(function(_0x175d9a,_0x1ca861){return client['request'](_0x5dc13b,_0x304fe2)[_0x4e02('0xb')](function(_0x245f3c){logger['info'](_0x4e02('0xc'),_0x4651bf,_0x4e02('0xd'));logger['debug'](_0x4e02('0xe'),_0x4651bf,_0x4e02('0xd'),JSON[_0x4e02('0xf')](_0x245f3c));if(_0x245f3c[_0x4e02('0x10')]){if(_0x245f3c[_0x4e02('0x10')]['code']===0x1f4){logger['error'](_0x4e02('0xc'),_0x4651bf,_0x245f3c[_0x4e02('0x10')][_0x4e02('0x11')]);return _0x1ca861(_0x245f3c['error'][_0x4e02('0x11')]);}logger[_0x4e02('0x10')](_0x4e02('0xc'),_0x4651bf,_0x245f3c['error']['message']);return _0x175d9a(_0x245f3c['error'][_0x4e02('0x11')]);}else{logger[_0x4e02('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x4651bf,'request\x20sent');_0x175d9a(_0x245f3c['result']['message']);}})[_0x4e02('0x13')](function(_0x404c87){logger['error'](_0x4e02('0xc'),_0x4651bf,_0x404c87);_0x1ca861(_0x404c87);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 50db037..584b3d6 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3cbf78,_0x49e26f){var _0x1791b1=function(_0x39a239){while(--_0x39a239){_0x3cbf78['push'](_0x3cbf78['shift']());}};_0x1791b1(++_0x49e26f);}(_0x70e0,0x17b));var _0x070e=function(_0x4fc074,_0x177b53){_0x4fc074=_0x4fc074-0x0;var _0x216754=_0x70e0[_0x4fc074];return _0x216754;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5091ac,_0x347ff7){var _0x40524b=function(_0x754225){while(--_0x754225){_0x5091ac['push'](_0x5091ac['shift']());}};_0x40524b(++_0x347ff7);}(_0x70e0,0x17b));var _0x070e=function(_0x19fc20,_0x327b3a){_0x19fc20=_0x19fc20-0x0;var _0x85d9e6=_0x70e0[_0x19fc20];return _0x85d9e6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index a0fc744..6733970 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 _0x2fa9=['sequelize','exports','INTEGER'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x2fa9,0x144));var _0x92fa=function(_0xe7902a,_0x49d79f){_0xe7902a=_0xe7902a-0x0;var _0x14db37=_0x2fa9[_0xe7902a];return _0x14db37;};'use strict';var Sequelize=require(_0x92fa('0x0'));module[_0x92fa('0x1')]={'penalty':{'type':Sequelize[_0x92fa('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9806=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9806,0x193));var _0x6980=function(_0x125550,_0x11ce62){_0x125550=_0x125550-0x0;var _0x123a1a=_0x9806[_0x125550];return _0x123a1a;};'use strict';var Sequelize=require(_0x6980('0x0'));module[_0x6980('0x1')]={'penalty':{'type':Sequelize[_0x6980('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 3805f59..b3be874 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 _0xc4aa=['bluebird','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'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 _0x3f8a=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4cbb4a,_0x532f48){var _0x6f6285=function(_0x60d4d2){while(--_0x60d4d2){_0x4cbb4a['push'](_0x4cbb4a['shift']());}};_0x6f6285(++_0x532f48);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x30cae7,_0x1116cc){_0x30cae7=_0x30cae7-0x0;var _0x38b11b=_0x3f8a[_0x30cae7];return _0x38b11b;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index cb9249b..f3429d2 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 _0x2d37=['jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ee73b,_0x12dd9e){var _0x5217af=function(_0x3aecd4){while(--_0x3aecd4){_0x5ee73b['push'](_0x5ee73b['shift']());}};_0x5217af(++_0x12dd9e);}(_0x2d37,0xf3));var _0x72d3=function(_0x27aea7,_0x401bd6){_0x27aea7=_0x27aea7-0x0;var _0x54f32f=_0x2d37[_0x27aea7];return _0x54f32f;};'use strict';var _=require(_0x72d3('0x0'));var util=require('util');var moment=require(_0x72d3('0x1'));var BPromise=require(_0x72d3('0x2'));var rs=require(_0x72d3('0x3'));var fs=require('fs');var Redis=require(_0x72d3('0x4'));var db=require(_0x72d3('0x5'))['db'];var utils=require(_0x72d3('0x6'));var logger=require(_0x72d3('0x7'))(_0x72d3('0x8'));var config=require('../../config/environment');var jayson=require(_0x72d3('0x9'));var client=jayson[_0x72d3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11a245,_0x5924ee,_0x59cf35){return new BPromise(function(_0x106670,_0x4a973f){return client[_0x72d3('0xb')](_0x11a245,_0x59cf35)[_0x72d3('0xc')](function(_0x4cae60){logger[_0x72d3('0xd')](_0x72d3('0xe'),_0x5924ee,_0x72d3('0xf'));logger['debug'](_0x72d3('0x10'),_0x5924ee,'request\x20sent',JSON[_0x72d3('0x11')](_0x4cae60));if(_0x4cae60[_0x72d3('0x12')]){if(_0x4cae60[_0x72d3('0x12')]['code']===0x1f4){logger[_0x72d3('0x12')](_0x72d3('0xe'),_0x5924ee,_0x4cae60[_0x72d3('0x12')]['message']);return _0x4a973f(_0x4cae60['error']['message']);}logger['error'](_0x72d3('0xe'),_0x5924ee,_0x4cae60[_0x72d3('0x12')][_0x72d3('0x13')]);return _0x106670(_0x4cae60[_0x72d3('0x12')]['message']);}else{logger[_0x72d3('0xd')](_0x72d3('0xe'),_0x5924ee,_0x72d3('0xf'));_0x106670(_0x4cae60[_0x72d3('0x14')][_0x72d3('0x13')]);}})['catch'](function(_0x18deea){logger[_0x72d3('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5924ee,_0x18deea);_0x4a973f(_0x18deea);});});} \ No newline at end of file +var _0x71ce=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x93b4b7,_0x1492dd){var _0x4ef863=function(_0xd7b0f1){while(--_0xd7b0f1){_0x93b4b7['push'](_0x93b4b7['shift']());}};_0x4ef863(++_0x1492dd);}(_0x71ce,0x109));var _0xe71c=function(_0x33bfe5,_0xab5ebd){_0x33bfe5=_0x33bfe5-0x0;var _0x3965c5=_0x71ce[_0x33bfe5];return _0x3965c5;};'use strict';var _=require('lodash');var util=require(_0xe71c('0x0'));var moment=require(_0xe71c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe71c('0x2'));var fs=require('fs');var Redis=require(_0xe71c('0x3'));var db=require(_0xe71c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe71c('0x5'))(_0xe71c('0x6'));var config=require(_0xe71c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe71c('0x8')][_0xe71c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfa464f,_0x4d30d6,_0x73084b){return new BPromise(function(_0x4bbb03,_0x303a35){return client[_0xe71c('0xa')](_0xfa464f,_0x73084b)[_0xe71c('0xb')](function(_0x323a42){logger[_0xe71c('0xc')](_0xe71c('0xd'),_0x4d30d6,_0xe71c('0xe'));logger[_0xe71c('0xf')](_0xe71c('0x10'),_0x4d30d6,'request\x20sent',JSON[_0xe71c('0x11')](_0x323a42));if(_0x323a42[_0xe71c('0x12')]){if(_0x323a42[_0xe71c('0x12')][_0xe71c('0x13')]===0x1f4){logger[_0xe71c('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x4d30d6,_0x323a42[_0xe71c('0x12')][_0xe71c('0x14')]);return _0x303a35(_0x323a42[_0xe71c('0x12')][_0xe71c('0x14')]);}logger[_0xe71c('0x12')](_0xe71c('0xd'),_0x4d30d6,_0x323a42[_0xe71c('0x12')][_0xe71c('0x14')]);return _0x4bbb03(_0x323a42['error'][_0xe71c('0x14')]);}else{logger[_0xe71c('0xc')](_0xe71c('0xd'),_0x4d30d6,_0xe71c('0xe'));_0x4bbb03(_0x323a42[_0xe71c('0x15')]['message']);}})[_0xe71c('0x16')](function(_0x430bea){logger[_0xe71c('0x12')](_0xe71c('0xd'),_0x4d30d6,_0x430bea);_0x303a35(_0x430bea);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index db9a26d..f85a964 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 _0x6519=['INTEGER'];(function(_0x268b25,_0x539ab3){var _0x414334=function(_0x30aa30){while(--_0x30aa30){_0x268b25['push'](_0x268b25['shift']());}};_0x414334(++_0x539ab3);}(_0x6519,0x1a2));var _0x9651=function(_0x20a394,_0x5c4e0c){_0x20a394=_0x20a394-0x0;var _0x8a454f=_0x6519[_0x20a394];return _0x8a454f;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0x9651('0x0')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xec76=['INTEGER','sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xec76,0x121));var _0x6ec7=function(_0x2fd809,_0x2a62cb){_0x2fd809=_0x2fd809-0x0;var _0x13b7b2=_0xec76[_0x2fd809];return _0x13b7b2;};'use strict';var Sequelize=require(_0x6ec7('0x0'));module[_0x6ec7('0x1')]={'UserId':{'type':Sequelize[_0x6ec7('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6ec7('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 8ab389f..789f2d0 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(_0x2c9c0d,_0x317bb4){var _0x2e6018=function(_0x4c4a04){while(--_0x4c4a04){_0x2c9c0d['push'](_0x2c9c0d['shift']());}};_0x2e6018(++_0x317bb4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x193847,_0x193568){var _0x13eacc=function(_0xe63c5e){while(--_0xe63c5e){_0x193847['push'](_0x193847['shift']());}};_0x13eacc(++_0x193568);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 28617e0..ab9d3d8 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3f1b70,_0x52affe){var _0x373e90=function(_0x99c3d1){while(--_0x99c3d1){_0x3f1b70['push'](_0x3f1b70['shift']());}};_0x373e90(++_0x52affe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fc735,_0x11db60){var _0x574095=function(_0x421590){while(--_0x421590){_0x1fc735['push'](_0x1fc735['shift']());}};_0x574095(++_0x11db60);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 5267414..0ab59ef 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 _0xd125=['sequelize','exports'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0xd125,0xf0));var _0x5d12=function(_0x3ec282,_0x2fad7a){_0x3ec282=_0x3ec282-0x0;var _0x9cb2b5=_0xd125[_0x3ec282];return _0x9cb2b5;};'use strict';var Sequelize=require(_0x5d12('0x0'));module[_0x5d12('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xef45=['exports','INTEGER','sequelize'];(function(_0x8f70f2,_0x3c8ca9){var _0x4a5e19=function(_0x26fc9c){while(--_0x26fc9c){_0x8f70f2['push'](_0x8f70f2['shift']());}};_0x4a5e19(++_0x3c8ca9);}(_0xef45,0xe3));var _0x5ef4=function(_0x1d8ebd,_0x583b23){_0x1d8ebd=_0x1d8ebd-0x0;var _0x11974c=_0xef45[_0x1d8ebd];return _0x11974c;};'use strict';var Sequelize=require(_0x5ef4('0x0'));module[_0x5ef4('0x1')]={'penalty':{'type':Sequelize[_0x5ef4('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 8f312ed..fb42ce0 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 _0xacc2=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xacc2,0x1ea));var _0x2acc=function(_0x4c758b,_0x5c5d87){_0x4c758b=_0x4c758b-0x0;var _0x3ca9fd=_0xacc2[_0x4c758b];return _0x3ca9fd;};'use strict';var _=require(_0x2acc('0x0'));var util=require(_0x2acc('0x1'));var logger=require(_0x2acc('0x2'))(_0x2acc('0x3'));var moment=require(_0x2acc('0x4'));var BPromise=require(_0x2acc('0x5'));var rp=require(_0x2acc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2acc('0x7'));var config=require(_0x2acc('0x8'));var attributes=require(_0x2acc('0x9'));module['exports']=function(_0x988347,_0x1230b5){return _0x988347['define'](_0x2acc('0xa'),attributes,{'tableName':_0x2acc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb4d=['path','./userVoiceQueue.attributes','exports','UserVoiceQueue','lodash','util','../../config/logger','moment','request-promise'];(function(_0x14c3a8,_0x45b63e){var _0x41632f=function(_0x40be03){while(--_0x40be03){_0x14c3a8['push'](_0x14c3a8['shift']());}};_0x41632f(++_0x45b63e);}(_0xdb4d,0x1e1));var _0xddb4=function(_0x45da8e,_0x5e2f98){_0x45da8e=_0x45da8e-0x0;var _0x4375a6=_0xdb4d[_0x45da8e];return _0x4375a6;};'use strict';var _=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var logger=require(_0xddb4('0x2'))('api');var moment=require(_0xddb4('0x3'));var BPromise=require('bluebird');var rp=require(_0xddb4('0x4'));var fs=require('fs');var path=require(_0xddb4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xddb4('0x6'));module[_0xddb4('0x7')]=function(_0x4f4e93,_0x93080f){return _0x4f4e93['define'](_0xddb4('0x8'),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 a3433b9..ca837e4 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 _0x141e=['error','code','message','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4afcf0,_0x3606ca){var _0x3b1441=function(_0x549a66){while(--_0x549a66){_0x4afcf0['push'](_0x4afcf0['shift']());}};_0x3b1441(++_0x3606ca);}(_0x141e,0x1e3));var _0xe141=function(_0x323e36,_0xf35032){_0x323e36=_0x323e36-0x0;var _0x62f803=_0x141e[_0x323e36];return _0x62f803;};'use strict';var _=require(_0xe141('0x0'));var util=require(_0xe141('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe141('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe141('0x3'))['db'];var utils=require(_0xe141('0x4'));var logger=require(_0xe141('0x5'))(_0xe141('0x6'));var config=require(_0xe141('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe141('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26d454,_0x19a8fe,_0x1f458e){return new BPromise(function(_0xf75281,_0x3fc42f){return client[_0xe141('0x9')](_0x26d454,_0x1f458e)[_0xe141('0xa')](function(_0x40fa56){logger[_0xe141('0xb')](_0xe141('0xc'),_0x19a8fe,_0xe141('0xd'));logger[_0xe141('0xe')](_0xe141('0xf'),_0x19a8fe,_0xe141('0xd'),JSON[_0xe141('0x10')](_0x40fa56));if(_0x40fa56[_0xe141('0x11')]){if(_0x40fa56['error'][_0xe141('0x12')]===0x1f4){logger[_0xe141('0x11')](_0xe141('0xc'),_0x19a8fe,_0x40fa56[_0xe141('0x11')][_0xe141('0x13')]);return _0x3fc42f(_0x40fa56['error'][_0xe141('0x13')]);}logger[_0xe141('0x11')](_0xe141('0xc'),_0x19a8fe,_0x40fa56[_0xe141('0x11')][_0xe141('0x13')]);return _0xf75281(_0x40fa56[_0xe141('0x11')][_0xe141('0x13')]);}else{logger[_0xe141('0xb')](_0xe141('0xc'),_0x19a8fe,_0xe141('0xd'));_0xf75281(_0x40fa56['result'][_0xe141('0x13')]);}})['catch'](function(_0x308239){logger[_0xe141('0x11')](_0xe141('0xc'),_0x19a8fe,_0x308239);_0x3fc42f(_0x308239);});});} \ No newline at end of file +var _0xbdef=['jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3e4dca,_0x4541b3){var _0x3d3e08=function(_0x2f9d03){while(--_0x2f9d03){_0x3e4dca['push'](_0x3e4dca['shift']());}};_0x3d3e08(++_0x4541b3);}(_0xbdef,0x1db));var _0xfbde=function(_0x4e47f7,_0x205e52){_0x4e47f7=_0x4e47f7-0x0;var _0x24b111=_0xbdef[_0x4e47f7];return _0x24b111;};'use strict';var _=require(_0xfbde('0x0'));var util=require(_0xfbde('0x1'));var moment=require('moment');var BPromise=require(_0xfbde('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbde('0x3'));var db=require(_0xfbde('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbde('0x5'))(_0xfbde('0x6'));var config=require(_0xfbde('0x7'));var jayson=require(_0xfbde('0x8'));var client=jayson[_0xfbde('0x9')][_0xfbde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15355b,_0x7c126a,_0x59432c){return new BPromise(function(_0x763d7b,_0x2ad794){return client[_0xfbde('0xb')](_0x15355b,_0x59432c)[_0xfbde('0xc')](function(_0x2b0b50){logger[_0xfbde('0xd')](_0xfbde('0xe'),_0x7c126a,_0xfbde('0xf'));logger[_0xfbde('0x10')](_0xfbde('0x11'),_0x7c126a,'request\x20sent',JSON[_0xfbde('0x12')](_0x2b0b50));if(_0x2b0b50['error']){if(_0x2b0b50[_0xfbde('0x13')][_0xfbde('0x14')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x7c126a,_0x2b0b50[_0xfbde('0x13')]['message']);return _0x2ad794(_0x2b0b50[_0xfbde('0x13')][_0xfbde('0x15')]);}logger[_0xfbde('0x13')](_0xfbde('0xe'),_0x7c126a,_0x2b0b50['error'][_0xfbde('0x15')]);return _0x763d7b(_0x2b0b50[_0xfbde('0x13')][_0xfbde('0x15')]);}else{logger['info'](_0xfbde('0xe'),_0x7c126a,_0xfbde('0xf'));_0x763d7b(_0x2b0b50['result'][_0xfbde('0x15')]);}})[_0xfbde('0x16')](function(_0x232069){logger[_0xfbde('0x13')](_0xfbde('0xe'),_0x7c126a,_0x232069);_0x2ad794(_0x232069);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 8a2e386..d4576ff 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x2d6e76,_0x3684f0){var _0x4f651b=function(_0x469f42){while(--_0x469f42){_0x2d6e76['push'](_0x2d6e76['shift']());}};_0x4f651b(++_0x3684f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 dd8a0d7..5961573 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 _0x63e5=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x1ad7eb,_0x51ad26){var _0x1ec8dc=function(_0x438ca1){while(--_0x438ca1){_0x1ad7eb['push'](_0x1ad7eb['shift']());}};_0x1ec8dc(++_0x51ad26);}(_0x63e5,0x74));var _0x563e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x63e5[_0x75f869];return _0x10af8b;};'use strict';var Sequelize=require(_0x563e('0x0'));module[_0x563e('0x1')]={'uniqueid':{'type':Sequelize[_0x563e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x563e('0x3')},'membername':{'type':Sequelize[_0x563e('0x4')],'allowNull':![],'comment':_0x563e('0x3')},'UserId':{'type':Sequelize[_0x563e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x563e('0x5'),'comment':_0x563e('0x3')},'VoiceQueueId':{'type':Sequelize[_0x563e('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x563e('0x4')],'allowNull':![],'unique':_0x563e('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x563e('0x2')](0xb),'defaultValue':0x0,'comment':_0x563e('0x3')}}; \ No newline at end of file +var _0x4053=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x2e68dd,_0x1f1f1d){var _0x29bb3b=function(_0x14b3d3){while(--_0x14b3d3){_0x2e68dd['push'](_0x2e68dd['shift']());}};_0x29bb3b(++_0x1f1f1d);}(_0x4053,0xd7));var _0x3405=function(_0x3420bd,_0x34703d){_0x3420bd=_0x3420bd-0x0;var _0x5c7793=_0x4053[_0x3420bd];return _0x5c7793;};'use strict';var Sequelize=require(_0x3405('0x0'));module[_0x3405('0x1')]={'uniqueid':{'type':Sequelize[_0x3405('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3405('0x3')},'membername':{'type':Sequelize[_0x3405('0x4')],'allowNull':![],'comment':_0x3405('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3405('0x4')],'allowNull':![],'unique':_0x3405('0x5'),'comment':_0x3405('0x3')},'VoiceQueueId':{'type':Sequelize[_0x3405('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x3405('0x3')},'penalty':{'type':Sequelize[_0x3405('0x2')](0xb),'defaultValue':0x0,'comment':_0x3405('0x3')},'paused':{'type':Sequelize[_0x3405('0x2')](0xb),'defaultValue':0x0,'comment':_0x3405('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 45f1569..e380dac 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 _0xec2d=['../../mysqldb','UserVoiceQueueRt','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4ef577,_0x5a6e06){var _0x59cdeb=function(_0x40fb90){while(--_0x40fb90){_0x4ef577['push'](_0x4ef577['shift']());}};_0x59cdeb(++_0x5a6e06);}(_0xec2d,0x1a6));var _0xdec2=function(_0x4cbf60,_0x309b24){_0x4cbf60=_0x4cbf60-0x0;var _0x38341a=_0xec2d[_0x4cbf60];return _0x38341a;};'use strict';var EventEmitter=require(_0xdec2('0x0'));var UserVoiceQueueRt=require(_0xdec2('0x1'))['db'][_0xdec2('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdec2('0x3'),'afterUpdate':'update','afterDestroy':_0xdec2('0x4')};function emitEvent(_0x3f33bd){return function(_0x5087f0,_0x1959e7,_0x10391b){UserVoiceQueueRtEvents[_0xdec2('0x5')](_0x3f33bd+':'+_0x5087f0['id'],_0x5087f0);UserVoiceQueueRtEvents[_0xdec2('0x5')](_0x3f33bd,_0x5087f0);_0x10391b(null);};}for(var e in events){if(events[_0xdec2('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xdec2('0x7')](e,emitEvent(event));}}module[_0xdec2('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4bf7=['update','remove','emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x3f6fe3,_0x27b19a){var _0x143ba9=function(_0xc7f90f){while(--_0xc7f90f){_0x3f6fe3['push'](_0x3f6fe3['shift']());}};_0x143ba9(++_0x27b19a);}(_0x4bf7,0x6a));var _0x74bf=function(_0x1e9f7c,_0x5941b2){_0x1e9f7c=_0x1e9f7c-0x0;var _0x1112a3=_0x4bf7[_0x1e9f7c];return _0x1112a3;};'use strict';var EventEmitter=require(_0x74bf('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x74bf('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x74bf('0x2')](0x0);var events={'afterCreate':_0x74bf('0x3'),'afterUpdate':_0x74bf('0x4'),'afterDestroy':_0x74bf('0x5')};function emitEvent(_0x39a585){return function(_0x274274,_0xf0beb,_0x185b80){UserVoiceQueueRtEvents['emit'](_0x39a585+':'+_0x274274['id'],_0x274274);UserVoiceQueueRtEvents[_0x74bf('0x6')](_0x39a585,_0x274274);_0x185b80(null);};}for(var e in events){if(events[_0x74bf('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x74bf('0x8')](e,emitEvent(event));}}module[_0x74bf('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 755732e..e0e739c 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 _0x7ba2=['util','../../config/logger','moment','bluebird','request-promise','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x7c13d1,_0x583546){var _0x10e5fa=function(_0x303418){while(--_0x303418){_0x7c13d1['push'](_0x7c13d1['shift']());}};_0x10e5fa(++_0x583546);}(_0x7ba2,0xc7));var _0x27ba=function(_0x49588f,_0x3e56ea){_0x49588f=_0x49588f-0x0;var _0x41b293=_0x7ba2[_0x49588f];return _0x41b293;};'use strict';var _=require(_0x27ba('0x0'));var util=require(_0x27ba('0x1'));var logger=require(_0x27ba('0x2'))('api');var moment=require(_0x27ba('0x3'));var BPromise=require(_0x27ba('0x4'));var rp=require(_0x27ba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x27ba('0x6')]=function(_0x4f23fd,_0x39f858){return _0x4f23fd[_0x27ba('0x7')](_0x27ba('0x8'),attributes,{'tableName':_0x27ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89f0=['exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird','request-promise','rimraf','./userVoiceQueueRt.attributes'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x89f0,0x143));var _0x089f=function(_0xeb134b,_0x2aa58a){_0xeb134b=_0xeb134b-0x0;var _0x50a9db=_0x89f0[_0xeb134b];return _0x50a9db;};'use strict';var _=require(_0x089f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x089f('0x1'));var moment=require(_0x089f('0x2'));var BPromise=require(_0x089f('0x3'));var rp=require(_0x089f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x089f('0x5'));var config=require('../../config/environment');var attributes=require(_0x089f('0x6'));module[_0x089f('0x7')]=function(_0x55ccdb,_0xa264d3){return _0x55ccdb['define'](_0x089f('0x8'),attributes,{'tableName':_0x089f('0x9'),'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 b448077..f1c5028 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 _0x6b84=['GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch'];(function(_0x53a07a,_0x30f20f){var _0x2566ce=function(_0xa042aa){while(--_0xa042aa){_0x53a07a['push'](_0x53a07a['shift']());}};_0x2566ce(++_0x30f20f);}(_0x6b84,0x180));var _0x46b8=function(_0x18fad2,_0x59980d){_0x18fad2=_0x18fad2-0x0;var _0x4b3a97=_0x6b84[_0x18fad2];return _0x4b3a97;};'use strict';var _=require('lodash');var util=require(_0x46b8('0x0'));var moment=require(_0x46b8('0x1'));var BPromise=require(_0x46b8('0x2'));var rs=require(_0x46b8('0x3'));var fs=require('fs');var Redis=require(_0x46b8('0x4'));var db=require(_0x46b8('0x5'))['db'];var utils=require(_0x46b8('0x6'));var logger=require('../../config/logger')(_0x46b8('0x7'));var config=require(_0x46b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46b8('0x9')][_0x46b8('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x46b8('0xb')],{'host':_0x46b8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46b8('0xb')]));require(_0x46b8('0xd'))[_0x46b8('0xe')](socket);function respondWithRpcPromise(_0x570357,_0x456482,_0x2a6706){return new BPromise(function(_0x49a1e6,_0x3062e9){return client['request'](_0x570357,_0x2a6706)[_0x46b8('0xf')](function(_0x3748b7){logger['info'](_0x46b8('0x10'),_0x456482,_0x46b8('0x11'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x456482,_0x46b8('0x11'),JSON[_0x46b8('0x12')](_0x3748b7));if(_0x3748b7['error']){if(_0x3748b7[_0x46b8('0x13')][_0x46b8('0x14')]===0x1f4){logger['error'](_0x46b8('0x10'),_0x456482,_0x3748b7['error'][_0x46b8('0x15')]);return _0x3062e9(_0x3748b7['error'][_0x46b8('0x15')]);}logger['error'](_0x46b8('0x10'),_0x456482,_0x3748b7[_0x46b8('0x13')][_0x46b8('0x15')]);return _0x49a1e6(_0x3748b7['error']['message']);}else{logger[_0x46b8('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x456482,_0x46b8('0x11'));_0x49a1e6(_0x3748b7['result'][_0x46b8('0x15')]);}})[_0x46b8('0x17')](function(_0x17ab0d){logger[_0x46b8('0x13')](_0x46b8('0x10'),_0x456482,_0x17ab0d);_0x3062e9(_0x17ab0d);});});}exports[_0x46b8('0x18')]=function(_0x1c016b){var _0x1460e7=this;return new Promise(function(_0x12675a,_0x56ae4e){return db['UserVoiceQueueRt'][_0x46b8('0x19')]({'raw':_0x1c016b[_0x46b8('0x1a')]?_0x1c016b[_0x46b8('0x1a')][_0x46b8('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c016b[_0x46b8('0x1a')]?_0x1c016b['options'][_0x46b8('0x1c')]||null:null,'attributes':[[db[_0x46b8('0x1d')]['fn']('COUNT',db[_0x46b8('0x1d')]['fn']('IF',db[_0x46b8('0x1d')][_0x46b8('0x1e')](_0x46b8('0x1f')))),_0x46b8('0x20')]]})['then'](function(_0x529128){logger[_0x46b8('0x16')](_0x46b8('0x18'),_0x1c016b);logger[_0x46b8('0x21')](_0x46b8('0x18'),_0x1c016b,JSON['stringify'](_0x529128));_0x12675a(_0x529128);})['catch'](function(_0x1dcbbf){logger[_0x46b8('0x13')](_0x46b8('0x18'),_0x1dcbbf[_0x46b8('0x15')],_0x1c016b);_0x56ae4e(_0x1460e7[_0x46b8('0x13')](0x1f4,_0x1dcbbf[_0x46b8('0x15')]));});});}; \ No newline at end of file +var _0xb74b=['result','catch','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','GetVoiceQueueRtPauses','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x393438,_0x4883a6){var _0x2a0986=function(_0x15a93b){while(--_0x15a93b){_0x393438['push'](_0x393438['shift']());}};_0x2a0986(++_0x4883a6);}(_0xb74b,0xbf));var _0xbb74=function(_0x51f84a,_0x445f17){_0x51f84a=_0x51f84a-0x0;var _0x4ba63d=_0xb74b[_0x51f84a];return _0x4ba63d;};'use strict';var _=require(_0xbb74('0x0'));var util=require(_0xbb74('0x1'));var moment=require('moment');var BPromise=require(_0xbb74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb74('0x3'));var db=require(_0xbb74('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb74('0x5'))('rpc');var config=require(_0xbb74('0x6'));var jayson=require(_0xbb74('0x7'));var client=jayson[_0xbb74('0x8')][_0xbb74('0x9')]({'port':0x232a});config[_0xbb74('0xa')]=_[_0xbb74('0xb')](config[_0xbb74('0xa')],{'host':_0xbb74('0xc'),'port':0x18eb});var socket=require(_0xbb74('0xd'))(new Redis(config['redis']));require(_0xbb74('0xe'))[_0xbb74('0xf')](socket);function respondWithRpcPromise(_0x15cc42,_0x4f60ff,_0x14b89c){return new BPromise(function(_0x4ef951,_0x52cf98){return client['request'](_0x15cc42,_0x14b89c)[_0xbb74('0x10')](function(_0x577181){logger['info'](_0xbb74('0x11'),_0x4f60ff,_0xbb74('0x12'));logger[_0xbb74('0x13')](_0xbb74('0x14'),_0x4f60ff,_0xbb74('0x12'),JSON['stringify'](_0x577181));if(_0x577181[_0xbb74('0x15')]){if(_0x577181[_0xbb74('0x15')][_0xbb74('0x16')]===0x1f4){logger[_0xbb74('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4f60ff,_0x577181[_0xbb74('0x15')][_0xbb74('0x17')]);return _0x52cf98(_0x577181[_0xbb74('0x15')][_0xbb74('0x17')]);}logger['error'](_0xbb74('0x11'),_0x4f60ff,_0x577181[_0xbb74('0x15')][_0xbb74('0x17')]);return _0x4ef951(_0x577181[_0xbb74('0x15')]['message']);}else{logger[_0xbb74('0x18')](_0xbb74('0x11'),_0x4f60ff,_0xbb74('0x12'));_0x4ef951(_0x577181[_0xbb74('0x19')][_0xbb74('0x17')]);}})[_0xbb74('0x1a')](function(_0x4ef05c){logger[_0xbb74('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4f60ff,_0x4ef05c);_0x52cf98(_0x4ef05c);});});}exports['GetVoiceQueueRtPauses']=function(_0x3f8d71){var _0x34a326=this;return new Promise(function(_0x28a6ae,_0x528ccb){return db[_0xbb74('0x1b')][_0xbb74('0x1c')]({'raw':_0x3f8d71['options']?_0x3f8d71[_0xbb74('0x1d')][_0xbb74('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f8d71['options']?_0x3f8d71[_0xbb74('0x1d')][_0xbb74('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0xbb74('0x20'),db[_0xbb74('0x21')]['fn']('IF',db[_0xbb74('0x21')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xbb74('0x10')](function(_0xfc9dda){logger['info'](_0xbb74('0x22'),_0x3f8d71);logger[_0xbb74('0x13')]('GetVoiceQueueRtPauses',_0x3f8d71,JSON[_0xbb74('0x23')](_0xfc9dda));_0x28a6ae(_0xfc9dda);})[_0xbb74('0x1a')](function(_0x254dee){logger[_0xbb74('0x15')](_0xbb74('0x22'),_0x254dee['message'],_0x3f8d71);_0x528ccb(_0x34a326[_0xbb74('0x15')](0x1f4,_0x254dee[_0xbb74('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 27ff7ac..883c5d4 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 _0x88d5=['remove','update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x88d5,0x76));var _0x588d=function(_0x29cb11,_0x51b883){_0x29cb11=_0x29cb11-0x0;var _0x4ec483=_0x88d5[_0x29cb11];return _0x4ec483;};'use strict';var UserVoiceQueueRtEvents=require(_0x588d('0x0'));var events=[_0x588d('0x1'),_0x588d('0x2'),_0x588d('0x3')];function createListener(_0x315178,_0x5372b1){return function(_0xe46c98){_0x5372b1[_0x588d('0x4')](_0x315178,_0xe46c98);};}function removeListener(_0x504b52,_0x474e79){return function(){UserVoiceQueueRtEvents[_0x588d('0x5')](_0x504b52,_0x474e79);};}exports[_0x588d('0x6')]=function(_0x1b193f){for(var _0xecfb11=0x0,_0x413748=events['length'];_0xecfb11<_0x413748;_0xecfb11++){var _0x57699a=events[_0xecfb11];var _0x41ddf3=createListener(_0x588d('0x7')+_0x57699a,_0x1b193f);UserVoiceQueueRtEvents['on'](_0x57699a,_0x41ddf3);}}; \ No newline at end of file +var _0x448a=['removeListener','register','length','save','remove','emit'];(function(_0x7902d0,_0x378152){var _0x2ab4ac=function(_0x1837ee){while(--_0x1837ee){_0x7902d0['push'](_0x7902d0['shift']());}};_0x2ab4ac(++_0x378152);}(_0x448a,0x1ef));var _0xa448=function(_0x2db2e4,_0x49130e){_0x2db2e4=_0x2db2e4-0x0;var _0x2ef52d=_0x448a[_0x2db2e4];return _0x2ef52d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa448('0x0'),_0xa448('0x1'),'update'];function createListener(_0x3f08b0,_0x47909c){return function(_0x5ea7f4){_0x47909c[_0xa448('0x2')](_0x3f08b0,_0x5ea7f4);};}function removeListener(_0x3206fd,_0x57e1ea){return function(){UserVoiceQueueRtEvents[_0xa448('0x3')](_0x3206fd,_0x57e1ea);};}exports[_0xa448('0x4')]=function(_0x343b79){for(var _0x2c16e3=0x0,_0x12b0e2=events[_0xa448('0x5')];_0x2c16e3<_0x12b0e2;_0x2c16e3++){var _0x1ec2d8=events[_0x2c16e3];var _0x54bdb0=createListener('userVoiceQueueRt:'+_0x1ec2d8,_0x343b79);UserVoiceQueueRtEvents['on'](_0x1ec2d8,_0x54bdb0);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index e73ae53..d14dfc1 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x233662,_0x359ad6){var _0x1e82db=function(_0x5de5f0){while(--_0x5de5f0){_0x233662['push'](_0x233662['shift']());}};_0x1e82db(++_0x359ad6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0xcb91[_0x209fcd];return _0x501d5e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4a1412,_0x2b6ee8){var _0x2cc456=function(_0x2cf4a4){while(--_0x2cf4a4){_0x4a1412['push'](_0x4a1412['shift']());}};_0x2cc456(++_0x2b6ee8);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index ba13cd2..391f2c6 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 _0x5ec3=['exports','sequelize'];(function(_0xc506b2,_0x55a8dd){var _0x588d2a=function(_0x30ba1e){while(--_0x30ba1e){_0xc506b2['push'](_0xc506b2['shift']());}};_0x588d2a(++_0x55a8dd);}(_0x5ec3,0xa1));var _0x35ec=function(_0x4bf61e,_0x4ee0b6){_0x4bf61e=_0x4bf61e-0x0;var _0xb4d821=_0x5ec3[_0x4bf61e];return _0xb4d821;};'use strict';var Sequelize=require(_0x35ec('0x0'));module[_0x35ec('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf36f=['exports','INTEGER','sequelize'];(function(_0x45c3b1,_0x4c7f4d){var _0x4376bb=function(_0x18b344){while(--_0x18b344){_0x45c3b1['push'](_0x45c3b1['shift']());}};_0x4376bb(++_0x4c7f4d);}(_0xf36f,0x155));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xff36('0x0'));module[_0xff36('0x1')]={'penalty':{'type':Sequelize[_0xff36('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 6f9bb90..a6ae83c 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 _0xd503=['moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x4204c7,_0x3d87a3){var _0x4d3f3d=function(_0x23643d){while(--_0x23643d){_0x4204c7['push'](_0x4204c7['shift']());}};_0x4d3f3d(++_0x3d87a3);}(_0xd503,0x1dd));var _0x3d50=function(_0x2e3cda,_0x4571c6){_0x2e3cda=_0x2e3cda-0x0;var _0x3c85b2=_0xd503[_0x2e3cda];return _0x3c85b2;};'use strict';var _=require(_0x3d50('0x0'));var util=require(_0x3d50('0x1'));var logger=require(_0x3d50('0x2'))(_0x3d50('0x3'));var moment=require(_0x3d50('0x4'));var BPromise=require(_0x3d50('0x5'));var rp=require(_0x3d50('0x6'));var fs=require('fs');var path=require(_0x3d50('0x7'));var rimraf=require('rimraf');var config=require(_0x3d50('0x8'));var attributes=require(_0x3d50('0x9'));module['exports']=function(_0x50c85d,_0x190d30){return _0x50c85d[_0x3d50('0xa')](_0x3d50('0xb'),attributes,{'tableName':_0x3d50('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1f8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash'];(function(_0x4f6436,_0x4b59ac){var _0x3756b8=function(_0x3dd272){while(--_0x3dd272){_0x4f6436['push'](_0x4f6436['shift']());}};_0x3756b8(++_0x4b59ac);}(_0xc1f8,0x1df));var _0x8c1f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc1f8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8c1f('0x0'));var util=require('util');var logger=require(_0x8c1f('0x1'))(_0x8c1f('0x2'));var moment=require('moment');var BPromise=require(_0x8c1f('0x3'));var rp=require(_0x8c1f('0x4'));var fs=require('fs');var path=require(_0x8c1f('0x5'));var rimraf=require(_0x8c1f('0x6'));var config=require(_0x8c1f('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x8c1f('0x8')]=function(_0x91c35b,_0xe77753){return _0x91c35b[_0x8c1f('0x9')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index c937551..b4fb8ac 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 _0x59aa=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x47b7f3,_0x6f277a){var _0x264bea=function(_0x3cba3b){while(--_0x3cba3b){_0x47b7f3['push'](_0x47b7f3['shift']());}};_0x264bea(++_0x6f277a);}(_0x59aa,0x14a));var _0xa59a=function(_0x2f0801,_0x214ca1){_0x2f0801=_0x2f0801-0x0;var _0x5b7c3f=_0x59aa[_0x2f0801];return _0x5b7c3f;};'use strict';var _=require(_0xa59a('0x0'));var util=require(_0xa59a('0x1'));var moment=require(_0xa59a('0x2'));var BPromise=require(_0xa59a('0x3'));var rs=require(_0xa59a('0x4'));var fs=require('fs');var Redis=require(_0xa59a('0x5'));var db=require(_0xa59a('0x6'))['db'];var utils=require(_0xa59a('0x7'));var logger=require(_0xa59a('0x8'))(_0xa59a('0x9'));var config=require(_0xa59a('0xa'));var jayson=require(_0xa59a('0xb'));var client=jayson[_0xa59a('0xc')][_0xa59a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f73b5,_0x16586f,_0x6fca36){return new BPromise(function(_0x49d6ef,_0x19a321){return client[_0xa59a('0xe')](_0x5f73b5,_0x6fca36)[_0xa59a('0xf')](function(_0x4b1392){logger[_0xa59a('0x10')](_0xa59a('0x11'),_0x16586f,_0xa59a('0x12'));logger[_0xa59a('0x13')](_0xa59a('0x14'),_0x16586f,_0xa59a('0x12'),JSON[_0xa59a('0x15')](_0x4b1392));if(_0x4b1392[_0xa59a('0x16')]){if(_0x4b1392[_0xa59a('0x16')][_0xa59a('0x17')]===0x1f4){logger[_0xa59a('0x16')](_0xa59a('0x11'),_0x16586f,_0x4b1392[_0xa59a('0x16')][_0xa59a('0x18')]);return _0x19a321(_0x4b1392[_0xa59a('0x16')][_0xa59a('0x18')]);}logger[_0xa59a('0x16')](_0xa59a('0x11'),_0x16586f,_0x4b1392[_0xa59a('0x16')][_0xa59a('0x18')]);return _0x49d6ef(_0x4b1392[_0xa59a('0x16')][_0xa59a('0x18')]);}else{logger[_0xa59a('0x10')](_0xa59a('0x11'),_0x16586f,_0xa59a('0x12'));_0x49d6ef(_0x4b1392[_0xa59a('0x19')][_0xa59a('0x18')]);}})[_0xa59a('0x1a')](function(_0x2ca51d){logger['error'](_0xa59a('0x11'),_0x16586f,_0x2ca51d);_0x19a321(_0x2ca51d);});});} \ No newline at end of file +var _0x4432=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x550916,_0x5cf877){var _0x2f20d3=function(_0x2f6bcd){while(--_0x2f6bcd){_0x550916['push'](_0x550916['shift']());}};_0x2f20d3(++_0x5cf877);}(_0x4432,0x8e));var _0x2443=function(_0x32c45e,_0x29d229){_0x32c45e=_0x32c45e-0x0;var _0x495bfe=_0x4432[_0x32c45e];return _0x495bfe;};'use strict';var _=require(_0x2443('0x0'));var util=require('util');var moment=require(_0x2443('0x1'));var BPromise=require('bluebird');var rs=require(_0x2443('0x2'));var fs=require('fs');var Redis=require(_0x2443('0x3'));var db=require(_0x2443('0x4'))['db'];var utils=require(_0x2443('0x5'));var logger=require('../../config/logger')(_0x2443('0x6'));var config=require(_0x2443('0x7'));var jayson=require(_0x2443('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9e4355,_0x58dece,_0x598b32){return new BPromise(function(_0x31bff8,_0x30560d){return client[_0x2443('0x9')](_0x9e4355,_0x598b32)[_0x2443('0xa')](function(_0x389aa7){logger[_0x2443('0xb')](_0x2443('0xc'),_0x58dece,_0x2443('0xd'));logger[_0x2443('0xe')](_0x2443('0xf'),_0x58dece,_0x2443('0xd'),JSON[_0x2443('0x10')](_0x389aa7));if(_0x389aa7[_0x2443('0x11')]){if(_0x389aa7[_0x2443('0x11')][_0x2443('0x12')]===0x1f4){logger[_0x2443('0x11')](_0x2443('0xc'),_0x58dece,_0x389aa7[_0x2443('0x11')][_0x2443('0x13')]);return _0x30560d(_0x389aa7[_0x2443('0x11')][_0x2443('0x13')]);}logger[_0x2443('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x58dece,_0x389aa7[_0x2443('0x11')]['message']);return _0x31bff8(_0x389aa7[_0x2443('0x11')][_0x2443('0x13')]);}else{logger[_0x2443('0xb')](_0x2443('0xc'),_0x58dece,_0x2443('0xd'));_0x31bff8(_0x389aa7[_0x2443('0x14')][_0x2443('0x13')]);}})['catch'](function(_0x36bfc4){logger[_0x2443('0x11')](_0x2443('0xc'),_0x58dece,_0x36bfc4);_0x30560d(_0x36bfc4);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 41dc716..174848e 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 _0xa276=['../../config/environment','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x46b27c,_0x1dfdbb){var _0x451c64=function(_0x5ce29b){while(--_0x5ce29b){_0x46b27c['push'](_0x46b27c['shift']());}};_0x451c64(++_0x1dfdbb);}(_0xa276,0x9a));var _0x6a27=function(_0x57ba62,_0x86964){_0x57ba62=_0x57ba62-0x0;var _0x135459=_0xa276[_0x57ba62];return _0x135459;};'use strict';var multer=require('multer');var util=require(_0x6a27('0x0'));var path=require(_0x6a27('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a27('0x2'));var router=express[_0x6a27('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6a27('0x4'));var interaction=require(_0x6a27('0x5'));var config=require(_0x6a27('0x6'));var controller=require('./variable.controller');router[_0x6a27('0x7')]('/',auth[_0x6a27('0x8')](),controller[_0x6a27('0x9')]);router['get'](_0x6a27('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6a27('0xb')]);router[_0x6a27('0xc')](_0x6a27('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6a27('0xd')](_0x6a27('0xa'),auth[_0x6a27('0x8')](),controller[_0x6a27('0xe')]);module[_0x6a27('0xf')]=router; \ No newline at end of file +var _0x38c3=['../../components/interaction/service','./variable.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3d71ba,_0x49a38b){var _0x5e0ed0=function(_0x4d0bfb){while(--_0x4d0bfb){_0x3d71ba['push'](_0x3d71ba['shift']());}};_0x5e0ed0(++_0x49a38b);}(_0x38c3,0x13d));var _0x338c=function(_0x4f840d,_0x5d6218){_0x4f840d=_0x4f840d-0x0;var _0x315f81=_0x38c3[_0x4f840d];return _0x315f81;};'use strict';var multer=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var path=require('path');var timeout=require(_0x338c('0x2'));var express=require(_0x338c('0x3'));var router=express[_0x338c('0x4')]();var fs_extra=require(_0x338c('0x5'));var auth=require(_0x338c('0x6'));var interaction=require(_0x338c('0x7'));var config=require('../../config/environment');var controller=require(_0x338c('0x8'));router['get']('/',auth[_0x338c('0x9')](),controller[_0x338c('0xa')]);router['get'](_0x338c('0xb'),auth[_0x338c('0x9')](),controller[_0x338c('0xc')]);router['post']('/',auth[_0x338c('0x9')](),controller[_0x338c('0xd')]);router[_0x338c('0xe')](_0x338c('0xb'),auth[_0x338c('0x9')](),controller[_0x338c('0xf')]);router[_0x338c('0x10')]('/:id',auth[_0x338c('0x9')](),controller[_0x338c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 3bc1072..c85aaa2 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 _0x4437=['sequelize','exports'];(function(_0x4f09c5,_0x2a5dcb){var _0x155453=function(_0x16dbdc){while(--_0x16dbdc){_0x4f09c5['push'](_0x4f09c5['shift']());}};_0x155453(++_0x2a5dcb);}(_0x4437,0x15a));var _0x7443=function(_0x2b42f7,_0x2f1d8c){_0x2b42f7=_0x2b42f7-0x0;var _0x39e1a6=_0x4437[_0x2b42f7];return _0x39e1a6;};'use strict';var Sequelize=require(_0x7443('0x0'));module[_0x7443('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4b0c=['sequelize','STRING','name'];(function(_0x4cad2a,_0x572bc4){var _0x431fad=function(_0x55ec52){while(--_0x55ec52){_0x4cad2a['push'](_0x4cad2a['shift']());}};_0x431fad(++_0x572bc4);}(_0x4b0c,0x138));var _0xc4b0=function(_0x3d51eb,_0x5911df){_0x3d51eb=_0x3d51eb-0x0;var _0x203c01=_0x4b0c[_0x3d51eb];return _0x203c01;};'use strict';var Sequelize=require(_0xc4b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4b0('0x1')],'unique':_0xc4b0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 903c142..08a67ff 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 _0x9b39=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','Variables','UserProfileResource','stack','name','map','Variable','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','show','params','keys','options','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x30300f,_0x377387){var _0x2079bd=function(_0x7a15fa){while(--_0x7a15fa){_0x30300f['push'](_0x30300f['shift']());}};_0x2079bd(++_0x377387);}(_0x9b39,0xf7));var _0x99b3=function(_0xcbbc7d,_0x49e121){_0xcbbc7d=_0xcbbc7d-0x0;var _0x2c7d27=_0x9b39[_0xcbbc7d];return _0x2c7d27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99b3('0x0'));var zipdir=require(_0x99b3('0x1'));var jsonpatch=require(_0x99b3('0x2'));var rp=require(_0x99b3('0x3'));var moment=require(_0x99b3('0x4'));var BPromise=require(_0x99b3('0x5'));var Mustache=require(_0x99b3('0x6'));var util=require('util');var path=require(_0x99b3('0x7'));var sox=require(_0x99b3('0x8'));var csv=require(_0x99b3('0x9'));var ejs=require(_0x99b3('0xa'));var fs=require('fs');var fs_extra=require(_0x99b3('0xb'));var _=require(_0x99b3('0xc'));var squel=require(_0x99b3('0xd'));var crypto=require(_0x99b3('0xe'));var jsforce=require(_0x99b3('0xf'));var deskjs=require(_0x99b3('0x10'));var toCsv=require(_0x99b3('0x9'));var querystring=require(_0x99b3('0x11'));var Papa=require(_0x99b3('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x99b3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99b3('0x14'))('api');var utils=require(_0x99b3('0x15'));var config=require(_0x99b3('0x16'));var licenseUtil=require(_0x99b3('0x17'));var db=require(_0x99b3('0x18'))['db'];function respondWithStatusCode(_0x46436c,_0x419afa){_0x419afa=_0x419afa||0xcc;return function(_0x415016){if(_0x415016){return _0x46436c[_0x99b3('0x19')](_0x419afa);}return _0x46436c['status'](_0x419afa)[_0x99b3('0x1a')]();};}function respondWithResult(_0xdf7287,_0x50096c){_0x50096c=_0x50096c||0xc8;return function(_0x5d3c54){if(_0x5d3c54){return _0xdf7287[_0x99b3('0x1b')](_0x50096c)[_0x99b3('0x1c')](_0x5d3c54);}};}function respondWithFilteredResult(_0x258777,_0x4fcc0e){return function(_0x2e4860){if(_0x2e4860){var _0x2d2f88=typeof _0x4fcc0e['offset']===_0x99b3('0x1d')&&typeof _0x4fcc0e[_0x99b3('0x1e')]==='undefined';var _0x10e4c7=_0x2e4860[_0x99b3('0x1f')];var _0x250d35=_0x2d2f88?0x0:_0x4fcc0e[_0x99b3('0x20')];var _0x2d4984=_0x2d2f88?_0x2e4860[_0x99b3('0x1f')]:_0x4fcc0e[_0x99b3('0x20')]+_0x4fcc0e[_0x99b3('0x1e')];var _0x240184;if(_0x2d4984>=_0x10e4c7){_0x2d4984=_0x10e4c7;_0x240184=0xc8;}else{_0x240184=0xce;}_0x258777['status'](_0x240184);return _0x258777[_0x99b3('0x21')](_0x99b3('0x22'),_0x250d35+'-'+_0x2d4984+'/'+_0x10e4c7)[_0x99b3('0x1c')](_0x2e4860);}return null;};}function patchUpdates(_0x5d03a1){return function(_0x20eb13){try{jsonpatch[_0x99b3('0x23')](_0x20eb13,_0x5d03a1,!![]);}catch(_0xfbad20){return BPromise[_0x99b3('0x24')](_0xfbad20);}return _0x20eb13[_0x99b3('0x25')]();};}function saveUpdates(_0x405383,_0x427310){return function(_0x3e45e3){if(_0x3e45e3){return _0x3e45e3['update'](_0x405383)[_0x99b3('0x26')](function(_0x179488){return _0x179488;});}return null;};}function removeEntity(_0xb23eda,_0x374c6d){return function(_0x58f9c1){if(_0x58f9c1){return _0x58f9c1[_0x99b3('0x27')]()[_0x99b3('0x26')](function(){var _0xf4ea70=_0x58f9c1['get']({'plain':!![]});var _0x45e81a=_0x99b3('0x28');return db[_0x99b3('0x29')][_0x99b3('0x27')]({'where':{'type':_0x45e81a,'resourceId':_0xf4ea70['id']}})[_0x99b3('0x26')](function(){return _0x58f9c1;});})[_0x99b3('0x26')](function(){_0xb23eda[_0x99b3('0x1b')](0xcc)[_0x99b3('0x1a')]();});}};}function handleEntityNotFound(_0x256154,_0x389320){return function(_0x33601f){if(!_0x33601f){_0x256154[_0x99b3('0x19')](0x194);}return _0x33601f;};}function handleError(_0x1aea1f,_0x231da8){_0x231da8=_0x231da8||0x1f4;return function(_0x3ba184){logger['error'](_0x3ba184[_0x99b3('0x2a')]);if(_0x3ba184[_0x99b3('0x2b')]){delete _0x3ba184[_0x99b3('0x2b')];}_0x1aea1f[_0x99b3('0x1b')](_0x231da8)['send'](_0x3ba184);};}exports['index']=function(_0x5d6589,_0x3f4405){var _0x4416bc={},_0x18572a={},_0x41f97f={'count':0x0,'rows':[]};var _0xedaea6=_[_0x99b3('0x2c')](db[_0x99b3('0x2d')][_0x99b3('0x2e')],function(_0x42e84c){return{'name':_0x42e84c[_0x99b3('0x2f')],'type':_0x42e84c[_0x99b3('0x30')][_0x99b3('0x31')]};});_0x18572a[_0x99b3('0x32')]=_['map'](_0xedaea6,_0x99b3('0x2b'));_0x18572a[_0x99b3('0x33')]=_['keys'](_0x5d6589[_0x99b3('0x33')]);_0x18572a['filters']=_['intersection'](_0x18572a['model'],_0x18572a['query']);_0x4416bc[_0x99b3('0x34')]=_[_0x99b3('0x35')](_0x18572a[_0x99b3('0x32')],qs[_0x99b3('0x36')](_0x5d6589[_0x99b3('0x33')]['fields']));_0x4416bc['attributes']=_0x4416bc[_0x99b3('0x34')][_0x99b3('0x37')]?_0x4416bc[_0x99b3('0x34')]:_0x18572a['model'];if(!_0x5d6589[_0x99b3('0x33')]['hasOwnProperty'](_0x99b3('0x38'))){_0x4416bc[_0x99b3('0x1e')]=qs['limit'](_0x5d6589[_0x99b3('0x33')][_0x99b3('0x1e')]);_0x4416bc['offset']=qs['offset'](_0x5d6589['query'][_0x99b3('0x20')]);}_0x4416bc[_0x99b3('0x39')]=qs[_0x99b3('0x3a')](_0x5d6589[_0x99b3('0x33')][_0x99b3('0x3a')]);_0x4416bc[_0x99b3('0x3b')]=qs[_0x99b3('0x3c')](_[_0x99b3('0x3d')](_0x5d6589['query'],_0x18572a[_0x99b3('0x3c')]),_0xedaea6);if(_0x5d6589['query'][_0x99b3('0x3e')]){_0x4416bc[_0x99b3('0x3b')]=_[_0x99b3('0x3f')](_0x4416bc[_0x99b3('0x3b')],{'$or':_[_0x99b3('0x2c')](_0xedaea6,function(_0x34eea6){if(_0x34eea6[_0x99b3('0x30')]!==_0x99b3('0x40')){var _0x4a8589={};_0x4a8589[_0x34eea6[_0x99b3('0x2b')]]={'$like':'%'+_0x5d6589['query'][_0x99b3('0x3e')]+'%'};return _0x4a8589;}})});}_0x4416bc=_['merge']({},_0x4416bc,_0x5d6589['options']);var _0x1a28d9={'where':_0x4416bc['where']};return db[_0x99b3('0x2d')][_0x99b3('0x1f')](_0x1a28d9)[_0x99b3('0x26')](function(_0x41a373){_0x41f97f[_0x99b3('0x1f')]=_0x41a373;if(_0x5d6589[_0x99b3('0x33')]['includeAll']){_0x4416bc[_0x99b3('0x41')]=[{'all':!![]}];}return db[_0x99b3('0x2d')][_0x99b3('0x42')](_0x4416bc);})[_0x99b3('0x26')](function(_0x420a6b){_0x41f97f['rows']=_0x420a6b;return _0x41f97f;})['then'](respondWithFilteredResult(_0x3f4405,_0x4416bc))['catch'](handleError(_0x3f4405,null));};exports[_0x99b3('0x43')]=function(_0x2d043c,_0x612e0){var _0x24a13a={'raw':!![],'where':{'id':_0x2d043c[_0x99b3('0x44')]['id']}},_0x1b311d={};_0x1b311d[_0x99b3('0x32')]=_[_0x99b3('0x45')](db[_0x99b3('0x2d')][_0x99b3('0x2e')]);_0x1b311d[_0x99b3('0x33')]=_[_0x99b3('0x45')](_0x2d043c[_0x99b3('0x33')]);_0x1b311d[_0x99b3('0x3c')]=_[_0x99b3('0x35')](_0x1b311d[_0x99b3('0x32')],_0x1b311d[_0x99b3('0x33')]);_0x24a13a[_0x99b3('0x34')]=_[_0x99b3('0x35')](_0x1b311d['model'],qs[_0x99b3('0x36')](_0x2d043c[_0x99b3('0x33')]['fields']));_0x24a13a['attributes']=_0x24a13a['attributes'][_0x99b3('0x37')]?_0x24a13a[_0x99b3('0x34')]:_0x1b311d[_0x99b3('0x32')];if(_0x2d043c['query']['includeAll']){_0x24a13a[_0x99b3('0x41')]=[{'all':!![]}];}_0x24a13a=_['merge']({},_0x24a13a,_0x2d043c[_0x99b3('0x46')]);return db[_0x99b3('0x2d')]['find'](_0x24a13a)['then'](handleEntityNotFound(_0x612e0,null))[_0x99b3('0x26')](respondWithResult(_0x612e0,null))[_0x99b3('0x47')](handleError(_0x612e0,null));};exports[_0x99b3('0x48')]=function(_0x52bf04,_0x34390e){return db[_0x99b3('0x2d')]['create'](_0x52bf04[_0x99b3('0x49')],{})[_0x99b3('0x26')](function(_0x43c630){var _0x17c094=_0x52bf04[_0x99b3('0x4a')][_0x99b3('0x4b')]({'plain':!![]});if(!_0x17c094)throw new Error(_0x99b3('0x4c'));if(_0x17c094[_0x99b3('0x4d')]==='user'){var _0x1cf79c=_0x43c630[_0x99b3('0x4b')]({'plain':!![]});var _0xc93bef=_0x99b3('0x28');return db[_0x99b3('0x4e')]['find']({'where':{'name':_0xc93bef,'userProfileId':_0x17c094[_0x99b3('0x4f')]},'raw':!![]})[_0x99b3('0x26')](function(_0x3f2b26){if(_0x3f2b26&&_0x3f2b26['autoAssociation']===0x0){return db[_0x99b3('0x29')][_0x99b3('0x48')]({'name':_0x1cf79c[_0x99b3('0x2b')],'resourceId':_0x1cf79c['id'],'type':_0x3f2b26[_0x99b3('0x2b')],'sectionId':_0x3f2b26['id']},{})[_0x99b3('0x26')](function(){return _0x43c630;});}else{return _0x43c630;}})[_0x99b3('0x47')](function(_0x14d20b){logger[_0x99b3('0x50')](_0x99b3('0x51'),_0x14d20b);throw _0x14d20b;});}return _0x43c630;})['then'](respondWithResult(_0x34390e,0xc9))['catch'](handleError(_0x34390e,null));};exports[_0x99b3('0x52')]=function(_0x3d3109,_0x50884c){if(_0x3d3109['body']['id']){delete _0x3d3109['body']['id'];}return db[_0x99b3('0x2d')][_0x99b3('0x53')]({'where':{'id':_0x3d3109[_0x99b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x50884c,null))[_0x99b3('0x26')](saveUpdates(_0x3d3109[_0x99b3('0x49')],null))[_0x99b3('0x26')](respondWithResult(_0x50884c,null))['catch'](handleError(_0x50884c,null));};exports['destroy']=function(_0x1aa005,_0x3cbb0b){return db[_0x99b3('0x2d')][_0x99b3('0x53')]({'where':{'id':_0x1aa005[_0x99b3('0x44')]['id']}})[_0x99b3('0x26')](handleEntityNotFound(_0x3cbb0b,null))[_0x99b3('0x26')](removeEntity(_0x3cbb0b,null))[_0x99b3('0x47')](handleError(_0x3cbb0b,null));}; \ No newline at end of file +var _0x1b2b=['type','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','params','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','Variables','error','stack','name','send','index','map','Variable','rawAttributes','fieldName'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b2b,0x171));var _0xb1b2=function(_0x565de9,_0x114287){_0x565de9=_0x565de9-0x0;var _0x5f5dab=_0x1b2b[_0x565de9];return _0x5f5dab;};'use strict';var emlformat=require(_0xb1b2('0x0'));var rimraf=require(_0xb1b2('0x1'));var zipdir=require(_0xb1b2('0x2'));var jsonpatch=require(_0xb1b2('0x3'));var rp=require(_0xb1b2('0x4'));var moment=require(_0xb1b2('0x5'));var BPromise=require(_0xb1b2('0x6'));var Mustache=require(_0xb1b2('0x7'));var util=require(_0xb1b2('0x8'));var path=require(_0xb1b2('0x9'));var sox=require(_0xb1b2('0xa'));var csv=require(_0xb1b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1b2('0xc'));var _=require('lodash');var squel=require(_0xb1b2('0xd'));var crypto=require('crypto');var jsforce=require(_0xb1b2('0xe'));var deskjs=require(_0xb1b2('0xf'));var toCsv=require(_0xb1b2('0xb'));var querystring=require(_0xb1b2('0x10'));var Papa=require(_0xb1b2('0x11'));var Redis=require(_0xb1b2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb1b2('0x13'));var as=require(_0xb1b2('0x14'));var hardwareService=require(_0xb1b2('0x15'));var logger=require(_0xb1b2('0x16'))(_0xb1b2('0x17'));var utils=require(_0xb1b2('0x18'));var config=require(_0xb1b2('0x19'));var licenseUtil=require(_0xb1b2('0x1a'));var db=require(_0xb1b2('0x1b'))['db'];function respondWithStatusCode(_0x1bf366,_0x2a19cd){_0x2a19cd=_0x2a19cd||0xcc;return function(_0x2ebd6b){if(_0x2ebd6b){return _0x1bf366['sendStatus'](_0x2a19cd);}return _0x1bf366[_0xb1b2('0x1c')](_0x2a19cd)[_0xb1b2('0x1d')]();};}function respondWithResult(_0x129630,_0x14244f){_0x14244f=_0x14244f||0xc8;return function(_0x1fe682){if(_0x1fe682){return _0x129630[_0xb1b2('0x1c')](_0x14244f)[_0xb1b2('0x1e')](_0x1fe682);}};}function respondWithFilteredResult(_0x5406be,_0x3bd30c){return function(_0x26e2bc){if(_0x26e2bc){var _0x1cf2a7=typeof _0x3bd30c['offset']===_0xb1b2('0x1f')&&typeof _0x3bd30c['limit']===_0xb1b2('0x1f');var _0x5066a1=_0x26e2bc[_0xb1b2('0x20')];var _0x5981dd=_0x1cf2a7?0x0:_0x3bd30c['offset'];var _0x307b48=_0x1cf2a7?_0x26e2bc['count']:_0x3bd30c[_0xb1b2('0x21')]+_0x3bd30c[_0xb1b2('0x22')];var _0x578977;if(_0x307b48>=_0x5066a1){_0x307b48=_0x5066a1;_0x578977=0xc8;}else{_0x578977=0xce;}_0x5406be[_0xb1b2('0x1c')](_0x578977);return _0x5406be[_0xb1b2('0x23')](_0xb1b2('0x24'),_0x5981dd+'-'+_0x307b48+'/'+_0x5066a1)[_0xb1b2('0x1e')](_0x26e2bc);}return null;};}function patchUpdates(_0x9010e){return function(_0x121930){try{jsonpatch[_0xb1b2('0x25')](_0x121930,_0x9010e,!![]);}catch(_0x3aa9c7){return BPromise[_0xb1b2('0x26')](_0x3aa9c7);}return _0x121930['save']();};}function saveUpdates(_0x37fdf9,_0x4553ac){return function(_0x287d0e){if(_0x287d0e){return _0x287d0e[_0xb1b2('0x27')](_0x37fdf9)[_0xb1b2('0x28')](function(_0xe5816b){return _0xe5816b;});}return null;};}function removeEntity(_0x250849,_0x47cfa4){return function(_0x5e4c7e){if(_0x5e4c7e){return _0x5e4c7e['destroy']()['then'](function(){var _0x2f5406=_0x5e4c7e['get']({'plain':!![]});var _0x317ed7=_0xb1b2('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x317ed7,'resourceId':_0x2f5406['id']}})['then'](function(){return _0x5e4c7e;});})[_0xb1b2('0x28')](function(){_0x250849[_0xb1b2('0x1c')](0xcc)[_0xb1b2('0x1d')]();});}};}function handleEntityNotFound(_0xbd3355,_0x15eda2){return function(_0x2212fe){if(!_0x2212fe){_0xbd3355['sendStatus'](0x194);}return _0x2212fe;};}function handleError(_0x52b108,_0x3a36e8){_0x3a36e8=_0x3a36e8||0x1f4;return function(_0x304a90){logger[_0xb1b2('0x2a')](_0x304a90[_0xb1b2('0x2b')]);if(_0x304a90[_0xb1b2('0x2c')]){delete _0x304a90[_0xb1b2('0x2c')];}_0x52b108[_0xb1b2('0x1c')](_0x3a36e8)[_0xb1b2('0x2d')](_0x304a90);};}exports[_0xb1b2('0x2e')]=function(_0x4eef44,_0x2a2beb){var _0x204033={},_0x925c2a={},_0x21c942={'count':0x0,'rows':[]};var _0x1f9185=_[_0xb1b2('0x2f')](db[_0xb1b2('0x30')][_0xb1b2('0x31')],function(_0x43c052){return{'name':_0x43c052[_0xb1b2('0x32')],'type':_0x43c052[_0xb1b2('0x33')]['key']};});_0x925c2a['model']=_[_0xb1b2('0x2f')](_0x1f9185,_0xb1b2('0x2c'));_0x925c2a[_0xb1b2('0x34')]=_[_0xb1b2('0x35')](_0x4eef44[_0xb1b2('0x34')]);_0x925c2a[_0xb1b2('0x36')]=_[_0xb1b2('0x37')](_0x925c2a[_0xb1b2('0x38')],_0x925c2a[_0xb1b2('0x34')]);_0x204033[_0xb1b2('0x39')]=_[_0xb1b2('0x37')](_0x925c2a[_0xb1b2('0x38')],qs['fields'](_0x4eef44['query']['fields']));_0x204033[_0xb1b2('0x39')]=_0x204033[_0xb1b2('0x39')][_0xb1b2('0x3a')]?_0x204033[_0xb1b2('0x39')]:_0x925c2a[_0xb1b2('0x38')];if(!_0x4eef44[_0xb1b2('0x34')]['hasOwnProperty'](_0xb1b2('0x3b'))){_0x204033[_0xb1b2('0x22')]=qs['limit'](_0x4eef44['query'][_0xb1b2('0x22')]);_0x204033[_0xb1b2('0x21')]=qs['offset'](_0x4eef44[_0xb1b2('0x34')]['offset']);}_0x204033[_0xb1b2('0x3c')]=qs[_0xb1b2('0x3d')](_0x4eef44[_0xb1b2('0x34')][_0xb1b2('0x3d')]);_0x204033[_0xb1b2('0x3e')]=qs['filters'](_[_0xb1b2('0x3f')](_0x4eef44['query'],_0x925c2a[_0xb1b2('0x36')]),_0x1f9185);if(_0x4eef44[_0xb1b2('0x34')]['filter']){_0x204033[_0xb1b2('0x3e')]=_['merge'](_0x204033['where'],{'$or':_[_0xb1b2('0x2f')](_0x1f9185,function(_0x3939e3){if(_0x3939e3[_0xb1b2('0x33')]!==_0xb1b2('0x40')){var _0x4fd424={};_0x4fd424[_0x3939e3[_0xb1b2('0x2c')]]={'$like':'%'+_0x4eef44[_0xb1b2('0x34')]['filter']+'%'};return _0x4fd424;}})});}_0x204033=_[_0xb1b2('0x41')]({},_0x204033,_0x4eef44[_0xb1b2('0x42')]);var _0x50785f={'where':_0x204033[_0xb1b2('0x3e')]};return db['Variable'][_0xb1b2('0x20')](_0x50785f)[_0xb1b2('0x28')](function(_0x4d7973){_0x21c942[_0xb1b2('0x20')]=_0x4d7973;if(_0x4eef44[_0xb1b2('0x34')][_0xb1b2('0x43')]){_0x204033['include']=[{'all':!![]}];}return db['Variable'][_0xb1b2('0x44')](_0x204033);})[_0xb1b2('0x28')](function(_0x51b15f){_0x21c942[_0xb1b2('0x45')]=_0x51b15f;return _0x21c942;})[_0xb1b2('0x28')](respondWithFilteredResult(_0x2a2beb,_0x204033))['catch'](handleError(_0x2a2beb,null));};exports['show']=function(_0x13a9d8,_0xb6bfc3){var _0x15b316={'raw':!![],'where':{'id':_0x13a9d8[_0xb1b2('0x46')]['id']}},_0x553336={};_0x553336['model']=_['keys'](db[_0xb1b2('0x30')]['rawAttributes']);_0x553336[_0xb1b2('0x34')]=_['keys'](_0x13a9d8[_0xb1b2('0x34')]);_0x553336[_0xb1b2('0x36')]=_[_0xb1b2('0x37')](_0x553336[_0xb1b2('0x38')],_0x553336[_0xb1b2('0x34')]);_0x15b316[_0xb1b2('0x39')]=_[_0xb1b2('0x37')](_0x553336[_0xb1b2('0x38')],qs[_0xb1b2('0x47')](_0x13a9d8[_0xb1b2('0x34')][_0xb1b2('0x47')]));_0x15b316[_0xb1b2('0x39')]=_0x15b316[_0xb1b2('0x39')]['length']?_0x15b316[_0xb1b2('0x39')]:_0x553336[_0xb1b2('0x38')];if(_0x13a9d8[_0xb1b2('0x34')]['includeAll']){_0x15b316[_0xb1b2('0x48')]=[{'all':!![]}];}_0x15b316=_[_0xb1b2('0x41')]({},_0x15b316,_0x13a9d8[_0xb1b2('0x42')]);return db['Variable'][_0xb1b2('0x49')](_0x15b316)['then'](handleEntityNotFound(_0xb6bfc3,null))[_0xb1b2('0x28')](respondWithResult(_0xb6bfc3,null))['catch'](handleError(_0xb6bfc3,null));};exports['create']=function(_0x4fa0e1,_0x2eaabc){return db[_0xb1b2('0x30')][_0xb1b2('0x4a')](_0x4fa0e1[_0xb1b2('0x4b')],{})[_0xb1b2('0x28')](function(_0x738ef2){var _0x379219=_0x4fa0e1[_0xb1b2('0x4c')]['get']({'plain':!![]});if(!_0x379219)throw new Error(_0xb1b2('0x4d'));if(_0x379219[_0xb1b2('0x4e')]===_0xb1b2('0x4c')){var _0x3d7f47=_0x738ef2['get']({'plain':!![]});var _0x46f022=_0xb1b2('0x29');return db[_0xb1b2('0x4f')]['find']({'where':{'name':_0x46f022,'userProfileId':_0x379219[_0xb1b2('0x50')]},'raw':!![]})[_0xb1b2('0x28')](function(_0x467272){if(_0x467272&&_0x467272[_0xb1b2('0x51')]===0x0){return db[_0xb1b2('0x52')][_0xb1b2('0x4a')]({'name':_0x3d7f47['name'],'resourceId':_0x3d7f47['id'],'type':_0x467272[_0xb1b2('0x2c')],'sectionId':_0x467272['id']},{})[_0xb1b2('0x28')](function(){return _0x738ef2;});}else{return _0x738ef2;}})[_0xb1b2('0x53')](function(_0x3562c3){logger[_0xb1b2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3562c3);throw _0x3562c3;});}return _0x738ef2;})[_0xb1b2('0x28')](respondWithResult(_0x2eaabc,0xc9))[_0xb1b2('0x53')](handleError(_0x2eaabc,null));};exports['update']=function(_0xfb60ac,_0x57a817){if(_0xfb60ac[_0xb1b2('0x4b')]['id']){delete _0xfb60ac[_0xb1b2('0x4b')]['id'];}return db[_0xb1b2('0x30')][_0xb1b2('0x49')]({'where':{'id':_0xfb60ac[_0xb1b2('0x46')]['id']}})[_0xb1b2('0x28')](handleEntityNotFound(_0x57a817,null))[_0xb1b2('0x28')](saveUpdates(_0xfb60ac[_0xb1b2('0x4b')],null))[_0xb1b2('0x28')](respondWithResult(_0x57a817,null))[_0xb1b2('0x53')](handleError(_0x57a817,null));};exports['destroy']=function(_0x1a6454,_0x2d3f35){return db[_0xb1b2('0x30')]['find']({'where':{'id':_0x1a6454[_0xb1b2('0x46')]['id']}})[_0xb1b2('0x28')](handleEntityNotFound(_0x2d3f35,null))[_0xb1b2('0x28')](removeEntity(_0x2d3f35,null))['catch'](handleError(_0x2d3f35,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 2f5eabc..0d3ca9c 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 _0x4868=['path','rimraf','../../config/environment','exports','define','Variable','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x53ea77,_0x3edf7e){var _0xfc6ae3=function(_0x5e05c7){while(--_0x5e05c7){_0x53ea77['push'](_0x53ea77['shift']());}};_0xfc6ae3(++_0x3edf7e);}(_0x4868,0x12f));var _0x8486=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4868[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8486('0x0'));var util=require('util');var logger=require(_0x8486('0x1'))(_0x8486('0x2'));var moment=require('moment');var BPromise=require(_0x8486('0x3'));var rp=require(_0x8486('0x4'));var fs=require('fs');var path=require(_0x8486('0x5'));var rimraf=require(_0x8486('0x6'));var config=require(_0x8486('0x7'));var attributes=require('./variable.attributes');module[_0x8486('0x8')]=function(_0x27b8b6,_0x5f2173){return _0x27b8b6[_0x8486('0x9')](_0x8486('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf46=['../../config/environment','./variable.attributes','exports','define','Variable','util','api','bluebird','request-promise','rimraf'];(function(_0x230420,_0x139548){var _0x4ad453=function(_0x179bcb){while(--_0x179bcb){_0x230420['push'](_0x230420['shift']());}};_0x4ad453(++_0x139548);}(_0xbf46,0x91));var _0x6bf4=function(_0xb2520c,_0x37213e){_0xb2520c=_0xb2520c-0x0;var _0x1d1a4e=_0xbf46[_0xb2520c];return _0x1d1a4e;};'use strict';var _=require('lodash');var util=require(_0x6bf4('0x0'));var logger=require('../../config/logger')(_0x6bf4('0x1'));var moment=require('moment');var BPromise=require(_0x6bf4('0x2'));var rp=require(_0x6bf4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bf4('0x4'));var config=require(_0x6bf4('0x5'));var attributes=require(_0x6bf4('0x6'));module[_0x6bf4('0x7')]=function(_0x468440,_0x2dc290){return _0x468440[_0x6bf4('0x8')](_0x6bf4('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index badeb9e..d7adc57 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x45505a,_0x59368a){var _0x36a1f6=function(_0x2f4542){while(--_0x2f4542){_0x45505a['push'](_0x45505a['shift']());}};_0x36a1f6(++_0x59368a);}(_0x3e74,0x175));var _0x43e7=function(_0x2d9183,_0x203aab){_0x2d9183=_0x2d9183-0x0;var _0x40c09e=_0x3e74[_0x2d9183];return _0x40c09e;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x3c601b,_0x4e839f){var _0x24f02f=function(_0x6a5086){while(--_0x6a5086){_0x3c601b['push'](_0x3c601b['shift']());}};_0x24f02f(++_0x4e839f);}(_0xe14b,0x93));var _0xbe14=function(_0x52e266,_0x586656){_0x52e266=_0x52e266-0x0;var _0x335947=_0xe14b[_0x52e266];return _0x335947;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index cd18777..5c2f9fc 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 _0xdc91=['Router','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xdc91,0xed));var _0x1dc9=function(_0x2868fc,_0x59ee48){_0x2868fc=_0x2868fc-0x0;var _0x924633=_0xdc91[_0x2868fc];return _0x924633;};'use strict';var express=require(_0x1dc9('0x0'));var router=express[_0x1dc9('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x1dc9('0x2'));router['get']('/',controller[_0x1dc9('0x3')]);router[_0x1dc9('0x4')](_0x1dc9('0x5'),auth[_0x1dc9('0x6')](),auth[_0x1dc9('0x7')](),controller['fetch']);router[_0x1dc9('0x4')](_0x1dc9('0x8'),auth['isAuthenticated'](),auth[_0x1dc9('0x7')](),controller[_0x1dc9('0x9')]);router['get'](_0x1dc9('0xa'),auth[_0x1dc9('0x6')](),auth[_0x1dc9('0x7')](),controller[_0x1dc9('0xb')]);router[_0x1dc9('0x4')](_0x1dc9('0xc'),auth[_0x1dc9('0x6')](),controller[_0x1dc9('0xd')]);router['get'](_0x1dc9('0xe'),controller[_0x1dc9('0xf')]);module[_0x1dc9('0x10')]=router; \ No newline at end of file +var _0xf05f=['/reset','canUpdate','/pull','/restart','restart','/migrations','exports','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated'];(function(_0x29e398,_0x890225){var _0xd799e2=function(_0x4fcf2f){while(--_0x4fcf2f){_0x29e398['push'](_0x29e398['shift']());}};_0xd799e2(++_0x890225);}(_0xf05f,0x180));var _0xff05=function(_0x34a24b,_0x54cf53){_0x34a24b=_0x34a24b-0x0;var _0x34bd9d=_0xf05f[_0x34a24b];return _0x34bd9d;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xff05('0x0'));var controller=require(_0xff05('0x1'));router[_0xff05('0x2')]('/',controller[_0xff05('0x3')]);router[_0xff05('0x2')](_0xff05('0x4'),auth[_0xff05('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0xff05('0x2')](_0xff05('0x6'),auth[_0xff05('0x5')](),auth[_0xff05('0x7')](),controller['reset']);router[_0xff05('0x2')](_0xff05('0x8'),auth['isAuthenticated'](),auth[_0xff05('0x7')](),controller['pull']);router[_0xff05('0x2')](_0xff05('0x9'),auth[_0xff05('0x5')](),controller[_0xff05('0xa')]);router[_0xff05('0x2')](_0xff05('0xb'),controller['migrations']);module[_0xff05('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 7ff62c4..2b6feb7 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 _0xdec8=['server','migrations','length','.js','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','status','json','fetch','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xdec8,0x164));var _0x8dec=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xdec8[_0xb0f7c3];return _0x28ea68;};'use strict';var Umzug=require(_0x8dec('0x0'));var path=require(_0x8dec('0x1'));var fs=require('fs');var _=require(_0x8dec('0x2'));var pkginfo=require('pkginfo')(module,_0x8dec('0x3'));var compareVersions=require(_0x8dec('0x4'));var exec=require(_0x8dec('0x5'))['exec'];var db=require(_0x8dec('0x6'))['db'];var config=require(_0x8dec('0x7'));var pm2=require(_0x8dec('0x8'));var logger=require(_0x8dec('0x9'))(_0x8dec('0xa'));var git=require(_0x8dec('0xb'))(config[_0x8dec('0xc')]);exports[_0x8dec('0xd')]=function(_0x1ae4b7,_0x571f2d){var _0x14ce34={'current':module[_0x8dec('0xe')]['version'],'phonebar':0x2};if(_0x1ae4b7['query']&&_0x1ae4b7[_0x8dec('0xf')][_0x8dec('0x10')]){return git['fetch']()['tags'](function(_0x3e33a1,_0x582fc5){_0x14ce34[_0x8dec('0x10')]=(_0x3e33a1?module[_0x8dec('0xe')][_0x8dec('0x3')]:_0x582fc5[_0x8dec('0x10')])||'2.0.0';return _0x571f2d[_0x8dec('0x11')](0xc8)[_0x8dec('0x12')](_0x14ce34);});}else{return _0x571f2d['status'](0xc8)[_0x8dec('0x12')](_0x14ce34);}};exports['fetch']=function(_0x1f0338,_0x368283){return git[_0x8dec('0x13')]([_0x8dec('0x14'),'master'],function(_0x4f5112){if(_0x4f5112){logger[_0x8dec('0x15')](_0x4f5112);return _0x368283['status'](0x1f4)[_0x8dec('0x12')](_0x4f5112);}logger[_0x8dec('0x16')](_0x8dec('0x17'));return _0x368283[_0x8dec('0x11')](0xc8)[_0x8dec('0x12')]({'output':_0x8dec('0x18')});});};exports['reset']=function(_0x344250,_0x356947){return git['reset'](['--hard','FETCH_HEAD'],function(_0x3cf666){if(_0x3cf666){logger[_0x8dec('0x15')](_0x3cf666);return _0x356947['status'](0x1f4)['json'](_0x3cf666);}logger['info'](_0x8dec('0x19'));return _0x356947['status'](0xc8)[_0x8dec('0x12')]({'output':_0x8dec('0x1a')});});};exports[_0x8dec('0x1b')]=function(_0x28fa3d,_0x3689db){exec(_0x8dec('0x1c'),function(_0x3a528c,_0x113739,_0x438802){logger['info'](_0x113739);logger[_0x8dec('0x16')](_0x438802);if(_0x3a528c){logger[_0x8dec('0x15')](_0x3a528c);return _0x3689db[_0x8dec('0x11')](0x1f4)[_0x8dec('0x12')](_0x3a528c);}return _0x3689db[_0x8dec('0x11')](0xc8)[_0x8dec('0x12')]({'output':_0x113739});});};exports[_0x8dec('0x1d')]=function(_0x1a2926,_0x3c7eee){return pm2[_0x8dec('0x1d')](_0x8dec('0x1e'))['then'](function(_0x19ecb3){logger[_0x8dec('0x16')](_0x8dec('0x1f'),_0x19ecb3);return _0x3c7eee[_0x8dec('0x11')](0xc8)[_0x8dec('0x12')]({'output':_0x8dec('0x20')});})[_0x8dec('0x21')](function(_0x3a4a15){logger['error'](_0x3a4a15);return _0x3c7eee['status'](0x1f4)[_0x8dec('0x12')](_0x3a4a15);});};exports['migrations']=function(_0xadc577,_0x50e465){var _0x27a65a=fs[_0x8dec('0x22')](path[_0x8dec('0x23')](config['root'],_0x8dec('0x24'),_0x8dec('0x25')));var _0x4abd65=[];for(var _0x372fc8=0x0;_0x372fc8<_0x27a65a[_0x8dec('0x26')];_0x372fc8++){var _0x5e069c=_0x27a65a[_0x372fc8]['replace'](_0x8dec('0x27'),'');if(compareVersions(module['exports'][_0x8dec('0x3')],_0x5e069c)===-0x1){_0x4abd65['push'](_0x5e069c);}}if(_0x4abd65['length']){var _0x15a25a=_0x4abd65[_0x8dec('0x28')](compareVersions);var _0x318652=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x8dec('0x29')],'modelName':_0x8dec('0x29'),'columnName':'version'},'migrations':{'params':[db[_0x8dec('0x2a')]['getQueryInterface'](),db[_0x8dec('0x2a')][_0x8dec('0x2b')],function(){throw new Error(_0x8dec('0x2c'));}],'path':path[_0x8dec('0x23')](config[_0x8dec('0xc')],_0x8dec('0x24'),'migrations'),'pattern':/\.js$/}});_0x318652['up']({'migrations':_['map'](_0x15a25a,function(_0x3b7f3d){return _0x3b7f3d+_0x8dec('0x27');})})['then'](function(){return _0x50e465[_0x8dec('0x11')](0xc8)[_0x8dec('0x12')]({'output':_0x8dec('0x2d')+module[_0x8dec('0xe')][_0x8dec('0x3')]+'\x20to\x20'+_[_0x8dec('0x2e')](_0x15a25a),'migrations':_[_0x8dec('0x23')](_0x15a25a)});})[_0x8dec('0x21')](function(_0x400135){if(_0x400135 instanceof db[_0x8dec('0x2a')][_0x8dec('0x2f')]){return _0x50e465[_0x8dec('0x11')](0xc8)[_0x8dec('0x12')]({'output':_0x8dec('0x30')});}else{return _0x50e465[_0x8dec('0x11')](0x1f4)[_0x8dec('0x12')](_0x400135);}});}else{return _0x50e465[_0x8dec('0x11')](0xc8)[_0x8dec('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x4fdb=['origin','master','error','info','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','update','simple-git','root','index','exports','query','fetch','latest','2.0.0','status','json'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4fdb,0xfa));var _0xb4fd=function(_0xb4b5c9,_0xb8c2d4){_0xb4b5c9=_0xb4b5c9-0x0;var _0xc67fae=_0x4fdb[_0xb4b5c9];return _0xc67fae;};'use strict';var Umzug=require(_0xb4fd('0x0'));var path=require(_0xb4fd('0x1'));var fs=require('fs');var _=require(_0xb4fd('0x2'));var pkginfo=require(_0xb4fd('0x3'))(module,_0xb4fd('0x4'));var compareVersions=require(_0xb4fd('0x5'));var exec=require(_0xb4fd('0x6'))[_0xb4fd('0x7')];var db=require('../../mysqldb')['db'];var config=require(_0xb4fd('0x8'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xb4fd('0x9'));var git=require(_0xb4fd('0xa'))(config[_0xb4fd('0xb')]);exports[_0xb4fd('0xc')]=function(_0x48c4a3,_0x20d49a){var _0x1d08fb={'current':module[_0xb4fd('0xd')][_0xb4fd('0x4')],'phonebar':0x2};if(_0x48c4a3[_0xb4fd('0xe')]&&_0x48c4a3['query']['latest']){return git[_0xb4fd('0xf')]()['tags'](function(_0x247d28,_0x57b202){_0x1d08fb[_0xb4fd('0x10')]=(_0x247d28?module[_0xb4fd('0xd')][_0xb4fd('0x4')]:_0x57b202[_0xb4fd('0x10')])||_0xb4fd('0x11');return _0x20d49a[_0xb4fd('0x12')](0xc8)['json'](_0x1d08fb);});}else{return _0x20d49a[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')](_0x1d08fb);}};exports[_0xb4fd('0xf')]=function(_0x20f9bb,_0x52ef89){return git[_0xb4fd('0xf')]([_0xb4fd('0x14'),_0xb4fd('0x15')],function(_0x331bed){if(_0x331bed){logger[_0xb4fd('0x16')](_0x331bed);return _0x52ef89[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x331bed);}logger[_0xb4fd('0x17')]('git\x20fetch');return _0x52ef89[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xb4fd('0x18')]=function(_0x39eee1,_0x3226fd){return git[_0xb4fd('0x18')]([_0xb4fd('0x19'),'FETCH_HEAD'],function(_0x4ff791){if(_0x4ff791){logger[_0xb4fd('0x16')](_0x4ff791);return _0x3226fd[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x4ff791);}logger[_0xb4fd('0x17')](_0xb4fd('0x1a'));return _0x3226fd[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x1b')});});};exports[_0xb4fd('0x1c')]=function(_0x56d967,_0x405774){exec(_0xb4fd('0x1d'),function(_0xacb392,_0x1f1dcb,_0xf9a022){logger[_0xb4fd('0x17')](_0x1f1dcb);logger[_0xb4fd('0x17')](_0xf9a022);if(_0xacb392){logger[_0xb4fd('0x16')](_0xacb392);return _0x405774['status'](0x1f4)[_0xb4fd('0x13')](_0xacb392);}return _0x405774[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0x1f1dcb});});};exports[_0xb4fd('0x1e')]=function(_0x26e95d,_0x1dacd0){return pm2[_0xb4fd('0x1e')](_0xb4fd('0x1f'))[_0xb4fd('0x20')](function(_0x487706){logger[_0xb4fd('0x17')](_0xb4fd('0x21'),_0x487706);return _0x1dacd0[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x22')});})[_0xb4fd('0x23')](function(_0x73e6b1){logger[_0xb4fd('0x16')](_0x73e6b1);return _0x1dacd0[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x73e6b1);});};exports[_0xb4fd('0x24')]=function(_0x4dc457,_0x31c94f){var _0x278f9e=fs[_0xb4fd('0x25')](path[_0xb4fd('0x26')](config[_0xb4fd('0xb')],_0xb4fd('0x27'),_0xb4fd('0x24')));var _0x14d9cf=[];for(var _0x5700b5=0x0;_0x5700b5<_0x278f9e[_0xb4fd('0x28')];_0x5700b5++){var _0x18b98d=_0x278f9e[_0x5700b5][_0xb4fd('0x29')]('.js','');if(compareVersions(module[_0xb4fd('0xd')][_0xb4fd('0x4')],_0x18b98d)===-0x1){_0x14d9cf[_0xb4fd('0x2a')](_0x18b98d);}}if(_0x14d9cf[_0xb4fd('0x28')]){var _0x4c5f4c=_0x14d9cf[_0xb4fd('0x2b')](compareVersions);var _0x44d0fe=new Umzug({'storage':_0xb4fd('0x2c'),'storageOptions':{'model':db[_0xb4fd('0x2d')],'modelName':_0xb4fd('0x2d'),'columnName':_0xb4fd('0x4')},'migrations':{'params':[db[_0xb4fd('0x2c')][_0xb4fd('0x2e')](),db[_0xb4fd('0x2c')][_0xb4fd('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xb4fd('0x26')](config[_0xb4fd('0xb')],_0xb4fd('0x27'),_0xb4fd('0x24')),'pattern':/\.js$/}});_0x44d0fe['up']({'migrations':_[_0xb4fd('0x30')](_0x4c5f4c,function(_0x95b487){return _0x95b487+_0xb4fd('0x31');})})[_0xb4fd('0x20')](function(){return _0x31c94f['status'](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x32')+module[_0xb4fd('0xd')]['version']+'\x20to\x20'+_[_0xb4fd('0x33')](_0x4c5f4c),'migrations':_[_0xb4fd('0x26')](_0x4c5f4c)});})[_0xb4fd('0x23')](function(_0x293778){if(_0x293778 instanceof db[_0xb4fd('0x2c')][_0xb4fd('0x34')]){return _0x31c94f[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x35')});}else{return _0x31c94f[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x293778);}});}else{return _0x31c94f[_0xb4fd('0x12')](0xc8)['json']({'output':_0xb4fd('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 0c3c475..c2fe1e2 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 _0x44ac=['destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x50f074,_0x3c3cf1){var _0x562c5f=function(_0x199a76){while(--_0x199a76){_0x50f074['push'](_0x50f074['shift']());}};_0x562c5f(++_0x3c3cf1);}(_0x44ac,0xfe));var _0xc44a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x44ac[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xc44a('0x0'));var util=require(_0xc44a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc44a('0x2'));var router=express[_0xc44a('0x3')]();var fs_extra=require(_0xc44a('0x4'));var auth=require(_0xc44a('0x5'));var interaction=require(_0xc44a('0x6'));var config=require(_0xc44a('0x7'));var controller=require('./voiceAgentReport.controller');router[_0xc44a('0x8')]('/',auth['isAuthenticated'](),controller[_0xc44a('0x9')]);router[_0xc44a('0x8')]('/describe',auth[_0xc44a('0xa')](),controller[_0xc44a('0xb')]);router[_0xc44a('0x8')](_0xc44a('0xc'),auth[_0xc44a('0xa')](),controller[_0xc44a('0xd')]);router[_0xc44a('0xe')]('/',auth[_0xc44a('0xa')](),controller[_0xc44a('0xf')]);router[_0xc44a('0x10')](_0xc44a('0xc'),auth[_0xc44a('0xa')](),controller[_0xc44a('0x11')]);router[_0xc44a('0x12')](_0xc44a('0xc'),auth[_0xc44a('0xa')](),controller[_0xc44a('0x13')]);module[_0xc44a('0x14')]=router; \ No newline at end of file +var _0x4766=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','delete'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x4766,0xe6));var _0x6476=function(_0x56f4ec,_0x43a0bd){_0x56f4ec=_0x56f4ec-0x0;var _0x841a3a=_0x4766[_0x56f4ec];return _0x841a3a;};'use strict';var multer=require(_0x6476('0x0'));var util=require(_0x6476('0x1'));var path=require(_0x6476('0x2'));var timeout=require(_0x6476('0x3'));var express=require(_0x6476('0x4'));var router=express['Router']();var fs_extra=require(_0x6476('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6476('0x6'));var config=require(_0x6476('0x7'));var controller=require(_0x6476('0x8'));router['get']('/',auth[_0x6476('0x9')](),controller[_0x6476('0xa')]);router[_0x6476('0xb')](_0x6476('0xc'),auth[_0x6476('0x9')](),controller['describe']);router['get'](_0x6476('0xd'),auth[_0x6476('0x9')](),controller['show']);router[_0x6476('0xe')]('/',auth[_0x6476('0x9')](),controller[_0x6476('0xf')]);router['put'](_0x6476('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6476('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6476('0x11')]);module[_0x6476('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c40dd69..b8ce92c 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 _0x3da6=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3da6,0xc1));var _0x63da=function(_0x116bb5,_0x4fb7cf){_0x116bb5=_0x116bb5-0x0;var _0x5bcfb0=_0x3da6[_0x116bb5];return _0x5bcfb0;};'use strict';var Sequelize=require(_0x63da('0x0'));module[_0x63da('0x1')]={'type':{'type':Sequelize[_0x63da('0x2')]},'uniqueid':{'type':Sequelize[_0x63da('0x2')]},'calleridnum':{'type':Sequelize[_0x63da('0x2')]},'calleridname':{'type':Sequelize[_0x63da('0x2')]},'queue':{'type':Sequelize[_0x63da('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x63da('0x2')]},'agentcalledAt':{'type':Sequelize[_0x63da('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x63da('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x63da('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x63da('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x63da('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x63da('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x63da('0x5')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x63da('0x5')]},'reason':{'type':Sequelize[_0x63da('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x63da('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x63da('0x2')]},'connectedlinenum':{'type':Sequelize[_0x63da('0x2')]},'connectedlinename':{'type':Sequelize[_0x63da('0x2')]},'language':{'type':Sequelize[_0x63da('0x2')]},'accountcode':{'type':Sequelize[_0x63da('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x63da('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x63da('0x2')]},'destchannelstate':{'type':Sequelize[_0x63da('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x63da('0x2')]},'destcalleridnum':{'type':Sequelize[_0x63da('0x2')]},'destcalleridname':{'type':Sequelize[_0x63da('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x63da('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x63da('0x2')]},'destlanguage':{'type':Sequelize[_0x63da('0x2')]},'destaccountcode':{'type':Sequelize[_0x63da('0x2')]},'destcontext':{'type':Sequelize[_0x63da('0x2')]},'destexten':{'type':Sequelize[_0x63da('0x2')]},'destpriority':{'type':Sequelize[_0x63da('0x2')]},'destuniqueid':{'type':Sequelize[_0x63da('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x63da('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x63da('0x6')},'transferexten':{'type':Sequelize[_0x63da('0x2')]},'transferuniqueid':{'type':Sequelize[_0x63da('0x2')]},'agententerreason':{'type':Sequelize[_0x63da('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7af9=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x560e95,_0x565c20){var _0x20baf2=function(_0x4035fe){while(--_0x4035fe){_0x560e95['push'](_0x560e95['shift']());}};_0x20baf2(++_0x565c20);}(_0x7af9,0x95));var _0x97af=function(_0x369d10,_0x1768c2){_0x369d10=_0x369d10-0x0;var _0xf9ae9a=_0x7af9[_0x369d10];return _0xf9ae9a;};'use strict';var Sequelize=require(_0x97af('0x0'));module['exports']={'type':{'type':Sequelize[_0x97af('0x1')]},'uniqueid':{'type':Sequelize[_0x97af('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97af('0x1')]},'queue':{'type':Sequelize[_0x97af('0x1')]},'interface':{'type':Sequelize[_0x97af('0x1')]},'membername':{'type':Sequelize[_0x97af('0x1')]},'agentcalledAt':{'type':Sequelize[_0x97af('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x97af('0x2')]},'holdtime':{'type':Sequelize[_0x97af('0x3')]},'agentcomplete':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x97af('0x3')]},'agentacw':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x97af('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x97af('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x97af('0x3')]},'channelstatedesc':{'type':Sequelize[_0x97af('0x1')]},'connectedlinenum':{'type':Sequelize[_0x97af('0x1')]},'connectedlinename':{'type':Sequelize[_0x97af('0x1')]},'language':{'type':Sequelize[_0x97af('0x1')]},'accountcode':{'type':Sequelize[_0x97af('0x1')]},'context':{'type':Sequelize[_0x97af('0x1')]},'exten':{'type':Sequelize[_0x97af('0x1')]},'priority':{'type':Sequelize[_0x97af('0x1')]},'destchannel':{'type':Sequelize[_0x97af('0x1')]},'destchannelstate':{'type':Sequelize[_0x97af('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x97af('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x97af('0x1')]},'destlanguage':{'type':Sequelize[_0x97af('0x1')]},'destaccountcode':{'type':Sequelize[_0x97af('0x1')]},'destcontext':{'type':Sequelize[_0x97af('0x1')]},'destexten':{'type':Sequelize[_0x97af('0x1')]},'destpriority':{'type':Sequelize[_0x97af('0x1')]},'destuniqueid':{'type':Sequelize[_0x97af('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x97af('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x97af('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x97af('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x97af('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 60e24c1..e046d82 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(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 152ed72..cbf1dbe 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 _0x7579=['destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','report_agent'];(function(_0x2dfb9e,_0x3c4288){var _0x3112af=function(_0x1cf7d4){while(--_0x1cf7d4){_0x2dfb9e['push'](_0x2dfb9e['shift']());}};_0x3112af(++_0x3c4288);}(_0x7579,0x1e2));var _0x9757=function(_0x4e4428,_0x5d61f1){_0x4e4428=_0x4e4428-0x0;var _0x5b9638=_0x7579[_0x4e4428];return _0x5b9638;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x9757('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3be=['destuniqueid','lodash','util','../../config/logger','api','bluebird','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xf3be,0x1e1));var _0xef3b=function(_0x4d606e,_0x1355b7){_0x4d606e=_0x4d606e-0x0;var _0x4bc8a5=_0xf3be[_0x4d606e];return _0x4bc8a5;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var logger=require(_0xef3b('0x2'))(_0xef3b('0x3'));var moment=require('moment');var BPromise=require(_0xef3b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef3b('0x5'));module[_0xef3b('0x6')]=function(_0x48f499,_0x3dfcc2){return _0x48f499[_0xef3b('0x7')](_0xef3b('0x8'),attributes,{'tableName':_0xef3b('0x9'),'paranoid':![],'indexes':[{'fields':[_0xef3b('0xa'),_0xef3b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0bb00cf..428d391 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 _0xa27f=['client','request','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','attributes','then','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x227e04,_0xc59ab9){var _0x439475=function(_0x4d50c6){while(--_0x4d50c6){_0x227e04['push'](_0x227e04['shift']());}};_0x439475(++_0xc59ab9);}(_0xa27f,0xc4));var _0xfa27=function(_0x3d75e4,_0x904a72){_0x3d75e4=_0x3d75e4-0x0;var _0x233bf3=_0xa27f[_0x3d75e4];return _0x233bf3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfa27('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa27('0x1'));var db=require(_0xfa27('0x2'))['db'];var utils=require(_0xfa27('0x3'));var logger=require(_0xfa27('0x4'))(_0xfa27('0x5'));var config=require('../../config/environment');var jayson=require(_0xfa27('0x6'));var client=jayson[_0xfa27('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5639ef,_0x5a86f2,_0x1bcafc){return new BPromise(function(_0x311cab,_0x2002de){return client[_0xfa27('0x8')](_0x5639ef,_0x1bcafc)['then'](function(_0x54833b){logger[_0xfa27('0x9')]('VoiceAgentReport,\x20%s,\x20%s',_0x5a86f2,'request\x20sent');logger[_0xfa27('0xa')](_0xfa27('0xb'),_0x5a86f2,'request\x20sent',JSON[_0xfa27('0xc')](_0x54833b));if(_0x54833b[_0xfa27('0xd')]){if(_0x54833b[_0xfa27('0xd')]['code']===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x5a86f2,_0x54833b[_0xfa27('0xd')]['message']);return _0x2002de(_0x54833b['error'][_0xfa27('0xe')]);}logger[_0xfa27('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x5a86f2,_0x54833b[_0xfa27('0xd')][_0xfa27('0xe')]);return _0x311cab(_0x54833b[_0xfa27('0xd')][_0xfa27('0xe')]);}else{logger[_0xfa27('0x9')](_0xfa27('0xf'),_0x5a86f2,_0xfa27('0x10'));_0x311cab(_0x54833b[_0xfa27('0x11')]['message']);}})[_0xfa27('0x12')](function(_0x2b8c8a){logger['error'](_0xfa27('0xf'),_0x5a86f2,_0x2b8c8a);_0x2002de(_0x2b8c8a);});});}exports[_0xfa27('0x13')]=function(_0x111b66){var _0x374642=this;return new Promise(function(_0x42e1b8,_0x5bf43f){return db[_0xfa27('0x14')][_0xfa27('0x15')](_0x111b66[_0xfa27('0x16')],{'raw':_0x111b66[_0xfa27('0x17')]?_0x111b66['options'][_0xfa27('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1621b0){logger[_0xfa27('0x9')](_0xfa27('0x13'),_0x111b66);logger[_0xfa27('0xa')](_0xfa27('0x13'),_0x111b66,JSON['stringify'](_0x1621b0));_0x42e1b8(_0x1621b0);})[_0xfa27('0x12')](function(_0x1bcacc){logger[_0xfa27('0xd')](_0xfa27('0x13'),_0x1bcacc[_0xfa27('0xe')],_0x111b66);_0x5bf43f(_0x374642[_0xfa27('0xd')](0x1f4,_0x1bcacc[_0xfa27('0xe')]));});});};exports[_0xfa27('0x19')]=function(_0x299322){var _0x38c4e6=this;return new Promise(function(_0x583b40,_0x58960d){return db[_0xfa27('0x14')]['update'](_0x299322[_0xfa27('0x16')],{'raw':_0x299322['options']?_0x299322['options'][_0xfa27('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x299322[_0xfa27('0x17')]?_0x299322['options'][_0xfa27('0x1a')]||null:null,'attributes':_0x299322[_0xfa27('0x17')]?_0x299322[_0xfa27('0x17')][_0xfa27('0x1b')]||null:null,'limit':_0x299322[_0xfa27('0x17')]?_0x299322[_0xfa27('0x17')]['limit']||null:null})[_0xfa27('0x1c')](function(_0x293a18){logger[_0xfa27('0x9')](_0xfa27('0x19'),_0x299322);logger[_0xfa27('0xa')]('UpdateVoiceAgentReport',_0x299322,JSON[_0xfa27('0xc')](_0x293a18));_0x583b40(_0x293a18);})[_0xfa27('0x12')](function(_0xc671b){logger[_0xfa27('0xd')](_0xfa27('0x19'),_0xc671b['message'],_0x299322);_0x58960d(_0x38c4e6[_0xfa27('0xd')](0x1f4,_0xc671b[_0xfa27('0xe')]));});});}; \ No newline at end of file +var _0xa560=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x3eca13,_0x19d21d){var _0x2c5f29=function(_0xb67653){while(--_0xb67653){_0x3eca13['push'](_0x3eca13['shift']());}};_0x2c5f29(++_0x19d21d);}(_0xa560,0x148));var _0x0a56=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa560[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0a56('0x0'));var util=require(_0x0a56('0x1'));var moment=require(_0x0a56('0x2'));var BPromise=require(_0x0a56('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a56('0x4'));var db=require(_0x0a56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a56('0x6'))('rpc');var config=require(_0x0a56('0x7'));var jayson=require(_0x0a56('0x8'));var client=jayson['client'][_0x0a56('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4939,_0x53bebf,_0x4e65d0){return new BPromise(function(_0x261031,_0x2e59c2){return client[_0x0a56('0xa')](_0x2b4939,_0x4e65d0)[_0x0a56('0xb')](function(_0x17cdf8){logger[_0x0a56('0xc')](_0x0a56('0xd'),_0x53bebf,_0x0a56('0xe'));logger[_0x0a56('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x53bebf,_0x0a56('0xe'),JSON[_0x0a56('0x10')](_0x17cdf8));if(_0x17cdf8[_0x0a56('0x11')]){if(_0x17cdf8[_0x0a56('0x11')]['code']===0x1f4){logger[_0x0a56('0x11')](_0x0a56('0xd'),_0x53bebf,_0x17cdf8[_0x0a56('0x11')][_0x0a56('0x12')]);return _0x2e59c2(_0x17cdf8[_0x0a56('0x11')][_0x0a56('0x12')]);}logger['error'](_0x0a56('0xd'),_0x53bebf,_0x17cdf8['error'][_0x0a56('0x12')]);return _0x261031(_0x17cdf8[_0x0a56('0x11')][_0x0a56('0x12')]);}else{logger[_0x0a56('0xc')](_0x0a56('0xd'),_0x53bebf,_0x0a56('0xe'));_0x261031(_0x17cdf8[_0x0a56('0x13')][_0x0a56('0x12')]);}})[_0x0a56('0x14')](function(_0x1fad02){logger['error'](_0x0a56('0xd'),_0x53bebf,_0x1fad02);_0x2e59c2(_0x1fad02);});});}exports[_0x0a56('0x15')]=function(_0x4b6e72){var _0xa010fa=this;return new Promise(function(_0x3c4a7e,_0x17a870){return db[_0x0a56('0x16')][_0x0a56('0x17')](_0x4b6e72[_0x0a56('0x18')],{'raw':_0x4b6e72[_0x0a56('0x19')]?_0x4b6e72[_0x0a56('0x19')][_0x0a56('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xb06cad){logger[_0x0a56('0xc')]('CreateVoiceAgentReport',_0x4b6e72);logger[_0x0a56('0xf')](_0x0a56('0x15'),_0x4b6e72,JSON['stringify'](_0xb06cad));_0x3c4a7e(_0xb06cad);})[_0x0a56('0x14')](function(_0x1e7726){logger['error']('CreateVoiceAgentReport',_0x1e7726[_0x0a56('0x12')],_0x4b6e72);_0x17a870(_0xa010fa['error'](0x1f4,_0x1e7726[_0x0a56('0x12')]));});});};exports[_0x0a56('0x1b')]=function(_0x594590){var _0x5106e3=this;return new Promise(function(_0x5d8460,_0x27707f){return db[_0x0a56('0x16')][_0x0a56('0x1c')](_0x594590[_0x0a56('0x18')],{'raw':_0x594590[_0x0a56('0x19')]?_0x594590[_0x0a56('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x594590[_0x0a56('0x19')]?_0x594590['options']['where']||null:null,'attributes':_0x594590[_0x0a56('0x19')]?_0x594590['options'][_0x0a56('0x1d')]||null:null,'limit':_0x594590['options']?_0x594590[_0x0a56('0x19')][_0x0a56('0x1e')]||null:null})[_0x0a56('0xb')](function(_0x6f00b4){logger[_0x0a56('0xc')](_0x0a56('0x1b'),_0x594590);logger[_0x0a56('0xf')](_0x0a56('0x1b'),_0x594590,JSON[_0x0a56('0x10')](_0x6f00b4));_0x5d8460(_0x6f00b4);})[_0x0a56('0x14')](function(_0x14584b){logger['error'](_0x0a56('0x1b'),_0x14584b[_0x0a56('0x12')],_0x594590);_0x27707f(_0x5106e3['error'](0x1f4,_0x14584b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0215b71..b7ec85b 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 _0x0e85=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x5dfe9b,_0x318b85){var _0x3bb0f4=function(_0x9f12f3){while(--_0x9f12f3){_0x5dfe9b['push'](_0x5dfe9b['shift']());}};_0x3bb0f4(++_0x318b85);}(_0x0e85,0x7c));var _0x50e8=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0e85[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['show']);router[_0x50e8('0xc')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xf')]);router[_0x50e8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x50e8('0x11')]);module[_0x50e8('0x12')]=router; \ No newline at end of file +var _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeec6,0x1c2));var _0x6eec=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0xeec6[_0x291aaf];return _0x5571e6;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index d2bd59f..3cf6eae 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 _0x552c=['STRING','ENUM','inbound','TEXT','DATE','INTEGER','exports'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0x552c,0xa0));var _0xc552=function(_0x280c4b,_0xfe785d){_0x280c4b=_0x280c4b-0x0;var _0x2a5e90=_0x552c[_0x280c4b];return _0x2a5e90;};'use strict';var Sequelize=require('sequelize');module[_0xc552('0x0')]={'uniqueid':{'type':Sequelize[_0xc552('0x1')]},'type':{'type':Sequelize[_0xc552('0x2')](_0xc552('0x3'),'internal','outbound','inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0xc552('0x1')]},'accountcode':{'type':Sequelize[_0xc552('0x1')]},'source':{'type':Sequelize[_0xc552('0x1')]},'destination':{'type':Sequelize[_0xc552('0x1')]},'destinationcontext':{'type':Sequelize[_0xc552('0x1')]},'callerid':{'type':Sequelize[_0xc552('0x1')]},'channel':{'type':Sequelize[_0xc552('0x1')]},'destinationchannel':{'type':Sequelize[_0xc552('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc552('0x4')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xc552('0x5')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc552('0x5')]},'duration':{'type':Sequelize[_0xc552('0x6')]},'billableseconds':{'type':Sequelize[_0xc552('0x6')]},'mohtime':{'type':Sequelize[_0xc552('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc552('0x1')]},'userfield':{'type':Sequelize[_0xc552('0x1')]},'userDisposition':{'type':Sequelize[_0xc552('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xc552('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc552('0x1')]},'prefix':{'type':Sequelize[_0xc552('0x1')]},'routeid':{'type':Sequelize[_0xc552('0x6')]},'sipcallid':{'type':Sequelize[_0xc552('0x1')]}}; \ No newline at end of file +var _0x6bd1=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x39a3ca,_0x2ec458){var _0x3d408a=function(_0x2e8f20){while(--_0x2e8f20){_0x39a3ca['push'](_0x39a3ca['shift']());}};_0x3d408a(++_0x2ec458);}(_0x6bd1,0xe8));var _0x16bd=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x6bd1[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x16bd('0x0'));module[_0x16bd('0x1')]={'uniqueid':{'type':Sequelize[_0x16bd('0x2')]},'type':{'type':Sequelize[_0x16bd('0x3')](_0x16bd('0x4'),_0x16bd('0x5'),'outbound',_0x16bd('0x6'),_0x16bd('0x7'),_0x16bd('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x16bd('0x2')]},'source':{'type':Sequelize[_0x16bd('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x16bd('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x16bd('0x9')]},'starttime':{'type':Sequelize[_0x16bd('0xa')]},'systemanswertime':{'type':Sequelize[_0x16bd('0xa')]},'answertime':{'type':Sequelize[_0x16bd('0xa')]},'endtime':{'type':Sequelize[_0x16bd('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x16bd('0xb')]},'mohtime':{'type':Sequelize[_0x16bd('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x16bd('0x2')]},'amaflags':{'type':Sequelize[_0x16bd('0x2')]},'userfield':{'type':Sequelize[_0x16bd('0x2')]},'userDisposition':{'type':Sequelize[_0x16bd('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x16bd('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x16bd('0x2')]},'prefix':{'type':Sequelize[_0x16bd('0x2')]},'routeid':{'type':Sequelize[_0x16bd('0xb')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 95597f5..de864e2 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x5f2f,0x73));var _0xf5f2=function(_0x277ce1,_0x6ed646){_0x277ce1=_0x277ce1-0x0;var _0x36ff3c=_0x5f2f[_0x277ce1];return _0x36ff3c;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _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(_0x4d0527,_0x216351){var _0x4ad853=function(_0x5f4268){while(--_0x5f4268){_0x4d0527['push'](_0x4d0527['shift']());}};_0x4ad853(++_0x216351);}(_0xb10b,0x12a));var _0xbb10=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0xb10b[_0x46e182];return _0x42ade0;};'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 diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 152c34e..f24ac98 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 _0xbbdc=['report_call','lodash','util','rimraf','./voiceCallReport.attributes','exports','define'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0xbbdc,0x1eb));var _0xcbbd=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0xbbdc[_0x4d337e];return _0x247963;};'use strict';var _=require(_0xcbbd('0x0'));var util=require(_0xcbbd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbd('0x2'));var config=require('../../config/environment');var attributes=require(_0xcbbd('0x3'));module[_0xcbbd('0x4')]=function(_0x131ef0,_0x3a7454){return _0x131ef0[_0xcbbd('0x5')]('VoiceCallReport',attributes,{'tableName':_0xcbbd('0x6'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x84fe=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','VoiceCallReport','report_call','lodash'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x84fe,0xdb));var _0xe84f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84fe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe84f('0x0'));var util=require(_0xe84f('0x1'));var logger=require(_0xe84f('0x2'))(_0xe84f('0x3'));var moment=require(_0xe84f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe84f('0x5'));var rimraf=require(_0xe84f('0x6'));var config=require(_0xe84f('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0xe84f('0x8')]=function(_0x33ac1a,_0x6d5bd0){return _0x33ac1a['define'](_0xe84f('0x9'),attributes,{'tableName':_0xe84f('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 41e25f3..9ba6f42 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 _0x4ed2=['body','UpdateVoiceCallReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VoiceCallReport','findAll','options','raw','include','map','model','attributes','then','GetVoiceCallReport','debug','CreateVoiceCallReport'];(function(_0xe8f5ca,_0x154e8a){var _0x5e31a0=function(_0x456691){while(--_0x456691){_0xe8f5ca['push'](_0xe8f5ca['shift']());}};_0x5e31a0(++_0x154e8a);}(_0x4ed2,0x7a));var _0x24ed=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4ed2[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x24ed('0x0'));var util=require(_0x24ed('0x1'));var moment=require(_0x24ed('0x2'));var BPromise=require(_0x24ed('0x3'));var rs=require(_0x24ed('0x4'));var fs=require('fs');var Redis=require(_0x24ed('0x5'));var db=require(_0x24ed('0x6'))['db'];var utils=require(_0x24ed('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x24ed('0x8'));var jayson=require(_0x24ed('0x9'));var client=jayson['client'][_0x24ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e6702,_0x11a059,_0x46a066){return new BPromise(function(_0x38cf8b,_0x56bb30){return client[_0x24ed('0xb')](_0x3e6702,_0x46a066)['then'](function(_0x522c85){logger[_0x24ed('0xc')](_0x24ed('0xd'),_0x11a059,_0x24ed('0xe'));logger['debug'](_0x24ed('0xf'),_0x11a059,'request\x20sent',JSON[_0x24ed('0x10')](_0x522c85));if(_0x522c85['error']){if(_0x522c85['error'][_0x24ed('0x11')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x11a059,_0x522c85[_0x24ed('0x12')][_0x24ed('0x13')]);return _0x56bb30(_0x522c85[_0x24ed('0x12')][_0x24ed('0x13')]);}logger[_0x24ed('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x11a059,_0x522c85['error'][_0x24ed('0x13')]);return _0x38cf8b(_0x522c85[_0x24ed('0x12')]['message']);}else{logger['info'](_0x24ed('0xd'),_0x11a059,_0x24ed('0xe'));_0x38cf8b(_0x522c85[_0x24ed('0x14')]['message']);}})[_0x24ed('0x15')](function(_0x2ccbf4){logger['error'](_0x24ed('0xd'),_0x11a059,_0x2ccbf4);_0x56bb30(_0x2ccbf4);});});}exports['GetVoiceCallReport']=function(_0x18b75c){var _0x1f7c62=this;return new Promise(function(_0x438503,_0x4502fb){return db[_0x24ed('0x16')][_0x24ed('0x17')]({'raw':_0x18b75c['options']?_0x18b75c[_0x24ed('0x18')][_0x24ed('0x19')]===undefined?!![]:![]:!![],'where':_0x18b75c[_0x24ed('0x18')]?_0x18b75c[_0x24ed('0x18')]['where']||null:null,'attributes':_0x18b75c['options']?_0x18b75c[_0x24ed('0x18')]['attributes']||null:null,'limit':_0x18b75c['options']?_0x18b75c[_0x24ed('0x18')]['limit']||null:null,'include':_0x18b75c[_0x24ed('0x18')]?_0x18b75c['options'][_0x24ed('0x1a')]?_[_0x24ed('0x1b')](_0x18b75c['options'][_0x24ed('0x1a')],function(_0x3044b2){return{'model':db[_0x3044b2[_0x24ed('0x1c')]],'as':_0x3044b2['as'],'attributes':_0x3044b2[_0x24ed('0x1d')],'include':_0x3044b2[_0x24ed('0x1a')]?_['map'](_0x3044b2[_0x24ed('0x1a')],function(_0x22d03e){return{'model':db[_0x22d03e[_0x24ed('0x1c')]],'as':_0x22d03e['as'],'attributes':_0x22d03e['attributes'],'include':_0x22d03e['include']?_['map'](_0x22d03e['include'],function(_0x21b278){return{'model':db[_0x21b278['model']],'as':_0x21b278['as'],'attributes':_0x21b278[_0x24ed('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x24ed('0x1e')](function(_0x18880b){logger[_0x24ed('0xc')](_0x24ed('0x1f'),_0x18b75c);logger[_0x24ed('0x20')](_0x24ed('0x1f'),_0x18b75c,JSON[_0x24ed('0x10')](_0x18880b));_0x438503(_0x18880b);})['catch'](function(_0x635dad){logger['error']('GetVoiceCallReport',_0x635dad['message'],_0x18b75c);_0x4502fb(_0x1f7c62['error'](0x1f4,_0x635dad[_0x24ed('0x13')]));});});};exports[_0x24ed('0x21')]=function(_0x42e51b){var _0x3a9560=this;return new Promise(function(_0x4d249b,_0x2ea27c){return db['VoiceCallReport']['create'](_0x42e51b[_0x24ed('0x22')],{'raw':_0x42e51b[_0x24ed('0x18')]?_0x42e51b[_0x24ed('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x478030){logger[_0x24ed('0xc')](_0x24ed('0x21'),_0x42e51b);logger[_0x24ed('0x20')]('CreateVoiceCallReport',_0x42e51b,JSON[_0x24ed('0x10')](_0x478030));_0x4d249b(_0x478030);})[_0x24ed('0x15')](function(_0x5c1fd5){logger[_0x24ed('0x12')]('CreateVoiceCallReport',_0x5c1fd5[_0x24ed('0x13')],_0x42e51b);_0x2ea27c(_0x3a9560[_0x24ed('0x12')](0x1f4,_0x5c1fd5['message']));});});};exports[_0x24ed('0x23')]=function(_0x4626de){var _0x12fd29=this;return new Promise(function(_0x38f2a4,_0x168f9b){return db[_0x24ed('0x16')][_0x24ed('0x24')](_0x4626de[_0x24ed('0x22')],{'raw':_0x4626de[_0x24ed('0x18')]?_0x4626de[_0x24ed('0x18')][_0x24ed('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4626de[_0x24ed('0x18')]?_0x4626de[_0x24ed('0x18')][_0x24ed('0x25')]||null:null,'attributes':_0x4626de[_0x24ed('0x18')]?_0x4626de[_0x24ed('0x18')][_0x24ed('0x1d')]||null:null,'limit':_0x4626de[_0x24ed('0x18')]?_0x4626de[_0x24ed('0x18')][_0x24ed('0x26')]||null:null})[_0x24ed('0x1e')](function(_0x219a17){logger[_0x24ed('0xc')](_0x24ed('0x23'),_0x4626de);logger[_0x24ed('0x20')](_0x24ed('0x23'),_0x4626de,JSON[_0x24ed('0x10')](_0x219a17));_0x38f2a4(_0x219a17);})['catch'](function(_0x5ba742){logger['error']('UpdateVoiceCallReport',_0x5ba742[_0x24ed('0x13')],_0x4626de);_0x168f9b(_0x12fd29[_0x24ed('0x12')](0x1f4,_0x5ba742[_0x24ed('0x13')]));});});}; \ No newline at end of file +var _0x8a0f=['util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','GetVoiceCallReport','debug','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash'];(function(_0x46e86f,_0x4819bd){var _0x19d80c=function(_0x554310){while(--_0x554310){_0x46e86f['push'](_0x46e86f['shift']());}};_0x19d80c(++_0x4819bd);}(_0x8a0f,0x10f));var _0xf8a0=function(_0x354892,_0xc5cd4){_0x354892=_0x354892-0x0;var _0x327d2f=_0x8a0f[_0x354892];return _0x327d2f;};'use strict';var _=require(_0xf8a0('0x0'));var util=require(_0xf8a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf8a0('0x3'));var logger=require(_0xf8a0('0x4'))(_0xf8a0('0x5'));var config=require('../../config/environment');var jayson=require(_0xf8a0('0x6'));var client=jayson['client'][_0xf8a0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58b984,_0x424111,_0x599a3c){return new BPromise(function(_0x523620,_0x48ba58){return client['request'](_0x58b984,_0x599a3c)[_0xf8a0('0x8')](function(_0x42bf31){logger[_0xf8a0('0x9')](_0xf8a0('0xa'),_0x424111,'request\x20sent');logger['debug'](_0xf8a0('0xb'),_0x424111,_0xf8a0('0xc'),JSON[_0xf8a0('0xd')](_0x42bf31));if(_0x42bf31[_0xf8a0('0xe')]){if(_0x42bf31['error'][_0xf8a0('0xf')]===0x1f4){logger[_0xf8a0('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x424111,_0x42bf31[_0xf8a0('0xe')][_0xf8a0('0x10')]);return _0x48ba58(_0x42bf31['error'][_0xf8a0('0x10')]);}logger[_0xf8a0('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x424111,_0x42bf31['error'][_0xf8a0('0x10')]);return _0x523620(_0x42bf31[_0xf8a0('0xe')][_0xf8a0('0x10')]);}else{logger['info'](_0xf8a0('0xa'),_0x424111,_0xf8a0('0xc'));_0x523620(_0x42bf31['result'][_0xf8a0('0x10')]);}})['catch'](function(_0x544a3d){logger[_0xf8a0('0xe')](_0xf8a0('0xa'),_0x424111,_0x544a3d);_0x48ba58(_0x544a3d);});});}exports['GetVoiceCallReport']=function(_0x502e50){var _0x115583=this;return new Promise(function(_0x15f98f,_0x4c1c51){return db[_0xf8a0('0x11')][_0xf8a0('0x12')]({'raw':_0x502e50['options']?_0x502e50[_0xf8a0('0x13')][_0xf8a0('0x14')]===undefined?!![]:![]:!![],'where':_0x502e50[_0xf8a0('0x13')]?_0x502e50[_0xf8a0('0x13')]['where']||null:null,'attributes':_0x502e50[_0xf8a0('0x13')]?_0x502e50[_0xf8a0('0x13')][_0xf8a0('0x15')]||null:null,'limit':_0x502e50[_0xf8a0('0x13')]?_0x502e50['options'][_0xf8a0('0x16')]||null:null,'include':_0x502e50[_0xf8a0('0x13')]?_0x502e50[_0xf8a0('0x13')][_0xf8a0('0x17')]?_['map'](_0x502e50['options']['include'],function(_0x2b8e05){return{'model':db[_0x2b8e05['model']],'as':_0x2b8e05['as'],'attributes':_0x2b8e05[_0xf8a0('0x15')],'include':_0x2b8e05[_0xf8a0('0x17')]?_[_0xf8a0('0x18')](_0x2b8e05[_0xf8a0('0x17')],function(_0x2119a3){return{'model':db[_0x2119a3['model']],'as':_0x2119a3['as'],'attributes':_0x2119a3[_0xf8a0('0x15')],'include':_0x2119a3[_0xf8a0('0x17')]?_[_0xf8a0('0x18')](_0x2119a3['include'],function(_0x27143f){return{'model':db[_0x27143f['model']],'as':_0x27143f['as'],'attributes':_0x27143f[_0xf8a0('0x15')]};}):[]};}):[]};}):[]:[]})[_0xf8a0('0x8')](function(_0x32e9dc){logger['info'](_0xf8a0('0x19'),_0x502e50);logger[_0xf8a0('0x1a')]('GetVoiceCallReport',_0x502e50,JSON[_0xf8a0('0xd')](_0x32e9dc));_0x15f98f(_0x32e9dc);})[_0xf8a0('0x1b')](function(_0x292a2d){logger['error']('GetVoiceCallReport',_0x292a2d[_0xf8a0('0x10')],_0x502e50);_0x4c1c51(_0x115583[_0xf8a0('0xe')](0x1f4,_0x292a2d[_0xf8a0('0x10')]));});});};exports[_0xf8a0('0x1c')]=function(_0x472117){var _0x299ce2=this;return new Promise(function(_0x513680,_0x1cddec){return db['VoiceCallReport'][_0xf8a0('0x1d')](_0x472117[_0xf8a0('0x1e')],{'raw':_0x472117['options']?_0x472117[_0xf8a0('0x13')][_0xf8a0('0x14')]===undefined?!![]:![]:!![]})[_0xf8a0('0x8')](function(_0x33c3f9){logger['info'](_0xf8a0('0x1c'),_0x472117);logger[_0xf8a0('0x1a')](_0xf8a0('0x1c'),_0x472117,JSON[_0xf8a0('0xd')](_0x33c3f9));_0x513680(_0x33c3f9);})['catch'](function(_0x1efc4a){logger[_0xf8a0('0xe')](_0xf8a0('0x1c'),_0x1efc4a[_0xf8a0('0x10')],_0x472117);_0x1cddec(_0x299ce2['error'](0x1f4,_0x1efc4a['message']));});});};exports[_0xf8a0('0x1f')]=function(_0x1b3c33){var _0x438c8a=this;return new Promise(function(_0x448544,_0x2063d4){return db['VoiceCallReport'][_0xf8a0('0x20')](_0x1b3c33[_0xf8a0('0x1e')],{'raw':_0x1b3c33['options']?_0x1b3c33[_0xf8a0('0x13')][_0xf8a0('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b3c33['options']?_0x1b3c33[_0xf8a0('0x13')][_0xf8a0('0x21')]||null:null,'attributes':_0x1b3c33[_0xf8a0('0x13')]?_0x1b3c33['options'][_0xf8a0('0x15')]||null:null,'limit':_0x1b3c33[_0xf8a0('0x13')]?_0x1b3c33[_0xf8a0('0x13')][_0xf8a0('0x16')]||null:null})[_0xf8a0('0x8')](function(_0x282f3e){logger[_0xf8a0('0x9')](_0xf8a0('0x1f'),_0x1b3c33);logger[_0xf8a0('0x1a')](_0xf8a0('0x1f'),_0x1b3c33,JSON[_0xf8a0('0xd')](_0x282f3e));_0x448544(_0x282f3e);})['catch'](function(_0x7544c){logger[_0xf8a0('0xe')]('UpdateVoiceCallReport',_0x7544c[_0xf8a0('0x10')],_0x1b3c33);_0x2063d4(_0x438c8a[_0xf8a0('0xe')](0x1f4,_0x7544c[_0xf8a0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 2159ada..3b6e5e4 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 _0x4a92=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index'];(function(_0x2a4000,_0x3c88d7){var _0x226381=function(_0x3c228e){while(--_0x3c228e){_0x2a4000['push'](_0x2a4000['shift']());}};_0x226381(++_0x3c88d7);}(_0x4a92,0xd0));var _0x24a9=function(_0x1ae78f,_0x122ed2){_0x1ae78f=_0x1ae78f-0x0;var _0x5baf80=_0x4a92[_0x1ae78f];return _0x5baf80;};'use strict';var multer=require(_0x24a9('0x0'));var util=require(_0x24a9('0x1'));var path=require(_0x24a9('0x2'));var timeout=require(_0x24a9('0x3'));var express=require(_0x24a9('0x4'));var router=express['Router']();var fs_extra=require(_0x24a9('0x5'));var auth=require(_0x24a9('0x6'));var interaction=require(_0x24a9('0x7'));var config=require('../../config/environment');var controller=require(_0x24a9('0x8'));router[_0x24a9('0x9')]('/',auth[_0x24a9('0xa')](),controller[_0x24a9('0xb')]);router[_0x24a9('0x9')](_0x24a9('0xc'),auth[_0x24a9('0xa')](),controller[_0x24a9('0xd')]);router[_0x24a9('0xe')]('/',auth[_0x24a9('0xa')](),controller[_0x24a9('0xf')]);router[_0x24a9('0x10')](_0x24a9('0xc'),auth[_0x24a9('0xa')](),controller[_0x24a9('0x11')]);router[_0x24a9('0x12')](_0x24a9('0xc'),auth[_0x24a9('0xa')](),controller[_0x24a9('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0c0c=['../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0c0c,0x19b));var _0xc0c0=function(_0x28ec75,_0x5a81ae){_0x28ec75=_0x28ec75-0x0;var _0x219ad6=_0x0c0c[_0x28ec75];return _0x219ad6;};'use strict';var multer=require(_0xc0c0('0x0'));var util=require(_0xc0c0('0x1'));var path=require(_0xc0c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0c0('0x3'));var router=express[_0xc0c0('0x4')]();var fs_extra=require(_0xc0c0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc0c0('0x6'));var config=require(_0xc0c0('0x7'));var controller=require(_0xc0c0('0x8'));router[_0xc0c0('0x9')]('/',auth['isAuthenticated'](),controller[_0xc0c0('0xa')]);router[_0xc0c0('0x9')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller['show']);router[_0xc0c0('0xd')]('/',auth[_0xc0c0('0xc')](),controller[_0xc0c0('0xe')]);router[_0xc0c0('0xf')](_0xc0c0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc0c0('0x10')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller[_0xc0c0('0x11')]);module[_0xc0c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 644dea4..2a398cf 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 _0x1ba8=['getDataValue','split','BOOLEAN','STRING','name','setDataValue','options','join'];(function(_0x154a9c,_0x3dcf24){var _0x430559=function(_0x4a411c){while(--_0x4a411c){_0x154a9c['push'](_0x154a9c['shift']());}};_0x430559(++_0x3dcf24);}(_0x1ba8,0xb3));var _0x81ba=function(_0x2c0f40,_0x1572f5){_0x2c0f40=_0x2c0f40-0x0;var _0x459753=_0x1ba8[_0x2c0f40];return _0x459753;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x81ba('0x0')]},'prefix':{'type':Sequelize[_0x81ba('0x0')],'unique':_0x81ba('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x81ba('0x0')],'set':function(_0x5333b0){this[_0x81ba('0x2')](_0x81ba('0x3'),_0x5333b0?_0x5333b0[_0x81ba('0x4')](''):[]);},'get':function(){return this[_0x81ba('0x5')](_0x81ba('0x3'))?this[_0x81ba('0x5')]('options')[_0x81ba('0x6')](''):[];}},'auth':{'type':Sequelize[_0x81ba('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x81ba('0x0')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x81ba('0x0')]},'description':{'type':Sequelize[_0x81ba('0x0')]}}; \ No newline at end of file +var _0xa31a=['options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa31a,0x175));var _0xaa31=function(_0x5672c5,_0x22f273){_0x5672c5=_0x5672c5-0x0;var _0x156413=_0xa31a[_0x5672c5];return _0x156413;};'use strict';var Sequelize=require(_0xaa31('0x0'));module[_0xaa31('0x1')]={'name':{'type':Sequelize[_0xaa31('0x2')]},'prefix':{'type':Sequelize[_0xaa31('0x2')],'unique':_0xaa31('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x292a45){this[_0xaa31('0x4')]('options',_0x292a45?_0x292a45[_0xaa31('0x5')](''):[]);},'get':function(){return this[_0xaa31('0x6')](_0xaa31('0x7'))?this[_0xaa31('0x6')]('options')[_0xaa31('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xaa31('0x2')]},'record':{'type':Sequelize[_0xaa31('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xaa31('0x2')]},'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 83586d2..893cf6e 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 _0x0ca5=['bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x0ca5,0xfc));var _0x50ca=function(_0x303bf7,_0x3c01f7){_0x303bf7=_0x303bf7-0x0;var _0x488a64=_0x0ca5[_0x303bf7];return _0x488a64;};'use strict';var emlformat=require(_0x50ca('0x0'));var rimraf=require(_0x50ca('0x1'));var zipdir=require(_0x50ca('0x2'));var jsonpatch=require(_0x50ca('0x3'));var rp=require(_0x50ca('0x4'));var moment=require(_0x50ca('0x5'));var BPromise=require(_0x50ca('0x6'));var Mustache=require(_0x50ca('0x7'));var util=require('util');var path=require(_0x50ca('0x8'));var sox=require(_0x50ca('0x9'));var csv=require(_0x50ca('0xa'));var ejs=require(_0x50ca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50ca('0xc'));var squel=require(_0x50ca('0xd'));var crypto=require('crypto');var jsforce=require(_0x50ca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x50ca('0xa'));var querystring=require('querystring');var Papa=require(_0x50ca('0xf'));var Redis=require(_0x50ca('0x10'));var authService=require(_0x50ca('0x11'));var qs=require(_0x50ca('0x12'));var as=require(_0x50ca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x50ca('0x14'));var utils=require(_0x50ca('0x15'));var config=require(_0x50ca('0x16'));var licenseUtil=require(_0x50ca('0x17'));var db=require(_0x50ca('0x18'))['db'];function respondWithStatusCode(_0x26797d,_0x297cb5){_0x297cb5=_0x297cb5||0xcc;return function(_0x323ab7){if(_0x323ab7){return _0x26797d[_0x50ca('0x19')](_0x297cb5);}return _0x26797d[_0x50ca('0x1a')](_0x297cb5)[_0x50ca('0x1b')]();};}function respondWithResult(_0x41cb54,_0x2ba68b){_0x2ba68b=_0x2ba68b||0xc8;return function(_0x868867){if(_0x868867){return _0x41cb54[_0x50ca('0x1a')](_0x2ba68b)['json'](_0x868867);}};}function respondWithFilteredResult(_0x168436,_0x5729e1){return function(_0x708d02){if(_0x708d02){var _0x3035e5=typeof _0x5729e1[_0x50ca('0x1c')]==='undefined'&&typeof _0x5729e1[_0x50ca('0x1d')]==='undefined';var _0x1d16bd=_0x708d02[_0x50ca('0x1e')];var _0x1b1f61=_0x3035e5?0x0:_0x5729e1[_0x50ca('0x1c')];var _0x4d9cbc=_0x3035e5?_0x708d02[_0x50ca('0x1e')]:_0x5729e1[_0x50ca('0x1c')]+_0x5729e1[_0x50ca('0x1d')];var _0x4bc6b9;if(_0x4d9cbc>=_0x1d16bd){_0x4d9cbc=_0x1d16bd;_0x4bc6b9=0xc8;}else{_0x4bc6b9=0xce;}_0x168436['status'](_0x4bc6b9);return _0x168436[_0x50ca('0x1f')](_0x50ca('0x20'),_0x1b1f61+'-'+_0x4d9cbc+'/'+_0x1d16bd)[_0x50ca('0x21')](_0x708d02);}return null;};}function patchUpdates(_0x346406){return function(_0x1bdd6f){try{jsonpatch[_0x50ca('0x22')](_0x1bdd6f,_0x346406,!![]);}catch(_0x48203d){return BPromise['reject'](_0x48203d);}return _0x1bdd6f[_0x50ca('0x23')]();};}function saveUpdates(_0x2e522f,_0x1f3d65){return function(_0x44c017){if(_0x44c017){return _0x44c017[_0x50ca('0x24')](_0x2e522f)[_0x50ca('0x25')](function(_0x7e6bad){return _0x7e6bad;});}return null;};}function removeEntity(_0x16f5b5,_0x4c4f58){return function(_0x53e1e7){if(_0x53e1e7){return _0x53e1e7[_0x50ca('0x26')]()['then'](function(){var _0x2c828a=_0x53e1e7[_0x50ca('0x27')]({'plain':!![]});var _0x4a4b6e=_0x50ca('0x28');return db[_0x50ca('0x29')][_0x50ca('0x26')]({'where':{'type':_0x4a4b6e,'resourceId':_0x2c828a['id']}})['then'](function(){return _0x53e1e7;});})[_0x50ca('0x25')](function(){_0x16f5b5['status'](0xcc)[_0x50ca('0x1b')]();});}};}function handleEntityNotFound(_0x1ebf0d,_0x17cfd0){return function(_0x58ebac){if(!_0x58ebac){_0x1ebf0d[_0x50ca('0x19')](0x194);}return _0x58ebac;};}function handleError(_0x4fd8a7,_0xca51f){_0xca51f=_0xca51f||0x1f4;return function(_0x44fc76){logger[_0x50ca('0x2a')](_0x44fc76[_0x50ca('0x2b')]);if(_0x44fc76[_0x50ca('0x2c')]){delete _0x44fc76[_0x50ca('0x2c')];}_0x4fd8a7[_0x50ca('0x1a')](_0xca51f)[_0x50ca('0x2d')](_0x44fc76);};}exports[_0x50ca('0x2e')]=function(_0x34aad2,_0x784edb){var _0x5e4285={},_0x474a2a={},_0x2c3133={'count':0x0,'rows':[]};var _0x16e8bf=_[_0x50ca('0x2f')](db[_0x50ca('0x30')][_0x50ca('0x31')],function(_0x697e9){return{'name':_0x697e9[_0x50ca('0x32')],'type':_0x697e9['type'][_0x50ca('0x33')]};});_0x474a2a[_0x50ca('0x34')]=_[_0x50ca('0x2f')](_0x16e8bf,_0x50ca('0x2c'));_0x474a2a[_0x50ca('0x35')]=_['keys'](_0x34aad2[_0x50ca('0x35')]);_0x474a2a['filters']=_[_0x50ca('0x36')](_0x474a2a[_0x50ca('0x34')],_0x474a2a[_0x50ca('0x35')]);_0x5e4285[_0x50ca('0x37')]=_[_0x50ca('0x36')](_0x474a2a['model'],qs[_0x50ca('0x38')](_0x34aad2[_0x50ca('0x35')][_0x50ca('0x38')]));_0x5e4285[_0x50ca('0x37')]=_0x5e4285[_0x50ca('0x37')]['length']?_0x5e4285[_0x50ca('0x37')]:_0x474a2a[_0x50ca('0x34')];if(!_0x34aad2['query'][_0x50ca('0x39')](_0x50ca('0x3a'))){_0x5e4285[_0x50ca('0x1d')]=qs[_0x50ca('0x1d')](_0x34aad2[_0x50ca('0x35')]['limit']);_0x5e4285[_0x50ca('0x1c')]=qs[_0x50ca('0x1c')](_0x34aad2[_0x50ca('0x35')]['offset']);}_0x5e4285['order']=qs['sort'](_0x34aad2['query'][_0x50ca('0x3b')]);_0x5e4285['where']=qs[_0x50ca('0x3c')](_[_0x50ca('0x3d')](_0x34aad2[_0x50ca('0x35')],_0x474a2a[_0x50ca('0x3c')]),_0x16e8bf);if(_0x34aad2[_0x50ca('0x35')][_0x50ca('0x3e')]){_0x5e4285[_0x50ca('0x3f')]=_[_0x50ca('0x40')](_0x5e4285[_0x50ca('0x3f')],{'$or':_[_0x50ca('0x2f')](_0x16e8bf,function(_0x5c48a1){if(_0x5c48a1[_0x50ca('0x41')]!==_0x50ca('0x42')){var _0x590f93={};_0x590f93[_0x5c48a1[_0x50ca('0x2c')]]={'$like':'%'+_0x34aad2[_0x50ca('0x35')][_0x50ca('0x3e')]+'%'};return _0x590f93;}})});}_0x5e4285=_[_0x50ca('0x40')]({},_0x5e4285,_0x34aad2[_0x50ca('0x43')]);var _0x222382={'where':_0x5e4285[_0x50ca('0x3f')]};return db[_0x50ca('0x30')][_0x50ca('0x1e')](_0x222382)['then'](function(_0x570535){_0x2c3133[_0x50ca('0x1e')]=_0x570535;if(_0x34aad2[_0x50ca('0x35')][_0x50ca('0x44')]){_0x5e4285[_0x50ca('0x45')]=[{'all':!![]}];}return db[_0x50ca('0x30')][_0x50ca('0x46')](_0x5e4285);})['then'](function(_0x4ac01a){_0x2c3133['rows']=_0x4ac01a;return _0x2c3133;})[_0x50ca('0x25')](respondWithFilteredResult(_0x784edb,_0x5e4285))['catch'](handleError(_0x784edb,null));};exports[_0x50ca('0x47')]=function(_0x17c9fe,_0x4177cf){var _0x27c4ce={'raw':![],'where':{'id':_0x17c9fe[_0x50ca('0x48')]['id']}},_0x24f388={};_0x24f388[_0x50ca('0x34')]=_[_0x50ca('0x49')](db[_0x50ca('0x30')]['rawAttributes']);_0x24f388[_0x50ca('0x35')]=_[_0x50ca('0x49')](_0x17c9fe[_0x50ca('0x35')]);_0x24f388[_0x50ca('0x3c')]=_[_0x50ca('0x36')](_0x24f388['model'],_0x24f388[_0x50ca('0x35')]);_0x27c4ce[_0x50ca('0x37')]=_[_0x50ca('0x36')](_0x24f388[_0x50ca('0x34')],qs[_0x50ca('0x38')](_0x17c9fe['query'][_0x50ca('0x38')]));_0x27c4ce[_0x50ca('0x37')]=_0x27c4ce[_0x50ca('0x37')][_0x50ca('0x4a')]?_0x27c4ce['attributes']:_0x24f388[_0x50ca('0x34')];if(_0x17c9fe[_0x50ca('0x35')]['includeAll']){_0x27c4ce[_0x50ca('0x45')]=[{'all':!![]}];}_0x27c4ce=_[_0x50ca('0x40')]({},_0x27c4ce,_0x17c9fe[_0x50ca('0x43')]);return db[_0x50ca('0x30')][_0x50ca('0x4b')](_0x27c4ce)[_0x50ca('0x25')](handleEntityNotFound(_0x4177cf,null))[_0x50ca('0x25')](respondWithResult(_0x4177cf,null))[_0x50ca('0x4c')](handleError(_0x4177cf,null));};exports[_0x50ca('0x4d')]=function(_0x2c6f55,_0x39ea){return db[_0x50ca('0x30')][_0x50ca('0x4d')](_0x2c6f55[_0x50ca('0x4e')],{})[_0x50ca('0x25')](function(_0x1b88d5){var _0x415277=_0x2c6f55[_0x50ca('0x4f')]['get']({'plain':!![]});if(!_0x415277)throw new Error(_0x50ca('0x50'));if(_0x415277[_0x50ca('0x51')]==='user'){var _0x1bac1b=_0x1b88d5[_0x50ca('0x27')]({'plain':!![]});var _0x78e460=_0x50ca('0x28');return db[_0x50ca('0x52')][_0x50ca('0x4b')]({'where':{'name':_0x78e460,'userProfileId':_0x415277[_0x50ca('0x53')]},'raw':!![]})[_0x50ca('0x25')](function(_0x5c3296){if(_0x5c3296&&_0x5c3296[_0x50ca('0x54')]===0x0){return db[_0x50ca('0x29')]['create']({'name':_0x1bac1b[_0x50ca('0x2c')],'resourceId':_0x1bac1b['id'],'type':_0x5c3296[_0x50ca('0x2c')],'sectionId':_0x5c3296['id']},{})['then'](function(){return _0x1b88d5;});}else{return _0x1b88d5;}})[_0x50ca('0x4c')](function(_0x56903a){logger[_0x50ca('0x2a')](_0x50ca('0x55'),_0x56903a);throw _0x56903a;});}return _0x1b88d5;})['then'](respondWithResult(_0x39ea,0xc9))['catch'](handleError(_0x39ea,null));};exports[_0x50ca('0x24')]=function(_0x1c75aa,_0x4b9e77){if(_0x1c75aa[_0x50ca('0x4e')]['id']){delete _0x1c75aa[_0x50ca('0x4e')]['id'];}return db[_0x50ca('0x30')][_0x50ca('0x4b')]({'where':{'id':_0x1c75aa['params']['id']}})[_0x50ca('0x25')](handleEntityNotFound(_0x4b9e77,null))[_0x50ca('0x25')](saveUpdates(_0x1c75aa[_0x50ca('0x4e')],null))[_0x50ca('0x25')](respondWithResult(_0x4b9e77,null))[_0x50ca('0x4c')](handleError(_0x4b9e77,null));};exports[_0x50ca('0x26')]=function(_0x39e47e,_0x290ab7){return db[_0x50ca('0x30')][_0x50ca('0x4b')]({'where':{'id':_0x39e47e[_0x50ca('0x48')]['id']}})[_0x50ca('0x25')](handleEntityNotFound(_0x290ab7,null))['then'](removeEntity(_0x290ab7,null))[_0x50ca('0x4c')](handleError(_0x290ab7,null));}; \ No newline at end of file +var _0x2e54=['apply','reject','save','then','get','ChanSpies','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x550b26,_0xe14aae){var _0x1cf038=function(_0x188080){while(--_0x188080){_0x550b26['push'](_0x550b26['shift']());}};_0x1cf038(++_0xe14aae);}(_0x2e54,0x1dd));var _0x42e5=function(_0x3b8531,_0x441334){_0x3b8531=_0x3b8531-0x0;var _0x133138=_0x2e54[_0x3b8531];return _0x133138;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){var _0xf29221=_0x32380f[_0x42e5('0x25')]({'plain':!![]});var _0x275c80=_0x42e5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x275c80,'resourceId':_0xf29221['id']}})[_0x42e5('0x24')](function(){return _0x32380f;});})['then'](function(){_0x37d10e['status'](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x5b1727,_0x392c6b){return function(_0x2d9e65){if(!_0x2d9e65){_0x5b1727[_0x42e5('0x18')](0x194);}return _0x2d9e65;};}function handleError(_0x1c8ee4,_0x27ae27){_0x27ae27=_0x27ae27||0x1f4;return function(_0x2f1edc){logger['error'](_0x2f1edc[_0x42e5('0x27')]);if(_0x2f1edc[_0x42e5('0x28')]){delete _0x2f1edc[_0x42e5('0x28')];}_0x1c8ee4[_0x42e5('0x19')](_0x27ae27)[_0x42e5('0x29')](_0x2f1edc);};}exports[_0x42e5('0x2a')]=function(_0x383e97,_0x282cbf){var _0x5a4930={},_0x2ba9ef={},_0x2c7542={'count':0x0,'rows':[]};var _0x3d9e8b=_[_0x42e5('0x2b')](db['VoiceChanSpy'][_0x42e5('0x2c')],function(_0xf5a3dc){return{'name':_0xf5a3dc[_0x42e5('0x2d')],'type':_0xf5a3dc[_0x42e5('0x2e')]['key']};});_0x2ba9ef['model']=_[_0x42e5('0x2b')](_0x3d9e8b,'name');_0x2ba9ef[_0x42e5('0x2f')]=_['keys'](_0x383e97[_0x42e5('0x2f')]);_0x2ba9ef[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2ba9ef['model'],_0x2ba9ef[_0x42e5('0x2f')]);_0x5a4930[_0x42e5('0x32')]=_['intersection'](_0x2ba9ef[_0x42e5('0x33')],qs['fields'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x5a4930[_0x42e5('0x32')]=_0x5a4930[_0x42e5('0x32')][_0x42e5('0x35')]?_0x5a4930[_0x42e5('0x32')]:_0x2ba9ef[_0x42e5('0x33')];if(!_0x383e97['query']['hasOwnProperty'](_0x42e5('0x36'))){_0x5a4930[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x383e97['query']['limit']);_0x5a4930['offset']=qs['offset'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x1c')]);}_0x5a4930[_0x42e5('0x37')]=qs[_0x42e5('0x38')](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x38')]);_0x5a4930[_0x42e5('0x39')]=qs[_0x42e5('0x30')](_['pick'](_0x383e97[_0x42e5('0x2f')],_0x2ba9ef['filters']),_0x3d9e8b);if(_0x383e97[_0x42e5('0x2f')][_0x42e5('0x3a')]){_0x5a4930[_0x42e5('0x39')]=_[_0x42e5('0x3b')](_0x5a4930[_0x42e5('0x39')],{'$or':_[_0x42e5('0x2b')](_0x3d9e8b,function(_0xd5e7f5){if(_0xd5e7f5['type']!==_0x42e5('0x3c')){var _0x356ff6={};_0x356ff6[_0xd5e7f5['name']]={'$like':'%'+_0x383e97[_0x42e5('0x2f')]['filter']+'%'};return _0x356ff6;}})});}_0x5a4930=_['merge']({},_0x5a4930,_0x383e97['options']);var _0x1105ea={'where':_0x5a4930[_0x42e5('0x39')]};return db[_0x42e5('0x3d')][_0x42e5('0x1f')](_0x1105ea)[_0x42e5('0x24')](function(_0x77aa22){_0x2c7542[_0x42e5('0x1f')]=_0x77aa22;if(_0x383e97['query'][_0x42e5('0x3e')]){_0x5a4930[_0x42e5('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x42e5('0x40')](_0x5a4930);})[_0x42e5('0x24')](function(_0x5db771){_0x2c7542[_0x42e5('0x41')]=_0x5db771;return _0x2c7542;})[_0x42e5('0x24')](respondWithFilteredResult(_0x282cbf,_0x5a4930))[_0x42e5('0x42')](handleError(_0x282cbf,null));};exports[_0x42e5('0x43')]=function(_0x424304,_0x4d32f4){var _0x41e1fd={'raw':![],'where':{'id':_0x424304[_0x42e5('0x44')]['id']}},_0xc34e51={};_0xc34e51[_0x42e5('0x33')]=_['keys'](db[_0x42e5('0x3d')][_0x42e5('0x2c')]);_0xc34e51[_0x42e5('0x2f')]=_[_0x42e5('0x45')](_0x424304[_0x42e5('0x2f')]);_0xc34e51[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0xc34e51[_0x42e5('0x33')],_0xc34e51['query']);_0x41e1fd[_0x42e5('0x32')]=_['intersection'](_0xc34e51['model'],qs[_0x42e5('0x34')](_0x424304[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x41e1fd[_0x42e5('0x32')]=_0x41e1fd[_0x42e5('0x32')][_0x42e5('0x35')]?_0x41e1fd[_0x42e5('0x32')]:_0xc34e51['model'];if(_0x424304[_0x42e5('0x2f')][_0x42e5('0x3e')]){_0x41e1fd[_0x42e5('0x3f')]=[{'all':!![]}];}_0x41e1fd=_[_0x42e5('0x3b')]({},_0x41e1fd,_0x424304[_0x42e5('0x46')]);return db[_0x42e5('0x3d')][_0x42e5('0x47')](_0x41e1fd)[_0x42e5('0x24')](handleEntityNotFound(_0x4d32f4,null))['then'](respondWithResult(_0x4d32f4,null))[_0x42e5('0x42')](handleError(_0x4d32f4,null));};exports[_0x42e5('0x48')]=function(_0x3616f4,_0x48757e){return db[_0x42e5('0x3d')][_0x42e5('0x48')](_0x3616f4[_0x42e5('0x49')],{})[_0x42e5('0x24')](function(_0x2586b0){var _0x528ddd=_0x3616f4[_0x42e5('0x4a')]['get']({'plain':!![]});if(!_0x528ddd)throw new Error(_0x42e5('0x4b'));if(_0x528ddd[_0x42e5('0x4c')]===_0x42e5('0x4a')){var _0x48b63b=_0x2586b0['get']({'plain':!![]});var _0x4f0639=_0x42e5('0x26');return db[_0x42e5('0x4d')][_0x42e5('0x47')]({'where':{'name':_0x4f0639,'userProfileId':_0x528ddd[_0x42e5('0x4e')]},'raw':!![]})['then'](function(_0x3ae9de){if(_0x3ae9de&&_0x3ae9de[_0x42e5('0x4f')]===0x0){return db[_0x42e5('0x50')]['create']({'name':_0x48b63b[_0x42e5('0x28')],'resourceId':_0x48b63b['id'],'type':_0x3ae9de['name'],'sectionId':_0x3ae9de['id']},{})[_0x42e5('0x24')](function(){return _0x2586b0;});}else{return _0x2586b0;}})[_0x42e5('0x42')](function(_0x53e29b){logger[_0x42e5('0x51')](_0x42e5('0x52'),_0x53e29b);throw _0x53e29b;});}return _0x2586b0;})[_0x42e5('0x24')](respondWithResult(_0x48757e,0xc9))[_0x42e5('0x42')](handleError(_0x48757e,null));};exports[_0x42e5('0x53')]=function(_0x3f043f,_0x41c1dc){if(_0x3f043f[_0x42e5('0x49')]['id']){delete _0x3f043f[_0x42e5('0x49')]['id'];}return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x3f043f[_0x42e5('0x44')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x41c1dc,null))[_0x42e5('0x24')](saveUpdates(_0x3f043f[_0x42e5('0x49')],null))[_0x42e5('0x24')](respondWithResult(_0x41c1dc,null))['catch'](handleError(_0x41c1dc,null));};exports[_0x42e5('0x54')]=function(_0x2b226f,_0x40b633){return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x2b226f['params']['id']}})['then'](handleEntityNotFound(_0x40b633,null))[_0x42e5('0x24')](removeEntity(_0x40b633,null))[_0x42e5('0x42')](handleError(_0x40b633,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index ca538be..3ed6d5f 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 _0x3376=['models','define','VoiceChanSpy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','record','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','name','options','join','StopMixMonitor','length','internal','User','findAll','then','catch','exports'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x3376,0x187));var _0x6337=function(_0x25efaa,_0x44ab63){_0x25efaa=_0x25efaa-0x0;var _0x5320dc=_0x3376[_0x25efaa];return _0x5320dc;};'use strict';var _=require(_0x6337('0x0'));var util=require(_0x6337('0x1'));var BPromise=require(_0x6337('0x2'));var attributes=require(_0x6337('0x3'));var getUserApplications=function(_0x2d4688,_0x5876e5,_0x7791bf){var _0x48348e=0x1;var _0x176bf2=[];var _0x1ebc7a={'context':_0x5876e5[_0x6337('0x4')]||_0x6337('0x5'),'exten':util[_0x6337('0x6')](_0x6337('0x7'),_0x2d4688[_0x6337('0x8')],_0x7791bf),'type':_0x6337('0x9'),'isApp':![],'ChanSpyId':_0x2d4688['id'],'UserId':_0x5876e5['id']};_0x176bf2[_0x6337('0xa')](_[_0x6337('0xb')]({'app':_0x6337('0xc'),'appdata':util[_0x6337('0x6')]('CDR(type)=%s','chanspy'),'priority':_0x48348e++},_0x1ebc7a));if(_0x2d4688[_0x6337('0xd')]){_0x176bf2[_0x6337('0xa')](_[_0x6337('0xb')]({'app':'MixMonitor','appdata':util['format'](_0x6337('0xe'),_0x2d4688[_0x6337('0xf')]),'priority':_0x48348e++},_0x1ebc7a));}if(_0x2d4688['auth']){_0x176bf2['push'](_[_0x6337('0xb')]({'app':_0x6337('0x10'),'appdata':_0x2d4688['password'],'priority':_0x48348e++},_0x1ebc7a));}_0x176bf2[_0x6337('0xa')](_[_0x6337('0xb')]({'app':_0x6337('0x11'),'appdata':util[_0x6337('0x6')]('SIP/%s,%s',_0x5876e5[_0x6337('0x12')],_0x2d4688[_0x6337('0x13')]?_0x2d4688[_0x6337('0x13')][_0x6337('0x14')](''):''),'priority':_0x48348e++},_0x1ebc7a));if(_0x2d4688[_0x6337('0xd')]){_0x176bf2[_0x6337('0xa')](_[_0x6337('0xb')]({'app':_0x6337('0x15'),'priority':_0x48348e++},_0x1ebc7a));}return _0x176bf2;};var getChanSpyApplications=function(_0x75593d,_0x1cec4e){var _0x364a20=[];for(var _0xb7ded3=0x0,_0x786e44=0x1;_0xb7ded3<_0x1cec4e[_0x6337('0x16')];_0xb7ded3++,_0x786e44=0x1){_0x364a20=_0x364a20['concat'](getUserApplications(_0x75593d,_0x1cec4e[_0xb7ded3],_0x1cec4e[_0xb7ded3][_0x6337('0x17')]));if(_0x1cec4e[_0xb7ded3][_0x6337('0x17')]!=_0x1cec4e[_0xb7ded3][_0x6337('0x12')]){_0x364a20=_0x364a20['concat'](getUserApplications(_0x75593d,_0x1cec4e[_0xb7ded3],_0x1cec4e[_0xb7ded3][_0x6337('0x12')]));}}return _0x364a20;};var getChanSpyPromise=function(_0x32211c,_0x9b5b2c){return new BPromise(function(_0x33a094,_0x60662c){return _0x32211c[_0x6337('0x18')][_0x6337('0x19')]({'attributes':['id','name',_0x6337('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x6337('0x1a')](function(_0x40068f){if(_0x40068f){return _0x33a094(getChanSpyApplications(_0x9b5b2c,_0x40068f));}return _0x33a094([]);})[_0x6337('0x1b')](function(_0x3fd3a7){_0x60662c(_0x3fd3a7);});});};module[_0x6337('0x1c')]=function(_0x3e70f3,_0x45dfd8){var _0xb71248=_0x3e70f3[_0x6337('0x1d')];return _0x3e70f3[_0x6337('0x1e')](_0x6337('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xbac6ad,_0xa45078,_0x32998d){return getChanSpyPromise(_0xb71248,_0xbac6ad)[_0x6337('0x1a')](function(_0x25180b){if(_0x25180b&&_0x25180b['length']){return _0xb71248[_0x6337('0x20')]['bulkCreate'](_0x25180b);}})[_0x6337('0x1a')](function(){_0x32998d();})[_0x6337('0x1b')](function(_0x40cfaa){_0x32998d(_0x40cfaa);});},'afterUpdate':function(_0x11c3f1,_0x2d02cf,_0x5290c3){return _0xb71248[_0x6337('0x20')][_0x6337('0x21')]({'where':{'ChanSpyId':_0x11c3f1['id']}})['then'](function(){return getChanSpyPromise(_0xb71248,_0x11c3f1);})[_0x6337('0x1a')](function(_0x2ca579){if(_0x2ca579&&_0x2ca579[_0x6337('0x16')]){return _0xb71248[_0x6337('0x20')][_0x6337('0x22')](_0x2ca579);}})[_0x6337('0x1a')](function(){_0x5290c3();})[_0x6337('0x1b')](function(_0x1c43f2){_0x5290c3(_0x1c43f2);});},'afterDestroy':function(_0x5ddd20,_0xfe4429,_0x37929d){return _0xb71248['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5ddd20['id']}})[_0x6337('0x1a')](function(){_0x37929d();})[_0x6337('0x1b')](function(_0x5e0f85){_0x37929d(_0x5e0f85);});}}});}; \ No newline at end of file +var _0x66d2=['destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge','Set','CDR(type)=%s','MixMonitor','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','internal','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension'];(function(_0x1c490a,_0x217f34){var _0x1e0b1d=function(_0x3ee02b){while(--_0x3ee02b){_0x1c490a['push'](_0x1c490a['shift']());}};_0x1e0b1d(++_0x217f34);}(_0x66d2,0x17d));var _0x266d=function(_0x231541,_0x41f496){_0x231541=_0x231541-0x0;var _0xf99c1=_0x66d2[_0x231541];return _0xf99c1;};'use strict';var _=require(_0x266d('0x0'));var util=require(_0x266d('0x1'));var BPromise=require(_0x266d('0x2'));var attributes=require(_0x266d('0x3'));var getUserApplications=function(_0x1e247f,_0x310546,_0x1c7a0e){var _0x14fd89=0x1;var _0x1c01ea=[];var _0x1f229e={'context':_0x310546[_0x266d('0x4')]||_0x266d('0x5'),'exten':util[_0x266d('0x6')]('%s%s',_0x1e247f[_0x266d('0x7')],_0x1c7a0e),'type':_0x266d('0x8'),'isApp':![],'ChanSpyId':_0x1e247f['id'],'UserId':_0x310546['id']};_0x1c01ea[_0x266d('0x9')](_[_0x266d('0xa')]({'app':_0x266d('0xb'),'appdata':util[_0x266d('0x6')](_0x266d('0xc'),'chanspy'),'priority':_0x14fd89++},_0x1f229e));if(_0x1e247f['record']){_0x1c01ea[_0x266d('0x9')](_['merge']({'app':_0x266d('0xd'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x1e247f['recordingFormat']),'priority':_0x14fd89++},_0x1f229e));}if(_0x1e247f[_0x266d('0xe')]){_0x1c01ea[_0x266d('0x9')](_[_0x266d('0xa')]({'app':_0x266d('0xf'),'appdata':_0x1e247f[_0x266d('0x10')],'priority':_0x14fd89++},_0x1f229e));}_0x1c01ea['push'](_[_0x266d('0xa')]({'app':_0x266d('0x11'),'appdata':util['format'](_0x266d('0x12'),_0x310546[_0x266d('0x13')],_0x1e247f[_0x266d('0x14')]?_0x1e247f[_0x266d('0x14')][_0x266d('0x15')](''):''),'priority':_0x14fd89++},_0x1f229e));if(_0x1e247f[_0x266d('0x16')]){_0x1c01ea[_0x266d('0x9')](_['merge']({'app':_0x266d('0x17'),'priority':_0x14fd89++},_0x1f229e));}return _0x1c01ea;};var getChanSpyApplications=function(_0x3da3ac,_0x1daf1f){var _0x3c38d7=[];for(var _0x2d1561=0x0,_0x2ce78d=0x1;_0x2d1561<_0x1daf1f[_0x266d('0x18')];_0x2d1561++,_0x2ce78d=0x1){_0x3c38d7=_0x3c38d7['concat'](getUserApplications(_0x3da3ac,_0x1daf1f[_0x2d1561],_0x1daf1f[_0x2d1561][_0x266d('0x19')]));if(_0x1daf1f[_0x2d1561]['internal']!=_0x1daf1f[_0x2d1561]['name']){_0x3c38d7=_0x3c38d7['concat'](getUserApplications(_0x3da3ac,_0x1daf1f[_0x2d1561],_0x1daf1f[_0x2d1561][_0x266d('0x13')]));}}return _0x3c38d7;};var getChanSpyPromise=function(_0x56c8a9,_0x35cb0b){return new BPromise(function(_0x7f5e8a,_0x4a820b){return _0x56c8a9[_0x266d('0x1a')][_0x266d('0x1b')]({'attributes':['id',_0x266d('0x13'),_0x266d('0x19')],'where':{'role':_0x266d('0x1c'),'chanspy':!![]},'raw':!![]})[_0x266d('0x1d')](function(_0x255b97){if(_0x255b97){return _0x7f5e8a(getChanSpyApplications(_0x35cb0b,_0x255b97));}return _0x7f5e8a([]);})[_0x266d('0x1e')](function(_0x1223a9){_0x4a820b(_0x1223a9);});});};module[_0x266d('0x1f')]=function(_0x37f71d,_0x20ff94){var _0x28d7a8=_0x37f71d[_0x266d('0x20')];return _0x37f71d['define'](_0x266d('0x21'),attributes,{'tableName':_0x266d('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21cbb1,_0x131247,_0x509404){return getChanSpyPromise(_0x28d7a8,_0x21cbb1)[_0x266d('0x1d')](function(_0x39ad28){if(_0x39ad28&&_0x39ad28[_0x266d('0x18')]){return _0x28d7a8['VoiceExtension'][_0x266d('0x23')](_0x39ad28);}})[_0x266d('0x1d')](function(){_0x509404();})[_0x266d('0x1e')](function(_0x30697c){_0x509404(_0x30697c);});},'afterUpdate':function(_0x30adf7,_0x25cee4,_0x1fd7ab){return _0x28d7a8[_0x266d('0x24')][_0x266d('0x25')]({'where':{'ChanSpyId':_0x30adf7['id']}})[_0x266d('0x1d')](function(){return getChanSpyPromise(_0x28d7a8,_0x30adf7);})[_0x266d('0x1d')](function(_0x1a9b20){if(_0x1a9b20&&_0x1a9b20['length']){return _0x28d7a8[_0x266d('0x24')]['bulkCreate'](_0x1a9b20);}})[_0x266d('0x1d')](function(){_0x1fd7ab();})[_0x266d('0x1e')](function(_0x179d58){_0x1fd7ab(_0x179d58);});},'afterDestroy':function(_0x5c5124,_0x5c65fa,_0x467f7c){return _0x28d7a8['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5c5124['id']}})[_0x266d('0x1d')](function(){_0x467f7c();})[_0x266d('0x1e')](function(_0x334c72){_0x467f7c(_0x334c72);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 99b061e..33c0988 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 _0x7794=['randomstring','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x7794,0x7b));var _0x4779=function(_0x4e43e8,_0x327de0){_0x4e43e8=_0x4e43e8-0x0;var _0x41fcfc=_0x7794[_0x4e43e8];return _0x41fcfc;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x339512,_0x523c93,_0xb3fe18){return new BPromise(function(_0x13bb66,_0x270a5f){return client[_0x4779('0x8')](_0x339512,_0xb3fe18)[_0x4779('0x9')](function(_0x7179e1){logger[_0x4779('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));logger[_0x4779('0xc')](_0x4779('0xd'),_0x523c93,_0x4779('0xb'),JSON[_0x4779('0xe')](_0x7179e1));if(_0x7179e1[_0x4779('0xf')]){if(_0x7179e1[_0x4779('0xf')][_0x4779('0x10')]===0x1f4){logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1['error']['message']);return _0x270a5f(_0x7179e1['error'][_0x4779('0x12')]);}logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1[_0x4779('0xf')]['message']);return _0x13bb66(_0x7179e1[_0x4779('0xf')][_0x4779('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));_0x13bb66(_0x7179e1[_0x4779('0x13')][_0x4779('0x12')]);}})[_0x4779('0x14')](function(_0x56ec51){logger['error'](_0x4779('0x11'),_0x523c93,_0x56ec51);_0x270a5f(_0x56ec51);});});} \ No newline at end of file +var _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x18fd0b,_0xe0f9ed){var _0x3b19a3=function(_0xde37ae){while(--_0xde37ae){_0x18fd0b['push'](_0x18fd0b['shift']());}};_0x3b19a3(++_0xe0f9ed);}(_0x9348,0x10d));var _0x8934=function(_0x275fd9,_0x4bd9b0){_0x275fd9=_0x275fd9-0x0;var _0x19c18e=_0x9348[_0x275fd9];return _0x19c18e;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 628e905..e485b1f 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 _0xe7eb=['update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','get','post','create','put','/:id'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xe7eb,0x1dd));var _0xbe7e=function(_0x1c4999,_0x129185){_0x1c4999=_0x1c4999-0x0;var _0x448504=_0xe7eb[_0x1c4999];return _0x448504;};'use strict';var multer=require(_0xbe7e('0x0'));var util=require(_0xbe7e('0x1'));var path=require('path');var timeout=require(_0xbe7e('0x2'));var express=require(_0xbe7e('0x3'));var router=express[_0xbe7e('0x4')]();var fs_extra=require(_0xbe7e('0x5'));var auth=require(_0xbe7e('0x6'));var interaction=require(_0xbe7e('0x7'));var config=require('../../config/environment');var controller=require(_0xbe7e('0x8'));router['get']('/',auth[_0xbe7e('0x9')](),controller[_0xbe7e('0xa')]);router[_0xbe7e('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbe7e('0xc')]('/',auth[_0xbe7e('0x9')](),controller[_0xbe7e('0xd')]);router[_0xbe7e('0xe')](_0xbe7e('0xf'),auth['isAuthenticated'](),controller[_0xbe7e('0x10')]);router['delete']('/:id',auth[_0xbe7e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5eaa=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x5eaa,0xdd));var _0xa5ea=function(_0x3616a4,_0x2b89fa){_0x3616a4=_0x3616a4-0x0;var _0x539472=_0x5eaa[_0x3616a4];return _0x539472;};'use strict';var multer=require(_0xa5ea('0x0'));var util=require(_0xa5ea('0x1'));var path=require(_0xa5ea('0x2'));var timeout=require(_0xa5ea('0x3'));var express=require(_0xa5ea('0x4'));var router=express['Router']();var fs_extra=require(_0xa5ea('0x5'));var auth=require(_0xa5ea('0x6'));var interaction=require(_0xa5ea('0x7'));var config=require(_0xa5ea('0x8'));var controller=require('./voiceContext.controller');router[_0xa5ea('0x9')]('/',auth['isAuthenticated'](),controller[_0xa5ea('0xa')]);router[_0xa5ea('0x9')](_0xa5ea('0xb'),auth[_0xa5ea('0xc')](),controller[_0xa5ea('0xd')]);router[_0xa5ea('0xe')]('/',auth[_0xa5ea('0xc')](),controller[_0xa5ea('0xf')]);router[_0xa5ea('0x10')](_0xa5ea('0xb'),auth[_0xa5ea('0xc')](),controller[_0xa5ea('0x11')]);router[_0xa5ea('0x12')](_0xa5ea('0xb'),auth[_0xa5ea('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 3355361..3afb569 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 _0xa251=['BOOLEAN','exports','name','STRING'];(function(_0x3f6368,_0x9ba37f){var _0x75cea4=function(_0x113196){while(--_0x113196){_0x3f6368['push'](_0x3f6368['shift']());}};_0x75cea4(++_0x9ba37f);}(_0xa251,0x99));var _0x1a25=function(_0x53368e,_0x477a10){_0x53368e=_0x53368e-0x0;var _0x1528fa=_0xa251[_0x53368e];return _0x1528fa;};'use strict';var Sequelize=require('sequelize');module[_0x1a25('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1a25('0x1')},'description':{'type':Sequelize[_0x1a25('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1a25('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbf6e=['name','BOOLEAN','STRING'];(function(_0x48dc7e,_0x5ee759){var _0x5986e1=function(_0xd01224){while(--_0xd01224){_0x48dc7e['push'](_0x48dc7e['shift']());}};_0x5986e1(++_0x5ee759);}(_0xbf6e,0x149));var _0xebf6=function(_0x46319c,_0x5a5ea4){_0x46319c=_0x46319c-0x0;var _0x4b741b=_0xbf6e[_0x46319c];return _0x4b741b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xebf6('0x0')],'unique':_0xebf6('0x1')},'description':{'type':Sequelize[_0xebf6('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4215c4f..edba26c 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 _0x9ff0=['length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','catch','status','end','offset','undefined','count','limit','Content-Range','json','reject','update','then','Contexts','UserProfileResource','destroy','sendStatus','stack','name','send','index','VoiceContext','fieldName','type','key','map','query','keys','intersection','model','attributes','fields'];(function(_0x190cfe,_0x16f92e){var _0x22716e=function(_0x52a77a){while(--_0x52a77a){_0x190cfe['push'](_0x190cfe['shift']());}};_0x22716e(++_0x16f92e);}(_0x9ff0,0x15e));var _0x09ff=function(_0x5e02bb,_0x17636e){_0x5e02bb=_0x5e02bb-0x0;var _0x5f41b5=_0x9ff0[_0x5e02bb];return _0x5f41b5;};'use strict';var emlformat=require(_0x09ff('0x0'));var rimraf=require(_0x09ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09ff('0x2'));var moment=require(_0x09ff('0x3'));var BPromise=require(_0x09ff('0x4'));var Mustache=require(_0x09ff('0x5'));var util=require('util');var path=require(_0x09ff('0x6'));var sox=require(_0x09ff('0x7'));var csv=require('to-csv');var ejs=require(_0x09ff('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09ff('0x9'));var squel=require(_0x09ff('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x09ff('0xb'));var toCsv=require(_0x09ff('0xc'));var querystring=require(_0x09ff('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x09ff('0xe'));var qs=require(_0x09ff('0xf'));var as=require(_0x09ff('0x10'));var hardwareService=require(_0x09ff('0x11'));var logger=require(_0x09ff('0x12'))(_0x09ff('0x13'));var utils=require(_0x09ff('0x14'));var config=require(_0x09ff('0x15'));var licenseUtil=require(_0x09ff('0x16'));var db=require(_0x09ff('0x17'))['db'];var jayson=require(_0x09ff('0x18'));var client=jayson['client'][_0x09ff('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3bad3f,_0x155a95,_0x4baced,_0x4e83c2){return new BPromise(function(_0x4d347c,_0x3b259b){var _0xd3bd55=_0x4e83c2||client;return _0xd3bd55[_0x09ff('0x1a')](_0x3bad3f,_0x4baced)['then'](function(_0xf42ed0){logger[_0x09ff('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x155a95,_0x09ff('0x1c'));logger[_0x09ff('0x1d')](_0x09ff('0x1e'),_0x155a95,_0x09ff('0x1c'),JSON[_0x09ff('0x1f')](_0xf42ed0));if(_0xf42ed0[_0x09ff('0x20')]){if(_0xf42ed0[_0x09ff('0x20')]['code']===0x1f4){logger[_0x09ff('0x20')](_0x09ff('0x21'),_0x155a95,_0xf42ed0[_0x09ff('0x20')][_0x09ff('0x22')]);return _0x3b259b(_0xf42ed0['error'][_0x09ff('0x22')]);}logger[_0x09ff('0x20')](_0x09ff('0x21'),_0x155a95,_0xf42ed0['error'][_0x09ff('0x22')]);return _0x4d347c(_0xf42ed0[_0x09ff('0x20')][_0x09ff('0x22')]);}else{logger['info'](_0x09ff('0x21'),_0x155a95,_0x09ff('0x1c'));_0x4d347c(_0xf42ed0['result'][_0x09ff('0x22')]);}})[_0x09ff('0x23')](function(_0x292fdf){logger['error'](_0x09ff('0x21'),_0x155a95,_0x292fdf);_0x3b259b(_0x292fdf);});});}function respondWithStatusCode(_0x14f42d,_0x4f56a5){_0x4f56a5=_0x4f56a5||0xcc;return function(_0x35fb61){if(_0x35fb61){return _0x14f42d['sendStatus'](_0x4f56a5);}return _0x14f42d[_0x09ff('0x24')](_0x4f56a5)[_0x09ff('0x25')]();};}function respondWithResult(_0x4960e3,_0x2d44bf){_0x2d44bf=_0x2d44bf||0xc8;return function(_0x41401f){if(_0x41401f){return _0x4960e3['status'](_0x2d44bf)['json'](_0x41401f);}};}function respondWithFilteredResult(_0x4c8a87,_0x879471){return function(_0x31b45d){if(_0x31b45d){var _0x243878=typeof _0x879471[_0x09ff('0x26')]===_0x09ff('0x27')&&typeof _0x879471['limit']==='undefined';var _0x29ef84=_0x31b45d[_0x09ff('0x28')];var _0xce2768=_0x243878?0x0:_0x879471[_0x09ff('0x26')];var _0x229d01=_0x243878?_0x31b45d[_0x09ff('0x28')]:_0x879471[_0x09ff('0x26')]+_0x879471[_0x09ff('0x29')];var _0x569848;if(_0x229d01>=_0x29ef84){_0x229d01=_0x29ef84;_0x569848=0xc8;}else{_0x569848=0xce;}_0x4c8a87[_0x09ff('0x24')](_0x569848);return _0x4c8a87['set'](_0x09ff('0x2a'),_0xce2768+'-'+_0x229d01+'/'+_0x29ef84)[_0x09ff('0x2b')](_0x31b45d);}return null;};}function patchUpdates(_0x380ae4){return function(_0x1e843d){try{jsonpatch['apply'](_0x1e843d,_0x380ae4,!![]);}catch(_0x296969){return BPromise[_0x09ff('0x2c')](_0x296969);}return _0x1e843d['save']();};}function saveUpdates(_0x401745,_0x2d365e){return function(_0xd10f0){if(_0xd10f0){return _0xd10f0[_0x09ff('0x2d')](_0x401745)[_0x09ff('0x2e')](function(_0x49d52a){return _0x49d52a;});}return null;};}function removeEntity(_0x2c579d,_0x4cdfba){return function(_0x2569a3){if(_0x2569a3){return _0x2569a3['destroy']()['then'](function(){var _0x288aa9=_0x2569a3['get']({'plain':!![]});var _0x5b91d0=_0x09ff('0x2f');return db[_0x09ff('0x30')][_0x09ff('0x31')]({'where':{'type':_0x5b91d0,'resourceId':_0x288aa9['id']}})[_0x09ff('0x2e')](function(){return _0x2569a3;});})['then'](function(){_0x2c579d[_0x09ff('0x24')](0xcc)[_0x09ff('0x25')]();});}};}function handleEntityNotFound(_0x3388be,_0x27b234){return function(_0x4877fe){if(!_0x4877fe){_0x3388be[_0x09ff('0x32')](0x194);}return _0x4877fe;};}function handleError(_0x141099,_0x32db3d){_0x32db3d=_0x32db3d||0x1f4;return function(_0x3a9f7e){logger['error'](_0x3a9f7e[_0x09ff('0x33')]);if(_0x3a9f7e[_0x09ff('0x34')]){delete _0x3a9f7e[_0x09ff('0x34')];}_0x141099['status'](_0x32db3d)[_0x09ff('0x35')](_0x3a9f7e);};}exports[_0x09ff('0x36')]=function(_0x3a5719,_0x2d93bb){var _0x32c050={},_0x3fcec1={},_0x5801b6={'count':0x0,'rows':[]};var _0x5a8051=_['map'](db[_0x09ff('0x37')]['rawAttributes'],function(_0x80726e){return{'name':_0x80726e[_0x09ff('0x38')],'type':_0x80726e[_0x09ff('0x39')][_0x09ff('0x3a')]};});_0x3fcec1['model']=_[_0x09ff('0x3b')](_0x5a8051,_0x09ff('0x34'));_0x3fcec1[_0x09ff('0x3c')]=_[_0x09ff('0x3d')](_0x3a5719[_0x09ff('0x3c')]);_0x3fcec1['filters']=_[_0x09ff('0x3e')](_0x3fcec1[_0x09ff('0x3f')],_0x3fcec1[_0x09ff('0x3c')]);_0x32c050[_0x09ff('0x40')]=_['intersection'](_0x3fcec1[_0x09ff('0x3f')],qs[_0x09ff('0x41')](_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x41')]));_0x32c050[_0x09ff('0x40')]=_0x32c050[_0x09ff('0x40')][_0x09ff('0x42')]?_0x32c050['attributes']:_0x3fcec1[_0x09ff('0x3f')];if(!_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x43')](_0x09ff('0x44'))){_0x32c050[_0x09ff('0x29')]=qs[_0x09ff('0x29')](_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x29')]);_0x32c050[_0x09ff('0x26')]=qs[_0x09ff('0x26')](_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x26')]);}_0x32c050[_0x09ff('0x45')]=qs['sort'](_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x46')]);_0x32c050['where']=qs[_0x09ff('0x47')](_[_0x09ff('0x48')](_0x3a5719[_0x09ff('0x3c')],_0x3fcec1[_0x09ff('0x47')]),_0x5a8051);if(_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x49')]){_0x32c050['where']=_[_0x09ff('0x4a')](_0x32c050[_0x09ff('0x4b')],{'$or':_['map'](_0x5a8051,function(_0x4563a3){if(_0x4563a3['type']!==_0x09ff('0x4c')){var _0x3177a6={};_0x3177a6[_0x4563a3[_0x09ff('0x34')]]={'$like':'%'+_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x49')]+'%'};return _0x3177a6;}})});}_0x32c050=_[_0x09ff('0x4a')]({},_0x32c050,_0x3a5719[_0x09ff('0x4d')]);var _0x3491a2={'where':_0x32c050['where']};return db['VoiceContext'][_0x09ff('0x28')](_0x3491a2)[_0x09ff('0x2e')](function(_0x31b822){_0x5801b6[_0x09ff('0x28')]=_0x31b822;if(_0x3a5719[_0x09ff('0x3c')][_0x09ff('0x4e')]){_0x32c050[_0x09ff('0x4f')]=[{'all':!![]}];}return db[_0x09ff('0x37')][_0x09ff('0x50')](_0x32c050);})[_0x09ff('0x2e')](function(_0x3c2185){_0x5801b6[_0x09ff('0x51')]=_0x3c2185;return _0x5801b6;})[_0x09ff('0x2e')](respondWithFilteredResult(_0x2d93bb,_0x32c050))['catch'](handleError(_0x2d93bb,null));};exports[_0x09ff('0x52')]=function(_0x24478d,_0x214484){var _0x229757={'raw':![],'where':{'id':_0x24478d[_0x09ff('0x53')]['id']}},_0x5ad089={};_0x5ad089['model']=_[_0x09ff('0x3d')](db[_0x09ff('0x37')][_0x09ff('0x54')]);_0x5ad089[_0x09ff('0x3c')]=_[_0x09ff('0x3d')](_0x24478d['query']);_0x5ad089[_0x09ff('0x47')]=_['intersection'](_0x5ad089[_0x09ff('0x3f')],_0x5ad089[_0x09ff('0x3c')]);_0x229757[_0x09ff('0x40')]=_[_0x09ff('0x3e')](_0x5ad089['model'],qs[_0x09ff('0x41')](_0x24478d[_0x09ff('0x3c')][_0x09ff('0x41')]));_0x229757[_0x09ff('0x40')]=_0x229757[_0x09ff('0x40')][_0x09ff('0x42')]?_0x229757[_0x09ff('0x40')]:_0x5ad089[_0x09ff('0x3f')];if(_0x24478d[_0x09ff('0x3c')][_0x09ff('0x4e')]){_0x229757['include']=[{'all':!![]}];}_0x229757=_[_0x09ff('0x4a')]({},_0x229757,_0x24478d[_0x09ff('0x4d')]);return db['VoiceContext'][_0x09ff('0x55')](_0x229757)[_0x09ff('0x2e')](handleEntityNotFound(_0x214484,null))[_0x09ff('0x2e')](respondWithResult(_0x214484,null))[_0x09ff('0x23')](handleError(_0x214484,null));};exports['create']=function(_0x3aacab,_0x3affbc,_0x3b3d0e){var _0x5133b4;return db[_0x09ff('0x37')][_0x09ff('0x56')](_0x3aacab[_0x09ff('0x57')],{'raw':!![]})[_0x09ff('0x2e')](function(_0x36a6c7){_0x5133b4=_0x36a6c7;return db['VoiceContext'][_0x09ff('0x50')]({'raw':!![]});})[_0x09ff('0x2e')](function(_0x1713af){var _0x1b2bb2=fs[_0x09ff('0x58')](path[_0x09ff('0x59')](config[_0x09ff('0x5a')],_0x09ff('0x5b')),_0x09ff('0x5c'));var _0x152f0f=ejs[_0x09ff('0x5d')](_0x1b2bb2,{'contexts':_0x1713af||[]});fs[_0x09ff('0x5e')](_0x09ff('0x5f'),_0x152f0f);})['then'](function(){return respondWithRpcPromise(_0x09ff('0x60'),_0x09ff('0x56'),{'module':_0x09ff('0x61')});})['then'](function(){var _0x2cc3d6=_0x3aacab[_0x09ff('0x62')]['get']({'plain':!![]});if(!_0x2cc3d6)throw new Error(_0x09ff('0x63'));if(_0x2cc3d6[_0x09ff('0x64')]===_0x09ff('0x62')){var _0x5d376e=_0x5133b4[_0x09ff('0x65')]({'plain':!![]});return db['UserProfileSection'][_0x09ff('0x55')]({'where':{'name':'Contexts','userProfileId':_0x2cc3d6['userProfileId']},'raw':!![]})[_0x09ff('0x2e')](function(_0x1d7cea){if(_0x1d7cea&&_0x1d7cea[_0x09ff('0x66')]===0x0){return db[_0x09ff('0x30')][_0x09ff('0x56')]({'name':_0x5d376e[_0x09ff('0x34')],'resourceId':_0x5d376e['id'],'type':_0x1d7cea[_0x09ff('0x34')],'sectionId':_0x1d7cea['id']},{})[_0x09ff('0x2e')](function(){return _0x5133b4;});}else{return _0x5133b4;}})[_0x09ff('0x23')](function(_0x41c58b){logger[_0x09ff('0x20')](_0x09ff('0x67'),_0x41c58b);throw _0x41c58b;});}return _0x5133b4;})['then'](respondWithResult(_0x3affbc,0xc9))[_0x09ff('0x23')](handleError(_0x3affbc,null));};exports[_0x09ff('0x2d')]=function(_0x371d6f,_0x5c7255,_0x9579ec){var _0x4019a4;return db[_0x09ff('0x37')][_0x09ff('0x55')]({'where':{'id':_0x371d6f[_0x09ff('0x53')]['id']}})[_0x09ff('0x2e')](handleEntityNotFound(_0x5c7255,null))[_0x09ff('0x2e')](saveUpdates(_0x371d6f[_0x09ff('0x57')],null))[_0x09ff('0x2e')](function(_0x5e6563){if(_0x5e6563){_0x4019a4=_0x5e6563;return db[_0x09ff('0x37')][_0x09ff('0x50')]({'raw':!![]});}})[_0x09ff('0x2e')](function(_0x43c1ae){var _0x136ad2=fs[_0x09ff('0x58')](path[_0x09ff('0x59')](config[_0x09ff('0x5a')],_0x09ff('0x5b')),_0x09ff('0x5c'));var _0x27b376=ejs[_0x09ff('0x5d')](_0x136ad2,{'contexts':_0x43c1ae||[]});fs[_0x09ff('0x5e')](_0x09ff('0x5f'),_0x27b376);})[_0x09ff('0x2e')](function(){return respondWithRpcPromise(_0x09ff('0x60'),_0x09ff('0x2d'),{'module':_0x09ff('0x61')});})[_0x09ff('0x2e')](function(){return _0x4019a4;})[_0x09ff('0x2e')](respondWithResult(_0x5c7255,null))[_0x09ff('0x23')](handleError(_0x5c7255,null));};exports[_0x09ff('0x31')]=function(_0x118526,_0x10967e,_0x315d45){var _0x323895;return db[_0x09ff('0x37')]['find']({'where':{'id':_0x118526[_0x09ff('0x53')]['id']}})['then'](handleEntityNotFound(_0x10967e,null))[_0x09ff('0x2e')](removeEntity(_0x10967e,null))[_0x09ff('0x2e')](function(){return db[_0x09ff('0x37')][_0x09ff('0x50')]({'raw':!![]});})[_0x09ff('0x2e')](function(_0x5374b9){var _0x1afa3e=fs[_0x09ff('0x58')](path[_0x09ff('0x59')](config[_0x09ff('0x5a')],'server/files/templates/context.ejs'),_0x09ff('0x5c'));var _0x596842=ejs[_0x09ff('0x5d')](_0x1afa3e,{'contexts':_0x5374b9});fs[_0x09ff('0x5e')](_0x09ff('0x5f'),_0x596842);return respondWithRpcPromise(_0x09ff('0x60'),'destroy',{'module':_0x09ff('0x61')});})[_0x09ff('0x23')](handleError(_0x10967e,null));}; \ No newline at end of file +var _0x4c6d=['key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','create','body','readFileSync','join','root','render','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','update','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','get','Contexts','end','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type'];(function(_0xd7f2eb,_0x29e482){var _0xae3324=function(_0x387d5c){while(--_0x387d5c){_0xd7f2eb['push'](_0xd7f2eb['shift']());}};_0xae3324(++_0x29e482);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x2d6bf1,_0x5b3a23){_0x2d6bf1=_0x2d6bf1-0x0;var _0x5b2495=_0x4c6d[_0x2d6bf1];return _0x5b2495;};'use strict';var emlformat=require(_0xd4c6('0x0'));var rimraf=require(_0xd4c6('0x1'));var zipdir=require(_0xd4c6('0x2'));var jsonpatch=require(_0xd4c6('0x3'));var rp=require(_0xd4c6('0x4'));var moment=require('moment');var BPromise=require(_0xd4c6('0x5'));var Mustache=require(_0xd4c6('0x6'));var util=require(_0xd4c6('0x7'));var path=require('path');var sox=require(_0xd4c6('0x8'));var csv=require(_0xd4c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4c6('0xa'));var _=require(_0xd4c6('0xb'));var squel=require(_0xd4c6('0xc'));var crypto=require('crypto');var jsforce=require(_0xd4c6('0xd'));var deskjs=require(_0xd4c6('0xe'));var toCsv=require(_0xd4c6('0x9'));var querystring=require('querystring');var Papa=require(_0xd4c6('0xf'));var Redis=require(_0xd4c6('0x10'));var authService=require(_0xd4c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd4c6('0x12'));var hardwareService=require(_0xd4c6('0x13'));var logger=require(_0xd4c6('0x14'))(_0xd4c6('0x15'));var utils=require(_0xd4c6('0x16'));var config=require(_0xd4c6('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xd4c6('0x18'));var client=jayson['client'][_0xd4c6('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1ce98a,_0x191068,_0x2424c3,_0x3a2143){return new BPromise(function(_0x384a98,_0x94f42e){var _0x5b3cf0=_0x3a2143||client;return _0x5b3cf0['request'](_0x1ce98a,_0x2424c3)[_0xd4c6('0x1a')](function(_0x3deb85){logger[_0xd4c6('0x1b')](_0xd4c6('0x1c'),_0x191068,_0xd4c6('0x1d'));logger[_0xd4c6('0x1e')](_0xd4c6('0x1f'),_0x191068,'request\x20sent',JSON[_0xd4c6('0x20')](_0x3deb85));if(_0x3deb85[_0xd4c6('0x21')]){if(_0x3deb85[_0xd4c6('0x21')][_0xd4c6('0x22')]===0x1f4){logger[_0xd4c6('0x21')]('VoiceContext,\x20%s,\x20%s',_0x191068,_0x3deb85[_0xd4c6('0x21')][_0xd4c6('0x23')]);return _0x94f42e(_0x3deb85[_0xd4c6('0x21')]['message']);}logger[_0xd4c6('0x21')](_0xd4c6('0x1c'),_0x191068,_0x3deb85[_0xd4c6('0x21')][_0xd4c6('0x23')]);return _0x384a98(_0x3deb85['error'][_0xd4c6('0x23')]);}else{logger['info'](_0xd4c6('0x1c'),_0x191068,_0xd4c6('0x1d'));_0x384a98(_0x3deb85[_0xd4c6('0x24')][_0xd4c6('0x23')]);}})[_0xd4c6('0x25')](function(_0x27d8eb){logger[_0xd4c6('0x21')](_0xd4c6('0x1c'),_0x191068,_0x27d8eb);_0x94f42e(_0x27d8eb);});});}function respondWithStatusCode(_0x155cb3,_0x466330){_0x466330=_0x466330||0xcc;return function(_0x1ebb17){if(_0x1ebb17){return _0x155cb3[_0xd4c6('0x26')](_0x466330);}return _0x155cb3['status'](_0x466330)['end']();};}function respondWithResult(_0x2f7309,_0x2febbf){_0x2febbf=_0x2febbf||0xc8;return function(_0x4a5390){if(_0x4a5390){return _0x2f7309[_0xd4c6('0x27')](_0x2febbf)[_0xd4c6('0x28')](_0x4a5390);}};}function respondWithFilteredResult(_0x100411,_0x565b25){return function(_0x35b50c){if(_0x35b50c){var _0x30276c=typeof _0x565b25['offset']===_0xd4c6('0x29')&&typeof _0x565b25[_0xd4c6('0x2a')]===_0xd4c6('0x29');var _0x488e7e=_0x35b50c[_0xd4c6('0x2b')];var _0x3b656d=_0x30276c?0x0:_0x565b25[_0xd4c6('0x2c')];var _0x4270d5=_0x30276c?_0x35b50c[_0xd4c6('0x2b')]:_0x565b25[_0xd4c6('0x2c')]+_0x565b25[_0xd4c6('0x2a')];var _0x1f32d8;if(_0x4270d5>=_0x488e7e){_0x4270d5=_0x488e7e;_0x1f32d8=0xc8;}else{_0x1f32d8=0xce;}_0x100411[_0xd4c6('0x27')](_0x1f32d8);return _0x100411[_0xd4c6('0x2d')](_0xd4c6('0x2e'),_0x3b656d+'-'+_0x4270d5+'/'+_0x488e7e)[_0xd4c6('0x28')](_0x35b50c);}return null;};}function patchUpdates(_0x15d312){return function(_0x112969){try{jsonpatch['apply'](_0x112969,_0x15d312,!![]);}catch(_0x25229b){return BPromise[_0xd4c6('0x2f')](_0x25229b);}return _0x112969[_0xd4c6('0x30')]();};}function saveUpdates(_0x38d423,_0x4a4667){return function(_0x4f8a76){if(_0x4f8a76){return _0x4f8a76['update'](_0x38d423)[_0xd4c6('0x1a')](function(_0x42161e){return _0x42161e;});}return null;};}function removeEntity(_0x1eb355,_0x2ee8df){return function(_0x1ac153){if(_0x1ac153){return _0x1ac153[_0xd4c6('0x31')]()[_0xd4c6('0x1a')](function(){var _0x5cd469=_0x1ac153[_0xd4c6('0x32')]({'plain':!![]});var _0x3ae596=_0xd4c6('0x33');return db['UserProfileResource'][_0xd4c6('0x31')]({'where':{'type':_0x3ae596,'resourceId':_0x5cd469['id']}})[_0xd4c6('0x1a')](function(){return _0x1ac153;});})[_0xd4c6('0x1a')](function(){_0x1eb355['status'](0xcc)[_0xd4c6('0x34')]();});}};}function handleEntityNotFound(_0x37a3a1,_0xdff93){return function(_0xe5aa2d){if(!_0xe5aa2d){_0x37a3a1['sendStatus'](0x194);}return _0xe5aa2d;};}function handleError(_0x25b48a,_0x155b05){_0x155b05=_0x155b05||0x1f4;return function(_0x14db11){logger[_0xd4c6('0x21')](_0x14db11[_0xd4c6('0x35')]);if(_0x14db11['name']){delete _0x14db11[_0xd4c6('0x36')];}_0x25b48a[_0xd4c6('0x27')](_0x155b05)[_0xd4c6('0x37')](_0x14db11);};}exports[_0xd4c6('0x38')]=function(_0x24a145,_0x2cdb9d){var _0x554666={},_0x13b552={},_0x3e9e92={'count':0x0,'rows':[]};var _0x3bb951=_['map'](db[_0xd4c6('0x39')][_0xd4c6('0x3a')],function(_0x1c95e3){return{'name':_0x1c95e3[_0xd4c6('0x3b')],'type':_0x1c95e3[_0xd4c6('0x3c')][_0xd4c6('0x3d')]};});_0x13b552[_0xd4c6('0x3e')]=_[_0xd4c6('0x3f')](_0x3bb951,_0xd4c6('0x36'));_0x13b552['query']=_[_0xd4c6('0x40')](_0x24a145['query']);_0x13b552['filters']=_[_0xd4c6('0x41')](_0x13b552[_0xd4c6('0x3e')],_0x13b552[_0xd4c6('0x42')]);_0x554666[_0xd4c6('0x43')]=_[_0xd4c6('0x41')](_0x13b552['model'],qs['fields'](_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x44')]));_0x554666[_0xd4c6('0x43')]=_0x554666[_0xd4c6('0x43')]['length']?_0x554666[_0xd4c6('0x43')]:_0x13b552['model'];if(!_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x45')](_0xd4c6('0x46'))){_0x554666['limit']=qs[_0xd4c6('0x2a')](_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x2a')]);_0x554666[_0xd4c6('0x2c')]=qs[_0xd4c6('0x2c')](_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x2c')]);}_0x554666[_0xd4c6('0x47')]=qs[_0xd4c6('0x48')](_0x24a145['query'][_0xd4c6('0x48')]);_0x554666[_0xd4c6('0x49')]=qs[_0xd4c6('0x4a')](_['pick'](_0x24a145[_0xd4c6('0x42')],_0x13b552[_0xd4c6('0x4a')]),_0x3bb951);if(_0x24a145[_0xd4c6('0x42')]['filter']){_0x554666['where']=_[_0xd4c6('0x4b')](_0x554666[_0xd4c6('0x49')],{'$or':_[_0xd4c6('0x3f')](_0x3bb951,function(_0x5b9816){if(_0x5b9816[_0xd4c6('0x3c')]!==_0xd4c6('0x4c')){var _0x1a53e9={};_0x1a53e9[_0x5b9816[_0xd4c6('0x36')]]={'$like':'%'+_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x4d')]+'%'};return _0x1a53e9;}})});}_0x554666=_['merge']({},_0x554666,_0x24a145[_0xd4c6('0x4e')]);var _0x221f4b={'where':_0x554666[_0xd4c6('0x49')]};return db[_0xd4c6('0x39')][_0xd4c6('0x2b')](_0x221f4b)[_0xd4c6('0x1a')](function(_0x34fb42){_0x3e9e92[_0xd4c6('0x2b')]=_0x34fb42;if(_0x24a145['query']['includeAll']){_0x554666[_0xd4c6('0x4f')]=[{'all':!![]}];}return db[_0xd4c6('0x39')][_0xd4c6('0x50')](_0x554666);})['then'](function(_0x37aa81){_0x3e9e92[_0xd4c6('0x51')]=_0x37aa81;return _0x3e9e92;})[_0xd4c6('0x1a')](respondWithFilteredResult(_0x2cdb9d,_0x554666))['catch'](handleError(_0x2cdb9d,null));};exports[_0xd4c6('0x52')]=function(_0xa6bd55,_0x17193f){var _0x1cefcc={'raw':![],'where':{'id':_0xa6bd55[_0xd4c6('0x53')]['id']}},_0x50b1ee={};_0x50b1ee[_0xd4c6('0x3e')]=_[_0xd4c6('0x40')](db[_0xd4c6('0x39')][_0xd4c6('0x3a')]);_0x50b1ee[_0xd4c6('0x42')]=_[_0xd4c6('0x40')](_0xa6bd55['query']);_0x50b1ee[_0xd4c6('0x4a')]=_[_0xd4c6('0x41')](_0x50b1ee[_0xd4c6('0x3e')],_0x50b1ee['query']);_0x1cefcc[_0xd4c6('0x43')]=_[_0xd4c6('0x41')](_0x50b1ee[_0xd4c6('0x3e')],qs[_0xd4c6('0x44')](_0xa6bd55[_0xd4c6('0x42')][_0xd4c6('0x44')]));_0x1cefcc[_0xd4c6('0x43')]=_0x1cefcc['attributes'][_0xd4c6('0x54')]?_0x1cefcc['attributes']:_0x50b1ee['model'];if(_0xa6bd55[_0xd4c6('0x42')]['includeAll']){_0x1cefcc[_0xd4c6('0x4f')]=[{'all':!![]}];}_0x1cefcc=_['merge']({},_0x1cefcc,_0xa6bd55[_0xd4c6('0x4e')]);return db['VoiceContext']['find'](_0x1cefcc)[_0xd4c6('0x1a')](handleEntityNotFound(_0x17193f,null))[_0xd4c6('0x1a')](respondWithResult(_0x17193f,null))[_0xd4c6('0x25')](handleError(_0x17193f,null));};exports[_0xd4c6('0x55')]=function(_0x5639b6,_0x241e6c,_0x2fc893){var _0x44a904;return db[_0xd4c6('0x39')]['create'](_0x5639b6[_0xd4c6('0x56')],{'raw':!![]})[_0xd4c6('0x1a')](function(_0x3c8e29){_0x44a904=_0x3c8e29;return db[_0xd4c6('0x39')][_0xd4c6('0x50')]({'raw':!![]});})[_0xd4c6('0x1a')](function(_0x37cb1d){var _0x32e0a8=fs[_0xd4c6('0x57')](path[_0xd4c6('0x58')](config[_0xd4c6('0x59')],'server/files/templates/context.ejs'),'utf8');var _0x2dab4a=ejs[_0xd4c6('0x5a')](_0x32e0a8,{'contexts':_0x37cb1d||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2dab4a);})['then'](function(){return respondWithRpcPromise(_0xd4c6('0x5b'),_0xd4c6('0x55'),{'module':'chan_sip.so'});})['then'](function(){var _0x3915d1=_0x5639b6[_0xd4c6('0x5c')][_0xd4c6('0x32')]({'plain':!![]});if(!_0x3915d1)throw new Error(_0xd4c6('0x5d'));if(_0x3915d1[_0xd4c6('0x5e')]==='user'){var _0x3e9a31=_0x44a904[_0xd4c6('0x32')]({'plain':!![]});return db[_0xd4c6('0x5f')][_0xd4c6('0x60')]({'where':{'name':_0xd4c6('0x33'),'userProfileId':_0x3915d1[_0xd4c6('0x61')]},'raw':!![]})[_0xd4c6('0x1a')](function(_0x1c5dfa){if(_0x1c5dfa&&_0x1c5dfa[_0xd4c6('0x62')]===0x0){return db[_0xd4c6('0x63')][_0xd4c6('0x55')]({'name':_0x3e9a31[_0xd4c6('0x36')],'resourceId':_0x3e9a31['id'],'type':_0x1c5dfa[_0xd4c6('0x36')],'sectionId':_0x1c5dfa['id']},{})['then'](function(){return _0x44a904;});}else{return _0x44a904;}})['catch'](function(_0x3148ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3148ea);throw _0x3148ea;});}return _0x44a904;})['then'](respondWithResult(_0x241e6c,0xc9))[_0xd4c6('0x25')](handleError(_0x241e6c,null));};exports[_0xd4c6('0x64')]=function(_0x1afde2,_0x46e433,_0x5731f6){var _0xbdcb11;return db[_0xd4c6('0x39')]['find']({'where':{'id':_0x1afde2[_0xd4c6('0x53')]['id']}})[_0xd4c6('0x1a')](handleEntityNotFound(_0x46e433,null))[_0xd4c6('0x1a')](saveUpdates(_0x1afde2[_0xd4c6('0x56')],null))['then'](function(_0x3d711c){if(_0x3d711c){_0xbdcb11=_0x3d711c;return db[_0xd4c6('0x39')]['findAll']({'raw':!![]});}})[_0xd4c6('0x1a')](function(_0xbbdb9c){var _0x5ae295=fs[_0xd4c6('0x57')](path[_0xd4c6('0x58')](config['root'],_0xd4c6('0x65')),'utf8');var _0x7aef4=ejs[_0xd4c6('0x5a')](_0x5ae295,{'contexts':_0xbbdb9c||[]});fs[_0xd4c6('0x66')](_0xd4c6('0x67'),_0x7aef4);})[_0xd4c6('0x1a')](function(){return respondWithRpcPromise(_0xd4c6('0x5b'),'update',{'module':_0xd4c6('0x68')});})['then'](function(){return _0xbdcb11;})[_0xd4c6('0x1a')](respondWithResult(_0x46e433,null))[_0xd4c6('0x25')](handleError(_0x46e433,null));};exports['destroy']=function(_0x136fd1,_0xf13eb9,_0x125639){var _0x5d544f;return db[_0xd4c6('0x39')]['find']({'where':{'id':_0x136fd1[_0xd4c6('0x53')]['id']}})[_0xd4c6('0x1a')](handleEntityNotFound(_0xf13eb9,null))['then'](removeEntity(_0xf13eb9,null))[_0xd4c6('0x1a')](function(){return db['VoiceContext'][_0xd4c6('0x50')]({'raw':!![]});})[_0xd4c6('0x1a')](function(_0x4a8eb7){var _0x22032b=fs[_0xd4c6('0x57')](path['join'](config[_0xd4c6('0x59')],_0xd4c6('0x65')),'utf8');var _0x237255=ejs[_0xd4c6('0x5a')](_0x22032b,{'contexts':_0x4a8eb7});fs[_0xd4c6('0x66')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x237255);return respondWithRpcPromise(_0xd4c6('0x5b'),_0xd4c6('0x31'),{'module':_0xd4c6('0x68')});})[_0xd4c6('0x25')](handleError(_0xf13eb9,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 2157d95..cb4a663 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 _0xe317=['voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','define'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0xe317,0x155));var _0x7e31=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xe317[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7e31('0x0'));var util=require(_0x7e31('0x1'));var logger=require(_0x7e31('0x2'))(_0x7e31('0x3'));var moment=require(_0x7e31('0x4'));var BPromise=require(_0x7e31('0x5'));var rp=require(_0x7e31('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e31('0x7'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module['exports']=function(_0x1f175d,_0x3288c0){return _0x1f175d[_0x7e31('0x8')]('VoiceContext',attributes,{'tableName':_0x7e31('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ace=['define','VoiceContext','voice_contexts','util','../../config/logger','api','moment','bluebird','request-promise','./voiceContext.attributes','exports'];(function(_0x4a5972,_0x22541e){var _0x49a63c=function(_0x4e1d39){while(--_0x4e1d39){_0x4a5972['push'](_0x4a5972['shift']());}};_0x49a63c(++_0x22541e);}(_0x7ace,0x1bb));var _0xe7ac=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7ace[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0xe7ac('0x0'));var logger=require(_0xe7ac('0x1'))(_0xe7ac('0x2'));var moment=require(_0xe7ac('0x3'));var BPromise=require(_0xe7ac('0x4'));var rp=require(_0xe7ac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7ac('0x6'));module[_0xe7ac('0x7')]=function(_0x5ce6bd,_0x3a4680){return _0x5ce6bd[_0xe7ac('0x8')](_0xe7ac('0x9'),attributes,{'tableName':_0xe7ac('0xa'),'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 556de30..5b766e1 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 _0x9c2c=['request\x20sent','stringify','code','error','message','info','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x714610,_0x2c11b2){var _0x573a69=function(_0x4d5d7a){while(--_0x4d5d7a){_0x714610['push'](_0x714610['shift']());}};_0x573a69(++_0x2c11b2);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9c2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9c2('0x3'));var logger=require(_0xc9c2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9c2('0x5'));var client=jayson['client'][_0xc9c2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x17b5e8,_0x711f3d,_0x18a815){return new BPromise(function(_0x270572,_0xd7fb27){return client[_0xc9c2('0x7')](_0x17b5e8,_0x18a815)[_0xc9c2('0x8')](function(_0x8614c4){logger['info'](_0xc9c2('0x9'),_0x711f3d,'request\x20sent');logger[_0xc9c2('0xa')](_0xc9c2('0xb'),_0x711f3d,_0xc9c2('0xc'),JSON[_0xc9c2('0xd')](_0x8614c4));if(_0x8614c4['error']){if(_0x8614c4['error'][_0xc9c2('0xe')]===0x1f4){logger[_0xc9c2('0xf')]('VoiceContext,\x20%s,\x20%s',_0x711f3d,_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);return _0xd7fb27(_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);}logger[_0xc9c2('0xf')](_0xc9c2('0x9'),_0x711f3d,_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);return _0x270572(_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);}else{logger[_0xc9c2('0x11')](_0xc9c2('0x9'),_0x711f3d,'request\x20sent');_0x270572(_0x8614c4[_0xc9c2('0x12')][_0xc9c2('0x10')]);}})[_0xc9c2('0x13')](function(_0x240099){logger[_0xc9c2('0xf')]('VoiceContext,\x20%s,\x20%s',_0x711f3d,_0x240099);_0xd7fb27(_0x240099);});});} \ No newline at end of file +var _0x57fa=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x291b93,_0x44b715){var _0x4183c8=function(_0x228c59){while(--_0x228c59){_0x291b93['push'](_0x291b93['shift']());}};_0x4183c8(++_0x44b715);}(_0x57fa,0x127));var _0xa57f=function(_0x11b9ae,_0x1a7bb2){_0x11b9ae=_0x11b9ae-0x0;var _0x54ce78=_0x57fa[_0x11b9ae];return _0x54ce78;};'use strict';var _=require(_0xa57f('0x0'));var util=require(_0xa57f('0x1'));var moment=require('moment');var BPromise=require(_0xa57f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa57f('0x3'));var db=require(_0xa57f('0x4'))['db'];var utils=require(_0xa57f('0x5'));var logger=require(_0xa57f('0x6'))(_0xa57f('0x7'));var config=require(_0xa57f('0x8'));var jayson=require(_0xa57f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d84e9,_0x5b7ae5,_0x438665){return new BPromise(function(_0x871646,_0x24d248){return client[_0xa57f('0xa')](_0x3d84e9,_0x438665)[_0xa57f('0xb')](function(_0x575986){logger[_0xa57f('0xc')](_0xa57f('0xd'),_0x5b7ae5,_0xa57f('0xe'));logger[_0xa57f('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5b7ae5,'request\x20sent',JSON[_0xa57f('0x10')](_0x575986));if(_0x575986[_0xa57f('0x11')]){if(_0x575986[_0xa57f('0x11')][_0xa57f('0x12')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b7ae5,_0x575986[_0xa57f('0x11')][_0xa57f('0x13')]);return _0x24d248(_0x575986['error'][_0xa57f('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b7ae5,_0x575986[_0xa57f('0x11')]['message']);return _0x871646(_0x575986[_0xa57f('0x11')]['message']);}else{logger[_0xa57f('0xc')](_0xa57f('0xd'),_0x5b7ae5,_0xa57f('0xe'));_0x871646(_0x575986[_0xa57f('0x14')]['message']);}})['catch'](function(_0x4661ef){logger[_0xa57f('0x11')](_0xa57f('0xd'),_0x5b7ae5,_0x4661ef);_0x24d248(_0x4661ef);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 0ccd059..1263bc4 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 _0x7157=['Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x6fbc80,_0x355ace){var _0x57c2ff=function(_0x2f7b5c){while(--_0x2f7b5c){_0x6fbc80['push'](_0x6fbc80['shift']());}};_0x57c2ff(++_0x355ace);}(_0x7157,0x13e));var _0x7715=function(_0x57421a,_0x50a89c){_0x57421a=_0x57421a-0x0;var _0x2b7c33=_0x7157[_0x57421a];return _0x2b7c33;};'use strict';var multer=require(_0x7715('0x0'));var util=require('util');var path=require(_0x7715('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7715('0x2')]();var fs_extra=require(_0x7715('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7715('0x4'));var config=require('../../config/environment');var controller=require(_0x7715('0x5'));router['get']('/',auth[_0x7715('0x6')](),controller[_0x7715('0x7')]);router[_0x7715('0x8')](_0x7715('0x9'),auth[_0x7715('0x6')](),controller[_0x7715('0xa')]);router['get'](_0x7715('0xb'),auth['isAuthenticated'](),controller[_0x7715('0xc')]);router[_0x7715('0xd')]('/',auth[_0x7715('0x6')](),controller[_0x7715('0xe')]);router[_0x7715('0xf')](_0x7715('0xb'),auth[_0x7715('0x6')](),controller[_0x7715('0x10')]);router[_0x7715('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7715('0x12')]);module[_0x7715('0x13')]=router; \ No newline at end of file +var _0x82ba=['../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x18e860,_0x4e7cf2){var _0x50e46e=function(_0x271cfc){while(--_0x271cfc){_0x18e860['push'](_0x18e860['shift']());}};_0x50e46e(++_0x4e7cf2);}(_0x82ba,0x1d9));var _0xa82b=function(_0x314109,_0x40b281){_0x314109=_0x314109-0x0;var _0xa233fd=_0x82ba[_0x314109];return _0xa233fd;};'use strict';var multer=require(_0xa82b('0x0'));var util=require('util');var path=require(_0xa82b('0x1'));var timeout=require(_0xa82b('0x2'));var express=require(_0xa82b('0x3'));var router=express[_0xa82b('0x4')]();var fs_extra=require(_0xa82b('0x5'));var auth=require(_0xa82b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa82b('0x7'));var controller=require(_0xa82b('0x8'));router[_0xa82b('0x9')]('/',auth[_0xa82b('0xa')](),controller['index']);router['get'](_0xa82b('0xb'),auth[_0xa82b('0xa')](),controller['describe']);router[_0xa82b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa82b('0xc')]('/',auth[_0xa82b('0xa')](),controller[_0xa82b('0xd')]);router[_0xa82b('0xe')]('/:id',auth[_0xa82b('0xa')](),controller[_0xa82b('0xf')]);router[_0xa82b('0x10')](_0xa82b('0x11'),auth[_0xa82b('0xa')](),controller[_0xa82b('0x12')]);module[_0xa82b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 322dbf1..263a0db 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 _0x4b84=['INTEGER','STRING','DATE','called,connect,complete','sequelize','exports'];(function(_0x5d13a7,_0x30d73c){var _0x440c24=function(_0x1e48d3){while(--_0x1e48d3){_0x5d13a7['push'](_0x5d13a7['shift']());}};_0x440c24(++_0x30d73c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0x4b84[_0x1c0f41];return _0x369a9f;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x44b8('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinename':{'type':Sequelize[_0x44b8('0x3')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x44b8('0x3')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x44b8('0x3')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x44b8('0x3')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x44b8('0x3')]},'destcalleridname':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x44b8('0x3')]},'destaccountcode':{'type':Sequelize[_0x44b8('0x3')]},'destcontext':{'type':Sequelize[_0x44b8('0x3')]},'destexten':{'type':Sequelize[_0x44b8('0x3')]},'destpriority':{'type':Sequelize[_0x44b8('0x2')]},'destuniqueid':{'type':Sequelize[_0x44b8('0x3')]},'destlinkedid':{'type':Sequelize[_0x44b8('0x3')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x44b8('0x3')]},'starttime':{'type':Sequelize[_0x44b8('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x44b8('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x44b8('0x5')},'routeId':{'type':Sequelize[_0x44b8('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x44b8('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x15c4ac,_0x338f49){var _0x5696aa=function(_0x576fa3){while(--_0x576fa3){_0x15c4ac['push'](_0x15c4ac['shift']());}};_0x5696aa(++_0x338f49);}(_0xb821,0xa7));var _0x1b82=function(_0x292318,_0x5d535f){_0x292318=_0x292318-0x0;var _0x238ae6=_0xb821[_0x292318];return _0x238ae6;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index fcb92cf..ef70f9b 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 _0xdf8a=['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','set','Content-Range','apply','update','destroy','then','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x5838c5,_0x4f205d){var _0x51a071=function(_0x2fc0c3){while(--_0x2fc0c3){_0x5838c5['push'](_0x5838c5['shift']());}};_0x51a071(++_0x4f205d);}(_0xdf8a,0xcb));var _0xadf8=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0xdf8a[_0x54f7c0];return _0x245d03;};'use strict';var emlformat=require(_0xadf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadf8('0x1'));var jsonpatch=require(_0xadf8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xadf8('0x3'));var Mustache=require(_0xadf8('0x4'));var util=require(_0xadf8('0x5'));var path=require(_0xadf8('0x6'));var sox=require(_0xadf8('0x7'));var csv=require('to-csv');var ejs=require(_0xadf8('0x8'));var fs=require('fs');var fs_extra=require(_0xadf8('0x9'));var _=require(_0xadf8('0xa'));var squel=require(_0xadf8('0xb'));var crypto=require(_0xadf8('0xc'));var jsforce=require(_0xadf8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xadf8('0xe'));var querystring=require(_0xadf8('0xf'));var Papa=require('papaparse');var Redis=require(_0xadf8('0x10'));var authService=require(_0xadf8('0x11'));var qs=require(_0xadf8('0x12'));var as=require(_0xadf8('0x13'));var hardwareService=require(_0xadf8('0x14'));var logger=require('../../config/logger')(_0xadf8('0x15'));var utils=require(_0xadf8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xadf8('0x17'))['db'];function respondWithStatusCode(_0xd964e1,_0x4f3683){_0x4f3683=_0x4f3683||0xcc;return function(_0x43bb4c){if(_0x43bb4c){return _0xd964e1[_0xadf8('0x18')](_0x4f3683);}return _0xd964e1[_0xadf8('0x19')](_0x4f3683)[_0xadf8('0x1a')]();};}function respondWithResult(_0x44e1de,_0x40fca6){_0x40fca6=_0x40fca6||0xc8;return function(_0x24ae25){if(_0x24ae25){return _0x44e1de['status'](_0x40fca6)[_0xadf8('0x1b')](_0x24ae25);}};}function respondWithFilteredResult(_0x40fdc9,_0x28c312){return function(_0x155e7b){if(_0x155e7b){var _0x2b89ac=typeof _0x28c312[_0xadf8('0x1c')]==='undefined'&&typeof _0x28c312['limit']===_0xadf8('0x1d');var _0x363d38=_0x155e7b[_0xadf8('0x1e')];var _0x5b3979=_0x2b89ac?0x0:_0x28c312[_0xadf8('0x1c')];var _0x3d05c8=_0x2b89ac?_0x155e7b[_0xadf8('0x1e')]:_0x28c312[_0xadf8('0x1c')]+_0x28c312[_0xadf8('0x1f')];var _0x4c17d1;if(_0x3d05c8>=_0x363d38){_0x3d05c8=_0x363d38;_0x4c17d1=0xc8;}else{_0x4c17d1=0xce;}_0x40fdc9['status'](_0x4c17d1);return _0x40fdc9[_0xadf8('0x20')](_0xadf8('0x21'),_0x5b3979+'-'+_0x3d05c8+'/'+_0x363d38)[_0xadf8('0x1b')](_0x155e7b);}return null;};}function patchUpdates(_0x1a28c4){return function(_0x138323){try{jsonpatch[_0xadf8('0x22')](_0x138323,_0x1a28c4,!![]);}catch(_0x51ae2e){return BPromise['reject'](_0x51ae2e);}return _0x138323['save']();};}function saveUpdates(_0x312a0f,_0x8290b9){return function(_0x4dc4c4){if(_0x4dc4c4){return _0x4dc4c4[_0xadf8('0x23')](_0x312a0f)['then'](function(_0x160e72){return _0x160e72;});}return null;};}function removeEntity(_0x4dc874,_0x59fe69){return function(_0x1aee71){if(_0x1aee71){return _0x1aee71[_0xadf8('0x24')]()[_0xadf8('0x25')](function(){_0x4dc874[_0xadf8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25debb,_0xc6cdfc){return function(_0x35e855){if(!_0x35e855){_0x25debb[_0xadf8('0x18')](0x194);}return _0x35e855;};}function handleError(_0x264802,_0x4d0f4c){_0x4d0f4c=_0x4d0f4c||0x1f4;return function(_0xb17400){logger['error'](_0xb17400['stack']);if(_0xb17400[_0xadf8('0x26')]){delete _0xb17400[_0xadf8('0x26')];}_0x264802[_0xadf8('0x19')](_0x4d0f4c)[_0xadf8('0x27')](_0xb17400);};}exports['index']=function(_0x571df9,_0x2c1715){var _0xfb244b={},_0x435b05={},_0x2ed6cd={'count':0x0,'rows':[]};var _0x2ca3d7=_[_0xadf8('0x28')](db[_0xadf8('0x29')][_0xadf8('0x2a')],function(_0x46f088){return{'name':_0x46f088[_0xadf8('0x2b')],'type':_0x46f088[_0xadf8('0x2c')][_0xadf8('0x2d')]};});_0x435b05[_0xadf8('0x2e')]=_[_0xadf8('0x28')](_0x2ca3d7,_0xadf8('0x26'));_0x435b05[_0xadf8('0x2f')]=_[_0xadf8('0x30')](_0x571df9[_0xadf8('0x2f')]);_0x435b05[_0xadf8('0x31')]=_[_0xadf8('0x32')](_0x435b05[_0xadf8('0x2e')],_0x435b05['query']);_0xfb244b[_0xadf8('0x33')]=_['intersection'](_0x435b05['model'],qs[_0xadf8('0x34')](_0x571df9[_0xadf8('0x2f')][_0xadf8('0x34')]));_0xfb244b[_0xadf8('0x33')]=_0xfb244b['attributes'][_0xadf8('0x35')]?_0xfb244b['attributes']:_0x435b05[_0xadf8('0x2e')];if(!_0x571df9['query'][_0xadf8('0x36')]('nolimit')){_0xfb244b['limit']=qs['limit'](_0x571df9[_0xadf8('0x2f')][_0xadf8('0x1f')]);_0xfb244b[_0xadf8('0x1c')]=qs['offset'](_0x571df9['query'][_0xadf8('0x1c')]);}_0xfb244b[_0xadf8('0x37')]=qs[_0xadf8('0x38')](_0x571df9[_0xadf8('0x2f')][_0xadf8('0x38')]);_0xfb244b[_0xadf8('0x39')]=qs[_0xadf8('0x31')](_[_0xadf8('0x3a')](_0x571df9[_0xadf8('0x2f')],_0x435b05[_0xadf8('0x31')]),_0x2ca3d7);if(_0x571df9[_0xadf8('0x2f')]['filter']){_0xfb244b['where']=_[_0xadf8('0x3b')](_0xfb244b[_0xadf8('0x39')],{'$or':_[_0xadf8('0x28')](_0x2ca3d7,function(_0x33aa9e){if(_0x33aa9e[_0xadf8('0x2c')]!==_0xadf8('0x3c')){var _0x81f8e1={};_0x81f8e1[_0x33aa9e[_0xadf8('0x26')]]={'$like':'%'+_0x571df9[_0xadf8('0x2f')][_0xadf8('0x3d')]+'%'};return _0x81f8e1;}})});}_0xfb244b=_[_0xadf8('0x3b')]({},_0xfb244b,_0x571df9[_0xadf8('0x3e')]);var _0x5b1520={'where':_0xfb244b['where']};return db['VoiceDialReport'][_0xadf8('0x1e')](_0x5b1520)[_0xadf8('0x25')](function(_0x463801){_0x2ed6cd[_0xadf8('0x1e')]=_0x463801;if(_0x571df9['query'][_0xadf8('0x3f')]){_0xfb244b[_0xadf8('0x40')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xadf8('0x41')](_0xfb244b);})['then'](function(_0xb2a66a){_0x2ed6cd['rows']=_0xb2a66a;return _0x2ed6cd;})[_0xadf8('0x25')](respondWithFilteredResult(_0x2c1715,_0xfb244b))[_0xadf8('0x42')](handleError(_0x2c1715,null));};exports[_0xadf8('0x43')]=function(_0x43e743,_0x1f6150){var _0x2eac4e={'raw':!![],'where':{'id':_0x43e743[_0xadf8('0x44')]['id']}},_0x157665={};_0x157665[_0xadf8('0x2e')]=_[_0xadf8('0x30')](db['VoiceDialReport'][_0xadf8('0x2a')]);_0x157665[_0xadf8('0x2f')]=_[_0xadf8('0x30')](_0x43e743[_0xadf8('0x2f')]);_0x157665[_0xadf8('0x31')]=_[_0xadf8('0x32')](_0x157665[_0xadf8('0x2e')],_0x157665[_0xadf8('0x2f')]);_0x2eac4e[_0xadf8('0x33')]=_[_0xadf8('0x32')](_0x157665[_0xadf8('0x2e')],qs[_0xadf8('0x34')](_0x43e743[_0xadf8('0x2f')][_0xadf8('0x34')]));_0x2eac4e[_0xadf8('0x33')]=_0x2eac4e[_0xadf8('0x33')][_0xadf8('0x35')]?_0x2eac4e[_0xadf8('0x33')]:_0x157665[_0xadf8('0x2e')];if(_0x43e743[_0xadf8('0x2f')][_0xadf8('0x3f')]){_0x2eac4e[_0xadf8('0x40')]=[{'all':!![]}];}_0x2eac4e=_[_0xadf8('0x3b')]({},_0x2eac4e,_0x43e743[_0xadf8('0x3e')]);return db[_0xadf8('0x29')][_0xadf8('0x45')](_0x2eac4e)[_0xadf8('0x25')](handleEntityNotFound(_0x1f6150,null))['then'](respondWithResult(_0x1f6150,null))[_0xadf8('0x42')](handleError(_0x1f6150,null));};exports[_0xadf8('0x46')]=function(_0x9eb350,_0x11e2e9){return db[_0xadf8('0x29')][_0xadf8('0x46')](_0x9eb350[_0xadf8('0x47')],{})[_0xadf8('0x25')](respondWithResult(_0x11e2e9,0xc9))[_0xadf8('0x42')](handleError(_0x11e2e9,null));};exports[_0xadf8('0x23')]=function(_0x28b112,_0x2e3458){if(_0x28b112[_0xadf8('0x47')]['id']){delete _0x28b112['body']['id'];}return db[_0xadf8('0x29')][_0xadf8('0x45')]({'where':{'id':_0x28b112[_0xadf8('0x44')]['id']}})[_0xadf8('0x25')](handleEntityNotFound(_0x2e3458,null))[_0xadf8('0x25')](saveUpdates(_0x28b112[_0xadf8('0x47')],null))[_0xadf8('0x25')](respondWithResult(_0x2e3458,null))[_0xadf8('0x42')](handleError(_0x2e3458,null));};exports['destroy']=function(_0x126cc2,_0x3851dd){return db[_0xadf8('0x29')][_0xadf8('0x45')]({'where':{'id':_0x126cc2[_0xadf8('0x44')]['id']}})[_0xadf8('0x25')](handleEntityNotFound(_0x3851dd,null))[_0xadf8('0x25')](removeEntity(_0x3851dd,null))[_0xadf8('0x42')](handleError(_0x3851dd,null));};exports['describe']=function(_0x7cacb2,_0x2046b4){return db[_0xadf8('0x29')][_0xadf8('0x48')]()[_0xadf8('0x25')](respondWithResult(_0x2046b4,null))['catch'](handleError(_0x2046b4,null));}; \ No newline at end of file +var _0x40ae=['reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceDialReport','includeAll','include','findAll','catch','show','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply'];(function(_0x5a15a5,_0x1de601){var _0x58f5dd=function(_0x300967){while(--_0x300967){_0x5a15a5['push'](_0x5a15a5['shift']());}};_0x58f5dd(++_0x1de601);}(_0x40ae,0xca));var _0xe40a=function(_0x2229fb,_0x45e3c0){_0x2229fb=_0x2229fb-0x0;var _0x12ed5a=_0x40ae[_0x2229fb];return _0x12ed5a;};'use strict';var emlformat=require(_0xe40a('0x0'));var rimraf=require(_0xe40a('0x1'));var zipdir=require(_0xe40a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe40a('0x3'));var moment=require(_0xe40a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe40a('0x5'));var util=require('util');var path=require(_0xe40a('0x6'));var sox=require('sox');var csv=require(_0xe40a('0x7'));var ejs=require(_0xe40a('0x8'));var fs=require('fs');var fs_extra=require(_0xe40a('0x9'));var _=require(_0xe40a('0xa'));var squel=require(_0xe40a('0xb'));var crypto=require('crypto');var jsforce=require(_0xe40a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe40a('0x7'));var querystring=require(_0xe40a('0xd'));var Papa=require(_0xe40a('0xe'));var Redis=require(_0xe40a('0xf'));var authService=require(_0xe40a('0x10'));var qs=require(_0xe40a('0x11'));var as=require(_0xe40a('0x12'));var hardwareService=require(_0xe40a('0x13'));var logger=require(_0xe40a('0x14'))(_0xe40a('0x15'));var utils=require(_0xe40a('0x16'));var config=require(_0xe40a('0x17'));var licenseUtil=require(_0xe40a('0x18'));var db=require(_0xe40a('0x19'))['db'];function respondWithStatusCode(_0x3f4282,_0x2b0bb1){_0x2b0bb1=_0x2b0bb1||0xcc;return function(_0x51c98f){if(_0x51c98f){return _0x3f4282[_0xe40a('0x1a')](_0x2b0bb1);}return _0x3f4282[_0xe40a('0x1b')](_0x2b0bb1)['end']();};}function respondWithResult(_0xca875d,_0x293d36){_0x293d36=_0x293d36||0xc8;return function(_0x5628cf){if(_0x5628cf){return _0xca875d[_0xe40a('0x1b')](_0x293d36)[_0xe40a('0x1c')](_0x5628cf);}};}function respondWithFilteredResult(_0x257d80,_0x2c8e8c){return function(_0x1ea9fa){if(_0x1ea9fa){var _0x5da4dc=typeof _0x2c8e8c['offset']==='undefined'&&typeof _0x2c8e8c[_0xe40a('0x1d')]===_0xe40a('0x1e');var _0x33b112=_0x1ea9fa[_0xe40a('0x1f')];var _0x3c6f09=_0x5da4dc?0x0:_0x2c8e8c[_0xe40a('0x20')];var _0x15c6f7=_0x5da4dc?_0x1ea9fa[_0xe40a('0x1f')]:_0x2c8e8c[_0xe40a('0x20')]+_0x2c8e8c[_0xe40a('0x1d')];var _0x3a5999;if(_0x15c6f7>=_0x33b112){_0x15c6f7=_0x33b112;_0x3a5999=0xc8;}else{_0x3a5999=0xce;}_0x257d80['status'](_0x3a5999);return _0x257d80['set'](_0xe40a('0x21'),_0x3c6f09+'-'+_0x15c6f7+'/'+_0x33b112)['json'](_0x1ea9fa);}return null;};}function patchUpdates(_0x473237){return function(_0x43c7f0){try{jsonpatch[_0xe40a('0x22')](_0x43c7f0,_0x473237,!![]);}catch(_0x4a0e91){return BPromise[_0xe40a('0x23')](_0x4a0e91);}return _0x43c7f0[_0xe40a('0x24')]();};}function saveUpdates(_0x461f93,_0xc94148){return function(_0x42c2b3){if(_0x42c2b3){return _0x42c2b3[_0xe40a('0x25')](_0x461f93)[_0xe40a('0x26')](function(_0x32efa2){return _0x32efa2;});}return null;};}function removeEntity(_0xbadafa,_0x39e880){return function(_0x22b960){if(_0x22b960){return _0x22b960[_0xe40a('0x27')]()[_0xe40a('0x26')](function(){_0xbadafa[_0xe40a('0x1b')](0xcc)[_0xe40a('0x28')]();});}};}function handleEntityNotFound(_0x5eb3db,_0x4b0eae){return function(_0x25ac2c){if(!_0x25ac2c){_0x5eb3db['sendStatus'](0x194);}return _0x25ac2c;};}function handleError(_0x2eedc1,_0x22d167){_0x22d167=_0x22d167||0x1f4;return function(_0x1c2dbc){logger[_0xe40a('0x29')](_0x1c2dbc[_0xe40a('0x2a')]);if(_0x1c2dbc[_0xe40a('0x2b')]){delete _0x1c2dbc['name'];}_0x2eedc1['status'](_0x22d167)[_0xe40a('0x2c')](_0x1c2dbc);};}exports[_0xe40a('0x2d')]=function(_0xf1d5b7,_0x2e8f2b){var _0xfb67b7={},_0xa13a16={},_0x3c3c30={'count':0x0,'rows':[]};var _0x1051e2=_[_0xe40a('0x2e')](db['VoiceDialReport'][_0xe40a('0x2f')],function(_0x5ca2e4){return{'name':_0x5ca2e4[_0xe40a('0x30')],'type':_0x5ca2e4[_0xe40a('0x31')][_0xe40a('0x32')]};});_0xa13a16[_0xe40a('0x33')]=_[_0xe40a('0x2e')](_0x1051e2,_0xe40a('0x2b'));_0xa13a16[_0xe40a('0x34')]=_[_0xe40a('0x35')](_0xf1d5b7[_0xe40a('0x34')]);_0xa13a16[_0xe40a('0x36')]=_['intersection'](_0xa13a16[_0xe40a('0x33')],_0xa13a16[_0xe40a('0x34')]);_0xfb67b7[_0xe40a('0x37')]=_[_0xe40a('0x38')](_0xa13a16[_0xe40a('0x33')],qs[_0xe40a('0x39')](_0xf1d5b7['query']['fields']));_0xfb67b7[_0xe40a('0x37')]=_0xfb67b7['attributes']['length']?_0xfb67b7[_0xe40a('0x37')]:_0xa13a16[_0xe40a('0x33')];if(!_0xf1d5b7[_0xe40a('0x34')]['hasOwnProperty'](_0xe40a('0x3a'))){_0xfb67b7['limit']=qs[_0xe40a('0x1d')](_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x1d')]);_0xfb67b7[_0xe40a('0x20')]=qs['offset'](_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x20')]);}_0xfb67b7[_0xe40a('0x3b')]=qs[_0xe40a('0x3c')](_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x3c')]);_0xfb67b7[_0xe40a('0x3d')]=qs[_0xe40a('0x36')](_[_0xe40a('0x3e')](_0xf1d5b7[_0xe40a('0x34')],_0xa13a16[_0xe40a('0x36')]),_0x1051e2);if(_0xf1d5b7[_0xe40a('0x34')]['filter']){_0xfb67b7['where']=_[_0xe40a('0x3f')](_0xfb67b7[_0xe40a('0x3d')],{'$or':_[_0xe40a('0x2e')](_0x1051e2,function(_0x47ce9a){if(_0x47ce9a[_0xe40a('0x31')]!==_0xe40a('0x40')){var _0x2cfebc={};_0x2cfebc[_0x47ce9a[_0xe40a('0x2b')]]={'$like':'%'+_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x41')]+'%'};return _0x2cfebc;}})});}_0xfb67b7=_['merge']({},_0xfb67b7,_0xf1d5b7[_0xe40a('0x42')]);var _0x22e548={'where':_0xfb67b7[_0xe40a('0x3d')]};return db[_0xe40a('0x43')]['count'](_0x22e548)[_0xe40a('0x26')](function(_0x13d022){_0x3c3c30[_0xe40a('0x1f')]=_0x13d022;if(_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x44')]){_0xfb67b7[_0xe40a('0x45')]=[{'all':!![]}];}return db[_0xe40a('0x43')][_0xe40a('0x46')](_0xfb67b7);})['then'](function(_0x531576){_0x3c3c30['rows']=_0x531576;return _0x3c3c30;})[_0xe40a('0x26')](respondWithFilteredResult(_0x2e8f2b,_0xfb67b7))[_0xe40a('0x47')](handleError(_0x2e8f2b,null));};exports[_0xe40a('0x48')]=function(_0x2cf292,_0x299f83){var _0x251dc8={'raw':!![],'where':{'id':_0x2cf292[_0xe40a('0x49')]['id']}},_0x3ba062={};_0x3ba062[_0xe40a('0x33')]=_[_0xe40a('0x35')](db['VoiceDialReport'][_0xe40a('0x2f')]);_0x3ba062[_0xe40a('0x34')]=_[_0xe40a('0x35')](_0x2cf292['query']);_0x3ba062['filters']=_['intersection'](_0x3ba062[_0xe40a('0x33')],_0x3ba062['query']);_0x251dc8[_0xe40a('0x37')]=_['intersection'](_0x3ba062[_0xe40a('0x33')],qs[_0xe40a('0x39')](_0x2cf292[_0xe40a('0x34')][_0xe40a('0x39')]));_0x251dc8[_0xe40a('0x37')]=_0x251dc8[_0xe40a('0x37')][_0xe40a('0x4a')]?_0x251dc8['attributes']:_0x3ba062[_0xe40a('0x33')];if(_0x2cf292[_0xe40a('0x34')]['includeAll']){_0x251dc8[_0xe40a('0x45')]=[{'all':!![]}];}_0x251dc8=_[_0xe40a('0x3f')]({},_0x251dc8,_0x2cf292[_0xe40a('0x42')]);return db[_0xe40a('0x43')]['find'](_0x251dc8)[_0xe40a('0x26')](handleEntityNotFound(_0x299f83,null))[_0xe40a('0x26')](respondWithResult(_0x299f83,null))[_0xe40a('0x47')](handleError(_0x299f83,null));};exports['create']=function(_0x42483a,_0xeeddb7){return db['VoiceDialReport'][_0xe40a('0x4b')](_0x42483a[_0xe40a('0x4c')],{})[_0xe40a('0x26')](respondWithResult(_0xeeddb7,0xc9))[_0xe40a('0x47')](handleError(_0xeeddb7,null));};exports[_0xe40a('0x25')]=function(_0x55d82e,_0x4c355b){if(_0x55d82e[_0xe40a('0x4c')]['id']){delete _0x55d82e[_0xe40a('0x4c')]['id'];}return db[_0xe40a('0x43')][_0xe40a('0x4d')]({'where':{'id':_0x55d82e[_0xe40a('0x49')]['id']}})[_0xe40a('0x26')](handleEntityNotFound(_0x4c355b,null))[_0xe40a('0x26')](saveUpdates(_0x55d82e[_0xe40a('0x4c')],null))[_0xe40a('0x26')](respondWithResult(_0x4c355b,null))['catch'](handleError(_0x4c355b,null));};exports[_0xe40a('0x27')]=function(_0x5a7d2a,_0xed02a7){return db[_0xe40a('0x43')]['find']({'where':{'id':_0x5a7d2a['params']['id']}})[_0xe40a('0x26')](handleEntityNotFound(_0xed02a7,null))[_0xe40a('0x26')](removeEntity(_0xed02a7,null))[_0xe40a('0x47')](handleError(_0xed02a7,null));};exports[_0xe40a('0x4e')]=function(_0x22be32,_0x49366e){return db['VoiceDialReport'][_0xe40a('0x4e')]()[_0xe40a('0x26')](respondWithResult(_0x49366e,null))['catch'](handleError(_0x49366e,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index fe3fa9e..8315296 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 _0x6c19=['request-promise','path','rimraf','../../config/environment','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ba66b,_0x4b6c1e){var _0xa07e97=function(_0x27f11d){while(--_0x27f11d){_0x1ba66b['push'](_0x1ba66b['shift']());}};_0xa07e97(++_0x4b6c1e);}(_0x6c19,0x12e));var _0x96c1=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0x6c19[_0x173f10];return _0x53142d;};'use strict';var _=require(_0x96c1('0x0'));var util=require(_0x96c1('0x1'));var logger=require(_0x96c1('0x2'))(_0x96c1('0x3'));var moment=require(_0x96c1('0x4'));var BPromise=require(_0x96c1('0x5'));var rp=require(_0x96c1('0x6'));var fs=require('fs');var path=require(_0x96c1('0x7'));var rimraf=require(_0x96c1('0x8'));var config=require(_0x96c1('0x9'));var attributes=require('./voiceDialReport.attributes');module[_0x96c1('0xa')]=function(_0x489c8b,_0x3e7b35){return _0x489c8b['define'](_0x96c1('0xb'),attributes,{'tableName':_0x96c1('0xc'),'paranoid':![],'indexes':[{'fields':[_0x96c1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe421=['uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','VoiceDialReport','report_dial'];(function(_0x55c10e,_0x31af91){var _0x598bcc=function(_0xe48bdf){while(--_0xe48bdf){_0x55c10e['push'](_0x55c10e['shift']());}};_0x598bcc(++_0x31af91);}(_0xe421,0x18d));var _0x1e42=function(_0x35c70b,_0x3c80c7){_0x35c70b=_0x35c70b-0x0;var _0x17fa17=_0xe421[_0x35c70b];return _0x17fa17;};'use strict';var _=require(_0x1e42('0x0'));var util=require(_0x1e42('0x1'));var logger=require(_0x1e42('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1e42('0x3'));var rp=require(_0x1e42('0x4'));var fs=require('fs');var path=require(_0x1e42('0x5'));var rimraf=require('rimraf');var config=require(_0x1e42('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x1e42('0x7')]=function(_0x48f82f,_0x3788d8){return _0x48f82f['define'](_0x1e42('0x8'),attributes,{'tableName':_0x1e42('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1e42('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 7691d24..fd0a0fd 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 _0x1851=['options','raw','info','debug','UpdateVoiceDialReport','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body'];(function(_0x26ad41,_0x49a4f1){var _0x297109=function(_0x1b8077){while(--_0x1b8077){_0x26ad41['push'](_0x26ad41['shift']());}};_0x297109(++_0x49a4f1);}(_0x1851,0x19a));var _0x1185=function(_0x5cfed5,_0x3b2c7f){_0x5cfed5=_0x5cfed5-0x0;var _0x282a3a=_0x1851[_0x5cfed5];return _0x282a3a;};'use strict';var _=require(_0x1185('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1185('0x1'));var rs=require(_0x1185('0x2'));var fs=require('fs');var Redis=require(_0x1185('0x3'));var db=require(_0x1185('0x4'))['db'];var utils=require(_0x1185('0x5'));var logger=require('../../config/logger')(_0x1185('0x6'));var config=require(_0x1185('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1185('0x8')][_0x1185('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x335f3f,_0x3847b5,_0x358164){return new BPromise(function(_0x5da79a,_0x452917){return client[_0x1185('0xa')](_0x335f3f,_0x358164)[_0x1185('0xb')](function(_0x4b83c8){logger['info'](_0x1185('0xc'),_0x3847b5,_0x1185('0xd'));logger['debug'](_0x1185('0xe'),_0x3847b5,_0x1185('0xd'),JSON[_0x1185('0xf')](_0x4b83c8));if(_0x4b83c8[_0x1185('0x10')]){if(_0x4b83c8[_0x1185('0x10')]['code']===0x1f4){logger[_0x1185('0x10')](_0x1185('0xc'),_0x3847b5,_0x4b83c8[_0x1185('0x10')]['message']);return _0x452917(_0x4b83c8[_0x1185('0x10')][_0x1185('0x11')]);}logger[_0x1185('0x10')](_0x1185('0xc'),_0x3847b5,_0x4b83c8[_0x1185('0x10')][_0x1185('0x11')]);return _0x5da79a(_0x4b83c8['error'][_0x1185('0x11')]);}else{logger['info'](_0x1185('0xc'),_0x3847b5,'request\x20sent');_0x5da79a(_0x4b83c8[_0x1185('0x12')][_0x1185('0x11')]);}})[_0x1185('0x13')](function(_0x93a53f){logger[_0x1185('0x10')](_0x1185('0xc'),_0x3847b5,_0x93a53f);_0x452917(_0x93a53f);});});}exports[_0x1185('0x14')]=function(_0x13453d){var _0x5966ef=this;return new Promise(function(_0x6b43f0,_0x4b714f){return db[_0x1185('0x15')][_0x1185('0x16')](_0x13453d[_0x1185('0x17')],{'raw':_0x13453d[_0x1185('0x18')]?_0x13453d[_0x1185('0x18')][_0x1185('0x19')]===undefined?!![]:![]:!![]})[_0x1185('0xb')](function(_0x193193){logger[_0x1185('0x1a')](_0x1185('0x14'),_0x13453d);logger[_0x1185('0x1b')](_0x1185('0x14'),_0x13453d,JSON[_0x1185('0xf')](_0x193193));_0x6b43f0(_0x193193);})[_0x1185('0x13')](function(_0x58454e){logger[_0x1185('0x10')](_0x1185('0x14'),_0x58454e[_0x1185('0x11')],_0x13453d);_0x4b714f(_0x5966ef['error'](0x1f4,_0x58454e[_0x1185('0x11')]));});});};exports[_0x1185('0x1c')]=function(_0xce6b6c){var _0x525955=this;return new Promise(function(_0x38ef34,_0x36bbf7){return db[_0x1185('0x15')]['update'](_0xce6b6c['body'],{'raw':_0xce6b6c[_0x1185('0x18')]?_0xce6b6c['options'][_0x1185('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xce6b6c[_0x1185('0x18')]?_0xce6b6c[_0x1185('0x18')]['where']||null:null,'attributes':_0xce6b6c[_0x1185('0x18')]?_0xce6b6c[_0x1185('0x18')][_0x1185('0x1d')]||null:null,'limit':_0xce6b6c[_0x1185('0x18')]?_0xce6b6c[_0x1185('0x18')][_0x1185('0x1e')]||null:null})['then'](function(_0x29fce7){logger[_0x1185('0x1a')](_0x1185('0x1c'),_0xce6b6c);logger[_0x1185('0x1b')](_0x1185('0x1c'),_0xce6b6c,JSON['stringify'](_0x29fce7));_0x38ef34(_0x29fce7);})['catch'](function(_0xd1628c){logger[_0x1185('0x10')](_0x1185('0x1c'),_0xd1628c[_0x1185('0x11')],_0xce6b6c);_0x36bbf7(_0x525955['error'](0x1f4,_0xd1628c['message']));});});}; \ No newline at end of file +var _0xe937=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','stringify','error','code','message','info','VoiceDialReport,\x20%s,\x20%s','result','CreateVoiceDialReport','create','options','UpdateVoiceDialReport','VoiceDialReport','update','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x21e3d5,_0x443510){var _0x37fff5=function(_0x177dbc){while(--_0x177dbc){_0x21e3d5['push'](_0x21e3d5['shift']());}};_0x37fff5(++_0x443510);}(_0xe937,0xbf));var _0x7e93=function(_0x2ceafe,_0x4914a1){_0x2ceafe=_0x2ceafe-0x0;var _0x271c8e=_0xe937[_0x2ceafe];return _0x271c8e;};'use strict';var _=require(_0x7e93('0x0'));var util=require(_0x7e93('0x1'));var moment=require(_0x7e93('0x2'));var BPromise=require(_0x7e93('0x3'));var rs=require(_0x7e93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e93('0x5'))['db'];var utils=require(_0x7e93('0x6'));var logger=require(_0x7e93('0x7'))(_0x7e93('0x8'));var config=require(_0x7e93('0x9'));var jayson=require(_0x7e93('0xa'));var client=jayson['client'][_0x7e93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ecee6,_0x3cc94d,_0x1ff3e9){return new BPromise(function(_0x10ac69,_0x5645c0){return client['request'](_0x4ecee6,_0x1ff3e9)[_0x7e93('0xc')](function(_0x4f6af5){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3cc94d,_0x7e93('0xd'));logger[_0x7e93('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3cc94d,_0x7e93('0xd'),JSON[_0x7e93('0xf')](_0x4f6af5));if(_0x4f6af5[_0x7e93('0x10')]){if(_0x4f6af5[_0x7e93('0x10')][_0x7e93('0x11')]===0x1f4){logger[_0x7e93('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3cc94d,_0x4f6af5['error']['message']);return _0x5645c0(_0x4f6af5['error']['message']);}logger[_0x7e93('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3cc94d,_0x4f6af5['error'][_0x7e93('0x12')]);return _0x10ac69(_0x4f6af5[_0x7e93('0x10')][_0x7e93('0x12')]);}else{logger[_0x7e93('0x13')](_0x7e93('0x14'),_0x3cc94d,_0x7e93('0xd'));_0x10ac69(_0x4f6af5[_0x7e93('0x15')][_0x7e93('0x12')]);}})['catch'](function(_0x2f8394){logger[_0x7e93('0x10')](_0x7e93('0x14'),_0x3cc94d,_0x2f8394);_0x5645c0(_0x2f8394);});});}exports[_0x7e93('0x16')]=function(_0x421536){var _0x380c85=this;return new Promise(function(_0x113ea0,_0x54085b){return db['VoiceDialReport'][_0x7e93('0x17')](_0x421536['body'],{'raw':_0x421536[_0x7e93('0x18')]?_0x421536['options']['raw']===undefined?!![]:![]:!![]})[_0x7e93('0xc')](function(_0x5216b0){logger[_0x7e93('0x13')]('CreateVoiceDialReport',_0x421536);logger[_0x7e93('0xe')](_0x7e93('0x16'),_0x421536,JSON[_0x7e93('0xf')](_0x5216b0));_0x113ea0(_0x5216b0);})['catch'](function(_0x45ba1f){logger[_0x7e93('0x10')]('CreateVoiceDialReport',_0x45ba1f[_0x7e93('0x12')],_0x421536);_0x54085b(_0x380c85[_0x7e93('0x10')](0x1f4,_0x45ba1f[_0x7e93('0x12')]));});});};exports[_0x7e93('0x19')]=function(_0x5d434b){var _0x1ba465=this;return new Promise(function(_0x5e6f2f,_0x36cadb){return db[_0x7e93('0x1a')][_0x7e93('0x1b')](_0x5d434b['body'],{'raw':_0x5d434b[_0x7e93('0x18')]?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d434b[_0x7e93('0x18')]?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1d')]||null:null,'attributes':_0x5d434b['options']?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1e')]||null:null,'limit':_0x5d434b[_0x7e93('0x18')]?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1f')]||null:null})['then'](function(_0x206700){logger[_0x7e93('0x13')]('UpdateVoiceDialReport',_0x5d434b);logger['debug']('UpdateVoiceDialReport',_0x5d434b,JSON[_0x7e93('0xf')](_0x206700));_0x5e6f2f(_0x206700);})[_0x7e93('0x20')](function(_0x36687a){logger['error']('UpdateVoiceDialReport',_0x36687a[_0x7e93('0x12')],_0x5d434b);_0x36cadb(_0x1ba465[_0x7e93('0x10')](0x1f4,_0x36687a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 1d342aa..8f0dd2b 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 _0xce8b=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','put','update','delete'];(function(_0x171d07,_0x59c974){var _0x135563=function(_0x2aea19){while(--_0x2aea19){_0x171d07['push'](_0x171d07['shift']());}};_0x135563(++_0x59c974);}(_0xce8b,0x1a4));var _0xbce8=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xce8b[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0xbce8('0x0'));var util=require(_0xbce8('0x1'));var path=require(_0xbce8('0x2'));var timeout=require('connect-timeout');var express=require(_0xbce8('0x3'));var router=express[_0xbce8('0x4')]();var fs_extra=require(_0xbce8('0x5'));var auth=require(_0xbce8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbce8('0x7'));var controller=require(_0xbce8('0x8'));router[_0xbce8('0x9')]('/',auth[_0xbce8('0xa')](),controller['index']);router[_0xbce8('0x9')](_0xbce8('0xb'),auth['isAuthenticated'](),controller[_0xbce8('0xc')]);router[_0xbce8('0xd')]('/',auth[_0xbce8('0xa')](),controller[_0xbce8('0xe')]);router[_0xbce8('0xd')](_0xbce8('0xf'),auth[_0xbce8('0xa')](),controller[_0xbce8('0x10')]);router[_0xbce8('0x11')](_0xbce8('0xb'),auth[_0xbce8('0xa')](),controller[_0xbce8('0x12')]);router[_0xbce8('0x13')](_0xbce8('0xb'),auth[_0xbce8('0xa')](),controller[_0xbce8('0x14')]);module[_0xbce8('0x15')]=router; \ No newline at end of file +var _0x7675=['multer','connect-timeout','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','post','create','/:id/applications','addApplications','put','delete','destroy','exports'];(function(_0x4b23fb,_0x4a3527){var _0x11f8e9=function(_0x32da42){while(--_0x32da42){_0x4b23fb['push'](_0x4b23fb['shift']());}};_0x11f8e9(++_0x4a3527);}(_0x7675,0x143));var _0x5767=function(_0x1a9812,_0x140bbe){_0x1a9812=_0x1a9812-0x0;var _0x5a87c8=_0x7675[_0x1a9812];return _0x5a87c8;};'use strict';var multer=require(_0x5767('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5767('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5767('0x2'));var config=require(_0x5767('0x3'));var controller=require(_0x5767('0x4'));router[_0x5767('0x5')]('/',auth['isAuthenticated'](),controller[_0x5767('0x6')]);router[_0x5767('0x5')](_0x5767('0x7'),auth[_0x5767('0x8')](),controller['show']);router[_0x5767('0x9')]('/',auth[_0x5767('0x8')](),controller[_0x5767('0xa')]);router['post'](_0x5767('0xb'),auth[_0x5767('0x8')](),controller[_0x5767('0xc')]);router[_0x5767('0xd')](_0x5767('0x7'),auth[_0x5767('0x8')](),controller['update']);router[_0x5767('0xe')](_0x5767('0x7'),auth['isAuthenticated'](),controller[_0x5767('0xf')]);module[_0x5767('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 3ac2e09..43a7820 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 _0xd0cf=['ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','compositeIndex','STRING'];(function(_0xeaba4b,_0x1eab4b){var _0x32f4fd=function(_0x43ec5b){while(--_0x43ec5b){_0xeaba4b['push'](_0xeaba4b['shift']());}};_0x32f4fd(++_0x1eab4b);}(_0xd0cf,0x153));var _0xfd0c=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0xd0cf[_0xf34b0a];return _0x5021e1;};'use strict';var Sequelize=require(_0xfd0c('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfd0c('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xfd0c('0x1')},'tag':{'type':Sequelize[_0xfd0c('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xfd0c('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xfd0c('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xfd0c('0x3')](_0xfd0c('0x4'),_0xfd0c('0x5'),_0xfd0c('0x6'),_0xfd0c('0x7'),_0xfd0c('0x8'),_0xfd0c('0x9'),_0xfd0c('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xfd0c('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfd0c('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xfd0c('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xfd0c('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xfd0c('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xfd0c('0xd')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xfd0c('0xe')},'answer':{'type':Sequelize[_0xfd0c('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xfd0c('0xf')],'get':function(_0x40b27b){return this[_0xfd0c('0x10')](_0xfd0c('0x11'));}},'alias':{'type':Sequelize[_0xfd0c('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7133=['getDataValue','exten','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','BOOLEAN','INTEGER','wav'];(function(_0x53d088,_0x2d219a){var _0x22675c=function(_0x217b51){while(--_0x217b51){_0x53d088['push'](_0x53d088['shift']());}};_0x22675c(++_0x2d219a);}(_0x7133,0x16a));var _0x3713=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7133[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'defaultValue':'1','unique':_0x3713('0x1')},'tag':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3713('0x2')},'appdata':{'type':Sequelize[_0x3713('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x3713('0x3'),_0x3713('0x4'),_0x3713('0x5'),_0x3713('0x6'),_0x3713('0x7'),'system',_0x3713('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x3713('0x0')]},'interval':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'defaultValue':_0x3713('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x3713('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3713('0x0')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3713('0xb')]},'recordingFormat':{'type':Sequelize[_0x3713('0x0')],'defaultValue':_0x3713('0xc')},'answer':{'type':Sequelize[_0x3713('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3c5ea1){return this[_0x3713('0xd')](_0x3713('0xe'));}},'alias':{'type':Sequelize[_0x3713('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index c2c48aa..14a98b8 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 _0x157e=['rawAttributes','intersection','length','find','catch','create','body','startsWith','exten','concat','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','type','name','UserProfileResource','then','end','error','stack','send','index','VoiceExtension','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params'];(function(_0x3d6bd3,_0x1ea55d){var _0x106abe=function(_0x125f4d){while(--_0x125f4d){_0x3d6bd3['push'](_0x3d6bd3['shift']());}};_0x106abe(++_0x1ea55d);}(_0x157e,0x18b));var _0xe157=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x157e[_0x4b73a2];return _0x383c66;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xe157('0x0'));var logger=require(_0xe157('0x1'))('api');var config=require(_0xe157('0x2'));var db=require(_0xe157('0x3'))['db'];config[_0xe157('0x4')]=_['defaults'](config[_0xe157('0x4')],{'host':_0xe157('0x5'),'port':0x18eb});var socket=require(_0xe157('0x6'))(new Redis(config[_0xe157('0x4')]));require(_0xe157('0x7'))[_0xe157('0x8')](socket);function respondWithStatusCode(_0x53224b,_0x423a65){_0x423a65=_0x423a65||0xcc;return function(_0x296079){if(_0x296079){return _0x53224b[_0xe157('0x9')](_0x423a65);}return _0x53224b[_0xe157('0xa')](_0x423a65)['end']();};}function respondWithResult(_0x4c25f5,_0x3ce84a){_0x3ce84a=_0x3ce84a||0xc8;return function(_0x2cf4ca){if(_0x2cf4ca){return _0x4c25f5['status'](_0x3ce84a)[_0xe157('0xb')](_0x2cf4ca);}};}function respondWithFilteredResult(_0x474234,_0x183de5){return function(_0x32caba){if(_0x32caba){var _0x47f6b7=typeof _0x183de5[_0xe157('0xc')]===_0xe157('0xd')&&typeof _0x183de5[_0xe157('0xe')]==='undefined';var _0x54247a=_0x32caba['count'];var _0x1cb1e3=_0x47f6b7?0x0:_0x183de5[_0xe157('0xc')];var _0x4ec00d=_0x47f6b7?_0x32caba['count']:_0x183de5[_0xe157('0xc')]+_0x183de5[_0xe157('0xe')];var _0x37f819;if(_0x4ec00d>=_0x54247a){_0x4ec00d=_0x54247a;_0x37f819=0xc8;}else{_0x37f819=0xce;}_0x474234[_0xe157('0xa')](_0x37f819);return _0x474234['set']('Content-Range',_0x1cb1e3+'-'+_0x4ec00d+'/'+_0x54247a)[_0xe157('0xb')](_0x32caba);}return null;};}function removeEntity(_0x30a8c0){return function(_0x5a46b0){if(_0x5a46b0){return _0x5a46b0[_0xe157('0xf')]()['then'](function(){var _0x2dfb8e=_0x5a46b0[_0xe157('0x10')]({'plain':!![]});var _0x195618=[{'name':_0xe157('0x11'),'value':_0xe157('0x12'),'ignore':![]},{'name':_0xe157('0x13'),'value':_0xe157('0x14'),'ignore':![]},{'name':_0xe157('0x15'),'value':'internal','ignore':![]}];var _0x4e06b9=_(_0x195618)[_0xe157('0x16')](_0xe157('0x17'))[_0xe157('0x18')](_0xe157('0x19'))[_0xe157('0x19')]();if(_[_0xe157('0x1a')](_0x4e06b9,_0x2dfb8e[_0xe157('0x1b')])){return;}var _0x8b2852=_['find'](_0x195618,['value',_0x2dfb8e[_0xe157('0x1b')]])[_0xe157('0x1c')];return db[_0xe157('0x1d')][_0xe157('0xf')]({'where':{'type':_0x8b2852,'resourceId':_0x2dfb8e['id']}})[_0xe157('0x1e')](function(){return _0x5a46b0;});})['then'](function(){_0x30a8c0['status'](0xcc)[_0xe157('0x1f')]();});}};}function handleEntityNotFound(_0x13c6dd){return function(_0x482ef7){if(!_0x482ef7){_0x13c6dd[_0xe157('0x9')](0x194);}return _0x482ef7;};}function handleError(_0x339860,_0x46edac){_0x46edac=_0x46edac||0x1f4;return function(_0x374255){logger[_0xe157('0x20')](_0x374255[_0xe157('0x21')]);if(_0x374255[_0xe157('0x1c')]){delete _0x374255[_0xe157('0x1c')];}_0x339860['status'](_0x46edac)[_0xe157('0x22')](_0x374255);};}exports[_0xe157('0x23')]=function(_0x1128d1,_0x310eeb){var _0x17bfa7={},_0x4c4ebe={},_0x2c6859={'count':0x0,'rows':[]};var _0x3e9097=_['map'](db[_0xe157('0x24')]['rawAttributes'],function(_0x46957b){return{'name':_0x46957b[_0xe157('0x25')],'type':_0x46957b[_0xe157('0x1b')][_0xe157('0x26')]};});_0x4c4ebe[_0xe157('0x27')]=_[_0xe157('0x18')](_0x3e9097,'name');_0x4c4ebe[_0xe157('0x28')]=_[_0xe157('0x29')](_0x1128d1[_0xe157('0x28')]);_0x4c4ebe[_0xe157('0x2a')]=_['intersection'](_0x4c4ebe['model'],_0x4c4ebe['query']);_0x17bfa7[_0xe157('0x2b')]=_['intersection'](_0x4c4ebe[_0xe157('0x27')],qs['fields'](_0x1128d1[_0xe157('0x28')][_0xe157('0x2c')]));_0x17bfa7[_0xe157('0x2b')]=_0x17bfa7[_0xe157('0x2b')]['length']?_0x17bfa7['attributes']:_0x4c4ebe['model'];if(!_0x1128d1[_0xe157('0x28')][_0xe157('0x2d')](_0xe157('0x2e'))){_0x17bfa7[_0xe157('0xe')]=qs[_0xe157('0xe')](_0x1128d1[_0xe157('0x28')][_0xe157('0xe')]);_0x17bfa7['offset']=qs['offset'](_0x1128d1[_0xe157('0x28')][_0xe157('0xc')]);}_0x17bfa7[_0xe157('0x2f')]=qs['sort'](_0x1128d1[_0xe157('0x28')][_0xe157('0x30')]);_0x17bfa7[_0xe157('0x31')]=qs[_0xe157('0x2a')](_[_0xe157('0x32')](_0x1128d1[_0xe157('0x28')],_0x4c4ebe[_0xe157('0x2a')]),_0x3e9097);if(_0x1128d1[_0xe157('0x28')][_0xe157('0x16')]){_0x17bfa7[_0xe157('0x31')]=_[_0xe157('0x33')](_0x17bfa7[_0xe157('0x31')],{'$or':_[_0xe157('0x18')](_0x3e9097,function(_0x10578c){if(_0x10578c[_0xe157('0x1b')]!==_0xe157('0x34')){var _0x1d25d7={};_0x1d25d7[_0x10578c['name']]={'$like':'%'+_0x1128d1[_0xe157('0x28')][_0xe157('0x16')]+'%'};return _0x1d25d7;}})});}_0x17bfa7=_[_0xe157('0x33')]({},_0x17bfa7,_0x1128d1[_0xe157('0x35')]);var _0x225735={'where':_0x17bfa7['where']};return db[_0xe157('0x24')]['count'](_0x225735)['then'](function(_0x304b96){_0x2c6859[_0xe157('0x36')]=_0x304b96;if(_0x1128d1[_0xe157('0x28')][_0xe157('0x37')]){_0x17bfa7[_0xe157('0x38')]=[{'all':!![]}];}return db['VoiceExtension'][_0xe157('0x39')](_0x17bfa7);})['then'](function(_0x377b86){_0x2c6859[_0xe157('0x3a')]=_0x377b86;return _0x2c6859;})[_0xe157('0x1e')](respondWithFilteredResult(_0x310eeb,_0x17bfa7))['catch'](handleError(_0x310eeb,null));};exports['show']=function(_0x21ee90,_0x5c7d2f){var _0x40bbb7={'raw':![],'where':{'id':_0x21ee90[_0xe157('0x3b')]['id']}},_0x751421={};_0x751421['model']=_['keys'](db['VoiceExtension'][_0xe157('0x3c')]);_0x751421['query']=_['keys'](_0x21ee90[_0xe157('0x28')]);_0x751421[_0xe157('0x2a')]=_[_0xe157('0x3d')](_0x751421[_0xe157('0x27')],_0x751421[_0xe157('0x28')]);_0x40bbb7[_0xe157('0x2b')]=_['intersection'](_0x751421[_0xe157('0x27')],qs['fields'](_0x21ee90['query'][_0xe157('0x2c')]));_0x40bbb7['attributes']=_0x40bbb7[_0xe157('0x2b')][_0xe157('0x3e')]?_0x40bbb7[_0xe157('0x2b')]:_0x751421[_0xe157('0x27')];if(_0x21ee90[_0xe157('0x28')][_0xe157('0x37')]){_0x40bbb7[_0xe157('0x38')]=[{'all':!![]}];}_0x40bbb7=_[_0xe157('0x33')]({},_0x40bbb7,_0x21ee90['options']);return db[_0xe157('0x24')][_0xe157('0x3f')](_0x40bbb7)[_0xe157('0x1e')](handleEntityNotFound(_0x5c7d2f,null))[_0xe157('0x1e')](respondWithResult(_0x5c7d2f,null))[_0xe157('0x40')](handleError(_0x5c7d2f,null));};exports[_0xe157('0xf')]=function(_0x1fa3e9,_0x3d5155){return db[_0xe157('0x24')][_0xe157('0x3f')]({'where':{'id':_0x1fa3e9['params']['id']}})[_0xe157('0x1e')](handleEntityNotFound(_0x3d5155,null))[_0xe157('0x1e')](removeEntity(_0x3d5155,null))[_0xe157('0x40')](handleError(_0x3d5155,null));};exports[_0xe157('0x41')]=function(_0x55519e,_0x33c253){if(_0x55519e[_0xe157('0x42')]['type']===_0xe157('0x14')&&!_[_0xe157('0x43')](_0x55519e['body'][_0xe157('0x44')],'_')){_0x55519e[_0xe157('0x42')][_0xe157('0x44')]='_'[_0xe157('0x45')](_0x55519e['body'][_0xe157('0x44')]);}return db[_0xe157('0x24')][_0xe157('0x41')](_0x55519e[_0xe157('0x42')],{'raw':![]})[_0xe157('0x1e')](function(_0x849f40){var _0x342206=_0x55519e[_0xe157('0x46')][_0xe157('0x10')]({'plain':!![]});if(!_0x342206)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x342206['role']===_0xe157('0x46')){var _0x7df5ef=_0x849f40['get']({'plain':!![]});var _0x29a8df=[{'name':_0xe157('0x11'),'value':_0xe157('0x12')},{'name':_0xe157('0x13'),'value':_0xe157('0x14')},{'name':_0xe157('0x15'),'value':'internal'}];var _0x8b431d=_[_0xe157('0x3f')](_0x29a8df,[_0xe157('0x19'),_0x7df5ef[_0xe157('0x1b')]])[_0xe157('0x1c')];return db[_0xe157('0x47')][_0xe157('0x3f')]({'where':{'name':_0x8b431d,'userProfileId':_0x342206[_0xe157('0x48')]},'raw':!![]})['then'](function(_0x39b87d){if(_0x39b87d&&_0x39b87d[_0xe157('0x49')]===0x0){return db[_0xe157('0x1d')][_0xe157('0x41')]({'name':_0x7df5ef['name'],'resourceId':_0x7df5ef['id'],'type':_0x39b87d[_0xe157('0x1c')],'sectionId':_0x39b87d['id']},{})['then'](function(){return _0x849f40;});}else{return _0x849f40;}})[_0xe157('0x40')](function(_0x2f3da7){logger['error'](_0xe157('0x4a'),_0x2f3da7);throw _0x2f3da7;});}return _0x849f40;})['then'](respondWithResult(_0x33c253,0xc9))[_0xe157('0x40')](handleError(_0x33c253,null));};exports[_0xe157('0x4b')]=function(_0x4284fa,_0x53b155){if(_0x4284fa[_0xe157('0x42')]['id']){delete _0x4284fa[_0xe157('0x42')]['id'];}return db[_0xe157('0x24')]['find']({'where':{'id':_0x4284fa['params']['id']}})[_0xe157('0x1e')](handleEntityNotFound(_0x53b155,null))[_0xe157('0x1e')](function(_0x5ad64f){if(_0x5ad64f){return db['VoiceExtension'][_0xe157('0x4b')](_[_0xe157('0x32')](_0x4284fa[_0xe157('0x42')],[_0xe157('0x44'),'context',_0xe157('0x4c'),_0xe157('0x4d'),_0xe157('0x4e'),_0xe157('0x4f'),_0xe157('0x50')]),{'where':{'context':_0x5ad64f[_0xe157('0x51')],'exten':_0x5ad64f[_0xe157('0x44')]},'individualHooks':!![]})[_0xe157('0x1e')](function(_0x39c066){return _0x39c066;});}return null;})['then'](respondWithStatusCode(_0x53b155,null))[_0xe157('0x40')](handleError(_0x53b155,null));};exports['addApplications']=function(_0xeef6de,_0x119855){var _0x25e29d=_0xeef6de[_0xe157('0x3b')]['id'];var _0x5aa157=_0xeef6de['body'];var _0x158ab6=0xc8;var _0x32431e=null;return db[_0xe157('0x52')][_0xe157('0x53')]({'isolationLevel':db[_0xe157('0x52')]['Transaction'][_0xe157('0x54')][_0xe157('0x55')]},function(_0x2dd2ff){return db[_0xe157('0x24')]['findOne']({'where':{'id':_0x25e29d},'transaction':_0x2dd2ff})[_0xe157('0x1e')](function(_0x1018ed){if(_0x1018ed){return db[_0xe157('0x24')][_0xe157('0xf')]({'where':{'VoiceExtensionId':_0x25e29d},'transaction':_0x2dd2ff})[_0xe157('0x1e')](function(){var _0x3cda40=_['map'](_0x5aa157,function(_0xccde33){_0xccde33['VoiceExtensionId']=_0x25e29d;_0xccde33[_0xe157('0x56')]=!![];return _0xccde33;});return _0x1018ed[_0xe157('0x57')](_0x3cda40);})['then'](function(_0x41dce9){return db[_0xe157('0x24')][_0xe157('0x58')](_0x41dce9,{'transaction':_0x2dd2ff});});}else{_0x158ab6=0x194;_0x32431e=[];}});})['then'](function(){if(_0x158ab6!==0x194){return db[_0xe157('0x24')][_0xe157('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x25e29d},'order':_0xe157('0x5a')})[_0xe157('0x1e')](function(_0x3df135){_0x32431e=_0x3df135;});}})[_0xe157('0x40')](function(_0x51a073){_0x158ab6=0x1f4;logger[_0xe157('0x20')](_0x51a073[_0xe157('0x21')]);if(_0x51a073[_0xe157('0x1c')]){delete _0x51a073[_0xe157('0x1c')];}_0x32431e=_0x51a073;})['finally'](function(){if(_0x32431e===null){_0x119855[_0xe157('0x9')](_0x158ab6);}else{if(_0x158ab6===0x1f4){_0x119855['status'](_0x158ab6)[_0xe157('0x22')](_0x32431e);}else{_0x119855[_0xe157('0xa')](_0x158ab6)[_0xe157('0xb')](_0x32431e);}}});}; \ No newline at end of file +var _0xf392=['keys','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','then','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','sort','where','pick','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','params'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf392,0xdc));var _0x2f39=function(_0x41f67b,_0x55ea60){_0x41f67b=_0x41f67b-0x0;var _0x48f8a7=_0xf392[_0x41f67b];return _0x48f8a7;};'use strict';var _=require(_0x2f39('0x0'));var Redis=require(_0x2f39('0x1'));var qs=require(_0x2f39('0x2'));var logger=require(_0x2f39('0x3'))(_0x2f39('0x4'));var config=require(_0x2f39('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2f39('0x6')](config[_0x2f39('0x7')],{'host':_0x2f39('0x8'),'port':0x18eb});var socket=require(_0x2f39('0x9'))(new Redis(config[_0x2f39('0x7')]));require(_0x2f39('0xa'))[_0x2f39('0xb')](socket);function respondWithStatusCode(_0xcd865a,_0x2bb66b){_0x2bb66b=_0x2bb66b||0xcc;return function(_0x311e99){if(_0x311e99){return _0xcd865a[_0x2f39('0xc')](_0x2bb66b);}return _0xcd865a[_0x2f39('0xd')](_0x2bb66b)[_0x2f39('0xe')]();};}function respondWithResult(_0x5b6459,_0x41d51a){_0x41d51a=_0x41d51a||0xc8;return function(_0x47aa1e){if(_0x47aa1e){return _0x5b6459[_0x2f39('0xd')](_0x41d51a)[_0x2f39('0xf')](_0x47aa1e);}};}function respondWithFilteredResult(_0x53dbe3,_0x233404){return function(_0x584a25){if(_0x584a25){var _0xf82811=typeof _0x233404[_0x2f39('0x10')]===_0x2f39('0x11')&&typeof _0x233404[_0x2f39('0x12')]===_0x2f39('0x11');var _0x46116b=_0x584a25['count'];var _0x4a62ff=_0xf82811?0x0:_0x233404[_0x2f39('0x10')];var _0x3c187b=_0xf82811?_0x584a25['count']:_0x233404['offset']+_0x233404[_0x2f39('0x12')];var _0x31645c;if(_0x3c187b>=_0x46116b){_0x3c187b=_0x46116b;_0x31645c=0xc8;}else{_0x31645c=0xce;}_0x53dbe3['status'](_0x31645c);return _0x53dbe3[_0x2f39('0x13')](_0x2f39('0x14'),_0x4a62ff+'-'+_0x3c187b+'/'+_0x46116b)[_0x2f39('0xf')](_0x584a25);}return null;};}function removeEntity(_0x5a5a8d){return function(_0x44ba67){if(_0x44ba67){return _0x44ba67['destroy']()['then'](function(){var _0x12ed66=_0x44ba67[_0x2f39('0x15')]({'plain':!![]});var _0x26b5e6=[{'name':_0x2f39('0x16'),'value':_0x2f39('0x17'),'ignore':![]},{'name':_0x2f39('0x18'),'value':_0x2f39('0x19'),'ignore':![]},{'name':'InternalRoutes','value':_0x2f39('0x1a'),'ignore':![]}];var _0x550d6f=_(_0x26b5e6)[_0x2f39('0x1b')](_0x2f39('0x1c'))[_0x2f39('0x1d')]('value')[_0x2f39('0x1e')]();if(_[_0x2f39('0x1f')](_0x550d6f,_0x12ed66[_0x2f39('0x20')])){return;}var _0x575394=_[_0x2f39('0x21')](_0x26b5e6,[_0x2f39('0x1e'),_0x12ed66['type']])[_0x2f39('0x22')];return db[_0x2f39('0x23')][_0x2f39('0x24')]({'where':{'type':_0x575394,'resourceId':_0x12ed66['id']}})[_0x2f39('0x25')](function(){return _0x44ba67;});})['then'](function(){_0x5a5a8d[_0x2f39('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16caef){return function(_0x54221d){if(!_0x54221d){_0x16caef[_0x2f39('0xc')](0x194);}return _0x54221d;};}function handleError(_0x553032,_0x34694f){_0x34694f=_0x34694f||0x1f4;return function(_0x1b95aa){logger[_0x2f39('0x26')](_0x1b95aa[_0x2f39('0x27')]);if(_0x1b95aa[_0x2f39('0x22')]){delete _0x1b95aa[_0x2f39('0x22')];}_0x553032[_0x2f39('0xd')](_0x34694f)['send'](_0x1b95aa);};}exports[_0x2f39('0x28')]=function(_0x4bbf91,_0x135afb){var _0x3ab92c={},_0x22cfa4={},_0x20be28={'count':0x0,'rows':[]};var _0x509106=_[_0x2f39('0x1d')](db[_0x2f39('0x29')][_0x2f39('0x2a')],function(_0x57b962){return{'name':_0x57b962[_0x2f39('0x2b')],'type':_0x57b962[_0x2f39('0x20')][_0x2f39('0x2c')]};});_0x22cfa4['model']=_[_0x2f39('0x1d')](_0x509106,'name');_0x22cfa4['query']=_['keys'](_0x4bbf91[_0x2f39('0x2d')]);_0x22cfa4[_0x2f39('0x2e')]=_[_0x2f39('0x2f')](_0x22cfa4['model'],_0x22cfa4['query']);_0x3ab92c[_0x2f39('0x30')]=_[_0x2f39('0x2f')](_0x22cfa4[_0x2f39('0x31')],qs[_0x2f39('0x32')](_0x4bbf91['query'][_0x2f39('0x32')]));_0x3ab92c[_0x2f39('0x30')]=_0x3ab92c[_0x2f39('0x30')][_0x2f39('0x33')]?_0x3ab92c[_0x2f39('0x30')]:_0x22cfa4[_0x2f39('0x31')];if(!_0x4bbf91[_0x2f39('0x2d')]['hasOwnProperty']('nolimit')){_0x3ab92c['limit']=qs['limit'](_0x4bbf91[_0x2f39('0x2d')][_0x2f39('0x12')]);_0x3ab92c[_0x2f39('0x10')]=qs[_0x2f39('0x10')](_0x4bbf91['query']['offset']);}_0x3ab92c['order']=qs['sort'](_0x4bbf91[_0x2f39('0x2d')][_0x2f39('0x34')]);_0x3ab92c[_0x2f39('0x35')]=qs[_0x2f39('0x2e')](_[_0x2f39('0x36')](_0x4bbf91[_0x2f39('0x2d')],_0x22cfa4['filters']),_0x509106);if(_0x4bbf91[_0x2f39('0x2d')]['filter']){_0x3ab92c['where']=_['merge'](_0x3ab92c[_0x2f39('0x35')],{'$or':_[_0x2f39('0x1d')](_0x509106,function(_0x525884){if(_0x525884[_0x2f39('0x20')]!==_0x2f39('0x37')){var _0x575fad={};_0x575fad[_0x525884[_0x2f39('0x22')]]={'$like':'%'+_0x4bbf91[_0x2f39('0x2d')]['filter']+'%'};return _0x575fad;}})});}_0x3ab92c=_[_0x2f39('0x38')]({},_0x3ab92c,_0x4bbf91[_0x2f39('0x39')]);var _0x2c843c={'where':_0x3ab92c['where']};return db[_0x2f39('0x29')][_0x2f39('0x3a')](_0x2c843c)[_0x2f39('0x25')](function(_0x23def2){_0x20be28['count']=_0x23def2;if(_0x4bbf91[_0x2f39('0x2d')][_0x2f39('0x3b')]){_0x3ab92c[_0x2f39('0x3c')]=[{'all':!![]}];}return db[_0x2f39('0x29')]['findAll'](_0x3ab92c);})['then'](function(_0x7693bd){_0x20be28[_0x2f39('0x3d')]=_0x7693bd;return _0x20be28;})[_0x2f39('0x25')](respondWithFilteredResult(_0x135afb,_0x3ab92c))[_0x2f39('0x3e')](handleError(_0x135afb,null));};exports[_0x2f39('0x3f')]=function(_0x126121,_0x493ce9){var _0x934da3={'raw':![],'where':{'id':_0x126121[_0x2f39('0x40')]['id']}},_0x5c3195={};_0x5c3195[_0x2f39('0x31')]=_[_0x2f39('0x41')](db['VoiceExtension'][_0x2f39('0x2a')]);_0x5c3195['query']=_[_0x2f39('0x41')](_0x126121['query']);_0x5c3195[_0x2f39('0x2e')]=_['intersection'](_0x5c3195[_0x2f39('0x31')],_0x5c3195[_0x2f39('0x2d')]);_0x934da3[_0x2f39('0x30')]=_['intersection'](_0x5c3195['model'],qs[_0x2f39('0x32')](_0x126121[_0x2f39('0x2d')]['fields']));_0x934da3['attributes']=_0x934da3[_0x2f39('0x30')][_0x2f39('0x33')]?_0x934da3[_0x2f39('0x30')]:_0x5c3195[_0x2f39('0x31')];if(_0x126121[_0x2f39('0x2d')][_0x2f39('0x3b')]){_0x934da3[_0x2f39('0x3c')]=[{'all':!![]}];}_0x934da3=_['merge']({},_0x934da3,_0x126121[_0x2f39('0x39')]);return db[_0x2f39('0x29')]['find'](_0x934da3)['then'](handleEntityNotFound(_0x493ce9,null))[_0x2f39('0x25')](respondWithResult(_0x493ce9,null))[_0x2f39('0x3e')](handleError(_0x493ce9,null));};exports['destroy']=function(_0x2e475e,_0x3da8c0){return db[_0x2f39('0x29')][_0x2f39('0x21')]({'where':{'id':_0x2e475e[_0x2f39('0x40')]['id']}})[_0x2f39('0x25')](handleEntityNotFound(_0x3da8c0,null))['then'](removeEntity(_0x3da8c0,null))[_0x2f39('0x3e')](handleError(_0x3da8c0,null));};exports[_0x2f39('0x42')]=function(_0x2e4ef2,_0x3dee15){if(_0x2e4ef2['body'][_0x2f39('0x20')]===_0x2f39('0x19')&&!_['startsWith'](_0x2e4ef2[_0x2f39('0x43')][_0x2f39('0x44')],'_')){_0x2e4ef2[_0x2f39('0x43')]['exten']='_'[_0x2f39('0x45')](_0x2e4ef2[_0x2f39('0x43')][_0x2f39('0x44')]);}return db['VoiceExtension'][_0x2f39('0x42')](_0x2e4ef2[_0x2f39('0x43')],{'raw':![]})['then'](function(_0x38de7d){var _0x386861=_0x2e4ef2['user']['get']({'plain':!![]});if(!_0x386861)throw new Error(_0x2f39('0x46'));if(_0x386861[_0x2f39('0x47')]==='user'){var _0x59f127=_0x38de7d[_0x2f39('0x15')]({'plain':!![]});var _0x478c5b=[{'name':_0x2f39('0x16'),'value':_0x2f39('0x17')},{'name':_0x2f39('0x18'),'value':_0x2f39('0x19')},{'name':_0x2f39('0x48'),'value':'internal'}];var _0x1693e5=_['find'](_0x478c5b,[_0x2f39('0x1e'),_0x59f127[_0x2f39('0x20')]])[_0x2f39('0x22')];return db['UserProfileSection'][_0x2f39('0x21')]({'where':{'name':_0x1693e5,'userProfileId':_0x386861[_0x2f39('0x49')]},'raw':!![]})[_0x2f39('0x25')](function(_0x119790){if(_0x119790&&_0x119790[_0x2f39('0x4a')]===0x0){return db[_0x2f39('0x23')][_0x2f39('0x42')]({'name':_0x59f127['name'],'resourceId':_0x59f127['id'],'type':_0x119790[_0x2f39('0x22')],'sectionId':_0x119790['id']},{})[_0x2f39('0x25')](function(){return _0x38de7d;});}else{return _0x38de7d;}})[_0x2f39('0x3e')](function(_0x3191b6){logger['error'](_0x2f39('0x4b'),_0x3191b6);throw _0x3191b6;});}return _0x38de7d;})['then'](respondWithResult(_0x3dee15,0xc9))[_0x2f39('0x3e')](handleError(_0x3dee15,null));};exports[_0x2f39('0x4c')]=function(_0x214c40,_0x191d91){if(_0x214c40['body']['id']){delete _0x214c40[_0x2f39('0x43')]['id'];}return db[_0x2f39('0x29')][_0x2f39('0x21')]({'where':{'id':_0x214c40[_0x2f39('0x40')]['id']}})[_0x2f39('0x25')](handleEntityNotFound(_0x191d91,null))['then'](function(_0x13f68e){if(_0x13f68e){return db[_0x2f39('0x29')][_0x2f39('0x4c')](_['pick'](_0x214c40[_0x2f39('0x43')],[_0x2f39('0x44'),_0x2f39('0x4d'),_0x2f39('0x4e'),_0x2f39('0x4f'),_0x2f39('0x50'),_0x2f39('0x51'),_0x2f39('0x52')]),{'where':{'context':_0x13f68e[_0x2f39('0x4d')],'exten':_0x13f68e[_0x2f39('0x44')]},'individualHooks':!![]})[_0x2f39('0x25')](function(_0x45fd8a){return _0x45fd8a;});}return null;})[_0x2f39('0x25')](respondWithStatusCode(_0x191d91,null))['catch'](handleError(_0x191d91,null));};exports['addApplications']=function(_0x2ad3c3,_0x487386){var _0x565616=_0x2ad3c3[_0x2f39('0x40')]['id'];var _0x40088a=_0x2ad3c3['body'];var _0x2be6a7=0xc8;var _0x1bdbdf=null;return db['sequelize'][_0x2f39('0x53')]({'isolationLevel':db[_0x2f39('0x54')]['Transaction'][_0x2f39('0x55')][_0x2f39('0x56')]},function(_0x49c3b9){return db[_0x2f39('0x29')][_0x2f39('0x57')]({'where':{'id':_0x565616},'transaction':_0x49c3b9})[_0x2f39('0x25')](function(_0x3136cb){if(_0x3136cb){return db[_0x2f39('0x29')][_0x2f39('0x24')]({'where':{'VoiceExtensionId':_0x565616},'transaction':_0x49c3b9})['then'](function(){var _0x2f5a96=_[_0x2f39('0x1d')](_0x40088a,function(_0x47a16d){_0x47a16d[_0x2f39('0x58')]=_0x565616;_0x47a16d[_0x2f39('0x59')]=!![];return _0x47a16d;});return _0x3136cb['createRouting'](_0x2f5a96);})[_0x2f39('0x25')](function(_0x45d7c2){return db[_0x2f39('0x29')][_0x2f39('0x5a')](_0x45d7c2,{'transaction':_0x49c3b9});});}else{_0x2be6a7=0x194;_0x1bdbdf=[];}});})[_0x2f39('0x25')](function(){if(_0x2be6a7!==0x194){return db[_0x2f39('0x29')][_0x2f39('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x565616},'order':_0x2f39('0x5c')})[_0x2f39('0x25')](function(_0x4e5685){_0x1bdbdf=_0x4e5685;});}})['catch'](function(_0x5c2ace){_0x2be6a7=0x1f4;logger[_0x2f39('0x26')](_0x5c2ace[_0x2f39('0x27')]);if(_0x5c2ace['name']){delete _0x5c2ace[_0x2f39('0x22')];}_0x1bdbdf=_0x5c2ace;})[_0x2f39('0x5d')](function(){if(_0x1bdbdf===null){_0x487386[_0x2f39('0xc')](_0x2be6a7);}else{if(_0x2be6a7===0x1f4){_0x487386[_0x2f39('0xd')](_0x2be6a7)[_0x2f39('0x5e')](_0x1bdbdf);}else{_0x487386['status'](_0x2be6a7)[_0x2f39('0xf')](_0x1bdbdf);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index c440d0b..6386af7 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 _0x8bae=['update','remove','emit','hook','exports','../../mysqldb','VoiceExtension','save'];(function(_0x374672,_0x4f495a){var _0x2318e1=function(_0x28645b){while(--_0x28645b){_0x374672['push'](_0x374672['shift']());}};_0x2318e1(++_0x4f495a);}(_0x8bae,0xbd));var _0xe8ba=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8bae[_0x51020b];return _0x371e47;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xe8ba('0x0'))['db'][_0xe8ba('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe8ba('0x2'),'afterUpdate':_0xe8ba('0x3'),'afterDestroy':_0xe8ba('0x4')};function emitEvent(_0x3b4628){return function(_0x3d4a16,_0x2bb9ac,_0x33cef1){VoiceExtensionEvents['emit'](_0x3b4628+':'+_0x3d4a16['id'],_0x3d4a16);VoiceExtensionEvents[_0xe8ba('0x5')](_0x3b4628,_0x3d4a16);_0x33cef1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xe8ba('0x6')](e,emitEvent(event));}}module[_0xe8ba('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xe9bf=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe9bf,0xab));var _0xfe9b=function(_0xe94a50,_0x1a794c){_0xe94a50=_0xe94a50-0x0;var _0x5b7eba=_0xe9bf[_0xe94a50];return _0x5b7eba;};'use strict';var EventEmitter=require(_0xfe9b('0x0'));var VoiceExtension=require(_0xfe9b('0x1'))['db'][_0xfe9b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfe9b('0x3')](0x0);var events={'afterCreate':_0xfe9b('0x4'),'afterUpdate':_0xfe9b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x27b91d){return function(_0x58f4b5,_0x546acb,_0x2b009f){VoiceExtensionEvents[_0xfe9b('0x6')](_0x27b91d+':'+_0x58f4b5['id'],_0x58f4b5);VoiceExtensionEvents[_0xfe9b('0x6')](_0x27b91d,_0x58f4b5);_0x2b009f(null);};}for(var e in events){if(events[_0xfe9b('0x7')](e)){var event=events[e];VoiceExtension[_0xfe9b('0x8')](e,emitEvent(event));}}module[_0xfe9b('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 453ecab..74da4bb 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 _0xdc91=['CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','answer','queue','playback','includes','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','appType','outboundDial','appdata','agi','priority','last','concat','define','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports','type','CDR(type)=','context','exten','Set','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdc91,0x183));var _0x1dc9=function(_0x3c36fb,_0x388539){_0x3c36fb=_0x3c36fb-0x0;var _0x4a47eb=_0xdc91[_0x3c36fb];return _0x4a47eb;};'use strict';var _=require(_0x1dc9('0x0'));var attributes=require(_0x1dc9('0x1'));module[_0x1dc9('0x2')]=function(_0x2b4f65){var _0x1ef0bb=_0x2b4f65['models'];function _0x198b5c(_0x35e81b){var _0x38f7b8=0x2;var _0x5b08a6=[{'type':_0x35e81b[_0x1dc9('0x3')],'app':'Set','appdata':_0x1dc9('0x4')+_0x35e81b[_0x1dc9('0x3')],'context':_0x35e81b[_0x1dc9('0x5')],'exten':_0x35e81b[_0x1dc9('0x6')],'priority':_0x38f7b8++,'VoiceExtensionId':_0x35e81b['id']},{'type':_0x35e81b[_0x1dc9('0x3')],'app':_0x35e81b['alias']?_0x1dc9('0x7'):'NoOp','appdata':_0x35e81b['alias']?'CDR(routeAlias)='+_0x35e81b[_0x1dc9('0x8')]:_0x1dc9('0x9'),'context':_0x35e81b[_0x1dc9('0x5')],'exten':_0x35e81b[_0x1dc9('0x6')],'priority':_0x38f7b8++,'VoiceExtensionId':_0x35e81b['id']}];if(_0x35e81b['type']===_0x1dc9('0xa')){_0x5b08a6[_0x1dc9('0xb')]({'type':_0x1dc9('0xa'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0xc')+_0x35e81b['id'],'context':_0x35e81b['context'],'exten':_0x35e81b[_0x1dc9('0x6')],'priority':_0x38f7b8++,'VoiceExtensionId':_0x35e81b['id']});}_0x5b08a6[_0x1dc9('0xb')]({'type':_0x35e81b[_0x1dc9('0x3')],'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0xd'),'context':_0x35e81b['context'],'exten':_0x35e81b['exten'],'priority':_0x38f7b8++,'VoiceExtensionId':_0x35e81b['id']},{'type':_0x35e81b[_0x1dc9('0x3')],'app':'Set','appdata':_0x1dc9('0xe'),'context':_0x35e81b[_0x1dc9('0x5')],'exten':_0x35e81b[_0x1dc9('0x6')],'priority':_0x38f7b8++,'VoiceExtensionId':_0x35e81b['id']},{'type':_0x35e81b[_0x1dc9('0x3')],'app':'Set','appdata':_0x1dc9('0xf'),'context':_0x35e81b[_0x1dc9('0x5')],'exten':_0x35e81b[_0x1dc9('0x6')],'priority':_0x38f7b8++,'VoiceExtensionId':_0x35e81b['id']});return _0x5b08a6;}function _0x2da7a9(_0x34802c){var _0x3f6eaf=0x2;var _0x13028e=[{'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0x11'),'context':_0x34802c['context'],'exten':_0x34802c['exten'],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':_0x1dc9('0x10'),'app':_0x34802c['alias']?_0x1dc9('0x7'):'NoOp','appdata':_0x34802c[_0x1dc9('0x8')]?_0x1dc9('0x12')+_0x34802c['alias']:_0x1dc9('0x9'),'context':_0x34802c['context'],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0x13')+(_0x34802c[_0x1dc9('0x14')]?_0x1dc9('0x15')+_0x34802c[_0x1dc9('0x14')]+'}':_0x1dc9('0x16')),'context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0xc')+_0x34802c['id'],'context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':'outbound','app':_0x1dc9('0x17'),'appdata':_0x1dc9('0x18')+(_0x3f6eaf+0x2)+_0x1dc9('0x19')+(_0x3f6eaf+0x1)+')','context':_0x34802c['context'],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':'outbound','app':_0x1dc9('0x7'),'appdata':_0x34802c[_0x1dc9('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x34802c['cutdigits']+'}':_0x1dc9('0x1a'),'context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c['exten'],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0xe'),'context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0xf'),'context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c['exten'],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0x1b')+_0x34802c['id'],'context':_0x34802c['context'],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']}];if(_0x34802c['hasOwnProperty']('recordingFormat')&&_0x34802c[_0x1dc9('0x1c')]!==_0x1dc9('0x1d')){_0x13028e[_0x1dc9('0xb')]({'type':_0x1dc9('0x10'),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0x1e'),'context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c['exten'],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']},{'type':'outbound','app':_0x1dc9('0x7'),'appdata':_0x1dc9('0x1f')+_0x34802c[_0x1dc9('0x1c')]||_0x1dc9('0x20'),'context':_0x34802c[_0x1dc9('0x5')],'exten':_0x34802c[_0x1dc9('0x6')],'priority':_0x3f6eaf++,'VoiceExtensionId':_0x34802c['id']});}return _0x13028e;}function _0x1fb5de(_0x55ff0a,_0x38a5ed){var _0x5104c0=[{'name':_0x1dc9('0x21'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x1dc9('0x22'),'param':0x2},{'name':_0x1dc9('0x23'),'param':0x3}];var _0x10f8fa={};var _0x242566=_0x38a5ed[_0x1dc9('0x24')](',');var _0x44ae0c=[];for(var _0x5a644c=0x0;_0x5a644c<_0x5104c0[_0x1dc9('0x25')];_0x5a644c++){switch(_0x5104c0[_0x5a644c][_0x1dc9('0x26')]){case _0x1dc9('0x21'):_0x10f8fa['trunk']=_0x242566[_0x5104c0[_0x5a644c][_0x1dc9('0x27')]][_0x1dc9('0x24')]('/')[0x1];_0x10f8fa[_0x1dc9('0x28')]=_0x242566[_0x5104c0[_0x5a644c][_0x1dc9('0x27')]]['split']('/')[0x2];_0x10f8fa['prefix']=_0x10f8fa[_0x1dc9('0x28')]?_0x10f8fa[_0x1dc9('0x28')][_0x1dc9('0x24')]('$')[0x0]:undefined;_0x10f8fa[_0x1dc9('0x28')]=_0x55ff0a[_0x1dc9('0x14')]?(_0x10f8fa['prefix']||'')+_0x1dc9('0x15')+_0x55ff0a[_0x1dc9('0x14')]+'}':(_0x10f8fa[_0x1dc9('0x29')]||'')+_0x1dc9('0x16');_0x44ae0c[_0x5104c0[_0x5a644c][_0x1dc9('0x27')]]=[_0x1dc9('0x2a'),_0x10f8fa[_0x1dc9('0x21')],_0x10f8fa[_0x1dc9('0x28')]][_0x1dc9('0x2b')]('/');break;case'options':_0x10f8fa[_0x1dc9('0x22')]=_0x242566[_0x5104c0[_0x5a644c]['param']];if(_0x55ff0a[_0x1dc9('0x1c')]!==_0x1dc9('0x1d')){if(_0x10f8fa[_0x1dc9('0x22')][_0x1dc9('0x2c')](_0x1dc9('0x2d'))<0x0){_0x10f8fa[_0x1dc9('0x22')]+=_0x1dc9('0x2d');}}else{_0x10f8fa['options']=_0x10f8fa[_0x1dc9('0x22')][_0x1dc9('0x2e')](_0x1dc9('0x2d'),'');}_0x44ae0c[_0x5104c0[_0x5a644c][_0x1dc9('0x27')]]=_0x10f8fa['options'];break;default:_0x44ae0c[_0x5104c0[_0x5a644c][_0x1dc9('0x27')]]=_0x242566[_0x5104c0[_0x5a644c][_0x1dc9('0x27')]];}}return _0x44ae0c[_0x1dc9('0x2b')](',');}function _0x3def87(_0x1d32c7,_0x496f45,_0x5eead6){return new Promise(function(_0x4e0a5f,_0x1ff189){var _0x2ccf9f=[];if(_[_0x1dc9('0x2f')](_0x496f45))return _0x4e0a5f(_0x2ccf9f);_0x1ef0bb[_0x1dc9('0x30')][_0x1dc9('0x31')]({'attributes':['id',_0x1dc9('0x32'),_0x1dc9('0x33')],'raw':!![]})[_0x1dc9('0x34')](function(_0x3eb6d5){for(var _0x3a422d=0x0,_0x1ec1a0=0x0;_0x3a422d<_0x496f45[_0x1dc9('0x25')];_0x3a422d++,_0x1ec1a0=0x0){var _0x162163=_0x496f45[_0x3a422d];var _0x2986e1=[];var _0x4e2a11=[];delete _0x162163['id'];if(_0x162163[_0x1dc9('0x32')]!==_0x1dc9('0x35')){_0x162163[_0x1dc9('0x36')]=[_0x162163[_0x1dc9('0x32')]];}else{_0x162163[_0x1dc9('0x36')]=_0x162163['IntervalId']?_[_0x1dc9('0x37')](_[_0x1dc9('0x38')](_0x3eb6d5,{'IntervalId':_0x162163[_0x1dc9('0x33')]}),_0x1dc9('0x32')):[];}_0x162163['context']=_0x1d32c7[_0x1dc9('0x5')];_0x162163[_0x1dc9('0x6')]=_0x1d32c7[_0x1dc9('0x6')];if(_0x162163[_0x1dc9('0x3')])_0x162163[_0x1dc9('0x3')]=_0x162163['type'][_0x1dc9('0x39')]();if(_0x1d32c7[_0x1dc9('0x3')]===_0x1dc9('0x10')){if(_0x162163[_0x1dc9('0x3a')](_0x1dc9('0x3b'))&&_0x162163[_0x1dc9('0x3b')]&&_0x162163[_0x1dc9('0x3b')]!=='--'){_0x2986e1[_0x1dc9('0xb')]({'type':_0x162163['type'][_0x1dc9('0x39')](),'app':_0x1dc9('0x7'),'appdata':'CDR(tag)='+_0x162163[_0x1dc9('0x3b')],'context':_0x1d32c7[_0x1dc9('0x5')],'exten':_0x1d32c7[_0x1dc9('0x6')],'priority':_0x162163['intervals'][_0x1dc9('0x25')]+_0x5eead6+_0x1ec1a0++,'VoiceExtensionId':_0x1d32c7['id']});}_0x2986e1[_0x1dc9('0xb')]({'type':_0x162163[_0x1dc9('0x3')][_0x1dc9('0x39')](),'app':'ExecIf','appdata':_0x1dc9('0x3c')+(_0x162163[_0x1dc9('0x3d')]?'Set(CALLERID(all)='+_0x162163[_0x1dc9('0x3d')]+')':'NoOp(No\x20number\x20available)'),'context':_0x1d32c7[_0x1dc9('0x5')],'exten':_0x1d32c7[_0x1dc9('0x6')],'priority':_0x162163[_0x1dc9('0x36')][_0x1dc9('0x25')]+_0x5eead6+_0x1ec1a0++,'VoiceExtensionId':_0x1d32c7['id']});}else{if(_0x162163[_0x1dc9('0x3a')](_0x1dc9('0x3e'))){if([_0x1dc9('0x3f'),_0x1dc9('0x40')][_0x1dc9('0x41')](_0x162163[_0x1dc9('0x42')][_0x1dc9('0x39')]())&&_0x162163['appType']!=='custom'){if(_0x162163[_0x1dc9('0x3e')]){_0x2986e1[_0x1dc9('0xb')]({'type':_0x162163[_0x1dc9('0x3')][_0x1dc9('0x39')](),'app':_0x1dc9('0x17'),'appdata':_0x1dc9('0x43'),'context':_0x1d32c7['context'],'exten':_0x1d32c7[_0x1dc9('0x6')],'priority':_0x162163[_0x1dc9('0x36')][_0x1dc9('0x25')]+_0x5eead6+_0x1ec1a0++,'VoiceExtensionId':_0x1d32c7['id']});_0x2986e1['push']({'type':_0x162163[_0x1dc9('0x3')][_0x1dc9('0x39')](),'app':_0x1dc9('0x7'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1d32c7[_0x1dc9('0x5')],'exten':_0x1d32c7[_0x1dc9('0x6')],'priority':_0x162163[_0x1dc9('0x36')]['length']+_0x5eead6+_0x1ec1a0++,'VoiceExtensionId':_0x1d32c7['id']});}else{_0x2986e1['push']({'type':_0x162163[_0x1dc9('0x3')][_0x1dc9('0x39')](),'app':_0x1dc9('0x17'),'appdata':_0x1dc9('0x44'),'context':_0x1d32c7['context'],'exten':_0x1d32c7['exten'],'priority':_0x162163[_0x1dc9('0x36')]['length']+_0x5eead6+_0x1ec1a0++,'VoiceExtensionId':_0x1d32c7['id']});_0x2986e1[_0x1dc9('0xb')]({'type':_0x162163['type'][_0x1dc9('0x39')](),'app':_0x1dc9('0x7'),'appdata':_0x1dc9('0x45'),'context':_0x1d32c7[_0x1dc9('0x5')],'exten':_0x1d32c7['exten'],'priority':_0x162163[_0x1dc9('0x36')][_0x1dc9('0x25')]+_0x5eead6+_0x1ec1a0++,'VoiceExtensionId':_0x1d32c7['id']});}}}}for(var _0xd0e039=0x0;_0xd0e039<_0x162163[_0x1dc9('0x36')][_0x1dc9('0x25')];_0xd0e039++){var _0xbe8ac9=_0x5eead6+_0x162163[_0x1dc9('0x36')][_0x1dc9('0x25')];var _0x179582=_0xd0e039===_0x162163[_0x1dc9('0x36')][_0x1dc9('0x25')]-0x1?_0x5eead6+_0x2986e1['length']+_0x4e2a11[_0x1dc9('0x25')]+0x2:_0x5eead6+_0xd0e039+0x1;_0x2986e1['splice'](_0xd0e039,0x0,{'type':_0x1d32c7[_0x1dc9('0x3')],'app':'GotoIfTime','appdata':_0x162163['intervals'][_0xd0e039]+'?'+_0x1d32c7[_0x1dc9('0x5')]+_0x1dc9('0x46')+_0xbe8ac9+':'+_0x1d32c7[_0x1dc9('0x5')]+',${EXTEN},'+_0x179582,'exten':_0x1d32c7[_0x1dc9('0x6')],'context':_0x1d32c7[_0x1dc9('0x5')],'priority':_0x5eead6+_0xd0e039,'VoiceExtensionId':_0x1d32c7['id']});}if(_0x162163[_0x1dc9('0x47')]===_0x1dc9('0x48')){_0x162163[_0x1dc9('0x49')]=_0x1fb5de(_0x1d32c7,_0x162163[_0x1dc9('0x49')]);}if(_0x162163[_0x1dc9('0x47')]===_0x1dc9('0x4a')){_0x2986e1['push']({'type':_0x162163[_0x1dc9('0x3')]['toLowerCase'](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x1d32c7['context'],'exten':_0x1d32c7['exten'],'priority':_0x162163[_0x1dc9('0x36')][_0x1dc9('0x25')]+_0x5eead6+_0x1ec1a0++,'VoiceExtensionId':_0x1d32c7['id']});}_0x162163[_0x1dc9('0x4b')]=_0x2986e1[_0x1dc9('0x25')]?_[_0x1dc9('0x4c')](_0x2986e1)[_0x1dc9('0x4b')]+0x1:_0x5eead6;_0x2ccf9f=_[_0x1dc9('0x4d')](_0x2ccf9f,_0x2986e1,[_0x162163],_0x4e2a11);_0x5eead6=_[_0x1dc9('0x4c')](_0x2ccf9f)['priority']+0x1;}return _0x4e0a5f(_0x2ccf9f);})['catch'](function(_0x3185cc){_0x1ff189(_0x3185cc);});});}return _0x2b4f65[_0x1dc9('0x4e')]('VoiceExtension',attributes,{'tableName':_0x1dc9('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x25c228){var _0x2e687b=this['get']({'plain':!![]});var _0x38c1e0=_0x2e687b[_0x1dc9('0x3')]===_0x1dc9('0x10')?_0x2da7a9(_0x2e687b):_0x198b5c(_0x2e687b);return _0x3def87(_0x2e687b,_0x25c228,_[_0x1dc9('0x4c')](_0x38c1e0)[_0x1dc9('0x4b')]+0x1)['then'](function(_0x2fc797){var _0x3ccfde=_['concat'](_0x38c1e0,_0x2fc797);_0x3ccfde[_0x1dc9('0xb')]({'type':_0x2e687b[_0x1dc9('0x3')],'app':_0x1dc9('0x50'),'exten':_0x2e687b[_0x1dc9('0x6')],'context':_0x2e687b['context'],'priority':_['last'](_0x3ccfde)['priority']+0x1,'VoiceExtensionId':_0x2e687b['id']});return _0x3ccfde;});}}});}; \ No newline at end of file +var _0x0848=['custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','define','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','exports','models','Set','type','exten','alias','NoOp','No\x20alias\x20set','context','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','CDR(type)=outbound','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','recordingFormat','none','push','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','name','param','phone','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','length','intervals','map','toLowerCase','hasOwnProperty','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType'];(function(_0x3ed25a,_0xb6a908){var _0x464480=function(_0x4b84e3){while(--_0x4b84e3){_0x3ed25a['push'](_0x3ed25a['shift']());}};_0x464480(++_0xb6a908);}(_0x0848,0x15d));var _0x8084=function(_0x42d6ac,_0x361177){_0x42d6ac=_0x42d6ac-0x0;var _0x13838b=_0x0848[_0x42d6ac];return _0x13838b;};'use strict';var _=require('lodash');var attributes=require(_0x8084('0x0'));module[_0x8084('0x1')]=function(_0x4501e8){var _0x1e6138=_0x4501e8[_0x8084('0x2')];function _0x1751d1(_0x334860){var _0x5133e8=0x2;var _0x353d88=[{'type':_0x334860['type'],'app':_0x8084('0x3'),'appdata':'CDR(type)='+_0x334860[_0x8084('0x4')],'context':_0x334860['context'],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']},{'type':_0x334860[_0x8084('0x4')],'app':_0x334860[_0x8084('0x6')]?_0x8084('0x3'):_0x8084('0x7'),'appdata':_0x334860[_0x8084('0x6')]?'CDR(routeAlias)='+_0x334860[_0x8084('0x6')]:_0x8084('0x8'),'context':_0x334860[_0x8084('0x9')],'exten':_0x334860['exten'],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']}];if(_0x334860[_0x8084('0x4')]===_0x8084('0xa')){_0x353d88['push']({'type':'inbound','app':'Set','appdata':_0x8084('0xb')+_0x334860['id'],'context':_0x334860['context'],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']});}_0x353d88['push']({'type':_0x334860[_0x8084('0x4')],'app':'Set','appdata':_0x8084('0xc'),'context':_0x334860[_0x8084('0x9')],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']},{'type':_0x334860[_0x8084('0x4')],'app':'Set','appdata':_0x8084('0xd'),'context':_0x334860['context'],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']},{'type':_0x334860[_0x8084('0x4')],'app':_0x8084('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x334860[_0x8084('0x9')],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']});return _0x353d88;}function _0x3ef3e1(_0xd5a45d){var _0xc27461=0x2;var _0x1d7a68=[{'type':'outbound','app':_0x8084('0x3'),'appdata':_0x8084('0xe'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0xd5a45d[_0x8084('0x6')]?_0x8084('0x3'):_0x8084('0x7'),'appdata':_0xd5a45d[_0x8084('0x6')]?_0x8084('0x10')+_0xd5a45d[_0x8084('0x6')]:_0x8084('0x8'),'context':_0xd5a45d['context'],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0x11')+(_0xd5a45d[_0x8084('0x12')]?_0x8084('0x13')+_0xd5a45d[_0x8084('0x12')]+'}':_0x8084('0x14')),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0xb')+_0xd5a45d['id'],'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d['exten'],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':'ExecIf','appdata':_0x8084('0x15')+(_0xc27461+0x2)+_0x8084('0x16')+(_0xc27461+0x1)+')','context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0xd5a45d['cutdigits']?_0x8084('0x17')+_0xd5a45d[_0x8084('0x12')]+'}':_0x8084('0x18'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':'outbound','app':_0x8084('0x3'),'appdata':_0x8084('0xc'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':'outbound','app':_0x8084('0x3'),'appdata':_0x8084('0x19'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':'outboundrouteid='+_0xd5a45d['id'],'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d['exten'],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']}];if(_0xd5a45d['hasOwnProperty']('recordingFormat')&&_0xd5a45d[_0x8084('0x1a')]!==_0x8084('0x1b')){_0x1d7a68[_0x8084('0x1c')]({'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0x1d'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0x1e')+_0xd5a45d[_0x8084('0x1a')]||_0x8084('0x1f'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']});}return _0x1d7a68;}function _0x8d0739(_0x1734c7,_0x236db3){var _0xf08f63=[{'name':_0x8084('0x20'),'param':0x0},{'name':_0x8084('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x8084('0x22'),'param':0x3}];var _0x28cec3={};var _0x4f76d9=_0x236db3[_0x8084('0x23')](',');var _0x2091a5=[];for(var _0x54ef2c=0x0;_0x54ef2c<_0xf08f63['length'];_0x54ef2c++){switch(_0xf08f63[_0x54ef2c][_0x8084('0x24')]){case _0x8084('0x20'):_0x28cec3[_0x8084('0x20')]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]][_0x8084('0x23')]('/')[0x1];_0x28cec3[_0x8084('0x26')]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]][_0x8084('0x23')]('/')[0x2];_0x28cec3[_0x8084('0x27')]=_0x28cec3[_0x8084('0x26')]?_0x28cec3[_0x8084('0x26')][_0x8084('0x23')]('$')[0x0]:undefined;_0x28cec3[_0x8084('0x26')]=_0x1734c7['cutdigits']?(_0x28cec3[_0x8084('0x27')]||'')+'${EXTEN:'+_0x1734c7[_0x8084('0x12')]+'}':(_0x28cec3[_0x8084('0x27')]||'')+'${EXTEN}';_0x2091a5[_0xf08f63[_0x54ef2c][_0x8084('0x25')]]=[_0x8084('0x28'),_0x28cec3[_0x8084('0x20')],_0x28cec3[_0x8084('0x26')]][_0x8084('0x29')]('/');break;case _0x8084('0x2a'):_0x28cec3[_0x8084('0x2a')]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]];if(_0x1734c7[_0x8084('0x1a')]!=='none'){if(_0x28cec3['options'][_0x8084('0x2b')](_0x8084('0x2c'))<0x0){_0x28cec3[_0x8084('0x2a')]+=_0x8084('0x2c');}}else{_0x28cec3['options']=_0x28cec3['options'][_0x8084('0x2d')](_0x8084('0x2c'),'');}_0x2091a5[_0xf08f63[_0x54ef2c][_0x8084('0x25')]]=_0x28cec3[_0x8084('0x2a')];break;default:_0x2091a5[_0xf08f63[_0x54ef2c][_0x8084('0x25')]]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]];}}return _0x2091a5[_0x8084('0x29')](',');}function _0x15ef30(_0x3827af,_0x514969,_0x29752c){return new Promise(function(_0x4d1e56,_0xc91f75){var _0x19dec9=[];if(_['isEmpty'](_0x514969))return _0x4d1e56(_0x19dec9);_0x1e6138[_0x8084('0x2e')][_0x8084('0x2f')]({'attributes':['id',_0x8084('0x30'),_0x8084('0x31')],'raw':!![]})[_0x8084('0x32')](function(_0x4597d1){for(var _0x2c4301=0x0,_0x3f584e=0x0;_0x2c4301<_0x514969[_0x8084('0x33')];_0x2c4301++,_0x3f584e=0x0){var _0x4be6a8=_0x514969[_0x2c4301];var _0x10854c=[];var _0x4a97ff=[];delete _0x4be6a8['id'];if(_0x4be6a8['interval']!=='*,*,*,*'){_0x4be6a8[_0x8084('0x34')]=[_0x4be6a8['interval']];}else{_0x4be6a8[_0x8084('0x34')]=_0x4be6a8[_0x8084('0x31')]?_[_0x8084('0x35')](_['filter'](_0x4597d1,{'IntervalId':_0x4be6a8[_0x8084('0x31')]}),'interval'):[];}_0x4be6a8[_0x8084('0x9')]=_0x3827af[_0x8084('0x9')];_0x4be6a8[_0x8084('0x5')]=_0x3827af[_0x8084('0x5')];if(_0x4be6a8['type'])_0x4be6a8['type']=_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')]();if(_0x3827af[_0x8084('0x4')]===_0x8084('0xf')){if(_0x4be6a8[_0x8084('0x37')](_0x8084('0x38'))&&_0x4be6a8[_0x8084('0x38')]&&_0x4be6a8[_0x8084('0x38')]!=='--'){_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':'CDR(tag)='+_0x4be6a8[_0x8084('0x38')],'context':_0x3827af['context'],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8['intervals']['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8['type']['toLowerCase'](),'app':_0x8084('0x39'),'appdata':_0x8084('0x3a')+(_0x4be6a8[_0x8084('0x3b')]?'Set(CALLERID(all)='+_0x4be6a8[_0x8084('0x3b')]+')':_0x8084('0x3c')),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8[_0x8084('0x34')]['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}else{if(_0x4be6a8[_0x8084('0x37')]('answer')){if([_0x8084('0x3d'),_0x8084('0x3e')][_0x8084('0x3f')](_0x4be6a8[_0x8084('0x40')][_0x8084('0x36')]())&&_0x4be6a8[_0x8084('0x41')]!==_0x8084('0x42')){if(_0x4be6a8['answer']){_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8['type']['toLowerCase'](),'app':_0x8084('0x39'),'appdata':_0x8084('0x43'),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8['intervals'][_0x8084('0x33')]+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8['type'][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':_0x8084('0x44'),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af['exten'],'priority':_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')]+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}else{_0x10854c['push']({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x39'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')]+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':_0x8084('0x45'),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8['intervals']['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}}}}for(var _0x3dc1d6=0x0;_0x3dc1d6<_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')];_0x3dc1d6++){var _0x576838=_0x29752c+_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')];var _0x3fe8a0=_0x3dc1d6===_0x4be6a8[_0x8084('0x34')]['length']-0x1?_0x29752c+_0x10854c[_0x8084('0x33')]+_0x4a97ff[_0x8084('0x33')]+0x2:_0x29752c+_0x3dc1d6+0x1;_0x10854c[_0x8084('0x46')](_0x3dc1d6,0x0,{'type':_0x3827af['type'],'app':_0x8084('0x47'),'appdata':_0x4be6a8['intervals'][_0x3dc1d6]+'?'+_0x3827af[_0x8084('0x9')]+',${EXTEN},'+_0x576838+':'+_0x3827af[_0x8084('0x9')]+',${EXTEN},'+_0x3fe8a0,'exten':_0x3827af['exten'],'context':_0x3827af[_0x8084('0x9')],'priority':_0x29752c+_0x3dc1d6,'VoiceExtensionId':_0x3827af['id']});}if(_0x4be6a8['appType']===_0x8084('0x48')){_0x4be6a8[_0x8084('0x49')]=_0x8d0739(_0x3827af,_0x4be6a8[_0x8084('0x49')]);}if(_0x4be6a8[_0x8084('0x41')]==='agi'){_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':_0x8084('0x4a'),'context':_0x3827af['context'],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8[_0x8084('0x34')]['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}_0x4be6a8[_0x8084('0x4b')]=_0x10854c['length']?_[_0x8084('0x4c')](_0x10854c)['priority']+0x1:_0x29752c;_0x19dec9=_['concat'](_0x19dec9,_0x10854c,[_0x4be6a8],_0x4a97ff);_0x29752c=_[_0x8084('0x4c')](_0x19dec9)[_0x8084('0x4b')]+0x1;}return _0x4d1e56(_0x19dec9);})[_0x8084('0x4d')](function(_0xdad17a){_0xc91f75(_0xdad17a);});});}return _0x4501e8[_0x8084('0x4e')](_0x8084('0x4f'),attributes,{'tableName':_0x8084('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x228a48){var _0x50d149=this[_0x8084('0x51')]({'plain':!![]});var _0x1c4f3f=_0x50d149['type']==='outbound'?_0x3ef3e1(_0x50d149):_0x1751d1(_0x50d149);return _0x15ef30(_0x50d149,_0x228a48,_[_0x8084('0x4c')](_0x1c4f3f)[_0x8084('0x4b')]+0x1)[_0x8084('0x32')](function(_0x1e7ceb){var _0x12d32e=_['concat'](_0x1c4f3f,_0x1e7ceb);_0x12d32e[_0x8084('0x1c')]({'type':_0x50d149[_0x8084('0x4')],'app':_0x8084('0x52'),'exten':_0x50d149[_0x8084('0x5')],'context':_0x50d149[_0x8084('0x9')],'priority':_[_0x8084('0x4c')](_0x12d32e)[_0x8084('0x4b')]+0x1,'VoiceExtensionId':_0x50d149['id']});return _0x12d32e;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index b5e36c8..de9b564 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 _0x2bd8=['attributes','limit','map','include','model','then','debug','GetVoiceExtension','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','where'];(function(_0x51735a,_0x3db5e4){var _0x51fcf4=function(_0x223905){while(--_0x223905){_0x51735a['push'](_0x51735a['shift']());}};_0x51fcf4(++_0x3db5e4);}(_0x2bd8,0x130));var _0x82bd=function(_0x10c61b,_0xd30677){_0x10c61b=_0x10c61b-0x0;var _0xe803e8=_0x2bd8[_0x10c61b];return _0xe803e8;};'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});config[_0x82bd('0xb')]=_[_0x82bd('0xc')](config[_0x82bd('0xb')],{'host':_0x82bd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82bd('0xb')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x51c6ea,_0x5bb22c,_0x5f0434){return new BPromise(function(_0x4c9430,_0x36abe3){return client['request'](_0x51c6ea,_0x5f0434)['then'](function(_0x32821a){logger[_0x82bd('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x5bb22c,_0x82bd('0xf'));logger['debug'](_0x82bd('0x10'),_0x5bb22c,'request\x20sent',JSON[_0x82bd('0x11')](_0x32821a));if(_0x32821a[_0x82bd('0x12')]){if(_0x32821a[_0x82bd('0x12')][_0x82bd('0x13')]===0x1f4){logger['error'](_0x82bd('0x14'),_0x5bb22c,_0x32821a[_0x82bd('0x12')]['message']);return _0x36abe3(_0x32821a[_0x82bd('0x12')]['message']);}logger[_0x82bd('0x12')](_0x82bd('0x14'),_0x5bb22c,_0x32821a[_0x82bd('0x12')][_0x82bd('0x15')]);return _0x4c9430(_0x32821a[_0x82bd('0x12')][_0x82bd('0x15')]);}else{logger[_0x82bd('0xe')](_0x82bd('0x14'),_0x5bb22c,_0x82bd('0xf'));_0x4c9430(_0x32821a[_0x82bd('0x16')][_0x82bd('0x15')]);}})[_0x82bd('0x17')](function(_0x1c3779){logger[_0x82bd('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x5bb22c,_0x1c3779);_0x36abe3(_0x1c3779);});});}exports['GetVoiceExtension']=function(_0x283ce7){var _0x3eb844=this;return new Promise(function(_0x2ee27c,_0xc9fcdf){return db[_0x82bd('0x18')][_0x82bd('0x19')]({'raw':_0x283ce7[_0x82bd('0x1a')]?_0x283ce7[_0x82bd('0x1a')][_0x82bd('0x1b')]===undefined?!![]:![]:!![],'where':_0x283ce7[_0x82bd('0x1a')]?_0x283ce7[_0x82bd('0x1a')][_0x82bd('0x1c')]||null:null,'attributes':_0x283ce7[_0x82bd('0x1a')]?_0x283ce7[_0x82bd('0x1a')][_0x82bd('0x1d')]||null:null,'limit':_0x283ce7[_0x82bd('0x1a')]?_0x283ce7[_0x82bd('0x1a')][_0x82bd('0x1e')]||null:null,'include':_0x283ce7[_0x82bd('0x1a')]?_0x283ce7['options']['include']?_[_0x82bd('0x1f')](_0x283ce7[_0x82bd('0x1a')][_0x82bd('0x20')],function(_0x3eb6a5){return{'model':db[_0x3eb6a5[_0x82bd('0x21')]],'as':_0x3eb6a5['as'],'attributes':_0x3eb6a5[_0x82bd('0x1d')],'include':_0x3eb6a5[_0x82bd('0x20')]?_[_0x82bd('0x1f')](_0x3eb6a5[_0x82bd('0x20')],function(_0x2add80){return{'model':db[_0x2add80['model']],'as':_0x2add80['as'],'attributes':_0x2add80['attributes'],'include':_0x2add80['include']?_['map'](_0x2add80[_0x82bd('0x20')],function(_0x52bcd8){return{'model':db[_0x52bcd8[_0x82bd('0x21')]],'as':_0x52bcd8['as'],'attributes':_0x52bcd8[_0x82bd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x82bd('0x22')](function(_0x50585e){logger['info']('GetVoiceExtension',_0x283ce7);logger[_0x82bd('0x23')](_0x82bd('0x24'),_0x283ce7,JSON[_0x82bd('0x11')](_0x50585e));_0x2ee27c(_0x50585e);})['catch'](function(_0x166c46){logger['error'](_0x82bd('0x24'),_0x166c46[_0x82bd('0x15')],_0x283ce7);_0xc9fcdf(_0x3eb844[_0x82bd('0x12')](0x1f4,_0x166c46[_0x82bd('0x15')]));});});}; \ No newline at end of file +var _0x9e54=['lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceExtension,\x20%s,\x20%s','result','catch','findAll','options','raw','attributes','limit','include','model','map','GetVoiceExtension'];(function(_0x35af01,_0x4b407e){var _0x53de18=function(_0x83957c){while(--_0x83957c){_0x35af01['push'](_0x35af01['shift']());}};_0x53de18(++_0x4b407e);}(_0x9e54,0x88));var _0x49e5=function(_0x1e3dae,_0x13e381){_0x1e3dae=_0x1e3dae-0x0;var _0xdc7cc6=_0x9e54[_0x1e3dae];return _0xdc7cc6;};'use strict';var _=require(_0x49e5('0x0'));var util=require(_0x49e5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49e5('0x2'));var db=require(_0x49e5('0x3'))['db'];var utils=require(_0x49e5('0x4'));var logger=require('../../config/logger')(_0x49e5('0x5'));var config=require(_0x49e5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49e5('0x7')]['http']({'port':0x232a});config['redis']=_[_0x49e5('0x8')](config['redis'],{'host':_0x49e5('0x9'),'port':0x18eb});var socket=require(_0x49e5('0xa'))(new Redis(config[_0x49e5('0xb')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x3cee11,_0x5e0dfa,_0x45c7cd){return new BPromise(function(_0x22aec5,_0x134034){return client[_0x49e5('0xc')](_0x3cee11,_0x45c7cd)[_0x49e5('0xd')](function(_0x51cf9b){logger[_0x49e5('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x5e0dfa,_0x49e5('0xf'));logger[_0x49e5('0x10')](_0x49e5('0x11'),_0x5e0dfa,_0x49e5('0xf'),JSON[_0x49e5('0x12')](_0x51cf9b));if(_0x51cf9b['error']){if(_0x51cf9b['error'][_0x49e5('0x13')]===0x1f4){logger[_0x49e5('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x5e0dfa,_0x51cf9b['error'][_0x49e5('0x15')]);return _0x134034(_0x51cf9b['error'][_0x49e5('0x15')]);}logger['error'](_0x49e5('0x16'),_0x5e0dfa,_0x51cf9b[_0x49e5('0x14')][_0x49e5('0x15')]);return _0x22aec5(_0x51cf9b['error'][_0x49e5('0x15')]);}else{logger[_0x49e5('0xe')](_0x49e5('0x16'),_0x5e0dfa,_0x49e5('0xf'));_0x22aec5(_0x51cf9b[_0x49e5('0x17')][_0x49e5('0x15')]);}})[_0x49e5('0x18')](function(_0x4dca4f){logger[_0x49e5('0x14')](_0x49e5('0x16'),_0x5e0dfa,_0x4dca4f);_0x134034(_0x4dca4f);});});}exports['GetVoiceExtension']=function(_0x2370ad){var _0x5b13ed=this;return new Promise(function(_0x305b4c,_0x2b1bbe){return db['VoiceExtension'][_0x49e5('0x19')]({'raw':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')][_0x49e5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')]['where']||null:null,'attributes':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad['options'][_0x49e5('0x1c')]||null:null,'limit':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')][_0x49e5('0x1d')]||null:null,'include':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')]['include']?_['map'](_0x2370ad[_0x49e5('0x1a')][_0x49e5('0x1e')],function(_0x5531bf){return{'model':db[_0x5531bf[_0x49e5('0x1f')]],'as':_0x5531bf['as'],'attributes':_0x5531bf[_0x49e5('0x1c')],'include':_0x5531bf[_0x49e5('0x1e')]?_[_0x49e5('0x20')](_0x5531bf[_0x49e5('0x1e')],function(_0x21b29a){return{'model':db[_0x21b29a['model']],'as':_0x21b29a['as'],'attributes':_0x21b29a[_0x49e5('0x1c')],'include':_0x21b29a[_0x49e5('0x1e')]?_[_0x49e5('0x20')](_0x21b29a['include'],function(_0x300754){return{'model':db[_0x300754['model']],'as':_0x300754['as'],'attributes':_0x300754[_0x49e5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x49e5('0xd')](function(_0x5a0e10){logger['info'](_0x49e5('0x21'),_0x2370ad);logger[_0x49e5('0x10')]('GetVoiceExtension',_0x2370ad,JSON[_0x49e5('0x12')](_0x5a0e10));_0x305b4c(_0x5a0e10);})['catch'](function(_0x36d49e){logger[_0x49e5('0x14')](_0x49e5('0x21'),_0x36d49e[_0x49e5('0x15')],_0x2370ad);_0x2b1bbe(_0x5b13ed[_0x49e5('0x14')](0x1f4,_0x36d49e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 1cc22e5..72a860c 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x465c4f,_0x18a72e){var _0x4d3933=function(_0x57787e){while(--_0x57787e){_0x465c4f['push'](_0x465c4f['shift']());}};_0x4d3933(++_0x18a72e);}(_0xe14b,0x93));var _0xbe14=function(_0x4df934,_0x4cb6c2){_0x4df934=_0x4df934-0x0;var _0x308ddd=_0xe14b[_0x4df934];return _0x308ddd;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x299a1c,_0x50668c){_0x299a1c=_0x299a1c-0x0;var _0x40530f=_0x1cb9[_0x299a1c];return _0x40530f;};'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 5d3db70..87ebe68 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 _0x9fd4=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/messages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd4,0x16c));var _0x49fd=function(_0xf5ed1b,_0x33a489){_0xf5ed1b=_0xf5ed1b-0x0;var _0x5ecbdb=_0x9fd4[_0xf5ed1b];return _0x5ecbdb;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/:id',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['getMessages']);router[_0x49fd('0xe')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x12')]);router['delete'](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x13')]);module[_0x49fd('0x14')]=router; \ No newline at end of file +var _0x187d=['/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show'];(function(_0x17a749,_0x40908b){var _0x10ee89=function(_0x487af7){while(--_0x487af7){_0x17a749['push'](_0x17a749['shift']());}};_0x10ee89(++_0x40908b);}(_0x187d,0x93));var _0xd187=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x187d[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a3a9d6d..38a9c6b 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 _0xce82=['fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','trim','yes','ENUM','TINYINT(4)','TIMESTAMP','VIRTUAL','getDataValue'];(function(_0x42a5c1,_0x1cb36d){var _0x105b3b=function(_0x4b303f){while(--_0x4b303f){_0x42a5c1['push'](_0x42a5c1['shift']());}};_0x105b3b(++_0x1cb36d);}(_0xce82,0x173));var _0x2ce8=function(_0x59ed79,_0x39b678){_0x59ed79=_0x59ed79-0x0;var _0x48f5e2=_0xce82[_0x59ed79];return _0x48f5e2;};'use strict';var Sequelize=require(_0x2ce8('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2ce8('0x1')],'defaultValue':_0x2ce8('0x2'),'unique':_0x2ce8('0x3')},'mailbox':{'type':Sequelize[_0x2ce8('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x2ce8('0x1')]},'fullname':{'type':Sequelize[_0x2ce8('0x1')]},'email':{'type':Sequelize[_0x2ce8('0x1')],'validate':{'isEmail':!![]},'set':function(_0x310832){this['setDataValue'](_0x2ce8('0x4'),typeof _0x310832===_0x2ce8('0x5')&&_0x310832[_0x2ce8('0x6')]()?_0x310832[_0x2ce8('0x6')]():null);}},'pager':{'type':Sequelize[_0x2ce8('0x1')]},'tz':{'type':Sequelize[_0x2ce8('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x2ce8('0x7'),'no'),'defaultValue':_0x2ce8('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x2ce8('0x8')](_0x2ce8('0x7'),'no'),'defaultValue':_0x2ce8('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x2ce8('0x1')]},'callback':{'type':Sequelize[_0x2ce8('0x1')]},'review':{'type':Sequelize[_0x2ce8('0x8')](_0x2ce8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2ce8('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2ce8('0x8')](_0x2ce8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x2ce8('0x8')](_0x2ce8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2ce8('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2ce8('0x8')](_0x2ce8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2ce8('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2ce8('0x8')]('yes','no'),'defaultValue':_0x2ce8('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x2ce8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x2ce8('0x8')](_0x2ce8('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2ce8('0x8')](_0x2ce8('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x2ce8('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2ce8('0xb')],'get':function(){return this[_0x2ce8('0xc')](_0x2ce8('0xd'))+_0x2ce8('0xe')+this[_0x2ce8('0xc')](_0x2ce8('0xf'));}}}; \ No newline at end of file +var _0xce8a=['getDataValue','fullname','\x20-\x20','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x41b167,_0x81b7d7){var _0x5b20b3=function(_0x41178b){while(--_0x41178b){_0x41b167['push'](_0x41b167['shift']());}};_0x5b20b3(++_0x81b7d7);}(_0xce8a,0x111));var _0xace8=function(_0x4ef3f8,_0x223c5d){_0x4ef3f8=_0x4ef3f8-0x0;var _0x5a46a2=_0xce8a[_0x4ef3f8];return _0x5a46a2;};'use strict';var Sequelize=require(_0xace8('0x0'));module[_0xace8('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xace8('0x2'),'unique':_0xace8('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xace8('0x3')},'password':{'type':Sequelize[_0xace8('0x4')]},'fullname':{'type':Sequelize[_0xace8('0x4')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x167af8){this[_0xace8('0x5')](_0xace8('0x6'),typeof _0x167af8==='string'&&_0x167af8['trim']()?_0x167af8[_0xace8('0x7')]():null);}},'pager':{'type':Sequelize[_0xace8('0x4')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xace8('0x8')},'attach':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xace8('0x4')]},'callback':{'type':Sequelize[_0xace8('0x4')]},'review':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xace8('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'stamp':{'type':_0xace8('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xace8('0x4')]},'maxsecs':{'type':Sequelize[_0xace8('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xace8('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xace8('0xe')],'get':function(){return this[_0xace8('0xf')](_0xace8('0x10'))+_0xace8('0x11')+this['getDataValue']('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f85e16c..3482a9e 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(_0x1008b7,_0x53512e){var _0x537757=function(_0x2dafe8){while(--_0x2dafe8){_0x1008b7['push'](_0x1008b7['shift']());}};_0x537757(++_0x53512e);}(_0x1be1,0x192));var _0x11be=function(_0x591e09,_0x4a63dd){_0x591e09=_0x591e09-0x0;var _0x591157=_0x1be1[_0x591e09];return _0x591157;};'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 _0x6e6c=['sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','find','create','user','UserProfileSection','autoAssociation','UserProfileResource','body','params','findOne','VoiceMailMessage','nolimit','mailbox','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x204c59,_0x5614ee){var _0x4cd35b=function(_0xf20241){while(--_0xf20241){_0x204c59['push'](_0x204c59['shift']());}};_0x4cd35b(++_0x5614ee);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){var _0x266786=_0x4c35ae[_0xc6e6('0x26')]({'plain':!![]});var _0x2e5e0e=_0xc6e6('0x27');return db['UserProfileResource'][_0xc6e6('0x25')]({'where':{'type':_0x2e5e0e,'resourceId':_0x266786['id']}})['then'](function(){return _0x4c35ae;});})[_0xc6e6('0x24')](function(){_0x36ebfa['status'](0xcc)[_0xc6e6('0x28')]();});}};}function handleEntityNotFound(_0x16dcd9,_0x348888){return function(_0x41e7c2){if(!_0x41e7c2){_0x16dcd9[_0xc6e6('0x17')](0x194);}return _0x41e7c2;};}function handleError(_0x5e34f6,_0x346480){_0x346480=_0x346480||0x1f4;return function(_0x1501bd){logger[_0xc6e6('0x29')](_0x1501bd[_0xc6e6('0x2a')]);if(_0x1501bd['name']){delete _0x1501bd[_0xc6e6('0x2b')];}_0x5e34f6['status'](_0x346480)[_0xc6e6('0x2c')](_0x1501bd);};}exports[_0xc6e6('0x2d')]=function(_0x12c616,_0xc578b3){var _0xd3b63={},_0x402598={},_0x43ff9c={'count':0x0,'rows':[]};var _0x337442=_[_0xc6e6('0x2e')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')],function(_0x214d6a){return{'name':_0x214d6a[_0xc6e6('0x31')],'type':_0x214d6a[_0xc6e6('0x32')][_0xc6e6('0x33')]};});_0x402598[_0xc6e6('0x34')]=_[_0xc6e6('0x2e')](_0x337442,'name');_0x402598[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0x12c616['query']);_0x402598['filters']=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],_0x402598[_0xc6e6('0x35')]);_0xd3b63[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],qs['fields'](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0xd3b63[_0xc6e6('0x38')]=_0xd3b63['attributes']['length']?_0xd3b63[_0xc6e6('0x38')]:_0x402598[_0xc6e6('0x34')];if(!_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x3a')]('nolimit')){_0xd3b63['limit']=qs[_0xc6e6('0x1c')](_0x12c616['query'][_0xc6e6('0x1c')]);_0xd3b63['offset']=qs[_0xc6e6('0x1a')](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0xd3b63[_0xc6e6('0x3b')]=qs['sort'](_0x12c616['query'][_0xc6e6('0x3c')]);_0xd3b63[_0xc6e6('0x3d')]=qs[_0xc6e6('0x3e')](_[_0xc6e6('0x3f')](_0x12c616['query'],_0x402598['filters']),_0x337442);if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]){_0xd3b63[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0xd3b63['where'],{'$or':_[_0xc6e6('0x2e')](_0x337442,function(_0x46c3ef){if(_0x46c3ef['type']!=='VIRTUAL'){var _0x2b01fd={};_0x2b01fd[_0x46c3ef['name']]={'$like':'%'+_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]+'%'};return _0x2b01fd;}})});}_0xd3b63=_['merge']({},_0xd3b63,_0x12c616[_0xc6e6('0x42')]);var _0x50c96d={'where':_0xd3b63[_0xc6e6('0x3d')]};return db['VoiceMail'][_0xc6e6('0x1d')](_0x50c96d)[_0xc6e6('0x24')](function(_0x247076){_0x43ff9c[_0xc6e6('0x1d')]=_0x247076;if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x43')]){_0xd3b63[_0xc6e6('0x44')]=[{'all':!![]}];}return db[_0xc6e6('0x2f')][_0xc6e6('0x45')](_0xd3b63);})['then'](function(_0x3e3da6){_0x43ff9c[_0xc6e6('0x46')]=_0x3e3da6;return _0x43ff9c;})[_0xc6e6('0x24')](respondWithFilteredResult(_0xc578b3,_0xd3b63))[_0xc6e6('0x47')](handleError(_0xc578b3,null));};exports['show']=function(_0xc5f4fb,_0x825640){var _0x3a46ee={'raw':!![],'where':{'id':_0xc5f4fb['params']['id']}},_0x2fa3c5={};_0x2fa3c5[_0xc6e6('0x34')]=_[_0xc6e6('0x36')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')]);_0x2fa3c5[_0xc6e6('0x35')]=_['keys'](_0xc5f4fb[_0xc6e6('0x35')]);_0x2fa3c5['filters']=_[_0xc6e6('0x37')](_0x2fa3c5['model'],_0x2fa3c5[_0xc6e6('0x35')]);_0x3a46ee[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x2fa3c5[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xc5f4fb[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0x3a46ee[_0xc6e6('0x38')]=_0x3a46ee['attributes'][_0xc6e6('0x48')]?_0x3a46ee[_0xc6e6('0x38')]:_0x2fa3c5[_0xc6e6('0x34')];if(_0xc5f4fb['query'][_0xc6e6('0x43')]){_0x3a46ee[_0xc6e6('0x44')]=[{'all':!![]}];}_0x3a46ee=_[_0xc6e6('0x41')]({},_0x3a46ee,_0xc5f4fb[_0xc6e6('0x42')]);return db[_0xc6e6('0x2f')][_0xc6e6('0x49')](_0x3a46ee)[_0xc6e6('0x24')](handleEntityNotFound(_0x825640,null))[_0xc6e6('0x24')](respondWithResult(_0x825640,null))[_0xc6e6('0x47')](handleError(_0x825640,null));};exports[_0xc6e6('0x4a')]=function(_0x3bfe85,_0x470167){return db[_0xc6e6('0x2f')][_0xc6e6('0x4a')](_0x3bfe85['body'],{})[_0xc6e6('0x24')](function(_0x5566df){var _0x2c48e7=_0x3bfe85[_0xc6e6('0x4b')]['get']({'plain':!![]});if(!_0x2c48e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c48e7['role']==='user'){var _0x531dca=_0x5566df[_0xc6e6('0x26')]({'plain':!![]});var _0x40bbe9=_0xc6e6('0x27');return db[_0xc6e6('0x4c')][_0xc6e6('0x49')]({'where':{'name':_0x40bbe9,'userProfileId':_0x2c48e7['userProfileId']},'raw':!![]})['then'](function(_0x335229){if(_0x335229&&_0x335229[_0xc6e6('0x4d')]===0x0){return db[_0xc6e6('0x4e')][_0xc6e6('0x4a')]({'name':_0x531dca['name'],'resourceId':_0x531dca['id'],'type':_0x335229[_0xc6e6('0x2b')],'sectionId':_0x335229['id']},{})[_0xc6e6('0x24')](function(){return _0x5566df;});}else{return _0x5566df;}})[_0xc6e6('0x47')](function(_0x286dcf){logger[_0xc6e6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x286dcf);throw _0x286dcf;});}return _0x5566df;})[_0xc6e6('0x24')](respondWithResult(_0x470167,0xc9))[_0xc6e6('0x47')](handleError(_0x470167,null));};exports[_0xc6e6('0x23')]=function(_0x5113e3,_0x3df0db){if(_0x5113e3[_0xc6e6('0x4f')]['id']){delete _0x5113e3[_0xc6e6('0x4f')]['id'];}return db[_0xc6e6('0x2f')][_0xc6e6('0x49')]({'where':{'id':_0x5113e3['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3df0db,null))[_0xc6e6('0x24')](saveUpdates(_0x5113e3[_0xc6e6('0x4f')],null))[_0xc6e6('0x24')](respondWithResult(_0x3df0db,null))[_0xc6e6('0x47')](handleError(_0x3df0db,null));};exports['destroy']=function(_0x5a7391,_0x58b09b){return db[_0xc6e6('0x2f')][_0xc6e6('0x49')]({'where':{'id':_0x5a7391[_0xc6e6('0x50')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x58b09b,null))[_0xc6e6('0x24')](removeEntity(_0x58b09b,null))[_0xc6e6('0x47')](handleError(_0x58b09b,null));};exports['getMessages']=function(_0xcd3d5d,_0x50f52a,_0x26f0e0){return db[_0xc6e6('0x2f')][_0xc6e6('0x51')]({'where':{'id':_0xcd3d5d['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x50f52a,null))['then'](function(_0x3b6822){var _0x50ac31;var _0x4a3bb1={},_0x18e101={};_0x18e101['model']=_['keys'](db[_0xc6e6('0x52')][_0xc6e6('0x30')]);_0x18e101[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0xcd3d5d[_0xc6e6('0x35')]);_0x18e101[_0xc6e6('0x3e')]=_[_0xc6e6('0x37')](_0x18e101[_0xc6e6('0x34')],_0x18e101['query']);_0x4a3bb1[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x18e101[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xcd3d5d['query'][_0xc6e6('0x39')]));_0x4a3bb1[_0xc6e6('0x38')]=_0x4a3bb1[_0xc6e6('0x38')]['length']?_0x4a3bb1['attributes']:_0x18e101[_0xc6e6('0x34')];if(!_0xcd3d5d['query']['hasOwnProperty'](_0xc6e6('0x53'))){_0x4a3bb1[_0xc6e6('0x1c')]=qs[_0xc6e6('0x1c')](_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x1c')]);_0x4a3bb1[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0x4a3bb1[_0xc6e6('0x3b')]=qs[_0xc6e6('0x3c')](_0xcd3d5d['query']['sort']);_0x4a3bb1[_0xc6e6('0x3d')]=qs['filters'](_['pick'](_0xcd3d5d[_0xc6e6('0x35')],_0x18e101[_0xc6e6('0x3e')]));if(_0xcd3d5d[_0xc6e6('0x35')]['filter']){_0x4a3bb1[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0x4a3bb1['where'],{'$or':_['map'](_0x4a3bb1[_0xc6e6('0x38')],function(_0x31329c){var _0x9d69b5={};_0x9d69b5[_0x31329c]={'$like':'%'+_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x40')]+'%'};return _0x9d69b5;})});}_0x4a3bb1[_0xc6e6('0x3d')]=_['merge'](_0x4a3bb1[_0xc6e6('0x3d')],{'mailboxuser':_0x3b6822[_0xc6e6('0x54')]});_0x4a3bb1=_[_0xc6e6('0x41')]({},_0x4a3bb1,_0xcd3d5d[_0xc6e6('0x42')]);return db[_0xc6e6('0x52')]['findAndCountAll'](_0x4a3bb1)[_0xc6e6('0x24')](respondWithFilteredResult(_0x50f52a,_0x4a3bb1));})[_0xc6e6('0x47')](handleError(_0x50f52a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f0978dd..d170697 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 _0x80b7=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util'];(function(_0x4260a7,_0x2df6d2){var _0x43a40a=function(_0x23f43c){while(--_0x23f43c){_0x4260a7['push'](_0x4260a7['shift']());}};_0x43a40a(++_0x2df6d2);}(_0x80b7,0x108));var _0x780b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80b7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x780b('0x0'));var util=require(_0x780b('0x1'));var logger=require('../../config/logger')(_0x780b('0x2'));var moment=require('moment');var BPromise=require(_0x780b('0x3'));var rp=require(_0x780b('0x4'));var fs=require('fs');var path=require(_0x780b('0x5'));var rimraf=require(_0x780b('0x6'));var config=require(_0x780b('0x7'));var attributes=require(_0x780b('0x8'));module['exports']=function(_0x198847,_0x2a4a5e){return _0x198847[_0x780b('0x9')](_0x780b('0xa'),attributes,{'tableName':_0x780b('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x780b('0xc'),_0x780b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9bce=['exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x5c74db,_0x478ac1){var _0x37ec4d=function(_0x4b2291){while(--_0x4b2291){_0x5c74db['push'](_0x5c74db['shift']());}};_0x37ec4d(++_0x478ac1);}(_0x9bce,0x151));var _0xe9bc=function(_0x3b2fbe,_0x3663ed){_0x3b2fbe=_0x3b2fbe-0x0;var _0x2834c9=_0x9bce[_0x3b2fbe];return _0x2834c9;};'use strict';var _=require('lodash');var util=require(_0xe9bc('0x0'));var logger=require(_0xe9bc('0x1'))(_0xe9bc('0x2'));var moment=require('moment');var BPromise=require(_0xe9bc('0x3'));var rp=require(_0xe9bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9bc('0x5'));var config=require(_0xe9bc('0x6'));var attributes=require(_0xe9bc('0x7'));module[_0xe9bc('0x8')]=function(_0x396721,_0x6fbf67){return _0x396721[_0xe9bc('0x9')](_0xe9bc('0xa'),attributes,{'tableName':_0xe9bc('0xb'),'paranoid':![],'indexes':[{'name':_0xe9bc('0xc'),'fields':[_0xe9bc('0xd'),_0xe9bc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 7268a6b..f3bebaa 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 _0x682a=['stringify','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x140395,_0x5efa83){var _0x1dc4f6=function(_0x472362){while(--_0x472362){_0x140395['push'](_0x140395['shift']());}};_0x1dc4f6(++_0x5efa83);}(_0x682a,0x1bb));var _0xa682=function(_0x2603e0,_0x58f256){_0x2603e0=_0x2603e0-0x0;var _0x1e7fa0=_0x682a[_0x2603e0];return _0x1e7fa0;};'use strict';var _=require(_0xa682('0x0'));var util=require('util');var moment=require(_0xa682('0x1'));var BPromise=require('bluebird');var rs=require(_0xa682('0x2'));var fs=require('fs');var Redis=require(_0xa682('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa682('0x4'));var logger=require('../../config/logger')(_0xa682('0x5'));var config=require(_0xa682('0x6'));var jayson=require(_0xa682('0x7'));var client=jayson[_0xa682('0x8')][_0xa682('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53b267,_0x387584,_0x5b6c96){return new BPromise(function(_0x65945c,_0x5037fb){return client[_0xa682('0xa')](_0x53b267,_0x5b6c96)[_0xa682('0xb')](function(_0x19d756){logger[_0xa682('0xc')](_0xa682('0xd'),_0x387584,_0xa682('0xe'));logger[_0xa682('0xf')](_0xa682('0x10'),_0x387584,_0xa682('0xe'),JSON[_0xa682('0x11')](_0x19d756));if(_0x19d756['error']){if(_0x19d756['error'][_0xa682('0x12')]===0x1f4){logger['error'](_0xa682('0xd'),_0x387584,_0x19d756[_0xa682('0x13')][_0xa682('0x14')]);return _0x5037fb(_0x19d756[_0xa682('0x13')]['message']);}logger[_0xa682('0x13')](_0xa682('0xd'),_0x387584,_0x19d756['error'][_0xa682('0x14')]);return _0x65945c(_0x19d756['error'][_0xa682('0x14')]);}else{logger[_0xa682('0xc')](_0xa682('0xd'),_0x387584,'request\x20sent');_0x65945c(_0x19d756[_0xa682('0x15')]['message']);}})[_0xa682('0x16')](function(_0x24aa51){logger[_0xa682('0x13')]('VoiceMail,\x20%s,\x20%s',_0x387584,_0x24aa51);_0x5037fb(_0x24aa51);});});} \ No newline at end of file +var _0xca7f=['then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x140c4c,_0x17b9ec){var _0x11ef65=function(_0x4f5ffc){while(--_0x4f5ffc){_0x140c4c['push'](_0x140c4c['shift']());}};_0x11ef65(++_0x17b9ec);}(_0xca7f,0x68));var _0xfca7=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xca7f[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xfca7('0x0'));var util=require(_0xfca7('0x1'));var moment=require(_0xfca7('0x2'));var BPromise=require('bluebird');var rs=require(_0xfca7('0x3'));var fs=require('fs');var Redis=require(_0xfca7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfca7('0x5'));var logger=require(_0xfca7('0x6'))('rpc');var config=require(_0xfca7('0x7'));var jayson=require(_0xfca7('0x8'));var client=jayson['client'][_0xfca7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a76ed,_0xd5b135,_0x5232e3){return new BPromise(function(_0x6ca47e,_0x3eac5a){return client[_0xfca7('0xa')](_0x5a76ed,_0x5232e3)[_0xfca7('0xb')](function(_0x1c165a){logger[_0xfca7('0xc')]('VoiceMail,\x20%s,\x20%s',_0xd5b135,_0xfca7('0xd'));logger[_0xfca7('0xe')](_0xfca7('0xf'),_0xd5b135,_0xfca7('0xd'),JSON[_0xfca7('0x10')](_0x1c165a));if(_0x1c165a[_0xfca7('0x11')]){if(_0x1c165a[_0xfca7('0x11')][_0xfca7('0x12')]===0x1f4){logger[_0xfca7('0x11')](_0xfca7('0x13'),_0xd5b135,_0x1c165a['error'][_0xfca7('0x14')]);return _0x3eac5a(_0x1c165a['error'][_0xfca7('0x14')]);}logger[_0xfca7('0x11')](_0xfca7('0x13'),_0xd5b135,_0x1c165a['error'][_0xfca7('0x14')]);return _0x6ca47e(_0x1c165a[_0xfca7('0x11')][_0xfca7('0x14')]);}else{logger[_0xfca7('0xc')]('VoiceMail,\x20%s,\x20%s',_0xd5b135,_0xfca7('0xd'));_0x6ca47e(_0x1c165a[_0xfca7('0x15')][_0xfca7('0x14')]);}})[_0xfca7('0x16')](function(_0x590d05){logger['error']('VoiceMail,\x20%s,\x20%s',_0xd5b135,_0x590d05);_0x3eac5a(_0x590d05);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9e7f897..92d170f 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 _0x1838=['create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','post'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x1838,0x15a));var _0x8183=function(_0x425e78,_0x496743){_0x425e78=_0x425e78-0x0;var _0x5d034a=_0x1838[_0x425e78];return _0x5d034a;};'use strict';var multer=require('multer');var util=require(_0x8183('0x0'));var path=require(_0x8183('0x1'));var timeout=require('connect-timeout');var express=require(_0x8183('0x2'));var router=express[_0x8183('0x3')]();var fs_extra=require(_0x8183('0x4'));var auth=require(_0x8183('0x5'));var interaction=require(_0x8183('0x6'));var config=require('../../config/environment');var controller=require(_0x8183('0x7'));router[_0x8183('0x8')]('/',auth[_0x8183('0x9')](),controller['index']);router[_0x8183('0x8')](_0x8183('0xa'),auth[_0x8183('0x9')](),controller[_0x8183('0xb')]);router[_0x8183('0x8')](_0x8183('0xc'),auth[_0x8183('0x9')](),controller['download']);router[_0x8183('0xd')]('/',auth[_0x8183('0x9')](),controller[_0x8183('0xe')]);router[_0x8183('0xf')](_0x8183('0xa'),auth[_0x8183('0x9')](),controller[_0x8183('0x10')]);router[_0x8183('0x11')](_0x8183('0xa'),auth['isAuthenticated'](),controller[_0x8183('0x12')]);module[_0x8183('0x13')]=router; \ No newline at end of file +var _0xdbf7=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','get','/:id','show','/:id/download','post','create','put','update','destroy'];(function(_0x4fb017,_0x2af811){var _0x59b1c9=function(_0x2bea51){while(--_0x2bea51){_0x4fb017['push'](_0x4fb017['shift']());}};_0x59b1c9(++_0x2af811);}(_0xdbf7,0x120));var _0x7dbf=function(_0x2384df,_0x44eefd){_0x2384df=_0x2384df-0x0;var _0x741672=_0xdbf7[_0x2384df];return _0x741672;};'use strict';var multer=require(_0x7dbf('0x0'));var util=require(_0x7dbf('0x1'));var path=require('path');var timeout=require(_0x7dbf('0x2'));var express=require(_0x7dbf('0x3'));var router=express[_0x7dbf('0x4')]();var fs_extra=require(_0x7dbf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7dbf('0x6'));var config=require('../../config/environment');var controller=require(_0x7dbf('0x7'));router['get']('/',auth[_0x7dbf('0x8')](),controller['index']);router[_0x7dbf('0x9')](_0x7dbf('0xa'),auth[_0x7dbf('0x8')](),controller[_0x7dbf('0xb')]);router[_0x7dbf('0x9')](_0x7dbf('0xc'),auth[_0x7dbf('0x8')](),controller['download']);router[_0x7dbf('0xd')]('/',auth['isAuthenticated'](),controller[_0x7dbf('0xe')]);router[_0x7dbf('0xf')](_0x7dbf('0xa'),auth['isAuthenticated'](),controller[_0x7dbf('0x10')]);router['delete'](_0x7dbf('0xa'),auth[_0x7dbf('0x8')](),controller[_0x7dbf('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6f5bcf8..c3a861b 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 _0x48ad=['STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','INTEGER'];(function(_0x3326b6,_0x4beb0d){var _0x5df1f5=function(_0x444c30){while(--_0x444c30){_0x3326b6['push'](_0x3326b6['shift']());}};_0x5df1f5(++_0x4beb0d);}(_0x48ad,0xe5));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd48a('0x0'));module['exports']={'name':{'type':Sequelize[_0xd48a('0x1')],'get':function(_0x23fe4e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xd48a('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xd48a('0x4')](_0xd48a('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd48a('0x3')],'defaultValue':''},'stamp':{'type':_0xd48a('0x6'),'defaultValue':Sequelize['literal'](_0xd48a('0x7'))}}; \ No newline at end of file +var _0x7b6b=['BLOB','long','literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x429f3f,_0x4c17d0){var _0x26491d=function(_0x3e7aed){while(--_0x3e7aed){_0x429f3f['push'](_0x429f3f['shift']());}};_0x26491d(++_0x4c17d0);}(_0x7b6b,0xf6));var _0xb7b6=function(_0x35ff9f,_0x501de5){_0x35ff9f=_0x35ff9f-0x0;var _0x9c0c7c=_0x7b6b[_0x35ff9f];return _0x9c0c7c;};'use strict';var Sequelize=require(_0xb7b6('0x0'));module[_0xb7b6('0x1')]={'name':{'type':Sequelize[_0xb7b6('0x2')],'get':function(_0x25f579){return this[_0xb7b6('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xb7b6('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xb7b6('0x6')](_0xb7b6('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb7b6('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 4bdb893..ec0abf8 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 _0xbbd7=['audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','msg_id','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','error','stack','name','index','map','VoiceMailMessage','fieldName','model','differenceBy','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','rawAttributes','length','includeAll','find','create','body','catch','destroy','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found'];(function(_0x27676b,_0x516bcd){var _0xfdb028=function(_0x93ee3a){while(--_0x93ee3a){_0x27676b['push'](_0x27676b['shift']());}};_0xfdb028(++_0x516bcd);}(_0xbbd7,0x1b9));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7bbd('0x0'));var zipdir=require(_0x7bbd('0x1'));var jsonpatch=require(_0x7bbd('0x2'));var rp=require(_0x7bbd('0x3'));var moment=require(_0x7bbd('0x4'));var BPromise=require(_0x7bbd('0x5'));var Mustache=require(_0x7bbd('0x6'));var util=require(_0x7bbd('0x7'));var path=require(_0x7bbd('0x8'));var sox=require(_0x7bbd('0x9'));var csv=require('to-csv');var ejs=require(_0x7bbd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7bbd('0xb'));var crypto=require(_0x7bbd('0xc'));var jsforce=require(_0x7bbd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7bbd('0xe'));var querystring=require(_0x7bbd('0xf'));var Papa=require(_0x7bbd('0x10'));var Redis=require(_0x7bbd('0x11'));var authService=require(_0x7bbd('0x12'));var qs=require(_0x7bbd('0x13'));var as=require(_0x7bbd('0x14'));var hardwareService=require(_0x7bbd('0x15'));var logger=require(_0x7bbd('0x16'))(_0x7bbd('0x17'));var utils=require('../../config/utils');var config=require(_0x7bbd('0x18'));var licenseUtil=require(_0x7bbd('0x19'));var db=require(_0x7bbd('0x1a'))['db'];function respondWithStatusCode(_0xf7d0ed,_0x76d4c6){_0x76d4c6=_0x76d4c6||0xcc;return function(_0xfc50b7){if(_0xfc50b7){return _0xf7d0ed[_0x7bbd('0x1b')](_0x76d4c6);}return _0xf7d0ed[_0x7bbd('0x1c')](_0x76d4c6)['end']();};}function respondWithResult(_0x2c6602,_0x120edc){_0x120edc=_0x120edc||0xc8;return function(_0x5a73f8){if(_0x5a73f8){return _0x2c6602['status'](_0x120edc)[_0x7bbd('0x1d')](_0x5a73f8);}};}function respondWithFilteredResult(_0x364692,_0x3a1463){return function(_0x1f8152){if(_0x1f8152){var _0x53fd50=typeof _0x3a1463[_0x7bbd('0x1e')]===_0x7bbd('0x1f')&&typeof _0x3a1463[_0x7bbd('0x20')]==='undefined';var _0x1ce251=_0x1f8152[_0x7bbd('0x21')];var _0x17377c=_0x53fd50?0x0:_0x3a1463[_0x7bbd('0x1e')];var _0x291b6f=_0x53fd50?_0x1f8152['count']:_0x3a1463[_0x7bbd('0x1e')]+_0x3a1463[_0x7bbd('0x20')];var _0x35b497;if(_0x291b6f>=_0x1ce251){_0x291b6f=_0x1ce251;_0x35b497=0xc8;}else{_0x35b497=0xce;}_0x364692[_0x7bbd('0x1c')](_0x35b497);return _0x364692[_0x7bbd('0x22')]('Content-Range',_0x17377c+'-'+_0x291b6f+'/'+_0x1ce251)['json'](_0x1f8152);}return null;};}function patchUpdates(_0x256f63){return function(_0xff56fe){try{jsonpatch[_0x7bbd('0x23')](_0xff56fe,_0x256f63,!![]);}catch(_0x3e9080){return BPromise['reject'](_0x3e9080);}return _0xff56fe[_0x7bbd('0x24')]();};}function saveUpdates(_0x328e0c,_0x3a3301){return function(_0x3d7fda){if(_0x3d7fda){return _0x3d7fda[_0x7bbd('0x25')](_0x328e0c)[_0x7bbd('0x26')](function(_0x40a230){return _0x40a230;});}return null;};}function removeEntity(_0x5a1ff8,_0x4c034a){return function(_0xeb4ff0){if(_0xeb4ff0){return _0xeb4ff0['destroy']()[_0x7bbd('0x26')](function(){_0x5a1ff8['status'](0xcc)[_0x7bbd('0x27')]();});}};}function handleEntityNotFound(_0x17a8ad,_0x550db6){return function(_0x255cc3){if(!_0x255cc3){_0x17a8ad['sendStatus'](0x194);}return _0x255cc3;};}function handleError(_0x53e558,_0x277939){_0x277939=_0x277939||0x1f4;return function(_0xa3a9d6){logger[_0x7bbd('0x28')](_0xa3a9d6[_0x7bbd('0x29')]);if(_0xa3a9d6[_0x7bbd('0x2a')]){delete _0xa3a9d6[_0x7bbd('0x2a')];}_0x53e558[_0x7bbd('0x1c')](_0x277939)['send'](_0xa3a9d6);};}exports[_0x7bbd('0x2b')]=function(_0x4d9a09,_0x208bcf){var _0x156caa={},_0x5634f7={},_0x46a520={'count':0x0,'rows':[]};var _0x1c18cb=_[_0x7bbd('0x2c')](db[_0x7bbd('0x2d')]['rawAttributes'],function(_0x1d430a){return{'name':_0x1d430a[_0x7bbd('0x2e')],'type':_0x1d430a['type']['key']};});_0x5634f7[_0x7bbd('0x2f')]=_[_0x7bbd('0x30')](_[_0x7bbd('0x2c')](_0x1c18cb,_0x7bbd('0x2a')),[_0x7bbd('0x2a')]);_0x5634f7['query']=_[_0x7bbd('0x31')](_0x4d9a09['query']);_0x5634f7['filters']=_[_0x7bbd('0x32')](_0x5634f7[_0x7bbd('0x2f')],_0x5634f7[_0x7bbd('0x33')]);_0x156caa[_0x7bbd('0x34')]=_[_0x7bbd('0x32')](_0x5634f7[_0x7bbd('0x2f')],qs[_0x7bbd('0x35')](_0x4d9a09[_0x7bbd('0x33')][_0x7bbd('0x35')]));_0x156caa[_0x7bbd('0x34')]=_0x156caa[_0x7bbd('0x34')]['length']?_0x156caa[_0x7bbd('0x34')]:_0x5634f7[_0x7bbd('0x2f')];if(!_0x4d9a09[_0x7bbd('0x33')][_0x7bbd('0x36')](_0x7bbd('0x37'))){_0x156caa[_0x7bbd('0x20')]=qs[_0x7bbd('0x20')](_0x4d9a09[_0x7bbd('0x33')][_0x7bbd('0x20')]);_0x156caa[_0x7bbd('0x1e')]=qs[_0x7bbd('0x1e')](_0x4d9a09['query']['offset']);}_0x156caa['order']=qs[_0x7bbd('0x38')](_0x4d9a09['query']['sort']);_0x156caa[_0x7bbd('0x39')]=qs[_0x7bbd('0x3a')](_[_0x7bbd('0x3b')](_0x4d9a09[_0x7bbd('0x33')],_0x5634f7[_0x7bbd('0x3a')]),_0x1c18cb);if(_0x4d9a09[_0x7bbd('0x33')][_0x7bbd('0x3c')]){_0x156caa[_0x7bbd('0x39')]=_[_0x7bbd('0x3d')](_0x156caa[_0x7bbd('0x39')],{'$or':_[_0x7bbd('0x2c')](_0x1c18cb,function(_0x2da1e9){if(_0x2da1e9['type']!==_0x7bbd('0x3e')){var _0x5170a4={};_0x5170a4[_0x2da1e9['name']]={'$like':'%'+_0x4d9a09[_0x7bbd('0x33')]['filter']+'%'};return _0x5170a4;}})});}_0x156caa=_[_0x7bbd('0x3d')]({},_0x156caa,_0x4d9a09[_0x7bbd('0x3f')]);var _0x4107b9={'where':_0x156caa[_0x7bbd('0x39')]};return db[_0x7bbd('0x2d')][_0x7bbd('0x21')](_0x4107b9)['then'](function(_0x1ce992){_0x46a520['count']=_0x1ce992;if(_0x4d9a09[_0x7bbd('0x33')]['includeAll']){_0x156caa[_0x7bbd('0x40')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x7bbd('0x41')](_0x156caa);})['then'](function(_0x62fbbe){_0x46a520[_0x7bbd('0x42')]=_0x62fbbe;return _0x46a520;})[_0x7bbd('0x26')](respondWithFilteredResult(_0x208bcf,_0x156caa))['catch'](handleError(_0x208bcf,null));};exports['show']=function(_0x137065,_0x30a602){var _0x11bdc5={'raw':!![],'where':{'id':_0x137065[_0x7bbd('0x43')]['id']}},_0x4569bb={};_0x4569bb[_0x7bbd('0x2f')]=_[_0x7bbd('0x31')](db[_0x7bbd('0x2d')][_0x7bbd('0x44')]);_0x4569bb[_0x7bbd('0x33')]=_[_0x7bbd('0x31')](_0x137065['query']);_0x4569bb['filters']=_[_0x7bbd('0x32')](_0x4569bb[_0x7bbd('0x2f')],_0x4569bb[_0x7bbd('0x33')]);_0x11bdc5[_0x7bbd('0x34')]=_[_0x7bbd('0x32')](_0x4569bb['model'],qs[_0x7bbd('0x35')](_0x137065[_0x7bbd('0x33')][_0x7bbd('0x35')]));_0x11bdc5[_0x7bbd('0x34')]=_0x11bdc5[_0x7bbd('0x34')][_0x7bbd('0x45')]?_0x11bdc5[_0x7bbd('0x34')]:_0x4569bb[_0x7bbd('0x2f')];if(_0x137065['query'][_0x7bbd('0x46')]){_0x11bdc5[_0x7bbd('0x40')]=[{'all':!![]}];}_0x11bdc5=_[_0x7bbd('0x3d')]({},_0x11bdc5,_0x137065[_0x7bbd('0x3f')]);return db[_0x7bbd('0x2d')][_0x7bbd('0x47')](_0x11bdc5)['then'](handleEntityNotFound(_0x30a602,null))[_0x7bbd('0x26')](respondWithResult(_0x30a602,null))['catch'](handleError(_0x30a602,null));};exports[_0x7bbd('0x48')]=function(_0x469f7f,_0x5f4b94){return db[_0x7bbd('0x2d')][_0x7bbd('0x48')](_0x469f7f['body'],{})[_0x7bbd('0x26')](respondWithResult(_0x5f4b94,0xc9))['catch'](handleError(_0x5f4b94,null));};exports['update']=function(_0x1e7383,_0x206ec8){if(_0x1e7383['body']['id']){delete _0x1e7383[_0x7bbd('0x49')]['id'];}return db[_0x7bbd('0x2d')][_0x7bbd('0x47')]({'where':{'id':_0x1e7383[_0x7bbd('0x43')]['id']}})['then'](handleEntityNotFound(_0x206ec8,null))[_0x7bbd('0x26')](saveUpdates(_0x1e7383['body'],null))[_0x7bbd('0x26')](respondWithResult(_0x206ec8,null))[_0x7bbd('0x4a')](handleError(_0x206ec8,null));};exports[_0x7bbd('0x4b')]=function(_0x15ce35,_0x51f0c3){return db[_0x7bbd('0x2d')]['find']({'where':{'id':_0x15ce35[_0x7bbd('0x43')]['id']}})['then'](handleEntityNotFound(_0x51f0c3,null))[_0x7bbd('0x26')](removeEntity(_0x51f0c3,null))['catch'](handleError(_0x51f0c3,null));};exports[_0x7bbd('0x4c')]=function(_0x1880b1,_0x52d102,_0x3b3f69){return db[_0x7bbd('0x2d')]['find']({'where':{'id':_0x1880b1['params']['id']},'attributes':['id',_0x7bbd('0x4d'),'msg_id']})[_0x7bbd('0x26')](handleEntityNotFound(_0x52d102,null))['then'](function(_0x579eb4){if(_0x579eb4){if(!_0x579eb4['recording']){throw new db[(_0x7bbd('0x4e'))][(_0x7bbd('0x4f'))](_0x7bbd('0x50'));}var _0x381d78={'Content-Type':_0x7bbd('0x51'),'Content-Disposition':_0x7bbd('0x52')};if(_0x579eb4['msg_id']){_0x381d78[_0x7bbd('0x53')]=_0x7bbd('0x54')+_0x579eb4[_0x7bbd('0x55')]+_0x7bbd('0x56');}_0x52d102[_0x7bbd('0x22')](_0x381d78);return _0x52d102['send'](new Buffer(_0x579eb4[_0x7bbd('0x4d')]));}})['catch'](handleError(_0x52d102,null));}; \ No newline at end of file +var _0x900d=['order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','.wav\x22','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','name','map','VoiceMailMessage','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x900d,0x1af));var _0xd900=function(_0x243ed8,_0x36e82c){_0x243ed8=_0x243ed8-0x0;var _0x89344e=_0x900d[_0x243ed8];return _0x89344e;};'use strict';var emlformat=require(_0xd900('0x0'));var rimraf=require(_0xd900('0x1'));var zipdir=require(_0xd900('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd900('0x3'));var moment=require(_0xd900('0x4'));var BPromise=require(_0xd900('0x5'));var Mustache=require('mustache');var util=require(_0xd900('0x6'));var path=require(_0xd900('0x7'));var sox=require(_0xd900('0x8'));var csv=require('to-csv');var ejs=require(_0xd900('0x9'));var fs=require('fs');var fs_extra=require(_0xd900('0xa'));var _=require(_0xd900('0xb'));var squel=require(_0xd900('0xc'));var crypto=require('crypto');var jsforce=require(_0xd900('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd900('0xe'));var querystring=require(_0xd900('0xf'));var Papa=require(_0xd900('0x10'));var Redis=require('ioredis');var authService=require(_0xd900('0x11'));var qs=require(_0xd900('0x12'));var as=require(_0xd900('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd900('0x14'))('api');var utils=require(_0xd900('0x15'));var config=require(_0xd900('0x16'));var licenseUtil=require(_0xd900('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a2417,_0x1ef915){_0x1ef915=_0x1ef915||0xcc;return function(_0x1806e6){if(_0x1806e6){return _0x3a2417['sendStatus'](_0x1ef915);}return _0x3a2417['status'](_0x1ef915)[_0xd900('0x18')]();};}function respondWithResult(_0x47d2e5,_0x27cb22){_0x27cb22=_0x27cb22||0xc8;return function(_0x38020d){if(_0x38020d){return _0x47d2e5['status'](_0x27cb22)['json'](_0x38020d);}};}function respondWithFilteredResult(_0x1e0cff,_0x191c09){return function(_0x22ede8){if(_0x22ede8){var _0x19089b=typeof _0x191c09['offset']===_0xd900('0x19')&&typeof _0x191c09[_0xd900('0x1a')]==='undefined';var _0x1c254b=_0x22ede8[_0xd900('0x1b')];var _0x5150f4=_0x19089b?0x0:_0x191c09['offset'];var _0xea6479=_0x19089b?_0x22ede8['count']:_0x191c09[_0xd900('0x1c')]+_0x191c09[_0xd900('0x1a')];var _0x2ca8e2;if(_0xea6479>=_0x1c254b){_0xea6479=_0x1c254b;_0x2ca8e2=0xc8;}else{_0x2ca8e2=0xce;}_0x1e0cff[_0xd900('0x1d')](_0x2ca8e2);return _0x1e0cff[_0xd900('0x1e')](_0xd900('0x1f'),_0x5150f4+'-'+_0xea6479+'/'+_0x1c254b)[_0xd900('0x20')](_0x22ede8);}return null;};}function patchUpdates(_0x205bd3){return function(_0x3ae505){try{jsonpatch[_0xd900('0x21')](_0x3ae505,_0x205bd3,!![]);}catch(_0x2c0685){return BPromise[_0xd900('0x22')](_0x2c0685);}return _0x3ae505[_0xd900('0x23')]();};}function saveUpdates(_0x32d739,_0x2a75d7){return function(_0x179159){if(_0x179159){return _0x179159[_0xd900('0x24')](_0x32d739)[_0xd900('0x25')](function(_0x3dfd76){return _0x3dfd76;});}return null;};}function removeEntity(_0x591c99,_0x3edfc1){return function(_0x169a44){if(_0x169a44){return _0x169a44[_0xd900('0x26')]()[_0xd900('0x25')](function(){_0x591c99[_0xd900('0x1d')](0xcc)[_0xd900('0x18')]();});}};}function handleEntityNotFound(_0xfe430b,_0x1c258b){return function(_0x4f6270){if(!_0x4f6270){_0xfe430b['sendStatus'](0x194);}return _0x4f6270;};}function handleError(_0x24da77,_0x2b4b08){_0x2b4b08=_0x2b4b08||0x1f4;return function(_0x278dec){logger['error'](_0x278dec['stack']);if(_0x278dec['name']){delete _0x278dec[_0xd900('0x27')];}_0x24da77['status'](_0x2b4b08)['send'](_0x278dec);};}exports['index']=function(_0x1acca0,_0x1ecd9e){var _0x46d9df={},_0x43c671={},_0x3d8345={'count':0x0,'rows':[]};var _0x3f0732=_[_0xd900('0x28')](db[_0xd900('0x29')][_0xd900('0x2a')],function(_0x52750e){return{'name':_0x52750e[_0xd900('0x2b')],'type':_0x52750e[_0xd900('0x2c')]['key']};});_0x43c671[_0xd900('0x2d')]=_['differenceBy'](_[_0xd900('0x28')](_0x3f0732,_0xd900('0x27')),[_0xd900('0x27')]);_0x43c671['query']=_[_0xd900('0x2e')](_0x1acca0['query']);_0x43c671[_0xd900('0x2f')]=_['intersection'](_0x43c671[_0xd900('0x2d')],_0x43c671[_0xd900('0x30')]);_0x46d9df[_0xd900('0x31')]=_[_0xd900('0x32')](_0x43c671['model'],qs[_0xd900('0x33')](_0x1acca0[_0xd900('0x30')][_0xd900('0x33')]));_0x46d9df[_0xd900('0x31')]=_0x46d9df[_0xd900('0x31')][_0xd900('0x34')]?_0x46d9df['attributes']:_0x43c671['model'];if(!_0x1acca0['query'][_0xd900('0x35')](_0xd900('0x36'))){_0x46d9df[_0xd900('0x1a')]=qs[_0xd900('0x1a')](_0x1acca0['query'][_0xd900('0x1a')]);_0x46d9df[_0xd900('0x1c')]=qs[_0xd900('0x1c')](_0x1acca0[_0xd900('0x30')][_0xd900('0x1c')]);}_0x46d9df[_0xd900('0x37')]=qs[_0xd900('0x38')](_0x1acca0['query'][_0xd900('0x38')]);_0x46d9df[_0xd900('0x39')]=qs['filters'](_[_0xd900('0x3a')](_0x1acca0[_0xd900('0x30')],_0x43c671[_0xd900('0x2f')]),_0x3f0732);if(_0x1acca0['query'][_0xd900('0x3b')]){_0x46d9df[_0xd900('0x39')]=_[_0xd900('0x3c')](_0x46d9df[_0xd900('0x39')],{'$or':_[_0xd900('0x28')](_0x3f0732,function(_0x17bac8){if(_0x17bac8[_0xd900('0x2c')]!==_0xd900('0x3d')){var _0x47471f={};_0x47471f[_0x17bac8['name']]={'$like':'%'+_0x1acca0[_0xd900('0x30')][_0xd900('0x3b')]+'%'};return _0x47471f;}})});}_0x46d9df=_[_0xd900('0x3c')]({},_0x46d9df,_0x1acca0[_0xd900('0x3e')]);var _0x2ef02e={'where':_0x46d9df['where']};return db['VoiceMailMessage'][_0xd900('0x1b')](_0x2ef02e)[_0xd900('0x25')](function(_0x3dfae9){_0x3d8345[_0xd900('0x1b')]=_0x3dfae9;if(_0x1acca0[_0xd900('0x30')]['includeAll']){_0x46d9df[_0xd900('0x3f')]=[{'all':!![]}];}return db[_0xd900('0x29')][_0xd900('0x40')](_0x46d9df);})[_0xd900('0x25')](function(_0x340e16){_0x3d8345[_0xd900('0x41')]=_0x340e16;return _0x3d8345;})['then'](respondWithFilteredResult(_0x1ecd9e,_0x46d9df))['catch'](handleError(_0x1ecd9e,null));};exports[_0xd900('0x42')]=function(_0x339f6b,_0x1af1f4){var _0x2a2e9a={'raw':!![],'where':{'id':_0x339f6b[_0xd900('0x43')]['id']}},_0x29f040={};_0x29f040[_0xd900('0x2d')]=_[_0xd900('0x2e')](db[_0xd900('0x29')][_0xd900('0x2a')]);_0x29f040[_0xd900('0x30')]=_[_0xd900('0x2e')](_0x339f6b['query']);_0x29f040['filters']=_[_0xd900('0x32')](_0x29f040[_0xd900('0x2d')],_0x29f040['query']);_0x2a2e9a[_0xd900('0x31')]=_[_0xd900('0x32')](_0x29f040[_0xd900('0x2d')],qs[_0xd900('0x33')](_0x339f6b[_0xd900('0x30')]['fields']));_0x2a2e9a[_0xd900('0x31')]=_0x2a2e9a[_0xd900('0x31')][_0xd900('0x34')]?_0x2a2e9a[_0xd900('0x31')]:_0x29f040[_0xd900('0x2d')];if(_0x339f6b[_0xd900('0x30')]['includeAll']){_0x2a2e9a[_0xd900('0x3f')]=[{'all':!![]}];}_0x2a2e9a=_[_0xd900('0x3c')]({},_0x2a2e9a,_0x339f6b[_0xd900('0x3e')]);return db['VoiceMailMessage'][_0xd900('0x44')](_0x2a2e9a)['then'](handleEntityNotFound(_0x1af1f4,null))['then'](respondWithResult(_0x1af1f4,null))[_0xd900('0x45')](handleError(_0x1af1f4,null));};exports[_0xd900('0x46')]=function(_0x1d655c,_0xe39e49){return db[_0xd900('0x29')][_0xd900('0x46')](_0x1d655c[_0xd900('0x47')],{})['then'](respondWithResult(_0xe39e49,0xc9))[_0xd900('0x45')](handleError(_0xe39e49,null));};exports[_0xd900('0x24')]=function(_0x454103,_0xe688f8){if(_0x454103[_0xd900('0x47')]['id']){delete _0x454103['body']['id'];}return db[_0xd900('0x29')]['find']({'where':{'id':_0x454103['params']['id']}})['then'](handleEntityNotFound(_0xe688f8,null))[_0xd900('0x25')](saveUpdates(_0x454103['body'],null))[_0xd900('0x25')](respondWithResult(_0xe688f8,null))['catch'](handleError(_0xe688f8,null));};exports[_0xd900('0x26')]=function(_0x4f6ebc,_0x3db10b){return db[_0xd900('0x29')]['find']({'where':{'id':_0x4f6ebc[_0xd900('0x43')]['id']}})[_0xd900('0x25')](handleEntityNotFound(_0x3db10b,null))[_0xd900('0x25')](removeEntity(_0x3db10b,null))['catch'](handleError(_0x3db10b,null));};exports[_0xd900('0x48')]=function(_0x3fd2f6,_0x1cfb8a,_0x392aef){return db[_0xd900('0x29')]['find']({'where':{'id':_0x3fd2f6[_0xd900('0x43')]['id']},'attributes':['id',_0xd900('0x49'),_0xd900('0x4a')]})[_0xd900('0x25')](handleEntityNotFound(_0x1cfb8a,null))[_0xd900('0x25')](function(_0x1efca4){if(_0x1efca4){if(!_0x1efca4[_0xd900('0x49')]){throw new db['Sequelize'][(_0xd900('0x4b'))](_0xd900('0x4c'));}var _0x535138={'Content-Type':_0xd900('0x4d'),'Content-Disposition':'attachment'};if(_0x1efca4[_0xd900('0x4a')]){_0x535138[_0xd900('0x4e')]='attachment;\x20filename=\x22'+_0x1efca4[_0xd900('0x4a')]+_0xd900('0x4f');}_0x1cfb8a[_0xd900('0x1e')](_0x535138);return _0x1cfb8a[_0xd900('0x50')](new Buffer(_0x1efca4[_0xd900('0x49')]));}})[_0xd900('0x45')](handleError(_0x1cfb8a,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index ee654c4..bc7d3e8 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 _0x8f7e=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x38a0fe,_0x51cd83){var _0x119294=function(_0x584d27){while(--_0x584d27){_0x38a0fe['push'](_0x38a0fe['shift']());}};_0x119294(++_0x51cd83);}(_0x8f7e,0xfc));var _0xe8f7=function(_0x1740bc,_0x52d88e){_0x1740bc=_0x1740bc-0x0;var _0x3e4f82=_0x8f7e[_0x1740bc];return _0x3e4f82;};'use strict';var _=require(_0xe8f7('0x0'));var util=require(_0xe8f7('0x1'));var logger=require(_0xe8f7('0x2'))(_0xe8f7('0x3'));var moment=require('moment');var BPromise=require(_0xe8f7('0x4'));var rp=require(_0xe8f7('0x5'));var fs=require('fs');var path=require(_0xe8f7('0x6'));var rimraf=require(_0xe8f7('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xe8f7('0x8')]=function(_0x32c530,_0x1634c3){return _0x32c530[_0xe8f7('0x9')](_0xe8f7('0xa'),attributes,{'tableName':_0xe8f7('0xb'),'paranoid':![],'indexes':[{'name':_0xe8f7('0xc'),'fields':[_0xe8f7('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8b84=['path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x8b84,0x1ac));var _0x48b8=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x8b84[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x48b8('0x0'));var util=require(_0x48b8('0x1'));var logger=require(_0x48b8('0x2'))(_0x48b8('0x3'));var moment=require('moment');var BPromise=require(_0x48b8('0x4'));var rp=require(_0x48b8('0x5'));var fs=require('fs');var path=require(_0x48b8('0x6'));var rimraf=require(_0x48b8('0x7'));var config=require(_0x48b8('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x48b8('0x9')]=function(_0x231b8c,_0x5eeac7){return _0x231b8c[_0x48b8('0xa')](_0x48b8('0xb'),attributes,{'tableName':_0x48b8('0xc'),'paranoid':![],'indexes':[{'name':_0x48b8('0xd'),'fields':[_0x48b8('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 4934cbc..c6b221f 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 _0xecf0=['../../config/environment','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0xecf0,0x1e8));var _0x0ecf=function(_0x219f04,_0x26d096){_0x219f04=_0x219f04-0x0;var _0x38dcbd=_0xecf0[_0x219f04];return _0x38dcbd;};'use strict';var _=require(_0x0ecf('0x0'));var util=require('util');var moment=require(_0x0ecf('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ecf('0x2'));var fs=require('fs');var Redis=require(_0x0ecf('0x3'));var db=require(_0x0ecf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0ecf('0x5'));var config=require(_0x0ecf('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40528f,_0x3f6f66,_0x25f24c){return new BPromise(function(_0x48b3ce,_0x971641){return client[_0x0ecf('0x7')](_0x40528f,_0x25f24c)[_0x0ecf('0x8')](function(_0x1e0cad){logger[_0x0ecf('0x9')](_0x0ecf('0xa'),_0x3f6f66,_0x0ecf('0xb'));logger[_0x0ecf('0xc')](_0x0ecf('0xd'),_0x3f6f66,_0x0ecf('0xb'),JSON[_0x0ecf('0xe')](_0x1e0cad));if(_0x1e0cad[_0x0ecf('0xf')]){if(_0x1e0cad[_0x0ecf('0xf')]['code']===0x1f4){logger[_0x0ecf('0xf')](_0x0ecf('0xa'),_0x3f6f66,_0x1e0cad[_0x0ecf('0xf')][_0x0ecf('0x10')]);return _0x971641(_0x1e0cad['error']['message']);}logger[_0x0ecf('0xf')](_0x0ecf('0xa'),_0x3f6f66,_0x1e0cad[_0x0ecf('0xf')]['message']);return _0x48b3ce(_0x1e0cad[_0x0ecf('0xf')][_0x0ecf('0x10')]);}else{logger[_0x0ecf('0x9')](_0x0ecf('0xa'),_0x3f6f66,'request\x20sent');_0x48b3ce(_0x1e0cad[_0x0ecf('0x11')][_0x0ecf('0x10')]);}})[_0x0ecf('0x12')](function(_0x3a6a52){logger['error'](_0x0ecf('0xa'),_0x3f6f66,_0x3a6a52);_0x971641(_0x3a6a52);});});} \ No newline at end of file +var _0x2395=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2ea5d6,_0x2ef3e7){var _0x20dcb3=function(_0x22ed56){while(--_0x22ed56){_0x2ea5d6['push'](_0x2ea5d6['shift']());}};_0x20dcb3(++_0x2ef3e7);}(_0x2395,0xaf));var _0x5239=function(_0x45d2a9,_0xa564a6){_0x45d2a9=_0x45d2a9-0x0;var _0x2ecaf7=_0x2395[_0x45d2a9];return _0x2ecaf7;};'use strict';var _=require('lodash');var util=require(_0x5239('0x0'));var moment=require(_0x5239('0x1'));var BPromise=require(_0x5239('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5239('0x3'));var db=require(_0x5239('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5239('0x5'))(_0x5239('0x6'));var config=require(_0x5239('0x7'));var jayson=require(_0x5239('0x8'));var client=jayson[_0x5239('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd24fc,_0x8633ac,_0x35c6e4){return new BPromise(function(_0xb237f8,_0x55f482){return client['request'](_0xd24fc,_0x35c6e4)[_0x5239('0xa')](function(_0x652f63){logger[_0x5239('0xb')](_0x5239('0xc'),_0x8633ac,_0x5239('0xd'));logger[_0x5239('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x8633ac,'request\x20sent',JSON[_0x5239('0xf')](_0x652f63));if(_0x652f63[_0x5239('0x10')]){if(_0x652f63[_0x5239('0x10')][_0x5239('0x11')]===0x1f4){logger['error'](_0x5239('0xc'),_0x8633ac,_0x652f63['error'][_0x5239('0x12')]);return _0x55f482(_0x652f63[_0x5239('0x10')][_0x5239('0x12')]);}logger[_0x5239('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x8633ac,_0x652f63['error']['message']);return _0xb237f8(_0x652f63[_0x5239('0x10')][_0x5239('0x12')]);}else{logger[_0x5239('0xb')](_0x5239('0xc'),_0x8633ac,_0x5239('0xd'));_0xb237f8(_0x652f63['result'][_0x5239('0x12')]);}})[_0x5239('0x13')](function(_0x26e7f4){logger['error'](_0x5239('0xc'),_0x8633ac,_0x26e7f4);_0x55f482(_0x26e7f4);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b7e7ebd..638cfdc 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 _0xbadb=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','addSound','/:id','update','destroy','delete','removeSound','exports','multer','util'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0xbadb,0x1b6));var _0xbbad=function(_0x455adc,_0x2029fd){_0x455adc=_0x455adc-0x0;var _0x3b08cf=_0xbadb[_0x455adc];return _0x3b08cf;};'use strict';var multer=require(_0xbbad('0x0'));var util=require(_0xbbad('0x1'));var path=require(_0xbbad('0x2'));var timeout=require(_0xbbad('0x3'));var express=require(_0xbbad('0x4'));var router=express['Router']();var fs_extra=require(_0xbbad('0x5'));var auth=require(_0xbbad('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbad('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0xbbad('0x8')]('/',auth[_0xbbad('0x9')](),controller[_0xbbad('0xa')]);router[_0xbbad('0x8')]('/:id',auth[_0xbbad('0x9')](),controller[_0xbbad('0xb')]);router[_0xbbad('0x8')](_0xbbad('0xc'),auth['isAuthenticated'](),controller[_0xbbad('0xd')]);router[_0xbbad('0xe')]('/',auth[_0xbbad('0x9')](),controller['create']);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0xbbad('0xf')]);router['put'](_0xbbad('0x10'),auth[_0xbbad('0x9')](),controller[_0xbbad('0x11')]);router['delete'](_0xbbad('0x10'),auth[_0xbbad('0x9')](),controller[_0xbbad('0x12')]);router[_0xbbad('0x13')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0xbbad('0x14')]);module[_0xbbad('0x15')]=router; \ No newline at end of file +var _0xe376=['removeSound','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xe376,0x1c4));var _0x6e37=function(_0xb61d88,_0x388bba){_0xb61d88=_0xb61d88-0x0;var _0x196a0d=_0xe376[_0xb61d88];return _0x196a0d;};'use strict';var multer=require(_0x6e37('0x0'));var util=require(_0x6e37('0x1'));var path=require(_0x6e37('0x2'));var timeout=require(_0x6e37('0x3'));var express=require('express');var router=express[_0x6e37('0x4')]();var fs_extra=require(_0x6e37('0x5'));var auth=require(_0x6e37('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6e37('0x7'));var controller=require(_0x6e37('0x8'));router[_0x6e37('0x9')]('/',auth[_0x6e37('0xa')](),controller['index']);router[_0x6e37('0x9')]('/:id',auth[_0x6e37('0xa')](),controller[_0x6e37('0xb')]);router[_0x6e37('0x9')](_0x6e37('0xc'),auth['isAuthenticated'](),controller[_0x6e37('0xd')]);router[_0x6e37('0xe')]('/',auth[_0x6e37('0xa')](),controller[_0x6e37('0xf')]);router[_0x6e37('0xe')](_0x6e37('0xc'),auth[_0x6e37('0xa')](),controller[_0x6e37('0x10')]);router[_0x6e37('0x11')](_0x6e37('0x12'),auth['isAuthenticated'](),controller[_0x6e37('0x13')]);router[_0x6e37('0x14')]('/:id',auth[_0x6e37('0xa')](),controller[_0x6e37('0x15')]);router[_0x6e37('0x14')](_0x6e37('0x16'),auth[_0x6e37('0xa')](),controller[_0x6e37('0x17')]);module[_0x6e37('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index ec8ed54..ecf142d 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 _0xc679=['name','ENUM','quietmp3nb','quietmp3','mp3','files','BOOLEAN','STRING'];(function(_0x3e2567,_0x42d99d){var _0x141ee3=function(_0x4975c1){while(--_0x4975c1){_0x3e2567['push'](_0x3e2567['shift']());}};_0x141ee3(++_0x42d99d);}(_0xc679,0x1cf));var _0x9c67=function(_0x548ebb,_0x3ff666){_0x548ebb=_0x548ebb-0x0;var _0x4d8235=_0xc679[_0x548ebb];return _0x4d8235;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9c67('0x0')],'allowNull':![],'unique':_0x9c67('0x1')},'mode':{'type':Sequelize[_0x9c67('0x2')]('custom','files','mp3nb',_0x9c67('0x3'),_0x9c67('0x4'),_0x9c67('0x5')),'allowNull':!![],'defaultValue':_0x9c67('0x6')},'directory':{'type':Sequelize[_0x9c67('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0x9c67('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9c67('0x0')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x9c67('0x0')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x9c67('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5702=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','exports','STRING','name','ENUM','files'];(function(_0x2ebfe0,_0x3d32e2){var _0x2df263=function(_0x4069a7){while(--_0x4069a7){_0x2ebfe0['push'](_0x2ebfe0['shift']());}};_0x2df263(++_0x3d32e2);}(_0x5702,0x10e));var _0x2570=function(_0x29f487,_0x3eeb94){_0x29f487=_0x29f487-0x0;var _0x4d549e=_0x5702[_0x29f487];return _0x4d549e;};'use strict';var Sequelize=require('sequelize');module[_0x2570('0x0')]={'name':{'type':Sequelize[_0x2570('0x1')],'allowNull':![],'unique':_0x2570('0x2')},'mode':{'type':Sequelize[_0x2570('0x3')]('custom',_0x2570('0x4'),_0x2570('0x5'),_0x2570('0x6'),_0x2570('0x7'),_0x2570('0x8')),'allowNull':!![],'defaultValue':_0x2570('0x4')},'directory':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![],'defaultValue':_0x2570('0x9')},'format':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'stamp':{'type':_0x2570('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index f0e60e3..1e2539a 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 _0x8c15=['end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','body','sequelize','transaction','mode','directory','root','server/files/moh','create','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','readdirSync','unlinkSync','join','rmdirSync','Sequelize','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','basename','extname','format','symlinkSync','ValidationError','findOne','removeSound','id2','getSounds','pick','eml-format','rimraf','fast-json-patch','moment','util','to-csv','ejs','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/environment','status'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x8c15,0xbc));var _0x58c1=function(_0x5524a1,_0x43e956){_0x5524a1=_0x5524a1-0x0;var _0xfc1058=_0x8c15[_0x5524a1];return _0xfc1058;};'use strict';var emlformat=require(_0x58c1('0x0'));var rimraf=require(_0x58c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58c1('0x2'));var rp=require('request-promise');var moment=require(_0x58c1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x58c1('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x58c1('0x5'));var ejs=require(_0x58c1('0x6'));var fs=require('fs');var fs_extra=require(_0x58c1('0x7'));var _=require(_0x58c1('0x8'));var squel=require(_0x58c1('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x58c1('0xa'));var toCsv=require(_0x58c1('0x5'));var querystring=require(_0x58c1('0xb'));var Papa=require(_0x58c1('0xc'));var Redis=require(_0x58c1('0xd'));var authService=require(_0x58c1('0xe'));var qs=require(_0x58c1('0xf'));var as=require(_0x58c1('0x10'));var hardwareService=require(_0x58c1('0x11'));var logger=require(_0x58c1('0x12'))(_0x58c1('0x13'));var utils=require('../../config/utils');var config=require(_0x58c1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x126a4d,_0x1bcabb){_0x1bcabb=_0x1bcabb||0xcc;return function(_0x1de1c2){if(_0x1de1c2){return _0x126a4d['sendStatus'](_0x1bcabb);}return _0x126a4d[_0x58c1('0x15')](_0x1bcabb)[_0x58c1('0x16')]();};}function respondWithResult(_0x233ac7,_0x3a5c77){_0x3a5c77=_0x3a5c77||0xc8;return function(_0x2628b1){if(_0x2628b1){return _0x233ac7[_0x58c1('0x15')](_0x3a5c77)[_0x58c1('0x17')](_0x2628b1);}};}function respondWithFilteredResult(_0x5d1459,_0x42e7ac){return function(_0x11ff58){if(_0x11ff58){var _0x5c2347=typeof _0x42e7ac[_0x58c1('0x18')]===_0x58c1('0x19')&&typeof _0x42e7ac[_0x58c1('0x1a')]==='undefined';var _0x184e51=_0x11ff58[_0x58c1('0x1b')];var _0x237cfe=_0x5c2347?0x0:_0x42e7ac['offset'];var _0x397188=_0x5c2347?_0x11ff58[_0x58c1('0x1b')]:_0x42e7ac[_0x58c1('0x18')]+_0x42e7ac[_0x58c1('0x1a')];var _0x42c187;if(_0x397188>=_0x184e51){_0x397188=_0x184e51;_0x42c187=0xc8;}else{_0x42c187=0xce;}_0x5d1459[_0x58c1('0x15')](_0x42c187);return _0x5d1459[_0x58c1('0x1c')](_0x58c1('0x1d'),_0x237cfe+'-'+_0x397188+'/'+_0x184e51)[_0x58c1('0x17')](_0x11ff58);}return null;};}function patchUpdates(_0x1cba06){return function(_0x527da3){try{jsonpatch[_0x58c1('0x1e')](_0x527da3,_0x1cba06,!![]);}catch(_0x8c8ed){return BPromise['reject'](_0x8c8ed);}return _0x527da3['save']();};}function saveUpdates(_0x310500,_0x2b178d){return function(_0x306973){if(_0x306973){return _0x306973[_0x58c1('0x1f')](_0x310500)[_0x58c1('0x20')](function(_0x25006a){return _0x25006a;});}return null;};}function removeEntity(_0x165e96,_0x45f91b){return function(_0x9b9d77){if(_0x9b9d77){return _0x9b9d77[_0x58c1('0x21')]()[_0x58c1('0x20')](function(){var _0x15f37c=_0x9b9d77['get']({'plain':!![]});var _0x38a6ce='MusicOnHolds';return db['UserProfileResource'][_0x58c1('0x21')]({'where':{'type':_0x38a6ce,'resourceId':_0x15f37c['id']}})[_0x58c1('0x20')](function(){return _0x9b9d77;});})['then'](function(){_0x165e96[_0x58c1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a47c,_0x3bdd63){return function(_0x4a1383){if(!_0x4a1383){_0x44a47c[_0x58c1('0x22')](0x194);}return _0x4a1383;};}function handleError(_0x418c72,_0x45250f){_0x45250f=_0x45250f||0x1f4;return function(_0x29db36){logger[_0x58c1('0x23')](_0x29db36['stack']);if(_0x29db36[_0x58c1('0x24')]){delete _0x29db36[_0x58c1('0x24')];}_0x418c72[_0x58c1('0x15')](_0x45250f)[_0x58c1('0x25')](_0x29db36);};}exports[_0x58c1('0x26')]=function(_0x2814f8,_0x3ed457){var _0x351d1e={},_0x13f4eb={},_0x2c1ee6={'count':0x0,'rows':[]};var _0x3cd42c=_[_0x58c1('0x27')](db[_0x58c1('0x28')][_0x58c1('0x29')],function(_0x238457){return{'name':_0x238457['fieldName'],'type':_0x238457[_0x58c1('0x2a')]['key']};});_0x13f4eb[_0x58c1('0x2b')]=_[_0x58c1('0x27')](_0x3cd42c,_0x58c1('0x24'));_0x13f4eb[_0x58c1('0x2c')]=_['keys'](_0x2814f8[_0x58c1('0x2c')]);_0x13f4eb[_0x58c1('0x2d')]=_[_0x58c1('0x2e')](_0x13f4eb[_0x58c1('0x2b')],_0x13f4eb[_0x58c1('0x2c')]);_0x351d1e[_0x58c1('0x2f')]=_[_0x58c1('0x2e')](_0x13f4eb[_0x58c1('0x2b')],qs['fields'](_0x2814f8['query']['fields']));_0x351d1e[_0x58c1('0x2f')]=_0x351d1e[_0x58c1('0x2f')][_0x58c1('0x30')]?_0x351d1e[_0x58c1('0x2f')]:_0x13f4eb['model'];if(!_0x2814f8[_0x58c1('0x2c')][_0x58c1('0x31')](_0x58c1('0x32'))){_0x351d1e[_0x58c1('0x1a')]=qs[_0x58c1('0x1a')](_0x2814f8['query'][_0x58c1('0x1a')]);_0x351d1e[_0x58c1('0x18')]=qs[_0x58c1('0x18')](_0x2814f8[_0x58c1('0x2c')][_0x58c1('0x18')]);}_0x351d1e[_0x58c1('0x33')]=qs[_0x58c1('0x34')](_0x2814f8[_0x58c1('0x2c')][_0x58c1('0x34')]);delete _0x2814f8[_0x58c1('0x2c')]['sort'];_0x351d1e[_0x58c1('0x35')]=qs['filters'](_['pick'](_0x2814f8[_0x58c1('0x2c')],_0x13f4eb['filters']),_0x3cd42c);if(_0x2814f8[_0x58c1('0x2c')][_0x58c1('0x36')]){_0x351d1e[_0x58c1('0x35')]=_['merge'](_0x351d1e[_0x58c1('0x35')],{'$or':_[_0x58c1('0x27')](_0x3cd42c,function(_0xf3632e){if(_0xf3632e[_0x58c1('0x2a')]!=='VIRTUAL'){var _0x4bd85a={};_0x4bd85a[_0xf3632e['name']]={'$like':'%'+_0x2814f8[_0x58c1('0x2c')][_0x58c1('0x36')]+'%'};return _0x4bd85a;}})});}_0x351d1e=_[_0x58c1('0x37')]({},_0x351d1e,_0x2814f8[_0x58c1('0x38')]);var _0x5693c8={'where':_0x351d1e[_0x58c1('0x35')]};return db['VoiceMusicOnHold'][_0x58c1('0x1b')](_0x5693c8)[_0x58c1('0x20')](function(_0x59ccc6){_0x2c1ee6[_0x58c1('0x1b')]=_0x59ccc6;if(_0x2814f8[_0x58c1('0x2c')][_0x58c1('0x39')]){_0x351d1e[_0x58c1('0x3a')]=[{'all':!![]}];}return db[_0x58c1('0x28')][_0x58c1('0x3b')](_0x351d1e);})['then'](function(_0x511a7a){_0x2c1ee6[_0x58c1('0x3c')]=_0x511a7a;return _0x2c1ee6;})[_0x58c1('0x20')](respondWithFilteredResult(_0x3ed457,_0x351d1e))[_0x58c1('0x3d')](handleError(_0x3ed457,null));};exports[_0x58c1('0x3e')]=function(_0xe9a428,_0x4d76b1){var _0x1a4903={'raw':![],'where':{'id':_0xe9a428[_0x58c1('0x3f')]['id']}},_0x481ed2={};_0x481ed2['model']=_[_0x58c1('0x40')](db[_0x58c1('0x28')][_0x58c1('0x29')]);_0x481ed2[_0x58c1('0x2c')]=_['keys'](_0xe9a428[_0x58c1('0x2c')]);_0x481ed2[_0x58c1('0x2d')]=_['intersection'](_0x481ed2[_0x58c1('0x2b')],_0x481ed2[_0x58c1('0x2c')]);_0x1a4903[_0x58c1('0x2f')]=_[_0x58c1('0x2e')](_0x481ed2[_0x58c1('0x2b')],qs[_0x58c1('0x41')](_0xe9a428['query'][_0x58c1('0x41')]));_0x1a4903[_0x58c1('0x2f')]=_0x1a4903[_0x58c1('0x2f')][_0x58c1('0x30')]?_0x1a4903[_0x58c1('0x2f')]:_0x481ed2[_0x58c1('0x2b')];if(_0xe9a428[_0x58c1('0x2c')]['includeAll']){_0x1a4903[_0x58c1('0x3a')]=[{'all':!![]}];}_0x1a4903=_[_0x58c1('0x37')]({},_0x1a4903,_0xe9a428[_0x58c1('0x38')]);return db[_0x58c1('0x28')][_0x58c1('0x42')](_0x1a4903)[_0x58c1('0x20')](handleEntityNotFound(_0x4d76b1,null))[_0x58c1('0x20')](respondWithResult(_0x4d76b1,null))[_0x58c1('0x3d')](handleError(_0x4d76b1,null));};exports[_0x58c1('0x1f')]=function(_0x3f3a1f,_0x332842){if(_0x3f3a1f['body']['id']){delete _0x3f3a1f[_0x58c1('0x43')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3f3a1f[_0x58c1('0x3f')]['id']}})[_0x58c1('0x20')](handleEntityNotFound(_0x332842,null))[_0x58c1('0x20')](saveUpdates(_0x3f3a1f[_0x58c1('0x43')],null))[_0x58c1('0x20')](respondWithResult(_0x332842,null))[_0x58c1('0x3d')](handleError(_0x332842,null));};exports['create']=function(_0x4c1e69,_0x1e80a6,_0xaa0eed){return db[_0x58c1('0x44')][_0x58c1('0x45')](function(_0x84ee7a){if(_0x4c1e69[_0x58c1('0x43')][_0x58c1('0x46')]==='files'){_0x4c1e69[_0x58c1('0x43')][_0x58c1('0x47')]=path['join'](config[_0x58c1('0x48')],_0x58c1('0x49'),_0x4c1e69['body'][_0x58c1('0x24')]);}return db[_0x58c1('0x28')][_0x58c1('0x4a')](_0x4c1e69[_0x58c1('0x43')],{'transaction':_0x84ee7a})[_0x58c1('0x20')](function(_0x245699){if(_0x4c1e69['body'][_0x58c1('0x46')]==='files'){fs[_0x58c1('0x4b')](_0x245699[_0x58c1('0x47')],parseInt('0777',0x8));}var _0x318737=_0x4c1e69['user']['get']({'plain':!![]});if(!_0x318737)throw new Error(_0x58c1('0x4c'));if(_0x318737['role']===_0x58c1('0x4d')){var _0x4235aa=_0x245699['get']({'plain':!![]});return db[_0x58c1('0x4e')]['find']({'where':{'name':_0x58c1('0x4f'),'userProfileId':_0x318737[_0x58c1('0x50')]},'raw':!![]})[_0x58c1('0x20')](function(_0x354944){if(_0x354944&&_0x354944[_0x58c1('0x51')]===0x0){return db[_0x58c1('0x52')][_0x58c1('0x4a')]({'name':_0x4235aa[_0x58c1('0x24')],'resourceId':_0x4235aa['id'],'type':_0x354944[_0x58c1('0x24')],'sectionId':_0x354944['id']},{})[_0x58c1('0x20')](function(){return _0x245699;});}else{return _0x245699;}})[_0x58c1('0x3d')](function(_0xa30d0c){logger[_0x58c1('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa30d0c);});}return _0x245699;});})[_0x58c1('0x20')](respondWithResult(_0x1e80a6,0xc9))['catch'](handleError(_0x1e80a6,null));};exports[_0x58c1('0x21')]=function(_0x36254e,_0x52d12e,_0x205d22){var _0xc58af4;return db[_0x58c1('0x28')]['find']({'where':{'id':_0x36254e[_0x58c1('0x3f')]['id']}})[_0x58c1('0x20')](function(_0x564fee){if(_0x564fee){return db[_0x58c1('0x44')]['transaction'](function(_0x384295){return _0x564fee[_0x58c1('0x21')]({'transaction':_0x384295,'raw':!![]})['then'](function(_0x36ea64){if(_0x36ea64['directory']){fs[_0x58c1('0x53')](_0x36ea64[_0x58c1('0x47')])['forEach'](function(_0x530f21){fs[_0x58c1('0x54')](path[_0x58c1('0x55')](_0x36ea64[_0x58c1('0x47')],_0x530f21));});fs[_0x58c1('0x56')](_0x36ea64[_0x58c1('0x47')]);}return _0x36ea64;});})[_0x58c1('0x3d')](function(_0x26dda6){throw new db[(_0x58c1('0x57'))]['ValidationError'](_0x26dda6[_0x58c1('0x58')]);});}})[_0x58c1('0x20')](handleEntityNotFound(_0x52d12e,null))[_0x58c1('0x20')](removeEntity(_0x52d12e,null))[_0x58c1('0x3d')](handleError(_0x52d12e,null));};exports[_0x58c1('0x59')]=function(_0x142234,_0x4f4c3b,_0x3b905e){return db[_0x58c1('0x44')][_0x58c1('0x45')](function(_0x4cf369){var _0x11d460;return db[_0x58c1('0x28')][_0x58c1('0x42')]({'where':{'id':_0x142234[_0x58c1('0x3f')]['id']}})[_0x58c1('0x20')](function(_0x30fadb){if(_0x30fadb){_0x11d460=_0x30fadb;return _0x30fadb[_0x58c1('0x59')](_0x142234[_0x58c1('0x43')]['id'],{'transaction':_0x4cf369});}})[_0x58c1('0x20')](function(_0x33e52b){if(_0x33e52b){return db[_0x58c1('0x5a')]['findOne']({'where':{'id':_0x142234[_0x58c1('0x43')]['id']},'attributes':['id',_0x58c1('0x24'),_0x58c1('0x5b'),_0x58c1('0x5c'),_0x58c1('0x5d')],'raw':!![]});}})[_0x58c1('0x20')](function(_0x4a9300){if(_0x4a9300){var _0x411f95=path[_0x58c1('0x55')](config['root'],_0x58c1('0x5e'),util['format']('%s.%s',path[_0x58c1('0x5f')](_0x4a9300['save_name'],path[_0x58c1('0x60')](_0x4a9300[_0x58c1('0x5b')])),_0x4a9300[_0x58c1('0x5c')]));var _0x2ae34f=path[_0x58c1('0x55')](config[_0x58c1('0x48')],_0x58c1('0x49'),_0x11d460[_0x58c1('0x24')],util[_0x58c1('0x61')]('%s.%s',_0x4a9300[_0x58c1('0x24')],_0x4a9300['converted_format']));fs[_0x58c1('0x62')](_0x411f95,_0x2ae34f);return _0x4a9300;}})[_0x58c1('0x3d')](function(_0x2d5a48){throw new db[(_0x58c1('0x57'))][(_0x58c1('0x63'))](_0x2d5a48[_0x58c1('0x58')]);});})[_0x58c1('0x20')](handleEntityNotFound(_0x4f4c3b,null))[_0x58c1('0x20')](respondWithResult(_0x4f4c3b,0xc9))['catch'](handleError(_0x4f4c3b,null));};exports['removeSound']=function(_0x5edc91,_0x527d58,_0x4d2732){return db['sequelize'][_0x58c1('0x45')](function(_0x298c0b){var _0x572763;return db['VoiceMusicOnHold'][_0x58c1('0x64')]({'where':{'id':_0x5edc91[_0x58c1('0x3f')]['id']}})[_0x58c1('0x20')](handleEntityNotFound(_0x527d58,null))[_0x58c1('0x20')](function(_0x4fca7b){if(_0x4fca7b){_0x572763=_0x4fca7b;return _0x4fca7b[_0x58c1('0x65')](_0x5edc91[_0x58c1('0x3f')][_0x58c1('0x66')]);}})['then'](function(_0x2e761a){if(_0x2e761a){return db[_0x58c1('0x5a')]['findOne']({'where':{'id':_0x5edc91[_0x58c1('0x3f')][_0x58c1('0x66')]},'attributes':['id',_0x58c1('0x24'),_0x58c1('0x5b'),_0x58c1('0x5c'),_0x58c1('0x5d')],'raw':!![]});}})[_0x58c1('0x20')](function(_0x555915){if(_0x555915){fs[_0x58c1('0x54')](path['join'](_0x572763[_0x58c1('0x47')],util['format']('%s.%s',_0x555915['name'],_0x555915[_0x58c1('0x5c')])));return _0x555915;}})[_0x58c1('0x3d')](function(_0x9e3574){throw new db['Sequelize']['ValidationError'](_0x9e3574[_0x58c1('0x58')]);});})[_0x58c1('0x20')](handleEntityNotFound(_0x527d58,null))[_0x58c1('0x20')](respondWithStatusCode(_0x527d58,0xcc))[_0x58c1('0x3d')](handleError(_0x527d58,null));};exports[_0x58c1('0x67')]=function(_0x5a64a8,_0x2d49ff,_0x134372){var _0x5aafc3={};var _0x373c91={};var _0x23d299;var _0x114ce9;return db[_0x58c1('0x28')][_0x58c1('0x64')]({'where':{'id':_0x5a64a8[_0x58c1('0x3f')]['id']}})[_0x58c1('0x20')](handleEntityNotFound(_0x2d49ff,null))[_0x58c1('0x20')](function(_0x3b5fe3){if(_0x3b5fe3){_0x23d299=_0x3b5fe3;_0x373c91[_0x58c1('0x2b')]=_[_0x58c1('0x40')](db[_0x58c1('0x5a')][_0x58c1('0x29')]);_0x373c91[_0x58c1('0x2c')]=_['keys'](_0x5a64a8[_0x58c1('0x2c')]);_0x373c91[_0x58c1('0x2d')]=_['intersection'](_0x373c91[_0x58c1('0x2b')],_0x373c91[_0x58c1('0x2c')]);_0x5aafc3[_0x58c1('0x2f')]=_[_0x58c1('0x2e')](_0x373c91[_0x58c1('0x2b')],qs['fields'](_0x5a64a8['query'][_0x58c1('0x41')]));_0x5aafc3[_0x58c1('0x2f')]=_0x5aafc3[_0x58c1('0x2f')][_0x58c1('0x30')]?_0x5aafc3['attributes']:_0x373c91[_0x58c1('0x2b')];_0x5aafc3[_0x58c1('0x33')]=qs[_0x58c1('0x34')](_0x5a64a8[_0x58c1('0x2c')][_0x58c1('0x34')]);_0x5aafc3[_0x58c1('0x35')]=qs['filters'](_[_0x58c1('0x68')](_0x5a64a8[_0x58c1('0x2c')],_0x373c91[_0x58c1('0x2d')]));if(_0x5a64a8[_0x58c1('0x2c')][_0x58c1('0x36')]){_0x5aafc3[_0x58c1('0x35')]=_[_0x58c1('0x37')](_0x5aafc3['where'],{'$or':_[_0x58c1('0x27')](_0x5aafc3[_0x58c1('0x2f')],function(_0x134919){var _0x1775b4={};_0x1775b4[_0x134919]={'$like':'%'+_0x5a64a8[_0x58c1('0x2c')]['filter']+'%'};return _0x1775b4;})});}_0x5aafc3=_['merge']({},_0x5aafc3,_0x5a64a8[_0x58c1('0x38')]);return _0x23d299['getSounds'](_0x5aafc3);}})[_0x58c1('0x20')](function(_0x5ddd27){if(_0x5ddd27){_0x114ce9=_0x5ddd27[_0x58c1('0x30')];if(!_0x5a64a8[_0x58c1('0x2c')][_0x58c1('0x31')](_0x58c1('0x32'))){_0x5aafc3[_0x58c1('0x1a')]=qs[_0x58c1('0x1a')](_0x5a64a8['query'][_0x58c1('0x1a')]);_0x5aafc3[_0x58c1('0x18')]=qs[_0x58c1('0x18')](_0x5a64a8['query'][_0x58c1('0x18')]);}return _0x23d299['getSounds'](_0x5aafc3);}})[_0x58c1('0x20')](function(_0x5c89b3){if(_0x5c89b3){return _0x5c89b3?{'count':_0x114ce9,'rows':_0x5c89b3}:null;}})['then'](respondWithResult(_0x2d49ff,null))['catch'](handleError(_0x2d49ff,null));}; \ No newline at end of file +var _0x0ae9=['name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','catch','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','server/files/sounds/converted','%s.%s','basename','symlinkSync','removeSound','id2','converted_format','unlinkSync','format','filter','getSounds','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource'];(function(_0x1a20c6,_0x363058){var _0x4f5a02=function(_0x115808){while(--_0x115808){_0x1a20c6['push'](_0x1a20c6['shift']());}};_0x4f5a02(++_0x363058);}(_0x0ae9,0x12a));var _0x90ae=function(_0x4d9aa2,_0x37cf1f){_0x4d9aa2=_0x4d9aa2-0x0;var _0x544483=_0x0ae9[_0x4d9aa2];return _0x544483;};'use strict';var emlformat=require(_0x90ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90ae('0x2'));var moment=require(_0x90ae('0x3'));var BPromise=require(_0x90ae('0x4'));var Mustache=require(_0x90ae('0x5'));var util=require(_0x90ae('0x6'));var path=require(_0x90ae('0x7'));var sox=require('sox');var csv=require(_0x90ae('0x8'));var ejs=require(_0x90ae('0x9'));var fs=require('fs');var fs_extra=require(_0x90ae('0xa'));var _=require(_0x90ae('0xb'));var squel=require(_0x90ae('0xc'));var crypto=require(_0x90ae('0xd'));var jsforce=require(_0x90ae('0xe'));var deskjs=require(_0x90ae('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90ae('0x10'));var Redis=require(_0x90ae('0x11'));var authService=require(_0x90ae('0x12'));var qs=require(_0x90ae('0x13'));var as=require(_0x90ae('0x14'));var hardwareService=require(_0x90ae('0x15'));var logger=require(_0x90ae('0x16'))(_0x90ae('0x17'));var utils=require(_0x90ae('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x90ae('0x19'));var db=require(_0x90ae('0x1a'))['db'];function respondWithStatusCode(_0x4335b5,_0x44c7a7){_0x44c7a7=_0x44c7a7||0xcc;return function(_0x4f5de6){if(_0x4f5de6){return _0x4335b5[_0x90ae('0x1b')](_0x44c7a7);}return _0x4335b5['status'](_0x44c7a7)[_0x90ae('0x1c')]();};}function respondWithResult(_0x2356b7,_0x13e484){_0x13e484=_0x13e484||0xc8;return function(_0x2958ba){if(_0x2958ba){return _0x2356b7[_0x90ae('0x1d')](_0x13e484)[_0x90ae('0x1e')](_0x2958ba);}};}function respondWithFilteredResult(_0x26b198,_0x429dc7){return function(_0x1ab0e1){if(_0x1ab0e1){var _0x2c9224=typeof _0x429dc7[_0x90ae('0x1f')]===_0x90ae('0x20')&&typeof _0x429dc7[_0x90ae('0x21')]===_0x90ae('0x20');var _0x12c6d7=_0x1ab0e1[_0x90ae('0x22')];var _0x1dc905=_0x2c9224?0x0:_0x429dc7[_0x90ae('0x1f')];var _0x5df3e5=_0x2c9224?_0x1ab0e1[_0x90ae('0x22')]:_0x429dc7['offset']+_0x429dc7['limit'];var _0x286e7a;if(_0x5df3e5>=_0x12c6d7){_0x5df3e5=_0x12c6d7;_0x286e7a=0xc8;}else{_0x286e7a=0xce;}_0x26b198[_0x90ae('0x1d')](_0x286e7a);return _0x26b198[_0x90ae('0x23')](_0x90ae('0x24'),_0x1dc905+'-'+_0x5df3e5+'/'+_0x12c6d7)[_0x90ae('0x1e')](_0x1ab0e1);}return null;};}function patchUpdates(_0x2fdb70){return function(_0x1587e0){try{jsonpatch['apply'](_0x1587e0,_0x2fdb70,!![]);}catch(_0x2957a4){return BPromise[_0x90ae('0x25')](_0x2957a4);}return _0x1587e0[_0x90ae('0x26')]();};}function saveUpdates(_0x4075c6,_0x55b513){return function(_0x950ea4){if(_0x950ea4){return _0x950ea4[_0x90ae('0x27')](_0x4075c6)[_0x90ae('0x28')](function(_0x400a63){return _0x400a63;});}return null;};}function removeEntity(_0x2c8428,_0x137a91){return function(_0x65703f){if(_0x65703f){return _0x65703f[_0x90ae('0x29')]()[_0x90ae('0x28')](function(){var _0x38dd42=_0x65703f[_0x90ae('0x2a')]({'plain':!![]});var _0x4ad38c='MusicOnHolds';return db[_0x90ae('0x2b')][_0x90ae('0x29')]({'where':{'type':_0x4ad38c,'resourceId':_0x38dd42['id']}})[_0x90ae('0x28')](function(){return _0x65703f;});})['then'](function(){_0x2c8428['status'](0xcc)[_0x90ae('0x1c')]();});}};}function handleEntityNotFound(_0x92b33d,_0x1e1f54){return function(_0x36a42b){if(!_0x36a42b){_0x92b33d[_0x90ae('0x1b')](0x194);}return _0x36a42b;};}function handleError(_0x27c37a,_0x52b8cf){_0x52b8cf=_0x52b8cf||0x1f4;return function(_0x22a19e){logger['error'](_0x22a19e['stack']);if(_0x22a19e[_0x90ae('0x2c')]){delete _0x22a19e[_0x90ae('0x2c')];}_0x27c37a[_0x90ae('0x1d')](_0x52b8cf)[_0x90ae('0x2d')](_0x22a19e);};}exports[_0x90ae('0x2e')]=function(_0x25a528,_0x480d40){var _0x2fd2f2={},_0x306494={},_0x24d009={'count':0x0,'rows':[]};var _0x2341f3=_[_0x90ae('0x2f')](db[_0x90ae('0x30')][_0x90ae('0x31')],function(_0x4c8bcd){return{'name':_0x4c8bcd[_0x90ae('0x32')],'type':_0x4c8bcd['type']['key']};});_0x306494[_0x90ae('0x33')]=_[_0x90ae('0x2f')](_0x2341f3,_0x90ae('0x2c'));_0x306494[_0x90ae('0x34')]=_[_0x90ae('0x35')](_0x25a528['query']);_0x306494['filters']=_[_0x90ae('0x36')](_0x306494[_0x90ae('0x33')],_0x306494[_0x90ae('0x34')]);_0x2fd2f2[_0x90ae('0x37')]=_[_0x90ae('0x36')](_0x306494[_0x90ae('0x33')],qs[_0x90ae('0x38')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x38')]));_0x2fd2f2[_0x90ae('0x37')]=_0x2fd2f2['attributes'][_0x90ae('0x39')]?_0x2fd2f2['attributes']:_0x306494['model'];if(!_0x25a528[_0x90ae('0x34')]['hasOwnProperty'](_0x90ae('0x3a'))){_0x2fd2f2['limit']=qs[_0x90ae('0x21')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x21')]);_0x2fd2f2['offset']=qs[_0x90ae('0x1f')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x1f')]);}_0x2fd2f2[_0x90ae('0x3b')]=qs[_0x90ae('0x3c')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x3c')]);delete _0x25a528[_0x90ae('0x34')][_0x90ae('0x3c')];_0x2fd2f2[_0x90ae('0x3d')]=qs[_0x90ae('0x3e')](_['pick'](_0x25a528[_0x90ae('0x34')],_0x306494[_0x90ae('0x3e')]),_0x2341f3);if(_0x25a528[_0x90ae('0x34')]['filter']){_0x2fd2f2[_0x90ae('0x3d')]=_['merge'](_0x2fd2f2[_0x90ae('0x3d')],{'$or':_[_0x90ae('0x2f')](_0x2341f3,function(_0x24e8c3){if(_0x24e8c3['type']!==_0x90ae('0x3f')){var _0x4e2de7={};_0x4e2de7[_0x24e8c3[_0x90ae('0x2c')]]={'$like':'%'+_0x25a528['query']['filter']+'%'};return _0x4e2de7;}})});}_0x2fd2f2=_[_0x90ae('0x40')]({},_0x2fd2f2,_0x25a528[_0x90ae('0x41')]);var _0x5625d4={'where':_0x2fd2f2[_0x90ae('0x3d')]};return db[_0x90ae('0x30')][_0x90ae('0x22')](_0x5625d4)[_0x90ae('0x28')](function(_0x1d3726){_0x24d009[_0x90ae('0x22')]=_0x1d3726;if(_0x25a528['query']['includeAll']){_0x2fd2f2[_0x90ae('0x42')]=[{'all':!![]}];}return db[_0x90ae('0x30')][_0x90ae('0x43')](_0x2fd2f2);})['then'](function(_0x3d0717){_0x24d009[_0x90ae('0x44')]=_0x3d0717;return _0x24d009;})[_0x90ae('0x28')](respondWithFilteredResult(_0x480d40,_0x2fd2f2))['catch'](handleError(_0x480d40,null));};exports[_0x90ae('0x45')]=function(_0x18c206,_0x2ceaef){var _0x4f3485={'raw':![],'where':{'id':_0x18c206[_0x90ae('0x46')]['id']}},_0x4481ca={};_0x4481ca[_0x90ae('0x33')]=_[_0x90ae('0x35')](db[_0x90ae('0x30')][_0x90ae('0x31')]);_0x4481ca['query']=_[_0x90ae('0x35')](_0x18c206[_0x90ae('0x34')]);_0x4481ca[_0x90ae('0x3e')]=_[_0x90ae('0x36')](_0x4481ca[_0x90ae('0x33')],_0x4481ca[_0x90ae('0x34')]);_0x4f3485[_0x90ae('0x37')]=_[_0x90ae('0x36')](_0x4481ca[_0x90ae('0x33')],qs[_0x90ae('0x38')](_0x18c206[_0x90ae('0x34')][_0x90ae('0x38')]));_0x4f3485[_0x90ae('0x37')]=_0x4f3485[_0x90ae('0x37')]['length']?_0x4f3485[_0x90ae('0x37')]:_0x4481ca['model'];if(_0x18c206['query'][_0x90ae('0x47')]){_0x4f3485[_0x90ae('0x42')]=[{'all':!![]}];}_0x4f3485=_['merge']({},_0x4f3485,_0x18c206[_0x90ae('0x41')]);return db['VoiceMusicOnHold'][_0x90ae('0x48')](_0x4f3485)['then'](handleEntityNotFound(_0x2ceaef,null))['then'](respondWithResult(_0x2ceaef,null))[_0x90ae('0x49')](handleError(_0x2ceaef,null));};exports[_0x90ae('0x27')]=function(_0x441ef6,_0x139189){if(_0x441ef6[_0x90ae('0x4a')]['id']){delete _0x441ef6[_0x90ae('0x4a')]['id'];}return db[_0x90ae('0x30')][_0x90ae('0x48')]({'where':{'id':_0x441ef6[_0x90ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x139189,null))[_0x90ae('0x28')](saveUpdates(_0x441ef6['body'],null))[_0x90ae('0x28')](respondWithResult(_0x139189,null))[_0x90ae('0x49')](handleError(_0x139189,null));};exports[_0x90ae('0x4b')]=function(_0x3f3dd1,_0x301878,_0x148b8d){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0x3e797f){if(_0x3f3dd1['body'][_0x90ae('0x4e')]===_0x90ae('0x4f')){_0x3f3dd1[_0x90ae('0x4a')][_0x90ae('0x50')]=path[_0x90ae('0x51')](config[_0x90ae('0x52')],_0x90ae('0x53'),_0x3f3dd1[_0x90ae('0x4a')]['name']);}return db[_0x90ae('0x30')][_0x90ae('0x4b')](_0x3f3dd1['body'],{'transaction':_0x3e797f})['then'](function(_0x406cc2){if(_0x3f3dd1[_0x90ae('0x4a')][_0x90ae('0x4e')]===_0x90ae('0x4f')){fs[_0x90ae('0x54')](_0x406cc2[_0x90ae('0x50')],parseInt(_0x90ae('0x55'),0x8));}var _0x18761d=_0x3f3dd1[_0x90ae('0x56')][_0x90ae('0x2a')]({'plain':!![]});if(!_0x18761d)throw new Error(_0x90ae('0x57'));if(_0x18761d[_0x90ae('0x58')]===_0x90ae('0x56')){var _0x364004=_0x406cc2[_0x90ae('0x2a')]({'plain':!![]});return db[_0x90ae('0x59')][_0x90ae('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x18761d[_0x90ae('0x5a')]},'raw':!![]})['then'](function(_0x4cf603){if(_0x4cf603&&_0x4cf603['autoAssociation']===0x0){return db['UserProfileResource'][_0x90ae('0x4b')]({'name':_0x364004[_0x90ae('0x2c')],'resourceId':_0x364004['id'],'type':_0x4cf603[_0x90ae('0x2c')],'sectionId':_0x4cf603['id']},{})['then'](function(){return _0x406cc2;});}else{return _0x406cc2;}})[_0x90ae('0x49')](function(_0x140850){logger[_0x90ae('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x140850);});}return _0x406cc2;});})[_0x90ae('0x28')](respondWithResult(_0x301878,0xc9))[_0x90ae('0x49')](handleError(_0x301878,null));};exports[_0x90ae('0x29')]=function(_0x38b0c2,_0x32e400,_0x1ffdd2){var _0x3f9a51;return db[_0x90ae('0x30')][_0x90ae('0x48')]({'where':{'id':_0x38b0c2['params']['id']}})['then'](function(_0x16c09d){if(_0x16c09d){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0x45a877){return _0x16c09d[_0x90ae('0x29')]({'transaction':_0x45a877,'raw':!![]})[_0x90ae('0x28')](function(_0x48b73d){if(_0x48b73d['directory']){fs[_0x90ae('0x5c')](_0x48b73d['directory'])[_0x90ae('0x5d')](function(_0x13a4c2){fs['unlinkSync'](path[_0x90ae('0x51')](_0x48b73d[_0x90ae('0x50')],_0x13a4c2));});fs[_0x90ae('0x5e')](_0x48b73d[_0x90ae('0x50')]);}return _0x48b73d;});})['catch'](function(_0x34f10f){throw new db[(_0x90ae('0x5f'))][(_0x90ae('0x60'))](_0x34f10f[_0x90ae('0x61')]);});}})[_0x90ae('0x28')](handleEntityNotFound(_0x32e400,null))['then'](removeEntity(_0x32e400,null))[_0x90ae('0x49')](handleError(_0x32e400,null));};exports[_0x90ae('0x62')]=function(_0x3d3f3e,_0x294bad,_0x2ae76b){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0xce756d){var _0x368e4d;return db[_0x90ae('0x30')][_0x90ae('0x48')]({'where':{'id':_0x3d3f3e[_0x90ae('0x46')]['id']}})[_0x90ae('0x28')](function(_0x218473){if(_0x218473){_0x368e4d=_0x218473;return _0x218473['addSound'](_0x3d3f3e[_0x90ae('0x4a')]['id'],{'transaction':_0xce756d});}})[_0x90ae('0x28')](function(_0x1add61){if(_0x1add61){return db[_0x90ae('0x63')][_0x90ae('0x64')]({'where':{'id':_0x3d3f3e[_0x90ae('0x4a')]['id']},'attributes':['id','name',_0x90ae('0x65'),'converted_format','createdAt'],'raw':!![]});}})[_0x90ae('0x28')](function(_0x1681b6){if(_0x1681b6){var _0x5a947f=path[_0x90ae('0x51')](config[_0x90ae('0x52')],_0x90ae('0x66'),util['format'](_0x90ae('0x67'),path[_0x90ae('0x68')](_0x1681b6[_0x90ae('0x65')],path['extname'](_0x1681b6[_0x90ae('0x65')])),_0x1681b6['converted_format']));var _0x2922c4=path[_0x90ae('0x51')](config[_0x90ae('0x52')],_0x90ae('0x53'),_0x368e4d[_0x90ae('0x2c')],util['format'](_0x90ae('0x67'),_0x1681b6['name'],_0x1681b6['converted_format']));fs[_0x90ae('0x69')](_0x5a947f,_0x2922c4);return _0x1681b6;}})[_0x90ae('0x49')](function(_0xa542d0){throw new db[(_0x90ae('0x5f'))][(_0x90ae('0x60'))](_0xa542d0[_0x90ae('0x61')]);});})[_0x90ae('0x28')](handleEntityNotFound(_0x294bad,null))[_0x90ae('0x28')](respondWithResult(_0x294bad,0xc9))[_0x90ae('0x49')](handleError(_0x294bad,null));};exports[_0x90ae('0x6a')]=function(_0x22e5a2,_0x534d10,_0x120c71){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0x43b602){var _0x4ce1d2;return db[_0x90ae('0x30')][_0x90ae('0x64')]({'where':{'id':_0x22e5a2[_0x90ae('0x46')]['id']}})[_0x90ae('0x28')](handleEntityNotFound(_0x534d10,null))[_0x90ae('0x28')](function(_0x4ac836){if(_0x4ac836){_0x4ce1d2=_0x4ac836;return _0x4ac836[_0x90ae('0x6a')](_0x22e5a2[_0x90ae('0x46')][_0x90ae('0x6b')]);}})[_0x90ae('0x28')](function(_0x160b75){if(_0x160b75){return db[_0x90ae('0x63')]['findOne']({'where':{'id':_0x22e5a2[_0x90ae('0x46')][_0x90ae('0x6b')]},'attributes':['id',_0x90ae('0x2c'),'save_name',_0x90ae('0x6c'),'createdAt'],'raw':!![]});}})[_0x90ae('0x28')](function(_0x3739d9){if(_0x3739d9){fs[_0x90ae('0x6d')](path[_0x90ae('0x51')](_0x4ce1d2[_0x90ae('0x50')],util[_0x90ae('0x6e')](_0x90ae('0x67'),_0x3739d9[_0x90ae('0x2c')],_0x3739d9[_0x90ae('0x6c')])));return _0x3739d9;}})[_0x90ae('0x49')](function(_0x3ee88f){throw new db[(_0x90ae('0x5f'))]['ValidationError'](_0x3ee88f[_0x90ae('0x61')]);});})[_0x90ae('0x28')](handleEntityNotFound(_0x534d10,null))[_0x90ae('0x28')](respondWithStatusCode(_0x534d10,0xcc))[_0x90ae('0x49')](handleError(_0x534d10,null));};exports['getSounds']=function(_0xc78866,_0xef0601,_0x2b9dc2){var _0x2aaf65={};var _0x52a958={};var _0x3ed6f3;var _0x51338b;return db[_0x90ae('0x30')][_0x90ae('0x64')]({'where':{'id':_0xc78866[_0x90ae('0x46')]['id']}})[_0x90ae('0x28')](handleEntityNotFound(_0xef0601,null))[_0x90ae('0x28')](function(_0x1a9119){if(_0x1a9119){_0x3ed6f3=_0x1a9119;_0x52a958['model']=_[_0x90ae('0x35')](db[_0x90ae('0x63')][_0x90ae('0x31')]);_0x52a958[_0x90ae('0x34')]=_[_0x90ae('0x35')](_0xc78866[_0x90ae('0x34')]);_0x52a958[_0x90ae('0x3e')]=_[_0x90ae('0x36')](_0x52a958[_0x90ae('0x33')],_0x52a958['query']);_0x2aaf65[_0x90ae('0x37')]=_[_0x90ae('0x36')](_0x52a958[_0x90ae('0x33')],qs[_0x90ae('0x38')](_0xc78866[_0x90ae('0x34')][_0x90ae('0x38')]));_0x2aaf65[_0x90ae('0x37')]=_0x2aaf65[_0x90ae('0x37')][_0x90ae('0x39')]?_0x2aaf65[_0x90ae('0x37')]:_0x52a958[_0x90ae('0x33')];_0x2aaf65['order']=qs[_0x90ae('0x3c')](_0xc78866[_0x90ae('0x34')][_0x90ae('0x3c')]);_0x2aaf65[_0x90ae('0x3d')]=qs[_0x90ae('0x3e')](_['pick'](_0xc78866[_0x90ae('0x34')],_0x52a958['filters']));if(_0xc78866[_0x90ae('0x34')]['filter']){_0x2aaf65[_0x90ae('0x3d')]=_[_0x90ae('0x40')](_0x2aaf65[_0x90ae('0x3d')],{'$or':_[_0x90ae('0x2f')](_0x2aaf65[_0x90ae('0x37')],function(_0x4bbe3b){var _0x44ae54={};_0x44ae54[_0x4bbe3b]={'$like':'%'+_0xc78866[_0x90ae('0x34')][_0x90ae('0x6f')]+'%'};return _0x44ae54;})});}_0x2aaf65=_['merge']({},_0x2aaf65,_0xc78866['options']);return _0x3ed6f3[_0x90ae('0x70')](_0x2aaf65);}})[_0x90ae('0x28')](function(_0x2ffcdb){if(_0x2ffcdb){_0x51338b=_0x2ffcdb['length'];if(!_0xc78866[_0x90ae('0x34')][_0x90ae('0x71')](_0x90ae('0x3a'))){_0x2aaf65[_0x90ae('0x21')]=qs[_0x90ae('0x21')](_0xc78866['query'][_0x90ae('0x21')]);_0x2aaf65['offset']=qs[_0x90ae('0x1f')](_0xc78866[_0x90ae('0x34')][_0x90ae('0x1f')]);}return _0x3ed6f3[_0x90ae('0x70')](_0x2aaf65);}})[_0x90ae('0x28')](function(_0x20a1ca){if(_0x20a1ca){return _0x20a1ca?{'count':_0x51338b,'rows':_0x20a1ca}:null;}})[_0x90ae('0x28')](respondWithResult(_0xef0601,null))[_0x90ae('0x49')](handleError(_0xef0601,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index b27ea5d..6eeab41 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 _0x2ee7=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','path'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x2ee7,0x8b));var _0x72ee=function(_0x282b9b,_0x4b1562){_0x282b9b=_0x282b9b-0x0;var _0x12282e=_0x2ee7[_0x282b9b];return _0x12282e;};'use strict';var _=require(_0x72ee('0x0'));var util=require(_0x72ee('0x1'));var logger=require(_0x72ee('0x2'))('api');var moment=require(_0x72ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x72ee('0x4'));var rimraf=require(_0x72ee('0x5'));var config=require(_0x72ee('0x6'));var attributes=require(_0x72ee('0x7'));module[_0x72ee('0x8')]=function(_0x2dfc99,_0x29899e){return _0x2dfc99[_0x72ee('0x9')](_0x72ee('0xa'),attributes,{'tableName':_0x72ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e43=['api','moment','bluebird','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x4c6659,_0x45622b){var _0x3abc20=function(_0x427560){while(--_0x427560){_0x4c6659['push'](_0x4c6659['shift']());}};_0x3abc20(++_0x45622b);}(_0x6e43,0x11b));var _0x36e4=function(_0x30d0a4,_0x52475b){_0x30d0a4=_0x30d0a4-0x0;var _0x58d636=_0x6e43[_0x30d0a4];return _0x58d636;};'use strict';var _=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var logger=require(_0x36e4('0x2'))(_0x36e4('0x3'));var moment=require(_0x36e4('0x4'));var BPromise=require(_0x36e4('0x5'));var rp=require(_0x36e4('0x6'));var fs=require('fs');var path=require(_0x36e4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x36e4('0x8'));module[_0x36e4('0x9')]=function(_0x5de7e3,_0x27719c){return _0x5de7e3[_0x36e4('0xa')](_0x36e4('0xb'),attributes,{'tableName':_0x36e4('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 3f8efa4..ac01c2f 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3ce84e,_0x587fa6){var _0x169ac5=function(_0x128c07){while(--_0x128c07){_0x3ce84e['push'](_0x3ce84e['shift']());}};_0x169ac5(++_0x587fa6);}(_0x70e0,0x17b));var _0x070e=function(_0x3c0378,_0x5719a7){_0x3c0378=_0x3c0378-0x0;var _0x4d5574=_0x70e0[_0x3c0378];return _0x4d5574;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _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(_0x1a00e8,_0x2746b8){var _0x5acb59=function(_0x583908){while(--_0x583908){_0x1a00e8['push'](_0x1a00e8['shift']());}};_0x5acb59(++_0x2746b8);}(_0xedd9,0xfc));var _0x9edd=function(_0x48e697,_0x3d43d3){_0x48e697=_0x48e697-0x0;var _0x3a6f5f=_0xedd9[_0x48e697];return _0x3a6f5f;};'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 c1636c8..df48b3d 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 _0x4a9c=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','/:id','update','delete','destroy','removeAgents'];(function(_0x11160d,_0x413adc){var _0x21520a=function(_0x272f3c){while(--_0x272f3c){_0x11160d['push'](_0x11160d['shift']());}};_0x21520a(++_0x413adc);}(_0x4a9c,0xcc));var _0xc4a9=function(_0xfe81b,_0xf30553){_0xfe81b=_0xfe81b-0x0;var _0x3edef8=_0x4a9c[_0xfe81b];return _0x3edef8;};'use strict';var multer=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var path=require(_0xc4a9('0x2'));var timeout=require(_0xc4a9('0x3'));var express=require(_0xc4a9('0x4'));var router=express[_0xc4a9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc4a9('0x6'));var interaction=require(_0xc4a9('0x7'));var config=require(_0xc4a9('0x8'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0xc4a9('0x9')](),controller[_0xc4a9('0xa')]);router[_0xc4a9('0xb')](_0xc4a9('0xc'),auth['isAuthenticated'](),controller[_0xc4a9('0xd')]);router['get']('/:id',auth[_0xc4a9('0x9')](),controller[_0xc4a9('0xe')]);router[_0xc4a9('0xb')](_0xc4a9('0xf'),auth[_0xc4a9('0x9')](),controller[_0xc4a9('0x10')]);router[_0xc4a9('0xb')](_0xc4a9('0x11'),auth[_0xc4a9('0x9')](),controller[_0xc4a9('0x12')]);router[_0xc4a9('0x13')]('/',auth['isAuthenticated'](),controller[_0xc4a9('0x14')]);router[_0xc4a9('0x13')](_0xc4a9('0xf'),auth['isAuthenticated'](),controller[_0xc4a9('0x15')]);router[_0xc4a9('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc4a9('0x16')]);router['put'](_0xc4a9('0x17'),auth[_0xc4a9('0x9')](),controller[_0xc4a9('0x18')]);router[_0xc4a9('0x19')](_0xc4a9('0x17'),auth['isAuthenticated'](),controller[_0xc4a9('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xc4a9('0x1b')]);router[_0xc4a9('0x19')]('/:id/teams',auth[_0xc4a9('0x9')](),controller['removeTeams']);module[_0xc4a9('0x1c')]=router; \ No newline at end of file +var _0xfa12=['../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','addAgents','addTeams','update','delete','destroy','removeTeams','exports','multer','util','path','Router','fs-extra'];(function(_0x58bba6,_0x49938f){var _0x54d408=function(_0x299411){while(--_0x299411){_0x58bba6['push'](_0x58bba6['shift']());}};_0x54d408(++_0x49938f);}(_0xfa12,0x1bd));var _0x2fa1=function(_0xf03b59,_0x45b9b3){_0xf03b59=_0xf03b59-0x0;var _0x54e57d=_0xfa12[_0xf03b59];return _0x54e57d;};'use strict';var multer=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var path=require(_0x2fa1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fa1('0x3')]();var fs_extra=require(_0x2fa1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fa1('0x5'));var controller=require(_0x2fa1('0x6'));router[_0x2fa1('0x7')]('/',auth['isAuthenticated'](),controller[_0x2fa1('0x8')]);router['get'](_0x2fa1('0x9'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0xb')]);router[_0x2fa1('0x7')](_0x2fa1('0xc'),auth[_0x2fa1('0xa')](),controller['show']);router[_0x2fa1('0x7')](_0x2fa1('0xd'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0xe')]);router[_0x2fa1('0x7')](_0x2fa1('0xf'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x10')]);router['post']('/',auth[_0x2fa1('0xa')](),controller['create']);router[_0x2fa1('0x11')]('/:id/users',auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x12')]);router[_0x2fa1('0x11')](_0x2fa1('0xf'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x13')]);router['put'](_0x2fa1('0xc'),auth['isAuthenticated'](),controller[_0x2fa1('0x14')]);router[_0x2fa1('0x15')]('/:id',auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x16')]);router[_0x2fa1('0x15')](_0x2fa1('0xd'),auth[_0x2fa1('0xa')](),controller['removeAgents']);router['delete'](_0x2fa1('0xf'),auth['isAuthenticated'](),controller[_0x2fa1('0x17')]);module[_0x2fa1('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 77a5a64..50029bf 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 _0xdd7a=['STRING','name','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xdd7a,0x6e));var _0xadd7=function(_0x1ef7e4,_0x3d67e4){_0x1ef7e4=_0x1ef7e4-0x0;var _0x204bfc=_0xdd7a[_0x1ef7e4];return _0x204bfc;};'use strict';var Sequelize=require(_0xadd7('0x0'));module[_0xadd7('0x1')]={'name':{'type':Sequelize[_0xadd7('0x2')],'allowNull':![],'unique':_0xadd7('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x52cf34){return _0xadd7('0x4')+this[_0xadd7('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xadd7('0x2')]},'callerIdAll':{'type':Sequelize[_0xadd7('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xadd7('0x6')]}}; \ No newline at end of file +var _0x2935=['name','VIRTUAL','getDataValue','INTEGER','exports','STRING'];(function(_0x1d85e3,_0x125cff){var _0x38f84a=function(_0x1e481b){while(--_0x1e481b){_0x1d85e3['push'](_0x1d85e3['shift']());}};_0x38f84a(++_0x125cff);}(_0x2935,0x8e));var _0x5293=function(_0x4ddb18,_0x433cd5){_0x4ddb18=_0x4ddb18-0x0;var _0x453631=_0x2935[_0x4ddb18];return _0x453631;};'use strict';var Sequelize=require('sequelize');module[_0x5293('0x0')]={'name':{'type':Sequelize[_0x5293('0x1')],'allowNull':![],'unique':_0x5293('0x2')},'prefix':{'type':Sequelize[_0x5293('0x3')],'get':function(_0x4229ec){return'system-'+this[_0x5293('0x4')](_0x5293('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x5293('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x5293('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index c2a5a40..33dddcd 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 _0x7916=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','reject','then','destroy','get','UserProfileResource','end','error','name','send','index','map','VoicePrefix','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','rawAttributes','length','find','catch','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','charAt','update','system-','transaction','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getTeams','Team','findAll','Agents','online','interface','flatMap','upsert','each','UserVoicePrefix','findOrCreate','forEach','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse'];(function(_0x3606e9,_0x18fe4e){var _0x44f882=function(_0x28704e){while(--_0x28704e){_0x3606e9['push'](_0x3606e9['shift']());}};_0x44f882(++_0x18fe4e);}(_0x7916,0x128));var _0x6791=function(_0x534305,_0x11a876){_0x534305=_0x534305-0x0;var _0x5cfadc=_0x7916[_0x534305];return _0x5cfadc;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var licenseUtil=require(_0x6791('0x15'));var db=require(_0x6791('0x16'))['db'];config[_0x6791('0x17')]=_[_0x6791('0x18')](config[_0x6791('0x17')],{'host':_0x6791('0x19'),'port':0x18eb});var socket=require(_0x6791('0x1a'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x6791('0x1b')](socket);function respondWithStatusCode(_0x5122f9,_0x2a9151){_0x2a9151=_0x2a9151||0xcc;return function(_0x4c32a1){if(_0x4c32a1){return _0x5122f9[_0x6791('0x1c')](_0x2a9151);}return _0x5122f9[_0x6791('0x1d')](_0x2a9151)['end']();};}function respondWithResult(_0x3e4792,_0x4b80ed){_0x4b80ed=_0x4b80ed||0xc8;return function(_0x3856ac){if(_0x3856ac){return _0x3e4792[_0x6791('0x1d')](_0x4b80ed)['json'](_0x3856ac);}};}function respondWithFilteredResult(_0xbc35d,_0x36d7a1){return function(_0x5bec14){if(_0x5bec14){var _0x1872f5=typeof _0x36d7a1['offset']===_0x6791('0x1e')&&typeof _0x36d7a1[_0x6791('0x1f')]===_0x6791('0x1e');var _0x3a72ce=_0x5bec14[_0x6791('0x20')];var _0x2bc0ab=_0x1872f5?0x0:_0x36d7a1[_0x6791('0x21')];var _0x581d51=_0x1872f5?_0x5bec14[_0x6791('0x20')]:_0x36d7a1[_0x6791('0x21')]+_0x36d7a1['limit'];var _0x21ef16;if(_0x581d51>=_0x3a72ce){_0x581d51=_0x3a72ce;_0x21ef16=0xc8;}else{_0x21ef16=0xce;}_0xbc35d[_0x6791('0x1d')](_0x21ef16);return _0xbc35d['set'](_0x6791('0x22'),_0x2bc0ab+'-'+_0x581d51+'/'+_0x3a72ce)[_0x6791('0x23')](_0x5bec14);}return null;};}function patchUpdates(_0x15b9ab){return function(_0x12d83b){try{jsonpatch['apply'](_0x12d83b,_0x15b9ab,!![]);}catch(_0x3e17b3){return BPromise[_0x6791('0x24')](_0x3e17b3);}return _0x12d83b['save']();};}function saveUpdates(_0x53bb44,_0x4b23bc){return function(_0x372dae){if(_0x372dae){return _0x372dae['update'](_0x53bb44)[_0x6791('0x25')](function(_0x5409f1){return _0x5409f1;});}return null;};}function removeEntity(_0x54a092,_0x496273){return function(_0x5cadc){if(_0x5cadc){return _0x5cadc[_0x6791('0x26')]()[_0x6791('0x25')](function(){var _0x56a74e=_0x5cadc[_0x6791('0x27')]({'plain':!![]});var _0x30cc17='VoicePrefixes';return db[_0x6791('0x28')]['destroy']({'where':{'type':_0x30cc17,'resourceId':_0x56a74e['id']}})[_0x6791('0x25')](function(){return _0x5cadc;});})['then'](function(){_0x54a092['status'](0xcc)[_0x6791('0x29')]();});}};}function handleEntityNotFound(_0x551718,_0x2f56a2){return function(_0x34b006){if(!_0x34b006){_0x551718['sendStatus'](0x194);}return _0x34b006;};}function handleError(_0x240a9f,_0x273f79){_0x273f79=_0x273f79||0x1f4;return function(_0x234c5e){logger[_0x6791('0x2a')](_0x234c5e['stack']);if(_0x234c5e['name']){delete _0x234c5e[_0x6791('0x2b')];}_0x240a9f['status'](_0x273f79)[_0x6791('0x2c')](_0x234c5e);};}exports[_0x6791('0x2d')]=function(_0x30397e,_0x2b98b8){var _0x1d551b={},_0x127bfa={},_0x8e2101={'count':0x0,'rows':[]};var _0x14307e=_[_0x6791('0x2e')](db[_0x6791('0x2f')]['rawAttributes'],function(_0x28b3d4){return{'name':_0x28b3d4[_0x6791('0x30')],'type':_0x28b3d4[_0x6791('0x31')][_0x6791('0x32')]};});_0x127bfa[_0x6791('0x33')]=_[_0x6791('0x2e')](_0x14307e,'name');_0x127bfa['query']=_['keys'](_0x30397e[_0x6791('0x34')]);_0x127bfa[_0x6791('0x35')]=_[_0x6791('0x36')](_0x127bfa['model'],_0x127bfa['query']);_0x1d551b[_0x6791('0x37')]=_[_0x6791('0x36')](_0x127bfa[_0x6791('0x33')],qs[_0x6791('0x38')](_0x30397e['query'][_0x6791('0x38')]));_0x1d551b[_0x6791('0x37')]=_0x1d551b[_0x6791('0x37')]['length']?_0x1d551b[_0x6791('0x37')]:_0x127bfa['model'];if(!_0x30397e['query'][_0x6791('0x39')](_0x6791('0x3a'))){_0x1d551b['limit']=qs[_0x6791('0x1f')](_0x30397e[_0x6791('0x34')][_0x6791('0x1f')]);_0x1d551b[_0x6791('0x21')]=qs[_0x6791('0x21')](_0x30397e['query'][_0x6791('0x21')]);}_0x1d551b[_0x6791('0x3b')]=qs[_0x6791('0x3c')](_0x30397e['query'][_0x6791('0x3c')]);_0x1d551b[_0x6791('0x3d')]=qs[_0x6791('0x35')](_['pick'](_0x30397e[_0x6791('0x34')],_0x127bfa[_0x6791('0x35')]),_0x14307e);if(_0x30397e[_0x6791('0x34')][_0x6791('0x3e')]){_0x1d551b['where']=_[_0x6791('0x3f')](_0x1d551b[_0x6791('0x3d')],{'$or':_[_0x6791('0x2e')](_0x14307e,function(_0xd0f1c){if(_0xd0f1c[_0x6791('0x31')]!==_0x6791('0x40')){var _0x2688a9={};_0x2688a9[_0xd0f1c[_0x6791('0x2b')]]={'$like':'%'+_0x30397e[_0x6791('0x34')]['filter']+'%'};return _0x2688a9;}})});}_0x1d551b=_['merge']({},_0x1d551b,_0x30397e[_0x6791('0x41')]);var _0xe11675={'where':_0x1d551b['where']};return db[_0x6791('0x2f')][_0x6791('0x20')](_0xe11675)[_0x6791('0x25')](function(_0x3edb86){_0x8e2101[_0x6791('0x20')]=_0x3edb86;if(_0x30397e[_0x6791('0x34')][_0x6791('0x42')]){_0x1d551b['include']=[{'all':!![]}];}return db[_0x6791('0x2f')]['findAll'](_0x1d551b);})[_0x6791('0x25')](function(_0xfc170e){_0x8e2101[_0x6791('0x43')]=_0xfc170e;return _0x8e2101;})[_0x6791('0x25')](respondWithFilteredResult(_0x2b98b8,_0x1d551b))['catch'](handleError(_0x2b98b8,null));};exports[_0x6791('0x44')]=function(_0x4f0e2d,_0xeb9d45){var _0x3251e9={'raw':![],'where':{'id':_0x4f0e2d[_0x6791('0x45')]['id']}},_0x5a7fb6={};_0x5a7fb6[_0x6791('0x33')]=_[_0x6791('0x46')](db['VoicePrefix'][_0x6791('0x47')]);_0x5a7fb6[_0x6791('0x34')]=_[_0x6791('0x46')](_0x4f0e2d[_0x6791('0x34')]);_0x5a7fb6['filters']=_[_0x6791('0x36')](_0x5a7fb6[_0x6791('0x33')],_0x5a7fb6['query']);_0x3251e9[_0x6791('0x37')]=_['intersection'](_0x5a7fb6[_0x6791('0x33')],qs[_0x6791('0x38')](_0x4f0e2d[_0x6791('0x34')][_0x6791('0x38')]));_0x3251e9[_0x6791('0x37')]=_0x3251e9[_0x6791('0x37')][_0x6791('0x48')]?_0x3251e9[_0x6791('0x37')]:_0x5a7fb6[_0x6791('0x33')];if(_0x4f0e2d['query'][_0x6791('0x42')]){_0x3251e9['include']=[{'all':!![]}];}_0x3251e9=_[_0x6791('0x3f')]({},_0x3251e9,_0x4f0e2d[_0x6791('0x41')]);return db[_0x6791('0x2f')][_0x6791('0x49')](_0x3251e9)[_0x6791('0x25')](handleEntityNotFound(_0xeb9d45,null))['then'](respondWithResult(_0xeb9d45,null))[_0x6791('0x4a')](handleError(_0xeb9d45,null));};exports[_0x6791('0x26')]=function(_0x235b56,_0x3d22f3){return db[_0x6791('0x2f')]['find']({'where':{'id':_0x235b56[_0x6791('0x45')]['id']}})[_0x6791('0x25')](handleEntityNotFound(_0x3d22f3,null))['then'](removeEntity(_0x3d22f3,null))[_0x6791('0x4a')](handleError(_0x3d22f3,null));};exports['describe']=function(_0x3d4b7e,_0x22a4d3){return db[_0x6791('0x2f')][_0x6791('0x4b')]()['then'](respondWithResult(_0x22a4d3,null))[_0x6791('0x4a')](handleError(_0x22a4d3,null));};exports[_0x6791('0x4c')]=function(_0x5655c8,_0x189b22){var _0x4370ab;return db[_0x6791('0x4d')]['transaction'](function(_0x355e97){return db[_0x6791('0x2f')]['create'](_0x5655c8[_0x6791('0x4e')],{'transaction':_0x355e97})[_0x6791('0x25')](function(_0x49d583){_0x4370ab=_0x49d583[_0x6791('0x27')]({'plain':!![]});return db[_0x6791('0x4f')][_0x6791('0x49')]({'where':{'id':_0x4370ab[_0x6791('0x50')]},'raw':!![]})['then'](function(_0x3c1076){return createVoicePrefixExtensions(_0x4370ab,_0x3c1076,_0x355e97);});});})[_0x6791('0x25')](function(){var _0x32f36b=_0x5655c8['user']['get']({'plain':!![]});if(!_0x32f36b)throw new Error(_0x6791('0x51'));if(_0x32f36b[_0x6791('0x52')]===_0x6791('0x53')){var _0x45756f=_0x4370ab;return db[_0x6791('0x54')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x32f36b[_0x6791('0x55')]},'raw':!![]})['then'](function(_0x51f071){if(_0x51f071&&_0x51f071[_0x6791('0x56')]===0x0){return db[_0x6791('0x28')][_0x6791('0x4c')]({'name':_0x45756f[_0x6791('0x2b')],'resourceId':_0x45756f['id'],'type':_0x51f071[_0x6791('0x2b')],'sectionId':_0x51f071['id']},{})[_0x6791('0x25')](function(){return _0x4370ab;});}else{return _0x4370ab;}})['catch'](function(_0x5a30f3){logger[_0x6791('0x2a')](_0x6791('0x57'),_0x5a30f3);throw _0x5a30f3;});}return _0x4370ab;})['then'](respondWithResult(_0x189b22,null))[_0x6791('0x4a')](handleError(_0x189b22,null));};function Extension(_0x535ecf,_0x473443,_0x15fb6c,_0x50cf85){this[_0x6791('0x58')]=_0x6791('0x59');this[_0x6791('0x5a')]=_0x535ecf;this['app']=_0x15fb6c;this[_0x6791('0x31')]=_0x6791('0x5b');this[_0x6791('0x5c')]=_0x6791('0x5d');this[_0x6791('0x5e')]=_0x473443;this['appdata']=_0x50cf85;}function createVoicePrefixExtensions(_0x54d0ba,_0x1a9acd,_0x13430e){return new BPromise(function(_0x5d2668,_0x329fc0){var _0x466a64=new Extension(formatPrefixName(_0x54d0ba[_0x6791('0x5f')]),0x1,_0x6791('0x60'),_0x6791('0x61'));_0x466a64[_0x6791('0x62')]=_0x54d0ba['id'];return db[_0x6791('0x4f')][_0x6791('0x4c')](_0x466a64,{'transaction':_0x13430e})['then'](function(_0x2c5f12){var _0x3b46bf=_0x2c5f12[_0x6791('0x27')]({'plain':!![]});var _0x1a9a2e=_['map'](addVoicePrefixExtensions(_0x54d0ba,_0x1a9acd),function(_0x16dff7){_0x16dff7[_0x6791('0x50')]=_0x3b46bf['id'];_0x16dff7[_0x6791('0x62')]=_0x54d0ba['id'];return _0x16dff7;});return db['VoiceExtension'][_0x6791('0x63')](_0x1a9a2e,{'transaction':_0x13430e})[_0x6791('0x25')](function(_0x99d4ee){if(!_0x99d4ee){return _0x329fc0(_0x6791('0x64'));}else{return _0x5d2668(_0x99d4ee);}})['catch'](function(_0x2c834f){return _0x329fc0(_0x2c834f);});});;});};function addVoicePrefixExtensions(_0x2843fb,_0x5522db){var _0x1114d4=[];var _0x901cc1=formatPrefixName(_0x2843fb[_0x6791('0x5f')]);_0x1114d4[_0x6791('0x65')](new Extension(_0x901cc1,0x2,_0x6791('0x66'),_0x6791('0x67')+_0x2843fb['name']));if(_0x2843fb[_0x6791('0x68')]){_0x1114d4[_0x6791('0x65')](new Extension(_0x901cc1,0x3,_0x6791('0x66'),'PREFIX-CALLERIDALL='+_0x2843fb[_0x6791('0x68')]));}else{_0x1114d4['push'](new Extension(_0x901cc1,0x3,_0x6791('0x60'),_0x6791('0x69')));}_0x1114d4[_0x6791('0x65')](new Extension(_0x901cc1,0x4,_0x6791('0x6a'),_0x5522db[_0x6791('0x58')]+','+'${EXTEN:'+(0x8+_0x2843fb[_0x6791('0x2b')][_0x6791('0x48')])+'}'+','+0x1));return _0x1114d4;}function formatPrefixName(_0x375062){var _0x2accfa='_';for(var _0x5f158f=0x0;_0x5f158f<_0x375062[_0x6791('0x48')];_0x5f158f++){if(_0x375062[_0x6791('0x6b')](_0x5f158f)=='-'){_0x2accfa+=_0x375062['charAt'](_0x5f158f);}else{_0x2accfa+='['+_0x375062[_0x6791('0x6b')](_0x5f158f)+']';}}_0x2accfa+='.';return _0x2accfa;}exports[_0x6791('0x6c')]=function(_0x567302,_0x201465,_0x23b9b4){var _0x113d9f=_0x567302[_0x6791('0x4e')];_0x113d9f['prefix']=_0x6791('0x6d')+_0x113d9f[_0x6791('0x2b')]+'-';return db['sequelize'][_0x6791('0x6e')](function(_0x26c2aa){return db[_0x6791('0x2f')][_0x6791('0x6c')](_0x113d9f,{'where':{'id':_0x113d9f['id']},'transaction':_0x26c2aa})[_0x6791('0x25')](function(){return db['VoiceExtension'][_0x6791('0x26')]({'where':{'VoicePrefixId':_0x113d9f['id']},'transaction':_0x26c2aa})[_0x6791('0x25')](function(){return db['VoiceExtension'][_0x6791('0x49')]({'where':{'id':_0x113d9f[_0x6791('0x50')]},'raw':!![]})[_0x6791('0x25')](function(_0x4bbf2d){return createVoicePrefixExtensions(_0x113d9f,_0x4bbf2d,_0x26c2aa);});});});})[_0x6791('0x25')](function(){return db[_0x6791('0x2f')][_0x6791('0x6f')](_0x113d9f['id']);})[_0x6791('0x25')](respondWithResult(_0x201465,null))[_0x6791('0x4a')](handleError(_0x201465,null));};exports[_0x6791('0x70')]=function(_0x367dc9,_0x30b3e6,_0x4cca28){return db[_0x6791('0x2f')][_0x6791('0x49')]({'where':{'id':_0x367dc9['params']['id']}})[_0x6791('0x25')](handleEntityNotFound(_0x30b3e6,null))[_0x6791('0x25')](function(_0x410a66){if(_0x410a66){return _0x410a66['addAgents'](_0x367dc9[_0x6791('0x4e')]['ids'],_[_0x6791('0x71')](_0x367dc9[_0x6791('0x4e')],[_0x6791('0x72'),'id'])||{})[_0x6791('0x73')](function(_0x3a964a){for(var _0x2d15b5=0x0;_0x2d15b5<_0x367dc9[_0x6791('0x4e')][_0x6791('0x72')][_0x6791('0x48')];_0x2d15b5+=0x1){socket[_0x6791('0x74')](_0x6791('0x75'),{'UserId':Number(_0x367dc9[_0x6791('0x4e')][_0x6791('0x72')][_0x2d15b5]),'VoicePrefixId':Number(_0x367dc9[_0x6791('0x45')]['id'])});}return _0x3a964a;});}})[_0x6791('0x25')](respondWithResult(_0x30b3e6,null))[_0x6791('0x4a')](handleError(_0x30b3e6,null));};exports[_0x6791('0x76')]=function(_0x386bc7,_0xc6c959,_0x5cf7d7){return db['VoicePrefix']['find']({'where':{'id':_0x386bc7[_0x6791('0x45')]['id']}})[_0x6791('0x25')](handleEntityNotFound(_0xc6c959,null))[_0x6791('0x25')](function(_0x194a0b){if(_0x194a0b){return _0x194a0b[_0x6791('0x76')](_0x386bc7[_0x6791('0x34')][_0x6791('0x72')])[_0x6791('0x25')](function(){if(_[_0x6791('0x77')](_0x386bc7[_0x6791('0x34')][_0x6791('0x72')])){for(var _0x37ae6b=0x0;_0x37ae6b<_0x386bc7[_0x6791('0x34')][_0x6791('0x72')][_0x6791('0x48')];_0x37ae6b+=0x1){socket[_0x6791('0x74')](_0x6791('0x78'),{'UserId':Number(_0x386bc7[_0x6791('0x34')][_0x6791('0x72')][_0x37ae6b]),'VoicePrefixId':Number(_0x386bc7[_0x6791('0x45')]['id'])});}}else{socket[_0x6791('0x74')](_0x6791('0x78'),{'UserId':Number(_0x386bc7[_0x6791('0x34')][_0x6791('0x72')]),'VoicePrefixId':Number(_0x386bc7[_0x6791('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0xc6c959,null))[_0x6791('0x4a')](handleError(_0xc6c959,null));};exports['getAgents']=function(_0x8d9556,_0x11eb22,_0x4b262c){var _0x1c2864={};var _0x503041={};var _0x27e3bd;var _0x26e77c;return db['VoicePrefix'][_0x6791('0x79')]({'where':{'id':_0x8d9556[_0x6791('0x45')]['id']}})[_0x6791('0x25')](handleEntityNotFound(_0x11eb22,null))['then'](function(_0x41fcf4){if(_0x41fcf4){_0x27e3bd=_0x41fcf4;_0x503041[_0x6791('0x33')]=_[_0x6791('0x46')](db[_0x6791('0x7a')][_0x6791('0x47')]);_0x503041[_0x6791('0x34')]=_['keys'](_0x8d9556[_0x6791('0x34')]);_0x503041[_0x6791('0x35')]=_[_0x6791('0x36')](_0x503041[_0x6791('0x33')],_0x503041[_0x6791('0x34')]);_0x1c2864[_0x6791('0x37')]=_[_0x6791('0x36')](_0x503041['model'],qs[_0x6791('0x38')](_0x8d9556['query'][_0x6791('0x38')]));_0x1c2864['attributes']=_0x1c2864[_0x6791('0x37')][_0x6791('0x48')]?_0x1c2864[_0x6791('0x37')]:_0x503041[_0x6791('0x33')];_0x1c2864[_0x6791('0x3b')]=qs[_0x6791('0x3c')](_0x8d9556['query'][_0x6791('0x3c')]);_0x1c2864['where']=qs[_0x6791('0x35')](_['pick'](_0x8d9556['query'],_0x503041['filters']));if(_0x8d9556[_0x6791('0x34')][_0x6791('0x3e')]){_0x1c2864['where']=_[_0x6791('0x3f')](_0x1c2864['where'],{'$or':_[_0x6791('0x2e')](_0x1c2864[_0x6791('0x37')],function(_0x4f52c2){var _0x494435={};_0x494435[_0x4f52c2]={'$like':'%'+_0x8d9556['query'][_0x6791('0x3e')]+'%'};return _0x494435;})});}_0x1c2864=_[_0x6791('0x3f')]({},_0x1c2864,_0x8d9556[_0x6791('0x41')]);return _0x27e3bd['getAgents'](_0x1c2864);}})[_0x6791('0x25')](function(_0x20ded4){if(_0x20ded4){_0x26e77c=_0x20ded4[_0x6791('0x48')];if(!_0x8d9556[_0x6791('0x34')][_0x6791('0x39')]('nolimit')){_0x1c2864[_0x6791('0x1f')]=qs[_0x6791('0x1f')](_0x8d9556[_0x6791('0x34')][_0x6791('0x1f')]);_0x1c2864[_0x6791('0x21')]=qs['offset'](_0x8d9556[_0x6791('0x34')][_0x6791('0x21')]);}return _0x27e3bd['getAgents'](_0x1c2864);}})[_0x6791('0x25')](function(_0x46aea7){if(_0x46aea7){return _0x46aea7?{'count':_0x26e77c,'rows':_0x46aea7}:null;}})[_0x6791('0x25')](respondWithResult(_0x11eb22,null))[_0x6791('0x4a')](handleError(_0x11eb22,null));};exports['getTeams']=function(_0x29e2a0,_0x1092d4,_0x370da4){var _0xdf1dd4={};var _0xa5eb83={};var _0x145814;var _0x5dcaab;return db[_0x6791('0x2f')]['findOne']({'where':{'id':_0x29e2a0['params']['id']}})[_0x6791('0x25')](handleEntityNotFound(_0x1092d4,null))[_0x6791('0x25')](function(_0x313d5d){if(_0x313d5d){_0x145814=_0x313d5d;_0xa5eb83['model']=_[_0x6791('0x46')](db['Team'][_0x6791('0x47')]);_0xa5eb83[_0x6791('0x34')]=_['keys'](_0x29e2a0[_0x6791('0x34')]);_0xa5eb83[_0x6791('0x35')]=_[_0x6791('0x36')](_0xa5eb83[_0x6791('0x33')],_0xa5eb83[_0x6791('0x34')]);_0xdf1dd4['attributes']=_[_0x6791('0x36')](_0xa5eb83[_0x6791('0x33')],qs[_0x6791('0x38')](_0x29e2a0['query']['fields']));_0xdf1dd4[_0x6791('0x37')]=_0xdf1dd4[_0x6791('0x37')]['length']?_0xdf1dd4[_0x6791('0x37')]:_0xa5eb83[_0x6791('0x33')];_0xdf1dd4[_0x6791('0x3b')]=qs['sort'](_0x29e2a0[_0x6791('0x34')]['sort']);_0xdf1dd4['where']=qs[_0x6791('0x35')](_['pick'](_0x29e2a0[_0x6791('0x34')],_0xa5eb83[_0x6791('0x35')]));if(_0x29e2a0[_0x6791('0x34')][_0x6791('0x3e')]){_0xdf1dd4[_0x6791('0x3d')]=_[_0x6791('0x3f')](_0xdf1dd4['where'],{'$or':_[_0x6791('0x2e')](_0xdf1dd4['attributes'],function(_0x221fad){var _0x4d6641={};_0x4d6641[_0x221fad]={'$like':'%'+_0x29e2a0['query'][_0x6791('0x3e')]+'%'};return _0x4d6641;})});}_0xdf1dd4=_[_0x6791('0x3f')]({},_0xdf1dd4,_0x29e2a0[_0x6791('0x41')]);return _0x145814[_0x6791('0x7b')](_0xdf1dd4);}})[_0x6791('0x25')](function(_0x11089f){if(_0x11089f){_0x5dcaab=_0x11089f[_0x6791('0x48')];if(!_0x29e2a0[_0x6791('0x34')][_0x6791('0x39')](_0x6791('0x3a'))){_0xdf1dd4[_0x6791('0x1f')]=qs[_0x6791('0x1f')](_0x29e2a0[_0x6791('0x34')][_0x6791('0x1f')]);_0xdf1dd4[_0x6791('0x21')]=qs[_0x6791('0x21')](_0x29e2a0[_0x6791('0x34')][_0x6791('0x21')]);}return _0x145814[_0x6791('0x7b')](_0xdf1dd4);}})['then'](function(_0xfef30e){if(_0xfef30e){return _0xfef30e?{'count':_0x5dcaab,'rows':_0xfef30e}:null;}})[_0x6791('0x25')](respondWithResult(_0x1092d4,null))[_0x6791('0x4a')](handleError(_0x1092d4,null));};exports['addTeams']=function(_0x4c6eb1,_0x4bce1d,_0x42d7fb){var _0x257efa=_0x4c6eb1['body'][_0x6791('0x72')];var _0x17c93e;return db[_0x6791('0x7c')][_0x6791('0x7d')]({'where':{'id':_0x257efa},'attributes':['id'],'include':[{'model':db[_0x6791('0x7a')],'as':_0x6791('0x7e'),'attributes':['id',_0x6791('0x2b'),_0x6791('0x7f'),'voicePause',_0x6791('0x80')],'raw':!![]}]})['then'](function(_0xd61243){if(_0xd61243){_0x17c93e=_0xd61243;var _0x123627=_[_0x6791('0x81')](_0xd61243,function(_0x5d5963){var _0x4d36de=_0x5d5963['get']({'plain':!![]});return _0x4d36de[_0x6791('0x7e')];});return db[_0x6791('0x2f')][_0x6791('0x49')]({'where':{'id':_0x4c6eb1[_0x6791('0x45')]['id']}})['then'](function(_0x3b487a){return db[_0x6791('0x4d')][_0x6791('0x6e')](function(_0x3b0d8f){return _0x3b487a['addTeams'](_0x257efa,{'transaction':_0x3b0d8f})['then'](function(){return BPromise['each'](_0x17c93e,function(_0x3a7711){return db['TeamVoicePrefix'][_0x6791('0x82')]({'TeamId':_0x3a7711['id'],'VoicePrefixId':_0x4c6eb1[_0x6791('0x45')]['id']},{'transaction':_0x3b0d8f});});})[_0x6791('0x25')](function(){return BPromise[_0x6791('0x83')](_0x123627,function(_0x15a95b){return db[_0x6791('0x84')][_0x6791('0x85')]({'where':{'UserId':_0x15a95b['id'],'VoicePrefixId':_0x4c6eb1[_0x6791('0x45')]['id']},'transaction':_0x3b0d8f});});})['then'](function(){_0x123627[_0x6791('0x86')](function(_0x300c8b){socket['emit'](_0x6791('0x75'),{'UserId':_0x300c8b['id'],'VoicePrefixId':_0x3b487a['id']});});});});});}})[_0x6791('0x25')](respondWithStatusCode(_0x4bce1d,null))[_0x6791('0x4a')](handleError(_0x4bce1d,null));};exports[_0x6791('0x87')]=function(_0x4f88e4,_0x447ea6,_0x31a2c8){return db[_0x6791('0x7c')][_0x6791('0x7d')]({'where':{'id':_0x4f88e4[_0x6791('0x34')][_0x6791('0x72')]},'attributes':['id'],'include':[{'model':db[_0x6791('0x7a')],'as':_0x6791('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x6791('0x25')](handleEntityNotFound(_0x447ea6,null))['then'](function(_0x150a13){var _0x211721=_[_0x6791('0x2e')](_0x150a13,'id');var _0xb7986d=[];var _0x19cb72=[];var _0x5aad37=squel['select']();_0x5aad37[_0x6791('0x88')](_0x6791('0x89'))['from'](_0x6791('0x8a'),'tq')[_0x6791('0x8b')](_0x6791('0x8c'),'ut',_0x6791('0x8d'))[_0x6791('0x3d')](_0x6791('0x8e'),_0x4f88e4[_0x6791('0x45')]['id']);for(var _0x21a12c=0x0;_0x21a12c<_0x150a13[_0x6791('0x48')];_0x21a12c+=0x1){let _0x54a34f=_0x150a13[_0x21a12c];for(var _0x405e1c=0x0;_0x405e1c<_0x54a34f[_0x6791('0x7e')]['length'];_0x405e1c+=0x1){let _0x303ba8=_0x54a34f['Agents'][_0x405e1c];var _0x23bed3=_0x5aad37[_0x6791('0x8f')]();_0x23bed3[_0x6791('0x3d')](_0x6791('0x90'),_0x303ba8['id']);_0x19cb72[_0x6791('0x65')](db[_0x6791('0x4d')][_0x6791('0x34')](_0x23bed3[_0x6791('0x91')](),{'type':db[_0x6791('0x4d')][_0x6791('0x92')][_0x6791('0x93')]})[_0x6791('0x25')](function(_0x1f06d8){if(_0x1f06d8[_0x6791('0x48')]===0x1){return _0x303ba8['id'];}else{var _0x46d6ff=_[_0x6791('0x94')](_[_0x6791('0x2e')](_0x1f06d8,_0x6791('0x95')),function(_0x462e03){return _['includes'](_0x211721,_0x462e03);});if(_0x46d6ff){return _0x303ba8['id'];}}}));}}return BPromise[_0x6791('0x96')](_0x19cb72)['then'](function(_0x41385c){_0xb7986d=_(_0xb7986d)[_0x6791('0x97')](_0x41385c)[_0x6791('0x98')]()[_0x6791('0x99')]();return db[_0x6791('0x2f')][_0x6791('0x49')]({'where':{'id':_0x4f88e4[_0x6791('0x45')]['id']}})[_0x6791('0x25')](function(_0x546bf7){return db[_0x6791('0x4d')]['transaction'](function(_0x54cf28){return _0x546bf7[_0x6791('0x87')](_0x4f88e4[_0x6791('0x34')][_0x6791('0x72')],{'transaction':_0x54cf28})[_0x6791('0x25')](function(){if(!_[_0x6791('0x9a')](_0xb7986d)){return _0x546bf7[_0x6791('0x76')](_0xb7986d,{'transaction':_0x54cf28});}})[_0x6791('0x25')](function(){_0xb7986d['forEach'](function(_0x3b7b0f){socket[_0x6791('0x74')](_0x6791('0x78'),{'UserId':_0x3b7b0f,'VoicePrefixId':_0x546bf7['id']});});});});});});})[_0x6791('0x25')](respondWithStatusCode(_0x447ea6,null))[_0x6791('0x4a')](handleError(_0x447ea6,null));}; \ No newline at end of file +var _0x8e3f=['charAt','update','system-','findById','addAgents','ids','omit','userVoicePrefix:save','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','online','voicePause','interface','flatMap','get','Agents','addTeams','each','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','join','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','all','union','compact','removeTeams','isEmpty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','findAll','catch','includeAll','include','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:'];(function(_0x11901e,_0x2896fa){var _0x3e99ae=function(_0x5be476){while(--_0x5be476){_0x11901e['push'](_0x11901e['shift']());}};_0x3e99ae(++_0x2896fa);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];config[_0xf8e3('0x1a')]=_[_0xf8e3('0x1b')](config[_0xf8e3('0x1a')],{'host':_0xf8e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8e3('0x1a')]));require(_0xf8e3('0x1d'))[_0xf8e3('0x1e')](socket);function respondWithStatusCode(_0x4af736,_0x44f631){_0x44f631=_0x44f631||0xcc;return function(_0x5136c6){if(_0x5136c6){return _0x4af736[_0xf8e3('0x1f')](_0x44f631);}return _0x4af736[_0xf8e3('0x20')](_0x44f631)[_0xf8e3('0x21')]();};}function respondWithResult(_0x570ee3,_0x529c92){_0x529c92=_0x529c92||0xc8;return function(_0x564f43){if(_0x564f43){return _0x570ee3[_0xf8e3('0x20')](_0x529c92)[_0xf8e3('0x22')](_0x564f43);}};}function respondWithFilteredResult(_0x3b01ac,_0x110a78){return function(_0x11d4cc){if(_0x11d4cc){var _0x7a81c3=typeof _0x110a78[_0xf8e3('0x23')]===_0xf8e3('0x24')&&typeof _0x110a78[_0xf8e3('0x25')]==='undefined';var _0x20cc64=_0x11d4cc[_0xf8e3('0x26')];var _0x24e8d6=_0x7a81c3?0x0:_0x110a78[_0xf8e3('0x23')];var _0x3128ad=_0x7a81c3?_0x11d4cc[_0xf8e3('0x26')]:_0x110a78[_0xf8e3('0x23')]+_0x110a78[_0xf8e3('0x25')];var _0x5b99b1;if(_0x3128ad>=_0x20cc64){_0x3128ad=_0x20cc64;_0x5b99b1=0xc8;}else{_0x5b99b1=0xce;}_0x3b01ac[_0xf8e3('0x20')](_0x5b99b1);return _0x3b01ac[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x24e8d6+'-'+_0x3128ad+'/'+_0x20cc64)[_0xf8e3('0x22')](_0x11d4cc);}return null;};}function patchUpdates(_0x4a1e5f){return function(_0x39df34){try{jsonpatch['apply'](_0x39df34,_0x4a1e5f,!![]);}catch(_0x286059){return BPromise[_0xf8e3('0x29')](_0x286059);}return _0x39df34[_0xf8e3('0x2a')]();};}function saveUpdates(_0x2dc856,_0x1f4b68){return function(_0x3ac384){if(_0x3ac384){return _0x3ac384['update'](_0x2dc856)[_0xf8e3('0x2b')](function(_0x2fc674){return _0x2fc674;});}return null;};}function removeEntity(_0x3373ca,_0x417b42){return function(_0x1f1363){if(_0x1f1363){return _0x1f1363[_0xf8e3('0x2c')]()[_0xf8e3('0x2b')](function(){var _0x157a2d=_0x1f1363['get']({'plain':!![]});var _0x356e0a=_0xf8e3('0x2d');return db[_0xf8e3('0x2e')][_0xf8e3('0x2c')]({'where':{'type':_0x356e0a,'resourceId':_0x157a2d['id']}})[_0xf8e3('0x2b')](function(){return _0x1f1363;});})[_0xf8e3('0x2b')](function(){_0x3373ca[_0xf8e3('0x20')](0xcc)[_0xf8e3('0x21')]();});}};}function handleEntityNotFound(_0x4f2ae9,_0x21e1c0){return function(_0x243e28){if(!_0x243e28){_0x4f2ae9[_0xf8e3('0x1f')](0x194);}return _0x243e28;};}function handleError(_0x28b2f2,_0x567153){_0x567153=_0x567153||0x1f4;return function(_0x2e507c){logger[_0xf8e3('0x2f')](_0x2e507c[_0xf8e3('0x30')]);if(_0x2e507c[_0xf8e3('0x31')]){delete _0x2e507c[_0xf8e3('0x31')];}_0x28b2f2[_0xf8e3('0x20')](_0x567153)[_0xf8e3('0x32')](_0x2e507c);};}exports[_0xf8e3('0x33')]=function(_0x50ad3f,_0x2c07bf){var _0x527337={},_0x4acd6c={},_0x5d2dd5={'count':0x0,'rows':[]};var _0x5cc1ed=_[_0xf8e3('0x34')](db['VoicePrefix'][_0xf8e3('0x35')],function(_0x41faaa){return{'name':_0x41faaa[_0xf8e3('0x36')],'type':_0x41faaa[_0xf8e3('0x37')]['key']};});_0x4acd6c['model']=_[_0xf8e3('0x34')](_0x5cc1ed,_0xf8e3('0x31'));_0x4acd6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x50ad3f[_0xf8e3('0x38')]);_0x4acd6c[_0xf8e3('0x3a')]=_['intersection'](_0x4acd6c[_0xf8e3('0x3b')],_0x4acd6c['query']);_0x527337['attributes']=_[_0xf8e3('0x3c')](_0x4acd6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x50ad3f[_0xf8e3('0x38')]['fields']));_0x527337['attributes']=_0x527337[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x527337['attributes']:_0x4acd6c[_0xf8e3('0x3b')];if(!_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x40')](_0xf8e3('0x41'))){_0x527337['limit']=qs['limit'](_0x50ad3f['query'][_0xf8e3('0x25')]);_0x527337[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x50ad3f[_0xf8e3('0x38')]['offset']);}_0x527337[_0xf8e3('0x42')]=qs['sort'](_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x527337[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x50ad3f[_0xf8e3('0x38')],_0x4acd6c[_0xf8e3('0x3a')]),_0x5cc1ed);if(_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x527337['where']=_[_0xf8e3('0x47')](_0x527337['where'],{'$or':_[_0xf8e3('0x34')](_0x5cc1ed,function(_0x1e8917){if(_0x1e8917[_0xf8e3('0x37')]!==_0xf8e3('0x48')){var _0x64bfc6={};_0x64bfc6[_0x1e8917[_0xf8e3('0x31')]]={'$like':'%'+_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x64bfc6;}})});}_0x527337=_['merge']({},_0x527337,_0x50ad3f[_0xf8e3('0x49')]);var _0x108b81={'where':_0x527337[_0xf8e3('0x44')]};return db[_0xf8e3('0x4a')][_0xf8e3('0x26')](_0x108b81)[_0xf8e3('0x2b')](function(_0x792190){_0x5d2dd5[_0xf8e3('0x26')]=_0x792190;if(_0x50ad3f['query']['includeAll']){_0x527337['include']=[{'all':!![]}];}return db[_0xf8e3('0x4a')][_0xf8e3('0x4b')](_0x527337);})['then'](function(_0x181908){_0x5d2dd5['rows']=_0x181908;return _0x5d2dd5;})[_0xf8e3('0x2b')](respondWithFilteredResult(_0x2c07bf,_0x527337))[_0xf8e3('0x4c')](handleError(_0x2c07bf,null));};exports['show']=function(_0x1fb64d,_0x4b0791){var _0x679519={'raw':![],'where':{'id':_0x1fb64d['params']['id']}},_0x6875a6={};_0x6875a6[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db[_0xf8e3('0x4a')][_0xf8e3('0x35')]);_0x6875a6['query']=_['keys'](_0x1fb64d['query']);_0x6875a6[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x6875a6[_0xf8e3('0x3b')],_0x6875a6['query']);_0x679519[_0xf8e3('0x3e')]=_['intersection'](_0x6875a6[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x1fb64d['query']['fields']));_0x679519[_0xf8e3('0x3e')]=_0x679519[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x679519[_0xf8e3('0x3e')]:_0x6875a6[_0xf8e3('0x3b')];if(_0x1fb64d[_0xf8e3('0x38')][_0xf8e3('0x4d')]){_0x679519[_0xf8e3('0x4e')]=[{'all':!![]}];}_0x679519=_[_0xf8e3('0x47')]({},_0x679519,_0x1fb64d[_0xf8e3('0x49')]);return db[_0xf8e3('0x4a')]['find'](_0x679519)[_0xf8e3('0x2b')](handleEntityNotFound(_0x4b0791,null))[_0xf8e3('0x2b')](respondWithResult(_0x4b0791,null))[_0xf8e3('0x4c')](handleError(_0x4b0791,null));};exports[_0xf8e3('0x2c')]=function(_0x385a8f,_0x3256e6){return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x385a8f[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3256e6,null))[_0xf8e3('0x2b')](removeEntity(_0x3256e6,null))[_0xf8e3('0x4c')](handleError(_0x3256e6,null));};exports[_0xf8e3('0x51')]=function(_0x5855f2,_0x260f67){return db[_0xf8e3('0x4a')][_0xf8e3('0x51')]()[_0xf8e3('0x2b')](respondWithResult(_0x260f67,null))[_0xf8e3('0x4c')](handleError(_0x260f67,null));};exports[_0xf8e3('0x52')]=function(_0x5990fc,_0x394e45){var _0x1f425f;return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x452b00){return db['VoicePrefix'][_0xf8e3('0x52')](_0x5990fc[_0xf8e3('0x55')],{'transaction':_0x452b00})[_0xf8e3('0x2b')](function(_0x53c897){_0x1f425f=_0x53c897['get']({'plain':!![]});return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x1f425f[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x58ad2f){return createVoicePrefixExtensions(_0x1f425f,_0x58ad2f,_0x452b00);});});})[_0xf8e3('0x2b')](function(){var _0x16bddb=_0x5990fc['user']['get']({'plain':!![]});if(!_0x16bddb)throw new Error(_0xf8e3('0x58'));if(_0x16bddb[_0xf8e3('0x59')]===_0xf8e3('0x5a')){var _0x505477=_0x1f425f;return db['UserProfileSection']['find']({'where':{'name':_0xf8e3('0x2d'),'userProfileId':_0x16bddb[_0xf8e3('0x5b')]},'raw':!![]})['then'](function(_0x4937fc){if(_0x4937fc&&_0x4937fc['autoAssociation']===0x0){return db[_0xf8e3('0x2e')][_0xf8e3('0x52')]({'name':_0x505477['name'],'resourceId':_0x505477['id'],'type':_0x4937fc[_0xf8e3('0x31')],'sectionId':_0x4937fc['id']},{})[_0xf8e3('0x2b')](function(){return _0x1f425f;});}else{return _0x1f425f;}})[_0xf8e3('0x4c')](function(_0x560f42){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560f42);throw _0x560f42;});}return _0x1f425f;})['then'](respondWithResult(_0x394e45,null))[_0xf8e3('0x4c')](handleError(_0x394e45,null));};function Extension(_0x3b120a,_0x3ef144,_0x447efe,_0x442349){this[_0xf8e3('0x5c')]=_0xf8e3('0x5d');this[_0xf8e3('0x5e')]=_0x3b120a;this[_0xf8e3('0x5f')]=_0x447efe;this['type']='system';this[_0xf8e3('0x60')]=_0xf8e3('0x61');this[_0xf8e3('0x62')]=_0x3ef144;this['appdata']=_0x442349;}function createVoicePrefixExtensions(_0x234b06,_0x131c0b,_0x4879c7){return new BPromise(function(_0x48bb3f,_0x256cd5){var _0x4763eb=new Extension(formatPrefixName(_0x234b06[_0xf8e3('0x63')]),0x1,_0xf8e3('0x64'),'Voice\x20Prefix');_0x4763eb['VoicePrefixId']=_0x234b06['id'];return db[_0xf8e3('0x56')][_0xf8e3('0x52')](_0x4763eb,{'transaction':_0x4879c7})[_0xf8e3('0x2b')](function(_0x392d99){var _0x4f1ddb=_0x392d99['get']({'plain':!![]});var _0x324ad5=_[_0xf8e3('0x34')](addVoicePrefixExtensions(_0x234b06,_0x131c0b),function(_0x56a07e){_0x56a07e[_0xf8e3('0x57')]=_0x4f1ddb['id'];_0x56a07e[_0xf8e3('0x65')]=_0x234b06['id'];return _0x56a07e;});return db[_0xf8e3('0x56')][_0xf8e3('0x66')](_0x324ad5,{'transaction':_0x4879c7})['then'](function(_0x11ebb2){if(!_0x11ebb2){return _0x256cd5('Extensions\x20creation\x20failed');}else{return _0x48bb3f(_0x11ebb2);}})[_0xf8e3('0x4c')](function(_0x1cad38){return _0x256cd5(_0x1cad38);});});;});};function addVoicePrefixExtensions(_0x5cbdc6,_0x2ec4f6){var _0x31568b=[];var _0x55418c=formatPrefixName(_0x5cbdc6[_0xf8e3('0x63')]);_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x2,_0xf8e3('0x68'),_0xf8e3('0x69')+_0x5cbdc6['name']));if(_0x5cbdc6[_0xf8e3('0x6a')]){_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x68'),_0xf8e3('0x6b')+_0x5cbdc6[_0xf8e3('0x6a')]));}else{_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x64'),_0xf8e3('0x6c')));}_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x4,_0xf8e3('0x6d'),_0x2ec4f6[_0xf8e3('0x5c')]+','+_0xf8e3('0x6e')+(0x8+_0x5cbdc6['name']['length'])+'}'+','+0x1));return _0x31568b;}function formatPrefixName(_0x2f6cf4){var _0x32eaab='_';for(var _0x5ccdb2=0x0;_0x5ccdb2<_0x2f6cf4[_0xf8e3('0x3f')];_0x5ccdb2++){if(_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)=='-'){_0x32eaab+=_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2);}else{_0x32eaab+='['+_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)+']';}}_0x32eaab+='.';return _0x32eaab;}exports[_0xf8e3('0x70')]=function(_0x5804eb,_0x3e501c,_0x1dcd23){var _0x52e996=_0x5804eb[_0xf8e3('0x55')];_0x52e996['prefix']=_0xf8e3('0x71')+_0x52e996['name']+'-';return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x45361d){return db[_0xf8e3('0x4a')][_0xf8e3('0x70')](_0x52e996,{'where':{'id':_0x52e996['id']},'transaction':_0x45361d})['then'](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x2c')]({'where':{'VoicePrefixId':_0x52e996['id']},'transaction':_0x45361d})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x52e996[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x2ccd34){return createVoicePrefixExtensions(_0x52e996,_0x2ccd34,_0x45361d);});});});})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x4a')][_0xf8e3('0x72')](_0x52e996['id']);})[_0xf8e3('0x2b')](respondWithResult(_0x3e501c,null))['catch'](handleError(_0x3e501c,null));};exports[_0xf8e3('0x73')]=function(_0x280f06,_0x3dc049,_0x4b69db){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x280f06[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3dc049,null))[_0xf8e3('0x2b')](function(_0x40174a){if(_0x40174a){return _0x40174a[_0xf8e3('0x73')](_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')],_[_0xf8e3('0x75')](_0x280f06[_0xf8e3('0x55')],[_0xf8e3('0x74'),'id'])||{})['spread'](function(_0x118cc6){for(var _0xf7cb3a=0x0;_0xf7cb3a<_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')]['length'];_0xf7cb3a+=0x1){socket['emit'](_0xf8e3('0x76'),{'UserId':Number(_0x280f06[_0xf8e3('0x55')]['ids'][_0xf7cb3a]),'VoicePrefixId':Number(_0x280f06['params']['id'])});}return _0x118cc6;});}})[_0xf8e3('0x2b')](respondWithResult(_0x3dc049,null))[_0xf8e3('0x4c')](handleError(_0x3dc049,null));};exports['removeAgents']=function(_0x2a2c6,_0xca5962,_0x16e69a){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x2a2c6['params']['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xca5962,null))[_0xf8e3('0x2b')](function(_0x54db4e){if(_0x54db4e){return _0x54db4e['removeAgents'](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])[_0xf8e3('0x2b')](function(){if(_[_0xf8e3('0x77')](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])){for(var _0x3823b9=0x0;_0x3823b9<_0x2a2c6[_0xf8e3('0x38')]['ids'][_0xf8e3('0x3f')];_0x3823b9+=0x1){socket[_0xf8e3('0x78')](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')][_0x3823b9]),'VoicePrefixId':Number(_0x2a2c6[_0xf8e3('0x50')]['id'])});}}else{socket['emit'](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')]),'VoicePrefixId':Number(_0x2a2c6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xca5962,null))[_0xf8e3('0x4c')](handleError(_0xca5962,null));};exports[_0xf8e3('0x7a')]=function(_0x25805c,_0xc01ac,_0x4659ed){var _0x5b8840={};var _0x25bf6c={};var _0x1f5a80;var _0x1bfe33;return db[_0xf8e3('0x4a')][_0xf8e3('0x7b')]({'where':{'id':_0x25805c[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xc01ac,null))[_0xf8e3('0x2b')](function(_0x40b66c){if(_0x40b66c){_0x1f5a80=_0x40b66c;_0x25bf6c['model']=_[_0xf8e3('0x39')](db[_0xf8e3('0x7c')][_0xf8e3('0x35')]);_0x25bf6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x25805c[_0xf8e3('0x38')]);_0x25bf6c[_0xf8e3('0x3a')]=_['intersection'](_0x25bf6c['model'],_0x25bf6c[_0xf8e3('0x38')]);_0x5b8840[_0xf8e3('0x3e')]=_['intersection'](_0x25bf6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x5b8840[_0xf8e3('0x3e')]=_0x5b8840[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x5b8840['attributes']:_0x25bf6c[_0xf8e3('0x3b')];_0x5b8840[_0xf8e3('0x42')]=qs[_0xf8e3('0x43')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x5b8840[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x25805c[_0xf8e3('0x38')],_0x25bf6c[_0xf8e3('0x3a')]));if(_0x25805c[_0xf8e3('0x38')]['filter']){_0x5b8840['where']=_[_0xf8e3('0x47')](_0x5b8840['where'],{'$or':_[_0xf8e3('0x34')](_0x5b8840['attributes'],function(_0x1a3843){var _0x1b2249={};_0x1b2249[_0x1a3843]={'$like':'%'+_0x25805c[_0xf8e3('0x38')]['filter']+'%'};return _0x1b2249;})});}_0x5b8840=_[_0xf8e3('0x47')]({},_0x5b8840,_0x25805c[_0xf8e3('0x49')]);return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x3619cd){if(_0x3619cd){_0x1bfe33=_0x3619cd['length'];if(!_0x25805c[_0xf8e3('0x38')]['hasOwnProperty'](_0xf8e3('0x41'))){_0x5b8840[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x5b8840[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x25805c['query'][_0xf8e3('0x23')]);}return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x1a9ba6){if(_0x1a9ba6){return _0x1a9ba6?{'count':_0x1bfe33,'rows':_0x1a9ba6}:null;}})['then'](respondWithResult(_0xc01ac,null))[_0xf8e3('0x4c')](handleError(_0xc01ac,null));};exports[_0xf8e3('0x7d')]=function(_0x3f7c0e,_0x2da8fb,_0x22fa2f){var _0x18fbd2={};var _0x477589={};var _0x1bb12c;var _0x4a5ad8;return db['VoicePrefix'][_0xf8e3('0x7b')]({'where':{'id':_0x3f7c0e[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x2da8fb,null))[_0xf8e3('0x2b')](function(_0x131625){if(_0x131625){_0x1bb12c=_0x131625;_0x477589[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db['Team'][_0xf8e3('0x35')]);_0x477589['query']=_[_0xf8e3('0x39')](_0x3f7c0e[_0xf8e3('0x38')]);_0x477589[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x477589['model'],_0x477589[_0xf8e3('0x38')]);_0x18fbd2['attributes']=_['intersection'](_0x477589[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x18fbd2['attributes']=_0x18fbd2['attributes'][_0xf8e3('0x3f')]?_0x18fbd2[_0xf8e3('0x3e')]:_0x477589['model'];_0x18fbd2['order']=qs[_0xf8e3('0x43')](_0x3f7c0e[_0xf8e3('0x38')]['sort']);_0x18fbd2[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x3f7c0e[_0xf8e3('0x38')],_0x477589[_0xf8e3('0x3a')]));if(_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x18fbd2['where']=_[_0xf8e3('0x47')](_0x18fbd2[_0xf8e3('0x44')],{'$or':_['map'](_0x18fbd2[_0xf8e3('0x3e')],function(_0x4a8866){var _0x1ca81d={};_0x1ca81d[_0x4a8866]={'$like':'%'+_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x1ca81d;})});}_0x18fbd2=_['merge']({},_0x18fbd2,_0x3f7c0e[_0xf8e3('0x49')]);return _0x1bb12c['getTeams'](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x41ca1b){if(_0x41ca1b){_0x4a5ad8=_0x41ca1b[_0xf8e3('0x3f')];if(!_0x3f7c0e[_0xf8e3('0x38')]['hasOwnProperty']('nolimit')){_0x18fbd2[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x18fbd2[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x3f7c0e['query'][_0xf8e3('0x23')]);}return _0x1bb12c[_0xf8e3('0x7d')](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x348e59){if(_0x348e59){return _0x348e59?{'count':_0x4a5ad8,'rows':_0x348e59}:null;}})['then'](respondWithResult(_0x2da8fb,null))[_0xf8e3('0x4c')](handleError(_0x2da8fb,null));};exports['addTeams']=function(_0x3b51c7,_0xf88bb2,_0x4b27e3){var _0x108168=_0x3b51c7['body'][_0xf8e3('0x74')];var _0x3fba66;return db['Team'][_0xf8e3('0x4b')]({'where':{'id':_0x108168},'attributes':['id'],'include':[{'model':db[_0xf8e3('0x7c')],'as':'Agents','attributes':['id',_0xf8e3('0x31'),_0xf8e3('0x7e'),_0xf8e3('0x7f'),_0xf8e3('0x80')],'raw':!![]}]})[_0xf8e3('0x2b')](function(_0x3b79e1){if(_0x3b79e1){_0x3fba66=_0x3b79e1;var _0x13f467=_[_0xf8e3('0x81')](_0x3b79e1,function(_0x29c04b){var _0x271ed0=_0x29c04b[_0xf8e3('0x82')]({'plain':!![]});return _0x271ed0[_0xf8e3('0x83')];});return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x3b51c7[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](function(_0x48230e){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x7e83fd){return _0x48230e[_0xf8e3('0x84')](_0x108168,{'transaction':_0x7e83fd})[_0xf8e3('0x2b')](function(){return BPromise[_0xf8e3('0x85')](_0x3fba66,function(_0x6d4c09){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x6d4c09['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},{'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){return BPromise['each'](_0x13f467,function(_0x1a85cf){return db[_0xf8e3('0x86')]['findOrCreate']({'where':{'UserId':_0x1a85cf['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){_0x13f467[_0xf8e3('0x87')](function(_0x27d0b6){socket[_0xf8e3('0x78')]('userVoicePrefix:save',{'UserId':_0x27d0b6['id'],'VoicePrefixId':_0x48230e['id']});});});});});}})[_0xf8e3('0x2b')](respondWithStatusCode(_0xf88bb2,null))[_0xf8e3('0x4c')](handleError(_0xf88bb2,null));};exports['removeTeams']=function(_0x4f02bb,_0x237eb6,_0xd9e796){return db[_0xf8e3('0x88')][_0xf8e3('0x4b')]({'where':{'id':_0x4f02bb[_0xf8e3('0x38')][_0xf8e3('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf8e3('0x83'),'attributes':['id'],'raw':!![]}]})[_0xf8e3('0x2b')](handleEntityNotFound(_0x237eb6,null))['then'](function(_0x5ae078){var _0x512d8d=_[_0xf8e3('0x34')](_0x5ae078,'id');var _0x186e42=[];var _0x417af2=[];var _0x29f5d0=squel[_0xf8e3('0x89')]();_0x29f5d0[_0xf8e3('0x8a')](_0xf8e3('0x8b'))['from']('team_has_voice_prefixes','tq')[_0xf8e3('0x8c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf8e3('0x44')](_0xf8e3('0x8d'),_0x4f02bb['params']['id']);for(var _0x1cff32=0x0;_0x1cff32<_0x5ae078[_0xf8e3('0x3f')];_0x1cff32+=0x1){let _0x876d0c=_0x5ae078[_0x1cff32];for(var _0x2c4060=0x0;_0x2c4060<_0x876d0c[_0xf8e3('0x83')][_0xf8e3('0x3f')];_0x2c4060+=0x1){let _0x1b8e99=_0x876d0c[_0xf8e3('0x83')][_0x2c4060];var _0x107896=_0x29f5d0[_0xf8e3('0x8e')]();_0x107896[_0xf8e3('0x44')](_0xf8e3('0x8f'),_0x1b8e99['id']);_0x417af2[_0xf8e3('0x67')](db[_0xf8e3('0x53')][_0xf8e3('0x38')](_0x107896['toString'](),{'type':db[_0xf8e3('0x53')][_0xf8e3('0x90')]['SELECT']})[_0xf8e3('0x2b')](function(_0x4e8329){if(_0x4e8329['length']===0x1){return _0x1b8e99['id'];}else{var _0x5a66ee=_[_0xf8e3('0x91')](_[_0xf8e3('0x34')](_0x4e8329,'TeamId'),function(_0x207393){return _[_0xf8e3('0x92')](_0x512d8d,_0x207393);});if(_0x5a66ee){return _0x1b8e99['id'];}}}));}}return BPromise[_0xf8e3('0x93')](_0x417af2)['then'](function(_0x3a39a8){_0x186e42=_(_0x186e42)[_0xf8e3('0x94')](_0x3a39a8)[_0xf8e3('0x95')]()['value']();return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x4f02bb[_0xf8e3('0x50')]['id']}})['then'](function(_0x42d800){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x13782d){return _0x42d800[_0xf8e3('0x96')](_0x4f02bb[_0xf8e3('0x38')]['ids'],{'transaction':_0x13782d})[_0xf8e3('0x2b')](function(){if(!_[_0xf8e3('0x97')](_0x186e42)){return _0x42d800['removeAgents'](_0x186e42,{'transaction':_0x13782d});}})[_0xf8e3('0x2b')](function(){_0x186e42[_0xf8e3('0x87')](function(_0xcf534f){socket[_0xf8e3('0x78')]('userVoicePrefix:remove',{'UserId':_0xcf534f,'VoicePrefixId':_0x42d800['id']});});});});});});})[_0xf8e3('0x2b')](respondWithStatusCode(_0x237eb6,null))['catch'](handleError(_0x237eb6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9ef8960..7c1f785 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 _0x7ea3=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0x7ea3,0xe5));var _0x37ea=function(_0x2c63ac,_0x1df97a){_0x2c63ac=_0x2c63ac-0x0;var _0xdf3040=_0x7ea3[_0x2c63ac];return _0xdf3040;};'use strict';var EventEmitter=require(_0x37ea('0x0'));var VoicePrefix=require(_0x37ea('0x1'))['db'][_0x37ea('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x37ea('0x3')](0x0);var events={'afterCreate':_0x37ea('0x4'),'afterUpdate':_0x37ea('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b6d99){return function(_0x1f349e,_0x1b12ff,_0x208479){VoicePrefixEvents[_0x37ea('0x6')](_0x5b6d99+':'+_0x1f349e['id'],_0x1f349e);VoicePrefixEvents[_0x37ea('0x6')](_0x5b6d99,_0x1f349e);_0x208479(null);};}for(var e in events){if(events[_0x37ea('0x7')](e)){var event=events[e];VoicePrefix[_0x37ea('0x8')](e,emitEvent(event));}}module[_0x37ea('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x427f=['events','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0xea6c20,_0x5a0de8){var _0x458655=function(_0x4afe96){while(--_0x4afe96){_0xea6c20['push'](_0xea6c20['shift']());}};_0x458655(++_0x5a0de8);}(_0x427f,0x18f));var _0xf427=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x427f[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0xf427('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf427('0x1')](0x0);var events={'afterCreate':_0xf427('0x2'),'afterUpdate':'update','afterDestroy':_0xf427('0x3')};function emitEvent(_0x274b0c){return function(_0x51acb9,_0x45f0f5,_0x51a20d){VoicePrefixEvents['emit'](_0x274b0c+':'+_0x51acb9['id'],_0x51acb9);VoicePrefixEvents[_0xf427('0x4')](_0x274b0c,_0x51acb9);_0x51a20d(null);};}for(var e in events){if(events[_0xf427('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xf427('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e6347d5..912fc4d 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 _0x3edc=['exports','VoicePrefix','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x3edc,0xc0));var _0xc3ed=function(_0x5a1e67,_0x3b9c7a){_0x5a1e67=_0x5a1e67-0x0;var _0x28603f=_0x3edc[_0x5a1e67];return _0x28603f;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var logger=require('../../config/logger')(_0xc3ed('0x2'));var moment=require(_0xc3ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xc3ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ed('0x5'));var config=require(_0xc3ed('0x6'));var attributes=require(_0xc3ed('0x7'));module[_0xc3ed('0x8')]=function(_0x8d01ff,_0x102628){return _0x8d01ff['define'](_0xc3ed('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51c3=['api','moment','bluebird','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util','../../config/logger'];(function(_0x357a97,_0x5aead2){var _0x28d590=function(_0x54b139){while(--_0x54b139){_0x357a97['push'](_0x357a97['shift']());}};_0x28d590(++_0x5aead2);}(_0x51c3,0xcd));var _0x351c=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x51c3[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var util=require(_0x351c('0x0'));var logger=require(_0x351c('0x1'))(_0x351c('0x2'));var moment=require(_0x351c('0x3'));var BPromise=require(_0x351c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x351c('0x5'));var attributes=require(_0x351c('0x6'));module[_0x351c('0x7')]=function(_0x30d200,_0x3d211c){return _0x30d200['define'](_0x351c('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index c7412d2..2ad5c8a 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 _0x5ff9=['util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x15f6a4,_0x84f7bd){var _0xa1832f=function(_0x171be4){while(--_0x171be4){_0x15f6a4['push'](_0x15f6a4['shift']());}};_0xa1832f(++_0x84f7bd);}(_0x5ff9,0xa0));var _0x95ff=function(_0x2a65d8,_0x392c55){_0x2a65d8=_0x2a65d8-0x0;var _0x2f92cb=_0x5ff9[_0x2a65d8];return _0x2f92cb;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var moment=require('moment');var BPromise=require(_0x95ff('0x2'));var rs=require(_0x95ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95ff('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x95ff('0x5'));var jayson=require(_0x95ff('0x6'));var client=jayson['client'][_0x95ff('0x7')]({'port':0x232a});config['redis']=_[_0x95ff('0x8')](config[_0x95ff('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x95ff('0xa'))(new Redis(config['redis']));require(_0x95ff('0xb'))[_0x95ff('0xc')](socket);function respondWithRpcPromise(_0x4807b6,_0x17b39b,_0x1f3e2d){return new BPromise(function(_0x2a1750,_0x4f5bb9){return client[_0x95ff('0xd')](_0x4807b6,_0x1f3e2d)[_0x95ff('0xe')](function(_0x39d786){logger[_0x95ff('0xf')](_0x95ff('0x10'),_0x17b39b,_0x95ff('0x11'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x17b39b,_0x95ff('0x11'),JSON[_0x95ff('0x12')](_0x39d786));if(_0x39d786[_0x95ff('0x13')]){if(_0x39d786[_0x95ff('0x13')]['code']===0x1f4){logger[_0x95ff('0x13')](_0x95ff('0x10'),_0x17b39b,_0x39d786['error'][_0x95ff('0x14')]);return _0x4f5bb9(_0x39d786[_0x95ff('0x13')]['message']);}logger['error'](_0x95ff('0x10'),_0x17b39b,_0x39d786[_0x95ff('0x13')][_0x95ff('0x14')]);return _0x2a1750(_0x39d786['error'][_0x95ff('0x14')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x17b39b,_0x95ff('0x11'));_0x2a1750(_0x39d786[_0x95ff('0x15')][_0x95ff('0x14')]);}})[_0x95ff('0x16')](function(_0x5e7132){logger[_0x95ff('0x13')](_0x95ff('0x10'),_0x17b39b,_0x5e7132);_0x4f5bb9(_0x5e7132);});});} \ No newline at end of file +var _0xcd6f=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x38df07,_0x5e619a){var _0x4ed4f8=function(_0x56e08a){while(--_0x56e08a){_0x38df07['push'](_0x38df07['shift']());}};_0x4ed4f8(++_0x5e619a);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x2a2dc6,_0x5a5d5b){_0x2a2dc6=_0x2a2dc6-0x0;var _0x350f2d=_0xcd6f[_0x2a2dc6];return _0x350f2d;};'use strict';var _=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var moment=require(_0xfcd6('0x2'));var BPromise=require(_0xfcd6('0x3'));var rs=require(_0xfcd6('0x4'));var fs=require('fs');var Redis=require(_0xfcd6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcd6('0x6'));var logger=require(_0xfcd6('0x7'))(_0xfcd6('0x8'));var config=require(_0xfcd6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfcd6('0xa')]['http']({'port':0x232a});config[_0xfcd6('0xb')]=_['defaults'](config[_0xfcd6('0xb')],{'host':_0xfcd6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcd6('0xb')]));require('./voicePrefix.socket')[_0xfcd6('0xd')](socket);function respondWithRpcPromise(_0x4f8dbf,_0x4c2eb7,_0x4bcd78){return new BPromise(function(_0x43b053,_0x550f2b){return client['request'](_0x4f8dbf,_0x4bcd78)[_0xfcd6('0xe')](function(_0xcc5317){logger['info'](_0xfcd6('0xf'),_0x4c2eb7,_0xfcd6('0x10'));logger[_0xfcd6('0x11')](_0xfcd6('0x12'),_0x4c2eb7,_0xfcd6('0x10'),JSON[_0xfcd6('0x13')](_0xcc5317));if(_0xcc5317[_0xfcd6('0x14')]){if(_0xcc5317[_0xfcd6('0x14')][_0xfcd6('0x15')]===0x1f4){logger[_0xfcd6('0x14')](_0xfcd6('0xf'),_0x4c2eb7,_0xcc5317[_0xfcd6('0x14')][_0xfcd6('0x16')]);return _0x550f2b(_0xcc5317[_0xfcd6('0x14')]['message']);}logger['error'](_0xfcd6('0xf'),_0x4c2eb7,_0xcc5317[_0xfcd6('0x14')]['message']);return _0x43b053(_0xcc5317[_0xfcd6('0x14')][_0xfcd6('0x16')]);}else{logger[_0xfcd6('0x17')](_0xfcd6('0xf'),_0x4c2eb7,'request\x20sent');_0x43b053(_0xcc5317['result'][_0xfcd6('0x16')]);}})[_0xfcd6('0x18')](function(_0x17bb38){logger[_0xfcd6('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x4c2eb7,_0x17bb38);_0x550f2b(_0x17bb38);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 13bed11..cfe690d 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 _0x5b05=['update','emit','removeListener','length','save','remove'];(function(_0x1462fa,_0x242c5b){var _0x3720d2=function(_0x2370d7){while(--_0x2370d7){_0x1462fa['push'](_0x1462fa['shift']());}};_0x3720d2(++_0x242c5b);}(_0x5b05,0x190));var _0x55b0=function(_0x4eb48b,_0x216a59){_0x4eb48b=_0x4eb48b-0x0;var _0x1806b0=_0x5b05[_0x4eb48b];return _0x1806b0;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x55b0('0x0'),_0x55b0('0x1'),_0x55b0('0x2')];function createListener(_0x4148d8,_0x28c785){return function(_0x2925fe){_0x28c785[_0x55b0('0x3')](_0x4148d8,_0x2925fe);};}function removeListener(_0x43a880,_0x2cbf51){return function(){VoicePrefixEvents[_0x55b0('0x4')](_0x43a880,_0x2cbf51);};}exports['register']=function(_0x569adf){for(var _0x129898=0x0,_0xe0c407=events[_0x55b0('0x5')];_0x129898<_0xe0c407;_0x129898++){var _0x355e20=events[_0x129898];var _0xdf375f=createListener('voicePrefix:'+_0x355e20,_0x569adf);VoicePrefixEvents['on'](_0x355e20,_0xdf375f);}}; \ No newline at end of file +var _0x6d2e=['voicePrefix:','save','remove','update','register','length'];(function(_0x2a4f10,_0x242620){var _0x2aaee5=function(_0x102074){while(--_0x102074){_0x2a4f10['push'](_0x2a4f10['shift']());}};_0x2aaee5(++_0x242620);}(_0x6d2e,0x97));var _0xe6d2=function(_0x2bbe8d,_0x5156c2){_0x2bbe8d=_0x2bbe8d-0x0;var _0x539e7a=_0x6d2e[_0x2bbe8d];return _0x539e7a;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xe6d2('0x0'),_0xe6d2('0x1'),_0xe6d2('0x2')];function createListener(_0x3ff4b6,_0x412889){return function(_0xf81df7){_0x412889['emit'](_0x3ff4b6,_0xf81df7);};}function removeListener(_0x2dee74,_0x5dc6e4){return function(){VoicePrefixEvents['removeListener'](_0x2dee74,_0x5dc6e4);};}exports[_0xe6d2('0x3')]=function(_0x2b4bf0){for(var _0x3c0fab=0x0,_0x4d9c9f=events[_0xe6d2('0x4')];_0x3c0fab<_0x4d9c9f;_0x3c0fab++){var _0x53906e=events[_0x3c0fab];var _0x2e227e=createListener(_0xe6d2('0x5')+_0x53906e,_0x2b4bf0);VoicePrefixEvents['on'](_0x53906e,_0x2e227e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 244c619..759243f 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(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0xb10b,0x12a));var _0xbb10=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xb10b[_0xcfc44];return _0x307a25;};'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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x375b34,_0x4c4cfb){var _0x3d3486=function(_0x4697f2){while(--_0x4697f2){_0x375b34['push'](_0x375b34['shift']());}};_0x3d3486(++_0x4c4cfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index ee8659c..1ea5560 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 _0x603e=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','outbound','default','ENUM','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','preview','includes','INTEGER','yes','once','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','power','predictive','booked','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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\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,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC'];(function(_0x475923,_0x25d9ec){var _0x374030=function(_0x3f256b){while(--_0x3f256b){_0x475923['push'](_0x475923['shift']());}};_0x374030(++_0x25d9ec);}(_0x603e,0xff));var _0xe603=function(_0x3e4cbb,_0x1ec2fd){_0x3e4cbb=_0x3e4cbb-0x0;var _0x78c593=_0x603e[_0x3e4cbb];return _0x78c593;};'use strict';var Sequelize=require(_0xe603('0x0'));module[_0xe603('0x1')]={'name':{'type':Sequelize[_0xe603('0x2')],'allowNull':![],'unique':_0xe603('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xe603('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xe603('0x2')],'defaultValue':_0xe603('0x5')},'announce':{'type':Sequelize[_0xe603('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe603('0x6')]('rr','ringall','leastrecent',_0xe603('0x7'),_0xe603('0x8'),_0xe603('0x9'),_0xe603('0xa'),_0xe603('0xb'),_0xe603('0xc')),'allowNull':![],'defaultValue':_0xe603('0xd'),'set':function(_0x555d41){this[_0xe603('0xe')](_0xe603('0xf'),_0x555d41?_0x555d41:_0xe603('0x9'));},'get':function(){var _0x1a6413=this[_0xe603('0x10')](_0xe603('0x11'));var _0x11f46b=this['getDataValue']('dialMethod');var _0x4adce2=this[_0xe603('0x10')](_0xe603('0xf'));if(_0x1a6413==='outbound'){if(_0x11f46b===_0xe603('0x12')){return null;}if(_0x11f46b==='booked'&&![_0xe603('0x9'),'roundrobin'][_0xe603('0x13')](_0x4adce2)){this[_0xe603('0xe')](_0xe603('0xf'),_0xe603('0x9'));}}return _0x4adce2;}},'servicelevel':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xe603('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defaultValue':_0xe603('0x15')},'autopause':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe603('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xe603('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe603('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe603('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe603('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe603('0x6')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe603('0x6')]('yes','no'),'defaultValue':_0xe603('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xe603('0x15'),'no',_0xe603('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe603('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xe603('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe603('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe603('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe603('0x2')]},'queue_youarenext':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe603('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe603('0x2')]},'queue_quantity1':{'type':Sequelize[_0xe603('0x2')]},'queue_quantity2':{'type':Sequelize[_0xe603('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xe603('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1282fe){this[_0xe603('0xe')](_0xe603('0x17'),_0x1282fe?_0x1282fe['join'](','):[]);},'get':function(){return this['getDataValue'](_0xe603('0x17'))?this[_0xe603('0x10')](_0xe603('0x17'))[_0xe603('0x18')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x111957){this['setDataValue'](_0xe603('0x19'),_0x111957?_0x111957[_0xe603('0x1a')](','):undefined);},'get':function(){return this[_0xe603('0x10')]('joinempty')?this[_0xe603('0x10')](_0xe603('0x19'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xf27877){this[_0xe603('0xe')](_0xe603('0x1b'),_0xf27877?_0xf27877[_0xe603('0x1a')](','):undefined);},'get':function(){return this[_0xe603('0x10')](_0xe603('0x1b'))?this[_0xe603('0x10')](_0xe603('0x1b'))[_0xe603('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe603('0x2')]},'description':{'type':Sequelize[_0xe603('0x2')]},'acw':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':0x0,'set':function(_0x1e6790){this['setDataValue']('acw',_0x1e6790);if(_0x1e6790){if(this[_0xe603('0x10')](_0xe603('0x1d'))<0x2){this[_0xe603('0xe')](_0xe603('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xe603('0x6')]('preview','progressive',_0xe603('0x1e'),_0xe603('0x1f'),_0xe603('0x20')),'defaultValue':_0xe603('0x21'),'comment':_0xe603('0x22')},'dialLimitChannel':{'type':Sequelize[_0xe603('0x14')](0x4)[_0xe603('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xe603('0x14')](0x4)[_0xe603('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe603('0x24')},'dialPowerLevel':{'type':Sequelize[_0xe603('0x25')](0x2)[_0xe603('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xe603('0x6')]('agentBusyFactor','dropRate'),'defaultValue':'dropRate','comment':_0xe603('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xe603('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe603('0x27')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe603('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xe603('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x28')},'dialQueueOptions':{'type':Sequelize[_0xe603('0x2')],'defaultValue':_0xe603('0x29'),'comment':_0xe603('0x2a')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x2b')},'dialQueueProject':{'type':Sequelize[_0xe603('0x2')],'comment':_0xe603('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe603('0x14')](0x5)[_0xe603('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe603('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe603('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe603('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe603('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe603('0x14')](0x5)[_0xe603('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe603('0x32')},'dialTimezone':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe603('0x2')],'defaultValue':_0xe603('0x33')},'dialPrefix':{'type':Sequelize[_0xe603('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x34'),_0xe603('0x35'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':0x0,'comment':_0xe603('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0xe603('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe603('0x37')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe603('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe603('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe603('0x14')](0x9)[_0xe603('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe603('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe603('0x14')](0x9)[_0xe603('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe603('0x3a')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe603('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe603('0x14')](0x9)[_0xe603('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe603('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe603('0x14')](0x9)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe603('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe603('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe603('0x14')](0x9)[_0xe603('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe603('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0xe603('0x14')](0x5)[_0xe603('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe603('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':0x0,'comment':_0xe603('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe603('0x6')](_0xe603('0x40'),_0xe603('0x41')),'defaultValue':_0xe603('0x40')},'dialQueueProject2':{'type':Sequelize[_0xe603('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe603('0x42')},'dialCutDigit':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe603('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0xe603('0x14')](0x5)[_0xe603('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe603('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe603('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe603('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe603('0x14')](0x5)[_0xe603('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe603('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe603('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe603('0x14')](0x5)[_0xe603('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe603('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe603('0x14')],'allowNull':!![],'comment':_0xe603('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':![],'comment':_0xe603('0x4d'),'set':function(_0x64f7b0){if(!_0x64f7b0)this[_0xe603('0xe')](_0xe603('0x4e'),null);this['setDataValue'](_0xe603('0x4f'),_0x64f7b0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe603('0x14')](0x3)[_0xe603('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe603('0x14')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe603('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0xe87d=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','STRING','ENUM','outbound','inbound','default','fewestcalls','linear','strategy','getDataValue','preview','booked','roundrobin','includes','setDataValue','rrmemory','INTEGER','yes','all','once','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xe87d,0x9d));var _0xde87=function(_0x373a43,_0x516820){_0x373a43=_0x373a43-0x0;var _0x474dd3=_0xe87d[_0x373a43];return _0x474dd3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xde87('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xde87('0x1')]('inbound',_0xde87('0x2')),'allowNull':![],'defaultValue':_0xde87('0x3')},'musiconhold':{'type':Sequelize[_0xde87('0x0')],'defaultValue':_0xde87('0x4')},'announce':{'type':Sequelize[_0xde87('0x0')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent',_0xde87('0x5'),'random','rrmemory',_0xde87('0x6'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x1585df){this['setDataValue'](_0xde87('0x7'),_0x1585df?_0x1585df:'rrmemory');},'get':function(){var _0x53c324=this[_0xde87('0x8')]('type');var _0x408247=this[_0xde87('0x8')]('dialMethod');var _0x1b0a37=this[_0xde87('0x8')](_0xde87('0x7'));if(_0x53c324===_0xde87('0x2')){if(_0x408247===_0xde87('0x9')){return null;}if(_0x408247===_0xde87('0xa')&&!['rrmemory',_0xde87('0xb')][_0xde87('0xc')](_0x1b0a37)){this[_0xde87('0xd')](_0xde87('0x7'),_0xde87('0xe'));}}return _0x1b0a37;}},'servicelevel':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xde87('0xf')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xde87('0x0')]},'weight':{'type':Sequelize[_0xde87('0xf')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xde87('0x10'),'no'),'defaultValue':_0xde87('0x10')},'autopause':{'type':Sequelize[_0xde87('0x1')]('yes','no',_0xde87('0x11')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xde87('0xf')](0xb)},'autopausebusy':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xde87('0x1')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xde87('0x10'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xde87('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xde87('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xde87('0x1')]('yes','no',_0xde87('0x12')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xde87('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xde87('0x1')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xde87('0xf')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xde87('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xde87('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xde87('0x0')]},'queue_quantity1':{'type':Sequelize[_0xde87('0x0')]},'queue_quantity2':{'type':Sequelize[_0xde87('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0xde87('0x0')]},'queue_less_than':{'type':Sequelize[_0xde87('0x0')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x315bd1){this[_0xde87('0xd')](_0xde87('0x13'),_0x315bd1?_0x315bd1[_0xde87('0x14')](','):[]);},'get':function(){return this[_0xde87('0x8')](_0xde87('0x13'))?this[_0xde87('0x8')](_0xde87('0x13'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xde87('0x0')],'defaultValue':'yes','set':function(_0x37214f){this['setDataValue'](_0xde87('0x15'),_0x37214f?_0x37214f['join'](','):undefined);},'get':function(){return this[_0xde87('0x8')](_0xde87('0x15'))?this[_0xde87('0x8')](_0xde87('0x15'))[_0xde87('0x16')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x2dbdc3){this['setDataValue']('leavewhenempty',_0x2dbdc3?_0x2dbdc3[_0xde87('0x14')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0xde87('0x8')](_0xde87('0x17'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xde87('0x1')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde87('0x0')]},'acw':{'type':Sequelize[_0xde87('0x18')],'defaultValue':0x0,'set':function(_0x29b99b){this[_0xde87('0xd')](_0xde87('0x19'),_0x29b99b);if(_0x29b99b){if(this[_0xde87('0x8')](_0xde87('0x1a'))<0x2){this[_0xde87('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xde87('0x1')]('preview',_0xde87('0x1b'),_0xde87('0x1c'),_0xde87('0x1d'),'booked'),'defaultValue':'progressive','comment':_0xde87('0x1e')},'dialLimitChannel':{'type':Sequelize[_0xde87('0xf')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xde87('0x1f')},'dialLimitQueue':{'type':Sequelize[_0xde87('0xf')](0x4)[_0xde87('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xde87('0x21')},'dialPowerLevel':{'type':Sequelize[_0xde87('0x22')](0x2)[_0xde87('0x20')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xde87('0x23')},'dialPredictiveOptimization':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x24'),'dropRate'),'defaultValue':'dropRate','comment':_0xde87('0x25')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xde87('0x26')},'dialPredictiveInterval':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xde87('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xde87('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x27')},'dialQueueOptions':{'type':Sequelize[_0xde87('0x0')],'defaultValue':'tTxX','comment':_0xde87('0x28')},'dialQueueTimeout':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x29')},'dialQueueProject':{'type':Sequelize[_0xde87('0x0')],'comment':_0xde87('0x2a')},'dialCongestionMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x2b')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x2c')},'dialBusyRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x2e')},'dialGlobalMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xde87('0x0')],'defaultValue':_0xde87('0x2f')},'dialPrefix':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xde87('0x30'),_0xde87('0x31'),'onlyIfOpen'),'defaultValue':_0xde87('0x30')},'dialAMDActive':{'type':Sequelize[_0xde87('0x18')],'defaultValue':0x0,'comment':_0xde87('0x32')},'dialAMDInitialSilence':{'type':Sequelize[_0xde87('0xf')](0x9)[_0xde87('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xde87('0x33')},'dialAMDGreeting':{'type':Sequelize[_0xde87('0xf')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xde87('0x34')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xde87('0xf')](0x9)[_0xde87('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xde87('0x35')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xde87('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xde87('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0xde87('0xf')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xde87('0x37')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xde87('0xf')](0x9)[_0xde87('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xde87('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xde87('0xf')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xde87('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xde87('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xde87('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0xde87('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xde87('0x18')],'defaultValue':0x0,'comment':_0xde87('0x3b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x3c'),_0xde87('0x3d')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xde87('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde87('0x3e')},'dialCutDigit':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde87('0x3f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x40')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x41')},'dialDropMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x42')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xde87('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![],'comment':_0xde87('0x4a'),'set':function(_0x3d47bc){if(!_0x3d47bc)this[_0xde87('0xd')]('mandatoryDispositionPauseId',null);this[_0xde87('0xd')](_0xde87('0x4b'),_0x3d47bc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xde87('0x18')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index c5958a1..ebae0db 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 _0x008c=['deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','into','fromQuery','COALESCE(phone,\x27\x27)','all','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','offset','undefined','count','set','Content-Range','then','inbound','map','value','includes','type','UserProfileResource','destroy','status','send','index','VoiceQueue','rawAttributes','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','filters','model','intersection','fields','attributes','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','VoiceQueues','QueueCampaigns','outbound','name','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','length','hasOwnProperty','nolimit','limit','sort','pick','VoiceQueueId','filter','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','isNil','interface','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','union','compact','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','isEmpty','UserVoiceQueueRt','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','cm_contacts'];(function(_0x285bd1,_0x1c55bc){var _0x1ce446=function(_0x3bbad0){while(--_0x3bbad0){_0x285bd1['push'](_0x285bd1['shift']());}};_0x1ce446(++_0x1c55bc);}(_0x008c,0x188));var _0xc008=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x008c[_0x12c34e];return _0x244e88;};'use strict';var moment=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));var squel=require(_0xc008('0x4'));var Redis=require('ioredis');var qs=require(_0xc008('0x5'));var logger=require(_0xc008('0x6'))(_0xc008('0x7'));var config=require(_0xc008('0x8'));var db=require(_0xc008('0x9'))['db'];config[_0xc008('0xa')]=_[_0xc008('0xb')](config[_0xc008('0xa')],{'host':_0xc008('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc008('0xa')]));require('./voiceQueue.socket')[_0xc008('0xd')](socket);function respondWithStatusCode(_0x5b64f8,_0x52041f){_0x52041f=_0x52041f||0xcc;return function(_0x27830d){if(_0x27830d){return _0x5b64f8[_0xc008('0xe')](_0x52041f);}return _0x5b64f8['status'](_0x52041f)['end']();};}function respondWithResult(_0x543eb8,_0x1eacfa){_0x1eacfa=_0x1eacfa||0xc8;return function(_0xc881aa){if(_0xc881aa){return _0x543eb8['status'](_0x1eacfa)[_0xc008('0xf')](_0xc881aa);}};}function respondWithFilteredResult(_0x332fd4,_0x2ea200){return function(_0x2a5b4e){if(_0x2a5b4e){var _0x9ffa93=typeof _0x2ea200[_0xc008('0x10')]===_0xc008('0x11')&&typeof _0x2ea200['limit']==='undefined';var _0x33f44c=_0x2a5b4e['count'];var _0x25e13f=_0x9ffa93?0x0:_0x2ea200[_0xc008('0x10')];var _0x2073ef=_0x9ffa93?_0x2a5b4e[_0xc008('0x12')]:_0x2ea200[_0xc008('0x10')]+_0x2ea200['limit'];var _0x5e894e;if(_0x2073ef>=_0x33f44c){_0x2073ef=_0x33f44c;_0x5e894e=0xc8;}else{_0x5e894e=0xce;}_0x332fd4['status'](_0x5e894e);return _0x332fd4[_0xc008('0x13')](_0xc008('0x14'),_0x25e13f+'-'+_0x2073ef+'/'+_0x33f44c)[_0xc008('0xf')](_0x2a5b4e);}return null;};}function saveUpdates(_0x3eb12a){return function(_0x4fe771){if(_0x4fe771){return _0x4fe771['update'](_0x3eb12a)['then'](function(_0x5c2668){return _0x5c2668;});}return null;};}function removeEntity(_0x46042b){return function(_0x462af5){if(_0x462af5){return _0x462af5['destroy']()[_0xc008('0x15')](function(){var _0x5906e6=_0x462af5['get']({'plain':!![]});var _0x543e5d=[{'name':'VoiceQueues','value':_0xc008('0x16'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x590a71=_(_0x543e5d)['filter']('ignore')[_0xc008('0x17')](_0xc008('0x18'))[_0xc008('0x18')]();if(_[_0xc008('0x19')](_0x590a71,_0x5906e6[_0xc008('0x1a')])){return;}var _0x110128=_['find'](_0x543e5d,[_0xc008('0x18'),_0x5906e6['type']])['name'];return db[_0xc008('0x1b')][_0xc008('0x1c')]({'where':{'type':_0x110128,'resourceId':_0x5906e6['id']}})[_0xc008('0x15')](function(){return _0x462af5;});})[_0xc008('0x15')](function(){_0x46042b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9){return function(_0x3f7b07){if(!_0x3f7b07){_0x5de1e9[_0xc008('0xe')](0x194);}return _0x3f7b07;};}function handleError(_0x92c582,_0x2e31c2){_0x2e31c2=_0x2e31c2||0x1f4;return function(_0x5bebd9){logger['error'](_0x5bebd9['stack']);if(_0x5bebd9['name']){delete _0x5bebd9['name'];}_0x92c582[_0xc008('0x1d')](_0x2e31c2)[_0xc008('0x1e')](_0x5bebd9);};}exports[_0xc008('0x1f')]=function(_0x529961,_0x24c14c){var _0x32390d={};var _0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x20')][_0xc008('0x21')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x22')]};});_0x32390d=qs[_0xc008('0x23')](_0x2a7d4f,_0x529961);var _0xf831f2={'where':_0x32390d[_0xc008('0x24')]};return db[_0xc008('0x20')][_0xc008('0x12')](_0xf831f2)[_0xc008('0x15')](function(_0x22d8e8){_0x209591[_0xc008('0x12')]=_0x22d8e8;_0x32390d[_0xc008('0x25')]=qs[_0xc008('0x25')](_0x529961[_0xc008('0x26')]);return db['VoiceQueue'][_0xc008('0x27')](_0x32390d);})[_0xc008('0x15')](function(_0x499754){_0x209591[_0xc008('0x28')]=_0x499754;return _0x209591;})[_0xc008('0x15')](respondWithFilteredResult(_0x24c14c,_0x32390d))[_0xc008('0x29')](handleError(_0x24c14c,null));};exports[_0xc008('0x2a')]=function(_0xd0e05a,_0x3cd878){var _0x7cfbc5={'raw':![],'where':{'id':_0xd0e05a[_0xc008('0x2b')]['id']}},_0x470e79={};_0x470e79['model']=_[_0xc008('0x2c')](db[_0xc008('0x20')][_0xc008('0x21')]);_0x470e79[_0xc008('0x26')]=_[_0xc008('0x2c')](_0xd0e05a[_0xc008('0x26')]);_0x470e79[_0xc008('0x2d')]=_['intersection'](_0x470e79[_0xc008('0x2e')],_0x470e79[_0xc008('0x26')]);_0x7cfbc5['attributes']=_[_0xc008('0x2f')](_0x470e79[_0xc008('0x2e')],qs['fields'](_0xd0e05a[_0xc008('0x26')][_0xc008('0x30')]));_0x7cfbc5[_0xc008('0x31')]=_0x7cfbc5['attributes']['length']?_0x7cfbc5['attributes']:_0x470e79[_0xc008('0x2e')];if(_0xd0e05a['query'][_0xc008('0x32')]){_0x7cfbc5[_0xc008('0x25')]=[{'all':!![]}];}_0x7cfbc5=_[_0xc008('0x33')]({},_0x7cfbc5,_0xd0e05a[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x7cfbc5)[_0xc008('0x15')](handleEntityNotFound(_0x3cd878,null))[_0xc008('0x15')](respondWithResult(_0x3cd878,null))[_0xc008('0x29')](handleError(_0x3cd878,null));};exports[_0xc008('0x36')]=function(_0x3ebb83,_0xdfca2e){return db[_0xc008('0x20')][_0xc008('0x36')](_0x3ebb83['body'],{})[_0xc008('0x15')](function(_0x23c4db){var _0x30b7df=_0x3ebb83[_0xc008('0x37')]['get']({'plain':!![]});if(!_0x30b7df)throw new Error(_0xc008('0x38'));if(_0x30b7df[_0xc008('0x39')]===_0xc008('0x37')){var _0x36e7ae=_0x23c4db[_0xc008('0x3a')]({'plain':!![]});var _0x5706bb=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':_0xc008('0x3c'),'value':_0xc008('0x3d')}];var _0x7279e8=_['find'](_0x5706bb,[_0xc008('0x18'),_0x36e7ae[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')]['find']({'where':{'name':_0x7279e8,'userProfileId':_0x30b7df[_0xc008('0x40')]},'raw':!![]})[_0xc008('0x15')](function(_0x351d5c){if(_0x351d5c&&_0x351d5c['autoAssociation']===0x0){return db[_0xc008('0x1b')]['create']({'name':_0x36e7ae[_0xc008('0x3e')],'resourceId':_0x36e7ae['id'],'type':_0x351d5c['name'],'sectionId':_0x351d5c['id']},{})[_0xc008('0x15')](function(){return _0x23c4db;});}else{return _0x23c4db;}})[_0xc008('0x29')](function(_0x5a5d85){logger[_0xc008('0x41')](_0xc008('0x42'),_0x5a5d85);throw _0x5a5d85;});}return _0x23c4db;})[_0xc008('0x15')](respondWithResult(_0xdfca2e,0xc9))['catch'](handleError(_0xdfca2e,null));};exports[_0xc008('0x43')]=function(_0x2a9b5c,_0x200469){var _0x44fc5d={'where':{'id':_0x2a9b5c[_0xc008('0x2b')]['id']}},_0x347629={};_0x347629['model']=_['keys'](db['VoiceQueue'][_0xc008('0x21')]);_0x44fc5d[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x347629[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x2a9b5c[_0xc008('0x26')][_0xc008('0x30')]));_0x44fc5d[_0xc008('0x31')]=_0x44fc5d['attributes']['length']?_0x44fc5d['attributes']:_0x347629[_0xc008('0x2e')];if(_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]){_0x44fc5d['include']=[{'all':!![]}];}_0x44fc5d=_[_0xc008('0x33')]({},_0x44fc5d,_0x2a9b5c[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x44fc5d)[_0xc008('0x15')](handleEntityNotFound(_0x200469,null))[_0xc008('0x15')](function(_0x17ec90){if(_0x17ec90){var _0x405e87=_0x17ec90[_0xc008('0x3a')]({'plain':!![]});_0x405e87=qs[_0xc008('0x44')](_0x405e87,['id','createdAt','updatedAt']);_0x2a9b5c[_0xc008('0x45')]=_['omit'](_0x2a9b5c[_0xc008('0x45')],['id',_0xc008('0x46'),_0xc008('0x47')]);return db['VoiceQueue'][_0xc008('0x36')](_[_0xc008('0x33')](_0x405e87,_0x2a9b5c[_0xc008('0x45')]),{'include':_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]?[{'all':!![]}]:undefined})['then'](function(_0x3a7b3b){var _0x27b022=_0x2a9b5c['user'][_0xc008('0x3a')]({'plain':!![]});if(!_0x27b022)throw new Error(_0xc008('0x38'));if(_0x27b022['role']==='user'){var _0x2df905=_0x3a7b3b[_0xc008('0x3a')]({'plain':!![]});var _0x20947b=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':'QueueCampaigns','value':'outbound'}];var _0x34b72a=_['find'](_0x20947b,[_0xc008('0x18'),_0x2df905[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')][_0xc008('0x35')]({'where':{'name':_0x34b72a,'userProfileId':_0x27b022[_0xc008('0x40')]},'raw':!![]})['then'](function(_0x2ea742){if(_0x2ea742&&_0x2ea742[_0xc008('0x48')]===0x0){return db[_0xc008('0x1b')][_0xc008('0x36')]({'name':_0x2df905[_0xc008('0x3e')],'resourceId':_0x2df905['id'],'type':_0x2ea742['name'],'sectionId':_0x2ea742['id']},{})[_0xc008('0x15')](function(){return _0x3a7b3b;});}else{return _0x3a7b3b;}})['catch'](function(_0x535e6e){logger['error'](_0xc008('0x42'),_0x535e6e);throw _0x535e6e;});}return _0x3a7b3b;});}})[_0xc008('0x15')](respondWithResult(_0x200469,0xc9))[_0xc008('0x29')](handleError(_0x200469,null));};exports['update']=function(_0x3aeeab,_0x2d8361){if(_0x3aeeab[_0xc008('0x45')]['id']){delete _0x3aeeab['body']['id'];}return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x3aeeab[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2d8361,null))['then'](saveUpdates(_0x3aeeab[_0xc008('0x45')],null))['then'](respondWithResult(_0x2d8361,null))[_0xc008('0x29')](handleError(_0x2d8361,null));};exports[_0xc008('0x1c')]=function(_0x2ae14e,_0x943c91){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2ae14e['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x943c91,null))['then'](removeEntity(_0x943c91,null))['catch'](handleError(_0x943c91,null));};exports[_0xc008('0x49')]=function(_0x30aa1e,_0x56e755){var _0xb1befa={'raw':![],'where':{}};var _0xb8ba7={};var _0x3e373e={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x30aa1e[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x56e755,null))['then'](function(_0x16e052){if(_0x16e052){_0xb8ba7[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x4b')][_0xc008('0x21')]);_0xb8ba7[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x30aa1e[_0xc008('0x26')]);_0xb8ba7[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0xb8ba7[_0xc008('0x2e')],_0xb8ba7[_0xc008('0x26')]);_0xb1befa[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xb8ba7['model'],qs[_0xc008('0x30')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x30')]));_0xb1befa['attributes']=_0xb1befa[_0xc008('0x31')][_0xc008('0x4c')]?_0xb1befa['attributes']:_0xb8ba7['model'];if(!_0x30aa1e[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0xb1befa[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x4f')]);_0xb1befa[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x10')]);}_0xb1befa['order']=qs[_0xc008('0x50')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x50')]);_0xb1befa[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x30aa1e['query'],_0xb8ba7[_0xc008('0x2d')]));_0xb1befa[_0xc008('0x24')][_0xc008('0x52')]=_0x16e052['id'];if(_0x30aa1e['query'][_0xc008('0x53')]){_0xb1befa[_0xc008('0x24')]=_[_0xc008('0x33')](_0xb1befa['where'],{'$or':_[_0xc008('0x17')](_0xb1befa['attributes'],function(_0x50ee03){var _0xee7a85={};_0xee7a85[_0x50ee03]={'$like':'%'+_0x30aa1e[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0xee7a85;})});}_0xb1befa=_[_0xc008('0x33')]({},_0xb1befa,_0x30aa1e['options']);return db[_0xc008('0x4b')][_0xc008('0x12')]({'where':_0xb1befa['where']})[_0xc008('0x15')](function(_0x5233bb){_0x3e373e[_0xc008('0x12')]=_0x5233bb;if(_0x30aa1e['query'][_0xc008('0x32')]){_0xb1befa['include']=[{'all':!![]}];}return db[_0xc008('0x4b')][_0xc008('0x27')](_0xb1befa);})[_0xc008('0x15')](function(_0x47337b){_0x3e373e['rows']=_0x47337b;return _0x3e373e;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x56e755,_0xb1befa))[_0xc008('0x29')](handleError(_0x56e755,null));};exports[_0xc008('0x54')]=function(_0x1d49db,_0x321500){var _0x13ef78={'raw':!![],'where':{}};var _0xd9e3fd={};var _0x3b46e4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc008('0x4a')]({'where':{'id':_0x1d49db['params']['id']}})['then'](handleEntityNotFound(_0x321500,null))['then'](function(_0x406ead){if(_0x406ead){_0xd9e3fd[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x55')][_0xc008('0x21')]);_0xd9e3fd[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x1d49db[_0xc008('0x26')]);_0xd9e3fd[_0xc008('0x2d')]=_['intersection'](_0xd9e3fd[_0xc008('0x2e')],_0xd9e3fd[_0xc008('0x26')]);_0x13ef78[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xd9e3fd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1d49db[_0xc008('0x26')][_0xc008('0x30')]));_0x13ef78[_0xc008('0x31')]=_0x13ef78[_0xc008('0x31')][_0xc008('0x4c')]?_0x13ef78[_0xc008('0x31')]:_0xd9e3fd['model'];if(!_0x1d49db['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x13ef78[_0xc008('0x4f')]=qs['limit'](_0x1d49db[_0xc008('0x26')][_0xc008('0x4f')]);_0x13ef78['offset']=qs['offset'](_0x1d49db['query'][_0xc008('0x10')]);}_0x13ef78[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1d49db[_0xc008('0x26')][_0xc008('0x50')]);_0x13ef78[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x1d49db[_0xc008('0x26')],_0xd9e3fd[_0xc008('0x2d')]));_0x13ef78['where']['VoiceQueueId']=_0x406ead['id'];if(_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]){_0x13ef78[_0xc008('0x24')]=_[_0xc008('0x33')](_0x13ef78[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x13ef78['attributes'],function(_0x5794fe){var _0x68372f={};_0x68372f[_0x5794fe]={'$like':'%'+_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x68372f;})});}_0x13ef78=_['merge']({},_0x13ef78,_0x1d49db['options']);return db['CmHopperHistory']['count']({'where':_0x13ef78['where']})['then'](function(_0x276de2){_0x3b46e4['count']=_0x276de2;if(_0x1d49db[_0xc008('0x26')]['includeAll']){_0x13ef78[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x55')][_0xc008('0x27')](_0x13ef78);})['then'](function(_0x58f348){_0x3b46e4[_0xc008('0x28')]=_0x58f348;return _0x3b46e4;});}})['then'](respondWithFilteredResult(_0x321500,_0x13ef78))[_0xc008('0x29')](handleError(_0x321500,null));};exports[_0xc008('0x57')]=function(_0x544519,_0x7b7246){var _0x4db90b={'raw':!![],'where':{}};var _0x554cf4={};var _0x23bece={'count':0x0,'rows':[]};return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x544519[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x7b7246,null))[_0xc008('0x15')](function(_0x4bd290){if(_0x4bd290){_0x554cf4[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x58')][_0xc008('0x21')]);_0x554cf4[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x544519['query']);_0x554cf4[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],_0x554cf4['query']);_0x4db90b[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],qs['fields'](_0x544519['query']['fields']));_0x4db90b[_0xc008('0x31')]=_0x4db90b[_0xc008('0x31')][_0xc008('0x4c')]?_0x4db90b[_0xc008('0x31')]:_0x554cf4[_0xc008('0x2e')];if(!_0x544519[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x4db90b['limit']=qs[_0xc008('0x4f')](_0x544519[_0xc008('0x26')]['limit']);_0x4db90b['offset']=qs[_0xc008('0x10')](_0x544519[_0xc008('0x26')][_0xc008('0x10')]);}_0x4db90b[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x544519['query'][_0xc008('0x50')]);_0x4db90b[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x544519[_0xc008('0x26')],_0x554cf4[_0xc008('0x2d')]));_0x4db90b[_0xc008('0x24')]['VoiceQueueId']=_0x4bd290['id'];if(_0x544519[_0xc008('0x26')][_0xc008('0x53')]){_0x4db90b[_0xc008('0x24')]=_[_0xc008('0x33')](_0x4db90b['where'],{'$or':_[_0xc008('0x17')](_0x4db90b[_0xc008('0x31')],function(_0x57cf19){var _0x555e8a={};_0x555e8a[_0x57cf19]={'$like':'%'+_0x544519[_0xc008('0x26')]['filter']+'%'};return _0x555e8a;})});}_0x4db90b=_[_0xc008('0x33')]({},_0x4db90b,_0x544519[_0xc008('0x34')]);return db['CmHopperFinal'][_0xc008('0x12')]({'where':_0x4db90b[_0xc008('0x24')]})[_0xc008('0x15')](function(_0xbe42a2){_0x23bece[_0xc008('0x12')]=_0xbe42a2;if(_0x544519[_0xc008('0x26')][_0xc008('0x32')]){_0x4db90b[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x58')][_0xc008('0x27')](_0x4db90b);})['then'](function(_0x49e6d5){_0x23bece[_0xc008('0x28')]=_0x49e6d5;return _0x23bece;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x7b7246,_0x4db90b))['catch'](handleError(_0x7b7246,null));};exports[_0xc008('0x59')]=function(_0x1bdaa9,_0x698d5c){var _0x5f1e48={'raw':!![],'where':{}};var _0x303cdd={};var _0x38239a={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x1bdaa9[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x698d5c,null))[_0xc008('0x15')](function(_0x5bd010){if(_0x5bd010){_0x303cdd[_0xc008('0x2e')]=_['keys'](db[_0xc008('0x5a')][_0xc008('0x21')]);_0x303cdd[_0xc008('0x26')]=_['keys'](_0x1bdaa9[_0xc008('0x26')]);_0x303cdd[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],_0x303cdd[_0xc008('0x26')]);_0x5f1e48[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1bdaa9[_0xc008('0x26')]['fields']));_0x5f1e48[_0xc008('0x31')]=_0x5f1e48[_0xc008('0x31')][_0xc008('0x4c')]?_0x5f1e48[_0xc008('0x31')]:_0x303cdd[_0xc008('0x2e')];if(!_0x1bdaa9['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x5f1e48[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x4f')]);_0x5f1e48[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x10')]);}_0x5f1e48[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x50')]);_0x5f1e48[_0xc008('0x24')]=qs['filters'](_['pick'](_0x1bdaa9[_0xc008('0x26')],_0x303cdd[_0xc008('0x2d')]));_0x5f1e48[_0xc008('0x24')][_0xc008('0x52')]=_0x5bd010['id'];if(_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]){_0x5f1e48[_0xc008('0x24')]=_[_0xc008('0x33')](_0x5f1e48[_0xc008('0x24')],{'$or':_['map'](_0x5f1e48[_0xc008('0x31')],function(_0x2bbadf){var _0x54fd75={};_0x54fd75[_0x2bbadf]={'$like':'%'+_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x54fd75;})});}_0x5f1e48=_[_0xc008('0x33')]({},_0x5f1e48,_0x1bdaa9[_0xc008('0x34')]);return db[_0xc008('0x5a')][_0xc008('0x12')]({'where':_0x5f1e48['where']})[_0xc008('0x15')](function(_0x321532){_0x38239a[_0xc008('0x12')]=_0x321532;if(_0x1bdaa9[_0xc008('0x26')]['includeAll']){_0x5f1e48[_0xc008('0x25')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc008('0x27')](_0x5f1e48);})[_0xc008('0x15')](function(_0x5b47c3){_0x38239a[_0xc008('0x28')]=_0x5b47c3;return _0x38239a;});}})['then'](respondWithFilteredResult(_0x698d5c,_0x5f1e48))[_0xc008('0x29')](handleError(_0x698d5c,null));};exports['getTeams']=function(_0x5b387d,_0x5351f7){var _0x79dfea={};var _0x402b67={};var _0x48f40f;var _0x4fda8;return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x5b387d[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5351f7,null))[_0xc008('0x15')](function(_0x5843ee){if(_0x5843ee){_0x48f40f=_0x5843ee;_0x402b67[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x5b')][_0xc008('0x21')]);_0x402b67[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x5b387d[_0xc008('0x26')]);_0x402b67[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],_0x402b67[_0xc008('0x26')]);_0x79dfea['attributes']=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5b387d['query'][_0xc008('0x30')]));_0x79dfea[_0xc008('0x31')]=_0x79dfea[_0xc008('0x31')]['length']?_0x79dfea[_0xc008('0x31')]:_0x402b67['model'];_0x79dfea[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5b387d[_0xc008('0x26')]['sort']);_0x79dfea[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x5b387d[_0xc008('0x26')],_0x402b67[_0xc008('0x2d')]));if(_0x5b387d[_0xc008('0x26')][_0xc008('0x53')]){_0x79dfea['where']=_[_0xc008('0x33')](_0x79dfea[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x79dfea[_0xc008('0x31')],function(_0x5a61d6){var _0x46fba5={};_0x46fba5[_0x5a61d6]={'$like':'%'+_0x5b387d['query'][_0xc008('0x53')]+'%'};return _0x46fba5;})});}_0x79dfea=_[_0xc008('0x33')]({},_0x79dfea,_0x5b387d[_0xc008('0x34')]);return _0x48f40f[_0xc008('0x5c')](_0x79dfea);}})[_0xc008('0x15')](function(_0x9f266e){if(_0x9f266e){_0x4fda8=_0x9f266e[_0xc008('0x4c')];if(!_0x5b387d['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x79dfea[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5b387d['query'][_0xc008('0x4f')]);_0x79dfea['offset']=qs[_0xc008('0x10')](_0x5b387d[_0xc008('0x26')][_0xc008('0x10')]);}return _0x48f40f['getTeams'](_0x79dfea);}})['then'](function(_0x39bfc0){if(_0x39bfc0){return _0x39bfc0?{'count':_0x4fda8,'rows':_0x39bfc0}:null;}})['then'](respondWithResult(_0x5351f7,null))[_0xc008('0x29')](handleError(_0x5351f7,null));};exports[_0xc008('0x5d')]=function(_0x1c2e63,_0xaf3bed){var _0x58ae7b=_0x1c2e63[_0xc008('0x45')][_0xc008('0x5e')];var _0x537e5e=_['map'](_0x58ae7b,'id');return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x537e5e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc008('0x5f'),'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),_0xc008('0x61'),'interface'],'raw':!![]}]})[_0xc008('0x15')](function(_0x3721e8){if(_0x3721e8){var _0xc344a7=_[_0xc008('0x62')](_0x3721e8,function(_0x78b833){var _0x177733=_0x78b833[_0xc008('0x3a')]({'plain':!![]});_0x177733[_0xc008('0x5f')][_0xc008('0x63')](function(_0xa332b1){_0xa332b1[_0xc008('0x64')]=_[_0xc008('0x35')](_0x58ae7b,{'id':_0x177733['id']})[_0xc008('0x64')];});return _0x177733['Agents'];});return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1c2e63[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](function(_0x4447ba){return db[_0xc008('0x65')][_0xc008('0x66')](function(_0xe5d226){return _0x4447ba['addTeams'](_0x537e5e,{'transaction':_0xe5d226})['then'](function(){return BPromise[_0xc008('0x67')](_0x58ae7b,function(_0x3d33ed){return db[_0xc008('0x68')]['upsert']({'TeamId':_0x3d33ed['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id'],'penalty':_0x3d33ed[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_0xc344a7,function(_0x156ec3){return db[_0xc008('0x69')][_0xc008('0x6a')]({'where':{'UserId':_0x156ec3['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id']},'defaults':{'penalty':_0x156ec3[_0xc008('0x64')]},'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_[_0xc008('0x53')](_0xc344a7,{'online':!![]}),function(_0x4ffaa3){return db['UserVoiceQueueRt'][_0xc008('0x6b')]({'membername':_0x4ffaa3[_0xc008('0x3e')],'UserId':_0x4ffaa3['id'],'queue_name':_0x4447ba['name'],'VoiceQueueId':_0x4447ba['id'],'interface':_[_0xc008('0x6c')](_0x4ffaa3[_0xc008('0x6d')])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0x4ffaa3[_0xc008('0x3e')]):_0x4ffaa3[_0xc008('0x6d')],'paused':_0x4ffaa3[_0xc008('0x61')]||![],'penalty':_0x4ffaa3[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){_0xc344a7['forEach'](function(_0x51b305){socket['emit'](_0xc008('0x70'),{'UserId':_0x51b305['id'],'VoiceQueueId':_0x4447ba['id']});});});});});}})['then'](respondWithStatusCode(_0xaf3bed,null))[_0xc008('0x29')](handleError(_0xaf3bed,null));};exports[_0xc008('0x71')]=function(_0x2c6a48,_0x177e8e){return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')]},'attributes':['id'],'include':[{'model':db[_0xc008('0x73')],'as':_0xc008('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xc008('0x15')](handleEntityNotFound(_0x177e8e,null))[_0xc008('0x15')](function(_0x1fea74){var _0x304083=_[_0xc008('0x17')](_0x1fea74,'id');var _0x473f44=[];var _0x41d1ea=[];var _0x5c2ca1=squel[_0xc008('0x74')]();_0x5c2ca1['field'](_0xc008('0x75'))[_0xc008('0x76')](_0xc008('0x77'),'tq')['join'](_0xc008('0x78'),'ut',_0xc008('0x79'))[_0xc008('0x24')](_0xc008('0x7a'),_0x2c6a48[_0xc008('0x2b')]['id']);for(var _0x377754=0x0;_0x377754<_0x1fea74[_0xc008('0x4c')];_0x377754+=0x1){let _0x57b8da=_0x1fea74[_0x377754];for(var _0x1cad4b=0x0;_0x1cad4b<_0x57b8da[_0xc008('0x5f')][_0xc008('0x4c')];_0x1cad4b+=0x1){let _0xdb4cef=_0x57b8da['Agents'][_0x1cad4b];var _0x555e8c=_0x5c2ca1['clone']();_0x555e8c['where'](_0xc008('0x7b'),_0xdb4cef['id']);_0x41d1ea[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x555e8c['toString'](),{'type':db[_0xc008('0x65')][_0xc008('0x7d')][_0xc008('0x7e')]})['then'](function(_0x438195){if(_0x438195['length']===0x1){return _0xdb4cef['id'];}else{var _0x3d76b7=_['every'](_[_0xc008('0x17')](_0x438195,_0xc008('0x7f')),function(_0x1aaf89){return _[_0xc008('0x19')](_0x304083,_0x1aaf89);});if(_0x3d76b7){return _0xdb4cef['id'];}}}));}}return BPromise['all'](_0x41d1ea)[_0xc008('0x15')](function(_0x19dcb7){_0x473f44=_(_0x473f44)[_0xc008('0x80')](_0x19dcb7)[_0xc008('0x81')]()[_0xc008('0x18')]();return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2c6a48['params']['id']}})[_0xc008('0x15')](function(_0x30b6af){return db[_0xc008('0x65')]['transaction'](function(_0x5ba04f){return _0x30b6af[_0xc008('0x71')](_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')],{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){if(!_['isEmpty'](_0x473f44)){return _0x30b6af[_0xc008('0x82')](_0x473f44,{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2c6a48['params']['id'],'UserId':_0x473f44},'transaction':_0x5ba04f});});}})[_0xc008('0x15')](function(){_0x473f44['forEach'](function(_0x3744e1){socket['emit'](_0xc008('0x83'),{'UserId':_0x3744e1,'VoiceQueueId':_0x30b6af['id']});});});});});});})[_0xc008('0x15')](respondWithStatusCode(_0x177e8e,null))[_0xc008('0x29')](handleError(_0x177e8e,null));};exports[_0xc008('0x84')]=function(_0x5c24cd,_0x5effd6){var _0x23ba7e,_0x274739;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5c24cd[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5effd6,null))[_0xc008('0x15')](function(_0x272d98){if(_0x272d98){_0x274739=_0x272d98;return _0x272d98[_0xc008('0x84')](_0x5c24cd[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5c24cd[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{})[_0xc008('0x85')](function(_0x57687f){for(var _0x5ea13a=0x0;_0x5ea13a<_0x5c24cd[_0xc008('0x45')]['ids'][_0xc008('0x4c')];_0x5ea13a+=0x1){socket[_0xc008('0x86')]('userVoiceQueue:save',{'UserId':Number(_0x5c24cd['body'][_0xc008('0x72')][_0x5ea13a]),'VoiceQueueId':Number(_0x5c24cd[_0xc008('0x2b')]['id'])});}return _0x57687f;});}})[_0xc008('0x15')](function(_0x129cbf){_0x23ba7e=_0x129cbf||[];if(_0x274739){return db[_0xc008('0x73')][_0xc008('0x27')]({'where':{'id':_0x5c24cd['body'][_0xc008('0x72')]},'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),'voicePause',_0xc008('0x6d')],'raw':!![]});}})[_0xc008('0x15')](function(_0xcef0e4){if(!_[_0xc008('0x87')](_0xcef0e4)){var _0x49f92e=[];for(var _0x4ae026=0x0;_0x4ae026<_0xcef0e4[_0xc008('0x4c')];_0x4ae026++){if(_0xcef0e4[_0x4ae026]['online']){_0x49f92e[_0xc008('0x7c')](db[_0xc008('0x88')][_0xc008('0x6b')]({'membername':_0xcef0e4[_0x4ae026][_0xc008('0x3e')],'UserId':_0xcef0e4[_0x4ae026]['id'],'queue_name':_0x274739[_0xc008('0x3e')],'VoiceQueueId':_0x274739['id'],'interface':_['isNil'](_0xcef0e4[_0x4ae026]['interface'])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0xcef0e4[_0x4ae026][_0xc008('0x3e')]):_0xcef0e4[_0x4ae026][_0xc008('0x6d')],'paused':_0xcef0e4[_0x4ae026][_0xc008('0x61')]||![],'penalty':_0x5c24cd[_0xc008('0x45')][_0xc008('0x64')]||0x0}));}}return BPromise['all'](_0x49f92e);}})[_0xc008('0x15')](function(){return _0x23ba7e;})[_0xc008('0x15')](respondWithResult(_0x5effd6,null))[_0xc008('0x29')](handleError(_0x5effd6,null));};exports[_0xc008('0x82')]=function(_0x1afb32,_0x1c2263){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x1afb32[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x1c2263,null))[_0xc008('0x15')](function(_0x328284){if(_0x328284){return _0x328284['removeAgents'](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])['then'](function(){if(_[_0xc008('0x89')](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])){for(var _0x2598be=0x0;_0x2598be<_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0xc008('0x4c')];_0x2598be+=0x1){socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0x2598be]),'VoiceQueueId':Number(_0x1afb32['params']['id'])});}}else{socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]),'VoiceQueueId':Number(_0x1afb32[_0xc008('0x2b')]['id'])});}});}})[_0xc008('0x15')](function(_0x12f5d1){return db[_0xc008('0x88')][_0xc008('0x1c')]({'where':{'VoiceQueueId':_0x1afb32[_0xc008('0x2b')]['id'],'UserId':_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]}})[_0xc008('0x15')](function(){return _0x12f5d1;});})[_0xc008('0x15')](respondWithStatusCode(_0x1c2263,null))[_0xc008('0x29')](handleError(_0x1c2263,null));};exports[_0xc008('0x8a')]=function(_0x5c358b,_0x49688b){var _0x51fd86={};var _0x10778f={};var _0x237ffb;var _0x3f80f4;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x5c358b[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x49688b,null))['then'](function(_0x3e7099){if(_0x3e7099){_0x237ffb=_0x3e7099;_0x10778f['model']=_['keys'](db[_0xc008('0x73')][_0xc008('0x21')]);_0x10778f['query']=_[_0xc008('0x2c')](_0x5c358b[_0xc008('0x26')]);_0x10778f[_0xc008('0x2d')]=_['intersection'](_0x10778f[_0xc008('0x2e')],_0x10778f[_0xc008('0x26')]);_0x51fd86[_0xc008('0x31')]=_['intersection'](_0x10778f[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5c358b[_0xc008('0x26')][_0xc008('0x30')]));_0x51fd86[_0xc008('0x31')]=_0x51fd86[_0xc008('0x31')][_0xc008('0x4c')]?_0x51fd86[_0xc008('0x31')]:_0x10778f['model'];_0x51fd86[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5c358b[_0xc008('0x26')][_0xc008('0x50')]);_0x51fd86[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x5c358b[_0xc008('0x26')],_0x10778f[_0xc008('0x2d')]));if(_0x5c358b[_0xc008('0x26')][_0xc008('0x53')]){_0x51fd86[_0xc008('0x24')]=_[_0xc008('0x33')](_0x51fd86[_0xc008('0x24')],{'$or':_['map'](_0x51fd86[_0xc008('0x31')],function(_0x231318){var _0x3df369={};_0x3df369[_0x231318]={'$like':'%'+_0x5c358b[_0xc008('0x26')]['filter']+'%'};return _0x3df369;})});}_0x51fd86=_['merge']({},_0x51fd86,_0x5c358b[_0xc008('0x34')]);return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})['then'](function(_0x30e433){if(_0x30e433){_0x3f80f4=_0x30e433[_0xc008('0x4c')];if(!_0x5c358b[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x51fd86[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5c358b['query']['limit']);_0x51fd86[_0xc008('0x10')]=qs['offset'](_0x5c358b[_0xc008('0x26')][_0xc008('0x10')]);}return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})[_0xc008('0x15')](function(_0x2ea1db){if(_0x2ea1db){return _0x2ea1db?{'count':_0x3f80f4,'rows':_0x2ea1db}:null;}})[_0xc008('0x15')](respondWithResult(_0x49688b,null))[_0xc008('0x29')](handleError(_0x49688b,null));};exports[_0xc008('0x8b')]=function(_0x367873,_0x356a82){var _0x368c1f={};var _0x4fd0ff={};var _0x22772e;var _0x39fd43;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x367873[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x356a82,null))[_0xc008('0x15')](function(_0x506dc0){if(_0x506dc0){_0x22772e=_0x506dc0;_0x4fd0ff[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x88')]['rawAttributes']);_0x4fd0ff[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x367873[_0xc008('0x26')]);_0x4fd0ff[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],_0x4fd0ff['query']);_0x368c1f['attributes']=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x367873[_0xc008('0x26')][_0xc008('0x30')]));_0x368c1f['attributes']=_0x368c1f[_0xc008('0x31')]['length']?_0x368c1f[_0xc008('0x31')]:_0x4fd0ff[_0xc008('0x2e')];_0x368c1f['order']=qs[_0xc008('0x50')](_0x367873[_0xc008('0x26')][_0xc008('0x50')]);_0x368c1f[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x367873[_0xc008('0x26')],_0x4fd0ff[_0xc008('0x2d')]));if(_0x367873[_0xc008('0x26')][_0xc008('0x53')]){_0x368c1f['where']=_[_0xc008('0x33')](_0x368c1f[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x368c1f['attributes'],function(_0x43f96e){var _0x353cd5={};_0x353cd5[_0x43f96e]={'$like':'%'+_0x367873[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x353cd5;})});}_0x368c1f=_['merge']({},_0x368c1f,_0x367873[_0xc008('0x34')]);return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x9afcd6){if(_0x9afcd6){_0x39fd43=_0x9afcd6[_0xc008('0x4c')];if(!_0x367873['query'][_0xc008('0x4d')]('nolimit')){_0x368c1f['limit']=qs[_0xc008('0x4f')](_0x367873['query'][_0xc008('0x4f')]);_0x368c1f[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x367873[_0xc008('0x26')][_0xc008('0x10')]);}return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x5e9e9c){return _0x5e9e9c?{'count':_0x39fd43,'rows':_0x5e9e9c}:null;})[_0xc008('0x15')](respondWithResult(_0x356a82,null))[_0xc008('0x29')](handleError(_0x356a82,null));};exports[_0xc008('0x8c')]=function(_0x45fe90,_0xc046ce){var _0x46fc75={};var _0x59b5b9={};var _0x3c3ead;var _0x3c8a79;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x45fe90[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0xc046ce,null))[_0xc008('0x15')](function(_0x3aa9b4){if(_0x3aa9b4){_0x3c3ead=_0x3aa9b4;_0x59b5b9['model']=_['keys'](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x59b5b9['query']=_[_0xc008('0x2c')](_0x45fe90['query']);_0x59b5b9[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],_0x59b5b9[_0xc008('0x26')]);_0x46fc75[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],qs['fields'](_0x45fe90[_0xc008('0x26')]['fields']));_0x46fc75[_0xc008('0x31')]=_0x46fc75[_0xc008('0x31')][_0xc008('0x4c')]?_0x46fc75[_0xc008('0x31')]:_0x59b5b9[_0xc008('0x2e')];_0x46fc75[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x45fe90['query'][_0xc008('0x50')]);_0x46fc75[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x45fe90[_0xc008('0x26')],_0x59b5b9[_0xc008('0x2d')]));if(_0x45fe90[_0xc008('0x26')][_0xc008('0x53')]){_0x46fc75[_0xc008('0x24')]=_['merge'](_0x46fc75[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x46fc75[_0xc008('0x31')],function(_0x3e7c19){var _0x47d263={};_0x47d263[_0x3e7c19]={'$like':'%'+_0x45fe90['query']['filter']+'%'};return _0x47d263;})});}_0x46fc75=_[_0xc008('0x33')]({},_0x46fc75,_0x45fe90[_0xc008('0x34')]);return _0x3c3ead['getLists'](_0x46fc75);}})['then'](function(_0x5035ca){if(_0x5035ca){_0x3c8a79=_0x5035ca['length'];if(!_0x45fe90[_0xc008('0x26')][_0xc008('0x4d')]('nolimit')){_0x46fc75[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x45fe90[_0xc008('0x26')][_0xc008('0x4f')]);_0x46fc75[_0xc008('0x10')]=qs['offset'](_0x45fe90['query'][_0xc008('0x10')]);}return _0x3c3ead[_0xc008('0x8c')](_0x46fc75);}})[_0xc008('0x15')](function(_0x46f9ab){if(_0x46f9ab){return _0x46f9ab?{'count':_0x3c8a79,'rows':_0x46f9ab}:null;}})[_0xc008('0x15')](respondWithResult(_0xc046ce,null))[_0xc008('0x29')](handleError(_0xc046ce,null));};exports[_0xc008('0x8e')]=function(_0x5645bb,_0x2ebe07){var _0x3d6f0d=moment()[_0xc008('0x6e')](_0xc008('0x8f'));var _0x3be328,_0x3bcf94;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5645bb['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2ebe07,null))[_0xc008('0x15')](function(_0x11bcba){if(_0x11bcba){_0x3bcf94=_0x11bcba;return _0x11bcba[_0xc008('0x8e')](_0x5645bb[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5645bb[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0xefba5){var _0x202826;_0x3be328=_0xefba5||[];var _0x37e1f2=[];if(_0xefba5){for(var _0x5161f3=0x0;_0x5161f3<_0xefba5['length'];_0x5161f3+=0x1){var _0x43ec81=_0xefba5[_0x5161f3][_0xc008('0x3a')]({'plain':!![]});_0x3bcf94[_0xc008('0x90')]=_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]?_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]:_0x3bcf94['dialCheckDuplicateType'];switch(_0x3bcf94['dialCheckDuplicateType']){case'always':_0x202826=squel[_0xc008('0x91')]()['into']('cm_hopper')['fromQuery']([_0xc008('0x92'),_0xc008('0x93'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','scheduledAt')['field']('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),'VoiceQueueId')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')['field']('\x27'+_0x3d6f0d+'\x27','updatedAt')['from'](_0xc008('0x99'))['where'](_0xc008('0x9a'))[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81['CmListId']['toString']())[_0xc008('0x24')](_0xc008('0x9c'))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x9e'))[_0xc008('0x76')](_0xc008('0x9f'))[_0xc008('0x24')](_0xc008('0x7a'),_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')]()))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0xc008('0x76')](_0xc008('0xa0'))[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id']['toString']())))['toString']();break;case _0xc008('0xa1'):_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x93'),'ContactId',_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0x92'),_0xc008('0x92'))['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))[_0xc008('0x96')]('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81['CmListId'][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),_0xc008('0x52'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where'](_0xc008('0x9a'))['where']('ListId\x20=\x20?',_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL')[_0xc008('0x24')](_0xc008('0x9d'),squel['select']()[_0xc008('0x96')](_0xc008('0xa4'))['from']('cm_hopper')[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id'][_0xc008('0x98')]())))['toString']();break;default:_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),'scheduledAt','ContactId',_0xc008('0x95'),'VoiceQueueId',_0xc008('0x46'),'updatedAt'],squel['select']()['field'](_0xc008('0x92'),'phone')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))['field']('id','ContactId')[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))['field'](_0x5645bb['params']['id'][_0xc008('0x98')](),'VoiceQueueId')['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')['from']('cm_contacts')[_0xc008('0x24')]('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x37e1f2[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x202826));}return BPromise[_0xc008('0xa5')](_0x37e1f2);}})[_0xc008('0x15')](function(){var _0x262b79=[];var _0x15c5a2=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa6'))[_0xc008('0xa3')]([_0xc008('0xa7'),'phone',_0xc008('0xa8'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0xa9'))[_0xc008('0x96')](_0xc008('0xaa'))[_0xc008('0x96')](_0xc008('0xab'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')[_0xc008('0x76')](_0xc008('0xac'),'ci')[_0xc008('0xad')](_0xc008('0xa0'),'h',_0xc008('0xae'))[_0xc008('0x24')](_0xc008('0xaf'),_0x3d6f0d)['where'](_0xc008('0xb0'),'PHONE'))[_0xc008('0x98')]();_0x262b79[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x15c5a2));return BPromise[_0xc008('0xa5')](_0x262b79);})[_0xc008('0x15')](function(){return _0x3be328;})[_0xc008('0x15')](respondWithResult(_0x2ebe07,null))[_0xc008('0x29')](handleError(_0x2ebe07,null));};exports[_0xc008('0xb1')]=function(_0x471780,_0x4fae34){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x471780[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x4fae34,null))[_0xc008('0x15')](function(_0x1cc6a6){if(_0x1cc6a6){return _0x1cc6a6[_0xc008('0xb1')](_0x471780[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x471618){if(_0x471618){return db[_0xc008('0x4b')][_0xc008('0x1c')]({'where':{'ListId':_0x471780['query'][_0xc008('0x72')],'VoiceQueueId':_0x471780['params']['id']}})[_0xc008('0x15')](function(){return _0x471618;});}})[_0xc008('0x15')](respondWithStatusCode(_0x4fae34,null))[_0xc008('0x29')](handleError(_0x4fae34,null));};exports[_0xc008('0xb2')]=function(_0x370234,_0x3ff7d2){var _0x478794={};var _0x406de6={};var _0x34cbce;var _0x337acd;return db['VoiceQueue']['findOne']({'where':{'id':_0x370234['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3ff7d2,null))[_0xc008('0x15')](function(_0x2ccfcf){if(_0x2ccfcf){_0x34cbce=_0x2ccfcf;_0x406de6[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x406de6['query']=_[_0xc008('0x2c')](_0x370234[_0xc008('0x26')]);_0x406de6[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],_0x406de6['query']);_0x478794[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x370234[_0xc008('0x26')][_0xc008('0x30')]));_0x478794[_0xc008('0x31')]=_0x478794[_0xc008('0x31')][_0xc008('0x4c')]?_0x478794[_0xc008('0x31')]:_0x406de6[_0xc008('0x2e')];_0x478794['order']=qs[_0xc008('0x50')](_0x370234['query'][_0xc008('0x50')]);_0x478794[_0xc008('0x24')]=qs[_0xc008('0x2d')](_['pick'](_0x370234[_0xc008('0x26')],_0x406de6['filters']));if(_0x370234[_0xc008('0x26')][_0xc008('0x53')]){_0x478794[_0xc008('0x24')]=_[_0xc008('0x33')](_0x478794[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x478794[_0xc008('0x31')],function(_0x89601c){var _0x22bb2a={};_0x22bb2a[_0x89601c]={'$like':'%'+_0x370234[_0xc008('0x26')]['filter']+'%'};return _0x22bb2a;})});}_0x478794=_[_0xc008('0x33')]({},_0x478794,_0x370234['options']);return _0x34cbce['getBlackLists'](_0x478794);}})[_0xc008('0x15')](function(_0x55ad1f){if(_0x55ad1f){_0x337acd=_0x55ad1f[_0xc008('0x4c')];if(!_0x370234[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x478794['limit']=qs[_0xc008('0x4f')](_0x370234[_0xc008('0x26')][_0xc008('0x4f')]);_0x478794[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x370234['query'][_0xc008('0x10')]);}return _0x34cbce[_0xc008('0xb2')](_0x478794);}})['then'](function(_0x247e3a){if(_0x247e3a){return _0x247e3a?{'count':_0x337acd,'rows':_0x247e3a}:null;}})[_0xc008('0x15')](respondWithResult(_0x3ff7d2,null))[_0xc008('0x29')](handleError(_0x3ff7d2,null));};exports[_0xc008('0xb3')]=function(_0x252c44,_0x3b46db){var _0x482efd;return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x252c44[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3b46db,null))[_0xc008('0x15')](function(_0x2f217e){if(_0x2f217e){return _0x2f217e[_0xc008('0xb3')](_0x252c44[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x252c44['body'],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0x298783){var _0xe349bd;_0x482efd=_0x298783||[];var _0x50db48=[];if(_0x298783){for(var _0x384f2f=0x0;_0x384f2f<_0x298783[_0xc008('0x4c')];_0x384f2f+=0x1){var _0x367581=_0x298783[_0x384f2f][_0xc008('0x3a')]({'plain':!![]});_0xe349bd=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xb4'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel['select']()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('id',_0xc008('0x94'))['field'](_0x367581[_0xc008('0x97')][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x252c44[_0xc008('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xc008('0x46'))['field']('NOW()',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where']('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x367581[_0xc008('0x97')][_0xc008('0x98')]())['where'](_0xc008('0x9c')))[_0xc008('0x98')]();_0x50db48['push'](db[_0xc008('0x65')]['query'](_0xe349bd));}return BPromise['all'](_0x50db48);}})[_0xc008('0x15')](function(){return _0x482efd;})[_0xc008('0x15')](respondWithResult(_0x3b46db,null))['catch'](handleError(_0x3b46db,null));};exports['removeBlackLists']=function(_0x1e3098,_0x9b997d){return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1e3098['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x9b997d,null))[_0xc008('0x15')](function(_0x1422ab){if(_0x1422ab){return _0x1422ab[_0xc008('0xb5')](_0x1e3098[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x41a8a6){if(_0x41a8a6){return db['CmHopperBlack'][_0xc008('0x1c')]({'where':{'ListId':_0x1e3098['query'][_0xc008('0x72')],'VoiceQueueId':_0x1e3098['params']['id']}})['then'](function(){return _0x41a8a6;});}})[_0xc008('0x15')](respondWithStatusCode(_0x9b997d,null))[_0xc008('0x29')](handleError(_0x9b997d,null));}; \ No newline at end of file +var _0x6aa7=['ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','fieldName','getOptions','where','include','rows','show','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','catch','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','params','omit','updatedAt','createdAt','getHoppers','findOne','filters','nolimit','order','sort','pick','VoiceQueueId','filter','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','isEmpty','removeAgents','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','toString','cm_contacts','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6aa7,0x178));var _0x76aa=function(_0x2b471b,_0x11dc42){_0x2b471b=_0x2b471b-0x0;var _0x4e0fb5=_0x6aa7[_0x2b471b];return _0x4e0fb5;};'use strict';var moment=require(_0x76aa('0x0'));var BPromise=require('bluebird');var util=require(_0x76aa('0x1'));var _=require(_0x76aa('0x2'));var squel=require(_0x76aa('0x3'));var Redis=require(_0x76aa('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x76aa('0x8')](config['redis'],{'host':_0x76aa('0x9'),'port':0x18eb});var socket=require(_0x76aa('0xa'))(new Redis(config[_0x76aa('0xb')]));require('./voiceQueue.socket')[_0x76aa('0xc')](socket);function respondWithStatusCode(_0x266bd5,_0x3a3f36){_0x3a3f36=_0x3a3f36||0xcc;return function(_0x557d69){if(_0x557d69){return _0x266bd5[_0x76aa('0xd')](_0x3a3f36);}return _0x266bd5[_0x76aa('0xe')](_0x3a3f36)[_0x76aa('0xf')]();};}function respondWithResult(_0x16cb50,_0x37f1ab){_0x37f1ab=_0x37f1ab||0xc8;return function(_0x128435){if(_0x128435){return _0x16cb50[_0x76aa('0xe')](_0x37f1ab)[_0x76aa('0x10')](_0x128435);}};}function respondWithFilteredResult(_0xd6327,_0x17a417){return function(_0x5e5f47){if(_0x5e5f47){var _0x112c39=typeof _0x17a417['offset']===_0x76aa('0x11')&&typeof _0x17a417[_0x76aa('0x12')]===_0x76aa('0x11');var _0x8e44ed=_0x5e5f47[_0x76aa('0x13')];var _0x4e309f=_0x112c39?0x0:_0x17a417['offset'];var _0x2b3b4f=_0x112c39?_0x5e5f47['count']:_0x17a417[_0x76aa('0x14')]+_0x17a417[_0x76aa('0x12')];var _0x5cf594;if(_0x2b3b4f>=_0x8e44ed){_0x2b3b4f=_0x8e44ed;_0x5cf594=0xc8;}else{_0x5cf594=0xce;}_0xd6327[_0x76aa('0xe')](_0x5cf594);return _0xd6327['set'](_0x76aa('0x15'),_0x4e309f+'-'+_0x2b3b4f+'/'+_0x8e44ed)['json'](_0x5e5f47);}return null;};}function saveUpdates(_0x1515e9){return function(_0x413cf6){if(_0x413cf6){return _0x413cf6[_0x76aa('0x16')](_0x1515e9)[_0x76aa('0x17')](function(_0xa1bc7){return _0xa1bc7;});}return null;};}function removeEntity(_0x3ead3f){return function(_0x496902){if(_0x496902){return _0x496902['destroy']()[_0x76aa('0x17')](function(){var _0x454dd3=_0x496902[_0x76aa('0x18')]({'plain':!![]});var _0x15b931=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a'),'ignore':![]},{'name':_0x76aa('0x1b'),'value':_0x76aa('0x1c'),'ignore':![]}];var _0x385157=_(_0x15b931)['filter'](_0x76aa('0x1d'))[_0x76aa('0x1e')](_0x76aa('0x1f'))['value']();if(_[_0x76aa('0x20')](_0x385157,_0x454dd3[_0x76aa('0x21')])){return;}var _0x31252f=_[_0x76aa('0x22')](_0x15b931,[_0x76aa('0x1f'),_0x454dd3[_0x76aa('0x21')]])[_0x76aa('0x23')];return db[_0x76aa('0x24')][_0x76aa('0x25')]({'where':{'type':_0x31252f,'resourceId':_0x454dd3['id']}})[_0x76aa('0x17')](function(){return _0x496902;});})[_0x76aa('0x17')](function(){_0x3ead3f[_0x76aa('0xe')](0xcc)[_0x76aa('0xf')]();});}};}function handleEntityNotFound(_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x4ef9b0[_0x76aa('0xd')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x26')](_0xa1e6[_0x76aa('0x27')]);if(_0xa1e6[_0x76aa('0x23')]){delete _0xa1e6[_0x76aa('0x23')];}_0x25c614[_0x76aa('0xe')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x28')]=function(_0x5a8030,_0x994550){var _0x365ff8={};var _0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x1e')](db[_0x76aa('0x29')][_0x76aa('0x2a')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x2b')],'type':_0x3827ec[_0x76aa('0x21')]['key']};});_0x365ff8=qs[_0x76aa('0x2c')](_0x1e90b9,_0x5a8030);var _0x5532c7={'where':_0x365ff8[_0x76aa('0x2d')]};return db[_0x76aa('0x29')][_0x76aa('0x13')](_0x5532c7)[_0x76aa('0x17')](function(_0x35a705){_0x2dec94['count']=_0x35a705;_0x365ff8[_0x76aa('0x2e')]=qs[_0x76aa('0x2e')](_0x5a8030['query']);return db[_0x76aa('0x29')]['findAll'](_0x365ff8);})[_0x76aa('0x17')](function(_0x4c90b6){_0x2dec94[_0x76aa('0x2f')]=_0x4c90b6;return _0x2dec94;})['then'](respondWithFilteredResult(_0x994550,_0x365ff8))['catch'](handleError(_0x994550,null));};exports[_0x76aa('0x30')]=function(_0x282c56,_0x198fcb){var _0x37dfab={'raw':![],'where':{'id':_0x282c56['params']['id']}},_0x595a0f={};_0x595a0f[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')][_0x76aa('0x2a')]);_0x595a0f[_0x76aa('0x33')]=_['keys'](_0x282c56[_0x76aa('0x33')]);_0x595a0f['filters']=_['intersection'](_0x595a0f[_0x76aa('0x31')],_0x595a0f[_0x76aa('0x33')]);_0x37dfab[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x595a0f['model'],qs[_0x76aa('0x36')](_0x282c56[_0x76aa('0x33')][_0x76aa('0x36')]));_0x37dfab['attributes']=_0x37dfab[_0x76aa('0x34')][_0x76aa('0x37')]?_0x37dfab[_0x76aa('0x34')]:_0x595a0f[_0x76aa('0x31')];if(_0x282c56[_0x76aa('0x33')][_0x76aa('0x38')]){_0x37dfab[_0x76aa('0x2e')]=[{'all':!![]}];}_0x37dfab=_[_0x76aa('0x39')]({},_0x37dfab,_0x282c56[_0x76aa('0x3a')]);return db['VoiceQueue'][_0x76aa('0x22')](_0x37dfab)[_0x76aa('0x17')](handleEntityNotFound(_0x198fcb,null))[_0x76aa('0x17')](respondWithResult(_0x198fcb,null))[_0x76aa('0x3b')](handleError(_0x198fcb,null));};exports[_0x76aa('0x3c')]=function(_0x2957aa,_0x572fdb){return db['VoiceQueue'][_0x76aa('0x3c')](_0x2957aa[_0x76aa('0x3d')],{})[_0x76aa('0x17')](function(_0x365612){var _0x50599f=_0x2957aa[_0x76aa('0x3e')][_0x76aa('0x18')]({'plain':!![]});if(!_0x50599f)throw new Error(_0x76aa('0x3f'));if(_0x50599f[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x4aa2f3=_0x365612[_0x76aa('0x18')]({'plain':!![]});var _0x556f59=[{'name':_0x76aa('0x19'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x144f0a=_['find'](_0x556f59,['value',_0x4aa2f3['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x144f0a,'userProfileId':_0x50599f[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0x47b0c8){if(_0x47b0c8&&_0x47b0c8[_0x76aa('0x43')]===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x4aa2f3[_0x76aa('0x23')],'resourceId':_0x4aa2f3['id'],'type':_0x47b0c8[_0x76aa('0x23')],'sectionId':_0x47b0c8['id']},{})['then'](function(){return _0x365612;});}else{return _0x365612;}})[_0x76aa('0x3b')](function(_0x1c62a9){logger['error'](_0x76aa('0x44'),_0x1c62a9);throw _0x1c62a9;});}return _0x365612;})['then'](respondWithResult(_0x572fdb,0xc9))[_0x76aa('0x3b')](handleError(_0x572fdb,null));};exports[_0x76aa('0x45')]=function(_0x31930b,_0x18fd3e){var _0x2d0bc4={'where':{'id':_0x31930b[_0x76aa('0x46')]['id']}},_0x3e0315={};_0x3e0315[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')]['rawAttributes']);_0x2d0bc4[_0x76aa('0x34')]=_['intersection'](_0x3e0315[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x31930b[_0x76aa('0x33')][_0x76aa('0x36')]));_0x2d0bc4['attributes']=_0x2d0bc4['attributes'][_0x76aa('0x37')]?_0x2d0bc4['attributes']:_0x3e0315[_0x76aa('0x31')];if(_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]){_0x2d0bc4[_0x76aa('0x2e')]=[{'all':!![]}];}_0x2d0bc4=_[_0x76aa('0x39')]({},_0x2d0bc4,_0x31930b[_0x76aa('0x3a')]);return db['VoiceQueue']['find'](_0x2d0bc4)[_0x76aa('0x17')](handleEntityNotFound(_0x18fd3e,null))[_0x76aa('0x17')](function(_0x1708d4){if(_0x1708d4){var _0x40e8ff=_0x1708d4[_0x76aa('0x18')]({'plain':!![]});_0x40e8ff=qs[_0x76aa('0x47')](_0x40e8ff,['id','createdAt',_0x76aa('0x48')]);_0x31930b[_0x76aa('0x3d')]=_[_0x76aa('0x47')](_0x31930b['body'],['id',_0x76aa('0x49'),'updatedAt']);return db[_0x76aa('0x29')]['create'](_[_0x76aa('0x39')](_0x40e8ff,_0x31930b[_0x76aa('0x3d')]),{'include':_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]?[{'all':!![]}]:undefined})[_0x76aa('0x17')](function(_0x316de3){var _0x953726=_0x31930b['user'][_0x76aa('0x18')]({'plain':!![]});if(!_0x953726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x953726[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x288151=_0x316de3[_0x76aa('0x18')]({'plain':!![]});var _0x3fa7ec=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a')},{'name':'QueueCampaigns','value':_0x76aa('0x1c')}];var _0x281f73=_[_0x76aa('0x22')](_0x3fa7ec,[_0x76aa('0x1f'),_0x288151['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x281f73,'userProfileId':_0x953726[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0xf7732){if(_0xf7732&&_0xf7732['autoAssociation']===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x288151[_0x76aa('0x23')],'resourceId':_0x288151['id'],'type':_0xf7732[_0x76aa('0x23')],'sectionId':_0xf7732['id']},{})[_0x76aa('0x17')](function(){return _0x316de3;});}else{return _0x316de3;}})[_0x76aa('0x3b')](function(_0x37babe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37babe);throw _0x37babe;});}return _0x316de3;});}})[_0x76aa('0x17')](respondWithResult(_0x18fd3e,0xc9))[_0x76aa('0x3b')](handleError(_0x18fd3e,null));};exports['update']=function(_0x3d7802,_0x1e6f3c){if(_0x3d7802['body']['id']){delete _0x3d7802[_0x76aa('0x3d')]['id'];}return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x3d7802[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1e6f3c,null))[_0x76aa('0x17')](saveUpdates(_0x3d7802[_0x76aa('0x3d')],null))[_0x76aa('0x17')](respondWithResult(_0x1e6f3c,null))[_0x76aa('0x3b')](handleError(_0x1e6f3c,null));};exports['destroy']=function(_0xd337f0,_0x49156c){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0xd337f0[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x49156c,null))[_0x76aa('0x17')](removeEntity(_0x49156c,null))[_0x76aa('0x3b')](handleError(_0x49156c,null));};exports[_0x76aa('0x4a')]=function(_0x431d1c,_0x2f1263){var _0x5eceba={'raw':![],'where':{}};var _0x267fcf={};var _0x3d4025={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x431d1c[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x2f1263,null))[_0x76aa('0x17')](function(_0x157540){if(_0x157540){_0x267fcf['model']=_[_0x76aa('0x32')](db['CmHopper'][_0x76aa('0x2a')]);_0x267fcf[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x431d1c[_0x76aa('0x33')]);_0x267fcf[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x267fcf[_0x76aa('0x31')],_0x267fcf['query']);_0x5eceba[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x267fcf['model'],qs['fields'](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x36')]));_0x5eceba['attributes']=_0x5eceba[_0x76aa('0x34')][_0x76aa('0x37')]?_0x5eceba[_0x76aa('0x34')]:_0x267fcf['model'];if(!_0x431d1c[_0x76aa('0x33')]['hasOwnProperty'](_0x76aa('0x4d'))){_0x5eceba[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x431d1c[_0x76aa('0x33')]['limit']);_0x5eceba['offset']=qs[_0x76aa('0x14')](_0x431d1c['query'][_0x76aa('0x14')]);}_0x5eceba[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x5eceba[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x431d1c[_0x76aa('0x33')],_0x267fcf['filters']));_0x5eceba[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x157540['id'];if(_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]){_0x5eceba['where']=_['merge'](_0x5eceba['where'],{'$or':_[_0x76aa('0x1e')](_0x5eceba['attributes'],function(_0xb61e5){var _0x256195={};_0x256195[_0xb61e5]={'$like':'%'+_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x256195;})});}_0x5eceba=_['merge']({},_0x5eceba,_0x431d1c[_0x76aa('0x3a')]);return db['CmHopper'][_0x76aa('0x13')]({'where':_0x5eceba[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x11d602){_0x3d4025[_0x76aa('0x13')]=_0x11d602;if(_0x431d1c['query'][_0x76aa('0x38')]){_0x5eceba[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x53')][_0x76aa('0x54')](_0x5eceba);})[_0x76aa('0x17')](function(_0x22432d){_0x3d4025[_0x76aa('0x2f')]=_0x22432d;return _0x3d4025;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x2f1263,_0x5eceba))['catch'](handleError(_0x2f1263,null));};exports[_0x76aa('0x55')]=function(_0x381f44,_0x48136a){var _0x3c1b98={'raw':!![],'where':{}};var _0x215463={};var _0x325487={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x381f44[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x48136a,null))['then'](function(_0xdb821b){if(_0xdb821b){_0x215463['model']=_['keys'](db[_0x76aa('0x56')][_0x76aa('0x2a')]);_0x215463['query']=_['keys'](_0x381f44[_0x76aa('0x33')]);_0x215463[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x215463['model'],_0x215463['query']);_0x3c1b98[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x215463[_0x76aa('0x31')],qs['fields'](_0x381f44[_0x76aa('0x33')]['fields']));_0x3c1b98[_0x76aa('0x34')]=_0x3c1b98[_0x76aa('0x34')][_0x76aa('0x37')]?_0x3c1b98[_0x76aa('0x34')]:_0x215463[_0x76aa('0x31')];if(!_0x381f44['query']['hasOwnProperty'](_0x76aa('0x4d'))){_0x3c1b98[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x381f44['query'][_0x76aa('0x12')]);_0x3c1b98[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x381f44[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x3c1b98['order']=qs[_0x76aa('0x4f')](_0x381f44['query'][_0x76aa('0x4f')]);_0x3c1b98[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x381f44[_0x76aa('0x33')],_0x215463[_0x76aa('0x4c')]));_0x3c1b98['where']['VoiceQueueId']=_0xdb821b['id'];if(_0x381f44['query']['filter']){_0x3c1b98['where']=_[_0x76aa('0x39')](_0x3c1b98[_0x76aa('0x2d')],{'$or':_['map'](_0x3c1b98['attributes'],function(_0x4f01e9){var _0x3a6326={};_0x3a6326[_0x4f01e9]={'$like':'%'+_0x381f44[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x3a6326;})});}_0x3c1b98=_['merge']({},_0x3c1b98,_0x381f44['options']);return db[_0x76aa('0x56')][_0x76aa('0x13')]({'where':_0x3c1b98[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x354c7b){_0x325487['count']=_0x354c7b;if(_0x381f44['query'][_0x76aa('0x38')]){_0x3c1b98['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c1b98);})[_0x76aa('0x17')](function(_0xbb1ccd){_0x325487['rows']=_0xbb1ccd;return _0x325487;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x48136a,_0x3c1b98))[_0x76aa('0x3b')](handleError(_0x48136a,null));};exports['getHopperFinals']=function(_0x22063f,_0x24331a){var _0x11d91f={'raw':!![],'where':{}};var _0x258e5a={};var _0x1fa86b={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x22063f[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x24331a,null))['then'](function(_0x84bc91){if(_0x84bc91){_0x258e5a[_0x76aa('0x31')]=_['keys'](db[_0x76aa('0x57')][_0x76aa('0x2a')]);_0x258e5a[_0x76aa('0x33')]=_['keys'](_0x22063f[_0x76aa('0x33')]);_0x258e5a[_0x76aa('0x4c')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],_0x258e5a[_0x76aa('0x33')]);_0x11d91f[_0x76aa('0x34')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x22063f['query']['fields']));_0x11d91f['attributes']=_0x11d91f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x11d91f[_0x76aa('0x34')]:_0x258e5a[_0x76aa('0x31')];if(!_0x22063f['query']['hasOwnProperty']('nolimit')){_0x11d91f[_0x76aa('0x12')]=qs['limit'](_0x22063f[_0x76aa('0x33')][_0x76aa('0x12')]);_0x11d91f['offset']=qs[_0x76aa('0x14')](_0x22063f[_0x76aa('0x33')]['offset']);}_0x11d91f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x22063f[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x11d91f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x22063f[_0x76aa('0x33')],_0x258e5a['filters']));_0x11d91f['where']['VoiceQueueId']=_0x84bc91['id'];if(_0x22063f['query']['filter']){_0x11d91f[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x11d91f[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x11d91f['attributes'],function(_0x447103){var _0x2192ed={};_0x2192ed[_0x447103]={'$like':'%'+_0x22063f[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2192ed;})});}_0x11d91f=_[_0x76aa('0x39')]({},_0x11d91f,_0x22063f['options']);return db[_0x76aa('0x57')][_0x76aa('0x13')]({'where':_0x11d91f[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x13be70){_0x1fa86b[_0x76aa('0x13')]=_0x13be70;if(_0x22063f[_0x76aa('0x33')]['includeAll']){_0x11d91f[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x57')]['findAll'](_0x11d91f);})['then'](function(_0x216e87){_0x1fa86b[_0x76aa('0x2f')]=_0x216e87;return _0x1fa86b;});}})['then'](respondWithFilteredResult(_0x24331a,_0x11d91f))[_0x76aa('0x3b')](handleError(_0x24331a,null));};exports['getHopperBlacks']=function(_0x28ec11,_0x5cc005){var _0x28b439={'raw':!![],'where':{}};var _0x583924={};var _0x45227e={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x28ec11['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x5cc005,null))['then'](function(_0x1af32e){if(_0x1af32e){_0x583924[_0x76aa('0x31')]=_['keys'](db['CmHopperBlack'][_0x76aa('0x2a')]);_0x583924[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x28ec11[_0x76aa('0x33')]);_0x583924['filters']=_['intersection'](_0x583924[_0x76aa('0x31')],_0x583924['query']);_0x28b439[_0x76aa('0x34')]=_['intersection'](_0x583924[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x28ec11['query'][_0x76aa('0x36')]));_0x28b439['attributes']=_0x28b439['attributes'][_0x76aa('0x37')]?_0x28b439[_0x76aa('0x34')]:_0x583924['model'];if(!_0x28ec11[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x28b439['limit']=qs[_0x76aa('0x12')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x12')]);_0x28b439[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x28b439[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x28b439[_0x76aa('0x2d')]=qs['filters'](_[_0x76aa('0x50')](_0x28ec11[_0x76aa('0x33')],_0x583924['filters']));_0x28b439[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x1af32e['id'];if(_0x28ec11['query']['filter']){_0x28b439[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x28b439['where'],{'$or':_[_0x76aa('0x1e')](_0x28b439[_0x76aa('0x34')],function(_0x24af48){var _0x5010c8={};_0x5010c8[_0x24af48]={'$like':'%'+_0x28ec11[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x5010c8;})});}_0x28b439=_['merge']({},_0x28b439,_0x28ec11[_0x76aa('0x3a')]);return db[_0x76aa('0x59')][_0x76aa('0x13')]({'where':_0x28b439[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x42543c){_0x45227e['count']=_0x42543c;if(_0x28ec11[_0x76aa('0x33')]['includeAll']){_0x28b439[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x59')][_0x76aa('0x54')](_0x28b439);})['then'](function(_0x4c5f54){_0x45227e[_0x76aa('0x2f')]=_0x4c5f54;return _0x45227e;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x5cc005,_0x28b439))[_0x76aa('0x3b')](handleError(_0x5cc005,null));};exports[_0x76aa('0x5a')]=function(_0x1a81fd,_0x1eb8f2){var _0x4f7dd4={};var _0x5a4c03={};var _0x2565a2;var _0x109bd3;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x1a81fd['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1eb8f2,null))['then'](function(_0x54d530){if(_0x54d530){_0x2565a2=_0x54d530;_0x5a4c03[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x5b')]['rawAttributes']);_0x5a4c03[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x1a81fd[_0x76aa('0x33')]);_0x5a4c03[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],_0x5a4c03[_0x76aa('0x33')]);_0x4f7dd4['attributes']=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x36')]));_0x4f7dd4[_0x76aa('0x34')]=_0x4f7dd4['attributes'][_0x76aa('0x37')]?_0x4f7dd4[_0x76aa('0x34')]:_0x5a4c03[_0x76aa('0x31')];_0x4f7dd4[_0x76aa('0x4e')]=qs['sort'](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x4f7dd4[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x1a81fd['query'],_0x5a4c03[_0x76aa('0x4c')]));if(_0x1a81fd[_0x76aa('0x33')]['filter']){_0x4f7dd4['where']=_[_0x76aa('0x39')](_0x4f7dd4[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x4f7dd4[_0x76aa('0x34')],function(_0x46f098){var _0x293221={};_0x293221[_0x46f098]={'$like':'%'+_0x1a81fd['query'][_0x76aa('0x52')]+'%'};return _0x293221;})});}_0x4f7dd4=_[_0x76aa('0x39')]({},_0x4f7dd4,_0x1a81fd[_0x76aa('0x3a')]);return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x2e7bb7){if(_0x2e7bb7){_0x109bd3=_0x2e7bb7['length'];if(!_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x4f7dd4[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x1a81fd[_0x76aa('0x33')]['limit']);_0x4f7dd4[_0x76aa('0x14')]=qs['offset'](_0x1a81fd[_0x76aa('0x33')]['offset']);}return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x56d6af){if(_0x56d6af){return _0x56d6af?{'count':_0x109bd3,'rows':_0x56d6af}:null;}})[_0x76aa('0x17')](respondWithResult(_0x1eb8f2,null))[_0x76aa('0x3b')](handleError(_0x1eb8f2,null));};exports[_0x76aa('0x5c')]=function(_0x57636c,_0x3ae5e8){var _0x46c818=_0x57636c['body'][_0x76aa('0x5d')];var _0xfe926d=_[_0x76aa('0x1e')](_0x46c818,'id');return db[_0x76aa('0x5b')][_0x76aa('0x54')]({'where':{'id':_0xfe926d},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':'Agents','attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]}]})[_0x76aa('0x17')](function(_0x28e1a4){if(_0x28e1a4){var _0x8bb516=_[_0x76aa('0x62')](_0x28e1a4,function(_0xf9f670){var _0x1359f9=_0xf9f670[_0x76aa('0x18')]({'plain':!![]});_0x1359f9['Agents'][_0x76aa('0x63')](function(_0x58cd0c){_0x58cd0c[_0x76aa('0x64')]=_[_0x76aa('0x22')](_0x46c818,{'id':_0x1359f9['id']})[_0x76aa('0x64')];});return _0x1359f9[_0x76aa('0x65')];});return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x57636c['params']['id']}})[_0x76aa('0x17')](function(_0x53090c){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x2045a2){return _0x53090c['addTeams'](_0xfe926d,{'transaction':_0x2045a2})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_0x46c818,function(_0x228968){return db[_0x76aa('0x69')][_0x76aa('0x6a')]({'TeamId':_0x228968['id'],'VoiceQueueId':_0x57636c['params']['id'],'penalty':_0x228968[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})['then'](function(){return BPromise[_0x76aa('0x68')](_0x8bb516,function(_0x1bc764){return db['UserVoiceQueue'][_0x76aa('0x6b')]({'where':{'UserId':_0x1bc764['id'],'VoiceQueueId':_0x57636c[_0x76aa('0x46')]['id']},'defaults':{'penalty':_0x1bc764[_0x76aa('0x64')]},'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_[_0x76aa('0x52')](_0x8bb516,{'online':!![]}),function(_0x245af7){return db[_0x76aa('0x6c')]['upsert']({'membername':_0x245af7[_0x76aa('0x23')],'UserId':_0x245af7['id'],'queue_name':_0x53090c[_0x76aa('0x23')],'VoiceQueueId':_0x53090c['id'],'interface':_[_0x76aa('0x6d')](_0x245af7[_0x76aa('0x61')])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x245af7[_0x76aa('0x23')]):_0x245af7[_0x76aa('0x61')],'paused':_0x245af7['voicePause']||![],'penalty':_0x245af7[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){_0x8bb516[_0x76aa('0x63')](function(_0x54e450){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':_0x54e450['id'],'VoiceQueueId':_0x53090c['id']});});});});});}})[_0x76aa('0x17')](respondWithStatusCode(_0x3ae5e8,null))[_0x76aa('0x3b')](handleError(_0x3ae5e8,null));};exports[_0x76aa('0x72')]=function(_0x5db8d8,_0x21fd43){return db['Team'][_0x76aa('0x54')]({'where':{'id':_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')]},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':_0x76aa('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21fd43,null))[_0x76aa('0x17')](function(_0x4920fa){var _0x577463=_[_0x76aa('0x1e')](_0x4920fa,'id');var _0x20ba92=[];var _0x533080=[];var _0x3cd088=squel['select']();_0x3cd088[_0x76aa('0x74')](_0x76aa('0x75'))[_0x76aa('0x76')](_0x76aa('0x77'),'tq')[_0x76aa('0x78')](_0x76aa('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x5db8d8[_0x76aa('0x46')]['id']);for(var _0x3ebe91=0x0;_0x3ebe91<_0x4920fa[_0x76aa('0x37')];_0x3ebe91+=0x1){let _0x14318c=_0x4920fa[_0x3ebe91];for(var _0xbfa5f8=0x0;_0xbfa5f8<_0x14318c[_0x76aa('0x65')][_0x76aa('0x37')];_0xbfa5f8+=0x1){let _0x46772f=_0x14318c[_0x76aa('0x65')][_0xbfa5f8];var _0x40df44=_0x3cd088[_0x76aa('0x45')]();_0x40df44[_0x76aa('0x2d')](_0x76aa('0x7b'),_0x46772f['id']);_0x533080[_0x76aa('0x7c')](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x40df44['toString'](),{'type':db[_0x76aa('0x66')]['QueryTypes'][_0x76aa('0x7d')]})[_0x76aa('0x17')](function(_0x4a093b){if(_0x4a093b[_0x76aa('0x37')]===0x1){return _0x46772f['id'];}else{var _0x5305f1=_[_0x76aa('0x7e')](_[_0x76aa('0x1e')](_0x4a093b,_0x76aa('0x7f')),function(_0x5ceae2){return _[_0x76aa('0x20')](_0x577463,_0x5ceae2);});if(_0x5305f1){return _0x46772f['id'];}}}));}}return BPromise['all'](_0x533080)['then'](function(_0x3c9841){_0x20ba92=_(_0x20ba92)['union'](_0x3c9841)[_0x76aa('0x80')]()['value']();return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5db8d8[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](function(_0x3f4ded){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x434634){return _0x3f4ded[_0x76aa('0x72')](_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')],{'transaction':_0x434634})[_0x76aa('0x17')](function(){if(!_[_0x76aa('0x81')](_0x20ba92)){return _0x3f4ded[_0x76aa('0x82')](_0x20ba92,{'transaction':_0x434634})[_0x76aa('0x17')](function(){return db['UserVoiceQueueRt'][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5db8d8[_0x76aa('0x46')]['id'],'UserId':_0x20ba92},'transaction':_0x434634});});}})[_0x76aa('0x17')](function(){_0x20ba92[_0x76aa('0x63')](function(_0x540bf3){socket[_0x76aa('0x70')]('userVoiceQueue:remove',{'UserId':_0x540bf3,'VoiceQueueId':_0x3f4ded['id']});});});});});});})[_0x76aa('0x17')](respondWithStatusCode(_0x21fd43,null))['catch'](handleError(_0x21fd43,null));};exports[_0x76aa('0x83')]=function(_0x5427f0,_0x3e9153){var _0x490090,_0x31b7a8;return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5427f0[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e9153,null))[_0x76aa('0x17')](function(_0x51feca){if(_0x51feca){_0x31b7a8=_0x51feca;return _0x51feca[_0x76aa('0x83')](_0x5427f0['body'][_0x76aa('0x73')],_['omit'](_0x5427f0['body'],[_0x76aa('0x73'),'id'])||{})[_0x76aa('0x84')](function(_0x38b6aa){for(var _0x395501=0x0;_0x395501<_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')][_0x76aa('0x37')];_0x395501+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':Number(_0x5427f0[_0x76aa('0x3d')]['ids'][_0x395501]),'VoiceQueueId':Number(_0x5427f0[_0x76aa('0x46')]['id'])});}return _0x38b6aa;});}})[_0x76aa('0x17')](function(_0x3d969f){_0x490090=_0x3d969f||[];if(_0x31b7a8){return db[_0x76aa('0x5e')][_0x76aa('0x54')]({'where':{'id':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')]},'attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]});}})[_0x76aa('0x17')](function(_0x3274a9){if(!_[_0x76aa('0x81')](_0x3274a9)){var _0x5c0268=[];for(var _0x5c5a6f=0x0;_0x5c5a6f<_0x3274a9[_0x76aa('0x37')];_0x5c5a6f++){if(_0x3274a9[_0x5c5a6f][_0x76aa('0x5f')]){_0x5c0268[_0x76aa('0x7c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3274a9[_0x5c5a6f][_0x76aa('0x23')],'UserId':_0x3274a9[_0x5c5a6f]['id'],'queue_name':_0x31b7a8[_0x76aa('0x23')],'VoiceQueueId':_0x31b7a8['id'],'interface':_[_0x76aa('0x6d')](_0x3274a9[_0x5c5a6f]['interface'])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x3274a9[_0x5c5a6f]['name']):_0x3274a9[_0x5c5a6f]['interface'],'paused':_0x3274a9[_0x5c5a6f]['voicePause']||![],'penalty':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x64')]||0x0}));}}return BPromise[_0x76aa('0x85')](_0x5c0268);}})['then'](function(){return _0x490090;})[_0x76aa('0x17')](respondWithResult(_0x3e9153,null))[_0x76aa('0x3b')](handleError(_0x3e9153,null));};exports['removeAgents']=function(_0x5433dc,_0x328d1a){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x5433dc['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x328d1a,null))[_0x76aa('0x17')](function(_0x546770){if(_0x546770){return _0x546770[_0x76aa('0x82')](_0x5433dc[_0x76aa('0x33')]['ids'])[_0x76aa('0x17')](function(){if(_[_0x76aa('0x86')](_0x5433dc['query'][_0x76aa('0x73')])){for(var _0x4df504=0x0;_0x4df504<_0x5433dc['query'][_0x76aa('0x73')][_0x76aa('0x37')];_0x4df504+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')][_0x76aa('0x73')][_0x4df504]),'VoiceQueueId':Number(_0x5433dc[_0x76aa('0x46')]['id'])});}}else{socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')]['ids']),'VoiceQueueId':Number(_0x5433dc['params']['id'])});}});}})[_0x76aa('0x17')](function(_0x2726da){return db[_0x76aa('0x6c')][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5433dc[_0x76aa('0x46')]['id'],'UserId':_0x5433dc[_0x76aa('0x33')]['ids']}})[_0x76aa('0x17')](function(){return _0x2726da;});})[_0x76aa('0x17')](respondWithStatusCode(_0x328d1a,null))[_0x76aa('0x3b')](handleError(_0x328d1a,null));};exports[_0x76aa('0x88')]=function(_0x38694d,_0xf0b932){var _0x1c8cf5={};var _0x5a8d0f={};var _0x5f513d;var _0x54e70c;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x38694d[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0xf0b932,null))[_0x76aa('0x17')](function(_0x4afe13){if(_0x4afe13){_0x5f513d=_0x4afe13;_0x5a8d0f['model']=_[_0x76aa('0x32')](db[_0x76aa('0x5e')][_0x76aa('0x2a')]);_0x5a8d0f[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x38694d['query']);_0x5a8d0f[_0x76aa('0x4c')]=_['intersection'](_0x5a8d0f[_0x76aa('0x31')],_0x5a8d0f['query']);_0x1c8cf5['attributes']=_[_0x76aa('0x35')](_0x5a8d0f['model'],qs[_0x76aa('0x36')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x36')]));_0x1c8cf5[_0x76aa('0x34')]=_0x1c8cf5[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1c8cf5[_0x76aa('0x34')]:_0x5a8d0f[_0x76aa('0x31')];_0x1c8cf5['order']=qs[_0x76aa('0x4f')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1c8cf5[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x38694d[_0x76aa('0x33')],_0x5a8d0f['filters']));if(_0x38694d[_0x76aa('0x33')]['filter']){_0x1c8cf5[_0x76aa('0x2d')]=_['merge'](_0x1c8cf5[_0x76aa('0x2d')],{'$or':_['map'](_0x1c8cf5[_0x76aa('0x34')],function(_0x8b2ee1){var _0x279be2={};_0x279be2[_0x8b2ee1]={'$like':'%'+_0x38694d['query']['filter']+'%'};return _0x279be2;})});}_0x1c8cf5=_[_0x76aa('0x39')]({},_0x1c8cf5,_0x38694d['options']);return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x1b99d8){if(_0x1b99d8){_0x54e70c=_0x1b99d8['length'];if(!_0x38694d['query']['hasOwnProperty']('nolimit')){_0x1c8cf5[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1c8cf5[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x2484fd){if(_0x2484fd){return _0x2484fd?{'count':_0x54e70c,'rows':_0x2484fd}:null;}})[_0x76aa('0x17')](respondWithResult(_0xf0b932,null))[_0x76aa('0x3b')](handleError(_0xf0b932,null));};exports['getMembers']=function(_0x2b12e9,_0x4e697b){var _0x1e902d={};var _0x3a7658={};var _0x1b1f85;var _0x3fb275;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x2b12e9[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x4e697b,null))[_0x76aa('0x17')](function(_0x1bdc5c){if(_0x1bdc5c){_0x1b1f85=_0x1bdc5c;_0x3a7658[_0x76aa('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x76aa('0x2a')]);_0x3a7658[_0x76aa('0x33')]=_['keys'](_0x2b12e9[_0x76aa('0x33')]);_0x3a7658[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x3a7658[_0x76aa('0x31')],_0x3a7658[_0x76aa('0x33')]);_0x1e902d[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x3a7658['model'],qs[_0x76aa('0x36')](_0x2b12e9[_0x76aa('0x33')]['fields']));_0x1e902d['attributes']=_0x1e902d[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1e902d[_0x76aa('0x34')]:_0x3a7658[_0x76aa('0x31')];_0x1e902d[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1e902d[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x2b12e9[_0x76aa('0x33')],_0x3a7658[_0x76aa('0x4c')]));if(_0x2b12e9['query']['filter']){_0x1e902d[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x1e902d[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x1e902d['attributes'],function(_0x5f3819){var _0x2a8410={};_0x2a8410[_0x5f3819]={'$like':'%'+_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2a8410;})});}_0x1e902d=_['merge']({},_0x1e902d,_0x2b12e9['options']);return _0x1b1f85['getMembers'](_0x1e902d);}})[_0x76aa('0x17')](function(_0x4df872){if(_0x4df872){_0x3fb275=_0x4df872[_0x76aa('0x37')];if(!_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x1e902d[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1e902d[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x1b1f85[_0x76aa('0x89')](_0x1e902d);}})[_0x76aa('0x17')](function(_0x3b1f33){return _0x3b1f33?{'count':_0x3fb275,'rows':_0x3b1f33}:null;})[_0x76aa('0x17')](respondWithResult(_0x4e697b,null))['catch'](handleError(_0x4e697b,null));};exports[_0x76aa('0x8a')]=function(_0x5e8cec,_0x1a37e9){var _0x58932f={};var _0x17bd1a={};var _0x5d7a2b;var _0x363c45;return db['VoiceQueue']['findOne']({'where':{'id':_0x5e8cec[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1a37e9,null))[_0x76aa('0x17')](function(_0x44668d){if(_0x44668d){_0x5d7a2b=_0x44668d;_0x17bd1a[_0x76aa('0x31')]=_[_0x76aa('0x32')](db['CmList'][_0x76aa('0x2a')]);_0x17bd1a[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x5e8cec[_0x76aa('0x33')]);_0x17bd1a['filters']=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],_0x17bd1a[_0x76aa('0x33')]);_0x58932f[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x36')]));_0x58932f[_0x76aa('0x34')]=_0x58932f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x58932f['attributes']:_0x17bd1a['model'];_0x58932f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x58932f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x5e8cec[_0x76aa('0x33')],_0x17bd1a[_0x76aa('0x4c')]));if(_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x52')]){_0x58932f['where']=_[_0x76aa('0x39')](_0x58932f['where'],{'$or':_[_0x76aa('0x1e')](_0x58932f[_0x76aa('0x34')],function(_0x278bac){var _0x14256c={};_0x14256c[_0x278bac]={'$like':'%'+_0x5e8cec[_0x76aa('0x33')]['filter']+'%'};return _0x14256c;})});}_0x58932f=_['merge']({},_0x58932f,_0x5e8cec[_0x76aa('0x3a')]);return _0x5d7a2b['getLists'](_0x58932f);}})[_0x76aa('0x17')](function(_0xb760ca){if(_0xb760ca){_0x363c45=_0xb760ca[_0x76aa('0x37')];if(!_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x58')]('nolimit')){_0x58932f['limit']=qs[_0x76aa('0x12')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x12')]);_0x58932f[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5d7a2b[_0x76aa('0x8a')](_0x58932f);}})[_0x76aa('0x17')](function(_0x33644d){if(_0x33644d){return _0x33644d?{'count':_0x363c45,'rows':_0x33644d}:null;}})['then'](respondWithResult(_0x1a37e9,null))[_0x76aa('0x3b')](handleError(_0x1a37e9,null));};exports[_0x76aa('0x8b')]=function(_0x4830ea,_0x20638f){var _0x2b2f27=moment()[_0x76aa('0x6e')](_0x76aa('0x8c'));var _0x1a5297,_0x487c28;return db[_0x76aa('0x29')]['find']({'where':{'id':_0x4830ea[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x20638f,null))[_0x76aa('0x17')](function(_0x2f2a27){if(_0x2f2a27){_0x487c28=_0x2f2a27;return _0x2f2a27['addLists'](_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x4830ea[_0x76aa('0x3d')],[_0x76aa('0x73'),'id'])||{});}return null;})[_0x76aa('0x84')](function(_0xca12fa){var _0xb0a4e1;_0x1a5297=_0xca12fa||[];var _0x1f7f1d=[];if(_0xca12fa){for(var _0x413528=0x0;_0x413528<_0xca12fa[_0x76aa('0x37')];_0x413528+=0x1){var _0x39de41=_0xca12fa[_0x413528][_0x76aa('0x18')]({'plain':!![]});_0x487c28[_0x76aa('0x8d')]=_0x4830ea['body']['dialCheckDuplicateType']?_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x8d')]:_0x487c28['dialCheckDuplicateType'];switch(_0x487c28[_0x76aa('0x8d')]){case'always':_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),'VoiceQueueId',_0x76aa('0x49'),_0x76aa('0x48')],squel['select']()['field'](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id','ContactId')[_0x76aa('0x74')](_0x39de41['CmListId'][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x76aa('0x74')](_0x76aa('0x98'))['from'](_0x76aa('0x99'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']()))['where'](_0x76aa('0x9a'),squel['select']()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')]('VoiceQueueId\x20=\x20?',_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')]())))[_0x76aa('0x96')]();break;case _0x76aa('0x9c'):_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')](['phone',_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))['field'](_0x39de41['CmListId']['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea['params']['id'][_0x76aa('0x96')](),'VoiceQueueId')['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0'))[_0x76aa('0x2d')](_0x76aa('0x9a'),squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']())))[_0x76aa('0x96')]();break;default:_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')]('cm_hopper')[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))['field']('id',_0x76aa('0x94'))['field'](_0x39de41[_0x76aa('0x9f')]['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id']['toString'](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')]('cm_contacts')['where'](_0x76aa('0xa1'))[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')](_0x76aa('0xa0')))[_0x76aa('0x96')]();}_0x1f7f1d['push'](db['sequelize'][_0x76aa('0x33')](_0xb0a4e1));}return BPromise[_0x76aa('0x85')](_0x1f7f1d);}})[_0x76aa('0x17')](function(){var _0xbb19e4=[];var _0x226b44=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xa2'))['fromQuery']([_0x76aa('0xa3'),_0x76aa('0x92'),_0x76aa('0xa4'),'createdAt',_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')]('h.id')['field'](_0x76aa('0xa5'))['field'](_0x76aa('0xa6'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')['from'](_0x76aa('0xa7'),'ci')[_0x76aa('0x78')](_0x76aa('0x90'),'h',_0x76aa('0xa8'))[_0x76aa('0x2d')](_0x76aa('0xa9'),_0x2b2f27)['where'](_0x76aa('0xaa'),_0x76aa('0xab')))[_0x76aa('0x96')]();_0xbb19e4['push'](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x226b44));return BPromise[_0x76aa('0x85')](_0xbb19e4);})['then'](function(){return _0x1a5297;})[_0x76aa('0x17')](respondWithResult(_0x20638f,null))['catch'](handleError(_0x20638f,null));};exports['removeLists']=function(_0xef9ea7,_0x45f21f){return db[_0x76aa('0x29')]['find']({'where':{'id':_0xef9ea7[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f21f,null))[_0x76aa('0x17')](function(_0x113e70){if(_0x113e70){return _0x113e70['removeLists'](_0xef9ea7[_0x76aa('0x33')]['ids']);}})['then'](function(_0x583d68){if(_0x583d68){return db[_0x76aa('0x53')]['destroy']({'where':{'ListId':_0xef9ea7[_0x76aa('0x33')]['ids'],'VoiceQueueId':_0xef9ea7['params']['id']}})[_0x76aa('0x17')](function(){return _0x583d68;});}})['then'](respondWithStatusCode(_0x45f21f,null))['catch'](handleError(_0x45f21f,null));};exports[_0x76aa('0xac')]=function(_0x3b7370,_0x1c3431){var _0x865a1b={};var _0x132d60={};var _0x1a3074;var _0x3184a2;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b7370[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1c3431,null))[_0x76aa('0x17')](function(_0x274356){if(_0x274356){_0x1a3074=_0x274356;_0x132d60[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0xad')][_0x76aa('0x2a')]);_0x132d60[_0x76aa('0x33')]=_['keys'](_0x3b7370['query']);_0x132d60[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x132d60[_0x76aa('0x31')],_0x132d60[_0x76aa('0x33')]);_0x865a1b['attributes']=_['intersection'](_0x132d60[_0x76aa('0x31')],qs['fields'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x36')]));_0x865a1b['attributes']=_0x865a1b[_0x76aa('0x34')][_0x76aa('0x37')]?_0x865a1b[_0x76aa('0x34')]:_0x132d60[_0x76aa('0x31')];_0x865a1b[_0x76aa('0x4e')]=qs['sort'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x865a1b['where']=qs['filters'](_[_0x76aa('0x50')](_0x3b7370[_0x76aa('0x33')],_0x132d60[_0x76aa('0x4c')]));if(_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]){_0x865a1b[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x865a1b[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x865a1b[_0x76aa('0x34')],function(_0xbb0ea3){var _0x4978dd={};_0x4978dd[_0xbb0ea3]={'$like':'%'+_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x4978dd;})});}_0x865a1b=_[_0x76aa('0x39')]({},_0x865a1b,_0x3b7370[_0x76aa('0x3a')]);return _0x1a3074['getBlackLists'](_0x865a1b);}})['then'](function(_0x4ee1d3){if(_0x4ee1d3){_0x3184a2=_0x4ee1d3['length'];if(!_0x3b7370[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x865a1b[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x12')]);_0x865a1b['offset']=qs['offset'](_0x3b7370[_0x76aa('0x33')]['offset']);}return _0x1a3074[_0x76aa('0xac')](_0x865a1b);}})[_0x76aa('0x17')](function(_0x3bc149){if(_0x3bc149){return _0x3bc149?{'count':_0x3184a2,'rows':_0x3bc149}:null;}})['then'](respondWithResult(_0x1c3431,null))[_0x76aa('0x3b')](handleError(_0x1c3431,null));};exports[_0x76aa('0xae')]=function(_0x29e112,_0x3fd683){var _0x5c2c4d;return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x29e112[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd683,null))[_0x76aa('0x17')](function(_0xcb041d){if(_0xcb041d){return _0xcb041d[_0x76aa('0xae')](_0x29e112[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x29e112[_0x76aa('0x3d')],['ids','id'])||{});}return null;})['spread'](function(_0x72b9a){var _0x29db0f;_0x5c2c4d=_0x72b9a||[];var _0x28a212=[];if(_0x72b9a){for(var _0x242cd6=0x0;_0x242cd6<_0x72b9a[_0x76aa('0x37')];_0x242cd6+=0x1){var _0xeb428a=_0x72b9a[_0x242cd6][_0x76aa('0x18')]({'plain':!![]});_0x29db0f=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xaf'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))[_0x76aa('0x74')](_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x29e112['params']['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')](_0x76aa('0xb0'),'createdAt')[_0x76aa('0x74')](_0x76aa('0xb0'),_0x76aa('0x48'))['from'](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0')))['toString']();_0x28a212[_0x76aa('0x7c')](db['sequelize'][_0x76aa('0x33')](_0x29db0f));}return BPromise['all'](_0x28a212);}})[_0x76aa('0x17')](function(){return _0x5c2c4d;})['then'](respondWithResult(_0x3fd683,null))[_0x76aa('0x3b')](handleError(_0x3fd683,null));};exports[_0x76aa('0xb1')]=function(_0x140ee1,_0x3d9e9e){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x140ee1['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x3d9e9e,null))[_0x76aa('0x17')](function(_0x139e67){if(_0x139e67){return _0x139e67[_0x76aa('0xb1')](_0x140ee1['query'][_0x76aa('0x73')]);}})[_0x76aa('0x17')](function(_0x506cad){if(_0x506cad){return db['CmHopperBlack'][_0x76aa('0x25')]({'where':{'ListId':_0x140ee1[_0x76aa('0x33')][_0x76aa('0x73')],'VoiceQueueId':_0x140ee1[_0x76aa('0x46')]['id']}})['then'](function(){return _0x506cad;});}})['then'](respondWithStatusCode(_0x3d9e9e,null))[_0x76aa('0x3b')](handleError(_0x3d9e9e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 22241c5..fe9ab35 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 _0x5eb0=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x655d61,_0x4c5687){var _0x589c9e=function(_0x5c34cc){while(--_0x5c34cc){_0x655d61['push'](_0x655d61['shift']());}};_0x589c9e(++_0x4c5687);}(_0x5eb0,0x7a));var _0x05eb=function(_0x402cff,_0x550758){_0x402cff=_0x402cff-0x0;var _0x102501=_0x5eb0[_0x402cff];return _0x102501;};'use strict';var EventEmitter=require(_0x05eb('0x0'));var VoiceQueue=require(_0x05eb('0x1'))['db'][_0x05eb('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x05eb('0x3')](0x0);var events={'afterCreate':_0x05eb('0x4'),'afterUpdate':_0x05eb('0x5'),'afterDestroy':_0x05eb('0x6')};function emitEvent(_0x52c86a){return function(_0x24ec64,_0x27669f,_0x69b691){VoiceQueueEvents[_0x05eb('0x7')](_0x52c86a+':'+_0x24ec64['id'],_0x24ec64);VoiceQueueEvents[_0x05eb('0x7')](_0x52c86a,_0x24ec64);_0x69b691(null);};}for(var e in events){if(events[_0x05eb('0x8')](e)){var event=events[e];VoiceQueue[_0x05eb('0x9')](e,emitEvent(event));}}module[_0x05eb('0xa')]=VoiceQueueEvents; \ No newline at end of file +var _0x9f14=['remove','emit','events','save','update'];(function(_0x2e36cc,_0x4d3678){var _0x4a39a=function(_0x2c2eeb){while(--_0x2c2eeb){_0x2e36cc['push'](_0x2e36cc['shift']());}};_0x4a39a(++_0x4d3678);}(_0x9f14,0x156));var _0x49f1=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9f14[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x49f1('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x49f1('0x1'),'afterUpdate':_0x49f1('0x2'),'afterDestroy':_0x49f1('0x3')};function emitEvent(_0xdfcd0e){return function(_0x58a7ad,_0x36dc78,_0x3f3e7f){VoiceQueueEvents['emit'](_0xdfcd0e+':'+_0x58a7ad['id'],_0x58a7ad);VoiceQueueEvents[_0x49f1('0x4')](_0xdfcd0e,_0x58a7ad);_0x3f3e7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index a647015..9b0607f 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x389c80,_0x5977d5){var _0x3f643e=function(_0x56dcf6){while(--_0x56dcf6){_0x389c80['push'](_0x389c80['shift']());}};_0x3f643e(++_0x5977d5);}(_0x70e0,0x17b));var _0x070e=function(_0x103c1a,_0x572c1a){_0x103c1a=_0x103c1a-0x0;var _0x4aaf95=_0x70e0[_0x103c1a];return _0x4aaf95;};'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 +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x1aee7f,_0x178cc1){var _0x1659e1=function(_0x5b8d70){while(--_0x5b8d70){_0x1aee7f['push'](_0x1aee7f['shift']());}};_0x1659e1(++_0x178cc1);}(_0x34e8,0x12c));var _0x834e=function(_0x2aa6e4,_0x119958){_0x2aa6e4=_0x2aa6e4-0x0;var _0x2ff6d2=_0x34e8[_0x2aa6e4];return _0x2ff6d2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index f481fc0..8645638 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 _0xfa5b=['then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','VoiceQueue','options','raw','attributes','limit','include','map','model','GetVoiceQueue','debug','stringify','ShowVoiceQueue','where','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','register','request'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xfa5b,0x136));var _0xbfa5=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xfa5b[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbfa5('0x0'));var BPromise=require('bluebird');var rs=require(_0xbfa5('0x1'));var fs=require('fs');var Redis=require(_0xbfa5('0x2'));var db=require(_0xbfa5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfa5('0x4'))(_0xbfa5('0x5'));var config=require('../../config/environment');var jayson=require(_0xbfa5('0x6'));var client=jayson[_0xbfa5('0x7')][_0xbfa5('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbfa5('0x9')],{'host':_0xbfa5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbfa5('0xb'))[_0xbfa5('0xc')](socket);function respondWithRpcPromise(_0x2047e1,_0x254e10,_0x3f91ca){return new BPromise(function(_0x5c59fb,_0x27226e){return client[_0xbfa5('0xd')](_0x2047e1,_0x3f91ca)[_0xbfa5('0xe')](function(_0x285314){logger[_0xbfa5('0xf')](_0xbfa5('0x10'),_0x254e10,'request\x20sent');logger['debug'](_0xbfa5('0x11'),_0x254e10,_0xbfa5('0x12'),JSON['stringify'](_0x285314));if(_0x285314['error']){if(_0x285314[_0xbfa5('0x13')][_0xbfa5('0x14')]===0x1f4){logger[_0xbfa5('0x13')](_0xbfa5('0x10'),_0x254e10,_0x285314[_0xbfa5('0x13')][_0xbfa5('0x15')]);return _0x27226e(_0x285314[_0xbfa5('0x13')][_0xbfa5('0x15')]);}logger[_0xbfa5('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x254e10,_0x285314['error'][_0xbfa5('0x15')]);return _0x5c59fb(_0x285314[_0xbfa5('0x13')][_0xbfa5('0x15')]);}else{logger[_0xbfa5('0xf')](_0xbfa5('0x10'),_0x254e10,_0xbfa5('0x12'));_0x5c59fb(_0x285314['result'][_0xbfa5('0x15')]);}})[_0xbfa5('0x16')](function(_0x316383){logger[_0xbfa5('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x254e10,_0x316383);_0x27226e(_0x316383);});});}exports['GetVoiceQueue']=function(_0x42a91a){var _0x22cb84=this;return new Promise(function(_0x31f648,_0x52090a){return db[_0xbfa5('0x17')]['findAll']({'raw':_0x42a91a['options']?_0x42a91a[_0xbfa5('0x18')][_0xbfa5('0x19')]===undefined?!![]:![]:!![],'where':_0x42a91a[_0xbfa5('0x18')]?_0x42a91a['options']['where']||null:null,'attributes':_0x42a91a['options']?_0x42a91a['options'][_0xbfa5('0x1a')]||null:null,'limit':_0x42a91a['options']?_0x42a91a[_0xbfa5('0x18')][_0xbfa5('0x1b')]||null:null,'include':_0x42a91a['options']?_0x42a91a['options'][_0xbfa5('0x1c')]?_[_0xbfa5('0x1d')](_0x42a91a['options'][_0xbfa5('0x1c')],function(_0x494e09){return{'model':db[_0x494e09[_0xbfa5('0x1e')]],'as':_0x494e09['as'],'attributes':_0x494e09['attributes'],'include':_0x494e09[_0xbfa5('0x1c')]?_[_0xbfa5('0x1d')](_0x494e09[_0xbfa5('0x1c')],function(_0x480840){return{'model':db[_0x480840[_0xbfa5('0x1e')]],'as':_0x480840['as'],'attributes':_0x480840['attributes'],'include':_0x480840[_0xbfa5('0x1c')]?_['map'](_0x480840['include'],function(_0x3a01fd){return{'model':db[_0x3a01fd[_0xbfa5('0x1e')]],'as':_0x3a01fd['as'],'attributes':_0x3a01fd[_0xbfa5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbfa5('0xe')](function(_0x24602d){logger['info'](_0xbfa5('0x1f'),_0x42a91a);logger[_0xbfa5('0x20')](_0xbfa5('0x1f'),_0x42a91a,JSON[_0xbfa5('0x21')](_0x24602d));_0x31f648(_0x24602d);})[_0xbfa5('0x16')](function(_0x3ed105){logger[_0xbfa5('0x13')](_0xbfa5('0x1f'),_0x3ed105['message'],_0x42a91a);_0x52090a(_0x22cb84[_0xbfa5('0x13')](0x1f4,_0x3ed105[_0xbfa5('0x15')]));});});};exports[_0xbfa5('0x22')]=function(_0x23ce51){var _0x33f7d6=this;return new Promise(function(_0x29b753,_0x1f4da9){return db[_0xbfa5('0x17')]['find']({'raw':_0x23ce51['options']?_0x23ce51[_0xbfa5('0x18')][_0xbfa5('0x19')]===undefined?!![]:![]:!![],'where':_0x23ce51[_0xbfa5('0x18')]?_0x23ce51[_0xbfa5('0x18')][_0xbfa5('0x23')]||null:null,'attributes':_0x23ce51[_0xbfa5('0x18')]?_0x23ce51[_0xbfa5('0x18')][_0xbfa5('0x1a')]||null:null,'include':_0x23ce51[_0xbfa5('0x18')]?_0x23ce51['options'][_0xbfa5('0x1c')]?_[_0xbfa5('0x1d')](_0x23ce51[_0xbfa5('0x18')][_0xbfa5('0x1c')],function(_0x286fc6){return{'model':db[_0x286fc6[_0xbfa5('0x1e')]],'as':_0x286fc6['as'],'attributes':_0x286fc6[_0xbfa5('0x1a')],'include':_0x286fc6[_0xbfa5('0x1c')]?_[_0xbfa5('0x1d')](_0x286fc6[_0xbfa5('0x1c')],function(_0x5e19ad){return{'model':db[_0x5e19ad[_0xbfa5('0x1e')]],'as':_0x5e19ad['as'],'attributes':_0x5e19ad[_0xbfa5('0x1a')],'include':_0x5e19ad[_0xbfa5('0x1c')]?_[_0xbfa5('0x1d')](_0x5e19ad[_0xbfa5('0x1c')],function(_0x3e2f2b){return{'model':db[_0x3e2f2b['model']],'as':_0x3e2f2b['as'],'attributes':_0x3e2f2b[_0xbfa5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbfa5('0xe')](function(_0x415f19){logger['info'](_0xbfa5('0x22'),_0x23ce51);logger[_0xbfa5('0x20')](_0xbfa5('0x22'),_0x23ce51,JSON['stringify'](_0x415f19));_0x29b753(_0x415f19);})[_0xbfa5('0x16')](function(_0xc68388){logger[_0xbfa5('0x13')](_0xbfa5('0x22'),_0xc68388[_0xbfa5('0x15')],_0x23ce51);_0x1f4da9(_0x33f7d6[_0xbfa5('0x13')](0x1f4,_0xc68388[_0xbfa5('0x15')]));});});}; \ No newline at end of file +var _0xb1ce=['../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3ef39e,_0x496609){var _0x57ad2a=function(_0x413d2b){while(--_0x413d2b){_0x3ef39e['push'](_0x3ef39e['shift']());}};_0x57ad2a(++_0x496609);}(_0xb1ce,0x150));var _0xeb1c=function(_0xe9fca1,_0x5ba251){_0xe9fca1=_0xe9fca1-0x0;var _0x55ae32=_0xb1ce[_0xe9fca1];return _0x55ae32;};'use strict';var _=require(_0xeb1c('0x0'));var util=require(_0xeb1c('0x1'));var moment=require(_0xeb1c('0x2'));var BPromise=require(_0xeb1c('0x3'));var rs=require(_0xeb1c('0x4'));var fs=require('fs');var Redis=require(_0xeb1c('0x5'));var db=require(_0xeb1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb1c('0x7'))(_0xeb1c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeb1c('0x9')][_0xeb1c('0xa')]({'port':0x232a});config[_0xeb1c('0xb')]=_[_0xeb1c('0xc')](config['redis'],{'host':_0xeb1c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb1c('0xb')]));require('./voiceQueue.socket')[_0xeb1c('0xe')](socket);function respondWithRpcPromise(_0xc6213f,_0x1bf9db,_0xb7812f){return new BPromise(function(_0xb0ed0d,_0x33040f){return client[_0xeb1c('0xf')](_0xc6213f,_0xb7812f)[_0xeb1c('0x10')](function(_0x302585){logger[_0xeb1c('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0xeb1c('0x12'));logger[_0xeb1c('0x13')](_0xeb1c('0x14'),_0x1bf9db,_0xeb1c('0x12'),JSON[_0xeb1c('0x15')](_0x302585));if(_0x302585[_0xeb1c('0x16')]){if(_0x302585['error']['code']===0x1f4){logger[_0xeb1c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);return _0x33040f(_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);}logger[_0xeb1c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);return _0xb0ed0d(_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);}else{logger[_0xeb1c('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0xeb1c('0x12'));_0xb0ed0d(_0x302585['result']['message']);}})[_0xeb1c('0x18')](function(_0x592bfc){logger[_0xeb1c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0x592bfc);_0x33040f(_0x592bfc);});});}exports[_0xeb1c('0x19')]=function(_0xb46b83){var _0x1c5492=this;return new Promise(function(_0x4e92b8,_0x2f0173){return db['VoiceQueue'][_0xeb1c('0x1a')]({'raw':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x1c')]===undefined?!![]:![]:!![],'where':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x1d')]||null:null,'attributes':_0xb46b83['options']?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x1e')]||null:null,'limit':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83['options'][_0xeb1c('0x1f')]||null:null,'include':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0xb46b83[_0xeb1c('0x1b')]['include'],function(_0x4d7937){return{'model':db[_0x4d7937[_0xeb1c('0x22')]],'as':_0x4d7937['as'],'attributes':_0x4d7937[_0xeb1c('0x1e')],'include':_0x4d7937[_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x4d7937['include'],function(_0x590b6){return{'model':db[_0x590b6['model']],'as':_0x590b6['as'],'attributes':_0x590b6['attributes'],'include':_0x590b6['include']?_[_0xeb1c('0x21')](_0x590b6[_0xeb1c('0x20')],function(_0xa0514e){return{'model':db[_0xa0514e['model']],'as':_0xa0514e['as'],'attributes':_0xa0514e['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb1c('0x10')](function(_0x16795f){logger[_0xeb1c('0x11')](_0xeb1c('0x19'),_0xb46b83);logger[_0xeb1c('0x13')]('GetVoiceQueue',_0xb46b83,JSON['stringify'](_0x16795f));_0x4e92b8(_0x16795f);})[_0xeb1c('0x18')](function(_0x1b09bd){logger[_0xeb1c('0x16')](_0xeb1c('0x19'),_0x1b09bd[_0xeb1c('0x17')],_0xb46b83);_0x2f0173(_0x1c5492[_0xeb1c('0x16')](0x1f4,_0x1b09bd[_0xeb1c('0x17')]));});});};exports[_0xeb1c('0x23')]=function(_0x4ce487){var _0xcf00a6=this;return new Promise(function(_0x360179,_0x1002c7){return db[_0xeb1c('0x24')][_0xeb1c('0x25')]({'raw':_0x4ce487['options']?_0x4ce487[_0xeb1c('0x1b')][_0xeb1c('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ce487[_0xeb1c('0x1b')]?_0x4ce487[_0xeb1c('0x1b')][_0xeb1c('0x1d')]||null:null,'attributes':_0x4ce487[_0xeb1c('0x1b')]?_0x4ce487[_0xeb1c('0x1b')]['attributes']||null:null,'include':_0x4ce487[_0xeb1c('0x1b')]?_0x4ce487['options'][_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x4ce487['options'][_0xeb1c('0x20')],function(_0x477957){return{'model':db[_0x477957[_0xeb1c('0x22')]],'as':_0x477957['as'],'attributes':_0x477957[_0xeb1c('0x1e')],'include':_0x477957[_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x477957['include'],function(_0x35b131){return{'model':db[_0x35b131[_0xeb1c('0x22')]],'as':_0x35b131['as'],'attributes':_0x35b131[_0xeb1c('0x1e')],'include':_0x35b131[_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x35b131[_0xeb1c('0x20')],function(_0x235187){return{'model':db[_0x235187['model']],'as':_0x235187['as'],'attributes':_0x235187[_0xeb1c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcd5e77){logger[_0xeb1c('0x11')](_0xeb1c('0x23'),_0x4ce487);logger[_0xeb1c('0x13')](_0xeb1c('0x23'),_0x4ce487,JSON['stringify'](_0xcd5e77));_0x360179(_0xcd5e77);})[_0xeb1c('0x18')](function(_0x212439){logger[_0xeb1c('0x16')]('ShowVoiceQueue',_0x212439[_0xeb1c('0x17')],_0x4ce487);_0x1002c7(_0xcf00a6[_0xeb1c('0x16')](0x1f4,_0x212439[_0xeb1c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index ccb0b06..dd42ea9 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 _0x5409=['update','removeListener','register','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x1338a5,_0x20ebc2){var _0x1cf1b2=function(_0x3df925){while(--_0x3df925){_0x1338a5['push'](_0x1338a5['shift']());}};_0x1cf1b2(++_0x20ebc2);}(_0x5409,0x131));var _0x9540=function(_0x36daba,_0x5aa80d){_0x36daba=_0x36daba-0x0;var _0x82ea15=_0x5409[_0x36daba];return _0x82ea15;};'use strict';var VoiceQueueEvents=require(_0x9540('0x0'));var events=[_0x9540('0x1'),_0x9540('0x2'),_0x9540('0x3')];function createListener(_0x499914,_0x5b35e0){return function(_0x3ba4b1){_0x5b35e0['emit'](_0x499914,_0x3ba4b1);};}function removeListener(_0x46fb54,_0xc6f232){return function(){VoiceQueueEvents[_0x9540('0x4')](_0x46fb54,_0xc6f232);};}exports[_0x9540('0x5')]=function(_0x24a42d){for(var _0x354a7b=0x0,_0x16b5b9=events['length'];_0x354a7b<_0x16b5b9;_0x354a7b++){var _0x5d4a3f=events[_0x354a7b];var _0x3b94b6=createListener(_0x9540('0x6')+_0x5d4a3f,_0x24a42d);VoiceQueueEvents['on'](_0x5d4a3f,_0x3b94b6);}}; \ No newline at end of file +var _0x2d6b=['voiceQueue:','save','remove','update','removeListener','register','length'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x2d6b,0x7f));var _0xb2d6=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x2d6b[_0x5f1391];return _0x50ebe3;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb2d6('0x0'),_0xb2d6('0x1'),_0xb2d6('0x2')];function createListener(_0x429031,_0x4c9e4f){return function(_0x11c17d){_0x4c9e4f['emit'](_0x429031,_0x11c17d);};}function removeListener(_0xc8c84c,_0xa2a3ff){return function(){VoiceQueueEvents[_0xb2d6('0x3')](_0xc8c84c,_0xa2a3ff);};}exports[_0xb2d6('0x4')]=function(_0x30efd3){for(var _0x86759d=0x0,_0x305136=events[_0xb2d6('0x5')];_0x86759d<_0x305136;_0x86759d++){var _0x465c91=events[_0x86759d];var _0x396e1c=createListener(_0xb2d6('0x6')+_0x465c91,_0x30efd3);VoiceQueueEvents['on'](_0x465c91,_0x396e1c);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 9571545..7425fa3 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 _0x21c1=['path','express','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','getVoiceQueuesReport','/:id','create','update','delete','destroy','exports','multer','util'];(function(_0x3c27b6,_0x2192cb){var _0x2a5f55=function(_0x4d8700){while(--_0x4d8700){_0x3c27b6['push'](_0x3c27b6['shift']());}};_0x2a5f55(++_0x2192cb);}(_0x21c1,0x11b));var _0x121c=function(_0x3ffeaf,_0x402638){_0x3ffeaf=_0x3ffeaf-0x0;var _0x46a2e2=_0x21c1[_0x3ffeaf];return _0x46a2e2;};'use strict';var multer=require(_0x121c('0x0'));var util=require(_0x121c('0x1'));var path=require(_0x121c('0x2'));var timeout=require('connect-timeout');var express=require(_0x121c('0x3'));var router=express[_0x121c('0x4')]();var fs_extra=require(_0x121c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x121c('0x6'));var controller=require(_0x121c('0x7'));router[_0x121c('0x8')]('/',auth[_0x121c('0x9')](),controller['index']);router['get'](_0x121c('0xa'),auth[_0x121c('0x9')](),controller[_0x121c('0xb')]);router[_0x121c('0x8')]('/index',auth[_0x121c('0x9')](),controller[_0x121c('0xc')]);router[_0x121c('0x8')](_0x121c('0xd'),auth[_0x121c('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x121c('0xe')]);router['put'](_0x121c('0xd'),auth[_0x121c('0x9')](),controller[_0x121c('0xf')]);router[_0x121c('0x10')](_0x121c('0xd'),auth[_0x121c('0x9')](),controller[_0x121c('0x11')]);module[_0x121c('0x12')]=router; \ No newline at end of file +var _0x1cf6=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','create','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1cf6,0x1a4));var _0x61cf=function(_0x47917a,_0x44e8bf){_0x47917a=_0x47917a-0x0;var _0x197de5=_0x1cf6[_0x47917a];return _0x197de5;};'use strict';var multer=require('multer');var util=require(_0x61cf('0x0'));var path=require(_0x61cf('0x1'));var timeout=require(_0x61cf('0x2'));var express=require(_0x61cf('0x3'));var router=express[_0x61cf('0x4')]();var fs_extra=require(_0x61cf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x61cf('0x6'));var config=require(_0x61cf('0x7'));var controller=require(_0x61cf('0x8'));router[_0x61cf('0x9')]('/',auth[_0x61cf('0xa')](),controller[_0x61cf('0xb')]);router[_0x61cf('0x9')](_0x61cf('0xc'),auth[_0x61cf('0xa')](),controller[_0x61cf('0xd')]);router[_0x61cf('0x9')](_0x61cf('0xe'),auth[_0x61cf('0xa')](),controller[_0x61cf('0xf')]);router[_0x61cf('0x9')](_0x61cf('0x10'),auth['isAuthenticated'](),controller[_0x61cf('0x11')]);router['post']('/',auth[_0x61cf('0xa')](),controller[_0x61cf('0x12')]);router['put'](_0x61cf('0x10'),auth[_0x61cf('0xa')](),controller[_0x61cf('0x13')]);router[_0x61cf('0x14')](_0x61cf('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x61cf('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 3767535..a6527fc 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 _0x4793=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue'];(function(_0x34d43d,_0x1679f6){var _0x906117=function(_0x49bdee){while(--_0x49bdee){_0x34d43d['push'](_0x34d43d['shift']());}};_0x906117(++_0x1679f6);}(_0x4793,0x6e));var _0x3479=function(_0x541bd0,_0x1def49){_0x541bd0=_0x541bd0-0x0;var _0x9c91e2=_0x4793[_0x541bd0];return _0x9c91e2;};'use strict';var Sequelize=require(_0x3479('0x0'));var moment=require('moment');module[_0x3479('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3479('0x2')]},'calleridnum':{'type':Sequelize[_0x3479('0x2')]},'calleridname':{'type':Sequelize[_0x3479('0x2')]},'queue':{'type':Sequelize[_0x3479('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3479('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3479('0x3')],'set':function(_0x4ea832){var _0x1c8ecd=moment(_0x4ea832);var _0x2b2487=moment(this[_0x3479('0x4')](_0x3479('0x5')))['format'](_0x3479('0x6'));var _0x4578f1=_0x1c8ecd[_0x3479('0x7')](_0x2b2487,_0x3479('0x8'));this[_0x3479('0x9')](_0x3479('0xa'),_0x4ea832);this[_0x3479('0x9')](_0x3479('0xb'),_0x4578f1||null);}},'position':{'type':Sequelize[_0x3479('0xc')]},'count':{'type':Sequelize[_0x3479('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x3479('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3479('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x3479('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3479('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3479('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x3479('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3479('0xc')]},'channel':{'type':Sequelize[_0x3479('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3479('0x2')]},'connectedlinename':{'type':Sequelize[_0x3479('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3479('0x2')]},'holdtime':{'type':Sequelize[_0x3479('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3479('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3479('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3479('0xe')},'transferexten':{'type':Sequelize[_0x3479('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3479('0x2')]},'disposition':{'type':Sequelize[_0x3479('0x2')]},'secondDisposition':{'type':Sequelize[_0x3479('0x2')]},'thirdDisposition':{'type':Sequelize[_0x3479('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x3479('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x3479('0x2')]}}; \ No newline at end of file +var _0x52db=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue'];(function(_0x176f30,_0x353f9b){var _0x1236bc=function(_0x33c9e4){while(--_0x33c9e4){_0x176f30['push'](_0x176f30['shift']());}};_0x1236bc(++_0x353f9b);}(_0x52db,0x7b));var _0xb52d=function(_0xef6c6a,_0x2f7369){_0xef6c6a=_0xef6c6a-0x0;var _0x4bdc83=_0x52db[_0xef6c6a];return _0x4bdc83;};'use strict';var Sequelize=require(_0xb52d('0x0'));var moment=require(_0xb52d('0x1'));module[_0xb52d('0x2')]={'type':{'type':Sequelize[_0xb52d('0x3')]},'uniqueid':{'type':Sequelize[_0xb52d('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xb52d('0x4')],'set':function(_0x17d0a1){var _0x378af=moment(_0x17d0a1);var _0x1b3a3f=moment(this[_0xb52d('0x5')](_0xb52d('0x6')))[_0xb52d('0x7')](_0xb52d('0x8'));var _0x2493e3=_0x378af[_0xb52d('0x9')](_0x1b3a3f,_0xb52d('0xa'));this['setDataValue'](_0xb52d('0xb'),_0x17d0a1);this[_0xb52d('0xc')](_0xb52d('0xd'),_0x2493e3||null);}},'position':{'type':Sequelize[_0xb52d('0xe')]},'count':{'type':Sequelize[_0xb52d('0xe')]},'queuecallerabandon':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb52d('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb52d('0x4')]},'queuecallerexit':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb52d('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xb52d('0x10')},'originalposition':{'type':Sequelize[_0xb52d('0xe')]},'channel':{'type':Sequelize[_0xb52d('0x3')]},'connectedlinenum':{'type':Sequelize[_0xb52d('0x3')]},'connectedlinename':{'type':Sequelize[_0xb52d('0x3')]},'accountcode':{'type':Sequelize[_0xb52d('0x3')]},'context':{'type':Sequelize[_0xb52d('0x3')]},'exten':{'type':Sequelize[_0xb52d('0x3')]},'priority':{'type':Sequelize[_0xb52d('0x3')]},'holdtime':{'type':Sequelize[_0xb52d('0xe')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb52d('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xb52d('0x3')]},'transferuniqueid':{'type':Sequelize[_0xb52d('0x3')]},'disposition':{'type':Sequelize[_0xb52d('0x3')]},'secondDisposition':{'type':Sequelize[_0xb52d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb52d('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xb52d('0xe')],'defaultValue':0x0},'note':{'type':Sequelize[_0xb52d('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 7612608..a143008 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 _0xfbad=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','stack','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','name','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','destroy','find','describe','getVoiceQueuesReport','order','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel'];(function(_0x320ef8,_0x266188){var _0x176141=function(_0x290437){while(--_0x290437){_0x320ef8['push'](_0x320ef8['shift']());}};_0x176141(++_0x266188);}(_0xfbad,0x144));var _0xdfba=function(_0x549811,_0x2badad){_0x549811=_0x549811-0x0;var _0x294a9e=_0xfbad[_0x549811];return _0x294a9e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdfba('0x0'));var jsonpatch=require(_0xdfba('0x1'));var rp=require(_0xdfba('0x2'));var moment=require(_0xdfba('0x3'));var BPromise=require(_0xdfba('0x4'));var Mustache=require(_0xdfba('0x5'));var util=require(_0xdfba('0x6'));var path=require('path');var sox=require(_0xdfba('0x7'));var csv=require('to-csv');var ejs=require(_0xdfba('0x8'));var fs=require('fs');var fs_extra=require(_0xdfba('0x9'));var _=require(_0xdfba('0xa'));var squel=require(_0xdfba('0xb'));var crypto=require(_0xdfba('0xc'));var jsforce=require(_0xdfba('0xd'));var deskjs=require(_0xdfba('0xe'));var toCsv=require(_0xdfba('0xf'));var querystring=require(_0xdfba('0x10'));var Papa=require(_0xdfba('0x11'));var Redis=require(_0xdfba('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdfba('0x13'));var as=require(_0xdfba('0x14'));var hardwareService=require(_0xdfba('0x15'));var logger=require(_0xdfba('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xdfba('0x17'));var licenseUtil=require(_0xdfba('0x18'));var db=require(_0xdfba('0x19'))['db'];config[_0xdfba('0x1a')]=_['defaults'](config[_0xdfba('0x1a')],{'host':_0xdfba('0x1b'),'port':0x18eb});var socket=require(_0xdfba('0x1c'))(new Redis(config[_0xdfba('0x1a')]));require(_0xdfba('0x1d'))['register'](socket);function respondWithStatusCode(_0x2fa191,_0xd5c210){_0xd5c210=_0xd5c210||0xcc;return function(_0xf1ee9e){if(_0xf1ee9e){return _0x2fa191[_0xdfba('0x1e')](_0xd5c210);}return _0x2fa191[_0xdfba('0x1f')](_0xd5c210)[_0xdfba('0x20')]();};}function respondWithResult(_0x146340,_0x191226){_0x191226=_0x191226||0xc8;return function(_0x5c4916){if(_0x5c4916){return _0x146340[_0xdfba('0x1f')](_0x191226)[_0xdfba('0x21')](_0x5c4916);}};}function respondWithFilteredResult(_0x599deb,_0x1725a0){return function(_0x4d3d9e){if(_0x4d3d9e){var _0x56a84a=typeof _0x1725a0[_0xdfba('0x22')]===_0xdfba('0x23')&&typeof _0x1725a0[_0xdfba('0x24')]===_0xdfba('0x23');var _0x2331d6=_0x4d3d9e[_0xdfba('0x25')];var _0x404fad=_0x56a84a?0x0:_0x1725a0[_0xdfba('0x22')];var _0x44abf8=_0x56a84a?_0x4d3d9e[_0xdfba('0x25')]:_0x1725a0[_0xdfba('0x22')]+_0x1725a0[_0xdfba('0x24')];var _0x5e6a91;if(_0x44abf8>=_0x2331d6){_0x44abf8=_0x2331d6;_0x5e6a91=0xc8;}else{_0x5e6a91=0xce;}_0x599deb[_0xdfba('0x1f')](_0x5e6a91);return _0x599deb['set'](_0xdfba('0x26'),_0x404fad+'-'+_0x44abf8+'/'+_0x2331d6)[_0xdfba('0x21')](_0x4d3d9e);}return null;};}function patchUpdates(_0x29a743){return function(_0x38c46a){try{jsonpatch['apply'](_0x38c46a,_0x29a743,!![]);}catch(_0x101c29){return BPromise[_0xdfba('0x27')](_0x101c29);}return _0x38c46a[_0xdfba('0x28')]();};}function saveUpdates(_0x3bedff,_0x1e42c6){return function(_0x2dbf7d){if(_0x2dbf7d){return _0x2dbf7d[_0xdfba('0x29')](_0x3bedff)['then'](function(_0x1d39a9){return _0x1d39a9;});}return null;};}function removeEntity(_0x120258,_0x2b2dd6){return function(_0x4061e3){if(_0x4061e3){return _0x4061e3['destroy']()[_0xdfba('0x2a')](function(){_0x120258[_0xdfba('0x1f')](0xcc)[_0xdfba('0x20')]();});}};}function handleEntityNotFound(_0x43f3f4,_0x1e4edc){return function(_0x5f2d62){if(!_0x5f2d62){_0x43f3f4[_0xdfba('0x1e')](0x194);}return _0x5f2d62;};}function handleError(_0x35836c,_0x311a80){_0x311a80=_0x311a80||0x1f4;return function(_0x53b6da){logger['error'](_0x53b6da[_0xdfba('0x2b')]);if(_0x53b6da['name']){delete _0x53b6da['name'];}_0x35836c[_0xdfba('0x1f')](_0x311a80)[_0xdfba('0x2c')](_0x53b6da);};}exports[_0xdfba('0x2d')]=function(_0x5f49b0,_0x56a9a5){var _0x5121d3={},_0x53cc52={},_0x1cf11c={'count':0x0,'rows':[]};var _0x3efb31=_[_0xdfba('0x2e')](db[_0xdfba('0x2f')][_0xdfba('0x30')],function(_0x7d134){return{'name':_0x7d134[_0xdfba('0x31')],'type':_0x7d134[_0xdfba('0x32')][_0xdfba('0x33')]};});_0x53cc52[_0xdfba('0x34')]=_[_0xdfba('0x2e')](_0x3efb31,_0xdfba('0x35'));_0x53cc52['query']=_[_0xdfba('0x36')](_0x5f49b0['query']);_0x53cc52[_0xdfba('0x37')]=_['intersection'](_0x53cc52[_0xdfba('0x34')],_0x53cc52[_0xdfba('0x38')]);_0x5121d3['attributes']=_[_0xdfba('0x39')](_0x53cc52[_0xdfba('0x34')],qs[_0xdfba('0x3a')](_0x5f49b0[_0xdfba('0x38')]['fields']));_0x5121d3[_0xdfba('0x3b')]=_0x5121d3[_0xdfba('0x3b')][_0xdfba('0x3c')]?_0x5121d3[_0xdfba('0x3b')]:_0x53cc52[_0xdfba('0x34')];if(!_0x5f49b0[_0xdfba('0x38')][_0xdfba('0x3d')](_0xdfba('0x3e'))){_0x5121d3[_0xdfba('0x24')]=qs['limit'](_0x5f49b0[_0xdfba('0x38')][_0xdfba('0x24')]);_0x5121d3[_0xdfba('0x22')]=qs['offset'](_0x5f49b0['query'][_0xdfba('0x22')]);}_0x5121d3['order']=qs[_0xdfba('0x3f')](_0x5f49b0[_0xdfba('0x38')]['sort']);_0x5121d3['where']=qs[_0xdfba('0x37')](_[_0xdfba('0x40')](_0x5f49b0[_0xdfba('0x38')],_0x53cc52[_0xdfba('0x37')]),_0x3efb31);if(_0x5f49b0[_0xdfba('0x38')][_0xdfba('0x41')]){_0x5121d3[_0xdfba('0x42')]=_[_0xdfba('0x43')](_0x5121d3[_0xdfba('0x42')],{'$or':_[_0xdfba('0x2e')](_0x3efb31,function(_0x556e95){if(_0x556e95[_0xdfba('0x32')]!==_0xdfba('0x44')){var _0x4a8f8e={};_0x4a8f8e[_0x556e95[_0xdfba('0x35')]]={'$like':'%'+_0x5f49b0[_0xdfba('0x38')][_0xdfba('0x41')]+'%'};return _0x4a8f8e;}})});}_0x5121d3=_['merge']({},_0x5121d3,_0x5f49b0[_0xdfba('0x45')]);var _0x4ca5a2={'where':_0x5121d3[_0xdfba('0x42')]};return db[_0xdfba('0x2f')][_0xdfba('0x25')](_0x4ca5a2)[_0xdfba('0x2a')](function(_0x326788){_0x1cf11c['count']=_0x326788;if(_0x5f49b0['query'][_0xdfba('0x46')]){_0x5121d3[_0xdfba('0x47')]=[{'all':!![]}];}return db[_0xdfba('0x2f')][_0xdfba('0x48')](_0x5121d3);})['then'](function(_0x393620){_0x1cf11c[_0xdfba('0x49')]=_0x393620;return _0x1cf11c;})[_0xdfba('0x2a')](respondWithFilteredResult(_0x56a9a5,_0x5121d3))[_0xdfba('0x4a')](handleError(_0x56a9a5,null));};exports[_0xdfba('0x4b')]=function(_0x264e31,_0x4bb9f9){var _0x2835d4={'raw':![],'where':{'id':_0x264e31[_0xdfba('0x4c')]['id']}},_0x3e8cc2={};_0x3e8cc2[_0xdfba('0x34')]=_['keys'](db[_0xdfba('0x2f')][_0xdfba('0x30')]);_0x3e8cc2['query']=_[_0xdfba('0x36')](_0x264e31[_0xdfba('0x38')]);_0x3e8cc2[_0xdfba('0x37')]=_[_0xdfba('0x39')](_0x3e8cc2['model'],_0x3e8cc2['query']);_0x2835d4[_0xdfba('0x3b')]=_[_0xdfba('0x39')](_0x3e8cc2[_0xdfba('0x34')],qs[_0xdfba('0x3a')](_0x264e31[_0xdfba('0x38')]['fields']));_0x2835d4[_0xdfba('0x3b')]=_0x2835d4[_0xdfba('0x3b')][_0xdfba('0x3c')]?_0x2835d4[_0xdfba('0x3b')]:_0x3e8cc2['model'];if(_0x264e31[_0xdfba('0x38')][_0xdfba('0x46')]){_0x2835d4[_0xdfba('0x47')]=[{'all':!![]}];}_0x2835d4=_[_0xdfba('0x43')]({},_0x2835d4,_0x264e31[_0xdfba('0x45')]);return db[_0xdfba('0x2f')]['find'](_0x2835d4)[_0xdfba('0x2a')](handleEntityNotFound(_0x4bb9f9,null))[_0xdfba('0x2a')](respondWithResult(_0x4bb9f9,null))['catch'](handleError(_0x4bb9f9,null));};exports['create']=function(_0x4208f4,_0x5be2c5){return db[_0xdfba('0x2f')][_0xdfba('0x4d')](_0x4208f4['body'],{})[_0xdfba('0x2a')](respondWithResult(_0x5be2c5,0xc9))['catch'](handleError(_0x5be2c5,null));};exports[_0xdfba('0x29')]=function(_0x592749,_0x2540db){if(_0x592749[_0xdfba('0x4e')]['id']){delete _0x592749[_0xdfba('0x4e')]['id'];}return db[_0xdfba('0x2f')]['find']({'where':{'id':_0x592749[_0xdfba('0x4c')]['id']}})[_0xdfba('0x2a')](handleEntityNotFound(_0x2540db,null))[_0xdfba('0x2a')](saveUpdates(_0x592749[_0xdfba('0x4e')],null))['then'](respondWithResult(_0x2540db,null))['catch'](handleError(_0x2540db,null));};exports[_0xdfba('0x4f')]=function(_0xedba3e,_0xc868c6){return db[_0xdfba('0x2f')][_0xdfba('0x50')]({'where':{'id':_0xedba3e['params']['id']}})[_0xdfba('0x2a')](handleEntityNotFound(_0xc868c6,null))['then'](removeEntity(_0xc868c6,null))[_0xdfba('0x4a')](handleError(_0xc868c6,null));};exports[_0xdfba('0x51')]=function(_0x3792c5,_0x13dc4d){return db[_0xdfba('0x2f')][_0xdfba('0x51')]()[_0xdfba('0x2a')](respondWithResult(_0x13dc4d,null))['catch'](handleError(_0x13dc4d,null));};exports[_0xdfba('0x52')]=function(_0x261463,_0x1afd99){var _0x5d66ff={},_0xd4f7={},_0x2643b7={'count':0x0,'rows':[]};_0xd4f7['model']=_[_0xdfba('0x36')](db[_0xdfba('0x2f')][_0xdfba('0x30')]);_0xd4f7[_0xdfba('0x38')]=_[_0xdfba('0x36')](_0x261463[_0xdfba('0x38')]);_0xd4f7['filters']=_[_0xdfba('0x39')](_0xd4f7[_0xdfba('0x34')],_0xd4f7[_0xdfba('0x38')]);_0x5d66ff[_0xdfba('0x3b')]=_['intersection'](_0xd4f7['model'],qs['fields'](_0x261463[_0xdfba('0x38')][_0xdfba('0x3a')]));_0x5d66ff[_0xdfba('0x3b')]=_0x5d66ff[_0xdfba('0x3b')][_0xdfba('0x3c')]?_0x5d66ff[_0xdfba('0x3b')]:_0xd4f7[_0xdfba('0x34')];if(!_0x261463[_0xdfba('0x38')][_0xdfba('0x3d')]('nolimit')){_0x5d66ff[_0xdfba('0x24')]=qs[_0xdfba('0x24')](_0x261463['query']['limit']);_0x5d66ff[_0xdfba('0x22')]=qs[_0xdfba('0x22')](_0x261463[_0xdfba('0x38')][_0xdfba('0x22')]);}_0x5d66ff[_0xdfba('0x53')]=qs[_0xdfba('0x3f')](_0x261463[_0xdfba('0x38')]['sort']);_0x5d66ff[_0xdfba('0x42')]=qs[_0xdfba('0x37')](_[_0xdfba('0x40')](_0x261463['query'],_0xd4f7['filters']));if(_0x261463[_0xdfba('0x38')][_0xdfba('0x41')]){_0x5d66ff[_0xdfba('0x42')]=_[_0xdfba('0x43')](_0x5d66ff[_0xdfba('0x42')],{'$or':_[_0xdfba('0x2e')](_0x5d66ff[_0xdfba('0x3b')],function(_0x449141){var _0x56944b={};_0x56944b[_0x449141]={'$like':'%'+_0x261463[_0xdfba('0x38')][_0xdfba('0x41')]+'%'};return _0x56944b;})});}_0x5d66ff=_[_0xdfba('0x43')]({},_0x5d66ff,_0x261463[_0xdfba('0x45')]);var _0x4ca3de={'where':_0x5d66ff[_0xdfba('0x42')]};return db[_0xdfba('0x2f')][_0xdfba('0x25')](_0x4ca3de)[_0xdfba('0x2a')](function(_0xb70c88){_0x2643b7['count']=_0xb70c88;if(_0x261463[_0xdfba('0x38')]['includeAll']){_0x5d66ff[_0xdfba('0x47')]=[{'all':!![]}];}return db[_0xdfba('0x2f')][_0xdfba('0x48')](_0x5d66ff);})[_0xdfba('0x2a')](function(_0x2c01a0){_0x2643b7[_0xdfba('0x49')]=_0x2c01a0;return _0x2643b7;})[_0xdfba('0x2a')](respondWithFilteredResult(_0x1afd99,_0x5d66ff,_0xdfba('0x52')))[_0xdfba('0x4a')](handleError(_0x1afd99,null,_0xdfba('0x52')));}; \ No newline at end of file +var _0x5f71=['sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','rawAttributes','create','body','find','destroy','describe','order','options','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','VoiceQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit'];(function(_0xfd166a,_0x2b982b){var _0x37d4d1=function(_0x90c6ca){while(--_0x90c6ca){_0xfd166a['push'](_0xfd166a['shift']());}};_0x37d4d1(++_0x2b982b);}(_0x5f71,0x1bd));var _0x15f7=function(_0x856d6f,_0x23ed79){_0x856d6f=_0x856d6f-0x0;var _0x149de0=_0x5f71[_0x856d6f];return _0x149de0;};'use strict';var emlformat=require(_0x15f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15f7('0x1'));var jsonpatch=require(_0x15f7('0x2'));var rp=require(_0x15f7('0x3'));var moment=require(_0x15f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15f7('0x5'));var util=require(_0x15f7('0x6'));var path=require('path');var sox=require(_0x15f7('0x7'));var csv=require('to-csv');var ejs=require(_0x15f7('0x8'));var fs=require('fs');var fs_extra=require(_0x15f7('0x9'));var _=require(_0x15f7('0xa'));var squel=require(_0x15f7('0xb'));var crypto=require(_0x15f7('0xc'));var jsforce=require(_0x15f7('0xd'));var deskjs=require(_0x15f7('0xe'));var toCsv=require(_0x15f7('0xf'));var querystring=require(_0x15f7('0x10'));var Papa=require(_0x15f7('0x11'));var Redis=require(_0x15f7('0x12'));var authService=require(_0x15f7('0x13'));var qs=require(_0x15f7('0x14'));var as=require(_0x15f7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15f7('0x16'))(_0x15f7('0x17'));var utils=require(_0x15f7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x15f7('0x19'));var db=require(_0x15f7('0x1a'))['db'];config[_0x15f7('0x1b')]=_[_0x15f7('0x1c')](config['redis'],{'host':_0x15f7('0x1d'),'port':0x18eb});var socket=require(_0x15f7('0x1e'))(new Redis(config[_0x15f7('0x1b')]));require('./voiceQueueReport.socket')[_0x15f7('0x1f')](socket);function respondWithStatusCode(_0x467866,_0x4a4248){_0x4a4248=_0x4a4248||0xcc;return function(_0x30a40a){if(_0x30a40a){return _0x467866[_0x15f7('0x20')](_0x4a4248);}return _0x467866[_0x15f7('0x21')](_0x4a4248)[_0x15f7('0x22')]();};}function respondWithResult(_0x139387,_0x2ffaed){_0x2ffaed=_0x2ffaed||0xc8;return function(_0x15feff){if(_0x15feff){return _0x139387[_0x15f7('0x21')](_0x2ffaed)[_0x15f7('0x23')](_0x15feff);}};}function respondWithFilteredResult(_0x3ebd58,_0x273851){return function(_0x2b5112){if(_0x2b5112){var _0x208948=typeof _0x273851[_0x15f7('0x24')]===_0x15f7('0x25')&&typeof _0x273851[_0x15f7('0x26')]===_0x15f7('0x25');var _0x39d6ca=_0x2b5112[_0x15f7('0x27')];var _0x3335f0=_0x208948?0x0:_0x273851['offset'];var _0x34dbd5=_0x208948?_0x2b5112[_0x15f7('0x27')]:_0x273851['offset']+_0x273851[_0x15f7('0x26')];var _0x2350cb;if(_0x34dbd5>=_0x39d6ca){_0x34dbd5=_0x39d6ca;_0x2350cb=0xc8;}else{_0x2350cb=0xce;}_0x3ebd58[_0x15f7('0x21')](_0x2350cb);return _0x3ebd58[_0x15f7('0x28')](_0x15f7('0x29'),_0x3335f0+'-'+_0x34dbd5+'/'+_0x39d6ca)[_0x15f7('0x23')](_0x2b5112);}return null;};}function patchUpdates(_0x5c60a2){return function(_0x52d49f){try{jsonpatch[_0x15f7('0x2a')](_0x52d49f,_0x5c60a2,!![]);}catch(_0x1739b0){return BPromise[_0x15f7('0x2b')](_0x1739b0);}return _0x52d49f['save']();};}function saveUpdates(_0x46346e,_0x37159c){return function(_0x26cb05){if(_0x26cb05){return _0x26cb05[_0x15f7('0x2c')](_0x46346e)[_0x15f7('0x2d')](function(_0x118889){return _0x118889;});}return null;};}function removeEntity(_0x44a61c,_0x509d3c){return function(_0x304573){if(_0x304573){return _0x304573['destroy']()['then'](function(){_0x44a61c['status'](0xcc)[_0x15f7('0x22')]();});}};}function handleEntityNotFound(_0x52bdc8,_0x44357f){return function(_0x13aa75){if(!_0x13aa75){_0x52bdc8[_0x15f7('0x20')](0x194);}return _0x13aa75;};}function handleError(_0x5db40b,_0x181fca){_0x181fca=_0x181fca||0x1f4;return function(_0x326b86){logger[_0x15f7('0x2e')](_0x326b86['stack']);if(_0x326b86[_0x15f7('0x2f')]){delete _0x326b86[_0x15f7('0x2f')];}_0x5db40b['status'](_0x181fca)[_0x15f7('0x30')](_0x326b86);};}exports[_0x15f7('0x31')]=function(_0x44b505,_0x4eb8b4){var _0x56c34d={},_0x175cb4={},_0x5844c4={'count':0x0,'rows':[]};var _0x17138f=_[_0x15f7('0x32')](db[_0x15f7('0x33')]['rawAttributes'],function(_0x568517){return{'name':_0x568517[_0x15f7('0x34')],'type':_0x568517[_0x15f7('0x35')][_0x15f7('0x36')]};});_0x175cb4['model']=_[_0x15f7('0x32')](_0x17138f,_0x15f7('0x2f'));_0x175cb4[_0x15f7('0x37')]=_[_0x15f7('0x38')](_0x44b505[_0x15f7('0x37')]);_0x175cb4[_0x15f7('0x39')]=_[_0x15f7('0x3a')](_0x175cb4['model'],_0x175cb4[_0x15f7('0x37')]);_0x56c34d['attributes']=_['intersection'](_0x175cb4[_0x15f7('0x3b')],qs[_0x15f7('0x3c')](_0x44b505[_0x15f7('0x37')][_0x15f7('0x3c')]));_0x56c34d['attributes']=_0x56c34d['attributes'][_0x15f7('0x3d')]?_0x56c34d[_0x15f7('0x3e')]:_0x175cb4[_0x15f7('0x3b')];if(!_0x44b505[_0x15f7('0x37')][_0x15f7('0x3f')](_0x15f7('0x40'))){_0x56c34d[_0x15f7('0x26')]=qs[_0x15f7('0x26')](_0x44b505[_0x15f7('0x37')][_0x15f7('0x26')]);_0x56c34d[_0x15f7('0x24')]=qs[_0x15f7('0x24')](_0x44b505[_0x15f7('0x37')]['offset']);}_0x56c34d['order']=qs[_0x15f7('0x41')](_0x44b505[_0x15f7('0x37')][_0x15f7('0x41')]);_0x56c34d[_0x15f7('0x42')]=qs[_0x15f7('0x39')](_[_0x15f7('0x43')](_0x44b505[_0x15f7('0x37')],_0x175cb4['filters']),_0x17138f);if(_0x44b505[_0x15f7('0x37')][_0x15f7('0x44')]){_0x56c34d['where']=_[_0x15f7('0x45')](_0x56c34d[_0x15f7('0x42')],{'$or':_[_0x15f7('0x32')](_0x17138f,function(_0x326b2a){if(_0x326b2a['type']!==_0x15f7('0x46')){var _0x3a9f65={};_0x3a9f65[_0x326b2a['name']]={'$like':'%'+_0x44b505['query'][_0x15f7('0x44')]+'%'};return _0x3a9f65;}})});}_0x56c34d=_['merge']({},_0x56c34d,_0x44b505['options']);var _0x2be213={'where':_0x56c34d['where']};return db[_0x15f7('0x33')]['count'](_0x2be213)[_0x15f7('0x2d')](function(_0x14a5ef){_0x5844c4[_0x15f7('0x27')]=_0x14a5ef;if(_0x44b505[_0x15f7('0x37')][_0x15f7('0x47')]){_0x56c34d[_0x15f7('0x48')]=[{'all':!![]}];}return db[_0x15f7('0x33')][_0x15f7('0x49')](_0x56c34d);})[_0x15f7('0x2d')](function(_0x3033dc){_0x5844c4['rows']=_0x3033dc;return _0x5844c4;})['then'](respondWithFilteredResult(_0x4eb8b4,_0x56c34d))[_0x15f7('0x4a')](handleError(_0x4eb8b4,null));};exports[_0x15f7('0x4b')]=function(_0x308936,_0x530097){var _0x1a7514={'raw':![],'where':{'id':_0x308936['params']['id']}},_0x4b23bf={};_0x4b23bf[_0x15f7('0x3b')]=_['keys'](db[_0x15f7('0x33')][_0x15f7('0x4c')]);_0x4b23bf[_0x15f7('0x37')]=_[_0x15f7('0x38')](_0x308936[_0x15f7('0x37')]);_0x4b23bf[_0x15f7('0x39')]=_['intersection'](_0x4b23bf['model'],_0x4b23bf['query']);_0x1a7514[_0x15f7('0x3e')]=_['intersection'](_0x4b23bf['model'],qs['fields'](_0x308936[_0x15f7('0x37')][_0x15f7('0x3c')]));_0x1a7514[_0x15f7('0x3e')]=_0x1a7514[_0x15f7('0x3e')][_0x15f7('0x3d')]?_0x1a7514[_0x15f7('0x3e')]:_0x4b23bf[_0x15f7('0x3b')];if(_0x308936['query'][_0x15f7('0x47')]){_0x1a7514[_0x15f7('0x48')]=[{'all':!![]}];}_0x1a7514=_['merge']({},_0x1a7514,_0x308936['options']);return db[_0x15f7('0x33')]['find'](_0x1a7514)[_0x15f7('0x2d')](handleEntityNotFound(_0x530097,null))[_0x15f7('0x2d')](respondWithResult(_0x530097,null))[_0x15f7('0x4a')](handleError(_0x530097,null));};exports[_0x15f7('0x4d')]=function(_0x1bf8b5,_0x3888f2){return db[_0x15f7('0x33')]['create'](_0x1bf8b5['body'],{})[_0x15f7('0x2d')](respondWithResult(_0x3888f2,0xc9))[_0x15f7('0x4a')](handleError(_0x3888f2,null));};exports[_0x15f7('0x2c')]=function(_0xe963d2,_0x32b338){if(_0xe963d2['body']['id']){delete _0xe963d2[_0x15f7('0x4e')]['id'];}return db['VoiceQueueReport'][_0x15f7('0x4f')]({'where':{'id':_0xe963d2['params']['id']}})[_0x15f7('0x2d')](handleEntityNotFound(_0x32b338,null))[_0x15f7('0x2d')](saveUpdates(_0xe963d2['body'],null))[_0x15f7('0x2d')](respondWithResult(_0x32b338,null))['catch'](handleError(_0x32b338,null));};exports[_0x15f7('0x50')]=function(_0x5721ec,_0x5b10d1){return db[_0x15f7('0x33')][_0x15f7('0x4f')]({'where':{'id':_0x5721ec['params']['id']}})[_0x15f7('0x2d')](handleEntityNotFound(_0x5b10d1,null))[_0x15f7('0x2d')](removeEntity(_0x5b10d1,null))[_0x15f7('0x4a')](handleError(_0x5b10d1,null));};exports['describe']=function(_0x3133d0,_0x48d718){return db[_0x15f7('0x33')][_0x15f7('0x51')]()[_0x15f7('0x2d')](respondWithResult(_0x48d718,null))[_0x15f7('0x4a')](handleError(_0x48d718,null));};exports['getVoiceQueuesReport']=function(_0x27ab9a,_0xf09542){var _0x421477={},_0x56392f={},_0x427550={'count':0x0,'rows':[]};_0x56392f[_0x15f7('0x3b')]=_[_0x15f7('0x38')](db[_0x15f7('0x33')][_0x15f7('0x4c')]);_0x56392f[_0x15f7('0x37')]=_['keys'](_0x27ab9a['query']);_0x56392f[_0x15f7('0x39')]=_[_0x15f7('0x3a')](_0x56392f[_0x15f7('0x3b')],_0x56392f['query']);_0x421477[_0x15f7('0x3e')]=_[_0x15f7('0x3a')](_0x56392f['model'],qs['fields'](_0x27ab9a['query']['fields']));_0x421477[_0x15f7('0x3e')]=_0x421477[_0x15f7('0x3e')][_0x15f7('0x3d')]?_0x421477[_0x15f7('0x3e')]:_0x56392f[_0x15f7('0x3b')];if(!_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x3f')](_0x15f7('0x40'))){_0x421477[_0x15f7('0x26')]=qs[_0x15f7('0x26')](_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x26')]);_0x421477['offset']=qs[_0x15f7('0x24')](_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x24')]);}_0x421477[_0x15f7('0x52')]=qs[_0x15f7('0x41')](_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x41')]);_0x421477[_0x15f7('0x42')]=qs['filters'](_[_0x15f7('0x43')](_0x27ab9a[_0x15f7('0x37')],_0x56392f[_0x15f7('0x39')]));if(_0x27ab9a[_0x15f7('0x37')]['filter']){_0x421477[_0x15f7('0x42')]=_[_0x15f7('0x45')](_0x421477['where'],{'$or':_['map'](_0x421477[_0x15f7('0x3e')],function(_0x521865){var _0xe38734={};_0xe38734[_0x521865]={'$like':'%'+_0x27ab9a[_0x15f7('0x37')]['filter']+'%'};return _0xe38734;})});}_0x421477=_['merge']({},_0x421477,_0x27ab9a[_0x15f7('0x53')]);var _0x38286e={'where':_0x421477[_0x15f7('0x42')]};return db[_0x15f7('0x33')]['count'](_0x38286e)['then'](function(_0x28f2b4){_0x427550[_0x15f7('0x27')]=_0x28f2b4;if(_0x27ab9a[_0x15f7('0x37')]['includeAll']){_0x421477[_0x15f7('0x48')]=[{'all':!![]}];}return db[_0x15f7('0x33')][_0x15f7('0x49')](_0x421477);})['then'](function(_0x4c19c3){_0x427550['rows']=_0x4c19c3;return _0x427550;})['then'](respondWithFilteredResult(_0xf09542,_0x421477,'getVoiceQueuesReport'))[_0x15f7('0x4a')](handleError(_0xf09542,null,_0x15f7('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 7981f4b..7c094cf 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 _0x77d0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x466830,_0x2d1bc5){var _0x3ec9c9=function(_0x17b134){while(--_0x17b134){_0x466830['push'](_0x466830['shift']());}};_0x3ec9c9(++_0x2d1bc5);}(_0x77d0,0xd5));var _0x077d=function(_0x392f3a,_0x19b09b){_0x392f3a=_0x392f3a-0x0;var _0x200848=_0x77d0[_0x392f3a];return _0x200848;};'use strict';var EventEmitter=require(_0x077d('0x0'));var VoiceQueueReport=require(_0x077d('0x1'))['db'][_0x077d('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x077d('0x3')](0x0);var events={'afterCreate':_0x077d('0x4'),'afterUpdate':_0x077d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x977126){return function(_0x334625,_0x5682e9,_0xe90480){VoiceQueueReportEvents[_0x077d('0x6')](_0x977126+':'+_0x334625['id'],_0x334625);VoiceQueueReportEvents[_0x077d('0x6')](_0x977126,_0x334625);_0xe90480(null);};}for(var e in events){if(events[_0x077d('0x7')](e)){var event=events[e];VoiceQueueReport[_0x077d('0x8')](e,emitEvent(event));}}module[_0x077d('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x9477=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x9477,0xb2));var _0x7947=function(_0x26e758,_0x4289f0){_0x26e758=_0x26e758-0x0;var _0x1f8cfe=_0x9477[_0x26e758];return _0x1f8cfe;};'use strict';var EventEmitter=require(_0x7947('0x0'));var VoiceQueueReport=require(_0x7947('0x1'))['db'][_0x7947('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7947('0x3')](0x0);var events={'afterCreate':_0x7947('0x4'),'afterUpdate':_0x7947('0x5'),'afterDestroy':_0x7947('0x6')};function emitEvent(_0x424bad){return function(_0x178a56,_0x5e449a,_0x1a6fbf){VoiceQueueReportEvents[_0x7947('0x7')](_0x424bad+':'+_0x178a56['id'],_0x178a56);VoiceQueueReportEvents[_0x7947('0x7')](_0x424bad,_0x178a56);_0x1a6fbf(null);};}for(var e in events){if(events[_0x7947('0x8')](e)){var event=events[e];VoiceQueueReport[_0x7947('0x9')](e,emitEvent(event));}}module[_0x7947('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 98992e4..99dbba2 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 _0xb5f7=['../../config/environment','exports','define','uniqueid','calleridnum','api','moment','bluebird','request-promise','path'];(function(_0x16cbe3,_0x311500){var _0x1f3bd0=function(_0x478015){while(--_0x478015){_0x16cbe3['push'](_0x16cbe3['shift']());}};_0x1f3bd0(++_0x311500);}(_0xb5f7,0x11d));var _0x7b5f=function(_0x19842a,_0xead96b){_0x19842a=_0x19842a-0x0;var _0x6d56a3=_0xb5f7[_0x19842a];return _0x6d56a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7b5f('0x0'));var moment=require(_0x7b5f('0x1'));var BPromise=require(_0x7b5f('0x2'));var rp=require(_0x7b5f('0x3'));var fs=require('fs');var path=require(_0x7b5f('0x4'));var rimraf=require('rimraf');var config=require(_0x7b5f('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0x7b5f('0x6')]=function(_0x5c2a4f,_0x2869e4){return _0x5c2a4f[_0x7b5f('0x7')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x7b5f('0x8')]},{'fields':[_0x7b5f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x070d=['calleridnum','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_queue','uniqueid'];(function(_0x1cd08d,_0x332c91){var _0x31455d=function(_0x5eb8c9){while(--_0x5eb8c9){_0x1cd08d['push'](_0x1cd08d['shift']());}};_0x31455d(++_0x332c91);}(_0x070d,0x153));var _0xd070=function(_0x3b934f,_0x59dc45){_0x3b934f=_0x3b934f-0x0;var _0x136c82=_0x070d[_0x3b934f];return _0x136c82;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd070('0x0'))(_0xd070('0x1'));var moment=require(_0xd070('0x2'));var BPromise=require(_0xd070('0x3'));var rp=require(_0xd070('0x4'));var fs=require('fs');var path=require(_0xd070('0x5'));var rimraf=require(_0xd070('0x6'));var config=require(_0xd070('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xd070('0x8')]=function(_0x3a0d10,_0x5452ca){return _0x3a0d10[_0xd070('0x9')]('VoiceQueueReport',attributes,{'tableName':_0xd070('0xa'),'paranoid':![],'indexes':[{'fields':[_0xd070('0xb')]},{'fields':[_0xd070('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index cef55c8..91589a8 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 _0x4c71=['stringify','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','request','then','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','debug','CreateVoiceQueueReport','VoiceQueueReport','create','body','info'];(function(_0x34e4ad,_0x377875){var _0x24a0c2=function(_0x5f5977){while(--_0x5f5977){_0x34e4ad['push'](_0x34e4ad['shift']());}};_0x24a0c2(++_0x377875);}(_0x4c71,0xda));var _0x14c7=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x4c71[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var moment=require('moment');var BPromise=require(_0x14c7('0x2'));var rs=require(_0x14c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14c7('0x4'))['db'];var utils=require(_0x14c7('0x5'));var logger=require(_0x14c7('0x6'))(_0x14c7('0x7'));var config=require(_0x14c7('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x14c7('0x9')](config[_0x14c7('0xa')],{'host':_0x14c7('0xb'),'port':0x18eb});var socket=require(_0x14c7('0xc'))(new Redis(config[_0x14c7('0xa')]));require('./voiceQueueReport.socket')[_0x14c7('0xd')](socket);function respondWithRpcPromise(_0x594667,_0x2c4d76,_0x1415a5){return new BPromise(function(_0x484b3e,_0x2d407c){return client[_0x14c7('0xe')](_0x594667,_0x1415a5)[_0x14c7('0xf')](function(_0x3d99f8){logger['info'](_0x14c7('0x10'),_0x2c4d76,'request\x20sent');logger['debug'](_0x14c7('0x11'),_0x2c4d76,_0x14c7('0x12'),JSON['stringify'](_0x3d99f8));if(_0x3d99f8[_0x14c7('0x13')]){if(_0x3d99f8[_0x14c7('0x13')][_0x14c7('0x14')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2c4d76,_0x3d99f8[_0x14c7('0x13')][_0x14c7('0x15')]);return _0x2d407c(_0x3d99f8[_0x14c7('0x13')][_0x14c7('0x15')]);}logger['error'](_0x14c7('0x10'),_0x2c4d76,_0x3d99f8[_0x14c7('0x13')][_0x14c7('0x15')]);return _0x484b3e(_0x3d99f8[_0x14c7('0x13')]['message']);}else{logger['info'](_0x14c7('0x10'),_0x2c4d76,_0x14c7('0x12'));_0x484b3e(_0x3d99f8[_0x14c7('0x16')][_0x14c7('0x15')]);}})[_0x14c7('0x17')](function(_0x530882){logger[_0x14c7('0x13')](_0x14c7('0x10'),_0x2c4d76,_0x530882);_0x2d407c(_0x530882);});});}exports[_0x14c7('0x18')]=function(_0x54dbc7){var _0x1d3e97=this;return new Promise(function(_0x1dad52,_0x4721c5){return db['VoiceQueueReport'][_0x14c7('0x19')]({'raw':_0x54dbc7[_0x14c7('0x1a')]?_0x54dbc7[_0x14c7('0x1a')][_0x14c7('0x1b')]===undefined?!![]:![]:!![],'where':_0x54dbc7[_0x14c7('0x1a')]?_0x54dbc7[_0x14c7('0x1a')][_0x14c7('0x1c')]||null:null,'attributes':_0x54dbc7[_0x14c7('0x1a')]?_0x54dbc7[_0x14c7('0x1a')][_0x14c7('0x1d')]||null:null,'limit':_0x54dbc7['options']?_0x54dbc7[_0x14c7('0x1a')][_0x14c7('0x1e')]||null:null,'include':_0x54dbc7['options']?_0x54dbc7['options']['include']?_[_0x14c7('0x1f')](_0x54dbc7['options'][_0x14c7('0x20')],function(_0x1a2d3d){return{'model':db[_0x1a2d3d[_0x14c7('0x21')]],'as':_0x1a2d3d['as'],'attributes':_0x1a2d3d[_0x14c7('0x1d')],'include':_0x1a2d3d['include']?_[_0x14c7('0x1f')](_0x1a2d3d[_0x14c7('0x20')],function(_0x5b81e9){return{'model':db[_0x5b81e9[_0x14c7('0x21')]],'as':_0x5b81e9['as'],'attributes':_0x5b81e9[_0x14c7('0x1d')],'include':_0x5b81e9[_0x14c7('0x20')]?_['map'](_0x5b81e9[_0x14c7('0x20')],function(_0x2bc6a3){return{'model':db[_0x2bc6a3[_0x14c7('0x21')]],'as':_0x2bc6a3['as'],'attributes':_0x2bc6a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x14c7('0xf')](function(_0xbb1bf8){logger['info'](_0x14c7('0x18'),_0x54dbc7);logger[_0x14c7('0x22')]('GetVoiceQueueReport',_0x54dbc7,JSON['stringify'](_0xbb1bf8));_0x1dad52(_0xbb1bf8);})[_0x14c7('0x17')](function(_0xe77200){logger[_0x14c7('0x13')](_0x14c7('0x18'),_0xe77200['message'],_0x54dbc7);_0x4721c5(_0x1d3e97[_0x14c7('0x13')](0x1f4,_0xe77200[_0x14c7('0x15')]));});});};exports[_0x14c7('0x23')]=function(_0x3324eb){var _0x356231=this;return new Promise(function(_0x1cd800,_0x443382){return db[_0x14c7('0x24')][_0x14c7('0x25')](_0x3324eb[_0x14c7('0x26')],{'raw':_0x3324eb['options']?_0x3324eb[_0x14c7('0x1a')][_0x14c7('0x1b')]===undefined?!![]:![]:!![]})[_0x14c7('0xf')](function(_0x35a292){logger[_0x14c7('0x27')](_0x14c7('0x23'),_0x3324eb);logger[_0x14c7('0x22')](_0x14c7('0x23'),_0x3324eb,JSON[_0x14c7('0x28')](_0x35a292));_0x1cd800(_0x35a292);})['catch'](function(_0x29e100){logger[_0x14c7('0x13')](_0x14c7('0x23'),_0x29e100[_0x14c7('0x15')],_0x3324eb);_0x443382(_0x356231[_0x14c7('0x13')](0x1f4,_0x29e100[_0x14c7('0x15')]));});});};exports[_0x14c7('0x29')]=function(_0x3edc95){var _0x355d25=this;return new Promise(function(_0x1b5eec,_0x4f5ead){return db['VoiceQueueReport'][_0x14c7('0x2a')](_0x3edc95['body'],{'raw':_0x3edc95[_0x14c7('0x1a')]?_0x3edc95[_0x14c7('0x1a')][_0x14c7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3edc95[_0x14c7('0x1a')]?_0x3edc95[_0x14c7('0x1a')]['where']||null:null,'attributes':_0x3edc95['options']?_0x3edc95[_0x14c7('0x1a')][_0x14c7('0x1d')]||null:null,'limit':_0x3edc95['options']?_0x3edc95[_0x14c7('0x1a')][_0x14c7('0x1e')]||null:null})['then'](function(_0x36bed7){logger[_0x14c7('0x27')](_0x14c7('0x29'),_0x3edc95);logger['debug']('UpdateVoiceQueueReport',_0x3edc95,JSON[_0x14c7('0x28')](_0x36bed7));_0x1b5eec(_0x36bed7);})['catch'](function(_0x5a8d22){logger[_0x14c7('0x13')](_0x14c7('0x29'),_0x5a8d22['message'],_0x3edc95);_0x4f5ead(_0x355d25[_0x14c7('0x13')](0x1f4,_0x5a8d22['message']));});});}; \ No newline at end of file +var _0x006c=['where','limit','UpdateVoiceQueueReport','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','attributes','include','map','model','GetVoiceQueueReport','debug','VoiceQueueReport','CreateVoiceQueueReport','update'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x006c,0x97));var _0xc006=function(_0x260878,_0xa9be1a){_0x260878=_0x260878-0x0;var _0x121b93=_0x006c[_0x260878];return _0x121b93;};'use strict';var _=require(_0xc006('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc006('0x1'));var db=require(_0xc006('0x2'))['db'];var utils=require(_0xc006('0x3'));var logger=require('../../config/logger')(_0xc006('0x4'));var config=require(_0xc006('0x5'));var jayson=require(_0xc006('0x6'));var client=jayson['client'][_0xc006('0x7')]({'port':0x232a});config['redis']=_[_0xc006('0x8')](config[_0xc006('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc006('0xa'))(new Redis(config[_0xc006('0x9')]));require(_0xc006('0xb'))['register'](socket);function respondWithRpcPromise(_0x50ab3d,_0x452eed,_0xccf571){return new BPromise(function(_0x2d7f3a,_0x3e011e){return client['request'](_0x50ab3d,_0xccf571)[_0xc006('0xc')](function(_0x5e0db8){logger[_0xc006('0xd')](_0xc006('0xe'),_0x452eed,_0xc006('0xf'));logger['debug'](_0xc006('0x10'),_0x452eed,'request\x20sent',JSON[_0xc006('0x11')](_0x5e0db8));if(_0x5e0db8[_0xc006('0x12')]){if(_0x5e0db8[_0xc006('0x12')]['code']===0x1f4){logger[_0xc006('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x452eed,_0x5e0db8[_0xc006('0x12')][_0xc006('0x13')]);return _0x3e011e(_0x5e0db8[_0xc006('0x12')]['message']);}logger[_0xc006('0x12')](_0xc006('0xe'),_0x452eed,_0x5e0db8[_0xc006('0x12')][_0xc006('0x13')]);return _0x2d7f3a(_0x5e0db8[_0xc006('0x12')]['message']);}else{logger[_0xc006('0xd')](_0xc006('0xe'),_0x452eed,_0xc006('0xf'));_0x2d7f3a(_0x5e0db8[_0xc006('0x14')][_0xc006('0x13')]);}})[_0xc006('0x15')](function(_0x4e4183){logger[_0xc006('0x12')](_0xc006('0xe'),_0x452eed,_0x4e4183);_0x3e011e(_0x4e4183);});});}exports['GetVoiceQueueReport']=function(_0x1aceca){var _0x1ff08b=this;return new Promise(function(_0x342bf6,_0x5a52e7){return db['VoiceQueueReport'][_0xc006('0x16')]({'raw':_0x1aceca['options']?_0x1aceca[_0xc006('0x17')][_0xc006('0x18')]===undefined?!![]:![]:!![],'where':_0x1aceca['options']?_0x1aceca['options']['where']||null:null,'attributes':_0x1aceca[_0xc006('0x17')]?_0x1aceca[_0xc006('0x17')][_0xc006('0x19')]||null:null,'limit':_0x1aceca[_0xc006('0x17')]?_0x1aceca['options']['limit']||null:null,'include':_0x1aceca[_0xc006('0x17')]?_0x1aceca[_0xc006('0x17')][_0xc006('0x1a')]?_[_0xc006('0x1b')](_0x1aceca[_0xc006('0x17')]['include'],function(_0x29604d){return{'model':db[_0x29604d[_0xc006('0x1c')]],'as':_0x29604d['as'],'attributes':_0x29604d[_0xc006('0x19')],'include':_0x29604d[_0xc006('0x1a')]?_[_0xc006('0x1b')](_0x29604d[_0xc006('0x1a')],function(_0x21189d){return{'model':db[_0x21189d[_0xc006('0x1c')]],'as':_0x21189d['as'],'attributes':_0x21189d['attributes'],'include':_0x21189d['include']?_['map'](_0x21189d['include'],function(_0x55cf12){return{'model':db[_0x55cf12[_0xc006('0x1c')]],'as':_0x55cf12['as'],'attributes':_0x55cf12[_0xc006('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc006('0xc')](function(_0x56970b){logger[_0xc006('0xd')](_0xc006('0x1d'),_0x1aceca);logger[_0xc006('0x1e')]('GetVoiceQueueReport',_0x1aceca,JSON[_0xc006('0x11')](_0x56970b));_0x342bf6(_0x56970b);})[_0xc006('0x15')](function(_0x46d0e8){logger[_0xc006('0x12')](_0xc006('0x1d'),_0x46d0e8['message'],_0x1aceca);_0x5a52e7(_0x1ff08b[_0xc006('0x12')](0x1f4,_0x46d0e8[_0xc006('0x13')]));});});};exports['CreateVoiceQueueReport']=function(_0x12cc6c){var _0x332131=this;return new Promise(function(_0x36730b,_0x23d0de){return db[_0xc006('0x1f')]['create'](_0x12cc6c['body'],{'raw':_0x12cc6c[_0xc006('0x17')]?_0x12cc6c['options'][_0xc006('0x18')]===undefined?!![]:![]:!![]})[_0xc006('0xc')](function(_0x40e381){logger['info']('CreateVoiceQueueReport',_0x12cc6c);logger['debug']('CreateVoiceQueueReport',_0x12cc6c,JSON[_0xc006('0x11')](_0x40e381));_0x36730b(_0x40e381);})[_0xc006('0x15')](function(_0xa83dfd){logger[_0xc006('0x12')](_0xc006('0x20'),_0xa83dfd['message'],_0x12cc6c);_0x23d0de(_0x332131[_0xc006('0x12')](0x1f4,_0xa83dfd['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x38d6d9){var _0x17a001=this;return new Promise(function(_0x5c2c45,_0x15f725){return db['VoiceQueueReport'][_0xc006('0x21')](_0x38d6d9['body'],{'raw':_0x38d6d9[_0xc006('0x17')]?_0x38d6d9[_0xc006('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38d6d9['options']?_0x38d6d9[_0xc006('0x17')][_0xc006('0x22')]||null:null,'attributes':_0x38d6d9[_0xc006('0x17')]?_0x38d6d9[_0xc006('0x17')]['attributes']||null:null,'limit':_0x38d6d9[_0xc006('0x17')]?_0x38d6d9[_0xc006('0x17')][_0xc006('0x23')]||null:null})['then'](function(_0x352916){logger['info'](_0xc006('0x24'),_0x38d6d9);logger[_0xc006('0x1e')](_0xc006('0x24'),_0x38d6d9,JSON['stringify'](_0x352916));_0x5c2c45(_0x352916);})[_0xc006('0x15')](function(_0x2daade){logger[_0xc006('0x12')](_0xc006('0x24'),_0x2daade['message'],_0x38d6d9);_0x15f725(_0x17a001[_0xc006('0x12')](0x1f4,_0x2daade['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f5eb1e3..b4e7277 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 _0x21f2=['length','save','remove','update','emit','removeListener','register'];(function(_0x577b56,_0x21e90c){var _0x20ae0d=function(_0x1df996){while(--_0x1df996){_0x577b56['push'](_0x577b56['shift']());}};_0x20ae0d(++_0x21e90c);}(_0x21f2,0x158));var _0x221f=function(_0x2a844c,_0x2a6bde){_0x2a844c=_0x2a844c-0x0;var _0x2a291a=_0x21f2[_0x2a844c];return _0x2a291a;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x221f('0x0'),_0x221f('0x1'),_0x221f('0x2')];function createListener(_0x2018be,_0x28631e){return function(_0x306a0f){_0x28631e[_0x221f('0x3')](_0x2018be,_0x306a0f);};}function removeListener(_0xa9e3b,_0x1e54e2){return function(){VoiceQueueReportEvents[_0x221f('0x4')](_0xa9e3b,_0x1e54e2);};}exports[_0x221f('0x5')]=function(_0x500757){for(var _0x3acd81=0x0,_0xc069ff=events[_0x221f('0x6')];_0x3acd81<_0xc069ff;_0x3acd81++){var _0x28768d=events[_0x3acd81];var _0x116c6c=createListener('voiceQueueReport:'+_0x28768d,_0x500757);VoiceQueueReportEvents['on'](_0x28768d,_0x116c6c);}}; \ No newline at end of file +var _0xa261=['remove','update','removeListener','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x40c73d,_0x427abc){var _0x2883ce=function(_0x39788a){while(--_0x39788a){_0x40c73d['push'](_0x40c73d['shift']());}};_0x2883ce(++_0x427abc);}(_0xa261,0x1a3));var _0x1a26=function(_0x1bc688,_0x5140a8){_0x1bc688=_0x1bc688-0x0;var _0x15055e=_0xa261[_0x1bc688];return _0x15055e;};'use strict';var VoiceQueueReportEvents=require(_0x1a26('0x0'));var events=['save',_0x1a26('0x1'),_0x1a26('0x2')];function createListener(_0x4010fc,_0x151055){return function(_0x698831){_0x151055['emit'](_0x4010fc,_0x698831);};}function removeListener(_0x52360d,_0x52a165){return function(){VoiceQueueReportEvents[_0x1a26('0x3')](_0x52360d,_0x52a165);};}exports[_0x1a26('0x4')]=function(_0x2dad90){for(var _0x392ee0=0x0,_0x120837=events['length'];_0x392ee0<_0x120837;_0x392ee0++){var _0x2dfa27=events[_0x392ee0];var _0x53064d=createListener(_0x1a26('0x5')+_0x2dfa27,_0x2dad90);VoiceQueueReportEvents['on'](_0x2dfa27,_0x53064d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index a5f004f..4f3966e 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 _0xa3d4=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path'];(function(_0x920ae3,_0x4652ef){var _0x19ea79=function(_0x4ce49f){while(--_0x4ce49f){_0x920ae3['push'](_0x920ae3['shift']());}};_0x19ea79(++_0x4652ef);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa3d4[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x4a3d('0x0'));var path=require(_0x4a3d('0x1'));var timeout=require(_0x4a3d('0x2'));var express=require('express');var router=express[_0x4a3d('0x3')]();var fs_extra=require(_0x4a3d('0x4'));var auth=require(_0x4a3d('0x5'));var interaction=require(_0x4a3d('0x6'));var config=require(_0x4a3d('0x7'));var controller=require(_0x4a3d('0x8'));router[_0x4a3d('0x9')]('/',auth[_0x4a3d('0xa')](),controller['index']);router[_0x4a3d('0x9')](_0x4a3d('0xb'),auth[_0x4a3d('0xa')](),controller[_0x4a3d('0xc')]);router[_0x4a3d('0xd')]('/',auth[_0x4a3d('0xa')](),controller[_0x4a3d('0xe')]);router[_0x4a3d('0xf')](_0x4a3d('0xb'),auth['isAuthenticated'](),controller[_0x4a3d('0x10')]);router[_0x4a3d('0x11')](_0x4a3d('0xb'),auth[_0x4a3d('0xa')](),controller[_0x4a3d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x89b9=['get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller'];(function(_0x55deaa,_0x31e06b){var _0x30864b=function(_0x205140){while(--_0x205140){_0x55deaa['push'](_0x55deaa['shift']());}};_0x30864b(++_0x31e06b);}(_0x89b9,0x17a));var _0x989b=function(_0x59dc6b,_0x175f0b){_0x59dc6b=_0x59dc6b-0x0;var _0xd58605=_0x89b9[_0x59dc6b];return _0xd58605;};'use strict';var multer=require(_0x989b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x989b('0x1')]();var fs_extra=require(_0x989b('0x2'));var auth=require(_0x989b('0x3'));var interaction=require(_0x989b('0x4'));var config=require('../../config/environment');var controller=require(_0x989b('0x5'));router[_0x989b('0x6')]('/',auth[_0x989b('0x7')](),controller['index']);router[_0x989b('0x6')]('/:id',auth[_0x989b('0x7')](),controller[_0x989b('0x8')]);router[_0x989b('0x9')]('/',auth[_0x989b('0x7')](),controller[_0x989b('0xa')]);router[_0x989b('0xb')](_0x989b('0xc'),auth[_0x989b('0x7')](),controller[_0x989b('0xd')]);router['delete'](_0x989b('0xc'),auth[_0x989b('0x7')](),controller[_0x989b('0xe')]);module[_0x989b('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7526c46..df447f1 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 _0x8be5=['moment','exports','STRING','DATE','literal','sequelize'];(function(_0x3014f1,_0x3dfb13){var _0x51b5da=function(_0x400603){while(--_0x400603){_0x3014f1['push'](_0x3014f1['shift']());}};_0x51b5da(++_0x3dfb13);}(_0x8be5,0x1e5));var _0x58be=function(_0x4e8bd5,_0x4f9b6e){_0x4e8bd5=_0x4e8bd5-0x0;var _0x303235=_0x8be5[_0x4e8bd5];return _0x303235;};'use strict';var Sequelize=require(_0x58be('0x0'));var moment=require(_0x58be('0x1'));module[_0x58be('0x2')]={'time':{'type':Sequelize[_0x58be('0x3')]},'callid':{'type':Sequelize[_0x58be('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x58be('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x58be('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x58be('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x58be('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x58be('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x58be('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x58be('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x58be('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x0a05=['sequelize','moment','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x0a05,0x12c));var _0x50a0=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x0a05[_0x39e164];return _0x13fa6b;};'use strict';var Sequelize=require(_0x50a0('0x0'));var moment=require(_0x50a0('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x50a0('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x50a0('0x4')](_0x50a0('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c020d27..b767daa 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 _0x11e4=['update','then','destroy','error','name','send','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','VoiceQueuesLog','include','show','keys','length','includeAll','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save'];(function(_0x2fdfa3,_0x1783ef){var _0x96527d=function(_0x30113e){while(--_0x30113e){_0x2fdfa3['push'](_0x2fdfa3['shift']());}};_0x96527d(++_0x1783ef);}(_0x11e4,0x147));var _0x411e=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x11e4[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x411e('0x0'));var zipdir=require(_0x411e('0x1'));var jsonpatch=require(_0x411e('0x2'));var rp=require(_0x411e('0x3'));var moment=require(_0x411e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x411e('0x5'));var util=require(_0x411e('0x6'));var path=require(_0x411e('0x7'));var sox=require('sox');var csv=require(_0x411e('0x8'));var ejs=require(_0x411e('0x9'));var fs=require('fs');var fs_extra=require(_0x411e('0xa'));var _=require(_0x411e('0xb'));var squel=require('squel');var crypto=require(_0x411e('0xc'));var jsforce=require(_0x411e('0xd'));var deskjs=require(_0x411e('0xe'));var toCsv=require(_0x411e('0x8'));var querystring=require(_0x411e('0xf'));var Papa=require(_0x411e('0x10'));var Redis=require('ioredis');var authService=require(_0x411e('0x11'));var qs=require(_0x411e('0x12'));var as=require(_0x411e('0x13'));var hardwareService=require(_0x411e('0x14'));var logger=require('../../config/logger')(_0x411e('0x15'));var utils=require(_0x411e('0x16'));var config=require(_0x411e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x411e('0x18'))['db'];function respondWithStatusCode(_0x2b2de4,_0x2bb4c4){_0x2bb4c4=_0x2bb4c4||0xcc;return function(_0x11acca){if(_0x11acca){return _0x2b2de4[_0x411e('0x19')](_0x2bb4c4);}return _0x2b2de4[_0x411e('0x1a')](_0x2bb4c4)[_0x411e('0x1b')]();};}function respondWithResult(_0x90791f,_0x7ec713){_0x7ec713=_0x7ec713||0xc8;return function(_0x14c582){if(_0x14c582){return _0x90791f[_0x411e('0x1a')](_0x7ec713)['json'](_0x14c582);}};}function respondWithFilteredResult(_0x6af0de,_0x5b7726){return function(_0x395a2c){if(_0x395a2c){var _0x42ce52=typeof _0x5b7726[_0x411e('0x1c')]==='undefined'&&typeof _0x5b7726[_0x411e('0x1d')]===_0x411e('0x1e');var _0x2c1e53=_0x395a2c[_0x411e('0x1f')];var _0x45dbb9=_0x42ce52?0x0:_0x5b7726['offset'];var _0x37c76f=_0x42ce52?_0x395a2c['count']:_0x5b7726[_0x411e('0x1c')]+_0x5b7726[_0x411e('0x1d')];var _0x4bf94f;if(_0x37c76f>=_0x2c1e53){_0x37c76f=_0x2c1e53;_0x4bf94f=0xc8;}else{_0x4bf94f=0xce;}_0x6af0de[_0x411e('0x1a')](_0x4bf94f);return _0x6af0de[_0x411e('0x20')](_0x411e('0x21'),_0x45dbb9+'-'+_0x37c76f+'/'+_0x2c1e53)[_0x411e('0x22')](_0x395a2c);}return null;};}function patchUpdates(_0x362de9){return function(_0x34ceb3){try{jsonpatch[_0x411e('0x23')](_0x34ceb3,_0x362de9,!![]);}catch(_0x3009f6){return BPromise[_0x411e('0x24')](_0x3009f6);}return _0x34ceb3[_0x411e('0x25')]();};}function saveUpdates(_0x52a218,_0x24ac9a){return function(_0x2d494d){if(_0x2d494d){return _0x2d494d[_0x411e('0x26')](_0x52a218)[_0x411e('0x27')](function(_0xd58414){return _0xd58414;});}return null;};}function removeEntity(_0xc7bbd4,_0x26110a){return function(_0x36a8a8){if(_0x36a8a8){return _0x36a8a8[_0x411e('0x28')]()[_0x411e('0x27')](function(){_0xc7bbd4[_0x411e('0x1a')](0xcc)[_0x411e('0x1b')]();});}};}function handleEntityNotFound(_0x5507ae,_0x3b9594){return function(_0xf2c96c){if(!_0xf2c96c){_0x5507ae[_0x411e('0x19')](0x194);}return _0xf2c96c;};}function handleError(_0x4b68a9,_0x8c828a){_0x8c828a=_0x8c828a||0x1f4;return function(_0x1ff02f){logger[_0x411e('0x29')](_0x1ff02f['stack']);if(_0x1ff02f['name']){delete _0x1ff02f[_0x411e('0x2a')];}_0x4b68a9[_0x411e('0x1a')](_0x8c828a)[_0x411e('0x2b')](_0x1ff02f);};}exports[_0x411e('0x2c')]=function(_0x1fbcbb,_0x541f30){var _0x2dd8a3={},_0x123f9f={},_0x3ccd3={'count':0x0,'rows':[]};var _0x3f4e33=_['map'](db['VoiceQueuesLog'][_0x411e('0x2d')],function(_0xdd5edc){return{'name':_0xdd5edc['fieldName'],'type':_0xdd5edc[_0x411e('0x2e')][_0x411e('0x2f')]};});_0x123f9f['model']=_[_0x411e('0x30')](_0x3f4e33,'name');_0x123f9f['query']=_['keys'](_0x1fbcbb[_0x411e('0x31')]);_0x123f9f[_0x411e('0x32')]=_[_0x411e('0x33')](_0x123f9f[_0x411e('0x34')],_0x123f9f[_0x411e('0x31')]);_0x2dd8a3[_0x411e('0x35')]=_[_0x411e('0x33')](_0x123f9f[_0x411e('0x34')],qs['fields'](_0x1fbcbb[_0x411e('0x31')]['fields']));_0x2dd8a3[_0x411e('0x35')]=_0x2dd8a3[_0x411e('0x35')]['length']?_0x2dd8a3['attributes']:_0x123f9f[_0x411e('0x34')];if(!_0x1fbcbb['query'][_0x411e('0x36')](_0x411e('0x37'))){_0x2dd8a3[_0x411e('0x1d')]=qs[_0x411e('0x1d')](_0x1fbcbb[_0x411e('0x31')][_0x411e('0x1d')]);_0x2dd8a3[_0x411e('0x1c')]=qs['offset'](_0x1fbcbb[_0x411e('0x31')][_0x411e('0x1c')]);}_0x2dd8a3['order']=qs['sort'](_0x1fbcbb[_0x411e('0x31')][_0x411e('0x38')]);_0x2dd8a3[_0x411e('0x39')]=qs['filters'](_['pick'](_0x1fbcbb[_0x411e('0x31')],_0x123f9f[_0x411e('0x32')]),_0x3f4e33);if(_0x1fbcbb[_0x411e('0x31')][_0x411e('0x3a')]){_0x2dd8a3[_0x411e('0x39')]=_[_0x411e('0x3b')](_0x2dd8a3[_0x411e('0x39')],{'$or':_[_0x411e('0x30')](_0x3f4e33,function(_0x2333d2){if(_0x2333d2[_0x411e('0x2e')]!==_0x411e('0x3c')){var _0x20efe3={};_0x20efe3[_0x2333d2[_0x411e('0x2a')]]={'$like':'%'+_0x1fbcbb[_0x411e('0x31')][_0x411e('0x3a')]+'%'};return _0x20efe3;}})});}_0x2dd8a3=_[_0x411e('0x3b')]({},_0x2dd8a3,_0x1fbcbb[_0x411e('0x3d')]);var _0x3660ff={'where':_0x2dd8a3[_0x411e('0x39')]};return db[_0x411e('0x3e')]['count'](_0x3660ff)['then'](function(_0x52a26c){_0x3ccd3['count']=_0x52a26c;if(_0x1fbcbb['query']['includeAll']){_0x2dd8a3[_0x411e('0x3f')]=[{'all':!![]}];}return db[_0x411e('0x3e')]['findAll'](_0x2dd8a3);})[_0x411e('0x27')](function(_0x248306){_0x3ccd3['rows']=_0x248306;return _0x3ccd3;})[_0x411e('0x27')](respondWithFilteredResult(_0x541f30,_0x2dd8a3))['catch'](handleError(_0x541f30,null));};exports[_0x411e('0x40')]=function(_0x4d9ecd,_0x18e8fd){var _0x4936c8={'raw':!![],'where':{'id':_0x4d9ecd['params']['id']}},_0x184447={};_0x184447[_0x411e('0x34')]=_[_0x411e('0x41')](db[_0x411e('0x3e')][_0x411e('0x2d')]);_0x184447['query']=_['keys'](_0x4d9ecd[_0x411e('0x31')]);_0x184447[_0x411e('0x32')]=_['intersection'](_0x184447[_0x411e('0x34')],_0x184447[_0x411e('0x31')]);_0x4936c8[_0x411e('0x35')]=_[_0x411e('0x33')](_0x184447['model'],qs['fields'](_0x4d9ecd[_0x411e('0x31')]['fields']));_0x4936c8['attributes']=_0x4936c8[_0x411e('0x35')][_0x411e('0x42')]?_0x4936c8['attributes']:_0x184447[_0x411e('0x34')];if(_0x4d9ecd[_0x411e('0x31')][_0x411e('0x43')]){_0x4936c8[_0x411e('0x3f')]=[{'all':!![]}];}_0x4936c8=_[_0x411e('0x3b')]({},_0x4936c8,_0x4d9ecd[_0x411e('0x3d')]);return db[_0x411e('0x3e')][_0x411e('0x44')](_0x4936c8)[_0x411e('0x27')](handleEntityNotFound(_0x18e8fd,null))[_0x411e('0x27')](respondWithResult(_0x18e8fd,null))[_0x411e('0x45')](handleError(_0x18e8fd,null));};exports[_0x411e('0x46')]=function(_0x3738a6,_0x3dde7d){return db[_0x411e('0x3e')]['create'](_0x3738a6[_0x411e('0x47')],{})[_0x411e('0x27')](respondWithResult(_0x3dde7d,0xc9))['catch'](handleError(_0x3dde7d,null));};exports[_0x411e('0x26')]=function(_0x154a38,_0x4fd8fc){if(_0x154a38[_0x411e('0x47')]['id']){delete _0x154a38['body']['id'];}return db[_0x411e('0x3e')][_0x411e('0x44')]({'where':{'id':_0x154a38[_0x411e('0x48')]['id']}})[_0x411e('0x27')](handleEntityNotFound(_0x4fd8fc,null))[_0x411e('0x27')](saveUpdates(_0x154a38[_0x411e('0x47')],null))[_0x411e('0x27')](respondWithResult(_0x4fd8fc,null))[_0x411e('0x45')](handleError(_0x4fd8fc,null));};exports[_0x411e('0x28')]=function(_0x1a9980,_0x19bc6c){return db['VoiceQueuesLog'][_0x411e('0x44')]({'where':{'id':_0x1a9980['params']['id']}})['then'](handleEntityNotFound(_0x19bc6c,null))[_0x411e('0x27')](removeEntity(_0x19bc6c,null))['catch'](handleError(_0x19bc6c,null));}; \ No newline at end of file +var _0x7712=['name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack'];(function(_0x26b308,_0x397dfc){var _0x59478d=function(_0x20b4c4){while(--_0x20b4c4){_0x26b308['push'](_0x26b308['shift']());}};_0x59478d(++_0x397dfc);}(_0x7712,0xbb));var _0x2771=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7712[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2771('0x0'));var zipdir=require(_0x2771('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2771('0x2'));var moment=require(_0x2771('0x3'));var BPromise=require(_0x2771('0x4'));var Mustache=require(_0x2771('0x5'));var util=require(_0x2771('0x6'));var path=require(_0x2771('0x7'));var sox=require(_0x2771('0x8'));var csv=require(_0x2771('0x9'));var ejs=require(_0x2771('0xa'));var fs=require('fs');var fs_extra=require(_0x2771('0xb'));var _=require(_0x2771('0xc'));var squel=require(_0x2771('0xd'));var crypto=require(_0x2771('0xe'));var jsforce=require(_0x2771('0xf'));var deskjs=require(_0x2771('0x10'));var toCsv=require(_0x2771('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2771('0x11'));var authService=require(_0x2771('0x12'));var qs=require(_0x2771('0x13'));var as=require(_0x2771('0x14'));var hardwareService=require(_0x2771('0x15'));var logger=require(_0x2771('0x16'))(_0x2771('0x17'));var utils=require('../../config/utils');var config=require(_0x2771('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2771('0x19'))['db'];function respondWithStatusCode(_0x1c04e6,_0x651377){_0x651377=_0x651377||0xcc;return function(_0x139a2b){if(_0x139a2b){return _0x1c04e6['sendStatus'](_0x651377);}return _0x1c04e6['status'](_0x651377)['end']();};}function respondWithResult(_0x1042c9,_0x61fca0){_0x61fca0=_0x61fca0||0xc8;return function(_0x9dea16){if(_0x9dea16){return _0x1042c9[_0x2771('0x1a')](_0x61fca0)[_0x2771('0x1b')](_0x9dea16);}};}function respondWithFilteredResult(_0xc971bd,_0x552b57){return function(_0x290e83){if(_0x290e83){var _0x41e469=typeof _0x552b57[_0x2771('0x1c')]===_0x2771('0x1d')&&typeof _0x552b57[_0x2771('0x1e')]===_0x2771('0x1d');var _0x83336c=_0x290e83[_0x2771('0x1f')];var _0x398062=_0x41e469?0x0:_0x552b57[_0x2771('0x1c')];var _0x58d3dc=_0x41e469?_0x290e83['count']:_0x552b57[_0x2771('0x1c')]+_0x552b57[_0x2771('0x1e')];var _0x149d99;if(_0x58d3dc>=_0x83336c){_0x58d3dc=_0x83336c;_0x149d99=0xc8;}else{_0x149d99=0xce;}_0xc971bd['status'](_0x149d99);return _0xc971bd['set'](_0x2771('0x20'),_0x398062+'-'+_0x58d3dc+'/'+_0x83336c)['json'](_0x290e83);}return null;};}function patchUpdates(_0x628a49){return function(_0x351f7f){try{jsonpatch[_0x2771('0x21')](_0x351f7f,_0x628a49,!![]);}catch(_0x3c8ddd){return BPromise[_0x2771('0x22')](_0x3c8ddd);}return _0x351f7f[_0x2771('0x23')]();};}function saveUpdates(_0x562376,_0x2a50dd){return function(_0x2dcc02){if(_0x2dcc02){return _0x2dcc02[_0x2771('0x24')](_0x562376)[_0x2771('0x25')](function(_0x59aa38){return _0x59aa38;});}return null;};}function removeEntity(_0x1b5055,_0x3990dd){return function(_0x12a971){if(_0x12a971){return _0x12a971[_0x2771('0x26')]()[_0x2771('0x25')](function(){_0x1b5055[_0x2771('0x1a')](0xcc)[_0x2771('0x27')]();});}};}function handleEntityNotFound(_0x3a7868,_0x369316){return function(_0x416853){if(!_0x416853){_0x3a7868['sendStatus'](0x194);}return _0x416853;};}function handleError(_0xfc652a,_0x3e6054){_0x3e6054=_0x3e6054||0x1f4;return function(_0x340d07){logger['error'](_0x340d07[_0x2771('0x28')]);if(_0x340d07[_0x2771('0x29')]){delete _0x340d07[_0x2771('0x29')];}_0xfc652a['status'](_0x3e6054)[_0x2771('0x2a')](_0x340d07);};}exports[_0x2771('0x2b')]=function(_0x51a56f,_0x8be12e){var _0x51f191={},_0x4a7bd1={},_0x1d2836={'count':0x0,'rows':[]};var _0x52c9b9=_[_0x2771('0x2c')](db[_0x2771('0x2d')][_0x2771('0x2e')],function(_0x48924e){return{'name':_0x48924e[_0x2771('0x2f')],'type':_0x48924e['type']['key']};});_0x4a7bd1[_0x2771('0x30')]=_[_0x2771('0x2c')](_0x52c9b9,_0x2771('0x29'));_0x4a7bd1[_0x2771('0x31')]=_['keys'](_0x51a56f[_0x2771('0x31')]);_0x4a7bd1['filters']=_['intersection'](_0x4a7bd1[_0x2771('0x30')],_0x4a7bd1[_0x2771('0x31')]);_0x51f191['attributes']=_[_0x2771('0x32')](_0x4a7bd1[_0x2771('0x30')],qs[_0x2771('0x33')](_0x51a56f[_0x2771('0x31')]['fields']));_0x51f191[_0x2771('0x34')]=_0x51f191['attributes'][_0x2771('0x35')]?_0x51f191[_0x2771('0x34')]:_0x4a7bd1[_0x2771('0x30')];if(!_0x51a56f['query'][_0x2771('0x36')](_0x2771('0x37'))){_0x51f191[_0x2771('0x1e')]=qs[_0x2771('0x1e')](_0x51a56f[_0x2771('0x31')][_0x2771('0x1e')]);_0x51f191[_0x2771('0x1c')]=qs[_0x2771('0x1c')](_0x51a56f[_0x2771('0x31')][_0x2771('0x1c')]);}_0x51f191[_0x2771('0x38')]=qs[_0x2771('0x39')](_0x51a56f[_0x2771('0x31')][_0x2771('0x39')]);_0x51f191[_0x2771('0x3a')]=qs[_0x2771('0x3b')](_[_0x2771('0x3c')](_0x51a56f[_0x2771('0x31')],_0x4a7bd1[_0x2771('0x3b')]),_0x52c9b9);if(_0x51a56f['query'][_0x2771('0x3d')]){_0x51f191[_0x2771('0x3a')]=_['merge'](_0x51f191['where'],{'$or':_[_0x2771('0x2c')](_0x52c9b9,function(_0x3431b2){if(_0x3431b2[_0x2771('0x3e')]!=='VIRTUAL'){var _0x4a01e8={};_0x4a01e8[_0x3431b2['name']]={'$like':'%'+_0x51a56f[_0x2771('0x31')][_0x2771('0x3d')]+'%'};return _0x4a01e8;}})});}_0x51f191=_[_0x2771('0x3f')]({},_0x51f191,_0x51a56f[_0x2771('0x40')]);var _0x6f627a={'where':_0x51f191['where']};return db[_0x2771('0x2d')][_0x2771('0x1f')](_0x6f627a)[_0x2771('0x25')](function(_0x307943){_0x1d2836[_0x2771('0x1f')]=_0x307943;if(_0x51a56f[_0x2771('0x31')][_0x2771('0x41')]){_0x51f191[_0x2771('0x42')]=[{'all':!![]}];}return db[_0x2771('0x2d')][_0x2771('0x43')](_0x51f191);})['then'](function(_0x17a5eb){_0x1d2836[_0x2771('0x44')]=_0x17a5eb;return _0x1d2836;})['then'](respondWithFilteredResult(_0x8be12e,_0x51f191))[_0x2771('0x45')](handleError(_0x8be12e,null));};exports[_0x2771('0x46')]=function(_0x21dd99,_0x31c7af){var _0x1d2f96={'raw':!![],'where':{'id':_0x21dd99[_0x2771('0x47')]['id']}},_0x563760={};_0x563760[_0x2771('0x30')]=_[_0x2771('0x48')](db['VoiceQueuesLog'][_0x2771('0x2e')]);_0x563760['query']=_[_0x2771('0x48')](_0x21dd99['query']);_0x563760[_0x2771('0x3b')]=_[_0x2771('0x32')](_0x563760[_0x2771('0x30')],_0x563760[_0x2771('0x31')]);_0x1d2f96[_0x2771('0x34')]=_[_0x2771('0x32')](_0x563760[_0x2771('0x30')],qs[_0x2771('0x33')](_0x21dd99[_0x2771('0x31')][_0x2771('0x33')]));_0x1d2f96[_0x2771('0x34')]=_0x1d2f96[_0x2771('0x34')][_0x2771('0x35')]?_0x1d2f96['attributes']:_0x563760[_0x2771('0x30')];if(_0x21dd99['query'][_0x2771('0x41')]){_0x1d2f96[_0x2771('0x42')]=[{'all':!![]}];}_0x1d2f96=_[_0x2771('0x3f')]({},_0x1d2f96,_0x21dd99[_0x2771('0x40')]);return db[_0x2771('0x2d')][_0x2771('0x49')](_0x1d2f96)[_0x2771('0x25')](handleEntityNotFound(_0x31c7af,null))[_0x2771('0x25')](respondWithResult(_0x31c7af,null))[_0x2771('0x45')](handleError(_0x31c7af,null));};exports['create']=function(_0x2e6d72,_0x55aefb){return db['VoiceQueuesLog'][_0x2771('0x4a')](_0x2e6d72[_0x2771('0x4b')],{})[_0x2771('0x25')](respondWithResult(_0x55aefb,0xc9))['catch'](handleError(_0x55aefb,null));};exports[_0x2771('0x24')]=function(_0x3236fb,_0x53e606){if(_0x3236fb[_0x2771('0x4b')]['id']){delete _0x3236fb[_0x2771('0x4b')]['id'];}return db[_0x2771('0x2d')][_0x2771('0x49')]({'where':{'id':_0x3236fb[_0x2771('0x47')]['id']}})[_0x2771('0x25')](handleEntityNotFound(_0x53e606,null))['then'](saveUpdates(_0x3236fb[_0x2771('0x4b')],null))['then'](respondWithResult(_0x53e606,null))[_0x2771('0x45')](handleError(_0x53e606,null));};exports['destroy']=function(_0x297d63,_0x57235c){return db[_0x2771('0x2d')]['find']({'where':{'id':_0x297d63[_0x2771('0x47')]['id']}})[_0x2771('0x25')](handleEntityNotFound(_0x57235c,null))[_0x2771('0x25')](removeEntity(_0x57235c,null))[_0x2771('0x45')](handleError(_0x57235c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 33281c2..5b3f48e 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 _0xd9ea=['voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog'];(function(_0x371fe5,_0x4e7be4){var _0x479303=function(_0x45926c){while(--_0x45926c){_0x371fe5['push'](_0x371fe5['shift']());}};_0x479303(++_0x4e7be4);}(_0xd9ea,0x1c6));var _0xad9e=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0xd9ea[_0x786e9];return _0x1f891b;};'use strict';var _=require(_0xad9e('0x0'));var util=require(_0xad9e('0x1'));var logger=require('../../config/logger')(_0xad9e('0x2'));var moment=require(_0xad9e('0x3'));var BPromise=require(_0xad9e('0x4'));var rp=require(_0xad9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad9e('0x6'));var attributes=require(_0xad9e('0x7'));module[_0xad9e('0x8')]=function(_0x4f80f8,_0x1fff5c){return _0x4f80f8[_0xad9e('0x9')](_0xad9e('0xa'),attributes,{'tableName':_0xad9e('0xb'),'paranoid':![],'indexes':[{'name':_0xad9e('0xc'),'fields':[_0xad9e('0xd'),_0xad9e('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2b55=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x2f5784,_0x75ac1c){var _0x2ff0fd=function(_0xe6bce0){while(--_0xe6bce0){_0x2f5784['push'](_0x2f5784['shift']());}};_0x2ff0fd(++_0x75ac1c);}(_0x2b55,0x1f0));var _0x52b5=function(_0x25009f,_0x1d6a9f){_0x25009f=_0x25009f-0x0;var _0x5c16a6=_0x2b55[_0x25009f];return _0x5c16a6;};'use strict';var _=require(_0x52b5('0x0'));var util=require(_0x52b5('0x1'));var logger=require(_0x52b5('0x2'))('api');var moment=require(_0x52b5('0x3'));var BPromise=require(_0x52b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52b5('0x5'));var rimraf=require(_0x52b5('0x6'));var config=require(_0x52b5('0x7'));var attributes=require(_0x52b5('0x8'));module[_0x52b5('0x9')]=function(_0x54eb44,_0xd1f017){return _0x54eb44[_0x52b5('0xa')](_0x52b5('0xb'),attributes,{'tableName':_0x52b5('0xc'),'paranoid':![],'indexes':[{'name':_0x52b5('0xd'),'fields':[_0x52b5('0xe'),_0x52b5('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 7f5a91a..a71ffec 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 _0x0e39=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x56d75a,_0x59c7cc){var _0x4b1e73=function(_0x12dede){while(--_0x12dede){_0x56d75a['push'](_0x56d75a['shift']());}};_0x4b1e73(++_0x59c7cc);}(_0x0e39,0x1f3));var _0x90e3=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0x0e39[_0x380016];return _0x5c7ac0;};'use strict';var _=require(_0x90e3('0x0'));var util=require('util');var moment=require(_0x90e3('0x1'));var BPromise=require(_0x90e3('0x2'));var rs=require(_0x90e3('0x3'));var fs=require('fs');var Redis=require(_0x90e3('0x4'));var db=require(_0x90e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x90e3('0x6'))(_0x90e3('0x7'));var config=require(_0x90e3('0x8'));var jayson=require(_0x90e3('0x9'));var client=jayson[_0x90e3('0xa')][_0x90e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c91e2,_0x39a2d4,_0x590383){return new BPromise(function(_0x2a1f49,_0xd9180b){return client[_0x90e3('0xc')](_0x3c91e2,_0x590383)[_0x90e3('0xd')](function(_0x40e74e){logger[_0x90e3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x39a2d4,_0x90e3('0xf'));logger[_0x90e3('0x10')](_0x90e3('0x11'),_0x39a2d4,'request\x20sent',JSON[_0x90e3('0x12')](_0x40e74e));if(_0x40e74e[_0x90e3('0x13')]){if(_0x40e74e[_0x90e3('0x13')][_0x90e3('0x14')]===0x1f4){logger[_0x90e3('0x13')](_0x90e3('0x15'),_0x39a2d4,_0x40e74e['error'][_0x90e3('0x16')]);return _0xd9180b(_0x40e74e['error'][_0x90e3('0x16')]);}logger[_0x90e3('0x13')](_0x90e3('0x15'),_0x39a2d4,_0x40e74e[_0x90e3('0x13')][_0x90e3('0x16')]);return _0x2a1f49(_0x40e74e[_0x90e3('0x13')]['message']);}else{logger[_0x90e3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x39a2d4,_0x90e3('0xf'));_0x2a1f49(_0x40e74e[_0x90e3('0x17')][_0x90e3('0x16')]);}})[_0x90e3('0x18')](function(_0x1e1642){logger[_0x90e3('0x13')](_0x90e3('0x15'),_0x39a2d4,_0x1e1642);_0xd9180b(_0x1e1642);});});} \ No newline at end of file +var _0xc3fe=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xc3fe,0xff));var _0xec3f=function(_0x5be58b,_0xdfeb83){_0x5be58b=_0x5be58b-0x0;var _0x50c17e=_0xc3fe[_0x5be58b];return _0x50c17e;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0b84,_0x526183,_0x503775){return new BPromise(function(_0xcb8557,_0x5df7fc){return client[_0xec3f('0xa')](_0x3b0b84,_0x503775)[_0xec3f('0xb')](function(_0x12a7c5){logger[_0xec3f('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));logger[_0xec3f('0xe')](_0xec3f('0xf'),_0x526183,_0xec3f('0xd'),JSON[_0xec3f('0x10')](_0x12a7c5));if(_0x12a7c5[_0xec3f('0x11')]){if(_0x12a7c5['error'][_0xec3f('0x12')]===0x1f4){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0x12a7c5['error']['message']);return _0x5df7fc(_0x12a7c5[_0xec3f('0x11')]['message']);}logger['error'](_0xec3f('0x13'),_0x526183,_0x12a7c5[_0xec3f('0x11')][_0xec3f('0x14')]);return _0xcb8557(_0x12a7c5['error']['message']);}else{logger[_0xec3f('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));_0xcb8557(_0x12a7c5[_0xec3f('0x15')]['message']);}})[_0xec3f('0x16')](function(_0xb8ee6f){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0xb8ee6f);_0x5df7fc(_0xb8ee6f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index fe278f1..a91b0c6 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 _0xb1b2=['get','/:id/download','download','downloads','downloadTranscribe','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xb1b2,0xf2));var _0x2b1b=function(_0x4bc52c,_0x20df54){_0x4bc52c=_0x4bc52c-0x0;var _0x3f01a0=_0xb1b2[_0x4bc52c];return _0x3f01a0;};'use strict';var multer=require(_0x2b1b('0x0'));var util=require(_0x2b1b('0x1'));var path=require(_0x2b1b('0x2'));var timeout=require('connect-timeout');var express=require(_0x2b1b('0x3'));var router=express['Router']();var fs_extra=require(_0x2b1b('0x4'));var auth=require(_0x2b1b('0x5'));var interaction=require(_0x2b1b('0x6'));var config=require(_0x2b1b('0x7'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x2b1b('0x8')](),controller['index']);router['get'](_0x2b1b('0x9'),auth[_0x2b1b('0x8')](),controller[_0x2b1b('0xa')]);router[_0x2b1b('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x2b1b('0xc'),auth['isAuthenticated'](),controller[_0x2b1b('0xd')]);router[_0x2b1b('0xb')]('/:id/downloads',controller[_0x2b1b('0xe')]);router[_0x2b1b('0xb')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x2b1b('0xf')]);router[_0x2b1b('0x10')]('/',auth[_0x2b1b('0x8')](),controller[_0x2b1b('0x11')]);router['post']('/:id/transcribe',auth[_0x2b1b('0x8')](),controller['runTranscribe']);router['put'](_0x2b1b('0x12'),auth['isAuthenticated'](),controller[_0x2b1b('0x13')]);router[_0x2b1b('0x14')](_0x2b1b('0x12'),auth['isAuthenticated'](),controller[_0x2b1b('0x15')]);module[_0x2b1b('0x16')]=router; \ No newline at end of file +var _0xe724=['./voiceRecording.controller','/describe','isAuthenticated','describe','/:id','show','get','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x120f54,_0x402107){var _0x2e6297=function(_0x1ca170){while(--_0x1ca170){_0x120f54['push'](_0x120f54['shift']());}};_0x2e6297(++_0x402107);}(_0xe724,0x160));var _0x4e72=function(_0x430f44,_0x4ae21b){_0x430f44=_0x430f44-0x0;var _0x1f6b0f=_0xe724[_0x430f44];return _0x1f6b0f;};'use strict';var multer=require(_0x4e72('0x0'));var util=require(_0x4e72('0x1'));var path=require(_0x4e72('0x2'));var timeout=require(_0x4e72('0x3'));var express=require(_0x4e72('0x4'));var router=express[_0x4e72('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4e72('0x6'));var config=require(_0x4e72('0x7'));var controller=require(_0x4e72('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4e72('0x9'),auth[_0x4e72('0xa')](),controller[_0x4e72('0xb')]);router['get'](_0x4e72('0xc'),auth['isAuthenticated'](),controller[_0x4e72('0xd')]);router[_0x4e72('0xe')](_0x4e72('0xf'),auth[_0x4e72('0xa')](),controller[_0x4e72('0x10')]);router['get']('/:id/downloads',controller[_0x4e72('0x11')]);router['get'](_0x4e72('0x12'),auth[_0x4e72('0xa')](),controller[_0x4e72('0x13')]);router[_0x4e72('0x14')]('/',auth[_0x4e72('0xa')](),controller['create']);router['post'](_0x4e72('0x12'),auth[_0x4e72('0xa')](),controller[_0x4e72('0x15')]);router['put']('/:id',auth[_0x4e72('0xa')](),controller[_0x4e72('0x16')]);router['delete'](_0x4e72('0xc'),auth[_0x4e72('0xa')](),controller['destroy']);module[_0x4e72('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index e0f6c83..fea0e45 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 c7365ba..838897f 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 _0x51c9=['runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','differenceBy','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','then','includeAll','include','VoiceRecording','rows','catch','show','fields','find','create','body','params','describe','value','format','%s.cypher','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','uniqueid','token','$and','push','existsSync','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','language','Transcribe\x20not\x20configured'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x51c9,0x159));var _0x951c=function(_0x5bcd5b,_0x515e40){_0x5bcd5b=_0x5bcd5b-0x0;var _0x4b5d4d=_0x51c9[_0x5bcd5b];return _0x4b5d4d;};'use strict';var emlformat=require(_0x951c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x951c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x951c('0x2'));var moment=require(_0x951c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x951c('0x4'));var util=require('util');var path=require(_0x951c('0x5'));var sox=require(_0x951c('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x951c('0x7'));var _=require(_0x951c('0x8'));var squel=require(_0x951c('0x9'));var crypto=require(_0x951c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x951c('0xb'));var toCsv=require(_0x951c('0xc'));var querystring=require(_0x951c('0xd'));var Papa=require(_0x951c('0xe'));var AWS=require(_0x951c('0xf'));var uuidv4=require(_0x951c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x951c('0x11'));var as=require(_0x951c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x951c('0x13'))(_0x951c('0x14'));var utils=require('../../config/utils');var config=require(_0x951c('0x15'));var licenseUtil=require(_0x951c('0x16'));var db=require(_0x951c('0x17'))['db'];function respondWithStatusCode(_0x3bbc47,_0x4f0a1b){_0x4f0a1b=_0x4f0a1b||0xcc;return function(_0x2a6cac){if(_0x2a6cac){return _0x3bbc47[_0x951c('0x18')](_0x4f0a1b);}return _0x3bbc47['status'](_0x4f0a1b)[_0x951c('0x19')]();};}function respondWithResult(_0x2abbd7,_0x364fa8){_0x364fa8=_0x364fa8||0xc8;return function(_0x587845){if(_0x587845){return _0x2abbd7['status'](_0x364fa8)[_0x951c('0x1a')](_0x587845);}};}function respondWithFilteredResult(_0xd03471,_0x37f4e0){return function(_0x202c8e){if(_0x202c8e){var _0x2bf953=typeof _0x37f4e0[_0x951c('0x1b')]===_0x951c('0x1c')&&typeof _0x37f4e0['limit']===_0x951c('0x1c');var _0x9454e7=_0x202c8e[_0x951c('0x1d')];var _0x23916c=_0x2bf953?0x0:_0x37f4e0[_0x951c('0x1b')];var _0x58b1d9=_0x2bf953?_0x202c8e['count']:_0x37f4e0[_0x951c('0x1b')]+_0x37f4e0[_0x951c('0x1e')];var _0x33b9d2;if(_0x58b1d9>=_0x9454e7){_0x58b1d9=_0x9454e7;_0x33b9d2=0xc8;}else{_0x33b9d2=0xce;}_0xd03471[_0x951c('0x1f')](_0x33b9d2);return _0xd03471[_0x951c('0x20')](_0x951c('0x21'),_0x23916c+'-'+_0x58b1d9+'/'+_0x9454e7)['json'](_0x202c8e);}return null;};}function patchUpdates(_0x46fe00){return function(_0x5a2ed7){try{jsonpatch[_0x951c('0x22')](_0x5a2ed7,_0x46fe00,!![]);}catch(_0x5344bd){return BPromise[_0x951c('0x23')](_0x5344bd);}return _0x5a2ed7[_0x951c('0x24')]();};}function saveUpdates(_0x38ead0,_0x37527a){return function(_0x123148){if(_0x123148){return _0x123148[_0x951c('0x25')](_0x38ead0)['then'](function(_0x41a972){return _0x41a972;});}return null;};}function removeEntity(_0x195ef6,_0x383fbd){return function(_0xfa86c2){if(_0xfa86c2){return _0xfa86c2[_0x951c('0x26')]()['then'](function(){_0x195ef6[_0x951c('0x1f')](0xcc)[_0x951c('0x19')]();});}};}function handleEntityNotFound(_0x4ebe91,_0x2cb0cf){return function(_0x2ce677){if(!_0x2ce677){_0x4ebe91[_0x951c('0x18')](0x194);}return _0x2ce677;};}function handleError(_0x56fb21,_0x8ea41){_0x8ea41=_0x8ea41||0x1f4;return function(_0x5812ff){logger[_0x951c('0x27')](_0x5812ff[_0x951c('0x28')]);if(_0x5812ff[_0x951c('0x29')]){delete _0x5812ff['name'];}_0x56fb21[_0x951c('0x1f')](_0x8ea41)['send'](_0x5812ff);};}exports[_0x951c('0x2a')]=function(_0x21661d,_0x4799aa){var _0x33abb1={},_0xd577be={},_0x2f3038={'count':0x0,'rows':[]};var _0x27823e=_[_0x951c('0x2b')](db['VoiceRecording'][_0x951c('0x2c')],function(_0x57d0e9){return{'name':_0x57d0e9[_0x951c('0x2d')],'type':_0x57d0e9[_0x951c('0x2e')]['key']};});_0xd577be[_0x951c('0x2f')]=_[_0x951c('0x30')](_[_0x951c('0x2b')](_0x27823e,_0x951c('0x29')),['format']);_0xd577be['query']=_[_0x951c('0x31')](_0x21661d['query']);_0xd577be[_0x951c('0x32')]=_[_0x951c('0x33')](_0xd577be[_0x951c('0x2f')],_0xd577be[_0x951c('0x34')]);_0x33abb1[_0x951c('0x35')]=_[_0x951c('0x33')](_0xd577be['model'],qs['fields'](_0x21661d['query']['fields']));_0x33abb1[_0x951c('0x35')]=_0x33abb1[_0x951c('0x35')][_0x951c('0x36')]?_0x33abb1[_0x951c('0x35')]:_0xd577be[_0x951c('0x2f')];if(!_0x21661d[_0x951c('0x34')][_0x951c('0x37')](_0x951c('0x38'))){_0x33abb1[_0x951c('0x1e')]=qs[_0x951c('0x1e')](_0x21661d['query'][_0x951c('0x1e')]);_0x33abb1[_0x951c('0x1b')]=qs[_0x951c('0x1b')](_0x21661d['query']['offset']);}_0x33abb1['order']=qs['sort'](_0x21661d['query'][_0x951c('0x39')]);_0x33abb1[_0x951c('0x3a')]=qs[_0x951c('0x32')](_['pick'](_0x21661d[_0x951c('0x34')],_0xd577be['filters']),_0x27823e);if(_0x21661d[_0x951c('0x34')][_0x951c('0x3b')]){_0x33abb1['where']=_['merge'](_0x33abb1[_0x951c('0x3a')],{'$or':_[_0x951c('0x2b')](_0x27823e,function(_0x408e6d){if(_0x408e6d['type']!==_0x951c('0x3c')){var _0x14ccbc={};_0x14ccbc[_0x408e6d[_0x951c('0x29')]]={'$like':'%'+_0x21661d[_0x951c('0x34')][_0x951c('0x3b')]+'%'};return _0x14ccbc;}})});}_0x33abb1=_[_0x951c('0x3d')]({},_0x33abb1,_0x21661d[_0x951c('0x3e')]);var _0x298e67={'where':_0x33abb1[_0x951c('0x3a')]};return db['VoiceRecording']['count'](_0x298e67)[_0x951c('0x3f')](function(_0x16e727){_0x2f3038[_0x951c('0x1d')]=_0x16e727;if(_0x21661d[_0x951c('0x34')][_0x951c('0x40')]){_0x33abb1[_0x951c('0x41')]=[{'all':!![]}];}return db[_0x951c('0x42')]['findAll'](_0x33abb1);})['then'](function(_0x5d4fb4){_0x2f3038[_0x951c('0x43')]=_0x5d4fb4;return _0x2f3038;})[_0x951c('0x3f')](respondWithFilteredResult(_0x4799aa,_0x33abb1))[_0x951c('0x44')](handleError(_0x4799aa,null));};exports[_0x951c('0x45')]=function(_0x320098,_0x25f530){var _0x573e89={'raw':![],'where':{'id':_0x320098['params']['id']}},_0x574cf7={};_0x574cf7['model']=_[_0x951c('0x31')](db[_0x951c('0x42')][_0x951c('0x2c')]);_0x574cf7[_0x951c('0x34')]=_['keys'](_0x320098[_0x951c('0x34')]);_0x574cf7[_0x951c('0x32')]=_['intersection'](_0x574cf7[_0x951c('0x2f')],_0x574cf7[_0x951c('0x34')]);_0x573e89[_0x951c('0x35')]=_[_0x951c('0x33')](_0x574cf7[_0x951c('0x2f')],qs[_0x951c('0x46')](_0x320098['query'][_0x951c('0x46')]));_0x573e89[_0x951c('0x35')]=_0x573e89[_0x951c('0x35')]['length']?_0x573e89[_0x951c('0x35')]:_0x574cf7[_0x951c('0x2f')];if(_0x320098[_0x951c('0x34')][_0x951c('0x40')]){_0x573e89[_0x951c('0x41')]=[{'all':!![]}];}_0x573e89=_[_0x951c('0x3d')]({},_0x573e89,_0x320098[_0x951c('0x3e')]);return db['VoiceRecording'][_0x951c('0x47')](_0x573e89)[_0x951c('0x3f')](handleEntityNotFound(_0x25f530,null))[_0x951c('0x3f')](respondWithResult(_0x25f530,null))['catch'](handleError(_0x25f530,null));};exports['create']=function(_0x694765,_0x416f8d){return db[_0x951c('0x42')][_0x951c('0x48')](_0x694765['body'],{})[_0x951c('0x3f')](respondWithResult(_0x416f8d,0xc9))[_0x951c('0x44')](handleError(_0x416f8d,null));};exports[_0x951c('0x25')]=function(_0xe8da53,_0x632b30){if(_0xe8da53[_0x951c('0x49')]['id']){delete _0xe8da53[_0x951c('0x49')]['id'];}return db['VoiceRecording'][_0x951c('0x47')]({'where':{'id':_0xe8da53[_0x951c('0x4a')]['id']}})[_0x951c('0x3f')](handleEntityNotFound(_0x632b30,null))[_0x951c('0x3f')](saveUpdates(_0xe8da53[_0x951c('0x49')],null))['then'](respondWithResult(_0x632b30,null))[_0x951c('0x44')](handleError(_0x632b30,null));};exports[_0x951c('0x4b')]=function(_0x2222c9,_0x27cf02){return db[_0x951c('0x42')][_0x951c('0x4b')]()[_0x951c('0x3f')](respondWithResult(_0x27cf02,null))[_0x951c('0x44')](handleError(_0x27cf02,null));};exports['download']=function(_0x1450e4,_0x51c856,_0xedcd51){var _0x559947=require('../../components/encryptor');var _0x1878ec=![];var _0x5c8a53={};if(_0x1450e4[_0x951c('0x34')][_0x951c('0x2e')]&&_0x1450e4[_0x951c('0x34')]['type']==='uniqueid'){_0x5c8a53['uniqueid']=_0x1450e4[_0x951c('0x4a')]['id'];}else{_0x5c8a53['id']=_0x1450e4[_0x951c('0x4a')]['id'];}return db[_0x951c('0x42')][_0x951c('0x47')]({'where':_0x5c8a53,'attributes':['id','value'],'raw':!![]})[_0x951c('0x3f')](handleEntityNotFound(_0x51c856,null))['then'](function(_0x4d9045){if(_0x4d9045){var _0x5cb4fa=_0x4d9045[_0x951c('0x4c')];var _0x43fa96=util[_0x951c('0x4d')](_0x951c('0x4e'),_0x5cb4fa);if(fs['existsSync'](_0x43fa96)){_0x1878ec=!![];return _0x559947[_0x951c('0x4f')](_0x43fa96,_0x5cb4fa,config[_0x951c('0x50')][_0x951c('0x51')])[_0x951c('0x3f')](function(){return _0x4d9045;});}return _0x4d9045;}})[_0x951c('0x3f')](function(_0x3f75df){if(_0x3f75df){var _0x29dc74=_0x3f75df['value'];if(!fs['existsSync'](_0x29dc74)){throw new db[(_0x951c('0x52'))]['ValidationError'](_0x951c('0x53'));}if(_0x3f75df[_0x951c('0x54')]){return _0x51c856[_0x951c('0x55')](_0x29dc74,_0x3f75df['filename']+path[_0x951c('0x56')](_0x29dc74),function(){if(_0x1878ec){fs[_0x951c('0x57')](_0x29dc74);}});}else{return _0x51c856[_0x951c('0x55')](_0x29dc74,function(_0x5cb1b8){if(_0x1878ec){fs[_0x951c('0x57')](_0x29dc74);}});}}})['catch'](function(_0x272127){if(_0x272127[_0x951c('0x58')]==='VoiceRecording\x20not\x20found'){_0x51c856['status'](0x194)['send'](_0x951c('0x59'));}else{return handleError(_0x51c856,null);}});};exports[_0x951c('0x5a')]=function(_0x10ff88,_0x407b3b,_0x1524dc){var _0x2f5551=require(_0x951c('0x5b'));var _0x5b9936=![];var _0x2eae15={'$and':[db[_0x951c('0x5c')][_0x951c('0x3a')](db[_0x951c('0x5c')]['fn'](_0x951c('0x5d'),db['sequelize'][_0x951c('0x5e')](_0x951c('0x5f'))),_0x10ff88[_0x951c('0x34')][_0x951c('0x60')])]};if(_0x10ff88['query'][_0x951c('0x2e')]&&_0x10ff88[_0x951c('0x34')]['type']==='uniqueid'){_0x2eae15[_0x951c('0x61')][_0x951c('0x62')]({'uniqueid':_0x10ff88[_0x951c('0x4a')]['id']});}else{_0x2eae15[_0x951c('0x61')]['push']({'id':_0x10ff88['params']['id']});}return db['VoiceRecording'][_0x951c('0x47')]({'where':_0x2eae15,'attributes':['id',_0x951c('0x4c')],'raw':!![]})[_0x951c('0x3f')](handleEntityNotFound(_0x407b3b,null))[_0x951c('0x3f')](function(_0x58e0cb){if(_0x58e0cb){var _0x25de3f=util['format'](_0x951c('0x4e'),_0x58e0cb[_0x951c('0x4c')]);if(fs[_0x951c('0x63')](_0x25de3f)){_0x5b9936=!![];return _0x2f5551['decryptFile'](_0x25de3f,_0x58e0cb[_0x951c('0x4c')],config[_0x951c('0x50')][_0x951c('0x51')])[_0x951c('0x3f')](function(){return _0x58e0cb;});}return _0x58e0cb;}})[_0x951c('0x3f')](function(_0x4f6141){if(_0x4f6141){if(!fs[_0x951c('0x63')](_0x4f6141[_0x951c('0x4c')])){throw new db[(_0x951c('0x52'))][(_0x951c('0x64'))](_0x951c('0x53'));}if(_0x4f6141[_0x951c('0x54')]){return _0x407b3b['download'](_0x4f6141['value'],_0x4f6141[_0x951c('0x54')]+path['extname'](_0x4f6141['value']),function(){if(_0x5b9936){fs['unlink'](_0x4f6141[_0x951c('0x4c')]);}});}else{return _0x407b3b[_0x951c('0x55')](_0x4f6141['value'],function(_0x5c63c5){if(_0x5b9936){fs[_0x951c('0x57')](_0x4f6141['value']);}});}}})[_0x951c('0x44')](handleError(_0x407b3b,null));};exports[_0x951c('0x26')]=function(_0x33a98b,_0x104d38){return db[_0x951c('0x42')][_0x951c('0x47')]({'where':{'id':_0x33a98b[_0x951c('0x4a')]['id']}})[_0x951c('0x3f')](function(_0x568027){if(_[_0x951c('0x65')](_0x568027)){throw new ReferenceError(_0x951c('0x66'));}return _0x568027;})[_0x951c('0x3f')](function(_0x54f86c){var _0x2a074a=_0x54f86c[_0x951c('0x4c')];logger[_0x951c('0x67')](_0x951c('0x68'),_0x2a074a);if(!_[_0x951c('0x65')](_0x54f86c[_0x951c('0x4c')])&&fs[_0x951c('0x63')](_0x2a074a)){logger[_0x951c('0x67')](_0x951c('0x69')+_0x2a074a+_0x951c('0x6a'));fs[_0x951c('0x6b')](_0x2a074a);}_0x2a074a=_0x2a074a+_0x951c('0x6c');if(!_['isNil'](_0x54f86c[_0x951c('0x4c')])&&fs[_0x951c('0x63')](_0x2a074a)){logger[_0x951c('0x67')]('File:\x20\x22'+_0x2a074a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x951c('0x6b')](_0x2a074a);}return _0x54f86c;})[_0x951c('0x3f')](function(_0x1beebe){if(!_0x1beebe)throw new InternalError();return _0x1beebe['destroy']();})[_0x951c('0x3f')](function(){_0x104d38['status'](0xcc)['end']();})[_0x951c('0x44')](handleError(_0x104d38,null));};function getBucketslist(_0x40c14c,_0x558e8c,_0x209f8e){return new Promise(function(_0x25b336,_0x5ec3d4){var _0x36f322=new AWS['S3']({'accessKeyId':_0x558e8c,'secretAccessKey':_0x40c14c,'region':_0x209f8e});_0x36f322[_0x951c('0x6d')]({},function(_0x372b1f,_0x116afe){if(_0x372b1f){return _0x5ec3d4(_0x372b1f);}else{return _0x25b336(_0x116afe);}});});}function createBucket(_0x6921de,_0x36f02e,_0x5b13f2,_0x5a09f0){return new Promise(function(_0x4a841c,_0x3ec137){var _0x460469=new AWS['S3']({'accessKeyId':_0x36f02e,'secretAccessKey':_0x6921de,'region':_0x5b13f2});_0x460469[_0x951c('0x6e')]({'Bucket':_0x5a09f0},function(_0x5b43cb,_0x4bffb6){if(_0x5b43cb){return _0x3ec137(_0x5b43cb);}else{return _0x4a841c(_0x4bffb6);}});});}function uploadFile(_0x2be474,_0x5d1aef,_0xe8b897,_0x26ed6b,_0x393ffb,_0x4bb687){return new Promise(function(_0x2b1654,_0x35fadc){var _0x1addc5=new AWS['S3']({'accessKeyId':_0x5d1aef,'secretAccessKey':_0x2be474,'region':_0xe8b897});_0x1addc5[_0x951c('0x6f')]({'Bucket':_0x26ed6b,'Key':_0x393ffb,'Body':_0x4bb687},function(_0x256989,_0x3ecb06){if(_0x256989){return _0x35fadc(_0x256989);}else{return _0x2b1654(_0x3ecb06);}});});}function startTranscribe(_0x149283,_0x24174f,_0x4e9b44,_0x44b3c0,_0x1eb685,_0x1be4f){return new Promise(function(_0x1ab8aa,_0x5e631d){var _0xbcfc24=new AWS[(_0x951c('0x70'))]({'accessKeyId':_0x24174f,'secretAccessKey':_0x149283,'region':_0x4e9b44});_0xbcfc24[_0x951c('0x71')]({'TranscriptionJobName':_0x44b3c0,'LanguageCode':_0x1eb685,'Media':{'MediaFileUri':_0x1be4f}},function(_0x1300d7,_0x131b78){if(_0x1300d7){return _0x5e631d(_0x1300d7);}else{return _0x1ab8aa(_0x131b78);}});});}function transcribe(_0x3b1955,_0x5670fa,_0x4b5f7b,_0x110a8c,_0x30c4ef,_0x43f489,_0xa8d91d){return new Promise(function(_0x1edeec,_0x2662ff){var _0x34b2fa={};logger['info'](util['format'](_0x951c('0x72'),_0x3b1955,_0x30c4ef));return uploadFile(_0x5670fa,_0x4b5f7b,_0x110a8c,_0x30c4ef,path['basename'](_0x43f489),fs[_0x951c('0x73')](_0x43f489))['then'](function(_0x26f9ed){logger[_0x951c('0x67')](util['format'](_0x951c('0x74'),_0x3b1955,_0x30c4ef,_0x26f9ed[_0x951c('0x75')]));_0x34b2fa[_0x951c('0x76')]=_0x26f9ed['Bucket'];_0x34b2fa['location']=_0x26f9ed[_0x951c('0x75')];logger[_0x951c('0x67')](util[_0x951c('0x4d')](_0x951c('0x77'),_0x3b1955));return startTranscribe(_0x5670fa,_0x4b5f7b,_0x110a8c,uuidv4(),_0xa8d91d,_0x26f9ed[_0x951c('0x75')]);})['then'](function(_0x2e8d7d){logger[_0x951c('0x67')](util['format'](_0x951c('0x78'),_0x3b1955,_0x2e8d7d[_0x951c('0x79')]['TranscriptionJobName']));_0x34b2fa[_0x951c('0x7a')]=_0x2e8d7d[_0x951c('0x79')][_0x951c('0x7b')];_0x34b2fa['transcribeStatus']=_0x2e8d7d[_0x951c('0x79')][_0x951c('0x7c')];return _0x1edeec(_0x34b2fa);})[_0x951c('0x44')](function(_0x453d17){return _0x2662ff(_0x453d17);});});}exports[_0x951c('0x7d')]=function(_0xfbae2e,_0x158095,_0x2cf337){var _0x8d65ea;var _0x509b7e;var _0x36b885;var _0x184704=require(_0x951c('0x5b'));return db['VoiceRecording'][_0x951c('0x7e')]({'where':{'id':_0xfbae2e['params']['id']}})[_0x951c('0x3f')](function(_0x4dda74){if(_0x4dda74){var _0x1e5bff=util[_0x951c('0x4d')](_0x951c('0x4e'),_0x4dda74['value']);if(fs[_0x951c('0x63')](_0x1e5bff)){cypher=!![];return _0x184704[_0x951c('0x4f')](_0x1e5bff,_0x4dda74['value'],config[_0x951c('0x50')]['recording'])[_0x951c('0x3f')](function(){return _0x4dda74;});}return _0x4dda74;}})['then'](function(_0x5e6b82){if(!_0x5e6b82){throw new db[(_0x951c('0x52'))][(_0x951c('0x64'))](_0x951c('0x7f'));}_0x509b7e=_0x5e6b82;return db[_0x951c('0x80')]['findOne']({'where':{'id':0x1}});})[_0x951c('0x3f')](handleEntityNotFound(_0x158095,null))[_0x951c('0x3f')](function(_0x3aed52){if(_0x3aed52){_0x8d65ea=_0x3aed52;if(!_0x8d65ea[_0x951c('0x81')]||!_0x8d65ea['transcribeAccountId']||!_0x8d65ea['transcribeRegion']||!_0x8d65ea[_0x951c('0x82')]||!_0x8d65ea[_0x951c('0x76')]){throw new db[(_0x951c('0x52'))][(_0x951c('0x64'))](_0x951c('0x83'));}if(_0xfbae2e['body'][_0x951c('0x84')]&&(!_0x8d65ea[_0x951c('0x85')]||!_0x8d65ea[_0x951c('0x86')]||!_0x8d65ea[_0x951c('0x87')]||!_0x8d65ea[_0x951c('0x82')]||!_0x8d65ea[_0x951c('0x76')])){throw new db['Sequelize'][(_0x951c('0x64'))](_0x951c('0x88'));}return db[_0x951c('0x89')][_0x951c('0x7e')]({'where':{'id':_0x8d65ea[_0x951c('0x8a')]}});}})[_0x951c('0x3f')](function(_0xb50a56){if(!_0xb50a56){throw new db[(_0x951c('0x52'))]['ValidationError'](_0x951c('0x8b'));}if(!_0xb50a56[_0x951c('0x8c')]||!_0xb50a56['data2']){throw new db['Sequelize']['ValidationError'](_0x951c('0x8d'));}_0x36b885=_0xb50a56;return getBucketslist(_0x36b885[_0x951c('0x8c')],_0x36b885[_0x951c('0x8e')],_0x8d65ea['transcribeRegion']);})[_0x951c('0x3f')](function(_0x3e8a23){if(_0x3e8a23&&_0x3e8a23[_0x951c('0x8f')]){var _0x180776=_[_0x951c('0x47')](_0x3e8a23[_0x951c('0x8f')],function(_0x5de7ea){return _0x5de7ea['Name']===_0x8d65ea[_0x951c('0x76')];});if(!_0x180776){logger[_0x951c('0x67')](util[_0x951c('0x4d')](_0x951c('0x90'),_0xfbae2e['params']['id'],_0x8d65ea['bucket']));return createBucket(_0x36b885['data1'],_0x36b885[_0x951c('0x8e')],_0x8d65ea['transcribeRegion'],_0x8d65ea[_0x951c('0x76')]);}logger[_0x951c('0x67')](util['format'](_0x951c('0x91'),_0xfbae2e[_0x951c('0x4a')]['id'],_0x8d65ea[_0x951c('0x76')]));return;}})[_0x951c('0x3f')](function(_0x526560){if(_0x509b7e[_0x951c('0x92')]==='NEW'){return transcribe(_0xfbae2e[_0x951c('0x4a')]['id'],_0x36b885[_0x951c('0x8c')],_0x36b885[_0x951c('0x8e')],_0x8d65ea[_0x951c('0x93')],_0x8d65ea[_0x951c('0x76')],_0x509b7e[_0x951c('0x4c')],_0x8d65ea[_0x951c('0x82')]);}else{logger[_0x951c('0x67')](util[_0x951c('0x4d')](_0x951c('0x94'),_0xfbae2e[_0x951c('0x4a')]['id']));return{'transcribeStatus':_0x951c('0x95')};}})[_0x951c('0x3f')](function(_0x399996){if(_0x399996){_0x399996[_0x951c('0x96')]=_0xfbae2e[_0x951c('0x49')][_0x951c('0x84')];return _0x509b7e[_0x951c('0x97')](_0x399996);}})['then'](respondWithResult(_0x158095,null))['catch'](handleError(_0x158095,null));};function writeFile(_0x592c9e,_0x534bd7){return new Promise(function(_0x58283f,_0x1b6fba){fs[_0x951c('0x98')](_0x534bd7,_0x592c9e,function(_0x555fcc,_0x28bb59){if(_0x555fcc){return _0x1b6fba(_0x555fcc);}else{return _0x58283f(_0x28bb59);}});});}exports[_0x951c('0x99')]=function(_0x347526,_0x2b9808,_0x20ac21){return db[_0x951c('0x42')]['findOne']({'where':{'id':_0x347526[_0x951c('0x4a')]['id']}})[_0x951c('0x3f')](handleEntityNotFound(_0x2b9808))[_0x951c('0x3f')](function(_0x18cd5f){if(_0x18cd5f&&_0x18cd5f[_0x951c('0x9a')]){var _0x3893dc=_0x18cd5f[_0x951c('0x9a')];var _0x220679=config[_0x951c('0x9b')]+_0x951c('0x9c')+_0x18cd5f['id']+_0x951c('0x9d');if(fs[_0x951c('0x63')](_0x220679)){return _0x220679;}return writeFile(_0x3893dc,_0x220679)[_0x951c('0x3f')](function(){return _0x220679;});}else{throw new db['Sequelize'][(_0x951c('0x64'))](_0x951c('0x9e'));}})[_0x951c('0x3f')](function(_0x572328){return _0x2b9808[_0x951c('0x55')](_0x572328);})[_0x951c('0x44')](handleError(_0x2b9808));}; \ No newline at end of file +var _0xb083=['.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','name','send','map','VoiceRecording','fieldName','type','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb083,0x1d0));var _0x3b08=function(_0x325d00,_0x58667e){_0x325d00=_0x325d00-0x0;var _0x105041=_0xb083[_0x325d00];return _0x105041;};'use strict';var emlformat=require(_0x3b08('0x0'));var rimraf=require(_0x3b08('0x1'));var zipdir=require(_0x3b08('0x2'));var jsonpatch=require(_0x3b08('0x3'));var rp=require('request-promise');var moment=require(_0x3b08('0x4'));var BPromise=require(_0x3b08('0x5'));var Mustache=require(_0x3b08('0x6'));var util=require(_0x3b08('0x7'));var path=require(_0x3b08('0x8'));var sox=require(_0x3b08('0x9'));var csv=require(_0x3b08('0xa'));var ejs=require(_0x3b08('0xb'));var fs=require('fs');var fs_extra=require(_0x3b08('0xc'));var _=require(_0x3b08('0xd'));var squel=require('squel');var crypto=require(_0x3b08('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3b08('0xf'));var toCsv=require(_0x3b08('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x3b08('0x10'));var uuidv4=require(_0x3b08('0x11'));var Redis=require(_0x3b08('0x12'));var authService=require(_0x3b08('0x13'));var qs=require(_0x3b08('0x14'));var as=require(_0x3b08('0x15'));var hardwareService=require(_0x3b08('0x16'));var logger=require(_0x3b08('0x17'))(_0x3b08('0x18'));var utils=require(_0x3b08('0x19'));var config=require(_0x3b08('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b08('0x1b'))['db'];function respondWithStatusCode(_0x274b4d,_0x36032b){_0x36032b=_0x36032b||0xcc;return function(_0x5396db){if(_0x5396db){return _0x274b4d[_0x3b08('0x1c')](_0x36032b);}return _0x274b4d[_0x3b08('0x1d')](_0x36032b)[_0x3b08('0x1e')]();};}function respondWithResult(_0x34cf4a,_0x90b72a){_0x90b72a=_0x90b72a||0xc8;return function(_0x2d1202){if(_0x2d1202){return _0x34cf4a[_0x3b08('0x1d')](_0x90b72a)[_0x3b08('0x1f')](_0x2d1202);}};}function respondWithFilteredResult(_0x1b799e,_0x9fa0eb){return function(_0x352e08){if(_0x352e08){var _0x15f31b=typeof _0x9fa0eb[_0x3b08('0x20')]===_0x3b08('0x21')&&typeof _0x9fa0eb['limit']===_0x3b08('0x21');var _0x567ac8=_0x352e08[_0x3b08('0x22')];var _0x1f0e53=_0x15f31b?0x0:_0x9fa0eb[_0x3b08('0x20')];var _0x3de63c=_0x15f31b?_0x352e08[_0x3b08('0x22')]:_0x9fa0eb['offset']+_0x9fa0eb[_0x3b08('0x23')];var _0x118932;if(_0x3de63c>=_0x567ac8){_0x3de63c=_0x567ac8;_0x118932=0xc8;}else{_0x118932=0xce;}_0x1b799e[_0x3b08('0x1d')](_0x118932);return _0x1b799e[_0x3b08('0x24')](_0x3b08('0x25'),_0x1f0e53+'-'+_0x3de63c+'/'+_0x567ac8)[_0x3b08('0x1f')](_0x352e08);}return null;};}function patchUpdates(_0x218dc6){return function(_0x425a3d){try{jsonpatch[_0x3b08('0x26')](_0x425a3d,_0x218dc6,!![]);}catch(_0x3b5194){return BPromise['reject'](_0x3b5194);}return _0x425a3d['save']();};}function saveUpdates(_0x23b51b,_0x3a9cd3){return function(_0x4d6b64){if(_0x4d6b64){return _0x4d6b64[_0x3b08('0x27')](_0x23b51b)[_0x3b08('0x28')](function(_0x8ec364){return _0x8ec364;});}return null;};}function removeEntity(_0x30f184,_0xe35955){return function(_0x44b8c9){if(_0x44b8c9){return _0x44b8c9[_0x3b08('0x29')]()[_0x3b08('0x28')](function(){_0x30f184[_0x3b08('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f162,_0x2bc85f){return function(_0x32c626){if(!_0x32c626){_0x23f162['sendStatus'](0x194);}return _0x32c626;};}function handleError(_0x242960,_0x1161b7){_0x1161b7=_0x1161b7||0x1f4;return function(_0x202cf4){logger['error'](_0x202cf4['stack']);if(_0x202cf4['name']){delete _0x202cf4[_0x3b08('0x2a')];}_0x242960[_0x3b08('0x1d')](_0x1161b7)[_0x3b08('0x2b')](_0x202cf4);};}exports['index']=function(_0x33ed28,_0x314c2b){var _0x5e550e={},_0x1a0763={},_0x2857e1={'count':0x0,'rows':[]};var _0x4c18de=_[_0x3b08('0x2c')](db[_0x3b08('0x2d')]['rawAttributes'],function(_0x1f6f08){return{'name':_0x1f6f08[_0x3b08('0x2e')],'type':_0x1f6f08[_0x3b08('0x2f')]['key']};});_0x1a0763[_0x3b08('0x30')]=_[_0x3b08('0x31')](_[_0x3b08('0x2c')](_0x4c18de,'name'),[_0x3b08('0x32')]);_0x1a0763[_0x3b08('0x33')]=_[_0x3b08('0x34')](_0x33ed28['query']);_0x1a0763['filters']=_[_0x3b08('0x35')](_0x1a0763[_0x3b08('0x30')],_0x1a0763[_0x3b08('0x33')]);_0x5e550e[_0x3b08('0x36')]=_[_0x3b08('0x35')](_0x1a0763['model'],qs['fields'](_0x33ed28[_0x3b08('0x33')][_0x3b08('0x37')]));_0x5e550e[_0x3b08('0x36')]=_0x5e550e['attributes'][_0x3b08('0x38')]?_0x5e550e[_0x3b08('0x36')]:_0x1a0763['model'];if(!_0x33ed28[_0x3b08('0x33')][_0x3b08('0x39')](_0x3b08('0x3a'))){_0x5e550e['limit']=qs[_0x3b08('0x23')](_0x33ed28[_0x3b08('0x33')][_0x3b08('0x23')]);_0x5e550e[_0x3b08('0x20')]=qs['offset'](_0x33ed28['query'][_0x3b08('0x20')]);}_0x5e550e[_0x3b08('0x3b')]=qs[_0x3b08('0x3c')](_0x33ed28['query'][_0x3b08('0x3c')]);_0x5e550e[_0x3b08('0x3d')]=qs['filters'](_[_0x3b08('0x3e')](_0x33ed28[_0x3b08('0x33')],_0x1a0763[_0x3b08('0x3f')]),_0x4c18de);if(_0x33ed28[_0x3b08('0x33')]['filter']){_0x5e550e[_0x3b08('0x3d')]=_[_0x3b08('0x40')](_0x5e550e[_0x3b08('0x3d')],{'$or':_[_0x3b08('0x2c')](_0x4c18de,function(_0x963112){if(_0x963112[_0x3b08('0x2f')]!==_0x3b08('0x41')){var _0x18892e={};_0x18892e[_0x963112[_0x3b08('0x2a')]]={'$like':'%'+_0x33ed28[_0x3b08('0x33')][_0x3b08('0x42')]+'%'};return _0x18892e;}})});}_0x5e550e=_[_0x3b08('0x40')]({},_0x5e550e,_0x33ed28[_0x3b08('0x43')]);var _0xc97a9d={'where':_0x5e550e[_0x3b08('0x3d')]};return db[_0x3b08('0x2d')][_0x3b08('0x22')](_0xc97a9d)[_0x3b08('0x28')](function(_0x225277){_0x2857e1[_0x3b08('0x22')]=_0x225277;if(_0x33ed28['query'][_0x3b08('0x44')]){_0x5e550e[_0x3b08('0x45')]=[{'all':!![]}];}return db['VoiceRecording'][_0x3b08('0x46')](_0x5e550e);})[_0x3b08('0x28')](function(_0x5b1d0a){_0x2857e1[_0x3b08('0x47')]=_0x5b1d0a;return _0x2857e1;})[_0x3b08('0x28')](respondWithFilteredResult(_0x314c2b,_0x5e550e))[_0x3b08('0x48')](handleError(_0x314c2b,null));};exports[_0x3b08('0x49')]=function(_0x47c02f,_0x3c79f8){var _0x5b7dcb={'raw':![],'where':{'id':_0x47c02f[_0x3b08('0x4a')]['id']}},_0x315235={};_0x315235['model']=_[_0x3b08('0x34')](db[_0x3b08('0x2d')]['rawAttributes']);_0x315235[_0x3b08('0x33')]=_[_0x3b08('0x34')](_0x47c02f[_0x3b08('0x33')]);_0x315235[_0x3b08('0x3f')]=_['intersection'](_0x315235['model'],_0x315235[_0x3b08('0x33')]);_0x5b7dcb[_0x3b08('0x36')]=_[_0x3b08('0x35')](_0x315235[_0x3b08('0x30')],qs['fields'](_0x47c02f[_0x3b08('0x33')][_0x3b08('0x37')]));_0x5b7dcb[_0x3b08('0x36')]=_0x5b7dcb[_0x3b08('0x36')][_0x3b08('0x38')]?_0x5b7dcb[_0x3b08('0x36')]:_0x315235[_0x3b08('0x30')];if(_0x47c02f[_0x3b08('0x33')][_0x3b08('0x44')]){_0x5b7dcb[_0x3b08('0x45')]=[{'all':!![]}];}_0x5b7dcb=_[_0x3b08('0x40')]({},_0x5b7dcb,_0x47c02f[_0x3b08('0x43')]);return db[_0x3b08('0x2d')]['find'](_0x5b7dcb)[_0x3b08('0x28')](handleEntityNotFound(_0x3c79f8,null))[_0x3b08('0x28')](respondWithResult(_0x3c79f8,null))[_0x3b08('0x48')](handleError(_0x3c79f8,null));};exports[_0x3b08('0x4b')]=function(_0x5e13f7,_0x3daf8f){return db['VoiceRecording'][_0x3b08('0x4b')](_0x5e13f7[_0x3b08('0x4c')],{})[_0x3b08('0x28')](respondWithResult(_0x3daf8f,0xc9))[_0x3b08('0x48')](handleError(_0x3daf8f,null));};exports['update']=function(_0x409c7c,_0x1bbe43){if(_0x409c7c[_0x3b08('0x4c')]['id']){delete _0x409c7c[_0x3b08('0x4c')]['id'];}return db[_0x3b08('0x2d')][_0x3b08('0x4d')]({'where':{'id':_0x409c7c[_0x3b08('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bbe43,null))[_0x3b08('0x28')](saveUpdates(_0x409c7c[_0x3b08('0x4c')],null))[_0x3b08('0x28')](respondWithResult(_0x1bbe43,null))[_0x3b08('0x48')](handleError(_0x1bbe43,null));};exports['describe']=function(_0x26a6c9,_0x3d9083){return db[_0x3b08('0x2d')][_0x3b08('0x4e')]()['then'](respondWithResult(_0x3d9083,null))[_0x3b08('0x48')](handleError(_0x3d9083,null));};exports[_0x3b08('0x4f')]=function(_0x2d86b8,_0x27610d,_0x1fe6b3){var _0x2fbce3=require(_0x3b08('0x50'));var _0x1a8fcf=![];var _0xf7975e={};if(_0x2d86b8[_0x3b08('0x33')][_0x3b08('0x2f')]&&_0x2d86b8[_0x3b08('0x33')]['type']===_0x3b08('0x51')){_0xf7975e[_0x3b08('0x51')]=_0x2d86b8['params']['id'];}else{_0xf7975e['id']=_0x2d86b8[_0x3b08('0x4a')]['id'];}return db[_0x3b08('0x2d')]['find']({'where':_0xf7975e,'attributes':['id','value'],'raw':!![]})[_0x3b08('0x28')](handleEntityNotFound(_0x27610d,null))[_0x3b08('0x28')](function(_0x32792d){if(_0x32792d){var _0x4b4c25=_0x32792d[_0x3b08('0x52')];var _0x5f3092=util[_0x3b08('0x32')](_0x3b08('0x53'),_0x4b4c25);if(fs[_0x3b08('0x54')](_0x5f3092)){_0x1a8fcf=!![];return _0x2fbce3[_0x3b08('0x55')](_0x5f3092,_0x4b4c25,config['secrets'][_0x3b08('0x56')])['then'](function(){return _0x32792d;});}return _0x32792d;}})[_0x3b08('0x28')](function(_0x35e5e2){if(_0x35e5e2){var _0x3e1626=_0x35e5e2[_0x3b08('0x52')];if(!fs['existsSync'](_0x3e1626)){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x59'));}if(_0x35e5e2[_0x3b08('0x5a')]){return _0x27610d['download'](_0x3e1626,_0x35e5e2[_0x3b08('0x5a')]+path[_0x3b08('0x5b')](_0x3e1626),function(){if(_0x1a8fcf){fs[_0x3b08('0x5c')](_0x3e1626);}});}else{return _0x27610d[_0x3b08('0x4f')](_0x3e1626,function(_0x56d314){if(_0x1a8fcf){fs[_0x3b08('0x5c')](_0x3e1626);}});}}})['catch'](function(_0x51ebb3){if(_0x51ebb3[_0x3b08('0x5d')]===_0x3b08('0x59')){_0x27610d['status'](0x194)[_0x3b08('0x2b')](_0x3b08('0x5e'));}else{return handleError(_0x27610d,null);}});};exports[_0x3b08('0x5f')]=function(_0x2d6846,_0xdca5eb,_0x4ce55f){var _0x4ffb9e=require(_0x3b08('0x50'));var _0x34aa54=![];var _0x1cdc88={'$and':[db[_0x3b08('0x60')][_0x3b08('0x3d')](db[_0x3b08('0x60')]['fn'](_0x3b08('0x61'),db['sequelize'][_0x3b08('0x62')]('uniqueid')),_0x2d6846[_0x3b08('0x33')][_0x3b08('0x63')])]};if(_0x2d6846['query'][_0x3b08('0x2f')]&&_0x2d6846[_0x3b08('0x33')][_0x3b08('0x2f')]===_0x3b08('0x51')){_0x1cdc88[_0x3b08('0x64')]['push']({'uniqueid':_0x2d6846['params']['id']});}else{_0x1cdc88[_0x3b08('0x64')][_0x3b08('0x65')]({'id':_0x2d6846[_0x3b08('0x4a')]['id']});}return db[_0x3b08('0x2d')]['find']({'where':_0x1cdc88,'attributes':['id',_0x3b08('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0xdca5eb,null))[_0x3b08('0x28')](function(_0xe462f8){if(_0xe462f8){var _0x5836ca=util[_0x3b08('0x32')](_0x3b08('0x53'),_0xe462f8[_0x3b08('0x52')]);if(fs[_0x3b08('0x54')](_0x5836ca)){_0x34aa54=!![];return _0x4ffb9e[_0x3b08('0x55')](_0x5836ca,_0xe462f8['value'],config['secrets'][_0x3b08('0x56')])['then'](function(){return _0xe462f8;});}return _0xe462f8;}})[_0x3b08('0x28')](function(_0x2bb663){if(_0x2bb663){if(!fs['existsSync'](_0x2bb663[_0x3b08('0x52')])){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x59'));}if(_0x2bb663[_0x3b08('0x5a')]){return _0xdca5eb[_0x3b08('0x4f')](_0x2bb663[_0x3b08('0x52')],_0x2bb663[_0x3b08('0x5a')]+path['extname'](_0x2bb663['value']),function(){if(_0x34aa54){fs[_0x3b08('0x5c')](_0x2bb663[_0x3b08('0x52')]);}});}else{return _0xdca5eb[_0x3b08('0x4f')](_0x2bb663[_0x3b08('0x52')],function(_0x3fc742){if(_0x34aa54){fs[_0x3b08('0x5c')](_0x2bb663['value']);}});}}})[_0x3b08('0x48')](handleError(_0xdca5eb,null));};exports[_0x3b08('0x29')]=function(_0x55d249,_0x3f65da){return db[_0x3b08('0x2d')][_0x3b08('0x4d')]({'where':{'id':_0x55d249['params']['id']}})[_0x3b08('0x28')](function(_0x5ccd59){if(_[_0x3b08('0x66')](_0x5ccd59)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5ccd59;})[_0x3b08('0x28')](function(_0x5c9f78){var _0x3fa0f5=_0x5c9f78[_0x3b08('0x52')];logger['info'](_0x3b08('0x67'),_0x3fa0f5);if(!_[_0x3b08('0x66')](_0x5c9f78[_0x3b08('0x52')])&&fs['existsSync'](_0x3fa0f5)){logger[_0x3b08('0x68')](_0x3b08('0x69')+_0x3fa0f5+_0x3b08('0x6a'));fs[_0x3b08('0x6b')](_0x3fa0f5);}_0x3fa0f5=_0x3fa0f5+'.cypher';if(!_[_0x3b08('0x66')](_0x5c9f78['value'])&&fs[_0x3b08('0x54')](_0x3fa0f5)){logger['info'](_0x3b08('0x69')+_0x3fa0f5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3b08('0x6b')](_0x3fa0f5);}return _0x5c9f78;})[_0x3b08('0x28')](function(_0x5d7e60){if(!_0x5d7e60)throw new InternalError();return _0x5d7e60[_0x3b08('0x29')]();})[_0x3b08('0x28')](function(){_0x3f65da['status'](0xcc)[_0x3b08('0x1e')]();})['catch'](handleError(_0x3f65da,null));};function getBucketslist(_0x54c9c6,_0x57bc38,_0x33ebcb){return new Promise(function(_0x45680b,_0x3f2ff3){var _0x42161a=new AWS['S3']({'accessKeyId':_0x57bc38,'secretAccessKey':_0x54c9c6,'region':_0x33ebcb});_0x42161a[_0x3b08('0x6c')]({},function(_0x383ac9,_0x1c4b22){if(_0x383ac9){return _0x3f2ff3(_0x383ac9);}else{return _0x45680b(_0x1c4b22);}});});}function createBucket(_0x34f4e3,_0x432f65,_0x4f5f7c,_0x3155f6){return new Promise(function(_0x2bd5b6,_0x2ff8cf){var _0x3e2510=new AWS['S3']({'accessKeyId':_0x432f65,'secretAccessKey':_0x34f4e3,'region':_0x4f5f7c});_0x3e2510['createBucket']({'Bucket':_0x3155f6},function(_0x390bdf,_0x58c601){if(_0x390bdf){return _0x2ff8cf(_0x390bdf);}else{return _0x2bd5b6(_0x58c601);}});});}function uploadFile(_0x887cbf,_0x487096,_0x1d0dd2,_0x585917,_0x4771e3,_0x30233c){return new Promise(function(_0x3ac91d,_0x4280ed){var _0x2ffe35=new AWS['S3']({'accessKeyId':_0x487096,'secretAccessKey':_0x887cbf,'region':_0x1d0dd2});_0x2ffe35['upload']({'Bucket':_0x585917,'Key':_0x4771e3,'Body':_0x30233c},function(_0x2d459d,_0x14a936){if(_0x2d459d){return _0x4280ed(_0x2d459d);}else{return _0x3ac91d(_0x14a936);}});});}function startTranscribe(_0x3bde3f,_0x434d61,_0x2e8edb,_0x18ebc2,_0x1bf077,_0x4dc971){return new Promise(function(_0x253c90,_0x134964){var _0x5d7c33=new AWS['TranscribeService']({'accessKeyId':_0x434d61,'secretAccessKey':_0x3bde3f,'region':_0x2e8edb});_0x5d7c33[_0x3b08('0x6d')]({'TranscriptionJobName':_0x18ebc2,'LanguageCode':_0x1bf077,'Media':{'MediaFileUri':_0x4dc971}},function(_0x3e66ca,_0x2a4473){if(_0x3e66ca){return _0x134964(_0x3e66ca);}else{return _0x253c90(_0x2a4473);}});});}function transcribe(_0x3b3ecd,_0x50c738,_0x4eb762,_0x59171c,_0x2aa584,_0x5151d9,_0xd6c6b1){return new Promise(function(_0x23ab1a,_0x8e5531){var _0x12756f={};logger[_0x3b08('0x68')](util['format'](_0x3b08('0x6e'),_0x3b3ecd,_0x2aa584));return uploadFile(_0x50c738,_0x4eb762,_0x59171c,_0x2aa584,path[_0x3b08('0x6f')](_0x5151d9),fs[_0x3b08('0x70')](_0x5151d9))[_0x3b08('0x28')](function(_0x3f8c1b){logger['info'](util[_0x3b08('0x32')](_0x3b08('0x71'),_0x3b3ecd,_0x2aa584,_0x3f8c1b[_0x3b08('0x72')]));_0x12756f[_0x3b08('0x73')]=_0x3f8c1b['Bucket'];_0x12756f[_0x3b08('0x74')]=_0x3f8c1b[_0x3b08('0x72')];logger[_0x3b08('0x68')](util['format'](_0x3b08('0x75'),_0x3b3ecd));return startTranscribe(_0x50c738,_0x4eb762,_0x59171c,uuidv4(),_0xd6c6b1,_0x3f8c1b[_0x3b08('0x72')]);})[_0x3b08('0x28')](function(_0x26ac7e){logger['info'](util['format'](_0x3b08('0x76'),_0x3b3ecd,_0x26ac7e[_0x3b08('0x77')][_0x3b08('0x78')]));_0x12756f[_0x3b08('0x79')]=_0x26ac7e[_0x3b08('0x77')]['TranscriptionJobName'];_0x12756f[_0x3b08('0x7a')]=_0x26ac7e[_0x3b08('0x77')][_0x3b08('0x7b')];return _0x23ab1a(_0x12756f);})[_0x3b08('0x48')](function(_0x8e0545){return _0x8e5531(_0x8e0545);});});}exports['runTranscribe']=function(_0x57ceaf,_0x379fc7,_0x5d745a){var _0x225be4;var _0x1c518a;var _0x18511a;var _0x2d851f=require(_0x3b08('0x50'));return db[_0x3b08('0x2d')][_0x3b08('0x7c')]({'where':{'id':_0x57ceaf[_0x3b08('0x4a')]['id']}})[_0x3b08('0x28')](function(_0x2f7d2d){if(_0x2f7d2d){var _0x221fcb=util[_0x3b08('0x32')](_0x3b08('0x53'),_0x2f7d2d[_0x3b08('0x52')]);if(fs[_0x3b08('0x54')](_0x221fcb)){cypher=!![];return _0x2d851f[_0x3b08('0x55')](_0x221fcb,_0x2f7d2d['value'],config['secrets']['recording'])[_0x3b08('0x28')](function(){return _0x2f7d2d;});}return _0x2f7d2d;}})['then'](function(_0x10dc44){if(!_0x10dc44){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x7d'));}_0x1c518a=_0x10dc44;return db[_0x3b08('0x7e')][_0x3b08('0x7c')]({'where':{'id':0x1}});})[_0x3b08('0x28')](handleEntityNotFound(_0x379fc7,null))[_0x3b08('0x28')](function(_0x179649){if(_0x179649){_0x225be4=_0x179649;if(!_0x225be4[_0x3b08('0x7f')]||!_0x225be4[_0x3b08('0x80')]||!_0x225be4[_0x3b08('0x81')]||!_0x225be4[_0x3b08('0x82')]||!_0x225be4['bucket']){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x83'));}if(_0x57ceaf[_0x3b08('0x4c')][_0x3b08('0x84')]&&(!_0x225be4[_0x3b08('0x85')]||!_0x225be4[_0x3b08('0x86')]||!_0x225be4['sentimentRegion']||!_0x225be4['language']||!_0x225be4['bucket'])){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x87'));}return db[_0x3b08('0x88')][_0x3b08('0x7c')]({'where':{'id':_0x225be4[_0x3b08('0x80')]}});}})[_0x3b08('0x28')](function(_0x4115e1){if(!_0x4115e1){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x89'));}if(!_0x4115e1[_0x3b08('0x8a')]||!_0x4115e1['data2']){throw new db[(_0x3b08('0x57'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x18511a=_0x4115e1;return getBucketslist(_0x18511a[_0x3b08('0x8a')],_0x18511a[_0x3b08('0x8b')],_0x225be4['transcribeRegion']);})[_0x3b08('0x28')](function(_0x51d629){if(_0x51d629&&_0x51d629['Buckets']){var _0xaf5b06=_[_0x3b08('0x4d')](_0x51d629[_0x3b08('0x8c')],function(_0xad9358){return _0xad9358[_0x3b08('0x8d')]===_0x225be4[_0x3b08('0x73')];});if(!_0xaf5b06){logger[_0x3b08('0x68')](util[_0x3b08('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x57ceaf[_0x3b08('0x4a')]['id'],_0x225be4[_0x3b08('0x73')]));return createBucket(_0x18511a[_0x3b08('0x8a')],_0x18511a['data2'],_0x225be4[_0x3b08('0x81')],_0x225be4[_0x3b08('0x73')]);}logger[_0x3b08('0x68')](util[_0x3b08('0x32')](_0x3b08('0x8e'),_0x57ceaf[_0x3b08('0x4a')]['id'],_0x225be4['bucket']));return;}})[_0x3b08('0x28')](function(_0x489ab7){if(_0x1c518a[_0x3b08('0x7a')]===_0x3b08('0x8f')){return transcribe(_0x57ceaf['params']['id'],_0x18511a[_0x3b08('0x8a')],_0x18511a[_0x3b08('0x8b')],_0x225be4[_0x3b08('0x81')],_0x225be4['bucket'],_0x1c518a['value'],_0x225be4[_0x3b08('0x82')]);}else{logger[_0x3b08('0x68')](util[_0x3b08('0x32')](_0x3b08('0x90'),_0x57ceaf[_0x3b08('0x4a')]['id']));return{'transcribeStatus':_0x3b08('0x91')};}})['then'](function(_0x4ad010){if(_0x4ad010){_0x4ad010['tempSentiment']=_0x57ceaf[_0x3b08('0x4c')][_0x3b08('0x84')];return _0x1c518a[_0x3b08('0x92')](_0x4ad010);}})[_0x3b08('0x28')](respondWithResult(_0x379fc7,null))['catch'](handleError(_0x379fc7,null));};function writeFile(_0xe19df2,_0x26009d){return new Promise(function(_0x1c778b,_0x412f7a){fs[_0x3b08('0x93')](_0x26009d,_0xe19df2,function(_0x7b0572,_0x4312e4){if(_0x7b0572){return _0x412f7a(_0x7b0572);}else{return _0x1c778b(_0x4312e4);}});});}exports[_0x3b08('0x94')]=function(_0x584ca5,_0x81d96,_0x5d0374){return db['VoiceRecording'][_0x3b08('0x7c')]({'where':{'id':_0x584ca5[_0x3b08('0x4a')]['id']}})[_0x3b08('0x28')](handleEntityNotFound(_0x81d96))[_0x3b08('0x28')](function(_0x29e401){if(_0x29e401&&_0x29e401['fileText']){var _0x539eb3=_0x29e401[_0x3b08('0x95')];var _0x45e2cb=config[_0x3b08('0x96')]+_0x3b08('0x97')+_0x29e401['id']+_0x3b08('0x98');if(fs[_0x3b08('0x54')](_0x45e2cb)){return _0x45e2cb;}return writeFile(_0x539eb3,_0x45e2cb)[_0x3b08('0x28')](function(){return _0x45e2cb;});}else{throw new db['Sequelize'][(_0x3b08('0x58'))](_0x3b08('0x99'));}})[_0x3b08('0x28')](function(_0x20992f){return _0x81d96[_0x3b08('0x4f')](_0x20992f);})[_0x3b08('0x48')](handleError(_0x81d96));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 50094c4..f01cb4f 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 _0x61a1=['transcribeStatus','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x61a1,0x127));var _0x161a=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x61a1[_0x14363e];return _0x17c56d;};'use strict';var attributes=require(_0x161a('0x0'));module[_0x161a('0x1')]=function(_0x1befc0,_0x1824bc){return _0x1befc0[_0x161a('0x2')]('VoiceRecording',attributes,{'tableName':_0x161a('0x3'),'paranoid':![],'indexes':[{'name':_0x161a('0x4'),'fields':['uniqueid']},{'name':_0x161a('0x5'),'fields':[_0x161a('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38df=['./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','transcribeStatus'];(function(_0x380640,_0x185d99){var _0xf3c37=function(_0x182c1c){while(--_0x182c1c){_0x380640['push'](_0x380640['shift']());}};_0xf3c37(++_0x185d99);}(_0x38df,0x144));var _0xf38d=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x38df[_0x2cc569];return _0x1bfc2e;};'use strict';var attributes=require(_0xf38d('0x0'));module[_0xf38d('0x1')]=function(_0x1b738c,_0x40d0df){return _0x1b738c[_0xf38d('0x2')](_0xf38d('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf38d('0x4')]},{'name':_0xf38d('0x5'),'fields':[_0xf38d('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 1b1c38d..1153932 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 _0x2a07=['body','options','raw','where','attributes','limit','UpdateVoiceRecording','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','VoiceRecording','update'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x2a07,0x74));var _0x72a0=function(_0xa601a2,_0x47718e){_0xa601a2=_0xa601a2-0x0;var _0x54af8a=_0x2a07[_0xa601a2];return _0x54af8a;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}exports['UpdateVoiceRecording']=function(_0x100d8f){var _0x42e9ec=this;return new Promise(function(_0x131b73,_0x5b63c8){return db[_0x72a0('0x17')][_0x72a0('0x18')](_0x100d8f[_0x72a0('0x19')],{'raw':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f['options'][_0x72a0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x100d8f['options']?_0x100d8f[_0x72a0('0x1a')][_0x72a0('0x1c')]||null:null,'attributes':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f['options'][_0x72a0('0x1d')]||null:null,'limit':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f[_0x72a0('0x1a')][_0x72a0('0x1e')]||null:null})['then'](function(_0x38a7ba){logger[_0x72a0('0x15')](_0x72a0('0x1f'),_0x100d8f);logger[_0x72a0('0x20')](_0x72a0('0x1f'),_0x100d8f,JSON[_0x72a0('0x12')](_0x38a7ba));_0x131b73(_0x38a7ba);})['catch'](function(_0x4dd1a6){logger[_0x72a0('0x13')](_0x72a0('0x1f'),_0x4dd1a6[_0x72a0('0x14')],_0x100d8f);_0x5b63c8(_0x42e9ec[_0x72a0('0x13')](0x1f4,_0x4dd1a6[_0x72a0('0x14')]));});});};exports[_0x72a0('0x21')]=function(_0xa5bda0){var _0x15922a=this;return new Promise(function(_0xee99e2,_0x12dcc9){var _0x4f9718=require(_0x72a0('0x22'));var _0x553641;return db[_0x72a0('0x23')][_0x72a0('0x24')]({'attributes':['id',_0x72a0('0x25')],'where':{'id':0x1},'raw':!![]})[_0x72a0('0xe')](function(_0x432179){_0x553641=_0x432179;return db[_0x72a0('0x17')][_0x72a0('0x26')](_0xa5bda0[_0x72a0('0x19')]);})['then'](function(_0x41efc1){if(_0x553641[_0x72a0('0x25')]&&fs[_0x72a0('0x27')](_0x41efc1[_0x72a0('0x28')])){var _0x13c04=util[_0x72a0('0x29')](_0x72a0('0x2a'),_0x41efc1['value']);return _0x4f9718[_0x72a0('0x2b')](_0x41efc1[_0x72a0('0x28')],_0x13c04,config[_0x72a0('0x2c')][_0x72a0('0x2d')])[_0x72a0('0xe')](function(){fs[_0x72a0('0x2e')](_0x41efc1[_0x72a0('0x28')]);logger[_0x72a0('0x15')]('CreateVoiceRecording\x20file\x20encrypted');return _0x41efc1;});}return _0x41efc1;})[_0x72a0('0xe')](function(_0x1fb485){logger[_0x72a0('0x15')]('CreateVoiceRecording',_0xa5bda0);logger[_0x72a0('0x20')]('CreateVoiceRecording',_0xa5bda0,JSON[_0x72a0('0x12')](_0x1fb485));_0xee99e2(_0x1fb485);})[_0x72a0('0x16')](function(_0x1d02c4){logger[_0x72a0('0x13')](_0x72a0('0x21'),_0x1d02c4[_0x72a0('0x14')],_0xa5bda0);_0x12dcc9(_0x15922a[_0x72a0('0x13')](0x1f4,_0x1d02c4[_0x72a0('0x14')]));});});}; \ No newline at end of file +var _0x2da6=['stringify','error','code','message','result','catch','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x46b573,_0x388f6d){var _0x3bcf35=function(_0x531d44){while(--_0x531d44){_0x46b573['push'](_0x46b573['shift']());}};_0x3bcf35(++_0x388f6d);}(_0x2da6,0x1dd));var _0x62da=function(_0x30765d,_0xe40e82){_0x30765d=_0x30765d-0x0;var _0x2b6f37=_0x2da6[_0x30765d];return _0x2b6f37;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['UpdateVoiceRecording']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['update'](_0xa7050b[_0x62da('0x19')],{'raw':_0xa7050b['options']?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1c')]||null:null,'attributes':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1d')]||null:null,'limit':_0xa7050b[_0x62da('0x1a')]?_0xa7050b['options'][_0x62da('0x1e')]||null:null})[_0x62da('0xc')](function(_0x2fd925){logger[_0x62da('0xd')](_0x62da('0x1f'),_0xa7050b);logger[_0x62da('0xf')](_0x62da('0x1f'),_0xa7050b,JSON['stringify'](_0x2fd925));_0x4d6482(_0x2fd925);})['catch'](function(_0x509fd9){logger[_0x62da('0x13')](_0x62da('0x1f'),_0x509fd9[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x509fd9['message']));});});};exports[_0x62da('0x20')]=function(_0x3b9c06){var _0x5f0a9c=this;return new Promise(function(_0x3ccf96,_0x195dc4){var _0x1775ea=require('../../components/encryptor');var _0x41de3a;return db[_0x62da('0x21')][_0x62da('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3c6274){_0x41de3a=_0x3c6274;return db[_0x62da('0x18')][_0x62da('0x23')](_0x3b9c06['body']);})[_0x62da('0xc')](function(_0x2a4681){if(_0x41de3a[_0x62da('0x24')]&&fs[_0x62da('0x25')](_0x2a4681[_0x62da('0x26')])){var _0x1cf765=util['format'](_0x62da('0x27'),_0x2a4681['value']);return _0x1775ea[_0x62da('0x28')](_0x2a4681[_0x62da('0x26')],_0x1cf765,config[_0x62da('0x29')][_0x62da('0x2a')])[_0x62da('0xc')](function(){fs[_0x62da('0x2b')](_0x2a4681['value']);logger[_0x62da('0xd')](_0x62da('0x2c'));return _0x2a4681;});}return _0x2a4681;})[_0x62da('0xc')](function(_0x5107b1){logger[_0x62da('0xd')](_0x62da('0x20'),_0x3b9c06);logger[_0x62da('0xf')]('CreateVoiceRecording',_0x3b9c06,JSON[_0x62da('0x12')](_0x5107b1));_0x3ccf96(_0x5107b1);})[_0x62da('0x17')](function(_0x55eda7){logger[_0x62da('0x13')](_0x62da('0x20'),_0x55eda7['message'],_0x3b9c06);_0x195dc4(_0x5f0a9c[_0x62da('0x13')](0x1f4,_0x55eda7[_0x62da('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9bd7fa1..e7d8cd8 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 _0x004f=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer'];(function(_0x55acfa,_0x80d2b9){var _0x13bc60=function(_0x2fe545){while(--_0x2fe545){_0x55acfa['push'](_0x55acfa['shift']());}};_0x13bc60(++_0x80d2b9);}(_0x004f,0x1c1));var _0xf004=function(_0x4351ab,_0x32c8e1){_0x4351ab=_0x4351ab-0x0;var _0x493268=_0x004f[_0x4351ab];return _0x493268;};'use strict';var multer=require(_0xf004('0x0'));var util=require(_0xf004('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf004('0x2')]();var fs_extra=require(_0xf004('0x3'));var auth=require(_0xf004('0x4'));var interaction=require(_0xf004('0x5'));var config=require(_0xf004('0x6'));var controller=require(_0xf004('0x7'));router[_0xf004('0x8')]('/',auth[_0xf004('0x9')](),controller['index']);router[_0xf004('0x8')]('/describe',auth[_0xf004('0x9')](),controller[_0xf004('0xa')]);router['get'](_0xf004('0xb'),auth['isAuthenticated'](),controller[_0xf004('0xc')]);router['post']('/',auth[_0xf004('0x9')](),controller['create']);router[_0xf004('0xd')](_0xf004('0xb'),auth[_0xf004('0x9')](),controller[_0xf004('0xe')]);router[_0xf004('0xf')](_0xf004('0xb'),auth['isAuthenticated'](),controller[_0xf004('0x10')]);module[_0xf004('0x11')]=router; \ No newline at end of file +var _0xd630=['../../config/environment','get','isAuthenticated','describe','/:id','show','create','put','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5335cc,_0x44d8f7){var _0x172ecc=function(_0x39241f){while(--_0x39241f){_0x5335cc['push'](_0x5335cc['shift']());}};_0x172ecc(++_0x44d8f7);}(_0xd630,0x1da));var _0x0d63=function(_0x1f9a39,_0x372548){_0x1f9a39=_0x1f9a39-0x0;var _0x4e7cbe=_0xd630[_0x1f9a39];return _0x4e7cbe;};'use strict';var multer=require(_0x0d63('0x0'));var util=require(_0x0d63('0x1'));var path=require('path');var timeout=require(_0x0d63('0x2'));var express=require(_0x0d63('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0d63('0x4'));var interaction=require(_0x0d63('0x5'));var config=require(_0x0d63('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x0d63('0x7')]('/',auth[_0x0d63('0x8')](),controller['index']);router[_0x0d63('0x7')]('/describe',auth[_0x0d63('0x8')](),controller[_0x0d63('0x9')]);router[_0x0d63('0x7')](_0x0d63('0xa'),auth['isAuthenticated'](),controller[_0x0d63('0xb')]);router['post']('/',auth[_0x0d63('0x8')](),controller[_0x0d63('0xc')]);router[_0x0d63('0xd')](_0x0d63('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0d63('0xa'),auth[_0x0d63('0x8')](),controller[_0x0d63('0xe')]);module[_0x0d63('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e0d76f5..2241fac 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 _0x50d5=['exports','blind','attended','STRING','ENUM','Yes','sequelize','moment'];(function(_0x99bba3,_0x45c75f){var _0x466a06=function(_0x3d239b){while(--_0x3d239b){_0x99bba3['push'](_0x99bba3['shift']());}};_0x466a06(++_0x45c75f);}(_0x50d5,0xb6));var _0x550d=function(_0x264cee,_0x1bcfee){_0x264cee=_0x264cee-0x0;var _0x69dd7c=_0x50d5[_0x264cee];return _0x69dd7c;};'use strict';var Sequelize=require(_0x550d('0x0'));var moment=require(_0x550d('0x1'));module[_0x550d('0x2')]={'type':{'type':Sequelize['ENUM'](_0x550d('0x3'),_0x550d('0x4'))},'result':{'type':Sequelize[_0x550d('0x5')]},'transfererchannel':{'type':Sequelize[_0x550d('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x550d('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x550d('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x550d('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x550d('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x550d('0x5')]},'transfereechannel':{'type':Sequelize[_0x550d('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x550d('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x550d('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x550d('0x5')]},'transfereecontext':{'type':Sequelize[_0x550d('0x5')]},'transfereeexten':{'type':Sequelize[_0x550d('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x550d('0x6')](_0x550d('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x550d('0x5')]}}; \ No newline at end of file +var _0xf739=['STRING','Yes','sequelize','moment','blind'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf739,0x18d));var _0x9f73=function(_0x3358b9,_0x4bdab0){_0x3358b9=_0x3358b9-0x0;var _0x4c15eb=_0xf739[_0x3358b9];return _0x4c15eb;};'use strict';var Sequelize=require(_0x9f73('0x0'));var moment=require(_0x9f73('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x9f73('0x2'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x9f73('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x9f73('0x3')]},'transferercalleridname':{'type':Sequelize[_0x9f73('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x9f73('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x9f73('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x9f73('0x3')]},'transferercontext':{'type':Sequelize[_0x9f73('0x3')]},'transfererexten':{'type':Sequelize[_0x9f73('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x9f73('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x9f73('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x9f73('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9f73('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x9f73('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x9f73('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x9f73('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x9f73('0x4'),'No')},'context':{'type':Sequelize[_0x9f73('0x3')]},'extension':{'type':Sequelize[_0x9f73('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 4324156..376a327 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 _0xcbe2=['fieldName','type','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','create','update','body','destroy','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','then','error','stack','name','send','map','VoiceTransferReport','rawAttributes'];(function(_0x383ca9,_0x229d4a){var _0x304fea=function(_0x5247ae){while(--_0x5247ae){_0x383ca9['push'](_0x383ca9['shift']());}};_0x304fea(++_0x229d4a);}(_0xcbe2,0x186));var _0x2cbe=function(_0x3a1c89,_0xdcbbfb){_0x3a1c89=_0x3a1c89-0x0;var _0x2636d7=_0xcbe2[_0x3a1c89];return _0x2636d7;};'use strict';var emlformat=require(_0x2cbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cbe('0x1'));var jsonpatch=require(_0x2cbe('0x2'));var rp=require(_0x2cbe('0x3'));var moment=require(_0x2cbe('0x4'));var BPromise=require(_0x2cbe('0x5'));var Mustache=require(_0x2cbe('0x6'));var util=require(_0x2cbe('0x7'));var path=require(_0x2cbe('0x8'));var sox=require(_0x2cbe('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cbe('0xa'));var squel=require(_0x2cbe('0xb'));var crypto=require(_0x2cbe('0xc'));var jsforce=require(_0x2cbe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2cbe('0xe'));var querystring=require(_0x2cbe('0xf'));var Papa=require(_0x2cbe('0x10'));var Redis=require(_0x2cbe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2cbe('0x12'));var as=require(_0x2cbe('0x13'));var hardwareService=require(_0x2cbe('0x14'));var logger=require(_0x2cbe('0x15'))(_0x2cbe('0x16'));var utils=require('../../config/utils');var config=require(_0x2cbe('0x17'));var licenseUtil=require(_0x2cbe('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3020f9,_0x3a3654){_0x3a3654=_0x3a3654||0xcc;return function(_0x4cb70e){if(_0x4cb70e){return _0x3020f9[_0x2cbe('0x19')](_0x3a3654);}return _0x3020f9[_0x2cbe('0x1a')](_0x3a3654)[_0x2cbe('0x1b')]();};}function respondWithResult(_0x19ed43,_0x1b32d0){_0x1b32d0=_0x1b32d0||0xc8;return function(_0x124736){if(_0x124736){return _0x19ed43[_0x2cbe('0x1a')](_0x1b32d0)[_0x2cbe('0x1c')](_0x124736);}};}function respondWithFilteredResult(_0x343a96,_0x2a3722){return function(_0x56d18c){if(_0x56d18c){var _0x46d9df=typeof _0x2a3722['offset']==='undefined'&&typeof _0x2a3722[_0x2cbe('0x1d')]==='undefined';var _0x1c8d9f=_0x56d18c[_0x2cbe('0x1e')];var _0x4942d0=_0x46d9df?0x0:_0x2a3722[_0x2cbe('0x1f')];var _0x4b1d1c=_0x46d9df?_0x56d18c['count']:_0x2a3722[_0x2cbe('0x1f')]+_0x2a3722[_0x2cbe('0x1d')];var _0x4ec89b;if(_0x4b1d1c>=_0x1c8d9f){_0x4b1d1c=_0x1c8d9f;_0x4ec89b=0xc8;}else{_0x4ec89b=0xce;}_0x343a96['status'](_0x4ec89b);return _0x343a96[_0x2cbe('0x20')](_0x2cbe('0x21'),_0x4942d0+'-'+_0x4b1d1c+'/'+_0x1c8d9f)['json'](_0x56d18c);}return null;};}function patchUpdates(_0x49ed58){return function(_0xfc4b85){try{jsonpatch['apply'](_0xfc4b85,_0x49ed58,!![]);}catch(_0x18ea41){return BPromise['reject'](_0x18ea41);}return _0xfc4b85['save']();};}function saveUpdates(_0x9fedd0,_0x171308){return function(_0x39e9bf){if(_0x39e9bf){return _0x39e9bf['update'](_0x9fedd0)[_0x2cbe('0x22')](function(_0x9b1ec2){return _0x9b1ec2;});}return null;};}function removeEntity(_0x181476,_0x229e7c){return function(_0x2ab8be){if(_0x2ab8be){return _0x2ab8be['destroy']()[_0x2cbe('0x22')](function(){_0x181476[_0x2cbe('0x1a')](0xcc)[_0x2cbe('0x1b')]();});}};}function handleEntityNotFound(_0x1bb4ae,_0x59d47b){return function(_0x31e511){if(!_0x31e511){_0x1bb4ae[_0x2cbe('0x19')](0x194);}return _0x31e511;};}function handleError(_0x1ab88a,_0x2509ca){_0x2509ca=_0x2509ca||0x1f4;return function(_0x2c0532){logger[_0x2cbe('0x23')](_0x2c0532[_0x2cbe('0x24')]);if(_0x2c0532['name']){delete _0x2c0532[_0x2cbe('0x25')];}_0x1ab88a[_0x2cbe('0x1a')](_0x2509ca)[_0x2cbe('0x26')](_0x2c0532);};}exports['index']=function(_0x4b58b1,_0x34e23f){var _0xfa96c={},_0x509048={},_0x195027={'count':0x0,'rows':[]};var _0x314cca=_[_0x2cbe('0x27')](db[_0x2cbe('0x28')][_0x2cbe('0x29')],function(_0x25bc42){return{'name':_0x25bc42[_0x2cbe('0x2a')],'type':_0x25bc42[_0x2cbe('0x2b')]['key']};});_0x509048[_0x2cbe('0x2c')]=_[_0x2cbe('0x27')](_0x314cca,_0x2cbe('0x25'));_0x509048[_0x2cbe('0x2d')]=_[_0x2cbe('0x2e')](_0x4b58b1['query']);_0x509048['filters']=_[_0x2cbe('0x2f')](_0x509048[_0x2cbe('0x2c')],_0x509048[_0x2cbe('0x2d')]);_0xfa96c['attributes']=_[_0x2cbe('0x2f')](_0x509048[_0x2cbe('0x2c')],qs['fields'](_0x4b58b1[_0x2cbe('0x2d')][_0x2cbe('0x30')]));_0xfa96c['attributes']=_0xfa96c[_0x2cbe('0x31')][_0x2cbe('0x32')]?_0xfa96c[_0x2cbe('0x31')]:_0x509048[_0x2cbe('0x2c')];if(!_0x4b58b1[_0x2cbe('0x2d')]['hasOwnProperty']('nolimit')){_0xfa96c['limit']=qs[_0x2cbe('0x1d')](_0x4b58b1[_0x2cbe('0x2d')][_0x2cbe('0x1d')]);_0xfa96c[_0x2cbe('0x1f')]=qs[_0x2cbe('0x1f')](_0x4b58b1['query']['offset']);}_0xfa96c[_0x2cbe('0x33')]=qs[_0x2cbe('0x34')](_0x4b58b1[_0x2cbe('0x2d')]['sort']);_0xfa96c[_0x2cbe('0x35')]=qs[_0x2cbe('0x36')](_[_0x2cbe('0x37')](_0x4b58b1['query'],_0x509048[_0x2cbe('0x36')]),_0x314cca);if(_0x4b58b1[_0x2cbe('0x2d')]['filter']){_0xfa96c[_0x2cbe('0x35')]=_['merge'](_0xfa96c[_0x2cbe('0x35')],{'$or':_['map'](_0x314cca,function(_0x31f26e){if(_0x31f26e[_0x2cbe('0x2b')]!==_0x2cbe('0x38')){var _0x31c7c0={};_0x31c7c0[_0x31f26e[_0x2cbe('0x25')]]={'$like':'%'+_0x4b58b1[_0x2cbe('0x2d')][_0x2cbe('0x39')]+'%'};return _0x31c7c0;}})});}_0xfa96c=_[_0x2cbe('0x3a')]({},_0xfa96c,_0x4b58b1[_0x2cbe('0x3b')]);var _0x4a0401={'where':_0xfa96c[_0x2cbe('0x35')]};return db[_0x2cbe('0x28')][_0x2cbe('0x1e')](_0x4a0401)[_0x2cbe('0x22')](function(_0x59e5bf){_0x195027[_0x2cbe('0x1e')]=_0x59e5bf;if(_0x4b58b1[_0x2cbe('0x2d')][_0x2cbe('0x3c')]){_0xfa96c[_0x2cbe('0x3d')]=[{'all':!![]}];}return db[_0x2cbe('0x28')]['findAll'](_0xfa96c);})[_0x2cbe('0x22')](function(_0x55762b){_0x195027[_0x2cbe('0x3e')]=_0x55762b;return _0x195027;})[_0x2cbe('0x22')](respondWithFilteredResult(_0x34e23f,_0xfa96c))[_0x2cbe('0x3f')](handleError(_0x34e23f,null));};exports[_0x2cbe('0x40')]=function(_0x3f9890,_0x44aed8){var _0x481de5={'raw':!![],'where':{'id':_0x3f9890[_0x2cbe('0x41')]['id']}},_0x4ed056={};_0x4ed056[_0x2cbe('0x2c')]=_[_0x2cbe('0x2e')](db[_0x2cbe('0x28')][_0x2cbe('0x29')]);_0x4ed056['query']=_[_0x2cbe('0x2e')](_0x3f9890[_0x2cbe('0x2d')]);_0x4ed056['filters']=_[_0x2cbe('0x2f')](_0x4ed056['model'],_0x4ed056[_0x2cbe('0x2d')]);_0x481de5[_0x2cbe('0x31')]=_[_0x2cbe('0x2f')](_0x4ed056[_0x2cbe('0x2c')],qs[_0x2cbe('0x30')](_0x3f9890[_0x2cbe('0x2d')][_0x2cbe('0x30')]));_0x481de5[_0x2cbe('0x31')]=_0x481de5['attributes'][_0x2cbe('0x32')]?_0x481de5[_0x2cbe('0x31')]:_0x4ed056['model'];if(_0x3f9890[_0x2cbe('0x2d')][_0x2cbe('0x3c')]){_0x481de5[_0x2cbe('0x3d')]=[{'all':!![]}];}_0x481de5=_['merge']({},_0x481de5,_0x3f9890[_0x2cbe('0x3b')]);return db[_0x2cbe('0x28')]['find'](_0x481de5)[_0x2cbe('0x22')](handleEntityNotFound(_0x44aed8,null))[_0x2cbe('0x22')](respondWithResult(_0x44aed8,null))[_0x2cbe('0x3f')](handleError(_0x44aed8,null));};exports[_0x2cbe('0x42')]=function(_0x2e4805,_0x17769f){return db['VoiceTransferReport'][_0x2cbe('0x42')](_0x2e4805['body'],{})[_0x2cbe('0x22')](respondWithResult(_0x17769f,0xc9))['catch'](handleError(_0x17769f,null));};exports[_0x2cbe('0x43')]=function(_0x5606ea,_0x5e829a){if(_0x5606ea[_0x2cbe('0x44')]['id']){delete _0x5606ea['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x5606ea[_0x2cbe('0x41')]['id']}})[_0x2cbe('0x22')](handleEntityNotFound(_0x5e829a,null))[_0x2cbe('0x22')](saveUpdates(_0x5606ea[_0x2cbe('0x44')],null))['then'](respondWithResult(_0x5e829a,null))['catch'](handleError(_0x5e829a,null));};exports[_0x2cbe('0x45')]=function(_0x39d29f,_0x122571){return db[_0x2cbe('0x28')][_0x2cbe('0x46')]({'where':{'id':_0x39d29f['params']['id']}})[_0x2cbe('0x22')](handleEntityNotFound(_0x122571,null))[_0x2cbe('0x22')](removeEntity(_0x122571,null))['catch'](handleError(_0x122571,null));};exports['describe']=function(_0x5c1f80,_0x509f3f){return db[_0x2cbe('0x28')][_0x2cbe('0x47')]()['then'](respondWithResult(_0x509f3f,null))[_0x2cbe('0x3f')](handleError(_0x509f3f,null));}; \ No newline at end of file +var _0x1828=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x3f6402,_0x46ada1){var _0x21a763=function(_0x16fe67){while(--_0x16fe67){_0x3f6402['push'](_0x3f6402['shift']());}};_0x21a763(++_0x46ada1);}(_0x1828,0x1a7));var _0x8182=function(_0x423aab,_0x38e4e3){_0x423aab=_0x423aab-0x0;var _0x42bbe2=_0x1828[_0x423aab];return _0x42bbe2;};'use strict';var emlformat=require(_0x8182('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8182('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8182('0x2'));var moment=require(_0x8182('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8182('0x4'));var util=require(_0x8182('0x5'));var path=require(_0x8182('0x6'));var sox=require(_0x8182('0x7'));var csv=require(_0x8182('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8182('0x9'));var squel=require(_0x8182('0xa'));var crypto=require(_0x8182('0xb'));var jsforce=require(_0x8182('0xc'));var deskjs=require(_0x8182('0xd'));var toCsv=require(_0x8182('0x8'));var querystring=require('querystring');var Papa=require(_0x8182('0xe'));var Redis=require(_0x8182('0xf'));var authService=require(_0x8182('0x10'));var qs=require(_0x8182('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8182('0x12'))(_0x8182('0x13'));var utils=require(_0x8182('0x14'));var config=require(_0x8182('0x15'));var licenseUtil=require(_0x8182('0x16'));var db=require(_0x8182('0x17'))['db'];function respondWithStatusCode(_0x109322,_0x48e505){_0x48e505=_0x48e505||0xcc;return function(_0x4c7a53){if(_0x4c7a53){return _0x109322[_0x8182('0x18')](_0x48e505);}return _0x109322['status'](_0x48e505)[_0x8182('0x19')]();};}function respondWithResult(_0xd69fd2,_0x51395c){_0x51395c=_0x51395c||0xc8;return function(_0x20d7e3){if(_0x20d7e3){return _0xd69fd2[_0x8182('0x1a')](_0x51395c)[_0x8182('0x1b')](_0x20d7e3);}};}function respondWithFilteredResult(_0x275107,_0x3feb81){return function(_0x9008e3){if(_0x9008e3){var _0x12ee42=typeof _0x3feb81[_0x8182('0x1c')]===_0x8182('0x1d')&&typeof _0x3feb81[_0x8182('0x1e')]===_0x8182('0x1d');var _0x3495d2=_0x9008e3[_0x8182('0x1f')];var _0x5793a7=_0x12ee42?0x0:_0x3feb81[_0x8182('0x1c')];var _0x24db20=_0x12ee42?_0x9008e3[_0x8182('0x1f')]:_0x3feb81[_0x8182('0x1c')]+_0x3feb81[_0x8182('0x1e')];var _0x598441;if(_0x24db20>=_0x3495d2){_0x24db20=_0x3495d2;_0x598441=0xc8;}else{_0x598441=0xce;}_0x275107[_0x8182('0x1a')](_0x598441);return _0x275107[_0x8182('0x20')](_0x8182('0x21'),_0x5793a7+'-'+_0x24db20+'/'+_0x3495d2)['json'](_0x9008e3);}return null;};}function patchUpdates(_0x3c6802){return function(_0xe3e0fa){try{jsonpatch[_0x8182('0x22')](_0xe3e0fa,_0x3c6802,!![]);}catch(_0x3a7fd7){return BPromise[_0x8182('0x23')](_0x3a7fd7);}return _0xe3e0fa[_0x8182('0x24')]();};}function saveUpdates(_0x420881,_0x5008fa){return function(_0x25d26e){if(_0x25d26e){return _0x25d26e[_0x8182('0x25')](_0x420881)['then'](function(_0x812d75){return _0x812d75;});}return null;};}function removeEntity(_0x531d00,_0x2d9447){return function(_0x27f9c2){if(_0x27f9c2){return _0x27f9c2[_0x8182('0x26')]()[_0x8182('0x27')](function(){_0x531d00['status'](0xcc)[_0x8182('0x19')]();});}};}function handleEntityNotFound(_0x407c57,_0x4b4c04){return function(_0x231f2a){if(!_0x231f2a){_0x407c57['sendStatus'](0x194);}return _0x231f2a;};}function handleError(_0x45ef62,_0x97c334){_0x97c334=_0x97c334||0x1f4;return function(_0x56cd53){logger[_0x8182('0x28')](_0x56cd53[_0x8182('0x29')]);if(_0x56cd53['name']){delete _0x56cd53[_0x8182('0x2a')];}_0x45ef62['status'](_0x97c334)['send'](_0x56cd53);};}exports[_0x8182('0x2b')]=function(_0x29c156,_0x48781d){var _0x551a92={},_0x2637e6={},_0x464325={'count':0x0,'rows':[]};var _0x51507c=_['map'](db[_0x8182('0x2c')][_0x8182('0x2d')],function(_0x2a57f9){return{'name':_0x2a57f9[_0x8182('0x2e')],'type':_0x2a57f9[_0x8182('0x2f')][_0x8182('0x30')]};});_0x2637e6[_0x8182('0x31')]=_[_0x8182('0x32')](_0x51507c,_0x8182('0x2a'));_0x2637e6[_0x8182('0x33')]=_[_0x8182('0x34')](_0x29c156[_0x8182('0x33')]);_0x2637e6['filters']=_[_0x8182('0x35')](_0x2637e6[_0x8182('0x31')],_0x2637e6[_0x8182('0x33')]);_0x551a92[_0x8182('0x36')]=_['intersection'](_0x2637e6[_0x8182('0x31')],qs[_0x8182('0x37')](_0x29c156['query'][_0x8182('0x37')]));_0x551a92[_0x8182('0x36')]=_0x551a92[_0x8182('0x36')]['length']?_0x551a92[_0x8182('0x36')]:_0x2637e6['model'];if(!_0x29c156['query'][_0x8182('0x38')](_0x8182('0x39'))){_0x551a92['limit']=qs[_0x8182('0x1e')](_0x29c156[_0x8182('0x33')]['limit']);_0x551a92[_0x8182('0x1c')]=qs['offset'](_0x29c156['query']['offset']);}_0x551a92[_0x8182('0x3a')]=qs[_0x8182('0x3b')](_0x29c156[_0x8182('0x33')][_0x8182('0x3b')]);_0x551a92[_0x8182('0x3c')]=qs[_0x8182('0x3d')](_[_0x8182('0x3e')](_0x29c156[_0x8182('0x33')],_0x2637e6[_0x8182('0x3d')]),_0x51507c);if(_0x29c156[_0x8182('0x33')][_0x8182('0x3f')]){_0x551a92[_0x8182('0x3c')]=_[_0x8182('0x40')](_0x551a92[_0x8182('0x3c')],{'$or':_[_0x8182('0x32')](_0x51507c,function(_0x24dd0f){if(_0x24dd0f[_0x8182('0x2f')]!==_0x8182('0x41')){var _0x48f660={};_0x48f660[_0x24dd0f['name']]={'$like':'%'+_0x29c156[_0x8182('0x33')][_0x8182('0x3f')]+'%'};return _0x48f660;}})});}_0x551a92=_[_0x8182('0x40')]({},_0x551a92,_0x29c156['options']);var _0x213bd3={'where':_0x551a92[_0x8182('0x3c')]};return db['VoiceTransferReport'][_0x8182('0x1f')](_0x213bd3)[_0x8182('0x27')](function(_0x4b9bd6){_0x464325[_0x8182('0x1f')]=_0x4b9bd6;if(_0x29c156['query'][_0x8182('0x42')]){_0x551a92[_0x8182('0x43')]=[{'all':!![]}];}return db[_0x8182('0x2c')]['findAll'](_0x551a92);})[_0x8182('0x27')](function(_0x57f3bd){_0x464325[_0x8182('0x44')]=_0x57f3bd;return _0x464325;})[_0x8182('0x27')](respondWithFilteredResult(_0x48781d,_0x551a92))[_0x8182('0x45')](handleError(_0x48781d,null));};exports[_0x8182('0x46')]=function(_0x22fd19,_0x292969){var _0x2bcab0={'raw':!![],'where':{'id':_0x22fd19['params']['id']}},_0x2bdb55={};_0x2bdb55[_0x8182('0x31')]=_['keys'](db[_0x8182('0x2c')][_0x8182('0x2d')]);_0x2bdb55[_0x8182('0x33')]=_[_0x8182('0x34')](_0x22fd19[_0x8182('0x33')]);_0x2bdb55['filters']=_[_0x8182('0x35')](_0x2bdb55[_0x8182('0x31')],_0x2bdb55[_0x8182('0x33')]);_0x2bcab0['attributes']=_['intersection'](_0x2bdb55[_0x8182('0x31')],qs[_0x8182('0x37')](_0x22fd19[_0x8182('0x33')][_0x8182('0x37')]));_0x2bcab0[_0x8182('0x36')]=_0x2bcab0[_0x8182('0x36')]['length']?_0x2bcab0[_0x8182('0x36')]:_0x2bdb55[_0x8182('0x31')];if(_0x22fd19[_0x8182('0x33')][_0x8182('0x42')]){_0x2bcab0[_0x8182('0x43')]=[{'all':!![]}];}_0x2bcab0=_[_0x8182('0x40')]({},_0x2bcab0,_0x22fd19[_0x8182('0x47')]);return db[_0x8182('0x2c')][_0x8182('0x48')](_0x2bcab0)[_0x8182('0x27')](handleEntityNotFound(_0x292969,null))[_0x8182('0x27')](respondWithResult(_0x292969,null))[_0x8182('0x45')](handleError(_0x292969,null));};exports[_0x8182('0x49')]=function(_0x3bdada,_0x41ffee){return db[_0x8182('0x2c')]['create'](_0x3bdada[_0x8182('0x4a')],{})[_0x8182('0x27')](respondWithResult(_0x41ffee,0xc9))['catch'](handleError(_0x41ffee,null));};exports['update']=function(_0x29325a,_0x1784c8){if(_0x29325a[_0x8182('0x4a')]['id']){delete _0x29325a['body']['id'];}return db[_0x8182('0x2c')][_0x8182('0x48')]({'where':{'id':_0x29325a[_0x8182('0x4b')]['id']}})[_0x8182('0x27')](handleEntityNotFound(_0x1784c8,null))[_0x8182('0x27')](saveUpdates(_0x29325a['body'],null))['then'](respondWithResult(_0x1784c8,null))[_0x8182('0x45')](handleError(_0x1784c8,null));};exports['destroy']=function(_0x216127,_0xa9f6c0){return db[_0x8182('0x2c')][_0x8182('0x48')]({'where':{'id':_0x216127[_0x8182('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa9f6c0,null))[_0x8182('0x27')](removeEntity(_0xa9f6c0,null))[_0x8182('0x45')](handleError(_0xa9f6c0,null));};exports['describe']=function(_0x1ed2e6,_0x3967ad){return db[_0x8182('0x2c')]['describe']()[_0x8182('0x27')](respondWithResult(_0x3967ad,null))[_0x8182('0x45')](handleError(_0x3967ad,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index cf1b2f5..a57f3be 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 _0x3153=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bcc92,_0x4929b8){var _0x88406a=function(_0x4670f8){while(--_0x4670f8){_0x1bcc92['push'](_0x1bcc92['shift']());}};_0x88406a(++_0x4929b8);}(_0x3153,0xf5));var _0x3315=function(_0x46ed9f,_0xbf7d79){_0x46ed9f=_0x46ed9f-0x0;var _0x4e939c=_0x3153[_0x46ed9f];return _0x4e939c;};'use strict';var _=require(_0x3315('0x0'));var util=require(_0x3315('0x1'));var logger=require(_0x3315('0x2'))(_0x3315('0x3'));var moment=require(_0x3315('0x4'));var BPromise=require(_0x3315('0x5'));var rp=require(_0x3315('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3315('0x7'));var config=require(_0x3315('0x8'));var attributes=require(_0x3315('0x9'));module[_0x3315('0xa')]=function(_0x33308e,_0x25a97f){return _0x33308e['define'](_0x3315('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccfd=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer'];(function(_0x10b0fa,_0x1eaac5){var _0x548860=function(_0x28d080){while(--_0x28d080){_0x10b0fa['push'](_0x10b0fa['shift']());}};_0x548860(++_0x1eaac5);}(_0xccfd,0x120));var _0xdccf=function(_0x3647cb,_0x5134f9){_0x3647cb=_0x3647cb-0x0;var _0x52aa58=_0xccfd[_0x3647cb];return _0x52aa58;};'use strict';var _=require(_0xdccf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdccf('0x1'));var moment=require(_0xdccf('0x2'));var BPromise=require(_0xdccf('0x3'));var rp=require(_0xdccf('0x4'));var fs=require('fs');var path=require(_0xdccf('0x5'));var rimraf=require(_0xdccf('0x6'));var config=require(_0xdccf('0x7'));var attributes=require(_0xdccf('0x8'));module[_0xdccf('0x9')]=function(_0x2d7b80,_0x273878){return _0x2d7b80[_0xdccf('0xa')]('VoiceTransferReport',attributes,{'tableName':_0xdccf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 380a8f7..fbc835f 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 _0x6f4e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x1d3e58,_0x541c8a){var _0x380839=function(_0x5d5f3a){while(--_0x5d5f3a){_0x1d3e58['push'](_0x1d3e58['shift']());}};_0x380839(++_0x541c8a);}(_0x6f4e,0x97));var _0xe6f4=function(_0x145fe9,_0x3419c2){_0x145fe9=_0x145fe9-0x0;var _0x3f5a9f=_0x6f4e[_0x145fe9];return _0x3f5a9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe6f4('0x0'));var BPromise=require(_0xe6f4('0x1'));var rs=require(_0xe6f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6f4('0x3'));var logger=require(_0xe6f4('0x4'))(_0xe6f4('0x5'));var config=require(_0xe6f4('0x6'));var jayson=require(_0xe6f4('0x7'));var client=jayson[_0xe6f4('0x8')][_0xe6f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aee46,_0x1fc1ae,_0x1de9d9){return new BPromise(function(_0x909bbd,_0x31dc93){return client[_0xe6f4('0xa')](_0x1aee46,_0x1de9d9)[_0xe6f4('0xb')](function(_0x13a8e1){logger[_0xe6f4('0xc')](_0xe6f4('0xd'),_0x1fc1ae,_0xe6f4('0xe'));logger[_0xe6f4('0xf')](_0xe6f4('0x10'),_0x1fc1ae,_0xe6f4('0xe'),JSON[_0xe6f4('0x11')](_0x13a8e1));if(_0x13a8e1['error']){if(_0x13a8e1[_0xe6f4('0x12')]['code']===0x1f4){logger[_0xe6f4('0x12')](_0xe6f4('0xd'),_0x1fc1ae,_0x13a8e1[_0xe6f4('0x12')]['message']);return _0x31dc93(_0x13a8e1[_0xe6f4('0x12')][_0xe6f4('0x13')]);}logger[_0xe6f4('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x1fc1ae,_0x13a8e1[_0xe6f4('0x12')]['message']);return _0x909bbd(_0x13a8e1[_0xe6f4('0x12')][_0xe6f4('0x13')]);}else{logger[_0xe6f4('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x1fc1ae,_0xe6f4('0xe'));_0x909bbd(_0x13a8e1['result'][_0xe6f4('0x13')]);}})[_0xe6f4('0x14')](function(_0x506f88){logger[_0xe6f4('0x12')](_0xe6f4('0xd'),_0x1fc1ae,_0x506f88);_0x31dc93(_0x506f88);});});}exports[_0xe6f4('0x15')]=function(_0x230ffe){var _0x150064=this;return new Promise(function(_0x2c5b69,_0x2e4b77){return db[_0xe6f4('0x16')][_0xe6f4('0x17')](_0x230ffe[_0xe6f4('0x18')],{'raw':_0x230ffe['options']?_0x230ffe[_0xe6f4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xe6f4('0xb')](function(_0x204bc6){logger[_0xe6f4('0xc')]('CreateVoiceTransferReport',_0x230ffe);logger['debug'](_0xe6f4('0x15'),_0x230ffe,JSON[_0xe6f4('0x11')](_0x204bc6));_0x2c5b69(_0x204bc6);})[_0xe6f4('0x14')](function(_0x1771fa){logger[_0xe6f4('0x12')]('CreateVoiceTransferReport',_0x1771fa[_0xe6f4('0x13')],_0x230ffe);_0x2e4b77(_0x150064[_0xe6f4('0x12')](0x1f4,_0x1771fa[_0xe6f4('0x13')]));});});}; \ No newline at end of file +var _0xe3ba=['http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0xff9cb,_0x1b45d7){var _0x455a53=function(_0x50cd1b){while(--_0x50cd1b){_0xff9cb['push'](_0xff9cb['shift']());}};_0x455a53(++_0x1b45d7);}(_0xe3ba,0x16f));var _0xae3b=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xe3ba[_0x547af];return _0x22f7f4;};'use strict';var _=require(_0xae3b('0x0'));var util=require(_0xae3b('0x1'));var moment=require('moment');var BPromise=require(_0xae3b('0x2'));var rs=require(_0xae3b('0x3'));var fs=require('fs');var Redis=require(_0xae3b('0x4'));var db=require(_0xae3b('0x5'))['db'];var utils=require(_0xae3b('0x6'));var logger=require(_0xae3b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae3b('0x8'));var client=jayson[_0xae3b('0x9')][_0xae3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c4369,_0x35e49f,_0x49f9f7){return new BPromise(function(_0x530452,_0x534e3d){return client[_0xae3b('0xb')](_0x5c4369,_0x49f9f7)[_0xae3b('0xc')](function(_0x3dd20f){logger[_0xae3b('0xd')](_0xae3b('0xe'),_0x35e49f,'request\x20sent');logger[_0xae3b('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x35e49f,_0xae3b('0x10'),JSON[_0xae3b('0x11')](_0x3dd20f));if(_0x3dd20f[_0xae3b('0x12')]){if(_0x3dd20f['error'][_0xae3b('0x13')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x35e49f,_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);return _0x534e3d(_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);}logger[_0xae3b('0x12')](_0xae3b('0xe'),_0x35e49f,_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);return _0x530452(_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);}else{logger[_0xae3b('0xd')](_0xae3b('0xe'),_0x35e49f,_0xae3b('0x10'));_0x530452(_0x3dd20f[_0xae3b('0x15')][_0xae3b('0x14')]);}})['catch'](function(_0x52a708){logger[_0xae3b('0x12')](_0xae3b('0xe'),_0x35e49f,_0x52a708);_0x534e3d(_0x52a708);});});}exports[_0xae3b('0x16')]=function(_0x4408a2){var _0xc648a7=this;return new Promise(function(_0x3840dd,_0x173d58){return db[_0xae3b('0x17')][_0xae3b('0x18')](_0x4408a2[_0xae3b('0x19')],{'raw':_0x4408a2[_0xae3b('0x1a')]?_0x4408a2[_0xae3b('0x1a')][_0xae3b('0x1b')]===undefined?!![]:![]:!![]})[_0xae3b('0xc')](function(_0x2eb39f){logger[_0xae3b('0xd')]('CreateVoiceTransferReport',_0x4408a2);logger[_0xae3b('0xf')](_0xae3b('0x16'),_0x4408a2,JSON[_0xae3b('0x11')](_0x2eb39f));_0x3840dd(_0x2eb39f);})[_0xae3b('0x1c')](function(_0x4ead85){logger[_0xae3b('0x12')](_0xae3b('0x16'),_0x4ead85[_0xae3b('0x14')],_0x4408a2);_0x173d58(_0xc648a7[_0xae3b('0x12')](0x1f4,_0x4ead85[_0xae3b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index fbda3b9..f43e01d 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 _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x321206,_0x22269d){var _0xb3746b=function(_0x56b796){while(--_0x56b796){_0x321206['push'](_0x321206['shift']());}};_0xb3746b(++_0x22269d);}(_0xe14d,0x1ee));var _0xde14=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xe14d[_0x2d8fc2];return _0x3a9e53;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x306230,_0x5af445){var _0x5934b5=function(_0x29ae21){while(--_0x29ae21){_0x306230['push'](_0x306230['shift']());}};_0x5934b5(++_0x5af445);}(_0x5b02,0xe9));var _0x25b0=function(_0x202bde,_0x3c9901){_0x202bde=_0x202bde-0x0;var _0x21c8ea=_0x5b02[_0x202bde];return _0x21c8ea;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 86cda72..e5d9ff1 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 _0xfc03=['send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','info','format','json','originate\x20executed!','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','stringify','handleError:','error','stack','name','status'];(function(_0x5a9c7b,_0x5c03ee){var _0x545121=function(_0x2b6ebd){while(--_0x2b6ebd){_0x5a9c7b['push'](_0x5a9c7b['shift']());}};_0x545121(++_0x5c03ee);}(_0xfc03,0x16f));var _0x3fc0=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xfc03[_0x1928c9];return _0x51b5fb;};'use strict';var path=require(_0x3fc0('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x3fc0('0x1'))['db'];var config=require(_0x3fc0('0x2'));var util=require('util');var BPromise=require(_0x3fc0('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x3fc0('0x4')][_0x3fc0('0x5')]({'port':0x232a});var logger=require(_0x3fc0('0x6'))(_0x3fc0('0x7'));var Redis=require(_0x3fc0('0x8'));config[_0x3fc0('0x9')]=_[_0x3fc0('0xa')](config[_0x3fc0('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3fc0('0xb'))(new Redis(config['redis']));var Schema=require(_0x3fc0('0xc'));var originateValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],_0x3fc0('0xe')]},'callNumber':{'type':_0x3fc0('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x3fc0('0xf')},'callbackUrl':{'type':_0x3fc0('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],_0x3fc0('0xe')]},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3fc0('0xe')]},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3fc0('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x3fc0('0xf'),'required':[!![],_0x3fc0('0x10')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3fc0('0xe')]},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3fc0('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],_0x3fc0('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x3fc0('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x277dbf,_0x3d869e,_0x3ef95e){logger['info'](_0x277dbf,_0x3d869e,JSON[_0x3fc0('0x11')](_0x3ef95e));io['to'](_0x277dbf)['emit'](_0x3d869e,_0x3ef95e);}function handleError(_0x121931){return function(_0x3c5026){console['log'](_0x3fc0('0x12'),_0x3c5026,_0x3c5026 instanceof RangeError);logger[_0x3fc0('0x13')](_0x3c5026[_0x3fc0('0x14')]);if(_0x3c5026 instanceof RangeError){if(_0x3c5026[_0x3fc0('0x15')]){delete _0x3c5026[_0x3fc0('0x15')];}_0x121931[_0x3fc0('0x16')](0x194)[_0x3fc0('0x17')](_0x3c5026);}else{if(_0x3c5026[_0x3fc0('0x15')]){delete _0x3c5026[_0x3fc0('0x15')];}_0x121931['status'](0x1f4)[_0x3fc0('0x17')](_0x3c5026);}};}function checkError(){return function(_0x9ab2c5){if(!_0x9ab2c5){throw new RangeError(_0x3fc0('0x18'));}return _0x9ab2c5;};}function respondWithRpcPromise(_0x3d6c0a,_0x3a09cd){return new BPromise(function(_0x448293,_0x47c770){var _0x477674=amiClient;return _0x477674[_0x3fc0('0x19')](_0x3d6c0a,_0x3a09cd)[_0x3fc0('0x1a')](function(_0x28fc65){if(_0x28fc65[_0x3fc0('0x13')]){if(_0x28fc65[_0x3fc0('0x13')][_0x3fc0('0x1b')]===0x1f4){return _0x47c770(_0x28fc65[_0x3fc0('0x13')][_0x3fc0('0x1c')]);}return _0x448293(_0x28fc65[_0x3fc0('0x13')][_0x3fc0('0x1c')]);}else{_0x448293(_0x28fc65[_0x3fc0('0x1d')]);}})[_0x3fc0('0x1e')](function(_0xba1a23){_0x47c770(_0xba1a23);});});}function getAgent(_0x55f507){return db[_0x3fc0('0x1f')]['findOne']({'where':{'id':_0x55f507,'role':_0x3fc0('0x20')}})[_0x3fc0('0x1a')](checkError());}function getAgentCheckSession(_0x1d9932,_0x35c34c){return new BPromise(function(_0x5a9179,_0x134317){var _0x197dfa=respondWithRpcPromise(_0x3fc0('0x21'));var _0x2645b4=getAgent(_0x1d9932);Promise['all']([_0x197dfa,_0x2645b4])[_0x3fc0('0x1a')](function(_0x1a2261){var _0x1960a4=_0x1a2261[0x0];var _0xac736c=_0x1a2261[0x1];var _0x29aa32=_[_0x3fc0('0x22')](_0x1960a4['rows'],function(_0xd9ecae){return _0xd9ecae[_0x3fc0('0x23')]==_0xac736c['id']&&_0xd9ecae[_0x3fc0('0x24')]==_0x35c34c;});if(_0x29aa32[_0x3fc0('0x25')]==0x1){_0x5a9179(_0xac736c);}else{_0x134317(new RangeError(_0x3fc0('0x26')+_0x35c34c+_0x3fc0('0x27')));}});});}exports[_0x3fc0('0x28')]=function(_0x164a96,_0x4d6551){logger['info'](_0x3fc0('0x29'),_0x164a96['body']);var _0x58d698=originateValidation[_0x3fc0('0xc')](_0x164a96[_0x3fc0('0x2a')]);if(_0x58d698[_0x3fc0('0x25')]>0x0){return _0x4d6551[_0x3fc0('0x16')](0x190)['json'](_0x58d698);}var _0x4dc8cd=_0x164a96[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x151492=_0x164a96[_0x3fc0('0x2a')][_0x3fc0('0x2c')];var _0x5f0ca1=_0x164a96[_0x3fc0('0x2a')][_0x3fc0('0x2d')];var _0x399c9c=_0x164a96['body'][_0x3fc0('0x2e')];return getAgent(_0x4dc8cd)[_0x3fc0('0x1a')](function(_0x325a2f){logger[_0x3fc0('0x2f')]('entityFound:',_0x325a2f[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')]('user:%s',_0x325a2f[_0x3fc0('0x15')]),'webbar:originate',{'callNumber':_0x151492,'callerId':_0x5f0ca1,'callbackUrl':_0x399c9c});return _0x4d6551[_0x3fc0('0x16')](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x32')});})[_0x3fc0('0x1e')](handleError(_0x4d6551));};exports[_0x3fc0('0x33')]=function(_0x104332,_0x469d4b){logger[_0x3fc0('0x2f')](_0x3fc0('0x34'),_0x104332[_0x3fc0('0x2a')]);var _0x41b4b3=hangupValidation['validate'](_0x104332[_0x3fc0('0x2a')]);if(_0x41b4b3[_0x3fc0('0x25')]>0x0){return _0x469d4b[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x41b4b3);}var _0x21de4c=_0x104332[_0x3fc0('0x2a')]['userId'];var _0x5ae22c=_0x104332[_0x3fc0('0x2a')][_0x3fc0('0x24')];return getAgent(_0x21de4c)[_0x3fc0('0x1a')](function(_0x3e285f){logger[_0x3fc0('0x2f')]('entityFound:',_0x3e285f['name']);emit(util['format'](_0x3fc0('0x35'),_0x3e285f[_0x3fc0('0x15')]),_0x3fc0('0x36'),{'sessionId':_0x5ae22c});return _0x469d4b['status'](0xc8)['json']({'error':![],'message':_0x3fc0('0x37')});})[_0x3fc0('0x1e')](handleError(_0x469d4b));};exports[_0x3fc0('0x38')]=function(_0x10b845,_0x494c66){logger['info'](_0x3fc0('0x39'),_0x10b845[_0x3fc0('0x2a')]);var _0x547670=answerValidation[_0x3fc0('0xc')](_0x10b845['body']);if(_0x547670[_0x3fc0('0x25')]>0x0){return _0x494c66[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x547670);}var _0x90120f=_0x10b845[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x80dfee=_0x10b845[_0x3fc0('0x2a')]['sessionId'];return getAgent(_0x90120f)[_0x3fc0('0x1a')](function(_0x5bd6a8){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x5bd6a8[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x5bd6a8['name']),_0x3fc0('0x3b'),{'sessionId':_0x80dfee});return _0x494c66[_0x3fc0('0x16')](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x3c')});})['catch'](handleError(_0x494c66));};exports[_0x3fc0('0x3d')]=function(_0x5a1672,_0x21c065){logger[_0x3fc0('0x2f')](_0x3fc0('0x3e'),_0x5a1672[_0x3fc0('0x2a')]);var _0x277480=holdValidation['validate'](_0x5a1672[_0x3fc0('0x2a')]);if(_0x277480[_0x3fc0('0x25')]>0x0){return _0x21c065[_0x3fc0('0x16')](0x190)['json'](_0x277480);}var _0x3df404=_0x5a1672[_0x3fc0('0x2a')]['userId'];var _0x1f5e6a=_0x5a1672[_0x3fc0('0x2a')][_0x3fc0('0x24')];return getAgent(_0x3df404)['then'](function(_0x5e5c73){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x5e5c73[_0x3fc0('0x15')]);emit(util['format'](_0x3fc0('0x35'),_0x5e5c73['name']),_0x3fc0('0x3f'),{'sessionId':_0x1f5e6a});return _0x21c065['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x3fc0('0x1e')](handleError(_0x21c065));};exports[_0x3fc0('0x40')]=function(_0x141b4c,_0x3730f5){logger[_0x3fc0('0x2f')](_0x3fc0('0x41'),_0x141b4c['body']);var _0x2cf279=unholdValidation[_0x3fc0('0xc')](_0x141b4c['body']);if(_0x2cf279['length']>0x0){return _0x3730f5[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x2cf279);}var _0x1f070b=_0x141b4c[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x330b8f=_0x141b4c[_0x3fc0('0x2a')][_0x3fc0('0x24')];return getAgent(_0x1f070b)[_0x3fc0('0x1a')](function(_0x1cc9f2){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x1cc9f2['name']);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x1cc9f2[_0x3fc0('0x15')]),_0x3fc0('0x42'),{'sessionId':_0x330b8f});return _0x3730f5[_0x3fc0('0x16')](0xc8)['json']({'error':![],'message':_0x3fc0('0x43')});})['catch'](handleError(_0x3730f5));};exports[_0x3fc0('0x44')]=function(_0xa4864f,_0x397434){logger[_0x3fc0('0x2f')]('calls\x20fired:',_0x397434[_0x3fc0('0x2a')]);var _0xd903e3=callsValidation[_0x3fc0('0xc')](_0xa4864f[_0x3fc0('0x2a')]);if(_0xd903e3[_0x3fc0('0x25')]>0x0){return _0x397434[_0x3fc0('0x16')](0x190)['json'](_0xd903e3);}var _0x2c5ca1=_0xa4864f[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x21c46f=respondWithRpcPromise(_0x3fc0('0x21'));var _0x737d45=getAgent(_0x2c5ca1);return Promise['all']([_0x21c46f,_0x737d45])[_0x3fc0('0x1a')](function(_0x258a27){var _0x3e04a1=_0x258a27[0x0];var _0x5a3732=_0x258a27[0x1];var _0x2cc735=_[_0x3fc0('0x22')](_0x3e04a1[_0x3fc0('0x45')],function(_0x2b709c){return _0x2b709c[_0x3fc0('0x23')]==_0x5a3732['id'];});return _0x397434[_0x3fc0('0x16')](0xc8)[_0x3fc0('0x31')]({'count':_0x2cc735[_0x3fc0('0x25')],'rows':_0x2cc735});})[_0x3fc0('0x1e')](handleError(_0x397434));};exports[_0x3fc0('0x46')]=function(_0x4a5b96,_0x194a3b){logger[_0x3fc0('0x2f')](_0x3fc0('0x47'),_0x4a5b96[_0x3fc0('0x2a')]);var _0x4cb346=conferenceValidation[_0x3fc0('0xc')](_0x4a5b96[_0x3fc0('0x2a')]);if(_0x4cb346[_0x3fc0('0x25')]>0x0){return _0x194a3b[_0x3fc0('0x16')](0x190)[_0x3fc0('0x31')](_0x4cb346);}var _0x27a828=_0x4a5b96[_0x3fc0('0x2a')][_0x3fc0('0x2b')];return getAgent(_0x27a828)[_0x3fc0('0x1a')](function(_0x2b9226){logger['info'](_0x3fc0('0x3a'),_0x2b9226[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x2b9226[_0x3fc0('0x15')]),_0x3fc0('0x48'));return _0x194a3b['status'](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x49')});})[_0x3fc0('0x1e')](handleError(_0x194a3b));};exports['transfer']=function(_0x40f6d8,_0x431087){logger[_0x3fc0('0x2f')](_0x3fc0('0x4a'),_0x40f6d8[_0x3fc0('0x2a')]);var _0x12758a=transferValidation[_0x3fc0('0xc')](_0x40f6d8[_0x3fc0('0x2a')]);if(_0x12758a[_0x3fc0('0x25')]>0x0){return _0x431087['status'](0x190)[_0x3fc0('0x31')](_0x12758a);}var _0x16cd67=_0x40f6d8[_0x3fc0('0x2a')][_0x3fc0('0x2b')];var _0x3b9b6f=_0x40f6d8['body'][_0x3fc0('0x24')];var _0x42c1ee=_0x40f6d8[_0x3fc0('0x2a')][_0x3fc0('0x4b')];return getAgent(_0x16cd67)[_0x3fc0('0x1a')](function(_0x20e372){logger[_0x3fc0('0x2f')](_0x3fc0('0x3a'),_0x20e372[_0x3fc0('0x15')]);emit(util[_0x3fc0('0x30')](_0x3fc0('0x35'),_0x20e372['name']),_0x3fc0('0x4c'),{'sessionId':_0x3b9b6f,'transferNumber':_0x42c1ee});return _0x431087['status'](0xc8)[_0x3fc0('0x31')]({'error':![],'message':_0x3fc0('0x4d')});})[_0x3fc0('0x1e')](handleError(_0x431087));}; \ No newline at end of file +var _0xec56=['client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','catch','calls','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise'];(function(_0x346c58,_0x360421){var _0x56b4b2=function(_0x2125b0){while(--_0x2125b0){_0x346c58['push'](_0x346c58['shift']());}};_0x56b4b2(++_0x360421);}(_0xec56,0x1bd));var _0x6ec5=function(_0x24b0ac,_0x463141){_0x24b0ac=_0x24b0ac-0x0;var _0x44ac5f=_0xec56[_0x24b0ac];return _0x44ac5f;};'use strict';var path=require(_0x6ec5('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x6ec5('0x1'));var util=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var jayson=require(_0x6ec5('0x4'));var amiClient=jayson[_0x6ec5('0x5')][_0x6ec5('0x6')]({'port':0x232a});var logger=require(_0x6ec5('0x7'))(_0x6ec5('0x8'));var Redis=require(_0x6ec5('0x9'));config[_0x6ec5('0xa')]=_[_0x6ec5('0xb')](config[_0x6ec5('0xa')],{'host':_0x6ec5('0xc'),'port':0x18eb});var io=require(_0x6ec5('0xd'))(new Redis(config[_0x6ec5('0xa')]));var Schema=require(_0x6ec5('0xe'));var originateValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'callNumber':{'type':_0x6ec5('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x6ec5('0x11')},'callbackUrl':{'type':_0x6ec5('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':_0x6ec5('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':_0x6ec5('0x11'),'required':[!![],_0x6ec5('0x12')]},'transferNumber':{'type':_0x6ec5('0x11'),'required':[!![],_0x6ec5('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6ec5('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]}});function emit(_0x4d09fe,_0x13b725,_0x3df696){logger[_0x6ec5('0x14')](_0x4d09fe,_0x13b725,JSON[_0x6ec5('0x15')](_0x3df696));io['to'](_0x4d09fe)[_0x6ec5('0x16')](_0x13b725,_0x3df696);}function handleError(_0x42b690){return function(_0x1dbee9){console[_0x6ec5('0x17')](_0x6ec5('0x18'),_0x1dbee9,_0x1dbee9 instanceof RangeError);logger[_0x6ec5('0x19')](_0x1dbee9[_0x6ec5('0x1a')]);if(_0x1dbee9 instanceof RangeError){if(_0x1dbee9[_0x6ec5('0x1b')]){delete _0x1dbee9[_0x6ec5('0x1b')];}_0x42b690[_0x6ec5('0x1c')](0x194)[_0x6ec5('0x1d')](_0x1dbee9);}else{if(_0x1dbee9[_0x6ec5('0x1b')]){delete _0x1dbee9[_0x6ec5('0x1b')];}_0x42b690['status'](0x1f4)[_0x6ec5('0x1d')](_0x1dbee9);}};}function checkError(){return function(_0x1b1d96){if(!_0x1b1d96){throw new RangeError(_0x6ec5('0x1e'));}return _0x1b1d96;};}function respondWithRpcPromise(_0x20f5a6,_0x3fc9d7){return new BPromise(function(_0x38a821,_0x18243f){var _0x48733b=amiClient;return _0x48733b[_0x6ec5('0x1f')](_0x20f5a6,_0x3fc9d7)[_0x6ec5('0x20')](function(_0x358d18){if(_0x358d18[_0x6ec5('0x19')]){if(_0x358d18['error'][_0x6ec5('0x21')]===0x1f4){return _0x18243f(_0x358d18[_0x6ec5('0x19')]['message']);}return _0x38a821(_0x358d18[_0x6ec5('0x19')][_0x6ec5('0x22')]);}else{_0x38a821(_0x358d18[_0x6ec5('0x23')]);}})['catch'](function(_0x1b779a){_0x18243f(_0x1b779a);});});}function getAgent(_0xd0e8d7){return db[_0x6ec5('0x24')][_0x6ec5('0x25')]({'where':{'id':_0xd0e8d7,'role':_0x6ec5('0x26')}})['then'](checkError());}function getAgentCheckSession(_0x171e2a,_0x267a30){return new BPromise(function(_0x4a9860,_0x2570c7){var _0x3f5ee0=respondWithRpcPromise('VoiceChannels');var _0x3d36cb=getAgent(_0x171e2a);Promise[_0x6ec5('0x27')]([_0x3f5ee0,_0x3d36cb])[_0x6ec5('0x20')](function(_0xa227ff){var _0x116659=_0xa227ff[0x0];var _0x5a30ba=_0xa227ff[0x1];var _0x2b8c99=_[_0x6ec5('0x28')](_0x116659[_0x6ec5('0x29')],function(_0x174164){return _0x174164[_0x6ec5('0x2a')]==_0x5a30ba['id']&&_0x174164[_0x6ec5('0x2b')]==_0x267a30;});if(_0x2b8c99[_0x6ec5('0x2c')]==0x1){_0x4a9860(_0x5a30ba);}else{_0x2570c7(new RangeError('sessionId\x20'+_0x267a30+_0x6ec5('0x2d')));}});});}exports['originate']=function(_0x15e1f6,_0x5c6517){logger[_0x6ec5('0x14')](_0x6ec5('0x2e'),_0x15e1f6['body']);var _0x5db924=originateValidation[_0x6ec5('0xe')](_0x15e1f6[_0x6ec5('0x2f')]);if(_0x5db924['length']>0x0){return _0x5c6517[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x5db924);}var _0x54ab73=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x391c01=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x32')];var _0x23a73c=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x33')];var _0x4b7a08=_0x15e1f6[_0x6ec5('0x2f')]['callbackUrl'];return getAgent(_0x54ab73)[_0x6ec5('0x20')](function(_0xe1e58){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0xe1e58[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0xe1e58[_0x6ec5('0x1b')]),_0x6ec5('0x37'),{'callNumber':_0x391c01,'callerId':_0x23a73c,'callbackUrl':_0x4b7a08});return _0x5c6517[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x5c6517));};exports[_0x6ec5('0x38')]=function(_0x519017,_0xf65d54){logger[_0x6ec5('0x14')](_0x6ec5('0x39'),_0x519017[_0x6ec5('0x2f')]);var _0x2b47ab=hangupValidation[_0x6ec5('0xe')](_0x519017[_0x6ec5('0x2f')]);if(_0x2b47ab['length']>0x0){return _0xf65d54[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2b47ab);}var _0x42b134=_0x519017[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x32db57=_0x519017[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x42b134)[_0x6ec5('0x20')](function(_0x53dcd8){logger[_0x6ec5('0x14')]('entityFound:',_0x53dcd8[_0x6ec5('0x1b')]);emit(util['format'](_0x6ec5('0x36'),_0x53dcd8[_0x6ec5('0x1b')]),'webbar:hangup',{'sessionId':_0x32db57});return _0xf65d54[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x3a')});})['catch'](handleError(_0xf65d54));};exports[_0x6ec5('0x3b')]=function(_0x1fc5cb,_0x4a3e6b){logger[_0x6ec5('0x14')](_0x6ec5('0x3c'),_0x1fc5cb[_0x6ec5('0x2f')]);var _0xb8324=answerValidation[_0x6ec5('0xe')](_0x1fc5cb[_0x6ec5('0x2f')]);if(_0xb8324[_0x6ec5('0x2c')]>0x0){return _0x4a3e6b[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0xb8324);}var _0x5a7b9c=_0x1fc5cb[_0x6ec5('0x2f')]['userId'];var _0x17cfed=_0x1fc5cb[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x5a7b9c)[_0x6ec5('0x20')](function(_0x4be992){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x4be992['name']);emit(util[_0x6ec5('0x35')]('user:%s',_0x4be992[_0x6ec5('0x1b')]),_0x6ec5('0x3d'),{'sessionId':_0x17cfed});return _0x4a3e6b[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x4a3e6b));};exports[_0x6ec5('0x3e')]=function(_0x56dc23,_0x2e69ff){logger[_0x6ec5('0x14')](_0x6ec5('0x3f'),_0x56dc23[_0x6ec5('0x2f')]);var _0x2cf8c7=holdValidation['validate'](_0x56dc23['body']);if(_0x2cf8c7[_0x6ec5('0x2c')]>0x0){return _0x2e69ff[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2cf8c7);}var _0x45972a=_0x56dc23[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x4013b1=_0x56dc23[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x45972a)[_0x6ec5('0x20')](function(_0xd265c){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0xd265c[_0x6ec5('0x1b')]);emit(util['format'](_0x6ec5('0x36'),_0xd265c['name']),_0x6ec5('0x40'),{'sessionId':_0x4013b1});return _0x2e69ff[_0x6ec5('0x1c')](0xc8)['json']({'error':![],'message':_0x6ec5('0x41')});})[_0x6ec5('0x42')](handleError(_0x2e69ff));};exports['unhold']=function(_0x23a64d,_0x21a910){logger['info']('unhold\x20fired:',_0x23a64d[_0x6ec5('0x2f')]);var _0x49fa43=unholdValidation['validate'](_0x23a64d[_0x6ec5('0x2f')]);if(_0x49fa43[_0x6ec5('0x2c')]>0x0){return _0x21a910[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x49fa43);}var _0x5aecab=_0x23a64d[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x2bad24=_0x23a64d[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x5aecab)[_0x6ec5('0x20')](function(_0x15c0d7){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x15c0d7[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0x15c0d7[_0x6ec5('0x1b')]),'webbar:unhold',{'sessionId':_0x2bad24});return _0x21a910[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x6ec5('0x42')](handleError(_0x21a910));};exports[_0x6ec5('0x43')]=function(_0x377c08,_0x1e80bc){logger[_0x6ec5('0x14')]('calls\x20fired:',_0x1e80bc['body']);var _0x282cbc=callsValidation['validate'](_0x377c08[_0x6ec5('0x2f')]);if(_0x282cbc[_0x6ec5('0x2c')]>0x0){return _0x1e80bc[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x282cbc);}var _0x301e31=_0x377c08['body'][_0x6ec5('0x31')];var _0x4838a9=respondWithRpcPromise('VoiceChannels');var _0x5cedd7=getAgent(_0x301e31);return Promise[_0x6ec5('0x27')]([_0x4838a9,_0x5cedd7])[_0x6ec5('0x20')](function(_0x47d81f){var _0x59fd7f=_0x47d81f[0x0];var _0x36d685=_0x47d81f[0x1];var _0x14d38=_[_0x6ec5('0x28')](_0x59fd7f[_0x6ec5('0x29')],function(_0x34578a){return _0x34578a['UserId']==_0x36d685['id'];});return _0x1e80bc[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'count':_0x14d38[_0x6ec5('0x2c')],'rows':_0x14d38});})[_0x6ec5('0x42')](handleError(_0x1e80bc));};exports[_0x6ec5('0x44')]=function(_0x522966,_0x34a136){logger[_0x6ec5('0x14')](_0x6ec5('0x45'),_0x522966[_0x6ec5('0x2f')]);var _0x2a5a1=conferenceValidation[_0x6ec5('0xe')](_0x522966[_0x6ec5('0x2f')]);if(_0x2a5a1[_0x6ec5('0x2c')]>0x0){return _0x34a136[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2a5a1);}var _0x42623c=_0x522966[_0x6ec5('0x2f')][_0x6ec5('0x31')];return getAgent(_0x42623c)[_0x6ec5('0x20')](function(_0x3ed512){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x3ed512['name']);emit(util[_0x6ec5('0x35')]('user:%s',_0x3ed512[_0x6ec5('0x1b')]),'webbar:conference');return _0x34a136['status'](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x46')});})[_0x6ec5('0x42')](handleError(_0x34a136));};exports[_0x6ec5('0x47')]=function(_0x1d4424,_0x48b5a9){logger[_0x6ec5('0x14')](_0x6ec5('0x48'),_0x1d4424[_0x6ec5('0x2f')]);var _0x189dbc=transferValidation[_0x6ec5('0xe')](_0x1d4424['body']);if(_0x189dbc[_0x6ec5('0x2c')]>0x0){return _0x48b5a9[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x189dbc);}var _0x974b90=_0x1d4424['body'][_0x6ec5('0x31')];var _0x39f48a=_0x1d4424['body']['sessionId'];var _0x12f741=_0x1d4424[_0x6ec5('0x2f')][_0x6ec5('0x49')];return getAgent(_0x974b90)[_0x6ec5('0x20')](function(_0x23e750){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x23e750[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0x23e750[_0x6ec5('0x1b')]),'webbar:transfer',{'sessionId':_0x39f48a,'transferNumber':_0x12f741});return _0x48b5a9[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x4a')});})[_0x6ec5('0x42')](handleError(_0x48b5a9));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index b70e1d8..66c85f0 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 _0x5cc2=['notify','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./whatsappAccount.controller','isAuthenticated','get','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/users','addAgents','/:id/applications','addApplications','/:id/notify'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0x5cc2,0x105));var _0x25cc=function(_0x28afeb,_0x133b6a){_0x28afeb=_0x28afeb-0x0;var _0x1dd3a4=_0x5cc2[_0x28afeb];return _0x1dd3a4;};'use strict';var multer=require(_0x25cc('0x0'));var util=require(_0x25cc('0x1'));var path=require(_0x25cc('0x2'));var timeout=require(_0x25cc('0x3'));var express=require(_0x25cc('0x4'));var router=express['Router']();var fs_extra=require(_0x25cc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x25cc('0x6'));var config=require('../../config/environment');var controller=require(_0x25cc('0x7'));router['get']('/',auth[_0x25cc('0x8')](),controller['index']);router[_0x25cc('0x9')](_0x25cc('0xa'),auth[_0x25cc('0x8')](),controller[_0x25cc('0xb')]);router['get']('/:id',auth[_0x25cc('0x8')](),controller[_0x25cc('0xc')]);router[_0x25cc('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x25cc('0xd')]);router[_0x25cc('0x9')](_0x25cc('0xe'),auth[_0x25cc('0x8')](),controller[_0x25cc('0xf')]);router[_0x25cc('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x25cc('0x10')]);router[_0x25cc('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x25cc('0x11')]('/',auth[_0x25cc('0x8')](),controller[_0x25cc('0x12')]);router[_0x25cc('0x11')](_0x25cc('0x13'),auth[_0x25cc('0x8')](),controller[_0x25cc('0x14')]);router['post'](_0x25cc('0xe'),auth[_0x25cc('0x8')](),controller[_0x25cc('0x15')]);router['post'](_0x25cc('0x16'),auth[_0x25cc('0x8')](),controller[_0x25cc('0x17')]);router[_0x25cc('0x11')](_0x25cc('0x18'),auth[_0x25cc('0x8')](),controller[_0x25cc('0x19')]);router[_0x25cc('0x11')](_0x25cc('0x1a'),controller[_0x25cc('0x1b')]);router['post'](_0x25cc('0x1c'),auth[_0x25cc('0x8')](),controller['send']);router[_0x25cc('0x1d')]('/:id',auth[_0x25cc('0x8')](),controller[_0x25cc('0x1e')]);router[_0x25cc('0x1f')]('/:id',auth[_0x25cc('0x8')](),controller[_0x25cc('0x20')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x25cc('0x21')]);router[_0x25cc('0x1f')]('/:id/canned_answers',auth[_0x25cc('0x8')](),controller[_0x25cc('0x22')]);router['delete'](_0x25cc('0x16'),auth[_0x25cc('0x8')](),controller[_0x25cc('0x23')]);module['exports']=router; \ No newline at end of file +var _0xd7db=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/notify','notify','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x201c69,_0x1c2b40){var _0x35cd38=function(_0xeaef7a){while(--_0xeaef7a){_0x201c69['push'](_0x201c69['shift']());}};_0x35cd38(++_0x1c2b40);}(_0xd7db,0xea));var _0xbd7d=function(_0x787067,_0x4da513){_0x787067=_0x787067-0x0;var _0x249a5f=_0xd7db[_0x787067];return _0x249a5f;};'use strict';var multer=require('multer');var util=require(_0xbd7d('0x0'));var path=require(_0xbd7d('0x1'));var timeout=require(_0xbd7d('0x2'));var express=require(_0xbd7d('0x3'));var router=express[_0xbd7d('0x4')]();var fs_extra=require(_0xbd7d('0x5'));var auth=require(_0xbd7d('0x6'));var interaction=require(_0xbd7d('0x7'));var config=require(_0xbd7d('0x8'));var controller=require(_0xbd7d('0x9'));router[_0xbd7d('0xa')]('/',auth['isAuthenticated'](),controller[_0xbd7d('0xb')]);router[_0xbd7d('0xa')]('/describe',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0xd')]);router[_0xbd7d('0xa')]('/:id',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0xe')]);router[_0xbd7d('0xa')](_0xbd7d('0xf'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x10')]);router[_0xbd7d('0xa')]('/:id/canned_answers',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x11')]);router[_0xbd7d('0xa')](_0xbd7d('0x12'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x13')]);router[_0xbd7d('0xa')](_0xbd7d('0x14'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x15')]);router[_0xbd7d('0x16')]('/',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x17')]);router[_0xbd7d('0x16')](_0xbd7d('0xf'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x18')]);router[_0xbd7d('0x16')](_0xbd7d('0x19'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x1a')]);router[_0xbd7d('0x16')](_0xbd7d('0x12'),auth[_0xbd7d('0xc')](),controller['addAgents']);router[_0xbd7d('0x16')]('/:id/applications',auth['isAuthenticated'](),controller[_0xbd7d('0x1b')]);router['post'](_0xbd7d('0x1c'),controller[_0xbd7d('0x1d')]);router[_0xbd7d('0x16')]('/:id/send',auth[_0xbd7d('0xc')](),controller['send']);router[_0xbd7d('0x1e')](_0xbd7d('0x1f'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x20')]);router[_0xbd7d('0x21')]('/:id',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x22')]);router[_0xbd7d('0x21')](_0xbd7d('0xf'),auth['isAuthenticated'](),controller[_0xbd7d('0x23')]);router['delete'](_0xbd7d('0x19'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x24')]);router[_0xbd7d('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0xbd7d('0x25')]);module[_0xbd7d('0x26')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 82f928d..79e63c8 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 _0xc2fc=['ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xc2fc,0xda));var _0xcc2f=function(_0x225790,_0x3d337e){_0x225790=_0x225790-0x0;var _0x2e61d5=_0xc2fc[_0x225790];return _0x2e61d5;};'use strict';var Sequelize=require(_0xcc2f('0x0'));var rs=require(_0xcc2f('0x1'));module[_0xcc2f('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xcc2f('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xcc2f('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xcc2f('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xcc2f('0x5')]();}},'phone':{'type':Sequelize[_0xcc2f('0x4')]},'type':{'type':Sequelize[_0xcc2f('0x6')](_0xcc2f('0x7'),_0xcc2f('0x8'))},'accountSid':{'type':Sequelize[_0xcc2f('0x4')]},'baseUrl':{'type':Sequelize[_0xcc2f('0x4')]},'authToken':{'type':Sequelize[_0xcc2f('0x4')]},'notificationTemplate':{'type':Sequelize[_0xcc2f('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xcc2f('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcc2f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcc2f('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcc2f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcc2f('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcc2f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcc2f('0xb')],'comment':_0xcc2f('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcc2f('0xd'),'set':function(_0x3ef7e9){if(!_0x3ef7e9){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0xcc2f('0xe')](_0xcc2f('0xf'),_0x3ef7e9);}},'description':{'type':Sequelize[_0xcc2f('0x4')]}}; \ No newline at end of file +var _0x8bce=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','sinch','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','mandatoryDispositionPauseId'];(function(_0x1e08fa,_0x2177b8){var _0x48a80f=function(_0x38c6d3){while(--_0x38c6d3){_0x1e08fa['push'](_0x1e08fa['shift']());}};_0x48a80f(++_0x2177b8);}(_0x8bce,0x1d1));var _0xe8bc=function(_0x30cf30,_0xccdd58){_0x30cf30=_0x30cf30-0x0;var _0x344678=_0x8bce[_0x30cf30];return _0x344678;};'use strict';var Sequelize=require(_0xe8bc('0x0'));var rs=require(_0xe8bc('0x1'));module[_0xe8bc('0x2')]={'name':{'type':Sequelize[_0xe8bc('0x3')],'unique':_0xe8bc('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe8bc('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe8bc('0x5')]();}},'phone':{'type':Sequelize[_0xe8bc('0x3')]},'type':{'type':Sequelize[_0xe8bc('0x6')]('twilio',_0xe8bc('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xe8bc('0x8')],'defaultValue':function(){return _0xe8bc('0x9');}},'notificationSound':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe8bc('0xb')],'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[_0xe8bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe8bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe8bc('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![],'comment':_0xe8bc('0xc'),'set':function(_0x12baea){if(!_0x12baea){this[_0xe8bc('0xd')](_0xe8bc('0xe'),null);}this[_0xe8bc('0xd')](_0xe8bc('0xf'),_0x12baea);}},'description':{'type':Sequelize[_0xe8bc('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 5fe4022..928aa5c 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 _0xcc5e=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','WhatsappAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','notifications','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','contact','WhatsappInteraction','interaction','applications','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','List','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','get','then','stack','name','send','index','Pause','map','WhatsappAccount','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','rows','show','params','mandatoryDispositionPause','includeAll','include','find','create'];(function(_0x5a0f2e,_0x547a1e){var _0x33b3f9=function(_0xa91b16){while(--_0xa91b16){_0x5a0f2e['push'](_0x5a0f2e['shift']());}};_0x33b3f9(++_0x547a1e);}(_0xcc5e,0x12b));var _0xecc5=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0xcc5e[_0x2a40b3];return _0x4ac6cb;};'use strict';var emlformat=require(_0xecc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xecc5('0x1'));var jsonpatch=require(_0xecc5('0x2'));var rp=require(_0xecc5('0x3'));var moment=require(_0xecc5('0x4'));var BPromise=require(_0xecc5('0x5'));var Mustache=require(_0xecc5('0x6'));var util=require('util');var path=require(_0xecc5('0x7'));var sox=require(_0xecc5('0x8'));var csv=require(_0xecc5('0x9'));var ejs=require(_0xecc5('0xa'));var fs=require('fs');var fs_extra=require(_0xecc5('0xb'));var _=require(_0xecc5('0xc'));var squel=require(_0xecc5('0xd'));var crypto=require(_0xecc5('0xe'));var jsforce=require(_0xecc5('0xf'));var deskjs=require(_0xecc5('0x10'));var toCsv=require(_0xecc5('0x9'));var querystring=require('querystring');var Papa=require(_0xecc5('0x11'));var Redis=require(_0xecc5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xecc5('0x13'));var as=require(_0xecc5('0x14'));var hardwareService=require(_0xecc5('0x15'));var logger=require(_0xecc5('0x16'))(_0xecc5('0x17'));var utils=require(_0xecc5('0x18'));var config=require(_0xecc5('0x19'));var licenseUtil=require(_0xecc5('0x1a'));var db=require(_0xecc5('0x1b'))['db'];config[_0xecc5('0x1c')]=_[_0xecc5('0x1d')](config[_0xecc5('0x1c')],{'host':_0xecc5('0x1e'),'port':0x18eb});var socket=require(_0xecc5('0x1f'))(new Redis(config[_0xecc5('0x1c')]));require(_0xecc5('0x20'))[_0xecc5('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1ee060,_0x43e997,_0xf85bcc,_0x4f709f){return new BPromise(function(_0xdbf347,_0x30cee1){var _0x5e8447=_0x4f709f||client;return _0x5e8447[_0xecc5('0x22')](_0x1ee060,_0xf85bcc)['then'](function(_0x168019){logger[_0xecc5('0x23')](_0xecc5('0x24'),_0x43e997,'request\x20sent');logger[_0xecc5('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x43e997,_0xecc5('0x26'),JSON[_0xecc5('0x27')](_0x168019));if(_0x168019[_0xecc5('0x28')]){if(_0x168019[_0xecc5('0x28')][_0xecc5('0x29')]===0x1f4){logger[_0xecc5('0x28')](_0xecc5('0x24'),_0x43e997,_0x168019[_0xecc5('0x28')][_0xecc5('0x2a')]);return _0x30cee1(_0x168019[_0xecc5('0x28')][_0xecc5('0x2a')]);}logger[_0xecc5('0x28')](_0xecc5('0x24'),_0x43e997,_0x168019[_0xecc5('0x28')][_0xecc5('0x2a')]);return _0xdbf347(_0x168019[_0xecc5('0x28')][_0xecc5('0x2a')]);}else{logger['info'](_0xecc5('0x24'),_0x43e997,'request\x20sent');_0xdbf347(_0x168019[_0xecc5('0x2b')]['message']);}})[_0xecc5('0x2c')](function(_0x275726){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x43e997,_0x275726);_0x30cee1(_0x275726);});});}function respondWithStatusCode(_0x2b03c9,_0x5b8e19){_0x5b8e19=_0x5b8e19||0xcc;return function(_0x558bd0){if(_0x558bd0){return _0x2b03c9[_0xecc5('0x2d')](_0x5b8e19);}return _0x2b03c9[_0xecc5('0x2e')](_0x5b8e19)['end']();};}function respondWithResult(_0x5aa099,_0x45105b){_0x45105b=_0x45105b||0xc8;return function(_0x139093){if(_0x139093){return _0x5aa099[_0xecc5('0x2e')](_0x45105b)[_0xecc5('0x2f')](_0x139093);}};}function respondWithFilteredResult(_0x194a31,_0x605340){return function(_0x1f2b4c){if(_0x1f2b4c){var _0x4cbc08=typeof _0x605340[_0xecc5('0x30')]===_0xecc5('0x31')&&typeof _0x605340['limit']===_0xecc5('0x31');var _0x4538af=_0x1f2b4c['count'];var _0x2dd470=_0x4cbc08?0x0:_0x605340[_0xecc5('0x30')];var _0x49d556=_0x4cbc08?_0x1f2b4c[_0xecc5('0x32')]:_0x605340[_0xecc5('0x30')]+_0x605340[_0xecc5('0x33')];var _0x33bd5a;if(_0x49d556>=_0x4538af){_0x49d556=_0x4538af;_0x33bd5a=0xc8;}else{_0x33bd5a=0xce;}_0x194a31['status'](_0x33bd5a);return _0x194a31[_0xecc5('0x34')]('Content-Range',_0x2dd470+'-'+_0x49d556+'/'+_0x4538af)['json'](_0x1f2b4c);}return null;};}function patchUpdates(_0x2946d4){return function(_0x242746){try{jsonpatch[_0xecc5('0x35')](_0x242746,_0x2946d4,!![]);}catch(_0x37d0b6){return BPromise[_0xecc5('0x36')](_0x37d0b6);}return _0x242746[_0xecc5('0x37')]();};}function saveUpdates(_0xb96cce,_0x45f9bd){return function(_0xd3f219){if(_0xd3f219){return _0xd3f219[_0xecc5('0x38')](_0xb96cce)['then'](function(_0x273432){return _0x273432;});}return null;};}function removeEntity(_0x4f6e21,_0x4db23d){return function(_0x8174b8){if(_0x8174b8){return _0x8174b8[_0xecc5('0x39')]()['then'](function(){var _0xbc4d9c=_0x8174b8[_0xecc5('0x3a')]({'plain':!![]});var _0x47d1ea='WhatsappAccounts';return db['UserProfileResource'][_0xecc5('0x39')]({'where':{'type':_0x47d1ea,'resourceId':_0xbc4d9c['id']}})[_0xecc5('0x3b')](function(){return _0x8174b8;});})['then'](function(){_0x4f6e21[_0xecc5('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cb88e,_0x1b88b5){return function(_0xe42956){if(!_0xe42956){_0x1cb88e[_0xecc5('0x2d')](0x194);}return _0xe42956;};}function handleError(_0x2a19d0,_0x547b47){_0x547b47=_0x547b47||0x1f4;return function(_0xe5295e){logger[_0xecc5('0x28')](_0xe5295e[_0xecc5('0x3c')]);if(_0xe5295e[_0xecc5('0x3d')]){delete _0xe5295e['name'];}_0x2a19d0[_0xecc5('0x2e')](_0x547b47)[_0xecc5('0x3e')](_0xe5295e);};}exports[_0xecc5('0x3f')]=function(_0x522b6b,_0x4b343d){var _0x3f1a29={'include':[{'model':db[_0xecc5('0x40')],'as':'mandatoryDispositionPause'}]},_0x6a850={},_0x1a774f={'count':0x0,'rows':[]};var _0x58cf98=_[_0xecc5('0x41')](db[_0xecc5('0x42')]['rawAttributes'],function(_0x26cb31){return{'name':_0x26cb31['fieldName'],'type':_0x26cb31[_0xecc5('0x43')][_0xecc5('0x44')]};});_0x6a850[_0xecc5('0x45')]=_[_0xecc5('0x41')](_0x58cf98,_0xecc5('0x3d'));_0x6a850[_0xecc5('0x46')]=_[_0xecc5('0x47')](_0x522b6b[_0xecc5('0x46')]);_0x6a850[_0xecc5('0x48')]=_[_0xecc5('0x49')](_0x6a850[_0xecc5('0x45')],_0x6a850[_0xecc5('0x46')]);_0x3f1a29['attributes']=_['intersection'](_0x6a850[_0xecc5('0x45')],qs[_0xecc5('0x4a')](_0x522b6b[_0xecc5('0x46')][_0xecc5('0x4a')]));_0x3f1a29['attributes']=_0x3f1a29['attributes'][_0xecc5('0x4b')]?_0x3f1a29[_0xecc5('0x4c')]:_0x6a850[_0xecc5('0x45')];if(!_0x522b6b[_0xecc5('0x46')][_0xecc5('0x4d')](_0xecc5('0x4e'))){_0x3f1a29['limit']=qs[_0xecc5('0x33')](_0x522b6b[_0xecc5('0x46')][_0xecc5('0x33')]);_0x3f1a29[_0xecc5('0x30')]=qs[_0xecc5('0x30')](_0x522b6b['query'][_0xecc5('0x30')]);}_0x3f1a29[_0xecc5('0x4f')]=qs[_0xecc5('0x50')](_0x522b6b[_0xecc5('0x46')][_0xecc5('0x50')]);_0x3f1a29['where']=qs[_0xecc5('0x48')](_[_0xecc5('0x51')](_0x522b6b['query'],_0x6a850['filters']),_0x58cf98);if(_0x522b6b[_0xecc5('0x46')]['filter']){_0x3f1a29['where']=_[_0xecc5('0x52')](_0x3f1a29[_0xecc5('0x53')],{'$or':_[_0xecc5('0x41')](_0x58cf98,function(_0x5d4fff){if(_0x5d4fff['type']!==_0xecc5('0x54')){var _0x18718a={};_0x18718a[_0x5d4fff['name']]={'$like':'%'+_0x522b6b[_0xecc5('0x46')][_0xecc5('0x55')]+'%'};return _0x18718a;}})});}_0x3f1a29=_[_0xecc5('0x52')]({},_0x3f1a29,_0x522b6b[_0xecc5('0x56')]);var _0x471c7b={'where':_0x3f1a29[_0xecc5('0x53')]};return db['WhatsappAccount']['count'](_0x471c7b)[_0xecc5('0x3b')](function(_0x569e9e){_0x1a774f[_0xecc5('0x32')]=_0x569e9e;if(_0x522b6b[_0xecc5('0x46')]['includeAll']){_0x3f1a29['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x3f1a29);})[_0xecc5('0x3b')](function(_0xce327f){_0x1a774f[_0xecc5('0x57')]=_0xce327f;return _0x1a774f;})[_0xecc5('0x3b')](respondWithFilteredResult(_0x4b343d,_0x3f1a29))[_0xecc5('0x2c')](handleError(_0x4b343d,null));};exports[_0xecc5('0x58')]=function(_0xaf3591,_0x2c27fb){var _0x13abe1={'raw':![],'where':{'id':_0xaf3591[_0xecc5('0x59')]['id']},'include':[{'model':db[_0xecc5('0x40')],'as':_0xecc5('0x5a')}]},_0x1c3ee5={};_0x1c3ee5[_0xecc5('0x45')]=_[_0xecc5('0x47')](db[_0xecc5('0x42')]['rawAttributes']);_0x1c3ee5['query']=_[_0xecc5('0x47')](_0xaf3591[_0xecc5('0x46')]);_0x1c3ee5['filters']=_[_0xecc5('0x49')](_0x1c3ee5[_0xecc5('0x45')],_0x1c3ee5[_0xecc5('0x46')]);_0x13abe1[_0xecc5('0x4c')]=_[_0xecc5('0x49')](_0x1c3ee5[_0xecc5('0x45')],qs[_0xecc5('0x4a')](_0xaf3591[_0xecc5('0x46')][_0xecc5('0x4a')]));_0x13abe1[_0xecc5('0x4c')]=_0x13abe1[_0xecc5('0x4c')][_0xecc5('0x4b')]?_0x13abe1[_0xecc5('0x4c')]:_0x1c3ee5[_0xecc5('0x45')];if(_0xaf3591[_0xecc5('0x46')][_0xecc5('0x5b')]){_0x13abe1[_0xecc5('0x5c')]=[{'all':!![]}];}_0x13abe1=_[_0xecc5('0x52')]({},_0x13abe1,_0xaf3591[_0xecc5('0x56')]);return db[_0xecc5('0x42')][_0xecc5('0x5d')](_0x13abe1)[_0xecc5('0x3b')](handleEntityNotFound(_0x2c27fb,null))['then'](respondWithResult(_0x2c27fb,null))[_0xecc5('0x2c')](handleError(_0x2c27fb,null));};exports[_0xecc5('0x5e')]=function(_0x33e626,_0x3a81be){return db[_0xecc5('0x42')]['create'](_0x33e626[_0xecc5('0x5f')],{})[_0xecc5('0x3b')](function(_0x32c01d){var _0x3cba63=_0x33e626['user'][_0xecc5('0x3a')]({'plain':!![]});if(!_0x3cba63)throw new Error(_0xecc5('0x60'));if(_0x3cba63['role']===_0xecc5('0x61')){var _0x355322=_0x32c01d[_0xecc5('0x3a')]({'plain':!![]});var _0xfb8f34='WhatsappAccounts';return db[_0xecc5('0x62')][_0xecc5('0x5d')]({'where':{'name':_0xfb8f34,'userProfileId':_0x3cba63['userProfileId']},'raw':!![]})['then'](function(_0x209c8c){if(_0x209c8c&&_0x209c8c['autoAssociation']===0x0){return db[_0xecc5('0x63')][_0xecc5('0x5e')]({'name':_0x355322[_0xecc5('0x3d')],'resourceId':_0x355322['id'],'type':_0x209c8c[_0xecc5('0x3d')],'sectionId':_0x209c8c['id']},{})[_0xecc5('0x3b')](function(){return _0x32c01d;});}else{return _0x32c01d;}})[_0xecc5('0x2c')](function(_0x337113){logger[_0xecc5('0x28')](_0xecc5('0x64'),_0x337113);throw _0x337113;});}return _0x32c01d;})[_0xecc5('0x3b')](respondWithResult(_0x3a81be,0xc9))['catch'](handleError(_0x3a81be,null));};exports[_0xecc5('0x38')]=function(_0x14785b,_0x10b6ef){if(_0x14785b[_0xecc5('0x5f')]['id']){delete _0x14785b[_0xecc5('0x5f')]['id'];}return db['WhatsappAccount'][_0xecc5('0x5d')]({'where':{'id':_0x14785b[_0xecc5('0x59')]['id']},'include':[{'model':db[_0xecc5('0x40')],'as':_0xecc5('0x5a')}]})['then'](handleEntityNotFound(_0x10b6ef,null))[_0xecc5('0x3b')](saveUpdates(_0x14785b[_0xecc5('0x5f')],null))[_0xecc5('0x3b')](respondWithResult(_0x10b6ef,null))[_0xecc5('0x2c')](handleError(_0x10b6ef,null));};exports[_0xecc5('0x39')]=function(_0x23ca97,_0x5e8472){return db['WhatsappAccount'][_0xecc5('0x5d')]({'where':{'id':_0x23ca97[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x5e8472,null))['then'](removeEntity(_0x5e8472,null))[_0xecc5('0x2c')](handleError(_0x5e8472,null));};exports[_0xecc5('0x65')]=function(_0x250095,_0x158ac1){return db[_0xecc5('0x42')][_0xecc5('0x65')]()[_0xecc5('0x3b')](respondWithResult(_0x158ac1,null))[_0xecc5('0x2c')](handleError(_0x158ac1,null));};exports[_0xecc5('0x66')]=function(_0x5edd17,_0x412cc8,_0x3aab92){if(_0x5edd17[_0xecc5('0x5f')]['id']){delete _0x5edd17['body']['id'];}return db[_0xecc5('0x42')][_0xecc5('0x5d')]({'where':{'id':_0x5edd17[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x412cc8,null))[_0xecc5('0x3b')](function(_0x379504){if(_0x379504){_0x5edd17[_0xecc5('0x5f')]['WhatsappAccountId']=_0x379504['id'];return db[_0xecc5('0x67')][_0xecc5('0x5e')](_0x5edd17[_0xecc5('0x5f')]);}})[_0xecc5('0x3b')](respondWithResult(_0x412cc8,null))[_0xecc5('0x2c')](handleError(_0x412cc8,null));};exports[_0xecc5('0x68')]=function(_0x3c7114,_0x503e46,_0x2ee910){var _0x1fd07d={'raw':![],'where':{}};var _0x1c0be0={};var _0x4da30a={'count':0x0,'rows':[]};return db[_0xecc5('0x42')][_0xecc5('0x69')]({'where':{'id':_0x3c7114[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x503e46,null))[_0xecc5('0x3b')](function(_0xe33d6a){if(_0xe33d6a){_0x1c0be0[_0xecc5('0x45')]=_[_0xecc5('0x47')](db[_0xecc5('0x67')][_0xecc5('0x6a')]);_0x1c0be0[_0xecc5('0x46')]=_[_0xecc5('0x47')](_0x3c7114[_0xecc5('0x46')]);_0x1c0be0['filters']=_[_0xecc5('0x49')](_0x1c0be0['model'],_0x1c0be0[_0xecc5('0x46')]);_0x1fd07d[_0xecc5('0x4c')]=_[_0xecc5('0x49')](_0x1c0be0[_0xecc5('0x45')],qs[_0xecc5('0x4a')](_0x3c7114[_0xecc5('0x46')][_0xecc5('0x4a')]));_0x1fd07d[_0xecc5('0x4c')]=_0x1fd07d['attributes'][_0xecc5('0x4b')]?_0x1fd07d[_0xecc5('0x4c')]:_0x1c0be0['model'];if(!_0x3c7114[_0xecc5('0x46')][_0xecc5('0x4d')](_0xecc5('0x4e'))){_0x1fd07d[_0xecc5('0x33')]=qs[_0xecc5('0x33')](_0x3c7114[_0xecc5('0x46')]['limit']);_0x1fd07d[_0xecc5('0x30')]=qs[_0xecc5('0x30')](_0x3c7114[_0xecc5('0x46')][_0xecc5('0x30')]);}_0x1fd07d[_0xecc5('0x4f')]=qs[_0xecc5('0x50')](_0x3c7114[_0xecc5('0x46')][_0xecc5('0x50')]);_0x1fd07d[_0xecc5('0x53')]=qs['filters'](_[_0xecc5('0x51')](_0x3c7114[_0xecc5('0x46')],_0x1c0be0[_0xecc5('0x48')]));_0x1fd07d[_0xecc5('0x53')][_0xecc5('0x6b')]=_0xe33d6a['id'];if(_0x3c7114[_0xecc5('0x46')][_0xecc5('0x55')]){_0x1fd07d[_0xecc5('0x53')]=_[_0xecc5('0x52')](_0x1fd07d[_0xecc5('0x53')],{'$or':_[_0xecc5('0x41')](_0x1fd07d[_0xecc5('0x4c')],function(_0x3c0340){var _0x2b4d86={};_0x2b4d86[_0x3c0340]={'$like':'%'+_0x3c7114[_0xecc5('0x46')][_0xecc5('0x55')]+'%'};return _0x2b4d86;})});}_0x1fd07d=_['merge']({},_0x1fd07d,_0x3c7114[_0xecc5('0x56')]);return db[_0xecc5('0x67')][_0xecc5('0x32')]({'where':_0x1fd07d[_0xecc5('0x53')]})['then'](function(_0x3b28e3){_0x4da30a[_0xecc5('0x32')]=_0x3b28e3;if(_0x3c7114[_0xecc5('0x46')]['includeAll']){_0x1fd07d[_0xecc5('0x5c')]=[{'all':!![]}];}return db[_0xecc5('0x67')][_0xecc5('0x6c')](_0x1fd07d);})['then'](function(_0x580deb){_0x4da30a['rows']=_0x580deb;return _0x4da30a;});}})[_0xecc5('0x3b')](respondWithFilteredResult(_0x503e46,_0x1fd07d))[_0xecc5('0x2c')](handleError(_0x503e46,null));};exports[_0xecc5('0x6d')]=function(_0x153f14,_0x425fba,_0x329c95){return db['WhatsappAccount'][_0xecc5('0x5d')]({'where':{'id':_0x153f14[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x425fba,null))[_0xecc5('0x3b')](function(_0x4772ec){if(_0x4772ec){return _0x4772ec[_0xecc5('0x6d')](_0x153f14[_0xecc5('0x46')]['ids']);}})[_0xecc5('0x3b')](respondWithStatusCode(_0x425fba,null))[_0xecc5('0x2c')](handleError(_0x425fba,null));};exports[_0xecc5('0x6e')]=function(_0x1117f3,_0x3556f6,_0x283285){if(_0x1117f3[_0xecc5('0x5f')]['id']){delete _0x1117f3[_0xecc5('0x5f')]['id'];}return db['WhatsappAccount'][_0xecc5('0x5d')]({'where':{'id':_0x1117f3[_0xecc5('0x59')]['id']}})['then'](handleEntityNotFound(_0x3556f6,null))['then'](function(_0x1a8018){if(_0x1a8018){_0x1117f3[_0xecc5('0x5f')][_0xecc5('0x6b')]=_0x1a8018['id'];return db[_0xecc5('0x6f')][_0xecc5('0x5e')](_0x1117f3[_0xecc5('0x5f')]);}})[_0xecc5('0x3b')](respondWithResult(_0x3556f6,null))[_0xecc5('0x2c')](handleError(_0x3556f6,null));};exports[_0xecc5('0x70')]=function(_0x54f51a,_0x5d0d16,_0x1fa3da){var _0x3e2c34={'raw':![],'where':{}};var _0x3912ae={};var _0x6cebb={'count':0x0,'rows':[]};return db[_0xecc5('0x42')]['findOne']({'where':{'id':_0x54f51a[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x5d0d16,null))[_0xecc5('0x3b')](function(_0x1ec46d){if(_0x1ec46d){_0x3912ae[_0xecc5('0x45')]=_[_0xecc5('0x47')](db[_0xecc5('0x6f')][_0xecc5('0x6a')]);_0x3912ae[_0xecc5('0x46')]=_[_0xecc5('0x47')](_0x54f51a['query']);_0x3912ae[_0xecc5('0x48')]=_[_0xecc5('0x49')](_0x3912ae[_0xecc5('0x45')],_0x3912ae['query']);_0x3e2c34['attributes']=_[_0xecc5('0x49')](_0x3912ae[_0xecc5('0x45')],qs[_0xecc5('0x4a')](_0x54f51a[_0xecc5('0x46')][_0xecc5('0x4a')]));_0x3e2c34[_0xecc5('0x4c')]=_0x3e2c34[_0xecc5('0x4c')][_0xecc5('0x4b')]?_0x3e2c34['attributes']:_0x3912ae['model'];if(!_0x54f51a[_0xecc5('0x46')][_0xecc5('0x4d')](_0xecc5('0x4e'))){_0x3e2c34[_0xecc5('0x33')]=qs[_0xecc5('0x33')](_0x54f51a['query'][_0xecc5('0x33')]);_0x3e2c34['offset']=qs[_0xecc5('0x30')](_0x54f51a[_0xecc5('0x46')]['offset']);}_0x3e2c34[_0xecc5('0x4f')]=qs['sort'](_0x54f51a[_0xecc5('0x46')][_0xecc5('0x50')]);_0x3e2c34[_0xecc5('0x53')]=qs[_0xecc5('0x48')](_['pick'](_0x54f51a[_0xecc5('0x46')],_0x3912ae[_0xecc5('0x48')]));_0x3e2c34[_0xecc5('0x53')][_0xecc5('0x6b')]=_0x1ec46d['id'];if(_0x54f51a['query'][_0xecc5('0x55')]){_0x3e2c34[_0xecc5('0x53')]=_[_0xecc5('0x52')](_0x3e2c34[_0xecc5('0x53')],{'$or':_[_0xecc5('0x41')](_0x3e2c34[_0xecc5('0x4c')],function(_0x5aab69){var _0x4846ff={};_0x4846ff[_0x5aab69]={'$like':'%'+_0x54f51a['query'][_0xecc5('0x55')]+'%'};return _0x4846ff;})});}_0x3e2c34=_[_0xecc5('0x52')]({},_0x3e2c34,_0x54f51a[_0xecc5('0x56')]);return db[_0xecc5('0x6f')]['count']({'where':_0x3e2c34[_0xecc5('0x53')]})['then'](function(_0xd77425){_0x6cebb['count']=_0xd77425;if(_0x54f51a[_0xecc5('0x46')][_0xecc5('0x5b')]){_0x3e2c34['include']=[{'all':!![]}];}return db[_0xecc5('0x6f')][_0xecc5('0x6c')](_0x3e2c34);})['then'](function(_0x2d3570){_0x6cebb['rows']=_0x2d3570;return _0x6cebb;});}})['then'](respondWithFilteredResult(_0x5d0d16,_0x3e2c34))[_0xecc5('0x2c')](handleError(_0x5d0d16,null));};exports[_0xecc5('0x71')]=function(_0x4ef43e,_0x305c5f,_0x5e2c52){return db['WhatsappAccount']['find']({'where':{'id':_0x4ef43e['params']['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x305c5f,null))[_0xecc5('0x3b')](function(_0x761dc3){if(_0x761dc3){return _0x761dc3['removeAnswers'](_0x4ef43e[_0xecc5('0x46')][_0xecc5('0x72')]);}})[_0xecc5('0x3b')](respondWithStatusCode(_0x305c5f,null))[_0xecc5('0x2c')](handleError(_0x305c5f,null));};exports[_0xecc5('0x73')]=function(_0x433b69,_0x54f979,_0x18d668){return db[_0xecc5('0x42')][_0xecc5('0x5d')]({'where':{'id':_0x433b69[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x54f979,null))[_0xecc5('0x3b')](function(_0x11c9a2){if(_0x11c9a2){return _0x11c9a2[_0xecc5('0x73')](_0x433b69[_0xecc5('0x5f')][_0xecc5('0x72')],_[_0xecc5('0x74')](_0x433b69['body'],['ids','id'])||{})[_0xecc5('0x75')](function(_0xa84afb){for(var _0x58fbd2=0x0;_0x58fbd2<_0x433b69[_0xecc5('0x5f')][_0xecc5('0x72')][_0xecc5('0x4b')];_0x58fbd2+=0x1){socket[_0xecc5('0x76')]('userWhatsappAccount:save',{'UserId':Number(_0x433b69[_0xecc5('0x5f')][_0xecc5('0x72')][_0x58fbd2]),'WhatsappAccountId':Number(_0x433b69[_0xecc5('0x59')]['id'])});}return _0xa84afb;});}})['then'](respondWithResult(_0x54f979,null))['catch'](handleError(_0x54f979,null));};exports[_0xecc5('0x77')]=function(_0x3bb27a,_0x1599b4,_0xfe7fb0){return db[_0xecc5('0x42')][_0xecc5('0x5d')]({'where':{'id':_0x3bb27a[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x1599b4,null))[_0xecc5('0x3b')](function(_0x14d1c6){if(_0x14d1c6){return _0x14d1c6[_0xecc5('0x77')](_0x3bb27a['query'][_0xecc5('0x72')])['then'](function(){if(_[_0xecc5('0x78')](_0x3bb27a[_0xecc5('0x46')][_0xecc5('0x72')])){for(var _0x21bd0d=0x0;_0x21bd0d<_0x3bb27a['query']['ids'][_0xecc5('0x4b')];_0x21bd0d+=0x1){socket[_0xecc5('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x3bb27a[_0xecc5('0x46')]['ids'][_0x21bd0d]),'WhatsappAccountId':Number(_0x3bb27a['params']['id'])});}}else{socket[_0xecc5('0x76')](_0xecc5('0x79'),{'UserId':Number(_0x3bb27a['query'][_0xecc5('0x72')]),'WhatsappAccountId':Number(_0x3bb27a[_0xecc5('0x59')]['id'])});}});}})[_0xecc5('0x3b')](respondWithStatusCode(_0x1599b4,null))[_0xecc5('0x2c')](handleError(_0x1599b4,null));};exports[_0xecc5('0x7a')]=function(_0x403c9a,_0x6bb5c7,_0x30194d){var _0x312e96={};var _0x297eea={};var _0x56de86;var _0x387771;return db[_0xecc5('0x42')][_0xecc5('0x69')]({'where':{'id':_0x403c9a[_0xecc5('0x59')]['id']}})[_0xecc5('0x3b')](handleEntityNotFound(_0x6bb5c7,null))[_0xecc5('0x3b')](function(_0x4982a9){if(_0x4982a9){_0x56de86=_0x4982a9;_0x297eea[_0xecc5('0x45')]=_['keys'](db[_0xecc5('0x7b')][_0xecc5('0x6a')]);_0x297eea[_0xecc5('0x46')]=_[_0xecc5('0x47')](_0x403c9a[_0xecc5('0x46')]);_0x297eea['filters']=_[_0xecc5('0x49')](_0x297eea[_0xecc5('0x45')],_0x297eea[_0xecc5('0x46')]);_0x312e96[_0xecc5('0x4c')]=_[_0xecc5('0x49')](_0x297eea[_0xecc5('0x45')],qs[_0xecc5('0x4a')](_0x403c9a[_0xecc5('0x46')]['fields']));_0x312e96[_0xecc5('0x4c')]=_0x312e96['attributes']['length']?_0x312e96['attributes']:_0x297eea[_0xecc5('0x45')];_0x312e96[_0xecc5('0x4f')]=qs[_0xecc5('0x50')](_0x403c9a[_0xecc5('0x46')]['sort']);_0x312e96[_0xecc5('0x53')]=qs[_0xecc5('0x48')](_[_0xecc5('0x51')](_0x403c9a[_0xecc5('0x46')],_0x297eea[_0xecc5('0x48')]));if(_0x403c9a[_0xecc5('0x46')][_0xecc5('0x55')]){_0x312e96[_0xecc5('0x53')]=_['merge'](_0x312e96[_0xecc5('0x53')],{'$or':_[_0xecc5('0x41')](_0x312e96['attributes'],function(_0x51e2ad){var _0xf3b7dc={};_0xf3b7dc[_0x51e2ad]={'$like':'%'+_0x403c9a[_0xecc5('0x46')]['filter']+'%'};return _0xf3b7dc;})});}_0x312e96=_[_0xecc5('0x52')]({},_0x312e96,_0x403c9a[_0xecc5('0x56')]);return _0x56de86['getAgents'](_0x312e96);}})['then'](function(_0x5d944c){if(_0x5d944c){_0x387771=_0x5d944c[_0xecc5('0x4b')];if(!_0x403c9a['query'][_0xecc5('0x4d')]('nolimit')){_0x312e96[_0xecc5('0x33')]=qs[_0xecc5('0x33')](_0x403c9a['query'][_0xecc5('0x33')]);_0x312e96[_0xecc5('0x30')]=qs[_0xecc5('0x30')](_0x403c9a[_0xecc5('0x46')][_0xecc5('0x30')]);}return _0x56de86[_0xecc5('0x7a')](_0x312e96);}})[_0xecc5('0x3b')](function(_0x46aa66){if(_0x46aa66){return _0x46aa66?{'count':_0x387771,'rows':_0x46aa66}:null;}})[_0xecc5('0x3b')](respondWithResult(_0x6bb5c7,null))[_0xecc5('0x2c')](handleError(_0x6bb5c7,null));};exports[_0xecc5('0x7c')]=function(_0x48b479,_0x295fa9){var _0x2d0587=_0x48b479[_0xecc5('0x59')]['id'];var _0x2998d0=_0x48b479[_0xecc5('0x5f')];var _0x54fccd=0xc8;var _0x34faea=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xecc5('0x7d')]['Transaction'][_0xecc5('0x7e')][_0xecc5('0x7f')]},function(_0x4ad4cd){return db[_0xecc5('0x42')][_0xecc5('0x69')]({'where':{'id':_0x2d0587},'transaction':_0x4ad4cd})[_0xecc5('0x3b')](function(_0x2ef230){if(_0x2ef230){return db[_0xecc5('0x80')][_0xecc5('0x39')]({'where':{'WhatsappAccountId':_0x2d0587},'transaction':_0x4ad4cd})[_0xecc5('0x3b')](function(){var _0x2e005c=_['map'](_0x2998d0,function(_0x1a0425){_0x1a0425['WhatsappAccountId']=_0x2d0587;return _0x1a0425;});return db[_0xecc5('0x80')][_0xecc5('0x81')](_0x2e005c,{'transaction':_0x4ad4cd});});}else{_0x54fccd=0x194;_0x34faea=[];}});})[_0xecc5('0x3b')](function(){if(_0x54fccd!==0x194){return db[_0xecc5('0x80')][_0xecc5('0x82')]({'where':{'WhatsappAccountId':_0x2d0587},'order':_0xecc5('0x83')})[_0xecc5('0x3b')](function(_0x5ec661){_0x34faea=_0x5ec661;});}})[_0xecc5('0x2c')](function(_0x94bddb){_0x54fccd=0x1f4;logger[_0xecc5('0x28')](_0x94bddb[_0xecc5('0x3c')]);if(_0x94bddb[_0xecc5('0x3d')]){delete _0x94bddb[_0xecc5('0x3d')];}_0x34faea=_0x94bddb;})['finally'](function(){if(_0x34faea===null){_0x295fa9[_0xecc5('0x2d')](_0x54fccd);}else{if(_0x54fccd===0x1f4){_0x295fa9[_0xecc5('0x2e')](_0x54fccd)[_0xecc5('0x3e')](_0x34faea);}else{_0x295fa9[_0xecc5('0x2e')](_0x54fccd)[_0xecc5('0x2f')](_0x34faea);}}});};exports[_0xecc5('0x84')]=function(_0x44e256,_0x319be5,_0x4a49e8){var _0x31219c={};var _0x4ff7c9={};var _0x13d7df;var _0x186f6c;return db['WhatsappAccount'][_0xecc5('0x69')]({'where':{'id':_0x44e256[_0xecc5('0x59')]['id']}})['then'](handleEntityNotFound(_0x319be5,null))['then'](function(_0x5a6439){if(_0x5a6439){_0x13d7df=_0x5a6439;_0x4ff7c9[_0xecc5('0x45')]=_[_0xecc5('0x47')](db[_0xecc5('0x80')][_0xecc5('0x6a')]);_0x4ff7c9[_0xecc5('0x46')]=_[_0xecc5('0x47')](_0x44e256[_0xecc5('0x46')]);_0x4ff7c9[_0xecc5('0x48')]=_[_0xecc5('0x49')](_0x4ff7c9[_0xecc5('0x45')],_0x4ff7c9[_0xecc5('0x46')]);_0x31219c[_0xecc5('0x4c')]=_['intersection'](_0x4ff7c9[_0xecc5('0x45')],qs[_0xecc5('0x4a')](_0x44e256['query'][_0xecc5('0x4a')]));_0x31219c[_0xecc5('0x4c')]=_0x31219c['attributes']['length']?_0x31219c[_0xecc5('0x4c')]:_0x4ff7c9[_0xecc5('0x45')];_0x31219c[_0xecc5('0x4f')]=qs['sort'](_0x44e256['query'][_0xecc5('0x50')]);_0x31219c[_0xecc5('0x53')]=qs['filters'](_[_0xecc5('0x51')](_0x44e256[_0xecc5('0x46')],_0x4ff7c9[_0xecc5('0x48')]));if(_0x44e256[_0xecc5('0x46')]['filter']){_0x31219c[_0xecc5('0x53')]=_['merge'](_0x31219c['where'],{'$or':_[_0xecc5('0x41')](_0x31219c[_0xecc5('0x4c')],function(_0x3102ff){var _0x35329c={};_0x35329c[_0x3102ff]={'$like':'%'+_0x44e256[_0xecc5('0x46')][_0xecc5('0x55')]+'%'};return _0x35329c;})});}_0x31219c=_[_0xecc5('0x52')]({},_0x31219c,_0x44e256[_0xecc5('0x56')]);return _0x13d7df['getApplications'](_0x31219c);}})[_0xecc5('0x3b')](function(_0x276e1c){if(_0x276e1c){_0x186f6c=_0x276e1c[_0xecc5('0x4b')];if(!_0x44e256[_0xecc5('0x46')][_0xecc5('0x4d')](_0xecc5('0x4e'))){_0x31219c[_0xecc5('0x33')]=qs[_0xecc5('0x33')](_0x44e256[_0xecc5('0x46')][_0xecc5('0x33')]);_0x31219c[_0xecc5('0x30')]=qs[_0xecc5('0x30')](_0x44e256['query']['offset']);}return _0x13d7df[_0xecc5('0x84')](_0x31219c);}})[_0xecc5('0x3b')](function(_0x511754){if(_0x511754){return _0x511754?{'count':_0x186f6c,'rows':_0x511754}:null;}})['then'](respondWithResult(_0x319be5,null))['catch'](handleError(_0x319be5,null));};exports[_0xecc5('0x85')]=function(_0x1f9953,_0x555351,_0x52c454){var _0x3d222b={'channel':'whatsapp'};var _0x2989d8=[];var _0x21721c=[];var _0x4b4316={};return db[_0xecc5('0x42')][_0xecc5('0x5d')]({'where':{'id':_0x1f9953[_0xecc5('0x59')]['id']},'include':[{'model':db[_0xecc5('0x80')],'as':_0xecc5('0x86')}]})['then'](handleEntityNotFound(_0x555351,null))[_0xecc5('0x3b')](function(_0x277bd8){_0x3d222b[_0xecc5('0x87')]=_0x277bd8;if(_0x3d222b[_0xecc5('0x87')]&&_0x3d222b[_0xecc5('0x87')][_0xecc5('0x43')]===_0xecc5('0x88')&&_0x1f9953[_0xecc5('0x5f')][_0xecc5('0x89')]){if(_0x1f9953[_0xecc5('0x5f')][_0xecc5('0x89')]['length']===0x0)return;if(_0x1f9953[_0xecc5('0x5f')]['statuses'][0x0][_0xecc5('0x8a')]!==_0xecc5('0x8b'))return;return db[_0xecc5('0x8c')][_0xecc5('0x38')]({'read':!![],'readAt':_0x1f9953[_0xecc5('0x5f')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x1f9953[_0xecc5('0x5f')][_0xecc5('0x89')][0x0][_0xecc5('0x8d')]},'individualHooks':!![]})[_0xecc5('0x3b')](function(_0xc330){return _0x555351[_0xecc5('0x2e')](0xc8)['json'](_0xc330);});}_0x3d222b['applications']=_[_0xecc5('0x8e')](_0x277bd8[_0xecc5('0x86')],[_0xecc5('0x83')],[_0xecc5('0x8f')]);if(_0x3d222b[_0xecc5('0x87')][_0xecc5('0x86')]){delete _0x3d222b[_0xecc5('0x87')][_0xecc5('0x86')];}return db[_0xecc5('0x90')][_0xecc5('0x65')]()[_0xecc5('0x3b')](function(_0x16c2b){if(!_0x16c2b){throw new db['Sequelize'][(_0xecc5('0x91'))](_0xecc5('0x92'));}_0x2989d8=_[_0xecc5('0x93')](_['keys'](_0x16c2b),[_0xecc5('0x94'),_0xecc5('0x95')]);_0x21721c=_['difference'](_[_0xecc5('0x47')](_0x16c2b),[_0xecc5('0x94'),'updatedAt',_0xecc5('0x96'),_0xecc5('0x97')]);_0x3d222b[_0xecc5('0x5f')]={'mapKey':_0xecc5('0x98')};if(_0x3d222b[_0xecc5('0x87')]&&_0x3d222b[_0xecc5('0x87')][_0xecc5('0x43')]===_0xecc5('0x99')){_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9a')]=_0x1f9953[_0xecc5('0x5f')]['From'][_0xecc5('0x9b')](_0xecc5('0x9c'),'');_0x3d222b['body'][_0xecc5('0x5f')]=_0x1f9953[_0xecc5('0x5f')][_0xecc5('0x9d')];_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9e')]=_0x1f9953[_0xecc5('0x5f')]['MessageSid'];}if(_0x3d222b[_0xecc5('0x87')]&&_0x3d222b[_0xecc5('0x87')][_0xecc5('0x43')]===_0xecc5('0x88')){_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9a')]=_0x1f9953[_0xecc5('0x5f')][_0xecc5('0x9f')][0x0]['from'];_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x5f')]=_0x1f9953['body'][_0xecc5('0x9f')][0x0][_0xecc5('0x2a')][_0xecc5('0x5f')];_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9e')]=_0x1f9953[_0xecc5('0x5f')]['notifications'][0x0]['message_id'];}if(_0x3d222b[_0xecc5('0x5f')]['id']){delete _0x3d222b[_0xecc5('0x5f')]['id'];}if(_[_0xecc5('0xa0')](_0x3d222b['body'][_0xecc5('0x9a')])){throw new db[(_0xecc5('0xa1'))]['ValidationError'](_0xecc5('0xa2'));}if(_[_0xecc5('0xa0')](_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x5f')])||_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x5f')]===''){throw new db['Sequelize'][(_0xecc5('0x91'))](_0xecc5('0xa3'));}if(_['isNil'](_0x3d222b[_0xecc5('0x5f')][_0xecc5('0xa4')])){throw new db[(_0xecc5('0xa1'))][(_0xecc5('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x21721c);}if(!_['includes'](_0x21721c,_0x3d222b[_0xecc5('0x5f')][_0xecc5('0xa4')])){throw new db[(_0xecc5('0xa1'))]['ValidationError'](_0xecc5('0xa5')+_0x21721c);}_0x4b4316[_0x3d222b['body'][_0xecc5('0xa4')]]=_0x3d222b['body'][_0xecc5('0x9a')];return db['CmList'][_0xecc5('0x5d')]({'where':{'id':_0x3d222b['account']['ListId']},'include':[{'model':db[_0xecc5('0x90')],'as':_0xecc5('0xa6'),'where':_0x4b4316,'limit':0x1,'order':[[_0xecc5('0x95'),_0xecc5('0xa7')]]}]});})[_0xecc5('0x3b')](handleEntityNotFound(_0x555351,null))['then'](function(_0x1f771e){if(_0x1f771e){_0x3d222b[_0xecc5('0xa8')]=_['omit'](_0x1f771e,[_0xecc5('0xa6')]);if(_0x1f771e[_0xecc5('0xa6')]['length']){return _0x1f771e[_0xecc5('0xa6')][0x0];}var _0x5ecb70=_[_0xecc5('0x1d')](_0x3d222b[_0xecc5('0x5f')],{'firstName':_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9a')],'ListId':_0x1f771e['id']});_0x5ecb70[_0x3d222b[_0xecc5('0x5f')]['mapKey']]=_0x3d222b[_0xecc5('0x5f')]['from'];return db[_0xecc5('0x90')][_0xecc5('0x5e')](_0x5ecb70,{'fields':_0x2989d8,'raw':!![]});}})[_0xecc5('0x3b')](handleEntityNotFound(_0x555351,null))['then'](function(_0x2151f0){if(_0x2151f0){_0x3d222b[_0xecc5('0xa9')]=_0x2151f0;var _0x4d666f={'ContactId':_0x2151f0['id'],'phone':_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9a')],'WhatsappAccountId':_0x1f9953[_0xecc5('0x59')]['id']};var _0x28a629={'ContactId':_0x2151f0['id'],'WhatsappAccountId':_0x1f9953[_0xecc5('0x59')]['id'],'closed':![]};return db[_0xecc5('0xaa')][_0xecc5('0x5d')]({'where':_0x28a629})[_0xecc5('0x3b')](function(_0x38fa92){if(_0x38fa92){return[_0x38fa92,![]];}return db[_0xecc5('0xaa')]['create'](_0x4d666f)[_0xecc5('0x3b')](function(_0x36eb58){return[_0x36eb58,!![]];});});}})[_0xecc5('0x75')](function(_0x5699a3,_0x2fe2d1){_0x3d222b[_0xecc5('0xab')]=_0x5699a3[_0xecc5('0x3a')]({'plain':!![]});_0x3d222b[_0xecc5('0xab')]['created']=![];if(_0x2fe2d1){if(_0x3d222b[_0xecc5('0x87')]['autoclose']){_0x3d222b[_0xecc5('0xac')]['push']({'id':0x0,'priority':_0x3d222b[_0xecc5('0xac')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xecc5('0xad')});}_0x3d222b[_0xecc5('0xab')][_0xecc5('0xae')]=!![];}return db[_0xecc5('0x8c')][_0xecc5('0x5e')]({'phone':_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9a')],'messageId':_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x9e')],'body':_0x3d222b[_0xecc5('0x5f')][_0xecc5('0x5f')],'WhatsappAccountId':_0x1f9953[_0xecc5('0x59')]['id'],'WhatsappInteractionId':_0x5699a3['id'],'direction':'in','ContactId':_0x5699a3[_0xecc5('0xaf')],'AttachmentId':_0x3d222b[_0xecc5('0x5f')][_0xecc5('0xb0')]});})['then'](function(_0x29cb95){_0x3d222b['message']=_0x29cb95;if(!_0x3d222b[_0xecc5('0xab')][_0xecc5('0xb1')])return;return db[_0xecc5('0x7b')][_0xecc5('0x5d')]({'attributes':['id',_0xecc5('0x3d')],'where':{'id':_0x3d222b[_0xecc5('0xab')]['UserId']}});})[_0xecc5('0x3b')](function(_0x2c091d){if(_0x2c091d){_0x3d222b[_0xecc5('0xac')][_0xecc5('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2c091d[_0xecc5('0x3d')]+','+(_0x3d222b[_0xecc5('0x87')][_0xecc5('0xb3')]||0xa),'interval':'*,*,*,*'});}if(!_0x3d222b[_0xecc5('0xab')][_0xecc5('0xb4')])return;return db[_0xecc5('0xb5')][_0xecc5('0x5d')]({'attributes':['id',_0xecc5('0x3d')],'where':{'id':_0x3d222b[_0xecc5('0xab')][_0xecc5('0xb4')]}});})[_0xecc5('0x3b')](function(_0x4528f1){if(_0x4528f1){_0x3d222b['applications'][_0xecc5('0xb2')]({'id':0x0,'priority':0x1,'app':_0xecc5('0xb6'),'appdata':_0x4528f1[_0xecc5('0x3d')]+','+(_0x3d222b[_0xecc5('0x87')][_0xecc5('0xb7')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xecc5('0xb8'),_0xecc5('0xb9'),_0x3d222b);})[_0xecc5('0x3b')](function(_0x575cce){if(_0x575cce){var _0x37ae64=0xc8;var _0x2eb4ee='receiveMessage';logger['info'](_0xecc5('0xba'),_0x2eb4ee,_0x37ae64,_0xecc5('0xbb'));logger[_0xecc5('0x25')](_0xecc5('0xbc'),_0x2eb4ee,_0x37ae64,_0xecc5('0xbb'),JSON['stringify'](_0x575cce));if(_0x3d222b[_0xecc5('0x87')][_0xecc5('0x43')]===_0xecc5('0x99')){return _0x555351[_0xecc5('0x2e')](_0x37ae64)[_0xecc5('0x34')](_0xecc5('0xbd'),_0xecc5('0xbe'))[_0xecc5('0x3e')](_0xecc5('0xbf'));}else{return _0x555351['status'](_0x37ae64)['json'](_0x575cce);}}});})[_0xecc5('0x2c')](handleError(_0x555351,null));};exports[_0xecc5('0x3e')]=function(_0x2192be,_0x2e8709,_0x244a34){var _0x854bf1,_0x5596c3,_0xbbfdd4;if(_[_0xecc5('0xa0')](_0x2192be[_0xecc5('0x5f')][_0xecc5('0x5f')])||_0x2192be[_0xecc5('0x5f')][_0xecc5('0x5f')]===''){throw new db[(_0xecc5('0xa1'))][(_0xecc5('0x91'))](_0xecc5('0xa3'));}if(_['isNil'](_0x2192be['body']['to'])){throw new db[(_0xecc5('0xa1'))][(_0xecc5('0x91'))]('to\x20is\x20mandatory');}_0x854bf1=_0x2192be['body']['to'];return db[_0xecc5('0x42')][_0xecc5('0x5d')]({'where':{'id':_0x2192be[_0xecc5('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xecc5('0xc0'),'include':[{'model':db[_0xecc5('0x90')],'as':_0xecc5('0xa6'),'where':{'mobile':_0x854bf1},'limit':0x1,'order':[[_0xecc5('0x95'),_0xecc5('0xa7')]]}]}]})[_0xecc5('0x3b')](handleEntityNotFound(_0x2e8709,null))[_0xecc5('0x3b')](function(_0x361d0d){if(_0x361d0d&&_0x361d0d[_0xecc5('0xc0')]){_0x5596c3=_0x361d0d[_0xecc5('0x3a')]({'plain':!![]});if(_0x5596c3['List']&&_0x5596c3[_0xecc5('0xc0')][_0xecc5('0xa6')][_0xecc5('0x4b')]){return _0x5596c3[_0xecc5('0xc0')][_0xecc5('0xa6')][0x0];}return db['CmContact'][_0xecc5('0x5e')](_['defaults'](_0x2192be[_0xecc5('0x5f')],{'firstName':_0x854bf1,'mobile':_0x854bf1,'phone':_0x854bf1,'ListId':_0x5596c3[_0xecc5('0x97')]}));}})[_0xecc5('0x3b')](handleEntityNotFound(_0x2e8709,null))[_0xecc5('0x3b')](function(_0x2a8f63){if(_0x2a8f63){_0xbbfdd4=_0x2a8f63;return db[_0xecc5('0xaa')][_0xecc5('0x5d')]({'where':{'ContactId':_0xbbfdd4['id'],'closed':![],'WhatsappAccountId':_0x5596c3['id']}})[_0xecc5('0x3b')](function(_0x83424f){if(_0x83424f){return[_0x83424f,![]];}return db[_0xecc5('0xaa')]['create']({'UserId':_0x2192be[_0xecc5('0x61')]['id'],'ContactId':_0xbbfdd4['id'],'WhatsappAccountId':_0x5596c3['id'],'phone':_0x854bf1,'firstMsgDirection':_0xecc5('0xc1'),'Messages':[_['merge'](_0x2192be['body'],{'read':![],'body':_0x2192be[_0xecc5('0x5f')][_0xecc5('0x5f')],'phone':_0x854bf1,'WhatsappAccountId':_0x5596c3['id'],'UserId':_0x2192be[_0xecc5('0x61')]['id'],'ContactId':_0xbbfdd4['id']})]},{'include':[{'model':db[_0xecc5('0x8c')],'as':_0xecc5('0xc2')}]})[_0xecc5('0x3b')](function(_0x3cb0ac){return[_0x3cb0ac,!![]];});});}})[_0xecc5('0x75')](function(_0x45aefd,_0x5dac70){if(_0x5dac70){return _0x45aefd;}return db[_0xecc5('0x8c')][_0xecc5('0x5e')](_['merge'](_0x2192be[_0xecc5('0x5f')],{'read':![],'body':_0x2192be[_0xecc5('0x5f')]['body'],'phone':_0x854bf1,'WhatsappAccountId':_0x5596c3['id'],'WhatsappInteractionId':_0x45aefd['id'],'UserId':_0x2192be[_0xecc5('0x61')]['id'],'ContactId':_0xbbfdd4['id']}))['then'](function(_0x135202){_0x45aefd[_0xecc5('0xc3')][_0xecc5('0xc2')]=[];_0x45aefd[_0xecc5('0xc3')]['Messages'][_0xecc5('0xc4')](_0x135202[_0xecc5('0xc3')]);return _0x45aefd;});})[_0xecc5('0x3b')](respondWithResult(_0x2e8709,null))['catch'](handleError(_0x2e8709,null));}; \ No newline at end of file +var _0xf556=['unmanaged','*,*,*,*','created','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','to\x20is\x20mandatory','List','updatedAt','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','undefined','count','set','apply','save','update','get','WhatsappAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','nolimit','WhatsappAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','mobile','twilio','from','From','replace','Body','messageId','notifications','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','ListId','DESC','list','Contacts','CmContact','contact','WhatsappInteraction','interaction','autoclose','push','close'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xf556,0x19c));var _0x6f55=function(_0x19a9b5,_0x198382){_0x19a9b5=_0x19a9b5-0x0;var _0x632733=_0xf556[_0x19a9b5];return _0x632733;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f55('0x0'));var zipdir=require(_0x6f55('0x1'));var jsonpatch=require(_0x6f55('0x2'));var rp=require(_0x6f55('0x3'));var moment=require(_0x6f55('0x4'));var BPromise=require(_0x6f55('0x5'));var Mustache=require(_0x6f55('0x6'));var util=require(_0x6f55('0x7'));var path=require(_0x6f55('0x8'));var sox=require(_0x6f55('0x9'));var csv=require('to-csv');var ejs=require(_0x6f55('0xa'));var fs=require('fs');var fs_extra=require(_0x6f55('0xb'));var _=require(_0x6f55('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f55('0xd'));var deskjs=require(_0x6f55('0xe'));var toCsv=require(_0x6f55('0xf'));var querystring=require(_0x6f55('0x10'));var Papa=require(_0x6f55('0x11'));var Redis=require(_0x6f55('0x12'));var authService=require(_0x6f55('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6f55('0x14'));var hardwareService=require(_0x6f55('0x15'));var logger=require(_0x6f55('0x16'))(_0x6f55('0x17'));var utils=require(_0x6f55('0x18'));var config=require(_0x6f55('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6f55('0x1a')]=_[_0x6f55('0x1b')](config['redis'],{'host':_0x6f55('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f55('0x1a')]));require(_0x6f55('0x1d'))[_0x6f55('0x1e')](socket);var jayson=require(_0x6f55('0x1f'));var client=jayson[_0x6f55('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x47dc69,_0x4207d0,_0x4cb3ed,_0x19f5cb){return new BPromise(function(_0x6ad544,_0x4ac92d){var _0x5287e9=_0x19f5cb||client;return _0x5287e9[_0x6f55('0x21')](_0x47dc69,_0x4cb3ed)[_0x6f55('0x22')](function(_0x560def){logger[_0x6f55('0x23')](_0x6f55('0x24'),_0x4207d0,_0x6f55('0x25'));logger[_0x6f55('0x26')](_0x6f55('0x27'),_0x4207d0,_0x6f55('0x25'),JSON[_0x6f55('0x28')](_0x560def));if(_0x560def[_0x6f55('0x29')]){if(_0x560def[_0x6f55('0x29')][_0x6f55('0x2a')]===0x1f4){logger[_0x6f55('0x29')](_0x6f55('0x24'),_0x4207d0,_0x560def[_0x6f55('0x29')][_0x6f55('0x2b')]);return _0x4ac92d(_0x560def[_0x6f55('0x29')][_0x6f55('0x2b')]);}logger[_0x6f55('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x4207d0,_0x560def[_0x6f55('0x29')][_0x6f55('0x2b')]);return _0x6ad544(_0x560def[_0x6f55('0x29')]['message']);}else{logger['info'](_0x6f55('0x24'),_0x4207d0,_0x6f55('0x25'));_0x6ad544(_0x560def[_0x6f55('0x2c')][_0x6f55('0x2b')]);}})[_0x6f55('0x2d')](function(_0x2f315e){logger[_0x6f55('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x4207d0,_0x2f315e);_0x4ac92d(_0x2f315e);});});}function respondWithStatusCode(_0x35187d,_0x417d77){_0x417d77=_0x417d77||0xcc;return function(_0x5ee457){if(_0x5ee457){return _0x35187d['sendStatus'](_0x417d77);}return _0x35187d[_0x6f55('0x2e')](_0x417d77)['end']();};}function respondWithResult(_0x2f64ed,_0x58274a){_0x58274a=_0x58274a||0xc8;return function(_0x4b12b5){if(_0x4b12b5){return _0x2f64ed['status'](_0x58274a)[_0x6f55('0x2f')](_0x4b12b5);}};}function respondWithFilteredResult(_0x2a7d0b,_0x1b973f){return function(_0x1a65d8){if(_0x1a65d8){var _0x4f9501=typeof _0x1b973f[_0x6f55('0x30')]==='undefined'&&typeof _0x1b973f[_0x6f55('0x31')]===_0x6f55('0x32');var _0x25c40c=_0x1a65d8[_0x6f55('0x33')];var _0x4b59b3=_0x4f9501?0x0:_0x1b973f['offset'];var _0x2e2568=_0x4f9501?_0x1a65d8[_0x6f55('0x33')]:_0x1b973f['offset']+_0x1b973f[_0x6f55('0x31')];var _0x2cef07;if(_0x2e2568>=_0x25c40c){_0x2e2568=_0x25c40c;_0x2cef07=0xc8;}else{_0x2cef07=0xce;}_0x2a7d0b[_0x6f55('0x2e')](_0x2cef07);return _0x2a7d0b[_0x6f55('0x34')]('Content-Range',_0x4b59b3+'-'+_0x2e2568+'/'+_0x25c40c)[_0x6f55('0x2f')](_0x1a65d8);}return null;};}function patchUpdates(_0x4a5ad4){return function(_0x3fe058){try{jsonpatch[_0x6f55('0x35')](_0x3fe058,_0x4a5ad4,!![]);}catch(_0x566137){return BPromise['reject'](_0x566137);}return _0x3fe058[_0x6f55('0x36')]();};}function saveUpdates(_0x3fcbec,_0x1d237c){return function(_0x41e92c){if(_0x41e92c){return _0x41e92c[_0x6f55('0x37')](_0x3fcbec)['then'](function(_0x54628d){return _0x54628d;});}return null;};}function removeEntity(_0x45c78f,_0x479aac){return function(_0x18accc){if(_0x18accc){return _0x18accc['destroy']()[_0x6f55('0x22')](function(){var _0x532c16=_0x18accc[_0x6f55('0x38')]({'plain':!![]});var _0x1e5644=_0x6f55('0x39');return db[_0x6f55('0x3a')][_0x6f55('0x3b')]({'where':{'type':_0x1e5644,'resourceId':_0x532c16['id']}})[_0x6f55('0x22')](function(){return _0x18accc;});})[_0x6f55('0x22')](function(){_0x45c78f[_0x6f55('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22793f,_0x57524f){return function(_0x4b7099){if(!_0x4b7099){_0x22793f[_0x6f55('0x3c')](0x194);}return _0x4b7099;};}function handleError(_0x52a250,_0x4435a3){_0x4435a3=_0x4435a3||0x1f4;return function(_0x398609){logger[_0x6f55('0x29')](_0x398609[_0x6f55('0x3d')]);if(_0x398609[_0x6f55('0x3e')]){delete _0x398609[_0x6f55('0x3e')];}_0x52a250['status'](_0x4435a3)[_0x6f55('0x3f')](_0x398609);};}exports[_0x6f55('0x40')]=function(_0x211329,_0x2a1dfa){var _0x46644c={'include':[{'model':db[_0x6f55('0x41')],'as':_0x6f55('0x42')}]},_0x5c4831={},_0x318e63={'count':0x0,'rows':[]};var _0x24a0bf=_[_0x6f55('0x43')](db[_0x6f55('0x44')][_0x6f55('0x45')],function(_0xcaae2b){return{'name':_0xcaae2b['fieldName'],'type':_0xcaae2b[_0x6f55('0x46')][_0x6f55('0x47')]};});_0x5c4831['model']=_['map'](_0x24a0bf,_0x6f55('0x3e'));_0x5c4831[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x211329[_0x6f55('0x48')]);_0x5c4831['filters']=_[_0x6f55('0x4a')](_0x5c4831['model'],_0x5c4831['query']);_0x46644c[_0x6f55('0x4b')]=_[_0x6f55('0x4a')](_0x5c4831[_0x6f55('0x4c')],qs['fields'](_0x211329['query'][_0x6f55('0x4d')]));_0x46644c[_0x6f55('0x4b')]=_0x46644c[_0x6f55('0x4b')][_0x6f55('0x4e')]?_0x46644c[_0x6f55('0x4b')]:_0x5c4831[_0x6f55('0x4c')];if(!_0x211329[_0x6f55('0x48')][_0x6f55('0x4f')]('nolimit')){_0x46644c[_0x6f55('0x31')]=qs['limit'](_0x211329[_0x6f55('0x48')][_0x6f55('0x31')]);_0x46644c[_0x6f55('0x30')]=qs[_0x6f55('0x30')](_0x211329[_0x6f55('0x48')][_0x6f55('0x30')]);}_0x46644c[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x211329[_0x6f55('0x48')][_0x6f55('0x51')]);_0x46644c[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x211329[_0x6f55('0x48')],_0x5c4831['filters']),_0x24a0bf);if(_0x211329[_0x6f55('0x48')][_0x6f55('0x55')]){_0x46644c['where']=_[_0x6f55('0x56')](_0x46644c[_0x6f55('0x52')],{'$or':_[_0x6f55('0x43')](_0x24a0bf,function(_0x39e6ec){if(_0x39e6ec['type']!==_0x6f55('0x57')){var _0x13a084={};_0x13a084[_0x39e6ec['name']]={'$like':'%'+_0x211329[_0x6f55('0x48')]['filter']+'%'};return _0x13a084;}})});}_0x46644c=_[_0x6f55('0x56')]({},_0x46644c,_0x211329[_0x6f55('0x58')]);var _0x47a6aa={'where':_0x46644c['where']};return db[_0x6f55('0x44')][_0x6f55('0x33')](_0x47a6aa)[_0x6f55('0x22')](function(_0x56afb2){_0x318e63['count']=_0x56afb2;if(_0x211329[_0x6f55('0x48')][_0x6f55('0x59')]){_0x46644c[_0x6f55('0x5a')]=[{'all':!![]}];}return db[_0x6f55('0x44')][_0x6f55('0x5b')](_0x46644c);})[_0x6f55('0x22')](function(_0x44162e){_0x318e63['rows']=_0x44162e;return _0x318e63;})[_0x6f55('0x22')](respondWithFilteredResult(_0x2a1dfa,_0x46644c))['catch'](handleError(_0x2a1dfa,null));};exports[_0x6f55('0x5c')]=function(_0x567505,_0xadbef){var _0x454f90={'raw':![],'where':{'id':_0x567505[_0x6f55('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x6f55('0x42')}]},_0x2acaa6={};_0x2acaa6[_0x6f55('0x4c')]=_['keys'](db[_0x6f55('0x44')][_0x6f55('0x45')]);_0x2acaa6[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x567505[_0x6f55('0x48')]);_0x2acaa6[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x2acaa6['model'],_0x2acaa6[_0x6f55('0x48')]);_0x454f90[_0x6f55('0x4b')]=_['intersection'](_0x2acaa6[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x567505[_0x6f55('0x48')][_0x6f55('0x4d')]));_0x454f90[_0x6f55('0x4b')]=_0x454f90[_0x6f55('0x4b')]['length']?_0x454f90[_0x6f55('0x4b')]:_0x2acaa6['model'];if(_0x567505['query'][_0x6f55('0x59')]){_0x454f90[_0x6f55('0x5a')]=[{'all':!![]}];}_0x454f90=_[_0x6f55('0x56')]({},_0x454f90,_0x567505[_0x6f55('0x58')]);return db['WhatsappAccount'][_0x6f55('0x5e')](_0x454f90)[_0x6f55('0x22')](handleEntityNotFound(_0xadbef,null))[_0x6f55('0x22')](respondWithResult(_0xadbef,null))['catch'](handleError(_0xadbef,null));};exports[_0x6f55('0x5f')]=function(_0x17b535,_0x2a610e){return db[_0x6f55('0x44')]['create'](_0x17b535['body'],{})['then'](function(_0x3e1deb){var _0xcbc48=_0x17b535['user'][_0x6f55('0x38')]({'plain':!![]});if(!_0xcbc48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcbc48[_0x6f55('0x60')]===_0x6f55('0x61')){var _0x26e59b=_0x3e1deb['get']({'plain':!![]});var _0x528b43='WhatsappAccounts';return db[_0x6f55('0x62')][_0x6f55('0x5e')]({'where':{'name':_0x528b43,'userProfileId':_0xcbc48[_0x6f55('0x63')]},'raw':!![]})[_0x6f55('0x22')](function(_0x359e27){if(_0x359e27&&_0x359e27[_0x6f55('0x64')]===0x0){return db['UserProfileResource'][_0x6f55('0x5f')]({'name':_0x26e59b[_0x6f55('0x3e')],'resourceId':_0x26e59b['id'],'type':_0x359e27[_0x6f55('0x3e')],'sectionId':_0x359e27['id']},{})[_0x6f55('0x22')](function(){return _0x3e1deb;});}else{return _0x3e1deb;}})[_0x6f55('0x2d')](function(_0x551633){logger[_0x6f55('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x551633);throw _0x551633;});}return _0x3e1deb;})[_0x6f55('0x22')](respondWithResult(_0x2a610e,0xc9))['catch'](handleError(_0x2a610e,null));};exports['update']=function(_0x8a828b,_0x364a71){if(_0x8a828b[_0x6f55('0x65')]['id']){delete _0x8a828b[_0x6f55('0x65')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x8a828b[_0x6f55('0x5d')]['id']},'include':[{'model':db[_0x6f55('0x41')],'as':_0x6f55('0x42')}]})['then'](handleEntityNotFound(_0x364a71,null))[_0x6f55('0x22')](saveUpdates(_0x8a828b[_0x6f55('0x65')],null))[_0x6f55('0x22')](respondWithResult(_0x364a71,null))[_0x6f55('0x2d')](handleError(_0x364a71,null));};exports['destroy']=function(_0x1b3550,_0x53dd86){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x1b3550['params']['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x53dd86,null))[_0x6f55('0x22')](removeEntity(_0x53dd86,null))[_0x6f55('0x2d')](handleError(_0x53dd86,null));};exports[_0x6f55('0x66')]=function(_0x4633e4,_0x45f573){return db['WhatsappAccount'][_0x6f55('0x66')]()[_0x6f55('0x22')](respondWithResult(_0x45f573,null))['catch'](handleError(_0x45f573,null));};exports[_0x6f55('0x67')]=function(_0x2fb329,_0x3c76b2,_0xe9dbd6){if(_0x2fb329[_0x6f55('0x65')]['id']){delete _0x2fb329['body']['id'];}return db['WhatsappAccount'][_0x6f55('0x5e')]({'where':{'id':_0x2fb329[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x3c76b2,null))[_0x6f55('0x22')](function(_0x52dd0d){if(_0x52dd0d){_0x2fb329[_0x6f55('0x65')]['WhatsappAccountId']=_0x52dd0d['id'];return db[_0x6f55('0x68')][_0x6f55('0x5f')](_0x2fb329['body']);}})[_0x6f55('0x22')](respondWithResult(_0x3c76b2,null))[_0x6f55('0x2d')](handleError(_0x3c76b2,null));};exports['getDispositions']=function(_0x1b670e,_0x231399,_0x4477e9){var _0x23e8b3={'raw':![],'where':{}};var _0x50f750={};var _0x33407d={'count':0x0,'rows':[]};return db[_0x6f55('0x44')]['findOne']({'where':{'id':_0x1b670e[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x231399,null))[_0x6f55('0x22')](function(_0x4e9787){if(_0x4e9787){_0x50f750[_0x6f55('0x4c')]=_[_0x6f55('0x49')](db[_0x6f55('0x68')][_0x6f55('0x45')]);_0x50f750[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x1b670e['query']);_0x50f750[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x50f750[_0x6f55('0x4c')],_0x50f750[_0x6f55('0x48')]);_0x23e8b3['attributes']=_[_0x6f55('0x4a')](_0x50f750[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x1b670e[_0x6f55('0x48')]['fields']));_0x23e8b3[_0x6f55('0x4b')]=_0x23e8b3[_0x6f55('0x4b')][_0x6f55('0x4e')]?_0x23e8b3[_0x6f55('0x4b')]:_0x50f750[_0x6f55('0x4c')];if(!_0x1b670e['query'][_0x6f55('0x4f')](_0x6f55('0x69'))){_0x23e8b3['limit']=qs[_0x6f55('0x31')](_0x1b670e['query'][_0x6f55('0x31')]);_0x23e8b3['offset']=qs[_0x6f55('0x30')](_0x1b670e['query']['offset']);}_0x23e8b3[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x1b670e[_0x6f55('0x48')][_0x6f55('0x51')]);_0x23e8b3[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_['pick'](_0x1b670e['query'],_0x50f750[_0x6f55('0x53')]));_0x23e8b3[_0x6f55('0x52')][_0x6f55('0x6a')]=_0x4e9787['id'];if(_0x1b670e[_0x6f55('0x48')][_0x6f55('0x55')]){_0x23e8b3[_0x6f55('0x52')]=_['merge'](_0x23e8b3[_0x6f55('0x52')],{'$or':_['map'](_0x23e8b3[_0x6f55('0x4b')],function(_0x43ab96){var _0x4cc0a2={};_0x4cc0a2[_0x43ab96]={'$like':'%'+_0x1b670e['query']['filter']+'%'};return _0x4cc0a2;})});}_0x23e8b3=_[_0x6f55('0x56')]({},_0x23e8b3,_0x1b670e[_0x6f55('0x58')]);return db[_0x6f55('0x68')][_0x6f55('0x33')]({'where':_0x23e8b3['where']})[_0x6f55('0x22')](function(_0x137c14){_0x33407d['count']=_0x137c14;if(_0x1b670e[_0x6f55('0x48')][_0x6f55('0x59')]){_0x23e8b3[_0x6f55('0x5a')]=[{'all':!![]}];}return db[_0x6f55('0x68')][_0x6f55('0x5b')](_0x23e8b3);})[_0x6f55('0x22')](function(_0x4bcfb0){_0x33407d[_0x6f55('0x6b')]=_0x4bcfb0;return _0x33407d;});}})[_0x6f55('0x22')](respondWithFilteredResult(_0x231399,_0x23e8b3))[_0x6f55('0x2d')](handleError(_0x231399,null));};exports['removeDispositions']=function(_0x12e1a2,_0x5ea4c5,_0x227a76){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x12e1a2[_0x6f55('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5ea4c5,null))[_0x6f55('0x22')](function(_0x43a3ce){if(_0x43a3ce){return _0x43a3ce[_0x6f55('0x6c')](_0x12e1a2[_0x6f55('0x48')][_0x6f55('0x6d')]);}})[_0x6f55('0x22')](respondWithStatusCode(_0x5ea4c5,null))[_0x6f55('0x2d')](handleError(_0x5ea4c5,null));};exports[_0x6f55('0x6e')]=function(_0x57e8b6,_0x17045b,_0x45ec5a){if(_0x57e8b6['body']['id']){delete _0x57e8b6['body']['id'];}return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x57e8b6[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x17045b,null))[_0x6f55('0x22')](function(_0x388fc1){if(_0x388fc1){_0x57e8b6[_0x6f55('0x65')][_0x6f55('0x6a')]=_0x388fc1['id'];return db[_0x6f55('0x6f')][_0x6f55('0x5f')](_0x57e8b6['body']);}})[_0x6f55('0x22')](respondWithResult(_0x17045b,null))[_0x6f55('0x2d')](handleError(_0x17045b,null));};exports[_0x6f55('0x70')]=function(_0x51adf6,_0x33e7d5,_0x377231){var _0x3a6b97={'raw':![],'where':{}};var _0x4d847b={};var _0x56d1f0={'count':0x0,'rows':[]};return db[_0x6f55('0x44')]['findOne']({'where':{'id':_0x51adf6[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x33e7d5,null))[_0x6f55('0x22')](function(_0xf46352){if(_0xf46352){_0x4d847b[_0x6f55('0x4c')]=_['keys'](db[_0x6f55('0x6f')][_0x6f55('0x45')]);_0x4d847b[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x51adf6[_0x6f55('0x48')]);_0x4d847b[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x4d847b[_0x6f55('0x4c')],_0x4d847b[_0x6f55('0x48')]);_0x3a6b97['attributes']=_[_0x6f55('0x4a')](_0x4d847b[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x51adf6[_0x6f55('0x48')][_0x6f55('0x4d')]));_0x3a6b97['attributes']=_0x3a6b97[_0x6f55('0x4b')][_0x6f55('0x4e')]?_0x3a6b97[_0x6f55('0x4b')]:_0x4d847b[_0x6f55('0x4c')];if(!_0x51adf6[_0x6f55('0x48')][_0x6f55('0x4f')]('nolimit')){_0x3a6b97[_0x6f55('0x31')]=qs[_0x6f55('0x31')](_0x51adf6[_0x6f55('0x48')][_0x6f55('0x31')]);_0x3a6b97[_0x6f55('0x30')]=qs[_0x6f55('0x30')](_0x51adf6[_0x6f55('0x48')][_0x6f55('0x30')]);}_0x3a6b97['order']=qs[_0x6f55('0x51')](_0x51adf6['query'][_0x6f55('0x51')]);_0x3a6b97[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x51adf6['query'],_0x4d847b[_0x6f55('0x53')]));_0x3a6b97[_0x6f55('0x52')]['WhatsappAccountId']=_0xf46352['id'];if(_0x51adf6[_0x6f55('0x48')]['filter']){_0x3a6b97[_0x6f55('0x52')]=_[_0x6f55('0x56')](_0x3a6b97[_0x6f55('0x52')],{'$or':_[_0x6f55('0x43')](_0x3a6b97[_0x6f55('0x4b')],function(_0x59a99e){var _0x344f13={};_0x344f13[_0x59a99e]={'$like':'%'+_0x51adf6['query'][_0x6f55('0x55')]+'%'};return _0x344f13;})});}_0x3a6b97=_['merge']({},_0x3a6b97,_0x51adf6[_0x6f55('0x58')]);return db['CannedAnswer']['count']({'where':_0x3a6b97[_0x6f55('0x52')]})[_0x6f55('0x22')](function(_0x4ac292){_0x56d1f0['count']=_0x4ac292;if(_0x51adf6[_0x6f55('0x48')][_0x6f55('0x59')]){_0x3a6b97['include']=[{'all':!![]}];}return db[_0x6f55('0x6f')][_0x6f55('0x5b')](_0x3a6b97);})[_0x6f55('0x22')](function(_0x1dc549){_0x56d1f0[_0x6f55('0x6b')]=_0x1dc549;return _0x56d1f0;});}})[_0x6f55('0x22')](respondWithFilteredResult(_0x33e7d5,_0x3a6b97))[_0x6f55('0x2d')](handleError(_0x33e7d5,null));};exports[_0x6f55('0x71')]=function(_0x5ebf73,_0x64a47d,_0x8ee6e3){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x5ebf73['params']['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x64a47d,null))[_0x6f55('0x22')](function(_0x27edd3){if(_0x27edd3){return _0x27edd3[_0x6f55('0x71')](_0x5ebf73[_0x6f55('0x48')][_0x6f55('0x6d')]);}})['then'](respondWithStatusCode(_0x64a47d,null))[_0x6f55('0x2d')](handleError(_0x64a47d,null));};exports[_0x6f55('0x72')]=function(_0x512c65,_0xf80d74,_0x2723c1){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x512c65['params']['id']}})['then'](handleEntityNotFound(_0xf80d74,null))[_0x6f55('0x22')](function(_0x4a1028){if(_0x4a1028){return _0x4a1028[_0x6f55('0x72')](_0x512c65['body'][_0x6f55('0x6d')],_[_0x6f55('0x73')](_0x512c65[_0x6f55('0x65')],[_0x6f55('0x6d'),'id'])||{})[_0x6f55('0x74')](function(_0x5b3d93){for(var _0x3ac8ba=0x0;_0x3ac8ba<_0x512c65[_0x6f55('0x65')][_0x6f55('0x6d')]['length'];_0x3ac8ba+=0x1){socket[_0x6f55('0x75')](_0x6f55('0x76'),{'UserId':Number(_0x512c65[_0x6f55('0x65')][_0x6f55('0x6d')][_0x3ac8ba]),'WhatsappAccountId':Number(_0x512c65[_0x6f55('0x5d')]['id'])});}return _0x5b3d93;});}})[_0x6f55('0x22')](respondWithResult(_0xf80d74,null))[_0x6f55('0x2d')](handleError(_0xf80d74,null));};exports[_0x6f55('0x77')]=function(_0x456448,_0x52efa3,_0x43e1de){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x456448[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x52efa3,null))['then'](function(_0x26d858){if(_0x26d858){return _0x26d858['removeAgents'](_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')])['then'](function(){if(_[_0x6f55('0x78')](_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')])){for(var _0x29329a=0x0;_0x29329a<_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')]['length'];_0x29329a+=0x1){socket[_0x6f55('0x75')](_0x6f55('0x79'),{'UserId':Number(_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')][_0x29329a]),'WhatsappAccountId':Number(_0x456448['params']['id'])});}}else{socket[_0x6f55('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x456448['query']['ids']),'WhatsappAccountId':Number(_0x456448[_0x6f55('0x5d')]['id'])});}});}})[_0x6f55('0x22')](respondWithStatusCode(_0x52efa3,null))[_0x6f55('0x2d')](handleError(_0x52efa3,null));};exports[_0x6f55('0x7a')]=function(_0x413545,_0x4386b8,_0x2d04f5){var _0xc1cfe8={};var _0x36f932={};var _0x4acc58;var _0xff51a4;return db[_0x6f55('0x44')]['findOne']({'where':{'id':_0x413545[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x4386b8,null))[_0x6f55('0x22')](function(_0xe55ad4){if(_0xe55ad4){_0x4acc58=_0xe55ad4;_0x36f932['model']=_[_0x6f55('0x49')](db[_0x6f55('0x7b')]['rawAttributes']);_0x36f932['query']=_['keys'](_0x413545[_0x6f55('0x48')]);_0x36f932['filters']=_[_0x6f55('0x4a')](_0x36f932[_0x6f55('0x4c')],_0x36f932[_0x6f55('0x48')]);_0xc1cfe8[_0x6f55('0x4b')]=_[_0x6f55('0x4a')](_0x36f932['model'],qs['fields'](_0x413545[_0x6f55('0x48')][_0x6f55('0x4d')]));_0xc1cfe8['attributes']=_0xc1cfe8['attributes'][_0x6f55('0x4e')]?_0xc1cfe8[_0x6f55('0x4b')]:_0x36f932[_0x6f55('0x4c')];_0xc1cfe8[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x413545[_0x6f55('0x48')]['sort']);_0xc1cfe8['where']=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x413545[_0x6f55('0x48')],_0x36f932[_0x6f55('0x53')]));if(_0x413545['query']['filter']){_0xc1cfe8[_0x6f55('0x52')]=_[_0x6f55('0x56')](_0xc1cfe8['where'],{'$or':_[_0x6f55('0x43')](_0xc1cfe8[_0x6f55('0x4b')],function(_0x5de970){var _0x96951a={};_0x96951a[_0x5de970]={'$like':'%'+_0x413545[_0x6f55('0x48')]['filter']+'%'};return _0x96951a;})});}_0xc1cfe8=_[_0x6f55('0x56')]({},_0xc1cfe8,_0x413545[_0x6f55('0x58')]);return _0x4acc58[_0x6f55('0x7a')](_0xc1cfe8);}})[_0x6f55('0x22')](function(_0x3dc59a){if(_0x3dc59a){_0xff51a4=_0x3dc59a[_0x6f55('0x4e')];if(!_0x413545[_0x6f55('0x48')][_0x6f55('0x4f')](_0x6f55('0x69'))){_0xc1cfe8[_0x6f55('0x31')]=qs[_0x6f55('0x31')](_0x413545[_0x6f55('0x48')][_0x6f55('0x31')]);_0xc1cfe8[_0x6f55('0x30')]=qs[_0x6f55('0x30')](_0x413545['query'][_0x6f55('0x30')]);}return _0x4acc58[_0x6f55('0x7a')](_0xc1cfe8);}})[_0x6f55('0x22')](function(_0xf96e91){if(_0xf96e91){return _0xf96e91?{'count':_0xff51a4,'rows':_0xf96e91}:null;}})[_0x6f55('0x22')](respondWithResult(_0x4386b8,null))['catch'](handleError(_0x4386b8,null));};exports[_0x6f55('0x7c')]=function(_0x1380b4,_0x437458){var _0x199f34=_0x1380b4[_0x6f55('0x5d')]['id'];var _0x399bf1=_0x1380b4[_0x6f55('0x65')];var _0x4e185e=0xc8;var _0x3cfbd9=null;return db['sequelize'][_0x6f55('0x7d')]({'isolationLevel':db['sequelize'][_0x6f55('0x7e')][_0x6f55('0x7f')][_0x6f55('0x80')]},function(_0x202d00){return db['WhatsappAccount'][_0x6f55('0x81')]({'where':{'id':_0x199f34},'transaction':_0x202d00})[_0x6f55('0x22')](function(_0x387d89){if(_0x387d89){return db[_0x6f55('0x82')][_0x6f55('0x3b')]({'where':{'WhatsappAccountId':_0x199f34},'transaction':_0x202d00})['then'](function(){var _0x3d7b9a=_[_0x6f55('0x43')](_0x399bf1,function(_0x330dcf){_0x330dcf['WhatsappAccountId']=_0x199f34;return _0x330dcf;});return db[_0x6f55('0x82')][_0x6f55('0x83')](_0x3d7b9a,{'transaction':_0x202d00});});}else{_0x4e185e=0x194;_0x3cfbd9=[];}});})[_0x6f55('0x22')](function(){if(_0x4e185e!==0x194){return db[_0x6f55('0x82')][_0x6f55('0x84')]({'where':{'WhatsappAccountId':_0x199f34},'order':_0x6f55('0x85')})[_0x6f55('0x22')](function(_0x59b46d){_0x3cfbd9=_0x59b46d;});}})[_0x6f55('0x2d')](function(_0x1ddf1f){_0x4e185e=0x1f4;logger[_0x6f55('0x29')](_0x1ddf1f['stack']);if(_0x1ddf1f[_0x6f55('0x3e')]){delete _0x1ddf1f[_0x6f55('0x3e')];}_0x3cfbd9=_0x1ddf1f;})[_0x6f55('0x86')](function(){if(_0x3cfbd9===null){_0x437458[_0x6f55('0x3c')](_0x4e185e);}else{if(_0x4e185e===0x1f4){_0x437458['status'](_0x4e185e)[_0x6f55('0x3f')](_0x3cfbd9);}else{_0x437458['status'](_0x4e185e)[_0x6f55('0x2f')](_0x3cfbd9);}}});};exports[_0x6f55('0x87')]=function(_0x20a5c8,_0x491fcb,_0x3f5218){var _0x497306={};var _0x16a3fe={};var _0x3f1df3;var _0x2f7ed4;return db[_0x6f55('0x44')][_0x6f55('0x81')]({'where':{'id':_0x20a5c8[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x491fcb,null))[_0x6f55('0x22')](function(_0x2c8c4c){if(_0x2c8c4c){_0x3f1df3=_0x2c8c4c;_0x16a3fe[_0x6f55('0x4c')]=_[_0x6f55('0x49')](db[_0x6f55('0x82')]['rawAttributes']);_0x16a3fe['query']=_[_0x6f55('0x49')](_0x20a5c8['query']);_0x16a3fe[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x16a3fe[_0x6f55('0x4c')],_0x16a3fe['query']);_0x497306['attributes']=_[_0x6f55('0x4a')](_0x16a3fe[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x4d')]));_0x497306['attributes']=_0x497306[_0x6f55('0x4b')]['length']?_0x497306['attributes']:_0x16a3fe[_0x6f55('0x4c')];_0x497306[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x51')]);_0x497306[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x20a5c8[_0x6f55('0x48')],_0x16a3fe[_0x6f55('0x53')]));if(_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x55')]){_0x497306[_0x6f55('0x52')]=_[_0x6f55('0x56')](_0x497306['where'],{'$or':_[_0x6f55('0x43')](_0x497306[_0x6f55('0x4b')],function(_0x5668db){var _0x2f3453={};_0x2f3453[_0x5668db]={'$like':'%'+_0x20a5c8[_0x6f55('0x48')]['filter']+'%'};return _0x2f3453;})});}_0x497306=_[_0x6f55('0x56')]({},_0x497306,_0x20a5c8[_0x6f55('0x58')]);return _0x3f1df3[_0x6f55('0x87')](_0x497306);}})[_0x6f55('0x22')](function(_0x144b6c){if(_0x144b6c){_0x2f7ed4=_0x144b6c[_0x6f55('0x4e')];if(!_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x4f')]('nolimit')){_0x497306[_0x6f55('0x31')]=qs[_0x6f55('0x31')](_0x20a5c8[_0x6f55('0x48')]['limit']);_0x497306['offset']=qs[_0x6f55('0x30')](_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x30')]);}return _0x3f1df3[_0x6f55('0x87')](_0x497306);}})['then'](function(_0x10b608){if(_0x10b608){return _0x10b608?{'count':_0x2f7ed4,'rows':_0x10b608}:null;}})['then'](respondWithResult(_0x491fcb,null))['catch'](handleError(_0x491fcb,null));};exports['notify']=function(_0x1e446d,_0x44c24c,_0x589605){var _0x4e894b={'channel':'whatsapp'};var _0x5327a9=[];var _0x43082b=[];var _0x2795f5={};return db[_0x6f55('0x44')]['find']({'where':{'id':_0x1e446d[_0x6f55('0x5d')]['id']},'include':[{'model':db[_0x6f55('0x82')],'as':_0x6f55('0x88')}]})['then'](handleEntityNotFound(_0x44c24c,null))[_0x6f55('0x22')](function(_0x3b3667){_0x4e894b[_0x6f55('0x89')]=_0x3b3667;if(_0x4e894b[_0x6f55('0x89')]&&_0x4e894b[_0x6f55('0x89')][_0x6f55('0x46')]==='sinch'&&_0x1e446d[_0x6f55('0x65')]['statuses']){if(_0x1e446d['body']['statuses']['length']===0x0)return;if(_0x1e446d['body'][_0x6f55('0x8a')][0x0][_0x6f55('0x8b')]!=='read')return;return db[_0x6f55('0x8c')][_0x6f55('0x37')]({'read':!![],'readAt':_0x1e446d['body'][_0x6f55('0x8a')][0x0][_0x6f55('0x8d')]},{'where':{'messageId':_0x1e446d[_0x6f55('0x65')]['statuses'][0x0][_0x6f55('0x8e')]},'individualHooks':!![]})[_0x6f55('0x22')](function(_0x111dfe){return _0x44c24c[_0x6f55('0x2e')](0xc8)[_0x6f55('0x2f')](_0x111dfe);});}_0x4e894b[_0x6f55('0x8f')]=_[_0x6f55('0x90')](_0x3b3667[_0x6f55('0x88')],[_0x6f55('0x85')],[_0x6f55('0x91')]);if(_0x4e894b[_0x6f55('0x89')]['Applications']){delete _0x4e894b['account'][_0x6f55('0x88')];}return db['CmContact'][_0x6f55('0x66')]()['then'](function(_0x3e3599){if(!_0x3e3599){throw new db[(_0x6f55('0x92'))]['ValidationError'](_0x6f55('0x93'));}_0x5327a9=_['difference'](_[_0x6f55('0x49')](_0x3e3599),['createdAt','updatedAt']);_0x43082b=_[_0x6f55('0x94')](_[_0x6f55('0x49')](_0x3e3599),[_0x6f55('0x95'),'updatedAt',_0x6f55('0x96'),'ListId']);_0x4e894b[_0x6f55('0x65')]={'mapKey':_0x6f55('0x97')};if(_0x4e894b[_0x6f55('0x89')]&&_0x4e894b[_0x6f55('0x89')][_0x6f55('0x46')]===_0x6f55('0x98')){_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')]=_0x1e446d[_0x6f55('0x65')][_0x6f55('0x9a')][_0x6f55('0x9b')]('whatsapp:','');_0x4e894b[_0x6f55('0x65')][_0x6f55('0x65')]=_0x1e446d[_0x6f55('0x65')][_0x6f55('0x9c')];_0x4e894b[_0x6f55('0x65')][_0x6f55('0x9d')]=_0x1e446d[_0x6f55('0x65')]['MessageSid'];}if(_0x4e894b[_0x6f55('0x89')]&&_0x4e894b[_0x6f55('0x89')]['type']==='sinch'){_0x4e894b['body'][_0x6f55('0x99')]=_0x1e446d['body'][_0x6f55('0x9e')][0x0][_0x6f55('0x99')];_0x4e894b[_0x6f55('0x65')][_0x6f55('0x65')]=_0x1e446d[_0x6f55('0x65')][_0x6f55('0x9e')][0x0][_0x6f55('0x2b')][_0x6f55('0x65')];_0x4e894b[_0x6f55('0x65')]['messageId']=_0x1e446d[_0x6f55('0x65')]['notifications'][0x0][_0x6f55('0x8e')];}if(_0x4e894b[_0x6f55('0x65')]['id']){delete _0x4e894b[_0x6f55('0x65')]['id'];}if(_['isNil'](_0x4e894b[_0x6f55('0x65')]['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x6f55('0x9f')](_0x4e894b[_0x6f55('0x65')][_0x6f55('0x65')])||_0x4e894b[_0x6f55('0x65')]['body']===''){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))](_0x6f55('0xa1'));}if(_[_0x6f55('0x9f')](_0x4e894b[_0x6f55('0x65')][_0x6f55('0xa2')])){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43082b);}if(!_[_0x6f55('0xa3')](_0x43082b,_0x4e894b['body'][_0x6f55('0xa2')])){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43082b);}_0x2795f5[_0x4e894b['body']['mapKey']]=_0x4e894b[_0x6f55('0x65')]['from'];return db[_0x6f55('0xa4')]['find']({'where':{'id':_0x4e894b[_0x6f55('0x89')][_0x6f55('0xa5')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2795f5,'limit':0x1,'order':[['updatedAt',_0x6f55('0xa6')]]}]});})[_0x6f55('0x22')](handleEntityNotFound(_0x44c24c,null))[_0x6f55('0x22')](function(_0x355803){if(_0x355803){_0x4e894b[_0x6f55('0xa7')]=_['omit'](_0x355803,[_0x6f55('0xa8')]);if(_0x355803[_0x6f55('0xa8')][_0x6f55('0x4e')]){return _0x355803['Contacts'][0x0];}var _0x524010=_[_0x6f55('0x1b')](_0x4e894b['body'],{'firstName':_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')],'ListId':_0x355803['id']});_0x524010[_0x4e894b[_0x6f55('0x65')][_0x6f55('0xa2')]]=_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')];return db[_0x6f55('0xa9')][_0x6f55('0x5f')](_0x524010,{'fields':_0x5327a9,'raw':!![]});}})[_0x6f55('0x22')](handleEntityNotFound(_0x44c24c,null))[_0x6f55('0x22')](function(_0x4e5673){if(_0x4e5673){_0x4e894b[_0x6f55('0xaa')]=_0x4e5673;var _0x329453={'ContactId':_0x4e5673['id'],'phone':_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')],'WhatsappAccountId':_0x1e446d[_0x6f55('0x5d')]['id']};var _0x15dac0={'ContactId':_0x4e5673['id'],'WhatsappAccountId':_0x1e446d[_0x6f55('0x5d')]['id'],'closed':![]};return db[_0x6f55('0xab')][_0x6f55('0x5e')]({'where':_0x15dac0})[_0x6f55('0x22')](function(_0x2d8b20){if(_0x2d8b20){return[_0x2d8b20,![]];}return db['WhatsappInteraction'][_0x6f55('0x5f')](_0x329453)['then'](function(_0x3c66e9){return[_0x3c66e9,!![]];});});}})[_0x6f55('0x74')](function(_0x20c090,_0x1464a8){_0x4e894b[_0x6f55('0xac')]=_0x20c090[_0x6f55('0x38')]({'plain':!![]});_0x4e894b['interaction']['created']=![];if(_0x1464a8){if(_0x4e894b[_0x6f55('0x89')][_0x6f55('0xad')]){_0x4e894b[_0x6f55('0x8f')][_0x6f55('0xae')]({'id':0x0,'priority':_0x4e894b[_0x6f55('0x8f')][_0x6f55('0x4e')]+0x1,'app':_0x6f55('0xaf'),'appdata':_0x6f55('0xb0'),'interval':_0x6f55('0xb1')});}_0x4e894b['interaction'][_0x6f55('0xb2')]=!![];}return db[_0x6f55('0x8c')]['create']({'phone':_0x4e894b[_0x6f55('0x65')]['from'],'messageId':_0x4e894b[_0x6f55('0x65')][_0x6f55('0x9d')],'body':_0x4e894b['body'][_0x6f55('0x65')],'WhatsappAccountId':_0x1e446d[_0x6f55('0x5d')]['id'],'WhatsappInteractionId':_0x20c090['id'],'direction':'in','ContactId':_0x20c090['ContactId'],'AttachmentId':_0x4e894b[_0x6f55('0x65')]['AttachmentId']});})[_0x6f55('0x22')](function(_0x569942){_0x4e894b['message']=_0x569942;if(!_0x4e894b['interaction']['UserId'])return;return db[_0x6f55('0x7b')][_0x6f55('0x5e')]({'attributes':['id',_0x6f55('0x3e')],'where':{'id':_0x4e894b[_0x6f55('0xac')]['UserId']}});})['then'](function(_0x2de1b7){if(_0x2de1b7){_0x4e894b[_0x6f55('0x8f')][_0x6f55('0xb3')]({'id':0x0,'priority':0x0,'app':_0x6f55('0xb4'),'appdata':_0x2de1b7[_0x6f55('0x3e')]+','+(_0x4e894b[_0x6f55('0x89')][_0x6f55('0xb5')]||0xa),'interval':_0x6f55('0xb1')});}if(!_0x4e894b[_0x6f55('0xac')][_0x6f55('0xb6')])return;return db[_0x6f55('0xb7')][_0x6f55('0x5e')]({'attributes':['id',_0x6f55('0x3e')],'where':{'id':_0x4e894b[_0x6f55('0xac')][_0x6f55('0xb6')]}});})['then'](function(_0x35b032){if(_0x35b032){_0x4e894b[_0x6f55('0x8f')][_0x6f55('0xb3')]({'id':0x0,'priority':0x1,'app':_0x6f55('0xb8'),'appdata':_0x35b032['name']+','+(_0x4e894b['account'][_0x6f55('0xb9')]||0x12c),'interval':_0x6f55('0xb1')});}return respondWithRpcPromise('Start','startRouting',_0x4e894b);})[_0x6f55('0x22')](function(_0x2387a8){if(_0x2387a8){var _0x5b926a=0xc8;var _0x1fc484='receiveMessage';logger[_0x6f55('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1fc484,_0x5b926a,_0x6f55('0xba'));logger['debug'](_0x6f55('0xbb'),_0x1fc484,_0x5b926a,_0x6f55('0xba'),JSON[_0x6f55('0x28')](_0x2387a8));if(_0x4e894b[_0x6f55('0x89')][_0x6f55('0x46')]==='twilio'){return _0x44c24c[_0x6f55('0x2e')](_0x5b926a)[_0x6f55('0x34')]('Content-Type',_0x6f55('0xbc'))[_0x6f55('0x3f')](_0x6f55('0xbd'));}else{return _0x44c24c['status'](_0x5b926a)[_0x6f55('0x2f')](_0x2387a8);}}});})['catch'](handleError(_0x44c24c,null));};exports[_0x6f55('0x3f')]=function(_0x774f51,_0x497436,_0x3b62c1){var _0xd56e78,_0x29016f,_0x560e2b;if(_[_0x6f55('0x9f')](_0x774f51[_0x6f55('0x65')]['body'])||_0x774f51['body'][_0x6f55('0x65')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6f55('0x9f')](_0x774f51[_0x6f55('0x65')]['to'])){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))](_0x6f55('0xbe'));}_0xd56e78=_0x774f51[_0x6f55('0x65')]['to'];return db['WhatsappAccount'][_0x6f55('0x5e')]({'where':{'id':_0x774f51['params']['id']},'include':[{'model':db[_0x6f55('0xa4')],'as':_0x6f55('0xbf'),'include':[{'model':db[_0x6f55('0xa9')],'as':_0x6f55('0xa8'),'where':{'mobile':_0xd56e78},'limit':0x1,'order':[[_0x6f55('0xc0'),_0x6f55('0xa6')]]}]}]})[_0x6f55('0x22')](handleEntityNotFound(_0x497436,null))[_0x6f55('0x22')](function(_0x5e66c2){if(_0x5e66c2&&_0x5e66c2[_0x6f55('0xbf')]){_0x29016f=_0x5e66c2['get']({'plain':!![]});if(_0x29016f[_0x6f55('0xbf')]&&_0x29016f[_0x6f55('0xbf')]['Contacts'][_0x6f55('0x4e')]){return _0x29016f[_0x6f55('0xbf')]['Contacts'][0x0];}return db[_0x6f55('0xa9')][_0x6f55('0x5f')](_['defaults'](_0x774f51[_0x6f55('0x65')],{'firstName':_0xd56e78,'mobile':_0xd56e78,'phone':_0xd56e78,'ListId':_0x29016f['ListId']}));}})[_0x6f55('0x22')](handleEntityNotFound(_0x497436,null))['then'](function(_0x1c5338){if(_0x1c5338){_0x560e2b=_0x1c5338;return db[_0x6f55('0xab')][_0x6f55('0x5e')]({'where':{'ContactId':_0x560e2b['id'],'closed':![],'WhatsappAccountId':_0x29016f['id']}})['then'](function(_0xb9e3f4){if(_0xb9e3f4){return[_0xb9e3f4,![]];}return db[_0x6f55('0xab')][_0x6f55('0x5f')]({'UserId':_0x774f51[_0x6f55('0x61')]['id'],'ContactId':_0x560e2b['id'],'WhatsappAccountId':_0x29016f['id'],'phone':_0xd56e78,'firstMsgDirection':_0x6f55('0xc1'),'Messages':[_[_0x6f55('0x56')](_0x774f51['body'],{'read':![],'body':_0x774f51[_0x6f55('0x65')][_0x6f55('0x65')],'phone':_0xd56e78,'WhatsappAccountId':_0x29016f['id'],'UserId':_0x774f51[_0x6f55('0x61')]['id'],'ContactId':_0x560e2b['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x6f55('0xc2')}]})[_0x6f55('0x22')](function(_0x25c23c){return[_0x25c23c,!![]];});});}})[_0x6f55('0x74')](function(_0x14a548,_0x439b8c){if(_0x439b8c){return _0x14a548;}return db[_0x6f55('0x8c')][_0x6f55('0x5f')](_[_0x6f55('0x56')](_0x774f51[_0x6f55('0x65')],{'read':![],'body':_0x774f51[_0x6f55('0x65')][_0x6f55('0x65')],'phone':_0xd56e78,'WhatsappAccountId':_0x29016f['id'],'WhatsappInteractionId':_0x14a548['id'],'UserId':_0x774f51[_0x6f55('0x61')]['id'],'ContactId':_0x560e2b['id']}))[_0x6f55('0x22')](function(_0x29cafc){_0x14a548[_0x6f55('0xc3')][_0x6f55('0xc2')]=[];_0x14a548[_0x6f55('0xc3')][_0x6f55('0xc2')][_0x6f55('0xae')](_0x29cafc[_0x6f55('0xc3')]);return _0x14a548;});})['then'](respondWithResult(_0x497436,null))['catch'](handleError(_0x497436,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 1cc475f..ce73b55 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 _0xa966=['events','../../mysqldb','setMaxListeners','remove','hook','exports'];(function(_0x497f7f,_0xdf20bb){var _0x54ab29=function(_0x1ed90b){while(--_0x1ed90b){_0x497f7f['push'](_0x497f7f['shift']());}};_0x54ab29(++_0xdf20bb);}(_0xa966,0x9c));var _0x6a96=function(_0x1e6460,_0x4127e4){_0x1e6460=_0x1e6460-0x0;var _0x5e5316=_0xa966[_0x1e6460];return _0x5e5316;};'use strict';var EventEmitter=require(_0x6a96('0x0'));var WhatsappAccount=require(_0x6a96('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6a96('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6a96('0x3')};function emitEvent(_0x233884){return function(_0x4850f7,_0x57c5c5,_0x782bc8){WhatsappAccountEvents['emit'](_0x233884+':'+_0x4850f7['id'],_0x4850f7);WhatsappAccountEvents['emit'](_0x233884,_0x4850f7);_0x782bc8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x6a96('0x4')](e,emitEvent(event));}}module[_0x6a96('0x5')]=WhatsappAccountEvents; \ No newline at end of file +var _0x54d6=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0x54d6,0x11d));var _0x654d=function(_0x56d177,_0x526378){_0x56d177=_0x56d177-0x0;var _0x5bcfd0=_0x54d6[_0x56d177];return _0x5bcfd0;};'use strict';var EventEmitter=require(_0x654d('0x0'));var WhatsappAccount=require(_0x654d('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x654d('0x2')](0x0);var events={'afterCreate':_0x654d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b82c2){return function(_0x122800,_0x6d1a00,_0xfea275){WhatsappAccountEvents[_0x654d('0x4')](_0x1b82c2+':'+_0x122800['id'],_0x122800);WhatsappAccountEvents[_0x654d('0x4')](_0x1b82c2,_0x122800);_0xfea275(null);};}for(var e in events){if(events[_0x654d('0x5')](e)){var event=events[e];WhatsappAccount[_0x654d('0x6')](e,emitEvent(event));}}module[_0x654d('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index b31691a..d767103 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 _0xd67b=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xd67b,0x18f));var _0xbd67=function(_0x518eb7,_0xb512ec){_0x518eb7=_0x518eb7-0x0;var _0x4530b1=_0xd67b[_0x518eb7];return _0x4530b1;};'use strict';var _=require(_0xbd67('0x0'));var util=require(_0xbd67('0x1'));var logger=require(_0xbd67('0x2'))(_0xbd67('0x3'));var moment=require(_0xbd67('0x4'));var BPromise=require(_0xbd67('0x5'));var rp=require(_0xbd67('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd67('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0xbd67('0x8')]=function(_0x2ab1e3,_0xfe0303){return _0x2ab1e3[_0xbd67('0x9')](_0xbd67('0xa'),attributes,{'tableName':_0xbd67('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5c4=['rimraf','./whatsappAccount.attributes','define','WhatsappAccount','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11af81,_0x3d1a99){var _0x367dc6=function(_0x34370a){while(--_0x34370a){_0x11af81['push'](_0x11af81['shift']());}};_0x367dc6(++_0x3d1a99);}(_0xf5c4,0x88));var _0x4f5c=function(_0x231e58,_0x4fda70){_0x231e58=_0x231e58-0x0;var _0x3549b7=_0xf5c4[_0x231e58];return _0x3549b7;};'use strict';var _=require('lodash');var util=require(_0x4f5c('0x0'));var logger=require(_0x4f5c('0x1'))(_0x4f5c('0x2'));var moment=require(_0x4f5c('0x3'));var BPromise=require(_0x4f5c('0x4'));var rp=require(_0x4f5c('0x5'));var fs=require('fs');var path=require(_0x4f5c('0x6'));var rimraf=require(_0x4f5c('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f5c('0x8'));module['exports']=function(_0x54352b,_0x336e26){return _0x54352b[_0x4f5c('0x9')](_0x4f5c('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index e82e972..4a0095d 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 _0xf2cb=['info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappAccount,\x20%s,\x20%s','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','include','model','attributes','map','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then'];(function(_0x5702ec,_0x4ade92){var _0x44c422=function(_0x29b72d){while(--_0x29b72d){_0x5702ec['push'](_0x5702ec['shift']());}};_0x44c422(++_0x4ade92);}(_0xf2cb,0x1db));var _0xbf2c=function(_0x43900d,_0xd0e108){_0x43900d=_0x43900d-0x0;var _0x1df3d3=_0xf2cb[_0x43900d];return _0x1df3d3;};'use strict';var _=require(_0xbf2c('0x0'));var util=require(_0xbf2c('0x1'));var moment=require(_0xbf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf2c('0x3'));var fs=require('fs');var Redis=require(_0xbf2c('0x4'));var db=require(_0xbf2c('0x5'))['db'];var utils=require(_0xbf2c('0x6'));var logger=require(_0xbf2c('0x7'))(_0xbf2c('0x8'));var config=require(_0xbf2c('0x9'));var jayson=require(_0xbf2c('0xa'));var client=jayson[_0xbf2c('0xb')][_0xbf2c('0xc')]({'port':0x232a});config[_0xbf2c('0xd')]=_[_0xbf2c('0xe')](config[_0xbf2c('0xd')],{'host':_0xbf2c('0xf'),'port':0x18eb});var socket=require(_0xbf2c('0x10'))(new Redis(config[_0xbf2c('0xd')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x19de84,_0x2b49e6,_0x52ade1){return new BPromise(function(_0x5277c8,_0x176a7f){return client[_0xbf2c('0x11')](_0x19de84,_0x52ade1)[_0xbf2c('0x12')](function(_0x3cafca){logger[_0xbf2c('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x2b49e6,_0xbf2c('0x14'));logger[_0xbf2c('0x15')](_0xbf2c('0x16'),_0x2b49e6,_0xbf2c('0x14'),JSON['stringify'](_0x3cafca));if(_0x3cafca['error']){if(_0x3cafca[_0xbf2c('0x17')][_0xbf2c('0x18')]===0x1f4){logger[_0xbf2c('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x2b49e6,_0x3cafca[_0xbf2c('0x17')]['message']);return _0x176a7f(_0x3cafca['error'][_0xbf2c('0x19')]);}logger['error'](_0xbf2c('0x1a'),_0x2b49e6,_0x3cafca[_0xbf2c('0x17')][_0xbf2c('0x19')]);return _0x5277c8(_0x3cafca[_0xbf2c('0x17')][_0xbf2c('0x19')]);}else{logger[_0xbf2c('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x2b49e6,_0xbf2c('0x14'));_0x5277c8(_0x3cafca['result'][_0xbf2c('0x19')]);}})[_0xbf2c('0x1b')](function(_0x1f85a2){logger[_0xbf2c('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x2b49e6,_0x1f85a2);_0x176a7f(_0x1f85a2);});});}exports[_0xbf2c('0x1c')]=function(_0x333542){var _0x5c04d2=this;return new Promise(function(_0x477d01,_0x2d91d1){return db[_0xbf2c('0x1d')][_0xbf2c('0x1e')]({'raw':_0x333542[_0xbf2c('0x1f')]?_0x333542[_0xbf2c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x333542[_0xbf2c('0x1f')]?_0x333542['options'][_0xbf2c('0x20')]||null:null,'attributes':_0x333542[_0xbf2c('0x1f')]?_0x333542[_0xbf2c('0x1f')]['attributes']||null:null,'include':_0x333542['options']?_0x333542[_0xbf2c('0x1f')]['include']?_['map'](_0x333542[_0xbf2c('0x1f')][_0xbf2c('0x21')],function(_0x12ea64){return{'model':db[_0x12ea64[_0xbf2c('0x22')]],'as':_0x12ea64['as'],'attributes':_0x12ea64[_0xbf2c('0x23')],'include':_0x12ea64[_0xbf2c('0x21')]?_['map'](_0x12ea64[_0xbf2c('0x21')],function(_0x33373f){return{'model':db[_0x33373f[_0xbf2c('0x22')]],'as':_0x33373f['as'],'attributes':_0x33373f[_0xbf2c('0x23')],'include':_0x33373f[_0xbf2c('0x21')]?_[_0xbf2c('0x24')](_0x33373f[_0xbf2c('0x21')],function(_0x2e6e3d){return{'model':db[_0x2e6e3d['model']],'as':_0x2e6e3d['as'],'attributes':_0x2e6e3d[_0xbf2c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbf2c('0x12')](function(_0x47833b){logger[_0xbf2c('0x13')](_0xbf2c('0x1c'),_0x333542);logger[_0xbf2c('0x15')](_0xbf2c('0x1c'),_0x333542,JSON[_0xbf2c('0x25')](_0x47833b));_0x477d01(_0x47833b);})[_0xbf2c('0x1b')](function(_0x2f4852){logger[_0xbf2c('0x17')]('ShowWhatsappAccount',_0x2f4852[_0xbf2c('0x19')],_0x333542);_0x2d91d1(_0x5c04d2[_0xbf2c('0x17')](0x1f4,_0x2f4852[_0xbf2c('0x19')]));});});}; \ No newline at end of file +var _0x1e5f=['socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0x1e5f,0x194));var _0xf1e5=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x1e5f[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0xf1e5('0x0'));var util=require('util');var moment=require(_0xf1e5('0x1'));var BPromise=require(_0xf1e5('0x2'));var rs=require(_0xf1e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1e5('0x4'))['db'];var utils=require(_0xf1e5('0x5'));var logger=require(_0xf1e5('0x6'))(_0xf1e5('0x7'));var config=require('../../config/environment');var jayson=require(_0xf1e5('0x8'));var client=jayson[_0xf1e5('0x9')][_0xf1e5('0xa')]({'port':0x232a});config[_0xf1e5('0xb')]=_[_0xf1e5('0xc')](config[_0xf1e5('0xb')],{'host':_0xf1e5('0xd'),'port':0x18eb});var socket=require(_0xf1e5('0xe'))(new Redis(config[_0xf1e5('0xb')]));require('./whatsappAccount.socket')[_0xf1e5('0xf')](socket);function respondWithRpcPromise(_0xbc606c,_0x1f4fc7,_0x391bb1){return new BPromise(function(_0x119586,_0x788410){return client[_0xf1e5('0x10')](_0xbc606c,_0x391bb1)[_0xf1e5('0x11')](function(_0x10010){logger[_0xf1e5('0x12')](_0xf1e5('0x13'),_0x1f4fc7,_0xf1e5('0x14'));logger[_0xf1e5('0x15')](_0xf1e5('0x16'),_0x1f4fc7,_0xf1e5('0x14'),JSON[_0xf1e5('0x17')](_0x10010));if(_0x10010['error']){if(_0x10010[_0xf1e5('0x18')][_0xf1e5('0x19')]===0x1f4){logger[_0xf1e5('0x18')](_0xf1e5('0x13'),_0x1f4fc7,_0x10010[_0xf1e5('0x18')][_0xf1e5('0x1a')]);return _0x788410(_0x10010[_0xf1e5('0x18')][_0xf1e5('0x1a')]);}logger[_0xf1e5('0x18')](_0xf1e5('0x13'),_0x1f4fc7,_0x10010[_0xf1e5('0x18')]['message']);return _0x119586(_0x10010['error'][_0xf1e5('0x1a')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x1f4fc7,_0xf1e5('0x14'));_0x119586(_0x10010[_0xf1e5('0x1b')][_0xf1e5('0x1a')]);}})['catch'](function(_0x41c79d){logger[_0xf1e5('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x1f4fc7,_0x41c79d);_0x788410(_0x41c79d);});});}exports[_0xf1e5('0x1c')]=function(_0x4dd045){var _0x6f2e12=this;return new Promise(function(_0x2b4e51,_0x298ed1){return db[_0xf1e5('0x1d')][_0xf1e5('0x1e')]({'raw':_0x4dd045[_0xf1e5('0x1f')]?_0x4dd045[_0xf1e5('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4dd045['options']?_0x4dd045[_0xf1e5('0x1f')][_0xf1e5('0x20')]||null:null,'attributes':_0x4dd045[_0xf1e5('0x1f')]?_0x4dd045[_0xf1e5('0x1f')][_0xf1e5('0x21')]||null:null,'include':_0x4dd045[_0xf1e5('0x1f')]?_0x4dd045['options'][_0xf1e5('0x22')]?_[_0xf1e5('0x23')](_0x4dd045[_0xf1e5('0x1f')][_0xf1e5('0x22')],function(_0x566eaa){return{'model':db[_0x566eaa[_0xf1e5('0x24')]],'as':_0x566eaa['as'],'attributes':_0x566eaa[_0xf1e5('0x21')],'include':_0x566eaa[_0xf1e5('0x22')]?_['map'](_0x566eaa[_0xf1e5('0x22')],function(_0x5e584f){return{'model':db[_0x5e584f['model']],'as':_0x5e584f['as'],'attributes':_0x5e584f['attributes'],'include':_0x5e584f[_0xf1e5('0x22')]?_['map'](_0x5e584f[_0xf1e5('0x22')],function(_0xa95a31){return{'model':db[_0xa95a31[_0xf1e5('0x24')]],'as':_0xa95a31['as'],'attributes':_0xa95a31['attributes']};}):[]};}):[]};}):[]:[]})[_0xf1e5('0x11')](function(_0x16e2a3){logger[_0xf1e5('0x12')](_0xf1e5('0x1c'),_0x4dd045);logger[_0xf1e5('0x15')](_0xf1e5('0x1c'),_0x4dd045,JSON[_0xf1e5('0x17')](_0x16e2a3));_0x2b4e51(_0x16e2a3);})[_0xf1e5('0x25')](function(_0x58739b){logger[_0xf1e5('0x18')](_0xf1e5('0x1c'),_0x58739b[_0xf1e5('0x1a')],_0x4dd045);_0x298ed1(_0x6f2e12['error'](0x1f4,_0x58739b[_0xf1e5('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 5eb6be7..149180f 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 _0x5777=['save','remove','removeListener','register','length','whatsappAccount:'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x5777,0x156));var _0x7577=function(_0x268857,_0x58a836){_0x268857=_0x268857-0x0;var _0x21b1a2=_0x5777[_0x268857];return _0x21b1a2;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x7577('0x0'),_0x7577('0x1'),'update'];function createListener(_0xba6fa0,_0x3a070a){return function(_0x49aa5e){_0x3a070a['emit'](_0xba6fa0,_0x49aa5e);};}function removeListener(_0x386963,_0x575b74){return function(){WhatsappAccountEvents[_0x7577('0x2')](_0x386963,_0x575b74);};}exports[_0x7577('0x3')]=function(_0x513dbd){for(var _0xf3b35=0x0,_0x4e96a7=events[_0x7577('0x4')];_0xf3b35<_0x4e96a7;_0xf3b35++){var _0x48ebd=events[_0xf3b35];var _0x1c3164=createListener(_0x7577('0x5')+_0x48ebd,_0x513dbd);WhatsappAccountEvents['on'](_0x48ebd,_0x1c3164);}}; \ No newline at end of file +var _0x82f3=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','emit'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x82f3,0x130));var _0x382f=function(_0x1277c5,_0x342be3){_0x1277c5=_0x1277c5-0x0;var _0x319f11=_0x82f3[_0x1277c5];return _0x319f11;};'use strict';var WhatsappAccountEvents=require(_0x382f('0x0'));var events=['save','remove','update'];function createListener(_0x1c1b04,_0x2147b3){return function(_0x6278ca){_0x2147b3[_0x382f('0x1')](_0x1c1b04,_0x6278ca);};}function removeListener(_0xd9caa9,_0x182266){return function(){WhatsappAccountEvents[_0x382f('0x2')](_0xd9caa9,_0x182266);};}exports[_0x382f('0x3')]=function(_0x4ebdc9){for(var _0x500ccb=0x0,_0x177989=events[_0x382f('0x4')];_0x500ccb<_0x177989;_0x500ccb++){var _0x23c1a4=events[_0x500ccb];var _0x34ea5e=createListener(_0x382f('0x5')+_0x23c1a4,_0x4ebdc9);WhatsappAccountEvents['on'](_0x23c1a4,_0x34ea5e);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 9d5c6fe..c528cd9 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 _0x25da=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','create','/:id','update','delete','destroy','multer','util'];(function(_0x52ba09,_0x25eccf){var _0x4c433b=function(_0x2bd847){while(--_0x2bd847){_0x52ba09['push'](_0x52ba09['shift']());}};_0x4c433b(++_0x25eccf);}(_0x25da,0xb9));var _0xa25d=function(_0x4d66fd,_0x30abf4){_0x4d66fd=_0x4d66fd-0x0;var _0x440af4=_0x25da[_0x4d66fd];return _0x440af4;};'use strict';var multer=require(_0xa25d('0x0'));var util=require(_0xa25d('0x1'));var path=require('path');var timeout=require(_0xa25d('0x2'));var express=require(_0xa25d('0x3'));var router=express[_0xa25d('0x4')]();var fs_extra=require(_0xa25d('0x5'));var auth=require(_0xa25d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa25d('0x7'));var controller=require(_0xa25d('0x8'));router[_0xa25d('0x9')]('/',auth[_0xa25d('0xa')](),controller[_0xa25d('0xb')]);router[_0xa25d('0x9')]('/:id',auth[_0xa25d('0xa')](),controller['show']);router['post']('/',auth[_0xa25d('0xa')](),controller[_0xa25d('0xc')]);router['put'](_0xa25d('0xd'),auth['isAuthenticated'](),controller[_0xa25d('0xe')]);router[_0xa25d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa25d('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf922=['show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xf922,0xbb));var _0x2f92=function(_0xb8cc0f,_0x189431){_0xb8cc0f=_0xb8cc0f-0x0;var _0x49649b=_0xf922[_0xb8cc0f];return _0x49649b;};'use strict';var multer=require(_0x2f92('0x0'));var util=require(_0x2f92('0x1'));var path=require('path');var timeout=require(_0x2f92('0x2'));var express=require(_0x2f92('0x3'));var router=express[_0x2f92('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f92('0x5'));var interaction=require(_0x2f92('0x6'));var config=require(_0x2f92('0x7'));var controller=require(_0x2f92('0x8'));router[_0x2f92('0x9')]('/',auth[_0x2f92('0xa')](),controller[_0x2f92('0xb')]);router[_0x2f92('0x9')](_0x2f92('0xc'),auth['isAuthenticated'](),controller[_0x2f92('0xd')]);router[_0x2f92('0xe')]('/',auth[_0x2f92('0xa')](),controller['create']);router[_0x2f92('0xf')](_0x2f92('0xc'),auth[_0x2f92('0xa')](),controller[_0x2f92('0x10')]);router[_0x2f92('0x11')](_0x2f92('0xc'),auth['isAuthenticated'](),controller[_0x2f92('0x12')]);module[_0x2f92('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ec8759a..3492ef7 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 _0x2c39=['TEXT','sequelize','INTEGER','STRING'];(function(_0x21a8b3,_0x1ef181){var _0x5ad837=function(_0x803888){while(--_0x803888){_0x21a8b3['push'](_0x21a8b3['shift']());}};_0x5ad837(++_0x1ef181);}(_0x2c39,0xc5));var _0x92c3=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x2c39[_0x4c6d6f];return _0x2d4478;};'use strict';var Sequelize=require(_0x92c3('0x0'));module['exports']={'priority':{'type':Sequelize[_0x92c3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x92c3('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x92c3('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x92c3('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3a61=['TEXT','*,*,*,*','sequelize','STRING'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x3a61,0x192));var _0x13a6=function(_0x47ea50,_0x4f713f){_0x47ea50=_0x47ea50-0x0;var _0x4986bb=_0x3a61[_0x47ea50];return _0x4986bb;};'use strict';var Sequelize=require(_0x13a6('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x13a6('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x13a6('0x2')]()},'description':{'type':Sequelize[_0x13a6('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x13a6('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index dd9fad7..def2357 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 _0xe8e8=['undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','length','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','params','fields','includeAll','create','body','find','eml-format','rimraf','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x507e12,_0x513ccf){var _0x5366ce=function(_0x1c4c47){while(--_0x1c4c47){_0x507e12['push'](_0x507e12['shift']());}};_0x5366ce(++_0x513ccf);}(_0xe8e8,0xc6));var _0x8e8e=function(_0x501b84,_0x505516){_0x501b84=_0x501b84-0x0;var _0x1dcbd8=_0xe8e8[_0x501b84];return _0x1dcbd8;};'use strict';var emlformat=require(_0x8e8e('0x0'));var rimraf=require(_0x8e8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e8e('0x2'));var moment=require(_0x8e8e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e8e('0x4'));var path=require('path');var sox=require(_0x8e8e('0x5'));var csv=require(_0x8e8e('0x6'));var ejs=require(_0x8e8e('0x7'));var fs=require('fs');var fs_extra=require(_0x8e8e('0x8'));var _=require('lodash');var squel=require(_0x8e8e('0x9'));var crypto=require('crypto');var jsforce=require(_0x8e8e('0xa'));var deskjs=require(_0x8e8e('0xb'));var toCsv=require(_0x8e8e('0x6'));var querystring=require(_0x8e8e('0xc'));var Papa=require(_0x8e8e('0xd'));var Redis=require(_0x8e8e('0xe'));var authService=require(_0x8e8e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8e8e('0x10'));var hardwareService=require(_0x8e8e('0x11'));var logger=require(_0x8e8e('0x12'))(_0x8e8e('0x13'));var utils=require('../../config/utils');var config=require(_0x8e8e('0x14'));var licenseUtil=require(_0x8e8e('0x15'));var db=require(_0x8e8e('0x16'))['db'];function respondWithStatusCode(_0xb6501e,_0x1f5aa2){_0x1f5aa2=_0x1f5aa2||0xcc;return function(_0x17e222){if(_0x17e222){return _0xb6501e[_0x8e8e('0x17')](_0x1f5aa2);}return _0xb6501e[_0x8e8e('0x18')](_0x1f5aa2)[_0x8e8e('0x19')]();};}function respondWithResult(_0x176ae6,_0x548774){_0x548774=_0x548774||0xc8;return function(_0x320c42){if(_0x320c42){return _0x176ae6[_0x8e8e('0x18')](_0x548774)['json'](_0x320c42);}};}function respondWithFilteredResult(_0x45a15a,_0x23c61b){return function(_0x5d8be1){if(_0x5d8be1){var _0x439288=typeof _0x23c61b[_0x8e8e('0x1a')]===_0x8e8e('0x1b')&&typeof _0x23c61b[_0x8e8e('0x1c')]===_0x8e8e('0x1b');var _0x36c329=_0x5d8be1[_0x8e8e('0x1d')];var _0x27f7f6=_0x439288?0x0:_0x23c61b[_0x8e8e('0x1a')];var _0xdbde13=_0x439288?_0x5d8be1['count']:_0x23c61b[_0x8e8e('0x1a')]+_0x23c61b[_0x8e8e('0x1c')];var _0x5c2a85;if(_0xdbde13>=_0x36c329){_0xdbde13=_0x36c329;_0x5c2a85=0xc8;}else{_0x5c2a85=0xce;}_0x45a15a[_0x8e8e('0x18')](_0x5c2a85);return _0x45a15a[_0x8e8e('0x1e')](_0x8e8e('0x1f'),_0x27f7f6+'-'+_0xdbde13+'/'+_0x36c329)[_0x8e8e('0x20')](_0x5d8be1);}return null;};}function patchUpdates(_0x572c19){return function(_0x586b7e){try{jsonpatch['apply'](_0x586b7e,_0x572c19,!![]);}catch(_0x2676f3){return BPromise[_0x8e8e('0x21')](_0x2676f3);}return _0x586b7e[_0x8e8e('0x22')]();};}function saveUpdates(_0x21efa0,_0x59f008){return function(_0x32ff35){if(_0x32ff35){return _0x32ff35[_0x8e8e('0x23')](_0x21efa0)[_0x8e8e('0x24')](function(_0x585743){return _0x585743;});}return null;};}function removeEntity(_0x3d42c2,_0x4c685e){return function(_0x5f2a24){if(_0x5f2a24){return _0x5f2a24[_0x8e8e('0x25')]()[_0x8e8e('0x24')](function(){_0x3d42c2['status'](0xcc)[_0x8e8e('0x19')]();});}};}function handleEntityNotFound(_0x338f91,_0x32899c){return function(_0x110c70){if(!_0x110c70){_0x338f91['sendStatus'](0x194);}return _0x110c70;};}function handleError(_0x344830,_0x1dfed4){_0x1dfed4=_0x1dfed4||0x1f4;return function(_0x1ca842){logger[_0x8e8e('0x26')](_0x1ca842[_0x8e8e('0x27')]);if(_0x1ca842[_0x8e8e('0x28')]){delete _0x1ca842[_0x8e8e('0x28')];}_0x344830[_0x8e8e('0x18')](_0x1dfed4)[_0x8e8e('0x29')](_0x1ca842);};}exports[_0x8e8e('0x2a')]=function(_0x56424b,_0x3fca96){var _0x408ed6={},_0x2536df={},_0x4929ab={'count':0x0,'rows':[]};var _0xaba2cc=_[_0x8e8e('0x2b')](db[_0x8e8e('0x2c')][_0x8e8e('0x2d')],function(_0x5edf41){return{'name':_0x5edf41[_0x8e8e('0x2e')],'type':_0x5edf41[_0x8e8e('0x2f')][_0x8e8e('0x30')]};});_0x2536df['model']=_[_0x8e8e('0x2b')](_0xaba2cc,_0x8e8e('0x28'));_0x2536df['query']=_[_0x8e8e('0x31')](_0x56424b[_0x8e8e('0x32')]);_0x2536df['filters']=_['intersection'](_0x2536df['model'],_0x2536df[_0x8e8e('0x32')]);_0x408ed6[_0x8e8e('0x33')]=_[_0x8e8e('0x34')](_0x2536df[_0x8e8e('0x35')],qs['fields'](_0x56424b[_0x8e8e('0x32')]['fields']));_0x408ed6['attributes']=_0x408ed6[_0x8e8e('0x33')][_0x8e8e('0x36')]?_0x408ed6['attributes']:_0x2536df[_0x8e8e('0x35')];if(!_0x56424b[_0x8e8e('0x32')]['hasOwnProperty'](_0x8e8e('0x37'))){_0x408ed6[_0x8e8e('0x1c')]=qs[_0x8e8e('0x1c')](_0x56424b[_0x8e8e('0x32')][_0x8e8e('0x1c')]);_0x408ed6[_0x8e8e('0x1a')]=qs[_0x8e8e('0x1a')](_0x56424b[_0x8e8e('0x32')][_0x8e8e('0x1a')]);}_0x408ed6[_0x8e8e('0x38')]=qs[_0x8e8e('0x39')](_0x56424b['query'][_0x8e8e('0x39')]);_0x408ed6['where']=qs[_0x8e8e('0x3a')](_[_0x8e8e('0x3b')](_0x56424b[_0x8e8e('0x32')],_0x2536df[_0x8e8e('0x3a')]),_0xaba2cc);if(_0x56424b[_0x8e8e('0x32')]['filter']){_0x408ed6[_0x8e8e('0x3c')]=_['merge'](_0x408ed6[_0x8e8e('0x3c')],{'$or':_[_0x8e8e('0x2b')](_0xaba2cc,function(_0x3f60d1){if(_0x3f60d1['type']!==_0x8e8e('0x3d')){var _0x19fd04={};_0x19fd04[_0x3f60d1['name']]={'$like':'%'+_0x56424b[_0x8e8e('0x32')][_0x8e8e('0x3e')]+'%'};return _0x19fd04;}})});}_0x408ed6=_[_0x8e8e('0x3f')]({},_0x408ed6,_0x56424b[_0x8e8e('0x40')]);var _0x409981={'where':_0x408ed6[_0x8e8e('0x3c')]};return db['WhatsappApplication'][_0x8e8e('0x1d')](_0x409981)[_0x8e8e('0x24')](function(_0x1402d8){_0x4929ab[_0x8e8e('0x1d')]=_0x1402d8;if(_0x56424b[_0x8e8e('0x32')]['includeAll']){_0x408ed6[_0x8e8e('0x41')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x8e8e('0x42')](_0x408ed6);})['then'](function(_0x549dd6){_0x4929ab[_0x8e8e('0x43')]=_0x549dd6;return _0x4929ab;})[_0x8e8e('0x24')](respondWithFilteredResult(_0x3fca96,_0x408ed6))[_0x8e8e('0x44')](handleError(_0x3fca96,null));};exports['show']=function(_0x610892,_0x58aa71){var _0x12009c={'raw':!![],'where':{'id':_0x610892[_0x8e8e('0x45')]['id']}},_0x5dafb1={};_0x5dafb1[_0x8e8e('0x35')]=_[_0x8e8e('0x31')](db['WhatsappApplication'][_0x8e8e('0x2d')]);_0x5dafb1['query']=_[_0x8e8e('0x31')](_0x610892['query']);_0x5dafb1[_0x8e8e('0x3a')]=_[_0x8e8e('0x34')](_0x5dafb1[_0x8e8e('0x35')],_0x5dafb1[_0x8e8e('0x32')]);_0x12009c[_0x8e8e('0x33')]=_[_0x8e8e('0x34')](_0x5dafb1[_0x8e8e('0x35')],qs[_0x8e8e('0x46')](_0x610892[_0x8e8e('0x32')][_0x8e8e('0x46')]));_0x12009c[_0x8e8e('0x33')]=_0x12009c['attributes'][_0x8e8e('0x36')]?_0x12009c[_0x8e8e('0x33')]:_0x5dafb1[_0x8e8e('0x35')];if(_0x610892[_0x8e8e('0x32')][_0x8e8e('0x47')]){_0x12009c['include']=[{'all':!![]}];}_0x12009c=_[_0x8e8e('0x3f')]({},_0x12009c,_0x610892[_0x8e8e('0x40')]);return db[_0x8e8e('0x2c')]['find'](_0x12009c)[_0x8e8e('0x24')](handleEntityNotFound(_0x58aa71,null))[_0x8e8e('0x24')](respondWithResult(_0x58aa71,null))[_0x8e8e('0x44')](handleError(_0x58aa71,null));};exports[_0x8e8e('0x48')]=function(_0x132bcf,_0xae770c){return db[_0x8e8e('0x2c')]['create'](_0x132bcf['body'],{})[_0x8e8e('0x24')](respondWithResult(_0xae770c,0xc9))[_0x8e8e('0x44')](handleError(_0xae770c,null));};exports[_0x8e8e('0x23')]=function(_0x150a7d,_0x4bc828){if(_0x150a7d[_0x8e8e('0x49')]['id']){delete _0x150a7d[_0x8e8e('0x49')]['id'];}return db[_0x8e8e('0x2c')][_0x8e8e('0x4a')]({'where':{'id':_0x150a7d[_0x8e8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x4bc828,null))['then'](saveUpdates(_0x150a7d['body'],null))[_0x8e8e('0x24')](respondWithResult(_0x4bc828,null))[_0x8e8e('0x44')](handleError(_0x4bc828,null));};exports[_0x8e8e('0x25')]=function(_0x5d8181,_0x310bc8){return db[_0x8e8e('0x2c')][_0x8e8e('0x4a')]({'where':{'id':_0x5d8181['params']['id']}})[_0x8e8e('0x24')](handleEntityNotFound(_0x310bc8,null))[_0x8e8e('0x24')](removeEntity(_0x310bc8,null))[_0x8e8e('0x44')](handleError(_0x310bc8,null));}; \ No newline at end of file +var _0x63a6=['pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','count','status','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappApplication','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x63a6,0x1c7));var _0x663a=function(_0x41886e,_0x2f9b3e){_0x41886e=_0x41886e-0x0;var _0x10e7f4=_0x63a6[_0x41886e];return _0x10e7f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x663a('0x0'));var zipdir=require(_0x663a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x663a('0x2'));var moment=require(_0x663a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x663a('0x4'));var util=require(_0x663a('0x5'));var path=require(_0x663a('0x6'));var sox=require(_0x663a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663a('0x8'));var squel=require(_0x663a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x663a('0xa'));var toCsv=require(_0x663a('0xb'));var querystring=require(_0x663a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x663a('0xd'));var qs=require(_0x663a('0xe'));var as=require(_0x663a('0xf'));var hardwareService=require(_0x663a('0x10'));var logger=require(_0x663a('0x11'))(_0x663a('0x12'));var utils=require('../../config/utils');var config=require(_0x663a('0x13'));var licenseUtil=require(_0x663a('0x14'));var db=require(_0x663a('0x15'))['db'];function respondWithStatusCode(_0x581440,_0x583366){_0x583366=_0x583366||0xcc;return function(_0x3f3ef4){if(_0x3f3ef4){return _0x581440['sendStatus'](_0x583366);}return _0x581440['status'](_0x583366)[_0x663a('0x16')]();};}function respondWithResult(_0x39d5d4,_0x558f2f){_0x558f2f=_0x558f2f||0xc8;return function(_0x1eaf35){if(_0x1eaf35){return _0x39d5d4['status'](_0x558f2f)[_0x663a('0x17')](_0x1eaf35);}};}function respondWithFilteredResult(_0x1eab42,_0x15afa0){return function(_0x2d794f){if(_0x2d794f){var _0x1a8d76=typeof _0x15afa0['offset']===_0x663a('0x18')&&typeof _0x15afa0['limit']===_0x663a('0x18');var _0x45f489=_0x2d794f[_0x663a('0x19')];var _0x1508ab=_0x1a8d76?0x0:_0x15afa0['offset'];var _0x2a1f33=_0x1a8d76?_0x2d794f['count']:_0x15afa0['offset']+_0x15afa0['limit'];var _0x2d006c;if(_0x2a1f33>=_0x45f489){_0x2a1f33=_0x45f489;_0x2d006c=0xc8;}else{_0x2d006c=0xce;}_0x1eab42[_0x663a('0x1a')](_0x2d006c);return _0x1eab42['set']('Content-Range',_0x1508ab+'-'+_0x2a1f33+'/'+_0x45f489)[_0x663a('0x17')](_0x2d794f);}return null;};}function patchUpdates(_0x173a10){return function(_0x89d455){try{jsonpatch[_0x663a('0x1b')](_0x89d455,_0x173a10,!![]);}catch(_0x221c83){return BPromise[_0x663a('0x1c')](_0x221c83);}return _0x89d455[_0x663a('0x1d')]();};}function saveUpdates(_0x52d97b,_0x1586f3){return function(_0x21152c){if(_0x21152c){return _0x21152c[_0x663a('0x1e')](_0x52d97b)[_0x663a('0x1f')](function(_0x3d4e7c){return _0x3d4e7c;});}return null;};}function removeEntity(_0x207b26,_0x5e1bd1){return function(_0x310339){if(_0x310339){return _0x310339[_0x663a('0x20')]()['then'](function(){_0x207b26[_0x663a('0x1a')](0xcc)[_0x663a('0x16')]();});}};}function handleEntityNotFound(_0x5463d5,_0x3cb58a){return function(_0x2b2762){if(!_0x2b2762){_0x5463d5['sendStatus'](0x194);}return _0x2b2762;};}function handleError(_0x1e2653,_0x41c552){_0x41c552=_0x41c552||0x1f4;return function(_0x57131d){logger[_0x663a('0x21')](_0x57131d['stack']);if(_0x57131d[_0x663a('0x22')]){delete _0x57131d[_0x663a('0x22')];}_0x1e2653[_0x663a('0x1a')](_0x41c552)[_0x663a('0x23')](_0x57131d);};}exports[_0x663a('0x24')]=function(_0x57f93d,_0xcf9f0a){var _0x71efb={},_0x1ab286={},_0xf68801={'count':0x0,'rows':[]};var _0x210f03=_[_0x663a('0x25')](db[_0x663a('0x26')]['rawAttributes'],function(_0x3b4329){return{'name':_0x3b4329[_0x663a('0x27')],'type':_0x3b4329[_0x663a('0x28')][_0x663a('0x29')]};});_0x1ab286[_0x663a('0x2a')]=_['map'](_0x210f03,_0x663a('0x22'));_0x1ab286['query']=_[_0x663a('0x2b')](_0x57f93d[_0x663a('0x2c')]);_0x1ab286[_0x663a('0x2d')]=_[_0x663a('0x2e')](_0x1ab286[_0x663a('0x2a')],_0x1ab286['query']);_0x71efb[_0x663a('0x2f')]=_['intersection'](_0x1ab286[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x30')]));_0x71efb['attributes']=_0x71efb[_0x663a('0x2f')][_0x663a('0x31')]?_0x71efb[_0x663a('0x2f')]:_0x1ab286[_0x663a('0x2a')];if(!_0x57f93d[_0x663a('0x2c')][_0x663a('0x32')](_0x663a('0x33'))){_0x71efb[_0x663a('0x34')]=qs['limit'](_0x57f93d[_0x663a('0x2c')][_0x663a('0x34')]);_0x71efb['offset']=qs[_0x663a('0x35')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x35')]);}_0x71efb[_0x663a('0x36')]=qs[_0x663a('0x37')](_0x57f93d['query'][_0x663a('0x37')]);_0x71efb['where']=qs[_0x663a('0x2d')](_[_0x663a('0x38')](_0x57f93d['query'],_0x1ab286['filters']),_0x210f03);if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x39')]){_0x71efb['where']=_[_0x663a('0x3a')](_0x71efb[_0x663a('0x3b')],{'$or':_[_0x663a('0x25')](_0x210f03,function(_0x4d0b8d){if(_0x4d0b8d[_0x663a('0x28')]!==_0x663a('0x3c')){var _0x5e2826={};_0x5e2826[_0x4d0b8d[_0x663a('0x22')]]={'$like':'%'+_0x57f93d['query'][_0x663a('0x39')]+'%'};return _0x5e2826;}})});}_0x71efb=_[_0x663a('0x3a')]({},_0x71efb,_0x57f93d['options']);var _0x1aff26={'where':_0x71efb[_0x663a('0x3b')]};return db['WhatsappApplication'][_0x663a('0x19')](_0x1aff26)[_0x663a('0x1f')](function(_0x5de40d){_0xf68801['count']=_0x5de40d;if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x3d')]){_0x71efb[_0x663a('0x3e')]=[{'all':!![]}];}return db[_0x663a('0x26')][_0x663a('0x3f')](_0x71efb);})[_0x663a('0x1f')](function(_0x110afa){_0xf68801[_0x663a('0x40')]=_0x110afa;return _0xf68801;})['then'](respondWithFilteredResult(_0xcf9f0a,_0x71efb))[_0x663a('0x41')](handleError(_0xcf9f0a,null));};exports[_0x663a('0x42')]=function(_0x252963,_0x2e0df7){var _0x51fd91={'raw':!![],'where':{'id':_0x252963['params']['id']}},_0x285ed3={};_0x285ed3['model']=_['keys'](db['WhatsappApplication'][_0x663a('0x43')]);_0x285ed3[_0x663a('0x2c')]=_[_0x663a('0x2b')](_0x252963['query']);_0x285ed3[_0x663a('0x2d')]=_['intersection'](_0x285ed3[_0x663a('0x2a')],_0x285ed3[_0x663a('0x2c')]);_0x51fd91['attributes']=_[_0x663a('0x2e')](_0x285ed3[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x252963[_0x663a('0x2c')][_0x663a('0x30')]));_0x51fd91[_0x663a('0x2f')]=_0x51fd91[_0x663a('0x2f')][_0x663a('0x31')]?_0x51fd91['attributes']:_0x285ed3[_0x663a('0x2a')];if(_0x252963[_0x663a('0x2c')]['includeAll']){_0x51fd91['include']=[{'all':!![]}];}_0x51fd91=_[_0x663a('0x3a')]({},_0x51fd91,_0x252963[_0x663a('0x44')]);return db[_0x663a('0x26')][_0x663a('0x45')](_0x51fd91)['then'](handleEntityNotFound(_0x2e0df7,null))['then'](respondWithResult(_0x2e0df7,null))[_0x663a('0x41')](handleError(_0x2e0df7,null));};exports[_0x663a('0x46')]=function(_0x55b3ed,_0x5efe40){return db[_0x663a('0x26')][_0x663a('0x46')](_0x55b3ed[_0x663a('0x47')],{})[_0x663a('0x1f')](respondWithResult(_0x5efe40,0xc9))[_0x663a('0x41')](handleError(_0x5efe40,null));};exports[_0x663a('0x1e')]=function(_0x1c3bc4,_0x5ec404){if(_0x1c3bc4[_0x663a('0x47')]['id']){delete _0x1c3bc4[_0x663a('0x47')]['id'];}return db[_0x663a('0x26')][_0x663a('0x45')]({'where':{'id':_0x1c3bc4[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x5ec404,null))[_0x663a('0x1f')](saveUpdates(_0x1c3bc4[_0x663a('0x47')],null))[_0x663a('0x1f')](respondWithResult(_0x5ec404,null))[_0x663a('0x41')](handleError(_0x5ec404,null));};exports[_0x663a('0x20')]=function(_0x4a61f5,_0x32fbe2){return db[_0x663a('0x26')]['find']({'where':{'id':_0x4a61f5[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x32fbe2,null))[_0x663a('0x1f')](removeEntity(_0x32fbe2,null))['catch'](handleError(_0x32fbe2,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 673f77a..bf4dfa7 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 _0x032e=['api','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x5673fe,_0x2e7b75){var _0x5d951b=function(_0x1d0a76){while(--_0x1d0a76){_0x5673fe['push'](_0x5673fe['shift']());}};_0x5d951b(++_0x2e7b75);}(_0x032e,0x124));var _0xe032=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x032e[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var logger=require(_0xe032('0x1'))(_0xe032('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe032('0x3'));var fs=require('fs');var path=require(_0xe032('0x4'));var rimraf=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var attributes=require(_0xe032('0x7'));module[_0xe032('0x8')]=function(_0x2ba8a0,_0x33ad0b){return _0x2ba8a0[_0xe032('0x9')](_0xe032('0xa'),attributes,{'tableName':_0xe032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe032('0xc'),'collate':_0xe032('0xd')});}; \ No newline at end of file +var _0xb458=['path','rimraf','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x43a7c5,_0x2b90fc){var _0x531ee4=function(_0x6cef5d){while(--_0x6cef5d){_0x43a7c5['push'](_0x43a7c5['shift']());}};_0x531ee4(++_0x2b90fc);}(_0xb458,0x103));var _0x8b45=function(_0x65eae,_0x32dc5f){_0x65eae=_0x65eae-0x0;var _0x18e82b=_0xb458[_0x65eae];return _0x18e82b;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b45('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 711368f..ce53dbf 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2ae3f4,_0x1669df){var _0x26e602=function(_0x2bcaad){while(--_0x2bcaad){_0x2ae3f4['push'](_0x2ae3f4['shift']());}};_0x26e602(++_0x1669df);}(_0xe14d,0x1ee));var _0xde14=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe14d[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _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(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0xe5b3,0x133));var _0x3e5b=function(_0x15f347,_0x547ffe){_0x15f347=_0x15f347-0x0;var _0x3045a6=_0xe5b3[_0x15f347];return _0x3045a6;};'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 b53fe6d..8a31ef7 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 _0x6075=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','whatsapp','addTags','put','update','delete','destroy','removeTags','util','path','connect-timeout','express'];(function(_0x2c1d9b,_0x103faf){var _0x3caef6=function(_0x36479c){while(--_0x36479c){_0x2c1d9b['push'](_0x2c1d9b['shift']());}};_0x3caef6(++_0x103faf);}(_0x6075,0x191));var _0x5607=function(_0x20de14,_0x3eaff4){_0x20de14=_0x20de14-0x0;var _0x3cc019=_0x6075[_0x20de14];return _0x3cc019;};'use strict';var multer=require('multer');var util=require(_0x5607('0x0'));var path=require(_0x5607('0x1'));var timeout=require(_0x5607('0x2'));var express=require(_0x5607('0x3'));var router=express[_0x5607('0x4')]();var fs_extra=require(_0x5607('0x5'));var auth=require(_0x5607('0x6'));var interaction=require(_0x5607('0x7'));var config=require(_0x5607('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x5607('0x9')]('/',auth[_0x5607('0xa')](),controller[_0x5607('0xb')]);router['get']('/describe',auth[_0x5607('0xa')](),controller[_0x5607('0xc')]);router[_0x5607('0x9')](_0x5607('0xd'),auth[_0x5607('0xa')](),controller['show']);router[_0x5607('0x9')](_0x5607('0xe'),auth[_0x5607('0xa')](),controller['getMessages']);router[_0x5607('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x5607('0xf')]);router[_0x5607('0x10')]('/',auth[_0x5607('0xa')](),controller['create']);router[_0x5607('0x10')](_0x5607('0xe'),auth[_0x5607('0xa')](),controller[_0x5607('0x11')]);router[_0x5607('0x10')](_0x5607('0x12'),auth[_0x5607('0xa')](),interaction[_0x5607('0x13')](_0x5607('0x14'),'whatsappinteraction:addtags'),controller[_0x5607('0x15')]);router[_0x5607('0x16')](_0x5607('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x5607('0x14'),'whatsappinteraction:update'),controller[_0x5607('0x17')]);router[_0x5607('0x18')](_0x5607('0xd'),auth[_0x5607('0xa')](),interaction[_0x5607('0x13')](_0x5607('0x14'),'whatsappinteraction:destroy'),controller[_0x5607('0x19')]);router['delete'](_0x5607('0x12'),auth[_0x5607('0xa')](),controller[_0x5607('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x4317=['./whatsappInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd769bc,_0x5bdf82){var _0x21b8df=function(_0x1630f1){while(--_0x1630f1){_0xd769bc['push'](_0xd769bc['shift']());}};_0x21b8df(++_0x5bdf82);}(_0x4317,0x7c));var _0x7431=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4317[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xa')](_0x7431('0xe'),auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0xa')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0xa')](_0x7431('0x12'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);router[_0x7431('0x14')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0x15')]);router[_0x7431('0x14')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x16')]);router['post'](_0x7431('0x17'),auth[_0x7431('0xc')](),interaction[_0x7431('0x18')]('whatsapp',_0x7431('0x19')),controller[_0x7431('0x1a')]);router[_0x7431('0x1b')]('/:id',auth[_0x7431('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x7431('0x1c')]);router[_0x7431('0x1d')](_0x7431('0xe'),auth[_0x7431('0xc')](),interaction['tracked']('whatsapp',_0x7431('0x1e')),controller[_0x7431('0x1f')]);router[_0x7431('0x1d')](_0x7431('0x17'),auth[_0x7431('0xc')](),controller[_0x7431('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index f15b5f4..642ada9 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 _0x5ea2=['BOOLEAN','DATE','STRING','out','ENUM','INTEGER','sequelize'];(function(_0x554abc,_0x44ce67){var _0x3986fd=function(_0x57a721){while(--_0x57a721){_0x554abc['push'](_0x554abc['shift']());}};_0x3986fd(++_0x44ce67);}(_0x5ea2,0x99));var _0x25ea=function(_0x5adbc5,_0x257e80){_0x5adbc5=_0x5adbc5-0x0;var _0x39942e=_0x5ea2[_0x5adbc5];return _0x39942e;};'use strict';var Sequelize=require(_0x25ea('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x25ea('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x25ea('0x2')]},'disposition':{'type':Sequelize[_0x25ea('0x3')]},'secondDisposition':{'type':Sequelize[_0x25ea('0x3')]},'thirdDisposition':{'type':Sequelize[_0x25ea('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x25ea('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x25ea('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x25ea('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x25ea('0x5')]('in',_0x25ea('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x25ea('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x25ea('0x6')]}}; \ No newline at end of file +var _0xd4a2=['sequelize','BOOLEAN','STRING','DATE','ENUM','out','INTEGER'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd4a2,0x173));var _0x2d4a=function(_0x3dcd64,_0x12fdcc){_0x3dcd64=_0x3dcd64-0x0;var _0x22ae8f=_0xd4a2[_0x3dcd64];return _0x22ae8f;};'use strict';var Sequelize=require(_0x2d4a('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2d4a('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2d4a('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2d4a('0x2')]},'read1stAt':{'type':Sequelize[_0x2d4a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2d4a('0x4')]('in',_0x2d4a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2d4a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2d4a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2d4a('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 3ee60b0..bf40462 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 _0xe29b=['download','err','unlinkSync','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','getOptions','whatsapp','query','user','catch','show','params','model','keys','WhatsappInteraction','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','nolimit','sort','where','pick','filters','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','color','whatsappInteractionTags:save','removeTags','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','User','push','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','fullname','get','mkdirSync','Owner','N.A.','toString','closed','disposition','basename','createReadStream','pipe','createWriteStream','out','System','value','renderFile','views','downloadInteraction.ejs','.pdf','Whatsapp'];(function(_0xdb9c8,_0x1700c4){var _0x53430b=function(_0x34c25f){while(--_0x34c25f){_0xdb9c8['push'](_0xdb9c8['shift']());}};_0x53430b(++_0x1700c4);}(_0xe29b,0x81));var _0xbe29=function(_0x4b95f4,_0x25318e){_0x4b95f4=_0x4b95f4-0x0;var _0x5bb52d=_0xe29b[_0x4b95f4];return _0x5bb52d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xbe29('0x0'));var moment=require(_0xbe29('0x1'));var BPromise=require(_0xbe29('0x2'));var util=require(_0xbe29('0x3'));var path=require(_0xbe29('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbe29('0x5'));var Redis=require(_0xbe29('0x6'));var interaction=require(_0xbe29('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xbe29('0x8'));var logger=require(_0xbe29('0x9'))(_0xbe29('0xa'));var config=require(_0xbe29('0xb'));var db=require(_0xbe29('0xc'))['db'];config[_0xbe29('0xd')]=_[_0xbe29('0xe')](config[_0xbe29('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe29('0xf'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xbe29('0x10')](socket);function respondWithStatusCode(_0x2f846d,_0x39c673){_0x39c673=_0x39c673||0xcc;return function(_0x388ecb){if(_0x388ecb){return _0x2f846d[_0xbe29('0x11')](_0x39c673);}return _0x2f846d[_0xbe29('0x12')](_0x39c673)[_0xbe29('0x13')]();};}function respondWithResult(_0x5d4f3d,_0x1244cb){_0x1244cb=_0x1244cb||0xc8;return function(_0x1cccc3){if(_0x1cccc3){return _0x5d4f3d[_0xbe29('0x12')](_0x1244cb)['json'](_0x1cccc3);}};}function respondWithFilteredResult(_0xbca5a6,_0x4a5848){return function(_0x1946ca){if(_0x1946ca){var _0x49debd=typeof _0x4a5848[_0xbe29('0x14')]==='undefined'&&typeof _0x4a5848[_0xbe29('0x15')]===_0xbe29('0x16');var _0x25383e=_0x1946ca[_0xbe29('0x17')];var _0x54b2dc=_0x49debd?0x0:_0x4a5848['offset'];var _0x24a94c=_0x49debd?_0x1946ca['count']:_0x4a5848[_0xbe29('0x14')]+_0x4a5848[_0xbe29('0x15')];var _0x1f7c3e;if(_0x24a94c>=_0x25383e){_0x24a94c=_0x25383e;_0x1f7c3e=0xc8;}else{_0x1f7c3e=0xce;}_0xbca5a6['status'](_0x1f7c3e);return _0xbca5a6[_0xbe29('0x18')](_0xbe29('0x19'),_0x54b2dc+'-'+_0x24a94c+'/'+_0x25383e)[_0xbe29('0x1a')](_0x1946ca);}return null;};}function saveUpdates(_0x3c3876){return function(_0x455db6){if(_0x455db6){return _0x455db6[_0xbe29('0x1b')](_0x3c3876)[_0xbe29('0x1c')](function(_0x2b82da){return _0x2b82da;});}return null;};}function removeEntity(_0x118fe3){return function(_0x17487d){if(_0x17487d){return _0x17487d[_0xbe29('0x1d')]()['then'](function(){_0x118fe3[_0xbe29('0x12')](0xcc)[_0xbe29('0x13')]();});}};}function handleEntityNotFound(_0x59a96a){return function(_0x304ea6){if(!_0x304ea6){_0x59a96a[_0xbe29('0x11')](0x194);}return _0x304ea6;};}function handleError(_0x4835c0,_0x2ec86b){_0x2ec86b=_0x2ec86b||0x1f4;return function(_0x1ba652){logger[_0xbe29('0x1e')](_0x1ba652['stack']);if(_0x1ba652[_0xbe29('0x1f')]){delete _0x1ba652[_0xbe29('0x1f')];}_0x4835c0['status'](_0x2ec86b)[_0xbe29('0x20')](_0x1ba652);};}exports[_0xbe29('0x21')]=function(_0x52be45,_0x4aee7a){var _0x3cf024={};var _0x251b40=_[_0xbe29('0x22')](db['WhatsappInteraction'][_0xbe29('0x23')],function(_0x3fafb1){return{'name':_0x3fafb1[_0xbe29('0x24')],'type':_0x3fafb1[_0xbe29('0x25')]['key']};});_0x3cf024=qs[_0xbe29('0x26')](_0x251b40,_0x52be45);return interaction['findAll'](_0xbe29('0x27'),_0x52be45[_0xbe29('0x28')],_0x52be45[_0xbe29('0x29')],_0x3cf024,_0x251b40)[_0xbe29('0x1c')](respondWithFilteredResult(_0x4aee7a,_0x3cf024))[_0xbe29('0x2a')](handleError(_0x4aee7a,null));};exports[_0xbe29('0x2b')]=function(_0x41251f,_0x5db20a){var _0x2075d7={'raw':![],'where':{'id':_0x41251f[_0xbe29('0x2c')]['id']}},_0x5e9e8b={};_0x5e9e8b[_0xbe29('0x2d')]=_[_0xbe29('0x2e')](db[_0xbe29('0x2f')][_0xbe29('0x23')]);_0x5e9e8b['query']=_[_0xbe29('0x2e')](_0x41251f[_0xbe29('0x28')]);_0x5e9e8b['filters']=_['intersection'](_0x5e9e8b['model'],_0x5e9e8b[_0xbe29('0x28')]);_0x2075d7[_0xbe29('0x30')]=_[_0xbe29('0x31')](_0x5e9e8b['model'],qs['fields'](_0x41251f[_0xbe29('0x28')][_0xbe29('0x32')]));_0x2075d7[_0xbe29('0x30')]=_0x2075d7[_0xbe29('0x30')][_0xbe29('0x33')]?_0x2075d7[_0xbe29('0x30')]:_0x5e9e8b[_0xbe29('0x2d')];if(_0x41251f[_0xbe29('0x28')][_0xbe29('0x34')]){_0x2075d7[_0xbe29('0x35')]=[{'all':!![]}];}_0x2075d7=_[_0xbe29('0x36')]({},_0x2075d7,_0x41251f[_0xbe29('0x37')]);return db[_0xbe29('0x2f')][_0xbe29('0x38')](_0x2075d7)[_0xbe29('0x1c')](handleEntityNotFound(_0x5db20a,null))[_0xbe29('0x1c')](respondWithResult(_0x5db20a,null))[_0xbe29('0x2a')](handleError(_0x5db20a,null));};exports[_0xbe29('0x39')]=function(_0x16f1c8,_0x4992f4){return db[_0xbe29('0x2f')]['create'](_0x16f1c8[_0xbe29('0x3a')],{})[_0xbe29('0x1c')](respondWithResult(_0x4992f4,0xc9))['catch'](handleError(_0x4992f4,null));};exports['update']=function(_0x1d0eb1,_0x545119){if(_0x1d0eb1[_0xbe29('0x3a')]['id']){delete _0x1d0eb1[_0xbe29('0x3a')]['id'];}return db[_0xbe29('0x2f')][_0xbe29('0x38')]({'where':{'id':_0x1d0eb1[_0xbe29('0x2c')]['id']}})[_0xbe29('0x1c')](handleEntityNotFound(_0x545119,null))[_0xbe29('0x1c')](saveUpdates(_0x1d0eb1[_0xbe29('0x3a')],null))['then'](respondWithResult(_0x545119,null))[_0xbe29('0x2a')](handleError(_0x545119,null));};exports['destroy']=function(_0x43199c,_0x2dd975){return db[_0xbe29('0x2f')][_0xbe29('0x38')]({'where':{'id':_0x43199c[_0xbe29('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2dd975,null))[_0xbe29('0x1c')](removeEntity(_0x2dd975,null))[_0xbe29('0x2a')](handleError(_0x2dd975,null));};exports[_0xbe29('0x3b')]=function(_0x1c3818,_0x18debb){return db[_0xbe29('0x2f')]['describe']()[_0xbe29('0x1c')](respondWithResult(_0x18debb,null))['catch'](handleError(_0x18debb,null));};exports[_0xbe29('0x3c')]=function(_0x4b61c1,_0x32f2a8){return db[_0xbe29('0x3d')][_0xbe29('0x38')]({'where':{'id':_0x4b61c1[_0xbe29('0x2c')]['id']}})[_0xbe29('0x1c')](handleEntityNotFound(_0x32f2a8,null))['then'](function(_0x2d0a49){if(_0x2d0a49){return _0x2d0a49[_0xbe29('0x3c')](_0x4b61c1[_0xbe29('0x3a')][_0xbe29('0x3e')],_[_0xbe29('0x3f')](_0x4b61c1[_0xbe29('0x3a')],['ids','id'])||{});}})['then'](respondWithResult(_0x32f2a8,null))[_0xbe29('0x2a')](handleError(_0x32f2a8,null));};exports['getMessages']=function(_0x1de3ac,_0x5a0639){var _0x12f015={'raw':![],'where':{}};var _0x54e215={};var _0x151f09={'count':0x0,'rows':[]};return db[_0xbe29('0x2f')][_0xbe29('0x40')]({'where':{'id':_0x1de3ac[_0xbe29('0x2c')]['id']}})[_0xbe29('0x1c')](handleEntityNotFound(_0x5a0639,null))[_0xbe29('0x1c')](function(_0x2a6980){if(_0x2a6980){_0x54e215['model']=_[_0xbe29('0x2e')](db[_0xbe29('0x3d')][_0xbe29('0x23')]);_0x54e215[_0xbe29('0x28')]=_['keys'](_0x1de3ac[_0xbe29('0x28')]);_0x54e215['filters']=_[_0xbe29('0x31')](_0x54e215[_0xbe29('0x2d')],_0x54e215[_0xbe29('0x28')]);_0x12f015[_0xbe29('0x30')]=_[_0xbe29('0x31')](_0x54e215[_0xbe29('0x2d')],qs[_0xbe29('0x32')](_0x1de3ac['query'][_0xbe29('0x32')]));_0x12f015[_0xbe29('0x30')]=_0x12f015['attributes'][_0xbe29('0x33')]?_0x12f015[_0xbe29('0x30')]:_0x54e215[_0xbe29('0x2d')];if(!_0x1de3ac['query'][_0xbe29('0x41')](_0xbe29('0x42'))){_0x12f015['limit']=qs[_0xbe29('0x15')](_0x1de3ac[_0xbe29('0x28')]['limit']);_0x12f015[_0xbe29('0x14')]=qs[_0xbe29('0x14')](_0x1de3ac[_0xbe29('0x28')][_0xbe29('0x14')]);}_0x12f015['order']=qs[_0xbe29('0x43')](_0x1de3ac[_0xbe29('0x28')][_0xbe29('0x43')]);_0x12f015[_0xbe29('0x44')]=qs['filters'](_[_0xbe29('0x45')](_0x1de3ac[_0xbe29('0x28')],_0x54e215[_0xbe29('0x46')]));_0x12f015[_0xbe29('0x44')]['WhatsappInteractionId']=_0x2a6980['id'];if(_0x1de3ac['query'][_0xbe29('0x47')]){_0x12f015['where']=_['merge'](_0x12f015[_0xbe29('0x44')],{'$or':_[_0xbe29('0x22')](_0x12f015[_0xbe29('0x30')],function(_0x20b6c3){var _0x242b21={};_0x242b21[_0x20b6c3]={'$like':'%'+_0x1de3ac[_0xbe29('0x28')][_0xbe29('0x47')]+'%'};return _0x242b21;})});}if(_0x1de3ac['query']['$gte']){var _0x45a52a=_0x1de3ac['query']['$gte'][_0xbe29('0x48')](',');var _0x3a5a67={};_0x3a5a67[_0x45a52a[0x0]]={'$gte':moment(_0x45a52a[0x1])[_0xbe29('0x49')](_0xbe29('0x4a'))};_0x12f015[_0xbe29('0x44')]=_[_0xbe29('0x36')](_0x12f015[_0xbe29('0x44')],_0x3a5a67);}_0x12f015=_[_0xbe29('0x36')]({},_0x12f015,_0x1de3ac[_0xbe29('0x37')]);return db[_0xbe29('0x3d')][_0xbe29('0x17')]({'where':_0x12f015[_0xbe29('0x44')]})['then'](function(_0x306988){_0x151f09[_0xbe29('0x17')]=_0x306988;if(_0x1de3ac[_0xbe29('0x28')][_0xbe29('0x34')]){_0x12f015['include']=[{'all':!![]}];}return db[_0xbe29('0x3d')][_0xbe29('0x4b')](_0x12f015);})[_0xbe29('0x1c')](function(_0x5a5126){_0x151f09[_0xbe29('0x4c')]=_0x5a5126;return _0x151f09;});}})[_0xbe29('0x1c')](respondWithFilteredResult(_0x5a0639,_0x12f015))[_0xbe29('0x2a')](handleError(_0x5a0639,null));};exports[_0xbe29('0x4d')]=function(_0x48950d,_0xdef93b){return db[_0xbe29('0x2f')]['find']({'where':{'id':_0x48950d[_0xbe29('0x2c')]['id']}})['then'](handleEntityNotFound(_0xdef93b,null))[_0xbe29('0x1c')](function(_0x34aac7){if(_0x34aac7){return _0x34aac7[_0xbe29('0x4e')](_0x48950d['body'][_0xbe29('0x3e')],_['omit'](_0x48950d['body'],[_0xbe29('0x3e'),'id'])||{})[_0xbe29('0x4f')](function(){return db['Tag'][_0xbe29('0x4b')]({'attributes':['id',_0xbe29('0x1f'),_0xbe29('0x50')],'where':{'id':_0x48950d[_0xbe29('0x3a')][_0xbe29('0x3e')]}});})[_0xbe29('0x1c')](function(_0x26ede9){socket['emit'](_0xbe29('0x51'),{'id':Number(_0x48950d[_0xbe29('0x2c')]['id']),'tags':_0x26ede9||[]});return{'id':Number(_0x48950d[_0xbe29('0x2c')]['id']),'tags':_0x26ede9||[]};});}})[_0xbe29('0x1c')](respondWithResult(_0xdef93b,null))[_0xbe29('0x2a')](handleError(_0xdef93b,null));};exports[_0xbe29('0x52')]=function(_0x5f42a8,_0x1c1c4a){return db[_0xbe29('0x2f')][_0xbe29('0x38')]({'where':{'id':_0x5f42a8[_0xbe29('0x2c')]['id']}})[_0xbe29('0x1c')](handleEntityNotFound(_0x1c1c4a,null))['then'](function(_0x36d002){if(_0x36d002){return _0x36d002[_0xbe29('0x52')](_0x5f42a8[_0xbe29('0x28')][_0xbe29('0x3e')]);}})[_0xbe29('0x1c')](respondWithStatusCode(_0x1c1c4a,null))[_0xbe29('0x2a')](handleError(_0x1c1c4a,null));};exports['download']=function(_0x3d1da4,_0xb1fe22){var _0x3fc725=moment()['unix']()['toString']();var _0x595557=path['join'](config[_0xbe29('0x53')],'server',_0xbe29('0x54'),_0xbe29('0x55'));var _0x1179be=path[_0xbe29('0x56')](config[_0xbe29('0x53')],_0xbe29('0x57'),'files',_0xbe29('0x58'));var _0x1cb98b=path['join'](_0x595557,_0x3fc725);var _0x422001=util[_0xbe29('0x49')](_0xbe29('0x59'),_0x3d1da4[_0xbe29('0x2c')]['id'],_0x3fc725);var _0x11bac3=path[_0xbe29('0x56')](_0x595557,_0x422001);var _0x3b6b0a=[];_0x3b6b0a['push']({'model':db[_0xbe29('0x5a')],'as':_0xbe29('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x3b6b0a[_0xbe29('0x5b')]({'model':db[_0xbe29('0x5c')],'as':_0xbe29('0x5d'),'attributes':['id',_0xbe29('0x5e'),_0xbe29('0x5f')],'raw':!![]});if(_0x3d1da4[_0xbe29('0x28')][_0xbe29('0x58')]){_0x3b6b0a[_0xbe29('0x5b')]({'model':db[_0xbe29('0x60')],'as':_0xbe29('0x60'),'raw':!![]});}var _0x4a1718=[{'model':db[_0xbe29('0x3d')],'as':_0xbe29('0x61'),'attributes':['id','body',_0xbe29('0x62'),_0xbe29('0x63'),_0xbe29('0x64'),_0xbe29('0x65')],'include':_0x3b6b0a}];_0x4a1718[_0xbe29('0x5b')]({'model':db['WhatsappAccount'],'as':_0xbe29('0x66'),'attributes':['id',_0xbe29('0x1f')]});_0x4a1718[_0xbe29('0x5b')]({'model':db['User'],'as':'Owner','attributes':['id',_0xbe29('0x67')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x3d1da4[_0xbe29('0x2c')]['id']},'include':_0x4a1718})['then'](handleEntityNotFound(_0xb1fe22,null))[_0xbe29('0x1c')](function(_0x594b99){if(_0x594b99){var _0x82d3fd=_0x594b99[_0xbe29('0x68')]({'plain':!![]});fs[_0xbe29('0x69')](_0x1cb98b);var _0x1a6b63={'channel':'Whatsapp','account':_0x82d3fd['Account'][_0xbe29('0x1f')],'agent':_0x82d3fd['Owner']?_0x82d3fd[_0xbe29('0x6a')][_0xbe29('0x67')]:_0xbe29('0x6b'),'createdAt':moment(_0x82d3fd[_0xbe29('0x62')])[_0xbe29('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbe29('0x6c')](),'closedAt':_0x82d3fd[_0xbe29('0x6d')]?moment(_0x82d3fd['closedAt'])[_0xbe29('0x49')](_0xbe29('0x4a'))[_0xbe29('0x6c')]():'','disposition':_0x82d3fd[_0xbe29('0x6e')],'messages':_(_0x82d3fd['Messages'])['filter']({'secret':![]})['map'](function(_0xb71044){if(_0xb71044[_0xbe29('0x60')]){var _0x3e34a9=path[_0xbe29('0x56')](_0x1179be,_0xb71044[_0xbe29('0x60')][_0xbe29('0x6f')]);if(fs['existsSync'](_0x3e34a9)){fs[_0xbe29('0x70')](_0x3e34a9)[_0xbe29('0x71')](fs[_0xbe29('0x72')](path[_0xbe29('0x56')](_0x1cb98b,_0xb71044[_0xbe29('0x60')][_0xbe29('0x6f')])));}}return{'date':moment(_0xb71044['createdAt'])[_0xbe29('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbe29('0x6c')](),'sender':_0xb71044[_0xbe29('0x63')]===_0xbe29('0x73')?_0xb71044['User']?_0xb71044[_0xbe29('0x5a')][_0xbe29('0x67')]:_0xbe29('0x74'):_0xb71044[_0xbe29('0x5d')]['firstName']+(_0xb71044['Contact'][_0xbe29('0x5f')]?'\x20'+_0xb71044['Contact'][_0xbe29('0x5f')]:''),'body':_0xb71044['Attachment']?_0xb71044[_0xbe29('0x60')][_0xbe29('0x6f')]:_0xb71044['body'],'direction':_0xb71044['direction']==='out'?'A':'C','secret':_0xb71044[_0xbe29('0x64')],'read':_0xb71044[_0xbe29('0x65')],'attachment':_0xb71044[_0xbe29('0x60')]};})[_0xbe29('0x75')]()};return ejs[_0xbe29('0x76')](path[_0xbe29('0x56')](config[_0xbe29('0x53')],'server',_0xbe29('0x77'),_0xbe29('0x78')),{'interaction':_0x1a6b63})[_0xbe29('0x1c')](function(_0x294486){var _0x1e53fd=path['join'](_0x1cb98b,'transcript-'+_0x82d3fd['id']+'-'+_0x3fc725+_0xbe29('0x79'));var _0x456844={'path':_0x1e53fd,'channel':_0xbe29('0x7a'),'interactionId':_0x82d3fd['id']};return pdf['createPdfFromHTML'](_0x294486,_0x456844);})[_0xbe29('0x1c')](function(){return new BPromise(function(_0xe3e06b,_0x1ac320){zipdir(_0x1cb98b,{'saveTo':_0x11bac3},function(_0x273f84,_0x10eac0){if(_0x273f84)return _0x1ac320(_0x273f84);return _0xe3e06b(_0x10eac0);});})[_0xbe29('0x1c')](function(){return new BPromise(function(_0x540f7b,_0x16c6b3){rimraf(_0x1cb98b,function(_0x28a584){if(_0x28a584)_0x16c6b3(_0x28a584);return _0x540f7b();});});})[_0xbe29('0x1c')](function(){return _0xb1fe22[_0xbe29('0x7b')](_0x11bac3,_0x422001,function(_0x4014f6){if(_0x4014f6){console['log'](_0xbe29('0x7c'),_0x4014f6);}else{fs[_0xbe29('0x7d')](_0x11bac3);}});});});}else{return _0xb1fe22['sendStatus'](0xc8);}})[_0xbe29('0x2a')](handleError(_0xb1fe22,null));}; \ No newline at end of file +var _0x15ad=['register','sendStatus','status','json','offset','undefined','set','update','then','end','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','whatsapp','query','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','options','create','body','catch','find','destroy','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','split','count','include','findAll','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','join','root','server','tmp','files','format','push','User','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','get','mkdirSync','Whatsapp','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','out','System','Contact','value','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15ad,0x6e));var _0xd15a=function(_0x3f10b0,_0x35bca0){_0x3f10b0=_0x3f10b0-0x0;var _0x1029c4=_0x15ad[_0x3f10b0];return _0x1029c4;};'use strict';var rimraf=require(_0xd15a('0x0'));var zipdir=require(_0xd15a('0x1'));var moment=require('moment');var BPromise=require(_0xd15a('0x2'));var util=require(_0xd15a('0x3'));var path=require(_0xd15a('0x4'));var ejs=require(_0xd15a('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd15a('0x6'));var interaction=require(_0xd15a('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xd15a('0x8'));var logger=require(_0xd15a('0x9'))('api');var config=require('../../config/environment');var db=require(_0xd15a('0xa'))['db'];config[_0xd15a('0xb')]=_['defaults'](config[_0xd15a('0xb')],{'host':_0xd15a('0xc'),'port':0x18eb});var socket=require(_0xd15a('0xd'))(new Redis(config[_0xd15a('0xb')]));require('./whatsappInteraction.socket')[_0xd15a('0xe')](socket);function respondWithStatusCode(_0x5ba25b,_0x116a3f){_0x116a3f=_0x116a3f||0xcc;return function(_0x2f35d6){if(_0x2f35d6){return _0x5ba25b[_0xd15a('0xf')](_0x116a3f);}return _0x5ba25b['status'](_0x116a3f)['end']();};}function respondWithResult(_0x2e5851,_0x2d2940){_0x2d2940=_0x2d2940||0xc8;return function(_0x50bf8f){if(_0x50bf8f){return _0x2e5851[_0xd15a('0x10')](_0x2d2940)[_0xd15a('0x11')](_0x50bf8f);}};}function respondWithFilteredResult(_0x4674d6,_0x9898b8){return function(_0xbdbdff){if(_0xbdbdff){var _0x31c38d=typeof _0x9898b8[_0xd15a('0x12')]==='undefined'&&typeof _0x9898b8['limit']===_0xd15a('0x13');var _0x135737=_0xbdbdff['count'];var _0x208f46=_0x31c38d?0x0:_0x9898b8['offset'];var _0xc20782=_0x31c38d?_0xbdbdff['count']:_0x9898b8['offset']+_0x9898b8['limit'];var _0x423e9e;if(_0xc20782>=_0x135737){_0xc20782=_0x135737;_0x423e9e=0xc8;}else{_0x423e9e=0xce;}_0x4674d6[_0xd15a('0x10')](_0x423e9e);return _0x4674d6[_0xd15a('0x14')]('Content-Range',_0x208f46+'-'+_0xc20782+'/'+_0x135737)[_0xd15a('0x11')](_0xbdbdff);}return null;};}function saveUpdates(_0x25f5c0){return function(_0xc5bba){if(_0xc5bba){return _0xc5bba[_0xd15a('0x15')](_0x25f5c0)[_0xd15a('0x16')](function(_0x533e09){return _0x533e09;});}return null;};}function removeEntity(_0x3fd425){return function(_0x24edbd){if(_0x24edbd){return _0x24edbd['destroy']()[_0xd15a('0x16')](function(){_0x3fd425[_0xd15a('0x10')](0xcc)[_0xd15a('0x17')]();});}};}function handleEntityNotFound(_0x34ff4d){return function(_0xa1ae57){if(!_0xa1ae57){_0x34ff4d[_0xd15a('0xf')](0x194);}return _0xa1ae57;};}function handleError(_0x4b79c7,_0x14cf46){_0x14cf46=_0x14cf46||0x1f4;return function(_0x5a32b1){logger[_0xd15a('0x18')](_0x5a32b1[_0xd15a('0x19')]);if(_0x5a32b1[_0xd15a('0x1a')]){delete _0x5a32b1['name'];}_0x4b79c7[_0xd15a('0x10')](_0x14cf46)[_0xd15a('0x1b')](_0x5a32b1);};}exports[_0xd15a('0x1c')]=function(_0x39d52d,_0x42820c){var _0xb4af6b={};var _0x1334d1=_[_0xd15a('0x1d')](db[_0xd15a('0x1e')][_0xd15a('0x1f')],function(_0x37b2f8){return{'name':_0x37b2f8[_0xd15a('0x20')],'type':_0x37b2f8[_0xd15a('0x21')]['key']};});_0xb4af6b=qs[_0xd15a('0x22')](_0x1334d1,_0x39d52d);return interaction['findAll'](_0xd15a('0x23'),_0x39d52d[_0xd15a('0x24')],_0x39d52d['user'],_0xb4af6b,_0x1334d1)[_0xd15a('0x16')](respondWithFilteredResult(_0x42820c,_0xb4af6b))['catch'](handleError(_0x42820c,null));};exports[_0xd15a('0x25')]=function(_0x479344,_0x1284cd){var _0x3dd580={'raw':![],'where':{'id':_0x479344[_0xd15a('0x26')]['id']}},_0x4e5a7a={};_0x4e5a7a[_0xd15a('0x27')]=_['keys'](db['WhatsappInteraction'][_0xd15a('0x1f')]);_0x4e5a7a['query']=_[_0xd15a('0x28')](_0x479344['query']);_0x4e5a7a[_0xd15a('0x29')]=_[_0xd15a('0x2a')](_0x4e5a7a['model'],_0x4e5a7a['query']);_0x3dd580['attributes']=_[_0xd15a('0x2a')](_0x4e5a7a[_0xd15a('0x27')],qs[_0xd15a('0x2b')](_0x479344[_0xd15a('0x24')]['fields']));_0x3dd580[_0xd15a('0x2c')]=_0x3dd580[_0xd15a('0x2c')][_0xd15a('0x2d')]?_0x3dd580[_0xd15a('0x2c')]:_0x4e5a7a[_0xd15a('0x27')];if(_0x479344[_0xd15a('0x24')][_0xd15a('0x2e')]){_0x3dd580['include']=[{'all':!![]}];}_0x3dd580=_['merge']({},_0x3dd580,_0x479344[_0xd15a('0x2f')]);return db[_0xd15a('0x1e')]['find'](_0x3dd580)[_0xd15a('0x16')](handleEntityNotFound(_0x1284cd,null))[_0xd15a('0x16')](respondWithResult(_0x1284cd,null))['catch'](handleError(_0x1284cd,null));};exports[_0xd15a('0x30')]=function(_0xf52071,_0x4f814b){return db[_0xd15a('0x1e')]['create'](_0xf52071[_0xd15a('0x31')],{})['then'](respondWithResult(_0x4f814b,0xc9))[_0xd15a('0x32')](handleError(_0x4f814b,null));};exports[_0xd15a('0x15')]=function(_0x5a1c9e,_0xe71469){if(_0x5a1c9e['body']['id']){delete _0x5a1c9e[_0xd15a('0x31')]['id'];}return db[_0xd15a('0x1e')][_0xd15a('0x33')]({'where':{'id':_0x5a1c9e['params']['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0xe71469,null))[_0xd15a('0x16')](saveUpdates(_0x5a1c9e[_0xd15a('0x31')],null))[_0xd15a('0x16')](respondWithResult(_0xe71469,null))[_0xd15a('0x32')](handleError(_0xe71469,null));};exports[_0xd15a('0x34')]=function(_0x25b7d0,_0x1a548c){return db['WhatsappInteraction']['find']({'where':{'id':_0x25b7d0['params']['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0x1a548c,null))['then'](removeEntity(_0x1a548c,null))[_0xd15a('0x32')](handleError(_0x1a548c,null));};exports[_0xd15a('0x35')]=function(_0x4db015,_0x4c5cdf){return db['WhatsappInteraction']['describe']()[_0xd15a('0x16')](respondWithResult(_0x4c5cdf,null))[_0xd15a('0x32')](handleError(_0x4c5cdf,null));};exports[_0xd15a('0x36')]=function(_0x356da6,_0x56516c){return db[_0xd15a('0x37')][_0xd15a('0x33')]({'where':{'id':_0x356da6[_0xd15a('0x26')]['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0x56516c,null))[_0xd15a('0x16')](function(_0x20aa48){if(_0x20aa48){return _0x20aa48[_0xd15a('0x36')](_0x356da6['body']['ids'],_[_0xd15a('0x38')](_0x356da6[_0xd15a('0x31')],[_0xd15a('0x39'),'id'])||{});}})[_0xd15a('0x16')](respondWithResult(_0x56516c,null))[_0xd15a('0x32')](handleError(_0x56516c,null));};exports[_0xd15a('0x3a')]=function(_0x26853a,_0x51490b){var _0x327492={'raw':![],'where':{}};var _0x1e2207={};var _0x35bd7b={'count':0x0,'rows':[]};return db[_0xd15a('0x1e')][_0xd15a('0x3b')]({'where':{'id':_0x26853a[_0xd15a('0x26')]['id']}})['then'](handleEntityNotFound(_0x51490b,null))[_0xd15a('0x16')](function(_0x59ae58){if(_0x59ae58){_0x1e2207[_0xd15a('0x27')]=_[_0xd15a('0x28')](db[_0xd15a('0x37')][_0xd15a('0x1f')]);_0x1e2207[_0xd15a('0x24')]=_[_0xd15a('0x28')](_0x26853a[_0xd15a('0x24')]);_0x1e2207[_0xd15a('0x29')]=_[_0xd15a('0x2a')](_0x1e2207[_0xd15a('0x27')],_0x1e2207[_0xd15a('0x24')]);_0x327492['attributes']=_[_0xd15a('0x2a')](_0x1e2207[_0xd15a('0x27')],qs[_0xd15a('0x2b')](_0x26853a[_0xd15a('0x24')][_0xd15a('0x2b')]));_0x327492['attributes']=_0x327492[_0xd15a('0x2c')]['length']?_0x327492[_0xd15a('0x2c')]:_0x1e2207['model'];if(!_0x26853a[_0xd15a('0x24')][_0xd15a('0x3c')](_0xd15a('0x3d'))){_0x327492[_0xd15a('0x3e')]=qs['limit'](_0x26853a['query']['limit']);_0x327492[_0xd15a('0x12')]=qs[_0xd15a('0x12')](_0x26853a['query'][_0xd15a('0x12')]);}_0x327492[_0xd15a('0x3f')]=qs[_0xd15a('0x40')](_0x26853a[_0xd15a('0x24')][_0xd15a('0x40')]);_0x327492[_0xd15a('0x41')]=qs[_0xd15a('0x29')](_['pick'](_0x26853a[_0xd15a('0x24')],_0x1e2207[_0xd15a('0x29')]));_0x327492['where']['WhatsappInteractionId']=_0x59ae58['id'];if(_0x26853a[_0xd15a('0x24')][_0xd15a('0x42')]){_0x327492[_0xd15a('0x41')]=_[_0xd15a('0x43')](_0x327492[_0xd15a('0x41')],{'$or':_[_0xd15a('0x1d')](_0x327492['attributes'],function(_0x324d69){var _0x954312={};_0x954312[_0x324d69]={'$like':'%'+_0x26853a['query'][_0xd15a('0x42')]+'%'};return _0x954312;})});}if(_0x26853a[_0xd15a('0x24')]['$gte']){var _0x22b4db=_0x26853a['query']['$gte'][_0xd15a('0x44')](',');var _0x15f490={};_0x15f490[_0x22b4db[0x0]]={'$gte':moment(_0x22b4db[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x327492[_0xd15a('0x41')]=_[_0xd15a('0x43')](_0x327492[_0xd15a('0x41')],_0x15f490);}_0x327492=_[_0xd15a('0x43')]({},_0x327492,_0x26853a['options']);return db[_0xd15a('0x37')][_0xd15a('0x45')]({'where':_0x327492[_0xd15a('0x41')]})[_0xd15a('0x16')](function(_0x30c94f){_0x35bd7b[_0xd15a('0x45')]=_0x30c94f;if(_0x26853a[_0xd15a('0x24')][_0xd15a('0x2e')]){_0x327492[_0xd15a('0x46')]=[{'all':!![]}];}return db[_0xd15a('0x37')][_0xd15a('0x47')](_0x327492);})[_0xd15a('0x16')](function(_0x2f3d74){_0x35bd7b[_0xd15a('0x48')]=_0x2f3d74;return _0x35bd7b;});}})[_0xd15a('0x16')](respondWithFilteredResult(_0x51490b,_0x327492))[_0xd15a('0x32')](handleError(_0x51490b,null));};exports['addTags']=function(_0xcc5890,_0xa7fd78){return db[_0xd15a('0x1e')][_0xd15a('0x33')]({'where':{'id':_0xcc5890[_0xd15a('0x26')]['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0xa7fd78,null))[_0xd15a('0x16')](function(_0x34e9c0){if(_0x34e9c0){return _0x34e9c0[_0xd15a('0x49')](_0xcc5890['body'][_0xd15a('0x39')],_['omit'](_0xcc5890[_0xd15a('0x31')],[_0xd15a('0x39'),'id'])||{})[_0xd15a('0x4a')](function(){return db[_0xd15a('0x4b')][_0xd15a('0x47')]({'attributes':['id',_0xd15a('0x1a'),_0xd15a('0x4c')],'where':{'id':_0xcc5890[_0xd15a('0x31')][_0xd15a('0x39')]}});})[_0xd15a('0x16')](function(_0x5335a6){socket[_0xd15a('0x4d')]('whatsappInteractionTags:save',{'id':Number(_0xcc5890['params']['id']),'tags':_0x5335a6||[]});return{'id':Number(_0xcc5890[_0xd15a('0x26')]['id']),'tags':_0x5335a6||[]};});}})[_0xd15a('0x16')](respondWithResult(_0xa7fd78,null))[_0xd15a('0x32')](handleError(_0xa7fd78,null));};exports['removeTags']=function(_0x128bc3,_0x4728c0){return db['WhatsappInteraction']['find']({'where':{'id':_0x128bc3[_0xd15a('0x26')]['id']}})['then'](handleEntityNotFound(_0x4728c0,null))[_0xd15a('0x16')](function(_0x16a679){if(_0x16a679){return _0x16a679[_0xd15a('0x4e')](_0x128bc3[_0xd15a('0x24')]['ids']);}})['then'](respondWithStatusCode(_0x4728c0,null))[_0xd15a('0x32')](handleError(_0x4728c0,null));};exports[_0xd15a('0x4f')]=function(_0x2504b5,_0x13a8d2){var _0x30cba9=moment()[_0xd15a('0x50')]()['toString']();var _0x199c97=path[_0xd15a('0x51')](config[_0xd15a('0x52')],_0xd15a('0x53'),'files',_0xd15a('0x54'));var _0x314f5c=path[_0xd15a('0x51')](config[_0xd15a('0x52')],_0xd15a('0x53'),_0xd15a('0x55'),'attachments');var _0x180d25=path[_0xd15a('0x51')](_0x199c97,_0x30cba9);var _0x2a661c=util[_0xd15a('0x56')]('transcript-%d-%s.zip',_0x2504b5[_0xd15a('0x26')]['id'],_0x30cba9);var _0x280d9c=path[_0xd15a('0x51')](_0x199c97,_0x2a661c);var _0x2c94f7=[];_0x2c94f7[_0xd15a('0x57')]({'model':db[_0xd15a('0x58')],'as':_0xd15a('0x58'),'attributes':['id',_0xd15a('0x59')],'raw':!![]});_0x2c94f7[_0xd15a('0x57')]({'model':db[_0xd15a('0x5a')],'as':'Contact','attributes':['id',_0xd15a('0x5b'),_0xd15a('0x5c')],'raw':!![]});if(_0x2504b5['query'][_0xd15a('0x5d')]){_0x2c94f7[_0xd15a('0x57')]({'model':db['Attachment'],'as':_0xd15a('0x5e'),'raw':!![]});}var _0x26571d=[{'model':db['WhatsappMessage'],'as':_0xd15a('0x5f'),'attributes':['id',_0xd15a('0x31'),_0xd15a('0x60'),_0xd15a('0x61'),_0xd15a('0x62'),_0xd15a('0x63')],'include':_0x2c94f7}];_0x26571d['push']({'model':db[_0xd15a('0x64')],'as':'Account','attributes':['id',_0xd15a('0x1a')]});_0x26571d[_0xd15a('0x57')]({'model':db[_0xd15a('0x58')],'as':'Owner','attributes':['id','fullname']});return db[_0xd15a('0x1e')][_0xd15a('0x33')]({'where':{'id':_0x2504b5[_0xd15a('0x26')]['id']},'include':_0x26571d})['then'](handleEntityNotFound(_0x13a8d2,null))['then'](function(_0x3f8f0b){if(_0x3f8f0b){var _0x23b965=_0x3f8f0b[_0xd15a('0x65')]({'plain':!![]});fs[_0xd15a('0x66')](_0x180d25);var _0x5dffbf={'channel':_0xd15a('0x67'),'account':_0x23b965[_0xd15a('0x68')]['name'],'agent':_0x23b965[_0xd15a('0x69')]?_0x23b965[_0xd15a('0x69')]['fullname']:'N.A.','createdAt':moment(_0x23b965['createdAt'])['format'](_0xd15a('0x6a'))[_0xd15a('0x6b')](),'closedAt':_0x23b965[_0xd15a('0x6c')]?moment(_0x23b965[_0xd15a('0x6d')])[_0xd15a('0x56')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd15a('0x6b')]():'','disposition':_0x23b965[_0xd15a('0x6e')],'messages':_(_0x23b965[_0xd15a('0x5f')])[_0xd15a('0x42')]({'secret':![]})[_0xd15a('0x1d')](function(_0xfec887){if(_0xfec887[_0xd15a('0x5e')]){var _0x3de3f5=path[_0xd15a('0x51')](_0x314f5c,_0xfec887[_0xd15a('0x5e')][_0xd15a('0x6f')]);if(fs['existsSync'](_0x3de3f5)){fs[_0xd15a('0x70')](_0x3de3f5)[_0xd15a('0x71')](fs[_0xd15a('0x72')](path[_0xd15a('0x51')](_0x180d25,_0xfec887[_0xd15a('0x5e')]['basename'])));}}return{'date':moment(_0xfec887[_0xd15a('0x60')])[_0xd15a('0x56')](_0xd15a('0x6a'))[_0xd15a('0x6b')](),'sender':_0xfec887['direction']===_0xd15a('0x73')?_0xfec887[_0xd15a('0x58')]?_0xfec887[_0xd15a('0x58')][_0xd15a('0x59')]:_0xd15a('0x74'):_0xfec887[_0xd15a('0x75')][_0xd15a('0x5b')]+(_0xfec887['Contact']['lastName']?'\x20'+_0xfec887['Contact']['lastName']:''),'body':_0xfec887[_0xd15a('0x5e')]?_0xfec887[_0xd15a('0x5e')][_0xd15a('0x6f')]:_0xfec887[_0xd15a('0x31')],'direction':_0xfec887[_0xd15a('0x61')]===_0xd15a('0x73')?'A':'C','secret':_0xfec887['secret'],'read':_0xfec887[_0xd15a('0x63')],'attachment':_0xfec887['Attachment']};})[_0xd15a('0x76')]()};return ejs['renderFile'](path[_0xd15a('0x51')](config[_0xd15a('0x52')],_0xd15a('0x53'),'views',_0xd15a('0x77')),{'interaction':_0x5dffbf})[_0xd15a('0x16')](function(_0x49a443){var _0x2151a6=path[_0xd15a('0x51')](_0x180d25,_0xd15a('0x78')+_0x23b965['id']+'-'+_0x30cba9+_0xd15a('0x79'));var _0x3d8962={'path':_0x2151a6,'channel':_0xd15a('0x67'),'interactionId':_0x23b965['id']};return pdf['createPdfFromHTML'](_0x49a443,_0x3d8962);})['then'](function(){return new BPromise(function(_0x2ea226,_0x41862d){zipdir(_0x180d25,{'saveTo':_0x280d9c},function(_0x27d76b,_0x4ba895){if(_0x27d76b)return _0x41862d(_0x27d76b);return _0x2ea226(_0x4ba895);});})[_0xd15a('0x16')](function(){return new BPromise(function(_0x17da32,_0x43adb7){rimraf(_0x180d25,function(_0x3fc931){if(_0x3fc931)_0x43adb7(_0x3fc931);return _0x17da32();});});})[_0xd15a('0x16')](function(){return _0x13a8d2[_0xd15a('0x4f')](_0x280d9c,_0x2a661c,function(_0x2da8c3){if(_0x2da8c3){console[_0xd15a('0x7a')]('err',_0x2da8c3);}else{fs[_0xd15a('0x7b')](_0x280d9c);}});});});}else{return _0x13a8d2[_0xd15a('0xf')](0xc8);}})[_0xd15a('0x32')](handleError(_0x13a8d2,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index bf13611..31cdd78 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 _0xe58a=['../../mysqldb','WhatsappInteraction','WhatsappMessage','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','events'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xe58a,0x9f));var _0xae58=function(_0x5ef9a8,_0x4f8327){_0x5ef9a8=_0x5ef9a8-0x0;var _0x4adb10=_0xe58a[_0x5ef9a8];return _0x4adb10;};'use strict';var EventEmitter=require(_0xae58('0x0'));var WhatsappInteraction=require(_0xae58('0x1'))['db'][_0xae58('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xae58('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xae58('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4df1a3){return function(_0xa7f80a,_0x5f3a87,_0x198e0c){_0xa7f80a[_0xae58('0x5')]({'attributes':['id'],'raw':!![]})[_0xae58('0x6')](function(_0x2003b6){_0xa7f80a[_0xae58('0x7')](_0xae58('0x8'),_0x2003b6[_0xae58('0x9')](function(_0x201a06){return{'id':_0x201a06['id']};}));return WhatsappMessage[_0xae58('0xa')]({'where':{'WhatsappInteractionId':_0xa7f80a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xae58('0x6')](function(_0x5de1fa){_0xa7f80a[_0xae58('0x7')](_0xae58('0xb'),_0x5de1fa[_0xae58('0xc')]);WhatsappInteractionEvents[_0xae58('0xd')](_0x4df1a3+':'+_0xa7f80a['id'],_0xa7f80a);WhatsappInteractionEvents[_0xae58('0xd')](_0x4df1a3,_0xa7f80a);_0x198e0c(null);})['catch'](_0x198e0c(null));};}for(var e in events){if(events[_0xae58('0xe')](e)){var event=events[e];WhatsappInteraction[_0xae58('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x9090=['setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','getUsers','then'];(function(_0x235440,_0x506074){var _0x44c709=function(_0x4b04d8){while(--_0x4b04d8){_0x235440['push'](_0x235440['shift']());}};_0x44c709(++_0x506074);}(_0x9090,0x17f));var _0x0909=function(_0x4d0680,_0x4ce218){_0x4d0680=_0x4d0680-0x0;var _0x125442=_0x9090[_0x4d0680];return _0x125442;};'use strict';var EventEmitter=require(_0x0909('0x0'));var WhatsappInteraction=require(_0x0909('0x1'))['db'][_0x0909('0x2')];var WhatsappMessage=require(_0x0909('0x1'))['db'][_0x0909('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0909('0x4'),'afterDestroy':_0x0909('0x5')};function emitEvent(_0x29bc19){return function(_0x572e6e,_0x1a5cff,_0x42af40){_0x572e6e[_0x0909('0x6')]({'attributes':['id'],'raw':!![]})[_0x0909('0x7')](function(_0x26dfbe){_0x572e6e[_0x0909('0x8')](_0x0909('0x9'),_0x26dfbe['map'](function(_0x203b1b){return{'id':_0x203b1b['id']};}));return WhatsappMessage[_0x0909('0xa')]({'where':{'WhatsappInteractionId':_0x572e6e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3b86e7){_0x572e6e['setDataValue'](_0x0909('0xb'),_0x3b86e7[_0x0909('0xc')]);WhatsappInteractionEvents[_0x0909('0xd')](_0x29bc19+':'+_0x572e6e['id'],_0x572e6e);WhatsappInteractionEvents[_0x0909('0xd')](_0x29bc19,_0x572e6e);_0x42af40(null);})['catch'](_0x42af40(null));};}for(var e in events){if(events[_0x0909('0xe')](e)){var event=events[e];WhatsappInteraction[_0x0909('0xf')](e,emitEvent(event));}}module[_0x0909('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 2a8a767..75571ec 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 _0x2b70=['request-promise','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment'];(function(_0x836fec,_0x291263){var _0x4c406c=function(_0x4c4812){while(--_0x4c4812){_0x836fec['push'](_0x836fec['shift']());}};_0x4c406c(++_0x291263);}(_0x2b70,0xc0));var _0x02b7=function(_0x125510,_0x252ba5){_0x125510=_0x125510-0x0;var _0x1ed51b=_0x2b70[_0x125510];return _0x1ed51b;};'use strict';var _=require('lodash');var util=require(_0x02b7('0x0'));var logger=require('../../config/logger')(_0x02b7('0x1'));var moment=require(_0x02b7('0x2'));var BPromise=require('bluebird');var rp=require(_0x02b7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02b7('0x4'));var config=require('../../config/environment');var attributes=require(_0x02b7('0x5'));module[_0x02b7('0x6')]=function(_0x17ada1,_0x52d5f2){return _0x17ada1[_0x02b7('0x7')](_0x02b7('0x8'),attributes,{'tableName':_0x02b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4de7d1,_0x478e3d,_0xe78b){if(_0x4de7d1[_0x02b7('0xa')](_0x02b7('0xb'))){_0x4de7d1[_0x02b7('0xc')]=moment()[_0x02b7('0xd')](_0x02b7('0xe'));}_0xe78b(null,_0x4de7d1);}}});}; \ No newline at end of file +var _0xdfae=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xdfae,0x191));var _0xedfa=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0xdfae[_0x28b0a1];return _0x21470c;};'use strict';var _=require(_0xedfa('0x0'));var util=require(_0xedfa('0x1'));var logger=require(_0xedfa('0x2'))(_0xedfa('0x3'));var moment=require(_0xedfa('0x4'));var BPromise=require(_0xedfa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedfa('0x6'));var rimraf=require(_0xedfa('0x7'));var config=require('../../config/environment');var attributes=require(_0xedfa('0x8'));module[_0xedfa('0x9')]=function(_0x27090c,_0x52750d){return _0x27090c[_0xedfa('0xa')](_0xedfa('0xb'),attributes,{'tableName':_0xedfa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb4700,_0x49f7c1,_0x4f60e2){if(_0xb4700[_0xedfa('0xd')](_0xedfa('0xe'))){_0xb4700[_0xedfa('0xf')]=moment()[_0xedfa('0x10')](_0xedfa('0x11'));}_0x4f60e2(null,_0xb4700);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index b04266f..791e3b8 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 _0x390d=['UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','limit','find','ids','omit','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch'];(function(_0x129927,_0x344bd2){var _0x7249f9=function(_0x491ed5){while(--_0x491ed5){_0x129927['push'](_0x129927['shift']());}};_0x7249f9(++_0x344bd2);}(_0x390d,0x17d));var _0xd390=function(_0x5a9e50,_0x7df75e){_0x5a9e50=_0x5a9e50-0x0;var _0x3ff862=_0x390d[_0x5a9e50];return _0x3ff862;};'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(_0xd390('0xa'));var jayson=require(_0xd390('0xb'));var client=jayson[_0xd390('0xc')][_0xd390('0xd')]({'port':0x232a});config[_0xd390('0xe')]=_['defaults'](config[_0xd390('0xe')],{'host':_0xd390('0xf'),'port':0x18eb});var socket=require(_0xd390('0x10'))(new Redis(config[_0xd390('0xe')]));require(_0xd390('0x11'))[_0xd390('0x12')](socket);function respondWithRpcPromise(_0x335359,_0xc7c78e,_0x1f7f65){return new BPromise(function(_0x457314,_0x2894d1){return client['request'](_0x335359,_0x1f7f65)[_0xd390('0x13')](function(_0x3a8d47){logger[_0xd390('0x14')](_0xd390('0x15'),_0xc7c78e,_0xd390('0x16'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xc7c78e,_0xd390('0x16'),JSON[_0xd390('0x17')](_0x3a8d47));if(_0x3a8d47['error']){if(_0x3a8d47['error'][_0xd390('0x18')]===0x1f4){logger[_0xd390('0x19')](_0xd390('0x15'),_0xc7c78e,_0x3a8d47['error'][_0xd390('0x1a')]);return _0x2894d1(_0x3a8d47['error'][_0xd390('0x1a')]);}logger[_0xd390('0x19')](_0xd390('0x15'),_0xc7c78e,_0x3a8d47[_0xd390('0x19')]['message']);return _0x457314(_0x3a8d47[_0xd390('0x19')][_0xd390('0x1a')]);}else{logger['info'](_0xd390('0x15'),_0xc7c78e,_0xd390('0x16'));_0x457314(_0x3a8d47[_0xd390('0x1b')][_0xd390('0x1a')]);}})[_0xd390('0x1c')](function(_0x2ac2f0){logger[_0xd390('0x19')](_0xd390('0x15'),_0xc7c78e,_0x2ac2f0);_0x2894d1(_0x2ac2f0);});});}exports[_0xd390('0x1d')]=function(_0x461cba){var _0x509990=this;return new Promise(function(_0x59e540,_0x1895e1){return db[_0xd390('0x1e')][_0xd390('0x1f')](_0x461cba[_0xd390('0x20')],{'raw':_0x461cba['options']?_0x461cba[_0xd390('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x461cba[_0xd390('0x21')]?_0x461cba['options'][_0xd390('0x22')]||null:null,'attributes':_0x461cba['options']?_0x461cba[_0xd390('0x21')]['attributes']||null:null,'limit':_0x461cba[_0xd390('0x21')]?_0x461cba[_0xd390('0x21')][_0xd390('0x23')]||null:null})['then'](function(_0x1eef69){logger[_0xd390('0x14')]('UpdateWhatsappInteraction',_0x461cba);logger['debug']('UpdateWhatsappInteraction',_0x461cba,JSON[_0xd390('0x17')](_0x1eef69));_0x59e540(_0x1eef69);})['catch'](function(_0x5b9305){logger['error'](_0xd390('0x1d'),_0x5b9305[_0xd390('0x1a')],_0x461cba);_0x1895e1(_0x509990[_0xd390('0x19')](0x1f4,_0x5b9305['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x2085f6){return new Promise(function(_0x2b194b,_0xe8ba7e){return db['WhatsappInteraction'][_0xd390('0x24')]({'where':_0x2085f6[_0xd390('0x21')]?_0x2085f6['options']['where']||null:null})[_0xd390('0x13')](function(_0x434d17){if(_0x434d17){return _0x434d17['addTags'](_0x2085f6[_0xd390('0x20')][_0xd390('0x25')],_[_0xd390('0x26')](_0x2085f6[_0xd390('0x20')],[_0xd390('0x25'),'id'])||{});}})['spread'](function(_0x53cd3d){logger[_0xd390('0x14')](_0xd390('0x27'),_0x2085f6);logger[_0xd390('0x28')]('AddTags',_0x2085f6,JSON[_0xd390('0x17')](_0x53cd3d));_0x2b194b(_0x53cd3d);})[_0xd390('0x1c')](function(_0x3ba846){logger[_0xd390('0x19')](_0xd390('0x27'),_0x3ba846[_0xd390('0x1a')],_0x2085f6);_0xe8ba7e(_this['error'](0x1f4,_0x3ba846[_0xd390('0x1a')]));});});}; \ No newline at end of file +var _0x7e10=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','WhatsappInteraction','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','body','omit','ids','spread','AddTags'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7e10,0xdc));var _0x07e1=function(_0x1c7188,_0x16a7fb){_0x1c7188=_0x1c7188-0x0;var _0x50db34=_0x7e10[_0x1c7188];return _0x50db34;};'use strict';var _=require(_0x07e1('0x0'));var util=require('util');var moment=require(_0x07e1('0x1'));var BPromise=require(_0x07e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07e1('0x3'));var db=require(_0x07e1('0x4'))['db'];var utils=require(_0x07e1('0x5'));var logger=require(_0x07e1('0x6'))(_0x07e1('0x7'));var config=require(_0x07e1('0x8'));var jayson=require(_0x07e1('0x9'));var client=jayson[_0x07e1('0xa')][_0x07e1('0xb')]({'port':0x232a});config[_0x07e1('0xc')]=_[_0x07e1('0xd')](config[_0x07e1('0xc')],{'host':_0x07e1('0xe'),'port':0x18eb});var socket=require(_0x07e1('0xf'))(new Redis(config[_0x07e1('0xc')]));require('./whatsappInteraction.socket')[_0x07e1('0x10')](socket);function respondWithRpcPromise(_0x1bfb12,_0x488cb4,_0x401549){return new BPromise(function(_0x632bd1,_0x1c148d){return client[_0x07e1('0x11')](_0x1bfb12,_0x401549)[_0x07e1('0x12')](function(_0x5325b7){logger[_0x07e1('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x488cb4,_0x07e1('0x14'));logger[_0x07e1('0x15')](_0x07e1('0x16'),_0x488cb4,'request\x20sent',JSON[_0x07e1('0x17')](_0x5325b7));if(_0x5325b7[_0x07e1('0x18')]){if(_0x5325b7[_0x07e1('0x18')][_0x07e1('0x19')]===0x1f4){logger[_0x07e1('0x18')](_0x07e1('0x1a'),_0x488cb4,_0x5325b7[_0x07e1('0x18')][_0x07e1('0x1b')]);return _0x1c148d(_0x5325b7[_0x07e1('0x18')][_0x07e1('0x1b')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x488cb4,_0x5325b7['error'][_0x07e1('0x1b')]);return _0x632bd1(_0x5325b7[_0x07e1('0x18')][_0x07e1('0x1b')]);}else{logger['info'](_0x07e1('0x1a'),_0x488cb4,'request\x20sent');_0x632bd1(_0x5325b7[_0x07e1('0x1c')]['message']);}})['catch'](function(_0x2e6909){logger[_0x07e1('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x488cb4,_0x2e6909);_0x1c148d(_0x2e6909);});});}exports['UpdateWhatsappInteraction']=function(_0x4f476f){var _0x483085=this;return new Promise(function(_0x56d2da,_0x17ba65){return db[_0x07e1('0x1d')]['update'](_0x4f476f['body'],{'raw':_0x4f476f['options']?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f476f[_0x07e1('0x1e')]?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x20')]||null:null,'attributes':_0x4f476f[_0x07e1('0x1e')]?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x21')]||null:null,'limit':_0x4f476f[_0x07e1('0x1e')]?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x22')]||null:null})[_0x07e1('0x12')](function(_0x7e9b8b){logger[_0x07e1('0x13')]('UpdateWhatsappInteraction',_0x4f476f);logger[_0x07e1('0x15')]('UpdateWhatsappInteraction',_0x4f476f,JSON[_0x07e1('0x17')](_0x7e9b8b));_0x56d2da(_0x7e9b8b);})['catch'](function(_0x49e211){logger[_0x07e1('0x18')](_0x07e1('0x23'),_0x49e211[_0x07e1('0x1b')],_0x4f476f);_0x17ba65(_0x483085[_0x07e1('0x18')](0x1f4,_0x49e211[_0x07e1('0x1b')]));});});};exports[_0x07e1('0x24')]=function(_0x8c9a70){return new Promise(function(_0x1fca0d,_0x2af774){return db[_0x07e1('0x1d')][_0x07e1('0x25')]({'where':_0x8c9a70[_0x07e1('0x1e')]?_0x8c9a70['options'][_0x07e1('0x20')]||null:null})['then'](function(_0x115920){if(_0x115920){return _0x115920[_0x07e1('0x26')](_0x8c9a70[_0x07e1('0x27')]['ids'],_[_0x07e1('0x28')](_0x8c9a70['body'],[_0x07e1('0x29'),'id'])||{});}})[_0x07e1('0x2a')](function(_0x3988ae){logger[_0x07e1('0x13')](_0x07e1('0x2b'),_0x8c9a70);logger[_0x07e1('0x15')](_0x07e1('0x2b'),_0x8c9a70,JSON[_0x07e1('0x17')](_0x3988ae));_0x1fca0d(_0x3988ae);})['catch'](function(_0x518c5d){logger[_0x07e1('0x18')]('AddTags',_0x518c5d[_0x07e1('0x1b')],_0x8c9a70);_0x2af774(_this[_0x07e1('0x18')](0x1f4,_0x518c5d[_0x07e1('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 8cfe85f..cb540a8 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 _0x51f5=['length','./whatsappInteraction.events','remove','update','removeListener'];(function(_0xbc0d6d,_0x1bc497){var _0x26bf3f=function(_0x369339){while(--_0x369339){_0xbc0d6d['push'](_0xbc0d6d['shift']());}};_0x26bf3f(++_0x1bc497);}(_0x51f5,0x196));var _0x551f=function(_0x2782fd,_0x13e321){_0x2782fd=_0x2782fd-0x0;var _0x3fda0e=_0x51f5[_0x2782fd];return _0x3fda0e;};'use strict';var WhatsappInteractionEvents=require(_0x551f('0x0'));var events=['save',_0x551f('0x1'),_0x551f('0x2')];function createListener(_0x3a9dd3,_0x486956){return function(_0xdc74b){_0x486956['emit'](_0x3a9dd3,_0xdc74b);};}function removeListener(_0x3ac9e1,_0x418fd5){return function(){WhatsappInteractionEvents[_0x551f('0x3')](_0x3ac9e1,_0x418fd5);};}exports['register']=function(_0x4d1e93){for(var _0x3a76b4=0x0,_0x591d7e=events[_0x551f('0x4')];_0x3a76b4<_0x591d7e;_0x3a76b4++){var _0x3410d5=events[_0x3a76b4];var _0x599a6e=createListener('whatsappInteraction:'+_0x3410d5,_0x4d1e93);WhatsappInteractionEvents['on'](_0x3410d5,_0x599a6e);}}; \ No newline at end of file +var _0xcd58=['emit','register','length','whatsappInteraction:','update'];(function(_0x2bdf04,_0x5e608e){var _0x33ce04=function(_0x357c41){while(--_0x357c41){_0x2bdf04['push'](_0x2bdf04['shift']());}};_0x33ce04(++_0x5e608e);}(_0xcd58,0x15d));var _0x8cd5=function(_0x440f7a,_0x4368eb){_0x440f7a=_0x440f7a-0x0;var _0x5325e1=_0xcd58[_0x440f7a];return _0x5325e1;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0x8cd5('0x0')];function createListener(_0x4441f4,_0x5720c6){return function(_0x4f28e4){_0x5720c6[_0x8cd5('0x1')](_0x4441f4,_0x4f28e4);};}function removeListener(_0x1186b2,_0x3551d7){return function(){WhatsappInteractionEvents['removeListener'](_0x1186b2,_0x3551d7);};}exports[_0x8cd5('0x2')]=function(_0x46e05b){for(var _0x2abe4f=0x0,_0x5b02c9=events[_0x8cd5('0x3')];_0x2abe4f<_0x5b02c9;_0x2abe4f++){var _0x97be8f=events[_0x2abe4f];var _0x3c309b=createListener(_0x8cd5('0x4')+_0x97be8f,_0x46e05b);WhatsappInteractionEvents['on'](_0x97be8f,_0x3c309b);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0b673c4..c36996b 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 _0xbefc=['/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xbefc,0x17b));var _0xcbef=function(_0xa4d995,_0x146e4d){_0xa4d995=_0xa4d995-0x0;var _0x203f55=_0xbefc[_0xa4d995];return _0x203f55;};'use strict';var multer=require(_0xcbef('0x0'));var util=require(_0xcbef('0x1'));var path=require(_0xcbef('0x2'));var timeout=require('connect-timeout');var express=require(_0xcbef('0x3'));var router=express[_0xcbef('0x4')]();var fs_extra=require(_0xcbef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcbef('0x6'));var config=require('../../config/environment');var controller=require(_0xcbef('0x7'));router[_0xcbef('0x8')]('/',auth[_0xcbef('0x9')](),controller[_0xcbef('0xa')]);router[_0xcbef('0x8')]('/describe',auth[_0xcbef('0x9')](),controller['describe']);router['get'](_0xcbef('0xb'),auth[_0xcbef('0x9')](),controller[_0xcbef('0xc')]);router[_0xcbef('0xd')]('/',auth['isAuthenticated'](),interaction[_0xcbef('0xe')](_0xcbef('0xf'),_0xcbef('0x10')),controller[_0xcbef('0x11')]);router['post'](_0xcbef('0x12'),controller['status']);router[_0xcbef('0x13')](_0xcbef('0xb'),auth[_0xcbef('0x9')](),controller['update']);router[_0xcbef('0x13')](_0xcbef('0x14'),auth[_0xcbef('0x9')](),controller[_0xcbef('0x15')]);router[_0xcbef('0x13')](_0xcbef('0x16'),auth['isAuthenticated'](),controller[_0xcbef('0x17')]);router[_0xcbef('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xcbef('0x19')]);module['exports']=router; \ No newline at end of file +var _0x49cd=['show','post','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/:id'];(function(_0x2d1405,_0xb72e8){var _0x36d2e7=function(_0x11a039){while(--_0x11a039){_0x2d1405['push'](_0x2d1405['shift']());}};_0x36d2e7(++_0xb72e8);}(_0x49cd,0xe5));var _0xd49c=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0x49cd[_0x296144];return _0x5329b1;};'use strict';var multer=require(_0xd49c('0x0'));var util=require(_0xd49c('0x1'));var path=require('path');var timeout=require(_0xd49c('0x2'));var express=require(_0xd49c('0x3'));var router=express[_0xd49c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd49c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd49c('0x6'));var controller=require(_0xd49c('0x7'));router[_0xd49c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd49c('0x8')]('/describe',auth[_0xd49c('0x9')](),controller['describe']);router['get'](_0xd49c('0xa'),auth[_0xd49c('0x9')](),controller[_0xd49c('0xb')]);router[_0xd49c('0xc')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xd49c('0xd'),_0xd49c('0xe')),controller[_0xd49c('0xf')]);router[_0xd49c('0xc')](_0xd49c('0x10'),controller[_0xd49c('0x11')]);router[_0xd49c('0x12')](_0xd49c('0xa'),auth[_0xd49c('0x9')](),controller[_0xd49c('0x13')]);router['put']('/:id/accept',auth[_0xd49c('0x9')](),controller[_0xd49c('0x14')]);router[_0xd49c('0x12')](_0xd49c('0x15'),auth[_0xd49c('0x9')](),controller['reject']);router[_0xd49c('0x16')](_0xd49c('0xa'),auth[_0xd49c('0x9')](),controller[_0xd49c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 9e4a157..8054da2 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 _0xed11=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x41e9b6,_0xb841d9){var _0xb68942=function(_0x215ebc){while(--_0x215ebc){_0x41e9b6['push'](_0x41e9b6['shift']());}};_0xb68942(++_0xb841d9);}(_0xed11,0x1eb));var _0x1ed1=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xed11[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0x1ed1('0x0'));module['exports']={'body':{'type':Sequelize[_0x1ed1('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1ed1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ed1('0x3')]('in',_0x1ed1('0x4')),'defaultValue':_0x1ed1('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x1ed1('0x5')]},'readAt':{'type':Sequelize[_0x1ed1('0x6')]},'secret':{'type':Sequelize[_0x1ed1('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1ed1('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe5ad=['STRING','DATE','exports','TEXT','ENUM','out'];(function(_0x572ffa,_0x33b7fa){var _0x36c8e5=function(_0x420ab0){while(--_0x420ab0){_0x572ffa['push'](_0x572ffa['shift']());}};_0x36c8e5(++_0x33b7fa);}(_0xe5ad,0x158));var _0xde5a=function(_0x118ded,_0x44f172){_0x118ded=_0x118ded-0x0;var _0x59ee8e=_0xe5ad[_0x118ded];return _0x59ee8e;};'use strict';var Sequelize=require('sequelize');module[_0xde5a('0x0')]={'body':{'type':Sequelize[_0xde5a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xde5a('0x2')]('in',_0xde5a('0x3')),'defaultValue':_0xde5a('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xde5a('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xde5a('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'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 7c720ff..a9eb510 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 _0x4d2b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','save','sendStatus','stack','name','send','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','describe','../../config/logger','whatsapp-interactions','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','reject','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','email','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse'];(function(_0x17ec60,_0x30018b){var _0x441165=function(_0x44cd9e){while(--_0x44cd9e){_0x17ec60['push'](_0x17ec60['shift']());}};_0x441165(++_0x30018b);}(_0x4d2b,0x110));var _0xb4d2=function(_0x3e34a9,_0xc91ee6){_0x3e34a9=_0x3e34a9-0x0;var _0x5d6aab=_0x4d2b[_0x3e34a9];return _0x5d6aab;};'use strict';var emlformat=require(_0xb4d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4d2('0x1'));var jsonpatch=require(_0xb4d2('0x2'));var rp=require('request-promise');var moment=require(_0xb4d2('0x3'));var BPromise=require(_0xb4d2('0x4'));var Mustache=require(_0xb4d2('0x5'));var util=require('util');var path=require(_0xb4d2('0x6'));var sox=require(_0xb4d2('0x7'));var csv=require(_0xb4d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4d2('0x9'));var _=require(_0xb4d2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb4d2('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb4d2('0xc'));var Papa=require(_0xb4d2('0xd'));var Redis=require(_0xb4d2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb4d2('0xf'));var as=require(_0xb4d2('0x10'));var hardwareService=require(_0xb4d2('0x11'));var logger=require('../../config/logger')(_0xb4d2('0x12'));var utils=require(_0xb4d2('0x13'));var config=require(_0xb4d2('0x14'));var licenseUtil=require(_0xb4d2('0x15'));var db=require('../../mysqldb')['db'];config[_0xb4d2('0x16')]=_[_0xb4d2('0x17')](config[_0xb4d2('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4d2('0x18'))(new Redis(config['redis']));require(_0xb4d2('0x19'))['register'](socket);var jayson=require(_0xb4d2('0x1a'));var client=jayson[_0xb4d2('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xb4d2('0x1b')][_0xb4d2('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5ba5ed,_0x12ebf9,_0x111f9d,_0x53b832){return new BPromise(function(_0x58a051,_0x234b1f){var _0x2f9a06=_0x53b832||client;return _0x2f9a06[_0xb4d2('0x1d')](_0x5ba5ed,_0x111f9d)[_0xb4d2('0x1e')](function(_0x44ad36){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x12ebf9,_0xb4d2('0x1f'));logger[_0xb4d2('0x20')](_0xb4d2('0x21'),_0x12ebf9,'request\x20sent',JSON[_0xb4d2('0x22')](_0x44ad36));if(_0x44ad36[_0xb4d2('0x23')]){if(_0x44ad36[_0xb4d2('0x23')][_0xb4d2('0x24')]===0x1f4){logger['error'](_0xb4d2('0x25'),_0x12ebf9,_0x44ad36[_0xb4d2('0x23')]['message']);return _0x234b1f(_0x44ad36[_0xb4d2('0x23')]['message']);}logger[_0xb4d2('0x23')](_0xb4d2('0x25'),_0x12ebf9,_0x44ad36[_0xb4d2('0x23')][_0xb4d2('0x26')]);return _0x58a051(_0x44ad36[_0xb4d2('0x23')]['message']);}else{logger[_0xb4d2('0x27')](_0xb4d2('0x25'),_0x12ebf9,_0xb4d2('0x1f'));_0x58a051(_0x44ad36[_0xb4d2('0x28')][_0xb4d2('0x26')]);}})[_0xb4d2('0x29')](function(_0x37ee51){logger[_0xb4d2('0x23')](_0xb4d2('0x25'),_0x12ebf9,_0x37ee51);_0x234b1f(_0x37ee51);});});}function respondWithStatusCode(_0x4c5087,_0x19786e){_0x19786e=_0x19786e||0xcc;return function(_0x41136a){if(_0x41136a){return _0x4c5087['sendStatus'](_0x19786e);}return _0x4c5087[_0xb4d2('0x2a')](_0x19786e)[_0xb4d2('0x2b')]();};}function respondWithResult(_0x46a75f,_0x375649){_0x375649=_0x375649||0xc8;return function(_0x1aa202){if(_0x1aa202){return _0x46a75f['status'](_0x375649)[_0xb4d2('0x2c')](_0x1aa202);}};}function respondWithFilteredResult(_0x15ff2c,_0x555492){return function(_0x9cbd55){if(_0x9cbd55){var _0x2e52f2=typeof _0x555492[_0xb4d2('0x2d')]===_0xb4d2('0x2e')&&typeof _0x555492['limit']===_0xb4d2('0x2e');var _0x3cc511=_0x9cbd55[_0xb4d2('0x2f')];var _0x37f87f=_0x2e52f2?0x0:_0x555492[_0xb4d2('0x2d')];var _0x3e58de=_0x2e52f2?_0x9cbd55[_0xb4d2('0x2f')]:_0x555492[_0xb4d2('0x2d')]+_0x555492['limit'];var _0x2fc128;if(_0x3e58de>=_0x3cc511){_0x3e58de=_0x3cc511;_0x2fc128=0xc8;}else{_0x2fc128=0xce;}_0x15ff2c[_0xb4d2('0x2a')](_0x2fc128);return _0x15ff2c[_0xb4d2('0x30')](_0xb4d2('0x31'),_0x37f87f+'-'+_0x3e58de+'/'+_0x3cc511)[_0xb4d2('0x2c')](_0x9cbd55);}return null;};}function patchUpdates(_0x5bb521){return function(_0x3972b7){try{jsonpatch[_0xb4d2('0x32')](_0x3972b7,_0x5bb521,!![]);}catch(_0x2d6be2){return BPromise['reject'](_0x2d6be2);}return _0x3972b7[_0xb4d2('0x33')]();};}function saveUpdates(_0xa11e48,_0x206488){return function(_0x51bd81){if(_0x51bd81){return _0x51bd81['update'](_0xa11e48)[_0xb4d2('0x1e')](function(_0x2cbf05){return _0x2cbf05;});}return null;};}function removeEntity(_0x1e2a6c,_0x281e75){return function(_0x49e4c5){if(_0x49e4c5){return _0x49e4c5['destroy']()[_0xb4d2('0x1e')](function(){_0x1e2a6c[_0xb4d2('0x2a')](0xcc)[_0xb4d2('0x2b')]();});}};}function handleEntityNotFound(_0x40cb80,_0x464b67){return function(_0x7daaa6){if(!_0x7daaa6){_0x40cb80[_0xb4d2('0x34')](0x194);}return _0x7daaa6;};}function handleError(_0x43bd3b,_0x32c7fc){_0x32c7fc=_0x32c7fc||0x1f4;return function(_0x2efe6b){logger[_0xb4d2('0x23')](_0x2efe6b[_0xb4d2('0x35')]);if(_0x2efe6b[_0xb4d2('0x36')]){delete _0x2efe6b[_0xb4d2('0x36')];}_0x43bd3b[_0xb4d2('0x2a')](_0x32c7fc)[_0xb4d2('0x37')](_0x2efe6b);};}exports['index']=function(_0x60eef1,_0x57cfd4){var _0x34b39a={},_0xbbcda5={},_0x30ef21={'count':0x0,'rows':[]};var _0x1e712d=_['map'](db['WhatsappMessage'][_0xb4d2('0x38')],function(_0x4a3f78){return{'name':_0x4a3f78['fieldName'],'type':_0x4a3f78[_0xb4d2('0x39')]['key']};});_0xbbcda5[_0xb4d2('0x3a')]=_['map'](_0x1e712d,'name');_0xbbcda5[_0xb4d2('0x3b')]=_[_0xb4d2('0x3c')](_0x60eef1[_0xb4d2('0x3b')]);_0xbbcda5['filters']=_['intersection'](_0xbbcda5[_0xb4d2('0x3a')],_0xbbcda5[_0xb4d2('0x3b')]);_0x34b39a[_0xb4d2('0x3d')]=_[_0xb4d2('0x3e')](_0xbbcda5[_0xb4d2('0x3a')],qs[_0xb4d2('0x3f')](_0x60eef1[_0xb4d2('0x3b')][_0xb4d2('0x3f')]));_0x34b39a['attributes']=_0x34b39a[_0xb4d2('0x3d')][_0xb4d2('0x40')]?_0x34b39a[_0xb4d2('0x3d')]:_0xbbcda5[_0xb4d2('0x3a')];if(!_0x60eef1[_0xb4d2('0x3b')][_0xb4d2('0x41')](_0xb4d2('0x42'))){_0x34b39a['limit']=qs[_0xb4d2('0x43')](_0x60eef1['query'][_0xb4d2('0x43')]);_0x34b39a['offset']=qs[_0xb4d2('0x2d')](_0x60eef1[_0xb4d2('0x3b')][_0xb4d2('0x2d')]);}_0x34b39a[_0xb4d2('0x44')]=qs[_0xb4d2('0x45')](_0x60eef1[_0xb4d2('0x3b')][_0xb4d2('0x45')]);_0x34b39a[_0xb4d2('0x46')]=qs[_0xb4d2('0x47')](_[_0xb4d2('0x48')](_0x60eef1['query'],_0xbbcda5[_0xb4d2('0x47')]),_0x1e712d);if(_0x60eef1[_0xb4d2('0x3b')][_0xb4d2('0x49')]){_0x34b39a[_0xb4d2('0x46')]=_[_0xb4d2('0x4a')](_0x34b39a[_0xb4d2('0x46')],{'$or':_['map'](_0x1e712d,function(_0x346471){if(_0x346471[_0xb4d2('0x39')]!==_0xb4d2('0x4b')){var _0x59820c={};_0x59820c[_0x346471[_0xb4d2('0x36')]]={'$like':'%'+_0x60eef1[_0xb4d2('0x3b')][_0xb4d2('0x49')]+'%'};return _0x59820c;}})});}_0x34b39a=_[_0xb4d2('0x4a')]({},_0x34b39a,_0x60eef1[_0xb4d2('0x4c')]);var _0x536841={'where':_0x34b39a['where']};return db[_0xb4d2('0x4d')][_0xb4d2('0x2f')](_0x536841)['then'](function(_0x12f93b){_0x30ef21['count']=_0x12f93b;if(_0x60eef1[_0xb4d2('0x3b')][_0xb4d2('0x4e')]){_0x34b39a[_0xb4d2('0x4f')]=[{'all':!![]}];}return db[_0xb4d2('0x4d')][_0xb4d2('0x50')](_0x34b39a);})[_0xb4d2('0x1e')](function(_0xb007d3){_0x30ef21[_0xb4d2('0x51')]=_0xb007d3;return _0x30ef21;})[_0xb4d2('0x1e')](respondWithFilteredResult(_0x57cfd4,_0x34b39a))[_0xb4d2('0x29')](handleError(_0x57cfd4,null));};exports[_0xb4d2('0x52')]=function(_0x15aab7,_0x23dff4){var _0x41b492={'raw':!![],'where':{'id':_0x15aab7[_0xb4d2('0x53')]['id']}},_0x337bae={};_0x337bae[_0xb4d2('0x3a')]=_[_0xb4d2('0x3c')](db['WhatsappMessage']['rawAttributes']);_0x337bae[_0xb4d2('0x3b')]=_[_0xb4d2('0x3c')](_0x15aab7[_0xb4d2('0x3b')]);_0x337bae[_0xb4d2('0x47')]=_[_0xb4d2('0x3e')](_0x337bae['model'],_0x337bae[_0xb4d2('0x3b')]);_0x41b492['attributes']=_['intersection'](_0x337bae[_0xb4d2('0x3a')],qs[_0xb4d2('0x3f')](_0x15aab7[_0xb4d2('0x3b')][_0xb4d2('0x3f')]));_0x41b492[_0xb4d2('0x3d')]=_0x41b492[_0xb4d2('0x3d')][_0xb4d2('0x40')]?_0x41b492['attributes']:_0x337bae[_0xb4d2('0x3a')];if(_0x15aab7[_0xb4d2('0x3b')][_0xb4d2('0x4e')]){_0x41b492[_0xb4d2('0x4f')]=[{'all':!![]}];}_0x41b492=_[_0xb4d2('0x4a')]({},_0x41b492,_0x15aab7[_0xb4d2('0x4c')]);return db[_0xb4d2('0x4d')][_0xb4d2('0x54')](_0x41b492)[_0xb4d2('0x1e')](handleEntityNotFound(_0x23dff4,null))[_0xb4d2('0x1e')](respondWithResult(_0x23dff4,null))[_0xb4d2('0x29')](handleError(_0x23dff4,null));};exports[_0xb4d2('0x55')]=function(_0x1bc9c3,_0x471386){return db[_0xb4d2('0x4d')][_0xb4d2('0x55')](_0x1bc9c3[_0xb4d2('0x56')],{})[_0xb4d2('0x1e')](respondWithResult(_0x471386,0xc9))['catch'](handleError(_0x471386,null));};exports[_0xb4d2('0x57')]=function(_0x4bf38b,_0x4e2bce){if(_0x4bf38b[_0xb4d2('0x56')]['id']){delete _0x4bf38b[_0xb4d2('0x56')]['id'];}return db[_0xb4d2('0x4d')][_0xb4d2('0x54')]({'where':{'id':_0x4bf38b['params']['id']}})['then'](handleEntityNotFound(_0x4e2bce,null))[_0xb4d2('0x1e')](saveUpdates(_0x4bf38b['body'],null))['then'](respondWithResult(_0x4e2bce,null))[_0xb4d2('0x29')](handleError(_0x4e2bce,null));};exports[_0xb4d2('0x58')]=function(_0x3d9c23,_0x44da0f){return db[_0xb4d2('0x4d')][_0xb4d2('0x54')]({'where':{'id':_0x3d9c23[_0xb4d2('0x53')]['id']}})[_0xb4d2('0x1e')](handleEntityNotFound(_0x44da0f,null))[_0xb4d2('0x1e')](removeEntity(_0x44da0f,null))['catch'](handleError(_0x44da0f,null));};exports[_0xb4d2('0x59')]=function(_0x1d46c6,_0x110dcc){return db[_0xb4d2('0x4d')][_0xb4d2('0x59')]()[_0xb4d2('0x1e')](respondWithResult(_0x110dcc,null))[_0xb4d2('0x29')](handleError(_0x110dcc,null));};var interaction_log=require(_0xb4d2('0x5a'))(_0xb4d2('0x5b'));exports['accept']=function(_0x34f3e6,_0xf3fb96,_0x5fac95){var _0x38ab8a={'agent':{},'channel':_0xb4d2('0x5c')};if(_0x34f3e6[_0xb4d2('0x56')]['id']){delete _0x34f3e6['body']['id'];}_0x34f3e6[_0xb4d2('0x56')]['read']=!![];_0x34f3e6[_0xb4d2('0x56')]['readAt']=moment()[_0xb4d2('0x5d')](_0xb4d2('0x5e'));_0x34f3e6[_0xb4d2('0x56')][_0xb4d2('0x5f')]=_0x34f3e6[_0xb4d2('0x56')]['UserId']||_0x34f3e6[_0xb4d2('0x60')]['id'];_0x38ab8a[_0xb4d2('0x61')]['id']=_0x34f3e6[_0xb4d2('0x56')][_0xb4d2('0x5f')];return db[_0xb4d2('0x4d')]['find']({'where':{'id':_0x34f3e6[_0xb4d2('0x53')]['id'],'UserId':null}})[_0xb4d2('0x1e')](handleEntityNotFound(_0xf3fb96,null))['then'](saveUpdates(_0x34f3e6[_0xb4d2('0x56')],null))[_0xb4d2('0x1e')](function(_0x1df483){if(_0x1df483){_0x38ab8a['message']=_0x1df483[_0xb4d2('0x62')]({'plain':!![]});return db[_0xb4d2('0x63')][_0xb4d2('0x54')]({'where':{'id':_0x1df483[_0xb4d2('0x64')]}});}return null;})['then'](handleEntityNotFound(_0xf3fb96,null))['then'](function(_0x1eee6d){if(_0x1eee6d){return _0x1eee6d['update']({'UserId':_0x34f3e6[_0xb4d2('0x56')][_0xb4d2('0x5f')],'read1stAt':_[_0xb4d2('0x65')](_0x1eee6d[_0xb4d2('0x66')])?moment()[_0xb4d2('0x5d')](_0xb4d2('0x5e')):undefined});}return null;})[_0xb4d2('0x1e')](function(_0x1072b2){if(_0x1072b2){_0x38ab8a['interaction']=_0x1072b2[_0xb4d2('0x62')]({'plain':!![]});interaction_log[_0xb4d2('0x27')](_0xb4d2('0x67'),_0x34f3e6[_0xb4d2('0x60')]['id'],_0x34f3e6[_0xb4d2('0x60')]['name'],_0x34f3e6[_0xb4d2('0x60')][_0xb4d2('0x68')],_0x38ab8a['interaction']['id'],_0x34f3e6[_0xb4d2('0x56')]?JSON[_0xb4d2('0x22')](_0x34f3e6[_0xb4d2('0x56')]):_0xb4d2('0x69'));return respondWithRpcPromise(_0xb4d2('0x6a'),_0xb4d2('0x6b'),_0x38ab8a);}return null;})[_0xb4d2('0x1e')](function(_0x1470ae){var _0xa17665=_0xb4d2('0x6c')+_0x1470ae['message'][_0xb4d2('0x6d')];return db[_0xb4d2('0x6e')][_0xb4d2('0x3b')](_0xa17665,{'type':db[_0xb4d2('0x6f')][_0xb4d2('0x70')][_0xb4d2('0x71')],'raw':!![]})[_0xb4d2('0x1e')](function(_0xe99ff0){return _0xe99ff0;});})[_0xb4d2('0x1e')](function(_0x42c335){if(_0x42c335){_0x38ab8a[_0xb4d2('0x26')][_0xb4d2('0x72')]=_0x42c335[0x0];if(!_0x34f3e6[_0xb4d2('0x56')][_0xb4d2('0x5f')])return;return db['User'][_0xb4d2('0x54')]({'where':{'id':_0x34f3e6['body']['UserId'],'role':'agent'},'attributes':['id',_0xb4d2('0x36'),_0xb4d2('0x73'),'email',_0xb4d2('0x74')],'raw':!![]});}return null;})[_0xb4d2('0x1e')](function(_0x1f7249){if(!_0x1f7249)return null;_0x38ab8a[_0xb4d2('0x26')]['agent']=_0x1f7249;return _0x38ab8a;})[_0xb4d2('0x1e')](function(_0x737f49){if(_0x737f49){if(_0x34f3e6[_0xb4d2('0x56')][_0xb4d2('0x75')]){_0x38ab8a[_0xb4d2('0x26')][_0xb4d2('0x76')]=util[_0xb4d2('0x5d')](_0xb4d2('0x77'),_0x34f3e6[_0xb4d2('0x60')][_0xb4d2('0x36')]);_0x38ab8a[_0xb4d2('0x26')][_0xb4d2('0x78')]=_0x38ab8a[_0xb4d2('0x78')];_0x38ab8a['message'][_0xb4d2('0x79')]=_0x38ab8a[_0xb4d2('0x78')];_0x38ab8a['message'][_0xb4d2('0x7a')]=_0xb4d2('0x7b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x38ab8a[_0xb4d2('0x26')]},client9002)[_0xb4d2('0x1e')](function(){return _0x38ab8a;});}return _0x38ab8a;}return null;})[_0xb4d2('0x1e')](respondWithResult(_0xf3fb96,null))['catch'](handleError(_0xf3fb96,null));};var interaction_log=require(_0xb4d2('0x5a'))(_0xb4d2('0x5b'));exports[_0xb4d2('0x7c')]=function(_0xbc9a67,_0x5c0bde,_0x289bda){var _0x533500={'agent':{},'channel':_0xb4d2('0x5c')};if(_0xbc9a67[_0xb4d2('0x56')]['id']){delete _0xbc9a67[_0xb4d2('0x56')]['id'];}_0xbc9a67[_0xb4d2('0x56')][_0xb4d2('0x5f')]=_0xbc9a67['body'][_0xb4d2('0x5f')]||_0xbc9a67['user']['id'];_0x533500[_0xb4d2('0x61')]['id']=_0xbc9a67[_0xb4d2('0x56')][_0xb4d2('0x5f')];return db[_0xb4d2('0x4d')][_0xb4d2('0x54')]({'where':{'id':_0xbc9a67[_0xb4d2('0x53')]['id'],'UserId':null}})[_0xb4d2('0x1e')](handleEntityNotFound(_0x5c0bde,null))[_0xb4d2('0x1e')](function(_0x325841){if(_0x325841){_0x533500[_0xb4d2('0x26')]=_0x325841[_0xb4d2('0x62')]({'plain':!![]});return db[_0xb4d2('0x63')][_0xb4d2('0x54')]({'where':{'id':_0x325841[_0xb4d2('0x64')]}});}return null;})[_0xb4d2('0x1e')](handleEntityNotFound(_0x5c0bde,null))['then'](function(_0x3dc2f7){if(_0x3dc2f7){_0x533500[_0xb4d2('0x7d')]=_0x3dc2f7[_0xb4d2('0x62')]({'plain':!![]});interaction_log[_0xb4d2('0x27')](_0xb4d2('0x7e'),_0xbc9a67['user']['id'],_0xbc9a67['user'][_0xb4d2('0x36')],_0xbc9a67[_0xb4d2('0x60')][_0xb4d2('0x68')],_0x533500['interaction']['id'],_0xbc9a67[_0xb4d2('0x56')]?JSON[_0xb4d2('0x22')](_0xbc9a67[_0xb4d2('0x56')]):_0xb4d2('0x69'));return respondWithRpcPromise(_0xb4d2('0x7f'),'rejectMessage',_0x533500);}return null;})[_0xb4d2('0x1e')](function(_0x925787){var _0x2bfb29='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x925787['message']['ContactId'];return db[_0xb4d2('0x6e')]['query'](_0x2bfb29,{'type':db[_0xb4d2('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb4d2('0x1e')](function(_0x139734){return _0x139734;});})[_0xb4d2('0x1e')](function(_0x36e5c6){if(_0x36e5c6){_0x533500[_0xb4d2('0x26')]['contact']=_0x36e5c6[0x0];if(!_0xbc9a67['body'][_0xb4d2('0x5f')])return;return db[_0xb4d2('0x80')][_0xb4d2('0x54')]({'where':{'id':_0xbc9a67[_0xb4d2('0x56')][_0xb4d2('0x5f')],'role':'agent'},'attributes':['id','name',_0xb4d2('0x73'),_0xb4d2('0x81'),_0xb4d2('0x74')],'raw':!![]});}return null;})['then'](function(_0x3a0b9c){if(!_0x3a0b9c)return null;_0x533500['message'][_0xb4d2('0x61')]=_0x3a0b9c;return _0x533500;})[_0xb4d2('0x1e')](function(_0x7f0548){if(_0x7f0548){_0x7f0548[_0xb4d2('0x26')][_0xb4d2('0x76')]=util['format'](_0xb4d2('0x77'),_0xbc9a67[_0xb4d2('0x60')]['name']);_0x7f0548['message'][_0xb4d2('0x78')]=_0x533500['channel'];_0x7f0548[_0xb4d2('0x26')][_0xb4d2('0x79')]=_0x533500[_0xb4d2('0x78')];_0x7f0548[_0xb4d2('0x26')]['event']=_0xb4d2('0x7c');respondWithRpcPromise('EventManager',_0xb4d2('0x82'),{'event':_0xb4d2('0x83'),'message':_0x7f0548['message']},client9002);return _0x533500;}return null;})[_0xb4d2('0x1e')](respondWithResult(_0x5c0bde,null))[_0xb4d2('0x29')](handleError(_0x5c0bde,null));};exports['status']=function(_0xf2499b,_0x566153,_0x330711){if(_0xf2499b['body']['id']){delete _0xf2499b['body']['id'];}var _0x126bc2;return db[_0xb4d2('0x4d')]['find']({'where':{'id':_0xf2499b['params']['id']}})[_0xb4d2('0x1e')](handleEntityNotFound(_0x566153,null))[_0xb4d2('0x1e')](function(_0x1d4127){if(_0x1d4127){_0x126bc2=_0x1d4127;return db[_0xb4d2('0x84')][_0xb4d2('0x54')]({'where':{'id':_0x1d4127[_0xb4d2('0x85')]}});}})[_0xb4d2('0x1e')](handleEntityNotFound(_0x566153,null))[_0xb4d2('0x1e')](function(_0x56b4c5){if(_0x56b4c5){logger[_0xb4d2('0x20')](_0xb4d2('0x86'),_0xb4d2('0x2a'),_0xb4d2('0x87'),_0x56b4c5[_0xb4d2('0x39')],util['inspect'](_0xf2499b[_0xb4d2('0x56')],{'showHidden':![],'depth':null}));switch(_0x56b4c5[_0xb4d2('0x39')]){case _0xb4d2('0x88'):if(_0xf2499b[_0xb4d2('0x56')][_0xb4d2('0x89')]&&_0xf2499b[_0xb4d2('0x56')][_0xb4d2('0x89')]===_0x126bc2[_0xb4d2('0x8a')]&&_0xf2499b[_0xb4d2('0x56')][_0xb4d2('0x8b')]&&_0xf2499b[_0xb4d2('0x56')]['MessageStatus']===_0xb4d2('0x8c')){return _0x126bc2[_0xb4d2('0x57')]({'read':!![]});}else{logger['error'](_0xb4d2('0x8d'),_0xb4d2('0x2a'),_0xb4d2('0x88'),util[_0xb4d2('0x8e')](_0xf2499b['body'],{'showHidden':![],'depth':null}));}break;}return _0x126bc2;}})[_0xb4d2('0x1e')](respondWithResult(_0x566153,null))[_0xb4d2('0x29')](handleError(_0x566153,null));}; \ No newline at end of file +var _0x0c2e=['UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','fullname','SIP/%s','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','end','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0c2e,0xbc));var _0xe0c2=function(_0x386f38,_0x26d8ec){_0x386f38=_0x386f38-0x0;var _0x38e927=_0x0c2e[_0x386f38];return _0x38e927;};'use strict';var emlformat=require(_0xe0c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0c2('0x1'));var jsonpatch=require(_0xe0c2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe0c2('0x3'));var Mustache=require(_0xe0c2('0x4'));var util=require(_0xe0c2('0x5'));var path=require(_0xe0c2('0x6'));var sox=require(_0xe0c2('0x7'));var csv=require(_0xe0c2('0x8'));var ejs=require(_0xe0c2('0x9'));var fs=require('fs');var fs_extra=require(_0xe0c2('0xa'));var _=require(_0xe0c2('0xb'));var squel=require(_0xe0c2('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0c2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe0c2('0x8'));var querystring=require(_0xe0c2('0xe'));var Papa=require(_0xe0c2('0xf'));var Redis=require(_0xe0c2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe0c2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0c2('0x12'));var logger=require(_0xe0c2('0x13'))(_0xe0c2('0x14'));var utils=require(_0xe0c2('0x15'));var config=require(_0xe0c2('0x16'));var licenseUtil=require(_0xe0c2('0x17'));var db=require(_0xe0c2('0x18'))['db'];config[_0xe0c2('0x19')]=_[_0xe0c2('0x1a')](config['redis'],{'host':_0xe0c2('0x1b'),'port':0x18eb});var socket=require(_0xe0c2('0x1c'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xe0c2('0x1d')](socket);var jayson=require(_0xe0c2('0x1e'));var client=jayson[_0xe0c2('0x1f')][_0xe0c2('0x20')]({'port':0x232c});var client9002=jayson[_0xe0c2('0x1f')][_0xe0c2('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3d3738,_0x35f501,_0x2dfcf4,_0x1f1563){return new BPromise(function(_0x529e85,_0x168e89){var _0x561cae=_0x1f1563||client;return _0x561cae[_0xe0c2('0x21')](_0x3d3738,_0x2dfcf4)[_0xe0c2('0x22')](function(_0x33a249){logger[_0xe0c2('0x23')](_0xe0c2('0x24'),_0x35f501,_0xe0c2('0x25'));logger[_0xe0c2('0x26')](_0xe0c2('0x27'),_0x35f501,'request\x20sent',JSON[_0xe0c2('0x28')](_0x33a249));if(_0x33a249[_0xe0c2('0x29')]){if(_0x33a249[_0xe0c2('0x29')][_0xe0c2('0x2a')]===0x1f4){logger[_0xe0c2('0x29')](_0xe0c2('0x24'),_0x35f501,_0x33a249['error'][_0xe0c2('0x2b')]);return _0x168e89(_0x33a249[_0xe0c2('0x29')][_0xe0c2('0x2b')]);}logger[_0xe0c2('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x35f501,_0x33a249[_0xe0c2('0x29')][_0xe0c2('0x2b')]);return _0x529e85(_0x33a249['error']['message']);}else{logger[_0xe0c2('0x23')](_0xe0c2('0x24'),_0x35f501,_0xe0c2('0x25'));_0x529e85(_0x33a249[_0xe0c2('0x2c')][_0xe0c2('0x2b')]);}})['catch'](function(_0x14506d){logger['error'](_0xe0c2('0x24'),_0x35f501,_0x14506d);_0x168e89(_0x14506d);});});}function respondWithStatusCode(_0x38f9ca,_0x1f6995){_0x1f6995=_0x1f6995||0xcc;return function(_0x5271e6){if(_0x5271e6){return _0x38f9ca[_0xe0c2('0x2d')](_0x1f6995);}return _0x38f9ca[_0xe0c2('0x2e')](_0x1f6995)['end']();};}function respondWithResult(_0x534b81,_0x29f35d){_0x29f35d=_0x29f35d||0xc8;return function(_0xcec29a){if(_0xcec29a){return _0x534b81['status'](_0x29f35d)[_0xe0c2('0x2f')](_0xcec29a);}};}function respondWithFilteredResult(_0x2b3f59,_0x262f4c){return function(_0x247953){if(_0x247953){var _0x2c5138=typeof _0x262f4c['offset']===_0xe0c2('0x30')&&typeof _0x262f4c[_0xe0c2('0x31')]===_0xe0c2('0x30');var _0x5333a0=_0x247953['count'];var _0x182d22=_0x2c5138?0x0:_0x262f4c[_0xe0c2('0x32')];var _0x5f3c81=_0x2c5138?_0x247953['count']:_0x262f4c[_0xe0c2('0x32')]+_0x262f4c[_0xe0c2('0x31')];var _0x35b638;if(_0x5f3c81>=_0x5333a0){_0x5f3c81=_0x5333a0;_0x35b638=0xc8;}else{_0x35b638=0xce;}_0x2b3f59[_0xe0c2('0x2e')](_0x35b638);return _0x2b3f59[_0xe0c2('0x33')](_0xe0c2('0x34'),_0x182d22+'-'+_0x5f3c81+'/'+_0x5333a0)[_0xe0c2('0x2f')](_0x247953);}return null;};}function patchUpdates(_0x237304){return function(_0x47be71){try{jsonpatch['apply'](_0x47be71,_0x237304,!![]);}catch(_0x597e56){return BPromise[_0xe0c2('0x35')](_0x597e56);}return _0x47be71[_0xe0c2('0x36')]();};}function saveUpdates(_0x5dbeb2,_0x29ec6c){return function(_0x5ecf69){if(_0x5ecf69){return _0x5ecf69[_0xe0c2('0x37')](_0x5dbeb2)[_0xe0c2('0x22')](function(_0x430595){return _0x430595;});}return null;};}function removeEntity(_0x578a8e,_0x159cbd){return function(_0x2ae4d9){if(_0x2ae4d9){return _0x2ae4d9[_0xe0c2('0x38')]()[_0xe0c2('0x22')](function(){_0x578a8e[_0xe0c2('0x2e')](0xcc)[_0xe0c2('0x39')]();});}};}function handleEntityNotFound(_0x3c890e,_0x5d9ca0){return function(_0x87d4ef){if(!_0x87d4ef){_0x3c890e[_0xe0c2('0x2d')](0x194);}return _0x87d4ef;};}function handleError(_0x4b5d29,_0x31ed63){_0x31ed63=_0x31ed63||0x1f4;return function(_0x517252){logger[_0xe0c2('0x29')](_0x517252['stack']);if(_0x517252[_0xe0c2('0x3a')]){delete _0x517252[_0xe0c2('0x3a')];}_0x4b5d29['status'](_0x31ed63)[_0xe0c2('0x3b')](_0x517252);};}exports[_0xe0c2('0x3c')]=function(_0x37ebae,_0x14e0ff){var _0x52931d={},_0x18c1fd={},_0x2995ea={'count':0x0,'rows':[]};var _0x1d0cf9=_['map'](db[_0xe0c2('0x3d')][_0xe0c2('0x3e')],function(_0x386346){return{'name':_0x386346[_0xe0c2('0x3f')],'type':_0x386346[_0xe0c2('0x40')][_0xe0c2('0x41')]};});_0x18c1fd['model']=_[_0xe0c2('0x42')](_0x1d0cf9,_0xe0c2('0x3a'));_0x18c1fd[_0xe0c2('0x43')]=_[_0xe0c2('0x44')](_0x37ebae[_0xe0c2('0x43')]);_0x18c1fd[_0xe0c2('0x45')]=_[_0xe0c2('0x46')](_0x18c1fd[_0xe0c2('0x47')],_0x18c1fd[_0xe0c2('0x43')]);_0x52931d[_0xe0c2('0x48')]=_['intersection'](_0x18c1fd['model'],qs[_0xe0c2('0x49')](_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x49')]));_0x52931d['attributes']=_0x52931d[_0xe0c2('0x48')]['length']?_0x52931d[_0xe0c2('0x48')]:_0x18c1fd[_0xe0c2('0x47')];if(!_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4a')]('nolimit')){_0x52931d['limit']=qs[_0xe0c2('0x31')](_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x31')]);_0x52931d[_0xe0c2('0x32')]=qs[_0xe0c2('0x32')](_0x37ebae[_0xe0c2('0x43')]['offset']);}_0x52931d[_0xe0c2('0x4b')]=qs[_0xe0c2('0x4c')](_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4c')]);_0x52931d['where']=qs['filters'](_[_0xe0c2('0x4d')](_0x37ebae[_0xe0c2('0x43')],_0x18c1fd[_0xe0c2('0x45')]),_0x1d0cf9);if(_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4e')]){_0x52931d[_0xe0c2('0x4f')]=_[_0xe0c2('0x50')](_0x52931d[_0xe0c2('0x4f')],{'$or':_['map'](_0x1d0cf9,function(_0x3d86dc){if(_0x3d86dc[_0xe0c2('0x40')]!==_0xe0c2('0x51')){var _0x394daa={};_0x394daa[_0x3d86dc[_0xe0c2('0x3a')]]={'$like':'%'+_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4e')]+'%'};return _0x394daa;}})});}_0x52931d=_[_0xe0c2('0x50')]({},_0x52931d,_0x37ebae[_0xe0c2('0x52')]);var _0x69a071={'where':_0x52931d[_0xe0c2('0x4f')]};return db['WhatsappMessage']['count'](_0x69a071)[_0xe0c2('0x22')](function(_0x39a532){_0x2995ea['count']=_0x39a532;if(_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x53')]){_0x52931d['include']=[{'all':!![]}];}return db[_0xe0c2('0x3d')][_0xe0c2('0x54')](_0x52931d);})[_0xe0c2('0x22')](function(_0x137588){_0x2995ea[_0xe0c2('0x55')]=_0x137588;return _0x2995ea;})['then'](respondWithFilteredResult(_0x14e0ff,_0x52931d))['catch'](handleError(_0x14e0ff,null));};exports[_0xe0c2('0x56')]=function(_0x1790ed,_0x288621){var _0x1413be={'raw':!![],'where':{'id':_0x1790ed[_0xe0c2('0x57')]['id']}},_0x53a220={};_0x53a220[_0xe0c2('0x47')]=_['keys'](db['WhatsappMessage'][_0xe0c2('0x3e')]);_0x53a220['query']=_[_0xe0c2('0x44')](_0x1790ed[_0xe0c2('0x43')]);_0x53a220[_0xe0c2('0x45')]=_['intersection'](_0x53a220[_0xe0c2('0x47')],_0x53a220[_0xe0c2('0x43')]);_0x1413be[_0xe0c2('0x48')]=_[_0xe0c2('0x46')](_0x53a220[_0xe0c2('0x47')],qs['fields'](_0x1790ed[_0xe0c2('0x43')][_0xe0c2('0x49')]));_0x1413be[_0xe0c2('0x48')]=_0x1413be[_0xe0c2('0x48')][_0xe0c2('0x58')]?_0x1413be[_0xe0c2('0x48')]:_0x53a220[_0xe0c2('0x47')];if(_0x1790ed['query'][_0xe0c2('0x53')]){_0x1413be[_0xe0c2('0x59')]=[{'all':!![]}];}_0x1413be=_[_0xe0c2('0x50')]({},_0x1413be,_0x1790ed[_0xe0c2('0x52')]);return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')](_0x1413be)[_0xe0c2('0x22')](handleEntityNotFound(_0x288621,null))['then'](respondWithResult(_0x288621,null))[_0xe0c2('0x5b')](handleError(_0x288621,null));};exports[_0xe0c2('0x5c')]=function(_0x37c404,_0x553b80){return db[_0xe0c2('0x3d')][_0xe0c2('0x5c')](_0x37c404[_0xe0c2('0x5d')],{})[_0xe0c2('0x22')](respondWithResult(_0x553b80,0xc9))['catch'](handleError(_0x553b80,null));};exports[_0xe0c2('0x37')]=function(_0x3ab296,_0x4ef274){if(_0x3ab296[_0xe0c2('0x5d')]['id']){delete _0x3ab296[_0xe0c2('0x5d')]['id'];}return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x3ab296[_0xe0c2('0x57')]['id']}})[_0xe0c2('0x22')](handleEntityNotFound(_0x4ef274,null))[_0xe0c2('0x22')](saveUpdates(_0x3ab296[_0xe0c2('0x5d')],null))[_0xe0c2('0x22')](respondWithResult(_0x4ef274,null))[_0xe0c2('0x5b')](handleError(_0x4ef274,null));};exports['destroy']=function(_0x355df6,_0x2bd72d){return db['WhatsappMessage'][_0xe0c2('0x5a')]({'where':{'id':_0x355df6[_0xe0c2('0x57')]['id']}})['then'](handleEntityNotFound(_0x2bd72d,null))[_0xe0c2('0x22')](removeEntity(_0x2bd72d,null))[_0xe0c2('0x5b')](handleError(_0x2bd72d,null));};exports[_0xe0c2('0x5e')]=function(_0x393914,_0xca177c){return db[_0xe0c2('0x3d')][_0xe0c2('0x5e')]()[_0xe0c2('0x22')](respondWithResult(_0xca177c,null))[_0xe0c2('0x5b')](handleError(_0xca177c,null));};var interaction_log=require(_0xe0c2('0x13'))(_0xe0c2('0x5f'));exports[_0xe0c2('0x60')]=function(_0x2c2248,_0x59b145,_0x1cc4ad){var _0x4bb479={'agent':{},'channel':_0xe0c2('0x61')};if(_0x2c2248['body']['id']){delete _0x2c2248[_0xe0c2('0x5d')]['id'];}_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x62')]=!![];_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x63')]=moment()[_0xe0c2('0x64')](_0xe0c2('0x65'));_0x2c2248['body'][_0xe0c2('0x66')]=_0x2c2248['body'][_0xe0c2('0x66')]||_0x2c2248[_0xe0c2('0x67')]['id'];_0x4bb479[_0xe0c2('0x68')]['id']=_0x2c2248['body']['UserId'];return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x2c2248[_0xe0c2('0x57')]['id'],'UserId':null}})[_0xe0c2('0x22')](handleEntityNotFound(_0x59b145,null))['then'](saveUpdates(_0x2c2248['body'],null))[_0xe0c2('0x22')](function(_0x48ef72){if(_0x48ef72){_0x4bb479[_0xe0c2('0x2b')]=_0x48ef72['get']({'plain':!![]});return db[_0xe0c2('0x69')]['find']({'where':{'id':_0x48ef72[_0xe0c2('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x59b145,null))['then'](function(_0x109ec5){if(_0x109ec5){return _0x109ec5[_0xe0c2('0x37')]({'UserId':_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x66')],'read1stAt':_[_0xe0c2('0x6b')](_0x109ec5[_0xe0c2('0x6c')])?moment()[_0xe0c2('0x64')](_0xe0c2('0x65')):undefined});}return null;})[_0xe0c2('0x22')](function(_0x154e4a){if(_0x154e4a){_0x4bb479[_0xe0c2('0x6d')]=_0x154e4a[_0xe0c2('0x6e')]({'plain':!![]});interaction_log[_0xe0c2('0x23')](_0xe0c2('0x6f'),_0x2c2248[_0xe0c2('0x67')]['id'],_0x2c2248['user'][_0xe0c2('0x3a')],_0x2c2248[_0xe0c2('0x67')]['role'],_0x4bb479[_0xe0c2('0x6d')]['id'],_0x2c2248[_0xe0c2('0x5d')]?JSON['stringify'](_0x2c2248[_0xe0c2('0x5d')]):_0xe0c2('0x70'));return respondWithRpcPromise(_0xe0c2('0x71'),_0xe0c2('0x72'),_0x4bb479);}return null;})[_0xe0c2('0x22')](function(_0x582102){var _0x4c98db=_0xe0c2('0x73')+_0x582102[_0xe0c2('0x2b')][_0xe0c2('0x74')];return db[_0xe0c2('0x75')][_0xe0c2('0x43')](_0x4c98db,{'type':db[_0xe0c2('0x76')][_0xe0c2('0x77')][_0xe0c2('0x78')],'raw':!![]})[_0xe0c2('0x22')](function(_0x26c37d){return _0x26c37d;});})['then'](function(_0x40bf8d){if(_0x40bf8d){_0x4bb479['message'][_0xe0c2('0x79')]=_0x40bf8d[0x0];if(!_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x66')])return;return db[_0xe0c2('0x7a')][_0xe0c2('0x5a')]({'where':{'id':_0x2c2248[_0xe0c2('0x5d')]['UserId'],'role':_0xe0c2('0x68')},'attributes':['id','name','fullname',_0xe0c2('0x7b'),_0xe0c2('0x7c')],'raw':!![]});}return null;})[_0xe0c2('0x22')](function(_0x25cb4d){if(!_0x25cb4d)return null;_0x4bb479[_0xe0c2('0x2b')][_0xe0c2('0x68')]=_0x25cb4d;return _0x4bb479;})[_0xe0c2('0x22')](function(_0x19e97c){if(_0x19e97c){if(_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x7d')]){_0x4bb479[_0xe0c2('0x2b')][_0xe0c2('0x7e')]=util['format']('SIP/%s',_0x2c2248[_0xe0c2('0x67')][_0xe0c2('0x3a')]);_0x4bb479[_0xe0c2('0x2b')][_0xe0c2('0x7f')]=_0x4bb479['channel'];_0x4bb479['message'][_0xe0c2('0x80')]=_0x4bb479[_0xe0c2('0x7f')];_0x4bb479[_0xe0c2('0x2b')]['event']=_0xe0c2('0x60');return respondWithRpcPromise('EventManager',_0xe0c2('0x81'),{'event':'acceptmessage','message':_0x4bb479['message']},client9002)[_0xe0c2('0x22')](function(){return _0x4bb479;});}return _0x4bb479;}return null;})[_0xe0c2('0x22')](respondWithResult(_0x59b145,null))['catch'](handleError(_0x59b145,null));};var interaction_log=require(_0xe0c2('0x13'))('whatsapp-interactions');exports['reject']=function(_0x5b1e6a,_0x470f16,_0xdf2c14){var _0x1fccac={'agent':{},'channel':_0xe0c2('0x61')};if(_0x5b1e6a['body']['id']){delete _0x5b1e6a[_0xe0c2('0x5d')]['id'];}_0x5b1e6a['body'][_0xe0c2('0x66')]=_0x5b1e6a[_0xe0c2('0x5d')]['UserId']||_0x5b1e6a['user']['id'];_0x1fccac['agent']['id']=_0x5b1e6a['body']['UserId'];return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x5b1e6a[_0xe0c2('0x57')]['id'],'UserId':null}})[_0xe0c2('0x22')](handleEntityNotFound(_0x470f16,null))[_0xe0c2('0x22')](function(_0x52e782){if(_0x52e782){_0x1fccac['message']=_0x52e782['get']({'plain':!![]});return db[_0xe0c2('0x69')][_0xe0c2('0x5a')]({'where':{'id':_0x52e782[_0xe0c2('0x6a')]}});}return null;})[_0xe0c2('0x22')](handleEntityNotFound(_0x470f16,null))[_0xe0c2('0x22')](function(_0x13f2c1){if(_0x13f2c1){_0x1fccac[_0xe0c2('0x6d')]=_0x13f2c1[_0xe0c2('0x6e')]({'plain':!![]});interaction_log[_0xe0c2('0x23')](_0xe0c2('0x82'),_0x5b1e6a['user']['id'],_0x5b1e6a['user'][_0xe0c2('0x3a')],_0x5b1e6a['user'][_0xe0c2('0x83')],_0x1fccac['interaction']['id'],_0x5b1e6a[_0xe0c2('0x5d')]?JSON[_0xe0c2('0x28')](_0x5b1e6a[_0xe0c2('0x5d')]):_0xe0c2('0x70'));return respondWithRpcPromise(_0xe0c2('0x84'),_0xe0c2('0x85'),_0x1fccac);}return null;})['then'](function(_0x1bf1d9){var _0x47a663='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1bf1d9[_0xe0c2('0x2b')][_0xe0c2('0x74')];return db[_0xe0c2('0x75')][_0xe0c2('0x43')](_0x47a663,{'type':db[_0xe0c2('0x76')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe0c2('0x22')](function(_0x5be7ac){return _0x5be7ac;});})[_0xe0c2('0x22')](function(_0x31b736){if(_0x31b736){_0x1fccac[_0xe0c2('0x2b')][_0xe0c2('0x79')]=_0x31b736[0x0];if(!_0x5b1e6a[_0xe0c2('0x5d')][_0xe0c2('0x66')])return;return db[_0xe0c2('0x7a')][_0xe0c2('0x5a')]({'where':{'id':_0x5b1e6a[_0xe0c2('0x5d')]['UserId'],'role':_0xe0c2('0x68')},'attributes':['id',_0xe0c2('0x3a'),_0xe0c2('0x86'),_0xe0c2('0x7b'),'internal'],'raw':!![]});}return null;})[_0xe0c2('0x22')](function(_0x3909dd){if(!_0x3909dd)return null;_0x1fccac[_0xe0c2('0x2b')]['agent']=_0x3909dd;return _0x1fccac;})[_0xe0c2('0x22')](function(_0x242f62){if(_0x242f62){_0x242f62['message'][_0xe0c2('0x7e')]=util[_0xe0c2('0x64')](_0xe0c2('0x87'),_0x5b1e6a['user'][_0xe0c2('0x3a')]);_0x242f62[_0xe0c2('0x2b')]['channel']=_0x1fccac[_0xe0c2('0x7f')];_0x242f62[_0xe0c2('0x2b')]['motionChannel']=_0x1fccac['channel'];_0x242f62[_0xe0c2('0x2b')][_0xe0c2('0x88')]='reject';respondWithRpcPromise(_0xe0c2('0x81'),'EventManager',{'event':'rejectmessage','message':_0x242f62[_0xe0c2('0x2b')]},client9002);return _0x1fccac;}return null;})['then'](respondWithResult(_0x470f16,null))['catch'](handleError(_0x470f16,null));};exports[_0xe0c2('0x2e')]=function(_0x2d02f1,_0x11931d,_0x5e1cae){if(_0x2d02f1['body']['id']){delete _0x2d02f1['body']['id'];}var _0x334fbf;return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x2d02f1['params']['id']}})[_0xe0c2('0x22')](handleEntityNotFound(_0x11931d,null))[_0xe0c2('0x22')](function(_0x20df7e){if(_0x20df7e){_0x334fbf=_0x20df7e;return db[_0xe0c2('0x89')][_0xe0c2('0x5a')]({'where':{'id':_0x20df7e[_0xe0c2('0x8a')]}});}})['then'](handleEntityNotFound(_0x11931d,null))[_0xe0c2('0x22')](function(_0x598114){if(_0x598114){logger[_0xe0c2('0x26')](_0xe0c2('0x8b'),_0xe0c2('0x2e'),'received\x20delivery\x20report\x20from',_0x598114[_0xe0c2('0x40')],util[_0xe0c2('0x8c')](_0x2d02f1['body'],{'showHidden':![],'depth':null}));switch(_0x598114[_0xe0c2('0x40')]){case _0xe0c2('0x8d'):if(_0x2d02f1[_0xe0c2('0x5d')]['MessageSid']&&_0x2d02f1['body']['MessageSid']===_0x334fbf[_0xe0c2('0x8e')]&&_0x2d02f1['body'][_0xe0c2('0x8f')]&&_0x2d02f1['body']['MessageStatus']==='read'){return _0x334fbf[_0xe0c2('0x37')]({'read':!![]});}else{logger[_0xe0c2('0x29')](_0xe0c2('0x90'),_0xe0c2('0x2e'),_0xe0c2('0x8d'),util[_0xe0c2('0x8c')](_0x2d02f1[_0xe0c2('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x334fbf;}})[_0xe0c2('0x22')](respondWithResult(_0x11931d,null))[_0xe0c2('0x5b')](handleError(_0x11931d,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 3f1381f..e86861b 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 _0x2b65=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x24bcc4,_0x226525){var _0x2e6411=function(_0x541b84){while(--_0x541b84){_0x24bcc4['push'](_0x24bcc4['shift']());}};_0x2e6411(++_0x226525);}(_0x2b65,0x131));var _0x52b6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x2b65[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require(_0x52b6('0x0'));var WhatsappMessage=require(_0x52b6('0x1'))['db'][_0x52b6('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x52b6('0x3')](0x0);var events={'afterCreate':_0x52b6('0x4'),'afterUpdate':_0x52b6('0x5'),'afterDestroy':_0x52b6('0x6')};function emitEvent(_0x14f639){return function(_0x5582d0,_0x3b8e05,_0x2a1355){WhatsappMessageEvents[_0x52b6('0x7')](_0x14f639+':'+_0x5582d0['id'],_0x5582d0);WhatsappMessageEvents[_0x52b6('0x7')](_0x14f639,_0x5582d0);_0x2a1355(null);};}for(var e in events){if(events[_0x52b6('0x8')](e)){var event=events[e];WhatsappMessage[_0x52b6('0x9')](e,emitEvent(event));}}module[_0x52b6('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x657b=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x657b,0x131));var _0xb657=function(_0x5cb559,_0x5d07ec){_0x5cb559=_0x5cb559-0x0;var _0x414e08=_0x657b[_0x5cb559];return _0x414e08;};'use strict';var EventEmitter=require(_0xb657('0x0'));var WhatsappMessage=require(_0xb657('0x1'))['db'][_0xb657('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb657('0x3')](0x0);var events={'afterCreate':_0xb657('0x4'),'afterUpdate':'update','afterDestroy':_0xb657('0x5')};function emitEvent(_0xa41497){return function(_0x5da1bc,_0x175072,_0x322e57){WhatsappMessageEvents[_0xb657('0x6')](_0xa41497+':'+_0x5da1bc['id'],_0x5da1bc);WhatsappMessageEvents[_0xb657('0x6')](_0xa41497,_0x5da1bc);_0x322e57(null);};}for(var e in events){if(events[_0xb657('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb657('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 3584b8e..df65ad8 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 _0x8581=['WhatsappInteractionId','then','createdAt','catch','error','find','type','twilio','authToken','messages','create','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','message_id','update','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne'];(function(_0x27f88b,_0x526bad){var _0x2114f4=function(_0x341508){while(--_0x341508){_0x27f88b['push'](_0x27f88b['shift']());}};_0x2114f4(++_0x526bad);}(_0x8581,0x114));var _0x1858=function(_0x5108d0,_0xdc80a2){_0x5108d0=_0x5108d0-0x0;var _0x3d44e7=_0x8581[_0x5108d0];return _0x3d44e7;};'use strict';var _=require('lodash');var util=require(_0x1858('0x0'));var logger=require(_0x1858('0x1'))('api');var moment=require(_0x1858('0x2'));var BPromise=require('bluebird');var rp=require(_0x1858('0x3'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x1858('0x4'));var rimraf=require('rimraf');var config=require(_0x1858('0x5'));var attributes=require(_0x1858('0x6'));module[_0x1858('0x7')]=function(_0xf0aac3,_0x27db16){return _0xf0aac3[_0x1858('0x8')](_0x1858('0x9'),attributes,{'tableName':_0x1858('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1858('0xb')]},{'name':_0x1858('0xc'),'fields':[_0x1858('0xd')],'type':_0x1858('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42091d,_0x47ff04,_0x5cc182){var _0x264626=_0xf0aac3[_0x1858('0xf')];var _0x2d3d5e=_0x42091d['get']({'plain':!![]});if(_0x2d3d5e['direction'][_0x1858('0x10')]()==='in'||_0x2d3d5e[_0x1858('0x11')]['toLowerCase']()===_0x1858('0x12')&&!_0x2d3d5e[_0x1858('0x13')]&&!_[_0x1858('0x14')](_0x2d3d5e[_0x1858('0x15')])){_0x264626[_0x1858('0x16')][_0x1858('0x17')]({'where':{'id':_0x2d3d5e[_0x1858('0x18')]}})[_0x1858('0x19')](function(_0x1b396a){if(_0x1b396a){_0x1b396a['update']({'lastMsgAt':_0x2d3d5e[_0x1858('0x1a')],'lastMsgDirection':_0x2d3d5e[_0x1858('0x11')][_0x1858('0x10')]()});}})[_0x1858('0x1b')](function(_0x521cee){console[_0x1858('0x1c')](_0x521cee);});}if(_0x2d3d5e['direction']===_0x1858('0x12')&&!_0x2d3d5e[_0x1858('0x13')]){var _0xe776d5;_0x264626['WhatsappAccount'][_0x1858('0x1d')]({'where':{'id':_0x2d3d5e['WhatsappAccountId']},'raw':!![]})['then'](function(_0x57cf77){_0xe776d5=_0x57cf77;if(_0xe776d5&&_0xe776d5[_0x1858('0x1e')]){switch(_0xe776d5[_0x1858('0x1e')]){case _0x1858('0x1f'):var _0x525de8=require(_0x1858('0x1f'));if(_0xe776d5['accountSid']&&_0xe776d5[_0x1858('0x20')]&&_0xe776d5['phone']){var _0x213bf3=new _0x525de8(_0xe776d5['accountSid'],_0xe776d5[_0x1858('0x20')]);_0x213bf3[_0x1858('0x21')][_0x1858('0x22')]({'body':_0x2d3d5e[_0x1858('0xd')],'to':_0x1858('0x23')+_0x2d3d5e['phone'],'from':'whatsapp:'+_0xe776d5[_0x1858('0x24')],'statusCallback':_0xe776d5['remote']+_0x1858('0x25')+_0x2d3d5e['id']+_0x1858('0x26')+_0xe776d5[_0x1858('0x27')]})[_0x1858('0x19')](function(_0x4f14c6){if(_0x4f14c6['sid']){return _0x42091d['update']({'messageId':_0x4f14c6['sid']});}})['catch'](function(_0x734465){logger['error'](_0x1858('0x28'),_0x1858('0x29'),'twilio',util[_0x1858('0x2a')](_0x734465,{'showHidden':![],'depth':null}));});}else{logger[_0x1858('0x1c')](_0x1858('0x28'),_0x1858('0x29'),'twilio',_0x1858('0x2b'));}break;case _0x1858('0x2c'):var _0x32e070=_0xe776d5[_0x1858('0x2d')];var _0x272e76=_0xe776d5[_0x1858('0x20')];var _0x2214b6=_0xe776d5[_0x1858('0x2e')]+_0x1858('0x2f')+_0x32e070+'/messages/';var _0xe32a4f={'to':[_0x2d3d5e[_0x1858('0x24')]],'message':{'type':_0x1858('0x30'),'text':_0x2d3d5e[_0x1858('0xd')]}};var _0x3a7761={'method':_0x1858('0x31'),'uri':_0x2214b6,'headers':{'Authorization':_0x1858('0x32')+_0x272e76,'Content-Type':_0x1858('0x33')},'body':_0xe32a4f,'json':!![]};rp(_0x3a7761)[_0x1858('0x19')](function(_0x10e421){if(_0x10e421['statuses'][0x0][_0x1858('0x34')]){return _0x42091d[_0x1858('0x35')]({'messageId':_0x10e421[_0x1858('0x36')][0x0]['message_id']});}})['catch'](function(_0xebe2e1){logger[_0x1858('0x37')](_0x1858('0x38'),_0xebe2e1);});break;}}})[_0x1858('0x39')](function(){_0x5cc182();});}else{_0x5cc182();}}},'charset':_0x1858('0x3a'),'collate':_0x1858('0x3b')});}; \ No newline at end of file +var _0x7564=['exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','get','toLowerCase','out','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','direction','catch','secret','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','body','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise','node-fetch','path','rimraf','../../config/environment'];(function(_0x42d0b5,_0x1fdfa5){var _0x9dfb43=function(_0x57b6d0){while(--_0x57b6d0){_0x42d0b5['push'](_0x42d0b5['shift']());}};_0x9dfb43(++_0x1fdfa5);}(_0x7564,0xaa));var _0x4756=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x7564[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x4756('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4756('0x1'));var BPromise=require('bluebird');var rp=require(_0x4756('0x2'));var fetch=require(_0x4756('0x3'));var fs=require('fs');var path=require(_0x4756('0x4'));var rimraf=require(_0x4756('0x5'));var config=require(_0x4756('0x6'));var attributes=require('./whatsappMessage.attributes');module[_0x4756('0x7')]=function(_0x5bd7fd,_0x2e6628){return _0x5bd7fd[_0x4756('0x8')](_0x4756('0x9'),attributes,{'tableName':_0x4756('0xa'),'paranoid':![],'indexes':[{'name':_0x4756('0xb'),'fields':['messageId']},{'name':_0x4756('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x295eb7,_0x6f387e,_0x407bba){var _0x5207ee=_0x5bd7fd['models'];var _0x4c10b6=_0x295eb7[_0x4756('0xd')]({'plain':!![]});if(_0x4c10b6['direction'][_0x4756('0xe')]()==='in'||_0x4c10b6['direction'][_0x4756('0xe')]()===_0x4756('0xf')&&!_0x4c10b6['secret']&&!_[_0x4756('0x10')](_0x4c10b6['UserId'])){_0x5207ee[_0x4756('0x11')][_0x4756('0x12')]({'where':{'id':_0x4c10b6[_0x4756('0x13')]}})[_0x4756('0x14')](function(_0x1dff5a){if(_0x1dff5a){_0x1dff5a[_0x4756('0x15')]({'lastMsgAt':_0x4c10b6[_0x4756('0x16')],'lastMsgDirection':_0x4c10b6[_0x4756('0x17')][_0x4756('0xe')]()});}})[_0x4756('0x18')](function(_0x54fb63){console['error'](_0x54fb63);});}if(_0x4c10b6[_0x4756('0x17')]===_0x4756('0xf')&&!_0x4c10b6[_0x4756('0x19')]){var _0x504a79;_0x5207ee[_0x4756('0x1a')]['find']({'where':{'id':_0x4c10b6[_0x4756('0x1b')]},'raw':!![]})['then'](function(_0x7c1759){_0x504a79=_0x7c1759;if(_0x504a79&&_0x504a79[_0x4756('0x1c')]){switch(_0x504a79[_0x4756('0x1c')]){case _0x4756('0x1d'):var _0x2e8a49=require(_0x4756('0x1d'));if(_0x504a79[_0x4756('0x1e')]&&_0x504a79[_0x4756('0x1f')]&&_0x504a79[_0x4756('0x20')]){var _0x2c13b3=new _0x2e8a49(_0x504a79[_0x4756('0x1e')],_0x504a79['authToken']);_0x2c13b3[_0x4756('0x21')][_0x4756('0x22')]({'body':_0x4c10b6['body'],'to':_0x4756('0x23')+_0x4c10b6['phone'],'from':'whatsapp:'+_0x504a79[_0x4756('0x20')],'statusCallback':_0x504a79[_0x4756('0x24')]+_0x4756('0x25')+_0x4c10b6['id']+_0x4756('0x26')+_0x504a79[_0x4756('0x27')]})[_0x4756('0x14')](function(_0x5daea7){if(_0x5daea7['sid']){return _0x295eb7['update']({'messageId':_0x5daea7[_0x4756('0x28')]});}})[_0x4756('0x18')](function(_0xb1d19b){logger['error'](_0x4756('0x29'),_0x4756('0x2a'),_0x4756('0x1d'),util[_0x4756('0x2b')](_0xb1d19b,{'showHidden':![],'depth':null}));});}else{logger[_0x4756('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0x4756('0x2d'));}break;case _0x4756('0x2e'):var _0x4aaaf8=_0x504a79[_0x4756('0x1e')];var _0x181f69=_0x504a79[_0x4756('0x1f')];var _0x5a98da=_0x504a79['baseUrl']+_0x4756('0x2f')+_0x4aaaf8+_0x4756('0x30');var _0x3ff88b={'to':[_0x4c10b6[_0x4756('0x20')]],'message':{'type':'text','text':_0x4c10b6[_0x4756('0x31')]}};var _0x13c70f={'method':_0x4756('0x32'),'uri':_0x5a98da,'headers':{'Authorization':_0x4756('0x33')+_0x181f69,'Content-Type':_0x4756('0x34')},'body':_0x3ff88b,'json':!![]};rp(_0x13c70f)['then'](function(_0x2c6297){if(_0x2c6297[_0x4756('0x35')][0x0][_0x4756('0x36')]){return _0x295eb7[_0x4756('0x15')]({'messageId':_0x2c6297['statuses'][0x0][_0x4756('0x36')]});}})[_0x4756('0x18')](function(_0x29ed2b){logger[_0x4756('0x37')]('WhatsappMessage,\x20%s',_0x29ed2b);});break;}}})[_0x4756('0x38')](function(){_0x407bba();});}else{_0x407bba();}}},'charset':_0x4756('0x39'),'collate':_0x4756('0x3a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index c77fe74..4ffc7b6 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 _0xfe9f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','create','body','options','raw','then','lodash','util','moment','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe9f,0xa6));var _0xffe9=function(_0x1aff13,_0x1b1f60){_0x1aff13=_0x1aff13-0x0;var _0x46921c=_0xfe9f[_0x1aff13];return _0x46921c;};'use strict';var _=require(_0xffe9('0x0'));var util=require(_0xffe9('0x1'));var moment=require(_0xffe9('0x2'));var BPromise=require('bluebird');var rs=require(_0xffe9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffe9('0x4'))['db'];var utils=require(_0xffe9('0x5'));var logger=require(_0xffe9('0x6'))('rpc');var config=require(_0xffe9('0x7'));var jayson=require(_0xffe9('0x8'));var client=jayson['client'][_0xffe9('0x9')]({'port':0x232a});config[_0xffe9('0xa')]=_[_0xffe9('0xb')](config[_0xffe9('0xa')],{'host':_0xffe9('0xc'),'port':0x18eb});var socket=require(_0xffe9('0xd'))(new Redis(config[_0xffe9('0xa')]));require(_0xffe9('0xe'))[_0xffe9('0xf')](socket);function respondWithRpcPromise(_0x40b9b4,_0x478a36,_0x161e6a){return new BPromise(function(_0x48b83b,_0x5d13d9){return client[_0xffe9('0x10')](_0x40b9b4,_0x161e6a)['then'](function(_0x6a31a3){logger[_0xffe9('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x478a36,_0xffe9('0x12'));logger[_0xffe9('0x13')](_0xffe9('0x14'),_0x478a36,'request\x20sent',JSON[_0xffe9('0x15')](_0x6a31a3));if(_0x6a31a3[_0xffe9('0x16')]){if(_0x6a31a3[_0xffe9('0x16')][_0xffe9('0x17')]===0x1f4){logger[_0xffe9('0x16')](_0xffe9('0x18'),_0x478a36,_0x6a31a3[_0xffe9('0x16')]['message']);return _0x5d13d9(_0x6a31a3['error']['message']);}logger['error'](_0xffe9('0x18'),_0x478a36,_0x6a31a3['error'][_0xffe9('0x19')]);return _0x48b83b(_0x6a31a3[_0xffe9('0x16')][_0xffe9('0x19')]);}else{logger[_0xffe9('0x11')](_0xffe9('0x18'),_0x478a36,_0xffe9('0x12'));_0x48b83b(_0x6a31a3[_0xffe9('0x1a')][_0xffe9('0x19')]);}})[_0xffe9('0x1b')](function(_0x3555cc){logger[_0xffe9('0x16')](_0xffe9('0x18'),_0x478a36,_0x3555cc);_0x5d13d9(_0x3555cc);});});}exports[_0xffe9('0x1c')]=function(_0x90bc0c){var _0x16c8c4=this;return new Promise(function(_0x35b6bf,_0x2675ca){return db['WhatsappMessage'][_0xffe9('0x1d')](_0x90bc0c[_0xffe9('0x1e')],{'raw':_0x90bc0c['options']?_0x90bc0c[_0xffe9('0x1f')][_0xffe9('0x20')]===undefined?!![]:![]:!![]})[_0xffe9('0x21')](function(_0x9d772f){logger['info'](_0xffe9('0x1c'),_0x90bc0c);logger[_0xffe9('0x13')]('CreateWhatsappMessage',_0x90bc0c,JSON[_0xffe9('0x15')](_0x9d772f));_0x35b6bf(_0x9d772f);})['catch'](function(_0x469044){logger[_0xffe9('0x16')](_0xffe9('0x1c'),_0x469044[_0xffe9('0x19')],_0x90bc0c);_0x2675ca(_0x16c8c4[_0xffe9('0x16')](0x1f4,_0x469044[_0xffe9('0x19')]));});});}; \ No newline at end of file +var _0x5553=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','lodash','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5553,0xa6));var _0x3555=function(_0x3fbd49,_0x3974f5){_0x3fbd49=_0x3fbd49-0x0;var _0xf0fbd4=_0x5553[_0x3fbd49];return _0xf0fbd4;};'use strict';var _=require(_0x3555('0x0'));var util=require('util');var moment=require(_0x3555('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3555('0x2'));var logger=require(_0x3555('0x3'))('rpc');var config=require(_0x3555('0x4'));var jayson=require(_0x3555('0x5'));var client=jayson[_0x3555('0x6')][_0x3555('0x7')]({'port':0x232a});config[_0x3555('0x8')]=_[_0x3555('0x9')](config[_0x3555('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3555('0xa'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x3555('0xb')](socket);function respondWithRpcPromise(_0x388fab,_0x19380a,_0x2da8bc){return new BPromise(function(_0x2a4619,_0x31d0c2){return client[_0x3555('0xc')](_0x388fab,_0x2da8bc)[_0x3555('0xd')](function(_0x240813){logger['info'](_0x3555('0xe'),_0x19380a,_0x3555('0xf'));logger[_0x3555('0x10')](_0x3555('0x11'),_0x19380a,_0x3555('0xf'),JSON[_0x3555('0x12')](_0x240813));if(_0x240813['error']){if(_0x240813['error'][_0x3555('0x13')]===0x1f4){logger[_0x3555('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x19380a,_0x240813[_0x3555('0x14')]['message']);return _0x31d0c2(_0x240813[_0x3555('0x14')]['message']);}logger[_0x3555('0x14')](_0x3555('0xe'),_0x19380a,_0x240813['error'][_0x3555('0x15')]);return _0x2a4619(_0x240813[_0x3555('0x14')]['message']);}else{logger[_0x3555('0x16')](_0x3555('0xe'),_0x19380a,'request\x20sent');_0x2a4619(_0x240813[_0x3555('0x17')]['message']);}})[_0x3555('0x18')](function(_0x357e8b){logger[_0x3555('0x14')](_0x3555('0xe'),_0x19380a,_0x357e8b);_0x31d0c2(_0x357e8b);});});}exports[_0x3555('0x19')]=function(_0x31088e){var _0x5bc2df=this;return new Promise(function(_0x22688a,_0x29328b){return db[_0x3555('0x1a')]['create'](_0x31088e[_0x3555('0x1b')],{'raw':_0x31088e[_0x3555('0x1c')]?_0x31088e[_0x3555('0x1c')][_0x3555('0x1d')]===undefined?!![]:![]:!![]})[_0x3555('0xd')](function(_0x2c61f1){logger[_0x3555('0x16')]('CreateWhatsappMessage',_0x31088e);logger[_0x3555('0x10')]('CreateWhatsappMessage',_0x31088e,JSON[_0x3555('0x12')](_0x2c61f1));_0x22688a(_0x2c61f1);})[_0x3555('0x18')](function(_0x91866c){logger['error'](_0x3555('0x19'),_0x91866c[_0x3555('0x15')],_0x31088e);_0x29328b(_0x5bc2df['error'](0x1f4,_0x91866c[_0x3555('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 18df657..6064d36 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 _0xb4d3=['whatsappMessage:','save','removeListener','register','length'];(function(_0x454ce1,_0x37f36a){var _0x52693d=function(_0x3b9b6d){while(--_0x3b9b6d){_0x454ce1['push'](_0x454ce1['shift']());}};_0x52693d(++_0x37f36a);}(_0xb4d3,0x65));var _0x3b4d=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0xb4d3[_0x152449];return _0x5b58b2;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x3b4d('0x0'),'remove','update'];function createListener(_0x526bc0,_0x459d7d){return function(_0x12af94){_0x459d7d['emit'](_0x526bc0,_0x12af94);};}function removeListener(_0x368922,_0x4c144a){return function(){WhatsappMessageEvents[_0x3b4d('0x1')](_0x368922,_0x4c144a);};}exports[_0x3b4d('0x2')]=function(_0x1cf90b){for(var _0x1ed5b0=0x0,_0x347680=events[_0x3b4d('0x3')];_0x1ed5b0<_0x347680;_0x1ed5b0++){var _0x458810=events[_0x1ed5b0];var _0x2f2b07=createListener(_0x3b4d('0x4')+_0x458810,_0x1cf90b);WhatsappMessageEvents['on'](_0x458810,_0x2f2b07);}}; \ No newline at end of file +var _0x5b5d=['./whatsappMessage.events','save','update','emit','removeListener','register','length'];(function(_0x427bd4,_0x4c2aa2){var _0x46c675=function(_0x109076){while(--_0x109076){_0x427bd4['push'](_0x427bd4['shift']());}};_0x46c675(++_0x4c2aa2);}(_0x5b5d,0x1dc));var _0xd5b5=function(_0x460e12,_0x335b3f){_0x460e12=_0x460e12-0x0;var _0x367951=_0x5b5d[_0x460e12];return _0x367951;};'use strict';var WhatsappMessageEvents=require(_0xd5b5('0x0'));var events=[_0xd5b5('0x1'),'remove',_0xd5b5('0x2')];function createListener(_0x1f6ca8,_0x4dec38){return function(_0x1f71e6){_0x4dec38[_0xd5b5('0x3')](_0x1f6ca8,_0x1f71e6);};}function removeListener(_0x4daca2,_0x4a9c5a){return function(){WhatsappMessageEvents[_0xd5b5('0x4')](_0x4daca2,_0x4a9c5a);};}exports[_0xd5b5('0x5')]=function(_0x351f75){for(var _0x15080a=0x0,_0x44934d=events[_0xd5b5('0x6')];_0x15080a<_0x44934d;_0x15080a++){var _0x2136d4=events[_0x15080a];var _0x4d5d4d=createListener('whatsappMessage:'+_0x2136d4,_0x351f75);WhatsappMessageEvents['on'](_0x2136d4,_0x4d5d4d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 0111cdb..e8e52ef 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 _0x165a=['put','destroy','delete','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents'];(function(_0x1b833e,_0x2d356f){var _0x315218=function(_0x4c928a){while(--_0x4c928a){_0x1b833e['push'](_0x1b833e['shift']());}};_0x315218(++_0x2d356f);}(_0x165a,0xd8));var _0xa165=function(_0x18f6f7,_0x418bc4){_0x18f6f7=_0x18f6f7-0x0;var _0x57970b=_0x165a[_0x18f6f7];return _0x57970b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa165('0x0'));var timeout=require(_0xa165('0x1'));var express=require(_0xa165('0x2'));var router=express[_0xa165('0x3')]();var fs_extra=require(_0xa165('0x4'));var auth=require(_0xa165('0x5'));var interaction=require(_0xa165('0x6'));var config=require(_0xa165('0x7'));var controller=require('./whatsappQueue.controller');router[_0xa165('0x8')]('/',auth[_0xa165('0x9')](),controller[_0xa165('0xa')]);router[_0xa165('0x8')](_0xa165('0xb'),auth['isAuthenticated'](),controller[_0xa165('0xc')]);router[_0xa165('0x8')](_0xa165('0xd'),auth[_0xa165('0x9')](),controller[_0xa165('0xe')]);router['get'](_0xa165('0xf'),auth[_0xa165('0x9')](),controller[_0xa165('0x10')]);router[_0xa165('0x8')](_0xa165('0x11'),auth[_0xa165('0x9')](),controller[_0xa165('0x12')]);router[_0xa165('0x8')](_0xa165('0x13'),auth[_0xa165('0x9')](),controller[_0xa165('0x14')]);router[_0xa165('0x15')]('/',auth['isAuthenticated'](),controller[_0xa165('0x16')]);router['post']('/:id/teams',auth[_0xa165('0x9')](),controller['addTeams']);router[_0xa165('0x15')](_0xa165('0x13'),auth[_0xa165('0x9')](),controller[_0xa165('0x17')]);router[_0xa165('0x18')](_0xa165('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa165('0xd'),auth[_0xa165('0x9')](),controller[_0xa165('0x19')]);router[_0xa165('0x1a')]('/:id/teams',auth[_0xa165('0x9')](),controller[_0xa165('0x1b')]);router[_0xa165('0x1a')](_0xa165('0x13'),auth[_0xa165('0x9')](),controller[_0xa165('0x1c')]);module[_0xa165('0x1d')]=router; \ No newline at end of file +var _0xc718=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc718,0x1e9));var _0x8c71=function(_0x3b9388,_0xc4ab13){_0x3b9388=_0x3b9388-0x0;var _0x3d82d2=_0xc718[_0x3b9388];return _0x3d82d2;};'use strict';var multer=require(_0x8c71('0x0'));var util=require(_0x8c71('0x1'));var path=require(_0x8c71('0x2'));var timeout=require(_0x8c71('0x3'));var express=require('express');var router=express[_0x8c71('0x4')]();var fs_extra=require(_0x8c71('0x5'));var auth=require(_0x8c71('0x6'));var interaction=require(_0x8c71('0x7'));var config=require(_0x8c71('0x8'));var controller=require('./whatsappQueue.controller');router[_0x8c71('0x9')]('/',auth[_0x8c71('0xa')](),controller[_0x8c71('0xb')]);router['get'](_0x8c71('0xc'),auth['isAuthenticated'](),controller[_0x8c71('0xd')]);router[_0x8c71('0x9')](_0x8c71('0xe'),auth['isAuthenticated'](),controller[_0x8c71('0xf')]);router[_0x8c71('0x9')](_0x8c71('0x10'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x11')]);router['get'](_0x8c71('0x12'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x13')]);router['get'](_0x8c71('0x14'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x15')]);router[_0x8c71('0x16')]('/',auth[_0x8c71('0xa')](),controller['create']);router[_0x8c71('0x16')]('/:id/teams',auth[_0x8c71('0xa')](),controller[_0x8c71('0x17')]);router['post'](_0x8c71('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x8c71('0x18')](_0x8c71('0xe'),auth['isAuthenticated'](),controller[_0x8c71('0x19')]);router[_0x8c71('0x1a')](_0x8c71('0xe'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x1b')]);router['delete'](_0x8c71('0x12'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x1c')]);router[_0x8c71('0x1a')](_0x8c71('0x14'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x1d')]);module[_0x8c71('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index bd103dd..e947326 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 _0x95c5=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING','sequelize','exports','name'];(function(_0x42e582,_0x24966d){var _0x1c51ef=function(_0x4bc07b){while(--_0x4bc07b){_0x42e582['push'](_0x42e582['shift']());}};_0x1c51ef(++_0x24966d);}(_0x95c5,0x153));var _0x595c=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0x95c5[_0x32bb6b];return _0x58dcb4;};'use strict';var Sequelize=require(_0x595c('0x0'));module[_0x595c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x595c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x595c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x595c('0x4')](_0x595c('0x5'),_0x595c('0x6'),_0x595c('0x7'))},'description':{'type':Sequelize[_0x595c('0x8')]}}; \ No newline at end of file +var _0xa101=['STRING','sequelize','exports','name','INTEGER','rrmemory','beepall'];(function(_0x186591,_0x4b9f84){var _0x52353b=function(_0x16105a){while(--_0x16105a){_0x186591['push'](_0x186591['shift']());}};_0x52353b(++_0x4b9f84);}(_0xa101,0x15f));var _0x1a10=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0xa101[_0x2b1551];return _0x2fc2a1;};'use strict';var Sequelize=require(_0x1a10('0x0'));module[_0x1a10('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1a10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1a10('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1a10('0x4'),_0x1a10('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x1a10('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index cddb6f6..f0edcb3 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 _0x4c8a=['emit','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','findOne','bluebird','lodash','squel','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','end','status','json','offset','undefined','count','update','destroy','then','get','WhatsappQueues','UserProfileResource','sendStatus','name','index','WhatsappQueue','rawAttributes','key','where','include','query','findAll','catch','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','body','describe','getMembers','UserWhatsappQueue','hasOwnProperty','nolimit','limit','order','sort','filter','options','User','map','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','whatsappPause','getTeams','pick','addTeams','Agents','online','voicePause','interface','flatMap','each','forEach','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','every','includes','all','union','compact','transaction','removeAgents'];(function(_0xfb0ed5,_0x8835b4){var _0x56f5a9=function(_0x1f058d){while(--_0x1f058d){_0xfb0ed5['push'](_0xfb0ed5['shift']());}};_0x56f5a9(++_0x8835b4);}(_0x4c8a,0x1d3));var _0xa4c8=function(_0xfaa896,_0x30e4bf){_0xfaa896=_0xfaa896-0x0;var _0x5ba760=_0x4c8a[_0xfaa896];return _0x5ba760;};'use strict';var BPromise=require(_0xa4c8('0x0'));var util=require('util');var _=require(_0xa4c8('0x1'));var squel=require(_0xa4c8('0x2'));var Redis=require('ioredis');var qs=require(_0xa4c8('0x3'));var logger=require(_0xa4c8('0x4'))('api');var config=require('../../config/environment');var db=require(_0xa4c8('0x5'))['db'];config[_0xa4c8('0x6')]=_[_0xa4c8('0x7')](config[_0xa4c8('0x6')],{'host':_0xa4c8('0x8'),'port':0x18eb});var socket=require(_0xa4c8('0x9'))(new Redis(config['redis']));require(_0xa4c8('0xa'))[_0xa4c8('0xb')](socket);function respondWithStatusCode(_0x3deecb,_0x4ac2ad){_0x4ac2ad=_0x4ac2ad||0xcc;return function(_0x42883b){if(_0x42883b){return _0x3deecb['sendStatus'](_0x4ac2ad);}return _0x3deecb['status'](_0x4ac2ad)[_0xa4c8('0xc')]();};}function respondWithResult(_0x4ce081,_0x58ca52){_0x58ca52=_0x58ca52||0xc8;return function(_0x408cba){if(_0x408cba){return _0x4ce081[_0xa4c8('0xd')](_0x58ca52)[_0xa4c8('0xe')](_0x408cba);}};}function respondWithFilteredResult(_0x2984e4,_0x19b997){return function(_0x3a9e77){if(_0x3a9e77){var _0x4859fb=typeof _0x19b997[_0xa4c8('0xf')]==='undefined'&&typeof _0x19b997['limit']===_0xa4c8('0x10');var _0x3f1b5e=_0x3a9e77['count'];var _0x505592=_0x4859fb?0x0:_0x19b997[_0xa4c8('0xf')];var _0x1777a4=_0x4859fb?_0x3a9e77[_0xa4c8('0x11')]:_0x19b997['offset']+_0x19b997['limit'];var _0x110006;if(_0x1777a4>=_0x3f1b5e){_0x1777a4=_0x3f1b5e;_0x110006=0xc8;}else{_0x110006=0xce;}_0x2984e4[_0xa4c8('0xd')](_0x110006);return _0x2984e4['set']('Content-Range',_0x505592+'-'+_0x1777a4+'/'+_0x3f1b5e)['json'](_0x3a9e77);}return null;};}function saveUpdates(_0x17587d){return function(_0x8da814){if(_0x8da814){return _0x8da814[_0xa4c8('0x12')](_0x17587d)['then'](function(_0x48c861){return _0x48c861;});}return null;};}function removeEntity(_0x2376db){return function(_0x2dbe6e){if(_0x2dbe6e){return _0x2dbe6e[_0xa4c8('0x13')]()[_0xa4c8('0x14')](function(){var _0x25f38f=_0x2dbe6e[_0xa4c8('0x15')]({'plain':!![]});var _0x1cce1b=_0xa4c8('0x16');return db[_0xa4c8('0x17')][_0xa4c8('0x13')]({'where':{'type':_0x1cce1b,'resourceId':_0x25f38f['id']}})[_0xa4c8('0x14')](function(){return _0x2dbe6e;});})[_0xa4c8('0x14')](function(){_0x2376db[_0xa4c8('0xd')](0xcc)[_0xa4c8('0xc')]();});}};}function handleEntityNotFound(_0x1637d4){return function(_0x4a77b9){if(!_0x4a77b9){_0x1637d4[_0xa4c8('0x18')](0x194);}return _0x4a77b9;};}function handleError(_0x2f0651,_0x4dfd52){_0x4dfd52=_0x4dfd52||0x1f4;return function(_0x60e1ba){logger['error'](_0x60e1ba['stack']);if(_0x60e1ba[_0xa4c8('0x19')]){delete _0x60e1ba[_0xa4c8('0x19')];}_0x2f0651['status'](_0x4dfd52)['send'](_0x60e1ba);};}exports[_0xa4c8('0x1a')]=function(_0x47c1b2,_0x37ed3b){var _0x1ad4db={};var _0x1cd102={'count':0x0,'rows':[]};var _0x1b3541=_['map'](db[_0xa4c8('0x1b')][_0xa4c8('0x1c')],function(_0x365982){return{'name':_0x365982['fieldName'],'type':_0x365982['type'][_0xa4c8('0x1d')]};});_0x1ad4db=qs['getOptions'](_0x1b3541,_0x47c1b2);var _0x308fa0={'where':_0x1ad4db[_0xa4c8('0x1e')]};return db[_0xa4c8('0x1b')][_0xa4c8('0x11')](_0x308fa0)['then'](function(_0x2d7926){_0x1cd102['count']=_0x2d7926;_0x1ad4db[_0xa4c8('0x1f')]=qs[_0xa4c8('0x1f')](_0x47c1b2[_0xa4c8('0x20')]);return db[_0xa4c8('0x1b')][_0xa4c8('0x21')](_0x1ad4db);})[_0xa4c8('0x14')](function(_0x2942ed){_0x1cd102['rows']=_0x2942ed;return _0x1cd102;})[_0xa4c8('0x14')](respondWithFilteredResult(_0x37ed3b,_0x1ad4db))[_0xa4c8('0x22')](handleError(_0x37ed3b,null));};exports[_0xa4c8('0x23')]=function(_0x4d251c,_0x27f14c){var _0x263b64={'raw':!![],'where':{'id':_0x4d251c[_0xa4c8('0x24')]['id']}},_0x250691={};_0x250691[_0xa4c8('0x25')]=_[_0xa4c8('0x26')](db['WhatsappQueue']['rawAttributes']);_0x250691[_0xa4c8('0x20')]=_[_0xa4c8('0x26')](_0x4d251c[_0xa4c8('0x20')]);_0x250691[_0xa4c8('0x27')]=_['intersection'](_0x250691[_0xa4c8('0x25')],_0x250691[_0xa4c8('0x20')]);_0x263b64[_0xa4c8('0x28')]=_[_0xa4c8('0x29')](_0x250691['model'],qs['fields'](_0x4d251c[_0xa4c8('0x20')][_0xa4c8('0x2a')]));_0x263b64[_0xa4c8('0x28')]=_0x263b64[_0xa4c8('0x28')][_0xa4c8('0x2b')]?_0x263b64[_0xa4c8('0x28')]:_0x250691['model'];if(_0x4d251c[_0xa4c8('0x20')][_0xa4c8('0x2c')]){_0x263b64[_0xa4c8('0x1f')]=[{'all':!![]}];}_0x263b64=_[_0xa4c8('0x2d')]({},_0x263b64,_0x4d251c['options']);return db[_0xa4c8('0x1b')]['find'](_0x263b64)[_0xa4c8('0x14')](handleEntityNotFound(_0x27f14c,null))[_0xa4c8('0x14')](respondWithResult(_0x27f14c,null))[_0xa4c8('0x22')](handleError(_0x27f14c,null));};exports[_0xa4c8('0x2e')]=function(_0x2b79fb,_0x4d3ed9){return db[_0xa4c8('0x1b')][_0xa4c8('0x2e')](_0x2b79fb['body'],{})[_0xa4c8('0x14')](function(_0x36c875){var _0x2b70d1=_0x2b79fb[_0xa4c8('0x2f')][_0xa4c8('0x15')]({'plain':!![]});if(!_0x2b70d1)throw new Error(_0xa4c8('0x30'));if(_0x2b70d1[_0xa4c8('0x31')]==='user'){var _0x5e2fa8=_0x36c875['get']({'plain':!![]});var _0x508882=_0xa4c8('0x16');return db['UserProfileSection'][_0xa4c8('0x32')]({'where':{'name':_0x508882,'userProfileId':_0x2b70d1[_0xa4c8('0x33')]},'raw':!![]})['then'](function(_0x5a990b){if(_0x5a990b&&_0x5a990b[_0xa4c8('0x34')]===0x0){return db[_0xa4c8('0x17')][_0xa4c8('0x2e')]({'name':_0x5e2fa8[_0xa4c8('0x19')],'resourceId':_0x5e2fa8['id'],'type':_0x5a990b['name'],'sectionId':_0x5a990b['id']},{})[_0xa4c8('0x14')](function(){return _0x36c875;});}else{return _0x36c875;}})[_0xa4c8('0x22')](function(_0xbf202){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbf202);throw _0xbf202;});}return _0x36c875;})[_0xa4c8('0x14')](respondWithResult(_0x4d3ed9,0xc9))[_0xa4c8('0x22')](handleError(_0x4d3ed9,null));};exports[_0xa4c8('0x12')]=function(_0x19d643,_0x125ad6){if(_0x19d643[_0xa4c8('0x35')]['id']){delete _0x19d643[_0xa4c8('0x35')]['id'];}return db[_0xa4c8('0x1b')][_0xa4c8('0x32')]({'where':{'id':_0x19d643[_0xa4c8('0x24')]['id']}})['then'](handleEntityNotFound(_0x125ad6,null))[_0xa4c8('0x14')](saveUpdates(_0x19d643[_0xa4c8('0x35')],null))['then'](respondWithResult(_0x125ad6,null))[_0xa4c8('0x22')](handleError(_0x125ad6,null));};exports[_0xa4c8('0x13')]=function(_0x541465,_0x129581){return db[_0xa4c8('0x1b')][_0xa4c8('0x32')]({'where':{'id':_0x541465['params']['id']}})[_0xa4c8('0x14')](handleEntityNotFound(_0x129581,null))['then'](removeEntity(_0x129581,null))['catch'](handleError(_0x129581,null));};exports[_0xa4c8('0x36')]=function(_0x1b47e6,_0x128c5f){return db[_0xa4c8('0x1b')]['describe']()[_0xa4c8('0x14')](respondWithResult(_0x128c5f,null))['catch'](handleError(_0x128c5f,null));};exports[_0xa4c8('0x37')]=function(_0x57825e,_0x5e8a15){var _0x3dccce={'raw':!![],'where':{}},_0x33ba7e={},_0x192eac;return db[_0xa4c8('0x1b')]['findOne']({'where':{'id':_0x57825e[_0xa4c8('0x24')]['id']}})[_0xa4c8('0x14')](handleEntityNotFound(_0x5e8a15,null))[_0xa4c8('0x14')](function(_0x1f03b1){if(_0x1f03b1){_0x192eac=_0x1f03b1[_0xa4c8('0x15')]({'plain':!![]});_0x33ba7e['model']=_[_0xa4c8('0x26')](db[_0xa4c8('0x38')][_0xa4c8('0x1c')]);_0x33ba7e['query']=_['keys'](_0x57825e[_0xa4c8('0x20')]);_0x33ba7e['filters']=_[_0xa4c8('0x29')](_0x33ba7e[_0xa4c8('0x25')],_0x33ba7e[_0xa4c8('0x20')]);_0x3dccce[_0xa4c8('0x28')]=_[_0xa4c8('0x29')](_0x33ba7e[_0xa4c8('0x25')],qs['fields'](_0x57825e['query'][_0xa4c8('0x2a')]));_0x3dccce[_0xa4c8('0x28')]=_0x3dccce['attributes'][_0xa4c8('0x2b')]?_0x3dccce[_0xa4c8('0x28')]:_0x33ba7e['model'];if(!_0x57825e[_0xa4c8('0x20')][_0xa4c8('0x39')](_0xa4c8('0x3a'))){_0x3dccce[_0xa4c8('0x3b')]=qs['limit'](_0x57825e[_0xa4c8('0x20')][_0xa4c8('0x3b')]);_0x3dccce[_0xa4c8('0xf')]=qs[_0xa4c8('0xf')](_0x57825e[_0xa4c8('0x20')][_0xa4c8('0xf')]);}_0x3dccce[_0xa4c8('0x3c')]=qs[_0xa4c8('0x3d')](_0x57825e[_0xa4c8('0x20')][_0xa4c8('0x3d')]);_0x3dccce[_0xa4c8('0x1e')]=qs[_0xa4c8('0x27')](_['pick'](_0x57825e[_0xa4c8('0x20')],_0x33ba7e[_0xa4c8('0x27')]));_0x3dccce[_0xa4c8('0x1e')]['WhatsappQueueId']=_0x1f03b1['id'];if(_0x57825e[_0xa4c8('0x20')][_0xa4c8('0x3e')]){_0x3dccce['where']=_[_0xa4c8('0x2d')](_0x3dccce['where'],{'$or':_['map'](_0x3dccce[_0xa4c8('0x28')],function(_0x5253f8){var _0x285361={};_0x285361[_0x5253f8]={'$like':'%'+_0x57825e[_0xa4c8('0x20')][_0xa4c8('0x3e')]+'%'};return _0x285361;})});}_0x3dccce=_['merge']({},_0x3dccce,_0x57825e[_0xa4c8('0x3f')]);return db[_0xa4c8('0x38')][_0xa4c8('0x21')](_0x3dccce);}})[_0xa4c8('0x14')](function(_0x2e0713){if(_0x2e0713){return db[_0xa4c8('0x40')]['findAndCountAll']({'where':{'id':_[_0xa4c8('0x41')](_0x2e0713,_0xa4c8('0x42')),'role':_0xa4c8('0x43')},'attributes':['id',_0xa4c8('0x19'),'whatsappPause',_0xa4c8('0x44'),_0xa4c8('0x45')]});}})['then'](function(_0x1eeced){if(_0x1eeced){return{'count':_0x1eeced[_0xa4c8('0x11')],'rows':_[_0xa4c8('0x41')](_0x1eeced[_0xa4c8('0x46')],function(_0xd09d45){return{'membername':_0xd09d45[_0xa4c8('0x19')],'UserId':_0xd09d45['id'],'queue_name':_0x192eac[_0xa4c8('0x19')],'WhatsappQueueId':_0x192eac['id'],'interface':util[_0xa4c8('0x47')](_0xa4c8('0x48'),_0xa4c8('0x49'),_0xd09d45[_0xa4c8('0x19')]),'penalty':0x0,'paused':_0xd09d45[_0xa4c8('0x4a')],'createdAt':_0xd09d45[_0xa4c8('0x45')],'updatedAt':_0xd09d45[_0xa4c8('0x44')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa4c8('0x14')](respondWithFilteredResult(_0x5e8a15,_0x3dccce))[_0xa4c8('0x22')](handleError(_0x5e8a15,null));};exports[_0xa4c8('0x4b')]=function(_0xd57d12,_0x2aacfc){var _0x10f816={};var _0xae6d9b={};var _0x446261;var _0x2e6849;return db[_0xa4c8('0x1b')]['findOne']({'where':{'id':_0xd57d12['params']['id']}})['then'](handleEntityNotFound(_0x2aacfc,null))[_0xa4c8('0x14')](function(_0x453d4d){if(_0x453d4d){_0x446261=_0x453d4d;_0xae6d9b[_0xa4c8('0x25')]=_['keys'](db['Team'][_0xa4c8('0x1c')]);_0xae6d9b[_0xa4c8('0x20')]=_[_0xa4c8('0x26')](_0xd57d12[_0xa4c8('0x20')]);_0xae6d9b[_0xa4c8('0x27')]=_[_0xa4c8('0x29')](_0xae6d9b['model'],_0xae6d9b[_0xa4c8('0x20')]);_0x10f816['attributes']=_[_0xa4c8('0x29')](_0xae6d9b['model'],qs[_0xa4c8('0x2a')](_0xd57d12['query'][_0xa4c8('0x2a')]));_0x10f816[_0xa4c8('0x28')]=_0x10f816[_0xa4c8('0x28')][_0xa4c8('0x2b')]?_0x10f816[_0xa4c8('0x28')]:_0xae6d9b[_0xa4c8('0x25')];_0x10f816[_0xa4c8('0x3c')]=qs[_0xa4c8('0x3d')](_0xd57d12[_0xa4c8('0x20')][_0xa4c8('0x3d')]);_0x10f816[_0xa4c8('0x1e')]=qs[_0xa4c8('0x27')](_[_0xa4c8('0x4c')](_0xd57d12[_0xa4c8('0x20')],_0xae6d9b[_0xa4c8('0x27')]));if(_0xd57d12['query']['filter']){_0x10f816['where']=_[_0xa4c8('0x2d')](_0x10f816['where'],{'$or':_[_0xa4c8('0x41')](_0x10f816[_0xa4c8('0x28')],function(_0xadf9c8){var _0x416d11={};_0x416d11[_0xadf9c8]={'$like':'%'+_0xd57d12[_0xa4c8('0x20')][_0xa4c8('0x3e')]+'%'};return _0x416d11;})});}_0x10f816=_['merge']({},_0x10f816,_0xd57d12[_0xa4c8('0x3f')]);return _0x446261[_0xa4c8('0x4b')](_0x10f816);}})[_0xa4c8('0x14')](function(_0x36b8af){if(_0x36b8af){_0x2e6849=_0x36b8af[_0xa4c8('0x2b')];if(!_0xd57d12[_0xa4c8('0x20')][_0xa4c8('0x39')]('nolimit')){_0x10f816[_0xa4c8('0x3b')]=qs[_0xa4c8('0x3b')](_0xd57d12[_0xa4c8('0x20')][_0xa4c8('0x3b')]);_0x10f816[_0xa4c8('0xf')]=qs[_0xa4c8('0xf')](_0xd57d12[_0xa4c8('0x20')][_0xa4c8('0xf')]);}return _0x446261[_0xa4c8('0x4b')](_0x10f816);}})['then'](function(_0x5e1387){if(_0x5e1387){return _0x5e1387?{'count':_0x2e6849,'rows':_0x5e1387}:null;}})[_0xa4c8('0x14')](respondWithResult(_0x2aacfc,null))['catch'](handleError(_0x2aacfc,null));};exports[_0xa4c8('0x4d')]=function(_0x1b1091,_0xc2c978){var _0x32f5fe=_0x1b1091[_0xa4c8('0x35')]['ids'];return db['Team'][_0xa4c8('0x21')]({'where':{'id':_0x32f5fe},'attributes':['id'],'include':[{'model':db[_0xa4c8('0x40')],'as':_0xa4c8('0x4e'),'attributes':['id',_0xa4c8('0x19'),_0xa4c8('0x4f'),_0xa4c8('0x50'),_0xa4c8('0x51')],'raw':!![]}]})[_0xa4c8('0x14')](function(_0x171646){if(_0x171646){var _0x1eda01=_[_0xa4c8('0x52')](_0x171646,function(_0x41d437){var _0x36cfd8=_0x41d437[_0xa4c8('0x15')]({'plain':!![]});return _0x36cfd8[_0xa4c8('0x4e')];});return db[_0xa4c8('0x1b')]['find']({'where':{'id':_0x1b1091[_0xa4c8('0x24')]['id']}})[_0xa4c8('0x14')](function(_0x6e8e6f){return db['sequelize']['transaction'](function(_0x3c81be){return _0x6e8e6f[_0xa4c8('0x4d')](_0x32f5fe,{'transaction':_0x3c81be})['then'](function(){return BPromise[_0xa4c8('0x53')](_0x1eda01,function(_0x1d43db){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x1d43db['id'],'WhatsappQueueId':_0x1b1091[_0xa4c8('0x24')]['id']},'transaction':_0x3c81be});});})['then'](function(){_0x1eda01[_0xa4c8('0x54')](function(_0x18383f){socket['emit'](_0xa4c8('0x55'),{'UserId':_0x18383f['id'],'WhatsappQueueId':_0x6e8e6f['id']});});});});});}})[_0xa4c8('0x14')](respondWithStatusCode(_0xc2c978,null))[_0xa4c8('0x22')](handleError(_0xc2c978,null));};exports[_0xa4c8('0x56')]=function(_0x230447,_0x4c76f2){return db['Team']['findAll']({'where':{'id':_0x230447[_0xa4c8('0x20')][_0xa4c8('0x57')]},'attributes':['id'],'include':[{'model':db[_0xa4c8('0x40')],'as':_0xa4c8('0x4e'),'attributes':['id'],'raw':!![]}]})[_0xa4c8('0x14')](handleEntityNotFound(_0x4c76f2,null))[_0xa4c8('0x14')](function(_0x191a8b){var _0x54e49d=_[_0xa4c8('0x41')](_0x191a8b,'id');var _0x30bac2=[];var _0x33222e=[];var _0x3cbc0b=squel[_0xa4c8('0x58')]();_0x3cbc0b[_0xa4c8('0x59')](_0xa4c8('0x5a'))[_0xa4c8('0x5b')](_0xa4c8('0x5c'),'tq')[_0xa4c8('0x5d')]('user_has_teams','ut',_0xa4c8('0x5e'))[_0xa4c8('0x1e')](_0xa4c8('0x5f'),_0x230447[_0xa4c8('0x24')]['id']);for(var _0x306cd6=0x0;_0x306cd6<_0x191a8b[_0xa4c8('0x2b')];_0x306cd6+=0x1){let _0x1086ab=_0x191a8b[_0x306cd6];for(var _0x3a5a7c=0x0;_0x3a5a7c<_0x1086ab['Agents'][_0xa4c8('0x2b')];_0x3a5a7c+=0x1){let _0x3c9b60=_0x1086ab[_0xa4c8('0x4e')][_0x3a5a7c];var _0x192cf6=_0x3cbc0b[_0xa4c8('0x60')]();_0x192cf6['where'](_0xa4c8('0x61'),_0x3c9b60['id']);_0x33222e['push'](db['sequelize'][_0xa4c8('0x20')](_0x192cf6[_0xa4c8('0x62')](),{'type':db[_0xa4c8('0x63')][_0xa4c8('0x64')]['SELECT']})['then'](function(_0x316448){if(_0x316448[_0xa4c8('0x2b')]===0x1){return _0x3c9b60['id'];}else{var _0x6b8288=_[_0xa4c8('0x65')](_[_0xa4c8('0x41')](_0x316448,'TeamId'),function(_0x3f5b20){return _[_0xa4c8('0x66')](_0x54e49d,_0x3f5b20);});if(_0x6b8288){return _0x3c9b60['id'];}}}));}}return BPromise[_0xa4c8('0x67')](_0x33222e)[_0xa4c8('0x14')](function(_0x51b2e8){_0x30bac2=_(_0x30bac2)[_0xa4c8('0x68')](_0x51b2e8)[_0xa4c8('0x69')]()['value']();return db[_0xa4c8('0x1b')]['find']({'where':{'id':_0x230447[_0xa4c8('0x24')]['id']}})['then'](function(_0x47728b){return db[_0xa4c8('0x63')][_0xa4c8('0x6a')](function(_0x52437f){return _0x47728b[_0xa4c8('0x56')](_0x230447[_0xa4c8('0x20')][_0xa4c8('0x57')],{'transaction':_0x52437f})[_0xa4c8('0x14')](function(){if(!_['isEmpty'](_0x30bac2)){return _0x47728b[_0xa4c8('0x6b')](_0x30bac2,{'transaction':_0x52437f});}})[_0xa4c8('0x14')](function(){_0x30bac2['forEach'](function(_0x5d432d){socket[_0xa4c8('0x6c')](_0xa4c8('0x6d'),{'UserId':_0x5d432d,'WhatsappQueueId':_0x47728b['id']});});});});});});})[_0xa4c8('0x14')](respondWithStatusCode(_0x4c76f2,null))[_0xa4c8('0x22')](handleError(_0x4c76f2,null));};exports[_0xa4c8('0x6e')]=function(_0x12659a,_0x17459e){return db[_0xa4c8('0x1b')][_0xa4c8('0x32')]({'where':{'id':_0x12659a[_0xa4c8('0x24')]['id']}})[_0xa4c8('0x14')](handleEntityNotFound(_0x17459e,null))[_0xa4c8('0x14')](function(_0x202376){if(_0x202376){return _0x202376[_0xa4c8('0x6e')](_0x12659a[_0xa4c8('0x35')][_0xa4c8('0x57')],_['omit'](_0x12659a[_0xa4c8('0x35')],['ids','id'])||{})[_0xa4c8('0x6f')](function(_0x3b8e6b){for(var _0xfd142e=0x0;_0xfd142e<_0x12659a[_0xa4c8('0x35')][_0xa4c8('0x57')][_0xa4c8('0x2b')];_0xfd142e+=0x1){socket[_0xa4c8('0x6c')](_0xa4c8('0x55'),{'UserId':Number(_0x12659a[_0xa4c8('0x35')][_0xa4c8('0x57')][_0xfd142e]),'WhatsappQueueId':Number(_0x12659a[_0xa4c8('0x24')]['id'])});}return _0x3b8e6b;});}})[_0xa4c8('0x14')](respondWithResult(_0x17459e,null))[_0xa4c8('0x22')](handleError(_0x17459e,null));};exports[_0xa4c8('0x6b')]=function(_0x2a489e,_0x51bed6){return db[_0xa4c8('0x1b')][_0xa4c8('0x32')]({'where':{'id':_0x2a489e[_0xa4c8('0x24')]['id']}})[_0xa4c8('0x14')](handleEntityNotFound(_0x51bed6,null))[_0xa4c8('0x14')](function(_0x2f3d5d){if(_0x2f3d5d){return _0x2f3d5d[_0xa4c8('0x6b')](_0x2a489e['query'][_0xa4c8('0x57')])[_0xa4c8('0x14')](function(){if(_[_0xa4c8('0x70')](_0x2a489e[_0xa4c8('0x20')][_0xa4c8('0x57')])){for(var _0x4671c8=0x0;_0x4671c8<_0x2a489e[_0xa4c8('0x20')]['ids']['length'];_0x4671c8+=0x1){socket['emit'](_0xa4c8('0x6d'),{'UserId':Number(_0x2a489e['query'][_0xa4c8('0x57')][_0x4671c8]),'WhatsappQueueId':Number(_0x2a489e['params']['id'])});}}else{socket[_0xa4c8('0x6c')](_0xa4c8('0x6d'),{'UserId':Number(_0x2a489e[_0xa4c8('0x20')]['ids']),'WhatsappQueueId':Number(_0x2a489e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x51bed6,null))[_0xa4c8('0x22')](handleError(_0x51bed6,null));};exports[_0xa4c8('0x71')]=function(_0x3f45c3,_0xf260bf){var _0x4f340c={};var _0x581ce8={};var _0x19c03a;var _0x112737;return db[_0xa4c8('0x1b')][_0xa4c8('0x72')]({'where':{'id':_0x3f45c3['params']['id']}})[_0xa4c8('0x14')](handleEntityNotFound(_0xf260bf,null))['then'](function(_0x447e07){if(_0x447e07){_0x19c03a=_0x447e07;_0x581ce8[_0xa4c8('0x25')]=_['keys'](db[_0xa4c8('0x40')]['rawAttributes']);_0x581ce8['query']=_[_0xa4c8('0x26')](_0x3f45c3[_0xa4c8('0x20')]);_0x581ce8[_0xa4c8('0x27')]=_[_0xa4c8('0x29')](_0x581ce8[_0xa4c8('0x25')],_0x581ce8[_0xa4c8('0x20')]);_0x4f340c[_0xa4c8('0x28')]=_[_0xa4c8('0x29')](_0x581ce8['model'],qs[_0xa4c8('0x2a')](_0x3f45c3['query'][_0xa4c8('0x2a')]));_0x4f340c[_0xa4c8('0x28')]=_0x4f340c[_0xa4c8('0x28')]['length']?_0x4f340c[_0xa4c8('0x28')]:_0x581ce8['model'];_0x4f340c[_0xa4c8('0x3c')]=qs[_0xa4c8('0x3d')](_0x3f45c3[_0xa4c8('0x20')][_0xa4c8('0x3d')]);_0x4f340c[_0xa4c8('0x1e')]=qs[_0xa4c8('0x27')](_[_0xa4c8('0x4c')](_0x3f45c3[_0xa4c8('0x20')],_0x581ce8[_0xa4c8('0x27')]));if(_0x3f45c3[_0xa4c8('0x20')]['filter']){_0x4f340c[_0xa4c8('0x1e')]=_[_0xa4c8('0x2d')](_0x4f340c[_0xa4c8('0x1e')],{'$or':_[_0xa4c8('0x41')](_0x4f340c['attributes'],function(_0x48de4e){var _0x138da2={};_0x138da2[_0x48de4e]={'$like':'%'+_0x3f45c3[_0xa4c8('0x20')][_0xa4c8('0x3e')]+'%'};return _0x138da2;})});}_0x4f340c=_[_0xa4c8('0x2d')]({},_0x4f340c,_0x3f45c3[_0xa4c8('0x3f')]);return _0x19c03a[_0xa4c8('0x71')](_0x4f340c);}})[_0xa4c8('0x14')](function(_0x549cf0){if(_0x549cf0){_0x112737=_0x549cf0['length'];if(!_0x3f45c3['query']['hasOwnProperty'](_0xa4c8('0x3a'))){_0x4f340c[_0xa4c8('0x3b')]=qs[_0xa4c8('0x3b')](_0x3f45c3[_0xa4c8('0x20')]['limit']);_0x4f340c[_0xa4c8('0xf')]=qs['offset'](_0x3f45c3[_0xa4c8('0x20')][_0xa4c8('0xf')]);}return _0x19c03a[_0xa4c8('0x71')](_0x4f340c);}})['then'](function(_0x12957a){if(_0x12957a){return _0x12957a?{'count':_0x112737,'rows':_0x12957a}:null;}})['then'](respondWithResult(_0xf260bf,null))[_0xa4c8('0x22')](handleError(_0xf260bf,null));}; \ No newline at end of file +var _0xfebf=['length','includeAll','options','find','catch','create','body','user','role','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappQueueId','filter','merge','map','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','findAll','Agents','online','voicePause','sequelize','transaction','addTeams','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userWhatsappQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','end','status','offset','limit','count','json','update','then','get','WhatsappQueues','destroy','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','params','model','keys','filters','intersection','attributes','fields'];(function(_0xf30c64,_0x37a900){var _0x36287d=function(_0x285927){while(--_0x285927){_0xf30c64['push'](_0xf30c64['shift']());}};_0x36287d(++_0x37a900);}(_0xfebf,0x13c));var _0xffeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebf[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xffeb('0x0'));var util=require(_0xffeb('0x1'));var _=require(_0xffeb('0x2'));var squel=require(_0xffeb('0x3'));var Redis=require(_0xffeb('0x4'));var qs=require(_0xffeb('0x5'));var logger=require(_0xffeb('0x6'))(_0xffeb('0x7'));var config=require(_0xffeb('0x8'));var db=require(_0xffeb('0x9'))['db'];config[_0xffeb('0xa')]=_[_0xffeb('0xb')](config['redis'],{'host':_0xffeb('0xc'),'port':0x18eb});var socket=require(_0xffeb('0xd'))(new Redis(config[_0xffeb('0xa')]));require(_0xffeb('0xe'))['register'](socket);function respondWithStatusCode(_0xf4f2c5,_0x23fc87){_0x23fc87=_0x23fc87||0xcc;return function(_0x2df920){if(_0x2df920){return _0xf4f2c5[_0xffeb('0xf')](_0x23fc87);}return _0xf4f2c5['status'](_0x23fc87)[_0xffeb('0x10')]();};}function respondWithResult(_0x1c6886,_0x297827){_0x297827=_0x297827||0xc8;return function(_0x3e89fe){if(_0x3e89fe){return _0x1c6886[_0xffeb('0x11')](_0x297827)['json'](_0x3e89fe);}};}function respondWithFilteredResult(_0x425823,_0x5b1c48){return function(_0x55b76b){if(_0x55b76b){var _0x4c46df=typeof _0x5b1c48[_0xffeb('0x12')]==='undefined'&&typeof _0x5b1c48[_0xffeb('0x13')]==='undefined';var _0x4ced07=_0x55b76b[_0xffeb('0x14')];var _0x542d8a=_0x4c46df?0x0:_0x5b1c48[_0xffeb('0x12')];var _0x2fa43a=_0x4c46df?_0x55b76b[_0xffeb('0x14')]:_0x5b1c48[_0xffeb('0x12')]+_0x5b1c48[_0xffeb('0x13')];var _0x3ce8c4;if(_0x2fa43a>=_0x4ced07){_0x2fa43a=_0x4ced07;_0x3ce8c4=0xc8;}else{_0x3ce8c4=0xce;}_0x425823[_0xffeb('0x11')](_0x3ce8c4);return _0x425823['set']('Content-Range',_0x542d8a+'-'+_0x2fa43a+'/'+_0x4ced07)[_0xffeb('0x15')](_0x55b76b);}return null;};}function saveUpdates(_0x442d59){return function(_0x5d02c9){if(_0x5d02c9){return _0x5d02c9[_0xffeb('0x16')](_0x442d59)[_0xffeb('0x17')](function(_0x383129){return _0x383129;});}return null;};}function removeEntity(_0x53f453){return function(_0x219c0c){if(_0x219c0c){return _0x219c0c['destroy']()[_0xffeb('0x17')](function(){var _0x309ca2=_0x219c0c[_0xffeb('0x18')]({'plain':!![]});var _0x46b951=_0xffeb('0x19');return db['UserProfileResource'][_0xffeb('0x1a')]({'where':{'type':_0x46b951,'resourceId':_0x309ca2['id']}})[_0xffeb('0x17')](function(){return _0x219c0c;});})[_0xffeb('0x17')](function(){_0x53f453['status'](0xcc)[_0xffeb('0x10')]();});}};}function handleEntityNotFound(_0x3ae3e4){return function(_0x125ccc){if(!_0x125ccc){_0x3ae3e4['sendStatus'](0x194);}return _0x125ccc;};}function handleError(_0x35488e,_0x3f7f6d){_0x3f7f6d=_0x3f7f6d||0x1f4;return function(_0x28dc56){logger['error'](_0x28dc56[_0xffeb('0x1b')]);if(_0x28dc56[_0xffeb('0x1c')]){delete _0x28dc56['name'];}_0x35488e['status'](_0x3f7f6d)[_0xffeb('0x1d')](_0x28dc56);};}exports[_0xffeb('0x1e')]=function(_0x3bfd6e,_0x32967c){var _0xcbed19={};var _0x2fad60={'count':0x0,'rows':[]};var _0x75b760=_['map'](db[_0xffeb('0x1f')][_0xffeb('0x20')],function(_0x36ba8a){return{'name':_0x36ba8a[_0xffeb('0x21')],'type':_0x36ba8a[_0xffeb('0x22')][_0xffeb('0x23')]};});_0xcbed19=qs[_0xffeb('0x24')](_0x75b760,_0x3bfd6e);var _0x3afbc9={'where':_0xcbed19['where']};return db[_0xffeb('0x1f')][_0xffeb('0x14')](_0x3afbc9)[_0xffeb('0x17')](function(_0x249283){_0x2fad60['count']=_0x249283;_0xcbed19[_0xffeb('0x25')]=qs['include'](_0x3bfd6e[_0xffeb('0x26')]);return db[_0xffeb('0x1f')]['findAll'](_0xcbed19);})[_0xffeb('0x17')](function(_0x2d6247){_0x2fad60[_0xffeb('0x27')]=_0x2d6247;return _0x2fad60;})[_0xffeb('0x17')](respondWithFilteredResult(_0x32967c,_0xcbed19))['catch'](handleError(_0x32967c,null));};exports['show']=function(_0x20a623,_0x30534c){var _0x293d8d={'raw':!![],'where':{'id':_0x20a623[_0xffeb('0x28')]['id']}},_0x162dc1={};_0x162dc1[_0xffeb('0x29')]=_[_0xffeb('0x2a')](db[_0xffeb('0x1f')][_0xffeb('0x20')]);_0x162dc1['query']=_['keys'](_0x20a623[_0xffeb('0x26')]);_0x162dc1[_0xffeb('0x2b')]=_[_0xffeb('0x2c')](_0x162dc1['model'],_0x162dc1[_0xffeb('0x26')]);_0x293d8d[_0xffeb('0x2d')]=_['intersection'](_0x162dc1['model'],qs[_0xffeb('0x2e')](_0x20a623[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x293d8d[_0xffeb('0x2d')]=_0x293d8d[_0xffeb('0x2d')][_0xffeb('0x2f')]?_0x293d8d[_0xffeb('0x2d')]:_0x162dc1[_0xffeb('0x29')];if(_0x20a623[_0xffeb('0x26')][_0xffeb('0x30')]){_0x293d8d[_0xffeb('0x25')]=[{'all':!![]}];}_0x293d8d=_['merge']({},_0x293d8d,_0x20a623[_0xffeb('0x31')]);return db[_0xffeb('0x1f')][_0xffeb('0x32')](_0x293d8d)[_0xffeb('0x17')](handleEntityNotFound(_0x30534c,null))[_0xffeb('0x17')](respondWithResult(_0x30534c,null))[_0xffeb('0x33')](handleError(_0x30534c,null));};exports['create']=function(_0x224db9,_0x2e27b2){return db[_0xffeb('0x1f')][_0xffeb('0x34')](_0x224db9[_0xffeb('0x35')],{})[_0xffeb('0x17')](function(_0x275d43){var _0x337cb2=_0x224db9[_0xffeb('0x36')][_0xffeb('0x18')]({'plain':!![]});if(!_0x337cb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x337cb2[_0xffeb('0x37')]===_0xffeb('0x36')){var _0x512e01=_0x275d43['get']({'plain':!![]});var _0x1e0b46=_0xffeb('0x19');return db['UserProfileSection'][_0xffeb('0x32')]({'where':{'name':_0x1e0b46,'userProfileId':_0x337cb2['userProfileId']},'raw':!![]})['then'](function(_0x5a498a){if(_0x5a498a&&_0x5a498a[_0xffeb('0x38')]===0x0){return db[_0xffeb('0x39')][_0xffeb('0x34')]({'name':_0x512e01[_0xffeb('0x1c')],'resourceId':_0x512e01['id'],'type':_0x5a498a[_0xffeb('0x1c')],'sectionId':_0x5a498a['id']},{})[_0xffeb('0x17')](function(){return _0x275d43;});}else{return _0x275d43;}})['catch'](function(_0x373cb4){logger[_0xffeb('0x3a')](_0xffeb('0x3b'),_0x373cb4);throw _0x373cb4;});}return _0x275d43;})[_0xffeb('0x17')](respondWithResult(_0x2e27b2,0xc9))['catch'](handleError(_0x2e27b2,null));};exports['update']=function(_0x2f1004,_0x3059a6){if(_0x2f1004[_0xffeb('0x35')]['id']){delete _0x2f1004['body']['id'];}return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0x2f1004[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x3059a6,null))['then'](saveUpdates(_0x2f1004[_0xffeb('0x35')],null))[_0xffeb('0x17')](respondWithResult(_0x3059a6,null))[_0xffeb('0x33')](handleError(_0x3059a6,null));};exports['destroy']=function(_0x4b5f54,_0x41dfdd){return db['WhatsappQueue'][_0xffeb('0x32')]({'where':{'id':_0x4b5f54[_0xffeb('0x28')]['id']}})['then'](handleEntityNotFound(_0x41dfdd,null))[_0xffeb('0x17')](removeEntity(_0x41dfdd,null))[_0xffeb('0x33')](handleError(_0x41dfdd,null));};exports['describe']=function(_0x59ba54,_0x53450f){return db['WhatsappQueue'][_0xffeb('0x3c')]()[_0xffeb('0x17')](respondWithResult(_0x53450f,null))[_0xffeb('0x33')](handleError(_0x53450f,null));};exports[_0xffeb('0x3d')]=function(_0x37ffd7,_0x4bf2a3){var _0x42b524={'raw':!![],'where':{}},_0x366d16={},_0x17394c;return db[_0xffeb('0x1f')][_0xffeb('0x3e')]({'where':{'id':_0x37ffd7[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x4bf2a3,null))[_0xffeb('0x17')](function(_0x33a0b1){if(_0x33a0b1){_0x17394c=_0x33a0b1[_0xffeb('0x18')]({'plain':!![]});_0x366d16[_0xffeb('0x29')]=_['keys'](db[_0xffeb('0x3f')]['rawAttributes']);_0x366d16[_0xffeb('0x26')]=_[_0xffeb('0x2a')](_0x37ffd7[_0xffeb('0x26')]);_0x366d16[_0xffeb('0x2b')]=_[_0xffeb('0x2c')](_0x366d16['model'],_0x366d16[_0xffeb('0x26')]);_0x42b524[_0xffeb('0x2d')]=_[_0xffeb('0x2c')](_0x366d16['model'],qs[_0xffeb('0x2e')](_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x42b524[_0xffeb('0x2d')]=_0x42b524[_0xffeb('0x2d')]['length']?_0x42b524[_0xffeb('0x2d')]:_0x366d16[_0xffeb('0x29')];if(!_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x40')](_0xffeb('0x41'))){_0x42b524[_0xffeb('0x13')]=qs[_0xffeb('0x13')](_0x37ffd7['query'][_0xffeb('0x13')]);_0x42b524[_0xffeb('0x12')]=qs[_0xffeb('0x12')](_0x37ffd7['query']['offset']);}_0x42b524[_0xffeb('0x42')]=qs['sort'](_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x43')]);_0x42b524[_0xffeb('0x44')]=qs[_0xffeb('0x2b')](_[_0xffeb('0x45')](_0x37ffd7['query'],_0x366d16['filters']));_0x42b524['where'][_0xffeb('0x46')]=_0x33a0b1['id'];if(_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x47')]){_0x42b524['where']=_[_0xffeb('0x48')](_0x42b524[_0xffeb('0x44')],{'$or':_[_0xffeb('0x49')](_0x42b524[_0xffeb('0x2d')],function(_0x23a10e){var _0x577105={};_0x577105[_0x23a10e]={'$like':'%'+_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x47')]+'%'};return _0x577105;})});}_0x42b524=_[_0xffeb('0x48')]({},_0x42b524,_0x37ffd7[_0xffeb('0x31')]);return db[_0xffeb('0x3f')]['findAll'](_0x42b524);}})[_0xffeb('0x17')](function(_0x2ac53b){if(_0x2ac53b){return db[_0xffeb('0x4a')][_0xffeb('0x4b')]({'where':{'id':_[_0xffeb('0x49')](_0x2ac53b,_0xffeb('0x4c')),'role':_0xffeb('0x4d')},'attributes':['id',_0xffeb('0x1c'),_0xffeb('0x4e'),_0xffeb('0x4f'),_0xffeb('0x50')]});}})['then'](function(_0x10a599){if(_0x10a599){return{'count':_0x10a599['count'],'rows':_[_0xffeb('0x49')](_0x10a599[_0xffeb('0x27')],function(_0x252754){return{'membername':_0x252754[_0xffeb('0x1c')],'UserId':_0x252754['id'],'queue_name':_0x17394c['name'],'WhatsappQueueId':_0x17394c['id'],'interface':util[_0xffeb('0x51')](_0xffeb('0x52'),'SIP',_0x252754[_0xffeb('0x1c')]),'penalty':0x0,'paused':_0x252754[_0xffeb('0x4e')],'createdAt':_0x252754[_0xffeb('0x50')],'updatedAt':_0x252754['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xffeb('0x17')](respondWithFilteredResult(_0x4bf2a3,_0x42b524))[_0xffeb('0x33')](handleError(_0x4bf2a3,null));};exports[_0xffeb('0x53')]=function(_0x37fff8,_0x2113cf){var _0x4447db={};var _0xb080e6={};var _0x42f727;var _0x3f12bb;return db[_0xffeb('0x1f')][_0xffeb('0x3e')]({'where':{'id':_0x37fff8['params']['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x2113cf,null))['then'](function(_0x28df7b){if(_0x28df7b){_0x42f727=_0x28df7b;_0xb080e6['model']=_[_0xffeb('0x2a')](db[_0xffeb('0x54')][_0xffeb('0x20')]);_0xb080e6[_0xffeb('0x26')]=_[_0xffeb('0x2a')](_0x37fff8['query']);_0xb080e6[_0xffeb('0x2b')]=_[_0xffeb('0x2c')](_0xb080e6[_0xffeb('0x29')],_0xb080e6['query']);_0x4447db[_0xffeb('0x2d')]=_[_0xffeb('0x2c')](_0xb080e6['model'],qs[_0xffeb('0x2e')](_0x37fff8[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x4447db['attributes']=_0x4447db[_0xffeb('0x2d')][_0xffeb('0x2f')]?_0x4447db[_0xffeb('0x2d')]:_0xb080e6[_0xffeb('0x29')];_0x4447db[_0xffeb('0x42')]=qs['sort'](_0x37fff8[_0xffeb('0x26')]['sort']);_0x4447db['where']=qs['filters'](_[_0xffeb('0x45')](_0x37fff8['query'],_0xb080e6[_0xffeb('0x2b')]));if(_0x37fff8['query'][_0xffeb('0x47')]){_0x4447db[_0xffeb('0x44')]=_['merge'](_0x4447db[_0xffeb('0x44')],{'$or':_[_0xffeb('0x49')](_0x4447db[_0xffeb('0x2d')],function(_0x458398){var _0x3f99c7={};_0x3f99c7[_0x458398]={'$like':'%'+_0x37fff8['query'][_0xffeb('0x47')]+'%'};return _0x3f99c7;})});}_0x4447db=_['merge']({},_0x4447db,_0x37fff8[_0xffeb('0x31')]);return _0x42f727[_0xffeb('0x53')](_0x4447db);}})[_0xffeb('0x17')](function(_0x4eee27){if(_0x4eee27){_0x3f12bb=_0x4eee27['length'];if(!_0x37fff8['query'][_0xffeb('0x40')](_0xffeb('0x41'))){_0x4447db[_0xffeb('0x13')]=qs[_0xffeb('0x13')](_0x37fff8[_0xffeb('0x26')]['limit']);_0x4447db['offset']=qs[_0xffeb('0x12')](_0x37fff8[_0xffeb('0x26')][_0xffeb('0x12')]);}return _0x42f727['getTeams'](_0x4447db);}})[_0xffeb('0x17')](function(_0x314515){if(_0x314515){return _0x314515?{'count':_0x3f12bb,'rows':_0x314515}:null;}})['then'](respondWithResult(_0x2113cf,null))[_0xffeb('0x33')](handleError(_0x2113cf,null));};exports['addTeams']=function(_0x2bab95,_0x24e77f){var _0x31b0ad=_0x2bab95[_0xffeb('0x35')][_0xffeb('0x55')];return db['Team'][_0xffeb('0x56')]({'where':{'id':_0x31b0ad},'attributes':['id'],'include':[{'model':db[_0xffeb('0x4a')],'as':_0xffeb('0x57'),'attributes':['id',_0xffeb('0x1c'),_0xffeb('0x58'),_0xffeb('0x59'),'interface'],'raw':!![]}]})['then'](function(_0xba7f3d){if(_0xba7f3d){var _0x3d9a38=_['flatMap'](_0xba7f3d,function(_0x5d1232){var _0x4679c9=_0x5d1232[_0xffeb('0x18')]({'plain':!![]});return _0x4679c9[_0xffeb('0x57')];});return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0x2bab95[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](function(_0x49f89f){return db[_0xffeb('0x5a')][_0xffeb('0x5b')](function(_0x32a53c){return _0x49f89f[_0xffeb('0x5c')](_0x31b0ad,{'transaction':_0x32a53c})[_0xffeb('0x17')](function(){return BPromise[_0xffeb('0x5d')](_0x3d9a38,function(_0x51ba51){return db[_0xffeb('0x3f')]['findOrCreate']({'where':{'UserId':_0x51ba51['id'],'WhatsappQueueId':_0x2bab95[_0xffeb('0x28')]['id']},'transaction':_0x32a53c});});})[_0xffeb('0x17')](function(){_0x3d9a38[_0xffeb('0x5e')](function(_0x11c720){socket[_0xffeb('0x5f')](_0xffeb('0x60'),{'UserId':_0x11c720['id'],'WhatsappQueueId':_0x49f89f['id']});});});});});}})[_0xffeb('0x17')](respondWithStatusCode(_0x24e77f,null))[_0xffeb('0x33')](handleError(_0x24e77f,null));};exports[_0xffeb('0x61')]=function(_0x41d932,_0x22ec66){return db[_0xffeb('0x54')]['findAll']({'where':{'id':_0x41d932['query'][_0xffeb('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xffeb('0x57'),'attributes':['id'],'raw':!![]}]})[_0xffeb('0x17')](handleEntityNotFound(_0x22ec66,null))[_0xffeb('0x17')](function(_0x58d55f){var _0x859ec2=_['map'](_0x58d55f,'id');var _0x2cbac5=[];var _0x5ad883=[];var _0x29fd9a=squel[_0xffeb('0x62')]();_0x29fd9a[_0xffeb('0x63')](_0xffeb('0x64'))['from'](_0xffeb('0x65'),'tq')['join'](_0xffeb('0x66'),'ut',_0xffeb('0x67'))['where'](_0xffeb('0x68'),_0x41d932[_0xffeb('0x28')]['id']);for(var _0x434e5b=0x0;_0x434e5b<_0x58d55f[_0xffeb('0x2f')];_0x434e5b+=0x1){let _0x18ef32=_0x58d55f[_0x434e5b];for(var _0x5d222f=0x0;_0x5d222f<_0x18ef32[_0xffeb('0x57')][_0xffeb('0x2f')];_0x5d222f+=0x1){let _0x271fc0=_0x18ef32[_0xffeb('0x57')][_0x5d222f];var _0x3cc79b=_0x29fd9a['clone']();_0x3cc79b[_0xffeb('0x44')]('ut.UserId\x20=\x20?',_0x271fc0['id']);_0x5ad883[_0xffeb('0x69')](db[_0xffeb('0x5a')][_0xffeb('0x26')](_0x3cc79b[_0xffeb('0x6a')](),{'type':db[_0xffeb('0x5a')][_0xffeb('0x6b')][_0xffeb('0x6c')]})[_0xffeb('0x17')](function(_0x1c6d2a){if(_0x1c6d2a['length']===0x1){return _0x271fc0['id'];}else{var _0x57eaa0=_['every'](_[_0xffeb('0x49')](_0x1c6d2a,_0xffeb('0x6d')),function(_0x1bdb30){return _[_0xffeb('0x6e')](_0x859ec2,_0x1bdb30);});if(_0x57eaa0){return _0x271fc0['id'];}}}));}}return BPromise['all'](_0x5ad883)['then'](function(_0x44c99d){_0x2cbac5=_(_0x2cbac5)[_0xffeb('0x6f')](_0x44c99d)[_0xffeb('0x70')]()[_0xffeb('0x71')]();return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0x41d932[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](function(_0x3464dc){return db[_0xffeb('0x5a')][_0xffeb('0x5b')](function(_0xe79db5){return _0x3464dc[_0xffeb('0x61')](_0x41d932[_0xffeb('0x26')]['ids'],{'transaction':_0xe79db5})['then'](function(){if(!_[_0xffeb('0x72')](_0x2cbac5)){return _0x3464dc[_0xffeb('0x73')](_0x2cbac5,{'transaction':_0xe79db5});}})[_0xffeb('0x17')](function(){_0x2cbac5[_0xffeb('0x5e')](function(_0x29c9f4){socket[_0xffeb('0x5f')]('userWhatsappQueue:remove',{'UserId':_0x29c9f4,'WhatsappQueueId':_0x3464dc['id']});});});});});});})['then'](respondWithStatusCode(_0x22ec66,null))[_0xffeb('0x33')](handleError(_0x22ec66,null));};exports[_0xffeb('0x74')]=function(_0xbdc7d4,_0x7a6e5e){return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0xbdc7d4[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x7a6e5e,null))[_0xffeb('0x17')](function(_0x3b84e4){if(_0x3b84e4){return _0x3b84e4['addAgents'](_0xbdc7d4[_0xffeb('0x35')]['ids'],_[_0xffeb('0x75')](_0xbdc7d4[_0xffeb('0x35')],['ids','id'])||{})[_0xffeb('0x76')](function(_0x3660a3){for(var _0xa84f0e=0x0;_0xa84f0e<_0xbdc7d4['body'][_0xffeb('0x55')][_0xffeb('0x2f')];_0xa84f0e+=0x1){socket[_0xffeb('0x5f')]('userWhatsappQueue:save',{'UserId':Number(_0xbdc7d4[_0xffeb('0x35')][_0xffeb('0x55')][_0xa84f0e]),'WhatsappQueueId':Number(_0xbdc7d4[_0xffeb('0x28')]['id'])});}return _0x3660a3;});}})['then'](respondWithResult(_0x7a6e5e,null))[_0xffeb('0x33')](handleError(_0x7a6e5e,null));};exports[_0xffeb('0x73')]=function(_0x1bf46c,_0x3ec6ea){return db['WhatsappQueue'][_0xffeb('0x32')]({'where':{'id':_0x1bf46c['params']['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x3ec6ea,null))[_0xffeb('0x17')](function(_0x18a36a){if(_0x18a36a){return _0x18a36a[_0xffeb('0x73')](_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')])[_0xffeb('0x17')](function(){if(_['isArray'](_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')])){for(var _0x2f9129=0x0;_0x2f9129<_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')][_0xffeb('0x2f')];_0x2f9129+=0x1){socket['emit'](_0xffeb('0x77'),{'UserId':Number(_0x1bf46c['query'][_0xffeb('0x55')][_0x2f9129]),'WhatsappQueueId':Number(_0x1bf46c['params']['id'])});}}else{socket[_0xffeb('0x5f')](_0xffeb('0x77'),{'UserId':Number(_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')]),'WhatsappQueueId':Number(_0x1bf46c[_0xffeb('0x28')]['id'])});}});}})[_0xffeb('0x17')](respondWithStatusCode(_0x3ec6ea,null))[_0xffeb('0x33')](handleError(_0x3ec6ea,null));};exports[_0xffeb('0x78')]=function(_0x26cffb,_0x3d202c){var _0x112138={};var _0x4979ab={};var _0x5509ce;var _0xddd220;return db[_0xffeb('0x1f')][_0xffeb('0x3e')]({'where':{'id':_0x26cffb[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x3d202c,null))['then'](function(_0x147252){if(_0x147252){_0x5509ce=_0x147252;_0x4979ab['model']=_['keys'](db[_0xffeb('0x4a')][_0xffeb('0x20')]);_0x4979ab[_0xffeb('0x26')]=_[_0xffeb('0x2a')](_0x26cffb[_0xffeb('0x26')]);_0x4979ab[_0xffeb('0x2b')]=_['intersection'](_0x4979ab[_0xffeb('0x29')],_0x4979ab[_0xffeb('0x26')]);_0x112138[_0xffeb('0x2d')]=_[_0xffeb('0x2c')](_0x4979ab[_0xffeb('0x29')],qs['fields'](_0x26cffb[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x112138[_0xffeb('0x2d')]=_0x112138[_0xffeb('0x2d')][_0xffeb('0x2f')]?_0x112138['attributes']:_0x4979ab[_0xffeb('0x29')];_0x112138[_0xffeb('0x42')]=qs[_0xffeb('0x43')](_0x26cffb['query'][_0xffeb('0x43')]);_0x112138[_0xffeb('0x44')]=qs[_0xffeb('0x2b')](_[_0xffeb('0x45')](_0x26cffb[_0xffeb('0x26')],_0x4979ab[_0xffeb('0x2b')]));if(_0x26cffb[_0xffeb('0x26')][_0xffeb('0x47')]){_0x112138[_0xffeb('0x44')]=_[_0xffeb('0x48')](_0x112138[_0xffeb('0x44')],{'$or':_[_0xffeb('0x49')](_0x112138[_0xffeb('0x2d')],function(_0x4a480d){var _0x42bab2={};_0x42bab2[_0x4a480d]={'$like':'%'+_0x26cffb['query'][_0xffeb('0x47')]+'%'};return _0x42bab2;})});}_0x112138=_[_0xffeb('0x48')]({},_0x112138,_0x26cffb[_0xffeb('0x31')]);return _0x5509ce['getAgents'](_0x112138);}})[_0xffeb('0x17')](function(_0x59da9e){if(_0x59da9e){_0xddd220=_0x59da9e['length'];if(!_0x26cffb[_0xffeb('0x26')][_0xffeb('0x40')](_0xffeb('0x41'))){_0x112138[_0xffeb('0x13')]=qs['limit'](_0x26cffb[_0xffeb('0x26')][_0xffeb('0x13')]);_0x112138['offset']=qs[_0xffeb('0x12')](_0x26cffb['query'][_0xffeb('0x12')]);}return _0x5509ce[_0xffeb('0x78')](_0x112138);}})[_0xffeb('0x17')](function(_0xe9c039){if(_0xe9c039){return _0xe9c039?{'count':_0xddd220,'rows':_0xe9c039}:null;}})['then'](respondWithResult(_0x3d202c,null))[_0xffeb('0x33')](handleError(_0x3d202c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 29ff5fd..29678d1 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 _0xb207=['events','WhatsappQueue','update','remove','emit','hasOwnProperty','hook'];(function(_0x43c960,_0x5d000b){var _0x584dfd=function(_0x52cd8b){while(--_0x52cd8b){_0x43c960['push'](_0x43c960['shift']());}};_0x584dfd(++_0x5d000b);}(_0xb207,0x17a));var _0x7b20=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0xb207[_0x4c9f6a];return _0x5df5b9;};'use strict';var EventEmitter=require(_0x7b20('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x7b20('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b20('0x2'),'afterDestroy':_0x7b20('0x3')};function emitEvent(_0x50c0a4){return function(_0x302395,_0x4c32ae,_0xef4cb9){WhatsappQueueEvents[_0x7b20('0x4')](_0x50c0a4+':'+_0x302395['id'],_0x302395);WhatsappQueueEvents[_0x7b20('0x4')](_0x50c0a4,_0x302395);_0xef4cb9(null);};}for(var e in events){if(events[_0x7b20('0x5')](e)){var event=events[e];WhatsappQueue[_0x7b20('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xdd7b=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x4b523f,_0xddef26){var _0x287bd8=function(_0x3fa74d){while(--_0x3fa74d){_0x4b523f['push'](_0x4b523f['shift']());}};_0x287bd8(++_0xddef26);}(_0xdd7b,0xec));var _0xbdd7=function(_0x1e30a2,_0x1f16a2){_0x1e30a2=_0x1e30a2-0x0;var _0x4942e0=_0xdd7b[_0x1e30a2];return _0x4942e0;};'use strict';var EventEmitter=require(_0xbdd7('0x0'));var WhatsappQueue=require(_0xbdd7('0x1'))['db'][_0xbdd7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xbdd7('0x3')](0x0);var events={'afterCreate':_0xbdd7('0x4'),'afterUpdate':_0xbdd7('0x5'),'afterDestroy':_0xbdd7('0x6')};function emitEvent(_0x5ce929){return function(_0x3dfa67,_0x5dd07e,_0x29ae2d){WhatsappQueueEvents[_0xbdd7('0x7')](_0x5ce929+':'+_0x3dfa67['id'],_0x3dfa67);WhatsappQueueEvents[_0xbdd7('0x7')](_0x5ce929,_0x3dfa67);_0x29ae2d(null);};}for(var e in events){if(events[_0xbdd7('0x8')](e)){var event=events[e];WhatsappQueue[_0xbdd7('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index f1b80cd..72ea1e4 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 _0x16f6=['util','../../config/logger','api','moment','request-promise','path','./whatsappQueue.attributes','exports','WhatsappQueue','lodash'];(function(_0x3e4d14,_0x2155fa){var _0x43fc99=function(_0x3bd452){while(--_0x3bd452){_0x3e4d14['push'](_0x3e4d14['shift']());}};_0x43fc99(++_0x2155fa);}(_0x16f6,0x149));var _0x616f=function(_0x312e73,_0x3be2cf){_0x312e73=_0x312e73-0x0;var _0x2beb13=_0x16f6[_0x312e73];return _0x2beb13;};'use strict';var _=require(_0x616f('0x0'));var util=require(_0x616f('0x1'));var logger=require(_0x616f('0x2'))(_0x616f('0x3'));var moment=require(_0x616f('0x4'));var BPromise=require('bluebird');var rp=require(_0x616f('0x5'));var fs=require('fs');var path=require(_0x616f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x616f('0x7'));module[_0x616f('0x8')]=function(_0x155cc6,_0x54111f){return _0x155cc6['define'](_0x616f('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1384=['path','../../config/environment','define','WhatsappQueue','lodash','util','api','moment','bluebird'];(function(_0x32f326,_0x26dd4a){var _0x2b9fdd=function(_0x5b7bf4){while(--_0x5b7bf4){_0x32f326['push'](_0x32f326['shift']());}};_0x2b9fdd(++_0x26dd4a);}(_0x1384,0x1e1));var _0x4138=function(_0xcfcd8c,_0x5dcccf){_0xcfcd8c=_0xcfcd8c-0x0;var _0x5c68cb=_0x1384[_0xcfcd8c];return _0x5c68cb;};'use strict';var _=require(_0x4138('0x0'));var util=require(_0x4138('0x1'));var logger=require('../../config/logger')(_0x4138('0x2'));var moment=require(_0x4138('0x3'));var BPromise=require(_0x4138('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4138('0x5'));var rimraf=require('rimraf');var config=require(_0x4138('0x6'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0xb3cfbb,_0x1cafba){return _0xb3cfbb[_0x4138('0x7')](_0x4138('0x8'),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 a900755..a173ecf 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 _0x8296=['include','map','model','ShowWhatsappQueue','WhatsappQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','then','info','request\x20sent','debug','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','catch','GetWhatsappQueue','findAll','options','raw','where','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8296,0x1e7));var _0x6829=function(_0x4af42d,_0x226c6d){_0x4af42d=_0x4af42d-0x0;var _0x14b54f=_0x8296[_0x4af42d];return _0x14b54f;};'use strict';var _=require(_0x6829('0x0'));var util=require(_0x6829('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6829('0x2'));var fs=require('fs');var Redis=require(_0x6829('0x3'));var db=require(_0x6829('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6829('0x5'))(_0x6829('0x6'));var config=require('../../config/environment');var jayson=require(_0x6829('0x7'));var client=jayson[_0x6829('0x8')][_0x6829('0x9')]({'port':0x232a});config[_0x6829('0xa')]=_[_0x6829('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6829('0xc'))(new Redis(config[_0x6829('0xa')]));require(_0x6829('0xd'))[_0x6829('0xe')](socket);function respondWithRpcPromise(_0x4f7225,_0xca5afe,_0x3956cf){return new BPromise(function(_0x3f53e8,_0x3eeffb){return client['request'](_0x4f7225,_0x3956cf)[_0x6829('0xf')](function(_0x1f43be){logger[_0x6829('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0xca5afe,_0x6829('0x11'));logger[_0x6829('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0xca5afe,_0x6829('0x11'),JSON[_0x6829('0x13')](_0x1f43be));if(_0x1f43be[_0x6829('0x14')]){if(_0x1f43be[_0x6829('0x14')][_0x6829('0x15')]===0x1f4){logger[_0x6829('0x14')](_0x6829('0x16'),_0xca5afe,_0x1f43be[_0x6829('0x14')][_0x6829('0x17')]);return _0x3eeffb(_0x1f43be[_0x6829('0x14')][_0x6829('0x17')]);}logger[_0x6829('0x14')](_0x6829('0x16'),_0xca5afe,_0x1f43be['error'][_0x6829('0x17')]);return _0x3f53e8(_0x1f43be[_0x6829('0x14')]['message']);}else{logger[_0x6829('0x10')](_0x6829('0x16'),_0xca5afe,'request\x20sent');_0x3f53e8(_0x1f43be['result'][_0x6829('0x17')]);}})[_0x6829('0x18')](function(_0x265184){logger[_0x6829('0x14')](_0x6829('0x16'),_0xca5afe,_0x265184);_0x3eeffb(_0x265184);});});}exports[_0x6829('0x19')]=function(_0x24e7b2){var _0x33b82c=this;return new Promise(function(_0x58ce85,_0x5178d7){return db['WhatsappQueue'][_0x6829('0x1a')]({'raw':_0x24e7b2[_0x6829('0x1b')]?_0x24e7b2['options'][_0x6829('0x1c')]===undefined?!![]:![]:!![],'where':_0x24e7b2['options']?_0x24e7b2[_0x6829('0x1b')][_0x6829('0x1d')]||null:null,'attributes':_0x24e7b2[_0x6829('0x1b')]?_0x24e7b2[_0x6829('0x1b')][_0x6829('0x1e')]||null:null,'limit':_0x24e7b2[_0x6829('0x1b')]?_0x24e7b2[_0x6829('0x1b')]['limit']||null:null,'include':_0x24e7b2['options']?_0x24e7b2[_0x6829('0x1b')][_0x6829('0x1f')]?_[_0x6829('0x20')](_0x24e7b2[_0x6829('0x1b')][_0x6829('0x1f')],function(_0x58e9d3){return{'model':db[_0x58e9d3[_0x6829('0x21')]],'as':_0x58e9d3['as'],'attributes':_0x58e9d3[_0x6829('0x1e')],'include':_0x58e9d3['include']?_[_0x6829('0x20')](_0x58e9d3[_0x6829('0x1f')],function(_0x43faf){return{'model':db[_0x43faf[_0x6829('0x21')]],'as':_0x43faf['as'],'attributes':_0x43faf[_0x6829('0x1e')],'include':_0x43faf[_0x6829('0x1f')]?_[_0x6829('0x20')](_0x43faf[_0x6829('0x1f')],function(_0x4057bc){return{'model':db[_0x4057bc[_0x6829('0x21')]],'as':_0x4057bc['as'],'attributes':_0x4057bc[_0x6829('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6829('0xf')](function(_0xa2175a){logger[_0x6829('0x10')](_0x6829('0x19'),_0x24e7b2);logger[_0x6829('0x12')](_0x6829('0x19'),_0x24e7b2,JSON[_0x6829('0x13')](_0xa2175a));_0x58ce85(_0xa2175a);})[_0x6829('0x18')](function(_0x15be81){logger[_0x6829('0x14')](_0x6829('0x19'),_0x15be81[_0x6829('0x17')],_0x24e7b2);_0x5178d7(_0x33b82c[_0x6829('0x14')](0x1f4,_0x15be81[_0x6829('0x17')]));});});};exports[_0x6829('0x22')]=function(_0x3a2211){var _0x103317=this;return new Promise(function(_0x37d3e4,_0x4e4707){return db[_0x6829('0x23')][_0x6829('0x24')]({'raw':_0x3a2211[_0x6829('0x1b')]?_0x3a2211['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a2211[_0x6829('0x1b')]?_0x3a2211['options']['where']||null:null,'attributes':_0x3a2211[_0x6829('0x1b')]?_0x3a2211[_0x6829('0x1b')][_0x6829('0x1e')]||null:null,'include':_0x3a2211['options']?_0x3a2211[_0x6829('0x1b')][_0x6829('0x1f')]?_['map'](_0x3a2211[_0x6829('0x1b')]['include'],function(_0x28e534){return{'model':db[_0x28e534[_0x6829('0x21')]],'as':_0x28e534['as'],'attributes':_0x28e534[_0x6829('0x1e')],'include':_0x28e534[_0x6829('0x1f')]?_[_0x6829('0x20')](_0x28e534[_0x6829('0x1f')],function(_0x2d39e6){return{'model':db[_0x2d39e6[_0x6829('0x21')]],'as':_0x2d39e6['as'],'attributes':_0x2d39e6['attributes'],'include':_0x2d39e6[_0x6829('0x1f')]?_[_0x6829('0x20')](_0x2d39e6[_0x6829('0x1f')],function(_0x24bd7f){return{'model':db[_0x24bd7f[_0x6829('0x21')]],'as':_0x24bd7f['as'],'attributes':_0x24bd7f[_0x6829('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6829('0xf')](function(_0x3b11d0){logger[_0x6829('0x10')](_0x6829('0x22'),_0x3a2211);logger[_0x6829('0x12')](_0x6829('0x22'),_0x3a2211,JSON[_0x6829('0x13')](_0x3b11d0));_0x37d3e4(_0x3b11d0);})[_0x6829('0x18')](function(_0x2e3ba7){logger[_0x6829('0x14')](_0x6829('0x22'),_0x2e3ba7[_0x6829('0x17')],_0x3a2211);_0x4e4707(_0x103317[_0x6829('0x14')](0x1f4,_0x2e3ba7[_0x6829('0x17')]));});});}; \ No newline at end of file +var _0x6b83=['catch','ShowWhatsappQueue','find','where','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetWhatsappQueue','findAll','options','raw','attributes','limit','map','model','include','then','debug','stringify'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x6b83,0xdc));var _0x36b8=function(_0x2d1840,_0x5dc27e){_0x2d1840=_0x2d1840-0x0;var _0xd06a88=_0x6b83[_0x2d1840];return _0xd06a88;};'use strict';var _=require(_0x36b8('0x0'));var util=require('util');var moment=require(_0x36b8('0x1'));var BPromise=require(_0x36b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x36b8('0x4'));var logger=require(_0x36b8('0x5'))(_0x36b8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x36b8('0x7')]['http']({'port':0x232a});config[_0x36b8('0x8')]=_[_0x36b8('0x9')](config[_0x36b8('0x8')],{'host':_0x36b8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36b8('0x8')]));require('./whatsappQueue.socket')[_0x36b8('0xb')](socket);function respondWithRpcPromise(_0x1caa7c,_0x1690f4,_0x454d90){return new BPromise(function(_0xf48b8c,_0x1f4dff){return client[_0x36b8('0xc')](_0x1caa7c,_0x454d90)['then'](function(_0x17ad20){logger[_0x36b8('0xd')](_0x36b8('0xe'),_0x1690f4,_0x36b8('0xf'));logger['debug'](_0x36b8('0x10'),_0x1690f4,_0x36b8('0xf'),JSON['stringify'](_0x17ad20));if(_0x17ad20[_0x36b8('0x11')]){if(_0x17ad20['error']['code']===0x1f4){logger[_0x36b8('0x11')](_0x36b8('0xe'),_0x1690f4,_0x17ad20[_0x36b8('0x11')][_0x36b8('0x12')]);return _0x1f4dff(_0x17ad20[_0x36b8('0x11')][_0x36b8('0x12')]);}logger[_0x36b8('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x1690f4,_0x17ad20['error'][_0x36b8('0x12')]);return _0xf48b8c(_0x17ad20[_0x36b8('0x11')][_0x36b8('0x12')]);}else{logger['info'](_0x36b8('0xe'),_0x1690f4,'request\x20sent');_0xf48b8c(_0x17ad20[_0x36b8('0x13')][_0x36b8('0x12')]);}})['catch'](function(_0x3f3909){logger['error'](_0x36b8('0xe'),_0x1690f4,_0x3f3909);_0x1f4dff(_0x3f3909);});});}exports[_0x36b8('0x14')]=function(_0x409569){var _0xf8bb4d=this;return new Promise(function(_0x271712,_0x54904f){return db['WhatsappQueue'][_0x36b8('0x15')]({'raw':_0x409569[_0x36b8('0x16')]?_0x409569['options'][_0x36b8('0x17')]===undefined?!![]:![]:!![],'where':_0x409569[_0x36b8('0x16')]?_0x409569[_0x36b8('0x16')]['where']||null:null,'attributes':_0x409569[_0x36b8('0x16')]?_0x409569[_0x36b8('0x16')][_0x36b8('0x18')]||null:null,'limit':_0x409569[_0x36b8('0x16')]?_0x409569[_0x36b8('0x16')][_0x36b8('0x19')]||null:null,'include':_0x409569['options']?_0x409569['options']['include']?_[_0x36b8('0x1a')](_0x409569[_0x36b8('0x16')]['include'],function(_0x1b7ac2){return{'model':db[_0x1b7ac2[_0x36b8('0x1b')]],'as':_0x1b7ac2['as'],'attributes':_0x1b7ac2['attributes'],'include':_0x1b7ac2['include']?_[_0x36b8('0x1a')](_0x1b7ac2['include'],function(_0x2969f8){return{'model':db[_0x2969f8[_0x36b8('0x1b')]],'as':_0x2969f8['as'],'attributes':_0x2969f8[_0x36b8('0x18')],'include':_0x2969f8[_0x36b8('0x1c')]?_[_0x36b8('0x1a')](_0x2969f8[_0x36b8('0x1c')],function(_0x433ad0){return{'model':db[_0x433ad0['model']],'as':_0x433ad0['as'],'attributes':_0x433ad0['attributes']};}):[]};}):[]};}):[]:[]})[_0x36b8('0x1d')](function(_0x1de0c1){logger['info'](_0x36b8('0x14'),_0x409569);logger[_0x36b8('0x1e')](_0x36b8('0x14'),_0x409569,JSON[_0x36b8('0x1f')](_0x1de0c1));_0x271712(_0x1de0c1);})[_0x36b8('0x20')](function(_0x46d014){logger[_0x36b8('0x11')]('GetWhatsappQueue',_0x46d014[_0x36b8('0x12')],_0x409569);_0x54904f(_0xf8bb4d[_0x36b8('0x11')](0x1f4,_0x46d014[_0x36b8('0x12')]));});});};exports[_0x36b8('0x21')]=function(_0x16e5d8){var _0x470579=this;return new Promise(function(_0x1f732a,_0x269e2b){return db['WhatsappQueue'][_0x36b8('0x22')]({'raw':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8[_0x36b8('0x16')][_0x36b8('0x17')]===undefined?!![]:![]:!![],'where':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8[_0x36b8('0x16')][_0x36b8('0x23')]||null:null,'attributes':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8[_0x36b8('0x16')]['attributes']||null:null,'include':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8['options']['include']?_[_0x36b8('0x1a')](_0x16e5d8['options'][_0x36b8('0x1c')],function(_0x423fcb){return{'model':db[_0x423fcb[_0x36b8('0x1b')]],'as':_0x423fcb['as'],'attributes':_0x423fcb[_0x36b8('0x18')],'include':_0x423fcb[_0x36b8('0x1c')]?_[_0x36b8('0x1a')](_0x423fcb[_0x36b8('0x1c')],function(_0x1ded85){return{'model':db[_0x1ded85[_0x36b8('0x1b')]],'as':_0x1ded85['as'],'attributes':_0x1ded85[_0x36b8('0x18')],'include':_0x1ded85['include']?_[_0x36b8('0x1a')](_0x1ded85[_0x36b8('0x1c')],function(_0x1b7307){return{'model':db[_0x1b7307[_0x36b8('0x1b')]],'as':_0x1b7307['as'],'attributes':_0x1b7307[_0x36b8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x36b8('0x1d')](function(_0x170b99){logger[_0x36b8('0xd')](_0x36b8('0x21'),_0x16e5d8);logger[_0x36b8('0x1e')](_0x36b8('0x21'),_0x16e5d8,JSON[_0x36b8('0x1f')](_0x170b99));_0x1f732a(_0x170b99);})[_0x36b8('0x20')](function(_0x348abe){logger['error']('ShowWhatsappQueue',_0x348abe['message'],_0x16e5d8);_0x269e2b(_0x470579['error'](0x1f4,_0x348abe[_0x36b8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 450c5e0..90ca549 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 _0x4b52=['length','./whatsappQueue.events','save','remove','update','removeListener','register'];(function(_0x83d48e,_0x507328){var _0x26f1d1=function(_0x252172){while(--_0x252172){_0x83d48e['push'](_0x83d48e['shift']());}};_0x26f1d1(++_0x507328);}(_0x4b52,0x1b3));var _0x24b5=function(_0x234cb5,_0x476cce){_0x234cb5=_0x234cb5-0x0;var _0x49f505=_0x4b52[_0x234cb5];return _0x49f505;};'use strict';var WhatsappQueueEvents=require(_0x24b5('0x0'));var events=[_0x24b5('0x1'),_0x24b5('0x2'),_0x24b5('0x3')];function createListener(_0x1eac05,_0x33f059){return function(_0x3ebd96){_0x33f059['emit'](_0x1eac05,_0x3ebd96);};}function removeListener(_0x4e84a8,_0x40b7d1){return function(){WhatsappQueueEvents[_0x24b5('0x4')](_0x4e84a8,_0x40b7d1);};}exports[_0x24b5('0x5')]=function(_0x1930d0){for(var _0x4f8d68=0x0,_0x5e0c37=events[_0x24b5('0x6')];_0x4f8d68<_0x5e0c37;_0x4f8d68++){var _0x3e200c=events[_0x4f8d68];var _0x26bef2=createListener('whatsappQueue:'+_0x3e200c,_0x1930d0);WhatsappQueueEvents['on'](_0x3e200c,_0x26bef2);}}; \ No newline at end of file +var _0xebf5=['length','whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xebf5,0x1e2));var _0x5ebf=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xebf5[_0x1f44e4];return _0x591989;};'use strict';var WhatsappQueueEvents=require(_0x5ebf('0x0'));var events=['save',_0x5ebf('0x1'),_0x5ebf('0x2')];function createListener(_0x350c75,_0xbb9292){return function(_0x4dfe93){_0xbb9292[_0x5ebf('0x3')](_0x350c75,_0x4dfe93);};}function removeListener(_0x5475a7,_0x1148f2){return function(){WhatsappQueueEvents[_0x5ebf('0x4')](_0x5475a7,_0x1148f2);};}exports[_0x5ebf('0x5')]=function(_0x2946c1){for(var _0x1d0d5e=0x0,_0x80fa8f=events[_0x5ebf('0x6')];_0x1d0d5e<_0x80fa8f;_0x1d0d5e++){var _0x13ce45=events[_0x1d0d5e];var _0x1a3323=createListener(_0x5ebf('0x7')+_0x13ce45,_0x2946c1);WhatsappQueueEvents['on'](_0x13ce45,_0x1a3323);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 0ff212c..225f87d 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 _0x9993=['create','put','update','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x9993,0x6f));var _0x3999=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x9993[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0x3999('0x0'));var util=require('util');var path=require(_0x3999('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3999('0x2'));var auth=require(_0x3999('0x3'));var interaction=require(_0x3999('0x4'));var config=require(_0x3999('0x5'));var controller=require(_0x3999('0x6'));router['get']('/',auth[_0x3999('0x7')](),controller[_0x3999('0x8')]);router[_0x3999('0x9')](_0x3999('0xa'),auth[_0x3999('0x7')](),controller[_0x3999('0xb')]);router[_0x3999('0x9')](_0x3999('0xc'),auth[_0x3999('0x7')](),controller[_0x3999('0xd')]);router[_0x3999('0xe')]('/',auth[_0x3999('0x7')](),controller[_0x3999('0xf')]);router[_0x3999('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3999('0x11')]);router[_0x3999('0x12')](_0x3999('0xc'),auth[_0x3999('0x7')](),controller[_0x3999('0x13')]);module[_0x3999('0x14')]=router; \ No newline at end of file +var _0x7624=['/describe','describe','show','create','put','/:id','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x468523,_0x4acf52){var _0x39dd57=function(_0x152e15){while(--_0x152e15){_0x468523['push'](_0x468523['shift']());}};_0x39dd57(++_0x4acf52);}(_0x7624,0x1e7));var _0x4762=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7624[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4762('0x0'));var express=require(_0x4762('0x1'));var router=express[_0x4762('0x2')]();var fs_extra=require(_0x4762('0x3'));var auth=require(_0x4762('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4762('0x5'));router[_0x4762('0x6')]('/',auth[_0x4762('0x7')](),controller[_0x4762('0x8')]);router[_0x4762('0x6')](_0x4762('0x9'),auth[_0x4762('0x7')](),controller[_0x4762('0xa')]);router[_0x4762('0x6')]('/:id',auth[_0x4762('0x7')](),controller[_0x4762('0xb')]);router['post']('/',auth[_0x4762('0x7')](),controller[_0x4762('0xc')]);router[_0x4762('0xd')]('/:id',auth[_0x4762('0x7')](),controller['update']);router['delete'](_0x4762('0xe'),auth[_0x4762('0x7')](),controller[_0x4762('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 91a7e0f..5280121 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x22e468,_0x575fe0){var _0x1d2986=function(_0x418032){while(--_0x418032){_0x22e468['push'](_0x22e468['shift']());}};_0x1d2986(++_0x575fe0);}(_0x7a54,0x106));var _0x47a5=function(_0x4c532e,_0x371064){_0x4c532e=_0x4c532e-0x0;var _0x193e66=_0x7a54[_0x4c532e];return _0x193e66;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x28d43f,_0x326cb4){var _0x646bf=function(_0x5e5769){while(--_0x5e5769){_0x28d43f['push'](_0x28d43f['shift']());}};_0x646bf(++_0x326cb4);}(_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 893a384..fad640e 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 _0x7072=['moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','WhatsappQueueReport','fieldName','type','key','map','query','keys','filters','intersection','model','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','attributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7072,0x138));var _0x2707=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x7072[_0x166742];return _0xb7814a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x3f6976,_0x171add){return function(_0x2ad386){if(!_0x2ad386){_0x3f6976[_0x2707('0x1a')](0x194);}return _0x2ad386;};}function handleError(_0x528b20,_0x2dce16){_0x2dce16=_0x2dce16||0x1f4;return function(_0x4ca05d){logger[_0x2707('0x2a')](_0x4ca05d[_0x2707('0x2b')]);if(_0x4ca05d[_0x2707('0x2c')]){delete _0x4ca05d['name'];}_0x528b20[_0x2707('0x1c')](_0x2dce16)[_0x2707('0x2d')](_0x4ca05d);};}exports[_0x2707('0x2e')]=function(_0x529be8,_0x31e990){var _0x42adf8={},_0x4a99ce={},_0xd63d3f={'count':0x0,'rows':[]};var _0x497c92=_['map'](db[_0x2707('0x2f')]['rawAttributes'],function(_0x2a0d24){return{'name':_0x2a0d24[_0x2707('0x30')],'type':_0x2a0d24[_0x2707('0x31')][_0x2707('0x32')]};});_0x4a99ce['model']=_[_0x2707('0x33')](_0x497c92,_0x2707('0x2c'));_0x4a99ce[_0x2707('0x34')]=_[_0x2707('0x35')](_0x529be8[_0x2707('0x34')]);_0x4a99ce[_0x2707('0x36')]=_[_0x2707('0x37')](_0x4a99ce[_0x2707('0x38')],_0x4a99ce[_0x2707('0x34')]);_0x42adf8['attributes']=_[_0x2707('0x37')](_0x4a99ce[_0x2707('0x38')],qs['fields'](_0x529be8['query']['fields']));_0x42adf8['attributes']=_0x42adf8['attributes'][_0x2707('0x39')]?_0x42adf8['attributes']:_0x4a99ce['model'];if(!_0x529be8[_0x2707('0x34')][_0x2707('0x3a')]('nolimit')){_0x42adf8[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x529be8['query']['limit']);_0x42adf8[_0x2707('0x1d')]=qs[_0x2707('0x1d')](_0x529be8['query']['offset']);}_0x42adf8[_0x2707('0x3b')]=qs[_0x2707('0x3c')](_0x529be8['query'][_0x2707('0x3c')]);_0x42adf8[_0x2707('0x3d')]=qs[_0x2707('0x36')](_[_0x2707('0x3e')](_0x529be8[_0x2707('0x34')],_0x4a99ce[_0x2707('0x36')]),_0x497c92);if(_0x529be8['query'][_0x2707('0x3f')]){_0x42adf8[_0x2707('0x3d')]=_[_0x2707('0x40')](_0x42adf8[_0x2707('0x3d')],{'$or':_[_0x2707('0x33')](_0x497c92,function(_0x1b9d71){if(_0x1b9d71[_0x2707('0x31')]!=='VIRTUAL'){var _0x3f85a0={};_0x3f85a0[_0x1b9d71[_0x2707('0x2c')]]={'$like':'%'+_0x529be8[_0x2707('0x34')][_0x2707('0x3f')]+'%'};return _0x3f85a0;}})});}_0x42adf8=_[_0x2707('0x40')]({},_0x42adf8,_0x529be8[_0x2707('0x41')]);var _0x3ed513={'where':_0x42adf8[_0x2707('0x3d')]};return db[_0x2707('0x2f')][_0x2707('0x20')](_0x3ed513)[_0x2707('0x29')](function(_0x3368cd){_0xd63d3f[_0x2707('0x20')]=_0x3368cd;if(_0x529be8[_0x2707('0x34')][_0x2707('0x42')]){_0x42adf8[_0x2707('0x43')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x2707('0x44')](_0x42adf8);})[_0x2707('0x29')](function(_0x5053ba){_0xd63d3f[_0x2707('0x45')]=_0x5053ba;return _0xd63d3f;})['then'](respondWithFilteredResult(_0x31e990,_0x42adf8))[_0x2707('0x46')](handleError(_0x31e990,null));};exports[_0x2707('0x47')]=function(_0x3a91da,_0x1d69d3){var _0x13e1c0={'raw':!![],'where':{'id':_0x3a91da[_0x2707('0x48')]['id']}},_0xdeec24={};_0xdeec24['model']=_[_0x2707('0x35')](db[_0x2707('0x2f')]['rawAttributes']);_0xdeec24[_0x2707('0x34')]=_[_0x2707('0x35')](_0x3a91da[_0x2707('0x34')]);_0xdeec24['filters']=_['intersection'](_0xdeec24[_0x2707('0x38')],_0xdeec24[_0x2707('0x34')]);_0x13e1c0['attributes']=_[_0x2707('0x37')](_0xdeec24['model'],qs[_0x2707('0x49')](_0x3a91da[_0x2707('0x34')][_0x2707('0x49')]));_0x13e1c0[_0x2707('0x4a')]=_0x13e1c0['attributes'][_0x2707('0x39')]?_0x13e1c0[_0x2707('0x4a')]:_0xdeec24[_0x2707('0x38')];if(_0x3a91da[_0x2707('0x34')][_0x2707('0x42')]){_0x13e1c0[_0x2707('0x43')]=[{'all':!![]}];}_0x13e1c0=_[_0x2707('0x40')]({},_0x13e1c0,_0x3a91da['options']);return db[_0x2707('0x2f')][_0x2707('0x4b')](_0x13e1c0)[_0x2707('0x29')](handleEntityNotFound(_0x1d69d3,null))[_0x2707('0x29')](respondWithResult(_0x1d69d3,null))[_0x2707('0x46')](handleError(_0x1d69d3,null));};exports['create']=function(_0x35917d,_0x4a6eea){return db[_0x2707('0x2f')][_0x2707('0x4c')](_0x35917d['body'],{})[_0x2707('0x29')](respondWithResult(_0x4a6eea,0xc9))[_0x2707('0x46')](handleError(_0x4a6eea,null));};exports[_0x2707('0x27')]=function(_0x4ae196,_0x1a8034){if(_0x4ae196['body']['id']){delete _0x4ae196[_0x2707('0x4d')]['id'];}return db[_0x2707('0x2f')]['find']({'where':{'id':_0x4ae196[_0x2707('0x48')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x1a8034,null))[_0x2707('0x29')](saveUpdates(_0x4ae196['body'],null))['then'](respondWithResult(_0x1a8034,null))[_0x2707('0x46')](handleError(_0x1a8034,null));};exports[_0x2707('0x28')]=function(_0x292b44,_0x2515dc){return db[_0x2707('0x2f')]['find']({'where':{'id':_0x292b44['params']['id']}})['then'](handleEntityNotFound(_0x2515dc,null))[_0x2707('0x29')](removeEntity(_0x2515dc,null))[_0x2707('0x46')](handleError(_0x2515dc,null));};exports[_0x2707('0x4e')]=function(_0x1dcf74,_0x1ffcce){return db['WhatsappQueueReport'][_0x2707('0x4e')]()[_0x2707('0x29')](respondWithResult(_0x1ffcce,null))['catch'](handleError(_0x1ffcce,null));}; \ No newline at end of file +var _0x1339=['../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','WhatsappQueueReport','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x484cd0,_0x249fee){var _0x2b6362=function(_0x9140a1){while(--_0x9140a1){_0x484cd0['push'](_0x484cd0['shift']());}};_0x2b6362(++_0x249fee);}(_0x1339,0x1ed));var _0x9133=function(_0x59ff04,_0x508027){_0x59ff04=_0x59ff04-0x0;var _0x43effc=_0x1339[_0x59ff04];return _0x43effc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));};exports[_0x9133('0x49')]=function(_0x4f7b1e,_0x2342f4){return db[_0x9133('0x29')][_0x9133('0x49')]()[_0x9133('0x20')](respondWithResult(_0x2342f4,null))['catch'](handleError(_0x2342f4,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index c26550b..662a139 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 _0x3da0=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport'];(function(_0x32c6f7,_0x10a8af){var _0x15e0ec=function(_0x35e120){while(--_0x35e120){_0x32c6f7['push'](_0x32c6f7['shift']());}};_0x15e0ec(++_0x10a8af);}(_0x3da0,0x89));var _0x03da=function(_0x459573,_0x35679e){_0x459573=_0x459573-0x0;var _0x51ffcd=_0x3da0[_0x459573];return _0x51ffcd;};'use strict';var _=require(_0x03da('0x0'));var util=require(_0x03da('0x1'));var logger=require(_0x03da('0x2'))(_0x03da('0x3'));var moment=require(_0x03da('0x4'));var BPromise=require(_0x03da('0x5'));var rp=require(_0x03da('0x6'));var fs=require('fs');var path=require(_0x03da('0x7'));var rimraf=require(_0x03da('0x8'));var config=require(_0x03da('0x9'));var attributes=require(_0x03da('0xa'));module['exports']=function(_0x4ed393,_0xa163fd){return _0x4ed393[_0x03da('0xb')](_0x03da('0xc'),attributes,{'tableName':_0x03da('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x03da('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e47=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x1e47,0x115));var _0x71e4=function(_0x5f0129,_0x56c699){_0x5f0129=_0x5f0129-0x0;var _0x231531=_0x1e47[_0x5f0129];return _0x231531;};'use strict';var _=require(_0x71e4('0x0'));var util=require(_0x71e4('0x1'));var logger=require(_0x71e4('0x2'))(_0x71e4('0x3'));var moment=require('moment');var BPromise=require(_0x71e4('0x4'));var rp=require(_0x71e4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x71e4('0x6'));var attributes=require(_0x71e4('0x7'));module[_0x71e4('0x8')]=function(_0x279aa9,_0x276f4d){return _0x279aa9[_0x71e4('0x9')](_0x71e4('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x71e4('0xb'),'fields':[_0x71e4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 5159a76..abbd654 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 _0xd750=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','stringify','UpdateWhatsappQueueReport','update','where','attributes','lodash','util'];(function(_0x238a5b,_0x26ae74){var _0x30826a=function(_0x9fcd1c){while(--_0x9fcd1c){_0x238a5b['push'](_0x238a5b['shift']());}};_0x30826a(++_0x26ae74);}(_0xd750,0x1ed));var _0x0d75=function(_0x46f01a,_0xc5ab14){_0x46f01a=_0x46f01a-0x0;var _0xfe8a59=_0xd750[_0x46f01a];return _0xfe8a59;};'use strict';var _=require(_0x0d75('0x0'));var util=require(_0x0d75('0x1'));var moment=require(_0x0d75('0x2'));var BPromise=require(_0x0d75('0x3'));var rs=require(_0x0d75('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0d75('0x5'));var logger=require('../../config/logger')(_0x0d75('0x6'));var config=require(_0x0d75('0x7'));var jayson=require(_0x0d75('0x8'));var client=jayson[_0x0d75('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fd7f0,_0x1f3c62,_0x4ff7ff){return new BPromise(function(_0x21c7e4,_0xfb2e74){return client[_0x0d75('0xa')](_0x1fd7f0,_0x4ff7ff)[_0x0d75('0xb')](function(_0xea152d){logger[_0x0d75('0xc')](_0x0d75('0xd'),_0x1f3c62,_0x0d75('0xe'));logger['debug'](_0x0d75('0xf'),_0x1f3c62,'request\x20sent',JSON['stringify'](_0xea152d));if(_0xea152d[_0x0d75('0x10')]){if(_0xea152d[_0x0d75('0x10')][_0x0d75('0x11')]===0x1f4){logger[_0x0d75('0x10')](_0x0d75('0xd'),_0x1f3c62,_0xea152d[_0x0d75('0x10')][_0x0d75('0x12')]);return _0xfb2e74(_0xea152d[_0x0d75('0x10')]['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x1f3c62,_0xea152d[_0x0d75('0x10')]['message']);return _0x21c7e4(_0xea152d[_0x0d75('0x10')][_0x0d75('0x12')]);}else{logger[_0x0d75('0xc')](_0x0d75('0xd'),_0x1f3c62,'request\x20sent');_0x21c7e4(_0xea152d[_0x0d75('0x13')][_0x0d75('0x12')]);}})[_0x0d75('0x14')](function(_0x1bc47d){logger[_0x0d75('0x10')](_0x0d75('0xd'),_0x1f3c62,_0x1bc47d);_0xfb2e74(_0x1bc47d);});});}exports[_0x0d75('0x15')]=function(_0x512082){var _0x41f9fc=this;return new Promise(function(_0x3b3a04,_0x1ac85d){return db[_0x0d75('0x16')][_0x0d75('0x17')](_0x512082[_0x0d75('0x18')],{'raw':_0x512082['options']?_0x512082[_0x0d75('0x19')][_0x0d75('0x1a')]===undefined?!![]:![]:!![]})[_0x0d75('0xb')](function(_0x5c0b45){logger[_0x0d75('0xc')](_0x0d75('0x15'),_0x512082);logger[_0x0d75('0x1b')]('CreateWhatsappQueueReport',_0x512082,JSON[_0x0d75('0x1c')](_0x5c0b45));_0x3b3a04(_0x5c0b45);})[_0x0d75('0x14')](function(_0xad4550){logger[_0x0d75('0x10')]('CreateWhatsappQueueReport',_0xad4550[_0x0d75('0x12')],_0x512082);_0x1ac85d(_0x41f9fc[_0x0d75('0x10')](0x1f4,_0xad4550[_0x0d75('0x12')]));});});};exports[_0x0d75('0x1d')]=function(_0x18dc1d){var _0x287394=this;return new Promise(function(_0x579a40,_0x3c3174){return db[_0x0d75('0x16')][_0x0d75('0x1e')](_0x18dc1d[_0x0d75('0x18')],{'raw':_0x18dc1d[_0x0d75('0x19')]?_0x18dc1d[_0x0d75('0x19')][_0x0d75('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18dc1d[_0x0d75('0x19')]?_0x18dc1d['options'][_0x0d75('0x1f')]||null:null,'attributes':_0x18dc1d[_0x0d75('0x19')]?_0x18dc1d[_0x0d75('0x19')][_0x0d75('0x20')]||null:null,'limit':_0x18dc1d[_0x0d75('0x19')]?_0x18dc1d[_0x0d75('0x19')]['limit']||null:null})[_0x0d75('0xb')](function(_0x7dd249){logger[_0x0d75('0xc')](_0x0d75('0x1d'),_0x18dc1d);logger[_0x0d75('0x1b')](_0x0d75('0x1d'),_0x18dc1d,JSON[_0x0d75('0x1c')](_0x7dd249));_0x579a40(_0x7dd249);})['catch'](function(_0x5f1534){logger['error'](_0x0d75('0x1d'),_0x5f1534[_0x0d75('0x12')],_0x18dc1d);_0x3c3174(_0x287394['error'](0x1f4,_0x5f1534['message']));});});}; \ No newline at end of file +var _0xef5b=['util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','debug','UpdateWhatsappQueueReport','update','where','attributes','lodash'];(function(_0x4a9433,_0x5337cb){var _0x434947=function(_0x3ab6cd){while(--_0x3ab6cd){_0x4a9433['push'](_0x4a9433['shift']());}};_0x434947(++_0x5337cb);}(_0xef5b,0x17f));var _0xbef5=function(_0x29c62e,_0x267c9f){_0x29c62e=_0x29c62e-0x0;var _0x2df4cd=_0xef5b[_0x29c62e];return _0x2df4cd;};'use strict';var _=require(_0xbef5('0x0'));var util=require(_0xbef5('0x1'));var moment=require(_0xbef5('0x2'));var BPromise=require('bluebird');var rs=require(_0xbef5('0x3'));var fs=require('fs');var Redis=require(_0xbef5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbef5('0x5'));var logger=require('../../config/logger')(_0xbef5('0x6'));var config=require(_0xbef5('0x7'));var jayson=require(_0xbef5('0x8'));var client=jayson[_0xbef5('0x9')][_0xbef5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa528,_0x551030,_0x817706){return new BPromise(function(_0x2e8d9b,_0x55184d){return client['request'](_0x4aa528,_0x817706)['then'](function(_0x210be7){logger[_0xbef5('0xb')](_0xbef5('0xc'),_0x551030,_0xbef5('0xd'));logger['debug'](_0xbef5('0xe'),_0x551030,_0xbef5('0xd'),JSON[_0xbef5('0xf')](_0x210be7));if(_0x210be7[_0xbef5('0x10')]){if(_0x210be7['error']['code']===0x1f4){logger[_0xbef5('0x10')](_0xbef5('0xc'),_0x551030,_0x210be7[_0xbef5('0x10')]['message']);return _0x55184d(_0x210be7[_0xbef5('0x10')]['message']);}logger[_0xbef5('0x10')](_0xbef5('0xc'),_0x551030,_0x210be7[_0xbef5('0x10')]['message']);return _0x2e8d9b(_0x210be7[_0xbef5('0x10')][_0xbef5('0x11')]);}else{logger[_0xbef5('0xb')](_0xbef5('0xc'),_0x551030,_0xbef5('0xd'));_0x2e8d9b(_0x210be7[_0xbef5('0x12')]['message']);}})[_0xbef5('0x13')](function(_0x2c610e){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x551030,_0x2c610e);_0x55184d(_0x2c610e);});});}exports[_0xbef5('0x14')]=function(_0x593ad7){var _0x15f3bf=this;return new Promise(function(_0x4e201a,_0x2f1bc3){return db[_0xbef5('0x15')][_0xbef5('0x16')](_0x593ad7[_0xbef5('0x17')],{'raw':_0x593ad7[_0xbef5('0x18')]?_0x593ad7[_0xbef5('0x18')][_0xbef5('0x19')]===undefined?!![]:![]:!![]})[_0xbef5('0x1a')](function(_0x32a225){logger[_0xbef5('0xb')](_0xbef5('0x14'),_0x593ad7);logger[_0xbef5('0x1b')](_0xbef5('0x14'),_0x593ad7,JSON['stringify'](_0x32a225));_0x4e201a(_0x32a225);})[_0xbef5('0x13')](function(_0x99e3a5){logger[_0xbef5('0x10')](_0xbef5('0x14'),_0x99e3a5[_0xbef5('0x11')],_0x593ad7);_0x2f1bc3(_0x15f3bf[_0xbef5('0x10')](0x1f4,_0x99e3a5[_0xbef5('0x11')]));});});};exports[_0xbef5('0x1c')]=function(_0x1e591b){var _0x16ecd3=this;return new Promise(function(_0x3de277,_0x1c2150){return db[_0xbef5('0x15')][_0xbef5('0x1d')](_0x1e591b[_0xbef5('0x17')],{'raw':_0x1e591b[_0xbef5('0x18')]?_0x1e591b[_0xbef5('0x18')][_0xbef5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e591b['options']?_0x1e591b['options'][_0xbef5('0x1e')]||null:null,'attributes':_0x1e591b[_0xbef5('0x18')]?_0x1e591b['options'][_0xbef5('0x1f')]||null:null,'limit':_0x1e591b[_0xbef5('0x18')]?_0x1e591b[_0xbef5('0x18')]['limit']||null:null})[_0xbef5('0x1a')](function(_0x385327){logger[_0xbef5('0xb')](_0xbef5('0x1c'),_0x1e591b);logger[_0xbef5('0x1b')]('UpdateWhatsappQueueReport',_0x1e591b,JSON['stringify'](_0x385327));_0x3de277(_0x385327);})[_0xbef5('0x13')](function(_0x32bbc7){logger['error'](_0xbef5('0x1c'),_0x32bbc7[_0xbef5('0x11')],_0x1e591b);_0x1c2150(_0x16ecd3[_0xbef5('0x10')](0x1f4,_0x32bbc7[_0xbef5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 9108cc6..90872cd 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 _0xeeb1=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0xeeb1,0x91));var _0x1eeb=function(_0x253b45,_0x32b9da){_0x253b45=_0x253b45-0x0;var _0x3e1947=_0xeeb1[_0x253b45];return _0x3e1947;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1eeb('0x0'));var timeout=require(_0x1eeb('0x1'));var express=require(_0x1eeb('0x2'));var router=express['Router']();var fs_extra=require(_0x1eeb('0x3'));var auth=require(_0x1eeb('0x4'));var interaction=require(_0x1eeb('0x5'));var config=require(_0x1eeb('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0x1eeb('0x7')]('/',auth[_0x1eeb('0x8')](),controller[_0x1eeb('0x9')]);router[_0x1eeb('0x7')](_0x1eeb('0xa'),auth['isAuthenticated'](),controller[_0x1eeb('0xb')]);router['get'](_0x1eeb('0xc'),auth[_0x1eeb('0x8')](),controller[_0x1eeb('0xd')]);router[_0x1eeb('0xe')]('/',auth['isAuthenticated'](),controller[_0x1eeb('0xf')]);router['put'](_0x1eeb('0xc'),auth['isAuthenticated'](),controller[_0x1eeb('0x10')]);router[_0x1eeb('0x11')](_0x1eeb('0xc'),auth[_0x1eeb('0x8')](),controller['destroy']);module[_0x1eeb('0x12')]=router; \ No newline at end of file +var _0x65c0=['get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x192cc3,_0x5edef6){var _0x4f1774=function(_0x53d916){while(--_0x53d916){_0x192cc3['push'](_0x192cc3['shift']());}};_0x4f1774(++_0x5edef6);}(_0x65c0,0x172));var _0x065c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x65c0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x065c('0x0'));var path=require(_0x065c('0x1'));var timeout=require(_0x065c('0x2'));var express=require(_0x065c('0x3'));var router=express[_0x065c('0x4')]();var fs_extra=require(_0x065c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x065c('0x6'));var config=require(_0x065c('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x065c('0x8')]('/',auth[_0x065c('0x9')](),controller[_0x065c('0xa')]);router[_0x065c('0x8')](_0x065c('0xb'),auth[_0x065c('0x9')](),controller[_0x065c('0xc')]);router[_0x065c('0x8')]('/:id',auth[_0x065c('0x9')](),controller['show']);router[_0x065c('0xd')]('/',auth[_0x065c('0x9')](),controller[_0x065c('0xe')]);router[_0x065c('0xf')](_0x065c('0x10'),auth[_0x065c('0x9')](),controller[_0x065c('0x11')]);router[_0x065c('0x12')](_0x065c('0x10'),auth['isAuthenticated'](),controller[_0x065c('0x13')]);module[_0x065c('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 6e6adc9..9dc1f96 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 _0x21f8=['queue','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x21f8,0x71));var _0x821f=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0x21f8[_0x53f0db];return _0xae0a5c;};'use strict';var Sequelize=require(_0x821f('0x0'));module[_0x821f('0x1')]={'uniqueid':{'type':Sequelize[_0x821f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x821f('0x3')](_0x821f('0x4'),_0x821f('0x5'),_0x821f('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x5523=['ENUM','account','agent','queue','DATE','STRING'];(function(_0x4824c1,_0x12548d){var _0x1972f0=function(_0x1940c2){while(--_0x1940c2){_0x4824c1['push'](_0x4824c1['shift']());}};_0x1972f0(++_0x12548d);}(_0x5523,0x137));var _0x3552=function(_0x43addb,_0xedcfc5){_0x43addb=_0x43addb-0x0;var _0x291816=_0x5523[_0x43addb];return _0x291816;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3552('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3552('0x1')](_0x3552('0x2'),_0x3552('0x3'),_0x3552('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x3552('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 2c41643..6e6fcd2 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 _0xf682=['update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','key','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','filters','fields','options','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf682,0x12f));var _0x2f68=function(_0x5afe20,_0x2ded37){_0x5afe20=_0x5afe20-0x0;var _0xfd8864=_0xf682[_0x5afe20];return _0xfd8864;};'use strict';var emlformat=require(_0x2f68('0x0'));var rimraf=require(_0x2f68('0x1'));var zipdir=require(_0x2f68('0x2'));var jsonpatch=require(_0x2f68('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f68('0x4'));var Mustache=require(_0x2f68('0x5'));var util=require(_0x2f68('0x6'));var path=require(_0x2f68('0x7'));var sox=require('sox');var csv=require(_0x2f68('0x8'));var ejs=require(_0x2f68('0x9'));var fs=require('fs');var fs_extra=require(_0x2f68('0xa'));var _=require(_0x2f68('0xb'));var squel=require('squel');var crypto=require(_0x2f68('0xc'));var jsforce=require(_0x2f68('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2f68('0xe'));var authService=require(_0x2f68('0xf'));var qs=require(_0x2f68('0x10'));var as=require(_0x2f68('0x11'));var hardwareService=require(_0x2f68('0x12'));var logger=require(_0x2f68('0x13'))(_0x2f68('0x14'));var utils=require(_0x2f68('0x15'));var config=require(_0x2f68('0x16'));var licenseUtil=require(_0x2f68('0x17'));var db=require(_0x2f68('0x18'))['db'];function respondWithStatusCode(_0xe71dbe,_0x2d9b69){_0x2d9b69=_0x2d9b69||0xcc;return function(_0x308cc9){if(_0x308cc9){return _0xe71dbe[_0x2f68('0x19')](_0x2d9b69);}return _0xe71dbe[_0x2f68('0x1a')](_0x2d9b69)['end']();};}function respondWithResult(_0xfb1457,_0x348383){_0x348383=_0x348383||0xc8;return function(_0x455ab1){if(_0x455ab1){return _0xfb1457[_0x2f68('0x1a')](_0x348383)[_0x2f68('0x1b')](_0x455ab1);}};}function respondWithFilteredResult(_0x1c2225,_0x421602){return function(_0x3106d2){if(_0x3106d2){var _0x4e4a11=typeof _0x421602[_0x2f68('0x1c')]===_0x2f68('0x1d')&&typeof _0x421602[_0x2f68('0x1e')]==='undefined';var _0x1b3415=_0x3106d2['count'];var _0x2ab432=_0x4e4a11?0x0:_0x421602['offset'];var _0x36abc4=_0x4e4a11?_0x3106d2[_0x2f68('0x1f')]:_0x421602[_0x2f68('0x1c')]+_0x421602[_0x2f68('0x1e')];var _0x2a8ecc;if(_0x36abc4>=_0x1b3415){_0x36abc4=_0x1b3415;_0x2a8ecc=0xc8;}else{_0x2a8ecc=0xce;}_0x1c2225['status'](_0x2a8ecc);return _0x1c2225[_0x2f68('0x20')](_0x2f68('0x21'),_0x2ab432+'-'+_0x36abc4+'/'+_0x1b3415)[_0x2f68('0x1b')](_0x3106d2);}return null;};}function patchUpdates(_0x5b7723){return function(_0x47ac88){try{jsonpatch[_0x2f68('0x22')](_0x47ac88,_0x5b7723,!![]);}catch(_0x345a67){return BPromise['reject'](_0x345a67);}return _0x47ac88['save']();};}function saveUpdates(_0x3141b4,_0x5d6ab9){return function(_0x41aa72){if(_0x41aa72){return _0x41aa72['update'](_0x3141b4)[_0x2f68('0x23')](function(_0x21e44a){return _0x21e44a;});}return null;};}function removeEntity(_0x2d0738,_0x14ef8e){return function(_0x31992a){if(_0x31992a){return _0x31992a[_0x2f68('0x24')]()['then'](function(){_0x2d0738['status'](0xcc)[_0x2f68('0x25')]();});}};}function handleEntityNotFound(_0xc2f5a,_0x49659c){return function(_0x56e1b7){if(!_0x56e1b7){_0xc2f5a[_0x2f68('0x19')](0x194);}return _0x56e1b7;};}function handleError(_0x5c8f36,_0x44876d){_0x44876d=_0x44876d||0x1f4;return function(_0x5b6039){logger[_0x2f68('0x26')](_0x5b6039[_0x2f68('0x27')]);if(_0x5b6039[_0x2f68('0x28')]){delete _0x5b6039[_0x2f68('0x28')];}_0x5c8f36['status'](_0x44876d)[_0x2f68('0x29')](_0x5b6039);};}exports[_0x2f68('0x2a')]=function(_0xe27015,_0x1cb800){var _0x44ce52={},_0x1af673={},_0xd98322={'count':0x0,'rows':[]};var _0x17e037=_[_0x2f68('0x2b')](db[_0x2f68('0x2c')][_0x2f68('0x2d')],function(_0x2ebac9){return{'name':_0x2ebac9['fieldName'],'type':_0x2ebac9['type'][_0x2f68('0x2e')]};});_0x1af673['model']=_[_0x2f68('0x2b')](_0x17e037,_0x2f68('0x28'));_0x1af673[_0x2f68('0x2f')]=_['keys'](_0xe27015['query']);_0x1af673['filters']=_[_0x2f68('0x30')](_0x1af673[_0x2f68('0x31')],_0x1af673['query']);_0x44ce52[_0x2f68('0x32')]=_['intersection'](_0x1af673[_0x2f68('0x31')],qs['fields'](_0xe27015[_0x2f68('0x2f')]['fields']));_0x44ce52['attributes']=_0x44ce52[_0x2f68('0x32')][_0x2f68('0x33')]?_0x44ce52[_0x2f68('0x32')]:_0x1af673[_0x2f68('0x31')];if(!_0xe27015[_0x2f68('0x2f')][_0x2f68('0x34')](_0x2f68('0x35'))){_0x44ce52[_0x2f68('0x1e')]=qs['limit'](_0xe27015[_0x2f68('0x2f')][_0x2f68('0x1e')]);_0x44ce52['offset']=qs[_0x2f68('0x1c')](_0xe27015['query'][_0x2f68('0x1c')]);}_0x44ce52[_0x2f68('0x36')]=qs[_0x2f68('0x37')](_0xe27015[_0x2f68('0x2f')][_0x2f68('0x37')]);_0x44ce52[_0x2f68('0x38')]=qs['filters'](_['pick'](_0xe27015[_0x2f68('0x2f')],_0x1af673['filters']),_0x17e037);if(_0xe27015[_0x2f68('0x2f')][_0x2f68('0x39')]){_0x44ce52['where']=_[_0x2f68('0x3a')](_0x44ce52[_0x2f68('0x38')],{'$or':_[_0x2f68('0x2b')](_0x17e037,function(_0x4464e9){if(_0x4464e9['type']!==_0x2f68('0x3b')){var _0xa7b636={};_0xa7b636[_0x4464e9[_0x2f68('0x28')]]={'$like':'%'+_0xe27015[_0x2f68('0x2f')][_0x2f68('0x39')]+'%'};return _0xa7b636;}})});}_0x44ce52=_[_0x2f68('0x3a')]({},_0x44ce52,_0xe27015['options']);var _0x411de5={'where':_0x44ce52[_0x2f68('0x38')]};return db[_0x2f68('0x2c')][_0x2f68('0x1f')](_0x411de5)[_0x2f68('0x23')](function(_0x281b3e){_0xd98322[_0x2f68('0x1f')]=_0x281b3e;if(_0xe27015[_0x2f68('0x2f')][_0x2f68('0x3c')]){_0x44ce52[_0x2f68('0x3d')]=[{'all':!![]}];}return db[_0x2f68('0x2c')][_0x2f68('0x3e')](_0x44ce52);})['then'](function(_0x3c27eb){_0xd98322[_0x2f68('0x3f')]=_0x3c27eb;return _0xd98322;})[_0x2f68('0x23')](respondWithFilteredResult(_0x1cb800,_0x44ce52))[_0x2f68('0x40')](handleError(_0x1cb800,null));};exports['show']=function(_0x33021a,_0x9f5c30){var _0x47082e={'raw':!![],'where':{'id':_0x33021a[_0x2f68('0x41')]['id']}},_0x326854={};_0x326854[_0x2f68('0x31')]=_['keys'](db[_0x2f68('0x2c')][_0x2f68('0x2d')]);_0x326854['query']=_[_0x2f68('0x42')](_0x33021a[_0x2f68('0x2f')]);_0x326854[_0x2f68('0x43')]=_['intersection'](_0x326854[_0x2f68('0x31')],_0x326854[_0x2f68('0x2f')]);_0x47082e[_0x2f68('0x32')]=_[_0x2f68('0x30')](_0x326854['model'],qs[_0x2f68('0x44')](_0x33021a['query'][_0x2f68('0x44')]));_0x47082e[_0x2f68('0x32')]=_0x47082e[_0x2f68('0x32')][_0x2f68('0x33')]?_0x47082e[_0x2f68('0x32')]:_0x326854[_0x2f68('0x31')];if(_0x33021a[_0x2f68('0x2f')]['includeAll']){_0x47082e[_0x2f68('0x3d')]=[{'all':!![]}];}_0x47082e=_[_0x2f68('0x3a')]({},_0x47082e,_0x33021a[_0x2f68('0x45')]);return db[_0x2f68('0x2c')][_0x2f68('0x46')](_0x47082e)['then'](handleEntityNotFound(_0x9f5c30,null))[_0x2f68('0x23')](respondWithResult(_0x9f5c30,null))[_0x2f68('0x40')](handleError(_0x9f5c30,null));};exports[_0x2f68('0x47')]=function(_0x513e39,_0x29723a){return db[_0x2f68('0x2c')][_0x2f68('0x47')](_0x513e39['body'],{})['then'](respondWithResult(_0x29723a,0xc9))['catch'](handleError(_0x29723a,null));};exports[_0x2f68('0x48')]=function(_0x579fe7,_0x3a39be){if(_0x579fe7[_0x2f68('0x49')]['id']){delete _0x579fe7['body']['id'];}return db[_0x2f68('0x2c')][_0x2f68('0x46')]({'where':{'id':_0x579fe7[_0x2f68('0x41')]['id']}})[_0x2f68('0x23')](handleEntityNotFound(_0x3a39be,null))[_0x2f68('0x23')](saveUpdates(_0x579fe7[_0x2f68('0x49')],null))[_0x2f68('0x23')](respondWithResult(_0x3a39be,null))[_0x2f68('0x40')](handleError(_0x3a39be,null));};exports[_0x2f68('0x24')]=function(_0x4d1afc,_0x2209cb){return db[_0x2f68('0x2c')]['find']({'where':{'id':_0x4d1afc[_0x2f68('0x41')]['id']}})[_0x2f68('0x23')](handleEntityNotFound(_0x2209cb,null))[_0x2f68('0x23')](removeEntity(_0x2209cb,null))[_0x2f68('0x40')](handleError(_0x2209cb,null));};exports[_0x2f68('0x4a')]=function(_0x6596df,_0xdb66b1){return db['WhatsappTransferReport'][_0x2f68('0x4a')]()[_0x2f68('0x23')](respondWithResult(_0xdb66b1,null))[_0x2f68('0x40')](handleError(_0xdb66b1,null));}; \ No newline at end of file +var _0x05e8=['../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','filters','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3001d9,_0x299963){var _0x315068=function(_0x570f06){while(--_0x570f06){_0x3001d9['push'](_0x3001d9['shift']());}};_0x315068(++_0x299963);}(_0x05e8,0xc9));var _0x805e=function(_0x1e6124,_0x209962){_0x1e6124=_0x1e6124-0x0;var _0x490597=_0x05e8[_0x1e6124];return _0x490597;};'use strict';var emlformat=require(_0x805e('0x0'));var rimraf=require(_0x805e('0x1'));var zipdir=require(_0x805e('0x2'));var jsonpatch=require(_0x805e('0x3'));var rp=require('request-promise');var moment=require(_0x805e('0x4'));var BPromise=require(_0x805e('0x5'));var Mustache=require(_0x805e('0x6'));var util=require(_0x805e('0x7'));var path=require('path');var sox=require(_0x805e('0x8'));var csv=require('to-csv');var ejs=require(_0x805e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x805e('0xa'));var squel=require('squel');var crypto=require(_0x805e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x805e('0xc'));var querystring=require(_0x805e('0xd'));var Papa=require(_0x805e('0xe'));var Redis=require(_0x805e('0xf'));var authService=require(_0x805e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x805e('0x11'));var hardwareService=require(_0x805e('0x12'));var logger=require(_0x805e('0x13'))(_0x805e('0x14'));var utils=require(_0x805e('0x15'));var config=require(_0x805e('0x16'));var licenseUtil=require(_0x805e('0x17'));var db=require(_0x805e('0x18'))['db'];function respondWithStatusCode(_0x3d9d94,_0x5658e7){_0x5658e7=_0x5658e7||0xcc;return function(_0xacb97a){if(_0xacb97a){return _0x3d9d94['sendStatus'](_0x5658e7);}return _0x3d9d94[_0x805e('0x19')](_0x5658e7)[_0x805e('0x1a')]();};}function respondWithResult(_0x1e0a26,_0x8773cd){_0x8773cd=_0x8773cd||0xc8;return function(_0xc9cb3a){if(_0xc9cb3a){return _0x1e0a26[_0x805e('0x19')](_0x8773cd)['json'](_0xc9cb3a);}};}function respondWithFilteredResult(_0x5216f2,_0x4ba0b8){return function(_0x4d6034){if(_0x4d6034){var _0x20367c=typeof _0x4ba0b8[_0x805e('0x1b')]===_0x805e('0x1c')&&typeof _0x4ba0b8[_0x805e('0x1d')]===_0x805e('0x1c');var _0x3af7b9=_0x4d6034[_0x805e('0x1e')];var _0x41d629=_0x20367c?0x0:_0x4ba0b8[_0x805e('0x1b')];var _0x46c265=_0x20367c?_0x4d6034[_0x805e('0x1e')]:_0x4ba0b8[_0x805e('0x1b')]+_0x4ba0b8[_0x805e('0x1d')];var _0x569b6b;if(_0x46c265>=_0x3af7b9){_0x46c265=_0x3af7b9;_0x569b6b=0xc8;}else{_0x569b6b=0xce;}_0x5216f2[_0x805e('0x19')](_0x569b6b);return _0x5216f2[_0x805e('0x1f')](_0x805e('0x20'),_0x41d629+'-'+_0x46c265+'/'+_0x3af7b9)[_0x805e('0x21')](_0x4d6034);}return null;};}function patchUpdates(_0x38c6f0){return function(_0x19a107){try{jsonpatch[_0x805e('0x22')](_0x19a107,_0x38c6f0,!![]);}catch(_0x29171d){return BPromise[_0x805e('0x23')](_0x29171d);}return _0x19a107[_0x805e('0x24')]();};}function saveUpdates(_0x59594a,_0x3750b0){return function(_0x28f8d4){if(_0x28f8d4){return _0x28f8d4[_0x805e('0x25')](_0x59594a)[_0x805e('0x26')](function(_0x93dc98){return _0x93dc98;});}return null;};}function removeEntity(_0x5c8dbd,_0x16e27a){return function(_0x4626c9){if(_0x4626c9){return _0x4626c9[_0x805e('0x27')]()[_0x805e('0x26')](function(){_0x5c8dbd['status'](0xcc)[_0x805e('0x1a')]();});}};}function handleEntityNotFound(_0x413298,_0x388ceb){return function(_0x334a1b){if(!_0x334a1b){_0x413298[_0x805e('0x28')](0x194);}return _0x334a1b;};}function handleError(_0x483a34,_0x5ad757){_0x5ad757=_0x5ad757||0x1f4;return function(_0x28499a){logger['error'](_0x28499a[_0x805e('0x29')]);if(_0x28499a[_0x805e('0x2a')]){delete _0x28499a['name'];}_0x483a34[_0x805e('0x19')](_0x5ad757)['send'](_0x28499a);};}exports[_0x805e('0x2b')]=function(_0x57a9b1,_0x19b766){var _0x38be2a={},_0x183bb5={},_0x1cafea={'count':0x0,'rows':[]};var _0x316913=_[_0x805e('0x2c')](db[_0x805e('0x2d')][_0x805e('0x2e')],function(_0x3b299e){return{'name':_0x3b299e['fieldName'],'type':_0x3b299e[_0x805e('0x2f')][_0x805e('0x30')]};});_0x183bb5[_0x805e('0x31')]=_[_0x805e('0x2c')](_0x316913,_0x805e('0x2a'));_0x183bb5[_0x805e('0x32')]=_[_0x805e('0x33')](_0x57a9b1[_0x805e('0x32')]);_0x183bb5['filters']=_[_0x805e('0x34')](_0x183bb5['model'],_0x183bb5[_0x805e('0x32')]);_0x38be2a['attributes']=_[_0x805e('0x34')](_0x183bb5['model'],qs[_0x805e('0x35')](_0x57a9b1[_0x805e('0x32')]['fields']));_0x38be2a[_0x805e('0x36')]=_0x38be2a[_0x805e('0x36')][_0x805e('0x37')]?_0x38be2a[_0x805e('0x36')]:_0x183bb5['model'];if(!_0x57a9b1[_0x805e('0x32')][_0x805e('0x38')](_0x805e('0x39'))){_0x38be2a['limit']=qs[_0x805e('0x1d')](_0x57a9b1[_0x805e('0x32')][_0x805e('0x1d')]);_0x38be2a[_0x805e('0x1b')]=qs[_0x805e('0x1b')](_0x57a9b1[_0x805e('0x32')][_0x805e('0x1b')]);}_0x38be2a[_0x805e('0x3a')]=qs['sort'](_0x57a9b1[_0x805e('0x32')]['sort']);_0x38be2a[_0x805e('0x3b')]=qs['filters'](_[_0x805e('0x3c')](_0x57a9b1[_0x805e('0x32')],_0x183bb5['filters']),_0x316913);if(_0x57a9b1[_0x805e('0x32')][_0x805e('0x3d')]){_0x38be2a['where']=_[_0x805e('0x3e')](_0x38be2a[_0x805e('0x3b')],{'$or':_[_0x805e('0x2c')](_0x316913,function(_0x21d9b8){if(_0x21d9b8[_0x805e('0x2f')]!==_0x805e('0x3f')){var _0x24e89b={};_0x24e89b[_0x21d9b8[_0x805e('0x2a')]]={'$like':'%'+_0x57a9b1[_0x805e('0x32')]['filter']+'%'};return _0x24e89b;}})});}_0x38be2a=_['merge']({},_0x38be2a,_0x57a9b1['options']);var _0x4c0648={'where':_0x38be2a[_0x805e('0x3b')]};return db[_0x805e('0x2d')]['count'](_0x4c0648)[_0x805e('0x26')](function(_0x167819){_0x1cafea[_0x805e('0x1e')]=_0x167819;if(_0x57a9b1[_0x805e('0x32')][_0x805e('0x40')]){_0x38be2a['include']=[{'all':!![]}];}return db[_0x805e('0x2d')]['findAll'](_0x38be2a);})['then'](function(_0x1c4fc0){_0x1cafea[_0x805e('0x41')]=_0x1c4fc0;return _0x1cafea;})['then'](respondWithFilteredResult(_0x19b766,_0x38be2a))['catch'](handleError(_0x19b766,null));};exports[_0x805e('0x42')]=function(_0x224684,_0x58660e){var _0x3cb2a2={'raw':!![],'where':{'id':_0x224684['params']['id']}},_0x2278ba={};_0x2278ba[_0x805e('0x31')]=_['keys'](db[_0x805e('0x2d')][_0x805e('0x2e')]);_0x2278ba[_0x805e('0x32')]=_[_0x805e('0x33')](_0x224684[_0x805e('0x32')]);_0x2278ba[_0x805e('0x43')]=_[_0x805e('0x34')](_0x2278ba[_0x805e('0x31')],_0x2278ba['query']);_0x3cb2a2[_0x805e('0x36')]=_[_0x805e('0x34')](_0x2278ba[_0x805e('0x31')],qs[_0x805e('0x35')](_0x224684[_0x805e('0x32')][_0x805e('0x35')]));_0x3cb2a2[_0x805e('0x36')]=_0x3cb2a2[_0x805e('0x36')]['length']?_0x3cb2a2[_0x805e('0x36')]:_0x2278ba[_0x805e('0x31')];if(_0x224684[_0x805e('0x32')]['includeAll']){_0x3cb2a2[_0x805e('0x44')]=[{'all':!![]}];}_0x3cb2a2=_[_0x805e('0x3e')]({},_0x3cb2a2,_0x224684['options']);return db[_0x805e('0x2d')][_0x805e('0x45')](_0x3cb2a2)[_0x805e('0x26')](handleEntityNotFound(_0x58660e,null))['then'](respondWithResult(_0x58660e,null))[_0x805e('0x46')](handleError(_0x58660e,null));};exports[_0x805e('0x47')]=function(_0x3c1e0c,_0x4e2dfb){return db[_0x805e('0x2d')][_0x805e('0x47')](_0x3c1e0c[_0x805e('0x48')],{})['then'](respondWithResult(_0x4e2dfb,0xc9))[_0x805e('0x46')](handleError(_0x4e2dfb,null));};exports[_0x805e('0x25')]=function(_0x433ebe,_0x2b87f0){if(_0x433ebe[_0x805e('0x48')]['id']){delete _0x433ebe['body']['id'];}return db['WhatsappTransferReport'][_0x805e('0x45')]({'where':{'id':_0x433ebe['params']['id']}})[_0x805e('0x26')](handleEntityNotFound(_0x2b87f0,null))[_0x805e('0x26')](saveUpdates(_0x433ebe[_0x805e('0x48')],null))[_0x805e('0x26')](respondWithResult(_0x2b87f0,null))['catch'](handleError(_0x2b87f0,null));};exports[_0x805e('0x27')]=function(_0x3f030e,_0x4588e3){return db[_0x805e('0x2d')][_0x805e('0x45')]({'where':{'id':_0x3f030e[_0x805e('0x49')]['id']}})[_0x805e('0x26')](handleEntityNotFound(_0x4588e3,null))['then'](removeEntity(_0x4588e3,null))[_0x805e('0x46')](handleError(_0x4588e3,null));};exports[_0x805e('0x4a')]=function(_0xe90867,_0x2b2286){return db[_0x805e('0x2d')][_0x805e('0x4a')]()[_0x805e('0x26')](respondWithResult(_0x2b2286,null))['catch'](handleError(_0x2b2286,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e7d3ee6..97851ee 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 _0x6a3e=['rimraf','../../config/environment','exports','uniqueid','lodash','api','moment','request-promise','path'];(function(_0x1d6ebf,_0x3c21bd){var _0x43fd33=function(_0x44190e){while(--_0x44190e){_0x1d6ebf['push'](_0x1d6ebf['shift']());}};_0x43fd33(++_0x3c21bd);}(_0x6a3e,0x1b4));var _0xe6a3=function(_0x3d9467,_0x11cdef){_0x3d9467=_0x3d9467-0x0;var _0x4f4815=_0x6a3e[_0x3d9467];return _0x4f4815;};'use strict';var _=require(_0xe6a3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe6a3('0x1'));var moment=require(_0xe6a3('0x2'));var BPromise=require('bluebird');var rp=require(_0xe6a3('0x3'));var fs=require('fs');var path=require(_0xe6a3('0x4'));var rimraf=require(_0xe6a3('0x5'));var config=require(_0xe6a3('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0xe6a3('0x7')]=function(_0x3ea5a8,_0x46392c){return _0x3ea5a8['define']('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xe6a3('0x8'),'fields':[_0xe6a3('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb603=['rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','api','bluebird','request-promise','path'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0xb603,0xc6));var _0x3b60=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xb603[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x3b60('0x0'));var util=require(_0x3b60('0x1'));var logger=require('../../config/logger')(_0x3b60('0x2'));var moment=require('moment');var BPromise=require(_0x3b60('0x3'));var rp=require(_0x3b60('0x4'));var fs=require('fs');var path=require(_0x3b60('0x5'));var rimraf=require(_0x3b60('0x6'));var config=require(_0x3b60('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x3b60('0x8')]=function(_0x41c038,_0x290b14){return _0x41c038[_0x3b60('0x9')](_0x3b60('0xa'),attributes,{'tableName':_0x3b60('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 5a09610..bb7df28 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 _0x60ea=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0x60ea,0x119));var _0xa60e=function(_0x52f61d,_0x5c62dc){_0x52f61d=_0x52f61d-0x0;var _0x1e152e=_0x60ea[_0x52f61d];return _0x1e152e;};'use strict';var _=require(_0xa60e('0x0'));var util=require('util');var moment=require(_0xa60e('0x1'));var BPromise=require(_0xa60e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa60e('0x3'));var db=require(_0xa60e('0x4'))['db'];var utils=require(_0xa60e('0x5'));var logger=require('../../config/logger')(_0xa60e('0x6'));var config=require(_0xa60e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa60e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a90bd,_0x58d649,_0x27b756){return new BPromise(function(_0x6f7a01,_0x2d1321){return client[_0xa60e('0x9')](_0x5a90bd,_0x27b756)[_0xa60e('0xa')](function(_0x2964a8){logger[_0xa60e('0xb')](_0xa60e('0xc'),_0x58d649,_0xa60e('0xd'));logger['debug'](_0xa60e('0xe'),_0x58d649,_0xa60e('0xd'),JSON[_0xa60e('0xf')](_0x2964a8));if(_0x2964a8[_0xa60e('0x10')]){if(_0x2964a8[_0xa60e('0x10')]['code']===0x1f4){logger[_0xa60e('0x10')](_0xa60e('0xc'),_0x58d649,_0x2964a8[_0xa60e('0x10')][_0xa60e('0x11')]);return _0x2d1321(_0x2964a8[_0xa60e('0x10')]['message']);}logger[_0xa60e('0x10')](_0xa60e('0xc'),_0x58d649,_0x2964a8[_0xa60e('0x10')][_0xa60e('0x11')]);return _0x6f7a01(_0x2964a8[_0xa60e('0x10')][_0xa60e('0x11')]);}else{logger[_0xa60e('0xb')](_0xa60e('0xc'),_0x58d649,_0xa60e('0xd'));_0x6f7a01(_0x2964a8[_0xa60e('0x12')][_0xa60e('0x11')]);}})[_0xa60e('0x13')](function(_0x433957){logger[_0xa60e('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x58d649,_0x433957);_0x2d1321(_0x433957);});});} \ No newline at end of file +var _0x9323=['../../config/logger','jayson/promise','client','http','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ed406,_0x3b3184){var _0x359b38=function(_0x35dc97){while(--_0x35dc97){_0x1ed406['push'](_0x1ed406['shift']());}};_0x359b38(++_0x3b3184);}(_0x9323,0x1dc));var _0x3932=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9323[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x3932('0x0'));var util=require(_0x3932('0x1'));var moment=require(_0x3932('0x2'));var BPromise=require(_0x3932('0x3'));var rs=require(_0x3932('0x4'));var fs=require('fs');var Redis=require(_0x3932('0x5'));var db=require(_0x3932('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3932('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3932('0x8'));var client=jayson[_0x3932('0x9')][_0x3932('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31e994,_0x1e38b4,_0x1288d7){return new BPromise(function(_0x164890,_0x1902f0){return client['request'](_0x31e994,_0x1288d7)[_0x3932('0xb')](function(_0x5d6968){logger['info'](_0x3932('0xc'),_0x1e38b4,_0x3932('0xd'));logger[_0x3932('0xe')](_0x3932('0xf'),_0x1e38b4,_0x3932('0xd'),JSON[_0x3932('0x10')](_0x5d6968));if(_0x5d6968[_0x3932('0x11')]){if(_0x5d6968[_0x3932('0x11')]['code']===0x1f4){logger[_0x3932('0x11')](_0x3932('0xc'),_0x1e38b4,_0x5d6968[_0x3932('0x11')][_0x3932('0x12')]);return _0x1902f0(_0x5d6968[_0x3932('0x11')][_0x3932('0x12')]);}logger[_0x3932('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1e38b4,_0x5d6968['error']['message']);return _0x164890(_0x5d6968[_0x3932('0x11')][_0x3932('0x12')]);}else{logger[_0x3932('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1e38b4,_0x3932('0xd'));_0x164890(_0x5d6968['result'][_0x3932('0x12')]);}})[_0x3932('0x14')](function(_0x39d105){logger[_0x3932('0x11')](_0x3932('0xc'),_0x1e38b4,_0x39d105);_0x1902f0(_0x39d105);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index e37c769..a857ff4 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bde=['default','listen','info','start','filter','exitCode','number','length','pm2_env','name','Online\x20apps:','map','join','Offline\x20apps:','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB'];(function(_0x217525,_0x4d9301){var _0x4d01f3=function(_0x2dac9f){while(--_0x2dac9f){_0x217525['push'](_0x217525['shift']());}};_0x4d01f3(++_0x4d9301);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xe0bd('0x1'));var checkLicense=require(_0xe0bd('0x2'));var rpc=require('./rpc');var config=require(_0xe0bd('0x3'));var logger=require(_0xe0bd('0x4'))(_0xe0bd('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0xe0bd('0x6'));var schedule=require(_0xe0bd('0x7'));var chat=require(_0xe0bd('0x8'));var whatsapp=require(_0xe0bd('0x9'));var transcribe=require(_0xe0bd('0xa'));var provider=require(_0xe0bd('0xb'));function main(){return db[_0xe0bd('0xc')][_0xe0bd('0xd')]()[_0xe0bd('0xe')](function(){if(config[_0xe0bd('0xf')]){return seedDb[_0xe0bd('0x10')]();}})[_0xe0bd('0xe')](function(){return checkLicense[_0xe0bd('0x10')]();})['then'](function(){return rpc[_0xe0bd('0x11')]();})[_0xe0bd('0xe')](function(_0x5a7117){logger[_0xe0bd('0x12')](_0x5a7117);return chat['start']();})[_0xe0bd('0xe')](function(){return whatsapp[_0xe0bd('0x13')]();})[_0xe0bd('0xe')](function(){return schedule[_0xe0bd('0x13')]();})[_0xe0bd('0xe')](function(){return transcribe[_0xe0bd('0x13')]();})[_0xe0bd('0xe')](function(){return provider['start']();})[_0xe0bd('0xe')](function(_0x40c17c){logger[_0xe0bd('0x12')](_0x40c17c);return pm2['start'](pm2Config);})[_0xe0bd('0xe')](function(_0x48afde){var _0x1858b8=_0x48afde[_0xe0bd('0x14')](function(_0x3f5ef7){return typeof _0x3f5ef7[_0xe0bd('0x15')]===_0xe0bd('0x16')&&_0x3f5ef7[_0xe0bd('0x15')]>=0x0;});if(_0x1858b8[_0xe0bd('0x17')]>0x0){throw new Error(_0x1858b8[_0xe0bd('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x1858b8,function(_0x2d2ba3){return'\x22'+_0x2d2ba3[_0xe0bd('0x18')][_0xe0bd('0x19')]+'\x22';}));}logger[_0xe0bd('0x12')](_0xe0bd('0x1a'),_[_0xe0bd('0x1b')](_['filter'](_0x48afde,{'status':'online'}),_0xe0bd('0x19'))[_0xe0bd('0x1c')]());logger[_0xe0bd('0x12')](_0xe0bd('0x1d'),_[_0xe0bd('0x1b')](_[_0xe0bd('0x14')](_0x48afde,function(_0x3dbd98){return _0x3dbd98['status']!=='online';}),_0xe0bd('0x19'))[_0xe0bd('0x1c')]()||_0xe0bd('0x1e'));console[_0xe0bd('0x1f')](_0xe0bd('0x20'));})['catch'](function(_0x30442f){console['log'](_0xe0bd('0x21'),_0x30442f);logger[_0xe0bd('0x22')](_0xe0bd('0x23'),_0x30442f);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x6334=['map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','filter','join','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','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','seedDB','default','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x6334,0x119));var _0x4633=function(_0x1f1f3b,_0x227aa9){_0x1f1f3b=_0x1f1f3b-0x0;var _0x2e63aa=_0x6334[_0x1f1f3b];return _0x2e63aa;};'use strict';var _=require(_0x4633('0x0'));var db=require(_0x4633('0x1'))['db'];var seedDb=require(_0x4633('0x2'));var checkLicense=require(_0x4633('0x3'));var rpc=require(_0x4633('0x4'));var config=require(_0x4633('0x5'));var logger=require('./config/logger')(_0x4633('0x6'));var pm2=require(_0x4633('0x7'));var pm2Config=require(_0x4633('0x8'));var schedule=require(_0x4633('0x9'));var chat=require(_0x4633('0xa'));var whatsapp=require(_0x4633('0xb'));var transcribe=require(_0x4633('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x4633('0xd')]['sync']()[_0x4633('0xe')](function(){if(config[_0x4633('0xf')]){return seedDb['default']();}})[_0x4633('0xe')](function(){return checkLicense[_0x4633('0x10')]();})[_0x4633('0xe')](function(){return rpc['listen']();})[_0x4633('0xe')](function(_0x2f07fa){logger['info'](_0x2f07fa);return chat[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return whatsapp[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return schedule['start']();})[_0x4633('0xe')](function(){return transcribe[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return provider['start']();})['then'](function(_0x49f5c3){logger[_0x4633('0x12')](_0x49f5c3);return pm2[_0x4633('0x11')](pm2Config);})['then'](function(_0x52955e){var _0x1d967e=_0x52955e['filter'](function(_0xcdffcc){return typeof _0xcdffcc[_0x4633('0x13')]===_0x4633('0x14')&&_0xcdffcc[_0x4633('0x13')]>=0x0;});if(_0x1d967e['length']>0x0){throw new Error(_0x1d967e[_0x4633('0x15')]+_0x4633('0x16')+_[_0x4633('0x17')](_0x1d967e,function(_0x4ffad5){return'\x22'+_0x4ffad5[_0x4633('0x18')][_0x4633('0x19')]+'\x22';}));}logger[_0x4633('0x12')](_0x4633('0x1a'),_[_0x4633('0x17')](_['filter'](_0x52955e,{'status':_0x4633('0x1b')}),_0x4633('0x19'))['join']());logger['info'](_0x4633('0x1c'),_['map'](_[_0x4633('0x1d')](_0x52955e,function(_0x5b5011){return _0x5b5011['status']!==_0x4633('0x1b');}),_0x4633('0x19'))[_0x4633('0x1e')]()||_0x4633('0x1f'));console[_0x4633('0x20')](_0x4633('0x21'));})['catch'](function(_0x2b1976){console['log'](_0x4633('0x22'),_0x2b1976);logger[_0x4633('0x23')](_0x4633('0x24'),_0x2b1976);process[_0x4633('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 885b251..eddde87 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 _0x3266=['phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','find','then','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','session','payload','options','verify','randomBytes','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','util','moment','secrets','role','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone'];(function(_0x5d79d5,_0x35cf9f){var _0x546af9=function(_0x131de5){while(--_0x131de5){_0x5d79d5['push'](_0x5d79d5['shift']());}};_0x546af9(++_0x35cf9f);}(_0x3266,0x6a));var _0x6326=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x3266[_0x2adbeb];return _0x5e18a6;};'use strict';var db=require(_0x6326('0x0'))['db'];var config=require(_0x6326('0x1'));var hardwareConf=require(_0x6326('0x2'));var licenseUtil=require(_0x6326('0x3'));var encryptor=require(_0x6326('0x4'));var _=require(_0x6326('0x5'));var jwt=require(_0x6326('0x6'));var expressJwt=require(_0x6326('0x7'));var compose=require(_0x6326('0x8'));var basicAuth=require('basic-auth');var crypto=require(_0x6326('0x9'));var BPromise=require('bluebird');var util=require(_0x6326('0xa'));var moment=require(_0x6326('0xb'));var validateJwt=expressJwt({'secret':config[_0x6326('0xc')]['session']});var userAttributes=['id',_0x6326('0xd'),'fullname',_0x6326('0xe'),_0x6326('0xf'),_0x6326('0x10'),_0x6326('0x11'),_0x6326('0x12'),'md5secret',_0x6326('0x13'),_0x6326('0x14'),_0x6326('0x15'),_0x6326('0x16'),_0x6326('0x17'),_0x6326('0x18'),_0x6326('0x19'),_0x6326('0x1a'),_0x6326('0x1b'),_0x6326('0x1c'),'crudPermissions','allowmessenger',_0x6326('0x1d'),_0x6326('0x1e'),'phoneBarAutoAnswer',_0x6326('0x1f'),'phoneBarDnd',_0x6326('0x20'),_0x6326('0x21'),_0x6326('0x22'),_0x6326('0x23'),_0x6326('0x24'),_0x6326('0x25'),'phoneBarRemoteControlPort',_0x6326('0x26'),'interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings',_0x6326('0x27'),_0x6326('0x28'),_0x6326('0x29'),'selectRecallMeCampaign','chatAutoanswer',_0x6326('0x2a'),_0x6326('0x2b'),_0x6326('0x2c'),_0x6326('0x2d'),_0x6326('0x2e'),_0x6326('0x2f'),_0x6326('0x30'),'faxAutoanswer',_0x6326('0x31'),'whatsappAutoanswer',_0x6326('0x32'),_0x6326('0x33')];exports[_0x6326('0x34')]=function(){return this[_0x6326('0x35')](!![])[_0x6326('0x36')](function(_0x39fff1,_0x225555,_0x429bb0){if(_0x39fff1[_0x6326('0x37')]){_0x429bb0();}else{return db[_0x6326('0x38')][_0x6326('0x39')]({'where':{'id':_0x39fff1['params']['id']},'attributes':['id',_0x6326('0x3a'),_0x6326('0x3b')],'raw':!![]})['then'](function(_0x4e272b){if(_0x4e272b&&_0x4e272b['closed']){return _0x225555[_0x6326('0x3c')](_0x4e272b['disposition']===_0x6326('0x3d')?0x195:0x193)[_0x6326('0x3e')]({'message':_0x4e272b['disposition']===_0x6326('0x3d')?_0x6326('0x3f'):_0x6326('0x40')});}else{_0x429bb0();}})[_0x6326('0x41')](function(_0x2d2180){_0x429bb0(_0x2d2180);});}});};exports[_0x6326('0x35')]=function isAuthenticated(_0x40e036){return compose()[_0x6326('0x36')](function(_0x461e0f,_0x127744,_0x4980f6){var _0x2a8873;if(_0x461e0f[_0x6326('0x42')][_0x6326('0x43')]){if(_[_0x6326('0x44')](_0x461e0f[_0x6326('0x42')]['authorization'],_0x6326('0x45'))){var _0x47303c=basicAuth(_0x461e0f);db[_0x6326('0x46')]['find']({'where':{'name':_0x47303c[_0x6326('0xe')]}})['then'](function(_0x4e703a){if(!_0x4e703a||!_0x4e703a[_0x6326('0x47')](_0x47303c[_0x6326('0x48')])){return _0x127744[_0x6326('0x3c')](0x191)[_0x6326('0x3e')]({'message':_0x6326('0x49')});}_0x461e0f[_0x6326('0x37')]={'id':_0x4e703a['id']};_0x4980f6();})[_0x6326('0x41')](function(_0x46c803){_0x4980f6(_0x46c803);});}else if(_[_0x6326('0x44')](_0x461e0f[_0x6326('0x42')][_0x6326('0x43')],_0x6326('0x4a'))){validateJwt(_0x461e0f,_0x127744,_0x4980f6);}else{if(_0x40e036){_0x4980f6();}else{return _0x127744['status'](0x193)[_0x6326('0x3e')]({'message':_0x6326('0x4b')});}}}else if(_0x461e0f['query'][_0x6326('0x4c')]){try{var _0x2958af={'audience':hardwareConf[_0x6326('0x4d')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x461e0f[_0x6326('0x4e')]['apikey'],_0x2958af)['then'](function(_0x3a2c6a){return db[_0x6326('0x46')][_0x6326('0x4f')]({'where':{'id':_0x3a2c6a['sub']}})[_0x6326('0x50')](function(_0x55a431){_0x2a8873=_0x55a431;return db[_0x6326('0x51')]['findOne']({'where':{'id':0x1},'attributes':[_0x6326('0x52'),_0x6326('0x53')],'raw':!![]});})[_0x6326('0x50')](function(_0x101430){if(!_0x2a8873||!_[_0x6326('0x54')](_0x2a8873[_0x6326('0x55')],_0x3a2c6a['nonce'])){return _0x127744[_0x6326('0x3c')](0x191)[_0x6326('0x3e')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x2a8873[_0x6326('0x56')]){return _0x127744['status'](0x191)['json']({'message':_0x6326('0x57')});}if(_0x2a8873[_0x6326('0x58')]){if(_0x101430[_0x6326('0x53')]>0x0){if(moment(_0x2a8873[_0x6326('0x59')])[_0x6326('0x5a')](_0x101430[_0x6326('0x53')],'minutes')>moment()){return _0x127744['status'](0x191)[_0x6326('0x3e')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x127744[_0x6326('0x3c')](0x191)['json']({'message':_0x6326('0x57')});}}_0x461e0f[_0x6326('0x37')]={'id':_0x2a8873['id']};_0x4980f6();});})[_0x6326('0x41')](function(){return _0x127744[_0x6326('0x3c')](0x191)[_0x6326('0x3e')]({'message':_0x6326('0x57')});});}catch(_0x40f891){_0x4980f6(_0x40f891);}}else if(_0x40e036){_0x4980f6();}else{return _0x127744[_0x6326('0x3c')](0x193)[_0x6326('0x3e')]({'message':_0x6326('0x4b')});}})[_0x6326('0x36')](function(_0x5d36b1,_0x181864,_0x5ce03a){if(_0x5d36b1[_0x6326('0x37')]){db[_0x6326('0x46')][_0x6326('0x4f')]({'where':{'id':_0x5d36b1[_0x6326('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x3a346e){if(!_0x3a346e){return _0x181864[_0x6326('0x3c')](0x194)['json']({'message':_0x6326('0x5b')});}_0x5d36b1[_0x6326('0x37')]=_0x3a346e;_0x5ce03a();})[_0x6326('0x41')](function(_0x3ea41e){_0x5ce03a(_0x3ea41e);});}else if(_0x40e036){_0x5ce03a();}else{return _0x181864['status'](0x194)[_0x6326('0x3e')]({'message':_0x6326('0x5c')});}});};exports[_0x6326('0x5d')]=function canUpdate(){return compose()[_0x6326('0x36')](function(_0x44d852,_0x165953,_0xa71ecb){return licenseUtil['getLicense']()[_0x6326('0x50')](function(_0x94bc60){if(_0x94bc60[_0x6326('0x5e')]){_0xa71ecb();}else{return _0x165953[_0x6326('0x3c')](0x193)['json']({'message':_0x6326('0x5f')});}})['catch'](function(_0x1f3d3b){_0xa71ecb(_0x1f3d3b);});});};exports[_0x6326('0x60')]=function isWebrtcLicence(){return compose()[_0x6326('0x36')](function(_0x3fbc11,_0x183690,_0x5dc727){return licenseUtil[_0x6326('0x61')]()['then'](function(_0x5e0e2f){if(_0x5e0e2f[_0x6326('0x62')]){_0x5dc727();}else{return _0x183690[_0x6326('0x3c')](0x193)['json']({'message':_0x6326('0x5f')});}})[_0x6326('0x41')](function(_0x327f93){_0x5dc727(_0x327f93);});});};exports[_0x6326('0x63')]=function(_0x3a3907,_0x4f8dc0,_0x4af0ee){_0x3a3907[_0x6326('0x63')]=!![];return _0x4af0ee();};exports[_0x6326('0x64')]=function signToken(_0x1661a9){return signJwt(_0x1661a9);};exports[_0x6326('0x65')]=function(_0x210a1b,_0x318d19){if(!_0x210a1b[_0x6326('0x37')]){return _0x318d19['status'](0x194)[_0x6326('0x3e')]({'message':_0x6326('0x66')});}var _0x2dd0c4={'payload':{'id':_0x210a1b[_0x6326('0x37')]['id'],'role':_0x210a1b[_0x6326('0x37')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2dd0c4)[_0x6326('0x50')](function(_0x55537a){_0x318d19[_0x6326('0x67')](_0x6326('0x68'),_0x55537a);_0x318d19['redirect'](_0x6326('0x69'));})['catch'](function(_0xaa4c9d){return _0x318d19[_0x6326('0x3c')](0x1f4)[_0x6326('0x6a')](_0xaa4c9d);});};exports[_0x6326('0x6b')]=function(_0x58731d){if(_[_0x6326('0x6c')](_0x58731d[_0x6326('0x55')])||_['isNil'](_0x58731d[_0x6326('0x6d')])){return null;}else{return createJwt(_0x58731d);}};exports[_0x6326('0x6e')]=function(_0x345301){_0x345301['apiKeyNonce']=generateNonce();_0x345301[_0x6326('0x6d')]=generateIssuedAt();return createJwt(_0x345301);};exports[_0x6326('0x6f')]=function(_0x59a167,_0x16e606){var _0x5d234e=_0x59a167[_0x6326('0x4e')][_0x6326('0x4c')];if(_0x5d234e){var _0x3e9825={'nonce':_0x16e606[_0x6326('0x55')],'iat':_0x16e606[_0x6326('0x6d')],'audience':hardwareConf[_0x6326('0x4d')](),'issuer':hardwareConf[_0x6326('0x4d')]()};return verifyJwt(_0x5d234e,_0x3e9825)['then'](function(){return generateApiKey(_0x16e606);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x1db004){var _0x4e986e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4e986e[_0x6326('0x70')](_0x1db004))throw new db[(_0x6326('0x71'))][(_0x6326('0x72'))](_0x6326('0x73'));return;};exports[_0x6326('0x74')]=function(_0x4b5bc6,_0x23bf64,_0x2e4244){var _0x5f3a74=encryptor[_0x6326('0x75')](_0x23bf64)[_0x6326('0x76')](',');for(var _0x1b6c29=0x0;_0x1b6c29<_0x2e4244;_0x1b6c29++){if(!_0x5f3a74[_0x1b6c29])break;if(_0x4b5bc6[_0x6326('0x77')]()===_0x5f3a74[_0x1b6c29][_0x6326('0x77')]()){var _0x36f2f5=util[_0x6326('0x78')](_0x6326('0x79'),_0x2e4244);if(_0x2e4244===0x1){_0x36f2f5=_0x6326('0x7a');}throw new db[(_0x6326('0x71'))]['ValidationError'](_0x36f2f5);}}return;};exports[_0x6326('0x7b')]=function(_0x128ae0,_0x3fc712){var _0x92f535=_0x3fc712?encryptor['decryptString'](_0x3fc712)['split'](','):[];if(_0x92f535[_0x6326('0x7c')]===0x5){_0x92f535[_0x6326('0x7d')](-0x1,0x1);}_0x92f535[_0x6326('0x7e')](_0x128ae0);return encryptor[_0x6326('0x7f')](_0x92f535[_0x6326('0x80')](','));};function signJwt(_0x54a9eb){var _0x4cec50=BPromise[_0x6326('0x81')](jwt[_0x6326('0x82')],{'context':jwt});var _0x437be2=_0x54a9eb[_0x6326('0x83')]||config['secrets'][_0x6326('0x84')];return new BPromise(function(_0x2c5f74,_0x326fd3){_0x4cec50(_0x54a9eb[_0x6326('0x85')],_0x437be2,_0x54a9eb[_0x6326('0x86')])[_0x6326('0x50')](function(_0x5cedec){_0x2c5f74(_0x5cedec);})[_0x6326('0x41')](function(_0x5d5f4b){_0x326fd3(_0x5d5f4b);});});}function verifyJwt(_0x4877c8,_0x1e09c0,_0x57dfde){var _0x14d66c=BPromise[_0x6326('0x81')](jwt[_0x6326('0x87')],{'context':jwt});var _0x3b6de7=_0x57dfde||config[_0x6326('0xc')][_0x6326('0x84')];return new BPromise(function(_0x1e8d86,_0x75e3a7){_0x14d66c(_0x4877c8,_0x3b6de7,_0x1e09c0)[_0x6326('0x50')](function(_0x3f5e2e){_0x1e8d86(_0x3f5e2e);})['catch'](function(_0x470f8e){_0x75e3a7(_0x470f8e);});});}function generateNonce(){return crypto[_0x6326('0x88')](0x10)[_0x6326('0x89')](_0x6326('0x8a'));}function generateIssuedAt(){return Math[_0x6326('0x8b')](Date['now']()/0x3e8)[_0x6326('0x89')]();}function createJwt(_0x3dc2f0){var _0x42346b={'payload':{'iat':_0x3dc2f0[_0x6326('0x6d')],'nonce':_0x3dc2f0[_0x6326('0x55')]},'options':{'algorithm':'HS512','subject':_0x3dc2f0['id'][_0x6326('0x89')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x42346b)[_0x6326('0x50')](function(_0xf54264){return{'iat':_0x3dc2f0[_0x6326('0x6d')],'nonce':_0x3dc2f0[_0x6326('0x55')],'token':_0xf54264};});} \ 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(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xb688,0xcf));var _0x8b68=function(_0x12d4b9,_0x39a033){_0x12d4b9=_0x12d4b9-0x0;var _0x2022cc=_0xb688[_0x12d4b9];return _0x2022cc;};'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 ba2a2a1..f9fe42c 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 _0x49c2=['countFilteredContacts','count','User','getFilteredContacts','rows','catch','CmContact','describe','keys','filter','cf_','map','findOne','slice','all','fieldType','type','lodash','./sql-utils','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','clause','user','skip','checkListsRestrictions','ids'];(function(_0x6fd276,_0x32ca86){var _0x870689=function(_0x34f8dc){while(--_0x34f8dc){_0x6fd276['push'](_0x6fd276['shift']());}};_0x870689(++_0x32ca86);}(_0x49c2,0x91));var _0x249c=function(_0x48b41d,_0x2f433f){_0x48b41d=_0x48b41d-0x0;var _0x10732e=_0x49c2[_0x48b41d];return _0x10732e;};'use strict';var _=require(_0x249c('0x0'));var sqlUtils=require(_0x249c('0x1'));var db=require('../../mysqldb')['db'];exports['findAll']=function(_0x24bf46,_0x2b4758,_0x26dd34,_0x3c31dd){var _0x53f2ad={'count':0x0,'rows':[]};var _0x49bf6a=sqlUtils[_0x249c('0x2')](_0x2b4758,_0x24bf46);if(_0x49bf6a){return Promise[_0x249c('0x3')](_0x53f2ad);}var _0x5b16d4=sqlUtils['getContactsSubquery']();var _0x2b2128={};var _0x4b7317=![];var _0xc36dcf=![];return Promise[_0x249c('0x3')]()[_0x249c('0x4')](function(){if(_0x24bf46[_0x249c('0x5')]){return sqlUtils[_0x249c('0x6')](_0x24bf46[_0x249c('0x5')],_0x3c31dd);}else{return sqlUtils[_0x249c('0x7')](_0x24bf46,_0x3c31dd);}})['then'](function(_0x5e22e8){_0x5b16d4['where'](_0x5e22e8[_0x249c('0x8')]);_0x5b16d4[_0x249c('0x9')](_0x5e22e8['fields']);_0x5b16d4[_0x249c('0x9')](_0x5e22e8['filter']);_0x5b16d4[_0x249c('0x9')](_0x5e22e8['user'][_0x249c('0xa')]);_0x2b2128=_0x5e22e8['tags'];_0xc36dcf=_0x5e22e8[_0x249c('0xb')][_0x249c('0xc')];return sqlUtils[_0x249c('0xd')](_0x2b4758,_0x24bf46,_0xc36dcf);})[_0x249c('0x4')](function(_0x965245){_0x5b16d4[_0x249c('0x9')](_0x965245);var _0x4ad8ad=_0x24bf46[_0x249c('0x5')]?_0x2b2128[_0x249c('0xe')]:_0x24bf46['tag'];_0x4b7317=_0x4ad8ad?!![]:![];return sqlUtils[_0x249c('0xf')](_0x5b16d4,_0x4ad8ad);})['then'](function(_0x801407){_0x53f2ad[_0x249c('0x10')]=_0x801407;if(_0x53f2ad[_0x249c('0x10')]===0x0){return;}if(_0x24bf46[_0x249c('0x11')]){_0xc36dcf=!![];}return sqlUtils['buildContactsQuery'](_0x5b16d4,_0x24bf46['fields'],_0x26dd34,_0x4b7317,_0x2b2128['clause'],_0xc36dcf);})[_0x249c('0x4')](function(_0x58796e){if(!_0x58796e){return[];}return sqlUtils[_0x249c('0x12')](_0x58796e,_0x24bf46,_0x26dd34);})['then'](function(_0x3fba99){_0x53f2ad[_0x249c('0x13')]=_0x3fba99;return _0x53f2ad;})[_0x249c('0x14')](function(_0xdd16e7){throw _0xdd16e7;});};exports['describe']=function(){var _0x58d52c={};var _0x52dd87=[];return db[_0x249c('0x15')][_0x249c('0x16')]()['then'](function(_0x3dabaf){_0x58d52c=_0x3dabaf;var _0x3aed91=Object[_0x249c('0x17')](_0x58d52c)[_0x249c('0x18')](function(_0x45ea3c){return _['startsWith'](_0x45ea3c,_0x249c('0x19'))?_0x45ea3c:undefined;});var _0x3efe81=_0x3aed91[_0x249c('0x1a')](function(_0x3e53d6){return db['CmCustomField'][_0x249c('0x1b')]({'where':{'id':_0x3e53d6[_0x249c('0x1c')](0x3)},'raw':!![]});});return Promise[_0x249c('0x1d')](_0x3efe81);})[_0x249c('0x4')](function(_0x49238c){for(var _0x2e6736=0x0;_0x2e6736<_0x49238c['length'];_0x2e6736++){if(_0x49238c[_0x2e6736]){var _0x32344d='cf_'+_0x49238c[_0x2e6736]['id'];_0x58d52c[_0x32344d][_0x249c('0x1e')]=_0x49238c[_0x2e6736][_0x249c('0x1f')];}}_0x52dd87=_[_0x249c('0x1a')](Object['keys'](_0x58d52c),function(_0x450c8a){return{'name':_0x450c8a,'type':_0x58d52c[_0x450c8a][_0x249c('0x1f')]};});return _0x52dd87;})[_0x249c('0x14')](function(_0x3b2030){throw _0x3b2030;});}; \ No newline at end of file +var _0xcb24=['search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','ids','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','catch','CmContact','keys','startsWith','cf_','slice','length','type','map','lodash','./sql-utils','findAll','getContactsSubquery','resolve','then'];(function(_0x1963de,_0x340358){var _0x5aa543=function(_0x4b6eff){while(--_0x4b6eff){_0x1963de['push'](_0x1963de['shift']());}};_0x5aa543(++_0x340358);}(_0xcb24,0x144));var _0x4cb2=function(_0x553277,_0x15dea4){_0x553277=_0x553277-0x0;var _0x6f7ee2=_0xcb24[_0x553277];return _0x6f7ee2;};'use strict';var _=require(_0x4cb2('0x0'));var sqlUtils=require(_0x4cb2('0x1'));var db=require('../../mysqldb')['db'];exports[_0x4cb2('0x2')]=function(_0x584efa,_0x4e25ae,_0x3a7905,_0x14e14c){var _0x54daef={'count':0x0,'rows':[]};var _0x335a1b=sqlUtils['skipContactsQuery'](_0x4e25ae,_0x584efa);if(_0x335a1b){return Promise['resolve'](_0x54daef);}var _0x31ea59=sqlUtils[_0x4cb2('0x3')]();var _0xeaccb9={};var _0x238d4d=![];var _0x40eff7=![];return Promise[_0x4cb2('0x4')]()[_0x4cb2('0x5')](function(){if(_0x584efa[_0x4cb2('0x6')]){return sqlUtils[_0x4cb2('0x7')](_0x584efa['search'],_0x14e14c);}else{return sqlUtils[_0x4cb2('0x8')](_0x584efa,_0x14e14c);}})['then'](function(_0x3a1874){_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xa')]);_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xb')]);_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xc')]);_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xd')][_0x4cb2('0xe')]);_0xeaccb9=_0x3a1874[_0x4cb2('0xf')];_0x40eff7=_0x3a1874[_0x4cb2('0xd')][_0x4cb2('0x10')];return sqlUtils['checkListsRestrictions'](_0x4e25ae,_0x584efa,_0x40eff7);})[_0x4cb2('0x5')](function(_0x518f95){_0x31ea59[_0x4cb2('0x9')](_0x518f95);var _0x30348e=_0x584efa[_0x4cb2('0x6')]?_0xeaccb9[_0x4cb2('0x11')]:_0x584efa[_0x4cb2('0x12')];_0x238d4d=_0x30348e?!![]:![];return sqlUtils[_0x4cb2('0x13')](_0x31ea59,_0x30348e);})[_0x4cb2('0x5')](function(_0x4664ae){_0x54daef['count']=_0x4664ae;if(_0x54daef[_0x4cb2('0x14')]===0x0){return;}if(_0x584efa[_0x4cb2('0x15')]){_0x40eff7=!![];}return sqlUtils[_0x4cb2('0x16')](_0x31ea59,_0x584efa[_0x4cb2('0xb')],_0x3a7905,_0x238d4d,_0xeaccb9[_0x4cb2('0xe')],_0x40eff7);})[_0x4cb2('0x5')](function(_0xd90f4e){if(!_0xd90f4e){return[];}return sqlUtils[_0x4cb2('0x17')](_0xd90f4e,_0x584efa,_0x3a7905);})[_0x4cb2('0x5')](function(_0x3b60cc){_0x54daef['rows']=_0x3b60cc;return _0x54daef;})[_0x4cb2('0x18')](function(_0x906200){throw _0x906200;});};exports['describe']=function(){var _0x34d040={};var _0x196334=[];return db[_0x4cb2('0x19')]['describe']()['then'](function(_0x55ac64){_0x34d040=_0x55ac64;var _0x4bcc44=Object[_0x4cb2('0x1a')](_0x34d040)[_0x4cb2('0xc')](function(_0x1eb744){return _[_0x4cb2('0x1b')](_0x1eb744,_0x4cb2('0x1c'))?_0x1eb744:undefined;});var _0x4e927f=_0x4bcc44['map'](function(_0x226c82){return db['CmCustomField']['findOne']({'where':{'id':_0x226c82[_0x4cb2('0x1d')](0x3)},'raw':!![]});});return Promise['all'](_0x4e927f);})[_0x4cb2('0x5')](function(_0x8d88a8){for(var _0x85589a=0x0;_0x85589a<_0x8d88a8[_0x4cb2('0x1e')];_0x85589a++){if(_0x8d88a8[_0x85589a]){var _0x3c72fd=_0x4cb2('0x1c')+_0x8d88a8[_0x85589a]['id'];_0x34d040[_0x3c72fd]['fieldType']=_0x8d88a8[_0x85589a][_0x4cb2('0x1f')];}}_0x196334=_[_0x4cb2('0x20')](Object[_0x4cb2('0x1a')](_0x34d040),function(_0x17c54f){return{'name':_0x17c54f,'type':_0x34d040[_0x17c54f][_0x4cb2('0x1f')]};});return _0x196334;})['catch'](function(_0x4c21f7){throw _0x4c21f7;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 103e35b..117b40c 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 _0xa28b=['select','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','CompanyId','createdAt','updatedAt','deletedAt','includes','push','forEach','TagIds','field','expr','getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','conditions','find','name','fieldType','castTo','DATE','buildExpression','type','default','text','value','start','end','map','tags','clause','and','User','user','uc.UserId\x20=\x20?','skip','some','compact','Contact','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','filter','resolve','role','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','from','color','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','agent','search','autocomplete','true'];(function(_0x9fa69e,_0x51ebb4){var _0x4cd85a=function(_0x4684fe){while(--_0x4684fe){_0x9fa69e['push'](_0x9fa69e['shift']());}};_0x4cd85a(++_0x51ebb4);}(_0xa28b,0xcb));var _0xba28=function(_0x4f4a4d,_0x4de4be){_0x4f4a4d=_0x4f4a4d-0x0;var _0x3e2202=_0xa28b[_0x4f4a4d];return _0x3e2202;};'use strict';var _=require(_0xba28('0x0'));var squel=require(_0xba28('0x1'));var as=require(_0xba28('0x2'));var qs=require(_0xba28('0x3'));var utils=require(_0xba28('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x21e726,_0x46b9f0){var _0x8b7a3b=![];if(_0x21e726['role']===_0xba28('0x5')&&!_0x46b9f0[_0xba28('0x6')]&&!_0x46b9f0['ListId']&&_0x46b9f0[_0xba28('0x7')]!==_0xba28('0x8')){_0x8b7a3b=!![];}return _0x8b7a3b;}function getContactsSubquery(){return squel[_0xba28('0x9')]()['from']('cm_contacts','c')[_0xba28('0xa')](_0xba28('0xb'));}function applyJoinClauses(_0x2eef49,_0x55a850){var _0x11835d=_0x55a850?'c':_0xba28('0xc');_0x2eef49['left_join'](_0xba28('0xd'),'uc','uc.CmContactId\x20=\x20'+_0x11835d+_0xba28('0xe'))[_0xba28('0xf')](_0xba28('0x10'),'ct',_0xba28('0x11')+_0x11835d+_0xba28('0xe'))[_0xba28('0xf')](_0xba28('0x12'),'t',_0xba28('0x13'));return _0x2eef49;}function addFieldsToQuery(_0x671a52,_0x39cd9a,_0xa984e7,_0x408e6e,_0x1170e8){var _0x3fa507=_0x1170e8?'c':_0xba28('0xc');if(!_0x39cd9a){_0x39cd9a=['id','firstName',_0xba28('0x14'),_0xba28('0x15'),_0xba28('0x16'),_0xba28('0x17'),'email','ListId',_0xba28('0x18'),_0xba28('0x19'),_0xba28('0x1a'),_0xba28('0x1b'),'TagIds'];}else if(!_0x39cd9a[_0xba28('0x1c')]('id')){_0x39cd9a[_0xba28('0x1d')]('id');}var _0x39fc69=_0xa984e7&&_0x1170e8||!_0xa984e7&&!_0x1170e8;if(_0x408e6e){_0x39fc69=_0x408e6e&&_0x1170e8||!_0x408e6e&&!_0x1170e8;}_0x39cd9a[_0xba28('0x1e')](function(_0x1f71c7){if(_0x1f71c7===_0xba28('0x1f')){if(_0x39fc69){_0x671a52[_0xba28('0x20')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1f71c7);}else if(_0xa984e7||_0x408e6e){_0x671a52['field'](_0x3fa507+'.'+_0x1f71c7);}}else{_0x671a52[_0xba28('0x20')](_0x3fa507+'.'+_0x1f71c7);}});return _0x671a52;}function getSqlClauses(){var _0xbd106a={'default':squel[_0xba28('0x21')](),'fields':squel[_0xba28('0x21')](),'filter':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0xbd106a;}function parseTagParameter(_0xce6d27){var _0x44d1c1=squel['expr']();if(_0xce6d27){var _0x4b9355=utils[_0xba28('0x22')](_0xce6d27);_0x4b9355[_0xba28('0x1e')](function(_0x1f42b7){_0x44d1c1['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1f42b7+',%');});}return _0x44d1c1;}function parseSearchFilter(_0x15da37){var _0x5488c9=squel[_0xba28('0x21')]();if(_0x15da37){var _0x51aa56=_0x15da37[_0xba28('0x23')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x51aa56[_0xba28('0x24')]('\x20')[_0xba28('0x25')]>0x1){_0x5488c9['or'](_0xba28('0x26'),qs[_0xba28('0x27')](_0x51aa56,!![]),null);}else{if(qs['isNumeric'](_0x51aa56)){_0x5488c9['or'](_0xba28('0x28'),_0x51aa56+'%');_0x5488c9['or'](_0xba28('0x29'),_0x51aa56+'%');_0x5488c9['or']('c.mobile\x20LIKE\x20?',_0x51aa56+'%');_0x5488c9['or']('c.fax\x20LIKE\x20?',_0x51aa56+'%');}else if(qs[_0xba28('0x2a')](_0x51aa56)){_0x5488c9['or']('c.email\x20LIKE\x20?',_0x51aa56+'%');}else{_0x5488c9['or'](_0xba28('0x2b'),'%'+_0x51aa56+'%');_0x5488c9['or']('c.lastName\x20LIKE\x20?','%'+_0x51aa56+'%');_0x5488c9['or'](_0xba28('0x2c'),'%'+_0x51aa56+'%');}}}return _0x5488c9;}function parseAdvancedSearchFilter(_0x40e184,_0x417d38){var _0x46dee6=getSqlClauses();var _0x1881e3=as['parseSearch'](_0x40e184);var _0x55b263=_0x1881e3[_0xba28('0x2d')];for(var _0x339f86=0x0;_0x339f86<_0x1881e3['conditions']['length'];_0x339f86++){var _0x3518c9=_0x1881e3[_0xba28('0x2e')][_0x339f86];var _0x5898c6='c';var _0x51dede=_[_0xba28('0x2f')](_0x417d38,[_0xba28('0x30'),_0x3518c9[_0xba28('0x20')]]);if(_0x51dede){if(_0x3518c9['field']==='dateOfBirth'||_0x51dede[_0xba28('0x31')]==='datetime'){_0x3518c9[_0xba28('0x32')]=_0xba28('0x33');}var _0x159466=as[_0xba28('0x34')](_0x5898c6,_0x51dede[_0xba28('0x35')],_0x3518c9);_0x46dee6[_0xba28('0x36')][_0x55b263](_0x159466[_0xba28('0x37')],_0x159466[_0xba28('0x38')][_0xba28('0x39')],_0x159466[_0xba28('0x38')][_0xba28('0x3a')]);}else{if(_0x3518c9[_0xba28('0x20')]==='Tag'){var _0x5d78db=_0x3518c9[_0xba28('0x38')][_0xba28('0x24')](',')[_0xba28('0x3b')](function(_0x50c412){return Number(_0x50c412);});var _0x8badc1=parseTagParameter(_0x5d78db);_0x46dee6[_0xba28('0x3c')][_0xba28('0x3d')][_0xba28('0x3e')](_0x8badc1);_0x46dee6[_0xba28('0x3c')]['ids']=_0x5d78db;}else if(_0x3518c9[_0xba28('0x20')]===_0xba28('0x3f')){_0x46dee6[_0xba28('0x40')]['clause'][_0xba28('0x3e')](_0xba28('0x41'),_0x3518c9[_0xba28('0x38')]);_0x46dee6[_0xba28('0x40')][_0xba28('0x42')]=!![];}}}return _0x46dee6;}function parseModelFields(_0x29309b,_0x56e60a){var _0x180c4e=squel['expr']();var _0x223267=_(_0x29309b)['keys']()[_0xba28('0x3b')](function(_0x5dcf04){return _[_0xba28('0x43')](_0x56e60a,['name',_0x5dcf04])?_0x5dcf04:undefined;})[_0xba28('0x44')]()['value']();if(_0x29309b['Contact']){_0x223267[_0xba28('0x1d')](_0xba28('0x45'));}if(_0x29309b[_0xba28('0x3f')]){_0x223267[_0xba28('0x1d')](_0xba28('0x3f'));}if(_0x223267[_0xba28('0x25')]>0x0){_0x223267[_0xba28('0x1e')](function(_0x333043){if(_0x333043===_0xba28('0x46')){_0x180c4e[_0xba28('0x3e')](_0xba28('0x47'),[][_0xba28('0x48')](_0x29309b[_0x333043]));}else if(_0x333043===_0xba28('0x45')){var _0x4ab066='%'+_0x29309b[_0x333043]+'%';_0x180c4e[_0xba28('0x3e')](_0xba28('0x49'),_0x4ab066);}else if(_0x333043==='User'){_0x180c4e['and']('uc.UserId\x20=\x20?',_0x29309b[_0x333043]);}else{_0x180c4e[_0xba28('0x3e')]('c.'+_0x333043+_0xba28('0x4a'),_0x29309b[_0x333043]);}});}return _0x180c4e;}function parseQueryParameters(_0xe5c717,_0x2ef396){var _0x5d477b=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0xe5c717,_0x2ef396);})[_0xba28('0x4b')](function(_0x15d611){_0x5d477b[_0xba28('0x4c')][_0xba28('0x3e')](_0x15d611);return parseTagParameter(_0xe5c717['tag']);})[_0xba28('0x4b')](function(_0x4e807e){_0x5d477b[_0xba28('0x3c')]['clause'][_0xba28('0x3e')](_0x4e807e);return parseSearchFilter(_0xe5c717[_0xba28('0x4d')]);})['then'](function(_0x1a0211){_0x5d477b[_0xba28('0x4d')]=_0x1a0211;return _0x5d477b;});}function checkListsRestrictions(_0x58cd44,_0x4664cf,_0x38247a){var _0x3e9067=squel[_0xba28('0x21')]();return Promise[_0xba28('0x4e')]()[_0xba28('0x4b')](function(){if(_0x4664cf[_0xba28('0x6')]&&_0x58cd44[_0xba28('0x4f')]===_0xba28('0x5')&&!_0x38247a){return _0x58cd44[_0xba28('0x50')]({'attributes':['id'],'raw':!![]});}})[_0xba28('0x4b')](function(_0x465622){if(_0x465622){if(_0x465622['length']===0x0){_0x3e9067[_0xba28('0x3e')](_0xba28('0x51'));}else{_0x3e9067['and']('c.ListId\x20IN\x20?',_[_0xba28('0x3b')](_0x465622,'id'));}}})[_0xba28('0x4b')](function(){return _0x3e9067;});}function buildContactsQuery(_0x56aa3d,_0xb34595,_0x12251a,_0x434569,_0x51f563,_0x192877){if(_0xb34595){_0xb34595=_0x12251a[_0xba28('0x52')];}_0x56aa3d=addFieldsToQuery(_0x56aa3d,_0xb34595,_0x434569,_0x192877,!![]);var _0x163ed3=squel[_0xba28('0x9')]();_0x163ed3=addFieldsToQuery(_0x163ed3,_0xb34595,_0x434569,_0x192877,![]);if(_0x434569||_0x192877){_0x56aa3d=applyJoinClauses(_0x56aa3d,!![]);_0x56aa3d[_0xba28('0x53')](_0xba28('0x54'));if(_0x12251a[_0xba28('0x55')]){_0x163ed3[_0xba28('0x55')](_0x12251a['limit']);}if(_0x12251a[_0xba28('0x56')]){_0x163ed3[_0xba28('0x56')](_0x12251a[_0xba28('0x56')]);}}else{_0x163ed3=applyJoinClauses(_0x163ed3,![]);_0x163ed3['group'](_0xba28('0x57'));if(_0x12251a[_0xba28('0x55')]){_0x56aa3d['limit'](_0x12251a[_0xba28('0x55')]);}if(_0x12251a[_0xba28('0x56')]){_0x56aa3d['offset'](_0x12251a[_0xba28('0x56')]);}}_0x163ed3['having'](_0x51f563);if(_0x12251a[_0xba28('0x58')]){_0x12251a[_0xba28('0x58')][_0xba28('0x1e')](function(_0x249f60){_0x56aa3d[_0xba28('0x58')]('c.'+_0x249f60[0x0],_0x249f60[0x1]===_0xba28('0x59')?![]:!![]);_0x163ed3[_0xba28('0x58')](_0xba28('0x5a')+_0x249f60[0x0],_0x249f60[0x1]===_0xba28('0x59')?![]:!![]);});}_0x163ed3[_0xba28('0x5b')](_0x56aa3d,_0xba28('0xc'));return _0x163ed3;}function getFilteredContacts(_0x1c8b90){var _0x3f9abf=[];return db['Tag']['findAll']({'attributes':['id',_0xba28('0x30'),_0xba28('0x5c')],'raw':!![]})['then'](function(_0x1b36b4){_0x3f9abf=_[_0xba28('0x5d')](_0x1b36b4,'id');var _0x13171f={'type':db[_0xba28('0x5e')]['QueryTypes'][_0xba28('0x5f')],'model':db[_0xba28('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xba28('0x61')][_0xba28('0x62')](_0x1c8b90[_0xba28('0x63')](),_0x13171f);})[_0xba28('0x4b')](function(_0x26eba6){_0x26eba6[_0xba28('0x1e')](function(_0xb67306){if(_0xb67306['TagIds']){_0xb67306[_0xba28('0x64')]=[];_0xb67306[_0xba28('0x1f')][_0xba28('0x24')](',')['forEach'](function(_0x563359){_0xb67306[_0xba28('0x64')][_0xba28('0x1d')](_0x3f9abf[_0x563359]);});}delete _0xb67306[_0xba28('0x1f')];});return _0x26eba6;});}function countFilteredContacts(_0x1d7151,_0x2e54e0){var _0x1f804d=_0x1d7151['clone']();_0x1f804d[_0xba28('0x20')](_0xba28('0x65'));_0x1f804d=applyJoinClauses(_0x1f804d,!![]);_0x1d7151[_0xba28('0x53')](_0xba28('0x54'));var _0xac99f=utils[_0xba28('0x22')](_0x2e54e0);if(!_[_0xba28('0x66')](_0xac99f)){_0x1f804d[_0xba28('0xa')](_0xba28('0x67'),_0xac99f);}var _0x52039c={'type':db[_0xba28('0x5e')][_0xba28('0x68')]['SELECT'],'raw':!![]};return db[_0xba28('0x61')]['query'](_0x1f804d['toString'](),_0x52039c)[_0xba28('0x4b')](function(_0x46b766){return _0x46b766[0x0][_0xba28('0x65')];});}module[_0xba28('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xe105=['Tags','clone','isEmpty','t.id\x20IN\x20?','SELECT','COUNT(*)','exports','squel','../parsers/qs','../../mysqldb','agent','search','ListId','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','email','createdAt','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','datetime','castTo','DATE','buildExpression','type','default','text','start','split','map','clause','and','tags','ids','User','uc.UserId\x20=\x20?','value','user','skip','keys','some','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','limit','offset','having','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','toString','TagIds'];(function(_0x325169,_0x1b3ee8){var _0x202a0b=function(_0x5772d3){while(--_0x5772d3){_0x325169['push'](_0x325169['shift']());}};_0x202a0b(++_0x1b3ee8);}(_0xe105,0x19f));var _0x5e10=function(_0x3ddb8e,_0x5e12a5){_0x3ddb8e=_0x3ddb8e-0x0;var _0x398328=_0xe105[_0x3ddb8e];return _0x398328;};'use strict';var _=require('lodash');var squel=require(_0x5e10('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x5e10('0x1'));var utils=require('../interaction/utils');var db=require(_0x5e10('0x2'))['db'];function skipContactsQuery(_0x31db84,_0x326d23){var _0x481f6b=![];if(_0x31db84['role']===_0x5e10('0x3')&&!_0x326d23[_0x5e10('0x4')]&&!_0x326d23[_0x5e10('0x5')]&&_0x326d23['autocomplete']!=='true'){_0x481f6b=!![];}return _0x481f6b;}function getContactsSubquery(){return squel[_0x5e10('0x6')]()[_0x5e10('0x7')](_0x5e10('0x8'),'c')['where'](_0x5e10('0x9'));}function applyJoinClauses(_0x1a7118,_0x699def){var _0x49b705=_0x699def?'c':_0x5e10('0xa');_0x1a7118[_0x5e10('0xb')]('cm_user_has_contacts','uc',_0x5e10('0xc')+_0x49b705+_0x5e10('0xd'))['left_join']('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20'+_0x49b705+_0x5e10('0xd'))[_0x5e10('0xb')]('tools_tags','t',_0x5e10('0xe'));return _0x1a7118;}function addFieldsToQuery(_0x8e48df,_0x1a69d8,_0x34352f,_0x5ddd27,_0x3dd597){var _0x32c31b=_0x3dd597?'c':_0x5e10('0xa');if(!_0x1a69d8){_0x1a69d8=['id',_0x5e10('0xf'),_0x5e10('0x10'),'phone',_0x5e10('0x11'),_0x5e10('0x12'),_0x5e10('0x13'),_0x5e10('0x5'),'CompanyId',_0x5e10('0x14'),'updatedAt','deletedAt','TagIds'];}else if(!_0x1a69d8['includes']('id')){_0x1a69d8[_0x5e10('0x15')]('id');}var _0x4cb282=_0x34352f&&_0x3dd597||!_0x34352f&&!_0x3dd597;if(_0x5ddd27){_0x4cb282=_0x5ddd27&&_0x3dd597||!_0x5ddd27&&!_0x3dd597;}_0x1a69d8[_0x5e10('0x16')](function(_0x341313){if(_0x341313==='TagIds'){if(_0x4cb282){_0x8e48df[_0x5e10('0x17')](_0x5e10('0x18'),_0x341313);}else if(_0x34352f||_0x5ddd27){_0x8e48df[_0x5e10('0x17')](_0x32c31b+'.'+_0x341313);}}else{_0x8e48df['field'](_0x32c31b+'.'+_0x341313);}});return _0x8e48df;}function getSqlClauses(){var _0x15bf7c={'default':squel[_0x5e10('0x19')](),'fields':squel[_0x5e10('0x19')](),'filter':squel[_0x5e10('0x19')](),'tags':{'clause':squel[_0x5e10('0x19')](),'ids':null},'user':{'clause':squel[_0x5e10('0x19')](),'skip':![]}};return _0x15bf7c;}function parseTagParameter(_0x398bb9){var _0x52537b=squel[_0x5e10('0x19')]();if(_0x398bb9){var _0x19c818=utils[_0x5e10('0x1a')](_0x398bb9);_0x19c818[_0x5e10('0x16')](function(_0x1fac3e){_0x52537b['or'](_0x5e10('0x1b'),'%,'+_0x1fac3e+',%');});}return _0x52537b;}function parseSearchFilter(_0x5dbb0d){var _0x5e3c71=squel[_0x5e10('0x19')]();if(_0x5dbb0d){var _0xd041ef=_0x5dbb0d[_0x5e10('0x1c')]('\x5c','\x5c\x5c')[_0x5e10('0x1c')](/'/g,'\x27\x27');if(_0xd041ef['split']('\x20')['length']>0x1){_0x5e3c71['or'](_0x5e10('0x1d'),qs[_0x5e10('0x1e')](_0xd041ef,!![]),null);}else{if(qs[_0x5e10('0x1f')](_0xd041ef)){_0x5e3c71['or'](_0x5e10('0x20'),_0xd041ef+'%');_0x5e3c71['or'](_0x5e10('0x21'),_0xd041ef+'%');_0x5e3c71['or'](_0x5e10('0x22'),_0xd041ef+'%');_0x5e3c71['or']('c.fax\x20LIKE\x20?',_0xd041ef+'%');}else if(qs[_0x5e10('0x23')](_0xd041ef)){_0x5e3c71['or']('c.email\x20LIKE\x20?',_0xd041ef+'%');}else{_0x5e3c71['or'](_0x5e10('0x24'),'%'+_0xd041ef+'%');_0x5e3c71['or'](_0x5e10('0x25'),'%'+_0xd041ef+'%');_0x5e3c71['or']('c.email\x20LIKE\x20?','%'+_0xd041ef+'%');}}}return _0x5e3c71;}function parseAdvancedSearchFilter(_0x2945b3,_0x8482b4){var _0x331dbb=getSqlClauses();var _0x28815a=as[_0x5e10('0x26')](_0x2945b3);var _0x28f1bc=_0x28815a[_0x5e10('0x27')];for(var _0x5e7473=0x0;_0x5e7473<_0x28815a[_0x5e10('0x28')][_0x5e10('0x29')];_0x5e7473++){var _0xa8b36b=_0x28815a[_0x5e10('0x28')][_0x5e7473];var _0x2017e3='c';var _0xe5e160=_[_0x5e10('0x2a')](_0x8482b4,[_0x5e10('0x2b'),_0xa8b36b[_0x5e10('0x17')]]);if(_0xe5e160){if(_0xa8b36b[_0x5e10('0x17')]===_0x5e10('0x2c')||_0xe5e160['fieldType']===_0x5e10('0x2d')){_0xa8b36b[_0x5e10('0x2e')]=_0x5e10('0x2f');}var _0x1a6c87=as[_0x5e10('0x30')](_0x2017e3,_0xe5e160[_0x5e10('0x31')],_0xa8b36b);_0x331dbb[_0x5e10('0x32')][_0x28f1bc](_0x1a6c87[_0x5e10('0x33')],_0x1a6c87['value'][_0x5e10('0x34')],_0x1a6c87['value']['end']);}else{if(_0xa8b36b[_0x5e10('0x17')]==='Tag'){var _0x2d0d60=_0xa8b36b['value'][_0x5e10('0x35')](',')[_0x5e10('0x36')](function(_0x1c4d5e){return Number(_0x1c4d5e);});var _0x561e21=parseTagParameter(_0x2d0d60);_0x331dbb['tags'][_0x5e10('0x37')][_0x5e10('0x38')](_0x561e21);_0x331dbb[_0x5e10('0x39')][_0x5e10('0x3a')]=_0x2d0d60;}else if(_0xa8b36b[_0x5e10('0x17')]===_0x5e10('0x3b')){_0x331dbb['user'][_0x5e10('0x37')][_0x5e10('0x38')](_0x5e10('0x3c'),_0xa8b36b[_0x5e10('0x3d')]);_0x331dbb[_0x5e10('0x3e')][_0x5e10('0x3f')]=!![];}}}return _0x331dbb;}function parseModelFields(_0x4f4144,_0x5abd99){var _0x4f7092=squel['expr']();var _0x5df86b=_(_0x4f4144)[_0x5e10('0x40')]()['map'](function(_0x52b7d9){return _[_0x5e10('0x41')](_0x5abd99,[_0x5e10('0x2b'),_0x52b7d9])?_0x52b7d9:undefined;})[_0x5e10('0x42')]()['value']();if(_0x4f4144[_0x5e10('0x43')]){_0x5df86b[_0x5e10('0x15')](_0x5e10('0x43'));}if(_0x4f4144[_0x5e10('0x3b')]){_0x5df86b[_0x5e10('0x15')]('User');}if(_0x5df86b[_0x5e10('0x29')]>0x0){_0x5df86b[_0x5e10('0x16')](function(_0x5b8484){if(_0x5b8484==='ListId'){_0x4f7092[_0x5e10('0x38')]('c.ListId\x20IN\x20?',[][_0x5e10('0x44')](_0x4f4144[_0x5b8484]));}else if(_0x5b8484===_0x5e10('0x43')){var _0x3a2428='%'+_0x4f4144[_0x5b8484]+'%';_0x4f7092['and'](_0x5e10('0x45'),_0x3a2428);}else if(_0x5b8484===_0x5e10('0x3b')){_0x4f7092[_0x5e10('0x38')](_0x5e10('0x3c'),_0x4f4144[_0x5b8484]);}else{_0x4f7092['and']('c.'+_0x5b8484+'\x20=\x20?',_0x4f4144[_0x5b8484]);}});}return _0x4f7092;}function parseQueryParameters(_0x3ee48c,_0x57e233){var _0x3402c3=getSqlClauses();return Promise[_0x5e10('0x46')]()[_0x5e10('0x47')](function(){return parseModelFields(_0x3ee48c,_0x57e233);})[_0x5e10('0x47')](function(_0x1014ea){_0x3402c3[_0x5e10('0x48')]['and'](_0x1014ea);return parseTagParameter(_0x3ee48c[_0x5e10('0x49')]);})[_0x5e10('0x47')](function(_0x10350c){_0x3402c3[_0x5e10('0x39')][_0x5e10('0x37')][_0x5e10('0x38')](_0x10350c);return parseSearchFilter(_0x3ee48c[_0x5e10('0x4a')]);})[_0x5e10('0x47')](function(_0x1a2f82){_0x3402c3[_0x5e10('0x4a')]=_0x1a2f82;return _0x3402c3;});}function checkListsRestrictions(_0x34faa3,_0xf77f12,_0x30173b){var _0x3de4f3=squel[_0x5e10('0x19')]();return Promise[_0x5e10('0x46')]()[_0x5e10('0x47')](function(){if(_0xf77f12[_0x5e10('0x4')]&&_0x34faa3[_0x5e10('0x4b')]===_0x5e10('0x3')&&!_0x30173b){return _0x34faa3[_0x5e10('0x4c')]({'attributes':['id'],'raw':!![]});}})[_0x5e10('0x47')](function(_0x3babce){if(_0x3babce){if(_0x3babce[_0x5e10('0x29')]===0x0){_0x3de4f3[_0x5e10('0x38')](_0x5e10('0x4d'));}else{_0x3de4f3['and'](_0x5e10('0x4e'),_[_0x5e10('0x36')](_0x3babce,'id'));}}})[_0x5e10('0x47')](function(){return _0x3de4f3;});}function buildContactsQuery(_0xc48d27,_0x158dde,_0x3b2d46,_0x441976,_0x2b395f,_0x375570){if(_0x158dde){_0x158dde=_0x3b2d46[_0x5e10('0x4f')];}_0xc48d27=addFieldsToQuery(_0xc48d27,_0x158dde,_0x441976,_0x375570,!![]);var _0x3c2f87=squel[_0x5e10('0x6')]();_0x3c2f87=addFieldsToQuery(_0x3c2f87,_0x158dde,_0x441976,_0x375570,![]);if(_0x441976||_0x375570){_0xc48d27=applyJoinClauses(_0xc48d27,!![]);_0xc48d27[_0x5e10('0x50')]('c.id');if(_0x3b2d46[_0x5e10('0x51')]){_0x3c2f87['limit'](_0x3b2d46['limit']);}if(_0x3b2d46[_0x5e10('0x52')]){_0x3c2f87[_0x5e10('0x52')](_0x3b2d46[_0x5e10('0x52')]);}}else{_0x3c2f87=applyJoinClauses(_0x3c2f87,![]);_0x3c2f87[_0x5e10('0x50')]('subqry.id');if(_0x3b2d46[_0x5e10('0x51')]){_0xc48d27['limit'](_0x3b2d46[_0x5e10('0x51')]);}if(_0x3b2d46[_0x5e10('0x52')]){_0xc48d27[_0x5e10('0x52')](_0x3b2d46[_0x5e10('0x52')]);}}_0x3c2f87[_0x5e10('0x53')](_0x2b395f);if(_0x3b2d46['order']){_0x3b2d46[_0x5e10('0x54')]['forEach'](function(_0x4a5629){_0xc48d27[_0x5e10('0x54')]('c.'+_0x4a5629[0x0],_0x4a5629[0x1]===_0x5e10('0x55')?![]:!![]);_0x3c2f87['order']('subqry.'+_0x4a5629[0x0],_0x4a5629[0x1]===_0x5e10('0x55')?![]:!![]);});}_0x3c2f87[_0x5e10('0x7')](_0xc48d27,_0x5e10('0xa'));return _0x3c2f87;}function getFilteredContacts(_0x5f0fae){var _0x2fea9d=[];return db['Tag'][_0x5e10('0x56')]({'attributes':['id','name',_0x5e10('0x57')],'raw':!![]})[_0x5e10('0x47')](function(_0x2533f4){_0x2fea9d=_[_0x5e10('0x58')](_0x2533f4,'id');var _0x4d59ba={'type':db[_0x5e10('0x59')][_0x5e10('0x5a')]['SELECT'],'model':db[_0x5e10('0x5b')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5e10('0x5c')]['query'](_0x5f0fae[_0x5e10('0x5d')](),_0x4d59ba);})['then'](function(_0x686ba5){_0x686ba5[_0x5e10('0x16')](function(_0x43e4b9){if(_0x43e4b9[_0x5e10('0x5e')]){_0x43e4b9[_0x5e10('0x5f')]=[];_0x43e4b9[_0x5e10('0x5e')][_0x5e10('0x35')](',')[_0x5e10('0x16')](function(_0x22ae84){_0x43e4b9[_0x5e10('0x5f')][_0x5e10('0x15')](_0x2fea9d[_0x22ae84]);});}delete _0x43e4b9[_0x5e10('0x5e')];});return _0x686ba5;});}function countFilteredContacts(_0xe7754,_0x5674db){var _0x241ac7=_0xe7754[_0x5e10('0x60')]();_0x241ac7[_0x5e10('0x17')]('COUNT(*)');_0x241ac7=applyJoinClauses(_0x241ac7,!![]);_0xe7754[_0x5e10('0x50')]('c.id');var _0x2f5bdc=utils[_0x5e10('0x1a')](_0x5674db);if(!_[_0x5e10('0x61')](_0x2f5bdc)){_0x241ac7['where'](_0x5e10('0x62'),_0x2f5bdc);}var _0x12fbc7={'type':db['Sequelize'][_0x5e10('0x5a')][_0x5e10('0x63')],'raw':!![]};return db[_0x5e10('0x5c')]['query'](_0x241ac7['toString'](),_0x12fbc7)['then'](function(_0x2fad40){return _0x2fad40[0x0][_0x5e10('0x64')];});}module[_0x5e10('0x65')]={'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 2b865cc..a27bd3e 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 _0x25bc=['binary','write','final','end','close','decryptFile','createDecipher','unlink','encryptString','base64','decryptString','utf8','crypto','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','join','error','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update'];(function(_0x7dcb40,_0x439e47){var _0x4bdc47=function(_0x17bbdf){while(--_0x17bbdf){_0x7dcb40['push'](_0x7dcb40['shift']());}};_0x4bdc47(++_0x439e47);}(_0x25bc,0x1d3));var _0xc25b=function(_0x2e80b6,_0x769d8e){_0x2e80b6=_0x2e80b6-0x0;var _0x2bd920=_0x25bc[_0x2e80b6];return _0x2bd920;};'use strict';var crypto=require(_0xc25b('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xc25b('0x1'));var config=require(_0xc25b('0x2'));var logger=require(_0xc25b('0x3'))(_0xc25b('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xc25b('0x5')],'algorithm':_0xc25b('0x6')};const fileOptions={'algorithm':_0xc25b('0x7')};if(config[_0xc25b('0x8')]&&config[_0xc25b('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xc25b('0x8')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0xc25b('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc25b('0x9')](',\x20');logger[_0xc25b('0xa')](config[_0xc25b('0x8')][_0xc25b('0xb')],_0xc25b('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x330bb8){return AES_SUPPORTED_RX[_0xc25b('0xd')](_0x330bb8);}function getSupportedCiphers(){return crypto[_0xc25b('0xe')]()[_0xc25b('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x57cefd){return getSupportedCiphers()[_0xc25b('0x10')](_0x57cefd)>-0x1;}function combineOptions(_0x121894){var _0x2a6168={};for(var _0x455516 in fileOptions){if(fileOptions[_0xc25b('0x11')](_0x455516)){_0x2a6168[_0x455516]=fileOptions[_0x455516];}}if(_0x121894){for(var _0x32e1aa in _0x121894){if(_0x121894[_0xc25b('0x11')](_0x32e1aa)){_0x2a6168[_0x32e1aa]=_0x121894[_0x32e1aa];}}}return _0x2a6168;}exports['encryptFile']=function(_0xd0b775,_0x5c89e6,_0x40d3ba,_0x527627){return new BPromise(function(_0x5ead42,_0x257ea3){_0x527627=combineOptions(_0x527627);var _0x49ea36=new Buffer(_0x40d3ba);var _0x578ab9=fs[_0xc25b('0x12')](_0xd0b775);var _0x214698=fs[_0xc25b('0x13')](_0x5c89e6);var _0x58e35f=crypto[_0xc25b('0x14')](_0x527627[_0xc25b('0xb')],_0x49ea36);_0x578ab9['on'](_0xc25b('0x15'),function(_0x41d4e4){var _0x3db7bd=new Buffer(_0x58e35f[_0xc25b('0x16')](_0x41d4e4),_0xc25b('0x17'));_0x214698[_0xc25b('0x18')](_0x3db7bd);});_0x578ab9['on']('end',function(){try{var _0x2d8526=new Buffer(_0x58e35f[_0xc25b('0x19')]('binary'),'binary');_0x214698[_0xc25b('0x18')](_0x2d8526);_0x214698[_0xc25b('0x1a')]();_0x214698['on'](_0xc25b('0x1b'),function(){return _0x5ead42(_0x5c89e6);});}catch(_0x859b7d){fs['unlink'](_0x5c89e6);return _0x257ea3(_0x859b7d);}});});};exports[_0xc25b('0x1c')]=function(_0x4a8d33,_0x23bf8b,_0x27d2e4,_0x5349e1){return new BPromise(function(_0x3a5ced,_0x486ba8){_0x5349e1=combineOptions(_0x5349e1);var _0x424348=new Buffer(_0x27d2e4);var _0x46c0ef=fs[_0xc25b('0x12')](_0x4a8d33);var _0x42bbd8=fs[_0xc25b('0x13')](_0x23bf8b);var _0x90ebc3=crypto[_0xc25b('0x1d')](_0x5349e1[_0xc25b('0xb')],_0x424348);_0x46c0ef['on']('data',function(_0x32bd30){var _0x2224c3=new Buffer(_0x90ebc3[_0xc25b('0x16')](_0x32bd30),_0xc25b('0x17'));_0x42bbd8[_0xc25b('0x18')](_0x2224c3);});_0x46c0ef['on']('end',function(){try{var _0x51f931=new Buffer(_0x90ebc3[_0xc25b('0x19')](_0xc25b('0x17')),_0xc25b('0x17'));_0x42bbd8[_0xc25b('0x18')](_0x51f931);_0x42bbd8[_0xc25b('0x1a')]();_0x42bbd8['on'](_0xc25b('0x1b'),function(){return _0x3a5ced(_0x23bf8b);});}catch(_0x282ade){fs[_0xc25b('0x1e')](_0x23bf8b);return _0x486ba8(_0x282ade);}});});};exports[_0xc25b('0x1f')]=function(_0x834fa6,_0x3f3552,_0x222e5a){var _0x5de006=_0x222e5a||stringOptions[_0xc25b('0xb')];var _0x5d3b73=_0x3f3552||stringOptions['secret'];var _0x56fd72=crypto[_0xc25b('0x14')](_0x5de006,_0x5d3b73);var _0x4e02da=_0x56fd72[_0xc25b('0x16')](_0x834fa6,'utf8',_0xc25b('0x20'));_0x4e02da+=_0x56fd72['final'](_0xc25b('0x20'));return _0x4e02da;};exports[_0xc25b('0x21')]=function(_0x1a47c8,_0x1ae19b,_0x4db864){var _0x55700a=_0x4db864||stringOptions[_0xc25b('0xb')];var _0x31d425=_0x1ae19b||stringOptions['secret'];var _0x2f419b=crypto[_0xc25b('0x1d')](_0x55700a,_0x31d425);var _0x30cb17=_0x2f419b[_0xc25b('0x16')](_0x1a47c8,_0xc25b('0x20'),'utf8');_0x30cb17+=_0x2f419b[_0xc25b('0x19')](_0xc25b('0x22'));return _0x30cb17;}; \ No newline at end of file +var _0x916b=['lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createCipher','data','update','binary','write','end','final','decryptFile','createWriteStream','createDecipher','close','unlink','encryptString','secret','base64','utf8','crypto'];(function(_0x2ca9e2,_0xdc1986){var _0x434604=function(_0x1345b2){while(--_0x1345b2){_0x2ca9e2['push'](_0x2ca9e2['shift']());}};_0x434604(++_0xdc1986);}(_0x916b,0x175));var _0xb916=function(_0x20d4c0,_0x281bca){_0x20d4c0=_0x20d4c0-0x0;var _0x515a4c=_0x916b[_0x20d4c0];return _0x515a4c;};'use strict';var crypto=require(_0xb916('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xb916('0x1'));var config=require(_0xb916('0x2'));var logger=require(_0xb916('0x3'))(_0xb916('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb916('0x5')][_0xb916('0x6')],'algorithm':_0xb916('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0xb916('0x8')]&&config[_0xb916('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0xb916('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0xb916('0x8')][_0xb916('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xb916('0xa')](config[_0xb916('0x8')]['algorithm'],_0xb916('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x55067b){return AES_SUPPORTED_RX[_0xb916('0xc')](_0x55067b);}function getSupportedCiphers(){return crypto[_0xb916('0xd')]()[_0xb916('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2d305c){return getSupportedCiphers()[_0xb916('0xf')](_0x2d305c)>-0x1;}function combineOptions(_0x5bcd66){var _0x4bd2f7={};for(var _0x3b738f in fileOptions){if(fileOptions[_0xb916('0x10')](_0x3b738f)){_0x4bd2f7[_0x3b738f]=fileOptions[_0x3b738f];}}if(_0x5bcd66){for(var _0x11de7d in _0x5bcd66){if(_0x5bcd66[_0xb916('0x10')](_0x11de7d)){_0x4bd2f7[_0x11de7d]=_0x5bcd66[_0x11de7d];}}}return _0x4bd2f7;}exports['encryptFile']=function(_0x34a8d6,_0x4e83f7,_0x2dc176,_0x202067){return new BPromise(function(_0x531bf8,_0x5d36c6){_0x202067=combineOptions(_0x202067);var _0x2fef31=new Buffer(_0x2dc176);var _0x2c6ee9=fs[_0xb916('0x11')](_0x34a8d6);var _0x19bac3=fs['createWriteStream'](_0x4e83f7);var _0x52ea5b=crypto[_0xb916('0x12')](_0x202067[_0xb916('0x9')],_0x2fef31);_0x2c6ee9['on'](_0xb916('0x13'),function(_0xdba2b8){var _0x515120=new Buffer(_0x52ea5b[_0xb916('0x14')](_0xdba2b8),_0xb916('0x15'));_0x19bac3[_0xb916('0x16')](_0x515120);});_0x2c6ee9['on'](_0xb916('0x17'),function(){try{var _0x489356=new Buffer(_0x52ea5b[_0xb916('0x18')](_0xb916('0x15')),_0xb916('0x15'));_0x19bac3[_0xb916('0x16')](_0x489356);_0x19bac3[_0xb916('0x17')]();_0x19bac3['on']('close',function(){return _0x531bf8(_0x4e83f7);});}catch(_0xa703a3){fs['unlink'](_0x4e83f7);return _0x5d36c6(_0xa703a3);}});});};exports[_0xb916('0x19')]=function(_0x2ca488,_0x4a390a,_0x481410,_0x583f7a){return new BPromise(function(_0x39c31c,_0x47a528){_0x583f7a=combineOptions(_0x583f7a);var _0xd9546b=new Buffer(_0x481410);var _0x3eb16e=fs[_0xb916('0x11')](_0x2ca488);var _0xeefc19=fs[_0xb916('0x1a')](_0x4a390a);var _0x373882=crypto[_0xb916('0x1b')](_0x583f7a[_0xb916('0x9')],_0xd9546b);_0x3eb16e['on']('data',function(_0x3ecd4b){var _0x548f16=new Buffer(_0x373882[_0xb916('0x14')](_0x3ecd4b),'binary');_0xeefc19[_0xb916('0x16')](_0x548f16);});_0x3eb16e['on'](_0xb916('0x17'),function(){try{var _0x1c7460=new Buffer(_0x373882['final'](_0xb916('0x15')),'binary');_0xeefc19[_0xb916('0x16')](_0x1c7460);_0xeefc19[_0xb916('0x17')]();_0xeefc19['on'](_0xb916('0x1c'),function(){return _0x39c31c(_0x4a390a);});}catch(_0x580556){fs[_0xb916('0x1d')](_0x4a390a);return _0x47a528(_0x580556);}});});};exports[_0xb916('0x1e')]=function(_0x1707b7,_0x1459c0,_0x4f287c){var _0x496a49=_0x4f287c||stringOptions[_0xb916('0x9')];var _0x2bdac8=_0x1459c0||stringOptions[_0xb916('0x1f')];var _0x1bb49e=crypto[_0xb916('0x12')](_0x496a49,_0x2bdac8);var _0x5ab4c7=_0x1bb49e[_0xb916('0x14')](_0x1707b7,'utf8',_0xb916('0x20'));_0x5ab4c7+=_0x1bb49e[_0xb916('0x18')]('base64');return _0x5ab4c7;};exports['decryptString']=function(_0x5c6337,_0x1cd949,_0xc0de06){var _0x33f0aa=_0xc0de06||stringOptions['algorithm'];var _0x413c43=_0x1cd949||stringOptions[_0xb916('0x1f')];var _0x1d6186=crypto['createDecipher'](_0x33f0aa,_0x413c43);var _0x43e610=_0x1d6186[_0xb916('0x14')](_0x5c6337,_0xb916('0x20'),'utf8');_0x43e610+=_0x1d6186['final'](_0xb916('0x21'));return _0x43e610;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9c277f2..25ac238 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 _0x7acc=['sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','.csv','existsSync','join','mkdirSync','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','info','inspect','Failed','finally','exit','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7acc,0xd8));var _0xc7ac=function(_0x33f99c,_0x17882f){_0x33f99c=_0x33f99c-0x0;var _0x4b24d5=_0x7acc[_0x33f99c];return _0x4b24d5;};'use strict';var util=require('util');var path=require(_0xc7ac('0x0'));var _=require(_0xc7ac('0x1'));var csv=require(_0xc7ac('0x2'));var fs=require('fs');var BPromise=require(_0xc7ac('0x3'));var zipdir=require(_0xc7ac('0x4'));var rimraf=require(_0xc7ac('0x5'));var db=require(_0xc7ac('0x6'))['db'];var dbH=require(_0xc7ac('0x6'))[_0xc7ac('0x7')];var logger=require(_0xc7ac('0x8'))(_0xc7ac('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xc7ac('0xa')][0x2]);var QUERY=process[_0xc7ac('0xa')][0x3];var PATH=process[_0xc7ac('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x34dc84,_0x23a603){var _0x54ecc0={'status':_0x34dc84};var _0x1c275b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23a603){_0x54ecc0['savename']=_0x23a603;}return db['AnalyticExtractedReport']['update'](_0x54ecc0,_0x1c275b);}function main(){var _0x407efc=0x1388;var _0x178835;logger['info'](util[_0xc7ac('0xb')](_0xc7ac('0xc'),EXTRACTED_REPORT_ID,_0xc7ac('0xd')));return db[_0xc7ac('0xe')][_0xc7ac('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc7ac('0x10'),_0xc7ac('0x11')]})['then'](function(_0x4f4460){if(_0x4f4460){_0x178835=_0x4f4460;_0x407efc=_0x178835['splitSizeCsv']||0x1388;}})[_0xc7ac('0x12')](function(){return dbH[_0xc7ac('0x13')]['query'](util[_0xc7ac('0xb')](_0xc7ac('0x14'),QUERY),{'type':dbH[_0xc7ac('0x13')][_0xc7ac('0x15')]['SELECT']});})[_0xc7ac('0x12')](function(_0x1dd83a){if(!_0x1dd83a[0x0][_0xc7ac('0x16')]){return analyticExtractedReport(_0xc7ac('0x17'));}var _0x51b7c2=[];var _0x2269cd=0x0;if(_0x178835[_0xc7ac('0x10')]){if(_0x1dd83a&&_0x1dd83a[_0xc7ac('0x18')]){var _0x4101b6=_[_0xc7ac('0x19')](_0x1dd83a[0x0][_0xc7ac('0x16')]/_0x407efc);var _0x4ddec2=Number[_0xc7ac('0x1a')](_0x1dd83a[0x0][_0xc7ac('0x16')]/_0x407efc)?_0x1dd83a[0x0][_0xc7ac('0x16')]%_0x407efc:0x0;_0x4101b6[_0xc7ac('0x1b')](function(_0x212a3f){if(_0x212a3f>0x0){_0x2269cd+=_0x407efc;}_0x51b7c2['push'](dbH[_0xc7ac('0x13')][_0xc7ac('0x1c')](util[_0xc7ac('0xb')](_0xc7ac('0x1d'),QUERY,_0x407efc,_0x2269cd),{'type':dbH[_0xc7ac('0x13')]['QueryTypes'][_0xc7ac('0x1e')]}));});if(_0x4ddec2>0x0){_0x2269cd+=_0x407efc;_0x51b7c2[_0xc7ac('0x1f')](dbH['sequelize'][_0xc7ac('0x1c')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4ddec2,_0x2269cd),{'type':dbH[_0xc7ac('0x13')][_0xc7ac('0x15')][_0xc7ac('0x1e')]}));}}}else{_0x51b7c2[_0xc7ac('0x1f')](dbH[_0xc7ac('0x13')][_0xc7ac('0x1c')](QUERY,{'type':dbH[_0xc7ac('0x13')]['QueryTypes'][_0xc7ac('0x1e')]}));}var _0x539c28=path['dirname'](PATH);var _0x492de1=path['basename'](PATH,_0xc7ac('0x20'));var _0x20418f=_0x178835[_0xc7ac('0x10')]&&_0x51b7c2[_0xc7ac('0x18')]>0x1;var _0xe0be5=[];if(!fs[_0xc7ac('0x21')](path[_0xc7ac('0x22')](_0x539c28,_0x492de1))&&_0x20418f){fs[_0xc7ac('0x23')](path[_0xc7ac('0x22')](_0x539c28,_0x492de1));}return BPromise['each'](_0x51b7c2,function(_0x170d51){_0xe0be5['push'](_0x170d51);})[_0xc7ac('0x12')](function(){for(var _0x4a53d9=0x0;_0x4a53d9<_0xe0be5[_0xc7ac('0x18')];_0x4a53d9+=0x1){var _0x1dba40;var _0x5c3d58=_0xe0be5[_0x4a53d9];if(_0x20418f){_0x1dba40=path[_0xc7ac('0x22')](_0x539c28,_0x492de1,util[_0xc7ac('0xb')]('%s%d.%s',_0x492de1,_0x4a53d9,_0xc7ac('0x24')));}else{_0x1dba40=path[_0xc7ac('0x22')](_0x539c28,util[_0xc7ac('0xb')](_0xc7ac('0x25'),_0x492de1,'csv'));}fs[_0xc7ac('0x26')](_0x1dba40,csv(_0x5c3d58));}})[_0xc7ac('0x12')](function(){if(_0x20418f){return new Promise(function(_0x4ce05e){zipdir(path['join'](_0x539c28,_0x492de1),{'saveTo':path[_0xc7ac('0x22')](_0x539c28,util['format'](_0xc7ac('0x25'),_0x492de1,_0xc7ac('0x27')))},function(_0x3829f0,_0x481119){rimraf(path['join'](_0x539c28,_0x492de1),function(){});_0x4ce05e(_0xc7ac('0x28'));});});}})[_0xc7ac('0x12')](function(){logger['info'](util[_0xc7ac('0xb')](_0xc7ac('0x29'),EXTRACTED_REPORT_ID,_0xc7ac('0xd')));return analyticExtractedReport('Completed',_0x20418f?util[_0xc7ac('0xb')]('%s.%s',_0x492de1,_0x20418f?_0xc7ac('0x27'):_0xc7ac('0x24')):null);});})['catch'](function(_0x4879a1){logger[_0xc7ac('0x2a')](util[_0xc7ac('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0xc7ac('0x2b')](_0x4879a1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc7ac('0x2c'));})[_0xc7ac('0x2d')](function(){process[_0xc7ac('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4312=['split','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','join','each','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','sequelize','query','SELECT','then','num','Empty'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x4312,0x14b));var _0x2431=function(_0x944797,_0x147b4c){_0x944797=_0x944797-0x0;var _0x1908ca=_0x4312[_0x944797];return _0x1908ca;};'use strict';var util=require(_0x2431('0x0'));var path=require(_0x2431('0x1'));var _=require(_0x2431('0x2'));var csv=require(_0x2431('0x3'));var fs=require('fs');var BPromise=require(_0x2431('0x4'));var zipdir=require(_0x2431('0x5'));var rimraf=require(_0x2431('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2431('0x7'))[_0x2431('0x8')];var logger=require(_0x2431('0x9'))(_0x2431('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2431('0xb')][0x3];var PATH=process[_0x2431('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x6a7e12,_0x4198d1){var _0x104cf6={'status':_0x6a7e12};var _0xdbaff9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4198d1){_0x104cf6[_0x2431('0xc')]=_0x4198d1;}return db[_0x2431('0xd')]['update'](_0x104cf6,_0xdbaff9);}function main(){var _0xe85d63=0x1388;var _0x3639a9;logger[_0x2431('0xe')](util[_0x2431('0xf')](_0x2431('0x10'),EXTRACTED_REPORT_ID,_0x2431('0x11')));return db[_0x2431('0x12')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})['then'](function(_0x4b76b4){if(_0x4b76b4){_0x3639a9=_0x4b76b4;_0xe85d63=_0x3639a9[_0x2431('0x13')]||0x1388;}})['then'](function(){return dbH[_0x2431('0x14')][_0x2431('0x15')](util[_0x2431('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2431('0x14')]['QueryTypes'][_0x2431('0x16')]});})[_0x2431('0x17')](function(_0x4e63fc){if(!_0x4e63fc[0x0][_0x2431('0x18')]){return analyticExtractedReport(_0x2431('0x19'));}var _0x22a0c9=[];var _0x445591=0x0;if(_0x3639a9[_0x2431('0x1a')]){if(_0x4e63fc&&_0x4e63fc[_0x2431('0x1b')]){var _0x286e7b=_[_0x2431('0x1c')](_0x4e63fc[0x0][_0x2431('0x18')]/_0xe85d63);var _0x3c1228=Number['isInteger'](_0x4e63fc[0x0][_0x2431('0x18')]/_0xe85d63)?_0x4e63fc[0x0][_0x2431('0x18')]%_0xe85d63:0x0;_0x286e7b[_0x2431('0x1d')](function(_0x18fc90){if(_0x18fc90>0x0){_0x445591+=_0xe85d63;}_0x22a0c9[_0x2431('0x1e')](dbH[_0x2431('0x14')][_0x2431('0x15')](util[_0x2431('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe85d63,_0x445591),{'type':dbH['sequelize']['QueryTypes'][_0x2431('0x16')]}));});if(_0x3c1228>0x0){_0x445591+=_0xe85d63;_0x22a0c9[_0x2431('0x1e')](dbH['sequelize']['query'](util['format'](_0x2431('0x1f'),QUERY,_0x3c1228,_0x445591),{'type':dbH[_0x2431('0x14')]['QueryTypes'][_0x2431('0x16')]}));}}}else{_0x22a0c9[_0x2431('0x1e')](dbH['sequelize'][_0x2431('0x15')](QUERY,{'type':dbH['sequelize'][_0x2431('0x20')]['SELECT']}));}var _0x24944d=path[_0x2431('0x21')](PATH);var _0x56e2e8=path[_0x2431('0x22')](PATH,_0x2431('0x23'));var _0x4a920b=_0x3639a9['split']&&_0x22a0c9['length']>0x1;var _0x1e851d=[];if(!fs['existsSync'](path[_0x2431('0x24')](_0x24944d,_0x56e2e8))&&_0x4a920b){fs['mkdirSync'](path['join'](_0x24944d,_0x56e2e8));}return BPromise[_0x2431('0x25')](_0x22a0c9,function(_0x736af8){_0x1e851d[_0x2431('0x1e')](_0x736af8);})[_0x2431('0x17')](function(){for(var _0x42548d=0x0;_0x42548d<_0x1e851d[_0x2431('0x1b')];_0x42548d+=0x1){var _0x1d2aab;var _0x4aada8=_0x1e851d[_0x42548d];if(_0x4a920b){_0x1d2aab=path[_0x2431('0x24')](_0x24944d,_0x56e2e8,util[_0x2431('0xf')]('%s%d.%s',_0x56e2e8,_0x42548d,_0x2431('0x26')));}else{_0x1d2aab=path[_0x2431('0x24')](_0x24944d,util[_0x2431('0xf')](_0x2431('0x27'),_0x56e2e8,_0x2431('0x26')));}fs[_0x2431('0x28')](_0x1d2aab,csv(_0x4aada8));}})[_0x2431('0x17')](function(){if(_0x4a920b){return new Promise(function(_0xe1ab7c){zipdir(path['join'](_0x24944d,_0x56e2e8),{'saveTo':path['join'](_0x24944d,util[_0x2431('0xf')](_0x2431('0x27'),_0x56e2e8,'zip'))},function(_0x58db7c,_0x2eec52){rimraf(path[_0x2431('0x24')](_0x24944d,_0x56e2e8),function(){});_0xe1ab7c(_0x2431('0x29'));});});}})[_0x2431('0x17')](function(){logger['info'](util[_0x2431('0xf')](_0x2431('0x2a'),EXTRACTED_REPORT_ID,_0x2431('0x11')));return analyticExtractedReport(_0x2431('0x2b'),_0x4a920b?util[_0x2431('0xf')](_0x2431('0x27'),_0x56e2e8,_0x4a920b?_0x2431('0x2c'):_0x2431('0x26')):null);});})[_0x2431('0x2d')](function(_0x157584){logger[_0x2431('0xe')](util[_0x2431('0xf')](_0x2431('0x2e'),EXTRACTED_REPORT_ID,_0x2431('0x11')),util[_0x2431('0x2f')](_0x157584,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2431('0x30'));})[_0x2431('0x31')](function(){process[_0x2431('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index b59c6d4..7867f8f 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 _0x7f9f=['finish','error','createPdfFromHTML','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','value','fill','length','auto','body','concat','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','black','right','Empty','Setting','find','split','splitSizePdf','then','num','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream'];(function(_0x59931d,_0x7c1f6d){var _0x4a5efd=function(_0x17df0c){while(--_0x17df0c){_0x59931d['push'](_0x59931d['shift']());}};_0x4a5efd(++_0x7c1f6d);}(_0x7f9f,0xb3));var _0xf7f9=function(_0x3b55a0,_0x1fa6ab){_0x3b55a0=_0x3b55a0-0x0;var _0x465bb9=_0x7f9f[_0x3b55a0];return _0x465bb9;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xf7f9('0x0'));var moment=require(_0xf7f9('0x1'));var htmlToPdfmake=require(_0xf7f9('0x2'));var PdfPrinter=require(_0xf7f9('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xf7f9('0x4'));var JSDOM=require(_0xf7f9('0x5'))[_0xf7f9('0x6')];var window=new JSDOM('')[_0xf7f9('0x7')];var BPromise=require(_0xf7f9('0x8'));var db=require(_0xf7f9('0x9'))['db'];var dbH=require(_0xf7f9('0x9'))[_0xf7f9('0xa')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xf7f9('0xb')][0x2]);var QUERY=process[_0xf7f9('0xb')][0x3];var PATH=process[_0xf7f9('0xb')][0x4];var NAME=process[_0xf7f9('0xb')][0x5];var FORMAT=_0xf7f9('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x23896e,_0x3f70f0){var _0x13d3dc={'status':_0x23896e};var _0x31a183={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f70f0){_0x13d3dc[_0xf7f9('0xd')]=_0x3f70f0;}return db[_0xf7f9('0xe')]['update'](_0x13d3dc,_0x31a183);}function getHeaders(_0x236800){return _[_0xf7f9('0xf')](_0x236800,function(_0x275d14){return{'text':_0x275d14,'style':'tableHeader'};});}function getRows(_0xaac5e6,_0x5ebb61){return _[_0xf7f9('0xf')](_0x5ebb61,function(_0x134e45){return _(_0x134e45)['pick'](_0xaac5e6)['map'](function(_0x345004){return _0x345004?_['toString'](_0x345004):'';})[_0xf7f9('0x10')]();});}function createTable(_0x5cdb6d,_0x2d6de9){var _0x390542={'widths':_[_0xf7f9('0x11')](Array(_0x5cdb6d[_0xf7f9('0x12')]),0x91),'heights':function(_0x407dc8){return _0x407dc8===0x0?_0xf7f9('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x78687=getHeaders(_0x5cdb6d);_0x390542['body']['push'](_0x78687);var _0x3d1b36=getRows(_0x5cdb6d,_0x2d6de9);_0x390542[_0xf7f9('0x14')]=_0x390542[_0xf7f9('0x14')][_0xf7f9('0x15')](_0x3d1b36);return _0x390542;}function createTables(_0x40991d){var _0x2a97f7=[];var _0xa239a3=_['chunk'](Object[_0xf7f9('0x16')](_0x40991d[0x0]),0x5);_0xa239a3[_0xf7f9('0x17')](function(_0x59e111){_0x2a97f7[_0xf7f9('0x18')](createTable(_0x59e111,_0x40991d));});return _0x2a97f7;}function getPDFDocDefinition(_0x4b0a24){var _0x12ddee=util[_0xf7f9('0x19')](_0xf7f9('0x1a'),NAME,EXTRACTED_REPORT[_0xf7f9('0x1b')],moment(EXTRACTED_REPORT[_0xf7f9('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xf7f9('0x1d')])[_0xf7f9('0x19')](FORMAT));var _0x4268be=[];for(var _0x48ec0f=0x0;_0x48ec0f<_0x4b0a24[_0xf7f9('0x12')];_0x48ec0f++){var _0x1538a8=[];if(_0x48ec0f===0x0){_0x1538a8[_0xf7f9('0x18')]({'text':_0x12ddee,'style':_0xf7f9('0x1e')});}var _0x40d100={'table':_0x4b0a24[_0x48ec0f]};if(_0x48ec0f>0x0){_0x40d100[_0xf7f9('0x1f')]=_0xf7f9('0x20');_0x40d100[_0xf7f9('0x21')]=[0x0,0x46,0x0,0x0];}_0x1538a8[_0xf7f9('0x18')](_0x40d100);_0x4268be[_0xf7f9('0x18')](_0x1538a8);}return{'pageSize':'A4','pageOrientation':_0xf7f9('0x22'),'content':_0x4268be,'footer':function(_0x4b8416,_0x314053){return{'text':_0x4b8416[_0xf7f9('0x23')]()+_0xf7f9('0x24')+_0x314053,'style':_0xf7f9('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf7f9('0x26')},'footer':{'alignment':_0xf7f9('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4cf0d8){var _0x25c69c=0x1388;var _0x939b0f;if(!_0x4cf0d8[0x0]['num']){return analyticExtractedReport(_0xf7f9('0x28'));}return db[_0xf7f9('0x29')][_0xf7f9('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf7f9('0x2b'),_0xf7f9('0x2c')]})[_0xf7f9('0x2d')](function(_0x4cf9fa){if(_0x4cf9fa){_0x939b0f=_0x4cf9fa;_0x25c69c=_0x939b0f[_0xf7f9('0x2c')]||0x3e8;}})[_0xf7f9('0x2d')](function(){var _0x1bb478=[];var _0x110ec0=0x0;if(_0x939b0f[_0xf7f9('0x2b')]){if(_0x4cf0d8&&_0x4cf0d8[_0xf7f9('0x12')]){var _0x1608e8=_['range'](_0x4cf0d8[0x0][_0xf7f9('0x2e')]/_0x25c69c);var _0x327381=Number['isInteger'](_0x4cf0d8[0x0][_0xf7f9('0x2e')]/_0x25c69c)?_0x4cf0d8[0x0][_0xf7f9('0x2e')]%_0x25c69c:0x0;_0x1608e8[_0xf7f9('0x17')](function(_0x2f4fcc){if(_0x2f4fcc>0x0){_0x110ec0+=_0x25c69c;}_0x1bb478[_0xf7f9('0x18')](dbH[_0xf7f9('0x2f')][_0xf7f9('0x30')](util[_0xf7f9('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x25c69c,_0x110ec0),{'type':dbH[_0xf7f9('0x2f')][_0xf7f9('0x31')][_0xf7f9('0x32')]}));});if(_0x327381>0x0){_0x110ec0+=_0x25c69c;_0x1bb478[_0xf7f9('0x18')](dbH[_0xf7f9('0x2f')][_0xf7f9('0x30')](util['format'](_0xf7f9('0x33'),QUERY,_0x327381,_0x110ec0),{'type':dbH[_0xf7f9('0x2f')][_0xf7f9('0x31')][_0xf7f9('0x32')]}));}}}else{_0x1bb478[_0xf7f9('0x18')](dbH['sequelize'][_0xf7f9('0x30')](QUERY,{'type':dbH['sequelize'][_0xf7f9('0x31')]['SELECT']}));}var _0x1e2d62=path['dirname'](PATH);var _0x2ef37d=path['basename'](PATH,_0xf7f9('0x34'));var _0x58e4e7=_0x939b0f[_0xf7f9('0x2b')]&&_0x1bb478[_0xf7f9('0x12')]>0x1;var _0x3f8262=[];if(!fs[_0xf7f9('0x35')](path[_0xf7f9('0x36')](_0x1e2d62,_0x2ef37d))&&_0x58e4e7){fs[_0xf7f9('0x37')](path[_0xf7f9('0x36')](_0x1e2d62,_0x2ef37d));}return BPromise['each'](_0x1bb478,function(_0x3db325){_0x3f8262[_0xf7f9('0x18')](_0x3db325);})[_0xf7f9('0x2d')](function(){var _0x5b1b3a=[];for(var _0xcd3360=0x0;_0xcd3360<_0x3f8262['length'];_0xcd3360+=0x1){var _0x5d0fd4=_0x3f8262[_0xcd3360];var _0xe381d7=createTables(_[_0xf7f9('0x38')](_0x5d0fd4));var _0x4438b3;var _0x1a4609=getPDFDocDefinition(_0xe381d7);var _0xbe9e20=getPDFPrinter();var _0x41661f=_0xbe9e20[_0xf7f9('0x39')](_0x1a4609);if(_0x58e4e7){_0x4438b3=path[_0xf7f9('0x36')](_0x1e2d62,_0x2ef37d,util[_0xf7f9('0x19')](_0xf7f9('0x3a'),_0x2ef37d,_0xcd3360,_0xf7f9('0x3b')));}else{_0x4438b3=path[_0xf7f9('0x36')](_0x1e2d62,util['format'](_0xf7f9('0x3c'),_0x2ef37d,_0xf7f9('0x3b')));}_0x5b1b3a[_0xf7f9('0x18')](writePDFDocument(_0x41661f,_0x4438b3));}return Promise['all'](_0x5b1b3a);})['then'](function(){if(_0x58e4e7){return new Promise(function(_0x2241f5){zipdir(path[_0xf7f9('0x36')](_0x1e2d62,_0x2ef37d),{'saveTo':path[_0xf7f9('0x36')](_0x1e2d62,util[_0xf7f9('0x19')](_0xf7f9('0x3c'),_0x2ef37d,'zip'))},function(){rimraf(path[_0xf7f9('0x36')](_0x1e2d62,_0x2ef37d),function(){});_0x2241f5('zip\x20finished');});});}})[_0xf7f9('0x2d')](function(){if(!_0x58e4e7)return;rimraf(path['join'](_0x1e2d62,_0x2ef37d),function(){});})[_0xf7f9('0x2d')](function(){logger['info'](util[_0xf7f9('0x19')](_0xf7f9('0x3d'),EXTRACTED_REPORT_ID,_0xf7f9('0x3e')));return analyticExtractedReport(_0xf7f9('0x3f'),_0x58e4e7?util[_0xf7f9('0x19')](_0xf7f9('0x3c'),_0x2ef37d,_0x58e4e7?_0xf7f9('0x40'):_0xf7f9('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf7f9('0x41')](util[_0xf7f9('0x19')](_0xf7f9('0x42'),EXTRACTED_REPORT_ID,_0xf7f9('0x3e')));return db[_0xf7f9('0xe')][_0xf7f9('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf7f9('0x2d')](function(_0x180183){EXTRACTED_REPORT=_0x180183;return dbH[_0xf7f9('0x2f')][_0xf7f9('0x30')](util[_0xf7f9('0x19')](_0xf7f9('0x44'),QUERY),{'type':dbH[_0xf7f9('0x2f')][_0xf7f9('0x31')][_0xf7f9('0x32')]});})[_0xf7f9('0x2d')](extractReport)['catch'](function(_0x4784fc){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf7f9('0x3e')),util['inspect'](_0x4784fc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf7f9('0x45'));})[_0xf7f9('0x46')](function(){process[_0xf7f9('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x30f128=new PdfPrinter({'Arial':{'normal':__dirname+_0xf7f9('0x48'),'bold':__dirname+_0xf7f9('0x49'),'italics':__dirname+_0xf7f9('0x4a'),'bolditalics':__dirname+_0xf7f9('0x4b')}});return _0x30f128;}function getPDFDocDefinitionFromHTML(_0x915b96,_0x569bae){var _0x4ed6d9=util[_0xf7f9('0x19')](_0xf7f9('0x4c'),_0x569bae[_0xf7f9('0x4d')],_0x569bae['interactionId']);var _0x509235=moment()[_0xf7f9('0x19')](_0xf7f9('0x4e'))[_0xf7f9('0x23')]();var _0x32267e=htmlToPdfmake(_0x915b96,{'window':window,'tableAutoSize':!![]});return{'content':[_0x32267e],'defaultStyle':{'font':_0xf7f9('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf7f9('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xf7f9('0x51'),'style':_0xf7f9('0x1e')}];},'footer':function(_0x605a5a,_0x2519d7){return[{'text':util[_0xf7f9('0x19')](_0xf7f9('0x52'),_0x4ed6d9,_0x605a5a,_0x2519d7,_0x509235),'style':_0xf7f9('0x25')}];}};}function writePDFDocument(_0x538665,_0x568dfa){return new Promise(function(_0x28fadf,_0x2b2a82){var _0x4aadd0=_0x538665[_0xf7f9('0x53')](fs[_0xf7f9('0x54')](_0x568dfa));_0x4aadd0['on'](_0xf7f9('0x55'),function(){_0x28fadf(_0xf7f9('0x55'));});_0x4aadd0['on'](_0xf7f9('0x56'),function(_0x642733){_0x2b2a82(_0x642733);});_0x538665['end']();});}exports[_0xf7f9('0x57')]=function(_0x5ee249,_0x1b3dc5){var _0x24dc10=getPDFPrinter();var _0x47340e=getPDFDocDefinitionFromHTML(_0x5ee249,_0x1b3dc5);var _0x3b3687=_0x24dc10['createPdfKitDocument'](_0x47340e);return writePDFDocument(_0x3b3687,_0x1b3dc5[_0xf7f9('0x0')])['catch'](function(_0x5d027f){throw _0x5d027f;});}; \ No newline at end of file +var _0x8dec=['pick','toString','value','fill','auto','body','concat','chunk','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','length','header','pageBreak','margin','landscape','footer','Arial','black','num','Empty','Setting','find','splitSizePdf','then','split','isInteger','sequelize','query','QueryTypes','SELECT','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader'];(function(_0x31fa75,_0x2f6615){var _0x59d721=function(_0x2e19e3){while(--_0x2e19e3){_0x31fa75['push'](_0x31fa75['shift']());}};_0x59d721(++_0x2f6615);}(_0x8dec,0x19c));var _0xc8de=function(_0x310994,_0x4c5d81){_0x310994=_0x310994-0x0;var _0x3c0b9a=_0x8dec[_0x310994];return _0x3c0b9a;};'use strict';var _=require(_0xc8de('0x0'));var fs=require('fs');var util=require(_0xc8de('0x1'));var path=require(_0xc8de('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xc8de('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xc8de('0x4'));var JSDOM=require(_0xc8de('0x5'))[_0xc8de('0x6')];var window=new JSDOM('')[_0xc8de('0x7')];var BPromise=require(_0xc8de('0x8'));var db=require(_0xc8de('0x9'))['db'];var dbH=require(_0xc8de('0x9'))['dbH'];var logger=require(_0xc8de('0xa'))(_0xc8de('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc8de('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xc8de('0xc')][0x5];var FORMAT=_0xc8de('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x330093,_0x51a09f){var _0x26badf={'status':_0x330093};var _0x4ee47c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51a09f){_0x26badf[_0xc8de('0xe')]=_0x51a09f;}return db['AnalyticExtractedReport'][_0xc8de('0xf')](_0x26badf,_0x4ee47c);}function getHeaders(_0x5a525f){return _[_0xc8de('0x10')](_0x5a525f,function(_0x4af524){return{'text':_0x4af524,'style':_0xc8de('0x11')};});}function getRows(_0xabe469,_0x5002e8){return _[_0xc8de('0x10')](_0x5002e8,function(_0x35a87d){return _(_0x35a87d)[_0xc8de('0x12')](_0xabe469)[_0xc8de('0x10')](function(_0x40a3e4){return _0x40a3e4?_[_0xc8de('0x13')](_0x40a3e4):'';})[_0xc8de('0x14')]();});}function createTable(_0x41ff30,_0x185d70){var _0x97d8da={'widths':_[_0xc8de('0x15')](Array(_0x41ff30['length']),0x91),'heights':function(_0x19d20d){return _0x19d20d===0x0?_0xc8de('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3a7703=getHeaders(_0x41ff30);_0x97d8da[_0xc8de('0x17')]['push'](_0x3a7703);var _0x1ed0c6=getRows(_0x41ff30,_0x185d70);_0x97d8da[_0xc8de('0x17')]=_0x97d8da['body'][_0xc8de('0x18')](_0x1ed0c6);return _0x97d8da;}function createTables(_0x579dbb){var _0x37297c=[];var _0x1d7ca9=_[_0xc8de('0x19')](Object['keys'](_0x579dbb[0x0]),0x5);_0x1d7ca9[_0xc8de('0x1a')](function(_0x5500b6){_0x37297c[_0xc8de('0x1b')](createTable(_0x5500b6,_0x579dbb));});return _0x37297c;}function getPDFDocDefinition(_0x1f35e3){var _0x1375cd=util[_0xc8de('0x1c')](_0xc8de('0x1d'),NAME,EXTRACTED_REPORT[_0xc8de('0x1e')],moment(EXTRACTED_REPORT['startDate'])[_0xc8de('0x1c')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xc8de('0x1c')](FORMAT));var _0x1bc218=[];for(var _0x17ee6c=0x0;_0x17ee6c<_0x1f35e3[_0xc8de('0x1f')];_0x17ee6c++){var _0x2a2281=[];if(_0x17ee6c===0x0){_0x2a2281['push']({'text':_0x1375cd,'style':_0xc8de('0x20')});}var _0x1b19b7={'table':_0x1f35e3[_0x17ee6c]};if(_0x17ee6c>0x0){_0x1b19b7[_0xc8de('0x21')]='before';_0x1b19b7[_0xc8de('0x22')]=[0x0,0x46,0x0,0x0];}_0x2a2281[_0xc8de('0x1b')](_0x1b19b7);_0x1bc218[_0xc8de('0x1b')](_0x2a2281);}return{'pageSize':'A4','pageOrientation':_0xc8de('0x23'),'content':_0x1bc218,'footer':function(_0x242973,_0x18b22f){return{'text':_0x242973[_0xc8de('0x13')]()+'\x20/\x20'+_0x18b22f,'style':_0xc8de('0x24')};},'defaultStyle':{'font':_0xc8de('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc8de('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3d14fa){var _0x4df004=0x1388;var _0x10112d;if(!_0x3d14fa[0x0][_0xc8de('0x27')]){return analyticExtractedReport(_0xc8de('0x28'));}return db[_0xc8de('0x29')][_0xc8de('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x5ed04a){if(_0x5ed04a){_0x10112d=_0x5ed04a;_0x4df004=_0x10112d[_0xc8de('0x2b')]||0x3e8;}})[_0xc8de('0x2c')](function(){var _0x25e90c=[];var _0x55bd1d=0x0;if(_0x10112d[_0xc8de('0x2d')]){if(_0x3d14fa&&_0x3d14fa[_0xc8de('0x1f')]){var _0x20ed4e=_['range'](_0x3d14fa[0x0][_0xc8de('0x27')]/_0x4df004);var _0x27c938=Number[_0xc8de('0x2e')](_0x3d14fa[0x0][_0xc8de('0x27')]/_0x4df004)?_0x3d14fa[0x0][_0xc8de('0x27')]%_0x4df004:0x0;_0x20ed4e['forEach'](function(_0x51ebc5){if(_0x51ebc5>0x0){_0x55bd1d+=_0x4df004;}_0x25e90c['push'](dbH[_0xc8de('0x2f')][_0xc8de('0x30')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4df004,_0x55bd1d),{'type':dbH[_0xc8de('0x2f')][_0xc8de('0x31')][_0xc8de('0x32')]}));});if(_0x27c938>0x0){_0x55bd1d+=_0x4df004;_0x25e90c['push'](dbH[_0xc8de('0x2f')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x27c938,_0x55bd1d),{'type':dbH[_0xc8de('0x2f')]['QueryTypes'][_0xc8de('0x32')]}));}}}else{_0x25e90c[_0xc8de('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xc8de('0x2f')][_0xc8de('0x31')][_0xc8de('0x32')]}));}var _0x1b581c=path['dirname'](PATH);var _0xcc17a5=path['basename'](PATH,'.pdf');var _0x36f18c=_0x10112d['split']&&_0x25e90c['length']>0x1;var _0x29fd8a=[];if(!fs[_0xc8de('0x33')](path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5))&&_0x36f18c){fs[_0xc8de('0x35')](path['join'](_0x1b581c,_0xcc17a5));}return BPromise['each'](_0x25e90c,function(_0x45b50a){_0x29fd8a[_0xc8de('0x1b')](_0x45b50a);})[_0xc8de('0x2c')](function(){var _0x3d0b5d=[];for(var _0x505523=0x0;_0x505523<_0x29fd8a[_0xc8de('0x1f')];_0x505523+=0x1){var _0x57c909=_0x29fd8a[_0x505523];var _0x572e78=createTables(_[_0xc8de('0x36')](_0x57c909));var _0x1f9523;var _0x30489c=getPDFDocDefinition(_0x572e78);var _0x5b7d52=getPDFPrinter();var _0x216411=_0x5b7d52[_0xc8de('0x37')](_0x30489c);if(_0x36f18c){_0x1f9523=path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5,util[_0xc8de('0x1c')](_0xc8de('0x38'),_0xcc17a5,_0x505523,'pdf'));}else{_0x1f9523=path['join'](_0x1b581c,util['format'](_0xc8de('0x39'),_0xcc17a5,_0xc8de('0x3a')));}_0x3d0b5d['push'](writePDFDocument(_0x216411,_0x1f9523));}return Promise[_0xc8de('0x3b')](_0x3d0b5d);})[_0xc8de('0x2c')](function(){if(_0x36f18c){return new Promise(function(_0x3ea01b){zipdir(path['join'](_0x1b581c,_0xcc17a5),{'saveTo':path['join'](_0x1b581c,util[_0xc8de('0x1c')](_0xc8de('0x39'),_0xcc17a5,_0xc8de('0x3c')))},function(){rimraf(path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5),function(){});_0x3ea01b('zip\x20finished');});});}})[_0xc8de('0x2c')](function(){if(!_0x36f18c)return;rimraf(path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5),function(){});})[_0xc8de('0x2c')](function(){logger[_0xc8de('0x3d')](util[_0xc8de('0x1c')](_0xc8de('0x3e'),EXTRACTED_REPORT_ID,_0xc8de('0x3f')));return analyticExtractedReport('Completed',_0x36f18c?util[_0xc8de('0x1c')](_0xc8de('0x39'),_0xcc17a5,_0x36f18c?_0xc8de('0x3c'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc8de('0x3d')](util[_0xc8de('0x1c')](_0xc8de('0x40'),EXTRACTED_REPORT_ID,_0xc8de('0x3f')));return db[_0xc8de('0x41')][_0xc8de('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc8de('0x2c')](function(_0x1b9527){EXTRACTED_REPORT=_0x1b9527;return dbH['sequelize'][_0xc8de('0x30')](util[_0xc8de('0x1c')](_0xc8de('0x43'),QUERY),{'type':dbH[_0xc8de('0x2f')][_0xc8de('0x31')][_0xc8de('0x32')]});})['then'](extractReport)[_0xc8de('0x44')](function(_0x37dc1e){logger[_0xc8de('0x3d')](util[_0xc8de('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc8de('0x3f')),util[_0xc8de('0x45')](_0x37dc1e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xc8de('0x46')](function(){process[_0xc8de('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x337a1a=new PdfPrinter({'Arial':{'normal':__dirname+_0xc8de('0x48'),'bold':__dirname+_0xc8de('0x49'),'italics':__dirname+_0xc8de('0x4a'),'bolditalics':__dirname+_0xc8de('0x4b')}});return _0x337a1a;}function getPDFDocDefinitionFromHTML(_0x71a906,_0x1c4e5b){var _0x5f39bc=util[_0xc8de('0x1c')]('%s\x20#%d',_0x1c4e5b[_0xc8de('0x4c')],_0x1c4e5b['interactionId']);var _0x5d2ddf=moment()[_0xc8de('0x1c')](_0xc8de('0x4d'))[_0xc8de('0x13')]();var _0x5983af=htmlToPdfmake(_0x71a906,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5983af],'defaultStyle':{'font':_0xc8de('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc8de('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc8de('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc8de('0x4e')}},'header':function(){return[{'text':_0xc8de('0x4f'),'style':'header'}];},'footer':function(_0x224d21,_0x1ffc88){return[{'text':util[_0xc8de('0x1c')](_0xc8de('0x50'),_0x5f39bc,_0x224d21,_0x1ffc88,_0x5d2ddf),'style':'footer'}];}};}function writePDFDocument(_0x431688,_0x568780){return new Promise(function(_0x5480c0,_0x243642){var _0x17630f=_0x431688[_0xc8de('0x51')](fs['createWriteStream'](_0x568780));_0x17630f['on'](_0xc8de('0x52'),function(){_0x5480c0(_0xc8de('0x52'));});_0x17630f['on'](_0xc8de('0x53'),function(_0x3ffaa5){_0x243642(_0x3ffaa5);});_0x431688[_0xc8de('0x54')]();});}exports[_0xc8de('0x55')]=function(_0x86822b,_0x1bd92d){var _0x205993=getPDFPrinter();var _0x2d35fb=getPDFDocDefinitionFromHTML(_0x86822b,_0x1bd92d);var _0x1ed9de=_0x205993[_0xc8de('0x37')](_0x2d35fb);return writePDFDocument(_0x1ed9de,_0x1bd92d[_0xc8de('0x2')])[_0xc8de('0x44')](function(_0x3886f2){throw _0x3886f2;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 73e7d3a..6ec3fc7 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 _0x56a0=['dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0xd9b496,_0x43af24){var _0x37a013=function(_0x557497){while(--_0x557497){_0xd9b496['push'](_0xd9b496['shift']());}};_0x37a013(++_0x43af24);}(_0x56a0,0x101));var _0x056a=function(_0x27b7be,_0x538e2d){_0x27b7be=_0x27b7be-0x0;var _0x1aa77e=_0x56a0[_0x27b7be];return _0x1aa77e;};'use strict';var util=require(_0x056a('0x0'));var path=require(_0x056a('0x1'));var _=require(_0x056a('0x2'));var fs=require('fs');var json2xls=require(_0x056a('0x3'));var BPromise=require(_0x056a('0x4'));var zipdir=require(_0x056a('0x5'));var rimraf=require(_0x056a('0x6'));var db=require(_0x056a('0x7'))['db'];var dbH=require(_0x056a('0x7'))[_0x056a('0x8')];var logger=require(_0x056a('0x9'))(_0x056a('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x056a('0xb')][0x2]);var QUERY=process[_0x056a('0xb')][0x3];var PATH=process[_0x056a('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x54123d,_0x275bb3){var _0x2afa98={'status':_0x54123d};var _0x53ad18={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x275bb3){_0x2afa98['savename']=_0x275bb3;}return db[_0x056a('0xc')]['update'](_0x2afa98,_0x53ad18);}function main(){var _0x12c555=0x1388;var _0x5bd361;logger[_0x056a('0xd')](util[_0x056a('0xe')](_0x056a('0xf'),EXTRACTED_REPORT_ID,_0x056a('0x10')));return db[_0x056a('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x056a('0x12'),_0x056a('0x13')]})['then'](function(_0x42c45f){if(_0x42c45f){_0x5bd361=_0x42c45f;_0x12c555=_0x5bd361[_0x056a('0x13')]||0x1388;}})[_0x056a('0x14')](function(){return dbH['sequelize'][_0x056a('0x15')](util[_0x056a('0xe')](_0x056a('0x16'),QUERY),{'type':dbH['sequelize'][_0x056a('0x17')][_0x056a('0x18')]});})['then'](function(_0x4b80ed){if(!_0x4b80ed[0x0]['num']){return analyticExtractedReport(_0x056a('0x19'));}var _0x365b74=[];var _0x37a0ef=0x0;if(_0x5bd361[_0x056a('0x12')]){if(_0x4b80ed&&_0x4b80ed[_0x056a('0x1a')]){var _0x1918e8=_[_0x056a('0x1b')](_0x4b80ed[0x0]['num']/_0x12c555);var _0x1857c9=Number['isInteger'](_0x4b80ed[0x0][_0x056a('0x1c')]/_0x12c555)?_0x4b80ed[0x0][_0x056a('0x1c')]%_0x12c555:0x0;_0x1918e8['forEach'](function(_0x904ba5){if(_0x904ba5>0x0){_0x37a0ef+=_0x12c555;}_0x365b74[_0x056a('0x1d')](dbH[_0x056a('0x1e')][_0x056a('0x15')](util[_0x056a('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x12c555,_0x37a0ef),{'type':dbH[_0x056a('0x1e')][_0x056a('0x17')][_0x056a('0x18')]}));});if(_0x1857c9>0x0){_0x37a0ef+=_0x12c555;_0x365b74['push'](dbH[_0x056a('0x1e')][_0x056a('0x15')](util[_0x056a('0xe')](_0x056a('0x1f'),QUERY,_0x1857c9,_0x37a0ef),{'type':dbH[_0x056a('0x1e')]['QueryTypes'][_0x056a('0x18')]}));}}}else{_0x365b74[_0x056a('0x1d')](dbH[_0x056a('0x1e')][_0x056a('0x15')](QUERY,{'type':dbH[_0x056a('0x1e')][_0x056a('0x17')][_0x056a('0x18')]}));}var _0x348963=path[_0x056a('0x20')](PATH);var _0xa9faa9=path[_0x056a('0x21')](PATH,_0x056a('0x22'));var _0x1fb3e0=_0x5bd361['split']&&_0x365b74[_0x056a('0x1a')]>0x1;var _0x5cec17=[];if(!fs[_0x056a('0x23')](path[_0x056a('0x24')](_0x348963,_0xa9faa9))&&_0x1fb3e0){fs[_0x056a('0x25')](path[_0x056a('0x24')](_0x348963,_0xa9faa9));}return BPromise[_0x056a('0x26')](_0x365b74,function(_0x1e0c2f){_0x5cec17[_0x056a('0x1d')](_0x1e0c2f);})['then'](function(){for(var _0x574241=0x0;_0x574241<_0x5cec17[_0x056a('0x1a')];_0x574241+=0x1){var _0x5e31a5;var _0x444d47=_0x5cec17[_0x574241];if(_0x1fb3e0){_0x5e31a5=path[_0x056a('0x24')](_0x348963,_0xa9faa9,util[_0x056a('0xe')](_0x056a('0x27'),_0xa9faa9,_0x574241,_0x056a('0x28')));}else{_0x5e31a5=path[_0x056a('0x24')](_0x348963,util[_0x056a('0xe')](_0x056a('0x29'),_0xa9faa9,_0x056a('0x28')));}fs[_0x056a('0x2a')](_0x5e31a5,json2xls(_0x444d47),_0x056a('0x2b'));}})[_0x056a('0x14')](function(){if(_0x1fb3e0){return new Promise(function(_0x1d3bd8){zipdir(path[_0x056a('0x24')](_0x348963,_0xa9faa9),{'saveTo':path[_0x056a('0x24')](_0x348963,util[_0x056a('0xe')](_0x056a('0x29'),_0xa9faa9,_0x056a('0x2c')))},function(_0x2356ee,_0xc1eded){rimraf(path[_0x056a('0x24')](_0x348963,_0xa9faa9),function(){});_0x1d3bd8(_0x056a('0x2d'));});});}})['then'](function(){logger[_0x056a('0xd')](util[_0x056a('0xe')](_0x056a('0x2e'),EXTRACTED_REPORT_ID,_0x056a('0x10')));return analyticExtractedReport(_0x056a('0x2f'),_0x1fb3e0?util[_0x056a('0xe')](_0x056a('0x29'),_0xa9faa9,_0x1fb3e0?_0x056a('0x2c'):_0x056a('0x28')):null);});})[_0x056a('0x30')](function(_0x3f3a71){logger['info'](util[_0x056a('0xe')](_0x056a('0x31'),EXTRACTED_REPORT_ID,_0x056a('0x10')),util[_0x056a('0x32')](_0x3f3a71,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x056a('0x33'));})['finally'](function(){process[_0x056a('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb6fa=['util','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','XLSX','Setting','split','splitSizeXlsx','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','isInteger','forEach','query','QueryTypes','push','basename','.xlsx','existsSync','mkdirSync','join','each','length','xlsx','%s.%s','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','Failed','finally','exit'];(function(_0x5e99f1,_0x2b9658){var _0x24fcb3=function(_0x414fe8){while(--_0x414fe8){_0x5e99f1['push'](_0x5e99f1['shift']());}};_0x24fcb3(++_0x2b9658);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0xb6fa[_0x2c2980];return _0x2a20a9;};'use strict';var util=require(_0xab6f('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0xab6f('0x1'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xab6f('0x2'));var db=require(_0xab6f('0x3'))['db'];var dbH=require('../../mysqldb')[_0xab6f('0x4')];var logger=require(_0xab6f('0x5'))(_0xab6f('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xab6f('0x7')][0x2]);var QUERY=process[_0xab6f('0x7')][0x3];var PATH=process[_0xab6f('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x16b84e,_0x1b4da9){var _0x46b0f6={'status':_0x16b84e};var _0x85cb19={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b4da9){_0x46b0f6[_0xab6f('0x8')]=_0x1b4da9;}return db[_0xab6f('0x9')][_0xab6f('0xa')](_0x46b0f6,_0x85cb19);}function main(){var _0x67bfd1=0x1388;var _0x85d4c1;logger[_0xab6f('0xb')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xab6f('0xc')));return db[_0xab6f('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xab6f('0xe'),_0xab6f('0xf')]})[_0xab6f('0x10')](function(_0x437b32){if(_0x437b32){_0x85d4c1=_0x437b32;_0x67bfd1=_0x85d4c1[_0xab6f('0xf')]||0x1388;}})[_0xab6f('0x10')](function(){return dbH[_0xab6f('0x11')]['query'](util[_0xab6f('0x12')](_0xab6f('0x13'),QUERY),{'type':dbH[_0xab6f('0x11')]['QueryTypes'][_0xab6f('0x14')]});})['then'](function(_0x49d9f1){if(!_0x49d9f1[0x0][_0xab6f('0x15')]){return analyticExtractedReport('Empty');}var _0x422850=[];var _0x3653f0=0x0;if(_0x85d4c1[_0xab6f('0xe')]){if(_0x49d9f1&&_0x49d9f1['length']){var _0x255021=_['range'](_0x49d9f1[0x0][_0xab6f('0x15')]/_0x67bfd1);var _0x439b73=Number[_0xab6f('0x16')](_0x49d9f1[0x0][_0xab6f('0x15')]/_0x67bfd1)?_0x49d9f1[0x0][_0xab6f('0x15')]%_0x67bfd1:0x0;_0x255021[_0xab6f('0x17')](function(_0x455c20){if(_0x455c20>0x0){_0x3653f0+=_0x67bfd1;}_0x422850['push'](dbH[_0xab6f('0x11')][_0xab6f('0x18')](util[_0xab6f('0x12')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x67bfd1,_0x3653f0),{'type':dbH[_0xab6f('0x11')][_0xab6f('0x19')][_0xab6f('0x14')]}));});if(_0x439b73>0x0){_0x3653f0+=_0x67bfd1;_0x422850[_0xab6f('0x1a')](dbH[_0xab6f('0x11')][_0xab6f('0x18')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x439b73,_0x3653f0),{'type':dbH[_0xab6f('0x11')][_0xab6f('0x19')][_0xab6f('0x14')]}));}}}else{_0x422850[_0xab6f('0x1a')](dbH[_0xab6f('0x11')][_0xab6f('0x18')](QUERY,{'type':dbH[_0xab6f('0x11')]['QueryTypes'][_0xab6f('0x14')]}));}var _0xf849b5=path['dirname'](PATH);var _0x1f8db7=path[_0xab6f('0x1b')](PATH,_0xab6f('0x1c'));var _0x2e10a7=_0x85d4c1[_0xab6f('0xe')]&&_0x422850['length']>0x1;var _0x8d2357=[];if(!fs[_0xab6f('0x1d')](path['join'](_0xf849b5,_0x1f8db7))&&_0x2e10a7){fs[_0xab6f('0x1e')](path[_0xab6f('0x1f')](_0xf849b5,_0x1f8db7));}return BPromise[_0xab6f('0x20')](_0x422850,function(_0x2f8ebc){_0x8d2357[_0xab6f('0x1a')](_0x2f8ebc);})[_0xab6f('0x10')](function(){for(var _0x4952f9=0x0;_0x4952f9<_0x8d2357[_0xab6f('0x21')];_0x4952f9+=0x1){var _0x526d95;var _0x4ab3b2=_0x8d2357[_0x4952f9];if(_0x2e10a7){_0x526d95=path['join'](_0xf849b5,_0x1f8db7,util['format']('%s%d.%s',_0x1f8db7,_0x4952f9,_0xab6f('0x22')));}else{_0x526d95=path[_0xab6f('0x1f')](_0xf849b5,util[_0xab6f('0x12')](_0xab6f('0x23'),_0x1f8db7,_0xab6f('0x22')));}fs['writeFileSync'](_0x526d95,json2xls(_0x4ab3b2),_0xab6f('0x24'));}})[_0xab6f('0x10')](function(){if(_0x2e10a7){return new Promise(function(_0x86ed70){zipdir(path[_0xab6f('0x1f')](_0xf849b5,_0x1f8db7),{'saveTo':path[_0xab6f('0x1f')](_0xf849b5,util[_0xab6f('0x12')](_0xab6f('0x23'),_0x1f8db7,'zip'))},function(_0x19b056,_0xab5bb){rimraf(path[_0xab6f('0x1f')](_0xf849b5,_0x1f8db7),function(){});_0x86ed70('zip\x20finished');});});}})[_0xab6f('0x10')](function(){logger['info'](util[_0xab6f('0x12')](_0xab6f('0x25'),EXTRACTED_REPORT_ID,_0xab6f('0xc')));return analyticExtractedReport(_0xab6f('0x26'),_0x2e10a7?util[_0xab6f('0x12')](_0xab6f('0x23'),_0x1f8db7,_0x2e10a7?_0xab6f('0x27'):_0xab6f('0x22')):null);});})[_0xab6f('0x28')](function(_0x543750){logger[_0xab6f('0xb')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xab6f('0xc')),util[_0xab6f('0x29')](_0x543750,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xab6f('0x2a'));})[_0xab6f('0x2b')](function(){process[_0xab6f('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 2dae299..2da480b 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 _0x433d=['_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','findAll','intervals','models','then','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','hasOwnProperty','priority','extensions','extension','find','type','Set','format','CDR(type)=%s','context','inbound','push','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'];(function(_0x4c6014,_0x7ade65){var _0xbc8702=function(_0x295e97){while(--_0x295e97){_0x4c6014['push'](_0x4c6014['shift']());}};_0xbc8702(++_0x7ade65);}(_0x433d,0x159));var _0xd433=function(_0x44ae0b,_0x3e9865){_0x44ae0b=_0x44ae0b-0x0;var _0x69232a=_0x433d[_0x44ae0b];return _0x69232a;};'use strict';var _=require(_0xd433('0x0'));var util=require(_0xd433('0x1'));function rewrite(_0x3adb76,_0xe5faa6){var _0x11e9cf=this;return _0x3adb76['models']['Interval'][_0xd433('0x2')]({'raw':!![]})['then'](function(_0x733929){_0x11e9cf[_0xd433('0x3')]=_0x733929;return _0x3adb76[_0xd433('0x4')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0xe5faa6['IntervalId']},'raw':!![]});})[_0xd433('0x5')](function(_0xcdce0c){return _0x3adb76[_0xd433('0x4')][_0xd433('0x6')]['findAll']({'where':{'exten':{'$in':_[_0xd433('0x7')](_[_0xd433('0x8')](_0xcdce0c,'exten'))}},'order':[{'raw':_0xd433('0x9')}],'raw':!![]});})[_0xd433('0x5')](function(_0x57b9ce){var _0x1b36df=_[_0xd433('0xa')](_0x57b9ce,{'priority':'1'});var _0x3f135f=_[_0xd433('0xa')](_0x57b9ce,{'isApp':0x1});var _0x3337e1=_['groupBy'](_0x3f135f,_0xd433('0xb'));var _0x276163=[_0xd433('0xc'),'playback'];var _0x3efd0d=[];var _0x3467e9=[];for(var _0x4ecc97 in _0x3337e1){if(_0x3337e1[_0xd433('0xd')](_0x4ecc97)){_0x11e9cf[_0xd433('0xe')]=0x2;_0x11e9cf[_0xd433('0xf')]=[];_0x11e9cf[_0xd433('0x10')]=_[_0xd433('0x11')](_0x1b36df,{'exten':_0x3337e1[_0x4ecc97][0x0]['exten']});_0x11e9cf[_0xd433('0xf')]['push']({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':util[_0xd433('0x14')](_0xd433('0x15'),_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')]),'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf['priority']++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0]['VoiceExtensionId']});if(_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')]===_0xd433('0x17')){_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0]['type'],'app':'Set','appdata':_0xd433('0x19')+_0x3337e1[_0x4ecc97][0x0]['VoiceExtensionId'],'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf[_0xd433('0xe')]++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});}else if(_0x3337e1[_0x4ecc97][0x0]['type']===_0xd433('0x1b')){if(_0x11e9cf[_0xd433('0x10')]){_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':_0xd433('0x1c')+(_0x11e9cf[_0xd433('0x10')][_0xd433('0x1d')]?_0xd433('0x1e')+_0x11e9cf['extension'][_0xd433('0x1d')]+'}':_0xd433('0x1f')),'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf[_0xd433('0xe')]++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});}_0x11e9cf['extensions'][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':_0xd433('0x19')+_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')],'context':_0x3337e1[_0x4ecc97][0x0]['context'],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf['priority']++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});var _0x348b1e=_0x11e9cf[_0xd433('0xe')]++;_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x20'),'appdata':_0xd433('0x21')+(_0x348b1e+0x2)+_0xd433('0x22')+(_0x348b1e+0x1)+')','context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x348b1e,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});if(_0x11e9cf[_0xd433('0x10')]){_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0]['type'],'app':'Set','appdata':_0x11e9cf[_0xd433('0x10')][_0xd433('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x11e9cf[_0xd433('0x10')]['cutdigits']+'}':_0xd433('0x23'),'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0]['exten'],'priority':_0x11e9cf[_0xd433('0xe')]++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});}_0x11e9cf['extensions'][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':_0xd433('0x24')+_0x3337e1[_0x4ecc97][0x0]['VoiceExtensionId'],'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf['priority']++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});if(_0x11e9cf[_0xd433('0x10')]&&_0x11e9cf[_0xd433('0x10')]['hasOwnProperty'](_0xd433('0x25'))&&_0x11e9cf[_0xd433('0x10')][_0xd433('0x25')]!==_0xd433('0x26')){_0x11e9cf['extensions'][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':'Set','appdata':_0xd433('0x27'),'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf[_0xd433('0xe')]++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':_0xd433('0x28')+_0x11e9cf[_0xd433('0x10')][_0xd433('0x25')]||_0xd433('0x29'),'context':_0x3337e1[_0x4ecc97][0x0]['context'],'exten':_0x3337e1[_0x4ecc97][0x0]['exten'],'priority':_0x11e9cf['priority']++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});}}_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':_0xd433('0x2a'),'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf[_0xd433('0xe')]++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':_0xd433('0x2b'),'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf[_0xd433('0xe')]++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0]['type'],'app':'Set','appdata':_0xd433('0x2c'),'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'priority':_0x11e9cf[_0xd433('0xe')]++,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});for(var _0x861247=0x0,_0x5f077b=0x0;_0x861247<_0x3337e1[_0x4ecc97]['length'];_0x861247+=0x1,_0x5f077b=0x0){var _0x392a79=_0x3337e1[_0x4ecc97][_0x861247];if(_0x392a79[_0xd433('0x12')]){_0x392a79[_0xd433('0x12')]=_0x392a79[_0xd433('0x12')][_0xd433('0x2d')]();}var _0x1d9f16=[];var _0x1abaec=[];delete _0x392a79['id'];delete _0x392a79[_0xd433('0x2e')];delete _0x392a79[_0xd433('0x2f')];var _0x2d1fbe=_0x392a79[_0xd433('0x30')]!==_0xd433('0x31')?[_0x392a79[_0xd433('0x30')]]:_0x392a79[_0xd433('0x32')]?_[_0xd433('0x8')](_[_0xd433('0xa')](_0x11e9cf[_0xd433('0x3')],{'IntervalId':_0x392a79[_0xd433('0x32')]}),'interval'):[];if(_0x392a79['hasOwnProperty'](_0xd433('0x33'))){if(_0x392a79[_0xd433('0x33')]&&_0x392a79['tag']!=='--'){_0x1d9f16['push']({'type':_0x392a79[_0xd433('0x12')],'app':_0xd433('0x13'),'appdata':_0xd433('0x34')+_0x392a79[_0xd433('0x33')],'context':_0x392a79[_0xd433('0x16')],'exten':_0x392a79['exten'],'priority':_0x2d1fbe[_0xd433('0x35')]+_0x11e9cf[_0xd433('0xe')]+_0x5f077b++,'VoiceExtensionId':_0x392a79['VoiceExtensionId']});}}if(_0x392a79[_0xd433('0x12')]===_0xd433('0x1b')&&_0x392a79['hasOwnProperty'](_0xd433('0x36'))){if(_0x392a79[_0xd433('0x36')]){_0x1d9f16[_0xd433('0x18')]({'type':_0x392a79[_0xd433('0x12')],'app':_0xd433('0x20'),'appdata':_0xd433('0x37')+_0x392a79['callerID']+')','context':_0x392a79[_0xd433('0x16')],'exten':_0x392a79[_0xd433('0xb')],'priority':_0x2d1fbe[_0xd433('0x35')]+_0x11e9cf[_0xd433('0xe')]+_0x5f077b++,'VoiceExtensionId':_0x392a79['VoiceExtensionId']});}else{_0x1d9f16[_0xd433('0x18')]({'type':_0x392a79[_0xd433('0x12')],'app':_0xd433('0x20'),'appdata':_0xd433('0x38'),'context':_0x392a79[_0xd433('0x16')],'exten':_0x392a79['exten'],'priority':_0x2d1fbe[_0xd433('0x35')]+_0x11e9cf['priority']+_0x5f077b++,'VoiceExtensionId':_0x392a79[_0xd433('0x1a')]});}}if(_0x392a79[_0xd433('0xd')](_0xd433('0x39'))){if(_0x276163[_0xd433('0x3a')](_0x392a79[_0xd433('0x3b')][_0xd433('0x2d')]())>=0x0&&_0x392a79[_0xd433('0x3c')]!==_0xd433('0x3d')){if(_0x392a79[_0xd433('0x39')]){_0x1d9f16[_0xd433('0x18')]({'type':_0x392a79[_0xd433('0x12')],'app':_0xd433('0x20'),'appdata':_0xd433('0x3e'),'context':_0x392a79['context'],'exten':_0x392a79[_0xd433('0xb')],'priority':_0x2d1fbe[_0xd433('0x35')]+_0x11e9cf[_0xd433('0xe')]+_0x5f077b++,'VoiceExtensionId':_0x392a79[_0xd433('0x1a')]});_0x1d9f16[_0xd433('0x18')]({'type':_0x392a79[_0xd433('0x12')],'app':'Set','appdata':_0xd433('0x3f'),'context':_0x392a79['context'],'exten':_0x392a79[_0xd433('0xb')],'priority':_0x2d1fbe['length']+_0x11e9cf[_0xd433('0xe')]+_0x5f077b++,'VoiceExtensionId':_0x392a79[_0xd433('0x1a')]});}else{_0x1d9f16[_0xd433('0x18')]({'type':_0x392a79['type'],'app':_0xd433('0x20'),'appdata':_0xd433('0x40'),'context':_0x392a79[_0xd433('0x16')],'exten':_0x392a79[_0xd433('0xb')],'priority':_0x2d1fbe['length']+_0x11e9cf[_0xd433('0xe')]+_0x5f077b++,'VoiceExtensionId':_0x392a79['VoiceExtensionId']});_0x1d9f16[_0xd433('0x18')]({'type':_0x392a79['type'],'app':_0xd433('0x13'),'appdata':_0xd433('0x41'),'context':_0x392a79[_0xd433('0x16')],'exten':_0x392a79[_0xd433('0xb')],'priority':_0x2d1fbe[_0xd433('0x35')]+_0x11e9cf[_0xd433('0xe')]+_0x5f077b++,'VoiceExtensionId':_0x392a79[_0xd433('0x1a')]});}}}for(var _0x291d5b=0x0;_0x291d5b<_0x2d1fbe[_0xd433('0x35')];_0x291d5b+=0x1){var _0x3d0ea4=_0x11e9cf[_0xd433('0xe')]+_0x2d1fbe[_0xd433('0x35')];var _0x28ae85=_0x291d5b===_0x2d1fbe['length']-0x1?_0x11e9cf['priority']+_0x1d9f16['length']+_0x1abaec['length']+0x2:_0x11e9cf['priority']+_0x291d5b+0x1;_0x1d9f16[_0xd433('0x42')](_0x291d5b,0x0,{'type':_0x392a79[_0xd433('0x12')],'app':_0xd433('0x43'),'appdata':_0x2d1fbe[_0x291d5b]+'?'+_0x392a79[_0xd433('0x16')]+_0xd433('0x44')+_0x3d0ea4+':'+_0x392a79[_0xd433('0x16')]+_0xd433('0x44')+_0x28ae85,'exten':_0x392a79['exten'],'context':_0x392a79[_0xd433('0x16')],'priority':_0x11e9cf[_0xd433('0xe')]+_0x291d5b,'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});}_0x392a79[_0xd433('0xe')]=_0x1d9f16[_0xd433('0x35')]?_[_0xd433('0x45')](_0x1d9f16)[_0xd433('0xe')]+0x1:_0x11e9cf['priority'];_0x11e9cf[_0xd433('0xe')]=(_0x1abaec['length']?_[_0xd433('0x45')](_0x1abaec)[_0xd433('0xe')]:_0x392a79[_0xd433('0xe')])+0x1;_0x11e9cf[_0xd433('0xf')]=_[_0xd433('0x46')](_0x11e9cf[_0xd433('0xf')],_0x1d9f16,[_0x392a79],_0x1abaec);}_0x11e9cf[_0xd433('0xf')][_0xd433('0x18')]({'type':_0x3337e1[_0x4ecc97][0x0]['type'],'app':_0xd433('0x47'),'exten':_0x3337e1[_0x4ecc97][0x0][_0xd433('0xb')],'context':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x16')],'priority':_0x11e9cf[_0xd433('0xe')],'VoiceExtensionId':_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]});_0x3efd0d['push'](_0x3337e1[_0x4ecc97][0x0][_0xd433('0x1a')]);_0x3467e9=_[_0xd433('0x46')](_0x3467e9,_0x11e9cf[_0xd433('0xf')]);}}return _0x3adb76['transaction'](function(_0x2647ae){return _0x3adb76[_0xd433('0x4')][_0xd433('0x6')][_0xd433('0x48')]({'where':{'VoiceExtensionId':{'$in':_0x3efd0d}},'transaction':_0x2647ae})[_0xd433('0x5')](function(_0x51595a){return _0x3adb76['models']['VoiceExtension'][_0xd433('0x49')](_[_0xd433('0x4a')](_0x3467e9,_0xd433('0xe')),{'transaction':_0x2647ae});});});})['catch'](function(_0x9b8cb3){console[_0xd433('0x4b')](_0x9b8cb3);});}exports[_0xd433('0x4c')]=rewrite; \ No newline at end of file +var _0x7b98=['outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','IntervalId','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','filter','queue','playback','hasOwnProperty','extension','find','extensions','type','Set','format','CDR(type)=%s','context','priority','push','CDR(routeid)=','VoiceExtensionId','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix'];(function(_0x45495a,_0x353d64){var _0xf6fb7c=function(_0x499820){while(--_0x499820){_0x45495a['push'](_0x45495a['shift']());}};_0xf6fb7c(++_0x353d64);}(_0x7b98,0x1cf));var _0x87b9=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x7b98[_0x4695ba];return _0x524b7d;};'use strict';var _=require(_0x87b9('0x0'));var util=require(_0x87b9('0x1'));function rewrite(_0x91c21,_0x5e74ed){var _0x230ec1=this;return _0x91c21[_0x87b9('0x2')][_0x87b9('0x3')][_0x87b9('0x4')]({'raw':!![]})[_0x87b9('0x5')](function(_0x2af842){_0x230ec1['intervals']=_0x2af842;return _0x91c21[_0x87b9('0x2')][_0x87b9('0x6')][_0x87b9('0x4')]({'where':{'IntervalId':_0x5e74ed['IntervalId']},'raw':!![]});})[_0x87b9('0x5')](function(_0x2c9c22){return _0x91c21[_0x87b9('0x2')]['VoiceExtension'][_0x87b9('0x4')]({'where':{'exten':{'$in':_[_0x87b9('0x7')](_[_0x87b9('0x8')](_0x2c9c22,_0x87b9('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x87b9('0x5')](function(_0x362526){var _0x400a62=_[_0x87b9('0xa')](_0x362526,{'priority':'1'});var _0x300243=_[_0x87b9('0xa')](_0x362526,{'isApp':0x1});var _0x2c2b48=_['groupBy'](_0x300243,_0x87b9('0x9'));var _0x3c6af7=[_0x87b9('0xb'),_0x87b9('0xc')];var _0x580b94=[];var _0x47afe7=[];for(var _0x136bf1 in _0x2c2b48){if(_0x2c2b48[_0x87b9('0xd')](_0x136bf1)){_0x230ec1['priority']=0x2;_0x230ec1['extensions']=[];_0x230ec1[_0x87b9('0xe')]=_[_0x87b9('0xf')](_0x400a62,{'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')]});_0x230ec1[_0x87b9('0x10')]['push']({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':util[_0x87b9('0x13')](_0x87b9('0x14'),_0x2c2b48[_0x136bf1][0x0]['type']),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});if(_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')]==='inbound'){_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x18')+_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}else if(_0x2c2b48[_0x136bf1][0x0]['type']===_0x87b9('0x1a')){if(_0x230ec1[_0x87b9('0xe')]){_0x230ec1['extensions']['push']({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':'CDR(destination)='+(_0x230ec1[_0x87b9('0xe')][_0x87b9('0x1b')]?_0x87b9('0x1c')+_0x230ec1[_0x87b9('0xe')]['cutdigits']+'}':_0x87b9('0x1d')),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1['priority']++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x18')+_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId'],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1['priority']++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});var _0x1d6464=_0x230ec1[_0x87b9('0x16')]++;_0x230ec1['extensions'][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x1e'),'appdata':_0x87b9('0x1f')+(_0x1d6464+0x2)+'):Goto('+(_0x1d6464+0x1)+')','context':_0x2c2b48[_0x136bf1][0x0]['context'],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x1d6464,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});if(_0x230ec1[_0x87b9('0xe')]){_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x230ec1[_0x87b9('0xe')]['cutdigits']?_0x87b9('0x20')+_0x230ec1[_0x87b9('0xe')][_0x87b9('0x1b')]+'}':_0x87b9('0x21'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1['priority']++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':'Set','appdata':_0x87b9('0x22')+_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});if(_0x230ec1[_0x87b9('0xe')]&&_0x230ec1[_0x87b9('0xe')][_0x87b9('0xd')](_0x87b9('0x23'))&&_0x230ec1[_0x87b9('0xe')][_0x87b9('0x23')]!==_0x87b9('0x24')){_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x25'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x230ec1[_0x87b9('0x10')]['push']({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x26')+_0x230ec1[_0x87b9('0xe')]['recordingFormat']||_0x87b9('0x27'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});}}_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':'Set','appdata':_0x87b9('0x28'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0]['exten'],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x29'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x2a'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0]['exten'],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});for(var _0x4a3e2f=0x0,_0x2668ba=0x0;_0x4a3e2f<_0x2c2b48[_0x136bf1][_0x87b9('0x2b')];_0x4a3e2f+=0x1,_0x2668ba=0x0){var _0x3535c2=_0x2c2b48[_0x136bf1][_0x4a3e2f];if(_0x3535c2[_0x87b9('0x11')]){_0x3535c2[_0x87b9('0x11')]=_0x3535c2['type'][_0x87b9('0x2c')]();}var _0x2044ba=[];var _0x39ee9f=[];delete _0x3535c2['id'];delete _0x3535c2['createdAt'];delete _0x3535c2[_0x87b9('0x2d')];var _0x29d07b=_0x3535c2[_0x87b9('0x2e')]!=='*,*,*,*'?[_0x3535c2['interval']]:_0x3535c2[_0x87b9('0x2f')]?_[_0x87b9('0x8')](_['filter'](_0x230ec1[_0x87b9('0x30')],{'IntervalId':_0x3535c2[_0x87b9('0x2f')]}),'interval'):[];if(_0x3535c2[_0x87b9('0xd')](_0x87b9('0x31'))){if(_0x3535c2['tag']&&_0x3535c2[_0x87b9('0x31')]!=='--'){_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':'Set','appdata':_0x87b9('0x32')+_0x3535c2[_0x87b9('0x31')],'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b['length']+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2[_0x87b9('0x19')]});}}if(_0x3535c2[_0x87b9('0x11')]==='outbound'&&_0x3535c2['hasOwnProperty'](_0x87b9('0x33'))){if(_0x3535c2[_0x87b9('0x33')]){_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x1e'),'appdata':_0x87b9('0x34')+_0x3535c2['callerID']+')','context':_0x3535c2[_0x87b9('0x15')],'exten':_0x3535c2['exten'],'priority':_0x29d07b['length']+_0x230ec1['priority']+_0x2668ba++,'VoiceExtensionId':_0x3535c2[_0x87b9('0x19')]});}else{_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2['type'],'app':_0x87b9('0x1e'),'appdata':_0x87b9('0x35'),'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});}}if(_0x3535c2[_0x87b9('0xd')](_0x87b9('0x36'))){if(_0x3c6af7['indexOf'](_0x3535c2['app']['toLowerCase']())>=0x0&&_0x3535c2[_0x87b9('0x37')]!=='custom'){if(_0x3535c2[_0x87b9('0x36')]){_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':'ExecIf','appdata':_0x87b9('0x38'),'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b['length']+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x39'),'context':_0x3535c2['context'],'exten':_0x3535c2[_0x87b9('0x9')],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});}else{_0x2044ba['push']({'type':_0x3535c2['type'],'app':'ExecIf','appdata':_0x87b9('0x3a'),'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x3b'),'context':_0x3535c2['context'],'exten':_0x3535c2[_0x87b9('0x9')],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});}}}for(var _0x189731=0x0;_0x189731<_0x29d07b[_0x87b9('0x2b')];_0x189731+=0x1){var _0x1226ca=_0x230ec1[_0x87b9('0x16')]+_0x29d07b[_0x87b9('0x2b')];var _0x585613=_0x189731===_0x29d07b['length']-0x1?_0x230ec1[_0x87b9('0x16')]+_0x2044ba[_0x87b9('0x2b')]+_0x39ee9f[_0x87b9('0x2b')]+0x2:_0x230ec1[_0x87b9('0x16')]+_0x189731+0x1;_0x2044ba['splice'](_0x189731,0x0,{'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x3c'),'appdata':_0x29d07b[_0x189731]+'?'+_0x3535c2['context']+',${EXTEN},'+_0x1226ca+':'+_0x3535c2[_0x87b9('0x15')]+_0x87b9('0x3d')+_0x585613,'exten':_0x3535c2[_0x87b9('0x9')],'context':_0x3535c2['context'],'priority':_0x230ec1[_0x87b9('0x16')]+_0x189731,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}_0x3535c2['priority']=_0x2044ba[_0x87b9('0x2b')]?_[_0x87b9('0x3e')](_0x2044ba)['priority']+0x1:_0x230ec1[_0x87b9('0x16')];_0x230ec1[_0x87b9('0x16')]=(_0x39ee9f['length']?_[_0x87b9('0x3e')](_0x39ee9f)[_0x87b9('0x16')]:_0x3535c2['priority'])+0x1;_0x230ec1[_0x87b9('0x10')]=_[_0x87b9('0x3f')](_0x230ec1[_0x87b9('0x10')],_0x2044ba,[_0x3535c2],_0x39ee9f);}_0x230ec1['extensions']['push']({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x40'),'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'priority':_0x230ec1[_0x87b9('0x16')],'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x580b94[_0x87b9('0x17')](_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]);_0x47afe7=_['concat'](_0x47afe7,_0x230ec1[_0x87b9('0x10')]);}}return _0x91c21[_0x87b9('0x41')](function(_0x3dff73){return _0x91c21['models']['VoiceExtension'][_0x87b9('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x580b94}},'transaction':_0x3dff73})['then'](function(_0x151c98){return _0x91c21[_0x87b9('0x2')][_0x87b9('0x6')]['bulkCreate'](_[_0x87b9('0x43')](_0x47afe7,_0x87b9('0x16')),{'transaction':_0x3dff73});});});})[_0x87b9('0x44')](function(_0x5b6a60){console[_0x87b9('0x45')](_0x5b6a60);});}exports[_0x87b9('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 4029ed3..9c361d6 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 _0x85e7=['info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','into','cm_hopper','scheduledAt','createdAt','updatedAt','field','NOW()','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','toString','fromQuery','ContactId','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT'];(function(_0x1212f1,_0x406359){var _0x23ed52=function(_0x190d5f){while(--_0x190d5f){_0x1212f1['push'](_0x1212f1['shift']());}};_0x23ed52(++_0x406359);}(_0x85e7,0x79));var _0x785e=function(_0x512e30,_0x303109){_0x512e30=_0x512e30-0x0;var _0x5bf5c7=_0x85e7[_0x512e30];return _0x5bf5c7;};'use strict';var BPromise=require(_0x785e('0x0'));var util=require(_0x785e('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x785e('0x2'));var Papa=require(_0x785e('0x3'));var Redis=require('ioredis');var db=require(_0x785e('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x785e('0x5'))(_0x785e('0x6'));config[_0x785e('0x7')]=_[_0x785e('0x8')](config[_0x785e('0x7')],{'host':_0x785e('0x9'),'port':0x18eb});var socket=require(_0x785e('0xa'))(new Redis(config[_0x785e('0x7')]));require(_0x785e('0xb'))[_0x785e('0xc')](socket);try{if(!process[_0x785e('0xd')][0x2]||process['argv'][0x2]===_0x785e('0xe')||process[_0x785e('0xd')][0x2]===_0x785e('0xf')){throw new Error(_0x785e('0x10'));}var FILEPATH=process[_0x785e('0xd')][0x2];if(!process['argv'][0x3]||process[_0x785e('0xd')][0x3]==='undefined'||process[_0x785e('0xd')][0x3]===_0x785e('0xf')||!process[_0x785e('0xd')][0x4]||process['argv'][0x4]===_0x785e('0xe')||process[_0x785e('0xd')][0x4]==='null'){throw new Error(_0x785e('0x11'));}var FIELDS=_[_0x785e('0x12')](process['argv'][0x3]['split'](','),process[_0x785e('0xd')][0x4][_0x785e('0x13')](','));if(!process[_0x785e('0xd')][0x5]||process[_0x785e('0xd')][0x5]==='undefined'||process[_0x785e('0xd')][0x5]==='null'){throw new Error(_0x785e('0x14'));}var LISTID=process[_0x785e('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x785e('0xd')][0x6]!=='undefined'&&process[_0x785e('0xd')][0x6]!==_0x785e('0xf')?process[_0x785e('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x785e('0xd')][0x7]!==_0x785e('0xe')&&process[_0x785e('0xd')][0x7]!==_0x785e('0xf')?process[_0x785e('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x785e('0xd')][0x8]===_0x785e('0xe')||process[_0x785e('0xd')][0x8]===_0x785e('0xf')){throw new Error(_0x785e('0x15'));}var SOCKET_TIMESTAMP=process[_0x785e('0xd')][0x8];}catch(_0x57dda1){logger[_0x785e('0x16')](_0x57dda1);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(_0x4bed87,_0x421a41,_0x360d0e,_0x1674c1){var _0x4ab14a={'message':_0x421a41};_0x4ab14a[_0x4bed87]=!![];if(_0x360d0e){_0x4ab14a['contact']=_0x360d0e;}if(_0x1674c1){_0x4ab14a[_0x785e('0x17')]=_0x1674c1;}return _0x4ab14a;}function isEmail(_0x265ab7){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))*$/[_0x785e('0x18')](_0x265ab7);}function checkRow(_0x77fc7b,_0x5bed0d,_0x55601f){return new BPromise(function(_0xae2481,_0x50cae7){if(_[_0x785e('0x19')](_0x77fc7b)){return _0x50cae7(handleCheckRowError(_0x785e('0x16'),_0x785e('0x1a'),null,_0x55601f));}if(_0x77fc7b['errors']&&_0x77fc7b['errors'][_0x785e('0x1b')]){var _0x2100e6=_[_0x785e('0x1c')](_0x77fc7b['errors'],_0x785e('0x1d'))[_0x785e('0x1e')](';');return _0x50cae7(handleCheckRowError(_0x785e('0x16'),_0x2100e6,null,_0x55601f));}var _0x3dad3c={};for(var _0x3a2dad in FIELDS){if(FIELDS['hasOwnProperty'](_0x3a2dad)&&FIELDS[_0x3a2dad]){_0x3dad3c[_0x3a2dad]=_0x77fc7b[_0x785e('0x1f')][0x0][FIELDS[_0x3a2dad]]||_0x77fc7b[_0x785e('0x1f')][0x0]['\ufeff'+FIELDS[_0x3a2dad]];}}if(!_0x3dad3c[_0x785e('0x20')]){return _0x50cae7(handleCheckRowError(_0x785e('0x16'),_0x785e('0x21'),null,_0x55601f));}if(!_0x3dad3c[_0x785e('0x22')]){return _0x50cae7(handleCheckRowError(_0x785e('0x16'),'phone\x20not\x20specified!',null,_0x55601f));}if(_0x3dad3c['birthDate']){var _0x149dfa=moment(_0x3dad3c[_0x785e('0x23')],_0x785e('0x24'));if(!_0x149dfa[_0x785e('0x25')]()){return _0x50cae7(handleCheckRowError(_0x785e('0x16'),_0x785e('0x26'),null,_0x55601f));}}if(_0x3dad3c[_0x785e('0x27')]){if(!isEmail(_0x3dad3c['email'])){return _0x50cae7(handleCheckRowError(_0x785e('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x55601f));}}_0x3dad3c[_0x785e('0x28')]=LISTID;_0x3dad3c[_0x785e('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x785e('0x1b')]&&_0x5bed0d){var _0x16e4ca={};for(var _0x2b30d1=0x0,_0x44441d=DUPLICATES[_0x785e('0x1b')];_0x2b30d1<_0x44441d;_0x2b30d1+=0x1){_0x16e4ca[DUPLICATES[_0x2b30d1]]=_0x3dad3c[DUPLICATES[_0x2b30d1]];}var _0xea1fc6=_[_0x785e('0x2a')](_0x5bed0d,_0x16e4ca);if(_0xea1fc6){return _0x50cae7(handleCheckRowError(_0x785e('0x2b'),_0x785e('0x2c'),_0xea1fc6,_0x55601f));}}return db['CmContact'][_0x785e('0x2d')](_0x3dad3c,{'raw':!![],'hooks':![],'fields':_[_0x785e('0x2e')](_0x3dad3c)})[_0x785e('0x2f')](function(_0x520352){if(DUPLICATES&&DUPLICATES[_0x785e('0x1b')]&&_0x5bed0d){_0x5bed0d[_0x785e('0x30')](_[_0x785e('0x31')](_0x3dad3c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x520352['id'];return _0xae2481();})[_0x785e('0x32')](function(_0x26760f){return _0x50cae7(handleCheckRowError('error',_0x785e('0x33')+(_0x26760f[_0x785e('0x1d')]||JSON[_0x785e('0x34')](_0x26760f)),null,_0x55601f));});});}function checkHopper(){function _0x50fe19(){return function(_0x39d1df){logger['error'](_0x785e('0x35'),_0x785e('0x36'),util['inspect'](_0x39d1df,{'showHidden':![],'depth':null}));};}var _0x2b455f=function(_0x2f6ce0,_0x30b637){var _0xd0816e=squel[_0x785e('0x37')]()[_0x785e('0x38')](_0x785e('0x39'))['fromQuery']([_0x785e('0x22'),_0x785e('0x3a'),'ContactId',_0x785e('0x28'),_0x30b637,_0x785e('0x3b'),_0x785e('0x3c')],squel['select']()[_0x785e('0x3d')](_0x785e('0x22'),'phone')[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3a'))['field']('id','ContactId')['field'](LISTID['toString'](),_0x785e('0x28'))[_0x785e('0x3d')](_0x2f6ce0['id']['toString'](),_0x30b637)[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3b'))[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3c'))['from']('cm_contacts')[_0x785e('0x3f')](_0x785e('0x40'))['where'](_0x785e('0x41'),LISTID['toString']())[_0x785e('0x3f')](_0x785e('0x42'))[_0x785e('0x3f')](_0x785e('0x43'),squel[_0x785e('0x44')]()[_0x785e('0x3d')](_0x785e('0x22'))[_0x785e('0x45')](_0x785e('0x39'))[_0x785e('0x3f')](_0x30b637+_0x785e('0x46'),_0x2f6ce0['id'][_0x785e('0x47')]())))['toString']();return _0xd0816e;};var _0x3a5873=function(_0x3b3e9d,_0x5b0f8b){var _0xa967d4=squel[_0x785e('0x37')]()[_0x785e('0x38')]('cm_hopper')[_0x785e('0x48')]([_0x785e('0x22'),_0x785e('0x3a'),_0x785e('0x49'),_0x785e('0x28'),_0x5b0f8b,_0x785e('0x3b'),_0x785e('0x3c')],squel['select']()[_0x785e('0x3d')](_0x785e('0x22'),_0x785e('0x22'))[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3a'))[_0x785e('0x3d')]('id',_0x785e('0x49'))[_0x785e('0x3d')](LISTID[_0x785e('0x47')](),'ListId')[_0x785e('0x3d')](_0x3b3e9d['id'][_0x785e('0x47')](),_0x5b0f8b)[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3b'))['field'](_0x785e('0x3e'),_0x785e('0x3c'))[_0x785e('0x45')](_0x785e('0x4a'))[_0x785e('0x3f')]('deletedAt\x20IS\x20NULL')[_0x785e('0x3f')](_0x785e('0x41'),LISTID[_0x785e('0x47')]())[_0x785e('0x3f')](_0x785e('0x4b'),squel[_0x785e('0x4c')](hopperContacts))[_0x785e('0x3f')](_0x785e('0x42'))[_0x785e('0x3f')](_0x785e('0x43'),squel[_0x785e('0x44')]()[_0x785e('0x3d')](_0x785e('0x4d'))[_0x785e('0x45')](_0x785e('0x4e'))[_0x785e('0x3f')](_0x5b0f8b+_0x785e('0x46'),_0x3b3e9d['id']['toString']()))[_0x785e('0x3f')](_0x785e('0x43'),squel['select']()[_0x785e('0x3d')](_0x785e('0x22'))['from']('cm_hopper')['where'](_0x5b0f8b+_0x785e('0x46'),_0x3b3e9d['id'][_0x785e('0x47')]())))['toString']();return _0xa967d4;};function _0x568e4d(_0x5d170d,_0x4859a9){var _0x28ca01=squel['insert']()['into'](_0x785e('0x39'))[_0x785e('0x48')]([_0x785e('0x22'),_0x785e('0x3a'),'ContactId','ListId',_0x4859a9,'createdAt',_0x785e('0x3c')],squel[_0x785e('0x44')]()[_0x785e('0x3d')](_0x785e('0x22'),_0x785e('0x22'))[_0x785e('0x3d')]('NOW()',_0x785e('0x3a'))['field']('id',_0x785e('0x49'))['field'](LISTID[_0x785e('0x47')](),'ListId')[_0x785e('0x3d')](_0x5d170d['id']['toString'](),_0x4859a9)[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3b'))[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3c'))['from']('cm_contacts')[_0x785e('0x3f')](_0x785e('0x40'))[_0x785e('0x3f')](_0x785e('0x41'),LISTID[_0x785e('0x47')]())[_0x785e('0x3f')](_0x785e('0x4b'),squel[_0x785e('0x4c')](hopperContacts))[_0x785e('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x28ca01;}function _0x4e423d(_0x4e272d,_0x2f148f){var _0x4e654c=squel[_0x785e('0x37')]()[_0x785e('0x38')](_0x785e('0x4f'))['fromQuery'](['phone','ContactId',_0x785e('0x28'),_0x2f148f,_0x785e('0x3b'),'updatedAt'],squel[_0x785e('0x44')]()[_0x785e('0x3d')](_0x785e('0x22'),_0x785e('0x22'))['field']('id','ContactId')[_0x785e('0x3d')](LISTID[_0x785e('0x47')](),_0x785e('0x28'))['field'](_0x4e272d['id'][_0x785e('0x47')](),_0x2f148f)[_0x785e('0x3d')](_0x785e('0x3e'),_0x785e('0x3b'))[_0x785e('0x3d')]('NOW()',_0x785e('0x3c'))[_0x785e('0x45')](_0x785e('0x4a'))[_0x785e('0x3f')]('deletedAt\x20IS\x20NULL')[_0x785e('0x3f')]('ListId\x20=\x20?',LISTID['toString']())[_0x785e('0x3f')](_0x785e('0x4b'),squel[_0x785e('0x4c')](hopperContacts))['where'](_0x785e('0x42')))[_0x785e('0x47')]();return _0x4e654c;}return db[_0x785e('0x50')][_0x785e('0x51')]({'where':{'type':_0x785e('0x52')},'attributes':['id',_0x785e('0x53')],'include':[{'model':db[_0x785e('0x54')],'as':_0x785e('0x55'),'where':{'id':LISTID}}]})[_0x785e('0x2f')](function(_0x196ea5){var _0x4e00da=[];if(_0x196ea5){var _0x40af6c;for(var _0x3f1c7a=0x0,_0xa6e50c;_0x3f1c7a<_0x196ea5['length'];_0x3f1c7a+=0x1){_0xa6e50c=_0x196ea5[_0x3f1c7a]['get']({'plain':!![]});switch(_0xa6e50c[_0x785e('0x53')]){case _0x785e('0x56'):_0x4e00da[_0x785e('0x30')](db[_0x785e('0x57')]['query'](_0x3a5873(_0xa6e50c,_0x785e('0x58')))['then'](function(){})[_0x785e('0x32')](_0x50fe19()));break;case _0x785e('0x59'):_0x4e00da[_0x785e('0x30')](db[_0x785e('0x57')][_0x785e('0x5a')](_0x2b455f(_0xa6e50c,'VoiceQueueId'))[_0x785e('0x2f')](function(){})[_0x785e('0x32')](_0x50fe19()));break;default:_0x4e00da[_0x785e('0x30')](db[_0x785e('0x57')]['query'](_0x568e4d(_0xa6e50c,_0x785e('0x58')))[_0x785e('0x2f')](function(){})[_0x785e('0x32')](_0x50fe19()));}}}return _0x4e00da;})[_0x785e('0x5b')]()[_0x785e('0x2f')](function(){return db[_0x785e('0x50')]['findAll']({'where':{'type':_0x785e('0x52')},'attributes':['id'],'include':[{'model':db[_0x785e('0x54')],'as':_0x785e('0x5c'),'where':{'id':LISTID}}]})[_0x785e('0x2f')](function(_0x320fe2){var _0x277ee6=[];if(_0x320fe2){var _0x5b22c1;for(var _0xabd9ec=0x0,_0x5717d1;_0xabd9ec<_0x320fe2[_0x785e('0x1b')];_0xabd9ec+=0x1){_0x5717d1=_0x320fe2[_0xabd9ec][_0x785e('0x5d')]({'plain':!![]});_0x277ee6[_0x785e('0x30')](db[_0x785e('0x57')][_0x785e('0x5a')](_0x4e423d(_0x5717d1,_0x785e('0x58')))[_0x785e('0x2f')](function(){})[_0x785e('0x32')](_0x50fe19()));}}return _0x277ee6;})[_0x785e('0x5b')]();})['then'](function(){return db[_0x785e('0x5e')][_0x785e('0x51')]({'attributes':['id',_0x785e('0x53')],'include':[{'model':db[_0x785e('0x54')],'as':_0x785e('0x55'),'where':{'id':LISTID}}]})[_0x785e('0x2f')](function(_0x57615e){var _0x48f0a0=[];if(_0x57615e){for(var _0x33009c=0x0,_0xb4e295;_0x33009c<_0x57615e[_0x785e('0x1b')];_0x33009c+=0x1){_0xb4e295=_0x57615e[_0x33009c][_0x785e('0x5d')]({'plain':!![]});switch(_0xb4e295[_0x785e('0x53')]){case _0x785e('0x56'):_0x48f0a0['push'](db[_0x785e('0x57')][_0x785e('0x5a')](_0x3a5873(_0xb4e295,_0x785e('0x5f')))[_0x785e('0x2f')](function(){})[_0x785e('0x32')](_0x50fe19()));break;case _0x785e('0x59'):_0x48f0a0[_0x785e('0x30')](db[_0x785e('0x57')][_0x785e('0x5a')](_0x2b455f(_0xb4e295,'CampaignId'))['then'](function(){})['catch'](_0x50fe19()));break;default:_0x48f0a0[_0x785e('0x30')](db[_0x785e('0x57')][_0x785e('0x5a')](_0x568e4d(_0xb4e295,_0x785e('0x5f')))['then'](function(){})[_0x785e('0x32')](_0x50fe19()));}}}return _0x48f0a0;})[_0x785e('0x5b')]();})['then'](function(){return db[_0x785e('0x5e')][_0x785e('0x51')]({'attributes':['id'],'include':[{'model':db[_0x785e('0x54')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x785e('0x2f')](function(_0x3139dc){var _0xb7824b=[];if(_0x3139dc){for(var _0x1c8940=0x0,_0x11c541;_0x1c8940<_0x3139dc[_0x785e('0x1b')];_0x1c8940+=0x1){_0x11c541=_0x3139dc[_0x1c8940][_0x785e('0x5d')]({'plain':!![]});_0xb7824b[_0x785e('0x30')](db[_0x785e('0x57')]['query'](_0x4e423d(_0x11c541,_0x785e('0x5f')))[_0x785e('0x2f')](function(){})[_0x785e('0x32')](_0x50fe19()));}}return _0xb7824b;})['all']();})[_0x785e('0x32')](function(_0x222e3f){logger['error'](_0x785e('0x60'),_0x785e('0x61'),_0x222e3f['message']);});}var processPromises=function(_0x58a98f){return BPromise[_0x785e('0x5b')](promises)[_0x785e('0x2f')](function(_0x170bd2){})['catch'](function(_0x5fcb89){logger[_0x785e('0x16')](_0x785e('0x62'),JSON[_0x785e('0x34')](_0x5fcb89));})[_0x785e('0x63')](function(){socket[_0x785e('0x64')](_0x785e('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x58a98f){return _0x58a98f[_0x785e('0x66')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x785e('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x785e('0x2f')](function(){socket[_0x785e('0x64')](_0x785e('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x785e('0x67')](FILEPATH);}catch(_0x27a4b3){logger[_0x785e('0x16')](_0x785e('0x68'),JSON[_0x785e('0x34')](_0x27a4b3));}finally{process[_0x785e('0x69')](0x0);}});};process['on'](_0x785e('0x6a'),function(){logger[_0x785e('0x6b')](_0x785e('0x6c'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0x785e('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x785e('0x2f')](function(_0xbd9add){var _0x43168b=fs[_0x785e('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x785e('0x6e')](_0x43168b,{'header':!![],'skipEmptyLines':!![],'step':function(_0xe813c2,_0x1790c9){total+=0x1;var _0x4d2888=total;promises['push'](checkRow(_0xe813c2,_0xbd9add,_0x4d2888)[_0x785e('0x2f')](function(){success+=0x1;})[_0x785e('0x32')](function(_0x2c37e3){if(_0x2c37e3['error']){errors+=0x1;delete _0x2c37e3[_0x785e('0x16')];}else if(_0x2c37e3['duplicate']){duplicates+=0x1;delete _0x2c37e3['duplicate'];}rows[_0x785e('0x30')](_0x2c37e3);}));if(total%0xc8===0x0){_0x1790c9[_0x785e('0x6f')]();return processPromises(_0x1790c9);}},'complete':function(){return processPromises()['then'](function(){logger[_0x785e('0x6b')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x59ad1b,_0x41b4df){logger['info'](_0x785e('0x70'),JSON[_0x785e('0x34')](_0x59ad1b));endCsv();}});})['catch'](function(_0xb44102){logger[_0x785e('0x16')](_0x785e('0x71'),JSON[_0x785e('0x34')](_0xb44102));});}main(); \ No newline at end of file +var _0xac06=['generalCheckHopper','finally','contact:csv_','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','undefined','argv','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','into','cm_hopper','ListId','updatedAt','select','field','scheduledAt','ContactId','toString','NOW()','createdAt','from','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','sequelize','VoiceQueueId','then','onlyIfOpen','query','CmList','BlackLists','get','Campaign','CampaignId','all','cmContact,\x20%s,\x20%s'];(function(_0x23d074,_0x610d9b){var _0x3e2283=function(_0x4caa68){while(--_0x4caa68){_0x23d074['push'](_0x23d074['shift']());}};_0x3e2283(++_0x610d9b);}(_0xac06,0xeb));var _0x6ac0=function(_0x5bd95c,_0x17a0a7){_0x5bd95c=_0x5bd95c-0x0;var _0x54e71b=_0xac06[_0x5bd95c];return _0x54e71b;};'use strict';var BPromise=require(_0x6ac0('0x0'));var util=require('util');var _=require(_0x6ac0('0x1'));var fs=require('fs');var squel=require(_0x6ac0('0x2'));var Papa=require(_0x6ac0('0x3'));var Redis=require(_0x6ac0('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x6ac0('0x5'));var logger=require(_0x6ac0('0x6'))(_0x6ac0('0x7'));config[_0x6ac0('0x8')]=_[_0x6ac0('0x9')](config['redis'],{'host':_0x6ac0('0xa'),'port':0x18eb});var socket=require(_0x6ac0('0xb'))(new Redis(config[_0x6ac0('0x8')]));require(_0x6ac0('0xc'))['register'](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x2]===_0x6ac0('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x6ac0('0xe')][0x3]||process[_0x6ac0('0xe')][0x3]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x3]==='null'||!process[_0x6ac0('0xe')][0x4]||process['argv'][0x4]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x4]===_0x6ac0('0xf')){throw new Error(_0x6ac0('0x10'));}var FIELDS=_['zipObject'](process[_0x6ac0('0xe')][0x3][_0x6ac0('0x11')](','),process[_0x6ac0('0xe')][0x4][_0x6ac0('0x11')](','));if(!process['argv'][0x5]||process[_0x6ac0('0xe')][0x5]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x5]===_0x6ac0('0xf')){throw new Error(_0x6ac0('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x6ac0('0xe')][0x6]&&process[_0x6ac0('0xe')][0x6]!==_0x6ac0('0xd')&&process['argv'][0x6]!==_0x6ac0('0xf')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x6ac0('0xd')&&process['argv'][0x7]!==_0x6ac0('0xf')?process[_0x6ac0('0xe')][0x7]:null;if(!process[_0x6ac0('0xe')][0x8]||process[_0x6ac0('0xe')][0x8]===_0x6ac0('0xd')||process['argv'][0x8]===_0x6ac0('0xf')){throw new Error(_0x6ac0('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xd1c76c){logger[_0x6ac0('0x14')](_0xd1c76c);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(_0x434fcb,_0x1a5538,_0x5448f5,_0x4ec728){var _0x34bb25={'message':_0x1a5538};_0x34bb25[_0x434fcb]=!![];if(_0x5448f5){_0x34bb25['contact']=_0x5448f5;}if(_0x4ec728){_0x34bb25[_0x6ac0('0x15')]=_0x4ec728;}return _0x34bb25;}function isEmail(_0xf9bd36){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))*$/[_0x6ac0('0x16')](_0xf9bd36);}function checkRow(_0x19ace7,_0x393914,_0x49a6f4){return new BPromise(function(_0x33c47c,_0x299bb4){if(_[_0x6ac0('0x17')](_0x19ace7)){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x18'),null,_0x49a6f4));}if(_0x19ace7[_0x6ac0('0x19')]&&_0x19ace7[_0x6ac0('0x19')][_0x6ac0('0x1a')]){var _0x4cd15c=_[_0x6ac0('0x1b')](_0x19ace7[_0x6ac0('0x19')],_0x6ac0('0x1c'))[_0x6ac0('0x1d')](';');return _0x299bb4(handleCheckRowError('error',_0x4cd15c,null,_0x49a6f4));}var _0x3af8c2={};for(var _0x5143ed in FIELDS){if(FIELDS[_0x6ac0('0x1e')](_0x5143ed)&&FIELDS[_0x5143ed]){_0x3af8c2[_0x5143ed]=_0x19ace7[_0x6ac0('0x1f')][0x0][FIELDS[_0x5143ed]]||_0x19ace7[_0x6ac0('0x1f')][0x0]['\ufeff'+FIELDS[_0x5143ed]];}}if(!_0x3af8c2['firstName']){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x20'),null,_0x49a6f4));}if(!_0x3af8c2[_0x6ac0('0x21')]){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x22'),null,_0x49a6f4));}if(_0x3af8c2[_0x6ac0('0x23')]){var _0x2d596b=moment(_0x3af8c2[_0x6ac0('0x23')],_0x6ac0('0x24'));if(!_0x2d596b[_0x6ac0('0x25')]()){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x49a6f4));}}if(_0x3af8c2[_0x6ac0('0x26')]){if(!isEmail(_0x3af8c2[_0x6ac0('0x26')])){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x27'),null,_0x49a6f4));}}_0x3af8c2['ListId']=LISTID;_0x3af8c2[_0x6ac0('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6ac0('0x1a')]&&_0x393914){var _0x808522={};for(var _0x5298be=0x0,_0x4f1fcd=DUPLICATES[_0x6ac0('0x1a')];_0x5298be<_0x4f1fcd;_0x5298be+=0x1){_0x808522[DUPLICATES[_0x5298be]]=_0x3af8c2[DUPLICATES[_0x5298be]];}var _0x24b912=_[_0x6ac0('0x29')](_0x393914,_0x808522);if(_0x24b912){return _0x299bb4(handleCheckRowError(_0x6ac0('0x2a'),_0x6ac0('0x2b'),_0x24b912,_0x49a6f4));}}return db[_0x6ac0('0x2c')]['create'](_0x3af8c2,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3af8c2)})['then'](function(_0x488b24){if(DUPLICATES&&DUPLICATES[_0x6ac0('0x1a')]&&_0x393914){_0x393914[_0x6ac0('0x2d')](_[_0x6ac0('0x2e')](_0x3af8c2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x488b24['id'];return _0x33c47c();})[_0x6ac0('0x2f')](function(_0x3ba257){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x30')+(_0x3ba257['message']||JSON[_0x6ac0('0x31')](_0x3ba257)),null,_0x49a6f4));});});}function checkHopper(){function _0x56db11(){return function(_0xd3145e){logger['error']('cmContact',_0x6ac0('0x32'),util[_0x6ac0('0x33')](_0xd3145e,{'showHidden':![],'depth':null}));};}var _0x3e5b0c=function(_0x401e95,_0x30cfa8){var _0x363645=squel['insert']()[_0x6ac0('0x34')](_0x6ac0('0x35'))['fromQuery']([_0x6ac0('0x21'),'scheduledAt','ContactId',_0x6ac0('0x36'),_0x30cfa8,'createdAt',_0x6ac0('0x37')],squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')]('NOW()',_0x6ac0('0x3a'))['field']('id',_0x6ac0('0x3b'))['field'](LISTID[_0x6ac0('0x3c')](),'ListId')[_0x6ac0('0x39')](_0x401e95['id'][_0x6ac0('0x3c')](),_0x30cfa8)[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x3e'))[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x37'))[_0x6ac0('0x3f')]('cm_contacts')['where'](_0x6ac0('0x40'))[_0x6ac0('0x41')](_0x6ac0('0x42'),LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')](_0x6ac0('0x43'))[_0x6ac0('0x41')](_0x6ac0('0x44'),squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'))[_0x6ac0('0x3f')](_0x6ac0('0x35'))[_0x6ac0('0x41')](_0x30cfa8+'\x20=\x20?',_0x401e95['id'][_0x6ac0('0x3c')]())))[_0x6ac0('0x3c')]();return _0x363645;};var _0x3bb349=function(_0x12da19,_0x4a392f){var _0xca33a3=squel[_0x6ac0('0x45')]()[_0x6ac0('0x34')](_0x6ac0('0x35'))['fromQuery']([_0x6ac0('0x21'),_0x6ac0('0x3a'),_0x6ac0('0x3b'),'ListId',_0x4a392f,'createdAt',_0x6ac0('0x37')],squel['select']()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')]('NOW()',_0x6ac0('0x3a'))[_0x6ac0('0x39')]('id',_0x6ac0('0x3b'))[_0x6ac0('0x39')](LISTID[_0x6ac0('0x3c')](),_0x6ac0('0x36'))['field'](_0x12da19['id'][_0x6ac0('0x3c')](),_0x4a392f)[_0x6ac0('0x39')](_0x6ac0('0x3d'),'createdAt')[_0x6ac0('0x39')]('NOW()',_0x6ac0('0x37'))['from'](_0x6ac0('0x46'))[_0x6ac0('0x41')](_0x6ac0('0x40'))[_0x6ac0('0x41')]('ListId\x20=\x20?',LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')](_0x6ac0('0x47'),squel[_0x6ac0('0x48')](hopperContacts))[_0x6ac0('0x41')](_0x6ac0('0x43'))[_0x6ac0('0x41')](_0x6ac0('0x44'),squel[_0x6ac0('0x38')]()['field'](_0x6ac0('0x49'))[_0x6ac0('0x3f')](_0x6ac0('0x4a'))[_0x6ac0('0x41')](_0x4a392f+_0x6ac0('0x4b'),_0x12da19['id'][_0x6ac0('0x3c')]()))[_0x6ac0('0x41')](_0x6ac0('0x44'),squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'))[_0x6ac0('0x3f')](_0x6ac0('0x35'))[_0x6ac0('0x41')](_0x4a392f+_0x6ac0('0x4b'),_0x12da19['id'][_0x6ac0('0x3c')]())))['toString']();return _0xca33a3;};function _0x2c5c22(_0x47dcec,_0x2a5ad5){var _0x2500fa=squel[_0x6ac0('0x45')]()['into'](_0x6ac0('0x35'))['fromQuery'](['phone',_0x6ac0('0x3a'),_0x6ac0('0x3b'),_0x6ac0('0x36'),_0x2a5ad5,_0x6ac0('0x3e'),'updatedAt'],squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x3a'))[_0x6ac0('0x39')]('id','ContactId')['field'](LISTID[_0x6ac0('0x3c')](),_0x6ac0('0x36'))[_0x6ac0('0x39')](_0x47dcec['id'][_0x6ac0('0x3c')](),_0x2a5ad5)[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x3e'))[_0x6ac0('0x39')](_0x6ac0('0x3d'),'updatedAt')['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x6ac0('0x41')]('ListId\x20=\x20?',LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')](_0x6ac0('0x47'),squel[_0x6ac0('0x48')](hopperContacts))[_0x6ac0('0x41')](_0x6ac0('0x43')))['toString']();return _0x2500fa;}function _0x5ba5d4(_0x439903,_0x15b2c9){var _0x94fb80=squel[_0x6ac0('0x45')]()['into'](_0x6ac0('0x4c'))['fromQuery'](['phone','ContactId',_0x6ac0('0x36'),_0x15b2c9,_0x6ac0('0x3e'),_0x6ac0('0x37')],squel['select']()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')]('id',_0x6ac0('0x3b'))['field'](LISTID[_0x6ac0('0x3c')](),_0x6ac0('0x36'))[_0x6ac0('0x39')](_0x439903['id'][_0x6ac0('0x3c')](),_0x15b2c9)['field'](_0x6ac0('0x3d'),_0x6ac0('0x3e'))['field'](_0x6ac0('0x3d'),'updatedAt')[_0x6ac0('0x3f')](_0x6ac0('0x46'))[_0x6ac0('0x41')]('deletedAt\x20IS\x20NULL')[_0x6ac0('0x41')](_0x6ac0('0x42'),LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')]('id\x20IN\x20?',squel[_0x6ac0('0x48')](hopperContacts))[_0x6ac0('0x41')](_0x6ac0('0x43')))[_0x6ac0('0x3c')]();return _0x94fb80;}return db[_0x6ac0('0x4d')][_0x6ac0('0x4e')]({'where':{'type':_0x6ac0('0x4f')},'attributes':['id',_0x6ac0('0x50')],'include':[{'model':db['CmList'],'as':_0x6ac0('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x3efb7f){var _0x23f47a=[];if(_0x3efb7f){var _0x5b3717;for(var _0x142983=0x0,_0x5aa5a4;_0x142983<_0x3efb7f[_0x6ac0('0x1a')];_0x142983+=0x1){_0x5aa5a4=_0x3efb7f[_0x142983]['get']({'plain':!![]});switch(_0x5aa5a4[_0x6ac0('0x50')]){case _0x6ac0('0x52'):_0x23f47a[_0x6ac0('0x2d')](db[_0x6ac0('0x53')]['query'](_0x3bb349(_0x5aa5a4,_0x6ac0('0x54')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;case _0x6ac0('0x56'):_0x23f47a[_0x6ac0('0x2d')](db['sequelize'][_0x6ac0('0x57')](_0x3e5b0c(_0x5aa5a4,_0x6ac0('0x54')))['then'](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;default:_0x23f47a[_0x6ac0('0x2d')](db[_0x6ac0('0x53')][_0x6ac0('0x57')](_0x2c5c22(_0x5aa5a4,_0x6ac0('0x54')))[_0x6ac0('0x55')](function(){})['catch'](_0x56db11()));}}}return _0x23f47a;})['all']()['then'](function(){return db[_0x6ac0('0x4d')][_0x6ac0('0x4e')]({'where':{'type':_0x6ac0('0x4f')},'attributes':['id'],'include':[{'model':db[_0x6ac0('0x58')],'as':_0x6ac0('0x59'),'where':{'id':LISTID}}]})[_0x6ac0('0x55')](function(_0x3e282a){var _0x1796c0=[];if(_0x3e282a){var _0x4f2f0d;for(var _0x50ea39=0x0,_0x4e4e17;_0x50ea39<_0x3e282a[_0x6ac0('0x1a')];_0x50ea39+=0x1){_0x4e4e17=_0x3e282a[_0x50ea39][_0x6ac0('0x5a')]({'plain':!![]});_0x1796c0['push'](db['sequelize'][_0x6ac0('0x57')](_0x5ba5d4(_0x4e4e17,_0x6ac0('0x54')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));}}return _0x1796c0;})['all']();})[_0x6ac0('0x55')](function(){return db[_0x6ac0('0x5b')][_0x6ac0('0x4e')]({'attributes':['id',_0x6ac0('0x50')],'include':[{'model':db[_0x6ac0('0x58')],'as':_0x6ac0('0x51'),'where':{'id':LISTID}}]})[_0x6ac0('0x55')](function(_0x3f1c7f){var _0x51bf9b=[];if(_0x3f1c7f){for(var _0x4c2fab=0x0,_0x16d33e;_0x4c2fab<_0x3f1c7f[_0x6ac0('0x1a')];_0x4c2fab+=0x1){_0x16d33e=_0x3f1c7f[_0x4c2fab][_0x6ac0('0x5a')]({'plain':!![]});switch(_0x16d33e[_0x6ac0('0x50')]){case'always':_0x51bf9b[_0x6ac0('0x2d')](db[_0x6ac0('0x53')][_0x6ac0('0x57')](_0x3bb349(_0x16d33e,_0x6ac0('0x5c')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;case _0x6ac0('0x56'):_0x51bf9b[_0x6ac0('0x2d')](db[_0x6ac0('0x53')][_0x6ac0('0x57')](_0x3e5b0c(_0x16d33e,_0x6ac0('0x5c')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;default:_0x51bf9b['push'](db[_0x6ac0('0x53')]['query'](_0x2c5c22(_0x16d33e,'CampaignId'))[_0x6ac0('0x55')](function(){})['catch'](_0x56db11()));}}}return _0x51bf9b;})['all']();})[_0x6ac0('0x55')](function(){return db[_0x6ac0('0x5b')][_0x6ac0('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x6ac0('0x58')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x4fe1db){var _0x46e6c6=[];if(_0x4fe1db){for(var _0x106913=0x0,_0x51bb69;_0x106913<_0x4fe1db[_0x6ac0('0x1a')];_0x106913+=0x1){_0x51bb69=_0x4fe1db[_0x106913]['get']({'plain':!![]});_0x46e6c6[_0x6ac0('0x2d')](db['sequelize'][_0x6ac0('0x57')](_0x5ba5d4(_0x51bb69,_0x6ac0('0x5c')))['then'](function(){})[_0x6ac0('0x2f')](_0x56db11()));}}return _0x46e6c6;})[_0x6ac0('0x5d')]();})[_0x6ac0('0x2f')](function(_0x26e35f){logger[_0x6ac0('0x14')](_0x6ac0('0x5e'),_0x6ac0('0x5f'),_0x26e35f[_0x6ac0('0x1c')]);});}var processPromises=function(_0x1435ea){return BPromise['all'](promises)[_0x6ac0('0x55')](function(_0x327588){})['catch'](function(_0x24c07f){logger[_0x6ac0('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0x6ac0('0x31')](_0x24c07f));})[_0x6ac0('0x60')](function(){socket['emit'](_0x6ac0('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1435ea){return _0x1435ea['resume']();}});};var endCsv=function(){return BPromise[_0x6ac0('0x62')]()[_0x6ac0('0x55')](function(){if(hopperContacts){return checkHopper();}})[_0x6ac0('0x55')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6ac0('0x63')](FILEPATH);}catch(_0x306e34){logger[_0x6ac0('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x306e34));}finally{process[_0x6ac0('0x64')](0x0);}});};process['on'](_0x6ac0('0x65'),function(){logger[_0x6ac0('0x66')](_0x6ac0('0x67'));endCsv();});function main(){return BPromise[_0x6ac0('0x62')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6ac0('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6ac0('0x55')](function(_0x4eef8e){var _0x2cf069=fs[_0x6ac0('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6ac0('0x69')](_0x2cf069,{'header':!![],'skipEmptyLines':!![],'step':function(_0x640f1d,_0x47143d){total+=0x1;var _0x2a5dc3=total;promises[_0x6ac0('0x2d')](checkRow(_0x640f1d,_0x4eef8e,_0x2a5dc3)['then'](function(){success+=0x1;})[_0x6ac0('0x2f')](function(_0x45aecd){if(_0x45aecd[_0x6ac0('0x14')]){errors+=0x1;delete _0x45aecd[_0x6ac0('0x14')];}else if(_0x45aecd[_0x6ac0('0x2a')]){duplicates+=0x1;delete _0x45aecd['duplicate'];}rows[_0x6ac0('0x2d')](_0x45aecd);}));if(total%0xc8===0x0){_0x47143d[_0x6ac0('0x6a')]();return processPromises(_0x47143d);}},'complete':function(){return processPromises()[_0x6ac0('0x55')](function(){logger[_0x6ac0('0x66')](_0x6ac0('0x6b'));endCsv();});},'error':function(_0x26dc6a,_0x12a904){logger[_0x6ac0('0x66')](_0x6ac0('0x6c'),JSON[_0x6ac0('0x31')](_0x26dc6a));endCsv();}});})['catch'](function(_0x7d723){logger[_0x6ac0('0x14')](_0x6ac0('0x6d'),JSON['stringify'](_0x7d723));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 7d7109a..f53cf73 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 _0xc740=['CmContact','findAll','AdditionalPhones','then','push','all','split','length','CmContactHasItem','findOne','update','updated','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','ListId','createdAt','priority','UserId','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','into','cm_hopper_black','updatedAt','cm_contacts','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.createdAt','cm_contacts.UserId','scheduledat','ContactId','recallme','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','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.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','isNil','utcOffset','set','offset','dialTimezone','main','stringify','send','start','binding','clone','socket_timestamp','root','.csv','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','description','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','duplicates','contactId','orderBy','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','localhost','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join'];(function(_0x531c27,_0xe5f60d){var _0x569d7f=function(_0x297c29){while(--_0x297c29){_0x531c27['push'](_0x531c27['shift']());}};_0x569d7f(++_0xe5f60d);}(_0xc740,0x169));var _0x0c74=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc740[_0x30ae5e];return _0x1f2e93;};'use strict';var fs=require('fs');var path=require(_0x0c74('0x0'));var _=require(_0x0c74('0x1'));var Papa=require(_0x0c74('0x2'));var util=require(_0x0c74('0x3'));var BPromise=require(_0x0c74('0x4'));var moment=require(_0x0c74('0x5'));var squel=require(_0x0c74('0x6'));var Redis=require(_0x0c74('0x7'));var db=require(_0x0c74('0x8'))['db'];var config=require(_0x0c74('0x9'));var shared=require(_0x0c74('0xa'));var logger=require('../../../config/logger')(_0x0c74('0xb'));config[_0x0c74('0xc')]=_['defaults'](config[_0x0c74('0xc')],{'host':_0x0c74('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x0c74('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x0c74('0xf')](_0x0c74('0xe'));function isEmail(_0x495a7b){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))*$/[_0x0c74('0x10')](_0x495a7b);}function selectNotIn(_0x38b442,_0x145ccf,_0x420fc9,_0x158e39,_0x343bbf){return squel[_0x0c74('0x11')]()[_0x0c74('0x12')](_0x0c74('0x13'))[_0x0c74('0x14')](_0x158e39)['join'](_0x145ccf,null,_0x145ccf+_0x0c74('0x15')+_0x158e39+'.'+_0x420fc9)[_0x0c74('0x16')](_0x158e39+'.'+_0x420fc9+'\x20=\x20'+_0x38b442+'.'+_0x420fc9)[_0x0c74('0x16')](_0x145ccf+_0x0c74('0x17')+_0x343bbf[_0x0c74('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3df3dd,_0x372bc5){promisesAdditionalPhones=[];return db[_0x0c74('0x19')][_0x0c74('0x1a')]({'raw':!![],'attributes':['id',_0x0c74('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x0c74('0x1c')](function(_0x3dcbef){if(_0x3dcbef!==null){var _0x58a0ba=[];for(var _0x54d786=0x0;_0x54d786<_0x3dcbef['length'];_0x54d786++){var _0x2bac61=_0x3dcbef[_0x54d786];_0x58a0ba[_0x0c74('0x1d')](insertAdditionalPhones(_0x2bac61));}}Promise[_0x0c74('0x1e')](_0x58a0ba)[_0x0c74('0x1c')](function(){_0x3df3dd({'val':0x1});});});});}function insertAdditionalPhones(_0x291076){return new Promise(function(_0x323e55,_0x512dda){var _0x519e01=_0x291076['AdditionalPhones'];var _0x830039=_0x519e01[_0x0c74('0x1f')](';');var _0x86f65c=[];orderBy=0x0;for(var _0x5a9841=0x0;_0x5a9841<_0x830039['length'];_0x5a9841++){_0x86f65c[_0x0c74('0x1d')](splitAdditionalPhone(_0x291076['id'],_0x830039[_0x5a9841]));}Promise[_0x0c74('0x1e')](_0x86f65c)[_0x0c74('0x1c')](function(){_0x323e55({'val':_0x830039[_0x0c74('0x20')]});});});}function splitAdditionalPhone(_0x27d1a6,_0x4ba8e1){return new Promise(function(_0x47a61a,_0x376db3){var _0x19026c=_0x4ba8e1[_0x0c74('0x1f')](':');var _0x289196=_0x19026c[0x0];var _0x287d8a=_0x19026c[0x1];if(!_['isNil'](_0x287d8a)){var _0x1313ac=_0x287d8a[_0x0c74('0x1f')]('|');var _0x5899f1=[];for(var _0x34dfa1=0x0;_0x34dfa1<_0x1313ac[_0x0c74('0x20')];_0x34dfa1++){if(_0x1313ac[_0x34dfa1]!==''){var _0x182b5b=_['filter'](promisesAdditionalPhones,{'contactId':_0x27d1a6,'phone':_0x1313ac[_0x34dfa1]});if(_0x182b5b[_0x0c74('0x20')]==0x0){orderBy++;promisesAdditionalPhones[_0x0c74('0x1d')]({'contactId':_0x27d1a6,'contactTypeId':_0x289196,'phone':_0x1313ac[_0x34dfa1],'orderBy':orderBy});}}}_0x47a61a({'ok':0x1});}else _0x47a61a({'res':0x0});});}function createAdditionalPhone(_0x5cf4d9,_0x5b015a,_0x53617f,_0x1f0328){var _0x20f2f1='';var _0x11dd06='';var _0x4ec2bf=_0x53617f[_0x0c74('0x1f')]('§');_0x20f2f1=_0x4ec2bf[0x0];if(_0x4ec2bf[_0x0c74('0x20')]==0x2)_0x11dd06=_0x4ec2bf[0x1];return new Promise(function(_0x32250a,_0x3e7882){return db[_0x0c74('0x21')][_0x0c74('0x22')]({'where':{'CmContactId':_0x5cf4d9,'item':_0x20f2f1}})[_0x0c74('0x1c')](function(_0x44b436){if(_0x44b436){return db[_0x0c74('0x21')][_0x0c74('0x23')]({'ItemTypeId':_0x5b015a,'description':_0x11dd06,'OrderBy':_0x1f0328},{'where':{'CmContactId':_0x5cf4d9,'item':_0x20f2f1}})[_0x0c74('0x1c')](function(_0x10f7db){_0x32250a({'res':_0x0c74('0x24')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x5cf4d9,'item':_0x20f2f1,'description':_0x11dd06,'ItemTypeId':_0x5b015a,'OrderBy':_0x1f0328,'ItemClass':_0x0c74('0x25')})[_0x0c74('0x1c')](function(_0xd75c5a){_0x32250a({'res':'inserted'});});}});});}function insertCmHopper(_0x596155,_0x2569b2,_0x34ce38,_0x4e46c1,_0x4cec64){var _0x2ebe80=[_0x0c74('0x26'),'cm_contacts.scheduledat',_0x0c74('0x27'),'cm_contacts.ListId',_0x2569b2+'.'+_0x4e46c1,'cm_contacts.createdAt',_0x0c74('0x28'),_0x0c74('0x29'),'cm_contacts.UserId','\x22'+_0x4cec64+'\x22'];return squel[_0x0c74('0x2a')]()['into'](_0x0c74('0x2b'))[_0x0c74('0x2c')](['phone','scheduledat','ContactId',_0x0c74('0x2d'),_0x4e46c1,_0x0c74('0x2e'),'updatedAt',_0x0c74('0x2f'),_0x0c74('0x30'),'recallme'],squel[_0x0c74('0x11')]()[_0x0c74('0x31')](_0x2ebe80)['from'](_0x2569b2)[_0x0c74('0x18')]('cm_contacts',null,_0x0c74('0x32')+_0x2569b2+_0x0c74('0x33'))[_0x0c74('0x18')](_0x34ce38,null,_0x34ce38+_0x0c74('0x15')+_0x2569b2+'.'+_0x4e46c1)[_0x0c74('0x16')](_0x2569b2+'.CmListId\x20=\x20?',_0x596155)[_0x0c74('0x16')](_0x0c74('0x34'),NOW)[_0x0c74('0x16')](_0x0c74('0x35'),selectNotIn(_0x2569b2,_0x34ce38,_0x4e46c1,_0x0c74('0x2b'),[_0x0c74('0x36'),'\x22onlyIfOpen\x22']))[_0x0c74('0x16')](_0x0c74('0x35'),selectNotIn(_0x2569b2,_0x34ce38,_0x4e46c1,_0x0c74('0x2b'),[_0x0c74('0x36')])))[_0x0c74('0x37')]();}function insertCmHopperBlack(_0x1900ba,_0x48244e,_0x12e015,_0xea275b){var _0x2da6bb=[_0x0c74('0x26'),_0x0c74('0x27'),_0x0c74('0x38'),_0x48244e+'.'+_0xea275b,'cm_contacts.createdAt',_0x0c74('0x28')];return squel[_0x0c74('0x2a')]()[_0x0c74('0x39')](_0x0c74('0x3a'))[_0x0c74('0x2c')](['phone','ContactId',_0x0c74('0x2d'),_0xea275b,_0x0c74('0x2e'),_0x0c74('0x3b')],squel[_0x0c74('0x11')]()[_0x0c74('0x31')](_0x2da6bb)[_0x0c74('0x14')](_0x48244e)['join'](_0x0c74('0x3c'),null,_0x0c74('0x32')+_0x48244e+_0x0c74('0x33'))[_0x0c74('0x18')](_0x12e015,null,_0x12e015+_0x0c74('0x15')+_0x48244e+'.'+_0xea275b)[_0x0c74('0x16')](_0x48244e+_0x0c74('0x3d'),_0x1900ba)[_0x0c74('0x16')](_0x0c74('0x34'),NOW)[_0x0c74('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0c74('0x11')]()[_0x0c74('0x12')](_0x0c74('0x13'))[_0x0c74('0x14')](_0x0c74('0x3a'))['where'](_0x0c74('0x3e'),_0x1900ba)['where'](_0xea275b+_0x0c74('0x3f')+_0x48244e+'.'+_0xea275b)))[_0x0c74('0x37')]();}function insertTzCmHopper(_0x2d29ed,_0x59a07b,_0x524fba,_0x2a31a4,_0x454324,_0x26bf4d){var _0x54c57f=[_0x0c74('0x26'),_0x0c74('0x40')+_0x26bf4d+_0x0c74('0x41'),_0x0c74('0x27'),_0x0c74('0x38'),_0x59a07b+'.'+_0x2a31a4,_0x0c74('0x42'),'cm_contacts.updatedAt','cm_contacts.priority',_0x0c74('0x43'),'\x22'+_0x454324+'\x22'];var _0x138747=squel['insert']()['into']('cm_hopper')[_0x0c74('0x2c')]([_0x0c74('0x13'),_0x0c74('0x44'),_0x0c74('0x45'),_0x0c74('0x2d'),_0x2a31a4,'createdAt',_0x0c74('0x3b'),_0x0c74('0x2f'),_0x0c74('0x30'),_0x0c74('0x46')],squel[_0x0c74('0x11')]()['fields'](_0x54c57f)[_0x0c74('0x14')](_0x59a07b)[_0x0c74('0x18')]('cm_contacts',null,_0x0c74('0x32')+_0x59a07b+'.CmListId')[_0x0c74('0x18')](_0x524fba,null,_0x524fba+'.id\x20=\x20'+_0x59a07b+'.'+_0x2a31a4)[_0x0c74('0x18')](_0x26bf4d,null,_0x26bf4d+_0x0c74('0x15')+_0x59a07b+'.'+_0x2a31a4)[_0x0c74('0x16')](_0x59a07b+_0x0c74('0x3d'),_0x2d29ed)[_0x0c74('0x16')](_0x0c74('0x34'),NOW)[_0x0c74('0x16')](_0x0c74('0x35'),selectNotIn(_0x59a07b,_0x524fba,_0x2a31a4,_0x0c74('0x2b'),[_0x0c74('0x36'),_0x0c74('0x47')]))[_0x0c74('0x16')](_0x0c74('0x35'),selectNotIn(_0x59a07b,_0x524fba,_0x2a31a4,_0x0c74('0x2b'),['\x22always\x22'])))['toString']();return _0x138747;}function insertTzCmHopperBlack(_0x70fc25,_0x3c3842,_0x673a92,_0x4ce8b1){var _0x3ef722=[_0x0c74('0x26'),_0x0c74('0x27'),'cm_contacts.ListId',_0x3c3842+'.'+_0x4ce8b1,_0x0c74('0x42'),_0x0c74('0x28')];return squel[_0x0c74('0x2a')]()['into'](_0x0c74('0x3a'))[_0x0c74('0x2c')]([_0x0c74('0x13'),_0x0c74('0x45'),_0x0c74('0x2d'),_0x4ce8b1,_0x0c74('0x2e'),_0x0c74('0x3b')],squel[_0x0c74('0x11')]()[_0x0c74('0x31')](_0x3ef722)['from'](_0x3c3842)['join'](_0x0c74('0x3c'),null,_0x0c74('0x32')+_0x3c3842+_0x0c74('0x33'))['join'](_0x673a92,null,_0x673a92+_0x0c74('0x15')+_0x3c3842+'.'+_0x4ce8b1)[_0x0c74('0x16')](_0x3c3842+_0x0c74('0x3d'),_0x70fc25)[_0x0c74('0x16')](_0x0c74('0x34'),NOW)['where'](_0x0c74('0x35'),squel['select']()[_0x0c74('0x12')]('phone')['from'](_0x0c74('0x3a'))[_0x0c74('0x16')](_0x0c74('0x3e'),_0x70fc25)[_0x0c74('0x16')](_0x4ce8b1+_0x0c74('0x3f')+_0x3c3842+'.'+_0x4ce8b1)))[_0x0c74('0x37')]();}function insertCmHopperAdditionalPhones(_0x2702c7){var _0x256db8=[_0x0c74('0x48'),_0x0c74('0x49'),_0x0c74('0x4a'),_0x0c74('0x4b'),'cm_contact_has_items.updatedAt'];return squel[_0x0c74('0x2a')]()[_0x0c74('0x39')](_0x0c74('0x4c'))[_0x0c74('0x2c')]([_0x0c74('0x4d'),_0x0c74('0x13'),_0x0c74('0x4e'),_0x0c74('0x2e'),_0x0c74('0x3b')],squel['select']()[_0x0c74('0x31')](_0x256db8)[_0x0c74('0x14')](_0x0c74('0x2b'))[_0x0c74('0x18')](_0x0c74('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x0c74('0x18')](_0x0c74('0x4f'),null,_0x0c74('0x50'))['where'](_0x0c74('0x51'),_0x2702c7)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x0c74('0x37')]();}function insertCmContact(_0x1fd671,_0x4a7fe6,_0x2f20fd,_0x322f45){var _0x3f86dc=_[_0x0c74('0x52')](_[_0x0c74('0x53')](_0x322f45),[_0x0c74('0x2d'),'CompanyId',_0x0c74('0x2e'),'updatedAt',_0x0c74('0x54')]);return squel['insert']()[_0x0c74('0x39')](_0x0c74('0x3c'))['fromQuery'](_0x3f86dc,squel[_0x0c74('0x11')]()['fields'](_0x3f86dc)[_0x0c74('0x14')](_0x4a7fe6)[_0x0c74('0x16')]('('+_0x2f20fd['join'](',')+_0x0c74('0x55'),squel[_0x0c74('0x11')]()[_0x0c74('0x31')](_0x2f20fd)[_0x0c74('0x14')](_0x0c74('0x3c'))[_0x0c74('0x16')](_0x0c74('0x3e'),_0x1fd671)[_0x0c74('0x16')]('deletedAt\x20IS\x20NULL'))['where'](_0x0c74('0x56'),squel[_0x0c74('0x11')]()[_0x0c74('0x12')](_0x0c74('0x57'),_0x0c74('0x58'))[_0x0c74('0x14')](_0x4a7fe6)[_0x0c74('0x59')](_0x2f20fd[_0x0c74('0x18')](','))))[_0x0c74('0x37')]();}function handleStop(){logger[_0x0c74('0x5a')](_0x0c74('0x5b'));stopped=!![];}function handleUncaughtException(_0x1002ee){logger[_0x0c74('0x5c')](_0x1002ee[_0x0c74('0x5d')]);process[_0x0c74('0x5e')](0x1);}function handleError(_0x527853,_0x25649f){stats[_0x0c74('0x5f')][_0x0c74('0x1d')]({'name':_0x25649f[_0x0c74('0x60')],'message':_0x25649f['message'],'row':_0x527853});}function handleQuery(_0x190b3e){logger[_0x0c74('0x5a')](_0x190b3e);return db[_0x0c74('0x61')][_0x0c74('0x62')](_0x190b3e)[_0x0c74('0x63')](function(_0x5068dd){results['push'](_0x5068dd);})[_0x0c74('0x64')](function(_0xd1fbfe){logger[_0x0c74('0x5c')](_0xd1fbfe[_0x0c74('0x5d')]);});}function updateTzCampaigns(_0x5b290c){return new Promise(function(_0x2c855a,_0xb571e1){var _0x440034=squel[_0x0c74('0x11')]()[_0x0c74('0x31')]([_0x0c74('0x65'),_0x0c74('0x66')])[_0x0c74('0x14')](_0x0c74('0x67'))[_0x0c74('0x18')](_0x0c74('0x68'),null,_0x0c74('0x69'))['where'](_0x0c74('0x6a')+_0x5b290c);db[_0x0c74('0x61')][_0x0c74('0x62')](_0x440034[_0x0c74('0x37')]())[_0x0c74('0x63')](function(_0x15fd64){var _0x39e2fd=[];for(var _0x503f5e=0x0;_0x503f5e<_0x15fd64[_0x0c74('0x20')];_0x503f5e++){_0x39e2fd['push'](getTimezoneData(_0x15fd64[_0x503f5e],tmp_campaigns));}BPromise[_0x0c74('0x1e')](_0x39e2fd)['then'](function(){_0x2c855a({'val':0x1});});})[_0x0c74('0x64')](function(_0x304c6d){logger[_0x0c74('0x5c')](_0x304c6d[_0x0c74('0x5d')]);_0x2c855a({'val':0x0});});});}function updateTzVoiceQueues(_0x344809){return new Promise(function(_0xa2e164,_0x5ea4e6){var _0x22e418=squel[_0x0c74('0x11')]()[_0x0c74('0x31')]([_0x0c74('0x6b'),_0x0c74('0x6c')])[_0x0c74('0x14')](_0x0c74('0x6d'))[_0x0c74('0x18')](_0x0c74('0x6e'),null,_0x0c74('0x6f'))['where'](_0x0c74('0x70')+_0x344809);db[_0x0c74('0x61')][_0x0c74('0x62')](_0x22e418[_0x0c74('0x37')]())[_0x0c74('0x63')](function(_0x1bf847){var _0x5d5b03=[];for(var _0x4d428c=0x0;_0x4d428c<_0x1bf847[_0x0c74('0x20')];_0x4d428c++){_0x5d5b03[_0x0c74('0x1d')](getTimezoneData(_0x1bf847[_0x4d428c],tmp_voice_queues));}BPromise[_0x0c74('0x1e')](_0x5d5b03)[_0x0c74('0x1c')](function(){_0xa2e164({'val':0x1});});})[_0x0c74('0x64')](function(_0x23679b){logger[_0x0c74('0x5c')](_0x23679b[_0x0c74('0x5d')]);_0xa2e164({'val':0x0});});});}function getTimezoneData(_0x2745bd,_0x181f74){return new Promise(function(_0x812b99,_0x23be38){var _0x18598c=shared['timezones'];var _0x21d813=_0x18598c[_0x2745bd['dialTimezone']];if(_[_0x0c74('0x71')](_0x21d813)){_0x812b99({'ret':0x1});}else{var _0x3c7ac7=_0x21d813[_0x0c74('0x72')];var _0x213389=squel[_0x0c74('0x2a')]()[_0x0c74('0x39')](_0x181f74)[_0x0c74('0x73')]('id',_0x2745bd['id'])['set'](_0x0c74('0x74'),_0x3c7ac7)[_0x0c74('0x73')](_0x0c74('0x75'),_0x2745bd[_0x0c74('0x75')])[_0x0c74('0x37')]();return db[_0x0c74('0x61')]['query'](_0x213389)[_0x0c74('0x63')](function(_0x43e480){_0x812b99({'ret':0x1});})[_0x0c74('0x64')](function(_0xd5eb1b){logger['error'](_0xd5eb1b[_0x0c74('0x5d')]);_0x23be38({'ret':0x1});});}});}function handleTZQuery(_0x4579aa){logger[_0x0c74('0x5a')](_0x4579aa);return db[_0x0c74('0x61')][_0x0c74('0x62')](_0x4579aa)[_0x0c74('0x63')](function(_0x29b6e5){})['catch'](function(_0x29c2de){logger[_0x0c74('0x5c')](_0x29c2de[_0x0c74('0x5d')]);});}function main(_0x4ffaa9,_0x20f660,_0x3626de,_0x30d16b){logger[_0x0c74('0x5a')](_0x0c74('0x76'),_0x4ffaa9,JSON[_0x0c74('0x77')](_0x20f660));process[_0x0c74('0x78')](_0x0c74('0x79'));var _0x2ef7cc=_0x20f660[_0x0c74('0x7a')];var _0x1b2a1d=_[_0x0c74('0x7b')](_0x2ef7cc);var _0x379851=_0x20f660[_0x0c74('0x7c')];var _0x5e5b45=path['join'](config[_0x0c74('0x7d')],'server/files/tmp',_0x379851+_0x0c74('0x7e'));hasTZ=_[_0x0c74('0x53')](_0x2ef7cc)['includes'](_0x0c74('0x75'));var _0x1a0d22=_[_0x0c74('0x53')](_0x2ef7cc)[_0x0c74('0x18')]();logger[_0x0c74('0x5a')](_0x0c74('0x7f'),_0x1a0d22);db[_0x0c74('0x80')][_0x0c74('0x1a')]({'raw':!![],'attributes':['id',_0x0c74('0x81')]})[_0x0c74('0x1c')](function(_0x521986){for(var _0x2d4172=0x0;_0x2d4172<_0x521986[_0x0c74('0x20')];_0x2d4172++){if(_0x521986[_0x2d4172][_0x0c74('0x81')]in _0x2ef7cc){contactItemTypes[_0x0c74('0x1d')](_0x521986[_0x2d4172]);delete _0x1b2a1d[_0x521986[_0x2d4172]['name']];hasAdditionalPhones=!![];}for(var _0x2790fa in _0x2ef7cc){if(_0x521986[_0x2d4172]['name']+_0x0c74('0x82')===_0x2790fa){phoneDescriptions['push']({'itemTypeId':_0x521986[_0x2d4172]['id'],'description':_0x2790fa});delete _0x1b2a1d[_0x2790fa];}}}if(hasAdditionalPhones)_0x1b2a1d[_0x0c74('0x1b')]='';var _0xc0420=_['keys'](_0x1b2a1d)[_0x0c74('0x18')]();logger[_0x0c74('0x5a')]('header',_0xc0420);fs[_0x0c74('0x83')](_0x5e5b45,_0xc0420+'\x0a');Papa[_0x0c74('0x84')](fs[_0x0c74('0x85')](_0x4ffaa9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x40bfdd,_0x363f03){try{for(var _0x34bb01=0x0,_0x22b274=[];_0x34bb01<_0x40bfdd[_0x0c74('0x86')][_0x0c74('0x20')];_0x34bb01++){stats['rows']+=0x1;if(_0x40bfdd['errors'][_0x34bb01]){handleError(_0x40bfdd[_0x0c74('0x86')][_0x34bb01],_0x40bfdd['errors'][_0x34bb01]);}else{var _0x492184=[];var _0x1ba976=[];var _0x2b63e1={};for(var _0x301968 in _0x2ef7cc){let _0x49f722=contactItemTypes[_0x0c74('0x87')](_0x5a76c6=>_0x5a76c6[_0x0c74('0x81')]===_0x301968);let _0x45764e=contactItemTypes[_0x0c74('0x87')](_0x158ab9=>_0x158ab9['name']+_0x0c74('0x82')===_0x301968);if(_[_0x0c74('0x71')](_0x49f722)&&_[_0x0c74('0x71')](_0x45764e)){if(_0x2ef7cc[_0x0c74('0x88')](_0x301968)){if(_0x40bfdd[_0x0c74('0x86')][_0x34bb01][_0x2ef7cc[_0x301968]]){var _0x34221c=_[_0x0c74('0x89')](_0x40bfdd[_0x0c74('0x86')][_0x34bb01][_0x2ef7cc[_0x301968]][_0x0c74('0x8a')](/"/g,'\x27'));switch(_0x301968){case _0x0c74('0x44'):var _0x427b35=moment(_0x34221c,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x427b35['isValid']()){_0x22b274[_0x0c74('0x1d')]('\x22'+_0x34221c+'\x22');}else{_0x492184[_0x0c74('0x1d')](_0x0c74('0x8b'));}break;case _0x0c74('0x2f'):var _0x3a7189=parseInt(_0x34221c);_0x34221c=_[_0x0c74('0x8c')](_0x3a7189)||_0x3a7189<0x0||_0x3a7189>0x4?_0x30d16b?0x3:0x2:_0x3a7189;_0x22b274[_0x0c74('0x1d')]('\x22'+_0x34221c+'\x22');break;case _0x0c74('0x30'):var _0xffcd7c=parseInt(_0x34221c);if(_[_0x0c74('0x8d')](_0xffcd7c)&&_[_0x0c74('0x8e')](_0x3626de,_0xffcd7c)){_0x22b274[_0x0c74('0x1d')]('\x22'+_0xffcd7c+'\x22');}else{_0x492184[_0x0c74('0x1d')](_0x0c74('0x8f'));}break;case _0x0c74('0x90'):if(isEmail(_0x34221c)){_0x22b274[_0x0c74('0x1d')]('\x22'+_0x34221c+'\x22');}else{_0x492184['push'](_0x0c74('0x91'));}break;case _0x0c74('0x92'):var _0x96a417=moment(_0x34221c,_0x0c74('0x93'),!![]);if(_0x96a417['isValid']()){_0x22b274[_0x0c74('0x1d')]('\x22'+_0x34221c+'\x22');}else{_0x492184['push'](_0x0c74('0x94'));}break;case _0x0c74('0x75'):var _0x252283=shared['timezones'];var _0x724efd=_0x252283[_0x34221c];if(!_[_0x0c74('0x71')](_0x724efd)){var _0x4c4dc7=_0x724efd['utcOffset'];_0x22b274[_0x0c74('0x1d')]('\x22'+_0x34221c+'\x22');_0x22b274[_0x0c74('0x1d')]('\x22'+_0x4c4dc7+'\x22');}break;default:_0x22b274[_0x0c74('0x1d')]('\x22'+_0x34221c+'\x22');}}else{switch(_0x301968){case'firstName':case _0x0c74('0x13'):_0x492184[_0x0c74('0x1d')](_0x301968+_0x0c74('0x95'));break;default:_0x22b274[_0x0c74('0x1d')]('\x22\x22');}}}}else{var _0x469e37='';if(!_[_0x0c74('0x71')](_0x49f722)){if(!_0x2b63e1[_0x0c74('0x88')](_0x49f722['id'])){if(!_[_0x0c74('0x71')](_0x40bfdd[_0x0c74('0x86')][_0x34bb01][_0x2ef7cc[_0x301968]])){var _0x34221c=_[_0x0c74('0x89')](_0x40bfdd['data'][_0x34bb01][_0x2ef7cc[_0x301968]]['replace'](/"/g,'\x27'));var _0x3e9be6=phoneDescriptions[_0x0c74('0x87')](_0x4bbb0e=>_0x4bbb0e['itemTypeId']===_0x49f722['id']);if(!_[_0x0c74('0x71')](_0x3e9be6)){var _0x16cbd3=_[_0x0c74('0x89')](_0x40bfdd['data'][_0x34bb01][_0x2ef7cc[_0x3e9be6[_0x0c74('0x96')]]][_0x0c74('0x8a')](/"/g,'\x27'));if(!_[_0x0c74('0x71')](_0x16cbd3))_0x34221c=_0x34221c+'§'+_0x16cbd3;}if(_0x469e37=='')_0x469e37=_0x34221c;else _0x469e37+='|'+_0x34221c;}_0x1ba976[_0x0c74('0x1d')](_0x49f722['id']+':'+_0x469e37);_0x2b63e1[_0x49f722['id']]=0x1;}}}}if(hasAdditionalPhones){_0x22b274[_0x0c74('0x1d')]('\x22'+_0x1ba976[_0x0c74('0x18')](';')+'\x22');}if(_0x492184[_0x0c74('0x20')]){handleError(_0x40bfdd[_0x0c74('0x86')][_0x34bb01],{'code':_0x0c74('0x97'),'message':_0x492184[_0x0c74('0x18')]()});}else{fs[_0x0c74('0x98')](_0x5e5b45,_0x22b274['join']()+'\x0a');}_0x22b274=[];}if(!(stats[_0x0c74('0x99')]%0xc8)){socket[_0x0c74('0x9a')](_0x0c74('0x9b')+_0x379851,stats);stats[_0x0c74('0x5f')]=[];}}if(stopped){logger['info'](_0x0c74('0x9c'));_0x363f03[_0x0c74('0x9d')]();}}catch(_0x149cc4){handleError(_0x40bfdd[_0x0c74('0x86')][_0x34bb01],{'code':_0x0c74('0x9e'),'message':_0x149cc4[_0x0c74('0x5d')]});logger['error'](_0x0c74('0x9f'),_0x149cc4[_0x0c74('0x5d')]);}},'complete':function(){try{var _0x245103=[];var _0x48c2d5=[];var _0x27f55f=_0x0c74('0x3c');if(_0x20f660['duplicates']&&_0x20f660['duplicates']['length']){_0x27f55f=_0x0c74('0xa0')+_0x379851;_0x245103[_0x0c74('0x1d')](_0x0c74('0xa1')+_0x27f55f+_0x0c74('0xa2'));}tmp_campaigns=_0x0c74('0xa3')+_0x379851;tmp_voice_queues=_0x0c74('0xa4')+_0x379851;_0x48c2d5[_0x0c74('0x1d')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x0c74('0xa5'));_0x48c2d5[_0x0c74('0x1d')](_0x0c74('0xa1')+tmp_voice_queues+_0x0c74('0xa5'));BPromise[_0x0c74('0xa6')](_0x48c2d5,handleTZQuery)['then'](function(_0x5db597){updateTzCampaigns(_0x20f660[_0x0c74('0x2d')])[_0x0c74('0x1c')](function(_0x2212e3){updateTzVoiceQueues(_0x20f660[_0x0c74('0x2d')])[_0x0c74('0x1c')](function(_0x5b91d6){if(hasTZ)_0xc0420=_0xc0420[_0x0c74('0x8a')]('dialTimezone',_0x0c74('0xa7'));var _0x3ab061=util[_0x0c74('0xf')](_0x0c74('0xa8'),_0x5e5b45,_0x27f55f,_0xc0420,_0x20f660[_0x0c74('0x2d')],_0x20f660[_0x0c74('0xa9')]||null,NOW,NOW);if(_[_0x0c74('0x71')](_0x2ef7cc[_0x0c74('0x44')])){_0x3ab061+=_0x0c74('0xaa');}_0x245103[_0x0c74('0x1d')](_0x3ab061);if(_0x20f660[_0x0c74('0xab')]&&_0x20f660[_0x0c74('0xab')][_0x0c74('0x20')]){_0x245103[_0x0c74('0x1d')](insertCmContact(_0x20f660[_0x0c74('0x2d')],_0x27f55f,_0x20f660[_0x0c74('0xab')],_0x2ef7cc));_0x245103[_0x0c74('0x1d')]('DROP\x20TABLE\x20'+_0x27f55f+';');}BPromise[_0x0c74('0xa6')](_0x245103,handleQuery)[_0x0c74('0x1c')](function(_0x5bbdb0){BPromise[_0x0c74('0x1e')]([handleAdditionalPhones()])[_0x0c74('0x1c')](function(){_0x245103=[];for(var _0x335346=0x0;_0x335346\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','phone','from','.id\x20=\x20','where','\x20=\x20','CmContact','AdditionalPhones','length','push','then','split','isNil','filter','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.id','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','join','cm_contacts','field','cm_hopper_black','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','\x22always\x22','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','code','query'];(function(_0x4a2a99,_0x404a3d){var _0x232f86=function(_0x546890){while(--_0x546890){_0x4a2a99['push'](_0x4a2a99['shift']());}};_0x232f86(++_0x404a3d);}(_0xbdbd,0x1cf));var _0xdbdb=function(_0x2ccfd5,_0x518930){_0x2ccfd5=_0x2ccfd5-0x0;var _0x5e7dae=_0xbdbd[_0x2ccfd5];return _0x5e7dae;};'use strict';var fs=require('fs');var path=require(_0xdbdb('0x0'));var _=require(_0xdbdb('0x1'));var Papa=require(_0xdbdb('0x2'));var util=require(_0xdbdb('0x3'));var BPromise=require(_0xdbdb('0x4'));var moment=require(_0xdbdb('0x5'));var squel=require('squel');var Redis=require(_0xdbdb('0x6'));var db=require(_0xdbdb('0x7'))['db'];var config=require(_0xdbdb('0x8'));var shared=require(_0xdbdb('0x9'));var logger=require('../../../config/logger')(_0xdbdb('0xa'));config[_0xdbdb('0xb')]=_['defaults'](config['redis'],{'host':_0xdbdb('0xc'),'port':0x18eb});var socket=require(_0xdbdb('0xd'))(new Redis(config[_0xdbdb('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xdbdb('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xdbdb('0xf')](_0xdbdb('0xe'));function isEmail(_0x454e34){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))*$/[_0xdbdb('0x10')](_0x454e34);}function selectNotIn(_0x846d78,_0x441af6,_0x4641b6,_0x545060,_0x33219f){return squel[_0xdbdb('0x11')]()['field'](_0xdbdb('0x12'))[_0xdbdb('0x13')](_0x545060)['join'](_0x441af6,null,_0x441af6+_0xdbdb('0x14')+_0x545060+'.'+_0x4641b6)[_0xdbdb('0x15')](_0x545060+'.'+_0x4641b6+_0xdbdb('0x16')+_0x846d78+'.'+_0x4641b6)['where'](_0x441af6+'.dialCheckDuplicateType\x20IN\x20('+_0x33219f['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x38d149,_0x3f4b1e){promisesAdditionalPhones=[];return db[_0xdbdb('0x17')]['findAll']({'raw':!![],'attributes':['id',_0xdbdb('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x247ed5){if(_0x247ed5!==null){var _0x22e6f3=[];for(var _0x4cc13b=0x0;_0x4cc13b<_0x247ed5[_0xdbdb('0x19')];_0x4cc13b++){var _0x30bf1e=_0x247ed5[_0x4cc13b];_0x22e6f3[_0xdbdb('0x1a')](insertAdditionalPhones(_0x30bf1e));}}Promise['all'](_0x22e6f3)[_0xdbdb('0x1b')](function(){_0x38d149({'val':0x1});});});});}function insertAdditionalPhones(_0x5b8a9e){return new Promise(function(_0x52e646,_0x12f6db){var _0x112bd7=_0x5b8a9e[_0xdbdb('0x18')];var _0x215a19=_0x112bd7[_0xdbdb('0x1c')](';');var _0x1cfad8=[];orderBy=0x0;for(var _0xa277fe=0x0;_0xa277fe<_0x215a19['length'];_0xa277fe++){_0x1cfad8['push'](splitAdditionalPhone(_0x5b8a9e['id'],_0x215a19[_0xa277fe]));}Promise['all'](_0x1cfad8)[_0xdbdb('0x1b')](function(){_0x52e646({'val':_0x215a19[_0xdbdb('0x19')]});});});}function splitAdditionalPhone(_0x55e1e0,_0x41a3e9){return new Promise(function(_0x52f102,_0x265318){var _0x1b7c1b=_0x41a3e9['split'](':');var _0x5c93da=_0x1b7c1b[0x0];var _0x136719=_0x1b7c1b[0x1];if(!_[_0xdbdb('0x1d')](_0x136719)){var _0x4dcbb5=_0x136719['split']('|');var _0x25a83f=[];for(var _0x1fac83=0x0;_0x1fac83<_0x4dcbb5[_0xdbdb('0x19')];_0x1fac83++){if(_0x4dcbb5[_0x1fac83]!==''){var _0x1990af=_[_0xdbdb('0x1e')](promisesAdditionalPhones,{'contactId':_0x55e1e0,'phone':_0x4dcbb5[_0x1fac83]});if(_0x1990af[_0xdbdb('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xdbdb('0x1a')]({'contactId':_0x55e1e0,'contactTypeId':_0x5c93da,'phone':_0x4dcbb5[_0x1fac83],'orderBy':orderBy});}}}_0x52f102({'ok':0x1});}else _0x52f102({'res':0x0});});}function createAdditionalPhone(_0x1aae35,_0x5c50db,_0xa71d8a,_0x4090ac){var _0x5b9203='';var _0x5d320c='';var _0x51f8ca=_0xa71d8a[_0xdbdb('0x1c')]('§');_0x5b9203=_0x51f8ca[0x0];if(_0x51f8ca['length']==0x2)_0x5d320c=_0x51f8ca[0x1];return new Promise(function(_0xde87e8,_0x211cd4){return db['CmContactHasItem'][_0xdbdb('0x1f')]({'where':{'CmContactId':_0x1aae35,'item':_0x5b9203}})[_0xdbdb('0x1b')](function(_0x5e3465){if(_0x5e3465){return db[_0xdbdb('0x20')][_0xdbdb('0x21')]({'ItemTypeId':_0x5c50db,'description':_0x5d320c,'OrderBy':_0x4090ac},{'where':{'CmContactId':_0x1aae35,'item':_0x5b9203}})[_0xdbdb('0x1b')](function(_0xd3dd74){_0xde87e8({'res':_0xdbdb('0x22')});});}else{return db['CmContactHasItem'][_0xdbdb('0x23')]({'CmContactId':_0x1aae35,'item':_0x5b9203,'description':_0x5d320c,'ItemTypeId':_0x5c50db,'OrderBy':_0x4090ac,'ItemClass':_0xdbdb('0x24')})[_0xdbdb('0x1b')](function(_0x177b9f){_0xde87e8({'res':_0xdbdb('0x25')});});}});});}function insertCmHopper(_0x43b8f8,_0x4f273e,_0x445f87,_0x37294f,_0x30c45c){var _0x41bce3=['cm_contacts.phone','cm_contacts.scheduledat',_0xdbdb('0x26'),'cm_contacts.ListId',_0x4f273e+'.'+_0x37294f,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xdbdb('0x27'),_0xdbdb('0x28'),'\x22'+_0x30c45c+'\x22'];return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x2b'))[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2d'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x37294f,_0xdbdb('0x30'),_0xdbdb('0x31'),_0xdbdb('0x32'),_0xdbdb('0x33'),_0xdbdb('0x34')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x41bce3)[_0xdbdb('0x13')](_0x4f273e)['join']('cm_contacts',null,_0xdbdb('0x36')+_0x4f273e+_0xdbdb('0x37'))['join'](_0x445f87,null,_0x445f87+_0xdbdb('0x14')+_0x4f273e+'.'+_0x37294f)[_0xdbdb('0x15')](_0x4f273e+_0xdbdb('0x38'),_0x43b8f8)[_0xdbdb('0x15')](_0xdbdb('0x39'),NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),selectNotIn(_0x4f273e,_0x445f87,_0x37294f,_0xdbdb('0x2b'),['\x22always\x22',_0xdbdb('0x3b')]))[_0xdbdb('0x15')](_0xdbdb('0x3a'),selectNotIn(_0x4f273e,_0x445f87,_0x37294f,_0xdbdb('0x2b'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x318c48,_0x485f65,_0x15294b,_0x41c057){var _0x4f0a75=[_0xdbdb('0x3c'),'cm_contacts.id',_0xdbdb('0x3d'),_0x485f65+'.'+_0x41c057,_0xdbdb('0x3e'),_0xdbdb('0x3f')];return squel['insert']()[_0xdbdb('0x2a')]('cm_hopper_black')[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x41c057,_0xdbdb('0x30'),_0xdbdb('0x31')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x4f0a75)[_0xdbdb('0x13')](_0x485f65)[_0xdbdb('0x40')](_0xdbdb('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x485f65+_0xdbdb('0x37'))['join'](_0x15294b,null,_0x15294b+_0xdbdb('0x14')+_0x485f65+'.'+_0x41c057)['where'](_0x485f65+_0xdbdb('0x38'),_0x318c48)['where'](_0xdbdb('0x39'),NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),squel[_0xdbdb('0x11')]()[_0xdbdb('0x42')]('phone')[_0xdbdb('0x13')](_0xdbdb('0x43'))['where']('ListId\x20=\x20?',_0x318c48)[_0xdbdb('0x15')](_0x41c057+'\x20=\x20'+_0x485f65+'.'+_0x41c057)))[_0xdbdb('0x44')]();}function insertTzCmHopper(_0x5f082b,_0x2cc3de,_0x3b0152,_0x464d99,_0x5c81b4,_0x37a70b){var _0x5bd491=[_0xdbdb('0x3c'),_0xdbdb('0x45')+_0x37a70b+_0xdbdb('0x46'),_0xdbdb('0x26'),_0xdbdb('0x3d'),_0x2cc3de+'.'+_0x464d99,_0xdbdb('0x3e'),_0xdbdb('0x3f'),_0xdbdb('0x27'),_0xdbdb('0x28'),'\x22'+_0x5c81b4+'\x22'];var _0x10b7e3=squel['insert']()['into']('cm_hopper')[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2d'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x464d99,_0xdbdb('0x30'),_0xdbdb('0x31'),_0xdbdb('0x32'),_0xdbdb('0x33'),_0xdbdb('0x34')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x5bd491)[_0xdbdb('0x13')](_0x2cc3de)[_0xdbdb('0x40')](_0xdbdb('0x41'),null,_0xdbdb('0x36')+_0x2cc3de+_0xdbdb('0x37'))['join'](_0x3b0152,null,_0x3b0152+_0xdbdb('0x14')+_0x2cc3de+'.'+_0x464d99)['join'](_0x37a70b,null,_0x37a70b+_0xdbdb('0x14')+_0x2cc3de+'.'+_0x464d99)[_0xdbdb('0x15')](_0x2cc3de+_0xdbdb('0x38'),_0x5f082b)[_0xdbdb('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),selectNotIn(_0x2cc3de,_0x3b0152,_0x464d99,_0xdbdb('0x2b'),[_0xdbdb('0x47'),'\x22onlyIfOpen\x22']))['where'](_0xdbdb('0x3a'),selectNotIn(_0x2cc3de,_0x3b0152,_0x464d99,_0xdbdb('0x2b'),[_0xdbdb('0x47')])))['toString']();return _0x10b7e3;}function insertTzCmHopperBlack(_0x1d9792,_0x59bdc9,_0x5d4f45,_0x4cd149){var _0x492a63=[_0xdbdb('0x3c'),'cm_contacts.id',_0xdbdb('0x3d'),_0x59bdc9+'.'+_0x4cd149,_0xdbdb('0x3e'),_0xdbdb('0x3f')];return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x43'))[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x4cd149,'createdAt',_0xdbdb('0x31')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x492a63)['from'](_0x59bdc9)[_0xdbdb('0x40')](_0xdbdb('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x59bdc9+'.CmListId')['join'](_0x5d4f45,null,_0x5d4f45+_0xdbdb('0x14')+_0x59bdc9+'.'+_0x4cd149)[_0xdbdb('0x15')](_0x59bdc9+'.CmListId\x20=\x20?',_0x1d9792)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),squel[_0xdbdb('0x11')]()[_0xdbdb('0x42')](_0xdbdb('0x12'))[_0xdbdb('0x13')]('cm_hopper_black')[_0xdbdb('0x15')]('ListId\x20=\x20?',_0x1d9792)['where'](_0x4cd149+_0xdbdb('0x16')+_0x59bdc9+'.'+_0x4cd149)))['toString']();}function insertCmHopperAdditionalPhones(_0x15a571){var _0x110093=[_0xdbdb('0x48'),'cm_contact_has_items.item',_0xdbdb('0x49'),_0xdbdb('0x4a'),'cm_contact_has_items.updatedAt'];return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x4b'))[_0xdbdb('0x2c')]([_0xdbdb('0x4c'),_0xdbdb('0x12'),'OrderBy',_0xdbdb('0x30'),'updatedAt'],squel[_0xdbdb('0x11')]()['fields'](_0x110093)[_0xdbdb('0x13')](_0xdbdb('0x2b'))[_0xdbdb('0x40')](_0xdbdb('0x41'),null,_0xdbdb('0x4d'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xdbdb('0x15')](_0xdbdb('0x4e'),_0x15a571)[_0xdbdb('0x15')](_0xdbdb('0x39'),NOW))[_0xdbdb('0x44')]();}function insertCmContact(_0x401fc5,_0x9094bc,_0x580cbd,_0x4a7b57){var _0x4cd573=_['concat'](_['keys'](_0x4a7b57),[_0xdbdb('0x2f'),_0xdbdb('0x4f'),_0xdbdb('0x30'),_0xdbdb('0x31'),_0xdbdb('0x50')]);return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x41'))['fromQuery'](_0x4cd573,squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x4cd573)['from'](_0x9094bc)[_0xdbdb('0x15')]('('+_0x580cbd[_0xdbdb('0x40')](',')+_0xdbdb('0x51'),squel['select']()[_0xdbdb('0x35')](_0x580cbd)[_0xdbdb('0x13')](_0xdbdb('0x41'))['where'](_0xdbdb('0x52'),_0x401fc5)[_0xdbdb('0x15')](_0xdbdb('0x53')))[_0xdbdb('0x15')](_0xdbdb('0x54'),squel['select']()[_0xdbdb('0x42')](_0xdbdb('0x55'),_0xdbdb('0x56'))[_0xdbdb('0x13')](_0x9094bc)[_0xdbdb('0x57')](_0x580cbd[_0xdbdb('0x40')](','))))['toString']();}function handleStop(){logger[_0xdbdb('0x58')](_0xdbdb('0x59'));stopped=!![];}function handleUncaughtException(_0x52f1a1){logger[_0xdbdb('0x5a')](_0x52f1a1[_0xdbdb('0x5b')]);process[_0xdbdb('0x5c')](0x1);}function handleError(_0x5b2de6,_0x24bb9b){stats['errors']['push']({'name':_0x24bb9b[_0xdbdb('0x5d')],'message':_0x24bb9b['message'],'row':_0x5b2de6});}function handleQuery(_0xfb5642){logger[_0xdbdb('0x58')](_0xfb5642);return db['sequelize'][_0xdbdb('0x5e')](_0xfb5642)[_0xdbdb('0x5f')](function(_0x3410f0){results[_0xdbdb('0x1a')](_0x3410f0);})[_0xdbdb('0x60')](function(_0x1eb920){logger[_0xdbdb('0x5a')](_0x1eb920['message']);});}function updateTzCampaigns(_0x2901db){return new Promise(function(_0x95ebe3,_0x391883){var _0x211054=squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](['campaigns.id',_0xdbdb('0x61')])[_0xdbdb('0x13')](_0xdbdb('0x62'))['join'](_0xdbdb('0x63'),null,_0xdbdb('0x64'))[_0xdbdb('0x15')]('campaigns_has_cm_lists.CmListId='+_0x2901db);db['sequelize'][_0xdbdb('0x5e')](_0x211054[_0xdbdb('0x44')]())[_0xdbdb('0x5f')](function(_0x27972b){var _0x13fce8=[];for(var _0x4869d7=0x0;_0x4869d7<_0x27972b[_0xdbdb('0x19')];_0x4869d7++){_0x13fce8[_0xdbdb('0x1a')](getTimezoneData(_0x27972b[_0x4869d7],tmp_campaigns));}BPromise[_0xdbdb('0x65')](_0x13fce8)[_0xdbdb('0x1b')](function(){_0x95ebe3({'val':0x1});});})[_0xdbdb('0x60')](function(_0x337fc2){logger[_0xdbdb('0x5a')](_0x337fc2[_0xdbdb('0x5b')]);_0x95ebe3({'val':0x0});});});}function updateTzVoiceQueues(_0x5887d9){return new Promise(function(_0x2dd964,_0xdbcb92){var _0xeaa370=squel['select']()[_0xdbdb('0x35')]([_0xdbdb('0x66'),_0xdbdb('0x67')])['from']('voice_queues')[_0xdbdb('0x40')](_0xdbdb('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xdbdb('0x15')](_0xdbdb('0x69')+_0x5887d9);db[_0xdbdb('0x6a')]['query'](_0xeaa370[_0xdbdb('0x44')]())['spread'](function(_0xb779d6){var _0x2aee36=[];for(var _0x5e4196=0x0;_0x5e4196<_0xb779d6['length'];_0x5e4196++){_0x2aee36[_0xdbdb('0x1a')](getTimezoneData(_0xb779d6[_0x5e4196],tmp_voice_queues));}BPromise[_0xdbdb('0x65')](_0x2aee36)[_0xdbdb('0x1b')](function(){_0x2dd964({'val':0x1});});})[_0xdbdb('0x60')](function(_0x40368c){logger['error'](_0x40368c[_0xdbdb('0x5b')]);_0x2dd964({'val':0x0});});});}function getTimezoneData(_0x290bfa,_0x3543c4){return new Promise(function(_0x558e79,_0x331644){var _0x584190=shared[_0xdbdb('0x6b')];var _0x296136=_0x584190[_0x290bfa[_0xdbdb('0x6c')]];if(_[_0xdbdb('0x1d')](_0x296136)){_0x558e79({'ret':0x1});}else{var _0x3114f9=_0x296136['utcOffset'];var _0x5a61ab=squel[_0xdbdb('0x29')]()['into'](_0x3543c4)[_0xdbdb('0x6d')]('id',_0x290bfa['id'])['set'](_0xdbdb('0x6e'),_0x3114f9)[_0xdbdb('0x6d')](_0xdbdb('0x6c'),_0x290bfa['dialTimezone'])[_0xdbdb('0x44')]();return db[_0xdbdb('0x6a')][_0xdbdb('0x5e')](_0x5a61ab)[_0xdbdb('0x5f')](function(_0x57faf9){_0x558e79({'ret':0x1});})[_0xdbdb('0x60')](function(_0x75394a){logger['error'](_0x75394a[_0xdbdb('0x5b')]);_0x331644({'ret':0x1});});}});}function handleTZQuery(_0x26495c){logger[_0xdbdb('0x58')](_0x26495c);return db[_0xdbdb('0x6a')]['query'](_0x26495c)[_0xdbdb('0x5f')](function(_0x5b9389){})[_0xdbdb('0x60')](function(_0x88478d){logger[_0xdbdb('0x5a')](_0x88478d[_0xdbdb('0x5b')]);});}function main(_0x39b998,_0x4a54f5,_0x466b38,_0x344a74){logger[_0xdbdb('0x58')](_0xdbdb('0x6f'),_0x39b998,JSON[_0xdbdb('0x70')](_0x4a54f5));process[_0xdbdb('0x71')](_0xdbdb('0x72'));var _0x3aa6e5=_0x4a54f5[_0xdbdb('0x73')];var _0x1b0c92=_[_0xdbdb('0x74')](_0x3aa6e5);var _0x22684f=_0x4a54f5['socket_timestamp'];var _0x43807e=path[_0xdbdb('0x40')](config['root'],_0xdbdb('0x75'),_0x22684f+_0xdbdb('0x76'));hasTZ=_[_0xdbdb('0x77')](_0x3aa6e5)[_0xdbdb('0x78')]('dialTimezone');var _0x15f7b6=_['keys'](_0x3aa6e5)[_0xdbdb('0x40')]();logger[_0xdbdb('0x58')]('header',_0x15f7b6);db['ContactItemType'][_0xdbdb('0x79')]({'raw':!![],'attributes':['id',_0xdbdb('0x7a')]})[_0xdbdb('0x1b')](function(_0x1de159){for(var _0x246dd3=0x0;_0x246dd3<_0x1de159['length'];_0x246dd3++){if(_0x1de159[_0x246dd3][_0xdbdb('0x7a')]in _0x3aa6e5){contactItemTypes[_0xdbdb('0x1a')](_0x1de159[_0x246dd3]);delete _0x1b0c92[_0x1de159[_0x246dd3][_0xdbdb('0x7a')]];hasAdditionalPhones=!![];}for(var _0x55638b in _0x3aa6e5){if(_0x1de159[_0x246dd3][_0xdbdb('0x7a')]+_0xdbdb('0x7b')===_0x55638b){phoneDescriptions[_0xdbdb('0x1a')]({'itemTypeId':_0x1de159[_0x246dd3]['id'],'description':_0x55638b});delete _0x1b0c92[_0x55638b];}}}if(hasAdditionalPhones)_0x1b0c92['AdditionalPhones']='';var _0xf0dfcc=_['keys'](_0x1b0c92)['join']();logger[_0xdbdb('0x58')]('header',_0xf0dfcc);fs['writeFileSync'](_0x43807e,_0xf0dfcc+'\x0a');Papa[_0xdbdb('0x7c')](fs[_0xdbdb('0x7d')](_0x39b998),{'header':!![],'skipEmptyLines':!![],'step':function(_0x32dcdf,_0x305608){try{for(var _0x38987b=0x0,_0x5668ea=[];_0x38987b<_0x32dcdf['data'][_0xdbdb('0x19')];_0x38987b++){stats['rows']+=0x1;if(_0x32dcdf['errors'][_0x38987b]){handleError(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b],_0x32dcdf[_0xdbdb('0x7f')][_0x38987b]);}else{var _0x624eb8=[];var _0x137a37=[];var _0x33e37d={};for(var _0x3fa08d in _0x3aa6e5){let _0x291413=contactItemTypes['find'](_0x5e1915=>_0x5e1915['name']===_0x3fa08d);let _0x51f8ef=contactItemTypes[_0xdbdb('0x80')](_0x27d574=>_0x27d574[_0xdbdb('0x7a')]+'_description'===_0x3fa08d);if(_['isNil'](_0x291413)&&_[_0xdbdb('0x1d')](_0x51f8ef)){if(_0x3aa6e5[_0xdbdb('0x81')](_0x3fa08d)){if(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x3fa08d]]){var _0x52a5b5=_['trim'](_0x32dcdf['data'][_0x38987b][_0x3aa6e5[_0x3fa08d]]['replace'](/"/g,'\x27'));switch(_0x3fa08d){case'scheduledat':var _0x18c77b=moment(_0x52a5b5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x18c77b[_0xdbdb('0x82')]()){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x52a5b5+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')](_0xdbdb('0x83'));}break;case _0xdbdb('0x32'):var _0x1ef1a5=parseInt(_0x52a5b5);_0x52a5b5=_[_0xdbdb('0x84')](_0x1ef1a5)||_0x1ef1a5<0x0||_0x1ef1a5>0x4?_0x344a74?0x3:0x2:_0x1ef1a5;_0x5668ea['push']('\x22'+_0x52a5b5+'\x22');break;case _0xdbdb('0x33'):var _0x1e01af=parseInt(_0x52a5b5);if(_[_0xdbdb('0x85')](_0x1e01af)&&_[_0xdbdb('0x78')](_0x466b38,_0x1e01af)){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x1e01af+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')](_0xdbdb('0x86'));}break;case _0xdbdb('0x87'):if(isEmail(_0x52a5b5)){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x52a5b5+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')](_0xdbdb('0x88'));}break;case _0xdbdb('0x89'):var _0x7f47df=moment(_0x52a5b5,_0xdbdb('0x8a'),!![]);if(_0x7f47df[_0xdbdb('0x82')]()){_0x5668ea['push']('\x22'+_0x52a5b5+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xdbdb('0x6c'):var _0x5cff4f=shared[_0xdbdb('0x6b')];var _0x566256=_0x5cff4f[_0x52a5b5];if(!_[_0xdbdb('0x1d')](_0x566256)){var _0x1fb8a4=_0x566256[_0xdbdb('0x8b')];_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x52a5b5+'\x22');_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x1fb8a4+'\x22');}break;default:_0x5668ea['push']('\x22'+_0x52a5b5+'\x22');}}else{switch(_0x3fa08d){case _0xdbdb('0x8c'):case _0xdbdb('0x12'):_0x624eb8[_0xdbdb('0x1a')](_0x3fa08d+_0xdbdb('0x8d'));break;default:_0x5668ea[_0xdbdb('0x1a')]('\x22\x22');}}}}else{var _0x1be028='';if(!_['isNil'](_0x291413)){if(!_0x33e37d[_0xdbdb('0x81')](_0x291413['id'])){if(!_['isNil'](_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x3fa08d]])){var _0x52a5b5=_[_0xdbdb('0x8e')](_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x3fa08d]][_0xdbdb('0x8f')](/"/g,'\x27'));var _0x1b001a=phoneDescriptions['find'](_0x23885c=>_0x23885c[_0xdbdb('0x90')]===_0x291413['id']);if(!_[_0xdbdb('0x1d')](_0x1b001a)){var _0x52bf52=_[_0xdbdb('0x8e')](_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x1b001a[_0xdbdb('0x91')]]]['replace'](/"/g,'\x27'));if(!_[_0xdbdb('0x1d')](_0x52bf52))_0x52a5b5=_0x52a5b5+'§'+_0x52bf52;}if(_0x1be028=='')_0x1be028=_0x52a5b5;else _0x1be028+='|'+_0x52a5b5;}_0x137a37[_0xdbdb('0x1a')](_0x291413['id']+':'+_0x1be028);_0x33e37d[_0x291413['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x137a37[_0xdbdb('0x40')](';')+'\x22');}if(_0x624eb8[_0xdbdb('0x19')]){handleError(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b],{'code':'SystemRow','message':_0x624eb8[_0xdbdb('0x40')]()});}else{fs['appendFileSync'](_0x43807e,_0x5668ea[_0xdbdb('0x40')]()+'\x0a');}_0x5668ea=[];}if(!(stats[_0xdbdb('0x92')]%0xc8)){socket[_0xdbdb('0x93')](_0xdbdb('0x94')+_0x22684f,stats);stats[_0xdbdb('0x7f')]=[];}}if(stopped){logger[_0xdbdb('0x58')](_0xdbdb('0x95'));_0x305608[_0xdbdb('0x96')]();}}catch(_0x3a5377){handleError(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b],{'code':_0xdbdb('0x97'),'message':_0x3a5377[_0xdbdb('0x5b')]});logger['error'](_0xdbdb('0x98'),_0x3a5377[_0xdbdb('0x5b')]);}},'complete':function(){try{var _0x4a8c62=[];var _0x2dea07=[];var _0x289a9a='cm_contacts';if(_0x4a54f5[_0xdbdb('0x99')]&&_0x4a54f5[_0xdbdb('0x99')][_0xdbdb('0x19')]){_0x289a9a=_0xdbdb('0x9a')+_0x22684f;_0x4a8c62[_0xdbdb('0x1a')]('CREATE\x20TABLE\x20'+_0x289a9a+_0xdbdb('0x9b'));}tmp_campaigns=_0xdbdb('0x9c')+_0x22684f;tmp_voice_queues=_0xdbdb('0x9d')+_0x22684f;_0x2dea07[_0xdbdb('0x1a')](_0xdbdb('0x9e')+tmp_campaigns+_0xdbdb('0x9f'));_0x2dea07[_0xdbdb('0x1a')](_0xdbdb('0x9e')+tmp_voice_queues+_0xdbdb('0x9f'));BPromise['each'](_0x2dea07,handleTZQuery)[_0xdbdb('0x1b')](function(_0x5f38ab){updateTzCampaigns(_0x4a54f5[_0xdbdb('0x2f')])[_0xdbdb('0x1b')](function(_0x38dc5d){updateTzVoiceQueues(_0x4a54f5[_0xdbdb('0x2f')])[_0xdbdb('0x1b')](function(_0x456d58){if(hasTZ)_0xf0dfcc=_0xf0dfcc['replace'](_0xdbdb('0x6c'),_0xdbdb('0xa0'));var _0x577762=util[_0xdbdb('0xf')](_0xdbdb('0xa1'),_0x43807e,_0x289a9a,_0xf0dfcc,_0x4a54f5[_0xdbdb('0x2f')],_0x4a54f5[_0xdbdb('0x4f')]||null,NOW,NOW);if(_[_0xdbdb('0x1d')](_0x3aa6e5[_0xdbdb('0x2d')])){_0x577762+=',\x20scheduledAt\x20=\x20NOW()';}_0x4a8c62[_0xdbdb('0x1a')](_0x577762);if(_0x4a54f5[_0xdbdb('0x99')]&&_0x4a54f5[_0xdbdb('0x99')]['length']){_0x4a8c62[_0xdbdb('0x1a')](insertCmContact(_0x4a54f5[_0xdbdb('0x2f')],_0x289a9a,_0x4a54f5[_0xdbdb('0x99')],_0x3aa6e5));_0x4a8c62[_0xdbdb('0x1a')]('DROP\x20TABLE\x20'+_0x289a9a+';');}BPromise['each'](_0x4a8c62,handleQuery)[_0xdbdb('0x1b')](function(_0x897134){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x4a8c62=[];for(var _0x48fb8d=0x0;_0x48fb8d_0x1d0e29[_0x9896('0x68')]===_0x24f891);let _0x38c331=contactItemTypes['find'](_0x351561=>_0x351561[_0x9896('0x68')]+'_description'===_0x24f891);if(_['isNil'](_0x53ef6e)&&_['isNil'](_0x38c331)){if(_0x5b1fb3[_0x9896('0x6f')](_0x24f891)){if(_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0x24f891]]){var _0x4ce4ad=_[_0x9896('0x70')](_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0x24f891]][_0x9896('0x71')](/"/g,'\x27'));switch(_0x24f891){case _0x9896('0x72'):var _0x24ef6d=moment(_0x4ce4ad,_0x9896('0xd'),!![]);if(_0x24ef6d[_0x9896('0x73')]()){_0x3e8adc['push']('\x22'+_0x4ce4ad+'\x22');}else{_0x4b89b6[_0x9896('0x1c')](_0x9896('0x74'));}break;case _0x9896('0x37'):var _0x1ec533=parseInt(_0x4ce4ad);_0x4ce4ad=_[_0x9896('0x75')](_0x1ec533)||_0x1ec533<0x0||_0x1ec533>0x4?_0x11dcb5?0x3:0x2:_0x1ec533;_0x3e8adc[_0x9896('0x1c')]('\x22'+_0x4ce4ad+'\x22');break;case'UserId':var _0x72a512=parseInt(_0x4ce4ad);if(_[_0x9896('0x76')](_0x72a512)&&_['includes'](_0x19fd16,_0x72a512)){_0x3e8adc['push']('\x22'+_0x72a512+'\x22');}else{_0x4b89b6['push'](_0x9896('0x77'));}break;case _0x9896('0x78'):if(isEmail(_0x4ce4ad)){_0x3e8adc['push']('\x22'+_0x4ce4ad+'\x22');}else{_0x4b89b6[_0x9896('0x1c')](_0x9896('0x79'));}break;case _0x9896('0x7a'):var _0x25a455=moment(_0x4ce4ad,_0x9896('0x7b'),!![]);if(_0x25a455[_0x9896('0x73')]()){_0x3e8adc[_0x9896('0x1c')]('\x22'+_0x4ce4ad+'\x22');}else{_0x4b89b6[_0x9896('0x1c')](_0x9896('0x7c'));}break;default:_0x3e8adc['push']('\x22'+_0x4ce4ad+'\x22');}}else{switch(_0x24f891){case'firstName':case _0x9896('0x1a'):_0x4b89b6['push'](_0x24f891+'\x20not\x20specified');break;default:_0x3e8adc[_0x9896('0x1c')]('\x22\x22');}}}}else{var _0x27c380='';if(!_[_0x9896('0x19')](_0x53ef6e)){if(!_0x35b6b0[_0x9896('0x6f')](_0x53ef6e['id'])){for(var _0x38a569=0x0;_0x38a569<_0x5b1fb3[_0x24f891]['length'];_0x38a569++){var _0x4ce4ad=_[_0x9896('0x70')](_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0x24f891][_0x38a569]][_0x9896('0x71')](/"/g,'\x27'));var _0xef1815=phoneDescriptions[_0x9896('0x7d')](_0x31c8e0=>_0x31c8e0[_0x9896('0x7e')]===_0x53ef6e['id']);if(!_[_0x9896('0x19')](_0xef1815)){var _0x320ca8=_[_0x9896('0x70')](_0x32d1c1[_0x9896('0x6e')][_0x59fd1d][_0x5b1fb3[_0xef1815[_0x9896('0x7f')]][0x0]][_0x9896('0x71')](/"/g,'\x27'));if(!_[_0x9896('0x19')](_0x320ca8))_0x4ce4ad=_0x4ce4ad+'§'+_0x320ca8;}if(_0x27c380=='')_0x27c380=_0x4ce4ad;else _0x27c380+='|'+_0x4ce4ad;}_0xc35e4f[_0x9896('0x1c')](_0x53ef6e['id']+':'+_0x27c380);_0x35b6b0[_0x53ef6e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3e8adc['push']('\x22'+_0xc35e4f[_0x9896('0x11')](';')+'\x22');}if(_0x4b89b6['length']){handleError(_0x32d1c1['data'][_0x59fd1d],{'code':_0x9896('0x80'),'message':_0x4b89b6[_0x9896('0x11')]()});}else{fs[_0x9896('0x81')](_0xb02941,_0x3e8adc['join']()+'\x0a');}_0x3e8adc=[];}if(!(stats[_0x9896('0x82')]%0xc8)){socket['emit'](_0x9896('0x83')+_0x1785c1,stats);stats[_0x9896('0x59')]=[];}}if(stopped){logger[_0x9896('0x5b')]('Abort\x20parser');_0x2c19f8[_0x9896('0x84')]();}}catch(_0x53b2f1){handleError(_0x32d1c1[_0x9896('0x6e')][_0x59fd1d],{'code':_0x9896('0x85'),'message':_0x53b2f1[_0x9896('0x20')]});logger[_0x9896('0x1f')](_0x9896('0x86'),_0x53b2f1[_0x9896('0x20')]);}},'complete':function(){try{var _0x5bd7a1=[];var _0x545895=tempTableName;_0x5bd7a1[_0x9896('0x1c')](_0x9896('0x87')+_0x545895+_0x9896('0x88'));logger['info']('CIS\x20len',contactItemTypes[_0x9896('0x18')]);var _0x2cd9b7=util[_0x9896('0xc')](_0x9896('0x89'),_0xb02941,_0x545895,_0x298344,_0x5d1c3c[_0x9896('0x45')],_0x5d1c3c[_0x9896('0x54')]||null,NOW,NOW);if(_['isNil'](_0x5b1fb3['scheduledat'])){_0x2cd9b7+=_0x9896('0x8a');}_0x5bd7a1[_0x9896('0x1c')](_0x2cd9b7);BPromise[_0x9896('0x8b')](_0x5bd7a1,handleQuery)[_0x9896('0x1d')](function(_0x1737ba){BPromise[_0x9896('0x22')]([handleAdditionalPhones()])[_0x9896('0x1d')](function(){_0x5bd7a1=[];for(var _0x5d2e33=0x0;_0x5d2e33\x20\x20');}var _0x1a4dff=path[_0x9896('0x11')](config[_0x9896('0x63')],_0x9896('0x64'),process['argv'][0x2]);if(!fs[_0x9896('0x95')](_0x1a4dff)){throw new Error(_0x9896('0x96'));}var _0x4e431d={};try{_0x4e431d=JSON[_0x9896('0x6d')](process[_0x9896('0x94')][0x3]);if(!_0x4e431d[_0x9896('0x60')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x241d82=0x0;if(_0x4e431d[_0x9896('0x60')][_0x9896('0x38')]){_0x241d82=0x1;}if(!_0x4e431d[_0x9896('0x45')]){throw new Error(_0x9896('0x97'));}}catch(_0x4f1e59){throw new Error('body\x20id\x20mandatory');}var _0x30d5b0=[];try{_0x30d5b0=_['map'](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x4db47a){logger[_0x9896('0x5b')]('No\x20agent\x20available');}main(_0x1a4dff,_0x4e431d,_0x30d5b0,_0x241d82);}validate();process['on'](_0x9896('0x98'),handleStop);process['on'](_0x9896('0x99'),handleUncaughtException); \ No newline at end of file +var _0xddb8=['clone','socket_timestamp','root','server/files/tmp','body','ContactItemType','name','_description','header','writeFileSync','parse','createReadStream','rows','errors','data','find','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','replace','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','step','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','then','catch','error','message','split','length','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','createdAt','updatedAt','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','exit','info','main','stringify','send','binding'];(function(_0x11755c,_0x37e0b4){var _0xa12c69=function(_0x180a50){while(--_0x180a50){_0x11755c['push'](_0x11755c['shift']());}};_0xa12c69(++_0x37e0b4);}(_0xddb8,0xd7));var _0x8ddb=function(_0x4b5168,_0xa0f560){_0x4b5168=_0x4b5168-0x0;var _0x17b084=_0xddb8[_0x4b5168];return _0x17b084;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8ddb('0x0'));var Papa=require(_0x8ddb('0x1'));var util=require(_0x8ddb('0x2'));var BPromise=require('bluebird');var moment=require(_0x8ddb('0x3'));var squel=require(_0x8ddb('0x4'));var Redis=require(_0x8ddb('0x5'));var db=require(_0x8ddb('0x6'))['db'];var config=require(_0x8ddb('0x7'));var logger=require(_0x8ddb('0x8'))('import');config['redis']=_[_0x8ddb('0x9')](config[_0x8ddb('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ddb('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()[_0x8ddb('0xb')](_0x8ddb('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0x8ddb('0xb')](_0x8ddb('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x24d7af){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))*$/[_0x8ddb('0xe')](_0x24d7af);}function selectNotIn(_0x258ac4,_0x53173f,_0x3d19c1,_0x387ef3,_0x58e732){return squel[_0x8ddb('0xf')]()[_0x8ddb('0x10')](_0x8ddb('0x11'))[_0x8ddb('0x12')](_0x387ef3)[_0x8ddb('0x13')](_0x53173f,null,_0x53173f+_0x8ddb('0x14')+_0x387ef3+'.'+_0x3d19c1)[_0x8ddb('0x15')](_0x387ef3+'.'+_0x3d19c1+_0x8ddb('0x16')+_0x258ac4+'.'+_0x3d19c1)[_0x8ddb('0x15')](_0x53173f+'.dialCheckDuplicateType\x20IN\x20('+_0x58e732[_0x8ddb('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x33a599,_0xd76b91){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8ddb('0x17')][_0x8ddb('0x18')](_0x8ddb('0x19')+tempTableName)[_0x8ddb('0x1a')](function(_0x799e41){if(_0x799e41!==null){var _0x584076=[];for(var _0x1b3fa7=0x0;_0x1b3fa7<_0x799e41['length'];_0x1b3fa7++){var _0x337ae7=_0x799e41[_0x1b3fa7];if(!_[_0x8ddb('0x1b')](_0x337ae7[_0x8ddb('0x11')])){if(!_['isNil'](_0x337ae7[_0x8ddb('0x1c')]))_0x584076[_0x8ddb('0x1d')](insertAdditionalPhones(_0x337ae7));promisesContact[_0x8ddb('0x1d')]({'contact':_0x337ae7});}}}Promise[_0x8ddb('0x1e')](_0x584076)[_0x8ddb('0x1f')](function(){_0x33a599({'val':0x1});});})[_0x8ddb('0x20')](function(_0x250281){logger[_0x8ddb('0x21')](_0x250281[_0x8ddb('0x22')]);});});}function insertAdditionalPhones(_0x170885){return new Promise(function(_0x56068e,_0x5a96fd){var _0x2c3e01=_0x170885[_0x8ddb('0x1c')];if(_[_0x8ddb('0x1b')](_0x2c3e01))_0x5a96fd({'val':0x0});else{var _0x4f221d=_0x2c3e01[_0x8ddb('0x23')](';');var _0xedff9b=[];orderBy=0x0;for(var _0x482c2f=0x0;_0x482c2f<_0x4f221d['length'];_0x482c2f++){_0xedff9b[_0x8ddb('0x1d')](splitAdditionalPhone(_0x170885['id'],_0x4f221d[_0x482c2f]));}Promise[_0x8ddb('0x1e')](_0xedff9b)['then'](function(){_0x56068e({'val':_0x4f221d[_0x8ddb('0x24')]});});}});}function splitAdditionalPhone(_0x4ff99f,_0x3d02f8){return new Promise(function(_0x4f8789,_0x53b199){var _0x4880ce=_0x3d02f8[_0x8ddb('0x23')](':');var _0x1b0ade=_0x4880ce[0x0];var _0x2dc474=_0x4880ce[0x1];if(_0x2dc474!==''){var _0x153bf8=_0x2dc474[_0x8ddb('0x23')]('|');var _0x557295=[];for(var _0xb1f00a=0x0;_0xb1f00a<_0x153bf8[_0x8ddb('0x24')];_0xb1f00a++){if(_0x153bf8[_0xb1f00a]!==''){var _0x3c7622=_[_0x8ddb('0x25')](promisesAdditionalPhones,{'contactId':_0x4ff99f,'phone':_0x153bf8[_0xb1f00a]});if(_0x3c7622[_0x8ddb('0x24')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4ff99f,'contactTypeId':_0x1b0ade,'phone':_0x153bf8[_0xb1f00a],'orderBy':orderBy});}}}_0x4f8789({'ok':0x1});}else _0x4f8789({'res':0x0});});}function createAdditionalPhone(_0x1246e2,_0x5a6d96,_0x1e4625,_0x4c0281){var _0x5b080c='';var _0xea0f10='';var _0x41a45c=_0x1e4625[_0x8ddb('0x23')]('§');_0x5b080c=_0x41a45c[0x0];if(_0x41a45c[_0x8ddb('0x24')]==0x2)_0xea0f10=_0x41a45c[0x1];return new Promise(function(_0x24ed46,_0x1189f0){return db[_0x8ddb('0x26')][_0x8ddb('0x27')]({'where':{'CmContactId':_0x1246e2,'item':_0x5b080c}})[_0x8ddb('0x1f')](function(_0x56e987){if(_0x56e987){return db[_0x8ddb('0x26')][_0x8ddb('0x28')]({'ItemTypeId':_0x5a6d96,'description':_0xea0f10,'OrderBy':_0x4c0281},{'where':{'CmContactId':_0x1246e2,'item':_0x5b080c}})['then'](function(_0x46f47a){_0x24ed46({'res':_0x8ddb('0x29')});});}else{return db[_0x8ddb('0x26')][_0x8ddb('0x2a')]({'CmContactId':_0x1246e2,'item':_0x5b080c,'ItemTypeId':_0x5a6d96,'description':_0xea0f10,'OrderBy':_0x4c0281,'ItemClass':_0x8ddb('0x2b')})[_0x8ddb('0x1f')](function(_0x5b9f8b){_0x24ed46({'res':_0x8ddb('0x2c')});});}});});}function updateContact(_0x23db4d){return new Promise(function(_0x4dd2af,_0x104840){var _0x4e5796=_0x23db4d['id'];delete _0x23db4d['id'];return db['CmContact'][_0x8ddb('0x28')](_0x23db4d,{'where':{'id':_0x4e5796}})['then'](function(_0x5ec30c){updatedRows+=0x1;return db[_0x8ddb('0x2d')]['update']({'phone':_0x23db4d['phone']},{'where':{'ContactId':_0x4e5796}})[_0x8ddb('0x1f')](function(_0x85229){_0x4dd2af({'ret':'OK'});});});});}function insertCmHopper(_0x50f960,_0x116c06,_0x4796cc,_0x4356a6,_0x44dda8){var _0x5aed16=[_0x8ddb('0x2e'),'cm_contacts.scheduledat',_0x8ddb('0x2f'),_0x8ddb('0x30'),_0x116c06+'.'+_0x4356a6,_0x8ddb('0x31'),_0x8ddb('0x32'),_0x8ddb('0x33'),_0x8ddb('0x34'),'\x22'+_0x44dda8+'\x22'];return squel[_0x8ddb('0x35')]()[_0x8ddb('0x36')]('cm_hopper')[_0x8ddb('0x37')]([_0x8ddb('0x11'),_0x8ddb('0x38'),_0x8ddb('0x39'),_0x8ddb('0x3a'),_0x4356a6,'createdAt','updatedAt',_0x8ddb('0x3b'),'UserId',_0x8ddb('0x3c')],squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x5aed16)[_0x8ddb('0x12')](_0x116c06)[_0x8ddb('0x13')](_0x8ddb('0x3e'),null,_0x8ddb('0x3f')+_0x116c06+_0x8ddb('0x40'))[_0x8ddb('0x13')](_0x4796cc,null,_0x4796cc+'.id\x20=\x20'+_0x116c06+'.'+_0x4356a6)[_0x8ddb('0x15')](_0x116c06+_0x8ddb('0x41'),_0x50f960)['where'](_0x8ddb('0x42'),NOW)[_0x8ddb('0x15')](_0x8ddb('0x43'),selectNotIn(_0x116c06,_0x4796cc,_0x4356a6,_0x8ddb('0x44'),[_0x8ddb('0x45'),_0x8ddb('0x46')]))[_0x8ddb('0x15')](_0x8ddb('0x43'),selectNotIn(_0x116c06,_0x4796cc,_0x4356a6,_0x8ddb('0x44'),['\x22always\x22'])))[_0x8ddb('0x47')]();}function insertCmHopperBlack(_0x483fb7,_0x2bc5a5,_0x55bf17,_0xc51d5a){var _0x5cc1c9=[_0x8ddb('0x2e'),'cm_contacts.id',_0x8ddb('0x30'),_0x2bc5a5+'.'+_0xc51d5a,_0x8ddb('0x31'),_0x8ddb('0x32')];return squel[_0x8ddb('0x35')]()['into'](_0x8ddb('0x48'))[_0x8ddb('0x37')](['phone','ContactId',_0x8ddb('0x3a'),_0xc51d5a,_0x8ddb('0x49'),_0x8ddb('0x4a')],squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x5cc1c9)[_0x8ddb('0x12')](_0x2bc5a5)[_0x8ddb('0x13')](_0x8ddb('0x3e'),null,_0x8ddb('0x3f')+_0x2bc5a5+_0x8ddb('0x40'))[_0x8ddb('0x13')](_0x55bf17,null,_0x55bf17+_0x8ddb('0x14')+_0x2bc5a5+'.'+_0xc51d5a)[_0x8ddb('0x15')](_0x2bc5a5+_0x8ddb('0x41'),_0x483fb7)[_0x8ddb('0x15')](_0x8ddb('0x42'),NOW)[_0x8ddb('0x15')](_0x8ddb('0x43'),squel[_0x8ddb('0xf')]()[_0x8ddb('0x10')]('phone')[_0x8ddb('0x12')](_0x8ddb('0x48'))[_0x8ddb('0x15')](_0x8ddb('0x4b'),_0x483fb7)[_0x8ddb('0x15')](_0xc51d5a+_0x8ddb('0x4c'),_0x2bc5a5+'.'+_0xc51d5a)))[_0x8ddb('0x47')]();}function insertCmHopperAdditionalPhones(_0x5dd670){var _0xd619b6=[_0x8ddb('0x4d'),'cm_contact_has_items.item',_0x8ddb('0x4e'),_0x8ddb('0x4f'),_0x8ddb('0x50')];return squel[_0x8ddb('0x35')]()['into'](_0x8ddb('0x51'))['fromQuery']([_0x8ddb('0x52'),_0x8ddb('0x11'),_0x8ddb('0x53'),_0x8ddb('0x49'),_0x8ddb('0x4a')],squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0xd619b6)[_0x8ddb('0x12')](_0x8ddb('0x44'))[_0x8ddb('0x13')](_0x8ddb('0x3e'),null,_0x8ddb('0x54'))['join'](_0x8ddb('0x55'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x8ddb('0x15')](_0x8ddb('0x56'),_0x5dd670)[_0x8ddb('0x15')](_0x8ddb('0x42'),NOW))[_0x8ddb('0x47')]();}function insertCmContact(_0x5bb8c6,_0x51c1d7,_0x46efd1,_0x366222){var _0x516542=_['concat'](_[_0x8ddb('0x57')](_0x366222),[_0x8ddb('0x3a'),'CompanyId',_0x8ddb('0x49'),_0x8ddb('0x4a')]);return squel[_0x8ddb('0x35')]()[_0x8ddb('0x36')](_0x8ddb('0x3e'))[_0x8ddb('0x37')](_0x516542,squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x516542)['from'](_0x51c1d7)[_0x8ddb('0x15')]('('+_0x46efd1[_0x8ddb('0x13')](',')+_0x8ddb('0x58'),squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x46efd1)[_0x8ddb('0x12')](_0x8ddb('0x3e'))[_0x8ddb('0x15')](_0x8ddb('0x4b'),_0x5bb8c6))[_0x8ddb('0x15')]('id\x20IN\x20?',squel[_0x8ddb('0xf')]()['field'](_0x8ddb('0x59'),_0x8ddb('0x5a'))[_0x8ddb('0x12')](_0x51c1d7)[_0x8ddb('0x5b')](_0x46efd1['join'](','))))['toString']();}function handleStop(){logger['info'](_0x8ddb('0x5c'));stopped=!![];}function handleUncaughtException(_0xe3d1b7){logger[_0x8ddb('0x21')](_0xe3d1b7[_0x8ddb('0x22')]);process[_0x8ddb('0x5d')](0x1);}function handleError(_0x49102b,_0x3c172b){stats['errors'][_0x8ddb('0x1d')]({'name':_0x3c172b['code'],'message':_0x3c172b[_0x8ddb('0x22')],'row':_0x49102b});}function handleQuery(_0x10c332){logger[_0x8ddb('0x5e')](_0x10c332);return db[_0x8ddb('0x17')][_0x8ddb('0x18')](_0x10c332)[_0x8ddb('0x1a')](function(_0x5bac08){results[_0x8ddb('0x1d')](_0x5bac08);})[_0x8ddb('0x20')](function(_0x1bd4fc){logger['error'](_0x1bd4fc['message']);});}function main(_0x1e15c3,_0x73e809,_0x84f32b,_0x2a59cc){logger[_0x8ddb('0x5e')](_0x8ddb('0x5f'),_0x1e15c3,JSON[_0x8ddb('0x60')](_0x73e809));process[_0x8ddb('0x61')]('start');var _0x5eb3cd=_0x73e809[_0x8ddb('0x62')];var _0x27baa3=_[_0x8ddb('0x63')](_0x5eb3cd);var _0x24953c=_0x73e809[_0x8ddb('0x64')];var _0x1320dc=path[_0x8ddb('0x13')](config[_0x8ddb('0x65')],_0x8ddb('0x66'),_0x24953c+'.csv');logger[_0x8ddb('0x5e')](_0x8ddb('0x67'),_0x73e809);db[_0x8ddb('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x8ddb('0x69')]})[_0x8ddb('0x1f')](function(_0x54ac83){for(var _0x24f8a8=0x0;_0x24f8a8<_0x54ac83[_0x8ddb('0x24')];_0x24f8a8++){if(_0x54ac83[_0x24f8a8][_0x8ddb('0x69')]in _0x5eb3cd){contactItemTypes[_0x8ddb('0x1d')](_0x54ac83[_0x24f8a8]);delete _0x27baa3[_0x54ac83[_0x24f8a8][_0x8ddb('0x69')]];hasAdditionalPhones=!![];}for(var _0xb491dc in _0x5eb3cd){if(_0x54ac83[_0x24f8a8][_0x8ddb('0x69')]+_0x8ddb('0x6a')===_0xb491dc){phoneDescriptions['push']({'itemTypeId':_0x54ac83[_0x24f8a8]['id'],'description':_0xb491dc});delete _0x27baa3[_0xb491dc];}}}if(hasAdditionalPhones)_0x27baa3[_0x8ddb('0x1c')]='';var _0x586e77=_['keys'](_0x27baa3)[_0x8ddb('0x13')]();logger['info'](_0x8ddb('0x6b'),_0x586e77);fs[_0x8ddb('0x6c')](_0x1320dc,_0x586e77+'\x0a');Papa[_0x8ddb('0x6d')](fs[_0x8ddb('0x6e')](_0x1e15c3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5026bb,_0x5a1b24){try{for(var _0x2190de=0x0,_0x467289=[];_0x2190de<_0x5026bb['data']['length'];_0x2190de++){stats[_0x8ddb('0x6f')]+=0x1;if(_0x5026bb[_0x8ddb('0x70')][_0x2190de]){handleError(_0x5026bb[_0x8ddb('0x71')][_0x2190de],_0x5026bb[_0x8ddb('0x70')][_0x2190de]);}else{var _0x29fd45=[];var _0xc70f75=[];var _0x3e86bf={};for(var _0x1d2b0e in _0x5eb3cd){let _0x372927=contactItemTypes[_0x8ddb('0x72')](_0x25c9c4=>_0x25c9c4[_0x8ddb('0x69')]===_0x1d2b0e);let _0x2342af=contactItemTypes[_0x8ddb('0x72')](_0x5c88c8=>_0x5c88c8[_0x8ddb('0x69')]+_0x8ddb('0x6a')===_0x1d2b0e);if(_[_0x8ddb('0x1b')](_0x372927)&&_[_0x8ddb('0x1b')](_0x2342af)){if(_0x5eb3cd['hasOwnProperty'](_0x1d2b0e)){if(_0x5026bb[_0x8ddb('0x71')][_0x2190de][_0x5eb3cd[_0x1d2b0e]]){var _0x806c4=_[_0x8ddb('0x73')](_0x5026bb[_0x8ddb('0x71')][_0x2190de][_0x5eb3cd[_0x1d2b0e]]['replace'](/"/g,'\x27'));switch(_0x1d2b0e){case _0x8ddb('0x38'):var _0x30c1a5=moment(_0x806c4,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x30c1a5[_0x8ddb('0x74')]()){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}else{_0x29fd45[_0x8ddb('0x1d')](_0x8ddb('0x75'));}break;case _0x8ddb('0x3b'):var _0x3874f2=parseInt(_0x806c4);_0x806c4=_[_0x8ddb('0x76')](_0x3874f2)||_0x3874f2<0x0||_0x3874f2>0x4?_0x2a59cc?0x3:0x2:_0x3874f2;_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');break;case _0x8ddb('0x77'):var _0x2d7975=parseInt(_0x806c4);if(_[_0x8ddb('0x78')](_0x2d7975)&&_[_0x8ddb('0x79')](_0x84f32b,_0x2d7975)){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x2d7975+'\x22');}else{_0x29fd45[_0x8ddb('0x1d')]('agent\x20not\x20exists');}break;case _0x8ddb('0x7a'):if(isEmail(_0x806c4)){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}else{_0x29fd45[_0x8ddb('0x1d')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x1f4712=moment(_0x806c4,_0x8ddb('0x7b'),!![]);if(_0x1f4712[_0x8ddb('0x74')]()){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}else{_0x29fd45['push'](_0x8ddb('0x7c'));}break;default:_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}}else{switch(_0x1d2b0e){case _0x8ddb('0x7d'):case _0x8ddb('0x11'):_0x29fd45['push'](_0x1d2b0e+_0x8ddb('0x7e'));break;default:_0x467289[_0x8ddb('0x1d')]('\x22\x22');}}}}else{var _0x451375='';if(!_[_0x8ddb('0x1b')](_0x372927)){if(!_0x3e86bf[_0x8ddb('0x7f')](_0x372927['id'])){for(var _0x1caee1=0x0;_0x1caee1<_0x5eb3cd[_0x1d2b0e][_0x8ddb('0x24')];_0x1caee1++){var _0x806c4=_[_0x8ddb('0x73')](_0x5026bb[_0x8ddb('0x71')][_0x2190de][_0x5eb3cd[_0x1d2b0e][_0x1caee1]][_0x8ddb('0x80')](/"/g,'\x27'));var _0x3b9c4e=phoneDescriptions[_0x8ddb('0x72')](_0x4fcbce=>_0x4fcbce[_0x8ddb('0x81')]===_0x372927['id']);if(!_['isNil'](_0x3b9c4e)){var _0x31e563=_[_0x8ddb('0x73')](_0x5026bb['data'][_0x2190de][_0x5eb3cd[_0x3b9c4e[_0x8ddb('0x82')]][0x0]][_0x8ddb('0x80')](/"/g,'\x27'));if(!_[_0x8ddb('0x1b')](_0x31e563))_0x806c4=_0x806c4+'§'+_0x31e563;}if(_0x451375=='')_0x451375=_0x806c4;else _0x451375+='|'+_0x806c4;}_0xc70f75[_0x8ddb('0x1d')](_0x372927['id']+':'+_0x451375);_0x3e86bf[_0x372927['id']]=0x1;}}}}if(hasAdditionalPhones){_0x467289[_0x8ddb('0x1d')]('\x22'+_0xc70f75[_0x8ddb('0x13')](';')+'\x22');}if(_0x29fd45[_0x8ddb('0x24')]){handleError(_0x5026bb[_0x8ddb('0x71')][_0x2190de],{'code':_0x8ddb('0x83'),'message':_0x29fd45['join']()});}else{fs[_0x8ddb('0x84')](_0x1320dc,_0x467289[_0x8ddb('0x13')]()+'\x0a');}_0x467289=[];}if(!(stats[_0x8ddb('0x6f')]%0xc8)){socket[_0x8ddb('0x85')](_0x8ddb('0x86')+_0x24953c,stats);stats[_0x8ddb('0x70')]=[];}}if(stopped){logger['info'](_0x8ddb('0x87'));_0x5a1b24['abort']();}}catch(_0x41f5f6){handleError(_0x5026bb[_0x8ddb('0x71')][_0x2190de],{'code':'SystemError','message':_0x41f5f6['message']});logger[_0x8ddb('0x21')](_0x8ddb('0x88'),_0x41f5f6[_0x8ddb('0x22')]);}},'complete':function(){try{var _0x1b59b5=[];var _0x2a6518=tempTableName;_0x1b59b5[_0x8ddb('0x1d')](_0x8ddb('0x89')+_0x2a6518+'\x20LIKE\x20cm_contacts;');logger[_0x8ddb('0x5e')]('CIS\x20len',contactItemTypes['length']);var _0x3948c8=util[_0x8ddb('0xb')](_0x8ddb('0x8a'),_0x1320dc,_0x2a6518,_0x586e77,_0x73e809[_0x8ddb('0x3a')],_0x73e809[_0x8ddb('0x8b')]||null,NOW,NOW);if(_[_0x8ddb('0x1b')](_0x5eb3cd[_0x8ddb('0x38')])){_0x3948c8+=',\x20scheduledAt\x20=\x20NOW()';}_0x1b59b5['push'](_0x3948c8);BPromise['each'](_0x1b59b5,handleQuery)[_0x8ddb('0x1f')](function(_0x230fbb){BPromise[_0x8ddb('0x1e')]([handleAdditionalPhones()])['then'](function(){_0x1b59b5=[];for(var _0x2d8669=0x0;_0x2d8669\x20\x20');}var _0x3169f1=path[_0x8ddb('0x13')](config['root'],'server/files/tmp',process[_0x8ddb('0x96')][0x2]);if(!fs[_0x8ddb('0x97')](_0x3169f1)){throw new Error(_0x8ddb('0x98'));}var _0xe4d835={};try{_0xe4d835=JSON[_0x8ddb('0x6d')](process[_0x8ddb('0x96')][0x3]);if(!_0xe4d835[_0x8ddb('0x62')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x26d8c1=0x0;if(_0xe4d835[_0x8ddb('0x62')]['UserId']){_0x26d8c1=0x1;}if(!_0xe4d835['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x164bd1){throw new Error('body\x20id\x20mandatory');}var _0x3b6991=[];try{_0x3b6991=_[_0x8ddb('0x99')](JSON[_0x8ddb('0x6d')](process[_0x8ddb('0x96')][0x4]),'id');}catch(_0x3fc5b3){logger[_0x8ddb('0x5e')](_0x8ddb('0x9a'));}main(_0x3169f1,_0xe4d835,_0x3b6991,_0x26d8c1);}validate();process['on'](_0x8ddb('0x9b'),handleStop);process['on'](_0x8ddb('0x9c'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 3aa792b..c33b865 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf973=['destexten','Queue','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','membername','uniqueid','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','inbound','variable','queue','push','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf973,0x1e6));var _0x3f97=function(_0x3b7a06,_0x41f79e){_0x3b7a06=_0x3b7a06-0x0;var _0x363e31=_0xf973[_0x3b7a06];return _0x363e31;};'use strict';exports[_0x3f97('0x0')]=function(_0x1932b7,_0x5aba42){var _0x406600=[{'type':_0x3f97('0x1'),'content':_0x3f97('0x2'),'variableName':null}];switch(_0x1932b7['toLowerCase']()){case _0x3f97('0x3'):switch(_0x5aba42['toLowerCase']()){case _0x3f97('0x4'):_0x406600['push']({'type':_0x3f97('0x5'),'content':'','variableName':_0x3f97('0x6')});_0x406600[_0x3f97('0x7')]({'type':_0x3f97('0x5'),'content':'','variableName':'calleridnum'});break;case _0x3f97('0x8'):_0x406600['push']({'type':_0x3f97('0x1'),'content':_0x3f97('0x9'),'variableName':null});_0x406600[_0x3f97('0x7')]({'type':_0x3f97('0x5'),'content':'','variableName':_0x3f97('0xa')});break;}}return _0x406600;};exports[_0x3f97('0xb')]=function(_0x3e22b8,_0x24b9dd){var _0x1a4829=[];switch(_0x3e22b8[_0x3f97('0xc')]()){case'voice':switch(_0x24b9dd[_0x3f97('0xc')]()){case _0x3f97('0x4'):_0x1a4829=[{'type':_0x3f97('0x1'),'content':_0x3f97('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0xf'),'keyType':_0x3f97('0x5'),'variableName':_0x3f97('0x10')},{'type':'keyValue','content':'','key':_0x3f97('0x11'),'keyType':'variable','variableName':_0x3f97('0x12')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x13'),'keyType':'variable','variableName':_0x3f97('0x14')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x15'),'keyType':_0x3f97('0x5'),'variableName':'queue'},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x16'),'keyType':_0x3f97('0x5'),'variableName':'uniqueid'},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x17'),'keyType':_0x3f97('0x5'),'variableName':'agentcalledAt'},{'type':_0x3f97('0x1'),'content':_0x3f97('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x3f97('0xe'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x19'),'keyType':_0x3f97('0x5'),'variableName':_0x3f97('0xa')},{'type':_0x3f97('0x1'),'content':_0x3f97('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3f97('0x1b'),'keyType':_0x3f97('0x5'),'variableName':_0x3f97('0x1c')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x1d'),'keyType':_0x3f97('0x5'),'variableName':_0x3f97('0x1e')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x1f'),'keyType':'variable','variableName':_0x3f97('0x20')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x21'),'keyType':'variable','variableName':_0x3f97('0x22')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x23'),'keyType':_0x3f97('0x5'),'variableName':_0x3f97('0x24')}];break;case _0x3f97('0x8'):_0x1a4829=[{'type':_0x3f97('0x1'),'content':_0x3f97('0xd'),'variableName':null},{'type':_0x3f97('0xe'),'content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x3f97('0xe'),'content':'','key':'Member\x20Name','keyType':_0x3f97('0x5'),'keyContent':'','variableName':_0x3f97('0x25')},{'type':'keyValue','content':'','key':_0x3f97('0x16'),'keyType':_0x3f97('0x5'),'keyContent':'','variableName':_0x3f97('0x26')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x17'),'keyType':_0x3f97('0x5'),'keyContent':'','variableName':_0x3f97('0x27')},{'type':_0x3f97('0x1'),'content':_0x3f97('0x1a')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x28'),'keyType':_0x3f97('0x5'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x3f97('0x29'),'keyType':_0x3f97('0x5'),'keyContent':'','variableName':_0x3f97('0x2a')},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x2b'),'keyType':_0x3f97('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x3f97('0xe'),'content':'','key':_0x3f97('0x2c'),'keyType':_0x3f97('0x5'),'keyContent':'','variableName':_0x3f97('0x2d')}];break;}}return _0x1a4829;}; \ No newline at end of file +var _0x883a=['billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','queue','variable','calleridnum','outbound','Outbound\x20Call','***\x20Call\x20Info\x20***','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','keyValue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','destcalleridnum','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x883a,0x88));var _0xa883=function(_0xc579db,_0x445118){_0xc579db=_0xc579db-0x0;var _0x1f3f28=_0x883a[_0xc579db];return _0x1f3f28;};'use strict';exports[_0xa883('0x0')]=function(_0x42a7ea,_0x5c8e63){var _0x5492b6=[{'type':_0xa883('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x42a7ea[_0xa883('0x2')]()){case _0xa883('0x3'):switch(_0x5c8e63[_0xa883('0x2')]()){case _0xa883('0x4'):_0x5492b6[_0xa883('0x5')]({'type':'variable','content':'','variableName':_0xa883('0x6')});_0x5492b6[_0xa883('0x5')]({'type':_0xa883('0x7'),'content':'','variableName':_0xa883('0x8')});break;case _0xa883('0x9'):_0x5492b6[_0xa883('0x5')]({'type':_0xa883('0x1'),'content':_0xa883('0xa'),'variableName':null});_0x5492b6[_0xa883('0x5')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x5492b6;};exports['getDescriptions']=function(_0x1c8ad7,_0x2a9dde){var _0x5779f3=[];switch(_0x1c8ad7['toLowerCase']()){case _0xa883('0x3'):switch(_0x2a9dde[_0xa883('0x2')]()){case _0xa883('0x4'):_0x5779f3=[{'type':_0xa883('0x1'),'content':_0xa883('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa883('0xc'),'keyType':'variable','variableName':_0xa883('0x8')},{'type':'keyValue','content':'','key':_0xa883('0xd'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0xe')},{'type':'keyValue','content':'','key':_0xa883('0xf'),'keyType':'variable','variableName':_0xa883('0x10')},{'type':'keyValue','content':'','key':_0xa883('0x11'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x6')},{'type':'keyValue','content':'','key':_0xa883('0x12'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x13')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x15'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x16')},{'type':_0xa883('0x1'),'content':_0xa883('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa883('0x14'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0xa883('0x18')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0xa883('0x7'),'variableName':'destcalleridnum'},{'type':_0xa883('0x1'),'content':_0xa883('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa883('0x1a'),'keyType':'variable','variableName':_0xa883('0x16')},{'type':'keyValue','content':'','key':_0xa883('0x1b'),'keyType':_0xa883('0x7'),'variableName':'agentconnectAt'},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x1c'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x1d')},{'type':'keyValue','content':'','key':_0xa883('0x1e'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x1f')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x20'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x21')}];break;case'outbound':_0x5779f3=[{'type':_0xa883('0x1'),'content':_0xa883('0xb'),'variableName':null},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x22'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x23')},{'type':_0xa883('0x14'),'content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0xa883('0x24')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x12'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x13')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x15'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x25')},{'type':_0xa883('0x1'),'content':_0xa883('0x19')},{'type':'keyValue','content':'','key':_0xa883('0x26'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x27')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x28'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x29')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x2a'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x2b')},{'type':_0xa883('0x14'),'content':'','key':'Billable\x20Time','keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x2c')}];break;}}return _0x5779f3;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 23880fd..a2526dc 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2f6=['resolve','getInteractionsQuery','then','search','parseQueryParameters','where','contact','fields','filter','user','having','read','checkAccountsRestrictions','group','i.id','ids','tag','count','clause','order','forEach','DESC','catch','tracked','query','omit','body','html','phone','fax','mobile','updateUser','lodash','./sql-utils'];(function(_0x5eb294,_0x5b52ba){var _0xd139fd=function(_0x52e319){while(--_0x52e319){_0x5eb294['push'](_0x5eb294['shift']());}};_0xd139fd(++_0x5b52ba);}(_0xa2f6,0xa8));var _0x6a2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6a2f('0x0'));var sqlUtils=require(_0x6a2f('0x1'));var utils=require('./utils');exports['findAll']=function(_0x8f397a,_0x5c735c,_0x1fe191,_0x22ae7f,_0x2c34ea){var _0x1fe19b={'count':0x0,'rows':[]};var _0x367078=sqlUtils['skipInteractionsQuery'](_0x8f397a,_0x1fe191,_0x5c735c);if(_0x367078){return Promise[_0x6a2f('0x2')](_0x1fe19b);}var _0x583e95=sqlUtils[_0x6a2f('0x3')](_0x8f397a);var _0x192337={};return Promise[_0x6a2f('0x2')]()[_0x6a2f('0x4')](function(){if(_0x5c735c['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x5c735c[_0x6a2f('0x5')],_0x2c34ea);}else{return sqlUtils[_0x6a2f('0x6')](_0x8f397a,_0x5c735c,_0x2c34ea);}})['then'](function(_0x469675){_0x583e95['where'](_0x469675['body']);_0x583e95[_0x6a2f('0x7')](_0x469675[_0x6a2f('0x8')]);_0x583e95[_0x6a2f('0x7')](_0x469675['default']);_0x583e95['where'](_0x469675[_0x6a2f('0x9')]);_0x583e95['where'](_0x469675[_0x6a2f('0xa')]);_0x583e95[_0x6a2f('0x7')](_0x469675[_0x6a2f('0xb')]);_0x583e95[_0x6a2f('0xc')](_0x469675[_0x6a2f('0xd')]);_0x192337=_0x469675['tags'];return sqlUtils[_0x6a2f('0xe')](_0x8f397a,_0x1fe191,_0x5c735c);})[_0x6a2f('0x4')](function(_0x325f7c){_0x583e95[_0x6a2f('0x7')](_0x325f7c);_0x583e95[_0x6a2f('0xf')](_0x6a2f('0x10'));var _0x271f4f=_0x5c735c[_0x6a2f('0x5')]?_0x192337[_0x6a2f('0x11')]:_0x5c735c[_0x6a2f('0x12')];return sqlUtils['countFilteredInteractions'](_0x583e95,_0x271f4f);})[_0x6a2f('0x4')](function(_0x4e3346){_0x1fe19b[_0x6a2f('0x13')]=_0x4e3346['length'];if(_0x1fe19b[_0x6a2f('0x13')]===0x0){return[];}_0x583e95[_0x6a2f('0xc')](_0x192337[_0x6a2f('0x14')]);if(_0x22ae7f[_0x6a2f('0x15')]){_0x22ae7f[_0x6a2f('0x15')][_0x6a2f('0x16')](function(_0x24067a){var _0x2727e2=_0x24067a[0x0]==='contactName'?_0x24067a[0x0]:'i.'+_0x24067a[0x0];_0x583e95[_0x6a2f('0x15')](_0x2727e2,_0x24067a[0x1]===_0x6a2f('0x17')?![]:!![]);if(_0x24067a[0x0]==='closed'){var _0x560852=sqlUtils['getClosedOrderClause'](_0x8f397a,_0x5c735c);_0x583e95[_0x6a2f('0x15')](_0x560852,_0x24067a[0x1]===_0x6a2f('0x17')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x8f397a,_0x583e95,_0x5c735c,_0x22ae7f);})['then'](function(_0x4ec39e){_0x1fe19b['rows']=_0x4ec39e;return _0x1fe19b;})[_0x6a2f('0x18')](function(_0x18b303){throw _0x18b303;});};exports[_0x6a2f('0x19')]=function(_0x2d2111,_0x5591cc){return function(_0x5de73b,_0x190d44,_0x344b24){var _0x203926=_0x5de73b[_0x6a2f('0xb')];var _0x49ad8d={};var _0x492d63=_0x5de73b[_0x6a2f('0x1a')];if(_0x49ad8d){_0x49ad8d=_['clone'](_0x5de73b['body']);_0x49ad8d=_[_0x6a2f('0x1b')](_0x49ad8d,[_0x6a2f('0x1c'),_0x6a2f('0x1d'),_0x6a2f('0x1e'),_0x6a2f('0x1f'),_0x6a2f('0x20')]);}utils[_0x6a2f('0x21')](_0x203926,_0x49ad8d,_0x492d63,_0x2d2111,_0x5591cc);_0x344b24(null);};}; \ No newline at end of file +var _0xe6ee=['length','having','clause','order','forEach','contactName','getClosedOrderClause','getFilteredInteractions','catch','tracked','query','clone','omit','phone','updateUser','lodash','./sql-utils','./utils','findAll','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','body','contact','default','fields','user','tags','checkAccountsRestrictions','group','ids','count'];(function(_0x105f15,_0x39d8da){var _0xe08e21=function(_0x10dc14){while(--_0x10dc14){_0x105f15['push'](_0x105f15['shift']());}};_0xe08e21(++_0x39d8da);}(_0xe6ee,0x153));var _0xee6e=function(_0x1a5220,_0x329db5){_0x1a5220=_0x1a5220-0x0;var _0x1a1a1a=_0xe6ee[_0x1a5220];return _0x1a1a1a;};'use strict';var _=require(_0xee6e('0x0'));var sqlUtils=require(_0xee6e('0x1'));var utils=require(_0xee6e('0x2'));exports[_0xee6e('0x3')]=function(_0x3d02c8,_0x120598,_0x57ecfd,_0xb852af,_0x3759c3){var _0x4e60d6={'count':0x0,'rows':[]};var _0x12621d=sqlUtils['skipInteractionsQuery'](_0x3d02c8,_0x57ecfd,_0x120598);if(_0x12621d){return Promise[_0xee6e('0x4')](_0x4e60d6);}var _0x51beb3=sqlUtils[_0xee6e('0x5')](_0x3d02c8);var _0x3c68c3={};return Promise[_0xee6e('0x4')]()[_0xee6e('0x6')](function(){if(_0x120598[_0xee6e('0x7')]){return sqlUtils[_0xee6e('0x8')](_0x120598['search'],_0x3759c3);}else{return sqlUtils[_0xee6e('0x9')](_0x3d02c8,_0x120598,_0x3759c3);}})[_0xee6e('0x6')](function(_0x38d994){_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xb')]);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xc')]);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xd')]);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xe')]);_0x51beb3[_0xee6e('0xa')](_0x38d994['filter']);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xf')]);_0x51beb3['having'](_0x38d994['read']);_0x3c68c3=_0x38d994[_0xee6e('0x10')];return sqlUtils[_0xee6e('0x11')](_0x3d02c8,_0x57ecfd,_0x120598);})[_0xee6e('0x6')](function(_0x550246){_0x51beb3['where'](_0x550246);_0x51beb3[_0xee6e('0x12')]('i.id');var _0x314f4c=_0x120598[_0xee6e('0x7')]?_0x3c68c3[_0xee6e('0x13')]:_0x120598['tag'];return sqlUtils['countFilteredInteractions'](_0x51beb3,_0x314f4c);})['then'](function(_0x52c546){_0x4e60d6[_0xee6e('0x14')]=_0x52c546[_0xee6e('0x15')];if(_0x4e60d6[_0xee6e('0x14')]===0x0){return[];}_0x51beb3[_0xee6e('0x16')](_0x3c68c3[_0xee6e('0x17')]);if(_0xb852af['order']){_0xb852af[_0xee6e('0x18')][_0xee6e('0x19')](function(_0x4d3d74){var _0x5c6daa=_0x4d3d74[0x0]===_0xee6e('0x1a')?_0x4d3d74[0x0]:'i.'+_0x4d3d74[0x0];_0x51beb3['order'](_0x5c6daa,_0x4d3d74[0x1]==='DESC'?![]:!![]);if(_0x4d3d74[0x0]==='closed'){var _0x19380c=sqlUtils[_0xee6e('0x1b')](_0x3d02c8,_0x120598);_0x51beb3[_0xee6e('0x18')](_0x19380c,_0x4d3d74[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0xee6e('0x1c')](_0x3d02c8,_0x51beb3,_0x120598,_0xb852af);})[_0xee6e('0x6')](function(_0x3b624e){_0x4e60d6['rows']=_0x3b624e;return _0x4e60d6;})[_0xee6e('0x1d')](function(_0x101f15){throw _0x101f15;});};exports[_0xee6e('0x1e')]=function(_0xce0676,_0x3f4821){return function(_0x24a8ab,_0x31ecee,_0x461249){var _0x55b809=_0x24a8ab['user'];var _0x10bcde={};var _0x27b8e4=_0x24a8ab[_0xee6e('0x1f')];if(_0x10bcde){_0x10bcde=_[_0xee6e('0x20')](_0x24a8ab[_0xee6e('0xb')]);_0x10bcde=_[_0xee6e('0x21')](_0x10bcde,[_0xee6e('0xb'),'html',_0xee6e('0x22'),'fax','mobile']);}utils[_0xee6e('0x23')](_0x55b809,_0x10bcde,_0x27b8e4,_0xce0676,_0x3f4821);_0x461249(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 47595fa..0ac25b1 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6580=['type','text','start','value','unreadMessages','read','and','Contact','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','tags','clause','ids','User','operator','$substring','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','end','body','plainBody','keys','some','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','Websites','Accounts','i.thirdDisposition','i.disposition','unshift','closed','i.substatus','shift','Sequelize','QueryTypes','sequelize','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','groupBy','Setting','findOne','enableEmailPreview','all','clone','isEmpty','where','t.id\x20IN\x20?','SELECT','exports','squel','../parsers/advancedSearch','../parsers/qs','getAccountFK','role','agent','search','select','field','name','from','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','ui.','left_join','users','length','\x20IN\x20?','map','getInteractionsTables','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','mail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(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)','parseSearch','sqlOperator','conditions','find','buildExpression'];(function(_0x173c96,_0x359b40){var _0x3896ff=function(_0x4c07e3){while(--_0x4c07e3){_0x173c96['push'](_0x173c96['shift']());}};_0x3896ff(++_0x359b40);}(_0x6580,0x10a));var _0x0658=function(_0x1928f8,_0x23d850){_0x1928f8=_0x1928f8-0x0;var _0x2c39ae=_0x6580[_0x1928f8];return _0x2c39ae;};'use strict';var _=require('lodash');var squel=require(_0x0658('0x0'));var as=require(_0x0658('0x1'));var qs=require(_0x0658('0x2'));var updateInteraction=require('./update-interaction')['updateInteraction'];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0xf2667b,_0x2ba2ba,_0x313193){var _0x49929d=![];var _0x3a7d90=utils[_0x0658('0x3')](_0xf2667b);if(_0x2ba2ba[_0x0658('0x4')]===_0x0658('0x5')&&!_0x313193[_0x0658('0x6')]&&!_0x313193[_0x3a7d90]){_0x49929d=!![];}return _0x49929d;}function getTagsQuery(){return squel[_0x0658('0x7')]()[_0x0658('0x8')]('id')[_0x0658('0x8')](_0x0658('0x9'))['field']('color')[_0x0658('0xa')](_0x0658('0xb'));}function getUsersQuery(_0x584249,_0x347866){var _0x958950=utils[_0x0658('0xc')](_0x584249);var _0x138b88=_0x0658('0xd')+_0x584249+'_interactions';var _0x5d64b2=squel[_0x0658('0x7')]()['field'](_0x0658('0xe'))['field'](_0x0658('0xf'))[_0x0658('0x8')](_0x0658('0x10')+_0x958950)['from'](_0x138b88,'ui')[_0x0658('0x11')](_0x0658('0x12'),'u','u.id\x20=\x20ui.UserId');if(_0x347866[_0x0658('0x13')]>0x0){_0x5d64b2['where']('ui.'+_0x958950+_0x0658('0x14'),_[_0x0658('0x15')](_0x347866,'id'));}return _0x5d64b2;}function getInteractionsQuery(_0x9ba834){var _0xb816f6=utils[_0x0658('0x16')](_0x9ba834);var _0x3f8126=utils[_0x0658('0x3')](_0x9ba834);var _0x4425b9=utils[_0x0658('0xc')](_0x9ba834);return squel[_0x0658('0x7')]()[_0x0658('0xa')](_0xb816f6['interactions'],'i')[_0x0658('0x11')]('cm_contacts','c',_0x0658('0x17'))[_0x0658('0x11')](_0x0658('0x12'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xb816f6[_0x0658('0x18')],'a',_0x0658('0x19')+_0x3f8126)[_0x0658('0x11')](_0xb816f6[_0x0658('0x1a')],'me','me.'+_0x4425b9+_0x0658('0x1b'))['left_join'](_0xb816f6[_0x0658('0x1c')],'it','it.'+_0x4425b9+_0x0658('0x1b'))[_0x0658('0x11')]('tools_tags','t',_0x0658('0x1d'));}function getSqlClauses(){var _0x2356d8={'body':squel[_0x0658('0x1e')](),'contact':squel['expr'](),'default':squel[_0x0658('0x1e')](),'fields':squel[_0x0658('0x1e')](),'filter':squel[_0x0658('0x1e')](),'read':squel[_0x0658('0x1e')](),'tags':{'clause':squel[_0x0658('0x1e')](),'ids':null},'user':squel[_0x0658('0x1e')]()};return _0x2356d8;}function parseTagParameter(_0x345f11){var _0x26cdd3=squel[_0x0658('0x1e')]();if(_0x345f11){var _0x4a24dd=utils[_0x0658('0x1f')](_0x345f11);_0x4a24dd[_0x0658('0x20')](function(_0x2b60b4){_0x26cdd3['or'](_0x0658('0x21'),'%,'+_0x2b60b4+',%');});}return _0x26cdd3;}function parseReadParameter(_0x12c915){var _0x1e2ec0='';if(_0x12c915){_0x1e2ec0=_0x0658('0x22');if(_0x12c915==='1'){_0x1e2ec0=_0x1e2ec0[_0x0658('0x23')]('{OPERATOR}','=');}else{_0x1e2ec0=_0x1e2ec0[_0x0658('0x23')](_0x0658('0x24'),'>');}}return _0x1e2ec0;}function parseSearchFilter(_0x1ecfc8,_0x2bba3c){var _0x43eca7=squel[_0x0658('0x1e')]();if(_0x2bba3c){var _0x24976b=_0x2bba3c[_0x0658('0x23')]('\x5c','\x5c\x5c')[_0x0658('0x23')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x24976b)){_0x43eca7['or']('i.id\x20LIKE\x20?',_0x24976b+'%');if([_0x0658('0x25'),_0x0658('0x26')][_0x0658('0x27')](_0x1ecfc8)){_0x43eca7['or'](_0x0658('0x28'),_0x24976b+'%');}else if(_0x1ecfc8===_0x0658('0x29')){_0x43eca7['or'](_0x0658('0x2a'),_0x24976b+'%');}else if(_0x1ecfc8===_0x0658('0x2b')){_0x43eca7['or']('i.from\x20LIKE\x20?',_0x24976b+'%');}}else if(_0x1ecfc8===_0x0658('0x2c')&&qs['isEmail'](_0x24976b)){_0x43eca7['or'](_0x0658('0x2d'),_0x24976b+'%');}else{if(_0x1ecfc8===_0x0658('0x2c')){_0x43eca7['or'](_0x0658('0x2e'),qs[_0x0658('0x2f')](_0x24976b,!![]))['or'](_0x0658('0x30'),qs['getFullTextValue'](_0x24976b));}else if(_0x1ecfc8!==_0x0658('0x29')){_0x43eca7['or'](_0x0658('0x31'),qs[_0x0658('0x2f')](_0x24976b));}_0x43eca7['or'](_0x0658('0x32'),qs['getFullTextValue'](_0x24976b,!![]),null);}}return _0x43eca7;}function parseAdvancedSearchFilter(_0x340f44,_0x483353){var _0x2287c6=getSqlClauses();var _0x3051f4=as[_0x0658('0x33')](_0x340f44);var _0x294d30=_0x3051f4[_0x0658('0x34')];for(var _0x1c9b3f=0x0;_0x1c9b3f<_0x3051f4[_0x0658('0x35')][_0x0658('0x13')];_0x1c9b3f++){var _0x2c4e8c=_0x3051f4[_0x0658('0x35')][_0x1c9b3f];var _0x5a8f50='i';var _0x23104c=_[_0x0658('0x36')](_0x483353,['name',_0x2c4e8c[_0x0658('0x8')]]);if(_0x23104c){var _0x18e5d6=as[_0x0658('0x37')](_0x5a8f50,_0x23104c[_0x0658('0x38')],_0x2c4e8c);_0x2287c6['default'][_0x294d30](_0x18e5d6[_0x0658('0x39')],_0x18e5d6['value'][_0x0658('0x3a')],_0x18e5d6[_0x0658('0x3b')]['end']);}else{switch(_0x2c4e8c[_0x0658('0x8')]){case _0x0658('0x3c'):var _0xe5bf99=parseReadParameter(_0x2c4e8c[_0x0658('0x3b')]);_0x2287c6[_0x0658('0x3d')][_0x0658('0x3e')](_0xe5bf99);break;case _0x0658('0x3f'):if(_0x2c4e8c['operator']==='$substring'){if(_0x2c4e8c[_0x0658('0x3b')][_0x0658('0x40')]('\x20')[_0x0658('0x13')]>0x1){_0x2287c6[_0x0658('0x41')][_0x294d30](_0x0658('0x32'),qs[_0x0658('0x2f')](_0x2c4e8c['value'],!![]),null);}else{var _0x28f10e='%'+_0x2c4e8c[_0x0658('0x3b')]+'%';_0x2287c6[_0x0658('0x41')][_0x294d30](_0x0658('0x42'),_0x28f10e,_0x28f10e,_0x28f10e);}}else{_0x23104c=_[_0x0658('0x36')](_0x483353,[_0x0658('0x9'),_0x0658('0x43')]);_0x2c4e8c[_0x0658('0x8')]=_0x0658('0x43');_0x18e5d6=as['buildExpression'](_0x5a8f50,_0x23104c[_0x0658('0x38')],_0x2c4e8c);_0x2287c6[_0x0658('0x41')][_0x294d30](_0x18e5d6[_0x0658('0x39')],_0x18e5d6['value']['start'],_0x18e5d6[_0x0658('0x3b')]['end']);}break;case'Tag':var _0x335c8c=_0x2c4e8c[_0x0658('0x3b')][_0x0658('0x40')](',')[_0x0658('0x15')](function(_0xf2c9b2){return Number(_0xf2c9b2);});var _0xaac51b=parseTagParameter(_0x335c8c);_0x2287c6[_0x0658('0x44')][_0x0658('0x45')]['and'](_0xaac51b);_0x2287c6['tags'][_0x0658('0x46')]=_0x335c8c;break;case _0x0658('0x47'):if(_0x2c4e8c[_0x0658('0x48')]===_0x0658('0x49')){_0x2287c6[_0x0658('0x4a')][_0x294d30](_0x0658('0x4b'),'%'+_0x2c4e8c['value']+'%',null);}else{_0x23104c=_['find'](_0x483353,['name','UserId']);_0x2c4e8c[_0x0658('0x8')]=_0x0658('0x4c');_0x18e5d6=as['buildExpression'](_0x5a8f50,_0x23104c['type'],_0x2c4e8c);_0x2287c6[_0x0658('0x4a')][_0x294d30](_0x18e5d6[_0x0658('0x39')],_0x18e5d6['value'][_0x0658('0x3a')],_0x18e5d6[_0x0658('0x3b')][_0x0658('0x4d')]);}break;case _0x0658('0x4e'):case _0x0658('0x4f'):_0x18e5d6=as[_0x0658('0x37')]('me',null,_0x2c4e8c);_0x2287c6[_0x0658('0x4e')][_0x294d30](_0x18e5d6[_0x0658('0x39')],_0x18e5d6[_0x0658('0x3b')][_0x0658('0x3a')],_0x18e5d6[_0x0658('0x3b')][_0x0658('0x4d')]);break;}}}return _0x2287c6;}function parseModelFields(_0x4bb5a7,_0x4b82ef,_0x577b87){var _0x4825c2=utils['getAccountFK'](_0x4bb5a7);var _0x4f8c96=squel[_0x0658('0x1e')]();var _0x17acb2=_(_0x4b82ef)[_0x0658('0x50')]()[_0x0658('0x15')](function(_0x28a0da){return _[_0x0658('0x51')](_0x577b87,[_0x0658('0x9'),_0x28a0da])?_0x28a0da:undefined;})['compact']()[_0x0658('0x3b')]();if(_0x17acb2[_0x0658('0x13')]>0x0){_0x17acb2[_0x0658('0x20')](function(_0x41b53c){if(_0x41b53c===_0x4825c2){_0x4f8c96[_0x0658('0x3e')]('i.'+_0x4825c2+_0x0658('0x14'),[][_0x0658('0x52')](_0x4b82ef[_0x41b53c]));}else if(_0x41b53c===_0x0658('0x53')){var _0x2234b3=JSON[_0x0658('0x54')](_0x4b82ef[_0x41b53c])[_0x0658('0x55')];var _0x37b4c2=JSON[_0x0658('0x54')](_0x4b82ef[_0x41b53c])[_0x0658('0x56')];_0x4f8c96['and'](_0x0658('0x57'),_0x2234b3,_0x37b4c2);}else{if(_0x4b82ef[_0x41b53c]===_0x0658('0x58')){_0x4f8c96[_0x0658('0x3e')]('i.'+_0x41b53c+_0x0658('0x59'));}else{_0x4f8c96[_0x0658('0x3e')]('i.'+_0x41b53c+_0x0658('0x5a'),_0x4b82ef[_0x41b53c]);}}});}return _0x4f8c96;}function parseQueryParameters(_0x3ee28c,_0x25b507,_0xbb1c0b){var _0x5b77bd=getSqlClauses();return Promise[_0x0658('0x5b')]()[_0x0658('0x5c')](function(){return parseModelFields(_0x3ee28c,_0x25b507,_0xbb1c0b);})[_0x0658('0x5c')](function(_0x13caaf){_0x5b77bd[_0x0658('0x5d')][_0x0658('0x3e')](_0x13caaf);return parseReadParameter(_0x25b507[_0x0658('0x3d')]);})[_0x0658('0x5c')](function(_0x556cbf){_0x5b77bd[_0x0658('0x3d')]['and'](_0x556cbf);return parseTagParameter(_0x25b507[_0x0658('0x5e')]);})[_0x0658('0x5c')](function(_0x3c6d8b){_0x5b77bd[_0x0658('0x44')][_0x0658('0x45')][_0x0658('0x3e')](_0x3c6d8b);return parseSearchFilter(_0x3ee28c,_0x25b507[_0x0658('0x5f')]);})['then'](function(_0x538a40){_0x5b77bd[_0x0658('0x5f')]=_0x538a40;return _0x5b77bd;});}function checkAccountsRestrictions(_0x4c6c08,_0x2fb95a,_0x3c2243){var _0x474927=utils['getAccountFK'](_0x4c6c08);var _0x4f7c7d=_0x0658('0x60')+_[_0x0658('0x61')](_0x4c6c08)+(_0x4c6c08==='chat'?_0x0658('0x62'):_0x0658('0x63'));var _0x2f6eff=squel[_0x0658('0x1e')]();return Promise['resolve']()['then'](function(){if(_0x3c2243[_0x0658('0x6')]&&_0x2fb95a['role']===_0x0658('0x5')){return _0x2fb95a[_0x4f7c7d]({'attributes':['id'],'raw':!![]});}})['then'](function(_0xe56303){if(_0xe56303){if(_0xe56303[_0x0658('0x13')]===0x0){_0x2f6eff['and']('i.'+_0x474927+_0x0658('0x59'));}else{_0x2f6eff[_0x0658('0x3e')]('i.'+_0x474927+_0x0658('0x14'),_['map'](_0xe56303,'id'));}}else if(!_0x3c2243[_0x474927]){_0x2f6eff[_0x0658('0x3e')]('i.'+_0x474927+'\x20IS\x20NOT\x20NULL');}})[_0x0658('0x5c')](function(){return _0x2f6eff;});}function getClosedOrderClause(_0x30c561,_0x156836){var _0x2db266='';var _0x335fca=[_0x0658('0x64'),'i.secondDisposition',_0x0658('0x65')];if(_0x30c561===_0x0658('0x2c')){_0x335fca[_0x0658('0x66')]('i.substatus');}if(_0x156836[_0x0658('0x67')]==='0'&&_0x30c561===_0x0658('0x2c')){_0x2db266=_0x0658('0x68');}else{if(_0x156836[_0x0658('0x67')]==='1'){_0x335fca[_0x0658('0x69')]();}_0x2db266='CONCAT_WS(\x27\x27,\x20'+_0x335fca['join'](',\x20')+')';}return _0x2db266;}function getFilteredInteractions(_0x173919,_0x113c87,_0x528a2c,_0x2a8e5f){var _0x16d5e8=utils[_0x0658('0xc')](_0x173919);var _0x3dc540=_[_0x0658('0x61')](_0x173919)+'Interaction';var _0x44987a=[];var _0x2a7892=getTagsQuery();var _0x40e9f4={'type':db[_0x0658('0x6a')][_0x0658('0x6b')]['SELECT'],'raw':!![]};var _0x26cf75=[];var _0x547d27=[];return db[_0x0658('0x6c')]['query'](_0x2a7892[_0x0658('0x6d')](),_0x40e9f4)[_0x0658('0x5c')](function(_0x492b4f){_0x44987a=_[_0x0658('0x6e')](_0x492b4f,'id');_0x40e9f4=_[_0x0658('0x6f')](_0x40e9f4,{'model':db[_0x3dc540],'mapToModel':!![],'nest':!![]});if(_0x528a2c[_0x0658('0x5d')]){_0x2a8e5f[_0x0658('0x70')][_0x0658('0x20')](function(_0x6626ad){_0x113c87[_0x0658('0x8')]('i.'+_0x6626ad);});}else{_0x113c87[_0x0658('0x8')](_0x0658('0x71'),_0x0658('0x3c'));_0x113c87['field'](_0x0658('0x72'),_0x0658('0x73'));_0x113c87['field'](_0x0658('0x74'),_0x0658('0x75'));if(_0x173919===_0x0658('0x2c')){_0x113c87[_0x0658('0x8')](_0x0658('0x76'),_0x0658('0x77'));_0x113c87[_0x0658('0x8')](_0x0658('0x78'),_0x0658('0x79'));_0x113c87[_0x0658('0x8')](_0x0658('0x7a'));_0x113c87[_0x0658('0x8')]('i.createdAt');_0x113c87['field'](_0x0658('0x7b'));_0x113c87[_0x0658('0x8')](_0x0658('0x7c'));_0x113c87['field']('i.closedAt');_0x113c87[_0x0658('0x8')](_0x0658('0x7d'));_0x113c87[_0x0658('0x8')](_0x0658('0x7e'));_0x113c87[_0x0658('0x8')]('i.lastMsgDirection');_0x113c87['field'](_0x0658('0x7f'));_0x113c87[_0x0658('0x8')](_0x0658('0x65'));_0x113c87['field']('i.secondDisposition');_0x113c87[_0x0658('0x8')](_0x0658('0x64'));_0x113c87[_0x0658('0x8')]('i.substatus');_0x113c87['field'](_0x0658('0x80'));_0x113c87[_0x0658('0x8')](_0x0658('0x81'));_0x113c87[_0x0658('0x8')](_0x0658('0x82'));_0x113c87[_0x0658('0x8')]('i.UserId');}else if(_0x173919===_0x0658('0x2b')){_0x113c87[_0x0658('0x8')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x113c87[_0x0658('0x8')](_0x0658('0x83'),'contactName');}if(_0x173919!==_0x0658('0x2c')){_0x113c87['field'](_0x0658('0x84'));}_0x113c87[_0x0658('0x8')](_0x0658('0x85'),_0x0658('0x86'));_0x113c87[_0x0658('0x8')](_0x0658('0x87'),_0x0658('0x88'));_0x113c87[_0x0658('0x8')]('c.email',_0x0658('0x89'));_0x113c87[_0x0658('0x8')](_0x0658('0x8a'),_0x0658('0x8b'));_0x113c87[_0x0658('0x8')](_0x0658('0x8c'),_0x0658('0x8d'));_0x113c87[_0x0658('0x8')](_0x0658('0x8e'),'Contact.fax');_0x113c87[_0x0658('0x8')](_0x0658('0x8f'),'Owner.fullname');_0x113c87[_0x0658('0x8')](_0x0658('0x90'),_0x0658('0x91'));_0x113c87[_0x0658('0x8')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0658('0x92'));}if(_0x2a8e5f['limit']){_0x113c87['limit'](_0x2a8e5f[_0x0658('0x93')]);}if(_0x2a8e5f['offset']){_0x113c87[_0x0658('0x94')](_0x2a8e5f[_0x0658('0x94')]);}return db['sequelize']['query'](_0x113c87[_0x0658('0x6d')](),_0x40e9f4);})[_0x0658('0x5c')](function(_0x337f5f){_0x26cf75=_0x337f5f;var _0x164bba=getUsersQuery(_0x173919,_0x26cf75);return db[_0x0658('0x6c')][_0x0658('0x95')](_0x164bba[_0x0658('0x6d')](),_0x40e9f4);})[_0x0658('0x5c')](function(_0x8bb26e){_0x547d27=_[_0x0658('0x96')](_0x8bb26e,_0x16d5e8);if(_0x173919===_0x0658('0x2c')){return db[_0x0658('0x97')][_0x0658('0x98')]({'attributes':[_0x0658('0x99')],'raw':!![]});}})[_0x0658('0x5c')](function(_0x5d1038){var _0x2817de=_0x5d1038?_0x5d1038[_0x0658('0x99')]:undefined;var _0x252cb9=_0x26cf75[_0x0658('0x15')](function(_0x28ef73){return updateInteraction(_0x28ef73,_0x44987a,_0x547d27,_0x2817de);});return Promise[_0x0658('0x9a')](_0x252cb9);});}function countFilteredInteractions(_0x3205ff,_0x32f11f){var _0x5a6d7a=_0x3205ff[_0x0658('0x9b')]();_0x5a6d7a[_0x0658('0x8')]('COUNT(*)');_0x5a6d7a['field'](_0x0658('0x71'),_0x0658('0x3c'));var _0x4dc5c4=utils[_0x0658('0x1f')](_0x32f11f);if(!_[_0x0658('0x9c')](_0x4dc5c4)){_0x5a6d7a[_0x0658('0x9d')](_0x0658('0x9e'),_0x4dc5c4);}var _0x524e38={'type':db['Sequelize'][_0x0658('0x6b')][_0x0658('0x9f')],'raw':!![]};return db[_0x0658('0x6c')][_0x0658('0x95')](_0x5a6d7a[_0x0658('0x6d')](),_0x524e38);}module[_0x0658('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x17b1=['keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','i.id','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','SELECT','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','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)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','type','default','text','value','start','unreadMessages','read','and','operator','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','end','Tag','tags','clause','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','some','compact','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','role','\x20IS\x20NOT\x20NULL','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','QueryTypes','sequelize','query','toString'];(function(_0x1bbce7,_0x581b65){var _0xe3a3ef=function(_0x58c0c7){while(--_0x58c0c7){_0x1bbce7['push'](_0x1bbce7['shift']());}};_0xe3a3ef(++_0x581b65);}(_0x17b1,0x182));var _0x117b=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x17b1[_0x2e2681];return _0x368a64;};'use strict';var _=require(_0x117b('0x0'));var squel=require(_0x117b('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x117b('0x2'));var updateInteraction=require('./update-interaction')[_0x117b('0x3')];var utils=require(_0x117b('0x4'));var db=require(_0x117b('0x5'))['db'];function skipInteractionsQuery(_0x3bc8e2,_0x216e94,_0x2d3f2e){var _0x3bcda3=![];var _0x406350=utils[_0x117b('0x6')](_0x3bc8e2);if(_0x216e94['role']==='agent'&&!_0x2d3f2e[_0x117b('0x7')]&&!_0x2d3f2e[_0x406350]){_0x3bcda3=!![];}return _0x3bcda3;}function getTagsQuery(){return squel[_0x117b('0x8')]()[_0x117b('0x9')]('id')[_0x117b('0x9')](_0x117b('0xa'))[_0x117b('0x9')](_0x117b('0xb'))[_0x117b('0xc')](_0x117b('0xd'));}function getUsersQuery(_0x4820c5,_0x13b5c1){var _0x38cb9c=utils[_0x117b('0xe')](_0x4820c5);var _0x3ab62a=_0x117b('0xf')+_0x4820c5+_0x117b('0x10');var _0x5c8b60=squel[_0x117b('0x8')]()['field'](_0x117b('0x11'))[_0x117b('0x9')](_0x117b('0x12'))[_0x117b('0x9')]('ui.'+_0x38cb9c)[_0x117b('0xc')](_0x3ab62a,'ui')[_0x117b('0x13')](_0x117b('0x14'),'u',_0x117b('0x15'));if(_0x13b5c1[_0x117b('0x16')]>0x0){_0x5c8b60[_0x117b('0x17')](_0x117b('0x18')+_0x38cb9c+_0x117b('0x19'),_[_0x117b('0x1a')](_0x13b5c1,'id'));}return _0x5c8b60;}function getInteractionsQuery(_0x111a4d){var _0x19b257=utils[_0x117b('0x1b')](_0x111a4d);var _0x5ee5c5=utils[_0x117b('0x6')](_0x111a4d);var _0x4d996c=utils[_0x117b('0xe')](_0x111a4d);return squel[_0x117b('0x8')]()[_0x117b('0xc')](_0x19b257[_0x117b('0x1c')],'i')[_0x117b('0x13')](_0x117b('0x1d'),'c',_0x117b('0x1e'))[_0x117b('0x13')](_0x117b('0x14'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x19b257[_0x117b('0x1f')],'a',_0x117b('0x20')+_0x5ee5c5)['left_join'](_0x19b257['messages'],'me',_0x117b('0x21')+_0x4d996c+_0x117b('0x22'))[_0x117b('0x13')](_0x19b257[_0x117b('0x23')],'it',_0x117b('0x24')+_0x4d996c+_0x117b('0x22'))[_0x117b('0x13')](_0x117b('0xd'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x8f2045={'body':squel[_0x117b('0x25')](),'contact':squel['expr'](),'default':squel[_0x117b('0x25')](),'fields':squel[_0x117b('0x25')](),'filter':squel[_0x117b('0x25')](),'read':squel['expr'](),'tags':{'clause':squel[_0x117b('0x25')](),'ids':null},'user':squel['expr']()};return _0x8f2045;}function parseTagParameter(_0xc8cf9a){var _0x19549d=squel[_0x117b('0x25')]();if(_0xc8cf9a){var _0x5e0884=utils[_0x117b('0x26')](_0xc8cf9a);_0x5e0884[_0x117b('0x27')](function(_0x39610f){_0x19549d['or'](_0x117b('0x28'),'%,'+_0x39610f+',%');});}return _0x19549d;}function parseReadParameter(_0x1a3033){var _0x5b670a='';if(_0x1a3033){_0x5b670a='unreadMessages\x20{OPERATOR}\x200';if(_0x1a3033==='1'){_0x5b670a=_0x5b670a[_0x117b('0x29')](_0x117b('0x2a'),'=');}else{_0x5b670a=_0x5b670a[_0x117b('0x29')](_0x117b('0x2a'),'>');}}return _0x5b670a;}function parseSearchFilter(_0xb8ed38,_0x306c20){var _0x1a0e21=squel[_0x117b('0x25')]();if(_0x306c20){var _0x364259=_0x306c20[_0x117b('0x29')]('\x5c','\x5c\x5c')[_0x117b('0x29')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x364259)){_0x1a0e21['or'](_0x117b('0x2b'),_0x364259+'%');if([_0x117b('0x2c'),_0x117b('0x2d')]['includes'](_0xb8ed38)){_0x1a0e21['or'](_0x117b('0x2e'),_0x364259+'%');}else if(_0xb8ed38===_0x117b('0x2f')){_0x1a0e21['or'](_0x117b('0x30'),_0x364259+'%');}else if(_0xb8ed38===_0x117b('0x31')){_0x1a0e21['or'](_0x117b('0x32'),_0x364259+'%');}}else if(_0xb8ed38===_0x117b('0x33')&&qs[_0x117b('0x34')](_0x364259)){_0x1a0e21['or'](_0x117b('0x35'),_0x364259+'%');}else{if(_0xb8ed38===_0x117b('0x33')){_0x1a0e21['or'](_0x117b('0x36'),qs['getFullTextValue'](_0x364259,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x117b('0x37')](_0x364259));}else if(_0xb8ed38!==_0x117b('0x2f')){_0x1a0e21['or'](_0x117b('0x38'),qs[_0x117b('0x37')](_0x364259));}_0x1a0e21['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x117b('0x37')](_0x364259,!![]),null);}}return _0x1a0e21;}function parseAdvancedSearchFilter(_0x3a61bb,_0x26d15b){var _0x275122=getSqlClauses();var _0x59a91b=as[_0x117b('0x39')](_0x3a61bb);var _0x12ff41=_0x59a91b[_0x117b('0x3a')];for(var _0x15cbd5=0x0;_0x15cbd5<_0x59a91b['conditions'][_0x117b('0x16')];_0x15cbd5++){var _0x3a99cc=_0x59a91b[_0x117b('0x3b')][_0x15cbd5];var _0x389b14='i';var _0x58bd56=_[_0x117b('0x3c')](_0x26d15b,[_0x117b('0xa'),_0x3a99cc['field']]);if(_0x58bd56){var _0x25c816=as['buildExpression'](_0x389b14,_0x58bd56[_0x117b('0x3d')],_0x3a99cc);_0x275122[_0x117b('0x3e')][_0x12ff41](_0x25c816[_0x117b('0x3f')],_0x25c816[_0x117b('0x40')][_0x117b('0x41')],_0x25c816[_0x117b('0x40')]['end']);}else{switch(_0x3a99cc[_0x117b('0x9')]){case _0x117b('0x42'):var _0x4fdc49=parseReadParameter(_0x3a99cc[_0x117b('0x40')]);_0x275122[_0x117b('0x43')][_0x117b('0x44')](_0x4fdc49);break;case'Contact':if(_0x3a99cc[_0x117b('0x45')]==='$substring'){if(_0x3a99cc[_0x117b('0x40')][_0x117b('0x46')]('\x20')[_0x117b('0x16')]>0x1){_0x275122[_0x117b('0x47')][_0x12ff41](_0x117b('0x48'),qs[_0x117b('0x37')](_0x3a99cc['value'],!![]),null);}else{var _0x2ba922='%'+_0x3a99cc['value']+'%';_0x275122[_0x117b('0x47')][_0x12ff41](_0x117b('0x49'),_0x2ba922,_0x2ba922,_0x2ba922);}}else{_0x58bd56=_[_0x117b('0x3c')](_0x26d15b,['name',_0x117b('0x4a')]);_0x3a99cc['field']=_0x117b('0x4a');_0x25c816=as[_0x117b('0x4b')](_0x389b14,_0x58bd56['type'],_0x3a99cc);_0x275122['contact'][_0x12ff41](_0x25c816[_0x117b('0x3f')],_0x25c816[_0x117b('0x40')][_0x117b('0x41')],_0x25c816['value'][_0x117b('0x4c')]);}break;case _0x117b('0x4d'):var _0x2fa3ba=_0x3a99cc[_0x117b('0x40')][_0x117b('0x46')](',')[_0x117b('0x1a')](function(_0x29ebe1){return Number(_0x29ebe1);});var _0x240632=parseTagParameter(_0x2fa3ba);_0x275122[_0x117b('0x4e')][_0x117b('0x4f')]['and'](_0x240632);_0x275122['tags'][_0x117b('0x50')]=_0x2fa3ba;break;case'User':if(_0x3a99cc[_0x117b('0x45')]==='$substring'){_0x275122[_0x117b('0x51')][_0x12ff41](_0x117b('0x52'),'%'+_0x3a99cc[_0x117b('0x40')]+'%',null);}else{_0x58bd56=_[_0x117b('0x3c')](_0x26d15b,[_0x117b('0xa'),_0x117b('0x53')]);_0x3a99cc[_0x117b('0x9')]=_0x117b('0x53');_0x25c816=as[_0x117b('0x4b')](_0x389b14,_0x58bd56[_0x117b('0x3d')],_0x3a99cc);_0x275122[_0x117b('0x51')][_0x12ff41](_0x25c816[_0x117b('0x3f')],_0x25c816[_0x117b('0x40')]['start'],_0x25c816[_0x117b('0x40')]['end']);}break;case _0x117b('0x54'):case _0x117b('0x55'):_0x25c816=as[_0x117b('0x4b')]('me',null,_0x3a99cc);_0x275122[_0x117b('0x54')][_0x12ff41](_0x25c816['text'],_0x25c816[_0x117b('0x40')][_0x117b('0x41')],_0x25c816[_0x117b('0x40')][_0x117b('0x4c')]);break;}}}return _0x275122;}function parseModelFields(_0x5c5b4d,_0x10a2fd,_0x12bd7f){var _0x477d11=utils[_0x117b('0x6')](_0x5c5b4d);var _0x478899=squel['expr']();var _0x388845=_(_0x10a2fd)['keys']()[_0x117b('0x1a')](function(_0x559fc5){return _[_0x117b('0x56')](_0x12bd7f,['name',_0x559fc5])?_0x559fc5:undefined;})[_0x117b('0x57')]()[_0x117b('0x40')]();if(_0x388845['length']>0x0){_0x388845[_0x117b('0x27')](function(_0x4493ce){if(_0x4493ce===_0x477d11){_0x478899['and']('i.'+_0x477d11+_0x117b('0x19'),[][_0x117b('0x58')](_0x10a2fd[_0x4493ce]));}else if(_0x4493ce==='createdAt'){var _0x3500a6=JSON[_0x117b('0x59')](_0x10a2fd[_0x4493ce])['$gte'];var _0xad9e34=JSON[_0x117b('0x59')](_0x10a2fd[_0x4493ce])[_0x117b('0x5a')];_0x478899[_0x117b('0x44')](_0x117b('0x5b'),_0x3500a6,_0xad9e34);}else{if(_0x10a2fd[_0x4493ce]==='null'){_0x478899[_0x117b('0x44')]('i.'+_0x4493ce+_0x117b('0x5c'));}else{_0x478899['and']('i.'+_0x4493ce+'\x20=\x20?',_0x10a2fd[_0x4493ce]);}}});}return _0x478899;}function parseQueryParameters(_0x347554,_0x336398,_0x53b9a3){var _0x18cf56=getSqlClauses();return Promise[_0x117b('0x5d')]()[_0x117b('0x5e')](function(){return parseModelFields(_0x347554,_0x336398,_0x53b9a3);})[_0x117b('0x5e')](function(_0x138b04){_0x18cf56[_0x117b('0x5f')][_0x117b('0x44')](_0x138b04);return parseReadParameter(_0x336398[_0x117b('0x43')]);})[_0x117b('0x5e')](function(_0x409ba0){_0x18cf56[_0x117b('0x43')][_0x117b('0x44')](_0x409ba0);return parseTagParameter(_0x336398[_0x117b('0x60')]);})[_0x117b('0x5e')](function(_0x57f708){_0x18cf56[_0x117b('0x4e')][_0x117b('0x4f')][_0x117b('0x44')](_0x57f708);return parseSearchFilter(_0x347554,_0x336398[_0x117b('0x61')]);})['then'](function(_0x127882){_0x18cf56[_0x117b('0x61')]=_0x127882;return _0x18cf56;});}function checkAccountsRestrictions(_0x2fa6fb,_0x4b85d,_0x14dd45){var _0x54e8ff=utils[_0x117b('0x6')](_0x2fa6fb);var _0x4a2a22=_0x117b('0x62')+_[_0x117b('0x63')](_0x2fa6fb)+(_0x2fa6fb===_0x117b('0x64')?_0x117b('0x65'):_0x117b('0x66'));var _0x3fca46=squel[_0x117b('0x25')]();return Promise[_0x117b('0x5d')]()[_0x117b('0x5e')](function(){if(_0x14dd45[_0x117b('0x7')]&&_0x4b85d[_0x117b('0x67')]==='agent'){return _0x4b85d[_0x4a2a22]({'attributes':['id'],'raw':!![]});}})[_0x117b('0x5e')](function(_0x4fd014){if(_0x4fd014){if(_0x4fd014['length']===0x0){_0x3fca46[_0x117b('0x44')]('i.'+_0x54e8ff+'\x20IS\x20NULL');}else{_0x3fca46['and']('i.'+_0x54e8ff+_0x117b('0x19'),_[_0x117b('0x1a')](_0x4fd014,'id'));}}else if(!_0x14dd45[_0x54e8ff]){_0x3fca46[_0x117b('0x44')]('i.'+_0x54e8ff+_0x117b('0x68'));}})[_0x117b('0x5e')](function(){return _0x3fca46;});}function getClosedOrderClause(_0x1123c1,_0x327d91){var _0x2fa756='';var _0x39cd04=['i.thirdDisposition','i.secondDisposition','i.disposition'];if(_0x1123c1===_0x117b('0x33')){_0x39cd04[_0x117b('0x69')](_0x117b('0x6a'));}if(_0x327d91[_0x117b('0x6b')]==='0'&&_0x1123c1==='mail'){_0x2fa756='i.substatus';}else{if(_0x327d91['closed']==='1'){_0x39cd04[_0x117b('0x6c')]();}_0x2fa756=_0x117b('0x6d')+_0x39cd04[_0x117b('0x6e')](',\x20')+')';}return _0x2fa756;}function getFilteredInteractions(_0x598868,_0x4367f6,_0x2cf1c0,_0x1d836a){var _0x26311d=utils[_0x117b('0xe')](_0x598868);var _0x2546b7=_[_0x117b('0x63')](_0x598868)+'Interaction';var _0x962821=[];var _0x5a30e1=getTagsQuery();var _0x1c5f2c={'type':db['Sequelize'][_0x117b('0x6f')]['SELECT'],'raw':!![]};var _0x1d9d33=[];var _0x205d5c=[];return db[_0x117b('0x70')][_0x117b('0x71')](_0x5a30e1[_0x117b('0x72')](),_0x1c5f2c)[_0x117b('0x5e')](function(_0x1ead02){_0x962821=_[_0x117b('0x73')](_0x1ead02,'id');_0x1c5f2c=_['merge'](_0x1c5f2c,{'model':db[_0x2546b7],'mapToModel':!![],'nest':!![]});if(_0x2cf1c0[_0x117b('0x5f')]){_0x1d836a[_0x117b('0x74')][_0x117b('0x27')](function(_0x51079f){_0x4367f6[_0x117b('0x9')]('i.'+_0x51079f);});}else{_0x4367f6[_0x117b('0x9')](_0x117b('0x75'),_0x117b('0x42'));_0x4367f6[_0x117b('0x9')](_0x117b('0x76'),_0x117b('0x77'));_0x4367f6[_0x117b('0x9')](_0x117b('0x78'),_0x117b('0x79'));if(_0x598868==='mail'){_0x4367f6[_0x117b('0x9')](_0x117b('0x7a'),_0x117b('0x7b'));_0x4367f6[_0x117b('0x9')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x4367f6['field'](_0x117b('0x7c'));_0x4367f6[_0x117b('0x9')]('i.createdAt');_0x4367f6[_0x117b('0x9')]('i.updatedAt');_0x4367f6[_0x117b('0x9')](_0x117b('0x7d'));_0x4367f6[_0x117b('0x9')](_0x117b('0x7e'));_0x4367f6[_0x117b('0x9')]('i.attach');_0x4367f6[_0x117b('0x9')](_0x117b('0x7f'));_0x4367f6[_0x117b('0x9')]('i.lastMsgDirection');_0x4367f6[_0x117b('0x9')](_0x117b('0x80'));_0x4367f6[_0x117b('0x9')](_0x117b('0x81'));_0x4367f6[_0x117b('0x9')](_0x117b('0x82'));_0x4367f6[_0x117b('0x9')](_0x117b('0x83'));_0x4367f6[_0x117b('0x9')]('i.substatus');_0x4367f6[_0x117b('0x9')](_0x117b('0x84'));_0x4367f6[_0x117b('0x9')](_0x117b('0x85'));_0x4367f6[_0x117b('0x9')](_0x117b('0x86'));_0x4367f6[_0x117b('0x9')](_0x117b('0x87'));}else if(_0x598868==='openchannel'){_0x4367f6[_0x117b('0x9')](_0x117b('0x88'),_0x117b('0x89'));}else{_0x4367f6['field'](_0x117b('0x8a'),_0x117b('0x89'));}if(_0x598868!==_0x117b('0x33')){_0x4367f6['field'](_0x117b('0x8b'));}_0x4367f6[_0x117b('0x9')](_0x117b('0x8c'),_0x117b('0x8d'));_0x4367f6[_0x117b('0x9')](_0x117b('0x8e'),'Contact.lastName');_0x4367f6[_0x117b('0x9')]('c.email',_0x117b('0x8f'));_0x4367f6[_0x117b('0x9')](_0x117b('0x90'),_0x117b('0x91'));_0x4367f6[_0x117b('0x9')](_0x117b('0x92'),'Contact.mobile');_0x4367f6[_0x117b('0x9')](_0x117b('0x93'),_0x117b('0x94'));_0x4367f6['field']('o.fullname',_0x117b('0x95'));_0x4367f6[_0x117b('0x9')](_0x117b('0x96'),_0x117b('0x97'));_0x4367f6['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x117b('0x98'));}if(_0x1d836a[_0x117b('0x99')]){_0x4367f6['limit'](_0x1d836a[_0x117b('0x99')]);}if(_0x1d836a[_0x117b('0x9a')]){_0x4367f6[_0x117b('0x9a')](_0x1d836a[_0x117b('0x9a')]);}return db[_0x117b('0x70')][_0x117b('0x71')](_0x4367f6[_0x117b('0x72')](),_0x1c5f2c);})[_0x117b('0x5e')](function(_0x52a9a1){_0x1d9d33=_0x52a9a1;var _0x4b4bca=getUsersQuery(_0x598868,_0x1d9d33);return db[_0x117b('0x70')][_0x117b('0x71')](_0x4b4bca[_0x117b('0x72')](),_0x1c5f2c);})[_0x117b('0x5e')](function(_0x77ee65){_0x205d5c=_[_0x117b('0x9b')](_0x77ee65,_0x26311d);if(_0x598868===_0x117b('0x33')){return db[_0x117b('0x9c')][_0x117b('0x9d')]({'attributes':[_0x117b('0x9e')],'raw':!![]});}})[_0x117b('0x5e')](function(_0x5ae5a7){var _0x4613c2=_0x5ae5a7?_0x5ae5a7[_0x117b('0x9e')]:undefined;var _0x599133=_0x1d9d33[_0x117b('0x1a')](function(_0x597494){return updateInteraction(_0x597494,_0x962821,_0x205d5c,_0x4613c2);});return Promise[_0x117b('0x9f')](_0x599133);});}function countFilteredInteractions(_0x26f353,_0x25cbc0){var _0x40e709=_0x26f353[_0x117b('0xa0')]();_0x40e709[_0x117b('0x9')](_0x117b('0xa1'));_0x40e709[_0x117b('0x9')](_0x117b('0x75'),_0x117b('0x42'));var _0x3ccaf1=utils[_0x117b('0x26')](_0x25cbc0);if(!_[_0x117b('0xa2')](_0x3ccaf1)){_0x40e709['where'](_0x117b('0xa3'),_0x3ccaf1);}var _0x2f403b={'type':db[_0x117b('0xa4')][_0x117b('0x6f')][_0x117b('0xa5')],'raw':!![]};return db[_0x117b('0x70')][_0x117b('0x71')](_0x40e709['toString'](),_0x2f403b);}module[_0x117b('0xa6')]={'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 fa5c7f9..c3d6ee2 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 _0x92de=['push','waiting','talking','disposition','abandoned','unmanaged','UserId','MailMessage','findOne','out','plainBody','-id','then','trimStart','updateInteraction','Users','Tags','catch','lodash','../../mysqldb','map','fullname','split'];(function(_0x418e80,_0x4f09a1){var _0x1e316e=function(_0x5ed31c){while(--_0x5ed31c){_0x418e80['push'](_0x418e80['shift']());}};_0x1e316e(++_0x4f09a1);}(_0x92de,0x1b0));var _0xe92d=function(_0x28b163,_0x329551){_0x28b163=_0x28b163-0x0;var _0x8736ed=_0x92de[_0x28b163];return _0x8736ed;};'use strict';var _=require(_0xe92d('0x0'));var db=require(_0xe92d('0x1'))['db'];function getInteractionUsers(_0x556f40,_0x1698f6){return new Promise(function(_0x56c827,_0xeb1874){try{var _0x317536=[];if(_0x1698f6[_0x556f40]){_0x317536=_0x1698f6[_0x556f40][_0xe92d('0x2')](function(_0x1f7d57){return{'id':_0x1f7d57['id'],'fullname':_0x1f7d57[_0xe92d('0x3')]};});}return _0x56c827(_0x317536);}catch(_0x54efc0){_0xeb1874(_0x54efc0);}});}function getInteractionTags(_0x4c999b,_0x22a31d){var _0x3fe57d=[];if(_0x4c999b){_0x4c999b[_0xe92d('0x4')](',')['forEach'](function(_0x77ecdc){_0x3fe57d[_0xe92d('0x5')](_0x22a31d[_0x77ecdc]);});}return _0x3fe57d;}function updateWaitingCounter(_0x1d24cd){if(_0x1d24cd['waiting']){_0x1d24cd[_0xe92d('0x6')]-=0x1;}}function updateInteractionCounters(_0x363441){_0x363441[_0xe92d('0x6')]=0x0;_0x363441[_0xe92d('0x7')]=0x0;_0x363441['answered']=0x0;_0x363441['unmanaged']=0x0;_0x363441['abandoned']=0x0;_0x363441['total']=0x0;if(_0x363441['closed']){if(_0x363441[_0xe92d('0x8')]===_0xe92d('0x9')){_0x363441[_0xe92d('0x9')]+=0x1;updateWaitingCounter(_0x363441);}if(_0x363441['UserId']){_0x363441['answered']+=0x1;if(_0x363441[_0xe92d('0x7')]){_0x363441[_0xe92d('0x7')]-=0x1;}}else{if(_0x363441[_0xe92d('0x8')]){_0x363441[_0xe92d('0xa')]+=0x1;updateWaitingCounter(_0x363441);}}}else{if(!_0x363441['UserId']){_0x363441[_0xe92d('0x6')]+=0x1;}if(_0x363441[_0xe92d('0xb')]){_0x363441[_0xe92d('0x7')]+=0x1;updateWaitingCounter(_0x363441);}}_0x363441['total']+=0x1;return _0x363441;}function getLastMessageText(_0x36ba9a){return db[_0xe92d('0xc')][_0xe92d('0xd')]({'where':{'$and':[{'MailInteractionId':_0x36ba9a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe92d('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe92d('0xf')],'order':_0xe92d('0x10'),'raw':!![]})[_0xe92d('0x11')](function(_0x26d377){if(_0x26d377&&_0x26d377[_0xe92d('0xf')]){_0x36ba9a['lastMsgText']=_[_0xe92d('0x12')](_0x26d377[_0xe92d('0xf')]);}return _0x36ba9a;})['catch'](function(_0xe8e7f8){throw _0xe8e7f8;});}exports[_0xe92d('0x13')]=function(_0x3403ed,_0xd0464e,_0x215b31,_0x1a83b0){return new Promise(function(_0x1d506c,_0x4b720b){return getInteractionUsers(_0x3403ed['id'],_0x215b31)[_0xe92d('0x11')](function(_0x576279){_0x3403ed[_0xe92d('0x14')]=_0x576279;return getInteractionTags(_0x3403ed['TagIds'],_0xd0464e);})[_0xe92d('0x11')](function(_0x117db6){_0x3403ed[_0xe92d('0x15')]=_0x117db6;delete _0x3403ed['TagIds'];return updateInteractionCounters(_0x3403ed);})['then'](function(_0x2e7413){if(_0x1a83b0){return getLastMessageText(_0x2e7413);}else{return _0x2e7413;}})[_0xe92d('0x11')](function(_0x24c82e){_0x1d506c(_0x24c82e);})[_0xe92d('0x16')](function(_0x2ae7d7){_0x4b720b(_0x2ae7d7);});});}; \ No newline at end of file +var _0x803f=['total','disposition','UserId','MailMessage','-id','trimStart','catch','then','Tags','TagIds','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','abandoned'];(function(_0x3d017f,_0x11978e){var _0x57a0f3=function(_0xb2b0fa){while(--_0xb2b0fa){_0x3d017f['push'](_0x3d017f['shift']());}};_0x57a0f3(++_0x11978e);}(_0x803f,0x1ea));var _0xf803=function(_0x27ec7f,_0x195aa6){_0x27ec7f=_0x27ec7f-0x0;var _0x265800=_0x803f[_0x27ec7f];return _0x265800;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x31bef0,_0x222ee8){return new Promise(function(_0x2f608c,_0xaec968){try{var _0x33624a=[];if(_0x222ee8[_0x31bef0]){_0x33624a=_0x222ee8[_0x31bef0][_0xf803('0x0')](function(_0x42d3d4){return{'id':_0x42d3d4['id'],'fullname':_0x42d3d4[_0xf803('0x1')]};});}return _0x2f608c(_0x33624a);}catch(_0x2b4d3b){_0xaec968(_0x2b4d3b);}});}function getInteractionTags(_0x58ff48,_0x238a06){var _0x4002d7=[];if(_0x58ff48){_0x58ff48[_0xf803('0x2')](',')[_0xf803('0x3')](function(_0x115609){_0x4002d7[_0xf803('0x4')](_0x238a06[_0x115609]);});}return _0x4002d7;}function updateWaitingCounter(_0x5ab7e8){if(_0x5ab7e8[_0xf803('0x5')]){_0x5ab7e8[_0xf803('0x5')]-=0x1;}}function updateInteractionCounters(_0x4c9681){_0x4c9681[_0xf803('0x5')]=0x0;_0x4c9681[_0xf803('0x6')]=0x0;_0x4c9681[_0xf803('0x7')]=0x0;_0x4c9681[_0xf803('0x8')]=0x0;_0x4c9681[_0xf803('0x9')]=0x0;_0x4c9681[_0xf803('0xa')]=0x0;if(_0x4c9681['closed']){if(_0x4c9681[_0xf803('0xb')]===_0xf803('0x9')){_0x4c9681[_0xf803('0x9')]+=0x1;updateWaitingCounter(_0x4c9681);}if(_0x4c9681[_0xf803('0xc')]){_0x4c9681['answered']+=0x1;if(_0x4c9681[_0xf803('0x6')]){_0x4c9681[_0xf803('0x6')]-=0x1;}}else{if(_0x4c9681['disposition']){_0x4c9681[_0xf803('0x8')]+=0x1;updateWaitingCounter(_0x4c9681);}}}else{if(!_0x4c9681['UserId']){_0x4c9681[_0xf803('0x5')]+=0x1;}if(_0x4c9681[_0xf803('0xc')]){_0x4c9681[_0xf803('0x6')]+=0x1;updateWaitingCounter(_0x4c9681);}}_0x4c9681['total']+=0x1;return _0x4c9681;}function getLastMessageText(_0x1bb0c8){return db[_0xf803('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1bb0c8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xf803('0xe'),'raw':!![]})['then'](function(_0x336791){if(_0x336791&&_0x336791['plainBody']){_0x1bb0c8['lastMsgText']=_[_0xf803('0xf')](_0x336791['plainBody']);}return _0x1bb0c8;})[_0xf803('0x10')](function(_0x5c69ca){throw _0x5c69ca;});}exports['updateInteraction']=function(_0x15d3c7,_0x48ec7b,_0x3b5b24,_0x166740){return new Promise(function(_0x2e9357,_0x48820b){return getInteractionUsers(_0x15d3c7['id'],_0x3b5b24)[_0xf803('0x11')](function(_0x4d91ef){_0x15d3c7['Users']=_0x4d91ef;return getInteractionTags(_0x15d3c7['TagIds'],_0x48ec7b);})[_0xf803('0x11')](function(_0x262b87){_0x15d3c7[_0xf803('0x12')]=_0x262b87;delete _0x15d3c7[_0xf803('0x13')];return updateInteractionCounters(_0x15d3c7);})['then'](function(_0x16b84e){if(_0x166740){return getLastMessageText(_0x16b84e);}else{return _0x16b84e;}})[_0xf803('0x11')](function(_0x77463a){_0x2e9357(_0x77463a);})[_0xf803('0x10')](function(_0x415b23){_0x48820b(_0x415b23);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 43238ba..ac5901e 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 _0x51a0=['upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','Interaction','findOne','then','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','capitalize','chat','Account','InteractionId'];(function(_0x5caa58,_0x2da243){var _0x5184e1=function(_0x3e85e0){while(--_0x3e85e0){_0x5caa58['push'](_0x5caa58['shift']());}};_0x5184e1(++_0x2da243);}(_0x51a0,0x71));var _0x051a=function(_0x110924,_0x1374bb){_0x110924=_0x110924-0x0;var _0x12905b=_0x51a0[_0x110924];return _0x12905b;};'use strict';var _=require(_0x051a('0x0'));var db=require(_0x051a('0x1'))['db'];var loggers={'openchannel':require(_0x051a('0x2'))(_0x051a('0x3')),'mail':require(_0x051a('0x2'))(_0x051a('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x051a('0x2'))(_0x051a('0x5')),'chat':require(_0x051a('0x2'))(_0x051a('0x6')),'whatsapp':require(_0x051a('0x2'))('whatsapp-interactions')};function getAccountFK(_0x3c5891){return _[_0x051a('0x7')](_0x3c5891)+(_0x3c5891===_0x051a('0x8')?'Website':_0x051a('0x9'))+'Id';}function getInteractionFK(_0x54a5bd){return _[_0x051a('0x7')](_0x54a5bd)+_0x051a('0xa');}function getInteractionId(_0x384cd6,_0x1ca7e0,_0xd203b2){if(_0x384cd6&&_0x384cd6[_[_0x051a('0xb')](_0xd203b2)+'InteractionId']){return _0x384cd6[_['upperFirst'](_0xd203b2)+_0x051a('0xa')];}else if(_0x384cd6&&_0x384cd6['id']){return _0x384cd6['id'];}else if(_0x1ca7e0&&_0x1ca7e0['id']){return _0x1ca7e0['id'];}else{return _0x051a('0xc');}}function getInteractionsTables(_0x48715f){return{'accounts':_0x48715f+'_'+(_0x48715f==='chat'?_0x051a('0xd'):_0x051a('0xe')),'interactions':_0x48715f+'_interactions','interactionsTags':_0x48715f+_0x051a('0xf'),'messages':_0x48715f+_0x051a('0x10'),'userInteractions':_0x051a('0x11')+_0x48715f+_0x051a('0x12')};}function getSelectedTags(_0x2ea66c){var _0x12a754=[];if(_0x2ea66c){_0x12a754=Array['isArray'](_0x2ea66c)?_0x2ea66c:[_0x2ea66c];}return _0x12a754;}function log(_0x5c9769,_0x23824b,_0x5edc21,_0x525873,_0xbb32b9,_0x53333e){loggers[_0xbb32b9[_0x051a('0x13')]()][_0x5c9769](_0x051a('0x14'),_0x53333e['toUpperCase'](),_0x23824b?_0x23824b['id']:null,_0x23824b?_0x23824b['name']:null,_0x23824b?_0x23824b[_0x051a('0x15')]:null,getInteractionId(_0x5edc21,_0x525873,_0xbb32b9),_0x5edc21?JSON[_0x051a('0x16')](_0x5edc21):_0x051a('0x17'));}function updateUser(_0x1ca0ca,_0x2a93ca,_0x437344,_0xd4869f,_0x120228){db[_[_0x051a('0xb')](_0xd4869f)+_0x051a('0x18')][_0x051a('0x19')]({'where':{'id':getInteractionId(_0x2a93ca,_0x437344,_0xd4869f)}})['then'](function(_0x48b8a2){if(_0x48b8a2){return _0x48b8a2['update']({'UserId':_0x1ca0ca?_0x1ca0ca['id']:null});}})[_0x051a('0x1a')](function(_0x3ccff8){if(_0x3ccff8){log(_0x051a('0x1b'),_0x1ca0ca,_0x2a93ca,_0x437344,_0xd4869f,_0x120228);}})[_0x051a('0x1c')](function(){log(_0x051a('0x1d'),_0x1ca0ca,_0x2a93ca,_0x437344,_0xd4869f,_0x120228);});}module[_0x051a('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x24f4=['role','stringify','null','Interaction','findOne','then','info','catch','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','websites','accounts','_messages','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x37cab9,_0x3bedf0){var _0x5c0cd2=function(_0x225a75){while(--_0x225a75){_0x37cab9['push'](_0x37cab9['shift']());}};_0x5c0cd2(++_0x3bedf0);}(_0x24f4,0x148));var _0x424f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x424f('0x0'));var db=require(_0x424f('0x1'))['db'];var loggers={'openchannel':require(_0x424f('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x424f('0x3')),'fax':require(_0x424f('0x2'))(_0x424f('0x4')),'sms':require(_0x424f('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x424f('0x5')),'whatsapp':require(_0x424f('0x2'))(_0x424f('0x6'))};function getAccountFK(_0x31d2f7){return _[_0x424f('0x7')](_0x31d2f7)+(_0x31d2f7===_0x424f('0x8')?_0x424f('0x9'):_0x424f('0xa'))+'Id';}function getInteractionFK(_0x211566){return _[_0x424f('0x7')](_0x211566)+_0x424f('0xb');}function getInteractionId(_0x34ac9f,_0x3b0374,_0x45061a){if(_0x34ac9f&&_0x34ac9f[_['upperFirst'](_0x45061a)+_0x424f('0xb')]){return _0x34ac9f[_[_0x424f('0xc')](_0x45061a)+'InteractionId'];}else if(_0x34ac9f&&_0x34ac9f['id']){return _0x34ac9f['id'];}else if(_0x3b0374&&_0x3b0374['id']){return _0x3b0374['id'];}else{return'unknown';}}function getInteractionsTables(_0x4a2909){return{'accounts':_0x4a2909+'_'+(_0x4a2909==='chat'?_0x424f('0xd'):_0x424f('0xe')),'interactions':_0x4a2909+'_interactions','interactionsTags':_0x4a2909+'_interaction_has_tags','messages':_0x4a2909+_0x424f('0xf'),'userInteractions':'user_has_'+_0x4a2909+_0x424f('0x10')};}function getSelectedTags(_0x19e353){var _0x29edd3=[];if(_0x19e353){_0x29edd3=Array[_0x424f('0x11')](_0x19e353)?_0x19e353:[_0x19e353];}return _0x29edd3;}function log(_0x448eb6,_0x39dd44,_0x2641e7,_0x9a77db,_0x28c777,_0x2c47a5){loggers[_0x28c777[_0x424f('0x12')]()][_0x448eb6](_0x424f('0x13'),_0x2c47a5['toUpperCase'](),_0x39dd44?_0x39dd44['id']:null,_0x39dd44?_0x39dd44['name']:null,_0x39dd44?_0x39dd44[_0x424f('0x14')]:null,getInteractionId(_0x2641e7,_0x9a77db,_0x28c777),_0x2641e7?JSON[_0x424f('0x15')](_0x2641e7):_0x424f('0x16'));}function updateUser(_0x37b676,_0x295110,_0x52ac98,_0x216f29,_0xf41105){db[_[_0x424f('0xc')](_0x216f29)+_0x424f('0x17')][_0x424f('0x18')]({'where':{'id':getInteractionId(_0x295110,_0x52ac98,_0x216f29)}})[_0x424f('0x19')](function(_0x36976c){if(_0x36976c){return _0x36976c['update']({'UserId':_0x37b676?_0x37b676['id']:null});}})[_0x424f('0x19')](function(_0xf33292){if(_0xf33292){log(_0x424f('0x1a'),_0x37b676,_0x295110,_0x52ac98,_0x216f29,_0xf41105);}})[_0x424f('0x1b')](function(){log('error',_0x37b676,_0x295110,_0x52ac98,_0x216f29,_0xf41105);});}module[_0x424f('0x1c')]={'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 0db46b2..fa174a0 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 _0x57c7=['data1','split','createDecipher','format','%s:%s:%s','update','base64','final','utf8','parse','use','License','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','composable-middleware','../../mysqldb','../../config/environment','license'];(function(_0x5cabdc,_0x38dcc3){var _0x34588f=function(_0x35f14b){while(--_0x35f14b){_0x5cabdc['push'](_0x5cabdc['shift']());}};_0x34588f(++_0x38dcc3);}(_0x57c7,0x173));var _0x757c=function(_0x521865,_0x38e4b0){_0x521865=_0x521865-0x0;var _0x263ee5=_0x57c7[_0x521865];return _0x263ee5;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x757c('0x0'));var db=require(_0x757c('0x1'))['db'];var config=require(_0x757c('0x2'));function getValueFromLicense(_0x166879,_0x13d44a){if(_0x166879&&_0x13d44a){if(_0x13d44a['data1']&&_0x13d44a[_0x757c('0x3')]){var _0x19dfb4=_0x13d44a[_0x757c('0x4')];var _0x3422ad=_0x13d44a['license'];var _0x5bfc95=_0x19dfb4[_0x757c('0x5')]('-')[0x4];var _0x4cedde=_0x19dfb4['split']('-')[0x0];var _0x422a8c=crypto[_0x757c('0x6')]('aes-256-ctr',util[_0x757c('0x7')](_0x757c('0x8'),_0x5bfc95,_0x19dfb4,_0x4cedde));var _0x884590=_0x422a8c[_0x757c('0x9')](_0x3422ad,_0x757c('0xa'),'utf8');_0x884590+=_0x422a8c[_0x757c('0xb')](_0x757c('0xc'));var _0x304433=JSON[_0x757c('0xd')](_0x884590);return _0x304433['hasOwnProperty'](_0x166879)?_0x304433[_0x166879]:null;}}return null;}function isLimit(_0x489e76,_0x4df37f,_0x752187,_0x18a188){var _0x22c990=_0x4df37f;return compose()[_0x757c('0xe')](function(_0x1549d1,_0x3dcb2c,_0x17e1c3){return db[_0x757c('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x757c('0x10')](function(_0x5ea6ce){var _0x4126f9=getValueFromLicense(_0x489e76,_0x5ea6ce);return _0x4126f9?_0x4126f9:_0x22c990;})[_0x757c('0x10')](function(_0x5c9cb5){_0x22c990=_0x5c9cb5;return _0x752187[_0x757c('0x11')](_0x18a188);})[_0x757c('0x10')](function(_0x42bfaf){if(_0x42bfaf>=_0x22c990){return _0x3dcb2c['status'](0x193)[_0x757c('0x12')]({'message':util['format'](_0x757c('0x13'),_0x489e76)});}_0x17e1c3();})[_0x757c('0x14')](function(_0x1b3e30){_0x17e1c3(_0x1b3e30);});});}function isUserLimit(){return isLimit(_0x757c('0x15'),0x1,db[_0x757c('0x16')],{'where':{'$or':[{'role':_0x757c('0x17')},{'role':_0x757c('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x7494=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','isUserLimit','util','composable-middleware'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x7494,0x184));var _0x4749=function(_0x58fad9,_0x2240fe){_0x58fad9=_0x58fad9-0x0;var _0x164653=_0x7494[_0x58fad9];return _0x164653;};'use strict';var crypto=require('crypto');var util=require(_0x4749('0x0'));var compose=require(_0x4749('0x1'));var db=require(_0x4749('0x2'))['db'];var config=require(_0x4749('0x3'));function getValueFromLicense(_0x46cb36,_0x21a2e9){if(_0x46cb36&&_0x21a2e9){if(_0x21a2e9[_0x4749('0x4')]&&_0x21a2e9[_0x4749('0x5')]){var _0x42b6ab=_0x21a2e9[_0x4749('0x4')];var _0x377697=_0x21a2e9['license'];var _0x4ba070=_0x42b6ab[_0x4749('0x6')]('-')[0x4];var _0x3da7ad=_0x42b6ab['split']('-')[0x0];var _0x2f1923=crypto[_0x4749('0x7')]('aes-256-ctr',util[_0x4749('0x8')](_0x4749('0x9'),_0x4ba070,_0x42b6ab,_0x3da7ad));var _0x5eb979=_0x2f1923[_0x4749('0xa')](_0x377697,_0x4749('0xb'),_0x4749('0xc'));_0x5eb979+=_0x2f1923['final'](_0x4749('0xc'));var _0x38a9a0=JSON[_0x4749('0xd')](_0x5eb979);return _0x38a9a0[_0x4749('0xe')](_0x46cb36)?_0x38a9a0[_0x46cb36]:null;}}return null;}function isLimit(_0x1e14e0,_0x329267,_0x301320,_0xbd25b5){var _0x45f56b=_0x329267;return compose()['use'](function(_0x417e6b,_0x3468df,_0x5c43b9){return db[_0x4749('0xf')][_0x4749('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0xeaea79){var _0x3b6a3e=getValueFromLicense(_0x1e14e0,_0xeaea79);return _0x3b6a3e?_0x3b6a3e:_0x45f56b;})[_0x4749('0x11')](function(_0x3b95b5){_0x45f56b=_0x3b95b5;return _0x301320[_0x4749('0x12')](_0xbd25b5);})[_0x4749('0x11')](function(_0x1e443e){if(_0x1e443e>=_0x45f56b){return _0x3468df[_0x4749('0x13')](0x193)[_0x4749('0x14')]({'message':util[_0x4749('0x8')](_0x4749('0x15'),_0x1e14e0)});}_0x5c43b9();})[_0x4749('0x16')](function(_0x172bc7){_0x5c43b9(_0x172bc7);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x4749('0x17')},{'role':_0x4749('0x18')}]}});}exports[_0x4749('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 9e2cfe8..80dcf0d 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 _0x3aaf=['lodash','moment','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','filter','indexOf','map','conditions','buildExpression','DATE','operator','value','includes','$gt','$lte','add','days','format','castTo','CAST(','field','\x20AS\x20','text','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','$eq','=\x20?','$substring','$startsWith','$endsWith','$lt','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','seconds'];(function(_0x22e03f,_0x16d99c){var _0x32a84c=function(_0x406fa7){while(--_0x406fa7){_0x22e03f['push'](_0x22e03f['shift']());}};_0x32a84c(++_0x16d99c);}(_0x3aaf,0x144));var _0xf3aa=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x3aaf[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xf3aa('0x0'));var moment=require(_0xf3aa('0x1'));exports['parseSearch']=function(_0x334af2){var _0xc57429={'conditions':[]};_0xc57429[_0xf3aa('0x2')]=_[_0xf3aa('0x3')](_0x334af2,'[$or]')?'or':_0xf3aa('0x4');var _0x5bb1e9=_0x334af2[_0xf3aa('0x5')](_0xf3aa('0x6'),'')[_0xf3aa('0x5')](_0xf3aa('0x7'),'')[_0xf3aa('0x8')]('||');for(var _0x413ca7=0x0;_0x413ca7<_0x5bb1e9[_0xf3aa('0x9')];_0x413ca7++){var _0x77c2f=_0x5bb1e9[_0x413ca7][_0xf3aa('0x8')](':=');var _0x30728b=_0x77c2f[0x0];var _0x32df9e=_0x77c2f[_0xf3aa('0xa')](0x1);_0x32df9e[_0xf3aa('0xb')](function(_0x52bab5){var _0x494d52=_0x52bab5['split']('[')[_0xf3aa('0xc')]();var _0x4272b9=_0x52bab5['match'](/\[(.*?)\]/g);_0x4272b9[_0xf3aa('0xb')](function(_0x4fbf88){var _0x381dec=_0x4fbf88[_0xf3aa('0x8')]('[')[_0xf3aa('0xd')](function(_0x565409){return _0x565409[_0xf3aa('0xe')](']')>-0x1;})[_0xf3aa('0xf')](function(_0x3d218d){return _0x3d218d['split'](']')[0x0];})[0x0];_0xc57429[_0xf3aa('0x10')]['push']({'field':_0x30728b,'operator':_0x494d52,'value':_0x381dec});});});}return _0xc57429;};exports[_0xf3aa('0x11')]=function(_0x95e7ef,_0x346ae2,_0x32be33){var _0x43ba29={};if(_0x346ae2===_0xf3aa('0x12')){if(_0x32be33[_0xf3aa('0x13')]==='$eq'){_0x32be33[_0xf3aa('0x13')]='$between';_0x32be33[_0xf3aa('0x14')]+=','+_0x32be33[_0xf3aa('0x14')];}else if(_[_0xf3aa('0x15')]([_0xf3aa('0x16'),_0xf3aa('0x17')],_0x32be33[_0xf3aa('0x13')])){_0x32be33['value']=moment(_0x32be33['value'])[_0xf3aa('0x18')](0x1,_0xf3aa('0x19'))[_0xf3aa('0x1a')]('YYYY-MM-DD');}}if(_0x32be33[_0xf3aa('0x1b')]){_0x346ae2=_0x32be33[_0xf3aa('0x1b')];_0x43ba29['text']=_0xf3aa('0x1c')+_0x95e7ef+'.'+_0x32be33[_0xf3aa('0x1d')]+_0xf3aa('0x1e')+_0x32be33[_0xf3aa('0x1b')]+')\x20'+parseOperator(_0x32be33[_0xf3aa('0x13')]);}else{_0x43ba29[_0xf3aa('0x1f')]=_0x95e7ef+'.'+_0x32be33[_0xf3aa('0x1d')]+'\x20'+parseOperator(_0x32be33[_0xf3aa('0x13')]);}if(_[_0xf3aa('0x15')](['$ne','$notIn'],_0x32be33['operator']))_0x43ba29[_0xf3aa('0x1f')]='('+_0x43ba29['text']+'\x20OR\x20'+_0x95e7ef+'.'+_0x32be33['field']+_0xf3aa('0x20');_0x43ba29[_0xf3aa('0x14')]=parseValue(_0x346ae2,_0x32be33[_0xf3aa('0x13')],_0x32be33[_0xf3aa('0x14')]);return _0x43ba29;};function parseOperator(_0x2de6f8){var _0x436162;switch(_0x2de6f8){case _0xf3aa('0x21'):_0x436162=_0xf3aa('0x22');break;case _0xf3aa('0x23'):_0x436162=_0xf3aa('0x24');break;case _0xf3aa('0x25'):_0x436162=_0xf3aa('0x26');break;case'$ne':_0x436162='<>\x20?';break;case _0xf3aa('0x27'):case _0xf3aa('0x28'):case _0xf3aa('0x29'):_0x436162='LIKE\x20?';break;case _0xf3aa('0x2a'):_0x436162='<\x20?';break;case'$gt':_0x436162=_0xf3aa('0x2b');break;case _0xf3aa('0x17'):_0x436162=_0xf3aa('0x2c');break;case _0xf3aa('0x2d'):_0x436162=_0xf3aa('0x2e');break;case _0xf3aa('0x2f'):_0x436162=_0xf3aa('0x30');break;}return _0x436162;}function parseValue(_0x2b8552,_0x7e4bd4,_0x3aa0cb){var _0x320eeb={'start':undefined,'end':undefined};switch(_0x7e4bd4){case _0xf3aa('0x21'):case'$notIn':_0x320eeb['start']=_0x3aa0cb[_0xf3aa('0x8')](',');break;case'$substring':_0x320eeb['start']='%'+_0x3aa0cb+'%';break;case'$startsWith':_0x320eeb[_0xf3aa('0x31')]=_0x3aa0cb+'%';break;case'$endsWith':_0x320eeb[_0xf3aa('0x31')]='%'+_0x3aa0cb;break;case _0xf3aa('0x2f'):var _0x13ec89=_0x3aa0cb[_0xf3aa('0x8')](',');var _0x3aa0cb=_0x13ec89[_0xf3aa('0xc')]();var _0x5b3105=_0x13ec89[_0xf3aa('0x32')]();if(_0x2b8552===_0xf3aa('0x12')){_0x3aa0cb=moment(_0x3aa0cb)[_0xf3aa('0x33')](0x0,!![])[_0xf3aa('0x1a')]();_0x5b3105=moment(_0x5b3105)['utcOffset'](0x0,!![])[_0xf3aa('0x18')](0x17,'hours')['add'](0x3b,_0xf3aa('0x34'))['add'](0x3b,_0xf3aa('0x35'))[_0xf3aa('0x1a')]();}_0x320eeb={'start':_0x3aa0cb,'end':_0x5b3105};break;default:_0x320eeb[_0xf3aa('0x31')]=_0x3aa0cb;break;}return _0x320eeb;} \ No newline at end of file +var _0xb697=['NOT\x20IN\x20?','=\x20?','<>\x20?','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','$startsWith','shift','utcOffset','add','hours','moment','parseSearch','startsWith','and','replace','[$and]','split','match','forEach','filter','indexOf','map','conditions','buildExpression','DATE','$eq','operator','$between','includes','$lte','value','format','YYYY-MM-DD','CAST(','field','\x20AS\x20','text','$ne','\x20IS\x20NULL)','$in','IN\x20?','$notIn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb697,0xa8));var _0x7b69=function(_0x4c45e8,_0x140356){_0x4c45e8=_0x4c45e8-0x0;var _0x551fed=_0xb697[_0x4c45e8];return _0x551fed;};'use strict';var _=require('lodash');var moment=require(_0x7b69('0x0'));exports[_0x7b69('0x1')]=function(_0x1d0260){var _0x2a8808={'conditions':[]};_0x2a8808['sqlOperator']=_[_0x7b69('0x2')](_0x1d0260,'[$or]')?'or':_0x7b69('0x3');var _0x5e6665=_0x1d0260[_0x7b69('0x4')](_0x7b69('0x5'),'')['replace']('[$or]','')[_0x7b69('0x6')]('||');for(var _0x362a52=0x0;_0x362a52<_0x5e6665['length'];_0x362a52++){var _0x13a1ff=_0x5e6665[_0x362a52]['split'](':=');var _0x349d0d=_0x13a1ff[0x0];var _0x51d91e=_0x13a1ff['slice'](0x1);_0x51d91e['forEach'](function(_0x206f77){var _0x1b0551=_0x206f77[_0x7b69('0x6')]('[')['shift']();var _0x1c80e1=_0x206f77[_0x7b69('0x7')](/\[(.*?)\]/g);_0x1c80e1[_0x7b69('0x8')](function(_0x51488f){var _0x140697=_0x51488f['split']('[')[_0x7b69('0x9')](function(_0x2f5fda){return _0x2f5fda[_0x7b69('0xa')](']')>-0x1;})[_0x7b69('0xb')](function(_0x5c0ffc){return _0x5c0ffc['split'](']')[0x0];})[0x0];_0x2a8808[_0x7b69('0xc')]['push']({'field':_0x349d0d,'operator':_0x1b0551,'value':_0x140697});});});}return _0x2a8808;};exports[_0x7b69('0xd')]=function(_0x84dbad,_0x5d50dd,_0x2a3c83){var _0x3434a7={};if(_0x5d50dd===_0x7b69('0xe')){if(_0x2a3c83['operator']===_0x7b69('0xf')){_0x2a3c83[_0x7b69('0x10')]=_0x7b69('0x11');_0x2a3c83['value']+=','+_0x2a3c83['value'];}else if(_[_0x7b69('0x12')](['$gt',_0x7b69('0x13')],_0x2a3c83[_0x7b69('0x10')])){_0x2a3c83['value']=moment(_0x2a3c83[_0x7b69('0x14')])['add'](0x1,'days')[_0x7b69('0x15')](_0x7b69('0x16'));}}if(_0x2a3c83['castTo']){_0x5d50dd=_0x2a3c83['castTo'];_0x3434a7['text']=_0x7b69('0x17')+_0x84dbad+'.'+_0x2a3c83[_0x7b69('0x18')]+_0x7b69('0x19')+_0x2a3c83['castTo']+')\x20'+parseOperator(_0x2a3c83[_0x7b69('0x10')]);}else{_0x3434a7[_0x7b69('0x1a')]=_0x84dbad+'.'+_0x2a3c83[_0x7b69('0x18')]+'\x20'+parseOperator(_0x2a3c83[_0x7b69('0x10')]);}if(_[_0x7b69('0x12')]([_0x7b69('0x1b'),'$notIn'],_0x2a3c83[_0x7b69('0x10')]))_0x3434a7[_0x7b69('0x1a')]='('+_0x3434a7[_0x7b69('0x1a')]+'\x20OR\x20'+_0x84dbad+'.'+_0x2a3c83[_0x7b69('0x18')]+_0x7b69('0x1c');_0x3434a7['value']=parseValue(_0x5d50dd,_0x2a3c83['operator'],_0x2a3c83['value']);return _0x3434a7;};function parseOperator(_0x2b8943){var _0xfc1209;switch(_0x2b8943){case _0x7b69('0x1d'):_0xfc1209=_0x7b69('0x1e');break;case _0x7b69('0x1f'):_0xfc1209=_0x7b69('0x20');break;case _0x7b69('0xf'):_0xfc1209=_0x7b69('0x21');break;case _0x7b69('0x1b'):_0xfc1209=_0x7b69('0x22');break;case'$substring':case'$startsWith':case'$endsWith':_0xfc1209=_0x7b69('0x23');break;case _0x7b69('0x24'):_0xfc1209=_0x7b69('0x25');break;case'$gt':_0xfc1209=_0x7b69('0x26');break;case _0x7b69('0x13'):_0xfc1209=_0x7b69('0x27');break;case _0x7b69('0x28'):_0xfc1209=_0x7b69('0x29');break;case _0x7b69('0x11'):_0xfc1209=_0x7b69('0x2a');break;}return _0xfc1209;}function parseValue(_0x46d40e,_0x1cf1c9,_0x242948){var _0x297822={'start':undefined,'end':undefined};switch(_0x1cf1c9){case'$in':case _0x7b69('0x1f'):_0x297822[_0x7b69('0x2b')]=_0x242948[_0x7b69('0x6')](',');break;case _0x7b69('0x2c'):_0x297822[_0x7b69('0x2b')]='%'+_0x242948+'%';break;case _0x7b69('0x2d'):_0x297822[_0x7b69('0x2b')]=_0x242948+'%';break;case'$endsWith':_0x297822[_0x7b69('0x2b')]='%'+_0x242948;break;case _0x7b69('0x11'):var _0xe5b2aa=_0x242948[_0x7b69('0x6')](',');var _0x242948=_0xe5b2aa[_0x7b69('0x2e')]();var _0x34a45e=_0xe5b2aa['pop']();if(_0x46d40e===_0x7b69('0xe')){_0x242948=moment(_0x242948)[_0x7b69('0x2f')](0x0,!![])[_0x7b69('0x15')]();_0x34a45e=moment(_0x34a45e)['utcOffset'](0x0,!![])[_0x7b69('0x30')](0x17,_0x7b69('0x31'))[_0x7b69('0x30')](0x3b,'minutes')[_0x7b69('0x30')](0x3b,'seconds')[_0x7b69('0x15')]();}_0x297822={'start':_0x242948,'end':_0x34a45e};break;default:_0x297822[_0x7b69('0x2b')]=_0x242948;break;}return _0x297822;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index ee038b7..8a938cc 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 _0x1b8a=['alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','format','utc','YYYY-MM-DD','subtract','name','isArray','limit','offset','map','cast','col','priority','DESC','unsigned','ASC','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','attributes','intersection','nolimit','sort','pick','filter','object','includes','columns','value','merge','where','VIRTUAL','lower','options','include','includeAll','lodash','sequelize','moment','../../mysqldb','keys','parse','model'];(function(_0x15d557,_0x4edec7){var _0x57f9a3=function(_0xf07895){while(--_0xf07895){_0x15d557['push'](_0x15d557['shift']());}};_0x57f9a3(++_0x4edec7);}(_0x1b8a,0xc8));var _0xa1b8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b8a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa1b8('0x0'));var sequelize=require(_0xa1b8('0x1'));var moment=require(_0xa1b8('0x2'));var db=require(_0xa1b8('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x328dbb){var _0x50f4e3=['ne'];try{var _0x290396=JSON['parse'](_0x328dbb);var _0x572a88=Object[_0xa1b8('0x4')](_0x290396)[0x0];return _0x50f4e3['includes'](_0x572a88);}catch(_0x4cb536){return![];}}function getOperatorValue(_0x1e9ba4){var _0xde0955=JSON[_0xa1b8('0x5')](_0x1e9ba4);var _0x4bb756=Object[_0xa1b8('0x4')](_0xde0955)[0x0];var _0x5aad6c=_0xde0955[_0x4bb756];return{['$'+_0x4bb756]:_0x5aad6c};}function parseIncludeModel(_0x5e48fb){var _0x5d21be=JSON[_0xa1b8('0x5')](_0x5e48fb);return{'model':db[_0x5d21be[_0xa1b8('0x6')]],'as':_0x5d21be[_0xa1b8('0x7')],'attributes':_0x5d21be[_0xa1b8('0x8')],'raw':_0x5d21be[_0xa1b8('0x9')]};}exports[_0xa1b8('0x8')]=function(_0x2557a7){var _0x10d489=null;if(_0x2557a7){_0x10d489=_0x2557a7[_0xa1b8('0xa')](',');}return _0x10d489;};exports[_0xa1b8('0xb')]=function(_0x35178a,_0xda3efc){var _0x4ce1c6={};if(!_[_0xa1b8('0xc')](_0x35178a)){_[_0xa1b8('0xd')](_0x35178a,function(_0x11c8a6,_0xf1b2ab){try{if(_0xda3efc){var _0x2c5ed0=_[_0xa1b8('0xe')](_0xda3efc,{'name':_0xf1b2ab})||{};if(hasSequelizeOperator(_0x11c8a6)){_0x4ce1c6[_0xf1b2ab]=getOperatorValue(_0x11c8a6);}else if(_0x2c5ed0[_0xa1b8('0xf')]===_0xa1b8('0x10')&&_['isPlainObject'](_0x11c8a6)){var _0x43b9fe=JSON[_0xa1b8('0x5')](_0x11c8a6);var _0x527e37={'$gte':moment(moment(_0x43b9fe['$gte'])[_0xa1b8('0x11')]('YYYY-MM-DD'))[_0xa1b8('0x12')]()[_0xa1b8('0x11')](),'$lte':moment(moment(_0x43b9fe['$lte'])['format'](_0xa1b8('0x13')))['utc']()[_0xa1b8('0x14')](0x1,'s')[_0xa1b8('0x11')]()};_0x4ce1c6[_0xf1b2ab]=_0x527e37;}else if(_0x2c5ed0[_0xa1b8('0x15')]==='uniqueid'){_0x4ce1c6[_0xf1b2ab]=_0x11c8a6;}else{_0x4ce1c6[_0xf1b2ab]=_['isArray'](_0x11c8a6)?_0x11c8a6:JSON[_0xa1b8('0x5')](_0x11c8a6);}}else{_0x4ce1c6[_0xf1b2ab]=_[_0xa1b8('0x16')](_0x11c8a6)?_0x11c8a6:JSON['parse'](_0x11c8a6);}}catch(_0x246176){_0x4ce1c6[_0xf1b2ab]=_0x11c8a6['split'](',');}});}return _0x4ce1c6;};exports[_0xa1b8('0x17')]=function(_0x1893b2){_0x1893b2=parseInt(_0x1893b2,0xa);if(!_0x1893b2||_0x1893b2<0x0){_0x1893b2=LIMIT_VALUE;}return _0x1893b2;};exports[_0xa1b8('0x18')]=function(_0x15cba0){_0x15cba0=parseInt(_0x15cba0,0xa);if(!_0x15cba0||_0x15cba0<0x0){_0x15cba0=0x0;}return _0x15cba0;};exports['sort']=function(_0x378fef){var _0x518514,_0x2b7a9f=null;if(_0x378fef){_0x518514=_0x378fef[_0xa1b8('0xa')](',');_0x2b7a9f=_[_0xa1b8('0x19')](_0x518514,function(_0x322fcd){if(_0x322fcd['indexOf']('-')===0x0){return[_0x322fcd==='priority'?sequelize[_0xa1b8('0x1a')](sequelize[_0xa1b8('0x1b')](_0xa1b8('0x1c')),'unsigned'):_0x322fcd['substr'](0x1),_0xa1b8('0x1d')];}else{return[_0x322fcd==='priority'?sequelize['cast'](sequelize[_0xa1b8('0x1b')](_0xa1b8('0x1c')),_0xa1b8('0x1e')):_0x322fcd,_0xa1b8('0x1f')];}});}return _0x2b7a9f;};exports['omit']=function(_0x3f675e,_0x307811){if(_[_0xa1b8('0xc')](_0x3f675e)){return _0x3f675e;}if(_[_0xa1b8('0x16')](_0x3f675e)){for(var _0x44c2eb=0x0;_0x44c2eb<_0x3f675e['length'];_0x44c2eb+=0x1){_0x3f675e[_0x44c2eb]=this[_0xa1b8('0x20')](_0x3f675e[_0x44c2eb],_0x307811);}return _0x3f675e;}if(!_[_0xa1b8('0x21')](_0x3f675e)){return _0x3f675e;}if(_[_0xa1b8('0x22')](_0x307811)){_0x307811=[_0x307811];}if(!_[_0xa1b8('0x16')](_0x307811)){return _0x3f675e;}for(var _0x364537=0x0;_0x364537<_0x307811[_0xa1b8('0x23')];_0x364537+=0x1){_[_0xa1b8('0x24')](_0x3f675e,_0x307811[_0x364537]);}for(var _0x468d75 in _0x3f675e){if(_0x3f675e[_0xa1b8('0x25')](_0x468d75)){_0x3f675e[_0x468d75]=this[_0xa1b8('0x20')](_0x3f675e[_0x468d75],_0x307811);}}return _0x3f675e;};exports[_0xa1b8('0x26')]=function(_0x3ac1d9){return _0x3ac1d9[_0xa1b8('0x27')](RegExp(_0xa1b8('0x28')))?!![]:![];};exports[_0xa1b8('0x29')]=function(_0x59b7b6){return _0x59b7b6['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa1b8('0x2a')]=function(_0xcd1cac,_0xc32004){var _0x12e6b0=[];var _0xf53afe=/[ `!@#$%^&*()_\-?~]/;var _0x567990=_0xc32004?_0xa1b8('0x2b'):_0xa1b8('0x2c');_0xcd1cac[_0xa1b8('0xa')](/[ ,]+/)[_0xa1b8('0x2d')](function(_0x7a6338){_0x7a6338=_0x7a6338[_0xa1b8('0x2e')](/([^:]")"+/g,'$1');_0x7a6338='+'+_0x7a6338+'*';var _0x96f155=_0x7a6338[_0xa1b8('0x27')](_0xf53afe);if(_0x96f155){_0x7a6338='\x22'+_0x7a6338+'\x22';}_0x12e6b0[_0xa1b8('0x2f')](_0x7a6338);});_0x567990=_0x567990['replace'](_0xa1b8('0x2c'),_0x12e6b0[_0xa1b8('0x30')]('\x20'));return _0x567990;};exports[_0xa1b8('0x31')]=function(_0x1dcc7f,_0x1bc4db,_0x321bd3){var _0x24fc83={},_0x8f36da={};if(_0x1bc4db[_0xa1b8('0x32')][_0xa1b8('0x33')]){_0x1bc4db['query']['id']=_0x1bc4db['query'][_0xa1b8('0x33')];delete _0x1bc4db[_0xa1b8('0x32')][_0xa1b8('0x33')];}_0x24fc83[_0xa1b8('0x6')]=_['map'](_0x1dcc7f,_0xa1b8('0x15'));_0x24fc83[_0xa1b8('0x32')]=_[_0xa1b8('0x4')](_0x1bc4db['query']);_0x24fc83['filters']=_['intersection'](_0x24fc83[_0xa1b8('0x6')],_0x24fc83[_0xa1b8('0x32')]);_0x8f36da[_0xa1b8('0x34')]=_[_0xa1b8('0x35')](_0x24fc83[_0xa1b8('0x6')],this[_0xa1b8('0x8')](_0x1bc4db[_0xa1b8('0x32')][_0xa1b8('0x8')]));_0x8f36da[_0xa1b8('0x34')]=_0x8f36da[_0xa1b8('0x34')][_0xa1b8('0x23')]?_0x8f36da[_0xa1b8('0x34')]:_0x24fc83['model'];if(!_0x1bc4db[_0xa1b8('0x32')][_0xa1b8('0x25')](_0xa1b8('0x36'))){_0x8f36da[_0xa1b8('0x17')]=this[_0xa1b8('0x17')](_0x1bc4db[_0xa1b8('0x32')][_0xa1b8('0x17')]);_0x8f36da['offset']=this[_0xa1b8('0x18')](_0x1bc4db['query'][_0xa1b8('0x18')]);}_0x8f36da['order']=this['sort'](_0x1bc4db['query'][_0xa1b8('0x37')]);_0x8f36da['where']=this[_0xa1b8('0xb')](_[_0xa1b8('0x38')](_0x1bc4db['query'],_0x24fc83[_0xa1b8('0xb')]),_0x1dcc7f);if(_0x1bc4db[_0xa1b8('0x32')][_0xa1b8('0x39')]){var _0x29e660=_0x1dcc7f;var _0x41e19e=_0x1bc4db[_0xa1b8('0x32')]['filter'];if(typeof _0x41e19e===_0xa1b8('0x3a')){_0x29e660=_[_0xa1b8('0x39')](_0x1dcc7f,function(_0x251045){return _[_0xa1b8('0x3b')](_0x41e19e[_0xa1b8('0x3c')],_0x251045['name']);});_0x41e19e=_0x41e19e[_0xa1b8('0x3d')];}_0x8f36da['where']=_[_0xa1b8('0x3e')](_0x8f36da[_0xa1b8('0x3f')],{'$or':_[_0xa1b8('0x19')](_0x29e660,function(_0x104232){if(_0x104232[_0xa1b8('0xf')]!==_0xa1b8('0x40')){if(_0x321bd3){return sequelize[_0xa1b8('0x3f')](sequelize['fn'](_0xa1b8('0x41'),sequelize[_0xa1b8('0x1b')](_0x104232[_0xa1b8('0x15')])),{'$like':sequelize['fn']('lower','%'+_0x1bc4db['query'][_0xa1b8('0x39')]+'%')});}else{var _0x4edf96={};_0x4edf96[_0x104232[_0xa1b8('0x15')]]={'$like':'%'+_0x1bc4db[_0xa1b8('0x32')][_0xa1b8('0x39')]+'%'};return _0x4edf96;}}})});}_0x8f36da=_[_0xa1b8('0x3e')]({},_0x8f36da,_0x1bc4db[_0xa1b8('0x42')]);return _0x8f36da;};exports[_0xa1b8('0x43')]=function(_0xe2529f){var _0x31afee=[];if(_0xe2529f[_0xa1b8('0x44')]){_0x31afee[_0xa1b8('0x2f')]({'all':!![]});}else if(_0xe2529f[_0xa1b8('0x43')]){if(Array['isArray'](_0xe2529f['include'])){_0x31afee=Object[_0xa1b8('0x4')](_0xe2529f['include'])[_0xa1b8('0x19')](function(_0x30375f){return parseIncludeModel(_0xe2529f['include'][_0x30375f]);});}else{var _0x510c39=parseIncludeModel(_0xe2529f['include']);_0x31afee[_0xa1b8('0x2f')](_0x510c39);}}return _0x31afee;}; \ No newline at end of file +var _0x85d8=['match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','push','replace','join','getOptions','query','$id','name','intersection','attributes','nolimit','where','pick','filter','object','columns','type','lower','options','include','lodash','sequelize','moment','../../mysqldb','parse','keys','model','alias','fields','raw','split','filters','isEmpty','forOwn','DATE','isPlainObject','$gte','utc','format','$lte','YYYY-MM-DD','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','cast','col','priority','substr','DESC','unsigned','ASC','omit','length','isObject','isString','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x85d8,0x1b0));var _0x885d=function(_0x12bb96,_0x286131){_0x12bb96=_0x12bb96-0x0;var _0x385fd7=_0x85d8[_0x12bb96];return _0x385fd7;};'use strict';var _=require(_0x885d('0x0'));var sequelize=require(_0x885d('0x1'));var moment=require(_0x885d('0x2'));var db=require(_0x885d('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3e5eab){var _0x5bad48=['ne'];try{var _0x328261=JSON[_0x885d('0x4')](_0x3e5eab);var _0x320d7d=Object[_0x885d('0x5')](_0x328261)[0x0];return _0x5bad48['includes'](_0x320d7d);}catch(_0x586a81){return![];}}function getOperatorValue(_0x186504){var _0x30dcc2=JSON[_0x885d('0x4')](_0x186504);var _0x1df2e5=Object[_0x885d('0x5')](_0x30dcc2)[0x0];var _0x11e6d7=_0x30dcc2[_0x1df2e5];return{['$'+_0x1df2e5]:_0x11e6d7};}function parseIncludeModel(_0x1a9f6e){var _0xe09cf7=JSON[_0x885d('0x4')](_0x1a9f6e);return{'model':db[_0xe09cf7[_0x885d('0x6')]],'as':_0xe09cf7[_0x885d('0x7')],'attributes':_0xe09cf7[_0x885d('0x8')],'raw':_0xe09cf7[_0x885d('0x9')]};}exports[_0x885d('0x8')]=function(_0x19c903){var _0x46bd88=null;if(_0x19c903){_0x46bd88=_0x19c903[_0x885d('0xa')](',');}return _0x46bd88;};exports[_0x885d('0xb')]=function(_0x37a4b1,_0x503ea7){var _0x542805={};if(!_[_0x885d('0xc')](_0x37a4b1)){_[_0x885d('0xd')](_0x37a4b1,function(_0x495a56,_0x330b42){try{if(_0x503ea7){var _0x458d5d=_['find'](_0x503ea7,{'name':_0x330b42})||{};if(hasSequelizeOperator(_0x495a56)){_0x542805[_0x330b42]=getOperatorValue(_0x495a56);}else if(_0x458d5d['type']===_0x885d('0xe')&&_[_0x885d('0xf')](_0x495a56)){var _0x143ee3=JSON[_0x885d('0x4')](_0x495a56);var _0x2ecb5c={'$gte':moment(moment(_0x143ee3[_0x885d('0x10')])['format']('YYYY-MM-DD'))[_0x885d('0x11')]()[_0x885d('0x12')](),'$lte':moment(moment(_0x143ee3[_0x885d('0x13')])[_0x885d('0x12')](_0x885d('0x14')))[_0x885d('0x11')]()[_0x885d('0x15')](0x1,'s')[_0x885d('0x12')]()};_0x542805[_0x330b42]=_0x2ecb5c;}else if(_0x458d5d['name']===_0x885d('0x16')){_0x542805[_0x330b42]=_0x495a56;}else{_0x542805[_0x330b42]=_[_0x885d('0x17')](_0x495a56)?_0x495a56:JSON[_0x885d('0x4')](_0x495a56);}}else{_0x542805[_0x330b42]=_[_0x885d('0x17')](_0x495a56)?_0x495a56:JSON[_0x885d('0x4')](_0x495a56);}}catch(_0x5a72b8){_0x542805[_0x330b42]=_0x495a56[_0x885d('0xa')](',');}});}return _0x542805;};exports[_0x885d('0x18')]=function(_0x55738d){_0x55738d=parseInt(_0x55738d,0xa);if(!_0x55738d||_0x55738d<0x0){_0x55738d=LIMIT_VALUE;}return _0x55738d;};exports[_0x885d('0x19')]=function(_0x583637){_0x583637=parseInt(_0x583637,0xa);if(!_0x583637||_0x583637<0x0){_0x583637=0x0;}return _0x583637;};exports[_0x885d('0x1a')]=function(_0x2a1c31){var _0x22550d,_0x90589=null;if(_0x2a1c31){_0x22550d=_0x2a1c31[_0x885d('0xa')](',');_0x90589=_[_0x885d('0x1b')](_0x22550d,function(_0x22220e){if(_0x22220e[_0x885d('0x1c')]('-')===0x0){return[_0x22220e==='priority'?sequelize[_0x885d('0x1d')](sequelize[_0x885d('0x1e')](_0x885d('0x1f')),'unsigned'):_0x22220e[_0x885d('0x20')](0x1),_0x885d('0x21')];}else{return[_0x22220e===_0x885d('0x1f')?sequelize[_0x885d('0x1d')](sequelize[_0x885d('0x1e')](_0x885d('0x1f')),_0x885d('0x22')):_0x22220e,_0x885d('0x23')];}});}return _0x90589;};exports[_0x885d('0x24')]=function(_0x54e121,_0x5eb6a0){if(_[_0x885d('0xc')](_0x54e121)){return _0x54e121;}if(_['isArray'](_0x54e121)){for(var _0x1dda46=0x0;_0x1dda46<_0x54e121[_0x885d('0x25')];_0x1dda46+=0x1){_0x54e121[_0x1dda46]=this[_0x885d('0x24')](_0x54e121[_0x1dda46],_0x5eb6a0);}return _0x54e121;}if(!_[_0x885d('0x26')](_0x54e121)){return _0x54e121;}if(_[_0x885d('0x27')](_0x5eb6a0)){_0x5eb6a0=[_0x5eb6a0];}if(!_[_0x885d('0x17')](_0x5eb6a0)){return _0x54e121;}for(var _0x537886=0x0;_0x537886<_0x5eb6a0[_0x885d('0x25')];_0x537886+=0x1){_[_0x885d('0x28')](_0x54e121,_0x5eb6a0[_0x537886]);}for(var _0x502e8d in _0x54e121){if(_0x54e121[_0x885d('0x29')](_0x502e8d)){_0x54e121[_0x502e8d]=this['omit'](_0x54e121[_0x502e8d],_0x5eb6a0);}}return _0x54e121;};exports['isNumeric']=function(_0x3db722){return _0x3db722['match'](RegExp(_0x885d('0x2a')))?!![]:![];};exports[_0x885d('0x2b')]=function(_0x20a5f8){return _0x20a5f8[_0x885d('0x2c')](/^\S+@\S+$/)?!![]:![];};exports[_0x885d('0x2d')]=function(_0x2b0ea6,_0x5a0f63){var _0x3347da=[];var _0x197c27=/[ `!@#$%^&*()_\-?~]/;var _0x3aab64=_0x5a0f63?_0x885d('0x2e'):_0x885d('0x2f');_0x2b0ea6['split'](/[ ,]+/)[_0x885d('0x30')](function(_0x426b38){_0x426b38=_0x426b38['replace'](/([^:]")"+/g,'$1');_0x426b38='+'+_0x426b38+'*';var _0x168a2a=_0x426b38[_0x885d('0x2c')](_0x197c27);if(_0x168a2a){_0x426b38='\x22'+_0x426b38+'\x22';}_0x3347da[_0x885d('0x31')](_0x426b38);});_0x3aab64=_0x3aab64[_0x885d('0x32')](_0x885d('0x2f'),_0x3347da[_0x885d('0x33')]('\x20'));return _0x3aab64;};exports[_0x885d('0x34')]=function(_0x46694c,_0x5547e8,_0x5b9d7b){var _0x5560af={},_0x488a93={};if(_0x5547e8[_0x885d('0x35')][_0x885d('0x36')]){_0x5547e8['query']['id']=_0x5547e8[_0x885d('0x35')]['$id'];delete _0x5547e8[_0x885d('0x35')][_0x885d('0x36')];}_0x5560af[_0x885d('0x6')]=_[_0x885d('0x1b')](_0x46694c,_0x885d('0x37'));_0x5560af[_0x885d('0x35')]=_[_0x885d('0x5')](_0x5547e8['query']);_0x5560af['filters']=_[_0x885d('0x38')](_0x5560af['model'],_0x5560af[_0x885d('0x35')]);_0x488a93['attributes']=_['intersection'](_0x5560af[_0x885d('0x6')],this[_0x885d('0x8')](_0x5547e8[_0x885d('0x35')][_0x885d('0x8')]));_0x488a93[_0x885d('0x39')]=_0x488a93[_0x885d('0x39')][_0x885d('0x25')]?_0x488a93[_0x885d('0x39')]:_0x5560af[_0x885d('0x6')];if(!_0x5547e8[_0x885d('0x35')][_0x885d('0x29')](_0x885d('0x3a'))){_0x488a93[_0x885d('0x18')]=this[_0x885d('0x18')](_0x5547e8[_0x885d('0x35')][_0x885d('0x18')]);_0x488a93['offset']=this[_0x885d('0x19')](_0x5547e8[_0x885d('0x35')][_0x885d('0x19')]);}_0x488a93['order']=this['sort'](_0x5547e8[_0x885d('0x35')][_0x885d('0x1a')]);_0x488a93[_0x885d('0x3b')]=this[_0x885d('0xb')](_[_0x885d('0x3c')](_0x5547e8['query'],_0x5560af[_0x885d('0xb')]),_0x46694c);if(_0x5547e8['query'][_0x885d('0x3d')]){var _0x13a74c=_0x46694c;var _0x52b601=_0x5547e8[_0x885d('0x35')]['filter'];if(typeof _0x52b601===_0x885d('0x3e')){_0x13a74c=_[_0x885d('0x3d')](_0x46694c,function(_0x484094){return _['includes'](_0x52b601[_0x885d('0x3f')],_0x484094[_0x885d('0x37')]);});_0x52b601=_0x52b601['value'];}_0x488a93['where']=_['merge'](_0x488a93[_0x885d('0x3b')],{'$or':_[_0x885d('0x1b')](_0x13a74c,function(_0x123e25){if(_0x123e25[_0x885d('0x40')]!=='VIRTUAL'){if(_0x5b9d7b){return sequelize[_0x885d('0x3b')](sequelize['fn'](_0x885d('0x41'),sequelize[_0x885d('0x1e')](_0x123e25[_0x885d('0x37')])),{'$like':sequelize['fn'](_0x885d('0x41'),'%'+_0x5547e8[_0x885d('0x35')][_0x885d('0x3d')]+'%')});}else{var _0x28ca61={};_0x28ca61[_0x123e25['name']]={'$like':'%'+_0x5547e8[_0x885d('0x35')][_0x885d('0x3d')]+'%'};return _0x28ca61;}}})});}_0x488a93=_['merge']({},_0x488a93,_0x5547e8[_0x885d('0x42')]);return _0x488a93;};exports[_0x885d('0x43')]=function(_0xe429ff){var _0x5c414c=[];if(_0xe429ff['includeAll']){_0x5c414c[_0x885d('0x31')]({'all':!![]});}else if(_0xe429ff[_0x885d('0x43')]){if(Array[_0x885d('0x17')](_0xe429ff[_0x885d('0x43')])){_0x5c414c=Object[_0x885d('0x5')](_0xe429ff[_0x885d('0x43')])[_0x885d('0x1b')](function(_0x4cce44){return parseIncludeModel(_0xe429ff['include'][_0x4cce44]);});}else{var _0x151615=parseIncludeModel(_0xe429ff[_0x885d('0x43')]);_0x5c414c[_0x885d('0x31')](_0x151615);}}return _0x5c414c;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 73cc3b5..44ca01e 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 _0x5fab=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','getAgents','all','flatten','includes','map','getAgentIdsByStatus','resolve','fullname','smsPause','globalStatus','getSortedAgentsIdsByStatus','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','validateSortParameter','sort','pauseType','toLowerCase','online','lastLoginAt','lastPauseAt','address','openchannelPause','chatCapacity','openchannelCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','mailStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','name','role','userpic','mailStatusTime','voiceStatusTime','faxCapacity','mailCapacity','smsCapacity','mailCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','client','http','chatPause','faxPause','mailPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','error'];(function(_0x2235fa,_0x1fd7f1){var _0x3100e=function(_0x1f4a6c){while(--_0x1f4a6c){_0x2235fa['push'](_0x2235fa['shift']());}};_0x3100e(++_0x1fd7f1);}(_0x5fab,0x177));var _0xb5fa=function(_0x569f5f,_0x1c6c5c){_0x569f5f=_0x569f5f-0x0;var _0x3e8e2e=_0x5fab[_0x569f5f];return _0x3e8e2e;};'use strict';var _=require(_0xb5fa('0x0'));var jayson=require(_0xb5fa('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xb5fa('0x2')][_0xb5fa('0x3')]({'port':0x232a});var routingClient=jayson[_0xb5fa('0x2')][_0xb5fa('0x3')]({'port':0x232c});function isAgentPaused(_0x67e8e8,_0x595d8b){var _0x29390a=[_0x67e8e8[_0xb5fa('0x4')],_0x67e8e8[_0xb5fa('0x5')],_0x67e8e8[_0xb5fa('0x6')],_0x67e8e8['openchannelPause'],_0x67e8e8['smsPause'],_0x67e8e8[_0xb5fa('0x7')],_0x67e8e8[_0xb5fa('0x8')]];if(!_0x595d8b)return _[_0xb5fa('0x9')](_0x29390a);var _0x56d018=_[_0xb5fa('0xa')](_0x29390a);return _0x56d018[_0xb5fa('0xb')]>0x0&&_0x56d018[_0xb5fa('0xb')]<_0x29390a['length']?!![]:![];}function isIdle(_0x5b5ea8){return _0x5b5ea8===_0xb5fa('0xc')||_0x5b5ea8===_0xb5fa('0xd')||_0x5b5ea8===_0xb5fa('0xe')||_0x5b5ea8===_0xb5fa('0xf')||_[_0xb5fa('0x10')](_0x5b5ea8);}function isAgentIdle(_0xadef41){if(_0xadef41[_0xb5fa('0x11')]!==_0xb5fa('0xc')&&_0xadef41[_0xb5fa('0x7')]){_0xadef41['voiceStatus']=_0xb5fa('0x12');return![];}return _[_0xb5fa('0x9')]([_0xadef41['chatStatus'],_0xadef41[_0xb5fa('0x13')],_0xadef41['mailStatus'],_0xadef41[_0xb5fa('0x14')],_0xadef41[_0xb5fa('0x15')],_0xadef41[_0xb5fa('0x11')],_0xadef41[_0xb5fa('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb5fa('0x17')]('Agents',{})['then'](function(_0x38e964){if(_0x38e964[_0xb5fa('0x18')]){throw new Error(_0xb5fa('0x19'));}var _0x27c8f7=_0x38e964['result'];return routingClient['request'](_0xb5fa('0x1a'),{})[_0xb5fa('0x1b')](function(_0x32e9e5){if(_0x32e9e5[_0xb5fa('0x18')]){throw new Error(_0xb5fa('0x1c'));}var _0x13e82b=_0x32e9e5[_0xb5fa('0x1d')];return _[_0xb5fa('0x1e')]({},_0x27c8f7,_0x13e82b);});})[_0xb5fa('0x1f')](function(_0x368cb1){throw _0x368cb1;});}exports[_0xb5fa('0x20')]=getRealtimeAgents;function getAgentStatus(_0x1f5064){var _0x5cd822=_0xb5fa('0xd');if(isAgentPaused(_0x1f5064))_0x5cd822='pause';else if(isAgentPaused(_0x1f5064,!![]))_0x5cd822=_0xb5fa('0x21');else if(isAgentIdle(_0x1f5064))_0x5cd822='idle';else _0x5cd822=_0xb5fa('0x22');return _0x5cd822;}exports[_0xb5fa('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x4e05c0,_0x40dfdf){var _0x3a2ab9=_[_0xb5fa('0x24')](_0x4e05c0)?_0x4e05c0:[_0x4e05c0];var _0x47f71a=_[_0xb5fa('0x25')](_0x40dfdf)+_0xb5fa('0x26');var _0x444237=_['map'](_0x3a2ab9,function(_0x224ec8){return db[_0x47f71a]['findOne']({'where':{'id':_0x224ec8}})[_0xb5fa('0x1b')](function(_0x264591){if(!_0x264591)return[];return _0x264591[_0xb5fa('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb5fa('0x28')](_0x444237)[_0xb5fa('0x1b')](function(_0x3f61cd){var _0x6a455c=_(_0x3f61cd)[_0xb5fa('0x29')]()['map']('id')['uniq']()['value']();return _0x6a455c;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x28a350,_0x460b54,_0x12c0d4){try{if(_0x460b54[_0xb5fa('0xb')]>0x0){_0x28a350=_0x28a350[_0xb5fa('0xa')](function(_0x3506a4){return _0x460b54[_0xb5fa('0x2a')](_0x3506a4['id']);});}var _0x353314=_0x28a350[_0xb5fa('0xa')](function(_0x2a5690){var _0x142bfa=_0xb5fa('0x22');if(isAgentIdle(_0x2a5690)){_0x142bfa=_0xb5fa('0xc');}return _0x142bfa===_0x12c0d4;});return _[_0xb5fa('0x2b')](_0x353314,'id');}catch(_0xed02e){throw _0xed02e;}}exports[_0xb5fa('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5a0152,_0x3fd1fb,_0x21fc7e){return Promise[_0xb5fa('0x2d')]()[_0xb5fa('0x1b')](function(){if(_0x3fd1fb[_0xb5fa('0xb')]>0x0){_0x5a0152=_0x5a0152[_0xb5fa('0xa')](function(_0x25fc7c){return _0x3fd1fb['includes'](_0x25fc7c['id']);});}return _0x5a0152;})[_0xb5fa('0x1b')](function(){return db['User']['findAll']({'attributes':['id','name',_0xb5fa('0x2e'),'chatPause',_0xb5fa('0x5'),'mailPause','openchannelPause',_0xb5fa('0x2f'),_0xb5fa('0x7'),'whatsappPause','pauseType'],'where':{'id':{'$in':_[_0xb5fa('0x2b')](_0x5a0152,'id')}},'raw':!![]});})[_0xb5fa('0x1b')](function(_0x252421){return _0x252421['map'](function(_0xc9adee){var _0xc28a80=_['find'](_0x5a0152,['id',_0xc9adee['id']]);var _0x18398f=filterAgentAttributes(_0xc28a80);_[_0xb5fa('0x1e')](_0xc9adee,_0x18398f);_0xc9adee[_0xb5fa('0x30')]=getAgentStatus(_0xc9adee);return _0xc9adee;});})['then'](function(_0x4652cd){var _0x2c950e=sortAgentsByStatus(_0x4652cd,_0x21fc7e);return _[_0xb5fa('0x2b')](_0x2c950e,'id');})['catch'](function(_0x117694){throw _0x117694;});}exports[_0xb5fa('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x1a4697){var _0x31ff49={'fields':[],'order':null};var _0x5e7770=_0x1a4697['split'](',');_0x31ff49['fields']=_['filter'](_0x5e7770,function(_0x5989e1){if(!_0x5989e1['includes'](_0xb5fa('0x30'))){return!![];}_0x31ff49['order']=_[_0xb5fa('0x32')](_0x5989e1,'-')?_0xb5fa('0x33'):_0xb5fa('0x34');return![];});return _0x31ff49;}exports[_0xb5fa('0x35')]=getUpdatedSortOptions;function validateSortParameter(_0x40c1c0){if(!_0x40c1c0){_0x40c1c0=_0xb5fa('0x36');}if(_0x40c1c0['includes']('fullname')&&!_0x40c1c0['includes'](_0xb5fa('0x37'))){var _0x4d23f1=_0x40c1c0[_0xb5fa('0x38')](0x0,_0x40c1c0['indexOf']('fullname'));_0x40c1c0+=','+_0x4d23f1+_0xb5fa('0x37');}return _0x40c1c0;}exports[_0xb5fa('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x2e056e,_0x36c345){var _0x5bc93f=_0x2e056e[_0xb5fa('0x3a')](function(_0x337c53,_0x83df0b){if(_0x337c53[_0xb5fa('0x30')]===_0x83df0b[_0xb5fa('0x30')]){if(_0x337c53['globalStatus']===_0xb5fa('0x12')){if(_0x36c345==='DESC'){return(_0x337c53[_0xb5fa('0x3b')]||'')<(_0x83df0b[_0xb5fa('0x3b')]||'')||_0x337c53[_0xb5fa('0x2e')][_0xb5fa('0x3c')]()>_0x83df0b[_0xb5fa('0x2e')][_0xb5fa('0x3c')]()?0x1:-0x1;}else{return(_0x337c53[_0xb5fa('0x3b')]||'')<(_0x83df0b[_0xb5fa('0x3b')]||'')||_0x337c53['fullname'][_0xb5fa('0x3c')]()>_0x83df0b[_0xb5fa('0x2e')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x36c345===_0xb5fa('0x33')){return _0x337c53['fullname'][_0xb5fa('0x3c')]()<_0x83df0b[_0xb5fa('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return _0x337c53['fullname'][_0xb5fa('0x3c')]()<_0x83df0b[_0xb5fa('0x2e')][_0xb5fa('0x3c')]()?-0x1:0x1;}}}else{if(_0x36c345===_0xb5fa('0x33')){return _0x337c53[_0xb5fa('0x30')]<_0x83df0b[_0xb5fa('0x30')]?0x1:-0x1;}else{return _0x337c53[_0xb5fa('0x30')]<_0x83df0b[_0xb5fa('0x30')]?-0x1:0x1;}}});return _0x5bc93f;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x13bf04){var _0x3e8b1d=['userpic',_0xb5fa('0x3d'),_0xb5fa('0x3e'),_0xb5fa('0x3f'),_0xb5fa('0x3b'),_0xb5fa('0x3f'),_0xb5fa('0x37'),_0xb5fa('0x40'),_0xb5fa('0x4'),_0xb5fa('0x41'),_0xb5fa('0x6'),_0xb5fa('0x2f'),_0xb5fa('0x8'),_0xb5fa('0x5'),_0xb5fa('0x7'),_0xb5fa('0x42'),_0xb5fa('0x43'),'mailCapacity','smsCapacity',_0xb5fa('0x44'),'faxCapacity',_0xb5fa('0x45'),_0xb5fa('0x46'),'mailCurrentCapacity',_0xb5fa('0x47'),_0xb5fa('0x48'),_0xb5fa('0x49'),_0xb5fa('0x4a'),_0xb5fa('0x14'),_0xb5fa('0x4b'),'smsStatus',_0xb5fa('0x16'),'faxStatus',_0xb5fa('0x11'),_0xb5fa('0x4c'),_0xb5fa('0x4d'),'mailStatusTime',_0xb5fa('0x4e'),_0xb5fa('0x4f'),'faxStatusTime','voiceStatusTime',_0xb5fa('0x50'),_0xb5fa('0x51'),_0xb5fa('0x52'),_0xb5fa('0x53'),_0xb5fa('0x54'),_0xb5fa('0x55')];var _0x31c91f=[_0xb5fa('0x4'),_0xb5fa('0x41'),_0xb5fa('0x6'),_0xb5fa('0x2f'),_0xb5fa('0x8'),_0xb5fa('0x5'),_0xb5fa('0x7'),_0xb5fa('0x3d')];var _0x42c34f=_(_0x13bf04)[_0xb5fa('0x56')](_0x31c91f)[_0xb5fa('0x57')](_0x3e8b1d)['value']();return _0x42c34f;}exports[_0xb5fa('0x58')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xb5fa('0x59'),_0xb5fa('0x2e'),_0xb5fa('0x5a'),_0xb5fa('0x37'),_0xb5fa('0x3d'),_0xb5fa('0x30'),_0xb5fa('0x5b'),_0xb5fa('0x3e'),_0xb5fa('0x3b'),'lastPauseAt','faxPause',_0xb5fa('0x4'),_0xb5fa('0x6'),_0xb5fa('0x41'),'smsPause',_0xb5fa('0x7'),_0xb5fa('0x8'),_0xb5fa('0x4a'),_0xb5fa('0x13'),_0xb5fa('0x4b'),_0xb5fa('0x14'),_0xb5fa('0x15'),'voiceStatus',_0xb5fa('0x16'),_0xb5fa('0x4c'),'faxStatusTime',_0xb5fa('0x5c'),_0xb5fa('0x4d'),'smsStatusTime',_0xb5fa('0x5d'),_0xb5fa('0x4f'),_0xb5fa('0x42'),_0xb5fa('0x5e'),_0xb5fa('0x5f'),_0xb5fa('0x43'),_0xb5fa('0x60'),_0xb5fa('0x44'),_0xb5fa('0x45'),_0xb5fa('0x49'),_0xb5fa('0x61'),_0xb5fa('0x46'),_0xb5fa('0x47'),_0xb5fa('0x48'),_0xb5fa('0x53'),_0xb5fa('0x54'),_0xb5fa('0x51'),_0xb5fa('0x62'),_0xb5fa('0x50'),_0xb5fa('0x55'),_0xb5fa('0x52')];}exports[_0xb5fa('0x63')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x7da7=['whatsappStatus','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','unknown','*pause','busy','isArray','startCase','Queue','map','getAgents','all','then','flatten','uniq','value','getAgentIdsByStatus','includes','User','findAll','chatPause','openchannelPause','pauseType','globalStatus','split','fields','order','DESC','fullname','indexOf','internal','validateSortParameter','pause','toLowerCase','sortAgentsByStatus','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','filterAgentAttributes','name','role','userpic','voiceStatusTime','whatsappStatusTime','openchannelCapacity','chatCurrentCapacity','smsCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','smsPause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voicePause','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus'];(function(_0x49391e,_0x52f162){var _0x331497=function(_0x58a7b9){while(--_0x58a7b9){_0x49391e['push'](_0x49391e['shift']());}};_0x331497(++_0x52f162);}(_0x7da7,0x10d));var _0x77da=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x7da7[_0x4a5f6c];return _0x281ffd;};'use strict';var _=require(_0x77da('0x0'));var jayson=require(_0x77da('0x1'));var db=require(_0x77da('0x2'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x77da('0x3')][_0x77da('0x4')]({'port':0x232c});function isAgentPaused(_0x4f60c3,_0x3a9fa6){var _0x37b3d9=[_0x4f60c3['chatPause'],_0x4f60c3[_0x77da('0x5')],_0x4f60c3[_0x77da('0x6')],_0x4f60c3['openchannelPause'],_0x4f60c3[_0x77da('0x7')],_0x4f60c3['voicePause'],_0x4f60c3[_0x77da('0x8')]];if(!_0x3a9fa6)return _[_0x77da('0x9')](_0x37b3d9);var _0x37c5ab=_[_0x77da('0xa')](_0x37b3d9);return _0x37c5ab[_0x77da('0xb')]>0x0&&_0x37c5ab['length']<_0x37b3d9[_0x77da('0xb')]?!![]:![];}function isIdle(_0xb55827){return _0xb55827===_0x77da('0xc')||_0xb55827==='unknown'||_0xb55827===_0x77da('0xd')||_0xb55827===_0x77da('0xe')||_[_0x77da('0xf')](_0xb55827);}function isAgentIdle(_0x2a675a){if(_0x2a675a['voiceStatus']!==_0x77da('0xc')&&_0x2a675a[_0x77da('0x10')]){_0x2a675a[_0x77da('0x11')]='pause';return![];}return _['every']([_0x2a675a[_0x77da('0x12')],_0x2a675a[_0x77da('0x13')],_0x2a675a['mailStatus'],_0x2a675a[_0x77da('0x14')],_0x2a675a[_0x77da('0x15')],_0x2a675a[_0x77da('0x11')],_0x2a675a[_0x77da('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x77da('0x17'),{})['then'](function(_0x29cd7b){if(_0x29cd7b[_0x77da('0x18')]){throw new Error(_0x77da('0x19'));}var _0x4500c4=_0x29cd7b['result'];return routingClient['request']('Agents',{})['then'](function(_0x103e46){if(_0x103e46[_0x77da('0x18')]){throw new Error(_0x77da('0x1a'));}var _0x335dcb=_0x103e46[_0x77da('0x1b')];return _[_0x77da('0x1c')]({},_0x4500c4,_0x335dcb);});})[_0x77da('0x1d')](function(_0x3b6dde){throw _0x3b6dde;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x492063){var _0xd5a809=_0x77da('0x1e');if(isAgentPaused(_0x492063))_0xd5a809='pause';else if(isAgentPaused(_0x492063,!![]))_0xd5a809=_0x77da('0x1f');else if(isAgentIdle(_0x492063))_0xd5a809=_0x77da('0xc');else _0xd5a809=_0x77da('0x20');return _0xd5a809;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x58270c,_0x3e6cfe){var _0x58f6c1=_[_0x77da('0x21')](_0x58270c)?_0x58270c:[_0x58270c];var _0x1c27aa=_[_0x77da('0x22')](_0x3e6cfe)+_0x77da('0x23');var _0x10399a=_[_0x77da('0x24')](_0x58f6c1,function(_0x95b5db){return db[_0x1c27aa]['findOne']({'where':{'id':_0x95b5db}})['then'](function(_0xfd160){if(!_0xfd160)return[];return _0xfd160[_0x77da('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x77da('0x26')](_0x10399a)[_0x77da('0x27')](function(_0x545654){var _0x42240b=_(_0x545654)[_0x77da('0x28')]()[_0x77da('0x24')]('id')[_0x77da('0x29')]()[_0x77da('0x2a')]();return _0x42240b;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xce24b8,_0x3e090d,_0x1f2279){try{if(_0x3e090d[_0x77da('0xb')]>0x0){_0xce24b8=_0xce24b8['filter'](function(_0x5b4638){return _0x3e090d['includes'](_0x5b4638['id']);});}var _0x2258e9=_0xce24b8[_0x77da('0xa')](function(_0x410d09){var _0x3394d6=_0x77da('0x20');if(isAgentIdle(_0x410d09)){_0x3394d6='idle';}return _0x3394d6===_0x1f2279;});return _[_0x77da('0x24')](_0x2258e9,'id');}catch(_0x26f5a0){throw _0x26f5a0;}}exports[_0x77da('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d381b,_0x1e7853,_0x46e6b4){return Promise['resolve']()[_0x77da('0x27')](function(){if(_0x1e7853[_0x77da('0xb')]>0x0){_0x1d381b=_0x1d381b[_0x77da('0xa')](function(_0x38643a){return _0x1e7853[_0x77da('0x2c')](_0x38643a['id']);});}return _0x1d381b;})[_0x77da('0x27')](function(){return db[_0x77da('0x2d')][_0x77da('0x2e')]({'attributes':['id','name','fullname',_0x77da('0x2f'),_0x77da('0x5'),'mailPause',_0x77da('0x30'),_0x77da('0x7'),_0x77da('0x10'),_0x77da('0x8'),_0x77da('0x31')],'where':{'id':{'$in':_[_0x77da('0x24')](_0x1d381b,'id')}},'raw':!![]});})[_0x77da('0x27')](function(_0x5c4a03){return _0x5c4a03[_0x77da('0x24')](function(_0x4df4b9){var _0x54b7f2=_['find'](_0x1d381b,['id',_0x4df4b9['id']]);var _0x17d236=filterAgentAttributes(_0x54b7f2);_['merge'](_0x4df4b9,_0x17d236);_0x4df4b9[_0x77da('0x32')]=getAgentStatus(_0x4df4b9);return _0x4df4b9;});})[_0x77da('0x27')](function(_0xce9df2){var _0x3cc78b=sortAgentsByStatus(_0xce9df2,_0x46e6b4);return _[_0x77da('0x24')](_0x3cc78b,'id');})[_0x77da('0x1d')](function(_0x43c20a){throw _0x43c20a;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x297d49){var _0x467410={'fields':[],'order':null};var _0x1ca53a=_0x297d49[_0x77da('0x33')](',');_0x467410[_0x77da('0x34')]=_[_0x77da('0xa')](_0x1ca53a,function(_0x48fccc){if(!_0x48fccc[_0x77da('0x2c')](_0x77da('0x32'))){return!![];}_0x467410[_0x77da('0x35')]=_['startsWith'](_0x48fccc,'-')?_0x77da('0x36'):'ASC';return![];});return _0x467410;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x599e21){if(!_0x599e21){_0x599e21='fullname,internal';}if(_0x599e21[_0x77da('0x2c')](_0x77da('0x37'))&&!_0x599e21[_0x77da('0x2c')]('internal')){var _0x21d337=_0x599e21['substring'](0x0,_0x599e21[_0x77da('0x38')]('fullname'));_0x599e21+=','+_0x21d337+_0x77da('0x39');}return _0x599e21;}exports[_0x77da('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x290667,_0x1612b7){var _0x240bee=_0x290667['sort'](function(_0x759b86,_0x1f48bd){if(_0x759b86[_0x77da('0x32')]===_0x1f48bd[_0x77da('0x32')]){if(_0x759b86[_0x77da('0x32')]===_0x77da('0x3b')){if(_0x1612b7==='DESC'){return(_0x759b86[_0x77da('0x31')]||'')<(_0x1f48bd[_0x77da('0x31')]||'')||_0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()>_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?0x1:-0x1;}else{return(_0x759b86['pauseType']||'')<(_0x1f48bd[_0x77da('0x31')]||'')||_0x759b86['fullname'][_0x77da('0x3c')]()>_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?-0x1:0x1;}}else{if(_0x1612b7==='DESC'){return _0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()<_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?0x1:-0x1;}else{return _0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()<_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?-0x1:0x1;}}}else{if(_0x1612b7===_0x77da('0x36')){return _0x759b86['globalStatus']<_0x1f48bd[_0x77da('0x32')]?0x1:-0x1;}else{return _0x759b86[_0x77da('0x32')]<_0x1f48bd[_0x77da('0x32')]?-0x1:0x1;}}});return _0x240bee;}exports[_0x77da('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x4644f3){var _0x2e3c38=['userpic','online',_0x77da('0x3e'),_0x77da('0x3f'),_0x77da('0x31'),_0x77da('0x3f'),_0x77da('0x39'),_0x77da('0x40'),'chatPause',_0x77da('0x30'),_0x77da('0x6'),_0x77da('0x7'),_0x77da('0x8'),'faxPause',_0x77da('0x10'),'chatCapacity','openchannelCapacity',_0x77da('0x41'),_0x77da('0x42'),_0x77da('0x43'),_0x77da('0x44'),'chatCurrentCapacity',_0x77da('0x45'),_0x77da('0x46'),'smsCurrentCapacity',_0x77da('0x47'),_0x77da('0x48'),'chatStatus',_0x77da('0x14'),_0x77da('0x49'),_0x77da('0x15'),_0x77da('0x16'),_0x77da('0x13'),_0x77da('0x11'),_0x77da('0x4a'),_0x77da('0x4b'),_0x77da('0x4c'),_0x77da('0x4d'),'whatsappStatusTime',_0x77da('0x4e'),'voiceStatusTime',_0x77da('0x4f'),_0x77da('0x50'),_0x77da('0x51'),_0x77da('0x52'),_0x77da('0x53'),_0x77da('0x54')];var _0x3a78d2=['chatPause',_0x77da('0x30'),_0x77da('0x6'),_0x77da('0x7'),_0x77da('0x8'),'faxPause',_0x77da('0x10'),_0x77da('0x55')];var _0x133b14=_(_0x4644f3)['omit'](_0x3a78d2)['pick'](_0x2e3c38)[_0x77da('0x2a')]();return _0x133b14;}exports[_0x77da('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x77da('0x57'),_0x77da('0x37'),_0x77da('0x58'),'internal','online',_0x77da('0x32'),_0x77da('0x59'),'lastLoginAt',_0x77da('0x31'),_0x77da('0x3f'),_0x77da('0x5'),'chatPause',_0x77da('0x6'),_0x77da('0x30'),'smsPause',_0x77da('0x10'),_0x77da('0x8'),_0x77da('0x12'),_0x77da('0x13'),_0x77da('0x49'),_0x77da('0x14'),_0x77da('0x15'),_0x77da('0x11'),_0x77da('0x16'),'chatStatusTime',_0x77da('0x4e'),_0x77da('0x4c'),_0x77da('0x4b'),_0x77da('0x4d'),_0x77da('0x5a'),_0x77da('0x5b'),'chatCapacity',_0x77da('0x44'),_0x77da('0x41'),_0x77da('0x5c'),'smsCapacity',_0x77da('0x43'),_0x77da('0x5d'),_0x77da('0x48'),_0x77da('0x46'),_0x77da('0x45'),_0x77da('0x5e'),_0x77da('0x47'),'phoneBarEnableScreenRecordingByAgent',_0x77da('0x53'),'destconnectedlinenum',_0x77da('0x5f'),_0x77da('0x4f'),_0x77da('0x54'),'screenrecording'];}exports[_0x77da('0x60')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index d75ac6b..cab0de1 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 _0x0974=['notInUse','onHold','ringing','talking','unavailable','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','outbound','map','get','busy','merge','pick','initializeQueues','jayson/promise','util','client','http','available','paused','waiting','inUse','loggedInDb'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x0974,0x139));var _0x4097=function(_0x4e4b3b,_0x26ed5e){_0x4e4b3b=_0x4e4b3b-0x0;var _0x4514b6=_0x0974[_0x4e4b3b];return _0x4514b6;};'use strict';var _=require('lodash');var jayson=require(_0x4097('0x0'));var util=require(_0x4097('0x1'));var amiClient=jayson[_0x4097('0x2')][_0x4097('0x3')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x4097('0x4'),'loggedIn',_0x4097('0x5'),_0x4097('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x4097('0x7'),'invalid',_0x4097('0x8'),_0x4097('0x9'),_0x4097('0xa'),_0x4097('0xb'),'ringInUse',_0x4097('0xc'),_0x4097('0xd'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x4097('0xe'),_0x4097('0xf'),'statusMessage','dialActive',_0x4097('0x10'),_0x4097('0x11'),_0x4097('0x12'),_0x4097('0x13'),_0x4097('0x14'),'erlangCallToSecond',_0x4097('0x15'),'erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x4097('0x16'),_0x4097('0x17'),_0x4097('0x18'),_0x4097('0x19'),_0x4097('0x1a'),'predictiveIntervalAvgHoldtime',_0x4097('0x1b')];function getRealtimeQueues(_0x57e2a5,_0x4d6bd0){var _0x1570ed=_0x4d6bd0===_0x4097('0x1c')?amiClient:routingClient;return _0x1570ed['request'](_[_0x4097('0x1d')](_0x4d6bd0)+_0x4097('0x1e'),_0x57e2a5)[_0x4097('0x1f')](function(_0x1e40c2){if(_0x1e40c2[_0x4097('0x20')])throw new Error(util[_0x4097('0x21')](_0x4097('0x22'),_0x4d6bd0));return _0x1e40c2[_0x4097('0x23')];})[_0x4097('0x24')](function(_0x14c1f2){throw _0x14c1f2;});}exports[_0x4097('0x25')]=getRealtimeQueues;function initializeQueues(_0xd21b12,_0x1974b1,_0x2d10c8,_0x465b86){var _0x443b0f=DEFAULT_QUEUE_ATTRIBUTES;if(_0x2d10c8===_0x4097('0x1c')){if(_0x465b86===_0x4097('0x26')){_0x443b0f=_0x443b0f['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x465b86===_0x4097('0x27')){_0x443b0f=_0x443b0f['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xd21b12[_0x4097('0x28')](function(_0x353b60){var _0xeea52d=_0x353b60[_0x4097('0x29')]({'plain':!![]});_0xeea52d[_0x4097('0x5')]=0x0;_0xeea52d['loggedInDb']=0x0;_0xeea52d['loggedIn']=0x0;_0xeea52d[_0x4097('0x4')]=0x0;_0xeea52d['waiting']=0x0;if(_0x2d10c8===_0x4097('0x1c')){_0xeea52d['talking']=0x0;_0xeea52d[_0x4097('0x2a')]=0x0;if(_0x465b86===_0x4097('0x27')){_0xeea52d['pTalking']=0x0;_0xeea52d[_0x4097('0xe')]=0x0;}}var _0x2928e5=_['find'](_0x1974b1,['id',_0xeea52d['id']]);if(_0x2928e5){_[_0x4097('0x2b')](_0xeea52d,_[_0x4097('0x2c')](_0x2928e5,_0x443b0f));}return _0xeea52d;});}exports[_0x4097('0x2d')]=initializeQueues; \ No newline at end of file +var _0xeaf8=['predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','concat','outbound','map','get','paused','busy','pTalking','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','waiting','invalid','loggedInDb','notInUse','onHold','ringing','talking','unavailable','unknown','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeaf8,0xf1));var _0x8eaf=function(_0x488d8e,_0x11d17f){_0x488d8e=_0x488d8e-0x0;var _0x5561f6=_0xeaf8[_0x488d8e];return _0x5561f6;};'use strict';var _=require(_0x8eaf('0x0'));var jayson=require(_0x8eaf('0x1'));var util=require(_0x8eaf('0x2'));var amiClient=jayson[_0x8eaf('0x3')][_0x8eaf('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x8eaf('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x8eaf('0x5'),_0x8eaf('0x6'),'paused',_0x8eaf('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x8eaf('0x8'),_0x8eaf('0x9'),_0x8eaf('0xa'),_0x8eaf('0xb'),_0x8eaf('0xc'),'ringInUse',_0x8eaf('0xd'),_0x8eaf('0xe'),_0x8eaf('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x8eaf('0x10'),_0x8eaf('0x11'),_0x8eaf('0x12'),_0x8eaf('0x13'),_0x8eaf('0x14'),_0x8eaf('0x15'),_0x8eaf('0x16'),'startProgressive',_0x8eaf('0x17'),_0x8eaf('0x18'),_0x8eaf('0x19'),'erlangBusyFactor',_0x8eaf('0x1a'),'dialPredictiveIntervalMaxThreshold',_0x8eaf('0x1b'),_0x8eaf('0x1c'),_0x8eaf('0x1d'),_0x8eaf('0x1e'),_0x8eaf('0x1f'),_0x8eaf('0x20'),'predictiveIntervalAvgHoldtime',_0x8eaf('0x21')];function getRealtimeQueues(_0x5e0a93,_0x3f4f59){var _0x28dd2f=_0x3f4f59===_0x8eaf('0x22')?amiClient:routingClient;return _0x28dd2f[_0x8eaf('0x23')](_[_0x8eaf('0x24')](_0x3f4f59)+_0x8eaf('0x25'),_0x5e0a93)[_0x8eaf('0x26')](function(_0x125735){if(_0x125735['error'])throw new Error(util[_0x8eaf('0x27')](_0x8eaf('0x28'),_0x3f4f59));return _0x125735[_0x8eaf('0x29')];})['catch'](function(_0x1ad04f){throw _0x1ad04f;});}exports[_0x8eaf('0x2a')]=getRealtimeQueues;function initializeQueues(_0x10b312,_0x16ae9c,_0x3df82e,_0x3d32f5){var _0xe7b72d=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3df82e==='voice'){if(_0x3d32f5==='inbound'){_0xe7b72d=_0xe7b72d[_0x8eaf('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3d32f5===_0x8eaf('0x2c')){_0xe7b72d=_0xe7b72d[_0x8eaf('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x10b312[_0x8eaf('0x2d')](function(_0x3ada43){var _0x4cd4d6=_0x3ada43[_0x8eaf('0x2e')]({'plain':!![]});_0x4cd4d6[_0x8eaf('0x2f')]=0x0;_0x4cd4d6[_0x8eaf('0x9')]=0x0;_0x4cd4d6['loggedIn']=0x0;_0x4cd4d6[_0x8eaf('0x5')]=0x0;_0x4cd4d6['waiting']=0x0;if(_0x3df82e===_0x8eaf('0x22')){_0x4cd4d6['talking']=0x0;_0x4cd4d6[_0x8eaf('0x30')]=0x0;if(_0x3d32f5===_0x8eaf('0x2c')){_0x4cd4d6[_0x8eaf('0x31')]=0x0;_0x4cd4d6[_0x8eaf('0x10')]=0x0;}}var _0x1a2666=_[_0x8eaf('0x32')](_0x16ae9c,['id',_0x4cd4d6['id']]);if(_0x1a2666){_[_0x8eaf('0x33')](_0x4cd4d6,_[_0x8eaf('0x34')](_0x1a2666,_0xe7b72d));}return _0x4cd4d6;});}exports[_0x8eaf('0x35')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index db59e6c..0d6e5c0 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(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x1ae6b3,_0xe6d8e9){var _0x598044=function(_0x3c6b07){while(--_0x3c6b07){_0x1ae6b3['push'](_0x1ae6b3['shift']());}};_0x598044(++_0xe6d8e9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 2123c63..7adcad6 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 _0xd9c0=['head','mac','address','getFirstInterface','cpus','map','model','join','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','createHash','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal'];(function(_0x16a223,_0x31b6e8){var _0x5ded66=function(_0x25eb5f){while(--_0x25eb5f){_0x16a223['push'](_0x16a223['shift']());}};_0x5ded66(++_0x31b6e8);}(_0xd9c0,0x16a));var _0x0d9c=function(_0x1f27ba,_0x78c519){_0x1f27ba=_0x1f27ba-0x0;var _0x4c5569=_0xd9c0[_0x1f27ba];return _0x4c5569;};'use strict';var _=require(_0x0d9c('0x0'));var os=require('os');var crypto=require(_0x0d9c('0x1'));var machine=require(_0x0d9c('0x2'));var exec=require(_0x0d9c('0x3'))[_0x0d9c('0x4')];var config=require('../environment');function getInterfaces(){var _0x85e55d=[];var _0x47daa5=os[_0x0d9c('0x5')]();var _0x48eeb1=_[_0x0d9c('0x6')](_[_0x0d9c('0x7')](_0x47daa5));for(var _0x25cb6b=0x0;_0x25cb6b<_0x48eeb1[_0x0d9c('0x8')];_0x25cb6b++){var _0x44e420=_0x47daa5[_0x48eeb1[_0x25cb6b]][_0x0d9c('0x9')](function(_0x1bd8c6){return _0x1bd8c6['family']===_0x0d9c('0xa')&&_0x1bd8c6[_0x0d9c('0xb')]===![];});_0x85e55d=_0x85e55d['concat'](_0x44e420);}return _0x85e55d;}function getFirstInterface(){var _0x499eb6=_[_0x0d9c('0xc')](getInterfaces());return{'macAddress':_0x499eb6&&_0x499eb6['mac']?_0x499eb6[_0x0d9c('0xd')]:'00:00:00:00:00:00','ipAddress':_0x499eb6&&_0x499eb6[_0x0d9c('0xe')]?_0x499eb6[_0x0d9c('0xe')]:'127.0.0.1'};}exports[_0x0d9c('0xf')]=getFirstInterface;function getCPUhash(){var _0x45819a=_['orderBy'](os[_0x0d9c('0x10')]()[_0x0d9c('0x11')](function(_0x47534c){return _0x47534c[_0x0d9c('0x12')];}))[_0x0d9c('0x13')](':');return crypto['createHash']('md5')[_0x0d9c('0x14')](_0x45819a)[_0x0d9c('0x15')](_0x0d9c('0x16'));}exports[_0x0d9c('0x17')]=function(){var _0x1a170b=os[_0x0d9c('0x18')]();var _0x3c60f1=/[0-9a-f-]{36}/;if(config[_0x0d9c('0x19')]&&_0x3c60f1[_0x0d9c('0x1a')](config[_0x0d9c('0x19')])){return config['licenseToken'];}else if(_0x1a170b===_0x0d9c('0x1b')){return exec(_0x0d9c('0x1c'),{'encoding':_0x0d9c('0x1d')})['replace']('\x0d\x0a','');}else{var _0x1b1636=getFirstInterface();var _0x2a8a13=getCPUhash();var _0x705328=_0x2a8a13+'|'+os[_0x0d9c('0x1e')]()+'|'+_0x1b1636['macAddress']+'|'+_0x1b1636['ipAddress'];var _0x107542=crypto[_0x0d9c('0x1f')](_0x0d9c('0x20'))[_0x0d9c('0x14')](_0x705328)[_0x0d9c('0x15')]('hex');return _0x107542['substring'](0x0,0x8)+'-'+_0x107542[_0x0d9c('0x21')](0x8,0xc)+'-'+_0x107542[_0x0d9c('0x21')](0xc,0x10)+'-'+_0x107542[_0x0d9c('0x21')](0x10,0x14)+'-'+_0x107542['substring'](0x14);}}; \ No newline at end of file +var _0xce3b=['replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','filter','family','IPv4','internal','concat','head','mac','address','cpus','map','model','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','utf8'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xce3b,0xd0));var _0xbce3=function(_0x3bf456,_0x29833e){_0x3bf456=_0x3bf456-0x0;var _0x2b8964=_0xce3b[_0x3bf456];return _0x2b8964;};'use strict';var _=require(_0xbce3('0x0'));var os=require('os');var crypto=require(_0xbce3('0x1'));var machine=require(_0xbce3('0x2'));var exec=require(_0xbce3('0x3'))[_0xbce3('0x4')];var config=require('../environment');function getInterfaces(){var _0x43861=[];var _0x4251ae=os[_0xbce3('0x5')]();var _0x110786=_[_0xbce3('0x6')](_[_0xbce3('0x7')](_0x4251ae));for(var _0x154e37=0x0;_0x154e37<_0x110786['length'];_0x154e37++){var _0x484bca=_0x4251ae[_0x110786[_0x154e37]][_0xbce3('0x8')](function(_0x23881f){return _0x23881f[_0xbce3('0x9')]===_0xbce3('0xa')&&_0x23881f[_0xbce3('0xb')]===![];});_0x43861=_0x43861[_0xbce3('0xc')](_0x484bca);}return _0x43861;}function getFirstInterface(){var _0x30ed9f=_[_0xbce3('0xd')](getInterfaces());return{'macAddress':_0x30ed9f&&_0x30ed9f[_0xbce3('0xe')]?_0x30ed9f[_0xbce3('0xe')]:'00:00:00:00:00:00','ipAddress':_0x30ed9f&&_0x30ed9f['address']?_0x30ed9f[_0xbce3('0xf')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x1f6586=_[_0xbce3('0x6')](os[_0xbce3('0x10')]()[_0xbce3('0x11')](function(_0x25a510){return _0x25a510[_0xbce3('0x12')];}))['join'](':');return crypto[_0xbce3('0x13')](_0xbce3('0x14'))[_0xbce3('0x15')](_0x1f6586)[_0xbce3('0x16')](_0xbce3('0x17'));}exports[_0xbce3('0x18')]=function(){var _0x16371e=os[_0xbce3('0x19')]();var _0x55c444=/[0-9a-f-]{36}/;if(config[_0xbce3('0x1a')]&&_0x55c444[_0xbce3('0x1b')](config['licenseToken'])){return config['licenseToken'];}else if(_0x16371e===_0xbce3('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xbce3('0x1d')})[_0xbce3('0x1e')]('\x0d\x0a','');}else{var _0x53aa9a=getFirstInterface();var _0x3aef07=getCPUhash();var _0x21dc4c=_0x3aef07+'|'+os[_0xbce3('0x1f')]()+'|'+_0x53aa9a['macAddress']+'|'+_0x53aa9a[_0xbce3('0x20')];var _0xd55e26=crypto[_0xbce3('0x13')](_0xbce3('0x14'))[_0xbce3('0x15')](_0x21dc4c)['digest'](_0xbce3('0x17'));return _0xd55e26[_0xbce3('0x21')](0x0,0x8)+'-'+_0xd55e26[_0xbce3('0x21')](0x8,0xc)+'-'+_0xd55e26['substring'](0xc,0x10)+'-'+_0xd55e26[_0xbce3('0x21')](0x10,0x14)+'-'+_0xd55e26[_0xbce3('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1e886ef..d4d6cc1 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 _0x17b5=['NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','default','util','moment','request-promise','pkginfo','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','catch','get','data1','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x2d7b03,_0x232c07){var _0x4b6eb8=function(_0x377bbf){while(--_0x377bbf){_0x2d7b03['push'](_0x2d7b03['shift']());}};_0x4b6eb8(++_0x232c07);}(_0x17b5,0xe2));var _0x517b=function(_0xc4e62c,_0x5b226e){_0xc4e62c=_0xc4e62c-0x0;var _0x44c950=_0x17b5[_0xc4e62c];return _0x44c950;};'use strict';var util=require(_0x517b('0x0'));var moment=require(_0x517b('0x1'));var rp=require(_0x517b('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x517b('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x517b('0x4'));var hardware=require(_0x517b('0x5'));var logger=require(_0x517b('0x6'))('license');var HOST=_0x517b('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x560010){return new BPromise(function(_0x583401,_0x27a302){var _0x3f8464=util[_0x517b('0x8')](_0x517b('0x9'),HOST,_0x560010,module['exports'][_0x517b('0xa')]);if(oldToken){_0x3f8464=util[_0x517b('0x8')](_0x517b('0xb'),HOST,_0x560010,module[_0x517b('0xc')][_0x517b('0xa')],oldToken);}var _0x224cc8={'uri':_0x3f8464,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x224cc8)[_0x517b('0xd')](function(_0x4d9adc){_0x583401(_0x4d9adc);})[_0x517b('0xe')](function(_0x10f088){_0x27a302(_0x10f088);});});}function manageLicense(_0x52f42f,_0x4b0d0b){var _0x3ac3c0=_0x4b0d0b[_0x517b('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x3ac3c0[_0x517b('0x10')]!==_0x52f42f&&!_0x3ac3c0['data2']){oldToken=_0x3ac3c0['data1'];}httpRequest(_0x52f42f)[_0x517b('0xd')](function(_0xe19624){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xe19624[_0x517b('0x11')]){isOldTokenSent=![];if(!_0x3ac3c0['license']&&_0x3ac3c0['license']!=_0xe19624[_0x517b('0x12')]||_0x3ac3c0[_0x517b('0x12')]&&_0x3ac3c0['data2']){logger[_0x517b('0x13')](_0x517b('0x14'));}if(_0x3ac3c0[_0x517b('0x12')]&&!_0x3ac3c0[_0x517b('0x15')]&&_0x3ac3c0[_0x517b('0x12')]!=_0xe19624['license']){logger[_0x517b('0x13')](_0x517b('0x16'));}if(_0x3ac3c0['license']&&!_0x3ac3c0[_0x517b('0x15')]&&_0x3ac3c0['license']==_0xe19624[_0x517b('0x12')]){return _0x4b0d0b;}return _0x4b0d0b[_0x517b('0x17')]({'data1':_0x52f42f,'data2':null,'license':_0xe19624[_0x517b('0x12')]});}else{if(_0xe19624[_0x517b('0x12')]||_0x3ac3c0['license']){if(!_0x3ac3c0[_0x517b('0x15')]){if(_0x3ac3c0[_0x517b('0x10')]==_0x52f42f){GRAY_PERIOD_REASON=_0x517b('0x18');logger[_0x517b('0x13')](_0x517b('0x19'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x517b('0x13')](_0x517b('0x1a'),_0x3ac3c0[_0x517b('0x10')],_0x52f42f);}logger[_0x517b('0x13')](_0x517b('0x1b'),GRAY_PERIOD_REASON[_0x517b('0x1c')](),moment()['format'](_0x517b('0x1d')));return _0x4b0d0b[_0x517b('0x17')]({'data2':encryptor[_0x517b('0x1e')](moment()[_0x517b('0x8')](_0x517b('0x1d')))});}else{if(moment()[_0x517b('0x1f')](encryptor[_0x517b('0x20')](_0x3ac3c0[_0x517b('0x15')]),_0x517b('0x21'))>DAYS){logger[_0x517b('0x13')](_0x517b('0x22'),moment()['format'](_0x517b('0x1d')));isOldTokenSent=![];return _0x4b0d0b[_0x517b('0x17')]({'data1':_0x52f42f,'data2':null,'license':null});}}}else{if(_0x3ac3c0['data1']!=_0x52f42f){logger['info'](_0x517b('0x1a'),_0x3ac3c0[_0x517b('0x10')],_0x52f42f);return _0x4b0d0b[_0x517b('0x17')]({'data1':_0x52f42f,'data2':null,'license':null});}}}return _0x4b0d0b;})['then'](function(_0x114074){_0x4b0d0b=_0x114074;})['catch'](function(_0x188952){logger[_0x517b('0x23')](_0x188952[_0x517b('0x24')]);})[_0x517b('0x25')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4b0d0b);},TIME);});}function defaultLicense(){var _0x36a280=hardware[_0x517b('0x26')]();if(_0x36a280){return db[_0x517b('0x27')][_0x517b('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x36a280}})['spread'](function(_0xaace5f,_0x125a57){logger[_0x517b('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x36a280);manageLicense(_0x36a280,_0xaace5f);})[_0x517b('0xe')](function(_0x3a567c){logger['error'](_0x3a567c[_0x517b('0x24')]);});}}exports[_0x517b('0x29')]=defaultLicense; \ No newline at end of file +var _0x021e=['../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','request-promise','pkginfo','version','../../mysqldb'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x021e,0x114));var _0xe021=function(_0x3c854f,_0x36e601){_0x3c854f=_0x3c854f-0x0;var _0x1888bb=_0x021e[_0x3c854f];return _0x1888bb;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0xe021('0x0'));var BPromise=require('bluebird');var pkginfo=require(_0xe021('0x1'))(module,_0xe021('0x2'));var db=require(_0xe021('0x3'))['db'];var encryptor=require(_0xe021('0x4'));var hardware=require(_0xe021('0x5'));var logger=require('../logger')('license');var HOST=_0xe021('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4f9587){return new BPromise(function(_0x25aa89,_0x520d31){var _0x34d9cb=util[_0xe021('0x7')](_0xe021('0x8'),HOST,_0x4f9587,module[_0xe021('0x9')]['version']);if(oldToken){_0x34d9cb=util[_0xe021('0x7')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4f9587,module[_0xe021('0x9')][_0xe021('0x2')],oldToken);}var _0x4c30f4={'uri':_0x34d9cb,'method':_0xe021('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x4c30f4)[_0xe021('0xb')](function(_0x78e5e5){_0x25aa89(_0x78e5e5);})[_0xe021('0xc')](function(_0x45183d){_0x520d31(_0x45183d);});});}function manageLicense(_0x2da0b0,_0x581a25){var _0x2b92fd=_0x581a25[_0xe021('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x2b92fd[_0xe021('0xe')]!==_0x2da0b0&&!_0x2b92fd[_0xe021('0xf')]){oldToken=_0x2b92fd[_0xe021('0xe')];}httpRequest(_0x2da0b0)[_0xe021('0xb')](function(_0x4adaac){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4adaac[_0xe021('0x10')]){isOldTokenSent=![];if(!_0x2b92fd[_0xe021('0x11')]&&_0x2b92fd[_0xe021('0x11')]!=_0x4adaac['license']||_0x2b92fd[_0xe021('0x11')]&&_0x2b92fd[_0xe021('0xf')]){logger[_0xe021('0x12')](_0xe021('0x13'));}if(_0x2b92fd[_0xe021('0x11')]&&!_0x2b92fd[_0xe021('0xf')]&&_0x2b92fd[_0xe021('0x11')]!=_0x4adaac['license']){logger[_0xe021('0x12')](_0xe021('0x14'));}if(_0x2b92fd['license']&&!_0x2b92fd[_0xe021('0xf')]&&_0x2b92fd[_0xe021('0x11')]==_0x4adaac[_0xe021('0x11')]){return _0x581a25;}return _0x581a25[_0xe021('0x15')]({'data1':_0x2da0b0,'data2':null,'license':_0x4adaac['license']});}else{if(_0x4adaac[_0xe021('0x11')]||_0x2b92fd[_0xe021('0x11')]){if(!_0x2b92fd[_0xe021('0xf')]){if(_0x2b92fd[_0xe021('0xe')]==_0x2da0b0){GRAY_PERIOD_REASON=_0xe021('0x16');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xe021('0x17');logger['info'](_0xe021('0x18'),_0x2b92fd[_0xe021('0xe')],_0x2da0b0);}logger[_0xe021('0x12')](_0xe021('0x19'),GRAY_PERIOD_REASON[_0xe021('0x1a')](),moment()[_0xe021('0x7')](_0xe021('0x1b')));return _0x581a25['update']({'data2':encryptor[_0xe021('0x1c')](moment()[_0xe021('0x7')](_0xe021('0x1b')))});}else{if(moment()[_0xe021('0x1d')](encryptor['decryptString'](_0x2b92fd[_0xe021('0xf')]),_0xe021('0x1e'))>DAYS){logger[_0xe021('0x12')](_0xe021('0x1f'),moment()[_0xe021('0x7')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x581a25[_0xe021('0x15')]({'data1':_0x2da0b0,'data2':null,'license':null});}}}else{if(_0x2b92fd['data1']!=_0x2da0b0){logger[_0xe021('0x12')](_0xe021('0x18'),_0x2b92fd['data1'],_0x2da0b0);return _0x581a25[_0xe021('0x15')]({'data1':_0x2da0b0,'data2':null,'license':null});}}}return _0x581a25;})[_0xe021('0xb')](function(_0x37e96c){_0x581a25=_0x37e96c;})[_0xe021('0xc')](function(_0x153c11){logger[_0xe021('0x20')](_0x153c11[_0xe021('0x21')]);})[_0xe021('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x581a25);},TIME);});}function defaultLicense(){var _0x13e037=hardware[_0xe021('0x23')]();if(_0x13e037){return db[_0xe021('0x24')][_0xe021('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x13e037}})[_0xe021('0x26')](function(_0x4e80f7,_0x4158d2){logger['info'](_0xe021('0x27'),_0x13e037);manageLicense(_0x13e037,_0x4e80f7);})[_0xe021('0xc')](function(_0x125673){logger[_0xe021('0x20')](_0x125673['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e846c97..58078f7 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 _0x2af6=['lodash','moment','bluebird','./hardware','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','deadline','add','changed','disabled','message','User','findAll','role','sequelize','col','count','user','telephone','users','telephones','admin','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util'];(function(_0x4c4a18,_0x35be2c){var _0x51a123=function(_0x298960){while(--_0x298960){_0x4c4a18['push'](_0x4c4a18['shift']());}};_0x51a123(++_0x35be2c);}(_0x2af6,0x167));var _0x62af=function(_0x113acd,_0x13feb4){_0x113acd=_0x113acd-0x0;var _0x156778=_0x2af6[_0x113acd];return _0x156778;};'use strict';var util=require(_0x62af('0x0'));var _=require(_0x62af('0x1'));var moment=require(_0x62af('0x2'));var BPromise=require(_0x62af('0x3'));var hardware=require(_0x62af('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0x62af('0x5'))['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':'Demo\x20license','machineUuid':hardware[_0x62af('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x62af('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x62af('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x101981){return new BPromise(function(_0x5da756,_0x344bb4){return db[_0x62af('0x9')][_0x62af('0xa')](_['defaults'](_0x101981,{'raw':!![],'where':{'id':0x1}}))[_0x62af('0xb')](function(_0x43e3d0){return checkLicense(_0x43e3d0,null);})[_0x62af('0xb')](function(_0x42498e){_0x5da756(_0x42498e);return;})[_0x62af('0xc')](function(_0x2a52b0){_0x344bb4(_0x2a52b0);});});}function checkLicense(_0xe6f71d,_0xf0eca1){if(!_0xe6f71d){demoLicense[_0x62af('0xd')]=_0xe6f71d[_0x62af('0xe')];return demoLicense;}try{var _0x4d2708=_0xf0eca1||_0xe6f71d[_0x62af('0xf')];if(_[_0x62af('0x10')](_0x4d2708)){throw new Error(_0x62af('0x11'));}var _0x2dd3e5=_0xe6f71d[_0x62af('0xe')];var _0x3ac551=_0xe6f71d[_0x62af('0x12')];var _0x45e3ba=_0x2dd3e5[_0x62af('0x13')]('-')[0x4];var _0x27cfdf=_0x2dd3e5[_0x62af('0x13')]('-')[0x0];var _0x4e9ec1=encryptor[_0x62af('0x14')](_0x4d2708,util[_0x62af('0x15')](_0x62af('0x16'),_0x45e3ba,_0x2dd3e5,_0x27cfdf));var _0x514d5b=JSON[_0x62af('0x17')](_0x4e9ec1);_0x514d5b[_0x62af('0x18')]=![];_0x514d5b['uuid']=_0x2dd3e5;_0x514d5b['machineUuid']=hardware[_0x62af('0x6')]();if(_0x3ac551){var _0x295931=encryptor[_0x62af('0x14')](_0x3ac551);_0x514d5b['gray']=_0x295931;_0x514d5b[_0x62af('0x19')]=moment(_0x295931)[_0x62af('0x1a')](0x7,'days')[_0x62af('0x15')]();_0x514d5b['grayReason']=_0x514d5b[_0x62af('0xd')]!=_0x514d5b['machineUuid']?_0x62af('0x1b'):_0x62af('0x1c');}return _0x514d5b;}catch(_0x12e2b4){breakingLicense[_0x62af('0xd')]=_0xe6f71d[_0x62af('0xe')];breakingLicense[_0x62af('0x1d')]=_0x12e2b4[_0x62af('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x297554,_0x9b2a1c){getLicense()['then'](function(_0x1df317){return db[_0x62af('0x1e')][_0x62af('0x1f')]({'attributes':[_0x62af('0x20'),[db['sequelize']['fn']('COUNT',db[_0x62af('0x21')][_0x62af('0x22')](_0x62af('0x20'))),_0x62af('0x23')]],'group':_0x62af('0x20'),'where':{'role':{'$or':['admin',_0x62af('0x24'),_0x62af('0x25')]}},'raw':!![]})[_0x62af('0xb')](function(_0x1fcfae){var _0x464658={'user':_0x1df317[_0x62af('0x26')]||0x0,'telephone':_0x1df317[_0x62af('0x27')]||0x0};_0x1fcfae['forEach'](function(_0x1979d3){var _0xc8382c=_0x1979d3[_0x62af('0x20')]===_0x62af('0x28')?_0x62af('0x24'):_0x1979d3['role'];_0x464658[_0xc8382c]-=_0x1979d3[_0x62af('0x23')];if(_0x464658[_0xc8382c]<0x0)_0x464658[_0xc8382c]=0x0;});_0x297554(_0x464658);return;});})[_0x62af('0xc')](function(_0x556efe){_0x9b2a1c(_0x556efe);});});}function checkUserLimits(_0x334845){return new BPromise(function(_0x2d7904,_0x5bb826){getLimits()['then'](function(_0x59f984){var _0x5cf18c=_['pick'](_[_0x62af('0x29')](_0x334845,'role'),[_0x62af('0x28'),'user',_0x62af('0x25')]);var _0x11694d=(_0x5cf18c[_0x62af('0x28')]||0x0)+(_0x5cf18c[_0x62af('0x24')]||0x0);var _0x53a008=_0x5cf18c[_0x62af('0x25')]||0x0;if(_0x11694d>_0x59f984[_0x62af('0x24')])return _0x5bb826(_0x62af('0x2a'));if(_0x53a008>_0x59f984[_0x62af('0x25')])return _0x5bb826(_0x62af('0x2b'));return _0x2d7904();})[_0x62af('0xc')](function(_0x2229ad){_0x5bb826(_0x2229ad);});});}module[_0x62af('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x692f=['COUNT','col','count','telephone','users','telephones','admin','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','demo','machineUuid','decryptString','add','days','grayReason','changed','disabled','message','User','role','sequelize'];(function(_0x809314,_0xaf27c0){var _0x1a94b6=function(_0x450f50){while(--_0x450f50){_0x809314['push'](_0x809314['shift']());}};_0x1a94b6(++_0xaf27c0);}(_0x692f,0x11a));var _0xf692=function(_0x46ce98,_0x52d764){_0x46ce98=_0x46ce98-0x0;var _0x172f46=_0x692f[_0x46ce98];return _0x172f46;};'use strict';var util=require(_0xf692('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xf692('0x1'));var hardware=require(_0xf692('0x2'));var encryptor=require(_0xf692('0x3'));var db=require(_0xf692('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf692('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf692('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf692('0x6'),'machineUuid':hardware[_0xf692('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x247259){return new BPromise(function(_0x1ea1dd,_0x55c0f5){return db[_0xf692('0x8')]['find'](_[_0xf692('0x9')](_0x247259,{'raw':!![],'where':{'id':0x1}}))[_0xf692('0xa')](function(_0x4b4ccb){return checkLicense(_0x4b4ccb,null);})[_0xf692('0xa')](function(_0x21a607){_0x1ea1dd(_0x21a607);return;})[_0xf692('0xb')](function(_0xd14350){_0x55c0f5(_0xd14350);});});}function checkLicense(_0x49165f,_0x4ecaa0){if(!_0x49165f){demoLicense[_0xf692('0xc')]=_0x49165f[_0xf692('0xd')];return demoLicense;}try{var _0x3cdfd7=_0x4ecaa0||_0x49165f[_0xf692('0xe')];if(_[_0xf692('0xf')](_0x3cdfd7)){throw new Error(_0xf692('0x10'));}var _0x3cc503=_0x49165f[_0xf692('0xd')];var _0xa9e1=_0x49165f[_0xf692('0x11')];var _0xa35331=_0x3cc503['split']('-')[0x4];var _0x3f6553=_0x3cc503[_0xf692('0x12')]('-')[0x0];var _0x2fa963=encryptor['decryptString'](_0x3cdfd7,util[_0xf692('0x13')](_0xf692('0x14'),_0xa35331,_0x3cc503,_0x3f6553));var _0x441673=JSON['parse'](_0x2fa963);_0x441673[_0xf692('0x15')]=![];_0x441673[_0xf692('0xc')]=_0x3cc503;_0x441673[_0xf692('0x16')]=hardware[_0xf692('0x7')]();if(_0xa9e1){var _0x44b160=encryptor[_0xf692('0x17')](_0xa9e1);_0x441673['gray']=_0x44b160;_0x441673['deadline']=moment(_0x44b160)[_0xf692('0x18')](0x7,_0xf692('0x19'))[_0xf692('0x13')]();_0x441673[_0xf692('0x1a')]=_0x441673[_0xf692('0xc')]!=_0x441673[_0xf692('0x16')]?_0xf692('0x1b'):_0xf692('0x1c');}return _0x441673;}catch(_0x4e48ad){breakingLicense[_0xf692('0xc')]=_0x49165f[_0xf692('0xd')];breakingLicense[_0xf692('0x1d')]=_0x4e48ad[_0xf692('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xc652d4,_0x3802c1){getLicense()[_0xf692('0xa')](function(_0x14fd8a){return db[_0xf692('0x1e')]['findAll']({'attributes':[_0xf692('0x1f'),[db[_0xf692('0x20')]['fn'](_0xf692('0x21'),db[_0xf692('0x20')][_0xf692('0x22')](_0xf692('0x1f'))),_0xf692('0x23')]],'group':_0xf692('0x1f'),'where':{'role':{'$or':['admin','user',_0xf692('0x24')]}},'raw':!![]})[_0xf692('0xa')](function(_0x50d60e){var _0x5673d4={'user':_0x14fd8a[_0xf692('0x25')]||0x0,'telephone':_0x14fd8a[_0xf692('0x26')]||0x0};_0x50d60e['forEach'](function(_0x5e8080){var _0x58b6a1=_0x5e8080[_0xf692('0x1f')]===_0xf692('0x27')?_0xf692('0x28'):_0x5e8080[_0xf692('0x1f')];_0x5673d4[_0x58b6a1]-=_0x5e8080[_0xf692('0x23')];if(_0x5673d4[_0x58b6a1]<0x0)_0x5673d4[_0x58b6a1]=0x0;});_0xc652d4(_0x5673d4);return;});})[_0xf692('0xb')](function(_0x48e59f){_0x3802c1(_0x48e59f);});});}function checkUserLimits(_0x16a60a){return new BPromise(function(_0x2e4b19,_0x4594ac){getLimits()[_0xf692('0xa')](function(_0x1cd60f){var _0x296b3c=_[_0xf692('0x29')](_[_0xf692('0x2a')](_0x16a60a,_0xf692('0x1f')),['admin',_0xf692('0x28'),'telephone']);var _0x47a6cc=(_0x296b3c['admin']||0x0)+(_0x296b3c['user']||0x0);var _0x5329ea=_0x296b3c[_0xf692('0x24')]||0x0;if(_0x47a6cc>_0x1cd60f[_0xf692('0x28')])return _0x4594ac('License\x20limit\x20reached\x20for\x20users');if(_0x5329ea>_0x1cd60f['telephone'])return _0x4594ac(_0xf692('0x2b'));return _0x2e4b19();})[_0xf692('0xb')](function(_0x14ca1a){_0x4594ac(_0x14ca1a);});});}module[_0xf692('0x2c')]={'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 174ff42..e321887 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 _0x47c5=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x5cfa7c,_0x48ecef){var _0x20faa0=function(_0x492580){while(--_0x492580){_0x5cfa7c['push'](_0x5cfa7c['shift']());}};_0x20faa0(++_0x48ecef);}(_0x47c5,0x165));var _0x547c=function(_0x218c0c,_0x2b21e3){_0x218c0c=_0x218c0c-0x0;var _0xf0347d=_0x47c5[_0x218c0c];return _0xf0347d;};'use strict';module[_0x547c('0x0')]={'DOMAIN':_0x547c('0x1'),'SESSION_SECRET':_0x547c('0x2'),'GOOGLE_ID':_0x547c('0x3'),'GOOGLE_SECRET':_0x547c('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x14a0=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x5b8705,_0x19d2b3){var _0x3d8b53=function(_0x221066){while(--_0x221066){_0x5b8705['push'](_0x5b8705['shift']());}};_0x3d8b53(++_0x19d2b3);}(_0x14a0,0x8e));var _0x014a=function(_0x9b6210,_0x148de8){_0x9b6210=_0x9b6210-0x0;var _0x53955d=_0x14a0[_0x9b6210];return _0x53955d;};'use strict';module['exports']={'DOMAIN':_0x014a('0x0'),'SESSION_SECRET':_0x014a('0x1'),'GOOGLE_ID':_0x014a('0x2'),'GOOGLE_SECRET':_0x014a('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index f3cee03..dace13a 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2823=['fileLogger','exports'];(function(_0x30b127,_0xa5866f){var _0x2d6802=function(_0x2f8149){while(--_0x2f8149){_0x30b127['push'](_0x30b127['shift']());}};_0x2d6802(++_0xa5866f);}(_0x2823,0x1b4));var _0x3282=function(_0x5aefeb,_0x5958d3){_0x5aefeb=_0x5aefeb-0x0;var _0x3fee8b=_0x2823[_0x5aefeb];return _0x3fee8b;};'use strict';var fileLogger=require('../utils/loggers')[_0x3282('0x0')];module[_0x3282('0x1')]=fileLogger; \ No newline at end of file +var _0xd894=['fileLogger','exports','../utils/loggers'];(function(_0x1eb786,_0x1b5f72){var _0x460cad=function(_0x3ec7a6){while(--_0x3ec7a6){_0x1eb786['push'](_0x1eb786['shift']());}};_0x460cad(++_0x1b5f72);}(_0xd894,0xb3));var _0x4d89=function(_0x2d0cad,_0x320aaf){_0x2d0cad=_0x2d0cad-0x0;var _0x1b4688=_0xd894[_0x2d0cad];return _0x1b4688;};'use strict';var fileLogger=require(_0x4d89('0x0'))[_0x4d89('0x1')];module[_0x4d89('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index bcbdf7c..28acd22 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 _0x54c2=['express','join','../../services/express/index.js','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','../../config/environment','resolve','legacy-libs'];(function(_0x40b151,_0x506325){var _0xf5eafe=function(_0x4df552){while(--_0x4df552){_0x40b151['push'](_0x40b151['shift']());}};_0xf5eafe(++_0x506325);}(_0x54c2,0x6d));var _0x254c=function(_0x741334,_0x4dadd8){_0x741334=_0x741334-0x0;var _0x11f9e0=_0x54c2[_0x741334];return _0x11f9e0;};'use strict';var path=require('path');var cfg=require(_0x254c('0x0'));var env={'NODE_PATH':path[_0x254c('0x1')](path['join'](cfg['root'],_0x254c('0x2')))};var pm2config={'apps':[{'name':_0x254c('0x3'),'script':path[_0x254c('0x4')](__dirname,_0x254c('0x5')),'env':env},{'name':'ami','script':path[_0x254c('0x4')](__dirname,_0x254c('0x6')),'env':env},{'name':'agi','script':path['join'](__dirname,_0x254c('0x7')),'env':env},{'name':_0x254c('0x8'),'script':path[_0x254c('0x4')](__dirname,_0x254c('0x9')),'env':env},{'name':_0x254c('0xa'),'script':path[_0x254c('0x4')](__dirname,_0x254c('0xb')),'env':env},{'name':_0x254c('0xc'),'script':path[_0x254c('0x4')](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x254c('0xd')]=pm2config; \ No newline at end of file +var _0x03a0=['legacy-libs','express','../../services/express/index.js','../../services/ami/index.js','agi','join','../../services/agi/index.js','../../services/email/index.js','../../services/xdr/index.js','exports','path','../../config/environment','resolve','root'];(function(_0x47122f,_0x1ed27d){var _0x2484ed=function(_0x47c818){while(--_0x47c818){_0x47122f['push'](_0x47122f['shift']());}};_0x2484ed(++_0x1ed27d);}(_0x03a0,0x13e));var _0x003a=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x03a0[_0x53c256];return _0x25feb6;};'use strict';var path=require(_0x003a('0x0'));var cfg=require(_0x003a('0x1'));var env={'NODE_PATH':path[_0x003a('0x2')](path['join'](cfg[_0x003a('0x3')],_0x003a('0x4')))};var pm2config={'apps':[{'name':_0x003a('0x5'),'script':path['join'](__dirname,_0x003a('0x6')),'env':env},{'name':'ami','script':path['join'](__dirname,_0x003a('0x7')),'env':env},{'name':_0x003a('0x8'),'script':path[_0x003a('0x9')](__dirname,_0x003a('0xa')),'env':env},{'name':'email','script':path['join'](__dirname,_0x003a('0xb')),'env':env},{'name':'routing','script':path[_0x003a('0x9')](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path['join'](__dirname,_0x003a('0xc')),'env':env}]};module[_0x003a('0xd')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index c629654..9a2b402 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 _0x0a9a=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','disconnect'];(function(_0x4e2fe3,_0x15fb77){var _0x4f9d24=function(_0xc32b26){while(--_0xc32b26){_0x4e2fe3['push'](_0x4e2fe3['shift']());}};_0x4f9d24(++_0x15fb77);}(_0x0a9a,0x77));var _0xa0a9=function(_0xa6743c,_0x1e5a66){_0xa6743c=_0xa6743c-0x0;var _0x27528e=_0x0a9a[_0xa6743c];return _0x27528e;};'use strict';var pm2=require(_0xa0a9('0x0'));var BPromise=require(_0xa0a9('0x1'));var config=require(_0xa0a9('0x2'));function connect(){return new BPromise(function(_0x3c5286,_0x40b987){return pm2['connect'](function(_0x5da81f){if(_0x5da81f){return _0x40b987(_0x5da81f);}return _0x3c5286(_0xa0a9('0x3'));});});};exports[_0xa0a9('0x4')]=function(_0x2cc951){return connect()[_0xa0a9('0x5')](function(){return new BPromise(function(_0x306204,_0x1bee1a){return pm2['start'](_0x2cc951,function(_0x47153f,_0x22b88c){if(_0x47153f){return _0x1bee1a(_0x47153f);}pm2[_0xa0a9('0x6')]();return _0x306204(_0x22b88c);});});});};exports['stop']=function(_0x2e8c07){return connect()['then'](function(){return new BPromise(function(_0xb40c81,_0x55912d){return pm2[_0xa0a9('0x7')](_0x2e8c07,function(_0x5a4404,_0x1fff88){if(_0x5a4404){return _0x55912d(_0x5a4404);}pm2[_0xa0a9('0x6')]();return _0xb40c81(_0x1fff88);});});});};exports[_0xa0a9('0x8')]=function(_0x2cec5b){return connect()[_0xa0a9('0x5')](function(){return new BPromise(function(_0x9892ee,_0x550ba4){return pm2[_0xa0a9('0x8')](_0x2cec5b,function(_0x346adb,_0x524ec1){if(_0x346adb){return _0x550ba4(_0x346adb);}pm2[_0xa0a9('0x6')]();return _0x9892ee(_0x524ec1);});});});};exports['list']=function(){return connect()[_0xa0a9('0x5')](function(){return new BPromise(function(_0x3b9905,_0x4468a9){return pm2[_0xa0a9('0x9')](function(_0x90f8a9,_0x1ea615){if(_0x90f8a9){return _0x4468a9(_0x90f8a9);}pm2[_0xa0a9('0x6')]();return _0x3b9905(_0x1ea615);});});});};exports['describe']=function(_0x24047d){return connect()['then'](function(){return new BPromise(function(_0x4494d4,_0xe7b546){return pm2[_0xa0a9('0xa')](_0x24047d,function(_0x8d83fe,_0x44a4c7){if(_0x8d83fe){return _0xe7b546(_0x8d83fe);}pm2['disconnect']();return _0x4494d4(_0x44a4c7);});});});};exports[_0xa0a9('0xb')]=function(_0x486ece){return connect()['then'](function(){return new BPromise(function(_0x2288d,_0xa527ef){return pm2[_0xa0a9('0xb')](_0x486ece,function(_0x3cb1a2,_0x11bf1c){if(_0x3cb1a2){return _0xa527ef(_0x3cb1a2);}pm2['disconnect']();return _0x2288d(_0x11bf1c);});});});};exports[_0xa0a9('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x169986,_0x3cc75d){return pm2[_0xa0a9('0xc')](function(_0xc3bbbf){if(_0xc3bbbf){return _0x3cc75d(_0xc3bbbf);}return _0x169986(_0xa0a9('0xd'));});});});}; \ No newline at end of file +var _0xb8f1=['describe','delete','dump','./config','connect','start','then','disconnect','stop','restart','list'];(function(_0x121a6a,_0x3f6b8e){var _0x22a7d2=function(_0x51e3d6){while(--_0x51e3d6){_0x121a6a['push'](_0x121a6a['shift']());}};_0x22a7d2(++_0x3f6b8e);}(_0xb8f1,0xb3));var _0x1b8f=function(_0x59b258,_0x1ff184){_0x59b258=_0x59b258-0x0;var _0x26ffcf=_0xb8f1[_0x59b258];return _0x26ffcf;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x1b8f('0x0'));function connect(){return new BPromise(function(_0x5cef66,_0x446dfe){return pm2[_0x1b8f('0x1')](function(_0x3682b2){if(_0x3682b2){return _0x446dfe(_0x3682b2);}return _0x5cef66('connected');});});};exports[_0x1b8f('0x2')]=function(_0x5e93ac){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x1d7e43,_0x5cbf23){return pm2[_0x1b8f('0x2')](_0x5e93ac,function(_0x439b7a,_0x53229e){if(_0x439b7a){return _0x5cbf23(_0x439b7a);}pm2[_0x1b8f('0x4')]();return _0x1d7e43(_0x53229e);});});});};exports[_0x1b8f('0x5')]=function(_0x21f7b6){return connect()['then'](function(){return new BPromise(function(_0x5a5a46,_0x4e9ee3){return pm2['stop'](_0x21f7b6,function(_0x2f9466,_0x205bb4){if(_0x2f9466){return _0x4e9ee3(_0x2f9466);}pm2[_0x1b8f('0x4')]();return _0x5a5a46(_0x205bb4);});});});};exports[_0x1b8f('0x6')]=function(_0x12e6f6){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x1c48c5,_0x462043){return pm2[_0x1b8f('0x6')](_0x12e6f6,function(_0xdd03fd,_0x3f51b9){if(_0xdd03fd){return _0x462043(_0xdd03fd);}pm2[_0x1b8f('0x4')]();return _0x1c48c5(_0x3f51b9);});});});};exports[_0x1b8f('0x7')]=function(){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x1306a2,_0x23fce0){return pm2[_0x1b8f('0x7')](function(_0x3c295b,_0x5f1c4a){if(_0x3c295b){return _0x23fce0(_0x3c295b);}pm2[_0x1b8f('0x4')]();return _0x1306a2(_0x5f1c4a);});});});};exports['describe']=function(_0x268b30){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x2759ac,_0x2579e6){return pm2[_0x1b8f('0x8')](_0x268b30,function(_0x477ee6,_0x4891bf){if(_0x477ee6){return _0x2579e6(_0x477ee6);}pm2[_0x1b8f('0x4')]();return _0x2759ac(_0x4891bf);});});});};exports[_0x1b8f('0x9')]=function(_0x484c11){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x2600d9,_0x546b1c){return pm2[_0x1b8f('0x9')](_0x484c11,function(_0x1f5ccd,_0x33f704){if(_0x1f5ccd){return _0x546b1c(_0x1f5ccd);}pm2[_0x1b8f('0x4')]();return _0x2600d9(_0x33f704);});});});};exports[_0x1b8f('0xa')]=function(){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0xe8b405,_0x402622){return pm2[_0x1b8f('0xa')](function(_0x69b7da){if(_0x69b7da){return _0x402622(_0x69b7da);}return _0xe8b405('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index daa84d9..9df3838 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 _0xc845=['[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','find','then','ChatInteraction','lastMsgAt','chatTimeout','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error'];(function(_0x5209d9,_0x40846f){var _0x200544=function(_0xe96c61){while(--_0xe96c61){_0x5209d9['push'](_0x5209d9['shift']());}};_0x200544(++_0x40846f);}(_0xc845,0x196));var _0x5c84=function(_0x36f55d,_0x1615f5){_0x36f55d=_0x36f55d-0x0;var _0x469fb2=_0xc845[_0x36f55d];return _0x469fb2;};'use strict';var _=require(_0x5c84('0x0'));var moment=require(_0x5c84('0x1'));var Redis=require(_0x5c84('0x2'));var util=require(_0x5c84('0x3'));var config=require(_0x5c84('0x4'));var db=require(_0x5c84('0x5'))['db'];var logger=require(_0x5c84('0x6'))('schedule');config[_0x5c84('0x7')]=_[_0x5c84('0x8')](config[_0x5c84('0x7')],{'host':_0x5c84('0x9'),'port':0x18eb});var io=require(_0x5c84('0xa'))(new Redis(config[_0x5c84('0x7')]));function closeInteractions(){var _0x14c0db=0x0;var _0x403bc5=[];return db['Setting'][_0x5c84('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x5c84('0xc')](function(_0x2ea976){_0x14c0db=_0x2ea976['chatTimeout'];if(_0x14c0db){return db[_0x5c84('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x5c84('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2ea976[_0x5c84('0xf')],_0x5c84('0x10'))}}});}else{return[];}})[_0x5c84('0xc')](function(_0x21cddf){if(_0x21cddf&&_0x21cddf[_0x5c84('0x11')]){_0x403bc5=_[_0x5c84('0x12')](_0x21cddf||[],'id');logger[_0x5c84('0x13')](_0x5c84('0x14'),_0x403bc5['join']());return db[_0x5c84('0xd')]['update']({'closeReason':_0x5c84('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x5c84('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x403bc5}});}})['then'](function(){if(_0x403bc5&&_0x403bc5[_0x5c84('0x11')]){logger[_0x5c84('0x13')](_0x5c84('0x17'),_0x403bc5[_0x5c84('0x18')]());for(var _0x38f7ce=0x0;_0x38f7ce<_0x403bc5[_0x5c84('0x11')];_0x38f7ce++){io[_0x5c84('0x19')]('chatInteraction:update',{'id':_0x403bc5[_0x38f7ce],'closed':!![]});}}})[_0x5c84('0x1a')](function(_0x116a5f){logger[_0x5c84('0x1b')](_0x5c84('0x1c'),_0x116a5f?util[_0x5c84('0x1d')](_0x116a5f,{'showHidden':![],'depth':null}):'');});}exports[_0x5c84('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x2413=['ChatInteraction','findAll','lastMsgAt','minutes','length','info','join','system','timeout','format','then','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x2413,0x105));var _0x3241=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2413[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x3241('0x0'))(_0x3241('0x1'));config['redis']=_[_0x3241('0x2')](config[_0x3241('0x3')],{'host':_0x3241('0x4'),'port':0x18eb});var io=require(_0x3241('0x5'))(new Redis(config[_0x3241('0x3')]));function closeInteractions(){var _0x34d720=0x0;var _0x182e5c=[];return db[_0x3241('0x6')][_0x3241('0x7')]({'raw':!![],'attributes':['id',_0x3241('0x8')],'where':{'id':0x1}})['then'](function(_0x646398){_0x34d720=_0x646398[_0x3241('0x8')];if(_0x34d720){return db[_0x3241('0x9')][_0x3241('0xa')]({'raw':!![],'attributes':['id',_0x3241('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x646398[_0x3241('0x8')],_0x3241('0xc'))}}});}else{return[];}})['then'](function(_0x419ead){if(_0x419ead&&_0x419ead[_0x3241('0xd')]){_0x182e5c=_['map'](_0x419ead||[],'id');logger[_0x3241('0xe')]('[CHAT]\x20Interactions\x20to\x20close:',_0x182e5c[_0x3241('0xf')]());return db['ChatInteraction']['update']({'closeReason':_0x3241('0x10'),'disposition':_0x3241('0x11'),'closed':!![],'closedAt':moment()[_0x3241('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x182e5c}});}})[_0x3241('0x13')](function(){if(_0x182e5c&&_0x182e5c['length']){logger[_0x3241('0xe')](_0x3241('0x14'),_0x182e5c[_0x3241('0xf')]());for(var _0x2b8239=0x0;_0x2b8239<_0x182e5c[_0x3241('0xd')];_0x2b8239++){io[_0x3241('0x15')](_0x3241('0x16'),{'id':_0x182e5c[_0x2b8239],'closed':!![]});}}})[_0x3241('0x17')](function(_0x108f60){logger[_0x3241('0x18')](_0x3241('0x19'),_0x108f60?util[_0x3241('0x1a')](_0x108f60,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 639ebf2..bcd923a 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 _0x8a37=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x946e1b,_0x4f9f57){var _0x4db99b=function(_0x16f0e9){while(--_0x16f0e9){_0x946e1b['push'](_0x946e1b['shift']());}};_0x4db99b(++_0x4f9f57);}(_0x8a37,0x1d6));var _0x78a3=function(_0x9ebaa3,_0x4c6efd){_0x9ebaa3=_0x9ebaa3-0x0;var _0x543241=_0x8a37[_0x9ebaa3];return _0x543241;};'use strict';function start(){var _0x13a400=require(_0x78a3('0x0'));return _0x13a400[_0x78a3('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x3254=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x3254,0x182));var _0x4325=function(_0x2a8d5e,_0x1abf24){_0x2a8d5e=_0x2a8d5e-0x0;var _0x195f9b=_0x3254[_0x2a8d5e];return _0x195f9b;};'use strict';function start(){var _0x139d74=require(_0x4325('0x0'));return _0x139d74[_0x4325('0x1')]();}module[_0x4325('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 1cd8a3d..dea04dc 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 _0x9d6a=['error','email\x20sent','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','catch','no\x20report\x20id','MailServerOut','CloudProvider','toString','keyBy','difference','intersection','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','exists','stop\x20cron','length','update','util','path','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','subtractNumber','subtractUnit','savename','format','%s.%s','basename','extname','join','status','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then'];(function(_0x2343bd,_0x50657c){var _0x544091=function(_0x457340){while(--_0x457340){_0x2343bd['push'](_0x2343bd['shift']());}};_0x544091(++_0x50657c);}(_0x9d6a,0x1d0));var _0xa9d6=function(_0x15c68f,_0x2d0471){_0x15c68f=_0x15c68f-0x0;var _0x2598e0=_0x9d6a[_0x15c68f];return _0x2598e0;};'use strict';var fs=require('fs');var util=require(_0xa9d6('0x0'));var path=require(_0xa9d6('0x1'));var _=require(_0xa9d6('0x2'));var moment=require(_0xa9d6('0x3'));var CronJobManager=require(_0xa9d6('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0xa9d6('0x5'));var logger=require(_0xa9d6('0x6'))(_0xa9d6('0x7'));var db=require(_0xa9d6('0x8'))['db'];var analyticCustomReportController=require(_0xa9d6('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xa9d6('0xa')][_0xa9d6('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1336c4,_0x1bdb7c){return function(){logger[_0xa9d6('0xc')](_0xa9d6('0xd'),_0x1336c4[_0xa9d6('0xe')]);var _0x5aa446=!![];var _0x76b3a2=_0x1336c4[_0xa9d6('0xf')][_0xa9d6('0x10')]();var _0x3c4b38={'account':_0x76b3a2,'message':{'from':util['format'](_0xa9d6('0x11'),_0x1336c4[_0xa9d6('0xf')]['name'],_0x1336c4[_0xa9d6('0xf')][_0xa9d6('0xe')]||_0x1336c4[_0xa9d6('0xf')][_0xa9d6('0x12')][_0xa9d6('0x13')]),'to':_0x1336c4[_0xa9d6('0xe')],'cc':_0x1336c4['cc'],'bcc':_0x1336c4[_0xa9d6('0x14')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x1bdb7c['name'],_0x1336c4[_0xa9d6('0x15')],_0x1336c4[_0xa9d6('0x16')])}};var _0x568396=path['join'](__dirname,'../../files/reports');var _0x18d95c=_0x1bdb7c[_0xa9d6('0x17')];var _0x2acb2f=util[_0xa9d6('0x18')](_0xa9d6('0x19'),path[_0xa9d6('0x1a')](_0x1bdb7c[_0xa9d6('0x17')],path[_0xa9d6('0x1b')](_0x1bdb7c[_0xa9d6('0x17')])),'zip');var _0x5af92f=path[_0xa9d6('0x1c')](_0x568396,_0x18d95c);var _0x490737=path[_0xa9d6('0x1c')](_0x568396,_0x2acb2f);if(fs['existsSync'](_0x5af92f)){_0x1bdb7c[_0xa9d6('0x1d')]=_0xa9d6('0x1e');_0x3c4b38['message'][_0xa9d6('0x1f')]=[{'filename':_0x18d95c,'path':_0x5af92f}];_0x3c4b38[_0xa9d6('0x20')]['text']=util['format'](_0xa9d6('0x21'),JSON[_0xa9d6('0x22')](_0x1bdb7c,null,0x2));}else if(fs['existsSync'](_0x490737)){_0x1bdb7c[_0xa9d6('0x1d')]=_0xa9d6('0x1e');_0x3c4b38['message'][_0xa9d6('0x1f')]=[{'filename':_0x2acb2f,'path':_0x490737}];}else{_0x3c4b38[_0xa9d6('0x20')][_0xa9d6('0x23')]=_0xa9d6('0x24');if(!_0x1336c4[_0xa9d6('0x25')]){_0x5aa446=![];logger[_0xa9d6('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x5aa446){return client[_0xa9d6('0x26')]('SendMail',_0x3c4b38)[_0xa9d6('0x27')](function(_0x245233){if(_0x245233['error']){return logger[_0xa9d6('0x28')]('error\x20mail',JSON[_0xa9d6('0x22')](_0x245233));}return logger[_0xa9d6('0xc')](_0xa9d6('0x29'));})['catch'](function(_0x326f5c){return logger[_0xa9d6('0x28')](_0xa9d6('0x2a'),JSON[_0xa9d6('0x22')](_0x326f5c));});}};}function handleError(){return function(_0x57c862){return logger['error'](JSON[_0xa9d6('0x22')](_0x57c862));};}function handleResult(_0x4aed56){return function(_0x21cb10){logger[_0xa9d6('0xc')](_0xa9d6('0x2b'),JSON[_0xa9d6('0x22')](_0x21cb10));if(_0x4aed56['MailAccount']&&_0x4aed56[_0xa9d6('0xf')]['Smtp']&&!_[_0xa9d6('0x2c')](_0x4aed56[_0xa9d6('0xe')])){setTimeout(handleSendEmail(_0x4aed56,_0x21cb10),0x3c*0x3e8);}};}function handleJob(_0x16e044){return function(){try{if(_[_0xa9d6('0x2c')](_0x16e044[_0xa9d6('0x15')])){return logger[_0xa9d6('0xc')](_0xa9d6('0x2d'));}if(_[_0xa9d6('0x2c')](_0x16e044[_0xa9d6('0x16')])){return logger['info'](_0xa9d6('0x2e'));}var _0x174f45={'startDate':moment()[_0xa9d6('0x2f')](_0x16e044[_0xa9d6('0x15')],_0x16e044[_0xa9d6('0x16')])[_0xa9d6('0x18')](_0xa9d6('0x30')),'endDate':moment()[_0xa9d6('0x18')](_0xa9d6('0x30')),'type':_0xa9d6('0x31'),'output':_0x16e044[_0xa9d6('0x32')],'name':_0x16e044[_0xa9d6('0x33')]};if(!_['isNil'](_0x16e044['DefaultReportId'])){logger[_0xa9d6('0xc')](_0xa9d6('0x34'),_0x16e044['DefaultReportId']);return analyticDefaultReportController[_0xa9d6('0x35')]({'id':_0x16e044[_0xa9d6('0x36')]},_0x174f45)[_0xa9d6('0x27')](handleResult(_0x16e044))['catch'](handleError());}if(!_[_0xa9d6('0x2c')](_0x16e044[_0xa9d6('0x37')])){logger[_0xa9d6('0xc')](_0xa9d6('0x38'),_0x16e044['CustomReportId']);return analyticCustomReportController[_0xa9d6('0x35')]({'id':_0x16e044[_0xa9d6('0x37')]},_0x174f45)[_0xa9d6('0x27')](handleResult(_0x16e044))[_0xa9d6('0x39')](handleError());}}catch(_0x5451ee){logger[_0xa9d6('0x28')](JSON[_0xa9d6('0x22')](_0x5451ee));}return logger['info'](_0xa9d6('0x3a'));};}function getJobs(_0x25213f){var _0x5aceb7={};if(_0x25213f){_0x5aceb7['id']=_0x25213f;}return db['Schedule']['findAll']({'where':_0x5aceb7,'include':[{'model':db[_0xa9d6('0xf')],'attributes':['id',_0xa9d6('0x33'),_0xa9d6('0xe')],'include':[{'model':db[_0xa9d6('0x3b')],'as':_0xa9d6('0x12'),'include':[{'model':db['CloudProvider'],'as':_0xa9d6('0x3c')}]}]}]})['then'](function(_0x9f769d){var _0xe9b2bd=_['keys'](manager['jobs']);var _0x5f5661=_['map'](_0x9f769d,function(_0x32b120){return _0x32b120['id'][_0xa9d6('0x3d')]();});var _0x2282fb=_[_0xa9d6('0x3e')](_0x9f769d,function(_0x2fbf99){return _0x2fbf99['id'][_0xa9d6('0x3d')]();});var _0x3e1309=_0x25213f?_0x5f5661:_[_0xa9d6('0x3f')](_0x5f5661,_0xe9b2bd);var _0x2d5a95=_[_0xa9d6('0x40')](_0x5f5661,_0xe9b2bd);var _0x28219b=_[_0xa9d6('0x3f')](_0xe9b2bd,_0x5f5661);var _0x902d23;var _0x4b9050;for(_0x902d23=0x0;_0x902d23<_0x28219b['length']&&!_0x25213f;_0x902d23+=0x1){_0x4b9050=_0x28219b[_0x902d23][_0xa9d6('0x3d')]();if(manager['exists'](_0x4b9050)){manager[_0xa9d6('0x41')](_0x4b9050);manager[_0xa9d6('0x42')](_0x4b9050);logger[_0xa9d6('0xc')](_0xa9d6('0x43'),_0x4b9050);}}logger[_0xa9d6('0xc')](_0xa9d6('0x44'),JSON['stringify'](_0x3e1309));for(_0x902d23=0x0;_0x902d23<_0x3e1309['length'];_0x902d23+=0x1){_0x4b9050=_0x3e1309[_0x902d23][_0xa9d6('0x3d')]();logger[_0xa9d6('0xc')](_0xa9d6('0x45'),_0x4b9050);if(_0x25213f){logger[_0xa9d6('0xc')](_0xa9d6('0x46'),_0x25213f);logger['info'](JSON[_0xa9d6('0x22')](_0x2282fb[_0x4b9050]));BPromise[_0xa9d6('0x47')]()['then'](handleJob(_0x2282fb[_0x4b9050]));logger[_0xa9d6('0xc')]('run\x20job',_0x2282fb[_0x4b9050][_0xa9d6('0x33')],_0x2282fb[_0x4b9050][_0xa9d6('0x48')]);}else if(_0x2282fb[_0x4b9050]['cron']&&_0x2282fb[_0x4b9050][_0xa9d6('0x49')]&&moment()[_0xa9d6('0x4a')](_0x2282fb[_0x4b9050][_0xa9d6('0x4b')],_0x2282fb[_0x4b9050][_0xa9d6('0x4c')])){manager[_0xa9d6('0x4d')](_0x4b9050,_0x2282fb[_0x4b9050][_0xa9d6('0x48')],handleJob(_0x2282fb[_0x4b9050]));manager[_0xa9d6('0x4e')](_0x4b9050);logger[_0xa9d6('0xc')](_0xa9d6('0x4f'),_0x2282fb[_0x4b9050]['name'],_0x2282fb[_0x4b9050]['cron']);}else if(manager[_0xa9d6('0x50')](_0x4b9050)){manager[_0xa9d6('0x41')](_0x4b9050);manager[_0xa9d6('0x42')](_0x4b9050);logger[_0xa9d6('0xc')](_0xa9d6('0x51'),_0x2282fb[_0x4b9050][_0xa9d6('0x33')],_0x2282fb[_0x4b9050][_0xa9d6('0x48')]);}}for(_0x902d23=0x0,_0x4b9050;_0x902d23<_0x2d5a95[_0xa9d6('0x52')]&&!_0x25213f;_0x902d23+=0x1){_0x4b9050=_0x2d5a95[_0x902d23][_0xa9d6('0x3d')]();if(manager[_0xa9d6('0x50')](_0x4b9050)){if(_0x2282fb[_0x4b9050]['cron']&&_0x2282fb[_0x4b9050][_0xa9d6('0x49')]&&moment()[_0xa9d6('0x4a')](_0x2282fb[_0x4b9050][_0xa9d6('0x4b')],_0x2282fb[_0x4b9050][_0xa9d6('0x4c')])){manager[_0xa9d6('0x53')](_0x4b9050,_0x2282fb[_0x4b9050][_0xa9d6('0x48')],handleJob(_0x2282fb[_0x4b9050]));logger[_0xa9d6('0xc')]('update\x20cron',_0x2282fb[_0x4b9050]['name'],_0x2282fb[_0x4b9050][_0xa9d6('0x48')]);}else{manager[_0xa9d6('0x41')](_0x4b9050);manager[_0xa9d6('0x42')](_0x4b9050);logger[_0xa9d6('0xc')](_0xa9d6('0x51'),_0x2282fb[_0x4b9050][_0xa9d6('0x33')],_0x2282fb[_0x4b9050]['cron']);}}}})['catch'](function(_0x24f97c){logger[_0xa9d6('0x28')](JSON['stringify'](_0x24f97c));});}exports['run']=function(_0x2741db){return getJobs(_0x2741db);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x756e=['bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','Report\x20%s\x20last\x20%s\x20%s','join','../../files/reports','%s.%s','savename','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','isNil','subtractNumber','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','difference','length','exists','stop','deleteJob','delete\x20cron','my\x20id','cron','active','isBetween','endAt','add\x20cron','stop\x20cron','startAt','update','update\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise'];(function(_0x579af8,_0x2edf89){var _0x5c5da4=function(_0x3aa9ef){while(--_0x3aa9ef){_0x579af8['push'](_0x579af8['shift']());}};_0x5c5da4(++_0x2edf89);}(_0x756e,0x94));var _0xe756=function(_0x5e179f,_0xcf2d6d){_0x5e179f=_0x5e179f-0x0;var _0x5090f9=_0x756e[_0x5e179f];return _0x5090f9;};'use strict';var fs=require('fs');var util=require(_0xe756('0x0'));var path=require(_0xe756('0x1'));var _=require(_0xe756('0x2'));var moment=require(_0xe756('0x3'));var CronJobManager=require(_0xe756('0x4'));var jayson=require(_0xe756('0x5'));var BPromise=require(_0xe756('0x6'));var logger=require(_0xe756('0x7'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xe756('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xe756('0x9')][_0xe756('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e5a4b,_0x3952a4){return function(){logger['info'](_0xe756('0xb'),_0x1e5a4b[_0xe756('0xc')]);var _0x37b246=!![];var _0x539c5b=_0x1e5a4b[_0xe756('0xd')][_0xe756('0xe')]();var _0x56757b={'account':_0x539c5b,'message':{'from':util[_0xe756('0xf')](_0xe756('0x10'),_0x1e5a4b[_0xe756('0xd')][_0xe756('0x11')],_0x1e5a4b[_0xe756('0xd')][_0xe756('0xc')]||_0x1e5a4b['MailAccount'][_0xe756('0x12')]['user']),'to':_0x1e5a4b[_0xe756('0xc')],'cc':_0x1e5a4b['cc'],'bcc':_0x1e5a4b['bcc'],'subject':util[_0xe756('0xf')](_0xe756('0x13'),_0x3952a4[_0xe756('0x11')],_0x1e5a4b['subtractNumber'],_0x1e5a4b['subtractUnit'])}};var _0xc59755=path[_0xe756('0x14')](__dirname,_0xe756('0x15'));var _0xbfef29=_0x3952a4['savename'];var _0x22d275=util[_0xe756('0xf')](_0xe756('0x16'),path['basename'](_0x3952a4['savename'],path['extname'](_0x3952a4[_0xe756('0x17')])),'zip');var _0x3d7a4c=path[_0xe756('0x14')](_0xc59755,_0xbfef29);var _0x32b3e9=path['join'](_0xc59755,_0x22d275);if(fs['existsSync'](_0x3d7a4c)){_0x3952a4[_0xe756('0x18')]=_0xe756('0x19');_0x56757b[_0xe756('0x1a')][_0xe756('0x1b')]=[{'filename':_0xbfef29,'path':_0x3d7a4c}];_0x56757b[_0xe756('0x1a')][_0xe756('0x1c')]=util[_0xe756('0xf')](_0xe756('0x1d'),JSON[_0xe756('0x1e')](_0x3952a4,null,0x2));}else if(fs[_0xe756('0x1f')](_0x32b3e9)){_0x3952a4[_0xe756('0x18')]='Sent';_0x56757b['message'][_0xe756('0x1b')]=[{'filename':_0x22d275,'path':_0x32b3e9}];}else{_0x56757b['message']['text']=_0xe756('0x20');if(!_0x1e5a4b[_0xe756('0x21')]){_0x37b246=![];logger[_0xe756('0x22')](_0xe756('0x23'));}}if(_0x37b246){return client[_0xe756('0x24')]('SendMail',_0x56757b)[_0xe756('0x25')](function(_0x1a2b9e){if(_0x1a2b9e[_0xe756('0x26')]){return logger[_0xe756('0x26')](_0xe756('0x27'),JSON[_0xe756('0x1e')](_0x1a2b9e));}return logger[_0xe756('0x22')](_0xe756('0x28'));})['catch'](function(_0x450ce0){return logger[_0xe756('0x26')](_0xe756('0x27'),JSON[_0xe756('0x1e')](_0x450ce0));});}};}function handleError(){return function(_0x56aa27){return logger[_0xe756('0x26')](JSON[_0xe756('0x1e')](_0x56aa27));};}function handleResult(_0x2feb43){return function(_0xfdafc7){logger[_0xe756('0x22')]('data',JSON[_0xe756('0x1e')](_0xfdafc7));if(_0x2feb43[_0xe756('0xd')]&&_0x2feb43[_0xe756('0xd')][_0xe756('0x12')]&&!_['isNil'](_0x2feb43['email'])){setTimeout(handleSendEmail(_0x2feb43,_0xfdafc7),0x3c*0x3e8);}};}function handleJob(_0x44b545){return function(){try{if(_[_0xe756('0x29')](_0x44b545[_0xe756('0x2a')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe756('0x29')](_0x44b545[_0xe756('0x2b')])){return logger[_0xe756('0x22')]('subtractUnit\x20null\x20or\x20undefined');}var _0x4b03ec={'startDate':moment()[_0xe756('0x2c')](_0x44b545[_0xe756('0x2a')],_0x44b545['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xe756('0xf')](_0xe756('0x2d')),'type':_0xe756('0x2e'),'output':_0x44b545['output'],'name':_0x44b545['name']};if(!_[_0xe756('0x29')](_0x44b545[_0xe756('0x2f')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x44b545[_0xe756('0x2f')]);return analyticDefaultReportController[_0xe756('0x30')]({'id':_0x44b545[_0xe756('0x2f')]},_0x4b03ec)[_0xe756('0x25')](handleResult(_0x44b545))[_0xe756('0x31')](handleError());}if(!_[_0xe756('0x29')](_0x44b545[_0xe756('0x32')])){logger[_0xe756('0x22')](_0xe756('0x33'),_0x44b545[_0xe756('0x32')]);return analyticCustomReportController[_0xe756('0x30')]({'id':_0x44b545[_0xe756('0x32')]},_0x4b03ec)[_0xe756('0x25')](handleResult(_0x44b545))[_0xe756('0x31')](handleError());}}catch(_0xccb0c5){logger[_0xe756('0x26')](JSON[_0xe756('0x1e')](_0xccb0c5));}return logger[_0xe756('0x22')]('no\x20report\x20id');};}function getJobs(_0x383019){var _0xd27e56={};if(_0x383019){_0xd27e56['id']=_0x383019;}return db[_0xe756('0x34')][_0xe756('0x35')]({'where':_0xd27e56,'include':[{'model':db[_0xe756('0xd')],'attributes':['id',_0xe756('0x11'),_0xe756('0xc')],'include':[{'model':db[_0xe756('0x36')],'as':'Smtp','include':[{'model':db[_0xe756('0x37')],'as':_0xe756('0x37')}]}]}]})[_0xe756('0x25')](function(_0x59bcf8){var _0x411041=_['keys'](manager[_0xe756('0x38')]);var _0x45f720=_[_0xe756('0x39')](_0x59bcf8,function(_0x4d1d7c){return _0x4d1d7c['id'][_0xe756('0x3a')]();});var _0x546d23=_['keyBy'](_0x59bcf8,function(_0xd4bc14){return _0xd4bc14['id'][_0xe756('0x3a')]();});var _0x3e99a4=_0x383019?_0x45f720:_[_0xe756('0x3b')](_0x45f720,_0x411041);var _0x2d5288=_['intersection'](_0x45f720,_0x411041);var _0x52339a=_['difference'](_0x411041,_0x45f720);var _0x21b593;var _0x5c5397;for(_0x21b593=0x0;_0x21b593<_0x52339a[_0xe756('0x3c')]&&!_0x383019;_0x21b593+=0x1){_0x5c5397=_0x52339a[_0x21b593]['toString']();if(manager[_0xe756('0x3d')](_0x5c5397)){manager[_0xe756('0x3e')](_0x5c5397);manager[_0xe756('0x3f')](_0x5c5397);logger[_0xe756('0x22')](_0xe756('0x40'),_0x5c5397);}}logger[_0xe756('0x22')]('toRun',JSON['stringify'](_0x3e99a4));for(_0x21b593=0x0;_0x21b593<_0x3e99a4[_0xe756('0x3c')];_0x21b593+=0x1){_0x5c5397=_0x3e99a4[_0x21b593]['toString']();logger['info']('index',_0x5c5397);if(_0x383019){logger[_0xe756('0x22')](_0xe756('0x41'),_0x383019);logger[_0xe756('0x22')](JSON[_0xe756('0x1e')](_0x546d23[_0x5c5397]));BPromise['resolve']()[_0xe756('0x25')](handleJob(_0x546d23[_0x5c5397]));logger[_0xe756('0x22')]('run\x20job',_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}else if(_0x546d23[_0x5c5397][_0xe756('0x42')]&&_0x546d23[_0x5c5397][_0xe756('0x43')]&&moment()[_0xe756('0x44')](_0x546d23[_0x5c5397]['startAt'],_0x546d23[_0x5c5397][_0xe756('0x45')])){manager['add'](_0x5c5397,_0x546d23[_0x5c5397][_0xe756('0x42')],handleJob(_0x546d23[_0x5c5397]));manager['start'](_0x5c5397);logger[_0xe756('0x22')](_0xe756('0x46'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}else if(manager[_0xe756('0x3d')](_0x5c5397)){manager['stop'](_0x5c5397);manager[_0xe756('0x3f')](_0x5c5397);logger['info'](_0xe756('0x47'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}}for(_0x21b593=0x0,_0x5c5397;_0x21b593<_0x2d5288[_0xe756('0x3c')]&&!_0x383019;_0x21b593+=0x1){_0x5c5397=_0x2d5288[_0x21b593][_0xe756('0x3a')]();if(manager['exists'](_0x5c5397)){if(_0x546d23[_0x5c5397][_0xe756('0x42')]&&_0x546d23[_0x5c5397]['active']&&moment()[_0xe756('0x44')](_0x546d23[_0x5c5397][_0xe756('0x48')],_0x546d23[_0x5c5397][_0xe756('0x45')])){manager[_0xe756('0x49')](_0x5c5397,_0x546d23[_0x5c5397][_0xe756('0x42')],handleJob(_0x546d23[_0x5c5397]));logger['info'](_0xe756('0x4a'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}else{manager[_0xe756('0x3e')](_0x5c5397);manager[_0xe756('0x3f')](_0x5c5397);logger[_0xe756('0x22')](_0xe756('0x47'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397]['cron']);}}}})[_0xe756('0x31')](function(_0x2a3b9b){logger[_0xe756('0x26')](JSON[_0xe756('0x1e')](_0x2a3b9b));});}exports[_0xe756('0x4b')]=function(_0xaee585){return getJobs(_0xaee585);};exports[_0xe756('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 75fc522..336e6a1 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 _0xa49b=['Transcript\x20not\x20available','CloudProvider','findOne','sentimentAccountId','Cloud\x20Provider\x20not\x20configured','Positive','Negative','SentimentScore','Mixed','Neutral','FAILED','FailureReason','resolve','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','SequelizeValidationError','start','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','getTranscriptionJob','Comprehend','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','then','transcribeName','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','fileText','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0xa49b,0x126));var _0xba49=function(_0xf13f7d,_0x5448b4){_0xf13f7d=_0xf13f7d-0x0;var _0x302434=_0xa49b[_0xf13f7d];return _0x302434;};var _=require('lodash');var AWS=require(_0xba49('0x0'));var rp=require(_0xba49('0x1'));var util=require(_0xba49('0x2'));var BPromise=require(_0xba49('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xba49('0x4'))(_0xba49('0x5'));function getTranscriptionJob(_0x26c4ef,_0x5a2c15,_0x1bad43,_0x17710a){return new Promise(function(_0x3315bc,_0x525dfd){var _0xd5d20d=new AWS['TranscribeService']({'accessKeyId':_0x5a2c15,'secretAccessKey':_0x26c4ef,'region':_0x1bad43});_0xd5d20d[_0xba49('0x6')]({'TranscriptionJobName':_0x17710a},function(_0x47340c,_0x2bfae5){if(_0x47340c){return _0x525dfd(_0x47340c);}else{return _0x3315bc(_0x2bfae5);}});});}function sentiment(_0x4f0b8c,_0x2733a4,_0x249dd6,_0x755387,_0x5251e4){return new Promise(function(_0x5d9f2f,_0x27ec37){var _0x1c26a0=new AWS[(_0xba49('0x7'))]({'accessKeyId':_0x2733a4,'secretAccessKey':_0x4f0b8c,'region':_0x249dd6});_0x1c26a0['detectSentiment']({'Text':_0x755387,'LanguageCode':_0x5251e4['substring'](0x0,0x2)},function(_0x19d2f8,_0x5cff2f){if(_0x19d2f8){return _0x27ec37(_0x19d2f8);}else{return _0x5d9f2f(_0x5cff2f);}});});}function checkTranscribeJob(_0x58b8bf,_0x5249cd,_0x324539){var _0x498a91;return new BPromise(function(_0x52bd67,_0x9e4b15){logger[_0xba49('0x8')](util[_0xba49('0x9')](_0xba49('0xa'),_0x58b8bf['id'],_0x58b8bf['transcribeName']));return getTranscriptionJob(_0x324539[_0xba49('0xb')],_0x324539[_0xba49('0xc')],_0x5249cd['transcribeRegion'],_0x58b8bf['transcribeName'])[_0xba49('0xd')](function(_0x1e11e4){logger[_0xba49('0x8')](util[_0xba49('0x9')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x58b8bf['id'],_0x58b8bf[_0xba49('0xe')],_0x1e11e4[_0xba49('0xf')][_0xba49('0x10')]));if(!_0x58b8bf['fileText']){switch(_0x1e11e4[_0xba49('0xf')][_0xba49('0x10')]){case _0xba49('0x11'):var _0x4da3ca={'transcribeStatus':_0x1e11e4['TranscriptionJob'][_0xba49('0x10')],'fileUri':_0x1e11e4['TranscriptionJob'][_0xba49('0x12')]['TranscriptFileUri']};logger[_0xba49('0x8')](util[_0xba49('0x9')](_0xba49('0x13'),_0x58b8bf['id']));return rp({'uri':_0x1e11e4[_0xba49('0xf')][_0xba49('0x12')][_0xba49('0x14')],'json':!![]})[_0xba49('0xd')](function(_0x331ec2){logger[_0xba49('0x8')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x58b8bf['id']));if(_0x331ec2&&_0x331ec2[_0xba49('0x15')]&&_0x331ec2[_0xba49('0x15')]['transcripts']&&_0x331ec2['results']['transcripts']['length']){_0x4da3ca[_0xba49('0x16')]='';for(var _0x3cd3f4=0x0;_0x3cd3f4<_0x331ec2[_0xba49('0x15')][_0xba49('0x17')][_0xba49('0x18')];_0x3cd3f4++){_0x4da3ca[_0xba49('0x16')]+=_0x331ec2[_0xba49('0x15')][_0xba49('0x17')][_0x3cd3f4]['transcript']+'';}}return _0x58b8bf[_0xba49('0x19')](_0x4da3ca);})[_0xba49('0xd')](function(){logger[_0xba49('0x8')](util['format'](_0xba49('0x1a'),_0x58b8bf['id']));if(!_0x58b8bf[_0xba49('0x1b')]){throw new db[(_0xba49('0x1c'))]['ValidationError'](_0xba49('0x1d'));}if(!_0x5249cd[_0xba49('0x1e')]||!_0x5249cd['sentimentAccountId']||!_0x5249cd[_0xba49('0x1f')]||!_0x5249cd[_0xba49('0x20')]||!_0x5249cd[_0xba49('0x21')]){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))](_0xba49('0x23'));}if(!_0x4da3ca['fileText']){throw new Error(_0xba49('0x24'));}if(_0x5249cd['sentimentAccountId']===_0x324539['id']){return _0x324539;}else{return db[_0xba49('0x25')][_0xba49('0x26')]({'where':{'id':_settings[_0xba49('0x27')]}});}})['then'](function(_0x217b0c){if(!_0x217b0c){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x217b0c[_0xba49('0xb')]||!_0x217b0c[_0xba49('0xc')]){throw new db['Sequelize'][(_0xba49('0x22'))](_0xba49('0x28'));}_0x498a91=_0x217b0c;logger[_0xba49('0x8')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x58b8bf['id']));return sentiment(_0x498a91[_0xba49('0xb')],_0x498a91[_0xba49('0xc')],_0x5249cd[_0xba49('0x1f')],_0x4da3ca[_0xba49('0x16')],_0x5249cd[_0xba49('0x20')]);})[_0xba49('0xd')](function(_0x4b551b){logger[_0xba49('0x8')](util[_0xba49('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x58b8bf['id']));return _0x58b8bf[_0xba49('0x19')]({'sentiment':_0x4b551b['Sentiment'],'sPositive':_0x4b551b['SentimentScore'][_0xba49('0x29')],'sNegative':_0x4b551b['SentimentScore'][_0xba49('0x2a')],'sMixed':_0x4b551b[_0xba49('0x2b')][_0xba49('0x2c')],'sNeutral':_0x4b551b[_0xba49('0x2b')][_0xba49('0x2d')]});})[_0xba49('0xd')](function(){logger[_0xba49('0x8')](util[_0xba49('0x9')](_0xba49('0x1a'),_0x58b8bf['id']));_0x52bd67();});case _0xba49('0x2e'):return _0x58b8bf['update']({'transcribeStatus':_0xba49('0x2e'),'failureReason':_0x1e11e4[_0xba49('0xf')][_0xba49('0x2f')]})[_0xba49('0xd')](function(){logger[_0xba49('0x8')](util[_0xba49('0x9')](_0xba49('0x1a'),_0x58b8bf['id']));_0x52bd67();});default:logger['info'](util[_0xba49('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x58b8bf['id']));break;}}else{return BPromise[_0xba49('0x30')]()['then'](function(){if(!_0x58b8bf['tempSentiment']){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))](_0xba49('0x1d'));}if(!_0x5249cd['sentiment']||!_0x5249cd['sentimentAccountId']||!_0x5249cd['sentimentRegion']||!_0x5249cd[_0xba49('0x20')]||!_0x5249cd['bucket']){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x58b8bf[_0xba49('0x16')]){throw new Error(_0xba49('0x24'));}if(_0x5249cd[_0xba49('0x27')]===_0x324539['id']){return _0x324539;}else{return db[_0xba49('0x25')][_0xba49('0x26')]({'where':{'id':_settings[_0xba49('0x27')]}});}})['then'](function(_0x48cbd5){if(!_0x48cbd5){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))](_0xba49('0x31'));}if(!_0x48cbd5[_0xba49('0xb')]||!_0x48cbd5[_0xba49('0xc')]){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))](_0xba49('0x28'));}_0x498a91=_0x48cbd5;logger[_0xba49('0x8')](util[_0xba49('0x9')](_0xba49('0x32'),_0x58b8bf['id']));return sentiment(_0x498a91[_0xba49('0xb')],_0x498a91[_0xba49('0xc')],_0x5249cd[_0xba49('0x1f')],_0x58b8bf['fileText'],_0x5249cd[_0xba49('0x20')]);})[_0xba49('0xd')](function(_0x4384ee){logger['info'](util[_0xba49('0x9')](_0xba49('0x33'),_0x58b8bf['id']));return _0x58b8bf['update']({'sentiment':_0x4384ee['Sentiment'],'sPositive':_0x4384ee[_0xba49('0x2b')]['Positive'],'sNegative':_0x4384ee[_0xba49('0x2b')][_0xba49('0x2a')],'sMixed':_0x4384ee[_0xba49('0x2b')][_0xba49('0x2c')],'sNeutral':_0x4384ee[_0xba49('0x2b')][_0xba49('0x2d')],'transcribeStatus':'COMPLETED'});})[_0xba49('0xd')](function(){logger[_0xba49('0x8')](util[_0xba49('0x9')](_0xba49('0x1a'),_0x58b8bf['id']));_0x52bd67();});}})['catch'](function(_0x2c553d){if(_0x2c553d){if(!_0x2c553d[_0xba49('0x34')]||_0x2c553d[_0xba49('0x34')]!=='SequelizeValidationError'){logger['error'](util[_0xba49('0x9')](_0xba49('0x35'),_0x58b8bf['id']),util[_0xba49('0x36')](_0x2c553d,{'showHidden':![],'depth':null}));}}_0x52bd67();});});}function checkTranscribe(){var _0x4f5d27;var _0x10c177;var _0x21a49b;return db[_0xba49('0x37')]['findAll']({'where':{'transcribeStatus':_0xba49('0x38')}})[_0xba49('0xd')](function(_0x371b7b){if(!_0x371b7b||!_0x371b7b[_0xba49('0x18')]){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))]('No\x20transcribe\x20job\x20to\x20check');}_0x4f5d27=_0x371b7b;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xba49('0xd')](function(_0x34aed7){if(!_0x34aed7){throw new db['Sequelize'][(_0xba49('0x22'))](_0xba49('0x39'));}_0x10c177=_0x34aed7;if(!_0x10c177[_0xba49('0x5')]||!_0x10c177[_0xba49('0x3a')]||!_0x10c177['transcribeRegion']||!_0x10c177[_0xba49('0x20')]||!_0x10c177[_0xba49('0x21')]){throw new db['Sequelize'][(_0xba49('0x22'))](_0xba49('0x3b'));}return db['CloudProvider'][_0xba49('0x26')]({'where':{'id':_0x10c177['transcribeAccountId']}});})[_0xba49('0xd')](function(_0x137355){if(!_0x137355){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))](_0xba49('0x31'));}if(!_0x137355[_0xba49('0xb')]||!_0x137355['data2']){throw new db[(_0xba49('0x1c'))][(_0xba49('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x21a49b=_0x137355;var _0x5cfca5=[];_0x4f5d27[_0xba49('0x3c')](function(_0xfa23be){_0x5cfca5[_0xba49('0x3d')](checkTranscribeJob(_0xfa23be,_0x10c177,_0x21a49b));});return BPromise[_0xba49('0x3e')](_0x5cfca5);})[_0xba49('0x3f')](function(_0x19197a){if(_0x19197a){if(!_0x19197a[_0xba49('0x34')]||_0x19197a[_0xba49('0x34')]!==_0xba49('0x40')){logger['error'](util[_0xba49('0x36')](_0x19197a,{'showHidden':![],'depth':null}));}}});}exports[_0xba49('0x41')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x4d41=['aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','ValidationError','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','resolve','sentiment','CloudProvider','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Cloud\x20Provider\x20not\x20available','push','all','start','lodash'];(function(_0x4e02ea,_0x1d08bf){var _0x55a1e2=function(_0x46b345){while(--_0x46b345){_0x4e02ea['push'](_0x4e02ea['shift']());}};_0x55a1e2(++_0x1d08bf);}(_0x4d41,0x153));var _0x14d4=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x4d41[_0x2bbc07];return _0x6879e4;};var _=require(_0x14d4('0x0'));var AWS=require(_0x14d4('0x1'));var rp=require(_0x14d4('0x2'));var util=require('util');var BPromise=require(_0x14d4('0x3'));var db=require(_0x14d4('0x4'))['db'];var logger=require(_0x14d4('0x5'))(_0x14d4('0x6'));function getTranscriptionJob(_0x1d6194,_0x1b8e61,_0x582ae6,_0x579772){return new Promise(function(_0x21f1f2,_0x35eabb){var _0x2f7d30=new AWS['TranscribeService']({'accessKeyId':_0x1b8e61,'secretAccessKey':_0x1d6194,'region':_0x582ae6});_0x2f7d30['getTranscriptionJob']({'TranscriptionJobName':_0x579772},function(_0x5af0d5,_0x38ad4e){if(_0x5af0d5){return _0x35eabb(_0x5af0d5);}else{return _0x21f1f2(_0x38ad4e);}});});}function sentiment(_0x1bceeb,_0x28d13a,_0x466286,_0x4dab73,_0x54ed12){return new Promise(function(_0x14e477,_0x3031cc){var _0x2f4309=new AWS['Comprehend']({'accessKeyId':_0x28d13a,'secretAccessKey':_0x1bceeb,'region':_0x466286});_0x2f4309['detectSentiment']({'Text':_0x4dab73,'LanguageCode':_0x54ed12[_0x14d4('0x7')](0x0,0x2)},function(_0x5e42e7,_0x1ddd8b){if(_0x5e42e7){return _0x3031cc(_0x5e42e7);}else{return _0x14e477(_0x1ddd8b);}});});}function checkTranscribeJob(_0x1f3b0b,_0x53babc,_0x1b6d6b){var _0xb92ef4;return new BPromise(function(_0x1aec75,_0xce7f14){logger[_0x14d4('0x8')](util[_0x14d4('0x9')](_0x14d4('0xa'),_0x1f3b0b['id'],_0x1f3b0b[_0x14d4('0xb')]));return getTranscriptionJob(_0x1b6d6b[_0x14d4('0xc')],_0x1b6d6b['data2'],_0x53babc[_0x14d4('0xd')],_0x1f3b0b[_0x14d4('0xb')])[_0x14d4('0xe')](function(_0x512c79){logger[_0x14d4('0x8')](util[_0x14d4('0x9')](_0x14d4('0xf'),_0x1f3b0b['id'],_0x1f3b0b[_0x14d4('0xb')],_0x512c79[_0x14d4('0x10')][_0x14d4('0x11')]));if(!_0x1f3b0b[_0x14d4('0x12')]){switch(_0x512c79[_0x14d4('0x10')][_0x14d4('0x11')]){case _0x14d4('0x13'):var _0x75287d={'transcribeStatus':_0x512c79[_0x14d4('0x10')]['TranscriptionJobStatus'],'fileUri':_0x512c79[_0x14d4('0x10')][_0x14d4('0x14')][_0x14d4('0x15')]};logger['info'](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x1f3b0b['id']));return rp({'uri':_0x512c79[_0x14d4('0x10')][_0x14d4('0x14')][_0x14d4('0x15')],'json':!![]})[_0x14d4('0xe')](function(_0x39022f){logger['info'](util[_0x14d4('0x9')](_0x14d4('0x16'),_0x1f3b0b['id']));if(_0x39022f&&_0x39022f[_0x14d4('0x17')]&&_0x39022f['results']['transcripts']&&_0x39022f[_0x14d4('0x17')][_0x14d4('0x18')][_0x14d4('0x19')]){_0x75287d['fileText']='';for(var _0x2ffca8=0x0;_0x2ffca8<_0x39022f[_0x14d4('0x17')]['transcripts'][_0x14d4('0x19')];_0x2ffca8++){_0x75287d[_0x14d4('0x12')]+=_0x39022f[_0x14d4('0x17')][_0x14d4('0x18')][_0x2ffca8]['transcript']+'';}}return _0x1f3b0b[_0x14d4('0x1a')](_0x75287d);})['then'](function(){logger['info'](util[_0x14d4('0x9')](_0x14d4('0x1b'),_0x1f3b0b['id']));if(!_0x1f3b0b[_0x14d4('0x1c')]){throw new db[(_0x14d4('0x1d'))]['ValidationError'](_0x14d4('0x1e'));}if(!_0x53babc['sentiment']||!_0x53babc[_0x14d4('0x1f')]||!_0x53babc[_0x14d4('0x20')]||!_0x53babc['language']||!_0x53babc[_0x14d4('0x21')]){throw new db[(_0x14d4('0x1d'))]['ValidationError'](_0x14d4('0x22'));}if(!_0x75287d[_0x14d4('0x12')]){throw new Error(_0x14d4('0x23'));}if(_0x53babc['sentimentAccountId']===_0x1b6d6b['id']){return _0x1b6d6b;}else{return db['CloudProvider'][_0x14d4('0x24')]({'where':{'id':_settings[_0x14d4('0x1f')]}});}})['then'](function(_0x136309){if(!_0x136309){throw new db['Sequelize'][(_0x14d4('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x136309[_0x14d4('0xc')]||!_0x136309[_0x14d4('0x26')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))](_0x14d4('0x27'));}_0xb92ef4=_0x136309;logger[_0x14d4('0x8')](util[_0x14d4('0x9')](_0x14d4('0x28'),_0x1f3b0b['id']));return sentiment(_0xb92ef4['data1'],_0xb92ef4[_0x14d4('0x26')],_0x53babc[_0x14d4('0x20')],_0x75287d[_0x14d4('0x12')],_0x53babc[_0x14d4('0x29')]);})[_0x14d4('0xe')](function(_0x3a47bd){logger['info'](util[_0x14d4('0x9')](_0x14d4('0x2a'),_0x1f3b0b['id']));return _0x1f3b0b[_0x14d4('0x1a')]({'sentiment':_0x3a47bd[_0x14d4('0x2b')],'sPositive':_0x3a47bd[_0x14d4('0x2c')][_0x14d4('0x2d')],'sNegative':_0x3a47bd[_0x14d4('0x2c')]['Negative'],'sMixed':_0x3a47bd[_0x14d4('0x2c')][_0x14d4('0x2e')],'sNeutral':_0x3a47bd[_0x14d4('0x2c')][_0x14d4('0x2f')]});})[_0x14d4('0xe')](function(){logger[_0x14d4('0x8')](util['format'](_0x14d4('0x1b'),_0x1f3b0b['id']));_0x1aec75();});case _0x14d4('0x30'):return _0x1f3b0b['update']({'transcribeStatus':_0x14d4('0x30'),'failureReason':_0x512c79[_0x14d4('0x10')][_0x14d4('0x31')]})['then'](function(){logger[_0x14d4('0x8')](util['format'](_0x14d4('0x1b'),_0x1f3b0b['id']));_0x1aec75();});default:logger[_0x14d4('0x8')](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1f3b0b['id']));break;}}else{return BPromise[_0x14d4('0x32')]()[_0x14d4('0xe')](function(){if(!_0x1f3b0b[_0x14d4('0x1c')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x53babc[_0x14d4('0x33')]||!_0x53babc[_0x14d4('0x1f')]||!_0x53babc[_0x14d4('0x20')]||!_0x53babc[_0x14d4('0x29')]||!_0x53babc[_0x14d4('0x21')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))](_0x14d4('0x22'));}if(!_0x1f3b0b[_0x14d4('0x12')]){throw new Error(_0x14d4('0x23'));}if(_0x53babc[_0x14d4('0x1f')]===_0x1b6d6b['id']){return _0x1b6d6b;}else{return db[_0x14d4('0x34')][_0x14d4('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x14d4('0xe')](function(_0x25bce6){if(!_0x25bce6){throw new db['Sequelize'][(_0x14d4('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x25bce6['data1']||!_0x25bce6[_0x14d4('0x26')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))]('Cloud\x20Provider\x20not\x20configured');}_0xb92ef4=_0x25bce6;logger[_0x14d4('0x8')](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1f3b0b['id']));return sentiment(_0xb92ef4[_0x14d4('0xc')],_0xb92ef4[_0x14d4('0x26')],_0x53babc[_0x14d4('0x20')],_0x1f3b0b[_0x14d4('0x12')],_0x53babc[_0x14d4('0x29')]);})['then'](function(_0x372275){logger['info'](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1f3b0b['id']));return _0x1f3b0b['update']({'sentiment':_0x372275[_0x14d4('0x2b')],'sPositive':_0x372275[_0x14d4('0x2c')][_0x14d4('0x2d')],'sNegative':_0x372275[_0x14d4('0x2c')][_0x14d4('0x35')],'sMixed':_0x372275['SentimentScore'][_0x14d4('0x2e')],'sNeutral':_0x372275[_0x14d4('0x2c')][_0x14d4('0x2f')],'transcribeStatus':_0x14d4('0x13')});})[_0x14d4('0xe')](function(){logger[_0x14d4('0x8')](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1f3b0b['id']));_0x1aec75();});}})[_0x14d4('0x36')](function(_0x5bef7d){if(_0x5bef7d){if(!_0x5bef7d[_0x14d4('0x37')]||_0x5bef7d[_0x14d4('0x37')]!==_0x14d4('0x38')){logger[_0x14d4('0x39')](util['format'](_0x14d4('0x3a'),_0x1f3b0b['id']),util[_0x14d4('0x3b')](_0x5bef7d,{'showHidden':![],'depth':null}));}}_0x1aec75();});});}function checkTranscribe(){var _0x3e9087;var _0x4acd72;var _0x586119;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0x14d4('0x3c')}})[_0x14d4('0xe')](function(_0x34d0d4){if(!_0x34d0d4||!_0x34d0d4['length']){throw new db['Sequelize'][(_0x14d4('0x25'))](_0x14d4('0x3d'));}_0x3e9087=_0x34d0d4;return db[_0x14d4('0x3e')][_0x14d4('0x24')]({'where':{'id':0x1}});})[_0x14d4('0xe')](function(_0x18fd50){if(!_0x18fd50){throw new db['Sequelize'][(_0x14d4('0x25'))]('Settings\x20not\x20available');}_0x4acd72=_0x18fd50;if(!_0x4acd72[_0x14d4('0x6')]||!_0x4acd72[_0x14d4('0x3f')]||!_0x4acd72[_0x14d4('0xd')]||!_0x4acd72[_0x14d4('0x29')]||!_0x4acd72[_0x14d4('0x21')]){throw new db['Sequelize'][(_0x14d4('0x25'))]('Transcribe\x20not\x20configured');}return db[_0x14d4('0x34')]['findOne']({'where':{'id':_0x4acd72[_0x14d4('0x3f')]}});})[_0x14d4('0xe')](function(_0x5b2c71){if(!_0x5b2c71){throw new db['Sequelize'][(_0x14d4('0x25'))](_0x14d4('0x40'));}if(!_0x5b2c71['data1']||!_0x5b2c71[_0x14d4('0x26')]){throw new db['Sequelize'][(_0x14d4('0x25'))](_0x14d4('0x27'));}_0x586119=_0x5b2c71;var _0x39086e=[];_0x3e9087['forEach'](function(_0x3ecd97){_0x39086e[_0x14d4('0x41')](checkTranscribeJob(_0x3ecd97,_0x4acd72,_0x586119));});return BPromise[_0x14d4('0x42')](_0x39086e);})[_0x14d4('0x36')](function(_0x128c2d){if(_0x128c2d){if(!_0x128c2d[_0x14d4('0x37')]||_0x128c2d[_0x14d4('0x37')]!==_0x14d4('0x38')){logger[_0x14d4('0x39')](util['inspect'](_0x128c2d,{'showHidden':![],'depth':null}));}}});}exports[_0x14d4('0x43')]=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 f990f93..c178c49 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 _0xa6d1=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','schedule','defaults','redis','socket.io-emitter','WhatsappInteraction','findAll','subtract','then','length'];(function(_0x9a29ea,_0x5b8b29){var _0x11f261=function(_0x397dea){while(--_0x397dea){_0x9a29ea['push'](_0x9a29ea['shift']());}};_0x11f261(++_0x5b8b29);}(_0xa6d1,0x1e1));var _0x1a6d=function(_0x1f864e,_0x332753){_0x1f864e=_0x1f864e-0x0;var _0x2370b2=_0xa6d1[_0x1f864e];return _0x2370b2;};'use strict';var _=require(_0x1a6d('0x0'));var moment=require(_0x1a6d('0x1'));var Redis=require(_0x1a6d('0x2'));var util=require(_0x1a6d('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x1a6d('0x4'));config['redis']=_[_0x1a6d('0x5')](config[_0x1a6d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1a6d('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x49b611=[];return db[_0x1a6d('0x8')][_0x1a6d('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1a6d('0xa')](0x18,'hours')}}})[_0x1a6d('0xb')](function(_0x3a43cf){if(_0x3a43cf&&_0x3a43cf[_0x1a6d('0xc')]){_0x49b611=_[_0x1a6d('0xd')](_0x3a43cf||[],'id');logger[_0x1a6d('0xe')](_0x1a6d('0xf'),_0x49b611[_0x1a6d('0x10')]());return db[_0x1a6d('0x8')][_0x1a6d('0x11')]({'closeReason':_0x1a6d('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x1a6d('0x13'))},{'where':{'id':_0x49b611}});}})[_0x1a6d('0xb')](function(){if(_0x49b611&&_0x49b611['length']){logger[_0x1a6d('0xe')](_0x1a6d('0x14'),_0x49b611[_0x1a6d('0x10')]());for(var _0x58a962=0x0;_0x58a962<_0x49b611['length'];_0x58a962++){io[_0x1a6d('0x15')](_0x1a6d('0x16'),{'id':_0x49b611[_0x58a962],'closed':!![]});}}})['catch'](function(_0x398f0c){logger[_0x1a6d('0x17')](_0x1a6d('0x18'),_0x398f0c?util['inspect'](_0x398f0c,{'showHidden':![],'depth':null}):'');});}exports[_0x1a6d('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7623=['hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','inspect','start','lodash','moment','ioredis','../../config/environment','../logger','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x7623,0x11e));var _0x3762=function(_0x23733d,_0x56f0a1){_0x23733d=_0x23733d-0x0;var _0x4a9cc4=_0x7623[_0x23733d];return _0x4a9cc4;};'use strict';var _=require(_0x3762('0x0'));var moment=require(_0x3762('0x1'));var Redis=require(_0x3762('0x2'));var util=require('util');var config=require(_0x3762('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x3762('0x4'))('schedule');config['redis']=_[_0x3762('0x5')](config[_0x3762('0x6')],{'host':_0x3762('0x7'),'port':0x18eb});var io=require(_0x3762('0x8'))(new Redis(config[_0x3762('0x6')]));function closeInteractions(){var _0x264cd2=[];return db[_0x3762('0x9')][_0x3762('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x3762('0xb'))}}})['then'](function(_0x5b2a62){if(_0x5b2a62&&_0x5b2a62[_0x3762('0xc')]){_0x264cd2=_['map'](_0x5b2a62||[],'id');logger[_0x3762('0xd')](_0x3762('0xe'),_0x264cd2['join']());return db[_0x3762('0x9')][_0x3762('0xf')]({'closeReason':_0x3762('0x10'),'disposition':_0x3762('0x11'),'closed':!![],'closedAt':moment()[_0x3762('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x264cd2}});}})[_0x3762('0x13')](function(){if(_0x264cd2&&_0x264cd2['length']){logger[_0x3762('0xd')](_0x3762('0x14'),_0x264cd2[_0x3762('0x15')]());for(var _0x2494f6=0x0;_0x2494f6<_0x264cd2[_0x3762('0xc')];_0x2494f6++){io[_0x3762('0x16')]('whatsappInteraction:update',{'id':_0x264cd2[_0x2494f6],'closed':!![]});}}})[_0x3762('0x17')](function(_0x1f632b){logger[_0x3762('0x18')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1f632b?util[_0x3762('0x19')](_0x1f632b,{'showHidden':![],'depth':null}):'');});}exports[_0x3762('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 10dea9c..7fb8078 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45aa=['finished\x20populating','contacts1','CmHopper','log','contacts2','hopper2','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now','@xcally.com','destroy','then','CmContact','bulkCreate'];(function(_0x2941f1,_0x5642cc){var _0x438996=function(_0x6da01d){while(--_0x6da01d){_0x2941f1['push'](_0x2941f1['shift']());}};_0x438996(++_0x5642cc);}(_0x45aa,0x138));var _0xa45a=function(_0x228b28,_0x2f7f93){_0x228b28=_0x228b28-0x0;var _0x24fb44=_0x45aa[_0x228b28];return _0x24fb44;};'use strict';var util=require(_0xa45a('0x0'));var db=require(_0xa45a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xa45a('0x2')+i,'lastName':_0xa45a('0x3')+i,'phone':0xf879fb460+i,'email':_0xa45a('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa45a('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xa45a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xa45a('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa45a('0x5')]({'id':i,'firstName':_0xa45a('0x2')+i,'lastName':_0xa45a('0x3')+i,'phone':0xf879fb460+i,'email':_0xa45a('0x4')+i+_0xa45a('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa45a('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xa45a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xa45a('0x6')]()});}db['CmContact'][_0xa45a('0x8')]({'where':{}})[_0xa45a('0x9')](function(){return db[_0xa45a('0xa')][_0xa45a('0xb')](contacts);})[_0xa45a('0x9')](function(){console['log'](_0xa45a('0xc'),_0xa45a('0xd'));return db[_0xa45a('0xe')][_0xa45a('0x8')]({'where':{}});})['then'](function(){return db[_0xa45a('0xe')][_0xa45a('0xb')](hopper);})[_0xa45a('0x9')](function(){console[_0xa45a('0xf')](_0xa45a('0xc'),'hopper1');return db['CmContact'][_0xa45a('0xb')](contacts2);})['then'](function(){console[_0xa45a('0xf')](_0xa45a('0xc'),_0xa45a('0x10'));return db[_0xa45a('0xe')][_0xa45a('0xb')](hopper2);})[_0xa45a('0x9')](function(){console[_0xa45a('0xf')](_0xa45a('0xc'),_0xa45a('0x11'));})['catch'](function(_0x4abb42){console[_0xa45a('0xf')](_0x4abb42);}); \ No newline at end of file +var _0xa7bc=['hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','then','CmContact','log','finished\x20populating','contacts1','CmHopper','bulkCreate','contacts2'];(function(_0x4f7a0d,_0x52af6b){var _0x11c586=function(_0x3dfe48){while(--_0x3dfe48){_0x4f7a0d['push'](_0x4f7a0d['shift']());}};_0x11c586(++_0x52af6b);}(_0xa7bc,0x18e));var _0xca7b=function(_0x1883d8,_0x1c3c87){_0x1883d8=_0x1883d8-0x0;var _0x55d856=_0xa7bc[_0x1883d8];return _0x55d856;};'use strict';var util=require(_0xca7b('0x0'));var db=require(_0xca7b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xca7b('0x2')]({'id':i,'firstName':_0xca7b('0x3')+i,'lastName':_0xca7b('0x4')+i,'phone':0xf879fb460+i,'email':_0xca7b('0x5')+i+_0xca7b('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xca7b('0x3')+i,'lastName':_0xca7b('0x4')+i,'phone':0xf879fb460+i,'email':_0xca7b('0x5')+i+_0xca7b('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xca7b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xca7b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xca7b('0x7')]()});}db['CmContact']['destroy']({'where':{}})[_0xca7b('0x8')](function(){return db[_0xca7b('0x9')]['bulkCreate'](contacts);})[_0xca7b('0x8')](function(){console[_0xca7b('0xa')](_0xca7b('0xb'),_0xca7b('0xc'));return db[_0xca7b('0xd')]['destroy']({'where':{}});})[_0xca7b('0x8')](function(){return db[_0xca7b('0xd')][_0xca7b('0xe')](hopper);})[_0xca7b('0x8')](function(){console[_0xca7b('0xa')](_0xca7b('0xb'),'hopper1');return db[_0xca7b('0x9')][_0xca7b('0xe')](contacts2);})['then'](function(){console[_0xca7b('0xa')]('finished\x20populating',_0xca7b('0xf'));return db[_0xca7b('0xd')][_0xca7b('0xe')](hopper2);})[_0xca7b('0x8')](function(){console['log'](_0xca7b('0xb'),_0xca7b('0x10'));})[_0xca7b('0x11')](function(_0x1e7121){console['log'](_0x1e7121);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index ac139df..0afb313 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacc0=['%s%s','agent','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format'];(function(_0x1860a8,_0x51cd65){var _0x242c01=function(_0x734a38){while(--_0x734a38){_0x1860a8['push'](_0x1860a8['shift']());}};_0x242c01(++_0x51cd65);}(_0xacc0,0xd8));var _0x0acc=function(_0x2e3f6d,_0x335cdb){_0x2e3f6d=_0x2e3f6d-0x0;var _0x156edd=_0xacc0[_0x2e3f6d];return _0x156edd;};'use strict';var util=require(_0x0acc('0x0'));var db=require(_0x0acc('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x0acc('0x2')]({'name':util[_0x0acc('0x3')](_0x0acc('0x4'),_0x0acc('0x5'),i),'fullname':util[_0x0acc('0x3')](_0x0acc('0x4'),_0x0acc('0x5'),i),'email':util['format'](_0x0acc('0x6'),_0x0acc('0x5'),i),'role':_0x0acc('0x5'),'password':'password','internal':0xfa0+i,'type':_0x0acc('0x7'),'transport':[_0x0acc('0x8'),'ws',_0x0acc('0x9')],'disallow':[_0x0acc('0xa')],'allow':[_0x0acc('0xb')],'defaultuser':util[_0x0acc('0x3')](_0x0acc('0x4'),'agent',i),'encryption':_0x0acc('0xc'),'avpf':_0x0acc('0xc'),'force_avp':_0x0acc('0xc'),'icesupport':_0x0acc('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x0acc('0xd'),'dtlssetup':_0x0acc('0xe'),'callerid':util[_0x0acc('0x3')](_0x0acc('0xf'),util[_0x0acc('0x3')](_0x0acc('0x4'),_0x0acc('0x5'),i),0xfa0+i)});}db[_0x0acc('0x10')][_0x0acc('0x11')](users)[_0x0acc('0x12')](function(){console[_0x0acc('0x13')](_0x0acc('0x14'));})[_0x0acc('0x15')](function(_0x24f186){console[_0x0acc('0x13')](_0x24f186);}); \ No newline at end of file +var _0xde65=['User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x1249b4,_0x5cb242){var _0xe6122d=function(_0x35b58d){while(--_0x35b58d){_0x1249b4['push'](_0x1249b4['shift']());}};_0xe6122d(++_0x5cb242);}(_0xde65,0x116));var _0x5de6=function(_0x54a54a,_0x5eae31){_0x54a54a=_0x54a54a-0x0;var _0x4aeb04=_0xde65[_0x54a54a];return _0x4aeb04;};'use strict';var util=require(_0x5de6('0x0'));var db=require(_0x5de6('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5de6('0x2')]({'name':util[_0x5de6('0x3')](_0x5de6('0x4'),_0x5de6('0x5'),i),'fullname':util[_0x5de6('0x3')](_0x5de6('0x4'),_0x5de6('0x5'),i),'email':util[_0x5de6('0x3')](_0x5de6('0x6'),_0x5de6('0x5'),i),'role':_0x5de6('0x5'),'password':'password','internal':0xfa0+i,'type':_0x5de6('0x7'),'transport':[_0x5de6('0x8'),'ws',_0x5de6('0x9')],'disallow':['all'],'allow':[_0x5de6('0xa')],'defaultuser':util['format'](_0x5de6('0x4'),_0x5de6('0x5'),i),'encryption':_0x5de6('0xb'),'avpf':_0x5de6('0xb'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x5de6('0xb'),'dtlsverify':'no','dtlscertfile':_0x5de6('0xc'),'dtlsprivatekey':_0x5de6('0xd'),'dtlssetup':_0x5de6('0xe'),'callerid':util[_0x5de6('0x3')](_0x5de6('0xf'),util[_0x5de6('0x3')](_0x5de6('0x4'),_0x5de6('0x5'),i),0xfa0+i)});}db[_0x5de6('0x10')][_0x5de6('0x11')](users)['then'](function(){console[_0x5de6('0x12')](_0x5de6('0x13'));})[_0x5de6('0x14')](function(_0x12e20c){console[_0x5de6('0x12')](_0x12e20c);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 7054f9c..9b1c26c 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99e7=['whatsapp','telephone:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','default','address','request','connection','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','role','telephone','Campaign','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','ChatQueue','WhatsappQueues','Trunk','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel'];(function(_0x28bdf9,_0x505f16){var _0x3166f1=function(_0x583b37){while(--_0x583b37){_0x28bdf9['push'](_0x28bdf9['shift']());}};_0x3166f1(++_0x505f16);}(_0x99e7,0x1b5));var _0x799e=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0x99e7[_0x148879];return _0x4f7027;};'use strict';var _=require(_0x799e('0x0'));var util=require(_0x799e('0x1'));var BPromise=require(_0x799e('0x2'));var db=require(_0x799e('0x3'))['db'];var config=require(_0x799e('0x4'));var queryQueues={'attributes':['id',_0x799e('0x5')],'include':[{'as':_0x799e('0x6'),'model':db[_0x799e('0x7')],'attributes':['id',_0x799e('0x5'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x799e('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x799e('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x799e('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x799e('0x5'),_0x799e('0x9')],'where':{'type':_0x799e('0xa')}};function getAssociatedResources(_0xfc769f,_0x536a50,_0x21df07){return db[_0x799e('0xb')][_0x799e('0xc')]({'where':{'name':_0xfc769f,'userProfileId':_0x536a50},'raw':!![]})[_0x799e('0xd')](function(_0x5cf95e){if(_0x5cf95e){if(_0x5cf95e[_0x799e('0xe')]){switch(_0xfc769f){case _0x799e('0xf'):case _0x799e('0x10'):case _0x799e('0x11'):case _0x799e('0x12'):case _0x799e('0x13'):case _0x799e('0x14'):case'WhatsappQueues':return db[_0x21df07][_0x799e('0x15')](queryQueues);case _0x799e('0x16'):return db[_0x21df07][_0x799e('0x15')](queryTelephones);case _0x799e('0x17'):return db[_0x21df07][_0x799e('0x15')](queryTrunks);case _0x799e('0x18'):return db[_0x21df07][_0x799e('0x15')](queryCampaigns);}}else{return db[_0x799e('0x19')][_0x799e('0x15')]({'attributes':[_0x799e('0x1a')],'where':{'sectionId':_0x5cf95e['id']},'raw':!![]})['then'](function(_0x5299a8){if(_0x5299a8){var _0x4267bc={'where':{'id':_[_0x799e('0x1b')](_0x5299a8,_0x799e('0x1a'))},'raw':!![]};switch(_0x21df07){case'User':_0x4267bc[_0x799e('0x1c')][_0x799e('0x1d')]=_0x799e('0x1e');break;case _0x799e('0x1f'):_0x4267bc[_0x799e('0x1c')]['type']=_0x799e('0xa');break;}return db[_0x21df07][_0x799e('0x15')](_0x4267bc);}else{return[];}});}}else{return[];}})[_0x799e('0xd')](function(_0x115bb8){return _0x115bb8;});}function joinOrLeaveQueues(_0x4c41b8,_0x2c311d,_0x4c5500,_0x1b1478){_0x4c41b8[_0x2c311d](util[_0x799e('0x20')](_0x799e('0x21'),_0x4c5500,_0x1b1478[_0x799e('0x5')]));if(_0x1b1478[_0x799e('0x6')]){for(var _0x1b3b79=0x0;_0x1b3b79<_0x1b1478[_0x799e('0x6')][_0x799e('0x22')];_0x1b3b79+=0x1){_0x4c41b8[_0x2c311d](util[_0x799e('0x20')](_0x799e('0x23'),_0x1b1478[_0x799e('0x6')][_0x1b3b79][_0x799e('0x5')]));}}}function joinOrLeave(_0x3ae4aa,_0x5739e2,_0x2c9820){var _0x44b3ad;if(_0x3ae4aa[_0x799e('0x24')]['query']['id']){db['User'][_0x799e('0x25')]({'attributes':['id',_0x799e('0x5'),_0x799e('0x1d'),_0x799e('0x26')],'where':{'id':_0x3ae4aa[_0x799e('0x24')][_0x799e('0x27')]['id']},'include':[{'model':db[_0x799e('0x28')],'as':_0x799e('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x799e('0x2a')],'as':_0x799e('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x799e('0x2c')],'as':_0x799e('0x2d'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x799e('0x2e'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x799e('0x2f'),'attributes':['id'],'raw':!![]},{'model':db[_0x799e('0x30')],'as':_0x799e('0x31'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x392c39){if(_0x392c39){_0x44b3ad=_0x392c39;_0x3ae4aa[_0x5739e2](util[_0x799e('0x20')](_0x799e('0x23'),_0x392c39[_0x799e('0x5')]));var _0xa3c7c6=[];switch(_0x392c39[_0x799e('0x1d')]){case _0x799e('0x32'):_0x3ae4aa[_0x5739e2](_0x799e('0x33'));_0x3ae4aa[_0x5739e2](_0x799e('0x34'));if(queryQueues[_0x799e('0x35')](_0x799e('0x36'))){delete queryQueues[_0x799e('0x36')];}_0xa3c7c6[_0x799e('0x37')](db[_0x799e('0x38')][_0x799e('0x15')](queryQueues));_0xa3c7c6[_0x799e('0x37')](db['ChatQueue'][_0x799e('0x15')](queryQueues));_0xa3c7c6[_0x799e('0x37')](db[_0x799e('0x39')][_0x799e('0x15')](queryQueues));_0xa3c7c6[_0x799e('0x37')](db[_0x799e('0x3a')][_0x799e('0x15')](queryQueues));_0xa3c7c6[_0x799e('0x37')](db[_0x799e('0x3b')][_0x799e('0x15')](queryQueues));_0xa3c7c6['push'](db[_0x799e('0x3c')]['findAll'](queryQueues));_0xa3c7c6[_0x799e('0x37')](db[_0x799e('0x3d')][_0x799e('0x15')](queryQueues));_0xa3c7c6['push'](db[_0x799e('0x7')]['findAll'](queryTelephones));_0xa3c7c6[_0x799e('0x37')](db['Trunk'][_0x799e('0x15')](queryTrunks));_0xa3c7c6['push'](db[_0x799e('0x1f')][_0x799e('0x15')](queryCampaigns));_0xa3c7c6[_0x799e('0x37')](db[_0x799e('0x7')]['findAll'](queryAgents));break;case _0x799e('0x3e'):_0x3ae4aa[_0x5739e2](_0x799e('0x33'));_0x3ae4aa[_0x5739e2](_0x799e('0x34'));_0xa3c7c6[_0x799e('0x37')](getAssociatedResources('VoiceQueues',_0x392c39[_0x799e('0x26')],'VoiceQueue'));_0xa3c7c6['push'](getAssociatedResources(_0x799e('0x10'),_0x392c39[_0x799e('0x26')],_0x799e('0x3f')));_0xa3c7c6[_0x799e('0x37')](getAssociatedResources(_0x799e('0x11'),_0x392c39[_0x799e('0x26')],_0x799e('0x39')));_0xa3c7c6[_0x799e('0x37')](getAssociatedResources('SmsQueues',_0x392c39[_0x799e('0x26')],_0x799e('0x3a')));_0xa3c7c6[_0x799e('0x37')](getAssociatedResources(_0x799e('0x13'),_0x392c39['userProfileId'],_0x799e('0x3b')));_0xa3c7c6['push'](getAssociatedResources('OpenchannelQueues',_0x392c39[_0x799e('0x26')],'OpenchannelQueue'));_0xa3c7c6['push'](getAssociatedResources(_0x799e('0x40'),_0x392c39['userProfileId'],_0x799e('0x3d')));_0xa3c7c6[_0x799e('0x37')](getAssociatedResources(_0x799e('0x16'),_0x392c39['userProfileId'],'User'));_0xa3c7c6['push'](getAssociatedResources(_0x799e('0x17'),_0x392c39[_0x799e('0x26')],_0x799e('0x41')));_0xa3c7c6[_0x799e('0x37')](getAssociatedResources(_0x799e('0x18'),_0x392c39[_0x799e('0x26')],_0x799e('0x1f')));_0xa3c7c6[_0x799e('0x37')](db[_0x799e('0x7')][_0x799e('0x15')](queryAgents));break;case _0x799e('0x8'):_0x3ae4aa[_0x5739e2](_0x799e('0x33'));_0x3ae4aa[_0x5739e2]('voice:outbound');_0xa3c7c6['push'](_0x392c39['getVoiceQueues']({'attributes':['id',_0x799e('0x5')]}));_0xa3c7c6['push'](_0x392c39[_0x799e('0x42')]({'attributes':['id','name']}));_0xa3c7c6['push'](_0x392c39[_0x799e('0x43')]({'attributes':['id',_0x799e('0x5')]}));_0xa3c7c6[_0x799e('0x37')](_0x392c39[_0x799e('0x44')]({'attributes':['id',_0x799e('0x5')]}));_0xa3c7c6[_0x799e('0x37')](_0x392c39[_0x799e('0x45')]({'attributes':['id',_0x799e('0x5')]}));_0xa3c7c6['push'](_0x392c39[_0x799e('0x46')]({'attributes':['id',_0x799e('0x5')]}));_0xa3c7c6[_0x799e('0x37')](_0x392c39[_0x799e('0x47')]({'attributes':['id',_0x799e('0x5')]}));break;}return BPromise[_0x799e('0x48')](_0xa3c7c6);}})[_0x799e('0xd')](function(_0x4f953b){if(_0x4f953b&&_0x4f953b[_0x799e('0x22')]){for(var _0x565dcb=0x0;_0x565dcb<_0x4f953b[_0x799e('0x22')];_0x565dcb+=0x1){for(var _0x29da15=0x0;_0x29da15<_0x4f953b[_0x565dcb][_0x799e('0x22')];_0x29da15+=0x1){switch(_0x565dcb){case 0x0:joinOrLeaveQueues(_0x3ae4aa,_0x5739e2,_0x799e('0x49'),_0x4f953b[_0x565dcb][_0x29da15]);break;case 0x1:joinOrLeaveQueues(_0x3ae4aa,_0x5739e2,_0x799e('0x4a'),_0x4f953b[_0x565dcb][_0x29da15]);break;case 0x2:joinOrLeaveQueues(_0x3ae4aa,_0x5739e2,_0x799e('0x4b'),_0x4f953b[_0x565dcb][_0x29da15]);break;case 0x3:joinOrLeaveQueues(_0x3ae4aa,_0x5739e2,'sms',_0x4f953b[_0x565dcb][_0x29da15]);break;case 0x4:joinOrLeaveQueues(_0x3ae4aa,_0x5739e2,_0x799e('0x4c'),_0x4f953b[_0x565dcb][_0x29da15]);break;case 0x5:joinOrLeaveQueues(_0x3ae4aa,_0x5739e2,_0x799e('0x4d'),_0x4f953b[_0x565dcb][_0x29da15]);break;case 0x6:joinOrLeaveQueues(_0x3ae4aa,_0x5739e2,_0x799e('0x4e'),_0x4f953b[_0x565dcb][_0x29da15]);break;case 0x7:if(_0x44b3ad['role']!=='agent')_0x3ae4aa[_0x5739e2](util[_0x799e('0x20')](_0x799e('0x4f'),_0x4f953b[_0x565dcb][_0x29da15]['name']));break;case 0x8:if(_0x44b3ad[_0x799e('0x1d')]!==_0x799e('0x8'))_0x3ae4aa[_0x5739e2](util[_0x799e('0x20')]('trunk:%s',_0x4f953b[_0x565dcb][_0x29da15]['name']));break;case 0x9:if(_0x44b3ad['role']!==_0x799e('0x8'))_0x3ae4aa[_0x5739e2](util[_0x799e('0x20')](_0x799e('0x50'),_0x4f953b[_0x565dcb][_0x29da15]['type'],_0x4f953b[_0x565dcb][_0x29da15]['name']));break;case 0xa:_0x3ae4aa[_0x5739e2](util[_0x799e('0x20')]('user:%s',_0x4f953b[_0x565dcb][_0x29da15][_0x799e('0x5')]));break;}}}}})[_0x799e('0xd')](function(){if(_0x5739e2===_0x799e('0x51')){var _0x12be45=_['map'](_0x44b3ad[_0x799e('0x29')],'id');return _0x44b3ad['removeChatInteractions'](_0x12be45)['then'](function(){for(var _0x17a3c0=0x0;_0x17a3c0<_0x12be45['length'];_0x17a3c0+=0x1){_0x2c9820[_0x799e('0x52')](_0x799e('0x53'),{'ChatInteractionId':Number(_0x12be45[_0x17a3c0]),'UserId':Number(_0x44b3ad['id'])});}});}})['then'](function(){if(_0x5739e2==='leave'){var _0x41496d=_[_0x799e('0x1b')](_0x44b3ad[_0x799e('0x2b')],'id');return _0x44b3ad[_0x799e('0x54')](_0x41496d)[_0x799e('0xd')](function(){for(var _0x289823=0x0;_0x289823<_0x41496d['length'];_0x289823+=0x1){_0x2c9820[_0x799e('0x52')](_0x799e('0x55'),{'MailInteractionId':Number(_0x41496d[_0x289823]),'UserId':Number(_0x44b3ad['id'])});}});}})['then'](function(){if(_0x5739e2===_0x799e('0x51')){var _0x5151a7=_[_0x799e('0x1b')](_0x44b3ad[_0x799e('0x2d')],'id');return _0x44b3ad['removeFaxInteractions'](_0x5151a7)[_0x799e('0xd')](function(){for(var _0x1a77a0=0x0;_0x1a77a0<_0x5151a7[_0x799e('0x22')];_0x1a77a0+=0x1){_0x2c9820[_0x799e('0x52')](_0x799e('0x56'),{'FaxInteractionId':Number(_0x5151a7[_0x1a77a0]),'UserId':Number(_0x44b3ad['id'])});}});}})[_0x799e('0xd')](function(){if(_0x5739e2===_0x799e('0x51')){var _0x88fba=_[_0x799e('0x1b')](_0x44b3ad[_0x799e('0x2e')],'id');return _0x44b3ad[_0x799e('0x57')](_0x88fba)[_0x799e('0xd')](function(){for(var _0x2857f6=0x0;_0x2857f6<_0x88fba[_0x799e('0x22')];_0x2857f6+=0x1){_0x2c9820['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x88fba[_0x2857f6]),'UserId':Number(_0x44b3ad['id'])});}});}})[_0x799e('0xd')](function(){if(_0x5739e2===_0x799e('0x51')){var _0x2ca0fe=_[_0x799e('0x1b')](_0x44b3ad['OpenchannelInteractions'],'id');return _0x44b3ad[_0x799e('0x58')](_0x2ca0fe)[_0x799e('0xd')](function(){for(var _0x48c8df=0x0;_0x48c8df<_0x2ca0fe[_0x799e('0x22')];_0x48c8df+=0x1){_0x2c9820['emit'](_0x799e('0x59'),{'OpenchannelInteractionId':Number(_0x2ca0fe[_0x48c8df]),'UserId':Number(_0x44b3ad['id'])});}});}})[_0x799e('0xd')](function(){if(_0x5739e2===_0x799e('0x51')){var _0x5dee44=_[_0x799e('0x1b')](_0x44b3ad[_0x799e('0x31')],'id');return _0x44b3ad[_0x799e('0x5a')](_0x5dee44)[_0x799e('0xd')](function(){for(var _0x434e83=0x0;_0x434e83<_0x5dee44[_0x799e('0x22')];_0x434e83+=0x1){_0x2c9820[_0x799e('0x52')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x5dee44[_0x434e83]),'UserId':Number(_0x44b3ad['id'])});}});}})[_0x799e('0x5b')](function(_0x5e3e27){_0x3ae4aa['log'](_0x5e3e27);});}}function onDisconnect(_0x3e03a8,_0x2be7c0){joinOrLeave(_0x3e03a8,_0x799e('0x51'),_0x2be7c0);}function onConnect(_0x1b394c){joinOrLeave(_0x1b394c,'join');}exports[_0x799e('0x5c')]=function(_0x4ebdd8){_0x4ebdd8['on']('connection',function(_0x8e5e03){_0x8e5e03['setMaxListeners'](0x0);_0x8e5e03[_0x799e('0x5d')]=_0x8e5e03[_0x799e('0x5e')][_0x799e('0x5f')]['remoteAddress']+':'+_0x8e5e03['request'][_0x799e('0x5f')]['remotePort'];_0x8e5e03[_0x799e('0x60')]=new Date();_0x8e5e03[_0x799e('0x61')]=function(_0x47b974){console['log'](_0x799e('0x62')+_0x8e5e03[_0x799e('0x63')][_0x799e('0x5')]+'['+_0x8e5e03[_0x799e('0x5d')]+']',_0x47b974);};_0x8e5e03['on'](_0x799e('0x64'),function(){onDisconnect(_0x8e5e03,_0x4ebdd8);_0x8e5e03['log'](_0x799e('0x65'));});onConnect(_0x8e5e03);_0x8e5e03[_0x799e('0x61')](_0x799e('0x66'));});}; \ No newline at end of file +var _0xdfb1=['userProfileId','MailQueue','Trunks','Trunk','getVoiceQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','sms','mail','whatsapp','agent','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','catch','log','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','resourceId','then','map','where','role','format','length','user:%s','handshake','query','find','ChatInteraction','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Campaign','user','voice:outbound'];(function(_0x22828c,_0x3a66b0){var _0x25b4dd=function(_0xda31b){while(--_0xda31b){_0x22828c['push'](_0x22828c['shift']());}};_0x25b4dd(++_0x3a66b0);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x32014b,_0x261e8b){_0x32014b=_0x32014b-0x0;var _0x488881=_0xdfb1[_0x32014b];return _0x488881;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var BPromise=require(_0x1dfb('0x2'));var db=require(_0x1dfb('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x1dfb('0x4')],'include':[{'as':_0x1dfb('0x5'),'model':db[_0x1dfb('0x6')],'attributes':['id',_0x1dfb('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1dfb('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1dfb('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x1dfb('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1dfb('0x4'),_0x1dfb('0x8')],'where':{'type':_0x1dfb('0x9')}};function getAssociatedResources(_0x190198,_0x5a14dd,_0x24d8b9){return db[_0x1dfb('0xa')][_0x1dfb('0xb')]({'where':{'name':_0x190198,'userProfileId':_0x5a14dd},'raw':!![]})['then'](function(_0xd747ac){if(_0xd747ac){if(_0xd747ac[_0x1dfb('0xc')]){switch(_0x190198){case _0x1dfb('0xd'):case _0x1dfb('0xe'):case _0x1dfb('0xf'):case _0x1dfb('0x10'):case _0x1dfb('0x11'):case _0x1dfb('0x12'):case _0x1dfb('0x13'):return db[_0x24d8b9]['findAll'](queryQueues);case _0x1dfb('0x14'):return db[_0x24d8b9][_0x1dfb('0x15')](queryTelephones);case'Trunks':return db[_0x24d8b9][_0x1dfb('0x15')](queryTrunks);case _0x1dfb('0x16'):return db[_0x24d8b9][_0x1dfb('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0x1dfb('0x15')]({'attributes':[_0x1dfb('0x17')],'where':{'sectionId':_0xd747ac['id']},'raw':!![]})[_0x1dfb('0x18')](function(_0x5ccfcc){if(_0x5ccfcc){var _0xdaf261={'where':{'id':_[_0x1dfb('0x19')](_0x5ccfcc,_0x1dfb('0x17'))},'raw':!![]};switch(_0x24d8b9){case'User':_0xdaf261[_0x1dfb('0x1a')][_0x1dfb('0x1b')]=_0x1dfb('0x7');break;case'Campaign':_0xdaf261['where'][_0x1dfb('0x8')]=_0x1dfb('0x9');break;}return db[_0x24d8b9][_0x1dfb('0x15')](_0xdaf261);}else{return[];}});}}else{return[];}})[_0x1dfb('0x18')](function(_0x50f2ec){return _0x50f2ec;});}function joinOrLeaveQueues(_0x2305e2,_0x33f6e5,_0x2842e7,_0x358465){_0x2305e2[_0x33f6e5](util[_0x1dfb('0x1c')]('%s:queue:%s',_0x2842e7,_0x358465[_0x1dfb('0x4')]));if(_0x358465['Agents']){for(var _0x54cd15=0x0;_0x54cd15<_0x358465['Agents'][_0x1dfb('0x1d')];_0x54cd15+=0x1){_0x2305e2[_0x33f6e5](util[_0x1dfb('0x1c')](_0x1dfb('0x1e'),_0x358465['Agents'][_0x54cd15]['name']));}}}function joinOrLeave(_0x5de3c9,_0x2c9a0c,_0x1ceaab){var _0x1cf4cd;if(_0x5de3c9[_0x1dfb('0x1f')][_0x1dfb('0x20')]['id']){db[_0x1dfb('0x6')][_0x1dfb('0x21')]({'attributes':['id',_0x1dfb('0x4'),_0x1dfb('0x1b'),'userProfileId'],'where':{'id':_0x5de3c9['handshake'][_0x1dfb('0x20')]['id']},'include':[{'model':db[_0x1dfb('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1dfb('0x23')],'as':_0x1dfb('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x1dfb('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1dfb('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1dfb('0x27')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x1dfb('0x18')](function(_0x417f71){if(_0x417f71){_0x1cf4cd=_0x417f71;_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')]('user:%s',_0x417f71[_0x1dfb('0x4')]));var _0x82339a=[];switch(_0x417f71[_0x1dfb('0x1b')]){case _0x1dfb('0x28'):_0x5de3c9[_0x2c9a0c](_0x1dfb('0x29'));_0x5de3c9[_0x2c9a0c]('voice:outbound');if(queryQueues[_0x1dfb('0x2a')](_0x1dfb('0x2b'))){delete queryQueues['include'];}_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2d')]['findAll'](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2e')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2f')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x30')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db['MailQueue'][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x31')]['findAll'](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x32')][_0x1dfb('0x15')](queryQueues));_0x82339a['push'](db['User'][_0x1dfb('0x15')](queryTelephones));_0x82339a[_0x1dfb('0x2c')](db['Trunk'][_0x1dfb('0x15')](queryTrunks));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x33')]['findAll'](queryCampaigns));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x6')][_0x1dfb('0x15')](queryAgents));break;case _0x1dfb('0x34'):_0x5de3c9[_0x2c9a0c]('voice:inbound');_0x5de3c9[_0x2c9a0c](_0x1dfb('0x35'));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('VoiceQueues',_0x417f71['userProfileId'],_0x1dfb('0x2d')));_0x82339a['push'](getAssociatedResources(_0x1dfb('0xe'),_0x417f71['userProfileId'],'ChatQueue'));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0xf'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x2f')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('SmsQueues',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x30')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x11'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x37')));_0x82339a['push'](getAssociatedResources('OpenchannelQueues',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x31')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('WhatsappQueues',_0x417f71['userProfileId'],_0x1dfb('0x32')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('Telephones',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x6')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x38'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x39')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x16'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x33')));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x6')]['findAll'](queryAgents));break;case'agent':_0x5de3c9[_0x2c9a0c](_0x1dfb('0x29'));_0x5de3c9[_0x2c9a0c]('voice:outbound');_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3a')]({'attributes':['id','name']}));_0x82339a[_0x1dfb('0x2c')](_0x417f71['getChatQueues']({'attributes':['id','name']}));_0x82339a['push'](_0x417f71[_0x1dfb('0x3b')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71['getSmsQueues']({'attributes':['id','name']}));_0x82339a['push'](_0x417f71[_0x1dfb('0x3c')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3d')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3e')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x82339a);}})[_0x1dfb('0x18')](function(_0x26710a){if(_0x26710a&&_0x26710a[_0x1dfb('0x1d')]){for(var _0x56de99=0x0;_0x56de99<_0x26710a[_0x1dfb('0x1d')];_0x56de99+=0x1){for(var _0x2ff784=0x0;_0x2ff784<_0x26710a[_0x56de99][_0x1dfb('0x1d')];_0x2ff784+=0x1){switch(_0x56de99){case 0x0:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x3f'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x1:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x40'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x2:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,'fax',_0x26710a[_0x56de99][_0x2ff784]);break;case 0x3:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x41'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x4:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x42'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x5:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,'openchannel',_0x26710a[_0x56de99][_0x2ff784]);break;case 0x6:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x43'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x7:if(_0x1cf4cd[_0x1dfb('0x1b')]!=='agent')_0x5de3c9[_0x2c9a0c](util['format']('telephone:%s',_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x4')]));break;case 0x8:if(_0x1cf4cd[_0x1dfb('0x1b')]!==_0x1dfb('0x44'))_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x45'),_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x4')]));break;case 0x9:if(_0x1cf4cd[_0x1dfb('0x1b')]!=='agent')_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x46'),_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x8')],_0x26710a[_0x56de99][_0x2ff784]['name']));break;case 0xa:_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x1e'),_0x26710a[_0x56de99][_0x2ff784]['name']));break;}}}}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x3de05f=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x48')],'id');return _0x1cf4cd[_0x1dfb('0x49')](_0x3de05f)[_0x1dfb('0x18')](function(){for(var _0x325ef8=0x0;_0x325ef8<_0x3de05f[_0x1dfb('0x1d')];_0x325ef8+=0x1){_0x1ceaab['emit'](_0x1dfb('0x4a'),{'ChatInteractionId':Number(_0x3de05f[_0x325ef8]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x556de4=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x4b')],'id');return _0x1cf4cd[_0x1dfb('0x4c')](_0x556de4)[_0x1dfb('0x18')](function(){for(var _0x25e455=0x0;_0x25e455<_0x556de4['length'];_0x25e455+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x556de4[_0x25e455]),'UserId':Number(_0x1cf4cd['id'])});}});}})['then'](function(){if(_0x2c9a0c==='leave'){var _0x51ee9c=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x24')],'id');return _0x1cf4cd[_0x1dfb('0x4e')](_0x51ee9c)[_0x1dfb('0x18')](function(){for(var _0x1ee0cf=0x0;_0x1ee0cf<_0x51ee9c[_0x1dfb('0x1d')];_0x1ee0cf+=0x1){_0x1ceaab[_0x1dfb('0x4d')](_0x1dfb('0x4f'),{'FaxInteractionId':Number(_0x51ee9c[_0x1ee0cf]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x41cb03=_['map'](_0x1cf4cd[_0x1dfb('0x25')],'id');return _0x1cf4cd[_0x1dfb('0x50')](_0x41cb03)['then'](function(){for(var _0x3c7e8d=0x0;_0x3c7e8d<_0x41cb03[_0x1dfb('0x1d')];_0x3c7e8d+=0x1){_0x1ceaab[_0x1dfb('0x4d')](_0x1dfb('0x51'),{'SmsInteractionId':Number(_0x41cb03[_0x3c7e8d]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x54d8fe=_['map'](_0x1cf4cd[_0x1dfb('0x26')],'id');return _0x1cf4cd[_0x1dfb('0x52')](_0x54d8fe)['then'](function(){for(var _0x530ba9=0x0;_0x530ba9<_0x54d8fe['length'];_0x530ba9+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x54d8fe[_0x530ba9]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0xef7a1=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x53')],'id');return _0x1cf4cd[_0x1dfb('0x54')](_0xef7a1)[_0x1dfb('0x18')](function(){for(var _0xfdf97c=0x0;_0xfdf97c<_0xef7a1['length'];_0xfdf97c+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xef7a1[_0xfdf97c]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x55')](function(_0x123e5e){_0x5de3c9[_0x1dfb('0x56')](_0x123e5e);});}}function onDisconnect(_0x47c899,_0x545f5b){joinOrLeave(_0x47c899,_0x1dfb('0x47'),_0x545f5b);}function onConnect(_0xabb993){joinOrLeave(_0xabb993,'join');}exports[_0x1dfb('0x57')]=function(_0x19795d){_0x19795d['on'](_0x1dfb('0x58'),function(_0x8eaf81){_0x8eaf81[_0x1dfb('0x59')](0x0);_0x8eaf81[_0x1dfb('0x5a')]=_0x8eaf81[_0x1dfb('0x5b')][_0x1dfb('0x58')]['remoteAddress']+':'+_0x8eaf81[_0x1dfb('0x5b')][_0x1dfb('0x58')][_0x1dfb('0x5c')];_0x8eaf81[_0x1dfb('0x5d')]=new Date();_0x8eaf81['log']=function(_0x17c15a){console[_0x1dfb('0x56')](_0x1dfb('0x5e')+_0x8eaf81[_0x1dfb('0x5f')][_0x1dfb('0x4')]+'['+_0x8eaf81[_0x1dfb('0x5a')]+']',_0x17c15a);};_0x8eaf81['on']('disconnect',function(){onDisconnect(_0x8eaf81,_0x19795d);_0x8eaf81[_0x1dfb('0x56')]('DISCONNECTED');});onConnect(_0x8eaf81);_0x8eaf81[_0x1dfb('0x56')](_0x1dfb('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 72f8567..a82f571 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 _0x2853=['default','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','http','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','newmessage','ChatOfflineMessage','SmsInteraction','Sms','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','error','catch','Trigger,\x20%s','get','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','contact','UserId','interface','SIP/%s','agent','outgoingmessage','channel','SELECT','AfterCreate','changed','closed','substatus','format','name','AfterUpdate','User','find','fullname','email','internal'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0x2853,0x92));var _0x3285=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x2853[_0x92c450];return _0x2a9599;};'use strict';var util=require(_0x3285('0x0'));var db=require(_0x3285('0x1'))['db'];var jayson=require(_0x3285('0x2'));var logger=require('../logger')('triggers');var client=jayson['client'][_0x3285('0x3')]({'port':0x232a});var triggers=[{'channel':_0x3285('0x4'),'model':_0x3285('0x5'),'event':_0x3285('0x6'),'condition':_0x3285('0x7'),'callback':afterCreate},{'channel':'Chat','model':_0x3285('0x5'),'event':'afterUpdate','condition':_0x3285('0x8'),'callback':afterUpdate},{'channel':_0x3285('0x4'),'model':'ChatMessage','event':'afterCreate','condition':_0x3285('0x9'),'callback':afterCreateMessage},{'channel':_0x3285('0x4'),'model':_0x3285('0xa'),'event':_0x3285('0x6'),'condition':_0x3285('0x9'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x3285('0xb'),'event':_0x3285('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x3285('0xc'),'model':_0x3285('0xb'),'event':_0x3285('0xd'),'condition':_0x3285('0x8'),'callback':afterUpdate},{'channel':_0x3285('0xc'),'model':_0x3285('0xe'),'event':_0x3285('0x6'),'condition':_0x3285('0x9'),'callback':afterCreateMessage},{'channel':_0x3285('0xf'),'model':_0x3285('0x10'),'event':_0x3285('0x6'),'condition':_0x3285('0x7'),'callback':afterCreate},{'channel':_0x3285('0xf'),'model':'WhatsappInteraction','event':_0x3285('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x3285('0xf'),'model':_0x3285('0x11'),'event':_0x3285('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x3285('0x12'),'event':_0x3285('0x6'),'condition':_0x3285('0x7'),'callback':afterCreate},{'channel':_0x3285('0x13'),'model':_0x3285('0x12'),'event':'afterUpdate','condition':_0x3285('0x8'),'callback':afterUpdate},{'channel':_0x3285('0x13'),'model':'FaxMessage','event':_0x3285('0x6'),'condition':_0x3285('0x9'),'callback':afterCreateMessage},{'channel':_0x3285('0x14'),'model':_0x3285('0x15'),'event':_0x3285('0x6'),'condition':_0x3285('0x7'),'callback':afterCreate},{'channel':_0x3285('0x14'),'model':_0x3285('0x15'),'event':_0x3285('0xd'),'condition':_0x3285('0x8'),'callback':afterUpdate},{'channel':_0x3285('0x14'),'model':_0x3285('0x16'),'event':'afterCreate','condition':_0x3285('0x9'),'callback':afterCreateMessage},{'channel':_0x3285('0x17'),'model':_0x3285('0x18'),'event':'afterCreate','condition':_0x3285('0x7'),'callback':afterCreate},{'channel':_0x3285('0x17'),'model':_0x3285('0x18'),'event':_0x3285('0xd'),'condition':_0x3285('0x8'),'callback':afterUpdate},{'channel':_0x3285('0x17'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0x3285('0x9'),'callback':afterCreateMessage}];function request(_0x1a38c5){return client[_0x3285('0x19')](_0x3285('0x1a'),_0x1a38c5)[_0x3285('0x1b')](function(_0x4ce334){logger[_0x3285('0x1c')]('Trigger,\x20%s',_0x3285('0x1a'),_0x4ce334);if(_0x4ce334[_0x3285('0x1d')]){if(_0x4ce334[_0x3285('0x1d')]['code']===0x1f4){logger[_0x3285('0x1d')]('Trigger,\x20%s',_0x3285('0x1a'),_0x4ce334[_0x3285('0x1d')]);}}})[_0x3285('0x1e')](function(_0x186e86){logger[_0x3285('0x1d')](_0x3285('0x1f'),_0x3285('0x1a'),_0x186e86);});}function afterCreateMessage(_0x5943db){return function(_0x155552){_0x155552=_0x155552[_0x3285('0x20')]({'plain':!![]});_0x155552['channel']=_0x5943db;_0x155552[_0x3285('0x21')]=_0x5943db;_0x155552[_0x3285('0x22')]=_0x155552[_0x3285('0x23')];Promise[_0x3285('0x24')]()[_0x3285('0x1b')](function(){if(typeof _0x155552[_0x3285('0x25')]===_0x3285('0x26'))return null;var _0x48a8a3=_0x3285('0x27')+_0x155552[_0x3285('0x25')];return db[_0x3285('0x28')][_0x3285('0x29')](_0x48a8a3,{'type':db[_0x3285('0x2a')][_0x3285('0x2b')]['SELECT'],'raw':!![]});})['then'](function(_0x330479){if(_0x330479){_0x155552[_0x3285('0x2c')]=_0x330479[0x0];}if(typeof _0x155552[_0x3285('0x2d')]===_0x3285('0x26'))return;return getAgent(_0x155552['UserId']);})[_0x3285('0x1b')](function(_0x17956e){if(_0x17956e){_0x155552[_0x3285('0x2e')]=util['format'](_0x3285('0x2f'),_0x17956e['name']);_0x155552[_0x3285('0x30')]=_0x17956e;_0x155552['channel']=_0x5943db;return request({'event':'incomingmessage','message':_0x155552});}else{return request({'event':_0x3285('0x31'),'message':_0x155552});}})[_0x3285('0x1e')](function(_0x5e4498){logger[_0x3285('0x1d')]('Trigger,\x20%s','AfterCreateMessage',_0x5e4498);});};}function afterCreateOfflineMessage(_0x3f471b){return function(_0x3a5e1d){_0x3a5e1d=_0x3a5e1d['get']({'plain':!![]});_0x3a5e1d[_0x3285('0x32')]=_0x3f471b;_0x3a5e1d[_0x3285('0x21')]=_0x3f471b;_0x3a5e1d['event']='offlineMessage';return request({'event':_0x3a5e1d[_0x3285('0x22')],'message':_0x3a5e1d});};}function afterCreate(_0x5f1f80,_0x2cd84f){return function(_0x1a8567){_0x1a8567=_0x1a8567[_0x3285('0x20')]({'plain':!![]});_0x1a8567[_0x3285('0x32')]=_0x5f1f80;_0x1a8567['motionChannel']=_0x5f1f80;_0x1a8567[_0x3285('0x22')]='opened';Promise[_0x3285('0x24')]()[_0x3285('0x1b')](function(){var _0x5be4d4=_0x3285('0x27')+_0x1a8567[_0x3285('0x25')];return db[_0x3285('0x28')][_0x3285('0x29')](_0x5be4d4,{'type':db[_0x3285('0x2a')][_0x3285('0x2b')][_0x3285('0x33')],'raw':!![]});})[_0x3285('0x1b')](function(_0x518099){if(_0x518099){_0x1a8567[_0x3285('0x2c')]=_0x518099[0x0];}if(typeof _0x1a8567[_0x3285('0x2d')]===_0x3285('0x26'))return;return getAgent(_0x1a8567['UserId']);})['then'](function(_0x3d1bfe){if(_0x3d1bfe){_0x1a8567[_0x3285('0x2e')]=util['format'](_0x3285('0x2f'),_0x3d1bfe['name']);_0x1a8567['agent']=_0x3d1bfe;}return request({'event':_0x2cd84f,'message':_0x1a8567});})[_0x3285('0x1e')](function(_0x2dde22){logger['error'](_0x3285('0x1f'),_0x3285('0x34'),_0x2dde22);});};}function afterUpdate(_0x1873c3){return function(_0x4ee76a){var _0x2a3b0c=_0x4ee76a[_0x3285('0x35')](_0x3285('0x36'))&&_0x4ee76a[_0x3285('0x36')];var _0x25606b=_0x4ee76a[_0x3285('0x35')](_0x3285('0x37'));if(_0x2a3b0c||_0x25606b){var _0x3bf1fd=_0x2a3b0c?'closedinteraction':_0x3285('0x37');var _0x4ea275=_0x4ee76a[_0x3285('0x20')]({'plain':!![]});_0x4ea275['channel']=_0x1873c3;_0x4ea275[_0x3285('0x21')]=_0x1873c3;_0x4ea275['event']=_0x2a3b0c?'closed':_0x3285('0x37');var _0x41556b=_0x3285('0x27')+_0x4ea275[_0x3285('0x25')];return db['sequelize'][_0x3285('0x29')](_0x41556b,{'type':db[_0x3285('0x2a')][_0x3285('0x2b')][_0x3285('0x33')],'raw':!![]})[_0x3285('0x1b')](function(_0x43b4d4){if(_0x43b4d4){_0x4ea275[_0x3285('0x2c')]=_0x43b4d4[0x0];}if(typeof _0x4ea275['UserId']===_0x3285('0x26'))return;return getAgent(_0x4ea275[_0x3285('0x2d')]);})[_0x3285('0x1b')](function(_0x1b53cb){if(_0x1b53cb){_0x4ea275['interface']=util[_0x3285('0x38')](_0x3285('0x2f'),_0x1b53cb[_0x3285('0x39')]);_0x4ea275[_0x3285('0x30')]=_0x1b53cb;}return request({'event':_0x3bf1fd,'message':_0x4ea275});})[_0x3285('0x1e')](function(_0x77a1b0){logger[_0x3285('0x1d')](_0x3285('0x1f'),_0x3285('0x3a'),_0x77a1b0);});}};}function getAgent(_0x469fc2){return db[_0x3285('0x3b')][_0x3285('0x3c')]({'where':{'id':_0x469fc2},'attributes':['id',_0x3285('0x39'),_0x3285('0x3d'),_0x3285('0x3e'),_0x3285('0x3f')],'raw':!![]})[_0x3285('0x1b')](function(_0x85d53b){return _0x85d53b;});}exports[_0x3285('0x40')]=function(){for(var _0x9b24a1=0x0;_0x9b24a1=_0x2bd7d3[_0x133d('0xf')]){throw Error(_0x133d('0x10'));}_0x4b61e5(_0x2f258d);})[_0x133d('0x11')](function(_0x45f650){_0x495dac(_0x45f650);});});}; \ No newline at end of file +var _0x32b0=['Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','sms','whatsapp','openchannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','count','then','agents'];(function(_0x2c4051,_0x170811){var _0x515009=function(_0x5a553f){while(--_0x5a553f){_0x2c4051['push'](_0x2c4051['shift']());}};_0x515009(++_0x170811);}(_0x32b0,0x155));var _0x032b=function(_0x27d68c,_0x400adb){_0x27d68c=_0x27d68c-0x0;var _0x4e6572=_0x32b0[_0x27d68c];return _0x4e6572;};'use strict';var _=require(_0x032b('0x0'));var BPromise=require(_0x032b('0x1'));var db=require(_0x032b('0x2'))['db'];var util=require(_0x032b('0x3'));var channels=[_0x032b('0x4'),'mail','chat','fax',_0x032b('0x5'),_0x032b('0x6'),_0x032b('0x7')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x188b0d){_0x188b0d=_0x188b0d[_0x032b('0x8')]();return _['includes'](channels,_0x188b0d);};exports[_0x032b('0x9')]=function(_0x41eb5e,_0xab1517,_0x1a0aa3,_0x302faa){var _0x598d84={'loginAttempts':_0xab1517,'blocked':_0x1a0aa3};if(!_[_0x032b('0xa')](_0x302faa)){_0x598d84[_0x032b('0xb')]=_0x302faa;}return _0x41eb5e[_0x032b('0xc')](_0x598d84);};exports[_0x032b('0xd')]=function(_0x4d9813){return new BPromise(function(_0x21d9ee,_0x7b0c28){var _0x17265f=0x0;if(_0x4d9813['role']!==_0x032b('0xe')){_0x21d9ee(_0x4d9813);}db[_0x032b('0xf')][_0x032b('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4d9813['id']}}})[_0x032b('0x11')](function(_0x3ca5cb){_0x17265f=_0x3ca5cb;return util['getLicense']();})['then'](function(_0x265e11){if(_0x265e11&&_0x265e11[_0x032b('0x12')]&&_0x17265f>=_0x265e11[_0x032b('0x12')]){throw Error(_0x032b('0x13'));}_0x21d9ee(_0x4d9813);})['catch'](function(_0x437bbc){_0x7b0c28(_0x437bbc);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 5fac541..abaa38b 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','stack'];(function(_0x4f6afc,_0x4dfa88){var _0x256eeb=function(_0x216559){while(--_0x216559){_0x4f6afc['push'](_0x4f6afc['shift']());}};_0x256eeb(++_0x4dfa88);}(_0x814b,0x1a2));var _0xb814=function(_0x56ca61,_0x187321){_0x56ca61=_0x56ca61-0x0;var _0x1e7bee=_0x814b[_0x56ca61];return _0x1e7bee;};'use strict';var util=require(_0xb814('0x0'));var logger=require(_0xb814('0x1'))(_0xb814('0x2'));var APIError=function(_0x2f4ece,_0xfbb64b){this[_0xb814('0x3')]=_0x2f4ece||'Internal\x20Server\x20Error';this[_0xb814('0x4')]=_0xfbb64b||_0xb814('0x5');util[_0xb814('0x6')](APIError,Error);};var APIBadRequestError=function(_0x4237bc){this[_0xb814('0x3')]=_0x4237bc||_0xb814('0x7');this['name']=_0xb814('0x7');util[_0xb814('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x5c8539){this[_0xb814('0x3')]=_0x5c8539||_0xb814('0x8');this[_0xb814('0x4')]=_0xb814('0x9');util[_0xb814('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x21d4a5){this[_0xb814('0x3')]=_0x21d4a5||_0xb814('0xa');this[_0xb814('0x4')]=_0xb814('0xb');util[_0xb814('0x6')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x4b5f14){switch(_0x4b5f14){case _0xb814('0x7'):return 0x190;case'Forbidden',_0xb814('0xb'):return 0x193;case _0xb814('0x9'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x35b10d){if(_0x35b10d===_0xb814('0xb'))return _0x35b10d;return null;}function handleError(_0x2ce718){return function(_0x3bde14){logger[_0xb814('0xc')](_0x3bde14[_0xb814('0xd')]);var _0xa0a2e5=getStatusCode(_0x3bde14[_0xb814('0x4')]);var _0x3f4881=getCustomStatusMessage(_0x3bde14[_0xb814('0x4')]);if(_0x3bde14[_0xb814('0x4')])delete _0x3bde14[_0xb814('0x4')];if(_0x3f4881)_0x2ce718[_0xb814('0xe')]=_0x3f4881;return _0x2ce718[_0xb814('0xf')](_0xa0a2e5)[_0xb814('0x10')](_0x3bde14);};}module[_0xb814('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xc4aa=['stack','statusMessage','status','exports','util','../config/logger','api','message','inherits','Bad\x20Request','name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error'];(function(_0x870e0d,_0x5f5572){var _0x28fd9a=function(_0x291dd9){while(--_0x291dd9){_0x870e0d['push'](_0x870e0d['shift']());}};_0x28fd9a(++_0x5f5572);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var util=require(_0xac4a('0x0'));var logger=require(_0xac4a('0x1'))(_0xac4a('0x2'));var APIError=function(_0x351dd5,_0x275161){this[_0xac4a('0x3')]=_0x351dd5||'Internal\x20Server\x20Error';this['name']=_0x275161||'Error';util[_0xac4a('0x4')](APIError,Error);};var APIBadRequestError=function(_0x15b967){this[_0xac4a('0x3')]=_0x15b967||_0xac4a('0x5');this[_0xac4a('0x6')]=_0xac4a('0x5');util[_0xac4a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x10525b){this['message']=_0x10525b||'Entity\x20not\x20found';this[_0xac4a('0x6')]=_0xac4a('0x7');util[_0xac4a('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4f4146){this[_0xac4a('0x3')]=_0x4f4146||_0xac4a('0x8');this[_0xac4a('0x6')]='Out\x20Of\x20Interval';util[_0xac4a('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x488e3c){switch(_0x488e3c){case _0xac4a('0x5'):return 0x190;case'Forbidden',_0xac4a('0x9'):return 0x193;case _0xac4a('0x7'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x24291d){if(_0x24291d==='Out\x20Of\x20Interval')return _0x24291d;return null;}function handleError(_0x21a79){return function(_0x68424a){logger[_0xac4a('0xa')](_0x68424a[_0xac4a('0xb')]);var _0x1b4313=getStatusCode(_0x68424a[_0xac4a('0x6')]);var _0x34bc01=getCustomStatusMessage(_0x68424a[_0xac4a('0x6')]);if(_0x68424a[_0xac4a('0x6')])delete _0x68424a[_0xac4a('0x6')];if(_0x34bc01)_0x21a79[_0xac4a('0xc')]=_0x34bc01;return _0x21a79[_0xac4a('0xd')](_0x1b4313)['send'](_0x68424a);};}module[_0xac4a('0xe')]={'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 bebddcf..4bf4585 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde3e=['send','exports','404','status','render','json'];(function(_0x4bafa2,_0x43ee66){var _0x581606=function(_0x2398cf){while(--_0x2398cf){_0x4bafa2['push'](_0x4bafa2['shift']());}};_0x581606(++_0x43ee66);}(_0xde3e,0x1cf));var _0xede3=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xde3e[_0x1b828b];return _0x98da1a;};'use strict';module[_0xede3('0x0')][0x194]=function pageNotFound(_0x396b42,_0x31ecc6){var _0x5e7fa1=_0xede3('0x1');var _0x5ca8a7=0x194;var _0x12b3ba={'status':_0x5ca8a7};_0x31ecc6[_0xede3('0x2')](_0x12b3ba[_0xede3('0x2')]);_0x31ecc6[_0xede3('0x3')](_0x5e7fa1,{},function(_0x5b33a0,_0x2e9e33){if(_0x5b33a0){return _0x31ecc6[_0xede3('0x2')](_0x12b3ba[_0xede3('0x2')])[_0xede3('0x4')](_0x12b3ba);}_0x31ecc6[_0xede3('0x5')](_0x2e9e33);});}; \ No newline at end of file +var _0x2a41=['status','render','exports','404'];(function(_0x5095cc,_0x2b5d57){var _0x25bd2e=function(_0x5e39d2){while(--_0x5e39d2){_0x5095cc['push'](_0x5095cc['shift']());}};_0x25bd2e(++_0x2b5d57);}(_0x2a41,0x126));var _0x12a4=function(_0x9a2618,_0x7fd0c6){_0x9a2618=_0x9a2618-0x0;var _0x44d3a3=_0x2a41[_0x9a2618];return _0x44d3a3;};'use strict';module[_0x12a4('0x0')][0x194]=function pageNotFound(_0x4b1478,_0x2067f8){var _0x1bcc7a=_0x12a4('0x1');var _0x321075=0x194;var _0x1b4dd3={'status':_0x321075};_0x2067f8[_0x12a4('0x2')](_0x1b4dd3[_0x12a4('0x2')]);_0x2067f8[_0x12a4('0x3')](_0x1bcc7a,{},function(_0x3ae504,_0x501fcf){if(_0x3ae504){return _0x2067f8[_0x12a4('0x2')](_0x1b4dd3[_0x12a4('0x2')])['json'](_0x1b4dd3);}_0x2067f8['send'](_0x501fcf);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2db086a..7efd71a 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(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 82c68c0..f4496d1 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/integrations','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/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/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/square/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','/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/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./utils/client-side-logger','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x1f625b,_0x276b0e){_0x1f625b=_0x1f625b-0x0;var _0x748222=_0xd0bb[_0x1f625b];return _0x748222;};'use strict';var path=require(_0xbd0b('0x0'));var express=require(_0xbd0b('0x1'));var errors=require(_0xbd0b('0x2'));var config=require('./config/environment');var setupLoggers=require(_0xbd0b('0x3'))['setupLoggers'];var clientSideLogs=require(_0xbd0b('0x4'));exports[_0xbd0b('0x5')]=function(_0x53e6ce){return setupLoggers(_0x53e6ce)[_0xbd0b('0x6')](function(){_0x53e6ce['use'](_0xbd0b('0x7'),require(_0xbd0b('0x8')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa'),require(_0xbd0b('0xb')));_0x53e6ce['use'](_0xbd0b('0xc'),require(_0xbd0b('0xd')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe'),require(_0xbd0b('0xf')));_0x53e6ce['use']('/api/voice/mohs',require(_0xbd0b('0x10')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/queues',require(_0xbd0b('0x11')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/recordings',require(_0xbd0b('0x12')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x13'),require(_0xbd0b('0x14')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x15'),require(_0xbd0b('0x16')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x17'),require(_0xbd0b('0x18')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/calls/reports',require(_0xbd0b('0x19')));_0x53e6ce['use']('/api/voice/dials/reports',require(_0xbd0b('0x1a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x1b'),require(_0xbd0b('0x1c')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x1d'),require(_0xbd0b('0x1e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x1f'),require(_0xbd0b('0x20')));_0x53e6ce['use'](_0xbd0b('0x21'),require('./api/voiceTransferReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x22'),require(_0xbd0b('0x23')));_0x53e6ce[_0xbd0b('0x9')]('/api/mail/accounts',require(_0xbd0b('0x24')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x25'),require('./api/mailQueue'));_0x53e6ce[_0xbd0b('0x9')]('/api/mail/substatuses',require(_0xbd0b('0x26')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x27'),require(_0xbd0b('0x28')));_0x53e6ce[_0xbd0b('0x9')]('/api/mail/messages',require(_0xbd0b('0x29')));_0x53e6ce['use'](_0xbd0b('0x2a'),require(_0xbd0b('0x2b')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x2c'),require(_0xbd0b('0x2d')));_0x53e6ce[_0xbd0b('0x9')]('/api/dashboards',require(_0xbd0b('0x2e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x2f'),require(_0xbd0b('0x30')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x31'),require('./api/faxAccount'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x32'),require(_0xbd0b('0x33')));_0x53e6ce['use']('/api/fax/interactions',require(_0xbd0b('0x34')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x35'),require(_0xbd0b('0x36')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x37'),require(_0xbd0b('0x38')));_0x53e6ce['use'](_0xbd0b('0x39'),require(_0xbd0b('0x3a')));_0x53e6ce['use']('/api/sms/accounts',require(_0xbd0b('0x3b')));_0x53e6ce[_0xbd0b('0x9')]('/api/sms/applications',require(_0xbd0b('0x3c')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x3d'),require(_0xbd0b('0x3e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x3f'),require('./api/smsMessage'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x40'),require(_0xbd0b('0x41')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x42'),require(_0xbd0b('0x43')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x44'),require(_0xbd0b('0x45')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x46'),require(_0xbd0b('0x47')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x48'),require('./api/openchannelMessage'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x49'),require('./api/openchannelQueue'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x4a'),require(_0xbd0b('0x4b')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x4c'),require(_0xbd0b('0x4d')));_0x53e6ce['use'](_0xbd0b('0x4e'),require(_0xbd0b('0x4f')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x50'),require(_0xbd0b('0x51')));_0x53e6ce['use']('/api/chat/messages',require(_0xbd0b('0x52')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x53'),require(_0xbd0b('0x54')));_0x53e6ce['use']('/api/chat/queues',require(_0xbd0b('0x55')));_0x53e6ce['use'](_0xbd0b('0x56'),require(_0xbd0b('0x57')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x58'),require(_0xbd0b('0x59')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x5a'),require(_0xbd0b('0x5b')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x5c'),require(_0xbd0b('0x5d')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x5e'),require(_0xbd0b('0x5f')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x60'),require(_0xbd0b('0x61')));_0x53e6ce[_0xbd0b('0x9')]('/api/cm/hopper_final',require(_0xbd0b('0x62')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x63'),require(_0xbd0b('0x64')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x65'),require(_0xbd0b('0x66')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x67'),require(_0xbd0b('0x68')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x69'),require('./api/automation'));_0x53e6ce[_0xbd0b('0x9')]('/api/canned_answers',require('./api/cannedAnswer'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x6a'),require(_0xbd0b('0x6b')));_0x53e6ce['use'](_0xbd0b('0x6c'),require(_0xbd0b('0x6d')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x6e'),require(_0xbd0b('0x6f')));_0x53e6ce['use'](_0xbd0b('0x70'),require(_0xbd0b('0x71')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x72'),require(_0xbd0b('0x73')));_0x53e6ce[_0xbd0b('0x9')]('/api/voiceQueuesLog',require(_0xbd0b('0x74')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x75'),require(_0xbd0b('0x76')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x77'),require(_0xbd0b('0x78')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x79'),require(_0xbd0b('0x7a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x7b'),require(_0xbd0b('0x7c')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x7d'),require(_0xbd0b('0x7e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x7f'),require(_0xbd0b('0x80')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x81'),require(_0xbd0b('0x82')));_0x53e6ce[_0xbd0b('0x9')]('/api/triggers',require(_0xbd0b('0x83')));_0x53e6ce[_0xbd0b('0x9')]('/api/variables',require('./api/variable'));_0x53e6ce['use'](_0xbd0b('0x84'),require('./api/integration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x85'),require(_0xbd0b('0x86')));_0x53e6ce[_0xbd0b('0x9')]('/api/analytics/custom_reports',require(_0xbd0b('0x87')));_0x53e6ce['use'](_0xbd0b('0x88'),require('./api/analyticDefaultReport'));_0x53e6ce['use'](_0xbd0b('0x89'),require(_0xbd0b('0x8a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x8b'),require(_0xbd0b('0x8c')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x8d'),require(_0xbd0b('0x8e')));_0x53e6ce['use']('/api/analytics/tree_reports',require(_0xbd0b('0x8f')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x90'),require(_0xbd0b('0x91')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/salesforce/fields',require(_0xbd0b('0x92')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x93'),require(_0xbd0b('0x94')));_0x53e6ce['use'](_0xbd0b('0x95'),require(_0xbd0b('0x96')));_0x53e6ce['use'](_0xbd0b('0x97'),require(_0xbd0b('0x98')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x99'),require(_0xbd0b('0x9a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x9b'),require(_0xbd0b('0x9c')));_0x53e6ce['use'](_0xbd0b('0x9d'),require(_0xbd0b('0x9e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x9f'),require(_0xbd0b('0xa0')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa1'),require('./api/intZohoField'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa2'),require(_0xbd0b('0xa3')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa4'),require('./api/intZendeskConfiguration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa5'),require(_0xbd0b('0xa6')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa7'),require(_0xbd0b('0xa8')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa9'),require(_0xbd0b('0xaa')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xab'),require(_0xbd0b('0xac')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xad'),require(_0xbd0b('0xae')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xaf'),require('./api/intVtigerConfiguration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb0'),require(_0xbd0b('0xb1')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb2'),require(_0xbd0b('0xb3')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb4'),require('./api/intServicenowField'));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/dynamics365/accounts',require(_0xbd0b('0xb5')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb6'),require(_0xbd0b('0xb7')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb8'),require('./api/intDynamics365Field'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb9'),require(_0xbd0b('0xba')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/freshsales/configurations',require(_0xbd0b('0xbb')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xbc'),require(_0xbd0b('0xbd')));_0x53e6ce[_0xbd0b('0x9')]('/api/networks',require('./api/network'));_0x53e6ce[_0xbd0b('0x9')]('/api/chat/reports/queue',require(_0xbd0b('0xbe')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xbf'),require(_0xbd0b('0xc0')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc1'),require('./api/jscriptyAnswerReport'));_0x53e6ce[_0xbd0b('0x9')]('/api/jscripty/questions/reports',require(_0xbd0b('0xc2')));_0x53e6ce['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x53e6ce[_0xbd0b('0x9')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc3'),require('./api/squareReport'));_0x53e6ce[_0xbd0b('0x9')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc4'),require(_0xbd0b('0xc5')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc6'),require(_0xbd0b('0xc7')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc8'),require('./api/squareOdbc'));_0x53e6ce['use'](_0xbd0b('0xc9'),require('./api/squareProject'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xca'),require(_0xbd0b('0xcb')));_0x53e6ce['use'](_0xbd0b('0xcc'),require(_0xbd0b('0xcd')));_0x53e6ce['use'](_0xbd0b('0xce'),require(_0xbd0b('0xcf')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd0'),require(_0xbd0b('0xd1')));_0x53e6ce['use'](_0xbd0b('0xd2'),require(_0xbd0b('0xd3')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd4'),require('./api/migration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd5'),require('./api/attachment'));_0x53e6ce[_0xbd0b('0x9')]('/api/plugins',require(_0xbd0b('0xd6')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd7'),require(_0xbd0b('0xd8')));_0x53e6ce[_0xbd0b('0x9')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x53e6ce['use'](_0xbd0b('0xd9'),require(_0xbd0b('0xda')));_0x53e6ce[_0xbd0b('0x9')]('/api/openchannel/reports/transfer',require(_0xbd0b('0xdb')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xdc'),require(_0xbd0b('0xdd')));_0x53e6ce[_0xbd0b('0x9')]('/api/cm/lists',require(_0xbd0b('0xde')));_0x53e6ce['use'](_0xbd0b('0xdf'),require(_0xbd0b('0xe0')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe1'),require(_0xbd0b('0xe2')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe3'),require(_0xbd0b('0xe4')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe5'),require('./api/userProfileResource'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe6'),require(_0xbd0b('0xe7')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe8'),require(_0xbd0b('0xe9')));_0x53e6ce[_0xbd0b('0x9')]('/api/whatsapp/applications',require(_0xbd0b('0xea')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xeb'),require('./api/whatsappInteraction'));_0x53e6ce[_0xbd0b('0x9')]('/api/whatsapp/messages',require(_0xbd0b('0xec')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xed'),require(_0xbd0b('0xee')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xef'),require('./api/whatsappTransferReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf0'),require(_0xbd0b('0xf1')));_0x53e6ce[_0xbd0b('0x9')]('/api/cloudProviders',require(_0xbd0b('0xf2')));_0x53e6ce['use'](_0xbd0b('0xf3'),require(_0xbd0b('0xf4')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf5'),require(_0xbd0b('0xf6')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf7'),require(_0xbd0b('0xf8')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf9'),require(_0xbd0b('0xfa')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xfb'),require('./api/authActiveDirectory'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xfc'),require(_0xbd0b('0xfd')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xfe'),require(_0xbd0b('0xff')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x100'),require(_0xbd0b('0x101')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x102'),require(_0xbd0b('0x103')));_0x53e6ce[_0xbd0b('0x9')]('/api/pm2',require(_0xbd0b('0x104')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x105'),require(_0xbd0b('0x106')));_0x53e6ce['use'](_0xbd0b('0x107'),clientSideLogs);_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x108'),express[_0xbd0b('0x109')](path[_0xbd0b('0x10a')](config['root'],'/apidoc')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x10b'),express[_0xbd0b('0x109')](path['join'](config[_0xbd0b('0x10c')],_0xbd0b('0x10b'))));_0x53e6ce[_0xbd0b('0x9')]('/demo',express[_0xbd0b('0x109')](path['join'](config['root'],_0xbd0b('0x10d'))));_0x53e6ce['use']('/snippet',express[_0xbd0b('0x109')](path['join'](config[_0xbd0b('0x10c')],_0xbd0b('0x10e'),'3.5.0')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x10f'),express[_0xbd0b('0x109')](path[_0xbd0b('0x10a')](config[_0xbd0b('0x10c')],'/server/files/plugins')));_0x53e6ce[_0xbd0b('0x110')](_0xbd0b('0x111'))['get'](errors[0x194]);_0x53e6ce[_0xbd0b('0x110')]('/*')[_0xbd0b('0x112')](function(_0x2347f3,_0x3c9986){_0x3c9986[_0xbd0b('0x113')](path[_0xbd0b('0x114')](_0x53e6ce['get'](_0xbd0b('0x115'))+_0xbd0b('0x116')));});return _0x53e6ce;});}; \ No newline at end of file +var _0x544a=['./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/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/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./errors','setupLoggers','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper_black'];(function(_0xdd430b,_0x25cf87){var _0x59d745=function(_0x3b5e98){while(--_0x3b5e98){_0xdd430b['push'](_0xdd430b['shift']());}};_0x59d745(++_0x25cf87);}(_0x544a,0xbd));var _0xa544=function(_0x2f494d,_0x121424){_0x2f494d=_0x2f494d-0x0;var _0x158ec4=_0x544a[_0x2f494d];return _0x158ec4;};'use strict';var path=require(_0xa544('0x0'));var express=require(_0xa544('0x1'));var errors=require(_0xa544('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xa544('0x3')];var clientSideLogs=require('./api/client-side-logs');exports[_0xa544('0x4')]=function(_0xdca212){return setupLoggers(_0xdca212)['then'](function(){_0xdca212[_0xa544('0x5')](_0xa544('0x6'),require(_0xa544('0x7')));_0xdca212[_0xa544('0x5')](_0xa544('0x8'),require('./api/voiceChanSpy'));_0xdca212[_0xa544('0x5')]('/api/voice/contexts',require(_0xa544('0x9')));_0xdca212[_0xa544('0x5')]('/api/voice/extensions',require(_0xa544('0xa')));_0xdca212[_0xa544('0x5')](_0xa544('0xb'),require(_0xa544('0xc')));_0xdca212['use'](_0xa544('0xd'),require(_0xa544('0xe')));_0xdca212['use'](_0xa544('0xf'),require('./api/voiceRecording'));_0xdca212[_0xa544('0x5')](_0xa544('0x10'),require('./api/screenRecording'));_0xdca212[_0xa544('0x5')](_0xa544('0x11'),require(_0xa544('0x12')));_0xdca212[_0xa544('0x5')](_0xa544('0x13'),require(_0xa544('0x14')));_0xdca212[_0xa544('0x5')](_0xa544('0x15'),require(_0xa544('0x16')));_0xdca212[_0xa544('0x5')](_0xa544('0x17'),require(_0xa544('0x18')));_0xdca212['use'](_0xa544('0x19'),require(_0xa544('0x1a')));_0xdca212['use'](_0xa544('0x1b'),require(_0xa544('0x1c')));_0xdca212[_0xa544('0x5')](_0xa544('0x1d'),require(_0xa544('0x1e')));_0xdca212[_0xa544('0x5')](_0xa544('0x1f'),require(_0xa544('0x20')));_0xdca212[_0xa544('0x5')](_0xa544('0x21'),require('./api/voiceTransferReport'));_0xdca212['use'](_0xa544('0x22'),require(_0xa544('0x23')));_0xdca212[_0xa544('0x5')]('/api/mail/accounts',require(_0xa544('0x24')));_0xdca212[_0xa544('0x5')]('/api/mail/queues',require(_0xa544('0x25')));_0xdca212[_0xa544('0x5')](_0xa544('0x26'),require(_0xa544('0x27')));_0xdca212[_0xa544('0x5')]('/api/mail/interactions',require('./api/mailInteraction'));_0xdca212[_0xa544('0x5')]('/api/mail/messages',require(_0xa544('0x28')));_0xdca212[_0xa544('0x5')](_0xa544('0x29'),require(_0xa544('0x2a')));_0xdca212[_0xa544('0x5')](_0xa544('0x2b'),require(_0xa544('0x2c')));_0xdca212[_0xa544('0x5')](_0xa544('0x2d'),require('./api/dashboard'));_0xdca212[_0xa544('0x5')](_0xa544('0x2e'),require('./api/dashboardItem'));_0xdca212[_0xa544('0x5')](_0xa544('0x2f'),require(_0xa544('0x30')));_0xdca212['use'](_0xa544('0x31'),require(_0xa544('0x32')));_0xdca212[_0xa544('0x5')](_0xa544('0x33'),require('./api/faxInteraction'));_0xdca212[_0xa544('0x5')](_0xa544('0x34'),require(_0xa544('0x35')));_0xdca212['use'](_0xa544('0x36'),require(_0xa544('0x37')));_0xdca212['use']('/api/fax/reports/queue',require(_0xa544('0x38')));_0xdca212[_0xa544('0x5')](_0xa544('0x39'),require('./api/smsAccount'));_0xdca212[_0xa544('0x5')](_0xa544('0x3a'),require(_0xa544('0x3b')));_0xdca212['use'](_0xa544('0x3c'),require(_0xa544('0x3d')));_0xdca212['use'](_0xa544('0x3e'),require('./api/smsMessage'));_0xdca212[_0xa544('0x5')](_0xa544('0x3f'),require(_0xa544('0x40')));_0xdca212['use']('/api/openchannel/accounts',require(_0xa544('0x41')));_0xdca212[_0xa544('0x5')](_0xa544('0x42'),require('./api/openchannelApplication'));_0xdca212['use'](_0xa544('0x43'),require(_0xa544('0x44')));_0xdca212[_0xa544('0x5')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0xdca212[_0xa544('0x5')](_0xa544('0x45'),require(_0xa544('0x46')));_0xdca212[_0xa544('0x5')](_0xa544('0x47'),require(_0xa544('0x48')));_0xdca212[_0xa544('0x5')]('/api/openchannel/reports/queue',require(_0xa544('0x49')));_0xdca212[_0xa544('0x5')](_0xa544('0x4a'),require(_0xa544('0x4b')));_0xdca212['use'](_0xa544('0x4c'),require(_0xa544('0x4d')));_0xdca212[_0xa544('0x5')](_0xa544('0x4e'),require('./api/chatMessage'));_0xdca212[_0xa544('0x5')](_0xa544('0x4f'),require(_0xa544('0x50')));_0xdca212['use'](_0xa544('0x51'),require(_0xa544('0x52')));_0xdca212[_0xa544('0x5')](_0xa544('0x53'),require('./api/chatGroup'));_0xdca212['use'](_0xa544('0x54'),require(_0xa544('0x55')));_0xdca212['use'](_0xa544('0x56'),require(_0xa544('0x57')));_0xdca212[_0xa544('0x5')](_0xa544('0x58'),require('./api/cmContact'));_0xdca212[_0xa544('0x5')]('/api/cm/hopper',require('./api/cmHopper'));_0xdca212[_0xa544('0x5')](_0xa544('0x59'),require(_0xa544('0x5a')));_0xdca212[_0xa544('0x5')](_0xa544('0x5b'),require(_0xa544('0x5c')));_0xdca212[_0xa544('0x5')](_0xa544('0x5d'),require(_0xa544('0x5e')));_0xdca212[_0xa544('0x5')]('/api/cm/custom_fields',require(_0xa544('0x5f')));_0xdca212[_0xa544('0x5')]('/api/actions',require('./api/action'));_0xdca212[_0xa544('0x5')](_0xa544('0x60'),require('./api/automation'));_0xdca212[_0xa544('0x5')]('/api/canned_answers',require(_0xa544('0x61')));_0xdca212[_0xa544('0x5')](_0xa544('0x62'),require(_0xa544('0x63')));_0xdca212[_0xa544('0x5')](_0xa544('0x64'),require('./api/condition'));_0xdca212['use'](_0xa544('0x65'),require(_0xa544('0x66')));_0xdca212[_0xa544('0x5')]('/api/pauses',require('./api/pause'));_0xdca212[_0xa544('0x5')](_0xa544('0x67'),require(_0xa544('0x68')));_0xdca212[_0xa544('0x5')](_0xa544('0x69'),require(_0xa544('0x6a')));_0xdca212[_0xa544('0x5')](_0xa544('0x6b'),require(_0xa544('0x6c')));_0xdca212[_0xa544('0x5')]('/api/sounds',require(_0xa544('0x6d')));_0xdca212[_0xa544('0x5')](_0xa544('0x6e'),require(_0xa544('0x6f')));_0xdca212[_0xa544('0x5')](_0xa544('0x70'),require('./api/contactItemType'));_0xdca212['use'](_0xa544('0x71'),require(_0xa544('0x72')));_0xdca212[_0xa544('0x5')](_0xa544('0x73'),require(_0xa544('0x74')));_0xdca212[_0xa544('0x5')](_0xa544('0x75'),require('./api/template'));_0xdca212['use'](_0xa544('0x76'),require(_0xa544('0x77')));_0xdca212[_0xa544('0x5')](_0xa544('0x78'),require(_0xa544('0x79')));_0xdca212['use'](_0xa544('0x7a'),require(_0xa544('0x7b')));_0xdca212[_0xa544('0x5')](_0xa544('0x7c'),require('./api/integrationReport'));_0xdca212[_0xa544('0x5')](_0xa544('0x7d'),require(_0xa544('0x7e')));_0xdca212['use'](_0xa544('0x7f'),require(_0xa544('0x80')));_0xdca212[_0xa544('0x5')](_0xa544('0x81'),require(_0xa544('0x82')));_0xdca212[_0xa544('0x5')](_0xa544('0x83'),require('./api/analyticMetric'));_0xdca212[_0xa544('0x5')](_0xa544('0x84'),require(_0xa544('0x85')));_0xdca212[_0xa544('0x5')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0xdca212['use'](_0xa544('0x86'),require(_0xa544('0x87')));_0xdca212[_0xa544('0x5')](_0xa544('0x88'),require(_0xa544('0x89')));_0xdca212[_0xa544('0x5')](_0xa544('0x8a'),require(_0xa544('0x8b')));_0xdca212['use'](_0xa544('0x8c'),require(_0xa544('0x8d')));_0xdca212[_0xa544('0x5')](_0xa544('0x8e'),require(_0xa544('0x8f')));_0xdca212['use'](_0xa544('0x90'),require(_0xa544('0x91')));_0xdca212[_0xa544('0x5')]('/api/integrations/desk/accounts',require(_0xa544('0x92')));_0xdca212[_0xa544('0x5')](_0xa544('0x93'),require(_0xa544('0x94')));_0xdca212[_0xa544('0x5')](_0xa544('0x95'),require(_0xa544('0x96')));_0xdca212[_0xa544('0x5')](_0xa544('0x97'),require(_0xa544('0x98')));_0xdca212[_0xa544('0x5')](_0xa544('0x99'),require(_0xa544('0x9a')));_0xdca212['use'](_0xa544('0x9b'),require('./api/intZohoField'));_0xdca212[_0xa544('0x5')](_0xa544('0x9c'),require(_0xa544('0x9d')));_0xdca212[_0xa544('0x5')](_0xa544('0x9e'),require(_0xa544('0x9f')));_0xdca212['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0xdca212[_0xa544('0x5')](_0xa544('0xa0'),require(_0xa544('0xa1')));_0xdca212[_0xa544('0x5')](_0xa544('0xa2'),require(_0xa544('0xa3')));_0xdca212[_0xa544('0x5')]('/api/integrations/freshdesk/fields',require(_0xa544('0xa4')));_0xdca212[_0xa544('0x5')](_0xa544('0xa5'),require('./api/intVtigerAccount'));_0xdca212[_0xa544('0x5')](_0xa544('0xa6'),require(_0xa544('0xa7')));_0xdca212[_0xa544('0x5')](_0xa544('0xa8'),require(_0xa544('0xa9')));_0xdca212[_0xa544('0x5')]('/api/integrations/servicenow/accounts',require(_0xa544('0xaa')));_0xdca212[_0xa544('0x5')](_0xa544('0xab'),require('./api/intServicenowConfiguration'));_0xdca212[_0xa544('0x5')]('/api/integrations/servicenow/fields',require(_0xa544('0xac')));_0xdca212[_0xa544('0x5')]('/api/integrations/dynamics365/accounts',require(_0xa544('0xad')));_0xdca212[_0xa544('0x5')]('/api/integrations/dynamics365/configurations',require(_0xa544('0xae')));_0xdca212[_0xa544('0x5')](_0xa544('0xaf'),require(_0xa544('0xb0')));_0xdca212[_0xa544('0x5')](_0xa544('0xb1'),require(_0xa544('0xb2')));_0xdca212[_0xa544('0x5')](_0xa544('0xb3'),require('./api/intFreshsalesConfiguration'));_0xdca212[_0xa544('0x5')]('/api/integrations/freshsales/fields',require(_0xa544('0xb4')));_0xdca212[_0xa544('0x5')](_0xa544('0xb5'),require(_0xa544('0xb6')));_0xdca212['use'](_0xa544('0xb7'),require('./api/chatQueueReport'));_0xdca212[_0xa544('0x5')](_0xa544('0xb8'),require(_0xa544('0xb9')));_0xdca212['use'](_0xa544('0xba'),require(_0xa544('0xbb')));_0xdca212['use']('/api/jscripty/questions/reports',require(_0xa544('0xbc')));_0xdca212[_0xa544('0x5')](_0xa544('0xbd'),require(_0xa544('0xbe')));_0xdca212[_0xa544('0x5')]('/api/sms/reports/queue',require(_0xa544('0xbf')));_0xdca212['use'](_0xa544('0xc0'),require(_0xa544('0xc1')));_0xdca212['use'](_0xa544('0xc2'),require(_0xa544('0xc3')));_0xdca212[_0xa544('0x5')](_0xa544('0xc4'),require(_0xa544('0xc5')));_0xdca212['use'](_0xa544('0xc6'),require('./api/setting'));_0xdca212['use'](_0xa544('0xc7'),require(_0xa544('0xc8')));_0xdca212['use'](_0xa544('0xc9'),require(_0xa544('0xca')));_0xdca212[_0xa544('0x5')]('/api/square/recordings',require(_0xa544('0xcb')));_0xdca212[_0xa544('0x5')](_0xa544('0xcc'),require(_0xa544('0xcd')));_0xdca212[_0xa544('0x5')]('/api/teams',require('./api/team'));_0xdca212[_0xa544('0x5')](_0xa544('0xce'),require(_0xa544('0xcf')));_0xdca212[_0xa544('0x5')](_0xa544('0xd0'),require(_0xa544('0xd1')));_0xdca212['use']('/api/migrations',require(_0xa544('0xd2')));_0xdca212[_0xa544('0x5')](_0xa544('0xd3'),require(_0xa544('0xd4')));_0xdca212[_0xa544('0x5')](_0xa544('0xd5'),require(_0xa544('0xd6')));_0xdca212['use']('/api/mail/reports/transfer',require(_0xa544('0xd7')));_0xdca212[_0xa544('0x5')](_0xa544('0xd8'),require(_0xa544('0xd9')));_0xdca212[_0xa544('0x5')](_0xa544('0xda'),require(_0xa544('0xdb')));_0xdca212[_0xa544('0x5')](_0xa544('0xdc'),require(_0xa544('0xdd')));_0xdca212[_0xa544('0x5')](_0xa544('0xde'),require(_0xa544('0xdf')));_0xdca212[_0xa544('0x5')](_0xa544('0xe0'),require(_0xa544('0xe1')));_0xdca212[_0xa544('0x5')](_0xa544('0xe2'),require(_0xa544('0xe3')));_0xdca212[_0xa544('0x5')]('/api/userProfiles',require(_0xa544('0xe4')));_0xdca212['use'](_0xa544('0xe5'),require('./api/userProfileSection'));_0xdca212['use'](_0xa544('0xe6'),require(_0xa544('0xe7')));_0xdca212[_0xa544('0x5')]('/api/userNotifications',require(_0xa544('0xe8')));_0xdca212[_0xa544('0x5')](_0xa544('0xe9'),require('./api/whatsappAccount'));_0xdca212['use'](_0xa544('0xea'),require('./api/whatsappApplication'));_0xdca212[_0xa544('0x5')](_0xa544('0xeb'),require('./api/whatsappInteraction'));_0xdca212['use'](_0xa544('0xec'),require(_0xa544('0xed')));_0xdca212['use'](_0xa544('0xee'),require(_0xa544('0xef')));_0xdca212[_0xa544('0x5')](_0xa544('0xf0'),require('./api/whatsappTransferReport'));_0xdca212[_0xa544('0x5')](_0xa544('0xf1'),require('./api/whatsappQueue'));_0xdca212[_0xa544('0x5')](_0xa544('0xf2'),require('./api/cloudProvider'));_0xdca212[_0xa544('0x5')](_0xa544('0xf3'),require(_0xa544('0xf4')));_0xdca212[_0xa544('0x5')](_0xa544('0xf5'),require(_0xa544('0xf6')));_0xdca212['use'](_0xa544('0xf7'),require('./api/authLocal'));_0xdca212[_0xa544('0x5')](_0xa544('0xf8'),require(_0xa544('0xf9')));_0xdca212[_0xa544('0x5')](_0xa544('0xfa'),require(_0xa544('0xfb')));_0xdca212[_0xa544('0x5')](_0xa544('0xfc'),require(_0xa544('0xfd')));_0xdca212['use'](_0xa544('0xfe'),require(_0xa544('0xff')));_0xdca212[_0xa544('0x5')]('/api/version',require(_0xa544('0x100')));_0xdca212['use'](_0xa544('0x101'),require('./api/system'));_0xdca212[_0xa544('0x5')](_0xa544('0x102'),require(_0xa544('0x103')));_0xdca212[_0xa544('0x5')](_0xa544('0x104'),require(_0xa544('0x105')));_0xdca212[_0xa544('0x5')](_0xa544('0x106'),clientSideLogs);_0xdca212[_0xa544('0x5')](_0xa544('0x107'),express[_0xa544('0x108')](path['join'](config[_0xa544('0x109')],'/apidoc')));_0xdca212[_0xa544('0x5')](_0xa544('0x10a'),express[_0xa544('0x108')](path[_0xa544('0x10b')](config[_0xa544('0x109')],_0xa544('0x10a'))));_0xdca212['use'](_0xa544('0x10c'),express[_0xa544('0x108')](path['join'](config[_0xa544('0x109')],_0xa544('0x10c'))));_0xdca212[_0xa544('0x5')]('/snippet',express[_0xa544('0x108')](path[_0xa544('0x10b')](config[_0xa544('0x109')],_0xa544('0x10d'),_0xa544('0x10e'))));_0xdca212[_0xa544('0x5')](_0xa544('0x10f'),express[_0xa544('0x108')](path[_0xa544('0x10b')](config['root'],_0xa544('0x110'))));_0xdca212[_0xa544('0x111')](_0xa544('0x112'))[_0xa544('0x113')](errors[0x194]);_0xdca212['route']('/*')[_0xa544('0x113')](function(_0x5c380a,_0x3eb91a){_0x3eb91a['sendFile'](path[_0xa544('0x114')](_0xdca212['get'](_0xa544('0x115'))+_0xa544('0x116')));});return _0xdca212;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 668b7bd..c60b34d 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf64f=['../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.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/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.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/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.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/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0xf64f,0xb4));var _0xff64=function(_0x3db0b1,_0x346ce5){_0x3db0b1=_0x3db0b1-0x0;var _0x43d12a=_0xf64f[_0x3db0b1];return _0x43d12a;};'use strict';var jayson=require(_0xff64('0x0'));var _=require('lodash');var config=require(_0xff64('0x1'));exports[_0xff64('0x2')]=function(){return new Promise(function(_0x30fc9f,_0x16ec72){var _0x1ec077={};_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/user/user.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x4')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x5')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x6')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x7')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x8')));_0x1ec077=_['merge'](_0x1ec077,require('../api/trunk/trunk.rpc'));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x9')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0xa')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0xb')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0xc')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0xd')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0xe')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0xf')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x10')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x11')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x12')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x13')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/faxInteraction/faxInteraction.rpc'));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x14')));_0x1ec077=_['merge'](_0x1ec077,require('../api/faxQueue/faxQueue.rpc'));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x15')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/smsAccount/smsAccount.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x16')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/smsMessage/smsMessage.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x17')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x18')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x19')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x1a')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x1b')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x1c')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x1d')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x1e')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/cmContact/cmContact.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/cmHopper/cmHopper.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x1f')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x20')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x21')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x22')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x23')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x24')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/sound/sound.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x25')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x26')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x27')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x28')));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x29')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x2a')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x2b')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x2c')));_0x1ec077=_['merge'](_0x1ec077,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x2d')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x2e')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1ec077=_['merge'](_0x1ec077,require(_0xff64('0x2f')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x30')));_0x1ec077=_['merge'](_0x1ec077,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x31')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x32')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x33')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x34')));_0x1ec077=_['merge'](_0x1ec077,require('../api/squareOdbc/squareOdbc.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x35')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/squareRecording/squareRecording.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x36')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/campaign/campaign.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/attachment/attachment.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require('../api/plugin/plugin.rpc'));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x37')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x38')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x39')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x3a')));_0x1ec077=_[_0xff64('0x3')](_0x1ec077,require(_0xff64('0x3b')));var _0x167d0a=jayson[_0xff64('0x3c')](_0x1ec077)[_0xff64('0x3d')]();var _0x1e235c=config[_0xff64('0x3e')][_0xff64('0x3f')]||config[_0xff64('0x3f')]+0x1;var _0x2f5f5d=config['rpc']['ip']||_0xff64('0x40');_0x167d0a['on']('error',function(_0x29409d){return _0x16ec72(_0x29409d);});_0x167d0a[_0xff64('0x2')](_0x1e235c,_0x2f5f5d,function(){console[_0xff64('0x41')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x2f5f5d,_0x1e235c);require('../config/triggers')['default']();return _0x30fc9f(_0xff64('0x42')+_0x2f5f5d+':'+_0x1e235c);});});}; \ No newline at end of file +var _0xe02e=['../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.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/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/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/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','listen','../config/triggers','lodash'];(function(_0x7ee037,_0x38392b){var _0x450919=function(_0x2b0e45){while(--_0x2b0e45){_0x7ee037['push'](_0x7ee037['shift']());}};_0x450919(++_0x38392b);}(_0xe02e,0x1f0));var _0xee02=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe02e[_0x3b380d];return _0x54502b;};'use strict';var jayson=require('jayson/promise');var _=require(_0xee02('0x0'));var config=require(_0xee02('0x1'));exports['listen']=function(){return new Promise(function(_0x5c7559,_0xb2749a){var _0x1425fc={};_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x4')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x5')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x6')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x7')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x8')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x9')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/memberReport/memberReport.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xa')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xb')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0xc')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xd')));_0x1425fc=_['merge'](_0x1425fc,require('../api/mailAccount/mailAccount.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xe')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xf')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x10')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x11')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x12')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x13')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x14')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/faxInteraction/faxInteraction.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x15')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x16')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x17')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x18')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x19')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1a')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1b')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1c')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x1d')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1e')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1f')));_0x1425fc=_['merge'](_0x1425fc,require('../api/chatMessage/chatMessage.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x20')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x21')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x22')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x23')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x24')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x25')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x26')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x27')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x28')));_0x1425fc=_['merge'](_0x1425fc,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x29')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2a')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/variable/variable.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x2b')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2c')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2d')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2e')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2f')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x30')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x31')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x32')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x33')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x34')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x35')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x36')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x37')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/setting/setting.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x38')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x39')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3a')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/squareMessage/squareMessage.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/campaign/campaign.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3b')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/plugin/plugin.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3c')));_0x1425fc=_['merge'](_0x1425fc,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x3d')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3e')));var _0x2a9b1e=jayson[_0xee02('0x3f')](_0x1425fc)[_0xee02('0x40')]();var _0xf74e30=config[_0xee02('0x41')][_0xee02('0x42')]||config['port']+0x1;var _0x435db9=config[_0xee02('0x41')]['ip']||_0xee02('0x43');_0x2a9b1e['on'](_0xee02('0x44'),function(_0x4940dc){return _0xb2749a(_0x4940dc);});_0x2a9b1e[_0xee02('0x45')](_0xf74e30,_0x435db9,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x435db9,_0xf74e30);require(_0xee02('0x46'))['default']();return _0x5c7559('RPC\x20listening\x20on\x20'+_0x435db9+':'+_0xf74e30);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index df254e6..077e0f1 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 _0x97a0=['setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','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','events','./reply','call','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','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','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97a0,0xc5));var _0x097a=function(_0xe1d0ca,_0x41aba8){_0xe1d0ca=_0xe1d0ca-0x0;var _0x4673a0=_0x97a0[_0xe1d0ca];return _0x4673a0;};'use strict';var util=require(_0x097a('0x0'));var _=require(_0x097a('0x1'));var EventEmitter=require(_0x097a('0x2'))['EventEmitter'];var AGIReply=require(_0x097a('0x3'));var AGIError=require('./error');function AGIChannel(_0x48b5fd){var _0x467242=this,_0x4f28dc=new AGIReply(),_0x4ace0d=![],_0x2e8453={};EventEmitter[_0x097a('0x4')](_0x467242);_0x48b5fd['setEncoding'](_0x097a('0x5'));_0x48b5fd[_0x097a('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4f28dc['setEncoding'](_0x097a('0x5'));_0x4f28dc['on'](_0x097a('0x7'),function(_0x4df636){for(var _0x5d51ef in _0x4df636){_0x467242[_0x5d51ef]=_0x4df636[_0x5d51ef];}_0x467242[_0x097a('0x8')](_0x097a('0x9'));});_0x4f28dc['on'](_0x097a('0xa'),function(_0x3ad4d1){if(_0x3ad4d1[_0x097a('0xb')]()==_0x097a('0xc')){_0x467242[_0x097a('0x8')](_0x097a('0xc'));return;}if(_0x3ad4d1[_0x097a('0xd')](0x0,0xb)==_0x097a('0xe')){_0x4ace0d=!![];}if(_0x4ace0d){_0x2e8453['rx']+=_0x3ad4d1+'\x0a';if(_0x3ad4d1[_0x097a('0xf')](_0x097a('0x10'))!=-0x1){_0x4ace0d=![];}}else{_0x2e8453['rx']=_0x3ad4d1;}if(_0x4ace0d){return;}if(typeof _0x2e8453['cb']=='function'){var _0xe6e399=_0x2e8453['rx']['substring'](0x0,0x3),_0x56772a=null,_0x487bec=null;_0xe6e399=parseInt(_0xe6e399);if(isNaN(_0xe6e399)){_0x2e8453['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x097a('0x11')});return;}if(_0xe6e399!=0xc8){_0x2e8453['cb'](null,{'code':_0xe6e399,'result':-0x1,'extra':'KO'});return;}_0x56772a=_0x2e8453['rx']['substring'](0x4)[_0x097a('0x12')](_0x097a('0x13'),'');if(_0x56772a[_0x097a('0x14')]('\x20')!=-0x1){_0x56772a=_0x56772a['substr'](0x0,_0x56772a['indexOf']('\x20'));}if(_[_0x097a('0x15')](_0x56772a,'-1')){_0x56772a=parseInt(_0x56772a);}_0x487bec=_0x2e8453['rx']['split']('\x20');if(_0x487bec[_0x097a('0x16')]==0x3){_0x487bec=_0x487bec[0x2]['substring'](0x1,_0x487bec[0x2][_0x097a('0x16')]-0x1);}else if(_0x487bec[_0x097a('0x16')]>0x3){var _0x2e7129=/\((.+)\)/;var _0xc64c4=_0x2e8453['rx'][_0x097a('0x17')](_0x2e7129);if(_0xc64c4){_0x487bec=_0xc64c4[0x1];}else{_0x487bec=null;}}else{_0x487bec=null;}_0x2e8453['cb'](null,{'code':_0xe6e399,'result':_0x56772a,'extra':_0x487bec});}});_0x48b5fd['on']('error',function(_0x12d2a1){_0x467242[_0x097a('0x8')](_0x097a('0x18'),new AGIError(_0x097a('0x19'),_0x12d2a1[_0x097a('0x1a')]));});_0x48b5fd['on']('close',function(){_0x467242[_0x097a('0x8')](_0x097a('0x1b'),new AGIError(_0x097a('0x1c')));});_0x48b5fd['on'](_0x097a('0x1d'),function(){_0x467242[_0x097a('0x8')](_0x097a('0x1d'),new AGIError(_0x097a('0x1e')));_0x48b5fd[_0x097a('0x1f')]();});_0x48b5fd[_0x097a('0x20')](_0x4f28dc);this[_0x097a('0x21')]=function(_0x4053ee,_0x33f023){var _0x4053ee=_0x4053ee||'',_0x33f023=typeof _0x33f023=='function'?_0x33f023:new Function();_0x2e8453={'tx':_0x4053ee,'rx':'','cb':_0x33f023};_0x48b5fd[_0x097a('0x22')](_0x4053ee+'\x0a');},this[_0x097a('0x1b')]=function(){_0x48b5fd['destroy']();};}util[_0x097a('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x097a('0x24')][_0x097a('0x25')]=function(_0x2aab3f){return this['command'][_0x097a('0x26')](this,_0x2aab3f);};AGIChannel['prototype'][_0x097a('0x27')]=function(){return this[_0x097a('0x25')](_0x097a('0x28'));};AGIChannel[_0x097a('0x24')][_0x097a('0x29')]=function(_0x48c4b2,_0x487fad,_0x422a9b){_0x48c4b2=_0x48c4b2===undefined?_0x097a('0x2a'):_0x48c4b2;_0x487fad=_0x487fad===undefined?'5':_0x487fad;_0x422a9b=_0x422a9b===undefined?'1':_0x422a9b;return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x2c'),_0x48c4b2,_0x487fad*0x3e8,_0x422a9b));};AGIChannel[_0x097a('0x24')][_0x097a('0x2d')]=function(_0x21192e){_0x21192e=_0x21192e||_0x097a('0x2e');return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x2f'),_0x21192e));};AGIChannel['prototype'][_0x097a('0x30')]=function(_0x3541ab,_0xf1796){if(_[_0x097a('0x31')](_0xf1796)){return this[_0x097a('0x25')](util[_0x097a('0x2b')]('EXEC\x20%s\x20%s',_0x3541ab,_0xf1796['join'](',')));}return this[_0x097a('0x25')](util['format'](_0x097a('0x32'),_0x3541ab,_0xf1796));};AGIChannel[_0x097a('0x24')][_0x097a('0x33')]=function(_0x51d743){return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x34'),_0x51d743));};AGIChannel[_0x097a('0x24')][_0x097a('0x35')]=function(_0x177fe7){return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x36'),_0x177fe7));};AGIChannel[_0x097a('0x24')][_0x097a('0x37')]=function(_0x59b063){return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x38'),_0x59b063));};AGIChannel[_0x097a('0x24')][_0x097a('0xc')]=function(){return this[_0x097a('0x25')](_0x097a('0x39'));};AGIChannel[_0x097a('0x24')][_0x097a('0x3a')]=function(_0x53befd,_0x2baa37){var _0x1429d7=_[_0x097a('0x3b')](_0x2baa37)||_[_0x097a('0x3c')](_0x2baa37)?_0x2baa37[_0x097a('0x3d')]():_0x2baa37;return this['sendRequest'](util[_0x097a('0x2b')](_0x097a('0x3e'),_0x53befd,_0x1429d7?_0x1429d7[_0x097a('0x3d')]()[_0x097a('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x097a('0x24')][_0x097a('0x3f')]=function(_0x3fc755,_0x50adea){return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x40'),_0x3fc755,_0x50adea));};AGIChannel[_0x097a('0x24')][_0x097a('0x41')]=function(_0x4c877e,_0x33cc0f){return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x42'),_0x4c877e,_0x33cc0f));};AGIChannel[_0x097a('0x24')][_0x097a('0x43')]=function(_0x101ee0,_0x4e2117){return this[_0x097a('0x25')](util[_0x097a('0x2b')](_0x097a('0x44'),_0x101ee0,_0x4e2117));};AGIChannel['prototype'][_0x097a('0x45')]=function(_0x31d414,_0x3e7e50,_0x1966a6){_0x3e7e50=_0x3e7e50||this[_0x097a('0x46')];_0x1966a6=_0x1966a6||0x1;this[_0x097a('0x33')](_0x31d414);this[_0x097a('0x35')](_0x3e7e50);this[_0x097a('0x37')](_0x1966a6);return this[_0x097a('0x2d')](util[_0x097a('0x2b')](_0x097a('0x47'),_0x31d414,_0x3e7e50,_0x1966a6));};AGIChannel[_0x097a('0x24')][_0x097a('0x48')]=function(_0x4b4116){return this['sendRequest'](util[_0x097a('0x2b')](_0x097a('0x49'),_0x4b4116));};AGIChannel['prototype']['recordFile']=function(_0x7c140a,_0x57146a,_0x9bb7dd,_0xcb0fd2,_0x4d7a85,_0x24da66){_0x57146a=_0x57146a||_0x097a('0x4a');_0x9bb7dd=_0x9bb7dd||'';_0xcb0fd2=_0xcb0fd2===undefined?-0x1:_0xcb0fd2==='-1'?-0x1:_0xcb0fd2*0x3e8;_0x4d7a85=_0x4d7a85===undefined?'':'s='+_0x4d7a85;_0x24da66=_0x24da66?_0x097a('0x4b'):'';return this[_0x097a('0x25')](util[_0x097a('0x2b')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x7c140a,_0x57146a,_0x9bb7dd,_0xcb0fd2,_0x24da66,_0x4d7a85));};AGIChannel['prototype'][_0x097a('0x4c')]=function(_0x5d621d,_0x323015){_0x323015=_0x323015||'';return this['sendRequest'](util[_0x097a('0x2b')](_0x097a('0x4d'),_0x5d621d,_0x323015));};AGIChannel[_0x097a('0x24')]['agi']=function(_0x1d19f6){return this['exec'](_0x097a('0x4e'),_0x1d19f6);};AGIChannel[_0x097a('0x24')][_0x097a('0x4f')]=function(_0x34334d){return this[_0x097a('0x30')](_0x097a('0x50'),_0x34334d);};AGIChannel[_0x097a('0x24')][_0x097a('0x18')]=function(_0x4cb8b5,_0x4da81e){this[_0x097a('0x2d')](util[_0x097a('0x2b')](_0x097a('0x51'),_0x4cb8b5['id'],_0x4cb8b5[_0x097a('0x52')],_0x4da81e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x097a('0x53')]=AGIChannel; \ No newline at end of file +var _0x86be=['setTimeout','setEncoding','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','inherits','sendRequest','sync','prototype','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','format','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','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','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','utf8'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x86be,0x176));var _0xe86b=function(_0x1a0c1c,_0xcf7748){_0x1a0c1c=_0x1a0c1c-0x0;var _0x5366cc=_0x86be[_0x1a0c1c];return _0x5366cc;};'use strict';var util=require(_0xe86b('0x0'));var _=require('lodash');var EventEmitter=require(_0xe86b('0x1'))[_0xe86b('0x2')];var AGIReply=require(_0xe86b('0x3'));var AGIError=require(_0xe86b('0x4'));function AGIChannel(_0x348267){var _0x3c3b51=this,_0x815b97=new AGIReply(),_0x2ef1e1=![],_0x47ba5d={};EventEmitter['call'](_0x3c3b51);_0x348267['setEncoding'](_0xe86b('0x5'));_0x348267[_0xe86b('0x6')](0x8*0x3c*0x3c*0x3e8);_0x815b97[_0xe86b('0x7')](_0xe86b('0x5'));_0x815b97['on']('headers',function(_0x451793){for(var _0x69d6c9 in _0x451793){_0x3c3b51[_0x69d6c9]=_0x451793[_0x69d6c9];}_0x3c3b51[_0xe86b('0x8')]('ready');});_0x815b97['on'](_0xe86b('0x9'),function(_0x3d4c45){if(_0x3d4c45[_0xe86b('0xa')]()=='hangup'){_0x3c3b51[_0xe86b('0x8')](_0xe86b('0xb'));return;}if(_0x3d4c45[_0xe86b('0xc')](0x0,0xb)==_0xe86b('0xd')){_0x2ef1e1=!![];}if(_0x2ef1e1){_0x47ba5d['rx']+=_0x3d4c45+'\x0a';if(_0x3d4c45[_0xe86b('0xe')](_0xe86b('0xf'))!=-0x1){_0x2ef1e1=![];}}else{_0x47ba5d['rx']=_0x3d4c45;}if(_0x2ef1e1){return;}if(typeof _0x47ba5d['cb']==_0xe86b('0x10')){var _0x1d716d=_0x47ba5d['rx'][_0xe86b('0xc')](0x0,0x3),_0x48c991=null,_0x574825=null;_0x1d716d=parseInt(_0x1d716d);if(isNaN(_0x1d716d)){_0x47ba5d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe86b('0x11')});return;}if(_0x1d716d!=0xc8){_0x47ba5d['cb'](null,{'code':_0x1d716d,'result':-0x1,'extra':'KO'});return;}_0x48c991=_0x47ba5d['rx'][_0xe86b('0xc')](0x4)[_0xe86b('0x12')](_0xe86b('0x13'),'');if(_0x48c991[_0xe86b('0x14')]('\x20')!=-0x1){_0x48c991=_0x48c991[_0xe86b('0x15')](0x0,_0x48c991[_0xe86b('0x14')]('\x20'));}if(_[_0xe86b('0x16')](_0x48c991,'-1')){_0x48c991=parseInt(_0x48c991);}_0x574825=_0x47ba5d['rx'][_0xe86b('0x17')]('\x20');if(_0x574825[_0xe86b('0x18')]==0x3){_0x574825=_0x574825[0x2]['substring'](0x1,_0x574825[0x2][_0xe86b('0x18')]-0x1);}else if(_0x574825['length']>0x3){var _0x3c5ad6=/\((.+)\)/;var _0x180264=_0x47ba5d['rx'][_0xe86b('0x19')](_0x3c5ad6);if(_0x180264){_0x574825=_0x180264[0x1];}else{_0x574825=null;}}else{_0x574825=null;}_0x47ba5d['cb'](null,{'code':_0x1d716d,'result':_0x48c991,'extra':_0x574825});}});_0x348267['on'](_0xe86b('0x1a'),function(_0x1b6f44){_0x3c3b51[_0xe86b('0x8')](_0xe86b('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x1b6f44[_0xe86b('0x1b')]));});_0x348267['on']('close',function(){_0x3c3b51[_0xe86b('0x8')]('close',new AGIError(_0xe86b('0x1c')));});_0x348267['on'](_0xe86b('0x1d'),function(){_0x3c3b51[_0xe86b('0x8')](_0xe86b('0x1d'),new AGIError(_0xe86b('0x1e')));_0x348267[_0xe86b('0x1f')]();});_0x348267['pipe'](_0x815b97);this[_0xe86b('0x20')]=function(_0x145a54,_0x2f3486){var _0x145a54=_0x145a54||'',_0x2f3486=typeof _0x2f3486==_0xe86b('0x10')?_0x2f3486:new Function();_0x47ba5d={'tx':_0x145a54,'rx':'','cb':_0x2f3486};_0x348267['write'](_0x145a54+'\x0a');},this['close']=function(){_0x348267['destroy']();};}util[_0xe86b('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xe86b('0x22')]=function(_0x15f771){return this[_0xe86b('0x20')][_0xe86b('0x23')](this,_0x15f771);};AGIChannel[_0xe86b('0x24')]['answer']=function(){return this[_0xe86b('0x22')]('ANSWER');};AGIChannel[_0xe86b('0x24')][_0xe86b('0x25')]=function(_0x4869df,_0x5d5d44,_0xd1bf16){_0x4869df=_0x4869df===undefined?_0xe86b('0x26'):_0x4869df;_0x5d5d44=_0x5d5d44===undefined?'5':_0x5d5d44;_0xd1bf16=_0xd1bf16===undefined?'1':_0xd1bf16;return this[_0xe86b('0x22')](util['format'](_0xe86b('0x27'),_0x4869df,_0x5d5d44*0x3e8,_0xd1bf16));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x28')]=function(_0x43d168){_0x43d168=_0x43d168||_0xe86b('0x29');return this[_0xe86b('0x22')](util['format'](_0xe86b('0x2a'),_0x43d168));};AGIChannel[_0xe86b('0x24')]['exec']=function(_0x7bcbae,_0x146cc4){if(_['isArray'](_0x146cc4)){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x2c'),_0x7bcbae,_0x146cc4[_0xe86b('0x2d')](',')));}return this['sendRequest'](util['format'](_0xe86b('0x2c'),_0x7bcbae,_0x146cc4));};AGIChannel['prototype'][_0xe86b('0x2e')]=function(_0x348b55){return this[_0xe86b('0x22')](util['format'](_0xe86b('0x2f'),_0x348b55));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x30')]=function(_0x2012f5){return this[_0xe86b('0x22')](util['format'](_0xe86b('0x31'),_0x2012f5));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x32')]=function(_0x5af3d0){return this['sendRequest'](util[_0xe86b('0x2b')](_0xe86b('0x33'),_0x5af3d0));};AGIChannel['prototype'][_0xe86b('0xb')]=function(){return this['sendRequest'](_0xe86b('0x34'));};AGIChannel[_0xe86b('0x24')]['setVariable']=function(_0x1657f5,_0x115536){var _0x53a536=_[_0xe86b('0x35')](_0x115536)||_[_0xe86b('0x36')](_0x115536)?_0x115536['toString']():_0x115536;return this[_0xe86b('0x22')](util[_0xe86b('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1657f5,_0x53a536?_0x53a536[_0xe86b('0x37')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xe86b('0x38')]=function(_0x3aa95e,_0x401292){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x3aa95e,_0x401292));};AGIChannel[_0xe86b('0x24')]['sayDigits']=function(_0x1ac9b1,_0x5c0283){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x39'),_0x1ac9b1,_0x5c0283));};AGIChannel['prototype'][_0xe86b('0x3a')]=function(_0x19d010,_0x4c13ec){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x3b'),_0x19d010,_0x4c13ec));};AGIChannel[_0xe86b('0x24')]['continueAt']=function(_0x2266f2,_0x4a6a31,_0x300f50){_0x4a6a31=_0x4a6a31||this['extension'];_0x300f50=_0x300f50||0x1;this[_0xe86b('0x2e')](_0x2266f2);this[_0xe86b('0x30')](_0x4a6a31);this[_0xe86b('0x32')](_0x300f50);return this['noop'](util[_0xe86b('0x2b')](_0xe86b('0x3c'),_0x2266f2,_0x4a6a31,_0x300f50));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x3d')]=function(_0x4e5ad3){return this[_0xe86b('0x22')](util['format'](_0xe86b('0x3e'),_0x4e5ad3));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x3f')]=function(_0x1a1470,_0x3334c3,_0xf6e09,_0x1fd2e1,_0xbbdf18,_0x25fa8a){_0x3334c3=_0x3334c3||_0xe86b('0x40');_0xf6e09=_0xf6e09||'';_0x1fd2e1=_0x1fd2e1===undefined?-0x1:_0x1fd2e1==='-1'?-0x1:_0x1fd2e1*0x3e8;_0xbbdf18=_0xbbdf18===undefined?'':'s='+_0xbbdf18;_0x25fa8a=_0x25fa8a?_0xe86b('0x41'):'';return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x42'),_0x1a1470,_0x3334c3,_0xf6e09,_0x1fd2e1,_0x25fa8a,_0xbbdf18));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x43')]=function(_0x17f0a3,_0x2e08ad){_0x2e08ad=_0x2e08ad||'';return this[_0xe86b('0x22')](util[_0xe86b('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x17f0a3,_0x2e08ad));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x44')]=function(_0x23e0ba){return this[_0xe86b('0x45')](_0xe86b('0x46'),_0x23e0ba);};AGIChannel[_0xe86b('0x24')][_0xe86b('0x47')]=function(_0x4fae41){return this['exec'](_0xe86b('0x48'),_0x4fae41);};AGIChannel[_0xe86b('0x24')][_0xe86b('0x1a')]=function(_0x35b72d,_0x1f577f){this['noop'](util[_0xe86b('0x2b')](_0xe86b('0x49'),_0x35b72d['id'],_0x35b72d[_0xe86b('0x4a')],_0x1f577f));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe86b('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 17ebae3..c275a20 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 _0xc239=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','exports','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xc239,0x1b8));var _0x9c23=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc239[_0x346737];return _0x1ade2e;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x9c23('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x9c23('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x9c23('0x2'),'E_AGI_SOCKET_ERROR':_0x9c23('0x3'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x9c23('0x4'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9c23('0x5'),'E_AGI_IVR_ENTRY':_0x9c23('0x6')};function AGIError(_0x3851e4){var _0x3851e4=_0x3851e4||null,_0x1bc93f=_0x1bc93f||[],_0x426fbf=0x1,_0x1f7783='';if(!error[_0x3851e4]){_0x3851e4=_0x9c23('0x7');}_0x1bc93f[_0x9c23('0x8')](error[_0x3851e4]);while(arguments[_0x426fbf]){_0x1bc93f[_0x9c23('0x8')](arguments[_0x426fbf]);_0x426fbf++;}_0x1f7783=util['format'][_0x9c23('0x9')](util,_0x1bc93f);this[_0x9c23('0xa')]=_0x1f7783;this[_0x9c23('0xb')]=_0x3851e4;}module[_0x9c23('0xc')]=AGIError; \ No newline at end of file +var _0x28e7=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x5d43fa,_0x2906cc){var _0x94d13d=function(_0x19d923){while(--_0x19d923){_0x5d43fa['push'](_0x5d43fa['shift']());}};_0x94d13d(++_0x2906cc);}(_0x28e7,0x94));var _0x728e=function(_0x5f14c9,_0x643aa3){_0x5f14c9=_0x5f14c9-0x0;var _0x15f67c=_0x28e7[_0x5f14c9];return _0x15f67c;};'use strict';var util=require(_0x728e('0x0'));var error={'E_AGI_UNDEFINED':_0x728e('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x728e('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x728e('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x728e('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x728e('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x728e('0x6'),'E_AGI_COMMAND_EMPTY':_0x728e('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x728e('0x8'),'E_AGI_IVR_ENTRY':_0x728e('0x9')};function AGIError(_0x476f21){var _0x476f21=_0x476f21||null,_0x43a816=_0x43a816||[],_0x51c377=0x1,_0x53fc9a='';if(!error[_0x476f21]){_0x476f21=_0x728e('0xa');}_0x43a816[_0x728e('0xb')](error[_0x476f21]);while(arguments[_0x51c377]){_0x43a816[_0x728e('0xb')](arguments[_0x51c377]);_0x51c377++;}_0x53fc9a=util[_0x728e('0xc')][_0x728e('0xd')](util,_0x43a816);this[_0x728e('0xe')]=_0x53fc9a;this[_0x728e('0xf')]=_0x476f21;}module[_0x728e('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index ddfab8e..5cb71be 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 _0xc47d=['ioredis','../../config/environment','redis','defaults','subscribe','agi','error','message','emit','projectUpdate','E_AGI_SERVER_ERROR','exports','lodash','events','EventEmitter'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xc47d,0x147));var _0xdc47=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xc47d[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0xdc47('0x0'));var EventEmitter=require(_0xdc47('0x1'))[_0xdc47('0x2')];var Redis=require(_0xdc47('0x3'));var AGIError=require('./error');var config=require(_0xdc47('0x4'));config[_0xdc47('0x5')]=_[_0xdc47('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xdc47('0x7')](_0xdc47('0x8'),function(_0x3e1765){if(_0x3e1765)return eventEmitter['emit'](_0xdc47('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x3e1765));});sub['on'](_0xdc47('0xa'),function(_0x1bd838,_0x2f6879){if(_0x1bd838!=='agi')return;try{var _0x30b3df=JSON['parse'](_0x2f6879);eventEmitter[_0xdc47('0xb')](_0xdc47('0xc'),_0x30b3df);}catch(_0x4c7f4d){eventEmitter[_0xdc47('0xb')](_0xdc47('0x9'),new AGIError(_0xdc47('0xd'),_0x4c7f4d));}});module[_0xdc47('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x14bf=['../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x14bf,0x1f3));var _0xf14b=function(_0x5f3295,_0x123fbc){_0x5f3295=_0x5f3295-0x0;var _0x555ccc=_0x14bf[_0x5f3295];return _0x555ccc;};'use strict';var _=require(_0xf14b('0x0'));var EventEmitter=require(_0xf14b('0x1'))[_0xf14b('0x2')];var Redis=require(_0xf14b('0x3'));var AGIError=require(_0xf14b('0x4'));var config=require(_0xf14b('0x5'));config[_0xf14b('0x6')]=_[_0xf14b('0x7')](config['redis'],{'host':_0xf14b('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xf14b('0x6')]);sub[_0xf14b('0x9')](_0xf14b('0xa'),function(_0x1be84e){if(_0x1be84e)return eventEmitter[_0xf14b('0xb')](_0xf14b('0xc'),new AGIError(_0xf14b('0xd'),_0x1be84e));});sub['on'](_0xf14b('0xe'),function(_0x342d1e,_0x12b6ee){if(_0x342d1e!==_0xf14b('0xa'))return;try{var _0x58babd=JSON[_0xf14b('0xf')](_0x12b6ee);eventEmitter['emit'](_0xf14b('0x10'),_0x58babd);}catch(_0x53da11){eventEmitter[_0xf14b('0xb')]('error',new AGIError(_0xf14b('0xd'),_0x53da11));}});module[_0xf14b('0x11')]={'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 b08cde6..aed78e8 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 _0x5c00=['agicommand','vswitch','target','default','includes','max\x20retry\x20reach','condition\x20not\x20found','../../../config/logger','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addEdge','push','size','vertices','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0x5c00,0x1ed));var _0x05c0=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x5c00[_0x243217];return _0x478029;};'use strict';var _=require('lodash');var logger=require(_0x05c0('0x0'))('agi');var verticesWithRetry=[_0x05c0('0x1'),_0x05c0('0x2'),_0x05c0('0x3')];var Graph=function(){this['vertices']={};this[_0x05c0('0x4')]={};this[_0x05c0('0x5')]=0x0;};Graph[_0x05c0('0x6')]['addVertex']=function(_0x2cfd9e){this['vertices'][_0x2cfd9e['id']]=_0x2cfd9e;this[_0x05c0('0x4')][_0x2cfd9e['id']]=[];};Graph[_0x05c0('0x6')][_0x05c0('0x7')]=function(_0x4e383f,_0x48f0fa,_0x4868e5){this['edges'][_0x4e383f][_0x05c0('0x8')]({'target':_0x48f0fa,'condition':_0x4868e5});this[_0x05c0('0x5')]+=0x1;};Graph[_0x05c0('0x6')][_0x05c0('0x9')]=function(){return _[_0x05c0('0x9')](this[_0x05c0('0xa')]);};Graph[_0x05c0('0x6')][_0x05c0('0xb')]=function(){return this[_0x05c0('0x5')];};Graph[_0x05c0('0x6')][_0x05c0('0xc')]=function(_0x439adc){return this[_0x05c0('0xa')][_0x439adc];};Graph[_0x05c0('0x6')][_0x05c0('0xd')]=function(_0x5daaf7,_0x3365d6){if(!this[_0x05c0('0xa')][_0x5daaf7]){return logger[_0x05c0('0xe')]('no\x20vertex\x20found');}var _0x3220ca=_0x3365d6(this[_0x05c0('0xa')][_0x5daaf7]);if(!_0x3220ca){return logger['info'](_0x05c0('0xf'));}if(this[_0x05c0('0x4')][_0x5daaf7][_0x05c0('0x10')]===0x0){return logger['info'](_0x05c0('0x11'));}for(var _0x1a071e=0x0,_0x15911e=[],_0x17cc0d=![];_0x1a071e\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','find','handleNotFound','production','handleUnpublished','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server','connection','close','lodash','syncho','util','../../config/environment','../../config/logger','./project','./events','EventEmitter','defaults','agi','127.0.0.1','projectUpdate','nextTick','stack','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name'];(function(_0x42aff5,_0x2def5a){var _0x424bf0=function(_0x40e685){while(--_0x40e685){_0x42aff5['push'](_0x42aff5['shift']());}};_0x424bf0(++_0x2def5a);}(_0xdfbd,0x1be));var _0xddfb=function(_0x57f68c,_0x598838){_0x57f68c=_0x57f68c-0x0;var _0x37956d=_0xdfbd[_0x57f68c];return _0x37956d;};'use strict';var _=require(_0xddfb('0x0'));var syncho=require(_0xddfb('0x1'));var util=require(_0xddfb('0x2'));var config=require(_0xddfb('0x3'));var logger=require(_0xddfb('0x4'))('agi');var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0xddfb('0x5'));var AGIEmitter=require(_0xddfb('0x6'))[_0xddfb('0x7')];var projects=[];config['agi']=_[_0xddfb('0x8')](config[_0xddfb('0x9')],{'ip':_0xddfb('0xa'),'port':0x11dd});AGIEmitter['on'](_0xddfb('0xb'),projectUpdateHandler);function connectionHandler(_0xb32bd4){process[_0xddfb('0xc')](function(){syncho(function(){try{setChannelVariables(_0xb32bd4);agiHandler(_0xb32bd4);}catch(_0x444c07){logger['error'](_0x444c07[_0xddfb('0xd')]);}});});}function projectUpdateHandler(_0xb4ef0c){try{var _0x348bb0=_['findIndex'](projects,['id',_0xb4ef0c['id']]);if(_0x348bb0>-0x1){if(_0xb4ef0c['deleted']===!![]){projects['splice'](_0x348bb0,0x1);}else{projects[_0x348bb0]=_0xb4ef0c;}}else{projects['push'](_0xb4ef0c);}}catch(_0x3974d0){logger[_0xddfb('0xe')](_0x3974d0['stack']);}}function listeningHandler(){console[_0xddfb('0xf')](_0xddfb('0x10'),config[_0xddfb('0x9')][_0xddfb('0x11')]);logger[_0xddfb('0x12')](util[_0xddfb('0x13')](_0xddfb('0x14'),config[_0xddfb('0x9')]['ip'],config[_0xddfb('0x9')]['port']));}function errorHandler(_0x2391cb){if(_0x2391cb&&_0x2391cb[_0xddfb('0x15')]&&_0x2391cb[_0xddfb('0x16')]){logger['error'](util[_0xddfb('0x13')]('[%s]\x20%s',_0x2391cb['name'],_0x2391cb[_0xddfb('0x16')]));}else{logger[_0xddfb('0xe')](util[_0xddfb('0x13')]('[ERROR]\x20%s',_0x2391cb['stack']));}}function closeHandler(){logger[_0xddfb('0x12')](util[_0xddfb('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xddfb('0x17')],this[_0xddfb('0x18')],this[_0xddfb('0x19')],this[_0xddfb('0x1a')],this[_0xddfb('0x1b')]));try{createSquareReport(this);}catch(_0x1b57a9){logger[_0xddfb('0xe')](_0x1b57a9[_0xddfb('0xd')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xddfb('0x18')],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xddfb('0x13')](_0xddfb('0x1c'),this[_0xddfb('0x17')],this['calleridname'],this['callerid'],this[_0xddfb('0x1a')],this[_0xddfb('0x1b')]));this[_0xddfb('0x1d')]=!![];}function createSquareReport(_0x3a15f6,_0x2be202){rpc[_0xddfb('0x1e')](_0x3a15f6)[_0xddfb('0x1f')](function(_0x373c17){if(_0x2be202){_0x2be202(null,_0x373c17);}})[_0xddfb('0x20')](function(_0xc8c4c8){if(_0x2be202){_0x2be202(null,_0xc8c4c8);}});}function setChannelVariables(_0x2c15eb){for(var _0x4cd09d in _0x2c15eb){if(_0x2c15eb[_0xddfb('0x21')](_0x4cd09d)){if(_0x4cd09d[_0xddfb('0x22')](_0xddfb('0x23'))===0x0){_0x2c15eb[_0x4cd09d[_0xddfb('0x24')](0x4)]=_0x2c15eb[_0x4cd09d];delete _0x2c15eb[_0x4cd09d];}}}}function agiHandler(_0x15cbac){logger['debug']('variables',JSON[_0xddfb('0x25')](_0x15cbac,null,0x2));logger['info'](util[_0xddfb('0x13')](_0xddfb('0x26'),_0x15cbac['arg_1'],_0x15cbac['calleridname'],_0x15cbac[_0xddfb('0x19')],_0x15cbac[_0xddfb('0x1a')],_0x15cbac['uniqueid']));_0x15cbac['on']('error',errorHandler);_0x15cbac['on']('close',closeHandler);_0x15cbac['on']('timeout',timeoutHandler);_0x15cbac[_0xddfb('0x1d')]=![];_0x15cbac['on']('hangup',hangupHandler);var _0x28a395=_[_0xddfb('0x27')](projects,[_0xddfb('0x15'),_0x15cbac[_0xddfb('0x17')]]);if(!_0x28a395)return Project[_0xddfb('0x28')](_0x15cbac);if(!_0x28a395[_0xddfb('0x29')])return Project[_0xddfb('0x2a')](_0x15cbac);return Project['initialize'](_0x28a395,_0x15cbac);}function main(){var _0x2dd2d4;return utilLicense['getLicense']()[_0xddfb('0x1f')](function(_0x20bf88){if(!_0x20bf88)return;if(_0x20bf88['voice']){if(_0x20bf88[_0xddfb('0x2b')]&&_0x20bf88['callysquare']>0x0){logger['info'](util[_0xddfb('0x13')](_0xddfb('0x2c'),_0x20bf88[_0xddfb('0x2b')]));_0x2dd2d4=_0x20bf88[_0xddfb('0x2b')];}else{logger[_0xddfb('0x12')](_0xddfb('0x2d'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x2dd2d4=-0x1;}})[_0xddfb('0x1f')](function(){return Project[_0xddfb('0x2e')]();})['then'](function(_0x45a102){projects=_0x45a102;return;})['catch'](function(_0x23328a){logger[_0xddfb('0xe')](_0xddfb('0x2f'),_0x23328a['stack']);})[_0xddfb('0x30')](function(){var _0x896785=require(_0xddfb('0x31'))(config['agi'][_0xddfb('0x11')],config[_0xddfb('0x9')]['ip'],_0x2dd2d4);_0x896785['on'](_0xddfb('0xe'),errorHandler);_0x896785['on']('listening',listeningHandler);_0x896785['on'](_0xddfb('0x32'),connectionHandler);_0x896785['on'](_0xddfb('0x33'),closeHandler);});}main(); \ No newline at end of file +var _0x16c3=['initialize','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','finally','listening','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','message','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','evtHangup','find','handleNotFound','handleUnpublished'];(function(_0x1205f8,_0x3e9e32){var _0x7e9648=function(_0x1135ce){while(--_0x1135ce){_0x1205f8['push'](_0x1205f8['shift']());}};_0x7e9648(++_0x3e9e32);}(_0x16c3,0x1f0));var _0x316c=function(_0xcb38a4,_0xd92302){_0xcb38a4=_0xcb38a4-0x0;var _0x4a86be=_0x16c3[_0xcb38a4];return _0x4a86be;};'use strict';var _=require('lodash');var syncho=require(_0x316c('0x0'));var util=require(_0x316c('0x1'));var config=require('../../config/environment');var logger=require(_0x316c('0x2'))(_0x316c('0x3'));var utilLicense=require(_0x316c('0x4'));var rpc=require(_0x316c('0x5'));var Project=require(_0x316c('0x6'));var AGIEmitter=require(_0x316c('0x7'))['EventEmitter'];var projects=[];config[_0x316c('0x3')]=_['defaults'](config[_0x316c('0x3')],{'ip':_0x316c('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0xaeddf3){process[_0x316c('0x9')](function(){syncho(function(){try{setChannelVariables(_0xaeddf3);agiHandler(_0xaeddf3);}catch(_0xa0732b){logger[_0x316c('0xa')](_0xa0732b[_0x316c('0xb')]);}});});}function projectUpdateHandler(_0xe6bad7){try{var _0xeee72b=_[_0x316c('0xc')](projects,['id',_0xe6bad7['id']]);if(_0xeee72b>-0x1){if(_0xe6bad7[_0x316c('0xd')]===!![]){projects[_0x316c('0xe')](_0xeee72b,0x1);}else{projects[_0xeee72b]=_0xe6bad7;}}else{projects[_0x316c('0xf')](_0xe6bad7);}}catch(_0x2aa39e){logger[_0x316c('0xa')](_0x2aa39e[_0x316c('0xb')]);}}function listeningHandler(){console[_0x316c('0x10')](_0x316c('0x11'),config[_0x316c('0x3')][_0x316c('0x12')]);logger['info'](util[_0x316c('0x13')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x316c('0x3')]['ip'],config['agi'][_0x316c('0x12')]));}function errorHandler(_0xa89fcc){if(_0xa89fcc&&_0xa89fcc[_0x316c('0x14')]&&_0xa89fcc[_0x316c('0x15')]){logger[_0x316c('0xa')](util[_0x316c('0x13')](_0x316c('0x16'),_0xa89fcc[_0x316c('0x14')],_0xa89fcc[_0x316c('0x15')]));}else{logger['error'](util['format'](_0x316c('0x17'),_0xa89fcc['stack']));}}function closeHandler(){logger[_0x316c('0x18')](util[_0x316c('0x13')](_0x316c('0x19'),this[_0x316c('0x1a')],this['calleridname'],this[_0x316c('0x1b')],this[_0x316c('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x55819e){logger['error'](_0x55819e[_0x316c('0xb')]);}}function timeoutHandler(){logger[_0x316c('0x18')](util[_0x316c('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x316c('0x1a')],this[_0x316c('0x1d')],this[_0x316c('0x1b')],this[_0x316c('0x1c')],this[_0x316c('0x1e')]));}function hangupHandler(){logger[_0x316c('0x18')](util[_0x316c('0x13')](_0x316c('0x1f'),this[_0x316c('0x1a')],this['calleridname'],this[_0x316c('0x1b')],this['dnid'],this[_0x316c('0x1e')]));this['evtHangup']=!![];}function createSquareReport(_0x34a017,_0x32f9a1){rpc[_0x316c('0x20')](_0x34a017)['then'](function(_0x337b1f){if(_0x32f9a1){_0x32f9a1(null,_0x337b1f);}})['catch'](function(_0x202e0d){if(_0x32f9a1){_0x32f9a1(null,_0x202e0d);}});}function setChannelVariables(_0x24f35c){for(var _0x7a6654 in _0x24f35c){if(_0x24f35c[_0x316c('0x21')](_0x7a6654)){if(_0x7a6654[_0x316c('0x22')](_0x316c('0x23'))===0x0){_0x24f35c[_0x7a6654[_0x316c('0x24')](0x4)]=_0x24f35c[_0x7a6654];delete _0x24f35c[_0x7a6654];}}}}function agiHandler(_0x5af912){logger[_0x316c('0x25')](_0x316c('0x26'),JSON[_0x316c('0x27')](_0x5af912,null,0x2));logger[_0x316c('0x18')](util[_0x316c('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5af912['arg_1'],_0x5af912[_0x316c('0x1d')],_0x5af912[_0x316c('0x1b')],_0x5af912[_0x316c('0x1c')],_0x5af912['uniqueid']));_0x5af912['on'](_0x316c('0xa'),errorHandler);_0x5af912['on']('close',closeHandler);_0x5af912['on']('timeout',timeoutHandler);_0x5af912[_0x316c('0x28')]=![];_0x5af912['on']('hangup',hangupHandler);var _0x1a321f=_[_0x316c('0x29')](projects,[_0x316c('0x14'),_0x5af912[_0x316c('0x1a')]]);if(!_0x1a321f)return Project[_0x316c('0x2a')](_0x5af912);if(!_0x1a321f['production'])return Project[_0x316c('0x2b')](_0x5af912);return Project[_0x316c('0x2c')](_0x1a321f,_0x5af912);}function main(){var _0x57751e;return utilLicense[_0x316c('0x2d')]()['then'](function(_0x2f950f){if(!_0x2f950f)return;if(_0x2f950f[_0x316c('0x2e')]){if(_0x2f950f['callysquare']&&_0x2f950f['callysquare']>0x0){logger[_0x316c('0x18')](util[_0x316c('0x13')](_0x316c('0x2f'),_0x2f950f[_0x316c('0x30')]));_0x57751e=_0x2f950f[_0x316c('0x30')];}else{logger[_0x316c('0x18')](_0x316c('0x31'));}}else{logger[_0x316c('0x18')](_0x316c('0x32'));_0x57751e=-0x1;}})['then'](function(){return Project['getAll']();})['then'](function(_0x406cf6){projects=_0x406cf6;return;})[_0x316c('0x33')](function(_0x5a6d4a){logger[_0x316c('0xa')]('[LICENSE]',_0x5a6d4a['stack']);})[_0x316c('0x34')](function(){var _0x3883b8=require('./server')(config[_0x316c('0x3')]['port'],config[_0x316c('0x3')]['ip'],_0x57751e);_0x3883b8['on'](_0x316c('0xa'),errorHandler);_0x3883b8['on'](_0x316c('0x35'),listeningHandler);_0x3883b8['on']('connection',connectionHandler);_0x3883b8['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 aeb259a..31f5b52 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 _0xcdb0=['jayson/promise','client','request','then','error','message','result','sendMailMessage','bluebird'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0xcdb0,0x14c));var _0x0cdb=function(_0x52614e,_0x565d32){_0x52614e=_0x52614e-0x0;var _0x179e06=_0xcdb0[_0x52614e];return _0x179e06;};'use strict';var BPromise=require(_0x0cdb('0x0'));var jayson=require(_0x0cdb('0x1'));var client=jayson[_0x0cdb('0x2')]['http']({'port':0x232b});function request(_0xddf66d,_0x4c2b8e){return new BPromise(function(_0xc4f363,_0x483b73){return client[_0x0cdb('0x3')](_0xddf66d,_0x4c2b8e)[_0x0cdb('0x4')](function(_0x384feb){if(_0x384feb[_0x0cdb('0x5')]){return _0x483b73(_0x384feb[_0x0cdb('0x5')][_0x0cdb('0x6')]);}else{return _0xc4f363(_0x384feb[_0x0cdb('0x7')]);}})['catch'](function(_0x5548ea){return _0x483b73(_0x5548ea);});});}exports[_0x0cdb('0x8')]=function(_0x2f0f2d,_0x13aacf){return request('SendMail',{'account':_0x2f0f2d,'message':_0x13aacf});}; \ No newline at end of file +var _0xed89=['catch','client','error','message','result'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xed89,0x14b));var _0x9ed8=function(_0x208832,_0x9d6d2b){_0x208832=_0x208832-0x0;var _0x50269d=_0xed89[_0x208832];return _0x50269d;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x9ed8('0x0')]['http']({'port':0x232b});function request(_0x3dd90f,_0x2c53cc){return new BPromise(function(_0x9b1457,_0x1f9d4f){return client['request'](_0x3dd90f,_0x2c53cc)['then'](function(_0x530ea3){if(_0x530ea3[_0x9ed8('0x1')]){return _0x1f9d4f(_0x530ea3[_0x9ed8('0x1')][_0x9ed8('0x2')]);}else{return _0x9b1457(_0x530ea3[_0x9ed8('0x3')]);}})[_0x9ed8('0x4')](function(_0xb5da32){return _0x1f9d4f(_0xb5da32);});});}exports['sendMailMessage']=function(_0x18db5b,_0x211126){return request('SendMail',{'account':_0x18db5b,'message':_0x211126});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 60e4a0e..77b68e4 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 _0x9710=['length','source','target','value','toJson','mxGraphModel','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','extension','priority','response','code','evtHangup','isUndefined','result','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','traverseBFS','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','context','close','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray'];(function(_0x134498,_0x500cb6){var _0x4f7f16=function(_0x5a1d2c){while(--_0x5a1d2c){_0x134498['push'](_0x134498['shift']());}};_0x4f7f16(++_0x500cb6);}(_0x9710,0xac));var _0x0971=function(_0x18cef4,_0x42aa03){_0x18cef4=_0x18cef4-0x0;var _0x40b616=_0x9710[_0x18cef4];return _0x40b616;};'use strict';var _=require(_0x0971('0x0'));var moment=require(_0x0971('0x1'));var parser=require(_0x0971('0x2'));var util=require(_0x0971('0x3'));var logger=require(_0x0971('0x4'))(_0x0971('0x5'));var rpc=require(_0x0971('0x6'));var mailRpc=require(_0x0971('0x7'));var Graph=require(_0x0971('0x8'));var Vertices=require(_0x0971('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x0971('0xa')]()[_0x0971('0xb')](function(_0x6e815b){logger[_0x0971('0xc')](_0x0971('0xd'),_0x6e815b[_0x0971('0xe')]);return[];});}function addVertex(_0x4123bd,_0x503ef6,_0x5c05cc){_0x503ef6[_0x0971('0xf')]=_0x5c05cc;if(_0x503ef6['hasOwnProperty'](_0x0971('0x10'))){_0x503ef6[_0x0971('0x11')]=parseInt(_0x503ef6['retry'],0xa);}_0x4123bd[_0x0971('0x12')](_[_0x0971('0x13')](_0x503ef6,_0x0971('0x14')));}function initGraph(_0x1ace06,_0x29a93a){var _0xcb3ac0=new Graph();for(var _0x281fe0 in _0x1ace06){if(_0x1ace06[_0x0971('0x15')](_0x281fe0)){if(_[_0x0971('0x16')](_0x1ace06[_0x281fe0])){for(var _0x2e9b72=0x0;_0x2e9b72<_0x1ace06[_0x281fe0][_0x0971('0x17')];_0x2e9b72+=0x1){addVertex(_0xcb3ac0,_0x1ace06[_0x281fe0][_0x2e9b72],_0x281fe0);}}else{addVertex(_0xcb3ac0,_0x1ace06[_0x281fe0],_0x281fe0);}}}for(var _0x22f35b=0x0;_0x22f35b<_0x29a93a[_0x0971('0x17')];_0x22f35b+=0x1){if(_0x29a93a[_0x22f35b][_0x0971('0x18')]&&_0x29a93a[_0x22f35b][_0x0971('0x19')]){_0xcb3ac0['addEdge'](_0x29a93a[_0x22f35b][_0x0971('0x18')],_0x29a93a[_0x22f35b][_0x0971('0x19')],_0x29a93a[_0x22f35b][_0x0971('0x1a')]);}}return _0xcb3ac0;}function getRoot(_0x541abf){return parser[_0x0971('0x1b')](_0x541abf,{'object':!![]})[_0x0971('0x1c')]['root'];}function inspect(_0x116128){return util[_0x0971('0x1d')](_0x116128,{'showHidden':![],'depth':null});}function initialize(_0x45c9a2,_0x11e72f){var _0x4b60a4=getRoot(_0x45c9a2[_0x0971('0x1e')]);if(!_0x4b60a4||!_0x4b60a4[_0x0971('0x1f')])return;var _0x13ed91,_0x103b4f,_0x3c452a;logger[_0x0971('0x20')]('root',JSON[_0x0971('0x21')](_0x4b60a4,null,0x2));_0x11e72f[_0x0971('0x22')]=moment()[_0x0971('0x23')](_0x0971('0x24'));_0x13ed91=initGraph(_[_0x0971('0x13')](_0x4b60a4,_0x0971('0x14')),_0x4b60a4['mxCell']);_0x103b4f=new Vertices(_0x11e72f,rpc,mailRpc);logger[_0x0971('0x25')](util[_0x0971('0x23')](_0x0971('0x26'),_0x11e72f[_0x0971('0x27')],_0x11e72f[_0x0971('0x28')],_0x11e72f[_0x0971('0x29')],_0x11e72f['dnid'],_0x11e72f[_0x0971('0x2a')]));_0x13ed91['traverseBFS'](_0x4b60a4[_0x0971('0x1f')]['id'],function(_0x3ade4b){try{_0x3ade4b=_0x103b4f[_0x0971('0x2b')](_0x3ade4b);logger['debug'](_0x0971('0x2c'),JSON[_0x0971('0x21')](_0x3ade4b,null,0x2));if(_0x3ade4b['agicommand']===_0x0971('0x2d')){logger[_0x0971('0x25')](_0x0971('0x2e'));_0x11e72f['context']=_0x3ade4b['context']||_0x11e72f['context'];_0x11e72f['extension']=_0x3ade4b[_0x0971('0x2f')];_0x11e72f[_0x0971('0x30')]=_0x3ade4b[_0x0971('0x30')]?_0x3ade4b['priority']-0x1:0x1;return null;}else if(_0x3ade4b&&_0x103b4f[_0x3ade4b[_0x0971('0xf')]]){_0x3c452a=_0x103b4f[_0x3ade4b['agicommand']](_0x3ade4b);logger[_0x0971('0x25')](_0x0971('0x31'),JSON[_0x0971('0x21')](_0x3c452a,null,0x2));if(_0x3c452a&&_0x3c452a[_0x0971('0x32')]===AGI_CODE_SUCCESS&&_0x3c452a['result']!==AGI_RESULT_ERROR&&!_0x11e72f[_0x0971('0x33')]){logger[_0x0971('0x20')](_0x0971('0x31'),inspect(_0x3c452a));return _[_0x0971('0x34')](_0x3c452a['result'])?null:_0x3c452a[_0x0971('0x35')]['toString']();}else{logger[_0x0971('0xc')](_0x0971('0x31'),inspect(_0x3c452a));return null;}}else{logger[_0x0971('0xc')](_0x0971('0x36'));return null;}}catch(_0xec1aef){logger['error'](_0xec1aef[_0x0971('0xe')]);return null;}});if(_0x4b60a4['finally']){logger['info'](util['format'](_0x0971('0x37'),_0x11e72f[_0x0971('0x27')],_0x11e72f['calleridname'],_0x11e72f[_0x0971('0x29')],_0x11e72f[_0x0971('0x38')],_0x11e72f[_0x0971('0x2a')]));_0x13ed91[_0x0971('0x39')](_0x4b60a4[_0x0971('0x3a')]['id'],function(_0x39a654){try{_0x39a654=_0x103b4f[_0x0971('0x2b')](_0x39a654);logger[_0x0971('0x20')](_0x0971('0x2c'),JSON[_0x0971('0x21')](_0x39a654,null,0x2));if(_0x39a654&&_0x103b4f[_0x39a654[_0x0971('0xf')]]){_0x3c452a=_0x103b4f[_0x39a654['agicommand']](_0x39a654);if(_0x3c452a){logger[_0x0971('0x20')](_0x0971('0x31'),inspect(_0x3c452a));return _['isUndefined'](_0x3c452a[_0x0971('0x35')])?null:_0x3c452a['result']['toString']();}else{logger['error'](_0x0971('0x31'),inspect(_0x3c452a));return null;}}else{logger['error'](_0x0971('0x36'));return null;}}catch(_0x45497f){logger[_0x0971('0xc')](_0x45497f[_0x0971('0xe')]);return null;}});}logger[_0x0971('0x25')](util[_0x0971('0x23')](_0x0971('0x3b'),_0x11e72f[_0x0971('0x27')],_0x11e72f[_0x0971('0x28')],_0x11e72f[_0x0971('0x29')],_0x11e72f[_0x0971('0x38')],_0x11e72f[_0x0971('0x2a')]));logger[_0x0971('0x25')](util[_0x0971('0x23')](_0x0971('0x3c'),_0x11e72f['context'],_0x11e72f['extension'],parseInt(_0x11e72f[_0x0971('0x30')],0xa)+0x1));_0x11e72f[_0x0971('0x3d')](_0x11e72f[_0x0971('0x3e')],_0x11e72f[_0x0971('0x2f')],parseInt(_0x11e72f[_0x0971('0x30')],0xa)+0x1);_0x11e72f[_0x0971('0x3f')]();}function handleNotFound(_0x1cddf9){logger['error'](util[_0x0971('0x23')]('Project\x20%s\x20not\x20found',_0x1cddf9[_0x0971('0x27')]));_0x1cddf9[_0x0971('0x3d')](_0x1cddf9[_0x0971('0x3e')],_0x1cddf9['extension'],parseInt(_0x1cddf9['priority'],0xa)+0x1);_0x1cddf9[_0x0971('0x3f')]();}function handleUnpublished(_0x4b34d4){logger[_0x0971('0xc')](util[_0x0971('0x23')]('Project\x20%s\x20not\x20published',_0x4b34d4[_0x0971('0x27')]));_0x4b34d4[_0x0971('0x3d')](_0x4b34d4[_0x0971('0x3e')],_0x4b34d4['extension'],parseInt(_0x4b34d4['priority'],0xa)+0x1);_0x4b34d4[_0x0971('0x3f')]();}module[_0x0971('0x40')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x37ed=['[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','moment','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','clear','vertex','stringify','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','toString','response','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','traverseBFS','agicommand\x20not\x20found'];(function(_0x4da4ea,_0x2875d3){var _0x3cc102=function(_0x5549c2){while(--_0x5549c2){_0x4da4ea['push'](_0x4da4ea['shift']());}};_0x3cc102(++_0x2875d3);}(_0x37ed,0xc9));var _0xd37e=function(_0x4d45d6,_0x2c74f0){_0x4d45d6=_0x4d45d6-0x0;var _0x19cd3f=_0x37ed[_0x4d45d6];return _0x19cd3f;};'use strict';var _=require('lodash');var moment=require(_0xd37e('0x0'));var parser=require(_0xd37e('0x1'));var util=require(_0xd37e('0x2'));var logger=require(_0xd37e('0x3'))(_0xd37e('0x4'));var rpc=require(_0xd37e('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xd37e('0x6'));var Vertices=require(_0xd37e('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xd37e('0x8')]()[_0xd37e('0x9')](function(_0x3eb8ed){logger[_0xd37e('0xa')](_0xd37e('0xb'),_0x3eb8ed['stack']);return[];});}function addVertex(_0x3aa801,_0x58eccd,_0x9dcf37){_0x58eccd['agicommand']=_0x9dcf37;if(_0x58eccd[_0xd37e('0xc')]('retry')){_0x58eccd[_0xd37e('0xd')]=parseInt(_0x58eccd[_0xd37e('0xe')],0xa);}_0x3aa801[_0xd37e('0xf')](_[_0xd37e('0x10')](_0x58eccd,_0xd37e('0x11')));}function initGraph(_0x1a9e21,_0x4317bc){var _0x56238c=new Graph();for(var _0x4ebd3f in _0x1a9e21){if(_0x1a9e21['hasOwnProperty'](_0x4ebd3f)){if(_[_0xd37e('0x12')](_0x1a9e21[_0x4ebd3f])){for(var _0x415613=0x0;_0x415613<_0x1a9e21[_0x4ebd3f][_0xd37e('0x13')];_0x415613+=0x1){addVertex(_0x56238c,_0x1a9e21[_0x4ebd3f][_0x415613],_0x4ebd3f);}}else{addVertex(_0x56238c,_0x1a9e21[_0x4ebd3f],_0x4ebd3f);}}}for(var _0x9f9653=0x0;_0x9f9653<_0x4317bc['length'];_0x9f9653+=0x1){if(_0x4317bc[_0x9f9653]['source']&&_0x4317bc[_0x9f9653][_0xd37e('0x14')]){_0x56238c[_0xd37e('0x15')](_0x4317bc[_0x9f9653][_0xd37e('0x16')],_0x4317bc[_0x9f9653]['target'],_0x4317bc[_0x9f9653][_0xd37e('0x17')]);}}return _0x56238c;}function getRoot(_0x422abd){return parser[_0xd37e('0x18')](_0x422abd,{'object':!![]})[_0xd37e('0x19')][_0xd37e('0x1a')];}function inspect(_0x46c5fc){return util[_0xd37e('0x1b')](_0x46c5fc,{'showHidden':![],'depth':null});}function initialize(_0x297d4e,_0x4bb4ca){var _0x5332a9=getRoot(_0x297d4e[_0xd37e('0x1c')]);if(!_0x5332a9||!_0x5332a9[_0xd37e('0x1d')])return;var _0x42b3bb,_0x37d259,_0x1db5e4;logger[_0xd37e('0x1e')](_0xd37e('0x1a'),JSON['stringify'](_0x5332a9,null,0x2));_0x4bb4ca[_0xd37e('0x1f')]=moment()[_0xd37e('0x20')]('YYYY-MM-DD\x20HH:mm:ss');_0x42b3bb=initGraph(_[_0xd37e('0x10')](_0x5332a9,_0xd37e('0x11')),_0x5332a9[_0xd37e('0x11')]);_0x37d259=new Vertices(_0x4bb4ca,rpc,mailRpc);logger[_0xd37e('0x21')](util[_0xd37e('0x20')](_0xd37e('0x22'),_0x4bb4ca['arg_1'],_0x4bb4ca['calleridname'],_0x4bb4ca[_0xd37e('0x23')],_0x4bb4ca[_0xd37e('0x24')],_0x4bb4ca[_0xd37e('0x25')]));_0x42b3bb['traverseBFS'](_0x5332a9[_0xd37e('0x1d')]['id'],function(_0x5a2df2){try{_0x5a2df2=_0x37d259[_0xd37e('0x26')](_0x5a2df2);logger[_0xd37e('0x1e')](_0xd37e('0x27'),JSON[_0xd37e('0x28')](_0x5a2df2,null,0x2));if(_0x5a2df2[_0xd37e('0x29')]===_0xd37e('0x2a')){logger[_0xd37e('0x21')](_0xd37e('0x2b'));_0x4bb4ca['context']=_0x5a2df2[_0xd37e('0x2c')]||_0x4bb4ca[_0xd37e('0x2c')];_0x4bb4ca[_0xd37e('0x2d')]=_0x5a2df2[_0xd37e('0x2d')];_0x4bb4ca[_0xd37e('0x2e')]=_0x5a2df2[_0xd37e('0x2e')]?_0x5a2df2[_0xd37e('0x2e')]-0x1:0x1;return null;}else if(_0x5a2df2&&_0x37d259[_0x5a2df2[_0xd37e('0x29')]]){_0x1db5e4=_0x37d259[_0x5a2df2[_0xd37e('0x29')]](_0x5a2df2);logger[_0xd37e('0x21')]('response',JSON[_0xd37e('0x28')](_0x1db5e4,null,0x2));if(_0x1db5e4&&_0x1db5e4[_0xd37e('0x2f')]===AGI_CODE_SUCCESS&&_0x1db5e4[_0xd37e('0x30')]!==AGI_RESULT_ERROR&&!_0x4bb4ca[_0xd37e('0x31')]){logger[_0xd37e('0x1e')]('response',inspect(_0x1db5e4));return _['isUndefined'](_0x1db5e4[_0xd37e('0x30')])?null:_0x1db5e4[_0xd37e('0x30')][_0xd37e('0x32')]();}else{logger['error'](_0xd37e('0x33'),inspect(_0x1db5e4));return null;}}else{logger[_0xd37e('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x23e0e8){logger[_0xd37e('0xa')](_0x23e0e8[_0xd37e('0x34')]);return null;}});if(_0x5332a9[_0xd37e('0x35')]){logger['info'](util[_0xd37e('0x20')](_0xd37e('0x36'),_0x4bb4ca[_0xd37e('0x37')],_0x4bb4ca[_0xd37e('0x38')],_0x4bb4ca[_0xd37e('0x23')],_0x4bb4ca[_0xd37e('0x24')],_0x4bb4ca[_0xd37e('0x25')]));_0x42b3bb[_0xd37e('0x39')](_0x5332a9[_0xd37e('0x35')]['id'],function(_0x2b05f4){try{_0x2b05f4=_0x37d259['clear'](_0x2b05f4);logger[_0xd37e('0x1e')](_0xd37e('0x27'),JSON['stringify'](_0x2b05f4,null,0x2));if(_0x2b05f4&&_0x37d259[_0x2b05f4['agicommand']]){_0x1db5e4=_0x37d259[_0x2b05f4[_0xd37e('0x29')]](_0x2b05f4);if(_0x1db5e4){logger['debug'](_0xd37e('0x33'),inspect(_0x1db5e4));return _['isUndefined'](_0x1db5e4[_0xd37e('0x30')])?null:_0x1db5e4[_0xd37e('0x30')][_0xd37e('0x32')]();}else{logger[_0xd37e('0xa')](_0xd37e('0x33'),inspect(_0x1db5e4));return null;}}else{logger[_0xd37e('0xa')](_0xd37e('0x3a'));return null;}}catch(_0x4a744c){logger[_0xd37e('0xa')](_0x4a744c[_0xd37e('0x34')]);return null;}});}logger['info'](util['format'](_0xd37e('0x3b'),_0x4bb4ca['arg_1'],_0x4bb4ca[_0xd37e('0x38')],_0x4bb4ca[_0xd37e('0x23')],_0x4bb4ca[_0xd37e('0x24')],_0x4bb4ca[_0xd37e('0x25')]));logger[_0xd37e('0x21')](util['format'](_0xd37e('0x3c'),_0x4bb4ca['context'],_0x4bb4ca[_0xd37e('0x2d')],parseInt(_0x4bb4ca[_0xd37e('0x2e')],0xa)+0x1));_0x4bb4ca[_0xd37e('0x3d')](_0x4bb4ca['context'],_0x4bb4ca['extension'],parseInt(_0x4bb4ca[_0xd37e('0x2e')],0xa)+0x1);_0x4bb4ca['close']();}function handleNotFound(_0x96fefc){logger[_0xd37e('0xa')](util[_0xd37e('0x20')](_0xd37e('0x3e'),_0x96fefc[_0xd37e('0x37')]));_0x96fefc['continueAt'](_0x96fefc[_0xd37e('0x2c')],_0x96fefc[_0xd37e('0x2d')],parseInt(_0x96fefc[_0xd37e('0x2e')],0xa)+0x1);_0x96fefc[_0xd37e('0x3f')]();}function handleUnpublished(_0x264b2a){logger[_0xd37e('0xa')](util[_0xd37e('0x20')](_0xd37e('0x40'),_0x264b2a[_0xd37e('0x37')]));_0x264b2a[_0xd37e('0x3d')](_0x264b2a['context'],_0x264b2a[_0xd37e('0x2d')],parseInt(_0x264b2a[_0xd37e('0x2e')],0xa)+0x1);_0x264b2a['close']();}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 cfc5f72..a1928a6 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 _0x60cb=['prototype','_transform','\x0d\x0a\x0d\x0a','_inBody','substring','length','split','indexOf','slice','trim','headers','emit','line','util','Transform','_localBuffer','inherits'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x60cb,0x172));var _0xb60c=function(_0x1aacb4,_0x4028fb){_0x1aacb4=_0x1aacb4-0x0;var _0x5a15e4=_0x60cb[_0x1aacb4];return _0x5a15e4;};'use strict';var util=require(_0xb60c('0x0'));var Transform=require('stream')[_0xb60c('0x1')];function AGIReply(_0x5c02a6){Transform['call'](this,_0x5c02a6);this[_0xb60c('0x2')]='';this['_inBody']=![];}util[_0xb60c('0x3')](AGIReply,Transform);AGIReply[_0xb60c('0x4')][_0xb60c('0x5')]=function(_0x27024e,_0x366402,_0x467dcb){var _0x177339='\x0a',_0x45fe51=['\x0a\x0a',_0xb60c('0x6')],_0x4ad95a=-0x1,_0x41acb9=-0x1,_0x168ad4='',_0x2e8689=0x0,_0x1d9b0e='',_0x3cd6c1='';this['_localBuffer']+=_0x27024e['toString']();_0x1d9b0e=this[_0xb60c('0x2')];if(!this[_0xb60c('0x7')]){_0x2e8689=0x0;while(_0x45fe51[_0x2e8689]){while((_0x41acb9=_0x1d9b0e['indexOf'](_0x45fe51[_0x2e8689]))!=-0x1){_0x168ad4=_0x45fe51[_0x2e8689];_0x3cd6c1=_0x1d9b0e[_0xb60c('0x8')](0x0,_0x41acb9);_0x1d9b0e=_0x1d9b0e[_0xb60c('0x8')](_0x41acb9+_0x168ad4[_0xb60c('0x9')]);var _0x17dec0=_0x3cd6c1[_0xb60c('0xa')](_0x177339),_0x57c386=0x0,_0x38fc1a={},_0x5a9a81='',_0x42842f='',_0xd162ac=-0x1;while(_0x17dec0[_0x57c386]){_0xd162ac=_0x17dec0[_0x57c386][_0xb60c('0xb')](':');if(_0xd162ac!=-0x1){_0x5a9a81=_0x17dec0[_0x57c386][_0xb60c('0xc')](0x0,_0xd162ac)[_0xb60c('0xd')]();_0x42842f=_0x17dec0[_0x57c386][_0xb60c('0xc')](_0xd162ac+0x1)['trim']();if(_0x5a9a81['length']>0x0){_0x38fc1a[_0x5a9a81]=_0x42842f;}}else{}_0x57c386++;}this['emit'](_0xb60c('0xe'),_0x38fc1a);this[_0xb60c('0x7')]=!![];}_0x2e8689++;}this['_localBuffer']=_0x1d9b0e;}else{while((_0x4ad95a=_0x1d9b0e[_0xb60c('0xb')](_0x177339))!=-0x1){_0x3cd6c1=_0x1d9b0e[_0xb60c('0x8')](0x0,_0x4ad95a);this[_0xb60c('0xf')](_0xb60c('0x10'),_0x3cd6c1);_0x1d9b0e=_0x1d9b0e[_0xb60c('0x8')](_0x4ad95a+_0x177339['length']);}this[_0xb60c('0x2')]=_0x1d9b0e;}_0x467dcb();};module['exports']=AGIReply; \ No newline at end of file +var _0xa56c=['indexOf','substring','slice','trim','length','emit','exports','util','stream','call','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa56c,0x1f4));var _0xca56=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa56c[_0x4a53d];return _0x27410e;};'use strict';var util=require(_0xca56('0x0'));var Transform=require(_0xca56('0x1'))['Transform'];function AGIReply(_0x2a42f7){Transform[_0xca56('0x2')](this,_0x2a42f7);this[_0xca56('0x3')]='';this['_inBody']=![];}util[_0xca56('0x4')](AGIReply,Transform);AGIReply[_0xca56('0x5')][_0xca56('0x6')]=function(_0x1c26f8,_0x1b2815,_0x613e75){var _0x5d2108='\x0a',_0x3366cc=['\x0a\x0a',_0xca56('0x7')],_0xc289c0=-0x1,_0x180774=-0x1,_0x35b267='',_0x3367e9=0x0,_0x595822='',_0x4f76d3='';this['_localBuffer']+=_0x1c26f8[_0xca56('0x8')]();_0x595822=this[_0xca56('0x3')];if(!this[_0xca56('0x9')]){_0x3367e9=0x0;while(_0x3366cc[_0x3367e9]){while((_0x180774=_0x595822[_0xca56('0xa')](_0x3366cc[_0x3367e9]))!=-0x1){_0x35b267=_0x3366cc[_0x3367e9];_0x4f76d3=_0x595822[_0xca56('0xb')](0x0,_0x180774);_0x595822=_0x595822[_0xca56('0xb')](_0x180774+_0x35b267['length']);var _0x2a74b9=_0x4f76d3['split'](_0x5d2108),_0x342790=0x0,_0x1c3ada={},_0x1ebd30='',_0x580ca7='',_0xcddbc3=-0x1;while(_0x2a74b9[_0x342790]){_0xcddbc3=_0x2a74b9[_0x342790][_0xca56('0xa')](':');if(_0xcddbc3!=-0x1){_0x1ebd30=_0x2a74b9[_0x342790][_0xca56('0xc')](0x0,_0xcddbc3)[_0xca56('0xd')]();_0x580ca7=_0x2a74b9[_0x342790]['slice'](_0xcddbc3+0x1)[_0xca56('0xd')]();if(_0x1ebd30[_0xca56('0xe')]>0x0){_0x1c3ada[_0x1ebd30]=_0x580ca7;}}else{}_0x342790++;}this[_0xca56('0xf')]('headers',_0x1c3ada);this['_inBody']=!![];}_0x3367e9++;}this[_0xca56('0x3')]=_0x595822;}else{while((_0xc289c0=_0x595822[_0xca56('0xa')](_0x5d2108))!=-0x1){_0x4f76d3=_0x595822[_0xca56('0xb')](0x0,_0xc289c0);this[_0xca56('0xf')]('line',_0x4f76d3);_0x595822=_0x595822[_0xca56('0xb')](_0xc289c0+_0x5d2108[_0xca56('0xe')]);}this[_0xca56('0x3')]=_0x595822;}_0x613e75();};module[_0xca56('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 548c5c8..da634f2 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 _0xac9d=['createCmContact','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','moment','jayson/promise','client','http','request','error','message','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage'];(function(_0x3aa37a,_0x4a45c9){var _0x239384=function(_0x4aba03){while(--_0x4aba03){_0x3aa37a['push'](_0x3aa37a['shift']());}};_0x239384(++_0x4a45c9);}(_0xac9d,0x14d));var _0xdac9=function(_0x9d9797,_0xe3ebe8){_0x9d9797=_0x9d9797-0x0;var _0x3c16ca=_0xac9d[_0x9d9797];return _0x3c16ca;};'use strict';var _=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var jayson=require(_0xdac9('0x2'));var client=jayson[_0xdac9('0x3')][_0xdac9('0x4')]({'port':0x2329});function request(_0x27eb7c,_0x25d1b3){return new Promise(function(_0x1b967e,_0x51a5d7){return client[_0xdac9('0x5')](_0x27eb7c,_0x25d1b3)['then'](function(_0x3d56ae){if(_0x3d56ae[_0xdac9('0x6')]){return _0x51a5d7(_0x3d56ae[_0xdac9('0x6')][_0xdac9('0x7')]);}else{return _0x1b967e(_0x3d56ae[_0xdac9('0x8')]);}})[_0xdac9('0x9')](function(_0x5531af){return _0x51a5d7(_0x5531af);});});}exports[_0xdac9('0xa')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xdac9('0xb'),_0xdac9('0xc')]}});};exports[_0xdac9('0xd')]=function(_0x1a4674){return request(_0xdac9('0xe'),{'options':{'raw':![],'where':{'name':_0x1a4674},'attributes':[_0xdac9('0xc')]}});};exports[_0xdac9('0xf')]=function(_0x1b604a){return request(_0xdac9('0x10'),{'options':{'raw':![],'where':{'id':_0x1b604a},'include':[{'model':'MailServerOut','as':_0xdac9('0x11'),'include':[{'model':_0xdac9('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0xdac9('0xb'),_0xdac9('0x13')],'smtp':!![]}});};exports[_0xdac9('0x14')]=function(_0x4b2436){return request(_0xdac9('0xe'),{'options':{'where':{'id':_0x4b2436},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x15')]=function(_0x5f0bbd){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5f0bbd},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x16')]=function(_0x50f9fe){return request(_0xdac9('0x17'),{'options':{'where':{'id':_0x50f9fe},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x18')]=function(_0x5b2f1b){return request(_0xdac9('0x19'),{'options':{'where':{'id':_0x5b2f1b},'attributes':[_0xdac9('0x1a')]}});};exports[_0xdac9('0x1b')]=function(_0xec1016){return request('ShowUser',{'options':{'where':{'id':_0xec1016},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x1c')]=function(_0x571e07){return request(_0xdac9('0x1d'),{'options':{'where':{'phone':_0x571e07[_0xdac9('0x1e')]},'attributes':['id']}});};exports[_0xdac9('0x1f')]=function(_0x181d11){return request('ShowTrunk',{'options':{'where':{'id':_0x181d11},'attributes':['name']}});};exports[_0xdac9('0x20')]=function(_0x20ece3){return request(_0xdac9('0x21'),{'options':{'where':{'id':_0x20ece3},'attributes':[_0xdac9('0x22')]}});};exports['getIntervalById']=function(_0x23ee5e){return request(_0xdac9('0x23'),{'options':{'raw':![],'where':{'id':_0x23ee5e},'include':[{'model':_0xdac9('0x24'),'as':_0xdac9('0x25')}]}});};exports[_0xdac9('0x26')]=function(_0x42317c){return request(_0xdac9('0x27'),{'options':{'where':{'id':_0x42317c},'attributes':['id',_0xdac9('0xb')]}});};exports[_0xdac9('0x28')]=function(_0x33de5c){return request('CreateSmsMessage',{'body':_0x33de5c});};exports[_0xdac9('0x29')]=function(_0x11f4fd){return request(_0xdac9('0x2a'),{'body':_0x11f4fd});};exports[_0xdac9('0x2b')]=function(_0x5ca076){return request(_0xdac9('0x2c'),{'body':_['merge'](_0x5ca076,{'project_name':_0x5ca076[_0xdac9('0x2d')],'prev_project_name':_0x5ca076[_0xdac9('0x2e')]||'','is_subproject':_0x5ca076['arg_2']?!![]:![],'leaveAt':moment()[_0xdac9('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xdac9('0x30')]=function(_0x3743f7){return request(_0xdac9('0x31'),{'body':_0x3743f7});};exports[_0xdac9('0x32')]=function(_0x57d76a){return request('CreateSquareMessage',{'body':_0x57d76a});};exports[_0xdac9('0x33')]=function(_0x170afd){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x170afd['phone'],'ListId':_0x170afd[_0xdac9('0x34')]}}})[_0xdac9('0x35')](function(_0x13efba){if(_0x13efba){return _0x13efba;}return request(_0xdac9('0x36'),{'body':_0x170afd});});};exports[_0xdac9('0x37')]=function(_0x2247f8){return request(_0xdac9('0x38'),{'options':{'where':{'id':_0x2247f8},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x39')]=function(_0x2f36f4,_0xb49c21){return request(_0xdac9('0x3a'),{'body':{'interface':_0xb49c21},'options':{'where':_0x2f36f4}});};exports[_0xdac9('0x3b')]=function(_0x336fd5,_0x410cec,_0x446080){return request(_0xdac9('0x3c'),{'body':{'type':_0x410cec,'uniqueid':_0x446080},'options':{'where':_0x336fd5}});};exports[_0xdac9('0x3d')]=function(_0x339f31){return request(_0xdac9('0x3e'),{'body':{},'options':{'where':_0x339f31}});};exports[_0xdac9('0x3f')]=function(_0x514eee){return request('LogoutUser',{'body':{},'options':{'where':_0x514eee}});}; \ No newline at end of file +var _0x9de3=['ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','then','error','message','result','catch','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','GetContactByPhone','getTrunkById','ShowTrunk','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareMessage','createCmContact','ShowCmHopper'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0x9de3,0xea));var _0x39de=function(_0x28873c,_0x19359b){_0x28873c=_0x28873c-0x0;var _0x709671=_0x9de3[_0x28873c];return _0x709671;};'use strict';var _=require(_0x39de('0x0'));var moment=require('moment');var jayson=require(_0x39de('0x1'));var client=jayson[_0x39de('0x2')][_0x39de('0x3')]({'port':0x2329});function request(_0x4f43f9,_0x3c8483){return new Promise(function(_0x515fba,_0x1010da){return client[_0x39de('0x4')](_0x4f43f9,_0x3c8483)[_0x39de('0x5')](function(_0x1d59d6){if(_0x1d59d6['error']){return _0x1010da(_0x1d59d6[_0x39de('0x6')][_0x39de('0x7')]);}else{return _0x515fba(_0x1d59d6[_0x39de('0x8')]);}})[_0x39de('0x9')](function(_0x2604fa){return _0x1010da(_0x2604fa);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x39de('0xa')]}});};exports[_0x39de('0xb')]=function(_0x3e92d9){return request(_0x39de('0xc'),{'options':{'raw':![],'where':{'name':_0x3e92d9},'attributes':[_0x39de('0xa')]}});};exports[_0x39de('0xd')]=function(_0x431b4a){return request(_0x39de('0xe'),{'options':{'raw':![],'where':{'id':_0x431b4a},'include':[{'model':'MailServerOut','as':_0x39de('0xf'),'include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id',_0x39de('0x10'),_0x39de('0x11')],'smtp':!![]}});};exports[_0x39de('0x12')]=function(_0x494764){return request(_0x39de('0xc'),{'options':{'where':{'id':_0x494764},'attributes':[_0x39de('0x10')]}});};exports[_0x39de('0x13')]=function(_0x905132){return request(_0x39de('0x14'),{'options':{'where':{'id':_0x905132},'attributes':[_0x39de('0x10')]}});};exports[_0x39de('0x15')]=function(_0x25ca17){return request(_0x39de('0x16'),{'options':{'where':{'id':_0x25ca17},'attributes':[_0x39de('0x10')]}});};exports['getSquareOdbcById']=function(_0x1f36e0){return request(_0x39de('0x17'),{'options':{'where':{'id':_0x1f36e0},'attributes':[_0x39de('0x18')]}});};exports[_0x39de('0x19')]=function(_0x493200){return request('ShowUser',{'options':{'where':{'id':_0x493200},'attributes':[_0x39de('0x10')]}});};exports['getContactByPhone']=function(_0x1fb6fa){return request(_0x39de('0x1a'),{'options':{'where':{'phone':_0x1fb6fa['phone']},'attributes':['id']}});};exports[_0x39de('0x1b')]=function(_0x5dcb96){return request(_0x39de('0x1c'),{'options':{'where':{'id':_0x5dcb96},'attributes':[_0x39de('0x10')]}});};exports['getSoundById']=function(_0x5d34dd){return request(_0x39de('0x1d'),{'options':{'where':{'id':_0x5d34dd},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x315e4a){return request(_0x39de('0x1e'),{'options':{'raw':![],'where':{'id':_0x315e4a},'include':[{'model':_0x39de('0x1f'),'as':_0x39de('0x20')}]}});};exports[_0x39de('0x21')]=function(_0x10c0fc){return request('ShowSmsAccount',{'options':{'where':{'id':_0x10c0fc},'attributes':['id',_0x39de('0x10')]}});};exports[_0x39de('0x22')]=function(_0x45abce){return request('CreateSmsMessage',{'body':_0x45abce});};exports[_0x39de('0x23')]=function(_0x483d49){return request(_0x39de('0x24'),{'body':_0x483d49});};exports[_0x39de('0x25')]=function(_0x30c3e3){return request(_0x39de('0x26'),{'body':_[_0x39de('0x27')](_0x30c3e3,{'project_name':_0x30c3e3['arg_1'],'prev_project_name':_0x30c3e3[_0x39de('0x28')]||'','is_subproject':_0x30c3e3[_0x39de('0x28')]?!![]:![],'leaveAt':moment()[_0x39de('0x29')](_0x39de('0x2a'))})});};exports['createSquareRecording']=function(_0x3fd91a){return request('CreateSquareRecording',{'body':_0x3fd91a});};exports['createSquareMessage']=function(_0x17d876){return request(_0x39de('0x2b'),{'body':_0x17d876});};exports[_0x39de('0x2c')]=function(_0x3ff4d8){return request(_0x39de('0x2d'),{'options':{'raw':![],'where':{'phone':_0x3ff4d8['phone'],'ListId':_0x3ff4d8[_0x39de('0x2e')]}}})[_0x39de('0x5')](function(_0x46dfd2){if(_0x46dfd2){return _0x46dfd2;}return request(_0x39de('0x2f'),{'body':_0x3ff4d8});});};exports[_0x39de('0x30')]=function(_0x2db103){return request(_0x39de('0x31'),{'options':{'where':{'id':_0x2db103},'attributes':['name']}});};exports[_0x39de('0x32')]=function(_0x2ca57d,_0x3760c7){return request(_0x39de('0x33'),{'body':{'interface':_0x3760c7},'options':{'where':_0x2ca57d}});};exports['agentPause']=function(_0x44df77,_0x3d6562,_0x410d9e){return request(_0x39de('0x34'),{'body':{'type':_0x3d6562,'uniqueid':_0x410d9e},'options':{'where':_0x44df77}});};exports['agentUnpause']=function(_0x184ea6){return request(_0x39de('0x35'),{'body':{},'options':{'where':_0x184ea6}});};exports[_0x39de('0x36')]=function(_0x363eff){return request(_0x39de('0x37'),{'body':{},'options':{'where':_0x363eff}});}; \ 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 0102ec3..e01a8a1 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 _0x41d9=['exports','./polly','./lex'];(function(_0x4b6aeb,_0x2bfdf7){var _0x321781=function(_0x3e80f4){while(--_0x3e80f4){_0x4b6aeb['push'](_0x4b6aeb['shift']());}};_0x321781(++_0x2bfdf7);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};var polly=require(_0x941d('0x0'));var lex=require(_0x941d('0x1'));module[_0x941d('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x2f4a=['./lex','exports','./polly'];(function(_0x490b8a,_0x6e2622){var _0x40769d=function(_0x48fb78){while(--_0x48fb78){_0x490b8a['push'](_0x490b8a['shift']());}};_0x40769d(++_0x6e2622);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2f4a[_0x432682];return _0x463d05;};var polly=require(_0xa2f4('0x0'));var lex=require(_0xa2f4('0x1'));module[_0xa2f4('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 8e49da6..46f0ad3 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 _0xe605=['./lib/api','exports'];(function(_0x558a14,_0x22988e){var _0x273183=function(_0x41feae){while(--_0x41feae){_0x558a14['push'](_0x558a14['shift']());}};_0x273183(++_0x22988e);}(_0xe605,0x92));var _0x5e60=function(_0x1a0f28,_0x957a4a){_0x1a0f28=_0x1a0f28-0x0;var _0x3e2190=_0xe605[_0x1a0f28];return _0x3e2190;};'use strict';var lex=require(_0x5e60('0x0'));module[_0x5e60('0x1')]=function(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3){return lex(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3);}; \ No newline at end of file +var _0x668b=['./lib/api','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x668b,0x140));var _0xb668=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x668b[_0x2bf141];return _0x48277b;};'use strict';var lex=require(_0xb668('0x0'));module[_0xb668('0x1')]=function(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83){return lex(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83);}; \ 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 de48b15..a70dd2c 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(_0x3ff936,_0x3bcaab){var _0x4f3380=function(_0x2f2b53){while(--_0x2f2b53){_0x3ff936['push'](_0x3ff936['shift']());}};_0x4f3380(++_0x3bcaab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x391df4,_0x1fbb2f){var _0x39f6f4=function(_0x2a7c32){while(--_0x2a7c32){_0x391df4['push'](_0x391df4['shift']());}};_0x39f6f4(++_0x1fbb2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 5595231..e664513 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 _0x350c=['./lib/api'];(function(_0x26c8e3,_0x3912c5){var _0x294e5f=function(_0x1432bb){while(--_0x1432bb){_0x26c8e3['push'](_0x26c8e3['shift']());}};_0x294e5f(++_0x3912c5);}(_0x350c,0x1ac));var _0xc350=function(_0x2abd2f,_0x3e7891){_0x2abd2f=_0x2abd2f-0x0;var _0x51c631=_0x350c[_0x2abd2f];return _0x51c631;};'use strict';var polly=require(_0xc350('0x0'));module['exports']=function(_0x29e42c,_0x2c1936,_0x82e5bf,_0x3aedb9,_0x18d8c5,_0x57c412,_0x142b11){return polly(_0x29e42c,_0x2c1936,_0x82e5bf,_0x3aedb9,_0x18d8c5,_0x57c412,_0x142b11);}; \ No newline at end of file +var _0x0524=['exports'];(function(_0x20ad2f,_0x7f1a9f){var _0x5b0cdb=function(_0x3f34ee){while(--_0x3f34ee){_0x20ad2f['push'](_0x20ad2f['shift']());}};_0x5b0cdb(++_0x7f1a9f);}(_0x0524,0xb5));var _0x4052=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x0524[_0x28b0a4];return _0x105ce6;};'use strict';var polly=require('./lib/api');module[_0x4052('0x0')]=function(_0x1823f4,_0x4f1da9,_0x51d9b0,_0x1d439d,_0x57a030,_0x34b7fe,_0x23d4c7){return polly(_0x1823f4,_0x4f1da9,_0x51d9b0,_0x1d439d,_0x57a030,_0x34b7fe,_0x23d4c7);}; \ 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 e14a4af..68ae0fd 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 _0x290b=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x290b,0x1e8));var _0xb290=function(_0x3226a3,_0x1a61ec){_0x3226a3=_0x3226a3-0x0;var _0x1b99af=_0x290b[_0x3226a3];return _0x1b99af;};'use strict';var fs=require('fs');var path=require(_0xb290('0x0'));var BPromise=require(_0xb290('0x1'));var rs=require(_0xb290('0x2'));var AWS=require(_0xb290('0x3'));function pollyResult(_0x13997e,_0x544f03,_0xa7a410){return new BPromise(function(_0x521225,_0x5751ff){_0x13997e[_0xb290('0x4')](_0x544f03,function(_0x3b78e6,_0x444c7d){if(_0x3b78e6){_0x5751ff(_0x3b78e6);}else if(_0x444c7d){if(_0x444c7d[_0xb290('0x5')]instanceof Buffer){fs[_0xb290('0x6')](_0xa7a410,_0x444c7d[_0xb290('0x5')],function(_0x3ca02b){if(_0x3ca02b){_0x5751ff(_0x3ca02b);}else{_0x521225();}});}else{_0x5751ff(new Error(_0xb290('0x7')));}}else{_0x5751ff(new Error(_0xb290('0x8')));}});});}module[_0xb290('0x9')]=function(_0x1e486c,_0x2dba50,_0x44cd19,_0x5020cf,_0x5c2521,_0x20e0d1,_0x70f083){var _0x52a2fb=new AWS['Polly']({'accessKeyId':_0x1e486c,'secretAccessKey':_0x2dba50,'region':_0x44cd19});var _0x1f406c={'Text':_0x5c2521,'TextType':_0x20e0d1||'text','OutputFormat':_0xb290('0xa'),'VoiceId':_0x5020cf};return pollyResult(_0x52a2fb,_0x1f406c,_0x70f083);}; \ No newline at end of file +var _0x298c=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech'];(function(_0x3d6340,_0x28b4e8){var _0x4a6e7b=function(_0x26ba7d){while(--_0x26ba7d){_0x3d6340['push'](_0x3d6340['shift']());}};_0x4a6e7b(++_0x28b4e8);}(_0x298c,0x1dc));var _0xc298=function(_0x59ff5b,_0x5cd4ca){_0x59ff5b=_0x59ff5b-0x0;var _0x583022=_0x298c[_0x59ff5b];return _0x583022;};'use strict';var fs=require('fs');var path=require(_0xc298('0x0'));var BPromise=require(_0xc298('0x1'));var rs=require(_0xc298('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x593559,_0x23159c,_0x38a2c0){return new BPromise(function(_0x628ee1,_0x4cca66){_0x593559[_0xc298('0x3')](_0x23159c,function(_0x2f0638,_0xe3c3f0){if(_0x2f0638){_0x4cca66(_0x2f0638);}else if(_0xe3c3f0){if(_0xe3c3f0[_0xc298('0x4')]instanceof Buffer){fs[_0xc298('0x5')](_0x38a2c0,_0xe3c3f0[_0xc298('0x4')],function(_0xef09c9){if(_0xef09c9){_0x4cca66(_0xef09c9);}else{_0x628ee1();}});}else{_0x4cca66(new Error(_0xc298('0x6')));}}else{_0x4cca66(new Error(_0xc298('0x7')));}});});}module[_0xc298('0x8')]=function(_0x4df14f,_0x3ddfc0,_0x258b1a,_0x56d631,_0x21e452,_0x17d4ec,_0x285f9e){var _0x41dd49=new AWS[(_0xc298('0x9'))]({'accessKeyId':_0x4df14f,'secretAccessKey':_0x3ddfc0,'region':_0x258b1a});var _0x1cc659={'Text':_0x21e452,'TextType':_0x17d4ec||_0xc298('0xa'),'OutputFormat':_0xc298('0xb'),'VoiceId':_0x56d631};return pollyResult(_0x41dd49,_0x1cc659,_0x285f9e);}; \ 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 06900dc..38c174c 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 _0x47c7=['exports','./lib/api'];(function(_0x587ed7,_0xbe5dbc){var _0x1cd18d=function(_0x148463){while(--_0x148463){_0x587ed7['push'](_0x587ed7['shift']());}};_0x1cd18d(++_0xbe5dbc);}(_0x47c7,0x1ad));var _0x747c=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x47c7[_0x1344d6];return _0xf45b24;};'use strict';var asr=require(_0x747c('0x0'));module[_0x747c('0x1')]=function(_0x23cf7f,_0x5dd988,_0x3a8b1f,_0x4c75ba){return asr(_0x23cf7f,_0x5dd988,_0x3a8b1f);}; \ No newline at end of file +var _0x5834=['exports','./lib/api'];(function(_0x5de8fa,_0x4665af){var _0x136868=function(_0xf16f59){while(--_0xf16f59){_0x5de8fa['push'](_0x5de8fa['shift']());}};_0x136868(++_0x4665af);}(_0x5834,0x1a1));var _0x4583=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x5834[_0x4b7895];return _0x264180;};'use strict';var asr=require(_0x4583('0x0'));module[_0x4583('0x1')]=function(_0x3168c7,_0x19c65e,_0x188799,_0x43f41e){return asr(_0x3168c7,_0x19c65e,_0x188799);}; \ 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 39548da..8ee27cb 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 _0xd845=['exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','LINEAR16','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x526e0f,_0x4b5803){var _0x49c993=function(_0x524c56){while(--_0x524c56){_0x526e0f['push'](_0x526e0f['shift']());}};_0x49c993(++_0x4b5803);}(_0xd845,0x135));var _0x5d84=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xd845[_0x50007c];return _0x5c1ec7;};'use strict';var url=require(_0x5d84('0x0'));var BPromise=require(_0x5d84('0x1'));var fs=require('fs');var host=_0x5d84('0x2');module[_0x5d84('0x3')]=function(_0x59cdf4,_0x137388,_0xcb72c0){return new BPromise(function(_0x918317,_0x11abe5){var _0x53ba56;if(typeof _0x59cdf4!==_0x5d84('0x4')||_0x59cdf4[_0x5d84('0x5')]===0x0){return _0x11abe5(_0x5d84('0x6'));}if(typeof _0x137388!==_0x5d84('0x4')||_0x137388[_0x5d84('0x5')]===0x0){return _0x11abe5(_0x5d84('0x7'));}if(typeof _0xcb72c0!=='undefined'&&(typeof _0xcb72c0!==_0x5d84('0x4')||_0xcb72c0['length']===0x0)){return _0x11abe5(_0x5d84('0x8'));}try{_0x53ba56=fs[_0x5d84('0x9')](_0x59cdf4)['toString'](_0x5d84('0xa'));}catch(_0x2cf40d){return _0x11abe5(_0x2cf40d);}return _0x918317({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x137388,'body':{'config':{'encoding':_0x5d84('0xb'),'sampleRateHertz':_0x5d84('0xc'),'languageCode':_0xcb72c0},'audio':{'content':_0x53ba56}},'json':!![]});});}; \ No newline at end of file +var _0x35aa=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x16167f,_0x38a605){var _0x187192=function(_0x189b3f){while(--_0x189b3f){_0x16167f['push'](_0x16167f['shift']());}};_0x187192(++_0x38a605);}(_0x35aa,0xbe));var _0xa35a=function(_0x564adf,_0x861a9){_0x564adf=_0x564adf-0x0;var _0x506f27=_0x35aa[_0x564adf];return _0x506f27;};'use strict';var url=require('url');var BPromise=require(_0xa35a('0x0'));var fs=require('fs');var host=_0xa35a('0x1');module[_0xa35a('0x2')]=function(_0x3518ac,_0x5c294c,_0x2e9bcf){return new BPromise(function(_0x4303b4,_0x24cc2){var _0x11f841;if(typeof _0x3518ac!==_0xa35a('0x3')||_0x3518ac[_0xa35a('0x4')]===0x0){return _0x24cc2(_0xa35a('0x5'));}if(typeof _0x5c294c!==_0xa35a('0x3')||_0x5c294c['length']===0x0){return _0x24cc2(_0xa35a('0x6'));}if(typeof _0x2e9bcf!=='undefined'&&(typeof _0x2e9bcf!==_0xa35a('0x3')||_0x2e9bcf[_0xa35a('0x4')]===0x0)){return _0x24cc2(_0xa35a('0x7'));}try{_0x11f841=fs[_0xa35a('0x8')](_0x3518ac)[_0xa35a('0x9')](_0xa35a('0xa'));}catch(_0x48f7f4){return _0x24cc2(_0x48f7f4);}return _0x4303b4({'method':_0xa35a('0xb'),'uri':host+_0xa35a('0xc')+_0x5c294c,'body':{'config':{'encoding':_0xa35a('0xd'),'sampleRateHertz':_0xa35a('0xe'),'languageCode':_0x2e9bcf},'audio':{'content':_0x11f841}},'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 74f4122..22f1510 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 _0xd937=['exports','./asr'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0xd937,0x151));var _0x7d93=function(_0x502259,_0x5a95a6){_0x502259=_0x502259-0x0;var _0x1e3bf4=_0xd937[_0x502259];return _0x1e3bf4;};var asr=require(_0x7d93('0x0'));module[_0x7d93('0x1')]={'asr':asr}; \ No newline at end of file +var _0x853d=['./asr','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x853d,0x1c4));var _0xd853=function(_0x1eecf2,_0x5eddc2){_0x1eecf2=_0x1eecf2-0x0;var _0x3e3d86=_0x853d[_0x1eecf2];return _0x3e3d86;};var asr=require(_0xd853('0x0'));module[_0xd853('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 02d6f06..021dc14 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 _0x0903=['statusMessage','finish','info','close','unlink','download\x20error','pipe','protocol','host','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','MP3','text:synthesize','.mp3','audioContent','writeFile','.wav','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','f.req=','jQ1olc','stringify','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','action','actionIncomplete','speech','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','ispeechASR','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./google','./tilde','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0903,0xef));var _0x3090=function(_0x434ab8,_0x164e29){_0x434ab8=_0x434ab8-0x0;var _0x4173a2=_0x0903[_0x434ab8];return _0x4173a2;};'use strict';var apiai=require(_0x3090('0x0'));var BPromise=require(_0x3090('0x1'));var dialogflow=require(_0x3090('0x2'));var fs=require('fs');var http=require(_0x3090('0x3'));var https=require(_0x3090('0x4'));var md5=require(_0x3090('0x5'));var path=require(_0x3090('0x6'));var querystring=require('querystring');var rp=require(_0x3090('0x7'));var rs=require(_0x3090('0x8'));var sox=require(_0x3090('0x9'));var tts=require(_0x3090('0xa'));var urlParse=require(_0x3090('0xb'))[_0x3090('0xc')];var util=require(_0x3090('0xd'));var aws=require('./aws');var google=require(_0x3090('0xe'));var sestek=require('./sestek');var tilde=require(_0x3090('0xf'));var logger=require('../../../config/logger')(_0x3090('0x10'));var ISPEECH_API=_0x3090('0x11');function downloadFile(_0x110333,_0x1a1d9b){return new BPromise(function(_0x912d03,_0x37760c){var _0x3ad95e=urlParse(_0x110333);var _0x1c41ed=_0x3ad95e['protocol']===_0x3090('0x12')?https:http;var _0x54a033={'host':_0x3ad95e['host'],'path':_0x3ad95e[_0x3090('0x6')],'headers':{'user-agent':_0x3090('0x13')}};_0x1c41ed[_0x3090('0x14')](_0x54a033,function(_0x17cd74){if(_0x17cd74[_0x3090('0x15')]!==0xc8){logger[_0x3090('0x16')](_0x3090('0x17')+_0x110333+_0x3090('0x18')+_0x17cd74[_0x3090('0x15')]+'\x20('+_0x17cd74[_0x3090('0x19')]+')');_0x37760c(new Error('request\x20to\x20'+_0x110333+'\x20failed,\x20status\x20code\x20=\x20'+_0x17cd74[_0x3090('0x15')]+'\x20('+_0x17cd74[_0x3090('0x19')]+')'));return;}var _0x3b14a2=fs['createWriteStream'](_0x1a1d9b);_0x3b14a2['on'](_0x3090('0x1a'),function(){logger[_0x3090('0x1b')]('finish\x20download\x20file');_0x3b14a2[_0x3090('0x1c')](_0x912d03);});_0x3b14a2['on'](_0x3090('0x16'),function(_0x3c1e92){fs[_0x3090('0x1d')](_0x1a1d9b);logger[_0x3090('0x16')](_0x3090('0x1e'),_0x3c1e92);_0x37760c(_0x3c1e92);});_0x17cd74[_0x3090('0x1f')](_0x3b14a2);})['on']('error',function(_0x1cc1da){logger['error'](_0x1cc1da);_0x37760c(_0x1cc1da);})['end']();});}function uploadFile(_0x3fd950){return new BPromise(function(_0x8aed1c,_0x23ce01){var _0x1b7066=urlParse(_0x3fd950);var _0x391678=_0x1b7066[_0x3090('0x20')]==='https:'?https:http;var _0x1b104a={'host':_0x1b7066[_0x3090('0x21')],'path':_0x1b7066[_0x3090('0x6')],'headers':{'user-agent':_0x3090('0x13')}};_0x391678[_0x3090('0x14')](_0x1b104a,function(_0x70b7b6){if(_0x70b7b6[_0x3090('0x15')]!==0xc8){_0x23ce01(new Error(_0x3090('0x17')+_0x3fd950+_0x3090('0x18')+_0x70b7b6[_0x3090('0x15')]+'\x20('+_0x70b7b6[_0x3090('0x19')]+')'));return;}var _0xfb4bec='';_0x70b7b6['on'](_0x3090('0x22'),function(_0x32aec6){_0xfb4bec+=_0x32aec6;});_0x70b7b6['on'](_0x3090('0x23'),function(){_0x8aed1c(_0xfb4bec);});})['on']('error',function(_0x1fd2b0){_0x23ce01(_0x1fd2b0);})[_0x3090('0x23')]();});}function convertFile(_0x39f883,_0x27ac56){return new BPromise(function(_0x329ad0,_0x5d5325){var _0x2ec008=sox[_0x3090('0x24')](_0x39f883,_0x27ac56,{'sampleRate':0x1f40,'format':_0x3090('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2ec008['on'](_0x3090('0x16'),function(_0x1970de){logger[_0x3090('0x16')](_0x3090('0x26'),_0x1970de);_0x5d5325(_0x1970de);});_0x2ec008['on'](_0x3090('0x23'),function(){logger['info'](_0x3090('0x27'));_0x329ad0();});_0x2ec008[_0x3090('0x28')]();});}function base64Decode(_0x3d9532,_0x548618){var _0x50619c=path[_0x3090('0x29')](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+'.wav');fs[_0x3090('0x2c')](_0x50619c,_0x3d9532,_0x3090('0x2d'));return convertFile(_0x50619c,_0x548618)[_0x3090('0x2e')](function(){try{fs[_0x3090('0x1d')](_0x50619c);fs[_0x3090('0x2f')](_0x548618,_0x3090('0x30'));}catch(_0x445f2d){logger[_0x3090('0x16')](_0x445f2d);}return _0x548618[_0x3090('0x31')]('.')[0x0];});}function base64Encode(_0x779931){var _0x34c7b3=fs['readFileSync'](_0x779931);return new Buffer(_0x34c7b3)[_0x3090('0x32')]('base64');}exports[_0x3090('0x33')]=function(_0x3cd7de,_0x49cfa5,_0x20df84,_0xf478f,_0x1d04b7,_0x2e8bb3){var _0x35c71e,_0x4df6c2;var _0x1bbb7e=_0x3090('0x34');var _0xa3fbeb=_0x3090('0x35')+_0x3cd7de;var _0x8b5160={};if(_0x49cfa5==='ssml'){_0x8b5160[_0x3090('0x36')]={'ssml':_0x20df84};}else{_0x8b5160[_0x3090('0x36')]={'text':_0x20df84};};_0x8b5160[_0x3090('0x37')]={'languageCode':_0xf478f,'ssmlGender':_0x1d04b7};_0x8b5160['audioConfig']={'audioEncoding':_0x3090('0x38'),'sampleRateHertz':0x1f40};var _0x20033d={'url':_0x1bbb7e+_0x3090('0x39')+_0xa3fbeb,'method':'POST','json':!![],'body':_0x8b5160};return rp(_0x20033d)[_0x3090('0x2e')](function(_0x2c3b62){return new BPromise(function(_0x4c1224,_0x519231){_0x35c71e=path['resolve'](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+_0x3090('0x3a'));var _0x58dc34=Buffer['from'](_0x2c3b62[_0x3090('0x3b')],_0x3090('0x2d'));return fs[_0x3090('0x3c')](_0x35c71e,_0x58dc34,function(_0x473fc8){_0x519231(_0x473fc8);},function(_0x402bd6){fs[_0x3090('0x2f')](_0x35c71e,_0x3090('0x30'));_0x4c1224(_0x402bd6);});});})['then'](function(_0x4286d5){_0x4df6c2=path['resolve'](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+_0x3090('0x3d'));return convertFile(_0x35c71e,_0x4df6c2);})[_0x3090('0x2e')](function(){try{fs['unlink'](_0x35c71e);fs[_0x3090('0x2f')](_0x4df6c2,_0x3090('0x30'));}catch(_0x54ea3c){logger[_0x3090('0x16')](_0x54ea3c);}logger[_0x3090('0x1b')]('googleCloudTTS\x20path',_0x4df6c2[_0x3090('0x31')]('.')[0x0]);return _0x4df6c2[_0x3090('0x31')]('.')[0x0];});};exports[_0x3090('0x3e')]=function(_0x119981,_0x53cb0f){var _0x5c01b3=_0x3090('0x3f');var _0x3878f4,_0x4aa950;var _0x325f2a;var _0x2094fe={'encoding':_0x3090('0x40'),'method':_0x3090('0x41'),'timeout':0x2710,'url':_0x5c01b3,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x3090('0x42')+encodeURIComponent(JSON['stringify']([[[_0x3090('0x43'),JSON[_0x3090('0x44')]([_0x119981,_0x53cb0f||'en',![],_0x3090('0x45')]),null,_0x3090('0x46')]]]))};return rp(_0x2094fe)[_0x3090('0x2e')](function(_0x126b18){try{_0x325f2a=eval(_0x126b18['slice'](0x5))[0x0][0x2];}catch(_0x1264a7){throw new Error(_0x3090('0x47')+_0x126b18[_0x3090('0x22')]);}if(!_0x325f2a){if(_0x119981[_0x3090('0x48')]>0xc8){throw new Error(_0x3090('0x49'));}else{throw new Error('lang\x20\x22'+_0x53cb0f+_0x3090('0x4a'));}}try{_0x325f2a=eval(_0x325f2a)[0x0];}catch(_0x3e4bec){throw new Error(_0x3090('0x47')+res[_0x3090('0x22')]);}const _0x1d42f1=_0x325f2a;_0x3878f4=path[_0x3090('0x29')](__dirname,_0x3090('0x2a'),rs['generate'](0x4)+_0x3090('0x3a'));fs[_0x3090('0x2c')](_0x3878f4,_0x325f2a,{'encoding':_0x3090('0x2d')});_0x4aa950=path[_0x3090('0x29')](__dirname,'tmp',rs[_0x3090('0x2b')](0x4)+_0x3090('0x3d'));return convertFile(_0x3878f4,_0x4aa950);})[_0x3090('0x2e')](function(){try{fs[_0x3090('0x1d')](_0x3878f4);fs['chmodSync'](_0x4aa950,_0x3090('0x30'));}catch(_0x244042){logger['error'](_0x244042);}logger['info'](_0x3090('0x4b'),_0x4aa950['split']('.')[0x0]);return _0x4aa950[_0x3090('0x31')]('.')[0x0];});};exports[_0x3090('0x4c')]=function(_0x423dab,_0x3c5a75,_0x5b9c7f){return google[_0x3090('0x4d')](_0x423dab,_0x3c5a75,_0x5b9c7f)[_0x3090('0x2e')](function(_0x4e4e55){logger[_0x3090('0x1b')](_0x4e4e55[_0x3090('0x4e')]);return rp(_0x4e4e55);})[_0x3090('0x2e')](function(_0x3d2063){var _0x16a14b='';var _0x3d0958=0x0;try{fs[_0x3090('0x1d')](_0x423dab);}catch(_0x32f6c4){logger[_0x3090('0x16')](_0x32f6c4);}if(_0x3d2063&&_0x3d2063[_0x3090('0x4f')]){_0x16a14b=_0x3d2063[_0x3090('0x4f')]['map'](function(_0x586ca2){return _0x586ca2&&_0x586ca2[_0x3090('0x50')][0x0]&&_0x586ca2['alternatives'][0x0][_0x3090('0x51')]?_0x586ca2[_0x3090('0x50')][0x0][_0x3090('0x51')]:'';})[_0x3090('0x52')]('\x0a');_0x3d0958=_0x3d2063[_0x3090('0x4f')][_0x3090('0x53')](function(_0x17d1c8){return _0x17d1c8&&_0x17d1c8['alternatives'][0x0]&&_0x17d1c8[_0x3090('0x50')][0x0]['confidence']?_0x17d1c8[_0x3090('0x50')][0x0][_0x3090('0x54')]:0x0;})[_0x3090('0x52')]('\x0a');}logger[_0x3090('0x1b')](_0x3090('0x55'),_0x16a14b);logger[_0x3090('0x1b')](_0x3090('0x56'),_0x3d0958);return{'transcript':_0x16a14b,'confidence':_0x3d0958};})[_0x3090('0x57')](function(_0x3eca91){logger['error'](_0x3090('0x58'),_0x3eca91[_0x3090('0x15')],_0x3eca91[_0x3090('0x59')],_0x3eca91[_0x3090('0x5a')]);});};exports['googleDialogflow']=function(_0x1a7ffb,_0x3a6fdc,_0x440d06,_0x493ac1){var _0x5e0a7c=apiai(_0x3a6fdc,{'language':_0x493ac1||'en'});return _0x5e0a7c[_0x3090('0x5b')](_0x440d06,{'sessionId':md5(_0x1a7ffb)})[_0x3090('0x2e')](function(_0x57dae6){logger[_0x3090('0x1b')](JSON[_0x3090('0x44')](_0x57dae6));return{'source':_0x57dae6[_0x3090('0x5c')][_0x3090('0x5d')],'resolvedQuery':_0x57dae6[_0x3090('0x5c')][_0x3090('0x5e')],'action':_0x57dae6[_0x3090('0x5c')][_0x3090('0x5f')],'actionIncomplete':_0x57dae6[_0x3090('0x5c')][_0x3090('0x60')],'speech':_0x57dae6[_0x3090('0x5c')]['fulfillment'][_0x3090('0x61')],'score':_0x57dae6[_0x3090('0x5c')]['score'],'statusCode':_0x57dae6['status'][_0x3090('0x62')],'endConversation':_0x57dae6[_0x3090('0x5c')][_0x3090('0x63')][_0x3090('0x64')]||![],'isFallbackIntent':_0x57dae6[_0x3090('0x5c')][_0x3090('0x63')][_0x3090('0x65')]};});};exports[_0x3090('0x66')]=function(_0x19459d,_0x423c80,_0x356521,_0x38ddd4,_0x38ce78,_0x411d47){var _0x59aa4e=_0x38ddd4[_0x3090('0x67')](/\\n/g,'\x0a');var _0x1713cc={'credentials':{'private_key':_0x59aa4e,'client_email':_0x356521}};var _0x558025=new dialogflow['SessionsClient'](_0x1713cc);var _0x449f9a=_0x558025[_0x3090('0x68')](_0x423c80,md5(_0x19459d));var _0x479ca1={'session':_0x449f9a,'queryInput':{'text':{'text':_0x38ce78,'languageCode':_0x411d47}}};return _0x558025['detectIntent'](_0x479ca1)[_0x3090('0x2e')](function(_0x2906b1){if(_0x2906b1&&_0x2906b1[_0x3090('0x48')]){logger[_0x3090('0x1b')](_0x3090('0x69'),JSON['stringify'](_0x2906b1));var _0x52f814=_0x2906b1[0x0];if(_0x52f814){var _0x2759e5={'action':_0x52f814[_0x3090('0x6a')][_0x3090('0x5f')],'allRequiredParamsPresent':_0x52f814['queryResult']['allRequiredParamsPresent'],'endConversation':_0x52f814['queryResult'][_0x3090('0x6b')]&&_0x52f814[_0x3090('0x6a')][_0x3090('0x6b')]['fields']?_0x52f814[_0x3090('0x6a')]['diagnosticInfo'][_0x3090('0x6c')][_0x3090('0x6d')]['boolValue']:![],'fulfillmentText':_0x52f814[_0x3090('0x6a')][_0x3090('0x6e')],'intentName':_0x52f814[_0x3090('0x6a')]['intent'][_0x3090('0x59')],'intentDisplayName':_0x52f814[_0x3090('0x6a')][_0x3090('0x6f')]['displayName'],'isFallbackIntent':_0x52f814[_0x3090('0x6a')][_0x3090('0x6f')][_0x3090('0x70')],'languageCode':_0x52f814[_0x3090('0x6a')][_0x3090('0x71')],'queryText':_0x52f814[_0x3090('0x6a')][_0x3090('0x72')],'responseId':_0x52f814[_0x3090('0x73')],'score':_0x52f814['queryResult']['intentDetectionConfidence'],'speech':_0x52f814[_0x3090('0x6a')][_0x3090('0x6e')],'providerResponse':JSON['stringify'](_0x2906b1)};return _0x2759e5;}}});};exports['tildeASR']=function(_0xdc726e,_0x1b46c8,_0x20730d,_0x1b6c03){return tilde['asr'](_0xdc726e,_0x1b46c8,_0x20730d,_0x1b6c03)[_0x3090('0x2e')](function(_0x1d6338){try{fs[_0x3090('0x1d')](_0xdc726e);}catch(_0x487404){logger['error'](_0x487404);}logger[_0x3090('0x1b')](_0x3090('0x74'),_0x1d6338['transcript']);logger[_0x3090('0x1b')](_0x3090('0x75'),_0x1d6338[_0x3090('0x54')]);return _0x1d6338;});};exports['awsPolly']=function(_0x53181e,_0x57fb60,_0x4381f1,_0x3f2965,_0x17011d,_0x21ce75){var _0x5b02e1=path[_0x3090('0x29')](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+'.mp3');var _0x599817;return aws[_0x3090('0x76')](_0x53181e,_0x57fb60,_0x4381f1,_0x3f2965,_0x17011d,_0x21ce75,_0x5b02e1)[_0x3090('0x2e')](function(){_0x599817=path[_0x3090('0x29')](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+'.wav');return convertFile(_0x5b02e1,_0x599817);})[_0x3090('0x2e')](function(){try{fs['unlink'](_0x5b02e1);fs['chmodSync'](_0x599817,_0x3090('0x30'));}catch(_0x233123){logger[_0x3090('0x16')](_0x233123);}return _0x599817[_0x3090('0x31')]('.')[0x0];});};exports[_0x3090('0x77')]=function(_0x7c8ae8,_0x3697a7,_0x5202a2,_0x300d57,_0x19c0b6,_0x3e9c94){return aws[_0x3090('0x78')](_0x7c8ae8,_0x3697a7,_0x5202a2,_0x300d57,_0x19c0b6,_0x3e9c94)[_0x3090('0x2e')](function(_0x254c8e){logger['info'](JSON[_0x3090('0x44')](_0x254c8e));return _0x254c8e;});};exports[_0x3090('0x79')]=function(_0x5f2726,_0x1c66e8,_0xee43ea,_0x190870){var _0x179341=util[_0x3090('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x5f2726,encodeURIComponent(_0x1c66e8),_0xee43ea,_0x190870);var _0x3c120f=path['resolve'](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+'.mp3');var _0x219502;return downloadFile(_0x179341,_0x3c120f)[_0x3090('0x2e')](function(){_0x219502=path[_0x3090('0x29')](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+_0x3090('0x3d'));return convertFile(_0x3c120f,_0x219502);})['then'](function(){try{fs[_0x3090('0x1d')](_0x3c120f);fs[_0x3090('0x2f')](_0x219502,_0x3090('0x30'));}catch(_0x56ac35){logger[_0x3090('0x16')](_0x56ac35);}return _0x219502[_0x3090('0x31')]('.')[0x0];});};exports[_0x3090('0x7b')]=function(_0x16328d,_0x32f817,_0x69d2da,_0x3bf287){var _0x8c2f2c=util[_0x3090('0x7a')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x32f817,_0x69d2da,base64Encode(_0x16328d),_0x3bf287?util['format']('model=%s',encodeURIComponent(_0x3bf287)):'freeform=3');return uploadFile(_0x8c2f2c)[_0x3090('0x2e')](function(_0x213880){return querystring['parse'](_0x213880);});};exports[_0x3090('0x7c')]=function(_0x1ac103,_0x3c7c42){return sestek[_0x3090('0x7d')](_0x1ac103,_0x3c7c42)[_0x3090('0x2e')](function(_0x4faf25){logger[_0x3090('0x1b')](JSON[_0x3090('0x44')](_0x4faf25));var _0x525bb4={'speech':_0x4faf25[_0x3090('0x7e')],'action':_0x4faf25[_0x3090('0x7f')]?_0x4faf25[_0x3090('0x7f')][_0x3090('0x80')]:undefined,'actiondata':_0x4faf25['channelData']?_0x4faf25[_0x3090('0x7f')]['CustomActionData']:undefined};if(_0x4faf25[_0x3090('0x7f')]&&_0x4faf25[_0x3090('0x7f')][_0x3090('0x81')]){return base64Decode(_0x4faf25['channelData'][_0x3090('0x81')]['Data'],path[_0x3090('0x29')](__dirname,_0x3090('0x2a'),rs[_0x3090('0x2b')](0x4)+'.wav'))[_0x3090('0x2e')](function(_0x32198d){_0x525bb4[_0x3090('0x82')]=_0x32198d;return _0x525bb4;});}return _0x525bb4;});};exports[_0x3090('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0xdda3=['replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','md5','path','request-promise','randomstring','url','parse','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','host','data','transcode','error\x20convert','resolve','tmp','generate','writeFileSync','then','chmodSync','777','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','\x22\x20might\x20not\x20exist','.wav','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2'];(function(_0x121cf3,_0x2e8b1d){var _0x8aa6c9=function(_0xde74e6){while(--_0xde74e6){_0x121cf3['push'](_0x121cf3['shift']());}};_0x8aa6c9(++_0x2e8b1d);}(_0xdda3,0xaa));var _0x3dda=function(_0x13b65c,_0x1aa36f){_0x13b65c=_0x13b65c-0x0;var _0xb7b670=_0xdda3[_0x13b65c];return _0xb7b670;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x3dda('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x3dda('0x1'));var path=require(_0x3dda('0x2'));var querystring=require('querystring');var rp=require(_0x3dda('0x3'));var rs=require(_0x3dda('0x4'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x3dda('0x5'))[_0x3dda('0x6')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require(_0x3dda('0x7'));var tilde=require(_0x3dda('0x8'));var logger=require('../../../config/logger')(_0x3dda('0x9'));var ISPEECH_API=_0x3dda('0xa');function downloadFile(_0x39fd0c,_0x23285a){return new BPromise(function(_0x321742,_0x5f5cee){var _0xb6bb36=urlParse(_0x39fd0c);var _0x4b7832=_0xb6bb36[_0x3dda('0xb')]===_0x3dda('0xc')?https:http;var _0x1724e4={'host':_0xb6bb36['host'],'path':_0xb6bb36[_0x3dda('0x2')],'headers':{'user-agent':_0x3dda('0xd')}};_0x4b7832[_0x3dda('0xe')](_0x1724e4,function(_0x3904a2){if(_0x3904a2[_0x3dda('0xf')]!==0xc8){logger[_0x3dda('0x10')](_0x3dda('0x11')+_0x39fd0c+_0x3dda('0x12')+_0x3904a2[_0x3dda('0xf')]+'\x20('+_0x3904a2['statusMessage']+')');_0x5f5cee(new Error(_0x3dda('0x11')+_0x39fd0c+_0x3dda('0x12')+_0x3904a2[_0x3dda('0xf')]+'\x20('+_0x3904a2[_0x3dda('0x13')]+')'));return;}var _0x142b69=fs[_0x3dda('0x14')](_0x23285a);_0x142b69['on'](_0x3dda('0x15'),function(){logger[_0x3dda('0x16')](_0x3dda('0x17'));_0x142b69[_0x3dda('0x18')](_0x321742);});_0x142b69['on'](_0x3dda('0x10'),function(_0x210ebd){fs[_0x3dda('0x19')](_0x23285a);logger[_0x3dda('0x10')](_0x3dda('0x1a'),_0x210ebd);_0x5f5cee(_0x210ebd);});_0x3904a2[_0x3dda('0x1b')](_0x142b69);})['on'](_0x3dda('0x10'),function(_0x3b324f){logger[_0x3dda('0x10')](_0x3b324f);_0x5f5cee(_0x3b324f);})[_0x3dda('0x1c')]();});}function uploadFile(_0x4243d1){return new BPromise(function(_0xdac27c,_0x182ecd){var _0x27ed05=urlParse(_0x4243d1);var _0x2cf4fd=_0x27ed05[_0x3dda('0xb')]===_0x3dda('0xc')?https:http;var _0x1aba0d={'host':_0x27ed05[_0x3dda('0x1d')],'path':_0x27ed05[_0x3dda('0x2')],'headers':{'user-agent':_0x3dda('0xd')}};_0x2cf4fd[_0x3dda('0xe')](_0x1aba0d,function(_0x1d882e){if(_0x1d882e[_0x3dda('0xf')]!==0xc8){_0x182ecd(new Error(_0x3dda('0x11')+_0x4243d1+_0x3dda('0x12')+_0x1d882e[_0x3dda('0xf')]+'\x20('+_0x1d882e[_0x3dda('0x13')]+')'));return;}var _0x1c2dc5='';_0x1d882e['on'](_0x3dda('0x1e'),function(_0x35db66){_0x1c2dc5+=_0x35db66;});_0x1d882e['on'](_0x3dda('0x1c'),function(){_0xdac27c(_0x1c2dc5);});})['on'](_0x3dda('0x10'),function(_0x1012da){_0x182ecd(_0x1012da);})[_0x3dda('0x1c')]();});}function convertFile(_0x559b1e,_0xbca677){return new BPromise(function(_0x11a440,_0x311276){var _0x5def94=sox[_0x3dda('0x1f')](_0x559b1e,_0xbca677,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5def94['on'](_0x3dda('0x10'),function(_0xcb3d8b){logger[_0x3dda('0x10')](_0x3dda('0x20'),_0xcb3d8b);_0x311276(_0xcb3d8b);});_0x5def94['on'](_0x3dda('0x1c'),function(){logger['info']('finish\x20to\x20convert');_0x11a440();});_0x5def94['start']();});}function base64Decode(_0xae9765,_0x71b881){var _0x2b00d4=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+'.wav');fs[_0x3dda('0x24')](_0x2b00d4,_0xae9765,'base64');return convertFile(_0x2b00d4,_0x71b881)[_0x3dda('0x25')](function(){try{fs[_0x3dda('0x19')](_0x2b00d4);fs[_0x3dda('0x26')](_0x71b881,_0x3dda('0x27'));}catch(_0x36472f){logger[_0x3dda('0x10')](_0x36472f);}return _0x71b881[_0x3dda('0x28')]('.')[0x0];});}function base64Encode(_0x560885){var _0x24dbd5=fs[_0x3dda('0x29')](_0x560885);return new Buffer(_0x24dbd5)['toString'](_0x3dda('0x2a'));}exports[_0x3dda('0x2b')]=function(_0x592ee6,_0x3a4a4f,_0x33f3af,_0x52133d,_0x859a74,_0x4f2f1c){var _0x9af645,_0x402a8f;var _0x513981=_0x3dda('0x2c');var _0x1cc517='?key='+_0x592ee6;var _0x5e28ba={};if(_0x3a4a4f===_0x3dda('0x2d')){_0x5e28ba['input']={'ssml':_0x33f3af};}else{_0x5e28ba[_0x3dda('0x2e')]={'text':_0x33f3af};};_0x5e28ba['voice']={'languageCode':_0x52133d,'ssmlGender':_0x859a74};_0x5e28ba[_0x3dda('0x2f')]={'audioEncoding':_0x3dda('0x30'),'sampleRateHertz':0x1f40};var _0x56ef24={'url':_0x513981+_0x3dda('0x31')+_0x1cc517,'method':_0x3dda('0x32'),'json':!![],'body':_0x5e28ba};return rp(_0x56ef24)[_0x3dda('0x25')](function(_0x68d624){return new BPromise(function(_0x499d65,_0x362d85){_0x9af645=path['resolve'](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x33'));var _0x18fb33=Buffer[_0x3dda('0x34')](_0x68d624[_0x3dda('0x35')],_0x3dda('0x2a'));return fs[_0x3dda('0x36')](_0x9af645,_0x18fb33,function(_0x4f33b){_0x362d85(_0x4f33b);},function(_0x3cd5a3){fs[_0x3dda('0x26')](_0x9af645,_0x3dda('0x27'));_0x499d65(_0x3cd5a3);});});})['then'](function(_0x2c5c22){_0x402a8f=path['resolve'](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+'.wav');return convertFile(_0x9af645,_0x402a8f);})[_0x3dda('0x25')](function(){try{fs['unlink'](_0x9af645);fs[_0x3dda('0x26')](_0x402a8f,'777');}catch(_0x5eeda5){logger['error'](_0x5eeda5);}logger[_0x3dda('0x16')]('googleCloudTTS\x20path',_0x402a8f[_0x3dda('0x28')]('.')[0x0]);return _0x402a8f['split']('.')[0x0];});};exports[_0x3dda('0x37')]=function(_0x1a25ce,_0x34054a){var _0x14b566='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x175085,_0x13321d;var _0xf179f2;var _0x37f7fb={'encoding':_0x3dda('0x38'),'method':'POST','timeout':0x2710,'url':_0x14b566,'headers':{'Content-Type':_0x3dda('0x39')},'body':_0x3dda('0x3a')+encodeURIComponent(JSON['stringify']([[[_0x3dda('0x3b'),JSON[_0x3dda('0x3c')]([_0x1a25ce,_0x34054a||'en',![],_0x3dda('0x3d')]),null,_0x3dda('0x3e')]]]))};return rp(_0x37f7fb)[_0x3dda('0x25')](function(_0x81c09){try{_0xf179f2=eval(_0x81c09[_0x3dda('0x3f')](0x5))[0x0][0x2];}catch(_0x49e607){throw new Error(_0x3dda('0x40')+_0x81c09[_0x3dda('0x1e')]);}if(!_0xf179f2){if(_0x1a25ce['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x34054a+_0x3dda('0x41'));}}try{_0xf179f2=eval(_0xf179f2)[0x0];}catch(_0x53c5ee){throw new Error(_0x3dda('0x40')+res[_0x3dda('0x1e')]);}const _0x2ea7c5=_0xf179f2;_0x175085=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs['generate'](0x4)+_0x3dda('0x33'));fs[_0x3dda('0x24')](_0x175085,_0xf179f2,{'encoding':_0x3dda('0x2a')});_0x13321d=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42'));return convertFile(_0x175085,_0x13321d);})[_0x3dda('0x25')](function(){try{fs[_0x3dda('0x19')](_0x175085);fs[_0x3dda('0x26')](_0x13321d,'777');}catch(_0x3469df){logger['error'](_0x3469df);}logger[_0x3dda('0x16')](_0x3dda('0x43'),_0x13321d[_0x3dda('0x28')]('.')[0x0]);return _0x13321d[_0x3dda('0x28')]('.')[0x0];});};exports[_0x3dda('0x44')]=function(_0x361255,_0x32c801,_0x27ccf9){return google['asr'](_0x361255,_0x32c801,_0x27ccf9)[_0x3dda('0x25')](function(_0x37aaf9){logger[_0x3dda('0x16')](_0x37aaf9['uri']);return rp(_0x37aaf9);})[_0x3dda('0x25')](function(_0x14fe95){var _0x517f76='';var _0x2de923=0x0;try{fs[_0x3dda('0x19')](_0x361255);}catch(_0x3e115a){logger[_0x3dda('0x10')](_0x3e115a);}if(_0x14fe95&&_0x14fe95[_0x3dda('0x45')]){_0x517f76=_0x14fe95[_0x3dda('0x45')][_0x3dda('0x46')](function(_0xbe590a){return _0xbe590a&&_0xbe590a[_0x3dda('0x47')][0x0]&&_0xbe590a[_0x3dda('0x47')][0x0]['transcript']?_0xbe590a[_0x3dda('0x47')][0x0][_0x3dda('0x48')]:'';})[_0x3dda('0x49')]('\x0a');_0x2de923=_0x14fe95['results'][_0x3dda('0x46')](function(_0x26a78f){return _0x26a78f&&_0x26a78f[_0x3dda('0x47')][0x0]&&_0x26a78f[_0x3dda('0x47')][0x0][_0x3dda('0x4a')]?_0x26a78f[_0x3dda('0x47')][0x0][_0x3dda('0x4a')]:0x0;})['join']('\x0a');}logger['info'](_0x3dda('0x4b'),_0x517f76);logger['info'](_0x3dda('0x4c'),_0x2de923);return{'transcript':_0x517f76,'confidence':_0x2de923};})[_0x3dda('0x4d')](function(_0x1281b2){logger[_0x3dda('0x10')]('[%s]\x20%s:%s',_0x1281b2[_0x3dda('0xf')],_0x1281b2['name'],_0x1281b2[_0x3dda('0x4e')]);});};exports['googleDialogflow']=function(_0x58b75f,_0x1eb3fd,_0x259751,_0x2328d0){var _0x2c7308=apiai(_0x1eb3fd,{'language':_0x2328d0||'en'});return _0x2c7308[_0x3dda('0x4f')](_0x259751,{'sessionId':md5(_0x58b75f)})[_0x3dda('0x25')](function(_0xfca36){logger[_0x3dda('0x16')](JSON[_0x3dda('0x3c')](_0xfca36));return{'source':_0xfca36[_0x3dda('0x50')][_0x3dda('0x51')],'resolvedQuery':_0xfca36[_0x3dda('0x50')][_0x3dda('0x52')],'action':_0xfca36[_0x3dda('0x50')]['action'],'actionIncomplete':_0xfca36[_0x3dda('0x50')][_0x3dda('0x53')],'speech':_0xfca36[_0x3dda('0x50')][_0x3dda('0x54')][_0x3dda('0x55')],'score':_0xfca36[_0x3dda('0x50')][_0x3dda('0x56')],'statusCode':_0xfca36['status'][_0x3dda('0x57')],'endConversation':_0xfca36[_0x3dda('0x50')][_0x3dda('0x58')][_0x3dda('0x59')]||![],'isFallbackIntent':_0xfca36[_0x3dda('0x50')][_0x3dda('0x58')][_0x3dda('0x5a')]};});};exports[_0x3dda('0x5b')]=function(_0x41b279,_0x309e09,_0x1796ec,_0x8aae,_0xe9dd95,_0xe5ac94){var _0x37c6d0=_0x8aae[_0x3dda('0x5c')](/\\n/g,'\x0a');var _0x189096={'credentials':{'private_key':_0x37c6d0,'client_email':_0x1796ec}};var _0x555b89=new dialogflow[(_0x3dda('0x5d'))](_0x189096);var _0x5f2459=_0x555b89[_0x3dda('0x5e')](_0x309e09,md5(_0x41b279));var _0x3fdae9={'session':_0x5f2459,'queryInput':{'text':{'text':_0xe9dd95,'languageCode':_0xe5ac94}}};return _0x555b89[_0x3dda('0x5f')](_0x3fdae9)[_0x3dda('0x25')](function(_0x8150f2){if(_0x8150f2&&_0x8150f2['length']){logger[_0x3dda('0x16')](_0x3dda('0x60'),JSON['stringify'](_0x8150f2));var _0x38daf0=_0x8150f2[0x0];if(_0x38daf0){var _0x4e8207={'action':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x62')],'allRequiredParamsPresent':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x63')],'endConversation':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x64')]&&_0x38daf0[_0x3dda('0x61')]['diagnosticInfo'][_0x3dda('0x65')]?_0x38daf0['queryResult'][_0x3dda('0x64')][_0x3dda('0x65')][_0x3dda('0x66')][_0x3dda('0x67')]:![],'fulfillmentText':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x68')],'intentName':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x69')][_0x3dda('0x6a')],'intentDisplayName':_0x38daf0['queryResult'][_0x3dda('0x69')]['displayName'],'isFallbackIntent':_0x38daf0['queryResult'][_0x3dda('0x69')]['isFallback'],'languageCode':_0x38daf0['queryResult'][_0x3dda('0x6b')],'queryText':_0x38daf0[_0x3dda('0x61')]['queryText'],'responseId':_0x38daf0[_0x3dda('0x6c')],'score':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x6d')],'speech':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x68')],'providerResponse':JSON[_0x3dda('0x3c')](_0x8150f2)};return _0x4e8207;}}});};exports[_0x3dda('0x6e')]=function(_0x4249bc,_0x1cf6b4,_0x35b403,_0x1a6cbc){return tilde['asr'](_0x4249bc,_0x1cf6b4,_0x35b403,_0x1a6cbc)['then'](function(_0x48f572){try{fs['unlink'](_0x4249bc);}catch(_0x1e8646){logger[_0x3dda('0x10')](_0x1e8646);}logger[_0x3dda('0x16')](_0x3dda('0x6f'),_0x48f572[_0x3dda('0x48')]);logger[_0x3dda('0x16')](_0x3dda('0x70'),_0x48f572[_0x3dda('0x4a')]);return _0x48f572;});};exports['awsPolly']=function(_0x53b5f8,_0x5f3c52,_0x435150,_0x4fc47b,_0x85afa7,_0x4494da){var _0x2a082c=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x33'));var _0x3decb2;return aws[_0x3dda('0x71')](_0x53b5f8,_0x5f3c52,_0x435150,_0x4fc47b,_0x85afa7,_0x4494da,_0x2a082c)['then'](function(){_0x3decb2=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42'));return convertFile(_0x2a082c,_0x3decb2);})[_0x3dda('0x25')](function(){try{fs[_0x3dda('0x19')](_0x2a082c);fs['chmodSync'](_0x3decb2,'777');}catch(_0x5817fc){logger[_0x3dda('0x10')](_0x5817fc);}return _0x3decb2[_0x3dda('0x28')]('.')[0x0];});};exports[_0x3dda('0x72')]=function(_0x49e104,_0x3d40fd,_0x41801e,_0x153972,_0x5c1fd4,_0x2deb67){return aws[_0x3dda('0x73')](_0x49e104,_0x3d40fd,_0x41801e,_0x153972,_0x5c1fd4,_0x2deb67)[_0x3dda('0x25')](function(_0x3be3d6){logger[_0x3dda('0x16')](JSON[_0x3dda('0x3c')](_0x3be3d6));return _0x3be3d6;});};exports[_0x3dda('0x74')]=function(_0x23e9c0,_0x3f806f,_0xe420e3,_0x3f1962){var _0x24bb66=util[_0x3dda('0x75')](_0x3dda('0x76'),ISPEECH_API,_0x23e9c0,encodeURIComponent(_0x3f806f),_0xe420e3,_0x3f1962);var _0x2aea9b=path['resolve'](__dirname,_0x3dda('0x22'),rs['generate'](0x4)+_0x3dda('0x33'));var _0x2a3bcb;return downloadFile(_0x24bb66,_0x2aea9b)[_0x3dda('0x25')](function(){_0x2a3bcb=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42'));return convertFile(_0x2aea9b,_0x2a3bcb);})[_0x3dda('0x25')](function(){try{fs['unlink'](_0x2aea9b);fs[_0x3dda('0x26')](_0x2a3bcb,'777');}catch(_0x162495){logger[_0x3dda('0x10')](_0x162495);}return _0x2a3bcb[_0x3dda('0x28')]('.')[0x0];});};exports['ispeechASR']=function(_0x5aab9b,_0x350d7d,_0x72a75,_0x51b1c3){var _0x37b817=util['format'](_0x3dda('0x77'),ISPEECH_API,_0x350d7d,_0x72a75,base64Encode(_0x5aab9b),_0x51b1c3?util[_0x3dda('0x75')](_0x3dda('0x78'),encodeURIComponent(_0x51b1c3)):_0x3dda('0x79'));return uploadFile(_0x37b817)[_0x3dda('0x25')](function(_0x582499){return querystring[_0x3dda('0x6')](_0x582499);});};exports['sestekNDA']=function(_0x3de63a,_0x226e64){return sestek[_0x3dda('0x7a')](_0x3de63a,_0x226e64)['then'](function(_0x23ce36){logger[_0x3dda('0x16')](JSON[_0x3dda('0x3c')](_0x23ce36));var _0xfb9b47={'speech':_0x23ce36[_0x3dda('0x7b')],'action':_0x23ce36[_0x3dda('0x7c')]?_0x23ce36[_0x3dda('0x7c')][_0x3dda('0x7d')]:undefined,'actiondata':_0x23ce36[_0x3dda('0x7c')]?_0x23ce36[_0x3dda('0x7c')][_0x3dda('0x7e')]:undefined};if(_0x23ce36[_0x3dda('0x7c')]&&_0x23ce36[_0x3dda('0x7c')][_0x3dda('0x7f')]){return base64Decode(_0x23ce36[_0x3dda('0x7c')]['AudioFromTts'][_0x3dda('0x80')],path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42')))[_0x3dda('0x25')](function(_0xee4de6){_0xfb9b47[_0x3dda('0x81')]=_0xee4de6;return _0xfb9b47;});}return _0xfb9b47;});};exports[_0x3dda('0x82')]=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 6eac48d..938344a 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 _0x1279=['exports','./nda'];(function(_0x58b332,_0x54787d){var _0xb8e97e=function(_0x418171){while(--_0x418171){_0x58b332['push'](_0x58b332['shift']());}};_0xb8e97e(++_0x54787d);}(_0x1279,0x6d));var _0x9127=function(_0x4a41a8,_0x4a5012){_0x4a41a8=_0x4a41a8-0x0;var _0x383d95=_0x1279[_0x4a41a8];return _0x383d95;};var nda=require(_0x9127('0x0'));module[_0x9127('0x1')]={'nda':nda}; \ No newline at end of file +var _0x79b1=['./nda','exports'];(function(_0x35c577,_0x1c7f6e){var _0xb58a85=function(_0x8182ef){while(--_0x8182ef){_0x35c577['push'](_0x35c577['shift']());}};_0xb58a85(++_0x1c7f6e);}(_0x79b1,0x1c8));var _0x179b=function(_0x443f3f,_0x27a733){_0x443f3f=_0x443f3f-0x0;var _0x2e4b8e=_0x79b1[_0x443f3f];return _0x2e4b8e;};var nda=require(_0x179b('0x0'));module[_0x179b('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 ab9a3ab..5013004 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 _0x33a4=['project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','body','info','stringify','url','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','message','Nda','uniqueid','callerid','calleridname','text','Bearer\x20','access_token'];(function(_0x583249,_0xa121cd){var _0x4bd45e=function(_0x1c79a1){while(--_0x1c79a1){_0x583249['push'](_0x583249['shift']());}};_0x4bd45e(++_0xa121cd);}(_0x33a4,0x88));var _0x433a=function(_0x3cf5a7,_0x3cad36){_0x3cf5a7=_0x3cf5a7-0x0;var _0x30dc5b=_0x33a4[_0x3cf5a7];return _0x30dc5b;};'use strict';var rp=require('request-promise');var url=require(_0x433a('0x0'));var logger=require('../../../../../config/logger')(_0x433a('0x1'));module[_0x433a('0x2')]=function(_0x1917aa,_0x4909a4){var _0x4b7aef={'method':'POST','uri':url[_0x433a('0x3')](_0x4909a4[_0x433a('0x4')],_0x433a('0x5')),'form':{'grant_type':_0x433a('0x6'),'username':_0x4909a4[_0x433a('0x7')],'password':_0x4909a4['password']},'json':!![]};return rp(_0x4b7aef)[_0x433a('0x8')](function(_0x58e65c){var _0x2c2404={'method':_0x433a('0x9'),'uri':url[_0x433a('0x3')](_0x4909a4[_0x433a('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4909a4['ndaactivity_type']||_0x433a('0xb'),'channelId':_0x433a('0xc'),'conversation':{'id':_0x1917aa[_0x433a('0xd')]},'from':{'id':_0x1917aa[_0x433a('0xe')],'name':_0x1917aa[_0x433a('0xf')]},'recipient':{'id':_0x1917aa['dnid'],'name':_0x1917aa['extension']},'text':_0x4909a4[_0x433a('0x10')],'channelData':{}},'headers':{'Authorization':_0x433a('0x11')+_0x58e65c[_0x433a('0x12')]},'json':!![]};if(_0x4909a4[_0x433a('0x13')]){_0x2c2404['body'][_0x433a('0x14')][_0x433a('0x15')]=_0x4909a4['project'];}if(_0x4909a4[_0x433a('0x16')]=='1'){_0x2c2404['body'][_0x433a('0x14')][_0x433a('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x433a('0x18')};}if(_0x4909a4['custom_action']){_0x2c2404['body'][_0x433a('0x14')][_0x433a('0x19')]=_0x4909a4[_0x433a('0x1a')];if(_0x4909a4[_0x433a('0x1b')]){_0x2c2404[_0x433a('0x1c')]['channelData']['CustomActionData']=_0x4909a4[_0x433a('0x1b')];}}logger[_0x433a('0x1d')](JSON[_0x433a('0x1e')](_0x2c2404));return rp(_0x2c2404);});}; \ No newline at end of file +var _0x8e0d=['request-promise','agi','exports','POST','resolve','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','dnid','extension','text','project','channelData','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify'];(function(_0x2e1c53,_0x2b2182){var _0x47f844=function(_0x28e8c6){while(--_0x28e8c6){_0x2e1c53['push'](_0x2e1c53['shift']());}};_0x47f844(++_0x2b2182);}(_0x8e0d,0x82));var _0xd8e0=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x8e0d[_0x3430aa];return _0x2ac5c;};'use strict';var rp=require(_0xd8e0('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0xd8e0('0x1'));module[_0xd8e0('0x2')]=function(_0x549e82,_0x3ee520){var _0x180f36={'method':_0xd8e0('0x3'),'uri':url[_0xd8e0('0x4')](_0x3ee520['ndauth_url'],'/token'),'form':{'grant_type':_0xd8e0('0x5'),'username':_0x3ee520[_0xd8e0('0x6')],'password':_0x3ee520[_0xd8e0('0x5')]},'json':!![]};return rp(_0x180f36)[_0xd8e0('0x7')](function(_0x5e9735){var _0xd0c45c={'method':_0xd8e0('0x3'),'uri':url[_0xd8e0('0x4')](_0x3ee520[_0xd8e0('0x8')],_0xd8e0('0x9')),'body':{'type':_0x3ee520['ndaactivity_type']||_0xd8e0('0xa'),'channelId':'Nda','conversation':{'id':_0x549e82[_0xd8e0('0xb')]},'from':{'id':_0x549e82['callerid'],'name':_0x549e82['calleridname']},'recipient':{'id':_0x549e82[_0xd8e0('0xc')],'name':_0x549e82[_0xd8e0('0xd')]},'text':_0x3ee520[_0xd8e0('0xe')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5e9735['access_token']},'json':!![]};if(_0x3ee520[_0xd8e0('0xf')]){_0xd0c45c['body'][_0xd8e0('0x10')]['ProjectName']=_0x3ee520['project'];}if(_0x3ee520['ndagenerate_audio']=='1'){_0xd0c45c[_0xd8e0('0x11')]['channelData'][_0xd8e0('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xd8e0('0x13')};}if(_0x3ee520[_0xd8e0('0x14')]){_0xd0c45c[_0xd8e0('0x11')][_0xd8e0('0x10')][_0xd8e0('0x15')]=_0x3ee520[_0xd8e0('0x14')];if(_0x3ee520[_0xd8e0('0x16')]){_0xd0c45c[_0xd8e0('0x11')]['channelData'][_0xd8e0('0x17')]=_0x3ee520[_0xd8e0('0x16')];}}logger[_0xd8e0('0x18')](JSON[_0xd8e0('0x19')](_0xd0c45c));return rp(_0xd0c45c);});}; \ 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 2e30b9c..9ea63b8 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 _0x4ddf=['./lib/api','exports'];(function(_0x459a3e,_0x1d5da8){var _0x4c400d=function(_0x570300){while(--_0x570300){_0x459a3e['push'](_0x459a3e['shift']());}};_0x4c400d(++_0x1d5da8);}(_0x4ddf,0xe4));var _0xf4dd=function(_0x4e946f,_0x24584f){_0x4e946f=_0x4e946f-0x0;var _0x372ad7=_0x4ddf[_0x4e946f];return _0x372ad7;};'use strict';var asr=require(_0xf4dd('0x0'));module[_0xf4dd('0x1')]=function(_0x233ada,_0x473c45,_0x51eb0b,_0x34b1e2){return asr(_0x233ada,_0x473c45,_0x51eb0b,_0x34b1e2);}; \ No newline at end of file +var _0x348a=['exports','./lib/api'];(function(_0x5685bc,_0x2585c7){var _0x9694d4=function(_0x15868c){while(--_0x15868c){_0x5685bc['push'](_0x5685bc['shift']());}};_0x9694d4(++_0x2585c7);}(_0x348a,0xd3));var _0xa348=function(_0x49be0c,_0x4774fd){_0x49be0c=_0x49be0c-0x0;var _0x2b34aa=_0x348a[_0x49be0c];return _0x2b34aa;};'use strict';var asr=require(_0xa348('0x0'));module[_0xa348('0x1')]=function(_0x423c26,_0x54f726,_0x40b82e,_0x22a3de){return asr(_0x423c26,_0x54f726,_0x40b82e,_0x22a3de);}; \ 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 f1b17b6..251abac 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 _0x1932=['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','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','data','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','stringify','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','isNil','isObject','open','message','close','bluebird','crypto','../../../../../../config/logger','agi','exports','info'];(function(_0x332bb7,_0x86d0c3){var _0x48f551=function(_0x49d9c2){while(--_0x49d9c2){_0x332bb7['push'](_0x332bb7['shift']());}};_0x48f551(++_0x86d0c3);}(_0x1932,0x1b2));var _0x2193=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x1932[_0x3d42d8];return _0x27fc41;};'use strict';var BPromise=require(_0x2193('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x2193('0x1'));var logger=require(_0x2193('0x2'))(_0x2193('0x3'));module[_0x2193('0x4')]=function(_0x9066e8,_0x2f0407,_0x3e4d0d,_0x18c449){return new BPromise(function(_0x4e1d94,_0x13b4c9){logger[_0x2193('0x5')]('Tilde\x20URI',_0x18c449||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x5e5e61=new WebSocket(_0x18c449||_0x2193('0x6'),{'perMessageDeflate':![]});var _0x8ea0d2='';var _0x597fa4='0';var _0x5e9960='1';var _0x5a3f7c=_0x2193('0x7');function _0xc9296b(_0xecb3be){var _0x40733f=crypto['createHash'](_0x2193('0x8'));_0x40733f[_0x2193('0x9')](_0xecb3be);return _0x40733f[_0x2193('0xa')](_0x2193('0xb'));}function _0x1b1e8e(){try{logger[_0x2193('0x5')](_0x2193('0xc'));var _0x5f1d03=moment()[_0x2193('0xd')]();var _0x59ed43=_0xc9296b(_0x5f1d03+_0x2f0407+_0x3e4d0d);_0x5e5e61[_0x2193('0xe')](JSON['stringify']({'appID':_0x2f0407,'timestamp':_0x5f1d03,'appKey':_0x59ed43}));var _0x371fb9=fs['createReadStream'](_0x9066e8);_0x371fb9['on'](_0x2193('0xf'),function(_0x1fa585){_0x5e5e61[_0x2193('0xe')](_0x1fa585);});_0x371fb9['on']('close',function(){_0x5e5e61['send'](_0x2193('0x10'));});}catch(_0x4b771c){logger[_0x2193('0x11')](_0x2193('0x12'),JSON['stringify'](_0x4b771c));_0x5e5e61['terminate']();}}function _0x5f584f(_0x10d4fa){try{if(_0x10d4fa){var _0x1656dd=JSON[_0x2193('0x13')](_0x10d4fa);switch(_0x1656dd[_0x2193('0x14')]){case 0x0:if(_0x1656dd[_0x2193('0x15')]){if(_0x1656dd['result'][_0x2193('0x16')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x2193('0x17')](_0x1656dd['result'][_0x2193('0x18')]));_0x8ea0d2=_0x1656dd['result']['hypotheses'][0x0][_0x2193('0x19')];_0x597fa4=_0x1656dd['result'][_0x2193('0x18')][0x0][_0x2193('0x1a')];_0x5e9960='0';_0x5a3f7c=_0x2193('0x1b');_0x5e5e61[_0x2193('0x1c')]();}}break;case 0x1:logger[_0x2193('0x5')](_0x2193('0x7'));_0x5e9960='1';_0x5a3f7c=_0x2193('0x7');break;case 0x2:logger[_0x2193('0x5')](_0x2193('0x1d'));_0x5e9960='2';_0x5a3f7c=_0x2193('0x1d');break;case 0x9:logger[_0x2193('0x5')](_0x2193('0x1e'));_0x5e9960='9';_0x5a3f7c=_0x2193('0x1e');break;case 0xa:logger[_0x2193('0x5')](_0x2193('0x1f'));_0x5e9960='10';_0x5a3f7c='Authentication\x20failed.';break;case 0xb:logger[_0x2193('0x5')](_0x2193('0x20'));_0x5e9960='11';_0x5a3f7c='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1a2cc0){logger[_0x2193('0x11')](_0x2193('0x21'),JSON[_0x2193('0x17')](_0x1a2cc0));_0x5e5e61['terminate']();}}function _0x2716b5(){logger[_0x2193('0x5')](_0x2193('0x22'));_0x4e1d94({'transcript':_0x8ea0d2,'confidence':_0x597fa4,'status':_0x5e9960,'status_message':_0x5a3f7c});}function _0xd4c5f3(_0x4f26cf){logger[_0x2193('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x2193('0x23')](_0x4f26cf)){logger[_0x2193('0x11')](_[_0x2193('0x24')](_0x4f26cf)?JSON[_0x2193('0x17')](_0x4f26cf):_0x4f26cf);}}_0x5e5e61['on'](_0x2193('0x25'),_0x1b1e8e);_0x5e5e61['on'](_0x2193('0x26'),_0x5f584f);_0x5e5e61['on'](_0x2193('0x27'),_0x2716b5);_0x5e5e61['on']('error',_0xd4c5f3);});}; \ No newline at end of file +var _0x52a9=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','transcript','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x30b4cc,_0x566dc8){var _0x5b956d=function(_0x1b193e){while(--_0x1b193e){_0x30b4cc['push'](_0x30b4cc['shift']());}};_0x5b956d(++_0x566dc8);}(_0x52a9,0x9e));var _0x952a=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x52a9[_0xe66cf2];return _0x2d84e7;};'use strict';var BPromise=require(_0x952a('0x0'));var _=require(_0x952a('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x952a('0x2'));var crypto=require(_0x952a('0x3'));var logger=require(_0x952a('0x4'))(_0x952a('0x5'));module[_0x952a('0x6')]=function(_0x26713b,_0x519815,_0x161059,_0x4fff93){return new BPromise(function(_0x519f07,_0x22f9bc){logger[_0x952a('0x7')](_0x952a('0x8'),_0x4fff93||_0x952a('0x9'));var _0x189145=new WebSocket(_0x4fff93||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1b5566='';var _0x4da820='0';var _0x3dfa06='1';var _0x1413a5=_0x952a('0xa');function _0x596557(_0x55fcee){var _0x14d80d=crypto['createHash']('sha1');_0x14d80d['update'](_0x55fcee);return _0x14d80d['digest'](_0x952a('0xb'));}function _0x198f06(){try{logger[_0x952a('0x7')](_0x952a('0xc'));var _0x2148df=moment()[_0x952a('0xd')]();var _0x205176=_0x596557(_0x2148df+_0x519815+_0x161059);_0x189145[_0x952a('0xe')](JSON[_0x952a('0xf')]({'appID':_0x519815,'timestamp':_0x2148df,'appKey':_0x205176}));var _0x39192a=fs[_0x952a('0x10')](_0x26713b);_0x39192a['on'](_0x952a('0x11'),function(_0x24e096){_0x189145[_0x952a('0xe')](_0x24e096);});_0x39192a['on'](_0x952a('0x12'),function(){_0x189145[_0x952a('0xe')](_0x952a('0x13'));});}catch(_0x50228d){logger['error'](_0x952a('0x14'),JSON[_0x952a('0xf')](_0x50228d));_0x189145[_0x952a('0x15')]();}}function _0x3106e1(_0x106082){try{if(_0x106082){var _0x1ee8c5=JSON[_0x952a('0x16')](_0x106082);switch(_0x1ee8c5[_0x952a('0x17')]){case 0x0:if(_0x1ee8c5[_0x952a('0x18')]){if(_0x1ee8c5[_0x952a('0x18')][_0x952a('0x19')]){logger[_0x952a('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0x952a('0xf')](_0x1ee8c5[_0x952a('0x18')]['hypotheses']));_0x1b5566=_0x1ee8c5['result']['hypotheses'][0x0][_0x952a('0x1a')];_0x4da820=_0x1ee8c5[_0x952a('0x18')][_0x952a('0x1b')][0x0][_0x952a('0x1c')];_0x3dfa06='0';_0x1413a5=_0x952a('0x1d');_0x189145[_0x952a('0x15')]();}}break;case 0x1:logger[_0x952a('0x7')](_0x952a('0xa'));_0x3dfa06='1';_0x1413a5=_0x952a('0xa');break;case 0x2:logger[_0x952a('0x7')](_0x952a('0x1e'));_0x3dfa06='2';_0x1413a5=_0x952a('0x1e');break;case 0x9:logger[_0x952a('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3dfa06='9';_0x1413a5=_0x952a('0x1f');break;case 0xa:logger[_0x952a('0x7')](_0x952a('0x20'));_0x3dfa06='10';_0x1413a5=_0x952a('0x20');break;case 0xb:logger[_0x952a('0x7')](_0x952a('0x21'));_0x3dfa06='11';_0x1413a5=_0x952a('0x21');}}}catch(_0x351104){logger[_0x952a('0x22')](_0x952a('0x23'),JSON['stringify'](_0x351104));_0x189145['terminate']();}}function _0x305408(){logger[_0x952a('0x7')](_0x952a('0x24'));_0x519f07({'transcript':_0x1b5566,'confidence':_0x4da820,'status':_0x3dfa06,'status_message':_0x1413a5});}function _0x37784c(_0x24386b){logger[_0x952a('0x22')](_0x952a('0x25'));if(!_[_0x952a('0x26')](_0x24386b)){logger[_0x952a('0x22')](_[_0x952a('0x27')](_0x24386b)?JSON[_0x952a('0xf')](_0x24386b):_0x24386b);}}_0x189145['on'](_0x952a('0x28'),_0x198f06);_0x189145['on'](_0x952a('0x29'),_0x3106e1);_0x189145['on'](_0x952a('0x12'),_0x305408);_0x189145['on']('error',_0x37784c);});}; \ 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 bb47435..ac21cfd 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 _0xbb25=['exports','./asr'];(function(_0x35df76,_0x5e79a5){var _0x41a0bb=function(_0xf2492f){while(--_0xf2492f){_0x35df76['push'](_0x35df76['shift']());}};_0x41a0bb(++_0x5e79a5);}(_0xbb25,0x99));var _0x5bb2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb25[_0x3dd15e];return _0x231fd0;};var asr=require(_0x5bb2('0x0'));module[_0x5bb2('0x1')]={'asr':asr}; \ No newline at end of file +var _0xcd74=['./asr','exports'];(function(_0xaf4dff,_0x30c5c8){var _0x4af91b=function(_0x6bb906){while(--_0x6bb906){_0xaf4dff['push'](_0xaf4dff['shift']());}};_0x4af91b(++_0x30c5c8);}(_0xcd74,0x162));var _0x4cd7=function(_0x3eea3f,_0x473c51){_0x3eea3f=_0x3eea3f-0x0;var _0x1e3000=_0xcd74[_0x3eea3f];return _0x1e3000;};var asr=require(_0x4cd7('0x0'));module[_0x4cd7('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index cbad791..d00b8eb 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x12aba8,_0x40a036){var _0x2aac66=function(_0x3e56b7){while(--_0x3e56b7){_0x12aba8['push'](_0x12aba8['shift']());}};_0x2aac66(++_0x40a036);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _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(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 8c431a2..f821e98 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 _0x3561=['%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Response:','inspect','%s_STATUS_CODE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','mailRpc','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','exec','trim','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','restAPI','url','timeout','includes','PUT','toUpperCase','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','saveRestApiResult','%s.%s','setVariable','replaceAllVariables','split','length','replaceAll','getAndSetVariable','getVariable','result','extra','isConfigured','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','query','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','sip_id','no\x20user\x20selected','opts','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20private_key\x20configured','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20selected','trunk_name','DIAL','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x3561,0x94));var _0x1356=function(_0x32c87d,_0x3ae0c6){_0x32c87d=_0x32c87d-0x0;var _0x3189b8=_0x3561[_0x32c87d];return _0x3189b8;};'use strict';var fs=require('fs');var util=require(_0x1356('0x0'));var _=require('lodash');var sh=require(_0x1356('0x1'));var odbc=require(_0x1356('0x2'))();var rs=require(_0x1356('0x3'));var moment=require(_0x1356('0x4'));var Mustache=require(_0x1356('0x5'));var rp=require(_0x1356('0x6'));var logger=require(_0x1356('0x7'))(_0x1356('0x8'));var config=require(_0x1356('0x9'));var scripts=require(_0x1356('0xa'));var FILES_PATH=_0x1356('0xb');var recursiveMapAttributes=[_0x1356('0xc'),_0x1356('0xd')];var verticesWithRetry=['menu',_0x1356('0xe'),_0x1356('0xf')];var AGIVertices=function(_0x1e98ae,_0x55551e,_0x5e8516){this[_0x1356('0x10')]=_0x1e98ae;this[_0x1356('0x11')]=_0x55551e;this['mailRpc']=_0x5e8516;};AGIVertices[_0x1356('0x12')]['getVariable']=function(_0x301f64,_0x2d5865){this['rpc'][_0x1356('0x13')](_0x301f64)[_0x1356('0x14')](function(_0x58b39e){_0x2d5865(null,_0x58b39e?_0x58b39e[_0x1356('0x15')]:![]);})[_0x1356('0x16')](function(_0x466604){_0x2d5865(_0x466604);});};AGIVertices[_0x1356('0x12')][_0x1356('0x17')]=function(_0x107080,_0x70c471){this[_0x1356('0x11')][_0x1356('0x18')](_0x107080)[_0x1356('0x14')](function(_0x396402){_0x70c471(null,_0x396402?_0x396402[_0x1356('0x15')]:![]);})[_0x1356('0x16')](function(_0x47a952){_0x70c471(_0x47a952);});};AGIVertices['prototype'][_0x1356('0x19')]=function(_0x3c2adc,_0x11fdf2){this['rpc'][_0x1356('0x1a')](_0x3c2adc)[_0x1356('0x14')](function(_0x39f708){_0x11fdf2(null,_0x39f708?_0x39f708[_0x1356('0x15')]:![]);})[_0x1356('0x16')](function(_0x36655c){_0x11fdf2(_0x36655c);});};AGIVertices[_0x1356('0x12')][_0x1356('0x1b')]=function(_0x345b24,_0x370a91){this[_0x1356('0x11')][_0x1356('0x1c')](_0x345b24)[_0x1356('0x14')](function(_0x54c1a6){_0x370a91(null,_0x54c1a6?_0x54c1a6[_0x1356('0x1d')]:![]);})['catch'](function(_0x2d2af1){_0x370a91(_0x2d2af1);});};AGIVertices['prototype'][_0x1356('0x1e')]=function(_0x36adc3,_0x2f1581){this[_0x1356('0x11')][_0x1356('0x1f')](_0x36adc3)[_0x1356('0x14')](function(_0x539bd5){_0x2f1581(null,_0x539bd5?_0x539bd5[_0x1356('0x15')]:![]);})[_0x1356('0x16')](function(_0x53eca1){_0x2f1581(_0x53eca1);});};AGIVertices[_0x1356('0x12')][_0x1356('0x20')]=function(_0x3ed9bb,_0x56c0de){this[_0x1356('0x11')][_0x1356('0x21')](_0x3ed9bb)[_0x1356('0x14')](function(_0x231e6f){_0x56c0de(null,_0x231e6f?_0x231e6f['name']:![]);})['catch'](function(_0x42d609){_0x56c0de(_0x42d609);});};AGIVertices['prototype'][_0x1356('0x22')]=function(_0x3967f9,_0x210f88){var _0x3035eb=this;this[_0x1356('0x11')]['getSoundById'](_0x3967f9)[_0x1356('0x14')](function(_0x29ede4){_0x210f88(null,_0x29ede4?_0x3035eb[_0x1356('0x23')](_0x29ede4[_0x1356('0x24')]):![]);})[_0x1356('0x16')](function(_0x21a3ca){_0x210f88(_0x21a3ca);});};AGIVertices['prototype'][_0x1356('0x25')]=function(_0x4e28c1,_0x28dadc){this['rpc']['getMailAccountById'](_0x4e28c1)[_0x1356('0x14')](function(_0x406ca5){_0x28dadc(null,_0x406ca5?_0x406ca5:![]);})['catch'](function(_0x38dac3){_0x28dadc(_0x38dac3);});};AGIVertices[_0x1356('0x12')][_0x1356('0x26')]=function(_0x31cc14,_0x353268,_0x183bfd){this[_0x1356('0x27')]['sendMailMessage'](_0x31cc14,_0x353268)[_0x1356('0x14')](function(){_0x183bfd(null);})[_0x1356('0x16')](function(_0x3480ad){_0x183bfd(_0x3480ad);});};AGIVertices[_0x1356('0x12')]['getIntervals']=function(_0x395314,_0x1cd868){this[_0x1356('0x11')][_0x1356('0x28')](_0x395314)[_0x1356('0x14')](function(_0x4e9bca){if(_0x4e9bca){if(_0x4e9bca[_0x1356('0x29')]){_0x1cd868(null,[_0x4e9bca['interval']]);}else{_0x1cd868(null,_[_0x1356('0x2a')](_0x4e9bca[_0x1356('0x2b')],_0x1356('0x2c')));}}else{_0x1cd868(null,![]);}})[_0x1356('0x16')](function(_0x39e321){_0x1cd868(_0x39e321);});};AGIVertices[_0x1356('0x12')][_0x1356('0x23')]=function(_0x4fb4e6){return util[_0x1356('0x2d')](_0x1356('0x2e'),FILES_PATH,_0x4fb4e6);};AGIVertices[_0x1356('0x12')][_0x1356('0x2f')]=function(_0x57c1ff,_0x1ea4b4,_0x523990){odbc[_0x1356('0x30')](_0x57c1ff,function(_0x5c1eac){if(_0x5c1eac){logger[_0x1356('0x31')](_0x1356('0x32'),_0x5c1eac);_0x523990(_0x5c1eac);}else{logger['info'](_0x1356('0x33'));odbc['query'](_0x1ea4b4,function(_0x2884c3,_0x13f92e){if(_0x2884c3){logger[_0x1356('0x34')](_0x1356('0x35'),_0x1ea4b4);_0x523990(_0x2884c3);}else{logger['info'](_0x1356('0x36'),_0x1ea4b4);odbc['close'](function(_0x92d6cf){if(_0x92d6cf){logger[_0x1356('0x31')](_0x1356('0x37'),_0x92d6cf);}_0x523990(null,_0x13f92e);});}});}});};AGIVertices[_0x1356('0x12')][_0x1356('0x38')]=function(_0x1dd99e,_0x357b17){this[_0x1356('0x11')][_0x1356('0x39')](_0x1dd99e)[_0x1356('0x14')](function(_0x2e237e){_0x357b17(null,_0x2e237e?_0x2e237e:![]);})[_0x1356('0x16')](function(_0x467c11){_0x357b17(_0x467c11);});};AGIVertices[_0x1356('0x12')]['createSmsMessage']=function(_0x39f421,_0x27f193){this[_0x1356('0x11')][_0x1356('0x3a')](_0x39f421)[_0x1356('0x14')](function(_0x2231b6){_0x27f193(null,_0x2231b6);})[_0x1356('0x16')](function(_0x12ffe9){_0x27f193(_0x12ffe9);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x35b712,_0x36cf22,_0x55b399){this[_0x1356('0x11')][_0x1356('0x3b')]({'uniqueid':this[_0x1356('0x10')][_0x1356('0x3c')],'node':_0x35b712[_0x1356('0x3d')],'application':_0x35b712[_0x1356('0x3e')],'data':_0x36cf22||null,'project_name':this[_0x1356('0x10')][_0x1356('0x3f')],'callerid':this['channel'][_0x1356('0x40')]})['then'](function(_0x238454){if(_0x55b399){_0x55b399(null,_0x238454);}})[_0x1356('0x16')](function(_0x43def4){if(_0x55b399){_0x55b399(_0x43def4);}});};AGIVertices[_0x1356('0x12')][_0x1356('0x41')]=function(_0x5e39fe,_0x51b97e,_0x3338f1,_0x186908){this[_0x1356('0x11')][_0x1356('0x41')]({'uniqueid':this[_0x1356('0x10')][_0x1356('0x3c')],'callerid':this['channel'][_0x1356('0x40')],'calleridname':this['channel']['calleridname'],'context':this[_0x1356('0x10')][_0x1356('0x42')],'extension':this[_0x1356('0x10')][_0x1356('0x43')],'priority':this['channel'][_0x1356('0x44')],'accountcode':this[_0x1356('0x10')][_0x1356('0x45')],'dnid':this[_0x1356('0x10')]['dnid'],'projectName':this['channel'][_0x1356('0x3f')],'saveName':_0x51b97e,'filename':_0x5e39fe[_0x1356('0x46')]||_0x51b97e,'savePath':_0x3338f1})[_0x1356('0x14')](function(_0x2beee2){_0x186908(null,_0x2beee2);})[_0x1356('0x16')](function(_0x97ebd9){_0x186908(_0x97ebd9);});};AGIVertices['prototype'][_0x1356('0x47')]=function(_0x183425,_0x532205,_0xbe30af,_0xcf7e3a,_0x234bba){this[_0x1356('0x11')]['createSquareMessage']({'uniqueid':this['channel']['uniqueid'],'body':_0x183425,'direction':_0x532205,'providerName':_0xbe30af,'providerResponse':_0xcf7e3a})[_0x1356('0x14')](function(_0x4b03c1){if(_0x234bba){_0x234bba(null,_0x4b03c1);}})[_0x1356('0x16')](function(_0x21ce0e){if(_0x234bba){_0x234bba(_0x21ce0e);}});};AGIVertices[_0x1356('0x12')]['createCmContact']=function(_0x2a18e5,_0x10b5c1){this[_0x1356('0x11')][_0x1356('0x48')]({'firstName':_[_0x1356('0x49')](_0x2a18e5[_0x1356('0x15')])||_['isNil'](_0x2a18e5['name'])?_0x1356('0x4a')+Math[_0x1356('0x4b')]():_0x2a18e5[_0x1356('0x15')],'lastName':_[_0x1356('0x49')](_0x2a18e5[_0x1356('0x4c')])||_[_0x1356('0x4d')](_0x2a18e5[_0x1356('0x4c')])?null:_0x2a18e5['lastName'],'phone':_0x2a18e5[_0x1356('0x4e')],'ListId':_0x2a18e5[_0x1356('0x4f')],'scheduledat':_0x2a18e5['scheduledAt'],'callbackUniqueid':this['channel'][_0x1356('0x3c')],'tags':_0x1356('0x50'),'description':_0x1356('0x51')+_0x2a18e5[_0x1356('0x52')][_0x1356('0x53')](),'priority':_0x2a18e5[_0x1356('0x54')]})[_0x1356('0x14')](function(_0x59cea3){_0x10b5c1(null,_0x59cea3);})['catch'](function(_0x21602d){_0x10b5c1(_0x21602d);});};AGIVertices[_0x1356('0x12')][_0x1356('0x55')]=function(_0x35ca3b,_0x4e26a1){this[_0x1356('0x11')][_0x1356('0x56')](_0x35ca3b)[_0x1356('0x14')](function(_0x23f1a1){_0x4e26a1(null,_0x23f1a1?_0x23f1a1['name']:![]);})[_0x1356('0x16')](function(_0x529933){_0x4e26a1(_0x529933);});};AGIVertices[_0x1356('0x12')][_0x1356('0x57')]=function(_0x2da393,_0x1e91d0,_0x138b00){var _0x33dc4f={'role':_0x1356('0x58')};_0x33dc4f[_0x2da393]=this[_0x1356('0x10')][_0x1356('0x40')];this['rpc'][_0x1356('0x57')](_0x33dc4f,_0x1e91d0,this[_0x1356('0x10')][_0x1356('0x3c')])['then'](function(_0x3f2a4d){_0x138b00(null,_[_0x1356('0x4d')](_0x3f2a4d)?![]:!![]);})[_0x1356('0x16')](function(_0xc852e8){logger['error'](_0xc852e8);_0x138b00(null,![]);});};AGIVertices[_0x1356('0x12')][_0x1356('0x59')]=function(_0x2c52aa,_0x24514e){var _0x1257ed={'role':_0x1356('0x58')};_0x1257ed[_0x2c52aa]=this[_0x1356('0x10')][_0x1356('0x40')];this['rpc']['agentUnpause'](_0x1257ed)[_0x1356('0x14')](function(_0x5a3c5b){_0x24514e(null,_[_0x1356('0x4d')](_0x5a3c5b)?![]:!![]);})['catch'](function(_0x27cf2e){logger[_0x1356('0x31')](_0x27cf2e);_0x24514e(null,![]);});};AGIVertices['prototype'][_0x1356('0x5a')]=function(_0x2163be,_0x1d7392){var _0x2c07b3={'role':_0x1356('0x58')};_0x2c07b3[_0x2163be]=this[_0x1356('0x10')][_0x1356('0x40')];this[_0x1356('0x11')]['agentLogout'](_0x2c07b3)[_0x1356('0x14')](function(_0x1b9468){_0x1d7392(null,_[_0x1356('0x4d')](_0x1b9468)?![]:!![]);})[_0x1356('0x16')](function(_0x139072){logger[_0x1356('0x31')](_0x139072);_0x1d7392(null,![]);});};AGIVertices['prototype'][_0x1356('0x5b')]=function(_0x3c5032,_0x4d6933){var _0x27b1d3={'role':_0x1356('0x58')};_0x27b1d3[_0x3c5032]=this['channel'][_0x1356('0x40')];var _0x5b8464=_0x3c5032!=_0x1356('0x5c')?util['format']('%s/%s@from-sip/n',_0x1356('0x5d'),this['channel'][_0x1356('0x40')]):undefined;this['rpc']['agentLogin'](_0x27b1d3,_0x5b8464)[_0x1356('0x14')](function(_0x5e99f4){_0x4d6933(null,_[_0x1356('0x4d')](_0x5e99f4)?![]:!![]);})[_0x1356('0x16')](function(_0x127ea1){logger[_0x1356('0x31')](_0x127ea1);_0x4d6933(null,![]);});};AGIVertices[_0x1356('0x12')]['shellCommand']=function(_0x2e2002,_0x247610){sh[_0x1356('0x5e')](_[_0x1356('0x5f')](_0x2e2002),function(_0x2071fa,_0x1ef6e9){var _0x1d2a9f=_0x1ef6e9['replace'](/(\r\n|\n|\r)/gm,'');_0x247610(null,_0x1d2a9f);});};AGIVertices[_0x1356('0x12')][_0x1356('0x60')]=function(_0x1a898d,_0x2bb86a){scripts[_0x1356('0x60')](_0x1a898d[_0x1356('0x61')],_0x1a898d['google_cloud_tts_text_type']||'text',_0x1a898d[_0x1356('0x62')],_0x1a898d[_0x1356('0x63')]||_0x1356('0x64'),_0x1a898d[_0x1356('0x65')]||_0x1356('0x66'),_0x1a898d['audioEncoding']||_0x1356('0x67'))[_0x1356('0x14')](function(_0x44fb7b){_0x2bb86a(null,_0x44fb7b);})['catch'](function(_0x5d1943){_0x2bb86a(_0x5d1943);});};AGIVertices[_0x1356('0x12')][_0x1356('0x68')]=function(_0x54304d,_0x5bb015){scripts[_0x1356('0x68')](_0x54304d[_0x1356('0x62')],_0x54304d['google_tts_language']||'en',0x1)[_0x1356('0x14')](function(_0x18f7dc){_0x5bb015(null,_0x18f7dc);})['catch'](function(_0x5cec82){_0x5bb015(_0x5cec82);});};AGIVertices[_0x1356('0x12')][_0x1356('0x69')]=function(_0x43b9f2,_0x4d6e72){var _0x5bf6e6={'uri':_0x43b9f2[_0x1356('0x6a')],'method':_0x43b9f2['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x43b9f2['timeout'])==='number'&&parseInt(_0x43b9f2[_0x1356('0x6b')])>=0x1?parseInt(_0x43b9f2[_0x1356('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0x1356('0x6c')](['POST',_0x1356('0x6d')],_0x5bf6e6['method'][_0x1356('0x6e')]())){try{_0x5bf6e6['body']=_0x43b9f2[_0x1356('0xd')]?JSON[_0x1356('0x6f')](_0x43b9f2[_0x1356('0xd')]):{};}catch(_0x17f446){logger[_0x1356('0x31')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x17f446);}}try{_0x5bf6e6[_0x1356('0x70')]=_0x43b9f2[_0x1356('0xc')]?JSON['parse'](_0x43b9f2[_0x1356('0xc')]):{};}catch(_0x11a69){logger[_0x1356('0x31')](_0x1356('0x71'),_0x11a69);}if(_0x43b9f2[_0x1356('0x72')]){try{var _0xadcb7f=require(_0x43b9f2[_0x1356('0x72')])[_0x1356('0x73')](this,_0x5bf6e6);_0x5bf6e6[_0x1356('0x74')]=Mustache[_0x1356('0x75')](_0x43b9f2[_0x1356('0x6a')],_0xadcb7f,{},['$$','$$']);if(_0x5bf6e6[_0x1356('0x70')]){_0x5bf6e6[_0x1356('0x70')]=JSON['parse'](Mustache[_0x1356('0x75')](JSON[_0x1356('0x76')](_0x5bf6e6[_0x1356('0x70')]),_0xadcb7f,{},['$$','$$']));}if(_0x5bf6e6[_0x1356('0x77')]){_0x5bf6e6[_0x1356('0x77')]=JSON[_0x1356('0x6f')](Mustache[_0x1356('0x75')](JSON['stringify'](_0x5bf6e6[_0x1356('0x77')]),_0xadcb7f,{},['$$','$$']));}}catch(_0x25ac08){logger['error'](_0x1356('0x78'),_0x25ac08);}}rp(_0x5bf6e6)[_0x1356('0x14')](function(_0x5bf7e6){var _0x5a26e0={'statusCode':_0x5bf7e6[_0x1356('0x79')]||0xc8,'statusMessage':_0x5bf7e6[_0x1356('0x7a')]||'OK','headers':_0x5bf7e6['headers']||{},'body':_0x5bf7e6[_0x1356('0x77')]||{}};_0x4d6e72(null,_0x5a26e0);})['catch'](function(_0x4608ea){var _0x4fc02c={'statusCode':_0x4608ea[_0x1356('0x79')]||0x1f4,'statusMessage':_0x4608ea[_0x1356('0x7b')]||_0x1356('0x7c'),'headers':_0x4608ea['options'][_0x1356('0x70')]||{},'body':_0x4608ea[_0x1356('0x7d')]['body']||{}};_0x4d6e72(null,_0x4fc02c);});};AGIVertices[_0x1356('0x12')][_0x1356('0x7e')]=function(_0x502eee,_0x6b6b3e){scripts[_0x1356('0x7e')](this[_0x1356('0x10')][_0x1356('0x3c')],_0x502eee[_0x1356('0x7f')],_0x502eee['text'],_0x502eee[_0x1356('0x80')]||'en')[_0x1356('0x14')](function(_0x5eaabe){_0x6b6b3e(null,_0x5eaabe);})['catch'](function(_0x59a06a){_0x6b6b3e(_0x59a06a);});};AGIVertices[_0x1356('0x12')][_0x1356('0x81')]=function(_0x14de49,_0x2afd99){scripts[_0x1356('0x81')](this[_0x1356('0x10')][_0x1356('0x3c')],_0x14de49[_0x1356('0x82')],_0x14de49['client_email'],_0x14de49[_0x1356('0x83')],_0x14de49[_0x1356('0x62')],_0x14de49[_0x1356('0x84')]||'en')[_0x1356('0x14')](function(_0x159882){_0x2afd99(null,_0x159882);})[_0x1356('0x16')](function(_0x1366ef){_0x2afd99(_0x1366ef);});};AGIVertices['prototype'][_0x1356('0x85')]=function(_0x4470a2,_0x141d5b){scripts[_0x1356('0x85')](this[_0x1356('0x10')],_0x4470a2)['then'](function(_0x8859b0){_0x141d5b(null,_0x8859b0);})[_0x1356('0x16')](function(_0x5565e4){_0x141d5b(_0x5565e4);});};AGIVertices[_0x1356('0x12')][_0x1356('0x86')]=function(_0x436a3f,_0x3d0a88){scripts['ispeechTTS'](_0x436a3f[_0x1356('0x7f')],_0x436a3f['text'],_0x436a3f[_0x1356('0x87')]||'en-US',_0x436a3f[_0x1356('0x88')])[_0x1356('0x14')](function(_0x4ede24){_0x3d0a88(null,_0x4ede24);})['catch'](function(_0x4cea28){_0x3d0a88(_0x4cea28);});};AGIVertices['prototype']['ispeechASR']=function(_0x41e9eb,_0x24bd0a,_0x213178){scripts['ispeechASR'](_0x24bd0a,_0x41e9eb['key'],_0x41e9eb[_0x1356('0x89')]||_0x1356('0x64'),this['isConfigured'](_0x41e9eb[_0x1356('0x8a')])?_0x41e9eb[_0x1356('0x8a')]:undefined)[_0x1356('0x14')](function(_0x464dee){_0x213178(null,_0x464dee);})[_0x1356('0x16')](function(_0x2e19fb){_0x213178(_0x2e19fb);});};AGIVertices[_0x1356('0x12')]['awsPolly']=function(_0x17868b,_0x8c0e9b){scripts[_0x1356('0x8b')](_0x17868b[_0x1356('0x8c')],_0x17868b[_0x1356('0x8d')],_0x17868b[_0x1356('0x8e')],_0x17868b['aws_polly_voice']||_0x1356('0x8f'),_0x17868b['text'],_0x17868b[_0x1356('0x90')]||_0x1356('0x62'))[_0x1356('0x14')](function(_0x417b31){_0x8c0e9b(null,_0x417b31);})[_0x1356('0x16')](function(_0x1af402){_0x8c0e9b(_0x1af402);});};AGIVertices[_0x1356('0x12')][_0x1356('0x91')]=function(_0x37d23d,_0x1d3955){scripts[_0x1356('0x91')](this[_0x1356('0x10')][_0x1356('0x3c')],_0x37d23d['aws_access_key_id'],_0x37d23d['aws_secret_access_key'],_0x37d23d[_0x1356('0x92')],_0x37d23d[_0x1356('0x62')],_0x37d23d[_0x1356('0x93')])[_0x1356('0x14')](function(_0xbb82bd){_0x1d3955(null,_0xbb82bd);})['catch'](function(_0x2e1cd4){_0x1d3955(_0x2e1cd4);});};AGIVertices[_0x1356('0x12')][_0x1356('0x94')]=function(_0x5c23fb,_0x4036f3,_0x25aa42){scripts[_0x1356('0x94')](_0x4036f3,_0x5c23fb[_0x1356('0x7f')],_0x5c23fb[_0x1356('0x95')]||_0x1356('0x64'))[_0x1356('0x14')](function(_0x41c650){_0x25aa42(null,_0x41c650);})[_0x1356('0x16')](function(_0x32f681){_0x25aa42(_0x32f681);});};AGIVertices[_0x1356('0x12')][_0x1356('0x96')]=function(_0x1c6103,_0xa5abbb,_0xd68bf1){scripts['tildeASR'](_0xa5abbb,_0x1c6103[_0x1356('0x97')],_0x1c6103['appsecret'],_0x1c6103[_0x1356('0x74')])['then'](function(_0x17454d){_0xd68bf1(null,_0x17454d);})[_0x1356('0x16')](function(_0x431386){_0xd68bf1(_0x431386);});};AGIVertices[_0x1356('0x12')][_0x1356('0x98')]=function(_0xcd1348){var _0x596b79=_[_0x1356('0x6c')](verticesWithRetry,_0xcd1348[_0x1356('0x3e')])?_0xcd1348:_[_0x1356('0x99')](_0xcd1348);for(var _0x409751 in _0x596b79){if(_0x596b79['hasOwnProperty'](_0x409751)){if(_0x596b79[_0x409751]&&_[_0x1356('0x9a')](_0x596b79[_0x409751])){if(_[_0x1356('0x6c')](recursiveMapAttributes,_0x409751)){_0x596b79[_0x409751]=this[_0x1356('0x9b')](_0x596b79[_0x409751]);}else{_0x596b79[_0x409751]=this['replaceAllVariables'](_0x596b79[_0x409751]);}}}}return _0x596b79;};AGIVertices[_0x1356('0x12')][_0x1356('0x9c')]=function(_0x3a2f6a){for(var _0x1cbb5a in _0x3a2f6a){if(_0x3a2f6a[_0x1356('0x9d')](_0x1cbb5a)){if(_[_0x1356('0x9e')](_0x3a2f6a[_0x1cbb5a])){this['recursiveNodeIndex'](_0x3a2f6a[_0x1cbb5a]);}else if(_[_0x1356('0x9f')](_0x3a2f6a[_0x1cbb5a])){for(var _0x3df36b=0x0;_0x3df36b<_0x3a2f6a[_0x1cbb5a]['length'];_0x3df36b++){this[_0x1356('0x9c')](_0x3a2f6a[_0x1cbb5a][_0x3df36b]);}}else if(_[_0x1356('0x9a')](_0x3a2f6a[_0x1cbb5a])){_0x3a2f6a[_0x1cbb5a]=this['replaceAllVariables'](_0x3a2f6a[_0x1cbb5a]);}}}};AGIVertices[_0x1356('0x12')][_0x1356('0xa0')]=function(_0x39c30c,_0x10901f){for(var _0x20fee2 in _0x39c30c){if(_0x39c30c['hasOwnProperty'](_0x20fee2)){if(_[_0x1356('0x9e')](_0x39c30c[_0x20fee2])){if(!_['isEmpty'](_0x39c30c[_0x20fee2])){this[_0x1356('0xa0')](_0x39c30c[_0x20fee2],util['format']('%s.%s',_0x10901f,_0x20fee2));}}else if(_['isArray'](_0x39c30c[_0x20fee2])){for(var _0x22875c=0x0;_0x22875c<_0x39c30c[_0x20fee2]['length'];_0x22875c++){this[_0x1356('0xa0')](_0x39c30c[_0x20fee2][_0x22875c],util[_0x1356('0x2d')](_0x1356('0xa1'),_0x10901f,_0x20fee2+'['+_0x22875c+']'));}}else{if(!_[_0x1356('0x4d')](_0x39c30c[_0x20fee2])){this['channel'][_0x1356('0xa2')](util[_0x1356('0x2d')](_0x1356('0xa1'),_0x10901f,_0x20fee2),_0x39c30c[_0x20fee2]);}}}}};AGIVertices[_0x1356('0x12')]['replaceObjectAllVariables']=function(_0x1a0d92){try{var _0x1cafe7=JSON[_0x1356('0x6f')](_0x1a0d92);this[_0x1356('0x9c')](_0x1cafe7);return JSON[_0x1356('0x76')](_0x1cafe7);}catch(_0x147696){return this['replaceAllVariables'](_0x1a0d92);}};AGIVertices[_0x1356('0x12')][_0x1356('0xa3')]=function(_0x3dcfbf){var _0x23ef29=_0x3dcfbf[_0x1356('0xa4')]('{');for(var _0x1f8438=0x1;_0x1f8438<_0x23ef29[_0x1356('0xa5')];_0x1f8438+=0x1){var _0x42f5d3=_0x23ef29[_0x1f8438]['split']('}');if(_0x42f5d3[_0x1356('0xa5')]>0x1){_0x3dcfbf=_0x3dcfbf[_0x1356('0xa6')]('{'+_0x42f5d3[0x0]+'}',this[_0x1356('0x10')]['getVariable'](_0x42f5d3[0x0])['extra']||_0x42f5d3[0x0]);}}if(_0x23ef29[_0x1356('0xa5')]===0x1){return _0x3dcfbf[_0x1356('0x53')]();}return this[_0x1356('0xa3')](_0x3dcfbf);};AGIVertices['prototype'][_0x1356('0xa7')]=function(_0x4cbac5,_0xe2a6fe){var _0x12088b=this[_0x1356('0x10')][_0x1356('0xa8')](_0x4cbac5);if(_0x12088b[_0x1356('0xa9')]===-0x1){return _0x12088b;}logger['info'](util[_0x1356('0x2d')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xe2a6fe,_0x12088b[_0x1356('0xaa')]));return this[_0x1356('0x10')][_0x1356('0xa2')](_0xe2a6fe,_0x12088b[_0x1356('0xaa')]);};AGIVertices['prototype'][_0x1356('0xab')]=function(_0x5cfc56){return _0x5cfc56&&_0x5cfc56!=='0'&&_0x5cfc56!=='-1'&&_0x5cfc56!=='';};AGIVertices[_0x1356('0x12')]['maxRetry']=function(_0x43a391){this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x43a391,'-');_0x43a391['retry']=_0x43a391[_0x1356('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x1356('0xad')]=function(_0x462465){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x462465[_0x1356('0x3d')]));if(!this['isConfigured'](_0x462465['text'])){return this['channel'][_0x1356('0xae')](_0x1356('0xaf'));}var _0x5277e1='\x22'+_0x462465['text']+'\x22';if(this[_0x1356('0xab')](_0x462465[_0x1356('0x7d')])){_0x5277e1+=','+_0x462465[_0x1356('0x7d')];}var _0x1a15cc=this['channel'][_0x1356('0x5e')](_0x1356('0xb0'),_0x5277e1);if(_0x1a15cc['result']===-0x1){return _0x1a15cc;}return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xb1'),_0x5277e1));};AGIVertices['prototype'][_0x1356('0xb2')]=function(_0x323d01){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0xb3'),_0x323d01[_0x1356('0x3d')]));if(!this['isConfigured'](_0x323d01[_0x1356('0xb4')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xb5'));}var _0x252770=_0x323d01['grammar'];if(this[_0x1356('0xab')](_0x323d01['options'])){_0x252770+=','+_0x323d01['options'];}var _0x14caee=this['channel'][_0x1356('0x5e')](_0x1356('0xb6'),_0x252770);if(_0x14caee[_0x1356('0xa9')]===-0x1){return _0x14caee;}var _0x922bb1=this[_0x1356('0xa7')]('RECOG_CONFIDENCE()',_0x1356('0xb7'));if(_0x922bb1[_0x1356('0xa9')]===-0x1){return _0x922bb1;}var _0x2d0359=this[_0x1356('0xa7')](_0x1356('0xb8'),_0x1356('0xb9'));if(_0x2d0359[_0x1356('0xa9')]===-0x1){return _0x2d0359;}var _0x1476e6=this[_0x1356('0xa7')]('RECOG_INSTANCE()',_0x1356('0xba'));if(_0x1476e6[_0x1356('0xa9')]===-0x1){return _0x1476e6;}return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xbb'),_0x252770));};AGIVertices[_0x1356('0x12')][_0x1356('0x8')]=function(_0x40251f){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x40251f[_0x1356('0x3d')]));return this[_0x1356('0x10')][_0x1356('0x8')]([_0x40251f['command'],_0x40251f['args']]);};AGIVertices[_0x1356('0x12')][_0x1356('0xbc')]=function(_0x5beefd){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0xbd'),_0x5beefd[_0x1356('0x3d')]));if(this['isConfigured'](_0x5beefd[_0x1356('0x6b')])){logger[_0x1356('0x34')](util['format'](_0x1356('0xbe'),_0x5beefd[_0x1356('0x6b')]));var _0x48b061=this[_0x1356('0x10')]['wait'](_0x5beefd[_0x1356('0x6b')]);if(_0x48b061[_0x1356('0xa9')]===-0x1){return _0x48b061;}}return this[_0x1356('0x10')][_0x1356('0xbc')]();};AGIVertices[_0x1356('0x12')][_0x1356('0x50')]=function(_0xb4ae0b){logger[_0x1356('0x34')](util['format'](_0x1356('0xbf'),_0xb4ae0b[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0xb4ae0b[_0x1356('0x4f')])){return this[_0x1356('0x10')]['error'](_0xb4ae0b,'no\x20list\x20selected');}_0xb4ae0b[_0x1356('0x52')]=moment();if(this[_0x1356('0xab')](_0xb4ae0b[_0x1356('0xc0')])){_0xb4ae0b[_0x1356('0x52')]=moment()['add'](_0xb4ae0b[_0x1356('0xc0')],_0x1356('0xc1'));}if(!this[_0x1356('0xab')](_0xb4ae0b['callback_priority'])){_0xb4ae0b[_0x1356('0x54')]=0x2;}this[_0x1356('0x48')][_0x1356('0x73')](this,_0xb4ae0b);return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xc2'),_0xb4ae0b[_0x1356('0x4e')],_0xb4ae0b[_0x1356('0x4f')],_0xb4ae0b['scheduledAt']));};AGIVertices[_0x1356('0x12')]['custom_app']=function(_0x154a74){logger[_0x1356('0x34')](util['format'](_0x1356('0xc3'),_0x154a74['label']));var _0x233fef=this[_0x1356('0x10')][_0x1356('0x5e')](_0x154a74[_0x1356('0xc4')],_0x154a74[_0x1356('0x7d')]);if(_0x233fef['result']===-0x1){return _0x233fef;}return this[_0x1356('0x10')][_0x1356('0xae')](util['format'](_0x1356('0xc5'),_0x154a74[_0x1356('0xc4')],_0x154a74[_0x1356('0x7d')]));};AGIVertices['prototype'][_0x1356('0xc6')]=function(_0x4a9607){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0xc7'),_0x4a9607[_0x1356('0x3d')]));if(!this['isConfigured'](_0x4a9607[_0x1356('0x62')])){return this['channel'][_0x1356('0xae')]('no\x20text\x20configured');}var _0x2a818a='\x22'+_0x4a9607['text']+'\x22';if(this[_0x1356('0xab')](_0x4a9607[_0x1356('0x7d')])){_0x2a818a+=','+_0x4a9607['options'];}var _0x4acd8d=this[_0x1356('0x10')][_0x1356('0x5e')]('MRCPSynth',_0x2a818a);if(_0x4acd8d[_0x1356('0xa9')]===-0x1){return _0x4acd8d;}return this['channel'][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xb1'),_0x2a818a));};AGIVertices[_0x1356('0x12')][_0x1356('0xc8')]=function(_0x84a36f){logger['info'](util[_0x1356('0x2d')](_0x1356('0xc9'),_0x84a36f[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x84a36f[_0x1356('0x62')])){return this[_0x1356('0x10')]['noop']('no\x20text\x20configured');}var _0x246816='\x22'+_0x84a36f['text']+'\x22';if(this[_0x1356('0xab')](_0x84a36f[_0x1356('0x7d')])){_0x246816+=','+_0x84a36f[_0x1356('0x7d')];}var _0x44aff1=this['channel'][_0x1356('0x5e')]('MRCPSynth',_0x246816);if(_0x44aff1[_0x1356('0xa9')]===-0x1){return _0x44aff1;}return this['channel'][_0x1356('0xae')](util[_0x1356('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x246816));};AGIVertices[_0x1356('0x12')]['lumenvoxasr']=function(_0x173201){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0xca'),_0x173201['label']));if(!this[_0x1356('0xab')](_0x173201[_0x1356('0xb4')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xb5'));}var _0x54d1d5=_0x173201[_0x1356('0xb4')];if(this[_0x1356('0xab')](_0x173201[_0x1356('0x7d')])){_0x54d1d5+=','+_0x173201[_0x1356('0x7d')];}var _0x20393e=this[_0x1356('0x10')][_0x1356('0x5e')](_0x1356('0xb6'),_0x54d1d5);if(_0x20393e['result']===-0x1){return _0x20393e;}var _0x55bbd6=this[_0x1356('0xa7')](_0x1356('0xcb'),_0x1356('0xcc'));if(_0x55bbd6['result']===-0x1){return _0x55bbd6;}var _0x446821=this['getAndSetVariable'](_0x1356('0xb8'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x446821['result']===-0x1){return _0x446821;}var _0x231757=this[_0x1356('0xa7')](_0x1356('0xcd'),_0x1356('0xce'));if(_0x231757[_0x1356('0xa9')]===-0x1){return _0x231757;}return this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x54d1d5));};AGIVertices[_0x1356('0x12')]['sestekasr']=function(_0x30e0c2){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0xcf'),_0x30e0c2[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x30e0c2[_0x1356('0xb4')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xb5'));}var _0x33c14d=_0x30e0c2[_0x1356('0xb4')];if(this[_0x1356('0xab')](_0x30e0c2[_0x1356('0x7d')])){_0x33c14d+=','+_0x30e0c2[_0x1356('0x7d')];}var _0x48ab9b=this[_0x1356('0x10')][_0x1356('0x5e')](_0x1356('0xb6'),_0x33c14d);if(_0x48ab9b[_0x1356('0xa9')]===-0x1){return _0x48ab9b;}var _0x2a2ce3=this[_0x1356('0xa7')](_0x1356('0xcb'),_0x1356('0xd0'));if(_0x2a2ce3[_0x1356('0xa9')]===-0x1){return _0x2a2ce3;}var _0x4ba62a=this['getAndSetVariable'](_0x1356('0xb8'),_0x1356('0xd1'));if(_0x4ba62a[_0x1356('0xa9')]===-0x1){return _0x4ba62a;}var _0x41ea46=this['getAndSetVariable'](_0x1356('0xcd'),_0x1356('0xd2'));if(_0x41ea46[_0x1356('0xa9')]===-0x1){return _0x41ea46;}return this['channel'][_0x1356('0xae')](util[_0x1356('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x33c14d));};AGIVertices[_0x1356('0x12')][_0x1356('0xd3')]=function(_0x2eb959){logger['info'](util[_0x1356('0x2d')](_0x1356('0xd4'),_0x2eb959['label']));if(!this[_0x1356('0xab')](_0x2eb959[_0x1356('0xd5')])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x2eb959,'no\x20database\x20selected');}var _0xdc5e56=this[_0x1356('0x1b')]['sync'](this,_0x2eb959[_0x1356('0xd5')]);if(!_0xdc5e56){return this['channel'][_0x1356('0x31')](_0x2eb959,'no\x20odbc\x20database\x20found');}if(!this[_0x1356('0xab')](_0x2eb959['query'])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x2eb959,'no\x20query\x20configured');}var _0x546cc6=_0x2eb959[_0x1356('0xd6')][_0x1356('0xd7')](/(\r\n|\n|\r)/gm,'\x20');this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')](_0x1356('0xd8'),_0x546cc6));var _0x58b243=this[_0x1356('0x2f')]['sync'](this,_0xdc5e56,_0x546cc6);this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x2eb959,_0x546cc6);if(!this['isConfigured'](_0x2eb959['variable_id'])){return this['channel'][_0x1356('0xae')](_0x1356('0xd9'));}var _0xdae3be=this[_0x1356('0xa8')][_0x1356('0x73')](this,_0x2eb959[_0x1356('0xda')]);if(!_0xdae3be){return this[_0x1356('0x10')]['error'](_0x2eb959,_0x1356('0xdb'));}var _0x2b3ba6=this;_0x58b243[_0x1356('0xdc')](function(_0x189787,_0x4b55f4){Object[_0x1356('0xdd')](_0x189787)[_0x1356('0xdc')](function(_0x3a2532){_0x2b3ba6[_0x1356('0x10')]['setVariable'](util[_0x1356('0x2d')](_0x1356('0xde'),_0xdae3be,_0x4b55f4,_0x3a2532),_0x189787[_0x3a2532]);});});this[_0x1356('0x10')][_0x1356('0xa2')](util[_0x1356('0x2d')]('%s_ROWS_COUNT',_0xdae3be),_0x58b243[_0x1356('0xa5')]);return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xdf'),_0xdae3be));};AGIVertices[_0x1356('0x12')]['dial']=function(_0x35dd26){logger['debug'](util[_0x1356('0x2d')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x35dd26[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x35dd26[_0x1356('0xe0')])){return this[_0x1356('0x10')]['error'](_0x35dd26,_0x1356('0xe1'));}var _0x116dd1=this['getUser'][_0x1356('0x73')](this,_0x35dd26['sip_id']);if(!_0x116dd1){return this[_0x1356('0x10')][_0x1356('0x31')](_0x35dd26,'no\x20user\x20found');}var _0x440df7=this['channel'][_0x1356('0x5e')]('DIAL',[util[_0x1356('0x2d')]('SIP/%s',_0x116dd1),_0x35dd26[_0x1356('0x6b')],_0x35dd26[_0x1356('0xe2')],_0x35dd26[_0x1356('0x6a')]]);if(_0x440df7[_0x1356('0xa9')]===-0x1){return _0x440df7;}return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0x1356('0xe3')]=function(_0x53671f){logger[_0x1356('0x34')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x53671f[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x53671f[_0x1356('0x7f')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xe4'));}if(!this[_0x1356('0xab')](_0x53671f['text'])){return this['channel']['noop'](_0x1356('0xaf'));}this[_0x1356('0x10')][_0x1356('0xe5')]=!![];this[_0x1356('0x3b')](_0x53671f);this[_0x1356('0x47')](_0x53671f[_0x1356('0x62')],'in','','');this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xe6'),_0x53671f['text']));var _0x582463=this['googleDialogflow'][_0x1356('0x73')](this,_0x53671f);if(_0x582463){for(var _0x5bc777 in _0x582463){if(_0x582463[_0x1356('0x9d')](_0x5bc777)){this[_0x1356('0x10')]['setVariable'](util[_0x1356('0x2d')](_0x1356('0xe7'),_0x5bc777[_0x1356('0x6e')]()),_0x582463[_0x5bc777]);}}this['createSquareMessage'](_0x582463[_0x1356('0xe8')],'out','dialogflow','');return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xe9'),_0x582463[_0x1356('0xe8')]));}return this['channel'][_0x1356('0x31')](_0x53671f,_0x1356('0xea'));};AGIVertices[_0x1356('0x12')]['dialogflowV2']=function(_0x36da7c){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0xeb'),_0x36da7c['label']));if(!this[_0x1356('0xab')](_0x36da7c[_0x1356('0x82')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xec'));}if(!this['isConfigured'](_0x36da7c[_0x1356('0xed')])){return this['channel'][_0x1356('0xae')]('no\x20client_email\x20configured');}if(!this[_0x1356('0xab')](_0x36da7c[_0x1356('0x83')])){return this['channel'][_0x1356('0xae')](_0x1356('0xee'));}if(!this[_0x1356('0xab')](_0x36da7c['dialogflowV2_language'])){return this[_0x1356('0x10')][_0x1356('0xae')]('no\x20anguage\x20configured');}if(!this[_0x1356('0xab')](_0x36da7c[_0x1356('0x62')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xaf'));}this[_0x1356('0x10')]['bot']=!![];this[_0x1356('0x3b')](_0x36da7c);this[_0x1356('0x47')](_0x36da7c[_0x1356('0x62')],'in','','');this[_0x1356('0x10')][_0x1356('0xae')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x36da7c[_0x1356('0x62')]));var _0x7ee2ea=this[_0x1356('0x81')][_0x1356('0x73')](this,_0x36da7c);if(_0x7ee2ea){for(var _0x3e42da in _0x7ee2ea){if(_0x7ee2ea[_0x1356('0x9d')](_0x3e42da)){if(_0x3e42da!==_0x1356('0xef')){this['channel']['setVariable'](util['format'](_0x1356('0xe7'),_0x3e42da[_0x1356('0x6e')]()),_0x7ee2ea[_0x3e42da]);}}}this[_0x1356('0x47')](_0x7ee2ea['speech'],'out','dialogflowV2',_0x7ee2ea[_0x1356('0xef')]);return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('DialogflowV2\x20Result\x20%s',_0x7ee2ea['speech']));}return this['channel']['error'](_0x36da7c,_0x1356('0xf0'));};AGIVertices[_0x1356('0x12')][_0x1356('0xf1')]=function(_0x5c23bc){logger[_0x1356('0x34')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5c23bc[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x5c23bc[_0x1356('0xf2')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xf3'));}if(!this[_0x1356('0xab')](_0x5c23bc['username'])){return this['channel'][_0x1356('0xae')](_0x1356('0xf4'));}if(!this[_0x1356('0xab')](_0x5c23bc[_0x1356('0xf5')])){return this[_0x1356('0x10')][_0x1356('0xae')]('no\x20password\x20configured');}if(!this[_0x1356('0xab')](_0x5c23bc[_0x1356('0xf6')])){return this[_0x1356('0x10')]['noop'](_0x1356('0xaf'));}this[_0x1356('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0x5c23bc);this['createSquareMessage'](_0x5c23bc[_0x1356('0x62')],'in','','');this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xf7'),_0x5c23bc[_0x1356('0x62')]));var _0x1a7b18=this[_0x1356('0x85')][_0x1356('0x73')](this,_0x5c23bc);if(_0x1a7b18){for(var _0x37b55a in _0x1a7b18){if(_0x1a7b18['hasOwnProperty'](_0x37b55a)){this[_0x1356('0x10')][_0x1356('0xa2')](util[_0x1356('0x2d')](_0x1356('0xf8'),_0x37b55a['toUpperCase']()),_0x1a7b18[_0x37b55a]);}}this['createSquareMessage'](_0x1a7b18['speech'],_0x1356('0xf9'),_0x1356('0xf1'),'');if(_0x1a7b18[_0x1356('0xfa')]){this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xfb'),_0x1a7b18[_0x1356('0xfa')]));var _0x3fb32c=this[_0x1356('0x10')][_0x1356('0xfc')](_0x1a7b18[_0x1356('0xfa')]);try{fs[_0x1356('0xfd')](_0x1a7b18['audiofile']+'.wav');}catch(_0x11c745){logger['error'](_0x11c745);}return _0x3fb32c;}else{return this[_0x1356('0x10')][_0x1356('0xae')](util['format'](_0x1356('0xfe'),_0x1a7b18[_0x1356('0xe8')]));}}return this[_0x1356('0x10')][_0x1356('0x31')](_0x5c23bc,_0x1356('0xff'));};AGIVertices[_0x1356('0x12')][_0x1356('0x100')]=function(_0x10d873){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x10d873[_0x1356('0x3d')]));return this['channel'][_0x1356('0xae')](_0x1356('0x100'));};AGIVertices[_0x1356('0x12')]['ext_dial']=function(_0x2419f2){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2419f2[_0x1356('0x3d')]));var _0x179efc='';if(_0x2419f2[_0x1356('0x101')]){if(!this[_0x1356('0xab')](_0x2419f2[_0x1356('0x101')])){return this['channel'][_0x1356('0x31')](_0x2419f2,_0x1356('0x102'));}else{var _0x241aec=parseInt(_0x2419f2['trunk_id'],0xa);if(isNaN(_0x241aec)){_0x179efc=_0x2419f2['trunk_id'];}else{_0x179efc=this[_0x1356('0x20')][_0x1356('0x73')](this,_0x2419f2['trunk_id']);if(!_0x179efc){return this[_0x1356('0x10')]['error'](_0x2419f2,'no\x20trunk\x20found');}}}}else if(_0x2419f2[_0x1356('0x103')]){_0x179efc=_0x2419f2[_0x1356('0x103')];}else{return this['channel'][_0x1356('0x31')](_0x2419f2,_0x1356('0x102'));}var _0x4577f5=this['channel'][_0x1356('0x5e')](_0x1356('0x104'),[util['format'](_0x1356('0x105'),_0x179efc,_0x2419f2[_0x1356('0x4e')]),_0x2419f2[_0x1356('0x6b')],_0x2419f2[_0x1356('0xe2')],_0x2419f2['url']]);if(_0x4577f5['result']===-0x1){return _0x4577f5;}return this['channel']['noop'](util[_0x1356('0x2d')](_0x1356('0x106'),'DIAL'));};AGIVertices[_0x1356('0x12')][_0x1356('0x107')]=function(_0x10654b){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x108'),_0x10654b[_0x1356('0x3d')]));return this[_0x1356('0x10')]['noop']('finally');};AGIVertices[_0x1356('0x12')]['getdigits']=function(_0x379b3b){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x109'),_0x379b3b[_0x1356('0x3d')]));if(_0x379b3b['retry']===0x0){return this[_0x1356('0xac')](_0x379b3b);}_0x379b3b[_0x1356('0x10a')]-=0x1;if(!this[_0x1356('0xab')](_0x379b3b[_0x1356('0x10b')])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x379b3b,_0x1356('0x10c'));}var _0xe544b5=this[_0x1356('0x22')][_0x1356('0x73')](this,_0x379b3b[_0x1356('0x10b')]);if(!_0xe544b5){return this[_0x1356('0x10')][_0x1356('0x31')](_0x379b3b,_0x1356('0x10d'));}if(!this[_0x1356('0xab')](_0x379b3b['variable_id'])){return this[_0x1356('0x10')][_0x1356('0x31')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xdfc24f=this[_0x1356('0x10')][_0x1356('0x10e')](_0xe544b5,_0x379b3b[_0x1356('0x10f')],_0x379b3b[_0x1356('0x110')]);var _0x11186e=_0xdfc24f[_0x1356('0xa9')]?_0xdfc24f['result']['toString']():'';logger['info'](_0x1356('0x111'),JSON['stringify'](_0xdfc24f));if(_0xdfc24f[_0x1356('0xa9')]===-0x1){this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x379b3b,_0x11186e);return _0xdfc24f;}else if(_0xdfc24f['extra']===_0x1356('0x6b')){_0xdfc24f[_0x1356('0xa9')]=_0x11186e[_0x1356('0xa5')]>=parseInt(_0x379b3b[_0x1356('0x112')])?'x':'i';}else{_0xdfc24f[_0x1356('0xa9')]=_0x11186e[_0x1356('0xa5')]>=parseInt(_0x379b3b[_0x1356('0x112')])&&_0x11186e[_0x1356('0xa5')]<=parseInt(_0x379b3b[_0x1356('0x110')])?'x':'i';}var _0x5111bb=this[_0x1356('0xa8')]['sync'](this,_0x379b3b[_0x1356('0xda')]);if(!_0x5111bb){return this[_0x1356('0x10')][_0x1356('0x31')](_0x379b3b,_0x1356('0xdb'));}this[_0x1356('0x10')][_0x1356('0xa2')](_0x5111bb,_0x11186e);if(this[_0x1356('0xab')](_0x379b3b[_0x1356('0x113')])){var _0x165cf3=parseInt(_0x379b3b[_0x1356('0x113')],0xa);var _0x16a72f=rs[_0x1356('0x114')]({'charset':'*','length':_0x165cf3});var _0x4d7529=_0x11186e[_0x1356('0xa5')];if(_0x4d7529>0x0){if(_0x4d7529>_0x165cf3){this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x379b3b,_0x379b3b[_0x1356('0x115')]==='first'?_0x16a72f+_0x11186e[_0x1356('0x116')](_0x165cf3):_0x11186e[_0x1356('0x116')](0x0,_0x4d7529-_0x165cf3)+_0x16a72f);}else{this['createSquareDetailsReport'][_0x1356('0x73')](this,_0x379b3b,rs[_0x1356('0x114')]({'charset':'*','length':_0x4d7529}));}}else{this[_0x1356('0x3b')]['sync'](this,_0x379b3b,'');}}else{this[_0x1356('0x3b')]['sync'](this,_0x379b3b,_0x11186e);}return _0xdfc24f;};AGIVertices[_0x1356('0x12')][_0x1356('0xf')]=function(_0x22c4fc){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x117'),_0x22c4fc[_0x1356('0x3d')]));return this[_0x1356('0xe')](_0x22c4fc);};AGIVertices[_0x1356('0x12')][_0x1356('0x118')]=function(_0x2e7c06){logger['info'](util[_0x1356('0x2d')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x2e7c06['label']));this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x2e7c06,_0x2e7c06[_0x1356('0x119')]);return this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')](_0x1356('0x11a'),_0x2e7c06[_0x1356('0x119')]));};AGIVertices[_0x1356('0x12')][_0x1356('0x11b')]=function(_0x509709){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x11c'),_0x509709[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x509709[_0x1356('0x8c')])||!this[_0x1356('0xab')](_0x509709['aws_secret_access_key'])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0x11d'));}if(!this[_0x1356('0xab')](_0x509709[_0x1356('0x62')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0xaf'));}this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('Trying\x20aws\x20Polly\x20%s',_0x509709[_0x1356('0x62')]));var _0x8cc0f4=this[_0x1356('0x8b')][_0x1356('0x73')](this,_0x509709);if(_0x8cc0f4){this[_0x1356('0x10')][_0x1356('0xae')](util['format'](_0x1356('0x11e'),_0x8cc0f4));var _0x417e2b=this[_0x1356('0x10')][_0x1356('0xfc')](_0x8cc0f4);try{fs[_0x1356('0xfd')](_0x8cc0f4+_0x1356('0x11f'));}catch(_0x111ab0){logger[_0x1356('0x31')](_0x111ab0);}return _0x417e2b;}return this['channel']['error'](_0x509709,_0x1356('0x120'));};AGIVertices[_0x1356('0x12')][_0x1356('0x121')]=function(_0x5d7961){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x122'),_0x5d7961[_0x1356('0x3d')]));if(!this['isConfigured'](_0x5d7961[_0x1356('0x8c')])||!this[_0x1356('0xab')](_0x5d7961['aws_secret_access_key'])){return this[_0x1356('0x10')]['noop'](_0x1356('0x11d'));}if(!this[_0x1356('0xab')](_0x5d7961[_0x1356('0x93')])){return this['channel']['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x1356('0xab')](_0x5d7961[_0x1356('0x62')])){return this[_0x1356('0x10')][_0x1356('0xae')]('no\x20text\x20configured');}this['channel'][_0x1356('0xe5')]=!![];this['createSquareDetailsReport'](_0x5d7961);this['createSquareMessage'](_0x5d7961['text'],'in','','');this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('Trying\x20Amazon\x20Lex:\x20%s',_0x5d7961[_0x1356('0x62')]));var _0x482d7b=this[_0x1356('0x91')][_0x1356('0x73')](this,_0x5d7961);if(_0x482d7b){for(var _0x552dec in _0x482d7b){if(_0x482d7b[_0x1356('0x9d')](_0x552dec)&&_[_0x1356('0x9a')](_0x482d7b[_0x552dec])){this[_0x1356('0x10')][_0x1356('0xa2')](util[_0x1356('0x2d')](_0x1356('0x123'),_0x552dec[_0x1356('0x6e')]()),_0x482d7b[_0x552dec]);}}if(_[_0x1356('0x4d')](_0x482d7b[_0x1356('0x7b')])){return this['channel']['noop'](_0x1356('0x124'));}else{this[_0x1356('0x47')](_0x482d7b[_0x1356('0x7b')],_0x1356('0xf9'),_0x1356('0x125'),'');return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x126'),_0x482d7b[_0x1356('0x7b')]));}}return this[_0x1356('0x10')]['error'](_0x5d7961,_0x1356('0x127'));};AGIVertices[_0x1356('0x12')][_0x1356('0x128')]=function(_0x557275){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x129'),_0x557275['label'],_0x557275[_0x1356('0x6b')]));if(!this['isConfigured'](_0x557275['key'])){return this[_0x1356('0x10')]['noop']('no\x20key\x20configured');}var _0xa53395=_0x1356('0x12a');var _0x495218=util[_0x1356('0x2d')](_0x1356('0x12b'),FILES_PATH,rs[_0x1356('0x114')](0x4));var _0x22d8ac=util[_0x1356('0x2d')]('%s.%s',_0x495218,_0xa53395);var _0x217387=!![];if(_0x557275[_0x1356('0x12c')]===_0x1356('0x12d')){_0x217387=![];}var _0x2dd65a=this['channel'][_0x1356('0x12e')](_0x495218,_0xa53395,_0x557275[_0x1356('0x12f')],_0x557275[_0x1356('0x6b')],undefined,_0x217387);if(_0x2dd65a[_0x1356('0xa9')]!==-0x1){this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x130'),_0x22d8ac));var _0x96b302=this['googleASR'][_0x1356('0x73')](this,_0x557275,_0x22d8ac);if(_0x96b302){for(var _0x52ad27 in _0x96b302){if(_0x96b302[_0x1356('0x9d')](_0x52ad27)){this[_0x1356('0x10')][_0x1356('0xa2')](util[_0x1356('0x2d')]('GOOGLE_ASR_%s',_0x52ad27['toUpperCase']()),_0x96b302[_0x52ad27]);}}return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x131'),JSON[_0x1356('0x76')](_0x96b302)));}}return _0x2dd65a;};AGIVertices[_0x1356('0x12')]['tildeasr']=function(_0x4f122c){logger[_0x1356('0x34')](util['format'](_0x1356('0x132'),_0x4f122c[_0x1356('0x3d')]));if(!this['isConfigured'](_0x4f122c[_0x1356('0x97')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0x133'));}if(!this[_0x1356('0xab')](_0x4f122c['appsecret'])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0x134'));}var _0x4792c6=_0x1356('0x12a');var _0x4daa8d=util[_0x1356('0x2d')](_0x1356('0x12b'),FILES_PATH,rs[_0x1356('0x114')](0x4));var _0x42c591=util[_0x1356('0x2d')]('%s.%s',_0x4daa8d,_0x4792c6);var _0x8f3441=!![];if(_0x4f122c[_0x1356('0x12c')]===_0x1356('0x12d')){_0x8f3441=![];}var _0x40b364=this[_0x1356('0x10')][_0x1356('0x12e')](_0x4daa8d,_0x4792c6,_0x4f122c['intKey'],_0x4f122c['timeout'],undefined,_0x8f3441);if(_0x40b364['result']!==-0x1){this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('tilde\x20%s\x20file\x20created',_0x42c591));var _0x1fa47b=this['tildeASR'][_0x1356('0x73')](this,_0x4f122c,_0x42c591);if(_0x1fa47b){for(var _0x2992c2 in _0x1fa47b){if(_0x1fa47b[_0x1356('0x9d')](_0x2992c2)){this[_0x1356('0x10')][_0x1356('0xa2')](util[_0x1356('0x2d')](_0x1356('0x135'),_0x2992c2[_0x1356('0x6e')]()),_0x1fa47b[_0x2992c2]);}}return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('TildeASR\x20Result\x20%s',JSON[_0x1356('0x76')](_0x1fa47b)));}}return _0x40b364;};AGIVertices[_0x1356('0x12')][_0x1356('0x136')]=function(_0x5e7748){logger[_0x1356('0x34')](util['format'](_0x1356('0x137'),_0x5e7748['label']));return this[_0x1356('0x10')][_0x1356('0x138')](_0x5e7748['context'],_0x5e7748['extension'],_0x5e7748['priority']);};AGIVertices[_0x1356('0x12')][_0x1356('0x139')]=function(_0x4b0bee){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x13a'),_0x4b0bee['label']));if(!this[_0x1356('0xab')](_0x4b0bee[_0x1356('0x13b')])){return this[_0x1356('0x10')]['error'](_0x4b0bee,_0x1356('0x13c'));}try{var _0x25ee70=eval(_0x4b0bee[_0x1356('0x13b')])?_0x1356('0x13d'):_0x1356('0x13e');this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('EVAL\x20CONDITION\x20%s\x20%s',_0x4b0bee[_0x1356('0x13b')],_0x25ee70));return{'code':0xc8,'result':_0x25ee70};}catch(_0x3644f3){return{'code':0xc8,'result':_0x1356('0x13e')};}};AGIVertices['prototype'][_0x1356('0x13f')]=function(_0x4e0913){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x140'),_0x4e0913[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x4e0913[_0x1356('0x141')])){return this['channel'][_0x1356('0x31')](_0x4e0913,'no\x20interval\x20configured');}var _0x308198=this['getIntervals']['sync'](this,_0x4e0913[_0x1356('0x141')]);if(!_0x308198){return this[_0x1356('0x10')]['error'](_0x4e0913,_0x1356('0x142'));}for(var _0x34e4f7=0x0;_0x34e4f7<_0x308198[_0x1356('0xa5')];_0x34e4f7+=0x1){var _0x1a6c20=this[_0x1356('0x10')][_0x1356('0xa8')](util[_0x1356('0x2d')](_0x1356('0x143'),_0x308198[_0x34e4f7]));if(_0x1a6c20[_0x1356('0xa9')]===-0x1){return _0x1a6c20;}logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x144'),_0x308198[_0x34e4f7],_0x1a6c20[_0x1356('0xaa')]));if(_0x1a6c20['extra']===_0x1356('0x13d')){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x144'),_0x308198[_0x34e4f7],_0x1356('0x13d')));this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x144'),_0x308198[_0x34e4f7],_0x1356('0x13d')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x1356('0x2d')](_0x1356('0x144'),_0x308198[_0x34e4f7],_0x1356('0x13e')));this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('IFTIME\x20%s\x20%s',_0x308198[_0x34e4f7],_0x1356('0x13e')));}}return{'code':0xc8,'result':_0x1356('0x13e')};};AGIVertices[_0x1356('0x12')][_0x1356('0x145')]=function(_0x223798){logger[_0x1356('0x34')](util['format'](_0x1356('0x146'),_0x223798['label']));return this['channel'][_0x1356('0x145')]();};AGIVertices[_0x1356('0x12')][_0x1356('0x147')]=function(_0x4c2da5){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x148'),_0x4c2da5['label']));if(!this['isConfigured'](_0x4c2da5[_0x1356('0x7f')])){return this[_0x1356('0x10')]['noop'](_0x1356('0xe4'));}var _0x5be007=_0x1356('0x12a');var _0x5eab21=util['format'](_0x1356('0x12b'),FILES_PATH,rs[_0x1356('0x114')](0x4));var _0x546b17=util[_0x1356('0x2d')](_0x1356('0xa1'),_0x5eab21,_0x5be007);var _0x44d90c=!![];if(_0x4c2da5[_0x1356('0x12c')]===_0x1356('0x12d')){_0x44d90c=![];}var _0x2ec53a=this[_0x1356('0x10')][_0x1356('0x12e')](_0x5eab21,_0x5be007,_0x4c2da5[_0x1356('0x12f')],_0x4c2da5[_0x1356('0x6b')],undefined,_0x44d90c);if(_0x2ec53a[_0x1356('0xa9')]!==-0x1){this['channel']['noop'](util[_0x1356('0x2d')](_0x1356('0x149'),_0x546b17));var _0x3ebf92=this[_0x1356('0x14a')][_0x1356('0x73')](this,_0x4c2da5,_0x546b17);if(_0x3ebf92){for(var _0x16b630 in _0x3ebf92){if(_0x3ebf92['hasOwnProperty'](_0x16b630)){this[_0x1356('0x10')][_0x1356('0xa2')](util['format'](_0x1356('0x14b'),_0x16b630[_0x1356('0x6e')]()),_0x3ebf92[_0x16b630]);}}return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x14c'),JSON[_0x1356('0x76')](_0x3ebf92)));}}return _0x2ec53a;};AGIVertices['prototype'][_0x1356('0x14d')]=function(_0x58159f){logger[_0x1356('0x34')](util['format'](_0x1356('0x14e'),_0x58159f[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x58159f[_0x1356('0x7f')])){return this[_0x1356('0x10')]['noop']('no\x20key\x20configured');}if(!this[_0x1356('0xab')](_0x58159f[_0x1356('0x62')])){return this['channel'][_0x1356('0xae')]('no\x20text\x20configured');}this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')](_0x1356('0x14f'),_0x58159f[_0x1356('0x62')]));var _0x4f6f02=this[_0x1356('0x86')][_0x1356('0x73')](this,_0x58159f);if(_0x4f6f02){this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x149'),_0x4f6f02));var _0x8ca435=this[_0x1356('0x10')]['streamFile'](_0x4f6f02,_0x58159f[_0x1356('0x12f')]);try{fs['unlink'](_0x4f6f02+_0x1356('0x11f'));}catch(_0x4a0bfb){logger['error'](_0x4a0bfb);}return _0x8ca435;}return this[_0x1356('0x10')][_0x1356('0x31')](_0x58159f,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x1356('0x150')]=function(_0xd1a079){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x151'),_0xd1a079['label']));if(!this['isConfigured'](_0xd1a079[_0x1356('0x152')])){return this[_0x1356('0x10')]['error'](_0xd1a079,_0x1356('0x153'));}logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x154'),this[_0x1356('0x10')]['callerid'],_0xd1a079[_0x1356('0x152')]));var _0x576e28=this['agentLogin'][_0x1356('0x73')](this,_0xd1a079[_0x1356('0x152')]);if(_0x576e28){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x155'),this[_0x1356('0x10')][_0x1356('0x40')],_0xd1a079[_0x1356('0x152')]));this['channel']['noop'](util[_0x1356('0x2d')](_0x1356('0x155'),this['channel'][_0x1356('0x40')],_0xd1a079[_0x1356('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1356('0x34')](util[_0x1356('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1356('0x10')][_0x1356('0x40')],_0xd1a079[_0x1356('0x152')]));this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x156'),this[_0x1356('0x10')][_0x1356('0x40')],_0xd1a079[_0x1356('0x152')]));return{'code':0xc8,'result':_0x1356('0x157')};}};AGIVertices['prototype'][_0x1356('0x158')]=function(_0x548be3){logger['info'](util[_0x1356('0x2d')](_0x1356('0x159'),_0x548be3[_0x1356('0x3d')]));if(!this['isConfigured'](_0x548be3['findBy'])){return this['channel'][_0x1356('0x31')](_0x548be3,_0x1356('0x153'));}logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x154'),this[_0x1356('0x10')]['callerid'],_0x548be3[_0x1356('0x152')]));var _0x4eb1d2=this[_0x1356('0x5a')][_0x1356('0x73')](this,_0x548be3[_0x1356('0x152')]);if(_0x4eb1d2){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x155'),this[_0x1356('0x10')]['callerid'],_0x548be3[_0x1356('0x152')]));this[_0x1356('0x10')]['noop'](util['format'](_0x1356('0x155'),this['channel'][_0x1356('0x40')],_0x548be3[_0x1356('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x156'),this['channel'][_0x1356('0x40')],_0x548be3[_0x1356('0x152')]));this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x156'),this[_0x1356('0x10')][_0x1356('0x40')],_0x548be3[_0x1356('0x152')]));return{'code':0xc8,'result':_0x1356('0x157')};}};AGIVertices[_0x1356('0x12')][_0x1356('0x15a')]=function(_0x278689){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x278689[_0x1356('0x3d')]));if(!this['isConfigured'](_0x278689['operation'])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x278689,_0x1356('0x15b'));}this[_0x1356('0x10')][_0x1356('0xae')](util['format'](_0x1356('0x15c'),_0x278689[_0x1356('0x15d')]));var _0x10f2e4=eval(_0x278689['operation']);if(!this[_0x1356('0xab')](_0x278689[_0x1356('0xda')])){return this['channel'][_0x1356('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xa35780=this[_0x1356('0xa8')][_0x1356('0x73')](this,_0x278689[_0x1356('0xda')]);if(!_0xa35780){return this[_0x1356('0x10')][_0x1356('0x31')](_0x278689,_0x1356('0xdb'));}if(_[_0x1356('0x9f')](_0x10f2e4)){var _0x3e68d2=this;_0x10f2e4['forEach'](function(_0x4dc228,_0x2d98f5){_0x3e68d2[_0x1356('0x10')]['setVariable'](util[_0x1356('0x2d')](_0x1356('0x15e'),_0xa35780,_0x2d98f5),_0x4dc228);});return this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')](_0x1356('0x15f'),_0xa35780));}else{return this[_0x1356('0x10')][_0x1356('0xa2')](_0xa35780,_0x10f2e4);}};AGIVertices[_0x1356('0x12')]['menu']=function(_0x5e8b3c){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x160'),_0x5e8b3c['label']));if(_0x5e8b3c['retry']===0x0){return this[_0x1356('0xac')](_0x5e8b3c);}_0x5e8b3c[_0x1356('0x10a')]-=0x1;if(!this[_0x1356('0xab')](_0x5e8b3c[_0x1356('0x10b')])){return this['channel'][_0x1356('0x31')](_0x5e8b3c,_0x1356('0x10c'));}var _0xffa025=this[_0x1356('0x22')][_0x1356('0x73')](this,_0x5e8b3c[_0x1356('0x10b')]);if(!_0xffa025){return this['channel']['error'](_0x5e8b3c,_0x1356('0x10d'));}var _0x500a55=this[_0x1356('0x10')]['getData'](_0xffa025,_0x5e8b3c[_0x1356('0x10f')],_0x5e8b3c[_0x1356('0x161')]);var _0x3bfb83=_0x500a55[_0x1356('0xa9')];if(_0x500a55['result']===-0x1){this[_0x1356('0x3b')]['sync'](this,_0x5e8b3c,'-1');return _0x500a55;}else if(_0x500a55[_0x1356('0xaa')]==='timeout'){_0x500a55[_0x1356('0xa9')]=_0x500a55[_0x1356('0xa9')][_0x1356('0xa5')]>0x0?_0x500a55[_0x1356('0xa9')]:'t';}else if(_['isEmpty'](_0x500a55[_0x1356('0xa9')])){_0x500a55[_0x1356('0xa9')]='#';_0x3bfb83='#';}if(!this['isConfigured'](_0x5e8b3c[_0x1356('0xda')])){this[_0x1356('0x10')][_0x1356('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x427073=this['getVariable'][_0x1356('0x73')](this,_0x5e8b3c['variable_id']);if(!_0x427073){return this[_0x1356('0x10')][_0x1356('0x31')](_0x5e8b3c,_0x1356('0xdb'));}this['channel'][_0x1356('0xa2')](_0x427073,_0x3bfb83);}this[_0x1356('0x3b')]['sync'](this,_0x5e8b3c,_0x3bfb83);return _0x500a55;};AGIVertices[_0x1356('0x12')][_0x1356('0xae')]=function(_0x354a3b){logger[_0x1356('0x34')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x354a3b['label']));return this['channel'][_0x1356('0xae')](_0x354a3b[_0x1356('0x162')]||_0x354a3b['label']);};AGIVertices['prototype'][_0x1356('0x163')]=function(_0x392a5f){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x164'),_0x392a5f[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x392a5f['findBy'])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x392a5f,_0x1356('0x153'));}logger[_0x1356('0x34')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1356('0x10')][_0x1356('0x40')],_0x392a5f[_0x1356('0x152')]));var _0x4ab823=this[_0x1356('0x55')][_0x1356('0x73')](this,_0x392a5f[_0x1356('0x165')]);var _0x27fb16=this['agentPause'][_0x1356('0x73')](this,_0x392a5f[_0x1356('0x152')],_0x4ab823);if(_0x27fb16){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x155'),this[_0x1356('0x10')][_0x1356('0x40')],_0x392a5f['findBy']));this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x155'),this[_0x1356('0x10')][_0x1356('0x40')],_0x392a5f[_0x1356('0x152')]));return{'code':0xc8,'result':_0x1356('0x166')};}else{logger['info'](util['format'](_0x1356('0x156'),this[_0x1356('0x10')][_0x1356('0x40')],_0x392a5f[_0x1356('0x152')]));this[_0x1356('0x10')]['noop'](util['format'](_0x1356('0x155'),this[_0x1356('0x10')]['callerid'],_0x392a5f[_0x1356('0x152')]));return{'code':0xc8,'result':_0x1356('0x157')};}};AGIVertices['prototype'][_0x1356('0x167')]=function(_0x58396b){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x168'),_0x58396b[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x58396b['file_id'])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x58396b,_0x1356('0x10c'));}var _0x3910d3=this['getSound'][_0x1356('0x73')](this,_0x58396b[_0x1356('0x10b')]);if(!_0x3910d3){return this['channel'][_0x1356('0x31')](_0x58396b,_0x1356('0x10d'));}var _0x30acd0=this['channel']['exec'](_0x1356('0x169'),[_0x3910d3,_0x58396b[_0x1356('0xe2')]]);if(_0x30acd0[_0x1356('0xa9')]===-0x1){return _0x30acd0;}return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0xc5'),'PLAYBACK',_0x3910d3));};AGIVertices[_0x1356('0x12')][_0x1356('0x16a')]=function(_0x1bd34b){logger['info'](util[_0x1356('0x2d')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x1bd34b[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x1bd34b[_0x1356('0x16b')])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x1bd34b,_0x1356('0x16c'));}var _0x35f220='';var _0xe44e47=parseInt(_0x1bd34b[_0x1356('0x16b')],0xa);if(isNaN(_0xe44e47)){_0x35f220=_0x1bd34b[_0x1356('0x16b')];}else{_0x35f220=this[_0x1356('0x17')][_0x1356('0x73')](this,_0x1bd34b[_0x1356('0x16b')]);if(!_0x35f220){return this[_0x1356('0x10')][_0x1356('0x31')](_0x1bd34b,_0x1356('0x16d'));}}var _0x506e62='';if(this[_0x1356('0xab')](_0x1bd34b[_0x1356('0x10b')])){var _0x11724d=this['getSound']['sync'](this,_0x1bd34b['file_id']);if(_0x11724d){_0x506e62=_0x11724d;}}this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x1bd34b,_0x35f220);if(_0x1bd34b[_0x1356('0xe2')][_0x1356('0x16e')]('x')<0x0){_0x1bd34b[_0x1356('0xe2')]+='x';}if(_0x1bd34b[_0x1356('0xe2')]['indexOf']('X')<0x0){_0x1bd34b[_0x1356('0xe2')]+='X';}this['channel']['setVariable'](_0x1356('0x16f'),_0x35f220?_0x35f220[_0x1356('0x170')]():'');var _0x338592=this[_0x1356('0x10')]['exec'](_0x1356('0x171'),[_0x35f220,_0x1bd34b[_0x1356('0xe2')],_0x1bd34b[_0x1356('0x6a')],_0x506e62,_0x1bd34b['timeout'],_0x1bd34b[_0x1356('0x8')],_0x1bd34b['macro'],_0x1bd34b[_0x1356('0x172')],'',_0x1bd34b[_0x1356('0x173')]]);if(_0x338592['result']===-0x1){return _0x338592;}return this[_0x1356('0x10')][_0x1356('0xae')](util['format']('Executed\x20command\x20%s\x20%s',_0x1356('0x171'),_0x35f220));};AGIVertices[_0x1356('0x12')][_0x1356('0x174')]=function(_0x115a01){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x115a01[_0x1356('0x3d')]));var _0x4ab83b=_0x115a01[_0x1356('0x175')]||_0x1356('0x12a');var _0x1a18f5=util['format']('%s_%s',this[_0x1356('0x10')][_0x1356('0x3c')],rs[_0x1356('0x114')](0x5));var _0x27bd00=util[_0x1356('0x2d')](_0x1356('0x176'),FILES_PATH,_0x1a18f5,_0x4ab83b);var _0x5818f4=util[_0x1356('0x2d')]('%s/recordings/%s',FILES_PATH,_0x1a18f5);this[_0x1356('0x41')][_0x1356('0x73')](this,_0x115a01,_0x1a18f5,_0x27bd00);this['channel'][_0x1356('0xa2')](_0x1356('0x177'),_0x1a18f5);logger[_0x1356('0x34')](_0x1356('0x178'),_0x5818f4,_0x4ab83b,_0x115a01['escape_digits'],_0x115a01[_0x1356('0x6b')]);return this[_0x1356('0x10')][_0x1356('0x12e')](_0x5818f4,_0x4ab83b,_0x115a01[_0x1356('0x179')],_0x115a01[_0x1356('0x6b')],undefined,!![]);};AGIVertices[_0x1356('0x12')][_0x1356('0x17a')]=function(_0x47e866){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x47e866[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x47e866[_0x1356('0x6a')])){return this[_0x1356('0x10')][_0x1356('0xae')]('no\x20url\x20configured');}var _0x40f2be=this['restAPI'][_0x1356('0x73')](this,_0x47e866);logger[_0x1356('0x34')](util['format'](_0x1356('0x17b'),util[_0x1356('0x17c')](_0x40f2be,{'showHidden':![],'depth':null})));if(!this[_0x1356('0xab')](_0x47e866[_0x1356('0xda')])){return this[_0x1356('0x10')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0xcb106f=this[_0x1356('0xa8')][_0x1356('0x73')](this,_0x47e866[_0x1356('0xda')]);if(!_0xcb106f){return this[_0x1356('0x10')]['error'](_0x47e866,'no\x20variable\x20found');}this[_0x1356('0x10')][_0x1356('0xa2')](util[_0x1356('0x2d')](_0x1356('0x17d'),_0xcb106f),_0x40f2be[_0x1356('0x79')]?_0x40f2be[_0x1356('0x79')]:'200');this[_0x1356('0x10')][_0x1356('0xa2')](util[_0x1356('0x2d')]('%s_STATUS_MESSAGE',_0xcb106f),_0x40f2be[_0x1356('0x7a')]?_0x40f2be['statusMessage']:'OK');if(_0x40f2be[_0x1356('0x77')]){try{this[_0x1356('0xa0')](_0x40f2be['body'],_0xcb106f);}catch(_0x43b050){logger[_0x1356('0x31')](util['format'](_0x1356('0x17e'),_0xcb106f));}}return this['channel'][_0x1356('0xae')](util['format'](_0x1356('0xdf'),_0xcb106f));};AGIVertices[_0x1356('0x12')][_0x1356('0x17f')]=function(_0x27b9e9){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x180'),_0x27b9e9[_0x1356('0x3d')]));return this['channel']['sayDigits'](_0x27b9e9[_0x1356('0x181')][_0x1356('0xd7')](/\s+/g,''),_0x27b9e9[_0x1356('0x179')]);};AGIVertices['prototype']['saynumber']=function(_0x45b392){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x45b392['label']));return this[_0x1356('0x10')][_0x1356('0x182')](_0x45b392['number'][_0x1356('0xd7')](/\s+/g,''),_0x45b392['escape_digits']);};AGIVertices[_0x1356('0x12')][_0x1356('0x183')]=function(_0x195617){logger[_0x1356('0x34')](util['format'](_0x1356('0x184'),_0x195617['label']));return this['channel'][_0x1356('0x185')](_0x195617[_0x1356('0x62')],_0x195617[_0x1356('0x179')]);};AGIVertices[_0x1356('0x12')][_0x1356('0x186')]=function(_0x4f2642){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x187'),_0x4f2642[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x4f2642[_0x1356('0x188')])){return this[_0x1356('0x10')][_0x1356('0xae')]('no\x20mail\x20account\x20configured');}var _0x1a8152=this[_0x1356('0x25')]['sync'](this,_0x4f2642[_0x1356('0x188')]);if(!_0x1a8152||!_0x1a8152['Smtp']){return this['channel'][_0x1356('0x31')](_0x4f2642,'no\x20mail\x20account\x20found');}var _0x530655={'from':util[_0x1356('0x2d')](_0x1356('0x189'),_0x1a8152[_0x1356('0x15')],_0x1a8152[_0x1356('0x18a')]||_0x1a8152['Smtp'][_0x1356('0x18b')]),'to':_0x4f2642['to']||'','cc':_0x4f2642['cc']||'','bcc':_0x4f2642[_0x1356('0x18c')]||'','subject':_0x4f2642[_0x1356('0x18d')],'html':_0x4f2642[_0x1356('0x62')],'text':_0x4f2642[_0x1356('0x62')]};if(this['isConfigured'](_0x4f2642[_0x1356('0x18e')])){}logger[_0x1356('0x18f')](_0x1356('0x190'),JSON['stringify'](_0x530655));this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x4f2642,_0x4f2642[_0x1356('0x188')]);this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')](_0x1356('0x191'),_0x1a8152[_0x1356('0x15')]));this['sendMailMessage'][_0x1356('0x73')](this,_0x1a8152['smtpOptions'],_0x530655);return this['channel'][_0x1356('0xae')](_0x1356('0x192'));};AGIVertices[_0x1356('0x12')]['sendFax']=function(_0x34a9b5){logger['info'](util[_0x1356('0x2d')](_0x1356('0x193'),_0x34a9b5[_0x1356('0x3d')]));return this['channel'][_0x1356('0xae')](_0x1356('0x194'));};AGIVertices[_0x1356('0x12')]['sendSMS']=function(_0x301810){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x195'),_0x301810[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x301810[_0x1356('0x196')])){return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0x197'));}var _0x571a73=this['getSmsAccount'][_0x1356('0x73')](this,_0x301810[_0x1356('0x196')]);if(!_0x571a73){return this[_0x1356('0x10')][_0x1356('0x31')](_0x301810,_0x1356('0x198'));}var _0x403068={'body':_0x301810[_0x1356('0x199')],'phone':_0x301810['to']||'','SmsAccountId':_0x571a73['id']};logger[_0x1356('0x18f')](_0x1356('0x19a'),JSON[_0x1356('0x76')](_0x403068));this['createSquareDetailsReport'][_0x1356('0x73')](this,_0x301810,_0x301810['sms_account_id']);this['channel'][_0x1356('0xae')](util[_0x1356('0x2d')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x571a73['name']));this[_0x1356('0x3a')]['sync'](this,_0x403068);return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0x19b'));};AGIVertices['prototype'][_0x1356('0x19c')]=function(_0x11360a){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x19d'),_0x11360a['label']));if(!this[_0x1356('0xab')](_0x11360a[_0x1356('0xda')])){return this[_0x1356('0x10')]['error'](_0x11360a,_0x1356('0x19e'));}var _0x3f85e9=this[_0x1356('0xa8')]['sync'](this,_0x11360a[_0x1356('0xda')]);if(!_0x3f85e9){return this[_0x1356('0x10')][_0x1356('0x31')](_0x11360a,_0x1356('0xdb'));}return this[_0x1356('0x10')]['setVariable'](_0x3f85e9,_0x11360a[_0x1356('0x19f')]);};AGIVertices[_0x1356('0x12')]['start']=function(_0x4c7ded){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20START\x20(%s)\x20block',_0x4c7ded['label']));this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0x1a0'));var _0x1806b7=this[_0x1356('0x10')][_0x1356('0xa8')]('XMCS-UNIQUEID');if(!_['isEmpty'](_0x1806b7[_0x1356('0xaa')])){this[_0x1356('0x10')][_0x1356('0x3c')]=_0x1806b7[_0x1356('0xaa')];}if(_0x4c7ded[_0x1356('0xbc')]===_0x1356('0x1a1')){this['channel']['noop'](_0x1356('0x1a2'));return this[_0x1356('0x10')][_0x1356('0xbc')]();}return this[_0x1356('0x10')][_0x1356('0xae')](_0x1356('0x1a3'));};AGIVertices[_0x1356('0x12')][_0x1356('0x1a4')]=function(_0xfce994){logger[_0x1356('0x34')](util['format'](_0x1356('0x1a5'),_0xfce994[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0xfce994[_0x1356('0x1a6')])){return this[_0x1356('0x10')][_0x1356('0x31')](_0xfce994,_0x1356('0x1a7'));}var _0x32a705=this[_0x1356('0x19')][_0x1356('0x73')](this,_0xfce994['project_id']);if(!this[_0x1356('0xab')](_0x32a705)){return this[_0x1356('0x10')][_0x1356('0x31')](_0xfce994,util[_0x1356('0x2d')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0xfce994['project_id']));}if(_0x32a705===this['channel'][_0x1356('0x3f')]){return this[_0x1356('0x10')]['error'](_0xfce994,_0x1356('0x1a8'));}this[_0x1356('0x3b')][_0x1356('0x73')](this,_0xfce994,_0x32a705);var _0x1a9042=this[_0x1356('0x10')][_0x1356('0x5e')](_0x1356('0x1a9'),util[_0x1356('0x2d')](_0x1356('0x1aa'),config['agi']['host']||_0x1356('0x1ab'),_0x32a705,this['channel'][_0x1356('0x3f')]));if(_0x1a9042[_0x1356('0xa9')]===-0x1){return _0x1a9042;}return this[_0x1356('0x10')][_0x1356('0xae')](util['format']('Executed\x20command\x20%s\x20%s',_0x1356('0x1a9'),_0x32a705));};AGIVertices[_0x1356('0x12')][_0x1356('0x1ac')]=function(_0x1ae849){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x1ad'),_0x1ae849[_0x1356('0x3d')]));var _0x34cb96=this['shellCommand'][_0x1356('0x73')](this,_0x1ae849[_0x1356('0x1ae')]);this[_0x1356('0x3b')][_0x1356('0x73')](this,_0x1ae849,_0x1ae849[_0x1356('0x1ae')]);if(this[_0x1356('0xab')](_0x1ae849[_0x1356('0xda')])){var _0x16b428=this[_0x1356('0xa8')]['sync'](this,_0x1ae849['variable_id']);if(_0x16b428){this[_0x1356('0x10')][_0x1356('0xa2')](_0x16b428,_0x34cb96);return this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1ae849[_0x1356('0x1ae')],_0x16b428));}}return this['channel'][_0x1356('0xae')](util['format'](_0x1356('0x1af'),_0x1ae849[_0x1356('0x1ae')]));};AGIVertices[_0x1356('0x12')]['google_cloud_tts']=function(_0x41d7b3){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x1b0'),_0x41d7b3[_0x1356('0x3d')]));_0x41d7b3['text']=_0x41d7b3['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1356('0xab')](_0x41d7b3[_0x1356('0x61')])){return this[_0x1356('0x10')][_0x1356('0xae')]('no\x20apiKey\x20configured');}if(!this[_0x1356('0xab')](_0x41d7b3['text'])){return this[_0x1356('0x10')][_0x1356('0xae')]('no\x20text\x20configured');}this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x1b1'),_0x41d7b3[_0x1356('0x62')]));var _0x51f933=this[_0x1356('0x60')][_0x1356('0x73')](this,_0x41d7b3);if(_0x51f933){this['channel'][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x1b2'),_0x51f933));var _0x179475=this[_0x1356('0x10')][_0x1356('0xfc')](_0x51f933);try{fs[_0x1356('0xfd')](_0x51f933+'.wav');}catch(_0x3309d4){logger[_0x1356('0x31')](_0x3309d4);}return _0x179475;}return this['channel'][_0x1356('0x31')](_0x41d7b3,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1356('0x12')][_0x1356('0x1b3')]=function(_0x5eba58){logger[_0x1356('0x34')](util[_0x1356('0x2d')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5eba58[_0x1356('0x3d')]));_0x5eba58[_0x1356('0x62')]=_0x5eba58[_0x1356('0x62')][_0x1356('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1356('0xab')](_0x5eba58[_0x1356('0x62')])){return this['channel'][_0x1356('0xae')](_0x1356('0xaf'));}this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')](_0x1356('0x1b4'),_0x5eba58['text']));var _0x28a918=this[_0x1356('0x68')][_0x1356('0x73')](this,_0x5eba58);if(_0x28a918){this[_0x1356('0x10')]['noop'](util[_0x1356('0x2d')](_0x1356('0x1b5'),_0x28a918));var _0x171f2b=this[_0x1356('0x10')][_0x1356('0xfc')](_0x28a918);try{fs[_0x1356('0xfd')](_0x28a918+_0x1356('0x11f'));}catch(_0x236da2){logger[_0x1356('0x31')](_0x236da2);}return _0x171f2b;}return this['channel'][_0x1356('0x31')](_0x5eba58,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1356('0x12')][_0x1356('0x1b6')]=function(_0x48c55e){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x1b7'),_0x48c55e[_0x1356('0x3d')]));if(!this['isConfigured'](_0x48c55e['findBy'])){return this['channel'][_0x1356('0x31')](_0x48c55e,_0x1356('0x153'));}logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x154'),this[_0x1356('0x10')][_0x1356('0x40')],_0x48c55e[_0x1356('0x152')]));var _0x3b2c4=this['agentUnpause'][_0x1356('0x73')](this,_0x48c55e['findBy']);if(_0x3b2c4){logger['info'](util[_0x1356('0x2d')](_0x1356('0x155'),this[_0x1356('0x10')]['callerid'],_0x48c55e['findBy']));this[_0x1356('0x10')][_0x1356('0xae')](util[_0x1356('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1356('0x10')][_0x1356('0x40')],_0x48c55e['findBy']));return{'code':0xc8,'result':_0x1356('0x166')};}else{logger['info'](util[_0x1356('0x2d')](_0x1356('0x156'),this['channel']['callerid'],_0x48c55e['findBy']));this['channel'][_0x1356('0xae')](util[_0x1356('0x2d')](_0x1356('0x156'),this[_0x1356('0x10')]['callerid'],_0x48c55e['findBy']));return{'code':0xc8,'result':_0x1356('0x157')};}};AGIVertices[_0x1356('0x12')][_0x1356('0x1b8')]=function(_0x7aa180){logger[_0x1356('0x34')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x7aa180[_0x1356('0x3d')]));var _0x3ff26c=this[_0x1356('0x10')][_0x1356('0x5e')](_0x1356('0x1b9'),[_0x7aa180[_0x1356('0x1ba')],_0x7aa180['options']]);if(_0x3ff26c[_0x1356('0xa9')]===-0x1){return _0x3ff26c;}return this['channel'][_0x1356('0xae')](util['format'](_0x1356('0xc5'),_0x1356('0x1b9'),_0x7aa180[_0x1356('0x1ba')]));};AGIVertices[_0x1356('0x12')][_0x1356('0x1bb')]=function(_0x1bdfd9){logger[_0x1356('0x34')](util[_0x1356('0x2d')](_0x1356('0x1bc'),_0x1bdfd9[_0x1356('0x3d')]));if(!this[_0x1356('0xab')](_0x1bdfd9[_0x1356('0xda')])){return this[_0x1356('0x10')][_0x1356('0x31')](_0x1bdfd9,_0x1356('0x19e'));}var _0x210b4f=this[_0x1356('0xa8')][_0x1356('0x73')](this,_0x1bdfd9[_0x1356('0xda')]);if(!_0x210b4f){return this[_0x1356('0x10')][_0x1356('0x31')](_0x1bdfd9,'no\x20variable\x20found');}var _0x4ee5a6=this[_0x1356('0x10')][_0x1356('0xa8')](_0x210b4f);return{'code':0xc8,'result':_0x4ee5a6[_0x1356('0xaa')]?_0x4ee5a6[_0x1356('0xaa')]:'-'};};String[_0x1356('0x12')][_0x1356('0xa6')]=function(_0x1a7b52,_0x55ccc0){return this[_0x1356('0xa4')](_0x1a7b52)[_0x1356('0x1bd')](_0x55ccc0);};module[_0x1356('0x1be')]=AGIVertices; \ No newline at end of file +var _0x0a12=['response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','output','pause_id','failure','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','arg_1','system','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','agicommand','createSquareRecording','uniqueid','callerid','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','internal','LOCAL','agentLogin','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','stringify','render','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','saveRestApiResult','%s.%s','isArray','length','setVariable','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','scheduledAt','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','createSquareDetailsReport','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','getUser','sip_id','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','toUpperCase','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData'];(function(_0x545cba,_0x2903d9){var _0x43814f=function(_0x5a1596){while(--_0x5a1596){_0x545cba['push'](_0x545cba['shift']());}};_0x43814f(++_0x2903d9);}(_0x0a12,0xb8));var _0x20a1=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0a12[_0x45b034];return _0x509cb0;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x20a1('0x0'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x20a1('0x1'));var Mustache=require('mustache');var rp=require(_0x20a1('0x2'));var logger=require(_0x20a1('0x3'))(_0x20a1('0x4'));var config=require(_0x20a1('0x5'));var scripts=require(_0x20a1('0x6'));var FILES_PATH=_0x20a1('0x7');var recursiveMapAttributes=[_0x20a1('0x8'),'rawBody'];var verticesWithRetry=['menu',_0x20a1('0x9'),'getsecretdigits'];var AGIVertices=function(_0x548be6,_0x32645b,_0x6a8004){this[_0x20a1('0xa')]=_0x548be6;this[_0x20a1('0xb')]=_0x32645b;this[_0x20a1('0xc')]=_0x6a8004;};AGIVertices[_0x20a1('0xd')][_0x20a1('0xe')]=function(_0x5029df,_0x3552e4){this[_0x20a1('0xb')][_0x20a1('0xf')](_0x5029df)[_0x20a1('0x10')](function(_0x453842){_0x3552e4(null,_0x453842?_0x453842[_0x20a1('0x11')]:![]);})['catch'](function(_0x77a193){_0x3552e4(_0x77a193);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x12')]=function(_0x249e0e,_0x3a4786){this[_0x20a1('0xb')][_0x20a1('0x13')](_0x249e0e)[_0x20a1('0x10')](function(_0x3c7bef){_0x3a4786(null,_0x3c7bef?_0x3c7bef[_0x20a1('0x11')]:![]);})[_0x20a1('0x14')](function(_0x401178){_0x3a4786(_0x401178);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x15')]=function(_0x559a97,_0x50d618){this['rpc']['getSquareProjectById'](_0x559a97)['then'](function(_0x478974){_0x50d618(null,_0x478974?_0x478974['name']:![]);})['catch'](function(_0x4a68c5){_0x50d618(_0x4a68c5);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x16')]=function(_0xc4e691,_0xf5d655){this[_0x20a1('0xb')][_0x20a1('0x17')](_0xc4e691)['then'](function(_0x4879c4){_0xf5d655(null,_0x4879c4?_0x4879c4[_0x20a1('0x18')]:![]);})[_0x20a1('0x14')](function(_0x3720c2){_0xf5d655(_0x3720c2);});};AGIVertices['prototype']['getUser']=function(_0x1f6669,_0x2969cd){this[_0x20a1('0xb')][_0x20a1('0x19')](_0x1f6669)['then'](function(_0x512dbd){_0x2969cd(null,_0x512dbd?_0x512dbd['name']:![]);})['catch'](function(_0x67313c){_0x2969cd(_0x67313c);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1a')]=function(_0x4e9f0e,_0x10a600){this['rpc'][_0x20a1('0x1b')](_0x4e9f0e)['then'](function(_0x4bed2d){_0x10a600(null,_0x4bed2d?_0x4bed2d['name']:![]);})['catch'](function(_0x566a9f){_0x10a600(_0x566a9f);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1c')]=function(_0x24d1e2,_0xee9dd8){var _0x3927b2=this;this[_0x20a1('0xb')]['getSoundById'](_0x24d1e2)[_0x20a1('0x10')](function(_0x47877f){_0xee9dd8(null,_0x47877f?_0x3927b2[_0x20a1('0x1d')](_0x47877f[_0x20a1('0x1e')]):![]);})['catch'](function(_0x1c48cf){_0xee9dd8(_0x1c48cf);});};AGIVertices['prototype'][_0x20a1('0x1f')]=function(_0x2c8ec6,_0x184a3d){this[_0x20a1('0xb')][_0x20a1('0x20')](_0x2c8ec6)[_0x20a1('0x10')](function(_0x13d9ea){_0x184a3d(null,_0x13d9ea?_0x13d9ea:![]);})[_0x20a1('0x14')](function(_0x24593c){_0x184a3d(_0x24593c);});};AGIVertices[_0x20a1('0xd')]['sendMailMessage']=function(_0x1e6b14,_0x50194b,_0x5d2d7c){this[_0x20a1('0xc')][_0x20a1('0x21')](_0x1e6b14,_0x50194b)[_0x20a1('0x10')](function(){_0x5d2d7c(null);})[_0x20a1('0x14')](function(_0x4d1cc4){_0x5d2d7c(_0x4d1cc4);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x22')]=function(_0x308e15,_0x828a75){this['rpc'][_0x20a1('0x23')](_0x308e15)['then'](function(_0x5a7ade){if(_0x5a7ade){if(_0x5a7ade[_0x20a1('0x24')]){_0x828a75(null,[_0x5a7ade[_0x20a1('0x25')]]);}else{_0x828a75(null,_[_0x20a1('0x26')](_0x5a7ade[_0x20a1('0x27')],'interval'));}}else{_0x828a75(null,![]);}})[_0x20a1('0x14')](function(_0x16f100){_0x828a75(_0x16f100);});};AGIVertices['prototype'][_0x20a1('0x1d')]=function(_0x6356d8){return util[_0x20a1('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x6356d8);};AGIVertices['prototype'][_0x20a1('0x29')]=function(_0x15881e,_0x68bd2f,_0x131f61){odbc[_0x20a1('0x2a')](_0x15881e,function(_0x310ec9){if(_0x310ec9){logger[_0x20a1('0x2b')](_0x20a1('0x2c'),_0x310ec9);_0x131f61(_0x310ec9);}else{logger['info'](_0x20a1('0x2d'));odbc[_0x20a1('0x2e')](_0x68bd2f,function(_0x19e48c,_0x2cbdc6){if(_0x19e48c){logger[_0x20a1('0x2f')]('Error\x20executing\x20query\x20%s',_0x68bd2f);_0x131f61(_0x19e48c);}else{logger[_0x20a1('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x68bd2f);odbc[_0x20a1('0x30')](function(_0x21f8b7){if(_0x21f8b7){logger['error'](_0x20a1('0x31'),_0x21f8b7);}_0x131f61(null,_0x2cbdc6);});}});}});};AGIVertices['prototype'][_0x20a1('0x32')]=function(_0x5cf529,_0x5ea3dd){this[_0x20a1('0xb')][_0x20a1('0x33')](_0x5cf529)[_0x20a1('0x10')](function(_0x1cc297){_0x5ea3dd(null,_0x1cc297?_0x1cc297:![]);})['catch'](function(_0x404e9d){_0x5ea3dd(_0x404e9d);});};AGIVertices[_0x20a1('0xd')]['createSmsMessage']=function(_0x298462,_0x46a1e4){this[_0x20a1('0xb')][_0x20a1('0x34')](_0x298462)[_0x20a1('0x10')](function(_0x51f8f2){_0x46a1e4(null,_0x51f8f2);})[_0x20a1('0x14')](function(_0x266ae1){_0x46a1e4(_0x266ae1);});};AGIVertices[_0x20a1('0xd')]['createSquareDetailsReport']=function(_0x8fac61,_0x40b931,_0x542445){this[_0x20a1('0xb')]['createSquareDetailsReport']({'uniqueid':this['channel']['uniqueid'],'node':_0x8fac61['label'],'application':_0x8fac61[_0x20a1('0x35')],'data':_0x40b931||null,'project_name':this[_0x20a1('0xa')]['arg_1'],'callerid':this['channel']['callerid']})[_0x20a1('0x10')](function(_0x2ceab6){if(_0x542445){_0x542445(null,_0x2ceab6);}})[_0x20a1('0x14')](function(_0x53c230){if(_0x542445){_0x542445(_0x53c230);}});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x36')]=function(_0x40d66d,_0x19a153,_0x22e7b1,_0x5caadc){this['rpc']['createSquareRecording']({'uniqueid':this[_0x20a1('0xa')][_0x20a1('0x37')],'callerid':this['channel'][_0x20a1('0x38')],'calleridname':this[_0x20a1('0xa')][_0x20a1('0x39')],'context':this['channel'][_0x20a1('0x3a')],'extension':this['channel'][_0x20a1('0x3b')],'priority':this[_0x20a1('0xa')]['priority'],'accountcode':this[_0x20a1('0xa')][_0x20a1('0x3c')],'dnid':this['channel'][_0x20a1('0x3d')],'projectName':this[_0x20a1('0xa')]['arg_1'],'saveName':_0x19a153,'filename':_0x40d66d[_0x20a1('0x3e')]||_0x19a153,'savePath':_0x22e7b1})[_0x20a1('0x10')](function(_0xa74b57){_0x5caadc(null,_0xa74b57);})['catch'](function(_0xccf70){_0x5caadc(_0xccf70);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x3f')]=function(_0x543408,_0x1d605c,_0x53de98,_0x467ff8,_0x3a6ed9){this[_0x20a1('0xb')][_0x20a1('0x3f')]({'uniqueid':this[_0x20a1('0xa')][_0x20a1('0x37')],'body':_0x543408,'direction':_0x1d605c,'providerName':_0x53de98,'providerResponse':_0x467ff8})[_0x20a1('0x10')](function(_0x4d3b33){if(_0x3a6ed9){_0x3a6ed9(null,_0x4d3b33);}})[_0x20a1('0x14')](function(_0x2a4eb3){if(_0x3a6ed9){_0x3a6ed9(_0x2a4eb3);}});};AGIVertices['prototype'][_0x20a1('0x40')]=function(_0x4abddc,_0x455ccd){this[_0x20a1('0xb')]['createCmContact']({'firstName':_[_0x20a1('0x41')](_0x4abddc[_0x20a1('0x11')])||_[_0x20a1('0x42')](_0x4abddc[_0x20a1('0x11')])?_0x20a1('0x43')+Math[_0x20a1('0x44')]():_0x4abddc[_0x20a1('0x11')],'lastName':_[_0x20a1('0x41')](_0x4abddc[_0x20a1('0x45')])||_['isNil'](_0x4abddc[_0x20a1('0x45')])?null:_0x4abddc[_0x20a1('0x45')],'phone':_0x4abddc[_0x20a1('0x46')],'ListId':_0x4abddc[_0x20a1('0x47')],'scheduledat':_0x4abddc['scheduledAt'],'callbackUniqueid':this[_0x20a1('0xa')][_0x20a1('0x37')],'tags':'callback','description':_0x20a1('0x48')+_0x4abddc['scheduledAt'][_0x20a1('0x49')](),'priority':_0x4abddc[_0x20a1('0x4a')]})[_0x20a1('0x10')](function(_0x2cfd78){_0x455ccd(null,_0x2cfd78);})[_0x20a1('0x14')](function(_0xf0a0c5){_0x455ccd(_0xf0a0c5);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x4b')]=function(_0x39192f,_0x39db13){this[_0x20a1('0xb')]['getPauseById'](_0x39192f)[_0x20a1('0x10')](function(_0x4a12ac){_0x39db13(null,_0x4a12ac?_0x4a12ac[_0x20a1('0x11')]:![]);})['catch'](function(_0xa40071){_0x39db13(_0xa40071);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x4c')]=function(_0x45f6da,_0x2fb198,_0x442410){var _0x2ec8e9={'role':'agent'};_0x2ec8e9[_0x45f6da]=this[_0x20a1('0xa')][_0x20a1('0x38')];this['rpc'][_0x20a1('0x4c')](_0x2ec8e9,_0x2fb198,this[_0x20a1('0xa')][_0x20a1('0x37')])[_0x20a1('0x10')](function(_0x38efae){_0x442410(null,_[_0x20a1('0x42')](_0x38efae)?![]:!![]);})[_0x20a1('0x14')](function(_0x421022){logger[_0x20a1('0x2b')](_0x421022);_0x442410(null,![]);});};AGIVertices['prototype'][_0x20a1('0x4d')]=function(_0x50307c,_0x20dbb9){var _0x227621={'role':_0x20a1('0x4e')};_0x227621[_0x50307c]=this[_0x20a1('0xa')]['callerid'];this[_0x20a1('0xb')][_0x20a1('0x4d')](_0x227621)[_0x20a1('0x10')](function(_0x1aa0fa){_0x20dbb9(null,_[_0x20a1('0x42')](_0x1aa0fa)?![]:!![]);})[_0x20a1('0x14')](function(_0x38e44a){logger[_0x20a1('0x2b')](_0x38e44a);_0x20dbb9(null,![]);});};AGIVertices[_0x20a1('0xd')]['agentLogout']=function(_0xe1669e,_0x2927d6){var _0x1b95d3={'role':_0x20a1('0x4e')};_0x1b95d3[_0xe1669e]=this['channel']['callerid'];this[_0x20a1('0xb')][_0x20a1('0x4f')](_0x1b95d3)['then'](function(_0x44123d){_0x2927d6(null,_[_0x20a1('0x42')](_0x44123d)?![]:!![]);})[_0x20a1('0x14')](function(_0x19650e){logger[_0x20a1('0x2b')](_0x19650e);_0x2927d6(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x221b0a,_0x3de7fb){var _0x46c865={'role':'agent'};_0x46c865[_0x221b0a]=this[_0x20a1('0xa')][_0x20a1('0x38')];var _0x1e8abe=_0x221b0a!=_0x20a1('0x50')?util[_0x20a1('0x28')]('%s/%s@from-sip/n',_0x20a1('0x51'),this['channel']['callerid']):undefined;this[_0x20a1('0xb')][_0x20a1('0x52')](_0x46c865,_0x1e8abe)['then'](function(_0x40917f){_0x3de7fb(null,_[_0x20a1('0x42')](_0x40917f)?![]:!![]);})[_0x20a1('0x14')](function(_0x49c69d){logger['error'](_0x49c69d);_0x3de7fb(null,![]);});};AGIVertices[_0x20a1('0xd')]['shellCommand']=function(_0x4373fc,_0x775bb){sh[_0x20a1('0x53')](_[_0x20a1('0x54')](_0x4373fc),function(_0x2e19aa,_0x5f1650){var _0x328f0a=_0x5f1650['replace'](/(\r\n|\n|\r)/gm,'');_0x775bb(null,_0x328f0a);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x55')]=function(_0x4808d9,_0x473041){scripts[_0x20a1('0x55')](_0x4808d9['apiKey'],_0x4808d9[_0x20a1('0x56')]||_0x20a1('0x57'),_0x4808d9[_0x20a1('0x57')],_0x4808d9['languageCode']||_0x20a1('0x58'),_0x4808d9[_0x20a1('0x59')]||'MALE',_0x4808d9[_0x20a1('0x5a')]||_0x20a1('0x5b'))[_0x20a1('0x10')](function(_0x540df2){_0x473041(null,_0x540df2);})[_0x20a1('0x14')](function(_0x4fa573){_0x473041(_0x4fa573);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x5c')]=function(_0xc94ff1,_0x2df7d7){scripts[_0x20a1('0x5c')](_0xc94ff1[_0x20a1('0x57')],_0xc94ff1[_0x20a1('0x5d')]||'en',0x1)[_0x20a1('0x10')](function(_0x496994){_0x2df7d7(null,_0x496994);})[_0x20a1('0x14')](function(_0x470136){_0x2df7d7(_0x470136);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x5e')]=function(_0x2a43d3,_0x15afc3){var _0xacc3b3={'uri':_0x2a43d3[_0x20a1('0x5f')],'method':_0x2a43d3[_0x20a1('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2a43d3['timeout'])===_0x20a1('0x61')&&parseInt(_0x2a43d3[_0x20a1('0x62')])>=0x1?parseInt(_0x2a43d3['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x20a1('0x63')]([_0x20a1('0x64'),'PUT'],_0xacc3b3[_0x20a1('0x60')]['toUpperCase']())){try{_0xacc3b3[_0x20a1('0x65')]=_0x2a43d3[_0x20a1('0x66')]?JSON[_0x20a1('0x67')](_0x2a43d3[_0x20a1('0x66')]):{};}catch(_0x40b54f){logger[_0x20a1('0x2b')](_0x20a1('0x68'),_0x40b54f);}}try{_0xacc3b3[_0x20a1('0x69')]=_0x2a43d3[_0x20a1('0x8')]?JSON[_0x20a1('0x67')](_0x2a43d3[_0x20a1('0x8')]):{};}catch(_0x70b2ce){logger[_0x20a1('0x2b')](_0x20a1('0x6a'),_0x70b2ce);}if(_0x2a43d3[_0x20a1('0x6b')]){try{var _0x21774b=require(_0x2a43d3[_0x20a1('0x6b')])[_0x20a1('0x6c')](this,_0xacc3b3);_0xacc3b3['uri']=Mustache['render'](_0x2a43d3[_0x20a1('0x5f')],_0x21774b,{},['$$','$$']);if(_0xacc3b3[_0x20a1('0x69')]){_0xacc3b3['headers']=JSON[_0x20a1('0x67')](Mustache['render'](JSON[_0x20a1('0x6d')](_0xacc3b3[_0x20a1('0x69')]),_0x21774b,{},['$$','$$']));}if(_0xacc3b3[_0x20a1('0x65')]){_0xacc3b3['body']=JSON['parse'](Mustache[_0x20a1('0x6e')](JSON[_0x20a1('0x6d')](_0xacc3b3[_0x20a1('0x65')]),_0x21774b,{},['$$','$$']));}}catch(_0x3f4f79){logger[_0x20a1('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3f4f79);}}rp(_0xacc3b3)['then'](function(_0x36c44a){var _0x37707c={'statusCode':_0x36c44a[_0x20a1('0x6f')]||0xc8,'statusMessage':_0x36c44a[_0x20a1('0x70')]||'OK','headers':_0x36c44a[_0x20a1('0x69')]||{},'body':_0x36c44a[_0x20a1('0x65')]||{}};_0x15afc3(null,_0x37707c);})[_0x20a1('0x14')](function(_0x307aeb){var _0x396bba={'statusCode':_0x307aeb['statusCode']||0x1f4,'statusMessage':_0x307aeb['message']||_0x20a1('0x71'),'headers':_0x307aeb[_0x20a1('0x72')]['headers']||{},'body':_0x307aeb[_0x20a1('0x72')][_0x20a1('0x65')]||{}};_0x15afc3(null,_0x396bba);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x73')]=function(_0x47004e,_0x54e219){scripts[_0x20a1('0x73')](this[_0x20a1('0xa')][_0x20a1('0x37')],_0x47004e[_0x20a1('0x74')],_0x47004e['text'],_0x47004e[_0x20a1('0x75')]||'en')[_0x20a1('0x10')](function(_0x3a3841){_0x54e219(null,_0x3a3841);})[_0x20a1('0x14')](function(_0x3e72ae){_0x54e219(_0x3e72ae);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x76')]=function(_0x18d82a,_0x18d385){scripts[_0x20a1('0x76')](this[_0x20a1('0xa')][_0x20a1('0x37')],_0x18d82a['dialogflowV2_project_id'],_0x18d82a['client_email'],_0x18d82a[_0x20a1('0x77')],_0x18d82a['text'],_0x18d82a[_0x20a1('0x78')]||'en')['then'](function(_0x4c1616){_0x18d385(null,_0x4c1616);})[_0x20a1('0x14')](function(_0x594921){_0x18d385(_0x594921);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x79')]=function(_0x376ab6,_0x19b55b){scripts[_0x20a1('0x79')](this['channel'],_0x376ab6)[_0x20a1('0x10')](function(_0x14f01f){_0x19b55b(null,_0x14f01f);})[_0x20a1('0x14')](function(_0x31d32d){_0x19b55b(_0x31d32d);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x7a')]=function(_0x513c43,_0x243e36){scripts[_0x20a1('0x7a')](_0x513c43['key'],_0x513c43[_0x20a1('0x57')],_0x513c43['ispeech_tts_language']||_0x20a1('0x58'),_0x513c43[_0x20a1('0x7b')])['then'](function(_0x5e9942){_0x243e36(null,_0x5e9942);})[_0x20a1('0x14')](function(_0x21bd2f){_0x243e36(_0x21bd2f);});};AGIVertices['prototype'][_0x20a1('0x7c')]=function(_0x6a3f88,_0x1b0a58,_0x4039f7){scripts[_0x20a1('0x7c')](_0x1b0a58,_0x6a3f88[_0x20a1('0x74')],_0x6a3f88['ispeech_asr_language']||'en-US',this[_0x20a1('0x7d')](_0x6a3f88[_0x20a1('0x7e')])?_0x6a3f88[_0x20a1('0x7e')]:undefined)['then'](function(_0x475178){_0x4039f7(null,_0x475178);})['catch'](function(_0x3d922d){_0x4039f7(_0x3d922d);});};AGIVertices['prototype'][_0x20a1('0x7f')]=function(_0x237f1a,_0x4c402a){scripts[_0x20a1('0x7f')](_0x237f1a['aws_access_key_id'],_0x237f1a[_0x20a1('0x80')],_0x237f1a['aws_polly_region'],_0x237f1a[_0x20a1('0x81')]||_0x20a1('0x82'),_0x237f1a['text'],_0x237f1a[_0x20a1('0x83')]||'text')[_0x20a1('0x10')](function(_0x49576b){_0x4c402a(null,_0x49576b);})[_0x20a1('0x14')](function(_0x44da55){_0x4c402a(_0x44da55);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x84')]=function(_0x2f4ff6,_0x214ef3){scripts['awsLex'](this['channel'][_0x20a1('0x37')],_0x2f4ff6[_0x20a1('0x85')],_0x2f4ff6[_0x20a1('0x80')],_0x2f4ff6[_0x20a1('0x86')],_0x2f4ff6[_0x20a1('0x57')],_0x2f4ff6[_0x20a1('0x87')])[_0x20a1('0x10')](function(_0x3a6d46){_0x214ef3(null,_0x3a6d46);})[_0x20a1('0x14')](function(_0x3b89bc){_0x214ef3(_0x3b89bc);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x88')]=function(_0xc7f16a,_0x2cc3c8,_0x36af4f){scripts['googleASR'](_0x2cc3c8,_0xc7f16a['key'],_0xc7f16a['google_asr_language']||'en-US')['then'](function(_0x111005){_0x36af4f(null,_0x111005);})[_0x20a1('0x14')](function(_0x108edc){_0x36af4f(_0x108edc);});};AGIVertices[_0x20a1('0xd')]['tildeASR']=function(_0xc32da1,_0xc30638,_0x2f0a57){scripts[_0x20a1('0x89')](_0xc30638,_0xc32da1[_0x20a1('0x8a')],_0xc32da1[_0x20a1('0x8b')],_0xc32da1[_0x20a1('0x8c')])[_0x20a1('0x10')](function(_0x56bb6e){_0x2f0a57(null,_0x56bb6e);})[_0x20a1('0x14')](function(_0x7950a9){_0x2f0a57(_0x7950a9);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x8d')]=function(_0xcea91c){var _0x171078=_[_0x20a1('0x63')](verticesWithRetry,_0xcea91c[_0x20a1('0x35')])?_0xcea91c:_[_0x20a1('0x8e')](_0xcea91c);for(var _0x3981f in _0x171078){if(_0x171078['hasOwnProperty'](_0x3981f)){if(_0x171078[_0x3981f]&&_[_0x20a1('0x8f')](_0x171078[_0x3981f])){if(_[_0x20a1('0x63')](recursiveMapAttributes,_0x3981f)){_0x171078[_0x3981f]=this[_0x20a1('0x90')](_0x171078[_0x3981f]);}else{_0x171078[_0x3981f]=this[_0x20a1('0x91')](_0x171078[_0x3981f]);}}}}return _0x171078;};AGIVertices['prototype'][_0x20a1('0x92')]=function(_0xd186a2){for(var _0x54e0c5 in _0xd186a2){if(_0xd186a2[_0x20a1('0x93')](_0x54e0c5)){if(_[_0x20a1('0x94')](_0xd186a2[_0x54e0c5])){this[_0x20a1('0x92')](_0xd186a2[_0x54e0c5]);}else if(_['isArray'](_0xd186a2[_0x54e0c5])){for(var _0x220d68=0x0;_0x220d68<_0xd186a2[_0x54e0c5]['length'];_0x220d68++){this[_0x20a1('0x92')](_0xd186a2[_0x54e0c5][_0x220d68]);}}else if(_[_0x20a1('0x8f')](_0xd186a2[_0x54e0c5])){_0xd186a2[_0x54e0c5]=this[_0x20a1('0x91')](_0xd186a2[_0x54e0c5]);}}}};AGIVertices[_0x20a1('0xd')]['saveRestApiResult']=function(_0x282ad3,_0x25001c){for(var _0xac1680 in _0x282ad3){if(_0x282ad3['hasOwnProperty'](_0xac1680)){if(_[_0x20a1('0x94')](_0x282ad3[_0xac1680])){if(!_['isEmpty'](_0x282ad3[_0xac1680])){this[_0x20a1('0x95')](_0x282ad3[_0xac1680],util[_0x20a1('0x28')](_0x20a1('0x96'),_0x25001c,_0xac1680));}}else if(_[_0x20a1('0x97')](_0x282ad3[_0xac1680])){for(var _0x4d2a9e=0x0;_0x4d2a9e<_0x282ad3[_0xac1680][_0x20a1('0x98')];_0x4d2a9e++){this[_0x20a1('0x95')](_0x282ad3[_0xac1680][_0x4d2a9e],util[_0x20a1('0x28')]('%s.%s',_0x25001c,_0xac1680+'['+_0x4d2a9e+']'));}}else{if(!_['isNil'](_0x282ad3[_0xac1680])){this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0x96'),_0x25001c,_0xac1680),_0x282ad3[_0xac1680]);}}}}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x90')]=function(_0x429837){try{var _0x3dff34=JSON[_0x20a1('0x67')](_0x429837);this[_0x20a1('0x92')](_0x3dff34);return JSON[_0x20a1('0x6d')](_0x3dff34);}catch(_0x3a0d7e){return this[_0x20a1('0x91')](_0x429837);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x1ff366){var _0x2f92c8=_0x1ff366['split']('{');for(var _0x5e1c66=0x1;_0x5e1c66<_0x2f92c8['length'];_0x5e1c66+=0x1){var _0x300cf6=_0x2f92c8[_0x5e1c66]['split']('}');if(_0x300cf6[_0x20a1('0x98')]>0x1){_0x1ff366=_0x1ff366[_0x20a1('0x9a')]('{'+_0x300cf6[0x0]+'}',this[_0x20a1('0xa')][_0x20a1('0xe')](_0x300cf6[0x0])[_0x20a1('0x9b')]||_0x300cf6[0x0]);}}if(_0x2f92c8[_0x20a1('0x98')]===0x1){return _0x1ff366[_0x20a1('0x49')]();}return this[_0x20a1('0x91')](_0x1ff366);};AGIVertices[_0x20a1('0xd')]['getAndSetVariable']=function(_0x162ae6,_0x35ef43){var _0x4fe6a9=this[_0x20a1('0xa')][_0x20a1('0xe')](_0x162ae6);if(_0x4fe6a9[_0x20a1('0x9c')]===-0x1){return _0x4fe6a9;}logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x9d'),_0x35ef43,_0x4fe6a9[_0x20a1('0x9b')]));return this[_0x20a1('0xa')][_0x20a1('0x99')](_0x35ef43,_0x4fe6a9[_0x20a1('0x9b')]);};AGIVertices['prototype'][_0x20a1('0x7d')]=function(_0x3bf7d3){return _0x3bf7d3&&_0x3bf7d3!=='0'&&_0x3bf7d3!=='-1'&&_0x3bf7d3!=='';};AGIVertices[_0x20a1('0xd')][_0x20a1('0x9e')]=function(_0x5671c8){this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0x5671c8,'-');_0x5671c8[_0x20a1('0x9f')]=_0x5671c8[_0x20a1('0x9e')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x20a1('0xd')][_0x20a1('0xa0')]=function(_0x48f0b9){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xa1'),_0x48f0b9[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x48f0b9[_0x20a1('0x57')])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0xa3'));}var _0x257502='\x22'+_0x48f0b9[_0x20a1('0x57')]+'\x22';if(this[_0x20a1('0x7d')](_0x48f0b9[_0x20a1('0x72')])){_0x257502+=','+_0x48f0b9['options'];}var _0x14267c=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xa4'),_0x257502);if(_0x14267c[_0x20a1('0x9c')]===-0x1){return _0x14267c;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xa6'),_0x257502));};AGIVertices[_0x20a1('0xd')]['mrcprecog']=function(_0x709bbf){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xa7'),_0x709bbf['label']));if(!this['isConfigured'](_0x709bbf[_0x20a1('0xa8')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa9'));}var _0x2fbdbc=_0x709bbf[_0x20a1('0xa8')];if(this[_0x20a1('0x7d')](_0x709bbf[_0x20a1('0x72')])){_0x2fbdbc+=','+_0x709bbf[_0x20a1('0x72')];}var _0x511671=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xaa'),_0x2fbdbc);if(_0x511671[_0x20a1('0x9c')]===-0x1){return _0x511671;}var _0x906492=this['getAndSetVariable'](_0x20a1('0xab'),_0x20a1('0xac'));if(_0x906492[_0x20a1('0x9c')]===-0x1){return _0x906492;}var _0x221c4e=this[_0x20a1('0xad')]('RECOG_INPUT()',_0x20a1('0xae'));if(_0x221c4e[_0x20a1('0x9c')]===-0x1){return _0x221c4e;}var _0x3777fc=this[_0x20a1('0xad')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x3777fc['result']===-0x1){return _0x3777fc;}return this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0xaf'),_0x2fbdbc));};AGIVertices['prototype']['agi']=function(_0x17fd13){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xb0'),_0x17fd13[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x4')]([_0x17fd13[_0x20a1('0xb1')],_0x17fd13[_0x20a1('0xb2')]]);};AGIVertices[_0x20a1('0xd')][_0x20a1('0xb3')]=function(_0x2aa248){logger['info'](util[_0x20a1('0x28')](_0x20a1('0xb4'),_0x2aa248['label']));if(this[_0x20a1('0x7d')](_0x2aa248['timeout'])){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xb5'),_0x2aa248[_0x20a1('0x62')]));var _0x1c62d3=this['channel'][_0x20a1('0xb6')](_0x2aa248['timeout']);if(_0x1c62d3[_0x20a1('0x9c')]===-0x1){return _0x1c62d3;}}return this['channel'][_0x20a1('0xb3')]();};AGIVertices[_0x20a1('0xd')][_0x20a1('0xb7')]=function(_0x39baf5){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xb8'),_0x39baf5[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x39baf5[_0x20a1('0x47')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x39baf5,_0x20a1('0xb9'));}_0x39baf5['scheduledAt']=moment();if(this[_0x20a1('0x7d')](_0x39baf5[_0x20a1('0xba')])){_0x39baf5[_0x20a1('0xbb')]=moment()[_0x20a1('0xbc')](_0x39baf5[_0x20a1('0xba')],'minutes');}if(!this[_0x20a1('0x7d')](_0x39baf5['callback_priority'])){_0x39baf5[_0x20a1('0x4a')]=0x2;}this[_0x20a1('0x40')][_0x20a1('0x6c')](this,_0x39baf5);return this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xbd'),_0x39baf5[_0x20a1('0x46')],_0x39baf5[_0x20a1('0x47')],_0x39baf5[_0x20a1('0xbb')]));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xbe')]=function(_0x4321e4){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4321e4[_0x20a1('0xa2')]));var _0x249f2e=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x4321e4['application'],_0x4321e4[_0x20a1('0x72')]);if(_0x249f2e[_0x20a1('0x9c')]===-0x1){return _0x249f2e;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0xbf'),_0x4321e4[_0x20a1('0xc0')],_0x4321e4[_0x20a1('0x72')]));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xc1')]=function(_0x23a3e2){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0xc2'),_0x23a3e2[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x23a3e2[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}var _0x31d551='\x22'+_0x23a3e2[_0x20a1('0x57')]+'\x22';if(this[_0x20a1('0x7d')](_0x23a3e2['options'])){_0x31d551+=','+_0x23a3e2[_0x20a1('0x72')];}var _0x1bd05a=this[_0x20a1('0xa')]['exec'](_0x20a1('0xa4'),_0x31d551);if(_0x1bd05a[_0x20a1('0x9c')]===-0x1){return _0x1bd05a;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xa6'),_0x31d551));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xc3')]=function(_0x4e9148){logger['info'](util[_0x20a1('0x28')](_0x20a1('0xc4'),_0x4e9148[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x4e9148[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}var _0x437694='\x22'+_0x4e9148[_0x20a1('0x57')]+'\x22';if(this['isConfigured'](_0x4e9148['options'])){_0x437694+=','+_0x4e9148[_0x20a1('0x72')];}var _0xcdbf00=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xa4'),_0x437694);if(_0xcdbf00[_0x20a1('0x9c')]===-0x1){return _0xcdbf00;}return this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0xa6'),_0x437694));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xc5')]=function(_0x46a5e8){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x46a5e8['label']));if(!this[_0x20a1('0x7d')](_0x46a5e8[_0x20a1('0xa8')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa9'));}var _0x44592c=_0x46a5e8[_0x20a1('0xa8')];if(this[_0x20a1('0x7d')](_0x46a5e8['options'])){_0x44592c+=','+_0x46a5e8[_0x20a1('0x72')];}var _0x7a4e8=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xaa'),_0x44592c);if(_0x7a4e8[_0x20a1('0x9c')]===-0x1){return _0x7a4e8;}var _0xa5e919=this[_0x20a1('0xad')](_0x20a1('0xab'),_0x20a1('0xc6'));if(_0xa5e919['result']===-0x1){return _0xa5e919;}var _0x12070f=this[_0x20a1('0xad')](_0x20a1('0xc7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x12070f[_0x20a1('0x9c')]===-0x1){return _0x12070f;}var _0x5a9cce=this[_0x20a1('0xad')](_0x20a1('0xc8'),'LUMENVOX_ASR_INSTANCE');if(_0x5a9cce[_0x20a1('0x9c')]===-0x1){return _0x5a9cce;}return this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0xaf'),_0x44592c));};AGIVertices['prototype'][_0x20a1('0xc9')]=function(_0x3cd788){logger['info'](util[_0x20a1('0x28')](_0x20a1('0xca'),_0x3cd788[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x3cd788[_0x20a1('0xa8')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa9'));}var _0x4c3ba8=_0x3cd788[_0x20a1('0xa8')];if(this['isConfigured'](_0x3cd788['options'])){_0x4c3ba8+=','+_0x3cd788['options'];}var _0x3ac2ed=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xaa'),_0x4c3ba8);if(_0x3ac2ed[_0x20a1('0x9c')]===-0x1){return _0x3ac2ed;}var _0x278dc9=this['getAndSetVariable']('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x278dc9[_0x20a1('0x9c')]===-0x1){return _0x278dc9;}var _0x109189=this[_0x20a1('0xad')](_0x20a1('0xc7'),_0x20a1('0xcb'));if(_0x109189['result']===-0x1){return _0x109189;}var _0x11679f=this[_0x20a1('0xad')](_0x20a1('0xc8'),_0x20a1('0xcc'));if(_0x11679f[_0x20a1('0x9c')]===-0x1){return _0x11679f;}return this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0xaf'),_0x4c3ba8));};AGIVertices['prototype'][_0x20a1('0xcd')]=function(_0x38fc88){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0xce'),_0x38fc88[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x38fc88[_0x20a1('0xcf')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x38fc88,'no\x20database\x20selected');}var _0xcbdbea=this[_0x20a1('0x16')][_0x20a1('0x6c')](this,_0x38fc88['odbc_id']);if(!_0xcbdbea){return this['channel'][_0x20a1('0x2b')](_0x38fc88,_0x20a1('0xd0'));}if(!this['isConfigured'](_0x38fc88[_0x20a1('0x2e')])){return this['channel']['error'](_0x38fc88,_0x20a1('0xd1'));}var _0x1897bc=_0x38fc88['query'][_0x20a1('0xd2')](/(\r\n|\n|\r)/gm,'\x20');this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xd3'),_0x1897bc));var _0x4d674e=this['getQueryOdbc']['sync'](this,_0xcbdbea,_0x1897bc);this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x38fc88,_0x1897bc);if(!this[_0x20a1('0x7d')](_0x38fc88[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xd6'));}var _0x4e6f05=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x38fc88['variable_id']);if(!_0x4e6f05){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x38fc88,_0x20a1('0xd7'));}var _0x4f3fc4=this;_0x4d674e['forEach'](function(_0x1617bc,_0x3ede4d){Object[_0x20a1('0xd8')](_0x1617bc)['forEach'](function(_0x55791f){_0x4f3fc4[_0x20a1('0xa')]['setVariable'](util[_0x20a1('0x28')]('%s[%s][%s]',_0x4e6f05,_0x3ede4d,_0x55791f),_0x1617bc[_0x55791f]);});});this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0xd9'),_0x4e6f05),_0x4d674e[_0x20a1('0x98')]);return this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0xda'),_0x4e6f05));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xdb')]=function(_0x584efc){logger[_0x20a1('0xdc')](util[_0x20a1('0x28')](_0x20a1('0xdd'),_0x584efc[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x584efc['sip_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x584efc,'no\x20user\x20selected');}var _0x484b26=this[_0x20a1('0xde')][_0x20a1('0x6c')](this,_0x584efc[_0x20a1('0xdf')]);if(!_0x484b26){return this[_0x20a1('0xa')]['error'](_0x584efc,'no\x20user\x20found');}var _0x187ba8=this['channel'][_0x20a1('0x53')]('DIAL',[util[_0x20a1('0x28')](_0x20a1('0xe0'),_0x484b26),_0x584efc[_0x20a1('0x62')],_0x584efc[_0x20a1('0xe1')],_0x584efc[_0x20a1('0x5f')]]);if(_0x187ba8['result']===-0x1){return _0x187ba8;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Executed\x20command\x20%s',_0x20a1('0xe2')));};AGIVertices['prototype'][_0x20a1('0xe3')]=function(_0x2ec2c1){logger['info'](util['format'](_0x20a1('0xe4'),_0x2ec2c1[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x2ec2c1[_0x20a1('0x74')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x2ec2c1['text'])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0xa3'));}this['channel'][_0x20a1('0xe5')]=!![];this[_0x20a1('0xd4')](_0x2ec2c1);this['createSquareMessage'](_0x2ec2c1[_0x20a1('0x57')],'in','','');this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xe6'),_0x2ec2c1['text']));var _0x5c6fb6=this[_0x20a1('0x73')][_0x20a1('0x6c')](this,_0x2ec2c1);if(_0x5c6fb6){for(var _0x299ed9 in _0x5c6fb6){if(_0x5c6fb6[_0x20a1('0x93')](_0x299ed9)){this['channel'][_0x20a1('0x99')](util[_0x20a1('0x28')]('DIALOGFLOW_%s',_0x299ed9['toUpperCase']()),_0x5c6fb6[_0x299ed9]);}}this[_0x20a1('0x3f')](_0x5c6fb6[_0x20a1('0xe7')],_0x20a1('0xe8'),_0x20a1('0xe3'),'');return this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')]('Dialogflow\x20Result\x20%s',_0x5c6fb6[_0x20a1('0xe7')]));}return this['channel']['error'](_0x2ec2c1,_0x20a1('0xe9'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xea')]=function(_0x566971){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0xeb'),_0x566971[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x566971[_0x20a1('0xec')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xed'));}if(!this['isConfigured'](_0x566971['client_email'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xee'));}if(!this['isConfigured'](_0x566971[_0x20a1('0x77')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xef'));}if(!this[_0x20a1('0x7d')](_0x566971[_0x20a1('0x78')])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0xf0'));}if(!this[_0x20a1('0x7d')](_0x566971[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}this[_0x20a1('0xa')][_0x20a1('0xe5')]=!![];this[_0x20a1('0xd4')](_0x566971);this[_0x20a1('0x3f')](_0x566971['text'],'in','','');this['channel'][_0x20a1('0xa5')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x566971[_0x20a1('0x57')]));var _0x308327=this[_0x20a1('0x76')]['sync'](this,_0x566971);if(_0x308327){for(var _0x43de4d in _0x308327){if(_0x308327[_0x20a1('0x93')](_0x43de4d)){if(_0x43de4d!==_0x20a1('0xf1')){this[_0x20a1('0xa')]['setVariable'](util[_0x20a1('0x28')](_0x20a1('0xf2'),_0x43de4d[_0x20a1('0xf3')]()),_0x308327[_0x43de4d]);}}}this[_0x20a1('0x3f')](_0x308327[_0x20a1('0xe7')],'out',_0x20a1('0xea'),_0x308327['providerResponse']);return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0xf4'),_0x308327['speech']));}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x566971,_0x20a1('0xf5'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xf6')]=function(_0x279245){logger[_0x20a1('0x2f')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x279245[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x279245[_0x20a1('0xf7')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xf8'));}if(!this[_0x20a1('0x7d')](_0x279245[_0x20a1('0xf9')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xfa'));}if(!this['isConfigured'](_0x279245['password'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xfb'));}if(!this[_0x20a1('0x7d')](_0x279245['ndassistant_url'])){return this['channel'][_0x20a1('0xa5')]('no\x20text\x20configured');}this[_0x20a1('0xa')]['bot']=!![];this[_0x20a1('0xd4')](_0x279245);this[_0x20a1('0x3f')](_0x279245[_0x20a1('0x57')],'in','','');this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Trying\x20SestekNDA:\x20%s',_0x279245[_0x20a1('0x57')]));var _0x4a8a89=this[_0x20a1('0x79')][_0x20a1('0x6c')](this,_0x279245);if(_0x4a8a89){for(var _0x43a192 in _0x4a8a89){if(_0x4a8a89[_0x20a1('0x93')](_0x43a192)){this[_0x20a1('0xa')]['setVariable'](util[_0x20a1('0x28')](_0x20a1('0xfc'),_0x43a192[_0x20a1('0xf3')]()),_0x4a8a89[_0x43a192]);}}this['createSquareMessage'](_0x4a8a89['speech'],_0x20a1('0xe8'),'sesteknda','');if(_0x4a8a89[_0x20a1('0xfd')]){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4a8a89['audiofile']));var _0xc9200f=this['channel'][_0x20a1('0xfe')](_0x4a8a89[_0x20a1('0xfd')]);try{fs[_0x20a1('0xff')](_0x4a8a89[_0x20a1('0xfd')]+'.wav');}catch(_0xc441fd){logger['error'](_0xc441fd);}return _0xc9200f;}else{return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x100'),_0x4a8a89['speech']));}}return this[_0x20a1('0xa')]['error'](_0x279245,_0x20a1('0x101'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x102')]=function(_0x166856){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x103'),_0x166856[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0xa5')]('end');};AGIVertices[_0x20a1('0xd')]['ext_dial']=function(_0x4bc6c5){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x104'),_0x4bc6c5[_0x20a1('0xa2')]));var _0x25aa07='';if(_0x4bc6c5[_0x20a1('0x105')]){if(!this[_0x20a1('0x7d')](_0x4bc6c5['trunk_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4bc6c5,_0x20a1('0x106'));}else{var _0xabc86c=parseInt(_0x4bc6c5[_0x20a1('0x105')],0xa);if(isNaN(_0xabc86c)){_0x25aa07=_0x4bc6c5['trunk_id'];}else{_0x25aa07=this['getTrunk'][_0x20a1('0x6c')](this,_0x4bc6c5[_0x20a1('0x105')]);if(!_0x25aa07){return this[_0x20a1('0xa')]['error'](_0x4bc6c5,'no\x20trunk\x20found');}}}}else if(_0x4bc6c5[_0x20a1('0x107')]){_0x25aa07=_0x4bc6c5[_0x20a1('0x107')];}else{return this['channel'][_0x20a1('0x2b')](_0x4bc6c5,_0x20a1('0x106'));}var _0x4d302d=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xe2'),[util[_0x20a1('0x28')](_0x20a1('0x108'),_0x25aa07,_0x4bc6c5[_0x20a1('0x46')]),_0x4bc6c5[_0x20a1('0x62')],_0x4bc6c5[_0x20a1('0xe1')],_0x4bc6c5[_0x20a1('0x5f')]]);if(_0x4d302d[_0x20a1('0x9c')]===-0x1){return _0x4d302d;}return this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0x109'),_0x20a1('0xe2')));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x10a')]=function(_0x50ddc2){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x10b'),_0x50ddc2[_0x20a1('0xa2')]));return this[_0x20a1('0xa')]['noop'](_0x20a1('0x10a'));};AGIVertices['prototype'][_0x20a1('0x9')]=function(_0xc370){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x10c'),_0xc370[_0x20a1('0xa2')]));if(_0xc370[_0x20a1('0x9f')]===0x0){return this['maxRetry'](_0xc370);}_0xc370['retry']-=0x1;if(!this['isConfigured'](_0xc370[_0x20a1('0x10d')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0xc370,'no\x20file\x20audio\x20selected');}var _0x46d828=this[_0x20a1('0x1c')][_0x20a1('0x6c')](this,_0xc370[_0x20a1('0x10d')]);if(!_0x46d828){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0xc370,_0x20a1('0x10e'));}if(!this[_0x20a1('0x7d')](_0xc370[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3c649d=this[_0x20a1('0xa')][_0x20a1('0x10f')](_0x46d828,_0xc370[_0x20a1('0x110')],_0xc370[_0x20a1('0x111')]);var _0x57bd1a=_0x3c649d[_0x20a1('0x9c')]?_0x3c649d['result'][_0x20a1('0x49')]():'';logger[_0x20a1('0x2f')](_0x20a1('0x112'),JSON['stringify'](_0x3c649d));if(_0x3c649d[_0x20a1('0x9c')]===-0x1){this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0xc370,_0x57bd1a);return _0x3c649d;}else if(_0x3c649d[_0x20a1('0x9b')]===_0x20a1('0x62')){_0x3c649d['result']=_0x57bd1a[_0x20a1('0x98')]>=parseInt(_0xc370[_0x20a1('0x113')])?'x':'i';}else{_0x3c649d['result']=_0x57bd1a[_0x20a1('0x98')]>=parseInt(_0xc370[_0x20a1('0x113')])&&_0x57bd1a[_0x20a1('0x98')]<=parseInt(_0xc370[_0x20a1('0x111')])?'x':'i';}var _0x21a718=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0xc370[_0x20a1('0xd5')]);if(!_0x21a718){return this['channel']['error'](_0xc370,_0x20a1('0xd7'));}this[_0x20a1('0xa')][_0x20a1('0x99')](_0x21a718,_0x57bd1a);if(this[_0x20a1('0x7d')](_0xc370[_0x20a1('0x114')])){var _0x280906=parseInt(_0xc370['hiddendigitsnum'],0xa);var _0x8254c3=rs[_0x20a1('0x115')]({'charset':'*','length':_0x280906});var _0x4a134c=_0x57bd1a[_0x20a1('0x98')];if(_0x4a134c>0x0){if(_0x4a134c>_0x280906){this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0xc370,_0xc370[_0x20a1('0x116')]==='first'?_0x8254c3+_0x57bd1a[_0x20a1('0x117')](_0x280906):_0x57bd1a[_0x20a1('0x117')](0x0,_0x4a134c-_0x280906)+_0x8254c3);}else{this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0xc370,rs[_0x20a1('0x115')]({'charset':'*','length':_0x4a134c}));}}else{this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0xc370,'');}}else{this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0xc370,_0x57bd1a);}return _0x3c649d;};AGIVertices[_0x20a1('0xd')][_0x20a1('0x118')]=function(_0x34be42){logger['info'](util['format'](_0x20a1('0x119'),_0x34be42[_0x20a1('0xa2')]));return this[_0x20a1('0x9')](_0x34be42);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x11a')]=function(_0x391ecd){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x11b'),_0x391ecd[_0x20a1('0xa2')]));this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x391ecd,_0x391ecd[_0x20a1('0x11c')]);return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format']('GOAL\x20%s',_0x391ecd[_0x20a1('0x11c')]));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x11d')]=function(_0x148045){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x11e'),_0x148045[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x148045[_0x20a1('0x85')])||!this[_0x20a1('0x7d')](_0x148045[_0x20a1('0x80')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x11f'));}if(!this[_0x20a1('0x7d')](_0x148045[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x120'),_0x148045[_0x20a1('0x57')]));var _0xfe8b8b=this['awsPolly'][_0x20a1('0x6c')](this,_0x148045);if(_0xfe8b8b){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x121'),_0xfe8b8b));var _0x1a17cf=this[_0x20a1('0xa')]['streamFile'](_0xfe8b8b);try{fs[_0x20a1('0xff')](_0xfe8b8b+_0x20a1('0x122'));}catch(_0x4609f9){logger[_0x20a1('0x2b')](_0x4609f9);}return _0x1a17cf;}return this[_0x20a1('0xa')]['error'](_0x148045,_0x20a1('0x123'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x124')]=function(_0x51f26a){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x125'),_0x51f26a['label']));if(!this[_0x20a1('0x7d')](_0x51f26a['aws_access_key_id'])||!this[_0x20a1('0x7d')](_0x51f26a['aws_secret_access_key'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x11f'));}if(!this[_0x20a1('0x7d')](_0x51f26a[_0x20a1('0x87')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x126'));}if(!this[_0x20a1('0x7d')](_0x51f26a[_0x20a1('0x57')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa3'));}this[_0x20a1('0xa')][_0x20a1('0xe5')]=!![];this[_0x20a1('0xd4')](_0x51f26a);this[_0x20a1('0x3f')](_0x51f26a[_0x20a1('0x57')],'in','','');this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x127'),_0x51f26a[_0x20a1('0x57')]));var _0x130446=this['awsLex'][_0x20a1('0x6c')](this,_0x51f26a);if(_0x130446){for(var _0x40f658 in _0x130446){if(_0x130446['hasOwnProperty'](_0x40f658)&&_['isString'](_0x130446[_0x40f658])){this['channel']['setVariable'](util[_0x20a1('0x28')](_0x20a1('0x128'),_0x40f658['toUpperCase']()),_0x130446[_0x40f658]);}}if(_[_0x20a1('0x42')](_0x130446[_0x20a1('0x129')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x20a1('0x3f')](_0x130446['message'],_0x20a1('0xe8'),'amazonlex','');return this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')](_0x20a1('0x12a'),_0x130446[_0x20a1('0x129')]));}}return this['channel'][_0x20a1('0x2b')](_0x51f26a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x20a1('0xd')][_0x20a1('0x12b')]=function(_0xae2949){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x12c'),_0xae2949[_0x20a1('0xa2')],_0xae2949['timeout']));if(!this[_0x20a1('0x7d')](_0xae2949[_0x20a1('0x74')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x12d'));}var _0x5d88ee=_0x20a1('0x12e');var _0x56303d=util['format'](_0x20a1('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x4b261f=util[_0x20a1('0x28')](_0x20a1('0x96'),_0x56303d,_0x5d88ee);var _0x3c51f4=!![];if(_0xae2949[_0x20a1('0x130')]===_0x20a1('0x131')){_0x3c51f4=![];}var _0x4a65bb=this['channel']['recordFile'](_0x56303d,_0x5d88ee,_0xae2949[_0x20a1('0x132')],_0xae2949[_0x20a1('0x62')],undefined,_0x3c51f4);if(_0x4a65bb[_0x20a1('0x9c')]!==-0x1){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x133'),_0x4b261f));var _0x1c84cf=this[_0x20a1('0x88')][_0x20a1('0x6c')](this,_0xae2949,_0x4b261f);if(_0x1c84cf){for(var _0x548185 in _0x1c84cf){if(_0x1c84cf[_0x20a1('0x93')](_0x548185)){this[_0x20a1('0xa')][_0x20a1('0x99')](util['format']('GOOGLE_ASR_%s',_0x548185['toUpperCase']()),_0x1c84cf[_0x548185]);}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x134'),JSON['stringify'](_0x1c84cf)));}}return _0x4a65bb;};AGIVertices[_0x20a1('0xd')]['tildeasr']=function(_0x4e1e34){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4e1e34[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x4e1e34['appid'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x135'));}if(!this[_0x20a1('0x7d')](_0x4e1e34[_0x20a1('0x8b')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x136'));}var _0x17be2e=_0x20a1('0x12e');var _0x221d2f=util[_0x20a1('0x28')](_0x20a1('0x12f'),FILES_PATH,rs[_0x20a1('0x115')](0x4));var _0x1e6f2e=util[_0x20a1('0x28')](_0x20a1('0x96'),_0x221d2f,_0x17be2e);var _0x532380=!![];if(_0x4e1e34[_0x20a1('0x130')]===_0x20a1('0x131')){_0x532380=![];}var _0x1d90e2=this[_0x20a1('0xa')][_0x20a1('0x137')](_0x221d2f,_0x17be2e,_0x4e1e34['intKey'],_0x4e1e34[_0x20a1('0x62')],undefined,_0x532380);if(_0x1d90e2[_0x20a1('0x9c')]!==-0x1){this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0x138'),_0x1e6f2e));var _0x195386=this[_0x20a1('0x89')][_0x20a1('0x6c')](this,_0x4e1e34,_0x1e6f2e);if(_0x195386){for(var _0x37e72c in _0x195386){if(_0x195386[_0x20a1('0x93')](_0x37e72c)){this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')]('TILDE_ASR_%s',_0x37e72c['toUpperCase']()),_0x195386[_0x37e72c]);}}return this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0x139'),JSON[_0x20a1('0x6d')](_0x195386)));}}return _0x1d90e2;};AGIVertices['prototype'][_0x20a1('0x13a')]=function(_0x304004){logger['info'](util['format'](_0x20a1('0x13b'),_0x304004[_0x20a1('0xa2')]));return this['channel'][_0x20a1('0x13c')](_0x304004['context'],_0x304004[_0x20a1('0x3b')],_0x304004['priority']);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x13d')]=function(_0x407e6b){logger['info'](util[_0x20a1('0x28')](_0x20a1('0x13e'),_0x407e6b['label']));if(!this[_0x20a1('0x7d')](_0x407e6b[_0x20a1('0x13f')])){return this['channel'][_0x20a1('0x2b')](_0x407e6b,_0x20a1('0x140'));}try{var _0x158456=eval(_0x407e6b['condition'])?_0x20a1('0x141'):'false';this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x142'),_0x407e6b[_0x20a1('0x13f')],_0x158456));return{'code':0xc8,'result':_0x158456};}catch(_0x40e36f){return{'code':0xc8,'result':_0x20a1('0x143')};}};AGIVertices[_0x20a1('0xd')]['gotoiftime']=function(_0x4776aa){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x144'),_0x4776aa[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x4776aa['interval_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4776aa,_0x20a1('0x145'));}var _0x5eddc0=this[_0x20a1('0x22')][_0x20a1('0x6c')](this,_0x4776aa[_0x20a1('0x146')]);if(!_0x5eddc0){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4776aa,_0x20a1('0x147'));}for(var _0x48da1c=0x0;_0x48da1c<_0x5eddc0[_0x20a1('0x98')];_0x48da1c+=0x1){var _0x2ad1a2=this[_0x20a1('0xa')][_0x20a1('0xe')](util['format'](_0x20a1('0x148'),_0x5eddc0[_0x48da1c]));if(_0x2ad1a2[_0x20a1('0x9c')]===-0x1){return _0x2ad1a2;}logger['info'](util['format'](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],_0x2ad1a2['extra']));if(_0x2ad1a2[_0x20a1('0x9b')]===_0x20a1('0x141')){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],'true'));this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],'true'));return{'code':0xc8,'result':_0x20a1('0x141')};}else{logger[_0x20a1('0x2f')](util['format']('IFTIME\x20%s\x20%s',_0x5eddc0[_0x48da1c],_0x20a1('0x143')));this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],'false'));}}return{'code':0xc8,'result':_0x20a1('0x143')};};AGIVertices[_0x20a1('0xd')]['hangup']=function(_0x259600){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x14a'),_0x259600['label']));return this[_0x20a1('0xa')][_0x20a1('0x14b')]();};AGIVertices['prototype'][_0x20a1('0x14c')]=function(_0x4040d2){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x14d'),_0x4040d2['label']));if(!this[_0x20a1('0x7d')](_0x4040d2[_0x20a1('0x74')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x12d'));}var _0x3079d8=_0x20a1('0x12e');var _0x2917aa=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x20a1('0x115')](0x4));var _0x5b1289=util[_0x20a1('0x28')](_0x20a1('0x96'),_0x2917aa,_0x3079d8);var _0x5dec99=!![];if(_0x4040d2[_0x20a1('0x130')]===_0x20a1('0x131')){_0x5dec99=![];}var _0x2a3ae9=this[_0x20a1('0xa')]['recordFile'](_0x2917aa,_0x3079d8,_0x4040d2[_0x20a1('0x132')],_0x4040d2[_0x20a1('0x62')],undefined,_0x5dec99);if(_0x2a3ae9['result']!==-0x1){this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0x14e'),_0x5b1289));var _0x9e767d=this[_0x20a1('0x7c')]['sync'](this,_0x4040d2,_0x5b1289);if(_0x9e767d){for(var _0x5e89fa in _0x9e767d){if(_0x9e767d[_0x20a1('0x93')](_0x5e89fa)){this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0x14f'),_0x5e89fa['toUpperCase']()),_0x9e767d[_0x5e89fa]);}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x150'),JSON[_0x20a1('0x6d')](_0x9e767d)));}}return _0x2a3ae9;};AGIVertices[_0x20a1('0xd')]['ispeechtts']=function(_0x25d919){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x25d919['label']));if(!this['isConfigured'](_0x25d919['key'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x12d'));}if(!this[_0x20a1('0x7d')](_0x25d919[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')]('no\x20text\x20configured');}this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x151'),_0x25d919[_0x20a1('0x57')]));var _0x3c113d=this['ispeechTTS'][_0x20a1('0x6c')](this,_0x25d919);if(_0x3c113d){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x14e'),_0x3c113d));var _0x2e71a5=this[_0x20a1('0xa')]['streamFile'](_0x3c113d,_0x25d919[_0x20a1('0x132')]);try{fs[_0x20a1('0xff')](_0x3c113d+_0x20a1('0x122'));}catch(_0x1a4ccf){logger[_0x20a1('0x2b')](_0x1a4ccf);}return _0x2e71a5;}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x25d919,_0x20a1('0x152'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x153')]=function(_0x194b6d){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x154'),_0x194b6d['label']));if(!this[_0x20a1('0x7d')](_0x194b6d['findBy'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x194b6d,_0x20a1('0x155'));}logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x156'),this['channel'][_0x20a1('0x38')],_0x194b6d[_0x20a1('0x157')]));var _0x2563e1=this[_0x20a1('0x52')][_0x20a1('0x6c')](this,_0x194b6d[_0x20a1('0x157')]);if(_0x2563e1){logger[_0x20a1('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x20a1('0xa')][_0x20a1('0x38')],_0x194b6d['findBy']));this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x158'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x194b6d[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x159')};}else{logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x20a1('0xa')][_0x20a1('0x38')],_0x194b6d[_0x20a1('0x157')]));this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x15a'),this[_0x20a1('0xa')]['callerid'],_0x194b6d[_0x20a1('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x20a1('0xd')]['logout']=function(_0x2a75c9){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x15b'),_0x2a75c9[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x2a75c9['findBy'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x2a75c9,'no\x20find\x20by\x20configured');}logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x156'),this['channel'][_0x20a1('0x38')],_0x2a75c9['findBy']));var _0x1d937f=this[_0x20a1('0x4f')][_0x20a1('0x6c')](this,_0x2a75c9[_0x20a1('0x157')]);if(_0x1d937f){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x158'),this[_0x20a1('0xa')]['callerid'],_0x2a75c9['findBy']));this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0x158'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x2a75c9['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x20a1('0x28')](_0x20a1('0x15a'),this['channel']['callerid'],_0x2a75c9[_0x20a1('0x157')]));this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x15a'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x2a75c9[_0x20a1('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x20a1('0x15c')]=function(_0x187465){logger['info'](util['format'](_0x20a1('0x15d'),_0x187465[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x187465[_0x20a1('0x15e')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x187465,_0x20a1('0x15f'));}this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0x160'),_0x187465[_0x20a1('0x15e')]));var _0x589f08=eval(_0x187465['operation']);if(!this[_0x20a1('0x7d')](_0x187465[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x16faa1=this['getVariable'][_0x20a1('0x6c')](this,_0x187465[_0x20a1('0xd5')]);if(!_0x16faa1){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x187465,_0x20a1('0xd7'));}if(_[_0x20a1('0x97')](_0x589f08)){var _0x9dd960=this;_0x589f08[_0x20a1('0x161')](function(_0x209437,_0x551ba6){_0x9dd960[_0x20a1('0xa')]['setVariable'](util['format'](_0x20a1('0x162'),_0x16faa1,_0x551ba6),_0x209437);});return this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0x163'),_0x16faa1));}else{return this[_0x20a1('0xa')][_0x20a1('0x99')](_0x16faa1,_0x589f08);}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x164')]=function(_0x5cc47e){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x165'),_0x5cc47e[_0x20a1('0xa2')]));if(_0x5cc47e[_0x20a1('0x9f')]===0x0){return this[_0x20a1('0x9e')](_0x5cc47e);}_0x5cc47e['retry']-=0x1;if(!this[_0x20a1('0x7d')](_0x5cc47e[_0x20a1('0x10d')])){return this['channel'][_0x20a1('0x2b')](_0x5cc47e,_0x20a1('0x166'));}var _0xe425bd=this[_0x20a1('0x1c')]['sync'](this,_0x5cc47e['file_id']);if(!_0xe425bd){return this['channel'][_0x20a1('0x2b')](_0x5cc47e,_0x20a1('0x10e'));}var _0x146203=this[_0x20a1('0xa')]['getData'](_0xe425bd,_0x5cc47e['response'],_0x5cc47e['digit']);var _0xddf0a3=_0x146203['result'];if(_0x146203[_0x20a1('0x9c')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x5cc47e,'-1');return _0x146203;}else if(_0x146203['extra']==='timeout'){_0x146203[_0x20a1('0x9c')]=_0x146203[_0x20a1('0x9c')][_0x20a1('0x98')]>0x0?_0x146203[_0x20a1('0x9c')]:'t';}else if(_[_0x20a1('0x41')](_0x146203['result'])){_0x146203[_0x20a1('0x9c')]='#';_0xddf0a3='#';}if(!this[_0x20a1('0x7d')](_0x5cc47e[_0x20a1('0xd5')])){this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xd6'));}else{var _0x41c097=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x5cc47e[_0x20a1('0xd5')]);if(!_0x41c097){return this[_0x20a1('0xa')]['error'](_0x5cc47e,'no\x20variable\x20found');}this[_0x20a1('0xa')]['setVariable'](_0x41c097,_0xddf0a3);}this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x5cc47e,_0xddf0a3);return _0x146203;};AGIVertices[_0x20a1('0xd')][_0x20a1('0xa5')]=function(_0x16f709){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x16f709['label']));return this['channel'][_0x20a1('0xa5')](_0x16f709[_0x20a1('0x167')]||_0x16f709[_0x20a1('0xa2')]);};AGIVertices['prototype']['pause']=function(_0x4130d4){logger[_0x20a1('0x2f')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x4130d4[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x4130d4[_0x20a1('0x157')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4130d4,_0x20a1('0x155'));}logger['info'](util[_0x20a1('0x28')](_0x20a1('0x156'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x4130d4[_0x20a1('0x157')]));var _0x51de87=this['getPause']['sync'](this,_0x4130d4[_0x20a1('0x168')]);var _0x286d05=this[_0x20a1('0x4c')][_0x20a1('0x6c')](this,_0x4130d4[_0x20a1('0x157')],_0x51de87);if(_0x286d05){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x158'),this['channel'][_0x20a1('0x38')],_0x4130d4[_0x20a1('0x157')]));this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x20a1('0x38')],_0x4130d4['findBy']));return{'code':0xc8,'result':_0x20a1('0x159')};}else{logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x15a'),this['channel'][_0x20a1('0x38')],_0x4130d4['findBy']));this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x158'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x4130d4[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x169')};}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x16a')]=function(_0x562082){logger['info'](util['format'](_0x20a1('0x16b'),_0x562082['label']));if(!this[_0x20a1('0x7d')](_0x562082['file_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x562082,_0x20a1('0x166'));}var _0x4a5ede=this[_0x20a1('0x1c')][_0x20a1('0x6c')](this,_0x562082[_0x20a1('0x10d')]);if(!_0x4a5ede){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x562082,'no\x20file\x20audio\x20found');}var _0x366936=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0x16c'),[_0x4a5ede,_0x562082['opts']]);if(_0x366936['result']===-0x1){return _0x366936;}return this['channel']['noop'](util['format'](_0x20a1('0xbf'),_0x20a1('0x16c'),_0x4a5ede));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x16d')]=function(_0x3e6f14){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x16e'),_0x3e6f14['label']));if(!this[_0x20a1('0x7d')](_0x3e6f14[_0x20a1('0x16f')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3e6f14,_0x20a1('0x170'));}var _0x507311='';var _0x54f6c7=parseInt(_0x3e6f14[_0x20a1('0x16f')],0xa);if(isNaN(_0x54f6c7)){_0x507311=_0x3e6f14['queue_id'];}else{_0x507311=this[_0x20a1('0x12')][_0x20a1('0x6c')](this,_0x3e6f14[_0x20a1('0x16f')]);if(!_0x507311){return this['channel'][_0x20a1('0x2b')](_0x3e6f14,'no\x20queue\x20found');}}var _0x3d2374='';if(this[_0x20a1('0x7d')](_0x3e6f14[_0x20a1('0x10d')])){var _0x38b3c9=this[_0x20a1('0x1c')][_0x20a1('0x6c')](this,_0x3e6f14[_0x20a1('0x10d')]);if(_0x38b3c9){_0x3d2374=_0x38b3c9;}}this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x3e6f14,_0x507311);if(_0x3e6f14['opts'][_0x20a1('0x171')]('x')<0x0){_0x3e6f14[_0x20a1('0xe1')]+='x';}if(_0x3e6f14[_0x20a1('0xe1')][_0x20a1('0x171')]('X')<0x0){_0x3e6f14[_0x20a1('0xe1')]+='X';}this[_0x20a1('0xa')][_0x20a1('0x99')]('XMCS-QUEUE',_0x507311?_0x507311[_0x20a1('0x172')]():'');var _0x21a102=this[_0x20a1('0xa')]['exec'](_0x20a1('0x173'),[_0x507311,_0x3e6f14[_0x20a1('0xe1')],_0x3e6f14[_0x20a1('0x5f')],_0x3d2374,_0x3e6f14[_0x20a1('0x62')],_0x3e6f14[_0x20a1('0x4')],_0x3e6f14['macro'],_0x3e6f14[_0x20a1('0x174')],'',_0x3e6f14[_0x20a1('0x175')]]);if(_0x21a102[_0x20a1('0x9c')]===-0x1){return _0x21a102;}return this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xbf'),_0x20a1('0x173'),_0x507311));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x176')]=function(_0x2e0022){logger['info'](util[_0x20a1('0x28')](_0x20a1('0x177'),_0x2e0022[_0x20a1('0xa2')]));var _0xac8368=_0x2e0022[_0x20a1('0x178')]||_0x20a1('0x12e');var _0x4127cb=util[_0x20a1('0x28')](_0x20a1('0x179'),this[_0x20a1('0xa')]['uniqueid'],rs['generate'](0x5));var _0x15c414=util[_0x20a1('0x28')](_0x20a1('0x17a'),FILES_PATH,_0x4127cb,_0xac8368);var _0x311df4=util['format'](_0x20a1('0x12f'),FILES_PATH,_0x4127cb);this['createSquareRecording']['sync'](this,_0x2e0022,_0x4127cb,_0x15c414);this[_0x20a1('0xa')]['setVariable'](_0x20a1('0x17b'),_0x4127cb);logger[_0x20a1('0x2f')](_0x20a1('0x17c'),_0x311df4,_0xac8368,_0x2e0022['escape_digits'],_0x2e0022[_0x20a1('0x62')]);return this[_0x20a1('0xa')][_0x20a1('0x137')](_0x311df4,_0xac8368,_0x2e0022['escape_digits'],_0x2e0022[_0x20a1('0x62')],undefined,!![]);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x17d')]=function(_0x59ba83){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x17e'),_0x59ba83[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x59ba83[_0x20a1('0x5f')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0x17f'));}var _0x273886=this[_0x20a1('0x5e')][_0x20a1('0x6c')](this,_0x59ba83);logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x180'),util['inspect'](_0x273886,{'showHidden':![],'depth':null})));if(!this[_0x20a1('0x7d')](_0x59ba83[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x181'));}var _0x598b6e=this['getVariable'][_0x20a1('0x6c')](this,_0x59ba83[_0x20a1('0xd5')]);if(!_0x598b6e){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x59ba83,'no\x20variable\x20found');}this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0x182'),_0x598b6e),_0x273886[_0x20a1('0x6f')]?_0x273886[_0x20a1('0x6f')]:_0x20a1('0x183'));this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')]('%s_STATUS_MESSAGE',_0x598b6e),_0x273886[_0x20a1('0x70')]?_0x273886[_0x20a1('0x70')]:'OK');if(_0x273886[_0x20a1('0x65')]){try{this[_0x20a1('0x95')](_0x273886[_0x20a1('0x65')],_0x598b6e);}catch(_0x147da3){logger[_0x20a1('0x2b')](util['format'](_0x20a1('0x184'),_0x598b6e));}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xda'),_0x598b6e));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x185')]=function(_0x5ce49d){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5ce49d[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x186')](_0x5ce49d[_0x20a1('0x187')]['replace'](/\s+/g,''),_0x5ce49d[_0x20a1('0x188')]);};AGIVertices['prototype'][_0x20a1('0x189')]=function(_0x13af85){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x18a'),_0x13af85[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x18b')](_0x13af85[_0x20a1('0x61')][_0x20a1('0xd2')](/\s+/g,''),_0x13af85[_0x20a1('0x188')]);};AGIVertices[_0x20a1('0xd')]['sayphonetic']=function(_0x406e9f){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x18c'),_0x406e9f[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x18d')](_0x406e9f[_0x20a1('0x57')],_0x406e9f[_0x20a1('0x188')]);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x18e')]=function(_0x22b769){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x22b769[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x22b769[_0x20a1('0x18f')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x190'));}var _0xa8a022=this[_0x20a1('0x1f')][_0x20a1('0x6c')](this,_0x22b769['account_id']);if(!_0xa8a022||!_0xa8a022[_0x20a1('0x191')]){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x22b769,'no\x20mail\x20account\x20found');}var _0x498df7={'from':util[_0x20a1('0x28')](_0x20a1('0x192'),_0xa8a022[_0x20a1('0x11')],_0xa8a022['email']||_0xa8a022[_0x20a1('0x191')][_0x20a1('0x193')]),'to':_0x22b769['to']||'','cc':_0x22b769['cc']||'','bcc':_0x22b769[_0x20a1('0x194')]||'','subject':_0x22b769[_0x20a1('0x195')],'html':_0x22b769['text'],'text':_0x22b769[_0x20a1('0x57')]};if(this[_0x20a1('0x7d')](_0x22b769['template_id'])){}logger[_0x20a1('0xdc')](_0x20a1('0x196'),JSON['stringify'](_0x498df7));this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x22b769,_0x22b769[_0x20a1('0x18f')]);this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')](_0x20a1('0x197'),_0xa8a022['name']));this[_0x20a1('0x21')][_0x20a1('0x6c')](this,_0xa8a022[_0x20a1('0x198')],_0x498df7);return this['channel'][_0x20a1('0xa5')](_0x20a1('0x199'));};AGIVertices[_0x20a1('0xd')]['sendFax']=function(_0x548170){logger[_0x20a1('0x2f')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x548170['label']));return this[_0x20a1('0xa')][_0x20a1('0xa5')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x20a1('0xd')][_0x20a1('0x19a')]=function(_0x227795){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x19b'),_0x227795['label']));if(!this[_0x20a1('0x7d')](_0x227795[_0x20a1('0x19c')])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0x19d'));}var _0x2dceff=this[_0x20a1('0x32')][_0x20a1('0x6c')](this,_0x227795[_0x20a1('0x19c')]);if(!_0x2dceff){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x227795,'no\x20sms\x20account\x20found');}var _0x36f95f={'body':_0x227795[_0x20a1('0x19e')],'phone':_0x227795['to']||'','SmsAccountId':_0x2dceff['id']};logger[_0x20a1('0xdc')](_0x20a1('0x19f'),JSON[_0x20a1('0x6d')](_0x36f95f));this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0x227795,_0x227795[_0x20a1('0x19c')]);this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1a0'),_0x2dceff[_0x20a1('0x11')]));this['createSmsMessage'][_0x20a1('0x6c')](this,_0x36f95f);return this[_0x20a1('0xa')]['noop'](_0x20a1('0x1a1'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1a2')]=function(_0x9d44ce){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x1a3'),_0x9d44ce[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x9d44ce[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x9d44ce,_0x20a1('0x1a4'));}var _0x4ebcf6=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x9d44ce[_0x20a1('0xd5')]);if(!_0x4ebcf6){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x9d44ce,_0x20a1('0xd7'));}return this['channel'][_0x20a1('0x99')](_0x4ebcf6,_0x9d44ce['variable_value']);};AGIVertices['prototype'][_0x20a1('0x1a5')]=function(_0x5389df){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x1a6'),_0x5389df[_0x20a1('0xa2')]));this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x1a7'));var _0x497239=this[_0x20a1('0xa')][_0x20a1('0xe')](_0x20a1('0x1a8'));if(!_[_0x20a1('0x41')](_0x497239[_0x20a1('0x9b')])){this[_0x20a1('0xa')][_0x20a1('0x37')]=_0x497239[_0x20a1('0x9b')];}if(_0x5389df['answer']===_0x20a1('0x1a9')){this[_0x20a1('0xa')]['noop']('Answer');return this[_0x20a1('0xa')]['answer']();}return this[_0x20a1('0xa')][_0x20a1('0xa5')]('Skipped\x20Answer');};AGIVertices['prototype']['subproject']=function(_0x3d3e0c){logger['info'](util['format'](_0x20a1('0x1aa'),_0x3d3e0c[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x3d3e0c[_0x20a1('0x1ab')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3d3e0c,_0x20a1('0x1ac'));}var _0x1ace62=this['getSquareProject'][_0x20a1('0x6c')](this,_0x3d3e0c[_0x20a1('0x1ab')]);if(!this[_0x20a1('0x7d')](_0x1ace62)){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3d3e0c,util[_0x20a1('0x28')](_0x20a1('0x1ad'),_0x3d3e0c[_0x20a1('0x1ab')]));}if(_0x1ace62===this['channel']['arg_1']){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3d3e0c,_0x20a1('0x1ae'));}this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x3d3e0c,_0x1ace62);var _0x18eece=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0x1af'),util[_0x20a1('0x28')](_0x20a1('0x1b0'),config['agi'][_0x20a1('0x1b1')]||_0x20a1('0x1b2'),_0x1ace62,this[_0x20a1('0xa')][_0x20a1('0x1b3')]));if(_0x18eece[_0x20a1('0x9c')]===-0x1){return _0x18eece;}return this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xbf'),'AGI',_0x1ace62));};AGIVertices['prototype'][_0x20a1('0x1b4')]=function(_0x47ebdf){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x47ebdf[_0x20a1('0xa2')]));var _0xb34c9e=this[_0x20a1('0x1b5')][_0x20a1('0x6c')](this,_0x47ebdf[_0x20a1('0xb1')]);this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x47ebdf,_0x47ebdf[_0x20a1('0xb1')]);if(this[_0x20a1('0x7d')](_0x47ebdf['variable_id'])){var _0x1a353c=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x47ebdf['variable_id']);if(_0x1a353c){this[_0x20a1('0xa')][_0x20a1('0x99')](_0x1a353c,_0xb34c9e);return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x47ebdf[_0x20a1('0xb1')],_0x1a353c));}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1b6'),_0x47ebdf['command']));};AGIVertices['prototype'][_0x20a1('0x1b7')]=function(_0x28d2a7){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x1b8'),_0x28d2a7['label']));_0x28d2a7['text']=_0x28d2a7[_0x20a1('0x57')][_0x20a1('0xd2')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20a1('0x7d')](_0x28d2a7[_0x20a1('0x1b9')])){return this['channel']['noop']('no\x20apiKey\x20configured');}if(!this[_0x20a1('0x7d')](_0x28d2a7[_0x20a1('0x57')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa3'));}this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1ba'),_0x28d2a7[_0x20a1('0x57')]));var _0x77704e=this[_0x20a1('0x55')][_0x20a1('0x6c')](this,_0x28d2a7);if(_0x77704e){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x77704e));var _0x1740ff=this[_0x20a1('0xa')][_0x20a1('0xfe')](_0x77704e);try{fs[_0x20a1('0xff')](_0x77704e+_0x20a1('0x122'));}catch(_0x375cae){logger[_0x20a1('0x2b')](_0x375cae);}return _0x1740ff;}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x28d2a7,_0x20a1('0x1bb'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1bc')]=function(_0x14d5b7){logger['info'](util[_0x20a1('0x28')](_0x20a1('0x1bd'),_0x14d5b7[_0x20a1('0xa2')]));_0x14d5b7[_0x20a1('0x57')]=_0x14d5b7[_0x20a1('0x57')][_0x20a1('0xd2')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20a1('0x7d')](_0x14d5b7[_0x20a1('0x57')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa3'));}this['channel'][_0x20a1('0xa5')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x14d5b7[_0x20a1('0x57')]));var _0x43fe13=this[_0x20a1('0x5c')]['sync'](this,_0x14d5b7);if(_0x43fe13){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1be'),_0x43fe13));var _0x5b0b7c=this[_0x20a1('0xa')][_0x20a1('0xfe')](_0x43fe13);try{fs['unlink'](_0x43fe13+'.wav');}catch(_0x598a99){logger[_0x20a1('0x2b')](_0x598a99);}return _0x5b0b7c;}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x14d5b7,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x20a1('0x1bf')]=function(_0x54cbed){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x54cbed[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x54cbed[_0x20a1('0x157')])){return this['channel'][_0x20a1('0x2b')](_0x54cbed,_0x20a1('0x155'));}logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x156'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));var _0x5a2c09=this['agentUnpause'][_0x20a1('0x6c')](this,_0x54cbed[_0x20a1('0x157')]);if(_0x5a2c09){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x158'),this['channel'][_0x20a1('0x38')],_0x54cbed['findBy']));this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x158'),this['channel'][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x159')};}else{logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x15a'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0x15a'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x169')};}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1c0')]=function(_0x53e5ba){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x1c1'),_0x53e5ba['label']));var _0x3ac8c3=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0x1c2'),[_0x53e5ba[_0x20a1('0x1c3')],_0x53e5ba[_0x20a1('0x72')]]);if(_0x3ac8c3[_0x20a1('0x9c')]===-0x1){return _0x3ac8c3;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x53e5ba[_0x20a1('0x1c3')]));};AGIVertices['prototype'][_0x20a1('0x1c4')]=function(_0x68eb7c){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x1c5'),_0x68eb7c[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x68eb7c['variable_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x68eb7c,_0x20a1('0x1a4'));}var _0x6c9795=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x68eb7c[_0x20a1('0xd5')]);if(!_0x6c9795){return this['channel'][_0x20a1('0x2b')](_0x68eb7c,'no\x20variable\x20found');}var _0x4f6d2c=this[_0x20a1('0xa')]['getVariable'](_0x6c9795);return{'code':0xc8,'result':_0x4f6d2c[_0x20a1('0x9b')]?_0x4f6d2c[_0x20a1('0x9b')]:'-'};};String[_0x20a1('0xd')][_0x20a1('0x9a')]=function(_0x2f9e71,_0x5b6a8b){return this['split'](_0x2f9e71)[_0x20a1('0x1c6')](_0x5b6a8b);};module[_0x20a1('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 d5e5601..264055e 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 _0xe84d=['transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','interface','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','agents','resolve','getAgent','attended','destlinkedid','savePause','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]'];(function(_0x217ccb,_0x1f6d94){var _0x557582=function(_0x1bfdca){while(--_0x1bfdca){_0x217ccb['push'](_0x217ccb['shift']());}};_0x557582(++_0x1f6d94);}(_0xe84d,0x169));var _0xde84=function(_0xe5cc7e,_0x240934){_0xe5cc7e=_0xe5cc7e-0x0;var _0x5754fa=_0xe84d[_0xe5cc7e];return _0x5754fa;};'use strict';var _=require(_0xde84('0x0'));var moment=require(_0xde84('0x1'));var ami=require('../ami');var logger=require(_0xde84('0x2'))(_0xde84('0x3'));var RpcUser=require(_0xde84('0x4'));var RpcVoiceAgentReport=require(_0xde84('0x5'));function Acw(_0x57a80b){this[_0xde84('0x6')]=_0x57a80b[_0xde84('0x6')];this['agents']=_0x57a80b['agents'];this[_0xde84('0x7')]=_0x57a80b[_0xde84('0x7')];this['channels']={};ami['on'](_0xde84('0x8'),this[_0xde84('0x9')][_0xde84('0xa')](this));ami['on'](_0xde84('0xb'),this[_0xde84('0xc')]['bind'](this));ami['on'](_0xde84('0xd'),this[_0xde84('0xe')][_0xde84('0xa')](this));ami['on'](_0xde84('0xf'),this[_0xde84('0x10')][_0xde84('0xa')](this));ami['on'](_0xde84('0x11'),this[_0xde84('0x12')]['bind'](this));ami['on'](_0xde84('0x13'),this[_0xde84('0x14')]['bind'](this));ami['on'](_0xde84('0x15'),this[_0xde84('0x16')][_0xde84('0xa')](this));}function getDiff(_0x3d7c10){var _0x3ad96a=moment()['milliseconds'](0x0);var _0x53b95a=moment(_0x3d7c10)[_0xde84('0x17')](0x0);return _0x3ad96a[_0xde84('0x18')](_0x53b95a,_0xde84('0x19'));}Acw[_0xde84('0x1a')][_0xde84('0x1b')]=function(_0x219d58,_0x2c4cce){var _0x346f7f=this;var _0x235564=getDiff(_0x346f7f[_0xde84('0x7')][_0x219d58][_0xde84('0x1c')]);clearTimeout(_0x346f7f[_0xde84('0x7')][_0x219d58]['timer']);_0x346f7f['timers'][_0x219d58][_0xde84('0x1d')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x235564},_0x346f7f[_0xde84('0x7')][_0x219d58][_0xde84('0x1e')],_0x219d58)[_0xde84('0x1f')](function(_0x552b7e){logger[_0xde84('0x20')](_0xde84('0x21'),_0x2c4cce,_0x235564,_0x552b7e);})[_0xde84('0x22')](function(_0x4d6e2d){logger[_0xde84('0x23')]('[%s][UPDATE][ERRORS:%s]',_0x2c4cce,_0x4d6e2d);})[_0xde84('0x24')](function(){delete _0x346f7f['timers'][_0x219d58];});};Acw[_0xde84('0x1a')]['startAcw']=function(_0x31635f){try{var _0x506a0d=this;var _0x1bcdcb=this['channels'][_0x31635f][_0xde84('0x25')];var _0x1db379=this[_0xde84('0x26')][_0x31635f][_0xde84('0x27')];var _0x4a29a5=this['voiceQueues'][_0x1db379];var _0x1fb959=![];var _0x190348=_0xde84('0x28');if(_0x4a29a5[_0xde84('0x29')]&&_0x4a29a5[_0xde84('0x2a')]['name']){_0x1fb959=!![];_0x190348=_0x4a29a5[_0xde84('0x2a')]['name'];}if(!_0x506a0d[_0xde84('0x2b')][_0x1bcdcb]){return Promise[_0xde84('0x2c')]();}return RpcUser[_0xde84('0x2d')](_0x506a0d[_0xde84('0x2b')][_0x1bcdcb]['id'])[_0xde84('0x1f')](function(_0x1d5eda){if(!_0x1d5eda||_0x1d5eda['voicePause']){logger[_0xde84('0x20')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x31635f,_0x1bcdcb,_0x1db379);return;}logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x31635f,_0x1bcdcb,_0x1db379);var _0x41a7b8=_0x506a0d[_0xde84('0x26')][_0x31635f][_0xde84('0x2e')]&&_0x506a0d[_0xde84('0x26')][_0x31635f][_0xde84('0x2f')]?_0x506a0d['channels'][_0x31635f][_0xde84('0x2f')]:_0x31635f;return RpcUser[_0xde84('0x30')](_0x506a0d['agents'][_0x1bcdcb],_0x190348,_0x41a7b8)[_0xde84('0x1f')](function(_0x41b294){_0x506a0d[_0xde84('0x6')][_0x1db379]['available']-=0x1;_0x506a0d[_0xde84('0x6')][_0x1db379][_0xde84('0x31')]+=0x1;return _0x41b294;});})[_0xde84('0x1f')](function(_0x3832c6){if(_0x1fb959||!_0x3832c6){return;}_0x506a0d['timers'][_0x1bcdcb]={};logger[_0xde84('0x20')](_0xde84('0x32'),_0x31635f,_0x506a0d[_0xde84('0x6')][_0x1db379][_0xde84('0x33')],_0x1bcdcb,_0x1db379);_0x506a0d[_0xde84('0x7')][_0x1bcdcb][_0xde84('0x1d')]=setTimeout(_0x506a0d['stopAcw']['bind'](_0x506a0d,_0x1bcdcb),_0x506a0d[_0xde84('0x6')][_0x1db379][_0xde84('0x33')]*0x3e8);_0x506a0d['timers'][_0x1bcdcb][_0xde84('0x1c')]=moment()[_0xde84('0x34')](_0xde84('0x35'));_0x506a0d[_0xde84('0x7')][_0x1bcdcb][_0xde84('0x1e')]=_0x31635f;_0x506a0d[_0xde84('0x7')][_0x1bcdcb][_0xde84('0x27')]=_0x1db379;_0x506a0d[_0xde84('0x7')][_0x1bcdcb][_0xde84('0x1b')]=_0x506a0d['updateAcw'][_0xde84('0xa')](_0x506a0d,_0x1bcdcb,_0x31635f);})[_0xde84('0x22')](function(){logger[_0xde84('0x23')](_0xde84('0x32'),_0x31635f,_0x506a0d[_0xde84('0x6')][_0x1db379][_0xde84('0x33')],_0x1bcdcb,_0x1db379);})[_0xde84('0x24')](function(){delete _0x506a0d['channels'][_0x31635f];});}catch(_0x1098c0){logger['error']('[ACW][START]\x20%s',_0x1098c0[_0xde84('0x36')]);}};Acw[_0xde84('0x1a')][_0xde84('0x37')]=function(_0x44f5f7){try{var _0x188d65=this;if(_0x188d65[_0xde84('0x7')][_0x44f5f7]){_0x188d65[_0xde84('0x7')][_0x44f5f7][_0xde84('0x1d')]=![];var _0x2c6578=_0x188d65['timers'][_0x44f5f7]['uniqueid'];var _0x31b52e=_0x188d65[_0xde84('0x7')][_0x44f5f7][_0xde84('0x27')];var _0x337475=_0x188d65['voiceQueues'][_0x31b52e][_0xde84('0x33')];logger['info'](_0xde84('0x38'),_0x2c6578,_0x44f5f7);RpcUser['getAgent'](this['agents'][_0x44f5f7]['id'])[_0xde84('0x1f')](function(_0x49815e){if(_0x49815e[_0xde84('0x39')]===_0xde84('0x28')){return RpcUser[_0xde84('0x3a')](_0x188d65[_0xde84('0x2b')][_0x44f5f7]);}});RpcVoiceAgentReport[_0xde84('0x3b')]({'acwtime':_0x337475,'agentacw':!![]},_0x2c6578,_0x44f5f7)['then'](function(_0x81f7b6){logger[_0xde84('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0x2c6578,_0x337475,_0x81f7b6);})[_0xde84('0x22')](function(_0x35c600){logger[_0xde84('0x23')](_0xde84('0x3c'),_0x2c6578,_0x35c600);});}else{logger[_0xde84('0x23')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x44f5f7);if(_0x188d65[_0xde84('0x7')]){logger[_0xde84('0x20')]('[ACW][TIMERS]',JSON[_0xde84('0x3d')](_0x188d65[_0xde84('0x7')]));}}}catch(_0x2c0b28){logger[_0xde84('0x23')]('[ACW][STOP]\x20%s',_0x2c0b28[_0xde84('0x36')]);}};Acw[_0xde84('0x1a')]['syncAgentConnect']=function(_0x19a7eb){try{if(this['voiceQueues'][_0x19a7eb[_0xde84('0x27')]]&&(this[_0xde84('0x6')][_0x19a7eb[_0xde84('0x27')]]['acw']||this[_0xde84('0x6')][_0x19a7eb[_0xde84('0x27')]][_0xde84('0x29')])){if(this['agents'][_0x19a7eb[_0xde84('0x25')]]){this[_0xde84('0x26')][_0x19a7eb[_0xde84('0x1e')]]={'queue':_0x19a7eb[_0xde84('0x27')],'interface':_0x19a7eb[_0xde84('0x25')],'destlinkedid':_0x19a7eb['destlinkedid']};}}}catch(_0x5ce32d){logger[_0xde84('0x23')](_0xde84('0x3e'),_0x5ce32d[_0xde84('0x36')]);}};Acw[_0xde84('0x1a')][_0xde84('0x16')]=function(_0x56df66){try{if(this[_0xde84('0x6')][_0x56df66[_0xde84('0x27')]]&&(this[_0xde84('0x6')][_0x56df66[_0xde84('0x27')]]['acw']||this[_0xde84('0x6')][_0x56df66[_0xde84('0x27')]][_0xde84('0x29')])){if(this['agents'][_0x56df66[_0xde84('0x25')]]){this[_0xde84('0x26')][_0x56df66['uniqueid']]={'queue':_0x56df66['queue'],'interface':_0x56df66[_0xde84('0x25')]};}}}catch(_0x48af6f){logger['error'](_0xde84('0x3f'),_0x48af6f[_0xde84('0x36')]);}};Acw[_0xde84('0x1a')][_0xde84('0xc')]=function(_0x272364){try{if(this['channels'][_0x272364['uniqueid']]&&_[_0xde84('0x40')](this[_0xde84('0x26')][_0x272364['uniqueid']]['attended'])){logger[_0xde84('0x20')](_0xde84('0x41'),_0x272364[_0xde84('0x1e')]);this[_0xde84('0x42')](_0x272364[_0xde84('0x1e')]);}else if(this[_0xde84('0x26')][_0x272364['linkedid']]&&_['isUndefined'](this[_0xde84('0x26')][_0x272364[_0xde84('0x43')]][_0xde84('0x2e')])){logger[_0xde84('0x20')](_0xde84('0x44'),_0x272364[_0xde84('0x43')]);this[_0xde84('0x42')](_0x272364[_0xde84('0x43')]);}}catch(_0x1ba68a){logger[_0xde84('0x23')]('[ACW][syncHangupRequest]\x20%s',_0x1ba68a['message']);}};Acw[_0xde84('0x1a')][_0xde84('0xe')]=function(_0x2e0618){try{if(this[_0xde84('0x26')][_0x2e0618[_0xde84('0x1e')]]&&this[_0xde84('0x26')][_0x2e0618[_0xde84('0x1e')]][_0xde84('0x2e')]){logger[_0xde84('0x20')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2e0618['uniqueid']);this[_0xde84('0x42')](_0x2e0618[_0xde84('0x1e')]);}else if(this[_0xde84('0x26')][_0x2e0618[_0xde84('0x43')]]&&this['channels'][_0x2e0618[_0xde84('0x43')]]['attended']){logger[_0xde84('0x20')](_0xde84('0x45'),_0x2e0618[_0xde84('0x43')]);this[_0xde84('0x42')](_0x2e0618['linkedid']);}}catch(_0x2111ba){logger[_0xde84('0x23')](_0xde84('0x46'),_0x2111ba['message']);}};Acw[_0xde84('0x1a')][_0xde84('0x12')]=function(_0x525915){try{if(!_[_0xde84('0x47')](this[_0xde84('0x26')][_0x525915[_0xde84('0x48')]])){this[_0xde84('0x42')](_0x525915[_0xde84('0x48')]);if(this['channels'][_0x525915[_0xde84('0x49')]]){this[_0xde84('0x26')][_0x525915[_0xde84('0x49')]]['attended']=!![];this['channels'][_0x525915[_0xde84('0x4a')]]=this[_0xde84('0x26')][_0x525915[_0xde84('0x49')]];delete this[_0xde84('0x26')][_0x525915[_0xde84('0x49')]];}}else if(!_['isNil'](this[_0xde84('0x26')][_0x525915[_0xde84('0x4a')]])){this[_0xde84('0x42')](_0x525915[_0xde84('0x4a')]);if(this[_0xde84('0x26')][_0x525915['origtransfereruniqueid']]){this[_0xde84('0x26')][_0x525915[_0xde84('0x4b')]][_0xde84('0x2e')]=!![];this[_0xde84('0x26')][_0x525915[_0xde84('0x48')]]=this[_0xde84('0x26')][_0x525915[_0xde84('0x4b')]];delete this['channels'][_0x525915[_0xde84('0x4b')]];}}}catch(_0x4e87d8){logger[_0xde84('0x23')](_0xde84('0x4c'),_0x4e87d8[_0xde84('0x36')]);}};Acw['prototype'][_0xde84('0x14')]=function(_0x4c03ba){try{if(this[_0xde84('0x26')][_0x4c03ba[_0xde84('0x4d')]]){logger[_0xde84('0x20')](_0xde84('0x4e'),JSON[_0xde84('0x3d')](_0x4c03ba[_0xde84('0x4d')]));this['startAcw'](_0x4c03ba[_0xde84('0x4d')]);}else if(this[_0xde84('0x26')][_0x4c03ba[_0xde84('0x4f')]]){logger[_0xde84('0x20')](_0xde84('0x50'),JSON[_0xde84('0x3d')](_0x4c03ba[_0xde84('0x4f')]));this[_0xde84('0x42')](_0x4c03ba['transfererlinkedid']);}}catch(_0x325018){logger[_0xde84('0x23')](_0xde84('0x51'),_0x325018[_0xde84('0x36')]);}};Acw[_0xde84('0x1a')][_0xde84('0x10')]=function(_0x2d0ac3){try{if(this['voiceQueues'][_0x2d0ac3[_0xde84('0x27')]]&&this[_0xde84('0x6')][_0x2d0ac3['queue']][_0xde84('0x52')]===_0xde84('0x53')){if(this['agents'][_0x2d0ac3[_0xde84('0x25')]]){logger['info'](_0xde84('0x54'),_0x2d0ac3[_0xde84('0x1e')],_0x2d0ac3[_0xde84('0x25')],_0x2d0ac3[_0xde84('0x27')]);return RpcUser['savePause'](this['agents'][_0x2d0ac3[_0xde84('0x25')]],_0xde84('0x55'),_0x2d0ac3['uniqueid']);}}}catch(_0x44c5d2){logger[_0xde84('0x23')](_0xde84('0x56'),_0x44c5d2[_0xde84('0x36')]);}};module[_0xde84('0x57')]=Acw; \ No newline at end of file +var _0xda7c=['stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer'];(function(_0x4060ae,_0x4a46d4){var _0x16582b=function(_0x2b691f){while(--_0x2b691f){_0x4060ae['push'](_0x4060ae['shift']());}};_0x16582b(++_0x4a46d4);}(_0xda7c,0xc5));var _0xcda7=function(_0x4033b3,_0x3b7d25){_0x4033b3=_0x4033b3-0x0;var _0x25a184=_0xda7c[_0x4033b3];return _0x25a184;};'use strict';var _=require(_0xcda7('0x0'));var moment=require(_0xcda7('0x1'));var ami=require(_0xcda7('0x2'));var logger=require(_0xcda7('0x3'))(_0xcda7('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xcda7('0x5'));function Acw(_0x5160ce){this[_0xcda7('0x6')]=_0x5160ce[_0xcda7('0x6')];this['agents']=_0x5160ce[_0xcda7('0x7')];this[_0xcda7('0x8')]=_0x5160ce[_0xcda7('0x8')];this[_0xcda7('0x9')]={};ami['on'](_0xcda7('0xa'),this[_0xcda7('0xb')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0xd'),this[_0xcda7('0xe')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0xf'),this[_0xcda7('0x10')]['bind'](this));ami['on'](_0xcda7('0x11'),this['syncAgentRingNoAnswer'][_0xcda7('0xc')](this));ami['on'](_0xcda7('0x12'),this[_0xcda7('0x13')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0x14'),this[_0xcda7('0x15')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0x16'),this[_0xcda7('0x17')][_0xcda7('0xc')](this));}function getDiff(_0x344aa9){var _0x852b99=moment()[_0xcda7('0x18')](0x0);var _0x139bbc=moment(_0x344aa9)[_0xcda7('0x18')](0x0);return _0x852b99[_0xcda7('0x19')](_0x139bbc,_0xcda7('0x1a'));}Acw[_0xcda7('0x1b')]['updateAcw']=function(_0x3e3b4a,_0x611f84){var _0xa20956=this;var _0x191ada=getDiff(_0xa20956[_0xcda7('0x8')][_0x3e3b4a]['lastPauseAt']);clearTimeout(_0xa20956['timers'][_0x3e3b4a]['timer']);_0xa20956['timers'][_0x3e3b4a]['timer']=![];return RpcVoiceAgentReport[_0xcda7('0x1c')]({'acwtime':_0x191ada},_0xa20956[_0xcda7('0x8')][_0x3e3b4a][_0xcda7('0x1d')],_0x3e3b4a)[_0xcda7('0x1e')](function(_0x2f4149){logger['info'](_0xcda7('0x1f'),_0x611f84,_0x191ada,_0x2f4149);})[_0xcda7('0x20')](function(_0x2faac3){logger[_0xcda7('0x21')](_0xcda7('0x22'),_0x611f84,_0x2faac3);})[_0xcda7('0x23')](function(){delete _0xa20956[_0xcda7('0x8')][_0x3e3b4a];});};Acw[_0xcda7('0x1b')][_0xcda7('0x24')]=function(_0x59cd55){try{var _0x4af6aa=this;var _0x3cf969=this[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x25')];var _0x5b0f51=this[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x26')];var _0x263114=this[_0xcda7('0x6')][_0x5b0f51];var _0xd34d01=![];var _0x13cd4d=_0xcda7('0x27');if(_0x263114['mandatoryDisposition']&&_0x263114[_0xcda7('0x28')][_0xcda7('0x29')]){_0xd34d01=!![];_0x13cd4d=_0x263114['mandatoryDispositionPause'][_0xcda7('0x29')];}if(!_0x4af6aa[_0xcda7('0x7')][_0x3cf969]){return Promise['resolve']();}return RpcUser[_0xcda7('0x2a')](_0x4af6aa[_0xcda7('0x7')][_0x3cf969]['id'])[_0xcda7('0x1e')](function(_0x56902c){if(!_0x56902c||_0x56902c[_0xcda7('0x2b')]){logger['info'](_0xcda7('0x2c'),_0x59cd55,_0x3cf969,_0x5b0f51);return;}logger[_0xcda7('0x2d')](_0xcda7('0x2e'),_0x59cd55,_0x3cf969,_0x5b0f51);var _0x586b8c=_0x4af6aa[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x2f')]&&_0x4af6aa[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x30')]?_0x4af6aa[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x30')]:_0x59cd55;return RpcUser['savePause'](_0x4af6aa[_0xcda7('0x7')][_0x3cf969],_0x13cd4d,_0x586b8c)[_0xcda7('0x1e')](function(_0x15c5fb){_0x4af6aa[_0xcda7('0x6')][_0x5b0f51][_0xcda7('0x31')]-=0x1;_0x4af6aa[_0xcda7('0x6')][_0x5b0f51][_0xcda7('0x32')]+=0x1;return _0x15c5fb;});})[_0xcda7('0x1e')](function(_0x3caab6){if(_0xd34d01||!_0x3caab6){return;}_0x4af6aa[_0xcda7('0x8')][_0x3cf969]={};logger[_0xcda7('0x2d')](_0xcda7('0x33'),_0x59cd55,_0x4af6aa['voiceQueues'][_0x5b0f51][_0xcda7('0x34')],_0x3cf969,_0x5b0f51);_0x4af6aa['timers'][_0x3cf969][_0xcda7('0x35')]=setTimeout(_0x4af6aa[_0xcda7('0x36')][_0xcda7('0xc')](_0x4af6aa,_0x3cf969),_0x4af6aa[_0xcda7('0x6')][_0x5b0f51]['acwTimeout']*0x3e8);_0x4af6aa[_0xcda7('0x8')][_0x3cf969][_0xcda7('0x37')]=moment()[_0xcda7('0x38')](_0xcda7('0x39'));_0x4af6aa[_0xcda7('0x8')][_0x3cf969][_0xcda7('0x1d')]=_0x59cd55;_0x4af6aa[_0xcda7('0x8')][_0x3cf969][_0xcda7('0x26')]=_0x5b0f51;_0x4af6aa[_0xcda7('0x8')][_0x3cf969]['updateAcw']=_0x4af6aa[_0xcda7('0x3a')][_0xcda7('0xc')](_0x4af6aa,_0x3cf969,_0x59cd55);})['catch'](function(){logger['error'](_0xcda7('0x33'),_0x59cd55,_0x4af6aa[_0xcda7('0x6')][_0x5b0f51][_0xcda7('0x34')],_0x3cf969,_0x5b0f51);})[_0xcda7('0x23')](function(){delete _0x4af6aa['channels'][_0x59cd55];});}catch(_0x5ed01c){logger['error']('[ACW][START]\x20%s',_0x5ed01c[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0x36')]=function(_0x434039){try{var _0x4cd7d0=this;if(_0x4cd7d0[_0xcda7('0x8')][_0x434039]){_0x4cd7d0['timers'][_0x434039][_0xcda7('0x35')]=![];var _0x3b5ba8=_0x4cd7d0[_0xcda7('0x8')][_0x434039][_0xcda7('0x1d')];var _0x35fb7=_0x4cd7d0[_0xcda7('0x8')][_0x434039][_0xcda7('0x26')];var _0x5741f0=_0x4cd7d0[_0xcda7('0x6')][_0x35fb7]['acwTimeout'];logger[_0xcda7('0x2d')](_0xcda7('0x3c'),_0x3b5ba8,_0x434039);RpcUser['getAgent'](this['agents'][_0x434039]['id'])[_0xcda7('0x1e')](function(_0x4ea837){if(_0x4ea837[_0xcda7('0x3d')]===_0xcda7('0x27')){return RpcUser[_0xcda7('0x3e')](_0x4cd7d0['agents'][_0x434039]);}});RpcVoiceAgentReport[_0xcda7('0x1c')]({'acwtime':_0x5741f0,'agentacw':!![]},_0x3b5ba8,_0x434039)['then'](function(_0x176004){logger['info'](_0xcda7('0x1f'),_0x3b5ba8,_0x5741f0,_0x176004);})['catch'](function(_0x36c17a){logger[_0xcda7('0x21')](_0xcda7('0x22'),_0x3b5ba8,_0x36c17a);});}else{logger['error'](_0xcda7('0x3f'),_0x434039);if(_0x4cd7d0[_0xcda7('0x8')]){logger[_0xcda7('0x2d')]('[ACW][TIMERS]',JSON[_0xcda7('0x40')](_0x4cd7d0[_0xcda7('0x8')]));}}}catch(_0x5c1ebb){logger[_0xcda7('0x21')](_0xcda7('0x41'),_0x5c1ebb[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0xb')]=function(_0x384c85){try{if(this[_0xcda7('0x6')][_0x384c85[_0xcda7('0x26')]]&&(this[_0xcda7('0x6')][_0x384c85['queue']][_0xcda7('0x4')]||this[_0xcda7('0x6')][_0x384c85['queue']][_0xcda7('0x42')])){if(this['agents'][_0x384c85['interface']]){this['channels'][_0x384c85[_0xcda7('0x1d')]]={'queue':_0x384c85[_0xcda7('0x26')],'interface':_0x384c85['interface'],'destlinkedid':_0x384c85[_0xcda7('0x30')]};}}}catch(_0x181b85){logger[_0xcda7('0x21')](_0xcda7('0x43'),_0x181b85[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0x17')]=function(_0x4044c9){try{if(this['voiceQueues'][_0x4044c9['queue']]&&(this[_0xcda7('0x6')][_0x4044c9[_0xcda7('0x26')]][_0xcda7('0x4')]||this['voiceQueues'][_0x4044c9['queue']][_0xcda7('0x42')])){if(this[_0xcda7('0x7')][_0x4044c9[_0xcda7('0x25')]]){this['channels'][_0x4044c9[_0xcda7('0x1d')]]={'queue':_0x4044c9[_0xcda7('0x26')],'interface':_0x4044c9[_0xcda7('0x25')]};}}}catch(_0x3e762b){logger[_0xcda7('0x21')](_0xcda7('0x44'),_0x3e762b[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0xe')]=function(_0x37e9f1){try{if(this[_0xcda7('0x9')][_0x37e9f1['uniqueid']]&&_[_0xcda7('0x45')](this['channels'][_0x37e9f1[_0xcda7('0x1d')]]['attended'])){logger[_0xcda7('0x2d')]('[%s][HANGUP:UNIQUEID]',_0x37e9f1[_0xcda7('0x1d')]);this[_0xcda7('0x24')](_0x37e9f1['uniqueid']);}else if(this[_0xcda7('0x9')][_0x37e9f1[_0xcda7('0x46')]]&&_['isUndefined'](this[_0xcda7('0x9')][_0x37e9f1['linkedid']][_0xcda7('0x2f')])){logger['info'](_0xcda7('0x47'),_0x37e9f1[_0xcda7('0x46')]);this['startAcw'](_0x37e9f1[_0xcda7('0x46')]);}}catch(_0x1f0670){logger[_0xcda7('0x21')]('[ACW][syncHangupRequest]\x20%s',_0x1f0670[_0xcda7('0x3b')]);}};Acw['prototype'][_0xcda7('0x10')]=function(_0x195587){try{if(this[_0xcda7('0x9')][_0x195587['uniqueid']]&&this[_0xcda7('0x9')][_0x195587[_0xcda7('0x1d')]][_0xcda7('0x2f')]){logger[_0xcda7('0x2d')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x195587[_0xcda7('0x1d')]);this[_0xcda7('0x24')](_0x195587['uniqueid']);}else if(this[_0xcda7('0x9')][_0x195587[_0xcda7('0x46')]]&&this[_0xcda7('0x9')][_0x195587[_0xcda7('0x46')]]['attended']){logger[_0xcda7('0x2d')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x195587[_0xcda7('0x46')]);this[_0xcda7('0x24')](_0x195587[_0xcda7('0x46')]);}}catch(_0x10a1f1){logger[_0xcda7('0x21')]('[ACW][syncHangup]\x20%s',_0x10a1f1[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')]['syncAttendedTransfer']=function(_0x148177){try{if(!_['isNil'](this[_0xcda7('0x9')][_0x148177[_0xcda7('0x48')]])){this[_0xcda7('0x24')](_0x148177['transfereeuniqueid']);if(this[_0xcda7('0x9')][_0x148177[_0xcda7('0x49')]]){this['channels'][_0x148177[_0xcda7('0x49')]][_0xcda7('0x2f')]=!![];this['channels'][_0x148177[_0xcda7('0x4a')]]=this[_0xcda7('0x9')][_0x148177[_0xcda7('0x49')]];delete this['channels'][_0x148177[_0xcda7('0x49')]];}}else if(!_[_0xcda7('0x4b')](this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4a')]])){this['startAcw'](_0x148177['transfertargetuniqueid']);if(this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4c')]]){this['channels'][_0x148177[_0xcda7('0x4c')]][_0xcda7('0x2f')]=!![];this[_0xcda7('0x9')][_0x148177['transfereeuniqueid']]=this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4c')]];delete this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4c')]];}}}catch(_0x5a0aea){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x5a0aea[_0xcda7('0x3b')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x511868){try{if(this[_0xcda7('0x9')][_0x511868[_0xcda7('0x4d')]]){logger[_0xcda7('0x2d')](_0xcda7('0x4e'),JSON[_0xcda7('0x40')](_0x511868['transfereruniqueid']));this[_0xcda7('0x24')](_0x511868[_0xcda7('0x4d')]);}else if(this[_0xcda7('0x9')][_0x511868[_0xcda7('0x4f')]]){logger[_0xcda7('0x2d')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xcda7('0x40')](_0x511868[_0xcda7('0x4f')]));this[_0xcda7('0x24')](_0x511868[_0xcda7('0x4f')]);}}catch(_0x46aa63){logger[_0xcda7('0x21')](_0xcda7('0x50'),_0x46aa63[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0x51')]=function(_0x283c80){try{if(this[_0xcda7('0x6')][_0x283c80[_0xcda7('0x26')]]&&this['voiceQueues'][_0x283c80[_0xcda7('0x26')]][_0xcda7('0x52')]===_0xcda7('0x53')){if(this['agents'][_0x283c80[_0xcda7('0x25')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x283c80[_0xcda7('0x1d')],_0x283c80[_0xcda7('0x25')],_0x283c80['queue']);return RpcUser['savePause'](this['agents'][_0x283c80[_0xcda7('0x25')]],_0xcda7('0x54'),_0x283c80[_0xcda7('0x1d')]);}}}catch(_0x4b9a61){logger[_0xcda7('0x21')](_0xcda7('0x55'),_0x4b9a61[_0xcda7('0x3b')]);}};module[_0xcda7('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 5407c70..f32e8c6 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 _0xd21c=['../../config/environment','asterisk','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','catch','[ami.js][fullybooted]','close','exports','asterisk-manager','util','../../config/logger','ami'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0xd21c,0xba));var _0xcd21=function(_0x1e78ca,_0x1f6466){_0x1e78ca=_0x1e78ca-0x0;var _0x486a60=_0xd21c[_0x1e78ca];return _0x486a60;};'use strict';var Manager=require(_0xcd21('0x0'));var BPromise=require('bluebird');var util=require(_0xcd21('0x1'));var logger=require(_0xcd21('0x2'))(_0xcd21('0x3'));var config=require(_0xcd21('0x4'));var ami=new Manager(config[_0xcd21('0x5')]['port'],config[_0xcd21('0x5')]['ip'],config[_0xcd21('0x5')]['username'],config[_0xcd21('0x5')][_0xcd21('0x6')],!![]);ami[_0xcd21('0x7')]();ami[_0xcd21('0x8')]=BPromise[_0xcd21('0x9')](ami['action']);function error(_0x362d3e){logger[_0xcd21('0xa')](util[_0xcd21('0xb')](_0xcd21('0xc'),config['asterisk'][_0xcd21('0xd')],config['asterisk']['ip'],config[_0xcd21('0x5')][_0xcd21('0xe')],util[_0xcd21('0xf')](_0x362d3e,![],null)));}function close(){logger[_0xcd21('0xa')](util[_0xcd21('0xb')](_0xcd21('0x10'),config[_0xcd21('0x5')]['username'],config[_0xcd21('0x5')]['ip'],config[_0xcd21('0x5')][_0xcd21('0xe')]));}ami[_0xcd21('0x11')]=function(){return function(){return ami[_0xcd21('0x8')]({'action':'sipshowregistry'});};};ami[_0xcd21('0x12')]=function(){return function(){return ami[_0xcd21('0x8')]({'action':_0xcd21('0x13')});};};ami[_0xcd21('0x14')]=function(){return function(){return ami['Action']({'action':_0xcd21('0x15')});};};ami[_0xcd21('0x16')]=function(){return function(){return ami[_0xcd21('0x8')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xcd21('0x8')]({'action':_0xcd21('0x17')});};};function connect(){logger[_0xcd21('0x18')](util[_0xcd21('0xb')](_0xcd21('0x19'),config[_0xcd21('0x5')]['username'],config[_0xcd21('0x5')]['ip'],config['asterisk']['port']));ami[_0xcd21('0x1a')](_0xcd21('0xa'),error);ami[_0xcd21('0x1a')]('close',close);}ami['on'](_0xcd21('0x1b'),connect);ami['on'](_0xcd21('0x1c'),function(_0x2d3fac){logger[_0xcd21('0x18')](util[_0xcd21('0xb')](_0xcd21('0x1d'),config[_0xcd21('0x5')]['username'],config['asterisk']['ip'],config['asterisk'][_0xcd21('0xe')],util[_0xcd21('0xf')](_0x2d3fac,![],null)));});ami['on']('fullybooted',function(){logger[_0xcd21('0x18')](util[_0xcd21('0xb')](_0xcd21('0x1e'),config[_0xcd21('0x5')][_0xcd21('0xd')],config[_0xcd21('0x5')]['ip'],config[_0xcd21('0x5')][_0xcd21('0xe')]));return Promise[_0xcd21('0x1f')]()[_0xcd21('0x20')](ami[_0xcd21('0x11')]())[_0xcd21('0x20')](ami[_0xcd21('0x12')]())['then'](ami['actionSipPeerStatus']())[_0xcd21('0x20')](ami[_0xcd21('0x16')]())[_0xcd21('0x20')](ami[_0xcd21('0x21')]())[_0xcd21('0x22')](function(_0x2f0138){logger[_0xcd21('0xa')](_0xcd21('0x23'),util[_0xcd21('0xf')](_0x2f0138,{'showHidden':![],'depth':null}));});});ami[_0xcd21('0x1a')]('error',error);ami['once'](_0xcd21('0x24'),close);module[_0xcd21('0x25')]=ami; \ No newline at end of file +var _0x78d9=['devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','coreshowchannels','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionCoreShowChannels','[ami.js][fullybooted]','close','exports','bluebird','util','../../config/logger','asterisk','port','username','password','keepConnected','Action','promisify','error','actionSipShowRegistry'];(function(_0xe4d8e8,_0x1eefca){var _0x14c0ed=function(_0x4c257f){while(--_0x4c257f){_0xe4d8e8['push'](_0xe4d8e8['shift']());}};_0x14c0ed(++_0x1eefca);}(_0x78d9,0xdb));var _0x978d=function(_0x2e6149,_0x380c23){_0x2e6149=_0x2e6149-0x0;var _0x3a7dce=_0x78d9[_0x2e6149];return _0x3a7dce;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x978d('0x0'));var util=require(_0x978d('0x1'));var logger=require(_0x978d('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x978d('0x3')][_0x978d('0x4')],config[_0x978d('0x3')]['ip'],config[_0x978d('0x3')][_0x978d('0x5')],config[_0x978d('0x3')][_0x978d('0x6')],!![]);ami[_0x978d('0x7')]();ami[_0x978d('0x8')]=BPromise[_0x978d('0x9')](ami['action']);function error(_0x68e53d){logger[_0x978d('0xa')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config['asterisk'][_0x978d('0x4')],util['inspect'](_0x68e53d,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config[_0x978d('0x3')][_0x978d('0x4')]));}ami[_0x978d('0xb')]=function(){return function(){return ami[_0x978d('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x978d('0x8')]({'action':_0x978d('0xc')});};};ami[_0x978d('0xd')]=function(){return function(){return ami[_0x978d('0x8')]({'action':'sippeerstatus'});};};ami[_0x978d('0xe')]=function(){return function(){return ami['Action']({'action':_0x978d('0xf')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x978d('0x8')]({'action':_0x978d('0x10')});};};function connect(){logger['info'](util[_0x978d('0x11')](_0x978d('0x12'),config[_0x978d('0x3')][_0x978d('0x5')],config[_0x978d('0x3')]['ip'],config['asterisk'][_0x978d('0x4')]));ami[_0x978d('0x13')](_0x978d('0xa'),error);ami[_0x978d('0x13')]('close',close);}ami['on']('connect',connect);ami['on'](_0x978d('0x14'),function(_0xd9b273){logger[_0x978d('0x15')](util['format'](_0x978d('0x16'),config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config['asterisk'][_0x978d('0x4')],util[_0x978d('0x17')](_0xd9b273,![],null)));});ami['on'](_0x978d('0x18'),function(){logger[_0x978d('0x15')](util['format'](_0x978d('0x19'),config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config[_0x978d('0x3')][_0x978d('0x4')]));return Promise[_0x978d('0x1a')]()['then'](ami[_0x978d('0xb')]())[_0x978d('0x1b')](ami[_0x978d('0x1c')]())['then'](ami[_0x978d('0xd')]())[_0x978d('0x1b')](ami[_0x978d('0xe')]())['then'](ami[_0x978d('0x1d')]())['catch'](function(_0x488949){logger[_0x978d('0xa')](_0x978d('0x1e'),util['inspect'](_0x488949,{'showHidden':![],'depth':null}));});});ami[_0x978d('0x13')](_0x978d('0xa'),error);ami[_0x978d('0x13')](_0x978d('0x1f'),close);module[_0x978d('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 060e3d6..627c1b0 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0xcb91[_0x5976f8];return _0x179715;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcb91[_0x42cae2];return _0x5f256f;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 784c951..6ef15ad 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 _0x3256=['name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','contacts','message','[getContactDialer2][Empty]','state','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','CAMPAIGN_STATUS','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','content','indexOf','true','then','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','catch','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','uniqueid','type','ivr','queue','answertime','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','calleridname','calleridnum','createHistory','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','pick','strategy','preview','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','idHopper','run','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','countnoanswerretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','dialMachineRetryFrequency','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','resolve','available','talking','pTalking','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','syncQueueSummaryComplete','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','assign','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][Drop]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','loggedIn','predictiveIntervalPauses','milliseconds','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','getSeconds','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','RUNNING','emptyContact','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','./models/history','./models/final','./models/agentComplete','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queuesSummary','agentconnect','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','syncNewExten','varset','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','isUndefined','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format'];(function(_0xa513b4,_0x231147){var _0x35f0e8=function(_0x221e86){while(--_0x221e86){_0xa513b4['push'](_0xa513b4['shift']());}};_0x35f0e8(++_0x231147);}(_0x3256,0x1e0));var _0x6325=function(_0x4550f1,_0xd05947){_0x4550f1=_0x4550f1-0x0;var _0x3254cf=_0x3256[_0x4550f1];return _0x3254cf;};'use strict';var util=require(_0x6325('0x0'));var _=require(_0x6325('0x1'));var uuid=require('uuid');var moment=require(_0x6325('0x2'));var rr=require('rr');var Redis=require(_0x6325('0x3'));var utils=require(_0x6325('0x4'));var hopperUtils=require(_0x6325('0x5'));var ut=require(_0x6325('0x6'));var config=require(_0x6325('0x7'));var logger=require(_0x6325('0x8'))('dialer');var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x6325('0x8'))('predictive');var loggerPredictiveCalls=require(_0x6325('0x8'))(_0x6325('0x9'));var loggerSyncQueueSummary=require(_0x6325('0x8'))(_0x6325('0xa'));var ami=require('../ami');config[_0x6325('0xb')]=_[_0x6325('0xc')](config['redis'],{'host':_0x6325('0xd'),'port':0x18eb});var io=require(_0x6325('0xe'))(new Redis(config[_0x6325('0xb')]));var cmHopper=require(_0x6325('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x6325('0x10'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0x6325('0x11'));var Final=require(_0x6325('0x12'));var AgentComplete=require(_0x6325('0x13'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x6325('0x14'));var ipAgi=process['env'][_0x6325('0x15')]||_0x6325('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x6325('0x17')][_0x6325('0x18')]=function(_0x2decf0){this[_0x6325('0x19')]=this['tail']?this[_0x6325('0x19')]['finally'](_0x2decf0):_0x2decf0();};function Dialer(_0x4fc7fc,_0x368c10){this[_0x6325('0x1a')]=new Sequence();this['preview']=_0x368c10;this[_0x6325('0x1b')]=_0x4fc7fc[_0x6325('0x1b')];this['campaigns']=_0x4fc7fc[_0x6325('0x1c')];this[_0x6325('0x1d')]=_0x4fc7fc[_0x6325('0x1d')];this[_0x6325('0x1e')]=_0x4fc7fc[_0x6325('0x1e')];this[_0x6325('0x1f')]=config[_0x6325('0x1f')]||0x2;this[_0x6325('0x20')]={};this[_0x6325('0x21')]={};this[_0x6325('0x22')]={};this[_0x6325('0x23')]={};this[_0x6325('0x24')]={};this[_0x6325('0x25')]={};this[_0x6325('0x26')]={};this['ivrOriginated']={};this[_0x6325('0x27')]={};this['queueBookedRR']={};this[_0x6325('0x28')]={};ami['on'](_0x6325('0x29'),this[_0x6325('0x2a')]['bind'](this));ami['on']('queuecallerabandon',this[_0x6325('0x2b')][_0x6325('0x2c')](this));ami['on'](_0x6325('0x2d'),this['syncOriginateResponse'][_0x6325('0x2c')](this));ami['on'](_0x6325('0x2e'),this[_0x6325('0x2f')][_0x6325('0x2c')](this));ami['on'](_0x6325('0x30'),this[_0x6325('0xa')][_0x6325('0x2c')](this));ami['on'](_0x6325('0x31'),this['syncQueueSummaryComplete'][_0x6325('0x2c')](this));ami['on'](_0x6325('0x32'),this[_0x6325('0x33')][_0x6325('0x2c')](this));ami['on']('newexten',this[_0x6325('0x34')][_0x6325('0x2c')](this));ami['on'](_0x6325('0x35'),this['syncVarSet'][_0x6325('0x2c')](this));ami['on']('queuemember',this[_0x6325('0x36')][_0x6325('0x2c')](this));ami['on']('queuestatuscomplete',this[_0x6325('0x37')][_0x6325('0x2c')](this));this[_0x6325('0x38')]();this[_0x6325('0x39')]();RpcSetting[_0x6325('0x3a')]()['then'](function(_0x412d33){previewRecallmeReminderInterval=_0x412d33['previewRecallmeReminderInterval'];});}function isNotNull(_0x69600e){return _0x69600e!==null&&!_[_0x6325('0x3b')](_0x69600e);}function msgResponse(_0x2d6faf,_0x5baa6c,_0x38fa73){return{'action':_0x2d6faf,'response':_0x5baa6c,'message':_0x38fa73,'stack':_0x38fa73};}function emit(_0x55145a,_0x51e031,_0x55168e){io['to'](_0x55145a)[_0x6325('0x3c')](_0x51e031,_0x55168e);}function emitOutboundVoiceQueueSummary(_0x110f6f){if(_0x110f6f['type']===_0x6325('0x3d')){logger[_0x6325('0x3e')](_0x6325('0x3f'),util[_0x6325('0x40')](_0x110f6f,{'showHidden':![],'depth':null}));emit(util[_0x6325('0x41')]('voice:queue:%s',_0x110f6f[_0x6325('0x42')]),_0x6325('0x43'),_0x110f6f);}}function checkGetDataPredictive(_0x52fa41){if(isNotNull(_0x52fa41)&&!_[_0x6325('0x44')](_0x52fa41)){loggerPredictive[_0x6325('0x45')](_0x6325('0x46'));loggerPredictive[_0x6325('0x45')](_0x6325('0x47'),_0x52fa41[_0x6325('0x48')]);loggerPredictive[_0x6325('0x45')](_0x6325('0x49'),_0x52fa41[_0x6325('0x4a')]);loggerPredictive[_0x6325('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52fa41['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x6325('0x45')](_0x6325('0x4b'),_0x52fa41[_0x6325('0x4c')]);loggerPredictive['info'](_0x6325('0x4d'),_0x52fa41[_0x6325('0x4e')]);loggerPredictive[_0x6325('0x45')](_0x6325('0x4f'),_0x52fa41[_0x6325('0x50')]);loggerPredictive[_0x6325('0x45')](_0x6325('0x51'));if(_0x52fa41['predictiveIntervalTotalCalls']>0x0){if(!_[_0x6325('0x3b')](_0x52fa41['predictiveIntervalAvgTalktime'])&&_0x52fa41[_0x6325('0x50')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x52fa41[_0x6325('0x4e')])&&_0x52fa41[_0x6325('0x4e')]>0x0){return!![];}loggerPredictive[_0x6325('0x45')](_0x6325('0x52'));}else{loggerPredictive[_0x6325('0x45')](_0x6325('0x53'));}}else{loggerPredictive['info'](_0x6325('0x54'));}return![];}function mergeDataErlangB(_0x2a6c50){return function(_0x32aadb){loggerPredictive['info'](_0x6325('0x55'));loggerPredictive[_0x6325('0x45')](_0x6325('0x56'),_0x32aadb[_0x6325('0x57')]);loggerPredictive[_0x6325('0x45')](_0x6325('0x58'),_0x32aadb['erlangCallToSecond']);loggerPredictive['info'](_0x6325('0x59'),_0x32aadb[_0x6325('0x5a')]);loggerPredictive[_0x6325('0x45')](_0x6325('0x5b'),_0x32aadb[_0x6325('0x5c')]);loggerPredictive[_0x6325('0x45')](_0x6325('0x59'),_0x32aadb[_0x6325('0x5a')]);loggerPredictive['info']('---------------------------');_[_0x6325('0x5d')](_0x2a6c50,_0x32aadb);};}function ifInterval(_0x2216b3,_0x4f8756){if(_[_0x6325('0x3b')](_0x4f8756)){return![];}return utils['getSeconds'](undefined,_0x4f8756)<_0x2216b3*0x3c;}function clearPredictiveAttributes(_0x35ba29){if(_0x35ba29[_0x6325('0x26')]){_0x35ba29['startProgressive']=undefined;loggerPredictive['debug'](_0x35ba29[_0x6325('0x42')],_0x6325('0x5e'));}if(_0x35ba29[_0x6325('0x25')]){_0x35ba29[_0x6325('0x25')]=undefined;loggerPredictive[_0x6325('0x3e')](_0x35ba29[_0x6325('0x42')],'startPredictive\x20value\x20cleared');}if(_0x35ba29[_0x6325('0x5f')]){clearInterval(_0x35ba29[_0x6325('0x5f')]);_0x35ba29[_0x6325('0x5f')]=undefined;loggerPredictive[_0x6325('0x3e')](_0x35ba29[_0x6325('0x42')],_0x6325('0x60'));}}function loggerCatchPredictive(_0x5bfbc0,_0x3a5053){return function(_0x3d3847){loggerPredictive[_0x6325('0x61')](_0x3a5053[_0x6325('0x42')],_0x5bfbc0);loggerPredictive[_0x6325('0x61')](_0x3d3847[_0x6325('0x62')]);clearPredictiveAttributes(_0x3a5053);};}function loggerCatch(_0xc571ee){return function(_0x2d867a){logger[_0x6325('0x61')](_0xc571ee,util[_0x6325('0x40')](_0x2d867a,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x5eff82,_0xf26df5,_0x43a76c){return function(_0x169b6c){utils[_0x6325('0x63')](_0xf26df5,_0x43a76c,0x0);_0xf26df5[_0x6325('0x64')]=0x0;logger[_0x6325('0x61')](_0x5eff82,util[_0x6325('0x40')](_0x169b6c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4dc15d){return function(_0x27dbb1){if(isNotNull(_0x27dbb1)&&isNotNull(_0x27dbb1[0x0])){if(_0x27dbb1[0x0]['contactsRescheduled']>0x0){_0x4dc15d['message']=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x6325('0x45')]('[getContactDialer2][ReScheduled]'+_0x4dc15d[_0x6325('0x42')],_0x27dbb1[0x0][_0x6325('0x65')],_0x6325('0x66'));}else{_0x4dc15d[_0x6325('0x67')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger['info'](_0x6325('0x68')+_0x4dc15d[_0x6325('0x42')]);}}};}function createObjHistory(_0x161b73,_0x4b6e10,_0x28871d,_0x58b94d,_0x5e2c6d){_0x161b73[_0x6325('0x67')]=_0x28871d;var _0x5e57c3=new Action(_0x161b73,_0x4b6e10);var _0x43b7a0=new History(_0x5e57c3);_0x43b7a0[_0x6325('0x69')]=_0x58b94d;_0x43b7a0['statedesc']=_0x5e2c6d;_0x43b7a0[_0x6325('0x6a')]=_0x5e57c3[_0x6325('0x6b')];return _0x43b7a0;}function unlockQueueStatus(_0x1845b4,_0x3dc7e0){setTimeout(function(){if(_['isUndefined'](_0x1845b4['queueStatusComplete'])){loggerBooked['error'](_0x6325('0x6c'),_0x3dc7e0);}_0x1845b4[_0x6325('0x6d')]=!![];loggerBooked[_0x6325('0x45')](_0x6325('0x6e'),_0x3dc7e0,JSON[_0x6325('0x6f')](_['pick'](_0x1845b4,[_0x6325('0x42'),_0x6325('0x6d')])));},0x1f3);}function checkInterval(_0x59cb56){return function(){if(!isNotNull(_0x59cb56['Interval'])){_0x59cb56[_0x6325('0x67')]=utils[_0x6325('0x70')][_0x6325('0x71')];throw _0x59cb56[_0x6325('0x42')]+_0x6325('0x72');}if(!isNotNull(_0x59cb56[_0x6325('0x73')]['Intervals'])){_0x59cb56[_0x6325('0x67')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x59cb56[_0x6325('0x42')]+_0x6325('0x72');}if(!isNotNull(_[_0x6325('0x44')](_0x59cb56['Interval'][_0x6325('0x74')]))){_0x59cb56[_0x6325('0x67')]=utils[_0x6325('0x70')][_0x6325('0x71')];throw _0x59cb56[_0x6325('0x42')]+_0x6325('0x72');}};}function checkIsIVRCampaignActive(_0x32ce44){return function(){if(!utils[_0x6325('0x75')](_0x32ce44)){_0x32ce44[_0x6325('0x67')]=utils['CAMPAIGN_STATUS'][_0x6325('0x76')];throw _0x32ce44['name']+_0x6325('0x77');}};}function emitCampaignSummary(_0x2155f1){if(utils['isIVRCampaign'](_0x2155f1)){emit(util[_0x6325('0x41')]('campaign:ivr:%s',_0x2155f1[_0x6325('0x42')]),'campaign:save',_0x2155f1);}}function loggerCatchQueueSummary(_0x4a7006,_0x293098){return function(_0x2e4325){clearPredictiveAttributes(_0x293098);emitCampaignSummary(_0x293098);loggerSyncQueueSummary[_0x6325('0x3e')](_0x4a7006,util[_0x6325('0x40')](_0x2e4325,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1c5ab2){if(_0x1c5ab2[_0x6325('0x78')]){if(_0x1c5ab2[_0x6325('0x79')]===0x0){_0x1c5ab2[_0x6325('0x78')]=![];_0x1c5ab2[_0x6325('0x67')]=utils[_0x6325('0x70')][_0x6325('0x76')];loggerSyncQueueSummary[_0x6325('0x3e')](_0x6325('0x7a'),_0x1c5ab2[_0x6325('0x42')],'is\x20not\x20active');}else{_0x1c5ab2[_0x6325('0x67')]=utils[_0x6325('0x70')][_0x6325('0x7b')];loggerSyncQueueSummary['debug'](_0x6325('0x7a'),_0x1c5ab2[_0x6325('0x42')],_0x6325('0x7c'));}emitCampaignSummary(_0x1c5ab2);}}function myreject(_0x1e9b1f){return function(_0xf29565){return _0x1e9b1f(msgResponse(_0x6325('0x7d'),'Error',JSON['stringify'](_0xf29565)));};}Dialer[_0x6325('0x17')][_0x6325('0x7e')]=function(_0x57dbbb){return!_[_0x6325('0x3b')](_0x57dbbb)&&_0x57dbbb&&!_['isUndefined'](_0x57dbbb[_0x6325('0x42')])&&!_[_0x6325('0x3b')](_0x57dbbb['active'])&&_0x57dbbb[_0x6325('0x7f')]&&(this[_0x6325('0x1e')][util['format'](_0x6325('0x80'),_0x57dbbb[_0x6325('0x42')])]['status']===_0x6325('0x81')||this[_0x6325('0x1e')][util[_0x6325('0x41')](_0x6325('0x80'),_0x57dbbb['name'])][_0x6325('0x82')]===_0x6325('0x83'));};Dialer[_0x6325('0x17')][_0x6325('0x84')]=function(_0x3c452c){var _0x18f6fe=this;return function(){if(!_0x18f6fe[_0x6325('0x7e')](_0x3c452c[_0x6325('0x85')])){if(!_0x18f6fe[_0x6325('0x7e')](_0x3c452c[_0x6325('0x86')])){_0x3c452c['message']=utils[_0x6325('0x70')][_0x6325('0x87')];throw _0x3c452c[_0x6325('0x42')]+_0x6325('0x88');}}};};Dialer[_0x6325('0x17')]['checkIfTime']=function(_0x574307,_0x409c6d,_0x459bb0,_0x2996c2){var _0xa8c1c0=this;return function(){var _0x3355bf=!![];return _0xa8c1c0[_0x6325('0x89')](_0x574307,_0x409c6d,_0x459bb0,_0x2996c2,_0x3355bf);};};Dialer[_0x6325('0x17')][_0x6325('0x8a')]=function(_0x5563b2,_0x2d1a57,_0x461fdb,_0x416895){var _0x3f8461=this;return function(){var _0x288f07=![];return _0x3f8461[_0x6325('0x89')](_0x5563b2[_0x6325('0x74')],_0x2d1a57,_0x461fdb,_0x416895,_0x288f07);};};Dialer['prototype']['ifTimeIvr']=function(_0x507946,_0x493b6b,_0x1cf403,_0x200c80,_0xe948fb){var _0x21f85d=[];return new Promise(function(_0x3c0ffe,_0x1f506e){if(!isNotNull(_0x507946)){_0x200c80['message']=utils[_0x6325('0x70')][_0x6325('0x71')];return _0x1f506e(msgResponse(_0x6325('0x8b'),_0x6325('0x8c'),_0x1cf403+_0x6325('0x8d')));}if(_[_0x6325('0x44')](_0x507946)){_0x200c80[_0x6325('0x67')]=utils[_0x6325('0x70')][_0x6325('0x8e')];return _0x1f506e(msgResponse('ifTime',_0x6325('0x8c'),_0x1cf403+'\x20Intervals\x20is\x20empty\x20'));}if(_0x493b6b&&_[_0x6325('0x3b')](config[_0x6325('0x8f')][_0x493b6b])){_0x200c80[_0x6325('0x67')]=utils[_0x6325('0x70')][_0x6325('0x90')];return _0x1f506e(msgResponse('ifTime','Failure',_0x1cf403+_0x6325('0x91')+_0x493b6b));}if(_[_0x6325('0x92')](_0x507946)){for(var _0x24e904=0x0;_0x24e904<_0x507946['length'];_0x24e904+=0x1){_0x21f85d[_0x6325('0x93')](ami[_0x6325('0x94')]({'action':_0x6325('0x95'),'command':util['format'](_0x6325('0x96'),_0x507946[_0x24e904]['interval'],!_[_0x6325('0x3b')](config[_0x6325('0x8f')][_0x493b6b])?_0x493b6b:'')})['then'](function(_0x348419){return _0x348419[_0x6325('0x97')][_0x6325('0x98')](_0x6325('0x99'))>=0x0;})['catch'](myreject(_0x1f506e)));}}else{_0x21f85d[_0x6325('0x93')](ami['Action']({'action':'command','command':util[_0x6325('0x41')](_0x6325('0x96'),_0x507946,!_['isUndefined'](config[_0x6325('0x8f')][_0x493b6b])?_0x493b6b:'')})[_0x6325('0x9a')](function(_0x34f0b5){return _0x34f0b5[_0x6325('0x97')][_0x6325('0x98')](_0x6325('0x99'))>=0x0;})['catch'](myreject(_0x1f506e)));}Promise[_0x6325('0x9b')](_0x21f85d)[_0x6325('0x9a')](function(_0x3fdb7b){var _0x128561=_[_0x6325('0x9c')](_0x3fdb7b);if(_0x128561){return _0x3c0ffe(_0x128561);}else{_0x200c80[_0x6325('0x67')]=_0xe948fb?utils[_0x6325('0x70')][_0x6325('0x9d')]:utils['CAMPAIGN_STATUS'][_0x6325('0x9e')];return _0x1f506e(msgResponse(_0x6325('0x9f'),_0x6325('0x8c'),_0x6325('0xa0')+_0xe948fb+'\x20'+_0x1cf403+_0x6325('0xa1')+util[_0x6325('0x40')](_0x507946,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x493b6b));}})[_0x6325('0xa2')](function(_0x508a9b){return _0x1f506e(msgResponse(_0x6325('0x8b'),_0x6325('0x8c'),JSON[_0x6325('0x6f')](_0x508a9b)));});});};Dialer[_0x6325('0x17')][_0x6325('0x38')]=function(){var _0x238fba=this;return cmHopper[_0x6325('0xa3')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x238fba[_0x6325('0xa4')]();},0x3e8);});};Dialer[_0x6325('0x17')][_0x6325('0xa4')]=function(){var _0x4b8c09=this;var _0x14c88b;for(var _0x4fafdd in this[_0x6325('0x1c')]){if(typeof this[_0x6325('0x1c')][_0x4fafdd]!==_0x6325('0xa5')){_0x14c88b=this['campaigns'][_0x4fafdd];if(utils[_0x6325('0xa6')](_0x14c88b)&&utils['isIVRCampaignActive'](_0x14c88b)){_0x14c88b[_0x6325('0x78')]=!![];Promise['resolve']()[_0x6325('0x9a')](checkIsIVRCampaignActive(_0x14c88b))[_0x6325('0x9a')](checkInterval(_0x14c88b))[_0x6325('0x9a')](_0x4b8c09[_0x6325('0x84')](_0x14c88b))[_0x6325('0x9a')](_0x4b8c09[_0x6325('0xa7')](_0x14c88b[_0x6325('0xa8')],_0x14c88b[_0x6325('0xa9')],_0x14c88b[_0x6325('0x42')],_0x14c88b))[_0x6325('0x9a')](_0x4b8c09[_0x6325('0x8a')](_0x14c88b[_0x6325('0x73')],_0x14c88b[_0x6325('0xa9')],_0x14c88b[_0x6325('0x42')],_0x14c88b))[_0x6325('0x9a')](_0x4b8c09[_0x6325('0xaa')](_0x14c88b))[_0x6325('0xa2')](loggerCatchQueueSummary('[syncCampaigns]',_0x14c88b));}else{notSendMessagesCampaign(_0x14c88b);}}}};Dialer[_0x6325('0x17')][_0x6325('0xab')]=function(_0x358bf9){if(_0x358bf9[_0x6325('0xac')]!=='predictive'){clearPredictiveAttributes(_0x358bf9);}switch(_0x358bf9[_0x6325('0xac')]){case _0x6325('0xad'):this['handlePower'](_0x358bf9,0x1);break;case _0x6325('0xae'):this[_0x6325('0xaf')](_0x358bf9,_0x358bf9[_0x6325('0xb0')]);break;case _0x6325('0xb1'):this[_0x6325('0xb1')](_0x358bf9);break;case'booked':this[_0x6325('0xaf')](_0x358bf9,0x1);break;default:logger[_0x6325('0x61')](_0x6325('0xb2'),_0x358bf9['name'],_0x6325('0xb3'));}};Dialer['prototype']['ifTime']=function(_0x247492,_0x5e46f0){var _0x31d12b=_0x247492[_0x6325('0xa9')];var _0x5bb22a=_0x5e46f0?_0x247492[_0x6325('0xa8')]:_0x247492[_0x6325('0x73')]['Intervals'];logger['silly'](_0x6325('0xb4'),_0x5bb22a,_0x31d12b,_0x247492[_0x6325('0x42')],util[_0x6325('0x41')](_0x6325('0xb5'),_0x247492[_0x6325('0x42')],_0x247492['id']));var _0x18c543=null;return Interval['intervalIftime'](_0x5bb22a,_0x31d12b)[_0x6325('0x9a')](function(_0x31d060){if(_0x31d060===!![]){return _0x31d060;}else{_0x247492[_0x6325('0x67')]=_0x5e46f0?utils[_0x6325('0x70')][_0x6325('0x9d')]:utils[_0x6325('0x70')]['OVERTIME_INTERVAL'];_0x18c543=msgResponse(_0x6325('0x9f'),'Failure',_0x6325('0xa0')+_0x5e46f0+'\x20'+_0x247492[_0x6325('0x42')]+_0x6325('0xa1')+util[_0x6325('0x40')](_0x5bb22a,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x31d12b);}if(_0x18c543!==null){logger[_0x6325('0xb6')](_0x6325('0xb7'),_0x18c543);_0x18c543[_0x6325('0xb8')]=_0x5e46f0;throw _0x18c543;}})[_0x6325('0xa2')](function(_0x328ff2){logger['error'](_0x6325('0xb9'),_0x328ff2);throw msgResponse(_0x6325('0x7d'),_0x6325('0xba'),util[_0x6325('0x40')](_0x328ff2,{'showHidden':![],'depth':null}));});};Dialer[_0x6325('0x17')][_0x6325('0x2a')]=function(_0x1e5f85){if(this[_0x6325('0x1b')][_0x1e5f85['queue']]){if(this['uniqueId'][_0x1e5f85[_0x6325('0xbb')]]&&this[_0x6325('0x23')][_0x1e5f85[_0x6325('0xbb')]][_0x6325('0xbc')]!==_0x6325('0xbd')){this['updateOriginated'](this[_0x6325('0x1b')][_0x1e5f85[_0x6325('0xbe')]]);this['uniqueId'][_0x1e5f85[_0x6325('0xbb')]][_0x6325('0xbf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x6325('0x2f')]=function(_0x206398){var _0x160682=this[_0x6325('0x23')][_0x206398[_0x6325('0xbb')]];if(this[_0x6325('0x1b')][_0x206398[_0x6325('0xbe')]]){if(_0x160682&&_0x160682[_0x6325('0xbc')]!==_0x6325('0xbd')){delete this['uniqueId'][_0x206398[_0x6325('0xbb')]];this[_0x6325('0x1b')][_0x206398[_0x6325('0xbe')]]['outboundAnswerCallsDay']+=0x1;var _0x5a5264=new AgentComplete(_0x160682,_0x206398);if(_0x206398[_0x6325('0xc0')]===_0x6325('0xc1')){_0x5a5264['agiafterat']=this['voiceQueues'][_0x206398[_0x6325('0xbe')]][_0x6325('0xc2')]&&this[_0x6325('0x1b')][_0x206398[_0x6325('0xbe')]][_0x6325('0xc3')]?moment()[_0x6325('0x41')](_0x6325('0xc4')):undefined;}hopperUtils['createHistory'](_0x5a5264)[_0x6325('0xa2')](loggerCatch(_0x6325('0xc5')));hopperUtils[_0x6325('0xc6')](_0x5a5264)[_0x6325('0xa2')](loggerCatch(_0x6325('0xc7')));}}};Dialer[_0x6325('0x17')][_0x6325('0x2b')]=function(_0x5a3483){var _0x4498cc=this[_0x6325('0x23')][_0x5a3483['uniqueid']];var _0x3b2d54=this;var _0x3b842d=![];var _0x5dff7b;var _0x44eb5e;if(this['voiceQueues'][_0x5a3483[_0x6325('0xbe')]]){if(_0x4498cc&&_0x4498cc[_0x6325('0xbc')]!==_0x6325('0xbd')){delete this[_0x6325('0x23')][_0x5a3483[_0x6325('0xbb')]];this[_0x6325('0xc8')](this['voiceQueues'][_0x5a3483[_0x6325('0xbe')]]);_0x4498cc[_0x6325('0xc9')]=moment()[_0x6325('0x41')](_0x6325('0xc4'));var _0x22d1df=new QueueCallerAbandon(_0x4498cc,_0x5a3483);if(utils['getSeconds'](_0x4498cc[_0x6325('0xc9')],_0x4498cc[_0x6325('0xca')])>=_0x4498cc[_0x6325('0xcb')]){this[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xcc')]+=0x1;this[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xcd')]+=0x1;this['voiceQueues'][_0x5a3483['queue']][_0x6325('0xce')]+=0x1;_0x22d1df[_0x6325('0x69')]=0xa;_0x22d1df[_0x6325('0xcf')]=_0x6325('0xd0');_0x22d1df[_0x6325('0xd1')]=_0x6325('0xd2');_0x22d1df[_0x6325('0xd3')]=this[_0x6325('0x1b')][_0x5a3483['queue']][_0x6325('0xc2')]?moment()[_0x6325('0x41')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x22d1df[_0x6325('0xd4')]+=0x1;_0x22d1df['countglobal']+=0x1;_0x5dff7b=this[_0x6325('0x1b')][_0x5a3483['queue']]['dialDropRetryFrequency'];_0x44eb5e=this[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xd5')];hopperUtils['verifyAdditionalPhones'](_0x22d1df,_0x22d1df[_0x6325('0x69')],_0x4498cc[_0x6325('0xd6')])[_0x6325('0x9a')](function(_0x43ae02){_0x3b842d=_0x43ae02[_0x6325('0xd7')]==0x1;if(_0x22d1df[_0x6325('0xd4')]>=_0x3b2d54['voiceQueues'][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xd8')]){_0x3b2d54[_0x6325('0xd9')](_0x22d1df,_0x43ae02[_0x6325('0xd7')]);}else{hopperUtils[_0x6325('0xda')]({'active':![],'countdropretry':_0x22d1df[_0x6325('0xd4')],'scheduledat':moment()[_0x6325('0xdb')](_0x3b2d54[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xdc')],_0x6325('0xdd'))[_0x6325('0x41')](_0x6325('0xc4')),'ContactId':_0x4498cc[_0x6325('0xde')],'ListId':_0x4498cc[_0x6325('0xdf')],'VoiceQueueId':_0x4498cc[_0x6325('0xe0')]||undefined,'CampaignId':_0x4498cc[_0x6325('0xe1')]||undefined})[_0x6325('0xa2')](loggerCatch('[rescheduleContact][Drop]'));var _0x2afdd2=new History(_0x22d1df);_0x2afdd2[_0x6325('0x69')]=0xa;_0x2afdd2[_0x6325('0xcf')]=_0x6325('0xd0');_0x2afdd2[_0x6325('0x6b')]=moment()[_0x6325('0x41')](_0x6325('0xc4'));_0x2afdd2[_0x6325('0x6a')]=_0x2afdd2[_0x6325('0x6b')];_0x2afdd2[_0x6325('0xe2')]=_0x22d1df[_0x6325('0xe2')];_0x2afdd2['calleridnum']=_0x22d1df[_0x6325('0xe3')];hopperUtils[_0x6325('0xe4')](_0x2afdd2)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x6325('0x9a')](function(){if(_0x3b842d)hopperUtils['swapAdditionalPhones'](_0x22d1df,_0x5dff7b,_0x44eb5e)[_0x6325('0x9a')](function(){return 0x1;});});}else{this[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x5a3483['queue']][_0x6325('0xe5')]+=0x1;_0x22d1df[_0x6325('0x69')]=0xb;_0x22d1df[_0x6325('0xcf')]=_0x6325('0xe6');_0x22d1df['dropreason']=_0x6325('0xe7');_0x22d1df[_0x6325('0xe8')]+=0x1;_0x22d1df[_0x6325('0xe9')]+=0x1;_0x5dff7b=this['voiceQueues'][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xea')];_0x44eb5e=this[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xd5')];hopperUtils[_0x6325('0xeb')](_0x22d1df,_0x22d1df[_0x6325('0x69')],_0x4498cc[_0x6325('0xd6')])[_0x6325('0x9a')](function(_0x28cd14){if(_0x22d1df[_0x6325('0xe8')]>=_0x3b2d54[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xec')]){_0x3b2d54[_0x6325('0xd9')](_0x22d1df,_0x28cd14[_0x6325('0xd7')]);}else{hopperUtils[_0x6325('0xda')]({'active':![],'countabandonedretry':_0x22d1df[_0x6325('0xe8')],'scheduledat':moment()[_0x6325('0xdb')](_0x3b2d54[_0x6325('0x1b')][_0x5a3483[_0x6325('0xbe')]][_0x6325('0xea')],'minutes')[_0x6325('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4498cc[_0x6325('0xde')],'ListId':_0x4498cc['ListId'],'VoiceQueueId':_0x4498cc[_0x6325('0xe0')]||undefined,'CampaignId':_0x4498cc[_0x6325('0xe1')]||undefined})[_0x6325('0xa2')](loggerCatch(_0x6325('0xed')));var _0x4dd704=new History(_0x22d1df);_0x4dd704[_0x6325('0x69')]=0xb;_0x4dd704[_0x6325('0xcf')]=_0x6325('0xe6');_0x4dd704['starttime']=moment()[_0x6325('0x41')](_0x6325('0xc4'));_0x4dd704[_0x6325('0x6a')]=_0x4dd704[_0x6325('0x6b')];_0x4dd704['calleridname']=_0x22d1df[_0x6325('0xe2')];_0x4dd704[_0x6325('0xe3')]=_0x22d1df[_0x6325('0xe3')];hopperUtils[_0x6325('0xe4')](_0x4dd704)[_0x6325('0xa2')](loggerCatch(_0x6325('0xee')));}})[_0x6325('0x9a')](function(){if(_0x3b842d)hopperUtils[_0x6325('0xef')](_0x22d1df,_0x5dff7b,_0x44eb5e)[_0x6325('0x9a')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x6325('0x34')]=function(_0x1697b0){if(this[_0x6325('0x21')][_0x1697b0['uniqueid']]){this[_0x6325('0x21')][_0x1697b0[_0x6325('0xbb')]][_0x6325('0xf0')]=_0x1697b0[_0x6325('0xf0')];}if(this[_0x6325('0x23')][_0x1697b0[_0x6325('0xbb')]]){this[_0x6325('0x23')][_0x1697b0[_0x6325('0xbb')]][_0x6325('0xf0')]=_0x1697b0[_0x6325('0xf0')];}};Dialer[_0x6325('0x17')][_0x6325('0x36')]=function(_0xbd4e6f){if(!this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]]){return;}var _0x3baab9=this[_0x6325('0x1b')][this['actions'][_0xbd4e6f['actionid']][_0x6325('0xbe')]]['strategy']||_0x6325('0xf2');if(_0x3baab9===_0x6325('0xf3')){if(this['actions'][_0xbd4e6f[_0x6325('0xf1')]]&&_[_0x6325('0xf4')](this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]][_0x6325('0xf5')])&&_0xbd4e6f[_0x6325('0x82')]==='1'&&_0xbd4e6f[_0x6325('0xf6')]==='0'){if(this[_0x6325('0x1d')][_0xbd4e6f[_0x6325('0xf7')]]){if(!this[_0x6325('0x1d')][_0xbd4e6f[_0x6325('0xf7')]][_0x6325('0xf5')]){this[_0x6325('0x1d')][_0xbd4e6f[_0x6325('0xf7')]][_0x6325('0xf5')]=!![];this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]][_0x6325('0xf5')]=!![];this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]]['stateinterface']=_0xbd4e6f[_0x6325('0xf7')];}}}}else if(_0x3baab9==='rrmemory'){if(this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]]){if(this[_0x6325('0x1d')][_0xbd4e6f[_0x6325('0xf7')]]){this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]][_0x6325('0xf7')]=_0xbd4e6f[_0x6325('0xf7')];if(_[_0x6325('0xf4')](this['queueBooked'][this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]][_0x6325('0xbe')]])){this[_0x6325('0x27')][this[_0x6325('0x21')][_0xbd4e6f[_0x6325('0xf1')]]['queue']]=[];}this[_0x6325('0x27')][this[_0x6325('0x21')][_0xbd4e6f['actionid']]['queue']][_0x6325('0x93')](_[_0x6325('0x5d')](_[_0x6325('0xf8')](this['actions'][_0xbd4e6f[_0x6325('0xf1')]],['idHopper',_0x6325('0xf7')]),{'status':_0xbd4e6f[_0x6325('0x82')],'paused':_0xbd4e6f[_0x6325('0xf6')]}));}}}};Dialer[_0x6325('0x17')][_0x6325('0x37')]=function(_0x222b33){if(!this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]]){return;}var _0x5c7caa=this;var _0x44b6ff=this[_0x6325('0x1b')][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]];var _0x4c11d2=_0x44b6ff[_0x6325('0xf9')]||_0x6325('0xf2');if(_0x4c11d2==='roundrobin'){if(this['actions'][_0x222b33[_0x6325('0xf1')]]&&this['actions'][_0x222b33[_0x6325('0xf1')]][_0x6325('0xf7')]){this[_0x6325('0xfa')]['run'](this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]]['idHopper'],this['actions'][_0x222b33[_0x6325('0xf1')]]['stateinterface'])[_0x6325('0xa2')](function(_0x11840a){logger['error'](_0x6325('0xfb'),util['inspect'](_0x11840a,{'showHidden':![],'depth':null}));})[_0x6325('0xfc')](function(){_0x5c7caa[_0x6325('0xc8')](_0x5c7caa[_0x6325('0x1b')][_0x5c7caa[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]]);_0x5c7caa['agents'][_0x5c7caa[_0x6325('0x21')][_0x222b33['actionid']][_0x6325('0xf7')]][_0x6325('0xf5')]=![];delete _0x5c7caa['actions'][_0x222b33[_0x6325('0xf1')]];unlockQueueStatus(_0x44b6ff);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xde')],'ListId':this['actions'][_0x222b33['actionid']][_0x6325('0xdf')],'VoiceQueueId':this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xe0')]||undefined,'CampaignId':this[_0x6325('0x21')][_0x222b33['actionid']][_0x6325('0xe1')]||undefined})[_0x6325('0xa2')](loggerCatch(_0x6325('0xfd')));delete this['actions'][_0x222b33[_0x6325('0xf1')]];unlockQueueStatus(_0x44b6ff);}}else if(_0x4c11d2===_0x6325('0xf2')){var _0x1a941b;if(this['actions'][_0x222b33[_0x6325('0xf1')]]&&!_['isEmpty'](this[_0x6325('0x27')][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]])){if(this[_0x6325('0xfe')][_0x5c7caa[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]]){this[_0x6325('0xfe')][_0x5c7caa[_0x6325('0x21')][_0x222b33['actionid']][_0x6325('0xbe')]]=this['queueBookedRR'][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]]?this[_0x6325('0xfe')][this['actions'][_0x222b33['actionid']][_0x6325('0xbe')]]:this[_0x6325('0x27')][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]]['queue']]?this['queueBooked'][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]]['_rr']||0x0:0x0;}this[_0x6325('0x27')][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]][_0x6325('0xff')]=this['queueBookedRR'][this[_0x6325('0x21')][_0x222b33[_0x6325('0xf1')]][_0x6325('0xbe')]];for(var _0x4b5f5e=0x0;_0x4b5f5e=_0x1b2d3d['dialGlobalMaxRetry']){_0x3ccfee['stateGlobal'](_0x4160d6,_0x227a8f,_0x4b3ece,_0x6325('0x12c'));}else{if(_0x4160d6[_0x6325('0x125')]>=_0x1b2d3d['dialMachineMaxRetry']){_0x3ccfee[_0x6325('0x12d')](_0x4160d6,_0x227a8f,_0x4b3ece,_0x6325('0x12e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4160d6[_0x6325('0x125')],'scheduledat':moment()[_0x6325('0xdb')](_0x1b2d3d['dialMachineRetryFrequency'],_0x6325('0xdd'))[_0x6325('0x41')](_0x6325('0xc4')),'ContactId':_0x4160d6['ContactId'],'ListId':_0x4160d6[_0x6325('0xdf')],'VoiceQueueId':_0x4160d6[_0x6325('0xe0')]||undefined,'CampaignId':_0x4160d6[_0x6325('0xe1')]||undefined})['catch'](loggerCatch(_0x6325('0x12f')));_0x227a8f({'reschedule':0x1});}}});}if(_0x2d390e[_0x6325('0xbc')]===_0x6325('0xbd')&&this['campaigns'][_0x2d390e['queue']][_0x6325('0x116')]&&_0x4ad650[_0x6325('0x117')]===_0x6325('0x118')){delete this[_0x6325('0x23')][_0x4ad650[_0x6325('0xbb')]];this[_0x6325('0xc8')](this[_0x6325('0x1c')][_0x2d390e['queue']]);_0x5190d0=new Hangup(_0x2d390e,_0x4ad650);_0x5190d0[_0x6325('0x69')]=0x12;_0x5190d0[_0x6325('0xcf')]=_0x6325('0x11b');_0x5190d0[_0x6325('0x11c')]=_0x6325('0x11d');ami[_0x6325('0x3c')]('custom:amd',ut[_0x6325('0x11e')](_0x5190d0,_0x6325('0x11f')));this[_0x6325('0x120')](_0x5190d0,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x2d390e[_0x6325('0xbc')]===_0x6325('0xbd')&&this[_0x6325('0x1c')][_0x2d390e[_0x6325('0xbe')]][_0x6325('0x116')]&&_0x4ad650['value']===_0x6325('0x123')){return new Promise(function(_0x2d8d20,_0x3c9f97){delete _0x3ccfee[_0x6325('0x23')][_0x4ad650[_0x6325('0xbb')]];_0x3ccfee[_0x6325('0xc8')](_0x3ccfee[_0x6325('0x1c')][_0x2d390e[_0x6325('0xbe')]]);_0x3ccfee[_0x6325('0x1c')][_0x2d390e[_0x6325('0xbe')]][_0x6325('0x119')]+=0x1;_0x3ccfee[_0x6325('0x1c')][_0x2d390e[_0x6325('0xbe')]][_0x6325('0x11a')]+=0x1;var _0x280ad4=_0x3ccfee[_0x6325('0x1c')][_0x2d390e[_0x6325('0xbe')]];var _0x8dae4a=new Hangup(_0x2d390e,_0x4ad650);_0x8dae4a[_0x6325('0x69')]=0x13;_0x8dae4a[_0x6325('0xcf')]='Machine';_0x8dae4a[_0x6325('0x11c')]=_0x6325('0x11d');_0x8dae4a['countmachineretry']+=0x1;_0x8dae4a['countglobal']+=0x1;_0x8dae4a[_0x6325('0x11f')]=!![];ami[_0x6325('0x3c')](_0x6325('0x126'),ut[_0x6325('0x11e')](_0x8dae4a,_0x6325('0x11f')));hopperUtils['createHistory'](_0x8dae4a)[_0x6325('0xa2')](loggerCatch(_0x6325('0x127')));if(_0x8dae4a['countbusyretry']+_0x8dae4a[_0x6325('0x129')]+_0x8dae4a[_0x6325('0x130')]+_0x8dae4a['countnosuchnumberretry']+_0x8dae4a[_0x6325('0xd4')]+_0x8dae4a[_0x6325('0xe8')]+_0x8dae4a[_0x6325('0x125')]+_0x8dae4a['countagentrejectretry']>=_0x280ad4[_0x6325('0x131')]){_0x3ccfee[_0x6325('0x132')](_0x8dae4a,_0x2d8d20,_0x3c9f97,_0x6325('0x12c'));}else{if(_0x8dae4a[_0x6325('0x125')]>=_0x280ad4[_0x6325('0x133')]){_0x3ccfee['createStateFinal'](_0x8dae4a,_0x2d8d20,_0x3c9f97,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x8dae4a['countmachineretry'],'scheduledat':moment()['add'](_0x280ad4[_0x6325('0x134')],_0x6325('0xdd'))[_0x6325('0x41')](_0x6325('0xc4')),'ContactId':_0x8dae4a[_0x6325('0xde')],'ListId':_0x8dae4a[_0x6325('0xdf')],'VoiceQueueId':_0x8dae4a[_0x6325('0xe0')]||undefined,'CampaignId':_0x8dae4a[_0x6325('0xe1')]||undefined})['catch'](loggerCatch(_0x6325('0x12f')));_0x2d8d20({'reschedule':0x1});}}});}}};Dialer[_0x6325('0x17')][_0x6325('0x33')]=function(_0x3f9202){var _0x7bfad4=this[_0x6325('0x23')][_0x3f9202[_0x6325('0xbb')]];var _0x53293f;if(_0x7bfad4&&_0x7bfad4[_0x6325('0xbc')]===_0x6325('0xbd')){delete this['uniqueId'][_0x3f9202[_0x6325('0xbb')]];this['updateOriginated'](this[_0x6325('0x1c')][_0x7bfad4[_0x6325('0xbe')]]);this[_0x6325('0x1c')][_0x7bfad4[_0x6325('0xbe')]]['ivrAnswerCallsDay']+=0x1;_0x53293f=new Hangup(_0x7bfad4,_0x3f9202);hopperUtils[_0x6325('0xe4')](_0x53293f)[_0x6325('0xa2')](loggerCatch(_0x6325('0x135')));hopperUtils[_0x6325('0xc6')](_0x53293f)[_0x6325('0xa2')](loggerCatch('[syncHangupIvr]'));}if(_0x7bfad4&&_0x7bfad4[_0x6325('0xbc')]!==_0x6325('0xbd')&&isNotNull(this[_0x6325('0x1b')][_0x7bfad4[_0x6325('0xbe')]][_0x6325('0x136')])){delete this[_0x6325('0x23')][_0x3f9202[_0x6325('0xbb')]];this['updateOriginated'](this[_0x6325('0x1b')][_0x7bfad4['queue']]);this[_0x6325('0x1b')][_0x7bfad4[_0x6325('0xbe')]][_0x6325('0x119')]+=0x1;this[_0x6325('0x1b')][_0x7bfad4[_0x6325('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;_0x53293f=new Hangup(_0x7bfad4,_0x3f9202);_0x53293f[_0x6325('0x69')]=0x10;_0x53293f[_0x6325('0xcf')]=_0x6325('0x137');_0x53293f[_0x6325('0x11c')]=_0x6325('0x138');hopperUtils['createHistory'](_0x53293f)[_0x6325('0xa2')](loggerCatch(_0x6325('0x135')));hopperUtils[_0x6325('0xc6')](_0x53293f)['catch'](loggerCatch(_0x6325('0x139')));}if(_0x7bfad4&&_0x7bfad4[_0x6325('0xbc')]!==_0x6325('0xbd')&&!isNotNull(this[_0x6325('0x1b')][_0x7bfad4[_0x6325('0xbe')]][_0x6325('0x136')])){delete this[_0x6325('0x23')][_0x3f9202[_0x6325('0xbb')]];this[_0x6325('0xc8')](this['voiceQueues'][_0x7bfad4[_0x6325('0xbe')]]);this[_0x6325('0x1b')][_0x7bfad4['queue']]['outboundUnknownCallsDay']+=0x1;_0x53293f=new Hangup(_0x7bfad4,_0x3f9202);_0x53293f['state']=0xc;_0x53293f[_0x6325('0xcf')]=_0x3f9202[_0x6325('0x13a')];_0x53293f['membername']=_0x6325('0x13b');hopperUtils['createHistory'](_0x53293f)[_0x6325('0xa2')](loggerCatch(_0x6325('0x135')));hopperUtils[_0x6325('0xc6')](_0x53293f)[_0x6325('0xa2')](loggerCatch(_0x6325('0x139')));}};Dialer['prototype']['syncQueueSummary']=function(_0x3e6e01){var _0x52e0a5=this;if(!_0x52e0a5[_0x6325('0x28')][_0x3e6e01[_0x6325('0x42')]]){_0x52e0a5[_0x6325('0x28')][_0x3e6e01[_0x6325('0x42')]]={'running':![]};}else if(_0x52e0a5[_0x6325('0x28')][_0x3e6e01[_0x6325('0x42')]]['running']===!![]){return;}else if(_0x52e0a5[_0x6325('0x28')][_0x3e6e01[_0x6325('0x42')]][_0x6325('0x13c')]===![]){_0x52e0a5['queuesSummary'][_0x3e6e01[_0x6325('0x42')]][_0x6325('0x13c')]=!![];}var _0x5ac289=_0x52e0a5[_0x6325('0x1b')][_0x3e6e01['name']];var _0x271688=_0x5ac289['message']!==utils[_0x6325('0x70')][_0x6325('0x76')];var _0x5f0241=utils[_0x6325('0x13d')](_0x5ac289);_0x5ac289[_0x6325('0x13e')]=utils['getQueueCampaignStatusMessage'](_0x5ac289,_0x52e0a5[_0x6325('0x1e')]);Promise[_0x6325('0x13f')]()[_0x6325('0x9a')](function(){if(_0x5ac289[_0x6325('0x13e')]===utils[_0x6325('0x70')]['INACTIVE']){if(_0x271688){clearPredictiveAttributes(_0x5ac289);_0x3e6e01[_0x6325('0x25')]=undefined;_0x3e6e01[_0x6325('0x26')]=undefined;}if(_0x5ac289[_0x6325('0x13e')]===utils[_0x6325('0x70')][_0x6325('0x76')]){_0x3e6e01[_0x6325('0x140')]=0x0;_0x3e6e01[_0x6325('0xf6')]=0x0;_0x3e6e01['inUse']=0x0;_0x3e6e01[_0x6325('0x141')]=0x0;_0x3e6e01[_0x6325('0x142')]=0x0;}}else if(_0x5ac289[_0x6325('0x13e')]===utils['CAMPAIGN_STATUS']['ACTIVE']&&!_0x5f0241){return _0x52e0a5[_0x6325('0x8b')](_0x5ac289,!![])[_0x6325('0x9a')](function(){return _0x52e0a5[_0x6325('0x8b')](_0x5ac289,![]);})[_0x6325('0x9a')](function(){return _0x52e0a5[_0x6325('0xab')](_0x5ac289);})[_0x6325('0xa2')](function(_0x377ff5){loggerSyncQueueSummary[_0x6325('0x3e')](_0x6325('0x143'),util[_0x6325('0x40')](_0x377ff5,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5ac289);});}else{clearPredictiveAttributes(_0x5ac289);}})[_0x6325('0x9a')](function(){var _0xa3ff18=_0x3e6e01[_0x6325('0x144')](_0x5ac289);if(_0xa3ff18||_0x5ac289[_0x6325('0x145')]){_0x5ac289[_0x6325('0x145')]=![];_0x3e6e01[_0x6325('0x146')](_0x5ac289);Object['assign'](_0x5ac289,_0x3e6e01);emitOutboundVoiceQueueSummary(_0x3e6e01);}_0x52e0a5['queuesSummary'][_0x5ac289['name']][_0x6325('0x13c')]=![];})[_0x6325('0xa2')](function(_0xfced1f){logger[_0x6325('0x61')](_0x6325('0x143'),util['inspect'](_0xfced1f,{'showHidden':![],'depth':null}));_0x52e0a5[_0x6325('0x28')][_0x5ac289[_0x6325('0x42')]][_0x6325('0x13c')]=![];});};Dialer[_0x6325('0x17')][_0x6325('0x147')]=_['throttle'](function(){var _0x3efd58=_[_0x6325('0x148')](this['voiceQueues'],function(_0x1713ff){return _0x1713ff[_0x6325('0x149')];});var _0x4a73f6=_[_0x6325('0x148')](this[_0x6325('0x1d')],function(_0x4c423e){return _0x4c423e[_0x6325('0x14a')]&&_0x4c423e[_0x6325('0x82')]===_0x6325('0x81');});if(_0x3efd58[_0x6325('0x100')]>0x0&&_0x4a73f6[_0x6325('0x100')]>0x0){return Promise['resolve']()[_0x6325('0x9a')](cmHopper[_0x6325('0x14b')](_[_0x6325('0x14c')](_0x3efd58,'id'),previewRecallmeReminderInterval,_[_0x6325('0x14c')](_0x4a73f6,'id')))[_0x6325('0x9a')](function(_0x35e388){for(var _0x24ebdd=0x0;_0x24ebdd<_0x35e388[_0x6325('0x100')];_0x24ebdd++){var _0x3a4ef2=_0x35e388[_0x24ebdd][_0x6325('0x14d')][_0x6325('0x42')];if(_0x3a4ef2)io['to'](util['format'](_0x6325('0x14e'),_0x3a4ef2))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x35e388[_0x24ebdd]});}})[_0x6325('0xa2')](function(_0x50f771){logger[_0x6325('0x61')](_0x6325('0x14f'),_0x50f771);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x6325('0x17')][_0x6325('0x39')]=function(){var _0x18d5cb=this;setInterval(function(){_0x18d5cb['clearZombieChannels'](_0x18d5cb[_0x6325('0x23')],_0x6325('0x150'));_0x18d5cb[_0x6325('0x151')](_0x18d5cb[_0x6325('0x21')],'[actions]');},0x32c8);};Dialer[_0x6325('0x17')]['clearZombieChannels']=function(_0x3546bf,_0x4b2410){var _0x4e33a0=this;for(var _0x3d32d0 in _0x3546bf){if(typeof _0x3546bf[_0x3d32d0]!==_0x6325('0xa5')){this[_0x6325('0x1a')][_0x6325('0x18')](function(){if(!_[_0x6325('0xf4')](_0x3546bf[_0x3d32d0])){return ami['Action']({'action':_0x6325('0x82'),'channel':_0x3546bf[_0x3d32d0][_0x6325('0xf0')]})['catch'](function(_0x10eec2){if(_0x10eec2[_0x6325('0x67')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3546bf[_0x3d32d0]&&_0x3546bf[_0x3d32d0][_0x6325('0xbc')]!=='ivr'){_0x4e33a0[_0x6325('0xc8')](_0x4e33a0['voiceQueues'][_0x3546bf[_0x3d32d0][_0x6325('0xbe')]]);logger[_0x6325('0x61')](_0x6325('0x152'),_0x4b2410,_0x3d32d0,_0x3546bf[_0x3d32d0]['queue']);delete _0x3546bf[_0x3d32d0];}if(_0x3546bf[_0x3d32d0]&&_0x3546bf[_0x3d32d0][_0x6325('0xbc')]===_0x6325('0xbd')){_0x4e33a0['updateOriginated'](_0x4e33a0[_0x6325('0x1c')][_0x3546bf[_0x3d32d0][_0x6325('0xbe')]]);logger[_0x6325('0x61')](_0x6325('0x153'),_0x4b2410,_0x3d32d0,_0x3546bf[_0x3d32d0][_0x6325('0xbe')]);delete _0x3546bf[_0x3d32d0];}},0x2328);}});}});}}};Dialer[_0x6325('0x17')][_0x6325('0x154')]=function(_0x420320){return Promise[_0x6325('0x13f')]()['then'](voiceQueueRt[_0x6325('0x154')](_0x420320))['catch'](loggerCatch(_0x6325('0x155')));};Dialer['prototype'][_0x6325('0xc8')]=function(_0x1283d9){if(!_[_0x6325('0x3b')](_0x1283d9)&&_0x1283d9!==null){if(typeof _0x1283d9[_0x6325('0x79')]!==_0x6325('0xa5')){if(_0x1283d9[_0x6325('0x79')]>0x0){_0x1283d9[_0x6325('0x79')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6325('0x61')](_0x6325('0x156'));}};Dialer[_0x6325('0x17')][_0x6325('0x157')]=function(_0x3c8c43,_0xdc6839){var _0x55e78e=this;return function(_0x3ecca5){_0x55e78e[_0x6325('0xc8')](_0xdc6839);logger[_0x6325('0x61')](_0x3c8c43,util['inspect'](_0x3ecca5,{'showHidden':![],'depth':null}));};};Dialer[_0x6325('0x17')]['emptyContact']=function(_0x1c1825,_0x299feb,_0x37c7ac){var _0x452008={'state':0x19,'statedesc':_0x6325('0x158')};this[_0x6325('0xc8')](_0x299feb);this[_0x6325('0x120')](_[_0x6325('0x5d')](_0x452008,_[_0x6325('0xf8')](_0x37c7ac,[_0x6325('0xde'),_0x6325('0xdf'),_0x6325('0x159'),_0x6325('0xe0'),_0x6325('0xe1')])),_0x6325('0x15a'),_0x6325('0x15b'));logger['error'](_0x1c1825);};Dialer[_0x6325('0x17')][_0x6325('0x120')]=function(_0x57f756,_0x3f2096,_0x1d615a){hopperUtils['createHistory'](_0x57f756)['catch'](loggerCatch(_0x3f2096));hopperUtils['moveContactManagedDialer'](_0x57f756)[_0x6325('0xa2')](loggerCatch(_0x1d615a));};Dialer[_0x6325('0x17')][_0x6325('0xd9')]=function(_0x269cdd,_0x9f6bb1){hopperUtils['createHistory'](_0x269cdd)[_0x6325('0xa2')](loggerCatch(_0x6325('0xc5')));if(_0x9f6bb1==0x0){hopperUtils[_0x6325('0xc6')](_0x269cdd)[_0x6325('0xa2')](loggerCatch(_0x6325('0x15c')));}};Dialer['prototype'][_0x6325('0x14f')]=function(_0x1335ca){return Promise[_0x6325('0x13f')]()[_0x6325('0x9a')](cmHopper[_0x6325('0x14b')](_0x1335ca['id'],previewRecallmeReminderInterval))[_0x6325('0x9a')](function(_0x5bbd41){for(var _0x3ffa3d=0x0;_0x3ffa3d<_0x5bbd41[_0x6325('0x100')];_0x3ffa3d++){var _0x1e4560=_0x5bbd41[_0x3ffa3d]['Agent'][_0x6325('0x42')];if(_0x1e4560)io['to'](util[_0x6325('0x41')]('user:%s',_0x1e4560))[_0x6325('0x3c')](_0x6325('0x15d'),{'hopper':_0x5bbd41[_0x3ffa3d]});}})['catch'](function(){});};Dialer['prototype'][_0x6325('0xaa')]=function(_0x5a5542){var _0x132b3c=this;return function(){_0x132b3c[_0x6325('0x15e')](_0x5a5542);};};Dialer[_0x6325('0x17')]['actionOriginate']=function(_0x1a44de,_0x4b5f23){var _0x140c9e=this;var _0x2c93a5=uuid['v4']();this['actions'][_0x2c93a5]=new Action(_0x1a44de,_0x4b5f23,_0x2c93a5);return new Promise(function(_0x5b3cd2,_0x5c1b9a){if(_[_0x6325('0x3b')](_0x1a44de)&&typeof _0x1a44de!==_0x6325('0x15f')){return _0x5c1b9a(msgResponse(_0x6325('0x160'),_0x6325('0x8c'),_0x6325('0x161')));}if(_[_0x6325('0x3b')](_0x4b5f23['phone'])||_0x4b5f23[_0x6325('0x162')]===null){return _0x5c1b9a(msgResponse(_0x6325('0x160'),_0x6325('0x8c'),_0x6325('0x163')));}var _0x52686d={'XMD-CALLERID':_0x140c9e[_0x6325('0x21')][_0x2c93a5]['getCaller'](),'XMD-AGI':_0x1a44de[_0x6325('0x136')]?util[_0x6325('0x41')](_0x6325('0x164'),ipAgi,_0x1a44de[_0x6325('0x136')]):_0x6325('0x165'),'XMD-AGIAFTER':_0x1a44de[_0x6325('0xc2')]?util[_0x6325('0x41')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1a44de[_0x6325('0xc2')]):'NONE','XMD-QUEUE':utils[_0x6325('0x166')](_0x1a44de)?util['format'](_0x6325('0x167'),_0x1a44de[_0x6325('0x42')],_0x1a44de[_0x6325('0x168')]||'',_0x1a44de[_0x6325('0xc3')]?'c':'',_0x1a44de[_0x6325('0xcb')]||0x3):_0x6325('0x165'),'XMD-CONTACTID':_0x4b5f23[_0x6325('0xde')],'XMD-CDRTYPE':_0x6325('0x169'),'CALLERID(all)':_0x140c9e[_0x6325('0x21')][_0x2c93a5][_0x6325('0x16a')](),'XMD-AMD':_0x1a44de[_0x6325('0x116')]?_0x6325('0x16b'):_0x6325('0x165'),'XMD-DESTINATION':_0x6325('0x115')};if(_0x1a44de[_0x6325('0x116')]){_0x52686d[_0x6325('0x16c')]=_0x1a44de[_0x6325('0x16d')]||0x9c4;_0x52686d[_0x6325('0x16e')]=_0x1a44de[_0x6325('0x16f')]||0x5dc;_0x52686d[_0x6325('0x170')]=_0x1a44de[_0x6325('0x171')]||0x320;_0x52686d[_0x6325('0x172')]=_0x1a44de[_0x6325('0x173')]||0x1388;_0x52686d[_0x6325('0x174')]=_0x1a44de[_0x6325('0x175')]||0x64;_0x52686d['XMD-AMDBETWEENWORDSSILENCE']=_0x1a44de['dialAMDBetweenWordsSilence']||0x32;_0x52686d[_0x6325('0x176')]=_0x1a44de['dialAMDMaximumNumberOfWords']||0x3;_0x52686d['XMD-AMDSILENCETHRESHOLD']=_0x1a44de['dialAMDSilenceThreshold']||0x100;_0x52686d[_0x6325('0x177')]=_0x1a44de[_0x6325('0x178')]||0x1388;}if(utils[_0x6325('0x166')](_0x1a44de)){_0x52686d['XMD-VOICEQUEUEID']=_0x4b5f23[_0x6325('0xe0')];}else{_0x52686d[_0x6325('0x179')]=_0x4b5f23[_0x6325('0xe1')];}var _0x287a68=utils['setXMDContactVariables'](_0x4b5f23[_0x6325('0x17a')]);Object[_0x6325('0x17b')](_0x52686d,_0x287a68);var _0x1cbbc3=_0x140c9e[_0x6325('0x7e')](_0x1a44de[_0x6325('0x85')])?utils[_0x6325('0x17c')](_0x1a44de[_0x6325('0x85')][_0x6325('0x17d')],_0x1a44de[_0x6325('0x17e')],_0x1a44de['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x6325('0x17f')](_0x1a44de[_0x6325('0x180')],_0x1a44de[_0x6325('0x181')]):_0x1a44de[_0x6325('0x180')]):utils[_0x6325('0x17c')](_[_0x6325('0xf4')](_0x1a44de[_0x6325('0x86')])?_0x1a44de[_0x6325('0x85')]['callerid']:_0x1a44de['TrunkBackup']['callerid'],_0x1a44de['dialOriginateCallerIdName'],_0x1a44de[_0x6325('0x181')]>0x0?utils[_0x6325('0x17f')](_0x1a44de[_0x6325('0x180')],_0x1a44de['dialRandomLastDigitCallerIdNumber']):_0x1a44de[_0x6325('0x180')]);if(_0x1cbbc3){_0x52686d[_0x6325('0x182')]=_0x140c9e[_0x6325('0x21')][_0x2c93a5]['originatecalleridname']=utils[_0x6325('0x183')](_0x1cbbc3);_0x52686d[_0x6325('0x184')]=_0x4b5f23['phone'];}_0x1a44de[_0x6325('0x185')]=_0x52686d;return ami[_0x6325('0x94')]({'actionid':_0x2c93a5,'action':_0x6325('0x160'),'channel':_0x140c9e[_0x6325('0x7e')](_0x1a44de['Trunk'])?util[_0x6325('0x41')](_0x6325('0x186'),_0x1a44de[_0x6325('0x85')][_0x6325('0x42')],isNotNull(_0x1a44de[_0x6325('0x187')])?_0x1a44de[_0x6325('0x187')][_0x6325('0x188')]()||'':'',_0x1a44de['dialCutDigit']>0x0?_0x4b5f23[_0x6325('0x162')][_0x6325('0x189')](_0x1a44de['dialCutDigit']):_0x4b5f23[_0x6325('0x162')]):util[_0x6325('0x41')](_0x6325('0x186'),_[_0x6325('0xf4')](_0x1a44de[_0x6325('0x86')])?_0x1a44de[_0x6325('0x85')]['name']:_0x1a44de['TrunkBackup'][_0x6325('0x42')],isNotNull(_0x1a44de[_0x6325('0x187')])?_0x1a44de[_0x6325('0x187')][_0x6325('0x188')]()||'':'',_0x1a44de[_0x6325('0x18a')]>0x0?_0x4b5f23['phone'][_0x6325('0x189')](_0x1a44de['dialCutDigit']):_0x4b5f23[_0x6325('0x162')]),'callerid':_0x1cbbc3,'Exten':'xcally-motion-dialer','Context':_0x6325('0x18b'),'Priority':'1','variable':_0x52686d,'timeout':(_0x1a44de[_0x6325('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c93a5})[_0x6325('0x9a')](function(_0x10d427){return _0x5b3cd2(_0x10d427);})['catch'](function(_0x3f9852){_0x1a44de[_0x6325('0x18d')]+=0x1;var _0x5b34a7=new History(_0x140c9e[_0x6325('0x21')][_0x2c93a5]);logger[_0x6325('0x61')](util[_0x6325('0x41')](_0x6325('0x18e'),JSON['stringify'](_0x3f9852)));_0x5b34a7[_0x6325('0x69')]=0xe;_0x5b34a7[_0x6325('0xcf')]=_0x6325('0x18f');_0x5b34a7[_0x6325('0x6b')]=moment()[_0x6325('0x41')](_0x6325('0xc4'));_0x5b34a7[_0x6325('0x6a')]=_0x5b34a7[_0x6325('0x6b')];hopperUtils[_0x6325('0xe4')](_0x5b34a7)[_0x6325('0xa2')](loggerCatch('[originate][error]'));_0x140c9e[_0x6325('0xc6')](_0x5b34a7)[_0x6325('0xa2')](loggerCatch(_0x6325('0x190')))[_0x6325('0xfc')](function(){delete _0x140c9e[_0x6325('0x21')][_0x2c93a5];return _0x5c1b9a(msgResponse(_0x6325('0x160'),'Error',_0x6325('0x191')));});});});};Dialer[_0x6325('0x17')][_0x6325('0x192')]=function(_0x40328b,_0x5f584f,_0x4ae626){var _0x23e4d3=new History(_0x5f584f);if(_0x23e4d3[_0x6325('0x128')]+_0x23e4d3[_0x6325('0x129')]+_0x23e4d3['countnoanswerretry']+_0x23e4d3[_0x6325('0x12a')]+_0x23e4d3[_0x6325('0xd4')]+_0x23e4d3[_0x6325('0xe8')]+_0x23e4d3[_0x6325('0x125')]+_0x23e4d3[_0x6325('0x12b')]>=_0x4ae626[_0x6325('0x131')]-0x1){return!![];}switch(_0x40328b){case 0x3:if(_0x23e4d3[_0x6325('0x130')]>=_0x4ae626[_0x6325('0x193')]-0x1){return!![];}hopperUtils[_0x6325('0xda')]({'active':![],'countnoanswerretry':_0x23e4d3[_0x6325('0x130')]+=0x1,'scheduledat':moment()['add'](_0x4ae626['dialNoAnswerRetryFrequency'],_0x6325('0xdd'))[_0x6325('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x23e4d3[_0x6325('0xde')],'ListId':_0x23e4d3[_0x6325('0xdf')],'VoiceQueueId':_0x23e4d3[_0x6325('0xe0')]||undefined,'CampaignId':_0x23e4d3[_0x6325('0xe1')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x23e4d3[_0x6325('0x128')]>=_0x4ae626[_0x6325('0x194')]-0x1){return!![];}hopperUtils[_0x6325('0xda')]({'active':![],'countbusyretry':_0x23e4d3[_0x6325('0x128')]+=0x1,'scheduledat':moment()[_0x6325('0xdb')](_0x4ae626[_0x6325('0x195')],'minutes')['format'](_0x6325('0xc4')),'ContactId':_0x23e4d3[_0x6325('0xde')],'ListId':_0x23e4d3[_0x6325('0xdf')],'VoiceQueueId':_0x23e4d3[_0x6325('0xe0')]||undefined,'CampaignId':_0x23e4d3['CampaignId']||undefined})[_0x6325('0xa2')](loggerCatch(_0x6325('0x196')));break;case 0x8:if(_0x23e4d3[_0x6325('0x129')]>=_0x4ae626['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x6325('0xda')]({'active':![],'countcongestionretry':_0x23e4d3['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x4ae626['dialCongestionRetryFrequency'],_0x6325('0xdd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x23e4d3[_0x6325('0xde')],'ListId':_0x23e4d3[_0x6325('0xdf')],'VoiceQueueId':_0x23e4d3[_0x6325('0xe0')]||undefined,'CampaignId':_0x23e4d3['CampaignId']||undefined})[_0x6325('0xa2')](loggerCatch(_0x6325('0x197')));break;case 0x0:if(_0x23e4d3[_0x6325('0x12a')]>=_0x4ae626[_0x6325('0x198')]-0x1){return!![];}else{hopperUtils[_0x6325('0xda')]({'active':![],'countnosuchnumberretry':_0x23e4d3[_0x6325('0x12a')]+=0x1,'scheduledat':moment()[_0x6325('0xdb')](_0x4ae626['dialNoSuchNumberRetryFrequency'],_0x6325('0xdd'))['format'](_0x6325('0xc4')),'ContactId':_0x23e4d3[_0x6325('0xde')],'ListId':_0x23e4d3['ListId'],'VoiceQueueId':_0x23e4d3[_0x6325('0xe0')]||undefined,'CampaignId':_0x23e4d3[_0x6325('0xe1')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x23e4d3[_0x6325('0xd4')]>=_0x4ae626[_0x6325('0xd8')]-0x1){return!![];}hopperUtils[_0x6325('0xda')]({'active':![],'countdropretry':_0x23e4d3['countdropretry']+=0x1,'scheduledat':moment()[_0x6325('0xdb')](_0x4ae626[_0x6325('0xdc')],'minutes')[_0x6325('0x41')](_0x6325('0xc4')),'ContactId':_0x23e4d3[_0x6325('0xde')],'ListId':_0x23e4d3['ListId'],'VoiceQueueId':_0x23e4d3['VoiceQueueId']||undefined,'CampaignId':_0x23e4d3[_0x6325('0xe1')]||undefined})[_0x6325('0xa2')](loggerCatch(_0x6325('0x199')));break;case 0xb:if(_0x23e4d3[_0x6325('0xe8')]>=_0x4ae626[_0x6325('0xec')]-0x1){return!![];}hopperUtils[_0x6325('0xda')]({'active':![],'countabandonedretry':_0x23e4d3[_0x6325('0xe8')]+=0x1,'scheduledat':moment()[_0x6325('0xdb')](_0x4ae626[_0x6325('0xea')],_0x6325('0xdd'))[_0x6325('0x41')](_0x6325('0xc4')),'ContactId':_0x23e4d3[_0x6325('0xde')],'ListId':_0x23e4d3[_0x6325('0xdf')],'VoiceQueueId':_0x23e4d3[_0x6325('0xe0')]||undefined,'CampaignId':_0x23e4d3['CampaignId']||undefined})[_0x6325('0xa2')](loggerCatch(_0x6325('0xed')));break;case 0x13:if(_0x23e4d3[_0x6325('0x125')]>=_0x4ae626[_0x6325('0x133')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x23e4d3[_0x6325('0x125')]+=0x1,'scheduledat':moment()[_0x6325('0xdb')](_0x4ae626[_0x6325('0x134')],_0x6325('0xdd'))[_0x6325('0x41')](_0x6325('0xc4')),'ContactId':_0x23e4d3[_0x6325('0xde')],'ListId':_0x23e4d3['ListId'],'VoiceQueueId':_0x23e4d3[_0x6325('0xe0')]||undefined,'CampaignId':_0x23e4d3[_0x6325('0xe1')]||undefined})['catch'](loggerCatch(_0x6325('0x12f')));break;case 0x14:if(_0x23e4d3['countagentrejectretry']>=_0x4ae626['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x6325('0xda')]({'active':![],'countagentrejectretry':_0x23e4d3[_0x6325('0x12b')]+=0x1,'scheduledat':moment()[_0x6325('0xdb')](_0x4ae626[_0x6325('0x19a')],'minutes')[_0x6325('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x23e4d3['ContactId'],'ListId':_0x23e4d3['ListId'],'VoiceQueueId':_0x23e4d3[_0x6325('0xe0')]||undefined,'CampaignId':_0x23e4d3[_0x6325('0xe1')]||undefined})['catch'](loggerCatch(_0x6325('0x19b')));break;default:return!![];}};Dialer[_0x6325('0x17')][_0x6325('0x10f')]=function(_0xd3e8d7,_0xc046d7,_0x1cea45){var _0x5c51d8=this;var _0x409043=new History(_0xd3e8d7);var _0x4c8ce4=![];var _0x12f7fd;var _0x203847;return new Promise(function(_0xaa7c5,_0x57acca){if(_['isUndefined'](_0xc046d7)&&typeof _0xc046d7!==_0x6325('0x15f')){return _0x57acca(msgResponse('[callProgressDetecting]',_0x6325('0x8c'),_0x6325('0x19c')));}if(_[_0x6325('0x3b')](_0x1cea45)&&typeof _0x1cea45!==_0x6325('0x15f')){return _0x57acca(msgResponse(_0x6325('0x19d'),_0x6325('0x8c'),_0x6325('0x19e')));}hopperUtils[_0x6325('0xeb')](_0x409043,_0x1cea45[_0x6325('0xc0')],_0xc046d7)['then'](function(_0x361f4d){if(_0x361f4d[_0x6325('0xd7')]==0x1)_0x4c8ce4=!![];switch(_0x1cea45[_0x6325('0xc0')]){case'0':_0xc046d7[_0x6325('0x19f')]+=0x1;_0x409043[_0x6325('0x69')]=0x0;_0x409043[_0x6325('0xcf')]=_0x6325('0x1a0');_0x409043[_0x6325('0x12a')]+=0x1;_0x409043[_0x6325('0xe9')]+=0x1;ami[_0x6325('0x3c')](_0x6325('0x1a1'),ut[_0x6325('0x11e')](_0xd3e8d7,'nosuchnumber'));_0x12f7fd=_0xc046d7[_0x6325('0x1a2')];_0x203847=_0xc046d7['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x409043)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5c51d8[_0x6325('0x192')](0x0,_0xd3e8d7,_0xc046d7)&&!_0x4c8ce4){if(_0x409043['countnosuchnumberretry']>=_0xc046d7[_0x6325('0x198')]){_0x5c51d8[_0x6325('0x12d')](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1a3'));}else{_0x5c51d8['stateGlobal'](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1a3'));}}break;case'3':_0xc046d7['outboundNoAnswerCallsDay']+=0x1;_0x409043[_0x6325('0x69')]=0x3;_0x409043[_0x6325('0xcf')]=_0x6325('0x1a4');_0x409043[_0x6325('0x130')]+=0x1;_0x409043[_0x6325('0xe9')]+=0x1;var _0x512ee2=ut[_0x6325('0x1a5')](_0xd3e8d7,_0xc046d7);ami[_0x6325('0x3c')](_0x6325('0x1a6'),_0x512ee2);_0x12f7fd=_0xc046d7[_0x6325('0x1a7')];_0x203847=_0xc046d7['callAdditionalPhoneAfterMin'];hopperUtils[_0x6325('0xe4')](_0x409043)['catch'](loggerCatch(_0x6325('0x1a8')));if(_0x5c51d8[_0x6325('0x192')](0x3,_0xd3e8d7,_0xc046d7)&&!_0x4c8ce4){if(_0x409043[_0x6325('0x130')]>=_0xc046d7[_0x6325('0x193')]){_0x5c51d8[_0x6325('0x12d')](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1a9'));}else{_0x5c51d8[_0x6325('0x132')](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1a9'));}}break;case'5':_0xc046d7['outboundBusyCallsDay']+=0x1;_0x409043[_0x6325('0x69')]=0x5;_0x409043[_0x6325('0xcf')]='Busy';_0x409043[_0x6325('0x128')]+=0x1;_0x409043['countglobal']+=0x1;ami[_0x6325('0x3c')](_0x6325('0x1aa'),ut[_0x6325('0x11e')](_0xd3e8d7,_0x6325('0x1ab')));_0x12f7fd=_0xc046d7[_0x6325('0x195')];_0x203847=_0xc046d7['callAdditionalPhoneAfterMin'];hopperUtils[_0x6325('0xe4')](_0x409043)[_0x6325('0xa2')](loggerCatch(_0x6325('0x1ac')));if(_0x5c51d8[_0x6325('0x192')](0x5,_0xd3e8d7,_0xc046d7)&&!_0x4c8ce4){if(_0x409043[_0x6325('0x128')]>=_0xc046d7[_0x6325('0x194')]){_0x5c51d8[_0x6325('0x12d')](_0x409043,_0xaa7c5,_0x57acca,'reason\x205\x20busy');}else{_0x5c51d8[_0x6325('0x132')](_0x409043,_0xaa7c5,_0x57acca,'reason\x205\x20busy');}}break;case'8':_0xc046d7['outboundCongestionCallsDay']+=0x1;_0x409043[_0x6325('0x69')]=0x8;_0x409043[_0x6325('0xcf')]=_0x6325('0x1ad');_0x409043['countcongestionretry']+=0x1;_0x409043[_0x6325('0xe9')]+=0x1;_0x12f7fd=_0xc046d7[_0x6325('0x1ae')];_0x203847=_0xc046d7[_0x6325('0xd5')];ami['emit'](_0x6325('0x1af'),ut[_0x6325('0x11e')](_0xd3e8d7,_0x6325('0x1b0')));hopperUtils[_0x6325('0xe4')](_0x409043)[_0x6325('0xa2')](loggerCatch(_0x6325('0x1b1')));if(_0x5c51d8['checkRetriveMax'](0x8,_0xd3e8d7,_0xc046d7)&&!_0x4c8ce4){if(_0x409043[_0x6325('0x129')]>=_0xc046d7['dialCongestionMaxRetry']){_0x5c51d8[_0x6325('0x12d')](_0x409043,_0xaa7c5,_0x57acca,'reason\x208\x20congestion');}else{_0x5c51d8['stateGlobal'](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1b2'));}}break;case'11':_0xc046d7['outboundAbandonedCallsDay']+=0x1;_0x409043[_0x6325('0x69')]=0xb;_0x409043[_0x6325('0xcf')]=_0x6325('0xe6');_0x409043['countabandonedretry']+=0x1;_0x409043['countglobal']+=0x1;_0x12f7fd=_0xc046d7[_0x6325('0xea')];_0x203847=_0xc046d7['callAdditionalPhoneAfterMin'];hopperUtils[_0x6325('0xe4')](_0x409043)[_0x6325('0xa2')](loggerCatch(_0x6325('0xee')));if(_0x5c51d8[_0x6325('0x192')](0xb,_0xd3e8d7,_0xc046d7)&&!_0x4c8ce4){if(_0x409043[_0x6325('0xe8')]>=_0xc046d7[_0x6325('0xec')]){_0x5c51d8['createStateFinal'](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1b3'));}else{_0x5c51d8['stateGlobal'](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1b3'));}}break;case'20':_0xc046d7['outboundRejectCallsDay']+=0x1;_0x409043[_0x6325('0x69')]=0x14;_0x409043[_0x6325('0xcf')]=_0x6325('0x1b4');_0x409043[_0x6325('0x12b')]+=0x1;_0x409043['countglobal']+=0x1;_0x12f7fd=_0xc046d7[_0x6325('0x19a')];_0x203847=_0xc046d7[_0x6325('0xd5')];ami[_0x6325('0x3c')](_0x6325('0x1b5'),ut['buildObj'](_0xd3e8d7,_0x6325('0x1b6')));hopperUtils[_0x6325('0xe4')](_0x409043)[_0x6325('0xa2')](loggerCatch(_0x6325('0x1b7')));if(_0x5c51d8[_0x6325('0x192')](0x14,_0xd3e8d7,_0xc046d7)&&!_0x4c8ce4){if(_0x409043['countagentrejectretry']>=_0xc046d7[_0x6325('0x1b8')]){_0x5c51d8[_0x6325('0x12d')](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1b9'));}else{_0x5c51d8[_0x6325('0x132')](_0x409043,_0xaa7c5,_0x57acca,_0x6325('0x1b9'));}}break;default:_0xc046d7[_0x6325('0x1ba')]+=0x1;_0x409043[_0x6325('0x69')]=0xc;_0x409043[_0x6325('0xcf')]=_0x1cea45[_0x6325('0xc0')];_0x12f7fd=_0xc046d7[_0x6325('0x19a')];_0x203847=_0xc046d7['callAdditionalPhoneAfterMin'];hopperUtils[_0x6325('0xe4')](_0x409043)[_0x6325('0xa2')](loggerCatch(_0x6325('0x1bb')));if(_0x5c51d8['checkRetriveMax'](_0x1cea45[_0x6325('0xc0')],_0xd3e8d7,_0xc046d7)&&!_0x4c8ce4){if(_0x409043[_0x6325('0x128')]+_0x409043['countcongestionretry']+_0x409043[_0x6325('0x130')]+_0x409043[_0x6325('0x12a')]+_0x409043[_0x6325('0xd4')]+_0x409043[_0x6325('0xe8')]+_0x409043[_0x6325('0x125')]+_0x409043[_0x6325('0x12b')]>=_0xc046d7[_0x6325('0x131')]){_0x5c51d8['stateGlobal'](_0x409043,_0xaa7c5,_0x57acca,_0x1cea45['reason']);}else{_0x5c51d8[_0x6325('0x12d')](_0x409043,_0xaa7c5,_0x57acca,_0x1cea45[_0x6325('0xc0')]);}}}})[_0x6325('0x9a')](function(){if(_0x4c8ce4){hopperUtils[_0x6325('0xef')](_0x409043,_0x12f7fd,_0x203847)[_0x6325('0x9a')](function(){return _0xaa7c5(0x1);});}});});};Dialer['prototype'][_0x6325('0x132')]=function(_0x2fa02d,_0xe8fd34,_0x1a3a76,_0x49814b){var _0x5471c9=new Final(_0x2fa02d);_0x5471c9[_0x6325('0x69')]=0xf;_0x5471c9[_0x6325('0xcf')]='Global';this[_0x6325('0x12d')](_0x5471c9,_0xe8fd34,_0x1a3a76,_0x49814b);};Dialer['prototype'][_0x6325('0x12d')]=function(_0x4a2474,_0x28c267,_0x1129a2,_0x51ae5c){hopperUtils[_0x6325('0xc6')](_0x4a2474)['then'](function(){return _0x28c267(msgResponse(_0x6325('0x19d'),_0x6325('0x10e'),_0x51ae5c));})[_0x6325('0xa2')](function(){return _0x1129a2(msgResponse(_0x6325('0x1bc'),'Failure',_0x6325('0x1bd')));});};Dialer['prototype']['predictive']=function(_0x1c9b37){var _0x3b3b09=_0x1c9b37[_0x6325('0x1be')]/0x64;var _0x597010=_0x1c9b37[_0x6325('0xcd')]/(_0x1c9b37[_0x6325('0xcd')]+_0x1c9b37[_0x6325('0x119')]);var _0x346c74=Math['round'](_0x1c9b37[_0x6325('0x1bf')]*(_0x1c9b37['predictiveIntervalMaxThreshold']/0x64));var _0x344136=Math['round'](_0x1c9b37[_0x6325('0x1bf')]*(_0x1c9b37[_0x6325('0x1c0')]/0x64));var _0x4c1558=_0x1c9b37['available']+_0x1c9b37[_0x6325('0x141')];var _0x539d3d=Math[_0x6325('0x1c1')](_0x1c9b37[_0x6325('0x57')]*_0x1c9b37['erlangAbandonmentRate']*_0x1c9b37[_0x6325('0x1c2')]*_0x1c9b37[_0x6325('0x1c3')]);if(_[_0x6325('0x3b')](_0x1c9b37[_0x6325('0x26')])){if(!_['isUndefined'](_0x1c9b37[_0x6325('0x25')])){_0x1c9b37[_0x6325('0x25')]=undefined;loggerPredictive[_0x6325('0x61')](_0x6325('0x1c4'),_0x6325('0x1c5'));}if(!_[_0x6325('0x3b')](_0x1c9b37[_0x6325('0x5f')])){loggerPredictive[_0x6325('0x61')](_0x6325('0x1c4'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x1c9b37[_0x6325('0x5f')]);_0x1c9b37['handlePredictive']=undefined;}_0x1c9b37['startProgressive']=moment()[_0x6325('0x41')](_0x6325('0xc4'));loggerPredictive['info'](_0x1c9b37[_0x6325('0x42')],_0x6325('0x1c6'),_0x1c9b37[_0x6325('0x26')]);this[_0x6325('0xaf')](_0x1c9b37,0x1);}else if(ifInterval(_0x1c9b37[_0x6325('0x1c7')],_0x1c9b37['startProgressive'])){this[_0x6325('0xaf')](_0x1c9b37,0x1);loggerPredictiveCalls[_0x6325('0x45')](_0x6325('0x1c8'),_0x1c9b37[_0x6325('0x26')],_0x1c9b37[_0x6325('0x42')]);_0x1c9b37[_0x6325('0x57')]=0x0;_0x1c9b37[_0x6325('0xce')]=0x0;}else if(_0x3b3b09<_0x597010&&_0x1c9b37[_0x6325('0x1c9')]===_0x6325('0x1ca')){clearPredictiveAttributes(_0x1c9b37);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x6325('0x1cb'),_0x597010,'startProgressive',_0x1c9b37[_0x6325('0x42')]);}else if(_0x539d3d<_0x1c9b37[_0x6325('0xce')]&&_0x1c9b37['dialPredictiveOptimization']===_0x6325('0x1ca')){clearPredictiveAttributes(_0x1c9b37);loggerPredictive[_0x6325('0x45')](_0x6325('0x1cc'),_0x6325('0x1cd'),_0x539d3d,_0x6325('0x1ce'),_0x1c9b37[_0x6325('0xce')],_0x6325('0x26'),_0x1c9b37[_0x6325('0x42')]);}else if(!ifInterval(_0x1c9b37['dialPredictiveInterval'],_0x1c9b37['startProgressive'])&&_[_0x6325('0x3b')](_0x1c9b37[_0x6325('0x25')])&&!_['isUndefined'](_0x1c9b37[_0x6325('0x26')])){_0x1c9b37[_0x6325('0x25')]=moment()[_0x6325('0x41')](_0x6325('0xc4'));loggerPredictive[_0x6325('0x45')](_0x1c9b37[_0x6325('0x42')],'started\x20in\x20predictive\x20at',_0x1c9b37[_0x6325('0x25')]);hopperUtils[_0x6325('0x1cf')](_0x1c9b37[_0x6325('0x1c7')])[_0x6325('0x9a')](this[_0x6325('0x1d0')](_0x1c9b37))['then'](mergeDataErlangB(_0x1c9b37))[_0x6325('0x9a')](this[_0x6325('0x1d1')](_0x1c9b37))[_0x6325('0xa2')](loggerCatchPredictive(_0x6325('0x1d2'),_0x1c9b37));}else if(!ifInterval(_0x1c9b37[_0x6325('0x1c7')],_0x1c9b37[_0x6325('0x25')])){_0x1c9b37['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1c9b37[_0x6325('0x25')]=moment()[_0x6325('0x41')](_0x6325('0xc4'));loggerPredictive[_0x6325('0x45')](_0x1c9b37['name'],_0x6325('0x1d3'),_0x1c9b37['startPredictive']);clearInterval(_0x1c9b37[_0x6325('0x5f')]);_0x1c9b37[_0x6325('0x5f')]=undefined;hopperUtils[_0x6325('0x1cf')](_0x1c9b37['dialPredictiveInterval'])[_0x6325('0x9a')](this[_0x6325('0x1d0')](_0x1c9b37))[_0x6325('0x9a')](mergeDataErlangB(_0x1c9b37))['then'](this['startMethodPredictive'](_0x1c9b37))[_0x6325('0xa2')](loggerCatchPredictive(_0x6325('0x1d4'),_0x1c9b37));}else if(_0x1c9b37[_0x6325('0x1bf')]&&_0x4c1558<_0x1c9b37[_0x6325('0x1bf')]-_0x344136){clearPredictiveAttributes(_0x1c9b37);loggerPredictive['info'](_0x1c9b37[_0x6325('0x42')],_0x6325('0x1d5'),_0x4c1558,')\x20are\x20less\x20than\x20threshold\x20(',_0x1c9b37['predictiveIntervalAvailable'],'-',_0x344136,'=',_0x1c9b37[_0x6325('0x1bf')]-_0x344136,')');}else if(_0x1c9b37[_0x6325('0x1bf')]&&_0x4c1558>_0x1c9b37[_0x6325('0x1bf')]+_0x346c74){clearPredictiveAttributes(_0x1c9b37);loggerPredictive[_0x6325('0x45')](_0x1c9b37[_0x6325('0x42')],_0x6325('0x1d5'),_0x4c1558,_0x6325('0x1d6'),_0x1c9b37['predictiveIntervalAvailable'],'+',_0x346c74,'=',_0x1c9b37[_0x6325('0x1bf')]+_0x346c74,')');}};Dialer[_0x6325('0x17')][_0x6325('0x1d0')]=function(_0x5f268d){var _0x21c2dd=this;return function(_0x15a545){return new Promise(function(_0x20e853,_0x57df34){_['merge'](_0x5f268d,_0x15a545[0x0]);if(checkGetDataPredictive(_0x15a545[0x0])){var _0x1203e3=_0x5f268d[_0x6325('0x1bf')]=_0x5f268d[_0x6325('0x141')]+_0x5f268d[_0x6325('0x140')];var _0x3a0008=_0x5f268d[_0x6325('0x1c7')]*0x3c;var _0xb67478=_0x15a545[0x0][_0x6325('0x50')]+_0x15a545[0x0][_0x6325('0x4e')];var _0x380218=(_0x15a545[0x0][_0x6325('0x4a')]+_0x15a545[0x0][_0x6325('0xcc')]+_0x15a545[0x0][_0x6325('0x4c')])/_0x15a545[0x0]['predictiveIntervalTotalCalls'];_0x5f268d['predictiveIntervalHitRate']=_0x380218>0x0?_0x380218:0x1;switch(_0x5f268d['dialPredictiveOptimization']){case _0x6325('0x1ca'):var _0x1c92be=_0x5f268d[_0x6325('0x1be')]/0x64;return _0x21c2dd[_0x6325('0x1d7')](_0x1203e3,_0x3a0008,_0xb67478,_0x380218,_0x1c92be)[_0x6325('0x9a')](function(_0x2da0f8){return _0x20e853(_0x2da0f8);});case _0x6325('0x1d8'):var _0x496b50=_0x5f268d[_0x6325('0x1be')]/0x64;return _0x21c2dd[_0x6325('0x1d9')](_0x1203e3,_0x3a0008,_0xb67478,_0x380218,_0x496b50)['then'](function(_0x1a0b27){return _0x20e853(_0x1a0b27);});default:return _0x57df34(msgResponse(_0x6325('0x1da'),_0x6325('0x8c'),_0x6325('0x1db')));}}else{return _0x57df34(msgResponse(_0x6325('0x1da'),_0x6325('0x8c'),_0x6325('0x1dc')));}});};};Dialer[_0x6325('0x17')][_0x6325('0x1dd')]=function(_0x52eb48){var _0x5aea94=this;return function(_0x1591e1){return new Promise(function(_0x38cbf5,_0x2e5839){_['merge'](_0x52eb48,_0x1591e1[0x0]);if(checkGetDataPredictive(_0x1591e1[0x0])){loggerPredictive[_0x6325('0x45')](JSON[_0x6325('0x6f')](_0x1591e1[0x0]));if(_0x52eb48['dialPredictiveOptimization']===_0x6325('0x1ca')){return _0x5aea94[_0x6325('0x154')](_0x52eb48['id'])[_0x6325('0x9a')](function(_0x21bdbf){var _0x10f955=_0x52eb48['loggedIn']-_0x21bdbf[0x0][_0x6325('0x1de')];var _0x2a932c=_0x52eb48['dialPredictiveInterval']*0x3c;var _0x5ee84d=_0x1591e1[0x0][_0x6325('0x50')]+_0x1591e1[0x0][_0x6325('0x4e')];var _0x396b27=(_0x1591e1[0x0][_0x6325('0x4a')]+_0x1591e1[0x0][_0x6325('0xcc')]+_0x1591e1[0x0][_0x6325('0x4c')])/_0x1591e1[0x0][_0x6325('0x48')];var _0xc42e93=_0x52eb48['dialPredictiveOptimizationPercentage']/0x64;_0x52eb48['predictiveIntervalPauses']=_0x21bdbf[0x0][_0x6325('0x1de')]||0x0;_0x52eb48['predictiveIntervalHitRate']=_0x396b27>0x0?_0x396b27:0x1;return _0x5aea94[_0x6325('0x1d7')](_0x10f955,_0x2a932c,_0x5ee84d,_0x396b27,_0xc42e93);})[_0x6325('0x9a')](function(_0x555625){return _0x38cbf5(_0x555625);})['catch'](function(_0x32b7e0){return _0x2e5839(msgResponse(_0x6325('0x1df'),_0x6325('0x8c'),JSON[_0x6325('0x6f')](_0x32b7e0)));});}if(_0x52eb48[_0x6325('0x1c9')]===_0x6325('0x1d8')){return _0x5aea94[_0x6325('0x154')](_0x52eb48['id'])[_0x6325('0x9a')](function(_0x4a1dac){var _0x159e94=_0x52eb48[_0x6325('0x1e0')]-_0x4a1dac[0x0][_0x6325('0x1de')];var _0x4d02e7=_0x52eb48[_0x6325('0x1c7')]*0x3c;var _0x7b3f7c=_0x1591e1[0x0]['predictiveIntervalAvgTalktime']+_0x1591e1[0x0][_0x6325('0x4e')];var _0x802809=(_0x1591e1[0x0][_0x6325('0x4a')]+_0x1591e1[0x0][_0x6325('0xcc')]+_0x1591e1[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1591e1[0x0]['predictiveIntervalTotalCalls'];var _0x33e0af=_0x52eb48[_0x6325('0x1be')]/0x64;_0x52eb48[_0x6325('0x1e1')]=_0x4a1dac[0x0][_0x6325('0x1de')]||0x0;_0x52eb48[_0x6325('0x1c2')]=_0x802809>0x0?_0x802809:0x1;return _0x5aea94[_0x6325('0x1d9')](_0x159e94,_0x4d02e7,_0x7b3f7c,_0x802809,_0x33e0af);})[_0x6325('0x9a')](function(_0x147837){return _0x38cbf5(_0x147837);})[_0x6325('0xa2')](function(_0x151fcb){return _0x2e5839(msgResponse(_0x6325('0x1df'),_0x6325('0x8c'),JSON[_0x6325('0x6f')](_0x151fcb)));});}}else{return _0x2e5839(msgResponse('[getDataPredictive]',_0x6325('0x8c'),_0x6325('0x1dc')));}});};};Dialer[_0x6325('0x17')][_0x6325('0x1d1')]=function(_0xafa43c){var _0x251005=this;return function(){var _0x5926fa=0x0;var _0x5380d9=Math[_0x6325('0x1c1')](_0xafa43c['erlangCallToSecond']*0x3e8);if(_0x5380d9>0x0){_0x5380d9=_0x5380d9<0x64?0x64:_0x5380d9;loggerPredictive[_0x6325('0x45')](_0xafa43c[_0x6325('0x42')],'one\x20call\x20every:',_0x5380d9,_0x6325('0x1e2'));_0xafa43c[_0x6325('0x5f')]=setInterval(function(){_0x251005[_0x6325('0x5f')](_0xafa43c);loggerPredictiveCalls['info']('[handlePredictive]',_0x5926fa+=0x1);},_0x5380d9);}else{loggerPredictive[_0x6325('0x45')](_0xafa43c[_0x6325('0x42')],_0x6325('0x1e3'));}};};Dialer[_0x6325('0x17')][_0x6325('0x1e4')]=function(_0x74a551,_0x29dfeb){var _0x28ee96=this;return function(_0x44b376){if(_[_0x6325('0x44')](_0x44b376)){if(_['isNil'](_0x29dfeb[_0x6325('0x159')])||!_0x29dfeb[_0x6325('0x1e5')]){if(_0x74a551[_0x6325('0xac')]===_0x6325('0x1e6')){_0x74a551[_0x6325('0x6d')]=_['isUndefined'](_0x74a551[_0x6325('0x6d')])?!![]:_0x74a551[_0x6325('0x6d')];var _0x39ada9=uuid['v4']();_0x28ee96[_0x6325('0x21')][_0x39ada9]=new Action(_0x74a551,_0x29dfeb,_0x39ada9);loggerBooked[_0x6325('0x45')](_0x6325('0x1e7'),_0x39ada9,'queueStatusComplete:\x20',JSON[_0x6325('0x6f')](_0x74a551['queueStatusComplete']),_0x6325('0x1e8'),_0x74a551[_0x6325('0x42')]);if(_0x74a551[_0x6325('0x6d')]){_0x74a551[_0x6325('0x6d')]=![];_0x28ee96[_0x6325('0x27')][_0x28ee96['actions'][_0x39ada9][_0x6325('0xbe')]]=[];ami[_0x6325('0x94')]({'actionid':_0x39ada9,'action':_0x6325('0x1e9'),'queue':_0x74a551[_0x6325('0x42')]})[_0x6325('0xa2')](function(){_0x28ee96[_0x6325('0xc8')](_0x74a551);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x28ee96['actions'][_0x39ada9][_0x6325('0xde')],'ListId':_0x28ee96[_0x6325('0x21')][_0x39ada9][_0x6325('0xdf')],'VoiceQueueId':_0x28ee96[_0x6325('0x21')][_0x39ada9]['VoiceQueueId']||undefined,'CampaignId':_0x28ee96[_0x6325('0x21')][_0x39ada9][_0x6325('0xe1')]||undefined})[_0x6325('0xa2')](loggerCatch(_0x6325('0x1ea')));delete _0x28ee96[_0x6325('0x21')][_0x39ada9];});}else{loggerBooked[_0x6325('0x45')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x74a551[_0x6325('0x6d')]),'Queue:\x20',_0x74a551[_0x6325('0x42')]);_0x28ee96[_0x6325('0xc8')](_0x74a551);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x28ee96[_0x6325('0x21')][_0x39ada9][_0x6325('0xde')],'ListId':_0x28ee96[_0x6325('0x21')][_0x39ada9][_0x6325('0xdf')],'VoiceQueueId':_0x28ee96[_0x6325('0x21')][_0x39ada9][_0x6325('0xe0')]||undefined,'CampaignId':_0x28ee96[_0x6325('0x21')][_0x39ada9][_0x6325('0xe1')]||undefined})['catch'](loggerCatch(_0x6325('0x1ea')));delete _0x28ee96[_0x6325('0x21')][_0x39ada9];}}else{return _0x28ee96[_0x6325('0x1eb')](_0x74a551,_0x29dfeb);}}else{if(utils[_0x6325('0x1ec')](undefined,_0x29dfeb[_0x6325('0x1ed')])<_0x74a551[_0x6325('0x1ee')]*0x3c){if(_0x29dfeb[_0x6325('0x14d')]&&!_0x29dfeb[_0x6325('0x14d')][_0x6325('0x1ef')]){_0x28ee96[_0x6325('0xfa')][_0x6325('0x105')](_0x29dfeb['id'])[_0x6325('0xfc')](function(){_0x28ee96[_0x6325('0xc8')](_0x74a551);});}else{hopperUtils['unlockContact']({'active':![]},_0x29dfeb['id'],0x1)[_0x6325('0xfc')](function(){_0x28ee96['updateOriginated'](_0x74a551);});}}else{_0x74a551[_0x6325('0x1f0')]+=0x1;_0x28ee96[_0x6325('0xc8')](_0x74a551);if(_0x74a551[_0x6325('0x1f1')]){hopperUtils[_0x6325('0xda')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x29dfeb[_0x6325('0xde')],'ListId':_0x29dfeb['ListId'],'VoiceQueueId':_0x29dfeb[_0x6325('0xe0')]||undefined,'CampaignId':_0x29dfeb[_0x6325('0xe1')]||undefined})[_0x6325('0xa2')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils['createHistory'](createObjHistory(_0x74a551,_0x29dfeb,utils[_0x6325('0x70')][_0x6325('0x1f2')],0x17,'RecallInQueue'))[_0x6325('0xa2')](loggerCatch(_0x6325('0x1f3')));}else{_0x28ee96[_0x6325('0x120')](createObjHistory(_0x74a551,_0x29dfeb,utils[_0x6325('0x70')][_0x6325('0x1f4')],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x6325('0x1f5'));}}}}else{_0x74a551[_0x6325('0x1f6')]+=0x1;_0x28ee96[_0x6325('0x120')](createObjHistory(_0x74a551,_0x29dfeb,utils[_0x6325('0x70')]['BLACKLIST'],0xd,_0x6325('0x1f7')),_0x6325('0x1f8'),_0x6325('0x1f9'));throw _0x6325('0x1fa');}};};Dialer[_0x6325('0x17')][_0x6325('0x15e')]=function(_0x1d4cb9){var _0x594fe2=this;var _0x33b1e3=_0x1d4cb9[_0x6325('0x1fb')]-_0x1d4cb9['originated'];emitCampaignSummary(_0x1d4cb9);if(_0x33b1e3>0x0&&_0x1d4cb9[_0x6325('0x64')]==0x0){if(_0x33b1e3>this['maxNumberOriginate']){_0x33b1e3=this[_0x6325('0x1f')];}_0x1d4cb9[_0x6325('0x64')]=0x1;hopperUtils[_0x6325('0x1fc')](_0x1d4cb9,_0x33b1e3)[_0x6325('0x9a')](function(_0x4a90e2){_0x1d4cb9[_0x6325('0x64')]=0x0;if(_0x4a90e2){if(!utils[_0x6325('0x1fd')](_0x4a90e2)){_0x1d4cb9[_0x6325('0x67')]=utils[_0x6325('0x70')][_0x6325('0x1fe')];logger['info'](_0x6325('0x1ff')+_0x1d4cb9['name']);}else{_0x1d4cb9[_0x6325('0x79')]+=_0x4a90e2[_0x6325('0x100')];_0x1d4cb9[_0x6325('0x67')]=utils[_0x6325('0x70')]['RUNNING'];for(var _0x11af12=0x0;_0x11af12<_0x4a90e2[_0x6325('0x100')];_0x11af12+=0x1){_0x1d4cb9[_0x6325('0x200')]+=0x1;if(_[_0x6325('0xf4')](_0x4a90e2[_0x11af12])||_[_0x6325('0xf4')](_0x4a90e2[_0x11af12][_0x6325('0x17a')])||_[_0x6325('0xf4')](_0x4a90e2[_0x11af12][_0x6325('0x162')])){_0x594fe2['emptyContact'](_0x6325('0x201'),_0x1d4cb9,_0x4a90e2[_0x11af12]);}else{hopperUtils[_0x6325('0x202')](_[_0x6325('0xf8')](_0x4a90e2[_0x11af12],[_0x6325('0xe1'),_0x6325('0x162')]))[_0x6325('0x9a')](_0x594fe2[_0x6325('0x1e4')](_0x1d4cb9,_0x4a90e2[_0x11af12]))[_0x6325('0xa2')](_0x594fe2[_0x6325('0x157')]('[actionOriginateIvr]\x20',_0x1d4cb9));}}}}})[_0x6325('0xa2')](loggerGetContactDialer(_0x6325('0x203'),_0x1d4cb9,_0x33b1e3));}};Dialer[_0x6325('0x17')]['handlePower']=function(_0x115ac5,_0x5be993){var _0x4da4b6=this;var _0x45e617=[];if(_0x5be993<0x1||_0x115ac5[_0x6325('0xac')]===_0x6325('0x1e6')){_0x5be993=0x1;}var _0x5b9c28=Math[_0x6325('0x1c1')](_0x115ac5[_0x6325('0x140')]*_0x5be993)-_0x115ac5[_0x6325('0x79')];if(_0x115ac5[_0x6325('0x204')]>0x0){var _0x469ad3=_0x115ac5[_0x6325('0x204')]-_0x115ac5['originated']-_0x115ac5[_0x6325('0x141')]-_0x115ac5[_0x6325('0x142')];if(_0x5b9c28>_0x469ad3){_0x5b9c28=_0x469ad3;}}if(_0x5b9c28>0x0&&_0x115ac5[_0x6325('0x64')]==0x0){if(_0x115ac5[_0x6325('0xac')]===_0x6325('0x1e6')){_0x5b9c28=0x1;}if(_0x5b9c28>this['maxNumberOriginate']){_0x5b9c28=this[_0x6325('0x1f')];}for(var _0x3deaee in this[_0x6325('0x1d')]){if(typeof this[_0x6325('0x1d')][_0x3deaee]!=='undefined'){if(this[_0x6325('0x1d')][_0x3deaee][_0x6325('0x69')]===_0x6325('0x205')&&this[_0x6325('0x1d')][_0x3deaee][_0x6325('0x82')]===_0x6325('0x81')){_0x45e617[_0x6325('0x93')](this[_0x6325('0x1d')][_0x3deaee]['id']);}}}_0x115ac5[_0x6325('0x64')]=0x1;hopperUtils['getContactDialer'](_0x115ac5,_0x45e617,_0x5b9c28)[_0x6325('0x9a')](function(_0x54f0e5){_0x115ac5['temp']=0x0;if(_0x54f0e5){if(!utils[_0x6325('0x1fd')](_0x54f0e5)){hopperUtils[_0x6325('0x206')](_0x115ac5)[_0x6325('0x9a')](sendMessageReschedule(_0x115ac5))[_0x6325('0xa2')](loggerCatch(_0x6325('0x207')));}else{_0x115ac5[_0x6325('0x79')]+=_0x54f0e5[_0x6325('0x100')];_0x115ac5[_0x6325('0x67')]=_0x115ac5['dialMethod']===_0x6325('0x1e6')?utils[_0x6325('0x70')]['ACTIVE']:utils[_0x6325('0x70')][_0x6325('0x208')];for(var _0x1fe0e5=0x0;_0x1fe0e5<_0x54f0e5['length'];_0x1fe0e5+=0x1){if(_[_0x6325('0xf4')](_0x54f0e5[_0x1fe0e5])||_[_0x6325('0xf4')](_0x54f0e5[_0x1fe0e5][_0x6325('0x17a')])||_['isNil'](_0x54f0e5[_0x1fe0e5][_0x6325('0x162')])){_0x4da4b6[_0x6325('0x209')](_0x6325('0x201'),_0x115ac5,_0x54f0e5[_0x1fe0e5]);}else{hopperUtils[_0x6325('0x20a')](_[_0x6325('0xf8')](_0x54f0e5[_0x1fe0e5],[_0x6325('0xe0'),_0x6325('0x162')]))[_0x6325('0x9a')](_0x4da4b6[_0x6325('0x1e4')](_0x115ac5,_0x54f0e5[_0x1fe0e5]))[_0x6325('0xa2')](_0x4da4b6['loggerHandler']('[actionOriginate]\x20',_0x115ac5));}}}}})['catch'](loggerGetContactDialer(_0x6325('0x20b'),_0x115ac5,_0x5b9c28));}};Dialer[_0x6325('0x17')][_0x6325('0x5f')]=function(_0x40669d){if(_0x40669d[_0x6325('0x204')]>0x0){var _0x4d55d0=_0x40669d['dialLimitQueue']-_0x40669d[_0x6325('0x79')]-_0x40669d[_0x6325('0x141')];if(_0x4d55d0>0x0&&_0x40669d[_0x6325('0x64')]==0x0){this[_0x6325('0x20c')](_0x40669d);}else{loggerPredictiveCalls['info'](_0x6325('0x20d'));}}else{this[_0x6325('0x20c')](_0x40669d);}};Dialer[_0x6325('0x17')]['tryOriginatePredictive']=function(_0x321282){var _0x19fb7e=this;var _0x3e9837=[];_0x321282[_0x6325('0x79')]+=0x1;for(var _0xf96df7 in this[_0x6325('0x1d')]){if(typeof this['agents'][_0xf96df7]!==_0x6325('0xa5')){if(this[_0x6325('0x1d')][_0xf96df7]['state']===_0x6325('0x205')&&this[_0x6325('0x1d')][_0xf96df7]['status']===_0x6325('0x81')){_0x3e9837['push'](this[_0x6325('0x1d')][_0xf96df7]['id']);}}}_0x321282[_0x6325('0x64')]=0x1;return this[_0x6325('0x20e')](_0x321282['id'],_0x3e9837,0x1,_0x321282['dialOrderByScheduledAt'],_0x321282)[_0x6325('0x9a')](function(_0x25328a){_0x321282['temp']=0x1;if(_0x25328a){if(!utils['checkContactEmpty'](_0x25328a)){utils[_0x6325('0x63')](_0x321282,0x1,0x0);return hopperUtils[_0x6325('0x206')](_0x321282)[_0x6325('0x9a')](sendMessageReschedule(_0x321282))[_0x6325('0xa2')](loggerCatch('[countReScheduled]\x20'));}else{_0x321282['message']=utils[_0x6325('0x70')][_0x6325('0x208')];if(_[_0x6325('0xf4')](_0x25328a[0x0])||_[_0x6325('0xf4')](_0x25328a[0x0][_0x6325('0x17a')])||_[_0x6325('0xf4')](_0x25328a[0x0][_0x6325('0x162')])){_0x19fb7e[_0x6325('0x209')](_0x6325('0x201'),_0x321282,_0x25328a[0x0]);}else{return hopperUtils[_0x6325('0x20a')](_[_0x6325('0xf8')](_0x25328a[0x0],[_0x6325('0xe0'),_0x6325('0x162')]))['then'](_0x19fb7e['checkContactBlack'](_0x321282,_0x25328a[0x0]))[_0x6325('0xa2')](_0x19fb7e[_0x6325('0x157')](_0x6325('0x20f'),_0x321282));}}}})[_0x6325('0xa2')](loggerGetContactDialer(_0x6325('0x210'),_0x321282,0x1));};Dialer[_0x6325('0x17')][_0x6325('0x1d7')]=function(_0x3c2a83,_0x4af512,_0x2dbff3,_0x55ae7f,_0x395a3f,_0x127668){loggerPredictive['info'](_0x6325('0x211'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c2a83);loggerPredictive[_0x6325('0x45')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4af512);loggerPredictive[_0x6325('0x45')](_0x6325('0x212'),_0x2dbff3);loggerPredictive[_0x6325('0x45')](_0x6325('0x213'),_0x55ae7f);loggerPredictive[_0x6325('0x45')](_0x6325('0x214'),_0x395a3f);loggerPredictive['info'](_0x6325('0x51'));return new Promise(function(_0x1a60cc,_0x245cdc){if(_0x3c2a83<=0x0||isNaN(_0x3c2a83)){return _0x245cdc(msgResponse(_0x6325('0x215'),_0x6325('0xba'),_0x6325('0x216')+_0x3c2a83));}if(_0x2dbff3<=0x0||isNaN(_0x2dbff3)){return _0x245cdc(msgResponse(_0x6325('0x215'),'Error',_0x6325('0x217')+_0x2dbff3));}if(_0x55ae7f<=0x0||isNaN(_0x55ae7f)){return _0x245cdc(msgResponse(_0x6325('0x215'),_0x6325('0xba'),'p\x20=\x20'+_0x55ae7f));}if(_0x4af512<=0x0||isNaN(_0x4af512)){return _0x245cdc(msgResponse(_0x6325('0x215'),_0x6325('0xba'),_0x6325('0x218')+_0x4af512));}if(_0x395a3f<=0x0||isNaN(_0x395a3f)){return _0x245cdc(msgResponse('[abandonmentRate]',_0x6325('0xba'),_0x6325('0x219')+_0x395a3f));}_0x127668=_0x127668||0x0;var _0x3b63d2=0x1/_0x2dbff3;var _0x42deb6=0x0;var _0x4f2fba=0x0;var _0x14c936=0x0;var _0x28d6dd=0x0;for(var _0x234310=0x0;_0x14c936<_0x395a3f;_0x234310+=0x1){_0x4f2fba=_0x234310/_0x4af512;_0x42deb6=(_0x55ae7f*_0x4f2fba+_0x127668)/_0x3b63d2;_0x14c936=utils[_0x6325('0x21a')](_0x42deb6,_0x3c2a83);_0x28d6dd=_0x42deb6/_0x3c2a83*(0x1-utils['erlangb'](_0x42deb6,_0x3c2a83));}return _0x1a60cc({'erlangCalls':_0x234310,'erlangCallToSecond':_0x4af512/_0x234310,'erlangAbandonmentRate':_0x14c936,'erlangBusyFactor':_0x28d6dd});});};Dialer[_0x6325('0x17')][_0x6325('0x1d9')]=function(_0x34bd1b,_0x58d642,_0x15dc15,_0x526e22,_0x4bf3ad,_0xc5ccd2){loggerPredictive[_0x6325('0x45')](_0x6325('0x21b'));loggerPredictive[_0x6325('0x45')]('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',_0x34bd1b);loggerPredictive[_0x6325('0x45')](_0x6325('0x21c'),_0x58d642);loggerPredictive[_0x6325('0x45')](_0x6325('0x212'),_0x15dc15);loggerPredictive[_0x6325('0x45')](_0x6325('0x213'),_0x526e22);loggerPredictive['info'](_0x6325('0x21d'),_0x4bf3ad);loggerPredictive[_0x6325('0x45')](_0x6325('0x51'));return new Promise(function(_0x4ba998,_0x228239){if(_0x34bd1b<=0x0||isNaN(_0x34bd1b)){return _0x228239(msgResponse('[busyFactor]',_0x6325('0xba'),_0x6325('0x216')+_0x34bd1b));}if(_0x15dc15<=0x0||isNaN(_0x15dc15)){return _0x228239(msgResponse('[busyFactor]',_0x6325('0xba'),_0x6325('0x217')+_0x15dc15));}if(_0x526e22<=0x0||isNaN(_0x526e22)){return _0x228239(msgResponse(_0x6325('0x21e'),_0x6325('0xba'),_0x6325('0x21f')+_0x526e22));}if(_0x58d642<=0x0||isNaN(_0x58d642)){return _0x228239(msgResponse(_0x6325('0x21e'),_0x6325('0xba'),_0x6325('0x218')+_0x58d642));}if(_0x4bf3ad<=0x0||isNaN(_0x4bf3ad)){return _0x228239(msgResponse('[busyFactor]',_0x6325('0xba'),_0x6325('0x220')+_0x4bf3ad));}_0xc5ccd2=_0xc5ccd2||0x0;var _0x4e0d56=0x1/_0x15dc15;var _0x5f5bb1=0x0;var _0x51bb8a=0x0;var _0x28fed1=0x0;var _0x3a83cb=0x0;for(var _0x5c4c81=0x0;_0x3a83cb<_0x4bf3ad;_0x5c4c81+=0x1){_0x51bb8a=_0x5c4c81/_0x58d642;_0x5f5bb1=(_0x526e22*_0x51bb8a+_0xc5ccd2)/_0x4e0d56;_0x28fed1=utils[_0x6325('0x21a')](_0x5f5bb1,_0x34bd1b);_0x3a83cb=_0x5f5bb1/_0x34bd1b*(0x1-utils[_0x6325('0x21a')](_0x5f5bb1,_0x34bd1b));}return _0x4ba998({'erlangCalls':_0x5c4c81,'erlangCallToSecond':_0x58d642/_0x5c4c81,'erlangAbandonmentRate':_0x28fed1,'erlangBusyFactor':_0x3a83cb});});};module[_0x6325('0x221')]=Dialer; \ No newline at end of file +var _0x2afa=['dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','callAdditionalPhoneAfterMin','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectRetryFrequency','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAvgTalktime','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','checkIsBlackListIvr','checkContactBlack','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[countReScheduled]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','erlangb','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','syncQueueSummary','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','Interval','isIVRCampaignActive','INACTIVE','isIVRCampaign','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','prototype','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','Action','iftime\x20%s,%s','interval','timezones','indexOf','true','catch','command','content','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','responsetime','outboundDropCallsDayTimeout','Drop','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','countdropretry','add','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','starttime','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','minutes','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','pick','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','Success','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HangupInAMD','membername','AMD','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','outboundAnswerAgiCallsDay','Machine','custom:amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HANGUP','[syncHangupInAMDIvr]','countnoanswerretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','statusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','filter','online','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','getCallerId','dialOriginateCallerIdName'];(function(_0x3b8d77,_0x34d393){var _0x31e0d5=function(_0x5efa35){while(--_0x5efa35){_0x3b8d77['push'](_0x3b8d77['shift']());}};_0x31e0d5(++_0x34d393);}(_0x2afa,0xaa));var _0xa2af=function(_0xea6c7f,_0x18302f){_0xea6c7f=_0xea6c7f-0x0;var _0x3ae97e=_0x2afa[_0xea6c7f];return _0x3ae97e;};'use strict';var util=require(_0xa2af('0x0'));var _=require(_0xa2af('0x1'));var uuid=require(_0xa2af('0x2'));var moment=require(_0xa2af('0x3'));var rr=require('rr');var Redis=require(_0xa2af('0x4'));var utils=require(_0xa2af('0x5'));var hopperUtils=require(_0xa2af('0x6'));var ut=require(_0xa2af('0x7'));var config=require(_0xa2af('0x8'));var logger=require('../../../config/logger')(_0xa2af('0x9'));var loggerBooked=require(_0xa2af('0xa'))(_0xa2af('0xb'));var loggerPredictive=require(_0xa2af('0xa'))(_0xa2af('0xc'));var loggerPredictiveCalls=require(_0xa2af('0xa'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xa2af('0xd'));var ami=require('../ami');config['redis']=_[_0xa2af('0xe')](config[_0xa2af('0xf')],{'host':'localhost','port':0x18eb});var io=require(_0xa2af('0x10'))(new Redis(config[_0xa2af('0xf')]));var cmHopper=require(_0xa2af('0x11'));var voiceQueueRt=require(_0xa2af('0x12'));var RpcSetting=require(_0xa2af('0x13'));var Interval=require(_0xa2af('0x14'));var Action=require(_0xa2af('0x15'));var History=require(_0xa2af('0x16'));var Final=require(_0xa2af('0x17'));var AgentComplete=require(_0xa2af('0x18'));var QueueCallerAbandon=require(_0xa2af('0x19'));var Hangup=require(_0xa2af('0x1a'));var ipAgi=process[_0xa2af('0x1b')]['XCALLY_IP_AGI']||_0xa2af('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xa2af('0x1d')]=function(_0x272aaa){this['tail']=this[_0xa2af('0x1e')]?this[_0xa2af('0x1e')][_0xa2af('0x1f')](_0x272aaa):_0x272aaa();};function Dialer(_0x504090,_0xf29c8e){this[_0xa2af('0x20')]=new Sequence();this[_0xa2af('0x21')]=_0xf29c8e;this[_0xa2af('0x22')]=_0x504090[_0xa2af('0x22')];this[_0xa2af('0x23')]=_0x504090[_0xa2af('0x23')];this[_0xa2af('0x24')]=_0x504090[_0xa2af('0x24')];this['trunks']=_0x504090[_0xa2af('0x25')];this['maxNumberOriginate']=config[_0xa2af('0x26')]||0x2;this[_0xa2af('0x27')]={};this[_0xa2af('0x28')]={};this[_0xa2af('0x29')]={};this[_0xa2af('0x2a')]={};this[_0xa2af('0x2b')]={};this[_0xa2af('0x2c')]={};this[_0xa2af('0x2d')]={};this[_0xa2af('0x2e')]={};this[_0xa2af('0x2f')]={};this['queueBookedRR']={};this[_0xa2af('0x30')]={};ami['on']('agentconnect',this[_0xa2af('0x31')][_0xa2af('0x32')](this));ami['on'](_0xa2af('0x33'),this[_0xa2af('0x34')][_0xa2af('0x32')](this));ami['on']('originateresponse',this[_0xa2af('0x35')][_0xa2af('0x32')](this));ami['on'](_0xa2af('0x36'),this[_0xa2af('0x37')][_0xa2af('0x32')](this));ami['on']('custom:queuesummary',this['syncQueueSummary']['bind'](this));ami['on']('custom:queuesummarycomplete',this[_0xa2af('0x38')]['bind'](this));ami['on'](_0xa2af('0x39'),this[_0xa2af('0x3a')]['bind'](this));ami['on'](_0xa2af('0x3b'),this[_0xa2af('0x3c')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xa2af('0x32')](this));ami['on'](_0xa2af('0x3d'),this['syncQueueMember']['bind'](this));ami['on'](_0xa2af('0x3e'),this[_0xa2af('0x3f')][_0xa2af('0x32')](this));this[_0xa2af('0x40')]();this[_0xa2af('0x41')]();RpcSetting['getSettings']()[_0xa2af('0x42')](function(_0x3b6a3c){previewRecallmeReminderInterval=_0x3b6a3c[_0xa2af('0x43')];});}function isNotNull(_0x1d6316){return _0x1d6316!==null&&!_[_0xa2af('0x44')](_0x1d6316);}function msgResponse(_0x564ddf,_0x526082,_0x19aefe){return{'action':_0x564ddf,'response':_0x526082,'message':_0x19aefe,'stack':_0x19aefe};}function emit(_0x201fca,_0x45cb64,_0x5f13d8){io['to'](_0x201fca)[_0xa2af('0x45')](_0x45cb64,_0x5f13d8);}function emitOutboundVoiceQueueSummary(_0x15310d){if(_0x15310d[_0xa2af('0x46')]===_0xa2af('0x47')){logger['debug'](_0xa2af('0x48'),util[_0xa2af('0x49')](_0x15310d,{'showHidden':![],'depth':null}));emit(util[_0xa2af('0x4a')](_0xa2af('0x4b'),_0x15310d[_0xa2af('0x4c')]),_0xa2af('0x4d'),_0x15310d);}}function checkGetDataPredictive(_0x40c05e){if(isNotNull(_0x40c05e)&&!_[_0xa2af('0x4e')](_0x40c05e)){loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x50'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40c05e[_0xa2af('0x51')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x52'),_0x40c05e[_0xa2af('0x53')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x54'),_0x40c05e[_0xa2af('0x55')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40c05e[_0xa2af('0x56')]);loggerPredictive['info'](_0xa2af('0x57'),_0x40c05e[_0xa2af('0x58')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x59'),_0x40c05e['predictiveIntervalAvgTalktime']);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5a'));if(_0x40c05e[_0xa2af('0x51')]>0x0){if(!_[_0xa2af('0x44')](_0x40c05e['predictiveIntervalAvgTalktime'])&&_0x40c05e['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xa2af('0x44')](_0x40c05e[_0xa2af('0x58')])&&_0x40c05e['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5b'));}else{loggerPredictive['info'](_0xa2af('0x5c'));}}else{loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5d'));}return![];}function mergeDataErlangB(_0x2e6939){return function(_0x32e6d0){loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5e'));loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5f'),_0x32e6d0[_0xa2af('0x60')]);loggerPredictive[_0xa2af('0x4f')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32e6d0[_0xa2af('0x61')]);loggerPredictive[_0xa2af('0x4f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32e6d0[_0xa2af('0x62')]);loggerPredictive[_0xa2af('0x4f')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32e6d0[_0xa2af('0x63')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x64'),_0x32e6d0[_0xa2af('0x62')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5a'));_[_0xa2af('0x65')](_0x2e6939,_0x32e6d0);};}function ifInterval(_0x4e4f07,_0x10629f){if(_[_0xa2af('0x44')](_0x10629f)){return![];}return utils[_0xa2af('0x66')](undefined,_0x10629f)<_0x4e4f07*0x3c;}function clearPredictiveAttributes(_0x465da4){if(_0x465da4[_0xa2af('0x2d')]){_0x465da4[_0xa2af('0x2d')]=undefined;loggerPredictive[_0xa2af('0x67')](_0x465da4[_0xa2af('0x4c')],_0xa2af('0x68'));}if(_0x465da4[_0xa2af('0x2c')]){_0x465da4[_0xa2af('0x2c')]=undefined;loggerPredictive['debug'](_0x465da4['name'],_0xa2af('0x69'));}if(_0x465da4[_0xa2af('0x6a')]){clearInterval(_0x465da4[_0xa2af('0x6a')]);_0x465da4[_0xa2af('0x6a')]=undefined;loggerPredictive[_0xa2af('0x67')](_0x465da4[_0xa2af('0x4c')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x1724f4,_0x337fdb){return function(_0x56b83a){loggerPredictive[_0xa2af('0x6b')](_0x337fdb[_0xa2af('0x4c')],_0x1724f4);loggerPredictive[_0xa2af('0x6b')](_0x56b83a[_0xa2af('0x6c')]);clearPredictiveAttributes(_0x337fdb);};}function loggerCatch(_0x33e86e){return function(_0x5c31c8){logger[_0xa2af('0x6b')](_0x33e86e,util[_0xa2af('0x49')](_0x5c31c8,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2cc1ba,_0x73e030,_0x45c790){return function(_0x1c096b){utils[_0xa2af('0x6d')](_0x73e030,_0x45c790,0x0);_0x73e030[_0xa2af('0x6e')]=0x0;logger['error'](_0x2cc1ba,util['inspect'](_0x1c096b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x12358e){return function(_0x4455ef){if(isNotNull(_0x4455ef)&&isNotNull(_0x4455ef[0x0])){if(_0x4455ef[0x0]['contactsRescheduled']>0x0){_0x12358e[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x71')];logger['info']('[getContactDialer2][ReScheduled]'+_0x12358e[_0xa2af('0x4c')],_0x4455ef[0x0][_0xa2af('0x72')],_0xa2af('0x73'));}else{_0x12358e['message']=utils[_0xa2af('0x70')][_0xa2af('0x74')];logger['info']('[getContactDialer2][Empty]'+_0x12358e[_0xa2af('0x4c')]);}}};}function createObjHistory(_0x3fbc1b,_0x772ceb,_0x8c5bbe,_0x23b3ab,_0x346698){_0x3fbc1b[_0xa2af('0x6f')]=_0x8c5bbe;var _0x5c09f5=new Action(_0x3fbc1b,_0x772ceb);var _0x1b83d6=new History(_0x5c09f5);_0x1b83d6[_0xa2af('0x75')]=_0x23b3ab;_0x1b83d6[_0xa2af('0x76')]=_0x346698;_0x1b83d6[_0xa2af('0x77')]=_0x5c09f5['starttime'];return _0x1b83d6;}function unlockQueueStatus(_0x226f07,_0x2abe80){setTimeout(function(){if(_[_0xa2af('0x44')](_0x226f07[_0xa2af('0x78')])){loggerBooked[_0xa2af('0x6b')](_0xa2af('0x79'),_0x2abe80);}_0x226f07[_0xa2af('0x78')]=!![];loggerBooked[_0xa2af('0x4f')](_0xa2af('0x7a'),_0x2abe80,JSON[_0xa2af('0x7b')](_['pick'](_0x226f07,[_0xa2af('0x4c'),_0xa2af('0x78')])));},0x1f3);}function checkInterval(_0x292b57){return function(){if(!isNotNull(_0x292b57['Interval'])){_0x292b57[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x7c')];throw _0x292b57[_0xa2af('0x4c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x292b57['Interval'][_0xa2af('0x7d')])){_0x292b57[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x7c')];throw _0x292b57['name']+_0xa2af('0x7e');}if(!isNotNull(_['isEmpty'](_0x292b57[_0xa2af('0x7f')][_0xa2af('0x7d')]))){_0x292b57[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x7c')];throw _0x292b57[_0xa2af('0x4c')]+_0xa2af('0x7e');}};}function checkIsIVRCampaignActive(_0x48b9bc){return function(){if(!utils[_0xa2af('0x80')](_0x48b9bc)){_0x48b9bc[_0xa2af('0x6f')]=utils['CAMPAIGN_STATUS'][_0xa2af('0x81')];throw _0x48b9bc[_0xa2af('0x4c')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x1fa6b1){if(utils[_0xa2af('0x82')](_0x1fa6b1)){emit(util[_0xa2af('0x4a')]('campaign:ivr:%s',_0x1fa6b1[_0xa2af('0x4c')]),'campaign:save',_0x1fa6b1);}}function loggerCatchQueueSummary(_0x34b48b,_0x1adeac){return function(_0x4f554a){clearPredictiveAttributes(_0x1adeac);emitCampaignSummary(_0x1adeac);loggerSyncQueueSummary['debug'](_0x34b48b,util['inspect'](_0x4f554a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3ebe9b){if(_0x3ebe9b[_0xa2af('0x83')]){if(_0x3ebe9b['originated']===0x0){_0x3ebe9b[_0xa2af('0x83')]=![];_0x3ebe9b[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x81')];loggerSyncQueueSummary[_0xa2af('0x67')](_0xa2af('0x84'),_0x3ebe9b[_0xa2af('0x4c')],_0xa2af('0x85'));}else{_0x3ebe9b[_0xa2af('0x6f')]=utils[_0xa2af('0x70')]['DISACTIVED'];loggerSyncQueueSummary[_0xa2af('0x67')](_0xa2af('0x84'),_0x3ebe9b['name'],_0xa2af('0x86'));}emitCampaignSummary(_0x3ebe9b);}}function myreject(_0xe41f04){return function(_0x293302){return _0xe41f04(msgResponse(_0xa2af('0x87'),_0xa2af('0x88'),JSON[_0xa2af('0x7b')](_0x293302)));};}Dialer[_0xa2af('0x89')][_0xa2af('0x8a')]=function(_0x20f846){return!_[_0xa2af('0x44')](_0x20f846)&&_0x20f846&&!_[_0xa2af('0x44')](_0x20f846['name'])&&!_[_0xa2af('0x44')](_0x20f846[_0xa2af('0x8b')])&&_0x20f846[_0xa2af('0x8b')]&&(this[_0xa2af('0x25')][util['format'](_0xa2af('0x8c'),_0x20f846[_0xa2af('0x4c')])][_0xa2af('0x8d')]===_0xa2af('0x8e')||this[_0xa2af('0x25')][util[_0xa2af('0x4a')](_0xa2af('0x8c'),_0x20f846[_0xa2af('0x4c')])][_0xa2af('0x8d')]===_0xa2af('0x8f'));};Dialer[_0xa2af('0x89')]['checkIsTrunkReachable']=function(_0x4d133e){var _0x4ab55d=this;return function(){if(!_0x4ab55d[_0xa2af('0x8a')](_0x4d133e['Trunk'])){if(!_0x4ab55d[_0xa2af('0x8a')](_0x4d133e['TrunkBackup'])){_0x4d133e['message']=utils[_0xa2af('0x70')][_0xa2af('0x90')];throw _0x4d133e[_0xa2af('0x4c')]+_0xa2af('0x91');}}};};Dialer['prototype']['checkIfTime']=function(_0x3876b1,_0x2bea0f,_0x23628f,_0x28a0c8){var _0x2c3108=this;return function(){var _0x1d511=!![];return _0x2c3108[_0xa2af('0x92')](_0x3876b1,_0x2bea0f,_0x23628f,_0x28a0c8,_0x1d511);};};Dialer[_0xa2af('0x89')][_0xa2af('0x93')]=function(_0xd1766f,_0x27166c,_0x25d8ec,_0x49f872){var _0x460e9e=this;return function(){var _0x52ad09=![];return _0x460e9e[_0xa2af('0x92')](_0xd1766f['Intervals'],_0x27166c,_0x25d8ec,_0x49f872,_0x52ad09);};};Dialer[_0xa2af('0x89')][_0xa2af('0x92')]=function(_0x37bc40,_0x3f34e1,_0x39f577,_0x32e447,_0x57bb14){var _0x125d83=[];return new Promise(function(_0x17ff51,_0xa91e7){if(!isNotNull(_0x37bc40)){_0x32e447[_0xa2af('0x6f')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0xa91e7(msgResponse(_0xa2af('0x94'),_0xa2af('0x95'),_0x39f577+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xa2af('0x4e')](_0x37bc40)){_0x32e447[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x96')];return _0xa91e7(msgResponse('ifTime',_0xa2af('0x95'),_0x39f577+_0xa2af('0x97')));}if(_0x3f34e1&&_[_0xa2af('0x44')](config['timezones'][_0x3f34e1])){_0x32e447[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x98')];return _0xa91e7(msgResponse(_0xa2af('0x94'),_0xa2af('0x95'),_0x39f577+_0xa2af('0x99')+_0x3f34e1));}if(_['isArray'](_0x37bc40)){for(var _0x1453d7=0x0;_0x1453d7<_0x37bc40['length'];_0x1453d7+=0x1){_0x125d83[_0xa2af('0x9a')](ami[_0xa2af('0x9b')]({'action':'command','command':util[_0xa2af('0x4a')](_0xa2af('0x9c'),_0x37bc40[_0x1453d7][_0xa2af('0x9d')],!_[_0xa2af('0x44')](config[_0xa2af('0x9e')][_0x3f34e1])?_0x3f34e1:'')})['then'](function(_0x47de6a){return _0x47de6a['content'][_0xa2af('0x9f')](_0xa2af('0xa0'))>=0x0;})[_0xa2af('0xa1')](myreject(_0xa91e7)));}}else{_0x125d83[_0xa2af('0x9a')](ami[_0xa2af('0x9b')]({'action':_0xa2af('0xa2'),'command':util[_0xa2af('0x4a')](_0xa2af('0x9c'),_0x37bc40,!_[_0xa2af('0x44')](config[_0xa2af('0x9e')][_0x3f34e1])?_0x3f34e1:'')})[_0xa2af('0x42')](function(_0x264ae7){return _0x264ae7[_0xa2af('0xa3')]['indexOf'](_0xa2af('0xa0'))>=0x0;})[_0xa2af('0xa1')](myreject(_0xa91e7)));}Promise[_0xa2af('0xa4')](_0x125d83)['then'](function(_0x35323d){var _0x32d239=_[_0xa2af('0xa5')](_0x35323d);if(_0x32d239){return _0x17ff51(_0x32d239);}else{_0x32e447[_0xa2af('0x6f')]=_0x57bb14?utils[_0xa2af('0x70')][_0xa2af('0xa6')]:utils['CAMPAIGN_STATUS'][_0xa2af('0xa7')];return _0xa91e7(msgResponse(_0xa2af('0xa8'),_0xa2af('0x95'),_0xa2af('0xa9')+_0x57bb14+'\x20'+_0x39f577+_0xa2af('0xaa')+util['inspect'](_0x37bc40,{'showHidden':![],'depth':null})+_0xa2af('0xab')+_0x3f34e1));}})[_0xa2af('0xa1')](function(_0x411331){return _0xa91e7(msgResponse('ifTime',_0xa2af('0x95'),JSON[_0xa2af('0x7b')](_0x411331)));});});};Dialer[_0xa2af('0x89')]['loopCampaigns']=function(){var _0x3a3ad4=this;return cmHopper[_0xa2af('0xac')]({'active':![]},{'where':{'active':!![]}})[_0xa2af('0x42')](function(){setInterval(function(){_0x3a3ad4[_0xa2af('0xad')]();},0x3e8);});};Dialer[_0xa2af('0x89')][_0xa2af('0xad')]=function(){var _0x55bbe1=this;var _0x253062;for(var _0x58a79c in this[_0xa2af('0x23')]){if(typeof this[_0xa2af('0x23')][_0x58a79c]!==_0xa2af('0xae')){_0x253062=this[_0xa2af('0x23')][_0x58a79c];if(utils['isIVRCampaign'](_0x253062)&&utils['isIVRCampaignActive'](_0x253062)){_0x253062['sendMessageOneNotActive']=!![];Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](checkIsIVRCampaignActive(_0x253062))[_0xa2af('0x42')](checkInterval(_0x253062))[_0xa2af('0x42')](_0x55bbe1[_0xa2af('0xb0')](_0x253062))[_0xa2af('0x42')](_0x55bbe1[_0xa2af('0xb1')](_0x253062[_0xa2af('0xb2')],_0x253062[_0xa2af('0xb3')],_0x253062[_0xa2af('0x4c')],_0x253062))[_0xa2af('0x42')](_0x55bbe1['checkIfTimeIntervals'](_0x253062[_0xa2af('0x7f')],_0x253062[_0xa2af('0xb3')],_0x253062['name'],_0x253062))[_0xa2af('0x42')](_0x55bbe1[_0xa2af('0xb4')](_0x253062))[_0xa2af('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0x253062));}else{notSendMessagesCampaign(_0x253062);}}}};Dialer[_0xa2af('0x89')][_0xa2af('0xb5')]=function(_0x2c52f7){if(_0x2c52f7[_0xa2af('0xb6')]!==_0xa2af('0xc')){clearPredictiveAttributes(_0x2c52f7);}switch(_0x2c52f7['dialMethod']){case _0xa2af('0xb7'):this[_0xa2af('0xb8')](_0x2c52f7,0x1);break;case _0xa2af('0xb9'):this['handlePower'](_0x2c52f7,_0x2c52f7['dialPowerLevel']);break;case _0xa2af('0xc'):this[_0xa2af('0xc')](_0x2c52f7);break;case _0xa2af('0xb'):this['handlePower'](_0x2c52f7,0x1);break;default:logger[_0xa2af('0x6b')](_0xa2af('0xba'),_0x2c52f7[_0xa2af('0x4c')],_0xa2af('0xbb'));}};Dialer['prototype'][_0xa2af('0x94')]=function(_0x2d8818,_0x2a4e0a){var _0x3b71bf=_0x2d8818[_0xa2af('0xb3')];var _0x18ce50=_0x2a4e0a?_0x2d8818[_0xa2af('0xb2')]:_0x2d8818[_0xa2af('0x7f')][_0xa2af('0x7d')];logger[_0xa2af('0xbc')](_0xa2af('0xbd'),_0x18ce50,_0x3b71bf,_0x2d8818[_0xa2af('0x4c')],util[_0xa2af('0x4a')](_0xa2af('0xbe'),_0x2d8818[_0xa2af('0x4c')],_0x2d8818['id']));var _0x407e57=null;return Interval[_0xa2af('0xbf')](_0x18ce50,_0x3b71bf)[_0xa2af('0x42')](function(_0x5b72c1){if(_0x5b72c1===!![]){return _0x5b72c1;}else{_0x2d8818['message']=_0x2a4e0a?utils['CAMPAIGN_STATUS'][_0xa2af('0xa6')]:utils['CAMPAIGN_STATUS'][_0xa2af('0xa7')];_0x407e57=msgResponse('[ifTime][promiseAll]','Failure',_0xa2af('0xa9')+_0x2a4e0a+'\x20'+_0x2d8818[_0xa2af('0x4c')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0xa2af('0x49')](_0x18ce50,{'showHidden':![],'depth':null})+_0xa2af('0xab')+_0x3b71bf);}if(_0x407e57!==null){logger[_0xa2af('0xbc')](_0xa2af('0xc0'),_0x407e57);_0x407e57[_0xa2af('0xc1')]=_0x2a4e0a;throw _0x407e57;}})[_0xa2af('0xa1')](function(_0x1ddf65){logger[_0xa2af('0x6b')](_0xa2af('0xc2'),_0x1ddf65);throw msgResponse(_0xa2af('0x87'),_0xa2af('0x88'),util['inspect'](_0x1ddf65,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xa2af('0x31')]=function(_0x540cd1){if(this[_0xa2af('0x22')][_0x540cd1[_0xa2af('0xc3')]]){if(this[_0xa2af('0x2a')][_0x540cd1[_0xa2af('0xc4')]]&&this[_0xa2af('0x2a')][_0x540cd1['uniqueid']]['type']!==_0xa2af('0xc5')){this['updateOriginated'](this['voiceQueues'][_0x540cd1[_0xa2af('0xc3')]]);this[_0xa2af('0x2a')][_0x540cd1['uniqueid']][_0xa2af('0xc6')]=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));}}};Dialer[_0xa2af('0x89')][_0xa2af('0x37')]=function(_0x33cb2c){var _0x5dae5f=this[_0xa2af('0x2a')][_0x33cb2c[_0xa2af('0xc4')]];if(this[_0xa2af('0x22')][_0x33cb2c[_0xa2af('0xc3')]]){if(_0x5dae5f&&_0x5dae5f['type']!==_0xa2af('0xc5')){delete this['uniqueId'][_0x33cb2c['uniqueid']];this[_0xa2af('0x22')][_0x33cb2c[_0xa2af('0xc3')]][_0xa2af('0xc8')]+=0x1;var _0x54d07b=new AgentComplete(_0x5dae5f,_0x33cb2c);if(_0x33cb2c[_0xa2af('0xc9')]===_0xa2af('0xca')){_0x54d07b[_0xa2af('0xcb')]=this[_0xa2af('0x22')][_0x33cb2c[_0xa2af('0xc3')]][_0xa2af('0xcc')]&&this[_0xa2af('0x22')][_0x33cb2c['queue']]['dialAgiAfterHangupAgent']?moment()[_0xa2af('0x4a')](_0xa2af('0xc7')):undefined;}hopperUtils[_0xa2af('0xcd')](_0x54d07b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xce')));hopperUtils[_0xa2af('0xcf')](_0x54d07b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xd0')));}}};Dialer[_0xa2af('0x89')]['syncQueueCallerAbandon']=function(_0x430660){var _0x2ce890=this['uniqueId'][_0x430660[_0xa2af('0xc4')]];var _0x34026e=this;var _0x154926=![];var _0x1ff74a;var _0x1c1c8e;if(this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]]){if(_0x2ce890&&_0x2ce890[_0xa2af('0x46')]!==_0xa2af('0xc5')){delete this[_0xa2af('0x2a')][_0x430660[_0xa2af('0xc4')]];this[_0xa2af('0xd1')](this[_0xa2af('0x22')][_0x430660['queue']]);_0x2ce890['droptime']=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));var _0xb464c9=new QueueCallerAbandon(_0x2ce890,_0x430660);if(utils[_0xa2af('0x66')](_0x2ce890['droptime'],_0x2ce890[_0xa2af('0xd2')])>=_0x2ce890['dialQueueTimeout']){this[_0xa2af('0x22')][_0x430660['queue']][_0xa2af('0x55')]+=0x1;this['voiceQueues'][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xd3')]+=0x1;this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xb464c9[_0xa2af('0x75')]=0xa;_0xb464c9[_0xa2af('0x76')]=_0xa2af('0xd4');_0xb464c9['dropreason']='TIMEOUT';_0xb464c9['agiafterat']=this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xcc')]?moment()[_0xa2af('0x4a')](_0xa2af('0xc7')):undefined;_0xb464c9['countdropretry']+=0x1;_0xb464c9[_0xa2af('0xd5')]+=0x1;_0x1ff74a=this[_0xa2af('0x22')][_0x430660['queue']][_0xa2af('0xd6')];_0x1c1c8e=this['voiceQueues'][_0x430660[_0xa2af('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xa2af('0xd7')](_0xb464c9,_0xb464c9[_0xa2af('0x75')],_0x2ce890[_0xa2af('0xd8')])['then'](function(_0x3a0cc9){_0x154926=_0x3a0cc9[_0xa2af('0xd9')]==0x1;if(_0xb464c9['countdropretry']>=_0x34026e[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xda')]){_0x34026e[_0xa2af('0xdb')](_0xb464c9,_0x3a0cc9[_0xa2af('0xd9')]);}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countdropretry':_0xb464c9[_0xa2af('0xdd')],'scheduledat':moment()[_0xa2af('0xde')](_0x34026e[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]]['dialDropRetryFrequency'],'minutes')[_0xa2af('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2ce890[_0xa2af('0xdf')],'ListId':_0x2ce890[_0xa2af('0xe0')],'VoiceQueueId':_0x2ce890[_0xa2af('0xe1')]||undefined,'CampaignId':_0x2ce890[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xe3')));var _0x40c43c=new History(_0xb464c9);_0x40c43c[_0xa2af('0x75')]=0xa;_0x40c43c[_0xa2af('0x76')]='Drop';_0x40c43c[_0xa2af('0xe4')]=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));_0x40c43c[_0xa2af('0x77')]=_0x40c43c[_0xa2af('0xe4')];_0x40c43c['calleridname']=_0xb464c9['calleridname'];_0x40c43c[_0xa2af('0xe5')]=_0xb464c9[_0xa2af('0xe5')];hopperUtils['createHistory'](_0x40c43c)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xe6')));}})[_0xa2af('0x42')](function(){if(_0x154926)hopperUtils[_0xa2af('0xe7')](_0xb464c9,_0x1ff74a,_0x1c1c8e)[_0xa2af('0x42')](function(){return 0x1;});});}else{this['voiceQueues'][_0x430660[_0xa2af('0xc3')]][_0xa2af('0x56')]+=0x1;this[_0xa2af('0x22')][_0x430660['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0xb464c9[_0xa2af('0x75')]=0xb;_0xb464c9[_0xa2af('0x76')]=_0xa2af('0xe8');_0xb464c9[_0xa2af('0xe9')]=_0xa2af('0xea');_0xb464c9[_0xa2af('0xeb')]+=0x1;_0xb464c9[_0xa2af('0xd5')]+=0x1;_0x1ff74a=this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xec')];_0x1c1c8e=this['voiceQueues'][_0x430660[_0xa2af('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xa2af('0xd7')](_0xb464c9,_0xb464c9[_0xa2af('0x75')],_0x2ce890[_0xa2af('0xd8')])[_0xa2af('0x42')](function(_0x2bc4f0){if(_0xb464c9['countabandonedretry']>=_0x34026e[_0xa2af('0x22')][_0x430660['queue']][_0xa2af('0xed')]){_0x34026e[_0xa2af('0xdb')](_0xb464c9,_0x2bc4f0[_0xa2af('0xd9')]);}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countabandonedretry':_0xb464c9[_0xa2af('0xeb')],'scheduledat':moment()[_0xa2af('0xde')](_0x34026e[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xec')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x2ce890[_0xa2af('0xdf')],'ListId':_0x2ce890[_0xa2af('0xe0')],'VoiceQueueId':_0x2ce890[_0xa2af('0xe1')]||undefined,'CampaignId':_0x2ce890['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xef')));var _0x30217f=new History(_0xb464c9);_0x30217f['state']=0xb;_0x30217f['statedesc']=_0xa2af('0xe8');_0x30217f[_0xa2af('0xe4')]=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));_0x30217f[_0xa2af('0x77')]=_0x30217f[_0xa2af('0xe4')];_0x30217f[_0xa2af('0xf0')]=_0xb464c9[_0xa2af('0xf0')];_0x30217f[_0xa2af('0xe5')]=_0xb464c9['calleridnum'];hopperUtils[_0xa2af('0xcd')](_0x30217f)['catch'](loggerCatch(_0xa2af('0xf1')));}})[_0xa2af('0x42')](function(){if(_0x154926)hopperUtils[_0xa2af('0xe7')](_0xb464c9,_0x1ff74a,_0x1c1c8e)[_0xa2af('0x42')](function(){return 0x1;});});}}}};Dialer[_0xa2af('0x89')][_0xa2af('0x3c')]=function(_0x4d0fe9){if(this['actions'][_0x4d0fe9[_0xa2af('0xc4')]]){this[_0xa2af('0x28')][_0x4d0fe9[_0xa2af('0xc4')]]['channel']=_0x4d0fe9[_0xa2af('0xf2')];}if(this['uniqueId'][_0x4d0fe9['uniqueid']]){this['uniqueId'][_0x4d0fe9['uniqueid']][_0xa2af('0xf2')]=_0x4d0fe9[_0xa2af('0xf2')];}};Dialer[_0xa2af('0x89')][_0xa2af('0xf3')]=function(_0x539cca){if(!this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]){return;}var _0x35923f=this[_0xa2af('0x22')][this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]['queue']][_0xa2af('0xf5')]||_0xa2af('0xf6');if(_0x35923f===_0xa2af('0xf7')){if(this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]&&_[_0xa2af('0xf8')](this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xf9')])&&_0x539cca[_0xa2af('0x8d')]==='1'&&_0x539cca[_0xa2af('0xfa')]==='0'){if(this[_0xa2af('0x24')][_0x539cca['stateinterface']]){if(!this[_0xa2af('0x24')][_0x539cca[_0xa2af('0xfb')]][_0xa2af('0xf9')]){this['agents'][_0x539cca[_0xa2af('0xfb')]][_0xa2af('0xf9')]=!![];this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xf9')]=!![];this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xfb')]=_0x539cca[_0xa2af('0xfb')];}}}}else if(_0x35923f===_0xa2af('0xf6')){if(this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]){if(this[_0xa2af('0x24')][_0x539cca[_0xa2af('0xfb')]]){this[_0xa2af('0x28')][_0x539cca['actionid']][_0xa2af('0xfb')]=_0x539cca[_0xa2af('0xfb')];if(_[_0xa2af('0xf8')](this['queueBooked'][this['actions'][_0x539cca[_0xa2af('0xf4')]]['queue']])){this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xc3')]]=[];}this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]['queue']][_0xa2af('0x9a')](_[_0xa2af('0x65')](_[_0xa2af('0xfc')](this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]],[_0xa2af('0xfd'),'stateinterface']),{'status':_0x539cca[_0xa2af('0x8d')],'paused':_0x539cca[_0xa2af('0xfa')]}));}}}};Dialer[_0xa2af('0x89')]['syncQueueStatusComplete']=function(_0x2dec0a){if(!this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]]){return;}var _0x1ff7c9=this;var _0x431313=this[_0xa2af('0x22')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]];var _0x1a10d9=_0x431313[_0xa2af('0xf5')]||'rrmemory';if(_0x1a10d9===_0xa2af('0xf7')){if(this['actions'][_0x2dec0a[_0xa2af('0xf4')]]&&this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xfb')]){this[_0xa2af('0x21')][_0xa2af('0xfe')](this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xfd')],this[_0xa2af('0x28')][_0x2dec0a['actionid']][_0xa2af('0xfb')])[_0xa2af('0xa1')](function(_0x52f7ca){logger[_0xa2af('0x6b')](_0xa2af('0xff'),util[_0xa2af('0x49')](_0x52f7ca,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1ff7c9[_0xa2af('0xd1')](_0x1ff7c9[_0xa2af('0x22')][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]);_0x1ff7c9['agents'][_0x1ff7c9['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xfb')]][_0xa2af('0xf9')]=![];delete _0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]];unlockQueueStatus(_0x431313);});}else{this['updateOriginated'](this[_0xa2af('0x22')][this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]);hopperUtils[_0xa2af('0xdc')]({'active':![],'ContactId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xdf')],'ListId':this['actions'][_0x2dec0a['actionid']][_0xa2af('0xe0')],'VoiceQueueId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe1')]||undefined,'CampaignId':this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe2')]||undefined})['catch'](loggerCatch(_0xa2af('0x100')));delete this[_0xa2af('0x28')][_0x2dec0a['actionid']];unlockQueueStatus(_0x431313);}}else if(_0x1a10d9===_0xa2af('0xf6')){var _0x550fa0;if(this['actions'][_0x2dec0a[_0xa2af('0xf4')]]&&!_['isEmpty'](this[_0xa2af('0x2f')][this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]])){if(this[_0xa2af('0x101')][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]]['queue']]){this[_0xa2af('0x101')][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]=this[_0xa2af('0x101')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]?this['queueBookedRR'][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]:this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x2dec0a['actionid']]['queue']]?this[_0xa2af('0x2f')][this['actions'][_0x2dec0a['actionid']][_0xa2af('0xc3')]][_0xa2af('0x102')]||0x0:0x0;}this[_0xa2af('0x2f')][this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]][_0xa2af('0x102')]=this[_0xa2af('0x101')][this[_0xa2af('0x28')][_0x2dec0a['actionid']]['queue']];for(var _0x2e7008=0x0;_0x2e7008=_0xe1aa1d[_0xa2af('0x127')]){_0x1a1475[_0xa2af('0x128')](_0x24e4e6,_0x52029f,_0x46adb1,_0xa2af('0x129'));}else{if(_0x24e4e6['countmachineretry']>=_0xe1aa1d[_0xa2af('0x12a')]){_0x1a1475[_0xa2af('0x12b')](_0x24e4e6,_0x52029f,_0x46adb1,_0xa2af('0x12c'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x24e4e6[_0xa2af('0x125')],'scheduledat':moment()[_0xa2af('0xde')](_0xe1aa1d[_0xa2af('0x12d')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x24e4e6[_0xa2af('0xdf')],'ListId':_0x24e4e6[_0xa2af('0xe0')],'VoiceQueueId':_0x24e4e6['VoiceQueueId']||undefined,'CampaignId':_0x24e4e6[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x52029f({'reschedule':0x1});}}});}if(_0x2b454c[_0xa2af('0x46')]===_0xa2af('0xc5')&&this[_0xa2af('0x23')][_0x2b454c['queue']][_0xa2af('0x113')]&&_0x52a41e[_0xa2af('0x11b')]===_0xa2af('0x12e')){delete this[_0xa2af('0x2a')][_0x52a41e[_0xa2af('0xc4')]];this[_0xa2af('0xd1')](this['campaigns'][_0x2b454c[_0xa2af('0xc3')]]);_0x28a760=new Hangup(_0x2b454c,_0x52a41e);_0x28a760[_0xa2af('0x75')]=0x12;_0x28a760[_0xa2af('0x76')]=_0xa2af('0x114');_0x28a760[_0xa2af('0x115')]=_0xa2af('0x116');ami[_0xa2af('0x45')](_0xa2af('0x11f'),ut[_0xa2af('0x120')](_0x28a760,'amd'));this[_0xa2af('0x118')](_0x28a760,'[syncHangupInAMDIvr][createHistory]',_0xa2af('0x12f'));}if(_0x2b454c[_0xa2af('0x46')]===_0xa2af('0xc5')&&this[_0xa2af('0x23')][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0x113')]&&_0x52a41e[_0xa2af('0x11b')]===_0xa2af('0x11c')){return new Promise(function(_0x54644c,_0x309290){delete _0x1a1475[_0xa2af('0x2a')][_0x52a41e['uniqueid']];_0x1a1475['updateOriginated'](_0x1a1475['campaigns'][_0x2b454c[_0xa2af('0xc3')]]);_0x1a1475[_0xa2af('0x23')][_0x2b454c[_0xa2af('0xc3')]]['outboundAnswerCallsDay']+=0x1;_0x1a1475[_0xa2af('0x23')][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0x11d')]+=0x1;var _0x23ad41=_0x1a1475['campaigns'][_0x2b454c[_0xa2af('0xc3')]];var _0x3762e9=new Hangup(_0x2b454c,_0x52a41e);_0x3762e9[_0xa2af('0x75')]=0x13;_0x3762e9[_0xa2af('0x76')]=_0xa2af('0x11e');_0x3762e9[_0xa2af('0x115')]=_0xa2af('0x116');_0x3762e9['countmachineretry']+=0x1;_0x3762e9['countglobal']+=0x1;_0x3762e9['amd']=!![];ami[_0xa2af('0x45')]('custom:amd',ut['buildObj'](_0x3762e9,_0xa2af('0x117')));hopperUtils[_0xa2af('0xcd')](_0x3762e9)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x121')));if(_0x3762e9['countbusyretry']+_0x3762e9['countcongestionretry']+_0x3762e9[_0xa2af('0x130')]+_0x3762e9[_0xa2af('0x124')]+_0x3762e9[_0xa2af('0xdd')]+_0x3762e9[_0xa2af('0xeb')]+_0x3762e9['countmachineretry']+_0x3762e9['countagentrejectretry']>=_0x23ad41[_0xa2af('0x127')]){_0x1a1475[_0xa2af('0x128')](_0x3762e9,_0x54644c,_0x309290,_0xa2af('0x129'));}else{if(_0x3762e9['countmachineretry']>=_0x23ad41['dialMachineMaxRetry']){_0x1a1475['createStateFinal'](_0x3762e9,_0x54644c,_0x309290,_0xa2af('0x12c'));}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countmachineretry':_0x3762e9[_0xa2af('0x125')],'scheduledat':moment()[_0xa2af('0xde')](_0x23ad41['dialMachineRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x3762e9['ContactId'],'ListId':_0x3762e9[_0xa2af('0xe0')],'VoiceQueueId':_0x3762e9[_0xa2af('0xe1')]||undefined,'CampaignId':_0x3762e9['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x131')));_0x54644c({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xa2af('0x3a')]=function(_0x4002b7){var _0x3d6518=this[_0xa2af('0x2a')][_0x4002b7[_0xa2af('0xc4')]];var _0x16f4be;if(_0x3d6518&&_0x3d6518['type']==='ivr'){delete this[_0xa2af('0x2a')][_0x4002b7[_0xa2af('0xc4')]];this[_0xa2af('0xd1')](this[_0xa2af('0x23')][_0x3d6518[_0xa2af('0xc3')]]);this[_0xa2af('0x23')][_0x3d6518[_0xa2af('0xc3')]][_0xa2af('0x132')]+=0x1;_0x16f4be=new Hangup(_0x3d6518,_0x4002b7);hopperUtils[_0xa2af('0xcd')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x133')));hopperUtils['moveContactManagedDialer'](_0x16f4be)['catch'](loggerCatch(_0xa2af('0x134')));}if(_0x3d6518&&_0x3d6518[_0xa2af('0x46')]!==_0xa2af('0xc5')&&isNotNull(this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]['dialQueueProject'])){delete this['uniqueId'][_0x4002b7[_0xa2af('0xc4')]];this['updateOriginated'](this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]);this[_0xa2af('0x22')][_0x3d6518['queue']][_0xa2af('0xc8')]+=0x1;this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]][_0xa2af('0x11d')]+=0x1;_0x16f4be=new Hangup(_0x3d6518,_0x4002b7);_0x16f4be[_0xa2af('0x75')]=0x10;_0x16f4be['statedesc']=_0xa2af('0x135');_0x16f4be[_0xa2af('0x115')]=_0xa2af('0x136');hopperUtils[_0xa2af('0xcd')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa2af('0xcf')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x3d6518&&_0x3d6518[_0xa2af('0x46')]!==_0xa2af('0xc5')&&!isNotNull(this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]['dialQueueProject'])){delete this[_0xa2af('0x2a')][_0x4002b7[_0xa2af('0xc4')]];this['updateOriginated'](this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]);this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]][_0xa2af('0x137')]+=0x1;_0x16f4be=new Hangup(_0x3d6518,_0x4002b7);_0x16f4be[_0xa2af('0x75')]=0xc;_0x16f4be[_0xa2af('0x76')]=_0x4002b7[_0xa2af('0x138')];_0x16f4be[_0xa2af('0x115')]=_0xa2af('0x139');hopperUtils[_0xa2af('0xcd')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa2af('0xcf')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xa2af('0x89')][_0xa2af('0xd')]=function(_0x3cac3b){var _0x30c21f=this;if(!_0x30c21f['queuesSummary'][_0x3cac3b[_0xa2af('0x4c')]]){_0x30c21f['queuesSummary'][_0x3cac3b[_0xa2af('0x4c')]]={'running':![]};}else if(_0x30c21f[_0xa2af('0x30')][_0x3cac3b[_0xa2af('0x4c')]][_0xa2af('0x13a')]===!![]){return;}else if(_0x30c21f['queuesSummary'][_0x3cac3b['name']][_0xa2af('0x13a')]===![]){_0x30c21f[_0xa2af('0x30')][_0x3cac3b[_0xa2af('0x4c')]][_0xa2af('0x13a')]=!![];}var _0x56f107=_0x30c21f[_0xa2af('0x22')][_0x3cac3b[_0xa2af('0x4c')]];var _0x1b3443=_0x56f107[_0xa2af('0x6f')]!==utils[_0xa2af('0x70')][_0xa2af('0x81')];var _0x294898=utils['isPreviewCampaign'](_0x56f107);_0x56f107[_0xa2af('0x13b')]=utils['getQueueCampaignStatusMessage'](_0x56f107,_0x30c21f[_0xa2af('0x25')]);Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](function(){if(_0x56f107[_0xa2af('0x13b')]===utils[_0xa2af('0x70')][_0xa2af('0x81')]){if(_0x1b3443){clearPredictiveAttributes(_0x56f107);_0x3cac3b[_0xa2af('0x2c')]=undefined;_0x3cac3b[_0xa2af('0x2d')]=undefined;}if(_0x56f107['statusMessage']===utils[_0xa2af('0x70')]['INACTIVE']){_0x3cac3b[_0xa2af('0x13c')]=0x0;_0x3cac3b[_0xa2af('0xfa')]=0x0;_0x3cac3b[_0xa2af('0x13d')]=0x0;_0x3cac3b[_0xa2af('0x13e')]=0x0;_0x3cac3b[_0xa2af('0x13f')]=0x0;}}else if(_0x56f107[_0xa2af('0x13b')]===utils['CAMPAIGN_STATUS'][_0xa2af('0x140')]&&!_0x294898){return _0x30c21f[_0xa2af('0x94')](_0x56f107,!![])['then'](function(){return _0x30c21f[_0xa2af('0x94')](_0x56f107,![]);})[_0xa2af('0x42')](function(){return _0x30c21f['checkDialMethod'](_0x56f107);})[_0xa2af('0xa1')](function(_0x367ef1){loggerSyncQueueSummary[_0xa2af('0x67')](_0xa2af('0x141'),util[_0xa2af('0x49')](_0x367ef1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x56f107);});}else{clearPredictiveAttributes(_0x56f107);}})[_0xa2af('0x42')](function(){var _0x2e468d=_0x3cac3b['compareToOutboundQueue'](_0x56f107);if(_0x2e468d||_0x56f107[_0xa2af('0x142')]){_0x56f107[_0xa2af('0x142')]=![];_0x3cac3b[_0xa2af('0x143')](_0x56f107);Object[_0xa2af('0x144')](_0x56f107,_0x3cac3b);emitOutboundVoiceQueueSummary(_0x3cac3b);}_0x30c21f['queuesSummary'][_0x56f107[_0xa2af('0x4c')]][_0xa2af('0x13a')]=![];})[_0xa2af('0xa1')](function(_0x4ae32f){logger[_0xa2af('0x6b')](_0xa2af('0x141'),util[_0xa2af('0x49')](_0x4ae32f,{'showHidden':![],'depth':null}));_0x30c21f[_0xa2af('0x30')][_0x56f107[_0xa2af('0x4c')]][_0xa2af('0x13a')]=![];});};Dialer['prototype'][_0xa2af('0x38')]=_[_0xa2af('0x145')](function(){var _0x122f69=_['filter'](this['voiceQueues'],function(_0x42ce38){return _0x42ce38[_0xa2af('0x146')];});var _0xde4392=_[_0xa2af('0x147')](this['agents'],function(_0x2430ec){return _0x2430ec[_0xa2af('0x148')]&&_0x2430ec[_0xa2af('0x8d')]===_0xa2af('0x8e');});if(_0x122f69[_0xa2af('0x149')]>0x0&&_0xde4392['length']>0x0){return Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](cmHopper[_0xa2af('0x14a')](_[_0xa2af('0x14b')](_0x122f69,'id'),previewRecallmeReminderInterval,_['map'](_0xde4392,'id')))[_0xa2af('0x42')](function(_0x8a6404){for(var _0x718ac9=0x0;_0x718ac9<_0x8a6404[_0xa2af('0x149')];_0x718ac9++){var _0x30674f=_0x8a6404[_0x718ac9][_0xa2af('0x14c')]['name'];if(_0x30674f)io['to'](util[_0xa2af('0x4a')](_0xa2af('0x14d'),_0x30674f))[_0xa2af('0x45')](_0xa2af('0x14e'),{'hopper':_0x8a6404[_0x718ac9]});}})[_0xa2af('0xa1')](function(_0x5a5ea5){logger[_0xa2af('0x6b')](_0xa2af('0x14f'),_0x5a5ea5);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa2af('0x89')][_0xa2af('0x41')]=function(){var _0x41ff13=this;setInterval(function(){_0x41ff13[_0xa2af('0x150')](_0x41ff13[_0xa2af('0x2a')],_0xa2af('0x151'));_0x41ff13[_0xa2af('0x150')](_0x41ff13[_0xa2af('0x28')],'[actions]');},0x32c8);};Dialer[_0xa2af('0x89')][_0xa2af('0x150')]=function(_0xb2c119,_0x2491f2){var _0x3b311e=this;for(var _0x5dc608 in _0xb2c119){if(typeof _0xb2c119[_0x5dc608]!=='undefined'){this[_0xa2af('0x20')][_0xa2af('0x1d')](function(){if(!_['isNil'](_0xb2c119[_0x5dc608])){return ami['Action']({'action':'status','channel':_0xb2c119[_0x5dc608]['channel']})[_0xa2af('0xa1')](function(_0xa16990){if(_0xa16990[_0xa2af('0x6f')]===_0xa2af('0x152')){setTimeout(function(){if(_0xb2c119[_0x5dc608]&&_0xb2c119[_0x5dc608]['type']!=='ivr'){_0x3b311e['updateOriginated'](_0x3b311e['voiceQueues'][_0xb2c119[_0x5dc608][_0xa2af('0xc3')]]);logger[_0xa2af('0x6b')](_0xa2af('0x153'),_0x2491f2,_0x5dc608,_0xb2c119[_0x5dc608]['queue']);delete _0xb2c119[_0x5dc608];}if(_0xb2c119[_0x5dc608]&&_0xb2c119[_0x5dc608][_0xa2af('0x46')]==='ivr'){_0x3b311e[_0xa2af('0xd1')](_0x3b311e[_0xa2af('0x23')][_0xb2c119[_0x5dc608][_0xa2af('0xc3')]]);logger['error'](_0xa2af('0x154'),_0x2491f2,_0x5dc608,_0xb2c119[_0x5dc608]['queue']);delete _0xb2c119[_0x5dc608];}},0x2328);}});}});}}};Dialer[_0xa2af('0x89')][_0xa2af('0x155')]=function(_0x287d14){return Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](voiceQueueRt[_0xa2af('0x155')](_0x287d14))[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x156')));};Dialer[_0xa2af('0x89')][_0xa2af('0xd1')]=function(_0xfada28){if(!_['isUndefined'](_0xfada28)&&_0xfada28!==null){if(typeof _0xfada28[_0xa2af('0x157')]!=='undefined'){if(_0xfada28[_0xa2af('0x157')]>0x0){_0xfada28[_0xa2af('0x157')]-=0x1;}else{logger[_0xa2af('0x6b')](_0xa2af('0x158'));}}}else{logger['error'](_0xa2af('0x159'));}};Dialer[_0xa2af('0x89')][_0xa2af('0x15a')]=function(_0x56e81c,_0x4d19d4){var _0x260b87=this;return function(_0x71e276){_0x260b87['updateOriginated'](_0x4d19d4);logger[_0xa2af('0x6b')](_0x56e81c,util[_0xa2af('0x49')](_0x71e276,{'showHidden':![],'depth':null}));};};Dialer[_0xa2af('0x89')][_0xa2af('0x15b')]=function(_0x3b20d5,_0x2cfc10,_0x11a546){var _0x295d41={'state':0x19,'statedesc':_0xa2af('0x15c')};this[_0xa2af('0xd1')](_0x2cfc10);this[_0xa2af('0x118')](_[_0xa2af('0x65')](_0x295d41,_[_0xa2af('0xfc')](_0x11a546,[_0xa2af('0xdf'),'ListId',_0xa2af('0x15d'),_0xa2af('0xe1'),_0xa2af('0xe2')])),_0xa2af('0x15e'),_0xa2af('0x15f'));logger[_0xa2af('0x6b')](_0x3b20d5);};Dialer['prototype']['saveInDb']=function(_0x34fb0a,_0x38a529,_0x13d381){hopperUtils[_0xa2af('0xcd')](_0x34fb0a)['catch'](loggerCatch(_0x38a529));hopperUtils['moveContactManagedDialer'](_0x34fb0a)[_0xa2af('0xa1')](loggerCatch(_0x13d381));};Dialer[_0xa2af('0x89')]['queueCallerAbandonCreateState']=function(_0x197fcf,_0x5a1599){hopperUtils[_0xa2af('0xcd')](_0x197fcf)[_0xa2af('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x5a1599==0x0){hopperUtils['moveContactManagedDialer'](_0x197fcf)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xa2af('0x89')][_0xa2af('0x14f')]=function(_0x1d08cd){return Promise[_0xa2af('0xaf')]()['then'](cmHopper[_0xa2af('0x14a')](_0x1d08cd['id'],previewRecallmeReminderInterval))['then'](function(_0x398202){for(var _0xa7172b=0x0;_0xa7172b<_0x398202[_0xa2af('0x149')];_0xa7172b++){var _0x19e9bd=_0x398202[_0xa7172b][_0xa2af('0x14c')][_0xa2af('0x4c')];if(_0x19e9bd)io['to'](util[_0xa2af('0x4a')]('user:%s',_0x19e9bd))[_0xa2af('0x45')]('user:dialPreviewRecallReminder',{'hopper':_0x398202[_0xa7172b]});}})[_0xa2af('0xa1')](function(){});};Dialer[_0xa2af('0x89')][_0xa2af('0xb4')]=function(_0x8cfdcc){var _0x1d60d9=this;return function(){_0x1d60d9[_0xa2af('0x160')](_0x8cfdcc);};};Dialer[_0xa2af('0x89')][_0xa2af('0x161')]=function(_0x15ea32,_0x4efc30){var _0x1907cc=this;var _0x52fb08=uuid['v4']();this[_0xa2af('0x28')][_0x52fb08]=new Action(_0x15ea32,_0x4efc30,_0x52fb08);return new Promise(function(_0x12aaba,_0x5c3b5a){if(_[_0xa2af('0x44')](_0x15ea32)&&typeof _0x15ea32!=='object'){return _0x5c3b5a(msgResponse(_0xa2af('0x162'),_0xa2af('0x95'),_0xa2af('0x163')));}if(_[_0xa2af('0x44')](_0x4efc30['phone'])||_0x4efc30[_0xa2af('0x164')]===null){return _0x5c3b5a(msgResponse(_0xa2af('0x162'),'Failure',_0xa2af('0x165')));}var _0x311771={'XMD-CALLERID':_0x1907cc['actions'][_0x52fb08][_0xa2af('0x166')](),'XMD-AGI':_0x15ea32[_0xa2af('0x167')]?util[_0xa2af('0x4a')](_0xa2af('0x168'),ipAgi,_0x15ea32[_0xa2af('0x167')]):'NONE','XMD-AGIAFTER':_0x15ea32[_0xa2af('0xcc')]?util[_0xa2af('0x4a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x15ea32[_0xa2af('0xcc')]):'NONE','XMD-QUEUE':utils[_0xa2af('0x169')](_0x15ea32)?util[_0xa2af('0x4a')](_0xa2af('0x16a'),_0x15ea32['name'],_0x15ea32[_0xa2af('0x16b')]||'',_0x15ea32[_0xa2af('0x16c')]?'c':'',_0x15ea32[_0xa2af('0x16d')]||0x3):_0xa2af('0x16e'),'XMD-CONTACTID':_0x4efc30[_0xa2af('0xdf')],'XMD-CDRTYPE':_0xa2af('0x9'),'CALLERID(all)':_0x1907cc[_0xa2af('0x28')][_0x52fb08][_0xa2af('0x166')](),'XMD-AMD':_0x15ea32['dialAMDActive']?_0xa2af('0x140'):_0xa2af('0x16e'),'XMD-DESTINATION':_0xa2af('0x112')};if(_0x15ea32[_0xa2af('0x113')]){_0x311771[_0xa2af('0x16f')]=_0x15ea32[_0xa2af('0x170')]||0x9c4;_0x311771[_0xa2af('0x171')]=_0x15ea32[_0xa2af('0x172')]||0x5dc;_0x311771['XMD-AMDAFTERGREETINGSILENCE']=_0x15ea32['dialAMDAfterGreetingSilence']||0x320;_0x311771[_0xa2af('0x173')]=_0x15ea32[_0xa2af('0x174')]||0x1388;_0x311771['XMD-AMDMINWORDLENGTH']=_0x15ea32[_0xa2af('0x175')]||0x64;_0x311771['XMD-AMDBETWEENWORDSSILENCE']=_0x15ea32[_0xa2af('0x176')]||0x32;_0x311771[_0xa2af('0x177')]=_0x15ea32[_0xa2af('0x178')]||0x3;_0x311771['XMD-AMDSILENCETHRESHOLD']=_0x15ea32[_0xa2af('0x179')]||0x100;_0x311771['XMD-AMDMAXIMUMWORDLENGTH']=_0x15ea32[_0xa2af('0x17a')]||0x1388;}if(utils['isOutboundQueue'](_0x15ea32)){_0x311771['XMD-VOICEQUEUEID']=_0x4efc30['VoiceQueueId'];}else{_0x311771[_0xa2af('0x17b')]=_0x4efc30['CampaignId'];}var _0x515cd9=utils[_0xa2af('0x17c')](_0x4efc30[_0xa2af('0x17d')]);Object['assign'](_0x311771,_0x515cd9);var _0x1d6055=_0x1907cc[_0xa2af('0x8a')](_0x15ea32[_0xa2af('0x17e')])?utils[_0xa2af('0x17f')](_0x15ea32[_0xa2af('0x17e')]['callerid'],_0x15ea32[_0xa2af('0x180')],_0x15ea32[_0xa2af('0x181')]>0x0?utils[_0xa2af('0x182')](_0x15ea32[_0xa2af('0x183')],_0x15ea32[_0xa2af('0x181')]):_0x15ea32[_0xa2af('0x183')]):utils['getCallerId'](_[_0xa2af('0xf8')](_0x15ea32['TrunkBackup'])?_0x15ea32[_0xa2af('0x17e')][_0xa2af('0x184')]:_0x15ea32[_0xa2af('0x185')]['callerid'],_0x15ea32[_0xa2af('0x180')],_0x15ea32['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xa2af('0x182')](_0x15ea32[_0xa2af('0x183')],_0x15ea32[_0xa2af('0x181')]):_0x15ea32['dialOriginateCallerIdNumber']);if(_0x1d6055){_0x311771[_0xa2af('0x186')]=_0x1907cc[_0xa2af('0x28')][_0x52fb08][_0xa2af('0x187')]=utils[_0xa2af('0x188')](_0x1d6055);_0x311771[_0xa2af('0x189')]=_0x4efc30[_0xa2af('0x164')];}_0x15ea32[_0xa2af('0x18a')]=_0x311771;return ami['Action']({'actionid':_0x52fb08,'action':'originate','channel':_0x1907cc['isTrunkReachable'](_0x15ea32[_0xa2af('0x17e')])?util[_0xa2af('0x4a')](_0xa2af('0x18b'),_0x15ea32[_0xa2af('0x17e')]['name'],isNotNull(_0x15ea32['dialPrefix'])?_0x15ea32[_0xa2af('0x18c')][_0xa2af('0x18d')]()||'':'',_0x15ea32['dialCutDigit']>0x0?_0x4efc30[_0xa2af('0x164')][_0xa2af('0x18e')](_0x15ea32[_0xa2af('0x18f')]):_0x4efc30[_0xa2af('0x164')]):util[_0xa2af('0x4a')](_0xa2af('0x18b'),_[_0xa2af('0xf8')](_0x15ea32['TrunkBackup'])?_0x15ea32['Trunk']['name']:_0x15ea32[_0xa2af('0x185')][_0xa2af('0x4c')],isNotNull(_0x15ea32[_0xa2af('0x18c')])?_0x15ea32[_0xa2af('0x18c')][_0xa2af('0x18d')]()||'':'',_0x15ea32[_0xa2af('0x18f')]>0x0?_0x4efc30[_0xa2af('0x164')]['substring'](_0x15ea32[_0xa2af('0x18f')]):_0x4efc30[_0xa2af('0x164')]),'callerid':_0x1d6055,'Exten':_0xa2af('0x112'),'Context':_0xa2af('0x190'),'Priority':'1','variable':_0x311771,'timeout':(_0x15ea32[_0xa2af('0x191')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52fb08})[_0xa2af('0x42')](function(_0xfb86f1){return _0x12aaba(_0xfb86f1);})[_0xa2af('0xa1')](function(_0xf82531){_0x15ea32['outboundOriginateFailureCallsDay']+=0x1;var _0x45efc0=new History(_0x1907cc[_0xa2af('0x28')][_0x52fb08]);logger['error'](util[_0xa2af('0x4a')](_0xa2af('0x192'),JSON['stringify'](_0xf82531)));_0x45efc0[_0xa2af('0x75')]=0xe;_0x45efc0[_0xa2af('0x76')]=_0xa2af('0x193');_0x45efc0['starttime']=moment()['format'](_0xa2af('0xc7'));_0x45efc0['endtime']=_0x45efc0[_0xa2af('0xe4')];hopperUtils[_0xa2af('0xcd')](_0x45efc0)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x194')));_0x1907cc[_0xa2af('0xcf')](_0x45efc0)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x194')))[_0xa2af('0x1f')](function(){delete _0x1907cc[_0xa2af('0x28')][_0x52fb08];return _0x5c3b5a(msgResponse('originate',_0xa2af('0x88'),_0xa2af('0x195')));});});});};Dialer[_0xa2af('0x89')][_0xa2af('0x196')]=function(_0x12feb6,_0x446a99,_0x2608a1){var _0x54139c=new History(_0x446a99);if(_0x54139c[_0xa2af('0x122')]+_0x54139c['countcongestionretry']+_0x54139c[_0xa2af('0x130')]+_0x54139c[_0xa2af('0x124')]+_0x54139c[_0xa2af('0xdd')]+_0x54139c[_0xa2af('0xeb')]+_0x54139c['countmachineretry']+_0x54139c[_0xa2af('0x126')]>=_0x2608a1['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x12feb6){case 0x3:if(_0x54139c['countnoanswerretry']>=_0x2608a1[_0xa2af('0x197')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countnoanswerretry':_0x54139c[_0xa2af('0x130')]+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1[_0xa2af('0x198')],_0xa2af('0xee'))['format'](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x199')));break;case 0x5:if(_0x54139c[_0xa2af('0x122')]>=_0x2608a1[_0xa2af('0x19a')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countbusyretry':_0x54139c['countbusyretry']+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1['dialBusyRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c['VoiceQueueId']||undefined,'CampaignId':_0x54139c['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x54139c['countcongestionretry']>=_0x2608a1[_0xa2af('0x19b')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countcongestionretry':_0x54139c[_0xa2af('0x123')]+=0x1,'scheduledat':moment()['add'](_0x2608a1[_0xa2af('0x19c')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c['ListId'],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x19d')));break;case 0x0:if(_0x54139c['countnosuchnumberretry']>=_0x2608a1[_0xa2af('0x19e')]-0x1){return!![];}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countnosuchnumberretry':_0x54139c[_0xa2af('0x124')]+=0x1,'scheduledat':moment()['add'](_0x2608a1[_0xa2af('0x19f')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c['ContactId'],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})['catch'](loggerCatch(_0xa2af('0x1a0')));}break;case 0xa:if(_0x54139c[_0xa2af('0xdd')]>=_0x2608a1[_0xa2af('0xda')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countdropretry':_0x54139c['countdropretry']+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1[_0xa2af('0xd6')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xe3')));break;case 0xb:if(_0x54139c[_0xa2af('0xeb')]>=_0x2608a1['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countabandonedretry':_0x54139c[_0xa2af('0xeb')]+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1[_0xa2af('0xec')],'minutes')[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c['ContactId'],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xef')));break;case 0x13:if(_0x54139c[_0xa2af('0x125')]>=_0x2608a1[_0xa2af('0x12a')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countmachineretry':_0x54139c[_0xa2af('0x125')]+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1['dialMachineRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x131')));break;case 0x14:if(_0x54139c[_0xa2af('0x126')]>=_0x2608a1[_0xa2af('0x1a1')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countagentrejectretry':_0x54139c['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x2608a1['dialAgentRejectRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1a2')));break;default:return!![];}};Dialer[_0xa2af('0x89')][_0xa2af('0x1a3')]=function(_0x209d62,_0x38055a,_0x15272e){var _0x104c99=this;var _0x14103b=new History(_0x209d62);var _0x275924=![];var _0x4c2c88;var _0x5a86f2;return new Promise(function(_0x4d238e,_0x809153){if(_['isUndefined'](_0x38055a)&&typeof _0x38055a!==_0xa2af('0x1a4')){return _0x809153(msgResponse(_0xa2af('0x1a5'),_0xa2af('0x95'),_0xa2af('0x1a6')));}if(_['isUndefined'](_0x15272e)&&typeof _0x15272e!==_0xa2af('0x1a4')){return _0x809153(msgResponse(_0xa2af('0x1a5'),_0xa2af('0x95'),_0xa2af('0x1a7')));}hopperUtils[_0xa2af('0xd7')](_0x14103b,_0x15272e[_0xa2af('0xc9')],_0x38055a)['then'](function(_0x512185){if(_0x512185['additional']==0x1)_0x275924=!![];switch(_0x15272e['reason']){case'0':_0x38055a[_0xa2af('0x1a8')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x0;_0x14103b['statedesc']=_0xa2af('0x1a9');_0x14103b[_0xa2af('0x124')]+=0x1;_0x14103b[_0xa2af('0xd5')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0xa2af('0x120')](_0x209d62,_0xa2af('0x1aa')));_0x4c2c88=_0x38055a[_0xa2af('0x19f')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x121')));if(_0x104c99[_0xa2af('0x196')](0x0,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x124')]>=_0x38055a['dialNoSuchNumberMaxRetry']){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1ac'));}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1ac'));}}break;case'3':_0x38055a[_0xa2af('0x1ad')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x3;_0x14103b[_0xa2af('0x76')]=_0xa2af('0x1ae');_0x14103b[_0xa2af('0x130')]+=0x1;_0x14103b[_0xa2af('0xd5')]+=0x1;var _0x4a8601=ut[_0xa2af('0x1af')](_0x209d62,_0x38055a);ami[_0xa2af('0x45')](_0xa2af('0x1b0'),_0x4a8601);_0x4c2c88=_0x38055a['dialNoAnswerRetryFrequency'];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1b1')));if(_0x104c99[_0xa2af('0x196')](0x3,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x130')]>=_0x38055a['dialNoAnswerMaxRetry']){_0x104c99['createStateFinal'](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1b2'));}else{_0x104c99['stateGlobal'](_0x14103b,_0x4d238e,_0x809153,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x38055a[_0xa2af('0x1b3')]+=0x1;_0x14103b['state']=0x5;_0x14103b[_0xa2af('0x76')]='Busy';_0x14103b[_0xa2af('0x122')]+=0x1;_0x14103b['countglobal']+=0x1;ami[_0xa2af('0x45')](_0xa2af('0x1b4'),ut[_0xa2af('0x120')](_0x209d62,'busy'));_0x4c2c88=_0x38055a[_0xa2af('0x1b5')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)['catch'](loggerCatch(_0xa2af('0x1b6')));if(_0x104c99[_0xa2af('0x196')](0x5,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b['countbusyretry']>=_0x38055a[_0xa2af('0x19a')]){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1b7'));}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1b7'));}}break;case'8':_0x38055a[_0xa2af('0x1b8')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x8;_0x14103b['statedesc']=_0xa2af('0x1b9');_0x14103b[_0xa2af('0x123')]+=0x1;_0x14103b['countglobal']+=0x1;_0x4c2c88=_0x38055a[_0xa2af('0x19c')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];ami[_0xa2af('0x45')](_0xa2af('0x1ba'),ut[_0xa2af('0x120')](_0x209d62,_0xa2af('0x1bb')));hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1bc')));if(_0x104c99[_0xa2af('0x196')](0x8,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x123')]>=_0x38055a[_0xa2af('0x19b')]){_0x104c99['createStateFinal'](_0x14103b,_0x4d238e,_0x809153,'reason\x208\x20congestion');}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1bd'));}}break;case'11':_0x38055a[_0xa2af('0x1be')]+=0x1;_0x14103b[_0xa2af('0x75')]=0xb;_0x14103b[_0xa2af('0x76')]=_0xa2af('0xe8');_0x14103b[_0xa2af('0xeb')]+=0x1;_0x14103b['countglobal']+=0x1;_0x4c2c88=_0x38055a[_0xa2af('0xec')];_0x5a86f2=_0x38055a['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xf1')));if(_0x104c99[_0xa2af('0x196')](0xb,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0xeb')]>=_0x38055a['dialAbandonedMaxRetry']){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1bf'));}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1bf'));}}break;case'20':_0x38055a[_0xa2af('0x1c0')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x14;_0x14103b[_0xa2af('0x76')]=_0xa2af('0x1c1');_0x14103b[_0xa2af('0x126')]+=0x1;_0x14103b[_0xa2af('0xd5')]+=0x1;_0x4c2c88=_0x38055a['dialAgentRejectRetryFrequency'];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];ami[_0xa2af('0x45')](_0xa2af('0x1c2'),ut[_0xa2af('0x120')](_0x209d62,'agentreject'));hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1c3')));if(_0x104c99[_0xa2af('0x196')](0x14,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b['countagentrejectretry']>=_0x38055a[_0xa2af('0x1a1')]){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,'reason\x2020\x20agentreject');}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,'reason\x2020\x20agentreject');}}break;default:_0x38055a['outboundUnknownCallsDay']+=0x1;_0x14103b[_0xa2af('0x75')]=0xc;_0x14103b['statedesc']=_0x15272e['reason'];_0x4c2c88=_0x38055a[_0xa2af('0x1c4')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x104c99[_0xa2af('0x196')](_0x15272e['reason'],_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x122')]+_0x14103b[_0xa2af('0x123')]+_0x14103b[_0xa2af('0x130')]+_0x14103b['countnosuchnumberretry']+_0x14103b[_0xa2af('0xdd')]+_0x14103b[_0xa2af('0xeb')]+_0x14103b['countmachineretry']+_0x14103b[_0xa2af('0x126')]>=_0x38055a[_0xa2af('0x127')]){_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0x15272e[_0xa2af('0xc9')]);}else{_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0x15272e['reason']);}}}})[_0xa2af('0x42')](function(){if(_0x275924){hopperUtils[_0xa2af('0xe7')](_0x14103b,_0x4c2c88,_0x5a86f2)['then'](function(){return _0x4d238e(0x1);});}});});};Dialer[_0xa2af('0x89')]['stateGlobal']=function(_0x1b3dc1,_0x2d13ad,_0x459dbe,_0x22b146){var _0x12deae=new Final(_0x1b3dc1);_0x12deae['state']=0xf;_0x12deae[_0xa2af('0x76')]='Global';this['createStateFinal'](_0x12deae,_0x2d13ad,_0x459dbe,_0x22b146);};Dialer[_0xa2af('0x89')][_0xa2af('0x12b')]=function(_0x5dc612,_0x31cf2d,_0x96609d,_0xf589c2){hopperUtils['moveContactManagedDialer'](_0x5dc612)['then'](function(){return _0x31cf2d(msgResponse(_0xa2af('0x1a5'),_0xa2af('0x10c'),_0xf589c2));})['catch'](function(){return _0x96609d(msgResponse('[moveContactManagedDialer][0]',_0xa2af('0x95'),_0xa2af('0x1c5')));});};Dialer['prototype'][_0xa2af('0xc')]=function(_0xae421a){var _0x41d06b=_0xae421a[_0xa2af('0x1c6')]/0x64;var _0x11c857=_0xae421a[_0xa2af('0xd3')]/(_0xae421a[_0xa2af('0xd3')]+_0xae421a['outboundAnswerCallsDay']);var _0x1db2d0=Math[_0xa2af('0x1c7')](_0xae421a['predictiveIntervalAvailable']*(_0xae421a[_0xa2af('0x1c8')]/0x64));var _0x51d030=Math['round'](_0xae421a['predictiveIntervalAvailable']*(_0xae421a[_0xa2af('0x1c9')]/0x64));var _0x23c942=_0xae421a['available']+_0xae421a[_0xa2af('0x13e')];var _0x235e63=Math['floor'](_0xae421a[_0xa2af('0x60')]*_0xae421a[_0xa2af('0x62')]*_0xae421a[_0xa2af('0x1ca')]*_0xae421a['predictiveIntervalMultiplicativeFactor']);if(_[_0xa2af('0x44')](_0xae421a['startProgressive'])){if(!_['isUndefined'](_0xae421a[_0xa2af('0x2c')])){_0xae421a[_0xa2af('0x2c')]=undefined;loggerPredictive[_0xa2af('0x6b')](_0xa2af('0x1cb'),_0xa2af('0x1cc'));}if(!_[_0xa2af('0x44')](_0xae421a['handlePredictive'])){loggerPredictive[_0xa2af('0x6b')](_0xa2af('0x1cb'),_0xa2af('0x1cd'));clearInterval(_0xae421a[_0xa2af('0x6a')]);_0xae421a['handlePredictive']=undefined;}_0xae421a[_0xa2af('0x2d')]=moment()['format'](_0xa2af('0xc7'));loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],_0xa2af('0x1ce'),_0xae421a['startProgressive']);this[_0xa2af('0xb8')](_0xae421a,0x1);}else if(ifInterval(_0xae421a[_0xa2af('0x1cf')],_0xae421a[_0xa2af('0x2d')])){this[_0xa2af('0xb8')](_0xae421a,0x1);loggerPredictiveCalls[_0xa2af('0x4f')](_0xa2af('0x1d0'),_0xae421a[_0xa2af('0x2d')],_0xae421a[_0xa2af('0x4c')]);_0xae421a[_0xa2af('0x60')]=0x0;_0xae421a[_0xa2af('0x1d1')]=0x0;}else if(_0x41d06b<_0x11c857&&_0xae421a[_0xa2af('0x1d2')]===_0xa2af('0x1d3')){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x1d4'),_0xa2af('0x1d5'),_0x11c857,'startProgressive',_0xae421a[_0xa2af('0x4c')]);}else if(_0x235e63<_0xae421a['predictiveIntervalErlangCallsDroppedCalls']&&_0xae421a['dialPredictiveOptimization']===_0xa2af('0x1d3')){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x1d6'),_0xa2af('0x1d7'),_0x235e63,_0xa2af('0x1d8'),_0xae421a['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0xae421a['name']);}else if(!ifInterval(_0xae421a['dialPredictiveInterval'],_0xae421a[_0xa2af('0x2d')])&&_[_0xa2af('0x44')](_0xae421a[_0xa2af('0x2c')])&&!_[_0xa2af('0x44')](_0xae421a['startProgressive'])){_0xae421a[_0xa2af('0x2c')]=moment()['format'](_0xa2af('0xc7'));loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],_0xa2af('0x1d9'),_0xae421a[_0xa2af('0x2c')]);hopperUtils[_0xa2af('0x1da')](_0xae421a[_0xa2af('0x1cf')])['then'](this[_0xa2af('0x1db')](_0xae421a))['then'](mergeDataErlangB(_0xae421a))[_0xa2af('0x42')](this[_0xa2af('0x1dc')](_0xae421a))[_0xa2af('0xa1')](loggerCatchPredictive(_0xa2af('0x1dd'),_0xae421a));}else if(!ifInterval(_0xae421a[_0xa2af('0x1cf')],_0xae421a[_0xa2af('0x2c')])){_0xae421a[_0xa2af('0x1d1')]=0x0;_0xae421a['startPredictive']=moment()[_0xa2af('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa2af('0x4f')](_0xae421a['name'],'recalculate\x20predictive\x20at',_0xae421a[_0xa2af('0x2c')]);clearInterval(_0xae421a[_0xa2af('0x6a')]);_0xae421a[_0xa2af('0x6a')]=undefined;hopperUtils[_0xa2af('0x1da')](_0xae421a[_0xa2af('0x1cf')])[_0xa2af('0x42')](this[_0xa2af('0x1db')](_0xae421a))[_0xa2af('0x42')](mergeDataErlangB(_0xae421a))['then'](this[_0xa2af('0x1dc')](_0xae421a))[_0xa2af('0xa1')](loggerCatchPredictive(_0xa2af('0x1de'),_0xae421a));}else if(_0xae421a[_0xa2af('0x1df')]&&_0x23c942<_0xae421a['predictiveIntervalAvailable']-_0x51d030){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],_0xa2af('0x1e0'),_0x23c942,_0xa2af('0x1e1'),_0xae421a[_0xa2af('0x1df')],'-',_0x51d030,'=',_0xae421a[_0xa2af('0x1df')]-_0x51d030,')');}else if(_0xae421a[_0xa2af('0x1df')]&&_0x23c942>_0xae421a[_0xa2af('0x1df')]+_0x1db2d0){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x23c942,_0xa2af('0x1e2'),_0xae421a['predictiveIntervalAvailable'],'+',_0x1db2d0,'=',_0xae421a[_0xa2af('0x1df')]+_0x1db2d0,')');}};Dialer[_0xa2af('0x89')]['getDataPredictive']=function(_0x32dd00){var _0x5b8f55=this;return function(_0x2ae781){return new Promise(function(_0x2ebe82,_0x27f0da){_[_0xa2af('0x65')](_0x32dd00,_0x2ae781[0x0]);if(checkGetDataPredictive(_0x2ae781[0x0])){var _0x1d7f21=_0x32dd00[_0xa2af('0x1df')]=_0x32dd00[_0xa2af('0x13e')]+_0x32dd00[_0xa2af('0x13c')];var _0x5abc57=_0x32dd00[_0xa2af('0x1cf')]*0x3c;var _0x1fa75e=_0x2ae781[0x0][_0xa2af('0x1e3')]+_0x2ae781[0x0]['predictiveIntervalAvgHoldtime'];var _0x27180f=(_0x2ae781[0x0][_0xa2af('0x53')]+_0x2ae781[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2ae781[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2ae781[0x0]['predictiveIntervalTotalCalls'];_0x32dd00[_0xa2af('0x1ca')]=_0x27180f>0x0?_0x27180f:0x1;switch(_0x32dd00[_0xa2af('0x1d2')]){case _0xa2af('0x1d3'):var _0xa982f0=_0x32dd00['dialPredictiveOptimizationPercentage']/0x64;return _0x5b8f55['abandonmentRate'](_0x1d7f21,_0x5abc57,_0x1fa75e,_0x27180f,_0xa982f0)[_0xa2af('0x42')](function(_0xfb1467){return _0x2ebe82(_0xfb1467);});case _0xa2af('0x1e4'):var _0x740a39=_0x32dd00['dialPredictiveOptimizationPercentage']/0x64;return _0x5b8f55[_0xa2af('0x1e5')](_0x1d7f21,_0x5abc57,_0x1fa75e,_0x27180f,_0x740a39)[_0xa2af('0x42')](function(_0x5be74a){return _0x2ebe82(_0x5be74a);});default:return _0x27f0da(msgResponse(_0xa2af('0x1e6'),'Failure',_0xa2af('0x1e7')));}}else{return _0x27f0da(msgResponse(_0xa2af('0x1e6'),_0xa2af('0x95'),_0xa2af('0x1e8')));}});};};Dialer[_0xa2af('0x89')]['getDataPredictiveOld']=function(_0x1decd2){var _0x577667=this;return function(_0x402aa4){return new Promise(function(_0x56b1d1,_0x279f8c){_[_0xa2af('0x65')](_0x1decd2,_0x402aa4[0x0]);if(checkGetDataPredictive(_0x402aa4[0x0])){loggerPredictive[_0xa2af('0x4f')](JSON[_0xa2af('0x7b')](_0x402aa4[0x0]));if(_0x1decd2[_0xa2af('0x1d2')]===_0xa2af('0x1d3')){return _0x577667['getVoiceQueueRtPauses'](_0x1decd2['id'])['then'](function(_0x5e9e20){var _0x56ffff=_0x1decd2[_0xa2af('0x1e9')]-_0x5e9e20[0x0][_0xa2af('0x1ea')];var _0x5e6d5b=_0x1decd2[_0xa2af('0x1cf')]*0x3c;var _0x3306f0=_0x402aa4[0x0][_0xa2af('0x1e3')]+_0x402aa4[0x0]['predictiveIntervalAvgHoldtime'];var _0x9818bf=(_0x402aa4[0x0][_0xa2af('0x53')]+_0x402aa4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x402aa4[0x0][_0xa2af('0x56')])/_0x402aa4[0x0][_0xa2af('0x51')];var _0x134bb7=_0x1decd2[_0xa2af('0x1c6')]/0x64;_0x1decd2[_0xa2af('0x1eb')]=_0x5e9e20[0x0][_0xa2af('0x1ea')]||0x0;_0x1decd2[_0xa2af('0x1ca')]=_0x9818bf>0x0?_0x9818bf:0x1;return _0x577667['abandonmentRate'](_0x56ffff,_0x5e6d5b,_0x3306f0,_0x9818bf,_0x134bb7);})[_0xa2af('0x42')](function(_0x409f96){return _0x56b1d1(_0x409f96);})['catch'](function(_0x473c1d){return _0x279f8c(msgResponse(_0xa2af('0x1ec'),_0xa2af('0x95'),JSON[_0xa2af('0x7b')](_0x473c1d)));});}if(_0x1decd2['dialPredictiveOptimization']===_0xa2af('0x1e4')){return _0x577667[_0xa2af('0x155')](_0x1decd2['id'])['then'](function(_0x2d4a6e){var _0x53dc05=_0x1decd2[_0xa2af('0x1e9')]-_0x2d4a6e[0x0][_0xa2af('0x1ea')];var _0x293a2b=_0x1decd2[_0xa2af('0x1cf')]*0x3c;var _0x8933fd=_0x402aa4[0x0][_0xa2af('0x1e3')]+_0x402aa4[0x0][_0xa2af('0x58')];var _0x114061=(_0x402aa4[0x0][_0xa2af('0x53')]+_0x402aa4[0x0][_0xa2af('0x55')]+_0x402aa4[0x0][_0xa2af('0x56')])/_0x402aa4[0x0][_0xa2af('0x51')];var _0x3bebaa=_0x1decd2['dialPredictiveOptimizationPercentage']/0x64;_0x1decd2[_0xa2af('0x1eb')]=_0x2d4a6e[0x0]['outboundQueuePauses']||0x0;_0x1decd2[_0xa2af('0x1ca')]=_0x114061>0x0?_0x114061:0x1;return _0x577667[_0xa2af('0x1e5')](_0x53dc05,_0x293a2b,_0x8933fd,_0x114061,_0x3bebaa);})['then'](function(_0x506ef3){return _0x56b1d1(_0x506ef3);})[_0xa2af('0xa1')](function(_0x5cf039){return _0x279f8c(msgResponse('[CatchErlangB]',_0xa2af('0x95'),JSON[_0xa2af('0x7b')](_0x5cf039)));});}}else{return _0x279f8c(msgResponse(_0xa2af('0x1e6'),_0xa2af('0x95'),_0xa2af('0x1e8')));}});};};Dialer[_0xa2af('0x89')][_0xa2af('0x1dc')]=function(_0x52de09){var _0xbc2b4d=this;return function(){var _0x456a6f=0x0;var _0xb0c349=Math['floor'](_0x52de09[_0xa2af('0x61')]*0x3e8);if(_0xb0c349>0x0){_0xb0c349=_0xb0c349<0x64?0x64:_0xb0c349;loggerPredictive['info'](_0x52de09['name'],_0xa2af('0x1ed'),_0xb0c349,'milliseconds');_0x52de09[_0xa2af('0x6a')]=setInterval(function(){_0xbc2b4d['handlePredictive'](_0x52de09);loggerPredictiveCalls[_0xa2af('0x4f')](_0xa2af('0x1ee'),_0x456a6f+=0x1);},_0xb0c349);}else{loggerPredictive[_0xa2af('0x4f')](_0x52de09[_0xa2af('0x4c')],_0xa2af('0x1ef'));}};};Dialer[_0xa2af('0x89')]['checkContactBlack']=function(_0x2be7af,_0x438b9d){var _0x26c795=this;return function(_0x4fa90f){if(_[_0xa2af('0x4e')](_0x4fa90f)){if(_['isNil'](_0x438b9d[_0xa2af('0x15d')])||!_0x438b9d[_0xa2af('0x1f0')]){if(_0x2be7af['dialMethod']===_0xa2af('0xb')){_0x2be7af['queueStatusComplete']=_['isUndefined'](_0x2be7af['queueStatusComplete'])?!![]:_0x2be7af[_0xa2af('0x78')];var _0x3d2444=uuid['v4']();_0x26c795['actions'][_0x3d2444]=new Action(_0x2be7af,_0x438b9d,_0x3d2444);loggerBooked['info'](_0xa2af('0x1f1'),_0x3d2444,'queueStatusComplete:\x20',JSON[_0xa2af('0x7b')](_0x2be7af[_0xa2af('0x78')]),_0xa2af('0x1f2'),_0x2be7af[_0xa2af('0x4c')]);if(_0x2be7af[_0xa2af('0x78')]){_0x2be7af[_0xa2af('0x78')]=![];_0x26c795['queueBooked'][_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xc3')]]=[];ami[_0xa2af('0x9b')]({'actionid':_0x3d2444,'action':_0xa2af('0x1f3'),'queue':_0x2be7af['name']})[_0xa2af('0xa1')](function(){_0x26c795[_0xa2af('0xd1')](_0x2be7af);hopperUtils[_0xa2af('0xdc')]({'active':![],'ContactId':_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xdf')],'ListId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xe0')],'VoiceQueueId':_0x26c795[_0xa2af('0x28')][_0x3d2444]['VoiceQueueId']||undefined,'CampaignId':_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1f4')));delete _0x26c795[_0xa2af('0x28')][_0x3d2444];});}else{loggerBooked['info'](_0xa2af('0x1f5'),JSON[_0xa2af('0x7b')](_0x2be7af[_0xa2af('0x78')]),_0xa2af('0x1f2'),_0x2be7af[_0xa2af('0x4c')]);_0x26c795[_0xa2af('0xd1')](_0x2be7af);hopperUtils[_0xa2af('0xdc')]({'active':![],'ContactId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xdf')],'ListId':_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xe0')],'VoiceQueueId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xe1')]||undefined,'CampaignId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1f4')));delete _0x26c795[_0xa2af('0x28')][_0x3d2444];}}else{return _0x26c795[_0xa2af('0x161')](_0x2be7af,_0x438b9d);}}else{if(utils['getSeconds'](undefined,_0x438b9d[_0xa2af('0x1f6')])<_0x2be7af['dialRecallMeTimeout']*0x3c){if(_0x438b9d['Agent']&&!_0x438b9d[_0xa2af('0x14c')][_0xa2af('0x1f7')]){_0x26c795[_0xa2af('0x21')]['run'](_0x438b9d['id'])['finally'](function(){_0x26c795[_0xa2af('0xd1')](_0x2be7af);});}else{hopperUtils[_0xa2af('0x1f8')]({'active':![]},_0x438b9d['id'],0x1)[_0xa2af('0x1f')](function(){_0x26c795[_0xa2af('0xd1')](_0x2be7af);});}}else{_0x2be7af[_0xa2af('0x1f9')]+=0x1;_0x26c795[_0xa2af('0xd1')](_0x2be7af);if(_0x2be7af['dialRecallInQueue']){hopperUtils[_0xa2af('0xdc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x438b9d[_0xa2af('0xdf')],'ListId':_0x438b9d[_0xa2af('0xe0')],'VoiceQueueId':_0x438b9d[_0xa2af('0xe1')]||undefined,'CampaignId':_0x438b9d[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1fa')));hopperUtils[_0xa2af('0xcd')](createObjHistory(_0x2be7af,_0x438b9d,utils[_0xa2af('0x70')][_0xa2af('0x1fb')],0x17,_0xa2af('0x1fc')))['catch'](loggerCatch(_0xa2af('0x1fd')));}else{_0x26c795['saveInDb'](createObjHistory(_0x2be7af,_0x438b9d,utils[_0xa2af('0x70')]['RECALL_TIMEOUT'],0x16,_0xa2af('0x1fe')),'[Originate][HistoryRecallClose][historyCatch]',_0xa2af('0x1ff'));}}}}else{_0x2be7af[_0xa2af('0x200')]+=0x1;_0x26c795[_0xa2af('0x118')](createObjHistory(_0x2be7af,_0x438b9d,utils['CAMPAIGN_STATUS'][_0xa2af('0x201')],0xd,_0xa2af('0x202')),_0xa2af('0x203'),_0xa2af('0x204'));throw _0xa2af('0x205');}};};Dialer[_0xa2af('0x89')][_0xa2af('0x160')]=function(_0x5dc5e8){var _0x189003=this;var _0x8487d7=_0x5dc5e8[_0xa2af('0x206')]-_0x5dc5e8['originated'];emitCampaignSummary(_0x5dc5e8);if(_0x8487d7>0x0&&_0x5dc5e8[_0xa2af('0x6e')]==0x0){if(_0x8487d7>this[_0xa2af('0x26')]){_0x8487d7=this[_0xa2af('0x26')];}_0x5dc5e8['temp']=0x1;hopperUtils[_0xa2af('0x207')](_0x5dc5e8,_0x8487d7)['then'](function(_0x56254d){_0x5dc5e8['temp']=0x0;if(_0x56254d){if(!utils[_0xa2af('0x208')](_0x56254d)){_0x5dc5e8[_0xa2af('0x6f')]=utils['CAMPAIGN_STATUS'][_0xa2af('0x74')];logger[_0xa2af('0x4f')](_0xa2af('0x209')+_0x5dc5e8[_0xa2af('0x4c')]);}else{_0x5dc5e8['originated']+=_0x56254d['length'];_0x5dc5e8['message']=utils[_0xa2af('0x70')][_0xa2af('0x20a')];for(var _0x4424f9=0x0;_0x4424f9<_0x56254d[_0xa2af('0x149')];_0x4424f9+=0x1){_0x5dc5e8['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x56254d[_0x4424f9])||_[_0xa2af('0xf8')](_0x56254d[_0x4424f9]['Contact'])||_[_0xa2af('0xf8')](_0x56254d[_0x4424f9][_0xa2af('0x164')])){_0x189003[_0xa2af('0x15b')]('[actionOriginate]\x20',_0x5dc5e8,_0x56254d[_0x4424f9]);}else{hopperUtils[_0xa2af('0x20b')](_[_0xa2af('0xfc')](_0x56254d[_0x4424f9],['CampaignId','phone']))['then'](_0x189003[_0xa2af('0x20c')](_0x5dc5e8,_0x56254d[_0x4424f9]))[_0xa2af('0xa1')](_0x189003[_0xa2af('0x15a')]('[actionOriginateIvr]\x20',_0x5dc5e8));}}}}})[_0xa2af('0xa1')](loggerGetContactDialer(_0xa2af('0x20d'),_0x5dc5e8,_0x8487d7));}};Dialer['prototype'][_0xa2af('0xb8')]=function(_0x471161,_0x2620f9){var _0x5a6279=this;var _0x1698f4=[];if(_0x2620f9<0x1||_0x471161[_0xa2af('0xb6')]===_0xa2af('0xb')){_0x2620f9=0x1;}var _0x288c4c=Math[_0xa2af('0x20e')](_0x471161[_0xa2af('0x13c')]*_0x2620f9)-_0x471161[_0xa2af('0x157')];if(_0x471161[_0xa2af('0x20f')]>0x0){var _0x520903=_0x471161[_0xa2af('0x20f')]-_0x471161[_0xa2af('0x157')]-_0x471161['talking']-_0x471161[_0xa2af('0x13f')];if(_0x288c4c>_0x520903){_0x288c4c=_0x520903;}}if(_0x288c4c>0x0&&_0x471161[_0xa2af('0x6e')]==0x0){if(_0x471161[_0xa2af('0xb6')]===_0xa2af('0xb')){_0x288c4c=0x1;}if(_0x288c4c>this[_0xa2af('0x26')]){_0x288c4c=this[_0xa2af('0x26')];}for(var _0x2fcb7e in this[_0xa2af('0x24')]){if(typeof this[_0xa2af('0x24')][_0x2fcb7e]!=='undefined'){if(this['agents'][_0x2fcb7e][_0xa2af('0x75')]===_0xa2af('0x210')&&this['agents'][_0x2fcb7e][_0xa2af('0x8d')]===_0xa2af('0x8e')){_0x1698f4[_0xa2af('0x9a')](this[_0xa2af('0x24')][_0x2fcb7e]['id']);}}}_0x471161[_0xa2af('0x6e')]=0x1;hopperUtils[_0xa2af('0x211')](_0x471161,_0x1698f4,_0x288c4c)['then'](function(_0x1dcdc2){_0x471161[_0xa2af('0x6e')]=0x0;if(_0x1dcdc2){if(!utils[_0xa2af('0x208')](_0x1dcdc2)){hopperUtils[_0xa2af('0x212')](_0x471161)[_0xa2af('0x42')](sendMessageReschedule(_0x471161))[_0xa2af('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x471161[_0xa2af('0x157')]+=_0x1dcdc2[_0xa2af('0x149')];_0x471161['message']=_0x471161[_0xa2af('0xb6')]===_0xa2af('0xb')?utils[_0xa2af('0x70')]['ACTIVE']:utils[_0xa2af('0x70')][_0xa2af('0x20a')];for(var _0x56d034=0x0;_0x56d034<_0x1dcdc2['length'];_0x56d034+=0x1){if(_[_0xa2af('0xf8')](_0x1dcdc2[_0x56d034])||_[_0xa2af('0xf8')](_0x1dcdc2[_0x56d034][_0xa2af('0x17d')])||_['isNil'](_0x1dcdc2[_0x56d034]['phone'])){_0x5a6279['emptyContact'](_0xa2af('0x213'),_0x471161,_0x1dcdc2[_0x56d034]);}else{hopperUtils[_0xa2af('0x214')](_['pick'](_0x1dcdc2[_0x56d034],[_0xa2af('0xe1'),'phone']))[_0xa2af('0x42')](_0x5a6279[_0xa2af('0x20c')](_0x471161,_0x1dcdc2[_0x56d034]))['catch'](_0x5a6279[_0xa2af('0x15a')](_0xa2af('0x213'),_0x471161));}}}}})['catch'](loggerGetContactDialer(_0xa2af('0x215'),_0x471161,_0x288c4c));}};Dialer['prototype'][_0xa2af('0x6a')]=function(_0x467587){if(_0x467587[_0xa2af('0x20f')]>0x0){var _0x3ce495=_0x467587[_0xa2af('0x20f')]-_0x467587[_0xa2af('0x157')]-_0x467587[_0xa2af('0x13e')];if(_0x3ce495>0x0&&_0x467587[_0xa2af('0x6e')]==0x0){this['tryOriginatePredictive'](_0x467587);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0xa2af('0x216')](_0x467587);}};Dialer[_0xa2af('0x89')][_0xa2af('0x216')]=function(_0x4466ee){var _0x191e72=this;var _0x534ee2=[];_0x4466ee[_0xa2af('0x157')]+=0x1;for(var _0x3846b2 in this[_0xa2af('0x24')]){if(typeof this[_0xa2af('0x24')][_0x3846b2]!==_0xa2af('0xae')){if(this[_0xa2af('0x24')][_0x3846b2][_0xa2af('0x75')]===_0xa2af('0x210')&&this['agents'][_0x3846b2][_0xa2af('0x8d')]===_0xa2af('0x8e')){_0x534ee2[_0xa2af('0x9a')](this[_0xa2af('0x24')][_0x3846b2]['id']);}}}_0x4466ee[_0xa2af('0x6e')]=0x1;return this[_0xa2af('0x211')](_0x4466ee['id'],_0x534ee2,0x1,_0x4466ee['dialOrderByScheduledAt'],_0x4466ee)[_0xa2af('0x42')](function(_0xb219c9){_0x4466ee['temp']=0x1;if(_0xb219c9){if(!utils[_0xa2af('0x208')](_0xb219c9)){utils[_0xa2af('0x6d')](_0x4466ee,0x1,0x0);return hopperUtils[_0xa2af('0x212')](_0x4466ee)[_0xa2af('0x42')](sendMessageReschedule(_0x4466ee))['catch'](loggerCatch(_0xa2af('0x217')));}else{_0x4466ee[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x20a')];if(_[_0xa2af('0xf8')](_0xb219c9[0x0])||_[_0xa2af('0xf8')](_0xb219c9[0x0]['Contact'])||_[_0xa2af('0xf8')](_0xb219c9[0x0][_0xa2af('0x164')])){_0x191e72[_0xa2af('0x15b')](_0xa2af('0x213'),_0x4466ee,_0xb219c9[0x0]);}else{return hopperUtils[_0xa2af('0x214')](_[_0xa2af('0xfc')](_0xb219c9[0x0],[_0xa2af('0xe1'),_0xa2af('0x164')]))[_0xa2af('0x42')](_0x191e72['checkContactBlack'](_0x4466ee,_0xb219c9[0x0]))[_0xa2af('0xa1')](_0x191e72[_0xa2af('0x15a')]('[actionOriginatePredictive]\x20',_0x4466ee));}}}})['catch'](loggerGetContactDialer(_0xa2af('0x218'),_0x4466ee,0x1));};Dialer['prototype'][_0xa2af('0x219')]=function(_0x5ab911,_0x23a44c,_0x4d2a13,_0x3b9301,_0x3e0db3,_0x1c7666){loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21a'));loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21b'),_0x5ab911);loggerPredictive['info'](_0xa2af('0x21c'),_0x23a44c);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21d'),_0x4d2a13);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21e'),_0x3b9301);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21f'),_0x3e0db3);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5a'));return new Promise(function(_0x196b72,_0x39cb15){if(_0x5ab911<=0x0||isNaN(_0x5ab911)){return _0x39cb15(msgResponse('[abandonmentRate]',_0xa2af('0x88'),_0xa2af('0x220')+_0x5ab911));}if(_0x4d2a13<=0x0||isNaN(_0x4d2a13)){return _0x39cb15(msgResponse(_0xa2af('0x221'),_0xa2af('0x88'),_0xa2af('0x222')+_0x4d2a13));}if(_0x3b9301<=0x0||isNaN(_0x3b9301)){return _0x39cb15(msgResponse('[abandonmentRate]',_0xa2af('0x88'),_0xa2af('0x223')+_0x3b9301));}if(_0x23a44c<=0x0||isNaN(_0x23a44c)){return _0x39cb15(msgResponse(_0xa2af('0x221'),_0xa2af('0x88'),_0xa2af('0x224')+_0x23a44c));}if(_0x3e0db3<=0x0||isNaN(_0x3e0db3)){return _0x39cb15(msgResponse(_0xa2af('0x221'),_0xa2af('0x88'),_0xa2af('0x225')+_0x3e0db3));}_0x1c7666=_0x1c7666||0x0;var _0x473a83=0x1/_0x4d2a13;var _0x1eaa5e=0x0;var _0x5ea6df=0x0;var _0x53cc2a=0x0;var _0x40ff83=0x0;for(var _0x386ea5=0x0;_0x53cc2a<_0x3e0db3;_0x386ea5+=0x1){_0x5ea6df=_0x386ea5/_0x23a44c;_0x1eaa5e=(_0x3b9301*_0x5ea6df+_0x1c7666)/_0x473a83;_0x53cc2a=utils['erlangb'](_0x1eaa5e,_0x5ab911);_0x40ff83=_0x1eaa5e/_0x5ab911*(0x1-utils['erlangb'](_0x1eaa5e,_0x5ab911));}return _0x196b72({'erlangCalls':_0x386ea5,'erlangCallToSecond':_0x23a44c/_0x386ea5,'erlangAbandonmentRate':_0x53cc2a,'erlangBusyFactor':_0x40ff83});});};Dialer[_0xa2af('0x89')][_0xa2af('0x1e5')]=function(_0x3d971d,_0x243adf,_0x2970fc,_0x11584e,_0x1b1ec3,_0xa00b3e){loggerPredictive['info'](_0xa2af('0x226'));loggerPredictive[_0xa2af('0x4f')]('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',_0x3d971d);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x243adf);loggerPredictive['info']('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',_0x2970fc);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21e'),_0x11584e);loggerPredictive[_0xa2af('0x4f')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1b1ec3);loggerPredictive['info']('---------------------------');return new Promise(function(_0x6e3b14,_0x131967){if(_0x3d971d<=0x0||isNaN(_0x3d971d)){return _0x131967(msgResponse(_0xa2af('0x227'),_0xa2af('0x88'),'m\x20=\x20'+_0x3d971d));}if(_0x2970fc<=0x0||isNaN(_0x2970fc)){return _0x131967(msgResponse(_0xa2af('0x227'),_0xa2af('0x88'),_0xa2af('0x222')+_0x2970fc));}if(_0x11584e<=0x0||isNaN(_0x11584e)){return _0x131967(msgResponse(_0xa2af('0x227'),_0xa2af('0x88'),_0xa2af('0x223')+_0x11584e));}if(_0x243adf<=0x0||isNaN(_0x243adf)){return _0x131967(msgResponse(_0xa2af('0x227'),'Error',_0xa2af('0x224')+_0x243adf));}if(_0x1b1ec3<=0x0||isNaN(_0x1b1ec3)){return _0x131967(msgResponse(_0xa2af('0x227'),'Error',_0xa2af('0x228')+_0x1b1ec3));}_0xa00b3e=_0xa00b3e||0x0;var _0x190eea=0x1/_0x2970fc;var _0x5c8b82=0x0;var _0x56b541=0x0;var _0x26e093=0x0;var _0x20c2d3=0x0;for(var _0x99fb2f=0x0;_0x20c2d3<_0x1b1ec3;_0x99fb2f+=0x1){_0x56b541=_0x99fb2f/_0x243adf;_0x5c8b82=(_0x11584e*_0x56b541+_0xa00b3e)/_0x190eea;_0x26e093=utils[_0xa2af('0x229')](_0x5c8b82,_0x3d971d);_0x20c2d3=_0x5c8b82/_0x3d971d*(0x1-utils[_0xa2af('0x229')](_0x5c8b82,_0x3d971d));}return _0x6e3b14({'erlangCalls':_0x99fb2f,'erlangCallToSecond':_0x243adf/_0x99fb2f,'erlangAbandonmentRate':_0x26e093,'erlangBusyFactor':_0x20c2d3});});};module[_0xa2af('0x22a')]=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 326a6b4..7b354ec 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 _0xd6be=['idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','util','lodash','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x1b3031,_0x3694e3){var _0x2ae0ff=function(_0x545426){while(--_0x545426){_0x1b3031['push'](_0x1b3031['shift']());}};_0x2ae0ff(++_0x3694e3);}(_0xd6be,0x64));var _0xed6b=function(_0x1ad15c,_0x1247bd){_0x1ad15c=_0x1ad15c-0x0;var _0x1ca58c=_0xd6be[_0x1ad15c];return _0x1ca58c;};'use strict';var util=require(_0xed6b('0x0'));var _=require(_0xed6b('0x1'));var moment=require('moment');function checkNameSurname(_0x4d2029,_0x40e1f3,_0x53e879){var _0x22c9a4='';if(!_[_0xed6b('0x2')](_0x40e1f3)&&_0xed6b('0x3')===typeof _0x40e1f3){_0x22c9a4+=_0x40e1f3;}if(!_[_0xed6b('0x2')](_0x53e879)&&_0xed6b('0x3')===typeof _0x53e879){_0x22c9a4+='\x20'+_0x53e879;}if(_0x22c9a4!==''){return _0x22c9a4;}return _0x4d2029;}function Action(_0x3e6c45,_0x14e096,_0x14abb4){this['voiceQueue']=_0x3e6c45;this[_0xed6b('0x4')]=_0x14abb4||undefined;this[_0xed6b('0x5')]=checkNameSurname(_0x14e096[_0xed6b('0x6')][_0xed6b('0x7')],_0x14e096[_0xed6b('0x6')][_0xed6b('0x8')],_0x14e096[_0xed6b('0x6')][_0xed6b('0x9')]);this[_0xed6b('0xa')]=_0x14e096[_0xed6b('0x7')];this[_0xed6b('0xb')]=_0x3e6c45[_0xed6b('0x5')];this[_0xed6b('0xc')]=_0x14e096[_0xed6b('0xc')]||![];this[_0xed6b('0xd')]=_0x3e6c45[_0xed6b('0xd')];this[_0xed6b('0xe')]=_0x3e6c45[_0xed6b('0xe')]||0x3;this[_0xed6b('0xf')]=_0x14e096[_0xed6b('0xf')];this[_0xed6b('0x10')]=_0x14e096[_0xed6b('0x10')];this[_0xed6b('0x11')]=_0x14e096[_0xed6b('0x11')];this['countnoanswerretry']=_0x14e096[_0xed6b('0x12')];this[_0xed6b('0x13')]=_0x14e096[_0xed6b('0x13')];this['countdropretry']=_0x14e096[_0xed6b('0x14')];this[_0xed6b('0x15')]=_0x14e096['countabandonedretry'];this[_0xed6b('0x16')]=_0x14e096[_0xed6b('0x16')];this[_0xed6b('0x17')]=_0x14e096[_0xed6b('0x17')];this[_0xed6b('0x18')]=_0x14e096[_0xed6b('0x18')];this[_0xed6b('0x19')]=_0x14e096['ListId'];this[_0xed6b('0x1a')]=_0x14e096['UserId'];this[_0xed6b('0x1b')]=_0x14e096[_0xed6b('0x1b')];this[_0xed6b('0x1c')]=_0x14e096[_0xed6b('0x1c')];this[_0xed6b('0x1d')]=_0x14e096['id'];this['ContactFirstName']=_0x14e096['Contact']['firstName']||'';this[_0xed6b('0x1e')]=moment()[_0xed6b('0x1f')](_0xed6b('0x20'));this[_0xed6b('0x21')]=_0x14e096[_0xed6b('0x21')];this[_0xed6b('0x22')]=_0x14e096[_0xed6b('0x22')];this[_0xed6b('0x23')]=_0x14e096[_0xed6b('0x23')];this[_0xed6b('0x24')]=_0x14e096[_0xed6b('0x24')];this[_0xed6b('0x25')]='';this['originatecalleridname']='';}Action[_0xed6b('0x26')]['getCaller']=function(){return util[_0xed6b('0x1f')](_0xed6b('0x27'),this['name'],this[_0xed6b('0x28')][_0xed6b('0x29')]>0x0?this['number'][_0xed6b('0x2a')](this['voiceQueue']['dialCutDigit']):this['number']);};Action['prototype']['getQueue']=function(){return this[_0xed6b('0xb')];};module['exports']=Action; \ No newline at end of file +var _0xcb18=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName'];(function(_0x731de5,_0x1e2bc2){var _0x29b95c=function(_0xe718de){while(--_0xe718de){_0x731de5['push'](_0x731de5['shift']());}};_0x29b95c(++_0x1e2bc2);}(_0xcb18,0x98));var _0x8cb1=function(_0x158ec1,_0x4a9fde){_0x158ec1=_0x158ec1-0x0;var _0x3bdf30=_0xcb18[_0x158ec1];return _0x3bdf30;};'use strict';var util=require(_0x8cb1('0x0'));var _=require(_0x8cb1('0x1'));var moment=require(_0x8cb1('0x2'));function checkNameSurname(_0x393b6a,_0x36198b,_0x16b4c0){var _0x428dd5='';if(!_[_0x8cb1('0x3')](_0x36198b)&&_0x8cb1('0x4')===typeof _0x36198b){_0x428dd5+=_0x36198b;}if(!_['isNil'](_0x16b4c0)&&_0x8cb1('0x4')===typeof _0x16b4c0){_0x428dd5+='\x20'+_0x16b4c0;}if(_0x428dd5!==''){return _0x428dd5;}return _0x393b6a;}function Action(_0x5f2eed,_0x2be72e,_0x414b8a){this[_0x8cb1('0x5')]=_0x5f2eed;this[_0x8cb1('0x6')]=_0x414b8a||undefined;this[_0x8cb1('0x7')]=checkNameSurname(_0x2be72e['Contact'][_0x8cb1('0x8')],_0x2be72e[_0x8cb1('0x9')]['firstName'],_0x2be72e['Contact'][_0x8cb1('0xa')]);this[_0x8cb1('0xb')]=_0x2be72e[_0x8cb1('0x8')];this[_0x8cb1('0xc')]=_0x5f2eed[_0x8cb1('0x7')];this['active']=_0x2be72e['active']||![];this[_0x8cb1('0xd')]=_0x5f2eed[_0x8cb1('0xd')];this['dialQueueTimeout']=_0x5f2eed[_0x8cb1('0xe')]||0x3;this[_0x8cb1('0xf')]=_0x2be72e[_0x8cb1('0xf')];this['countbusyretry']=_0x2be72e[_0x8cb1('0x10')];this[_0x8cb1('0x11')]=_0x2be72e[_0x8cb1('0x11')];this[_0x8cb1('0x12')]=_0x2be72e[_0x8cb1('0x12')];this['countnosuchnumberretry']=_0x2be72e[_0x8cb1('0x13')];this[_0x8cb1('0x14')]=_0x2be72e[_0x8cb1('0x14')];this[_0x8cb1('0x15')]=_0x2be72e['countabandonedretry'];this[_0x8cb1('0x16')]=_0x2be72e['countmachineretry'];this[_0x8cb1('0x17')]=_0x2be72e[_0x8cb1('0x17')];this[_0x8cb1('0x18')]=_0x2be72e[_0x8cb1('0x18')];this[_0x8cb1('0x19')]=_0x2be72e[_0x8cb1('0x19')];this['UserId']=_0x2be72e[_0x8cb1('0x1a')];this[_0x8cb1('0x1b')]=_0x2be72e['VoiceQueueId'];this[_0x8cb1('0x1c')]=_0x2be72e[_0x8cb1('0x1c')];this[_0x8cb1('0x1d')]=_0x2be72e['id'];this[_0x8cb1('0x1e')]=_0x2be72e[_0x8cb1('0x9')][_0x8cb1('0x1f')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8cb1('0x20')]=_0x2be72e[_0x8cb1('0x20')];this['callbackuniqueid']=_0x2be72e[_0x8cb1('0x21')];this['callbackat']=_0x2be72e[_0x8cb1('0x22')];this[_0x8cb1('0x23')]=_0x2be72e[_0x8cb1('0x23')];this[_0x8cb1('0x24')]='';this[_0x8cb1('0x25')]='';}Action[_0x8cb1('0x26')][_0x8cb1('0x27')]=function(){return util[_0x8cb1('0x28')](_0x8cb1('0x29'),this[_0x8cb1('0x7')],this[_0x8cb1('0x5')][_0x8cb1('0x2a')]>0x0?this[_0x8cb1('0xb')][_0x8cb1('0x2b')](this[_0x8cb1('0x5')]['dialCutDigit']):this['number']);};Action[_0x8cb1('0x26')][_0x8cb1('0x2c')]=function(){return this[_0x8cb1('0xc')];};module[_0x8cb1('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index a1872bd..bfa2ee8 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 _0x0168=['agiafterat','exports','moment','../utils','state','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','responsetime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x2fd8f0,_0x2c1280){var _0x14e7c5=function(_0x131cde){while(--_0x131cde){_0x2fd8f0['push'](_0x2fd8f0['shift']());}};_0x14e7c5(++_0x2c1280);}(_0x0168,0x18e));var _0x8016=function(_0x13b629,_0x1f3afa){_0x13b629=_0x13b629-0x0;var _0x4f38c6=_0x0168[_0x13b629];return _0x4f38c6;};'use strict';var moment=require(_0x8016('0x0'));var utils=require(_0x8016('0x1'));function AgentComplete(_0x43052a,_0x5e3a40){this[_0x8016('0x2')]=0x4;this['statedesc']='Answer';this[_0x8016('0x3')]=_0x43052a[_0x8016('0x3')];this[_0x8016('0x4')]=_0x43052a[_0x8016('0x4')];this[_0x8016('0x5')]=_0x43052a['type']===_0x8016('0x6')?'queue':_0x43052a[_0x8016('0x4')];this['countbusyretry']=_0x43052a[_0x8016('0x7')];this[_0x8016('0x8')]=_0x43052a[_0x8016('0x8')];this[_0x8016('0x9')]=_0x43052a[_0x8016('0x9')];this[_0x8016('0xa')]=_0x43052a[_0x8016('0x7')]+_0x43052a[_0x8016('0x8')]+_0x43052a[_0x8016('0x9')]+_0x43052a[_0x8016('0xb')]+_0x43052a[_0x8016('0xc')]+_0x43052a[_0x8016('0xd')]+_0x43052a[_0x8016('0xe')]+_0x43052a[_0x8016('0xf')];this['countnosuchnumberretry']=_0x43052a[_0x8016('0xb')];this['countdropretry']=_0x43052a['countdropretry'];this['countabandonedretry']=_0x43052a[_0x8016('0xd')];this[_0x8016('0xe')]=_0x43052a[_0x8016('0xe')];this[_0x8016('0xf')]=_0x43052a[_0x8016('0xf')];this['uniqueid']=_0x5e3a40['uniqueid'];this[_0x8016('0x10')]=_0x43052a['name'];this[_0x8016('0x11')]=_0x43052a[_0x8016('0x12')];this[_0x8016('0x13')]=_0x43052a['starttime'];this['responsetime']=_0x43052a['responsetime'];this[_0x8016('0x14')]=_0x43052a[_0x8016('0x14')];this[_0x8016('0x15')]=moment()[_0x8016('0x16')](_0x8016('0x17'));this[_0x8016('0x18')]=utils[_0x8016('0x19')](_0x43052a[_0x8016('0x1a')],_0x43052a[_0x8016('0x13')]);this['holdtime']=utils[_0x8016('0x19')](_0x43052a[_0x8016('0x14')],_0x43052a[_0x8016('0x1a')]);this[_0x8016('0x1b')]=utils[_0x8016('0x19')](this[_0x8016('0x15')],_0x43052a[_0x8016('0x14')]);this[_0x8016('0x1c')]=_0x5e3a40[_0x8016('0x1c')];this[_0x8016('0x1d')]=_0x5e3a40[_0x8016('0x1d')];this[_0x8016('0x1e')]=_0x5e3a40['reason'];this[_0x8016('0x1f')]=_0x43052a[_0x8016('0x1f')];this['callbackuniqueid']=_0x43052a[_0x8016('0x20')];this['callbackat']=_0x43052a[_0x8016('0x21')];this['recallme']=_0x43052a[_0x8016('0x22')];this[_0x8016('0x23')]=_0x43052a['ContactId'];this[_0x8016('0x24')]=_0x43052a['ListId'];this[_0x8016('0x25')]=_0x43052a[_0x8016('0x25')];this[_0x8016('0x26')]=_0x43052a[_0x8016('0x26')];this[_0x8016('0x27')]=_0x43052a['CampaignId'];this[_0x8016('0x28')]=_0x43052a[_0x8016('0x28')]||'';this[_0x8016('0x29')]=_0x43052a[_0x8016('0x29')]||'';this[_0x8016('0x2a')]=_0x43052a[_0x8016('0x2a')];}module[_0x8016('0x2b')]=AgentComplete; \ No newline at end of file +var _0x6e5b=['calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x6e5b,0x178));var _0xb6e5=function(_0x504282,_0x56712d){_0x504282=_0x504282-0x0;var _0x25a59f=_0x6e5b[_0x504282];return _0x25a59f;};'use strict';var moment=require(_0xb6e5('0x0'));var utils=require(_0xb6e5('0x1'));function AgentComplete(_0x3e09be,_0x5f5bbd){this[_0xb6e5('0x2')]=0x4;this[_0xb6e5('0x3')]=_0xb6e5('0x4');this[_0xb6e5('0x5')]=_0x3e09be[_0xb6e5('0x5')];this[_0xb6e5('0x6')]=_0x3e09be[_0xb6e5('0x6')];this['campaigntype']=_0x3e09be['type']===_0xb6e5('0x7')?_0xb6e5('0x8'):_0x3e09be['type'];this[_0xb6e5('0x9')]=_0x3e09be[_0xb6e5('0x9')];this[_0xb6e5('0xa')]=_0x3e09be['countcongestionretry'];this[_0xb6e5('0xb')]=_0x3e09be['countnoanswerretry'];this[_0xb6e5('0xc')]=_0x3e09be[_0xb6e5('0x9')]+_0x3e09be[_0xb6e5('0xa')]+_0x3e09be['countnoanswerretry']+_0x3e09be[_0xb6e5('0xd')]+_0x3e09be[_0xb6e5('0xe')]+_0x3e09be[_0xb6e5('0xf')]+_0x3e09be[_0xb6e5('0x10')]+_0x3e09be[_0xb6e5('0x11')];this['countnosuchnumberretry']=_0x3e09be[_0xb6e5('0xd')];this[_0xb6e5('0xe')]=_0x3e09be[_0xb6e5('0xe')];this['countabandonedretry']=_0x3e09be[_0xb6e5('0xf')];this[_0xb6e5('0x10')]=_0x3e09be[_0xb6e5('0x10')];this[_0xb6e5('0x11')]=_0x3e09be[_0xb6e5('0x11')];this[_0xb6e5('0x12')]=_0x5f5bbd[_0xb6e5('0x12')];this['calleridname']=_0x3e09be[_0xb6e5('0x13')];this[_0xb6e5('0x14')]=_0x3e09be[_0xb6e5('0x15')];this[_0xb6e5('0x16')]=_0x3e09be[_0xb6e5('0x16')];this[_0xb6e5('0x17')]=_0x3e09be[_0xb6e5('0x17')];this[_0xb6e5('0x18')]=_0x3e09be[_0xb6e5('0x18')];this[_0xb6e5('0x19')]=moment()[_0xb6e5('0x1a')](_0xb6e5('0x1b'));this[_0xb6e5('0x1c')]=utils[_0xb6e5('0x1d')](_0x3e09be[_0xb6e5('0x17')],_0x3e09be['starttime']);this['holdtime']=utils['getSeconds'](_0x3e09be[_0xb6e5('0x18')],_0x3e09be['responsetime']);this['talktime']=utils[_0xb6e5('0x1d')](this[_0xb6e5('0x19')],_0x3e09be[_0xb6e5('0x18')]);this[_0xb6e5('0x8')]=_0x5f5bbd[_0xb6e5('0x8')];this[_0xb6e5('0x1e')]=_0x5f5bbd['membername'];this[_0xb6e5('0x1f')]=_0x5f5bbd['reason'];this[_0xb6e5('0x20')]=_0x3e09be[_0xb6e5('0x20')];this[_0xb6e5('0x21')]=_0x3e09be[_0xb6e5('0x21')];this[_0xb6e5('0x22')]=_0x3e09be['callbackat'];this[_0xb6e5('0x23')]=_0x3e09be[_0xb6e5('0x23')];this[_0xb6e5('0x24')]=_0x3e09be[_0xb6e5('0x24')];this[_0xb6e5('0x25')]=_0x3e09be[_0xb6e5('0x25')];this[_0xb6e5('0x26')]=_0x3e09be[_0xb6e5('0x26')];this[_0xb6e5('0x27')]=_0x3e09be[_0xb6e5('0x27')];this[_0xb6e5('0x28')]=_0x3e09be[_0xb6e5('0x28')];this[_0xb6e5('0x29')]=_0x3e09be[_0xb6e5('0x29')]||'';this[_0xb6e5('0x2a')]=_0x3e09be[_0xb6e5('0x2a')]||'';this[_0xb6e5('0x2b')]=_0x3e09be[_0xb6e5('0x2b')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 4ed5574..c45f4db 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 _0x0dca=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','calleridname','calleridnum','starttime'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x0dca,0xdd));var _0xa0dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0dca[_0x3dd15e];return _0x231fd0;};'use strict';function Final(_0x326096){this['uniqueid']=_0x326096[_0xa0dc('0x0')];this['scheduledat']=_0x326096[_0xa0dc('0x1')];this[_0xa0dc('0x2')]=_0x326096[_0xa0dc('0x2')];this['campaigntype']=_0x326096[_0xa0dc('0x2')]===_0xa0dc('0x3')?_0xa0dc('0x4'):_0x326096[_0xa0dc('0x2')];this[_0xa0dc('0x5')]=_0x326096[_0xa0dc('0x5')];this[_0xa0dc('0x6')]=_0x326096[_0xa0dc('0x6')];this[_0xa0dc('0x7')]=_0x326096[_0xa0dc('0x7')];this[_0xa0dc('0x8')]=_0x326096[_0xa0dc('0x5')]+_0x326096[_0xa0dc('0x6')]+_0x326096['countnoanswerretry']+_0x326096['countnosuchnumberretry']+_0x326096['countdropretry']+_0x326096['countabandonedretry']+_0x326096[_0xa0dc('0x9')]+_0x326096[_0xa0dc('0xa')];this[_0xa0dc('0xb')]=_0x326096[_0xa0dc('0xb')];this['countdropretry']=_0x326096[_0xa0dc('0xc')];this[_0xa0dc('0xd')]=_0x326096[_0xa0dc('0xd')];this[_0xa0dc('0x9')]=_0x326096['countmachineretry'];this['countagentrejectretry']=_0x326096[_0xa0dc('0xa')];this[_0xa0dc('0x4')]=_0x326096[_0xa0dc('0x4')];this[_0xa0dc('0xe')]=_0x326096[_0xa0dc('0xe')];this[_0xa0dc('0xf')]=_0x326096[_0xa0dc('0xf')];this[_0xa0dc('0x10')]=_0x326096[_0xa0dc('0x10')];this[_0xa0dc('0x11')]=_0x326096[_0xa0dc('0x11')];this[_0xa0dc('0x12')]=_0x326096[_0xa0dc('0x11')];this[_0xa0dc('0x13')]=_0x326096['ringtime']||0x0;this[_0xa0dc('0x14')]=_0x326096[_0xa0dc('0x14')]||0x0;this[_0xa0dc('0x15')]=_0x326096['talktime']||0x0;this[_0xa0dc('0x16')]=_0x326096['callback'];this['callbackuniqueid']=_0x326096[_0xa0dc('0x17')];this[_0xa0dc('0x18')]=_0x326096[_0xa0dc('0x18')];this['recallme']=_0x326096['recallme'];this['ContactId']=_0x326096['ContactId'];this[_0xa0dc('0x19')]=_0x326096[_0xa0dc('0x19')];this[_0xa0dc('0x1a')]=_0x326096[_0xa0dc('0x1a')];this[_0xa0dc('0x1b')]=_0x326096[_0xa0dc('0x1b')];this[_0xa0dc('0x1c')]=_0x326096[_0xa0dc('0x1c')];this[_0xa0dc('0x1d')]=_0x326096[_0xa0dc('0x1d')]||'';this[_0xa0dc('0x1e')]=_0x326096[_0xa0dc('0x1e')]||'';this[_0xa0dc('0x1f')]=_0x326096[_0xa0dc('0x1f')];this[_0xa0dc('0x20')]=_0x326096[_0xa0dc('0x20')];}module[_0xa0dc('0x21')]=Final; \ No newline at end of file +var _0xc4c0=['originatecalleridnum','originatecalleridname','state','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x4c488c,_0x2a9a09){var _0x82392f=function(_0x24eeec){while(--_0x24eeec){_0x4c488c['push'](_0x4c488c['shift']());}};_0x82392f(++_0x2a9a09);}(_0xc4c0,0xd6));var _0x0c4c=function(_0x129fa8,_0x3dba2a){_0x129fa8=_0x129fa8-0x0;var _0x546bab=_0xc4c0[_0x129fa8];return _0x546bab;};'use strict';function Final(_0x5c4e3b){this[_0x0c4c('0x0')]=_0x5c4e3b[_0x0c4c('0x0')];this[_0x0c4c('0x1')]=_0x5c4e3b[_0x0c4c('0x1')];this[_0x0c4c('0x2')]=_0x5c4e3b['type'];this[_0x0c4c('0x3')]=_0x5c4e3b[_0x0c4c('0x2')]==='outbound'?_0x0c4c('0x4'):_0x5c4e3b[_0x0c4c('0x2')];this[_0x0c4c('0x5')]=_0x5c4e3b[_0x0c4c('0x5')];this[_0x0c4c('0x6')]=_0x5c4e3b[_0x0c4c('0x6')];this[_0x0c4c('0x7')]=_0x5c4e3b[_0x0c4c('0x7')];this[_0x0c4c('0x8')]=_0x5c4e3b[_0x0c4c('0x5')]+_0x5c4e3b['countcongestionretry']+_0x5c4e3b['countnoanswerretry']+_0x5c4e3b['countnosuchnumberretry']+_0x5c4e3b[_0x0c4c('0x9')]+_0x5c4e3b[_0x0c4c('0xa')]+_0x5c4e3b['countmachineretry']+_0x5c4e3b[_0x0c4c('0xb')];this[_0x0c4c('0xc')]=_0x5c4e3b['countnosuchnumberretry'];this[_0x0c4c('0x9')]=_0x5c4e3b[_0x0c4c('0x9')];this[_0x0c4c('0xa')]=_0x5c4e3b[_0x0c4c('0xa')];this['countmachineretry']=_0x5c4e3b[_0x0c4c('0xd')];this[_0x0c4c('0xb')]=_0x5c4e3b['countagentrejectretry'];this[_0x0c4c('0x4')]=_0x5c4e3b[_0x0c4c('0x4')];this[_0x0c4c('0xe')]=_0x5c4e3b[_0x0c4c('0xe')];this[_0x0c4c('0xf')]=_0x5c4e3b['calleridnum'];this['starttime']=_0x5c4e3b[_0x0c4c('0x10')];this[_0x0c4c('0x11')]=_0x5c4e3b[_0x0c4c('0x11')];this[_0x0c4c('0x12')]=_0x5c4e3b[_0x0c4c('0x11')];this[_0x0c4c('0x13')]=_0x5c4e3b[_0x0c4c('0x13')]||0x0;this[_0x0c4c('0x14')]=_0x5c4e3b[_0x0c4c('0x14')]||0x0;this[_0x0c4c('0x15')]=_0x5c4e3b[_0x0c4c('0x15')]||0x0;this[_0x0c4c('0x16')]=_0x5c4e3b[_0x0c4c('0x16')];this[_0x0c4c('0x17')]=_0x5c4e3b['callbackuniqueid'];this[_0x0c4c('0x18')]=_0x5c4e3b[_0x0c4c('0x18')];this[_0x0c4c('0x19')]=_0x5c4e3b[_0x0c4c('0x19')];this['ContactId']=_0x5c4e3b[_0x0c4c('0x1a')];this[_0x0c4c('0x1b')]=_0x5c4e3b[_0x0c4c('0x1b')];this[_0x0c4c('0x1c')]=_0x5c4e3b[_0x0c4c('0x1c')];this[_0x0c4c('0x1d')]=_0x5c4e3b[_0x0c4c('0x1d')];this[_0x0c4c('0x1e')]=_0x5c4e3b[_0x0c4c('0x1e')];this[_0x0c4c('0x1f')]=_0x5c4e3b[_0x0c4c('0x1f')]||'';this[_0x0c4c('0x20')]=_0x5c4e3b['originatecalleridname']||'';this[_0x0c4c('0x21')]=_0x5c4e3b['state'];this['statedesc']=_0x5c4e3b['statedesc'];}module[_0x0c4c('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 0ad2779..7659664 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 _0xac51=['campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xac51,0x127));var _0x1ac5=function(_0xf7b006,_0x18c938){_0xf7b006=_0xf7b006-0x0;var _0x3ac6e5=_0xac51[_0xf7b006];return _0x3ac6e5;};'use strict';var moment=require(_0x1ac5('0x0'));var utils=require('../utils');function Hangup(_0x20be8c,_0x559844){this[_0x1ac5('0x1')]=0x4;this[_0x1ac5('0x2')]=_0x1ac5('0x3');this['scheduledat']=_0x20be8c[_0x1ac5('0x4')];this[_0x1ac5('0x5')]=_0x20be8c[_0x1ac5('0x5')];this[_0x1ac5('0x6')]=_0x20be8c[_0x1ac5('0x5')]===_0x1ac5('0x7')?'queue':_0x20be8c[_0x1ac5('0x5')];this[_0x1ac5('0x8')]=_0x20be8c[_0x1ac5('0x8')]||![];this['countbusyretry']=_0x20be8c[_0x1ac5('0x9')];this[_0x1ac5('0xa')]=_0x20be8c['countcongestionretry'];this[_0x1ac5('0xb')]=_0x20be8c['countnoanswerretry'];this[_0x1ac5('0xc')]=_0x20be8c[_0x1ac5('0x9')]+_0x20be8c[_0x1ac5('0xa')]+_0x20be8c[_0x1ac5('0xb')]+_0x20be8c[_0x1ac5('0xd')]+_0x20be8c['countdropretry']+_0x20be8c[_0x1ac5('0xe')]+_0x20be8c[_0x1ac5('0xf')]+_0x20be8c[_0x1ac5('0x10')];this[_0x1ac5('0xd')]=_0x20be8c[_0x1ac5('0xd')];this[_0x1ac5('0x11')]=_0x20be8c[_0x1ac5('0x11')];this[_0x1ac5('0xe')]=_0x20be8c[_0x1ac5('0xe')];this[_0x1ac5('0xf')]=_0x20be8c[_0x1ac5('0xf')];this['countagentrejectretry']=_0x20be8c[_0x1ac5('0x10')];this[_0x1ac5('0x12')]=_0x559844['uniqueid'];this['calleridname']=_0x20be8c[_0x1ac5('0x13')];this[_0x1ac5('0x14')]=_0x20be8c[_0x1ac5('0x15')];this[_0x1ac5('0x16')]=_0x20be8c[_0x1ac5('0x16')];this[_0x1ac5('0x17')]=_0x20be8c['responsetime'];this[_0x1ac5('0x18')]=moment()['format'](_0x1ac5('0x19'));this[_0x1ac5('0x1a')]=utils[_0x1ac5('0x1b')](_0x20be8c[_0x1ac5('0x17')],_0x20be8c[_0x1ac5('0x16')]);this['holdtime']=0x0;this[_0x1ac5('0x1c')]=utils['getSeconds'](this['endtime'],_0x20be8c[_0x1ac5('0x17')]);this['queue']=_0x20be8c['queue'];this[_0x1ac5('0x1d')]=_0x1ac5('0x1e');this[_0x1ac5('0x1f')]=_0x559844[_0x1ac5('0x20')];this[_0x1ac5('0x21')]=_0x20be8c['callback'];this[_0x1ac5('0x22')]=_0x20be8c['callbackuniqueid'];this['callbackat']=_0x20be8c[_0x1ac5('0x23')];this[_0x1ac5('0x24')]=_0x20be8c['recallme'];this[_0x1ac5('0x25')]=_0x20be8c['ContactId'];this[_0x1ac5('0x26')]=_0x20be8c[_0x1ac5('0x26')];this[_0x1ac5('0x27')]=_0x20be8c[_0x1ac5('0x27')];this[_0x1ac5('0x28')]=_0x20be8c[_0x1ac5('0x28')];this[_0x1ac5('0x29')]=_0x20be8c[_0x1ac5('0x29')];}module[_0x1ac5('0x2a')]=Hangup; \ No newline at end of file +var _0x93c2=['calleridnum','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname'];(function(_0x2be272,_0x1cc13a){var _0x5da7cb=function(_0x9ea820){while(--_0x9ea820){_0x2be272['push'](_0x2be272['shift']());}};_0x5da7cb(++_0x1cc13a);}(_0x93c2,0xad));var _0x293c=function(_0x26c087,_0x5c8264){_0x26c087=_0x26c087-0x0;var _0x16fc2f=_0x93c2[_0x26c087];return _0x16fc2f;};'use strict';var moment=require(_0x293c('0x0'));var utils=require(_0x293c('0x1'));function Hangup(_0x5f56b5,_0x189bc1){this[_0x293c('0x2')]=0x4;this[_0x293c('0x3')]=_0x293c('0x4');this[_0x293c('0x5')]=_0x5f56b5['scheduledat'];this[_0x293c('0x6')]=_0x5f56b5[_0x293c('0x6')];this[_0x293c('0x7')]=_0x5f56b5['type']===_0x293c('0x8')?_0x293c('0x9'):_0x5f56b5['type'];this[_0x293c('0xa')]=_0x5f56b5[_0x293c('0xa')]||![];this[_0x293c('0xb')]=_0x5f56b5[_0x293c('0xb')];this['countcongestionretry']=_0x5f56b5[_0x293c('0xc')];this[_0x293c('0xd')]=_0x5f56b5['countnoanswerretry'];this[_0x293c('0xe')]=_0x5f56b5[_0x293c('0xb')]+_0x5f56b5[_0x293c('0xc')]+_0x5f56b5[_0x293c('0xd')]+_0x5f56b5[_0x293c('0xf')]+_0x5f56b5['countdropretry']+_0x5f56b5[_0x293c('0x10')]+_0x5f56b5[_0x293c('0x11')]+_0x5f56b5[_0x293c('0x12')];this[_0x293c('0xf')]=_0x5f56b5['countnosuchnumberretry'];this[_0x293c('0x13')]=_0x5f56b5[_0x293c('0x13')];this['countabandonedretry']=_0x5f56b5['countabandonedretry'];this['countmachineretry']=_0x5f56b5[_0x293c('0x11')];this[_0x293c('0x12')]=_0x5f56b5[_0x293c('0x12')];this['uniqueid']=_0x189bc1[_0x293c('0x14')];this[_0x293c('0x15')]=_0x5f56b5['name'];this[_0x293c('0x16')]=_0x5f56b5[_0x293c('0x17')];this[_0x293c('0x18')]=_0x5f56b5[_0x293c('0x18')];this[_0x293c('0x19')]=_0x5f56b5['responsetime'];this['endtime']=moment()['format'](_0x293c('0x1a'));this['ringtime']=utils[_0x293c('0x1b')](_0x5f56b5['responsetime'],_0x5f56b5[_0x293c('0x18')]);this['holdtime']=0x0;this[_0x293c('0x1c')]=utils[_0x293c('0x1b')](this['endtime'],_0x5f56b5[_0x293c('0x19')]);this[_0x293c('0x9')]=_0x5f56b5[_0x293c('0x9')];this['membername']=_0x293c('0x1d');this['reason']=_0x189bc1[_0x293c('0x1e')];this['callback']=_0x5f56b5[_0x293c('0x1f')];this[_0x293c('0x20')]=_0x5f56b5[_0x293c('0x20')];this['callbackat']=_0x5f56b5[_0x293c('0x21')];this['recallme']=_0x5f56b5['recallme'];this[_0x293c('0x22')]=_0x5f56b5[_0x293c('0x22')];this[_0x293c('0x23')]=_0x5f56b5[_0x293c('0x23')];this['UserId']=_0x5f56b5[_0x293c('0x24')];this[_0x293c('0x25')]=_0x5f56b5['VoiceQueueId'];this[_0x293c('0x26')]=_0x5f56b5[_0x293c('0x26')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 9bb0ab2..d29036b 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 _0x9c75=['uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','../utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c75,0x185));var _0x59c7=function(_0x6395a9,_0x45adeb){_0x6395a9=_0x6395a9-0x0;var _0x5458e3=_0x9c75[_0x6395a9];return _0x5458e3;};'use strict';var utils=require(_0x59c7('0x0'));function History(_0x345d70){this[_0x59c7('0x1')]=_0x345d70[_0x59c7('0x1')];this[_0x59c7('0x2')]=_0x345d70[_0x59c7('0x2')]||undefined;this['type']=_0x345d70['type'];this[_0x59c7('0x3')]=_0x345d70[_0x59c7('0x4')]===_0x59c7('0x5')?_0x59c7('0x6'):_0x345d70[_0x59c7('0x4')];this[_0x59c7('0x7')]=_0x345d70[_0x59c7('0x7')];this['countcongestionretry']=_0x345d70[_0x59c7('0x8')];this[_0x59c7('0x9')]=_0x345d70['countnoanswerretry'];this[_0x59c7('0xa')]=_0x345d70[_0x59c7('0x7')]+_0x345d70[_0x59c7('0x8')]+_0x345d70[_0x59c7('0x9')]+_0x345d70[_0x59c7('0xb')]+_0x345d70['countdropretry']+_0x345d70[_0x59c7('0xc')]+_0x345d70['countmachineretry']+_0x345d70[_0x59c7('0xd')];this[_0x59c7('0xb')]=_0x345d70['countnosuchnumberretry'];this[_0x59c7('0xe')]=_0x345d70[_0x59c7('0xe')];this[_0x59c7('0xc')]=_0x345d70[_0x59c7('0xc')];this[_0x59c7('0xf')]=_0x345d70[_0x59c7('0xf')];this[_0x59c7('0xd')]=_0x345d70[_0x59c7('0xd')];this['queue']=_0x345d70[_0x59c7('0x6')];this[_0x59c7('0x10')]=_0x345d70[_0x59c7('0x11')];this[_0x59c7('0x12')]=_0x345d70[_0x59c7('0x13')];this[_0x59c7('0x14')]=_0x345d70[_0x59c7('0x14')];this['responsetime']=_0x345d70[_0x59c7('0x15')];this[_0x59c7('0x16')]=_0x345d70[_0x59c7('0x15')];this[_0x59c7('0x17')]=utils[_0x59c7('0x18')](_0x345d70['responsetime'],_0x345d70[_0x59c7('0x14')]);this[_0x59c7('0x19')]=0x0;this[_0x59c7('0x1a')]=0x0;this[_0x59c7('0x1b')]=_0x345d70[_0x59c7('0x1b')];this[_0x59c7('0x1c')]=_0x345d70[_0x59c7('0x1c')];this[_0x59c7('0x1d')]=_0x345d70[_0x59c7('0x1d')];this[_0x59c7('0x1e')]=_0x345d70[_0x59c7('0x1e')];this[_0x59c7('0x1f')]=_0x345d70['ContactId'];this[_0x59c7('0x20')]=_0x345d70[_0x59c7('0x20')];this[_0x59c7('0x21')]=_0x345d70[_0x59c7('0x21')];this[_0x59c7('0x22')]=_0x345d70[_0x59c7('0x22')];this[_0x59c7('0x23')]=_0x345d70[_0x59c7('0x23')];this[_0x59c7('0x24')]=_0x345d70['originatecalleridnum']||'';this['originatecalleridname']=_0x345d70['originatecalleridname']||'';this[_0x59c7('0x25')]=_0x345d70[_0x59c7('0x25')];this[_0x59c7('0x26')]=_0x345d70[_0x59c7('0x26')];}module['exports']=History; \ No newline at end of file +var _0x1652=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','type','campaigntype','outbound','queue'];(function(_0x53c6b2,_0x4c2b79){var _0x99daa6=function(_0x412b73){while(--_0x412b73){_0x53c6b2['push'](_0x53c6b2['shift']());}};_0x99daa6(++_0x4c2b79);}(_0x1652,0x18a));var _0x2165=function(_0x2a3b3e,_0x415238){_0x2a3b3e=_0x2a3b3e-0x0;var _0x3bb5f6=_0x1652[_0x2a3b3e];return _0x3bb5f6;};'use strict';var utils=require(_0x2165('0x0'));function History(_0x2fd43e){this[_0x2165('0x1')]=_0x2fd43e[_0x2165('0x1')];this['scheduledat']=_0x2fd43e['scheduledat']||undefined;this[_0x2165('0x2')]=_0x2fd43e[_0x2165('0x2')];this[_0x2165('0x3')]=_0x2fd43e[_0x2165('0x2')]===_0x2165('0x4')?_0x2165('0x5'):_0x2fd43e[_0x2165('0x2')];this[_0x2165('0x6')]=_0x2fd43e[_0x2165('0x6')];this[_0x2165('0x7')]=_0x2fd43e[_0x2165('0x7')];this[_0x2165('0x8')]=_0x2fd43e[_0x2165('0x8')];this[_0x2165('0x9')]=_0x2fd43e[_0x2165('0x6')]+_0x2fd43e['countcongestionretry']+_0x2fd43e[_0x2165('0x8')]+_0x2fd43e[_0x2165('0xa')]+_0x2fd43e[_0x2165('0xb')]+_0x2fd43e[_0x2165('0xc')]+_0x2fd43e['countmachineretry']+_0x2fd43e[_0x2165('0xd')];this['countnosuchnumberretry']=_0x2fd43e[_0x2165('0xa')];this['countdropretry']=_0x2fd43e[_0x2165('0xb')];this[_0x2165('0xc')]=_0x2fd43e['countabandonedretry'];this['countmachineretry']=_0x2fd43e[_0x2165('0xe')];this[_0x2165('0xd')]=_0x2fd43e[_0x2165('0xd')];this[_0x2165('0x5')]=_0x2fd43e[_0x2165('0x5')];this[_0x2165('0xf')]=_0x2fd43e[_0x2165('0x10')];this[_0x2165('0x11')]=_0x2fd43e[_0x2165('0x12')];this['starttime']=_0x2fd43e[_0x2165('0x13')];this[_0x2165('0x14')]=_0x2fd43e[_0x2165('0x14')];this[_0x2165('0x15')]=_0x2fd43e[_0x2165('0x14')];this[_0x2165('0x16')]=utils[_0x2165('0x17')](_0x2fd43e[_0x2165('0x14')],_0x2fd43e[_0x2165('0x13')]);this[_0x2165('0x18')]=0x0;this[_0x2165('0x19')]=0x0;this[_0x2165('0x1a')]=_0x2fd43e[_0x2165('0x1a')];this[_0x2165('0x1b')]=_0x2fd43e[_0x2165('0x1b')];this[_0x2165('0x1c')]=_0x2fd43e[_0x2165('0x1c')];this['recallme']=_0x2fd43e[_0x2165('0x1d')];this[_0x2165('0x1e')]=_0x2fd43e[_0x2165('0x1e')];this[_0x2165('0x1f')]=_0x2fd43e['ListId'];this[_0x2165('0x20')]=_0x2fd43e[_0x2165('0x20')];this[_0x2165('0x21')]=_0x2fd43e[_0x2165('0x21')];this[_0x2165('0x22')]=_0x2fd43e[_0x2165('0x22')];this[_0x2165('0x23')]=_0x2fd43e[_0x2165('0x23')]||'';this['originatecalleridname']=_0x2fd43e[_0x2165('0x24')]||'';this['state']=_0x2fd43e[_0x2165('0x25')];this[_0x2165('0x26')]=_0x2fd43e[_0x2165('0x26')];}module[_0x2165('0x27')]=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 3641fab..c3606a0 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 _0xf60b=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x3a023f,_0x3a0789){var _0x1de363=function(_0x239e8e){while(--_0x239e8e){_0x3a023f['push'](_0x3a023f['shift']());}};_0x1de363(++_0x3a0789);}(_0xf60b,0x17b));var _0xbf60=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0xf60b[_0x146484];return _0x4c7aa3;};'use strict';var utils=require(_0xbf60('0x0'));function QueueCallerAbandon(_0x1d19d8,_0x545fd2){this[_0xbf60('0x1')]=_0x1d19d8['scheduledat'];this[_0xbf60('0x2')]=_0x1d19d8[_0xbf60('0x2')];this[_0xbf60('0x3')]=_0x1d19d8[_0xbf60('0x2')]===_0xbf60('0x4')?_0xbf60('0x5'):_0x1d19d8[_0xbf60('0x2')];this[_0xbf60('0x6')]=_0x1d19d8[_0xbf60('0x6')];this['countcongestionretry']=_0x1d19d8[_0xbf60('0x7')];this[_0xbf60('0x8')]=_0x1d19d8['countnoanswerretry'];this[_0xbf60('0x9')]=_0x1d19d8['countbusyretry']+_0x1d19d8[_0xbf60('0x7')]+_0x1d19d8[_0xbf60('0x8')]+_0x1d19d8[_0xbf60('0xa')]+_0x1d19d8[_0xbf60('0xb')]+_0x1d19d8[_0xbf60('0xc')]+_0x1d19d8['countmachineretry']+_0x1d19d8['countagentrejectretry'];this['countnosuchnumberretry']=_0x1d19d8[_0xbf60('0xa')];this[_0xbf60('0xb')]=_0x1d19d8[_0xbf60('0xb')];this[_0xbf60('0xc')]=_0x1d19d8[_0xbf60('0xc')];this[_0xbf60('0xd')]=_0x1d19d8[_0xbf60('0xd')];this[_0xbf60('0xe')]=_0x1d19d8[_0xbf60('0xe')];this[_0xbf60('0xf')]=_0x545fd2['uniqueid'];this[_0xbf60('0x10')]=_0x1d19d8['name'];this[_0xbf60('0x11')]=_0x1d19d8[_0xbf60('0x12')];this[_0xbf60('0x13')]=_0x1d19d8['starttime'];this[_0xbf60('0x14')]=_0x1d19d8[_0xbf60('0x14')];this[_0xbf60('0x15')]=_0x1d19d8['droptime'];this[_0xbf60('0x16')]=_0x1d19d8[_0xbf60('0x16')];this[_0xbf60('0x17')]=this[_0xbf60('0x15')];this[_0xbf60('0x18')]=utils[_0xbf60('0x19')](_0x1d19d8[_0xbf60('0x14')],_0x1d19d8[_0xbf60('0x13')]);this['holdtime']=utils[_0xbf60('0x19')](this[_0xbf60('0x15')],_0x1d19d8['responsetime']);this['talktime']=0x0;this[_0xbf60('0x5')]=_0x545fd2[_0xbf60('0x5')];this['membername']=_0x545fd2[_0xbf60('0x1a')];this[_0xbf60('0x1b')]=_0x545fd2[_0xbf60('0x1b')];this[_0xbf60('0x1c')]=_0x1d19d8['callback'];this[_0xbf60('0x1d')]=_0x1d19d8[_0xbf60('0x1d')];this[_0xbf60('0x1e')]=_0x1d19d8[_0xbf60('0x1e')];this['recallme']=_0x1d19d8[_0xbf60('0x1f')];this[_0xbf60('0x20')]=_0x1d19d8[_0xbf60('0x20')];this[_0xbf60('0x21')]=_0x1d19d8[_0xbf60('0x21')];this[_0xbf60('0x22')]=_0x1d19d8[_0xbf60('0x22')];this[_0xbf60('0x23')]=_0x1d19d8[_0xbf60('0x23')];this['CampaignId']=_0x1d19d8[_0xbf60('0x24')];this[_0xbf60('0x25')]=_0x1d19d8['originatecalleridnum']||'';this['originatecalleridname']=_0x1d19d8[_0xbf60('0x26')]||'';this[_0xbf60('0x27')]=_0x1d19d8[_0xbf60('0x27')];this[_0xbf60('0x28')]=_0x1d19d8[_0xbf60('0x28')];this[_0xbf60('0x29')]=_0x1d19d8['statedesc'];}module[_0xbf60('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x9400=['droptime','dropreason','endtime','ringtime','responsetime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','starttime'];(function(_0x476ee0,_0x2254fc){var _0x1aae6f=function(_0x18899d){while(--_0x18899d){_0x476ee0['push'](_0x476ee0['shift']());}};_0x1aae6f(++_0x2254fc);}(_0x9400,0x1c6));var _0x0940=function(_0x219742,_0x220c6e){_0x219742=_0x219742-0x0;var _0x2efafa=_0x9400[_0x219742];return _0x2efafa;};'use strict';var utils=require(_0x0940('0x0'));function QueueCallerAbandon(_0x1954a9,_0x33a4cc){this[_0x0940('0x1')]=_0x1954a9[_0x0940('0x1')];this[_0x0940('0x2')]=_0x1954a9[_0x0940('0x2')];this[_0x0940('0x3')]=_0x1954a9[_0x0940('0x2')]===_0x0940('0x4')?_0x0940('0x5'):_0x1954a9[_0x0940('0x2')];this[_0x0940('0x6')]=_0x1954a9['countbusyretry'];this[_0x0940('0x7')]=_0x1954a9[_0x0940('0x7')];this[_0x0940('0x8')]=_0x1954a9[_0x0940('0x8')];this[_0x0940('0x9')]=_0x1954a9[_0x0940('0x6')]+_0x1954a9['countcongestionretry']+_0x1954a9[_0x0940('0x8')]+_0x1954a9[_0x0940('0xa')]+_0x1954a9[_0x0940('0xb')]+_0x1954a9[_0x0940('0xc')]+_0x1954a9['countmachineretry']+_0x1954a9[_0x0940('0xd')];this['countnosuchnumberretry']=_0x1954a9[_0x0940('0xa')];this[_0x0940('0xb')]=_0x1954a9['countdropretry'];this[_0x0940('0xc')]=_0x1954a9['countabandonedretry'];this['countmachineretry']=_0x1954a9[_0x0940('0xe')];this['countagentrejectretry']=_0x1954a9[_0x0940('0xd')];this[_0x0940('0xf')]=_0x33a4cc[_0x0940('0xf')];this[_0x0940('0x10')]=_0x1954a9[_0x0940('0x11')];this['calleridnum']=_0x1954a9['number'];this[_0x0940('0x12')]=_0x1954a9['starttime'];this['responsetime']=_0x1954a9['responsetime'];this[_0x0940('0x13')]=_0x1954a9[_0x0940('0x13')];this['dropreason']=_0x1954a9[_0x0940('0x14')];this[_0x0940('0x15')]=this['droptime'];this[_0x0940('0x16')]=utils['getSeconds'](_0x1954a9[_0x0940('0x17')],_0x1954a9[_0x0940('0x12')]);this['holdtime']=utils[_0x0940('0x18')](this[_0x0940('0x13')],_0x1954a9[_0x0940('0x17')]);this[_0x0940('0x19')]=0x0;this[_0x0940('0x5')]=_0x33a4cc[_0x0940('0x5')];this[_0x0940('0x1a')]=_0x33a4cc[_0x0940('0x1b')];this[_0x0940('0x1c')]=_0x33a4cc[_0x0940('0x1c')];this[_0x0940('0x1d')]=_0x1954a9[_0x0940('0x1d')];this[_0x0940('0x1e')]=_0x1954a9[_0x0940('0x1e')];this[_0x0940('0x1f')]=_0x1954a9[_0x0940('0x1f')];this[_0x0940('0x20')]=_0x1954a9[_0x0940('0x20')];this[_0x0940('0x21')]=_0x1954a9[_0x0940('0x21')];this[_0x0940('0x22')]=_0x1954a9[_0x0940('0x22')];this[_0x0940('0x23')]=_0x1954a9[_0x0940('0x23')];this['VoiceQueueId']=_0x1954a9[_0x0940('0x24')];this[_0x0940('0x25')]=_0x1954a9[_0x0940('0x25')];this[_0x0940('0x26')]=_0x1954a9[_0x0940('0x26')]||'';this['originatecalleridname']=_0x1954a9[_0x0940('0x27')]||'';this['agiafterat']=_0x1954a9['agiafterat'];this[_0x0940('0x28')]=_0x1954a9['state'];this['statedesc']=_0x1954a9[_0x0940('0x29')];}module[_0x0940('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index b2da56d..86383b3 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 _0x4137=['countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','[getContactDialer]','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4137,0xf8));var _0x7413=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4137[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x7413('0x0'));var logger=require(_0x7413('0x1'))(_0x7413('0x2'));var cmHopper=require(_0x7413('0x3'));var cmHopperAdditionalPhone=require(_0x7413('0x4'));var cmHopperBlack=require(_0x7413('0x5'));var cmHopperHistory=require(_0x7413('0x6'));function inspectError(_0x299eea){return util[_0x7413('0x7')](_0x299eea,{'showHidden':![],'depth':null});}function getContactDialer(_0x3dc48a,_0x451a96,_0x3bb181){return cmHopper['getContactDialer'](_0x3dc48a['id'],_0x451a96,_0x3bb181,_0x3dc48a[_0x7413('0x8')])[_0x7413('0x9')](function(_0x5b39ac){_0x3dc48a[_0x7413('0xa')]=0x0;logger['error'](_0x7413('0xb'),inspectError(_0x5b39ac));});}exports[_0x7413('0xc')]=getContactDialer;function getContactDialerIvr(_0x4e320b,_0x422bf5){return cmHopper[_0x7413('0xd')](_0x4e320b['id'],_0x422bf5,_0x4e320b['dialOrderByScheduledAt'])[_0x7413('0x9')](function(_0x427b3b){_0x4e320b[_0x7413('0xa')]=0x0;logger[_0x7413('0xe')](_0x7413('0xf'),inspectError(_0x427b3b));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0xa25d72){return cmHopper[_0x7413('0x10')](_0xa25d72)['catch'](function(_0x18a874){logger[_0x7413('0xe')](_0x7413('0x11'),inspectError(_0x18a874));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x5956b0){return cmHopper['rescheduleContact'](_0x5956b0)[_0x7413('0x9')](function(_0x336c4c){logger['error'](_0x7413('0x12'),inspectError(_0x336c4c));});}exports[_0x7413('0x13')]=rescheduleContact;function unlockContact(_0x4955d3,_0x38b3d1,_0x50f301){return cmHopper['unlockContact'](_0x4955d3,_0x38b3d1,_0x50f301)[_0x7413('0x9')](function(_0x568d1f){logger[_0x7413('0xe')]('[unlockContact]',inspectError(_0x568d1f));});}exports[_0x7413('0x14')]=unlockContact;function moveContactManagedDialer(_0x3230d8){return cmHopper[_0x7413('0x15')](_0x3230d8)[_0x7413('0x9')](function(_0x2a3417){logger[_0x7413('0xe')]('[moveContactManagedDialer]',inspectError(_0x2a3417));});}exports[_0x7413('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x17c062){return cmHopperBlack[_0x7413('0x16')](_0x17c062)[_0x7413('0x9')](function(_0x5bee15){logger[_0x7413('0xe')](_0x7413('0x17'),inspectError(_0x5bee15));});}exports[_0x7413('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x20d3d2){return cmHopperBlack[_0x7413('0x18')](_0x20d3d2)[_0x7413('0x9')](function(_0x4886e3){logger[_0x7413('0xe')]('[checkIsBlackListIvr]',inspectError(_0x4886e3));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x138508,_0x599654,_0x1585ba){return cmHopperAdditionalPhone[_0x7413('0x19')](_0x138508,_0x599654,_0x1585ba)[_0x7413('0x9')](function(_0x2fc0f4){logger[_0x7413('0xe')](_0x7413('0x1a'),inspectError(_0x2fc0f4));});}exports[_0x7413('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x41cb5d,_0x1d455b,_0x5a8329){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x41cb5d,_0x1d455b,_0x5a8329)[_0x7413('0x9')](function(_0x48c2dc){logger[_0x7413('0xe')](_0x7413('0x1b'),inspectError(_0x48c2dc));});}exports[_0x7413('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x4c2e90){return cmHopperHistory[_0x7413('0x1d')](_0x4c2e90)[_0x7413('0x9')](function(_0x79cab6){logger[_0x7413('0xe')](_0x7413('0x1e'),inspectError(_0x79cab6));});}exports[_0x7413('0x1d')]=avgHandleTime;function createHistory(_0x5eb4d9){return cmHopperHistory[_0x7413('0x1f')](_0x5eb4d9)['catch'](function(_0x1d0bde){logger[_0x7413('0xe')](_0x7413('0x20'),inspectError(_0x1d0bde));});}exports[_0x7413('0x1f')]=createHistory; \ No newline at end of file +var _0xe3da=['../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','util'];(function(_0x1e758e,_0x157fa3){var _0x23840b=function(_0x54b1a8){while(--_0x54b1a8){_0x1e758e['push'](_0x1e758e['shift']());}};_0x23840b(++_0x157fa3);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xae3d('0x0'));var logger=require(_0xae3d('0x1'))(_0xae3d('0x2'));var cmHopper=require(_0xae3d('0x3'));var cmHopperAdditionalPhone=require(_0xae3d('0x4'));var cmHopperBlack=require(_0xae3d('0x5'));var cmHopperHistory=require(_0xae3d('0x6'));function inspectError(_0x17952f){return util[_0xae3d('0x7')](_0x17952f,{'showHidden':![],'depth':null});}function getContactDialer(_0x22bacf,_0x1b9397,_0x26282d){return cmHopper[_0xae3d('0x8')](_0x22bacf['id'],_0x1b9397,_0x26282d,_0x22bacf[_0xae3d('0x9')])[_0xae3d('0xa')](function(_0x33c089){_0x22bacf['temp']=0x0;logger[_0xae3d('0xb')](_0xae3d('0xc'),inspectError(_0x33c089));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x577070,_0x459592){return cmHopper[_0xae3d('0xd')](_0x577070['id'],_0x459592,_0x577070[_0xae3d('0x9')])[_0xae3d('0xa')](function(_0x2705b8){_0x577070[_0xae3d('0xe')]=0x0;logger['error'](_0xae3d('0xf'),inspectError(_0x2705b8));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0xc7bd1c){return cmHopper[_0xae3d('0x10')](_0xc7bd1c)[_0xae3d('0xa')](function(_0x172f7a){logger['error'](_0xae3d('0x11'),inspectError(_0x172f7a));});}exports[_0xae3d('0x10')]=countReScheduled;function rescheduleContact(_0x16fd19){return cmHopper[_0xae3d('0x12')](_0x16fd19)[_0xae3d('0xa')](function(_0x430659){logger[_0xae3d('0xb')]('[rescheduleContact]',inspectError(_0x430659));});}exports[_0xae3d('0x12')]=rescheduleContact;function unlockContact(_0x42f4b4,_0x46295b,_0x230afb){return cmHopper[_0xae3d('0x13')](_0x42f4b4,_0x46295b,_0x230afb)[_0xae3d('0xa')](function(_0x585160){logger[_0xae3d('0xb')](_0xae3d('0x14'),inspectError(_0x585160));});}exports[_0xae3d('0x13')]=unlockContact;function moveContactManagedDialer(_0x5303c2){return cmHopper[_0xae3d('0x15')](_0x5303c2)[_0xae3d('0xa')](function(_0x558e42){logger['error'](_0xae3d('0x16'),inspectError(_0x558e42));});}exports[_0xae3d('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x19c44d){return cmHopperBlack[_0xae3d('0x17')](_0x19c44d)[_0xae3d('0xa')](function(_0x577f62){logger[_0xae3d('0xb')]('[checkIsBlackList]',inspectError(_0x577f62));});}exports[_0xae3d('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x2d138f){return cmHopperBlack[_0xae3d('0x18')](_0x2d138f)[_0xae3d('0xa')](function(_0x1facc1){logger[_0xae3d('0xb')](_0xae3d('0x19'),inspectError(_0x1facc1));});}exports[_0xae3d('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3224ff,_0x11ecf7,_0x300be8){return cmHopperAdditionalPhone[_0xae3d('0x1a')](_0x3224ff,_0x11ecf7,_0x300be8)[_0xae3d('0xa')](function(_0x1b2acb){logger[_0xae3d('0xb')](_0xae3d('0x1b'),inspectError(_0x1b2acb));});}exports[_0xae3d('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x21b608,_0x2131e9,_0x1b1217){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x21b608,_0x2131e9,_0x1b1217)[_0xae3d('0xa')](function(_0x185e71){logger[_0xae3d('0xb')](_0xae3d('0x1c'),inspectError(_0x185e71));});}exports[_0xae3d('0x1d')]=swapAdditionalPhones;function avgHandleTime(_0x4391db){return cmHopperHistory[_0xae3d('0x1e')](_0x4391db)['catch'](function(_0x57864e){logger[_0xae3d('0xb')](_0xae3d('0x1f'),inspectError(_0x57864e));});}exports[_0xae3d('0x1e')]=avgHandleTime;function createHistory(_0x3114f9){return cmHopperHistory[_0xae3d('0x20')](_0x3114f9)['catch'](function(_0x1d1483){logger[_0xae3d('0xb')]('[createHistory]',inspectError(_0x1d1483));});}exports[_0xae3d('0x20')]=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 cfd7a14..ef2d586 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 _0xbcba=['name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','../../../../config/logger','dialer','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk'];(function(_0xd51b98,_0xbd1f5){var _0x548ce8=function(_0x437b2a){while(--_0x437b2a){_0xd51b98['push'](_0xd51b98['shift']());}};_0x548ce8(++_0xbd1f5);}(_0xbcba,0x197));var _0xabcb=function(_0x68683b,_0x293913){_0x68683b=_0x68683b-0x0;var _0x336050=_0xbcba[_0x68683b];return _0x336050;};'use strict';var _=require(_0xabcb('0x0'));var moment=require(_0xabcb('0x1'));var util=require('util');var logger=require(_0xabcb('0x2'))(_0xabcb('0x3'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xabcb('0x4'),'BLACKLIST':_0xabcb('0x5'),'CONTACTS_RESCHEDULED':_0xabcb('0x6'),'DEACTIVATED':_0xabcb('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0xabcb('0x8'),'INACTIVE':_0xabcb('0x9'),'NO_AGENTS_LOGGED':_0xabcb('0xa'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xabcb('0xb'),'OVERTIME_GLOBAL_INTERVAL':_0xabcb('0xc'),'QUEUE_RECALL':_0xabcb('0xd'),'RECALL_TIMEOUT':_0xabcb('0xe'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xabcb('0xf'),'UNREACHABLE_TRUNK':_0xabcb('0x10')};exports[_0xabcb('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x511e03){return _0x511e03[_0xabcb('0x12')]===_0xabcb('0x13');}exports[_0xabcb('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x1582b0){return _0x1582b0[_0xabcb('0x15')]===_0xabcb('0x16');}exports[_0xabcb('0x17')]=isIVRCampaign;function isOutboundQueue(_0x41987d){return _0x41987d['type']==='outbound';}exports[_0xabcb('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x20f593){return _0x20f593[_0xabcb('0x19')];}exports[_0xabcb('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4f1cbe){return _0x4f1cbe[_0xabcb('0x1b')];}exports[_0xabcb('0x1c')]=isIVRCampaignActive;function getSeconds(_0x22caff,_0x356cfa){var _0x4a2466=moment(_0x22caff)[_0xabcb('0x1d')](0x0);var _0x31a495=moment(_0x356cfa)[_0xabcb('0x1d')](0x0);return _0x4a2466['diff'](_0x31a495,_0xabcb('0x1e'));}exports[_0xabcb('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x4ee532,_0x2f4290){var _0x2a5515=![];var _0x13ed6=_0x4ee532[_0xabcb('0x12')]!==_0x2f4290[_0xabcb('0x12')]||_0x4ee532[_0xabcb('0x19')]!==_0x2f4290[_0xabcb('0x19')]||_0x4ee532[_0xabcb('0x20')]!==_0x2f4290[_0xabcb('0x20')];var _0x3cd817=_0x4ee532[_0xabcb('0x21')]!==_0x2f4290[_0xabcb('0x21')]||_0x4ee532[_0xabcb('0x22')]!==_0x2f4290[_0xabcb('0x22')]||_0x4ee532['loggedInDb']!==_0x2f4290[_0xabcb('0x23')]||_0x4ee532[_0xabcb('0x24')]!==_0x2f4290[_0xabcb('0x24')]||_0x4ee532[_0xabcb('0x25')]!==_0x2f4290[_0xabcb('0x25')]||_0x4ee532[_0xabcb('0x26')]!==_0x2f4290[_0xabcb('0x26')]||_0x4ee532[_0xabcb('0x27')]!==_0x2f4290[_0xabcb('0x27')]||_0x4ee532[_0xabcb('0x28')]!==_0x2f4290[_0xabcb('0x28')]||_0x4ee532[_0xabcb('0x29')]!==_0x2f4290[_0xabcb('0x29')];if(_0x4ee532[_0xabcb('0x2a')]&&_0x2f4290[_0xabcb('0x2a')]){_0x2a5515=_0x4ee532['Trunk']['name']!==_0x2f4290[_0xabcb('0x2a')][_0xabcb('0x2b')]||_0x4ee532[_0xabcb('0x2a')][_0xabcb('0x1b')]!==_0x2f4290['Trunk'][_0xabcb('0x1b')];}return _0x13ed6||_0x3cd817||_0x2a5515;}exports[_0xabcb('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4d4a1a){var _0x30e486=null;var _0x422068=_0x4d4a1a['dialTimezone'];if(_[_0xabcb('0x2d')](_0x4d4a1a[_0xabcb('0x2e')])||_[_0xabcb('0x2d')](_0x4d4a1a['Interval'])||_[_0xabcb('0x2d')](_0x4d4a1a[_0xabcb('0x2f')][_0xabcb('0x30')])){_0x30e486=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x4d4a1a[_0xabcb('0x2e')])||_[_0xabcb('0x31')](_0x4d4a1a['Interval'][_0xabcb('0x30')])){_0x30e486=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x422068&&!timezones[_0x422068]){_0x30e486=CAMPAIGN_STATUS[_0xabcb('0x32')];}return _0x30e486;}function checkAnyValidTrunk(_0x45815e,_0x1b7431){var _0x2d13ea=null;var _0x139e35=_0xabcb('0x33');var _0x5cad28=[_0xabcb('0x34'),_0xabcb('0x35')];var _0x5ee069=!![];if(_0x45815e['Trunk']&&_0x45815e[_0xabcb('0x2a')][_0xabcb('0x1b')]){_0x139e35+=_0x45815e[_0xabcb('0x2a')][_0xabcb('0x2b')];_0x2d13ea=_0x1b7431[_0x139e35];_0x5ee069=_0x5cad28[_0xabcb('0x36')](_0x2d13ea[_0xabcb('0x37')]);}else if(_0x45815e[_0xabcb('0x38')]&&_0x45815e[_0xabcb('0x38')][_0xabcb('0x1b')]){_0x139e35+=_0x45815e[_0xabcb('0x38')][_0xabcb('0x2b')];_0x2d13ea=_0x1b7431[_0x139e35];_0x5ee069=_0x5cad28['includes'](_0x2d13ea[_0xabcb('0x37')]);}return _0x5ee069;}function getQueueCampaignStatusMessage(_0x913c87,_0x42e2cb){var _0x52d45e=CAMPAIGN_STATUS[_0xabcb('0x4')];var _0x59098e=isPreviewCampaign(_0x913c87);if(!isQueueCampaignActive(_0x913c87)){if(_0x59098e){_0x52d45e=CAMPAIGN_STATUS[_0xabcb('0x39')];}else{if(_0x913c87['originated']===0x0&&_0x913c87[_0xabcb('0x25')]===0x0&&_0x913c87[_0xabcb('0x27')]===0x0&&(_0x913c87['pTalking']||0x0)===0x0){_0x52d45e=CAMPAIGN_STATUS[_0xabcb('0x39')];}else{_0x52d45e=CAMPAIGN_STATUS[_0xabcb('0x3a')];}}}else if(_0x913c87['loggedIn']===0x0){_0x52d45e=CAMPAIGN_STATUS[_0xabcb('0x3b')];}else if(!checkAnyValidTrunk(_0x913c87,_0x42e2cb)){_0x52d45e=CAMPAIGN_STATUS[_0xabcb('0x3c')];}else if(!isPreviewCampaign(_0x913c87)){var _0x972d28=checkAnyValidQueueCampaignInterval(_0x913c87);if(_0x972d28){_0x52d45e=_0x972d28;}}return _0x52d45e;}exports[_0xabcb('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x451905){var _0x191b2c=CAMPAIGN_STATUS[_0xabcb('0x3a')];if(_0x451905[_0xabcb('0x29')]===0x0&&_0x451905[_0xabcb('0x25')]===0x0&&_0x451905[_0xabcb('0x27')]===0x0&&(_0x451905[_0xabcb('0x26')]||0x0)===0x0){_0x191b2c=CAMPAIGN_STATUS[_0xabcb('0x39')];}return _0x191b2c;}exports[_0xabcb('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x497cd8){var _0x2a2781=_0x497cd8[_0xabcb('0x3f')](/"(.*?)"/);return _0x2a2781?_0x2a2781[0x1]:_0x497cd8;}exports[_0xabcb('0x40')]=extractCalleridName;function getCallerId(_0x3c8be1,_0x1a79ec,_0x2c58d8){if(!_[_0xabcb('0x41')](_0x2c58d8)&&typeof _0x2c58d8===_0xabcb('0x42')&&!_[_0xabcb('0x31')](_0x2c58d8)){if(!_[_0xabcb('0x41')](_0x1a79ec)&&typeof _0x1a79ec===_0xabcb('0x42')&&!_[_0xabcb('0x31')](_0x1a79ec)){return util[_0xabcb('0x43')](_0xabcb('0x44'),_0x1a79ec,_0x2c58d8);}return util[_0xabcb('0x43')](_0xabcb('0x44'),_0x2c58d8,_0x2c58d8);}if(!_['isUndefined'](_0x3c8be1)&&typeof _0x3c8be1==='string'&&!_[_0xabcb('0x31')](_0x3c8be1)){return _0x3c8be1;}return'\x22\x22\x20<>';}exports[_0xabcb('0x45')]=getCallerId;function getCallerIdRandom(_0x37a734,_0x8298f0){var _0xb4ab09;var _0x119fdb;var _0x246bfb;if(_0x8298f0<=0x0){_0x8298f0=0x1;}_0xb4ab09=new RegExp(_0xabcb('0x46')+_0x8298f0+'}$');_0x119fdb=Math[_0xabcb('0x47')](0xa,_0x8298f0-0x1);_0x246bfb=Math['pow'](0xa,_0x8298f0)-0x1;return util[_0xabcb('0x43')]('%s',_[_0xabcb('0x48')](_0x37a734,_0xb4ab09,_[_0xabcb('0x49')](_0x119fdb,_0x246bfb)[_0xabcb('0x4a')]()));}exports[_0xabcb('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x4e433f){if(_0x4e433f[_0xabcb('0x29')]&&_0x4e433f[_0xabcb('0x29')]>0x0){_0x4e433f['originated']-=0x1;}else{logger['error'](_0xabcb('0x4c'));}}exports[_0xabcb('0x4d')]=decrementOriginate;function checkContactEmpty(_0x137a39){return _0x137a39&&_0x137a39['length']>0x0;}exports[_0xabcb('0x4e')]=checkContactEmpty;function erlangb(_0x503efa,_0x24c0e1){if(_0x24c0e1===0x0){return 0x0;}var _0x1c8890=0x1;for(var _0x4d685b=0x1;_0x4d685b<=_0x24c0e1;_0x4d685b+=0x1){_0x1c8890=0x1+_0x1c8890*_0x4d685b/_0x503efa;}return 0x1/_0x1c8890;}exports[_0xabcb('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x120a66,_0x46e567,_0x18d7e4){if(_0x46e567>_0x18d7e4){for(var _0x42d238=0x0;_0x42d238<_0x46e567-_0x18d7e4;_0x42d238+=0x1){decrementOriginate(_0x120a66);}}}exports[_0xabcb('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4f9d6c){var _0x31c205={};var _0x68146a=['id',_0xabcb('0x51'),_0xabcb('0x52'),_0xabcb('0x53'),_0xabcb('0x54')];if(_0x4f9d6c){for(var _0x3777b1 in _0x4f9d6c){if(typeof _0x4f9d6c[_0x3777b1]!==_0xabcb('0x55')){if(!_[_0xabcb('0x2d')](_0x4f9d6c[_0x3777b1])&&!_0x68146a[_0xabcb('0x36')](_0x3777b1)){_0x31c205[util['format'](_0xabcb('0x56'),_0xabcb('0x57'),_0x3777b1[_0xabcb('0x58')]())]=_0x4f9d6c[_0x3777b1];}}}}return _0x31c205;}exports[_0xabcb('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0x2a62=['random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','%s%s','XMD-','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','isIVRCampaignActive','milliseconds','seconds','getSeconds','dialActive','message','available','loggedIn','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialGlobalInterval','Interval','isNil','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','format','replace'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x2a62,0xb8));var _0x22a6=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x2a62[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x22a6('0x0'));var moment=require(_0x22a6('0x1'));var util=require(_0x22a6('0x2'));var logger=require('../../../../config/logger')(_0x22a6('0x3'));var timezones=require(_0x22a6('0x4'))[_0x22a6('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x22a6('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x22a6('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x22a6('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x22a6('0x9'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x22a6('0xa'),'OVERTIME_GLOBAL_INTERVAL':_0x22a6('0xb'),'QUEUE_RECALL':_0x22a6('0xc'),'RECALL_TIMEOUT':_0x22a6('0xd'),'RUNNING':_0x22a6('0xe'),'UNKNOWN_TIMEZONE':_0x22a6('0xf'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2c2654){return _0x2c2654[_0x22a6('0x10')]===_0x22a6('0x11');}exports[_0x22a6('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x46b730){return _0x46b730[_0x22a6('0x13')]===_0x22a6('0x14');}exports[_0x22a6('0x15')]=isIVRCampaign;function isOutboundQueue(_0x5cd991){return _0x5cd991[_0x22a6('0x13')]===_0x22a6('0x16');}exports[_0x22a6('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x7db7dc){return _0x7db7dc['dialActive'];}exports[_0x22a6('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4daecf){return _0x4daecf['active'];}exports[_0x22a6('0x19')]=isIVRCampaignActive;function getSeconds(_0x32e2bc,_0x4dad55){var _0x42d302=moment(_0x32e2bc)[_0x22a6('0x1a')](0x0);var _0x3a8789=moment(_0x4dad55)[_0x22a6('0x1a')](0x0);return _0x42d302['diff'](_0x3a8789,_0x22a6('0x1b'));}exports[_0x22a6('0x1c')]=getSeconds;function hasQueueCampaignDataChanged(_0x3b03aa,_0x46ee3a){var _0x6e3656=![];var _0x48c17e=_0x3b03aa['dialMethod']!==_0x46ee3a[_0x22a6('0x10')]||_0x3b03aa['dialActive']!==_0x46ee3a[_0x22a6('0x1d')]||_0x3b03aa['message']!==_0x46ee3a[_0x22a6('0x1e')];var _0x34fcb2=_0x3b03aa[_0x22a6('0x1f')]!==_0x46ee3a[_0x22a6('0x1f')]||_0x3b03aa[_0x22a6('0x20')]!==_0x46ee3a[_0x22a6('0x20')]||_0x3b03aa['loggedInDb']!==_0x46ee3a['loggedInDb']||_0x3b03aa['paused']!==_0x46ee3a[_0x22a6('0x21')]||_0x3b03aa[_0x22a6('0x22')]!==_0x46ee3a[_0x22a6('0x22')]||_0x3b03aa['pTalking']!==_0x46ee3a[_0x22a6('0x23')]||_0x3b03aa['waiting']!==_0x46ee3a[_0x22a6('0x24')]||_0x3b03aa[_0x22a6('0x25')]!==_0x46ee3a[_0x22a6('0x25')]||_0x3b03aa[_0x22a6('0x26')]!==_0x46ee3a[_0x22a6('0x26')];if(_0x3b03aa[_0x22a6('0x27')]&&_0x46ee3a[_0x22a6('0x27')]){_0x6e3656=_0x3b03aa[_0x22a6('0x27')]['name']!==_0x46ee3a[_0x22a6('0x27')][_0x22a6('0x28')]||_0x3b03aa[_0x22a6('0x27')][_0x22a6('0x29')]!==_0x46ee3a[_0x22a6('0x27')]['active'];}return _0x48c17e||_0x34fcb2||_0x6e3656;}exports[_0x22a6('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2b989f){var _0x7d8091=null;var _0x4c52e1=_0x2b989f['dialTimezone'];if(_['isNil'](_0x2b989f[_0x22a6('0x2b')])||_['isNil'](_0x2b989f[_0x22a6('0x2c')])||_[_0x22a6('0x2d')](_0x2b989f['Interval']['Intervals'])){_0x7d8091=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x22a6('0x2e')](_0x2b989f[_0x22a6('0x2b')])||_[_0x22a6('0x2e')](_0x2b989f[_0x22a6('0x2c')][_0x22a6('0x2f')])){_0x7d8091=CAMPAIGN_STATUS[_0x22a6('0x30')];}else if(_0x4c52e1&&!timezones[_0x4c52e1]){_0x7d8091=CAMPAIGN_STATUS[_0x22a6('0x31')];}return _0x7d8091;}function checkAnyValidTrunk(_0x3aeb41,_0x4610f2){var _0x12e6bf=null;var _0x1a4fb6='SIP/';var _0x4c8625=['reachable',_0x22a6('0x32')];var _0x471b4e=!![];if(_0x3aeb41[_0x22a6('0x27')]&&_0x3aeb41[_0x22a6('0x27')][_0x22a6('0x29')]){_0x1a4fb6+=_0x3aeb41[_0x22a6('0x27')][_0x22a6('0x28')];_0x12e6bf=_0x4610f2[_0x1a4fb6];_0x471b4e=_0x4c8625[_0x22a6('0x33')](_0x12e6bf[_0x22a6('0x34')]);}else if(_0x3aeb41[_0x22a6('0x35')]&&_0x3aeb41[_0x22a6('0x35')][_0x22a6('0x29')]){_0x1a4fb6+=_0x3aeb41['TrunkBackup'][_0x22a6('0x28')];_0x12e6bf=_0x4610f2[_0x1a4fb6];_0x471b4e=_0x4c8625[_0x22a6('0x33')](_0x12e6bf[_0x22a6('0x34')]);}return _0x471b4e;}function getQueueCampaignStatusMessage(_0x49d1ad,_0x208d87){var _0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x6')];var _0x20025e=isPreviewCampaign(_0x49d1ad);if(!isQueueCampaignActive(_0x49d1ad)){if(_0x20025e){_0x5d225d=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x49d1ad['originated']===0x0&&_0x49d1ad[_0x22a6('0x22')]===0x0&&_0x49d1ad[_0x22a6('0x24')]===0x0&&(_0x49d1ad[_0x22a6('0x23')]||0x0)===0x0){_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x36')];}else{_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x37')];}}}else if(_0x49d1ad[_0x22a6('0x20')]===0x0){_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x38')];}else if(!checkAnyValidTrunk(_0x49d1ad,_0x208d87)){_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x39')];}else if(!isPreviewCampaign(_0x49d1ad)){var _0x289838=checkAnyValidQueueCampaignInterval(_0x49d1ad);if(_0x289838){_0x5d225d=_0x289838;}}return _0x5d225d;}exports[_0x22a6('0x3a')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5ddc64){var _0x116daf=CAMPAIGN_STATUS[_0x22a6('0x37')];if(_0x5ddc64[_0x22a6('0x26')]===0x0&&_0x5ddc64[_0x22a6('0x22')]===0x0&&_0x5ddc64[_0x22a6('0x24')]===0x0&&(_0x5ddc64[_0x22a6('0x23')]||0x0)===0x0){_0x116daf=CAMPAIGN_STATUS[_0x22a6('0x36')];}return _0x116daf;}exports[_0x22a6('0x3b')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1dbea3){var _0xf0b90b=_0x1dbea3[_0x22a6('0x3c')](/"(.*?)"/);return _0xf0b90b?_0xf0b90b[0x1]:_0x1dbea3;}exports[_0x22a6('0x3d')]=extractCalleridName;function getCallerId(_0x26a199,_0x2e8f41,_0x33735e){if(!_[_0x22a6('0x3e')](_0x33735e)&&typeof _0x33735e===_0x22a6('0x3f')&&!_[_0x22a6('0x2e')](_0x33735e)){if(!_[_0x22a6('0x3e')](_0x2e8f41)&&typeof _0x2e8f41===_0x22a6('0x3f')&&!_['isEmpty'](_0x2e8f41)){return util['format']('\x22%s\x22\x20<%s>',_0x2e8f41,_0x33735e);}return util['format'](_0x22a6('0x40'),_0x33735e,_0x33735e);}if(!_[_0x22a6('0x3e')](_0x26a199)&&typeof _0x26a199===_0x22a6('0x3f')&&!_['isEmpty'](_0x26a199)){return _0x26a199;}return _0x22a6('0x41');}exports[_0x22a6('0x42')]=getCallerId;function getCallerIdRandom(_0xec3308,_0x13baf4){var _0x58543e;var _0x1e32c6;var _0x201b1f;if(_0x13baf4<=0x0){_0x13baf4=0x1;}_0x58543e=new RegExp(_0x22a6('0x43')+_0x13baf4+'}$');_0x1e32c6=Math[_0x22a6('0x44')](0xa,_0x13baf4-0x1);_0x201b1f=Math['pow'](0xa,_0x13baf4)-0x1;return util[_0x22a6('0x45')]('%s',_[_0x22a6('0x46')](_0xec3308,_0x58543e,_[_0x22a6('0x47')](_0x1e32c6,_0x201b1f)[_0x22a6('0x48')]()));}exports[_0x22a6('0x49')]=getCallerIdRandom;function decrementOriginate(_0x3a370e){if(_0x3a370e[_0x22a6('0x26')]&&_0x3a370e[_0x22a6('0x26')]>0x0){_0x3a370e['originated']-=0x1;}else{logger[_0x22a6('0x4a')](_0x22a6('0x4b'));}}exports[_0x22a6('0x4c')]=decrementOriginate;function checkContactEmpty(_0x19a2d9){return _0x19a2d9&&_0x19a2d9['length']>0x0;}exports[_0x22a6('0x4d')]=checkContactEmpty;function erlangb(_0x2e1cd9,_0x3bbd49){if(_0x3bbd49===0x0){return 0x0;}var _0x13e4f2=0x1;for(var _0x3a0bcf=0x1;_0x3a0bcf<=_0x3bbd49;_0x3a0bcf+=0x1){_0x13e4f2=0x1+_0x13e4f2*_0x3a0bcf/_0x2e1cd9;}return 0x1/_0x13e4f2;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x3cd7c7,_0x2cbd92,_0x4e7ee6){if(_0x2cbd92>_0x4e7ee6){for(var _0x44127a=0x0;_0x44127a<_0x2cbd92-_0x4e7ee6;_0x44127a+=0x1){decrementOriginate(_0x3cd7c7);}}}exports[_0x22a6('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x3fc2bb){var _0x469fff={};var _0x572d1a=['id',_0x22a6('0x4f'),'description','tags',_0x22a6('0x50')];if(_0x3fc2bb){for(var _0xc3d6ce in _0x3fc2bb){if(typeof _0x3fc2bb[_0xc3d6ce]!==_0x22a6('0x51')){if(!_['isNil'](_0x3fc2bb[_0xc3d6ce])&&!_0x572d1a['includes'](_0xc3d6ce)){_0x469fff[util['format'](_0x22a6('0x52'),_0x22a6('0x53'),_0xc3d6ce['toUpperCase']())]=_0x3fc2bb[_0xc3d6ce];}}}}return _0x469fff;}exports[_0x22a6('0x54')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8c452c1..4f0a61c 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(_0x40b086,_0x582c4d){var _0x468e43=function(_0x409298){while(--_0x409298){_0x40b086['push'](_0x40b086['shift']());}};_0x468e43(++_0x582c4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x2688c3,_0x25f2de){var _0x942e76=function(_0x1f3e35){while(--_0x1f3e35){_0x2688c3['push'](_0x2688c3['shift']());}};_0x942e76(++_0x25f2de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 a10aeb3..e80e04c 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 _0x0b33=['operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','application/pdf','then','notify','parse','.pdf','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][Updated]','catch','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','prototype','context','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc'];(function(_0x279112,_0x3b5a38){var _0x48bc97=function(_0xe492ee){while(--_0xe492ee){_0x279112['push'](_0x279112['shift']());}};_0x48bc97(++_0x3b5a38);}(_0x0b33,0x19c));var _0x30b3=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x0b33[_0x1344d6];return _0xf45b24;};'use strict';var util=require(_0x30b3('0x0'));var _=require(_0x30b3('0x1'));var BPromise=require(_0x30b3('0x2'));var uuid=require(_0x30b3('0x3'));var moment=require('moment');var path=require(_0x30b3('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x30b3('0x5'));var logger=require(_0x30b3('0x6'))(_0x30b3('0x7'));var ami=require(_0x30b3('0x8'));var rpcDb=require(_0x30b3('0x9'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x30b3('0xa'));var faxAccount=require(_0x30b3('0xb'));var attachment=require(_0x30b3('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x25d8fb){this[_0x30b3('0xd')]={};this[_0x30b3('0xe')]=_0x25d8fb[_0x30b3('0xe')];this[_0x30b3('0xf')]=_0x25d8fb['trunks'];this[_0x30b3('0x10')]={};ami['on'](_0x30b3('0x11'),this[_0x30b3('0x12')]['bind'](this));ami['on'](_0x30b3('0x13'),this[_0x30b3('0x14')][_0x30b3('0x15')](this));ami['on'](_0x30b3('0x16'),this[_0x30b3('0x17')]['bind'](this));ami['on'](_0x30b3('0x18'),this[_0x30b3('0x19')][_0x30b3('0x15')](this));ami['on'](_0x30b3('0x1a'),this[_0x30b3('0x1b')][_0x30b3('0x15')](this));ami['on'](_0x30b3('0x1c'),this['syncReceiveFax']['bind'](this));ami['on'](_0x30b3('0x1d'),this[_0x30b3('0x1e')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x30b3('0x15')](this));}Fax[_0x30b3('0x1f')][_0x30b3('0x12')]=function(_0x22cdf5){if(_0x22cdf5[_0x30b3('0x20')]==='from-voip-provider'){for(var _0xf34644 in this['faxAccounts']){if(this['faxAccounts']['hasOwnProperty'](_0xf34644)){if(_0x22cdf5[_0x30b3('0x21')]===this['faxAccounts'][_0xf34644][_0x30b3('0x22')]){this['channels'][_0x22cdf5[_0x30b3('0x23')]]={};this[_0x30b3('0xd')][_0x22cdf5[_0x30b3('0x23')]][_0x30b3('0x24')]=_0x22cdf5[_0x30b3('0x24')];this[_0x30b3('0xd')][_0x22cdf5[_0x30b3('0x23')]]['id']=this[_0x30b3('0xe')][_0xf34644]['id'];this[_0x30b3('0xd')][_0x22cdf5[_0x30b3('0x23')]][_0x30b3('0x25')]=this[_0x30b3('0xe')][_0xf34644][_0x30b3('0x25')];logger[_0x30b3('0x26')](_0x22cdf5[_0x30b3('0x23')],_0x30b3('0x27'));}}}}if(this['actions'][_0x22cdf5[_0x30b3('0x23')]]){this[_0x30b3('0xd')][_0x22cdf5[_0x30b3('0x23')]]={};this[_0x30b3('0xd')][_0x22cdf5[_0x30b3('0x23')]][_0x30b3('0x24')]=_0x22cdf5[_0x30b3('0x24')];logger[_0x30b3('0x26')](_0x22cdf5[_0x30b3('0x23')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x30b3('0x14')]=function(_0x3e114b){if(this['channels'][_0x3e114b[_0x30b3('0x23')]]){for(var _0x2147dd in _0x3e114b['variable']){if(_0x3e114b[_0x30b3('0x28')][_0x30b3('0x29')](_0x2147dd)){this[_0x30b3('0xd')][_0x3e114b[_0x30b3('0x23')]][_0x2147dd]=_0x3e114b['value'];}}}};Fax[_0x30b3('0x1f')][_0x30b3('0x17')]=function(_0x4790ac){if(this[_0x30b3('0xd')][_0x4790ac[_0x30b3('0x23')]]){this['channels'][_0x4790ac[_0x30b3('0x23')]]['channelstate']=_0x4790ac[_0x30b3('0x2a')];this[_0x30b3('0xd')][_0x4790ac[_0x30b3('0x23')]][_0x30b3('0x2b')]=_0x4790ac[_0x30b3('0x2b')];}};Fax['prototype']['syncNewExten']=function(_0x5a5a11){if(this[_0x30b3('0xd')][_0x5a5a11['uniqueid']]){for(var _0x204740 in _0x5a5a11[_0x30b3('0x28')]){if(_0x5a5a11[_0x30b3('0x28')][_0x30b3('0x29')](_0x204740)){this['channels'][_0x5a5a11['uniqueid']][_0x204740]=_0x5a5a11['value'];}}}};Fax['prototype']['syncFaxStatus']=function(_0x394a59){if(this['channels'][_0x394a59[_0x30b3('0x23')]]){this['channels'][_0x394a59[_0x30b3('0x23')]][_0x30b3('0x2c')]=_0x394a59['operation'];this[_0x30b3('0xd')][_0x394a59[_0x30b3('0x23')]][_0x30b3('0x2d')]=_0x394a59[_0x30b3('0x2d')];this[_0x30b3('0xd')][_0x394a59[_0x30b3('0x23')]][_0x30b3('0x22')]=_0x394a59[_0x30b3('0x22')];this[_0x30b3('0xd')][_0x394a59[_0x30b3('0x23')]][_0x30b3('0x2e')]=_0x394a59[_0x30b3('0x2e')];logger[_0x30b3('0x26')](_0x394a59[_0x30b3('0x23')],_0x30b3('0x2f'));}};Fax[_0x30b3('0x1f')][_0x30b3('0x30')]=function(_0x595ad2){var _0x360051=this;if(this[_0x30b3('0xd')][_0x595ad2[_0x30b3('0x23')]]){var _0xc942a2=this[_0x30b3('0xd')][_0x595ad2['uniqueid']]['id'];this[_0x30b3('0xd')][_0x595ad2[_0x30b3('0x23')]][_0x30b3('0x31')]=_0x595ad2[_0x30b3('0x31')];this[_0x30b3('0xd')][_0x595ad2['uniqueid']]['pagestransferred']=_0x595ad2[_0x30b3('0x32')];this[_0x30b3('0xd')][_0x595ad2['uniqueid']][_0x30b3('0x22')]=_0x595ad2['localstationid'];this['channels'][_0x595ad2[_0x30b3('0x23')]][_0x30b3('0x33')]=_0x595ad2[_0x30b3('0x33')];this['channels'][_0x595ad2[_0x30b3('0x23')]]['transferrate']=_0x595ad2[_0x30b3('0x34')];this[_0x30b3('0xd')][_0x595ad2[_0x30b3('0x23')]][_0x30b3('0x2e')]=_0x595ad2[_0x30b3('0x2e')];this['channels'][_0x595ad2[_0x30b3('0x23')]][_0x30b3('0x35')]=_0x595ad2[_0x30b3('0x35')];if(this[_0x30b3('0xd')][_0x595ad2[_0x30b3('0x23')]][_0x30b3('0x32')]>0x0){tiff2pdf(_0x595ad2[_0x30b3('0x2e')],_0x30b3('0x36'),function(_0x334cd9){logger[_0x30b3('0x26')](_0x595ad2[_0x30b3('0x23')],'\x20result\x20conversion\x20file\x20',_0x334cd9[_0x30b3('0x37')]);attachment['create']({'name':path['parse'](_0x595ad2['filename'])[_0x30b3('0x25')],'basename':path['parse'](_0x595ad2[_0x30b3('0x2e')])['name']+'.pdf','type':_0x30b3('0x38')})[_0x30b3('0x39')](function(_0x5b341f){faxAccount[_0x30b3('0x3a')](_0xc942a2,{'from':_0x595ad2[_0x30b3('0x35')],'mapKey':_0x30b3('0x7'),'body':path[_0x30b3('0x3b')](_0x595ad2['filename'])[_0x30b3('0x25')]+_0x30b3('0x3c'),'AttachmentId':_0x5b341f['id']})['catch'](function(_0x2f1026){logger['error'](_0x595ad2['uniqueid'],_0x30b3('0x3d'),JSON[_0x30b3('0x3e')](_0x2f1026));});})['catch'](function(_0x565fe7){logger[_0x30b3('0x3f')](_0x595ad2[_0x30b3('0x23')],_0x30b3('0x40'),JSON[_0x30b3('0x3e')](_0x565fe7));});});}logger['info'](_0x595ad2['uniqueid'],_0x30b3('0x40'));}};Fax[_0x30b3('0x1f')][_0x30b3('0x41')]=function(_0x32687){if(this[_0x30b3('0x10')][_0x32687[_0x30b3('0x23')]]){_[_0x30b3('0x42')](this[_0x30b3('0xd')][_0x32687['uniqueid']],_[_0x30b3('0x43')](_0x32687,['response','reason']));}};function updateStatus(_0x1a27e1){if(_0x1a27e1['AttachmentId']){faxMessage[_0x30b3('0x44')](_0x1a27e1['AttachmentId'],{'failMessage':_0x30b3('0x45')})[_0x30b3('0x39')](function(_0x395f18){ut[_0x30b3('0x46')]('[Fax][Message][Error][Updated]',_0x395f18);})['catch'](function(_0x4cf3b5){ut[_0x30b3('0x46')](_0x30b3('0x47'),_0x4cf3b5);});}else{ut[_0x30b3('0x46')](_0x30b3('0x48'));}}Fax['prototype'][_0x30b3('0x49')]=function(_0xd5f654,_0x3eccb1,_0x37fef7){var _0x425ab8=this;var _0x1c3735={};if(_0x3eccb1){_0x1c3735={'read':_0x3eccb1};}else{_0x1c3735={'failMessage':_0x37fef7};}if(this[_0x30b3('0x10')][_0xd5f654][_0x30b3('0x4a')]){faxMessage[_0x30b3('0x44')](this[_0x30b3('0x10')][_0xd5f654][_0x30b3('0x4a')],_0x1c3735)[_0x30b3('0x39')](function(_0x1571dd){ut[_0x30b3('0x46')](_0x30b3('0x4b'),_0x1571dd);})[_0x30b3('0x4c')](function(_0xed13fb){ut[_0x30b3('0x46')](_0x30b3('0x4d'),_0xed13fb);})[_0x30b3('0x4e')](function(){delete _0x425ab8[_0x30b3('0xd')][_0xd5f654];delete _0x425ab8[_0x30b3('0x10')][_0xd5f654];});}else{ut[_0x30b3('0x46')](_0x30b3('0x4f'));delete this[_0x30b3('0xd')][_0xd5f654];delete this['actions'][_0xd5f654];}};Fax['prototype'][_0x30b3('0x1e')]=function(_0x571bfd){var _0x2702c5=this;if(this['channels'][_0x571bfd['uniqueid']]){if(this['actions'][_0x571bfd[_0x30b3('0x23')]]){this[_0x30b3('0xd')][_0x571bfd['uniqueid']]['id']=this[_0x30b3('0x10')][_0x571bfd['uniqueid']]['id'];this[_0x30b3('0xd')][_0x571bfd[_0x30b3('0x23')]][_0x30b3('0x25')]=this['actions'][_0x571bfd[_0x30b3('0x23')]][_0x30b3('0x25')];}logger[_0x30b3('0x26')](_0x571bfd[_0x30b3('0x23')],this['actions'][_0x571bfd[_0x30b3('0x23')]]?_0x30b3('0x50'):_0x30b3('0x51'),JSON[_0x30b3('0x3e')](this['channels'][_0x571bfd[_0x30b3('0x23')]]));if(this[_0x30b3('0x10')][_0x571bfd['uniqueid']]){if(this['channels'][_0x571bfd['uniqueid']][_0x30b3('0x52')]>0x0&&this['channels'][_0x571bfd[_0x30b3('0x23')]][_0x30b3('0x1a')]===_0x30b3('0x53')){this[_0x30b3('0x49')](_0x571bfd[_0x30b3('0x23')],!![]);}else{this[_0x30b3('0x49')](_0x571bfd[_0x30b3('0x23')],![],this['channels'][_0x571bfd[_0x30b3('0x23')]][_0x30b3('0x54')]?_0x30b3('0x55')+this[_0x30b3('0xd')][_0x571bfd[_0x30b3('0x23')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax['prototype']['send']=function(_0x3492de){var _0x2516ed=this;return new BPromise(function(_0x107740,_0x198645){_0x2516ed[_0x30b3('0x56')](_0x3492de,_0x2516ed[_0x30b3('0xe')][_0x3492de[_0x30b3('0x57')]])[_0x30b3('0x39')](function(_0x4bec52){ut[_0x30b3('0x46')]('[Fax][execOriginate][success]',_0x4bec52);_0x107740(ut[_0x30b3('0x37')]('Fax\x20received'));})[_0x30b3('0x4c')](function(_0x13a6cb){ut['logger'](_0x30b3('0x58'),_0x13a6cb);updateStatus(_0x3492de);_0x198645(ut[_0x30b3('0x37')]('Fax\x20failed'));});});};Fax[_0x30b3('0x1f')][_0x30b3('0x59')]=function(_0xc3ad05){var _0x376735=this;return new BPromise(function(_0x19d3c3,_0x18cc18){var _0x3222a5=_0x376735[_0x30b3('0x5a')](_0x376735[_0x30b3('0xe')][_0xc3ad05[_0x30b3('0x57')]][_0x30b3('0x5b')],_0xc3ad05);if(_0x3222a5[_0x30b3('0x5c')]){_0x19d3c3(ut[_0x30b3('0x37')](_0x30b3('0x5d')));}else{_0x18cc18(ut[_0x30b3('0x37')](_0x3222a5['message']));}});};function originate(_0x27f3fa,_0x37c460,_0x3b4f40){return new BPromise(function(_0x3c5300,_0x28b160){if(_0x3b4f40){var _0x6c00a1=util[_0x30b3('0x5e')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x30b3('0x3b')](_0x27f3fa[_0x30b3('0x4')])[_0x30b3('0x25')],_0x27f3fa[_0x30b3('0x4')]);gs[_0x30b3('0x5f')](_0x6c00a1)[_0x30b3('0x39')](function(){_0x27f3fa[_0x30b3('0x4')]=util[_0x30b3('0x5e')](_0x30b3('0x60'),path[_0x30b3('0x3b')](_0x27f3fa[_0x30b3('0x4')])[_0x30b3('0x61')],path[_0x30b3('0x3b')](_0x27f3fa[_0x30b3('0x4')])[_0x30b3('0x25')]);_0x37c460[_0x30b3('0x62')]=_0x27f3fa[_0x30b3('0x4')];ut['logger'](_0x30b3('0x63'),'');ami[_0x30b3('0x64')](ut[_0x30b3('0x65')](_0x27f3fa,_0x37c460))[_0x30b3('0x39')](function(_0x577627){_0x3c5300(_0x577627);})['catch'](function(_0x2a7a61){_0x28b160(_0x2a7a61);});})['catch'](function(_0xfd6cbb){_0x28b160(_0xfd6cbb);});}else{ami[_0x30b3('0x64')](ut[_0x30b3('0x65')](_0x27f3fa,_0x37c460))['then'](function(_0x362064){_0x3c5300(_0x362064);})['catch'](function(_0x3cc779){_0x28b160(_0x3cc779);});}});}Fax[_0x30b3('0x1f')]['execOriginate']=function(_0x4b71a4,_0x2451ef){var _0x310c7c=this;return new BPromise(function(_0xb6442c,_0x1a48c7){var _0x355b20=uuid['v4']();var _0x12a7e2=ut['addVariables'](_0x4b71a4,_0x2451ef);_0x310c7c['actions'][_0x355b20]=new Action(_0x355b20,_0x2451ef,_0x4b71a4);var _0x72705d=_0x310c7c[_0x30b3('0x10')][_0x355b20];if(path[_0x30b3('0x3b')](_0x4b71a4[_0x30b3('0x4')])[_0x30b3('0x66')]===_0x30b3('0x3c')){originate(_0x72705d,_0x12a7e2,!![])[_0x30b3('0x39')](function(_0x313b04){_0xb6442c(_0x313b04);})[_0x30b3('0x4c')](function(_0x7902be){_0x1a48c7(_0x7902be);});}else{originate(_0x72705d,_0x12a7e2,![])['then'](function(_0x5eea90){_0xb6442c(_0x5eea90);})['catch'](function(_0x57b71b){_0x1a48c7(_0x57b71b);});}});};Fax[_0x30b3('0x1f')][_0x30b3('0x67')]=function(_0x593267){return!_[_0x30b3('0x68')](_0x593267)&&!_[_0x30b3('0x68')](_0x593267[_0x30b3('0x25')])&&!_[_0x30b3('0x68')](_0x593267[_0x30b3('0x69')])&&_0x593267['active']&&!_[_0x30b3('0x68')](this[_0x30b3('0xf')][util['format'](_0x30b3('0x6a'),_0x593267['name'])])&&!_['isNil'](this['trunks'][util[_0x30b3('0x5e')](_0x30b3('0x6a'),_0x593267[_0x30b3('0x25')])][_0x30b3('0x2d')])&&(this[_0x30b3('0xf')][util[_0x30b3('0x5e')](_0x30b3('0x6a'),_0x593267[_0x30b3('0x25')])]['status']===_0x30b3('0x6b')||this[_0x30b3('0xf')][util[_0x30b3('0x5e')](_0x30b3('0x6a'),_0x593267[_0x30b3('0x25')])][_0x30b3('0x2d')]===_0x30b3('0x6c'));};Fax[_0x30b3('0x1f')]['checkTrunk']=function(_0x3a0515,_0x51a9b2){if(!this[_0x30b3('0x67')](_0x3a0515)){ut[_0x30b3('0x46')](_0x30b3('0x6d'),_[_0x30b3('0x68')](_0x3a0515)?'':_0x3a0515[_0x30b3('0x25')]+_0x30b3('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x51a9b2['fax'])){ut[_0x30b3('0x46')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x51a9b2));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x30b3('0x68')](_0x51a9b2[_0x30b3('0x4')])){ut[_0x30b3('0x46')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x30b3('0x3e')](_0x51a9b2));return{'isValid':![],'message':_0x30b3('0x6f')};}return{'isValid':!![],'message':_0x30b3('0x70')};};module[_0x30b3('0x71')]=Fax; \ No newline at end of file +var _0xe3ed=['Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','format','path','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xe3ed,0x1d5));var _0xde3e=function(_0x5ea1ad,_0x2dfa93){_0x5ea1ad=_0x5ea1ad-0x0;var _0x16726c=_0xe3ed[_0x5ea1ad];return _0x16726c;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xde3e('0x0'));var uuid=require(_0xde3e('0x1'));var moment=require(_0xde3e('0x2'));var path=require('path');var tiff2pdf=require(_0xde3e('0x3'));var gs=require(_0xde3e('0x4'));var logger=require(_0xde3e('0x5'))(_0xde3e('0x6'));var ami=require(_0xde3e('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0xde3e('0x8'));var ut=require(_0xde3e('0x9'));var Action=require(_0xde3e('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xde3e('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x279509){this[_0xde3e('0xc')]={};this[_0xde3e('0xd')]=_0x279509[_0xde3e('0xd')];this[_0xde3e('0xe')]=_0x279509[_0xde3e('0xe')];this[_0xde3e('0xf')]={};ami['on'](_0xde3e('0x10'),this[_0xde3e('0x11')][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x13'),this['syncVarSet'][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x14'),this['syncNewState']['bind'](this));ami['on'](_0xde3e('0x15'),this['syncNewExten'][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x16'),this[_0xde3e('0x17')]['bind'](this));ami['on'](_0xde3e('0x18'),this['syncReceiveFax'][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x19'),this[_0xde3e('0x1a')]['bind'](this));ami['on'](_0xde3e('0x1b'),this[_0xde3e('0x1c')][_0xde3e('0x12')](this));}Fax[_0xde3e('0x1d')][_0xde3e('0x11')]=function(_0x228dd1){if(_0x228dd1['context']===_0xde3e('0x1e')){for(var _0x5b2a72 in this[_0xde3e('0xd')]){if(this['faxAccounts'][_0xde3e('0x1f')](_0x5b2a72)){if(_0x228dd1['exten']===this[_0xde3e('0xd')][_0x5b2a72][_0xde3e('0x20')]){this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]={};this['channels'][_0x228dd1[_0xde3e('0x21')]][_0xde3e('0x22')]=_0x228dd1['channel'];this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]['id']=this[_0xde3e('0xd')][_0x5b2a72]['id'];this['channels'][_0x228dd1['uniqueid']]['name']=this[_0xde3e('0xd')][_0x5b2a72][_0xde3e('0x23')];logger[_0xde3e('0x24')](_0x228dd1[_0xde3e('0x21')],_0xde3e('0x25'));}}}}if(this['actions'][_0x228dd1[_0xde3e('0x21')]]){this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]={};this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]['channel']=_0x228dd1[_0xde3e('0x22')];logger[_0xde3e('0x24')](_0x228dd1[_0xde3e('0x21')],_0xde3e('0x25'));}};Fax[_0xde3e('0x1d')][_0xde3e('0x26')]=function(_0x1b4f95){if(this[_0xde3e('0xc')][_0x1b4f95[_0xde3e('0x21')]]){for(var _0x41fe33 in _0x1b4f95[_0xde3e('0x27')]){if(_0x1b4f95[_0xde3e('0x27')][_0xde3e('0x1f')](_0x41fe33)){this['channels'][_0x1b4f95[_0xde3e('0x21')]][_0x41fe33]=_0x1b4f95[_0xde3e('0x28')];}}}};Fax[_0xde3e('0x1d')][_0xde3e('0x29')]=function(_0x347ae1){if(this[_0xde3e('0xc')][_0x347ae1[_0xde3e('0x21')]]){this[_0xde3e('0xc')][_0x347ae1[_0xde3e('0x21')]][_0xde3e('0x2a')]=_0x347ae1['channelstate'];this[_0xde3e('0xc')][_0x347ae1[_0xde3e('0x21')]][_0xde3e('0x2b')]=_0x347ae1[_0xde3e('0x2b')];}};Fax[_0xde3e('0x1d')][_0xde3e('0x2c')]=function(_0x187be0){if(this['channels'][_0x187be0[_0xde3e('0x21')]]){for(var _0x30c1fa in _0x187be0[_0xde3e('0x27')]){if(_0x187be0[_0xde3e('0x27')][_0xde3e('0x1f')](_0x30c1fa)){this['channels'][_0x187be0[_0xde3e('0x21')]][_0x30c1fa]=_0x187be0[_0xde3e('0x28')];}}}};Fax[_0xde3e('0x1d')]['syncFaxStatus']=function(_0x3aa19f){if(this['channels'][_0x3aa19f[_0xde3e('0x21')]]){this['channels'][_0x3aa19f[_0xde3e('0x21')]]['operation']=_0x3aa19f['operation'];this[_0xde3e('0xc')][_0x3aa19f['uniqueid']]['status']=_0x3aa19f[_0xde3e('0x2d')];this[_0xde3e('0xc')][_0x3aa19f['uniqueid']][_0xde3e('0x20')]=_0x3aa19f['localstationid'];this[_0xde3e('0xc')][_0x3aa19f['uniqueid']][_0xde3e('0x2e')]=_0x3aa19f[_0xde3e('0x2e')];logger[_0xde3e('0x24')](_0x3aa19f[_0xde3e('0x21')],_0xde3e('0x2f'));}};Fax['prototype']['syncReceiveFax']=function(_0x4ebc17){var _0x299114=this;if(this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]]){var _0x4b9682=this[_0xde3e('0xc')][_0x4ebc17['uniqueid']]['id'];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x30')]=_0x4ebc17[_0xde3e('0x30')];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]]['pagestransferred']=_0x4ebc17['pagestransferred'];this['channels'][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x20')]=_0x4ebc17[_0xde3e('0x20')];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x31')]=_0x4ebc17[_0xde3e('0x31')];this['channels'][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x32')]=_0x4ebc17[_0xde3e('0x32')];this['channels'][_0x4ebc17['uniqueid']][_0xde3e('0x2e')]=_0x4ebc17['filename'];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x33')]=_0x4ebc17[_0xde3e('0x33')];if(this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x34')]>0x0){tiff2pdf(_0x4ebc17[_0xde3e('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x1d2f3c){logger[_0xde3e('0x24')](_0x4ebc17['uniqueid'],_0xde3e('0x35'),_0x1d2f3c[_0xde3e('0x36')]);attachment[_0xde3e('0x37')]({'name':path[_0xde3e('0x38')](_0x4ebc17[_0xde3e('0x2e')])['name'],'basename':path['parse'](_0x4ebc17[_0xde3e('0x2e')])[_0xde3e('0x23')]+_0xde3e('0x39'),'type':_0xde3e('0x3a')})[_0xde3e('0x3b')](function(_0x26dd0f){faxAccount['notify'](_0x4b9682,{'from':_0x4ebc17[_0xde3e('0x33')],'mapKey':'fax','body':path[_0xde3e('0x38')](_0x4ebc17['filename'])[_0xde3e('0x23')]+_0xde3e('0x39'),'AttachmentId':_0x26dd0f['id']})[_0xde3e('0x3c')](function(_0x47b92e){logger[_0xde3e('0x3d')](_0x4ebc17[_0xde3e('0x21')],'\x20notify\x20',JSON[_0xde3e('0x3e')](_0x47b92e));});})['catch'](function(_0x60636d){logger[_0xde3e('0x3d')](_0x4ebc17['uniqueid'],_0xde3e('0x3f'),JSON['stringify'](_0x60636d));});});}logger[_0xde3e('0x24')](_0x4ebc17[_0xde3e('0x21')],_0xde3e('0x3f'));}};Fax[_0xde3e('0x1d')][_0xde3e('0x1c')]=function(_0x6fb482){if(this[_0xde3e('0xf')][_0x6fb482[_0xde3e('0x21')]]){_[_0xde3e('0x40')](this['channels'][_0x6fb482['uniqueid']],_[_0xde3e('0x41')](_0x6fb482,[_0xde3e('0x42'),_0xde3e('0x43')]));}};function updateStatus(_0x5aeb34){if(_0x5aeb34[_0xde3e('0x44')]){faxMessage['update'](_0x5aeb34[_0xde3e('0x44')],{'failMessage':_0xde3e('0x45')})['then'](function(_0x2173e4){ut[_0xde3e('0x46')]('[Fax][Message][Error][Updated]',_0x2173e4);})[_0xde3e('0x3c')](function(_0x4c9749){ut[_0xde3e('0x46')](_0xde3e('0x47'),_0x4c9749);});}else{ut[_0xde3e('0x46')](_0xde3e('0x48'));}}Fax[_0xde3e('0x1d')][_0xde3e('0x49')]=function(_0x233795,_0x186385,_0x5ed13a){var _0x4a5ae8=this;var _0x1a4140={};if(_0x186385){_0x1a4140={'read':_0x186385};}else{_0x1a4140={'failMessage':_0x5ed13a};}if(this['actions'][_0x233795][_0xde3e('0x44')]){faxMessage[_0xde3e('0x4a')](this[_0xde3e('0xf')][_0x233795]['AttachmentId'],_0x1a4140)[_0xde3e('0x3b')](function(_0x5408d9){ut[_0xde3e('0x46')](_0xde3e('0x4b'),_0x5408d9);})[_0xde3e('0x3c')](function(_0x3e8bc8){ut[_0xde3e('0x46')]('[Fax][Message][NoUpdate1]',_0x3e8bc8);})[_0xde3e('0x4c')](function(){delete _0x4a5ae8[_0xde3e('0xc')][_0x233795];delete _0x4a5ae8['actions'][_0x233795];});}else{ut['logger'](_0xde3e('0x4d'));delete this[_0xde3e('0xc')][_0x233795];delete this['actions'][_0x233795];}};Fax['prototype'][_0xde3e('0x1a')]=function(_0x287bf5){var _0x2d2ad2=this;if(this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]]){if(this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]){this['channels'][_0x287bf5[_0xde3e('0x21')]]['id']=this[_0xde3e('0xf')][_0x287bf5['uniqueid']]['id'];this['channels'][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x23')]=this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]['name'];}logger['info'](_0x287bf5[_0xde3e('0x21')],this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]?_0xde3e('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0xde3e('0x3e')](this['channels'][_0x287bf5[_0xde3e('0x21')]]));if(this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]){if(this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x4f')]>0x0&&this[_0xde3e('0xc')][_0x287bf5['uniqueid']][_0xde3e('0x16')]===_0xde3e('0x50')){this[_0xde3e('0x49')](_0x287bf5[_0xde3e('0x21')],!![]);}else{this[_0xde3e('0x49')](_0x287bf5[_0xde3e('0x21')],![],this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x51')]?'SENDING\x20FAILED:\x20'+this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x51')]:_0xde3e('0x52'));}}}};Fax['prototype'][_0xde3e('0x53')]=function(_0xf8c5e9){var _0x457607=this;return new BPromise(function(_0x405c2b,_0x2436e6){_0x457607[_0xde3e('0x54')](_0xf8c5e9,_0x457607[_0xde3e('0xd')][_0xf8c5e9[_0xde3e('0x55')]])[_0xde3e('0x3b')](function(_0x1a6ecd){ut[_0xde3e('0x46')](_0xde3e('0x56'),_0x1a6ecd);_0x405c2b(ut[_0xde3e('0x36')](_0xde3e('0x57')));})['catch'](function(_0xfe3441){ut[_0xde3e('0x46')](_0xde3e('0x58'),_0xfe3441);updateStatus(_0xf8c5e9);_0x2436e6(ut[_0xde3e('0x36')](_0xde3e('0x59')));});});};Fax['prototype'][_0xde3e('0x5a')]=function(_0xe8e060){var _0x14d84b=this;return new BPromise(function(_0x54978a,_0x3f0956){var _0x1d8a47=_0x14d84b['checkTrunk'](_0x14d84b[_0xde3e('0xd')][_0xe8e060[_0xde3e('0x55')]][_0xde3e('0x5b')],_0xe8e060);if(_0x1d8a47[_0xde3e('0x5c')]){_0x54978a(ut['message']('Trunk\x20Reachable'));}else{_0x3f0956(ut[_0xde3e('0x36')](_0x1d8a47['message']));}});};function originate(_0x3b40a4,_0x37f569,_0x1d550e){return new BPromise(function(_0x1884a6,_0x42da41){if(_0x1d550e){var _0x480ee3=util[_0xde3e('0x5d')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xde3e('0x38')](_0x3b40a4[_0xde3e('0x5e')])['name'],_0x3b40a4[_0xde3e('0x5e')]);gs[_0xde3e('0x5f')](_0x480ee3)[_0xde3e('0x3b')](function(){_0x3b40a4[_0xde3e('0x5e')]=util[_0xde3e('0x5d')](_0xde3e('0x60'),path['parse'](_0x3b40a4[_0xde3e('0x5e')])[_0xde3e('0x61')],path['parse'](_0x3b40a4['path'])[_0xde3e('0x23')]);_0x37f569[_0xde3e('0x62')]=_0x3b40a4[_0xde3e('0x5e')];ut[_0xde3e('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0xde3e('0x63')](ut['variablesAction'](_0x3b40a4,_0x37f569))[_0xde3e('0x3b')](function(_0x10e786){_0x1884a6(_0x10e786);})[_0xde3e('0x3c')](function(_0xd52bfe){_0x42da41(_0xd52bfe);});})[_0xde3e('0x3c')](function(_0x143760){_0x42da41(_0x143760);});}else{ami[_0xde3e('0x63')](ut[_0xde3e('0x64')](_0x3b40a4,_0x37f569))['then'](function(_0x117b6a){_0x1884a6(_0x117b6a);})[_0xde3e('0x3c')](function(_0xe28897){_0x42da41(_0xe28897);});}});}Fax[_0xde3e('0x1d')][_0xde3e('0x54')]=function(_0x18fe77,_0x2a42ed){var _0xa89255=this;return new BPromise(function(_0x1582d6,_0x157dbb){var _0x230c68=uuid['v4']();var _0x7e8c46=ut[_0xde3e('0x65')](_0x18fe77,_0x2a42ed);_0xa89255[_0xde3e('0xf')][_0x230c68]=new Action(_0x230c68,_0x2a42ed,_0x18fe77);var _0x2b26fa=_0xa89255[_0xde3e('0xf')][_0x230c68];if(path[_0xde3e('0x38')](_0x18fe77['path'])[_0xde3e('0x66')]==='.pdf'){originate(_0x2b26fa,_0x7e8c46,!![])['then'](function(_0x4e745b){_0x1582d6(_0x4e745b);})[_0xde3e('0x3c')](function(_0x1dc00a){_0x157dbb(_0x1dc00a);});}else{originate(_0x2b26fa,_0x7e8c46,![])[_0xde3e('0x3b')](function(_0x236f06){_0x1582d6(_0x236f06);})['catch'](function(_0x5a3972){_0x157dbb(_0x5a3972);});}});};Fax[_0xde3e('0x1d')][_0xde3e('0x67')]=function(_0x5c22cf){return!_[_0xde3e('0x68')](_0x5c22cf)&&!_[_0xde3e('0x68')](_0x5c22cf[_0xde3e('0x23')])&&!_[_0xde3e('0x68')](_0x5c22cf[_0xde3e('0x69')])&&_0x5c22cf[_0xde3e('0x69')]&&!_['isNil'](this[_0xde3e('0xe')][util[_0xde3e('0x5d')](_0xde3e('0x6a'),_0x5c22cf[_0xde3e('0x23')])])&&!_[_0xde3e('0x68')](this[_0xde3e('0xe')][util[_0xde3e('0x5d')](_0xde3e('0x6a'),_0x5c22cf[_0xde3e('0x23')])][_0xde3e('0x2d')])&&(this['trunks'][util['format']('SIP/%s',_0x5c22cf['name'])][_0xde3e('0x2d')]===_0xde3e('0x6b')||this[_0xde3e('0xe')][util['format']('SIP/%s',_0x5c22cf['name'])]['status']===_0xde3e('0x6c'));};Fax[_0xde3e('0x1d')][_0xde3e('0x6d')]=function(_0x24eea5,_0x2ad7eb){if(!this[_0xde3e('0x67')](_0x24eea5)){ut['logger'](_0xde3e('0x6e'),_['isNil'](_0x24eea5)?'':_0x24eea5[_0xde3e('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xde3e('0x68')](_0x2ad7eb[_0xde3e('0x6')])){ut[_0xde3e('0x46')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xde3e('0x3e')](_0x2ad7eb));return{'isValid':![],'message':_0xde3e('0x6f')};}if(_[_0xde3e('0x68')](_0x2ad7eb[_0xde3e('0x5e')])){ut[_0xde3e('0x46')](_0xde3e('0x70'),JSON[_0xde3e('0x3e')](_0x2ad7eb));return{'isValid':![],'message':_0xde3e('0x71')};}return{'isValid':!![],'message':_0xde3e('0x72')};};module[_0xde3e('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 2f2c2f4..b8972f8 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 _0xf1a4=['resolve','catch','[Notify]\x20','lodash','error','inspect','notify'];(function(_0x4712ce,_0x55e33d){var _0x4d33ec=function(_0x25e1a2){while(--_0x25e1a2){_0x4712ce['push'](_0x4712ce['shift']());}};_0x4d33ec(++_0x55e33d);}(_0xf1a4,0x18b));var _0x4f1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1a4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x4f1a('0x0'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2826ef){return function(_0x34df01){logger[_0x4f1a('0x1')](_0x2826ef,util[_0x4f1a('0x2')](_0x34df01,{'showHidden':![],'depth':null}));};}exports[_0x4f1a('0x3')]=function(_0x16d747,_0x13b21c){return BPromise[_0x4f1a('0x4')]()['then'](faxAccount[_0x4f1a('0x3')](_0x16d747,_0x13b21c))[_0x4f1a('0x5')](loggerCatch(_0x4f1a('0x6')));}; \ No newline at end of file +var _0x69eb=['notify','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger','lodash','error'];(function(_0x236a16,_0x1c007a){var _0x12121e=function(_0x4ad913){while(--_0x4ad913){_0x236a16['push'](_0x236a16['shift']());}};_0x12121e(++_0x1c007a);}(_0x69eb,0xa7));var _0xb69e=function(_0x20747d,_0x13867b){_0x20747d=_0x20747d-0x0;var _0x349e36=_0x69eb[_0x20747d];return _0x349e36;};'use strict';var util=require('util');var BPromise=require(_0xb69e('0x0'));var logger=require(_0xb69e('0x1'))('preview');var _=require(_0xb69e('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1546ef){return function(_0x1dcf97){logger[_0xb69e('0x3')](_0x1546ef,util['inspect'](_0x1dcf97,{'showHidden':![],'depth':null}));};}exports[_0xb69e('0x4')]=function(_0x51cf24,_0x349d3f){return BPromise[_0xb69e('0x5')]()[_0xb69e('0x6')](faxAccount[_0xb69e('0x4')](_0x51cf24,_0x349d3f))[_0xb69e('0x7')](loggerCatch(_0xb69e('0x8')));}; \ 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 0383f3c..4e112ac 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 _0x4197=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','info','Exec\x20gs'];(function(_0x4ca516,_0x34ed3a){var _0x41dd6f=function(_0x1a3cb2){while(--_0x1a3cb2){_0x4ca516['push'](_0x4ca516['shift']());}};_0x41dd6f(++_0x34ed3a);}(_0x4197,0xbf));var _0x7419=function(_0x5336c8,_0x40c5c1){_0x5336c8=_0x5336c8-0x0;var _0x5b743b=_0x4197[_0x5336c8];return _0x5b743b;};'use strict';var util=require(_0x7419('0x0'));var logger=require(_0x7419('0x1'))(_0x7419('0x2'));var BPromise=require(_0x7419('0x3'));var exec=require(_0x7419('0x4'))['exec'];exports['execute']=function(_0xc9bfc9){return new BPromise(function(_0x48833f,_0x5a4f51){exec(_0xc9bfc9,function(_0x343316,_0x1ec61b,_0x39504f){logger[_0x7419('0x5')]('Exec\x20gs',_0x1ec61b);if(_0x343316){logger[_0x7419('0x5')](_0x7419('0x6'),_0x7419('0x7'),util[_0x7419('0x8')](_0x343316,{'showHidden':![],'depth':null}),_0x1ec61b,_0x39504f);_0x5a4f51(_0x343316);}_0x48833f(_0x1ec61b);});});}; \ No newline at end of file +var _0xa924=['Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','bluebird','info'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa924,0x105));var _0x4a92=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa924[_0x2112d4];return _0x434972;};'use strict';var util=require('util');var logger=require(_0x4a92('0x0'))('fax');var BPromise=require(_0x4a92('0x1'));var exec=require('child_process')['exec'];exports['execute']=function(_0x1e3553){return new BPromise(function(_0x1d3200,_0x3f494f){exec(_0x1e3553,function(_0x327e0f,_0x207b76,_0x300346){logger[_0x4a92('0x2')](_0x4a92('0x3'),_0x207b76);if(_0x327e0f){logger[_0x4a92('0x2')](_0x4a92('0x3'),_0x4a92('0x4'),util[_0x4a92('0x5')](_0x327e0f,{'showHidden':![],'depth':null}),_0x207b76,_0x300346);_0x3f494f(_0x327e0f);}_0x1d3200(_0x207b76);});});}; \ 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 f592e7b..d616884 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 _0x82f2=['faxdetect','t38timeout','variablesAction','originate','channel','xcally-motion-fax','format','headerinfo','localstationid','uniqueid','lodash','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','minrate','maxrate','\x22%s\x22','modem','gateway'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0x82f2,0x163));var _0x282f=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x82f2[_0x12fc8d];return _0x3f9d04;};'use strict';var util=require('util');var _=require(_0x282f('0x0'));var moment=require('moment');var logger=require(_0x282f('0x1'))(_0x282f('0x2'));exports[_0x282f('0x3')]=function(_0x47b210){return{'message':_0x47b210};};exports['logger']=function(_0x1359da,_0x2b037e){logger[_0x282f('0x4')](_0x1359da,util[_0x282f('0x5')](_0x2b037e,{'showHidden':![],'depth':null}));};exports[_0x282f('0x6')]=function(_0x166fd3,_0x7ff7e6){var _0xdd5841={'XMF-ECM':_0x7ff7e6[_0x282f('0x7')],'XMF-HEADERINFO':_0x7ff7e6['headerinfo'],'XMF-MINRATE':_0x7ff7e6[_0x282f('0x8')],'XMF-MAXRATE':_0x7ff7e6[_0x282f('0x9')],'XMF-MODEM':util['format'](_0x282f('0xa'),_0x7ff7e6[_0x282f('0xb')]),'XMF-GATEWAY':_0x7ff7e6[_0x282f('0xc')],'XMF-FAXDETECT':_0x7ff7e6[_0x282f('0xd')],'XMF-T38TIMEOUT':_0x7ff7e6[_0x282f('0xe')],'XMF-LOCALSTATIONID':_0x7ff7e6['localstationid'],'XMF-PATH':_0x166fd3['path']};return _0xdd5841;};exports[_0x282f('0xf')]=function(_0x2b3f91,_0x10a9f7){return{'actionid':_0x2b3f91['uniqueid'],'action':_0x282f('0x10'),'channel':_0x2b3f91[_0x282f('0x11')],'Exten':_0x282f('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0x282f('0x13')]('\x22%s\x22\x20<%s>',_0x2b3f91[_0x282f('0x14')]?_0x2b3f91['headerinfo']:'',_0x2b3f91[_0x282f('0x15')]),'variable':_0x10a9f7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2b3f91[_0x282f('0x16')]};}; \ No newline at end of file +var _0x309d=['localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout'];(function(_0x197783,_0x32f814){var _0x55caba=function(_0x12780e){while(--_0x12780e){_0x197783['push'](_0x197783['shift']());}};_0x55caba(++_0x32f814);}(_0x309d,0x1e5));var _0xd309=function(_0x3257f7,_0x49eec1){_0x3257f7=_0x3257f7-0x0;var _0x482883=_0x309d[_0x3257f7];return _0x482883;};'use strict';var util=require('util');var _=require(_0xd309('0x0'));var moment=require(_0xd309('0x1'));var logger=require(_0xd309('0x2'))('fax');exports['message']=function(_0x402199){return{'message':_0x402199};};exports[_0xd309('0x3')]=function(_0x13b06e,_0x18e858){logger['info'](_0x13b06e,util[_0xd309('0x4')](_0x18e858,{'showHidden':![],'depth':null}));};exports[_0xd309('0x5')]=function(_0x40f0ba,_0x2cf2fc){var _0x38d58a={'XMF-ECM':_0x2cf2fc[_0xd309('0x6')],'XMF-HEADERINFO':_0x2cf2fc[_0xd309('0x7')],'XMF-MINRATE':_0x2cf2fc[_0xd309('0x8')],'XMF-MAXRATE':_0x2cf2fc[_0xd309('0x9')],'XMF-MODEM':util['format'](_0xd309('0xa'),_0x2cf2fc[_0xd309('0xb')]),'XMF-GATEWAY':_0x2cf2fc[_0xd309('0xc')],'XMF-FAXDETECT':_0x2cf2fc[_0xd309('0xd')],'XMF-T38TIMEOUT':_0x2cf2fc[_0xd309('0xe')],'XMF-LOCALSTATIONID':_0x2cf2fc[_0xd309('0xf')],'XMF-PATH':_0x40f0ba[_0xd309('0x10')]};return _0x38d58a;};exports[_0xd309('0x11')]=function(_0x127832,_0x5aa477){return{'actionid':_0x127832[_0xd309('0x12')],'action':_0xd309('0x13'),'channel':_0x127832[_0xd309('0x14')],'Exten':_0xd309('0x15'),'Context':_0xd309('0x16'),'Priority':'1','callerid':util[_0xd309('0x17')](_0xd309('0x18'),_0x127832[_0xd309('0x7')]?_0x127832[_0xd309('0x7')]:'',_0x127832[_0xd309('0xf')]),'variable':_0x5aa477,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x127832['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index bae5a61..aaf4ee2 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 _0x8ab9=['getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','util','moment','./server','./acw','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts'];(function(_0x14d382,_0x54b6bd){var _0x31c6a7=function(_0xc9bb74){while(--_0xc9bb74){_0x14d382['push'](_0x14d382['shift']());}};_0x31c6a7(++_0x54b6bd);}(_0x8ab9,0x92));var _0x98ab=function(_0x751c33,_0x2031fe){_0x751c33=_0x751c33-0x0;var _0x4652f9=_0x8ab9[_0x751c33];return _0x4652f9;};'use strict';var util=require(_0x98ab('0x0'));var moment=require(_0x98ab('0x1'));var server=require(_0x98ab('0x2'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x98ab('0x3'));var Trigger=require(_0x98ab('0x4'));var Dialer=require(_0x98ab('0x5'));var Preview=require('./preview');var Fax=require(_0x98ab('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0x98ab('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x98ab('0x8'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x98ab('0x9'));var cmHopperHistory=require(_0x98ab('0xa'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x98ab('0xb'));var faxAccount=require(_0x98ab('0xc'));var zendesk=require(_0x98ab('0xd'));var salesforce=require(_0x98ab('0xe'));var sugarcrm=require(_0x98ab('0xf'));var freshdesk=require(_0x98ab('0x10'));var desk=require(_0x98ab('0x11'));var zoho=require(_0x98ab('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x98ab('0x13'));var servicenow=require(_0x98ab('0x14'));var dynamics365=require(_0x98ab('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(_0x98ab('0x16'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x98ab('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x98ab('0x18')](_0x98ab('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x98ab('0x19')]()[_0x98ab('0x1a')](user[_0x98ab('0x1b')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x1c')]())[_0x98ab('0x1a')](user[_0x98ab('0x1d')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x1e')]())[_0x98ab('0x1a')](trunk[_0x98ab('0x1f')]())[_0x98ab('0x1a')](realtime['initTrunks']())['then'](voiceQueue['getVoiceQueues']())[_0x98ab('0x1a')](realtime[_0x98ab('0x20')]())[_0x98ab('0x1a')](trigger['getTriggers']())[_0x98ab('0x1a')](realtime[_0x98ab('0x21')]())[_0x98ab('0x1a')](template['getTemplates']())[_0x98ab('0x1a')](realtime[_0x98ab('0x22')]())[_0x98ab('0x1a')](zendesk[_0x98ab('0x23')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x24')]())['then'](salesforce['getSalesforceAccounts']())['then'](realtime[_0x98ab('0x25')]())['then'](sugarcrm[_0x98ab('0x26')]())['then'](realtime['initSugarcrmAccounts']())[_0x98ab('0x1a')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x98ab('0x27')]())[_0x98ab('0x1a')](desk[_0x98ab('0x28')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x29')]())[_0x98ab('0x1a')](zoho[_0x98ab('0x2a')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x2b')]())[_0x98ab('0x1a')](vtiger['getVtigerAccounts']())['then'](realtime[_0x98ab('0x2c')]())['then'](freshsales[_0x98ab('0x2d')]())[_0x98ab('0x1a')](realtime['initFreshsalesAccounts']())[_0x98ab('0x1a')](servicenow['getServicenowAccounts']())[_0x98ab('0x1a')](realtime['initServicenowAccounts']())[_0x98ab('0x1a')](dynamics365['getDynamics365Accounts']())[_0x98ab('0x1a')](realtime['initDynamics365Accounts']())[_0x98ab('0x1a')](campaign[_0x98ab('0x2e')]())['then'](realtime[_0x98ab('0x2f')]())['then'](voiceExtension[_0x98ab('0x30')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x31')]())[_0x98ab('0x1a')](faxAccount[_0x98ab('0x32')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x33')]())[_0x98ab('0x1a')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x98ab('0x1a')](voiceQueueReport[_0x98ab('0x34')]())[_0x98ab('0x1a')](realtime['initVoiceQueueReports']())[_0x98ab('0x1a')](cmHopperHistory[_0x98ab('0x35')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x36')]())[_0x98ab('0x1a')](cmHopperHistory[_0x98ab('0x37')]())[_0x98ab('0x1a')](realtime[_0x98ab('0x38')]())[_0x98ab('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x98ab('0x1a')](realtime['initVoiceCallReports']())[_0x98ab('0x39')](function(_0x292f2c){logger['error'](_0x98ab('0x3a'),util[_0x98ab('0x3b')](_0x292f2c,{'showHidden':![],'depth':null}));});}function main(){return server[_0x98ab('0x3c')](realtime,preview,fax)[_0x98ab('0x1a')](function(){return initRealtime();})[_0x98ab('0x1a')](function(){return initParams();})[_0x98ab('0x1a')](function(){report[_0x98ab('0x3d')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x32a553){logger[_0x98ab('0x3e')](_0x98ab('0x3f'),util['inspect'](_0x32a553,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x8c67=['getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initCampaigns','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','sync','inspect','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts'];(function(_0x171fce,_0x10c9db){var _0x1a5554=function(_0x487bfd){while(--_0x487bfd){_0x171fce['push'](_0x171fce['shift']());}};_0x1a5554(++_0x10c9db);}(_0x8c67,0xd2));var _0x78c6=function(_0x4962ca,_0x583983){_0x4962ca=_0x4962ca-0x0;var _0x480654=_0x8c67[_0x4962ca];return _0x480654;};'use strict';var util=require('util');var moment=require(_0x78c6('0x0'));var server=require(_0x78c6('0x1'));var Realtime=require(_0x78c6('0x2'));var Report=require(_0x78c6('0x3'));var Acw=require(_0x78c6('0x4'));var Trigger=require(_0x78c6('0x5'));var Dialer=require(_0x78c6('0x6'));var Preview=require(_0x78c6('0x7'));var Fax=require('./fax');var user=require(_0x78c6('0x8'));var voiceQueue=require(_0x78c6('0x9'));var voiceQueueReport=require(_0x78c6('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x78c6('0xb'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x78c6('0xc'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x78c6('0xd'));var freshdesk=require(_0x78c6('0xe'));var desk=require(_0x78c6('0xf'));var zoho=require(_0x78c6('0x10'));var vtiger=require(_0x78c6('0x11'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x78c6('0x12'));var dynamics365=require(_0x78c6('0x13'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x78c6('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x78c6('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x78c6('0x16')](_0x78c6('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x78c6('0x17')]()[_0x78c6('0x18')](user[_0x78c6('0x19')]())[_0x78c6('0x18')](realtime[_0x78c6('0x1a')]())['then'](user[_0x78c6('0x1b')]())['then'](realtime[_0x78c6('0x1c')]())[_0x78c6('0x18')](trunk['getTrunks']())[_0x78c6('0x18')](realtime[_0x78c6('0x1d')]())[_0x78c6('0x18')](voiceQueue[_0x78c6('0x1e')]())[_0x78c6('0x18')](realtime[_0x78c6('0x1f')]())[_0x78c6('0x18')](trigger[_0x78c6('0x20')]())[_0x78c6('0x18')](realtime[_0x78c6('0x21')]())['then'](template['getTemplates']())[_0x78c6('0x18')](realtime[_0x78c6('0x22')]())[_0x78c6('0x18')](zendesk[_0x78c6('0x23')]())[_0x78c6('0x18')](realtime[_0x78c6('0x24')]())[_0x78c6('0x18')](salesforce[_0x78c6('0x25')]())[_0x78c6('0x18')](realtime[_0x78c6('0x26')]())[_0x78c6('0x18')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0x78c6('0x27')]())[_0x78c6('0x18')](freshdesk[_0x78c6('0x28')]())[_0x78c6('0x18')](realtime[_0x78c6('0x29')]())['then'](desk[_0x78c6('0x2a')]())[_0x78c6('0x18')](realtime[_0x78c6('0x2b')]())[_0x78c6('0x18')](zoho[_0x78c6('0x2c')]())[_0x78c6('0x18')](realtime[_0x78c6('0x2d')]())[_0x78c6('0x18')](vtiger[_0x78c6('0x2e')]())['then'](realtime[_0x78c6('0x2f')]())[_0x78c6('0x18')](freshsales['getFreshsalesAccounts']())[_0x78c6('0x18')](realtime['initFreshsalesAccounts']())[_0x78c6('0x18')](servicenow[_0x78c6('0x30')]())[_0x78c6('0x18')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x78c6('0x31')]())['then'](realtime['initDynamics365Accounts']())[_0x78c6('0x18')](campaign['getCampaigns']())['then'](realtime[_0x78c6('0x32')]())['then'](voiceExtension['getVoiceExtensions']())[_0x78c6('0x18')](realtime['initVoiceExtensions']())[_0x78c6('0x18')](faxAccount[_0x78c6('0x33')]())['then'](realtime[_0x78c6('0x34')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x78c6('0x17')]()[_0x78c6('0x18')](voiceQueueReport[_0x78c6('0x35')]())[_0x78c6('0x18')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x78c6('0x36')]())[_0x78c6('0x18')](realtime[_0x78c6('0x37')]())[_0x78c6('0x18')](cmHopperHistory[_0x78c6('0x38')]())[_0x78c6('0x18')](realtime[_0x78c6('0x39')]())[_0x78c6('0x18')](voiceCallReport[_0x78c6('0x3a')]())[_0x78c6('0x18')](realtime['initVoiceCallReports']())[_0x78c6('0x3b')](function(_0x20b9a6){logger[_0x78c6('0x3c')]('[index.js][initParams]',util['inspect'](_0x20b9a6,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x78c6('0x18')](function(){return initRealtime();})[_0x78c6('0x18')](function(){return initParams();})[_0x78c6('0x18')](function(){report[_0x78c6('0x3d')]();setInterval(initRealtime,0x1388);})[_0x78c6('0x3b')](function(_0x2880b0){logger[_0x78c6('0x3c')]('[index.js][main]',util[_0x78c6('0x3e')](_0x2880b0,{'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 ca4a4de..8c300a9 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 _0x17a8=['statePause','toNumber','format','accountcode','status','address','interface','user:%s','emit','user:ami:update','omit','util','moment','md5','redis','defaults','socket.io-emitter','name','email','fullname','state','unknown','stateTime','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking'];(function(_0x27787d,_0x3c832a){var _0x2ec19c=function(_0x1d7c49){while(--_0x1d7c49){_0x27787d['push'](_0x27787d['shift']());}};_0x2ec19c(++_0x3c832a);}(_0x17a8,0x10e));var _0x817a=function(_0x3e6188,_0xd8d390){_0x3e6188=_0x3e6188-0x0;var _0x47bfe6=_0x17a8[_0x3e6188];return _0x47bfe6;};'use strict';var _=require('lodash');var util=require(_0x817a('0x0'));var moment=require(_0x817a('0x1'));var md5=require(_0x817a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x817a('0x3')]=_[_0x817a('0x4')](config[_0x817a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x817a('0x5'))(new Redis(config[_0x817a('0x3')]));function Agent(_0x383869){this['id']=_0x383869['id']||0x0;this[_0x817a('0x6')]=_0x383869[_0x817a('0x6')]||'';this[_0x817a('0x7')]=_0x383869[_0x817a('0x7')]||'';this['accountcode']=_0x383869['accountcode']||'';this[_0x817a('0x8')]=_0x383869[_0x817a('0x8')]||'';this[_0x817a('0x9')]=_0x817a('0xa');this[_0x817a('0xb')]=0x0;this['status']='unknown';this['address']='';this['phone']='';this[_0x817a('0xc')]='';this['interface']='';this[_0x817a('0xd')]=_0x383869[_0x817a('0xd')]||![];this[_0x817a('0xe')]=_0x817a('0xa');this[_0x817a('0xf')]=0x0;this[_0x817a('0x10')]='';this[_0x817a('0x11')]='';this[_0x817a('0x12')]=![];this[_0x817a('0x13')]=![];this['md5']='';}Agent[_0x817a('0x14')][_0x817a('0x15')]=function(_0x275980){var _0x2d8549;if(_0x275980&&_0x275980[_0x817a('0x9')]){_0x2d8549=_0x275980[_0x817a('0x9')][_0x817a('0x16')]();switch(_0x2d8549){case _0x817a('0x17'):_0x2d8549=_0x817a('0x18');break;case'inuse':_0x2d8549=_0x817a('0x19');break;}}if(_0x2d8549&&this[_0x817a('0xe')]!==_0x2d8549||_0x275980[_0x817a('0x1a')]){this['voiceStatusTime']=_[_0x817a('0x1b')](moment()[_0x817a('0x1c')]('x'));}if(_0x2d8549){this[_0x817a('0xe')]=_0x2d8549;}var _0x25331a={'id':this['id'],'name':this[_0x817a('0x6')],'email':this[_0x817a('0x7')],'accountcode':this[_0x817a('0x1d')],'fullname':this[_0x817a('0x8')],'state':this[_0x817a('0x9')],'stateTime':this[_0x817a('0xb')],'status':this[_0x817a('0x1e')],'address':this[_0x817a('0x1f')],'online':this[_0x817a('0xd')],'voiceStatus':this[_0x817a('0xe')],'voiceStatusTime':this[_0x817a('0xf')],'voiceStatusCallerIdNumber':this[_0x817a('0x10')],'voiceStatusQueue':this[_0x817a('0x11')],'interface':this[_0x817a('0x20')],'onhold':this[_0x817a('0x12')]};var _0x266475=md5(JSON['stringify'](_0x25331a));if(this[_0x817a('0x2')]!==_0x266475){this[_0x817a('0x2')]=_0x266475;io['to'](util['format'](_0x817a('0x21'),_0x25331a['name']))[_0x817a('0x22')](_0x817a('0x23'),_[_0x817a('0x24')](_0x25331a,[_0x817a('0xd')]));io[_0x817a('0x22')]('user:presence',_0x25331a);}};module['exports']=Agent; \ No newline at end of file +var _0x59b7=['stateTime','stringify','format','user:%s','user:ami:update','omit','user:presence','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','email','fullname','state','unknown','status','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','updateStatusRealtime','toLowerCase','inuse','talking','toNumber','voiceStatus','name','accountcode'];(function(_0x1f5176,_0x3f1313){var _0x234647=function(_0x8c4445){while(--_0x8c4445){_0x1f5176['push'](_0x1f5176['shift']());}};_0x234647(++_0x3f1313);}(_0x59b7,0xc5));var _0x759b=function(_0x1e3e52,_0x30ecda){_0x1e3e52=_0x1e3e52-0x0;var _0xfe2e49=_0x59b7[_0x1e3e52];return _0xfe2e49;};'use strict';var _=require(_0x759b('0x0'));var util=require(_0x759b('0x1'));var moment=require(_0x759b('0x2'));var md5=require(_0x759b('0x3'));var Redis=require(_0x759b('0x4'));var config=require(_0x759b('0x5'));config[_0x759b('0x6')]=_[_0x759b('0x7')](config[_0x759b('0x6')],{'host':_0x759b('0x8'),'port':0x18eb});var io=require(_0x759b('0x9'))(new Redis(config['redis']));function Agent(_0x15c36c){this['id']=_0x15c36c['id']||0x0;this['name']=_0x15c36c['name']||'';this[_0x759b('0xa')]=_0x15c36c[_0x759b('0xa')]||'';this['accountcode']=_0x15c36c['accountcode']||'';this['fullname']=_0x15c36c[_0x759b('0xb')]||'';this[_0x759b('0xc')]=_0x759b('0xd');this['stateTime']=0x0;this[_0x759b('0xe')]='unknown';this[_0x759b('0xf')]='';this[_0x759b('0x10')]='';this[_0x759b('0x11')]='';this[_0x759b('0x12')]='';this[_0x759b('0x13')]=_0x15c36c[_0x759b('0x13')]||![];this['voiceStatus']='unknown';this[_0x759b('0x14')]=0x0;this[_0x759b('0x15')]='';this[_0x759b('0x16')]='';this['onhold']=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x759b('0x17')]=function(_0x49d39b){var _0x196776;if(_0x49d39b&&_0x49d39b['state']){_0x196776=_0x49d39b[_0x759b('0xc')][_0x759b('0x18')]();switch(_0x196776){case'not_inuse':_0x196776='idle';break;case _0x759b('0x19'):_0x196776=_0x759b('0x1a');break;}}if(_0x196776&&this['voiceStatus']!==_0x196776||_0x49d39b['statePause']){this[_0x759b('0x14')]=_[_0x759b('0x1b')](moment()['format']('x'));}if(_0x196776){this[_0x759b('0x1c')]=_0x196776;}var _0x87b37={'id':this['id'],'name':this[_0x759b('0x1d')],'email':this['email'],'accountcode':this[_0x759b('0x1e')],'fullname':this[_0x759b('0xb')],'state':this[_0x759b('0xc')],'stateTime':this[_0x759b('0x1f')],'status':this[_0x759b('0xe')],'address':this['address'],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x759b('0x15')],'voiceStatusQueue':this[_0x759b('0x16')],'interface':this[_0x759b('0x12')],'onhold':this['onhold']};var _0x4075a5=md5(JSON[_0x759b('0x20')](_0x87b37));if(this[_0x759b('0x3')]!==_0x4075a5){this[_0x759b('0x3')]=_0x4075a5;io['to'](util[_0x759b('0x21')](_0x759b('0x22'),_0x87b37[_0x759b('0x1d')]))['emit'](_0x759b('0x23'),_[_0x759b('0x24')](_0x87b37,[_0x759b('0x13')]));io['emit'](_0x759b('0x25'),_0x87b37);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index a0f220a..e69cfaa 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 _0x3b2d=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x227703,_0x45968b){var _0x4796ad=function(_0x1d306c){while(--_0x1d306c){_0x227703['push'](_0x227703['shift']());}};_0x4796ad(++_0x45968b);}(_0x3b2d,0x1c1));var _0xd3b2=function(_0x571c21,_0x2f9f7e){_0x571c21=_0x571c21-0x0;var _0x39e526=_0x3b2d[_0x571c21];return _0x39e526;};'use strict';function Campaign(_0x36d681){this['id']=_0x36d681['id']||0x0;this[_0xd3b2('0x0')]=_0x36d681[_0xd3b2('0x0')]||'';this[_0xd3b2('0x1')]=_0x36d681['type']||'campaign';this[_0xd3b2('0x2')]=0x0;this[_0xd3b2('0x3')]=0x0;this[_0xd3b2('0x4')]=0x0;this[_0xd3b2('0x5')]=0x0;this[_0xd3b2('0x6')]='';this[_0xd3b2('0x7')]=!![];this['active']=_0x36d681[_0xd3b2('0x8')];this[_0xd3b2('0x9')]=_0x36d681[_0xd3b2('0x9')];this['dialTimezone']=_0x36d681[_0xd3b2('0xa')]||null;this[_0xd3b2('0xb')]=_0x36d681[_0xd3b2('0xb')]?_0x36d681[_0xd3b2('0xb')]:null;this[_0xd3b2('0xc')]=_0x36d681[_0xd3b2('0xc')];this[_0xd3b2('0xd')]=_0x36d681[_0xd3b2('0xd')];this[_0xd3b2('0xe')]=_0x36d681[_0xd3b2('0xe')]||0x1e;this[_0xd3b2('0xf')]=_0x36d681[_0xd3b2('0xf')];this[_0xd3b2('0x10')]=_0x36d681['dialCongestionRetryFrequency'];this[_0xd3b2('0x11')]=_0x36d681[_0xd3b2('0x11')];this[_0xd3b2('0x12')]=_0x36d681[_0xd3b2('0x12')];this['dialNoAnswerMaxRetry']=_0x36d681['dialNoAnswerMaxRetry'];this[_0xd3b2('0x13')]=_0x36d681[_0xd3b2('0x13')];this['dialGlobalMaxRetry']=_0x36d681[_0xd3b2('0x14')];this['dialNoSuchNumberMaxRetry']=_0x36d681['dialNoSuchNumberMaxRetry']||0x3;this[_0xd3b2('0x15')]=_0x36d681[_0xd3b2('0x15')]||0x96;this[_0xd3b2('0x16')]=_0x36d681[_0xd3b2('0x16')]||0x3;this[_0xd3b2('0x17')]=_0x36d681[_0xd3b2('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x36d681[_0xd3b2('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x36d681[_0xd3b2('0x19')]||0x96;this[_0xd3b2('0x1a')]=_0x36d681[_0xd3b2('0x1a')]||0x3;this[_0xd3b2('0x1b')]=_0x36d681[_0xd3b2('0x1b')]||0x96;this[_0xd3b2('0x1c')]=_0x36d681[_0xd3b2('0x1c')]||0x3;this[_0xd3b2('0x1d')]=_0x36d681[_0xd3b2('0x1d')]||0x96;this[_0xd3b2('0x1e')]=_0x36d681[_0xd3b2('0x1e')]||'DESC';this[_0xd3b2('0x1f')]=_0x36d681[_0xd3b2('0x1f')]||undefined;this[_0xd3b2('0x20')]=_0x36d681[_0xd3b2('0x20')]||undefined;this[_0xd3b2('0x21')]=_0x36d681['dialCutDigit']||undefined;this[_0xd3b2('0x22')]=_0x36d681[_0xd3b2('0x22')]?_0x36d681['TrunkBackup']:undefined;this[_0xd3b2('0x23')]=_0x36d681[_0xd3b2('0x23')]?_0x36d681[_0xd3b2('0x23')]:undefined;this['Interval']=_0x36d681[_0xd3b2('0x24')]?_0x36d681[_0xd3b2('0x24')]:undefined;this[_0xd3b2('0x25')]=_0x36d681[_0xd3b2('0x25')]?_0x36d681[_0xd3b2('0x25')]:undefined;this[_0xd3b2('0x26')]=_0x36d681[_0xd3b2('0x25')]?_0x36d681['SquareProject'][_0xd3b2('0x0')]:undefined;this[_0xd3b2('0x27')]=_0x36d681[_0xd3b2('0x27')]||![];this[_0xd3b2('0x28')]=_0x36d681['dialAMDInitialSilence'];this[_0xd3b2('0x29')]=_0x36d681[_0xd3b2('0x29')];this['dialAMDAfterGreetingSilence']=_0x36d681[_0xd3b2('0x2a')];this[_0xd3b2('0x2b')]=_0x36d681[_0xd3b2('0x2b')];this[_0xd3b2('0x2c')]=_0x36d681['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x36d681[_0xd3b2('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x36d681['dialAMDMaximumNumberOfWords'];this[_0xd3b2('0x2e')]=_0x36d681[_0xd3b2('0x2e')];this[_0xd3b2('0x2f')]=_0x36d681[_0xd3b2('0x2f')];}module[_0xd3b2('0x30')]=Campaign; \ No newline at end of file +var _0x40e9=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence'];(function(_0x193a6e,_0x45dd00){var _0x599a9b=function(_0x37a9e2){while(--_0x37a9e2){_0x193a6e['push'](_0x193a6e['shift']());}};_0x599a9b(++_0x45dd00);}(_0x40e9,0xe8));var _0x940e=function(_0xe2da1b,_0x1c6a86){_0xe2da1b=_0xe2da1b-0x0;var _0x116760=_0x40e9[_0xe2da1b];return _0x116760;};'use strict';function Campaign(_0x2acb6d){this['id']=_0x2acb6d['id']||0x0;this[_0x940e('0x0')]=_0x2acb6d[_0x940e('0x0')]||'';this['type']=_0x2acb6d[_0x940e('0x1')]||'campaign';this[_0x940e('0x2')]=0x0;this[_0x940e('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x940e('0x4')]=0x0;this[_0x940e('0x5')]='';this[_0x940e('0x6')]=!![];this[_0x940e('0x7')]=_0x2acb6d[_0x940e('0x7')];this['limitCalls']=_0x2acb6d['limitCalls'];this['dialTimezone']=_0x2acb6d[_0x940e('0x8')]||null;this['dialGlobalInterval']=_0x2acb6d[_0x940e('0x9')]?_0x2acb6d[_0x940e('0x9')]:null;this['dialOriginateCallerIdName']=_0x2acb6d['dialOriginateCallerIdName'];this[_0x940e('0xa')]=_0x2acb6d[_0x940e('0xa')];this['dialOriginateTimeout']=_0x2acb6d[_0x940e('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x2acb6d[_0x940e('0xc')];this['dialCongestionRetryFrequency']=_0x2acb6d['dialCongestionRetryFrequency'];this[_0x940e('0xd')]=_0x2acb6d[_0x940e('0xd')];this[_0x940e('0xe')]=_0x2acb6d[_0x940e('0xe')];this[_0x940e('0xf')]=_0x2acb6d['dialNoAnswerMaxRetry'];this[_0x940e('0x10')]=_0x2acb6d[_0x940e('0x10')];this[_0x940e('0x11')]=_0x2acb6d['dialGlobalMaxRetry'];this[_0x940e('0x12')]=_0x2acb6d['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2acb6d[_0x940e('0x13')]||0x96;this[_0x940e('0x14')]=_0x2acb6d[_0x940e('0x14')]||0x3;this[_0x940e('0x15')]=_0x2acb6d[_0x940e('0x15')]||0x96;this[_0x940e('0x16')]=_0x2acb6d[_0x940e('0x16')]||0x3;this[_0x940e('0x17')]=_0x2acb6d[_0x940e('0x17')]||0x96;this[_0x940e('0x18')]=_0x2acb6d[_0x940e('0x18')]||0x3;this[_0x940e('0x19')]=_0x2acb6d[_0x940e('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0x2acb6d['dialAgentRejectMaxRetry']||0x3;this[_0x940e('0x1a')]=_0x2acb6d[_0x940e('0x1a')]||0x96;this['dialOrderByScheduledAt']=_0x2acb6d['dialOrderByScheduledAt']||_0x940e('0x1b');this['dialPrefix']=_0x2acb6d[_0x940e('0x1c')]||undefined;this[_0x940e('0x1d')]=_0x2acb6d[_0x940e('0x1d')]||undefined;this[_0x940e('0x1e')]=_0x2acb6d[_0x940e('0x1e')]||undefined;this[_0x940e('0x1f')]=_0x2acb6d[_0x940e('0x1f')]?_0x2acb6d[_0x940e('0x1f')]:undefined;this[_0x940e('0x20')]=_0x2acb6d['Trunk']?_0x2acb6d[_0x940e('0x20')]:undefined;this[_0x940e('0x21')]=_0x2acb6d[_0x940e('0x21')]?_0x2acb6d[_0x940e('0x21')]:undefined;this[_0x940e('0x22')]=_0x2acb6d[_0x940e('0x22')]?_0x2acb6d['SquareProject']:undefined;this['dialQueueProject']=_0x2acb6d[_0x940e('0x22')]?_0x2acb6d['SquareProject']['name']:undefined;this['dialAMDActive']=_0x2acb6d[_0x940e('0x23')]||![];this['dialAMDInitialSilence']=_0x2acb6d[_0x940e('0x24')];this['dialAMDGreeting']=_0x2acb6d['dialAMDGreeting'];this[_0x940e('0x25')]=_0x2acb6d['dialAMDAfterGreetingSilence'];this[_0x940e('0x26')]=_0x2acb6d[_0x940e('0x26')];this['dialAMDMinWordLength']=_0x2acb6d[_0x940e('0x27')];this[_0x940e('0x28')]=_0x2acb6d[_0x940e('0x28')];this[_0x940e('0x29')]=_0x2acb6d['dialAMDMaximumNumberOfWords'];this[_0x940e('0x2a')]=_0x2acb6d['dialAMDSilenceThreshold'];this[_0x940e('0x2b')]=_0x2acb6d['dialAMDMaximumWordLength'];}module[_0x940e('0x2c')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 247ef46..772a317 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 _0xe8e8=['calleridname','connectedlinenum','context','linkedid','exten','answered','answertime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel'];(function(_0x28b6d6,_0x300897){var _0x4519cd=function(_0x31966c){while(--_0x31966c){_0x28b6d6['push'](_0x28b6d6['shift']());}};_0x4519cd(++_0x300897);}(_0xe8e8,0xc6));var _0x8e8e=function(_0x51eb4b,_0x186299){_0x51eb4b=_0x51eb4b-0x0;var _0xc0911e=_0xe8e8[_0x51eb4b];return _0xc0911e;};'use strict';function Channel(){this[_0x8e8e('0x0')]=null;this[_0x8e8e('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x8e8e('0x2')]='';this[_0x8e8e('0x3')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x8e8e('0x4')]='';this['uniqueid']=0x0;this[_0x8e8e('0x5')]=0x0;this[_0x8e8e('0x6')]=0x0;this[_0x8e8e('0x7')]=![];this[_0x8e8e('0x8')]=null;this['endtime']=null;this[_0x8e8e('0x9')]=![];this['abandoned']=![];this[_0x8e8e('0xa')]='';this[_0x8e8e('0xb')]='';this[_0x8e8e('0xc')]=0x0;this[_0x8e8e('0xd')]=0x0;this[_0x8e8e('0xe')]=0x0;this[_0x8e8e('0xf')]=null;this[_0x8e8e('0x10')]=null;this['disposition']=null;this[_0x8e8e('0x11')]=![];this[_0x8e8e('0x12')]=null;this[_0x8e8e('0x13')]=null;this[_0x8e8e('0x14')]=[];this['transfercalleridnum']=undefined;this[_0x8e8e('0x15')]=undefined;this[_0x8e8e('0x16')]=undefined;this[_0x8e8e('0x17')]=0x0;}module[_0x8e8e('0x18')]=Channel; \ No newline at end of file +var _0xa7c8=['exten','answertime','unmanaged','abandoned','lastapplication','billableseconds','holdtime','type','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinename','context','uniqueid','linkedid'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa7c8,0x82));var _0x8a7c=function(_0x4ba9d9,_0x147210){_0x4ba9d9=_0x4ba9d9-0x0;var _0xaca26a=_0xa7c8[_0x4ba9d9];return _0xaca26a;};'use strict';function Channel(){this[_0x8a7c('0x0')]=null;this['channel']='';this[_0x8a7c('0x1')]='';this[_0x8a7c('0x2')]=0x0;this[_0x8a7c('0x3')]='';this['connectedlinenum']=undefined;this[_0x8a7c('0x4')]=undefined;this['accountcode']=0x0;this[_0x8a7c('0x5')]='';this[_0x8a7c('0x6')]=0x0;this[_0x8a7c('0x7')]=0x0;this[_0x8a7c('0x8')]=0x0;this['answered']=![];this[_0x8a7c('0x9')]=null;this['endtime']=null;this[_0x8a7c('0xa')]=![];this[_0x8a7c('0xb')]=![];this[_0x8a7c('0xc')]='';this['lastdata']='';this['duration']=0x0;this[_0x8a7c('0xd')]=0x0;this[_0x8a7c('0xe')]=0x0;this[_0x8a7c('0xf')]=null;this['tag']=null;this['disposition']=null;this[_0x8a7c('0x10')]=![];this[_0x8a7c('0x11')]=null;this[_0x8a7c('0x12')]=null;this[_0x8a7c('0x13')]=[];this[_0x8a7c('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x8a7c('0x15')]=undefined;this['mohtime']=0x0;}module[_0x8a7c('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 5ae7230..5b7950d 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 _0xe1b3=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x4feb15,_0x538e8f){var _0x41b883=function(_0x4e051a){while(--_0x4e051a){_0x4feb15['push'](_0x4feb15['shift']());}};_0x41b883(++_0x538e8f);}(_0xe1b3,0xd4));var _0x3e1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1b3[_0x20a584];return _0x4b41a8;};'use strict';function DeskAccount(_0x310c93){this['id']=_0x310c93['id']||0x0;this['name']=_0x310c93[_0x3e1b('0x0')]||'';this['username']=_0x310c93[_0x3e1b('0x1')]||'';this[_0x3e1b('0x2')]=_0x310c93[_0x3e1b('0x2')]||'';this['authType']=_0x310c93[_0x3e1b('0x3')]||'';this[_0x3e1b('0x4')]=_0x310c93['password']||'';this[_0x3e1b('0x5')]=_0x310c93['consumerKey']||'';this[_0x3e1b('0x6')]=_0x310c93['consumerSecret']||'';this[_0x3e1b('0x7')]=_0x310c93[_0x3e1b('0x7')]||'';this[_0x3e1b('0x8')]=_0x310c93[_0x3e1b('0x8')]||'';this[_0x3e1b('0x9')]=_0x310c93[_0x3e1b('0x9')]||'';this['serverUrl']=_0x310c93[_0x3e1b('0xa')]||'';this[_0x3e1b('0xb')]=_0x310c93['Configurations']||{};}module[_0x3e1b('0xc')]=DeskAccount; \ No newline at end of file +var _0x4908=['name','username','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','Configurations'];(function(_0x2fba0c,_0x2cf2c0){var _0x263a96=function(_0x895beb){while(--_0x895beb){_0x2fba0c['push'](_0x2fba0c['shift']());}};_0x263a96(++_0x2cf2c0);}(_0x4908,0x186));var _0x8490=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x4908[_0x1f9f37];return _0x21c080;};'use strict';function DeskAccount(_0x4b29c9){this['id']=_0x4b29c9['id']||0x0;this[_0x8490('0x0')]=_0x4b29c9['name']||'';this[_0x8490('0x1')]=_0x4b29c9[_0x8490('0x1')]||'';this['remoteUri']=_0x4b29c9['remoteUri']||'';this[_0x8490('0x2')]=_0x4b29c9[_0x8490('0x2')]||'';this[_0x8490('0x3')]=_0x4b29c9[_0x8490('0x3')]||'';this['consumerKey']=_0x4b29c9[_0x8490('0x4')]||'';this[_0x8490('0x5')]=_0x4b29c9['consumerSecret']||'';this[_0x8490('0x6')]=_0x4b29c9[_0x8490('0x6')]||'';this[_0x8490('0x7')]=_0x4b29c9['tokenSecret']||'';this[_0x8490('0x8')]=_0x4b29c9[_0x8490('0x8')]||'';this['serverUrl']=_0x4b29c9['serverUrl']||'';this[_0x8490('0x9')]=_0x4b29c9[_0x8490('0x9')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index f2425fd..01c9f8f 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 _0x5fb5=['tenantId','clientId','clientSecret','serverUrl','Configurations','CloudProvider','name','username','password','remoteUri'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x5fb5,0x11e));var _0x55fb=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x5fb5[_0x52666e];return _0x515330;};'use strict';function Dynamics365Account(_0x587135){this['id']=_0x587135['id']||0x0;this[_0x55fb('0x0')]=_0x587135[_0x55fb('0x0')]||'';this['username']=_0x587135[_0x55fb('0x1')]||'';this['password']=_0x587135[_0x55fb('0x2')]||'';this[_0x55fb('0x3')]=_0x587135[_0x55fb('0x3')]||'';this['tenantId']=_0x587135[_0x55fb('0x4')]||'';this[_0x55fb('0x5')]=_0x587135['clientId']||'';this['clientSecret']=_0x587135[_0x55fb('0x6')]||{};this[_0x55fb('0x7')]=_0x587135['serverUrl']||'';this['modernAuthentication']=_0x587135['modernAuthentication']||![];this[_0x55fb('0x8')]=_0x587135[_0x55fb('0x8')]||{};this[_0x55fb('0x9')]=_0x587135['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x108b=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId'];(function(_0x1f2e7a,_0x408d6d){var _0x5beb54=function(_0x45a8d2){while(--_0x45a8d2){_0x1f2e7a['push'](_0x1f2e7a['shift']());}};_0x5beb54(++_0x408d6d);}(_0x108b,0x133));var _0xb108=function(_0x5e6cb8,_0x1d1eb5){_0x5e6cb8=_0x5e6cb8-0x0;var _0x41754f=_0x108b[_0x5e6cb8];return _0x41754f;};'use strict';function Dynamics365Account(_0x3aa4bb){this['id']=_0x3aa4bb['id']||0x0;this[_0xb108('0x0')]=_0x3aa4bb[_0xb108('0x0')]||'';this[_0xb108('0x1')]=_0x3aa4bb[_0xb108('0x1')]||'';this[_0xb108('0x2')]=_0x3aa4bb['password']||'';this[_0xb108('0x3')]=_0x3aa4bb[_0xb108('0x3')]||'';this[_0xb108('0x4')]=_0x3aa4bb[_0xb108('0x4')]||'';this[_0xb108('0x5')]=_0x3aa4bb['clientId']||'';this[_0xb108('0x6')]=_0x3aa4bb[_0xb108('0x6')]||{};this[_0xb108('0x7')]=_0x3aa4bb[_0xb108('0x7')]||'';this[_0xb108('0x8')]=_0x3aa4bb[_0xb108('0x8')]||![];this[_0xb108('0x9')]=_0x3aa4bb[_0xb108('0x9')]||{};this[_0xb108('0xa')]=_0x3aa4bb[_0xb108('0xa')]||{};}module[_0xb108('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index f0c812e..14aa84c 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 _0xb199=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0x30dd25,_0x371198){var _0x4e1829=function(_0x53df5c){while(--_0x53df5c){_0x30dd25['push'](_0x30dd25['shift']());}};_0x4e1829(++_0x371198);}(_0xb199,0xdc));var _0x9b19=function(_0x388db2,_0x50e4c1){_0x388db2=_0x388db2-0x0;var _0xc8702e=_0xb199[_0x388db2];return _0xc8702e;};'use strict';function FaxAccount(_0xa046e0){this['id']=_0xa046e0['id']||0x0;this[_0x9b19('0x0')]=_0xa046e0[_0x9b19('0x0')]||'';this[_0x9b19('0x1')]=_0xa046e0[_0x9b19('0x1')];this['ecm']=_0xa046e0[_0x9b19('0x2')];this[_0x9b19('0x3')]=_0xa046e0[_0x9b19('0x3')];this[_0x9b19('0x4')]=_0xa046e0[_0x9b19('0x4')];this[_0x9b19('0x5')]=_0xa046e0[_0x9b19('0x5')]||0x960;this['maxrate']=_0xa046e0[_0x9b19('0x6')]||0x3840;this[_0x9b19('0x7')]=_0xa046e0[_0x9b19('0x7')]||_0x9b19('0x8');this[_0x9b19('0x9')]=_0xa046e0[_0x9b19('0x9')]||'no';this[_0x9b19('0xa')]=_0xa046e0['faxdetect']||'no';this['t38timeout']=_0xa046e0['t38timeout']||0x1388;this[_0x9b19('0xb')]=_0xa046e0['tech']||'SIP';this[_0x9b19('0xc')]=_0xa046e0[_0x9b19('0xc')]?_0xa046e0[_0x9b19('0xc')]:undefined;this[_0x9b19('0xd')]=_0xa046e0['ListId'];this[_0x9b19('0xe')]=_0xa046e0[_0x9b19('0xe')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x5085=['SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x473c5f,_0x1a4606){var _0x1dbea4=function(_0x120f32){while(--_0x120f32){_0x473c5f['push'](_0x473c5f['shift']());}};_0x1dbea4(++_0x1a4606);}(_0x5085,0x164));var _0x5508=function(_0x2dcda8,_0x516ce2){_0x2dcda8=_0x2dcda8-0x0;var _0x1b5ccb=_0x5085[_0x2dcda8];return _0x1b5ccb;};'use strict';function FaxAccount(_0x5851e7){this['id']=_0x5851e7['id']||0x0;this[_0x5508('0x0')]=_0x5851e7[_0x5508('0x0')]||'';this[_0x5508('0x1')]=_0x5851e7[_0x5508('0x1')];this[_0x5508('0x2')]=_0x5851e7['ecm'];this[_0x5508('0x3')]=_0x5851e7[_0x5508('0x3')];this['localstationid']=_0x5851e7[_0x5508('0x4')];this[_0x5508('0x5')]=_0x5851e7[_0x5508('0x5')]||0x960;this[_0x5508('0x6')]=_0x5851e7[_0x5508('0x6')]||0x3840;this[_0x5508('0x7')]=_0x5851e7['modem']||'v17,v27,v29';this[_0x5508('0x8')]=_0x5851e7[_0x5508('0x8')]||'no';this[_0x5508('0x9')]=_0x5851e7['faxdetect']||'no';this['t38timeout']=_0x5851e7[_0x5508('0xa')]||0x1388;this[_0x5508('0xb')]=_0x5851e7[_0x5508('0xb')]||_0x5508('0xc');this[_0x5508('0xd')]=_0x5851e7[_0x5508('0xd')]?_0x5851e7[_0x5508('0xd')]:undefined;this['ListId']=_0x5851e7['ListId'];this[_0x5508('0xe')]=_0x5851e7['key'];}module[_0x5508('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index a6e98e1..cb40307 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 _0x7ea3=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ea3,0x145));var _0x37ea=function(_0x4b1475,_0x2912a3){_0x4b1475=_0x4b1475-0x0;var _0x3457d0=_0x7ea3[_0x4b1475];return _0x3457d0;};'use strict';function FreshdeskAccount(_0x24ed1a){this['id']=_0x24ed1a['id']||0x0;this[_0x37ea('0x0')]=_0x24ed1a[_0x37ea('0x0')]||'';this[_0x37ea('0x1')]=_0x24ed1a[_0x37ea('0x1')]||'';this[_0x37ea('0x2')]=_0x24ed1a[_0x37ea('0x3')]||'';this[_0x37ea('0x4')]=_0x24ed1a['remoteUri']||'';this[_0x37ea('0x5')]=_0x24ed1a['serverUrl']||'';this['Configurations']=_0x24ed1a[_0x37ea('0x6')]||{};}module[_0x37ea('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xe419=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x57c2bd,_0xd53c54){var _0x562428=function(_0x416026){while(--_0x416026){_0x57c2bd['push'](_0x57c2bd['shift']());}};_0x562428(++_0xd53c54);}(_0xe419,0x129));var _0x9e41=function(_0x429e43,_0x27bae2){_0x429e43=_0x429e43-0x0;var _0x5db12f=_0xe419[_0x429e43];return _0x5db12f;};'use strict';function FreshdeskAccount(_0x5296b8){this['id']=_0x5296b8['id']||0x0;this[_0x9e41('0x0')]=_0x5296b8[_0x9e41('0x0')]||'';this['username']=_0x5296b8[_0x9e41('0x1')]||'';this[_0x9e41('0x2')]=_0x5296b8[_0x9e41('0x3')]||'';this[_0x9e41('0x4')]=_0x5296b8[_0x9e41('0x4')]||'';this[_0x9e41('0x5')]=_0x5296b8[_0x9e41('0x5')]||'';this[_0x9e41('0x6')]=_0x5296b8[_0x9e41('0x6')]||{};}module[_0x9e41('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 d4af74d..4b3aafc 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 _0x4c9d=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0xdb357c,_0x3786b6){var _0x5c8735=function(_0x2e179c){while(--_0x2e179c){_0xdb357c['push'](_0xdb357c['shift']());}};_0x5c8735(++_0x3786b6);}(_0x4c9d,0x7c));var _0xd4c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4c9d[_0x2dafbe];return _0x58a45a;};'use strict';function FreshsalesAccount(_0x249319){this['id']=_0x249319['id']||0x0;this[_0xd4c9('0x0')]=_0x249319[_0xd4c9('0x0')]||'';this['username']=_0x249319[_0xd4c9('0x1')]||'';this[_0xd4c9('0x2')]=_0x249319[_0xd4c9('0x3')]||'';this[_0xd4c9('0x4')]=_0x249319[_0xd4c9('0x4')]||'';this[_0xd4c9('0x5')]=_0x249319[_0xd4c9('0x5')]||'';this[_0xd4c9('0x6')]=_0x249319[_0xd4c9('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x04f1=['exports','name','apiKey','token','remoteUri'];(function(_0x433c9f,_0x390cf6){var _0x3f07b0=function(_0x56fefd){while(--_0x56fefd){_0x433c9f['push'](_0x433c9f['shift']());}};_0x3f07b0(++_0x390cf6);}(_0x04f1,0x92));var _0x104f=function(_0x424801,_0x2a99af){_0x424801=_0x424801-0x0;var _0x584a33=_0x04f1[_0x424801];return _0x584a33;};'use strict';function FreshsalesAccount(_0x2550ff){this['id']=_0x2550ff['id']||0x0;this[_0x104f('0x0')]=_0x2550ff[_0x104f('0x0')]||'';this['username']=_0x2550ff['username']||'';this[_0x104f('0x1')]=_0x2550ff[_0x104f('0x2')]||'';this[_0x104f('0x3')]=_0x2550ff['remoteUri']||'';this['serverUrl']=_0x2550ff['serverUrl']||'';this['Configurations']=_0x2550ff['Configurations']||{};}module[_0x104f('0x4')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index d9dddf8..20f92e3 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 _0x93d5=['queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','priority','holdtime','assigned','lastAssignedTo','motionChannel','routealias','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count'];(function(_0x5a50cd,_0x4f85be){var _0x5cc332=function(_0x3e34c6){while(--_0x3e34c6){_0x5a50cd['push'](_0x5a50cd['shift']());}};_0x5cc332(++_0x4f85be);}(_0x93d5,0x130));var _0x593d=function(_0x3f62f4,_0x2b1dd3){_0x3f62f4=_0x3f62f4-0x0;var _0x19b0f5=_0x93d5[_0x3f62f4];return _0x19b0f5;};'use strict';function QueueReport(){this[_0x593d('0x0')]='inbound';this[_0x593d('0x1')]='';this[_0x593d('0x2')]='';this[_0x593d('0x3')]='';this['queue']='';this[_0x593d('0x4')]=null;this[_0x593d('0x5')]=null;this[_0x593d('0x6')]=0x1;this[_0x593d('0x7')]=0x1;this[_0x593d('0x8')]=![];this['queuecallerabandonAt']=null;this[_0x593d('0x9')]=![];this[_0x593d('0xa')]=null;this[_0x593d('0xb')]=![];this[_0x593d('0xc')]=null;this[_0x593d('0xd')]=0x1;this[_0x593d('0xe')]='';this[_0x593d('0xf')]='';this[_0x593d('0x10')]='';this['accountcode']='';this[_0x593d('0x11')]='';this['exten']='';this[_0x593d('0x12')]='';this[_0x593d('0x13')]=0x0;this[_0x593d('0x14')]=![];this[_0x593d('0x15')]='';this[_0x593d('0x16')]='voice';this[_0x593d('0x17')]=null;this['mohtime']=0x0;this[_0x593d('0x18')]={};}module[_0x593d('0x19')]=QueueReport; \ No newline at end of file +var _0x25df=['motionChannel','voice','routealias','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','lastAssignedTo'];(function(_0x456a84,_0x46bc0b){var _0x1117d6=function(_0x20f9d1){while(--_0x20f9d1){_0x456a84['push'](_0x456a84['shift']());}};_0x1117d6(++_0x46bc0b);}(_0x25df,0x6c));var _0xf25d=function(_0x30658c,_0x17bf62){_0x30658c=_0x30658c-0x0;var _0x2996e5=_0x25df[_0x30658c];return _0x2996e5;};'use strict';function QueueReport(){this[_0xf25d('0x0')]=_0xf25d('0x1');this[_0xf25d('0x2')]='';this[_0xf25d('0x3')]='';this[_0xf25d('0x4')]='';this[_0xf25d('0x5')]='';this[_0xf25d('0x6')]=null;this[_0xf25d('0x7')]=null;this[_0xf25d('0x8')]=0x1;this['count']=0x1;this[_0xf25d('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xf25d('0xa')]=![];this[_0xf25d('0xb')]=null;this[_0xf25d('0xc')]=![];this[_0xf25d('0xd')]=null;this[_0xf25d('0xe')]=0x1;this['channel']='';this[_0xf25d('0xf')]='';this[_0xf25d('0x10')]='';this[_0xf25d('0x11')]='';this[_0xf25d('0x12')]='';this[_0xf25d('0x13')]='';this[_0xf25d('0x14')]='';this['holdtime']=0x0;this['assigned']=![];this[_0xf25d('0x15')]='';this[_0xf25d('0x16')]=_0xf25d('0x17');this[_0xf25d('0x18')]=null;this['mohtime']=0x0;this[_0xf25d('0x19')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index a397fb4..6e1eb1c 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 _0xa840=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','remoteUri'];(function(_0x8e3afb,_0x313e49){var _0x579073=function(_0x574cff){while(--_0x574cff){_0x8e3afb['push'](_0x8e3afb['shift']());}};_0x579073(++_0x313e49);}(_0xa840,0x17f));var _0x0a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa840[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x55fdf3){this['id']=_0x55fdf3['id']||0x0;this[_0x0a84('0x0')]=_0x55fdf3['name']||'';this['username']=_0x55fdf3['username']||'';this[_0x0a84('0x1')]=_0x55fdf3['remoteUri']||'';this[_0x0a84('0x2')]=_0x55fdf3[_0x0a84('0x2')]||'';this[_0x0a84('0x3')]=_0x55fdf3['clientId']||'';this['clientSecret']=_0x55fdf3[_0x0a84('0x4')]||'';this[_0x0a84('0x5')]=_0x55fdf3[_0x0a84('0x5')]||'';this[_0x0a84('0x6')]=_0x55fdf3[_0x0a84('0x6')]||_0x0a84('0x7');this[_0x0a84('0x8')]=_0x55fdf3[_0x0a84('0x8')]||'';this[_0x0a84('0x9')]=_0x55fdf3[_0x0a84('0x9')]||{};}module[_0x0a84('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x1aa9=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations'];(function(_0x50d419,_0x5df67c){var _0x480c4b=function(_0x4773e1){while(--_0x4773e1){_0x50d419['push'](_0x50d419['shift']());}};_0x480c4b(++_0x5df67c);}(_0x1aa9,0x1a3));var _0x91aa=function(_0x210729,_0x48136d){_0x210729=_0x210729-0x0;var _0x7687ee=_0x1aa9[_0x210729];return _0x7687ee;};'use strict';function SalesforceAccount(_0x2cf670){this['id']=_0x2cf670['id']||0x0;this[_0x91aa('0x0')]=_0x2cf670[_0x91aa('0x0')]||'';this[_0x91aa('0x1')]=_0x2cf670[_0x91aa('0x1')]||'';this['remoteUri']=_0x2cf670[_0x91aa('0x2')]||'';this['password']=_0x2cf670[_0x91aa('0x3')]||'';this[_0x91aa('0x4')]=_0x2cf670['clientId']||'';this[_0x91aa('0x5')]=_0x2cf670['clientSecret']||'';this[_0x91aa('0x6')]=_0x2cf670[_0x91aa('0x6')]||'';this['type']=_0x2cf670[_0x91aa('0x7')]||'integrationTab';this[_0x91aa('0x8')]=_0x2cf670['serverUrl']||'';this[_0x91aa('0x9')]=_0x2cf670[_0x91aa('0x9')]||{};}module[_0x91aa('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9f105ad..3817f64 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 _0x3c4a=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x2dc1b9,_0x2254b0){var _0x460c91=function(_0x1a719b){while(--_0x1a719b){_0x2dc1b9['push'](_0x2dc1b9['shift']());}};_0x460c91(++_0x2254b0);}(_0x3c4a,0x160));var _0xa3c4=function(_0x29969b,_0x2982c4){_0x29969b=_0x29969b-0x0;var _0x16bdad=_0x3c4a[_0x29969b];return _0x16bdad;};'use strict';function ServicenowAccount(_0x199d86){this['id']=_0x199d86['id']||0x0;this[_0xa3c4('0x0')]=_0x199d86[_0xa3c4('0x0')]||'';this['username']=_0x199d86[_0xa3c4('0x1')]||'';this[_0xa3c4('0x2')]=_0x199d86[_0xa3c4('0x2')]||'';this[_0xa3c4('0x3')]=_0x199d86['remoteUri']||'';this['serverUrl']=_0x199d86[_0xa3c4('0x4')]||'';this['Configurations']=_0x199d86[_0xa3c4('0x5')]||{};}module[_0xa3c4('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xb200=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0xbd6821,_0x51a02a){var _0x2de2e1=function(_0x34ba60){while(--_0x34ba60){_0xbd6821['push'](_0xbd6821['shift']());}};_0x2de2e1(++_0x51a02a);}(_0xb200,0xc3));var _0x0b20=function(_0x499b83,_0xde81d0){_0x499b83=_0x499b83-0x0;var _0x15d62a=_0xb200[_0x499b83];return _0x15d62a;};'use strict';function ServicenowAccount(_0x10f872){this['id']=_0x10f872['id']||0x0;this[_0x0b20('0x0')]=_0x10f872[_0x0b20('0x0')]||'';this[_0x0b20('0x1')]=_0x10f872[_0x0b20('0x1')]||'';this[_0x0b20('0x2')]=_0x10f872['password']||'';this[_0x0b20('0x3')]=_0x10f872[_0x0b20('0x3')]||'';this['serverUrl']=_0x10f872[_0x0b20('0x4')]||'';this[_0x0b20('0x5')]=_0x10f872[_0x0b20('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 8074aa8..ec5e0ce 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 _0xcb99=['password','remoteUri','serverUrl','Configurations','name'];(function(_0x5472d3,_0x4a14ce){var _0x539a9b=function(_0x44e726){while(--_0x44e726){_0x5472d3['push'](_0x5472d3['shift']());}};_0x539a9b(++_0x4a14ce);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xcb99[_0x1147ab];return _0x55cb5a;};'use strict';function SugarcrmAccount(_0x4ef05b){this['id']=_0x4ef05b['id']||0x0;this['name']=_0x4ef05b[_0x9cb9('0x0')]||'';this['username']=_0x4ef05b['username']||'';this[_0x9cb9('0x1')]=_0x4ef05b[_0x9cb9('0x1')]||'';this[_0x9cb9('0x2')]=_0x4ef05b['remoteUri']||'';this[_0x9cb9('0x3')]=_0x4ef05b[_0x9cb9('0x3')]||'';this['Configurations']=_0x4ef05b[_0x9cb9('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xf3e9=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x18913f,_0x1aef94){var _0x38d764=function(_0x50ca6c){while(--_0x50ca6c){_0x18913f['push'](_0x18913f['shift']());}};_0x38d764(++_0x1aef94);}(_0xf3e9,0xe9));var _0x9f3e=function(_0x4724b8,_0x106564){_0x4724b8=_0x4724b8-0x0;var _0x3c02ba=_0xf3e9[_0x4724b8];return _0x3c02ba;};'use strict';function SugarcrmAccount(_0x422a1e){this['id']=_0x422a1e['id']||0x0;this[_0x9f3e('0x0')]=_0x422a1e['name']||'';this['username']=_0x422a1e['username']||'';this['password']=_0x422a1e[_0x9f3e('0x1')]||'';this[_0x9f3e('0x2')]=_0x422a1e[_0x9f3e('0x2')]||'';this[_0x9f3e('0x3')]=_0x422a1e[_0x9f3e('0x3')]||'';this['Configurations']=_0x422a1e[_0x9f3e('0x4')]||{};}module[_0x9f3e('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index cd64cec..6c6c4c2 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 _0xd452=['address','exports','name','accountcode','state','unknown'];(function(_0x2cde83,_0x3afd57){var _0x148c5f=function(_0x5aee9b){while(--_0x5aee9b){_0x2cde83['push'](_0x2cde83['shift']());}};_0x148c5f(++_0x3afd57);}(_0xd452,0x98));var _0x2d45=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xd452[_0x20589d];return _0x422de9;};'use strict';function Telephone(_0xef7ff){this['id']=_0xef7ff['id']||0x0;this[_0x2d45('0x0')]=_0xef7ff['name']||'';this[_0x2d45('0x1')]=_0xef7ff[_0x2d45('0x1')]||'';this[_0x2d45('0x2')]=_0x2d45('0x3');this['stateTime']=0x0;this['status']=_0x2d45('0x3');this[_0x2d45('0x4')]='';}module[_0x2d45('0x5')]=Telephone; \ No newline at end of file +var _0xa4ad=['address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xa4ad,0x80));var _0xda4a=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xa4ad[_0x2f9467];return _0x39894c;};'use strict';function Telephone(_0x4fae24){this['id']=_0x4fae24['id']||0x0;this['name']=_0x4fae24[_0xda4a('0x0')]||'';this[_0xda4a('0x1')]=_0x4fae24[_0xda4a('0x1')]||'';this[_0xda4a('0x2')]=_0xda4a('0x3');this[_0xda4a('0x4')]=0x0;this['status']='unknown';this[_0xda4a('0x5')]='';}module[_0xda4a('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 492116b..02d30a7 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(_0x2446ad,_0x5f0685){var _0x5648de=function(_0x37a52a){while(--_0x37a52a){_0x2446ad['push'](_0x2446ad['shift']());}};_0x5648de(++_0x5f0685);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x13c2e2,_0x7a62b8){var _0x29fb34=function(_0x432494){while(--_0x432494){_0x13c2e2['push'](_0x13c2e2['shift']());}};_0x29fb34(++_0x7a62b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 0f63225..4e0cf33 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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0x4fc2,0x111));var _0x24fc=function(_0x488e3d,_0x4f7e2a){_0x488e3d=_0x488e3d-0x0;var _0x3ee2b2=_0x4fc2[_0x488e3d];return _0x3ee2b2;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 21e700c..0b08e7c 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 _0x93b4=['split','port','domain','domainport','stateRegistry','address','exports','active','name','state','status','unknown','registry','indexOf'];(function(_0x26cc16,_0x4c174f){var _0x345e3e=function(_0x14b4f8){while(--_0x14b4f8){_0x26cc16['push'](_0x26cc16['shift']());}};_0x345e3e(++_0x4c174f);}(_0x93b4,0x1b9));var _0x493b=function(_0x128cf3,_0x133d5b){_0x128cf3=_0x128cf3-0x0;var _0x497eb5=_0x93b4[_0x128cf3];return _0x497eb5;};'use strict';function Trunk(_0x40b2f0){this['id']=_0x40b2f0['id']||0x0;this[_0x493b('0x0')]=_0x40b2f0[_0x493b('0x0')]||![];this[_0x493b('0x1')]=_0x40b2f0['name']||'';this[_0x493b('0x2')]='unknown';this['stateTime']=0x0;this[_0x493b('0x3')]=_0x493b('0x4');this[_0x493b('0x5')]=_0x40b2f0['registry']&&_0x40b2f0['registry'][_0x493b('0x6')](':')?_0x40b2f0[_0x493b('0x5')][_0x493b('0x7')](':')[0x0]:'';this['host']='';this[_0x493b('0x8')]='';this[_0x493b('0x9')]='';this[_0x493b('0xa')]='';this['refresh']='';this[_0x493b('0xb')]='unknown';this['registrationtime']='';this[_0x493b('0xc')]='';this['defaultuser']=_0x40b2f0['defaultuser']||'';}module[_0x493b('0xd')]=Trunk; \ No newline at end of file +var _0x0b5d=['defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','address'];(function(_0x11de83,_0x49e1c1){var _0x45bdb0=function(_0x51041e){while(--_0x51041e){_0x11de83['push'](_0x11de83['shift']());}};_0x45bdb0(++_0x49e1c1);}(_0x0b5d,0x68));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x165f3c){this['id']=_0x165f3c['id']||0x0;this[_0xd0b5('0x0')]=_0x165f3c['active']||![];this[_0xd0b5('0x1')]=_0x165f3c[_0xd0b5('0x1')]||'';this[_0xd0b5('0x2')]=_0xd0b5('0x3');this[_0xd0b5('0x4')]=0x0;this[_0xd0b5('0x5')]='unknown';this[_0xd0b5('0x6')]=_0x165f3c['registry']&&_0x165f3c['registry'][_0xd0b5('0x7')](':')?_0x165f3c['registry'][_0xd0b5('0x8')](':')[0x0]:'';this[_0xd0b5('0x9')]='';this[_0xd0b5('0xa')]='';this[_0xd0b5('0xb')]='';this[_0xd0b5('0xc')]='';this[_0xd0b5('0xd')]='';this['stateRegistry']=_0xd0b5('0x3');this['registrationtime']='';this[_0xd0b5('0xe')]='';this[_0xd0b5('0xf')]=_0x165f3c[_0xd0b5('0xf')]||'';}module[_0xd0b5('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b87e29a..a2fb94b 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 _0x4fb2=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x4fb2,0xca));var _0x24fb=function(_0x5bed71,_0x18ec61){_0x5bed71=_0x5bed71-0x0;var _0x5ab0b8=_0x4fb2[_0x5bed71];return _0x5ab0b8;};'use strict';function voiceExtension(_0x155352){this['id']=_0x155352['id']||0x0;this[_0x24fb('0x0')]=_0x155352[_0x24fb('0x0')]||'';this[_0x24fb('0x1')]=_0x155352['recordingFormat']||_0x24fb('0x2');this[_0x24fb('0x3')]=_0x155352[_0x24fb('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x5241=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x5241,0x176));var _0x1524=function(_0x387f3f,_0x2651b1){_0x387f3f=_0x387f3f-0x0;var _0x38e2ac=_0x5241[_0x387f3f];return _0x38e2ac;};'use strict';function voiceExtension(_0x785366){this['id']=_0x785366['id']||0x0;this[_0x1524('0x0')]=_0x785366[_0x1524('0x0')]||'';this[_0x1524('0x1')]=_0x785366[_0x1524('0x1')]||_0x1524('0x2');this[_0x1524('0x3')]=_0x785366[_0x1524('0x3')]||![];}module[_0x1524('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 4fec31d..dba1539 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 _0x20b6=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','random','roundrobin','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','invalid','loggedIn','notInUse','paused','ringing','talking','unavailable','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','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','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x20b6,0x1ab));var _0x620b=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x20b6[_0x5a5395];return _0x4da43d;};'use strict';var monitorFormat={'wav':_0x620b('0x0'),'wav49':_0x620b('0x1'),'gsm':_0x620b('0x2')};var strategy={'fewestcalls':_0x620b('0x3'),'leastrecent':_0x620b('0x4'),'linear':'linear','random':_0x620b('0x5'),'ringall':'ringall','rr':_0x620b('0x6'),'rrmemory':'rrmemory','rrordered':_0x620b('0x7'),'wrandom':_0x620b('0x8')};function VoiceQueue(_0x57dfd4){this['id']=_0x57dfd4['id']||0x0;this[_0x620b('0x9')]=_0x57dfd4[_0x620b('0x9')]||'';this[_0x620b('0xa')]=_0x57dfd4[_0x620b('0xa')]||'';this[_0x620b('0xb')]=_0x57dfd4[_0x620b('0xb')]||_0x620b('0xc');this[_0x620b('0xd')]=0x0;this[_0x620b('0xe')]=0x0;this[_0x620b('0xf')]=0x0;this[_0x620b('0x10')]=0x0;this[_0x620b('0x11')]=0x0;this[_0x620b('0x12')]=0x0;this[_0x620b('0x13')]=0x0;this[_0x620b('0x14')]=0x0;this[_0x620b('0x15')]=0x0;this[_0x620b('0x16')]=0x0;this['inUse']=0x0;this[_0x620b('0x17')]=0x0;this[_0x620b('0x18')]=0x0;this[_0x620b('0x19')]=0x0;this['onHold']=0x0;this[_0x620b('0x1a')]=0x0;this[_0x620b('0x1b')]=0x0;this['ringInUse']=0x0;this[_0x620b('0x1c')]=0x0;this[_0x620b('0x1d')]=0x0;this['unknown']=0x0;this[_0x620b('0x1e')]=_0x57dfd4[_0x620b('0x1e')]||![];this['acwTimeout']=_0x57dfd4[_0x620b('0x1f')]||0xa;this['autopause']=_0x57dfd4['autopause']||'no';this[_0x620b('0x20')]=!![];this[_0x620b('0x21')]='';this['statusMessage']='';this[_0x620b('0x22')]=0x0;this[_0x620b('0x23')]=0x0;this[_0x620b('0x24')]=_0x57dfd4[_0x620b('0x24')]||null;this[_0x620b('0x25')]=_0x57dfd4[_0x620b('0x25')]?_0x57dfd4['dialGlobalInterval']:null;this['dialActive']=_0x57dfd4[_0x620b('0x26')];this[_0x620b('0x27')]=_0x57dfd4[_0x620b('0x27')]||'progressive';this[_0x620b('0x28')]=_0x57dfd4[_0x620b('0x28')]||0x0;this['dialLimitQueue']=_0x57dfd4[_0x620b('0x29')]||0x0;this[_0x620b('0x2a')]=_0x57dfd4['dialPowerLevel']||0x1;this[_0x620b('0x2b')]=_0x57dfd4[_0x620b('0x2b')]||_0x620b('0x2c');this['dialPredictiveOptimizationPercentage']=_0x57dfd4['dialPredictiveOptimizationPercentage']||0.03;this[_0x620b('0x2d')]=_0x57dfd4[_0x620b('0x2d')]||0x258;this[_0x620b('0x2e')]=_0x57dfd4[_0x620b('0x2e')]||'anonymous';this[_0x620b('0x2f')]=_0x57dfd4[_0x620b('0x2f')]||_0x620b('0x30');this[_0x620b('0x31')]=_0x57dfd4[_0x620b('0x31')]||0x1e;this[_0x620b('0x32')]=_0x57dfd4[_0x620b('0x32')]||_0x620b('0x33');this[_0x620b('0x34')]=_0x57dfd4[_0x620b('0x34')]||0x3;this[_0x620b('0x35')]=_0x57dfd4[_0x620b('0x35')]||undefined;this[_0x620b('0x36')]=_0x57dfd4[_0x620b('0x36')]||0x3;this[_0x620b('0x37')]=_0x57dfd4[_0x620b('0x37')]||0x96;this[_0x620b('0x38')]=_0x57dfd4[_0x620b('0x38')]||0x3;this[_0x620b('0x39')]=_0x57dfd4[_0x620b('0x39')]||0x96;this[_0x620b('0x3a')]=_0x57dfd4[_0x620b('0x3a')]||0x3;this[_0x620b('0x3b')]=_0x57dfd4[_0x620b('0x3b')]||0x96;this[_0x620b('0x3c')]=_0x57dfd4['dialNoSuchNumberMaxRetry']||0x3;this[_0x620b('0x3d')]=_0x57dfd4['dialNoSuchNumberRetryFrequency']||0x96;this[_0x620b('0x3e')]=_0x57dfd4['dialDropMaxRetry']||0x3;this[_0x620b('0x3f')]=_0x57dfd4[_0x620b('0x3f')]||0x96;this['dialAbandonedMaxRetry']=_0x57dfd4[_0x620b('0x40')]||0x3;this[_0x620b('0x41')]=_0x57dfd4[_0x620b('0x41')]||0x96;this[_0x620b('0x42')]=_0x57dfd4[_0x620b('0x42')]||0x3;this[_0x620b('0x43')]=_0x57dfd4['dialMachineRetryFrequency']||0x96;this[_0x620b('0x44')]=_0x57dfd4['dialAgentRejectMaxRetry']||0x3;this[_0x620b('0x45')]=_0x57dfd4['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x57dfd4['callAdditionalPhoneAfterMin']||0x3;this[_0x620b('0x46')]=_0x57dfd4[_0x620b('0x46')]||0x4;this[_0x620b('0x47')]=_0x57dfd4[_0x620b('0x47')]?_0x57dfd4[_0x620b('0x47')]:undefined;this['TrunkBackup']=_0x57dfd4[_0x620b('0x48')]?_0x57dfd4[_0x620b('0x48')]:undefined;this[_0x620b('0x49')]=_0x57dfd4[_0x620b('0x49')]||undefined;this[_0x620b('0x4a')]=_0x57dfd4['Interval']?_0x57dfd4[_0x620b('0x4a')]:undefined;this['dialOrderByScheduledAt']=_0x57dfd4[_0x620b('0x4b')]||_0x620b('0x4c');this['dialRandomLastDigitCallerIdNumber']=_0x57dfd4[_0x620b('0x4d')]||undefined;this[_0x620b('0x4e')]=_0x57dfd4['dialCutDigit']||undefined;this[_0x620b('0x4f')]=strategy[_0x57dfd4[_0x620b('0x4f')]];this[_0x620b('0x50')]=!![];this[_0x620b('0x51')]=_0x57dfd4['dialAMDActive']||![];this[_0x620b('0x52')]=_0x57dfd4[_0x620b('0x52')];this[_0x620b('0x53')]=_0x57dfd4[_0x620b('0x53')];this[_0x620b('0x54')]=_0x57dfd4['dialAMDAfterGreetingSilence'];this[_0x620b('0x55')]=_0x57dfd4[_0x620b('0x55')];this['dialAMDMinWordLength']=_0x57dfd4[_0x620b('0x56')];this['dialAMDBetweenWordsSilence']=_0x57dfd4['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x57dfd4['dialAMDMaximumNumberOfWords'];this[_0x620b('0x57')]=_0x57dfd4[_0x620b('0x57')];this[_0x620b('0x58')]=_0x57dfd4[_0x620b('0x58')];this[_0x620b('0x59')]=0x0;this[_0x620b('0x5a')]=0x0;this[_0x620b('0x5b')]=_0x57dfd4[_0x620b('0x5b')];this[_0x620b('0x5c')]=0x0;this[_0x620b('0x5d')]=0x0;this[_0x620b('0x5e')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x620b('0x5f')]=0x0;this[_0x620b('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x620b('0x61')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x620b('0x62')]=0x0;this[_0x620b('0x63')]=0x0;this[_0x620b('0x64')]=0x0;this[_0x620b('0x65')]=undefined;this[_0x620b('0x66')]=undefined;this['handlePredictive']=undefined;this[_0x620b('0x67')]=1.05;this[_0x620b('0x68')]=0x0;this[_0x620b('0x69')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x620b('0x6a')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x620b('0x6b')]=0x0;this[_0x620b('0x6c')]=0x0;this[_0x620b('0x6d')]=_0x57dfd4[_0x620b('0x6e')]||0x14;this['predictiveIntervalMinThreshold']=_0x57dfd4[_0x620b('0x6e')]||0xa;this[_0x620b('0x6f')]=0x0;this[_0x620b('0x70')]=0x0;this[_0x620b('0x71')]=0x1;this['erlangCalls']=0x0;this[_0x620b('0x72')]=0x0;this[_0x620b('0x73')]=0x0;this[_0x620b('0x74')]=0x0;this[_0x620b('0x75')]=_0x57dfd4[_0x620b('0x75')]||0x1e;this[_0x620b('0x76')]=_0x57dfd4['dialRecallInQueue']||![];this[_0x620b('0x77')]=!!_0x57dfd4[_0x620b('0x77')]||![];this[_0x620b('0x78')]=!!_0x57dfd4[_0x620b('0x78')]||![];this['dialQueueProject2']=_0x57dfd4[_0x620b('0x79')]||undefined;this[_0x620b('0x7a')]=_0x57dfd4[_0x620b('0x7a')]||![];this[_0x620b('0x7b')]=_0x57dfd4[_0x620b('0x7b')]||![];this[_0x620b('0xa')]=monitorFormat[_0x57dfd4['monitor_format']]?monitorFormat[_0x57dfd4[_0x620b('0xa')]]:undefined;this['mandatoryDisposition']=_0x57dfd4['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x57dfd4[_0x620b('0x7c')]?_0x57dfd4['mandatoryDispositionPause']:undefined;this[_0x620b('0x7d')]=![];}module[_0x620b('0x7e')]=VoiceQueue; \ No newline at end of file +var _0x5fc3=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','abandoned','available','inUse','invalid','onHold','ringing','ringInUse','talking','unavailable','unknown','autopause','sendMessageOneNotActive','message','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','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x5aa1a7,_0x4975ff){var _0xac5d6=function(_0x5a7aa0){while(--_0x5a7aa0){_0x5aa1a7['push'](_0x5aa1a7['shift']());}};_0xac5d6(++_0x4975ff);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x5fc3[_0x5ebc04];return _0x17845c;};'use strict';var monitorFormat={'wav':_0x35fc('0x0'),'wav49':_0x35fc('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x35fc('0x2'),'leastrecent':_0x35fc('0x3'),'linear':_0x35fc('0x4'),'random':_0x35fc('0x5'),'ringall':_0x35fc('0x6'),'rr':'roundrobin','rrmemory':_0x35fc('0x7'),'rrordered':_0x35fc('0x8'),'wrandom':_0x35fc('0x9')};function VoiceQueue(_0x5b85ad){this['id']=_0x5b85ad['id']||0x0;this['name']=_0x5b85ad[_0x35fc('0xa')]||'';this['monitor_format']=_0x5b85ad[_0x35fc('0xb')]||'';this[_0x35fc('0xc')]=_0x5b85ad[_0x35fc('0xc')]||_0x35fc('0xd');this[_0x35fc('0xe')]=0x0;this[_0x35fc('0xf')]=0x0;this[_0x35fc('0x10')]=0x0;this['sumDuration']=0x0;this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;this['unmanaged']=0x0;this[_0x35fc('0x13')]=0x0;this[_0x35fc('0x14')]=0x0;this['busy']=0x0;this[_0x35fc('0x15')]=0x0;this[_0x35fc('0x16')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x35fc('0x17')]=0x0;this['paused']=0x0;this[_0x35fc('0x18')]=0x0;this[_0x35fc('0x19')]=0x0;this[_0x35fc('0x1a')]=0x0;this[_0x35fc('0x1b')]=0x0;this[_0x35fc('0x1c')]=0x0;this['acw']=_0x5b85ad['acw']||![];this['acwTimeout']=_0x5b85ad['acwTimeout']||0xa;this[_0x35fc('0x1d')]=_0x5b85ad[_0x35fc('0x1d')]||'no';this[_0x35fc('0x1e')]=!![];this[_0x35fc('0x1f')]='';this[_0x35fc('0x20')]='';this[_0x35fc('0x21')]=0x0;this['temp']=0x0;this[_0x35fc('0x22')]=_0x5b85ad[_0x35fc('0x22')]||null;this['dialGlobalInterval']=_0x5b85ad[_0x35fc('0x23')]?_0x5b85ad[_0x35fc('0x23')]:null;this[_0x35fc('0x24')]=_0x5b85ad['dialActive'];this[_0x35fc('0x25')]=_0x5b85ad[_0x35fc('0x25')]||_0x35fc('0x26');this['dialLimitChannel']=_0x5b85ad[_0x35fc('0x27')]||0x0;this[_0x35fc('0x28')]=_0x5b85ad[_0x35fc('0x28')]||0x0;this[_0x35fc('0x29')]=_0x5b85ad[_0x35fc('0x29')]||0x1;this[_0x35fc('0x2a')]=_0x5b85ad[_0x35fc('0x2a')]||_0x35fc('0x2b');this[_0x35fc('0x2c')]=_0x5b85ad[_0x35fc('0x2c')]||0.03;this['dialPredictiveInterval']=_0x5b85ad[_0x35fc('0x2d')]||0x258;this[_0x35fc('0x2e')]=_0x5b85ad[_0x35fc('0x2e')]||_0x35fc('0x2f');this[_0x35fc('0x30')]=_0x5b85ad['dialOriginateCallerIdNumber']||_0x35fc('0x2f');this[_0x35fc('0x31')]=_0x5b85ad['dialOriginateTimeout']||0x1e;this[_0x35fc('0x32')]=_0x5b85ad[_0x35fc('0x32')]||_0x35fc('0x33');this['dialQueueTimeout']=_0x5b85ad[_0x35fc('0x34')]||0x3;this['dialQueueProject']=_0x5b85ad[_0x35fc('0x35')]||undefined;this[_0x35fc('0x36')]=_0x5b85ad['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x5b85ad[_0x35fc('0x37')]||0x96;this['dialBusyMaxRetry']=_0x5b85ad[_0x35fc('0x38')]||0x3;this[_0x35fc('0x39')]=_0x5b85ad['dialBusyRetryFrequency']||0x96;this[_0x35fc('0x3a')]=_0x5b85ad[_0x35fc('0x3a')]||0x3;this[_0x35fc('0x3b')]=_0x5b85ad[_0x35fc('0x3b')]||0x96;this[_0x35fc('0x3c')]=_0x5b85ad[_0x35fc('0x3c')]||0x3;this[_0x35fc('0x3d')]=_0x5b85ad[_0x35fc('0x3d')]||0x96;this['dialDropMaxRetry']=_0x5b85ad[_0x35fc('0x3e')]||0x3;this[_0x35fc('0x3f')]=_0x5b85ad[_0x35fc('0x3f')]||0x96;this['dialAbandonedMaxRetry']=_0x5b85ad[_0x35fc('0x40')]||0x3;this[_0x35fc('0x41')]=_0x5b85ad[_0x35fc('0x41')]||0x96;this[_0x35fc('0x42')]=_0x5b85ad[_0x35fc('0x42')]||0x3;this[_0x35fc('0x43')]=_0x5b85ad[_0x35fc('0x43')]||0x96;this[_0x35fc('0x44')]=_0x5b85ad[_0x35fc('0x44')]||0x3;this[_0x35fc('0x45')]=_0x5b85ad['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x5b85ad[_0x35fc('0x46')]||0x3;this['dialGlobalMaxRetry']=_0x5b85ad[_0x35fc('0x47')]||0x4;this[_0x35fc('0x48')]=_0x5b85ad[_0x35fc('0x48')]?_0x5b85ad[_0x35fc('0x48')]:undefined;this[_0x35fc('0x49')]=_0x5b85ad[_0x35fc('0x49')]?_0x5b85ad['TrunkBackup']:undefined;this[_0x35fc('0x4a')]=_0x5b85ad[_0x35fc('0x4a')]||undefined;this[_0x35fc('0x4b')]=_0x5b85ad[_0x35fc('0x4b')]?_0x5b85ad[_0x35fc('0x4b')]:undefined;this[_0x35fc('0x4c')]=_0x5b85ad['dialOrderByScheduledAt']||_0x35fc('0x4d');this[_0x35fc('0x4e')]=_0x5b85ad[_0x35fc('0x4e')]||undefined;this['dialCutDigit']=_0x5b85ad[_0x35fc('0x4f')]||undefined;this['strategy']=strategy[_0x5b85ad[_0x35fc('0x50')]];this[_0x35fc('0x51')]=!![];this[_0x35fc('0x52')]=_0x5b85ad[_0x35fc('0x52')]||![];this['dialAMDInitialSilence']=_0x5b85ad['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x5b85ad[_0x35fc('0x53')];this['dialAMDAfterGreetingSilence']=_0x5b85ad[_0x35fc('0x54')];this['dialAMDTotalAnalysisTime']=_0x5b85ad[_0x35fc('0x55')];this[_0x35fc('0x56')]=_0x5b85ad[_0x35fc('0x56')];this[_0x35fc('0x57')]=_0x5b85ad[_0x35fc('0x57')];this[_0x35fc('0x58')]=_0x5b85ad[_0x35fc('0x58')];this['dialAMDSilenceThreshold']=_0x5b85ad[_0x35fc('0x59')];this[_0x35fc('0x5a')]=_0x5b85ad['dialAMDMaximumWordLength'];this[_0x35fc('0x5b')]=0x0;this[_0x35fc('0x5c')]=0x0;this[_0x35fc('0x5d')]=_0x5b85ad[_0x35fc('0x5d')];this[_0x35fc('0x5e')]=0x0;this[_0x35fc('0x5f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x35fc('0x60')]=0x0;this[_0x35fc('0x61')]=0x0;this[_0x35fc('0x62')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x35fc('0x63')]=0x0;this[_0x35fc('0x64')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x35fc('0x65')]=0x0;this[_0x35fc('0x66')]=0x0;this[_0x35fc('0x67')]=0x0;this[_0x35fc('0x68')]=0x0;this[_0x35fc('0x69')]=undefined;this[_0x35fc('0x6a')]=undefined;this[_0x35fc('0x6b')]=undefined;this[_0x35fc('0x6c')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x35fc('0x6d')]=0x0;this[_0x35fc('0x6e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x35fc('0x6f')]=0x0;this[_0x35fc('0x70')]=_0x5b85ad['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x35fc('0x71')]=_0x5b85ad[_0x35fc('0x72')]||0xa;this[_0x35fc('0x73')]=0x0;this[_0x35fc('0x74')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0x35fc('0x75')]=_0x5b85ad[_0x35fc('0x75')]||0x1e;this['dialRecallInQueue']=_0x5b85ad[_0x35fc('0x76')]||![];this['dialPreviewAutoRecallMe']=!!_0x5b85ad[_0x35fc('0x77')]||![];this[_0x35fc('0x78')]=!!_0x5b85ad[_0x35fc('0x78')]||![];this[_0x35fc('0x79')]=_0x5b85ad[_0x35fc('0x79')]||undefined;this['dialAgiAfterHangupClient']=_0x5b85ad[_0x35fc('0x7a')]||![];this[_0x35fc('0x7b')]=_0x5b85ad['dialAgiAfterHangupAgent']||![];this[_0x35fc('0xb')]=monitorFormat[_0x5b85ad[_0x35fc('0xb')]]?monitorFormat[_0x5b85ad[_0x35fc('0xb')]]:undefined;this[_0x35fc('0x7c')]=_0x5b85ad['mandatoryDisposition']||![];this[_0x35fc('0x7d')]=_0x5b85ad['mandatoryDispositionPause']?_0x5b85ad['mandatoryDispositionPause']:undefined;this[_0x35fc('0x7e')]=![];}module[_0x35fc('0x7f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 13cb959..7beb5c0 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 _0x29af=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','busy','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','ringing','talking','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','answered','invalid','onHold','notInUse','paused','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0x29af,0x134));var _0xf29a=function(_0x181546,_0x2268c6){_0x181546=_0x181546-0x0;var _0x13e8f7=_0x29af[_0x181546];return _0x13e8f7;};'use strict';var INBOUND_COUNTERS=[_0xf29a('0x0'),_0xf29a('0x1'),_0xf29a('0x2'),'paused',_0xf29a('0x3'),_0xf29a('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0xf29a('0x0'),'answered',_0xf29a('0x5'),_0xf29a('0x1'),'loggedInDb','originated',_0xf29a('0x6'),_0xf29a('0x7'),_0xf29a('0x8'),_0xf29a('0x9'),_0xf29a('0xa'),_0xf29a('0xb'),'outboundNoSuchCallsDay',_0xf29a('0xc'),_0xf29a('0xd'),_0xf29a('0xe'),'paused','pTalking',_0xf29a('0x4'),_0xf29a('0xf'),_0xf29a('0x10'),_0xf29a('0x11'),_0xf29a('0x12')];function VoiceQueueSummary(_0x3b892f){this['id']=_0x3b892f['id'];this[_0xf29a('0x13')]=_0x3b892f['name'];this[_0xf29a('0x14')]=_0x3b892f[_0xf29a('0x14')];this[_0xf29a('0x15')]=_0x3b892f[_0xf29a('0x15')]||0x0;this[_0xf29a('0x16')]=_0x3b892f[_0xf29a('0x16')]||0x0;this[_0xf29a('0x0')]=_0x3b892f['available']||0x0;this['busy']=_0x3b892f['busy']||0x0;this[_0xf29a('0x5')]=_0x3b892f[_0xf29a('0x5')]||0x0;this[_0xf29a('0x17')]=_0x3b892f[_0xf29a('0x17')]||0x0;this[_0xf29a('0x1')]=_0x3b892f['loggedIn']||0x0;this[_0xf29a('0x2')]=_0x3b892f[_0xf29a('0x2')]||0x0;this[_0xf29a('0x18')]=_0x3b892f[_0xf29a('0x18')]||0x0;this[_0xf29a('0x19')]=_0x3b892f[_0xf29a('0x19')]||0x0;this[_0xf29a('0x1a')]=_0x3b892f[_0xf29a('0x1a')]||0x0;this[_0xf29a('0x3')]=_0x3b892f[_0xf29a('0x3')]||0x0;this['ringInUse']=_0x3b892f[_0xf29a('0x1b')];this[_0xf29a('0xf')]=_0x3b892f['sumBillable'];this[_0xf29a('0x10')]=_0x3b892f[_0xf29a('0x10')];this[_0xf29a('0x1c')]=_0x3b892f['sumHoldTime']||0x0;this[_0xf29a('0x4')]=_0x3b892f['talking']||0x0;this[_0xf29a('0x11')]=_0x3b892f[_0xf29a('0x11')]||0x0;this[_0xf29a('0x1d')]=_0x3b892f[_0xf29a('0x1d')];this['unavailable']=_0x3b892f[_0xf29a('0x1e')]||0x0;this[_0xf29a('0x1f')]=_0x3b892f[_0xf29a('0x1f')]||0x0;this[_0xf29a('0x20')]=_0x3b892f[_0xf29a('0x20')]||0x0;this[_0xf29a('0x12')]=_0x3b892f[_0xf29a('0x12')]||0x0;if(_0x3b892f['type']==='outbound'){this['pTalking']=_0x3b892f[_0xf29a('0x21')]||0x0;this['dialActive']=_0x3b892f[_0xf29a('0x22')];this[_0xf29a('0x23')]=_0x3b892f[_0xf29a('0x23')];this['dialOriginateCallerIdName']=_0x3b892f[_0xf29a('0x24')];this[_0xf29a('0x25')]=_0x3b892f[_0xf29a('0x25')];this[_0xf29a('0x26')]=_0x3b892f[_0xf29a('0x26')];this[_0xf29a('0x27')]=_0x3b892f['dialPrefix'];this[_0xf29a('0x28')]=_0x3b892f[_0xf29a('0x28')];this['outboundAnswerAgiCallsDay']=_0x3b892f['outboundAnswerAgiCallsDay'];this['outboundAnswerCallsDay']=_0x3b892f[_0xf29a('0x7')];this[_0xf29a('0x8')]=_0x3b892f[_0xf29a('0x8')];this[_0xf29a('0x9')]=_0x3b892f[_0xf29a('0x9')];this[_0xf29a('0xa')]=_0x3b892f[_0xf29a('0xa')];this['outboundDropCallsDayACS']=_0x3b892f[_0xf29a('0x29')];this[_0xf29a('0x2a')]=_0x3b892f[_0xf29a('0x2a')];this[_0xf29a('0x2b')]=_0x3b892f[_0xf29a('0x2b')];this[_0xf29a('0xb')]=_0x3b892f[_0xf29a('0xb')];this['outboundNoSuchCallsDay']=_0x3b892f[_0xf29a('0x2c')];this['outboundOriginateFailureCallsDay']=_0x3b892f[_0xf29a('0x2d')];this[_0xf29a('0xc')]=_0x3b892f[_0xf29a('0xc')];this[_0xf29a('0xd')]=_0x3b892f[_0xf29a('0xd')];this['outboundUnknownCallsDay']=_0x3b892f[_0xf29a('0xe')];this['predictiveIntervalAnsweredCalls']=_0x3b892f[_0xf29a('0x2e')];this[_0xf29a('0x2f')]=_0x3b892f['predictiveIntervalAvgHoldtime'];this[_0xf29a('0x30')]=_0x3b892f[_0xf29a('0x30')];this['predictiveIntervalDroppedCallsCallersExit']=_0x3b892f[_0xf29a('0x31')];this[_0xf29a('0x32')]=_0x3b892f[_0xf29a('0x32')];this[_0xf29a('0x33')]=_0x3b892f[_0xf29a('0x33')];this[_0xf29a('0x34')]=_0x3b892f['predictiveIntervalErlangCallsDroppedCalls'];this[_0xf29a('0x35')]=_0x3b892f[_0xf29a('0x35')];this[_0xf29a('0x36')]=_0x3b892f['predictiveIntervalMultiplicativeFactor'];this[_0xf29a('0x37')]=_0x3b892f[_0xf29a('0x37')];this[_0xf29a('0x38')]=_0x3b892f[_0xf29a('0x38')];this[_0xf29a('0x39')]=_0x3b892f[_0xf29a('0x39')];this[_0xf29a('0x3a')]=_0x3b892f[_0xf29a('0x3a')];this[_0xf29a('0x3b')]=_0x3b892f[_0xf29a('0x3b')];this[_0xf29a('0x3c')]=_0x3b892f[_0xf29a('0x3c')];this['erlangAbandonmentRate']=_0x3b892f['erlangAbandonmentRate'];this[_0xf29a('0x3d')]=_0x3b892f[_0xf29a('0x3d')];this[_0xf29a('0x3e')]=_0x3b892f['startPredictive'];this[_0xf29a('0x3f')]=_0x3b892f[_0xf29a('0x3f')];this[_0xf29a('0x40')]=_0x3b892f[_0xf29a('0x40')];this[_0xf29a('0x41')]=_0x3b892f[_0xf29a('0x41')];}if(_0x3b892f[_0xf29a('0x42')]){this[_0xf29a('0x42')]={'id':_0x3b892f[_0xf29a('0x42')]['id'],'name':_0x3b892f[_0xf29a('0x42')][_0xf29a('0x13')],'active':_0x3b892f['Trunk'][_0xf29a('0x43')],'callerid':_0x3b892f['Trunk'][_0xf29a('0x44')]};}}VoiceQueueSummary[_0xf29a('0x45')]['createReport']=function(_0x492d41,_0x5cf180,_0x36f0f3,_0x15ce1e){this[_0xf29a('0x2')]=0x0;this[_0xf29a('0x4')]=0x0;this[_0xf29a('0x1a')]=0x0;this['unknown']=0x0;this[_0xf29a('0x19')]=0x0;this[_0xf29a('0x5')]=0x0;this[_0xf29a('0x46')]=0x0;this[_0xf29a('0x17')]=0x0;this['unavailable']=0x0;this[_0xf29a('0x3')]=0x0;this[_0xf29a('0x1b')]=0x0;this[_0xf29a('0x18')]=0x0;if(_0x36f0f3){if(_0x36f0f3[_0xf29a('0x0')]){this[_0xf29a('0x0')]=Number(_0x36f0f3[_0xf29a('0x0')]);}if(_0x36f0f3[_0xf29a('0x47')]){this[_0xf29a('0x1')]=Number(_0x36f0f3[_0xf29a('0x47')]);}if(_0x36f0f3[_0xf29a('0x48')]){this[_0xf29a('0x12')]=Number(_0x36f0f3[_0xf29a('0x48')]);}}for(var _0x340c9c=0x0;_0x340c9c<_0x492d41[_0xf29a('0x49')];_0x340c9c++){var _0x451f31=_0x5cf180[_0xf29a('0x4a')+_0x492d41[_0x340c9c][_0xf29a('0x13')]];if(_0x451f31&&_0x451f31[_0xf29a('0x4b')]){this[_0xf29a('0x2')]+=0x1;}if(_0x492d41[_0x340c9c][_0xf29a('0x4c')]==='1'){this['talking']+=0x1;}if(_0x492d41[_0x340c9c]['paused']==='1'&&!['2','7','8'][_0xf29a('0x4d')](_0x492d41[_0x340c9c][_0xf29a('0x4e')])){this[_0xf29a('0x1a')]+=0x1;}switch(_0x492d41[_0x340c9c][_0xf29a('0x4e')]){case'0':this[_0xf29a('0x1f')]+=0x1;break;case'1':this[_0xf29a('0x19')]+=0x1;break;case'2':this[_0xf29a('0x5')]+=0x1;break;case'3':this[_0xf29a('0x46')]+=0x1;break;case'4':this[_0xf29a('0x17')]+=0x1;break;case'5':this[_0xf29a('0x1e')]+=0x1;break;case'6':this[_0xf29a('0x3')]+=0x1;break;case'7':this[_0xf29a('0x1b')]+=0x1;break;case'8':this[_0xf29a('0x18')]+=0x1;break;}}if(this[_0xf29a('0x23')]===_0xf29a('0x4f')){var _0x2c1e95=Object[_0xf29a('0x50')](_0x15ce1e);for(var _0x2ba2f0=0x0;_0x2ba2f0<_0x2c1e95[_0xf29a('0x49')];_0x2ba2f0++){var _0x26de80=_0x2c1e95[_0x2ba2f0];var _0x269025=_0x15ce1e[_0x26de80];if(_0x269025[_0xf29a('0x51')]===this['name']&&_0x269025[_0xf29a('0x1d')]===_0xf29a('0x52')&&_0x269025[_0xf29a('0x53')]===_0xf29a('0x54')){this[_0xf29a('0x4')]+=0x1;}}if(this['talking']>this[_0xf29a('0x5')]){this[_0xf29a('0x4')]=this[_0xf29a('0x5')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x4d1187){var _0x20e9ee=![];if(_0x4d1187){_0x20e9ee=INBOUND_COUNTERS['some'](function(_0x5f0f1c){return this[_0x5f0f1c]!==_0x4d1187[_0x5f0f1c];},this);}return _0x20e9ee;};VoiceQueueSummary[_0xf29a('0x45')][_0xf29a('0x55')]=function(_0x53c89c){var _0x1c9459=![];var _0x3760ae=![];var _0x48d7f3=![];if(_0x53c89c){_0x1c9459=this['dialMethod']!==_0x53c89c['dialMethod']||this[_0xf29a('0x22')]!==_0x53c89c[_0xf29a('0x22')]||this[_0xf29a('0x40')]!==_0x53c89c[_0xf29a('0x40')]||this[_0xf29a('0x41')]!==_0x53c89c[_0xf29a('0x41')];_0x3760ae=OUTBOUND_COUNTERS['some'](function(_0x213d5){return this[_0x213d5]!==_0x53c89c[_0x213d5];},this);if(this[_0xf29a('0x42')]&&_0x53c89c[_0xf29a('0x42')]){_0x48d7f3=this[_0xf29a('0x42')][_0xf29a('0x13')]!==_0x53c89c[_0xf29a('0x42')][_0xf29a('0x13')]||this[_0xf29a('0x42')][_0xf29a('0x43')]!==_0x53c89c['Trunk']['active'];}}return _0x1c9459||_0x3760ae||_0x48d7f3;};VoiceQueueSummary[_0xf29a('0x45')][_0xf29a('0x56')]=function(_0x839ab5){this[_0xf29a('0x16')]=_0x839ab5['answered'];this['message']=_0x839ab5['message'];this[_0xf29a('0x41')]=_0x839ab5[_0xf29a('0x41')];this[_0xf29a('0x3a')]=_0x839ab5[_0xf29a('0x3a')];this['outboundAbandonedCallsDay']=_0x839ab5[_0xf29a('0x6')];this[_0xf29a('0x7')]=_0x839ab5[_0xf29a('0x7')];this[_0xf29a('0x8')]=_0x839ab5['outboundBlacklistCallsDay'];this[_0xf29a('0x9')]=_0x839ab5['outboundBusyCallsDay'];this[_0xf29a('0xa')]=_0x839ab5[_0xf29a('0xa')];this[_0xf29a('0xb')]=_0x839ab5[_0xf29a('0xb')];this[_0xf29a('0x2c')]=_0x839ab5[_0xf29a('0x2c')];this[_0xf29a('0xc')]=_0x839ab5[_0xf29a('0xc')];this['outboundRejectCallsDay']=_0x839ab5[_0xf29a('0xd')];this[_0xf29a('0xe')]=_0x839ab5[_0xf29a('0xe')];this[_0xf29a('0xf')]=_0x839ab5[_0xf29a('0xf')];this[_0xf29a('0x10')]=_0x839ab5[_0xf29a('0x10')];this['total']=_0x839ab5[_0xf29a('0x11')];if(this[_0xf29a('0x23')]===_0xf29a('0x57')){this['pTalking']=_0x839ab5[_0xf29a('0x21')];}};module[_0xf29a('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0xbea5=['startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','createReport','invalid','loggedin','callers','length','SIP/','incall','includes','status','dialMethod','booked','dialer','exten','prototype','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedIn','paused','ringing','talking','waiting','originated','outboundBlacklistCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','inUse','loggedInDb','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','pTalking','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xbea5,0x177));var _0x5bea=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0xbea5[_0x1e2080];return _0x260111;};'use strict';var INBOUND_COUNTERS=[_0x5bea('0x0'),_0x5bea('0x1'),'loggedInDb',_0x5bea('0x2'),_0x5bea('0x3'),_0x5bea('0x4'),_0x5bea('0x5')];var OUTBOUND_COUNTERS=[_0x5bea('0x0'),'answered','inUse',_0x5bea('0x1'),'loggedInDb',_0x5bea('0x6'),'outboundAbandonedCallsDay','outboundAnswerCallsDay',_0x5bea('0x7'),'outboundBusyCallsDay','outboundCongestionCallsDay',_0x5bea('0x8'),_0x5bea('0x9'),_0x5bea('0xa'),'outboundRejectCallsDay',_0x5bea('0xb'),'paused','pTalking',_0x5bea('0x4'),_0x5bea('0xc'),_0x5bea('0xd'),_0x5bea('0xe'),_0x5bea('0x5')];function VoiceQueueSummary(_0x386f92){this['id']=_0x386f92['id'];this['name']=_0x386f92[_0x5bea('0xf')];this[_0x5bea('0x10')]=_0x386f92['strategy'];this[_0x5bea('0x11')]=_0x386f92[_0x5bea('0x11')]||0x0;this['answered']=_0x386f92[_0x5bea('0x12')]||0x0;this[_0x5bea('0x0')]=_0x386f92[_0x5bea('0x0')]||0x0;this[_0x5bea('0x13')]=_0x386f92[_0x5bea('0x13')]||0x0;this[_0x5bea('0x14')]=_0x386f92[_0x5bea('0x14')]||0x0;this['invalid']=_0x386f92['invalid']||0x0;this[_0x5bea('0x1')]=_0x386f92[_0x5bea('0x1')]||0x0;this[_0x5bea('0x15')]=_0x386f92['loggedInDb']||0x0;this[_0x5bea('0x16')]=_0x386f92[_0x5bea('0x16')]||0x0;this[_0x5bea('0x17')]=_0x386f92['notInUse']||0x0;this[_0x5bea('0x2')]=_0x386f92[_0x5bea('0x2')]||0x0;this['ringing']=_0x386f92[_0x5bea('0x3')]||0x0;this['ringInUse']=_0x386f92[_0x5bea('0x18')];this[_0x5bea('0xc')]=_0x386f92[_0x5bea('0xc')];this['sumDuration']=_0x386f92['sumDuration'];this[_0x5bea('0x19')]=_0x386f92[_0x5bea('0x19')]||0x0;this[_0x5bea('0x4')]=_0x386f92['talking']||0x0;this[_0x5bea('0xe')]=_0x386f92[_0x5bea('0xe')]||0x0;this[_0x5bea('0x1a')]=_0x386f92[_0x5bea('0x1a')];this['unavailable']=_0x386f92[_0x5bea('0x1b')]||0x0;this[_0x5bea('0x1c')]=_0x386f92[_0x5bea('0x1c')]||0x0;this[_0x5bea('0x1d')]=_0x386f92['unmanaged']||0x0;this[_0x5bea('0x5')]=_0x386f92['waiting']||0x0;if(_0x386f92[_0x5bea('0x1a')]==='outbound'){this[_0x5bea('0x1e')]=_0x386f92[_0x5bea('0x1e')]||0x0;this[_0x5bea('0x1f')]=_0x386f92[_0x5bea('0x1f')];this['dialMethod']=_0x386f92['dialMethod'];this['dialOriginateCallerIdName']=_0x386f92[_0x5bea('0x20')];this[_0x5bea('0x21')]=_0x386f92['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x386f92[_0x5bea('0x22')];this[_0x5bea('0x23')]=_0x386f92['dialPrefix'];this[_0x5bea('0x24')]=_0x386f92['temp'];this['outboundAnswerAgiCallsDay']=_0x386f92[_0x5bea('0x25')];this[_0x5bea('0x26')]=_0x386f92[_0x5bea('0x26')];this[_0x5bea('0x7')]=_0x386f92[_0x5bea('0x7')];this[_0x5bea('0x27')]=_0x386f92[_0x5bea('0x27')];this[_0x5bea('0x28')]=_0x386f92[_0x5bea('0x28')];this['outboundDropCallsDayACS']=_0x386f92['outboundDropCallsDayACS'];this[_0x5bea('0x29')]=_0x386f92[_0x5bea('0x29')];this[_0x5bea('0x2a')]=_0x386f92[_0x5bea('0x2a')];this['outboundNoAnswerCallsDay']=_0x386f92[_0x5bea('0x8')];this[_0x5bea('0x9')]=_0x386f92[_0x5bea('0x9')];this[_0x5bea('0x2b')]=_0x386f92['outboundOriginateFailureCallsDay'];this[_0x5bea('0xa')]=_0x386f92[_0x5bea('0xa')];this[_0x5bea('0x2c')]=_0x386f92['outboundRejectCallsDay'];this[_0x5bea('0xb')]=_0x386f92[_0x5bea('0xb')];this[_0x5bea('0x2d')]=_0x386f92[_0x5bea('0x2d')];this[_0x5bea('0x2e')]=_0x386f92[_0x5bea('0x2e')];this['predictiveIntervalAvgTalktime']=_0x386f92['predictiveIntervalAvgTalktime'];this[_0x5bea('0x2f')]=_0x386f92[_0x5bea('0x2f')];this['predictiveIntervalDroppedCallsTimeout']=_0x386f92[_0x5bea('0x30')];this['predictiveIntervalErlangCalls']=_0x386f92[_0x5bea('0x31')];this[_0x5bea('0x32')]=_0x386f92['predictiveIntervalErlangCallsDroppedCalls'];this[_0x5bea('0x33')]=_0x386f92[_0x5bea('0x33')];this[_0x5bea('0x34')]=_0x386f92['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x386f92[_0x5bea('0x35')];this[_0x5bea('0x36')]=_0x386f92[_0x5bea('0x36')];this[_0x5bea('0x37')]=_0x386f92[_0x5bea('0x37')];this['originated']=_0x386f92[_0x5bea('0x6')];this['erlangCalls']=_0x386f92[_0x5bea('0x38')];this[_0x5bea('0x39')]=_0x386f92[_0x5bea('0x39')];this[_0x5bea('0x3a')]=_0x386f92[_0x5bea('0x3a')];this['erlangBusyFactor']=_0x386f92[_0x5bea('0x3b')];this[_0x5bea('0x3c')]=_0x386f92[_0x5bea('0x3c')];this[_0x5bea('0x3d')]=_0x386f92['startProgressive'];this[_0x5bea('0x3e')]=_0x386f92[_0x5bea('0x3e')];this[_0x5bea('0x3f')]=_0x386f92[_0x5bea('0x3f')];}if(_0x386f92[_0x5bea('0x40')]){this['Trunk']={'id':_0x386f92[_0x5bea('0x40')]['id'],'name':_0x386f92[_0x5bea('0x40')]['name'],'active':_0x386f92[_0x5bea('0x40')][_0x5bea('0x41')],'callerid':_0x386f92[_0x5bea('0x40')][_0x5bea('0x42')]};}}VoiceQueueSummary['prototype'][_0x5bea('0x43')]=function(_0x2e1976,_0xb805ab,_0x3690f0,_0x45c7bd){this[_0x5bea('0x15')]=0x0;this['talking']=0x0;this[_0x5bea('0x2')]=0x0;this['unknown']=0x0;this[_0x5bea('0x17')]=0x0;this[_0x5bea('0x14')]=0x0;this[_0x5bea('0x13')]=0x0;this[_0x5bea('0x44')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x5bea('0x16')]=0x0;if(_0x3690f0){if(_0x3690f0[_0x5bea('0x0')]){this[_0x5bea('0x0')]=Number(_0x3690f0['available']);}if(_0x3690f0[_0x5bea('0x45')]){this[_0x5bea('0x1')]=Number(_0x3690f0[_0x5bea('0x45')]);}if(_0x3690f0['callers']){this['waiting']=Number(_0x3690f0[_0x5bea('0x46')]);}}for(var _0x48355b=0x0;_0x48355b<_0x2e1976[_0x5bea('0x47')];_0x48355b++){var _0x2fea06=_0xb805ab[_0x5bea('0x48')+_0x2e1976[_0x48355b][_0x5bea('0xf')]];if(_0x2fea06&&_0x2fea06['online']){this[_0x5bea('0x15')]+=0x1;}if(_0x2e1976[_0x48355b][_0x5bea('0x49')]==='1'){this[_0x5bea('0x4')]+=0x1;}if(_0x2e1976[_0x48355b][_0x5bea('0x2')]==='1'&&!['2','7','8'][_0x5bea('0x4a')](_0x2e1976[_0x48355b]['status'])){this['paused']+=0x1;}switch(_0x2e1976[_0x48355b][_0x5bea('0x4b')]){case'0':this[_0x5bea('0x1c')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x5bea('0x14')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x5bea('0x44')]+=0x1;break;case'5':this[_0x5bea('0x1b')]+=0x1;break;case'6':this[_0x5bea('0x3')]+=0x1;break;case'7':this[_0x5bea('0x18')]+=0x1;break;case'8':this[_0x5bea('0x16')]+=0x1;break;}}if(this[_0x5bea('0x4c')]===_0x5bea('0x4d')){var _0x16771e=Object['keys'](_0x45c7bd);for(var _0x4b6783=0x0;_0x4b6783<_0x16771e['length'];_0x4b6783++){var _0x101a3b=_0x16771e[_0x4b6783];var _0x3c0bc3=_0x45c7bd[_0x101a3b];if(_0x3c0bc3['queue']===this[_0x5bea('0xf')]&&_0x3c0bc3['type']===_0x5bea('0x4e')&&_0x3c0bc3[_0x5bea('0x4f')]==='xcally-motion-preview'){this[_0x5bea('0x4')]+=0x1;}}if(this[_0x5bea('0x4')]>this[_0x5bea('0x14')]){this[_0x5bea('0x4')]=this[_0x5bea('0x14')];}this[_0x5bea('0x1e')]=0x0;}return this;};VoiceQueueSummary[_0x5bea('0x50')]['compareToInboundQueue']=function(_0x2a39a4){var _0x2a4fa4=![];if(_0x2a39a4){_0x2a4fa4=INBOUND_COUNTERS[_0x5bea('0x51')](function(_0x3c4dd2){return this[_0x3c4dd2]!==_0x2a39a4[_0x3c4dd2];},this);}return _0x2a4fa4;};VoiceQueueSummary[_0x5bea('0x50')][_0x5bea('0x52')]=function(_0x4941fe){var _0x3dbf5b=![];var _0x1863df=![];var _0xd0a1e7=![];if(_0x4941fe){_0x3dbf5b=this[_0x5bea('0x4c')]!==_0x4941fe[_0x5bea('0x4c')]||this[_0x5bea('0x1f')]!==_0x4941fe[_0x5bea('0x1f')]||this[_0x5bea('0x3e')]!==_0x4941fe[_0x5bea('0x3e')]||this[_0x5bea('0x3f')]!==_0x4941fe[_0x5bea('0x3f')];_0x1863df=OUTBOUND_COUNTERS[_0x5bea('0x51')](function(_0x117df9){return this[_0x117df9]!==_0x4941fe[_0x117df9];},this);if(this['Trunk']&&_0x4941fe[_0x5bea('0x40')]){_0xd0a1e7=this['Trunk'][_0x5bea('0xf')]!==_0x4941fe[_0x5bea('0x40')][_0x5bea('0xf')]||this[_0x5bea('0x40')]['active']!==_0x4941fe[_0x5bea('0x40')][_0x5bea('0x41')];}}return _0x3dbf5b||_0x1863df||_0xd0a1e7;};VoiceQueueSummary[_0x5bea('0x50')][_0x5bea('0x53')]=function(_0x24f441){this[_0x5bea('0x12')]=_0x24f441[_0x5bea('0x12')];this[_0x5bea('0x3e')]=_0x24f441[_0x5bea('0x3e')];this['statusMessage']=_0x24f441[_0x5bea('0x3f')];this[_0x5bea('0x6')]=_0x24f441[_0x5bea('0x6')];this[_0x5bea('0x54')]=_0x24f441['outboundAbandonedCallsDay'];this[_0x5bea('0x26')]=_0x24f441[_0x5bea('0x26')];this[_0x5bea('0x7')]=_0x24f441[_0x5bea('0x7')];this['outboundBusyCallsDay']=_0x24f441[_0x5bea('0x27')];this[_0x5bea('0x28')]=_0x24f441[_0x5bea('0x28')];this[_0x5bea('0x8')]=_0x24f441['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x24f441[_0x5bea('0x9')];this['outboundReCallsDay']=_0x24f441[_0x5bea('0xa')];this['outboundRejectCallsDay']=_0x24f441[_0x5bea('0x2c')];this['outboundUnknownCallsDay']=_0x24f441[_0x5bea('0xb')];this[_0x5bea('0xc')]=_0x24f441[_0x5bea('0xc')];this[_0x5bea('0xd')]=_0x24f441[_0x5bea('0xd')];this[_0x5bea('0xe')]=_0x24f441[_0x5bea('0xe')];if(this[_0x5bea('0x4c')]===_0x5bea('0x55')){this['pTalking']=_0x24f441['pTalking'];}};module[_0x5bea('0x56')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9634b81..25071d9 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 _0xb8bb=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x4090be,_0x1065d0){var _0x54611e=function(_0x5aea7d){while(--_0x5aea7d){_0x4090be['push'](_0x4090be['shift']());}};_0x54611e(++_0x1065d0);}(_0xb8bb,0x1a5));var _0xbb8b=function(_0x39d484,_0x40c5cb){_0x39d484=_0x39d484-0x0;var _0x75094d=_0xb8bb[_0x39d484];return _0x75094d;};'use strict';function VtigerAccount(_0x5593b8){this['id']=_0x5593b8['id']||0x0;this['name']=_0x5593b8[_0xbb8b('0x0')]||'';this[_0xbb8b('0x1')]=_0x5593b8['username']||'';this[_0xbb8b('0x2')]=_0x5593b8['accessKey']||'';this[_0xbb8b('0x3')]=_0x5593b8[_0xbb8b('0x3')]||'';this[_0xbb8b('0x4')]=_0x5593b8[_0xbb8b('0x4')]||'';this[_0xbb8b('0x5')]=_0x5593b8[_0xbb8b('0x5')]||{};}module[_0xbb8b('0x6')]=VtigerAccount; \ No newline at end of file +var _0x0434=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x288897,_0x1c4166){var _0x33f6aa=function(_0x3a6757){while(--_0x3a6757){_0x288897['push'](_0x288897['shift']());}};_0x33f6aa(++_0x1c4166);}(_0x0434,0xa4));var _0x4043=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x0434[_0x39e283];return _0x7de89f;};'use strict';function VtigerAccount(_0x112bf8){this['id']=_0x112bf8['id']||0x0;this['name']=_0x112bf8[_0x4043('0x0')]||'';this[_0x4043('0x1')]=_0x112bf8['username']||'';this[_0x4043('0x2')]=_0x112bf8[_0x4043('0x2')]||'';this[_0x4043('0x3')]=_0x112bf8[_0x4043('0x3')]||'';this[_0x4043('0x4')]=_0x112bf8[_0x4043('0x4')]||'';this[_0x4043('0x5')]=_0x112bf8[_0x4043('0x5')]||{};}module[_0x4043('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 e7d102d..8e8b5d8 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 _0x8481=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x8481,0x147));var _0x1848=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x8481[_0x5a7e3c];return _0x59252b;};'use strict';function ZendeskAccount(_0x500738){this['id']=_0x500738['id']||0x0;this[_0x1848('0x0')]=_0x500738['name']||'';this[_0x1848('0x1')]=_0x500738[_0x1848('0x1')]||'';this[_0x1848('0x2')]=_0x500738[_0x1848('0x2')]||'';this['token']=_0x500738[_0x1848('0x3')]||'';this[_0x1848('0x4')]=_0x500738[_0x1848('0x4')]||'';this[_0x1848('0x5')]=_0x500738[_0x1848('0x5')]||'';this[_0x1848('0x6')]=_0x500738[_0x1848('0x6')]||_0x1848('0x7');this['serverUrl']=_0x500738[_0x1848('0x8')]||'';this[_0x1848('0x9')]=_0x500738[_0x1848('0x9')]||{};}module[_0x1848('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x0e11=['integrationTab','serverUrl','exports','name','username','password','token','authType','type'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0x0e11,0x135));var _0x10e1=function(_0x46734c,_0x52047f){_0x46734c=_0x46734c-0x0;var _0x5a9b4d=_0x0e11[_0x46734c];return _0x5a9b4d;};'use strict';function ZendeskAccount(_0x476910){this['id']=_0x476910['id']||0x0;this[_0x10e1('0x0')]=_0x476910[_0x10e1('0x0')]||'';this[_0x10e1('0x1')]=_0x476910[_0x10e1('0x1')]||'';this['password']=_0x476910[_0x10e1('0x2')]||'';this[_0x10e1('0x3')]=_0x476910[_0x10e1('0x3')]||'';this['remoteUri']=_0x476910['remoteUri']||'';this[_0x10e1('0x4')]=_0x476910[_0x10e1('0x4')]||'';this[_0x10e1('0x5')]=_0x476910[_0x10e1('0x5')]||_0x10e1('0x6');this[_0x10e1('0x7')]=_0x476910[_0x10e1('0x7')]||'';this['Configurations']=_0x476910['Configurations']||{};}module[_0x10e1('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 9069848..ee9ac83 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 _0x23fa=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0x23fa,0xc9));var _0xa23f=function(_0x57c324,_0x55a80e){_0x57c324=_0x57c324-0x0;var _0x57d706=_0x23fa[_0x57c324];return _0x57d706;};'use strict';function ZohoAccount(_0x48b9fd){this['id']=_0x48b9fd['id']||0x0;this['name']=_0x48b9fd[_0xa23f('0x0')]||'';this[_0xa23f('0x1')]=_0x48b9fd['description']||'';this['host']=_0x48b9fd[_0xa23f('0x2')]||'';this['zone']=_0x48b9fd[_0xa23f('0x3')]||'';this[_0xa23f('0x4')]=_0x48b9fd[_0xa23f('0x4')]||'';this[_0xa23f('0x5')]=_0x48b9fd['clientSecret']||'';this[_0xa23f('0x6')]=_0x48b9fd[_0xa23f('0x6')]||'';this[_0xa23f('0x7')]=_0x48b9fd['code']||'';this['refreshToken']=_0x48b9fd[_0xa23f('0x8')]||'';this[_0xa23f('0x9')]=_0x48b9fd[_0xa23f('0x9')]||{};}module[_0xa23f('0xa')]=ZohoAccount; \ No newline at end of file +var _0x654b=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x654b,0x1c2));var _0xb654=function(_0x4d62bc,_0x393272){_0x4d62bc=_0x4d62bc-0x0;var _0x1dea32=_0x654b[_0x4d62bc];return _0x1dea32;};'use strict';function ZohoAccount(_0x4d90f7){this['id']=_0x4d90f7['id']||0x0;this[_0xb654('0x0')]=_0x4d90f7['name']||'';this[_0xb654('0x1')]=_0x4d90f7[_0xb654('0x1')]||'';this[_0xb654('0x2')]=_0x4d90f7[_0xb654('0x2')]||'';this[_0xb654('0x3')]=_0x4d90f7[_0xb654('0x3')]||'';this[_0xb654('0x4')]=_0x4d90f7['clientId']||'';this[_0xb654('0x5')]=_0x4d90f7[_0xb654('0x5')]||'';this[_0xb654('0x6')]=_0x4d90f7['serverUrl']||'';this[_0xb654('0x7')]=_0x4d90f7[_0xb654('0x7')]||'';this[_0xb654('0x8')]=_0x4d90f7[_0xb654('0x8')]||'';this[_0xb654('0x9')]=_0x4d90f7[_0xb654('0x9')]||{};}module[_0xb654('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 b8e12cc..342f906 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 _0x6343=['format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','number','moment','string','isNil','queue','name','type','campaigntype','Agent','channelAgent','membername'];(function(_0xe2e2e1,_0x554a88){var _0x262904=function(_0x484217){while(--_0x484217){_0xe2e2e1['push'](_0xe2e2e1['shift']());}};_0x262904(++_0x554a88);}(_0x6343,0x168));var _0x3634=function(_0x44bc5a,_0x2fce95){_0x44bc5a=_0x44bc5a-0x0;var _0x4a6426=_0x6343[_0x44bc5a];return _0x4a6426;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3634('0x0'));function checkNameSurname(_0x26d852,_0x53a78f,_0x518246){var _0x5a4621='';if(!_['isNil'](_0x53a78f)&&_0x3634('0x1')===typeof _0x53a78f){_0x5a4621+=_0x53a78f;}if(!_[_0x3634('0x2')](_0x518246)&&'string'===typeof _0x518246){_0x5a4621+='\x20'+_0x518246;}if(_0x5a4621!==''){return _0x5a4621;}return _0x26d852;}function Action(_0x247964,_0x388c18,_0x4bb496,_0x302828,_0xd40513){this['uniqueid']=_0x4bb496||undefined;this['idContact']=_0x247964['id'];this[_0x3634('0x3')]=_0x388c18[_0x3634('0x4')];this[_0x3634('0x5')]=_0x388c18[_0x3634('0x5')];this[_0x3634('0x6')]=_0x3634('0x3');this['dialAnswer']=![];this['membername']=_[_0x3634('0x2')](_0x247964[_0x3634('0x7')])?undefined:_0x247964['Agent'][_0x3634('0x4')];this[_0x3634('0x8')]=this[_0x3634('0x9')]?util[_0x3634('0xa')](_0x3634('0xb'),this[_0x3634('0x9')]):_0x302828||undefined;this[_0x3634('0xc')]=checkNameSurname(_0x247964[_0x3634('0xd')][_0x3634('0xe')],_0x247964[_0x3634('0xd')][_0x3634('0xf')],_0x247964[_0x3634('0xd')][_0x3634('0x10')]);this[_0x3634('0x11')]=_0x247964['active']||![];this[_0x3634('0x12')]=_0x247964['phone'];this[_0x3634('0x13')]=_0x247964[_0x3634('0x13')];this[_0x3634('0x14')]=_0x247964[_0x3634('0x14')]||0x0;this[_0x3634('0x15')]=_0x247964['countcongestionretry']||0x0;this[_0x3634('0x16')]=_0x247964['countnoanswerretry']||0x0;this['countglobal']=(_0x247964[_0x3634('0x14')]||0x0)+(_0x247964['countcongestionretry']||0x0)+(_0x247964[_0x3634('0x16')]||0x0)+(_0x247964[_0x3634('0x17')]||0x0)+(_0x247964[_0x3634('0x18')]||0x0)+(_0x247964['countabandonedretry']||0x0)+(_0x247964[_0x3634('0x19')]||0x0)+(_0x247964[_0x3634('0x1a')]||0x0);this['countnosuchnumberretry']=_0x247964[_0x3634('0x17')]||0x0;this['countdropretry']=_0x247964[_0x3634('0x18')]||0x0;this[_0x3634('0x1b')]=_0x247964['countabandonedretry']||0x0;this[_0x3634('0x19')]=_0x247964[_0x3634('0x19')]||0x0;this[_0x3634('0x1a')]=_0x247964['countagentrejectretry']||0x0;this[_0x3634('0x1c')]=_0x247964[_0x3634('0x1c')];this['callbackuniqueid']=_0x247964[_0x3634('0x1d')];this['callbackat']=_0x247964['callbackat'];this[_0x3634('0x1e')]=_0x247964[_0x3634('0x1e')];this['ContactId']=_0x247964[_0x3634('0x1f')];this[_0x3634('0x20')]=_0x247964[_0x3634('0x20')];this[_0x3634('0x21')]=_[_0x3634('0x2')](_0x247964[_0x3634('0x7')])?_0x247964[_0x3634('0x21')]:_0x247964[_0x3634('0x7')]['id'];this[_0x3634('0x22')]=_0x247964['VoiceQueueId'];this[_0x3634('0x23')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x3634('0xa')]('\x22%s\x22\x20<%s>',this[_0x3634('0xc')],this[_0x3634('0x24')]);};module['exports']=Action; \ No newline at end of file +var _0x1775=['countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry'];(function(_0x29ef18,_0x5a68c3){var _0x2f5ee0=function(_0x4caf88){while(--_0x4caf88){_0x29ef18['push'](_0x29ef18['shift']());}};_0x2f5ee0(++_0x5a68c3);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var _=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));function checkNameSurname(_0x6abfb8,_0x2ca33b,_0xaad33e){var _0x38ee08='';if(!_[_0x5177('0x2')](_0x2ca33b)&&_0x5177('0x3')===typeof _0x2ca33b){_0x38ee08+=_0x2ca33b;}if(!_[_0x5177('0x2')](_0xaad33e)&&_0x5177('0x3')===typeof _0xaad33e){_0x38ee08+='\x20'+_0xaad33e;}if(_0x38ee08!==''){return _0x38ee08;}return _0x6abfb8;}function Action(_0x159a20,_0x2c5c42,_0x153c1a,_0x2ac1c6,_0x300b43){this[_0x5177('0x4')]=_0x153c1a||undefined;this[_0x5177('0x5')]=_0x159a20['id'];this[_0x5177('0x6')]=_0x2c5c42[_0x5177('0x7')];this[_0x5177('0x8')]=_0x2c5c42[_0x5177('0x8')];this[_0x5177('0x9')]='queue';this['dialAnswer']=![];this[_0x5177('0xa')]=_[_0x5177('0x2')](_0x159a20[_0x5177('0xb')])?undefined:_0x159a20[_0x5177('0xb')][_0x5177('0x7')];this['channelAgent']=this[_0x5177('0xa')]?util[_0x5177('0xc')](_0x5177('0xd'),this[_0x5177('0xa')]):_0x2ac1c6||undefined;this[_0x5177('0xe')]=checkNameSurname(_0x159a20[_0x5177('0xf')][_0x5177('0x10')],_0x159a20[_0x5177('0xf')][_0x5177('0x11')],_0x159a20[_0x5177('0xf')][_0x5177('0x12')]);this[_0x5177('0x13')]=_0x159a20[_0x5177('0x13')]||![];this[_0x5177('0x14')]=_0x159a20[_0x5177('0x10')];this[_0x5177('0x15')]=_0x159a20[_0x5177('0x15')];this[_0x5177('0x16')]=_0x159a20[_0x5177('0x16')]||0x0;this['countcongestionretry']=_0x159a20[_0x5177('0x17')]||0x0;this[_0x5177('0x18')]=_0x159a20[_0x5177('0x18')]||0x0;this[_0x5177('0x19')]=(_0x159a20['countbusyretry']||0x0)+(_0x159a20[_0x5177('0x17')]||0x0)+(_0x159a20[_0x5177('0x18')]||0x0)+(_0x159a20[_0x5177('0x1a')]||0x0)+(_0x159a20['countdropretry']||0x0)+(_0x159a20[_0x5177('0x1b')]||0x0)+(_0x159a20['countmachineretry']||0x0)+(_0x159a20[_0x5177('0x1c')]||0x0);this[_0x5177('0x1a')]=_0x159a20[_0x5177('0x1a')]||0x0;this[_0x5177('0x1d')]=_0x159a20[_0x5177('0x1d')]||0x0;this[_0x5177('0x1b')]=_0x159a20[_0x5177('0x1b')]||0x0;this[_0x5177('0x1e')]=_0x159a20[_0x5177('0x1e')]||0x0;this[_0x5177('0x1c')]=_0x159a20[_0x5177('0x1c')]||0x0;this[_0x5177('0x1f')]=_0x159a20['callback'];this[_0x5177('0x20')]=_0x159a20['callbackuniqueid'];this[_0x5177('0x21')]=_0x159a20[_0x5177('0x21')];this[_0x5177('0x22')]=_0x159a20[_0x5177('0x22')];this['ContactId']=_0x159a20[_0x5177('0x23')];this['ListId']=_0x159a20['ListId'];this[_0x5177('0x24')]=_[_0x5177('0x2')](_0x159a20['Agent'])?_0x159a20[_0x5177('0x24')]:_0x159a20['Agent']['id'];this[_0x5177('0x25')]=_0x159a20[_0x5177('0x25')];this['originatecalleridnum']='';this[_0x5177('0x26')]='';}Action[_0x5177('0x27')][_0x5177('0x28')]=function(){return util[_0x5177('0xc')](_0x5177('0x29'),this[_0x5177('0xe')],this['number']);};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 8f36674..ac5c1dc 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(_0xfd5ecd,_0x494754){var _0x565122=function(_0x5b7ca6){while(--_0x5b7ca6){_0xfd5ecd['push'](_0xfd5ecd['shift']());}};_0x565122(++_0x494754);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x33880d,_0x462a76){var _0x5ac3de=function(_0xa04308){while(--_0xa04308){_0x33880d['push'](_0x33880d['shift']());}};_0x5ac3de(++_0x462a76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 156b977..c9a9c42 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 _0x5716=['[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','assigned','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','resolve','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled'];(function(_0x16b417,_0x13e846){var _0x7d08ea=function(_0xb82407){while(--_0xb82407){_0x16b417['push'](_0x16b417['shift']());}};_0x7d08ea(++_0x13e846);}(_0x5716,0x11d));var _0x6571=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0x5716[_0x20cc29];return _0x28d513;};'use strict';var util=require(_0x6571('0x0'));var BPromise=require(_0x6571('0x1'));var logger=require(_0x6571('0x2'))(_0x6571('0x3'));var cmHopper=require(_0x6571('0x4'));var cmHopperHistory=require(_0x6571('0x5'));var cmHopperBlack=require(_0x6571('0x6'));var agentReportPreview=require(_0x6571('0x7'));var voiceQueueReport=require(_0x6571('0x8'));function loggerCatch(_0xf8c434){return function(_0xc10299){logger['error'](_0xf8c434,util[_0x6571('0x9')](_0xc10299,{'showHidden':![],'depth':null}));};}function create(_0x29929c){return cmHopperHistory[_0x6571('0xa')](_0x29929c)[_0x6571('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x403274){return BPromise[_0x6571('0xc')]()[_0x6571('0xd')](agentReportPreview[_0x6571('0xa')](_0x403274))[_0x6571('0xb')](loggerCatch(_0x6571('0xe')));}function moveContact(_0x13cdfa){return cmHopper[_0x6571('0xf')](_0x13cdfa,!![])[_0x6571('0xb')](loggerCatch(_0x6571('0x10')));}exports[_0x6571('0x11')]=function(_0x1ccf7a){return cmHopperBlack[_0x6571('0x11')](_0x1ccf7a)['catch'](loggerCatch(_0x6571('0x12')));};exports[_0x6571('0x13')]=function(_0x197e4a){return BPromise[_0x6571('0xc')]()[_0x6571('0xd')](cmHopper['getContactPreview'](_0x197e4a))[_0x6571('0xb')](loggerCatch(_0x6571('0x14')));};exports[_0x6571('0xa')]=function(_0x4d902d,_0x357fa0){create(_0x4d902d)[_0x6571('0xb')](loggerCatch(_0x357fa0));moveContact(_0x4d902d)[_0x6571('0xb')](loggerCatch(_0x357fa0));};exports['createAgentHistory']=function(_0x428b31,_0x4e553c){createAgent(_0x428b31)[_0x6571('0xb')](loggerCatch(_0x4e553c));};exports[_0x6571('0x15')]=function(_0x325da8,_0x3df748){create(_0x325da8)[_0x6571('0xb')](loggerCatch(_0x3df748));};exports['createCustomerFinal']=function(_0xbba530,_0x26f0ad){moveContact(_0xbba530)[_0x6571('0xb')](loggerCatch(_0x26f0ad));};exports[_0x6571('0x16')]=function(_0x5240ff,_0x2b0187,_0x408d9e){if(_0x2b0187){_0x5240ff[_0x6571('0x17')]=null;}if(_0x408d9e){_0x5240ff[_0x6571('0x18')]=![];}return cmHopper['rescheduleContact'](_0x5240ff)['catch'](loggerCatch(_0x6571('0x19')));};exports[_0x6571('0x1a')]=function(_0x166379){return cmHopper[_0x6571('0x1a')](_0x166379)[_0x6571('0xb')](loggerCatch(_0x6571('0x1b')));};exports[_0x6571('0x1c')]=function(_0x206de1){return cmHopper[_0x6571('0x1c')]({'UserId':null},_0x206de1,0x1)['catch'](loggerCatch(_0x6571('0x1d')));};exports[_0x6571('0x1e')]=function(_0x59b760){return cmHopper[_0x6571('0x1c')]({'active':![]},_0x59b760,0x1)[_0x6571('0xb')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x466a23){var _0x463b2a={};_0x463b2a[_0x6571('0x1f')]=_0x466a23['type'];_0x463b2a[_0x6571('0x20')]=_0x466a23['uniqueid'];_0x463b2a[_0x6571('0x21')]=_0x466a23[_0x6571('0x21')];_0x463b2a[_0x6571('0x22')]=_0x466a23[_0x6571('0x22')];_0x463b2a[_0x6571('0x23')]=_0x466a23['queue'];_0x463b2a['queuecallerjoinAt']=_0x466a23[_0x6571('0x24')];_0x463b2a[_0x6571('0x25')]=_0x466a23[_0x6571('0x24')];_0x463b2a['queuecallercomplete']=0x1;_0x463b2a[_0x6571('0x26')]=_0x466a23['endtime'];_0x463b2a[_0x6571('0x27')]=_0x466a23[_0x6571('0x28')];_0x463b2a[_0x6571('0x29')]='from-sip';_0x463b2a[_0x6571('0x2a')]=_0x6571('0x2b');_0x463b2a['holdtime']=0x0;_0x463b2a[_0x6571('0x2c')]=0x1;_0x463b2a['lastAssignedTo']=_0x466a23['membername'];_0x463b2a['queuecallerexitreason']=_0x6571('0x2d');return BPromise[_0x6571('0xc')]()[_0x6571('0xd')](voiceQueueReport[_0x6571('0x2e')](_0x463b2a))['catch'](loggerCatch(_0x6571('0x2f')));};exports['getContactRecallMe']=function(_0xb8ee38,_0x18cba4){return BPromise[_0x6571('0xc')]()[_0x6571('0xd')](cmHopper[_0x6571('0x30')](_0xb8ee38,_0x18cba4))[_0x6571('0xb')](loggerCatch(_0x6571('0x31')));};exports[_0x6571('0x32')]=function(_0x1c802d){return cmHopper[_0x6571('0x16')](_0x1c802d,!![],!![])[_0x6571('0xb')](loggerCatch(_0x6571('0x33')));}; \ No newline at end of file +var _0x90bf=['[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','then','[moveContactManagedDialer]\x20','checkIsBlackList','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90bf,0x12e));var _0xf90b=function(_0x7030f5,_0x4cf872){_0x7030f5=_0x7030f5-0x0;var _0x5b1726=_0x90bf[_0x7030f5];return _0x5b1726;};'use strict';var util=require(_0xf90b('0x0'));var BPromise=require(_0xf90b('0x1'));var logger=require(_0xf90b('0x2'))(_0xf90b('0x3'));var cmHopper=require(_0xf90b('0x4'));var cmHopperHistory=require(_0xf90b('0x5'));var cmHopperBlack=require(_0xf90b('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xf90b('0x7'));function loggerCatch(_0x25bbbb){return function(_0x351236){logger[_0xf90b('0x8')](_0x25bbbb,util[_0xf90b('0x9')](_0x351236,{'showHidden':![],'depth':null}));};}function create(_0x29f971){return cmHopperHistory[_0xf90b('0xa')](_0x29f971)[_0xf90b('0xb')](loggerCatch(_0xf90b('0xc')));}function createAgent(_0x3e354d){return BPromise['resolve']()[_0xf90b('0xd')](agentReportPreview[_0xf90b('0xa')](_0x3e354d))[_0xf90b('0xb')](loggerCatch(_0xf90b('0xc')));}function moveContact(_0x432c2a){return cmHopper['moveContactManagedDialer'](_0x432c2a,!![])[_0xf90b('0xb')](loggerCatch(_0xf90b('0xe')));}exports[_0xf90b('0xf')]=function(_0x3b611b){return cmHopperBlack[_0xf90b('0xf')](_0x3b611b)[_0xf90b('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x1482b8){return BPromise[_0xf90b('0x10')]()[_0xf90b('0xd')](cmHopper['getContactPreview'](_0x1482b8))[_0xf90b('0xb')](loggerCatch(_0xf90b('0x11')));};exports[_0xf90b('0xa')]=function(_0x2f1b15,_0x4985ac){create(_0x2f1b15)[_0xf90b('0xb')](loggerCatch(_0x4985ac));moveContact(_0x2f1b15)[_0xf90b('0xb')](loggerCatch(_0x4985ac));};exports[_0xf90b('0x12')]=function(_0xddb3d7,_0x33c2f9){createAgent(_0xddb3d7)[_0xf90b('0xb')](loggerCatch(_0x33c2f9));};exports[_0xf90b('0x13')]=function(_0x4f188c,_0x163aa8){create(_0x4f188c)['catch'](loggerCatch(_0x163aa8));};exports[_0xf90b('0x14')]=function(_0xfa4545,_0x534881){moveContact(_0xfa4545)[_0xf90b('0xb')](loggerCatch(_0x534881));};exports[_0xf90b('0x15')]=function(_0x288af2,_0x33becc,_0x307378){if(_0x33becc){_0x288af2['UserId']=null;}if(_0x307378){_0x288af2[_0xf90b('0x16')]=![];}return cmHopper[_0xf90b('0x15')](_0x288af2)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x17')));};exports[_0xf90b('0x18')]=function(_0xb89538){return cmHopper[_0xf90b('0x18')](_0xb89538)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x19')));};exports[_0xf90b('0x1a')]=function(_0x339a69){return cmHopper[_0xf90b('0x1a')]({'UserId':null},_0x339a69,0x1)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x1b')));};exports['disableContact']=function(_0x26dfe7){return cmHopper[_0xf90b('0x1a')]({'active':![]},_0x26dfe7,0x1)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x1c')));};exports[_0xf90b('0x1d')]=function(_0x161b19){var _0x5372d5={};_0x5372d5[_0xf90b('0x1e')]=_0x161b19['type'];_0x5372d5[_0xf90b('0x1f')]=_0x161b19[_0xf90b('0x1f')];_0x5372d5[_0xf90b('0x20')]=_0x161b19[_0xf90b('0x20')];_0x5372d5[_0xf90b('0x21')]=_0x161b19[_0xf90b('0x21')];_0x5372d5[_0xf90b('0x22')]=_0x161b19[_0xf90b('0x22')];_0x5372d5['queuecallerjoinAt']=_0x161b19[_0xf90b('0x23')];_0x5372d5[_0xf90b('0x24')]=_0x161b19[_0xf90b('0x23')];_0x5372d5[_0xf90b('0x25')]=0x1;_0x5372d5[_0xf90b('0x26')]=_0x161b19[_0xf90b('0x27')];_0x5372d5[_0xf90b('0x28')]=_0x161b19[_0xf90b('0x29')];_0x5372d5[_0xf90b('0x2a')]=_0xf90b('0x2b');_0x5372d5['exten']=_0xf90b('0x2c');_0x5372d5['holdtime']=0x0;_0x5372d5[_0xf90b('0x2d')]=0x1;_0x5372d5[_0xf90b('0x2e')]=_0x161b19[_0xf90b('0x29')];_0x5372d5[_0xf90b('0x2f')]=_0xf90b('0x30');return BPromise[_0xf90b('0x10')]()[_0xf90b('0xd')](voiceQueueReport[_0xf90b('0x31')](_0x5372d5))[_0xf90b('0xb')](loggerCatch(_0xf90b('0x32')));};exports['getContactRecallMe']=function(_0x488f6a,_0x41c642){return BPromise[_0xf90b('0x10')]()[_0xf90b('0xd')](cmHopper[_0xf90b('0x33')](_0x488f6a,_0x41c642))[_0xf90b('0xb')](loggerCatch(_0xf90b('0x34')));};exports[_0xf90b('0x35')]=function(_0x16e275){return cmHopper[_0xf90b('0x15')](_0x16e275,!![],!![])[_0xf90b('0xb')](loggerCatch(_0xf90b('0x36')));}; \ 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 ec0be2d..dd5956a 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 _0x13f0=['rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isEmpty','string','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','starttime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','logLookAgent','membername','logCustomer','endtime','getSeconds','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','channelAgent','from-sip','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','clone','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13f0,0x138));var _0x013f=function(_0x43db86,_0x34184b){_0x43db86=_0x43db86-0x0;var _0x27bda2=_0x13f0[_0x43db86];return _0x27bda2;};'use strict';var util=require('util');var _=require(_0x013f('0x0'));var moment=require(_0x013f('0x1'));var logger=require(_0x013f('0x2'))(_0x013f('0x3'));var ipAgi=process[_0x013f('0x4')]['XCALLY_IP_AGI']||_0x013f('0x5');var utils=require(_0x013f('0x6'));exports[_0x013f('0x7')]=function(_0x3d356c){return function(_0x291cb6){logger[_0x013f('0x8')](_0x3d356c,util[_0x013f('0x9')](_0x291cb6,{'showHidden':![],'depth':null}));};};exports[_0x013f('0xa')]=function(_0x33af94,_0x53076b){logger[_0x013f('0xb')](_0x33af94,util[_0x013f('0x9')](_0x53076b,{'showHidden':![],'depth':null}));};exports[_0x013f('0xc')]=function(_0x113990,_0x156974){logger['error'](_0x113990,util[_0x013f('0x9')](_0x156974,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x43c11d){return function(_0x3a15b3){logger[_0x013f('0xb')](_0x43c11d,util[_0x013f('0x9')](_0x3a15b3,{'showHidden':![],'depth':null}));};};exports[_0x013f('0xd')]=function(_0xae8fb,_0x29dd4c,_0x1a0d74){return{'message':_0xae8fb,'unlock':_0x29dd4c,'active':_0x1a0d74};};exports[_0x013f('0xe')]=function(_0x47958c,_0x57b76c,_0x44372c){if(!_['isUndefined'](_0x44372c)&&'string'===typeof _0x44372c&&!_[_0x013f('0xf')](_0x44372c)){if(!_['isUndefined'](_0x57b76c)&&_0x013f('0x10')===typeof _0x57b76c&&!_[_0x013f('0xf')](_0x57b76c)){return util[_0x013f('0x11')](_0x013f('0x12'),_0x57b76c,_0x44372c);}return util[_0x013f('0x11')](_0x013f('0x12'),_0x44372c,_0x44372c);}if(!_[_0x013f('0x13')](_0x47958c)&&_0x013f('0x10')===typeof _0x47958c&&!_[_0x013f('0xf')](_0x47958c)){return _0x47958c;}return _0x013f('0x14');};exports[_0x013f('0x15')]=function(_0x43332b){if(_[_0x013f('0x16')](_0x43332b)){return![];}return _0x43332b;};exports['addVariables']=function(_0x37325a,_0x8f150c,_0x46eda2,_0x3101b8,_0xd3f9c1,_0x15c02a){var _0x5e40e0={'XMD-QUEUE':_0x8f150c[_0x013f('0x17')]?_0x8f150c[_0x013f('0x17')][_0x013f('0x18')]:'','XMD-CALLERID':_0x3101b8,'XMD-CALLERID-PREVIEW':_0x15c02a?util[_0x013f('0x11')](_0x013f('0x12'),_0x15c02a['calleridname'],_0x15c02a[_0x013f('0x19')]):_0x3101b8,'XMD-DIALID':_0xd3f9c1,'XMD-CONTACTID':_0x8f150c[_0x013f('0x1a')],'XMD-CDRTYPE':_0x013f('0x1b'),'CALLERID(all)':_0x3101b8,'XMD-VOICEQUEUEID':_0x8f150c[_0x013f('0x1c')],'XMD-DIALCHANNEL':_0x46eda2,'XMD-DIALTIMEOUT':_0x37325a[_0x013f('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x013f('0x11')]('\x22rtTxX%s%s\x22',_0x37325a['dialQueueProject2']?'g':'',_['isEmpty'](_0x37325a[_0x013f('0x1e')])?'':_0x013f('0x1f')),'XMD-DIALURL':_0x37325a[_0x013f('0x20')]||'','XMD-AGI':_0x37325a[_0x013f('0x21')]?util[_0x013f('0x11')](_0x013f('0x22'),ipAgi,_0x37325a[_0x013f('0x21')]):_0x013f('0x23'),'XMD-AGIAFTER':_0x37325a[_0x013f('0x24')]?util[_0x013f('0x11')](_0x013f('0x22'),ipAgi,_0x37325a[_0x013f('0x24')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x15c02a?_0x15c02a[_0x013f('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x15c02a?_0x15c02a['originatecalleridname']:'','XMD-DESTINATION':_0x013f('0x26'),'SIPADDHEADER':_0x013f('0x27')};if(!_[_0x013f('0xf')](_0x37325a[_0x013f('0x1e')])){_0x5e40e0[util['format']('%s',_0x013f('0x28'))]=_0x37325a['monitor_format'];_0x5e40e0[util['format']('%s',_0x013f('0x29'))]=_0xd3f9c1;}return _0x5e40e0;};exports[_0x013f('0x2a')]=function(_0x52f8ff){var _0x5c5aaf={};for(var _0x21dce1 in _0x52f8ff){if(_0x52f8ff[_0x013f('0x2b')](_0x21dce1)){_0x5c5aaf[util[_0x013f('0x11')]('%s',_[_0x013f('0x2c')](_0x21dce1))]=_0x52f8ff[_0x21dce1];}}return{'variables':_0x5c5aaf};};exports[_0x013f('0x2d')]=function(_0x3c795b,_0x3241fb){if(!_[_0x013f('0x16')](_0x3c795b)){if(_0x3c795b[_0x013f('0x2b')]('originated')){if(_0x3c795b[_0x013f('0x2e')]>0x0){_0x3c795b[_0x013f('0x2e')]-=0x1;}else{logger[_0x013f('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3241fb);}}}else{logger[_0x013f('0x8')](_0x013f('0x2f'),_0x3241fb);}};exports[_0x013f('0x30')]=function(_0x459b7f){var _0x6948a8=moment()[_0x013f('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x459b7f[_0x013f('0x31')]=0xd;_0x459b7f[_0x013f('0x32')]='Blacklist';_0x459b7f[_0x013f('0x33')]=_0x6948a8;_0x459b7f['responsetime']=_0x6948a8;_0x459b7f['endtime']=_0x6948a8;};exports[_0x013f('0x34')]=function(_0x23827d,_0x236efa,_0x4c4724){var _0x95b754=moment()[_0x013f('0x11')](_0x013f('0x35'));_0x23827d['state']=_0x236efa;_0x23827d[_0x013f('0x32')]=_0x4c4724;_0x23827d[_0x013f('0x36')]=_0x95b754;_0x23827d[_0x013f('0x37')]=utils['getSeconds'](_0x23827d[_0x013f('0x36')],_0x23827d[_0x013f('0x33')]);};exports[_0x013f('0x38')]=function(_0x8d530f,_0x552668,_0x20e5d9){_0x8d530f[_0x013f('0x39')]=_0x552668;_0x8d530f['UserId']=_0x20e5d9;};exports[_0x013f('0x3a')]=function(_0x113083,_0x5bbbf1,_0x5cb27b){var _0x4c67df=moment()[_0x013f('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x113083['state']=_0x5bbbf1;_0x113083['statedesc']=_0x5cb27b;_0x113083[_0x013f('0x36')]=_0x113083[_0x013f('0x36')]?_0x113083[_0x013f('0x36')]:_0x4c67df;_0x113083['endtime']=_0x113083[_0x013f('0x3b')]?_0x113083[_0x013f('0x3b')]:_0x4c67df;_0x113083[_0x013f('0x37')]=utils[_0x013f('0x3c')](_0x113083[_0x013f('0x36')]||0x0,_0x113083[_0x013f('0x33')]||0x0);_0x113083[_0x013f('0x3d')]=_0x113083['answertime']?utils['getSeconds'](_0x113083['endtime'],_0x113083[_0x013f('0x3e')]):0x0;};exports[_0x013f('0x3f')]=function(_0x514ffa){return _0x514ffa===_0x013f('0x40');};exports[_0x013f('0x41')]=function(_0xf46af2,_0x47ee1f,_0x28bb6c,_0x51b0d8,_0x5d0650){var _0x2ef67f=_0x51b0d8?_0x013f('0x42'):_0xf46af2[_0x013f('0x43')];_0x2ef67f=_0x5d0650?_0x013f('0x44'):_0x2ef67f;return{'actionid':_0xf46af2['uniqueid'],'action':'originate','channel':_0xf46af2[_0x013f('0x45')],'callerid':util[_0x013f('0x11')](_0x013f('0x12'),_0x2ef67f,_0xf46af2['calleridnum']),'Exten':_0x013f('0x26'),'Context':_0x013f('0x46'),'Priority':'1','variable':_0x28bb6c,'timeout':(_0x47ee1f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xf46af2[_0x013f('0x47')]};};exports[_0x013f('0x48')]=function(_0x3a086d){return _0x3a086d[_0x013f('0x49')]+_0x3a086d[_0x013f('0x4a')]+_0x3a086d[_0x013f('0x4b')]+_0x3a086d['countagentrejectretry']+_0x3a086d[_0x013f('0x4c')];};exports['cloneAction']=function(_0x5ccbee){var _0x2da15c=_[_0x013f('0x4d')](_0x5ccbee);_0x2da15c[_0x013f('0x31')]=0xf;_0x2da15c[_0x013f('0x32')]='Global';return _0x2da15c;};exports[_0x013f('0x4e')]=function(_0x22338c,_0x3f7c6a,_0x367b5a){var _0x3c3b07={};_0x3c3b07[_0x3f7c6a]=_0x22338c[_0x3f7c6a];_0x3c3b07[_0x013f('0x4f')]=![];_0x3c3b07[_0x013f('0x50')]=moment()[_0x013f('0x51')](_0x367b5a,_0x013f('0x52'))[_0x013f('0x11')](_0x013f('0x35'));_0x3c3b07['ContactId']=_0x22338c['ContactId'];_0x3c3b07[_0x013f('0x53')]=_0x22338c['ListId'];_0x3c3b07[_0x013f('0x1c')]=_0x22338c[_0x013f('0x1c')]||undefined;return _0x3c3b07;};exports['decrementTalkink']=function(_0x5d0e63,_0x3127ad){if(!_[_0x013f('0x16')](_0x5d0e63)){if(_0x5d0e63[_0x013f('0x54')]>0x0){_0x5d0e63[_0x013f('0x54')]-=0x1;}else{logger[_0x013f('0x8')](_0x3127ad,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x013f('0x8')](_0x3127ad,_0x013f('0x55'));}};exports[_0x013f('0x56')]=function(_0xd182c6){if(_0xd182c6<=0x0){return!![];}return![];};function buildObj(_0x32c27f,_0x5bb8af,_0xa4cb2d){_0x32c27f[_0x013f('0x57')]=_0x5bb8af;_0x32c27f[_0x013f('0x18')]=_0x32c27f[_0x013f('0x58')];_0x32c27f['interface']=_0x32c27f[_0x013f('0x45')];_0x32c27f[_0x013f('0x59')]=_0x013f('0x5a');if(_0xa4cb2d){_0x32c27f['mandatoryDisposition']=_0xa4cb2d[_0x013f('0x5b')];}return _0x32c27f;}exports['buildObj']=buildObj;exports[_0x013f('0x5c')]=function(_0x260606){var _0x5cdd82=[];for(var _0x2e4443 in _0x260606){if(_0x260606[_0x013f('0x2b')](_0x2e4443)){if(!_[_0x013f('0x16')](_0x260606[_0x2e4443])&&_0x260606[_0x2e4443][_0x013f('0x31')]===_0x013f('0x5d')&&_0x260606[_0x2e4443][_0x013f('0x5e')]===_0x013f('0x5f')){_0x5cdd82[_0x013f('0x60')](_0x260606[_0x2e4443]['id']);}}}return _0x5cdd82;};exports['getDiff']=function(_0x29cb6c){var _0x46cdc6=moment()['milliseconds'](0x0);var _0x170ff8=moment(_0x29cb6c)[_0x013f('0x61')](0x0);return _0x46cdc6[_0x013f('0x62')](_0x170ff8,_0x013f('0x63'));};exports[_0x013f('0x64')]=function(_0x4e3568){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e3568['ContactId'],'ListId':_0x4e3568[_0x013f('0x53')],'VoiceQueueId':_0x4e3568[_0x013f('0x1c')]||undefined,'CampaignId':_0x4e3568[_0x013f('0x65')]||undefined};};exports[_0x013f('0x66')]=function(_0x26472d){if(_0x26472d===_0x013f('0x47')||_0x26472d===_0x013f('0x67')||_0x26472d===_0x013f('0x58')||_0x26472d===_0x013f('0x68')||_0x26472d===_0x013f('0x69')||_0x26472d===_0x013f('0x6a')||_0x26472d===_0x013f('0x39')||_0x26472d===_0x013f('0x45')||_0x26472d==='calleridname'||_0x26472d==='active'||_0x26472d===_0x013f('0x19')||_0x26472d===_0x013f('0x50')||_0x26472d===_0x013f('0x49')||_0x26472d===_0x013f('0x4a')||_0x26472d===_0x013f('0x4b')||_0x26472d===_0x013f('0x6b')||_0x26472d==='callback'||_0x26472d===_0x013f('0x6c')||_0x26472d===_0x013f('0x6d')||_0x26472d===_0x013f('0x6e')||_0x26472d===_0x013f('0x1a')||_0x26472d===_0x013f('0x53')||_0x26472d===_0x013f('0x6f')||_0x26472d==='VoiceQueueId'||_0x26472d===_0x013f('0x70')||_0x26472d===_0x013f('0x71')||_0x26472d===_0x013f('0x72')||_0x26472d===_0x013f('0x73')||_0x26472d===_0x013f('0x74')||_0x26472d===_0x013f('0x75')||_0x26472d===_0x013f('0x76')||_0x26472d===_0x013f('0x77')||_0x26472d===_0x013f('0x78')||_0x26472d===_0x013f('0x79')||_0x26472d==='xmd-contactid'||_0x26472d===_0x013f('0x7a')||_0x26472d===_0x013f('0x7b')||_0x26472d===_0x013f('0x7c')||_0x26472d==='xmd-agi'||_0x26472d===_0x013f('0x7d')||_0x26472d===_0x013f('0x7e')||_0x26472d===_0x013f('0x7f')||_0x26472d===_0x013f('0x80')||_0x26472d===_0x013f('0x81')||_0x26472d===_0x013f('0x82')||_0x26472d===_0x013f('0x83')||_0x26472d===_0x013f('0x84')||_0x26472d===_0x013f('0x7d')||_0x26472d===_0x013f('0x7e')||_0x26472d===_0x013f('0x7f')||_0x26472d===_0x013f('0x80')||_0x26472d===_0x013f('0x81')||_0x26472d===_0x013f('0x82')||_0x26472d===_0x013f('0x83')||_0x26472d===_0x013f('0x84')||_0x26472d===_0x013f('0x85')||_0x26472d===_0x013f('0x86')||_0x26472d===_0x013f('0x31')||_0x26472d==='statedesc'){return![];}return!![];};exports[_0x013f('0x87')]=function(_0xf5055c,_0x3ecef1){var _0x17d9f4,_0x265d65,_0x416059;if(_0x3ecef1<=0x0){_0x3ecef1=0x1;}_0x17d9f4=new RegExp(_0x013f('0x88')+_0x3ecef1+'}$');_0x265d65=Math[_0x013f('0x89')](0xa,_0x3ecef1-0x1);_0x416059=Math['pow'](0xa,_0x3ecef1)-0x1;return util[_0x013f('0x11')]('%s',_['replace'](_0xf5055c,_0x17d9f4,_[_0x013f('0x8a')](_0x265d65,_0x416059)));};exports[_0x013f('0x8b')]=function(_0x28c9d8){var _0x59231e=_0x28c9d8[_0x013f('0x8c')](/"(.*?)"/);return _0x59231e?_0x59231e[0x1]:_0x28c9d8;};exports[_0x013f('0x8d')]=function(_0x3de5f5){var _0x5f2cdd=_0x3de5f5[_0x013f('0x8c')](/<(.*?)>/);return _0x5f2cdd?_0x5f2cdd[0x1]:_0x3de5f5;};function buildNoAnswerEventPayload(_0x136d9a,_0x2cb969){var _0x582cc8=buildObj(_0x136d9a,_0x013f('0x8e'));if(!_[_0x013f('0xf')](_0x2cb969[_0x013f('0x8f')])){Object[_0x013f('0x90')](_0x2cb969[_0x013f('0x8f')])[_0x013f('0x91')](function(_0xa0c154){_0x582cc8[_0xa0c154[_0x013f('0x92')]()]=_0x2cb969[_0x013f('0x8f')][_0xa0c154];});}return _0x582cc8;}exports[_0x013f('0x93')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xb184=['calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','membername','UserId','talktime','answertime','getSeconds','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','voice','mandatoryDisposition','buildObj','agentReadyId','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','inspect','logger','loggerError','error','info','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','isActive','isNil','addVariables','Queue','name'];(function(_0x3b44be,_0x396815){var _0x3c6131=function(_0x29be93){while(--_0x29be93){_0x3b44be['push'](_0x3b44be['shift']());}};_0x3c6131(++_0x396815);}(_0xb184,0xf7));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4b18('0x0'));var _=require(_0x4b18('0x1'));var moment=require(_0x4b18('0x2'));var logger=require(_0x4b18('0x3'))(_0x4b18('0x4'));var ipAgi=process['env'][_0x4b18('0x5')]||_0x4b18('0x6');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x4588af){return function(_0x1a58c1){logger['error'](_0x4588af,util[_0x4b18('0x7')](_0x1a58c1,{'showHidden':![],'depth':null}));};};exports[_0x4b18('0x8')]=function(_0x40b000,_0x1fb9ec){logger['info'](_0x40b000,util[_0x4b18('0x7')](_0x1fb9ec,{'showHidden':![],'depth':null}));};exports[_0x4b18('0x9')]=function(_0x4a4e16,_0x892ce2){logger[_0x4b18('0xa')](_0x4a4e16,util[_0x4b18('0x7')](_0x892ce2,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x2caf44){return function(_0x124392){logger[_0x4b18('0xb')](_0x2caf44,util[_0x4b18('0x7')](_0x124392,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x49aa0e,_0x208a59,_0x20f904){return{'message':_0x49aa0e,'unlock':_0x208a59,'active':_0x20f904};};exports[_0x4b18('0xc')]=function(_0x263c38,_0x17869e,_0xafaec8){if(!_[_0x4b18('0xd')](_0xafaec8)&&'string'===typeof _0xafaec8&&!_[_0x4b18('0xe')](_0xafaec8)){if(!_[_0x4b18('0xd')](_0x17869e)&&'string'===typeof _0x17869e&&!_['isEmpty'](_0x17869e)){return util[_0x4b18('0xf')](_0x4b18('0x10'),_0x17869e,_0xafaec8);}return util[_0x4b18('0xf')](_0x4b18('0x10'),_0xafaec8,_0xafaec8);}if(!_['isUndefined'](_0x263c38)&&_0x4b18('0x11')===typeof _0x263c38&&!_[_0x4b18('0xe')](_0x263c38)){return _0x263c38;}return'\x22\x22\x20<>';};exports[_0x4b18('0x12')]=function(_0x472546){if(_[_0x4b18('0x13')](_0x472546)){return![];}return _0x472546;};exports[_0x4b18('0x14')]=function(_0x384832,_0x3f1213,_0x32cab0,_0x9d3111,_0x5ed0c4,_0x5d9c74){var _0xdf74d6={'XMD-QUEUE':_0x3f1213[_0x4b18('0x15')]?_0x3f1213[_0x4b18('0x15')][_0x4b18('0x16')]:'','XMD-CALLERID':_0x9d3111,'XMD-CALLERID-PREVIEW':_0x5d9c74?util['format'](_0x4b18('0x10'),_0x5d9c74[_0x4b18('0x17')],_0x5d9c74[_0x4b18('0x18')]):_0x9d3111,'XMD-DIALID':_0x5ed0c4,'XMD-CONTACTID':_0x3f1213[_0x4b18('0x19')],'XMD-CDRTYPE':_0x4b18('0x1a'),'CALLERID(all)':_0x9d3111,'XMD-VOICEQUEUEID':_0x3f1213[_0x4b18('0x1b')],'XMD-DIALCHANNEL':_0x32cab0,'XMD-DIALTIMEOUT':_0x384832[_0x4b18('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x384832[_0x4b18('0x1d')]?'g':'',_['isEmpty'](_0x384832[_0x4b18('0x1e')])?'':_0x4b18('0x1f')),'XMD-DIALURL':_0x384832[_0x4b18('0x20')]||'','XMD-AGI':_0x384832[_0x4b18('0x21')]?util[_0x4b18('0xf')](_0x4b18('0x22'),ipAgi,_0x384832[_0x4b18('0x21')]):_0x4b18('0x23'),'XMD-AGIAFTER':_0x384832['dialQueueProject2']?util[_0x4b18('0xf')](_0x4b18('0x22'),ipAgi,_0x384832[_0x4b18('0x1d')]):_0x4b18('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x5d9c74?_0x5d9c74[_0x4b18('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d9c74?_0x5d9c74['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x4b18('0xe')](_0x384832[_0x4b18('0x1e')])){_0xdf74d6[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x384832['monitor_format'];_0xdf74d6[util[_0x4b18('0xf')]('%s',_0x4b18('0x25'))]=_0x5ed0c4;}return _0xdf74d6;};exports[_0x4b18('0x26')]=function(_0x4e4d8c){var _0x154b75={};for(var _0x179669 in _0x4e4d8c){if(_0x4e4d8c[_0x4b18('0x27')](_0x179669)){_0x154b75[util['format']('%s',_[_0x4b18('0x28')](_0x179669))]=_0x4e4d8c[_0x179669];}}return{'variables':_0x154b75};};exports[_0x4b18('0x29')]=function(_0x52cb9c,_0x3fe049){if(!_[_0x4b18('0x13')](_0x52cb9c)){if(_0x52cb9c[_0x4b18('0x27')](_0x4b18('0x2a'))){if(_0x52cb9c[_0x4b18('0x2a')]>0x0){_0x52cb9c['originated']-=0x1;}else{logger['error'](_0x4b18('0x2b'),_0x3fe049);}}}else{logger[_0x4b18('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3fe049);}};exports[_0x4b18('0x2c')]=function(_0x5ac312){var _0x52342a=moment()[_0x4b18('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ac312[_0x4b18('0x2d')]=0xd;_0x5ac312[_0x4b18('0x2e')]=_0x4b18('0x2f');_0x5ac312[_0x4b18('0x30')]=_0x52342a;_0x5ac312[_0x4b18('0x31')]=_0x52342a;_0x5ac312[_0x4b18('0x32')]=_0x52342a;};exports['logAgent']=function(_0x3e5737,_0x3d33a1,_0x2c7db4){var _0x1ad5fa=moment()[_0x4b18('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e5737[_0x4b18('0x2d')]=_0x3d33a1;_0x3e5737[_0x4b18('0x2e')]=_0x2c7db4;_0x3e5737['responsetime']=_0x1ad5fa;_0x3e5737[_0x4b18('0x33')]=utils['getSeconds'](_0x3e5737[_0x4b18('0x31')],_0x3e5737[_0x4b18('0x30')]);};exports['logLookAgent']=function(_0x5dfe38,_0x7ab911,_0x490765){_0x5dfe38[_0x4b18('0x34')]=_0x7ab911;_0x5dfe38[_0x4b18('0x35')]=_0x490765;};exports['logCustomer']=function(_0x217634,_0x2b5a98,_0x3a118a){var _0x1b5ec1=moment()[_0x4b18('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x217634['state']=_0x2b5a98;_0x217634[_0x4b18('0x2e')]=_0x3a118a;_0x217634[_0x4b18('0x31')]=_0x217634[_0x4b18('0x31')]?_0x217634[_0x4b18('0x31')]:_0x1b5ec1;_0x217634[_0x4b18('0x32')]=_0x217634[_0x4b18('0x32')]?_0x217634[_0x4b18('0x32')]:_0x1b5ec1;_0x217634['ringtime']=utils['getSeconds'](_0x217634[_0x4b18('0x31')]||0x0,_0x217634[_0x4b18('0x30')]||0x0);_0x217634[_0x4b18('0x36')]=_0x217634[_0x4b18('0x37')]?utils[_0x4b18('0x38')](_0x217634[_0x4b18('0x32')],_0x217634['answertime']):0x0;};exports['isFailure']=function(_0x3b7f03){return _0x3b7f03==='Failure';};exports['variablesAction']=function(_0x5dde6c,_0x57082c,_0x4053e8,_0x39034a,_0x197929){var _0x224c62=_0x39034a?_0x4b18('0x39'):_0x5dde6c[_0x4b18('0x17')];_0x224c62=_0x197929?_0x4b18('0x3a'):_0x224c62;return{'actionid':_0x5dde6c[_0x4b18('0x3b')],'action':_0x4b18('0x3c'),'channel':_0x5dde6c[_0x4b18('0x3d')],'callerid':util['format'](_0x4b18('0x10'),_0x224c62,_0x5dde6c[_0x4b18('0x18')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x4053e8,'timeout':(_0x57082c[_0x4b18('0x3e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5dde6c[_0x4b18('0x3b')]};};exports[_0x4b18('0x3f')]=function(_0x3462fe){return _0x3462fe[_0x4b18('0x40')]+_0x3462fe[_0x4b18('0x41')]+_0x3462fe[_0x4b18('0x42')]+_0x3462fe[_0x4b18('0x43')]+_0x3462fe[_0x4b18('0x44')];};exports['cloneAction']=function(_0x2dfc41){var _0x262491=_[_0x4b18('0x45')](_0x2dfc41);_0x262491[_0x4b18('0x2d')]=0xf;_0x262491[_0x4b18('0x2e')]=_0x4b18('0x46');return _0x262491;};exports[_0x4b18('0x47')]=function(_0x55da54,_0x3e0cff,_0x2a8c05){var _0x30a1fd={};_0x30a1fd[_0x3e0cff]=_0x55da54[_0x3e0cff];_0x30a1fd[_0x4b18('0x48')]=![];_0x30a1fd['scheduledat']=moment()[_0x4b18('0x49')](_0x2a8c05,_0x4b18('0x4a'))[_0x4b18('0xf')](_0x4b18('0x4b'));_0x30a1fd[_0x4b18('0x19')]=_0x55da54[_0x4b18('0x19')];_0x30a1fd[_0x4b18('0x4c')]=_0x55da54[_0x4b18('0x4c')];_0x30a1fd['VoiceQueueId']=_0x55da54[_0x4b18('0x1b')]||undefined;return _0x30a1fd;};exports[_0x4b18('0x4d')]=function(_0x2daf77,_0x2c19c5){if(!_[_0x4b18('0x13')](_0x2daf77)){if(_0x2daf77[_0x4b18('0x4e')]>0x0){_0x2daf77['pTalking']-=0x1;}else{logger[_0x4b18('0xa')](_0x2c19c5,_0x4b18('0x4f'));}}else{logger['error'](_0x2c19c5,_0x4b18('0x50'));}};exports['IsNotLoggedIn']=function(_0x52e126){if(_0x52e126<=0x0){return!![];}return![];};function buildObj(_0x3bc719,_0x2247d3,_0x181312){_0x3bc719[_0x4b18('0x51')]=_0x2247d3;_0x3bc719[_0x4b18('0x16')]=_0x3bc719[_0x4b18('0x52')];_0x3bc719[_0x4b18('0x53')]=_0x3bc719[_0x4b18('0x3d')];_0x3bc719['motionChannel']=_0x4b18('0x54');if(_0x181312){_0x3bc719['mandatoryDisposition']=_0x181312[_0x4b18('0x55')];}return _0x3bc719;}exports[_0x4b18('0x56')]=buildObj;exports[_0x4b18('0x57')]=function(_0x2b7789){var _0x42e37d=[];for(var _0x4b1b56 in _0x2b7789){if(_0x2b7789[_0x4b18('0x27')](_0x4b1b56)){if(!_[_0x4b18('0x13')](_0x2b7789[_0x4b1b56])&&_0x2b7789[_0x4b1b56][_0x4b18('0x2d')]==='not_inuse'&&_0x2b7789[_0x4b1b56][_0x4b18('0x58')]===_0x4b18('0x59')){_0x42e37d[_0x4b18('0x5a')](_0x2b7789[_0x4b1b56]['id']);}}}return _0x42e37d;};exports[_0x4b18('0x5b')]=function(_0x48cac3){var _0xab9738=moment()[_0x4b18('0x5c')](0x0);var _0x54a375=moment(_0x48cac3)[_0x4b18('0x5c')](0x0);return _0xab9738[_0x4b18('0x5d')](_0x54a375,_0x4b18('0x5e'));};exports[_0x4b18('0x5f')]=function(_0x5af843){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5af843[_0x4b18('0x19')],'ListId':_0x5af843[_0x4b18('0x4c')],'VoiceQueueId':_0x5af843['VoiceQueueId']||undefined,'CampaignId':_0x5af843[_0x4b18('0x60')]||undefined};};exports[_0x4b18('0x61')]=function(_0x533d2a){if(_0x533d2a===_0x4b18('0x3b')||_0x533d2a===_0x4b18('0x62')||_0x533d2a==='queue'||_0x533d2a===_0x4b18('0x63')||_0x533d2a===_0x4b18('0x64')||_0x533d2a===_0x4b18('0x65')||_0x533d2a===_0x4b18('0x34')||_0x533d2a==='channelAgent'||_0x533d2a===_0x4b18('0x17')||_0x533d2a==='active'||_0x533d2a===_0x4b18('0x18')||_0x533d2a===_0x4b18('0x66')||_0x533d2a===_0x4b18('0x40')||_0x533d2a===_0x4b18('0x41')||_0x533d2a===_0x4b18('0x42')||_0x533d2a==='countglobal'||_0x533d2a===_0x4b18('0x67')||_0x533d2a===_0x4b18('0x68')||_0x533d2a===_0x4b18('0x69')||_0x533d2a===_0x4b18('0x6a')||_0x533d2a===_0x4b18('0x19')||_0x533d2a===_0x4b18('0x4c')||_0x533d2a===_0x4b18('0x35')||_0x533d2a===_0x4b18('0x1b')||_0x533d2a===_0x4b18('0x6b')||_0x533d2a===_0x4b18('0x6c')||_0x533d2a===_0x4b18('0x6d')||_0x533d2a==='xmd-phone'||_0x533d2a===_0x4b18('0x6e')||_0x533d2a==='xmd-dialurl'||_0x533d2a===_0x4b18('0x6f')||_0x533d2a===_0x4b18('0x70')||_0x533d2a===_0x4b18('0x71')||_0x533d2a===_0x4b18('0x72')||_0x533d2a==='xmd-contactid'||_0x533d2a==='xmd-cdrtype'||_0x533d2a==='xmd-callerid'||_0x533d2a===_0x4b18('0x73')||_0x533d2a===_0x4b18('0x74')||_0x533d2a===_0x4b18('0x75')||_0x533d2a==='rtpaudioqosbridged'||_0x533d2a===_0x4b18('0x76')||_0x533d2a==='rtpaudioqosjitterbridged'||_0x533d2a===_0x4b18('0x77')||_0x533d2a===_0x4b18('0x78')||_0x533d2a===_0x4b18('0x79')||_0x533d2a==='rtpaudioqosrttbridged'||_0x533d2a===_0x4b18('0x75')||_0x533d2a==='rtpaudioqosbridged'||_0x533d2a==='rtpaudioqosjitter'||_0x533d2a===_0x4b18('0x7a')||_0x533d2a===_0x4b18('0x77')||_0x533d2a===_0x4b18('0x78')||_0x533d2a===_0x4b18('0x79')||_0x533d2a==='rtpaudioqosrttbridged'||_0x533d2a===_0x4b18('0x7b')||_0x533d2a===_0x4b18('0x7c')||_0x533d2a===_0x4b18('0x2d')||_0x533d2a===_0x4b18('0x2e')){return![];}return!![];};exports[_0x4b18('0x7d')]=function(_0x4e5d00,_0x24adb7){var _0xbafdce,_0x4df7c8,_0x4d415d;if(_0x24adb7<=0x0){_0x24adb7=0x1;}_0xbafdce=new RegExp('\x5cw{0,'+_0x24adb7+'}$');_0x4df7c8=Math[_0x4b18('0x7e')](0xa,_0x24adb7-0x1);_0x4d415d=Math[_0x4b18('0x7e')](0xa,_0x24adb7)-0x1;return util[_0x4b18('0xf')]('%s',_['replace'](_0x4e5d00,_0xbafdce,_[_0x4b18('0x7f')](_0x4df7c8,_0x4d415d)));};exports[_0x4b18('0x80')]=function(_0x134599){var _0x56ad35=_0x134599[_0x4b18('0x81')](/"(.*?)"/);return _0x56ad35?_0x56ad35[0x1]:_0x134599;};exports[_0x4b18('0x82')]=function(_0x145433){var _0x45713c=_0x145433['match'](/<(.*?)>/);return _0x45713c?_0x45713c[0x1]:_0x145433;};function buildNoAnswerEventPayload(_0x44ae4b,_0x251852){var _0x370df5=buildObj(_0x44ae4b,_0x4b18('0x83'));if(!_[_0x4b18('0xe')](_0x251852['variables'])){Object[_0x4b18('0x84')](_0x251852['variables'])['forEach'](function(_0x2d3996){_0x370df5[_0x2d3996[_0x4b18('0x85')]()]=_0x251852['variables'][_0x2d3996];});}return _0x370df5;}exports[_0x4b18('0x86')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2fcbfef..7507b3a 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 _0x7909=['voicequeuechannel','voicequeuechannelredirect','queueadd','string','number','queuepause','boolean','reload'];(function(_0x46a8ff,_0x8ecc7c){var _0xaa4c09=function(_0x2ad188){while(--_0x2ad188){_0x46a8ff['push'](_0x46a8ff['shift']());}};_0xaa4c09(++_0x8ecc7c);}(_0x7909,0x10a));var _0x9790=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7909[_0x17d9e3];return _0x14192d;};'use strict';exports[_0x9790('0x0')]={'queue':{'type':_0x9790('0x1'),'required':!![]},'interface':{'type':_0x9790('0x1'),'required':!![]},'membername':{'type':_0x9790('0x1'),'required':!![]},'penalty':{'type':_0x9790('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x9790('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x9790('0x3')]={'interface':{'type':_0x9790('0x1'),'required':!![]},'paused':{'type':_0x9790('0x4')},'reason':{'type':_0x9790('0x1'),'required':![]}};exports[_0x9790('0x5')]={'module':{'type':'string','required':![]}};exports[_0x9790('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x9790('0x1'),'required':!![]},'filename':{'type':_0x9790('0x1')},'format':{'type':_0x9790('0x1')},'mixmonitorid':{'type':_0x9790('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x9790('0x1'),'required':!![]}};exports[_0x9790('0x7')]={'uniqueid':{'type':_0x9790('0x1'),'required':!![]},'exten':{'type':_0x9790('0x1'),'required':!![]},'context':{'type':_0x9790('0x1')}}; \ No newline at end of file +var _0x63a9=['queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove'];(function(_0x49990b,_0x13c15f){var _0x6f9811=function(_0x899911){while(--_0x899911){_0x49990b['push'](_0x49990b['shift']());}};_0x6f9811(++_0x13c15f);}(_0x63a9,0x125));var _0x963a=function(_0x371122,_0x590e56){_0x371122=_0x371122-0x0;var _0x421cf6=_0x63a9[_0x371122];return _0x421cf6;};'use strict';exports['queueadd']={'queue':{'type':_0x963a('0x0'),'required':!![]},'interface':{'type':_0x963a('0x0'),'required':!![]},'membername':{'type':_0x963a('0x0'),'required':!![]},'penalty':{'type':_0x963a('0x1'),'required':![]},'paused':{'type':_0x963a('0x2'),'required':![]}};exports[_0x963a('0x3')]={'queue':{'type':_0x963a('0x0'),'required':!![]},'interface':{'type':_0x963a('0x0'),'required':!![]}};exports[_0x963a('0x4')]={'interface':{'type':_0x963a('0x0'),'required':!![]},'paused':{'type':_0x963a('0x2')},'reason':{'type':_0x963a('0x0'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x963a('0x5')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]}};exports[_0x963a('0x6')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]},'filename':{'type':_0x963a('0x0')},'format':{'type':_0x963a('0x0')},'mixmonitorid':{'type':_0x963a('0x0')}};exports[_0x963a('0x7')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]}};exports[_0x963a('0x8')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]},'exten':{'type':_0x963a('0x0'),'required':!![]},'context':{'type':_0x963a('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 50e683b..757127a 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 _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0x0b0e[_0x4b12ae];return _0x16957b;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x139303,_0x295f61){var _0x57af43=function(_0x39b309){while(--_0x39b309){_0x139303['push'](_0x139303['shift']());}};_0x57af43(++_0x295f61);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d719c,_0x59b346){_0x2d719c=_0x2d719c-0x0;var _0x16c7e8=_0xb10b[_0x2d719c];return _0x16c7e8;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 318e6a2..4620bec 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 _0xd1bb=['mergeDBDataToRealtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1bb,0x1a0));var _0xbd1b=function(_0x491b29,_0xd36f81){_0x491b29=_0x491b29-0x0;var _0x5dc75c=_0xd1bb[_0x491b29];return _0x5dc75c;};'use strict';function mergeDBDataToRealtime(_0x516398,_0x3c147b){var _0xef271d=Object['assign']({},_0x516398);for(var _0x5d6519 in _0x3c147b){if(_0xef271d['hasOwnProperty'](_0x5d6519)){_0xef271d[_0x5d6519]=_0x3c147b[_0x5d6519];}}return _0xef271d;}exports[_0xbd1b('0x0')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xbd79=['assign'];(function(_0x2533f4,_0x59837b){var _0x2f8f97=function(_0x5b76ec){while(--_0x5b76ec){_0x2533f4['push'](_0x2533f4['shift']());}};_0x2f8f97(++_0x59837b);}(_0xbd79,0xd3));var _0x9bd7=function(_0xc889e1,_0x438415){_0xc889e1=_0xc889e1-0x0;var _0x17ab9e=_0xbd79[_0xc889e1];return _0x17ab9e;};'use strict';function mergeDBDataToRealtime(_0x4df1f2,_0xd2b113){var _0xd8c9f9=Object[_0x9bd7('0x0')]({},_0x4df1f2);for(var _0x1e1d71 in _0xd2b113){if(_0xd8c9f9['hasOwnProperty'](_0x1e1d71)){_0xd8c9f9[_0x1e1d71]=_0xd2b113[_0x1e1d71];}}return _0xd8c9f9;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index c2facb9..15b0368 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 _0x652e=['outbound','destination','type','dialer','lastdata','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','calleridnum','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','length','monitorFilename','createdAt','exten','connectedlinename','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','getCallType','channel','split','getAgentByInternal'];(function(_0x49cfd1,_0x2bf717){var _0x4d2270=function(_0x38a3ee){while(--_0x38a3ee){_0x49cfd1['push'](_0x49cfd1['shift']());}};_0x4d2270(++_0x2bf717);}(_0x652e,0x1f1));var _0xe652=function(_0xc3154a,_0x2758a4){_0xc3154a=_0xc3154a-0x0;var _0x376b66=_0x652e[_0xc3154a];return _0x376b66;};'use strict';var _=require(_0xe652('0x0'));var moment=require(_0xe652('0x1'));var util=require(_0xe652('0x2'));var config=require(_0xe652('0x3'));var ami=require(_0xe652('0x4'));var RpcVoiceAgentReport=require(_0xe652('0x5'));var RpcVoiceCallReport=require(_0xe652('0x6'));var RpcVoiceDialReport=require(_0xe652('0x7'));var RpcMemberReport=require(_0xe652('0x8'));var RpcVoiceQueueReport=require(_0xe652('0x9'));var RpcVoiceRecording=require(_0xe652('0xa'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xe652('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xe652('0xc'));var UserReport=require(_0xe652('0xd'));function Report(_0x4d8e55){this[_0xe652('0xe')]=_0x4d8e55;this[_0xe652('0xf')]=_0x4d8e55[_0xe652('0xf')];this[_0xe652('0x10')]=_0x4d8e55['telephones'];}Report['prototype'][_0xe652('0x11')]=function(_0x46295b){var _0x3b8b4a=new VoiceQueueReport(this['realtime']);var _0x9c7bfa=new VoiceAgentReport(this[_0xe652('0xe')]);var _0x498a08=new VoiceDialReport(this[_0xe652('0xe')]);var _0x3c8f28=new VoiceCallReport(this['realtime']);var _0x20d8dd=new UserReport(this[_0xe652('0xe')]);if(config[_0xe652('0x12')]&&config[_0xe652('0x12')][_0xe652('0x13')]){ami['on'](_0xe652('0x14'),this[_0xe652('0x15')][_0xe652('0x16')](this));ami['on'](_0xe652('0x17'),this[_0xe652('0x18')]['bind'](this));ami['on'](_0xe652('0x19'),this[_0xe652('0x1a')][_0xe652('0x16')](this));ami['on'](_0xe652('0x1b'),this[_0xe652('0x1c')][_0xe652('0x16')](this));ami['on']('blindtransfer',this[_0xe652('0x1d')][_0xe652('0x16')](this));ami['on'](_0xe652('0x1e'),this[_0xe652('0x1f')][_0xe652('0x16')](this));}};Report[_0xe652('0x20')][_0xe652('0x21')]=function(_0x1b4303){var _0x1445f8;_0x1445f8=_['find'](this[_0xe652('0xf')],function(_0x1a5fe2){return _0x1a5fe2[_0xe652('0x22')]==_0x1b4303||_0x1a5fe2[_0xe652('0x23')]==_0x1b4303;});if(_[_0xe652('0x24')](_0x1445f8)){var _0x5a7af0=_['find'](this[_0xe652('0x10')],function(_0x37e0be){return _0x37e0be[_0xe652('0x22')]==_0x1b4303||_0x37e0be[_0xe652('0x23')]==_0x1b4303;});if(_0x5a7af0){_0x1445f8=_[_0xe652('0x25')](this['agents'],function(_0x1a042e){return _0x1a042e[_0xe652('0x26')]==util[_0xe652('0x27')](_0xe652('0x28'),_0x5a7af0[_0xe652('0x23')]);});}}return _0x1445f8;};Report[_0xe652('0x20')][_0xe652('0x15')]=function(_0xb30823){for(var _0x3431dc=0x0;_0x3431dc<_0xb30823['length'];_0x3431dc+=0x1){var _0x32965f=this[_0xe652('0x21')](_0xb30823[_0x3431dc][_0xe652('0x29')]);if(_0x32965f){_0xb30823[_0x3431dc][_0xe652('0x22')]=_0x32965f[_0xe652('0x22')];_0xb30823[_0x3431dc][_0xe652('0x2a')]=!![];_0xb30823[_0x3431dc][_0xe652('0x2b')]=_0x32965f['name'];_0xb30823[_0x3431dc][_0xe652('0x26')]=_[_0xe652('0x24')](_0x32965f[_0xe652('0x26')])?util[_0xe652('0x27')](_0xe652('0x28'),_0x32965f[_0xe652('0x23')]):_0x32965f[_0xe652('0x26')];if(_0xb30823[_0x3431dc]['queuecallercomplete']){_0xb30823[_0x3431dc][_0xe652('0x2c')]=moment()[_0xe652('0x27')](_0xe652('0x2d'));}if(_0xb30823[_0x3431dc][_0xe652('0x2e')]){_0xb30823[_0x3431dc][_0xe652('0x2f')]=moment()[_0xe652('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xe652('0x15')](_0xb30823[_0x3431dc]);}RpcVoiceQueueReport[_0xe652('0x30')](_0xb30823[_0x3431dc]);}};function extractCalleridNumber(_0x5b826a){var _0x59d595=_0x5b826a[_0xe652('0x31')](/<(.*?)>/);return _0x59d595?_0x59d595[0x1]:_0x5b826a;}Report[_0xe652('0x20')]['getAgentByInternal']=function(_0x1d328f){for(var _0x2494d3=0x0;_0x2494d3',_0x29aec1[_0xe652('0x46')],_0x29aec1[_0xe652('0x45')]);}if(RpcVoiceTransferReport[_0xe652('0x47')][_0x29aec1[_0xe652('0x48')]]){var _0x56e200=RpcVoiceTransferReport[_0xe652('0x47')][_0x29aec1[_0xe652('0x48')]];_0x56e200[_0xe652('0x49')]=_0x29aec1[_0xe652('0x4a')];RpcVoiceTransferReport[_0xe652('0x1d')](_0x56e200);delete RpcVoiceTransferReport[_0xe652('0x47')][_0x29aec1[_0xe652('0x48')]];}if(_[_0xe652('0x24')](_0x29aec1[_0xe652('0x39')])){_0x29aec1[_0xe652('0x39')]=this[_0xe652('0x33')](_0x29aec1);}if(_['isNil'](_0x29aec1[_0xe652('0x4b')])){var _0x123cb5=_0x29aec1[_0xe652('0x34')]['split']('-')[0x0];var _0x4f5ca0=this[_0xe652('0xf')][_0x123cb5];if(!_0x4f5ca0)_0x4f5ca0=this['getAgentByInternal'](_0x29aec1[_0xe652('0x22')]);if(_0x4f5ca0){_0x29aec1['UserId']=_0x4f5ca0['id'];_0x29aec1[_0xe652('0x4c')]=_0x4f5ca0[_0xe652('0x23')];}}RpcVoiceCallReport[_0xe652('0x30')](_0x29aec1);if(_0x29aec1[_0xe652('0x4d')]){for(var _0x1cd3b8=0x0;_0x1cd3b8<_0x29aec1[_0xe652('0x4e')][_0xe652('0x4f')];_0x1cd3b8+=0x1){_0x29aec1[_0xe652('0x50')]=_0x29aec1[_0xe652('0x4e')][_0x1cd3b8]['filename'];_0x29aec1[_0xe652('0x51')]=_0x29aec1[_0xe652('0x4e')][_0x1cd3b8]['createdAt'];if(_0x29aec1[_0xe652('0x52')]==_0xe652('0x41')){_0x29aec1[_0xe652('0x45')]=_0x29aec1[_0xe652('0x29')];_0x29aec1[_0xe652('0x46')]=_0x29aec1[_0xe652('0x53')];_0x29aec1[_0xe652('0x29')]=_0x29aec1[_0xe652('0x22')];_0x29aec1[_0xe652('0x53')]=_0x29aec1[_0xe652('0x4c')];_0x29aec1[_0xe652('0x52')]=_0x29aec1[_0xe652('0x43')];}else if(_0x29aec1['exten']=='xcally-motion-dialer'){_0x29aec1[_0xe652('0x45')]=_0x29aec1['destination'];_0x29aec1[_0xe652('0x52')]=_0x29aec1['originatecalleridnum'];}RpcVoiceRecording[_0xe652('0x30')](_0x29aec1);}}};Report[_0xe652('0x20')][_0xe652('0x1a')]=function(_0x26db83){if(_[_0xe652('0x54')](_0x26db83)){_0x26db83[_0xe652('0x55')](function(_0x14e94b){RpcVoiceAgentReport['create'](_0x14e94b);});}else{RpcVoiceAgentReport[_0xe652('0x30')](_0x26db83);}};Report[_0xe652('0x20')][_0xe652('0x1c')]=function(_0x54a7f2){RpcVoiceDialReport['create'](_0x54a7f2);var _0x46bac1;var _0x1b231c;var _0x5ced65=_0x54a7f2['channel'];if(_[_0xe652('0x56')](_0x5ced65,'Local')){_0x1b231c=_0x5ced65[_0xe652('0x57')](_0x5ced65[_0xe652('0x58')]('/')+0x1,_0x5ced65[_0xe652('0x58')]('@'));_0x46bac1=_['find'](this[_0xe652('0xf')],function(_0x17f6d8){return _0x17f6d8[_0xe652('0x59')]==_0x1b231c||_0x17f6d8[_0xe652('0x5a')]==_0x1b231c||_0x17f6d8[_0xe652('0x22')]==_0x1b231c;});}else{_0x1b231c=_0x5ced65['substring'](_0x5ced65[_0xe652('0x58')]('/')+0x1,_0x5ced65[_0xe652('0x5b')]('-'));_0x46bac1=this['findAgent'](_0x1b231c);}if(_0x46bac1){_0x54a7f2[_0xe652('0x26')]=_[_0xe652('0x24')](_0x46bac1[_0xe652('0x26')])?util[_0xe652('0x27')](_0xe652('0x28'),_0x46bac1[_0xe652('0x23')]):_0x46bac1['interface'];_0x54a7f2[_0xe652('0x4c')]=_0x46bac1['name'];_0x54a7f2[_0xe652('0x22')]=_0x46bac1[_0xe652('0x22')];RpcMemberReport[_0xe652('0x1c')](_0x54a7f2);}};Report[_0xe652('0x20')][_0xe652('0x1d')]=function(_0x34d39f){RpcVoiceTransferReport[_0xe652('0x47')][_0x34d39f['transfererlinkedid']]=_0x34d39f;};Report[_0xe652('0x20')]['attendedTransfer']=function(_0xe43cf5){RpcVoiceTransferReport[_0xe652('0x1f')](_0xe43cf5);};module['exports']=Report; \ No newline at end of file +var _0x3dff=['UserId','membername','monitor','monitors','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','prototype','sync','xdr','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','telephones','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','destinationchannel','ANSWERED','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3dff,0x130));var _0xf3df=function(_0x26094d,_0x2c9402){_0x26094d=_0x26094d-0x0;var _0x177d02=_0x3dff[_0x26094d];return _0x177d02;};'use strict';var _=require(_0xf3df('0x0'));var moment=require(_0xf3df('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0xf3df('0x2'));var RpcVoiceAgentReport=require(_0xf3df('0x3'));var RpcVoiceCallReport=require(_0xf3df('0x4'));var RpcVoiceDialReport=require(_0xf3df('0x5'));var RpcMemberReport=require(_0xf3df('0x6'));var RpcVoiceQueueReport=require(_0xf3df('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xf3df('0x8'));var VoiceQueueReport=require(_0xf3df('0x9'));var VoiceCallReport=require(_0xf3df('0xa'));var VoiceAgentReport=require(_0xf3df('0xb'));var VoiceDialReport=require(_0xf3df('0xc'));var UserReport=require(_0xf3df('0xd'));function Report(_0x4e077c){this[_0xf3df('0xe')]=_0x4e077c;this[_0xf3df('0xf')]=_0x4e077c['agents'];this['telephones']=_0x4e077c['telephones'];}Report[_0xf3df('0x10')][_0xf3df('0x11')]=function(_0x499f7c){var _0xba890d=new VoiceQueueReport(this[_0xf3df('0xe')]);var _0x5d73d4=new VoiceAgentReport(this[_0xf3df('0xe')]);var _0x4a1c13=new VoiceDialReport(this[_0xf3df('0xe')]);var _0x2a05b6=new VoiceCallReport(this['realtime']);var _0x4d1b5a=new UserReport(this['realtime']);if(config[_0xf3df('0x12')]&&config[_0xf3df('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xf3df('0x13')]['bind'](this));ami['on'](_0xf3df('0x14'),this[_0xf3df('0x15')][_0xf3df('0x16')](this));ami['on'](_0xf3df('0x17'),this[_0xf3df('0x18')][_0xf3df('0x16')](this));ami['on']('custom:voiceDialReport',this[_0xf3df('0x19')][_0xf3df('0x16')](this));ami['on']('blindtransfer',this[_0xf3df('0x1a')][_0xf3df('0x16')](this));ami['on'](_0xf3df('0x1b'),this[_0xf3df('0x1c')]['bind'](this));}};Report[_0xf3df('0x10')][_0xf3df('0x1d')]=function(_0x5f3757){var _0x1f6886;_0x1f6886=_[_0xf3df('0x1e')](this[_0xf3df('0xf')],function(_0x1ba25b){return _0x1ba25b['accountcode']==_0x5f3757||_0x1ba25b['name']==_0x5f3757;});if(_[_0xf3df('0x1f')](_0x1f6886)){var _0x3fa4cb=_[_0xf3df('0x1e')](this[_0xf3df('0x20')],function(_0x2e6fa1){return _0x2e6fa1[_0xf3df('0x21')]==_0x5f3757||_0x2e6fa1[_0xf3df('0x22')]==_0x5f3757;});if(_0x3fa4cb){_0x1f6886=_[_0xf3df('0x1e')](this[_0xf3df('0xf')],function(_0x7ffa55){return _0x7ffa55[_0xf3df('0x23')]==util[_0xf3df('0x24')](_0xf3df('0x25'),_0x3fa4cb['name']);});}}return _0x1f6886;};Report[_0xf3df('0x10')][_0xf3df('0x13')]=function(_0x3e84ea){for(var _0x3b9143=0x0;_0x3b9143<_0x3e84ea[_0xf3df('0x26')];_0x3b9143+=0x1){var _0x52232c=this[_0xf3df('0x1d')](_0x3e84ea[_0x3b9143][_0xf3df('0x27')]);if(_0x52232c){_0x3e84ea[_0x3b9143][_0xf3df('0x21')]=_0x52232c[_0xf3df('0x21')];_0x3e84ea[_0x3b9143][_0xf3df('0x28')]=!![];_0x3e84ea[_0x3b9143][_0xf3df('0x29')]=_0x52232c[_0xf3df('0x22')];_0x3e84ea[_0x3b9143][_0xf3df('0x23')]=_[_0xf3df('0x1f')](_0x52232c[_0xf3df('0x23')])?util[_0xf3df('0x24')]('SIP/%s',_0x52232c[_0xf3df('0x22')]):_0x52232c[_0xf3df('0x23')];if(_0x3e84ea[_0x3b9143][_0xf3df('0x2a')]){_0x3e84ea[_0x3b9143][_0xf3df('0x2b')]=moment()[_0xf3df('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e84ea[_0x3b9143][_0xf3df('0x2c')]){_0x3e84ea[_0x3b9143][_0xf3df('0x2d')]=moment()[_0xf3df('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xf3df('0x13')](_0x3e84ea[_0x3b9143]);}RpcVoiceQueueReport[_0xf3df('0x2e')](_0x3e84ea[_0x3b9143]);}};function extractCalleridNumber(_0x32736e){var _0x1d10b9=_0x32736e[_0xf3df('0x2f')](/<(.*?)>/);return _0x1d10b9?_0x1d10b9[0x1]:_0x32736e;}Report[_0xf3df('0x10')][_0xf3df('0x30')]=function(_0x156088){for(var _0x56a4ca=0x0;_0x56a4ca0x0?!![]:![];if(!_0x50270e){return this[_0xae9a('0x68')](this[_0xae9a('0x12')][_0xae9a('0x69')]);}};VoiceQueueReport[_0xae9a('0x36')][_0xae9a('0x19')]=function(_0x4c4152){var _0x59dc96=this['summary']['id'];if(this['summary'][_0xae9a('0x64')][_0x59dc96]&&this[_0xae9a('0x12')]['queuestatus'][_0x59dc96][_0x4c4152[_0xae9a('0x5d')]]){this[_0xae9a('0x12')][_0xae9a('0x64')][_0x59dc96][_0x4c4152[_0xae9a('0x5d')]][_0xae9a('0xd')][_0xae9a('0x6a')](_0x4c4152);}};VoiceQueueReport[_0xae9a('0x36')][_0xae9a('0x15')]=function(_0x576fda){var _0x847fea=this;try{if(this[_0xae9a('0x59')](_0x576fda)&&this['isNotNull'](_0x576fda[_0xae9a('0x4e')])){logger[_0xae9a('0x48')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xae9a('0x3f')](_0x576fda,{'showHidden':![],'depth':null}));var _0x338d8e=this[_0xae9a('0x10')][_0x576fda[_0xae9a('0x4e')]];if(_0x338d8e){logger[_0xae9a('0x48')](_0xae9a('0x6b'),_0x338d8e[_0xae9a('0x57')]);this[_0xae9a('0x12')]['queues'][_0x338d8e[_0xae9a('0x57')]]={'summaryEvent':_0x576fda};this[_0xae9a('0x12')][_0xae9a('0x67')]+=0x1;return ami[_0xae9a('0x3a')]({'action':_0xae9a('0x64'),'queue':_0x338d8e['name']})[_0xae9a('0x5c')](function(_0x56f1e7){if(!_0x847fea[_0xae9a('0x12')][_0xae9a('0x64')][_0x576fda[_0xae9a('0x5d')]]){_0x847fea[_0xae9a('0x12')][_0xae9a('0x64')][_0x576fda[_0xae9a('0x5d')]]={};}_0x847fea[_0xae9a('0x12')]['queuestatus'][_0x576fda[_0xae9a('0x5d')]][_0x56f1e7['actionid']]={'queue':_0x338d8e[_0xae9a('0x57')],'agents':[]};})[_0xae9a('0x5e')](function(_0x6a6d4d){throw _0x6a6d4d;});}}}catch(_0x477b69){logger[_0xae9a('0x3e')](_0xae9a('0x6c'),util[_0xae9a('0x3f')](_0x477b69,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xae9a('0x36')][_0xae9a('0x68')]=function(_0xcf0a4a){if(this['summary'][_0xae9a('0x67')]>0x0){this[_0xae9a('0x12')][_0xae9a('0x69')]=_0xcf0a4a;return;}logger[_0xae9a('0x48')](_0xae9a('0x6d'),util['inspect'](_0xcf0a4a,{'showHidden':![],'depth':null}));this[_0xae9a('0x12')]=initializeSummary();ami[_0xae9a('0x46')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xae9a('0x36')][_0xae9a('0x1d')]=function(_0x323c81){try{if(this[_0xae9a('0x59')](_0x323c81)){logger['debug'](_0xae9a('0x6e'),_0x323c81['uniqueid'],util[_0xae9a('0x3f')](_0x323c81,{'showHidden':![],'depth':null}));if(_[_0xae9a('0x6f')](this['queueReports'][_0x323c81[_0xae9a('0x4b')]])){this[_0xae9a('0xc')][_0x323c81['uniqueid']]=[];}if(_[_0xae9a('0x6f')](this[_0xae9a('0xe')][_0x323c81[_0xae9a('0x4b')]])){this[_0xae9a('0xe')][_0x323c81[_0xae9a('0x4b')]]={};}var _0x2c2687=new QueueReport();_0x2c2687['queue']=_0x323c81[_0xae9a('0x4e')];_0x2c2687[_0xae9a('0x55')]=this[_0xae9a('0x10')][_0x2c2687[_0xae9a('0x4e')]]&&this[_0xae9a('0x10')][_0x2c2687[_0xae9a('0x4e')]]['type']?this[_0xae9a('0x10')][_0x2c2687['queue']][_0xae9a('0x55')]||_0xae9a('0x56'):_0xae9a('0x56');_0x2c2687[_0xae9a('0x70')]=moment()[_0xae9a('0x4c')](_0xae9a('0x71'));_0x2c2687[_0xae9a('0x72')]=_0x323c81['position'];_0x2c2687['count']=_0x323c81[_0xae9a('0x73')];_0x2c2687[_0xae9a('0x4b')]=_0x323c81[_0xae9a('0x4b')];_0x2c2687[_0xae9a('0x74')]=this[_0xae9a('0xe')][_0x323c81[_0xae9a('0x4b')]][_0xae9a('0x74')];logger[_0xae9a('0x75')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2c2687[_0xae9a('0x4e')],_0x2c2687[_0xae9a('0x55')]);Object[_0xae9a('0x63')](_0x2c2687,_[_0xae9a('0x76')](_0x323c81,_[_0xae9a('0x77')](_0x2c2687)));this[_0xae9a('0xc')][_0x323c81['uniqueid']]['push'](_0x2c2687);this['channels'][_0x323c81[_0xae9a('0x4b')]]=_0x2c2687;this[_0xae9a('0x47')](_0x2c2687,_0xae9a('0x1c'));}}catch(_0x406f80){logger[_0xae9a('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x323c81[_0xae9a('0x4b')],util['inspect'](_0x406f80,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xae9a('0x36')]['syncQueueCallerAbandon']=function(_0xe42663){try{if(this[_0xae9a('0x59')](_0xe42663)){logger[_0xae9a('0x48')](_0xae9a('0x78'),_0xe42663[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0xe42663,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xe42663['uniqueid']]){var _0x21f0b4=_['last'](this[_0xae9a('0xc')][_0xe42663['uniqueid']]);_0x21f0b4['queuecallercomplete']=![];_0x21f0b4[_0xae9a('0x79')]=null;_0x21f0b4[_0xae9a('0x7a')]=_0xe42663[_0xae9a('0x7a')];_0x21f0b4[_0xae9a('0x7b')]=_0xe42663['originalposition'];_0x21f0b4[_0xae9a('0x1e')]=!![];_0x21f0b4['queuecallerabandonAt']=moment()[_0xae9a('0x4c')](_0xae9a('0x71'));_0x21f0b4[_0xae9a('0x7c')]=_0xae9a('0x7d');_0x21f0b4[_0xae9a('0x7e')]=null;logger[_0xae9a('0x75')](_0xae9a('0x7f'),_0x21f0b4[_0xae9a('0x4e')],_0x21f0b4[_0xae9a('0x55')]);this[_0xae9a('0xe')][_0xe42663['uniqueid']]=_0x21f0b4;this[_0xae9a('0x44')](_0x21f0b4,_0xae9a('0x1e'));}}}catch(_0x2307ad){logger[_0xae9a('0x3e')](_0xae9a('0x78'),_0xe42663['uniqueid'],util[_0xae9a('0x3f')](_0x2307ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xae9a('0x36')][_0xae9a('0x80')]=function(_0x3e2370){try{if(this[_0xae9a('0x59')](_0x3e2370)){logger['debug'](_0xae9a('0x81'),_0x3e2370[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0x3e2370,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e2370[_0xae9a('0x4b')]]){var _0x480f8c=_[_0xae9a('0x82')](this['queueReports'][_0x3e2370[_0xae9a('0x4b')]]);_0x480f8c['queuecallerleaveAt']=moment()[_0xae9a('0x4c')](_0xae9a('0x71'));_0x480f8c['connectedlinenum']=_0x3e2370[_0xae9a('0x83')];_0x480f8c['connectedlinename']=_0x3e2370[_0xae9a('0x84')];logger[_0xae9a('0x75')](_0xae9a('0x85'),_0x480f8c[_0xae9a('0x4e')],_0x480f8c[_0xae9a('0x55')],_0x3e2370['connectedlinenum'],_0x3e2370[_0xae9a('0x84')]);this[_0xae9a('0xe')][_0x3e2370[_0xae9a('0x4b')]]=_0x480f8c;this[_0xae9a('0x47')](_0x480f8c,_0xae9a('0x20'));}}}catch(_0x44cd8a){logger[_0xae9a('0x3e')](_0xae9a('0x81'),_0x3e2370[_0xae9a('0x4b')],util['inspect'](_0x44cd8a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xae9a('0x36')]['syncAgentConnect']=function(_0x1b46ec){try{if(this[_0xae9a('0x59')](_0x1b46ec)){logger[_0xae9a('0x48')](_0xae9a('0x86'),_0x1b46ec[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0x1b46ec,{'showHidden':![],'depth':null}));if(this[_0xae9a('0xc')][_0x1b46ec[_0xae9a('0x4b')]]){var _0x480372=_[_0xae9a('0x82')](this[_0xae9a('0xc')][_0x1b46ec[_0xae9a('0x4b')]]);_0x480372[_0xae9a('0x87')]=!![];_0x480372[_0xae9a('0x7c')]=_0xae9a('0x88');logger[_0xae9a('0x75')](_0xae9a('0x89'),_0x480372[_0xae9a('0x4e')],_0x480372[_0xae9a('0x55')]);}}}catch(_0x13858d){logger[_0xae9a('0x3e')](_0xae9a('0x86'),_0x1b46ec[_0xae9a('0x4b')],util['inspect'](_0x13858d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xae9a('0x36')]['syncAgentComplete']=function(_0x22d0b3){try{if(this[_0xae9a('0x59')](_0x22d0b3)){logger[_0xae9a('0x48')]('[%s][voiceQueueReport][agentcomplete]',_0x22d0b3[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0x22d0b3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x22d0b3[_0xae9a('0x4b')]]){var _0x56f2a5=_[_0xae9a('0x82')](this[_0xae9a('0xc')][_0x22d0b3[_0xae9a('0x4b')]]);_0x56f2a5['queuecallerabandon']=![];_0x56f2a5[_0xae9a('0x8a')]=null;_0x56f2a5[_0xae9a('0x8b')]=!![];_0x56f2a5[_0xae9a('0x7e')]=_0x22d0b3[_0xae9a('0x8c')];_0x56f2a5['holdtime']=_0x22d0b3[_0xae9a('0x7a')];_0x56f2a5[_0xae9a('0x87')]=!![];_0x56f2a5['queuecallerexit']=![];_0x56f2a5[_0xae9a('0x8d')]=null;if(!_0x56f2a5[_0xae9a('0x8e')]){if(_0x22d0b3[_0xae9a('0x8f')]==_0xae9a('0x8e')){_0x56f2a5[_0xae9a('0x7c')]=_0xae9a('0x90');logger[_0xae9a('0x75')](_0xae9a('0x91'),_0x56f2a5[_0xae9a('0x4e')],_0x56f2a5['type']);}else{if(_['startsWith'](_0x22d0b3[_0xae9a('0x3b')][_0xae9a('0x92')](),_0xae9a('0x93'))){if(this['queueReports'][_0x22d0b3[_0xae9a('0x94')]]){var _0x530693=_[_0xae9a('0x82')](this[_0xae9a('0xc')][_0x22d0b3['linkedid']]);_0x530693['queuecallercomplete']=![];_0x530693[_0xae9a('0x35')]=!![];_0x530693['queuecallerexitAt']=moment(_0x56f2a5[_0xae9a('0x70')])[_0xae9a('0x95')](_0x22d0b3['holdtime'],_0xae9a('0x96'))[_0xae9a('0x4c')](_0xae9a('0x71'));_0x530693['queuecallerexitreason']=_0xae9a('0x97');_0x530693[_0xae9a('0x8e')]=!![];_0x530693[_0xae9a('0x98')]=_0xae9a('0x99');_0x530693[_0xae9a('0x9a')]=_0x22d0b3[_0xae9a('0x9b')];_0x530693[_0xae9a('0x9c')]=_0x22d0b3[_0xae9a('0x4b')];logger['info'](_0xae9a('0x9d'),_0x530693[_0xae9a('0x4e')],_0x530693[_0xae9a('0x55')]);var _0x52ce2c=this[_0xae9a('0xc')][_0x22d0b3[_0xae9a('0x94')]];this[_0xae9a('0xc')][_0x22d0b3[_0xae9a('0x94')]]=this['queueReports'][_0x22d0b3['uniqueid']];this[_0xae9a('0xc')][_0x22d0b3[_0xae9a('0x4b')]]=_0x52ce2c;}}else{_0x56f2a5['queuecallerexitreason']=_0xae9a('0x9e')+_0x22d0b3[_0xae9a('0x8f')][_0xae9a('0x9f')]();logger[_0xae9a('0x75')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x56f2a5[_0xae9a('0x4e')],_0x56f2a5['type'],_0x56f2a5['queuecallerexitreason']);}}}this[_0xae9a('0xe')][_0x22d0b3[_0xae9a('0x4b')]]=_0x56f2a5;}}}catch(_0x42a282){logger[_0xae9a('0x3e')]('[%s][voiceQueueReport][agentcomplete]',_0x22d0b3[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0x42a282,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xae9a('0x36')][_0xae9a('0xa0')]=function(_0x258a8e){try{if(this[_0xae9a('0x59')](_0x258a8e)){logger[_0xae9a('0x48')](_0xae9a('0xa1'),_0x258a8e[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0x258a8e,{'showHidden':![],'depth':null}));this[_0xae9a('0xa2')](_0x258a8e[_0xae9a('0x4b')],_[_0xae9a('0x77')](_0x258a8e['variable'])[0x0],_0x258a8e['value']);if(this['queueReports'][_0x258a8e['uniqueid']]){var _0x284f8c=_[_0xae9a('0x82')](this[_0xae9a('0xc')][_0x258a8e[_0xae9a('0x4b')]]);if(_0x284f8c){if(this[_0xae9a('0x59')](_0x258a8e[_0xae9a('0xa3')])&&this[_0xae9a('0x59')](_0x258a8e[_0xae9a('0xa3')][_0xae9a('0x64')])){switch(_0x258a8e[_0xae9a('0xa4')]){case _0xae9a('0xa5'):_0x284f8c[_0xae9a('0x35')]=![];_0x284f8c['queuecallerexitAt']=null;break;case _0xae9a('0xa6'):_0x284f8c[_0xae9a('0xa7')]=_0xae9a('0xa8');_0x284f8c[_0xae9a('0x35')]=!![];_0x284f8c[_0xae9a('0x8d')]=moment()[_0xae9a('0x4c')](_0xae9a('0x71'));_0x284f8c[_0xae9a('0xa9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xae9a('0x48')](_0xae9a('0xaa'),_0x258a8e[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0x284f8c,{'showHidden':![],'depth':null}));ami[_0xae9a('0x46')](_0xae9a('0xab'),_0x284f8c);break;default:_0x284f8c[_0xae9a('0x35')]=!![];_0x284f8c[_0xae9a('0x8d')]=moment()[_0xae9a('0x4c')](_0xae9a('0x71'));_0x284f8c[_0xae9a('0xa9')]=moment()['format'](_0xae9a('0x71'));}_0x284f8c[_0xae9a('0x1e')]=![];_0x284f8c['queuecallerabandonAt']=null;_0x284f8c[_0xae9a('0x7c')]=_0x258a8e[_0xae9a('0xa4')];this['channels'][_0x258a8e[_0xae9a('0x4b')]]=_0x284f8c;this[_0xae9a('0x44')](_0x284f8c,_0xae9a('0x23'));}else if(this[_0xae9a('0x59')](_0x258a8e[_0xae9a('0xa3')])&&this[_0xae9a('0x59')](_0x258a8e[_0xae9a('0xa3')]['queueposition'])){if(!_0x284f8c[_0xae9a('0x1e')]){_0x284f8c[_0xae9a('0x35')]=!![];_0x284f8c[_0xae9a('0x8d')]=moment()[_0xae9a('0x4c')](_0xae9a('0x71'));_0x284f8c[_0xae9a('0x7c')]=_0xae9a('0xac');_0x284f8c[_0xae9a('0xa9')]=moment()[_0xae9a('0x4c')](_0xae9a('0x71'));this['channels'][_0x258a8e[_0xae9a('0x4b')]]=_0x284f8c;}}logger[_0xae9a('0x75')](_0xae9a('0xad'),_0x258a8e[_0xae9a('0x4b')],_0x284f8c[_0xae9a('0x4e')],_0x284f8c[_0xae9a('0x55')],_[_0xae9a('0x77')](_0x258a8e[_0xae9a('0xa3')])[0x0],_0x258a8e[_0xae9a('0xa4')]);_0x284f8c[_0xae9a('0x13')]=this[_0xae9a('0x13')][_0x258a8e[_0xae9a('0x4b')]];}}}}catch(_0x4c77cb){logger[_0xae9a('0x3e')](_0xae9a('0xa1'),_0x258a8e[_0xae9a('0x4b')],util[_0xae9a('0x3f')](_0x4c77cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xae9a('0x36')][_0xae9a('0xa2')]=function(_0x593ee5,_0x53f619,_0x5045b3){var _0x5c5e6d=['rtpaudioqos','rtpaudioqosbridged',_0xae9a('0xae'),_0xae9a('0xaf'),_0xae9a('0xb0'),_0xae9a('0xb1'),_0xae9a('0xb2'),_0xae9a('0xb3'),_0xae9a('0xb4'),'sipuri','bridgepeer',_0xae9a('0xb5'),_0xae9a('0xb6'),'memberdynamic',_0xae9a('0xb7'),'memberlastcall',_0xae9a('0x8c'),'memberpenalty',_0xae9a('0xb8')];if(!_[_0xae9a('0x39')](_0x53f619)&&!_[_0xae9a('0xb9')](_0x5c5e6d,_0x53f619)){if(_[_0xae9a('0x6f')](this['variables'][_0x593ee5])){this[_0xae9a('0x13')][_0x593ee5]={};}this[_0xae9a('0x13')][_0x593ee5][_0x53f619]=_0x5045b3;}};VoiceQueueReport[_0xae9a('0x36')]['handleHangup']=function(_0x541f8f,_0x30b01e,_0x23e04e){try{var _0x51f497={};if(this[_0xae9a('0xc')][_0x541f8f]){for(var _0x2efc45=0x0;_0x2efc450x0?!![]:![];if(!_0x480f6f){return this[_0xf2c1('0x6d')](this[_0xf2c1('0x15')][_0xf2c1('0x6e')]);}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x6f')]=function(_0x2fbae0){var _0xc38d35=this['summary']['id'];if(this[_0xf2c1('0x15')][_0xf2c1('0x64')][_0xc38d35]&&this['summary'][_0xf2c1('0x64')][_0xc38d35][_0x2fbae0[_0xf2c1('0x63')]]){this[_0xf2c1('0x15')]['queuestatus'][_0xc38d35][_0x2fbae0['actionid']][_0xf2c1('0x10')][_0xf2c1('0x70')](_0x2fbae0);}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x18')]=function(_0xeca0b8){var _0x37eed8=this;try{if(this[_0xf2c1('0x5d')](_0xeca0b8)&&this[_0xf2c1('0x5d')](_0xeca0b8['queue'])){logger[_0xf2c1('0x4b')](_0xf2c1('0x71'),util[_0xf2c1('0x43')](_0xeca0b8,{'showHidden':![],'depth':null}));var _0x22ae04=this[_0xf2c1('0x13')][_0xeca0b8[_0xf2c1('0x4f')]];if(_0x22ae04){logger['debug'](_0xf2c1('0x72'),_0x22ae04[_0xf2c1('0x5b')]);this[_0xf2c1('0x15')]['queues'][_0x22ae04[_0xf2c1('0x5b')]]={'summaryEvent':_0xeca0b8};this[_0xf2c1('0x15')]['statusRequests']+=0x1;return ami[_0xf2c1('0x5f')]({'action':'queuestatus','queue':_0x22ae04[_0xf2c1('0x5b')]})[_0xf2c1('0x62')](function(_0x1511a2){if(!_0x37eed8[_0xf2c1('0x15')][_0xf2c1('0x64')][_0xeca0b8[_0xf2c1('0x63')]]){_0x37eed8[_0xf2c1('0x15')]['queuestatus'][_0xeca0b8['actionid']]={};}_0x37eed8[_0xf2c1('0x15')][_0xf2c1('0x64')][_0xeca0b8[_0xf2c1('0x63')]][_0x1511a2[_0xf2c1('0x63')]]={'queue':_0x22ae04['name'],'agents':[]};})[_0xf2c1('0x3c')](function(_0x26f8cf){throw _0x26f8cf;});}}}catch(_0x51192b){logger['error'](_0xf2c1('0x73'),util[_0xf2c1('0x43')](_0x51192b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x6d')]=function(_0x51d26c){if(this['summary'][_0xf2c1('0x6c')]>0x0){this['summary'][_0xf2c1('0x6e')]=_0x51d26c;return;}logger[_0xf2c1('0x4b')](_0xf2c1('0x74'),util[_0xf2c1('0x43')](_0x51d26c,{'showHidden':![],'depth':null}));this[_0xf2c1('0x15')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x1c')]=function(_0x3cef99){try{if(this[_0xf2c1('0x5d')](_0x3cef99)){logger[_0xf2c1('0x4b')](_0xf2c1('0x75'),_0x3cef99['uniqueid'],util[_0xf2c1('0x43')](_0x3cef99,{'showHidden':![],'depth':null}));if(_[_0xf2c1('0x76')](this[_0xf2c1('0x41')][_0x3cef99[_0xf2c1('0x53')]])){this[_0xf2c1('0x41')][_0x3cef99[_0xf2c1('0x53')]]=[];}if(_[_0xf2c1('0x76')](this[_0xf2c1('0x11')][_0x3cef99[_0xf2c1('0x53')]])){this[_0xf2c1('0x11')][_0x3cef99[_0xf2c1('0x53')]]={};}var _0x1c2ae0=new QueueReport();_0x1c2ae0['queue']=_0x3cef99[_0xf2c1('0x4f')];_0x1c2ae0[_0xf2c1('0x58')]=this['voiceQueues'][_0x1c2ae0[_0xf2c1('0x4f')]]&&this[_0xf2c1('0x13')][_0x1c2ae0[_0xf2c1('0x4f')]][_0xf2c1('0x58')]?this[_0xf2c1('0x13')][_0x1c2ae0['queue']][_0xf2c1('0x58')]||_0xf2c1('0x59'):_0xf2c1('0x59');_0x1c2ae0[_0xf2c1('0x77')]=moment()[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c2ae0['position']=_0x3cef99[_0xf2c1('0x78')];_0x1c2ae0[_0xf2c1('0x79')]=_0x3cef99['count'];_0x1c2ae0['uniqueid']=_0x3cef99[_0xf2c1('0x53')];_0x1c2ae0[_0xf2c1('0x7a')]=this['channels'][_0x3cef99['uniqueid']][_0xf2c1('0x7a')];logger[_0xf2c1('0x7b')](_0xf2c1('0x7c'),_0x1c2ae0[_0xf2c1('0x4f')],_0x1c2ae0[_0xf2c1('0x58')]);Object[_0xf2c1('0x69')](_0x1c2ae0,_['pick'](_0x3cef99,_[_0xf2c1('0x7d')](_0x1c2ae0)));this['queueReports'][_0x3cef99['uniqueid']][_0xf2c1('0x70')](_0x1c2ae0);this[_0xf2c1('0x11')][_0x3cef99[_0xf2c1('0x53')]]=_0x1c2ae0;this['emitVoiceQueueChannelSave'](_0x1c2ae0,_0xf2c1('0x1b'));}}catch(_0x5ceff9){logger[_0xf2c1('0x3f')](_0xf2c1('0x75'),_0x3cef99[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x5ceff9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')]['syncQueueCallerAbandon']=function(_0x574978){try{if(this[_0xf2c1('0x5d')](_0x574978)){logger[_0xf2c1('0x4b')](_0xf2c1('0x7e'),_0x574978[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x574978,{'showHidden':![],'depth':null}));if(this[_0xf2c1('0x41')][_0x574978[_0xf2c1('0x53')]]){var _0x272233=_['last'](this[_0xf2c1('0x41')][_0x574978['uniqueid']]);_0x272233[_0xf2c1('0x37')]=![];_0x272233['queuecallercompleteAt']=null;_0x272233[_0xf2c1('0x7f')]=_0x574978['holdtime'];_0x272233[_0xf2c1('0x80')]=_0x574978[_0xf2c1('0x80')];_0x272233[_0xf2c1('0x1d')]=!![];_0x272233['queuecallerabandonAt']=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0x272233[_0xf2c1('0x54')]=_0xf2c1('0x82');_0x272233['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x272233[_0xf2c1('0x4f')],_0x272233[_0xf2c1('0x58')]);this[_0xf2c1('0x11')][_0x574978['uniqueid']]=_0x272233;this['emitVoiceQueueChannelRemove'](_0x272233,_0xf2c1('0x1d'));}}}catch(_0x3aec91){logger['error'](_0xf2c1('0x7e'),_0x574978[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x3aec91,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5b193e){try{if(this[_0xf2c1('0x5d')](_0x5b193e)){logger[_0xf2c1('0x4b')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b193e['uniqueid'],util[_0xf2c1('0x43')](_0x5b193e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5b193e[_0xf2c1('0x53')]]){var _0x3d0b60=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x5b193e[_0xf2c1('0x53')]]);_0x3d0b60[_0xf2c1('0x84')]=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0x3d0b60[_0xf2c1('0x85')]=_0x5b193e['connectedlinenum'];_0x3d0b60[_0xf2c1('0x86')]=_0x5b193e[_0xf2c1('0x86')];logger['info'](_0xf2c1('0x87'),_0x3d0b60[_0xf2c1('0x4f')],_0x3d0b60[_0xf2c1('0x58')],_0x5b193e[_0xf2c1('0x85')],_0x5b193e[_0xf2c1('0x86')]);this[_0xf2c1('0x11')][_0x5b193e[_0xf2c1('0x53')]]=_0x3d0b60;this[_0xf2c1('0x4a')](_0x3d0b60,'queuecallerleave');}}}catch(_0x4d71ae){logger[_0xf2c1('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b193e[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x4d71ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf2c1('0x23')]=function(_0x271001){try{if(this[_0xf2c1('0x5d')](_0x271001)){logger[_0xf2c1('0x4b')]('[%s][voiceQueueReport][agentconnect]',_0x271001[_0xf2c1('0x53')],util['inspect'](_0x271001,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x271001[_0xf2c1('0x53')]]){var _0x3f369b=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x271001[_0xf2c1('0x53')]]);_0x3f369b['queuecallercomplete']=!![];_0x3f369b[_0xf2c1('0x54')]='COMPLETEDBYAGENT';logger[_0xf2c1('0x7b')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x3f369b[_0xf2c1('0x4f')],_0x3f369b[_0xf2c1('0x58')]);}}}catch(_0x5c3686){logger[_0xf2c1('0x3f')](_0xf2c1('0x88'),_0x271001['uniqueid'],util[_0xf2c1('0x43')](_0x5c3686,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf2c1('0x21')]=function(_0x4f6032){try{if(this[_0xf2c1('0x5d')](_0x4f6032)){logger[_0xf2c1('0x4b')](_0xf2c1('0x89'),_0x4f6032[_0xf2c1('0x53')],util['inspect'](_0x4f6032,{'showHidden':![],'depth':null}));if(this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x53')]]){var _0x307680=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x53')]]);_0x307680[_0xf2c1('0x1d')]=![];_0x307680[_0xf2c1('0x8a')]=null;_0x307680['assigned']=!![];_0x307680['lastAssignedTo']=_0x4f6032[_0xf2c1('0x8b')];_0x307680[_0xf2c1('0x7f')]=_0x4f6032[_0xf2c1('0x7f')];_0x307680[_0xf2c1('0x37')]=!![];_0x307680[_0xf2c1('0x36')]=![];_0x307680['queuecallerexitAt']=null;if(!_0x307680[_0xf2c1('0x8c')]){if(_0x4f6032[_0xf2c1('0x8d')]==_0xf2c1('0x8c')){_0x307680[_0xf2c1('0x54')]='COMPLETED';logger[_0xf2c1('0x7b')](_0xf2c1('0x8e'),_0x307680[_0xf2c1('0x4f')],_0x307680['type']);}else{if(_[_0xf2c1('0x8f')](_0x4f6032['channel'][_0xf2c1('0x90')](),_0xf2c1('0x91'))){if(this['queueReports'][_0x4f6032[_0xf2c1('0x92')]]){var _0x2b65ed=_[_0xf2c1('0x83')](this['queueReports'][_0x4f6032[_0xf2c1('0x92')]]);_0x2b65ed[_0xf2c1('0x37')]=![];_0x2b65ed['queuecallerexit']=!![];_0x2b65ed[_0xf2c1('0x93')]=moment(_0x307680[_0xf2c1('0x77')])['add'](_0x4f6032['holdtime'],_0xf2c1('0x94'))[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b65ed[_0xf2c1('0x54')]='FORWARDTRANSFER';_0x2b65ed[_0xf2c1('0x8c')]=!![];_0x2b65ed[_0xf2c1('0x95')]=_0xf2c1('0x96');_0x2b65ed['transferexten']=_0x4f6032[_0xf2c1('0x97')];_0x2b65ed['transferuniqueid']=_0x4f6032[_0xf2c1('0x53')];logger['info'](_0xf2c1('0x98'),_0x2b65ed[_0xf2c1('0x4f')],_0x2b65ed['type']);var _0x4b5f64=this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x92')]];this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x92')]]=this[_0xf2c1('0x41')][_0x4f6032['uniqueid']];this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x53')]]=_0x4b5f64;}}else{_0x307680[_0xf2c1('0x54')]=_0xf2c1('0x99')+_0x4f6032[_0xf2c1('0x8d')][_0xf2c1('0x9a')]();logger[_0xf2c1('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x307680[_0xf2c1('0x4f')],_0x307680['type'],_0x307680[_0xf2c1('0x54')]);}}}this[_0xf2c1('0x11')][_0x4f6032[_0xf2c1('0x53')]]=_0x307680;}}}catch(_0x59dbcd){logger[_0xf2c1('0x3f')](_0xf2c1('0x89'),_0x4f6032['uniqueid'],util[_0xf2c1('0x43')](_0x59dbcd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x25')]=function(_0x40b8f6){try{if(this[_0xf2c1('0x5d')](_0x40b8f6)){logger['debug'](_0xf2c1('0x9b'),_0x40b8f6['uniqueid'],util[_0xf2c1('0x43')](_0x40b8f6,{'showHidden':![],'depth':null}));this[_0xf2c1('0x9c')](_0x40b8f6[_0xf2c1('0x53')],_[_0xf2c1('0x7d')](_0x40b8f6[_0xf2c1('0x9d')])[0x0],_0x40b8f6[_0xf2c1('0x9e')]);if(this['queueReports'][_0x40b8f6[_0xf2c1('0x53')]]){var _0xd6a167=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x40b8f6[_0xf2c1('0x53')]]);if(_0xd6a167){if(this['isNotNull'](_0x40b8f6[_0xf2c1('0x9d')])&&this['isNotNull'](_0x40b8f6[_0xf2c1('0x9d')][_0xf2c1('0x64')])){switch(_0x40b8f6[_0xf2c1('0x9e')]){case _0xf2c1('0x9f'):_0xd6a167[_0xf2c1('0x36')]=![];_0xd6a167[_0xf2c1('0x93')]=null;break;case'TIMEOUT':_0xd6a167[_0xf2c1('0xa0')]=_0xf2c1('0xa1');_0xd6a167[_0xf2c1('0x36')]=!![];_0xd6a167[_0xf2c1('0x93')]=moment()[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0xd6a167[_0xf2c1('0x84')]=moment()[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xf2c1('0x4b')](_0xf2c1('0xa2'),_0x40b8f6[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0xd6a167,{'showHidden':![],'depth':null}));ami[_0xf2c1('0x49')]('custom:timeout',_0xd6a167);break;default:_0xd6a167[_0xf2c1('0x36')]=!![];_0xd6a167['queuecallerexitAt']=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0xd6a167[_0xf2c1('0x84')]=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));}_0xd6a167[_0xf2c1('0x1d')]=![];_0xd6a167[_0xf2c1('0x8a')]=null;_0xd6a167['queuecallerexitreason']=_0x40b8f6['value'];this[_0xf2c1('0x11')][_0x40b8f6[_0xf2c1('0x53')]]=_0xd6a167;this['emitVoiceQueueChannelRemove'](_0xd6a167,_0xf2c1('0x24'));}else if(this[_0xf2c1('0x5d')](_0x40b8f6[_0xf2c1('0x9d')])&&this[_0xf2c1('0x5d')](_0x40b8f6[_0xf2c1('0x9d')][_0xf2c1('0xa3')])){if(!_0xd6a167['queuecallerabandon']){_0xd6a167[_0xf2c1('0x36')]=!![];_0xd6a167[_0xf2c1('0x93')]=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0xd6a167['queuecallerexitreason']=_0xf2c1('0xa4');_0xd6a167['queuecallerleaveAt']=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));this[_0xf2c1('0x11')][_0x40b8f6['uniqueid']]=_0xd6a167;}}logger['info'](_0xf2c1('0xa5'),_0x40b8f6['uniqueid'],_0xd6a167[_0xf2c1('0x4f')],_0xd6a167[_0xf2c1('0x58')],_[_0xf2c1('0x7d')](_0x40b8f6[_0xf2c1('0x9d')])[0x0],_0x40b8f6[_0xf2c1('0x9e')]);_0xd6a167[_0xf2c1('0x16')]=this[_0xf2c1('0x16')][_0x40b8f6[_0xf2c1('0x53')]];}}}}catch(_0x3280b5){logger[_0xf2c1('0x3f')]('[%s][voiceQueueReport][varset]',_0x40b8f6['uniqueid'],util['inspect'](_0x3280b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x9c')]=function(_0x5f4557,_0x19c38b,_0x242da6){var _0xd4bf41=[_0xf2c1('0xa6'),_0xf2c1('0xa7'),_0xf2c1('0xa8'),_0xf2c1('0xa9'),_0xf2c1('0xaa'),_0xf2c1('0xab'),_0xf2c1('0xac'),_0xf2c1('0xad'),'sipcallid',_0xf2c1('0xae'),_0xf2c1('0xaf'),'bridgepvtcallid',_0xf2c1('0xb0'),_0xf2c1('0xb1'),_0xf2c1('0xb2'),'memberlastcall',_0xf2c1('0x8b'),_0xf2c1('0xb3'),_0xf2c1('0xb4')];if(!_[_0xf2c1('0x39')](_0x19c38b)&&!_['includes'](_0xd4bf41,_0x19c38b)){if(_[_0xf2c1('0x76')](this[_0xf2c1('0x16')][_0x5f4557])){this[_0xf2c1('0x16')][_0x5f4557]={};}this[_0xf2c1('0x16')][_0x5f4557][_0x19c38b]=_0x242da6;}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0xb5')]=function(_0x5567d1,_0x1f9101,_0x120e7d){try{var _0x3e0800={};if(this['queueReports'][_0x5567d1]){for(var _0x425581=0x0;_0x425581=0x0?moment(_0x58c176[_0x40ee('0x1a')])[_0x40ee('0x1b')](_0x58c176[_0x40ee('0x19')],'seconds'):null,'data1':_0x40ee('0x1c'),'data2':_0x58c176[_0x40ee('0x15')],'data3':_0x58c176[_0x40ee('0x12')],'data4':_0x58c176[_0x40ee('0x1d')]||null,'role':'agent','internal':_0x58c176[_0x40ee('0x15')]?_[_0x40ee('0x1e')](_0x58c176['accountcode']):undefined,'uniqueid':_0x58c176['uniqueid']},'log':_0x40ee('0x7')});}; \ No newline at end of file +var _0xdbfa=['isNil','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','CreateMemberReport','membername','interface','starttime','endtime','outbound','exten','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','Request','voice','lastAssignedTo'];(function(_0xefbee3,_0x16f9d0){var _0x44c1bf=function(_0x4ad72a){while(--_0x4ad72a){_0xefbee3['push'](_0xefbee3['shift']());}};_0x44c1bf(++_0x16f9d0);}(_0xdbfa,0x1b7));var _0xadbf=function(_0x335ec6,_0x1c65fa){_0x335ec6=_0x335ec6-0x0;var _0xdd2c47=_0xdbfa[_0x335ec6];return _0xdd2c47;};'use strict';var moment=require(_0xadbf('0x0'));var _=require(_0xadbf('0x1'));var util=require(_0xadbf('0x2'));var client=require(_0xadbf('0x3'));exports[_0xadbf('0x4')]=function(_0x33984a){var _0x498f94=_0x33984a[_0xadbf('0x5')]||_0x33984a['queuecallerexitAt'];return client[_0xadbf('0x6')]('CreateMemberReport',{'body':{'channel':_0xadbf('0x7'),'membername':_0x33984a[_0xadbf('0x8')],'interface':_[_0xadbf('0x9')](_0x33984a['interface'])?util[_0xadbf('0xa')](_0xadbf('0xb'),_0x33984a[_0xadbf('0x8')]):_0x33984a['interface'],'type':_0xadbf('0xc'),'enterAt':_0x33984a['queuecallerleaveAt'],'exitAt':_0x498f94,'duration':moment(_0x498f94)[_0xadbf('0xd')](_0x33984a[_0xadbf('0xe')],_0xadbf('0xf')),'data1':_0xadbf('0x10'),'data2':_0x33984a[_0xadbf('0x11')],'data3':_0x33984a['exten'],'data4':null,'data5':_0x33984a[_0xadbf('0x12')],'role':_0xadbf('0x13'),'internal':_0x33984a[_0xadbf('0x14')]?_[_0xadbf('0x15')](_0x33984a[_0xadbf('0x14')]):undefined,'uniqueid':_0x33984a[_0xadbf('0x16')]},'log':'CreateMemberReport'});};exports[_0xadbf('0x17')]=function(_0x417a2d){return client[_0xadbf('0x6')](_0xadbf('0x18'),{'body':{'channel':_0xadbf('0x7'),'membername':_0x417a2d[_0xadbf('0x19')],'interface':_0x417a2d[_0xadbf('0x1a')],'type':_0xadbf('0xc'),'enterAt':_0x417a2d[_0xadbf('0x1b')],'exitAt':_0x417a2d[_0xadbf('0x1c')],'duration':moment(_0x417a2d['endtime'])[_0xadbf('0xd')](_0x417a2d[_0xadbf('0x1b')],_0xadbf('0xf'))>=0x0?moment(_0x417a2d['endtime'])[_0xadbf('0xd')](_0x417a2d[_0xadbf('0x1b')],_0xadbf('0xf')):null,'data1':_0xadbf('0x1d'),'data2':_0x417a2d['accountcode'],'data3':_0x417a2d[_0xadbf('0x1e')],'data4':_0x417a2d[_0xadbf('0x1f')]||null,'role':_0xadbf('0x13'),'internal':_0x417a2d['accountcode']?_[_0xadbf('0x15')](_0x417a2d[_0xadbf('0x14')]):undefined,'uniqueid':_0x417a2d[_0xadbf('0x16')]},'log':_0xadbf('0x18')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index dccc2ca..6de3bc2 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 _0x5a13=['previewRecallmeReminderInterval','GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x1beecc,_0x252b31){var _0x4cd3b2=function(_0x108c9e){while(--_0x108c9e){_0x1beecc['push'](_0x1beecc['shift']());}};_0x4cd3b2(++_0x252b31);}(_0x5a13,0x92));var _0x35a1=function(_0x29f249,_0x431283){_0x29f249=_0x29f249-0x0;var _0x5c96d0=_0x5a13[_0x29f249];return _0x5c96d0;};'use strict';var client=require('../client');exports[_0x35a1('0x0')]=function(){return client[_0x35a1('0x1')](_0x35a1('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x35a1('0x3'),_0x35a1('0x4')]},'log':_0x35a1('0x5')});}; \ No newline at end of file +var _0xdb51=['previewRecallmeReminderInterval','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xdb51,0x145));var _0x1db5=function(_0x2644c2,_0x815a12){_0x2644c2=_0x2644c2-0x0;var _0x56b106=_0xdb51[_0x2644c2];return _0x56b106;};'use strict';var client=require(_0x1db5('0x0'));exports[_0x1db5('0x1')]=function(){return client[_0x1db5('0x2')](_0x1db5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1db5('0x4'),_0x1db5('0x5')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 0519593..13e5c7a 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 _0x0bf7=['../client','Request','GetTemplate','name','html'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x0bf7,0x14a));var _0x70bf=function(_0x8d22b3,_0x57effe){_0x8d22b3=_0x8d22b3-0x0;var _0x2820be=_0x0bf7[_0x8d22b3];return _0x2820be;};'use strict';var client=require(_0x70bf('0x0'));exports['getTemplates']=function(_0x2fda82){return function(_0x1d3eee){return client[_0x70bf('0x1')](_0x70bf('0x2'),{'options':{'raw':!![],'attributes':['id',_0x70bf('0x3'),_0x70bf('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xcbf4=['Request','GetTemplate','name','html','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcbf4,0x7c));var _0x4cbf=function(_0x94f522,_0x3ad701){_0x94f522=_0x94f522-0x0;var _0x433a8c=_0xcbf4[_0x94f522];return _0x433a8c;};'use strict';var client=require(_0x4cbf('0x0'));exports['getTemplates']=function(_0x437d5b){return function(_0x3233e8){return client[_0x4cbf('0x1')](_0x4cbf('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4cbf('0x3'),_0x4cbf('0x4')]},'log':_0x4cbf('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 0bbdd36..9ab5359 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 _0x6bf9=['Condition','AnyConditions','operator','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','GetTrigger','getTriggers','Request','channel','field','value'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x6bf9,0x164));var _0x96bf=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x6bf9[_0x44b3bd];return _0x1efc4a;};'use strict';var client=require('../client');exports[_0x96bf('0x0')]=function(_0x5a298a){return function(_0x30741c){return client[_0x96bf('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x96bf('0x2'),'status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x96bf('0x3'),'operator',_0x96bf('0x4')]},{'model':_0x96bf('0x5'),'as':_0x96bf('0x6'),'attributes':['id',_0x96bf('0x3'),_0x96bf('0x7'),_0x96bf('0x4')]},{'model':_0x96bf('0x8'),'as':_0x96bf('0x9'),'attributes':['id',_0x96bf('0xa'),_0x96bf('0xb'),_0x96bf('0xc'),_0x96bf('0xd'),_0x96bf('0xe'),_0x96bf('0xf'),_0x96bf('0x10'),_0x96bf('0x11')]}]},'log':_0x96bf('0x12')});};}; \ No newline at end of file +var _0xbb2f=['channel','status','AllConditions','operator','value','Condition','Action','Actions','action','data1','data2','data3','data4','../client','getTriggers','Request','GetTrigger','name'];(function(_0x10e783,_0x18962f){var _0x396160=function(_0x3a3bb7){while(--_0x3a3bb7){_0x10e783['push'](_0x10e783['shift']());}};_0x396160(++_0x18962f);}(_0xbb2f,0x1ab));var _0xfbb2=function(_0x246d1b,_0x1890d3){_0x246d1b=_0x246d1b-0x0;var _0x2ec124=_0xbb2f[_0x246d1b];return _0x2ec124;};'use strict';var client=require(_0xfbb2('0x0'));exports[_0xfbb2('0x1')]=function(_0x233bb8){return function(_0x2b533){return client[_0xfbb2('0x2')](_0xfbb2('0x3'),{'options':{'raw':![],'attributes':['id',_0xfbb2('0x4'),_0xfbb2('0x5'),_0xfbb2('0x6')],'include':[{'model':'Condition','as':_0xfbb2('0x7'),'attributes':['id','field',_0xfbb2('0x8'),_0xfbb2('0x9')]},{'model':_0xfbb2('0xa'),'as':'AnyConditions','attributes':['id','field','operator',_0xfbb2('0x9')]},{'model':_0xfbb2('0xb'),'as':_0xfbb2('0xc'),'attributes':['id',_0xfbb2('0xd'),_0xfbb2('0xe'),_0xfbb2('0xf'),_0xfbb2('0x10'),_0xfbb2('0x11'),'data5','data6','data7']}]},'log':_0xfbb2('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index c6dd7ea..163cbc7 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 _0x4891=['GetTrunk','name','defaultuser','../client','getTrunks'];(function(_0x290804,_0x592b1b){var _0x5ea168=function(_0x4da973){while(--_0x4da973){_0x290804['push'](_0x290804['shift']());}};_0x5ea168(++_0x592b1b);}(_0x4891,0x166));var _0x1489=function(_0x3e9de4,_0x28235d){_0x3e9de4=_0x3e9de4-0x0;var _0x2e6f69=_0x4891[_0x3e9de4];return _0x2e6f69;};'use strict';var client=require(_0x1489('0x0'));exports[_0x1489('0x1')]=function(_0x585049){return function(_0x58542c){return client['Request'](_0x1489('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1489('0x3'),'registry',_0x1489('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x966a=['../client','GetTrunk','name','defaultuser'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x966a,0x138));var _0xa966=function(_0x1d5dbb,_0x32266c){_0x1d5dbb=_0x1d5dbb-0x0;var _0x4b67d2=_0x966a[_0x1d5dbb];return _0x4b67d2;};'use strict';var client=require(_0xa966('0x0'));exports['getTrunks']=function(_0x2adae6){return function(_0x54e4aa){return client['Request'](_0xa966('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa966('0x2'),'registry',_0xa966('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index f39a741..8603ee0 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 7d57552..ca2e0e1 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 _0x6c64=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x58376a,_0x26470a){var _0x1bb9b8=function(_0x2dbc93){while(--_0x2dbc93){_0x58376a['push'](_0x58376a['shift']());}};_0x1bb9b8(++_0x26470a);}(_0x6c64,0x18d));var _0x46c6=function(_0xc45512,_0x20e525){_0xc45512=_0xc45512-0x0;var _0x7729e9=_0x6c64[_0xc45512];return _0x7729e9;};'use strict';var client=require(_0x46c6('0x0'));exports['create']=function(_0x5701aa){return client[_0x46c6('0x1')](_0x46c6('0x2'),{'body':_0x5701aa,'log':_0x46c6('0x2')});};exports[_0x46c6('0x3')]=function(_0x1ff561,_0x46bfd9,_0x49c0cc){return client[_0x46c6('0x1')](_0x46c6('0x4'),{'body':_0x1ff561,'options':{'where':{'uniqueid':_0x46bfd9,'interface':_0x49c0cc,'agentcomplete':!![]}},'log':_0x46c6('0x4')});}; \ No newline at end of file +var _0xe565=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x1d03f,_0x5a79f8){var _0x3e2076=function(_0x442e24){while(--_0x442e24){_0x1d03f['push'](_0x1d03f['shift']());}};_0x3e2076(++_0x5a79f8);}(_0xe565,0x134));var _0x5e56=function(_0x4215aa,_0x42d7a4){_0x4215aa=_0x4215aa-0x0;var _0x26faa5=_0xe565[_0x4215aa];return _0x26faa5;};'use strict';var client=require(_0x5e56('0x0'));exports[_0x5e56('0x1')]=function(_0x2912b2){return client[_0x5e56('0x2')](_0x5e56('0x3'),{'body':_0x2912b2,'log':_0x5e56('0x3')});};exports[_0x5e56('0x4')]=function(_0x3fdec6,_0x2e0f74,_0xbefc85){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3fdec6,'options':{'where':{'uniqueid':_0x2e0f74,'interface':_0xbefc85,'agentcomplete':!![]}},'log':_0x5e56('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 175bf65..7eee60d 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 _0xd79a=['day','format','type','disposition','duration','GetVoiceCallReports','moment','lodash','../client','create','CreateVoiceCallReport','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','endOf'];(function(_0x582feb,_0xe665f0){var _0x331e63=function(_0x37f1fc){while(--_0x37f1fc){_0x582feb['push'](_0x582feb['shift']());}};_0x331e63(++_0xe665f0);}(_0xd79a,0x84));var _0xad79=function(_0xf75061,_0x3c5171){_0xf75061=_0xf75061-0x0;var _0x3095d7=_0xd79a[_0xf75061];return _0x3095d7;};'use strict';var moment=require(_0xad79('0x0'));var util=require('util');var _=require(_0xad79('0x1'));var client=require(_0xad79('0x2'));exports[_0xad79('0x3')]=function(_0x13ed4d){return client['Request'](_0xad79('0x4'),{'body':_['merge'](_0x13ed4d,{'source':_0x13ed4d[_0xad79('0x5')],'destinationcontext':_0x13ed4d[_0xad79('0x6')],'callerid':_0x13ed4d[_0xad79('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xad79('0x8')]=function(){return function(){return client['Request'](_0xad79('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xad79('0xa')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xad79('0xb')](_0xad79('0xc'))[_0xad79('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xad79('0xe'),_0xad79('0xf'),_0xad79('0x10'),'billableseconds']},'log':_0xad79('0x11')});};}; \ No newline at end of file +var _0x9930=['endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','Request','GetVoiceCallReport','outbound','startOf','day','format'];(function(_0x3b6a68,_0x16a779){var _0x1e6615=function(_0x2bafe4){while(--_0x2bafe4){_0x3b6a68['push'](_0x3b6a68['shift']());}};_0x1e6615(++_0x16a779);}(_0x9930,0xf9));var _0x0993=function(_0x2b2dd1,_0x2c6ac7){_0x2b2dd1=_0x2b2dd1-0x0;var _0x5d2ef5=_0x9930[_0x2b2dd1];return _0x5d2ef5;};'use strict';var moment=require(_0x0993('0x0'));var util=require('util');var _=require(_0x0993('0x1'));var client=require(_0x0993('0x2'));exports[_0x0993('0x3')]=function(_0x54f70a){return client['Request'](_0x0993('0x4'),{'body':_[_0x0993('0x5')](_0x54f70a,{'source':_0x54f70a[_0x0993('0x6')],'destinationcontext':_0x54f70a['context'],'callerid':_0x54f70a[_0x0993('0x7')],'amaflags':_0x0993('0x8')}),'log':_0x0993('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x0993('0x9')](_0x0993('0xa'),{'options':{'where':{'type':[_0x0993('0xb')],'createdAt':{'$between':[moment()[_0x0993('0xc')](_0x0993('0xd'))[_0x0993('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x0993('0xf')]('day')[_0x0993('0xe')](_0x0993('0x10'))]}},'attributes':[_0x0993('0x11'),_0x0993('0x12'),_0x0993('0x13'),_0x0993('0x14')]},'log':_0x0993('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 7d35e59..1c3c659 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 _0xa6db=['Request','CreateVoiceDialReport','../client'];(function(_0x9b87aa,_0x3e1a68){var _0x181721=function(_0x48ce0a){while(--_0x48ce0a){_0x9b87aa['push'](_0x9b87aa['shift']());}};_0x181721(++_0x3e1a68);}(_0xa6db,0x1d0));var _0xba6d=function(_0x24a49d,_0x508563){_0x24a49d=_0x24a49d-0x0;var _0x19a64f=_0xa6db[_0x24a49d];return _0x19a64f;};'use strict';var client=require(_0xba6d('0x0'));exports['create']=function(_0x1eb18c){return client[_0xba6d('0x1')](_0xba6d('0x2'),{'body':_0x1eb18c,'log':_0xba6d('0x2')});}; \ No newline at end of file +var _0xe716=['CreateVoiceDialReport','../client','create','Request'];(function(_0x43b383,_0xa1896f){var _0x305169=function(_0x273869){while(--_0x273869){_0x43b383['push'](_0x43b383['shift']());}};_0x305169(++_0xa1896f);}(_0xe716,0x181));var _0x6e71=function(_0x4b8be7,_0x3724c5){_0x4b8be7=_0x4b8be7-0x0;var _0x352685=_0xe716[_0x4b8be7];return _0x352685;};'use strict';var client=require(_0x6e71('0x0'));exports[_0x6e71('0x1')]=function(_0x234957){return client[_0x6e71('0x2')](_0x6e71('0x3'),{'body':_0x234957,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index c98c284..e761ec5 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 _0xfd6f=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x3c8c80,_0x4d47cc){var _0x479a99=function(_0x4beb20){while(--_0x4beb20){_0x3c8c80['push'](_0x3c8c80['shift']());}};_0x479a99(++_0x4d47cc);}(_0xfd6f,0x19d));var _0xffd6=function(_0x34fc51,_0x438a6e){_0x34fc51=_0x34fc51-0x0;var _0xbe6df2=_0xfd6f[_0x34fc51];return _0xbe6df2;};'use strict';var client=require(_0xffd6('0x0'));exports[_0xffd6('0x1')]=function(){return function(){return client[_0xffd6('0x2')](_0xffd6('0x3'),{'options':{'raw':!![],'attributes':['id',_0xffd6('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xffd6('0x1')});};}; \ No newline at end of file +var _0xf257=['exten','recordingFormat','Request','GetVoiceExtension'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xf257,0x82));var _0x7f25=function(_0x225813,_0x298959){_0x225813=_0x225813-0x0;var _0x5d3e36=_0xf257[_0x225813];return _0x5d3e36;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x7f25('0x0')](_0x7f25('0x1'),{'options':{'raw':!![],'attributes':['id',_0x7f25('0x2'),_0x7f25('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 06b3500..1e34a79 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 _0xd6e0=['strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2'];(function(_0x2a5d6d,_0x5067fd){var _0x13427f=function(_0x1bc716){while(--_0x1bc716){_0x2a5d6d['push'](_0x2a5d6d['shift']());}};_0x13427f(++_0x5067fd);}(_0xd6e0,0x18f));var _0x0d6e=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0xd6e0[_0x12833b];return _0x3acad3;};'use strict';var client=require(_0x0d6e('0x0'));exports[_0x0d6e('0x1')]=function(){return function(){return client[_0x0d6e('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x0d6e('0x3'),'acw',_0x0d6e('0x4'),_0x0d6e('0x5'),_0x0d6e('0x6'),_0x0d6e('0x7'),_0x0d6e('0x8'),'dialMethod',_0x0d6e('0x9'),_0x0d6e('0xa'),'dialPowerLevel',_0x0d6e('0xb'),_0x0d6e('0xc'),_0x0d6e('0xd'),_0x0d6e('0xe'),_0x0d6e('0xf'),'dialOriginateTimeout',_0x0d6e('0x10'),_0x0d6e('0x11'),_0x0d6e('0x12'),_0x0d6e('0x13'),_0x0d6e('0x14'),_0x0d6e('0x15'),_0x0d6e('0x16'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x0d6e('0x17'),_0x0d6e('0x18'),_0x0d6e('0x19'),_0x0d6e('0x1a'),_0x0d6e('0x1b'),_0x0d6e('0x1c'),_0x0d6e('0x1d'),_0x0d6e('0x1e'),_0x0d6e('0x1f'),'dialAMDTotalAnalysisTime',_0x0d6e('0x20'),'dialAMDBetweenWordsSilence',_0x0d6e('0x21'),_0x0d6e('0x22'),_0x0d6e('0x23'),_0x0d6e('0x24'),_0x0d6e('0x25'),_0x0d6e('0x26'),_0x0d6e('0x27'),_0x0d6e('0x28'),'dialAgiAfterHangupClient',_0x0d6e('0x29'),'monitor_format',_0x0d6e('0x2a'),_0x0d6e('0x2b'),_0x0d6e('0x2c'),_0x0d6e('0x2d'),'dialNoSuchNumberRetryFrequency',_0x0d6e('0x2e'),_0x0d6e('0x2f'),'dialAbandonedMaxRetry',_0x0d6e('0x30'),'dialMachineMaxRetry',_0x0d6e('0x31'),_0x0d6e('0x32'),_0x0d6e('0x33'),_0x0d6e('0x34'),_0x0d6e('0x35'),_0x0d6e('0x36'),_0x0d6e('0x37'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x0d6e('0x38'),'as':_0x0d6e('0x38'),'attributes':['id','name','callerid',_0x0d6e('0x39')]},{'model':_0x0d6e('0x3a'),'as':'mandatoryDispositionPause','attributes':['id',_0x0d6e('0x3')]},{'model':'Trunk','as':_0x0d6e('0x3b'),'attributes':['id',_0x0d6e('0x3'),'callerid','active']},{'model':_0x0d6e('0x3c'),'as':_0x0d6e('0x3c'),'attributes':['id',_0x0d6e('0x3')],'include':[{'model':_0x0d6e('0x3c'),'as':_0x0d6e('0x3d'),'attributes':['id',_0x0d6e('0x3'),_0x0d6e('0x3e')]}]}]},'log':_0x0d6e('0x1')});};}; \ No newline at end of file +var _0x5707=['dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','Interval','Intervals','getVoiceQueues','Request','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5707,0xcb));var _0x7570=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0x5707[_0x212a37];return _0x5d0bf9;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x7570('0x0')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x7570('0x1'),_0x7570('0x2'),_0x7570('0x3'),'autopause',_0x7570('0x4'),'type',_0x7570('0x5'),_0x7570('0x6'),_0x7570('0x7'),_0x7570('0x8'),_0x7570('0x9'),_0x7570('0xa'),_0x7570('0xb'),_0x7570('0xc'),_0x7570('0xd'),_0x7570('0xe'),_0x7570('0xf'),'dialQueueOptions',_0x7570('0x10'),_0x7570('0x11'),_0x7570('0x12'),'dialCongestionRetryFrequency',_0x7570('0x13'),_0x7570('0x14'),_0x7570('0x15'),_0x7570('0x16'),_0x7570('0x17'),_0x7570('0x18'),'dialGlobalInterval',_0x7570('0x19'),'dialCheckDuplicateType',_0x7570('0x1a'),'dialAMDInitialSilence',_0x7570('0x1b'),_0x7570('0x1c'),_0x7570('0x1d'),_0x7570('0x1e'),'dialAMDBetweenWordsSilence',_0x7570('0x1f'),_0x7570('0x20'),_0x7570('0x21'),_0x7570('0x22'),'dialRecallMeTimeout',_0x7570('0x23'),_0x7570('0x24'),_0x7570('0x25'),_0x7570('0x26'),_0x7570('0x27'),_0x7570('0x4'),_0x7570('0x28'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x7570('0x29'),'dialNoSuchNumberRetryFrequency',_0x7570('0x2a'),_0x7570('0x2b'),_0x7570('0x2c'),_0x7570('0x2d'),_0x7570('0x2e'),_0x7570('0x2f'),_0x7570('0x30'),'dialAgentRejectRetryFrequency',_0x7570('0x31'),_0x7570('0x32'),'dialPredictiveIntervalMinThreshold',_0x7570('0x33'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x7570('0x34'),'attributes':['id',_0x7570('0x1'),_0x7570('0x35'),_0x7570('0x36')]},{'model':_0x7570('0x37'),'as':'mandatoryDispositionPause','attributes':['id',_0x7570('0x1')]},{'model':_0x7570('0x34'),'as':'TrunkBackup','attributes':['id',_0x7570('0x1'),_0x7570('0x35'),_0x7570('0x36')]},{'model':_0x7570('0x38'),'as':_0x7570('0x38'),'attributes':['id',_0x7570('0x1')],'include':[{'model':'Interval','as':_0x7570('0x39'),'attributes':['id','name','interval']}]}]},'log':_0x7570('0x3a')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a94510f..5623793 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(_0x5ba7a7,_0xf94cc9){var _0x4334b0=function(_0x25172f){while(--_0x25172f){_0x5ba7a7['push'](_0x5ba7a7['shift']());}};_0x4334b0(++_0xf94cc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x45a4cd,_0x433b9a){var _0x1b378f=function(_0x4cfcf9){while(--_0x4cfcf9){_0x45a4cd['push'](_0x45a4cd['shift']());}};_0x1b378f(++_0x433b9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 62bd448..6f4d67f 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 _0x58f9=['../client','Request','getVoiceQueueRtPauses'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x58f9,0x1c2));var _0x958f=function(_0x22f9c2,_0x5aa9a9){_0x22f9c2=_0x22f9c2-0x0;var _0x4326f7=_0x58f9[_0x22f9c2];return _0x4326f7;};'use strict';var client=require(_0x958f('0x0'));exports['getVoiceQueueRtPauses']=function(_0x1d5c4e){return function(){return client[_0x958f('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x1d5c4e,'paused':!![]},'raw':!![]},'log':_0x958f('0x2')});};}; \ No newline at end of file +var _0x7d7d=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d7d,0xab));var _0xd7d7=function(_0x11663d,_0x8b534b){_0x11663d=_0x11663d-0x0;var _0x133bfa=_0x7d7d[_0x11663d];return _0x133bfa;};'use strict';var client=require(_0xd7d7('0x0'));exports[_0xd7d7('0x1')]=function(_0x2af9ba){return function(){return client['Request'](_0xd7d7('0x2'),{'options':{'where':{'VoiceQueueId':_0x2af9ba,'paused':!![]},'raw':!![]},'log':_0xd7d7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 7f78110..ef42d00 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(_0x4db8fd,_0x5be3e9){var _0x328bb9=function(_0x1e881d){while(--_0x1e881d){_0x4db8fd['push'](_0x4db8fd['shift']());}};_0x328bb9(++_0x5be3e9);}(_0x7a54,0x106));var _0x47a5=function(_0x4eae81,_0x259d8a){_0x4eae81=_0x4eae81-0x0;var _0x4f0595=_0x7a54[_0x4eae81];return _0x4f0595;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x36c996,_0x57638c){var _0x38922e=function(_0x570d3a){while(--_0x570d3a){_0x36c996['push'](_0x36c996['shift']());}};_0x38922e(++_0x57638c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 1451aac..9958327 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 _0xed55=['CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','origtransferercontext','attended','../client','blindTransfer','Request','result','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','context','extension','blind'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed55,0x198));var _0x5ed5=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xed55[_0x68ee8b];return _0x5148f7;};'use strict';var client=require(_0x5ed5('0x0'));exports['transfers']={};exports[_0x5ed5('0x1')]=function(_0x597097){return client[_0x5ed5('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x597097[_0x5ed5('0x3')],'transfererchannel':_0x597097['transfererchannel'],'transferercalleridnum':_0x597097['transferercalleridnum'],'transferercalleridname':_0x597097[_0x5ed5('0x4')],'transfererconnectedlinenum':_0x597097['transfererconnectedlinenum'],'transfererconnectedlinename':_0x597097[_0x5ed5('0x5')],'transfereraccountcode':_0x597097[_0x5ed5('0x6')],'transferercontext':_0x597097[_0x5ed5('0x7')],'transfererexten':_0x597097[_0x5ed5('0x8')],'transfererlinkedid':_0x597097[_0x5ed5('0x9')],'transfereechannel':_0x597097[_0x5ed5('0xa')],'transfereecalleridnum':_0x597097[_0x5ed5('0xb')],'transfereecalleridname':_0x597097[_0x5ed5('0xc')],'transfereeconnectedlinenum':_0x597097[_0x5ed5('0xd')],'transfereeconnectedlinename':_0x597097[_0x5ed5('0xe')],'transfereeaccountcode':_0x597097[_0x5ed5('0xf')],'transfereecontext':_0x597097['transfereecontext'],'transfereeexten':_0x597097[_0x5ed5('0x10')],'transfereelinkedid':_0x597097['transfereelinkedid'],'isexternal':_0x597097[_0x5ed5('0x11')],'context':_0x597097[_0x5ed5('0x12')],'extension':_0x597097[_0x5ed5('0x13')],'type':_0x5ed5('0x14')},'log':_0x5ed5('0x15')});};exports[_0x5ed5('0x16')]=function(_0x57ab79){return client[_0x5ed5('0x2')](_0x5ed5('0x15'),{'body':{'result':_0x57ab79[_0x5ed5('0x3')],'transfererchannel':_0x57ab79[_0x5ed5('0x17')],'transferercalleridnum':_0x57ab79[_0x5ed5('0x18')],'transferercalleridname':_0x57ab79[_0x5ed5('0x19')],'transfererconnectedlinenum':_0x57ab79[_0x5ed5('0x1a')],'transfererconnectedlinename':_0x57ab79[_0x5ed5('0x1b')],'transfereraccountcode':_0x57ab79['origtransfereraccountcode'],'transferercontext':_0x57ab79[_0x5ed5('0x1c')],'transfererexten':_0x57ab79[_0x5ed5('0x1d')],'transfererlinkedid':_0x57ab79[_0x5ed5('0x1e')],'transfereechannel':_0x57ab79[_0x5ed5('0x1f')],'transfereecalleridnum':_0x57ab79[_0x5ed5('0x20')],'transfereecalleridname':_0x57ab79[_0x5ed5('0x21')],'transfereeconnectedlinenum':_0x57ab79[_0x5ed5('0x22')],'transfereeconnectedlinename':_0x57ab79[_0x5ed5('0x23')],'transfereeaccountcode':_0x57ab79['transfertargetaccountcode'],'transfereecontext':_0x57ab79[_0x5ed5('0x24')],'transfereeexten':_0x57ab79['transfertargetexten'],'transfereelinkedid':_0x57ab79['transfertargetlinkedid'],'isexternal':_0x57ab79[_0x5ed5('0x11')],'context':_0x57ab79[_0x5ed5('0x25')],'extension':_0x57ab79['origtransfererexten'],'type':_0x5ed5('0x26')},'log':_0x5ed5('0x15')});}; \ No newline at end of file +var _0xec49=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xec49,0x143));var _0x9ec4=function(_0x19b1a8,_0x5b4394){_0x19b1a8=_0x19b1a8-0x0;var _0x43c590=_0xec49[_0x19b1a8];return _0x43c590;};'use strict';var client=require('../client');exports[_0x9ec4('0x0')]={};exports[_0x9ec4('0x1')]=function(_0x30e2c3){return client[_0x9ec4('0x2')](_0x9ec4('0x3'),{'body':{'result':_0x30e2c3['result'],'transfererchannel':_0x30e2c3[_0x9ec4('0x4')],'transferercalleridnum':_0x30e2c3['transferercalleridnum'],'transferercalleridname':_0x30e2c3[_0x9ec4('0x5')],'transfererconnectedlinenum':_0x30e2c3[_0x9ec4('0x6')],'transfererconnectedlinename':_0x30e2c3[_0x9ec4('0x7')],'transfereraccountcode':_0x30e2c3[_0x9ec4('0x8')],'transferercontext':_0x30e2c3[_0x9ec4('0x9')],'transfererexten':_0x30e2c3[_0x9ec4('0xa')],'transfererlinkedid':_0x30e2c3[_0x9ec4('0xb')],'transfereechannel':_0x30e2c3[_0x9ec4('0xc')],'transfereecalleridnum':_0x30e2c3[_0x9ec4('0xd')],'transfereecalleridname':_0x30e2c3[_0x9ec4('0xe')],'transfereeconnectedlinenum':_0x30e2c3['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x30e2c3[_0x9ec4('0xf')],'transfereeaccountcode':_0x30e2c3[_0x9ec4('0x10')],'transfereecontext':_0x30e2c3[_0x9ec4('0x11')],'transfereeexten':_0x30e2c3[_0x9ec4('0x12')],'transfereelinkedid':_0x30e2c3[_0x9ec4('0x13')],'isexternal':_0x30e2c3['isexternal'],'context':_0x30e2c3[_0x9ec4('0x14')],'extension':_0x30e2c3[_0x9ec4('0x15')],'type':_0x9ec4('0x16')},'log':_0x9ec4('0x3')});};exports['attendedTransfer']=function(_0x143501){return client[_0x9ec4('0x2')](_0x9ec4('0x3'),{'body':{'result':_0x143501['result'],'transfererchannel':_0x143501[_0x9ec4('0x17')],'transferercalleridnum':_0x143501[_0x9ec4('0x18')],'transferercalleridname':_0x143501[_0x9ec4('0x19')],'transfererconnectedlinenum':_0x143501[_0x9ec4('0x1a')],'transfererconnectedlinename':_0x143501['secondtransfererconnectedlinename'],'transfereraccountcode':_0x143501[_0x9ec4('0x1b')],'transferercontext':_0x143501[_0x9ec4('0x1c')],'transfererexten':_0x143501['secondtransfererexten'],'transfererlinkedid':_0x143501[_0x9ec4('0x1d')],'transfereechannel':_0x143501[_0x9ec4('0x1e')],'transfereecalleridnum':_0x143501['transfertargetcalleridnum'],'transfereecalleridname':_0x143501[_0x9ec4('0x1f')],'transfereeconnectedlinenum':_0x143501['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x143501['transfertargetconnectedlinename'],'transfereeaccountcode':_0x143501['transfertargetaccountcode'],'transfereecontext':_0x143501[_0x9ec4('0x20')],'transfereeexten':_0x143501[_0x9ec4('0x21')],'transfereelinkedid':_0x143501['transfertargetlinkedid'],'isexternal':_0x143501[_0x9ec4('0x22')],'context':_0x143501[_0x9ec4('0x23')],'extension':_0x143501[_0x9ec4('0x24')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 456bf61..3b63be5 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x53e393,_0x1904bd){var _0x597af9=function(_0x458983){while(--_0x458983){_0x53e393['push'](_0x53e393['shift']());}};_0x597af9(++_0x1904bd);}(_0xb10b,0x12a));var _0xbb10=function(_0x27d0d8,_0x2b657d){_0x27d0d8=_0x27d0d8-0x0;var _0x2b79d1=_0xb10b[_0x27d0d8];return _0x2b79d1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _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(_0x920b34,_0x160f7d){var _0x2ab2a3=function(_0x3fd3d0){while(--_0x3fd3d0){_0x920b34['push'](_0x920b34['shift']());}};_0x2ab2a3(++_0x160f7d);}(_0x7a54,0x106));var _0x47a5=function(_0x177bd2,_0x5374ce){_0x177bd2=_0x177bd2-0x0;var _0x1cb37b=_0x7a54[_0x177bd2];return _0x1cb37b;};'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 1cd39b3..b82f820 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 _0xc59f=['destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','localhost','socket.io-emitter','info','stringify','exec','data1','data2','isNil','data5','data3','split','phone','$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','fax','ListId','scheduledAt','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0xc59f,0xe3));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var BPromise=require(_0xfc59('0x0'));var Redis=require(_0xfc59('0x1'));var util=require(_0xfc59('0x2'));var config=require(_0xfc59('0x3'));var logger=require(_0xfc59('0x4'))(_0xfc59('0x5'));var cmContactRpc=require(_0xfc59('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xfc59('0x7'),'port':0x18eb});var io=require(_0xfc59('0x8'))(new Redis(config['redis']));function emit(_0x31327e,_0x82f8a5,_0x109564,_0x230db0,_0x572cc0){logger[_0xfc59('0x9')]('[CM][%s][%s]',_0x31327e,_0x82f8a5['id'],_0x109564,_0x230db0,JSON[_0xfc59('0xa')](_0x572cc0));io['to'](_0x109564)['emit'](_0x230db0,_0x572cc0);}exports[_0xfc59('0xb')]=function(_0x1561a0,_0x3e451a,_0x3b8901,_0x6ec562){var _0x3d071d,_0xa5a7d3;var _0x32d327={};var _0x9575d0;var _0x534d8f=Number(_0x3b8901[_0xfc59('0xc')]);var _0x5c355c=_0x3b8901[_0xfc59('0xd')]?Boolean(Number(_0x3b8901[_0xfc59('0xd')])):![];var _0x32b203;var _0xc2dcca=![];if(!_[_0xfc59('0xe')](_0x3b8901['data5'])){if(_0x3b8901[_0xfc59('0xf')]=='1')_0xc2dcca=!![];}if(!_0xc2dcca){if(_0x6ec562['xmd-contactid']){_0x32d327['id']=_0x6ec562['xmd-contactid'];}}if(!_0x32d327['id']){_0x32d327['ListId']=_0x534d8f;_0x32b203=_0x3b8901[_0xfc59('0x10')]&&_0x3b8901[_0xfc59('0x10')]!=='0'?_0x3b8901[_0xfc59('0x10')][_0xfc59('0x11')](','):[_0xfc59('0x12')];_0x32d327[_0xfc59('0x13')]=_[_0xfc59('0x14')](_0x32b203,function(_0x3cdf7e){var _0x361ec1={};_0x361ec1[_0x3cdf7e]=_0x6ec562[_0xfc59('0x15')]?_0x6ec562['destcalleridnum']:_0x6ec562[_0xfc59('0x16')];return _0x361ec1;});_0x9575d0=_0x6ec562['routeId']?_0x6ec562[_0xfc59('0x17')]:_0x6ec562[_0xfc59('0x16')];}var _0x4c62fe=['id',_0xfc59('0x18'),_0xfc59('0x19'),_0xfc59('0x12'),_0xfc59('0x1a'),_0xfc59('0x1b'),_0xfc59('0x1c'),'createdAt',_0xfc59('0x1d'),'updatedAt'];var _0x4e2442=_['union'](_0x4c62fe,_0x32b203);BPromise[_0xfc59('0x1e')]()[_0xfc59('0x1f')](cmContactRpc[_0xfc59('0x20')]({'attributes':_0x4e2442,'where':_0x32d327,'phone':_0x9575d0}))[_0xfc59('0x1f')](function(_0x586854){_0xa5a7d3=_0x586854;if(!_[_0xfc59('0x21')](_0xa5a7d3)){if(_0xa5a7d3['length']===0x1){_0x3d071d=_0xa5a7d3[0x0];logger[_0xfc59('0x9')](_0xfc59('0x22'),_0x6ec562[_0xfc59('0x23')],_0x3e451a['id'],_0x3d071d['id']);}else{logger[_0xfc59('0x9')](_0xfc59('0x24'),_0x6ec562[_0xfc59('0x23')],_0x3e451a['id'],_[_0xfc59('0x14')](_0xa5a7d3,'id')['join'](','));}return;}else{logger[_0xfc59('0x9')](_0xfc59('0x25'),_0x6ec562[_0xfc59('0x23')],_0x3e451a['id']);var _0x18b2f1={'ListId':_0x534d8f};var _0x5f14ad=_0x3b8901['data4']&&_0x3b8901[_0xfc59('0x26')]!=='0'?_0x3b8901[_0xfc59('0x26')]:_0xfc59('0x12');if(_0x5c355c){logger['info'](_0xfc59('0x27'),_0x6ec562[_0xfc59('0x23')],_0x3e451a['id']);_0x18b2f1[_0x5f14ad]=_['isNil'](_0x6ec562['routeId'])?_0x6ec562[_0xfc59('0x16')]:_0x6ec562[_0xfc59('0x17')];if(_[_0xfc59('0xe')](_0x6ec562[_0xfc59('0x15')])){_0x18b2f1[_0xfc59('0x18')]=_0x6ec562[_0xfc59('0x28')]&&_0x6ec562[_0xfc59('0x28')]!==_0xfc59('0x29')?_0x6ec562['calleridname']:_0xfc59('0x2a');}else{_0x18b2f1[_0xfc59('0x18')]=_0x6ec562[_0xfc59('0x2b')]&&_0x6ec562['destcalleridname']!==''?_0x6ec562[_0xfc59('0x2b')]:_0xfc59('0x2a');}return BPromise[_0xfc59('0x1e')]()[_0xfc59('0x1f')](cmContactRpc[_0xfc59('0x2c')](_0x18b2f1))[_0xfc59('0x1f')](function(_0x32e287){_0x3d071d=_0x32e287;_0xa5a7d3[_0xfc59('0x2d')](_0x32e287);if(_0x3d071d){logger['info'](_0xfc59('0x2e'),_0x6ec562['uniqueid'],_0x3e451a['id'],_0x3d071d['id']);}return;});}else{logger[_0xfc59('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x6ec562[_0xfc59('0x23')],_0x3e451a['id']);_0x18b2f1[_0x5f14ad]=_[_0xfc59('0xe')](_0x6ec562[_0xfc59('0x15')])?_0x6ec562[_0xfc59('0x16')]:_0x6ec562[_0xfc59('0x17')];if(_[_0xfc59('0xe')](_0x6ec562[_0xfc59('0x15')])){_0x18b2f1[_0xfc59('0x18')]=_0x6ec562[_0xfc59('0x28')]&&_0x6ec562[_0xfc59('0x28')]!==_0xfc59('0x29')?_0x6ec562['calleridname']:_0xfc59('0x2a');}else{_0x18b2f1[_0xfc59('0x18')]=_0x6ec562[_0xfc59('0x2b')]&&_0x6ec562[_0xfc59('0x2b')]!==_0xfc59('0x29')?_0x6ec562['destcalleridname']:_0xfc59('0x2a');}_0x3d071d=_0x18b2f1;_0xa5a7d3[_0xfc59('0x2d')](_0x18b2f1);return;}}})[_0xfc59('0x1f')](function(){if(_0x1561a0){emit(_0x6ec562['uniqueid'],_0x3e451a,util[_0xfc59('0x2f')](_0xfc59('0x30'),_0x1561a0[_0xfc59('0x31')]),util[_0xfc59('0x2f')](_0xfc59('0x32'),_0x3b8901[_0xfc59('0x33')][_0xfc59('0x34')]()),{'evt':_[_0xfc59('0x35')](_0x6ec562,{'autoCreate':_0x5c355c}),'contact':_0x3d071d===undefined?{}:_0x3d071d,'contacts':_0xa5a7d3['length']===0x0?undefined:_0xa5a7d3});}});}; \ No newline at end of file +var _0xa840=['emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','calleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','destcalleridnum','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','merge','bluebird','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify'];(function(_0x276357,_0x4a4691){var _0x4395b2=function(_0x1c5dc9){while(--_0x1c5dc9){_0x276357['push'](_0x276357['shift']());}};_0x4395b2(++_0x4a4691);}(_0xa840,0x17f));var _0x0a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa840[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var BPromise=require(_0x0a84('0x0'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x0a84('0x1'))('trigger');var cmContactRpc=require(_0x0a84('0x2'));config[_0x0a84('0x3')]=_[_0x0a84('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a84('0x5'))(new Redis(config[_0x0a84('0x3')]));function emit(_0x1eb43a,_0x3a97b9,_0x432780,_0x2fc0df,_0x276615){logger[_0x0a84('0x6')](_0x0a84('0x7'),_0x1eb43a,_0x3a97b9['id'],_0x432780,_0x2fc0df,JSON[_0x0a84('0x8')](_0x276615));io['to'](_0x432780)[_0x0a84('0x9')](_0x2fc0df,_0x276615);}exports[_0x0a84('0xa')]=function(_0x227e77,_0x1bd973,_0x29f493,_0x44e9a2){var _0xe49b6a,_0x5f1d31;var _0x287dcb={};var _0x57a045;var _0x2b84fb=Number(_0x29f493[_0x0a84('0xb')]);var _0x506cbc=_0x29f493[_0x0a84('0xc')]?Boolean(Number(_0x29f493[_0x0a84('0xc')])):![];var _0x1287ae;var _0x3e5777=![];if(!_['isNil'](_0x29f493[_0x0a84('0xd')])){if(_0x29f493[_0x0a84('0xd')]=='1')_0x3e5777=!![];}if(!_0x3e5777){if(_0x44e9a2[_0x0a84('0xe')]){_0x287dcb['id']=_0x44e9a2[_0x0a84('0xe')];}}if(!_0x287dcb['id']){_0x287dcb[_0x0a84('0xf')]=_0x2b84fb;_0x1287ae=_0x29f493[_0x0a84('0x10')]&&_0x29f493['data3']!=='0'?_0x29f493['data3'][_0x0a84('0x11')](','):[_0x0a84('0x12')];_0x287dcb[_0x0a84('0x13')]=_[_0x0a84('0x14')](_0x1287ae,function(_0x5b5c23){var _0x3b8aad={};_0x3b8aad[_0x5b5c23]=_0x44e9a2[_0x0a84('0x15')]?_0x44e9a2['destcalleridnum']:_0x44e9a2[_0x0a84('0x16')];return _0x3b8aad;});_0x57a045=_0x44e9a2[_0x0a84('0x15')]?_0x44e9a2['destcalleridnum']:_0x44e9a2['calleridnum'];}var _0x4d32a6=['id',_0x0a84('0x17'),_0x0a84('0x18'),'phone',_0x0a84('0x19'),_0x0a84('0x1a'),_0x0a84('0xf'),_0x0a84('0x1b'),'scheduledAt',_0x0a84('0x1c')];var _0x553f3a=_[_0x0a84('0x1d')](_0x4d32a6,_0x1287ae);BPromise[_0x0a84('0x1e')]()[_0x0a84('0x1f')](cmContactRpc[_0x0a84('0x20')]({'attributes':_0x553f3a,'where':_0x287dcb,'phone':_0x57a045}))[_0x0a84('0x1f')](function(_0x2439e3){_0x5f1d31=_0x2439e3;if(!_[_0x0a84('0x21')](_0x5f1d31)){if(_0x5f1d31[_0x0a84('0x22')]===0x1){_0xe49b6a=_0x5f1d31[0x0];logger[_0x0a84('0x6')](_0x0a84('0x23'),_0x44e9a2['uniqueid'],_0x1bd973['id'],_0xe49b6a['id']);}else{logger[_0x0a84('0x6')](_0x0a84('0x24'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id'],_[_0x0a84('0x14')](_0x5f1d31,'id')[_0x0a84('0x26')](','));}return;}else{logger['info'](_0x0a84('0x27'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id']);var _0x3eb642={'ListId':_0x2b84fb};var _0x215974=_0x29f493[_0x0a84('0x28')]&&_0x29f493[_0x0a84('0x28')]!=='0'?_0x29f493[_0x0a84('0x28')]:_0x0a84('0x12');if(_0x506cbc){logger[_0x0a84('0x6')](_0x0a84('0x29'),_0x44e9a2['uniqueid'],_0x1bd973['id']);_0x3eb642[_0x215974]=_[_0x0a84('0x2a')](_0x44e9a2[_0x0a84('0x15')])?_0x44e9a2[_0x0a84('0x16')]:_0x44e9a2[_0x0a84('0x2b')];if(_['isNil'](_0x44e9a2[_0x0a84('0x15')])){_0x3eb642['firstName']=_0x44e9a2[_0x0a84('0x2c')]&&_0x44e9a2[_0x0a84('0x2c')]!==''?_0x44e9a2['calleridname']:_0x0a84('0x2d');}else{_0x3eb642[_0x0a84('0x17')]=_0x44e9a2[_0x0a84('0x2e')]&&_0x44e9a2[_0x0a84('0x2e')]!==_0x0a84('0x2f')?_0x44e9a2[_0x0a84('0x2e')]:_0x0a84('0x2d');}return BPromise[_0x0a84('0x1e')]()[_0x0a84('0x1f')](cmContactRpc[_0x0a84('0x30')](_0x3eb642))[_0x0a84('0x1f')](function(_0x905a48){_0xe49b6a=_0x905a48;_0x5f1d31[_0x0a84('0x31')](_0x905a48);if(_0xe49b6a){logger[_0x0a84('0x6')](_0x0a84('0x32'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id'],_0xe49b6a['id']);}return;});}else{logger[_0x0a84('0x6')](_0x0a84('0x33'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id']);_0x3eb642[_0x215974]=_[_0x0a84('0x2a')](_0x44e9a2[_0x0a84('0x15')])?_0x44e9a2[_0x0a84('0x16')]:_0x44e9a2[_0x0a84('0x2b')];if(_[_0x0a84('0x2a')](_0x44e9a2[_0x0a84('0x15')])){_0x3eb642[_0x0a84('0x17')]=_0x44e9a2['calleridname']&&_0x44e9a2[_0x0a84('0x2c')]!==''?_0x44e9a2[_0x0a84('0x2c')]:_0x0a84('0x2d');}else{_0x3eb642[_0x0a84('0x17')]=_0x44e9a2[_0x0a84('0x2e')]&&_0x44e9a2['destcalleridname']!==_0x0a84('0x2f')?_0x44e9a2['destcalleridname']:'Unknown';}_0xe49b6a=_0x3eb642;_0x5f1d31['push'](_0x3eb642);return;}}})[_0x0a84('0x1f')](function(){if(_0x227e77){emit(_0x44e9a2['uniqueid'],_0x1bd973,util[_0x0a84('0x34')]('user:%s',_0x227e77[_0x0a84('0x35')]),util[_0x0a84('0x34')](_0x0a84('0x36'),_0x29f493['action']['toLowerCase']()),{'evt':_[_0x0a84('0x37')](_0x44e9a2,{'autoCreate':_0x506cbc}),'contact':_0xe49b6a===undefined?{}:_0xe49b6a,'contacts':_0x5f1d31[_0x0a84('0x22')]===0x0?undefined:_0x5f1d31});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 1d82e5c..9dfe718 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 _0xdfff=['null','substatus','offlineMessage','created','util','lodash','url','mustache','ioredis','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','inspect','checkTriggers','agents','interface','hasOwnProperty','status','checkTrigger','variables','Actions','action','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','toLowerCase','merge','jscripty','name','trigger:%s','exec','integration','queue','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','length','some','debug','evt','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','value','event','agent','membername','lastevent','routeId','mailSubstatus'];(function(_0x7baeca,_0x3ba2b8){var _0x4e5820=function(_0x32bf58){while(--_0x32bf58){_0x7baeca['push'](_0x7baeca['shift']());}};_0x4e5820(++_0x3ba2b8);}(_0xdfff,0x110));var _0xfdff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfff[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xfdff('0x0'));var _=require(_0xfdff('0x1'));var url=require(_0xfdff('0x2'));var Mustache=require(_0xfdff('0x3'));var Redis=require(_0xfdff('0x4'));var urlforward=require('./urlforward');var integration=require(_0xfdff('0x5'));var cmContact=require('./cmContact');var script=require(_0xfdff('0x6'));var config=require(_0xfdff('0x7'));var logger=require(_0xfdff('0x8'))(_0xfdff('0x9'));var ami=require(_0xfdff('0xa'));config[_0xfdff('0xb')]=_[_0xfdff('0xc')](config[_0xfdff('0xb')],{'host':_0xfdff('0xd'),'port':0x18eb});var io=require(_0xfdff('0xe'))(new Redis(config[_0xfdff('0xb')]));var operators={'equals':function(_0x45c451,_0x5ed1cc){return _0x45c451==_0x5ed1cc;},'not_equals':function(_0x5cdb21,_0x4fd397){return _0x5cdb21!=_0x4fd397;}};var barAndWebActions=[_0xfdff('0xf'),_0xfdff('0x2'),_0xfdff('0x10')];function Trigger(_0x345dc9){this[_0xfdff('0x11')]=_0x345dc9[_0xfdff('0x11')];this['agents']=_0x345dc9['agents'];this[_0xfdff('0x12')]=_0x345dc9[_0xfdff('0x12')];this[_0xfdff('0x13')]=_0x345dc9['templates'];this[_0xfdff('0x14')]=_0x345dc9[_0xfdff('0x14')];this[_0xfdff('0x15')]=_0x345dc9[_0xfdff('0x15')];this[_0xfdff('0x16')]=_0x345dc9[_0xfdff('0x16')];this[_0xfdff('0x17')]=_0x345dc9[_0xfdff('0x17')];this[_0xfdff('0x18')]=_0x345dc9[_0xfdff('0x18')];this[_0xfdff('0x19')]=_0x345dc9['zohoAccounts'];this['deskAccounts']=_0x345dc9[_0xfdff('0x1a')];this[_0xfdff('0x1b')]=_0x345dc9[_0xfdff('0x1b')];this['servicenowAccounts']=_0x345dc9[_0xfdff('0x1c')];this[_0xfdff('0x1d')]=_0x345dc9[_0xfdff('0x1d')];this['freshsalesAccounts']=_0x345dc9[_0xfdff('0x1e')];this[_0xfdff('0x1f')]={'zendesk':this[_0xfdff('0x15')],'salesforce':this[_0xfdff('0x17')],'freshdesk':this[_0xfdff('0x16')],'sugarcrm':this[_0xfdff('0x18')],'zoho':this[_0xfdff('0x19')],'desk':this['deskAccounts'],'vtiger':this[_0xfdff('0x1b')],'dynamics365':this[_0xfdff('0x1d')],'freshsales':this[_0xfdff('0x1e')],'servicenow':this[_0xfdff('0x1c')]};ami['on']('custom:agentcalled',this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x22'),this[_0xfdff('0x20')]['bind'](this));ami['on'](_0xfdff('0x23'),this['syncCustomEvent'][_0xfdff('0x21')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x24'),this['syncCustomEvent'][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x25'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x26'),this[_0xfdff('0x20')]['bind'](this));ami['on']('custom:agentreject',this[_0xfdff('0x20')]['bind'](this));ami['on'](_0xfdff('0x27'),this['syncCustomEvent'][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x28'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x29'),this[_0xfdff('0x2a')][_0xfdff('0x21')](this));ami['on']('custom:dialconnect',this[_0xfdff('0x2a')]['bind'](this));ami['on'](_0xfdff('0x2b'),this[_0xfdff('0x2a')][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x2c'),this[_0xfdff('0x20')]['bind'](this));ami['on'](_0xfdff('0x2d'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x2e'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x2f'),this[_0xfdff('0x20')]['bind'](this));ami['on'](_0xfdff('0x30'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x31'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x32'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));ami['on'](_0xfdff('0x33'),this[_0xfdff('0x20')][_0xfdff('0x21')](this));}Trigger[_0xfdff('0x34')][_0xfdff('0x35')]=function(_0x555b76,_0x23d4ca,_0x52bde8){logger[_0xfdff('0x36')](_0x555b76,_0x23d4ca,JSON[_0xfdff('0x37')](_0x52bde8));io['to'](_0x555b76)['emit'](_0x23d4ca,_0x52bde8);};Trigger[_0xfdff('0x34')][_0xfdff('0x20')]=function(_0x557aeb){var _0x3b4d36=_[_0xfdff('0x38')](_0x557aeb);if(typeof _0x3b4d36[_0xfdff('0x39')]===_0xfdff('0x3a')){_0x3b4d36['motionChannel']=_0xfdff('0x3b');}logger['debug']('syncCustomEvent',util[_0xfdff('0x3c')](_0x3b4d36,{'showHidden':!![],'depth':null}));this[_0xfdff('0x3d')](_0x3b4d36);};Trigger[_0xfdff('0x34')][_0xfdff('0x2a')]=function(_0x55fd01){if(this[_0xfdff('0x3e')][_0x55fd01[_0xfdff('0x3f')]]){this['syncCustomEvent'](_0x55fd01);}};Trigger['prototype'][_0xfdff('0x3d')]=function(_0x489356){var _0x1738b5;for(var _0x261095 in this['triggers']){if(this[_0xfdff('0x11')][_0xfdff('0x40')](_0x261095)){if(this[_0xfdff('0x11')][_0x261095][_0xfdff('0x41')]){_0x1738b5=this[_0xfdff('0x42')](this[_0xfdff('0x11')][_0x261095],_0x489356);if(_0x1738b5){_['merge'](_0x489356,_0x489356[_0xfdff('0x43')]);for(var _0x1ff92f=0x0,_0x24020e,_0x5778b5,_0x31520c;_0x1ff92f0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x56aa42,_0x49fdda){var _0x10e1f9=function(_0x128e5d){while(--_0x128e5d){_0x56aa42['push'](_0x56aa42['shift']());}};_0x10e1f9(++_0x49fdda);}(_0x3e74,0x175));var _0x43e7=function(_0x7edda6,_0x5d21ea){_0x7edda6=_0x7edda6-0x0;var _0x4b205b=_0x3e74[_0x7edda6];return _0x4b205b;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 93f8c16..d18363d 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 _0x3156=['\x20eq\x20\x27','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','phonecall','queue','callDirection','phonecalls','Fields','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','data7','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','message','outbound','destcalleridnum','calleridnum','POST','/systemusers(','body','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','GET','contacts?$select=','&$filter='];(function(_0x336ae2,_0x253fc7){var _0x3e404b=function(_0xf3d012){while(--_0xf3d012){_0x336ae2['push'](_0x336ae2['shift']());}};_0x3e404b(++_0x253fc7);}(_0x3156,0x99));var _0x6315=function(_0x4f96bc,_0x32ac60){_0x4f96bc=_0x4f96bc-0x0;var _0x1e3354=_0x3156[_0x4f96bc];return _0x1e3354;};'use strict';var _=require(_0x6315('0x0'));var rp=require(_0x6315('0x1'));var util=require(_0x6315('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x6315('0x3'))(_0x6315('0x4'));var config=require(_0x6315('0x5'));config['redis']=_[_0x6315('0x6')](config[_0x6315('0x7')],{'host':_0x6315('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6315('0x7')]));function getAuthToken(_0x36ee2c,_0x4e20f8,_0x163bdf){if(_0x36ee2c[_0x6315('0x9')]){_0x36ee2c[_0x6315('0xa')]=_0x36ee2c[_0x6315('0xb')]['data7'];_0x36ee2c[_0x6315('0xc')]=_0x36ee2c[_0x6315('0xb')][_0x6315('0xd')];return Promise['resolve'](_0x36ee2c[_0x6315('0xb')]['data5']);}var _0x2d0d3f={'method':'POST','uri':_0x4e20f8,'form':{'client_id':_0x36ee2c['clientId'],'resource':_0x36ee2c[_0x6315('0xa')],'username':_0x36ee2c[_0x6315('0xe')],'password':_0x36ee2c[_0x6315('0xf')],'grant_type':_0x6315('0xf'),'client_secret':_0x36ee2c[_0x6315('0x10')]},'json':!![]};return rp(_0x2d0d3f)[_0x6315('0x11')](function(_0xf7866d){return _0xf7866d[_0x6315('0x12')];})[_0x6315('0x13')](function(_0x1f59ef){logger[_0x6315('0x14')]('['+[_0x163bdf[_0x6315('0x15')]()]+_0x6315('0x16'));return _0x1f59ef['message'];});}function getUser(_0x3d673c,_0x4587a0,_0x15d7be,_0x56fb6b,_0xae4291,_0xc0ff83){return new Promise(function(_0xf54499,_0x34c695){return getAuthToken(_0x4587a0,_0x56fb6b,_0xc0ff83)[_0x6315('0x11')](function(_0x108ac5){var _0x2d4e80={'method':'GET','uri':_0xae4291+_0x6315('0x17'),'headers':{'Authorization':_0x6315('0x18')+_0x108ac5,'OData-Version':_0x6315('0x19')},'json':!![]};return rp(_0x2d4e80);})[_0x6315('0x11')](function(_0x3144c6){var _0x57d32=_0x3144c6[_0x6315('0x1a')];var _0x37e159=![];var _0x74ea74=null;if(!_[_0x6315('0x1b')](_0x15d7be)){if(intUtil[_0x6315('0x1c')](_0x15d7be[_0x6315('0x1d')])){_0x3d673c[_0x6315('0x1e')]=_0x15d7be[_0x6315('0x1d')];for(_0x74ea74=0x0;_0x74ea74<_0x57d32[_0x6315('0x1f')];_0x74ea74++){if(_0x57d32[_0x74ea74]['internalemailaddress']===_0x15d7be['email']&&!_0x57d32[_0x74ea74][_0x6315('0x20')]){_0x37e159=!![];logger[_0x6315('0x21')]('['+[_0xc0ff83['toUpperCase']()]+_0x6315('0x22')+_0x57d32[_0x74ea74][_0x6315('0x23')]+'!');_0x3d673c[_0x6315('0x24')]=_0x57d32[_0x74ea74][_0x6315('0x23')];}}}}if(!_0x37e159){logger[_0x6315('0x21')]('['+[_0xc0ff83['toUpperCase']()]+_0x6315('0x25'));_0x3d673c[_0x6315('0x1e')]=_0x4587a0[_0x6315('0xe')];for(_0x74ea74=0x0;_0x74ea74<_0x57d32['length'];_0x74ea74++){if(_0x57d32[_0x74ea74][_0x6315('0x26')]===_0x4587a0[_0x6315('0xe')]){_0x3d673c[_0x6315('0x24')]=_0x57d32[_0x74ea74][_0x6315('0x23')];}}}_0xf54499(_0x3d673c);})[_0x6315('0x13')](function(_0x3f9eb9){_0x34c695(_0x3f9eb9[_0x6315('0x27')]);});});}function createEndUser(_0x104714,_0x2ce411,_0x472a8b,_0x1f8ea4,_0x32384e,_0xb3e8c3,_0x210739){return new Promise(function(_0x32ea49,_0x387a8a){return getAuthToken(_0x2ce411,_0x472a8b,_0xb3e8c3)[_0x6315('0x11')](function(_0xa1a7a8){var _0x128823=_0xb3e8c3['toLowerCase']()===_0x6315('0x28')?_0x32384e[_0x6315('0x29')]:_0x32384e[_0x6315('0x2a')];var _0x41011e={'method':_0x6315('0x2b'),'uri':_0x1f8ea4+'contacts','body':{'fullname':_0x128823,'firstname':_0x128823,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6315('0x2c')+_0x104714[_0x6315('0x24')]+')'},'headers':{'Authorization':_0x6315('0x18')+_0xa1a7a8,'OData-Version':_0x6315('0x19')},'json':!![],'resolveWithFullResponse':!![]};_0x41011e[_0x6315('0x2d')][_0x210739]=_0x128823;return rp(_0x41011e);})['then'](function(_0x4164bb){var _0x425509=_0x4164bb['headers'][_0x6315('0x2e')];var _0x26f3f5=_0x425509[_0x6315('0x2f')](_0x425509[_0x6315('0x30')]('(')+0x1,_0x425509[_0x6315('0x30')](')'));_0x104714[_0x6315('0x31')]=_0x26f3f5;_0x32ea49(_0x104714);})[_0x6315('0x13')](function(_0x5acc81){_0x387a8a(_0x5acc81[_0x6315('0x27')]);});});}function getEndUser(_0x58a1d2,_0x43a5b3,_0x190ec2,_0x147d67,_0x1c01ad,_0x2d2c58,_0x57510c,_0x578247){var _0x314802=_0x2d2c58[_0x6315('0x32')]()===_0x6315('0x28')?_0x1c01ad[_0x6315('0x29')]:_0x1c01ad[_0x6315('0x2a')];return getAuthToken(_0x43a5b3,_0x190ec2,_0x2d2c58)[_0x6315('0x11')](function(_0x1ae588){_0x578247=_0x578247?_0x578247:_0x6315('0x33');var _0x49fca4={'method':_0x6315('0x34'),'uri':_0x147d67+_0x6315('0x35')+_0x578247+_0x6315('0x36')+_0x578247+_0x6315('0x37')+_0x314802['replace']('+',_0x6315('0x38'))+'\x27','headers':{'Authorization':_0x6315('0x18')+_0x1ae588,'If-None-Match':null,'OData-Version':_0x6315('0x19')},'json':!![]};return rp(_0x49fca4);})[_0x6315('0x11')](function(_0xb2da21){var _0x4766fb=![];if(!_0xb2da21)return _0x4766fb;var _0x51cb12=_0xb2da21[_0x6315('0x1a')];for(var _0x27c3be=0x0;_0x27c3be<_0x51cb12['length'];_0x27c3be++){if(_0x51cb12[_0x27c3be][_0x578247]===_0x314802){_0x4766fb=!![];_0x58a1d2[_0x6315('0x31')]=_0x51cb12[_0x27c3be]['contactid'];}}return _0x4766fb;})['then'](function(_0xbd1c51){if(_0xbd1c51)return _0x58a1d2;if(_0x57510c===_0x6315('0x39')){logger[_0x6315('0x21')]('['+[_0x2d2c58['toUpperCase']()]+_0x6315('0x3a'));return _0x58a1d2;}return createEndUser(_0x58a1d2,_0x43a5b3,_0x190ec2,_0x147d67,_0x1c01ad,_0x2d2c58,_0x578247)[_0x6315('0x11')](function(_0x433462){logger[_0x6315('0x21')]('['+[_0x2d2c58[_0x6315('0x15')]()]+_0x6315('0x3b'),_0x433462[_0x6315('0x31')]);return _0x433462;});});}function getCustomFields(_0x1e5bdd,_0x548450,_0x3a756c){var _0x1486c0={};if(_0x1e5bdd['length']>0x0){_['forEach'](_0x1e5bdd,function(_0x4457a4){if(_[_0x6315('0x3c')](['string',_0x6315('0x3d')],_0x4457a4[_0x6315('0x3e')])&&_0x4457a4[_0x6315('0x3f')]&&!_0x4457a4[_0x6315('0x40')]){var _0x20e1cc=_0x4457a4[_0x6315('0x41')][_0x6315('0x32')]();var _0xe31f0b=_0x20e1cc['substring'](0x0,_0x20e1cc[_0x6315('0x42')]('_'));var _0x3edaa2=_0x20e1cc[_0x6315('0x2f')](_0x20e1cc[_0x6315('0x42')]('_')+0x1);if(_0xe31f0b===_0x3a756c){_0x1486c0[_0x3edaa2]=_0x4457a4[_0x6315('0x43')];}}});}return _0x1486c0;}function getTicket(_0x5aaf0c,_0x48c28,_0x8036fd,_0x223b2a,_0x31456d,_0x4f39da,_0x33181f){return new Promise(function(_0x35af69,_0x591287){var _0x3bf156;return getAuthToken(_0x48c28,_0x8036fd,_0x33181f)[_0x6315('0x11')](function(_0x6b8495){if(_0x4f39da[_0x6315('0x44')]===_0x6315('0x45')){_0x3bf156={'method':_0x6315('0x2b'),'uri':_0x223b2a+'incidents','body':Object[_0x6315('0x46')]({},{'title':intUtil[_0x6315('0x47')](_0x4f39da[_0x6315('0x48')],_0x31456d,'\x20'),'description':intUtil[_0x6315('0x47')](_0x4f39da[_0x6315('0x49')],_0x31456d,'\x0a'),'customerid_contact@odata.bind':_0x5aaf0c['enduserId']?_0x6315('0x4a')+_0x5aaf0c[_0x6315('0x31')]+')':undefined,'ownerid@odata.bind':_0x6315('0x2c')+_0x5aaf0c[_0x6315('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x4f39da['Fields'],_0x31456d,_0x4f39da[_0x6315('0x44')])),'headers':{'Authorization':_0x6315('0x18')+_0x6b8495,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4f39da[_0x6315('0x44')]===_0x6315('0x4b')){var _0x905388=_0x5aaf0c[_0x6315('0x31')]?[{'partyid_systemuser@odata.bind':_0x6315('0x2c')+_0x5aaf0c['userId']+')','participationtypemask':_0x5aaf0c['callDirection']===_0x6315('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x6315('0x4a')+_0x5aaf0c['enduserId']+')','participationtypemask':_0x5aaf0c[_0x6315('0x4d')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6315('0x2c')+_0x5aaf0c[_0x6315('0x24')]+')','participationtypemask':_0x5aaf0c[_0x6315('0x4d')]===_0x6315('0x4c')?0x2:0x1}];_0x3bf156={'method':_0x6315('0x2b'),'uri':_0x223b2a+_0x6315('0x4e'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x4f39da[_0x6315('0x48')],_0x31456d,'\x20'),'phonenumber':String(_0x31456d[_0x6315('0x2a')]),'description':intUtil[_0x6315('0x47')](_0x4f39da[_0x6315('0x49')],_0x31456d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5aaf0c[_0x6315('0x31')]?_0x6315('0x4a')+_0x5aaf0c[_0x6315('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x5aaf0c[_0x6315('0x24')]+')','directioncode':_0x5aaf0c['callDirection']===_0x6315('0x4c')?![]:!![],'phonecall_activity_parties':_0x905388},getCustomFields(_0x4f39da[_0x6315('0x4f')],_0x31456d,_0x4f39da[_0x6315('0x44')])),'headers':{'Authorization':_0x6315('0x18')+_0x6b8495,'OData-Version':_0x6315('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3bf156);})[_0x6315('0x11')](function(_0x1af8c8){var _0x226fc4=_0x1af8c8[_0x6315('0x50')][_0x6315('0x2e')];var _0x53472b=_0x226fc4[_0x6315('0x2f')](_0x226fc4[_0x6315('0x30')]('(')+0x1,_0x226fc4[_0x6315('0x30')](')'));_0x5aaf0c[_0x6315('0x51')]=_0x53472b;_0x35af69(_0x5aaf0c);})[_0x6315('0x13')](function(_0x138311){_0x591287(_0x138311[_0x6315('0x27')]);});});}function emit(_0x4d9522,_0x1540d4,_0x2ebd5f,_0x220fbc){var _0x2bab2b={'uri':util[_0x6315('0x52')](_0x6315('0x53'),_0x4d9522,_0x2ebd5f,_0x220fbc)};io['to'](util['format'](_0x6315('0x54'),_0x1540d4))['emit'](_0x6315('0x55'),_0x2bab2b);}exports['cs']=function(_0x1542af,_0x3edb38,_0x4f056f,_0x4106ee,_0x20e597,_0x5bb06e,_0x2a1d4d,_0x163fe8){var _0x462dac={};_0x5bb06e[_0x6315('0xa')]=_0x5bb06e[_0x6315('0x9')]?intUtil[_0x6315('0x56')](_0x5bb06e[_0x6315('0xb')][_0x6315('0x57')]):intUtil[_0x6315('0x56')](_0x5bb06e[_0x6315('0xa')]);_0x5bb06e['serverUrl']=intUtil['stripTrailingSlash'](_0x5bb06e['serverUrl']);_0x462dac[_0x6315('0x4d')]=_0x163fe8===_0x6315('0x4c')||_0x163fe8==='unmanaged'?_0x6315('0x4c'):_0x6315('0x28');var _0x424f56=_0x5bb06e['modernAuthentication']?util[_0x6315('0x52')](_0x6315('0x58'),_0x5bb06e['CloudProvider']['data7']):util[_0x6315('0x52')]('%s/api/data/v9.0/',_0x5bb06e[_0x6315('0xa')]);var _0x583a10=util[_0x6315('0x52')](_0x6315('0x59'),_0x5bb06e['tenantId']);var _0x17507f=util[_0x6315('0x52')](_0x6315('0x5a'),_0x5bb06e['serverUrl'],_0x3edb38['uniqueid'],md5(_0x3edb38['uniqueid']));if(_0x20e597&&_0x20e597['monitor_format']){logger[_0x6315('0x21')](_0x6315('0x5b'),_0x6315('0x5c'));_0x3edb38[_0x6315('0x5d')]=_0x17507f;}else if(_0x2a1d4d&&_0x2a1d4d[_0x6315('0x5e')]&&_0x2a1d4d['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0x6315('0x5c'));_0x3edb38[_0x6315('0x5d')]=_0x17507f;}else{_0x3edb38[_0x6315('0x5d')]='';}return getUser(_0x462dac,_0x5bb06e,_0x4106ee,_0x583a10,_0x424f56,_0x163fe8)[_0x6315('0x11')](function(_0x4aaca3){logger[_0x6315('0x21')]('['+_0x163fe8[_0x6315('0x15')]()+_0x6315('0x5f'),_0x4aaca3[_0x6315('0x24')]);logger[_0x6315('0x21')]('['+_0x163fe8['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4aaca3[_0x6315('0x1e')]);return getEndUser(_0x4aaca3,_0x5bb06e,_0x583a10,_0x424f56,_0x3edb38,_0x163fe8,_0x4f056f['moduleCreate'],_0x4f056f[_0x6315('0x60')]);})[_0x6315('0x11')](function(_0x3bbf02){logger[_0x6315('0x21')]('['+_0x163fe8[_0x6315('0x15')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3bbf02['enduserId']);logger[_0x6315('0x21')]('['+_0x163fe8[_0x6315('0x15')]()+_0x6315('0x61'),_0x3edb38[_0x6315('0x2a')]);return getTicket(_0x3bbf02,_0x5bb06e,_0x583a10,_0x424f56,_0x3edb38,_0x4f056f,_0x163fe8);})['then'](function(_0x57db04){logger[_0x6315('0x21')](util[_0x6315('0x52')]('['+_0x163fe8[_0x6315('0x15')]()+_0x6315('0x62'),_0x4f056f[_0x6315('0x44')],_0x57db04[_0x6315('0x51')]));logger[_0x6315('0x21')](util[_0x6315('0x52')]('['+_0x163fe8[_0x6315('0x15')]()+_0x6315('0x63'),_0x163fe8));if(_0x163fe8!=='unmanaged'&&_0x4f056f[_0x6315('0x64')]){logger[_0x6315('0x21')]('['+_0x163fe8[_0x6315('0x15')]()+']',_0x6315('0x65'));emit(_0x5bb06e['remoteUri'],_0x4106ee[_0x6315('0x66')],_0x4f056f[_0x6315('0x44')],_0x57db04[_0x6315('0x51')]);}})['catch'](function(_0x38d59f){logger[_0x6315('0x14')]('['+_0x163fe8[_0x6315('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x38d59f[_0x6315('0x27')]);console[_0x6315('0x14')](_0x6315('0x67'),_0x38d59f);});}; \ No newline at end of file +var _0x9de0=['CloudProvider','data7','tenantId','data2','resolve','data5','clientId','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','isNil','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','POST','contacts','/systemusers(','Bearer\x20','4.0','headers','odata-entityid','substring','lastIndexOf','catch','toLowerCase','destcalleridnum','calleridnum','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','value','enduserId','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x9de0,0xd5));var _0x09de=function(_0x13d9bc,_0x598b69){_0x13d9bc=_0x13d9bc-0x0;var _0x54a47a=_0x9de0[_0x13d9bc];return _0x54a47a;};'use strict';var _=require(_0x09de('0x0'));var rp=require(_0x09de('0x1'));var util=require(_0x09de('0x2'));var intUtil=require('./util');var md5=require(_0x09de('0x3'));var Redis=require(_0x09de('0x4'));var logger=require(_0x09de('0x5'))('dynamics365');var config=require(_0x09de('0x6'));config[_0x09de('0x7')]=_[_0x09de('0x8')](config[_0x09de('0x7')],{'host':_0x09de('0x9'),'port':0x18eb});var io=require(_0x09de('0xa'))(new Redis(config['redis']));function getAuthToken(_0x30983f,_0x1ac354,_0x712364){if(_0x30983f[_0x09de('0xb')]){_0x30983f[_0x09de('0xc')]=_0x30983f[_0x09de('0xd')][_0x09de('0xe')];_0x30983f[_0x09de('0xf')]=_0x30983f[_0x09de('0xd')][_0x09de('0x10')];return Promise[_0x09de('0x11')](_0x30983f[_0x09de('0xd')][_0x09de('0x12')]);}var _0x4c748e={'method':'POST','uri':_0x1ac354,'form':{'client_id':_0x30983f[_0x09de('0x13')],'resource':_0x30983f[_0x09de('0xc')],'username':_0x30983f[_0x09de('0x14')],'password':_0x30983f[_0x09de('0x15')],'grant_type':'password','client_secret':_0x30983f[_0x09de('0x16')]},'json':!![]};return rp(_0x4c748e)[_0x09de('0x17')](function(_0x341a2e){return _0x341a2e[_0x09de('0x18')];})['catch'](function(_0x1b99c2){logger[_0x09de('0x19')]('['+[_0x712364[_0x09de('0x1a')]()]+_0x09de('0x1b'));return _0x1b99c2[_0x09de('0x1c')];});}function getUser(_0x1e88a7,_0xf5ef8,_0x1bc313,_0x1e721f,_0x2c2a0e,_0x1e37a7){return new Promise(function(_0x244505,_0x54b949){return getAuthToken(_0xf5ef8,_0x1e721f,_0x1e37a7)[_0x09de('0x17')](function(_0x3b55cb){var _0xb2fc92={'method':_0x09de('0x1d'),'uri':_0x2c2a0e+_0x09de('0x1e'),'headers':{'Authorization':'Bearer\x20'+_0x3b55cb,'OData-Version':'4.0'},'json':!![]};return rp(_0xb2fc92);})[_0x09de('0x17')](function(_0x4c7690){var _0x35c9ce=_0x4c7690['value'];var _0x5df32f=![];var _0x1985ba=null;if(!_[_0x09de('0x1f')](_0x1bc313)){if(intUtil['validateEmail'](_0x1bc313[_0x09de('0x20')])){_0x1e88a7[_0x09de('0x21')]=_0x1bc313[_0x09de('0x20')];for(_0x1985ba=0x0;_0x1985ba<_0x35c9ce[_0x09de('0x22')];_0x1985ba++){if(_0x35c9ce[_0x1985ba]['internalemailaddress']===_0x1bc313['email']&&!_0x35c9ce[_0x1985ba][_0x09de('0x23')]){_0x5df32f=!![];logger[_0x09de('0x24')]('['+[_0x1e37a7[_0x09de('0x1a')]()]+_0x09de('0x25')+_0x35c9ce[_0x1985ba][_0x09de('0x26')]+'!');_0x1e88a7[_0x09de('0x27')]=_0x35c9ce[_0x1985ba]['systemuserid'];}}}}if(!_0x5df32f){logger['info']('['+[_0x1e37a7['toUpperCase']()]+_0x09de('0x28'));_0x1e88a7['userEmail']=_0xf5ef8[_0x09de('0x14')];for(_0x1985ba=0x0;_0x1985ba<_0x35c9ce[_0x09de('0x22')];_0x1985ba++){if(_0x35c9ce[_0x1985ba]['internalemailaddress']===_0xf5ef8[_0x09de('0x14')]){_0x1e88a7[_0x09de('0x27')]=_0x35c9ce[_0x1985ba][_0x09de('0x26')];}}}_0x244505(_0x1e88a7);})['catch'](function(_0x5a5680){_0x54b949(_0x5a5680[_0x09de('0x1c')]);});});}function createEndUser(_0x373fc6,_0x477ac0,_0x354727,_0x56f569,_0xe4dc97,_0x2ce022,_0x3be74a){return new Promise(function(_0x22ff86,_0xd01a9b){return getAuthToken(_0x477ac0,_0x354727,_0x2ce022)[_0x09de('0x17')](function(_0x31e3b6){var _0x214bc1=_0x2ce022['toLowerCase']()===_0x09de('0x29')?_0xe4dc97['destcalleridnum']:_0xe4dc97['calleridnum'];var _0x3453c2={'method':_0x09de('0x2a'),'uri':_0x56f569+_0x09de('0x2b'),'body':{'fullname':_0x214bc1,'firstname':_0x214bc1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x09de('0x2c')+_0x373fc6[_0x09de('0x27')]+')'},'headers':{'Authorization':_0x09de('0x2d')+_0x31e3b6,'OData-Version':_0x09de('0x2e')},'json':!![],'resolveWithFullResponse':!![]};_0x3453c2['body'][_0x3be74a]=_0x214bc1;return rp(_0x3453c2);})['then'](function(_0x4fbeb3){var _0x5a77d2=_0x4fbeb3[_0x09de('0x2f')][_0x09de('0x30')];var _0x5e31fa=_0x5a77d2[_0x09de('0x31')](_0x5a77d2['lastIndexOf']('(')+0x1,_0x5a77d2[_0x09de('0x32')](')'));_0x373fc6['enduserId']=_0x5e31fa;_0x22ff86(_0x373fc6);})[_0x09de('0x33')](function(_0x227d1a){_0xd01a9b(_0x227d1a['message']);});});}function getEndUser(_0x341073,_0x5e7dbf,_0x2ae756,_0x538b35,_0x3a1acf,_0x542fc6,_0x482293,_0x533804){var _0x4416ef=_0x542fc6[_0x09de('0x34')]()==='outbound'?_0x3a1acf[_0x09de('0x35')]:_0x3a1acf[_0x09de('0x36')];return getAuthToken(_0x5e7dbf,_0x2ae756,_0x542fc6)['then'](function(_0x1e455d){_0x533804=_0x533804?_0x533804:'telephone1';var _0xc6bfbd={'method':'GET','uri':_0x538b35+_0x09de('0x37')+_0x533804+_0x09de('0x38')+_0x533804+_0x09de('0x39')+_0x4416ef['replace']('+',_0x09de('0x3a'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1e455d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xc6bfbd);})[_0x09de('0x17')](function(_0x2047ea){var _0x4a501b=![];if(!_0x2047ea)return _0x4a501b;var _0x3a0660=_0x2047ea[_0x09de('0x3b')];for(var _0x3e83f8=0x0;_0x3e83f8<_0x3a0660[_0x09de('0x22')];_0x3e83f8++){if(_0x3a0660[_0x3e83f8][_0x533804]===_0x4416ef){_0x4a501b=!![];_0x341073[_0x09de('0x3c')]=_0x3a0660[_0x3e83f8]['contactid'];}}return _0x4a501b;})[_0x09de('0x17')](function(_0x3a151a){if(_0x3a151a)return _0x341073;if(_0x482293===_0x09de('0x3d')){logger[_0x09de('0x24')]('['+[_0x542fc6['toUpperCase']()]+_0x09de('0x3e'));return _0x341073;}return createEndUser(_0x341073,_0x5e7dbf,_0x2ae756,_0x538b35,_0x3a1acf,_0x542fc6,_0x533804)['then'](function(_0x54b725){logger['info']('['+[_0x542fc6[_0x09de('0x1a')]()]+_0x09de('0x3f'),_0x54b725[_0x09de('0x3c')]);return _0x54b725;});});}function getCustomFields(_0x223e49,_0x4bf51f,_0x3e2066){var _0x13cee7={};if(_0x223e49[_0x09de('0x22')]>0x0){_[_0x09de('0x40')](_0x223e49,function(_0x5f049b){if(_[_0x09de('0x41')]([_0x09de('0x42'),_0x09de('0x43')],_0x5f049b[_0x09de('0x44')])&&_0x5f049b[_0x09de('0x45')]&&!_0x5f049b['customField']){var _0x1afbe4=_0x5f049b['idField']['toLowerCase']();var _0x574cc9=_0x1afbe4[_0x09de('0x31')](0x0,_0x1afbe4['indexOf']('_'));var _0x1e7747=_0x1afbe4[_0x09de('0x31')](_0x1afbe4[_0x09de('0x46')]('_')+0x1);if(_0x574cc9===_0x3e2066){_0x13cee7[_0x1e7747]=_0x5f049b[_0x09de('0x47')];}}});}return _0x13cee7;}function getTicket(_0x2d8ece,_0x57513c,_0x124542,_0x4ee7ee,_0x13bb77,_0x8e42f9,_0x19d720){return new Promise(function(_0x5af21a,_0x5e8956){var _0x32e040;return getAuthToken(_0x57513c,_0x124542,_0x19d720)['then'](function(_0x31e3dd){if(_0x8e42f9[_0x09de('0x48')]===_0x09de('0x49')){_0x32e040={'method':_0x09de('0x2a'),'uri':_0x4ee7ee+_0x09de('0x4a'),'body':Object[_0x09de('0x4b')]({},{'title':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4d')],_0x13bb77,'\x20'),'description':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4e')],_0x13bb77,'\x0a'),'customerid_contact@odata.bind':_0x2d8ece[_0x09de('0x3c')]?_0x09de('0x4f')+_0x2d8ece['enduserId']+')':undefined,'ownerid@odata.bind':_0x09de('0x2c')+_0x2d8ece[_0x09de('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x8e42f9[_0x09de('0x50')],_0x13bb77,_0x8e42f9['ticketType'])),'headers':{'Authorization':_0x09de('0x2d')+_0x31e3dd,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x8e42f9[_0x09de('0x48')]===_0x09de('0x51')){var _0x451f9e=_0x2d8ece[_0x09de('0x3c')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2d8ece[_0x09de('0x27')]+')','participationtypemask':_0x2d8ece['callDirection']===_0x09de('0x52')?0x2:0x1},{'partyid_contact@odata.bind':_0x09de('0x4f')+_0x2d8ece[_0x09de('0x3c')]+')','participationtypemask':_0x2d8ece[_0x09de('0x53')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2d8ece[_0x09de('0x27')]+')','participationtypemask':_0x2d8ece[_0x09de('0x53')]===_0x09de('0x52')?0x2:0x1}];_0x32e040={'method':_0x09de('0x2a'),'uri':_0x4ee7ee+'phonecalls','body':Object[_0x09de('0x4b')]({},{'subject':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4d')],_0x13bb77,'\x20'),'phonenumber':String(_0x13bb77[_0x09de('0x36')]),'description':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4e')],_0x13bb77,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2d8ece[_0x09de('0x3c')]?_0x09de('0x4f')+_0x2d8ece['enduserId']+')':undefined,'ownerid@odata.bind':_0x09de('0x2c')+_0x2d8ece[_0x09de('0x27')]+')','directioncode':_0x2d8ece['callDirection']===_0x09de('0x52')?![]:!![],'phonecall_activity_parties':_0x451f9e},getCustomFields(_0x8e42f9['Fields'],_0x13bb77,_0x8e42f9[_0x09de('0x48')])),'headers':{'Authorization':'Bearer\x20'+_0x31e3dd,'OData-Version':_0x09de('0x2e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x32e040);})[_0x09de('0x17')](function(_0x2270c4){var _0x1243a8=_0x2270c4[_0x09de('0x2f')]['odata-entityid'];var _0x1e5cdb=_0x1243a8[_0x09de('0x31')](_0x1243a8['lastIndexOf']('(')+0x1,_0x1243a8[_0x09de('0x32')](')'));_0x2d8ece['ticketId']=_0x1e5cdb;_0x5af21a(_0x2d8ece);})[_0x09de('0x33')](function(_0x5ac2b8){_0x5e8956(_0x5ac2b8['message']);});});}function emit(_0x6dc7bc,_0x428a8b,_0x441f87,_0xb4babb){var _0x35ef1c={'uri':util['format'](_0x09de('0x54'),_0x6dc7bc,_0x441f87,_0xb4babb)};io['to'](util[_0x09de('0x55')](_0x09de('0x56'),_0x428a8b))['emit'](_0x09de('0x57'),_0x35ef1c);}exports['cs']=function(_0x19f947,_0x536069,_0x14141f,_0x2b751d,_0x206b89,_0x39369b,_0x483c7b,_0x4f52d7){var _0x2fa877={};_0x39369b[_0x09de('0xc')]=_0x39369b[_0x09de('0xb')]?intUtil[_0x09de('0x58')](_0x39369b[_0x09de('0xd')][_0x09de('0xe')]):intUtil[_0x09de('0x58')](_0x39369b[_0x09de('0xc')]);_0x39369b['serverUrl']=intUtil[_0x09de('0x58')](_0x39369b[_0x09de('0x59')]);_0x2fa877[_0x09de('0x53')]=_0x4f52d7==='queue'||_0x4f52d7===_0x09de('0x5a')?_0x09de('0x52'):_0x09de('0x29');var _0x73db=_0x39369b[_0x09de('0xb')]?util[_0x09de('0x55')](_0x09de('0x5b'),_0x39369b[_0x09de('0xd')][_0x09de('0xe')]):util[_0x09de('0x55')](_0x09de('0x5b'),_0x39369b['remoteUri']);var _0x1f6ed3=util[_0x09de('0x55')](_0x09de('0x5c'),_0x39369b[_0x09de('0xf')]);var _0x24bc11=util[_0x09de('0x55')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39369b[_0x09de('0x59')],_0x536069[_0x09de('0x5d')],md5(_0x536069[_0x09de('0x5d')]));if(_0x206b89&&_0x206b89[_0x09de('0x5e')]){logger[_0x09de('0x24')]('[QUEUE]','Recording\x20is\x20enabled!');_0x536069[_0x09de('0x5f')]=_0x24bc11;}else if(_0x483c7b&&_0x483c7b[_0x09de('0x60')]&&_0x483c7b[_0x09de('0x60')]!=='none'){logger[_0x09de('0x24')](_0x09de('0x61'),_0x09de('0x62'));_0x536069[_0x09de('0x5f')]=_0x24bc11;}else{_0x536069[_0x09de('0x5f')]='';}return getUser(_0x2fa877,_0x39369b,_0x2b751d,_0x1f6ed3,_0x73db,_0x4f52d7)[_0x09de('0x17')](function(_0x53ff70){logger[_0x09de('0x24')]('['+_0x4f52d7['toUpperCase']()+_0x09de('0x63'),_0x53ff70[_0x09de('0x27')]);logger['info']('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x64'),_0x53ff70[_0x09de('0x21')]);return getEndUser(_0x53ff70,_0x39369b,_0x1f6ed3,_0x73db,_0x536069,_0x4f52d7,_0x14141f[_0x09de('0x65')],_0x14141f[_0x09de('0x66')]);})['then'](function(_0x387001){logger[_0x09de('0x24')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x67'),_0x387001['enduserId']);logger['info']('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x68'),_0x536069['calleridnum']);return getTicket(_0x387001,_0x39369b,_0x1f6ed3,_0x73db,_0x536069,_0x14141f,_0x4f52d7);})[_0x09de('0x17')](function(_0x597f2a){logger[_0x09de('0x24')](util[_0x09de('0x55')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x69'),_0x14141f['ticketType'],_0x597f2a[_0x09de('0x6a')]));logger[_0x09de('0x24')](util[_0x09de('0x55')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x6b'),_0x4f52d7));if(_0x4f52d7!==_0x09de('0x5a')&&_0x14141f[_0x09de('0x6c')]){logger[_0x09de('0x24')]('['+_0x4f52d7[_0x09de('0x1a')]()+']',_0x09de('0x6d'));emit(_0x39369b[_0x09de('0xc')],_0x2b751d[_0x09de('0x6e')],_0x14141f[_0x09de('0x48')],_0x597f2a['ticketId']);}})[_0x09de('0x33')](function(_0x54113f){logger[_0x09de('0x19')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x6f'),_0x54113f[_0x09de('0x1c')]);console['error'](_0x09de('0x70'),_0x54113f);});}; \ 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 0f43e3d..0ade109 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 _0x3cee=['Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','error','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','util','ioredis','freshdesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','remoteUri','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','toString','base64','debug','[HTTP]','stringify','GET','forEach','string','type','nameField','toLowerCase','content','includes','idField','push','variable','variableName','customField','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none'];(function(_0x4daa05,_0x5e001c){var _0x36fdf3=function(_0x1d1d32){while(--_0x1d1d32){_0x4daa05['push'](_0x4daa05['shift']());}};_0x36fdf3(++_0x5e001c);}(_0x3cee,0x17c));var _0xe3ce=function(_0x4a0b2e,_0x3b2aa3){_0x4a0b2e=_0x4a0b2e-0x0;var _0x2f5843=_0x3cee[_0x4a0b2e];return _0x2f5843;};'use strict';var _=require(_0xe3ce('0x0'));var rp=require(_0xe3ce('0x1'));var md5=require('md5');var util=require(_0xe3ce('0x2'));var Redis=require(_0xe3ce('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe3ce('0x4'));config[_0xe3ce('0x5')]=_[_0xe3ce('0x6')](config[_0xe3ce('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe3ce('0x7'))(new Redis(config[_0xe3ce('0x5')]));var headers={'Content-Type':_0xe3ce('0x8'),'Accept':_0xe3ce('0x8')};function emit(_0x48ed4a,_0x4eba1a,_0x4c8ca2){io['to'](_0x48ed4a)['emit'](_0x4eba1a,_0x4c8ca2);}function getTicket(_0x43f5ef,_0x33a17d,_0x326f4b,_0x2d5e16,_0x2df968){logger[_0xe3ce('0x9')](_0xe3ce('0xa'));var _0x1cebd2=_[_0xe3ce('0xb')]({'responder_id':_0x33a17d['id'],'requester_id':_0x326f4b['id'],'name':util[_0xe3ce('0xc')](_0xe3ce('0xd'),_0x2df968[_0xe3ce('0xe')]),'phone':_0x2df968[_0xe3ce('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2d5e16[_0xe3ce('0x10')],_0x2df968,'\x20'),'description':intUtil[_0xe3ce('0x11')](_0x2d5e16[_0xe3ce('0x12')],_0x2df968,_0xe3ce('0x13')),'tags':getTags(_0x2d5e16[_0xe3ce('0x14')],_0xe3ce('0x15'))},getCustomFields(_0x2d5e16[_0xe3ce('0x16')],_0x2df968));_0x1cebd2['custom_fields']=_['mapValues'](_[_0xe3ce('0x17')](_0x1cebd2[_0xe3ce('0x18')],'id'),_0xe3ce('0x19'));return request({'uri':util['format'](_0xe3ce('0x1a'),_0x43f5ef['remoteUri']),'method':_0xe3ce('0x1b'),'body':_0x1cebd2})['then'](function(_0x3b9bbf){logger[_0xe3ce('0x9')](_0xe3ce('0x1c'));return _0x3b9bbf;});}function getUser(_0xf00b89,_0x347430){if(intUtil[_0xe3ce('0x1d')](_0x347430)){return request({'uri':util['format']('%s/api/v2/agents',_0xf00b89[_0xe3ce('0x1e')]),'qs':{'email':_0x347430}})[_0xe3ce('0x1f')](function(_0x46ad54){if(_0x46ad54[_0xe3ce('0x20')]){logger['info'](_0xe3ce('0x21'));return _[_0xe3ce('0x22')](_0x46ad54,function(_0xc2dc27){return _0xc2dc27[_0xe3ce('0x23')][_0xe3ce('0x24')]===_0x347430;});}else{logger[_0xe3ce('0x9')](_0xe3ce('0x25'));return request({'uri':util[_0xe3ce('0xc')](_0xe3ce('0x26'),_0xf00b89[_0xe3ce('0x1e')])})[_0xe3ce('0x1f')](function(_0x2e97b9){logger['info'](_0xe3ce('0x27'));return _0x2e97b9;});}});}else{logger[_0xe3ce('0x9')](_0xe3ce('0x28'));return request({'uri':util[_0xe3ce('0xc')](_0xe3ce('0x26'),_0xf00b89[_0xe3ce('0x1e')])})[_0xe3ce('0x1f')](function(_0x259534){logger[_0xe3ce('0x9')]('Admin\x20account\x20selected.');return _0x259534;});}}function getEndUser(_0x40152b,_0x35dc34,_0x39b993){logger['info'](_0xe3ce('0x29'),_0x39b993);return request({'uri':util['format'](_0xe3ce('0x2a'),_0x40152b[_0xe3ce('0x1e')]),'qs':{'phone':_0x39b993}})[_0xe3ce('0x1f')](function(_0x4c9b99){if(_0x4c9b99[_0xe3ce('0x20')]){logger['info'](_0xe3ce('0x2b'));return _[_0xe3ce('0x22')](_0x4c9b99,{'phone':_0x39b993});}else{logger[_0xe3ce('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xe3ce('0xc')](_0xe3ce('0x2a'),_0x40152b[_0xe3ce('0x1e')]),'method':_0xe3ce('0x1b'),'body':{'name':_0x35dc34,'phone':_0x39b993}})[_0xe3ce('0x1f')](function(_0x55c274){logger['info']('Enduser\x20created.');return _0x55c274;});}});}function getAuth(_0x1f4032){return util[_0xe3ce('0xc')]('Basic\x20%s',new Buffer(_0x1f4032['apiKey']+':X')[_0xe3ce('0x2c')](_0xe3ce('0x2d')));}function request(_0x219e51){logger[_0xe3ce('0x2e')](_0xe3ce('0x2f'),JSON[_0xe3ce('0x30')](_0x219e51));return rp(_['defaults'](_0x219e51,{'method':_0xe3ce('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x20ad26,_0x3460b0){var _0x5910e8=[];if(_0x20ad26&&_0x20ad26[_0xe3ce('0x20')]>0x0){_0x5910e8=_['map'](_0x20ad26,_0x3460b0);}return _0x5910e8;}function getCustomFields(_0x33e55d,_0x39b9d1){var _0x5ec538=[];var _0x30d54f={'custom_fields':[]};if(_0x33e55d[_0xe3ce('0x20')]>0x0){_[_0xe3ce('0x32')](_0x33e55d,function(_0x1261c4){if(_['includes']([_0xe3ce('0x33'),'picklist'],_0x1261c4[_0xe3ce('0x34')])&&_0x1261c4[_0xe3ce('0x35')]&&!_0x1261c4['customField']){_0x30d54f[_0x1261c4[_0xe3ce('0x35')][_0xe3ce('0x36')]()]=_0x1261c4[_0xe3ce('0x37')]['toString']();}else if(_[_0xe3ce('0x38')]([_0xe3ce('0x33'),'picklist'],_0x1261c4[_0xe3ce('0x34')])&&_0x1261c4[_0xe3ce('0x39')]&&_0x1261c4['customField']){_0x30d54f[_0xe3ce('0x18')][_0xe3ce('0x3a')]({'id':_0x1261c4[_0xe3ce('0x39')],'value':_0x1261c4['content'][_0xe3ce('0x2c')]()});}else if(_0x1261c4[_0xe3ce('0x34')]===_0xe3ce('0x3b')&&_0x1261c4[_0xe3ce('0x3c')]&&_0x1261c4[_0xe3ce('0x39')]&&_0x1261c4[_0xe3ce('0x3d')]){_0x39b9d1[_0x1261c4[_0xe3ce('0x3c')]]&&_0x30d54f[_0xe3ce('0x18')][_0xe3ce('0x3a')]({'id':_0x1261c4['idField'],'value':_0x39b9d1[_0x1261c4[_0xe3ce('0x3c')]][_0xe3ce('0x2c')]()});}else if(_0x1261c4[_0xe3ce('0x34')]===_0xe3ce('0x3e')&&_0x1261c4[_0xe3ce('0x3f')]&&_0x1261c4['Variable']['name']&&_0x1261c4[_0xe3ce('0x39')]&&_0x1261c4[_0xe3ce('0x3d')]){_0x39b9d1[_0x1261c4[_0xe3ce('0x3f')][_0xe3ce('0x15')]['toLowerCase']()]&&_0x30d54f[_0xe3ce('0x18')][_0xe3ce('0x3a')]({'id':_0x1261c4[_0xe3ce('0x39')],'value':_0x39b9d1[_0x1261c4[_0xe3ce('0x3f')][_0xe3ce('0x15')][_0xe3ce('0x36')]()][_0xe3ce('0x2c')]()});}});}return _0x30d54f;}exports[_0xe3ce('0x40')]=function(_0x4b46bf,_0x26b010,_0x138279,_0x17541b,_0x33c8e8,_0x5bbc54){var _0x142fb0,_0x50d1bc;_0x5bbc54[_0xe3ce('0x1e')]=intUtil['stripTrailingSlash'](_0x5bbc54[_0xe3ce('0x1e')]);_0x5bbc54[_0xe3ce('0x41')]=intUtil[_0xe3ce('0x42')](_0x5bbc54['serverUrl']);if(_0x33c8e8&&_0x33c8e8['monitor_format']){logger[_0xe3ce('0x9')](_0xe3ce('0x43'),_0xe3ce('0x44'));_0x26b010[_0xe3ce('0x45')]=util['format'](_0xe3ce('0x46'),_0x5bbc54['serverUrl'],_0x26b010[_0xe3ce('0x47')],md5(_0x26b010[_0xe3ce('0x47')]));}else{_0x26b010['recordingURL']='';}headers['Authorization']=getAuth(_0x5bbc54);return getUser(_0x5bbc54,_0x17541b[_0xe3ce('0x24')])[_0xe3ce('0x1f')](function(_0x3bf321){_0x142fb0=_0x3bf321;logger['info'](_0xe3ce('0x48'),_0x142fb0['id']);return getEndUser(_0x5bbc54,_0x26b010[_0xe3ce('0xe')],_0x26b010[_0xe3ce('0xf')]);})[_0xe3ce('0x1f')](function(_0x482723){_0x50d1bc=_0x482723;logger[_0xe3ce('0x9')](_0xe3ce('0x49'),_0x50d1bc['id']);return getTicket(_0x5bbc54,_0x142fb0,_0x50d1bc,_0x138279,_0x26b010);})[_0xe3ce('0x1f')](function(_0x29c82b){if(_0x29c82b&&_0x29c82b['id']){logger[_0xe3ce('0x9')]('Ticket\x20created!');logger[_0xe3ce('0x9')]('The\x20Ticket\x20ID\x20is:',_0x29c82b['id']);logger[_0xe3ce('0x9')](_0xe3ce('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe3ce('0xc')](_0xe3ce('0x4a'),_0x17541b[_0xe3ce('0x15')]),_0xe3ce('0x4b'),{'uri':util[_0xe3ce('0xc')]('%s/helpdesk/tickets/%d',_0x5bbc54[_0xe3ce('0x1e')],_0x29c82b['id'])});}})[_0xe3ce('0x4c')](function(_0x555029){logger['error'](_0xe3ce('0x43'),JSON[_0xe3ce('0x30')](_0x555029));});};exports[_0xe3ce('0x4d')]=function(_0x4669d5,_0x142911,_0x39a15a,_0x10a6e9,_0xa2f2e0,_0x47fc65,_0x14233c){var _0xe6ec6e,_0x4cda05;_0x47fc65['remoteUri']=intUtil['stripTrailingSlash'](_0x47fc65[_0xe3ce('0x1e')]);_0x47fc65[_0xe3ce('0x41')]=intUtil[_0xe3ce('0x42')](_0x47fc65[_0xe3ce('0x41')]);if(_0x14233c&&_0x14233c[_0xe3ce('0x4e')]&&_0x14233c['recordingFormat']!==_0xe3ce('0x4f')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x142911[_0xe3ce('0x45')]=util[_0xe3ce('0xc')](_0xe3ce('0x46'),_0x47fc65[_0xe3ce('0x41')],_0x142911['uniqueid'],md5(_0x142911[_0xe3ce('0x47')]));}headers[_0xe3ce('0x50')]=getAuth(_0x47fc65);return getUser(_0x47fc65,_0x10a6e9[_0xe3ce('0x24')])[_0xe3ce('0x1f')](function(_0x538321){_0xe6ec6e=_0x538321;logger[_0xe3ce('0x9')](_0xe3ce('0x48'),_0xe6ec6e['id']);return getEndUser(_0x47fc65,_0x142911[_0xe3ce('0x51')],_0x142911[_0xe3ce('0x52')]);})[_0xe3ce('0x1f')](function(_0x13e40c){_0x4cda05=_0x13e40c;logger[_0xe3ce('0x9')](_0xe3ce('0x49'),_0x4cda05['id']);return getTicket(_0x47fc65,_0xe6ec6e,_0x4cda05,_0x39a15a,_0x142911);})['then'](function(_0x2f2782){if(_0x2f2782&&_0x2f2782['id']){logger['info'](_0xe3ce('0x1c'));logger['info'](_0xe3ce('0x53'),_0x2f2782['id']);logger[_0xe3ce('0x9')](_0xe3ce('0x54'),_0xe3ce('0x55'));emit(util['format'](_0xe3ce('0x4a'),_0x10a6e9[_0xe3ce('0x15')]),_0xe3ce('0x4b'),{'uri':util[_0xe3ce('0xc')](_0xe3ce('0x56'),_0x47fc65[_0xe3ce('0x1e')],_0x2f2782['id'])});}})[_0xe3ce('0x4c')](function(_0x3243b4){logger[_0xe3ce('0x57')](_0xe3ce('0x54'),JSON[_0xe3ce('0x30')](_0x3243b4));});};exports[_0xe3ce('0x58')]=function(_0x467bb5,_0x41973c,_0xbe1399,_0x5ac61d,_0x5ee446,_0x461f6a){var _0x176444,_0x3796e3;_0x461f6a[_0xe3ce('0x1e')]=intUtil[_0xe3ce('0x42')](_0x461f6a[_0xe3ce('0x1e')]);_0x461f6a[_0xe3ce('0x41')]=intUtil[_0xe3ce('0x42')](_0x461f6a[_0xe3ce('0x41')]);if(_0x5ee446&&_0x5ee446[_0xe3ce('0x59')]){logger['info']('['+_0x41973c['lastevent'][_0xe3ce('0x5a')]()+']',_0xe3ce('0x44'));_0x41973c['recordingURL']=util['format'](_0xe3ce('0x46'),_0x461f6a[_0xe3ce('0x41')],_0x41973c[_0xe3ce('0x47')],md5(_0x41973c[_0xe3ce('0x47')]));}else{_0x41973c[_0xe3ce('0x45')]='';}headers['Authorization']=getAuth(_0x461f6a);return getUser(_0x461f6a,'')[_0xe3ce('0x1f')](function(_0x2be519){_0x176444=_0x2be519;logger[_0xe3ce('0x9')]('The\x20User\x20ID\x20is:',_0x176444['id']);return getEndUser(_0x461f6a,_0x41973c[_0xe3ce('0xe')],_0x41973c[_0xe3ce('0xf')]);})[_0xe3ce('0x1f')](function(_0x5228db){_0x3796e3=_0x5228db;logger[_0xe3ce('0x9')](_0xe3ce('0x49'),_0x3796e3['id']);return getTicket(_0x461f6a,_0x176444,_0x3796e3,_0xbe1399,_0x41973c);})[_0xe3ce('0x1f')](function(_0x4da051){if(_0x4da051){logger[_0xe3ce('0x9')]('Ticket\x20created!');logger[_0xe3ce('0x9')](_0xe3ce('0x53'),_0x4da051['id']);}})[_0xe3ce('0x4c')](function(_0x3ff334){logger[_0xe3ce('0x57')]('['+_0x41973c[_0xe3ce('0x5b')][_0xe3ce('0x5a')]()+']',JSON[_0xe3ce('0x30')](_0x3ff334));});}; \ No newline at end of file +var _0x955c=['push','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','unmanaged','lastevent','The\x20User\x20ID\x20is:','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridnum','Subjects','getString','
','mapValues','%s/api/v2/tickets','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','find','POST','Enduser\x20created.','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','nameField','customField','toLowerCase','toString','includes','type','idField','content','variable','custom_fields','variableName','customVariable','Variable','name'];(function(_0x3e1175,_0x443838){var _0x2d609d=function(_0x30377b){while(--_0x30377b){_0x3e1175['push'](_0x3e1175['shift']());}};_0x2d609d(++_0x443838);}(_0x955c,0x1ee));var _0xc955=function(_0x259c0f,_0x1c8c1f){_0x259c0f=_0x259c0f-0x0;var _0xa73514=_0x955c[_0x259c0f];return _0xa73514;};'use strict';var _=require(_0xc955('0x0'));var rp=require(_0xc955('0x1'));var md5=require('md5');var util=require(_0xc955('0x2'));var Redis=require(_0xc955('0x3'));var intUtil=require(_0xc955('0x4'));var config=require(_0xc955('0x5'));var logger=require(_0xc955('0x6'))(_0xc955('0x7'));config[_0xc955('0x8')]=_[_0xc955('0x9')](config['redis'],{'host':_0xc955('0xa'),'port':0x18eb});var io=require(_0xc955('0xb'))(new Redis(config[_0xc955('0x8')]));var headers={'Content-Type':_0xc955('0xc'),'Accept':_0xc955('0xc')};function emit(_0x1b7b18,_0x41356b,_0x249b4a){io['to'](_0x1b7b18)[_0xc955('0xd')](_0x41356b,_0x249b4a);}function getTicket(_0x3ef396,_0x5909cc,_0x578afc,_0x3486a1,_0x4427fa){logger[_0xc955('0xe')]('Creating\x20new\x20ticket...');var _0x4ea14a=_[_0xc955('0xf')]({'responder_id':_0x5909cc['id'],'requester_id':_0x578afc['id'],'name':util[_0xc955('0x10')]('Caller\x20-\x20%s',_0x4427fa['calleridname']),'phone':_0x4427fa[_0xc955('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3486a1[_0xc955('0x12')],_0x4427fa,'\x20'),'description':intUtil[_0xc955('0x13')](_0x3486a1['Descriptions'],_0x4427fa,_0xc955('0x14')),'tags':getTags(_0x3486a1['Tags'],'name')},getCustomFields(_0x3486a1['Fields'],_0x4427fa));_0x4ea14a['custom_fields']=_[_0xc955('0x15')](_['keyBy'](_0x4ea14a['custom_fields'],'id'),'value');return request({'uri':util[_0xc955('0x10')](_0xc955('0x16'),_0x3ef396['remoteUri']),'method':'POST','body':_0x4ea14a})['then'](function(_0x1dc39f){logger[_0xc955('0xe')](_0xc955('0x17'));return _0x1dc39f;});}function getUser(_0x3371bb,_0x39c562){if(intUtil[_0xc955('0x18')](_0x39c562)){return request({'uri':util[_0xc955('0x10')](_0xc955('0x19'),_0x3371bb[_0xc955('0x1a')]),'qs':{'email':_0x39c562}})['then'](function(_0x592c90){if(_0x592c90[_0xc955('0x1b')]){logger[_0xc955('0xe')]('Agent\x20found!');return _['find'](_0x592c90,function(_0xe137c9){return _0xe137c9[_0xc955('0x1c')][_0xc955('0x1d')]===_0x39c562;});}else{logger[_0xc955('0xe')](_0xc955('0x1e'));return request({'uri':util['format'](_0xc955('0x1f'),_0x3371bb[_0xc955('0x1a')])})[_0xc955('0x20')](function(_0x57552c){logger[_0xc955('0xe')](_0xc955('0x21'));return _0x57552c;});}});}else{logger['info'](_0xc955('0x22'));return request({'uri':util[_0xc955('0x10')](_0xc955('0x1f'),_0x3371bb[_0xc955('0x1a')])})[_0xc955('0x20')](function(_0x27e38b){logger[_0xc955('0xe')](_0xc955('0x21'));return _0x27e38b;});}}function getEndUser(_0xf70d73,_0x5068c0,_0xdf4940){logger[_0xc955('0xe')]('Searching\x20enduser\x20with\x20phone',_0xdf4940);return request({'uri':util[_0xc955('0x10')](_0xc955('0x23'),_0xf70d73[_0xc955('0x1a')]),'qs':{'phone':_0xdf4940}})[_0xc955('0x20')](function(_0x394c4b){if(_0x394c4b[_0xc955('0x1b')]){logger[_0xc955('0xe')](_0xc955('0x24'));return _[_0xc955('0x25')](_0x394c4b,{'phone':_0xdf4940});}else{logger[_0xc955('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc955('0x10')](_0xc955('0x23'),_0xf70d73['remoteUri']),'method':_0xc955('0x26'),'body':{'name':_0x5068c0,'phone':_0xdf4940}})[_0xc955('0x20')](function(_0x573328){logger['info'](_0xc955('0x27'));return _0x573328;});}});}function getAuth(_0x2a5973){return util[_0xc955('0x10')]('Basic\x20%s',new Buffer(_0x2a5973[_0xc955('0x28')]+':X')['toString'](_0xc955('0x29')));}function request(_0x16aafb){logger[_0xc955('0x2a')](_0xc955('0x2b'),JSON[_0xc955('0x2c')](_0x16aafb));return rp(_[_0xc955('0x9')](_0x16aafb,{'method':_0xc955('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x5be30e,_0x317093){var _0x3b7a73=[];if(_0x5be30e&&_0x5be30e[_0xc955('0x1b')]>0x0){_0x3b7a73=_[_0xc955('0x2e')](_0x5be30e,_0x317093);}return _0x3b7a73;}function getCustomFields(_0xe5d7dd,_0x2d574c){var _0x55bdb2=[];var _0x1613a9={'custom_fields':[]};if(_0xe5d7dd[_0xc955('0x1b')]>0x0){_[_0xc955('0x2f')](_0xe5d7dd,function(_0x4a675e){if(_['includes']([_0xc955('0x30'),_0xc955('0x31')],_0x4a675e['type'])&&_0x4a675e[_0xc955('0x32')]&&!_0x4a675e[_0xc955('0x33')]){_0x1613a9[_0x4a675e[_0xc955('0x32')][_0xc955('0x34')]()]=_0x4a675e['content'][_0xc955('0x35')]();}else if(_[_0xc955('0x36')](['string',_0xc955('0x31')],_0x4a675e[_0xc955('0x37')])&&_0x4a675e[_0xc955('0x38')]&&_0x4a675e[_0xc955('0x33')]){_0x1613a9['custom_fields']['push']({'id':_0x4a675e['idField'],'value':_0x4a675e[_0xc955('0x39')]['toString']()});}else if(_0x4a675e[_0xc955('0x37')]===_0xc955('0x3a')&&_0x4a675e['variableName']&&_0x4a675e['idField']&&_0x4a675e['customField']){_0x2d574c[_0x4a675e['variableName']]&&_0x1613a9[_0xc955('0x3b')]['push']({'id':_0x4a675e[_0xc955('0x38')],'value':_0x2d574c[_0x4a675e[_0xc955('0x3c')]]['toString']()});}else if(_0x4a675e[_0xc955('0x37')]===_0xc955('0x3d')&&_0x4a675e[_0xc955('0x3e')]&&_0x4a675e[_0xc955('0x3e')][_0xc955('0x3f')]&&_0x4a675e[_0xc955('0x38')]&&_0x4a675e[_0xc955('0x33')]){_0x2d574c[_0x4a675e[_0xc955('0x3e')][_0xc955('0x3f')]['toLowerCase']()]&&_0x1613a9['custom_fields'][_0xc955('0x40')]({'id':_0x4a675e['idField'],'value':_0x2d574c[_0x4a675e[_0xc955('0x3e')][_0xc955('0x3f')][_0xc955('0x34')]()][_0xc955('0x35')]()});}});}return _0x1613a9;}exports[_0xc955('0x41')]=function(_0x358ac3,_0xc48f06,_0x2fe5cc,_0x2f1ab5,_0x23051a,_0x4af230){var _0x353304,_0x599db7;_0x4af230['remoteUri']=intUtil['stripTrailingSlash'](_0x4af230[_0xc955('0x1a')]);_0x4af230[_0xc955('0x42')]=intUtil[_0xc955('0x43')](_0x4af230[_0xc955('0x42')]);if(_0x23051a&&_0x23051a[_0xc955('0x44')]){logger['info'](_0xc955('0x45'),_0xc955('0x46'));_0xc48f06['recordingURL']=util[_0xc955('0x10')](_0xc955('0x47'),_0x4af230['serverUrl'],_0xc48f06[_0xc955('0x48')],md5(_0xc48f06[_0xc955('0x48')]));}else{_0xc48f06[_0xc955('0x49')]='';}headers['Authorization']=getAuth(_0x4af230);return getUser(_0x4af230,_0x2f1ab5[_0xc955('0x1d')])[_0xc955('0x20')](function(_0x4b997a){_0x353304=_0x4b997a;logger[_0xc955('0xe')]('The\x20User\x20ID\x20is:',_0x353304['id']);return getEndUser(_0x4af230,_0xc48f06[_0xc955('0x4a')],_0xc48f06[_0xc955('0x11')]);})[_0xc955('0x20')](function(_0x32b39b){_0x599db7=_0x32b39b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x599db7['id']);return getTicket(_0x4af230,_0x353304,_0x599db7,_0x2fe5cc,_0xc48f06);})['then'](function(_0x2a9f8f){if(_0x2a9f8f&&_0x2a9f8f['id']){logger[_0xc955('0xe')](_0xc955('0x17'));logger[_0xc955('0xe')](_0xc955('0x4b'),_0x2a9f8f['id']);logger[_0xc955('0xe')]('[QUEUE]',_0xc955('0x4c'));emit(util['format']('user:%s',_0x2f1ab5[_0xc955('0x3f')]),_0xc955('0x4d'),{'uri':util[_0xc955('0x10')](_0xc955('0x4e'),_0x4af230[_0xc955('0x1a')],_0x2a9f8f['id'])});}})[_0xc955('0x4f')](function(_0x51971d){logger[_0xc955('0x50')](_0xc955('0x45'),JSON[_0xc955('0x2c')](_0x51971d));});};exports[_0xc955('0x51')]=function(_0x5555ba,_0x28ea4a,_0x459eb4,_0xaf03ec,_0x44af0a,_0x4d3355,_0x30acf4){var _0x1132ca,_0x12d431;_0x4d3355[_0xc955('0x1a')]=intUtil['stripTrailingSlash'](_0x4d3355[_0xc955('0x1a')]);_0x4d3355[_0xc955('0x42')]=intUtil[_0xc955('0x43')](_0x4d3355[_0xc955('0x42')]);if(_0x30acf4&&_0x30acf4[_0xc955('0x52')]&&_0x30acf4['recordingFormat']!==_0xc955('0x53')){logger[_0xc955('0xe')](_0xc955('0x54'),_0xc955('0x46'));_0x28ea4a[_0xc955('0x49')]=util[_0xc955('0x10')](_0xc955('0x47'),_0x4d3355[_0xc955('0x42')],_0x28ea4a[_0xc955('0x48')],md5(_0x28ea4a[_0xc955('0x48')]));}headers[_0xc955('0x55')]=getAuth(_0x4d3355);return getUser(_0x4d3355,_0xaf03ec[_0xc955('0x1d')])[_0xc955('0x20')](function(_0x400374){_0x1132ca=_0x400374;logger[_0xc955('0xe')]('The\x20User\x20ID\x20is:',_0x1132ca['id']);return getEndUser(_0x4d3355,_0x28ea4a[_0xc955('0x56')],_0x28ea4a[_0xc955('0x57')]);})[_0xc955('0x20')](function(_0x26799f){_0x12d431=_0x26799f;logger['info'](_0xc955('0x58'),_0x12d431['id']);return getTicket(_0x4d3355,_0x1132ca,_0x12d431,_0x459eb4,_0x28ea4a);})['then'](function(_0x3dd3db){if(_0x3dd3db&&_0x3dd3db['id']){logger[_0xc955('0xe')](_0xc955('0x17'));logger[_0xc955('0xe')](_0xc955('0x4b'),_0x3dd3db['id']);logger[_0xc955('0xe')](_0xc955('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc955('0x10')]('user:%s',_0xaf03ec[_0xc955('0x3f')]),_0xc955('0x4d'),{'uri':util[_0xc955('0x10')]('%s/helpdesk/tickets/%d',_0x4d3355[_0xc955('0x1a')],_0x3dd3db['id'])});}})[_0xc955('0x4f')](function(_0x3df831){logger[_0xc955('0x50')](_0xc955('0x54'),JSON[_0xc955('0x2c')](_0x3df831));});};exports[_0xc955('0x59')]=function(_0x53173d,_0x532514,_0x316117,_0x21999c,_0xf0c734,_0x55e639){var _0x41605e,_0x89497;_0x55e639['remoteUri']=intUtil[_0xc955('0x43')](_0x55e639['remoteUri']);_0x55e639[_0xc955('0x42')]=intUtil[_0xc955('0x43')](_0x55e639[_0xc955('0x42')]);if(_0xf0c734&&_0xf0c734[_0xc955('0x44')]){logger[_0xc955('0xe')]('['+_0x532514[_0xc955('0x5a')]['toUpperCase']()+']',_0xc955('0x46'));_0x532514['recordingURL']=util['format'](_0xc955('0x47'),_0x55e639[_0xc955('0x42')],_0x532514[_0xc955('0x48')],md5(_0x532514[_0xc955('0x48')]));}else{_0x532514['recordingURL']='';}headers[_0xc955('0x55')]=getAuth(_0x55e639);return getUser(_0x55e639,'')[_0xc955('0x20')](function(_0x47dce4){_0x41605e=_0x47dce4;logger[_0xc955('0xe')](_0xc955('0x5b'),_0x41605e['id']);return getEndUser(_0x55e639,_0x532514[_0xc955('0x4a')],_0x532514[_0xc955('0x11')]);})['then'](function(_0x325278){_0x89497=_0x325278;logger[_0xc955('0xe')](_0xc955('0x58'),_0x89497['id']);return getTicket(_0x55e639,_0x41605e,_0x89497,_0x316117,_0x532514);})[_0xc955('0x20')](function(_0xca8caf){if(_0xca8caf){logger[_0xc955('0xe')]('Ticket\x20created!');logger[_0xc955('0xe')](_0xc955('0x4b'),_0xca8caf['id']);}})[_0xc955('0x4f')](function(_0x52b378){logger['error']('['+_0x532514[_0xc955('0x5a')][_0xc955('0x5c')]()+']',JSON[_0xc955('0x2c')](_0x52b378));});}; \ 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 a06f8a7..0131a6b 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 _0xee19=['User\x20found:','adminEmail','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','contact','getString','Contact','add','ticketId','Task\x20created:','/contacts/','emit','trigger:browser:url','stripTrailingSlash','remoteUri','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId'];(function(_0x135356,_0x3c3391){var _0x1aa8ff=function(_0x4f79bc){while(--_0x4f79bc){_0x135356['push'](_0x135356['shift']());}};_0x1aa8ff(++_0x3c3391);}(_0xee19,0x80));var _0x9ee1=function(_0x49a375,_0x5d4c8b){_0x49a375=_0x49a375-0x0;var _0x11f66d=_0xee19[_0x49a375];return _0x11f66d;};'use strict';var _=require(_0x9ee1('0x0'));var rp=require(_0x9ee1('0x1'));var md5=require('md5');var util=require(_0x9ee1('0x2'));var moment=require('moment');var Promise=require(_0x9ee1('0x3'));var Redis=require(_0x9ee1('0x4'));var intUtil=require('./util');var config=require(_0x9ee1('0x5'));var logger=require(_0x9ee1('0x6'))(_0x9ee1('0x7'));config['redis']=_[_0x9ee1('0x8')](config[_0x9ee1('0x9')],{'host':_0x9ee1('0xa'),'port':0x18eb});var io=require(_0x9ee1('0xb'))(new Redis(config[_0x9ee1('0x9')]));function getAdminId(_0xca060e,_0x51db92,_0xbd2a1d,_0x4f4c00){return new Promise(function(_0x1010e5,_0x87c2de){var _0x51e945=![];var _0x2cbd69={'method':_0x9ee1('0xc'),'uri':_0x4f4c00+_0x9ee1('0xd'),'json':!![]};_0x2cbd69['headers']=_0xbd2a1d;logger[_0x9ee1('0xe')](_0x9ee1('0xf'));return rp(_0x2cbd69)[_0x9ee1('0x10')](function(_0x31a239){if(_0x31a239){var _0x23db9f=_0x31a239[_0x9ee1('0x11')];var _0x3ff182=null;for(_0x3ff182=0x0;_0x3ff182<_0x23db9f['length'];_0x3ff182++){if(_0x23db9f[_0x3ff182][_0x9ee1('0x12')]===_0xca060e['adminEmail']){_0xca060e[_0x9ee1('0x13')]=_0x23db9f[_0x3ff182]['id'];_0x51e945=!![];}}if(_0x51e945){logger[_0x9ee1('0xe')](_0x9ee1('0x14'),_0xca060e[_0x9ee1('0x13')]);_0x1010e5(_0xca060e);}else{_0x87c2de({'statusCode':0x194,'message':_0x9ee1('0x15')});}}else{_0x87c2de({'statusCode':0x194,'message':_0x9ee1('0x15')});}})[_0x9ee1('0x16')](function(_0x4b7ad5){logger[_0x9ee1('0x17')]('['+[_0x51db92[_0x9ee1('0x18')]()]+']',_0x4b7ad5[_0x9ee1('0x19')]);_0x87c2de(_0x4b7ad5);});});}function getUser(_0x59ef07,_0x170af7,_0x3fd0a0){return function(_0x3f2a32){return new Promise(function(_0x25f59f,_0x1b18e5){var _0x89b51c={'method':'GET','uri':_0x3fd0a0+_0x9ee1('0xd'),'json':!![]};_0x89b51c['headers']=_0x170af7;logger['info'](_0x9ee1('0x1a'));return rp(_0x89b51c)[_0x9ee1('0x10')](function(_0x119afc){if(_0x119afc){var _0x446458=_0x119afc['users'];var _0x53f768=![];var _0x4e26a5=null;if(_0x3f2a32[_0x9ee1('0x1b')]!==null){logger[_0x9ee1('0xe')](_0x9ee1('0x1c'),_0x3f2a32[_0x9ee1('0x1b')]);_0x3f2a32[_0x9ee1('0x1d')]=_0x3f2a32[_0x9ee1('0x1b')];for(_0x4e26a5=0x0;_0x4e26a5<_0x446458[_0x9ee1('0x1e')];_0x4e26a5++){if(_0x446458[_0x4e26a5][_0x9ee1('0x12')]===_0x3f2a32['agentEmail']){_0x53f768=!![];_0x3f2a32[_0x9ee1('0x1f')]=_0x446458[_0x4e26a5]['id'];logger[_0x9ee1('0xe')](_0x9ee1('0x20'),_0x3f2a32[_0x9ee1('0x1f')]);}}}if(!_0x53f768){logger['info']('Admin\x20selected');_0x3f2a32['userEmail']=_0x3f2a32[_0x9ee1('0x21')];_0x3f2a32[_0x9ee1('0x1f')]=_0x3f2a32[_0x9ee1('0x13')];_0x53f768=!![];}if(_0x53f768){_0x25f59f(_0x3f2a32);}else{_0x1b18e5({'statusCode':0x194,'message':_0x9ee1('0x15')});}}else{_0x1b18e5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x9ee1('0x16')](function(_0x456e53){logger[_0x9ee1('0x17')]('['+[_0x59ef07[_0x9ee1('0x18')]()]+']',_0x456e53[_0x9ee1('0x19')]);_0x1b18e5(_0x456e53);});});};}function searchContact(_0x3e3463,_0x4fade1,_0x308361,_0x3f80b8){return new Promise(function(_0x4024f6,_0x1fb669){var _0x129d9d={'method':'GET','headers':_0x4fade1,'uri':_0x3e3463+_0x9ee1('0x22')+_0x3f80b8+_0x9ee1('0x23')+_0x308361+_0x9ee1('0x24'),'json':!![]};rp(_0x129d9d)[_0x9ee1('0x10')](function(_0x4d0742){var _0x31fd15=_[_0x9ee1('0x25')](_0x4d0742[_0x9ee1('0x26')][_0x9ee1('0x26')],[_0x308361,_0x3f80b8]);_0x4024f6(_0x31fd15);})[_0x9ee1('0x16')](function(_0x48dde9){_0x1fb669(_0x48dde9);});});}function getEndUser(_0x57dc09,_0x2a913f,_0x14848b){return function(_0xa86cca){return new Promise(function(_0x3bee6e,_0x284e74){logger['info'](util[_0x9ee1('0x27')](_0x9ee1('0x28'),_0xa86cca['contactNumber']));searchContact(_0x14848b,_0x2a913f,_0x9ee1('0x29'),_0xa86cca[_0x9ee1('0x2a')])[_0x9ee1('0x10')](function(_0x2f80a4){if(_0x2f80a4){_0xa86cca[_0x9ee1('0x2b')]=_0x2f80a4['id'];logger[_0x9ee1('0xe')](_0x9ee1('0x2c'),_0xa86cca['endUserId']);return _0x3bee6e(_0xa86cca);}searchContact(_0x14848b,_0x2a913f,'work_number',_0xa86cca[_0x9ee1('0x2a')])['then'](function(_0xe33212){if(_0xe33212){_0xa86cca['endUserId']=_0xe33212['id'];logger[_0x9ee1('0xe')](_0x9ee1('0x2d'),_0xa86cca[_0x9ee1('0x2b')]);return _0x3bee6e(_0xa86cca);}createEndUser(_0xa86cca,_0x57dc09,_0x2a913f,_0x14848b)[_0x9ee1('0x10')](function(_0x3e517d){logger[_0x9ee1('0xe')]('Contact\x20created:',_0x3e517d[_0x9ee1('0x2b')]);return _0x3bee6e(_0x3e517d);});});})[_0x9ee1('0x16')](function(_0x13c815){_0x284e74(_0x13c815);});});};}function createEndUser(_0x1ef9ca,_0x4f8f24,_0x1ccf14,_0x50cd91){return new Promise(function(_0x4dff7d,_0x3e5733){var _0x5a07de=moment();var _0x231832={'method':_0x9ee1('0x2e'),'uri':_0x50cd91+_0x9ee1('0x2f'),'body':{'contact':{'last_name':_0x1ef9ca[_0x9ee1('0x2a')],'work_number':_0x1ef9ca[_0x9ee1('0x2a')],'mobile_number':_0x1ef9ca[_0x9ee1('0x2a')],'owner_id':_0x1ef9ca[_0x9ee1('0x1f')],'created_at':_0x5a07de[_0x9ee1('0x27')](_0x9ee1('0x30'))}},'json':!![]};_0x231832[_0x9ee1('0x31')]=_0x1ccf14;logger[_0x9ee1('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x231832)[_0x9ee1('0x10')](function(_0x209a58){_0x1ef9ca[_0x9ee1('0x2b')]=_0x209a58[_0x9ee1('0x32')]['id'];_0x4dff7d(_0x1ef9ca);})[_0x9ee1('0x16')](function(_0x242b9e){logger[_0x9ee1('0x17')]('['+[_0x4f8f24[_0x9ee1('0x18')]()]+']',_0x242b9e[_0x9ee1('0x19')]);_0x3e5733(_0x242b9e[_0x9ee1('0x19')]);});});}function getTicket(_0x321999,_0xb64de4,_0x39afb3,_0x4c3377,_0x465bbf){return function(_0x2d65f3){logger[_0x9ee1('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x2e5396,_0x1378b4){var _0x167752=moment();var _0x1434c4={'method':_0x9ee1('0x2e'),'uri':_0x39afb3+'/api/tasks','body':{'title':intUtil[_0x9ee1('0x33')](_0x4c3377['Subjects'],_0x465bbf,'\x20'),'description':intUtil[_0x9ee1('0x33')](_0x4c3377['Descriptions'],_0x465bbf,'\x0a'),'owner_id':_0x2d65f3[_0x9ee1('0x1f')],'creater_id':_0x2d65f3[_0x9ee1('0x13')],'targetable_id':_0x2d65f3[_0x9ee1('0x2b')],'targetable_type':_0x9ee1('0x34'),'created_at':_0x167752[_0x9ee1('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x167752[_0x9ee1('0x35')](0x1e,'m')['format'](_0x9ee1('0x30'))},'json':!![]};_0x1434c4['headers']=_0xb64de4;return rp(_0x1434c4)[_0x9ee1('0x10')](function(_0x49087d){_0x2d65f3[_0x9ee1('0x36')]=_0x49087d['task']['id'];logger[_0x9ee1('0xe')](_0x9ee1('0x37'),_0x2d65f3['ticketId']);_0x2e5396(_0x2d65f3);})['catch'](function(_0x2d9d54){logger['error']('['+[_0x321999[_0x9ee1('0x18')]()]+']',_0x2d9d54['message']);_0x1378b4(_0x2d9d54['message']);});});};}function emit(_0x1b203c,_0x26b56d,_0x388199){var _0x27868a={'uri':_0x1b203c+_0x9ee1('0x38')+_0x388199};io['to'](util['format']('user:%s',_0x26b56d))[_0x9ee1('0x39')](_0x9ee1('0x3a'),_0x27868a);}exports['cs']=function(_0x3a6811,_0x20ee63,_0x860690,_0x5103ba,_0x958e90,_0x55e007,_0x227c1b,_0x5c03ab){var _0x5f0cbe={};var _0x3a7a2c={'Authorization':'Token\x20token='+_0x55e007['apiKey']};_0x55e007['remoteUri']=intUtil[_0x9ee1('0x3b')](_0x55e007[_0x9ee1('0x3c')]);_0x55e007[_0x9ee1('0x3d')]=intUtil[_0x9ee1('0x3b')](_0x55e007[_0x9ee1('0x3d')]);var _0x1ae63c=_0x55e007['remoteUri'];_0x5f0cbe[_0x9ee1('0x21')]=_0x55e007['username'];_0x5f0cbe[_0x9ee1('0x2a')]=_0x5c03ab[_0x9ee1('0x3e')]()===_0x9ee1('0x3f')?_0x20ee63[_0x9ee1('0x40')]:_0x20ee63[_0x9ee1('0x41')];_0x5f0cbe['callDirection']=_0x5c03ab==='queue'||_0x5c03ab==='unmanaged'?_0x9ee1('0x42'):'outbound';if(_0x5103ba){_0x5f0cbe[_0x9ee1('0x1b')]=_0x5103ba[_0x9ee1('0x12')];}var _0x17c932=util[_0x9ee1('0x27')](_0x9ee1('0x43'),_0x55e007[_0x9ee1('0x3d')],_0x20ee63[_0x9ee1('0x44')],md5(_0x20ee63['uniqueid']));if(_0x958e90&&_0x958e90[_0x9ee1('0x45')]){logger['info'](_0x9ee1('0x46'),'Recording\x20is\x20enabled!');_0x20ee63[_0x9ee1('0x47')]=_0x17c932;}else if(_0x227c1b&&_0x227c1b[_0x9ee1('0x48')]&&_0x227c1b[_0x9ee1('0x48')]!=='none'){logger[_0x9ee1('0xe')]('[OUTBOUND]',_0x9ee1('0x49'));_0x20ee63['recordingURL']=_0x17c932;}else{_0x20ee63['recordingURL']='';}return getAdminId(_0x5f0cbe,_0x5c03ab,_0x3a7a2c,_0x1ae63c)[_0x9ee1('0x10')](getUser(_0x5c03ab,_0x3a7a2c,_0x1ae63c))[_0x9ee1('0x10')](getEndUser(_0x5c03ab,_0x3a7a2c,_0x1ae63c))[_0x9ee1('0x10')](getTicket(_0x5c03ab,_0x3a7a2c,_0x1ae63c,_0x860690,_0x20ee63))[_0x9ee1('0x10')](function(_0x3cac8e){logger[_0x9ee1('0xe')](util[_0x9ee1('0x27')](_0x9ee1('0x4a'),_0x3cac8e[_0x9ee1('0x36')]));if(_0x5c03ab!==_0x9ee1('0x4b')){logger['info']('['+[_0x5c03ab[_0x9ee1('0x18')]()]+']',_0x9ee1('0x4c'));emit(_0x1ae63c,_0x5103ba[_0x9ee1('0x4d')],_0x3cac8e[_0x9ee1('0x2b')]);}})[_0x9ee1('0x16')](function(_0x50c1e0){logger[_0x9ee1('0x17')]('['+[_0x5c03ab[_0x9ee1('0x18')]()]+_0x9ee1('0x4e'),util[_0x9ee1('0x4f')](_0x50c1e0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x56df=['calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','headers','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','agentEmail','Getting\x20user\x20with\x20email','userId','Admin\x20selected','userEmail','message','/api/lookup?q=','&entities=contact','contacts','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','format','YYYY-MM-DDTHH:mm:ss','ticketId','task','user:%s','emit','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum'];(function(_0x28eea8,_0x1de20d){var _0x5e4aef=function(_0x3b5a99){while(--_0x3b5a99){_0x28eea8['push'](_0x28eea8['shift']());}};_0x5e4aef(++_0x1de20d);}(_0x56df,0xad));var _0xf56d=function(_0x313c4b,_0x46923c){_0x313c4b=_0x313c4b-0x0;var _0x3ea454=_0x56df[_0x313c4b];return _0x3ea454;};'use strict';var _=require(_0xf56d('0x0'));var rp=require(_0xf56d('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0xf56d('0x2'));var Promise=require(_0xf56d('0x3'));var Redis=require(_0xf56d('0x4'));var intUtil=require(_0xf56d('0x5'));var config=require(_0xf56d('0x6'));var logger=require('../../../../config/logger')(_0xf56d('0x7'));config[_0xf56d('0x8')]=_[_0xf56d('0x9')](config['redis'],{'host':_0xf56d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x22a767,_0x549367,_0x2110b3,_0xff7422){return new Promise(function(_0x385967,_0x454d91){var _0x17c171=![];var _0x293803={'method':'GET','uri':_0xff7422+'/api/selector/owners','json':!![]};_0x293803[_0xf56d('0xb')]=_0x2110b3;logger[_0xf56d('0xc')]('Getting\x20admin\x20information');return rp(_0x293803)[_0xf56d('0xd')](function(_0x510b57){if(_0x510b57){var _0x5b0376=_0x510b57[_0xf56d('0xe')];var _0x22cae1=null;for(_0x22cae1=0x0;_0x22cae1<_0x5b0376[_0xf56d('0xf')];_0x22cae1++){if(_0x5b0376[_0x22cae1][_0xf56d('0x10')]===_0x22a767[_0xf56d('0x11')]){_0x22a767[_0xf56d('0x12')]=_0x5b0376[_0x22cae1]['id'];_0x17c171=!![];}}if(_0x17c171){logger[_0xf56d('0xc')](_0xf56d('0x13'),_0x22a767[_0xf56d('0x12')]);_0x385967(_0x22a767);}else{_0x454d91({'statusCode':0x194,'message':_0xf56d('0x14')});}}else{_0x454d91({'statusCode':0x194,'message':_0xf56d('0x14')});}})[_0xf56d('0x15')](function(_0x5140b4){logger[_0xf56d('0x16')]('['+[_0x549367[_0xf56d('0x17')]()]+']',_0x5140b4['message']);_0x454d91(_0x5140b4);});});}function getUser(_0x45fd30,_0x883ef2,_0x5aa870){return function(_0x1de8b0){return new Promise(function(_0x477b5c,_0x2717d5){var _0x13bc81={'method':_0xf56d('0x18'),'uri':_0x5aa870+'/api/selector/owners','json':!![]};_0x13bc81[_0xf56d('0xb')]=_0x883ef2;logger[_0xf56d('0xc')]('Getting\x20user\x20list');return rp(_0x13bc81)['then'](function(_0x5b4442){if(_0x5b4442){var _0x23ca20=_0x5b4442[_0xf56d('0xe')];var _0x4ab790=![];var _0x27a1f2=null;if(_0x1de8b0[_0xf56d('0x19')]!==null){logger['info'](_0xf56d('0x1a'),_0x1de8b0[_0xf56d('0x19')]);_0x1de8b0['userEmail']=_0x1de8b0[_0xf56d('0x19')];for(_0x27a1f2=0x0;_0x27a1f2<_0x23ca20[_0xf56d('0xf')];_0x27a1f2++){if(_0x23ca20[_0x27a1f2][_0xf56d('0x10')]===_0x1de8b0['agentEmail']){_0x4ab790=!![];_0x1de8b0[_0xf56d('0x1b')]=_0x23ca20[_0x27a1f2]['id'];logger['info']('User\x20found:',_0x1de8b0['userId']);}}}if(!_0x4ab790){logger['info'](_0xf56d('0x1c'));_0x1de8b0[_0xf56d('0x1d')]=_0x1de8b0[_0xf56d('0x11')];_0x1de8b0[_0xf56d('0x1b')]=_0x1de8b0[_0xf56d('0x12')];_0x4ab790=!![];}if(_0x4ab790){_0x477b5c(_0x1de8b0);}else{_0x2717d5({'statusCode':0x194,'message':_0xf56d('0x14')});}}else{_0x2717d5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xf56d('0x15')](function(_0x48a326){logger[_0xf56d('0x16')]('['+[_0x45fd30[_0xf56d('0x17')]()]+']',_0x48a326[_0xf56d('0x1e')]);_0x2717d5(_0x48a326);});});};}function searchContact(_0x175e5a,_0x1bf942,_0x884511,_0x5cb782){return new Promise(function(_0x2ce94b,_0x5ba98c){var _0xb079cf={'method':'GET','headers':_0x1bf942,'uri':_0x175e5a+_0xf56d('0x1f')+_0x5cb782+'&f='+_0x884511+_0xf56d('0x20'),'json':!![]};rp(_0xb079cf)[_0xf56d('0xd')](function(_0x578268){var _0x2dbd59=_['find'](_0x578268[_0xf56d('0x21')][_0xf56d('0x21')],[_0x884511,_0x5cb782]);_0x2ce94b(_0x2dbd59);})[_0xf56d('0x15')](function(_0x1975da){_0x5ba98c(_0x1975da);});});}function getEndUser(_0x3a629b,_0x594b18,_0x4a313f){return function(_0x36457c){return new Promise(function(_0x1b0496,_0x32eba3){logger[_0xf56d('0xc')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x36457c['contactNumber']));searchContact(_0x4a313f,_0x594b18,_0xf56d('0x22'),_0x36457c[_0xf56d('0x23')])[_0xf56d('0xd')](function(_0x30e306){if(_0x30e306){_0x36457c[_0xf56d('0x24')]=_0x30e306['id'];logger[_0xf56d('0xc')](_0xf56d('0x25'),_0x36457c[_0xf56d('0x24')]);return _0x1b0496(_0x36457c);}searchContact(_0x4a313f,_0x594b18,_0xf56d('0x26'),_0x36457c[_0xf56d('0x23')])[_0xf56d('0xd')](function(_0x579e23){if(_0x579e23){_0x36457c['endUserId']=_0x579e23['id'];logger['info'](_0xf56d('0x27'),_0x36457c[_0xf56d('0x24')]);return _0x1b0496(_0x36457c);}createEndUser(_0x36457c,_0x3a629b,_0x594b18,_0x4a313f)['then'](function(_0x250364){logger[_0xf56d('0xc')](_0xf56d('0x28'),_0x250364[_0xf56d('0x24')]);return _0x1b0496(_0x250364);});});})[_0xf56d('0x15')](function(_0x21fe32){_0x32eba3(_0x21fe32);});});};}function createEndUser(_0x4e0264,_0x227313,_0x56e0f8,_0x1300f6){return new Promise(function(_0x4a8c3a,_0x596351){var _0x4e1cff=moment();var _0x456403={'method':_0xf56d('0x29'),'uri':_0x1300f6+_0xf56d('0x2a'),'body':{'contact':{'last_name':_0x4e0264['contactNumber'],'work_number':_0x4e0264[_0xf56d('0x23')],'mobile_number':_0x4e0264['contactNumber'],'owner_id':_0x4e0264[_0xf56d('0x1b')],'created_at':_0x4e1cff['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x456403[_0xf56d('0xb')]=_0x56e0f8;logger['info'](_0xf56d('0x2b'));return rp(_0x456403)[_0xf56d('0xd')](function(_0x2f095d){_0x4e0264[_0xf56d('0x24')]=_0x2f095d['contact']['id'];_0x4a8c3a(_0x4e0264);})['catch'](function(_0x158dea){logger[_0xf56d('0x16')]('['+[_0x227313['toUpperCase']()]+']',_0x158dea[_0xf56d('0x1e')]);_0x596351(_0x158dea[_0xf56d('0x1e')]);});});}function getTicket(_0xb22bbd,_0x5b451f,_0x57a9a9,_0x115793,_0x46e7f9){return function(_0x46704c){logger[_0xf56d('0xc')](_0xf56d('0x2c'));return new Promise(function(_0x3a5355,_0x522768){var _0x1c9098=moment();var _0x3f1e45={'method':_0xf56d('0x29'),'uri':_0x57a9a9+_0xf56d('0x2d'),'body':{'title':intUtil[_0xf56d('0x2e')](_0x115793[_0xf56d('0x2f')],_0x46e7f9,'\x20'),'description':intUtil[_0xf56d('0x2e')](_0x115793[_0xf56d('0x30')],_0x46e7f9,'\x0a'),'owner_id':_0x46704c[_0xf56d('0x1b')],'creater_id':_0x46704c[_0xf56d('0x12')],'targetable_id':_0x46704c['endUserId'],'targetable_type':'Contact','created_at':_0x1c9098['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1c9098[_0xf56d('0x31')](0x1e,'m')[_0xf56d('0x32')](_0xf56d('0x33'))},'json':!![]};_0x3f1e45[_0xf56d('0xb')]=_0x5b451f;return rp(_0x3f1e45)[_0xf56d('0xd')](function(_0x70d74c){_0x46704c[_0xf56d('0x34')]=_0x70d74c[_0xf56d('0x35')]['id'];logger[_0xf56d('0xc')]('Task\x20created:',_0x46704c[_0xf56d('0x34')]);_0x3a5355(_0x46704c);})[_0xf56d('0x15')](function(_0x149123){logger[_0xf56d('0x16')]('['+[_0xb22bbd['toUpperCase']()]+']',_0x149123[_0xf56d('0x1e')]);_0x522768(_0x149123[_0xf56d('0x1e')]);});});};}function emit(_0x566857,_0x221f17,_0x1ee95f){var _0x937993={'uri':_0x566857+'/contacts/'+_0x1ee95f};io['to'](util[_0xf56d('0x32')](_0xf56d('0x36'),_0x221f17))[_0xf56d('0x37')]('trigger:browser:url',_0x937993);}exports['cs']=function(_0x2c8e6b,_0x48bfd2,_0x13d072,_0x516240,_0x15dc1a,_0x5ac2b8,_0x328a38,_0x201c17){var _0x44c14b={};var _0x1abd0c={'Authorization':_0xf56d('0x38')+_0x5ac2b8['apiKey']};_0x5ac2b8[_0xf56d('0x39')]=intUtil[_0xf56d('0x3a')](_0x5ac2b8['remoteUri']);_0x5ac2b8[_0xf56d('0x3b')]=intUtil[_0xf56d('0x3a')](_0x5ac2b8['serverUrl']);var _0x3197b8=_0x5ac2b8[_0xf56d('0x39')];_0x44c14b['adminEmail']=_0x5ac2b8[_0xf56d('0x3c')];_0x44c14b['contactNumber']=_0x201c17[_0xf56d('0x3d')]()===_0xf56d('0x3e')?_0x48bfd2[_0xf56d('0x3f')]:_0x48bfd2[_0xf56d('0x40')];_0x44c14b[_0xf56d('0x41')]=_0x201c17===_0xf56d('0x42')||_0x201c17===_0xf56d('0x43')?_0xf56d('0x42'):'outbound';if(_0x516240){_0x44c14b['agentEmail']=_0x516240[_0xf56d('0x10')];}var _0x56de38=util['format'](_0xf56d('0x44'),_0x5ac2b8['serverUrl'],_0x48bfd2[_0xf56d('0x45')],md5(_0x48bfd2[_0xf56d('0x45')]));if(_0x15dc1a&&_0x15dc1a[_0xf56d('0x46')]){logger[_0xf56d('0xc')](_0xf56d('0x47'),_0xf56d('0x48'));_0x48bfd2[_0xf56d('0x49')]=_0x56de38;}else if(_0x328a38&&_0x328a38[_0xf56d('0x4a')]&&_0x328a38['recordingFormat']!==_0xf56d('0x4b')){logger[_0xf56d('0xc')](_0xf56d('0x4c'),_0xf56d('0x48'));_0x48bfd2[_0xf56d('0x49')]=_0x56de38;}else{_0x48bfd2[_0xf56d('0x49')]='';}return getAdminId(_0x44c14b,_0x201c17,_0x1abd0c,_0x3197b8)[_0xf56d('0xd')](getUser(_0x201c17,_0x1abd0c,_0x3197b8))[_0xf56d('0xd')](getEndUser(_0x201c17,_0x1abd0c,_0x3197b8))['then'](getTicket(_0x201c17,_0x1abd0c,_0x3197b8,_0x13d072,_0x48bfd2))[_0xf56d('0xd')](function(_0x3aaa5d){logger[_0xf56d('0xc')](util[_0xf56d('0x32')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3aaa5d[_0xf56d('0x34')]));if(_0x201c17!==_0xf56d('0x43')){logger[_0xf56d('0xc')]('['+[_0x201c17[_0xf56d('0x17')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3197b8,_0x516240[_0xf56d('0x4d')],_0x3aaa5d[_0xf56d('0x24')]);}})['catch'](function(_0x2ecf9b){logger[_0xf56d('0x16')]('['+[_0x201c17[_0xf56d('0x17')]()]+_0xf56d('0x4e'),util['inspect'](_0x2ecf9b,{'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 37419e6..7451c0c 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 _0x4d8f=['[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','unmanaged','sugarcrm','log','../../../../config/logger','error'];(function(_0xa983e8,_0x1f3fbc){var _0x23cf4b=function(_0x33a952){while(--_0x33a952){_0xa983e8['push'](_0xa983e8['shift']());}};_0x23cf4b(++_0x1f3fbc);}(_0x4d8f,0x134));var _0xf4d8=function(_0x1b974c,_0xb08b66){_0x1b974c=_0x1b974c-0x0;var _0x3aef0f=_0x4d8f[_0x1b974c];return _0x3aef0f;};'use strict';var _=require(_0xf4d8('0x0'));var util=require(_0xf4d8('0x1'));var zendesk=require(_0xf4d8('0x2'));var salesforce=require(_0xf4d8('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xf4d8('0x4'));var zoho=require(_0xf4d8('0x5'));var desk=require(_0xf4d8('0x6'));var vtiger=require(_0xf4d8('0x7'));var servicenow=require(_0xf4d8('0x8'));var dynamics365=require(_0xf4d8('0x9'));var freshsales=require(_0xf4d8('0xa'));var integrations=[_0xf4d8('0xb'),_0xf4d8('0xc'),'sugarcrm',_0xf4d8('0xd'),_0xf4d8('0xe'),_0xf4d8('0xf'),_0xf4d8('0x10'),_0xf4d8('0x11'),_0xf4d8('0x12'),'servicenow'];exports[_0xf4d8('0x13')]=function(_0x55312d,_0x2dc82c,_0x3a72a3,_0x2ac8b7,_0x4a64ab,_0x2a9dca){if(_0x3a72a3){if(_['includes'](integrations,_0x55312d[_0xf4d8('0x14')][_0xf4d8('0x15')]())){try{var _0x1d7361=null;var _0x14ad26='';var _0x44f661=_0x3a72a3[_0x55312d[_0xf4d8('0x14')][_0xf4d8('0x15')]()];if(_0x44f661){var _0x12272c=_0x44f661[_0x55312d[_0xf4d8('0x16')]];if(_0x12272c){var _0x51025c=_[_0xf4d8('0x17')](_0x12272c[_0xf4d8('0x18')],{'id':parseInt(_0x55312d[_0xf4d8('0x19')],0xa)});if(_0x51025c){if(_0x2ac8b7){if(_0x4a64ab&&_0x2dc82c[_0xf4d8('0x1a')]){_0x14ad26=_0xf4d8('0x1a');}else if(_0x2dc82c[_0xf4d8('0x1b')]){_0x14ad26=_0xf4d8('0x1c');}else{console['log']('EVENT\x20UNKNOWN',_0x2dc82c);}}else{_0x14ad26=_0xf4d8('0x1d');}switch(_0x55312d[_0xf4d8('0x14')][_0xf4d8('0x15')]()){case _0xf4d8('0xb'):zendesk[_0x14ad26](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca);break;case'salesforce':salesforce[_0x14ad26](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca);break;case _0xf4d8('0x1e'):sugarcrm[_0x14ad26](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca);break;case _0xf4d8('0xd'):freshdesk[_0x14ad26](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca);break;case _0xf4d8('0xe'):zoho[_0x14ad26](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca);break;case'desk':desk[_0x14ad26](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca);break;case _0xf4d8('0x10'):vtiger[_0x14ad26](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca);break;case _0xf4d8('0x12'):freshsales['cs'](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca,_0x14ad26);break;case'servicenow':servicenow['cs'](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca,_0x14ad26);break;case _0xf4d8('0x11'):dynamics365['cs'](_0x55312d,_0x2dc82c,_0x51025c,_0x2ac8b7,_0x4a64ab,_0x12272c,_0x2a9dca,_0x14ad26);break;default:console[_0xf4d8('0x1f')]('unknown\x20integration');}}else{_0x1d7361=require(_0xf4d8('0x20'))(_0x55312d[_0xf4d8('0x14')][_0xf4d8('0x15')]());_0x1d7361[_0xf4d8('0x21')](_0xf4d8('0x22'),util[_0xf4d8('0x23')](_0xf4d8('0x24'),_0x55312d['data1'][_0xf4d8('0x15')](),_0x55312d[_0xf4d8('0x19')]));}}else{_0x1d7361=require('../../../../config/logger')(_0x55312d['data1'][_0xf4d8('0x15')]());_0x1d7361['error'](_0xf4d8('0x22'),util[_0xf4d8('0x23')](_0xf4d8('0x25'),_0x55312d[_0xf4d8('0x14')]['toLowerCase'](),_0x55312d[_0xf4d8('0x16')]));}}else{}}catch(_0x4deb40){console[_0xf4d8('0x21')](_0x4deb40);}}}}; \ No newline at end of file +var _0x4ae8=['./freshsales','zendesk','salesforce','sugarcrm','freshdesk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','zoho','desk','log','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365'];(function(_0x2484e6,_0x2cbe6c){var _0x20efaf=function(_0x15499e){while(--_0x15499e){_0x2484e6['push'](_0x2484e6['shift']());}};_0x20efaf(++_0x2cbe6c);}(_0x4ae8,0x18d));var _0x84ae=function(_0x6f05d2,_0x50cdfe){_0x6f05d2=_0x6f05d2-0x0;var _0x103911=_0x4ae8[_0x6f05d2];return _0x103911;};'use strict';var _=require(_0x84ae('0x0'));var util=require(_0x84ae('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x84ae('0x2'));var sugarcrm=require(_0x84ae('0x3'));var freshdesk=require(_0x84ae('0x4'));var zoho=require(_0x84ae('0x5'));var desk=require(_0x84ae('0x6'));var vtiger=require(_0x84ae('0x7'));var servicenow=require(_0x84ae('0x8'));var dynamics365=require(_0x84ae('0x9'));var freshsales=require(_0x84ae('0xa'));var integrations=[_0x84ae('0xb'),_0x84ae('0xc'),_0x84ae('0xd'),_0x84ae('0xe'),'zoho','desk',_0x84ae('0xf'),_0x84ae('0x10'),_0x84ae('0x11'),'servicenow'];exports[_0x84ae('0x12')]=function(_0x46bf64,_0x2ed2be,_0x2280df,_0x4012ef,_0x4a21da,_0x23d37f){if(_0x2280df){if(_[_0x84ae('0x13')](integrations,_0x46bf64[_0x84ae('0x14')][_0x84ae('0x15')]())){try{var _0x4f2502=null;var _0x3fa071='';var _0xf60cad=_0x2280df[_0x46bf64[_0x84ae('0x14')]['toLowerCase']()];if(_0xf60cad){var _0x42e886=_0xf60cad[_0x46bf64[_0x84ae('0x16')]];if(_0x42e886){var _0x3cd388=_[_0x84ae('0x17')](_0x42e886[_0x84ae('0x18')],{'id':parseInt(_0x46bf64[_0x84ae('0x19')],0xa)});if(_0x3cd388){if(_0x4012ef){if(_0x4a21da&&_0x2ed2be[_0x84ae('0x1a')]){_0x3fa071=_0x84ae('0x1a');}else if(_0x2ed2be[_0x84ae('0x1b')]){_0x3fa071='outbound';}else{console['log'](_0x84ae('0x1c'),_0x2ed2be);}}else{_0x3fa071='unmanaged';}switch(_0x46bf64[_0x84ae('0x14')][_0x84ae('0x15')]()){case _0x84ae('0xb'):zendesk[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0xc'):salesforce[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0xd'):sugarcrm[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case'freshdesk':freshdesk[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0x1d'):zoho[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0x1e'):desk[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0xf'):vtiger[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0x11'):freshsales['cs'](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f,_0x3fa071);break;case'servicenow':servicenow['cs'](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f,_0x3fa071);break;case _0x84ae('0x10'):dynamics365['cs'](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f,_0x3fa071);break;default:console[_0x84ae('0x1f')]('unknown\x20integration');}}else{_0x4f2502=require(_0x84ae('0x20'))(_0x46bf64[_0x84ae('0x14')][_0x84ae('0x15')]());_0x4f2502[_0x84ae('0x21')](_0x84ae('0x22'),util[_0x84ae('0x23')](_0x84ae('0x24'),_0x46bf64['data1'][_0x84ae('0x15')](),_0x46bf64[_0x84ae('0x19')]));}}else{_0x4f2502=require(_0x84ae('0x20'))(_0x46bf64['data1'][_0x84ae('0x15')]());_0x4f2502['error'](_0x84ae('0x22'),util[_0x84ae('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x46bf64[_0x84ae('0x14')]['toLowerCase'](),_0x46bf64['data2']));}}else{}}catch(_0x588ee9){console[_0x84ae('0x21')](_0x588ee9);}}}}; \ 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 715f21c..bc9fd47 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 _0xc286=['idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','uniqueid','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','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','create','forEach','string','picklist'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc286,0x146));var _0x6c28=function(_0x1dc21e,_0x443665){_0x1dc21e=_0x1dc21e-0x0;var _0x1c975b=_0xc286[_0x1dc21e];return _0x1c975b;};'use strict';var _=require('lodash');var rp=require(_0x6c28('0x0'));var moment=require(_0x6c28('0x1'));var BPromise=require(_0x6c28('0x2'));var md5=require(_0x6c28('0x3'));var jsforce=require(_0x6c28('0x4'));var util=require(_0x6c28('0x5'));var Redis=require('ioredis');var intUtil=require(_0x6c28('0x6'));var config=require(_0x6c28('0x7'));var logger=require(_0x6c28('0x8'))(_0x6c28('0x9'));config[_0x6c28('0xa')]=_['defaults'](config[_0x6c28('0xa')],{'host':_0x6c28('0xb'),'port':0x18eb});var io=require(_0x6c28('0xc'))(new Redis(config['redis']));function emit(_0x225649,_0x21817b,_0x80356d){io['to'](_0x225649)[_0x6c28('0xd')](_0x21817b,_0x80356d);}function getTicket(_0xeb0876,_0x555d42,_0x41b8e6,_0xa135ec,_0x3c3cb0,_0x476661,_0x2f1bfc,_0x431b24){var _0x3a4b00=Object[_0x6c28('0xe')]({},{'OwnerId':_0x555d42['id'],'Subject':intUtil['getString'](_0xa135ec[_0x6c28('0xf')],_0x3c3cb0,'\x20'),'Description':intUtil['getString'](_0xa135ec[_0x6c28('0x10')],_0x3c3cb0,'\x0a')},getCustomFields(_0x476661,_0x3c3cb0));if(_0x41b8e6){if(_0xa135ec[_0x6c28('0x11')]===_0x6c28('0x12')){_0x3a4b00[_0x6c28('0x13')]=moment[_0x6c28('0x14')]();_0x3a4b00[_0x6c28('0x15')]=![];_0x3a4b00['IsRecurrence']=![];if(_0x41b8e6[_0x6c28('0x16')]===_0x6c28('0x17')||_0x41b8e6[_0x6c28('0x16')]===_0x6c28('0x18')){_0x3a4b00[_0x6c28('0x19')]=_0x41b8e6['id'];}else if(_0x41b8e6[_0x6c28('0x16')]===_0x6c28('0x1a')){_0x3a4b00[_0x6c28('0x1b')]=_0x41b8e6['id'];}}else if(_0xa135ec[_0x6c28('0x11')]===_0x6c28('0x1c')){if(_0x41b8e6['endUserType']==='contact'){_0x3a4b00[_0x6c28('0x1d')]=_0x41b8e6['id'];}else if(_0x41b8e6[_0x6c28('0x16')]===_0x6c28('0x1a')){_0x3a4b00[_0x6c28('0x1e')]=_0x41b8e6['id'];}else if(_0x41b8e6[_0x6c28('0x16')]===_0x6c28('0x18')&&_0xa135ec[_0x6c28('0x1f')]){_0x3a4b00[_0xa135ec['leadId']]=_0x41b8e6['id'];}else{logger[_0x6c28('0x20')](_0x6c28('0x21'));}}}return _0x2f1bfc[_0x6c28('0x22')](_0xa135ec[_0x6c28('0x11')])['create'](_0x3a4b00);}function getUser(_0x5108d5,_0x2d076b,_0x597f0e){if(!_[_0x6c28('0x23')](_0x2d076b)&&intUtil[_0x6c28('0x24')](_0x2d076b)){var _0x3ac438={'Email':_0x2d076b};var _0x2ff28f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x597f0e['sobject'](_0x6c28('0x25'))[_0x6c28('0x26')](_0x3ac438,_0x2ff28f)[_0x6c28('0x27')]()[_0x6c28('0x28')](function(_0x3b0293){if(_0x3b0293[_0x6c28('0x29')]){var _0x5a4b2a=_['find'](_0x3b0293,function(_0x47feac){return _0x47feac[_0x6c28('0x2a')]===_0x2d076b;});if(_0x5a4b2a){logger['info'](_0x6c28('0x2b'),_0x2d076b);return BPromise['resolve']({'id':_0x5a4b2a['Id'],'name':_0x5a4b2a[_0x6c28('0x2c')]});}}else{logger[_0x6c28('0x20')](_0x6c28('0x2d'),_0x2d076b);return _0x597f0e['identity']()['then'](function(_0x44778a){return BPromise[_0x6c28('0x2e')]({'id':_0x44778a[_0x6c28('0x2f')],'name':_0x44778a[_0x6c28('0x30')]});});}});}else{logger['info'](_0x6c28('0x2d'),_0x2d076b);return _0x597f0e[_0x6c28('0x31')]()[_0x6c28('0x28')](function(_0x45c9f1){return BPromise[_0x6c28('0x2e')]({'id':_0x45c9f1['user_id'],'name':_0x45c9f1[_0x6c28('0x30')]});});}}function getEndUser(_0x330010,_0x490b1b,_0x41036a,_0x14dd12,_0x2e73d2){var _0x2aa74f={'$or':{'Phone':_0x14dd12}};var _0x2719e9={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6c28('0x2e')]()[_0x6c28('0x28')](function(){logger[_0x6c28('0x20')](_0x6c28('0x32'),_0x14dd12,_0x490b1b[_0x6c28('0x33')]);switch(_0x490b1b['moduleSearch']){case _0x6c28('0x34'):var _0x5c6d1c=_[_0x6c28('0x35')](_0x2aa74f);if(_0x490b1b[_0x6c28('0x36')]){var _0x27f0ad={};_0x27f0ad[_0x490b1b[_0x6c28('0x36')]]=_0x14dd12;_[_0x6c28('0x37')](_0x5c6d1c[_0x6c28('0x38')],_0x27f0ad);}return _0x2e73d2[_0x6c28('0x22')]('Contact')[_0x6c28('0x26')](_0x5c6d1c,_0x2719e9)[_0x6c28('0x27')]()[_0x6c28('0x28')](function(_0x21349a){if(_0x21349a&&_0x21349a[_0x6c28('0x29')]){return _0x21349a;}else{var _0xd6a22a=_[_0x6c28('0x35')](_0x2aa74f);if(_0x490b1b[_0x6c28('0x39')]){var _0x334d8d={};_0x334d8d[_0x490b1b[_0x6c28('0x39')]]=_0x14dd12;_[_0x6c28('0x37')](_0xd6a22a[_0x6c28('0x38')],_0x334d8d);}return _0x2e73d2[_0x6c28('0x22')](_0x6c28('0x3a'))[_0x6c28('0x26')](_0xd6a22a,_0x2719e9);}});case'account_contact_lead':var _0x3da4ae=_[_0x6c28('0x35')](_0x2aa74f);if(_0x490b1b[_0x6c28('0x3b')]){var _0x27f0ad={};_0x27f0ad[_0x490b1b[_0x6c28('0x3b')]]=_0x14dd12;_[_0x6c28('0x37')](_0x3da4ae[_0x6c28('0x38')],_0x27f0ad);}return _0x2e73d2[_0x6c28('0x22')](_0x6c28('0x3c'))[_0x6c28('0x26')](_0x3da4ae,_0x2719e9)[_0x6c28('0x27')]()[_0x6c28('0x28')](function(_0x41f7f0){if(_0x41f7f0&&_0x41f7f0[_0x6c28('0x29')]){return _0x41f7f0;}else{var _0x598a9d=_[_0x6c28('0x35')](_0x2aa74f);if(_0x490b1b['additionalSearchContact']){var _0x137e9b={};_0x137e9b[_0x490b1b[_0x6c28('0x36')]]=_0x14dd12;_[_0x6c28('0x37')](_0x598a9d[_0x6c28('0x38')],_0x137e9b);}return _0x2e73d2['sobject'](_0x6c28('0x3d'))[_0x6c28('0x26')](_0x598a9d,_0x2719e9)[_0x6c28('0x28')](function(_0x235573){if(_0x235573&&_0x235573[_0x6c28('0x29')]){return _0x235573;}else{var _0x37c728=_[_0x6c28('0x35')](_0x2aa74f);if(_0x490b1b[_0x6c28('0x39')]){var _0x12e3b9={};_0x12e3b9[_0x490b1b['additionalSearchLead']]=_0x14dd12;_['merge'](_0x37c728[_0x6c28('0x38')],_0x12e3b9);}return _0x2e73d2[_0x6c28('0x22')](_0x6c28('0x3a'))[_0x6c28('0x26')](_0x37c728,_0x2719e9);}});}});case _0x6c28('0x17'):var _0x5c6d1c=_[_0x6c28('0x35')](_0x2aa74f);if(_0x490b1b['additionalSearchContact']){var _0x27f0ad={};_0x27f0ad[_0x490b1b['additionalSearchContact']]=_0x14dd12;_[_0x6c28('0x37')](_0x5c6d1c[_0x6c28('0x38')],_0x27f0ad);}return _0x2e73d2['sobject']('Contact')[_0x6c28('0x26')](_0x5c6d1c,_0x2719e9)[_0x6c28('0x27')]();case _0x6c28('0x18'):var _0x4776e3=_[_0x6c28('0x35')](_0x2aa74f);if(_0x490b1b[_0x6c28('0x39')]){var _0x27f0ad={};_0x27f0ad[_0x490b1b[_0x6c28('0x39')]]=_0x14dd12;_[_0x6c28('0x37')](_0x4776e3[_0x6c28('0x38')],_0x27f0ad);}return _0x2e73d2['sobject'](_0x6c28('0x3a'))['find'](_0x4776e3,_0x2719e9);case _0x6c28('0x1a'):var _0x3da4ae=_['cloneDeep'](_0x2aa74f);if(_0x490b1b[_0x6c28('0x3b')]){var _0x27f0ad={};_0x27f0ad[_0x490b1b[_0x6c28('0x3b')]]=_0x14dd12;_[_0x6c28('0x37')](_0x3da4ae[_0x6c28('0x38')],_0x27f0ad);}return _0x2e73d2[_0x6c28('0x22')](_0x6c28('0x3c'))[_0x6c28('0x26')](_0x3da4ae,_0x2719e9);default:return null;}})[_0x6c28('0x28')](function(_0x46ebef){if(_0x46ebef&&_0x46ebef[_0x6c28('0x29')]){var _0x386d61=_[_0x6c28('0x3e')](_0x46ebef);if(_0x386d61){return BPromise[_0x6c28('0x2e')]({'id':_0x386d61['Id'],'name':_0x386d61[_0x6c28('0x2c')],'phone':_0x386d61[_0x6c28('0x3f')],'endUserType':_0x386d61[_0x6c28('0x40')][_0x6c28('0x41')][_0x6c28('0x42')]()});}}})[_0x6c28('0x28')](function(_0x3eca24){if(_0x3eca24){logger[_0x6c28('0x20')](_0x6c28('0x43'),_0x3eca24[_0x6c28('0x16')],_0x14dd12);return BPromise[_0x6c28('0x2e')](_0x3eca24);}else{logger[_0x6c28('0x20')](_0x6c28('0x44'),_0x14dd12);var _0x234ec3={'Phone':_0x14dd12};if(_0x490b1b['moduleCreate']){if(_0x490b1b[_0x6c28('0x45')]==='contact'){logger[_0x6c28('0x20')](_0x6c28('0x46'),_0x14dd12,_0x490b1b['moduleCreate']);_0x234ec3[_0x6c28('0x47')]=_0x41036a!==_0x6c28('0x48')?_0x41036a:util[_0x6c28('0x49')]('Caller\x20-\x20%s',_0x14dd12);}else if(_0x490b1b[_0x6c28('0x45')]==='lead'){logger[_0x6c28('0x20')](_0x6c28('0x46'),_0x14dd12,_0x490b1b['moduleCreate']);_0x234ec3[_0x6c28('0x47')]=_0x41036a!==_0x6c28('0x48')?_0x41036a:util[_0x6c28('0x49')](_0x6c28('0x4a'),_0x14dd12);_0x234ec3[_0x6c28('0x4b')]=_0x6c28('0x4c');}else if(_0x490b1b['moduleCreate']==='account'){logger[_0x6c28('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x14dd12,_0x490b1b[_0x6c28('0x45')]);_0x234ec3[_0x6c28('0x2c')]=_0x41036a!==_0x6c28('0x48')?_0x41036a:util['format'](_0x6c28('0x4a'),_0x14dd12);}else{return null;}}return _0x2e73d2['sobject'](_[_0x6c28('0x4d')](_0x490b1b['moduleCreate']))[_0x6c28('0x4e')](_0x234ec3)[_0x6c28('0x28')](function(_0x32633b){return BPromise[_0x6c28('0x2e')]({'id':_0x32633b['id'],'endUserType':_0x490b1b[_0x6c28('0x45')]});});}});}function getCustomFields(_0x32f244,_0xf03720){var _0x15602b={};if(_0x32f244[_0x6c28('0x29')]>0x0){_[_0x6c28('0x4f')](_0x32f244,function(_0xc9cf2f){if(_['includes']([_0x6c28('0x50'),_0x6c28('0x51')],_0xc9cf2f['type'])&&_0xc9cf2f[_0x6c28('0x52')]){_0x15602b[_0xc9cf2f[_0x6c28('0x52')]]=_0xc9cf2f[_0x6c28('0x53')][_0x6c28('0x54')]();}else if(_0xc9cf2f[_0x6c28('0x41')]===_0x6c28('0x55')&&_0xc9cf2f[_0x6c28('0x56')]&&_0xc9cf2f[_0x6c28('0x52')]){_0xf03720[_0xc9cf2f[_0x6c28('0x56')]]&&(_0x15602b[_0xc9cf2f[_0x6c28('0x52')]]=_0xf03720[_0xc9cf2f[_0x6c28('0x56')]][_0x6c28('0x54')]());}else if(_0xc9cf2f[_0x6c28('0x41')]===_0x6c28('0x57')&&_0xc9cf2f[_0x6c28('0x58')]&&_0xc9cf2f[_0x6c28('0x58')][_0x6c28('0x59')]&&_0xc9cf2f[_0x6c28('0x52')]){_0xf03720[_0xc9cf2f[_0x6c28('0x58')][_0x6c28('0x59')]['toLowerCase']()]&&(_0x15602b[_0xc9cf2f['idField']]=_0xf03720[_0xc9cf2f[_0x6c28('0x58')][_0x6c28('0x59')]['toLowerCase']()][_0x6c28('0x54')]());}});}return _0x15602b;}function getConnection(_0x42cc36){var _0x1c255d=_0x42cc36[_0x6c28('0x5a')][_0x6c28('0x5b')](_0x42cc36['securityToken']);var _0x12bc27=new jsforce[(_0x6c28('0x5c'))]({'oauth2':{'loginUrl':_0x42cc36[_0x6c28('0x5d')]||_0x6c28('0x5e'),'clientId':_0x42cc36[_0x6c28('0x5f')],'clientSecret':_0x42cc36[_0x6c28('0x60')]}});return _0x12bc27[_0x6c28('0x61')](_0x42cc36[_0x6c28('0x62')],_0x1c255d)[_0x6c28('0x28')](function(){logger['info'](_0x6c28('0x63'));return _0x12bc27;});}exports[_0x6c28('0x64')]=function(_0x152975,_0x1d8dca,_0x2f2e51,_0x5d2de5,_0x1cebc6,_0x39840d){var _0x551c25,_0x51e5ed,_0x24d2de,_0x524464;_0x39840d['serverUrl']=intUtil[_0x6c28('0x65')](_0x39840d['serverUrl']);_0x39840d[_0x6c28('0x5d')]=intUtil[_0x6c28('0x65')](_0x39840d['remoteUri']);if(_0x1cebc6&&_0x1cebc6[_0x6c28('0x66')]){logger[_0x6c28('0x20')](_0x6c28('0x67'),_0x6c28('0x68'));_0x1d8dca[_0x6c28('0x69')]=util['format'](_0x6c28('0x6a'),_0x39840d[_0x6c28('0x6b')],_0x1d8dca['uniqueid'],md5(_0x1d8dca['uniqueid']));}else{_0x1d8dca[_0x6c28('0x69')]='';}return getConnection(_0x39840d)[_0x6c28('0x28')](function(_0x4994f6){_0x524464=_0x4994f6;return getUser(_0x39840d,_0x5d2de5['email'],_0x524464);})['then'](function(_0x429c73){_0x551c25=_0x429c73;return getEndUser(_0x39840d,_0x2f2e51,_0x1d8dca[_0x6c28('0x6c')],_0x1d8dca[_0x6c28('0x6d')],_0x524464);})[_0x6c28('0x28')](function(_0x29365c){_0x51e5ed=_0x29365c;return getTicket(_0x39840d,_0x551c25,_0x51e5ed,_0x2f2e51,_0x1d8dca,_0x2f2e51[_0x6c28('0x6e')],_0x524464,_0x6c28('0x64'));})[_0x6c28('0x28')](function(_0x59de04){_0x24d2de=_0x59de04;logger[_0x6c28('0x20')](_0x6c28('0x6f'),_0x24d2de['id']);logger['info'](_0x6c28('0x70'),_0x24d2de['id'],_0x5d2de5['name'],_0x39840d['type']);switch(_0x39840d[_0x6c28('0x41')]){case'integrationTab':emit(util['format']('user:%s',_0x5d2de5[_0x6c28('0x59')]),_0x6c28('0x71'),{'recordId':_0x24d2de['id']});break;case _0x6c28('0x72'):emit(util['format'](_0x6c28('0x73'),_0x5d2de5['name']),'trigger:browser:url',{'uri':util['format'](_0x6c28('0x74'),_0x524464[_0x6c28('0x75')],_0x24d2de['id'])});break;default:logger['error'](_0x6c28('0x76'));}})[_0x6c28('0x77')](function(_0x1a78b5){logger[_0x6c28('0x78')](_0x6c28('0x67'),_0x1a78b5);});};exports[_0x6c28('0x79')]=function(_0x2016dc,_0x1b135c,_0x42124f,_0x2e3273,_0x21379b,_0x5bcc02,_0x45ea22){var _0x5a2a0c,_0x5a75c5,_0xb7490c,_0xa868f3;_0x5bcc02['serverUrl']=intUtil[_0x6c28('0x65')](_0x5bcc02[_0x6c28('0x6b')]);_0x5bcc02[_0x6c28('0x5d')]=intUtil['stripTrailingSlash'](_0x5bcc02[_0x6c28('0x5d')]);if(_0x45ea22&&_0x45ea22[_0x6c28('0x7a')]&&_0x45ea22['recordingFormat']!==_0x6c28('0x7b')){logger[_0x6c28('0x20')]('[OUTBOUND]',_0x6c28('0x68'));_0x1b135c[_0x6c28('0x69')]=util[_0x6c28('0x49')](_0x6c28('0x6a'),_0x5bcc02[_0x6c28('0x6b')],_0x1b135c['uniqueid'],md5(_0x1b135c[_0x6c28('0x7c')]));}return getConnection(_0x5bcc02)[_0x6c28('0x28')](function(_0x5a9724){_0xa868f3=_0x5a9724;return getUser(_0x5bcc02,_0x2e3273['email'],_0xa868f3);})['then'](function(_0x9e4336){_0x5a2a0c=_0x9e4336;return getEndUser(_0x5bcc02,_0x42124f,_0x1b135c[_0x6c28('0x7d')],_0x1b135c[_0x6c28('0x7e')],_0xa868f3);})[_0x6c28('0x28')](function(_0x1ce278){_0x5a75c5=_0x1ce278;return getTicket(_0x5bcc02,_0x5a2a0c,_0x5a75c5,_0x42124f,_0x1b135c,_0x42124f[_0x6c28('0x6e')],_0xa868f3,'outbound');})[_0x6c28('0x28')](function(_0x4ac589){_0xb7490c=_0x4ac589;logger[_0x6c28('0x20')](_0x6c28('0x7f'),_0xb7490c['id']);logger[_0x6c28('0x20')](_0x6c28('0x80'),_0xb7490c['id'],_0x2e3273[_0x6c28('0x59')],_0x5bcc02[_0x6c28('0x41')]);switch(_0x5bcc02[_0x6c28('0x41')]){case'integrationTab':emit(util['format'](_0x6c28('0x73'),_0x2e3273[_0x6c28('0x59')]),_0x6c28('0x71'),{'recordId':_0xb7490c['id']});break;case _0x6c28('0x72'):emit(util['format'](_0x6c28('0x73'),_0x2e3273[_0x6c28('0x59')]),_0x6c28('0x81'),{'uri':util[_0x6c28('0x49')](_0x6c28('0x74'),_0xa868f3[_0x6c28('0x75')],_0xb7490c['id'])});break;default:logger[_0x6c28('0x78')](_0x6c28('0x82'),_0x6c28('0x83'));}})[_0x6c28('0x77')](function(_0x3fbe1f){logger[_0x6c28('0x78')](_0x6c28('0x82'),_0x3fbe1f);});};exports[_0x6c28('0x84')]=function(_0x553f77,_0x272923,_0xe030a6,_0x55b068,_0x2e97eb,_0x5c5bc1){var _0x312262,_0x22a1bc,_0x3c6411,_0x680b4b;_0x5c5bc1[_0x6c28('0x6b')]=intUtil[_0x6c28('0x65')](_0x5c5bc1[_0x6c28('0x6b')]);_0x5c5bc1[_0x6c28('0x5d')]=intUtil['stripTrailingSlash'](_0x5c5bc1[_0x6c28('0x5d')]);if(_0x2e97eb&&_0x2e97eb[_0x6c28('0x66')]){logger[_0x6c28('0x20')]('['+_0x272923['lastevent'][_0x6c28('0x85')]()+']',_0x6c28('0x68'));_0x272923[_0x6c28('0x69')]=util[_0x6c28('0x49')](_0x6c28('0x6a'),_0x5c5bc1[_0x6c28('0x6b')],_0x272923['uniqueid'],md5(_0x272923['uniqueid']));}else{_0x272923[_0x6c28('0x69')]='';}return getConnection(_0x5c5bc1)[_0x6c28('0x28')](function(_0x809c76){_0x680b4b=_0x809c76;if(!_[_0x6c28('0x23')](_0x55b068)){return getUser(_0x5c5bc1,_0x55b068['name'],_0x680b4b);}else{return getUser(_0x5c5bc1,null,_0x680b4b);}})['then'](function(_0x1a019f){_0x312262=_0x1a019f;return getEndUser(_0x5c5bc1,_0xe030a6,_0x272923[_0x6c28('0x6c')],_0x272923[_0x6c28('0x6d')],_0x680b4b);})[_0x6c28('0x28')](function(_0x4a6183){_0x22a1bc=_0x4a6183;return getTicket(_0x5c5bc1,_0x312262,_0x22a1bc,_0xe030a6,_0x272923,_0xe030a6[_0x6c28('0x6e')],_0x680b4b);})[_0x6c28('0x28')](function(_0x5729fa){_0x3c6411=_0x5729fa;logger[_0x6c28('0x20')]('['+_0x272923['lastevent'][_0x6c28('0x85')]()+_0x6c28('0x86'),_0x3c6411['id']);logger[_0x6c28('0x20')]('['+_0x272923[_0x6c28('0x87')][_0x6c28('0x85')]()+']\x20Integration\x20account\x20type\x20%s.',_0x5c5bc1[_0x6c28('0x41')]);})[_0x6c28('0x77')](function(_0x25b912){logger[_0x6c28('0x78')]('['+_0x272923[_0x6c28('0x87')][_0x6c28('0x85')]()+']',_0x25b912);});}; \ No newline at end of file +var _0x8c22=['error','catch','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','isNil','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','leadId','info','create','validateEmail','sobject','User','execute','length','find','Email','Agent\x20%s\x20found.','identity','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','cloneDeep','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Contact','first','Phone','attributes','type','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','Name','forEach','picklist','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','clientId','login','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8c22,0x18a));var _0x28c2=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x8c22[_0x263b0e];return _0x113fee;};'use strict';var _=require(_0x28c2('0x0'));var rp=require('request-promise');var moment=require(_0x28c2('0x1'));var BPromise=require('bluebird');var md5=require(_0x28c2('0x2'));var jsforce=require(_0x28c2('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x28c2('0x4'));var config=require(_0x28c2('0x5'));var logger=require(_0x28c2('0x6'))(_0x28c2('0x7'));config[_0x28c2('0x8')]=_['defaults'](config['redis'],{'host':_0x28c2('0x9'),'port':0x18eb});var io=require(_0x28c2('0xa'))(new Redis(config[_0x28c2('0x8')]));function emit(_0x572281,_0x5231a1,_0x1a331b){io['to'](_0x572281)[_0x28c2('0xb')](_0x5231a1,_0x1a331b);}function getTicket(_0x10e1a8,_0x3ee994,_0x5b9002,_0x40d1ec,_0x213298,_0x47121f,_0x358ceb,_0x394959){var _0x54118b=Object[_0x28c2('0xc')]({},{'OwnerId':_0x3ee994['id'],'Subject':intUtil[_0x28c2('0xd')](_0x40d1ec[_0x28c2('0xe')],_0x213298,'\x20'),'Description':intUtil[_0x28c2('0xd')](_0x40d1ec[_0x28c2('0xf')],_0x213298,'\x0a')},getCustomFields(_0x47121f,_0x213298));if(_0x5b9002){if(_0x40d1ec[_0x28c2('0x10')]===_0x28c2('0x11')){_0x54118b[_0x28c2('0x12')]=moment[_0x28c2('0x13')]();_0x54118b[_0x28c2('0x14')]=![];_0x54118b[_0x28c2('0x15')]=![];if(_0x5b9002[_0x28c2('0x16')]===_0x28c2('0x17')||_0x5b9002['endUserType']===_0x28c2('0x18')){_0x54118b[_0x28c2('0x19')]=_0x5b9002['id'];}else if(_0x5b9002[_0x28c2('0x16')]===_0x28c2('0x1a')){_0x54118b[_0x28c2('0x1b')]=_0x5b9002['id'];}}else if(_0x40d1ec[_0x28c2('0x10')]===_0x28c2('0x1c')){if(_0x5b9002['endUserType']===_0x28c2('0x17')){_0x54118b[_0x28c2('0x1d')]=_0x5b9002['id'];}else if(_0x5b9002[_0x28c2('0x16')]===_0x28c2('0x1a')){_0x54118b['AccountId']=_0x5b9002['id'];}else if(_0x5b9002[_0x28c2('0x16')]==='lead'&&_0x40d1ec[_0x28c2('0x1e')]){_0x54118b[_0x40d1ec[_0x28c2('0x1e')]]=_0x5b9002['id'];}else{logger[_0x28c2('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x358ceb['sobject'](_0x40d1ec[_0x28c2('0x10')])[_0x28c2('0x20')](_0x54118b);}function getUser(_0x46f31c,_0x5f03a3,_0x5ef070){if(!_['isNil'](_0x5f03a3)&&intUtil[_0x28c2('0x21')](_0x5f03a3)){var _0x1a732b={'Email':_0x5f03a3};var _0x59095d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5ef070[_0x28c2('0x22')](_0x28c2('0x23'))['find'](_0x1a732b,_0x59095d)[_0x28c2('0x24')]()['then'](function(_0x28c3ec){if(_0x28c3ec[_0x28c2('0x25')]){var _0x5bd347=_[_0x28c2('0x26')](_0x28c3ec,function(_0x419464){return _0x419464[_0x28c2('0x27')]===_0x5f03a3;});if(_0x5bd347){logger['info'](_0x28c2('0x28'),_0x5f03a3);return BPromise['resolve']({'id':_0x5bd347['Id'],'name':_0x5bd347['Name']});}}else{logger[_0x28c2('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5f03a3);return _0x5ef070[_0x28c2('0x29')]()['then'](function(_0x387bfa){return BPromise[_0x28c2('0x2a')]({'id':_0x387bfa[_0x28c2('0x2b')],'name':_0x387bfa[_0x28c2('0x2c')]});});}});}else{logger[_0x28c2('0x1f')](_0x28c2('0x2d'),_0x5f03a3);return _0x5ef070['identity']()[_0x28c2('0x2e')](function(_0x439edc){return BPromise[_0x28c2('0x2a')]({'id':_0x439edc[_0x28c2('0x2b')],'name':_0x439edc[_0x28c2('0x2c')]});});}}function getEndUser(_0x55f82a,_0x2ac299,_0x338b62,_0x3118ca,_0x1bdf42){var _0xc7a446={'$or':{'Phone':_0x3118ca}};var _0x371516={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x28c2('0x2a')]()['then'](function(){logger[_0x28c2('0x1f')](_0x28c2('0x2f'),_0x3118ca,_0x2ac299[_0x28c2('0x30')]);switch(_0x2ac299['moduleSearch']){case _0x28c2('0x31'):var _0x3b15a8=_['cloneDeep'](_0xc7a446);if(_0x2ac299[_0x28c2('0x32')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x32')]]=_0x3118ca;_[_0x28c2('0x33')](_0x3b15a8['$or'],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Contact')[_0x28c2('0x26')](_0x3b15a8,_0x371516)[_0x28c2('0x24')]()[_0x28c2('0x2e')](function(_0x131883){if(_0x131883&&_0x131883[_0x28c2('0x25')]){return _0x131883;}else{var _0x502fe4=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x35')]){var _0x5b1469={};_0x5b1469[_0x2ac299[_0x28c2('0x35')]]=_0x3118ca;_[_0x28c2('0x33')](_0x502fe4[_0x28c2('0x36')],_0x5b1469);}return _0x1bdf42[_0x28c2('0x22')](_0x28c2('0x37'))[_0x28c2('0x26')](_0x502fe4,_0x371516);}});case _0x28c2('0x38'):var _0x49277b=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x39')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x39')]]=_0x3118ca;_[_0x28c2('0x33')](_0x49277b[_0x28c2('0x36')],_0x37bc33);}return _0x1bdf42['sobject']('Account')[_0x28c2('0x26')](_0x49277b,_0x371516)[_0x28c2('0x24')]()[_0x28c2('0x2e')](function(_0x3875af){if(_0x3875af&&_0x3875af[_0x28c2('0x25')]){return _0x3875af;}else{var _0x3de5c9=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299['additionalSearchContact']){var _0x30d4f6={};_0x30d4f6[_0x2ac299[_0x28c2('0x32')]]=_0x3118ca;_[_0x28c2('0x33')](_0x3de5c9[_0x28c2('0x36')],_0x30d4f6);}return _0x1bdf42[_0x28c2('0x22')](_0x28c2('0x3a'))[_0x28c2('0x26')](_0x3de5c9,_0x371516)[_0x28c2('0x2e')](function(_0x2e786b){if(_0x2e786b&&_0x2e786b[_0x28c2('0x25')]){return _0x2e786b;}else{var _0x3cf14f=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x35')]){var _0x118f60={};_0x118f60[_0x2ac299[_0x28c2('0x35')]]=_0x3118ca;_['merge'](_0x3cf14f[_0x28c2('0x36')],_0x118f60);}return _0x1bdf42[_0x28c2('0x22')](_0x28c2('0x37'))[_0x28c2('0x26')](_0x3cf14f,_0x371516);}});}});case _0x28c2('0x17'):var _0x3b15a8=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x32')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x32')]]=_0x3118ca;_[_0x28c2('0x33')](_0x3b15a8[_0x28c2('0x36')],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Contact')['find'](_0x3b15a8,_0x371516)[_0x28c2('0x24')]();case _0x28c2('0x18'):var _0x216b40=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x35')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x35')]]=_0x3118ca;_['merge'](_0x216b40['$or'],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Lead')[_0x28c2('0x26')](_0x216b40,_0x371516);case'account':var _0x49277b=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x39')]){var _0x37bc33={};_0x37bc33[_0x2ac299['additionalSearchAccount']]=_0x3118ca;_[_0x28c2('0x33')](_0x49277b['$or'],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Account')[_0x28c2('0x26')](_0x49277b,_0x371516);default:return null;}})[_0x28c2('0x2e')](function(_0x2ad8e1){if(_0x2ad8e1&&_0x2ad8e1[_0x28c2('0x25')]){var _0x528c0d=_[_0x28c2('0x3b')](_0x2ad8e1);if(_0x528c0d){return BPromise['resolve']({'id':_0x528c0d['Id'],'name':_0x528c0d['Name'],'phone':_0x528c0d[_0x28c2('0x3c')],'endUserType':_0x528c0d[_0x28c2('0x3d')][_0x28c2('0x3e')]['toLowerCase']()});}}})[_0x28c2('0x2e')](function(_0x4f6b9a){if(_0x4f6b9a){logger['info'](_0x28c2('0x3f'),_0x4f6b9a['endUserType'],_0x3118ca);return BPromise[_0x28c2('0x2a')](_0x4f6b9a);}else{logger[_0x28c2('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x3118ca);var _0x4f8587={'Phone':_0x3118ca};if(_0x2ac299[_0x28c2('0x40')]){if(_0x2ac299[_0x28c2('0x40')]===_0x28c2('0x17')){logger[_0x28c2('0x1f')](_0x28c2('0x41'),_0x3118ca,_0x2ac299[_0x28c2('0x40')]);_0x4f8587[_0x28c2('0x42')]=_0x338b62!==_0x28c2('0x43')?_0x338b62:util[_0x28c2('0x44')](_0x28c2('0x45'),_0x3118ca);}else if(_0x2ac299[_0x28c2('0x40')]===_0x28c2('0x18')){logger[_0x28c2('0x1f')](_0x28c2('0x41'),_0x3118ca,_0x2ac299[_0x28c2('0x40')]);_0x4f8587[_0x28c2('0x42')]=_0x338b62!==_0x28c2('0x43')?_0x338b62:util['format'](_0x28c2('0x45'),_0x3118ca);_0x4f8587[_0x28c2('0x46')]=_0x28c2('0x47');}else if(_0x2ac299[_0x28c2('0x40')]===_0x28c2('0x1a')){logger[_0x28c2('0x1f')](_0x28c2('0x41'),_0x3118ca,_0x2ac299['moduleCreate']);_0x4f8587[_0x28c2('0x48')]=_0x338b62!==_0x28c2('0x43')?_0x338b62:util['format'](_0x28c2('0x45'),_0x3118ca);}else{return null;}}return _0x1bdf42[_0x28c2('0x22')](_['upperFirst'](_0x2ac299[_0x28c2('0x40')]))[_0x28c2('0x20')](_0x4f8587)[_0x28c2('0x2e')](function(_0x5e805c){return BPromise[_0x28c2('0x2a')]({'id':_0x5e805c['id'],'endUserType':_0x2ac299[_0x28c2('0x40')]});});}});}function getCustomFields(_0x302956,_0x1e678e){var _0x1fafda={};if(_0x302956[_0x28c2('0x25')]>0x0){_[_0x28c2('0x49')](_0x302956,function(_0x9ac590){if(_['includes'](['string',_0x28c2('0x4a')],_0x9ac590[_0x28c2('0x3e')])&&_0x9ac590[_0x28c2('0x4b')]){_0x1fafda[_0x9ac590[_0x28c2('0x4b')]]=_0x9ac590[_0x28c2('0x4c')]['toString']();}else if(_0x9ac590[_0x28c2('0x3e')]==='variable'&&_0x9ac590[_0x28c2('0x4d')]&&_0x9ac590['idField']){_0x1e678e[_0x9ac590[_0x28c2('0x4d')]]&&(_0x1fafda[_0x9ac590[_0x28c2('0x4b')]]=_0x1e678e[_0x9ac590[_0x28c2('0x4d')]][_0x28c2('0x4e')]());}else if(_0x9ac590[_0x28c2('0x3e')]===_0x28c2('0x4f')&&_0x9ac590['Variable']&&_0x9ac590[_0x28c2('0x50')][_0x28c2('0x51')]&&_0x9ac590['idField']){_0x1e678e[_0x9ac590[_0x28c2('0x50')][_0x28c2('0x51')][_0x28c2('0x52')]()]&&(_0x1fafda[_0x9ac590[_0x28c2('0x4b')]]=_0x1e678e[_0x9ac590[_0x28c2('0x50')][_0x28c2('0x51')]['toLowerCase']()][_0x28c2('0x4e')]());}});}return _0x1fafda;}function getConnection(_0x308beb){var _0x402c24=_0x308beb[_0x28c2('0x53')][_0x28c2('0x54')](_0x308beb['securityToken']);var _0x319e8d=new jsforce[(_0x28c2('0x55'))]({'oauth2':{'loginUrl':_0x308beb[_0x28c2('0x56')]||'https://login.salesforce.com','clientId':_0x308beb[_0x28c2('0x57')],'clientSecret':_0x308beb['clientSecret']}});return _0x319e8d[_0x28c2('0x58')](_0x308beb['username'],_0x402c24)[_0x28c2('0x2e')](function(){logger[_0x28c2('0x1f')](_0x28c2('0x59'));return _0x319e8d;});}exports['queue']=function(_0x4b93bc,_0x11118a,_0x141314,_0x1fc5a7,_0xf099e9,_0x36b4ff){var _0x3ec0f3,_0x8d4965,_0x4c7241,_0x461b3e;_0x36b4ff[_0x28c2('0x5a')]=intUtil['stripTrailingSlash'](_0x36b4ff['serverUrl']);_0x36b4ff[_0x28c2('0x56')]=intUtil[_0x28c2('0x5b')](_0x36b4ff[_0x28c2('0x56')]);if(_0xf099e9&&_0xf099e9['monitor_format']){logger[_0x28c2('0x1f')](_0x28c2('0x5c'),_0x28c2('0x5d'));_0x11118a[_0x28c2('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36b4ff[_0x28c2('0x5a')],_0x11118a[_0x28c2('0x5f')],md5(_0x11118a[_0x28c2('0x5f')]));}else{_0x11118a[_0x28c2('0x5e')]='';}return getConnection(_0x36b4ff)['then'](function(_0x3a3463){_0x461b3e=_0x3a3463;return getUser(_0x36b4ff,_0x1fc5a7['email'],_0x461b3e);})[_0x28c2('0x2e')](function(_0x1293c2){_0x3ec0f3=_0x1293c2;return getEndUser(_0x36b4ff,_0x141314,_0x11118a['calleridname'],_0x11118a[_0x28c2('0x60')],_0x461b3e);})['then'](function(_0x6fc6eb){_0x8d4965=_0x6fc6eb;return getTicket(_0x36b4ff,_0x3ec0f3,_0x8d4965,_0x141314,_0x11118a,_0x141314[_0x28c2('0x61')],_0x461b3e,_0x28c2('0x62'));})[_0x28c2('0x2e')](function(_0x45999b){_0x4c7241=_0x45999b;logger[_0x28c2('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4c7241['id']);logger[_0x28c2('0x1f')](_0x28c2('0x63'),_0x4c7241['id'],_0x1fc5a7[_0x28c2('0x51')],_0x36b4ff[_0x28c2('0x3e')]);switch(_0x36b4ff['type']){case _0x28c2('0x64'):emit(util[_0x28c2('0x44')](_0x28c2('0x65'),_0x1fc5a7[_0x28c2('0x51')]),_0x28c2('0x66'),{'recordId':_0x4c7241['id']});break;case _0x28c2('0x67'):emit(util[_0x28c2('0x44')](_0x28c2('0x65'),_0x1fc5a7[_0x28c2('0x51')]),_0x28c2('0x68'),{'uri':util['format']('%s/%s/e',_0x461b3e[_0x28c2('0x69')],_0x4c7241['id'])});break;default:logger[_0x28c2('0x6a')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x28c2('0x6b')](function(_0x3039a5){logger[_0x28c2('0x6a')](_0x28c2('0x5c'),_0x3039a5);});};exports[_0x28c2('0x6c')]=function(_0xb3ae23,_0x4dd603,_0x23af1e,_0x371a33,_0x29a69a,_0x14462e,_0x206f79){var _0x54d0d5,_0x5734ec,_0x40917b,_0x2130ed;_0x14462e[_0x28c2('0x5a')]=intUtil[_0x28c2('0x5b')](_0x14462e[_0x28c2('0x5a')]);_0x14462e[_0x28c2('0x56')]=intUtil[_0x28c2('0x5b')](_0x14462e[_0x28c2('0x56')]);if(_0x206f79&&_0x206f79[_0x28c2('0x6d')]&&_0x206f79['recordingFormat']!=='none'){logger['info'](_0x28c2('0x6e'),_0x28c2('0x5d'));_0x4dd603[_0x28c2('0x5e')]=util[_0x28c2('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14462e[_0x28c2('0x5a')],_0x4dd603[_0x28c2('0x5f')],md5(_0x4dd603['uniqueid']));}return getConnection(_0x14462e)[_0x28c2('0x2e')](function(_0x352f0a){_0x2130ed=_0x352f0a;return getUser(_0x14462e,_0x371a33[_0x28c2('0x6f')],_0x2130ed);})[_0x28c2('0x2e')](function(_0x1a66ae){_0x54d0d5=_0x1a66ae;return getEndUser(_0x14462e,_0x23af1e,_0x4dd603[_0x28c2('0x70')],_0x4dd603[_0x28c2('0x71')],_0x2130ed);})[_0x28c2('0x2e')](function(_0x131970){_0x5734ec=_0x131970;return getTicket(_0x14462e,_0x54d0d5,_0x5734ec,_0x23af1e,_0x4dd603,_0x23af1e[_0x28c2('0x61')],_0x2130ed,'outbound');})[_0x28c2('0x2e')](function(_0x99f4c4){_0x40917b=_0x99f4c4;logger[_0x28c2('0x1f')](_0x28c2('0x72'),_0x40917b['id']);logger[_0x28c2('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x40917b['id'],_0x371a33[_0x28c2('0x51')],_0x14462e['type']);switch(_0x14462e[_0x28c2('0x3e')]){case _0x28c2('0x64'):emit(util[_0x28c2('0x44')]('user:%s',_0x371a33['name']),_0x28c2('0x66'),{'recordId':_0x40917b['id']});break;case _0x28c2('0x67'):emit(util['format'](_0x28c2('0x65'),_0x371a33[_0x28c2('0x51')]),_0x28c2('0x68'),{'uri':util[_0x28c2('0x44')](_0x28c2('0x73'),_0x2130ed['instanceUrl'],_0x40917b['id'])});break;default:logger[_0x28c2('0x6a')](_0x28c2('0x6e'),_0x28c2('0x74'));}})[_0x28c2('0x6b')](function(_0x373bf9){logger[_0x28c2('0x6a')](_0x28c2('0x6e'),_0x373bf9);});};exports[_0x28c2('0x75')]=function(_0x5962a8,_0xbcc846,_0x3438cd,_0x179e33,_0x4e2d30,_0x54055a){var _0x1ad50e,_0x304966,_0x32c783,_0xf68a64;_0x54055a['serverUrl']=intUtil['stripTrailingSlash'](_0x54055a[_0x28c2('0x5a')]);_0x54055a[_0x28c2('0x56')]=intUtil[_0x28c2('0x5b')](_0x54055a[_0x28c2('0x56')]);if(_0x4e2d30&&_0x4e2d30['monitor_format']){logger[_0x28c2('0x1f')]('['+_0xbcc846[_0x28c2('0x76')][_0x28c2('0x77')]()+']',_0x28c2('0x5d'));_0xbcc846[_0x28c2('0x5e')]=util['format'](_0x28c2('0x78'),_0x54055a[_0x28c2('0x5a')],_0xbcc846[_0x28c2('0x5f')],md5(_0xbcc846[_0x28c2('0x5f')]));}else{_0xbcc846[_0x28c2('0x5e')]='';}return getConnection(_0x54055a)['then'](function(_0x10c195){_0xf68a64=_0x10c195;if(!_[_0x28c2('0x79')](_0x179e33)){return getUser(_0x54055a,_0x179e33[_0x28c2('0x51')],_0xf68a64);}else{return getUser(_0x54055a,null,_0xf68a64);}})[_0x28c2('0x2e')](function(_0x54a2da){_0x1ad50e=_0x54a2da;return getEndUser(_0x54055a,_0x3438cd,_0xbcc846[_0x28c2('0x7a')],_0xbcc846[_0x28c2('0x60')],_0xf68a64);})['then'](function(_0x5bd98a){_0x304966=_0x5bd98a;return getTicket(_0x54055a,_0x1ad50e,_0x304966,_0x3438cd,_0xbcc846,_0x3438cd[_0x28c2('0x61')],_0xf68a64);})[_0x28c2('0x2e')](function(_0x59704b){_0x32c783=_0x59704b;logger[_0x28c2('0x1f')]('['+_0xbcc846['lastevent']['toUpperCase']()+_0x28c2('0x7b'),_0x32c783['id']);logger[_0x28c2('0x1f')]('['+_0xbcc846[_0x28c2('0x76')][_0x28c2('0x77')]()+_0x28c2('0x7c'),_0x54055a['type']);})['catch'](function(_0x3337a8){logger[_0x28c2('0x6a')]('['+_0xbcc846[_0x28c2('0x76')][_0x28c2('0x77')]()+']',_0x3337a8);});}; \ 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 78fc784..8693aa9 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 _0xd81c=['all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','email','destcalleridnum','callDirection','format','uniqueid','monitor_format','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','true','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','type','nameField','toLowerCase','toString','string','picklist','customField','content','variable','variableName','customVariable','Variable','name','idField','outbound','userId','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident'];(function(_0x550b3f,_0x2dbbbd){var _0x14e4dc=function(_0x271fdc){while(--_0x271fdc){_0x550b3f['push'](_0x550b3f['shift']());}};_0x14e4dc(++_0x2dbbbd);}(_0xd81c,0x8c));var _0xcd81=function(_0x452699,_0x472c65){_0x452699=_0x452699-0x0;var _0x5c1d59=_0xd81c[_0x452699];return _0x5c1d59;};'use strict';var _=require(_0xcd81('0x0'));var Promise=require(_0xcd81('0x1'));var rp=require(_0xcd81('0x2'));var util=require(_0xcd81('0x3'));var md5=require(_0xcd81('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xcd81('0x5'));var logger=require(_0xcd81('0x6'))(_0xcd81('0x7'));config[_0xcd81('0x8')]=_[_0xcd81('0x9')](config[_0xcd81('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xcd81('0xa'))(new Redis(config[_0xcd81('0x8')]));function getAdminUser(_0x1ff264,_0x2395d7,_0x411270,_0x4da4fd,_0x1dc750,_0x4880e6){return new Promise(function(_0x58b73c,_0x501c82){var _0x41e385={'method':_0xcd81('0xb'),'uri':_0x4da4fd+_0xcd81('0xc')+'&'+_0x1dc750+'&'+_0x4880e6,'auth':_0x2395d7,'json':!![]};return rp(_0x41e385)['then'](function(_0x4749ed){if(_0x4749ed['result']['length']>0x0){_0x411270['adminId']=_0x4749ed[_0xcd81('0xd')][0x0][_0xcd81('0xe')];}logger[_0xcd81('0xf')]('['+[_0x1ff264[_0xcd81('0x10')]()]+_0xcd81('0x11'),_0x411270);_0x58b73c(_0x411270);})[_0xcd81('0x12')](function(_0x3703af){logger[_0xcd81('0x13')]('['+[_0x1ff264[_0xcd81('0x10')]()]+']',_0x3703af[_0xcd81('0x14')]);_0x501c82(_0x3703af[_0xcd81('0x14')]);});});}function getUser(_0x415b86,_0x37ba24,_0x5d1d17,_0x2ede6e,_0x119681){return function(_0x336aec){logger['info']('['+[_0x415b86[_0xcd81('0x10')]()]+_0xcd81('0x15'),_0x336aec);return new Promise(function(_0x4f9e84,_0x3eb392){if(intUtil[_0xcd81('0x16')](_0x336aec[_0xcd81('0x17')])){var _0x248ca2={'method':'GET','uri':_0x5d1d17+_0xcd81('0x18')+_0x336aec[_0xcd81('0x17')]+'&'+_0x2ede6e+'&'+_0x119681,'auth':_0x37ba24,'json':!![]};logger[_0xcd81('0xf')]('['+[_0x415b86[_0xcd81('0x10')]()]+_0xcd81('0x19'),_0x248ca2);return rp(_0x248ca2)[_0xcd81('0x1a')](function(_0x315111){logger[_0xcd81('0xf')]('['+[_0x415b86[_0xcd81('0x10')]()]+'],\x20getUser\x20entity',_0x315111);if(_0x315111[_0xcd81('0xd')]['length']>0x0&&String(_0x315111[_0xcd81('0xd')][0x0][_0xcd81('0x1b')])===_0xcd81('0x1c')){_0x336aec['userId']=_0x315111[_0xcd81('0xd')][0x0][_0xcd81('0xe')];}else{_0x336aec['userId']=_0x336aec[_0xcd81('0x1d')];_0x336aec[_0xcd81('0x17')]=_0x336aec['adminEmail'];}logger[_0xcd81('0xf')]('['+[_0x415b86[_0xcd81('0x10')]()]+'],\x20getUser\x20crm',_0x336aec);_0x4f9e84(_0x336aec);})[_0xcd81('0x12')](function(_0x264081){logger['error']('['+[_0x415b86['toUpperCase']()]+']',_0x264081[_0xcd81('0x14')]);_0x3eb392(_0x264081[_0xcd81('0x14')]);});}else{logger['info']('['+[_0x415b86[_0xcd81('0x10')]()]+']\x20using\x20admin\x20profile');_0x336aec['userId']=_0x336aec['adminId'];_0x336aec[_0xcd81('0x17')]=_0x336aec[_0xcd81('0x1e')];_0x4f9e84(_0x336aec);}});};}function createEndUser(_0x5f544f,_0x1452d9,_0x21cffc,_0x529b48,_0x50e78d){logger['info']('['+[_0x5f544f[_0xcd81('0x10')]()]+_0xcd81('0x1f'),_0x21cffc);return new Promise(function(_0x22626f,_0x164f7c){var _0x35a890={'method':_0xcd81('0x20'),'uri':_0x529b48+_0xcd81('0x21')+_0x50e78d,'body':{'user_name':_0x21cffc[_0xcd81('0x22')],'roles':'user','first_name':_0x21cffc[_0xcd81('0x22')],'active':'true','date_format':'System','phone':_0x21cffc['endUserNumber']},'auth':_0x1452d9,'json':!![]};return rp(_0x35a890)[_0xcd81('0x1a')](function(_0x5f4604){logger[_0xcd81('0xf')]('['+[_0x5f544f[_0xcd81('0x10')]()]+_0xcd81('0x23'),_0x5f4604[_0xcd81('0xd')]);_0x21cffc[_0xcd81('0x24')]=_0x5f4604['result'][_0xcd81('0xe')];_0x22626f(_0x21cffc);})[_0xcd81('0x12')](function(_0x593f31){logger[_0xcd81('0x13')]('['+[_0x5f544f[_0xcd81('0x10')]()]+']',_0x593f31[_0xcd81('0x14')]);_0x164f7c(_0x593f31['message']);});});}function getEndUser(_0x5cfab,_0x5bb69d,_0x4acb99,_0x49dd67,_0x593df8){return function(_0x1641b1){logger[_0xcd81('0xf')]('['+[_0x5cfab[_0xcd81('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x1641b1);return new Promise(function(_0x4dae6e,_0x5e6037){var _0x5a6a5b={'method':_0xcd81('0xb'),'uri':_0x4acb99+_0xcd81('0x25')+_0x1641b1['endUserNumber']+'&'+_0x49dd67+'&'+_0x593df8,'auth':_0x5bb69d,'json':!![]};return rp(_0x5a6a5b)[_0xcd81('0x1a')](function(_0x10fb1b){if(_0x10fb1b['result'][_0xcd81('0x26')]>0x0){_0x1641b1[_0xcd81('0x24')]=_0x10fb1b[_0xcd81('0xd')][0x0][_0xcd81('0xe')];logger[_0xcd81('0xf')]('['+[_0x5cfab[_0xcd81('0x10')]()]+_0xcd81('0x27'),_0x1641b1);_0x4dae6e(_0x1641b1);}else{return createEndUser(_0x5cfab,_0x5bb69d,_0x1641b1,_0x4acb99,_0x49dd67)[_0xcd81('0x1a')](function(_0x2c656c){logger['info']('['+[_0x5cfab[_0xcd81('0x10')]()]+_0xcd81('0x28'),_0x2c656c);_0x4dae6e(_0x2c656c);});}})[_0xcd81('0x12')](function(_0x4181bb){logger[_0xcd81('0x13')]('['+[_0x5cfab['toUpperCase']()]+']',_0x4181bb[_0xcd81('0x14')]);_0x5e6037(_0x4181bb[_0xcd81('0x14')]);});});};}function getCustomFields(_0x48fff2,_0x3f93ee){var _0x16c56a={};if(_0x48fff2[_0xcd81('0x26')]>0x0){_[_0xcd81('0x29')](_0x48fff2,function(_0x2a97a7){if(_[_0xcd81('0x2a')](['string','picklist'],_0x2a97a7[_0xcd81('0x2b')])&&_0x2a97a7[_0xcd81('0x2c')]&&!_0x2a97a7['customField']){_0x16c56a[_0x2a97a7[_0xcd81('0x2c')][_0xcd81('0x2d')]()]=_0x2a97a7['content'][_0xcd81('0x2e')]();}else if(_[_0xcd81('0x2a')]([_0xcd81('0x2f'),_0xcd81('0x30')],_0x2a97a7[_0xcd81('0x2b')])&&_0x2a97a7['idField']&&_0x2a97a7[_0xcd81('0x31')]){_0x16c56a[_0x2a97a7['idField'][_0xcd81('0x2d')]()]=_0x2a97a7[_0xcd81('0x32')]['toString']();}else if(_0x2a97a7[_0xcd81('0x2b')]===_0xcd81('0x33')&&_0x2a97a7[_0xcd81('0x34')]&&_0x2a97a7['idField']&&_0x2a97a7[_0xcd81('0x31')]){_0x16c56a[_0x2a97a7['idField'][_0xcd81('0x2d')]()]=_0x3f93ee[_0x2a97a7['variableName']]['toString']();}else if(_0x2a97a7[_0xcd81('0x2b')]===_0xcd81('0x35')&&_0x2a97a7[_0xcd81('0x36')]&&_0x2a97a7['Variable'][_0xcd81('0x37')]&&_0x2a97a7[_0xcd81('0x38')]&&_0x2a97a7[_0xcd81('0x31')]){_0x16c56a[_0x2a97a7[_0xcd81('0x38')][_0xcd81('0x2d')]()]=_0x3f93ee[_0x2a97a7[_0xcd81('0x36')]['name'][_0xcd81('0x2d')]()][_0xcd81('0x2e')]();}});}return _0x16c56a;}function getTicket(_0x14883c,_0x16ad5b,_0x496dbd,_0x499583,_0xc0670d,_0x45d33c){return function(_0x4dec00){logger[_0xcd81('0xf')]('['+[_0x14883c[_0xcd81('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x4dec00);return new Promise(function(_0x4436f5,_0x2f44f9){var _0x1de098=_0x14883c[_0xcd81('0x2d')]()===_0xcd81('0x39')?_0x4dec00[_0xcd81('0x3a')]:_0x4dec00[_0xcd81('0x24')];var _0x5a31a0={'method':'POST','uri':_0x496dbd+'incident'+'?'+_0x45d33c,'body':Object[_0xcd81('0x3b')]({},{'active':_0xcd81('0x1c'),'caller_id':_0x1de098,'assigned_to':_0x4dec00[_0xcd81('0x3a')],'short_description':intUtil[_0xcd81('0x3c')](_0x499583['Subjects'],_0xc0670d,'\x20'),'description':intUtil['getString'](_0x499583[_0xcd81('0x3d')],_0xc0670d,'\x0a')},getCustomFields(_0x499583[_0xcd81('0x3e')],_0xc0670d)),'auth':_0x16ad5b,'json':!![]};return rp(_0x5a31a0)[_0xcd81('0x1a')](function(_0x5b0518){logger[_0xcd81('0xf')]('['+[_0x14883c['toUpperCase']()]+_0xcd81('0x3f'),_0x5b0518['result']);_0x4dec00[_0xcd81('0x40')]=_0x5b0518['result'][_0xcd81('0xe')];_0x4dec00[_0xcd81('0x41')]=_0x5b0518['result']['number'];logger[_0xcd81('0xf')]('['+[_0x14883c[_0xcd81('0x10')]()]+_0xcd81('0x42'),_0x4dec00);_0x4436f5(_0x4dec00);})[_0xcd81('0x12')](function(_0x2092ec){logger[_0xcd81('0x13')]('['+[_0x14883c[_0xcd81('0x10')]()]+']',_0x2092ec['message']);_0x2f44f9(_0x2092ec[_0xcd81('0x14')]);});});};}function createRemoteTag(_0x27bd66,_0x48f62d,_0x1a5744,_0x4c0d09){return new Promise(function(_0x345e5d,_0x2d9d78){var _0x5ed771={'method':'POST','uri':_0x1a5744+_0xcd81('0x43')+'?'+_0x4c0d09,'body':{'short_description':_0x27bd66,'global':!![],'active':!![],'name':_0x27bd66},'auth':_0x48f62d,'json':!![]};return rp(_0x5ed771)[_0xcd81('0x1a')](function(_0x440ff4){var _0x1383e0=_0x440ff4[_0xcd81('0xd')]['sys_id'];_0x345e5d(_0x1383e0);});});}function getRemoteTag(_0x3e3d03,_0x51eb44,_0x533a4d,_0x1f2c06,_0x24f5bb){return new Promise(function(_0x47309c,_0x31995b){var _0x5a00d7={'method':_0xcd81('0xb'),'uri':_0x533a4d+'label'+_0xcd81('0x44')+_0x3e3d03+'&'+_0x1f2c06,'auth':_0x51eb44,'json':!![]};return rp(_0x5a00d7)[_0xcd81('0x1a')](function(_0x408025){if(_0x408025[_0xcd81('0xd')][_0xcd81('0x26')]>0x0){var _0x38198c=_0x408025[_0xcd81('0xd')][0x0][_0xcd81('0xe')];_0x47309c(_0x38198c);}else{return createRemoteTag(_0x3e3d03,_0x51eb44,_0x533a4d,_0x1f2c06)[_0xcd81('0x1a')](function(_0x3f3194){_0x47309c(_0x3f3194);});}});});}function assignTagToIncident(_0x296c65,_0xad99fe,_0x597051,_0x3f9412,_0xb40f58){return new Promise(function(_0x4471c4,_0x4ad151){var _0x1598b8={'method':_0xcd81('0x20'),'uri':_0x597051+_0xcd81('0x45')+'?'+_0xb40f58,'body':{'label':_0x296c65,'table':_0xcd81('0x46'),'id_type':_0xcd81('0x47'),'table_key':_0x3f9412[_0xcd81('0x40')],'title':'Incident\x20-\x20'+_0x3f9412[_0xcd81('0x41')],'id_display':_0x3f9412['ticketNumber']},'auth':_0xad99fe,'json':!![]};return rp(_0x1598b8)[_0xcd81('0x1a')](function(_0x59cfdc){_0x4471c4();})['catch'](function(){_0x4471c4();});});}function manageTags(_0x4f466e,_0x54a1f5,_0x1c3502,_0x5d2727,_0x2be259,_0x27427b,_0x2a268a){return new Promise(function(_0x4b7caa,_0x3e182a){var _0x4b415b=[];_0x54a1f5['forEach'](function(_0x3eb921){_0x4b415b['push'](getRemoteTag(_0x3eb921,_0x1c3502,_0x5d2727,_0x27427b,_0x2a268a));});return Promise[_0xcd81('0x48')](_0x4b415b)[_0xcd81('0x1a')](function(_0x105263){if(_0x105263[_0xcd81('0x26')]){logger['info']('['+[_0x4f466e[_0xcd81('0x10')]()]+_0xcd81('0x49'),_0x105263);var _0x7cf42=[];_0x105263[_0xcd81('0x29')](function(_0xc26ed){_0x7cf42[_0xcd81('0x4a')](assignTagToIncident(_0xc26ed,_0x1c3502,_0x5d2727,_0x2be259,_0x27427b));});return Promise[_0xcd81('0x48')](_0x7cf42)[_0xcd81('0x1a')](function(){_0x4b7caa();})[_0xcd81('0x12')](function(){_0x4b7caa();});}else{_0x4b7caa();}});});}function getTags(_0x777482,_0x1d0035,_0x25e17b,_0x596d19,_0x17b501,_0x4332d3){return function(_0x2ff9df){return new Promise(function(_0x48e166,_0xc0b912){var _0x23cef6=[];var _0x361219=_0x596d19[_0xcd81('0x4b')];if(_0x361219&&_0x361219[_0xcd81('0x26')]>0x0){_0x23cef6=_[_0xcd81('0x4c')](_0x361219,'name');}if(_0x23cef6[_0xcd81('0x26')]>0x0){return manageTags(_0x777482,_0x23cef6,_0x1d0035,_0x25e17b,_0x2ff9df,_0x17b501,_0x4332d3)[_0xcd81('0x1a')](function(){_0x48e166(_0x2ff9df);});}else{_0x48e166(_0x2ff9df);}});};}function emit(_0x46d9cb,_0x2beff9,_0x124c90){var _0x33c006='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xcd81('0x4d')+_0xcd81('0x4e');var _0x1ace14={'uri':_0x46d9cb+_0xcd81('0x4f')+_0x124c90+_0x33c006};io['to'](util['format']('user:%s',_0x2beff9))[_0xcd81('0x50')](_0xcd81('0x51'),_0x1ace14);}exports['cs']=function(_0xaa9700,_0x50c9e9,_0x1b5ecd,_0x2a4cf9,_0x7f83a2,_0x3512d7,_0xe06e52,_0x3780f4){var _0x236c7f={};var _0x16f747={'user':_0x3512d7[_0xcd81('0x52')],'pass':_0x3512d7[_0xcd81('0x53')]};var _0x4eabe7=_0xcd81('0x54');var _0x288021=_0xcd81('0x55');_0x3512d7['remoteUri']=intUtil['stripTrailingSlash'](_0x3512d7[_0xcd81('0x56')]);_0x3512d7[_0xcd81('0x57')]=intUtil[_0xcd81('0x58')](_0x3512d7[_0xcd81('0x57')]);var _0x21a02a=util['format'](_0xcd81('0x59'),_0x3512d7['remoteUri']);_0x236c7f[_0xcd81('0x17')]=!_['isNil'](_0x2a4cf9)?_0x2a4cf9['email']:null;_0x236c7f[_0xcd81('0x1e')]=_0x3512d7[_0xcd81('0x5a')];_0x236c7f[_0xcd81('0x22')]=_0x3780f4[_0xcd81('0x2d')]()===_0xcd81('0x39')?_0x50c9e9[_0xcd81('0x5b')]:_0x50c9e9['calleridnum'];_0x236c7f[_0xcd81('0x5c')]=_0x3780f4==='queue'||_0x3780f4==='unmanaged'?'queue':_0xcd81('0x39');var _0x2d19e3=util[_0xcd81('0x5d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3512d7[_0xcd81('0x57')],_0x50c9e9[_0xcd81('0x5e')],md5(_0x50c9e9[_0xcd81('0x5e')]));if(_0x7f83a2&&_0x7f83a2[_0xcd81('0x5f')]){logger[_0xcd81('0xf')]('[QUEUE]','Recording\x20is\x20enabled!');_0x50c9e9['recordingURL']=_0x2d19e3;}else if(_0xe06e52&&_0xe06e52[_0xcd81('0x60')]&&_0xe06e52[_0xcd81('0x60')]!==_0xcd81('0x61')){logger['info']('[OUTBOUND]',_0xcd81('0x62'));_0x50c9e9[_0xcd81('0x63')]=_0x2d19e3;}else{_0x50c9e9[_0xcd81('0x63')]='';}return getAdminUser(_0x3780f4,_0x16f747,_0x236c7f,_0x21a02a,_0x288021,_0x4eabe7)['then'](getUser(_0x3780f4,_0x16f747,_0x21a02a,_0x288021,_0x4eabe7))['then'](getEndUser(_0x3780f4,_0x16f747,_0x21a02a,_0x288021,_0x4eabe7))[_0xcd81('0x1a')](getTicket(_0x3780f4,_0x16f747,_0x21a02a,_0x1b5ecd,_0x50c9e9,_0x288021))[_0xcd81('0x1a')](function(_0x58b455){logger[_0xcd81('0xf')](util['format'](_0xcd81('0x64'),_0x58b455[_0xcd81('0x40')]));logger['info'](util['format'](_0xcd81('0x65'),_0x3780f4));if(_0x3780f4!==_0xcd81('0x66')){logger['info']('['+[_0x3780f4['toUpperCase']()]+']',_0xcd81('0x67'));emit(_0x3512d7[_0xcd81('0x56')],_0x2a4cf9['name'],_0x58b455[_0xcd81('0x40')]);}})[_0xcd81('0x12')](function(_0x33a01b){logger[_0xcd81('0x13')]('['+[_0x3780f4[_0xcd81('0x10')]()]+_0xcd81('0x68'),util[_0xcd81('0x69')](_0x33a01b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x463e=['email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','sys_id','adminEmail','error',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil'];(function(_0x4a5f59,_0x471f69){var _0x13740f=function(_0x36e80b){while(--_0x36e80b){_0x4a5f59['push'](_0x4a5f59['shift']());}};_0x13740f(++_0x471f69);}(_0x463e,0x1d6));var _0xe463=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x463e[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xe463('0x0'));var Promise=require(_0xe463('0x1'));var rp=require(_0xe463('0x2'));var util=require(_0xe463('0x3'));var md5=require(_0xe463('0x4'));var Redis=require(_0xe463('0x5'));var intUtil=require(_0xe463('0x6'));var config=require(_0xe463('0x7'));var logger=require(_0xe463('0x8'))(_0xe463('0x9'));config[_0xe463('0xa')]=_[_0xe463('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe463('0xa')]));function getAdminUser(_0x39efc1,_0x47135f,_0x2089cc,_0x3a4447,_0x305b07,_0x4d19bc){return new Promise(function(_0x2d8228,_0x5623c6){var _0x203e35={'method':_0xe463('0xc'),'uri':_0x3a4447+_0xe463('0xd')+'&'+_0x305b07+'&'+_0x4d19bc,'auth':_0x47135f,'json':!![]};return rp(_0x203e35)[_0xe463('0xe')](function(_0x21d3e5){if(_0x21d3e5[_0xe463('0xf')][_0xe463('0x10')]>0x0){_0x2089cc[_0xe463('0x11')]=_0x21d3e5[_0xe463('0xf')][0x0]['sys_id'];}logger[_0xe463('0x12')]('['+[_0x39efc1[_0xe463('0x13')]()]+_0xe463('0x14'),_0x2089cc);_0x2d8228(_0x2089cc);})['catch'](function(_0x438574){logger['error']('['+[_0x39efc1[_0xe463('0x13')]()]+']',_0x438574[_0xe463('0x15')]);_0x5623c6(_0x438574[_0xe463('0x15')]);});});}function getUser(_0x28e5c9,_0x511311,_0x349095,_0x9f2f,_0x8e4df6){return function(_0xd83804){logger[_0xe463('0x12')]('['+[_0x28e5c9[_0xe463('0x13')]()]+_0xe463('0x16'),_0xd83804);return new Promise(function(_0x4d750b,_0x1eead3){if(intUtil['validateEmail'](_0xd83804[_0xe463('0x17')])){var _0x1f919a={'method':'GET','uri':_0x349095+_0xe463('0x18')+_0xd83804[_0xe463('0x17')]+'&'+_0x9f2f+'&'+_0x8e4df6,'auth':_0x511311,'json':!![]};logger['info']('['+[_0x28e5c9[_0xe463('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x1f919a);return rp(_0x1f919a)[_0xe463('0xe')](function(_0x48362d){logger[_0xe463('0x12')]('['+[_0x28e5c9[_0xe463('0x13')]()]+_0xe463('0x19'),_0x48362d);if(_0x48362d[_0xe463('0xf')][_0xe463('0x10')]>0x0&&String(_0x48362d['result'][0x0][_0xe463('0x1a')])===_0xe463('0x1b')){_0xd83804['userId']=_0x48362d[_0xe463('0xf')][0x0][_0xe463('0x1c')];}else{_0xd83804['userId']=_0xd83804[_0xe463('0x11')];_0xd83804[_0xe463('0x17')]=_0xd83804[_0xe463('0x1d')];}logger[_0xe463('0x12')]('['+[_0x28e5c9[_0xe463('0x13')]()]+'],\x20getUser\x20crm',_0xd83804);_0x4d750b(_0xd83804);})['catch'](function(_0x494a90){logger[_0xe463('0x1e')]('['+[_0x28e5c9[_0xe463('0x13')]()]+']',_0x494a90[_0xe463('0x15')]);_0x1eead3(_0x494a90[_0xe463('0x15')]);});}else{logger[_0xe463('0x12')]('['+[_0x28e5c9['toUpperCase']()]+_0xe463('0x1f'));_0xd83804[_0xe463('0x20')]=_0xd83804[_0xe463('0x11')];_0xd83804[_0xe463('0x17')]=_0xd83804[_0xe463('0x1d')];_0x4d750b(_0xd83804);}});};}function createEndUser(_0xafe15d,_0x4d87a2,_0x187d38,_0x5580c7,_0x210e6a){logger[_0xe463('0x12')]('['+[_0xafe15d[_0xe463('0x13')]()]+_0xe463('0x21'),_0x187d38);return new Promise(function(_0x3b10ca,_0x4c1eca){var _0x4cd456={'method':_0xe463('0x22'),'uri':_0x5580c7+_0xe463('0x23')+_0x210e6a,'body':{'user_name':_0x187d38[_0xe463('0x24')],'roles':'user','first_name':_0x187d38[_0xe463('0x24')],'active':_0xe463('0x1b'),'date_format':_0xe463('0x25'),'phone':_0x187d38['endUserNumber']},'auth':_0x4d87a2,'json':!![]};return rp(_0x4cd456)['then'](function(_0xb4a4df){logger[_0xe463('0x12')]('['+[_0xafe15d[_0xe463('0x13')]()]+_0xe463('0x26'),_0xb4a4df['result']);_0x187d38['endUserId']=_0xb4a4df[_0xe463('0xf')]['sys_id'];_0x3b10ca(_0x187d38);})[_0xe463('0x27')](function(_0x35469c){logger['error']('['+[_0xafe15d[_0xe463('0x13')]()]+']',_0x35469c[_0xe463('0x15')]);_0x4c1eca(_0x35469c[_0xe463('0x15')]);});});}function getEndUser(_0x2bf005,_0x2e3114,_0x5f1bff,_0x209089,_0x53cdd2){return function(_0x1b4a36){logger[_0xe463('0x12')]('['+[_0x2bf005[_0xe463('0x13')]()]+_0xe463('0x28'),_0x1b4a36);return new Promise(function(_0x548109,_0x3acf13){var _0x4e414f={'method':_0xe463('0xc'),'uri':_0x5f1bff+_0xe463('0x29')+_0x1b4a36[_0xe463('0x24')]+'&'+_0x209089+'&'+_0x53cdd2,'auth':_0x2e3114,'json':!![]};return rp(_0x4e414f)[_0xe463('0xe')](function(_0x1d5805){if(_0x1d5805[_0xe463('0xf')][_0xe463('0x10')]>0x0){_0x1b4a36[_0xe463('0x2a')]=_0x1d5805['result'][0x0][_0xe463('0x1c')];logger[_0xe463('0x12')]('['+[_0x2bf005[_0xe463('0x13')]()]+_0xe463('0x2b'),_0x1b4a36);_0x548109(_0x1b4a36);}else{return createEndUser(_0x2bf005,_0x2e3114,_0x1b4a36,_0x5f1bff,_0x209089)[_0xe463('0xe')](function(_0x981f05){logger['info']('['+[_0x2bf005['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x981f05);_0x548109(_0x981f05);});}})[_0xe463('0x27')](function(_0x1be640){logger[_0xe463('0x1e')]('['+[_0x2bf005['toUpperCase']()]+']',_0x1be640[_0xe463('0x15')]);_0x3acf13(_0x1be640['message']);});});};}function getCustomFields(_0x1c2111,_0x4c9904){var _0xcd9ba={};if(_0x1c2111[_0xe463('0x10')]>0x0){_['forEach'](_0x1c2111,function(_0x3fa495){if(_[_0xe463('0x2c')]([_0xe463('0x2d'),_0xe463('0x2e')],_0x3fa495[_0xe463('0x2f')])&&_0x3fa495[_0xe463('0x30')]&&!_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x30')][_0xe463('0x32')]()]=_0x3fa495[_0xe463('0x33')][_0xe463('0x34')]();}else if(_[_0xe463('0x2c')]([_0xe463('0x2d'),_0xe463('0x2e')],_0x3fa495[_0xe463('0x2f')])&&_0x3fa495[_0xe463('0x35')]&&_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x35')]['toLowerCase']()]=_0x3fa495[_0xe463('0x33')][_0xe463('0x34')]();}else if(_0x3fa495[_0xe463('0x2f')]===_0xe463('0x36')&&_0x3fa495[_0xe463('0x37')]&&_0x3fa495[_0xe463('0x35')]&&_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x35')][_0xe463('0x32')]()]=_0x4c9904[_0x3fa495['variableName']][_0xe463('0x34')]();}else if(_0x3fa495[_0xe463('0x2f')]===_0xe463('0x38')&&_0x3fa495['Variable']&&_0x3fa495[_0xe463('0x39')][_0xe463('0x3a')]&&_0x3fa495[_0xe463('0x35')]&&_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x35')][_0xe463('0x32')]()]=_0x4c9904[_0x3fa495['Variable'][_0xe463('0x3a')][_0xe463('0x32')]()]['toString']();}});}return _0xcd9ba;}function getTicket(_0x4daaa9,_0x3a1f5d,_0x21a53d,_0x1a8c7c,_0x2e1ecb,_0x2b46f6){return function(_0x751973){logger['info']('['+[_0x4daaa9[_0xe463('0x13')]()]+_0xe463('0x3b'),_0x751973);return new Promise(function(_0x434981,_0x58a2bc){var _0x514452=_0x4daaa9[_0xe463('0x32')]()===_0xe463('0x3c')?_0x751973[_0xe463('0x20')]:_0x751973['endUserId'];var _0x494f0d={'method':'POST','uri':_0x21a53d+'incident'+'?'+_0x2b46f6,'body':Object[_0xe463('0x3d')]({},{'active':_0xe463('0x1b'),'caller_id':_0x514452,'assigned_to':_0x751973[_0xe463('0x20')],'short_description':intUtil[_0xe463('0x3e')](_0x1a8c7c[_0xe463('0x3f')],_0x2e1ecb,'\x20'),'description':intUtil[_0xe463('0x3e')](_0x1a8c7c[_0xe463('0x40')],_0x2e1ecb,'\x0a')},getCustomFields(_0x1a8c7c[_0xe463('0x41')],_0x2e1ecb)),'auth':_0x3a1f5d,'json':!![]};return rp(_0x494f0d)[_0xe463('0xe')](function(_0x117d93){logger[_0xe463('0x12')]('['+[_0x4daaa9[_0xe463('0x13')]()]+_0xe463('0x42'),_0x117d93['result']);_0x751973['ticketId']=_0x117d93[_0xe463('0xf')][_0xe463('0x1c')];_0x751973[_0xe463('0x43')]=_0x117d93['result'][_0xe463('0x44')];logger[_0xe463('0x12')]('['+[_0x4daaa9[_0xe463('0x13')]()]+_0xe463('0x45'),_0x751973);_0x434981(_0x751973);})[_0xe463('0x27')](function(_0x208b21){logger[_0xe463('0x1e')]('['+[_0x4daaa9[_0xe463('0x13')]()]+']',_0x208b21[_0xe463('0x15')]);_0x58a2bc(_0x208b21[_0xe463('0x15')]);});});};}function createRemoteTag(_0xbeaca9,_0x40e56d,_0x5b3e72,_0x33e43d){return new Promise(function(_0x412433,_0x3dc062){var _0x427b0f={'method':_0xe463('0x22'),'uri':_0x5b3e72+_0xe463('0x46')+'?'+_0x33e43d,'body':{'short_description':_0xbeaca9,'global':!![],'active':!![],'name':_0xbeaca9},'auth':_0x40e56d,'json':!![]};return rp(_0x427b0f)[_0xe463('0xe')](function(_0x404aa3){var _0xc35b09=_0x404aa3['result']['sys_id'];_0x412433(_0xc35b09);});});}function getRemoteTag(_0x22c36a,_0x5788e3,_0x3e4150,_0x4e161d,_0x1fd336){return new Promise(function(_0x1e09bc,_0x4b25e2){var _0xe11b0f={'method':_0xe463('0xc'),'uri':_0x3e4150+_0xe463('0x46')+_0xe463('0x47')+_0x22c36a+'&'+_0x4e161d,'auth':_0x5788e3,'json':!![]};return rp(_0xe11b0f)['then'](function(_0x5380dd){if(_0x5380dd['result'][_0xe463('0x10')]>0x0){var _0x4548e6=_0x5380dd[_0xe463('0xf')][0x0][_0xe463('0x1c')];_0x1e09bc(_0x4548e6);}else{return createRemoteTag(_0x22c36a,_0x5788e3,_0x3e4150,_0x4e161d)[_0xe463('0xe')](function(_0x45ebc3){_0x1e09bc(_0x45ebc3);});}});});}function assignTagToIncident(_0x13e496,_0x44d034,_0x46ab34,_0x4008fd,_0x31d60f){return new Promise(function(_0x5b302f,_0x5235a4){var _0x340f3a={'method':_0xe463('0x22'),'uri':_0x46ab34+_0xe463('0x48')+'?'+_0x31d60f,'body':{'label':_0x13e496,'table':'incident','id_type':'Incident','table_key':_0x4008fd['ticketId'],'title':'Incident\x20-\x20'+_0x4008fd[_0xe463('0x43')],'id_display':_0x4008fd[_0xe463('0x43')]},'auth':_0x44d034,'json':!![]};return rp(_0x340f3a)[_0xe463('0xe')](function(_0x56e9b1){_0x5b302f();})[_0xe463('0x27')](function(){_0x5b302f();});});}function manageTags(_0x45bee4,_0x439d74,_0x456b4e,_0x21ccf0,_0x3b3640,_0x3a0a96,_0x3221db){return new Promise(function(_0x4e0fbe,_0x5eee5d){var _0x2f3062=[];_0x439d74[_0xe463('0x49')](function(_0x5a58c8){_0x2f3062[_0xe463('0x4a')](getRemoteTag(_0x5a58c8,_0x456b4e,_0x21ccf0,_0x3a0a96,_0x3221db));});return Promise['all'](_0x2f3062)[_0xe463('0xe')](function(_0x55e4e5){if(_0x55e4e5[_0xe463('0x10')]){logger[_0xe463('0x12')]('['+[_0x45bee4[_0xe463('0x13')]()]+_0xe463('0x4b'),_0x55e4e5);var _0xa2f4e4=[];_0x55e4e5[_0xe463('0x49')](function(_0x1714f6){_0xa2f4e4['push'](assignTagToIncident(_0x1714f6,_0x456b4e,_0x21ccf0,_0x3b3640,_0x3a0a96));});return Promise[_0xe463('0x4c')](_0xa2f4e4)[_0xe463('0xe')](function(){_0x4e0fbe();})['catch'](function(){_0x4e0fbe();});}else{_0x4e0fbe();}});});}function getTags(_0x3dbd74,_0x627bfc,_0x1f67a9,_0xd084f5,_0x1461e4,_0x41e975){return function(_0x3d71d6){return new Promise(function(_0x460b09,_0x236cd5){var _0x44bf34=[];var _0x2d7517=_0xd084f5['Tags'];if(_0x2d7517&&_0x2d7517[_0xe463('0x10')]>0x0){_0x44bf34=_[_0xe463('0x4d')](_0x2d7517,_0xe463('0x3a'));}if(_0x44bf34[_0xe463('0x10')]>0x0){return manageTags(_0x3dbd74,_0x44bf34,_0x627bfc,_0x1f67a9,_0x3d71d6,_0x1461e4,_0x41e975)['then'](function(){_0x460b09(_0x3d71d6);});}else{_0x460b09(_0x3d71d6);}});};}function emit(_0x3a9f08,_0x184087,_0x41dccd){var _0x50b407=_0xe463('0x4e')+_0xe463('0x4f')+_0xe463('0x50')+_0xe463('0x51');var _0x51310a={'uri':_0x3a9f08+_0xe463('0x52')+_0x41dccd+_0x50b407};io['to'](util[_0xe463('0x53')](_0xe463('0x54'),_0x184087))[_0xe463('0x55')]('trigger:browser:url',_0x51310a);}exports['cs']=function(_0x58bf4b,_0x1017a3,_0x4be612,_0x211fb1,_0x2e035,_0x34c332,_0x3b2469,_0x474b6d){var _0x486470={};var _0x5907cf={'user':_0x34c332[_0xe463('0x56')],'pass':_0x34c332[_0xe463('0x57')]};var _0xd614c4=_0xe463('0x58');var _0x3b9efb=_0xe463('0x59');_0x34c332['remoteUri']=intUtil[_0xe463('0x5a')](_0x34c332[_0xe463('0x5b')]);_0x34c332[_0xe463('0x5c')]=intUtil[_0xe463('0x5a')](_0x34c332['serverUrl']);var _0x5c2b1a=util[_0xe463('0x53')](_0xe463('0x5d'),_0x34c332[_0xe463('0x5b')]);_0x486470['userEmail']=!_[_0xe463('0x5e')](_0x211fb1)?_0x211fb1[_0xe463('0x5f')]:null;_0x486470['adminEmail']=_0x34c332[_0xe463('0x5f')];_0x486470[_0xe463('0x24')]=_0x474b6d[_0xe463('0x32')]()==='outbound'?_0x1017a3[_0xe463('0x60')]:_0x1017a3[_0xe463('0x61')];_0x486470['callDirection']=_0x474b6d===_0xe463('0x62')||_0x474b6d===_0xe463('0x63')?_0xe463('0x62'):_0xe463('0x3c');var _0x145045=util[_0xe463('0x53')](_0xe463('0x64'),_0x34c332[_0xe463('0x5c')],_0x1017a3[_0xe463('0x65')],md5(_0x1017a3[_0xe463('0x65')]));if(_0x2e035&&_0x2e035[_0xe463('0x66')]){logger[_0xe463('0x12')]('[QUEUE]',_0xe463('0x67'));_0x1017a3['recordingURL']=_0x145045;}else if(_0x3b2469&&_0x3b2469[_0xe463('0x68')]&&_0x3b2469[_0xe463('0x68')]!==_0xe463('0x69')){logger[_0xe463('0x12')](_0xe463('0x6a'),_0xe463('0x67'));_0x1017a3[_0xe463('0x6b')]=_0x145045;}else{_0x1017a3[_0xe463('0x6b')]='';}return getAdminUser(_0x474b6d,_0x5907cf,_0x486470,_0x5c2b1a,_0x3b9efb,_0xd614c4)[_0xe463('0xe')](getUser(_0x474b6d,_0x5907cf,_0x5c2b1a,_0x3b9efb,_0xd614c4))[_0xe463('0xe')](getEndUser(_0x474b6d,_0x5907cf,_0x5c2b1a,_0x3b9efb,_0xd614c4))[_0xe463('0xe')](getTicket(_0x474b6d,_0x5907cf,_0x5c2b1a,_0x4be612,_0x1017a3,_0x3b9efb))[_0xe463('0xe')](function(_0x258fa4){logger[_0xe463('0x12')](util[_0xe463('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0x258fa4[_0xe463('0x6c')]));logger['info'](util[_0xe463('0x53')](_0xe463('0x6d'),_0x474b6d));if(_0x474b6d!==_0xe463('0x63')){logger['info']('['+[_0x474b6d['toUpperCase']()]+']',_0xe463('0x6e'));emit(_0x34c332[_0xe463('0x5b')],_0x211fb1[_0xe463('0x3a')],_0x258fa4[_0xe463('0x6c')]);}})['catch'](function(_0xe62011){logger[_0xe463('0x1e')]('['+[_0x474b6d['toUpperCase']()]+_0xe463('0x6f'),util[_0xe463('0x70')](_0xe62011,{'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 81dfff3..1e10165 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 _0xd277=['emit','name','getString','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','direction','length','forEach','push','idField','variableName','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','get_server_info','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','set_entry','first_name','','Enduser\x20created.','[HTTP]','type','string','customField','nameField','toLowerCase','content','custom_fields','variable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','POST'];(function(_0x379c24,_0x242e17){var _0x69186e=function(_0x591218){while(--_0x591218){_0x379c24['push'](_0x379c24['shift']());}};_0x69186e(++_0x242e17);}(_0xd277,0x68));var _0x7d27=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd277[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7d27('0x0'));var rp=require(_0x7d27('0x1'));var BPromise=require(_0x7d27('0x2'));var md5=require('md5');var util=require(_0x7d27('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7d27('0x4'));var config=require(_0x7d27('0x5'));var logger=require(_0x7d27('0x6'))(_0x7d27('0x7'));config['redis']=_['defaults'](config[_0x7d27('0x8')],{'host':_0x7d27('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7d27('0x8')]));var def={'method':_0x7d27('0xa'),'json':!![]};function emit(_0x248d41,_0x40d06a,_0x1c680d){io['to'](_0x248d41)[_0x7d27('0xb')](_0x40d06a,_0x1c680d);}function getTicket(_0x539509,_0x5a830e,_0x40d32e,_0x5d1f6a,_0x308396,_0x417307,_0x25bbab,_0x4b44fd){logger['info']('Creating\x20new\x20ticket...');var _0x224e3b=new Date();var _0x202c93=[{'name':_0x7d27('0xc'),'value':intUtil[_0x7d27('0xd')](_0x5d1f6a['Subjects'],_0x308396,'\x20')},{'name':'assigned_user_id','value':_0x5a830e['id']},{'name':_0x7d27('0xe'),'value':_0x5a830e['id']},{'name':_0x7d27('0xf'),'value':intUtil['getString'](_0x5d1f6a[_0x7d27('0x10')],_0x308396,'\x0a')},{'name':_0x7d27('0x11'),'value':_0x224e3b[_0x7d27('0x12')]()[_0x7d27('0x13')](0x0,0x13)[_0x7d27('0x14')]('T','\x20')},{'name':_0x7d27('0x15'),'value':'0'},{'name':_0x7d27('0x16'),'value':'15'},{'name':_0x7d27('0x17'),'value':_0x40d32e['id']},{'name':_0x7d27('0x18'),'value':'Contacts'},{'name':'parent_name','value':_0x40d32e[_0x7d27('0xc')]},{'name':_0x7d27('0x19'),'value':_0x4b44fd}];if(_0x417307[_0x7d27('0x1a')]){_[_0x7d27('0x1b')](_0x417307,function(_0x311ec2){if(_0x308396[_0x311ec2['variableName']]){_0x202c93[_0x7d27('0x1c')]({'name':_0x311ec2[_0x7d27('0x1d')],'value':_0x308396[_0x311ec2[_0x7d27('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x7d27('0x1f'),'response_type':_0x7d27('0x1f'),'rest_data':JSON[_0x7d27('0x20')]({'session':_0x25bbab['id'],'module_name':_0x7d27('0x21'),'name_value_list':_0x202c93})}});}function getAuth(_0x3f5059){return util['format'](_0x7d27('0x22'),new Buffer(_0x3f5059[_0x7d27('0x23')]+':X')[_0x7d27('0x24')]('base64'));}function getServerInfo(_0x19e120){return request({'form':{'method':_0x7d27('0x25'),'input_type':_0x7d27('0x1f'),'response_type':_0x7d27('0x1f'),'rest_data':JSON[_0x7d27('0x20')]({'session':_0x19e120['id']})}});}function getUser(_0x2efbca,_0x12b8f2,_0xef772){if(!_['isNil'](_0x12b8f2)){logger[_0x7d27('0x26')](_0x7d27('0x27'),_0x12b8f2);return request({'form':{'method':_0x7d27('0x28'),'input_type':_0x7d27('0x1f'),'response_type':'JSON','rest_data':JSON[_0x7d27('0x20')]({'session':_0xef772['id'],'module_name':_0x7d27('0x29'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x12b8f2),'order_by':'','offset':'0','select_fields':['id',_0x7d27('0xc'),_0x7d27('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7d27('0x2b')](function(_0x6eb597){if(_0x6eb597[_0x7d27('0x2c')][_0x7d27('0x1a')]){var _0x12ff39=_[_0x7d27('0x2d')](_0x6eb597[_0x7d27('0x2c')],function(_0x18f9f3){return _0x18f9f3[_0x7d27('0x2e')][_0x7d27('0x2a')]['value']===_0x12b8f2;});if(_0x12ff39){logger[_0x7d27('0x26')]('Agent\x20found!');return BPromise['resolve']({'id':_0x12ff39[_0x7d27('0x2e')]['id'][_0x7d27('0x2f')],'name':_0x12ff39[_0x7d27('0x2e')][_0x7d27('0xc')]['value']});}}logger[_0x7d27('0x26')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7d27('0x30')]({'id':_0xef772[_0x7d27('0x2e')][_0x7d27('0x31')][_0x7d27('0x2f')],'name':_0xef772[_0x7d27('0x2e')][_0x7d27('0x2a')][_0x7d27('0x2f')]});});}else{logger[_0x7d27('0x26')](_0x7d27('0x32'));return BPromise[_0x7d27('0x30')]({'id':_0xef772['name_value_list'][_0x7d27('0x31')][_0x7d27('0x2f')],'name':_0xef772['name_value_list'][_0x7d27('0x2a')][_0x7d27('0x2f')]});}}function getEndUser(_0x527323,_0x592576,_0x24c283,_0x13873b){logger[_0x7d27('0x26')]('Searching\x20enduser\x20with\x20phone',_0x24c283);return request({'form':{'method':_0x7d27('0x28'),'input_type':_0x7d27('0x1f'),'response_type':_0x7d27('0x1f'),'rest_data':JSON[_0x7d27('0x20')]({'session':_0x13873b['id'],'module_name':_0x7d27('0x33'),'query':util[_0x7d27('0x34')](_0x7d27('0x35'),_0x24c283),'order_by':'','offset':'0','select_fields':['id','name',_0x7d27('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7d27('0x2b')](function(_0x3e210a){if(_0x3e210a[_0x7d27('0x2c')][_0x7d27('0x1a')]){var _0x5767f7=_[_0x7d27('0x2d')](_0x3e210a['entry_list'],function(_0x12bebc){return _0x12bebc[_0x7d27('0x2e')][_0x7d27('0x36')]['value']===_0x24c283;});if(_0x5767f7){logger[_0x7d27('0x26')](_0x7d27('0x37'));return BPromise[_0x7d27('0x30')]({'id':_0x5767f7[_0x7d27('0x2e')]['id'][_0x7d27('0x2f')],'name':_0x5767f7[_0x7d27('0x2e')][_0x7d27('0xc')]['value'],'phone':_0x5767f7[_0x7d27('0x2e')][_0x7d27('0x36')][_0x7d27('0x2f')]});}}else{logger[_0x7d27('0x26')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x7d27('0x38'),'input_type':_0x7d27('0x1f'),'response_type':_0x7d27('0x1f'),'rest_data':JSON[_0x7d27('0x20')]({'session':_0x13873b['id'],'module_name':'Contacts','name_value_list':[{'name':_0x7d27('0x39'),'value':_0x592576!==_0x7d27('0x3a')?_0x592576:util[_0x7d27('0x34')]('Caller\x20-\x20%s',_0x24c283)},{'name':_0x7d27('0x36'),'value':_0x24c283}]})}})[_0x7d27('0x2b')](function(_0x4eaa20){logger[_0x7d27('0x26')](_0x7d27('0x3b'));return BPromise[_0x7d27('0x30')]({'id':_0x4eaa20['id'],'name':_0x4eaa20['entry_list'][_0x7d27('0x39')][_0x7d27('0x2f')],'phone':_0x4eaa20[_0x7d27('0x2c')][_0x7d27('0x36')][_0x7d27('0x2f')]});});}});}function request(_0x1a15da){logger['debug'](_0x7d27('0x3c'),JSON['stringify'](_0x1a15da));return rp(_['merge'](def,_0x1a15da));}function getTags(_0x3a21d0,_0x8eeb8f){var _0x11d9c0=[];if(_0x3a21d0&&_0x3a21d0[_0x7d27('0x1a')]>0x0){_0x11d9c0=_['map'](_0x3a21d0,_0x8eeb8f);}return _0x11d9c0;}function getCustomFields(_0x24a0d6,_0x6ad95f){var _0x2c0d47=[];var _0xb38dfe={'custom_fields':[]};if(_0x24a0d6['length']>0x0){_[_0x7d27('0x1b')](_0x24a0d6,function(_0xa5eae4){if(_0xa5eae4[_0x7d27('0x3d')]===_0x7d27('0x3e')&&_0xa5eae4['nameField']&&!_0xa5eae4[_0x7d27('0x3f')]){_0xb38dfe[_0xa5eae4[_0x7d27('0x40')][_0x7d27('0x41')]()]=_0xa5eae4[_0x7d27('0x42')]['toString']();}else if(_0xa5eae4['type']===_0x7d27('0x3e')&&_0xa5eae4[_0x7d27('0x1d')]&&_0xa5eae4[_0x7d27('0x3f')]){_0xb38dfe[_0x7d27('0x43')][_0x7d27('0x1c')]({'id':_0xa5eae4[_0x7d27('0x1d')],'value':_0xa5eae4[_0x7d27('0x42')][_0x7d27('0x24')]()});}else if(_0xa5eae4[_0x7d27('0x3d')]===_0x7d27('0x44')&&_0xa5eae4[_0x7d27('0x1e')]&&_0xa5eae4['idField']&&_0xa5eae4[_0x7d27('0x3f')]){_0x6ad95f[_0xa5eae4[_0x7d27('0x1e')]]&&_0xb38dfe[_0x7d27('0x43')][_0x7d27('0x1c')]({'id':_0xa5eae4['idField'],'value':_0x6ad95f[_0xa5eae4[_0x7d27('0x1e')]]['toString']()});}else if(_0xa5eae4[_0x7d27('0x3d')]==='customVariable'&&_0xa5eae4[_0x7d27('0x45')]&&_0xa5eae4[_0x7d27('0x45')][_0x7d27('0xc')]&&_0xa5eae4[_0x7d27('0x1d')]&&_0xa5eae4[_0x7d27('0x3f')]){_0x6ad95f[_0xa5eae4[_0x7d27('0x45')][_0x7d27('0xc')]['toLowerCase']()]&&_0xb38dfe[_0x7d27('0x43')][_0x7d27('0x1c')]({'id':_0xa5eae4['idField'],'value':_0x6ad95f[_0xa5eae4[_0x7d27('0x45')][_0x7d27('0xc')][_0x7d27('0x41')]()][_0x7d27('0x24')]()});}});}return _0xb38dfe;}function getConnection(_0x577124){return request({'method':_0x7d27('0xa'),'form':{'method':'login','input_type':'JSON','response_type':_0x7d27('0x1f'),'rest_data':JSON[_0x7d27('0x20')]({'user_auth':{'user_name':_0x577124[_0x7d27('0x46')],'password':_0x577124[_0x7d27('0x47')],'encryption':_0x7d27('0x48')},'application':_0x7d27('0x49')})}})['then'](function(_0x5041d0){var _0x4dc6d=_0x5041d0;if(_0x4dc6d['id']){def['sessionID']=_0x4dc6d['id'];return BPromise[_0x7d27('0x30')](_0x4dc6d);}else{throw new Error(util[_0x7d27('0x34')](_0x7d27('0x4a'),_0x577124['id']));}});}function setRelationship(_0x2c31cc,_0x514a81,_0x4d171a,_0x475b02){return request({'form':{'method':_0x7d27('0x4b'),'input_type':_0x7d27('0x1f'),'response_type':_0x7d27('0x1f'),'rest_data':JSON[_0x7d27('0x20')]({'session':_0x2c31cc['id'],'module_name':_0x7d27('0x21'),'module_id':_0x4d171a['id'],'link_field_name':_0x475b02,'related_ids':[_0x514a81['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5337ea,_0x5d7a88,_0x74fe2e,_0x332eaa,_0x270189,_0x22c1a6){var _0x47e046,_0x236b53,_0x95e73e,_0x23a0ff;_0x22c1a6[_0x7d27('0x4c')]=intUtil[_0x7d27('0x4d')](_0x22c1a6[_0x7d27('0x4c')]);_0x22c1a6[_0x7d27('0x4e')]=intUtil['stripTrailingSlash'](_0x22c1a6[_0x7d27('0x4e')]);def[_0x7d27('0x4f')]=util[_0x7d27('0x34')]('%s/service/v4_1/rest.php',_0x22c1a6[_0x7d27('0x4c')]);if(_0x270189&&_0x270189[_0x7d27('0x50')]){logger[_0x7d27('0x26')](_0x7d27('0x51'),_0x7d27('0x52'));_0x5d7a88[_0x7d27('0x53')]=util[_0x7d27('0x34')](_0x7d27('0x54'),_0x22c1a6['serverUrl'],_0x5d7a88[_0x7d27('0x55')],md5(_0x5d7a88['uniqueid']));}else{_0x5d7a88['recordingURL']='';}return getConnection(_0x22c1a6)[_0x7d27('0x2b')](function(_0x679d32){_0x23a0ff=_0x679d32;return getUser(_0x22c1a6,_0x332eaa['name'],_0x23a0ff);})[_0x7d27('0x2b')](function(_0x52e284){_0x47e046=_0x52e284;logger[_0x7d27('0x26')](_0x7d27('0x56'),_0x47e046['id']);return getEndUser(_0x22c1a6,_0x5d7a88['calleridname'],_0x5d7a88[_0x7d27('0x57')],_0x23a0ff);})[_0x7d27('0x2b')](function(_0x1bf806){_0x236b53=_0x1bf806;logger[_0x7d27('0x26')](_0x7d27('0x58'),_0x236b53['id']);return getTicket(_0x22c1a6,_0x47e046,_0x236b53,_0x74fe2e,_0x5d7a88,_0x74fe2e[_0x7d27('0x59')],_0x23a0ff,_0x7d27('0x5a'));})[_0x7d27('0x2b')](function(_0x13c0f1){_0x95e73e=_0x13c0f1;logger['info'](_0x7d27('0x5b'));logger['info'](_0x7d27('0x5c'),_0x95e73e['id']);return setRelationship(_0x23a0ff,_0x47e046,_0x95e73e,_0x7d27('0x5d'));})[_0x7d27('0x2b')](function(){return setRelationship(_0x23a0ff,_0x236b53,_0x95e73e,_0x7d27('0x5e'));})[_0x7d27('0x2b')](function(){return getServerInfo(_0x23a0ff);})[_0x7d27('0x2b')](function(_0x146258){var _0x3da88b=parseInt(_0x146258['version'][_0x7d27('0x5f')](0x0));var _0x44fd23=util[_0x7d27('0x34')](_0x7d27('0x60'),_0x22c1a6[_0x7d27('0x4c')],_0x95e73e['id']);if(_0x3da88b>0x6){_0x44fd23=util[_0x7d27('0x34')](_0x7d27('0x61'),_0x22c1a6[_0x7d27('0x4c')],_0x95e73e['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7d27('0x34')]('user:%s',_0x332eaa[_0x7d27('0xc')]),_0x7d27('0x62'),{'uri':_0x44fd23});})[_0x7d27('0x63')](function(_0x3316d3){logger[_0x7d27('0x64')](_0x7d27('0x51'),JSON[_0x7d27('0x20')](_0x3316d3));});};exports[_0x7d27('0x65')]=function(_0x5a18a3,_0x2215c1,_0x436f7d,_0x39ee50,_0x4c5940,_0x149be9,_0x32ec4f){var _0xb3cdb7,_0x23ee48,_0x481bbd,_0x43d05b;_0x149be9[_0x7d27('0x4c')]=intUtil['stripTrailingSlash'](_0x149be9[_0x7d27('0x4c')]);_0x149be9[_0x7d27('0x4e')]=intUtil[_0x7d27('0x4d')](_0x149be9[_0x7d27('0x4e')]);def[_0x7d27('0x4f')]=util['format'](_0x7d27('0x66'),_0x149be9[_0x7d27('0x4c')]);if(_0x32ec4f&&_0x32ec4f[_0x7d27('0x67')]&&_0x32ec4f[_0x7d27('0x67')]!==_0x7d27('0x68')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2215c1['recordingURL']=util['format'](_0x7d27('0x54'),_0x149be9[_0x7d27('0x4e')],_0x2215c1[_0x7d27('0x55')],md5(_0x2215c1[_0x7d27('0x55')]));}return getConnection(_0x149be9)[_0x7d27('0x2b')](function(_0x57021f){_0x43d05b=_0x57021f;return getUser(_0x149be9,_0x39ee50['name'],_0x43d05b);})[_0x7d27('0x2b')](function(_0x150413){_0xb3cdb7=_0x150413;logger[_0x7d27('0x26')]('The\x20User\x20ID\x20is:',_0xb3cdb7['id']);return getEndUser(_0x149be9,_0x2215c1[_0x7d27('0x69')],_0x2215c1[_0x7d27('0x6a')],_0x43d05b);})[_0x7d27('0x2b')](function(_0x391859){_0x23ee48=_0x391859;logger[_0x7d27('0x26')]('The\x20Enduser\x20ID\x20is:',_0x23ee48['id']);return getTicket(_0x149be9,_0xb3cdb7,_0x23ee48,_0x436f7d,_0x2215c1,_0x436f7d[_0x7d27('0x59')],_0x43d05b,_0x7d27('0x6b'));})[_0x7d27('0x2b')](function(_0x4f7c81){_0x481bbd=_0x4f7c81;logger[_0x7d27('0x26')](_0x7d27('0x5b'));logger['info'](_0x7d27('0x5c'),_0x481bbd['id']);return setRelationship(_0x43d05b,_0xb3cdb7,_0x481bbd,_0x7d27('0x5d'));})[_0x7d27('0x2b')](function(){return setRelationship(_0x43d05b,_0x23ee48,_0x481bbd,'contacts');})[_0x7d27('0x2b')](function(){return getServerInfo(_0x43d05b);})[_0x7d27('0x2b')](function(_0x14d9a9){var _0x52e53f=parseInt(_0x14d9a9[_0x7d27('0x6c')][_0x7d27('0x5f')](0x0));var _0x4c2719=util[_0x7d27('0x34')](_0x7d27('0x60'),_0x149be9[_0x7d27('0x4c')],_0x481bbd['id']);if(_0x52e53f>0x6){_0x4c2719=util[_0x7d27('0x34')](_0x7d27('0x61'),_0x149be9[_0x7d27('0x4c')],_0x481bbd['id']);}logger['info']('[OUTBOUND]',_0x7d27('0x6d'));emit(util['format'](_0x7d27('0x6e'),_0x39ee50[_0x7d27('0xc')]),'trigger:browser:url',{'uri':_0x4c2719});})[_0x7d27('0x63')](function(_0xac9c31){logger[_0x7d27('0x64')]('[OUTBOUND]',JSON[_0x7d27('0x20')](_0xac9c31));});};exports[_0x7d27('0x6f')]=function(_0x59184f,_0xf898b1,_0x34efa2,_0x506e64,_0x5bcdc0,_0x3f8081){var _0x1b1481,_0x37c659,_0x1df4f8,_0x5392ed;_0x3f8081[_0x7d27('0x4c')]=intUtil[_0x7d27('0x4d')](_0x3f8081[_0x7d27('0x4c')]);_0x3f8081[_0x7d27('0x4e')]=intUtil['stripTrailingSlash'](_0x3f8081[_0x7d27('0x4e')]);def['uri']=util[_0x7d27('0x34')](_0x7d27('0x66'),_0x3f8081[_0x7d27('0x4c')]);if(_0x5bcdc0&&_0x5bcdc0[_0x7d27('0x50')]){logger[_0x7d27('0x26')]('['+_0xf898b1['lastevent'][_0x7d27('0x70')]()+']','Recording\x20is\x20enabled!');_0xf898b1[_0x7d27('0x53')]=util['format'](_0x7d27('0x54'),_0x3f8081[_0x7d27('0x4e')],_0xf898b1[_0x7d27('0x55')],md5(_0xf898b1[_0x7d27('0x55')]));}else{_0xf898b1[_0x7d27('0x53')]='';}return getConnection(_0x3f8081)[_0x7d27('0x2b')](function(_0x3a6b3e){_0x5392ed=_0x3a6b3e;if(!_['isNil'](_0x506e64)){return getUser(_0x3f8081,_0x506e64[_0x7d27('0xc')],_0x5392ed);}else{return getUser(_0x3f8081,null,_0x5392ed);}})[_0x7d27('0x2b')](function(_0x538f55){_0x1b1481=_0x538f55;logger[_0x7d27('0x26')](_0x7d27('0x56'),_0x1b1481['id']);return getEndUser(_0x3f8081,_0xf898b1[_0x7d27('0x71')],_0xf898b1['calleridnum'],_0x5392ed);})[_0x7d27('0x2b')](function(_0x2d5e50){_0x37c659=_0x2d5e50;logger[_0x7d27('0x26')](_0x7d27('0x58'),_0x37c659['id']);return getTicket(_0x3f8081,_0x1b1481,_0x37c659,_0x34efa2,_0xf898b1,_0x34efa2[_0x7d27('0x59')],_0x5392ed,_0x7d27('0x5a'));})['then'](function(_0x52275a){_0x1df4f8=_0x52275a;logger['info'](_0x7d27('0x5b'));logger['info'](_0x7d27('0x5c'),_0x1df4f8['id']);return setRelationship(_0x5392ed,_0x1b1481,_0x1df4f8,_0x7d27('0x5d'));})[_0x7d27('0x2b')](function(){return setRelationship(_0x5392ed,_0x37c659,_0x1df4f8,_0x7d27('0x5e'));})[_0x7d27('0x2b')](function(){return getServerInfo(_0x5392ed);})[_0x7d27('0x63')](function(_0x5cfa5e){logger[_0x7d27('0x64')]('['+_0xf898b1[_0x7d27('0x72')][_0x7d27('0x70')]()+']',JSON[_0x7d27('0x20')](_0x5cfa5e));});}; \ No newline at end of file +var _0x4e24=['Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','toString','customField','custom_fields','variable','customVariable','Variable','push','login','username','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','error','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x4e24,0x1aa));var _0x44e2=function(_0x3860e8,_0x1a94ea){_0x3860e8=_0x3860e8-0x0;var _0x4b00d6=_0x4e24[_0x3860e8];return _0x4b00d6;};'use strict';var _=require(_0x44e2('0x0'));var rp=require(_0x44e2('0x1'));var BPromise=require('bluebird');var md5=require(_0x44e2('0x2'));var util=require(_0x44e2('0x3'));var Redis=require(_0x44e2('0x4'));var intUtil=require('./util');var config=require(_0x44e2('0x5'));var logger=require(_0x44e2('0x6'))(_0x44e2('0x7'));config[_0x44e2('0x8')]=_['defaults'](config['redis'],{'host':_0x44e2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x44e2('0x8')]));var def={'method':_0x44e2('0xa'),'json':!![]};function emit(_0x56df22,_0x4cfa55,_0x305cdc){io['to'](_0x56df22)[_0x44e2('0xb')](_0x4cfa55,_0x305cdc);}function getTicket(_0x1261f5,_0x56685a,_0x31a1b6,_0x4cdd24,_0x2c8ec3,_0x4b58a2,_0x1441d2,_0x19b6f5){logger[_0x44e2('0xc')](_0x44e2('0xd'));var _0x32d10a=new Date();var _0x14de57=[{'name':_0x44e2('0xe'),'value':intUtil[_0x44e2('0xf')](_0x4cdd24[_0x44e2('0x10')],_0x2c8ec3,'\x20')},{'name':_0x44e2('0x11'),'value':_0x56685a['id']},{'name':_0x44e2('0x12'),'value':_0x56685a['id']},{'name':_0x44e2('0x13'),'value':intUtil[_0x44e2('0xf')](_0x4cdd24['Descriptions'],_0x2c8ec3,'\x0a')},{'name':_0x44e2('0x14'),'value':_0x32d10a[_0x44e2('0x15')]()[_0x44e2('0x16')](0x0,0x13)[_0x44e2('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x44e2('0x18'),'value':'15'},{'name':_0x44e2('0x19'),'value':_0x31a1b6['id']},{'name':_0x44e2('0x1a'),'value':_0x44e2('0x1b')},{'name':_0x44e2('0x1c'),'value':_0x31a1b6[_0x44e2('0xe')]},{'name':'direction','value':_0x19b6f5}];if(_0x4b58a2[_0x44e2('0x1d')]){_[_0x44e2('0x1e')](_0x4b58a2,function(_0x921a17){if(_0x2c8ec3[_0x921a17['variableName']]){_0x14de57['push']({'name':_0x921a17[_0x44e2('0x1f')],'value':_0x2c8ec3[_0x921a17[_0x44e2('0x20')]]});}});}return request({'form':{'method':_0x44e2('0x21'),'input_type':'JSON','response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'session':_0x1441d2['id'],'module_name':_0x44e2('0x24'),'name_value_list':_0x14de57})}});}function getAuth(_0x1ca900){return util[_0x44e2('0x25')](_0x44e2('0x26'),new Buffer(_0x1ca900['apiKey']+':X')['toString'](_0x44e2('0x27')));}function getServerInfo(_0x7dbf52){return request({'form':{'method':_0x44e2('0x28'),'input_type':'JSON','response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'session':_0x7dbf52['id']})}});}function getUser(_0x349e98,_0x218b86,_0x100d54){if(!_[_0x44e2('0x29')](_0x218b86)){logger[_0x44e2('0xc')](_0x44e2('0x2a'),_0x218b86);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'session':_0x100d54['id'],'module_name':'Employees','query':util[_0x44e2('0x25')](_0x44e2('0x2b'),_0x218b86),'order_by':'','offset':'0','select_fields':['id',_0x44e2('0xe'),_0x44e2('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x44e2('0x2d')](function(_0x36ce8a){if(_0x36ce8a[_0x44e2('0x2e')]['length']){var _0x12e7ef=_[_0x44e2('0x2f')](_0x36ce8a[_0x44e2('0x2e')],function(_0xdd1d47){return _0xdd1d47[_0x44e2('0x30')][_0x44e2('0x2c')][_0x44e2('0x31')]===_0x218b86;});if(_0x12e7ef){logger[_0x44e2('0xc')](_0x44e2('0x32'));return BPromise[_0x44e2('0x33')]({'id':_0x12e7ef[_0x44e2('0x30')]['id']['value'],'name':_0x12e7ef[_0x44e2('0x30')][_0x44e2('0xe')][_0x44e2('0x31')]});}}logger[_0x44e2('0xc')](_0x44e2('0x34'));return BPromise[_0x44e2('0x33')]({'id':_0x100d54[_0x44e2('0x30')][_0x44e2('0x35')][_0x44e2('0x31')],'name':_0x100d54[_0x44e2('0x30')][_0x44e2('0x2c')][_0x44e2('0x31')]});});}else{logger[_0x44e2('0xc')](_0x44e2('0x36'));return BPromise['resolve']({'id':_0x100d54[_0x44e2('0x30')][_0x44e2('0x35')][_0x44e2('0x31')],'name':_0x100d54[_0x44e2('0x30')][_0x44e2('0x2c')][_0x44e2('0x31')]});}}function getEndUser(_0x5d138d,_0x2d0bfc,_0x5daf77,_0x573dd5){logger[_0x44e2('0xc')](_0x44e2('0x37'),_0x5daf77);return request({'form':{'method':_0x44e2('0x38'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x573dd5['id'],'module_name':_0x44e2('0x1b'),'query':util['format'](_0x44e2('0x39'),_0x5daf77),'order_by':'','offset':'0','select_fields':['id',_0x44e2('0xe'),_0x44e2('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x44e2('0x2d')](function(_0x575e8d){if(_0x575e8d[_0x44e2('0x2e')]['length']){var _0x3002ce=_['find'](_0x575e8d[_0x44e2('0x2e')],function(_0x4478f9){return _0x4478f9[_0x44e2('0x30')][_0x44e2('0x3a')][_0x44e2('0x31')]===_0x5daf77;});if(_0x3002ce){logger['info']('Enduser\x20found!');return BPromise[_0x44e2('0x33')]({'id':_0x3002ce[_0x44e2('0x30')]['id'][_0x44e2('0x31')],'name':_0x3002ce['name_value_list']['name']['value'],'phone':_0x3002ce[_0x44e2('0x30')]['phone_home'][_0x44e2('0x31')]});}}else{logger[_0x44e2('0xc')](_0x44e2('0x3b'));return request({'form':{'method':_0x44e2('0x21'),'input_type':_0x44e2('0x22'),'response_type':'JSON','rest_data':JSON[_0x44e2('0x23')]({'session':_0x573dd5['id'],'module_name':_0x44e2('0x1b'),'name_value_list':[{'name':_0x44e2('0x3c'),'value':_0x2d0bfc!==_0x44e2('0x3d')?_0x2d0bfc:util[_0x44e2('0x25')]('Caller\x20-\x20%s',_0x5daf77)},{'name':_0x44e2('0x3a'),'value':_0x5daf77}]})}})[_0x44e2('0x2d')](function(_0x219ccf){logger[_0x44e2('0xc')](_0x44e2('0x3e'));return BPromise[_0x44e2('0x33')]({'id':_0x219ccf['id'],'name':_0x219ccf[_0x44e2('0x2e')][_0x44e2('0x3c')][_0x44e2('0x31')],'phone':_0x219ccf[_0x44e2('0x2e')]['phone_home']['value']});});}});}function request(_0x28bc20){logger['debug'](_0x44e2('0x3f'),JSON[_0x44e2('0x23')](_0x28bc20));return rp(_[_0x44e2('0x40')](def,_0x28bc20));}function getTags(_0xdac1eb,_0x3b16e5){var _0x450023=[];if(_0xdac1eb&&_0xdac1eb[_0x44e2('0x1d')]>0x0){_0x450023=_[_0x44e2('0x41')](_0xdac1eb,_0x3b16e5);}return _0x450023;}function getCustomFields(_0x2d1802,_0x57cf3d){var _0x250726=[];var _0xc9afe9={'custom_fields':[]};if(_0x2d1802[_0x44e2('0x1d')]>0x0){_[_0x44e2('0x1e')](_0x2d1802,function(_0x208153){if(_0x208153[_0x44e2('0x42')]===_0x44e2('0x43')&&_0x208153[_0x44e2('0x44')]&&!_0x208153['customField']){_0xc9afe9[_0x208153[_0x44e2('0x44')][_0x44e2('0x45')]()]=_0x208153[_0x44e2('0x46')][_0x44e2('0x47')]();}else if(_0x208153['type']==='string'&&_0x208153[_0x44e2('0x1f')]&&_0x208153[_0x44e2('0x48')]){_0xc9afe9[_0x44e2('0x49')]['push']({'id':_0x208153[_0x44e2('0x1f')],'value':_0x208153[_0x44e2('0x46')][_0x44e2('0x47')]()});}else if(_0x208153[_0x44e2('0x42')]===_0x44e2('0x4a')&&_0x208153[_0x44e2('0x20')]&&_0x208153[_0x44e2('0x1f')]&&_0x208153[_0x44e2('0x48')]){_0x57cf3d[_0x208153[_0x44e2('0x20')]]&&_0xc9afe9[_0x44e2('0x49')]['push']({'id':_0x208153['idField'],'value':_0x57cf3d[_0x208153['variableName']][_0x44e2('0x47')]()});}else if(_0x208153[_0x44e2('0x42')]===_0x44e2('0x4b')&&_0x208153[_0x44e2('0x4c')]&&_0x208153[_0x44e2('0x4c')][_0x44e2('0xe')]&&_0x208153[_0x44e2('0x1f')]&&_0x208153['customField']){_0x57cf3d[_0x208153['Variable'][_0x44e2('0xe')]['toLowerCase']()]&&_0xc9afe9['custom_fields'][_0x44e2('0x4d')]({'id':_0x208153['idField'],'value':_0x57cf3d[_0x208153[_0x44e2('0x4c')][_0x44e2('0xe')]['toLowerCase']()]['toString']()});}});}return _0xc9afe9;}function getConnection(_0x56c2cc){return request({'method':_0x44e2('0xa'),'form':{'method':_0x44e2('0x4e'),'input_type':_0x44e2('0x22'),'response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'user_auth':{'user_name':_0x56c2cc[_0x44e2('0x4f')],'password':_0x56c2cc['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x44e2('0x2d')](function(_0x3473df){var _0x210da8=_0x3473df;if(_0x210da8['id']){def[_0x44e2('0x50')]=_0x210da8['id'];return BPromise[_0x44e2('0x33')](_0x210da8);}else{throw new Error(util[_0x44e2('0x25')](_0x44e2('0x51'),_0x56c2cc['id']));}});}function setRelationship(_0x375032,_0x197807,_0x4ddf5d,_0x79f815){return request({'form':{'method':_0x44e2('0x52'),'input_type':_0x44e2('0x22'),'response_type':_0x44e2('0x22'),'rest_data':JSON['stringify']({'session':_0x375032['id'],'module_name':_0x44e2('0x24'),'module_id':_0x4ddf5d['id'],'link_field_name':_0x79f815,'related_ids':[_0x197807['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3dce7e,_0x55d247,_0xaacc0a,_0x4e3366,_0x4ea866,_0x2c2097){var _0x14942d,_0x1be24d,_0x4c9960,_0x3c3fe5;_0x2c2097[_0x44e2('0x53')]=intUtil[_0x44e2('0x54')](_0x2c2097[_0x44e2('0x53')]);_0x2c2097[_0x44e2('0x55')]=intUtil['stripTrailingSlash'](_0x2c2097[_0x44e2('0x55')]);def[_0x44e2('0x56')]=util[_0x44e2('0x25')](_0x44e2('0x57'),_0x2c2097[_0x44e2('0x53')]);if(_0x4ea866&&_0x4ea866[_0x44e2('0x58')]){logger['info'](_0x44e2('0x59'),_0x44e2('0x5a'));_0x55d247[_0x44e2('0x5b')]=util['format'](_0x44e2('0x5c'),_0x2c2097[_0x44e2('0x55')],_0x55d247[_0x44e2('0x5d')],md5(_0x55d247[_0x44e2('0x5d')]));}else{_0x55d247[_0x44e2('0x5b')]='';}return getConnection(_0x2c2097)['then'](function(_0x3b2c20){_0x3c3fe5=_0x3b2c20;return getUser(_0x2c2097,_0x4e3366[_0x44e2('0xe')],_0x3c3fe5);})['then'](function(_0x4a15f4){_0x14942d=_0x4a15f4;logger[_0x44e2('0xc')](_0x44e2('0x5e'),_0x14942d['id']);return getEndUser(_0x2c2097,_0x55d247[_0x44e2('0x5f')],_0x55d247[_0x44e2('0x60')],_0x3c3fe5);})[_0x44e2('0x2d')](function(_0xdfc4d0){_0x1be24d=_0xdfc4d0;logger[_0x44e2('0xc')](_0x44e2('0x61'),_0x1be24d['id']);return getTicket(_0x2c2097,_0x14942d,_0x1be24d,_0xaacc0a,_0x55d247,_0xaacc0a[_0x44e2('0x62')],_0x3c3fe5,_0x44e2('0x63'));})[_0x44e2('0x2d')](function(_0x1840d5){_0x4c9960=_0x1840d5;logger['info'](_0x44e2('0x64'));logger[_0x44e2('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4c9960['id']);return setRelationship(_0x3c3fe5,_0x14942d,_0x4c9960,_0x44e2('0x65'));})[_0x44e2('0x2d')](function(){return setRelationship(_0x3c3fe5,_0x1be24d,_0x4c9960,'contacts');})[_0x44e2('0x2d')](function(){return getServerInfo(_0x3c3fe5);})[_0x44e2('0x2d')](function(_0x97fe01){var _0x4cd0e8=parseInt(_0x97fe01[_0x44e2('0x66')][_0x44e2('0x67')](0x0));var _0x28ccd3=util['format'](_0x44e2('0x68'),_0x2c2097[_0x44e2('0x53')],_0x4c9960['id']);if(_0x4cd0e8>0x6){_0x28ccd3=util[_0x44e2('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2c2097[_0x44e2('0x53')],_0x4c9960['id']);}logger[_0x44e2('0xc')](_0x44e2('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x44e2('0x25')](_0x44e2('0x69'),_0x4e3366['name']),'trigger:browser:url',{'uri':_0x28ccd3});})['catch'](function(_0x2c2302){logger[_0x44e2('0x6a')](_0x44e2('0x59'),JSON[_0x44e2('0x23')](_0x2c2302));});};exports['outbound']=function(_0x361e39,_0x4bb3ba,_0x4ee131,_0x46e735,_0x5d6399,_0x7bfc4e,_0x93b1cc){var _0xcc5688,_0xbc8d56,_0x1ef1df,_0x32dbad;_0x7bfc4e[_0x44e2('0x53')]=intUtil[_0x44e2('0x54')](_0x7bfc4e['remoteUri']);_0x7bfc4e[_0x44e2('0x55')]=intUtil[_0x44e2('0x54')](_0x7bfc4e[_0x44e2('0x55')]);def['uri']=util['format'](_0x44e2('0x57'),_0x7bfc4e[_0x44e2('0x53')]);if(_0x93b1cc&&_0x93b1cc['recordingFormat']&&_0x93b1cc[_0x44e2('0x6b')]!==_0x44e2('0x6c')){logger[_0x44e2('0xc')](_0x44e2('0x6d'),_0x44e2('0x5a'));_0x4bb3ba[_0x44e2('0x5b')]=util[_0x44e2('0x25')](_0x44e2('0x5c'),_0x7bfc4e[_0x44e2('0x55')],_0x4bb3ba[_0x44e2('0x5d')],md5(_0x4bb3ba['uniqueid']));}return getConnection(_0x7bfc4e)['then'](function(_0x382e6f){_0x32dbad=_0x382e6f;return getUser(_0x7bfc4e,_0x46e735[_0x44e2('0xe')],_0x32dbad);})[_0x44e2('0x2d')](function(_0x1c07a2){_0xcc5688=_0x1c07a2;logger[_0x44e2('0xc')](_0x44e2('0x5e'),_0xcc5688['id']);return getEndUser(_0x7bfc4e,_0x4bb3ba[_0x44e2('0x6e')],_0x4bb3ba['destcalleridnum'],_0x32dbad);})[_0x44e2('0x2d')](function(_0x4b4352){_0xbc8d56=_0x4b4352;logger[_0x44e2('0xc')](_0x44e2('0x61'),_0xbc8d56['id']);return getTicket(_0x7bfc4e,_0xcc5688,_0xbc8d56,_0x4ee131,_0x4bb3ba,_0x4ee131[_0x44e2('0x62')],_0x32dbad,_0x44e2('0x6f'));})[_0x44e2('0x2d')](function(_0x4e3c42){_0x1ef1df=_0x4e3c42;logger[_0x44e2('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x1ef1df['id']);return setRelationship(_0x32dbad,_0xcc5688,_0x1ef1df,_0x44e2('0x65'));})['then'](function(){return setRelationship(_0x32dbad,_0xbc8d56,_0x1ef1df,_0x44e2('0x70'));})[_0x44e2('0x2d')](function(){return getServerInfo(_0x32dbad);})[_0x44e2('0x2d')](function(_0x4dd718){var _0x13567b=parseInt(_0x4dd718[_0x44e2('0x66')][_0x44e2('0x67')](0x0));var _0x315ab4=util[_0x44e2('0x25')](_0x44e2('0x68'),_0x7bfc4e[_0x44e2('0x53')],_0x1ef1df['id']);if(_0x13567b>0x6){_0x315ab4=util[_0x44e2('0x25')](_0x44e2('0x71'),_0x7bfc4e[_0x44e2('0x53')],_0x1ef1df['id']);}logger[_0x44e2('0xc')](_0x44e2('0x6d'),_0x44e2('0x72'));emit(util['format'](_0x44e2('0x69'),_0x46e735['name']),_0x44e2('0x73'),{'uri':_0x315ab4});})[_0x44e2('0x74')](function(_0x3b80c3){logger[_0x44e2('0x6a')](_0x44e2('0x6d'),JSON['stringify'](_0x3b80c3));});};exports[_0x44e2('0x75')]=function(_0x280780,_0x3e9f46,_0x4e6701,_0x4504aa,_0x1f441b,_0x4af507){var _0x3daaa4,_0x52d2bb,_0x20f779,_0x2a77ca;_0x4af507['remoteUri']=intUtil[_0x44e2('0x54')](_0x4af507[_0x44e2('0x53')]);_0x4af507['serverUrl']=intUtil['stripTrailingSlash'](_0x4af507['serverUrl']);def[_0x44e2('0x56')]=util['format'](_0x44e2('0x57'),_0x4af507['remoteUri']);if(_0x1f441b&&_0x1f441b['monitor_format']){logger[_0x44e2('0xc')]('['+_0x3e9f46[_0x44e2('0x76')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x3e9f46[_0x44e2('0x5b')]=util[_0x44e2('0x25')](_0x44e2('0x5c'),_0x4af507[_0x44e2('0x55')],_0x3e9f46['uniqueid'],md5(_0x3e9f46['uniqueid']));}else{_0x3e9f46[_0x44e2('0x5b')]='';}return getConnection(_0x4af507)[_0x44e2('0x2d')](function(_0x4fa51b){_0x2a77ca=_0x4fa51b;if(!_[_0x44e2('0x29')](_0x4504aa)){return getUser(_0x4af507,_0x4504aa[_0x44e2('0xe')],_0x2a77ca);}else{return getUser(_0x4af507,null,_0x2a77ca);}})[_0x44e2('0x2d')](function(_0x18744b){_0x3daaa4=_0x18744b;logger[_0x44e2('0xc')](_0x44e2('0x5e'),_0x3daaa4['id']);return getEndUser(_0x4af507,_0x3e9f46[_0x44e2('0x5f')],_0x3e9f46[_0x44e2('0x60')],_0x2a77ca);})[_0x44e2('0x2d')](function(_0x4e2135){_0x52d2bb=_0x4e2135;logger[_0x44e2('0xc')](_0x44e2('0x61'),_0x52d2bb['id']);return getTicket(_0x4af507,_0x3daaa4,_0x52d2bb,_0x4e6701,_0x3e9f46,_0x4e6701[_0x44e2('0x62')],_0x2a77ca,_0x44e2('0x63'));})[_0x44e2('0x2d')](function(_0x1af0ad){_0x20f779=_0x1af0ad;logger[_0x44e2('0xc')](_0x44e2('0x64'));logger[_0x44e2('0xc')]('The\x20Ticket\x20ID\x20is:',_0x20f779['id']);return setRelationship(_0x2a77ca,_0x3daaa4,_0x20f779,_0x44e2('0x65'));})[_0x44e2('0x2d')](function(){return setRelationship(_0x2a77ca,_0x52d2bb,_0x20f779,'contacts');})['then'](function(){return getServerInfo(_0x2a77ca);})[_0x44e2('0x74')](function(_0xd8e961){logger['error']('['+_0x3e9f46[_0x44e2('0x76')][_0x44e2('0x77')]()+']',JSON['stringify'](_0xd8e961));});}; \ 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 c701580..d146204 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 _0x3f4f=['variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','getString','length','type','string','push','variable'];(function(_0x2d3ce8,_0x3524ba){var _0x579bc4=function(_0x1aeea7){while(--_0x1aeea7){_0x2d3ce8['push'](_0x2d3ce8['shift']());}};_0x579bc4(++_0x3524ba);}(_0x3f4f,0xd9));var _0xf3f4=function(_0x412ac0,_0x1330ae){_0x412ac0=_0x412ac0-0x0;var _0x5391a1=_0x3f4f[_0x412ac0];return _0x5391a1;};'use strict';var _=require(_0xf3f4('0x0'));var util=require(_0xf3f4('0x1'));exports[_0xf3f4('0x2')]=function(_0x42a4bb,_0x510910,_0x2d92c5){var _0x51210b=[];if(_0x42a4bb['length']>0x0){var _0x377fd8=_['sortBy'](_0x42a4bb,['id']);for(var _0x2b37fc=0x0;_0x2b37fc<_0x377fd8[_0xf3f4('0x3')];_0x2b37fc++){var _0x266636=_0x377fd8[_0x2b37fc];if(_0x266636[_0xf3f4('0x4')]===_0xf3f4('0x5')){_0x51210b[_0xf3f4('0x6')](_0x266636['content']);}else if(_0x266636[_0xf3f4('0x4')]===_0xf3f4('0x7')&&_0x266636['variableName']){_0x510910[_0x266636[_0xf3f4('0x8')]]&&_0x51210b['push'](_0x510910[_0x266636[_0xf3f4('0x8')]][_0xf3f4('0x9')]());}else if(_0x266636[_0xf3f4('0x4')]===_0xf3f4('0xa')&&_0x266636[_0xf3f4('0xb')]&&_0x266636[_0xf3f4('0xb')][_0xf3f4('0xc')]){_0x510910[_0x266636['Variable'][_0xf3f4('0xc')][_0xf3f4('0xd')]()]&&_0x51210b[_0xf3f4('0x6')](_0x510910[_0x266636[_0xf3f4('0xb')][_0xf3f4('0xc')]['toLowerCase']()]['toString']());}else if(_0x266636['type']===_0xf3f4('0xe')){if(_0x266636[_0xf3f4('0xf')]===_0xf3f4('0x5')&&_0x266636[_0xf3f4('0x10')]){_0x51210b[_0xf3f4('0x6')](util[_0xf3f4('0x11')]('%s:\x20%s',_0x266636[_0xf3f4('0x10')],_0x266636['keyContent']));}else if(_0x266636[_0xf3f4('0xf')]==='variable'&&_0x266636[_0xf3f4('0x8')]&&_0x266636[_0xf3f4('0x10')]){_0x510910[_0x266636[_0xf3f4('0x8')]]&&_0x51210b['push'](util[_0xf3f4('0x11')](_0xf3f4('0x12'),_0x266636[_0xf3f4('0x10')],_0x510910[_0x266636[_0xf3f4('0x8')]]));}else if(_0x266636[_0xf3f4('0xf')]===_0xf3f4('0xa')&&_0x266636[_0xf3f4('0xb')]&&_0x266636[_0xf3f4('0xb')][_0xf3f4('0xc')]&&_0x266636[_0xf3f4('0x10')]){_0x510910[_0x266636[_0xf3f4('0xb')][_0xf3f4('0xc')][_0xf3f4('0xd')]()]&&_0x51210b[_0xf3f4('0x6')](util[_0xf3f4('0x11')]('%s:\x20%s',_0x266636['key'],_0x510910[_0x266636['Variable']['name'][_0xf3f4('0xd')]()]));}}}}return _0x51210b['join'](_0x2d92c5);};exports[_0xf3f4('0x13')]=function(_0x1a7147){var _0x432668=_0x1a7147[_0xf3f4('0x14')](-0x1);if(_0x432668==='/'){_0x1a7147=_0x1a7147[_0xf3f4('0x15')](0x0,_0x1a7147['lastIndexOf'](_0x432668));}return _0x1a7147;};exports[_0xf3f4('0x16')]=function(_0x31d1fa){if(!_[_0xf3f4('0x17')](_0x31d1fa)&&_0x31d1fa!==''){var _0x35caaa=/^(([^<>()\[\]\\.,;:\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 _0x35caaa[_0xf3f4('0x18')](String(_0x31d1fa)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x4aa0=['customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','string','push','content','variable','variableName','toString','type'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x4aa0,0x1af));var _0x04aa=function(_0xe45207,_0x28620d){_0xe45207=_0xe45207-0x0;var _0x1fab1c=_0x4aa0[_0xe45207];return _0x1fab1c;};'use strict';var _=require(_0x04aa('0x0'));var util=require(_0x04aa('0x1'));exports[_0x04aa('0x2')]=function(_0x1afd54,_0x32c5e4,_0x1f359b){var _0x236bb0=[];if(_0x1afd54[_0x04aa('0x3')]>0x0){var _0x4ffbad=_['sortBy'](_0x1afd54,['id']);for(var _0x353462=0x0;_0x353462<_0x4ffbad['length'];_0x353462++){var _0x4fe172=_0x4ffbad[_0x353462];if(_0x4fe172['type']===_0x04aa('0x4')){_0x236bb0[_0x04aa('0x5')](_0x4fe172[_0x04aa('0x6')]);}else if(_0x4fe172['type']===_0x04aa('0x7')&&_0x4fe172[_0x04aa('0x8')]){_0x32c5e4[_0x4fe172[_0x04aa('0x8')]]&&_0x236bb0[_0x04aa('0x5')](_0x32c5e4[_0x4fe172[_0x04aa('0x8')]][_0x04aa('0x9')]());}else if(_0x4fe172[_0x04aa('0xa')]===_0x04aa('0xb')&&_0x4fe172[_0x04aa('0xc')]&&_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')]){_0x32c5e4[_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')][_0x04aa('0xe')]()]&&_0x236bb0[_0x04aa('0x5')](_0x32c5e4[_0x4fe172['Variable'][_0x04aa('0xd')]['toLowerCase']()][_0x04aa('0x9')]());}else if(_0x4fe172[_0x04aa('0xa')]===_0x04aa('0xf')){if(_0x4fe172[_0x04aa('0x10')]===_0x04aa('0x4')&&_0x4fe172[_0x04aa('0x11')]){_0x236bb0[_0x04aa('0x5')](util[_0x04aa('0x12')](_0x04aa('0x13'),_0x4fe172[_0x04aa('0x11')],_0x4fe172[_0x04aa('0x14')]));}else if(_0x4fe172['keyType']==='variable'&&_0x4fe172['variableName']&&_0x4fe172['key']){_0x32c5e4[_0x4fe172['variableName']]&&_0x236bb0['push'](util[_0x04aa('0x12')](_0x04aa('0x13'),_0x4fe172[_0x04aa('0x11')],_0x32c5e4[_0x4fe172['variableName']]));}else if(_0x4fe172[_0x04aa('0x10')]==='customVariable'&&_0x4fe172[_0x04aa('0xc')]&&_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')]&&_0x4fe172[_0x04aa('0x11')]){_0x32c5e4[_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')][_0x04aa('0xe')]()]&&_0x236bb0[_0x04aa('0x5')](util[_0x04aa('0x12')](_0x04aa('0x13'),_0x4fe172[_0x04aa('0x11')],_0x32c5e4[_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')][_0x04aa('0xe')]()]));}}}}return _0x236bb0['join'](_0x1f359b);};exports[_0x04aa('0x15')]=function(_0x50ffa3){var _0x24e624=_0x50ffa3['slice'](-0x1);if(_0x24e624==='/'){_0x50ffa3=_0x50ffa3[_0x04aa('0x16')](0x0,_0x50ffa3[_0x04aa('0x17')](_0x24e624));}return _0x50ffa3;};exports[_0x04aa('0x18')]=function(_0x52739b){if(!_[_0x04aa('0x19')](_0x52739b)&&_0x52739b!==''){var _0x2317d0=/^(([^<>()\[\]\\.,;:\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 _0x2317d0['test'](String(_0x52739b)[_0x04aa('0xe')]());}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 ef48fe8..feb7d97 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xe706,0xa3));var _0x6e70=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0xe706[_0x1ac6e5];return _0x5877dc;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _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(_0x427a55,_0x18822c){var _0x581ca4=function(_0xdf9020){while(--_0xdf9020){_0x427a55['push'](_0x427a55['shift']());}};_0x581ca4(++_0x18822c);}(_0x34e8,0x12c));var _0x834e=function(_0x318ebb,_0x2d433f){_0x318ebb=_0x318ebb-0x0;var _0x801b87=_0x34e8[_0x318ebb];return _0x801b87;};'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 ca84c0a..e659c3c 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 _0x4b33=['Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','includes','string','picklist','type','nameField','content','toString','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','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:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','replace','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','lastevent','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','then','info','Ticket\x20created!','ticket','validateEmail','format','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','%s/search.json','length','filter','end-user'];(function(_0x58a22f,_0x22721e){var _0x239b0e=function(_0x12b39b){while(--_0x12b39b){_0x58a22f['push'](_0x58a22f['shift']());}};_0x239b0e(++_0x22721e);}(_0x4b33,0x188));var _0x34b3=function(_0x419214,_0xfece04){_0x419214=_0x419214-0x0;var _0x470fa7=_0x4b33[_0x419214];return _0x470fa7;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x34b3('0x0'));var util=require(_0x34b3('0x1'));var Redis=require(_0x34b3('0x2'));var intUtil=require(_0x34b3('0x3'));var config=require('../../../../config/environment');var logger=require(_0x34b3('0x4'))('zendesk');config[_0x34b3('0x5')]=_[_0x34b3('0x6')](config[_0x34b3('0x5')],{'host':_0x34b3('0x7'),'port':0x18eb});var io=require(_0x34b3('0x8'))(new Redis(config['redis']));function emit(_0x137ccb,_0x195a3a,_0x3c19b4){io['to'](_0x137ccb)['emit'](_0x195a3a,_0x3c19b4);}var headers={'Content-Type':'application/json','Accept':_0x34b3('0x9')};function getTicket(_0x1b0fc7,_0x34fd90,_0x4a2cc8,_0x26f675,_0x521389){logger['info'](_0x34b3('0xa'));return request({'uri':util['format'](_0x34b3('0xb'),_0x1b0fc7[_0x34b3('0xc')]),'method':_0x34b3('0xd'),'body':{'ticket':_[_0x34b3('0xe')]({'requester_id':_0x4a2cc8['id'],'submitter_id':_0x34fd90?_0x34fd90['id']:undefined,'assignee_id':_0x34fd90?_0x34fd90['id']:undefined,'tags':getTags(_0x26f675['Tags'],_0x34b3('0xf')),'subject':intUtil[_0x34b3('0x10')](_0x26f675[_0x34b3('0x11')],_0x521389,'\x20'),'description':intUtil[_0x34b3('0x10')](_0x26f675['Descriptions'],_0x521389,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x26f675['Descriptions'],_0x521389,'\x0a')}},getCustomFields(_0x26f675['Fields'],_0x521389))}})[_0x34b3('0x12')](function(_0x5bb443){logger[_0x34b3('0x13')](_0x34b3('0x14'));return _0x5bb443[_0x34b3('0x15')];});}function getUser(_0x1203e3,_0xd0f14a){if(intUtil[_0x34b3('0x16')](_0xd0f14a)){logger[_0x34b3('0x13')]('Getting\x20agent\x20with\x20email',_0xd0f14a);return request({'uri':util[_0x34b3('0x17')]('%s/search.json',_0x1203e3[_0x34b3('0xc')]),'qs':{'query':util[_0x34b3('0x17')]('type:user\x20role:agent\x20email:%s',_0xd0f14a)}})[_0x34b3('0x12')](function(_0x1f9919){if(_0x1f9919[_0x34b3('0x18')]){logger[_0x34b3('0x13')]('Agent\x20found!');return _[_0x34b3('0x19')](_0x1f9919[_0x34b3('0x1a')],{'email':_0xd0f14a,'role':_0x34b3('0x1b')});}else{logger[_0x34b3('0x13')](_0x34b3('0x1c'));return request({'uri':util['format'](_0x34b3('0x1d'),_0x1203e3[_0x34b3('0xc')])})['then'](function(_0x538a41){logger[_0x34b3('0x13')](_0x34b3('0x1e'));return _0x538a41[_0x34b3('0x1f')];});}});}else{logger['info'](_0x34b3('0x1c'));return request({'uri':util[_0x34b3('0x17')](_0x34b3('0x1d'),_0x1203e3[_0x34b3('0xc')])})[_0x34b3('0x12')](function(_0x51c7dd){logger['info'](_0x34b3('0x1e'));return _0x51c7dd[_0x34b3('0x1f')];});}}function getEndUser(_0x52a9df,_0x434a2c,_0xdcf5c0){logger['info']('Searching\x20enduser\x20with\x20phone',_0xdcf5c0);return request({'uri':util[_0x34b3('0x17')](_0x34b3('0x20'),_0x52a9df[_0x34b3('0xc')]),'qs':{'query':util[_0x34b3('0x17')]('type:user\x20role:end-user\x20phone:%s',_0xdcf5c0)}})[_0x34b3('0x12')](function(_0x3042db){var _0x316cfe;if(_0x3042db[_0x34b3('0x1a')][_0x34b3('0x21')]){_0x3042db[_0x34b3('0x1a')]=_[_0x34b3('0x22')](_0x3042db['results'],{'suspended':![],'role':_0x34b3('0x23')});if(_0x3042db[_0x34b3('0x1a')][_0x34b3('0x21')]){_0x316cfe=_['first'](_0x3042db[_0x34b3('0x1a')]);}}if(_0x316cfe){logger[_0x34b3('0x13')](_0x34b3('0x24'));return _0x316cfe;}else{logger[_0x34b3('0x13')](_0x34b3('0x25'));return request({'uri':util[_0x34b3('0x17')](_0x34b3('0x26'),_0x52a9df[_0x34b3('0xc')]),'method':_0x34b3('0xd'),'body':{'user':{'role':_0x34b3('0x23'),'name':util['format'](_0x34b3('0x27'),_0x434a2c||_0xdcf5c0),'phone':_0xdcf5c0}}})['then'](function(_0x6b0919){logger[_0x34b3('0x13')]('Enduser\x20created.');return _0x6b0919[_0x34b3('0x1f')];});}});}function getAuth(_0x740b91){var _0x351c3e;if(_0x740b91[_0x34b3('0x28')]===_0x34b3('0x29')){_0x351c3e=util['format'](_0x34b3('0x2a'),_0x740b91[_0x34b3('0x2b')],_0x740b91[_0x34b3('0x29')]);}else if(_0x740b91[_0x34b3('0x28')]===_0x34b3('0x2c')){_0x351c3e=util['format']('%s/token:%s',_0x740b91['username'],_0x740b91[_0x34b3('0x2c')]);}return util[_0x34b3('0x17')](_0x34b3('0x2d'),new Buffer(_0x351c3e)['toString'](_0x34b3('0x2e')));}function request(_0x4daab0){logger[_0x34b3('0x2f')](_0x34b3('0x30'),JSON[_0x34b3('0x31')](_0x4daab0));return rp(_[_0x34b3('0x6')](_0x4daab0,{'method':_0x34b3('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x20a588,_0x50140b){var _0x5349d9=[];if(_0x20a588&&_0x20a588['length']>0x0){_0x5349d9=_['map'](_0x20a588,_0x50140b);}return _0x5349d9;}function getCustomFields(_0x35008c,_0x1db1ba){var _0x1d181f=[];var _0x2a40fd={'custom_fields':[]};if(_0x35008c[_0x34b3('0x21')]>0x0){_['forEach'](_0x35008c,function(_0x5f4f0b){if(_[_0x34b3('0x33')]([_0x34b3('0x34'),_0x34b3('0x35')],_0x5f4f0b[_0x34b3('0x36')])&&_0x5f4f0b[_0x34b3('0x37')]&&!_0x5f4f0b['customField']){_0x2a40fd[_0x5f4f0b['nameField']['toLowerCase']()]=_0x5f4f0b[_0x34b3('0x38')][_0x34b3('0x39')]();}else if(_[_0x34b3('0x33')](['string',_0x34b3('0x35')],_0x5f4f0b[_0x34b3('0x36')])&&_0x5f4f0b[_0x34b3('0x3a')]&&_0x5f4f0b[_0x34b3('0x3b')]){_0x2a40fd[_0x34b3('0x3c')][_0x34b3('0x3d')]({'id':_0x5f4f0b[_0x34b3('0x3a')],'value':_0x5f4f0b['content'][_0x34b3('0x39')]()});}else if(_0x5f4f0b[_0x34b3('0x36')]===_0x34b3('0x3e')&&_0x5f4f0b[_0x34b3('0x3f')]&&_0x5f4f0b[_0x34b3('0x3a')]&&_0x5f4f0b[_0x34b3('0x3b')]){_0x1db1ba[_0x5f4f0b[_0x34b3('0x3f')]]&&_0x2a40fd[_0x34b3('0x3c')][_0x34b3('0x3d')]({'id':_0x5f4f0b[_0x34b3('0x3a')],'value':_0x1db1ba[_0x5f4f0b['variableName']][_0x34b3('0x39')]()});}else if(_0x5f4f0b[_0x34b3('0x36')]===_0x34b3('0x40')&&_0x5f4f0b[_0x34b3('0x41')]&&_0x5f4f0b[_0x34b3('0x41')][_0x34b3('0xf')]&&_0x5f4f0b[_0x34b3('0x3a')]&&_0x5f4f0b[_0x34b3('0x3b')]){_0x1db1ba[_0x5f4f0b[_0x34b3('0x41')][_0x34b3('0xf')]['toLowerCase']()]&&_0x2a40fd[_0x34b3('0x3c')]['push']({'id':_0x5f4f0b[_0x34b3('0x3a')],'value':_0x1db1ba[_0x5f4f0b['Variable'][_0x34b3('0xf')][_0x34b3('0x42')]()]['toString']()});}});}return _0x2a40fd;}exports[_0x34b3('0x43')]=function(_0x39a2ee,_0x1c94be,_0x4e92ad,_0x2d0312,_0x2c86ca,_0x100c86){var _0x2b412a,_0x40bf9e;_0x100c86[_0x34b3('0xc')]=intUtil[_0x34b3('0x44')](_0x100c86[_0x34b3('0xc')]);_0x100c86[_0x34b3('0x45')]=intUtil[_0x34b3('0x44')](_0x100c86[_0x34b3('0x45')]);if(_0x2c86ca&&_0x2c86ca[_0x34b3('0x46')]){logger[_0x34b3('0x13')](_0x34b3('0x47'),_0x34b3('0x48'));_0x1c94be['recordingURL']=util[_0x34b3('0x17')](_0x34b3('0x49'),_0x100c86[_0x34b3('0x45')],_0x1c94be[_0x34b3('0x4a')],md5(_0x1c94be[_0x34b3('0x4a')]));}else{_0x1c94be[_0x34b3('0x4b')]='';}headers[_0x34b3('0x4c')]=getAuth(_0x100c86);return getUser(_0x100c86,_0x2d0312[_0x34b3('0x4d')])[_0x34b3('0x12')](function(_0x23c319){_0x2b412a=_0x23c319;logger['info'](_0x34b3('0x4e'),_0x2b412a['id']);return getEndUser(_0x100c86,_0x1c94be[_0x34b3('0x4f')],_0x1c94be[_0x34b3('0x50')]);})[_0x34b3('0x12')](function(_0x132607){_0x40bf9e=_0x132607;logger[_0x34b3('0x13')](_0x34b3('0x51'),_0x40bf9e['id']);return getTicket(_0x100c86,_0x2b412a,_0x40bf9e,_0x4e92ad,_0x1c94be);})[_0x34b3('0x12')](function(_0x547a26){if(_0x547a26){logger[_0x34b3('0x13')]('The\x20Ticket\x20ID\x20is:',_0x547a26['id']);switch(_0x100c86[_0x34b3('0x36')]){case _0x34b3('0x52'):logger['info'](_0x34b3('0x47'),_0x34b3('0x53'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x100c86[_0x34b3('0xc')],_0x2b412a['id'],_0x547a26['id']),'method':'POST'});case _0x34b3('0x54'):logger[_0x34b3('0x13')](_0x34b3('0x47'),_0x34b3('0x55'));emit(util[_0x34b3('0x17')](_0x34b3('0x56'),_0x2d0312[_0x34b3('0xf')]),_0x34b3('0x57'),{'uri':util['format'](_0x34b3('0x58'),_0x100c86[_0x34b3('0xc')]['replace']('/api/v2',''),_0x547a26['id'])});break;default:logger[_0x34b3('0x59')]('[QUEUE]',_0x34b3('0x5a'));}}})[_0x34b3('0x5b')](function(_0x3bc656){logger[_0x34b3('0x59')](_0x34b3('0x5c'),util['inspect'](_0x3bc656,{'showHidden':!![],'depth':null}));});};exports[_0x34b3('0x5d')]=function(_0x274a83,_0x3a8ca1,_0x3832a0,_0x4c47d7,_0x2a6ec5,_0x21abf2,_0x3774fc){var _0x1bf4e9,_0xe80aa3;_0x21abf2[_0x34b3('0xc')]=intUtil['stripTrailingSlash'](_0x21abf2[_0x34b3('0xc')]);_0x21abf2['serverUrl']=intUtil['stripTrailingSlash'](_0x21abf2[_0x34b3('0x45')]);if(_0x3774fc&&_0x3774fc['recordingFormat']&&_0x3774fc[_0x34b3('0x5e')]!==_0x34b3('0x5f')){logger[_0x34b3('0x13')]('[OUTBOUND]',_0x34b3('0x48'));_0x3a8ca1[_0x34b3('0x4b')]=util[_0x34b3('0x17')](_0x34b3('0x49'),_0x21abf2[_0x34b3('0x45')],_0x3a8ca1[_0x34b3('0x4a')],md5(_0x3a8ca1[_0x34b3('0x4a')]));}headers[_0x34b3('0x4c')]=getAuth(_0x21abf2);return getUser(_0x21abf2,_0x4c47d7[_0x34b3('0x4d')])[_0x34b3('0x12')](function(_0x2560e9){_0x1bf4e9=_0x2560e9;logger[_0x34b3('0x13')](_0x34b3('0x4e'),_0x1bf4e9['id']);return getEndUser(_0x21abf2,_0x3a8ca1['destcalleridname'],_0x3a8ca1[_0x34b3('0x60')]);})['then'](function(_0x112a98){_0xe80aa3=_0x112a98;logger['info'](_0x34b3('0x51'),_0xe80aa3['id']);return getTicket(_0x21abf2,_0x1bf4e9,_0xe80aa3,_0x3832a0,_0x3a8ca1);})['then'](function(_0x3ff7ae){if(_0x3ff7ae){logger[_0x34b3('0x13')](_0x34b3('0x61'),_0x3ff7ae['id']);switch(_0x21abf2[_0x34b3('0x36')]){case _0x34b3('0x52'):logger[_0x34b3('0x13')](_0x34b3('0x62'),_0x34b3('0x53'));return request({'uri':util['format'](_0x34b3('0x63'),_0x21abf2[_0x34b3('0xc')],_0x1bf4e9['id'],_0x3ff7ae['id']),'method':_0x34b3('0xd')});case _0x34b3('0x54'):logger['info'](_0x34b3('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x34b3('0x17')](_0x34b3('0x56'),_0x4c47d7[_0x34b3('0xf')]),'trigger:browser:url',{'uri':util[_0x34b3('0x17')](_0x34b3('0x58'),_0x21abf2[_0x34b3('0xc')][_0x34b3('0x64')](_0x34b3('0x65'),''),_0x3ff7ae['id'])});break;default:logger[_0x34b3('0x59')](_0x34b3('0x62'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x34b3('0x5b')](function(_0x589171){logger[_0x34b3('0x59')](_0x34b3('0x66'),util[_0x34b3('0x67')](_0x589171,{'showHidden':!![],'depth':null}));});};exports[_0x34b3('0x68')]=function(_0x35f5b8,_0x131583,_0x241c76,_0x547b96,_0x4360c3,_0x52db94){var _0x142b61,_0x3c2356;_0x52db94['remoteUri']=intUtil['stripTrailingSlash'](_0x52db94[_0x34b3('0xc')]);_0x52db94['serverUrl']=intUtil[_0x34b3('0x44')](_0x52db94[_0x34b3('0x45')]);if(_0x4360c3&&_0x4360c3[_0x34b3('0x46')]){logger[_0x34b3('0x13')]('['+_0x131583['lastevent'][_0x34b3('0x69')]()+']','Recording\x20is\x20enabled!');_0x131583[_0x34b3('0x4b')]=util['format'](_0x34b3('0x49'),_0x52db94['serverUrl'],_0x131583[_0x34b3('0x4a')],md5(_0x131583[_0x34b3('0x4a')]));}else{_0x131583['recordingURL']='';}headers['Authorization']=getAuth(_0x52db94);return getUser(_0x52db94)['then'](function(_0x311f63){_0x142b61=_0x311f63;logger[_0x34b3('0x13')](_0x34b3('0x4e'),_0x142b61['id']);return getEndUser(_0x52db94,_0x131583[_0x34b3('0x4f')],_0x131583['calleridnum']);})[_0x34b3('0x12')](function(_0x5ddde7){_0x3c2356=_0x5ddde7;logger['info'](_0x34b3('0x51'),_0x3c2356['id']);return getTicket(_0x52db94,_0x142b61,_0x3c2356,_0x241c76,_0x131583);})['then'](function(_0x40d4f0){if(_0x40d4f0){logger[_0x34b3('0x13')](_0x34b3('0x61'),_0x40d4f0['id']);}})[_0x34b3('0x5b')](function(_0x3cfbf3){logger[_0x34b3('0x59')]('['+_0x131583[_0x34b3('0x6a')][_0x34b3('0x69')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x34b3('0x67')](_0x3cfbf3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdcbf=['user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','toString','[HTTP]','stringify','defaults','map','forEach','includes','nameField','content','string','picklist','idField','customField','custom_fields','push','type','variable','variableName','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdcbf,0x16d));var _0xfdcb=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xdcbf[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xfdcb('0x0'));var rp=require(_0xfdcb('0x1'));var md5=require(_0xfdcb('0x2'));var util=require(_0xfdcb('0x3'));var Redis=require(_0xfdcb('0x4'));var intUtil=require(_0xfdcb('0x5'));var config=require('../../../../config/environment');var logger=require(_0xfdcb('0x6'))(_0xfdcb('0x7'));config[_0xfdcb('0x8')]=_['defaults'](config[_0xfdcb('0x8')],{'host':_0xfdcb('0x9'),'port':0x18eb});var io=require(_0xfdcb('0xa'))(new Redis(config['redis']));function emit(_0x12f734,_0x555673,_0x35ff6f){io['to'](_0x12f734)[_0xfdcb('0xb')](_0x555673,_0x35ff6f);}var headers={'Content-Type':'application/json','Accept':_0xfdcb('0xc')};function getTicket(_0x4e8160,_0x30be95,_0x326a46,_0x342a35,_0x2bed67){logger[_0xfdcb('0xd')](_0xfdcb('0xe'));return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x10'),_0x4e8160[_0xfdcb('0x11')]),'method':_0xfdcb('0x12'),'body':{'ticket':_[_0xfdcb('0x13')]({'requester_id':_0x326a46['id'],'submitter_id':_0x30be95?_0x30be95['id']:undefined,'assignee_id':_0x30be95?_0x30be95['id']:undefined,'tags':getTags(_0x342a35['Tags'],_0xfdcb('0x14')),'subject':intUtil['getString'](_0x342a35['Subjects'],_0x2bed67,'\x20'),'description':intUtil[_0xfdcb('0x15')](_0x342a35[_0xfdcb('0x16')],_0x2bed67,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfdcb('0x15')](_0x342a35['Descriptions'],_0x2bed67,'\x0a')}},getCustomFields(_0x342a35[_0xfdcb('0x17')],_0x2bed67))}})[_0xfdcb('0x18')](function(_0x436f38){logger[_0xfdcb('0xd')](_0xfdcb('0x19'));return _0x436f38[_0xfdcb('0x1a')];});}function getUser(_0x21d978,_0x2d56b5){if(intUtil[_0xfdcb('0x1b')](_0x2d56b5)){logger[_0xfdcb('0xd')](_0xfdcb('0x1c'),_0x2d56b5);return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x1d'),_0x21d978[_0xfdcb('0x11')]),'qs':{'query':util[_0xfdcb('0xf')](_0xfdcb('0x1e'),_0x2d56b5)}})[_0xfdcb('0x18')](function(_0x739357){if(_0x739357['count']){logger[_0xfdcb('0xd')](_0xfdcb('0x1f'));return _[_0xfdcb('0x20')](_0x739357[_0xfdcb('0x21')],{'email':_0x2d56b5,'role':_0xfdcb('0x22')});}else{logger[_0xfdcb('0xd')](_0xfdcb('0x23'));return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x24'),_0x21d978[_0xfdcb('0x11')])})['then'](function(_0x111fa6){logger[_0xfdcb('0xd')](_0xfdcb('0x25'));return _0x111fa6['user'];});}});}else{logger[_0xfdcb('0xd')](_0xfdcb('0x23'));return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x24'),_0x21d978['remoteUri'])})[_0xfdcb('0x18')](function(_0x2dcade){logger[_0xfdcb('0xd')](_0xfdcb('0x25'));return _0x2dcade[_0xfdcb('0x26')];});}}function getEndUser(_0x3c6171,_0x576ae4,_0x40f038){logger[_0xfdcb('0xd')](_0xfdcb('0x27'),_0x40f038);return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x1d'),_0x3c6171['remoteUri']),'qs':{'query':util[_0xfdcb('0xf')](_0xfdcb('0x28'),_0x40f038)}})['then'](function(_0x341fa8){var _0x28aabf;if(_0x341fa8[_0xfdcb('0x21')][_0xfdcb('0x29')]){_0x341fa8[_0xfdcb('0x21')]=_[_0xfdcb('0x2a')](_0x341fa8[_0xfdcb('0x21')],{'suspended':![],'role':_0xfdcb('0x2b')});if(_0x341fa8[_0xfdcb('0x21')][_0xfdcb('0x29')]){_0x28aabf=_[_0xfdcb('0x2c')](_0x341fa8[_0xfdcb('0x21')]);}}if(_0x28aabf){logger[_0xfdcb('0xd')](_0xfdcb('0x2d'));return _0x28aabf;}else{logger[_0xfdcb('0xd')](_0xfdcb('0x2e'));return request({'uri':util[_0xfdcb('0xf')]('%s/users.json',_0x3c6171[_0xfdcb('0x11')]),'method':_0xfdcb('0x12'),'body':{'user':{'role':'end-user','name':util[_0xfdcb('0xf')](_0xfdcb('0x2f'),_0x576ae4||_0x40f038),'phone':_0x40f038}}})[_0xfdcb('0x18')](function(_0x469adc){logger[_0xfdcb('0xd')]('Enduser\x20created.');return _0x469adc[_0xfdcb('0x26')];});}});}function getAuth(_0x4d02fb){var _0x427df7;if(_0x4d02fb[_0xfdcb('0x30')]===_0xfdcb('0x31')){_0x427df7=util[_0xfdcb('0xf')](_0xfdcb('0x32'),_0x4d02fb['username'],_0x4d02fb[_0xfdcb('0x31')]);}else if(_0x4d02fb[_0xfdcb('0x30')]===_0xfdcb('0x33')){_0x427df7=util[_0xfdcb('0xf')](_0xfdcb('0x34'),_0x4d02fb['username'],_0x4d02fb[_0xfdcb('0x33')]);}return util['format'](_0xfdcb('0x35'),new Buffer(_0x427df7)[_0xfdcb('0x36')]('base64'));}function request(_0x2fa63a){logger['debug'](_0xfdcb('0x37'),JSON[_0xfdcb('0x38')](_0x2fa63a));return rp(_[_0xfdcb('0x39')](_0x2fa63a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x27b5c4,_0x3207a6){var _0x180f93=[];if(_0x27b5c4&&_0x27b5c4[_0xfdcb('0x29')]>0x0){_0x180f93=_[_0xfdcb('0x3a')](_0x27b5c4,_0x3207a6);}return _0x180f93;}function getCustomFields(_0x49aa26,_0x284271){var _0x11821e=[];var _0x1dd30a={'custom_fields':[]};if(_0x49aa26[_0xfdcb('0x29')]>0x0){_[_0xfdcb('0x3b')](_0x49aa26,function(_0x5866d6){if(_[_0xfdcb('0x3c')](['string','picklist'],_0x5866d6['type'])&&_0x5866d6[_0xfdcb('0x3d')]&&!_0x5866d6['customField']){_0x1dd30a[_0x5866d6[_0xfdcb('0x3d')]['toLowerCase']()]=_0x5866d6[_0xfdcb('0x3e')]['toString']();}else if(_['includes']([_0xfdcb('0x3f'),_0xfdcb('0x40')],_0x5866d6['type'])&&_0x5866d6[_0xfdcb('0x41')]&&_0x5866d6[_0xfdcb('0x42')]){_0x1dd30a[_0xfdcb('0x43')][_0xfdcb('0x44')]({'id':_0x5866d6['idField'],'value':_0x5866d6['content'][_0xfdcb('0x36')]()});}else if(_0x5866d6[_0xfdcb('0x45')]===_0xfdcb('0x46')&&_0x5866d6['variableName']&&_0x5866d6['idField']&&_0x5866d6[_0xfdcb('0x42')]){_0x284271[_0x5866d6[_0xfdcb('0x47')]]&&_0x1dd30a[_0xfdcb('0x43')][_0xfdcb('0x44')]({'id':_0x5866d6[_0xfdcb('0x41')],'value':_0x284271[_0x5866d6[_0xfdcb('0x47')]]['toString']()});}else if(_0x5866d6[_0xfdcb('0x45')]==='customVariable'&&_0x5866d6[_0xfdcb('0x48')]&&_0x5866d6[_0xfdcb('0x48')][_0xfdcb('0x14')]&&_0x5866d6[_0xfdcb('0x41')]&&_0x5866d6[_0xfdcb('0x42')]){_0x284271[_0x5866d6[_0xfdcb('0x48')][_0xfdcb('0x14')][_0xfdcb('0x49')]()]&&_0x1dd30a[_0xfdcb('0x43')]['push']({'id':_0x5866d6[_0xfdcb('0x41')],'value':_0x284271[_0x5866d6['Variable'][_0xfdcb('0x14')][_0xfdcb('0x49')]()][_0xfdcb('0x36')]()});}});}return _0x1dd30a;}exports[_0xfdcb('0x4a')]=function(_0x286fff,_0x176746,_0x5c06ff,_0x5203fd,_0xb4bfed,_0xcd01e3){var _0x3d6e37,_0x190496;_0xcd01e3['remoteUri']=intUtil['stripTrailingSlash'](_0xcd01e3[_0xfdcb('0x11')]);_0xcd01e3[_0xfdcb('0x4b')]=intUtil[_0xfdcb('0x4c')](_0xcd01e3['serverUrl']);if(_0xb4bfed&&_0xb4bfed[_0xfdcb('0x4d')]){logger[_0xfdcb('0xd')](_0xfdcb('0x4e'),_0xfdcb('0x4f'));_0x176746[_0xfdcb('0x50')]=util[_0xfdcb('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xcd01e3[_0xfdcb('0x4b')],_0x176746[_0xfdcb('0x51')],md5(_0x176746[_0xfdcb('0x51')]));}else{_0x176746[_0xfdcb('0x50')]='';}headers[_0xfdcb('0x52')]=getAuth(_0xcd01e3);return getUser(_0xcd01e3,_0x5203fd[_0xfdcb('0x53')])[_0xfdcb('0x18')](function(_0x37d401){_0x3d6e37=_0x37d401;logger[_0xfdcb('0xd')]('The\x20User\x20ID\x20is:',_0x3d6e37['id']);return getEndUser(_0xcd01e3,_0x176746[_0xfdcb('0x54')],_0x176746[_0xfdcb('0x55')]);})['then'](function(_0x2ef83f){_0x190496=_0x2ef83f;logger[_0xfdcb('0xd')](_0xfdcb('0x56'),_0x190496['id']);return getTicket(_0xcd01e3,_0x3d6e37,_0x190496,_0x5c06ff,_0x176746);})[_0xfdcb('0x18')](function(_0x5cdd81){if(_0x5cdd81){logger[_0xfdcb('0xd')](_0xfdcb('0x57'),_0x5cdd81['id']);switch(_0xcd01e3[_0xfdcb('0x45')]){case _0xfdcb('0x58'):logger['info'](_0xfdcb('0x4e'),_0xfdcb('0x59'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xcd01e3['remoteUri'],_0x3d6e37['id'],_0x5cdd81['id']),'method':'POST'});case _0xfdcb('0x5a'):logger[_0xfdcb('0xd')](_0xfdcb('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xfdcb('0x5b'),_0x5203fd['name']),_0xfdcb('0x5c'),{'uri':util[_0xfdcb('0xf')](_0xfdcb('0x5d'),_0xcd01e3[_0xfdcb('0x11')][_0xfdcb('0x5e')](_0xfdcb('0x5f'),''),_0x5cdd81['id'])});break;default:logger[_0xfdcb('0x60')]('[QUEUE]',_0xfdcb('0x61'));}}})[_0xfdcb('0x62')](function(_0xd52016){logger[_0xfdcb('0x60')](_0xfdcb('0x63'),util[_0xfdcb('0x64')](_0xd52016,{'showHidden':!![],'depth':null}));});};exports[_0xfdcb('0x65')]=function(_0x13edc6,_0x1f2482,_0x5e9e9f,_0x51daa8,_0x2d2e29,_0x590e0e,_0x1932b7){var _0x22b013,_0x2e4918;_0x590e0e['remoteUri']=intUtil[_0xfdcb('0x4c')](_0x590e0e['remoteUri']);_0x590e0e[_0xfdcb('0x4b')]=intUtil[_0xfdcb('0x4c')](_0x590e0e[_0xfdcb('0x4b')]);if(_0x1932b7&&_0x1932b7['recordingFormat']&&_0x1932b7['recordingFormat']!==_0xfdcb('0x66')){logger[_0xfdcb('0xd')]('[OUTBOUND]',_0xfdcb('0x4f'));_0x1f2482[_0xfdcb('0x50')]=util[_0xfdcb('0xf')](_0xfdcb('0x67'),_0x590e0e['serverUrl'],_0x1f2482['uniqueid'],md5(_0x1f2482[_0xfdcb('0x51')]));}headers[_0xfdcb('0x52')]=getAuth(_0x590e0e);return getUser(_0x590e0e,_0x51daa8[_0xfdcb('0x53')])[_0xfdcb('0x18')](function(_0x49713d){_0x22b013=_0x49713d;logger['info'](_0xfdcb('0x68'),_0x22b013['id']);return getEndUser(_0x590e0e,_0x1f2482[_0xfdcb('0x69')],_0x1f2482[_0xfdcb('0x6a')]);})[_0xfdcb('0x18')](function(_0x4a68bb){_0x2e4918=_0x4a68bb;logger[_0xfdcb('0xd')](_0xfdcb('0x56'),_0x2e4918['id']);return getTicket(_0x590e0e,_0x22b013,_0x2e4918,_0x5e9e9f,_0x1f2482);})['then'](function(_0x4f6d2b){if(_0x4f6d2b){logger[_0xfdcb('0xd')](_0xfdcb('0x57'),_0x4f6d2b['id']);switch(_0x590e0e[_0xfdcb('0x45')]){case _0xfdcb('0x58'):logger[_0xfdcb('0xd')](_0xfdcb('0x6b'),_0xfdcb('0x59'));return request({'uri':util[_0xfdcb('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x590e0e[_0xfdcb('0x11')],_0x22b013['id'],_0x4f6d2b['id']),'method':_0xfdcb('0x12')});case _0xfdcb('0x5a'):logger[_0xfdcb('0xd')](_0xfdcb('0x6b'),_0xfdcb('0x6c'));emit(util[_0xfdcb('0xf')](_0xfdcb('0x5b'),_0x51daa8[_0xfdcb('0x14')]),_0xfdcb('0x5c'),{'uri':util[_0xfdcb('0xf')](_0xfdcb('0x5d'),_0x590e0e[_0xfdcb('0x11')][_0xfdcb('0x5e')](_0xfdcb('0x5f'),''),_0x4f6d2b['id'])});break;default:logger[_0xfdcb('0x60')](_0xfdcb('0x6b'),_0xfdcb('0x61'));}}})[_0xfdcb('0x62')](function(_0x51c8ce){logger['error'](_0xfdcb('0x6d'),util[_0xfdcb('0x64')](_0x51c8ce,{'showHidden':!![],'depth':null}));});};exports[_0xfdcb('0x6e')]=function(_0x416bc3,_0x5a2b7b,_0x36c751,_0x1f47da,_0x4d4cf0,_0x3b943d){var _0x46e1f7,_0x2d3030;_0x3b943d[_0xfdcb('0x11')]=intUtil[_0xfdcb('0x4c')](_0x3b943d['remoteUri']);_0x3b943d[_0xfdcb('0x4b')]=intUtil[_0xfdcb('0x4c')](_0x3b943d['serverUrl']);if(_0x4d4cf0&&_0x4d4cf0[_0xfdcb('0x4d')]){logger[_0xfdcb('0xd')]('['+_0x5a2b7b[_0xfdcb('0x6f')][_0xfdcb('0x70')]()+']',_0xfdcb('0x4f'));_0x5a2b7b['recordingURL']=util['format'](_0xfdcb('0x67'),_0x3b943d[_0xfdcb('0x4b')],_0x5a2b7b[_0xfdcb('0x51')],md5(_0x5a2b7b[_0xfdcb('0x51')]));}else{_0x5a2b7b[_0xfdcb('0x50')]='';}headers[_0xfdcb('0x52')]=getAuth(_0x3b943d);return getUser(_0x3b943d)[_0xfdcb('0x18')](function(_0x285f81){_0x46e1f7=_0x285f81;logger[_0xfdcb('0xd')]('The\x20User\x20ID\x20is:',_0x46e1f7['id']);return getEndUser(_0x3b943d,_0x5a2b7b[_0xfdcb('0x54')],_0x5a2b7b[_0xfdcb('0x55')]);})['then'](function(_0xdd4f2c){_0x2d3030=_0xdd4f2c;logger['info'](_0xfdcb('0x56'),_0x2d3030['id']);return getTicket(_0x3b943d,_0x46e1f7,_0x2d3030,_0x36c751,_0x5a2b7b);})['then'](function(_0x59ad22){if(_0x59ad22){logger[_0xfdcb('0xd')](_0xfdcb('0x57'),_0x59ad22['id']);}})['catch'](function(_0x3a282d){logger['error']('['+_0x5a2b7b[_0xfdcb('0x6f')][_0xfdcb('0x70')]()+']'+_0xfdcb('0x71'),util[_0xfdcb('0x64')](_0x3a282d,{'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 91790f0..389a79f 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 _0x8b9d=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/downloads?type=uniqueid&token=','com','destcalleridname','destcalleridnum','lastevent','toUpperCase','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','socket.io-emitter','emit','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','enduserType','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Subject','Description','getString','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','code','Call\x20created!','err','log','queue','host'];(function(_0xf9b0c9,_0x481736){var _0x291b52=function(_0x16b9d2){while(--_0x16b9d2){_0xf9b0c9['push'](_0xf9b0c9['shift']());}};_0x291b52(++_0x481736);}(_0x8b9d,0x1ee));var _0xd8b9=function(_0x149bc3,_0x4b09d8){_0x149bc3=_0x149bc3-0x0;var _0x5d33eb=_0x8b9d[_0x149bc3];return _0x5d33eb;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xd8b9('0x0'));var util=require(_0xd8b9('0x1'));var intUtil=require(_0xd8b9('0x2'));var moment=require(_0xd8b9('0x3'));var Redis=require(_0xd8b9('0x4'));var BPromise=require(_0xd8b9('0x5'));var config=require(_0xd8b9('0x6'));var logger=require(_0xd8b9('0x7'))(_0xd8b9('0x8'));config['redis']=_[_0xd8b9('0x9')](config[_0xd8b9('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xd8b9('0xb'))(new Redis(config['redis']));function emit(_0x302392,_0x341fbd,_0x22b0b4){io['to'](_0x302392)[_0xd8b9('0xc')](_0x341fbd,_0x22b0b4);}function request(_0x15fc1d){logger['debug']('[HTTP]',JSON[_0xd8b9('0xd')](_0x15fc1d));return rp(_0x15fc1d);}function getCustomFields(_0x3a6088,_0x267305){var _0x3070b8={};if(_0x3a6088[_0xd8b9('0xe')]>0x0){_[_0xd8b9('0xf')](_0x3a6088,function(_0xe2421b){if(_[_0xd8b9('0x10')]([_0xd8b9('0x11'),_0xd8b9('0x12')],_0xe2421b[_0xd8b9('0x13')])&&_0xe2421b['idField']){_0x3070b8[_0xe2421b[_0xd8b9('0x14')]]=_0xe2421b[_0xd8b9('0x15')][_0xd8b9('0x16')]();}else if(_0xe2421b[_0xd8b9('0x13')]===_0xd8b9('0x17')&&_0xe2421b[_0xd8b9('0x18')]&&_0xe2421b['idField']&&_0x267305[_0xe2421b[_0xd8b9('0x18')]]){_0x3070b8[_0xe2421b[_0xd8b9('0x14')]]=_0x267305[_0xe2421b[_0xd8b9('0x18')]][_0xd8b9('0x16')]();}else if(_0xe2421b[_0xd8b9('0x13')]===_0xd8b9('0x19')&&_0xe2421b[_0xd8b9('0x1a')]&&_0xe2421b[_0xd8b9('0x1a')][_0xd8b9('0x1b')]&&_0xe2421b[_0xd8b9('0x14')]&&_0x267305[_0xe2421b[_0xd8b9('0x1a')]['name'][_0xd8b9('0x1c')]()]){_0x3070b8[_0xe2421b['idField']]=_0x267305[_0xe2421b['Variable']['name']['toLowerCase']()][_0xd8b9('0x16')]();}});}return _0x3070b8;}function getName(_0x7a961d){if(_0x7a961d[_0xd8b9('0x1d')]('\x20')>0x0){var _0x3a1ba8=_0x7a961d[_0xd8b9('0x1e')](/ (.+)/);if(_0x3a1ba8[0x1]){return _0x3a1ba8;}}return[_0x7a961d,_0x7a961d];}var accountsTokens={};function getAccessToken(_0x31f94e){return new Promise(function(_0x561c2,_0x33bcce){if(!_['isNil'](accountsTokens[_0x31f94e['id']])&&!_[_0xd8b9('0x1f')](accountsTokens[_0x31f94e['id']][_0xd8b9('0x20')])){if(moment()[_0xd8b9('0x21')](accountsTokens[_0x31f94e['id']][_0xd8b9('0x22')])){_0x561c2(accountsTokens[_0x31f94e['id']][_0xd8b9('0x20')]);}}var _0x5a9e3f;switch(_0x31f94e[_0xd8b9('0x23')]){case'US':_0x5a9e3f=_0xd8b9('0x24');break;case'AU':_0x5a9e3f=_0xd8b9('0x25');break;case'EU':_0x5a9e3f=_0xd8b9('0x26');break;case'IN':_0x5a9e3f=_0xd8b9('0x27');break;case'CN':_0x5a9e3f=_0xd8b9('0x28');break;default:_0x5a9e3f='https://accounts.zoho.eu';break;}var _0xb8df4={'method':_0xd8b9('0x29'),'uri':_0x5a9e3f+'/oauth/v2/token','qs':{'refresh_token':_0x31f94e[_0xd8b9('0x2a')],'client_id':_0x31f94e[_0xd8b9('0x2b')],'client_secret':_0x31f94e[_0xd8b9('0x2c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xb8df4)[_0xd8b9('0x2d')](function(_0x4f829d){accountsTokens[_0x31f94e['id']]={'access_token':_0x4f829d['access_token'],'expires_in':moment()[_0xd8b9('0x2e')](_0x4f829d[_0xd8b9('0x22')],_0xd8b9('0x2f'))};_0x561c2(_0x4f829d['access_token']);})[_0xd8b9('0x30')](function(_0x245976){logger[_0xd8b9('0x31')](_0xd8b9('0x32'),_0x245976[_0xd8b9('0x33')]);_0x33bcce(_0x245976);});});}function getUser(_0x4f3973,_0x253646,_0x718a9e,_0x1e91ee){logger[_0xd8b9('0x34')](_0xd8b9('0x35'));return request({'method':_0xd8b9('0x36'),'uri':util['format'](_0xd8b9('0x37'),_0x253646),'qs':{'type':_0xd8b9('0x38')},'headers':{'Authorization':_0xd8b9('0x39')+_0x4f3973},'json':!![]})['then'](function(_0x52d929){if(_0x52d929[_0xd8b9('0x3a')]){var _0x491918=-0x1;if(_[_0xd8b9('0x3b')](_0x52d929[_0xd8b9('0x3a')])){if(!_[_0xd8b9('0x1f')](_0x1e91ee)){_0x491918=_[_0xd8b9('0x3c')](_0x52d929[_0xd8b9('0x3a')],function(_0x93c35b){return _0x93c35b[_0xd8b9('0x3d')]===_0x1e91ee;});}if(_0x491918>=0x0){logger[_0xd8b9('0x34')]('Agent\x20found!');}else{logger['info'](_0xd8b9('0x3e'));_0x491918=_[_0xd8b9('0x3c')](_0x52d929[_0xd8b9('0x3a')],function(_0x1afd30){return _0x1afd30[_0xd8b9('0x3f')][_0xd8b9('0x1b')]===_0xd8b9('0x40');});}return _0x52d929[_0xd8b9('0x3a')][_0x491918];}else{if(_0x52d929['user']['profile']['name']===_0xd8b9('0x40')){logger[_0xd8b9('0x34')](_0xd8b9('0x3e'));user=_0x52d929[_0xd8b9('0x41')];return user;}else{logger[_0xd8b9('0x31')](_0xd8b9('0x42'),JSON['stringify'](_0x52d929));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x52d929));}}}else{logger[_0xd8b9('0x31')](_0xd8b9('0x42'),JSON[_0xd8b9('0xd')](_0x52d929));throw new Error(_0xd8b9('0x43')+JSON[_0xd8b9('0xd')](_0x52d929));}})[_0xd8b9('0x30')](function(_0x58822f){console[_0xd8b9('0x31')](_0x58822f);});}function getZohoUser(_0x3205a3,_0x4aa884){return new BPromise(function(_0x541d74,_0x933f26){request(_0x3205a3)[_0xd8b9('0x2d')](function(_0x59b457){var _0x17a9c2=null;if(_0x59b457){_0x17a9c2=_0x59b457[_0xd8b9('0x44')][0x0];_0x17a9c2['enduserType']=_0x4aa884;}_0x541d74(_0x17a9c2);})[_0xd8b9('0x30')](function(_0x17e2b9){_0x933f26(_0x17e2b9);});});}function createEndUser(_0x29c67b,_0x15dfaa,_0x65b61f,_0x3e8ffd,_0x2cceb9,_0x36246f){var _0x65b61f=getName(_0x65b61f);return request({'method':_0xd8b9('0x29'),'uri':'https://www.zohoapis.'+_0x15dfaa+_0xd8b9('0x45')+_[_0xd8b9('0x46')](_0x36246f[_0xd8b9('0x47')])+'s','body':{'data':[{'Last_Name':_0x65b61f[0x1],'First_Name':_0x65b61f[0x0],'Phone':_0x3e8ffd,'Owner':{'name':!_[_0xd8b9('0x1f')](_0x2cceb9['role']['name'])?_0x2cceb9[_0xd8b9('0x48')][_0xd8b9('0x1b')]:!_[_0xd8b9('0x1f')](_0x2cceb9[_0xd8b9('0x49')])?_0x2cceb9[_0xd8b9('0x49')]+'\x20'+_0x2cceb9[_0xd8b9('0x4a')]:_0x2cceb9['last_name'],'id':_0x2cceb9['id']}}]},'headers':{'Authorization':_0xd8b9('0x39')+_0x29c67b},'json':!![]})[_0xd8b9('0x2d')](function(_0x3f42f9){if(_0x3f42f9&&_0x3f42f9[_0xd8b9('0x44')][0x0]['code']===_0xd8b9('0x4b')){var _0x40f679=_0x3f42f9['data'][0x0][_0xd8b9('0x4c')];_0x40f679[_0xd8b9('0x4d')]=_['startCase'](_0x36246f[_0xd8b9('0x47')])+'s';return _0x40f679;}logger[_0xd8b9('0x31')](_0xd8b9('0x42'),JSON[_0xd8b9('0xd')](data));throw new Error(_0xd8b9('0x4e')+JSON[_0xd8b9('0xd')](data));})[_0xd8b9('0x30')](function(_0x1f936e){console['log'](_0xd8b9('0x4f'),_0x1f936e);});}function getEndUser(_0xf21102,_0x4ca66c,_0xb08740,_0x9770d4,_0x12be95,_0x385d68,_0x37f080){var _0x5e0bc4={'method':_0xd8b9('0x36'),'uri':'','headers':{'Authorization':_0xd8b9('0x39')+_0xf21102},'json':!![]};switch(_0x37f080[_0xd8b9('0x50')]){case _0xd8b9('0x51'):_0x5e0bc4[_0xd8b9('0x52')]=_0xd8b9('0x53')+_0x4ca66c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x12be95+'))';return getZohoUser(_0x5e0bc4,_0xd8b9('0x54'))[_0xd8b9('0x2d')](function(_0x23ae23){if(_0x23ae23)return _0x23ae23;_0x5e0bc4[_0xd8b9('0x52')]='https://www.zohoapis.'+_0x4ca66c+_0xd8b9('0x55')+_0x12be95+'))';return getZohoUser(_0x5e0bc4,_0xd8b9('0x56'))['then'](function(_0x326f98){if(_0x326f98)return _0x326f98;if(_0x37f080[_0xd8b9('0x47')]!=_0xd8b9('0x57')){return createEndUser(_0xf21102,_0x4ca66c,_0x9770d4,_0x12be95,_0x385d68,_0x37f080);}else{return{};}});});break;case'contact':_0x5e0bc4[_0xd8b9('0x52')]=_0xd8b9('0x53')+_0x4ca66c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x12be95+'))';return getZohoUser(_0x5e0bc4,_0xd8b9('0x54'))['then'](function(_0x15159e){if(_0x15159e)return _0x15159e;if(_0x37f080[_0xd8b9('0x47')]!=_0xd8b9('0x57')){return createEndUser(_0xf21102,_0x4ca66c,_0x9770d4,_0x12be95,_0x385d68,_0x37f080);}else{return{};}});break;case _0xd8b9('0x58'):_0x5e0bc4[_0xd8b9('0x52')]=_0xd8b9('0x53')+_0x4ca66c+_0xd8b9('0x55')+_0x12be95+'))';return getZohoUser(_0x5e0bc4,'Leads')[_0xd8b9('0x2d')](function(_0x231625){if(_0x231625)return _0x231625;if(_0x37f080['moduleCreate']!='nothing'){return createEndUser(_0xf21102,_0x4ca66c,_0x9770d4,_0x12be95,_0x385d68,_0x37f080);}else{return{};}});break;}}function getCall(_0x21658b,_0x4d6790,_0x846d9f,_0x36fdd7,_0x4adb58,_0x226fad,_0x52eba9,_0x12c737){logger[_0xd8b9('0x34')](_0xd8b9('0x59'));var _0x5b706b={};_0x5b706b['Owner']={'name':!_[_0xd8b9('0x1f')](_0x36fdd7[_0xd8b9('0x48')][_0xd8b9('0x1b')])&&!_[_0xd8b9('0x1f')](_0x36fdd7['profile'][_0xd8b9('0x1b')])&&_0x36fdd7[_0xd8b9('0x3f')][_0xd8b9('0x1b')]==='administrator'?_0x36fdd7[_0xd8b9('0x48')]['name']:!_[_0xd8b9('0x1f')](_0x36fdd7['first_name'])?_0x36fdd7[_0xd8b9('0x49')]+'\x20'+_0x36fdd7['last_name']:_0x36fdd7['last_name'],'id':_0x36fdd7['id']};_0x5b706b[_0xd8b9('0x5a')]=intUtil['getString'](_0x226fad['Subjects'],_0x52eba9,'\x20');_0x5b706b[_0xd8b9('0x5b')]=intUtil[_0xd8b9('0x5c')](_0x226fad[_0xd8b9('0x5d')],_0x52eba9,'\x0a');if(_0x4adb58[_0xd8b9('0x4d')]===_0xd8b9('0x54')){_0x5b706b[_0xd8b9('0x5e')]={'name':!_[_0xd8b9('0x1f')](_0x4adb58[_0xd8b9('0x5f')])?_0x4adb58[_0xd8b9('0x5f')]:!_[_0xd8b9('0x1f')](_0x4adb58['First_Name'])?_0x4adb58['First_Name']+'\x20'+_0x4adb58[_0xd8b9('0x60')]:_0x4adb58[_0xd8b9('0x60')],'id':_0x4adb58['id']};}if(_0x4adb58['enduserType']===_0xd8b9('0x56')){_0x5b706b[_0xd8b9('0x61')]={'name':!_[_0xd8b9('0x1f')](_0x4adb58[_0xd8b9('0x5f')])?_0x4adb58[_0xd8b9('0x5f')]:!_[_0xd8b9('0x1f')](_0x4adb58['First_Name'])?_0x4adb58['First_Name']+'\x20'+_0x4adb58[_0xd8b9('0x60')]:_0x4adb58[_0xd8b9('0x60')],'id':_0x4adb58['id']};_0x5b706b['$se_module']=_['startCase'](_0x4adb58[_0xd8b9('0x4d')]);}if(_0x52eba9['talktime']){_0x5b706b[_0xd8b9('0x62')]=moment[_0xd8b9('0x63')](parseInt(_0x52eba9['talktime'])*0x3e8)['format'](_0xd8b9('0x64'));}else if(_0x52eba9[_0xd8b9('0x65')]&&_0x52eba9[_0xd8b9('0x66')]){_0x5b706b[_0xd8b9('0x62')]=moment[_0xd8b9('0x63')](moment(_0x52eba9[_0xd8b9('0x66')],_0xd8b9('0x67'))[_0xd8b9('0x68')](moment(_0x52eba9[_0xd8b9('0x69')],_0xd8b9('0x67'))))[_0xd8b9('0x6a')](_0xd8b9('0x64'));}switch(_0x52eba9['lastevent']){case _0xd8b9('0x6b'):_0x5b706b[_0xd8b9('0x6c')]=_0xd8b9('0x6d');break;case _0xd8b9('0x6e'):case _0xd8b9('0x6f'):_0x5b706b[_0xd8b9('0x6c')]=_0xd8b9('0x70');break;case _0xd8b9('0x71'):_0x5b706b['Call_Result']=_0xd8b9('0x72');break;case _0xd8b9('0x73'):_0x5b706b[_0xd8b9('0x6c')]='Abandoned';break;case'timeout':_0x5b706b['Call_Result']=_0xd8b9('0x74');default:}_0x5b706b[_0xd8b9('0x75')]=(_0x12c737===_0xd8b9('0x76')?moment(_0x52eba9['starttime'])[_0xd8b9('0x6a')](_0xd8b9('0x67')):moment(_0x52eba9[_0xd8b9('0x77')])[_0xd8b9('0x6a')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xd8b9('0x6a')](_0xd8b9('0x67'));_0x5b706b[_0xd8b9('0x78')]=_0x12c737||_0xd8b9('0x79');_0x5b706b=_[_0xd8b9('0x7a')](_0x5b706b,getCustomFields(_0x226fad['Fields'],_0x52eba9));return request({'method':_0xd8b9('0x29'),'uri':_0xd8b9('0x53')+_0x4d6790+_0xd8b9('0x7b'),'headers':{'Authorization':_0xd8b9('0x39')+_0x21658b},'body':{'data':[_0x5b706b]},'json':!![]})['then'](function(_0x457a6f){if(_0x457a6f&&_0x457a6f['data'][0x0][_0xd8b9('0x7c')]==='SUCCESS'){logger[_0xd8b9('0x34')](_0xd8b9('0x7d'));return{'id':_0x457a6f[_0xd8b9('0x44')][0x0][_0xd8b9('0x4c')]['id']};}})['catch'](function(_0x382405){logger[_0xd8b9('0x34')](_0xd8b9('0x7e'),_0x382405[_0xd8b9('0x33')]);console[_0xd8b9('0x7f')]('err',_0x382405);});}exports[_0xd8b9('0x80')]=function(_0x4294bd,_0x2f1491,_0x18fea5,_0x7c2e3a,_0x246fcb,_0x4fd02c){var _0xf6027a,_0x5d2bd0,_0x48d527;_0x4fd02c[_0xd8b9('0x81')]=intUtil['stripTrailingSlash'](_0x4fd02c[_0xd8b9('0x81')]);_0x4fd02c['serverUrl']=intUtil[_0xd8b9('0x82')](_0x4fd02c[_0xd8b9('0x83')]);if(_0x246fcb&&_0x246fcb[_0xd8b9('0x84')]){logger[_0xd8b9('0x34')](_0xd8b9('0x85'),_0xd8b9('0x86'));_0x2f1491[_0xd8b9('0x87')]=_0x4fd02c[_0xd8b9('0x83')]+_0xd8b9('0x88')+_0x2f1491['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x2f1491[_0xd8b9('0x89')]);}else{_0x2f1491[_0xd8b9('0x87')]='';}var _0x5e6746=_0x4fd02c[_0xd8b9('0x81')]===_0xd8b9('0x8a')?'eu':'com';return getAccessToken(_0x4fd02c)['then'](function(_0x4ffe11){_0x48d527=_0x4ffe11;return getUser(_0x48d527,_0x5e6746,_0x4fd02c,_0x7c2e3a[_0xd8b9('0x3d')]);})[_0xd8b9('0x2d')](function(_0x40fbf3){_0xf6027a=_0x40fbf3;logger[_0xd8b9('0x34')](_0xd8b9('0x8b'),_0xf6027a['id']);return getEndUser(_0x48d527,_0x5e6746,_0x4fd02c,_0x2f1491[_0xd8b9('0x8c')],_0x2f1491[_0xd8b9('0x8d')],_0xf6027a,_0x18fea5);})['then'](function(_0x4d057d){_0x5d2bd0=_0x4d057d;return getCall(_0x48d527,_0x5e6746,_0x4fd02c,_0xf6027a,_0x5d2bd0,_0x18fea5,_0x2f1491,'Inbound');})[_0xd8b9('0x2d')](function(_0x3d68d8){if(_0x3d68d8){logger[_0xd8b9('0x34')](_0xd8b9('0x8e'),_0x3d68d8['id']);logger['info']('[QUEUE]',_0xd8b9('0x8f'));emit(util[_0xd8b9('0x6a')](_0xd8b9('0x90'),_0x7c2e3a[_0xd8b9('0x1b')]),_0xd8b9('0x91'),{'uri':_0xd8b9('0x92')+_0x4fd02c[_0xd8b9('0x81')]+_0xd8b9('0x93')+_0x3d68d8['id']});}})[_0xd8b9('0x30')](function(_0xd72ca1){logger[_0xd8b9('0x31')](_0xd8b9('0x85'),JSON[_0xd8b9('0xd')](_0xd72ca1));});};exports['outbound']=function(_0x42a468,_0x3d90e3,_0x4a9c88,_0x252cb9,_0x6aeb75,_0x2ffeda,_0x1e4b01){var _0x189d2e,_0xc1eaff,_0x5f38fd;_0x2ffeda[_0xd8b9('0x81')]=intUtil['stripTrailingSlash'](_0x2ffeda['host']);_0x2ffeda[_0xd8b9('0x83')]=intUtil[_0xd8b9('0x82')](_0x2ffeda[_0xd8b9('0x83')]);if(_0x1e4b01&&_0x1e4b01[_0xd8b9('0x94')]&&_0x1e4b01[_0xd8b9('0x94')]!=='none'){logger[_0xd8b9('0x34')](_0xd8b9('0x95'),_0xd8b9('0x86'));_0x3d90e3['recordingURL']=_0x2ffeda[_0xd8b9('0x83')]+_0xd8b9('0x88')+_0x3d90e3[_0xd8b9('0x89')]+_0xd8b9('0x96')+md5(_0x3d90e3['uniqueid']);}var _0x32c9be=_0x2ffeda[_0xd8b9('0x81')]===_0xd8b9('0x8a')?'eu':_0xd8b9('0x97');return getAccessToken(_0x2ffeda)[_0xd8b9('0x2d')](function(_0x454a63){_0x5f38fd=_0x454a63;return getUser(_0x5f38fd,_0x32c9be,_0x2ffeda,_0x252cb9[_0xd8b9('0x3d')]);})['then'](function(_0xebda53){_0x189d2e=_0xebda53;logger['info'](_0xd8b9('0x8b'),_0x189d2e['id']);return getEndUser(_0x5f38fd,_0x32c9be,_0x2ffeda,_0x3d90e3[_0xd8b9('0x98')],_0x3d90e3[_0xd8b9('0x99')],_0x189d2e,_0x4a9c88);})[_0xd8b9('0x2d')](function(_0x5c63e3){_0xc1eaff=_0x5c63e3;return getCall(_0x5f38fd,_0x32c9be,_0x2ffeda,_0x189d2e,_0xc1eaff,_0x4a9c88,_0x3d90e3,'Outbound');})['then'](function(_0x2322d6){if(_0x2322d6){logger[_0xd8b9('0x34')](_0xd8b9('0x8e'),_0x2322d6['id']);logger[_0xd8b9('0x34')](_0xd8b9('0x95'),_0xd8b9('0x8f'));emit(util[_0xd8b9('0x6a')](_0xd8b9('0x90'),_0x252cb9[_0xd8b9('0x1b')]),'trigger:browser:url',{'uri':_0xd8b9('0x92')+_0x2ffeda[_0xd8b9('0x81')]+_0xd8b9('0x93')+_0x2322d6['id']});}})[_0xd8b9('0x30')](function(_0x21f07f){logger[_0xd8b9('0x31')](_0xd8b9('0x95'),JSON[_0xd8b9('0xd')](_0x21f07f));});};exports['unmanaged']=function(_0x316f70,_0x43cf36,_0x3faff2,_0x2e1976,_0x403cdd,_0x2c4108){var _0x2a3b6e,_0x119c60,_0x3cb7bd;_0x2c4108[_0xd8b9('0x81')]=intUtil[_0xd8b9('0x82')](_0x2c4108[_0xd8b9('0x81')]);_0x2c4108[_0xd8b9('0x83')]=intUtil[_0xd8b9('0x82')](_0x2c4108['serverUrl']);if(_0x403cdd&&_0x403cdd[_0xd8b9('0x84')]){logger[_0xd8b9('0x34')]('['+_0x43cf36[_0xd8b9('0x9a')][_0xd8b9('0x9b')]()+']',_0xd8b9('0x86'));_0x43cf36[_0xd8b9('0x87')]=_0x2c4108[_0xd8b9('0x83')]+_0xd8b9('0x88')+_0x43cf36['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x43cf36[_0xd8b9('0x89')]);}else{_0x43cf36[_0xd8b9('0x87')]='';}var _0x82e379=_0x2c4108['host']===_0xd8b9('0x8a')?'eu':_0xd8b9('0x97');return getAccessToken(_0x2c4108)['then'](function(_0x13f87f){_0x3cb7bd=_0x13f87f;return getUser(_0x3cb7bd,_0x82e379,_0x2c4108);})[_0xd8b9('0x2d')](function(_0x252d45){_0x2a3b6e=_0x252d45;logger[_0xd8b9('0x34')](_0xd8b9('0x8b'),_0x2a3b6e['id']);return getEndUser(_0x3cb7bd,_0x82e379,_0x2c4108,_0x43cf36[_0xd8b9('0x8c')],_0x43cf36['calleridnum'],_0x2a3b6e,_0x3faff2);})['then'](function(_0x1920b6){_0x119c60=_0x1920b6;return getCall(_0x3cb7bd,_0x82e379,_0x2c4108,_0x2a3b6e,_0x119c60,_0x3faff2,_0x43cf36,'Inbound');})['then'](function(_0xc9c824){if(_0xc9c824){logger[_0xd8b9('0x34')](_0xd8b9('0x8e'),_0xc9c824['id']);}})[_0xd8b9('0x30')](function(_0x41115a){logger[_0xd8b9('0x31')]('['+_0x43cf36[_0xd8b9('0x9a')][_0xd8b9('0x9b')]()+']',JSON[_0xd8b9('0xd')](_0x41115a));});}; \ No newline at end of file +var _0x3e57=['user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','The\x20User\x20ID\x20is:','destcalleridnum','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise','util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','[HTTP]','includes','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','refresh_token','then','catch','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','contact','Contacts','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x29ac6b,_0x184514){var _0x44a29b=function(_0x2dad03){while(--_0x2dad03){_0x29ac6b['push'](_0x29ac6b['shift']());}};_0x44a29b(++_0x184514);}(_0x3e57,0x1d1));var _0x73e5=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x3e57[_0x4d674b];return _0x535a1f;};'use strict';var _=require(_0x73e5('0x0'));var rp=require(_0x73e5('0x1'));var md5=require('md5');var util=require(_0x73e5('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x73e5('0x3'));var BPromise=require(_0x73e5('0x4'));var config=require(_0x73e5('0x5'));var logger=require('../../../../config/logger')(_0x73e5('0x6'));config[_0x73e5('0x7')]=_[_0x73e5('0x8')](config[_0x73e5('0x7')],{'host':_0x73e5('0x9'),'port':0x18eb});var io=require(_0x73e5('0xa'))(new Redis(config[_0x73e5('0x7')]));function emit(_0x2df2d0,_0x27afbe,_0x1c8e4c){io['to'](_0x2df2d0)['emit'](_0x27afbe,_0x1c8e4c);}function request(_0x2ce858){logger['debug'](_0x73e5('0xb'),JSON['stringify'](_0x2ce858));return rp(_0x2ce858);}function getCustomFields(_0x40a69d,_0x58389a){var _0x164117={};if(_0x40a69d['length']>0x0){_['forEach'](_0x40a69d,function(_0x52c383){if(_[_0x73e5('0xc')](['string','picklist'],_0x52c383['type'])&&_0x52c383['idField']){_0x164117[_0x52c383[_0x73e5('0xd')]]=_0x52c383[_0x73e5('0xe')][_0x73e5('0xf')]();}else if(_0x52c383[_0x73e5('0x10')]==='variable'&&_0x52c383[_0x73e5('0x11')]&&_0x52c383[_0x73e5('0xd')]&&_0x58389a[_0x52c383['variableName']]){_0x164117[_0x52c383[_0x73e5('0xd')]]=_0x58389a[_0x52c383['variableName']][_0x73e5('0xf')]();}else if(_0x52c383[_0x73e5('0x10')]===_0x73e5('0x12')&&_0x52c383[_0x73e5('0x13')]&&_0x52c383[_0x73e5('0x13')]['name']&&_0x52c383['idField']&&_0x58389a[_0x52c383[_0x73e5('0x13')][_0x73e5('0x14')][_0x73e5('0x15')]()]){_0x164117[_0x52c383[_0x73e5('0xd')]]=_0x58389a[_0x52c383[_0x73e5('0x13')][_0x73e5('0x14')][_0x73e5('0x15')]()][_0x73e5('0xf')]();}});}return _0x164117;}function getName(_0x232d39){if(_0x232d39[_0x73e5('0x16')]('\x20')>0x0){var _0x4db8e3=_0x232d39[_0x73e5('0x17')](/ (.+)/);if(_0x4db8e3[0x1]){return _0x4db8e3;}}return[_0x232d39,_0x232d39];}var accountsTokens={};function getAccessToken(_0x26ee4e){return new Promise(function(_0x82dd87,_0x25a436){if(!_[_0x73e5('0x18')](accountsTokens[_0x26ee4e['id']])&&!_[_0x73e5('0x18')](accountsTokens[_0x26ee4e['id']][_0x73e5('0x19')])){if(moment()[_0x73e5('0x1a')](accountsTokens[_0x26ee4e['id']][_0x73e5('0x1b')])){_0x82dd87(accountsTokens[_0x26ee4e['id']][_0x73e5('0x19')]);}}var _0x94459;switch(_0x26ee4e[_0x73e5('0x1c')]){case'US':_0x94459=_0x73e5('0x1d');break;case'AU':_0x94459=_0x73e5('0x1e');break;case'EU':_0x94459=_0x73e5('0x1f');break;case'IN':_0x94459=_0x73e5('0x20');break;case'CN':_0x94459=_0x73e5('0x21');break;default:_0x94459=_0x73e5('0x1f');break;}var _0x168826={'method':_0x73e5('0x22'),'uri':_0x94459+'/oauth/v2/token','qs':{'refresh_token':_0x26ee4e['refreshToken'],'client_id':_0x26ee4e[_0x73e5('0x23')],'client_secret':_0x26ee4e['clientSecret'],'grant_type':_0x73e5('0x24')},'json':!![]};return rp(_0x168826)[_0x73e5('0x25')](function(_0x111ba2){accountsTokens[_0x26ee4e['id']]={'access_token':_0x111ba2['access_token'],'expires_in':moment()['add'](_0x111ba2['expires_in'],'seconds')};_0x82dd87(_0x111ba2[_0x73e5('0x19')]);})[_0x73e5('0x26')](function(_0x4fe2d4){logger['error'](_0x73e5('0x27'),_0x4fe2d4['stack']);_0x25a436(_0x4fe2d4);});});}function getUser(_0x1a3236,_0x36a107,_0x4f85a5,_0x48f103){logger[_0x73e5('0x28')](_0x73e5('0x29'));return request({'method':_0x73e5('0x2a'),'uri':util[_0x73e5('0x2b')]('https://www.zohoapis.%s/crm/v2/users',_0x36a107),'qs':{'type':_0x73e5('0x2c')},'headers':{'Authorization':_0x73e5('0x2d')+_0x1a3236},'json':!![]})['then'](function(_0x3444bd){if(_0x3444bd[_0x73e5('0x2e')]){var _0x100841=-0x1;if(_[_0x73e5('0x2f')](_0x3444bd[_0x73e5('0x2e')])){if(!_[_0x73e5('0x18')](_0x48f103)){_0x100841=_[_0x73e5('0x30')](_0x3444bd[_0x73e5('0x2e')],function(_0x2bd0c8){return _0x2bd0c8[_0x73e5('0x31')]===_0x48f103;});}if(_0x100841>=0x0){logger[_0x73e5('0x28')](_0x73e5('0x32'));}else{logger[_0x73e5('0x28')]('Using\x20the\x20admin\x20account!');_0x100841=_[_0x73e5('0x30')](_0x3444bd['users'],function(_0x48b42c){return _0x48b42c[_0x73e5('0x33')][_0x73e5('0x14')]===_0x73e5('0x34');});}return _0x3444bd[_0x73e5('0x2e')][_0x100841];}else{if(_0x3444bd[_0x73e5('0x35')]['profile'][_0x73e5('0x14')]===_0x73e5('0x34')){logger['info'](_0x73e5('0x36'));user=_0x3444bd[_0x73e5('0x35')];return user;}else{logger[_0x73e5('0x37')](_0x73e5('0x38'),JSON[_0x73e5('0x39')](_0x3444bd));throw new Error(_0x73e5('0x3a')+JSON[_0x73e5('0x39')](_0x3444bd));}}}else{logger[_0x73e5('0x37')](_0x73e5('0x38'),JSON['stringify'](_0x3444bd));throw new Error(_0x73e5('0x3a')+JSON[_0x73e5('0x39')](_0x3444bd));}})[_0x73e5('0x26')](function(_0x1716f9){console[_0x73e5('0x37')](_0x1716f9);});}function getZohoUser(_0x2e2d54,_0x520764){return new BPromise(function(_0x4fae42,_0x2b2577){request(_0x2e2d54)[_0x73e5('0x25')](function(_0x4f944){var _0x3ea41a=null;if(_0x4f944){_0x3ea41a=_0x4f944[_0x73e5('0x3b')][0x0];_0x3ea41a[_0x73e5('0x3c')]=_0x520764;}_0x4fae42(_0x3ea41a);})[_0x73e5('0x26')](function(_0x49fdd4){_0x2b2577(_0x49fdd4);});});}function createEndUser(_0x3da30a,_0x3f4981,_0x1eaf53,_0x76990f,_0x58c409,_0xc6a1){var _0x1eaf53=getName(_0x1eaf53);return request({'method':_0x73e5('0x22'),'uri':'https://www.zohoapis.'+_0x3f4981+_0x73e5('0x3d')+_[_0x73e5('0x3e')](_0xc6a1[_0x73e5('0x3f')])+'s','body':{'data':[{'Last_Name':_0x1eaf53[0x1],'First_Name':_0x1eaf53[0x0],'Phone':_0x76990f,'Owner':{'name':!_[_0x73e5('0x18')](_0x58c409['role'][_0x73e5('0x14')])?_0x58c409[_0x73e5('0x40')][_0x73e5('0x14')]:!_['isNil'](_0x58c409[_0x73e5('0x41')])?_0x58c409[_0x73e5('0x41')]+'\x20'+_0x58c409[_0x73e5('0x42')]:_0x58c409[_0x73e5('0x42')],'id':_0x58c409['id']}}]},'headers':{'Authorization':_0x73e5('0x2d')+_0x3da30a},'json':!![]})[_0x73e5('0x25')](function(_0xed6bc9){if(_0xed6bc9&&_0xed6bc9[_0x73e5('0x3b')][0x0][_0x73e5('0x43')]===_0x73e5('0x44')){var _0x14a876=_0xed6bc9[_0x73e5('0x3b')][0x0][_0x73e5('0x45')];_0x14a876[_0x73e5('0x3c')]=_[_0x73e5('0x3e')](_0xc6a1[_0x73e5('0x3f')])+'s';return _0x14a876;}logger[_0x73e5('0x37')](_0x73e5('0x38'),JSON[_0x73e5('0x39')](data));throw new Error('Error:\x20'+JSON[_0x73e5('0x39')](data));})[_0x73e5('0x26')](function(_0x5a9a61){console[_0x73e5('0x46')](_0x73e5('0x47'),_0x5a9a61);});}function getEndUser(_0x85dd2c,_0x1e33ad,_0x3cd453,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7){var _0x499aab={'method':_0x73e5('0x2a'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x85dd2c},'json':!![]};switch(_0xb21ca7['moduleSearch']){case _0x73e5('0x48'):_0x499aab[_0x73e5('0x49')]=_0x73e5('0x4a')+_0x1e33ad+_0x73e5('0x4b')+_0xb5b2b7+'))';return getZohoUser(_0x499aab,'Contacts')[_0x73e5('0x25')](function(_0x28fc26){if(_0x28fc26)return _0x28fc26;_0x499aab[_0x73e5('0x49')]=_0x73e5('0x4a')+_0x1e33ad+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xb5b2b7+'))';return getZohoUser(_0x499aab,'Leads')[_0x73e5('0x25')](function(_0xa480ba){if(_0xa480ba)return _0xa480ba;if(_0xb21ca7[_0x73e5('0x3f')]!=_0x73e5('0x4c')){return createEndUser(_0x85dd2c,_0x1e33ad,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7);}else{return{};}});});break;case _0x73e5('0x4d'):_0x499aab['uri']='https://www.zohoapis.'+_0x1e33ad+_0x73e5('0x4b')+_0xb5b2b7+'))';return getZohoUser(_0x499aab,_0x73e5('0x4e'))[_0x73e5('0x25')](function(_0x531d95){if(_0x531d95)return _0x531d95;if(_0xb21ca7[_0x73e5('0x3f')]!=_0x73e5('0x4c')){return createEndUser(_0x85dd2c,_0x1e33ad,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7);}else{return{};}});break;case _0x73e5('0x4f'):_0x499aab['uri']=_0x73e5('0x4a')+_0x1e33ad+_0x73e5('0x50')+_0xb5b2b7+'))';return getZohoUser(_0x499aab,_0x73e5('0x51'))['then'](function(_0x6e71f2){if(_0x6e71f2)return _0x6e71f2;if(_0xb21ca7['moduleCreate']!='nothing'){return createEndUser(_0x85dd2c,_0x1e33ad,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7);}else{return{};}});break;}}function getCall(_0x323ab7,_0x3c3599,_0x1cbdc0,_0x39dde9,_0xae8aad,_0x2c06ca,_0x1e0069,_0x159c5e){logger[_0x73e5('0x28')]('Creating\x20new\x20call...');var _0x1a549e={};_0x1a549e[_0x73e5('0x52')]={'name':!_['isNil'](_0x39dde9[_0x73e5('0x40')][_0x73e5('0x14')])&&!_[_0x73e5('0x18')](_0x39dde9[_0x73e5('0x33')]['name'])&&_0x39dde9[_0x73e5('0x33')]['name']===_0x73e5('0x53')?_0x39dde9[_0x73e5('0x40')][_0x73e5('0x14')]:!_[_0x73e5('0x18')](_0x39dde9[_0x73e5('0x41')])?_0x39dde9[_0x73e5('0x41')]+'\x20'+_0x39dde9[_0x73e5('0x42')]:_0x39dde9[_0x73e5('0x42')],'id':_0x39dde9['id']};_0x1a549e[_0x73e5('0x54')]=intUtil[_0x73e5('0x55')](_0x2c06ca[_0x73e5('0x56')],_0x1e0069,'\x20');_0x1a549e[_0x73e5('0x57')]=intUtil[_0x73e5('0x55')](_0x2c06ca[_0x73e5('0x58')],_0x1e0069,'\x0a');if(_0xae8aad[_0x73e5('0x3c')]===_0x73e5('0x4e')){_0x1a549e['Who_Id']={'name':!_[_0x73e5('0x18')](_0xae8aad['Full_Name'])?_0xae8aad[_0x73e5('0x59')]:!_[_0x73e5('0x18')](_0xae8aad[_0x73e5('0x5a')])?_0xae8aad[_0x73e5('0x5a')]+'\x20'+_0xae8aad[_0x73e5('0x5b')]:_0xae8aad[_0x73e5('0x5b')],'id':_0xae8aad['id']};}if(_0xae8aad[_0x73e5('0x3c')]===_0x73e5('0x51')){_0x1a549e[_0x73e5('0x5c')]={'name':!_[_0x73e5('0x18')](_0xae8aad[_0x73e5('0x59')])?_0xae8aad[_0x73e5('0x59')]:!_[_0x73e5('0x18')](_0xae8aad[_0x73e5('0x5a')])?_0xae8aad[_0x73e5('0x5a')]+'\x20'+_0xae8aad['Last_Name']:_0xae8aad['Last_Name'],'id':_0xae8aad['id']};_0x1a549e[_0x73e5('0x5d')]=_[_0x73e5('0x3e')](_0xae8aad[_0x73e5('0x3c')]);}if(_0x1e0069['talktime']){_0x1a549e['Call_Duration']=moment[_0x73e5('0x5e')](parseInt(_0x1e0069['talktime'])*0x3e8)[_0x73e5('0x2b')](_0x73e5('0x5f'));}else if(_0x1e0069[_0x73e5('0x60')]&&_0x1e0069[_0x73e5('0x61')]){_0x1a549e['Call_Duration']=moment[_0x73e5('0x5e')](moment(_0x1e0069[_0x73e5('0x61')],_0x73e5('0x62'))['diff'](moment(_0x1e0069['starttime'],_0x73e5('0x62'))))[_0x73e5('0x2b')]('mm:ss');}switch(_0x1e0069[_0x73e5('0x63')]){case _0x73e5('0x64'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x66');break;case _0x73e5('0x67'):case _0x73e5('0x68'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x69');break;case _0x73e5('0x6a'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x6b');break;case _0x73e5('0x6c'):_0x1a549e['Call_Result']=_0x73e5('0x6d');break;case _0x73e5('0x6e'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x6f');default:}_0x1a549e['Call_Start_Time']=(_0x159c5e===_0x73e5('0x70')?moment(_0x1e0069[_0x73e5('0x71')])[_0x73e5('0x2b')](_0x73e5('0x62')):moment(_0x1e0069[_0x73e5('0x72')])[_0x73e5('0x2b')](_0x73e5('0x62')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x1a549e[_0x73e5('0x73')]=_0x159c5e||_0x73e5('0x74');_0x1a549e=_[_0x73e5('0x75')](_0x1a549e,getCustomFields(_0x2c06ca[_0x73e5('0x76')],_0x1e0069));return request({'method':_0x73e5('0x22'),'uri':'https://www.zohoapis.'+_0x3c3599+_0x73e5('0x77'),'headers':{'Authorization':_0x73e5('0x2d')+_0x323ab7},'body':{'data':[_0x1a549e]},'json':!![]})[_0x73e5('0x25')](function(_0x21da78){if(_0x21da78&&_0x21da78[_0x73e5('0x3b')][0x0]['code']===_0x73e5('0x44')){logger['info'](_0x73e5('0x78'));return{'id':_0x21da78[_0x73e5('0x3b')][0x0][_0x73e5('0x45')]['id']};}})[_0x73e5('0x26')](function(_0xb4fe02){logger[_0x73e5('0x28')](_0x73e5('0x79'),_0xb4fe02[_0x73e5('0x7a')]);console[_0x73e5('0x46')](_0x73e5('0x79'),_0xb4fe02);});}exports[_0x73e5('0x7b')]=function(_0x59ab91,_0x21590e,_0x3b140a,_0x1463dd,_0x4951b7,_0x57d4e0){var _0x85eaae,_0x381c35,_0x1370fa;_0x57d4e0['host']=intUtil['stripTrailingSlash'](_0x57d4e0[_0x73e5('0x7c')]);_0x57d4e0[_0x73e5('0x7d')]=intUtil[_0x73e5('0x7e')](_0x57d4e0[_0x73e5('0x7d')]);if(_0x4951b7&&_0x4951b7[_0x73e5('0x7f')]){logger[_0x73e5('0x28')](_0x73e5('0x80'),_0x73e5('0x81'));_0x21590e[_0x73e5('0x82')]=_0x57d4e0['serverUrl']+'/api/voice/recordings/'+_0x21590e['uniqueid']+_0x73e5('0x83')+md5(_0x21590e[_0x73e5('0x84')]);}else{_0x21590e['recordingURL']='';}var _0x45be0d=_0x57d4e0[_0x73e5('0x7c')]===_0x73e5('0x85')?'eu':_0x73e5('0x86');return getAccessToken(_0x57d4e0)['then'](function(_0xdd6a9e){_0x1370fa=_0xdd6a9e;return getUser(_0x1370fa,_0x45be0d,_0x57d4e0,_0x1463dd[_0x73e5('0x31')]);})[_0x73e5('0x25')](function(_0x338dab){_0x85eaae=_0x338dab;logger[_0x73e5('0x28')]('The\x20User\x20ID\x20is:',_0x85eaae['id']);return getEndUser(_0x1370fa,_0x45be0d,_0x57d4e0,_0x21590e[_0x73e5('0x87')],_0x21590e[_0x73e5('0x88')],_0x85eaae,_0x3b140a);})[_0x73e5('0x25')](function(_0x1f97d3){_0x381c35=_0x1f97d3;return getCall(_0x1370fa,_0x45be0d,_0x57d4e0,_0x85eaae,_0x381c35,_0x3b140a,_0x21590e,'Inbound');})[_0x73e5('0x25')](function(_0xfe38c7){if(_0xfe38c7){logger['info'](_0x73e5('0x89'),_0xfe38c7['id']);logger[_0x73e5('0x28')](_0x73e5('0x80'),_0x73e5('0x8a'));emit(util[_0x73e5('0x2b')](_0x73e5('0x8b'),_0x1463dd[_0x73e5('0x14')]),_0x73e5('0x8c'),{'uri':_0x73e5('0x8d')+_0x57d4e0['host']+'/crm/EntityInfo.do?module=Calls&id='+_0xfe38c7['id']});}})['catch'](function(_0xedd9c1){logger[_0x73e5('0x37')](_0x73e5('0x80'),JSON[_0x73e5('0x39')](_0xedd9c1));});};exports[_0x73e5('0x70')]=function(_0xb4d989,_0x2c9bb9,_0x20b6b0,_0x566a27,_0x559c16,_0x17231e,_0x4eddb1){var _0x54827b,_0xf7e10a,_0x164fbd;_0x17231e['host']=intUtil['stripTrailingSlash'](_0x17231e['host']);_0x17231e['serverUrl']=intUtil[_0x73e5('0x7e')](_0x17231e['serverUrl']);if(_0x4eddb1&&_0x4eddb1[_0x73e5('0x8e')]&&_0x4eddb1[_0x73e5('0x8e')]!==_0x73e5('0x8f')){logger[_0x73e5('0x28')](_0x73e5('0x90'),'Recording\x20is\x20enabled!');_0x2c9bb9[_0x73e5('0x82')]=_0x17231e[_0x73e5('0x7d')]+_0x73e5('0x91')+_0x2c9bb9['uniqueid']+_0x73e5('0x83')+md5(_0x2c9bb9[_0x73e5('0x84')]);}var _0x131fe6=_0x17231e[_0x73e5('0x7c')]===_0x73e5('0x85')?'eu':_0x73e5('0x86');return getAccessToken(_0x17231e)[_0x73e5('0x25')](function(_0x11e31d){_0x164fbd=_0x11e31d;return getUser(_0x164fbd,_0x131fe6,_0x17231e,_0x566a27[_0x73e5('0x31')]);})[_0x73e5('0x25')](function(_0x10924a){_0x54827b=_0x10924a;logger[_0x73e5('0x28')](_0x73e5('0x92'),_0x54827b['id']);return getEndUser(_0x164fbd,_0x131fe6,_0x17231e,_0x2c9bb9['destcalleridname'],_0x2c9bb9[_0x73e5('0x93')],_0x54827b,_0x20b6b0);})[_0x73e5('0x25')](function(_0x1baaaa){_0xf7e10a=_0x1baaaa;return getCall(_0x164fbd,_0x131fe6,_0x17231e,_0x54827b,_0xf7e10a,_0x20b6b0,_0x2c9bb9,'Outbound');})[_0x73e5('0x25')](function(_0x2d0317){if(_0x2d0317){logger[_0x73e5('0x28')](_0x73e5('0x89'),_0x2d0317['id']);logger['info'](_0x73e5('0x90'),_0x73e5('0x8a'));emit(util[_0x73e5('0x2b')](_0x73e5('0x8b'),_0x566a27[_0x73e5('0x14')]),_0x73e5('0x8c'),{'uri':_0x73e5('0x8d')+_0x17231e[_0x73e5('0x7c')]+_0x73e5('0x94')+_0x2d0317['id']});}})[_0x73e5('0x26')](function(_0x5a4ce9){logger[_0x73e5('0x37')](_0x73e5('0x90'),JSON[_0x73e5('0x39')](_0x5a4ce9));});};exports[_0x73e5('0x95')]=function(_0x1fc1af,_0x97e4dc,_0x1b1b4d,_0x5db1db,_0x465fc1,_0x16a046){var _0xd8b345,_0x1e527e,_0x1f9780;_0x16a046[_0x73e5('0x7c')]=intUtil[_0x73e5('0x7e')](_0x16a046[_0x73e5('0x7c')]);_0x16a046[_0x73e5('0x7d')]=intUtil[_0x73e5('0x7e')](_0x16a046[_0x73e5('0x7d')]);if(_0x465fc1&&_0x465fc1[_0x73e5('0x7f')]){logger[_0x73e5('0x28')]('['+_0x97e4dc['lastevent'][_0x73e5('0x96')]()+']','Recording\x20is\x20enabled!');_0x97e4dc['recordingURL']=_0x16a046[_0x73e5('0x7d')]+_0x73e5('0x91')+_0x97e4dc[_0x73e5('0x84')]+_0x73e5('0x83')+md5(_0x97e4dc[_0x73e5('0x84')]);}else{_0x97e4dc['recordingURL']='';}var _0x3d3836=_0x16a046[_0x73e5('0x7c')]===_0x73e5('0x85')?'eu':'com';return getAccessToken(_0x16a046)['then'](function(_0x37beb7){_0x1f9780=_0x37beb7;return getUser(_0x1f9780,_0x3d3836,_0x16a046);})[_0x73e5('0x25')](function(_0x4ec497){_0xd8b345=_0x4ec497;logger[_0x73e5('0x28')](_0x73e5('0x92'),_0xd8b345['id']);return getEndUser(_0x1f9780,_0x3d3836,_0x16a046,_0x97e4dc[_0x73e5('0x87')],_0x97e4dc['calleridnum'],_0xd8b345,_0x1b1b4d);})[_0x73e5('0x25')](function(_0x190cc2){_0x1e527e=_0x190cc2;return getCall(_0x1f9780,_0x3d3836,_0x16a046,_0xd8b345,_0x1e527e,_0x1b1b4d,_0x97e4dc,_0x73e5('0x74'));})[_0x73e5('0x25')](function(_0x59395c){if(_0x59395c){logger[_0x73e5('0x28')]('The\x20Call\x20ID\x20is:',_0x59395c['id']);}})['catch'](function(_0x37eac3){logger[_0x73e5('0x37')]('['+_0x97e4dc['lastevent'][_0x73e5('0x96')]()+']',JSON['stringify'](_0x37eac3));});}; \ 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 75ac0c8..f72891b 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 _0x614b=['../../../../config/logger','trigger','data2','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x614b,0x167));var _0xb614=function(_0x3458c2,_0x1aa0d8){_0x3458c2=_0x3458c2-0x0;var _0x22cdde=_0x614b[_0x3458c2];return _0x22cdde;};'use strict';var util=require('util');var sh=require(_0xb614('0x0'));var Mustache=require('mustache');var logger=require(_0xb614('0x1'))(_0xb614('0x2'));exports['exec']=function(_0x6140f8,_0x596de3){var _0x370265=_0x6140f8[_0xb614('0x3')]?_0x6140f8[_0xb614('0x3')]:'Script';var _0xcdd6c4=_0x6140f8[_0xb614('0x4')]?Mustache[_0xb614('0x5')](_0x6140f8['data3'],_0x596de3):_0x596de3;sh['exec'](_0xcdd6c4,function(_0x28939f,_0x2d66d9,_0x45b481){if(_0x28939f!==0x0){logger[_0xb614('0x6')](util['format'](_0xb614('0x7'),_0x370265,_0xcdd6c4,_0x28939f,_0x45b481));}else{logger['info'](util[_0xb614('0x8')](_0xb614('0x9'),_0x370265,_0xcdd6c4,_0x2d66d9));}});}; \ No newline at end of file +var _0x2d46=['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','shelljs','mustache','../../../../config/logger','exec','Script','data3'];(function(_0x193106,_0x4a6ae3){var _0x3a5c47=function(_0x26beb8){while(--_0x26beb8){_0x193106['push'](_0x193106['shift']());}};_0x3a5c47(++_0x4a6ae3);}(_0x2d46,0xbc));var _0x62d4=function(_0x475c4b,_0x5eaf4c){_0x475c4b=_0x475c4b-0x0;var _0x44de4f=_0x2d46[_0x475c4b];return _0x44de4f;};'use strict';var util=require(_0x62d4('0x0'));var sh=require(_0x62d4('0x1'));var Mustache=require(_0x62d4('0x2'));var logger=require(_0x62d4('0x3'))('trigger');exports[_0x62d4('0x4')]=function(_0x8e807a,_0xd74e79){var _0x3a6af7=_0x8e807a['data2']?_0x8e807a['data2']:_0x62d4('0x5');var _0x30281d=_0x8e807a[_0x62d4('0x6')]?Mustache[_0x62d4('0x7')](_0x8e807a['data3'],_0xd74e79):_0xd74e79;sh[_0x62d4('0x4')](_0x30281d,function(_0x5c341e,_0x219933,_0x3a70dc){if(_0x5c341e!==0x0){logger[_0x62d4('0x8')](util[_0x62d4('0x9')](_0x62d4('0xa'),_0x3a6af7,_0x30281d,_0x5c341e,_0x3a70dc));}else{logger[_0x62d4('0xb')](util[_0x62d4('0x9')](_0x62d4('0xc'),_0x3a6af7,_0x30281d,_0x219933));}});}; \ 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 69da1e7..2dd9056 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 _0x4479=['trigger','exec','toUpperCase','data5','number','headers','render','data6','stack','data1','DELETE','POST','PUT','data7','parse','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger'];(function(_0x6b888e,_0x420fed){var _0x17d0f6=function(_0x42675a){while(--_0x42675a){_0x6b888e['push'](_0x6b888e['shift']());}};_0x17d0f6(++_0x420fed);}(_0x4479,0x137));var _0x9447=function(_0x871180,_0x2dd5c7){_0x871180=_0x871180-0x0;var _0x1cc834=_0x4479[_0x871180];return _0x1cc834;};'use strict';var rp=require(_0x9447('0x0'));var util=require(_0x9447('0x1'));var _=require(_0x9447('0x2'));var Mustache=require('mustache');var logger=require(_0x9447('0x3'))(_0x9447('0x4'));exports[_0x9447('0x5')]=function(_0x3daf34,_0x19a7a3){var _0x2e0c2b,_0x30e923;var _0x9cc80a={'method':_0x3daf34['data1'][_0x9447('0x6')](),'uri':Mustache['render'](_0x3daf34['data2'],_0x19a7a3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3daf34[_0x9447('0x7')])===_0x9447('0x8')&&parseInt(_0x3daf34['data5'])>=0x1&&parseInt(_0x3daf34[_0x9447('0x7')])<=0xa?parseInt(_0x3daf34[_0x9447('0x7')])*0x3e8:0x5*0x3e8};try{_0x9cc80a[_0x9447('0x9')]=_0x3daf34['data6']?JSON['parse'](Mustache[_0x9447('0xa')](_0x3daf34[_0x9447('0xb')],_0x19a7a3)):{};}catch(_0x4fcdcb){logger['error'](_0x4fcdcb[_0x9447('0xc')]);}switch(_0x3daf34[_0x9447('0xd')][_0x9447('0x6')]()){case'GET':case _0x9447('0xe'):_0x2e0c2b=null;_0x9cc80a['qs']=_0x19a7a3;break;case _0x9447('0xf'):case _0x9447('0x10'):if(_0x3daf34[_0x9447('0x11')]){try{_0x2e0c2b=JSON[_0x9447('0x12')](Mustache['render'](_0x3daf34[_0x9447('0x11')],_0x19a7a3));_0x9cc80a[_0x9447('0x13')]=_0x2e0c2b;}catch(_0x47f494){logger['error'](_0x47f494[_0x9447('0xc')]);logger[_0x9447('0x14')](_0x9447('0x15'));}}else{_0x2e0c2b=_0x19a7a3;_0x9cc80a[_0x9447('0x13')]=_0x2e0c2b;}break;}logger[_0x9447('0x16')](util[_0x9447('0x17')](_0x9447('0x18'),_0x3daf34[_0x9447('0xd')],_0x3daf34[_0x9447('0x19')],JSON[_0x9447('0x1a')](_0x9cc80a)));rp(_0x9cc80a)[_0x9447('0x1b')](function(_0x230189){_0x2e0c2b=!_[_0x9447('0x1c')](_0x2e0c2b)?_0x9447('0x1d')+_0x2e0c2b:'';_0x30e923=typeof _0x230189[_0x9447('0x13')]===_0x9447('0x1e')?JSON['stringify'](_0x230189[_0x9447('0x13')]):_0x230189[_0x9447('0x13')];logger[_0x9447('0x16')](util[_0x9447('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3daf34[_0x9447('0xd')],_0x3daf34['data2'],_0x230189['statusCode'],_0x30e923));})[_0x9447('0x1f')](function(_0x110a08){logger['error'](util['format'](_0x9447('0x20'),_0x3daf34[_0x9447('0xd')],_0x3daf34[_0x9447('0x19')],_0x110a08[_0x9447('0x21')],_0x110a08[_0x9447('0x22')],_0x110a08['message']));});}; \ No newline at end of file +var _0xdc9e=['name','message','request-promise','util','lodash','../../../../config/logger','trigger','exec','toUpperCase','render','data2','number','data5','headers','data6','parse','error','stack','data1','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','body','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode'];(function(_0x22ca63,_0xd263ec){var _0xadc6dc=function(_0x4cd069){while(--_0x4cd069){_0x22ca63['push'](_0x22ca63['shift']());}};_0xadc6dc(++_0xd263ec);}(_0xdc9e,0x13d));var _0xedc9=function(_0x3062a2,_0x53173f){_0x3062a2=_0x3062a2-0x0;var _0x1958b3=_0xdc9e[_0x3062a2];return _0x1958b3;};'use strict';var rp=require(_0xedc9('0x0'));var util=require(_0xedc9('0x1'));var _=require(_0xedc9('0x2'));var Mustache=require('mustache');var logger=require(_0xedc9('0x3'))(_0xedc9('0x4'));exports[_0xedc9('0x5')]=function(_0x3b78c3,_0x28dfe7){var _0x2779c5,_0x961bff;var _0x2ed0e8={'method':_0x3b78c3['data1'][_0xedc9('0x6')](),'uri':Mustache[_0xedc9('0x7')](_0x3b78c3[_0xedc9('0x8')],_0x28dfe7),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3b78c3['data5'])===_0xedc9('0x9')&&parseInt(_0x3b78c3[_0xedc9('0xa')])>=0x1&&parseInt(_0x3b78c3[_0xedc9('0xa')])<=0xa?parseInt(_0x3b78c3[_0xedc9('0xa')])*0x3e8:0x5*0x3e8};try{_0x2ed0e8[_0xedc9('0xb')]=_0x3b78c3[_0xedc9('0xc')]?JSON[_0xedc9('0xd')](Mustache[_0xedc9('0x7')](_0x3b78c3[_0xedc9('0xc')],_0x28dfe7)):{};}catch(_0x2953f5){logger[_0xedc9('0xe')](_0x2953f5[_0xedc9('0xf')]);}switch(_0x3b78c3[_0xedc9('0x10')]['toUpperCase']()){case'GET':case _0xedc9('0x11'):_0x2779c5=null;_0x2ed0e8['qs']=_0x28dfe7;break;case _0xedc9('0x12'):case _0xedc9('0x13'):if(_0x3b78c3[_0xedc9('0x14')]){try{_0x2779c5=JSON['parse'](Mustache[_0xedc9('0x7')](_0x3b78c3[_0xedc9('0x14')],_0x28dfe7));_0x2ed0e8['body']=_0x2779c5;}catch(_0x34d878){logger['error'](_0x34d878[_0xedc9('0xf')]);logger[_0xedc9('0xe')](_0xedc9('0x15'));}}else{_0x2779c5=_0x28dfe7;_0x2ed0e8['body']=_0x2779c5;}break;}logger[_0xedc9('0x16')](util[_0xedc9('0x17')](_0xedc9('0x18'),_0x3b78c3['data1'],_0x3b78c3['data2'],JSON['stringify'](_0x2ed0e8)));rp(_0x2ed0e8)[_0xedc9('0x19')](function(_0x148db0){_0x2779c5=!_[_0xedc9('0x1a')](_0x2779c5)?',\x20request\x20body:\x20'+_0x2779c5:'';_0x961bff=typeof _0x148db0[_0xedc9('0x1b')]===_0xedc9('0x1c')?JSON['stringify'](_0x148db0['body']):_0x148db0[_0xedc9('0x1b')];logger[_0xedc9('0x16')](util['format'](_0xedc9('0x1d'),_0x3b78c3[_0xedc9('0x10')],_0x3b78c3['data2'],_0x148db0['statusCode'],_0x961bff));})[_0xedc9('0x1e')](function(_0x1921fa){logger[_0xedc9('0xe')](util[_0xedc9('0x17')](_0xedc9('0x1f'),_0x3b78c3[_0xedc9('0x10')],_0x3b78c3[_0xedc9('0x8')],_0x1921fa[_0xedc9('0x20')],_0x1921fa[_0xedc9('0x21')],_0x1921fa[_0xedc9('0x22')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d092a65..175bc42 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 _0x7f63=['bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc','error','message','catch','jayson/promise'];(function(_0x1ddfbd,_0xfa4d97){var _0x2469b8=function(_0x300e90){while(--_0x300e90){_0x1ddfbd['push'](_0x1ddfbd['shift']());}};_0x2469b8(++_0xfa4d97);}(_0x7f63,0xcf));var _0x37f6=function(_0x46531,_0x4fc16f){_0x46531=_0x46531-0x0;var _0x58617b=_0x7f63[_0x46531];return _0x58617b;};'use strict';var jayson=require(_0x37f6('0x0'));var BPromise=require(_0x37f6('0x1'));var logger=require(_0x37f6('0x2'))(_0x37f6('0x3'));var client=jayson['client'][_0x37f6('0x4')]({'port':0x2329});client[_0x37f6('0x5')]=function(_0x2230cc,_0x26bd36){return new BPromise(function(_0x25be96,_0x57cfc6){return client[_0x37f6('0x6')](_0x2230cc,_0x26bd36)[_0x37f6('0x7')](function(_0x42b9b8){logger[_0x37f6('0x8')](_0x37f6('0x9'),'routing',_0x2230cc,_0x26bd36,_0x42b9b8);if(_0x42b9b8[_0x37f6('0xa')]){logger['error'](_0x37f6('0x9'),'routing',_0x2230cc,_0x42b9b8[_0x37f6('0xa')][_0x37f6('0xb')],_0x26bd36);return _0x57cfc6(_0x42b9b8[_0x37f6('0xa')][_0x37f6('0xb')]);}else{return _0x25be96(_0x42b9b8['result']);}})[_0x37f6('0xc')](function(_0x35f37b){logger[_0x37f6('0xa')](_0x37f6('0x9'),_0x37f6('0x3'),_0x2230cc,_0x35f37b,_0x26bd36);return _0x57cfc6(_0x35f37b);});});};module['exports']=client; \ No newline at end of file +var _0x4d50=['routing','client','http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x2304a6,_0x4f18d9){var _0x2b2cd8=function(_0x297664){while(--_0x297664){_0x2304a6['push'](_0x2304a6['shift']());}};_0x2b2cd8(++_0x4f18d9);}(_0x4d50,0x84));var _0x04d5=function(_0x5d833a,_0x5e5e5c){_0x5d833a=_0x5d833a-0x0;var _0x37c29d=_0x4d50[_0x5d833a];return _0x37c29d;};'use strict';var jayson=require(_0x04d5('0x0'));var BPromise=require(_0x04d5('0x1'));var logger=require(_0x04d5('0x2'))(_0x04d5('0x3'));var client=jayson[_0x04d5('0x4')][_0x04d5('0x5')]({'port':0x2329});client['Request']=function(_0x59277a,_0x1ac3f6){return new BPromise(function(_0x525162,_0x2fe547){return client[_0x04d5('0x6')](_0x59277a,_0x1ac3f6)[_0x04d5('0x7')](function(_0x350b89){logger[_0x04d5('0x8')](_0x04d5('0x9'),_0x04d5('0x3'),_0x59277a,_0x1ac3f6,_0x350b89);if(_0x350b89[_0x04d5('0xa')]){logger['error'](_0x04d5('0x9'),_0x04d5('0x3'),_0x59277a,_0x350b89[_0x04d5('0xa')][_0x04d5('0xb')],_0x1ac3f6);return _0x2fe547(_0x350b89[_0x04d5('0xa')][_0x04d5('0xb')]);}else{return _0x525162(_0x350b89[_0x04d5('0xc')]);}})[_0x04d5('0xd')](function(_0x5d5429){logger[_0x04d5('0xa')](_0x04d5('0x9'),_0x04d5('0x3'),_0x59277a,_0x5d5429,_0x1ac3f6);return _0x2fe547(_0x5d5429);});});};module[_0x04d5('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 57b126b..1c6814c 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 _0x5fde=['loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','refresh','mailAccounts','listen'];(function(_0x48da55,_0x244ac6){var _0x1539cc=function(_0x38d212){while(--_0x38d212){_0x48da55['push'](_0x48da55['shift']());}};_0x1539cc(++_0x244ac6);}(_0x5fde,0x193));var _0xe5fd=function(_0x525ab6,_0x19c421){_0x525ab6=_0x525ab6-0x0;var _0x3c142a=_0x5fde[_0x525ab6];return _0x3c142a;};'use strict';var server=require(_0xe5fd('0x0'));var Realtime=require(_0xe5fd('0x1'));var EmailChannel=require(_0xe5fd('0x2'));var mailAccount=require(_0xe5fd('0x3'));var setting=require(_0xe5fd('0x4'));var logger=require(_0xe5fd('0x5'))(_0xe5fd('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe5fd('0x7')]()[_0xe5fd('0x8')](mailAccount[_0xe5fd('0x9')]())[_0xe5fd('0x8')](realtime['initMailAccounts']())[_0xe5fd('0x8')](function(){email[_0xe5fd('0xa')](realtime[_0xe5fd('0xb')]);return realtime;});}function main(){return server[_0xe5fd('0xc')](realtime,email)[_0xe5fd('0x8')](function(){return initRealtime();})[_0xe5fd('0x8')](function(){return setting['getSettings']();})[_0xe5fd('0x8')](function(_0x43e333){return setInterval(initRealtime,_0x43e333[_0xe5fd('0xd')]*0x3e8);})['catch'](function(_0x51b962){logger[_0xe5fd('0xe')](_0xe5fd('0xf'),_0x51b962);});}main(); \ No newline at end of file +var _0x24cf=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','refresh','listen','getSettings','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x561bf6,_0x5800e7){var _0x21df22=function(_0x14dce5){while(--_0x14dce5){_0x561bf6['push'](_0x561bf6['shift']());}};_0x21df22(++_0x5800e7);}(_0x24cf,0x6e));var _0xf24c=function(_0xe769e8,_0x1cb529){_0xe769e8=_0xe769e8-0x0;var _0x15c980=_0x24cf[_0xe769e8];return _0x15c980;};'use strict';var server=require(_0xf24c('0x0'));var Realtime=require(_0xf24c('0x1'));var EmailChannel=require(_0xf24c('0x2'));var mailAccount=require(_0xf24c('0x3'));var setting=require(_0xf24c('0x4'));var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xf24c('0x7')]()[_0xf24c('0x8')](mailAccount[_0xf24c('0x9')]())[_0xf24c('0x8')](realtime['initMailAccounts']())[_0xf24c('0x8')](function(){email[_0xf24c('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xf24c('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0xf24c('0x8')](function(){return setting[_0xf24c('0xc')]();})[_0xf24c('0x8')](function(_0x3c037c){return setInterval(initRealtime,_0x3c037c['loginMailFrequency']*0x3e8);})[_0xf24c('0xd')](function(_0x2e3e58){logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x2e3e58);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4a2f68c..d5d8e83 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 _0xac2f=['exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','Imap','status','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','active','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','notify','then','Mail\x20accepted\x20from\x20routing','catch','stringify','lastSync','sendMail','verifySmtp','Smtp','verify','verified'];(function(_0x588c33,_0xe686f7){var _0x5c639c=function(_0x128ccf){while(--_0x128ccf){_0x588c33['push'](_0x588c33['shift']());}};_0x5c639c(++_0xe686f7);}(_0xac2f,0xe1));var _0xfac2=function(_0x555afc,_0xa261bc){_0x555afc=_0x555afc-0x0;var _0x416c45=_0xac2f[_0x555afc];return _0x416c45;};'use strict';var _=require(_0xfac2('0x0'));var moment=require(_0xfac2('0x1'));var BPromise=require(_0xfac2('0x2'));var md5=require(_0xfac2('0x3'));var Redis=require(_0xfac2('0x4'));var config=require(_0xfac2('0x5'));var logger=require(_0xfac2('0x6'))(_0xfac2('0x7'));config[_0xfac2('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfac2('0x9'))(new Redis(config[_0xfac2('0x8')]));var EmailImap=require(_0xfac2('0xa'));var EmailSmtp=require(_0xfac2('0xb'));var mailAccount=require(_0xfac2('0xc'));var md5Accounts={};function EmailChannel(_0x4f504e){logger[_0xfac2('0xd')](_0xfac2('0xe'));this[_0xfac2('0xf')]=_0x4f504e['mailAccounts'];this[_0xfac2('0x10')]={};this[_0xfac2('0x11')]=new EmailSmtp();}EmailChannel[_0xfac2('0x12')][_0xfac2('0x13')]=function(_0xad7c2b){var _0x70ff46=this[_0xfac2('0xf')][_0xad7c2b];var _0x2780f6={'id':_0x70ff46['id'],'name':_0x70ff46['name'],'key':_0x70ff46['key'],'active':_0x70ff46['active'],'Imap':{'status':_0x70ff46[_0xfac2('0x14')][_0xfac2('0x15')],'messageStatus':_0x70ff46[_0xfac2('0x14')][_0xfac2('0x16')],'total':_0x70ff46[_0xfac2('0x14')][_0xfac2('0x17')]}};if(_[_0xfac2('0x18')](md5Accounts[_0xad7c2b])){md5Accounts[_0xad7c2b]={};}var _0x84c9dd=md5(JSON['stringify'](_0x2780f6));if(md5Accounts[_0xad7c2b][_0xfac2('0x3')]!==_0x84c9dd){md5Accounts[_0xad7c2b][_0xfac2('0x3')]=_0x84c9dd;io[_0xfac2('0x13')](_0xfac2('0x19'),_0x2780f6);}};EmailChannel[_0xfac2('0x12')][_0xfac2('0x1a')]=function(_0x14b1d2){for(var _0x2c3680 in _0x14b1d2){if(_0x14b1d2[_0xfac2('0x1b')](_0x2c3680)){if(_0x14b1d2[_0x2c3680][_0xfac2('0x14')]&&_0x14b1d2[_0x2c3680][_0xfac2('0x1c')]){var _0x186007=_0x14b1d2[_0x2c3680][_0xfac2('0x14')];if(!_0x186007['service']&&_0x14b1d2[_0x2c3680][_0xfac2('0x1d')]!==_0xfac2('0x1e'))_0x186007['service']=_0x14b1d2[_0x2c3680][_0xfac2('0x1d')];if(!this[_0xfac2('0x10')]['hasOwnProperty'](_0x186007['id'])){this[_0xfac2('0x10')][_0x186007['id']]=new EmailImap(_0x186007,_0x14b1d2[_0x2c3680]['email']);this[_0xfac2('0x10')][_0x186007['id']]['on'](_0xfac2('0x1f'),this[_0xfac2('0x20')][_0xfac2('0x21')](this,_0x2c3680));this['imapAccounts'][_0x186007['id']]['on'](_0xfac2('0x7'),this[_0xfac2('0x22')]['bind'](this,_0x2c3680));this['imapAccounts'][_0x186007['id']]['on'](_0xfac2('0x23'),this[_0xfac2('0x24')][_0xfac2('0x21')](this,_0x2c3680));this[_0xfac2('0x10')][_0x186007['id']]['on'](_0xfac2('0x25'),this[_0xfac2('0x26')][_0xfac2('0x21')](this,_0x2c3680));}}else{if(_[_0xfac2('0x18')](this[_0xfac2('0xf')][_0x2c3680][_0xfac2('0x14')])){this[_0xfac2('0xf')][_0x2c3680]['Imap']={};}this[_0xfac2('0xf')][_0x2c3680][_0xfac2('0x14')][_0xfac2('0x15')]=_0xfac2('0x27');this[_0xfac2('0xf')][_0x2c3680][_0xfac2('0x14')]['messageStatus']='';this[_0xfac2('0x13')](_0x2c3680);}}}};EmailChannel[_0xfac2('0x12')]['handleImapBox']=function(_0x1a5c45,_0x4bfe29){if(this[_0xfac2('0xf')][_0x1a5c45]){this[_0xfac2('0xf')][_0x1a5c45]['Imap']['status']=_0xfac2('0x28');this['mailAccounts'][_0x1a5c45][_0xfac2('0x14')][_0xfac2('0x16')]=_0x4bfe29[_0xfac2('0x29')];if(_0x4bfe29[_0xfac2('0x2a')]){this[_0xfac2('0xf')][_0x1a5c45]['Imap'][_0xfac2('0x17')]=_0x4bfe29[_0xfac2('0x2a')][_0xfac2('0x17')];}return this[_0xfac2('0x13')](_0x1a5c45);}};EmailChannel['prototype']['handleImapEmail']=function(_0x3da3b9,_0xc50393){logger[_0xfac2('0xd')](_0xfac2('0x2b'),_0xc50393['firstName'],_0xc50393['lastName'],_0xc50393['from'],_0x3da3b9);if(this[_0xfac2('0xf')][_0x3da3b9]){return mailAccount[_0xfac2('0x2c')](_0x3da3b9,_0xc50393)[_0xfac2('0x2d')](function(_0xab4954){if(_0xab4954){logger[_0xfac2('0xd')](_0xfac2('0x2e'));}})[_0xfac2('0x2f')](function(_0x590697){logger[_0xfac2('0x25')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xfac2('0x30')](_0x590697));});}};EmailChannel[_0xfac2('0x12')][_0xfac2('0x24')]=function(_0x26351c){if(this[_0xfac2('0xf')][_0x26351c]&&this[_0xfac2('0xf')][_0x26351c][_0xfac2('0x14')]){if(this[_0xfac2('0x10')][this[_0xfac2('0xf')][_0x26351c][_0xfac2('0x14')]['id']]){delete this[_0xfac2('0x10')][this[_0xfac2('0xf')][_0x26351c][_0xfac2('0x14')]['id']];}this[_0xfac2('0xf')][_0x26351c][_0xfac2('0x14')][_0xfac2('0x31')]=moment();this[_0xfac2('0x13')](_0x26351c);}};EmailChannel[_0xfac2('0x12')][_0xfac2('0x26')]=function(_0x3c86c4,_0x1dc926){if(this[_0xfac2('0xf')][_0x3c86c4]){this[_0xfac2('0xf')][_0x3c86c4][_0xfac2('0x14')][_0xfac2('0x15')]='error';this[_0xfac2('0xf')][_0x3c86c4][_0xfac2('0x14')]['messageStatus']=_0x1dc926;return this[_0xfac2('0x13')](_0x3c86c4);}};EmailChannel['prototype'][_0xfac2('0x32')]=function(_0x4297c0,_0x38e3cb){return this[_0xfac2('0x11')]['send'](_0x4297c0,_0x38e3cb);};EmailChannel[_0xfac2('0x12')][_0xfac2('0x33')]=function(_0x385228){var _0x1bab61=this;if(this['mailAccounts'][_0x385228['id']]){if(_[_0xfac2('0x18')](this[_0xfac2('0xf')][_0x385228['id']][_0xfac2('0x34')])){this['mailAccounts'][_0x385228['id']][_0xfac2('0x34')]={};}this['mailAccounts'][_0x385228['id']][_0xfac2('0x34')][_0xfac2('0x31')]=moment();return new BPromise(function(_0x4fae31,_0x51945d){return _0x1bab61[_0xfac2('0x11')][_0xfac2('0x35')](_0x385228)[_0xfac2('0x2d')](function(_0x310ca9){_0x1bab61[_0xfac2('0xf')][_0x385228['id']][_0xfac2('0x34')][_0xfac2('0x15')]=_0xfac2('0x36');_0x1bab61['mailAccounts'][_0x385228['id']][_0xfac2('0x34')]['messageStatus']='';_0x1bab61['emit'](_0x385228['id']);_0x4fae31(_0x310ca9);})['catch'](function(_0x4af845){_0x1bab61[_0xfac2('0xf')][_0x385228['id']][_0xfac2('0x34')][_0xfac2('0x15')]=_0xfac2('0x25');_0x1bab61[_0xfac2('0xf')][_0x385228['id']][_0xfac2('0x34')]['messageStatus']=_0x4af845;_0x1bab61['emit'](_0x385228['id']);_0x51945d(_0x4af845);});});}return this[_0xfac2('0x11')]['verify'](_0x385228);};module[_0xfac2('0x37')]=EmailChannel; \ No newline at end of file +var _0x4916=['lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','../../../config/environment','redis','defaults','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','email','handleImapBox','bind','handleImapEmail','end','handleImapEnd','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error'];(function(_0x3c210d,_0x52be7f){var _0x19daa4=function(_0x552568){while(--_0x552568){_0x3c210d['push'](_0x3c210d['shift']());}};_0x19daa4(++_0x52be7f);}(_0x4916,0xe5));var _0x6491=function(_0x418f69,_0x34dce9){_0x418f69=_0x418f69-0x0;var _0x512f3e=_0x4916[_0x418f69];return _0x512f3e;};'use strict';var _=require(_0x6491('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x6491('0x1'));var logger=require('../../../config/logger')('email');config[_0x6491('0x2')]=_[_0x6491('0x3')](config[_0x6491('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x6491('0x4'));var EmailSmtp=require(_0x6491('0x5'));var mailAccount=require(_0x6491('0x6'));var md5Accounts={};function EmailChannel(_0x3a6793){logger[_0x6491('0x7')]('start\x20email\x20channel');this[_0x6491('0x8')]=_0x3a6793[_0x6491('0x8')];this[_0x6491('0x9')]={};this[_0x6491('0xa')]=new EmailSmtp();}EmailChannel[_0x6491('0xb')][_0x6491('0xc')]=function(_0x33872e){var _0x5b7931=this[_0x6491('0x8')][_0x33872e];var _0x2d38e3={'id':_0x5b7931['id'],'name':_0x5b7931[_0x6491('0xd')],'key':_0x5b7931[_0x6491('0xe')],'active':_0x5b7931[_0x6491('0xf')],'Imap':{'status':_0x5b7931[_0x6491('0x10')][_0x6491('0x11')],'messageStatus':_0x5b7931['Imap'][_0x6491('0x12')],'total':_0x5b7931[_0x6491('0x10')][_0x6491('0x13')]}};if(_[_0x6491('0x14')](md5Accounts[_0x33872e])){md5Accounts[_0x33872e]={};}var _0x4f96ec=md5(JSON[_0x6491('0x15')](_0x2d38e3));if(md5Accounts[_0x33872e][_0x6491('0x16')]!==_0x4f96ec){md5Accounts[_0x33872e]['md5']=_0x4f96ec;io[_0x6491('0xc')](_0x6491('0x17'),_0x2d38e3);}};EmailChannel[_0x6491('0xb')][_0x6491('0x18')]=function(_0x49509b){for(var _0x46457e in _0x49509b){if(_0x49509b[_0x6491('0x19')](_0x46457e)){if(_0x49509b[_0x46457e][_0x6491('0x10')]&&_0x49509b[_0x46457e]['active']){var _0x2121c6=_0x49509b[_0x46457e][_0x6491('0x10')];if(!_0x2121c6[_0x6491('0x1a')]&&_0x49509b[_0x46457e][_0x6491('0x1b')]!==_0x6491('0x1c'))_0x2121c6[_0x6491('0x1a')]=_0x49509b[_0x46457e]['provider'];if(!this['imapAccounts'][_0x6491('0x19')](_0x2121c6['id'])){this['imapAccounts'][_0x2121c6['id']]=new EmailImap(_0x2121c6,_0x49509b[_0x46457e][_0x6491('0x1d')]);this['imapAccounts'][_0x2121c6['id']]['on']('box',this[_0x6491('0x1e')][_0x6491('0x1f')](this,_0x46457e));this[_0x6491('0x9')][_0x2121c6['id']]['on']('email',this[_0x6491('0x20')][_0x6491('0x1f')](this,_0x46457e));this[_0x6491('0x9')][_0x2121c6['id']]['on'](_0x6491('0x21'),this[_0x6491('0x22')]['bind'](this,_0x46457e));this['imapAccounts'][_0x2121c6['id']]['on']('error',this['handleImapError'][_0x6491('0x1f')](this,_0x46457e));}}else{if(_[_0x6491('0x14')](this[_0x6491('0x8')][_0x46457e]['Imap'])){this['mailAccounts'][_0x46457e]['Imap']={};}this['mailAccounts'][_0x46457e]['Imap'][_0x6491('0x11')]='disabled';this[_0x6491('0x8')][_0x46457e][_0x6491('0x10')][_0x6491('0x12')]='';this[_0x6491('0xc')](_0x46457e);}}}};EmailChannel[_0x6491('0xb')][_0x6491('0x1e')]=function(_0x5102e2,_0x4b7de0){if(this[_0x6491('0x8')][_0x5102e2]){this['mailAccounts'][_0x5102e2][_0x6491('0x10')]['status']=_0x6491('0x23');this[_0x6491('0x8')][_0x5102e2][_0x6491('0x10')]['messageStatus']=_0x4b7de0['name'];if(_0x4b7de0[_0x6491('0x24')]){this[_0x6491('0x8')][_0x5102e2][_0x6491('0x10')][_0x6491('0x13')]=_0x4b7de0['messages'][_0x6491('0x13')];}return this['emit'](_0x5102e2);}};EmailChannel[_0x6491('0xb')][_0x6491('0x20')]=function(_0x51142c,_0x529b06){logger[_0x6491('0x7')](_0x6491('0x25'),_0x529b06[_0x6491('0x26')],_0x529b06[_0x6491('0x27')],_0x529b06[_0x6491('0x28')],_0x51142c);if(this[_0x6491('0x8')][_0x51142c]){return mailAccount[_0x6491('0x29')](_0x51142c,_0x529b06)[_0x6491('0x2a')](function(_0x5d42a3){if(_0x5d42a3){logger[_0x6491('0x7')](_0x6491('0x2b'));}})[_0x6491('0x2c')](function(_0x25955e){logger[_0x6491('0x2d')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x6491('0x15')](_0x25955e));});}};EmailChannel[_0x6491('0xb')]['handleImapEnd']=function(_0x3e3612){if(this['mailAccounts'][_0x3e3612]&&this[_0x6491('0x8')][_0x3e3612]['Imap']){if(this[_0x6491('0x9')][this['mailAccounts'][_0x3e3612][_0x6491('0x10')]['id']]){delete this[_0x6491('0x9')][this[_0x6491('0x8')][_0x3e3612][_0x6491('0x10')]['id']];}this[_0x6491('0x8')][_0x3e3612][_0x6491('0x10')][_0x6491('0x2e')]=moment();this[_0x6491('0xc')](_0x3e3612);}};EmailChannel[_0x6491('0xb')][_0x6491('0x2f')]=function(_0x27c075,_0x90196b){if(this[_0x6491('0x8')][_0x27c075]){this[_0x6491('0x8')][_0x27c075][_0x6491('0x10')]['status']=_0x6491('0x2d');this[_0x6491('0x8')][_0x27c075][_0x6491('0x10')][_0x6491('0x12')]=_0x90196b;return this['emit'](_0x27c075);}};EmailChannel['prototype'][_0x6491('0x30')]=function(_0x273b75,_0xc064f1){return this[_0x6491('0xa')][_0x6491('0x31')](_0x273b75,_0xc064f1);};EmailChannel['prototype'][_0x6491('0x32')]=function(_0x493d5b){var _0x33134b=this;if(this[_0x6491('0x8')][_0x493d5b['id']]){if(_[_0x6491('0x14')](this[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')])){this[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')]={};}this[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')][_0x6491('0x2e')]=moment();return new BPromise(function(_0x457176,_0x28d134){return _0x33134b['smtp'][_0x6491('0x34')](_0x493d5b)[_0x6491('0x2a')](function(_0x180d06){_0x33134b[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')][_0x6491('0x11')]=_0x6491('0x35');_0x33134b['mailAccounts'][_0x493d5b['id']][_0x6491('0x33')]['messageStatus']='';_0x33134b['emit'](_0x493d5b['id']);_0x457176(_0x180d06);})[_0x6491('0x2c')](function(_0x18fcbb){_0x33134b[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')]['status']=_0x6491('0x2d');_0x33134b[_0x6491('0x8')][_0x493d5b['id']]['Smtp'][_0x6491('0x12')]=_0x18fcbb;_0x33134b[_0x6491('0xc')](_0x493d5b['id']);_0x28d134(_0x18fcbb);});});}return this['smtp'][_0x6491('0x34')](_0x493d5b);};module[_0x6491('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 8276df6..d7c707e 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 _0x83de=['bind','error','connect','inherits','prototype','connTimeout','authTimeout','user','modernAuthentication','xoauth2','CloudProvider','password','anonymous@xcally.com','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','handleError','length','fetch','message','handleFetchEnd','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','email','stringify','textCode','upperFirst','exports','lodash','util','mailparser','simpleParser','Iconv','events','EventEmitter','mailbox','account','getAccount','imap','once','end','handleEnd'];(function(_0x8a917c,_0x19c5f6){var _0x2c704e=function(_0x342f3a){while(--_0x342f3a){_0x8a917c['push'](_0x8a917c['shift']());}};_0x2c704e(++_0x19c5f6);}(_0x83de,0x18f));var _0xe83d=function(_0x2b40af,_0x31e526){_0x2b40af=_0x2b40af-0x0;var _0x5db890=_0x83de[_0x2b40af];return _0x5db890;};'use strict';var _=require(_0xe83d('0x0'));var util=require(_0xe83d('0x1'));var Imap=require('imap');var simpleParser=require(_0xe83d('0x2'))[_0xe83d('0x3')];var Iconv=require('iconv')[_0xe83d('0x4')];var EventEmitter=require(_0xe83d('0x5'))[_0xe83d('0x6')];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0xbce7fe,_0x50fe2a){this[_0xe83d('0x7')]=_0xbce7fe[_0xe83d('0x7')];this[_0xe83d('0x8')]=this[_0xe83d('0x9')](_0xbce7fe,_0x50fe2a);this[_0xe83d('0xa')]=new Imap(this[_0xe83d('0x8')]);this[_0xe83d('0xa')][_0xe83d('0xb')]('ready',this['handleReady']['bind'](this));this[_0xe83d('0xa')][_0xe83d('0xb')](_0xe83d('0xc'),this[_0xe83d('0xd')][_0xe83d('0xe')](this));this[_0xe83d('0xa')]['on'](_0xe83d('0xf'),this['handleError'][_0xe83d('0xe')](this));this[_0xe83d('0xa')][_0xe83d('0x10')]();}util[_0xe83d('0x11')](EmailImap,EventEmitter);EmailImap[_0xe83d('0x12')][_0xe83d('0x9')]=function(_0x3419f8,_0x4ec7c5){var _0x15244a={'connTimeout':_0x3419f8[_0xe83d('0x13')]?_0x3419f8['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3419f8['authTimeout']?_0x3419f8[_0xe83d('0x14')]*0x3e8:0x1388};if(_0x3419f8['service']){_0x15244a[_0xe83d('0x15')]=_0x3419f8[_0xe83d('0x15')];if(_0x3419f8[_0xe83d('0x16')]){_0x15244a[_0xe83d('0x17')]=utils['generateXOAuth2Token'](_0x3419f8[_0xe83d('0x18')]['data5'],_0x3419f8[_0xe83d('0x15')]);}else{_0x15244a['password']=_0x3419f8['password'];}}else{if(_0x3419f8['authentication']){_0x15244a[_0xe83d('0x15')]=_0x3419f8[_0xe83d('0x15')];_0x15244a['password']=_0x3419f8[_0xe83d('0x19')];}}_0x15244a['email']=_0x4ec7c5||_0x3419f8['user']||_0xe83d('0x1a');_0x15244a['host']=_0x3419f8['host'];_0x15244a[_0xe83d('0x1b')]=_0x3419f8[_0xe83d('0x1b')]||0x3e1;if(_0x3419f8['tls']){_0x15244a['tls']=!![];}else{_0x15244a[_0xe83d('0x1c')]=![];_0x15244a[_0xe83d('0x1d')]=_0xe83d('0x1e');}return _0x15244a;};EmailImap[_0xe83d('0x12')]['handleReady']=function(){this['imap'][_0xe83d('0x1f')](this['mailbox'],![],this[_0xe83d('0x20')][_0xe83d('0xe')](this));};EmailImap[_0xe83d('0x12')][_0xe83d('0x20')]=function(_0x232b03,_0x3039e6){if(_0x232b03){this['handleError'](_0x232b03,!![]);}else{this[_0xe83d('0x21')](_0xe83d('0x22'),_0x3039e6);this[_0xe83d('0x23')]();}};EmailImap['prototype'][_0xe83d('0x24')]=function(_0x1df561){if(_0x1df561){this['handleError'](_0x1df561,!![]);}else{this[_0xe83d('0xa')][_0xe83d('0xc')]();}};EmailImap[_0xe83d('0x12')][_0xe83d('0x23')]=function(){this[_0xe83d('0xa')][_0xe83d('0x25')]([_0xe83d('0x26')],this[_0xe83d('0x27')][_0xe83d('0xe')](this));};EmailImap[_0xe83d('0x12')][_0xe83d('0x27')]=function(_0x444ded,_0xff04ea){if(_0x444ded){this[_0xe83d('0x28')](_0x444ded,!![]);}else{if(_0xff04ea[_0xe83d('0x29')]){try{var _0x31228f=this[_0xe83d('0xa')][_0xe83d('0x2a')](_0xff04ea,{'bodies':'','markSeen':!![]});_0x31228f['on'](_0xe83d('0x2b'),this['handleFetchMessage']['bind'](this));_0x31228f[_0xe83d('0xb')]('error',this['handleFetchError']['bind'](this));_0x31228f[_0xe83d('0xb')](_0xe83d('0xc'),this[_0xe83d('0x2c')][_0xe83d('0xe')](this));}catch(_0x456f47){logger['error'](_0x456f47);}}else{this[_0xe83d('0xa')]['closeBox'](!![],this[_0xe83d('0x24')][_0xe83d('0xe')](this));}}};EmailImap[_0xe83d('0x12')][_0xe83d('0x2d')]=function(_0x3b8a22){_0x3b8a22['on'](_0xe83d('0x2e'),this[_0xe83d('0x2f')][_0xe83d('0xe')](this));_0x3b8a22['once'](_0xe83d('0x30'),this[_0xe83d('0x31')][_0xe83d('0xe')](this));_0x3b8a22[_0xe83d('0xb')]('end',this[_0xe83d('0x32')]['bind'](this));};EmailImap[_0xe83d('0x12')][_0xe83d('0x2f')]=function(_0x2fdc4c){simpleParser(_0x2fdc4c,{'Iconv':Iconv},this[_0xe83d('0x33')][_0xe83d('0xe')](this));};EmailImap[_0xe83d('0x12')][_0xe83d('0x31')]=function(){};EmailImap[_0xe83d('0x12')][_0xe83d('0x32')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0xaa70ff,_0xc3cf0){if(_0xaa70ff){logger[_0xe83d('0xf')](_0xaa70ff);}else{var _0xb51d41=this;utils[_0xe83d('0x34')](this[_0xe83d('0x8')],_0xc3cf0,function(_0x2c29a7){_0xb51d41['emit']('email',_0x2c29a7);});}};EmailImap['prototype'][_0xe83d('0x2c')]=function(){this[_0xe83d('0xa')]['closeBox'](!![],this[_0xe83d('0x24')][_0xe83d('0xe')](this));};EmailImap[_0xe83d('0x12')]['handleFetchError']=function(_0x2247fc){this['handleError'](_0x2247fc);this[_0xe83d('0xa')][_0xe83d('0x35')](!![],this['handleCloseBox'][_0xe83d('0xe')](this));};EmailImap[_0xe83d('0x12')][_0xe83d('0xd')]=function(){this['emit'](_0xe83d('0xc'));};EmailImap[_0xe83d('0x12')][_0xe83d('0x28')]=function(_0x1e5b73,_0x1bef39){logger[_0xe83d('0xf')]('handleError',this[_0xe83d('0x8')][_0xe83d('0x36')],JSON[_0xe83d('0x37')](_0x1e5b73));var _0x529333='';if(_0x1e5b73){if(_0x1e5b73['textCode']){_0x529333=_0x1e5b73[_0xe83d('0x38')];}else{for(var _0x14dcfc in _0x1e5b73){if(_0x1e5b73['hasOwnProperty'](_0x14dcfc)){_0x529333+=_[_0xe83d('0x39')](_0x14dcfc)+':\x20'+_0x1e5b73[_0x14dcfc]+'\x0a';}}}}if(_0x1bef39){this[_0xe83d('0xa')][_0xe83d('0xc')]();}else{this[_0xe83d('0x21')]('error',_0x529333);this[_0xe83d('0x21')](_0xe83d('0xc'));}};module[_0xe83d('0x3a')]=EmailImap; \ No newline at end of file +var _0x73bd=['handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','host','port','tls','autotls','required','openBox','handleOpenBox','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','once','handleFetchError','handleFetchEnd','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','handleReady','bind','end'];(function(_0x1d8fae,_0x55089c){var _0x12908c=function(_0x5eb27c){while(--_0x5eb27c){_0x1d8fae['push'](_0x1d8fae['shift']());}};_0x12908c(++_0x55089c);}(_0x73bd,0x1e8));var _0xd73b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x73bd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd73b('0x0'));var util=require(_0xd73b('0x1'));var Imap=require(_0xd73b('0x2'));var simpleParser=require('mailparser')[_0xd73b('0x3')];var Iconv=require(_0xd73b('0x4'))[_0xd73b('0x5')];var EventEmitter=require('events')[_0xd73b('0x6')];var utils=require(_0xd73b('0x7'));var logger=require(_0xd73b('0x8'))(_0xd73b('0x9'));function EmailImap(_0x46f13c,_0x4c9973){this[_0xd73b('0xa')]=_0x46f13c['mailbox'];this[_0xd73b('0xb')]=this[_0xd73b('0xc')](_0x46f13c,_0x4c9973);this['imap']=new Imap(this[_0xd73b('0xb')]);this[_0xd73b('0x2')]['once']('ready',this[_0xd73b('0xd')][_0xd73b('0xe')](this));this['imap']['once'](_0xd73b('0xf'),this[_0xd73b('0x10')][_0xd73b('0xe')](this));this[_0xd73b('0x2')]['on'](_0xd73b('0x11'),this[_0xd73b('0x12')][_0xd73b('0xe')](this));this[_0xd73b('0x2')][_0xd73b('0x13')]();}util[_0xd73b('0x14')](EmailImap,EventEmitter);EmailImap[_0xd73b('0x15')][_0xd73b('0xc')]=function(_0x33cc77,_0x52ae54){var _0x591d6c={'connTimeout':_0x33cc77[_0xd73b('0x16')]?_0x33cc77[_0xd73b('0x16')]*0x3e8:0x2710,'authTimeout':_0x33cc77[_0xd73b('0x17')]?_0x33cc77[_0xd73b('0x17')]*0x3e8:0x1388};if(_0x33cc77[_0xd73b('0x18')]){_0x591d6c[_0xd73b('0x19')]=_0x33cc77[_0xd73b('0x19')];if(_0x33cc77[_0xd73b('0x1a')]){_0x591d6c[_0xd73b('0x1b')]=utils[_0xd73b('0x1c')](_0x33cc77[_0xd73b('0x1d')]['data5'],_0x33cc77['user']);}else{_0x591d6c[_0xd73b('0x1e')]=_0x33cc77[_0xd73b('0x1e')];}}else{if(_0x33cc77['authentication']){_0x591d6c[_0xd73b('0x19')]=_0x33cc77[_0xd73b('0x19')];_0x591d6c[_0xd73b('0x1e')]=_0x33cc77['password'];}}_0x591d6c['email']=_0x52ae54||_0x33cc77['user']||'anonymous@xcally.com';_0x591d6c[_0xd73b('0x1f')]=_0x33cc77['host'];_0x591d6c[_0xd73b('0x20')]=_0x33cc77['port']||0x3e1;if(_0x33cc77[_0xd73b('0x21')]){_0x591d6c['tls']=!![];}else{_0x591d6c[_0xd73b('0x21')]=![];_0x591d6c[_0xd73b('0x22')]=_0xd73b('0x23');}return _0x591d6c;};EmailImap[_0xd73b('0x15')][_0xd73b('0xd')]=function(){this[_0xd73b('0x2')][_0xd73b('0x24')](this['mailbox'],![],this[_0xd73b('0x25')][_0xd73b('0xe')](this));};EmailImap[_0xd73b('0x15')][_0xd73b('0x25')]=function(_0x5ddbe2,_0x266d69){if(_0x5ddbe2){this[_0xd73b('0x12')](_0x5ddbe2,!![]);}else{this['emit'](_0xd73b('0x26'),_0x266d69);this[_0xd73b('0x27')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x1b273d){if(_0x1b273d){this[_0xd73b('0x12')](_0x1b273d,!![]);}else{this[_0xd73b('0x2')][_0xd73b('0xf')]();}};EmailImap[_0xd73b('0x15')][_0xd73b('0x27')]=function(){this[_0xd73b('0x2')][_0xd73b('0x28')]([_0xd73b('0x29')],this[_0xd73b('0x2a')]['bind'](this));};EmailImap[_0xd73b('0x15')]['handleReadUnseen']=function(_0x45db82,_0x3eb194){if(_0x45db82){this[_0xd73b('0x12')](_0x45db82,!![]);}else{if(_0x3eb194[_0xd73b('0x2b')]){try{var _0x3f31d4=this['imap'][_0xd73b('0x2c')](_0x3eb194,{'bodies':'','markSeen':!![]});_0x3f31d4['on'](_0xd73b('0x2d'),this[_0xd73b('0x2e')][_0xd73b('0xe')](this));_0x3f31d4[_0xd73b('0x2f')]('error',this[_0xd73b('0x30')][_0xd73b('0xe')](this));_0x3f31d4[_0xd73b('0x2f')]('end',this[_0xd73b('0x31')][_0xd73b('0xe')](this));}catch(_0x2b904c){logger[_0xd73b('0x11')](_0x2b904c);}}else{this[_0xd73b('0x2')]['closeBox'](!![],this[_0xd73b('0x32')][_0xd73b('0xe')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x109973){_0x109973['on'](_0xd73b('0x33'),this['handleMessageBody'][_0xd73b('0xe')](this));_0x109973[_0xd73b('0x2f')](_0xd73b('0x34'),this[_0xd73b('0x35')]['bind'](this));_0x109973['once'](_0xd73b('0xf'),this[_0xd73b('0x36')][_0xd73b('0xe')](this));};EmailImap['prototype'][_0xd73b('0x37')]=function(_0x40292b){simpleParser(_0x40292b,{'Iconv':Iconv},this[_0xd73b('0x38')]['bind'](this));};EmailImap['prototype'][_0xd73b('0x35')]=function(){};EmailImap[_0xd73b('0x15')][_0xd73b('0x36')]=function(){};EmailImap[_0xd73b('0x15')]['handleSimpleParser']=function(_0x39b982,_0x3c66fe){if(_0x39b982){logger[_0xd73b('0x11')](_0x39b982);}else{var _0x1b84d9=this;utils['parser'](this['account'],_0x3c66fe,function(_0x280a0b){_0x1b84d9[_0xd73b('0x39')](_0xd73b('0x9'),_0x280a0b);});}};EmailImap[_0xd73b('0x15')][_0xd73b('0x31')]=function(){this[_0xd73b('0x2')]['closeBox'](!![],this[_0xd73b('0x32')][_0xd73b('0xe')](this));};EmailImap[_0xd73b('0x15')][_0xd73b('0x30')]=function(_0x5426a0){this[_0xd73b('0x12')](_0x5426a0);this[_0xd73b('0x2')]['closeBox'](!![],this[_0xd73b('0x32')][_0xd73b('0xe')](this));};EmailImap['prototype'][_0xd73b('0x10')]=function(){this[_0xd73b('0x39')]('end');};EmailImap['prototype']['handleError']=function(_0x55a133,_0x190db1){logger[_0xd73b('0x11')](_0xd73b('0x12'),this[_0xd73b('0xb')][_0xd73b('0x9')],JSON[_0xd73b('0x3a')](_0x55a133));var _0x187231='';if(_0x55a133){if(_0x55a133[_0xd73b('0x3b')]){_0x187231=_0x55a133['textCode'];}else{for(var _0x1e91d9 in _0x55a133){if(_0x55a133[_0xd73b('0x3c')](_0x1e91d9)){_0x187231+=_[_0xd73b('0x3d')](_0x1e91d9)+':\x20'+_0x55a133[_0x1e91d9]+'\x0a';}}}}if(_0x190db1){this[_0xd73b('0x2')][_0xd73b('0xf')]();}else{this[_0xd73b('0x39')]('error',_0x187231);this[_0xd73b('0x39')]('end');}};module[_0xd73b('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 6c72b43..6cb9a32 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 _0xf5d6=['compile','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','use'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xf5d6,0xf5));var _0x6f5d=function(_0x312f87,_0x1a8378){_0x312f87=_0x312f87-0x0;var _0x516625=_0xf5d6[_0x312f87];return _0x516625;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x6f5d('0x0'));function EmailSmtp(){}EmailSmtp[_0x6f5d('0x1')]['send']=function(_0x504e37,_0xed742d){return new Promise(function(_0x7715db,_0x56563c){var _0x1f5ece=nodemailer['createTransport'](_0x504e37);_0x1f5ece[_0x6f5d('0x2')](_0x6f5d('0x3'),inlineBase64());_0x1f5ece['sendMail'](_0xed742d,function(_0x1f1ebf,_0xac8b60){if(_0x1f1ebf){_0x56563c(_0x1f1ebf[_0x6f5d('0x4')]());}else{_0x7715db(_0xac8b60);}});});};EmailSmtp['prototype'][_0x6f5d('0x5')]=function(_0x278c5b){return new Promise(function(_0x14e183,_0x33ddf0){var _0x46ce69=nodemailer['createTransport'](_0x278c5b);_0x46ce69[_0x6f5d('0x5')](function(_0x15cfde,_0x3df0b2){if(_0x15cfde){_0x33ddf0(_0x15cfde[_0x6f5d('0x4')]());}else{if(_0x3df0b2){_0x14e183(_0x3df0b2);}else{_0x33ddf0(_0x6f5d('0x6'));}}});});};module[_0x6f5d('0x7')]=EmailSmtp; \ No newline at end of file +var _0x1b4a=['compile','sendMail','toString','prototype','verify','exports','nodemailer','send','createTransport'];(function(_0x19567c,_0x3e68a5){var _0x94666b=function(_0x5ab4fa){while(--_0x5ab4fa){_0x19567c['push'](_0x19567c['shift']());}};_0x94666b(++_0x3e68a5);}(_0x1b4a,0xba));var _0xa1b4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1b4a[_0x19e35c];return _0x3e1fe8;};'use strict';var nodemailer=require(_0xa1b4('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xa1b4('0x1')]=function(_0x454d60,_0x66efb3){return new Promise(function(_0x32eb9b,_0x504ff4){var _0x563b12=nodemailer[_0xa1b4('0x2')](_0x454d60);_0x563b12['use'](_0xa1b4('0x3'),inlineBase64());_0x563b12[_0xa1b4('0x4')](_0x66efb3,function(_0x4ee0e3,_0x80fbe7){if(_0x4ee0e3){_0x504ff4(_0x4ee0e3[_0xa1b4('0x5')]());}else{_0x32eb9b(_0x80fbe7);}});});};EmailSmtp[_0xa1b4('0x6')][_0xa1b4('0x7')]=function(_0x863bf3){return new Promise(function(_0x159854,_0x3a91f9){var _0x3d9339=nodemailer[_0xa1b4('0x2')](_0x863bf3);_0x3d9339[_0xa1b4('0x7')](function(_0x546bae,_0x368318){if(_0x546bae){_0x3a91f9(_0x546bae[_0xa1b4('0x5')]());}else{if(_0x368318){_0x159854(_0x368318);}else{_0x3a91f9('Not\x20verifired');}}});});};module[_0xa1b4('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 8d821fa..aec6148 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 _0x1442=['email','message','originCc','isEmpty','originTo','bcc','attach','type','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','isAutoreply','parser','from','subject','messageId','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','Attachments','Data','

Empty\x20message

','generateXOAuth2Token','user=','auth=Bearer\x20','join','utf-8','toString','base64','lodash','moment','path','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','slice','Anonymous','split','pop','length','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x14bdb3[_0x2144('0xe')](0x0,-0x1)['join']('\x20'):_0x568aa1[_0x2144('0xb')];}return _0x2144('0xf');}function getLastName(_0x1de65b){var _0x28dcb0=_[_0x2144('0x5')](_0x1de65b[_0x2144('0x6')]);if(_0x28dcb0&&_0x28dcb0[_0x2144('0xb')]){var _0xb15100=_0x28dcb0[_0x2144('0xb')][_0x2144('0x10')](/\s+/);return _0xb15100['length']>0x1?_0xb15100[_0x2144('0x11')]():'';}return'';}function getMails(_0x35d802,_0x2532da){var _0x2aa7fb='';for(var _0x47b9f5=0x0;_0x47b9f5<_0x2532da['value'][_0x2144('0x12')];_0x47b9f5+=0x1){if(_0x2532da[_0x2144('0x6')][_0x47b9f5][_0x2144('0x7')]!==_0x35d802){if(!_['isEmpty'](_0x2aa7fb)){_0x2aa7fb+=',';}_0x2aa7fb+=_0x2532da[_0x2144('0x6')][_0x47b9f5]['name']||_0x2532da[_0x2144('0x6')][_0x47b9f5][_0x2144('0x7')]||'';_0x2aa7fb+='\x20<';_0x2aa7fb+=_0x2532da[_0x2144('0x6')][_0x47b9f5][_0x2144('0x7')]?_0x2532da[_0x2144('0x6')][_0x47b9f5]['address']:_0x2144('0x8')+random[_0x2144('0x9')](0x6)+_0x2144('0xa');_0x2aa7fb+='>';}}return _0x2aa7fb;}function parseEmail(_0x2e7be9,_0x5633fd,_0x1731f7){if(_0x5633fd[_0x2144('0x13')]){var _0x7e442c=/)<[^<]*)*<\/script>/gi;while(_0x7e442c[_0x2144('0x14')](_0x5633fd[_0x2144('0x13')])){_0x5633fd[_0x2144('0x13')]=_0x5633fd[_0x2144('0x13')][_0x2144('0x15')](_0x7e442c,'');}if(_0x5633fd['html'][_0x2144('0x16')](_0x2144('0x17'))){var _0x427958=[];_0x5633fd[_0x2144('0x18')][_0x2144('0x19')](_0x30811f=>{_0x427958[_0x2144('0x1a')](_0x30811f[_0x2144('0x1b')]);});var _0x8c8007=/]+>/g;var _0x23bb22=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5f32e9=_0x5633fd['html'][_0x2144('0x15')](_0x23bb22,_0x2144('0x1c'));var _0x484b44=_0x5f32e9[_0x2144('0x15')](_0x8c8007,_0x2144('0x1d'));for(let _0x1463dc=0x0;_0x1463dc<_0x427958[_0x2144('0x12')];_0x1463dc++){var _0x5205c4=_0x484b44[_0x2144('0x15')](_0x2144('0x1d'),_0x2144('0x1e')+_0x427958[_0x1463dc]+_0x2144('0x1f'));_0x484b44=_0x5205c4;}_0x5633fd[_0x2144('0x13')]=_0x484b44;}_0x1731f7[_0x2144('0x20')]=_0x5633fd['html'];}else{_0x1731f7[_0x2144('0x20')]=_0x5633fd[_0x2144('0x21')];}if(_0x1731f7[_0x2144('0x20')]){_0x1731f7[_0x2144('0x20')]=_0x1731f7[_0x2144('0x20')][_0x2144('0x15')](/0x0){var _0x5f37c3=[_0x2144('0x35'),_0x2144('0x36'),'Precedence:\x20auto_reply'];for(var _0x1ad17f=0x0;_0x1ad17f<_0x5633fd[_0x2144('0x34')][_0x2144('0x12')];_0x1ad17f++){var _0x23d915=_[_0x2144('0xd')](_0x5f37c3,_0x5633fd[_0x2144('0x34')][_0x1ad17f]['line']);if(_0x23d915>=0x0){_0x1731f7[_0x2144('0x37')]=!![];}}}return _0x1731f7;}exports[_0x2144('0x38')]=function(_0xd737ba,_0x259ac3,_0x4d17ce){var _0x418b78={'from':getAddress(_0x259ac3[_0x2144('0x39')]),'firstName':getFirstName(_0x259ac3[_0x2144('0x39')]),'lastName':getLastName(_0x259ac3[_0x2144('0x39')]),'mapKey':'email','message':{'from':getMails(_0xd737ba[_0x2144('0x23')],_0x259ac3[_0x2144('0x39')]),'to':_0xd737ba[_0x2144('0x23')],'cc':'','subject':_0x259ac3[_0x2144('0x3a')]||'','messageId':_0x259ac3[_0x2144('0x3b')],'inReplyTo':_0x259ac3['inReplyTo'],'sentAt':moment(_0x259ac3['date'])['format'](_0x2144('0x3c')),'attach':![],'attachments':[]}};if(!_0x259ac3[_0x2144('0x13')]&&!_0x259ac3[_0x2144('0x21')]){var _0x37f6ad=_[_0x2144('0x3d')](_0x259ac3['attachments'],{'contentType':'application/ms-tnef'});if(_0x37f6ad[_0x2144('0x12')]){logger[_0x2144('0x3e')](util[_0x2144('0x2c')](_0x2144('0x3f'),_0x259ac3[_0x2144('0x3b')]));tnef['parseBuffer'](_['first'](_0x37f6ad)['content'],function(_0x350dbc,_0x398366){if(_0x398366){_0x259ac3[_0x2144('0x13')]=_0x398366[_0x2144('0x40')]||'

Empty\x20message

';if(_0x398366[_0x2144('0x41')]){for(var _0x2e496d=0x0;_0x2e496d<_0x398366['Attachments'][_0x2144('0x12')];_0x2e496d++){var _0x2f3f67=_0x398366['Attachments'][_0x2e496d];_0x418b78[_0x2144('0x24')]['attachments'][_0x2144('0x1a')]({'filename':_0x2f3f67['Title'],'content':Buffer[_0x2144('0x39')](_0x2f3f67[_0x2144('0x42')])});}}}_0x4d17ce(parseEmail(_0xd737ba,_0x259ac3,_0x418b78));});}else{_0x259ac3[_0x2144('0x13')]=_0x2144('0x43');_0x4d17ce(parseEmail(_0xd737ba,_0x259ac3,_0x418b78));}}else{_0x4d17ce(parseEmail(_0xd737ba,_0x259ac3,_0x418b78));}};exports[_0x2144('0x44')]=function(_0x32f568,_0x43f265){var _0x1428e2=[_0x2144('0x45')+(_0x43f265||''),_0x2144('0x46')+_0x32f568,'',''];return Buffer[_0x2144('0x39')](_0x1428e2[_0x2144('0x47')](''),_0x2144('0x48'))[_0x2144('0x49')](_0x2144('0x4a'));}; \ No newline at end of file +var _0x448b=['content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','subject','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','first','

Empty\x20message

','Attachments','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','Anonymous','split','length','pop','isEmpty','html','replace','includes','attachments','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x520a6f['slice'](0x0,-0x1)['join']('\x20'):_0x57bb32['name'];}return _0xb448('0x11');}function getLastName(_0x212674){var _0x1c0893=_[_0xb448('0x9')](_0x212674[_0xb448('0xa')]);if(_0x1c0893&&_0x1c0893[_0xb448('0xf')]){var _0x434c63=_0x1c0893['name'][_0xb448('0x12')](/\s+/);return _0x434c63[_0xb448('0x13')]>0x1?_0x434c63[_0xb448('0x14')]():'';}return'';}function getMails(_0x1b4c9e,_0x23e3ee){var _0x22ab58='';for(var _0x5b5993=0x0;_0x5b5993<_0x23e3ee[_0xb448('0xa')][_0xb448('0x13')];_0x5b5993+=0x1){if(_0x23e3ee[_0xb448('0xa')][_0x5b5993][_0xb448('0xb')]!==_0x1b4c9e){if(!_[_0xb448('0x15')](_0x22ab58)){_0x22ab58+=',';}_0x22ab58+=_0x23e3ee['value'][_0x5b5993]['name']||_0x23e3ee[_0xb448('0xa')][_0x5b5993]['address']||'';_0x22ab58+='\x20<';_0x22ab58+=_0x23e3ee[_0xb448('0xa')][_0x5b5993][_0xb448('0xb')]?_0x23e3ee[_0xb448('0xa')][_0x5b5993][_0xb448('0xb')]:_0xb448('0xc')+random['generate'](0x6)+_0xb448('0xe');_0x22ab58+='>';}}return _0x22ab58;}function parseEmail(_0x5f440a,_0x551838,_0x264ca8){if(_0x551838[_0xb448('0x16')]){var _0x1024d3=/)<[^<]*)*<\/script>/gi;while(_0x1024d3['test'](_0x551838['html'])){_0x551838[_0xb448('0x16')]=_0x551838[_0xb448('0x16')][_0xb448('0x17')](_0x1024d3,'');}if(_0x551838[_0xb448('0x16')][_0xb448('0x18')]('{_0x4c46e4[_0xb448('0x1a')](_0x2fb744[_0xb448('0x1b')]);});var _0x4f68ea=/]+>/g;var _0x416506=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x209df0=_0x551838['html'][_0xb448('0x17')](_0x416506,_0xb448('0x1c'));var _0x5ed3fe=_0x209df0[_0xb448('0x17')](_0x4f68ea,_0xb448('0x1d'));for(let _0x2a2084=0x0;_0x2a2084<_0x4c46e4[_0xb448('0x13')];_0x2a2084++){var _0x458297=_0x5ed3fe[_0xb448('0x17')](_0xb448('0x1d'),_0xb448('0x1e')+_0x4c46e4[_0x2a2084]+_0xb448('0x1f'));_0x5ed3fe=_0x458297;}_0x551838[_0xb448('0x16')]=_0x5ed3fe;}_0x264ca8[_0xb448('0x20')]=_0x551838[_0xb448('0x16')];}else{_0x264ca8['body']=_0x551838[_0xb448('0x21')];}if(_0x264ca8[_0xb448('0x20')]){_0x264ca8[_0xb448('0x20')]=_0x264ca8['body'][_0xb448('0x17')](/0x0){var _0x38f81a=[_0xb448('0x31'),'X-Auto-Response-Suppress:\x20All',_0xb448('0x32')];for(var _0x41f502=0x0;_0x41f502<_0x551838[_0xb448('0x30')][_0xb448('0x13')];_0x41f502++){var _0x54df94=_[_0xb448('0x33')](_0x38f81a,_0x551838[_0xb448('0x30')][_0x41f502][_0xb448('0x34')]);if(_0x54df94>=0x0){_0x264ca8[_0xb448('0x35')]=!![];}}}return _0x264ca8;}exports[_0xb448('0x36')]=function(_0x120e11,_0x3a1fdc,_0x51f426){var _0x5d436c={'from':getAddress(_0x3a1fdc[_0xb448('0x37')]),'firstName':getFirstName(_0x3a1fdc[_0xb448('0x37')]),'lastName':getLastName(_0x3a1fdc[_0xb448('0x37')]),'mapKey':_0xb448('0x7'),'message':{'from':getMails(_0x120e11['email'],_0x3a1fdc[_0xb448('0x37')]),'to':_0x120e11['email'],'cc':'','subject':_0x3a1fdc[_0xb448('0x38')]||'','messageId':_0x3a1fdc['messageId'],'inReplyTo':_0x3a1fdc['inReplyTo'],'sentAt':moment(_0x3a1fdc[_0xb448('0x39')])['format'](_0xb448('0x3a')),'attach':![],'attachments':[]}};if(!_0x3a1fdc['html']&&!_0x3a1fdc[_0xb448('0x21')]){var _0x1c0421=_[_0xb448('0x3b')](_0x3a1fdc[_0xb448('0x19')],{'contentType':_0xb448('0x3c')});if(_0x1c0421[_0xb448('0x13')]){logger[_0xb448('0x3d')](util[_0xb448('0x2b')](_0xb448('0x3e'),_0x3a1fdc[_0xb448('0x3f')]));tnef['parseBuffer'](_[_0xb448('0x40')](_0x1c0421)[_0xb448('0x2f')],function(_0x50afd6,_0x5e910e){if(_0x5e910e){_0x3a1fdc[_0xb448('0x16')]=_0x5e910e['BodyHTML']||_0xb448('0x41');if(_0x5e910e[_0xb448('0x42')]){for(var _0x35fd8f=0x0;_0x35fd8f<_0x5e910e[_0xb448('0x42')][_0xb448('0x13')];_0x35fd8f++){var _0xb0fe71=_0x5e910e[_0xb448('0x42')][_0x35fd8f];_0x5d436c[_0xb448('0x24')][_0xb448('0x19')]['push']({'filename':_0xb0fe71['Title'],'content':Buffer['from'](_0xb0fe71['Data'])});}}}_0x51f426(parseEmail(_0x120e11,_0x3a1fdc,_0x5d436c));});}else{_0x3a1fdc[_0xb448('0x16')]=_0xb448('0x41');_0x51f426(parseEmail(_0x120e11,_0x3a1fdc,_0x5d436c));}}else{_0x51f426(parseEmail(_0x120e11,_0x3a1fdc,_0x5d436c));}};exports[_0xb448('0x43')]=function(_0x547845,_0x208eac){var _0x197db2=[_0xb448('0x44')+(_0x208eac||''),'auth=Bearer\x20'+_0x547845,'',''];return Buffer[_0xb448('0x37')](_0x197db2['join'](''),_0xb448('0x45'))[_0xb448('0x46')](_0xb448('0x47'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index fd642c2..c7f436c 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 _0x62ae=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x579556,_0x20e087){var _0x16680e=function(_0x178661){while(--_0x178661){_0x579556['push'](_0x579556['shift']());}};_0x16680e(++_0x20e087);}(_0x62ae,0x13b));var _0xe62a=function(_0x2493d0,_0x205e5e){_0x2493d0=_0x2493d0-0x0;var _0x4c843d=_0x62ae[_0x2493d0];return _0x4c843d;};'use strict';var _=require(_0xe62a('0x0'));function MailAccount(_0x317b2a){this['id']=_0x317b2a['id']||0x0;this[_0xe62a('0x1')]=_0x317b2a['name']||_0xe62a('0x2');this['key']=_0x317b2a[_0xe62a('0x3')]||_0xe62a('0x4');this['active']=_0x317b2a[_0xe62a('0x5')]||![];this[_0xe62a('0x6')]=_0x317b2a[_0xe62a('0x6')]||[];this['Smtp']=_0x317b2a[_0xe62a('0x7')]||[];}module[_0xe62a('0x8')]=MailAccount; \ No newline at end of file +var _0x5d36=['lodash','name','Service','key','active','Imap','Smtp','exports'];(function(_0x4c8220,_0x3ca184){var _0x2e2e20=function(_0x4da51f){while(--_0x4da51f){_0x4c8220['push'](_0x4c8220['shift']());}};_0x2e2e20(++_0x3ca184);}(_0x5d36,0xb0));var _0x65d3=function(_0x280fba,_0x32db4d){_0x280fba=_0x280fba-0x0;var _0x5225b8=_0x5d36[_0x280fba];return _0x5225b8;};'use strict';var _=require(_0x65d3('0x0'));function MailAccount(_0x1fc810){this['id']=_0x1fc810['id']||0x0;this['name']=_0x1fc810[_0x65d3('0x1')]||_0x65d3('0x2');this[_0x65d3('0x3')]=_0x1fc810[_0x65d3('0x3')]||'SERV';this[_0x65d3('0x4')]=_0x1fc810[_0x65d3('0x4')]||![];this[_0x65d3('0x5')]=_0x1fc810[_0x65d3('0x5')]||[];this[_0x65d3('0x6')]=_0x1fc810[_0x65d3('0x6')]||[];}module[_0x65d3('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 971d303..a502c20 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 _0x47f0=['exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x47f0,0x91));var _0x047f=function(_0x6c40ba,_0x5e39fa){_0x6c40ba=_0x6c40ba-0x0;var _0x7a54dd=_0x47f0[_0x6c40ba];return _0x7a54dd;};'use strict';var _=require('lodash');var MailAccount=require(_0x047f('0x0'));var Realtime=function(){this[_0x047f('0x1')]={};};function freeIsNotKey(_0x194f95,_0x5abf18,_0x515926){var _0x243093=_[_0x047f('0x2')](_0x194f95,function(_0x26a6b2,_0x43d5cc){return _0x26a6b2[_0x515926];});for(var _0x8d0ca7 in _0x5abf18){if(_0x5abf18[_0x047f('0x3')](_0x8d0ca7)){if(!_0x243093[_0x8d0ca7]){delete _0x5abf18[_0x8d0ca7];}}}}Realtime[_0x047f('0x4')][_0x047f('0x5')]=function(_0x419bb6,_0x1b55ac){for(var _0x473d93 in _0x1b55ac){if(_0x419bb6['hasOwnProperty'](_0x473d93)){_0x419bb6[_0x473d93]=_0x1b55ac[_0x473d93];}}};Realtime['prototype'][_0x047f('0x6')]=function(){var _0xdaf653=this;return function(_0x5de329){if(_0x5de329){freeIsNotKey(_0x5de329,_0xdaf653['mailAccounts'],'id');for(var _0x52346b=0x0,_0x51c871={},_0x2653a8={};_0x52346b<_0x5de329['length'];_0x52346b+=0x1){_0x51c871=_0x5de329[_0x52346b];if(_['isUndefined'](_0xdaf653[_0x047f('0x1')][_0x51c871['id']])){_0xdaf653[_0x047f('0x1')][_0x51c871['id']]=new MailAccount(_0x51c871);}else{_['merge'](_0xdaf653[_0x047f('0x1')][_0x51c871['id']],_0x51c871);}}}return _0xdaf653['mailAccounts'];};};module[_0x047f('0x7')]=Realtime; \ No newline at end of file +var _0x2b66=['mergeFromDatabase','length','isUndefined','merge','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x55ab47,_0x2fa34d){var _0x5833dc=function(_0x3dfe79){while(--_0x3dfe79){_0x55ab47['push'](_0x55ab47['shift']());}};_0x5833dc(++_0x2fa34d);}(_0x2b66,0x14c));var _0x62b6=function(_0x573faf,_0xc1b84){_0x573faf=_0x573faf-0x0;var _0x47e7e6=_0x2b66[_0x573faf];return _0x47e7e6;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x62b6('0x0')]={};};function freeIsNotKey(_0x4e481e,_0x2d8f5c,_0x339b01){var _0x303053=_[_0x62b6('0x1')](_0x4e481e,function(_0x3215ea,_0x596c8d){return _0x3215ea[_0x339b01];});for(var _0x44a37d in _0x2d8f5c){if(_0x2d8f5c[_0x62b6('0x2')](_0x44a37d)){if(!_0x303053[_0x44a37d]){delete _0x2d8f5c[_0x44a37d];}}}}Realtime[_0x62b6('0x3')][_0x62b6('0x4')]=function(_0x3b95ef,_0x39b44a){for(var _0x4d2790 in _0x39b44a){if(_0x3b95ef[_0x62b6('0x2')](_0x4d2790)){_0x3b95ef[_0x4d2790]=_0x39b44a[_0x4d2790];}}};Realtime[_0x62b6('0x3')]['initMailAccounts']=function(){var _0x181d6e=this;return function(_0x4eb0bb){if(_0x4eb0bb){freeIsNotKey(_0x4eb0bb,_0x181d6e[_0x62b6('0x0')],'id');for(var _0x20e3b5=0x0,_0x17d976={},_0x2e2030={};_0x20e3b5<_0x4eb0bb[_0x62b6('0x5')];_0x20e3b5+=0x1){_0x17d976=_0x4eb0bb[_0x20e3b5];if(_[_0x62b6('0x6')](_0x181d6e['mailAccounts'][_0x17d976['id']])){_0x181d6e[_0x62b6('0x0')][_0x17d976['id']]=new MailAccount(_0x17d976);}else{_[_0x62b6('0x7')](_0x181d6e[_0x62b6('0x0')][_0x17d976['id']],_0x17d976);}}}return _0x181d6e['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 f0792b9..888288d 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 _0x16ce=['service','ListId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider'];(function(_0x5be1d6,_0x52ab2a){var _0x5d9bd4=function(_0x4f05ba){while(--_0x4f05ba){_0x5be1d6['push'](_0x5be1d6['shift']());}};_0x5d9bd4(++_0x52ab2a);}(_0x16ce,0xfb));var _0xe16c=function(_0x1236de,_0x147e29){_0x1236de=_0x1236de-0x0;var _0x54f57c=_0x16ce[_0x1236de];return _0x54f57c;};'use strict';var client=require('../client');exports[_0xe16c('0x0')]=function(){return function(){return client[_0xe16c('0x1')](_0xe16c('0x2'),{'options':{'attributes':['id',_0xe16c('0x3'),_0xe16c('0x4'),_0xe16c('0x5'),'email','active','key',_0xe16c('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0xe16c('0x7'),'as':_0xe16c('0x8'),'include':[{'model':_0xe16c('0x9'),'attributes':['id',_0xe16c('0x3'),_0xe16c('0x5'),_0xe16c('0xa'),_0xe16c('0xb')],'as':_0xe16c('0x9')}]},{'model':'MailServerOut','as':_0xe16c('0xc'),'include':[{'model':_0xe16c('0x9'),'attributes':['id',_0xe16c('0x3'),_0xe16c('0x5'),_0xe16c('0xa'),_0xe16c('0xb')],'as':_0xe16c('0x9')}]}]},'log':_0xe16c('0xd')});};};exports[_0xe16c('0xe')]=function(_0x725d10,_0x45c562){return client['Request'](_0xe16c('0xf'),{'account':{'id':_0x725d10},'body':_0x45c562,'log':_0xe16c('0xf')});}; \ No newline at end of file +var _0x67d5=['key','ListId','TemplateId','MailServerIn','CloudProvider','type','data5','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','name','service','email','active'];(function(_0x543ef9,_0x56e805){var _0x19146c=function(_0x2bffc8){while(--_0x2bffc8){_0x543ef9['push'](_0x543ef9['shift']());}};_0x19146c(++_0x56e805);}(_0x67d5,0x18a));var _0x567d=function(_0x1c4e92,_0x3c9679){_0x1c4e92=_0x1c4e92-0x0;var _0x5551d8=_0x67d5[_0x1c4e92];return _0x5551d8;};'use strict';var client=require('../client');exports[_0x567d('0x0')]=function(){return function(){return client[_0x567d('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0x567d('0x2'),'provider',_0x567d('0x3'),_0x567d('0x4'),_0x567d('0x5'),_0x567d('0x6'),_0x567d('0x7'),_0x567d('0x8')],'raw':![],'include':[{'model':_0x567d('0x9'),'as':'Imap','include':[{'model':_0x567d('0xa'),'attributes':['id',_0x567d('0x2'),_0x567d('0x3'),_0x567d('0xb'),_0x567d('0xc')],'as':_0x567d('0xa')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x567d('0xa'),'attributes':['id',_0x567d('0x2'),_0x567d('0x3'),_0x567d('0xb'),_0x567d('0xc')],'as':_0x567d('0xa')}]}]},'log':_0x567d('0xd')});};};exports[_0x567d('0xe')]=function(_0x51d021,_0xd02cdc){return client[_0x567d('0x1')](_0x567d('0xf'),{'account':{'id':_0x51d021},'body':_0xd02cdc,'log':_0x567d('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index ed8da3a..1c64672 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 _0xadf6=['ShowSetting','loginMailFrequency','../client','getSettings','Request'];(function(_0x921689,_0x263a98){var _0x184a96=function(_0x5cedc9){while(--_0x5cedc9){_0x921689['push'](_0x921689['shift']());}};_0x184a96(++_0x263a98);}(_0xadf6,0x98));var _0x6adf=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xadf6[_0x1b7368];return _0x25d54c;};'use strict';var client=require(_0x6adf('0x0'));exports[_0x6adf('0x1')]=function(){return client[_0x6adf('0x2')](_0x6adf('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6adf('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x49f9=['GetSettings','../client','getSettings','ShowSetting','loginMailFrequency'];(function(_0x16258f,_0x5aca38){var _0x36e311=function(_0x21e61f){while(--_0x21e61f){_0x16258f['push'](_0x16258f['shift']());}};_0x36e311(++_0x5aca38);}(_0x49f9,0x79));var _0x949f=function(_0x20a68a,_0x54502e){_0x20a68a=_0x20a68a-0x0;var _0x56c5d4=_0x49f9[_0x20a68a];return _0x56c5d4;};'use strict';var client=require(_0x949f('0x0'));exports[_0x949f('0x1')]=function(){return client['Request'](_0x949f('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x949f('0x3')]},'log':_0x949f('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 8a66abb..b43a77e 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 3da7146..d98468d 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 _0xcd9c=['defaults','adapter','../../config/triggers','default','../../config/socketio','../../config/express','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','timeout','listen','port','polling','redis'];(function(_0x198faf,_0x254278){var _0xa30e7d=function(_0x316ef2){while(--_0x316ef2){_0x198faf['push'](_0x198faf['shift']());}};_0xa30e7d(++_0x254278);}(_0xcd9c,0xaa));var _0xccd9=function(_0x2193e3,_0x2dafc9){_0x2193e3=_0x2193e3-0x0;var _0x3724e6=_0xcd9c[_0x2193e3];return _0x3724e6;};'use strict';var _=require(_0xccd9('0x0'));var http=require(_0xccd9('0x1'));var express=require(_0xccd9('0x2'));var sticky=require(_0xccd9('0x3'));var Redis=require(_0xccd9('0x4'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0xccd9('0x5')]=0xdbba0;if(sticky[_0xccd9('0x6')](server,config[_0xccd9('0x7')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xccd9('0x8')]});config[_0xccd9('0x9')]=_[_0xccd9('0xa')](config[_0xccd9('0x9')],{'host':'localhost','port':0x18eb});socketio[_0xccd9('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0xccd9('0x9')]),'subClient':new Redis(config['redis'])}));require(_0xccd9('0xc'))[_0xccd9('0xd')]();require(_0xccd9('0xe'))[_0xccd9('0xd')](socketio);require(_0xccd9('0xf'))[_0xccd9('0xd')](app);require('../../routes')['default'](app);}else{server[_0xccd9('0x10')]('listening',function(){console[_0xccd9('0x11')](_0xccd9('0x12'),config[_0xccd9('0x7')]);});}exports=module[_0xccd9('0x13')]=app; \ No newline at end of file +var _0xdd96=['../../config/environment','timeout','listen','port','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis'];(function(_0x300819,_0x52a28c){var _0x428245=function(_0x40a9b2){while(--_0x40a9b2){_0x300819['push'](_0x300819['shift']());}};_0x428245(++_0x52a28c);}(_0xdd96,0x133));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6dd9('0x0'));var http=require(_0x6dd9('0x1'));var express=require(_0x6dd9('0x2'));var sticky=require(_0x6dd9('0x3'));var Redis=require(_0x6dd9('0x4'));var config=require(_0x6dd9('0x5'));var app=express();var server=http['createServer'](app);server[_0x6dd9('0x6')]=0xdbba0;if(sticky[_0x6dd9('0x7')](server,config[_0x6dd9('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x6dd9('0x9'),_0x6dd9('0xa')]});config[_0x6dd9('0xb')]=_[_0x6dd9('0xc')](config[_0x6dd9('0xb')],{'host':_0x6dd9('0xd'),'port':0x18eb});socketio['adapter'](require(_0x6dd9('0xe'))({'pubClient':new Redis(config[_0x6dd9('0xb')]),'subClient':new Redis(config['redis'])}));require(_0x6dd9('0xf'))[_0x6dd9('0x10')]();require(_0x6dd9('0x11'))['default'](socketio);require(_0x6dd9('0x12'))[_0x6dd9('0x10')](app);require(_0x6dd9('0x13'))[_0x6dd9('0x10')](app);}else{server['once'](_0x6dd9('0x14'),function(){console[_0x6dd9('0x15')](_0x6dd9('0x16'),config[_0x6dd9('0x8')]);});}exports=module[_0x6dd9('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 2567ac8..40b1e7f 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 _0x74c9=['http','Request','request','then','error','message','result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x6300b4,_0x215b3d){var _0x541ebe=function(_0x492abe){while(--_0x492abe){_0x6300b4['push'](_0x6300b4['shift']());}};_0x541ebe(++_0x215b3d);}(_0x74c9,0x19f));var _0x974c=function(_0x42d876,_0x14f7ee){_0x42d876=_0x42d876-0x0;var _0x208b52=_0x74c9[_0x42d876];return _0x208b52;};'use strict';var jayson=require(_0x974c('0x0'));var BPromise=require(_0x974c('0x1'));var logger=require(_0x974c('0x2'))(_0x974c('0x3'));var client=jayson[_0x974c('0x4')][_0x974c('0x5')]({'port':0x2329});client[_0x974c('0x6')]=function(_0x19623a,_0x4174d6){return new BPromise(function(_0x3fc17f,_0x225a9f){return client[_0x974c('0x7')](_0x19623a,_0x4174d6)[_0x974c('0x8')](function(_0x2cac7a){logger['debug']('rpc',_0x974c('0x3'),_0x19623a,_0x4174d6,_0x2cac7a);if(_0x2cac7a['error']){logger[_0x974c('0x9')]('rpc',_0x974c('0x3'),_0x19623a,_0x2cac7a['error'][_0x974c('0xa')],_0x4174d6);return _0x225a9f(_0x2cac7a[_0x974c('0x9')][_0x974c('0xa')]);}else{return _0x3fc17f(_0x2cac7a[_0x974c('0xb')]);}})[_0x974c('0xc')](function(_0x1e11da){logger[_0x974c('0x9')](_0x974c('0xd'),_0x974c('0x3'),_0x19623a,_0x1e11da,_0x4174d6);return _0x225a9f(_0x1e11da);});});};module[_0x974c('0xe')]=client; \ No newline at end of file +var _0xdb84=['client','http','Request','request','debug','rpc','routing','error','message','result','catch','jayson/promise','bluebird','../../config/logger'];(function(_0x469def,_0x3f8695){var _0x22792c=function(_0x318ae1){while(--_0x318ae1){_0x469def['push'](_0x469def['shift']());}};_0x22792c(++_0x3f8695);}(_0xdb84,0x1a1));var _0x4db8=function(_0x45e9e5,_0x441712){_0x45e9e5=_0x45e9e5-0x0;var _0x1c07db=_0xdb84[_0x45e9e5];return _0x1c07db;};'use strict';var jayson=require(_0x4db8('0x0'));var BPromise=require(_0x4db8('0x1'));var logger=require(_0x4db8('0x2'))('routing');var client=jayson[_0x4db8('0x3')][_0x4db8('0x4')]({'port':0x2329});client[_0x4db8('0x5')]=function(_0x370093,_0x3fc82c){return new BPromise(function(_0x187d84,_0x5914cd){return client[_0x4db8('0x6')](_0x370093,_0x3fc82c)['then'](function(_0x541a84){logger[_0x4db8('0x7')](_0x4db8('0x8'),_0x4db8('0x9'),_0x370093,_0x3fc82c,_0x541a84);if(_0x541a84['error']){logger[_0x4db8('0xa')]('rpc',_0x4db8('0x9'),_0x370093,_0x541a84[_0x4db8('0xa')][_0x4db8('0xb')],_0x3fc82c);return _0x5914cd(_0x541a84[_0x4db8('0xa')]['message']);}else{return _0x187d84(_0x541a84[_0x4db8('0xc')]);}})[_0x4db8('0xd')](function(_0x318326){logger[_0x4db8('0xa')](_0x4db8('0x8'),'routing',_0x370093,_0x318326,_0x3fc82c);return _0x5914cd(_0x318326);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index cd24568..e510248 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 _0x45f0=['./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initMailQueues','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0x17882c,_0x4b964b){var _0x355a59=function(_0x534b5b){while(--_0x534b5b){_0x17882c['push'](_0x17882c['shift']());}};_0x355a59(++_0x4b964b);}(_0x45f0,0x1f3));var _0x045f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x45f0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x045f('0x0'));var server=require(_0x045f('0x1'));var Realtime=require(_0x045f('0x2'));var user=require(_0x045f('0x3'));var interval=require(_0x045f('0x4'));var openchannelQueue=require(_0x045f('0x5'));var chatQueue=require(_0x045f('0x6'));var smsQueue=require(_0x045f('0x7'));var mailQueue=require(_0x045f('0x8'));var faxQueue=require(_0x045f('0x9'));var whatsappQueue=require(_0x045f('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x045f('0xb')]()[_0x045f('0xc')](user[_0x045f('0xd')]())['then'](realtime[_0x045f('0xe')]())[_0x045f('0xc')](interval['getIntervals']())[_0x045f('0xc')](realtime[_0x045f('0xf')]())[_0x045f('0xc')](openchannelQueue[_0x045f('0x10')]())['then'](realtime['initOpenchannelQueues']())[_0x045f('0xc')](chatQueue[_0x045f('0x11')]())[_0x045f('0xc')](realtime['initChatQueues']())[_0x045f('0xc')](smsQueue[_0x045f('0x12')]())[_0x045f('0xc')](realtime['initSmsQueues']())[_0x045f('0xc')](mailQueue['getMailQueues']())[_0x045f('0xc')](realtime[_0x045f('0x13')]())[_0x045f('0xc')](faxQueue['getFaxQueues']())['then'](realtime['initFaxQueues']())[_0x045f('0xc')](whatsappQueue['getWhatsappQueues']())[_0x045f('0xc')](realtime['initWhatsappQueues']())[_0x045f('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x045f('0xc')](function(_0x5d7351){return initRealtime();})[_0x045f('0xc')](function(_0x22a7b4){return setInterval(initRealtime,0x1388);})[_0x045f('0x14')](function(_0x59fc69){console['log'](_0x59fc69);});}main(); \ No newline at end of file +var _0xaadd=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xaadd,0x1bc));var _0xdaad=function(_0x467e9a,_0x3f060b){_0x467e9a=_0x467e9a-0x0;var _0x54ab51=_0xaadd[_0x467e9a];return _0x54ab51;};'use strict';var BPromise=require(_0xdaad('0x0'));var server=require(_0xdaad('0x1'));var Realtime=require(_0xdaad('0x2'));var user=require(_0xdaad('0x3'));var interval=require(_0xdaad('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xdaad('0x5'));var smsQueue=require(_0xdaad('0x6'));var mailQueue=require(_0xdaad('0x7'));var faxQueue=require(_0xdaad('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xdaad('0x9')]()[_0xdaad('0xa')](user[_0xdaad('0xb')]())[_0xdaad('0xa')](realtime[_0xdaad('0xc')]())['then'](interval[_0xdaad('0xd')]())['then'](realtime[_0xdaad('0xe')]())[_0xdaad('0xa')](openchannelQueue[_0xdaad('0xf')]())[_0xdaad('0xa')](realtime['initOpenchannelQueues']())[_0xdaad('0xa')](chatQueue[_0xdaad('0x10')]())[_0xdaad('0xa')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0xdaad('0xa')](realtime['initSmsQueues']())[_0xdaad('0xa')](mailQueue[_0xdaad('0x11')]())[_0xdaad('0xa')](realtime[_0xdaad('0x12')]())[_0xdaad('0xa')](faxQueue[_0xdaad('0x13')]())[_0xdaad('0xa')](realtime[_0xdaad('0x14')]())['then'](whatsappQueue[_0xdaad('0x15')]())[_0xdaad('0xa')](realtime['initWhatsappQueues']())[_0xdaad('0xa')](function(){return realtime;});}function main(){return server[_0xdaad('0x16')](realtime)[_0xdaad('0xa')](function(_0x1dc1bb){return initRealtime();})[_0xdaad('0xa')](function(_0x44bc4c){return setInterval(initRealtime,0x1388);})[_0xdaad('0x17')](function(_0x149763){console[_0xdaad('0x18')](_0x149763);});}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 a6be276..57681af 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1261,0x144));var _0x1126=function(_0x3c7ae2,_0x5504e3){_0x3c7ae2=_0x3c7ae2-0x0;var _0x39f0d7=_0x1261[_0x3c7ae2];return _0x39f0d7;};'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 +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x1c518c,_0x383352){var _0x2650cb=function(_0x45fe77){while(--_0x45fe77){_0x1c518c['push'](_0x1c518c['shift']());}};_0x2650cb(++_0x383352);}(_0x326f,0xd1));var _0xf326=function(_0x237347,_0x49a7f4){_0x237347=_0x237347-0x0;var _0x5f5ddb=_0x326f[_0x237347];return _0x5f5ddb;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index f0a49fd..b4ee9cf 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 _0xb66e=['message','result','catch','SendMail','bluebird','client','http','then','error'];(function(_0x4052e0,_0x4b1428){var _0x19a313=function(_0x64df1d){while(--_0x64df1d){_0x4052e0['push'](_0x4052e0['shift']());}};_0x19a313(++_0x4b1428);}(_0xb66e,0xaf));var _0xeb66=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0xb66e[_0x5a187b];return _0x14d601;};'use strict';var BPromise=require(_0xeb66('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xeb66('0x1')][_0xeb66('0x2')]({'port':0x232b});function request(_0x5e7610,_0x127bad){return new BPromise(function(_0x13028c,_0x3a7e8c){return client['request'](_0x5e7610,_0x127bad)[_0xeb66('0x3')](function(_0x381e02){if(_0x381e02[_0xeb66('0x4')]){return _0x3a7e8c(_0x381e02[_0xeb66('0x4')][_0xeb66('0x5')]);}else{return _0x13028c(_0x381e02[_0xeb66('0x6')]);}})[_0xeb66('0x7')](function(_0x54937a){return _0x3a7e8c(_0x54937a);});});}exports['sendMailMessage']=function(_0x33f2fe,_0x4e43df){return request(_0xeb66('0x8'),{'account':_0x33f2fe,'message':_0x4e43df});}; \ No newline at end of file +var _0x04f2=['result','catch','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x35b219,_0x4270ad){var _0x388615=function(_0x80131){while(--_0x80131){_0x35b219['push'](_0x35b219['shift']());}};_0x388615(++_0x4270ad);}(_0x04f2,0xd4));var _0x204f=function(_0x519d93,_0x395910){_0x519d93=_0x519d93-0x0;var _0x3579cf=_0x04f2[_0x519d93];return _0x3579cf;};'use strict';var BPromise=require(_0x204f('0x0'));var jayson=require(_0x204f('0x1'));var client=jayson[_0x204f('0x2')][_0x204f('0x3')]({'port':0x232b});function request(_0x59f8e1,_0x5a1e15){return new BPromise(function(_0x2af1f7,_0x34cdda){return client[_0x204f('0x4')](_0x59f8e1,_0x5a1e15)[_0x204f('0x5')](function(_0x47775c){if(_0x47775c['error']){return _0x34cdda(_0x47775c[_0x204f('0x6')][_0x204f('0x7')]);}else{return _0x2af1f7(_0x47775c[_0x204f('0x8')]);}})[_0x204f('0x9')](function(_0x20d492){return _0x34cdda(_0x20d492);});});}exports['sendMailMessage']=function(_0x51e569,_0x46e87d){return request(_0x204f('0xa'),{'account':_0x51e569,'message':_0x46e87d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2bd5c76..60dc275 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 _0xfb11=['openchannelCapacity','busyQueue','md5','chatWaitingInteractions','mailWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailStatusTime','smsCurrentCapacity','openchannelCurrentCapacity','faxWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','stringify','emit','user:routing:update','exports','lodash','moment','ioredis','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xfb11[_0x411add];return _0x238242;};'use strict';var _=require(_0x1fb1('0x0'));var md5=require('md5');var moment=require(_0x1fb1('0x1'));var Redis=require(_0x1fb1('0x2'));var config=require('../../../config/environment');config[_0x1fb1('0x3')]=_['defaults'](config[_0x1fb1('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x1fb1('0x4'))(new Redis(config[_0x1fb1('0x3')]));function Agent(_0x5af469){this['id']=_0x5af469['id']||0x0;this[_0x1fb1('0x5')]=_0x5af469[_0x1fb1('0x5')]||'';this['online']=_0x5af469[_0x1fb1('0x6')]||!![];this[_0x1fb1('0x7')]=_0x5af469[_0x1fb1('0x7')]||![];this[_0x1fb1('0x8')]=_0x5af469[_0x1fb1('0x8')]||![];this[_0x1fb1('0x9')]=_0x5af469[_0x1fb1('0x9')]||![];this[_0x1fb1('0xa')]=_0x5af469[_0x1fb1('0xa')]||![];this[_0x1fb1('0xb')]=_0x5af469['smsPause']||![];this[_0x1fb1('0xc')]=_0x5af469['openchannelPause']||![];this[_0x1fb1('0xd')]='unknown';this[_0x1fb1('0xe')]=0x0;this[_0x1fb1('0xf')]=_0x5af469[_0x1fb1('0xf')]||0x0;this[_0x1fb1('0x10')]=0x0;this[_0x1fb1('0x11')]=_0x1fb1('0x12');this['mailStatusTime']=0x0;this[_0x1fb1('0x13')]=_0x5af469[_0x1fb1('0x13')]||0x0;this[_0x1fb1('0x14')]=0x0;this[_0x1fb1('0x15')]=_0x1fb1('0x12');this[_0x1fb1('0x16')]=0x0;this[_0x1fb1('0x17')]=_0x5af469[_0x1fb1('0x17')]||0x0;this[_0x1fb1('0x18')]=0x0;this['smsStatus']='unknown';this[_0x1fb1('0x19')]=0x0;this[_0x1fb1('0x1a')]=_0x5af469[_0x1fb1('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x1fb1('0x1b')]=_0x1fb1('0x12');this[_0x1fb1('0x1c')]=0x0;this[_0x1fb1('0x1d')]=_0x5af469[_0x1fb1('0x1d')]||0x0;this[_0x1fb1('0x1e')]=0x0;this[_0x1fb1('0x1f')]=_0x1fb1('0x12');this[_0x1fb1('0x20')]=0x0;this['openchannelCapacity']=_0x5af469[_0x1fb1('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x1fb1('0x22')]=undefined;this[_0x1fb1('0x23')]='';this[_0x1fb1('0x24')]={};this['faxWaitingInteractions']={};this[_0x1fb1('0x25')]={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0x1fb1('0x26')]();}Agent[_0x1fb1('0x27')][_0x1fb1('0x28')]=function(_0x10924f){if(this[_0x10924f+_0x1fb1('0x29')]>0x0){if(this[_0x10924f+'Capacity']>0x0&&this[_0x10924f+_0x1fb1('0x29')]>=this[_0x10924f+_0x1fb1('0x2a')]){return _0x1fb1('0x2b');}else{return _0x1fb1('0x2c');}}else{return _0x1fb1('0x2d');}};Agent[_0x1fb1('0x27')][_0x1fb1('0x26')]=function(){var _0x2de1d4=['mail',_0x1fb1('0x2e'),_0x1fb1('0x2f'),_0x1fb1('0x30'),_0x1fb1('0x31'),_0x1fb1('0x32')];for(var _0x29e1bd=0x0;_0x29e1bd<_0x2de1d4[_0x1fb1('0x33')];_0x29e1bd+=0x1){var _0x15992c=this[_0x1fb1('0x28')](_0x2de1d4[_0x29e1bd]);if(this[_0x2de1d4[_0x29e1bd]+_0x1fb1('0x34')]!==_0x15992c){this[_0x2de1d4[_0x29e1bd]+_0x1fb1('0x35')]=_[_0x1fb1('0x36')](moment()[_0x1fb1('0x37')]('x'));}this[_0x2de1d4[_0x29e1bd]+_0x1fb1('0x34')]=_0x15992c;}var _0x2f6c88={'id':this['id'],'name':this['name'],'online':this[_0x1fb1('0x6')],'voicePause':this[_0x1fb1('0x7')],'chatPause':this[_0x1fb1('0x8')],'mailPause':this[_0x1fb1('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0x1fb1('0xa')],'openchannelPause':this[_0x1fb1('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x1fb1('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x1fb1('0x11')],'mailStatusTime':this[_0x1fb1('0x38')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x1fb1('0x14')],'faxStatus':this[_0x1fb1('0x15')],'faxStatusTime':this[_0x1fb1('0x16')],'faxCapacity':this[_0x1fb1('0x17')],'faxCurrentCapacity':this[_0x1fb1('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x1fb1('0x19')],'smsCapacity':this[_0x1fb1('0x1a')],'smsCurrentCapacity':this[_0x1fb1('0x39')],'whatsappStatus':this[_0x1fb1('0x1b')],'whatsappStatusTime':this[_0x1fb1('0x1c')],'whatsappCapacity':this[_0x1fb1('0x1d')],'whatsappCurrentCapacity':this[_0x1fb1('0x1e')],'openchannelStatus':this[_0x1fb1('0x1f')],'openchannelStatusTime':this[_0x1fb1('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x1fb1('0x3a')],'busy':this['busy'],'busyQueue':this[_0x1fb1('0x22')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x1fb1('0x3b')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x1fb1('0x3c')],'whatsappWaitingInteractions':this[_0x1fb1('0x3d')]};var _0x30df85=md5(JSON[_0x1fb1('0x3e')](_0x2f6c88));if(this['md5']!==_0x30df85){this[_0x1fb1('0x23')]=_0x30df85;io[_0x1fb1('0x3f')](_0x1fb1('0x40'),_['omit'](_0x2f6c88,[_0x1fb1('0x6')]));}};module[_0x1fb1('0x41')]=Agent; \ No newline at end of file +var _0x1a85=['whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','chatWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','faxStatusTime','whatsappStatus','openchannelWaitingInteractions','stringify','emit','user:routing:update','omit','moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1a85,0x178));var _0x51a8=function(_0x11e000,_0x12a8e5){_0x11e000=_0x11e000-0x0;var _0x110c27=_0x1a85[_0x11e000];return _0x110c27;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x51a8('0x0'));var Redis=require(_0x51a8('0x1'));var config=require(_0x51a8('0x2'));config['redis']=_['defaults'](config[_0x51a8('0x3')],{'host':_0x51a8('0x4'),'port':0x18eb});var io=require(_0x51a8('0x5'))(new Redis(config['redis']));function Agent(_0xaac0bf){this['id']=_0xaac0bf['id']||0x0;this['name']=_0xaac0bf[_0x51a8('0x6')]||'';this['online']=_0xaac0bf[_0x51a8('0x7')]||!![];this[_0x51a8('0x8')]=_0xaac0bf['voicePause']||![];this[_0x51a8('0x9')]=_0xaac0bf['chatPause']||![];this['mailPause']=_0xaac0bf[_0x51a8('0xa')]||![];this[_0x51a8('0xb')]=_0xaac0bf[_0x51a8('0xb')]||![];this[_0x51a8('0xc')]=_0xaac0bf[_0x51a8('0xc')]||![];this[_0x51a8('0xd')]=_0xaac0bf[_0x51a8('0xd')]||![];this[_0x51a8('0xe')]=_0x51a8('0xf');this[_0x51a8('0x10')]=0x0;this[_0x51a8('0x11')]=_0xaac0bf[_0x51a8('0x11')]||0x0;this[_0x51a8('0x12')]=0x0;this[_0x51a8('0x13')]=_0x51a8('0xf');this[_0x51a8('0x14')]=0x0;this[_0x51a8('0x15')]=_0xaac0bf['mailCapacity']||0x0;this[_0x51a8('0x16')]=0x0;this[_0x51a8('0x17')]=_0x51a8('0xf');this['faxStatusTime']=0x0;this[_0x51a8('0x18')]=_0xaac0bf['faxCapacity']||0x0;this[_0x51a8('0x19')]=0x0;this[_0x51a8('0x1a')]=_0x51a8('0xf');this[_0x51a8('0x1b')]=0x0;this[_0x51a8('0x1c')]=_0xaac0bf[_0x51a8('0x1c')]||0x0;this[_0x51a8('0x1d')]=0x0;this['whatsappStatus']=_0x51a8('0xf');this[_0x51a8('0x1e')]=0x0;this[_0x51a8('0x1f')]=_0xaac0bf[_0x51a8('0x1f')]||0x0;this[_0x51a8('0x20')]=0x0;this[_0x51a8('0x21')]='unknown';this[_0x51a8('0x22')]=0x0;this[_0x51a8('0x23')]=_0xaac0bf[_0x51a8('0x23')]||0x0;this[_0x51a8('0x24')]=0x0;this[_0x51a8('0x25')]=![];this[_0x51a8('0x26')]=undefined;this[_0x51a8('0x27')]='';this[_0x51a8('0x28')]={};this['faxWaitingInteractions']={};this[_0x51a8('0x29')]={};this['openchannelWaitingInteractions']={};this[_0x51a8('0x2a')]={};this[_0x51a8('0x2b')]={};this[_0x51a8('0x2c')]();}Agent[_0x51a8('0x2d')]['getChannelStatus']=function(_0xae3588){if(this[_0xae3588+'CurrentCapacity']>0x0){if(this[_0xae3588+'Capacity']>0x0&&this[_0xae3588+_0x51a8('0x2e')]>=this[_0xae3588+'Capacity']){return _0x51a8('0x2f');}else{return _0x51a8('0x30');}}else{return _0x51a8('0x31');}};Agent[_0x51a8('0x2d')][_0x51a8('0x2c')]=function(){var _0x2f2f05=[_0x51a8('0x32'),_0x51a8('0x33'),'openchannel',_0x51a8('0x34'),_0x51a8('0x35'),_0x51a8('0x36')];for(var _0x3da187=0x0;_0x3da187<_0x2f2f05[_0x51a8('0x37')];_0x3da187+=0x1){var _0x11aefc=this[_0x51a8('0x38')](_0x2f2f05[_0x3da187]);if(this[_0x2f2f05[_0x3da187]+_0x51a8('0x39')]!==_0x11aefc){this[_0x2f2f05[_0x3da187]+_0x51a8('0x3a')]=_[_0x51a8('0x3b')](moment()[_0x51a8('0x3c')]('x'));}this[_0x2f2f05[_0x3da187]+_0x51a8('0x39')]=_0x11aefc;}var _0x4a1548={'id':this['id'],'name':this[_0x51a8('0x6')],'online':this['online'],'voicePause':this[_0x51a8('0x8')],'chatPause':this[_0x51a8('0x9')],'mailPause':this[_0x51a8('0xa')],'smsPause':this[_0x51a8('0xc')],'faxPause':this[_0x51a8('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x51a8('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x51a8('0x11')],'chatCurrentCapacity':this[_0x51a8('0x12')],'mailStatus':this[_0x51a8('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x51a8('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x51a8('0x17')],'faxStatusTime':this[_0x51a8('0x3d')],'faxCapacity':this[_0x51a8('0x18')],'faxCurrentCapacity':this[_0x51a8('0x19')],'smsStatus':this[_0x51a8('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x51a8('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x51a8('0x3e')],'whatsappStatusTime':this[_0x51a8('0x1e')],'whatsappCapacity':this[_0x51a8('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x51a8('0x21')],'openchannelStatusTime':this[_0x51a8('0x22')],'openchannelCapacity':this[_0x51a8('0x23')],'openchannelCurrentCapacity':this[_0x51a8('0x24')],'busy':this[_0x51a8('0x25')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x51a8('0x29')],'openchannelWaitingInteractions':this[_0x51a8('0x3f')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x51a8('0x2b')]};var _0x4ec0ac=md5(JSON[_0x51a8('0x40')](_0x4a1548));if(this[_0x51a8('0x27')]!==_0x4ec0ac){this[_0x51a8('0x27')]=_0x4ec0ac;io[_0x51a8('0x41')](_0x51a8('0x42'),_[_0x51a8('0x43')](_0x4a1548,['online']));}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 8a48d5c..7c8a5fe 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 _0x40fd=['loggedIn','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','exports','md5','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','map','paused','online'];(function(_0x96a61a,_0x4c8ee8){var _0x495bef=function(_0x3f3c60){while(--_0x3f3c60){_0x96a61a['push'](_0x96a61a['shift']());}};_0x495bef(++_0x4c8ee8);}(_0x40fd,0xbf));var _0xd40f=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x40fd[_0x1064bc];return _0x5edc45;};'use strict';var _=require('lodash');var md5=require(_0xd40f('0x0'));var util=require('util');var Redis=require(_0xd40f('0x1'));var config=require('../../../config/environment');config[_0xd40f('0x2')]=_['defaults'](config[_0xd40f('0x2')],{'host':_0xd40f('0x3'),'port':0x18eb});var io=require(_0xd40f('0x4'))(new Redis(config['redis']));function ChatQueue(_0x7db4e){this['id']=_0x7db4e['id']||0x0;this[_0xd40f('0x5')]=_0x7db4e[_0xd40f('0x5')]||'';this[_0xd40f('0x6')]=_0x7db4e[_0xd40f('0x6')]||0xa;this[_0xd40f('0x7')]=_0x7db4e[_0xd40f('0x7')]||_0xd40f('0x8');this[_0xd40f('0x9')]=_0x7db4e['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xd40f('0x0')]='';this[_0xd40f('0xa')]();this[_0xd40f('0xb')]();}ChatQueue[_0xd40f('0xc')][_0xd40f('0xa')]=function(){var _0x170911=this[_0xd40f('0xd')]['_rr'];this[_0xd40f('0xd')]=_[_0xd40f('0xe')](this[_0xd40f('0x9')],'id');this[_0xd40f('0xd')]['_rr']=_0x170911;};ChatQueue[_0xd40f('0xc')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xd40f('0xf')]=0x0;for(var _0x164418=0x0;_0x164418=0x0?this[_0xd40f('0x13')]:0x0;var _0x19565d={'id':this['id'],'available':this[_0xd40f('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xd40f('0x5')],'paused':this[_0xd40f('0xf')],'waiting':this[_0xd40f('0x14')]};var _0x387a07=md5(JSON[_0xd40f('0x15')](_0x19565d));if(this[_0xd40f('0x0')]!==_0x387a07){this[_0xd40f('0x0')]=_0x387a07;io['to'](util[_0xd40f('0x16')](_0xd40f('0x17'),_0x19565d['name']))[_0xd40f('0x18')]('chat_queue:save',_0x19565d);}};module[_0xd40f('0x19')]=ChatQueue; \ No newline at end of file +var _0x64d2=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','paused','available','stringify','format','chat_queue:save','exports','md5'];(function(_0x14108b,_0xaef524){var _0x14ad65=function(_0x3a9e03){while(--_0x3a9e03){_0x14108b['push'](_0x14108b['shift']());}};_0x14ad65(++_0xaef524);}(_0x64d2,0x143));var _0x264d=function(_0x1bc4d3,_0x9bb12f){_0x1bc4d3=_0x1bc4d3-0x0;var _0x506aa1=_0x64d2[_0x1bc4d3];return _0x506aa1;};'use strict';var _=require('lodash');var md5=require(_0x264d('0x0'));var util=require('util');var Redis=require(_0x264d('0x1'));var config=require(_0x264d('0x2'));config[_0x264d('0x3')]=_[_0x264d('0x4')](config[_0x264d('0x3')],{'host':_0x264d('0x5'),'port':0x18eb});var io=require(_0x264d('0x6'))(new Redis(config['redis']));function ChatQueue(_0x1986b7){this['id']=_0x1986b7['id']||0x0;this['name']=_0x1986b7[_0x264d('0x7')]||'';this[_0x264d('0x8')]=_0x1986b7[_0x264d('0x8')]||0xa;this[_0x264d('0x9')]=_0x1986b7[_0x264d('0x9')]||_0x264d('0xa');this[_0x264d('0xb')]=_0x1986b7[_0x264d('0xb')];this[_0x264d('0xc')]={};this[_0x264d('0xd')]=0x0;this['md5']='';this[_0x264d('0xe')]();this[_0x264d('0xf')]();}ChatQueue['prototype'][_0x264d('0xe')]=function(){var _0x3d6201=this['mapAgentsId'][_0x264d('0x10')];this[_0x264d('0xc')]=_[_0x264d('0x11')](this[_0x264d('0xb')],'id');this[_0x264d('0xc')][_0x264d('0x10')]=_0x3d6201;};ChatQueue[_0x264d('0x12')][_0x264d('0xf')]=function(){this[_0x264d('0x13')]=0x0;this['paused']=0x0;for(var _0x543fed=0x0;_0x543fed=0x0?this[_0x264d('0x16')]:0x0;var _0x43a96e={'id':this['id'],'available':this[_0x264d('0x16')],'loggedIn':this[_0x264d('0x13')],'name':this[_0x264d('0x7')],'paused':this[_0x264d('0x15')],'waiting':this[_0x264d('0xd')]};var _0x46dfc5=md5(JSON[_0x264d('0x17')](_0x43a96e));if(this[_0x264d('0x0')]!==_0x46dfc5){this[_0x264d('0x0')]=_0x46dfc5;io['to'](util[_0x264d('0x18')]('chat:queue:%s',_0x43a96e[_0x264d('0x7')]))['emit'](_0x264d('0x19'),_0x43a96e);}};module[_0x264d('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 6a8ea2c..8b87ed2 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 _0x81e3=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','online','available','stringify','format','fax:queue:%s','emit','lodash','md5'];(function(_0x46b5ba,_0x4fbd36){var _0x3dd2db=function(_0x49be4f){while(--_0x49be4f){_0x46b5ba['push'](_0x46b5ba['shift']());}};_0x3dd2db(++_0x4fbd36);}(_0x81e3,0x13d));var _0x381e=function(_0x1410a9,_0x2d4289){_0x1410a9=_0x1410a9-0x0;var _0x43339d=_0x81e3[_0x1410a9];return _0x43339d;};'use strict';var _=require(_0x381e('0x0'));var md5=require(_0x381e('0x1'));var util=require(_0x381e('0x2'));var Redis=require(_0x381e('0x3'));var config=require(_0x381e('0x4'));config[_0x381e('0x5')]=_[_0x381e('0x6')](config[_0x381e('0x5')],{'host':_0x381e('0x7'),'port':0x18eb});var io=require(_0x381e('0x8'))(new Redis(config[_0x381e('0x5')]));function FaxQueue(_0x5dceff){this['id']=_0x5dceff['id']||0x0;this[_0x381e('0x9')]=_0x5dceff[_0x381e('0x9')]||'';this['timeout']=_0x5dceff[_0x381e('0xa')]||0xa;this['strategy']=_0x5dceff[_0x381e('0xb')]||_0x381e('0xc');this['Agents']=_0x5dceff[_0x381e('0xd')];this['mapAgentsId']={};this[_0x381e('0xe')]=0x0;this['md5']='';this[_0x381e('0xf')]();this[_0x381e('0x10')]();}FaxQueue['prototype'][_0x381e('0xf')]=function(){var _0x3146e3=this[_0x381e('0x11')][_0x381e('0x12')];this[_0x381e('0x11')]=_[_0x381e('0x13')](this[_0x381e('0xd')],'id');this['mapAgentsId']['_rr']=_0x3146e3;};FaxQueue[_0x381e('0x14')][_0x381e('0x10')]=function(){this[_0x381e('0x15')]=0x0;this[_0x381e('0x16')]=0x0;for(var _0x45d93a=0x0;_0x45d93a=0x0?this['available']:0x0;var _0x2d8c66={'id':this['id'],'available':this[_0x381e('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x381e('0x9')],'paused':this[_0x381e('0x16')],'waiting':this[_0x381e('0xe')]};var _0x1101ff=md5(JSON[_0x381e('0x19')](_0x2d8c66));if(this[_0x381e('0x1')]!==_0x1101ff){this[_0x381e('0x1')]=_0x1101ff;io['to'](util[_0x381e('0x1a')](_0x381e('0x1b'),_0x2d8c66[_0x381e('0x9')]))[_0x381e('0x1c')]('fax_queue:save',_0x2d8c66);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x4db6=['../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','md5','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','stringify','format','fax:queue:%s','emit','lodash','util','ioredis'];(function(_0x39ae4e,_0x44a089){var _0x49a003=function(_0x13e851){while(--_0x13e851){_0x39ae4e['push'](_0x39ae4e['shift']());}};_0x49a003(++_0x44a089);}(_0x4db6,0x126));var _0x64db=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x4db6[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0x64db('0x0'));var md5=require('md5');var util=require(_0x64db('0x1'));var Redis=require(_0x64db('0x2'));var config=require(_0x64db('0x3'));config[_0x64db('0x4')]=_['defaults'](config[_0x64db('0x4')],{'host':_0x64db('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x64db('0x4')]));function FaxQueue(_0x242f4a){this['id']=_0x242f4a['id']||0x0;this[_0x64db('0x6')]=_0x242f4a[_0x64db('0x6')]||'';this['timeout']=_0x242f4a[_0x64db('0x7')]||0xa;this[_0x64db('0x8')]=_0x242f4a[_0x64db('0x8')]||'beepall';this[_0x64db('0x9')]=_0x242f4a[_0x64db('0x9')];this['mapAgentsId']={};this[_0x64db('0xa')]=0x0;this[_0x64db('0xb')]='';this['updateRouting']();this[_0x64db('0xc')]();}FaxQueue[_0x64db('0xd')][_0x64db('0xe')]=function(){var _0x7de737=this[_0x64db('0xf')][_0x64db('0x10')];this[_0x64db('0xf')]=_[_0x64db('0x11')](this[_0x64db('0x9')],'id');this[_0x64db('0xf')][_0x64db('0x10')]=_0x7de737;};FaxQueue[_0x64db('0xd')][_0x64db('0xc')]=function(){this[_0x64db('0x12')]=0x0;this[_0x64db('0x13')]=0x0;for(var _0x2f4224=0x0;_0x2f4224=0x0?this['available']:0x0;var _0x31f5be={'id':this['id'],'available':this[_0x64db('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x64db('0x6')],'paused':this[_0x64db('0x13')],'waiting':this['waiting']};var _0x8cf6f8=md5(JSON[_0x64db('0x17')](_0x31f5be));if(this[_0x64db('0xb')]!==_0x8cf6f8){this['md5']=_0x8cf6f8;io['to'](util[_0x64db('0x18')](_0x64db('0x19'),_0x31f5be[_0x64db('0x6')]))[_0x64db('0x1a')]('fax_queue:save',_0x31f5be);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 772286f..878621a 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 _0x3c5d=['exports','name','Intervals'];(function(_0xd72008,_0x3fabee){var _0x1e5b98=function(_0x2704eb){while(--_0x2704eb){_0xd72008['push'](_0xd72008['shift']());}};_0x1e5b98(++_0x3fabee);}(_0x3c5d,0x11b));var _0xd3c5=function(_0x48da1b,_0x2dcd8d){_0x48da1b=_0x48da1b-0x0;var _0x367d4f=_0x3c5d[_0x48da1b];return _0x367d4f;};'use strict';function Interval(_0xbbf4dd){this['id']=_0xbbf4dd['id']||0x0;this[_0xd3c5('0x0')]=_0xbbf4dd[_0xd3c5('0x0')]||'';this['Intervals']=_0xbbf4dd[_0xd3c5('0x1')]||{};}module[_0xd3c5('0x2')]=Interval; \ No newline at end of file +var _0xdb36=['name','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb36,0x17e));var _0x6db3=function(_0x6faed5,_0xc5fed7){_0x6faed5=_0x6faed5-0x0;var _0x10cc01=_0xdb36[_0x6faed5];return _0x10cc01;};'use strict';function Interval(_0x265eac){this['id']=_0x265eac['id']||0x0;this[_0x6db3('0x0')]=_0x265eac[_0x6db3('0x0')]||'';this[_0x6db3('0x1')]=_0x265eac[_0x6db3('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 0a12507..5d8048a 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 _0xd8e2=['format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0xd8e2,0x18a));var _0x2d8e=function(_0x1dee00,_0x58bfda){_0x1dee00=_0x1dee00-0x0;var _0x17c4a7=_0xd8e2[_0x1dee00];return _0x17c4a7;};'use strict';var _=require(_0x2d8e('0x0'));var md5=require(_0x2d8e('0x1'));var util=require(_0x2d8e('0x2'));var Redis=require(_0x2d8e('0x3'));var config=require(_0x2d8e('0x4'));config[_0x2d8e('0x5')]=_[_0x2d8e('0x6')](config[_0x2d8e('0x5')],{'host':_0x2d8e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d8e('0x5')]));function MailQueue(_0x22a705){this['id']=_0x22a705['id']||0x0;this[_0x2d8e('0x8')]=_0x22a705[_0x2d8e('0x8')]||'';this[_0x2d8e('0x9')]=_0x22a705[_0x2d8e('0x9')]||0xa;this['strategy']=_0x22a705[_0x2d8e('0xa')]||_0x2d8e('0xb');this['Agents']=_0x22a705[_0x2d8e('0xc')];this['mapAgentsId']={};this[_0x2d8e('0xd')]=0x0;this['md5']='';this[_0x2d8e('0xe')]();this['updateRealtime']();}MailQueue[_0x2d8e('0xf')][_0x2d8e('0xe')]=function(){var _0x454bde=this[_0x2d8e('0x10')][_0x2d8e('0x11')];this['mapAgentsId']=_['map'](this[_0x2d8e('0xc')],'id');this[_0x2d8e('0x10')]['_rr']=_0x454bde;};MailQueue[_0x2d8e('0xf')][_0x2d8e('0x12')]=function(){this[_0x2d8e('0x13')]=0x0;this[_0x2d8e('0x14')]=0x0;for(var _0x3184d2=0x0;_0x3184d2=0x0?this['available']:0x0;var _0x374f2c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2d8e('0x13')],'name':this[_0x2d8e('0x8')],'paused':this[_0x2d8e('0x14')],'waiting':this['waiting']};var _0x57ed73=md5(JSON[_0x2d8e('0x19')](_0x374f2c));if(this['md5']!==_0x57ed73){this[_0x2d8e('0x1')]=_0x57ed73;io['to'](util[_0x2d8e('0x1a')](_0x2d8e('0x1b'),_0x374f2c[_0x2d8e('0x8')]))[_0x2d8e('0x1c')](_0x2d8e('0x1d'),_0x374f2c);}};module['exports']=MailQueue; \ No newline at end of file +var _0x652f=['../../../config/environment','redis','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis'];(function(_0x2fa0a7,_0x188ed4){var _0x366c65=function(_0x251995){while(--_0x251995){_0x2fa0a7['push'](_0x2fa0a7['shift']());}};_0x366c65(++_0x188ed4);}(_0x652f,0x10b));var _0xf652=function(_0x4b78ad,_0x3e1d13){_0x4b78ad=_0x4b78ad-0x0;var _0x28d99e=_0x652f[_0x4b78ad];return _0x28d99e;};'use strict';var _=require(_0xf652('0x0'));var md5=require(_0xf652('0x1'));var util=require('util');var Redis=require(_0xf652('0x2'));var config=require(_0xf652('0x3'));config[_0xf652('0x4')]=_['defaults'](config[_0xf652('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xf652('0x5'))(new Redis(config[_0xf652('0x4')]));function MailQueue(_0x46159a){this['id']=_0x46159a['id']||0x0;this[_0xf652('0x6')]=_0x46159a[_0xf652('0x6')]||'';this[_0xf652('0x7')]=_0x46159a['timeout']||0xa;this['strategy']=_0x46159a['strategy']||_0xf652('0x8');this[_0xf652('0x9')]=_0x46159a[_0xf652('0x9')];this[_0xf652('0xa')]={};this[_0xf652('0xb')]=0x0;this['md5']='';this[_0xf652('0xc')]();this[_0xf652('0xd')]();}MailQueue['prototype'][_0xf652('0xc')]=function(){var _0x34ffd6=this[_0xf652('0xa')][_0xf652('0xe')];this[_0xf652('0xa')]=_[_0xf652('0xf')](this[_0xf652('0x9')],'id');this['mapAgentsId'][_0xf652('0xe')]=_0x34ffd6;};MailQueue[_0xf652('0x10')][_0xf652('0xd')]=function(){this[_0xf652('0x11')]=0x0;this[_0xf652('0x12')]=0x0;for(var _0x44e92a=0x0;_0x44e92a=0x0?this[_0xf652('0x14')]:0x0;var _0x3a8e28={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf652('0x11')],'name':this[_0xf652('0x6')],'paused':this[_0xf652('0x12')],'waiting':this[_0xf652('0xb')]};var _0x5725f4=md5(JSON[_0xf652('0x15')](_0x3a8e28));if(this[_0xf652('0x1')]!==_0x5725f4){this[_0xf652('0x1')]=_0x5725f4;io['to'](util[_0xf652('0x16')](_0xf652('0x17'),_0x3a8e28['name']))[_0xf652('0x18')](_0xf652('0x19'),_0x3a8e28);}};module[_0xf652('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 eef02e9..936cb09 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x35454e,_0x2fac3b){var _0x4372b2=function(_0x58f777){while(--_0x58f777){_0x35454e['push'](_0x35454e['shift']());}};_0x4372b2(++_0x2fac3b);}(_0x814b,0x1a2));var _0xb814=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0x814b[_0xee3051];return _0x139e81;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _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(_0x1df070,_0x393578){var _0x38cc9f=function(_0x2d2d4f){while(--_0x2d2d4f){_0x1df070['push'](_0x1df070['shift']());}};_0x38cc9f(++_0x393578);}(_0x814b,0x1a2));var _0xb814=function(_0x8d695e,_0x394999){_0x8d695e=_0x8d695e-0x0;var _0x3d156e=_0x814b[_0x8d695e];return _0x3d156e;};'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 e1c774c..29b348f 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 _0x4b1f=['waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','paused','available','loggedIn','stringify','format','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x47f762,_0x106ece){var _0x4d2585=function(_0x4de06b){while(--_0x4de06b){_0x47f762['push'](_0x47f762['shift']());}};_0x4d2585(++_0x106ece);}(_0x4b1f,0x195));var _0xf4b1=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x4b1f[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xf4b1('0x0'));var md5=require(_0xf4b1('0x1'));var util=require('util');var Redis=require(_0xf4b1('0x2'));var config=require(_0xf4b1('0x3'));config[_0xf4b1('0x4')]=_['defaults'](config[_0xf4b1('0x4')],{'host':_0xf4b1('0x5'),'port':0x18eb});var io=require(_0xf4b1('0x6'))(new Redis(config['redis']));function SmsQueue(_0x5f26a3){this['id']=_0x5f26a3['id']||0x0;this[_0xf4b1('0x7')]=_0x5f26a3[_0xf4b1('0x7')]||'';this[_0xf4b1('0x8')]=_0x5f26a3[_0xf4b1('0x8')]||0xa;this[_0xf4b1('0x9')]=_0x5f26a3['strategy']||'beepall';this['Agents']=_0x5f26a3[_0xf4b1('0xa')];this['mapAgentsId']={};this[_0xf4b1('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xf4b1('0xc')]();}SmsQueue[_0xf4b1('0xd')][_0xf4b1('0xe')]=function(){var _0x253fa8=this[_0xf4b1('0xf')][_0xf4b1('0x10')];this[_0xf4b1('0xf')]=_[_0xf4b1('0x11')](this[_0xf4b1('0xa')],'id');this[_0xf4b1('0xf')][_0xf4b1('0x10')]=_0x253fa8;};SmsQueue[_0xf4b1('0xd')][_0xf4b1('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3ea6f3=0x0;_0x3ea6f3=0x0?this[_0xf4b1('0x13')]:0x0;var _0x420f9e={'id':this['id'],'available':this[_0xf4b1('0x13')],'loggedIn':this[_0xf4b1('0x14')],'name':this[_0xf4b1('0x7')],'paused':this[_0xf4b1('0x12')],'waiting':this['waiting']};var _0x220cad=md5(JSON[_0xf4b1('0x15')](_0x420f9e));if(this['md5']!==_0x220cad){this[_0xf4b1('0x1')]=_0x220cad;io['to'](util[_0xf4b1('0x16')]('sms:queue:%s',_0x420f9e[_0xf4b1('0x7')]))[_0xf4b1('0x17')](_0xf4b1('0x18'),_0x420f9e);}};module[_0xf4b1('0x19')]=SmsQueue; \ No newline at end of file +var _0x049e=['ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','smsPause','available','waiting','format','sms:queue:%s','sms_queue:save','exports','lodash','md5'];(function(_0x5b45df,_0xad4e74){var _0x65f5d0=function(_0x19b116){while(--_0x19b116){_0x5b45df['push'](_0x5b45df['shift']());}};_0x65f5d0(++_0xad4e74);}(_0x049e,0x16a));var _0xe049=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x049e[_0x446208];return _0xe49563;};'use strict';var _=require(_0xe049('0x0'));var md5=require(_0xe049('0x1'));var util=require('util');var Redis=require(_0xe049('0x2'));var config=require('../../../config/environment');config[_0xe049('0x3')]=_[_0xe049('0x4')](config[_0xe049('0x3')],{'host':_0xe049('0x5'),'port':0x18eb});var io=require(_0xe049('0x6'))(new Redis(config['redis']));function SmsQueue(_0x352aa6){this['id']=_0x352aa6['id']||0x0;this[_0xe049('0x7')]=_0x352aa6[_0xe049('0x7')]||'';this[_0xe049('0x8')]=_0x352aa6[_0xe049('0x8')]||0xa;this[_0xe049('0x9')]=_0x352aa6[_0xe049('0x9')]||'beepall';this[_0xe049('0xa')]=_0x352aa6[_0xe049('0xa')];this[_0xe049('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xe049('0xc')]();this[_0xe049('0xd')]();}SmsQueue[_0xe049('0xe')]['updateRouting']=function(){var _0x49e2fe=this['mapAgentsId'][_0xe049('0xf')];this[_0xe049('0xb')]=_[_0xe049('0x10')](this[_0xe049('0xa')],'id');this[_0xe049('0xb')][_0xe049('0xf')]=_0x49e2fe;};SmsQueue[_0xe049('0xe')][_0xe049('0xd')]=function(){this['loggedIn']=0x0;this[_0xe049('0x11')]=0x0;for(var _0x3f4a57=0x0;_0x3f4a57=0x0?this['available']:0x0;var _0x520dd9={'id':this['id'],'available':this[_0xe049('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xe049('0x11')],'waiting':this[_0xe049('0x17')]};var _0x5ae414=md5(JSON['stringify'](_0x520dd9));if(this[_0xe049('0x1')]!==_0x5ae414){this[_0xe049('0x1')]=_0x5ae414;io['to'](util[_0xe049('0x18')](_0xe049('0x19'),_0x520dd9['name']))['emit'](_0xe049('0x1a'),_0x520dd9);}};module[_0xe049('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index aef6bf2..4c7fdd5 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 _0xe823=['updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','online','available','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting'];(function(_0x1ffb8b,_0x142470){var _0x8ef031=function(_0x23fcca){while(--_0x23fcca){_0x1ffb8b['push'](_0x1ffb8b['shift']());}};_0x8ef031(++_0x142470);}(_0xe823,0x11b));var _0x3e82=function(_0x423d8a,_0x82a0a8){_0x423d8a=_0x423d8a-0x0;var _0x55bdb3=_0xe823[_0x423d8a];return _0x55bdb3;};'use strict';var _=require(_0x3e82('0x0'));var md5=require(_0x3e82('0x1'));var util=require('util');var Redis=require(_0x3e82('0x2'));var config=require(_0x3e82('0x3'));config[_0x3e82('0x4')]=_[_0x3e82('0x5')](config['redis'],{'host':_0x3e82('0x6'),'port':0x18eb});var io=require(_0x3e82('0x7'))(new Redis(config[_0x3e82('0x4')]));function WhatsappQueue(_0x5a8208){this['id']=_0x5a8208['id']||0x0;this[_0x3e82('0x8')]=_0x5a8208[_0x3e82('0x8')]||'';this['timeout']=_0x5a8208[_0x3e82('0x9')]||0xa;this[_0x3e82('0xa')]=_0x5a8208[_0x3e82('0xa')]||'beepall';this[_0x3e82('0xb')]=_0x5a8208[_0x3e82('0xb')];this['mapAgentsId']={};this[_0x3e82('0xc')]=0x0;this[_0x3e82('0x1')]='';this[_0x3e82('0xd')]();this[_0x3e82('0xe')]();}WhatsappQueue[_0x3e82('0xf')][_0x3e82('0xd')]=function(){var _0x2195c7=this[_0x3e82('0x10')][_0x3e82('0x11')];this[_0x3e82('0x10')]=_['map'](this[_0x3e82('0xb')],'id');this['mapAgentsId'][_0x3e82('0x11')]=_0x2195c7;};WhatsappQueue[_0x3e82('0xf')][_0x3e82('0xe')]=function(){this[_0x3e82('0x12')]=0x0;this[_0x3e82('0x13')]=0x0;for(var _0x164ac8=0x0;_0x164ac8=0x0?this['available']:0x0;var _0x127dd9={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3e82('0x12')],'name':this[_0x3e82('0x8')],'paused':this['paused'],'waiting':this[_0x3e82('0xc')]};var _0x1c76c3=md5(JSON['stringify'](_0x127dd9));if(this['md5']!==_0x1c76c3){this[_0x3e82('0x1')]=_0x1c76c3;io['to'](util['format'](_0x3e82('0x17'),_0x127dd9[_0x3e82('0x8')]))[_0x3e82('0x18')](_0x3e82('0x19'),_0x127dd9);}};module[_0x3e82('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x547b=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','whatsappPause','available','paused','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x231473,_0x33b93e){var _0x16d666=function(_0x35ed3a){while(--_0x35ed3a){_0x231473['push'](_0x231473['shift']());}};_0x16d666(++_0x33b93e);}(_0x547b,0x1a5));var _0xb547=function(_0x4f460e,_0x165aa0){_0x4f460e=_0x4f460e-0x0;var _0x209232=_0x547b[_0x4f460e];return _0x209232;};'use strict';var _=require(_0xb547('0x0'));var md5=require(_0xb547('0x1'));var util=require(_0xb547('0x2'));var Redis=require(_0xb547('0x3'));var config=require(_0xb547('0x4'));config[_0xb547('0x5')]=_[_0xb547('0x6')](config[_0xb547('0x5')],{'host':_0xb547('0x7'),'port':0x18eb});var io=require(_0xb547('0x8'))(new Redis(config[_0xb547('0x5')]));function WhatsappQueue(_0x1d4659){this['id']=_0x1d4659['id']||0x0;this['name']=_0x1d4659[_0xb547('0x9')]||'';this['timeout']=_0x1d4659[_0xb547('0xa')]||0xa;this[_0xb547('0xb')]=_0x1d4659[_0xb547('0xb')]||_0xb547('0xc');this['Agents']=_0x1d4659[_0xb547('0xd')];this[_0xb547('0xe')]={};this[_0xb547('0xf')]=0x0;this[_0xb547('0x1')]='';this[_0xb547('0x10')]();this[_0xb547('0x11')]();}WhatsappQueue['prototype'][_0xb547('0x10')]=function(){var _0x55590b=this[_0xb547('0xe')][_0xb547('0x12')];this[_0xb547('0xe')]=_[_0xb547('0x13')](this[_0xb547('0xd')],'id');this['mapAgentsId'][_0xb547('0x12')]=_0x55590b;};WhatsappQueue[_0xb547('0x14')]['updateRealtime']=function(){this[_0xb547('0x15')]=0x0;this['paused']=0x0;for(var _0x12193b=0x0;_0x12193b=0x0?this[_0xb547('0x19')]:0x0;var _0xe8f2c8={'id':this['id'],'available':this[_0xb547('0x19')],'loggedIn':this[_0xb547('0x15')],'name':this[_0xb547('0x9')],'paused':this[_0xb547('0x1a')],'waiting':this['waiting']};var _0x41f67b=md5(JSON[_0xb547('0x1b')](_0xe8f2c8));if(this['md5']!==_0x41f67b){this['md5']=_0x41f67b;io['to'](util[_0xb547('0x1c')](_0xb547('0x1d'),_0xe8f2c8[_0xb547('0x9')]))[_0xb547('0x1e')](_0xb547('0x1f'),_0xe8f2c8);}};module[_0xb547('0x20')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 2b6a5b3..0d74c52 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0xb14310,_0x2b7b6c){var _0x2e7c1e=function(_0x1f1ac5){while(--_0x1f1ac5){_0xb14310['push'](_0xb14310['shift']());}};_0x2e7c1e(++_0x2b7b6c);}(_0xb10b,0x12a));var _0xbb10=function(_0x49392e,_0x441b28){_0x49392e=_0x49392e-0x0;var _0xe978bb=_0xb10b[_0x49392e];return _0xe978bb;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4b309b,_0x14f4ec){var _0x49f58d=function(_0xa829da){while(--_0xa829da){_0x4b309b['push'](_0x4b309b['shift']());}};_0x49f58d(++_0x14f4ec);}(_0xb10b,0x12a));var _0xbb10=function(_0x4031e5,_0x5d9cd0){_0x4031e5=_0x4031e5-0x0;var _0x25b248=_0xb10b[_0x4031e5];return _0x25b248;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 765ed50..6b43a43 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 _0xab6e=['Request','addTagsToChatInteraction','update','UpdateChatInteraction','updateChatInteraction'];(function(_0x17b3cb,_0x10ee88){var _0x561e1c=function(_0xba89e8){while(--_0xba89e8){_0x17b3cb['push'](_0x17b3cb['shift']());}};_0x561e1c(++_0x10ee88);}(_0xab6e,0x89));var _0xeab6=function(_0x482914,_0x3fe08e){_0x482914=_0x482914-0x0;var _0x151f6a=_0xab6e[_0x482914];return _0x151f6a;};'use strict';var client=require('../client');exports[_0xeab6('0x0')]=function(_0x5d93f9,_0x496ab5){return client['Request'](_0xeab6('0x1'),{'body':_0x496ab5,'options':{'where':{'id':_0x5d93f9}},'log':_0xeab6('0x2')});};exports['addTags']=function(_0x2641ed,_0x54fa77){return client[_0xeab6('0x3')]('AddTagsToChatInteraction',{'body':_0x54fa77,'options':{'where':{'id':_0x2641ed}},'log':_0xeab6('0x4')});}; \ No newline at end of file +var _0xbdce=['update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x1e118f,_0x1d429d){var _0x92eb43=function(_0x34f1f0){while(--_0x34f1f0){_0x1e118f['push'](_0x1e118f['shift']());}};_0x92eb43(++_0x1d429d);}(_0xbdce,0x125));var _0xebdc=function(_0x3e215a,_0xd79132){_0x3e215a=_0x3e215a-0x0;var _0x5b4c9d=_0xbdce[_0x3e215a];return _0x5b4c9d;};'use strict';var client=require(_0xebdc('0x0'));exports[_0xebdc('0x1')]=function(_0x525a58,_0x1bf0d4){return client[_0xebdc('0x2')]('UpdateChatInteraction',{'body':_0x1bf0d4,'options':{'where':{'id':_0x525a58}},'log':_0xebdc('0x3')});};exports[_0xebdc('0x4')]=function(_0x1bf8ea,_0x4a7eeb){return client[_0xebdc('0x2')](_0xebdc('0x5'),{'body':_0x4a7eeb,'options':{'where':{'id':_0x1bf8ea}},'log':_0xebdc('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 580f503..5f7c172 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 _0x9a7c=['create','Request','CreateChatMessage'];(function(_0x208429,_0x3f8848){var _0x406352=function(_0x2a8203){while(--_0x2a8203){_0x208429['push'](_0x208429['shift']());}};_0x406352(++_0x3f8848);}(_0x9a7c,0xff));var _0xc9a7=function(_0x428c36,_0x173281){_0x428c36=_0x428c36-0x0;var _0x58988a=_0x9a7c[_0x428c36];return _0x58988a;};'use strict';var client=require('../client');exports[_0xc9a7('0x0')]=function(_0x227843){return client[_0xc9a7('0x1')](_0xc9a7('0x2'),{'body':_0x227843,'log':'createChatMessage'});}; \ No newline at end of file +var _0xd693=['CreateChatMessage','createChatMessage','../client','create'];(function(_0x3d325d,_0x5b080f){var _0x298852=function(_0xf5c81a){while(--_0xf5c81a){_0x3d325d['push'](_0x3d325d['shift']());}};_0x298852(++_0x5b080f);}(_0xd693,0xda));var _0x3d69=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0xd693[_0x328b1c];return _0x4dbeaa;};'use strict';var client=require(_0x3d69('0x0'));exports[_0x3d69('0x1')]=function(_0xfa5b58){return client['Request'](_0x3d69('0x2'),{'body':_0xfa5b58,'log':_0x3d69('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index b9bdf9f..5b70d5a 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 _0x2208=['timeout','strategy','User','Agents','name','online','getChatQueues','GetChatQueue'];(function(_0xec9b03,_0xdff584){var _0x441303=function(_0x5e78a6){while(--_0x5e78a6){_0xec9b03['push'](_0xec9b03['shift']());}};_0x441303(++_0xdff584);}(_0x2208,0x11e));var _0x8220=function(_0x4b8f70,_0x2e3b2d){_0x4b8f70=_0x4b8f70-0x0;var _0x2f3e80=_0x2208[_0x4b8f70];return _0x2f3e80;};'use strict';var client=require('../client');exports[_0x8220('0x0')]=function(){return function(){return client['Request'](_0x8220('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x8220('0x2'),_0x8220('0x3')],'include':[{'model':_0x8220('0x4'),'as':_0x8220('0x5'),'attributes':['id',_0x8220('0x6'),_0x8220('0x7'),'chatPause']}]},'log':_0x8220('0x0')});};}; \ No newline at end of file +var _0xfb8f=['User','Agents','online','chatPause','getChatQueues','name','timeout','strategy'];(function(_0x31c6ca,_0x5b37b3){var _0x1b5088=function(_0x3c840b){while(--_0x3c840b){_0x31c6ca['push'](_0x31c6ca['shift']());}};_0x1b5088(++_0x5b37b3);}(_0xfb8f,0x18c));var _0xffb8=function(_0x18c254,_0x57f783){_0x18c254=_0x18c254-0x0;var _0x4cfe02=_0xfb8f[_0x18c254];return _0x4cfe02;};'use strict';var client=require('../client');exports[_0xffb8('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xffb8('0x1'),_0xffb8('0x2'),_0xffb8('0x3')],'include':[{'model':_0xffb8('0x4'),'as':_0xffb8('0x5'),'attributes':['id','name',_0xffb8('0x6'),_0xffb8('0x7')]}]},'log':_0xffb8('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 17ed715..4778296 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 _0xd816=['UpdateChatQueueReport','../client','create','Request'];(function(_0x127ec3,_0x4e160b){var _0x17ebe9=function(_0x1fc7e5){while(--_0x1fc7e5){_0x127ec3['push'](_0x127ec3['shift']());}};_0x17ebe9(++_0x4e160b);}(_0xd816,0xd5));var _0x6d81=function(_0x2c0b7c,_0x55a0df){_0x2c0b7c=_0x2c0b7c-0x0;var _0xdafc83=_0xd816[_0x2c0b7c];return _0xdafc83;};'use strict';var client=require(_0x6d81('0x0'));exports[_0x6d81('0x1')]=function(_0x5449cb){return client[_0x6d81('0x2')]('CreateChatQueueReport',{'body':_0x5449cb,'log':'CreateChatQueueReport'});};exports['update']=function(_0x2a4988,_0x39a52f){return client[_0x6d81('0x2')](_0x6d81('0x3'),{'body':_0x39a52f,'options':{'where':{'uniqueid':_0x2a4988},'order':[['id','DESC']],'limit':0x1},'log':_0x6d81('0x3')});}; \ No newline at end of file +var _0x65f4=['DESC','UpdateChatQueueReport','Request','CreateChatQueueReport'];(function(_0x47faad,_0x230b04){var _0x4c449a=function(_0x426c7e){while(--_0x426c7e){_0x47faad['push'](_0x47faad['shift']());}};_0x4c449a(++_0x230b04);}(_0x65f4,0x19a));var _0x465f=function(_0x5d64a7,_0x2a9bf0){_0x5d64a7=_0x5d64a7-0x0;var _0xd32be7=_0x65f4[_0x5d64a7];return _0xd32be7;};'use strict';var client=require('../client');exports['create']=function(_0x39de85){return client[_0x465f('0x0')](_0x465f('0x1'),{'body':_0x39de85,'log':'CreateChatQueueReport'});};exports['update']=function(_0x32cc52,_0x3bf967){return client[_0x465f('0x0')]('UpdateChatQueueReport',{'body':_0x3bf967,'options':{'where':{'uniqueid':_0x32cc52},'order':[['id',_0x465f('0x2')]],'limit':0x1},'log':_0x465f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index a9f1a25..fcc6a5f 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(_0x4a8d6,_0x1d1239){var _0x3219b9=function(_0x4d8dae){while(--_0x4d8dae){_0x4a8d6['push'](_0x4a8d6['shift']());}};_0x3219b9(++_0x1d1239);}(_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,_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(_0x7a112,_0x2eb4a0){var _0x136dc5=function(_0x437650){while(--_0x437650){_0x7a112['push'](_0x7a112['shift']());}};_0x136dc5(++_0x2eb4a0);}(_0x7a54,0x106));var _0x47a5=function(_0x4ea7a0,_0x13a13b){_0x4ea7a0=_0x4ea7a0-0x0;var _0x24769e=_0x7a54[_0x4ea7a0];return _0x24769e;};'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 2ab2740..9ba5511 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 _0x4e23=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4e23,0x7e));var _0x34e2=function(_0x45c519,_0x4278eb){_0x45c519=_0x45c519-0x0;var _0x13e3f0=_0x4e23[_0x45c519];return _0x13e3f0;};'use strict';var client=require(_0x34e2('0x0'));exports[_0x34e2('0x1')]=function(_0x2e74a7){return client[_0x34e2('0x2')](_0x34e2('0x3'),{'body':_0x2e74a7,'log':_0x34e2('0x4')});}; \ No newline at end of file +var _0x3410=['create','../client'];(function(_0x593e12,_0x1cdaf9){var _0x8a6a30=function(_0x29a3cc){while(--_0x29a3cc){_0x593e12['push'](_0x593e12['shift']());}};_0x8a6a30(++_0x1cdaf9);}(_0x3410,0x17d));var _0x0341=function(_0x487240,_0x4ac7a5){_0x487240=_0x487240-0x0;var _0x3b7254=_0x3410[_0x487240];return _0x3b7254;};'use strict';var client=require(_0x0341('0x0'));exports[_0x0341('0x1')]=function(_0x2e431b){return client['Request']('CreateFaxMessage',{'body':_0x2e431b,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1055e65..219b0a0 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 _0x8c5b=['strategy','User','Agents','online','../client','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x3ba056,_0x3f420a){var _0x329d07=function(_0x4fb353){while(--_0x4fb353){_0x3ba056['push'](_0x3ba056['shift']());}};_0x329d07(++_0x3f420a);}(_0x8c5b,0x180));var _0xb8c5=function(_0x44c8cb,_0x2e28c7){_0x44c8cb=_0x44c8cb-0x0;var _0x3bf406=_0x8c5b[_0x44c8cb];return _0x3bf406;};'use strict';var client=require(_0xb8c5('0x0'));exports[_0xb8c5('0x1')]=function(){return function(){return client[_0xb8c5('0x2')](_0xb8c5('0x3'),{'options':{'raw':![],'attributes':['id',_0xb8c5('0x4'),_0xb8c5('0x5'),_0xb8c5('0x6')],'include':[{'model':_0xb8c5('0x7'),'as':_0xb8c5('0x8'),'attributes':['id',_0xb8c5('0x4'),_0xb8c5('0x9'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xe073=['User','online','faxPause','getFaxQueues','../client','Request','name','timeout','strategy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe073,0x1ea));var _0x3e07=function(_0x48f1f2,_0x108484){_0x48f1f2=_0x48f1f2-0x0;var _0x3737e8=_0xe073[_0x48f1f2];return _0x3737e8;};'use strict';var client=require(_0x3e07('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x3e07('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x3e07('0x2'),_0x3e07('0x3'),_0x3e07('0x4')],'include':[{'model':_0x3e07('0x5'),'as':'Agents','attributes':['id',_0x3e07('0x2'),_0x3e07('0x6'),_0x3e07('0x7')]}]},'log':_0x3e07('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 0dfd306..d4b24af 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 _0xda9e=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xda9e,0xac));var _0xeda9=function(_0x53a8bf,_0x59b79f){_0x53a8bf=_0x53a8bf-0x0;var _0x1cee30=_0xda9e[_0x53a8bf];return _0x1cee30;};'use strict';var client=require(_0xeda9('0x0'));exports[_0xeda9('0x1')]=function(_0x5da0f9){return client[_0xeda9('0x2')](_0xeda9('0x3'),{'body':_0x5da0f9,'log':_0xeda9('0x3')});};exports[_0xeda9('0x4')]=function(_0xd47fd5,_0x241087){return client['Request'](_0xeda9('0x5'),{'body':_0x241087,'options':{'where':{'uniqueid':_0xd47fd5},'order':[['id',_0xeda9('0x6')]],'limit':0x1},'log':_0xeda9('0x5')});}; \ No newline at end of file +var _0x2159=['CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client','create','Request'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x2159,0xe4));var _0x9215=function(_0x5a58e1,_0x5cf833){_0x5a58e1=_0x5a58e1-0x0;var _0x1061d4=_0x2159[_0x5a58e1];return _0x1061d4;};'use strict';var client=require(_0x9215('0x0'));exports[_0x9215('0x1')]=function(_0x1ef4fb){return client[_0x9215('0x2')](_0x9215('0x3'),{'body':_0x1ef4fb,'log':_0x9215('0x3')});};exports[_0x9215('0x4')]=function(_0x5de188,_0x1fd358){return client[_0x9215('0x2')]('UpdateFaxQueueReport',{'body':_0x1fd358,'options':{'where':{'uniqueid':_0x5de188},'order':[['id',_0x9215('0x5')]],'limit':0x1},'log':_0x9215('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e64aed1..2953126 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 _0xbbbb=['Request','Interval','Intervals','name','interval','../client','getIntervals'];(function(_0x154fa8,_0x1444dd){var _0x2d6586=function(_0x4ecae7){while(--_0x4ecae7){_0x154fa8['push'](_0x154fa8['shift']());}};_0x2d6586(++_0x1444dd);}(_0xbbbb,0x7c));var _0xbbbb=function(_0x1be67c,_0x24b9df){_0x1be67c=_0x1be67c-0x0;var _0x35850a=_0xbbbb[_0x1be67c];return _0x35850a;};'use strict';var client=require(_0xbbbb('0x0'));exports[_0xbbbb('0x1')]=function(){return function(){return client[_0xbbbb('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xbbbb('0x3'),'as':_0xbbbb('0x4'),'attributes':['id',_0xbbbb('0x5'),_0xbbbb('0x6')]}]},'log':_0xbbbb('0x1')});};}; \ No newline at end of file +var _0x455c=['name','Interval','interval','../client','getIntervals','Request','GetInterval'];(function(_0x2187b9,_0x32afa2){var _0xc40b26=function(_0x19cf62){while(--_0x19cf62){_0x2187b9['push'](_0x2187b9['shift']());}};_0xc40b26(++_0x32afa2);}(_0x455c,0x184));var _0xc455=function(_0x49a57f,_0x405f38){_0x49a57f=_0x49a57f-0x0;var _0x2fa2a5=_0x455c[_0x49a57f];return _0x2fa2a5;};'use strict';var client=require(_0xc455('0x0'));exports[_0xc455('0x1')]=function(){return function(){return client[_0xc455('0x2')](_0xc455('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc455('0x4')],'include':[{'model':_0xc455('0x5'),'as':'Intervals','attributes':['id',_0xc455('0x4'),_0xc455('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index e461f3e..7d737df 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 _0x1a85=['AddTagsToMailInteraction','Request','addTags'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1a85,0x178));var _0x51a8=function(_0x253673,_0x3287fb){_0x253673=_0x253673-0x0;var _0x259903=_0x1a85[_0x253673];return _0x259903;};'use strict';var client=require('../client');exports['update']=function(_0x305f18,_0x382cb8){return client[_0x51a8('0x0')]('UpdateMailInteraction',{'body':_0x382cb8,'options':{'where':{'id':_0x305f18}},'log':'updateMailInteraction'});};exports[_0x51a8('0x1')]=function(_0x1377a4,_0x99e371){return client['Request'](_0x51a8('0x2'),{'body':_0x99e371,'options':{'where':{'id':_0x1377a4}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x77d4=['update','UpdateMailInteraction','updateMailInteraction','Request','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x598f40,_0x52b170){var _0x1e48bb=function(_0x386c78){while(--_0x386c78){_0x598f40['push'](_0x598f40['shift']());}};_0x1e48bb(++_0x52b170);}(_0x77d4,0x108));var _0x477d=function(_0x244b18,_0x3e8f78){_0x244b18=_0x244b18-0x0;var _0xf3bf67=_0x77d4[_0x244b18];return _0xf3bf67;};'use strict';var client=require('../client');exports[_0x477d('0x0')]=function(_0x49b615,_0x18c0fe){return client['Request'](_0x477d('0x1'),{'body':_0x18c0fe,'options':{'where':{'id':_0x49b615}},'log':_0x477d('0x2')});};exports['addTags']=function(_0x53e1b8,_0x16213f){return client[_0x477d('0x3')](_0x477d('0x4'),{'body':_0x16213f,'options':{'where':{'id':_0x53e1b8}},'log':_0x477d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e463550..cd3b65b 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 _0x5349=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x477037,_0x653c1){var _0x3732fe=function(_0x23f8f7){while(--_0x23f8f7){_0x477037['push'](_0x477037['shift']());}};_0x3732fe(++_0x653c1);}(_0x5349,0x1b5));var _0x9534=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x5349[_0x8de54f];return _0x14cba4;};'use strict';var client=require(_0x9534('0x0'));exports[_0x9534('0x1')]=function(_0x5507fb){return client[_0x9534('0x2')](_0x9534('0x3'),{'body':_0x5507fb,'log':_0x9534('0x4')});}; \ No newline at end of file +var _0x8759=['Request','CreateMailMessage','createMailMessage','create'];(function(_0xa0af7,_0x18364e){var _0x405473=function(_0x29cb94){while(--_0x29cb94){_0xa0af7['push'](_0xa0af7['shift']());}};_0x405473(++_0x18364e);}(_0x8759,0x18f));var _0x9875=function(_0x34f29b,_0x3965a9){_0x34f29b=_0x34f29b-0x0;var _0x2a871c=_0x8759[_0x34f29b];return _0x2a871c;};'use strict';var client=require('../client');exports[_0x9875('0x0')]=function(_0x3a4a0a){return client[_0x9875('0x1')](_0x9875('0x2'),{'body':_0x3a4a0a,'log':_0x9875('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f330d9f..6c9b54f 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 _0xfceb=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','online','mailPause'];(function(_0x36eab2,_0x1188bb){var _0x47ba2d=function(_0xb0672c){while(--_0xb0672c){_0x36eab2['push'](_0x36eab2['shift']());}};_0x47ba2d(++_0x1188bb);}(_0xfceb,0xbd));var _0xbfce=function(_0x25d44f,_0x137f3d){_0x25d44f=_0x25d44f-0x0;var _0x5cb83c=_0xfceb[_0x25d44f];return _0x5cb83c;};'use strict';var client=require('../client');exports[_0xbfce('0x0')]=function(){return function(){return client[_0xbfce('0x1')](_0xbfce('0x2'),{'options':{'raw':![],'attributes':['id',_0xbfce('0x3'),_0xbfce('0x4'),_0xbfce('0x5')],'include':[{'model':_0xbfce('0x6'),'as':'Agents','attributes':['id',_0xbfce('0x3'),_0xbfce('0x7'),_0xbfce('0x8')]}]},'log':_0xbfce('0x0')});};}; \ No newline at end of file +var _0x1337=['User','../client','getMailQueues','name'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x1337,0x191));var _0x7133=function(_0x1d83a8,_0xe170f0){_0x1d83a8=_0x1d83a8-0x0;var _0x56c11d=_0x1337[_0x1d83a8];return _0x56c11d;};'use strict';var client=require(_0x7133('0x0'));exports[_0x7133('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x7133('0x2'),'timeout','strategy'],'include':[{'model':_0x7133('0x3'),'as':'Agents','attributes':['id',_0x7133('0x2'),'online','mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index a022e5d..f743692 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 _0xf07e=['UpdateMailQueueReport','../client','Request'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf07e,0x1c3));var _0xef07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf07e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xef07('0x0'));exports['create']=function(_0x3bfed0){return client['Request']('CreateMailQueueReport',{'body':_0x3bfed0,'log':'CreateMailQueueReport'});};exports['update']=function(_0x2dea78,_0x4b00e2){return client[_0xef07('0x1')]('UpdateMailQueueReport',{'body':_0x4b00e2,'options':{'where':{'uniqueid':_0x2dea78},'order':[['id','DESC']],'limit':0x1},'log':_0xef07('0x2')});}; \ No newline at end of file +var _0xa9ff=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9ff,0x1da));var _0xfa9f=function(_0x254081,_0x133020){_0x254081=_0x254081-0x0;var _0x15e822=_0xa9ff[_0x254081];return _0x15e822;};'use strict';var client=require(_0xfa9f('0x0'));exports[_0xfa9f('0x1')]=function(_0x50daa1){return client[_0xfa9f('0x2')](_0xfa9f('0x3'),{'body':_0x50daa1,'log':_0xfa9f('0x3')});};exports['update']=function(_0x1535ad,_0x1c8ffc){return client[_0xfa9f('0x2')](_0xfa9f('0x4'),{'body':_0x1c8ffc,'options':{'where':{'uniqueid':_0x1535ad},'order':[['id',_0xfa9f('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 e012bc6..1a9236e 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 _0xc692=['update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x2fc542,_0x445a9e){var _0x4bbdf1=function(_0x2d5549){while(--_0x2d5549){_0x2fc542['push'](_0x2fc542['shift']());}};_0x4bbdf1(++_0x445a9e);}(_0xc692,0xdf));var _0x2c69=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc692[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x2c69('0x0'));exports[_0x2c69('0x1')]=function(_0x327252,_0x40a0b5){return client[_0x2c69('0x2')](_0x2c69('0x3'),{'body':_0x40a0b5,'options':{'where':{'id':_0x327252}},'log':'updateOpenchannelInteraction'});};exports[_0x2c69('0x4')]=function(_0x29a063,_0x3c0198){return client[_0x2c69('0x2')](_0x2c69('0x5'),{'body':_0x3c0198,'options':{'where':{'id':_0x29a063}},'log':_0x2c69('0x6')});}; \ No newline at end of file +var _0x228e=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x31198d,_0x4e00db){var _0x109385=function(_0xa4c43e){while(--_0xa4c43e){_0x31198d['push'](_0x31198d['shift']());}};_0x109385(++_0x4e00db);}(_0x228e,0x1f1));var _0xe228=function(_0x498f1c,_0x3ef361){_0x498f1c=_0x498f1c-0x0;var _0x4e01c9=_0x228e[_0x498f1c];return _0x4e01c9;};'use strict';var client=require(_0xe228('0x0'));exports['update']=function(_0x553b7f,_0x1aa579){return client[_0xe228('0x1')](_0xe228('0x2'),{'body':_0x1aa579,'options':{'where':{'id':_0x553b7f}},'log':_0xe228('0x3')});};exports[_0xe228('0x4')]=function(_0x20d1ee,_0x181edc){return client['Request'](_0xe228('0x5'),{'body':_0x181edc,'options':{'where':{'id':_0x20d1ee}},'log':_0xe228('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index c40c70d..117b7d7 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 _0xf35b=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x376901,_0x481f0f){var _0x1545a4=function(_0x100476){while(--_0x100476){_0x376901['push'](_0x376901['shift']());}};_0x1545a4(++_0x481f0f);}(_0xf35b,0xbb));var _0xbf35=function(_0x1a9fb0,_0x2b728c){_0x1a9fb0=_0x1a9fb0-0x0;var _0x11a309=_0xf35b[_0x1a9fb0];return _0x11a309;};'use strict';var client=require(_0xbf35('0x0'));exports[_0xbf35('0x1')]=function(_0x4cf0e0){return client[_0xbf35('0x2')](_0xbf35('0x3'),{'body':_0x4cf0e0,'log':_0xbf35('0x4')});}; \ No newline at end of file +var _0xcdbd=['../client','create','Request','createOpenchannelMessage'];(function(_0x28fe26,_0x1141cc){var _0x3b7814=function(_0x5d939d){while(--_0x5d939d){_0x28fe26['push'](_0x28fe26['shift']());}};_0x3b7814(++_0x1141cc);}(_0xcdbd,0x6c));var _0xdcdb=function(_0x1f7743,_0x1fbc7f){_0x1f7743=_0x1f7743-0x0;var _0x17eb73=_0xcdbd[_0x1f7743];return _0x17eb73;};'use strict';var client=require(_0xdcdb('0x0'));exports[_0xdcdb('0x1')]=function(_0x42f949){return client[_0xdcdb('0x2')]('CreateOpenchannelMessage',{'body':_0x42f949,'log':_0xdcdb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d00417f..7981abc 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 _0xbe99=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','Agents','online'];(function(_0x174cf3,_0x27c5b8){var _0x4a0207=function(_0x4bfc8a){while(--_0x4bfc8a){_0x174cf3['push'](_0x174cf3['shift']());}};_0x4a0207(++_0x27c5b8);}(_0xbe99,0x196));var _0x9be9=function(_0x35af98,_0x103f33){_0x35af98=_0x35af98-0x0;var _0x5f5a62=_0xbe99[_0x35af98];return _0x5f5a62;};'use strict';var client=require(_0x9be9('0x0'));exports[_0x9be9('0x1')]=function(){return function(){return client[_0x9be9('0x2')](_0x9be9('0x3'),{'options':{'raw':![],'attributes':['id',_0x9be9('0x4'),'timeout',_0x9be9('0x5')],'include':[{'model':'User','as':_0x9be9('0x6'),'attributes':['id',_0x9be9('0x4'),_0x9be9('0x7'),_0x9be9('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x30c6=['strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout'];(function(_0x4548cc,_0x456898){var _0x2c4cb6=function(_0x448c50){while(--_0x448c50){_0x4548cc['push'](_0x4548cc['shift']());}};_0x2c4cb6(++_0x456898);}(_0x30c6,0x171));var _0x630c=function(_0x13968f,_0x22d6c8){_0x13968f=_0x13968f-0x0;var _0x264fc1=_0x30c6[_0x13968f];return _0x264fc1;};'use strict';var client=require(_0x630c('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x630c('0x1')](_0x630c('0x2'),{'options':{'raw':![],'attributes':['id',_0x630c('0x3'),_0x630c('0x4'),_0x630c('0x5')],'include':[{'model':_0x630c('0x6'),'as':_0x630c('0x7'),'attributes':['id',_0x630c('0x3'),_0x630c('0x8'),_0x630c('0x9')]}]},'log':_0x630c('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 495b550..3e1fb40 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 _0xf472=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf472,0xd1));var _0x2f47=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf472[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x2f47('0x0'));exports[_0x2f47('0x1')]=function(_0x8ef912){return client[_0x2f47('0x2')](_0x2f47('0x3'),{'body':_0x8ef912,'log':_0x2f47('0x3')});};exports[_0x2f47('0x4')]=function(_0x31539c,_0x45af27){return client[_0x2f47('0x2')](_0x2f47('0x5'),{'body':_0x45af27,'options':{'where':{'uniqueid':_0x31539c},'order':[['id',_0x2f47('0x6')]],'limit':0x1},'log':_0x2f47('0x5')});}; \ No newline at end of file +var _0xfba1=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client','Request'];(function(_0x345565,_0x436b05){var _0x21730e=function(_0x18fdbd){while(--_0x18fdbd){_0x345565['push'](_0x345565['shift']());}};_0x21730e(++_0x436b05);}(_0xfba1,0x1ca));var _0x1fba=function(_0x40681f,_0x32d0d1){_0x40681f=_0x40681f-0x0;var _0x573f43=_0xfba1[_0x40681f];return _0x573f43;};'use strict';var client=require(_0x1fba('0x0'));exports['create']=function(_0x2734da){return client[_0x1fba('0x1')](_0x1fba('0x2'),{'body':_0x2734da,'log':_0x1fba('0x2')});};exports[_0x1fba('0x3')]=function(_0x37cc17,_0x322e15){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x322e15,'options':{'where':{'uniqueid':_0x37cc17},'order':[['id','DESC']],'limit':0x1},'log':_0x1fba('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 6f99d44..7ed109e 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 _0x2494=['UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','Request'];(function(_0x5f2522,_0x2d1136){var _0x4fcb66=function(_0x1e96b7){while(--_0x1e96b7){_0x5f2522['push'](_0x5f2522['shift']());}};_0x4fcb66(++_0x2d1136);}(_0x2494,0x82));var _0x4249=function(_0x3a45dd,_0x32d5af){_0x3a45dd=_0x3a45dd-0x0;var _0x53be2e=_0x2494[_0x3a45dd];return _0x53be2e;};'use strict';var client=require(_0x4249('0x0'));exports['update']=function(_0xcb12de,_0x3072d7){return client[_0x4249('0x1')](_0x4249('0x2'),{'body':_0x3072d7,'options':{'where':{'id':_0xcb12de}},'log':_0x4249('0x3')});};exports[_0x4249('0x4')]=function(_0x5decbd,_0x4fdc12){return client[_0x4249('0x1')]('AddTagsToSmsInteraction',{'body':_0x4fdc12,'options':{'where':{'id':_0x5decbd}},'log':_0x4249('0x5')});}; \ No newline at end of file +var _0xb07f=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client'];(function(_0x36f8b2,_0x4c0dd4){var _0x324ae8=function(_0x1e2fc9){while(--_0x1e2fc9){_0x36f8b2['push'](_0x36f8b2['shift']());}};_0x324ae8(++_0x4c0dd4);}(_0xb07f,0x109));var _0xfb07=function(_0x23e367,_0x7c9f0){_0x23e367=_0x23e367-0x0;var _0x32326b=_0xb07f[_0x23e367];return _0x32326b;};'use strict';var client=require(_0xfb07('0x0'));exports[_0xfb07('0x1')]=function(_0x3088a0,_0xdf10d4){return client[_0xfb07('0x2')](_0xfb07('0x3'),{'body':_0xdf10d4,'options':{'where':{'id':_0x3088a0}},'log':_0xfb07('0x4')});};exports[_0xfb07('0x5')]=function(_0x3b3c05,_0x2fc1ce){return client[_0xfb07('0x2')]('AddTagsToSmsInteraction',{'body':_0x2fc1ce,'options':{'where':{'id':_0x3b3c05}},'log':_0xfb07('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index c9ff48b..10f02e2 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 _0xe490=['CreateSmsMessage','create','Request'];(function(_0x5efdf4,_0x47f987){var _0x31a6d2=function(_0x1f3936){while(--_0x1f3936){_0x5efdf4['push'](_0x5efdf4['shift']());}};_0x31a6d2(++_0x47f987);}(_0xe490,0x1a5));var _0x0e49=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe490[_0x46aff0];return _0x9d78cf;};'use strict';var client=require('../client');exports[_0x0e49('0x0')]=function(_0xf6a852){return client[_0x0e49('0x1')](_0x0e49('0x2'),{'body':_0xf6a852,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xa555=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x5d60ae,_0x53fa46){var _0x3cbb30=function(_0x162208){while(--_0x162208){_0x5d60ae['push'](_0x5d60ae['shift']());}};_0x3cbb30(++_0x53fa46);}(_0xa555,0x173));var _0x5a55=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0xa555[_0x4b3e49];return _0x57e339;};'use strict';var client=require('../client');exports[_0x5a55('0x0')]=function(_0x5b06c5){return client[_0x5a55('0x1')](_0x5a55('0x2'),{'body':_0x5b06c5,'log':_0x5a55('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index f3fd212..5ec3425 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0xf818af,_0x4ecf6e){var _0x448fc2=function(_0x4e126b){while(--_0x4e126b){_0xf818af['push'](_0xf818af['shift']());}};_0x448fc2(++_0x4ecf6e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x41b80a,_0x44eb4c){var _0x4efcca=function(_0x56b7c6){while(--_0x56b7c6){_0x41b80a['push'](_0x41b80a['shift']());}};_0x4efcca(++_0x44eb4c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xcb91[_0x5e4563];return _0x8d1bf5;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 0758091..97c4394 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 _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x100b7b,_0x3ecafe){var _0x121458=function(_0x387cb5){while(--_0x387cb5){_0x100b7b['push'](_0x100b7b['shift']());}};_0x121458(++_0x3ecafe);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x302d72,_0x5b5917){var _0x53b912=function(_0x4efc9e){while(--_0x4efc9e){_0x302d72['push'](_0x302d72['shift']());}};_0x53b912(++_0x5b5917);}(_0x3e74,0x175));var _0x43e7=function(_0x255340,_0x3067e8){_0x255340=_0x255340-0x0;var _0x40bb5a=_0x3e74[_0x255340];return _0x40bb5a;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index cb81a0c..72503b3 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(_0x54f78a,_0x3c78f8){var _0x21dc34=function(_0x99bf8a){while(--_0x99bf8a){_0x54f78a['push'](_0x54f78a['shift']());}};_0x21dc34(++_0x3c78f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x18570f,_0x3962bf){var _0x315e8b=function(_0xe9f5cd){while(--_0xe9f5cd){_0x18570f['push'](_0x18570f['shift']());}};_0x315e8b(++_0x3962bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index d6333bd..3341203 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 _0xf562=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x3c7104,_0x1737d1){var _0x527893=function(_0x49577a){while(--_0x49577a){_0x3c7104['push'](_0x3c7104['shift']());}};_0x527893(++_0x1737d1);}(_0xf562,0x100));var _0x2f56=function(_0x1fad86,_0x8e1762){_0x1fad86=_0x1fad86-0x0;var _0x5d6aef=_0xf562[_0x1fad86];return _0x5d6aef;};'use strict';var client=require(_0x2f56('0x0'));exports[_0x2f56('0x1')]=function(_0x453b45,_0x25d2fd){return client[_0x2f56('0x2')](_0x2f56('0x3'),{'body':_0x25d2fd,'options':{'where':{'id':_0x453b45}},'log':_0x2f56('0x4')});};exports[_0x2f56('0x5')]=function(_0x38a249,_0x55a78f){return client[_0x2f56('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x55a78f,'options':{'where':{'id':_0x38a249}},'log':_0x2f56('0x6')});}; \ No newline at end of file +var _0x4873=['update','Request','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x1066c6,_0xbbea15){var _0x3772d6=function(_0x35a252){while(--_0x35a252){_0x1066c6['push'](_0x1066c6['shift']());}};_0x3772d6(++_0xbbea15);}(_0x4873,0x1df));var _0x3487=function(_0x35b8fb,_0x136aad){_0x35b8fb=_0x35b8fb-0x0;var _0x719413=_0x4873[_0x35b8fb];return _0x719413;};'use strict';var client=require(_0x3487('0x0'));exports[_0x3487('0x1')]=function(_0x332e18,_0x4ca7ad){return client[_0x3487('0x2')]('UpdateWhatsappInteraction',{'body':_0x4ca7ad,'options':{'where':{'id':_0x332e18}},'log':'updateWhatsappInteraction'});};exports[_0x3487('0x3')]=function(_0xbc64e7,_0x54ff70){return client[_0x3487('0x2')](_0x3487('0x4'),{'body':_0x54ff70,'options':{'where':{'id':_0xbc64e7}},'log':_0x3487('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6da4b9c..0e63e68 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 _0xc00a=['createWhatsappMessage','create','CreateWhatsappMessage'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xc00a,0xe5));var _0xac00=function(_0x123601,_0x546b61){_0x123601=_0x123601-0x0;var _0x2d179b=_0xc00a[_0x123601];return _0x2d179b;};'use strict';var client=require('../client');exports[_0xac00('0x0')]=function(_0x5da5c7){return client['Request'](_0xac00('0x1'),{'body':_0x5da5c7,'log':_0xac00('0x2')});}; \ No newline at end of file +var _0x6403=['../client','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6403,0x198));var _0x3640=function(_0xa85a49,_0x3fd76c){_0xa85a49=_0xa85a49-0x0;var _0x5e2ad7=_0x6403[_0xa85a49];return _0x5e2ad7;};'use strict';var client=require(_0x3640('0x0'));exports['create']=function(_0x5283be){return client[_0x3640('0x1')](_0x3640('0x2'),{'body':_0x5283be,'log':_0x3640('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 0d1303c..785894e 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 _0x0184=['strategy','User','Agents','name','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0184,0x1c9));var _0x4018=function(_0x49f913,_0x12ccd8){_0x49f913=_0x49f913-0x0;var _0xf48ea5=_0x0184[_0x49f913];return _0xf48ea5;};'use strict';var client=require(_0x4018('0x0'));exports[_0x4018('0x1')]=function(){return function(){return client[_0x4018('0x2')](_0x4018('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4018('0x4'),_0x4018('0x5')],'include':[{'model':_0x4018('0x6'),'as':_0x4018('0x7'),'attributes':['id',_0x4018('0x8'),_0x4018('0x9'),_0x4018('0xa')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x08a9=['../client','Request','GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08a9,0x82));var _0x908a=function(_0x5067d7,_0x56c8e5){_0x5067d7=_0x5067d7-0x0;var _0x367d67=_0x08a9[_0x5067d7];return _0x367d67;};'use strict';var client=require(_0x908a('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x908a('0x1')](_0x908a('0x2'),{'options':{'raw':![],'attributes':['id',_0x908a('0x3'),'timeout',_0x908a('0x4')],'include':[{'model':_0x908a('0x5'),'as':_0x908a('0x6'),'attributes':['id',_0x908a('0x3'),_0x908a('0x7'),_0x908a('0x8')]}]},'log':_0x908a('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 8aa180c..300c26e 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 _0xb270=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x568f4d,_0x5d97b9){var _0x48298c=function(_0x540b83){while(--_0x540b83){_0x568f4d['push'](_0x568f4d['shift']());}};_0x48298c(++_0x5d97b9);}(_0xb270,0x1b9));var _0x0b27=function(_0x1338b4,_0x1fe8d7){_0x1338b4=_0x1338b4-0x0;var _0x385886=_0xb270[_0x1338b4];return _0x385886;};'use strict';var client=require(_0x0b27('0x0'));exports[_0x0b27('0x1')]=function(_0x153388){return client[_0x0b27('0x2')](_0x0b27('0x3'),{'body':_0x153388,'log':_0x0b27('0x3')});};exports[_0x0b27('0x4')]=function(_0xedbb88,_0x51f2e1){return client[_0x0b27('0x2')](_0x0b27('0x5'),{'body':_0x51f2e1,'options':{'where':{'uniqueid':_0xedbb88},'order':[['id',_0x0b27('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xa6cc=['update','UpdateWhatsappQueueReport','../client','CreateWhatsappQueueReport'];(function(_0x4de729,_0x50ddcd){var _0x127c6c=function(_0x1b9f58){while(--_0x1b9f58){_0x4de729['push'](_0x4de729['shift']());}};_0x127c6c(++_0x50ddcd);}(_0xa6cc,0x17a));var _0xca6c=function(_0x5b5f70,_0xc951e6){_0x5b5f70=_0x5b5f70-0x0;var _0x3affc7=_0xa6cc[_0x5b5f70];return _0x3affc7;};'use strict';var client=require(_0xca6c('0x0'));exports['create']=function(_0x1feed7){return client['Request'](_0xca6c('0x1'),{'body':_0x1feed7,'log':_0xca6c('0x1')});};exports[_0xca6c('0x2')]=function(_0x5334a2,_0x3b3d10){return client['Request'](_0xca6c('0x3'),{'body':_0x3b3d10,'options':{'where':{'uniqueid':_0x5334a2},'order':[['id','DESC']],'limit':0x1},'log':_0xca6c('0x3')});}; \ 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 6149744..6503a34 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 _0x7cdc=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','find','agents','timeout','atimeout','channel','format','START:%s','rules','end','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','error'];(function(_0x13c939,_0x3cb118){var _0x4cf8d8=function(_0x23be52){while(--_0x23be52){_0x13c939['push'](_0x13c939['shift']());}};_0x4cf8d8(++_0x3cb118);}(_0x7cdc,0x12c));var _0xc7cd=function(_0x423877,_0x58b273){_0x423877=_0x423877-0x0;var _0x13d692=_0x7cdc[_0x423877];return _0x13d692;};'use strict';var schema=require(_0xc7cd('0x0'));var _=require(_0xc7cd('0x1'));var util=require(_0xc7cd('0x2'));var seqqueue=require(_0xc7cd('0x3'));var logger=require(_0xc7cd('0x4'))('routing');var strategy=require(_0xc7cd('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xc7cd('0x6')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3a6d7d,_0x57cee3,_0x4c6c9d){return logger[_0xc7cd('0x7')](util['format'](_0xc7cd('0x8'),_0x3a6d7d,_0x57cee3[_0xc7cd('0x9')],_0x4c6c9d));}function handleFindAgent(_0x5c474d){return function(_0x23e2bf){return _0x23e2bf[_0xc7cd('0x9')][_0xc7cd('0xa')]()===_0x5c474d[_0xc7cd('0xa')]();};}exports[_0xc7cd('0xb')]=function(_0x48bb20,_0x214db9,_0x45c49b,_0x416dac){return function(_0x4cd67b){try{var _0x589889={'name':_0x214db9[0x0],'timeout':_0x214db9[0x1]};var _0x448d3d=queue[_0xc7cd('0x0')](_0x589889,{'typecast':!![]});if(_0x448d3d[_0xc7cd('0xc')]){logger['error']('[%s][AGENT]\x20%s',_0x48bb20,_[_0xc7cd('0xd')](_0x448d3d,_0xc7cd('0xe'))[_0xc7cd('0xf')](',\x20'));_0x4cd67b['stop']();}else{var _0x31a899=_[_0xc7cd('0x10')](_0x45c49b[_0xc7cd('0x11')],handleFindAgent(_0x589889['name']));if(_0x31a899){var _0xefc9b0=(_0x589889[_0xc7cd('0x12')]||0xa)*0x3e8;var _0x4339f4,_0x38ee48;var _0x5ee697=seqqueue['createQueue'](_0xefc9b0);_0x5ee697['id']=_0x48bb20;_0x5ee697[_0xc7cd('0x13')]=_0xefc9b0;_0x5ee697[_0xc7cd('0x14')]=_0x416dac[_0xc7cd('0x14')];writeLog(_0x48bb20,_0x31a899,util[_0xc7cd('0x15')](_0xc7cd('0x16'),_0xefc9b0));_0x45c49b[_0xc7cd('0x17')][_0x48bb20]['on'](_0xc7cd('0x18'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x48bb20);clearTimeout(_0x38ee48);_0x38ee48=undefined;_0x5ee697[_0xc7cd('0x19')]();if(_0x45c49b[_0xc7cd('0x17')][_0x48bb20]){delete _0x45c49b[_0xc7cd('0x17')][_0x48bb20];}_0x4cd67b[_0xc7cd('0x1a')]();});_0x45c49b['rules'][_0x48bb20]['on'](_0xc7cd('0x1b'),function(){if(_0x45c49b[_0xc7cd('0x17')][_0x48bb20]){delete _0x45c49b[_0xc7cd('0x17')][_0x48bb20];}});_0x38ee48=setTimeout(function(){logger[_0xc7cd('0x7')](_0xc7cd('0x1c'),_0x48bb20);clearTimeout(_0x38ee48);_0x5ee697[_0xc7cd('0x19')]();_0x4cd67b['next']();},_0xefc9b0);strategy['agent'](_0x5ee697,_0x31a899,_0x45c49b,_0x416dac);}else{logger[_0xc7cd('0x1d')](_0xc7cd('0x1e'),_0x48bb20,_0x589889['name']);_0x4cd67b[_0xc7cd('0x1a')]();}}}catch(_0x47f265){console['log'](_0x47f265);logger[_0xc7cd('0x1d')](_0xc7cd('0x1f'),_0x48bb20,_0x47f265[_0xc7cd('0x20')]);_0x4cd67b[_0xc7cd('0x1a')]();}};}; \ No newline at end of file +var _0xde09=['[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','../../../../config/logger','routing','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete'];(function(_0x16012a,_0x492cb0){var _0x4f32d1=function(_0x2a967d){while(--_0x2a967d){_0x16012a['push'](_0x16012a['shift']());}};_0x4f32d1(++_0x492cb0);}(_0xde09,0x11f));var _0x9de0=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xde09[_0x2235bf];return _0x4c3a64;};'use strict';var schema=require(_0x9de0('0x0'));var _=require(_0x9de0('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x9de0('0x2'))(_0x9de0('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x9de0('0x4'),'message':_0x9de0('0x5')}});function writeLog(_0x25e4ec,_0xdd236,_0x4e31df){return logger[_0x9de0('0x6')](util[_0x9de0('0x7')](_0x9de0('0x8'),_0x25e4ec,_0xdd236[_0x9de0('0x9')],_0x4e31df));}function handleFindAgent(_0x3da808){return function(_0x3d3baa){return _0x3d3baa[_0x9de0('0x9')][_0x9de0('0xa')]()===_0x3da808['toLowerCase']();};}exports[_0x9de0('0xb')]=function(_0x29f56d,_0x5c1b24,_0x586593,_0x570169){return function(_0x4d5bca){try{var _0x131bd6={'name':_0x5c1b24[0x0],'timeout':_0x5c1b24[0x1]};var _0x2c8441=queue[_0x9de0('0x0')](_0x131bd6,{'typecast':!![]});if(_0x2c8441[_0x9de0('0xc')]){logger[_0x9de0('0xd')](_0x9de0('0xe'),_0x29f56d,_['map'](_0x2c8441,_0x9de0('0xf'))[_0x9de0('0x10')](',\x20'));_0x4d5bca[_0x9de0('0x11')]();}else{var _0x6ef69=_[_0x9de0('0x12')](_0x586593[_0x9de0('0x13')],handleFindAgent(_0x131bd6[_0x9de0('0x9')]));if(_0x6ef69){var _0x183ce5=(_0x131bd6[_0x9de0('0x14')]||0xa)*0x3e8;var _0x3ef965,_0x2ba01f;var _0x32d081=seqqueue[_0x9de0('0x15')](_0x183ce5);_0x32d081['id']=_0x29f56d;_0x32d081['atimeout']=_0x183ce5;_0x32d081['channel']=_0x570169[_0x9de0('0x16')];writeLog(_0x29f56d,_0x6ef69,util[_0x9de0('0x7')](_0x9de0('0x17'),_0x183ce5));_0x586593[_0x9de0('0x18')][_0x29f56d]['on'](_0x9de0('0x19'),function(){logger[_0x9de0('0x6')](_0x9de0('0x1a'),_0x29f56d);clearTimeout(_0x2ba01f);_0x2ba01f=undefined;_0x32d081['close']();if(_0x586593[_0x9de0('0x18')][_0x29f56d]){delete _0x586593[_0x9de0('0x18')][_0x29f56d];}_0x4d5bca[_0x9de0('0x11')]();});_0x586593['rules'][_0x29f56d]['on'](_0x9de0('0x1b'),function(){if(_0x586593['rules'][_0x29f56d]){delete _0x586593['rules'][_0x29f56d];}});_0x2ba01f=setTimeout(function(){logger[_0x9de0('0x6')](_0x9de0('0x1c'),_0x29f56d);clearTimeout(_0x2ba01f);_0x32d081[_0x9de0('0x1d')]();_0x4d5bca[_0x9de0('0x1e')]();},_0x183ce5);strategy[_0x9de0('0x1f')](_0x32d081,_0x6ef69,_0x586593,_0x570169);}else{logger['error'](_0x9de0('0x20'),_0x29f56d,_0x131bd6[_0x9de0('0x9')]);_0x4d5bca[_0x9de0('0x11')]();}}}catch(_0x1e2e87){console[_0x9de0('0x21')](_0x1e2e87);logger['error'](_0x9de0('0x22'),_0x29f56d,_0x1e2e87['stack']);_0x4d5bca['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index a623163..1036c15 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 _0xc97a=['body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','next','stop','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created'];(function(_0x1f7072,_0x6f8026){var _0xef3c70=function(_0x352f1e){while(--_0x352f1e){_0x1f7072['push'](_0x1f7072['shift']());}};_0xef3c70(++_0x6f8026);}(_0xc97a,0x19d));var _0xac97=function(_0xd7acd8,_0xcdd9e6){_0xd7acd8=_0xd7acd8-0x0;var _0x4738de=_0xc97a[_0xd7acd8];return _0x4738de;};'use strict';var _=require(_0xac97('0x0'));var moment=require(_0xac97('0x1'));var AWS=require(_0xac97('0x2'));var utils=require('./utils');var logger=require(_0xac97('0x3'))('routing');var rpc={'chatMessage':require(_0xac97('0x4')),'openchannelMessage':require(_0xac97('0x5')),'mailMessage':require(_0xac97('0x6')),'smsMessage':require(_0xac97('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xac97('0x8'))};exports[_0xac97('0x9')]=function(_0x571979,_0x532b54){return function(_0x1ddba2){try{if(!_['isNil'](this[_0xac97('0xa')][_0xac97('0xb')])){logger[_0xac97('0xc')](_0xac97('0xd'),_0x571979,_0xac97('0xe'));return _0x1ddba2['next']();}var _0x57a953={'ContactId':this[_0xac97('0xf')]['id'],'sentAt':moment()[_0xac97('0x10')](_0xac97('0x11')),'direction':_0xac97('0x12')};if(this[_0xac97('0x13')]===_0xac97('0x14')||this[_0xac97('0x13')]===_0xac97('0x15')){_0x57a953[_0xac97('0x16')]=this[_0xac97('0xa')][_0xac97('0x16')];}var _0x27c864=this[_0xac97('0x13')];if(_0x27c864==='chat'){_0x57a953['ChatWebsiteId']=this[_0xac97('0x17')]['id'];}else{_0x57a953[_[_0xac97('0x18')](_0x27c864)+_0xac97('0x19')]=this[_0xac97('0x17')]['id'];}_0x57a953[_['upperFirst'](_0x27c864)+_0xac97('0x1a')]=this['interaction']['id'];if(this['interaction'][_0xac97('0x1b')]){var _0x54dc3d=_0x532b54[0x4];if(!_['isEmpty'](_0x54dc3d)){_0x57a953[_0xac97('0x1c')]=utils[_0xac97('0x1d')](_0x54dc3d,this);return rpc[_0x27c864+'Message'][_0xac97('0x1e')](_0x57a953)[_0xac97('0x1f')](function(_0x26de5f){logger[_0xac97('0xc')]('[%s][AMAZONLEX]\x20%s',_0x571979,_0x57a953[_0xac97('0x1c')]);})[_0xac97('0x20')](function(_0x1d3124){logger[_0xac97('0x21')](_0xac97('0xd'),_0x571979,JSON[_0xac97('0x22')](_0x1d3124));})[_0xac97('0x23')](function(){logger[_0xac97('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x571979);_0x1ddba2['stop']();});}else{logger[_0xac97('0xc')](_0xac97('0x24'),_0x571979);_0x1ddba2['stop']();}}else{var _0x519ef9=this;var _0xe4f2c8=new AWS[(_0xac97('0x25'))]({'accessKeyId':_0x532b54[0x0],'secretAccessKey':_0x532b54[0x1],'region':_0x532b54[0x2]});var _0x22af89={'botAlias':_0xac97('0x26'),'botName':_0x532b54[0x3],'inputText':this[_0xac97('0x27')][_0xac97('0x1c')],'userId':this[_0xac97('0x13')]+':'+this['interaction']['id'][_0xac97('0x28')]()};_0xe4f2c8[_0xac97('0x29')](_0x22af89,function(_0x105eb1,_0x2a693e){if(_0x105eb1){logger['error']('[%s][AMAZONLEX]\x20%s',_0x571979,_0x105eb1[_0xac97('0x27')]);_0x1ddba2['next']();}else if(_0x2a693e&&_0x2a693e['message']){_0x519ef9[_0xac97('0x1c')][_0xac97('0x2a')]=_0x2a693e;_0x57a953[_0xac97('0x1c')]=_0x2a693e['message'];_0x57a953[_0xac97('0x2b')]=_0xac97('0x2a');_0x57a953[_0xac97('0x2c')]=JSON['stringify'](_0x2a693e);return rpc[_0x27c864+'Message'][_0xac97('0x1e')](_0x57a953)['then'](function(_0x328068){logger[_0xac97('0xc')]('[%s][AMAZONLEX]\x20%s',_0x571979,_0x57a953[_0xac97('0x1c')]);if(_0x2a693e[_0xac97('0x2d')]==_0xac97('0x2e')){_0x1ddba2[_0xac97('0x2f')]();}else{_0x1ddba2[_0xac97('0x30')]();}})[_0xac97('0x20')](function(_0x4611d9){logger[_0xac97('0x21')]('[%s][AMAZONLEX]\x20%s',_0x571979,JSON[_0xac97('0x22')](_0x4611d9));_0x1ddba2[_0xac97('0x2f')]();});}else{_0x1ddba2[_0xac97('0x2f')]();}});}}catch(_0x44bde4){logger['error'](_0xac97('0xd'),_0x571979,JSON['stringify'](_0x44bde4));_0x1ddba2['stop']();}};}; \ No newline at end of file +var _0x7c73=['amazonlex','providerResponse','dialogState','Failed','error','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','providerName'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7c73,0x104));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x37c7('0x0'));var moment=require(_0x37c7('0x1'));var AWS=require(_0x37c7('0x2'));var utils=require('./utils');var logger=require(_0x37c7('0x3'))('routing');var rpc={'chatMessage':require(_0x37c7('0x4')),'openchannelMessage':require(_0x37c7('0x5')),'mailMessage':require(_0x37c7('0x6')),'smsMessage':require(_0x37c7('0x7')),'faxMessage':require(_0x37c7('0x8')),'whatsappMessage':require(_0x37c7('0x9'))};exports[_0x37c7('0xa')]=function(_0x150d75,_0x19a3e0){return function(_0x5723df){try{if(!_['isNil'](this['interaction'][_0x37c7('0xb')])){logger[_0x37c7('0xc')](_0x37c7('0xd'),_0x150d75,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5723df[_0x37c7('0xe')]();}var _0x284f69={'ContactId':this[_0x37c7('0xf')]['id'],'sentAt':moment()[_0x37c7('0x10')](_0x37c7('0x11')),'direction':_0x37c7('0x12')};if(this[_0x37c7('0x13')]===_0x37c7('0x14')||this[_0x37c7('0x13')]===_0x37c7('0x15')){_0x284f69[_0x37c7('0x16')]=this[_0x37c7('0x17')][_0x37c7('0x16')];}var _0xf3919e=this['channel'];if(_0xf3919e===_0x37c7('0x18')){_0x284f69[_0x37c7('0x19')]=this[_0x37c7('0x1a')]['id'];}else{_0x284f69[_[_0x37c7('0x1b')](_0xf3919e)+_0x37c7('0x1c')]=this[_0x37c7('0x1a')]['id'];}_0x284f69[_[_0x37c7('0x1b')](_0xf3919e)+_0x37c7('0x1d')]=this[_0x37c7('0x17')]['id'];if(this['interaction']['created']){var _0x3cb196=_0x19a3e0[0x4];if(!_[_0x37c7('0x1e')](_0x3cb196)){_0x284f69[_0x37c7('0x1f')]=utils[_0x37c7('0x20')](_0x3cb196,this);return rpc[_0xf3919e+_0x37c7('0x21')][_0x37c7('0x22')](_0x284f69)[_0x37c7('0x23')](function(_0x1c5efc){logger[_0x37c7('0xc')](_0x37c7('0xd'),_0x150d75,_0x284f69[_0x37c7('0x1f')]);})[_0x37c7('0x24')](function(_0x1c54b2){logger['error']('[%s][AMAZONLEX]\x20%s',_0x150d75,JSON[_0x37c7('0x25')](_0x1c54b2));})[_0x37c7('0x26')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x150d75);_0x5723df[_0x37c7('0x27')]();});}else{logger[_0x37c7('0xc')](_0x37c7('0x28'),_0x150d75);_0x5723df[_0x37c7('0x27')]();}}else{var _0x3db534=this;var _0x8275f6=new AWS[(_0x37c7('0x29'))]({'accessKeyId':_0x19a3e0[0x0],'secretAccessKey':_0x19a3e0[0x1],'region':_0x19a3e0[0x2]});var _0x221517={'botAlias':_0x37c7('0x2a'),'botName':_0x19a3e0[0x3],'inputText':this[_0x37c7('0x2b')][_0x37c7('0x1f')],'userId':this[_0x37c7('0x13')]+':'+this[_0x37c7('0x17')]['id'][_0x37c7('0x2c')]()};_0x8275f6['postText'](_0x221517,function(_0x3a2b32,_0xcd7549){if(_0x3a2b32){logger['error'](_0x37c7('0xd'),_0x150d75,_0x3a2b32[_0x37c7('0x2b')]);_0x5723df[_0x37c7('0xe')]();}else if(_0xcd7549&&_0xcd7549[_0x37c7('0x2b')]){_0x3db534[_0x37c7('0x1f')]['amazonlex']=_0xcd7549;_0x284f69[_0x37c7('0x1f')]=_0xcd7549[_0x37c7('0x2b')];_0x284f69[_0x37c7('0x2d')]=_0x37c7('0x2e');_0x284f69[_0x37c7('0x2f')]=JSON[_0x37c7('0x25')](_0xcd7549);return rpc[_0xf3919e+_0x37c7('0x21')][_0x37c7('0x22')](_0x284f69)[_0x37c7('0x23')](function(_0x1eb6f7){logger['info']('[%s][AMAZONLEX]\x20%s',_0x150d75,_0x284f69[_0x37c7('0x1f')]);if(_0xcd7549[_0x37c7('0x30')]==_0x37c7('0x31')){_0x5723df[_0x37c7('0xe')]();}else{_0x5723df[_0x37c7('0x27')]();}})[_0x37c7('0x24')](function(_0x3c8bcd){logger['error'](_0x37c7('0xd'),_0x150d75,JSON[_0x37c7('0x25')](_0x3c8bcd));_0x5723df[_0x37c7('0xe')]();});}else{_0x5723df['next']();}});}}catch(_0x39d92d){logger[_0x37c7('0x32')](_0x37c7('0xd'),_0x150d75,JSON[_0x37c7('0x25')](_0x39d92d));_0x5723df[_0x37c7('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 2828d9b..7b24806 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 _0xe4b8=['../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','create','then','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction'];(function(_0x396f3b,_0x368296){var _0x3d57b8=function(_0x21a822){while(--_0x21a822){_0x396f3b['push'](_0x396f3b['shift']());}};_0x3d57b8(++_0x368296);}(_0xe4b8,0x168));var _0x8e4b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe4b8[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x8e4b('0x0'));var moment=require(_0x8e4b('0x1'));var utils=require(_0x8e4b('0x2'));var logger=require(_0x8e4b('0x3'))(_0x8e4b('0x4'));var rpc={'chatMessage':require(_0x8e4b('0x5')),'openchannelMessage':require(_0x8e4b('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8e4b('0x7')),'whatsappMessage':require(_0x8e4b('0x8')),'chatInteraction':require(_0x8e4b('0x9')),'openchannelInteraction':require(_0x8e4b('0xa')),'mailInteraction':require(_0x8e4b('0xb')),'smsInteraction':require(_0x8e4b('0xc')),'faxInteraction':require(_0x8e4b('0xd')),'whatsappInteraction':require(_0x8e4b('0xe'))};var mailRpc=require('../../mailRpc');exports[_0x8e4b('0xf')]=function(_0x2e8173,_0x243b02,_0x47bbb6,_0x549d3d){return function(_0xaf20d3){try{var _0x3f3a1b=this[_0x8e4b('0x10')];if(_0x3f3a1b===_0x8e4b('0x11')&&_0x549d3d[_0x8e4b('0x12')][_0x8e4b('0x13')]){logger[_0x8e4b('0x14')](_0x8e4b('0x15'),_0x2e8173,_0x8e4b('0x16'));return _0xaf20d3[_0x8e4b('0x17')]();}if(_0x243b02[0x0]==='1'&&(_[_0x8e4b('0x18')](this[_0x8e4b('0x19')][_0x8e4b('0x1a')])||!this[_0x8e4b('0x19')][_0x8e4b('0x1a')])){logger['info'](_0x8e4b('0x15'),_0x2e8173,'Autoreply\x20already\x20sent');return _0xaf20d3[_0x8e4b('0x17')]();}if(_0x243b02[0x0]==='2'&&this[_0x8e4b('0x19')][_0x8e4b('0x1b')]){logger[_0x8e4b('0x14')](_0x8e4b('0x1c'),_0x2e8173,_0x8e4b('0x1d'));return _0xaf20d3['next']();}var _0xa8cf1e={'ContactId':this[_0x8e4b('0x1e')]['id'],'sentAt':moment()[_0x8e4b('0x1f')](_0x8e4b('0x20')),'direction':_0x8e4b('0x21')};if(this[_0x8e4b('0x10')]===_0x8e4b('0x11')){_0xa8cf1e[_0x8e4b('0x12')]=utils[_0x8e4b('0x22')](_0x243b02[0x2],this);}else{_0xa8cf1e[_0x8e4b('0x12')]=utils[_0x8e4b('0x22')](_0x243b02[0x1],this);}if(this[_0x8e4b('0x23')]){_0xa8cf1e['to']=this[_0x8e4b('0x23')][_0x8e4b('0x24')]||'';if(this[_0x8e4b('0x10')]===_0x8e4b('0x11')&&_0x243b02[0x1]==='1'){_0xa8cf1e['cc']=this[_0x8e4b('0x23')]['cc']||'';}_0xa8cf1e[_0x8e4b('0x24')]=this['message']['to']||'';_0xa8cf1e[_0x8e4b('0x25')]=this[_0x8e4b('0x23')]['phone']||'';_0xa8cf1e['read']=!![];if(this['message']['subject']){_0xa8cf1e[_0x8e4b('0x26')]='';_0xa8cf1e[_0x8e4b('0x26')]+=_[_0x8e4b('0x27')](this[_0x8e4b('0x23')][_0x8e4b('0x26')],_0x8e4b('0x28'))?'':_0x8e4b('0x29');_0xa8cf1e['subject']+=this[_0x8e4b('0x23')]['subject'];}}if(this[_0x8e4b('0x10')]===_0x8e4b('0x2a')){_0xa8cf1e[_0x8e4b('0x2b')]=this[_0x8e4b('0x2c')]['id'];}else{_0xa8cf1e[_[_0x8e4b('0x2d')](this[_0x8e4b('0x10')])+_0x8e4b('0x2e')]=this['account']['id'];}_0xa8cf1e[_[_0x8e4b('0x2d')](this[_0x8e4b('0x10')])+'InteractionId']=this['interaction']['id'];var _0xe05ba9=this['interaction'];if(rpc[this[_0x8e4b('0x10')]+_0x8e4b('0x2f')]){if(this['channel']===_0x8e4b('0x11')){_0xa8cf1e[_0x8e4b('0x30')]=this['message'][_0x8e4b('0x31')];_0xa8cf1e[_0x8e4b('0x32')]=_0x8e4b('0x33')+_[_0x8e4b('0x34')](_0xa8cf1e['body'],_0x8e4b('0x35'),_0x8e4b('0x36'))+_0x8e4b('0x37');_0xa8cf1e[_0x8e4b('0x38')]={'Auto-Submitted':_0x8e4b('0x39'),'X-Auto-Response-Suppress':_0x8e4b('0x3a'),'Precedence':_0x8e4b('0x3b')};return mailRpc[_0x8e4b('0x3c')](this['account'][_0x8e4b('0x3d')],_0xa8cf1e)['then'](function(_0x27808a){logger[_0x8e4b('0x14')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x2e8173);_0xa8cf1e[_0x8e4b('0x31')]=_0x27808a[_0x8e4b('0x23')][_0x8e4b('0x31')];return rpc[_0x3f3a1b+_0x8e4b('0x2f')][_0x8e4b('0x3e')](_0xa8cf1e);})[_0x8e4b('0x3f')](function(_0x172fbe){logger[_0x8e4b('0x14')]('[%s][AUTOREPLY]\x20%s',_0x2e8173,JSON['stringify'](_0x172fbe));})['catch'](function(_0x7db87d){logger[_0x8e4b('0x40')](_0x8e4b('0x41'),_0x2e8173,JSON[_0x8e4b('0x42')](_0x7db87d));})[_0x8e4b('0x43')](function(){Promise['resolve']()[_0x8e4b('0x3f')](function(){if(_0x243b02[0x0]!=='2'||_0xe05ba9[_0x8e4b('0x1b')])return;return rpc[_0x3f3a1b+_0x8e4b('0x44')][_0x8e4b('0x45')](_0xe05ba9['id'],{'autoreplyExecuted':!![]})[_0x8e4b('0x3f')](function(_0x44ed64){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2e8173,JSON['stringify'](_0x44ed64));})[_0x8e4b('0x46')](function(_0x169297){logger[_0x8e4b('0x40')](_0x8e4b('0x47'),_0x2e8173,JSON[_0x8e4b('0x42')](_0x169297));});})['then'](function(){_0xaf20d3['next']();});});}else{return rpc[this[_0x8e4b('0x10')]+'Message']['create'](_0xa8cf1e)[_0x8e4b('0x3f')](function(){logger[_0x8e4b('0x14')]('[%s][AUTOREPLY]\x20%s',_0x2e8173,_0xa8cf1e[_0x8e4b('0x12')]);})[_0x8e4b('0x46')](function(_0x1a874b){logger[_0x8e4b('0x40')](_0x8e4b('0x15'),_0x2e8173,JSON[_0x8e4b('0x42')](_0x1a874b));})[_0x8e4b('0x43')](function(){Promise[_0x8e4b('0x48')]()[_0x8e4b('0x3f')](function(){if(_0x243b02[0x0]!=='2'||_0xe05ba9[_0x8e4b('0x1b')])return;return rpc[_0x3f3a1b+_0x8e4b('0x44')][_0x8e4b('0x45')](_0xe05ba9['id'],{'autoreplyExecuted':!![]})[_0x8e4b('0x3f')](function(_0x30d3fd){logger[_0x8e4b('0x14')](_0x8e4b('0x1c'),_0x2e8173,JSON[_0x8e4b('0x42')](_0x30d3fd));})['catch'](function(_0x40ce6f){logger[_0x8e4b('0x40')](_0x8e4b('0x47'),_0x2e8173,JSON[_0x8e4b('0x42')](_0x40ce6f));});})[_0x8e4b('0x3f')](function(){_0xaf20d3[_0x8e4b('0x17')]();});});}}}catch(_0x286d31){logger[_0x8e4b('0x40')](_0x8e4b('0x15'),_0x2e8173,JSON[_0x8e4b('0x42')](_0x286d31));_0xaf20d3[_0x8e4b('0x49')]();}};}; \ No newline at end of file +var _0xd2dd=['body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','mail','getMustacheRender','message','from','phone','read','subject','startsWith','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','headers','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','consequence','channel'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0xd2dd,0xbc));var _0xdd2d=function(_0x527042,_0x3a6662){_0x527042=_0x527042-0x0;var _0x11d672=_0xd2dd[_0x527042];return _0x11d672;};'use strict';var _=require(_0xdd2d('0x0'));var moment=require(_0xdd2d('0x1'));var utils=require('./utils');var logger=require(_0xdd2d('0x2'))(_0xdd2d('0x3'));var rpc={'chatMessage':require(_0xdd2d('0x4')),'openchannelMessage':require(_0xdd2d('0x5')),'mailMessage':require(_0xdd2d('0x6')),'smsMessage':require(_0xdd2d('0x7')),'faxMessage':require(_0xdd2d('0x8')),'whatsappMessage':require(_0xdd2d('0x9')),'chatInteraction':require(_0xdd2d('0xa')),'openchannelInteraction':require(_0xdd2d('0xb')),'mailInteraction':require(_0xdd2d('0xc')),'smsInteraction':require(_0xdd2d('0xd')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xdd2d('0xe')]=function(_0x39405c,_0x535aca,_0x2cf435,_0x3525dd){return function(_0x44ed51){try{var _0x29f2d9=this[_0xdd2d('0xf')];if(_0x29f2d9==='mail'&&_0x3525dd[_0xdd2d('0x10')][_0xdd2d('0x11')]){logger[_0xdd2d('0x12')](_0xdd2d('0x13'),_0x39405c,_0xdd2d('0x14'));return _0x44ed51[_0xdd2d('0x15')]();}if(_0x535aca[0x0]==='1'&&(_[_0xdd2d('0x16')](this[_0xdd2d('0x17')][_0xdd2d('0x18')])||!this['interaction']['created'])){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY]\x20%s',_0x39405c,_0xdd2d('0x19'));return _0x44ed51[_0xdd2d('0x15')]();}if(_0x535aca[0x0]==='2'&&this[_0xdd2d('0x17')][_0xdd2d('0x1a')]){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x39405c,_0xdd2d('0x1b'));return _0x44ed51['next']();}var _0x4e29f3={'ContactId':this[_0xdd2d('0x1c')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xdd2d('0xf')]===_0xdd2d('0x1d')){_0x4e29f3[_0xdd2d('0x10')]=utils[_0xdd2d('0x1e')](_0x535aca[0x2],this);}else{_0x4e29f3[_0xdd2d('0x10')]=utils[_0xdd2d('0x1e')](_0x535aca[0x1],this);}if(this[_0xdd2d('0x1f')]){_0x4e29f3['to']=this[_0xdd2d('0x1f')]['from']||'';if(this[_0xdd2d('0xf')]===_0xdd2d('0x1d')&&_0x535aca[0x1]==='1'){_0x4e29f3['cc']=this[_0xdd2d('0x1f')]['cc']||'';}_0x4e29f3[_0xdd2d('0x20')]=this[_0xdd2d('0x1f')]['to']||'';_0x4e29f3[_0xdd2d('0x21')]=this[_0xdd2d('0x1f')][_0xdd2d('0x21')]||'';_0x4e29f3[_0xdd2d('0x22')]=!![];if(this[_0xdd2d('0x1f')][_0xdd2d('0x23')]){_0x4e29f3[_0xdd2d('0x23')]='';_0x4e29f3[_0xdd2d('0x23')]+=_[_0xdd2d('0x24')](this[_0xdd2d('0x1f')][_0xdd2d('0x23')],'Re:')?'':'Re:\x20';_0x4e29f3['subject']+=this[_0xdd2d('0x1f')][_0xdd2d('0x23')];}}if(this[_0xdd2d('0xf')]===_0xdd2d('0x25')){_0x4e29f3[_0xdd2d('0x26')]=this[_0xdd2d('0x27')]['id'];}else{_0x4e29f3[_[_0xdd2d('0x28')](this[_0xdd2d('0xf')])+_0xdd2d('0x29')]=this['account']['id'];}_0x4e29f3[_[_0xdd2d('0x28')](this[_0xdd2d('0xf')])+_0xdd2d('0x2a')]=this['interaction']['id'];var _0x50a526=this[_0xdd2d('0x17')];if(rpc[this[_0xdd2d('0xf')]+_0xdd2d('0x2b')]){if(this[_0xdd2d('0xf')]===_0xdd2d('0x1d')){_0x4e29f3[_0xdd2d('0x2c')]=this[_0xdd2d('0x1f')][_0xdd2d('0x2d')];_0x4e29f3[_0xdd2d('0x2e')]=''+_['replace'](_0x4e29f3['body'],_0xdd2d('0x2f'),_0xdd2d('0x30'))+_0xdd2d('0x31');_0x4e29f3[_0xdd2d('0x32')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0xdd2d('0x33')};return mailRpc[_0xdd2d('0x34')](this[_0xdd2d('0x27')][_0xdd2d('0x35')],_0x4e29f3)['then'](function(_0x1d003c){logger[_0xdd2d('0x12')](_0xdd2d('0x36'),_0x39405c);_0x4e29f3[_0xdd2d('0x2d')]=_0x1d003c['message'][_0xdd2d('0x2d')];return rpc[_0x29f2d9+_0xdd2d('0x2b')][_0xdd2d('0x37')](_0x4e29f3);})[_0xdd2d('0x38')](function(_0x417157){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY]\x20%s',_0x39405c,JSON[_0xdd2d('0x39')](_0x417157));})[_0xdd2d('0x3a')](function(_0x53391c){logger[_0xdd2d('0x3b')](_0xdd2d('0x3c'),_0x39405c,JSON[_0xdd2d('0x39')](_0x53391c));})[_0xdd2d('0x3d')](function(){Promise[_0xdd2d('0x3e')]()[_0xdd2d('0x38')](function(){if(_0x535aca[0x0]!=='2'||_0x50a526[_0xdd2d('0x1a')])return;return rpc[_0x29f2d9+_0xdd2d('0x3f')][_0xdd2d('0x40')](_0x50a526['id'],{'autoreplyExecuted':!![]})[_0xdd2d('0x38')](function(_0xc441ea){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x39405c,JSON['stringify'](_0xc441ea));})[_0xdd2d('0x3a')](function(_0x5efc60){logger['error'](_0xdd2d('0x41'),_0x39405c,JSON['stringify'](_0x5efc60));});})[_0xdd2d('0x38')](function(){_0x44ed51['next']();});});}else{return rpc[this[_0xdd2d('0xf')]+_0xdd2d('0x2b')]['create'](_0x4e29f3)['then'](function(){logger['info'](_0xdd2d('0x13'),_0x39405c,_0x4e29f3[_0xdd2d('0x10')]);})['catch'](function(_0x5e9ca5){logger['error'](_0xdd2d('0x13'),_0x39405c,JSON[_0xdd2d('0x39')](_0x5e9ca5));})[_0xdd2d('0x3d')](function(){Promise[_0xdd2d('0x3e')]()[_0xdd2d('0x38')](function(){if(_0x535aca[0x0]!=='2'||_0x50a526[_0xdd2d('0x1a')])return;return rpc[_0x29f2d9+_0xdd2d('0x3f')][_0xdd2d('0x40')](_0x50a526['id'],{'autoreplyExecuted':!![]})[_0xdd2d('0x38')](function(_0x34e341){logger[_0xdd2d('0x12')](_0xdd2d('0x42'),_0x39405c,JSON[_0xdd2d('0x39')](_0x34e341));})[_0xdd2d('0x3a')](function(_0x389221){logger[_0xdd2d('0x3b')](_0xdd2d('0x41'),_0x39405c,JSON[_0xdd2d('0x39')](_0x389221));});})[_0xdd2d('0x38')](function(){_0x44ed51['next']();});});}}}catch(_0x58f24a){logger[_0xdd2d('0x3b')](_0xdd2d('0x13'),_0x39405c,JSON['stringify'](_0x58f24a));_0x44ed51[_0xdd2d('0x43')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index a7ce737..0ce81c6 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 _0x49e7=['../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','format','system','Interaction','channel','update','then','info','interaction','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment'];(function(_0x5c9193,_0x2240b6){var _0x129c58=function(_0x584342){while(--_0x584342){_0x5c9193['push'](_0x5c9193['shift']());}};_0x129c58(++_0x2240b6);}(_0x49e7,0x158));var _0x749e=function(_0x3a252a,_0x23dc36){_0x3a252a=_0x3a252a-0x0;var _0x1afef4=_0x49e7[_0x3a252a];return _0x1afef4;};'use strict';var moment=require(_0x749e('0x0'));var logger=require(_0x749e('0x1'))(_0x749e('0x2'));var rpc={'chatInteraction':require(_0x749e('0x3')),'openchannelInteraction':require(_0x749e('0x4')),'smsInteraction':require(_0x749e('0x5')),'mailInteraction':require(_0x749e('0x6')),'faxInteraction':require(_0x749e('0x7')),'whatsappInteraction':require(_0x749e('0x8'))};exports[_0x749e('0x9')]=function(_0x16cccd,_0xaa2d40,_0x260984,_0x2a5847){return function(_0x3e2777){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x16cccd,_0xaa2d40[0x0]);var _0x38905b={'closed':0x1,'closedAt':moment()[_0x749e('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x749e('0xb'),'disposition':_0xaa2d40[0x0]};if(rpc[_0x2a5847['channel']+_0x749e('0xc')]){rpc[_0x2a5847[_0x749e('0xd')]+_0x749e('0xc')][_0x749e('0xe')](_0x2a5847['interaction']['id'],_0x38905b)[_0x749e('0xf')](function(_0x74464){logger[_0x749e('0x10')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x16cccd,_0x2a5847[_0x749e('0x11')]['id']);})['catch'](function(_0x14fd0f){logger[_0x749e('0x12')](_0x749e('0x13'),_0x16cccd,JSON[_0x749e('0x14')](_0x14fd0f));})[_0x749e('0x15')](function(){_0x3e2777[_0x749e('0x16')]();});}}catch(_0x4027a2){logger[_0x749e('0x12')](_0x749e('0x13'),_0x16cccd,JSON[_0x749e('0x14')](_0x4027a2));_0x3e2777['stop']();}};}; \ No newline at end of file +var _0xbad7=['channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','system'];(function(_0x184bdc,_0x2b3343){var _0x5c2a17=function(_0x4683f0){while(--_0x4683f0){_0x184bdc['push'](_0x184bdc['shift']());}};_0x5c2a17(++_0x2b3343);}(_0xbad7,0x1ee));var _0x7bad=function(_0x4e713e,_0x1ac682){_0x4e713e=_0x4e713e-0x0;var _0x296ac0=_0xbad7[_0x4e713e];return _0x296ac0;};'use strict';var moment=require(_0x7bad('0x0'));var logger=require(_0x7bad('0x1'))(_0x7bad('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7bad('0x3')),'smsInteraction':require(_0x7bad('0x4')),'mailInteraction':require(_0x7bad('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x7bad('0x6'))};exports[_0x7bad('0x7')]=function(_0x171191,_0x2cb202,_0x26bbac,_0x579cc8){return function(_0x3fd69c){try{logger[_0x7bad('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x171191,_0x2cb202[0x0]);var _0x4bdc5d={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x7bad('0x9'),'disposition':_0x2cb202[0x0]};if(rpc[_0x579cc8[_0x7bad('0xa')]+_0x7bad('0xb')]){rpc[_0x579cc8[_0x7bad('0xa')]+_0x7bad('0xb')][_0x7bad('0xc')](_0x579cc8[_0x7bad('0xd')]['id'],_0x4bdc5d)[_0x7bad('0xe')](function(_0x2511e8){logger['info'](_0x7bad('0xf'),_0x171191,_0x579cc8['interaction']['id']);})[_0x7bad('0x10')](function(_0x2a2e9f){logger[_0x7bad('0x11')]('[%s][CLOSE]\x20%s',_0x171191,JSON[_0x7bad('0x12')](_0x2a2e9f));})[_0x7bad('0x13')](function(){_0x3fd69c['stop']();});}}catch(_0x3bd54f){logger[_0x7bad('0x11')](_0x7bad('0x14'),_0x171191,JSON[_0x7bad('0x12')](_0x3bd54f));_0x3fd69c['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 7822634..f925e40 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 _0x8819=['[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','fulfillment','speech','providerName','dialogflow','providerResponse','create','metadata','endConversation','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','[%s][DIALOGFLOW]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','Message','then','body','catch','error','stringify','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8819,0x94));var _0x9881=function(_0x585dbd,_0x548fc3){_0x585dbd=_0x585dbd-0x0;var _0x71e497=_0x8819[_0x585dbd];return _0x71e497;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x9881('0x0'));var md5=require(_0x9881('0x1'));var utils=require(_0x9881('0x2'));var logger=require(_0x9881('0x3'))(_0x9881('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9881('0x5')),'mailMessage':require(_0x9881('0x6')),'smsMessage':require(_0x9881('0x7')),'faxMessage':require(_0x9881('0x8')),'whatsappMessage':require(_0x9881('0x9'))};exports[_0x9881('0xa')]=function(_0x5f1d45,_0x353966){return function(_0x4a6471){try{if(!_['isNil'](this[_0x9881('0xb')]['UserId'])){logger['info'](_0x9881('0xc'),_0x5f1d45,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4a6471[_0x9881('0xd')]();}var _0x39122e={'ContactId':this[_0x9881('0xe')]['id'],'sentAt':moment()['format'](_0x9881('0xf')),'direction':_0x9881('0x10')};if(this[_0x9881('0x11')]===_0x9881('0x12')||this['channel']===_0x9881('0x13')){_0x39122e[_0x9881('0x14')]=this['interaction'][_0x9881('0x14')];}var _0x587f05=this['channel'];if(_0x587f05==='chat'){_0x39122e['ChatWebsiteId']=this[_0x9881('0x15')]['id'];}else{_0x39122e[_[_0x9881('0x16')](_0x587f05)+_0x9881('0x17')]=this[_0x9881('0x15')]['id'];}_0x39122e[_[_0x9881('0x16')](_0x587f05)+_0x9881('0x18')]=this['interaction']['id'];if(this[_0x9881('0xb')][_0x9881('0x19')]){var _0xcc4b6d=_0x353966[0x2];if(!_['isEmpty'](_0xcc4b6d)){_0x39122e['body']=utils['getMustacheRender'](_0xcc4b6d,this);return rpc[_0x587f05+_0x9881('0x1a')]['create'](_0x39122e)[_0x9881('0x1b')](function(_0x5a9848){logger['info'](_0x9881('0xc'),_0x5f1d45,_0x39122e[_0x9881('0x1c')]);})[_0x9881('0x1d')](function(_0x2941bc){logger[_0x9881('0x1e')](_0x9881('0xc'),_0x5f1d45,JSON[_0x9881('0x1f')](_0x2941bc));})[_0x9881('0x20')](function(){logger[_0x9881('0x21')](_0x9881('0x22'),_0x5f1d45);_0x4a6471[_0x9881('0x23')]();});}else{logger[_0x9881('0x21')](_0x9881('0x24'),_0x5f1d45);_0x4a6471[_0x9881('0x23')]();}}else{var _0x174b39=this;var _0x58485d=apiai(_0x353966[0x0],{'language':_0x353966[0x1]||'en'});return _0x58485d['textRequest'](this[_0x9881('0x25')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0x9881('0x1b')](function(_0x30ed15){_0x174b39['body']['dialogflow']=_0x30ed15;_0x39122e[_0x9881('0x1c')]=_0x30ed15['result'][_0x9881('0x26')][_0x9881('0x27')];_0x39122e[_0x9881('0x28')]=_0x9881('0x29');_0x39122e[_0x9881('0x2a')]=JSON[_0x9881('0x1f')](_0x30ed15);return rpc[_0x587f05+_0x9881('0x1a')][_0x9881('0x2b')](_0x39122e)[_0x9881('0x1b')](function(_0x23727b){logger[_0x9881('0x21')](_0x9881('0xc'),_0x5f1d45,_0x39122e[_0x9881('0x1c')]);if(_0x30ed15['result'][_0x9881('0x2c')][_0x9881('0x2d')]){_0x4a6471['next']();}else{_0x4a6471[_0x9881('0x23')]();}})[_0x9881('0x1d')](function(_0x4970be){logger[_0x9881('0x1e')](_0x9881('0xc'),_0x5f1d45,JSON[_0x9881('0x1f')](_0x4970be));_0x4a6471[_0x9881('0xd')]();});})[_0x9881('0x1d')](function(_0x383ff0){logger[_0x9881('0x1e')](_0x9881('0xc'),_0x5f1d45,_0x383ff0['message']);_0x4a6471[_0x9881('0xd')]();});}}catch(_0xab2a2c){logger[_0x9881('0x1e')](_0x9881('0xc'),_0x5f1d45,JSON[_0x9881('0x1f')](_0xab2a2c));_0x4a6471[_0x9881('0x23')]();}};}; \ No newline at end of file +var _0xe314=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','result','speech','providerName','providerResponse','create','metadata','error','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat'];(function(_0x1b60db,_0x393e9c){var _0x261f63=function(_0x5215bf){while(--_0x5215bf){_0x1b60db['push'](_0x1b60db['shift']());}};_0x261f63(++_0x393e9c);}(_0xe314,0x7c));var _0x4e31=function(_0x2aaf0c,_0x120301){_0x2aaf0c=_0x2aaf0c-0x0;var _0x2ccbed=_0xe314[_0x2aaf0c];return _0x2ccbed;};'use strict';var _=require('lodash');var moment=require(_0x4e31('0x0'));var apiai=require(_0x4e31('0x1'));var md5=require(_0x4e31('0x2'));var utils=require(_0x4e31('0x3'));var logger=require(_0x4e31('0x4'))(_0x4e31('0x5'));var rpc={'chatMessage':require(_0x4e31('0x6')),'openchannelMessage':require(_0x4e31('0x7')),'mailMessage':require(_0x4e31('0x8')),'smsMessage':require(_0x4e31('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4e31('0xa')]=function(_0x29d63d,_0x608c4d){return function(_0x311a10){try{if(!_[_0x4e31('0xb')](this[_0x4e31('0xc')]['UserId'])){logger[_0x4e31('0xd')](_0x4e31('0xe'),_0x29d63d,_0x4e31('0xf'));return _0x311a10[_0x4e31('0x10')]();}var _0x4e822f={'ContactId':this[_0x4e31('0x11')]['id'],'sentAt':moment()[_0x4e31('0x12')](_0x4e31('0x13')),'direction':_0x4e31('0x14')};if(this[_0x4e31('0x15')]===_0x4e31('0x16')||this[_0x4e31('0x15')]===_0x4e31('0x17')){_0x4e822f[_0x4e31('0x18')]=this[_0x4e31('0xc')][_0x4e31('0x18')];}var _0x2033df=this[_0x4e31('0x15')];if(_0x2033df===_0x4e31('0x19')){_0x4e822f[_0x4e31('0x1a')]=this[_0x4e31('0x1b')]['id'];}else{_0x4e822f[_[_0x4e31('0x1c')](_0x2033df)+_0x4e31('0x1d')]=this['account']['id'];}_0x4e822f[_[_0x4e31('0x1c')](_0x2033df)+_0x4e31('0x1e')]=this['interaction']['id'];if(this[_0x4e31('0xc')][_0x4e31('0x1f')]){var _0x10203f=_0x608c4d[0x2];if(!_['isEmpty'](_0x10203f)){_0x4e822f[_0x4e31('0x20')]=utils[_0x4e31('0x21')](_0x10203f,this);return rpc[_0x2033df+_0x4e31('0x22')]['create'](_0x4e822f)[_0x4e31('0x23')](function(_0x4264f7){logger[_0x4e31('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x29d63d,_0x4e822f[_0x4e31('0x20')]);})[_0x4e31('0x24')](function(_0x5023aa){logger['error'](_0x4e31('0xe'),_0x29d63d,JSON[_0x4e31('0x25')](_0x5023aa));})[_0x4e31('0x26')](function(){logger[_0x4e31('0xd')](_0x4e31('0x27'),_0x29d63d);_0x311a10[_0x4e31('0x28')]();});}else{logger[_0x4e31('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x29d63d);_0x311a10[_0x4e31('0x28')]();}}else{var _0x31c5dc=this;var _0x240d19=apiai(_0x608c4d[0x0],{'language':_0x608c4d[0x1]||'en'});return _0x240d19['textRequest'](this[_0x4e31('0x29')][_0x4e31('0x20')],{'sessionId':md5(this[_0x4e31('0xc')]['id'])})[_0x4e31('0x23')](function(_0x12efaf){_0x31c5dc['body'][_0x4e31('0x2a')]=_0x12efaf;_0x4e822f[_0x4e31('0x20')]=_0x12efaf[_0x4e31('0x2b')]['fulfillment'][_0x4e31('0x2c')];_0x4e822f[_0x4e31('0x2d')]=_0x4e31('0x2a');_0x4e822f[_0x4e31('0x2e')]=JSON[_0x4e31('0x25')](_0x12efaf);return rpc[_0x2033df+_0x4e31('0x22')][_0x4e31('0x2f')](_0x4e822f)[_0x4e31('0x23')](function(_0x24b4e5){logger[_0x4e31('0xd')](_0x4e31('0xe'),_0x29d63d,_0x4e822f['body']);if(_0x12efaf[_0x4e31('0x2b')][_0x4e31('0x30')]['endConversation']){_0x311a10[_0x4e31('0x10')]();}else{_0x311a10[_0x4e31('0x28')]();}})['catch'](function(_0x2fb71b){logger['error'](_0x4e31('0xe'),_0x29d63d,JSON[_0x4e31('0x25')](_0x2fb71b));_0x311a10['next']();});})[_0x4e31('0x24')](function(_0x446df6){logger[_0x4e31('0x31')](_0x4e31('0xe'),_0x29d63d,_0x446df6[_0x4e31('0x29')]);_0x311a10[_0x4e31('0x10')]();});}}catch(_0x26f79b){logger[_0x4e31('0x31')](_0x4e31('0xe'),_0x29d63d,JSON[_0x4e31('0x25')](_0x26f79b));_0x311a10['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index e772c76..5dfcbfd 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 _0x0e72=['../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','whatsapp','phone','channel','chat','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','stringify','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x559920,_0x5931ad){var _0x332066=function(_0x1fbd07){while(--_0x1fbd07){_0x559920['push'](_0x559920['shift']());}};_0x332066(++_0x5931ad);}(_0x0e72,0x1a7));var _0x20e7=function(_0x371f28,_0x315fc9){_0x371f28=_0x371f28-0x0;var _0x3b690f=_0x0e72[_0x371f28];return _0x3b690f;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x20e7('0x0'));var moment=require(_0x20e7('0x1'));var Promise=require(_0x20e7('0x2'));var logger=require(_0x20e7('0x3'))(_0x20e7('0x4'));var utils=require(_0x20e7('0x5'));var rpc={'chatMessage':require(_0x20e7('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x20e7('0x7')),'smsMessage':require(_0x20e7('0x8')),'faxMessage':require(_0x20e7('0x9')),'whatsappMessage':require(_0x20e7('0xa'))};function createMessage(_0x1e5ace,_0x39adbc,_0x223059,_0x3ddac4){return new Promise(function(_0x1ae4be,_0x5a7e96){var _0x4e042c=_[_0x20e7('0xb')](_0x223059);_0x4e042c[_0x20e7('0xc')]=_0x3ddac4;return rpc[_0x39adbc+_0x20e7('0xd')][_0x20e7('0xe')](_0x4e042c)[_0x20e7('0xf')](function(){logger[_0x20e7('0x10')](_0x20e7('0x11'),_0x1e5ace,_0x4e042c['body']);_0x1ae4be();})[_0x20e7('0x12')](function(_0x480953){logger[_0x20e7('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x1e5ace,JSON['stringify'](_0x480953));_0x5a7e96(_0x480953);});});}exports[_0x20e7('0x14')]=function(_0x899ec8,_0x316385){return function(_0x2d5fba){try{if(!_[_0x20e7('0x15')](this[_0x20e7('0x16')][_0x20e7('0x17')])){logger[_0x20e7('0x10')](_0x20e7('0x11'),_0x899ec8,_0x20e7('0x18'));return _0x2d5fba[_0x20e7('0x19')]();}var _0x2e3faf={'ContactId':this[_0x20e7('0x1a')]['id'],'sentAt':moment()[_0x20e7('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x20e7('0x1c')};if(this['channel']===_0x20e7('0x1d')||this['channel']===_0x20e7('0x1e')){_0x2e3faf[_0x20e7('0x1f')]=this[_0x20e7('0x16')][_0x20e7('0x1f')];}var _0xd5993f=this[_0x20e7('0x20')];if(_0xd5993f===_0x20e7('0x21')){_0x2e3faf['ChatWebsiteId']=this[_0x20e7('0x22')]['id'];}else{_0x2e3faf[_[_0x20e7('0x23')](_0xd5993f)+_0x20e7('0x24')]=this[_0x20e7('0x22')]['id'];}_0x2e3faf[_['upperFirst'](_0xd5993f)+_0x20e7('0x25')]=this[_0x20e7('0x16')]['id'];if(this[_0x20e7('0x16')]['created']){var _0x364163=_0x316385[0x4];if(!_[_0x20e7('0x26')](_0x364163)){_0x2e3faf[_0x20e7('0xc')]=utils[_0x20e7('0x27')](_0x364163,this);return rpc[_0xd5993f+_0x20e7('0xd')][_0x20e7('0xe')](_0x2e3faf)[_0x20e7('0xf')](function(_0x12f65b){logger[_0x20e7('0x10')](_0x20e7('0x11'),_0x899ec8,_0x2e3faf[_0x20e7('0xc')]);})['catch'](function(_0x257cf1){logger[_0x20e7('0x13')](_0x20e7('0x11'),_0x899ec8,JSON[_0x20e7('0x28')](_0x257cf1));})['finally'](function(){logger[_0x20e7('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x899ec8);_0x2d5fba[_0x20e7('0x29')]();});}else{logger[_0x20e7('0x10')](_0x20e7('0x2a'),_0x899ec8);_0x2d5fba[_0x20e7('0x29')]();}}else{var _0x44e951=this;var _0x38943b=_0x316385[0x2][_0x20e7('0x2b')](/\\n/g,'\x0a');var _0x1470f8={'credentials':{'private_key':_0x38943b,'client_email':_0x316385[0x1]}};var _0x55cfa1=new dialogflow[(_0x20e7('0x2c'))](_0x1470f8);var _0x2b3ac8=_0x55cfa1[_0x20e7('0x2d')](_0x316385[0x0],md5(_0x44e951[_0x20e7('0x16')]['id']));var _0x3e5b35={'session':_0x2b3ac8,'queryInput':{'text':{'text':_0x44e951[_0x20e7('0x2e')][_0x20e7('0xc')],'languageCode':_0x316385[0x3]||'en'}}};return _0x55cfa1[_0x20e7('0x2f')](_0x3e5b35)['then'](function(_0x43121c){if(_0x43121c&&_0x43121c[_0x20e7('0x30')]){_0x44e951[_0x20e7('0xc')][_0x20e7('0x31')]=_0x43121c;var _0x2252e4=_0x43121c[0x0];var _0x5dea8a=_0x2252e4['queryResult'][_0x20e7('0x32')]&&_0x2252e4[_0x20e7('0x33')][_0x20e7('0x32')][_0x20e7('0x34')]?_0x2252e4[_0x20e7('0x33')][_0x20e7('0x32')][_0x20e7('0x34')]['end_conversation'][_0x20e7('0x35')]:![];_0x44e951[_0x20e7('0xc')][_0x20e7('0x36')]=_0x2252e4[_0x20e7('0x33')]['action'];_0x44e951[_0x20e7('0xc')][_0x20e7('0x37')]=_0x2252e4[_0x20e7('0x33')]['allRequiredParamsPresent'];_0x44e951[_0x20e7('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x2252e4[_0x20e7('0x33')][_0x20e7('0x32')]&&_0x2252e4['queryResult'][_0x20e7('0x32')][_0x20e7('0x34')]?_0x2252e4[_0x20e7('0x33')][_0x20e7('0x32')][_0x20e7('0x34')][_0x20e7('0x38')][_0x20e7('0x35')]:![];_0x44e951['body'][_0x20e7('0x39')]=_0x2252e4['queryResult'][_0x20e7('0x3a')][_0x20e7('0x3b')];_0x44e951['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x2252e4['queryResult']['intent'][_0x20e7('0x3c')];_0x44e951[_0x20e7('0xc')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x2252e4[_0x20e7('0x33')][_0x20e7('0x3a')][_0x20e7('0x3d')];_0x44e951[_0x20e7('0xc')][_0x20e7('0x3e')]=_0x2252e4[_0x20e7('0x33')][_0x20e7('0x3f')];_0x44e951[_0x20e7('0xc')][_0x20e7('0x40')]=_0x2252e4['queryResult'][_0x20e7('0x41')];_0x44e951[_0x20e7('0xc')][_0x20e7('0x42')]=_0x2252e4['queryResult'][_0x20e7('0x43')];_0x2e3faf[_0x20e7('0x44')]='dialogflowV2';_0x2e3faf[_0x20e7('0x45')]=JSON[_0x20e7('0x28')](_0x43121c);var _0x4dac94=[];for(var _0x503144=0x0;_0x503144<_0x43121c[_0x20e7('0x30')];_0x503144++){var _0x441203=_0x43121c[_0x503144];if(_0x441203&&_0x441203[_0x20e7('0x33')]&&_0x441203[_0x20e7('0x33')]['fulfillmentText']){_0x4dac94['push'](createMessage(_0x899ec8,_0xd5993f,_0x2e3faf,_0x441203[_0x20e7('0x33')][_0x20e7('0x46')]));}}return Promise[_0x20e7('0x47')](_0x4dac94)[_0x20e7('0xf')](function(){if(_0x5dea8a){_0x2d5fba[_0x20e7('0x19')]();}else{_0x2d5fba[_0x20e7('0x29')]();}})['catch'](function(_0x4f0129){logger[_0x20e7('0x13')](_0x20e7('0x11'),_0x899ec8,JSON['stringify'](_0x4f0129));_0x2d5fba[_0x20e7('0x19')]();});}})[_0x20e7('0x12')](function(_0x585c22){logger[_0x20e7('0x13')](_0x20e7('0x11'),_0x899ec8,_0x585c22[_0x20e7('0x2e')],_0x585c22['stack']);_0x2d5fba['next']();});}}catch(_0x4c60db){logger[_0x20e7('0x13')](_0x20e7('0x11'),_0x899ec8,JSON[_0x20e7('0x28')](_0x4c60db));_0x2d5fba[_0x20e7('0x29')]();}};}; \ No newline at end of file +var _0x8f77=['DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerResponse','length','fulfillmentText','all','next','message','stack','lodash','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name'];(function(_0x527536,_0x192f94){var _0x11f19d=function(_0x53c6c0){while(--_0x53c6c0){_0x527536['push'](_0x527536['shift']());}};_0x11f19d(++_0x192f94);}(_0x8f77,0x1d8));var _0x78f7=function(_0x3966b3,_0x59c284){_0x3966b3=_0x3966b3-0x0;var _0x22fbb2=_0x8f77[_0x3966b3];return _0x22fbb2;};'use strict';var _=require(_0x78f7('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x78f7('0x1'));var moment=require(_0x78f7('0x2'));var Promise=require(_0x78f7('0x3'));var logger=require('../../../../config/logger')(_0x78f7('0x4'));var utils=require(_0x78f7('0x5'));var rpc={'chatMessage':require(_0x78f7('0x6')),'openchannelMessage':require(_0x78f7('0x7')),'mailMessage':require(_0x78f7('0x8')),'smsMessage':require(_0x78f7('0x9')),'faxMessage':require(_0x78f7('0xa')),'whatsappMessage':require(_0x78f7('0xb'))};function createMessage(_0x34bcdc,_0x7975c1,_0xce558c,_0x54538f){return new Promise(function(_0x33017d,_0x458b59){var _0x3c5823=_['clone'](_0xce558c);_0x3c5823[_0x78f7('0xc')]=_0x54538f;return rpc[_0x7975c1+_0x78f7('0xd')][_0x78f7('0xe')](_0x3c5823)['then'](function(){logger[_0x78f7('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x34bcdc,_0x3c5823[_0x78f7('0xc')]);_0x33017d();})[_0x78f7('0x10')](function(_0x23adf0){logger[_0x78f7('0x11')](_0x78f7('0x12'),_0x34bcdc,JSON[_0x78f7('0x13')](_0x23adf0));_0x458b59(_0x23adf0);});});}exports[_0x78f7('0x14')]=function(_0x1b6eb7,_0x23c843){return function(_0x47341e){try{if(!_[_0x78f7('0x15')](this[_0x78f7('0x16')]['UserId'])){logger[_0x78f7('0xf')](_0x78f7('0x12'),_0x1b6eb7,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x47341e['next']();}var _0x13cfda={'ContactId':this[_0x78f7('0x17')]['id'],'sentAt':moment()[_0x78f7('0x18')](_0x78f7('0x19')),'direction':_0x78f7('0x1a')};if(this[_0x78f7('0x1b')]===_0x78f7('0x1c')||this[_0x78f7('0x1b')]===_0x78f7('0x1d')){_0x13cfda[_0x78f7('0x1e')]=this[_0x78f7('0x16')][_0x78f7('0x1e')];}var _0x549149=this['channel'];if(_0x549149===_0x78f7('0x1f')){_0x13cfda[_0x78f7('0x20')]=this['account']['id'];}else{_0x13cfda[_[_0x78f7('0x21')](_0x549149)+_0x78f7('0x22')]=this[_0x78f7('0x23')]['id'];}_0x13cfda[_[_0x78f7('0x21')](_0x549149)+_0x78f7('0x24')]=this['interaction']['id'];if(this['interaction'][_0x78f7('0x25')]){var _0x48ec60=_0x23c843[0x4];if(!_[_0x78f7('0x26')](_0x48ec60)){_0x13cfda['body']=utils[_0x78f7('0x27')](_0x48ec60,this);return rpc[_0x549149+_0x78f7('0xd')][_0x78f7('0xe')](_0x13cfda)[_0x78f7('0x28')](function(_0x3cca3d){logger[_0x78f7('0xf')](_0x78f7('0x12'),_0x1b6eb7,_0x13cfda[_0x78f7('0xc')]);})[_0x78f7('0x10')](function(_0x2eee56){logger['error'](_0x78f7('0x12'),_0x1b6eb7,JSON['stringify'](_0x2eee56));})[_0x78f7('0x29')](function(){logger[_0x78f7('0xf')](_0x78f7('0x2a'),_0x1b6eb7);_0x47341e['stop']();});}else{logger[_0x78f7('0xf')](_0x78f7('0x2b'),_0x1b6eb7);_0x47341e[_0x78f7('0x2c')]();}}else{var _0x36c20a=this;var _0x23ed67=_0x23c843[0x2][_0x78f7('0x2d')](/\\n/g,'\x0a');var _0x4b7cfc={'credentials':{'private_key':_0x23ed67,'client_email':_0x23c843[0x1]}};var _0x22c9a4=new dialogflow[(_0x78f7('0x2e'))](_0x4b7cfc);var _0x125795=_0x22c9a4[_0x78f7('0x2f')](_0x23c843[0x0],md5(_0x36c20a[_0x78f7('0x16')]['id']));var _0x50740c={'session':_0x125795,'queryInput':{'text':{'text':_0x36c20a['message'][_0x78f7('0xc')],'languageCode':_0x23c843[0x3]||'en'}}};return _0x22c9a4[_0x78f7('0x30')](_0x50740c)[_0x78f7('0x28')](function(_0x3248e7){if(_0x3248e7&&_0x3248e7['length']){_0x36c20a[_0x78f7('0xc')][_0x78f7('0x31')]=_0x3248e7;var _0x507f81=_0x3248e7[0x0];var _0x3f9a18=_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')]&&_0x507f81[_0x78f7('0x32')]['diagnosticInfo']['fields']?_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')][_0x78f7('0x34')]['end_conversation'][_0x78f7('0x35')]:![];_0x36c20a['body'][_0x78f7('0x36')]=_0x507f81[_0x78f7('0x32')]['action'];_0x36c20a[_0x78f7('0xc')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x507f81[_0x78f7('0x32')][_0x78f7('0x37')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x38')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')]&&_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')][_0x78f7('0x34')]?_0x507f81['queryResult'][_0x78f7('0x33')][_0x78f7('0x34')]['end_conversation'][_0x78f7('0x35')]:![];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x39')]=_0x507f81['queryResult'][_0x78f7('0x3a')][_0x78f7('0x3b')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x3c')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x3a')][_0x78f7('0x3d')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x3e')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x3a')][_0x78f7('0x3f')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x40')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x41')];_0x36c20a['body'][_0x78f7('0x42')]=_0x507f81['queryResult'][_0x78f7('0x43')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x44')]=_0x507f81[_0x78f7('0x32')]['intentDetectionConfidence'];_0x13cfda['providerName']=_0x78f7('0x31');_0x13cfda[_0x78f7('0x45')]=JSON[_0x78f7('0x13')](_0x3248e7);var _0x101fdc=[];for(var _0x2e7929=0x0;_0x2e7929<_0x3248e7[_0x78f7('0x46')];_0x2e7929++){var _0x150f76=_0x3248e7[_0x2e7929];if(_0x150f76&&_0x150f76['queryResult']&&_0x150f76[_0x78f7('0x32')][_0x78f7('0x47')]){_0x101fdc['push'](createMessage(_0x1b6eb7,_0x549149,_0x13cfda,_0x150f76[_0x78f7('0x32')][_0x78f7('0x47')]));}}return Promise[_0x78f7('0x48')](_0x101fdc)[_0x78f7('0x28')](function(){if(_0x3f9a18){_0x47341e[_0x78f7('0x49')]();}else{_0x47341e[_0x78f7('0x2c')]();}})[_0x78f7('0x10')](function(_0x44990d){logger[_0x78f7('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x1b6eb7,JSON[_0x78f7('0x13')](_0x44990d));_0x47341e[_0x78f7('0x49')]();});}})[_0x78f7('0x10')](function(_0x12a82d){logger[_0x78f7('0x11')](_0x78f7('0x12'),_0x1b6eb7,_0x12a82d[_0x78f7('0x4a')],_0x12a82d[_0x78f7('0x4b')]);_0x47341e[_0x78f7('0x49')]();});}}catch(_0x4a203c){logger[_0x78f7('0x11')](_0x78f7('0x12'),_0x1b6eb7,JSON[_0x78f7('0x13')](_0x4a203c));_0x47341e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 55b8f62..2eed4cb 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 _0x7156=['stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','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'];(function(_0x43c394,_0x2d9e21){var _0x50f077=function(_0x386189){while(--_0x386189){_0x43c394['push'](_0x43c394['shift']());}};_0x50f077(++_0x2d9e21);}(_0x7156,0x10f));var _0x6715=function(_0x21f96e,_0x1739a5){_0x21f96e=_0x21f96e-0x0;var _0x4dc184=_0x7156[_0x21f96e];return _0x4dc184;};'use strict';var schema=require(_0x6715('0x0'));var _=require(_0x6715('0x1'));var htmlToText=require(_0x6715('0x2'));var utils=require(_0x6715('0x3'));var logger=require(_0x6715('0x4'))(_0x6715('0x5'));var gotoif=schema({'condition':{'type':_0x6715('0x6'),'required':!![],'message':_0x6715('0x7')},'priorityTrue':{'type':_0x6715('0x8'),'message':_0x6715('0x9')},'priorityFalse':{'type':_0x6715('0x8'),'message':_0x6715('0xa')}});exports[_0x6715('0xb')]=function(_0x45fe9f,_0x4ab1e3){return function(_0x2b6001){try{var _0x11f3fd={'condition':htmlToText[_0x6715('0xc')](utils[_0x6715('0xd')](_0x4ab1e3[0x0],this),{'wordwrap':![]})[_0x6715('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4ab1e3[0x1],'priorityFalse':_0x4ab1e3[0x2]};var _0x5eadf8=gotoif[_0x6715('0x0')](_0x11f3fd,{'typecast':!![]});if(_0x5eadf8[_0x6715('0xf')]){logger['error'](_0x6715('0x10'),_0x45fe9f,_[_0x6715('0x11')](_0x5eadf8,_0x6715('0x12'))['join'](',\x20'));_0x2b6001[_0x6715('0x13')]();}else{try{var _0x21bb77=eval('('+_0x11f3fd[_0x6715('0x14')]+')');var _0x2f96a1=_0x21bb77?_0x11f3fd[_0x6715('0x15')]:_0x11f3fd[_0x6715('0x16')];logger[_0x6715('0x17')](_0x6715('0x18'),_0x45fe9f,_0x11f3fd[_0x6715('0x14')],_0x21bb77,_0x2f96a1||_0x6715('0x19'));if(_0x2f96a1){var _0x5c471c=_[_0x6715('0x1a')](_0x2b6001[_0x6715('0x1b')](),{'p':_0x2f96a1});if(_0x5c471c>=0x0){logger[_0x6715('0x17')](_0x6715('0x1c'),_0x45fe9f,_0x2f96a1||'next',_0x5c471c);_0x2b6001[_0x6715('0x19')](_0x5c471c);}else{logger[_0x6715('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x45fe9f,_0x2f96a1||_0x6715('0x19'));_0x2b6001[_0x6715('0x13')]();}}else{_0x2b6001[_0x6715('0x19')]();}}catch(_0x4553d2){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x45fe9f,_0x4553d2[_0x6715('0x12')]);_0x2b6001[_0x6715('0x13')]();}}}catch(_0x2df023){logger['error']('[%s][GOTOIF]\x20%s',_0x45fe9f,JSON[_0x6715('0x1d')](_0x2df023));_0x2b6001[_0x6715('0x13')]();}};}; \ No newline at end of file +var _0x4789=['../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','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','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4789,0x1bc));var _0x9478=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x4789[_0x55d8c5];return _0x225ae5;};'use strict';var schema=require(_0x9478('0x0'));var _=require(_0x9478('0x1'));var htmlToText=require(_0x9478('0x2'));var utils=require(_0x9478('0x3'));var logger=require(_0x9478('0x4'))(_0x9478('0x5'));var gotoif=schema({'condition':{'type':_0x9478('0x6'),'required':!![],'message':_0x9478('0x7')},'priorityTrue':{'type':_0x9478('0x8'),'message':_0x9478('0x9')},'priorityFalse':{'type':_0x9478('0x8'),'message':_0x9478('0xa')}});exports['consequence']=function(_0x5b1d2b,_0x590299){return function(_0x4327f8){try{var _0x182c8a={'condition':htmlToText[_0x9478('0xb')](utils[_0x9478('0xc')](_0x590299[0x0],this),{'wordwrap':![]})[_0x9478('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x590299[0x1],'priorityFalse':_0x590299[0x2]};var _0x13fdea=gotoif[_0x9478('0x0')](_0x182c8a,{'typecast':!![]});if(_0x13fdea[_0x9478('0xe')]){logger[_0x9478('0xf')](_0x9478('0x10'),_0x5b1d2b,_[_0x9478('0x11')](_0x13fdea,_0x9478('0x12'))[_0x9478('0x13')](',\x20'));_0x4327f8[_0x9478('0x14')]();}else{try{var _0x124f72=eval('('+_0x182c8a[_0x9478('0x15')]+')');var _0x1a9476=_0x124f72?_0x182c8a[_0x9478('0x16')]:_0x182c8a[_0x9478('0x17')];logger[_0x9478('0x18')](_0x9478('0x19'),_0x5b1d2b,_0x182c8a['condition'],_0x124f72,_0x1a9476||_0x9478('0x1a'));if(_0x1a9476){var _0x378caa=_[_0x9478('0x1b')](_0x4327f8[_0x9478('0x1c')](),{'p':_0x1a9476});if(_0x378caa>=0x0){logger[_0x9478('0x18')](_0x9478('0x1d'),_0x5b1d2b,_0x1a9476||'next',_0x378caa);_0x4327f8[_0x9478('0x1a')](_0x378caa);}else{logger[_0x9478('0x18')](_0x9478('0x1e'),_0x5b1d2b,_0x1a9476||_0x9478('0x1a'));_0x4327f8[_0x9478('0x14')]();}}else{_0x4327f8[_0x9478('0x1a')]();}}catch(_0x2a2aa5){logger[_0x9478('0xf')](_0x9478('0x1f'),_0x5b1d2b,_0x2a2aa5[_0x9478('0x12')]);_0x4327f8['stop']();}}}catch(_0x17e1f1){logger[_0x9478('0xf')](_0x9478('0x10'),_0x5b1d2b,JSON['stringify'](_0x17e1f1));_0x4327f8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 4a141a2..e6f0204 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 _0x389d=['validate','lodash','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x389d,0x19e));var _0xd389=function(_0x57f345,_0x316929){_0x57f345=_0x57f345-0x0;var _0x255e43=_0x389d[_0x57f345];return _0x255e43;};'use strict';var schema=require(_0xd389('0x0'));var _=require(_0xd389('0x1'));var logger=require(_0xd389('0x2'))(_0xd389('0x3'));var gotop=schema({'priority':{'type':_0xd389('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xd389('0x5')]=function(_0x1b0a6f,_0x51a44b){return function(_0x4f49b2){try{var _0x404c0f={'priority':_0x51a44b[0x0]};var _0x1a0c36=gotop[_0xd389('0x0')](_0x404c0f,{'typecast':!![]});if(_0x1a0c36[_0xd389('0x6')]){logger[_0xd389('0x7')](_0xd389('0x8'),_0x1b0a6f,_['map'](_0x1a0c36,_0xd389('0x9'))['join'](',\x20'));_0x4f49b2[_0xd389('0xa')]();}else{logger[_0xd389('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x1b0a6f,_0x404c0f[_0xd389('0xc')]);if(_0x404c0f[_0xd389('0xc')]){var _0x210f07=_[_0xd389('0xd')](_0x4f49b2[_0xd389('0xe')](),{'p':_0x404c0f[_0xd389('0xc')]});if(_0x210f07>=0x0){logger[_0xd389('0xb')](_0xd389('0xf'),_0x1b0a6f,_0x404c0f[_0xd389('0xc')]||_0xd389('0x10'),_0x210f07);_0x4f49b2[_0xd389('0x10')](_0x210f07);}else{logger[_0xd389('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1b0a6f,_0x404c0f['priority']||_0xd389('0x10'));_0x4f49b2[_0xd389('0xa')]();}}else{_0x4f49b2['next']();}}}catch(_0x56f632){logger['error'](_0xd389('0x8'),_0x1b0a6f,JSON[_0xd389('0x11')](_0x56f632));_0x4f49b2['stop']();}};}; \ No newline at end of file +var _0x882f=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','[%s][GOTOP]\x20%s','stringify','validate','lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x882f,0xbe));var _0xf882=function(_0x35a441,_0x3a2ec6){_0x35a441=_0x35a441-0x0;var _0x571ce3=_0x882f[_0x35a441];return _0x571ce3;};'use strict';var schema=require(_0xf882('0x0'));var _=require(_0xf882('0x1'));var logger=require('../../../../config/logger')(_0xf882('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xf882('0x3')}});exports[_0xf882('0x4')]=function(_0x32a355,_0x1057ac){return function(_0x504a3b){try{var _0x29d536={'priority':_0x1057ac[0x0]};var _0x837a8b=gotop[_0xf882('0x0')](_0x29d536,{'typecast':!![]});if(_0x837a8b[_0xf882('0x5')]){logger[_0xf882('0x6')]('[%s][GOTOP]\x20%s',_0x32a355,_[_0xf882('0x7')](_0x837a8b,_0xf882('0x8'))[_0xf882('0x9')](',\x20'));_0x504a3b[_0xf882('0xa')]();}else{logger[_0xf882('0xb')](_0xf882('0xc'),_0x32a355,_0x29d536[_0xf882('0xd')]);if(_0x29d536[_0xf882('0xd')]){var _0x171298=_['findIndex'](_0x504a3b[_0xf882('0xe')](),{'p':_0x29d536[_0xf882('0xd')]});if(_0x171298>=0x0){logger['info'](_0xf882('0xf'),_0x32a355,_0x29d536[_0xf882('0xd')]||'next',_0x171298);_0x504a3b['next'](_0x171298);}else{logger[_0xf882('0xb')](_0xf882('0x10'),_0x32a355,_0x29d536[_0xf882('0xd')]||_0xf882('0x11'));_0x504a3b[_0xf882('0xa')]();}}else{_0x504a3b['next']();}}}catch(_0x695a2c){logger[_0xf882('0x6')](_0xf882('0x12'),_0x32a355,JSON[_0xf882('0x13')](_0x695a2c));_0x504a3b['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 f9d0ad9..85c90b0 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 _0xb458=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','AccountId','account','interaction','Message','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x4fdfc0,_0xae9fa5){var _0x2f26c8=function(_0x3639ca){while(--_0x3639ca){_0x4fdfc0['push'](_0x4fdfc0['shift']());}};_0x2f26c8(++_0xae9fa5);}(_0xb458,0xca));var _0x8b45=function(_0x55414d,_0x478837){_0x55414d=_0x55414d-0x0;var _0x4461b6=_0xb458[_0x55414d];return _0x4461b6;};'use strict';var _=require(_0x8b45('0x0'));var utils=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))(_0x8b45('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8b45('0x4')),'mailMessage':require(_0x8b45('0x5')),'smsMessage':require(_0x8b45('0x6')),'faxMessage':require(_0x8b45('0x7')),'whatsappMessage':require(_0x8b45('0x8'))};exports[_0x8b45('0x9')]=function(_0x3f0efd,_0x35680c){return function(_0x2a5b3c){try{var _0x114de0={'body':utils[_0x8b45('0xa')](_0x35680c[0x0],this),'ContactId':this[_0x8b45('0xb')]['id']};if(this[_0x8b45('0xc')]==='chat'){_0x114de0[_0x8b45('0xd')]=this['account']['id'];}else{_0x114de0[_['upperFirst'](this[_0x8b45('0xc')])+_0x8b45('0xe')]=this[_0x8b45('0xf')]['id'];}_0x114de0[_['upperFirst'](this[_0x8b45('0xc')])+'InteractionId']=this[_0x8b45('0x10')]['id'];if(rpc[this[_0x8b45('0xc')]+_0x8b45('0x11')]){return rpc[this[_0x8b45('0xc')]+_0x8b45('0x11')]['create'](_0x114de0)['then'](function(_0x46a6c4){logger[_0x8b45('0x12')](_0x8b45('0x13'),_0x3f0efd,_0x114de0[_0x8b45('0x14')]);_0x2a5b3c[_0x8b45('0x15')]();})[_0x8b45('0x16')](function(_0x1bd228){logger[_0x8b45('0x17')](_0x8b45('0x13'),_0x3f0efd,JSON[_0x8b45('0x18')](_0x1bd228));_0x2a5b3c[_0x8b45('0x19')]();});}}catch(_0x153495){logger[_0x8b45('0x17')](_0x8b45('0x13'),_0x3f0efd,JSON[_0x8b45('0x18')](_0x153495));_0x2a5b3c['stop']();}};}; \ No newline at end of file +var _0x8185=['stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','account','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','error'];(function(_0x4ae8f8,_0x40a58e){var _0x24c8c6=function(_0x2457da){while(--_0x2457da){_0x4ae8f8['push'](_0x4ae8f8['shift']());}};_0x24c8c6(++_0x40a58e);}(_0x8185,0xb8));var _0x5818=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x8185[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x5818('0x0'));var utils=require(_0x5818('0x1'));var logger=require(_0x5818('0x2'))('routing');var rpc={'chatMessage':require(_0x5818('0x3')),'openchannelMessage':require(_0x5818('0x4')),'mailMessage':require(_0x5818('0x5')),'smsMessage':require(_0x5818('0x6')),'faxMessage':require(_0x5818('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x5818('0x8')]=function(_0x124d5d,_0x635812){return function(_0x2e1d94){try{var _0x412c57={'body':utils[_0x5818('0x9')](_0x635812[0x0],this),'ContactId':this[_0x5818('0xa')]['id']};if(this[_0x5818('0xb')]===_0x5818('0xc')){_0x412c57[_0x5818('0xd')]=this['account']['id'];}else{_0x412c57[_[_0x5818('0xe')](this[_0x5818('0xb')])+'AccountId']=this[_0x5818('0xf')]['id'];}_0x412c57[_[_0x5818('0xe')](this['channel'])+'InteractionId']=this[_0x5818('0x10')]['id'];if(rpc[this[_0x5818('0xb')]+'Message']){return rpc[this[_0x5818('0xb')]+_0x5818('0x11')][_0x5818('0x12')](_0x412c57)['then'](function(_0x41070e){logger[_0x5818('0x13')](_0x5818('0x14'),_0x124d5d,_0x412c57[_0x5818('0x15')]);_0x2e1d94[_0x5818('0x16')]();})['catch'](function(_0x15ef16){logger[_0x5818('0x17')](_0x5818('0x14'),_0x124d5d,JSON[_0x5818('0x18')](_0x15ef16));_0x2e1d94[_0x5818('0x19')]();});}}catch(_0x4006d7){logger[_0x5818('0x17')]('[%s][MESSAGE]\x20%s',_0x124d5d,JSON[_0x5818('0x18')](_0x4006d7));_0x2e1d94['stop']();}};}; \ 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 acf77ce..38b9598 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 _0x8cc5=['getMustacheRender','error','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0xdcafe7,_0x3cb34d){var _0x1d7fb5=function(_0x283de3){while(--_0x283de3){_0xdcafe7['push'](_0xdcafe7['shift']());}};_0x1d7fb5(++_0x3cb34d);}(_0x8cc5,0xb2));var _0x58cc=function(_0x21e020,_0x45d5d9){_0x21e020=_0x21e020-0x0;var _0x341331=_0x8cc5[_0x21e020];return _0x341331;};'use strict';var utils=require(_0x58cc('0x0'));var logger=require(_0x58cc('0x1'))(_0x58cc('0x2'));exports[_0x58cc('0x3')]=function(_0x34fc69,_0x161f0c){return function(_0x44ef0a){try{logger[_0x58cc('0x4')](_0x58cc('0x5'),_0x34fc69,utils[_0x58cc('0x6')](_0x161f0c[0x0],this));_0x44ef0a['next']();}catch(_0x4fd031){logger[_0x58cc('0x7')](_0x58cc('0x5'),_0x34fc69,JSON['stringify'](_0x4fd031));_0x44ef0a['stop']();}};}; \ No newline at end of file +var _0xad58=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','./utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xad58,0x1b8));var _0x8ad5=function(_0xa522f,_0x5debbc){_0xa522f=_0xa522f-0x0;var _0x2083b0=_0xad58[_0xa522f];return _0x2083b0;};'use strict';var utils=require(_0x8ad5('0x0'));var logger=require('../../../../config/logger')(_0x8ad5('0x1'));exports[_0x8ad5('0x2')]=function(_0xaefd61,_0x5d87c4){return function(_0x281795){try{logger[_0x8ad5('0x3')](_0x8ad5('0x4'),_0xaefd61,utils[_0x8ad5('0x5')](_0x5d87c4[0x0],this));_0x281795[_0x8ad5('0x6')]();}catch(_0x413198){logger['error'](_0x8ad5('0x4'),_0xaefd61,JSON['stringify'](_0x413198));_0x281795['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 4cc30d6..2deca05 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 _0xd775=['[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','queue_id','account','queue','from','push','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','QueueReport','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','next','strategy','rrmemory','beepall'];(function(_0x17789b,_0x4ad07b){var _0x2e64b6=function(_0x55f445){while(--_0x55f445){_0x17789b['push'](_0x17789b['shift']());}};_0x2e64b6(++_0x4ad07b);}(_0xd775,0xa2));var _0x5d77=function(_0x58bc9b,_0x1e111e){_0x58bc9b=_0x58bc9b-0x0;var _0x14542d=_0xd775[_0x58bc9b];return _0x14542d;};'use strict';var schema=require(_0x5d77('0x0'));var _=require('lodash');var util=require(_0x5d77('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x5d77('0x2'));var Redis=require(_0x5d77('0x3'));var config=require(_0x5d77('0x4'));var logger=require(_0x5d77('0x5'))(_0x5d77('0x6'));var strategy=require(_0x5d77('0x7'));config['redis']=_[_0x5d77('0x8')](config[_0x5d77('0x9')],{'host':_0x5d77('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5d77('0x9')]));var attributes=['id',_0x5d77('0xb'),_0x5d77('0xc'),_0x5d77('0xd'),_0x5d77('0xe'),'joinAt'];function emit(_0x308c4a,_0x519f0e,_0x352acc){io['to'](_0x308c4a)['emit'](_0x519f0e,_0x352acc);}function emitChannelQueueInteraction(_0x4fe26f,_0x1bd356,_0x38df63,_0x14db35,_0xe9787c,_0x1212e2,_0x111e5d,_0x222877){var _0x436f20=_['clone'](_0x38df63);_0x436f20[_0x5d77('0xb')]=_0x222877;_0x436f20[_0x5d77('0xd')]=_0x1bd356;_0x436f20[_0x5d77('0xc')]=_0x14db35;_0x436f20['id']=_0xe9787c;if(_0x1212e2){attributes[_0x5d77('0xf')](_['capitalize'](_0x4fe26f)+_0x5d77('0x10'));_0x111e5d[util[_0x5d77('0x11')](_0x5d77('0x12'),_0x4fe26f)][_0xe9787c]=_[_0x5d77('0x13')](_0x436f20,attributes);}else{delete _0x111e5d[util[_0x5d77('0x11')]('%sQueuesWaitingInteractions',_0x4fe26f)][_0xe9787c];}emit(util[_0x5d77('0x11')]('%s:queue:%s',_0x4fe26f,_0x1bd356),util[_0x5d77('0x11')](_0x5d77('0x14'),_0x4fe26f,_0x1212e2?'save':_0x5d77('0x15')),_[_0x5d77('0x13')](_0x436f20,attributes));}var rpc={'openchannelQueueReport':require(_0x5d77('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x5d77('0x17')),'chatInteraction':require(_0x5d77('0x18')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x5d77('0x19')),'openchannelInteraction':require(_0x5d77('0x1a')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x5d77('0x1b')},'timeout':{'type':_0x5d77('0x1c'),'message':_0x5d77('0x1d')}});function startRouting(_0x339ae1,_0x2ad998,_0x556eef,_0x16167d){if(_0x339ae1&&_0x2ad998&&_0x556eef){_0x2ad998[_0x5d77('0x1e')]+=0x1;var _0x21f607={'uniqueid':_0x339ae1,'from':_0x556eef[_0x5d77('0x1f')]?_0x556eef[_0x5d77('0x1f')][_0x5d77('0xe')]:'','joinAt':moment()[_0x5d77('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x556eef['contact']?_0x556eef[_0x5d77('0x20')]['id']:null,'ListId':_0x556eef[_0x5d77('0x21')]?_0x556eef[_0x5d77('0x21')]['id']:null};_0x21f607[_[_0x5d77('0x22')](_0x556eef[_0x5d77('0x23')])+_0x5d77('0x24')]=_0x2ad998['id']||null;_0x21f607[_['upperFirst'](_0x556eef[_0x5d77('0x23')])+_0x5d77('0x10')]=_0x556eef[_0x5d77('0x25')]?_0x556eef['interaction']['id']:null;_0x21f607[_[_0x5d77('0x22')](_0x556eef[_0x5d77('0x23')])+_0x5d77('0x26')]=_0x556eef[_0x5d77('0x27')]?_0x556eef[_0x5d77('0x27')]['id']:null;_0x21f607[_['upperFirst'](_0x556eef[_0x5d77('0x23')])+(_0x556eef[_0x5d77('0x23')]!==_0x5d77('0x28')?_0x5d77('0x29'):_0x5d77('0x2a'))]=_0x556eef[_0x5d77('0xc')]?_0x556eef['account']['id']:null;logger[_0x5d77('0x2b')](util[_0x5d77('0x11')](_0x5d77('0x2c'),_0x339ae1,_0x2ad998['name']));emitChannelQueueInteraction(_0x556eef['channel'],_0x2ad998[_0x5d77('0x2d')],_0x21f607,_0x556eef[_0x5d77('0xc')]['name'],_0x556eef[_0x5d77('0x27')]['id'],!![],_0x16167d,_0x2ad998['id']);if(rpc[_0x556eef['channel']+'QueueReport']){return rpc[_0x556eef[_0x5d77('0x23')]+'QueueReport'][_0x5d77('0x2e')](_0x21f607)[_0x5d77('0x2f')](function(_0x1cf4f8){logger[_0x5d77('0x30')](_0x5d77('0x31'),_0x1cf4f8);});}}}function stopRouting(_0x45bc2f,_0x459fc6,_0x236f91,_0x5b4f12){if(_0x45bc2f&&_0x459fc6){_0x459fc6[_0x5d77('0x1e')]-=0x1;var _0x4553bc={'leaveAt':moment()[_0x5d77('0x11')](_0x5d77('0x32')),'acceptAt':moment()[_0x5d77('0x11')](_0x5d77('0x32')),'reason':_0x5d77('0x33')};logger['info'](util[_0x5d77('0x11')](_0x5d77('0x34'),_0x45bc2f,_0x459fc6[_0x5d77('0x2d')]));emitChannelQueueInteraction(_0x236f91[_0x5d77('0x23')],_0x459fc6[_0x5d77('0x2d')],_0x236f91[_0x5d77('0x1f')],_0x236f91[_0x5d77('0xc')]['name'],_0x236f91[_0x5d77('0x27')]['id'],![],_0x5b4f12,_0x459fc6['id']);return rpc[_0x236f91[_0x5d77('0x23')]+_0x5d77('0x35')][_0x5d77('0x36')](_0x236f91[_0x5d77('0x25')]['id'],{'queueId':_0x459fc6['id']})[_0x5d77('0x37')](function(){if(rpc[_0x236f91['channel']+'QueueReport']){return rpc[_0x236f91[_0x5d77('0x23')]+'QueueReport'][_0x5d77('0x36')](_0x45bc2f,_0x4553bc)[_0x5d77('0x2f')](function(_0x3229c0){logger[_0x5d77('0x30')](_0x5d77('0x38'),_0x3229c0);});}});}}function endRouting(_0x341e36,_0x200cdb,_0x199027,_0x51fa8a){if(_0x341e36&&_0x200cdb){_0x200cdb[_0x5d77('0x1e')]-=0x1;var _0x1e0da0={'leaveAt':moment()[_0x5d77('0x11')](_0x5d77('0x32')),'exitAt':moment()[_0x5d77('0x11')](_0x5d77('0x32')),'reason':'timeout'};logger[_0x5d77('0x2b')](util[_0x5d77('0x11')](_0x5d77('0x39'),_0x341e36,_0x200cdb['name']));emitChannelQueueInteraction(_0x199027['channel'],_0x200cdb[_0x5d77('0x2d')],_0x199027[_0x5d77('0x1f')],_0x199027['account'][_0x5d77('0x2d')],_0x199027[_0x5d77('0x27')]['id'],![],_0x51fa8a);if(rpc[_0x199027['channel']+_0x5d77('0x3a')]){return rpc[_0x199027[_0x5d77('0x23')]+_0x5d77('0x3a')]['update'](_0x341e36,_0x1e0da0)['catch'](function(_0x4f22e1){logger[_0x5d77('0x30')](_0x5d77('0x38'),_0x4f22e1);});}}}function handleFindQueue(_0x264f5e){return function(_0x78d07c){return _0x78d07c[_0x5d77('0x2d')]['toLowerCase']()===_0x264f5e[_0x5d77('0x3b')]();};}exports[_0x5d77('0x3c')]=function(_0x5ed138,_0x27bea6,_0x2e1ae0,_0x550bce){return function(_0x30329f){try{var _0x2a4147={'name':_0x27bea6[0x0],'timeout':_0x27bea6[0x1]};var _0x2b6dab=queue['validate'](_0x2a4147,{'typecast':!![]});if(_0x2b6dab[_0x5d77('0x3d')]){logger[_0x5d77('0x30')](_0x5d77('0x3e'),_0x5ed138,_[_0x5d77('0x3f')](_0x2b6dab,'message')[_0x5d77('0x40')](',\x20'));_0x30329f[_0x5d77('0x41')]();}else{var _0x4df27b=_[_0x5d77('0x42')](_0x2e1ae0[_0x550bce['channel']+_0x5d77('0x43')],handleFindQueue(_0x2a4147[_0x5d77('0x2d')]));if(_0x4df27b){startRouting(_0x5ed138,_0x4df27b,_0x550bce,_0x2e1ae0);var _0x2e6b02=(_0x4df27b[_0x5d77('0x44')]||0xa)*0x3e8;var _0x236c4f=(_0x2a4147[_0x5d77('0x44')]||0x14)*0x3e8;var _0x26e065;if(_0x2e6b02>_0x236c4f){_0x236c4f=_0x2e6b02;}var _0x242713=seqqueue['createQueue'](_0x2e6b02);_0x242713['id']=_0x5ed138;_0x242713[_0x5d77('0x45')]=_0x2e6b02;_0x242713[_0x5d77('0x46')]=_0x236c4f;_0x242713[_0x5d77('0x23')]=_0x550bce[_0x5d77('0x23')];_0x2e1ae0['rules'][_0x5ed138]['on']('end',function(){logger[_0x5d77('0x2b')](_0x5d77('0x47'),_0x5ed138);stopRouting(_0x5ed138,_0x4df27b,_0x550bce,_0x2e1ae0);clearTimeout(_0x26e065);_0x26e065=undefined;_0x242713['close'](!![]);if(_0x2e1ae0[_0x5d77('0x48')][_0x5ed138]){delete _0x2e1ae0['rules'][_0x5ed138];}_0x30329f[_0x5d77('0x41')]();});_0x2e1ae0['rules'][_0x5ed138]['on'](_0x5d77('0x49'),function(){if(_0x2e1ae0[_0x5d77('0x48')][_0x5ed138]){delete _0x2e1ae0[_0x5d77('0x48')][_0x5ed138];}});_0x26e065=setTimeout(function(){logger[_0x5d77('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x5ed138);endRouting(_0x5ed138,_0x4df27b,_0x550bce,_0x2e1ae0);clearTimeout(_0x26e065);_0x242713['close'](!![]);_0x30329f[_0x5d77('0x4a')]();},_0x236c4f);switch(_0x4df27b[_0x5d77('0x4b')]){case'rrmemory':strategy[_0x5d77('0x4c')](_0x242713,_0x4df27b,_0x2e1ae0,_0x550bce);break;default:strategy[_0x5d77('0x4d')](_0x242713,_0x4df27b,_0x2e1ae0,_0x550bce);}}else{logger[_0x5d77('0x30')](_0x5d77('0x4e'),_0x5ed138,_0x2a4147[_0x5d77('0x2d')]);_0x30329f['stop']();}}}catch(_0x5493a1){logger[_0x5d77('0x30')](_0x5d77('0x3e'),_0x5ed138,_0x5493a1[_0x5d77('0x4f')]);_0x30329f[_0x5d77('0x41')]();}};}; \ No newline at end of file +var _0xa49b=['interaction','MessageId','message','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','join','find','Queues','timeout','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','account','queue','joinAt','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','QueueId'];(function(_0x5709ea,_0x5c0089){var _0x1998b4=function(_0x3bab6b){while(--_0x3bab6b){_0x5709ea['push'](_0x5709ea['shift']());}};_0x1998b4(++_0x5c0089);}(_0xa49b,0x126));var _0xba49=function(_0xa2e757,_0x50b583){_0xa2e757=_0xa2e757-0x0;var _0x49339e=_0xa49b[_0xa2e757];return _0x49339e;};'use strict';var schema=require('validate');var _=require(_0xba49('0x0'));var util=require(_0xba49('0x1'));var seqqueue=require(_0xba49('0x2'));var moment=require(_0xba49('0x3'));var Redis=require('ioredis');var config=require(_0xba49('0x4'));var logger=require(_0xba49('0x5'))(_0xba49('0x6'));var strategy=require('./strategy');config[_0xba49('0x7')]=_[_0xba49('0x8')](config[_0xba49('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xba49('0x9'))(new Redis(config['redis']));var attributes=['id',_0xba49('0xa'),_0xba49('0xb'),_0xba49('0xc'),'from',_0xba49('0xd')];function emit(_0x249dd6,_0x755387,_0x5251e4){io['to'](_0x249dd6)['emit'](_0x755387,_0x5251e4);}function emitChannelQueueInteraction(_0x27ec37,_0x1c26a0,_0x1e5a50,_0x4fa7b8,_0x5d0f30,_0x19d2f8,_0x5cff2f,_0x58b8bf){var _0x5249cd=_[_0xba49('0xe')](_0x1e5a50);_0x5249cd['queue_id']=_0x58b8bf;_0x5249cd['queue']=_0x1c26a0;_0x5249cd[_0xba49('0xb')]=_0x4fa7b8;_0x5249cd['id']=_0x5d0f30;if(_0x19d2f8){attributes[_0xba49('0xf')](_[_0xba49('0x10')](_0x27ec37)+_0xba49('0x11'));_0x5cff2f[util['format'](_0xba49('0x12'),_0x27ec37)][_0x5d0f30]=_[_0xba49('0x13')](_0x5249cd,attributes);}else{delete _0x5cff2f[util['format']('%sQueuesWaitingInteractions',_0x27ec37)][_0x5d0f30];}emit(util[_0xba49('0x14')](_0xba49('0x15'),_0x27ec37,_0x1c26a0),util[_0xba49('0x14')](_0xba49('0x16'),_0x27ec37,_0x19d2f8?'save':_0xba49('0x17')),_[_0xba49('0x13')](_0x5249cd,attributes));}var rpc={'openchannelQueueReport':require(_0xba49('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xba49('0x19')),'smsQueueReport':require(_0xba49('0x1a')),'faxQueueReport':require(_0xba49('0x1b')),'whatsappQueueReport':require(_0xba49('0x1c')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xba49('0x1d')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0xba49('0x1e')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0xba49('0x1f'))};var queue=schema({'name':{'type':_0xba49('0x20'),'required':!![],'message':_0xba49('0x21')},'timeout':{'type':_0xba49('0x22'),'message':_0xba49('0x23')}});function startRouting(_0x3369ee,_0x93c3f0,_0x331ec2,_0x2abc3b){if(_0x3369ee&&_0x93c3f0&&_0x331ec2){_0x93c3f0['waiting']+=0x1;var _0x4897b8={'uniqueid':_0x3369ee,'from':_0x331ec2[_0xba49('0x24')]?_0x331ec2[_0xba49('0x24')]['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x331ec2['contact']?_0x331ec2[_0xba49('0x25')]['id']:null,'ListId':_0x331ec2[_0xba49('0x26')]?_0x331ec2[_0xba49('0x26')]['id']:null};_0x4897b8[_[_0xba49('0x27')](_0x331ec2[_0xba49('0x28')])+_0xba49('0x29')]=_0x93c3f0['id']||null;_0x4897b8[_[_0xba49('0x27')](_0x331ec2[_0xba49('0x28')])+'InteractionId']=_0x331ec2[_0xba49('0x2a')]?_0x331ec2[_0xba49('0x2a')]['id']:null;_0x4897b8[_[_0xba49('0x27')](_0x331ec2['channel'])+_0xba49('0x2b')]=_0x331ec2[_0xba49('0x2c')]?_0x331ec2[_0xba49('0x2c')]['id']:null;_0x4897b8[_['upperFirst'](_0x331ec2[_0xba49('0x28')])+(_0x331ec2[_0xba49('0x28')]!=='chat'?_0xba49('0x2d'):_0xba49('0x2e'))]=_0x331ec2[_0xba49('0xb')]?_0x331ec2[_0xba49('0xb')]['id']:null;logger[_0xba49('0x2f')](util[_0xba49('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x3369ee,_0x93c3f0[_0xba49('0x30')]));emitChannelQueueInteraction(_0x331ec2['channel'],_0x93c3f0[_0xba49('0x30')],_0x4897b8,_0x331ec2[_0xba49('0xb')][_0xba49('0x30')],_0x331ec2['message']['id'],!![],_0x2abc3b,_0x93c3f0['id']);if(rpc[_0x331ec2[_0xba49('0x28')]+_0xba49('0x31')]){return rpc[_0x331ec2[_0xba49('0x28')]+'QueueReport'][_0xba49('0x32')](_0x4897b8)[_0xba49('0x33')](function(_0x590be8){logger[_0xba49('0x34')](_0xba49('0x35'),_0x590be8);});}}}function stopRouting(_0x1820c2,_0x5d18ef,_0x59581e,_0xdbfc5b){if(_0x1820c2&&_0x5d18ef){_0x5d18ef[_0xba49('0x36')]-=0x1;var _0x3f3578={'leaveAt':moment()[_0xba49('0x14')](_0xba49('0x37')),'acceptAt':moment()[_0xba49('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xba49('0x38')};logger[_0xba49('0x2f')](util['format'](_0xba49('0x39'),_0x1820c2,_0x5d18ef['name']));emitChannelQueueInteraction(_0x59581e['channel'],_0x5d18ef[_0xba49('0x30')],_0x59581e['body'],_0x59581e[_0xba49('0xb')][_0xba49('0x30')],_0x59581e[_0xba49('0x2c')]['id'],![],_0xdbfc5b,_0x5d18ef['id']);return rpc[_0x59581e[_0xba49('0x28')]+_0xba49('0x3a')][_0xba49('0x3b')](_0x59581e[_0xba49('0x2a')]['id'],{'queueId':_0x5d18ef['id']})[_0xba49('0x3c')](function(){if(rpc[_0x59581e[_0xba49('0x28')]+_0xba49('0x31')]){return rpc[_0x59581e['channel']+_0xba49('0x31')][_0xba49('0x3b')](_0x1820c2,_0x3f3578)[_0xba49('0x33')](function(_0x115168){logger[_0xba49('0x34')](_0xba49('0x3d'),_0x115168);});}});}}function endRouting(_0x1a438f,_0x4d23b8,_0x17eb82,_0x500fd2){if(_0x1a438f&&_0x4d23b8){_0x4d23b8[_0xba49('0x36')]-=0x1;var _0x532c40={'leaveAt':moment()['format'](_0xba49('0x37')),'exitAt':moment()[_0xba49('0x14')](_0xba49('0x37')),'reason':'timeout'};logger['info'](util['format'](_0xba49('0x3e'),_0x1a438f,_0x4d23b8['name']));emitChannelQueueInteraction(_0x17eb82[_0xba49('0x28')],_0x4d23b8[_0xba49('0x30')],_0x17eb82['body'],_0x17eb82[_0xba49('0xb')][_0xba49('0x30')],_0x17eb82[_0xba49('0x2c')]['id'],![],_0x500fd2);if(rpc[_0x17eb82[_0xba49('0x28')]+_0xba49('0x31')]){return rpc[_0x17eb82[_0xba49('0x28')]+'QueueReport']['update'](_0x1a438f,_0x532c40)[_0xba49('0x33')](function(_0x265c3c){logger[_0xba49('0x34')](_0xba49('0x3d'),_0x265c3c);});}}}function handleFindQueue(_0x3c2a61){return function(_0x29d04a){return _0x29d04a[_0xba49('0x30')][_0xba49('0x3f')]()===_0x3c2a61[_0xba49('0x3f')]();};}exports[_0xba49('0x40')]=function(_0x45979b,_0x3d953e,_0x349302,_0x40d35a){return function(_0x4d1eb2){try{var _0x352c35={'name':_0x3d953e[0x0],'timeout':_0x3d953e[0x1]};var _0x3387fd=queue[_0xba49('0x41')](_0x352c35,{'typecast':!![]});if(_0x3387fd['length']){logger[_0xba49('0x34')](_0xba49('0x42'),_0x45979b,_['map'](_0x3387fd,'message')[_0xba49('0x43')](',\x20'));_0x4d1eb2['stop']();}else{var _0x2688ca=_[_0xba49('0x44')](_0x349302[_0x40d35a[_0xba49('0x28')]+_0xba49('0x45')],handleFindQueue(_0x352c35[_0xba49('0x30')]));if(_0x2688ca){startRouting(_0x45979b,_0x2688ca,_0x40d35a,_0x349302);var _0x759b1c=(_0x2688ca['timeout']||0xa)*0x3e8;var _0x2b909c=(_0x352c35[_0xba49('0x46')]||0x14)*0x3e8;var _0x173aa1;if(_0x759b1c>_0x2b909c){_0x2b909c=_0x759b1c;}var _0x1bd13b=seqqueue['createQueue'](_0x759b1c);_0x1bd13b['id']=_0x45979b;_0x1bd13b[_0xba49('0x47')]=_0x759b1c;_0x1bd13b[_0xba49('0x48')]=_0x2b909c;_0x1bd13b[_0xba49('0x28')]=_0x40d35a['channel'];_0x349302['rules'][_0x45979b]['on'](_0xba49('0x49'),function(){logger[_0xba49('0x2f')](_0xba49('0x4a'),_0x45979b);stopRouting(_0x45979b,_0x2688ca,_0x40d35a,_0x349302);clearTimeout(_0x173aa1);_0x173aa1=undefined;_0x1bd13b['close'](!![]);if(_0x349302[_0xba49('0x4b')][_0x45979b]){delete _0x349302[_0xba49('0x4b')][_0x45979b];}_0x4d1eb2[_0xba49('0x4c')]();});_0x349302['rules'][_0x45979b]['on'](_0xba49('0x4d'),function(){if(_0x349302[_0xba49('0x4b')][_0x45979b]){delete _0x349302[_0xba49('0x4b')][_0x45979b];}});_0x173aa1=setTimeout(function(){logger[_0xba49('0x2f')](_0xba49('0x4e'),_0x45979b);endRouting(_0x45979b,_0x2688ca,_0x40d35a,_0x349302);clearTimeout(_0x173aa1);_0x1bd13b[_0xba49('0x4f')](!![]);_0x4d1eb2['next']();},_0x2b909c);switch(_0x2688ca['strategy']){case'rrmemory':strategy[_0xba49('0x50')](_0x1bd13b,_0x2688ca,_0x349302,_0x40d35a);break;default:strategy[_0xba49('0x51')](_0x1bd13b,_0x2688ca,_0x349302,_0x40d35a);}}else{logger['error'](_0xba49('0x52'),_0x45979b,_0x352c35[_0xba49('0x30')]);_0x4d1eb2[_0xba49('0x4c')]();}}}catch(_0x23534f){logger['error'](_0xba49('0x42'),_0x45979b,_0x23534f[_0xba49('0x53')]);_0x4d1eb2['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 bb90189..27072e9 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 _0x34e5=['saveWaitingNotification','channel','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','handleTimeout','handleDrained','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e5,0x172));var _0x534e=function(_0x1bd2d7,_0x216a20){_0x1bd2d7=_0x1bd2d7-0x0;var _0x285a33=_0x34e5[_0x1bd2d7];return _0x285a33;};'use strict';var _=require('lodash');var uuid=require(_0x534e('0x0'));var util=require('./util');var logger=require(_0x534e('0x1'))(_0x534e('0x2'));var Agent=function(_0x425ae8,_0x246650,_0x83eb2d,_0x50b790){this[_0x534e('0x3')]=uuid['v4']();this[_0x534e('0x4')]=_0x425ae8;this[_0x534e('0x5')]=_0x246650;this[_0x534e('0x6')]=_0x83eb2d;this[_0x534e('0x2')]=_0x50b790;this[_0x534e('0x4')][_0x534e('0x7')](this['handleRun'][_0x534e('0x8')](this),this[_0x534e('0x9')][_0x534e('0x8')](this));this['squeue']['on']('timeout',this[_0x534e('0x9')]['bind'](this));this[_0x534e('0x4')]['on']('drained',this[_0x534e('0xa')][_0x534e('0x8')](this));};Agent[_0x534e('0xb')]['push']=function(){this[_0x534e('0x4')][_0x534e('0x7')](this[_0x534e('0xc')][_0x534e('0x8')](this),this[_0x534e('0x9')]['bind'](this));};Agent[_0x534e('0xb')][_0x534e('0xa')]=function(){this[_0x534e('0x9')](!![]);};Agent[_0x534e('0xb')][_0x534e('0xc')]=function(){logger[_0x534e('0xd')](_0x534e('0xe'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);if(_['isNil'](this[_0x534e('0x6')][_0x534e('0xf')][this['agent']['id']])){logger['debug'](_0x534e('0x10'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);setTimeout(this[_0x534e('0x7')][_0x534e('0x8')](this),0x3e8);}else{if(this[_0x534e('0x2')][_0x534e('0x11')]||util['isAgentAvailable'](this[_0x534e('0x4')]['id'],this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']],this[_0x534e('0x4')]['channel'],![])){this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']][_0x534e('0x12')]=!![];this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']][_0x534e('0x13')]=undefined;util[_0x534e('0x14')](this['realtime'],this[_0x534e('0x2')],this[_0x534e('0x5')],this[_0x534e('0x4')][_0x534e('0x15')]);util[_0x534e('0x16')](this[_0x534e('0x3')],this[_0x534e('0x4')]['id'],this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']],null,this['routing']);util[_0x534e('0x17')](this[_0x534e('0x4')]['id'],this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']],'RINGING'+(this[_0x534e('0x2')][_0x534e('0x11')]?':FORCED':''));}else{logger['debug'](_0x534e('0x18'),this['squeue']['id'],this[_0x534e('0x5')]['id']);setTimeout(this[_0x534e('0x7')][_0x534e('0x8')](this),0x3e8);}}};Agent[_0x534e('0xb')][_0x534e('0x9')]=function(_0x42119b){if(_[_0x534e('0x19')](this['realtime']['agents'][this[_0x534e('0x5')]['id']])){return logger[_0x534e('0xd')](_0x534e('0x10'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);}else{logger[_0x534e('0xd')](_0x534e('0x1a'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);util[_0x534e('0x1b')](this[_0x534e('0x3')],this[_0x534e('0x4')]['id'],this['realtime'][_0x534e('0xf')][this[_0x534e('0x5')]['id']],null,this['routing']);this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']][_0x534e('0x12')]=![];this[_0x534e('0x6')][_0x534e('0xf')][this['agent']['id']][_0x534e('0x13')]=undefined;util[_0x534e('0x1c')](this['realtime'],this['routing'],this[_0x534e('0x5')],this[_0x534e('0x4')][_0x534e('0x15')]);util[_0x534e('0x17')](this['squeue']['id'],this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']],_0x42119b?'STOP':_0x534e('0x1d'));}if(!_0x42119b){setTimeout(this[_0x534e('0x7')]['bind'](this),0x3e8);}};function agent(_0x2f5cd1,_0x5c34a7,_0x593fb0,_0x519b40){return new Agent(_0x2f5cd1,_0x5c34a7,_0x593fb0,_0x519b40);}module['exports']=agent; \ No newline at end of file +var _0xee14=['RINGING',':FORCED','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','TIMEOUT','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog'];(function(_0x29dcf9,_0x1c4ecb){var _0x836250=function(_0x4ae913){while(--_0x4ae913){_0x29dcf9['push'](_0x29dcf9['shift']());}};_0x836250(++_0x1c4ecb);}(_0xee14,0x13a));var _0x4ee1=function(_0x586e1b,_0x2b0541){_0x586e1b=_0x586e1b-0x0;var _0x4f50f0=_0xee14[_0x586e1b];return _0x4f50f0;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x4ee1('0x0'));var logger=require(_0x4ee1('0x1'))(_0x4ee1('0x2'));var Agent=function(_0x1fa407,_0x18e3c4,_0x236ccd,_0x34a0ae){this[_0x4ee1('0x3')]=uuid['v4']();this[_0x4ee1('0x4')]=_0x1fa407;this['agent']=_0x18e3c4;this[_0x4ee1('0x5')]=_0x236ccd;this['routing']=_0x34a0ae;this[_0x4ee1('0x4')][_0x4ee1('0x6')](this[_0x4ee1('0x7')][_0x4ee1('0x8')](this),this[_0x4ee1('0x9')][_0x4ee1('0x8')](this));this['squeue']['on'](_0x4ee1('0xa'),this[_0x4ee1('0x9')]['bind'](this));this[_0x4ee1('0x4')]['on'](_0x4ee1('0xb'),this[_0x4ee1('0xc')][_0x4ee1('0x8')](this));};Agent['prototype'][_0x4ee1('0x6')]=function(){this[_0x4ee1('0x4')][_0x4ee1('0x6')](this[_0x4ee1('0x7')][_0x4ee1('0x8')](this),this[_0x4ee1('0x9')]['bind'](this));};Agent[_0x4ee1('0xd')][_0x4ee1('0xc')]=function(){this[_0x4ee1('0x9')](!![]);};Agent[_0x4ee1('0xd')][_0x4ee1('0x7')]=function(){logger[_0x4ee1('0xe')](_0x4ee1('0xf'),this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x10')]['id']);if(_['isNil'](this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']])){logger[_0x4ee1('0xe')](_0x4ee1('0x12'),this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x10')]['id']);setTimeout(this[_0x4ee1('0x6')][_0x4ee1('0x8')](this),0x3e8);}else{if(this[_0x4ee1('0x2')][_0x4ee1('0x13')]||util['isAgentAvailable'](this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']],this[_0x4ee1('0x4')][_0x4ee1('0x14')],![])){this['realtime'][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']][_0x4ee1('0x15')]=!![];this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']][_0x4ee1('0x16')]=undefined;util[_0x4ee1('0x17')](this[_0x4ee1('0x5')],this[_0x4ee1('0x2')],this['agent'],this['squeue'][_0x4ee1('0x14')]);util[_0x4ee1('0x18')](this[_0x4ee1('0x3')],this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')][_0x4ee1('0x11')][this['agent']['id']],null,this['routing']);util[_0x4ee1('0x19')](this[_0x4ee1('0x4')]['id'],this['realtime'][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']],_0x4ee1('0x1a')+(this[_0x4ee1('0x2')][_0x4ee1('0x13')]?_0x4ee1('0x1b'):''));}else{logger[_0x4ee1('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x4ee1('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x4ee1('0x6')]['bind'](this),0x3e8);}}};Agent[_0x4ee1('0xd')][_0x4ee1('0x9')]=function(_0x59a34e){if(_[_0x4ee1('0x1c')](this[_0x4ee1('0x5')]['agents'][this[_0x4ee1('0x10')]['id']])){return logger['debug'](_0x4ee1('0x12'),this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x10')]['id']);}else{logger[_0x4ee1('0xe')](_0x4ee1('0x1d'),this['squeue']['id'],this[_0x4ee1('0x10')]['id']);util[_0x4ee1('0x1e')](this[_0x4ee1('0x3')],this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')][_0x4ee1('0x11')][this['agent']['id']],null,this['routing']);this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']]['busy']=![];this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']][_0x4ee1('0x16')]=undefined;util[_0x4ee1('0x1f')](this[_0x4ee1('0x5')],this[_0x4ee1('0x2')],this[_0x4ee1('0x10')],this[_0x4ee1('0x4')][_0x4ee1('0x14')]);util[_0x4ee1('0x19')](this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')]['agents'][this[_0x4ee1('0x10')]['id']],_0x59a34e?_0x4ee1('0x20'):_0x4ee1('0x21'));}if(!_0x59a34e){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x257f67,_0x84480e,_0x74e6e2,_0x1f2b4b){return new Agent(_0x257f67,_0x84480e,_0x74e6e2,_0x1f2b4b);}module['exports']=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 877a149..dfb7095 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 _0x3269=['RINGING','busyQueue','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20EMPTY','STOP','lodash','uuid','./util','routing','notificationId','realtime','push','bind','handleTimeout','squeue','timeout','prototype','handleDrained','isNil','queue','Agents','length','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','agents'];(function(_0x421231,_0x318b72){var _0x297780=function(_0xb0c9f0){while(--_0xb0c9f0){_0x421231['push'](_0x421231['shift']());}};_0x297780(++_0x318b72);}(_0x3269,0x133));var _0x9326=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3269[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9326('0x0'));var uuid=require(_0x9326('0x1'));var util=require(_0x9326('0x2'));var logger=require('../../../../../config/logger')(_0x9326('0x3'));var Beepall=function(_0x4dc7b5,_0x2cf027,_0x5df7a6,_0x23ec54){this[_0x9326('0x4')]=uuid['v4']();this['squeue']=_0x4dc7b5;this['queue']=_0x2cf027;this[_0x9326('0x5')]=_0x5df7a6;this['routing']=_0x23ec54;this['squeue'][_0x9326('0x6')](this['handleRun'][_0x9326('0x7')](this),this[_0x9326('0x8')]['bind'](this));this[_0x9326('0x9')]['on'](_0x9326('0xa'),this[_0x9326('0x8')][_0x9326('0x7')](this));this[_0x9326('0x9')]['on']('drained',this['handleDrained']['bind'](this));};Beepall[_0x9326('0xb')][_0x9326('0x6')]=function(){this['squeue'][_0x9326('0x6')](this['handleRun']['bind'](this),this[_0x9326('0x8')][_0x9326('0x7')](this));};Beepall[_0x9326('0xb')][_0x9326('0xc')]=function(){this[_0x9326('0x8')](!![]);};Beepall[_0x9326('0xb')]['handleRun']=function(){var _0x2fc857=!![];if(!_[_0x9326('0xd')](this['queue'])&&!_[_0x9326('0xd')](this[_0x9326('0xe')][_0x9326('0xf')])&&this[_0x9326('0xe')][_0x9326('0xf')][_0x9326('0x10')]>0x0){for(var _0x501db4=0x0,_0x58aeae;_0x501db40x0){for(var _0x51c9e1=0x0,_0x48a5ef;_0x51c9e10x0&&_0x68c78[_0x2069a0+'CurrentCapacity']>=_0x68c78[_0x2069a0+_0x60e5('0x25')]){writeLog(_0x3478c6,_0x68c78,_0x2069a0['toUpperCase']()+_0x60e5('0x26'));return![];}}return!![];};exports[_0x60e5('0x27')]=function(_0x476d0a,_0xa62ebd,_0xbf8332,_0x59e702,_0x1b23bc){return sendNotification(!![],_0x476d0a,_0xa62ebd,_0xbf8332,_0x59e702,_0x1b23bc);};exports['hideNotification']=function(_0xd13043,_0x661169,_0x95fe05,_0x59d16f,_0xefae42){return sendNotification(![],_0xd13043,_0x661169,_0x95fe05,_0x59d16f,_0xefae42);};exports[_0x60e5('0x28')]=function(_0x5ed766,_0x1f9ba5,_0xd10ec1){var _0x46ebed=_0x1f9ba5['interaction'][_0x60e5('0x29')];if(!_0x46ebed&&_0xd10ec1){_0x46ebed=_0xd10ec1['id'];}var _0x123ea7=_[_0x60e5('0x2a')](_0x5ed766[_0x1f9ba5[_0x60e5('0x2b')]+_0x60e5('0x2c')],function(_0x40ce94){var _0x311485=_[_0x60e5('0x2d')](_0x1f9ba5[_0x60e5('0x2b')])+_0x60e5('0x2e');return _0x40ce94[_0x311485]===_0x1f9ba5[_0x60e5('0x2f')]['id'];});if(!_0x123ea7&&_0x46ebed&&_0x5ed766[_0x60e5('0x30')][_0x46ebed]){_0x123ea7=_['some'](_0x5ed766[_0x60e5('0x30')][_0x46ebed][_0x1f9ba5[_0x60e5('0x2b')]+_0x60e5('0x31')],function(_0x413ff5){return _0x413ff5['id']===_0x1f9ba5['interaction']['id'];});}return _0x123ea7;};exports['saveWaitingNotification']=function(_0x4aa55f,_0x1663b4,_0x2e2961,_0x20d8b7){if(_0x2e2961&&_0x2e2961['id']&&_0x4aa55f[_0x60e5('0x30')]&&_0x4aa55f[_0x60e5('0x30')][_0x2e2961['id']]){_0x4aa55f['agents'][_0x2e2961['id']][_0x20d8b7+_0x60e5('0x31')][_0x1663b4[_0x60e5('0x16')]['id']]={'id':_0x1663b4[_0x60e5('0x2f')]['id']};}};exports[_0x60e5('0x32')]=function(_0x5d8fce,_0x53b686,_0x43c8ed,_0x57f81c){if(_0x43c8ed&&_0x43c8ed['id']&&_0x5d8fce[_0x60e5('0x30')]&&_0x5d8fce[_0x60e5('0x30')][_0x43c8ed['id']]){delete _0x5d8fce[_0x60e5('0x30')][_0x43c8ed['id']][_0x57f81c+_0x60e5('0x31')][_0x53b686['message']['id']];}};exports[_0x60e5('0x33')]=writeLog; \ No newline at end of file +var _0x5ea2=['checkWaitingNotifications','UserId','channel','QueuesWaitingInteractions','InteractionId','agents','some','WaitingInteractions','interaction','message','removeWaitingNotification','writeLog','lodash','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','\x20interaction','name','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','format','[%s][QUEUE]\x20%s','user:%s','emit','notification:%s','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','showNotification','hideNotification'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5ea2,0x99));var _0x25ea=function(_0xc19ba6,_0x4788d3){_0xc19ba6=_0xc19ba6-0x0;var _0x253883=_0x5ea2[_0xc19ba6];return _0x253883;};'use strict';var _=require(_0x25ea('0x0'));var util=require('util');var utils=require('../utils');var Redis=require(_0x25ea('0x1'));var config=require(_0x25ea('0x2'));var logger=require(_0x25ea('0x3'))(_0x25ea('0x4'));config[_0x25ea('0x5')]=_['defaults'](config[_0x25ea('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x25ea('0x5')]));function sendNotification(_0x310a27,_0x3ca48f,_0x214ed8,_0x274f48,_0x254d54,_0x1c5b5d){var _0x2b4c7b=_0x1c5b5d||{};var _0x10fc57=_0x214ed8['split']('.');var _0x4389cd={'uniqueid':_0x3ca48f,'channel':_0x10fc57[0x0],'id':_0x10fc57[0x1],'title':_0x10fc57[0x0]+_0x25ea('0x6'),'interactionId':_0x10fc57[0x2],'queue':_0x254d54?_0x254d54[_0x25ea('0x7')]:null,'sound':_0x2b4c7b[_0x25ea('0x8')]['notificationSound'],'shake':_0x2b4c7b[_0x25ea('0x8')][_0x25ea('0x9')]};try{if(!_0x2b4c7b[_0x25ea('0xa')]){_0x2b4c7b[_0x25ea('0xa')]={};}if(_0x254d54){_0x2b4c7b[_0x25ea('0xa')][_0x25ea('0xb')]=_0x254d54;}else if(_0x2b4c7b['body']['queue']){delete _0x2b4c7b[_0x25ea('0xa')][_0x25ea('0xb')];}_0x4389cd['msg']=utils[_0x25ea('0xc')](_0x2b4c7b[_0x25ea('0x8')][_0x25ea('0xd')],_0x2b4c7b);}catch(_0x190d5a){_0x4389cd[_0x25ea('0xe')]=_0x25ea('0xf');logger['error'](util[_0x25ea('0x10')](_0x25ea('0x11'),_0x3ca48f,_0x190d5a['message']));}io['to'](util[_0x25ea('0x10')](_0x25ea('0x12'),_0x274f48[_0x25ea('0x7')]))[_0x25ea('0x13')](util[_0x25ea('0x10')](_0x25ea('0x14'),_0x310a27?'save':_0x25ea('0x15')),_0x4389cd);}function writeLog(_0x454b8e,_0x3b327e,_0x8d12b0){return logger[_0x25ea('0x16')](util[_0x25ea('0x10')](_0x25ea('0x17'),_0x454b8e,_0x3b327e['name'],_0x8d12b0));}exports[_0x25ea('0x18')]=function(_0x133343,_0x5578fe,_0x13884d,_0x58d927){if(_0x5578fe['busy']){writeLog(_0x133343,_0x5578fe,_0x25ea('0x19'));return![];}if(!_0x5578fe['online']){writeLog(_0x133343,_0x5578fe,_0x25ea('0x1a'));return![];}if(_0x5578fe[_0x13884d+_0x25ea('0x1b')]){writeLog(_0x133343,_0x5578fe,_0x25ea('0x1c'));return![];}if(_0x58d927&&_0x5578fe[_0x25ea('0x1d')](_0x13884d+'Capacity')&&_0x5578fe[_0x25ea('0x1d')](_0x13884d+_0x25ea('0x1e'))){if(_0x5578fe[_0x13884d+_0x25ea('0x1f')]>0x0&&_0x5578fe[_0x13884d+'CurrentCapacity']>=_0x5578fe[_0x13884d+_0x25ea('0x1f')]){writeLog(_0x133343,_0x5578fe,_0x13884d[_0x25ea('0x20')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x25ea('0x21')]=function(_0x2b5351,_0x5b9780,_0x260e8a,_0x104361,_0x2fe961){return sendNotification(!![],_0x2b5351,_0x5b9780,_0x260e8a,_0x104361,_0x2fe961);};exports[_0x25ea('0x22')]=function(_0x20c65b,_0xe63b85,_0x390c7b,_0x41e2a0,_0x12e061){return sendNotification(![],_0x20c65b,_0xe63b85,_0x390c7b,_0x41e2a0,_0x12e061);};exports[_0x25ea('0x23')]=function(_0x166cf5,_0x3e2a3e,_0x46520a){var _0x55020d=_0x3e2a3e['interaction'][_0x25ea('0x24')];if(!_0x55020d&&_0x46520a){_0x55020d=_0x46520a['id'];}var _0x21c4fc=_['some'](_0x166cf5[_0x3e2a3e[_0x25ea('0x25')]+_0x25ea('0x26')],function(_0x4171bf){var _0x5e47a8=_['capitalize'](_0x3e2a3e[_0x25ea('0x25')])+_0x25ea('0x27');return _0x4171bf[_0x5e47a8]===_0x3e2a3e['interaction']['id'];});if(!_0x21c4fc&&_0x55020d&&_0x166cf5[_0x25ea('0x28')][_0x55020d]){_0x21c4fc=_[_0x25ea('0x29')](_0x166cf5['agents'][_0x55020d][_0x3e2a3e[_0x25ea('0x25')]+_0x25ea('0x2a')],function(_0x3a852e){return _0x3a852e['id']===_0x3e2a3e[_0x25ea('0x2b')]['id'];});}return _0x21c4fc;};exports['saveWaitingNotification']=function(_0x10bf23,_0x5b6527,_0x2dde3a,_0x21b9ee){if(_0x2dde3a&&_0x2dde3a['id']&&_0x10bf23[_0x25ea('0x28')]&&_0x10bf23[_0x25ea('0x28')][_0x2dde3a['id']]){_0x10bf23['agents'][_0x2dde3a['id']][_0x21b9ee+'WaitingInteractions'][_0x5b6527[_0x25ea('0x2c')]['id']]={'id':_0x5b6527['interaction']['id']};}};exports[_0x25ea('0x2d')]=function(_0x6bc231,_0x47a447,_0x43367f,_0x57bfc4){if(_0x43367f&&_0x43367f['id']&&_0x6bc231['agents']&&_0x6bc231[_0x25ea('0x28')][_0x43367f['id']]){delete _0x6bc231[_0x25ea('0x28')][_0x43367f['id']][_0x57bfc4+_0x25ea('0x2a')][_0x47a447[_0x25ea('0x2c')]['id']];}};exports[_0x25ea('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 9993439..0c1911f 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 _0xa366=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','next','shelljs','lodash','./utils','../../../../config/logger','routing','string'];(function(_0x413ab1,_0x451632){var _0x42751e=function(_0x5b5071){while(--_0x5b5071){_0x413ab1['push'](_0x413ab1['shift']());}};_0x42751e(++_0x451632);}(_0xa366,0x118));var _0x6a36=function(_0x5982d2,_0x281a67){_0x5982d2=_0x5982d2-0x0;var _0x13b748=_0xa366[_0x5982d2];return _0x13b748;};'use strict';var schema=require('validate');var sh=require(_0x6a36('0x0'));var _=require(_0x6a36('0x1'));var utils=require(_0x6a36('0x2'));var logger=require(_0x6a36('0x3'))(_0x6a36('0x4'));var system=schema({'command':{'type':_0x6a36('0x5'),'required':!![],'message':_0x6a36('0x6')}});exports['consequence']=function(_0x1800c4,_0x1fe160){return function(_0x1b9e46){try{var _0xcf3385={'command':_0x1fe160[0x0]};var _0x1164ac=system[_0x6a36('0x7')](_0xcf3385,{'typecast':!![]});if(_0x1164ac[_0x6a36('0x8')]){logger[_0x6a36('0x9')](_0x6a36('0xa'),_0x1800c4,_[_0x6a36('0xb')](_0x1164ac,_0x6a36('0xc'))['join'](',\x20'));logger[_0x6a36('0xd')](_0x6a36('0xe'),_0x1800c4);_0x1b9e46['next']();}else{var _0x3d8890=this;var _0x568155=utils[_0x6a36('0xf')](_0x1fe160[0x0],this);logger[_0x6a36('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x1800c4,_0x568155);sh[_0x6a36('0x10')](_[_0x6a36('0x11')](_0x568155),function(_0x12234f,_0x2da6b9){logger[_0x6a36('0xd')](_0x6a36('0x12'),_0x1800c4,_0x12234f);if(_0x12234f==0x0){var _0x52ad84=_0x2da6b9[_0x6a36('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1fe160[0x1])||_[_0x6a36('0x14')](_0x1fe160[0x1])){logger['info'](_0x6a36('0x15'),_0x1800c4);_0x3d8890[_0x6a36('0x16')][_0x1fe160[0x1]]=_0x52ad84;}else{logger[_0x6a36('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x1800c4,_0x1fe160[0x1],_0x52ad84);_0x3d8890[_0x6a36('0x16')][_0x1fe160[0x1]]=_0x52ad84;}}_0x1b9e46['next']();});}}catch(_0x1afeb4){logger[_0x6a36('0x9')](_0x6a36('0xa'),_0x1800c4,_[_0x6a36('0x17')](_0x1afeb4)?JSON[_0x6a36('0x18')](_0x1afeb4):_0x1afeb4);logger[_0x6a36('0xd')](_0x6a36('0xe'),_0x1800c4);_0x1b9e46[_0x6a36('0x19')]();}};}; \ No newline at end of file +var _0xc47c=['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','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][SYSTEM]\x20%s','map','message','join'];(function(_0xc053e6,_0x2f6c77){var _0x7118cb=function(_0xe30ce5){while(--_0xe30ce5){_0xc053e6['push'](_0xc053e6['shift']());}};_0x7118cb(++_0x2f6c77);}(_0xc47c,0xe0));var _0xcc47=function(_0x1f10f8,_0x3df17e){_0x1f10f8=_0x1f10f8-0x0;var _0xdc191f=_0xc47c[_0x1f10f8];return _0xdc191f;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require('./utils');var logger=require(_0xcc47('0x0'))('routing');var system=schema({'command':{'type':_0xcc47('0x1'),'required':!![],'message':_0xcc47('0x2')}});exports[_0xcc47('0x3')]=function(_0x35d7bc,_0x3eeefa){return function(_0xd75e5e){try{var _0x462acf={'command':_0x3eeefa[0x0]};var _0x5e52b0=system[_0xcc47('0x4')](_0x462acf,{'typecast':!![]});if(_0x5e52b0[_0xcc47('0x5')]){logger['error'](_0xcc47('0x6'),_0x35d7bc,_[_0xcc47('0x7')](_0x5e52b0,_0xcc47('0x8'))[_0xcc47('0x9')](',\x20'));logger[_0xcc47('0xa')](_0xcc47('0xb'),_0x35d7bc);_0xd75e5e['next']();}else{var _0x1b7c43=this;var _0x36ebc2=utils[_0xcc47('0xc')](_0x3eeefa[0x0],this);logger[_0xcc47('0xa')](_0xcc47('0xd'),_0x35d7bc,_0x36ebc2);sh[_0xcc47('0xe')](_[_0xcc47('0xf')](_0x36ebc2),function(_0x59d86b,_0x52cfd2){logger[_0xcc47('0xa')](_0xcc47('0x10'),_0x35d7bc,_0x59d86b);if(_0x59d86b==0x0){var _0x59e49e=_0x52cfd2[_0xcc47('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xcc47('0x12')](_0x3eeefa[0x1])||_[_0xcc47('0x13')](_0x3eeefa[0x1])){logger[_0xcc47('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x35d7bc);_0x1b7c43[_0xcc47('0x14')][_0x3eeefa[0x1]]=_0x59e49e;}else{logger['info'](_0xcc47('0x15'),_0x35d7bc,_0x3eeefa[0x1],_0x59e49e);_0x1b7c43[_0xcc47('0x14')][_0x3eeefa[0x1]]=_0x59e49e;}}_0xd75e5e[_0xcc47('0x16')]();});}}catch(_0x43c3dc){logger[_0xcc47('0x17')]('[%s][SYSTEM]\x20%s',_0x35d7bc,_[_0xcc47('0x18')](_0x43c3dc)?JSON[_0xcc47('0x19')](_0x43c3dc):_0x43c3dc);logger[_0xcc47('0xa')](_0xcc47('0xb'),_0x35d7bc);_0xd75e5e['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 557da8b..ae2b140 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 _0x6dc1=['validate','lodash','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','next','isObject','info'];(function(_0x4706ce,_0x3866c9){var _0x105b02=function(_0x103fb6){while(--_0x103fb6){_0x4706ce['push'](_0x4706ce['shift']());}};_0x105b02(++_0x3866c9);}(_0x6dc1,0x12c));var _0x16dc=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x6dc1[_0x1d24eb];return _0x1dc576;};'use strict';var schema=require(_0x16dc('0x0'));var _=require(_0x16dc('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x16dc('0x2')),'faxInteraction':require(_0x16dc('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x16dc('0x4'))(_0x16dc('0x5'));var tag=schema({'tag':{'type':_0x16dc('0x6'),'required':!![],'message':_0x16dc('0x7')}});exports['consequence']=function(_0x9e6bbd,_0x3ed453,_0x4e45d1,_0x2419d6){return function(_0x16a164){try{var _0x85b9ac={'tag':_0x3ed453[0x0]};var _0x1d4401=tag[_0x16dc('0x0')](_0x85b9ac,{'typecast':!![]});if(_0x1d4401[_0x16dc('0x8')]){logger[_0x16dc('0x9')](_0x16dc('0xa'),_0x9e6bbd,_[_0x16dc('0xb')](_0x1d4401,_0x16dc('0xc'))['join'](',\x20'));logger['info'](_0x16dc('0xd'),_0x9e6bbd);_0x16a164['next']();}else{var _0x4e8102={'ids':[_0x3ed453[0x0]]};if(rpc[_0x2419d6[_0x16dc('0xe')]+_0x16dc('0xf')]){rpc[_0x2419d6[_0x16dc('0xe')]+_0x16dc('0xf')][_0x16dc('0x10')](_0x2419d6[_0x16dc('0x11')]['id'],_0x4e8102)[_0x16dc('0x12')](function(_0x1a9642){logger['info'](_0x16dc('0x13'),_0x9e6bbd,_0x3ed453[0x1],_0x2419d6[_0x16dc('0xe')],_0x2419d6[_0x16dc('0x11')]['id']);})['catch'](function(_0x584b5f){logger[_0x16dc('0x9')](_0x16dc('0xa'),_0x9e6bbd,JSON[_0x16dc('0x14')](_0x584b5f));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x9e6bbd);})[_0x16dc('0x15')](function(){_0x16a164[_0x16dc('0x16')]();});}}}catch(_0x999e3c){logger[_0x16dc('0x9')](_0x16dc('0xa'),_0x9e6bbd,_[_0x16dc('0x17')](_0x999e3c)?JSON['stringify'](_0x999e3c):_0x999e3c);logger[_0x16dc('0x18')](_0x16dc('0xd'),_0x9e6bbd);_0x16a164[_0x16dc('0x16')]();}};}; \ No newline at end of file +var _0x384f=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','info','next','Interaction','channel','addTags','interaction','then','error','stringify','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x384f,0x95));var _0xf384=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x384f[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xf384('0x0'));var _=require(_0xf384('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf384('0x2')),'smsInteraction':require(_0xf384('0x3')),'mailInteraction':require(_0xf384('0x4')),'faxInteraction':require(_0xf384('0x5')),'whatsappInteraction':require(_0xf384('0x6'))};var logger=require('../../../../config/logger')(_0xf384('0x7'));var tag=schema({'tag':{'type':_0xf384('0x8'),'required':!![],'message':_0xf384('0x9')}});exports[_0xf384('0xa')]=function(_0xb09c4c,_0x1712a7,_0x1a0e71,_0x42d0b1){return function(_0x3e8d7b){try{var _0xb3129={'tag':_0x1712a7[0x0]};var _0x493e59=tag[_0xf384('0x0')](_0xb3129,{'typecast':!![]});if(_0x493e59[_0xf384('0xb')]){logger['error'](_0xf384('0xc'),_0xb09c4c,_[_0xf384('0xd')](_0x493e59,_0xf384('0xe'))['join'](',\x20'));logger[_0xf384('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xb09c4c);_0x3e8d7b[_0xf384('0x10')]();}else{var _0x3f4494={'ids':[_0x1712a7[0x0]]};if(rpc[_0x42d0b1['channel']+_0xf384('0x11')]){rpc[_0x42d0b1[_0xf384('0x12')]+_0xf384('0x11')][_0xf384('0x13')](_0x42d0b1[_0xf384('0x14')]['id'],_0x3f4494)[_0xf384('0x15')](function(_0x198d79){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0xb09c4c,_0x1712a7[0x1],_0x42d0b1[_0xf384('0x12')],_0x42d0b1[_0xf384('0x14')]['id']);})['catch'](function(_0x2214ae){logger[_0xf384('0x16')](_0xf384('0xc'),_0xb09c4c,JSON[_0xf384('0x17')](_0x2214ae));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xb09c4c);})['finally'](function(){_0x3e8d7b['next']();});}}}catch(_0x35736a){logger[_0xf384('0x16')](_0xf384('0xc'),_0xb09c4c,_[_0xf384('0x18')](_0x35736a)?JSON[_0xf384('0x17')](_0x35736a):_0x35736a);logger[_0xf384('0xf')](_0xf384('0x19'),_0xb09c4c);_0x3e8d7b[_0xf384('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 956150e..b7ebc78 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 _0xf658=['utf8','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','stringify','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf658,0xde));var _0x8f65=function(_0x4f475a,_0xc0ce52){_0x4f475a=_0x4f475a-0x0;var _0x460c92=_0xf658[_0x4f475a];return _0x460c92;};'use strict';var rp=require(_0x8f65('0x0'));var logger=require('../../../../config/logger')(_0x8f65('0x1'));var _=require(_0x8f65('0x2'));var arr=[];exports[_0x8f65('0x3')]=function(_0x4a663c,_0x2c0684){return function(_0x37bec){var _0x504d0a=_0x2c0684[0xa];var _0x119102=_0x2c0684[0xb];var _0x146c07=_0x2c0684[0xc];var _0x224ac2=_0x2c0684[0xd];var _0x5010d2=_0x2c0684[0xe];var _0x33cac3=_0x2c0684[0xf][_0x8f65('0x4')](/\n/g,_0x8f65('0x5'));var _0x2ed97c=_0x2c0684[0x10][_0x8f65('0x4')](/\n/g,'\x20');if(!arr[_0x8f65('0x6')](_0x119102)){arr[_0x8f65('0x7')](_0x119102);var _0x57fec3=_0x2c0684[0x3];var _0x26bb53=_0x2c0684[0x4];var _0x8cf238=_0x2c0684[0x1];var _0x56eab1=_0x2c0684[0x0];var _0x4058fa={};_0x4058fa[_0x8f65('0x8')]=_0x2c0684[0x8]+_0x8f65('0x9')+_0x146c07+'|'+_0x504d0a+'|'+_0x224ac2+'|'+_0x119102+'|'+_0x5010d2;_0x4058fa[_0x8f65('0xa')]=_0x2c0684[0x7]+_0x8f65('0x9')+_0x146c07+'|'+_0x504d0a+'|'+_0x224ac2+'|'+_0x119102+'|'+_0x5010d2+'|'+_0x33cac3+'|'+_0x2ed97c;_0x4058fa[_0x8f65('0xb')]=_0x2c0684[0x9];var _0x216e27={};_0x216e27['jsonrpc']=_0x8f65('0xc');_0x216e27[_0x8f65('0xd')]=_0x8f65('0xe');var _0xb12f54=[];_0xb12f54[_0x8f65('0x7')](_0x2c0684[0x2]);_0xb12f54[_0x8f65('0x7')](_0x2c0684[0x5]);_0xb12f54['push'](_0x2c0684[0x6]);_0x216e27[_0x8f65('0xf')]=_0xb12f54;_0x216e27['id']=0x1;var _0x45d1d9=JSON['stringify'](_0x216e27);var _0x54c3bb={'encoding':_0x8f65('0x10'),'method':_0x8f65('0x11'),'timeout':0x2710,'url':_0x57fec3,'headers':{'Content-Type':_0x8f65('0x12')},'body':_0x45d1d9};return rp(_0x54c3bb)[_0x8f65('0x13')](function(_0x8e3793){const _0x337555=JSON[_0x8f65('0x14')](_0x8e3793);if(!_0x337555['result'][_0x8f65('0x15')]){throw new Error(_0x8f65('0x16'));}var _0x4cc51f=_0x119102;var _0x52b7b2=_0x8f65('0x17')+_0x8cf238+_0x8f65('0x18')+_0x56eab1+'&sessionId='+_0x4cc51f+_0x8f65('0x19')+JSON['stringify'](_0x4058fa);var _0x343896=_0x26bb53+'?'+_0x52b7b2;return rp(_0x343896);})[_0x8f65('0x13')](function(_0x14c64b){logger[_0x8f65('0x1a')](_0x8f65('0x1b'),_0x4a663c,_0x14c64b);_0x37bec['stop']();})[_0x8f65('0x1c')](function(_0x2ec0fa){logger[_0x8f65('0x1d')](_0x8f65('0x1e'),_0x4a663c,_['isObject'](_0x2ec0fa)?JSON[_0x8f65('0x1f')](_0x2ec0fa):_0x2ec0fa);_0x37bec[_0x8f65('0x20')]();});}else{logger[_0x8f65('0x1a')](_0x8f65('0x21'),_0x4a663c);_0x37bec['next']();}};}; \ No newline at end of file +var _0x1f12=['../../../../config/logger','routing','consequence','\x20-\x20','replace','includes','push','?params=','title','jsonrpc','2.0','method','login','params','stringify','POST','application/json-rpc','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','then','info','error','[%s][TVOX]\x20%s','isObject','next','request-promise'];(function(_0x5aed32,_0x2a5832){var _0x4d897f=function(_0x4486cc){while(--_0x4486cc){_0x5aed32['push'](_0x5aed32['shift']());}};_0x4d897f(++_0x2a5832);}(_0x1f12,0x195));var _0x21f1=function(_0x5af4f4,_0x217cb3){_0x5af4f4=_0x5af4f4-0x0;var _0x54dab4=_0x1f12[_0x5af4f4];return _0x54dab4;};'use strict';var rp=require(_0x21f1('0x0'));var logger=require(_0x21f1('0x1'))(_0x21f1('0x2'));var _=require('lodash');var arr=[];exports[_0x21f1('0x3')]=function(_0x20aedd,_0x36778f){return function(_0x47811c){var _0x4bb25b=_0x36778f[0xa];var _0xd43ebf=_0x36778f[0xb];var _0x186d4e=_0x36778f[0xc];var _0x564ffb=_0x36778f[0xd];var _0x5c9857=_0x36778f[0xe];var _0x3bcc22=_0x36778f[0xf]['replace'](/\n/g,_0x21f1('0x4'));var _0x18e1b6=_0x36778f[0x10][_0x21f1('0x5')](/\n/g,'\x20');if(!arr[_0x21f1('0x6')](_0xd43ebf)){arr[_0x21f1('0x7')](_0xd43ebf);var _0x46c5fd=_0x36778f[0x3];var _0x59f659=_0x36778f[0x4];var _0x5873bf=_0x36778f[0x1];var _0x5e02c5=_0x36778f[0x0];var _0x3c0575={};_0x3c0575['urlOnAnswer']=_0x36778f[0x8]+_0x21f1('0x8')+_0x186d4e+'|'+_0x4bb25b+'|'+_0x564ffb+'|'+_0xd43ebf+'|'+_0x5c9857;_0x3c0575['urlOnRing']=_0x36778f[0x7]+_0x21f1('0x8')+_0x186d4e+'|'+_0x4bb25b+'|'+_0x564ffb+'|'+_0xd43ebf+'|'+_0x5c9857+'|'+_0x3bcc22+'|'+_0x18e1b6;_0x3c0575[_0x21f1('0x9')]=_0x36778f[0x9];var _0x53c3bd={};_0x53c3bd[_0x21f1('0xa')]=_0x21f1('0xb');_0x53c3bd[_0x21f1('0xc')]=_0x21f1('0xd');var _0xbe47ae=[];_0xbe47ae[_0x21f1('0x7')](_0x36778f[0x2]);_0xbe47ae[_0x21f1('0x7')](_0x36778f[0x5]);_0xbe47ae[_0x21f1('0x7')](_0x36778f[0x6]);_0x53c3bd[_0x21f1('0xe')]=_0xbe47ae;_0x53c3bd['id']=0x1;var _0x2805e9=JSON[_0x21f1('0xf')](_0x53c3bd);var _0x30e80f={'encoding':'utf8','method':_0x21f1('0x10'),'timeout':0x2710,'url':_0x46c5fd,'headers':{'Content-Type':_0x21f1('0x11')},'body':_0x2805e9};return rp(_0x30e80f)['then'](function(_0x4619cd){const _0x17f4a2=JSON[_0x21f1('0x12')](_0x4619cd);if(!_0x17f4a2['result'][_0x21f1('0x13')]){throw new Error(_0x21f1('0x14'));}var _0x588a60=_0xd43ebf;var _0x2e0541='channelId='+_0x5873bf+'&serviceId='+_0x5e02c5+_0x21f1('0x15')+_0x588a60+_0x21f1('0x16')+JSON[_0x21f1('0xf')](_0x3c0575);var _0x52a1b7=_0x59f659+'?'+_0x2e0541;return rp(_0x52a1b7);})[_0x21f1('0x17')](function(_0x5d8b91){logger[_0x21f1('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x20aedd,_0x5d8b91);_0x47811c['stop']();})['catch'](function(_0x4e47c9){logger[_0x21f1('0x19')](_0x21f1('0x1a'),_0x20aedd,_[_0x21f1('0x1b')](_0x4e47c9)?JSON['stringify'](_0x4e47c9):_0x4e47c9);_0x47811c['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x20aedd);_0x47811c[_0x21f1('0x1c')]();}};}; \ 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 6b5c391..53e95b0 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2cf667,_0x199a55){var _0x3fd76c=function(_0x2a7e79){while(--_0x2a7e79){_0x2cf667['push'](_0x2cf667['shift']());}};_0x3fd76c(++_0x199a55);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x91bac8,_0x361ef4){var _0x119a9c=function(_0x1cf8fa){while(--_0x1cf8fa){_0x91bac8['push'](_0x91bac8['shift']());}};_0x119a9c(++_0x361ef4);}(_0xe706,0xa3));var _0x6e70=function(_0x25979f,_0x32a3eb){_0x25979f=_0x25979f-0x0;var _0x4de4e7=_0xe706[_0x25979f];return _0x4de4e7;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index ae7fc70..64774be 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 _0x58e6=['\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','channel','mail','push','slice','dialogflow','dialogflowv2','tvox','account','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','intervals','consequence','info','Push\x20new\x20rule','on\x20interval'];(function(_0x2b436d,_0x1f07fc){var _0x546141=function(_0x37a734){while(--_0x37a734){_0x2b436d['push'](_0x2b436d['shift']());}};_0x546141(++_0x1f07fc);}(_0x58e6,0x1c2));var _0x658e=function(_0x48cfb7,_0x4bc610){_0x48cfb7=_0x48cfb7-0x0;var _0xe0ba29=_0x58e6[_0x48cfb7];return _0xe0ba29;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0x658e('0x2'));var sUtils=require('./applications/strategy/util');var logger=require(_0x658e('0x3'))(_0x658e('0x4'));var rpc={'openchannelQueueReport':require(_0x658e('0x5')),'mailQueueReport':require(_0x658e('0x6')),'chatQueueReport':require(_0x658e('0x7')),'smsQueueReport':require(_0x658e('0x8')),'faxQueueReport':require(_0x658e('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x7a343,_0xa73acf,_0x1e2c26){return util['format'](_0x658e('0xa'),_0x7a343,_0xa73acf||0x0,_0x1e2c26||0x0);}function getIntervals(_0x6ea6e,_0x13ab91){var _0x322320=[];if(!_[_0x658e('0xb')](_0x13ab91[_0x658e('0xc')])&&!_['isNil'](_0x6ea6e[_0x13ab91['IntervalId']])&&!_[_0x658e('0xb')](_0x6ea6e[_0x13ab91[_0x658e('0xc')]][_0x658e('0xd')])){_0x322320=_[_0x658e('0xe')](_0x6ea6e[_0x13ab91[_0x658e('0xc')]][_0x658e('0xd')],_0x658e('0xf'));}else if(!_['isNil'](_0x13ab91[_0x658e('0xf')])){_0x322320=[_0x13ab91[_0x658e('0xf')]];}return _0x322320;}exports[_0x658e('0x10')]=function(_0xe0d724){_0xe0d724['rules']={};return new BPromise(function(_0x1e2044,_0x33bfd1){var _0x5a88e8={'Start':function(_0x4983e9){var _0x3a8385=this;return new Promise(function(_0x17c487,_0x3555ff){if(_0x4983e9){try{var _0x58dc8e=[];var _0x14b331=getId(_0x4983e9['channel'],_0x4983e9[_0x658e('0x11')]?_0x4983e9[_0x658e('0x11')]['id']:0x0,_0x4983e9[_0x658e('0x12')]?_0x4983e9[_0x658e('0x12')]['id']:0x0);var _0x23bb10=sUtils[_0x658e('0x13')](_0xe0d724,_0x4983e9);if(_0x4983e9['transfer']||!_0x23bb10&&_0x4983e9[_0x658e('0x14')]&&_[_0x658e('0x15')](_0x4983e9[_0x658e('0x14')])&&_0x4983e9[_0x658e('0x14')][_0x658e('0x16')]){for(var _0x544df0=0x0;_0x544df0<_0x4983e9['applications'][_0x658e('0x16')];_0x544df0+=0x1){var _0x1cc63d=_0x4983e9['applications'][_0x544df0];if(fs[_0x658e('0x17')](path[_0x658e('0x18')](__dirname,_0x658e('0x14'),_0x1cc63d[_0x658e('0x19')]+'.js'))){var _0xd9885d=[];switch(_0x1cc63d[_0x658e('0x19')][_0x658e('0x1a')]()){case _0x658e('0x1b'):var _0xe6cf1a=_0x1cc63d[_0x658e('0x1c')][_0x658e('0x1d')](',');if(_0x4983e9[_0x658e('0x1e')]===_0x658e('0x1f')){_0xd9885d[_0x658e('0x20')](_0xe6cf1a[0x0]);_0xd9885d[_0x658e('0x20')](_0xe6cf1a[0x1]);_0xd9885d['push'](_0xe6cf1a[_0x658e('0x21')](0x2,_0xe6cf1a[_0x658e('0x16')])['join'](','));}else{_0xd9885d[_0x658e('0x20')](_0xe6cf1a[0x0]);_0xd9885d[_0x658e('0x20')](_0xe6cf1a[_0x658e('0x21')](0x1,_0xe6cf1a[_0x658e('0x16')])[_0x658e('0x18')](','));}break;case _0x658e('0x22'):var _0x5d23dd=_0x1cc63d['appdata']['split'](',');_0xd9885d[_0x658e('0x20')](_0x5d23dd[0x0]);_0xd9885d[_0x658e('0x20')](_0x5d23dd[0x1]);_0xd9885d[_0x658e('0x20')](_0x5d23dd['slice'](0x2,_0x5d23dd[_0x658e('0x16')])[_0x658e('0x18')](','));break;case _0x658e('0x23'):var _0x4edddd=_0x1cc63d['appdata'][_0x658e('0x1d')](',');_0xd9885d['push'](_0x4edddd[0x0]);_0xd9885d[_0x658e('0x20')](_0x4edddd[0x1]);_0xd9885d[_0x658e('0x20')](_0x4edddd[0x2]);_0xd9885d[_0x658e('0x20')](_0x4edddd[0x3]);_0xd9885d[_0x658e('0x20')](_0x4edddd[_0x658e('0x21')](0x4,_0x4edddd[_0x658e('0x16')])[_0x658e('0x18')](','));break;case'amazonlex':var _0x4518fa=_0x1cc63d['appdata'][_0x658e('0x1d')](',');_0xd9885d[_0x658e('0x20')](_0x4518fa[0x0]);_0xd9885d['push'](_0x4518fa[0x1]);_0xd9885d[_0x658e('0x20')](_0x4518fa[0x2]);_0xd9885d[_0x658e('0x20')](_0x4518fa[0x3]);_0xd9885d[_0x658e('0x20')](_0x4518fa[_0x658e('0x21')](0x4,_0x4518fa['length'])['join'](','));break;case _0x658e('0x11'):_0xd9885d[_0x658e('0x20')](_0x1cc63d['appdata']);break;case'tag':_0xd9885d[_0x658e('0x20')](_0x1cc63d['TagId']);_0xd9885d[_0x658e('0x20')](_0x1cc63d[_0x658e('0x1c')]);break;case _0x658e('0x24'):var _0x5224d8=utils['getMustacheRender'](_0x4983e9[_0x658e('0x25')]['notificationTemplate'],_0x4983e9);var _0x1f881f=_0x1cc63d[_0x658e('0x1c')][_0x658e('0x1d')](',');_0xd9885d[_0x658e('0x20')](_0x1f881f[0x0]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x1]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x2]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x3]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x4]);_0xd9885d['push'](_0x1f881f[0x5]);_0xd9885d['push'](_0x1f881f[0x6]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x7]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0x8]);_0xd9885d['push'](_0x1f881f[0x9]);_0xd9885d[_0x658e('0x20')](_0x1f881f[0xa]);_0xd9885d[_0x658e('0x20')](_0x4983e9[_0x658e('0x12')]['id']);_0xd9885d['push'](_0x4983e9[_0x658e('0x11')]['id']);_0xd9885d['push'](_0x1cc63d[_0x658e('0x26')]);_0xd9885d[_0x658e('0x20')](_0x4983e9[_0x658e('0x12')][_0x658e('0x27')]);_0xd9885d[_0x658e('0x20')](_0x4983e9[_0x658e('0x28')][_0x658e('0x28')]);_0xd9885d['push'](_0x5224d8);break;default:_0xd9885d=_[_0x658e('0xb')](_0x1cc63d['appdata'])?[]:_0x1cc63d['appdata'][_0x658e('0x1d')](',');}var _0x378909={'id':util[_0x658e('0x29')](_0x658e('0x2a'),_0x14b331,_0x1cc63d['id'],_0x1cc63d[_0x658e('0x19')]),'condition':require(_0x658e('0x2b'))[_0x658e('0x2c')](_0x14b331,getIntervals(_0xe0d724[_0x658e('0x2d')],_0x1cc63d),_0xe0d724),'consequence':require('./applications/'+_0x1cc63d[_0x658e('0x19')])[_0x658e('0x2e')](_0x14b331,_0xd9885d,_0xe0d724,_0x4983e9),'p':_0x1cc63d['priority']||0x0};logger[_0x658e('0x2f')](_0x658e('0x30'),_0x378909['id'],_0x658e('0x31'),getIntervals(_0xe0d724['intervals'],_0x1cc63d)[_0x658e('0x18')](_0x658e('0x32')));_0x58dc8e[_0x658e('0x20')](_0x378909);}else{logger[_0x658e('0x33')](_0x658e('0x34'),path[_0x658e('0x18')](__dirname,'applications',_0x1cc63d['app']+'.js'));}}_0xe0d724['rules'][_0x14b331]=new RuleEngine(_0x58dc8e);_0xe0d724[_0x658e('0x35')][_0x14b331][_0x658e('0x36')](_0x4983e9,function(_0x1eca66){logger[_0x658e('0x2f')](_0x658e('0x37'),JSON['stringify'](_0x1eca66[_0x658e('0x38')]));if(_0xe0d724[_0x658e('0x35')][_0x14b331]){_0xe0d724[_0x658e('0x35')][_0x14b331]['emit'](_0x658e('0x39'));}});return _0x17c487({'code':0xc8,'message':_0x4983e9});}else{if(_0x23bb10){logger[_0x658e('0x2f')](util[_0x658e('0x29')](_0x658e('0x3a'),_0x14b331));}else{logger[_0x658e('0x2f')](_0x658e('0x3b'));}return _0x17c487({'code':0xc8,'message':_0x4983e9});}}catch(_0x3d3b16){logger[_0x658e('0x33')](_0x3d3b16['stack']);return _0x3555ff(_0x3a8385[_0x658e('0x33')](0x1f4,_0x3d3b16));}}return _0x3555ff(_0x658e('0x3c'));});},'AcceptMessage':function(_0x5a1703){var _0x4767d7=this;return new Promise(function(_0x51d21f,_0x240d42){if(_0x5a1703[_0x658e('0x3d')]&&_0x5a1703['agent']['id']){if(_0xe0d724[_0x658e('0x3e')][_0x5a1703['agent']['id']]){_0xe0d724[_0x658e('0x3e')][_0x5a1703[_0x658e('0x3d')]['id']]['busy']=![];_0xe0d724['agents'][_0x5a1703[_0x658e('0x3d')]['id']][_0x658e('0x3f')]=undefined;}}if(_0x5a1703[_0x658e('0x11')]&&_0x5a1703[_0x658e('0x11')]['id']){try{var _0x4a1a52=getId(_0x5a1703[_0x658e('0x1e')],_0x5a1703[_0x658e('0x11')]?_0x5a1703['message']['id']:0x0,_0x5a1703['interaction']?_0x5a1703['interaction']['id']:0x0);if(_0xe0d724[_0x658e('0x35')][_0x4a1a52]){_0xe0d724[_0x658e('0x35')][_0x4a1a52]['emit'](_0x658e('0x40'));if(rpc[_0x5a1703[_0x658e('0x1e')]+_0x658e('0x41')]){rpc[_0x5a1703[_0x658e('0x1e')]+'QueueReport'][_0x658e('0x42')](_0x4a1a52,{'UserId':_0x5a1703[_0x658e('0x11')][_0x658e('0x43')]})[_0x658e('0x44')](function(){logger[_0x658e('0x33')](_0x658e('0x45'));});}}return _0x51d21f({'code':0xc8,'message':_0x5a1703});}catch(_0x5a0321){logger['error'](_0x5a0321['stack']);return _0x240d42(_0x4767d7['error'](0x1f4,_0x5a0321));}}logger['error']('message\x20is\x20empty');return _0x240d42(_0x4767d7[_0x658e('0x33')](0x1f4,_0x658e('0x46')));});},'RejectMessage':function(_0x38e902){var _0x49d313=this;return new Promise(function(_0x2af3f7,_0xa7ea32){if(_0x38e902[_0x658e('0x3d')]&&_0x38e902[_0x658e('0x3d')]['id']){try{if(_0xe0d724[_0x658e('0x3e')][_0x38e902[_0x658e('0x3d')]['id']]){_0xe0d724[_0x658e('0x3e')][_0x38e902[_0x658e('0x3d')]['id']]['busy']=![];_0xe0d724[_0x658e('0x3e')][_0x38e902['agent']['id']][_0x658e('0x3f')]=undefined;}return _0x2af3f7({'code':0xc8,'message':_0x38e902});}catch(_0x501c59){logger[_0x658e('0x33')](_0x501c59[_0x658e('0x47')]);return _0xa7ea32(_0x49d313[_0x658e('0x33')](0x1f4,_0x501c59));}}logger[_0x658e('0x33')](_0x658e('0x46'));return _0xa7ea32(_0x49d313[_0x658e('0x33')](0x1f4,_0x658e('0x46')));});},'AbandonInteraction':function(_0x100cba){var _0x1c8989=this;return new Promise(function(_0x22d50f,_0x464b65){if(_0x100cba[_0x658e('0x1e')]&&_0x100cba['interaction']&&_0x100cba['interaction']['id']){try{var _0x591991=getId(_0x100cba[_0x658e('0x1e')],_0x100cba[_0x658e('0x11')]?_0x100cba[_0x658e('0x11')]['id']:0x0,_0x100cba[_0x658e('0x12')]?_0x100cba[_0x658e('0x12')]['id']:0x0);if(_0xe0d724[_0x658e('0x35')][_0x591991]){_0xe0d724[_0x658e('0x35')][_0x591991][_0x658e('0x48')](_0x658e('0x40'));}return _0x22d50f({'code':0xc8,'message':_0x100cba});}catch(_0x218e39){logger[_0x658e('0x33')](_0x218e39[_0x658e('0x47')]);return _0x464b65(_0x1c8989[_0x658e('0x33')](0x1f4,_0x218e39));}}logger[_0x658e('0x33')](_0x658e('0x46'));return _0x464b65(_0x1c8989[_0x658e('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0xe7db6){var _0x5b096c=this;return new Promise(function(_0x134411,_0x22b776){if(_0xe0d724[_0x658e('0x3e')][_0x658e('0x49')](_0xe7db6['id'])){for(var _0x212293 in _0xe7db6[_0x658e('0x4a')]){if(_0xe7db6[_0x658e('0x4a')][_0x658e('0x49')](_0x212293)){if(_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']][_0x658e('0x49')](_0x212293+_0x658e('0x4b'))){_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']][_0x212293+_0x658e('0x4b')]=parseInt(_0xe7db6[_0x658e('0x4a')][_0x212293],0xa);}}}_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']][_0x658e('0x4c')]();return _0x134411({'code':0xc8,'message':_0xe0d724[_0x658e('0x3e')][_0xe7db6['id']]});}else{return _0x22b776(_0x5b096c['error'](0x1f4,_0x658e('0x4d')));}});},'Agents':function(_0x3888b4){return new Promise(function(_0x510a10){var _0xffc528=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x3e')]);if(_0x3888b4&&_0x3888b4['id']){var _0x1638e0=_['find'](_0xffc528,function(_0xcae6df){return _0xcae6df['id']===_0x3888b4['id'];});_0x510a10(_0x1638e0);}else{_0x510a10({'count':_0xffc528[_0x658e('0x16')],'rows':_0xffc528});}});},'ChatQueues':function(){return new Promise(function(_0x7bc1a8){var _0x5bdb2f=[];for(var _0x4b688e in _0xe0d724[_0x658e('0x4f')]){if(_0xe0d724[_0x658e('0x4f')][_0x658e('0x49')](_0x4b688e)){var _0x4ccb4e=_0xe0d724[_0x658e('0x4f')][_0x4b688e];var _0x1a3372={'id':_0x4ccb4e['id'],'available':_0x4ccb4e[_0x658e('0x50')],'loggedIn':_0x4ccb4e[_0x658e('0x51')],'name':_0x4ccb4e[_0x658e('0x52')],'paused':_0x4ccb4e[_0x658e('0x53')],'waiting':_0x4ccb4e[_0x658e('0x54')]};_0x5bdb2f[_0x658e('0x20')](_0x1a3372);}}_0x7bc1a8({'count':_0x5bdb2f[_0x658e('0x16')],'rows':_0x5bdb2f});});},'MailQueues':function(){return new Promise(function(_0x56fce9){var _0x1ca7f5=[];for(var _0x3b12cb in _0xe0d724['mailQueues']){if(_0xe0d724[_0x658e('0x55')]['hasOwnProperty'](_0x3b12cb)){var _0x556e61=_0xe0d724[_0x658e('0x55')][_0x3b12cb];var _0x9503e0={'id':_0x556e61['id'],'available':_0x556e61['available'],'loggedIn':_0x556e61['loggedIn'],'name':_0x556e61['name'],'paused':_0x556e61[_0x658e('0x53')],'waiting':_0x556e61[_0x658e('0x54')]};_0x1ca7f5[_0x658e('0x20')](_0x9503e0);}}_0x56fce9({'count':_0x1ca7f5[_0x658e('0x16')],'rows':_0x1ca7f5});});},'OpenchannelQueues':function(){return new Promise(function(_0xe4e9d){var _0x163af3=[];for(var _0x25cbf6 in _0xe0d724[_0x658e('0x56')]){if(_0xe0d724[_0x658e('0x56')]['hasOwnProperty'](_0x25cbf6)){var _0x37b09e=_0xe0d724[_0x658e('0x56')][_0x25cbf6];var _0x32f51a={'id':_0x37b09e['id'],'available':_0x37b09e['available'],'loggedIn':_0x37b09e[_0x658e('0x51')],'name':_0x37b09e['name'],'paused':_0x37b09e[_0x658e('0x53')],'waiting':_0x37b09e['waiting']};_0x163af3[_0x658e('0x20')](_0x32f51a);}}_0xe4e9d({'count':_0x163af3[_0x658e('0x16')],'rows':_0x163af3});});},'SmsQueues':function(){return new Promise(function(_0x2596a4){var _0x322124=[];for(var _0x14d4c4 in _0xe0d724[_0x658e('0x57')]){if(_0xe0d724[_0x658e('0x57')]['hasOwnProperty'](_0x14d4c4)){var _0x4d046e=_0xe0d724['smsQueues'][_0x14d4c4];var _0x239a93={'id':_0x4d046e['id'],'available':_0x4d046e[_0x658e('0x50')],'loggedIn':_0x4d046e[_0x658e('0x51')],'name':_0x4d046e['name'],'paused':_0x4d046e[_0x658e('0x53')],'waiting':_0x4d046e[_0x658e('0x54')]};_0x322124[_0x658e('0x20')](_0x239a93);}}_0x2596a4({'count':_0x322124[_0x658e('0x16')],'rows':_0x322124});});},'FaxQueues':function(){return new Promise(function(_0x5e6d14){var _0x3621ef=[];for(var _0x513a39 in _0xe0d724[_0x658e('0x58')]){if(_0xe0d724['faxQueues']['hasOwnProperty'](_0x513a39)){var _0x1ca6e0=_0xe0d724[_0x658e('0x58')][_0x513a39];var _0x3d39d5={'id':_0x1ca6e0['id'],'available':_0x1ca6e0['available'],'loggedIn':_0x1ca6e0[_0x658e('0x51')],'name':_0x1ca6e0['name'],'paused':_0x1ca6e0['paused'],'waiting':_0x1ca6e0[_0x658e('0x54')]};_0x3621ef[_0x658e('0x20')](_0x3d39d5);}}_0x5e6d14({'count':_0x3621ef[_0x658e('0x16')],'rows':_0x3621ef});});},'WhatsappQueues':function(){return new Promise(function(_0x55c512){var _0x5f32d0=[];for(var _0x5adcb2 in _0xe0d724['whatsappQueues']){if(_0xe0d724[_0x658e('0x59')][_0x658e('0x49')](_0x5adcb2)){var _0x36621c=_0xe0d724[_0x658e('0x59')][_0x5adcb2];var _0xa3241b={'id':_0x36621c['id'],'available':_0x36621c['available'],'loggedIn':_0x36621c[_0x658e('0x51')],'name':_0x36621c['name'],'paused':_0x36621c['paused'],'waiting':_0x36621c[_0x658e('0x54')]};_0x5f32d0[_0x658e('0x20')](_0xa3241b);}}_0x55c512({'count':_0x5f32d0[_0x658e('0x16')],'rows':_0x5f32d0});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x133216){var _0x1e074b=_[_0x658e('0x4e')](_0xe0d724['chatQueuesWaitingInteractions']);_0x133216({'count':_0x1e074b[_0x658e('0x16')],'rows':_0x1e074b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2dc790){var _0x3e3620=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x5a')]);_0x2dc790({'count':_0x3e3620[_0x658e('0x16')],'rows':_0x3e3620});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x564560){var _0x579f1a=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x5b')]);_0x564560({'count':_0x579f1a[_0x658e('0x16')],'rows':_0x579f1a});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x541a5e){var _0x16369d=_['values'](_0xe0d724[_0x658e('0x5c')]);_0x541a5e({'count':_0x16369d['length'],'rows':_0x16369d});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3237d4){var _0x16157c=_[_0x658e('0x4e')](_0xe0d724[_0x658e('0x5d')]);_0x3237d4({'count':_0x16157c[_0x658e('0x16')],'rows':_0x16157c});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3ab042){var _0x3e7df6=_[_0x658e('0x4e')](_0xe0d724['whatsappQueuesWaitingInteractions']);_0x3ab042({'count':_0x3e7df6[_0x658e('0x16')],'rows':_0x3e7df6});});}};var _0x4c6a02=jayson[_0x658e('0x5e')](_0x5a88e8)['http']();_0x4c6a02['on'](_0x658e('0x33'),function(_0xf4cfb8){logger[_0x658e('0x33')](JSON[_0x658e('0x5f')](_0xf4cfb8));return _0x33bfd1(_0xf4cfb8);});_0x4c6a02[_0x658e('0x10')](0x232c,_0x658e('0x60'),function(){console[_0x658e('0x61')](_0x658e('0x62'),0x232c);return _0x1e2044(_0x658e('0x63')+0x232c);});});}; \ No newline at end of file +var _0x287e=['mail','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','error','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','channel','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','split'];(function(_0x4cf384,_0x5d12cb){var _0x1658c6=function(_0x279a9d){while(--_0x279a9d){_0x4cf384['push'](_0x4cf384['shift']());}};_0x1658c6(++_0x5d12cb);}(_0x287e,0x1e3));var _0xe287=function(_0x417c4c,_0x40d1f6){_0x417c4c=_0x417c4c-0x0;var _0xba104b=_0x287e[_0x417c4c];return _0xba104b;};'use strict';var _=require(_0xe287('0x0'));var util=require(_0xe287('0x1'));var path=require(_0xe287('0x2'));var fs=require('fs');var jayson=require(_0xe287('0x3'));var BPromise=require(_0xe287('0x4'));var utils=require(_0xe287('0x5'));var sUtils=require(_0xe287('0x6'));var logger=require(_0xe287('0x7'))(_0xe287('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xe287('0x9')),'chatQueueReport':require(_0xe287('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xe287('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4f3cf1,_0x4cd1f4,_0x2082c6){return util[_0xe287('0xc')](_0xe287('0xd'),_0x4f3cf1,_0x4cd1f4||0x0,_0x2082c6||0x0);}function getIntervals(_0x3b1a68,_0x1e781d){var _0x3e82a2=[];if(!_[_0xe287('0xe')](_0x1e781d[_0xe287('0xf')])&&!_[_0xe287('0xe')](_0x3b1a68[_0x1e781d[_0xe287('0xf')]])&&!_[_0xe287('0xe')](_0x3b1a68[_0x1e781d[_0xe287('0xf')]]['Intervals'])){_0x3e82a2=_[_0xe287('0x10')](_0x3b1a68[_0x1e781d['IntervalId']][_0xe287('0x11')],'interval');}else if(!_[_0xe287('0xe')](_0x1e781d['interval'])){_0x3e82a2=[_0x1e781d[_0xe287('0x12')]];}return _0x3e82a2;}exports[_0xe287('0x13')]=function(_0x2d2b48){_0x2d2b48[_0xe287('0x14')]={};return new BPromise(function(_0x279281,_0x497f73){var _0x298641={'Start':function(_0x5447b5){var _0x352922=this;return new Promise(function(_0x376a59,_0x5c1dea){if(_0x5447b5){try{var _0x336ff3=[];var _0x5053e0=getId(_0x5447b5['channel'],_0x5447b5[_0xe287('0x15')]?_0x5447b5[_0xe287('0x15')]['id']:0x0,_0x5447b5[_0xe287('0x16')]?_0x5447b5['interaction']['id']:0x0);var _0x2c4ef3=sUtils['checkWaitingNotifications'](_0x2d2b48,_0x5447b5);if(_0x5447b5['transfer']||!_0x2c4ef3&&_0x5447b5[_0xe287('0x17')]&&_[_0xe287('0x18')](_0x5447b5['applications'])&&_0x5447b5[_0xe287('0x17')]['length']){for(var _0x241873=0x0;_0x241873<_0x5447b5[_0xe287('0x17')][_0xe287('0x19')];_0x241873+=0x1){var _0x4e264f=_0x5447b5[_0xe287('0x17')][_0x241873];if(fs[_0xe287('0x1a')](path[_0xe287('0x1b')](__dirname,_0xe287('0x17'),_0x4e264f[_0xe287('0x1c')]+_0xe287('0x1d')))){var _0x3e971a=[];switch(_0x4e264f[_0xe287('0x1c')]['toLowerCase']()){case _0xe287('0x1e'):var _0x1e68af=_0x4e264f['appdata'][_0xe287('0x1f')](',');if(_0x5447b5['channel']===_0xe287('0x20')){_0x3e971a[_0xe287('0x21')](_0x1e68af[0x0]);_0x3e971a[_0xe287('0x21')](_0x1e68af[0x1]);_0x3e971a['push'](_0x1e68af['slice'](0x2,_0x1e68af[_0xe287('0x19')])[_0xe287('0x1b')](','));}else{_0x3e971a[_0xe287('0x21')](_0x1e68af[0x0]);_0x3e971a[_0xe287('0x21')](_0x1e68af[_0xe287('0x22')](0x1,_0x1e68af[_0xe287('0x19')])[_0xe287('0x1b')](','));}break;case _0xe287('0x23'):var _0x55c97a=_0x4e264f[_0xe287('0x24')]['split'](',');_0x3e971a[_0xe287('0x21')](_0x55c97a[0x0]);_0x3e971a[_0xe287('0x21')](_0x55c97a[0x1]);_0x3e971a['push'](_0x55c97a[_0xe287('0x22')](0x2,_0x55c97a[_0xe287('0x19')])[_0xe287('0x1b')](','));break;case _0xe287('0x25'):var _0x58ddec=_0x4e264f[_0xe287('0x24')][_0xe287('0x1f')](',');_0x3e971a[_0xe287('0x21')](_0x58ddec[0x0]);_0x3e971a['push'](_0x58ddec[0x1]);_0x3e971a[_0xe287('0x21')](_0x58ddec[0x2]);_0x3e971a[_0xe287('0x21')](_0x58ddec[0x3]);_0x3e971a[_0xe287('0x21')](_0x58ddec['slice'](0x4,_0x58ddec[_0xe287('0x19')])[_0xe287('0x1b')](','));break;case _0xe287('0x26'):var _0x253174=_0x4e264f[_0xe287('0x24')][_0xe287('0x1f')](',');_0x3e971a['push'](_0x253174[0x0]);_0x3e971a[_0xe287('0x21')](_0x253174[0x1]);_0x3e971a['push'](_0x253174[0x2]);_0x3e971a[_0xe287('0x21')](_0x253174[0x3]);_0x3e971a['push'](_0x253174[_0xe287('0x22')](0x4,_0x253174[_0xe287('0x19')])[_0xe287('0x1b')](','));break;case _0xe287('0x15'):_0x3e971a['push'](_0x4e264f['appdata']);break;case _0xe287('0x27'):_0x3e971a[_0xe287('0x21')](_0x4e264f['TagId']);_0x3e971a['push'](_0x4e264f['appdata']);break;case'tvox':var _0x556051=utils[_0xe287('0x28')](_0x5447b5[_0xe287('0x29')][_0xe287('0x2a')],_0x5447b5);var _0x1e0e62=_0x4e264f[_0xe287('0x24')][_0xe287('0x1f')](',');_0x3e971a['push'](_0x1e0e62[0x0]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x1]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x2]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x3]);_0x3e971a['push'](_0x1e0e62[0x4]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x5]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x6]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x7]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x8]);_0x3e971a['push'](_0x1e0e62[0x9]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0xa]);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x16')]['id']);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x15')]['id']);_0x3e971a[_0xe287('0x21')](_0x4e264f[_0xe287('0x2b')]);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x16')][_0xe287('0x2c')]);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x2d')][_0xe287('0x2d')]);_0x3e971a[_0xe287('0x21')](_0x556051);break;default:_0x3e971a=_[_0xe287('0xe')](_0x4e264f['appdata'])?[]:_0x4e264f[_0xe287('0x24')]['split'](',');}var _0x21d133={'id':util[_0xe287('0xc')](_0xe287('0x2e'),_0x5053e0,_0x4e264f['id'],_0x4e264f[_0xe287('0x1c')]),'condition':require(_0xe287('0x2f'))[_0xe287('0x30')](_0x5053e0,getIntervals(_0x2d2b48[_0xe287('0x31')],_0x4e264f),_0x2d2b48),'consequence':require(_0xe287('0x32')+_0x4e264f[_0xe287('0x1c')])['consequence'](_0x5053e0,_0x3e971a,_0x2d2b48,_0x5447b5),'p':_0x4e264f[_0xe287('0x33')]||0x0};logger[_0xe287('0x34')](_0xe287('0x35'),_0x21d133['id'],_0xe287('0x36'),getIntervals(_0x2d2b48['intervals'],_0x4e264f)[_0xe287('0x1b')]('\x20|\x20'));_0x336ff3[_0xe287('0x21')](_0x21d133);}else{logger[_0xe287('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xe287('0x1b')](__dirname,_0xe287('0x17'),_0x4e264f['app']+_0xe287('0x1d')));}}_0x2d2b48[_0xe287('0x14')][_0x5053e0]=new RuleEngine(_0x336ff3);_0x2d2b48[_0xe287('0x14')][_0x5053e0][_0xe287('0x38')](_0x5447b5,function(_0x2a3694){logger[_0xe287('0x34')](_0xe287('0x39'),JSON[_0xe287('0x3a')](_0x2a3694[_0xe287('0x3b')]));if(_0x2d2b48[_0xe287('0x14')][_0x5053e0]){_0x2d2b48[_0xe287('0x14')][_0x5053e0][_0xe287('0x3c')](_0xe287('0x3d'));}});return _0x376a59({'code':0xc8,'message':_0x5447b5});}else{if(_0x2c4ef3){logger['info'](util[_0xe287('0xc')](_0xe287('0x3e'),_0x5053e0));}else{logger[_0xe287('0x34')](_0xe287('0x3f'));}return _0x376a59({'code':0xc8,'message':_0x5447b5});}}catch(_0x5a843e){logger['error'](_0x5a843e[_0xe287('0x40')]);return _0x5c1dea(_0x352922[_0xe287('0x37')](0x1f4,_0x5a843e));}}return _0x5c1dea(_0xe287('0x41'));});},'AcceptMessage':function(_0x5561e5){var _0x595707=this;return new Promise(function(_0x562b66,_0x58c4dd){if(_0x5561e5[_0xe287('0x42')]&&_0x5561e5[_0xe287('0x42')]['id']){if(_0x2d2b48[_0xe287('0x43')][_0x5561e5[_0xe287('0x42')]['id']]){_0x2d2b48[_0xe287('0x43')][_0x5561e5['agent']['id']][_0xe287('0x44')]=![];_0x2d2b48[_0xe287('0x43')][_0x5561e5[_0xe287('0x42')]['id']][_0xe287('0x45')]=undefined;}}if(_0x5561e5[_0xe287('0x15')]&&_0x5561e5[_0xe287('0x15')]['id']){try{var _0x5e1181=getId(_0x5561e5['channel'],_0x5561e5['message']?_0x5561e5[_0xe287('0x15')]['id']:0x0,_0x5561e5[_0xe287('0x16')]?_0x5561e5[_0xe287('0x16')]['id']:0x0);if(_0x2d2b48['rules'][_0x5e1181]){_0x2d2b48[_0xe287('0x14')][_0x5e1181][_0xe287('0x3c')](_0xe287('0x46'));if(rpc[_0x5561e5[_0xe287('0x47')]+_0xe287('0x48')]){rpc[_0x5561e5[_0xe287('0x47')]+_0xe287('0x48')][_0xe287('0x49')](_0x5e1181,{'UserId':_0x5561e5['message'][_0xe287('0x4a')]})['catch'](function(){logger[_0xe287('0x37')](_0xe287('0x4b'));});}}return _0x562b66({'code':0xc8,'message':_0x5561e5});}catch(_0x2db119){logger[_0xe287('0x37')](_0x2db119[_0xe287('0x40')]);return _0x58c4dd(_0x595707[_0xe287('0x37')](0x1f4,_0x2db119));}}logger['error'](_0xe287('0x4c'));return _0x58c4dd(_0x595707[_0xe287('0x37')](0x1f4,_0xe287('0x4c')));});},'RejectMessage':function(_0x2aacf0){var _0x863b0c=this;return new Promise(function(_0x59f7e8,_0x263566){if(_0x2aacf0['agent']&&_0x2aacf0['agent']['id']){try{if(_0x2d2b48[_0xe287('0x43')][_0x2aacf0[_0xe287('0x42')]['id']]){_0x2d2b48[_0xe287('0x43')][_0x2aacf0[_0xe287('0x42')]['id']][_0xe287('0x44')]=![];_0x2d2b48['agents'][_0x2aacf0[_0xe287('0x42')]['id']][_0xe287('0x45')]=undefined;}return _0x59f7e8({'code':0xc8,'message':_0x2aacf0});}catch(_0x37b19){logger['error'](_0x37b19[_0xe287('0x40')]);return _0x263566(_0x863b0c['error'](0x1f4,_0x37b19));}}logger['error']('message\x20is\x20empty');return _0x263566(_0x863b0c['error'](0x1f4,_0xe287('0x4c')));});},'AbandonInteraction':function(_0x18bb86){var _0x3945de=this;return new Promise(function(_0xdd5d9a,_0x4889ed){if(_0x18bb86['channel']&&_0x18bb86[_0xe287('0x16')]&&_0x18bb86[_0xe287('0x16')]['id']){try{var _0x1e7cd1=getId(_0x18bb86[_0xe287('0x47')],_0x18bb86[_0xe287('0x15')]?_0x18bb86[_0xe287('0x15')]['id']:0x0,_0x18bb86[_0xe287('0x16')]?_0x18bb86[_0xe287('0x16')]['id']:0x0);if(_0x2d2b48[_0xe287('0x14')][_0x1e7cd1]){_0x2d2b48[_0xe287('0x14')][_0x1e7cd1]['emit'](_0xe287('0x46'));}return _0xdd5d9a({'code':0xc8,'message':_0x18bb86});}catch(_0x30a626){logger['error'](_0x30a626['stack']);return _0x4889ed(_0x3945de[_0xe287('0x37')](0x1f4,_0x30a626));}}logger[_0xe287('0x37')](_0xe287('0x4c'));return _0x4889ed(_0x3945de['error'](0x1f4,_0xe287('0x4c')));});},'AgentCapacity':function(_0x1a8dea){var _0x5c20cb=this;return new Promise(function(_0x17c34e,_0x164961){if(_0x2d2b48[_0xe287('0x43')][_0xe287('0x4d')](_0x1a8dea['id'])){for(var _0x5160ae in _0x1a8dea[_0xe287('0x4e')]){if(_0x1a8dea[_0xe287('0x4e')][_0xe287('0x4d')](_0x5160ae)){if(_0x2d2b48['agents'][_0x1a8dea['id']][_0xe287('0x4d')](_0x5160ae+_0xe287('0x4f'))){_0x2d2b48[_0xe287('0x43')][_0x1a8dea['id']][_0x5160ae+'CurrentCapacity']=parseInt(_0x1a8dea[_0xe287('0x4e')][_0x5160ae],0xa);}}}_0x2d2b48[_0xe287('0x43')][_0x1a8dea['id']]['updateRealtime']();return _0x17c34e({'code':0xc8,'message':_0x2d2b48[_0xe287('0x43')][_0x1a8dea['id']]});}else{return _0x164961(_0x5c20cb['error'](0x1f4,_0xe287('0x50')));}});},'Agents':function(_0x10f159){return new Promise(function(_0x1f4e4a){var _0x3db5b2=_[_0xe287('0x51')](_0x2d2b48[_0xe287('0x43')]);if(_0x10f159&&_0x10f159['id']){var _0x5eade8=_[_0xe287('0x52')](_0x3db5b2,function(_0x4c32ad){return _0x4c32ad['id']===_0x10f159['id'];});_0x1f4e4a(_0x5eade8);}else{_0x1f4e4a({'count':_0x3db5b2[_0xe287('0x19')],'rows':_0x3db5b2});}});},'ChatQueues':function(){return new Promise(function(_0x49e202){var _0x56a83b=[];for(var _0x43dec9 in _0x2d2b48['chatQueues']){if(_0x2d2b48[_0xe287('0x53')][_0xe287('0x4d')](_0x43dec9)){var _0x5d6f32=_0x2d2b48['chatQueues'][_0x43dec9];var _0x3eafd2={'id':_0x5d6f32['id'],'available':_0x5d6f32['available'],'loggedIn':_0x5d6f32[_0xe287('0x54')],'name':_0x5d6f32[_0xe287('0x55')],'paused':_0x5d6f32[_0xe287('0x56')],'waiting':_0x5d6f32[_0xe287('0x57')]};_0x56a83b[_0xe287('0x21')](_0x3eafd2);}}_0x49e202({'count':_0x56a83b[_0xe287('0x19')],'rows':_0x56a83b});});},'MailQueues':function(){return new Promise(function(_0x65115d){var _0x492c67=[];for(var _0x3886be in _0x2d2b48['mailQueues']){if(_0x2d2b48[_0xe287('0x58')][_0xe287('0x4d')](_0x3886be)){var _0x28947e=_0x2d2b48[_0xe287('0x58')][_0x3886be];var _0x1b8cdb={'id':_0x28947e['id'],'available':_0x28947e[_0xe287('0x59')],'loggedIn':_0x28947e[_0xe287('0x54')],'name':_0x28947e[_0xe287('0x55')],'paused':_0x28947e[_0xe287('0x56')],'waiting':_0x28947e[_0xe287('0x57')]};_0x492c67[_0xe287('0x21')](_0x1b8cdb);}}_0x65115d({'count':_0x492c67['length'],'rows':_0x492c67});});},'OpenchannelQueues':function(){return new Promise(function(_0x12a533){var _0x26e183=[];for(var _0x41af2a in _0x2d2b48['openchannelQueues']){if(_0x2d2b48[_0xe287('0x5a')][_0xe287('0x4d')](_0x41af2a)){var _0xba71=_0x2d2b48[_0xe287('0x5a')][_0x41af2a];var _0x57ab42={'id':_0xba71['id'],'available':_0xba71[_0xe287('0x59')],'loggedIn':_0xba71[_0xe287('0x54')],'name':_0xba71[_0xe287('0x55')],'paused':_0xba71[_0xe287('0x56')],'waiting':_0xba71[_0xe287('0x57')]};_0x26e183[_0xe287('0x21')](_0x57ab42);}}_0x12a533({'count':_0x26e183['length'],'rows':_0x26e183});});},'SmsQueues':function(){return new Promise(function(_0x3113c8){var _0x1b3395=[];for(var _0x369713 in _0x2d2b48['smsQueues']){if(_0x2d2b48[_0xe287('0x5b')][_0xe287('0x4d')](_0x369713)){var _0x35a40d=_0x2d2b48[_0xe287('0x5b')][_0x369713];var _0x380af1={'id':_0x35a40d['id'],'available':_0x35a40d['available'],'loggedIn':_0x35a40d['loggedIn'],'name':_0x35a40d[_0xe287('0x55')],'paused':_0x35a40d[_0xe287('0x56')],'waiting':_0x35a40d[_0xe287('0x57')]};_0x1b3395[_0xe287('0x21')](_0x380af1);}}_0x3113c8({'count':_0x1b3395[_0xe287('0x19')],'rows':_0x1b3395});});},'FaxQueues':function(){return new Promise(function(_0x53eb2c){var _0xf7c1a=[];for(var _0x41bca5 in _0x2d2b48[_0xe287('0x5c')]){if(_0x2d2b48[_0xe287('0x5c')][_0xe287('0x4d')](_0x41bca5)){var _0x230526=_0x2d2b48['faxQueues'][_0x41bca5];var _0x10f5fa={'id':_0x230526['id'],'available':_0x230526['available'],'loggedIn':_0x230526['loggedIn'],'name':_0x230526[_0xe287('0x55')],'paused':_0x230526['paused'],'waiting':_0x230526[_0xe287('0x57')]};_0xf7c1a[_0xe287('0x21')](_0x10f5fa);}}_0x53eb2c({'count':_0xf7c1a[_0xe287('0x19')],'rows':_0xf7c1a});});},'WhatsappQueues':function(){return new Promise(function(_0x367737){var _0x4bf17f=[];for(var _0x180255 in _0x2d2b48[_0xe287('0x5d')]){if(_0x2d2b48[_0xe287('0x5d')]['hasOwnProperty'](_0x180255)){var _0x311af0=_0x2d2b48['whatsappQueues'][_0x180255];var _0xa280ae={'id':_0x311af0['id'],'available':_0x311af0[_0xe287('0x59')],'loggedIn':_0x311af0[_0xe287('0x54')],'name':_0x311af0['name'],'paused':_0x311af0[_0xe287('0x56')],'waiting':_0x311af0[_0xe287('0x57')]};_0x4bf17f[_0xe287('0x21')](_0xa280ae);}}_0x367737({'count':_0x4bf17f[_0xe287('0x19')],'rows':_0x4bf17f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x48560c){var _0x4b63c3=_['values'](_0x2d2b48[_0xe287('0x5e')]);_0x48560c({'count':_0x4b63c3['length'],'rows':_0x4b63c3});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5b698c){var _0x5450c1=_[_0xe287('0x51')](_0x2d2b48[_0xe287('0x5f')]);_0x5b698c({'count':_0x5450c1[_0xe287('0x19')],'rows':_0x5450c1});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4b424f){var _0xfecd74=_[_0xe287('0x51')](_0x2d2b48[_0xe287('0x60')]);_0x4b424f({'count':_0xfecd74[_0xe287('0x19')],'rows':_0xfecd74});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x51f0e7){var _0x327a06=_['values'](_0x2d2b48[_0xe287('0x61')]);_0x51f0e7({'count':_0x327a06[_0xe287('0x19')],'rows':_0x327a06});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4b4674){var _0x388fc9=_['values'](_0x2d2b48[_0xe287('0x62')]);_0x4b4674({'count':_0x388fc9[_0xe287('0x19')],'rows':_0x388fc9});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1f14d0){var _0x27a591=_[_0xe287('0x51')](_0x2d2b48['whatsappQueuesWaitingInteractions']);_0x1f14d0({'count':_0x27a591[_0xe287('0x19')],'rows':_0x27a591});});}};var _0x49016e=jayson[_0xe287('0x63')](_0x298641)[_0xe287('0x64')]();_0x49016e['on']('error',function(_0x2c67cd){logger[_0xe287('0x37')](JSON['stringify'](_0x2c67cd));return _0x497f73(_0x2c67cd);});_0x49016e[_0xe287('0x13')](0x232c,_0xe287('0x65'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x279281(_0xe287('0x66')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index d84d0e4..a2c6d68 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 _0x1f72=['iftime','routing','condition','rules','info','map','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','stop','lodash','../../../utils/iftime'];(function(_0x1d0a6e,_0x22e059){var _0x2412dc=function(_0x45c9dd){while(--_0x45c9dd){_0x1d0a6e['push'](_0x1d0a6e['shift']());}};_0x2412dc(++_0x22e059);}(_0x1f72,0xc1));var _0x21f7=function(_0x42fe0c,_0x43a3d9){_0x42fe0c=_0x42fe0c-0x0;var _0x57b35b=_0x1f72[_0x42fe0c];return _0x57b35b;};'use strict';var _=require(_0x21f7('0x0'));var iftime=require(_0x21f7('0x1'))[_0x21f7('0x2')];var logger=require('../../../config/logger')(_0x21f7('0x3'));exports[_0x21f7('0x4')]=function(_0x17ce8c,_0x3d0536,_0x2ef43e){return function(_0x5ef08e){if(_0x2ef43e['rules']&&!_0x2ef43e[_0x21f7('0x5')][_0x17ce8c]){logger[_0x21f7('0x6')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x17ce8c);return _0x5ef08e['stop']();}var _0xa01d9d=_0x3d0536[_0x21f7('0x7')](function(_0x1f6da3){return iftime(_0x1f6da3);});var _0x56c98e=_['some'](_0xa01d9d);if(_0x56c98e){logger[_0x21f7('0x6')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x17ce8c,_0x3d0536[_0x21f7('0x8')](_0x21f7('0x9')),_0x56c98e);_0x5ef08e[_0x21f7('0xa')](_0x56c98e);}else{logger[_0x21f7('0x6')](_0x21f7('0xb'),_0x17ce8c,_0x3d0536['join'](_0x21f7('0x9')));_0x5ef08e[_0x21f7('0xc')]();}};}; \ No newline at end of file +var _0xdffc=['stop','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xdffc,0x1a7));var _0xcdff=function(_0x1eba6a,_0x332c64){_0x1eba6a=_0x1eba6a-0x0;var _0x2d36e1=_0xdffc[_0x1eba6a];return _0x2d36e1;};'use strict';var _=require(_0xcdff('0x0'));var iftime=require(_0xcdff('0x1'))[_0xcdff('0x2')];var logger=require(_0xcdff('0x3'))(_0xcdff('0x4'));exports[_0xcdff('0x5')]=function(_0x42e715,_0x57f348,_0x407bba){return function(_0xbc1eef){if(_0x407bba[_0xcdff('0x6')]&&!_0x407bba['rules'][_0x42e715]){logger[_0xcdff('0x7')](_0xcdff('0x8'),_0x42e715);return _0xbc1eef[_0xcdff('0x9')]();}var _0x4de2be=_0x57f348['map'](function(_0x38b919){return iftime(_0x38b919);});var _0x1b6f96=_[_0xcdff('0xa')](_0x4de2be);if(_0x1b6f96){logger[_0xcdff('0x7')](_0xcdff('0xb'),_0x42e715,_0x57f348[_0xcdff('0xc')](_0xcdff('0xd')),_0x1b6f96);_0xbc1eef[_0xcdff('0xe')](_0x1b6f96);}else{logger['info'](_0xcdff('0xf'),_0x42e715,_0x57f348[_0xcdff('0xc')](_0xcdff('0xd')));_0xbc1eef['stop']();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 1d7082d..ceb22e0 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 _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x78898f,_0x151a7c){var _0x56edd4=function(_0x331878){while(--_0x331878){_0x78898f['push'](_0x78898f['shift']());}};_0x56edd4(++_0x151a7c);}(_0xb9a7,0x112));var _0x7b9a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xb9a7[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file +var _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x56c7c0,_0x463d97){var _0x666b9a=function(_0x56e4a5){while(--_0x56e4a5){_0x56c7c0['push'](_0x56c7c0['shift']());}};_0x666b9a(++_0x463d97);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index d64a836..10aab4a 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 _0x5a84=['linkedid','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','set','toLowerCase','cdr','appdata','substring','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','exten','context','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime'];(function(_0x32f6c6,_0x128d6a){var _0x488308=function(_0x5f0c68){while(--_0x5f0c68){_0x32f6c6['push'](_0x32f6c6['shift']());}};_0x488308(++_0x128d6a);}(_0x5a84,0x184));var _0x45a8=function(_0x341d94,_0x5638a7){_0x341d94=_0x341d94-0x0;var _0x2eacd9=_0x5a84[_0x341d94];return _0x2eacd9;};'use strict';var _=require(_0x45a8('0x0'));var util=require('util');var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0x45a8('0x1'),'FAILED','NO\x20ANSWER',_0x45a8('0x2'),'NO\x20ANSWER',_0x45a8('0x3'),_0x45a8('0x4'),_0x45a8('0x1'),_0x45a8('0x1'),_0x45a8('0x1')];var channels={};function writeDB(_0x4f8717){utils[_0x45a8('0x5')](util[_0x45a8('0x6')](_0x45a8('0x7'),_0x4f8717[_0x45a8('0x8')],_0x4f8717['channel'],_0x4f8717[_0x45a8('0x9')],_0x4f8717[_0x45a8('0xa')],_0x4f8717[_0x45a8('0xb')],_0x4f8717[_0x45a8('0xc')],_0x4f8717[_0x45a8('0xd')],_0x4f8717[_0x45a8('0xe')]));if(_0x4f8717[_0x45a8('0xf')]){utils['getUserByInternal'](_0x4f8717[_0x45a8('0xf')])[_0x45a8('0x10')](function(_0x4d474e){if(_0x4d474e){_0x4f8717['UserId']=_0x4d474e['id'];}utils[_0x45a8('0x11')](_0x45a8('0x12'),_0x4f8717);});}else{utils['request']('CreateVoiceCallReport',_0x4f8717);}if(channels[_0x4f8717[_0x45a8('0x8')]]){delete channels[_0x4f8717['uniqueid']];}}exports['newchannel']=function(_0x27ea92){try{utils[_0x45a8('0x13')](util['format'](_0x45a8('0x14'),_0x27ea92['uniqueid']),_0x27ea92);if(_0x27ea92[_0x45a8('0x8')]==_0x27ea92['linkedid']&&_0x27ea92[_0x45a8('0x15')]!=_0x45a8('0x16')){utils[_0x45a8('0x5')](util[_0x45a8('0x6')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x27ea92[_0x45a8('0x8')],_0x27ea92['context'],_0x27ea92[_0x45a8('0x17')]));channels[_0x27ea92[_0x45a8('0x8')]]={'uniqueid':_0x27ea92[_0x45a8('0x8')],'accountcode':_0x27ea92[_0x45a8('0xf')],'source':_0x27ea92[_0x45a8('0xc')],'destination':_0x27ea92[_0x45a8('0x17')],'destinationcontext':_0x27ea92[_0x45a8('0x18')],'channel':_0x27ea92['channel'],'starttime':utils[_0x45a8('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x45a8('0x2'),'amaflags':_0x45a8('0x1a')};}}catch(_0x59f7c6){utils[_0x45a8('0x1b')](util[_0x45a8('0x6')]('[%s][calls][newchannel]',_0x27ea92['uniqueid']),_0x59f7c6);}};exports['newstate']=function(_0x30d8b7){try{utils[_0x45a8('0x13')](util[_0x45a8('0x6')](_0x45a8('0x1c'),_0x30d8b7[_0x45a8('0x8')]),_0x30d8b7);if(!_[_0x45a8('0x1d')](channels[_0x30d8b7[_0x45a8('0x8')]])&&_0x30d8b7['channelstate']==0x6){utils['info'](util[_0x45a8('0x6')](_0x45a8('0x1e'),_0x30d8b7[_0x45a8('0x8')],_0x30d8b7[_0x45a8('0x18')],_0x30d8b7[_0x45a8('0x15')]));if(_[_0x45a8('0x1d')](channels[_0x30d8b7['uniqueid']][_0x45a8('0x1f')])){channels[_0x30d8b7['uniqueid']]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x30d8b7[_0x45a8('0x20')]])&&_0x30d8b7[_0x45a8('0x21')]==0x6&&_0x30d8b7[_0x45a8('0x18')]!=_0x45a8('0x22')){utils[_0x45a8('0x5')](util['format'](_0x45a8('0x23'),_0x30d8b7[_0x45a8('0x8')],_0x30d8b7['linkedid'],_0x30d8b7[_0x45a8('0x18')],_0x30d8b7[_0x45a8('0x15')]));channels[_0x30d8b7[_0x45a8('0x20')]]['accountcode']=_0x30d8b7[_0x45a8('0xf')];channels[_0x30d8b7[_0x45a8('0x20')]]['destinationchannel']=_0x30d8b7[_0x45a8('0x15')];if(_['isNil'](channels[_0x30d8b7[_0x45a8('0x20')]][_0x45a8('0x24')])){channels[_0x30d8b7['linkedid']]['answertime']=utils[_0x45a8('0x19')]();}channels[_0x30d8b7[_0x45a8('0x20')]][_0x45a8('0x25')]=dispositions[_[_0x45a8('0x26')](_0x30d8b7[_0x45a8('0x21')])]||_0x45a8('0x3');}}catch(_0x250d1f){utils[_0x45a8('0x1b')](util[_0x45a8('0x6')](_0x45a8('0x1c'),_0x30d8b7[_0x45a8('0x8')]),_0x250d1f);}};exports[_0x45a8('0x27')]=function(_0x14246a){try{if(!_['isNil'](channels[_0x14246a[_0x45a8('0x8')]])){utils['debug'](util[_0x45a8('0x6')](_0x45a8('0x28'),_0x14246a[_0x45a8('0x8')]),_0x14246a);if(_[_0x45a8('0x1d')](channels[_0x14246a[_0x45a8('0x8')]][_0x45a8('0x29')])){channels[_0x14246a[_0x45a8('0x8')]][_0x45a8('0x29')]=_0x14246a[_0x45a8('0x2a')]+'\x20<'+_0x14246a[_0x45a8('0xc')]+'>';}utils[_0x45a8('0x5')](util['format'](_0x45a8('0x2b'),_0x14246a[_0x45a8('0x8')],channels[_0x14246a['uniqueid']]['callerid'],_0x14246a[_0x45a8('0x2c')]));channels[_0x14246a['uniqueid']][_0x45a8('0x2d')]=utils['now']();channels[_0x14246a['uniqueid']][_0x45a8('0x2e')]=utils[_0x45a8('0x2f')](channels[_0x14246a[_0x45a8('0x8')]]['endtime'],channels[_0x14246a[_0x45a8('0x8')]]['starttime']);channels[_0x14246a['uniqueid']][_0x45a8('0x30')]=channels[_0x14246a[_0x45a8('0x8')]]['answertime']?utils['diffTime'](channels[_0x14246a[_0x45a8('0x8')]][_0x45a8('0x2d')],channels[_0x14246a[_0x45a8('0x8')]][_0x45a8('0x24')]):0x0;writeDB(channels[_0x14246a[_0x45a8('0x8')]]);}}catch(_0x1d578f){utils[_0x45a8('0x1b')](util[_0x45a8('0x6')]('[%s][calls][hangup]',_0x14246a['uniqueid']),_0x1d578f);}};exports[_0x45a8('0x31')]=function(_0x21d25e){try{if(!_[_0x45a8('0x1d')](channels[_0x21d25e[_0x45a8('0x32')]])){utils[_0x45a8('0x13')](util[_0x45a8('0x6')]('[%s][calls][attendedtransfer]',_0x21d25e[_0x45a8('0x33')]),_0x21d25e);if(channels[_0x21d25e[_0x45a8('0x32')]][_0x45a8('0x15')]==_0x21d25e['transfereechannel']){utils['info'](util[_0x45a8('0x6')](_0x45a8('0x34'),_0x21d25e['origtransfereruniqueid'],_0x21d25e[_0x45a8('0x32')],_0x21d25e['secondtransfererchannel']));channels[_0x21d25e['localtwolinkedid']][_0x45a8('0x35')]=_0x21d25e['secondtransfererchannel'];channels[_0x21d25e[_0x45a8('0x32')]][_0x45a8('0x36')]=_0x45a8('0x37');}else if(channels[_0x21d25e[_0x45a8('0x32')]][_0x45a8('0x15')]=_0x21d25e[_0x45a8('0x38')]){utils['info'](util[_0x45a8('0x6')](_0x45a8('0x34'),_0x21d25e[_0x45a8('0x33')],_0x21d25e[_0x45a8('0x32')],_0x21d25e['origtransfererchannel']));channels[_0x21d25e['localtwolinkedid']][_0x45a8('0x35')]=_0x21d25e[_0x45a8('0x39')];channels[_0x21d25e[_0x45a8('0x32')]][_0x45a8('0x36')]=_0x45a8('0x37');}}}catch(_0x309f77){utils[_0x45a8('0x1b')](util['format'](_0x45a8('0x3a'),_0x21d25e['origtransfereruniqueid']),_0x309f77);}};exports['musiconholdstart']=function(_0x41f18a){try{if(!_[_0x45a8('0x1d')](channels[_0x41f18a[_0x45a8('0x8')]])){utils[_0x45a8('0x13')](util['format'](_0x45a8('0x3b'),_0x41f18a[_0x45a8('0x8')]),_0x41f18a);channels[_0x41f18a[_0x45a8('0x8')]][_0x45a8('0x3c')]=utils[_0x45a8('0x19')]();utils[_0x45a8('0x5')](util[_0x45a8('0x6')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x41f18a[_0x45a8('0x8')],channels[_0x41f18a[_0x45a8('0x8')]][_0x45a8('0x3c')]));}}catch(_0x8dd733){utils[_0x45a8('0x1b')](util['format'](_0x45a8('0x3b'),_0x41f18a[_0x45a8('0x8')]),_0x8dd733);}};exports[_0x45a8('0x3d')]=function(_0x46be5d){try{if(!_['isNil'](channels[_0x46be5d[_0x45a8('0x8')]])){utils[_0x45a8('0x13')](util['format']('[%s][calls][musiconholdstop]',_0x46be5d['uniqueid']),_0x46be5d);if(!_[_0x45a8('0x1d')](channels[_0x46be5d[_0x45a8('0x8')]]['musiconholdstartAt'])){channels[_0x46be5d[_0x45a8('0x8')]][_0x45a8('0x3e')]+=utils[_0x45a8('0x2f')](utils[_0x45a8('0x19')](),channels[_0x46be5d[_0x45a8('0x8')]]['musiconholdstartAt']);utils[_0x45a8('0x5')](util[_0x45a8('0x6')](_0x45a8('0x3f'),_0x46be5d[_0x45a8('0x8')],channels[_0x46be5d[_0x45a8('0x8')]][_0x45a8('0x3e')]));delete channels[_0x46be5d[_0x45a8('0x8')]][_0x45a8('0x3c')];}}}catch(_0x2d2c69){utils[_0x45a8('0x1b')](util[_0x45a8('0x6')](_0x45a8('0x40'),_0x46be5d[_0x45a8('0x8')]),_0x2d2c69);}};exports[_0x45a8('0x41')]=function(_0x5bf60b){try{if(!_['isNil'](channels[_0x5bf60b['uniqueid']])){utils['debug'](util['format'](_0x45a8('0x42'),_0x5bf60b[_0x45a8('0x8')]),_0x5bf60b);if(!_['isNil'](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x44')])){utils['info'](util[_0x45a8('0x6')](_0x45a8('0x45'),_0x5bf60b[_0x45a8('0x8')],_0x5bf60b[_0x45a8('0x46')]));channels[_0x5bf60b[_0x45a8('0x8')]][_0x45a8('0x47')]=_0x5bf60b[_0x45a8('0x46')];}if(!_['isNil'](_0x5bf60b[_0x45a8('0x43')]['xmd-phone'])){utils[_0x45a8('0x5')](util[_0x45a8('0x6')](_0x45a8('0x48'),_0x5bf60b[_0x45a8('0x8')],_0x5bf60b[_0x45a8('0x46')]));channels[_0x5bf60b['uniqueid']][_0x45a8('0x49')]=_0x5bf60b[_0x45a8('0x46')];channels[_0x5bf60b[_0x45a8('0x8')]][_0x45a8('0x29')]='\x22'+_0x5bf60b[_0x45a8('0x46')]+_0x45a8('0x4a')+_0x5bf60b[_0x45a8('0x46')]+'>';}if(!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x4b')])||!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x4c')])){utils[_0x45a8('0x5')](util[_0x45a8('0x6')](_0x45a8('0x4d'),_0x5bf60b[_0x45a8('0x8')],!_['isNil'](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x4b')])?_0x45a8('0x4b'):'xmd-callerid',_0x5bf60b['value']));channels[_0x5bf60b['uniqueid']][_0x45a8('0x29')]=_0x5bf60b[_0x45a8('0x46')];}if(!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x4e')])||!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x4f')])){utils['info'](util[_0x45a8('0x6')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5bf60b[_0x45a8('0x8')],!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x4e')])?_0x45a8('0x4e'):_0x45a8('0x4f'),_0x5bf60b['value']));channels[_0x5bf60b[_0x45a8('0x8')]][_0x45a8('0x50')]=_0x45a8('0x51');channels[_0x5bf60b[_0x45a8('0x8')]]['lastdata']=_0x5bf60b[_0x45a8('0x46')];channels[_0x5bf60b[_0x45a8('0x8')]][_0x45a8('0x9')]=!![];}if(!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x52')])){utils[_0x45a8('0x5')](util[_0x45a8('0x6')](_0x45a8('0x53'),_0x5bf60b[_0x45a8('0x8')],_0x5bf60b[_0x45a8('0x46')]));channels[_0x5bf60b[_0x45a8('0x8')]][_0x45a8('0x54')]=_0x5bf60b[_0x45a8('0x46')];}if(!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')][_0x45a8('0x55')])){utils['info'](util[_0x45a8('0x6')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5bf60b['uniqueid'],_0x5bf60b['value']));channels[_0x5bf60b[_0x45a8('0x8')]][_0x45a8('0x56')]=_0x5bf60b[_0x45a8('0x46')];}if(!_[_0x45a8('0x1d')](_0x5bf60b[_0x45a8('0x43')]['outboundrouteid'])){utils[_0x45a8('0x5')](util[_0x45a8('0x6')](_0x45a8('0x57'),_0x5bf60b[_0x45a8('0x8')],_0x5bf60b['value']));channels[_0x5bf60b['uniqueid']]['routeid']=_0x5bf60b[_0x45a8('0x46')];}if(!_[_0x45a8('0x1d')](_0x5bf60b['variable'][_0x45a8('0x58')])){utils[_0x45a8('0x5')](util['format'](_0x45a8('0x59'),_0x5bf60b[_0x45a8('0x8')],_0x5bf60b[_0x45a8('0x46')]));channels[_0x5bf60b[_0x45a8('0x8')]]['sipcallid']=_0x5bf60b[_0x45a8('0x46')];}}}catch(_0x1e2ec3){utils['error'](util[_0x45a8('0x6')]('[%s][calls][varset]',_0x5bf60b[_0x45a8('0x8')]),_0x1e2ec3);}};exports[_0x45a8('0x5a')]=function(_0x1fed45){try{if(!_[_0x45a8('0x1d')](channels[_0x1fed45[_0x45a8('0x8')]])){utils[_0x45a8('0x13')](util['format'](_0x45a8('0x5b'),_0x1fed45['uniqueid']),_0x1fed45);utils[_0x45a8('0x5')](util[_0x45a8('0x6')](_0x45a8('0x5c'),_0x1fed45[_0x45a8('0x8')],_0x1fed45[_0x45a8('0x5d')],_0x1fed45['appdata']));if(_0x1fed45[_0x45a8('0x5d')]['toLowerCase']()==_0x45a8('0x5e')&&_['startsWith'](_0x1fed45['appdata'][_0x45a8('0x5f')](),_0x45a8('0x60'))){var _0x62009b=_0x1fed45[_0x45a8('0x61')]['split']('=');var _0x187efe=_0x62009b[0x0][_0x45a8('0x62')](_0x62009b[0x0][_0x45a8('0x63')]('(')+0x1,_0x62009b[0x0][_0x45a8('0x63')](')'));var _0x2046e4=_0x62009b[0x1];channels[_0x1fed45['uniqueid']][_0x187efe]=_0x2046e4;}if(!_[_0x45a8('0x64')]([_0x45a8('0x27'),_0x45a8('0x65'),_0x45a8('0x66'),_0x45a8('0x5e'),_0x45a8('0x67')],_0x1fed45[_0x45a8('0x5d')][_0x45a8('0x5f')]())){channels[_0x1fed45[_0x45a8('0x8')]]['lastapplication']=_0x1fed45[_0x45a8('0x5d')];channels[_0x1fed45[_0x45a8('0x8')]][_0x45a8('0x68')]=_0x1fed45[_0x45a8('0x61')];}}}catch(_0x4063be){utils[_0x45a8('0x1b')](util[_0x45a8('0x6')](_0x45a8('0x5b'),_0x1fed45[_0x45a8('0x8')]),_0x4063be);}}; \ No newline at end of file +var _0x25bf=['destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','includes','gotoif','lodash','NO\x20ANSWER','FAILED','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','DOCUMENTATION','error','debug','isNil','channelstate','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','destinationchannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x25bf,0x155));var _0xf25b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x25bf[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf25b('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0xf25b('0x1'),'FAILED',_0xf25b('0x2'),_0xf25b('0x1'),_0xf25b('0x1'),'NO\x20ANSWER',_0xf25b('0x3'),'BUSY',_0xf25b('0x2'),_0xf25b('0x2'),_0xf25b('0x2')];var channels={};function writeDB(_0x177465){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x6'),_0x177465[_0xf25b('0x7')],_0x177465[_0xf25b('0x8')],_0x177465['queue'],_0x177465[_0xf25b('0x9')],_0x177465[_0xf25b('0xa')],_0x177465['calleridnum'],_0x177465['connectedlinenum'],_0x177465['lastevent']));if(_0x177465[_0xf25b('0xb')]){utils[_0xf25b('0xc')](_0x177465[_0xf25b('0xb')])[_0xf25b('0xd')](function(_0x390da5){if(_0x390da5){_0x177465[_0xf25b('0xe')]=_0x390da5['id'];}utils[_0xf25b('0xf')]('CreateVoiceCallReport',_0x177465);});}else{utils['request'](_0xf25b('0x10'),_0x177465);}if(channels[_0x177465[_0xf25b('0x7')]]){delete channels[_0x177465[_0xf25b('0x7')]];}}exports['newchannel']=function(_0x40646f){try{utils['debug'](util['format'](_0xf25b('0x11'),_0x40646f[_0xf25b('0x7')]),_0x40646f);if(_0x40646f[_0xf25b('0x7')]==_0x40646f[_0xf25b('0x12')]&&_0x40646f['channel']!=_0xf25b('0x13')){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x14'),_0x40646f['uniqueid'],_0x40646f[_0xf25b('0x15')],_0x40646f[_0xf25b('0x16')]));channels[_0x40646f[_0xf25b('0x7')]]={'uniqueid':_0x40646f[_0xf25b('0x7')],'accountcode':_0x40646f[_0xf25b('0xb')],'source':_0x40646f[_0xf25b('0x17')],'destination':_0x40646f[_0xf25b('0x16')],'destinationcontext':_0x40646f[_0xf25b('0x15')],'channel':_0x40646f['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf25b('0x1'),'amaflags':_0xf25b('0x18')};}}catch(_0x1a6675){utils[_0xf25b('0x19')](util['format'](_0xf25b('0x11'),_0x40646f[_0xf25b('0x7')]),_0x1a6675);}};exports['newstate']=function(_0x18eaf9){try{utils[_0xf25b('0x1a')](util['format']('[%s][calls][newstate]',_0x18eaf9['uniqueid']),_0x18eaf9);if(!_[_0xf25b('0x1b')](channels[_0x18eaf9[_0xf25b('0x7')]])&&_0x18eaf9[_0xf25b('0x1c')]==0x6){utils[_0xf25b('0x4')](util[_0xf25b('0x5')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x18eaf9[_0xf25b('0x7')],_0x18eaf9[_0xf25b('0x15')],_0x18eaf9['channel']));if(_[_0xf25b('0x1b')](channels[_0x18eaf9[_0xf25b('0x7')]][_0xf25b('0x1d')])){channels[_0x18eaf9[_0xf25b('0x7')]][_0xf25b('0x1d')]=utils[_0xf25b('0x1e')]();}}else if(!_[_0xf25b('0x1b')](channels[_0x18eaf9['linkedid']])&&_0x18eaf9['channelstate']==0x6&&_0x18eaf9['context']!=_0xf25b('0x1f')){utils['info'](util[_0xf25b('0x5')](_0xf25b('0x20'),_0x18eaf9['uniqueid'],_0x18eaf9['linkedid'],_0x18eaf9['context'],_0x18eaf9[_0xf25b('0x8')]));channels[_0x18eaf9[_0xf25b('0x12')]][_0xf25b('0xb')]=_0x18eaf9['accountcode'];channels[_0x18eaf9[_0xf25b('0x12')]]['destinationchannel']=_0x18eaf9[_0xf25b('0x8')];if(_[_0xf25b('0x1b')](channels[_0x18eaf9['linkedid']][_0xf25b('0x21')])){channels[_0x18eaf9[_0xf25b('0x12')]]['answertime']=utils['now']();}channels[_0x18eaf9[_0xf25b('0x12')]][_0xf25b('0x22')]=dispositions[_['toNumber'](_0x18eaf9[_0xf25b('0x1c')])]||'ANSWERED';}}catch(_0x57f4f1){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x23'),_0x18eaf9[_0xf25b('0x7')]),_0x57f4f1);}};exports[_0xf25b('0x24')]=function(_0x2ce29c){try{if(!_[_0xf25b('0x1b')](channels[_0x2ce29c[_0xf25b('0x7')]])){utils[_0xf25b('0x1a')](util['format']('[%s][calls][hangup]',_0x2ce29c[_0xf25b('0x7')]),_0x2ce29c);if(_[_0xf25b('0x1b')](channels[_0x2ce29c['uniqueid']]['callerid'])){channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x25')]=_0x2ce29c[_0xf25b('0x26')]+'\x20<'+_0x2ce29c[_0xf25b('0x17')]+'>';}utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x27'),_0x2ce29c['uniqueid'],channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x25')],_0x2ce29c['cause-txt']));channels[_0x2ce29c['uniqueid']][_0xf25b('0x28')]=utils['now']();channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x29')]=utils[_0xf25b('0x2a')](channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x28')],channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x2b')]);channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x2c')]=channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x21')]?utils[_0xf25b('0x2a')](channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x28')],channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x21')]):0x0;writeDB(channels[_0x2ce29c[_0xf25b('0x7')]]);}}catch(_0x1402d1){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x2d'),_0x2ce29c['uniqueid']),_0x1402d1);}};exports['attendedtransfer']=function(_0x54a9c3){try{if(!_[_0xf25b('0x1b')](channels[_0x54a9c3[_0xf25b('0x2e')]])){utils['debug'](util[_0xf25b('0x5')](_0xf25b('0x2f'),_0x54a9c3['origtransfereruniqueid']),_0x54a9c3);if(channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x8')]==_0x54a9c3[_0xf25b('0x30')]){utils[_0xf25b('0x4')](util['format'](_0xf25b('0x31'),_0x54a9c3[_0xf25b('0x32')],_0x54a9c3[_0xf25b('0x2e')],_0x54a9c3['secondtransfererchannel']));channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x33')]=_0x54a9c3[_0xf25b('0x34')];channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x35')]=_0xf25b('0x36');}else if(channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x8')]=_0x54a9c3[_0xf25b('0x37')]){utils['info'](util[_0xf25b('0x5')](_0xf25b('0x31'),_0x54a9c3[_0xf25b('0x32')],_0x54a9c3[_0xf25b('0x2e')],_0x54a9c3['origtransfererchannel']));channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x33')]=_0x54a9c3[_0xf25b('0x38')];channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x35')]=_0xf25b('0x36');}}}catch(_0x3b65a2){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x2f'),_0x54a9c3[_0xf25b('0x32')]),_0x3b65a2);}};exports['musiconholdstart']=function(_0x37a7ec){try{if(!_[_0xf25b('0x1b')](channels[_0x37a7ec[_0xf25b('0x7')]])){utils[_0xf25b('0x1a')](util[_0xf25b('0x5')](_0xf25b('0x39'),_0x37a7ec[_0xf25b('0x7')]),_0x37a7ec);channels[_0x37a7ec[_0xf25b('0x7')]]['musiconholdstartAt']=utils[_0xf25b('0x1e')]();utils[_0xf25b('0x4')](util['format'](_0xf25b('0x3a'),_0x37a7ec[_0xf25b('0x7')],channels[_0x37a7ec[_0xf25b('0x7')]]['musiconholdstartAt']));}}catch(_0x15801e){utils[_0xf25b('0x19')](util['format'](_0xf25b('0x39'),_0x37a7ec[_0xf25b('0x7')]),_0x15801e);}};exports[_0xf25b('0x3b')]=function(_0x52276d){try{if(!_['isNil'](channels[_0x52276d[_0xf25b('0x7')]])){utils['debug'](util[_0xf25b('0x5')](_0xf25b('0x3c'),_0x52276d[_0xf25b('0x7')]),_0x52276d);if(!_['isNil'](channels[_0x52276d['uniqueid']][_0xf25b('0x3d')])){channels[_0x52276d[_0xf25b('0x7')]]['mohtime']+=utils['diffTime'](utils[_0xf25b('0x1e')](),channels[_0x52276d[_0xf25b('0x7')]][_0xf25b('0x3d')]);utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x3e'),_0x52276d[_0xf25b('0x7')],channels[_0x52276d[_0xf25b('0x7')]][_0xf25b('0x3f')]));delete channels[_0x52276d[_0xf25b('0x7')]]['musiconholdstartAt'];}}}catch(_0x46ef99){utils['error'](util[_0xf25b('0x5')]('[%s][calls][musiconholdstop]',_0x52276d[_0xf25b('0x7')]),_0x46ef99);}};exports[_0xf25b('0x40')]=function(_0xdb3342){try{if(!_['isNil'](channels[_0xdb3342[_0xf25b('0x7')]])){utils[_0xf25b('0x1a')](util[_0xf25b('0x5')]('[%s][calls][varset]',_0xdb3342[_0xf25b('0x7')]),_0xdb3342);if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x42')])){utils['info'](util[_0xf25b('0x5')](_0xf25b('0x43'),_0xdb3342['uniqueid'],_0xdb3342['value']));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x44')]=_0xdb3342[_0xf25b('0x45')];}if(!_['isNil'](_0xdb3342[_0xf25b('0x41')]['xmd-phone'])){utils['info'](util['format'](_0xf25b('0x46'),_0xdb3342[_0xf25b('0x7')],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x47')]=_0xdb3342[_0xf25b('0x45')];channels[_0xdb3342[_0xf25b('0x7')]]['callerid']='\x22'+_0xdb3342['value']+_0xf25b('0x48')+_0xdb3342[_0xf25b('0x45')]+'>';}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x49')])||!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x4a')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x4b'),_0xdb3342['uniqueid'],!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')]['xmd-callerid-preview'])?_0xf25b('0x49'):_0xf25b('0x4a'),_0xdb3342['value']));channels[_0xdb3342[_0xf25b('0x7')]]['callerid']=_0xdb3342[_0xf25b('0x45')];}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')]['xmd-queue'])||!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x4c')])){utils['info'](util[_0xf25b('0x5')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xdb3342[_0xf25b('0x7')],!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x4d')])?'xmd-queue':_0xf25b('0x4c'),_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x4e')]=_0xf25b('0x4f');channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x50')]=_0xdb3342[_0xf25b('0x45')];channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x51')]=!![];}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x52')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x53'),_0xdb3342[_0xf25b('0x7')],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x54')]=_0xdb3342[_0xf25b('0x45')];}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x55')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xdb3342['uniqueid'],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x56')]=_0xdb3342[_0xf25b('0x45')];}if(!_['isNil'](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x57')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x58'),_0xdb3342['uniqueid'],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x59')]=_0xdb3342[_0xf25b('0x45')];}if(!_['isNil'](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x5a')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xdb3342[_0xf25b('0x7')],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342['uniqueid']][_0xf25b('0x5a')]=_0xdb3342[_0xf25b('0x45')];}}}catch(_0x195c47){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x5b'),_0xdb3342[_0xf25b('0x7')]),_0x195c47);}};exports[_0xf25b('0x5c')]=function(_0x155fca){try{if(!_[_0xf25b('0x1b')](channels[_0x155fca['uniqueid']])){utils[_0xf25b('0x1a')](util[_0xf25b('0x5')]('[%s][calls][newexten]',_0x155fca[_0xf25b('0x7')]),_0x155fca);utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x5d'),_0x155fca[_0xf25b('0x7')],_0x155fca[_0xf25b('0x5e')],_0x155fca[_0xf25b('0x5f')]));if(_0x155fca[_0xf25b('0x5e')][_0xf25b('0x60')]()==_0xf25b('0x61')&&_[_0xf25b('0x62')](_0x155fca[_0xf25b('0x5f')][_0xf25b('0x60')](),'cdr')){var _0x3705c1=_0x155fca[_0xf25b('0x5f')]['split']('=');var _0x46419b=_0x3705c1[0x0][_0xf25b('0x63')](_0x3705c1[0x0][_0xf25b('0x64')]('(')+0x1,_0x3705c1[0x0][_0xf25b('0x64')](')'));var _0x1ec394=_0x3705c1[0x1];channels[_0x155fca[_0xf25b('0x7')]][_0x46419b]=_0x1ec394;}if(!_[_0xf25b('0x65')](['hangup','noop','execif','set',_0xf25b('0x66')],_0x155fca[_0xf25b('0x5e')]['toLowerCase']())){channels[_0x155fca[_0xf25b('0x7')]][_0xf25b('0x4e')]=_0x155fca[_0xf25b('0x5e')];channels[_0x155fca['uniqueid']]['lastdata']=_0x155fca['appdata'];}}}catch(_0x4060b7){utils[_0xf25b('0x19')](util[_0xf25b('0x5')]('[%s][calls][newexten]',_0x155fca[_0xf25b('0x7')]),_0x4060b7);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 634d539..9822638 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 _0x0f95=['[core]\x20error','close','[core]\x20close','managerevent','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x0f95,0x1f0));var _0x50f9=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x0f95[_0x51b0dc];return _0x13fa89;};'use strict';var utils=require(_0x50f9('0x0'));exports['connect']=function(){utils[_0x50f9('0x1')](_0x50f9('0x2'));};exports[_0x50f9('0x3')]=function(){utils['info'](_0x50f9('0x4'));};exports[_0x50f9('0x5')]=function(){utils[_0x50f9('0x1')](_0x50f9('0x6'));};exports['error']=function(_0x1486e9){utils[_0x50f9('0x7')](_0x50f9('0x8'),_0x1486e9);};exports[_0x50f9('0x9')]=function(){utils['info'](_0x50f9('0xa'));};exports[_0x50f9('0xb')]=function(_0x65caff){}; \ No newline at end of file +var _0x3a94=['[core]\x20close','./utils','connect','[core]\x20connected','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close'];(function(_0x38605a,_0xf8d5e5){var _0x2221f4=function(_0x3e3fa9){while(--_0x3e3fa9){_0x38605a['push'](_0x38605a['shift']());}};_0x2221f4(++_0xf8d5e5);}(_0x3a94,0x105));var _0x43a9=function(_0x464be4,_0x473a1e){_0x464be4=_0x464be4-0x0;var _0x4c597c=_0x3a94[_0x464be4];return _0x4c597c;};'use strict';var utils=require(_0x43a9('0x0'));exports[_0x43a9('0x1')]=function(){utils['info'](_0x43a9('0x2'));};exports['shutdown']=function(){utils[_0x43a9('0x3')](_0x43a9('0x4'));};exports[_0x43a9('0x5')]=function(){utils['info'](_0x43a9('0x6'));};exports[_0x43a9('0x7')]=function(_0x51fcea){utils[_0x43a9('0x7')]('[core]\x20error',_0x51fcea);};exports[_0x43a9('0x8')]=function(){utils[_0x43a9('0x3')](_0x43a9('0x9'));};exports['managerevent']=function(_0x4d266d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 93979d6..6f92592 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 _0x1a06=['[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','endtime','holdtime','billableseconds','diffTime','[%s][dials][hangup]','lodash','util','./utils','info','format','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset'];(function(_0x3d418b,_0x1b1905){var _0x8f1831=function(_0x3d44cf){while(--_0x3d44cf){_0x3d418b['push'](_0x3d418b['shift']());}};_0x8f1831(++_0x1b1905);}(_0x1a06,0x173));var _0x61a0=function(_0x3fb0c0,_0x247d45){_0x3fb0c0=_0x3fb0c0-0x0;var _0x28085c=_0x1a06[_0x3fb0c0];return _0x28085c;};'use strict';var _=require(_0x61a0('0x0'));var util=require(_0x61a0('0x1'));var utils=require(_0x61a0('0x2'));var dials={};function writeDB(_0x24b30e){utils[_0x61a0('0x3')](util[_0x61a0('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x24b30e[_0x61a0('0x5')],_0x24b30e['channel'],_0x24b30e[_0x61a0('0x6')],_0x24b30e[_0x61a0('0x7')],_0x24b30e[_0x61a0('0x8')],_0x24b30e[_0x61a0('0x9')]));utils[_0x61a0('0xa')]('CreateVoiceDialReport',_0x24b30e);delete dials[_0x24b30e['uniqueid']];}exports['newexten']=function(_0x4e78c5){try{utils[_0x61a0('0xb')](util[_0x61a0('0x4')](_0x61a0('0xc'),_0x4e78c5['uniqueid']),_0x4e78c5);utils[_0x61a0('0x3')](util['format'](_0x61a0('0xd'),_0x4e78c5[_0x61a0('0x5')],_0x4e78c5['application'],_0x4e78c5[_0x61a0('0xe')]));if(_0x4e78c5['application'][_0x61a0('0xf')]()==_0x61a0('0x10')&&_[_0x61a0('0x11')](_0x4e78c5[_0x61a0('0xe')]['toLowerCase'](),_0x61a0('0x12'))){var _0x53086b=_0x4e78c5['appdata']['split']('=');dials[_0x4e78c5[_0x61a0('0x5')]]={'routeId':_0x53086b[0x1]};}}catch(_0x1bd01b){utils[_0x61a0('0x13')](util[_0x61a0('0x4')](_0x61a0('0xc'),_0x4e78c5[_0x61a0('0x5')]),_0x1bd01b);}};exports[_0x61a0('0x14')]=function(_0xb2de54){try{utils['debug'](util[_0x61a0('0x4')](_0x61a0('0x15'),_0xb2de54[_0x61a0('0x5')]),_0xb2de54);if(!_[_0x61a0('0x16')](_0xb2de54[_0x61a0('0x17')][_0x61a0('0x18')])){utils[_0x61a0('0x3')](util['format'](_0x61a0('0x19'),_0xb2de54['uniqueid'],_0xb2de54[_0x61a0('0x1a')]));dials[_0xb2de54[_0x61a0('0x5')]]={'routeId':_0xb2de54[_0x61a0('0x1a')]};}}catch(_0x46ea8e){utils[_0x61a0('0x13')](util[_0x61a0('0x4')](_0x61a0('0x15'),_0xb2de54[_0x61a0('0x5')]),_0x46ea8e);}};exports[_0x61a0('0x1b')]=function(_0xe4bfa7){try{if(!_[_0x61a0('0x16')](dials[_0xe4bfa7[_0x61a0('0x5')]])){utils['debug'](util[_0x61a0('0x4')](_0x61a0('0x1c'),_0xe4bfa7[_0x61a0('0x5')]),_0xe4bfa7);dials[_0xe4bfa7[_0x61a0('0x5')]]=_[_0x61a0('0x1d')](dials[_0xe4bfa7[_0x61a0('0x5')]],_0xe4bfa7);dials[_0xe4bfa7['uniqueid']][_0x61a0('0x1e')]=utils[_0x61a0('0x1f')]();dials[_0xe4bfa7[_0x61a0('0x5')]][_0x61a0('0x20')]='called';utils[_0x61a0('0x3')](util[_0x61a0('0x4')](_0x61a0('0x21'),_0xe4bfa7[_0x61a0('0x5')],dials[_0xe4bfa7[_0x61a0('0x5')]][_0x61a0('0x1e')]));}}catch(_0x1b14e0){utils['error'](util[_0x61a0('0x4')](_0x61a0('0x1c'),_0xe4bfa7[_0x61a0('0x5')]),_0x1b14e0);}};exports[_0x61a0('0x22')]=function(_0x280eb7){try{if(!_[_0x61a0('0x16')](dials[_0x280eb7[_0x61a0('0x5')]])){utils[_0x61a0('0xb')](util['format']('[%s][dials][dialend]',_0x280eb7[_0x61a0('0x5')]),_0x280eb7);dials[_0x280eb7[_0x61a0('0x5')]]['dialstatus']=_0x280eb7[_0x61a0('0x9')];if(_0x280eb7['dialstatus']=='ANSWER'){dials[_0x280eb7[_0x61a0('0x5')]]=_[_0x61a0('0x1d')](dials[_0x280eb7[_0x61a0('0x5')]],_0x280eb7);dials[_0x280eb7['uniqueid']]['answertime']=utils['now']();dials[_0x280eb7[_0x61a0('0x5')]][_0x61a0('0x20')]=_0x61a0('0x23');utils[_0x61a0('0x3')](util['format'](_0x61a0('0x24'),_0x280eb7[_0x61a0('0x5')],_0x280eb7[_0x61a0('0x9')],dials[_0x280eb7['uniqueid']][_0x61a0('0x25')]));}else{utils[_0x61a0('0x3')](util['format'](_0x61a0('0x26'),_0x280eb7[_0x61a0('0x5')],_0x280eb7[_0x61a0('0x9')]));}}}catch(_0x4fcede){utils[_0x61a0('0x13')](util[_0x61a0('0x4')](_0x61a0('0x27'),_0x280eb7['uniqueid']),_0x4fcede);}};exports['hangup']=function(_0x39f3d0){try{if(!_[_0x61a0('0x16')](dials[_0x39f3d0[_0x61a0('0x5')]])){utils[_0x61a0('0xb')](util['format']('[%s][dials][hangup]',_0x39f3d0[_0x61a0('0x5')]),_0x39f3d0);utils[_0x61a0('0x3')](util[_0x61a0('0x4')](_0x61a0('0x28'),_0x39f3d0[_0x61a0('0x5')],_0x39f3d0[_0x61a0('0x7')],_0x39f3d0[_0x61a0('0x29')],_0x39f3d0[_0x61a0('0x2a')]));dials[_0x39f3d0['uniqueid']]=_[_0x61a0('0x1d')](dials[_0x39f3d0['uniqueid']],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x2b')]=utils['diffTime'](dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x2c')],dials[_0x39f3d0['uniqueid']][_0x61a0('0x1e')]);dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x2d')]=utils['diffTime'](dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x25')]||dials[_0x39f3d0['uniqueid']][_0x61a0('0x2c')],dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x1e')]);dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x2e')]=dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x25')]?utils[_0x61a0('0x2f')](dials[_0x39f3d0['uniqueid']][_0x61a0('0x2c')],dials[_0x39f3d0[_0x61a0('0x5')]][_0x61a0('0x25')]):0x0;writeDB(dials[_0x39f3d0[_0x61a0('0x5')]]);}}catch(_0x2f9b22){utils[_0x61a0('0x13')](util[_0x61a0('0x4')](_0x61a0('0x30'),_0x39f3d0['uniqueid']),_0x2f9b22);}}; \ No newline at end of file +var _0x419b=['split','error','varset','[%s][dials][varset]','isNil','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)'];(function(_0x1dcb7b,_0x44cc17){var _0x1e7ff7=function(_0x5e2971){while(--_0x5e2971){_0x1dcb7b['push'](_0x1dcb7b['shift']());}};_0x1e7ff7(++_0x44cc17);}(_0x419b,0x150));var _0xb419=function(_0x27f53b,_0x7d7bc){_0x27f53b=_0x27f53b-0x0;var _0x4d5aa7=_0x419b[_0x27f53b];return _0x4d5aa7;};'use strict';var _=require(_0xb419('0x0'));var util=require(_0xb419('0x1'));var utils=require(_0xb419('0x2'));var dials={};function writeDB(_0xd2368b){utils['info'](util[_0xb419('0x3')](_0xb419('0x4'),_0xd2368b[_0xb419('0x5')],_0xd2368b[_0xb419('0x6')],_0xd2368b[_0xb419('0x7')],_0xd2368b[_0xb419('0x8')],_0xd2368b[_0xb419('0x9')],_0xd2368b[_0xb419('0xa')]));utils['request'](_0xb419('0xb'),_0xd2368b);delete dials[_0xd2368b['uniqueid']];}exports[_0xb419('0xc')]=function(_0x1ac981){try{utils[_0xb419('0xd')](util[_0xb419('0x3')](_0xb419('0xe'),_0x1ac981[_0xb419('0x5')]),_0x1ac981);utils['info'](util[_0xb419('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1ac981[_0xb419('0x5')],_0x1ac981[_0xb419('0xf')],_0x1ac981[_0xb419('0x10')]));if(_0x1ac981[_0xb419('0xf')][_0xb419('0x11')]()==_0xb419('0x12')&&_[_0xb419('0x13')](_0x1ac981[_0xb419('0x10')][_0xb419('0x11')](),_0xb419('0x14'))){var _0x508898=_0x1ac981[_0xb419('0x10')][_0xb419('0x15')]('=');dials[_0x1ac981[_0xb419('0x5')]]={'routeId':_0x508898[0x1]};}}catch(_0x557113){utils[_0xb419('0x16')](util[_0xb419('0x3')](_0xb419('0xe'),_0x1ac981[_0xb419('0x5')]),_0x557113);}};exports[_0xb419('0x17')]=function(_0x346e92){try{utils[_0xb419('0xd')](util[_0xb419('0x3')](_0xb419('0x18'),_0x346e92['uniqueid']),_0x346e92);if(!_[_0xb419('0x19')](_0x346e92['variable']['outboundrouteid'])){utils[_0xb419('0x1a')](util['format'](_0xb419('0x1b'),_0x346e92[_0xb419('0x5')],_0x346e92[_0xb419('0x1c')]));dials[_0x346e92['uniqueid']]={'routeId':_0x346e92['value']};}}catch(_0x13fcd){utils[_0xb419('0x16')](util['format'](_0xb419('0x18'),_0x346e92[_0xb419('0x5')]),_0x13fcd);}};exports['dialbegin']=function(_0x2eb854){try{if(!_[_0xb419('0x19')](dials[_0x2eb854['uniqueid']])){utils[_0xb419('0xd')](util['format'](_0xb419('0x1d'),_0x2eb854[_0xb419('0x5')]),_0x2eb854);dials[_0x2eb854[_0xb419('0x5')]]=_[_0xb419('0x1e')](dials[_0x2eb854[_0xb419('0x5')]],_0x2eb854);dials[_0x2eb854[_0xb419('0x5')]]['starttime']=utils[_0xb419('0x1f')]();dials[_0x2eb854[_0xb419('0x5')]]['lastevent']=_0xb419('0x20');utils[_0xb419('0x1a')](util['format'](_0xb419('0x21'),_0x2eb854['uniqueid'],dials[_0x2eb854[_0xb419('0x5')]][_0xb419('0x22')]));}}catch(_0x1ada0c){utils[_0xb419('0x16')](util[_0xb419('0x3')](_0xb419('0x1d'),_0x2eb854[_0xb419('0x5')]),_0x1ada0c);}};exports[_0xb419('0x23')]=function(_0x4561bf){try{if(!_[_0xb419('0x19')](dials[_0x4561bf[_0xb419('0x5')]])){utils[_0xb419('0xd')](util['format'](_0xb419('0x24'),_0x4561bf[_0xb419('0x5')]),_0x4561bf);dials[_0x4561bf[_0xb419('0x5')]][_0xb419('0xa')]=_0x4561bf[_0xb419('0xa')];if(_0x4561bf[_0xb419('0xa')]==_0xb419('0x25')){dials[_0x4561bf[_0xb419('0x5')]]=_[_0xb419('0x1e')](dials[_0x4561bf['uniqueid']],_0x4561bf);dials[_0x4561bf[_0xb419('0x5')]]['answertime']=utils[_0xb419('0x1f')]();dials[_0x4561bf[_0xb419('0x5')]]['lastevent']=_0xb419('0x26');utils[_0xb419('0x1a')](util[_0xb419('0x3')](_0xb419('0x27'),_0x4561bf['uniqueid'],_0x4561bf[_0xb419('0xa')],dials[_0x4561bf[_0xb419('0x5')]][_0xb419('0x28')]));}else{utils['info'](util[_0xb419('0x3')](_0xb419('0x29'),_0x4561bf[_0xb419('0x5')],_0x4561bf[_0xb419('0xa')]));}}}catch(_0xc69df2){utils[_0xb419('0x16')](util[_0xb419('0x3')](_0xb419('0x24'),_0x4561bf['uniqueid']),_0xc69df2);}};exports['hangup']=function(_0x23a6d5){try{if(!_[_0xb419('0x19')](dials[_0x23a6d5[_0xb419('0x5')]])){utils[_0xb419('0xd')](util[_0xb419('0x3')](_0xb419('0x2a'),_0x23a6d5[_0xb419('0x5')]),_0x23a6d5);utils[_0xb419('0x1a')](util[_0xb419('0x3')](_0xb419('0x2b'),_0x23a6d5[_0xb419('0x5')],_0x23a6d5['calleridnum'],_0x23a6d5['calleridname'],_0x23a6d5[_0xb419('0x2c')]));dials[_0x23a6d5[_0xb419('0x5')]]=_[_0xb419('0x1e')](dials[_0x23a6d5[_0xb419('0x5')]],{'endtime':utils[_0xb419('0x1f')](),'lastevent':_0xb419('0x2d')});dials[_0x23a6d5['uniqueid']][_0xb419('0x2e')]=utils[_0xb419('0x2f')](dials[_0x23a6d5['uniqueid']][_0xb419('0x30')],dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x22')]);dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x31')]=utils[_0xb419('0x2f')](dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x28')]||dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x30')],dials[_0x23a6d5['uniqueid']][_0xb419('0x22')]);dials[_0x23a6d5['uniqueid']][_0xb419('0x32')]=dials[_0x23a6d5['uniqueid']][_0xb419('0x28')]?utils[_0xb419('0x2f')](dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x30')],dials[_0x23a6d5['uniqueid']]['answertime']):0x0;writeDB(dials[_0x23a6d5[_0xb419('0x5')]]);}}catch(_0x56a491){utils[_0xb419('0x16')](util['format'](_0xb419('0x2a'),_0x23a6d5[_0xb419('0x5')]),_0x56a491);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 03f8906..d27799b 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 _0xd02c=['attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','username','asterisk','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./core.controller','connect','shutdown','error','close','managerevent','debug','format','device','devicestatechange','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd02c,0x97));var _0xcd02=function(_0x21fcef,_0x3aa2f5){_0x21fcef=_0x21fcef-0x0;var _0x46eb99=_0xd02c[_0x21fcef];return _0x46eb99;};var AsteriskManager=require(_0xcd02('0x0'));var config=require(_0xcd02('0x1'));var utils=require(_0xcd02('0x2'));var util=require(_0xcd02('0x3'));var isXDREnabled=config[_0xcd02('0x4')]&&config[_0xcd02('0x4')][_0xcd02('0x5')]?!config[_0xcd02('0x4')][_0xcd02('0x5')]:!![];var isProduction=config[_0xcd02('0x6')]===_0xcd02('0x7')||![];var isLocalAsterisk=config[_0xcd02('0x4')]&&config[_0xcd02('0x4')][_0xcd02('0x8')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xcd02('0x9')],config['asterisk']['ip'],config['asterisk'][_0xcd02('0xa')],config[_0xcd02('0xb')][_0xcd02('0xc')],!![]);ami[_0xcd02('0xd')]();if(!isXDREnabled){utils[_0xcd02('0xe')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xcd02('0xf'));}else{var agents=require(_0xcd02('0x10'));var calls=require(_0xcd02('0x11'));var queues=require(_0xcd02('0x12'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xcd02('0x13'));ami['on'](_0xcd02('0x14'),core[_0xcd02('0x14')]);ami['on'](_0xcd02('0x15'),core[_0xcd02('0x15')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0xcd02('0x16'),core[_0xcd02('0x16')]);ami['on'](_0xcd02('0x17'),core[_0xcd02('0x17')]);ami['on'](_0xcd02('0x18'),core['managerevent']);ami['on']('devicestatechange',function(_0x425ffc){try{utils[_0xcd02('0x19')](util[_0xcd02('0x1a')]('[%s][index][devicestatechange]',_0x425ffc[_0xcd02('0x1b')]),_0x425ffc);members[_0xcd02('0x1c')](_0x425ffc);}catch(_0x9dde0a){utils['error'](util[_0xcd02('0x1a')](_0xcd02('0x1d'),_0x425ffc[_0xcd02('0x1b')]),_0x9dde0a);}});ami['on']('agentcalled',function(_0x50134a){try{utils[_0xcd02('0x19')](util[_0xcd02('0x1a')](_0xcd02('0x1e'),_0x50134a[_0xcd02('0x1f')]),_0x50134a);agents[_0xcd02('0x20')](_0x50134a);}catch(_0x23b529){utils['error'](util[_0xcd02('0x1a')](_0xcd02('0x1e'),_0x50134a[_0xcd02('0x1f')]),_0x23b529);}});ami['on'](_0xcd02('0x21'),function(_0x35d10d){try{utils['debug'](util['format'](_0xcd02('0x22'),_0x35d10d[_0xcd02('0x1f')]),_0x35d10d);agents[_0xcd02('0x21')](_0x35d10d);}catch(_0xb4b7da){utils['error'](util[_0xcd02('0x1a')](_0xcd02('0x22'),_0x35d10d[_0xcd02('0x1f')]),_0xb4b7da);}});ami['on'](_0xcd02('0x23'),function(_0x4f996e){try{utils[_0xcd02('0x19')](util['format']('[%s][index][agentconnect]',_0x4f996e[_0xcd02('0x1f')]),_0x4f996e);agents[_0xcd02('0x23')](_0x4f996e);queues[_0xcd02('0x23')](_0x4f996e);}catch(_0x44ff29){utils[_0xcd02('0x16')](util['format'](_0xcd02('0x24'),_0x4f996e['uniqueid']),_0x44ff29);}});ami['on'](_0xcd02('0x25'),function(_0x4dca0f){try{utils[_0xcd02('0x19')](util['format'](_0xcd02('0x26'),_0x4dca0f[_0xcd02('0x1f')]),_0x4dca0f);agents[_0xcd02('0x25')](_0x4dca0f);queues[_0xcd02('0x25')](_0x4dca0f);members[_0xcd02('0x25')](_0x4dca0f);}catch(_0x3c1345){utils[_0xcd02('0x16')](util['format'](_0xcd02('0x26'),_0x4dca0f[_0xcd02('0x1f')]),_0x3c1345);}});ami['on'](_0xcd02('0x27'),function(_0x325aea){try{utils[_0xcd02('0x19')](util['format'](_0xcd02('0x28'),_0x325aea[_0xcd02('0x1f')]),_0x325aea);agents['queuecallerabandon'](_0x325aea);queues[_0xcd02('0x27')](_0x325aea);}catch(_0x3a209a){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')](_0xcd02('0x28'),_0x325aea[_0xcd02('0x1f')]),_0x3a209a);}});ami['on']('queuecallerjoin',function(_0x244a7d){try{utils[_0xcd02('0x19')](util[_0xcd02('0x1a')](_0xcd02('0x29'),_0x244a7d[_0xcd02('0x1f')]),_0x244a7d);queues[_0xcd02('0x2a')](_0x244a7d);recordings['queuecallerjoin'](_0x244a7d);}catch(_0x386247){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')](_0xcd02('0x29'),_0x244a7d['uniqueid']),_0x386247);}});ami['on']('queuecallerleave',function(_0x263b4b){try{utils['debug'](util[_0xcd02('0x1a')](_0xcd02('0x2b'),_0x263b4b['uniqueid']),_0x263b4b);queues[_0xcd02('0x2c')](_0x263b4b);}catch(_0x2609fc){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')](_0xcd02('0x2b'),_0x263b4b['uniqueid']),_0x2609fc);}});ami['on']('musiconholdstart',function(_0x263470){try{utils[_0xcd02('0x19')](util[_0xcd02('0x1a')](_0xcd02('0x2d'),_0x263470[_0xcd02('0x1f')]),_0x263470);queues['musiconholdstart'](_0x263470);calls['musiconholdstart'](_0x263470);}catch(_0x4db285){utils[_0xcd02('0x16')](util['format'](_0xcd02('0x2d'),_0x263470[_0xcd02('0x1f')]),_0x4db285);}});ami['on'](_0xcd02('0x2e'),function(_0x55039d){try{utils[_0xcd02('0x19')](util['format'](_0xcd02('0x2f'),_0x55039d['uniqueid']),_0x55039d);queues[_0xcd02('0x2e')](_0x55039d);calls['musiconholdstop'](_0x55039d);}catch(_0x38867d){utils['error'](util['format'](_0xcd02('0x2f'),_0x55039d[_0xcd02('0x1f')]),_0x38867d);}});ami['on'](_0xcd02('0x30'),function(_0x400e5a){try{utils['debug'](util[_0xcd02('0x1a')](_0xcd02('0x31'),_0x400e5a[_0xcd02('0x1f')]),_0x400e5a);calls[_0xcd02('0x30')](_0x400e5a);recordings[_0xcd02('0x30')](_0x400e5a);}catch(_0x58b45d){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')](_0xcd02('0x31'),_0x400e5a[_0xcd02('0x1f')]),_0x58b45d);}});ami['on']('hangup',function(_0x522d0b){try{utils['debug'](util[_0xcd02('0x1a')](_0xcd02('0x32'),_0x522d0b[_0xcd02('0x1f')]),_0x522d0b);calls[_0xcd02('0x33')](_0x522d0b);recordings['hangup'](_0x522d0b);dials[_0xcd02('0x33')](_0x522d0b);agents[_0xcd02('0x33')](_0x522d0b);queues[_0xcd02('0x33')](_0x522d0b);}catch(_0x510ed8){utils[_0xcd02('0x16')](util['format'](_0xcd02('0x32'),_0x522d0b[_0xcd02('0x1f')]),_0x510ed8);}});ami['on'](_0xcd02('0x34'),function(_0x30d17a){try{utils[_0xcd02('0x19')](util['format'](_0xcd02('0x35'),_0x30d17a[_0xcd02('0x1f')]),_0x30d17a);members[_0xcd02('0x34')](_0x30d17a);}catch(_0x161292){utils['error'](util[_0xcd02('0x1a')](_0xcd02('0x35'),_0x30d17a[_0xcd02('0x1f')]),_0x161292);}});ami['on'](_0xcd02('0x36'),function(_0x5f0836){try{utils[_0xcd02('0x19')](util[_0xcd02('0x1a')]('[%s][index][blindtransfer]',_0x5f0836['uniqueid']),_0x5f0836);queues['blindtransfer'](_0x5f0836);agents[_0xcd02('0x36')](_0x5f0836);transfers[_0xcd02('0x36')](_0x5f0836);}catch(_0x35397b){utils[_0xcd02('0x16')](util['format'](_0xcd02('0x37'),_0x5f0836[_0xcd02('0x1f')]),_0x35397b);}});ami['on'](_0xcd02('0x38'),function(_0x9c2c1a){try{utils[_0xcd02('0x19')](util['format'](_0xcd02('0x39'),_0x9c2c1a[_0xcd02('0x3a')]),_0x9c2c1a);queues[_0xcd02('0x38')](_0x9c2c1a);transfers['attendedtransfer'](_0x9c2c1a);agents[_0xcd02('0x38')](_0x9c2c1a);calls[_0xcd02('0x38')](_0x9c2c1a);}catch(_0x561303){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')](_0xcd02('0x39'),_0x9c2c1a[_0xcd02('0x3a')]),_0x561303);}});ami['on'](_0xcd02('0x3b'),function(_0x26537a){try{utils[_0xcd02('0x19')](util['format'](_0xcd02('0x3c'),_0x26537a[_0xcd02('0x1f')]),_0x26537a);queues[_0xcd02('0x3b')](_0x26537a);recordings[_0xcd02('0x3b')](_0x26537a);calls[_0xcd02('0x3b')](_0x26537a);dials['varset'](_0x26537a);}catch(_0x56955b){utils['error'](util['format'](_0xcd02('0x3c'),_0x26537a[_0xcd02('0x1f')]),_0x56955b);}});ami['on'](_0xcd02('0x3d'),function(_0x54d110){try{utils[_0xcd02('0x19')](util['format']('[%s][index][newexten]',_0x54d110[_0xcd02('0x1f')]),_0x54d110);calls['newexten'](_0x54d110);recordings[_0xcd02('0x3d')](_0x54d110);dials['newexten'](_0x54d110);}catch(_0x504055){utils[_0xcd02('0x16')](util['format'](_0xcd02('0x3e'),_0x54d110[_0xcd02('0x1f')]),_0x504055);}});ami['on'](_0xcd02('0x3f'),function(_0x5adb65){try{utils[_0xcd02('0x19')](util[_0xcd02('0x1a')](_0xcd02('0x40'),_0x5adb65[_0xcd02('0x1f')]),_0x5adb65);calls['newchannel'](_0x5adb65);recordings[_0xcd02('0x3f')](_0x5adb65);}catch(_0x8bb983){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')](_0xcd02('0x40'),_0x5adb65[_0xcd02('0x1f')]),_0x8bb983);}});ami['on']('dialbegin',function(_0xab8239){try{utils[_0xcd02('0x19')](util['format']('[%s][index][dialbegin]',_0xab8239[_0xcd02('0x1f')]),_0xab8239);dials[_0xcd02('0x41')](_0xab8239);}catch(_0x1c7b10){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')](_0xcd02('0x42'),_0xab8239['uniqueid']),_0x1c7b10);}});ami['on'](_0xcd02('0x43'),function(_0x22b63c){try{utils['debug'](util['format'](_0xcd02('0x44'),_0x22b63c[_0xcd02('0x1f')]),_0x22b63c);dials['dialend'](_0x22b63c);}catch(_0x58e632){utils[_0xcd02('0x16')](util[_0xcd02('0x1a')]('[%s][index][dialend]',_0x22b63c['uniqueid']),_0x58e632);}});} \ No newline at end of file +var _0xd5b4=['[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','xdr','disabled','production','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave'];(function(_0x4d1a49,_0x410b1f){var _0x27ef12=function(_0x54fe7a){while(--_0x54fe7a){_0x4d1a49['push'](_0x4d1a49['shift']());}};_0x27ef12(++_0x410b1f);}(_0xd5b4,0x1bd));var _0x4d5b=function(_0x18dc0f,_0x4d095a){_0x18dc0f=_0x18dc0f-0x0;var _0x5f2b3a=_0xd5b4[_0x18dc0f];return _0x5f2b3a;};var AsteriskManager=require(_0x4d5b('0x0'));var config=require(_0x4d5b('0x1'));var utils=require(_0x4d5b('0x2'));var util=require('util');var isXDREnabled=config[_0x4d5b('0x3')]&&config['xdr']['disabled']?!config[_0x4d5b('0x3')][_0x4d5b('0x4')]:!![];var isProduction=config['env']===_0x4d5b('0x5')||![];var isLocalAsterisk=config[_0x4d5b('0x3')]&&config[_0x4d5b('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x4d5b('0x6')][_0x4d5b('0x7')],config[_0x4d5b('0x6')]['ip'],config[_0x4d5b('0x6')][_0x4d5b('0x8')],config[_0x4d5b('0x6')]['password'],!![]);ami[_0x4d5b('0x9')]();if(!isXDREnabled){utils[_0x4d5b('0xa')](_0x4d5b('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x4d5b('0xa')](_0x4d5b('0xc'));}else{var agents=require(_0x4d5b('0xd'));var calls=require(_0x4d5b('0xe'));var queues=require(_0x4d5b('0xf'));var recordings=require(_0x4d5b('0x10'));var members=require(_0x4d5b('0x11'));var dials=require(_0x4d5b('0x12'));var transfers=require(_0x4d5b('0x13'));var core=require(_0x4d5b('0x14'));ami['on'](_0x4d5b('0x15'),core['connect']);ami['on'](_0x4d5b('0x16'),core[_0x4d5b('0x16')]);ami['on'](_0x4d5b('0x17'),core['fullybooted']);ami['on'](_0x4d5b('0x18'),core[_0x4d5b('0x18')]);ami['on'](_0x4d5b('0x19'),core[_0x4d5b('0x19')]);ami['on'](_0x4d5b('0x1a'),core['managerevent']);ami['on'](_0x4d5b('0x1b'),function(_0x375327){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][devicestatechange]',_0x375327[_0x4d5b('0x1e')]),_0x375327);members[_0x4d5b('0x1b')](_0x375327);}catch(_0x122f78){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x1f'),_0x375327[_0x4d5b('0x1e')]),_0x122f78);}});ami['on'](_0x4d5b('0x20'),function(_0x1f6d6c){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x21'),_0x1f6d6c['uniqueid']),_0x1f6d6c);agents[_0x4d5b('0x20')](_0x1f6d6c);}catch(_0x4c67f7){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x21'),_0x1f6d6c[_0x4d5b('0x22')]),_0x4c67f7);}});ami['on']('agentringnoanswer',function(_0xcfaae0){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x23'),_0xcfaae0[_0x4d5b('0x22')]),_0xcfaae0);agents[_0x4d5b('0x24')](_0xcfaae0);}catch(_0x12a330){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x23'),_0xcfaae0[_0x4d5b('0x22')]),_0x12a330);}});ami['on']('agentconnect',function(_0x170331){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x25'),_0x170331['uniqueid']),_0x170331);agents[_0x4d5b('0x26')](_0x170331);queues[_0x4d5b('0x26')](_0x170331);}catch(_0x21345b){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x25'),_0x170331['uniqueid']),_0x21345b);}});ami['on'](_0x4d5b('0x27'),function(_0x4d2636){try{utils['debug'](util[_0x4d5b('0x1d')]('[%s][index][agentcomplete]',_0x4d2636[_0x4d5b('0x22')]),_0x4d2636);agents['agentcomplete'](_0x4d2636);queues[_0x4d5b('0x27')](_0x4d2636);members['agentcomplete'](_0x4d2636);}catch(_0x542674){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x28'),_0x4d2636[_0x4d5b('0x22')]),_0x542674);}});ami['on'](_0x4d5b('0x29'),function(_0x998825){try{utils['debug'](util[_0x4d5b('0x1d')](_0x4d5b('0x2a'),_0x998825['uniqueid']),_0x998825);agents['queuecallerabandon'](_0x998825);queues[_0x4d5b('0x29')](_0x998825);}catch(_0x1e318c){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x2a'),_0x998825[_0x4d5b('0x22')]),_0x1e318c);}});ami['on'](_0x4d5b('0x2b'),function(_0x4dc804){try{utils['debug'](util['format']('[%s][index][queuecallerjoin]',_0x4dc804['uniqueid']),_0x4dc804);queues[_0x4d5b('0x2b')](_0x4dc804);recordings[_0x4d5b('0x2b')](_0x4dc804);}catch(_0x1d16af){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s][index][queuecallerjoin]',_0x4dc804[_0x4d5b('0x22')]),_0x1d16af);}});ami['on'](_0x4d5b('0x2c'),function(_0x3009ac){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x2d'),_0x3009ac['uniqueid']),_0x3009ac);queues[_0x4d5b('0x2c')](_0x3009ac);}catch(_0x360d62){utils[_0x4d5b('0x18')](util['format'](_0x4d5b('0x2d'),_0x3009ac[_0x4d5b('0x22')]),_0x360d62);}});ami['on'](_0x4d5b('0x2e'),function(_0x487465){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][musiconholdstart]',_0x487465[_0x4d5b('0x22')]),_0x487465);queues[_0x4d5b('0x2e')](_0x487465);calls[_0x4d5b('0x2e')](_0x487465);}catch(_0x34147e){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s][index][musiconholdstart]',_0x487465[_0x4d5b('0x22')]),_0x34147e);}});ami['on'](_0x4d5b('0x2f'),function(_0x5b1b45){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x30'),_0x5b1b45[_0x4d5b('0x22')]),_0x5b1b45);queues['musiconholdstop'](_0x5b1b45);calls[_0x4d5b('0x2f')](_0x5b1b45);}catch(_0x3ab6f3){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x30'),_0x5b1b45[_0x4d5b('0x22')]),_0x3ab6f3);}});ami['on'](_0x4d5b('0x31'),function(_0x2725ac){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][newstate]',_0x2725ac['uniqueid']),_0x2725ac);calls[_0x4d5b('0x31')](_0x2725ac);recordings['newstate'](_0x2725ac);}catch(_0x110d23){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x32'),_0x2725ac['uniqueid']),_0x110d23);}});ami['on'](_0x4d5b('0x33'),function(_0xf0fe21){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x34'),_0xf0fe21[_0x4d5b('0x22')]),_0xf0fe21);calls['hangup'](_0xf0fe21);recordings[_0x4d5b('0x33')](_0xf0fe21);dials[_0x4d5b('0x33')](_0xf0fe21);agents['hangup'](_0xf0fe21);queues[_0x4d5b('0x33')](_0xf0fe21);}catch(_0x48d574){utils[_0x4d5b('0x18')](util['format'](_0x4d5b('0x34'),_0xf0fe21[_0x4d5b('0x22')]),_0x48d574);}});ami['on'](_0x4d5b('0x35'),function(_0xc86b4d){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][cdr]',_0xc86b4d[_0x4d5b('0x22')]),_0xc86b4d);members[_0x4d5b('0x35')](_0xc86b4d);}catch(_0x110c28){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x36'),_0xc86b4d['uniqueid']),_0x110c28);}});ami['on'](_0x4d5b('0x37'),function(_0x730768){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x38'),_0x730768[_0x4d5b('0x22')]),_0x730768);queues['blindtransfer'](_0x730768);agents[_0x4d5b('0x37')](_0x730768);transfers[_0x4d5b('0x37')](_0x730768);}catch(_0x28b0e2){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x38'),_0x730768[_0x4d5b('0x22')]),_0x28b0e2);}});ami['on'](_0x4d5b('0x39'),function(_0x5cca36){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x3a'),_0x5cca36[_0x4d5b('0x3b')]),_0x5cca36);queues[_0x4d5b('0x39')](_0x5cca36);transfers['attendedtransfer'](_0x5cca36);agents[_0x4d5b('0x39')](_0x5cca36);calls[_0x4d5b('0x39')](_0x5cca36);}catch(_0x496f36){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s][index][attendedtransfer]',_0x5cca36[_0x4d5b('0x3b')]),_0x496f36);}});ami['on']('varset',function(_0xf5f438){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x3c'),_0xf5f438[_0x4d5b('0x22')]),_0xf5f438);queues['varset'](_0xf5f438);recordings[_0x4d5b('0x3d')](_0xf5f438);calls[_0x4d5b('0x3d')](_0xf5f438);dials[_0x4d5b('0x3d')](_0xf5f438);}catch(_0x53dc42){utils[_0x4d5b('0x18')](util['format'](_0x4d5b('0x3c'),_0xf5f438[_0x4d5b('0x22')]),_0x53dc42);}});ami['on'](_0x4d5b('0x3e'),function(_0xf1efac){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x3f'),_0xf1efac[_0x4d5b('0x22')]),_0xf1efac);calls[_0x4d5b('0x3e')](_0xf1efac);recordings['newexten'](_0xf1efac);dials[_0x4d5b('0x3e')](_0xf1efac);}catch(_0x44d404){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x3f'),_0xf1efac[_0x4d5b('0x22')]),_0x44d404);}});ami['on']('newchannel',function(_0x3954c3){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][newchannel]',_0x3954c3[_0x4d5b('0x22')]),_0x3954c3);calls[_0x4d5b('0x40')](_0x3954c3);recordings['newchannel'](_0x3954c3);}catch(_0xf97ae2){utils['error'](util['format'](_0x4d5b('0x41'),_0x3954c3[_0x4d5b('0x22')]),_0xf97ae2);}});ami['on'](_0x4d5b('0x42'),function(_0x5292f2){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x43'),_0x5292f2[_0x4d5b('0x22')]),_0x5292f2);dials[_0x4d5b('0x42')](_0x5292f2);}catch(_0x4dbcfa){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s]dialbegin',_0x5292f2[_0x4d5b('0x22')]),_0x4dbcfa);}});ami['on']('dialend',function(_0xeb9594){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x44'),_0xeb9594[_0x4d5b('0x22')]),_0xeb9594);dials[_0x4d5b('0x45')](_0xeb9594);}catch(_0x1c61f6){utils['error'](util[_0x4d5b('0x1d')]('[%s][index][dialend]',_0xeb9594[_0x4d5b('0x22')]),_0x1c61f6);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 17b8af0..33aaf9a 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 _0xb43b=['agent','isNil','duration','diffTime','exitAt','enterAt','error','debug','[%s][members][agentcomplete]','assign','cdr','[%s][members][cdr]','channel','data1','type','data2','source','data3','destination','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','[%s][members][writeDB]','some','devicestatechange','[%s][members][devicestatechange]','device','info','state','BUSY','TALKING'];(function(_0x20a137,_0x4d9549){var _0x3dc414=function(_0x21179b){while(--_0x21179b){_0x20a137['push'](_0x20a137['shift']());}};_0x3dc414(++_0x4d9549);}(_0xb43b,0x1b2));var _0xbb43=function(_0x561959,_0x259f6e){_0x561959=_0x561959-0x0;var _0x13d4b6=_0xb43b[_0x561959];return _0x13d4b6;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var utils=require('./utils');var members={};var exclude=[_0xbb43('0x2'),_0xbb43('0x3')];function writeDB(_0x22bc86){utils['info'](util[_0xbb43('0x4')](_0xbb43('0x5'),_0x22bc86[_0xbb43('0x6')],_0x22bc86[_0xbb43('0x7')],_0x22bc86['channel'],_0x22bc86['data2'],_0x22bc86[_0xbb43('0x8')],_0x22bc86['type']));if(_0x22bc86[_0xbb43('0x7')]){utils[_0xbb43('0x9')](_0x22bc86[_0xbb43('0x7')])[_0xbb43('0xa')](function(_0x364718){if(_0x364718){_0x22bc86['membername']=_0x364718[_0xbb43('0xb')];_0x22bc86[_0xbb43('0xc')]=_0x364718['internal'];utils[_0xbb43('0xd')](_0xbb43('0xe'),_0x22bc86);}else{utils[_0xbb43('0xf')](_0x22bc86[_0xbb43('0x7')][_0xbb43('0x10')]('/')[0x1])[_0xbb43('0xa')](function(_0x480cc2){if(_0x480cc2){_0x22bc86[_0xbb43('0x8')]=_0x480cc2[_0xbb43('0xb')];_0x22bc86['internal']=_0x480cc2['internal'];utils[_0xbb43('0xd')]('CreateMemberReport',_0x22bc86);}});}})['catch'](function(_0x438591){utils['error'](util[_0xbb43('0x4')](_0xbb43('0x11'),_0x22bc86['uniqueid']),_0x438591);});}delete members[_0x22bc86['interface']];}function startsWith(_0x4d5bcf,_0x338120){return _[_0xbb43('0x12')](_0x4d5bcf,function(_0x57bd1d){return _['startsWith'](_0x338120,_0x57bd1d);});}exports[_0xbb43('0x13')]=function(_0x563ce1){try{utils['debug'](util[_0xbb43('0x4')](_0xbb43('0x14'),members[_0x563ce1[_0xbb43('0x15')]]?members[_0x563ce1['device']][_0xbb43('0x6')]:_0x563ce1['device']),_0x563ce1);utils[_0xbb43('0x16')](util[_0xbb43('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x563ce1['device']]?members[_0x563ce1[_0xbb43('0x15')]][_0xbb43('0x6')]:_0x563ce1[_0xbb43('0x15')],_0x563ce1[_0xbb43('0x17')],_0x563ce1['device']));switch(_0x563ce1[_0xbb43('0x17')]){case'INUSE':case _0xbb43('0x18'):if(!startsWith(exclude,_0x563ce1['device'])){members[_0x563ce1[_0xbb43('0x15')]]={'channel':'voice','interface':_0x563ce1[_0xbb43('0x15')],'type':_0xbb43('0x19'),'enterAt':utils['now'](),'role':_0xbb43('0x1a')};}break;case'NOT_INUSE':if(!_[_0xbb43('0x1b')](members[_0x563ce1[_0xbb43('0x15')]])){members[_0x563ce1[_0xbb43('0x15')]]['exitAt']=utils['now']();members[_0x563ce1['device']][_0xbb43('0x1c')]=utils[_0xbb43('0x1d')](members[_0x563ce1['device']][_0xbb43('0x1e')],members[_0x563ce1[_0xbb43('0x15')]][_0xbb43('0x1f')]);if(members[_0x563ce1[_0xbb43('0x15')]]['uniqueid']){writeDB(members[_0x563ce1['device']]);}}break;default:break;}}catch(_0x27fd7a){utils[_0xbb43('0x20')](util[_0xbb43('0x4')](_0xbb43('0x14'),members[_0x563ce1[_0xbb43('0x15')]]?members[_0x563ce1[_0xbb43('0x15')]][_0xbb43('0x6')]:_0x563ce1[_0xbb43('0x15')]),_0x27fd7a);}};exports['agentcomplete']=function(_0x2ad6da){try{if(!_['isNil'](members[_0x2ad6da[_0xbb43('0x7')]])){utils[_0xbb43('0x21')](util[_0xbb43('0x4')](_0xbb43('0x22'),_0x2ad6da['uniqueid']),_0x2ad6da);utils[_0xbb43('0x16')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2ad6da['uniqueid'],_0x2ad6da[_0xbb43('0x7')],_0x2ad6da['queue']));members[_0x2ad6da[_0xbb43('0x7')]]=_[_0xbb43('0x23')](members[_0x2ad6da[_0xbb43('0x7')]],{'data4':_0x2ad6da['queue'],'uniqueid':_0x2ad6da[_0xbb43('0x6')]});}}catch(_0x1bdf91){utils[_0xbb43('0x20')](util[_0xbb43('0x4')](_0xbb43('0x22'),_0x2ad6da[_0xbb43('0x6')]),_0x1bdf91);}};exports[_0xbb43('0x24')]=function(_0x24375b){try{utils['debug'](util[_0xbb43('0x4')](_0xbb43('0x25'),_0x24375b[_0xbb43('0x6')]),_0x24375b);if(_0x24375b[_0xbb43('0x26')]){var _0x4015ec=_0x24375b[_0xbb43('0x26')][_0xbb43('0x10')]('-')[0x0];if(!_[_0xbb43('0x1b')](members[_0x4015ec])){members[_0x4015ec]=_[_0xbb43('0x23')](members[_0x4015ec],{'data1':members[_0x4015ec][_0xbb43('0x27')]||_0x24375b[_0xbb43('0x28')],'data2':members[_0x4015ec][_0xbb43('0x29')]||_0x24375b[_0xbb43('0x2a')],'data3':members[_0x4015ec][_0xbb43('0x2b')]||_0x24375b[_0xbb43('0x2c')],'uniqueid':members[_0x4015ec][_0xbb43('0x6')]||_0x24375b['uniqueid']});utils[_0xbb43('0x16')](util[_0xbb43('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x24375b[_0xbb43('0x6')],members[_0x4015ec][_0xbb43('0x27')],members[_0x4015ec][_0xbb43('0x29')],members[_0x4015ec]['data3']));if(members[_0x4015ec]['exitAt']){writeDB(members[_0x4015ec]);}}}if(_0x24375b['destinationchannel']){var _0x40df31=_0x24375b[_0xbb43('0x2d')]['split']('-')[0x0];if(!_['isNil'](members[_0x40df31])){members[_0x40df31]=_[_0xbb43('0x23')](members[_0x40df31],{'data1':members[_0x40df31][_0xbb43('0x27')]||_0x24375b[_0xbb43('0x28')],'data2':members[_0x40df31][_0xbb43('0x29')]||_0x24375b[_0xbb43('0x2a')],'data3':members[_0x40df31]['data3']||_0x24375b[_0xbb43('0x2c')],'uniqueid':members[_0x40df31][_0xbb43('0x6')]||_0x24375b[_0xbb43('0x6')]});utils[_0xbb43('0x16')](util[_0xbb43('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x24375b[_0xbb43('0x6')],members[_0x40df31]['data1'],members[_0x40df31][_0xbb43('0x29')],members[_0x40df31][_0xbb43('0x2b')]));if(members[_0x40df31]['exitAt']){writeDB(members[_0x40df31]);}}}}catch(_0x4783fe){utils['error'](util[_0xbb43('0x4')](_0xbb43('0x25'),_0x24375b[_0xbb43('0x6')]),_0x4783fe);}}; \ No newline at end of file +var _0x4fdc=['state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','type','util','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0xa22d6b,_0x3da494){var _0x555ef6=function(_0x3c8cca){while(--_0x3c8cca){_0xa22d6b['push'](_0xa22d6b['shift']());}};_0x555ef6(++_0x3da494);}(_0x4fdc,0x84));var _0xc4fd=function(_0x44ec0a,_0x4bba7e){_0x44ec0a=_0x44ec0a-0x0;var _0x127e75=_0x4fdc[_0x44ec0a];return _0x127e75;};'use strict';var _=require('lodash');var util=require(_0xc4fd('0x0'));var utils=require('./utils');var members={};var exclude=[_0xc4fd('0x1'),_0xc4fd('0x2')];function writeDB(_0x49fd20){utils['info'](util[_0xc4fd('0x3')](_0xc4fd('0x4'),_0x49fd20[_0xc4fd('0x5')],_0x49fd20[_0xc4fd('0x6')],_0x49fd20[_0xc4fd('0x7')],_0x49fd20[_0xc4fd('0x8')],_0x49fd20[_0xc4fd('0x9')],_0x49fd20['type']));if(_0x49fd20[_0xc4fd('0x6')]){utils[_0xc4fd('0xa')](_0x49fd20['interface'])[_0xc4fd('0xb')](function(_0x5b1df4){if(_0x5b1df4){_0x49fd20['membername']=_0x5b1df4[_0xc4fd('0xc')];_0x49fd20[_0xc4fd('0xd')]=_0x5b1df4[_0xc4fd('0xd')];utils[_0xc4fd('0xe')](_0xc4fd('0xf'),_0x49fd20);}else{utils[_0xc4fd('0x10')](_0x49fd20[_0xc4fd('0x6')][_0xc4fd('0x11')]('/')[0x1])['then'](function(_0x52cfdd){if(_0x52cfdd){_0x49fd20[_0xc4fd('0x9')]=_0x52cfdd[_0xc4fd('0xc')];_0x49fd20[_0xc4fd('0xd')]=_0x52cfdd['internal'];utils[_0xc4fd('0xe')](_0xc4fd('0xf'),_0x49fd20);}});}})[_0xc4fd('0x12')](function(_0x963371){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')](_0xc4fd('0x14'),_0x49fd20[_0xc4fd('0x5')]),_0x963371);});}delete members[_0x49fd20[_0xc4fd('0x6')]];}function startsWith(_0x553121,_0x75a44f){return _['some'](_0x553121,function(_0x5a248c){return _[_0xc4fd('0x15')](_0x75a44f,_0x5a248c);});}exports[_0xc4fd('0x16')]=function(_0x533217){try{utils['debug'](util[_0xc4fd('0x3')](_0xc4fd('0x17'),members[_0x533217[_0xc4fd('0x18')]]?members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x5')]:_0x533217[_0xc4fd('0x18')]),_0x533217);utils[_0xc4fd('0x19')](util['format'](_0xc4fd('0x1a'),members[_0x533217[_0xc4fd('0x18')]]?members[_0x533217[_0xc4fd('0x18')]]['uniqueid']:_0x533217['device'],_0x533217[_0xc4fd('0x1b')],_0x533217[_0xc4fd('0x18')]));switch(_0x533217[_0xc4fd('0x1b')]){case _0xc4fd('0x1c'):case _0xc4fd('0x1d'):if(!startsWith(exclude,_0x533217[_0xc4fd('0x18')])){members[_0x533217['device']]={'channel':'voice','interface':_0x533217[_0xc4fd('0x18')],'type':_0xc4fd('0x1e'),'enterAt':utils[_0xc4fd('0x1f')](),'role':_0xc4fd('0x20')};}break;case _0xc4fd('0x21'):if(!_[_0xc4fd('0x22')](members[_0x533217[_0xc4fd('0x18')]])){members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x23')]=utils['now']();members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x24')]=utils[_0xc4fd('0x25')](members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x23')],members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x26')]);if(members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x5')]){writeDB(members[_0x533217['device']]);}}break;default:break;}}catch(_0x54ac54){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')](_0xc4fd('0x17'),members[_0x533217[_0xc4fd('0x18')]]?members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x5')]:_0x533217['device']),_0x54ac54);}};exports[_0xc4fd('0x27')]=function(_0x1b65bd){try{if(!_[_0xc4fd('0x22')](members[_0x1b65bd[_0xc4fd('0x6')]])){utils[_0xc4fd('0x28')](util[_0xc4fd('0x3')](_0xc4fd('0x29'),_0x1b65bd[_0xc4fd('0x5')]),_0x1b65bd);utils['info'](util['format'](_0xc4fd('0x2a'),_0x1b65bd[_0xc4fd('0x5')],_0x1b65bd[_0xc4fd('0x6')],_0x1b65bd[_0xc4fd('0x2b')]));members[_0x1b65bd['interface']]=_[_0xc4fd('0x2c')](members[_0x1b65bd['interface']],{'data4':_0x1b65bd[_0xc4fd('0x2b')],'uniqueid':_0x1b65bd[_0xc4fd('0x5')]});}}catch(_0x5c84ea){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')](_0xc4fd('0x29'),_0x1b65bd[_0xc4fd('0x5')]),_0x5c84ea);}};exports[_0xc4fd('0x2d')]=function(_0x151bfb){try{utils['debug'](util[_0xc4fd('0x3')](_0xc4fd('0x2e'),_0x151bfb[_0xc4fd('0x5')]),_0x151bfb);if(_0x151bfb[_0xc4fd('0x7')]){var _0x45c9a5=_0x151bfb[_0xc4fd('0x7')][_0xc4fd('0x11')]('-')[0x0];if(!_['isNil'](members[_0x45c9a5])){members[_0x45c9a5]=_[_0xc4fd('0x2c')](members[_0x45c9a5],{'data1':members[_0x45c9a5]['data1']||_0x151bfb['type'],'data2':members[_0x45c9a5][_0xc4fd('0x8')]||_0x151bfb['source'],'data3':members[_0x45c9a5][_0xc4fd('0x2f')]||_0x151bfb[_0xc4fd('0x30')],'uniqueid':members[_0x45c9a5][_0xc4fd('0x5')]||_0x151bfb['uniqueid']});utils[_0xc4fd('0x19')](util[_0xc4fd('0x3')](_0xc4fd('0x31'),_0x151bfb[_0xc4fd('0x5')],members[_0x45c9a5]['data1'],members[_0x45c9a5][_0xc4fd('0x8')],members[_0x45c9a5][_0xc4fd('0x2f')]));if(members[_0x45c9a5][_0xc4fd('0x23')]){writeDB(members[_0x45c9a5]);}}}if(_0x151bfb[_0xc4fd('0x32')]){var _0x5abf34=_0x151bfb[_0xc4fd('0x32')][_0xc4fd('0x11')]('-')[0x0];if(!_['isNil'](members[_0x5abf34])){members[_0x5abf34]=_[_0xc4fd('0x2c')](members[_0x5abf34],{'data1':members[_0x5abf34][_0xc4fd('0x33')]||_0x151bfb[_0xc4fd('0x34')],'data2':members[_0x5abf34][_0xc4fd('0x8')]||_0x151bfb['source'],'data3':members[_0x5abf34][_0xc4fd('0x2f')]||_0x151bfb[_0xc4fd('0x30')],'uniqueid':members[_0x5abf34]['uniqueid']||_0x151bfb[_0xc4fd('0x5')]});utils[_0xc4fd('0x19')](util[_0xc4fd('0x3')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x151bfb[_0xc4fd('0x5')],members[_0x5abf34][_0xc4fd('0x33')],members[_0x5abf34][_0xc4fd('0x8')],members[_0x5abf34][_0xc4fd('0x2f')]));if(members[_0x5abf34]['exitAt']){writeDB(members[_0x5abf34]);}}}}catch(_0x543045){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')]('[%s][members][cdr]',_0x151bfb[_0xc4fd('0x5')]),_0x543045);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4108ba5..f4d592c 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 _0x05dc=['[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','error','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerexitAt','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','queuecallerjoinAt','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfertargetlinkedid','clone','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]'];(function(_0x2640fa,_0xaeaf32){var _0x5aa2cd=function(_0x3a0bf2){while(--_0x3a0bf2){_0x2640fa['push'](_0x2640fa['shift']());}};_0x5aa2cd(++_0xaeaf32);}(_0x05dc,0x115));var _0xc05d=function(_0xa970d1,_0x8e9f98){_0xa970d1=_0xa970d1-0x0;var _0x4c5a31=_0x05dc[_0xa970d1];return _0x4c5a31;};'use strict';var _=require('lodash');var util=require(_0xc05d('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x336b67){utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x3'),_0x336b67[_0xc05d('0x4')],_0x336b67[_0xc05d('0x5')],_0x336b67[_0xc05d('0x6')],_0x336b67[_0xc05d('0x7')],_0x336b67[_0xc05d('0x8')],_0x336b67[_0xc05d('0x9')],_0x336b67[_0xc05d('0xa')]));if(_0x336b67[_0xc05d('0x6')]){utils[_0xc05d('0xb')](_0x336b67[_0xc05d('0x6')])[_0xc05d('0xc')](function(_0x4ca303){if(_0x4ca303){_0x336b67[_0xc05d('0xd')]=_0x4ca303['type'];}utils[_0xc05d('0xe')](_0xc05d('0xf'),_0x336b67);});}else{utils[_0xc05d('0xe')](_0xc05d('0xf'),_0x336b67);}if(_0x336b67[_0xc05d('0x10')]){delete queues[_0x336b67[_0xc05d('0x10')]];}else{delete queues[_0x336b67['uniqueid']];}}exports[_0xc05d('0x11')]=function(_0x436712){try{utils[_0xc05d('0x12')](util['format'](_0xc05d('0x13'),_0x436712[_0xc05d('0x4')]),_0x436712);utils['info'](util[_0xc05d('0x2')](_0xc05d('0x14'),_0x436712[_0xc05d('0x4')],_0x436712[_0xc05d('0x6')],_0x436712[_0xc05d('0x15')]));queues[_0x436712[_0xc05d('0x4')]]=_[_0xc05d('0x16')](_0x436712,{'originalposition':_0x436712[_0xc05d('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x14f4f8){utils['error'](util[_0xc05d('0x2')](_0xc05d('0x13'),_0x436712['uniqueid']),_0x14f4f8);}};exports['hangup']=function(_0x2083a6){try{if(!_[_0xc05d('0x17')](queues[_0x2083a6[_0xc05d('0x4')]])){utils[_0xc05d('0x12')](util[_0xc05d('0x2')](_0xc05d('0x18'),_0x2083a6[_0xc05d('0x4')]),_0x2083a6);if(queues[_0x2083a6[_0xc05d('0x4')]]['queuecallerleaveAt']){if(!queues[_0x2083a6[_0xc05d('0x4')]]['queuecallerabandon']&&!queues[_0x2083a6[_0xc05d('0x4')]][_0xc05d('0x19')]){queues[_0x2083a6['uniqueid']]['queuecallercomplete']=!![];queues[_0x2083a6[_0xc05d('0x4')]][_0xc05d('0x1a')]=utils['now']();queues[_0x2083a6[_0xc05d('0x4')]][_0xc05d('0xa')]='COMPLETEDBYAGENT';}utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x1b'),_0x2083a6[_0xc05d('0x4')],queues[_0x2083a6['uniqueid']][_0xc05d('0x1c')],queues[_0x2083a6[_0xc05d('0x4')]][_0xc05d('0xa')]));writeDB(queues[_0x2083a6[_0xc05d('0x4')]]);}else if(queues[_0x2083a6[_0xc05d('0x4')]][_0xc05d('0x10')]){utils[_0xc05d('0x1')](util[_0xc05d('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2083a6[_0xc05d('0x4')],queues[_0x2083a6['uniqueid']]['name'],queues[_0x2083a6[_0xc05d('0x4')]][_0xc05d('0x10')]));queues[queues[_0x2083a6['uniqueid']][_0xc05d('0x10')]]=queues[_0x2083a6[_0xc05d('0x4')]];queues[queues[_0x2083a6[_0xc05d('0x4')]][_0xc05d('0x10')]][_0xc05d('0x1d')]=0x2;delete queues[_0x2083a6['uniqueid']];}}}catch(_0x37541c){utils[_0xc05d('0x1e')](util[_0xc05d('0x2')]('[%s][queues][hangup]',_0x2083a6[_0xc05d('0x4')]),_0x37541c);}};exports['varset']=function(_0x346407){try{utils[_0xc05d('0x12')](util[_0xc05d('0x2')](_0xc05d('0x1f'),_0x346407['uniqueid']),_0x346407);if(!_[_0xc05d('0x17')](_0x346407[_0xc05d('0x20')][_0xc05d('0x21')])&&_0x346407[_0xc05d('0x22')][_0xc05d('0x23')]()!==_0xc05d('0x24')){if(!_[_0xc05d('0x17')](queues[_0x346407[_0xc05d('0x4')]])){queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0x25')]=![];queues[_0x346407[_0xc05d('0x4')]]['queuecallerabandonAt']=null;queues[_0x346407[_0xc05d('0x4')]]['queuecallerexit']=!![];queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0x26')]=utils[_0xc05d('0x27')]();queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0xa')]=_0x346407['value'][_0xc05d('0x23')]();utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x28'),_0x346407[_0xc05d('0x4')],queues[_0x346407['uniqueid']]['name'],_0x346407[_0xc05d('0x22')],queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0xa')]));writeDB(queues[_0x346407[_0xc05d('0x4')]]);}}else if(!_[_0xc05d('0x17')](_0x346407[_0xc05d('0x20')]['queueposition'])){if(!_['isNil'](queues[_0x346407[_0xc05d('0x4')]])&&!queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0x25')]){queues[_0x346407['uniqueid']][_0xc05d('0x25')]=![];queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0x29')]=null;queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0x19')]=!![];queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0x26')]=utils[_0xc05d('0x27')]();queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0xa')]=_0xc05d('0x2a');utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x2b'),_0x346407[_0xc05d('0x4')],queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0x1c')],_0x346407[_0xc05d('0x22')],queues[_0x346407[_0xc05d('0x4')]][_0xc05d('0xa')]));}}}catch(_0xe9e5f0){utils['error'](util[_0xc05d('0x2')](_0xc05d('0x1f'),_0x346407[_0xc05d('0x4')]),_0xe9e5f0);}};exports[_0xc05d('0x25')]=function(_0x340b9f){try{if(!_[_0xc05d('0x17')](queues[_0x340b9f[_0xc05d('0x4')]])){utils[_0xc05d('0x12')](util[_0xc05d('0x2')](_0xc05d('0x2c'),_0x340b9f[_0xc05d('0x4')]),_0x340b9f);queues[_0x340b9f[_0xc05d('0x4')]][_0xc05d('0x19')]=![];queues[_0x340b9f[_0xc05d('0x4')]][_0xc05d('0x26')]=null;queues[_0x340b9f[_0xc05d('0x4')]][_0xc05d('0x25')]=!![];queues[_0x340b9f[_0xc05d('0x4')]][_0xc05d('0x29')]=utils['now']();queues[_0x340b9f[_0xc05d('0x4')]]['queuecallerexitreason']=_0xc05d('0x2d');utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x2e'),_0x340b9f[_0xc05d('0x4')],queues[_0x340b9f[_0xc05d('0x4')]][_0xc05d('0x1c')],queues[_0x340b9f['uniqueid']][_0xc05d('0xa')]));}}catch(_0x21adf1){utils['error'](util[_0xc05d('0x2')](_0xc05d('0x2c'),_0x340b9f[_0xc05d('0x4')]),_0x21adf1);}};exports[_0xc05d('0x2f')]=function(_0x10a84c){try{if(!_[_0xc05d('0x17')](queues[_0x10a84c[_0xc05d('0x4')]])){utils['debug'](util[_0xc05d('0x2')](_0xc05d('0x30'),_0x10a84c[_0xc05d('0x4')]),_0x10a84c);utils['info'](util['format'](_0xc05d('0x31'),_0x10a84c[_0xc05d('0x4')],queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x1c')],_0x10a84c[_0xc05d('0x32')],_0x10a84c[_0xc05d('0x33')]));queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x2f')]=!![];queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x34')]=utils[_0xc05d('0x27')]();queues[_0x10a84c[_0xc05d('0x4')]]['holdtime']=utils['diffTime'](queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x34')],queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x35')]);queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x15')]=_0x10a84c[_0xc05d('0x15')];queues[_0x10a84c[_0xc05d('0x4')]]['count']=_0x10a84c['count'];queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x32')]=_0x10a84c[_0xc05d('0x32')];queues[_0x10a84c[_0xc05d('0x4')]][_0xc05d('0x33')]=_0x10a84c[_0xc05d('0x33')];}}catch(_0x5c1d0a){utils[_0xc05d('0x1e')](util[_0xc05d('0x2')]('[%s][queues][queuecallerleave]',_0x10a84c[_0xc05d('0x4')]),_0x5c1d0a);}};exports[_0xc05d('0x36')]=function(_0x2c8e28){try{if(!_[_0xc05d('0x17')](queues[_0x2c8e28[_0xc05d('0x4')]])){utils[_0xc05d('0x12')](util['format'](_0xc05d('0x37'),_0x2c8e28['uniqueid']),_0x2c8e28);utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x38'),_0x2c8e28[_0xc05d('0x4')],queues[_0x2c8e28[_0xc05d('0x4')]][_0xc05d('0x1c')],_0x2c8e28[_0xc05d('0x39')],_0x2c8e28[_0xc05d('0x3a')]));queues[_0x2c8e28['uniqueid']]['queuecallerabandon']=![];queues[_0x2c8e28['uniqueid']][_0xc05d('0x25')]=![];queues[_0x2c8e28['uniqueid']][_0xc05d('0x29')]=null;queues[_0x2c8e28[_0xc05d('0x4')]]['queuecallerexit']=![];queues[_0x2c8e28[_0xc05d('0x4')]]['queuecallerexitreason']=null;queues[_0x2c8e28['uniqueid']][_0xc05d('0x26')]=null;queues[_0x2c8e28[_0xc05d('0x4')]][_0xc05d('0x3b')]=!![];queues[_0x2c8e28[_0xc05d('0x4')]][_0xc05d('0x9')]=_0x2c8e28['destaccountcode'];queues[_0x2c8e28[_0xc05d('0x4')]][_0xc05d('0x7')]=_0x2c8e28['membername'];}}catch(_0x3aa8e4){utils[_0xc05d('0x1e')](util['format'](_0xc05d('0x37'),_0x2c8e28['uniqueid']),_0x3aa8e4);}};exports[_0xc05d('0x3c')]=function(_0x45a7f0){try{if(!_[_0xc05d('0x17')](queues[_0x45a7f0['uniqueid']])){if(queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0x34')]){utils[_0xc05d('0x12')](util[_0xc05d('0x2')](_0xc05d('0x3d'),_0x45a7f0[_0xc05d('0x4')]),_0x45a7f0);queues[_0x45a7f0['uniqueid']][_0xc05d('0x25')]=![];queues[_0x45a7f0[_0xc05d('0x4')]]['queuecallerabandon']=![];queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0x29')]=null;queues[_0x45a7f0[_0xc05d('0x4')]]['queuecallerexit']=![];queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0x26')]=null;queues[_0x45a7f0[_0xc05d('0x4')]]['assigned']=!![];queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0x7')]=_0x45a7f0['membername'];queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0x3e')]=!![];queues[_0x45a7f0['uniqueid']][_0xc05d('0x1a')]=utils[_0xc05d('0x27')]();if(_0x45a7f0[_0xc05d('0x3f')]==_0xc05d('0x40')){if(!queues[_0x45a7f0['uniqueid']][_0xc05d('0x40')]){queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0xa')]=_0xc05d('0x41');}}else{queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0xa')]='COMPLETEDBY'+_0x45a7f0[_0xc05d('0x3f')]['toUpperCase']();}utils[_0xc05d('0x1')](util['format'](_0xc05d('0x42'),_0x45a7f0[_0xc05d('0x4')],queues[_0x45a7f0[_0xc05d('0x4')]][_0xc05d('0x1c')],_0x45a7f0[_0xc05d('0x39')],queues[_0x45a7f0['uniqueid']][_0xc05d('0xa')]));writeDB(queues[_0x45a7f0[_0xc05d('0x4')]]);}}}catch(_0x2760cd){utils['error'](util[_0xc05d('0x2')](_0xc05d('0x3d'),_0x45a7f0[_0xc05d('0x4')]),_0x2760cd);}};exports[_0xc05d('0x43')]=function(_0x2c3c21){try{if(!_['isNil'](queues[_0x2c3c21[_0xc05d('0x44')]])){utils[_0xc05d('0x12')](util[_0xc05d('0x2')](_0xc05d('0x45'),_0x2c3c21['uniqueid']),_0x2c3c21);queues[_0x2c3c21['transfereeuniqueid']]['transfer']=!![];queues[_0x2c3c21['transfereeuniqueid']][_0xc05d('0x46')]=_0xc05d('0x47');queues[_0x2c3c21['transfereeuniqueid']][_0xc05d('0x48')]=_0x2c3c21['extension'];queues[_0x2c3c21[_0xc05d('0x44')]][_0xc05d('0x49')]=_0x2c3c21['transfereeuniqueid'];queues[_0x2c3c21[_0xc05d('0x44')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util['format'](_0xc05d('0x4a'),_0x2c3c21[_0xc05d('0x4')],queues[_0x2c3c21[_0xc05d('0x44')]][_0xc05d('0x1c')],_0x2c3c21[_0xc05d('0x44')],_0x2c3c21['extension']));}}catch(_0x1a0b2b){utils[_0xc05d('0x1e')](util['format'](_0xc05d('0x45'),_0x2c3c21['uniqueid']),_0x1a0b2b);}};exports[_0xc05d('0x4b')]=function(_0x113b94){try{utils['debug'](util[_0xc05d('0x2')](_0xc05d('0x4c'),_0x113b94[_0xc05d('0x4d')]),_0x113b94);if(_0x113b94['origtransfereruniqueid']==_0x113b94[_0xc05d('0x4e')]){if(!_[_0xc05d('0x17')](queues[_0x113b94['secondtransfererlinkedid']])){utils[_0xc05d('0x1')](util['format'](_0xc05d('0x4f'),_0x113b94['origtransfereruniqueid'],queues[_0x113b94[_0xc05d('0x50')]][_0xc05d('0x1c')],_0x113b94[_0xc05d('0x51')]));queues[_0x113b94[_0xc05d('0x50')]][_0xc05d('0x40')]=!![];queues[_0x113b94[_0xc05d('0x50')]]['transfertype']='ATTENDED';queues[_0x113b94['secondtransfererlinkedid']][_0xc05d('0x48')]=_0x113b94[_0xc05d('0x51')];queues[_0x113b94['secondtransfererlinkedid']][_0xc05d('0x49')]=_0x113b94[_0xc05d('0x4d')];queues[_0x113b94[_0xc05d('0x50')]][_0xc05d('0xa')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x113b94[_0xc05d('0x4e')]])){if(_0x113b94[_0xc05d('0x52')]&&queues[_0x113b94[_0xc05d('0x52')]]){queues[_0x113b94[_0xc05d('0x52')]][_0xc05d('0x1d')]=0x1;queues[_0x113b94[_0xc05d('0x44')]]=_['clone'](queues[_0x113b94[_0xc05d('0x52')]]);queues[_0x113b94[_0xc05d('0x44')]][_0xc05d('0x10')]=_0x113b94[_0xc05d('0x53')];queues[_0x113b94['transfereeuniqueid']][_0xc05d('0x1d')]=0x2;queues[_0x113b94[_0xc05d('0x44')]][_0xc05d('0x8')]=queues[_0x113b94[_0xc05d('0x50')]][_0xc05d('0x8')];queues[_0x113b94[_0xc05d('0x44')]][_0xc05d('0x54')]=queues[_0x113b94[_0xc05d('0x50')]][_0xc05d('0x54')];queues[_0x113b94[_0xc05d('0x44')]][_0xc05d('0x35')]=utils['now']();queues[_0x113b94['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0xc05d('0x27')]();queues[_0x113b94['transfereeuniqueid']][_0xc05d('0x55')]=0x0;queues[_0x113b94[_0xc05d('0x44')]][_0xc05d('0x56')]=0x0;utils['info'](util[_0xc05d('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x113b94['origtransfereruniqueid'],queues[_0x113b94['transfereeuniqueid']]['name'],queues[_0x113b94['transfereeuniqueid']][_0xc05d('0x8')],queues[_0x113b94['transfereeuniqueid']]['calleridname']));}else{utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x57'),_0x113b94[_0xc05d('0x4d')],queues[_0x113b94[_0xc05d('0x4e')]][_0xc05d('0x1c')],_0x113b94[_0xc05d('0x50')]));queues[_0x113b94[_0xc05d('0x4e')]]['transfereduniqueid']=_0x113b94[_0xc05d('0x50')];}}}else if(_0x113b94['secondtransfereruniqueid']==_0x113b94[_0xc05d('0x50')]){if(!_['isNil'](queues[_0x113b94[_0xc05d('0x4e')]])){utils[_0xc05d('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x113b94[_0xc05d('0x4d')],queues[_0x113b94[_0xc05d('0x4e')]][_0xc05d('0x1c')],_0x113b94['secondtransfereruniqueid'],_0x113b94[_0xc05d('0x58')]));queues[_0x113b94['origtransfererlinkedid']][_0xc05d('0x40')]=!![];queues[_0x113b94[_0xc05d('0x4e')]][_0xc05d('0x46')]=_0xc05d('0x59');queues[_0x113b94['origtransfererlinkedid']]['transferexten']=_0x113b94[_0xc05d('0x58')];queues[_0x113b94[_0xc05d('0x4e')]][_0xc05d('0x49')]=_0x113b94['secondtransfereruniqueid'];queues[_0x113b94['origtransfererlinkedid']][_0xc05d('0xa')]=_0xc05d('0x5a');}if(!_[_0xc05d('0x17')](queues[_0x113b94['secondtransfererlinkedid']])){if(_0x113b94[_0xc05d('0x5b')]&&queues[_0x113b94[_0xc05d('0x5b')]]){queues[_0x113b94['transfertargetlinkedid']][_0xc05d('0x1d')]=0x1;queues[_0x113b94[_0xc05d('0x53')]]=_[_0xc05d('0x5c')](queues[_0x113b94[_0xc05d('0x5b')]]);queues[_0x113b94['transfertargetuniqueid']]['transfereduniqueid']=_0x113b94[_0xc05d('0x53')];queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x1d')]=0x2;queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x8')]=queues[_0x113b94['origtransfererlinkedid']][_0xc05d('0x8')];queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x54')]=queues[_0x113b94[_0xc05d('0x4e')]][_0xc05d('0x54')];queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x35')]=utils['now']();queues[_0x113b94['transfertargetuniqueid']][_0xc05d('0x34')]=utils[_0xc05d('0x27')]();queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x55')]=0x0;queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x56')]=0x0;utils[_0xc05d('0x1')](util[_0xc05d('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x113b94[_0xc05d('0x4d')],queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x1c')],queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x10')],queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x8')],queues[_0x113b94[_0xc05d('0x53')]][_0xc05d('0x54')]));}else{utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x57'),_0x113b94[_0xc05d('0x4d')],queues[_0x113b94[_0xc05d('0x50')]]['name'],_0x113b94['origtransfererlinkedid']));queues[_0x113b94[_0xc05d('0x50')]][_0xc05d('0x10')]=_0x113b94['origtransfererlinkedid'];}}}}catch(_0x1ec6dd){utils[_0xc05d('0x1e')](util['format'](_0xc05d('0x4c'),_0x113b94['origtransfereruniqueid']),_0x1ec6dd);}};exports['musiconholdstart']=function(_0x35d213){try{if(!_['isNil'](queues[_0x35d213[_0xc05d('0x4')]])){utils[_0xc05d('0x12')](util[_0xc05d('0x2')](_0xc05d('0x5d'),_0x35d213[_0xc05d('0x4')]),_0x35d213);queues[_0x35d213[_0xc05d('0x4')]][_0xc05d('0x5e')]=utils[_0xc05d('0x27')]();utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x5f'),_0x35d213[_0xc05d('0x4')],queues[_0x35d213[_0xc05d('0x4')]]['name'],queues[_0x35d213[_0xc05d('0x4')]][_0xc05d('0x5e')]));}}catch(_0x3a3308){utils[_0xc05d('0x1e')](util[_0xc05d('0x2')](_0xc05d('0x5d'),_0x35d213[_0xc05d('0x4')]),_0x3a3308);}};exports[_0xc05d('0x60')]=function(_0x54810e){try{if(!_[_0xc05d('0x17')](queues[_0x54810e[_0xc05d('0x4')]])){if(!_[_0xc05d('0x17')](queues[_0x54810e[_0xc05d('0x4')]][_0xc05d('0x5e')])){utils[_0xc05d('0x12')](util[_0xc05d('0x2')](_0xc05d('0x61'),_0x54810e[_0xc05d('0x4')]),_0x54810e);queues[_0x54810e[_0xc05d('0x4')]][_0xc05d('0x56')]+=utils['diffTime'](utils[_0xc05d('0x27')](),queues[_0x54810e[_0xc05d('0x4')]][_0xc05d('0x5e')]);utils[_0xc05d('0x1')](util[_0xc05d('0x2')](_0xc05d('0x62'),_0x54810e[_0xc05d('0x4')],queues[_0x54810e['uniqueid']][_0xc05d('0x1c')],queues[_0x54810e[_0xc05d('0x4')]][_0xc05d('0x56')]));delete queues[_0x54810e[_0xc05d('0x4')]]['musiconholdstartAt'];}}}catch(_0x3ded27){utils[_0xc05d('0x1e')](util[_0xc05d('0x2')](_0xc05d('0x61'),_0x54810e[_0xc05d('0x4')]),_0x3ded27);}}; \ No newline at end of file +var _0xeb19=['isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup'];(function(_0x414f02,_0x37e299){var _0x1c2f57=function(_0x8cf1cf){while(--_0x8cf1cf){_0x414f02['push'](_0x414f02['shift']());}};_0x1c2f57(++_0x37e299);}(_0xeb19,0x1e2));var _0x9eb1=function(_0x479786,_0x4a9032){_0x479786=_0x479786-0x0;var _0x442df8=_0xeb19[_0x479786];return _0x442df8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9eb1('0x0'));var queues={};function writeDB(_0x3f2dfa){utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x2'),_0x3f2dfa[_0x9eb1('0x3')],_0x3f2dfa[_0x9eb1('0x4')],_0x3f2dfa[_0x9eb1('0x5')],_0x3f2dfa[_0x9eb1('0x6')],_0x3f2dfa['calleridnum'],_0x3f2dfa[_0x9eb1('0x7')],_0x3f2dfa[_0x9eb1('0x8')]));if(_0x3f2dfa['queue']){utils['getVoiceQueueByName'](_0x3f2dfa[_0x9eb1('0x5')])['then'](function(_0x36220e){if(_0x36220e){_0x3f2dfa[_0x9eb1('0x9')]=_0x36220e['type'];}utils['request'](_0x9eb1('0xa'),_0x3f2dfa);});}else{utils[_0x9eb1('0xb')]('CreateVoiceQueueReport',_0x3f2dfa);}if(_0x3f2dfa[_0x9eb1('0xc')]){delete queues[_0x3f2dfa[_0x9eb1('0xc')]];}else{delete queues[_0x3f2dfa[_0x9eb1('0x3')]];}}exports[_0x9eb1('0xd')]=function(_0xeff0c2){try{utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x10'),_0xeff0c2[_0x9eb1('0x3')]),_0xeff0c2);utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x11'),_0xeff0c2[_0x9eb1('0x3')],_0xeff0c2['queue'],_0xeff0c2['position']));queues[_0xeff0c2[_0x9eb1('0x3')]]=_[_0x9eb1('0x12')](_0xeff0c2,{'originalposition':_0xeff0c2[_0x9eb1('0x13')],'queuecallerjoinAt':utils[_0x9eb1('0x14')](),'mohtime':0x0});}catch(_0x3aa9c8){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')]('[%s][queues][queuecallerjoin]',_0xeff0c2[_0x9eb1('0x3')]),_0x3aa9c8);}};exports[_0x9eb1('0x16')]=function(_0x1f9845){try{if(!_[_0x9eb1('0x17')](queues[_0x1f9845[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x18'),_0x1f9845['uniqueid']),_0x1f9845);if(queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x19')]){if(!queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1a')]&&!queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1b')]){queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1c')]=!![];queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1d')]=utils['now']();queues[_0x1f9845['uniqueid']][_0x9eb1('0x8')]=_0x9eb1('0x1e');}utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x1f'),_0x1f9845['uniqueid'],queues[_0x1f9845['uniqueid']]['name'],queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x8')]));writeDB(queues[_0x1f9845[_0x9eb1('0x3')]]);}else if(queues[_0x1f9845[_0x9eb1('0x3')]]['transfereduniqueid']){utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x20'),_0x1f9845['uniqueid'],queues[_0x1f9845['uniqueid']][_0x9eb1('0x21')],queues[_0x1f9845[_0x9eb1('0x3')]]['transfereduniqueid']));queues[queues[_0x1f9845[_0x9eb1('0x3')]]['transfereduniqueid']]=queues[_0x1f9845[_0x9eb1('0x3')]];queues[queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0xc')]][_0x9eb1('0x22')]=0x2;delete queues[_0x1f9845['uniqueid']];}}}catch(_0x3ec7ba){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x18'),_0x1f9845['uniqueid']),_0x3ec7ba);}};exports['varset']=function(_0x5038bb){try{utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x23'),_0x5038bb['uniqueid']),_0x5038bb);if(!_[_0x9eb1('0x17')](_0x5038bb[_0x9eb1('0x24')][_0x9eb1('0x25')])&&_0x5038bb[_0x9eb1('0x26')][_0x9eb1('0x27')]()!==_0x9eb1('0x28')){if(!_[_0x9eb1('0x17')](queues[_0x5038bb[_0x9eb1('0x3')]])){queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x29')]=null;queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1b')]=!![];queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x2a')]=utils[_0x9eb1('0x14')]();queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x8')]=_0x5038bb[_0x9eb1('0x26')]['toUpperCase']();utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x2b'),_0x5038bb[_0x9eb1('0x3')],queues[_0x5038bb[_0x9eb1('0x3')]]['name'],_0x5038bb[_0x9eb1('0x26')],queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x8')]));writeDB(queues[_0x5038bb['uniqueid']]);}}else if(!_[_0x9eb1('0x17')](_0x5038bb['variable']['queueposition'])){if(!_[_0x9eb1('0x17')](queues[_0x5038bb[_0x9eb1('0x3')]])&&!queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1a')]){queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x5038bb['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1b')]=!![];queues[_0x5038bb['uniqueid']][_0x9eb1('0x2a')]=utils['now']();queues[_0x5038bb[_0x9eb1('0x3')]]['queuecallerexitreason']=_0x9eb1('0x2c');utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5038bb[_0x9eb1('0x3')],queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x21')],_0x5038bb[_0x9eb1('0x26')],queues[_0x5038bb[_0x9eb1('0x3')]]['queuecallerexitreason']));}}}catch(_0x2cdcec){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')]('[%s][queues][varset]',_0x5038bb['uniqueid']),_0x2cdcec);}};exports[_0x9eb1('0x1a')]=function(_0x215e0e){try{if(!_[_0x9eb1('0x17')](queues[_0x215e0e[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x2d'),_0x215e0e['uniqueid']),_0x215e0e);queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x1b')]=![];queues[_0x215e0e[_0x9eb1('0x3')]]['queuecallerexitAt']=null;queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=!![];queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x29')]=utils[_0x9eb1('0x14')]();queues[_0x215e0e[_0x9eb1('0x3')]]['queuecallerexitreason']=_0x9eb1('0x2e');utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x2f'),_0x215e0e['uniqueid'],queues[_0x215e0e['uniqueid']][_0x9eb1('0x21')],queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x8')]));}}catch(_0x587d95){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x2d'),_0x215e0e['uniqueid']),_0x587d95);}};exports['queuecallerleave']=function(_0x3ea86e){try{if(!_[_0x9eb1('0x17')](queues[_0x3ea86e[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')]('[%s][queues][queuecallerleave]',_0x3ea86e[_0x9eb1('0x3')]),_0x3ea86e);utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x30'),_0x3ea86e[_0x9eb1('0x3')],queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x21')],_0x3ea86e['connectedlinenum'],_0x3ea86e[_0x9eb1('0x31')]));queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x32')]=!![];queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x19')]=utils['now']();queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x33')]=utils[_0x9eb1('0x34')](queues[_0x3ea86e[_0x9eb1('0x3')]]['queuecallerleaveAt'],queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x35')]);queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x13')]=_0x3ea86e[_0x9eb1('0x13')];queues[_0x3ea86e[_0x9eb1('0x3')]]['count']=_0x3ea86e[_0x9eb1('0x36')];queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x37')]=_0x3ea86e[_0x9eb1('0x37')];queues[_0x3ea86e['uniqueid']][_0x9eb1('0x31')]=_0x3ea86e['connectedlinename'];}}catch(_0xb2a61c){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x38'),_0x3ea86e[_0x9eb1('0x3')]),_0xb2a61c);}};exports['agentconnect']=function(_0x179532){try{if(!_['isNil'](queues[_0x179532[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')]('[%s][queues][agentconnect]',_0x179532[_0x9eb1('0x3')]),_0x179532);utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x39'),_0x179532[_0x9eb1('0x3')],queues[_0x179532[_0x9eb1('0x3')]]['name'],_0x179532[_0x9eb1('0x3a')],_0x179532[_0x9eb1('0x3b')]));queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x29')]=null;queues[_0x179532['uniqueid']][_0x9eb1('0x1b')]=![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x8')]=null;queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x2a')]=null;queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x3c')]=!![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x7')]=_0x179532[_0x9eb1('0x3b')];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x6')]=_0x179532[_0x9eb1('0x3a')];}}catch(_0x22eafd){utils['error'](util[_0x9eb1('0xf')]('[%s][queues][agentconnect]',_0x179532[_0x9eb1('0x3')]),_0x22eafd);}};exports[_0x9eb1('0x3d')]=function(_0x4db9f2){try{if(!_[_0x9eb1('0x17')](queues[_0x4db9f2[_0x9eb1('0x3')]])){if(queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x19')]){utils['debug'](util[_0x9eb1('0xf')](_0x9eb1('0x3e'),_0x4db9f2[_0x9eb1('0x3')]),_0x4db9f2);queues[_0x4db9f2['uniqueid']][_0x9eb1('0x1a')]=![];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x4db9f2['uniqueid']][_0x9eb1('0x29')]=null;queues[_0x4db9f2['uniqueid']]['queuecallerexit']=![];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x2a')]=null;queues[_0x4db9f2[_0x9eb1('0x3')]]['assigned']=!![];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x6')]=_0x4db9f2[_0x9eb1('0x3a')];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x1c')]=!![];queues[_0x4db9f2['uniqueid']][_0x9eb1('0x1d')]=utils[_0x9eb1('0x14')]();if(_0x4db9f2[_0x9eb1('0x3f')]==_0x9eb1('0x40')){if(!queues[_0x4db9f2[_0x9eb1('0x3')]]['transfer']){queues[_0x4db9f2[_0x9eb1('0x3')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x4db9f2['uniqueid']][_0x9eb1('0x8')]='COMPLETEDBY'+_0x4db9f2[_0x9eb1('0x3f')]['toUpperCase']();}utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x4db9f2[_0x9eb1('0x3')],queues[_0x4db9f2[_0x9eb1('0x3')]]['name'],_0x4db9f2[_0x9eb1('0x3a')],queues[_0x4db9f2['uniqueid']][_0x9eb1('0x8')]));writeDB(queues[_0x4db9f2[_0x9eb1('0x3')]]);}}}catch(_0x385517){utils['error'](util[_0x9eb1('0xf')](_0x9eb1('0x3e'),_0x4db9f2[_0x9eb1('0x3')]),_0x385517);}};exports[_0x9eb1('0x41')]=function(_0x992c72){try{if(!_[_0x9eb1('0x17')](queues[_0x992c72[_0x9eb1('0x42')]])){utils[_0x9eb1('0xe')](util['format'](_0x9eb1('0x43'),_0x992c72[_0x9eb1('0x3')]),_0x992c72);queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x40')]=!![];queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x44')]=_0x9eb1('0x45');queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x46')]=_0x992c72[_0x9eb1('0x47')];queues[_0x992c72[_0x9eb1('0x42')]]['transferuniqueid']=_0x992c72[_0x9eb1('0x42')];queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x8')]='BLINDTRANSFER';utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x48'),_0x992c72['uniqueid'],queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x21')],_0x992c72[_0x9eb1('0x42')],_0x992c72['extension']));}}catch(_0x51c88f){utils['error'](util['format'](_0x9eb1('0x43'),_0x992c72[_0x9eb1('0x3')]),_0x51c88f);}};exports[_0x9eb1('0x49')]=function(_0x41ecf5){try{utils[_0x9eb1('0xe')](util['format']('[%s][queues][attendedtransfer]',_0x41ecf5[_0x9eb1('0x4a')]),_0x41ecf5);if(_0x41ecf5[_0x9eb1('0x4a')]==_0x41ecf5['origtransfererlinkedid']){if(!_[_0x9eb1('0x17')](queues[_0x41ecf5[_0x9eb1('0x4b')]])){utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x4c'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x4b')]]['name'],_0x41ecf5[_0x9eb1('0x4d')]));queues[_0x41ecf5[_0x9eb1('0x4b')]]['transfer']=!![];queues[_0x41ecf5[_0x9eb1('0x4b')]]['transfertype']=_0x9eb1('0x4e');queues[_0x41ecf5['secondtransfererlinkedid']][_0x9eb1('0x46')]=_0x41ecf5[_0x9eb1('0x4d')];queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x4f')]=_0x41ecf5['origtransfereruniqueid'];queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x8')]=_0x9eb1('0x50');}if(!_['isNil'](queues[_0x41ecf5[_0x9eb1('0x51')]])){if(_0x41ecf5[_0x9eb1('0x52')]&&queues[_0x41ecf5[_0x9eb1('0x52')]]){queues[_0x41ecf5[_0x9eb1('0x52')]]['queuecallerenterreason']=0x1;queues[_0x41ecf5[_0x9eb1('0x42')]]=_[_0x9eb1('0x53')](queues[_0x41ecf5[_0x9eb1('0x52')]]);queues[_0x41ecf5['transfereeuniqueid']][_0x9eb1('0xc')]=_0x41ecf5[_0x9eb1('0x54')];queues[_0x41ecf5[_0x9eb1('0x42')]]['queuecallerenterreason']=0x2;queues[_0x41ecf5[_0x9eb1('0x42')]]['calleridnum']=queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x55')];queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x56')]=queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x56')];queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x35')]=utils[_0x9eb1('0x14')]();queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x19')]=utils['now']();queues[_0x41ecf5[_0x9eb1('0x42')]]['holdtime']=0x0;queues[_0x41ecf5[_0x9eb1('0x42')]]['mohtime']=0x0;utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x57'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x42')]]['name'],queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x55')],queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x56')]));}else{utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x41ecf5['origtransfereruniqueid'],queues[_0x41ecf5['origtransfererlinkedid']]['name'],_0x41ecf5['secondtransfererlinkedid']));queues[_0x41ecf5[_0x9eb1('0x51')]]['transfereduniqueid']=_0x41ecf5[_0x9eb1('0x4b')];}}}else if(_0x41ecf5['secondtransfereruniqueid']==_0x41ecf5['secondtransfererlinkedid']){if(!_[_0x9eb1('0x17')](queues[_0x41ecf5['origtransfererlinkedid']])){utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x21')],_0x41ecf5[_0x9eb1('0x58')],_0x41ecf5[_0x9eb1('0x59')]));queues[_0x41ecf5[_0x9eb1('0x51')]]['transfer']=!![];queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x44')]='ATTENDED';queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x46')]=_0x41ecf5['secondtransfererexten'];queues[_0x41ecf5['origtransfererlinkedid']][_0x9eb1('0x4f')]=_0x41ecf5[_0x9eb1('0x58')];queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x9eb1('0x17')](queues[_0x41ecf5[_0x9eb1('0x4b')]])){if(_0x41ecf5[_0x9eb1('0x5a')]&&queues[_0x41ecf5['transfertargetlinkedid']]){queues[_0x41ecf5[_0x9eb1('0x5a')]][_0x9eb1('0x22')]=0x1;queues[_0x41ecf5[_0x9eb1('0x54')]]=_[_0x9eb1('0x53')](queues[_0x41ecf5[_0x9eb1('0x5a')]]);queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0xc')]=_0x41ecf5['transfertargetuniqueid'];queues[_0x41ecf5[_0x9eb1('0x54')]]['queuecallerenterreason']=0x2;queues[_0x41ecf5['transfertargetuniqueid']][_0x9eb1('0x55')]=queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x55')];queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x56')]=queues[_0x41ecf5['origtransfererlinkedid']]['calleridname'];queues[_0x41ecf5[_0x9eb1('0x54')]]['queuecallerjoinAt']=utils[_0x9eb1('0x14')]();queues[_0x41ecf5[_0x9eb1('0x54')]]['queuecallerleaveAt']=utils[_0x9eb1('0x14')]();queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x33')]=0x0;queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x5b')]=0x0;utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x5c'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5['transfertargetuniqueid']][_0x9eb1('0x21')],queues[_0x41ecf5['transfertargetuniqueid']][_0x9eb1('0xc')],queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x55')],queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x56')]));}else{utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x5d'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x21')],_0x41ecf5[_0x9eb1('0x51')]));queues[_0x41ecf5['secondtransfererlinkedid']][_0x9eb1('0xc')]=_0x41ecf5[_0x9eb1('0x51')];}}}}catch(_0x542729){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x5e'),_0x41ecf5[_0x9eb1('0x4a')]),_0x542729);}};exports[_0x9eb1('0x5f')]=function(_0x2d3e0b){try{if(!_[_0x9eb1('0x17')](queues[_0x2d3e0b[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x60'),_0x2d3e0b[_0x9eb1('0x3')]),_0x2d3e0b);queues[_0x2d3e0b[_0x9eb1('0x3')]]['musiconholdstartAt']=utils[_0x9eb1('0x14')]();utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x61'),_0x2d3e0b[_0x9eb1('0x3')],queues[_0x2d3e0b[_0x9eb1('0x3')]]['name'],queues[_0x2d3e0b[_0x9eb1('0x3')]][_0x9eb1('0x62')]));}}catch(_0x34d008){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x60'),_0x2d3e0b[_0x9eb1('0x3')]),_0x34d008);}};exports['musiconholdstop']=function(_0x16d42a){try{if(!_['isNil'](queues[_0x16d42a[_0x9eb1('0x3')]])){if(!_['isNil'](queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x62')])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x63'),_0x16d42a[_0x9eb1('0x3')]),_0x16d42a);queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x5b')]+=utils[_0x9eb1('0x34')](utils[_0x9eb1('0x14')](),queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x62')]);utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x64'),_0x16d42a[_0x9eb1('0x3')],queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x21')],queues[_0x16d42a['uniqueid']][_0x9eb1('0x5b')]));delete queues[_0x16d42a['uniqueid']][_0x9eb1('0x62')];}}}catch(_0x52bf79){utils['error'](util[_0x9eb1('0xf')]('[%s][queues][musiconholdstop]',_0x16d42a[_0x9eb1('0x3')]),_0x52bf79);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 8ff5c78..3648573 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 _0xefeb=['exten','context','channel','error','debug','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','find','monitors','push','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','appdata','application','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','queue','[%s][recordings][queuecallerjoin]','lodash','./utils','format','[%s][recordings][writeDB]','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','[%s][recordings][newchannel]','uniqueid','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s'];(function(_0x3d961e,_0x291cc8){var _0x5da581=function(_0x4ed012){while(--_0x4ed012){_0x3d961e['push'](_0x3d961e['shift']());}};_0x5da581(++_0x291cc8);}(_0xefeb,0x1a1));var _0xbefe=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xefeb[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xbefe('0x0'));var util=require('util');var utils=require(_0xbefe('0x1'));var recordings={};function writeDB(_0x2a95fc){utils['info'](util[_0xbefe('0x2')](_0xbefe('0x3'),_0x2a95fc['uniqueid']));if(_0x2a95fc['accountcode']){utils[_0xbefe('0x4')](_0x2a95fc[_0xbefe('0x5')])[_0xbefe('0x6')](function(_0x506ab5){if(_0x506ab5){_0x2a95fc[_0xbefe('0x7')]=_0x506ab5[_0xbefe('0x8')];_0x2a95fc[_0xbefe('0x9')]=_0x506ab5['id'];}utils[_0xbefe('0xa')]('CreateVoiceRecording',_0x2a95fc);});}else{utils[_0xbefe('0xa')](_0xbefe('0xb'),_0x2a95fc);}}exports['newchannel']=function(_0x4c7691){try{utils['debug'](util[_0xbefe('0x2')](_0xbefe('0xc'),_0x4c7691[_0xbefe('0xd')]),_0x4c7691);if(_0x4c7691[_0xbefe('0xd')]==_0x4c7691[_0xbefe('0xe')]){utils[_0xbefe('0xf')](util['format'](_0xbefe('0x10'),_0x4c7691[_0xbefe('0xd')],_0x4c7691['context'],_0x4c7691[_0xbefe('0x11')]));recordings[_0x4c7691['uniqueid']]={'uniqueid':_0x4c7691['uniqueid'],'accountcode':_0x4c7691[_0xbefe('0x5')],'exten':_0x4c7691[_0xbefe('0x11')],'context':_0x4c7691[_0xbefe('0x12')],'channel':_0x4c7691[_0xbefe('0x13')],'monitors':[]};}}catch(_0x571605){utils[_0xbefe('0x14')](util[_0xbefe('0x2')](_0xbefe('0xc'),_0x4c7691['uniqueid']),_0x571605);}};exports['newstate']=function(_0x4c1d57){try{utils[_0xbefe('0x15')](util[_0xbefe('0x2')](_0xbefe('0x16'),_0x4c1d57['uniqueid']),_0x4c1d57);if(!_['isNil'](recordings[_0x4c1d57[_0xbefe('0xd')]])&&_0x4c1d57[_0xbefe('0x17')]==0x6){utils[_0xbefe('0xf')](util[_0xbefe('0x2')](_0xbefe('0x18'),_0x4c1d57[_0xbefe('0xd')],_0x4c1d57[_0xbefe('0x12')],_0x4c1d57['channel']));}else if(!_[_0xbefe('0x19')](recordings[_0x4c1d57[_0xbefe('0xe')]])&&_0x4c1d57[_0xbefe('0x17')]==0x6&&_0x4c1d57['context']!='transfer'){utils['info'](util['format'](_0xbefe('0x1a'),_0x4c1d57[_0xbefe('0xd')],_0x4c1d57[_0xbefe('0xe')],_0x4c1d57[_0xbefe('0x12')],_0x4c1d57[_0xbefe('0x13')]));recordings[_0x4c1d57['linkedid']]['accountcode']=_0x4c1d57[_0xbefe('0x5')];}}catch(_0x3a4142){utils[_0xbefe('0x14')](util[_0xbefe('0x2')]('[%s][recordings][newstate]',_0x4c1d57[_0xbefe('0xd')]),_0x3a4142);}};exports[_0xbefe('0x1b')]=function(_0x3061a7){try{if(!_[_0xbefe('0x19')](_0x3061a7['variable'])&&!_['isNil'](_0x3061a7[_0xbefe('0x1c')][_0xbefe('0x1d')])){utils[_0xbefe('0x15')](util[_0xbefe('0x2')](_0xbefe('0x1e'),_0x3061a7[_0xbefe('0xd')]),_0x3061a7);utils[_0xbefe('0xf')](util[_0xbefe('0x2')](_0xbefe('0x1f'),_0x3061a7['uniqueid'],_0x3061a7[_0xbefe('0x1c')],_0x3061a7['value']));if(_['endsWith'](_0x3061a7['value'],'.wav49')){_0x3061a7['value']=_0x3061a7[_0xbefe('0x20')][_0xbefe('0x21')](_0xbefe('0x22'),_0xbefe('0x23'));}if(recordings[_0x3061a7[_0xbefe('0xe')]]){var _0x2c03a4=_[_0xbefe('0x24')](recordings[_0x3061a7[_0xbefe('0xe')]][_0xbefe('0x25')],{'value':_0x3061a7['value']});if(_[_0xbefe('0x19')](_0x2c03a4)){recordings[_0x3061a7[_0xbefe('0xe')]][_0xbefe('0x25')][_0xbefe('0x26')]({'value':_0x3061a7[_0xbefe('0x20')]});}}}}catch(_0x414542){utils[_0xbefe('0x14')](util[_0xbefe('0x2')](_0xbefe('0x1e'),_0x3061a7[_0xbefe('0xd')]),_0x414542);}};exports['hangup']=function(_0x32d0e9){try{if(!_[_0xbefe('0x19')](recordings[_0x32d0e9[_0xbefe('0xd')]])){utils[_0xbefe('0x15')](util[_0xbefe('0x2')](_0xbefe('0x27'),_0x32d0e9[_0xbefe('0xd')]),_0x32d0e9);utils[_0xbefe('0xf')](util[_0xbefe('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x32d0e9['uniqueid'],_0x32d0e9[_0xbefe('0x28')],_0x32d0e9[_0xbefe('0x29')],_0x32d0e9[_0xbefe('0x2a')]));recordings[_0x32d0e9[_0xbefe('0xd')]]['calleridnum']=_0x32d0e9[_0xbefe('0x28')];recordings[_0x32d0e9[_0xbefe('0xd')]]['calleridname']=_0x32d0e9['calleridname'];recordings[_0x32d0e9['uniqueid']][_0xbefe('0x2b')]=_0x32d0e9[_0xbefe('0x2b')];recordings[_0x32d0e9[_0xbefe('0xd')]][_0xbefe('0x2c')]=_0x32d0e9['connectedlinename'];if(recordings[_0x32d0e9[_0xbefe('0xd')]][_0xbefe('0x2d')]==_0xbefe('0x2e')&&recordings[_0x32d0e9['uniqueid']]['accountcode']){recordings[_0x32d0e9[_0xbefe('0xd')]][_0xbefe('0x2b')]=recordings[_0x32d0e9[_0xbefe('0xd')]]['accountcode'];recordings[_0x32d0e9[_0xbefe('0xd')]][_0xbefe('0x2c')]='';}recordings[_0x32d0e9[_0xbefe('0xd')]][_0xbefe('0x25')][_0xbefe('0x2f')](function(_0x552abe){var _0x276528=_[_0xbefe('0x30')](recordings[_0x32d0e9['uniqueid']]);_0x276528['value']=_0x552abe[_0xbefe('0x20')];writeDB(_0x276528);});delete recordings[_0x32d0e9[_0xbefe('0xd')]];}}catch(_0x21cfba){utils['error'](util[_0xbefe('0x2')](_0xbefe('0x27'),_0x32d0e9[_0xbefe('0xd')]),_0x21cfba);}};exports[_0xbefe('0x31')]=function(_0x4e5447){try{if(!_[_0xbefe('0x19')](recordings[_0x4e5447[_0xbefe('0xd')]])){utils[_0xbefe('0x15')](util[_0xbefe('0x2')](_0xbefe('0x32'),_0x4e5447['uniqueid']),_0x4e5447);utils['info'](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x4e5447['uniqueid'],_0x4e5447['application'],_0x4e5447[_0xbefe('0x33')]));if(_0x4e5447[_0xbefe('0x34')][_0xbefe('0x35')]()==_0xbefe('0x36')&&_[_0xbefe('0x37')](_0x4e5447[_0xbefe('0x33')]['toLowerCase'](),_0xbefe('0x38'))){var _0x5da6b8=_0x4e5447[_0xbefe('0x33')]['split']('=');var _0x1b7aa4=_0x5da6b8[0x0][_0xbefe('0x39')](_0x5da6b8[0x0][_0xbefe('0x3a')]('(')+0x1,_0x5da6b8[0x0][_0xbefe('0x3a')](')'));var _0x71107a=_0x5da6b8[0x1];recordings[_0x4e5447[_0xbefe('0xd')]][_0x1b7aa4]=_0x71107a;}}}catch(_0x5e9924){utils['error'](util[_0xbefe('0x2')]('[%s][recordings][newexten]',_0x4e5447[_0xbefe('0xd')]),_0x5e9924);}};exports[_0xbefe('0x3b')]=function(_0x1bf5b5){try{if(!_['isNil'](recordings[_0x1bf5b5[_0xbefe('0xd')]])){utils[_0xbefe('0x15')](util[_0xbefe('0x2')]('[%s][recordings][queuecallerjoin]',_0x1bf5b5[_0xbefe('0xd')]),_0x1bf5b5);utils[_0xbefe('0xf')](util[_0xbefe('0x2')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1bf5b5['uniqueid'],_0x1bf5b5[_0xbefe('0x3c')]));recordings[_0x1bf5b5[_0xbefe('0xd')]]['queue']=_0x1bf5b5[_0xbefe('0x3c')];}}catch(_0x3b4615){utils['error'](util[_0xbefe('0x2')](_0xbefe('0x3d'),_0x1bf5b5[_0xbefe('0xd')]),_0x3b4615);}}; \ No newline at end of file +var _0x1b0a=['queue','lodash','util','./utils','info','format','accountcode','then','name','request','CreateVoiceRecording','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','uniqueid','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','endsWith','.wav49','value','replace','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','substring','lastIndexOf','[%s][recordings][queuecallerjoin]'];(function(_0x572a41,_0x2b777a){var _0x26cfda=function(_0x5b8127){while(--_0x5b8127){_0x572a41['push'](_0x572a41['shift']());}};_0x26cfda(++_0x2b777a);}(_0x1b0a,0x97));var _0xa1b0=function(_0x2de086,_0x13d466){_0x2de086=_0x2de086-0x0;var _0x346757=_0x1b0a[_0x2de086];return _0x346757;};'use strict';var _=require(_0xa1b0('0x0'));var util=require(_0xa1b0('0x1'));var utils=require(_0xa1b0('0x2'));var recordings={};function writeDB(_0x2c43fa){utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')]('[%s][recordings][writeDB]',_0x2c43fa['uniqueid']));if(_0x2c43fa[_0xa1b0('0x5')]){utils['getUserByInternal'](_0x2c43fa['accountcode'])[_0xa1b0('0x6')](function(_0x41e5ac){if(_0x41e5ac){_0x2c43fa['membername']=_0x41e5ac[_0xa1b0('0x7')];_0x2c43fa['UserId']=_0x41e5ac['id'];}utils[_0xa1b0('0x8')]('CreateVoiceRecording',_0x2c43fa);});}else{utils[_0xa1b0('0x8')](_0xa1b0('0x9'),_0x2c43fa);}}exports['newchannel']=function(_0x59b78f){try{utils[_0xa1b0('0xa')](util['format']('[%s][recordings][newchannel]',_0x59b78f['uniqueid']),_0x59b78f);if(_0x59b78f['uniqueid']==_0x59b78f[_0xa1b0('0xb')]){utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')](_0xa1b0('0xc'),_0x59b78f[_0xa1b0('0xd')],_0x59b78f[_0xa1b0('0xe')],_0x59b78f[_0xa1b0('0xf')]));recordings[_0x59b78f['uniqueid']]={'uniqueid':_0x59b78f[_0xa1b0('0xd')],'accountcode':_0x59b78f[_0xa1b0('0x5')],'exten':_0x59b78f[_0xa1b0('0xf')],'context':_0x59b78f[_0xa1b0('0xe')],'channel':_0x59b78f['channel'],'monitors':[]};}}catch(_0x401680){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')]('[%s][recordings][newchannel]',_0x59b78f[_0xa1b0('0xd')]),_0x401680);}};exports[_0xa1b0('0x11')]=function(_0x1003e9){try{utils[_0xa1b0('0xa')](util[_0xa1b0('0x4')](_0xa1b0('0x12'),_0x1003e9['uniqueid']),_0x1003e9);if(!_[_0xa1b0('0x13')](recordings[_0x1003e9[_0xa1b0('0xd')]])&&_0x1003e9['channelstate']==0x6){utils['info'](util[_0xa1b0('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1003e9['uniqueid'],_0x1003e9['context'],_0x1003e9[_0xa1b0('0x14')]));}else if(!_['isNil'](recordings[_0x1003e9[_0xa1b0('0xb')]])&&_0x1003e9['channelstate']==0x6&&_0x1003e9['context']!='transfer'){utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')](_0xa1b0('0x15'),_0x1003e9['uniqueid'],_0x1003e9[_0xa1b0('0xb')],_0x1003e9['context'],_0x1003e9[_0xa1b0('0x14')]));recordings[_0x1003e9[_0xa1b0('0xb')]][_0xa1b0('0x5')]=_0x1003e9[_0xa1b0('0x5')];}}catch(_0x32481d){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')](_0xa1b0('0x12'),_0x1003e9[_0xa1b0('0xd')]),_0x32481d);}};exports['varset']=function(_0x39030d){try{if(!_[_0xa1b0('0x13')](_0x39030d[_0xa1b0('0x16')])&&!_[_0xa1b0('0x13')](_0x39030d[_0xa1b0('0x16')]['mixmonitor_filename'])){utils[_0xa1b0('0xa')](util[_0xa1b0('0x4')](_0xa1b0('0x17'),_0x39030d['uniqueid']),_0x39030d);utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x39030d[_0xa1b0('0xd')],_0x39030d[_0xa1b0('0x16')],_0x39030d['value']));if(_[_0xa1b0('0x18')](_0x39030d['value'],_0xa1b0('0x19'))){_0x39030d[_0xa1b0('0x1a')]=_0x39030d[_0xa1b0('0x1a')][_0xa1b0('0x1b')](_0xa1b0('0x19'),'.WAV');}if(recordings[_0x39030d[_0xa1b0('0xb')]]){var _0x317c77=_[_0xa1b0('0x1c')](recordings[_0x39030d[_0xa1b0('0xb')]][_0xa1b0('0x1d')],{'value':_0x39030d[_0xa1b0('0x1a')]});if(_['isNil'](_0x317c77)){recordings[_0x39030d[_0xa1b0('0xb')]][_0xa1b0('0x1d')]['push']({'value':_0x39030d[_0xa1b0('0x1a')]});}}}}catch(_0x515764){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')]('[%s][recordings][varset]',_0x39030d[_0xa1b0('0xd')]),_0x515764);}};exports['hangup']=function(_0xb09338){try{if(!_[_0xa1b0('0x13')](recordings[_0xb09338[_0xa1b0('0xd')]])){utils['debug'](util['format'](_0xa1b0('0x1e'),_0xb09338[_0xa1b0('0xd')]),_0xb09338);utils['info'](util[_0xa1b0('0x4')](_0xa1b0('0x1f'),_0xb09338['uniqueid'],_0xb09338['calleridnum'],_0xb09338['calleridname'],_0xb09338[_0xa1b0('0x20')]));recordings[_0xb09338['uniqueid']][_0xa1b0('0x21')]=_0xb09338[_0xa1b0('0x21')];recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x22')]=_0xb09338[_0xa1b0('0x22')];recordings[_0xb09338['uniqueid']]['connectedlinenum']=_0xb09338[_0xa1b0('0x23')];recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x24')]=_0xb09338[_0xa1b0('0x24')];if(recordings[_0xb09338['uniqueid']]['type']=='outbound'&&recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x5')]){recordings[_0xb09338[_0xa1b0('0xd')]]['connectedlinenum']=recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x5')];recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x24')]='';}recordings[_0xb09338[_0xa1b0('0xd')]]['monitors'][_0xa1b0('0x25')](function(_0x359277){var _0x5ce930=_[_0xa1b0('0x26')](recordings[_0xb09338[_0xa1b0('0xd')]]);_0x5ce930['value']=_0x359277['value'];writeDB(_0x5ce930);});delete recordings[_0xb09338[_0xa1b0('0xd')]];}}catch(_0x8fc0aa){utils[_0xa1b0('0x10')](util['format'](_0xa1b0('0x1e'),_0xb09338[_0xa1b0('0xd')]),_0x8fc0aa);}};exports[_0xa1b0('0x27')]=function(_0xa96708){try{if(!_[_0xa1b0('0x13')](recordings[_0xa96708[_0xa1b0('0xd')]])){utils['debug'](util[_0xa1b0('0x4')](_0xa1b0('0x28'),_0xa96708[_0xa1b0('0xd')]),_0xa96708);utils[_0xa1b0('0x3')](util['format'](_0xa1b0('0x29'),_0xa96708['uniqueid'],_0xa96708['application'],_0xa96708['appdata']));if(_0xa96708[_0xa1b0('0x2a')][_0xa1b0('0x2b')]()=='set'&&_[_0xa1b0('0x2c')](_0xa96708[_0xa1b0('0x2d')]['toLowerCase'](),'cdr')){var _0x5be97a=_0xa96708['appdata']['split']('=');var _0xd7749c=_0x5be97a[0x0][_0xa1b0('0x2e')](_0x5be97a[0x0]['lastIndexOf']('(')+0x1,_0x5be97a[0x0][_0xa1b0('0x2f')](')'));var _0x4d6237=_0x5be97a[0x1];recordings[_0xa96708[_0xa1b0('0xd')]][_0xd7749c]=_0x4d6237;}}}catch(_0x443fea){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')](_0xa1b0('0x28'),_0xa96708[_0xa1b0('0xd')]),_0x443fea);}};exports['queuecallerjoin']=function(_0x28b9f5){try{if(!_[_0xa1b0('0x13')](recordings[_0x28b9f5[_0xa1b0('0xd')]])){utils[_0xa1b0('0xa')](util[_0xa1b0('0x4')](_0xa1b0('0x30'),_0x28b9f5[_0xa1b0('0xd')]),_0x28b9f5);utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x28b9f5['uniqueid'],_0x28b9f5[_0xa1b0('0x31')]));recordings[_0x28b9f5[_0xa1b0('0xd')]][_0xa1b0('0x31')]=_0x28b9f5[_0xa1b0('0x31')];}}catch(_0x5b060a){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')](_0xa1b0('0x30'),_0x28b9f5[_0xa1b0('0xd')]),_0x5b060a);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 8d3d3e2..fcb73f2 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 _0xaedf=['origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xaedf,0x13e));var _0xfaed=function(_0x1f94a0,_0xddea50){_0x1f94a0=_0x1f94a0-0x0;var _0x5cb0ba=_0xaedf[_0x1f94a0];return _0x5cb0ba;};'use strict';var _=require(_0xfaed('0x0'));var util=require('util');var utils=require(_0xfaed('0x1'));function writeDB(_0x3bf0a4){utils['info'](util[_0xfaed('0x2')](_0xfaed('0x3'),_0x3bf0a4[_0xfaed('0x4')]===_0xfaed('0x5')?_0x3bf0a4[_0xfaed('0x6')]:_0x3bf0a4[_0xfaed('0x7')],_0x3bf0a4[_0xfaed('0x4')]));utils['request'](_0xfaed('0x8'),_0x3bf0a4);}exports['blindtransfer']=function(_0x27f84e){try{utils[_0xfaed('0x9')](util[_0xfaed('0x2')]('[%s][transfers][blindtransfer]',_0x27f84e[_0xfaed('0x7')]),_0x27f84e);utils['info'](util[_0xfaed('0x2')](_0xfaed('0xa'),_0x27f84e[_0xfaed('0x7')],_0x27f84e[_0xfaed('0xb')],_0x27f84e['transferercalleridname'],_0x27f84e['transfereecalleridnum'],_0x27f84e['transfereecalleridname']));_0x27f84e[_0xfaed('0x4')]=_0xfaed('0xc');writeDB(_0x27f84e);}catch(_0x1bf825){utils[_0xfaed('0xd')](util['format'](_0xfaed('0xe'),_0x27f84e[_0xfaed('0x7')]),_0x1bf825);}};exports[_0xfaed('0xf')]=function(_0xe896b){try{utils[_0xfaed('0x9')](util[_0xfaed('0x2')]('[%s][transfers][attendedtransfer]',_0xe896b['origtransfereruniqueid']),_0xe896b);utils['info'](util[_0xfaed('0x2')](_0xfaed('0x10'),_0xe896b['origtransfereruniqueid'],_0xe896b[_0xfaed('0x11')],_0xe896b[_0xfaed('0x12')],_0xe896b[_0xfaed('0x13')],_0xe896b[_0xfaed('0x14')]));_0xe896b=_['assign'](_0xe896b,{'transfererchannel':_0xe896b[_0xfaed('0x15')],'transferercalleridnum':_0xe896b[_0xfaed('0x11')],'transferercalleridname':_0xe896b['origtransferercalleridname'],'transfererconnectedlinenum':_0xe896b[_0xfaed('0x16')],'transfererconnectedlinename':_0xe896b[_0xfaed('0x17')],'transfereraccountcode':_0xe896b[_0xfaed('0x18')],'transferercontext':_0xe896b[_0xfaed('0x19')],'transfererexten':_0xe896b[_0xfaed('0x1a')],'transfererlinkedid':_0xe896b['origtransfererlinkedid'],'context':_0xe896b[_0xfaed('0x1b')],'extension':_0xe896b[_0xfaed('0x1c')],'type':_0xfaed('0x5')});if(_[_0xfaed('0x1d')](_0xe896b[_0xfaed('0x1e')])){_0xe896b=_[_0xfaed('0x1f')](_0xe896b,{'transfereechannel':_0xe896b['transfertargetchannel'],'transfereecalleridnum':_0xe896b[_0xfaed('0x13')],'transfereecalleridname':_0xe896b[_0xfaed('0x14')],'transfereeconnectedlinenum':_0xe896b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xe896b['transfertargetconnectedlinename'],'transfereeaccountcode':_0xe896b['transfertargetaccountcode'],'transfereecontext':_0xe896b[_0xfaed('0x20')],'transfereeexten':_0xe896b[_0xfaed('0x21')],'transfereelinkedid':_0xe896b[_0xfaed('0x22')]});}writeDB(_0xe896b);}catch(_0x3c7a5d){utils[_0xfaed('0xd')](util[_0xfaed('0x2')](_0xfaed('0x23'),_0xe896b['origtransfereruniqueid']),_0x3c7a5d);}}; \ No newline at end of file +var _0xe9e8=['attended','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type'];(function(_0x414180,_0x1f980b){var _0x37b029=function(_0x4105b1){while(--_0x4105b1){_0x414180['push'](_0x414180['shift']());}};_0x37b029(++_0x1f980b);}(_0xe9e8,0x7e));var _0x8e9e=function(_0x46c275,_0x5577fd){_0x46c275=_0x46c275-0x0;var _0x364b9f=_0xe9e8[_0x46c275];return _0x364b9f;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var utils=require('./utils');function writeDB(_0x2946bf){utils[_0x8e9e('0x2')](util[_0x8e9e('0x3')](_0x8e9e('0x4'),_0x2946bf[_0x8e9e('0x5')]===_0x8e9e('0x6')?_0x2946bf['origtransfereruniqueid']:_0x2946bf[_0x8e9e('0x7')],_0x2946bf[_0x8e9e('0x5')]));utils[_0x8e9e('0x8')](_0x8e9e('0x9'),_0x2946bf);}exports['blindtransfer']=function(_0x350294){try{utils[_0x8e9e('0xa')](util[_0x8e9e('0x3')](_0x8e9e('0xb'),_0x350294[_0x8e9e('0x7')]),_0x350294);utils[_0x8e9e('0x2')](util['format'](_0x8e9e('0xc'),_0x350294[_0x8e9e('0x7')],_0x350294[_0x8e9e('0xd')],_0x350294[_0x8e9e('0xe')],_0x350294['transfereecalleridnum'],_0x350294[_0x8e9e('0xf')]));_0x350294[_0x8e9e('0x5')]=_0x8e9e('0x10');writeDB(_0x350294);}catch(_0x2afb38){utils[_0x8e9e('0x11')](util['format'](_0x8e9e('0xb'),_0x350294[_0x8e9e('0x7')]),_0x2afb38);}};exports[_0x8e9e('0x12')]=function(_0x2070b2){try{utils['debug'](util[_0x8e9e('0x3')](_0x8e9e('0x13'),_0x2070b2[_0x8e9e('0x14')]),_0x2070b2);utils['info'](util[_0x8e9e('0x3')](_0x8e9e('0x15'),_0x2070b2[_0x8e9e('0x14')],_0x2070b2['origtransferercalleridnum'],_0x2070b2[_0x8e9e('0x16')],_0x2070b2['transfertargetcalleridnum'],_0x2070b2[_0x8e9e('0x17')]));_0x2070b2=_[_0x8e9e('0x18')](_0x2070b2,{'transfererchannel':_0x2070b2['origtransfererchannel'],'transferercalleridnum':_0x2070b2[_0x8e9e('0x19')],'transferercalleridname':_0x2070b2[_0x8e9e('0x16')],'transfererconnectedlinenum':_0x2070b2[_0x8e9e('0x1a')],'transfererconnectedlinename':_0x2070b2[_0x8e9e('0x1b')],'transfereraccountcode':_0x2070b2[_0x8e9e('0x1c')],'transferercontext':_0x2070b2[_0x8e9e('0x1d')],'transfererexten':_0x2070b2[_0x8e9e('0x1e')],'transfererlinkedid':_0x2070b2[_0x8e9e('0x1f')],'context':_0x2070b2[_0x8e9e('0x20')],'extension':_0x2070b2[_0x8e9e('0x21')],'type':_0x8e9e('0x6')});if(_[_0x8e9e('0x22')](_0x2070b2[_0x8e9e('0x23')])){_0x2070b2=_['assign'](_0x2070b2,{'transfereechannel':_0x2070b2[_0x8e9e('0x24')],'transfereecalleridnum':_0x2070b2[_0x8e9e('0x25')],'transfereecalleridname':_0x2070b2[_0x8e9e('0x17')],'transfereeconnectedlinenum':_0x2070b2[_0x8e9e('0x26')],'transfereeconnectedlinename':_0x2070b2[_0x8e9e('0x27')],'transfereeaccountcode':_0x2070b2[_0x8e9e('0x28')],'transfereecontext':_0x2070b2[_0x8e9e('0x29')],'transfereeexten':_0x2070b2[_0x8e9e('0x2a')],'transfereelinkedid':_0x2070b2[_0x8e9e('0x2b')]});}writeDB(_0x2070b2);}catch(_0x40a3f9){utils[_0x8e9e('0x11')](util[_0x8e9e('0x3')](_0x8e9e('0x13'),_0x2070b2[_0x8e9e('0x14')]),_0x40a3f9);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index af650bf..8c3698c 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 _0x27a0=['result','length','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','getUserByInternal','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x27a0,0xbf));var _0x027a=function(_0x1c78b5,_0x3ef9d7){_0x1c78b5=_0x1c78b5-0x0;var _0x1d6baa=_0x27a0[_0x1c78b5];return _0x1d6baa;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var util=require(_0x027a('0x2'));var client=jayson[_0x027a('0x3')][_0x027a('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x47cd65,_0x30a54d){logger[_0x027a('0x5')](_0x47cd65,_0x30a54d?util[_0x027a('0x6')](_0x30a54d,{'showHidden':![],'depth':null}):'');};exports[_0x027a('0x7')]=function(_0xe233ed,_0x3c7d67){logger['debug'](_0xe233ed,_0x3c7d67?util[_0x027a('0x6')](_0x3c7d67,{'showHidden':![],'depth':null}):'');};exports[_0x027a('0x8')]=function(_0x277f49,_0x4ccee2){logger[_0x027a('0x8')](_0x277f49,_0x4ccee2?util[_0x027a('0x6')](_0x4ccee2,{'showHidden':![],'depth':null}):'');};exports[_0x027a('0x9')]=function(_0x534902,_0x6d5b04){return client[_0x027a('0x9')](_0x534902,{'body':_0x6d5b04})[_0x027a('0xa')](function(_0x2ca4f0){logger[_0x027a('0x7')](_0x027a('0xb'),_0x534902,_0x2ca4f0?util[_0x027a('0x6')](_0x2ca4f0,{'showHidden':![],'depth':null}):'');})[_0x027a('0xc')](function(_0x351d7e){logger[_0x027a('0x8')](_0x027a('0xb'),_0x534902,_0x351d7e?util['inspect'](_0x351d7e,{'showHidden':![],'depth':null}):'');});};function getUser(_0xe64d3a){return client[_0x027a('0x9')](_0x027a('0xd'),{'options':{'raw':!![],'attributes':['id',_0x027a('0xe'),_0x027a('0xf'),'interface'],'where':_0xe64d3a,'limit':0x1}})['then'](function(_0x1d680d){logger['debug'](_0x027a('0x10'),JSON['stringify'](_0xe64d3a),_0x1d680d?util[_0x027a('0x6')](_0x1d680d,{'showHidden':![],'depth':null}):'');return _0x1d680d['result']['length']?_0x1d680d['result'][0x0]:null;});}exports[_0x027a('0x11')]=function(_0x2f04e9){return new BPromise(function(_0x826d19,_0x1fb40b){if(_0x2f04e9){return getUser({'internal':_0x2f04e9})['then'](function(_0x282e70){logger[_0x027a('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2f04e9,_0x282e70?'found':_0x027a('0x12'));return _0x826d19(_0x282e70);})['catch'](function(_0x1d4a7a){logger['error']('[utils][getUserByInternal]',_0x1d4a7a?util['inspect'](_0x1d4a7a,{'showHidden':![],'depth':null}):'');return _0x826d19(null);});}return _0x826d19(null);});};exports['getUserByInterface']=function(_0x18efe7){return new BPromise(function(_0x11e254,_0x266c9e){if(_0x18efe7){return getUser({'interface':_0x18efe7})[_0x027a('0xa')](function(_0x51b870){logger[_0x027a('0x5')](_0x027a('0x13'),_0x18efe7,_0x51b870?_0x027a('0x14'):_0x027a('0x12'));return _0x11e254(_0x51b870);})[_0x027a('0xc')](function(_0x3bbd46){logger['error'](_0x027a('0x15'),_0x3bbd46?util['inspect'](_0x3bbd46,{'showHidden':![],'depth':null}):'');return _0x11e254(null);});}return _0x11e254(null);});};exports[_0x027a('0x16')]=function(_0x2e97c5){return new BPromise(function(_0x1b1a13,_0x83fe3e){if(_0x2e97c5){return getUser({'name':_0x2e97c5})['then'](function(_0x559381){logger[_0x027a('0x5')](_0x027a('0x17'),_0x2e97c5,_0x559381?_0x027a('0x14'):_0x027a('0x12'));return _0x1b1a13(_0x559381);})['catch'](function(_0x1b5325){logger['error'](_0x027a('0x18'),_0x1b5325?util['inspect'](_0x1b5325,{'showHidden':![],'depth':null}):'');return _0x1b1a13(null);});}return _0x1b1a13(null);});};exports[_0x027a('0x19')]=function(_0x4d5a25){return new BPromise(function(_0x578ea5,_0x31385d){if(_0x4d5a25){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x027a('0xf'),'type',_0x027a('0x1a'),'acwTimeout'],'where':{'name':_0x4d5a25},'limit':0x1}})[_0x027a('0xa')](function(_0xc99acc){logger['debug'](_0x027a('0x1b'),_0x4d5a25,_0xc99acc?util['inspect'](_0xc99acc,{'showHidden':![],'depth':null}):'');logger[_0x027a('0x5')](_0x027a('0x1c'),_0x4d5a25,_0xc99acc?_0x027a('0x14'):_0x027a('0x12'));return _0x578ea5(_0xc99acc[_0x027a('0x1d')][_0x027a('0x1e')]?_0xc99acc['result'][0x0]:null);})[_0x027a('0xc')](function(_0x592350){logger[_0x027a('0x8')]('[utils][getVoiceQueueByName]',_0x592350?util[_0x027a('0x6')](_0x592350,{'showHidden':![],'depth':null}):'');return _0x578ea5(null);});}return _0x578ea5(null);});};exports[_0x027a('0x1f')]=function(_0x44a10c,_0x307e3c){return moment(_0x44a10c)[_0x027a('0x20')](_0x307e3c,'seconds')[_0x027a('0x21')](_0x027a('0x22'));};exports[_0x027a('0x23')]=function(_0x2aefb7,_0x14cb87){return moment(_0x2aefb7)[_0x027a('0x24')](_0x14cb87,_0x027a('0x25'))[_0x027a('0x21')](_0x027a('0x22'));};exports[_0x027a('0x26')]=function(_0xacabe,_0x5e2d2a){return moment(_0xacabe)[_0x027a('0x27')](moment(_0x5e2d2a),_0x027a('0x25'));};exports[_0x027a('0x28')]=function(_0x32c36e,_0x19b476){return parseInt(_0x32c36e,0xa)+parseInt(_0x19b476,0xa);};exports[_0x027a('0x29')]=function(){return moment()[_0x027a('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x027a('0x2a')]=function(_0x280f46,_0xb646de){if(_0xb646de){return moment(_0x280f46)['isAfter'](_0xb646de);}return!![];};exports[_0x027a('0x2b')]=function(_0x5b7602,_0x38469a){if(_0x38469a){return moment(_0x5b7602)[_0x027a('0x2b')](_0x38469a);}else if(_0x5b7602){return!![];}return![];}; \ No newline at end of file +var _0x8d8b=['GetVoiceQueue','name','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','interface','[utils][getUser]\x20where:%s','stringify','length','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName'];(function(_0x1ac852,_0x185e6e){var _0x4f9fbf=function(_0x39ea01){while(--_0x39ea01){_0x1ac852['push'](_0x1ac852['shift']());}};_0x4f9fbf(++_0x185e6e);}(_0x8d8b,0x75));var _0xb8d8=function(_0x1e0715,_0x1df11a){_0x1e0715=_0x1e0715-0x0;var _0x5c69f3=_0x8d8b[_0x1e0715];return _0x5c69f3;};'use strict';var BPromise=require(_0xb8d8('0x0'));var jayson=require(_0xb8d8('0x1'));var moment=require(_0xb8d8('0x2'));var util=require(_0xb8d8('0x3'));var client=jayson[_0xb8d8('0x4')][_0xb8d8('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xb8d8('0x6'));exports[_0xb8d8('0x7')]=function(_0xf2802e,_0x5494a0){logger[_0xb8d8('0x7')](_0xf2802e,_0x5494a0?util[_0xb8d8('0x8')](_0x5494a0,{'showHidden':![],'depth':null}):'');};exports[_0xb8d8('0x9')]=function(_0xab0f64,_0x445296){logger[_0xb8d8('0x9')](_0xab0f64,_0x445296?util[_0xb8d8('0x8')](_0x445296,{'showHidden':![],'depth':null}):'');};exports[_0xb8d8('0xa')]=function(_0x503337,_0x2bc0f9){logger[_0xb8d8('0xa')](_0x503337,_0x2bc0f9?util[_0xb8d8('0x8')](_0x2bc0f9,{'showHidden':![],'depth':null}):'');};exports[_0xb8d8('0xb')]=function(_0x217e2d,_0x523dc2){return client['request'](_0x217e2d,{'body':_0x523dc2})['then'](function(_0x1868e8){logger['debug']('[utils][request]\x20name:%s',_0x217e2d,_0x1868e8?util[_0xb8d8('0x8')](_0x1868e8,{'showHidden':![],'depth':null}):'');})[_0xb8d8('0xc')](function(_0x1087e7){logger['error'](_0xb8d8('0xd'),_0x217e2d,_0x1087e7?util['inspect'](_0x1087e7,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1196b3){return client[_0xb8d8('0xb')](_0xb8d8('0xe'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xb8d8('0xf')],'where':_0x1196b3,'limit':0x1}})['then'](function(_0x53f7a9){logger[_0xb8d8('0x9')](_0xb8d8('0x10'),JSON[_0xb8d8('0x11')](_0x1196b3),_0x53f7a9?util[_0xb8d8('0x8')](_0x53f7a9,{'showHidden':![],'depth':null}):'');return _0x53f7a9['result'][_0xb8d8('0x12')]?_0x53f7a9['result'][0x0]:null;});}exports[_0xb8d8('0x13')]=function(_0x2e7c07){return new BPromise(function(_0x44f509,_0x443c21){if(_0x2e7c07){return getUser({'internal':_0x2e7c07})[_0xb8d8('0x14')](function(_0x75303c){logger[_0xb8d8('0x7')](_0xb8d8('0x15'),_0x2e7c07,_0x75303c?'found':_0xb8d8('0x16'));return _0x44f509(_0x75303c);})['catch'](function(_0x1aba16){logger['error']('[utils][getUserByInternal]',_0x1aba16?util[_0xb8d8('0x8')](_0x1aba16,{'showHidden':![],'depth':null}):'');return _0x44f509(null);});}return _0x44f509(null);});};exports[_0xb8d8('0x17')]=function(_0x2b3ac0){return new BPromise(function(_0x3737ac,_0x2248bf){if(_0x2b3ac0){return getUser({'interface':_0x2b3ac0})[_0xb8d8('0x14')](function(_0x1a5f07){logger[_0xb8d8('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2b3ac0,_0x1a5f07?_0xb8d8('0x18'):_0xb8d8('0x16'));return _0x3737ac(_0x1a5f07);})[_0xb8d8('0xc')](function(_0x388e3c){logger['error'](_0xb8d8('0x19'),_0x388e3c?util['inspect'](_0x388e3c,{'showHidden':![],'depth':null}):'');return _0x3737ac(null);});}return _0x3737ac(null);});};exports[_0xb8d8('0x1a')]=function(_0x396f41){return new BPromise(function(_0x4cf0c6,_0x51e437){if(_0x396f41){return getUser({'name':_0x396f41})[_0xb8d8('0x14')](function(_0x25b043){logger['info'](_0xb8d8('0x1b'),_0x396f41,_0x25b043?_0xb8d8('0x18'):_0xb8d8('0x16'));return _0x4cf0c6(_0x25b043);})[_0xb8d8('0xc')](function(_0x59515c){logger[_0xb8d8('0xa')](_0xb8d8('0x1c'),_0x59515c?util[_0xb8d8('0x8')](_0x59515c,{'showHidden':![],'depth':null}):'');return _0x4cf0c6(null);});}return _0x4cf0c6(null);});};exports[_0xb8d8('0x1d')]=function(_0x4ec643){return new BPromise(function(_0x335dff,_0x4bcd11){if(_0x4ec643){return client[_0xb8d8('0xb')](_0xb8d8('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xb8d8('0x1f'),'type',_0xb8d8('0x20'),'acwTimeout'],'where':{'name':_0x4ec643},'limit':0x1}})[_0xb8d8('0x14')](function(_0x885cff){logger[_0xb8d8('0x9')](_0xb8d8('0x21'),_0x4ec643,_0x885cff?util[_0xb8d8('0x8')](_0x885cff,{'showHidden':![],'depth':null}):'');logger[_0xb8d8('0x7')](_0xb8d8('0x22'),_0x4ec643,_0x885cff?_0xb8d8('0x18'):_0xb8d8('0x16'));return _0x335dff(_0x885cff[_0xb8d8('0x23')]['length']?_0x885cff['result'][0x0]:null);})[_0xb8d8('0xc')](function(_0x590a95){logger[_0xb8d8('0xa')](_0xb8d8('0x24'),_0x590a95?util[_0xb8d8('0x8')](_0x590a95,{'showHidden':![],'depth':null}):'');return _0x335dff(null);});}return _0x335dff(null);});};exports[_0xb8d8('0x25')]=function(_0x2e05b0,_0x59c571){return moment(_0x2e05b0)[_0xb8d8('0x26')](_0x59c571,_0xb8d8('0x27'))[_0xb8d8('0x28')](_0xb8d8('0x29'));};exports[_0xb8d8('0x2a')]=function(_0x52874f,_0x557790){return moment(_0x52874f)[_0xb8d8('0x2b')](_0x557790,_0xb8d8('0x27'))[_0xb8d8('0x28')](_0xb8d8('0x29'));};exports[_0xb8d8('0x2c')]=function(_0x43aea9,_0x1cb66e){return moment(_0x43aea9)[_0xb8d8('0x2d')](moment(_0x1cb66e),_0xb8d8('0x27'));};exports[_0xb8d8('0x2e')]=function(_0xfe0c97,_0x19da6c){return parseInt(_0xfe0c97,0xa)+parseInt(_0x19da6c,0xa);};exports['now']=function(){return moment()[_0xb8d8('0x28')](_0xb8d8('0x29'));};exports[_0xb8d8('0x2f')]=function(_0x420433,_0x3224f0){if(_0x3224f0){return moment(_0x420433)[_0xb8d8('0x2f')](_0x3224f0);}return!![];};exports[_0xb8d8('0x30')]=function(_0x4ac6da,_0x5dcb5d){if(_0x5dcb5d){return moment(_0x4ac6da)[_0xb8d8('0x30')](_0x5dcb5d);}else if(_0x4ac6da){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 2b296b3..890ad3e 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 _0x8bf7=['api','auth','set','client-side-logger','use','logger','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','agent_id','agent_name','test','setupLoggers','lodash','express-winston','path','util','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','log','client','role','name','ensureDir','then','catch','user','no-user','timestamp'];(function(_0x593b28,_0x4bac1a){var _0x4516ae=function(_0x49a9b4){while(--_0x49a9b4){_0x593b28['push'](_0x593b28['shift']());}};_0x4516ae(++_0x4bac1a);}(_0x8bf7,0xa1));var _0x78bf=function(_0x4cf7fc,_0x2987ce){_0x4cf7fc=_0x4cf7fc-0x0;var _0x2ab5e0=_0x8bf7[_0x4cf7fc];return _0x2ab5e0;};var fs=require('fs-extra');var _=require(_0x78bf('0x0'));var ewinston=require(_0x78bf('0x1'));var path=require(_0x78bf('0x2'));var util=require(_0x78bf('0x3'));var fileLogger=require('./loggers')[_0x78bf('0x4')];var safeTemplate=require(_0x78bf('0x5'))[_0x78bf('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0x78bf('0x7')];function ClientSideLogger(){function _0x23bf24(_0x1f108f){var _0x3e9629=path[_0x78bf('0x8')]('/var',_0x78bf('0x9'),'xcally');var _0x4307a3=path[_0x78bf('0x8')](_0x78bf('0xa'),_0x1f108f[_0x78bf('0xb')]+'-'+_0x1f108f[_0x78bf('0xc')]);return fs[_0x78bf('0xd')](path[_0x78bf('0x8')](_0x3e9629,_0x4307a3))[_0x78bf('0xe')](function(){var _0x251d65=fileLogger(_0x78bf('0xa'),path['join'](_0x3e9629,_0x4307a3));return _0x251d65;})[_0x78bf('0xf')](function(_0x4e3d0e){throw _0x4e3d0e;});}this[_0x78bf('0x9')]=function(_0x445e3f,_0x3ab6c6,_0x42421b,_0x1af0c2){return _0x23bf24(_0x445e3f[_0x78bf('0x10')])['then'](function(_0x9c0c3f){var _0x597b92=_0x9c0c3f[_0x3ab6c6];return _0x597b92;})[_0x78bf('0xe')](function(_0x39a2f0){var _0x30a834=_0x445e3f[_0x78bf('0x10')]?_0x445e3f['user']['id']:_0x78bf('0x11');var _0xd537a3=_0x1af0c2['data'];var _0x18d7f8=_0x1af0c2[_0x78bf('0x12')];var _0x28f354=new Date(Number(_0x18d7f8));return _0x39a2f0(_0x30a834,_0x28f354,_0x42421b,_0xd537a3);})[_0x78bf('0xf')](function(_0x1d54ed){fileLogger(_0x78bf('0xa'))['error'](_0x1d54ed);});};}function setupLoggers(_0x561f09){return new Promise(function(_0x4da809){var _0x28ca7a=new ClientSideLogger();var _0x3df9b8=fileLogger(_0x78bf('0x13'));var _0x2cc830=fileLogger(_0x78bf('0x14'));_0x561f09[_0x78bf('0x15')](_0x78bf('0x16'),_0x28ca7a);_0x561f09[_0x78bf('0x17')](ewinston[_0x78bf('0x18')]({'winstonInstance':_0x3df9b8,'meta':![],'statusLevels':!![],'msg':function(_0x2640e9,_0x5bf665){var _0x542109='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x78bf('0x19')](_0x2640e9[_0x78bf('0x1a')])){_0x542109+=_0x78bf('0x1b');var _0x5c7f56=_0x2640e9[_0x78bf('0x1a')];maskSensitiveData(_0x5c7f56);}return safeTemplate(util[_0x78bf('0x1c')](_0x542109,_0x2640e9[_0x78bf('0x1d')],_0x2640e9[_0x78bf('0x1e')][_0x78bf('0x1f')]?_0x2640e9[_0x78bf('0x1e')]['x-forwarded-for']:_0x2640e9[_0x78bf('0x20')][_0x78bf('0x21')]||_0x2640e9['ip'],_0x2640e9[_0x78bf('0x22')],_0x5bf665['statusCode'],_0x5bf665[_0x78bf('0x23')],_0x2640e9[_0x78bf('0x10')]?_0x2640e9[_0x78bf('0x10')]['id']:null,_0x2640e9[_0x78bf('0x10')]?_0x2640e9[_0x78bf('0x10')][_0x78bf('0xc')]:null,_0x2640e9[_0x78bf('0x10')]?_0x2640e9[_0x78bf('0x10')][_0x78bf('0xb')]:null,_0x5c7f56?util[_0x78bf('0x24')](_0x5c7f56,![],null):''));}}));_0x561f09[_0x78bf('0x17')](ewinston[_0x78bf('0x18')]({'winstonInstance':_0x2cc830,'meta':![],'statusLevels':!![],'msg':function(_0x59242d,_0x32f36b){var _0x4f1bfa=_0x78bf('0x25');if(_0x59242d[_0x78bf('0x1a')]&&_0x59242d['body'][_0x78bf('0x26')]&&_0x59242d[_0x78bf('0x1a')]['agent_id']){_0x4f1bfa=_0x78bf('0x27');}return util[_0x78bf('0x1c')](_0x4f1bfa,_0x59242d['method'],_0x59242d[_0x78bf('0x1e')][_0x78bf('0x1f')]?_0x59242d[_0x78bf('0x1e')]['x-forwarded-for']:_0x59242d[_0x78bf('0x20')]['remoteAddress']||_0x59242d['ip'],_0x59242d[_0x78bf('0x22')],_0x32f36b[_0x78bf('0x28')],_0x32f36b[_0x78bf('0x23')],_0x59242d[_0x78bf('0x10')]?_0x59242d[_0x78bf('0x10')]['id']:null,_0x59242d['user']?_0x59242d[_0x78bf('0x10')][_0x78bf('0xc')]:null,_0x59242d[_0x78bf('0x10')]?_0x59242d[_0x78bf('0x10')]['role']:null,_0x59242d[_0x78bf('0x1a')]&&_0x59242d[_0x78bf('0x1a')][_0x78bf('0x26')]?_0x59242d[_0x78bf('0x1a')]['device']:'other',_0x59242d[_0x78bf('0x1a')]&&_0x59242d['body']['agent_id']?_0x59242d[_0x78bf('0x1a')][_0x78bf('0x29')]:'',_0x59242d[_0x78bf('0x1a')]&&_0x59242d[_0x78bf('0x1a')]['agent_name']?_0x59242d[_0x78bf('0x1a')][_0x78bf('0x2a')]:'');},'ignoreRoute':function(_0x570c43){var _0x50748a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x50748a[_0x78bf('0x2b')](_0x570c43[_0x78bf('0x22')]);}}));return _0x4da809();});}exports[_0x78bf('0x2c')]=setupLoggers; \ No newline at end of file +var _0xd0c0=['body','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','responseTime','agent_id','agent_name','test','setupLoggers','fs-extra','express-winston','path','util','./loggers','fileLogger','./safe-template','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','data','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty'];(function(_0x5f0256,_0x8f0ba0){var _0x3f4d3d=function(_0x53819c){while(--_0x53819c){_0x5f0256['push'](_0x5f0256['shift']());}};_0x3f4d3d(++_0x8f0ba0);}(_0xd0c0,0xf2));var _0x0d0c=function(_0xfc8468,_0x434456){_0xfc8468=_0xfc8468-0x0;var _0x2b62c1=_0xd0c0[_0xfc8468];return _0x2b62c1;};var fs=require(_0x0d0c('0x0'));var _=require('lodash');var ewinston=require(_0x0d0c('0x1'));var path=require(_0x0d0c('0x2'));var util=require(_0x0d0c('0x3'));var fileLogger=require(_0x0d0c('0x4'))[_0x0d0c('0x5')];var safeTemplate=require(_0x0d0c('0x6'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0x0d0c('0x7')];function ClientSideLogger(){function _0x469d18(_0x54ea3a){var _0x333246=path[_0x0d0c('0x8')](_0x0d0c('0x9'),_0x0d0c('0xa'),_0x0d0c('0xb'));var _0x5793d2=path[_0x0d0c('0x8')](_0x0d0c('0xc'),_0x54ea3a[_0x0d0c('0xd')]+'-'+_0x54ea3a[_0x0d0c('0xe')]);return fs[_0x0d0c('0xf')](path[_0x0d0c('0x8')](_0x333246,_0x5793d2))[_0x0d0c('0x10')](function(){var _0x169dd4=fileLogger(_0x0d0c('0xc'),path[_0x0d0c('0x8')](_0x333246,_0x5793d2));return _0x169dd4;})[_0x0d0c('0x11')](function(_0x5603ba){throw _0x5603ba;});}this[_0x0d0c('0xa')]=function(_0x2aece4,_0x512a01,_0x4677a1,_0x2ddb4c){return _0x469d18(_0x2aece4[_0x0d0c('0x12')])[_0x0d0c('0x10')](function(_0x52ea45){var _0x48c01e=_0x52ea45[_0x512a01];return _0x48c01e;})['then'](function(_0x595aae){var _0x13ede8=_0x2aece4['user']?_0x2aece4[_0x0d0c('0x12')]['id']:'no-user';var _0x4a9cbe=_0x2ddb4c[_0x0d0c('0x13')];var _0x40e7ec=_0x2ddb4c['timestamp'];var _0x1034c6=new Date(Number(_0x40e7ec));return _0x595aae(_0x13ede8,_0x1034c6,_0x4677a1,_0x4a9cbe);})[_0x0d0c('0x11')](function(_0x3a9007){fileLogger(_0x0d0c('0xc'))['error'](_0x3a9007);});};}function setupLoggers(_0x59d381){return new Promise(function(_0x396b50){var _0x51124c=new ClientSideLogger();var _0x3e34c7=fileLogger(_0x0d0c('0x14'));var _0x3432b7=fileLogger(_0x0d0c('0x15'));_0x59d381[_0x0d0c('0x16')](_0x0d0c('0x17'),_0x51124c);_0x59d381[_0x0d0c('0x18')](ewinston[_0x0d0c('0x19')]({'winstonInstance':_0x3e34c7,'meta':![],'statusLevels':!![],'msg':function(_0xedd847,_0x3224a7){var _0x2c88f9=_0x0d0c('0x1a');if(!_[_0x0d0c('0x1b')](_0xedd847['body'])){_0x2c88f9+='\x20body=%s';var _0x585a3c=_0xedd847[_0x0d0c('0x1c')];maskSensitiveData(_0x585a3c);}return safeTemplate(util['format'](_0x2c88f9,_0xedd847[_0x0d0c('0x1d')],_0xedd847[_0x0d0c('0x1e')][_0x0d0c('0x1f')]?_0xedd847['headers'][_0x0d0c('0x1f')]:_0xedd847[_0x0d0c('0x20')][_0x0d0c('0x21')]||_0xedd847['ip'],_0xedd847[_0x0d0c('0x22')],_0x3224a7[_0x0d0c('0x23')],_0x3224a7['responseTime'],_0xedd847[_0x0d0c('0x12')]?_0xedd847[_0x0d0c('0x12')]['id']:null,_0xedd847['user']?_0xedd847[_0x0d0c('0x12')][_0x0d0c('0xe')]:null,_0xedd847[_0x0d0c('0x12')]?_0xedd847['user']['role']:null,_0x585a3c?util['inspect'](_0x585a3c,![],null):''));}}));_0x59d381[_0x0d0c('0x18')](ewinston[_0x0d0c('0x19')]({'winstonInstance':_0x3432b7,'meta':![],'statusLevels':!![],'msg':function(_0x3c8b7f,_0x44ebed){var _0xc10ba3=_0x0d0c('0x24');if(_0x3c8b7f[_0x0d0c('0x1c')]&&_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x25')]&&_0x3c8b7f[_0x0d0c('0x1c')]['agent_id']){_0xc10ba3=_0x0d0c('0x26');}return util[_0x0d0c('0x27')](_0xc10ba3,_0x3c8b7f['method'],_0x3c8b7f[_0x0d0c('0x1e')][_0x0d0c('0x1f')]?_0x3c8b7f[_0x0d0c('0x1e')][_0x0d0c('0x1f')]:_0x3c8b7f[_0x0d0c('0x20')][_0x0d0c('0x21')]||_0x3c8b7f['ip'],_0x3c8b7f['url'],_0x44ebed[_0x0d0c('0x23')],_0x44ebed[_0x0d0c('0x28')],_0x3c8b7f[_0x0d0c('0x12')]?_0x3c8b7f[_0x0d0c('0x12')]['id']:null,_0x3c8b7f[_0x0d0c('0x12')]?_0x3c8b7f['user'][_0x0d0c('0xe')]:null,_0x3c8b7f[_0x0d0c('0x12')]?_0x3c8b7f[_0x0d0c('0x12')][_0x0d0c('0xd')]:null,_0x3c8b7f['body']&&_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x25')]?_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x25')]:'other',_0x3c8b7f[_0x0d0c('0x1c')]&&_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x29')]?_0x3c8b7f['body']['agent_id']:'',_0x3c8b7f[_0x0d0c('0x1c')]&&_0x3c8b7f['body'][_0x0d0c('0x2a')]?_0x3c8b7f[_0x0d0c('0x1c')]['agent_name']:'');},'ignoreRoute':function(_0x5684d8){var _0x5f44a5=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5f44a5[_0x0d0c('0x2b')](_0x5684d8[_0x0d0c('0x22')]);}}));return _0x396b50();});}exports[_0x0d0c('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index e99b02e..dbfaabb 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf399=['split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','exports','circularMonthInterval','hours','minutes','clone','day','isBetween','ddd','includes','dowCompare','date','daysInMonth','max','domCompare','format','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid'];(function(_0x4844f7,_0xfe429){var _0x58a07e=function(_0x5cb1b5){while(--_0x5cb1b5){_0x4844f7['push'](_0x4844f7['shift']());}};_0x58a07e(++_0xfe429);}(_0xf399,0x148));var _0x9f39=function(_0x4e442b,_0x51c529){_0x4e442b=_0x4e442b-0x0;var _0x48daa8=_0xf399[_0x4e442b];return _0x48daa8;};var _=require(_0x9f39('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][_0x9f39('0x1')](function(_0x3759ed){return _0x3759ed[_0x9f39('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x9f39('0x3');var EINVALID_DATE=_0x9f39('0x4');function throwIfDateNotValid(_0x23077d){if(!_0x23077d['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0xacad9a){var _0x3fa907=_0xacad9a[_0x9f39('0x5')](':')[_0x9f39('0x1')](function(_0x150d21){return parseInt(_0x150d21,0xa);});var _0x1b8aef=_0x3fa907[0x0];var _0x587d14=_0x3fa907[0x1];if(_0x1b8aef<0x0||_0x1b8aef>0x17||_0x587d14<0x0||_0x587d14>0x3b){throw new Error(EINVALID_DATE);}return[_0x1b8aef,_0x587d14];}function circularDoWInterval(_0x4013bc,_0x8212e9){if(_0x4013bc===_0x8212e9){return[_0x4013bc];}else{var _0x114119=moment['locale']();moment[_0x9f39('0x6')]('en');var _0x4de6e4=moment[_0x9f39('0x7')]()[_0x9f39('0x1')](function(_0x3b50fd){return _0x3b50fd[_0x9f39('0x8')]();});moment[_0x9f39('0x6')](_0x114119);var _0x4414c8=_0x4de6e4[_0x9f39('0x9')](_0x4013bc);var _0x1a970a=_0x4de6e4['indexOf'](_0x8212e9);if(_0x1a970a>_0x4414c8){return _0x4de6e4[_0x9f39('0xa')](_0x4414c8,_0x1a970a+0x1);}else{var _0x785ef7=_0x4de6e4[_0x9f39('0xa')](0x0,_0x1a970a+0x1);var _0x3e9c40=_0x4de6e4[_0x9f39('0xa')](_0x4414c8);return _0x3e9c40[_0x9f39('0xb')](_0x785ef7);}}}module['exports'][_0x9f39('0xc')]=circularDoWInterval;function circularMonthInterval(_0x3b70a6,_0x6c0b1a){if(_0x3b70a6===_0x6c0b1a){return[_0x3b70a6];}else{var _0x5e04da=moment[_0x9f39('0x6')]();moment[_0x9f39('0x6')]('en');var _0xe3bc30=moment[_0x9f39('0xd')]()[_0x9f39('0x1')](function(_0x192363){return _0x192363[_0x9f39('0x8')]();});moment[_0x9f39('0x6')](_0x5e04da);var _0x2629c8=_0xe3bc30[_0x9f39('0x9')](_0x3b70a6);var _0x25a22f=_0xe3bc30[_0x9f39('0x9')](_0x6c0b1a);if(_0x25a22f>_0x2629c8){return _0xe3bc30[_0x9f39('0xa')](_0x2629c8,_0x25a22f+0x1);}else{var _0x42343a=_0xe3bc30['slice'](0x0,_0x25a22f+0x1);var _0x3c1c7d=_0xe3bc30['slice'](_0x2629c8);return _0x3c1c7d['concat'](_0x42343a);}}}module[_0x9f39('0xe')][_0x9f39('0xf')]=circularMonthInterval;function parseDom(_0x46fe4a){var _0x2ffd80=parseInt(_0x46fe4a,0xa);if(_0x2ffd80<0x1||_0x2ffd80>0x1f){throw new Error(EINVALID_DATE);}return _0x2ffd80;}function timeCompare(_0x37b904,_0x99783d,_0x2afade){var _0x23ab9b=_0x37b904['clone']();var _0x3a2150=extractTime(_0x99783d);var _0x1e8ceb=_0x3a2150[0x0];var _0x5b2dba=_0x3a2150[0x1];var _0x4927ad=_0x37b904['clone']()[_0x9f39('0x10')](_0x1e8ceb)[_0x9f39('0x11')](_0x5b2dba);throwIfDateNotValid(_0x4927ad);var _0x127ed0=extractTime(_0x2afade);var _0x5341d8=_0x127ed0[0x0];var _0x1d044b=_0x127ed0[0x1];var _0x2db123=_0x37b904[_0x9f39('0x12')]()[_0x9f39('0x10')](_0x5341d8)[_0x9f39('0x11')](_0x1d044b);throwIfDateNotValid(_0x2db123);if(_0x2db123['isBefore'](_0x4927ad)){var _0x3b6ec1=_0x23ab9b['clone']()['startOf'](_0x9f39('0x13'));var _0xf0c5de=_0x23ab9b[_0x9f39('0x12')]()['endOf'](_0x9f39('0x13'));return _0x23ab9b[_0x9f39('0x14')](_0x4927ad,_0xf0c5de,undefined,'[]')||_0x23ab9b['isBetween'](_0x3b6ec1,_0x2db123,undefined,'[]');}else{return _0x23ab9b['isBetween'](_0x4927ad,_0x2db123,undefined,'[]');}}module[_0x9f39('0xe')]['timeCompare']=timeCompare;function dowCompare(_0x31b621,_0x201ba7,_0x29a6f6){var _0x3068ae=_0x31b621['locale']('en')['format'](_0x9f39('0x15'))[_0x9f39('0x8')]();return circularDoWInterval(_0x201ba7,_0x29a6f6)[_0x9f39('0x16')](_0x3068ae);}module[_0x9f39('0xe')][_0x9f39('0x17')]=dowCompare;function domCompare(_0x3661cf,_0x111876,_0x18a7de){var _0x5afe81=_0x3661cf[_0x9f39('0x18')]();if(_0x111876===_0x18a7de){return _0x5afe81===_0x111876;}else{var _0x5eb0a5=_0x3661cf[_0x9f39('0x19')]();var _0x1bda93=_0x111876<_0x18a7de;let _0x3fae93=![];var _0x2aef6d=0x0;var _0x30f613=0x0;if(_0x1bda93){_0x2aef6d=Math[_0x9f39('0x1a')](0x1,_0x111876);_0x30f613=Math['min'](_0x18a7de,_0x5eb0a5);_0x3fae93=_0x5afe81>=_0x2aef6d&&_0x5afe81<=_0x30f613;}else{_0x2aef6d=Math['min'](_0x111876,_0x5eb0a5);_0x30f613=Math[_0x9f39('0x1a')](0x1,_0x18a7de);_0x3fae93=_0x5afe81>=_0x2aef6d||_0x5afe81<=_0x30f613;}return _0x3fae93;}}module[_0x9f39('0xe')][_0x9f39('0x1b')]=domCompare;function monthCompare(_0x1dede7,_0x2d1c1d,_0x5de22c){var _0x4efc8e=_0x1dede7[_0x9f39('0x6')]('en')[_0x9f39('0x1c')](_0x9f39('0x1d'))[_0x9f39('0x8')]();return circularMonthInterval(_0x2d1c1d,_0x5de22c)[_0x9f39('0x16')](_0x4efc8e);}module['exports'][_0x9f39('0x1e')]=monthCompare;function iftime(_0x5a4a0a,_0xe847c4=moment['tz'][_0x9f39('0x1f')](),_0x252de6=moment()){if(!validateRx[_0x9f39('0x20')](_0x5a4a0a)){throw new Error(EINVALID_STRING);}else{var _0xb5dd7=(moment[_0x9f39('0x21')](_0x252de6)?_0x252de6[_0x9f39('0x12')]():moment(_0x252de6))['tz'](_0xe847c4)[_0x9f39('0x6')]('en');throwIfDateNotValid(_0xb5dd7);var _0x5723a4=_0x5a4a0a[_0x9f39('0x5')](',');var _0x5cda7a=_0x5723a4[0x0];var _0x2693ae=_0x5723a4[0x1];var _0x4b62ec=_0x5723a4[0x2];var _0x2a6f6e=_0x5723a4[0x3];let _0x1a6a8f=!![];if(_0x5cda7a!=='*'){var _0x184a61=_0x5cda7a[_0x9f39('0x5')]('-');var _0x1d9e9a=_[_0x9f39('0x22')](_0x184a61[0x0],0x5,'0');var _0x2f6d57=_0x184a61[_0x9f39('0x23')]===0x2?_[_0x9f39('0x22')](_0x184a61[0x1],0x5,'0'):_0x1d9e9a;_0x1a6a8f=timeCompare(_0xb5dd7,_0x1d9e9a,_0x2f6d57);}let _0x314022=!![];if(_0x2693ae!=='*'){var _0x5cda1e=_0x2693ae[_0x9f39('0x5')]('-');var _0x2b0635=_0x5cda1e[0x0];var _0x55b333=_0x5cda1e['length']===0x2?_0x5cda1e[0x1]:_0x2b0635;_0x314022=dowCompare(_0xb5dd7,_0x2b0635,_0x55b333);}let _0x336745=!![];if(_0x4b62ec!=='*'){var _0x5832d3=_0x4b62ec[_0x9f39('0x5')]('-');var _0x2b2db4=parseDom(_0x5832d3[0x0]);var _0x16f89b=_0x5832d3['length']===0x2?parseDom(_0x5832d3[0x1]):_0x2b2db4;_0x336745=domCompare(_0xb5dd7,_0x2b2db4,_0x16f89b);}let _0x2d01ab=!![];if(_0x2a6f6e!=='*'){var _0x356f1a=_0x2a6f6e[_0x9f39('0x5')]('-');var _0x1c79b1=_0x356f1a[0x0];var _0x4db942=_0x356f1a['length']===0x2?_0x356f1a[0x1]:_0x356f1a[0x0];_0x2d01ab=monthCompare(_0xb5dd7,_0x1c79b1,_0x4db942);}return _0x1a6a8f&&_0x314022&&_0x336745&&_0x2d01ab;}}module[_0x9f39('0xe')][_0x9f39('0x24')]=iftime; \ No newline at end of file +var _0xc7b6=['monthCompare','guess','test','isMoment','split','padStart','length','iftime','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','locale','weekdaysShort','map','indexOf','slice','concat','circularDoWInterval','monthsShort','toLowerCase','exports','clone','minutes','hours','startOf','day','endOf','isBetween','timeCompare','format','dowCompare','date','daysInMonth','max','min','includes'];(function(_0x5d9a9d,_0x926a50){var _0x4324db=function(_0xa2ae5b){while(--_0xa2ae5b){_0x5d9a9d['push'](_0x5d9a9d['shift']());}};_0x4324db(++_0x926a50);}(_0xc7b6,0x1dc));var _0x6c7b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc7b6[_0x40a045];return _0x1a687c;};var _=require(_0x6c7b('0x0'));var moment=require(_0x6c7b('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x133274){return _0x133274[_0x6c7b('0x2')];})[_0x6c7b('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x6c7b('0x4');var EINVALID_DATE=_0x6c7b('0x5');function throwIfDateNotValid(_0x2be9b8){if(!_0x2be9b8['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x26a56e){var _0x5cf677=_0x26a56e['split'](':')['map'](function(_0x4fa6ad){return parseInt(_0x4fa6ad,0xa);});var _0x177c7c=_0x5cf677[0x0];var _0x38574b=_0x5cf677[0x1];if(_0x177c7c<0x0||_0x177c7c>0x17||_0x38574b<0x0||_0x38574b>0x3b){throw new Error(EINVALID_DATE);}return[_0x177c7c,_0x38574b];}function circularDoWInterval(_0x4d4d63,_0x11e632){if(_0x4d4d63===_0x11e632){return[_0x4d4d63];}else{var _0xed90c9=moment[_0x6c7b('0x6')]();moment['locale']('en');var _0x45dd4f=moment[_0x6c7b('0x7')]()[_0x6c7b('0x8')](function(_0x2b8f4f){return _0x2b8f4f['toLowerCase']();});moment[_0x6c7b('0x6')](_0xed90c9);var _0x49c6fa=_0x45dd4f['indexOf'](_0x4d4d63);var _0x1a922b=_0x45dd4f[_0x6c7b('0x9')](_0x11e632);if(_0x1a922b>_0x49c6fa){return _0x45dd4f['slice'](_0x49c6fa,_0x1a922b+0x1);}else{var _0x593a59=_0x45dd4f[_0x6c7b('0xa')](0x0,_0x1a922b+0x1);var _0x58955=_0x45dd4f[_0x6c7b('0xa')](_0x49c6fa);return _0x58955[_0x6c7b('0xb')](_0x593a59);}}}module['exports'][_0x6c7b('0xc')]=circularDoWInterval;function circularMonthInterval(_0x184c0f,_0x311778){if(_0x184c0f===_0x311778){return[_0x184c0f];}else{var _0x41dd9c=moment[_0x6c7b('0x6')]();moment['locale']('en');var _0x2a0f4b=moment[_0x6c7b('0xd')]()[_0x6c7b('0x8')](function(_0x2eb44e){return _0x2eb44e[_0x6c7b('0xe')]();});moment['locale'](_0x41dd9c);var _0x1bed38=_0x2a0f4b[_0x6c7b('0x9')](_0x184c0f);var _0x2e83eb=_0x2a0f4b[_0x6c7b('0x9')](_0x311778);if(_0x2e83eb>_0x1bed38){return _0x2a0f4b[_0x6c7b('0xa')](_0x1bed38,_0x2e83eb+0x1);}else{var _0xf6fe=_0x2a0f4b[_0x6c7b('0xa')](0x0,_0x2e83eb+0x1);var _0x112e51=_0x2a0f4b[_0x6c7b('0xa')](_0x1bed38);return _0x112e51[_0x6c7b('0xb')](_0xf6fe);}}}module[_0x6c7b('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x40f55b){var _0x1310e7=parseInt(_0x40f55b,0xa);if(_0x1310e7<0x1||_0x1310e7>0x1f){throw new Error(EINVALID_DATE);}return _0x1310e7;}function timeCompare(_0x4c49df,_0x5889ac,_0x27a99a){var _0x381aae=_0x4c49df[_0x6c7b('0x10')]();var _0x57a1e5=extractTime(_0x5889ac);var _0x121846=_0x57a1e5[0x0];var _0x5240c4=_0x57a1e5[0x1];var _0xfc58a6=_0x4c49df[_0x6c7b('0x10')]()['hours'](_0x121846)[_0x6c7b('0x11')](_0x5240c4);throwIfDateNotValid(_0xfc58a6);var _0x13ab44=extractTime(_0x27a99a);var _0x5cd915=_0x13ab44[0x0];var _0x1c0cf9=_0x13ab44[0x1];var _0x4164d7=_0x4c49df[_0x6c7b('0x10')]()[_0x6c7b('0x12')](_0x5cd915)[_0x6c7b('0x11')](_0x1c0cf9);throwIfDateNotValid(_0x4164d7);if(_0x4164d7['isBefore'](_0xfc58a6)){var _0x5e57e1=_0x381aae[_0x6c7b('0x10')]()[_0x6c7b('0x13')](_0x6c7b('0x14'));var _0x11e6da=_0x381aae['clone']()[_0x6c7b('0x15')]('day');return _0x381aae[_0x6c7b('0x16')](_0xfc58a6,_0x11e6da,undefined,'[]')||_0x381aae[_0x6c7b('0x16')](_0x5e57e1,_0x4164d7,undefined,'[]');}else{return _0x381aae['isBetween'](_0xfc58a6,_0x4164d7,undefined,'[]');}}module[_0x6c7b('0xf')][_0x6c7b('0x17')]=timeCompare;function dowCompare(_0x3d8dda,_0x1e182a,_0x571727){var _0x52a669=_0x3d8dda['locale']('en')[_0x6c7b('0x18')]('ddd')[_0x6c7b('0xe')]();return circularDoWInterval(_0x1e182a,_0x571727)['includes'](_0x52a669);}module['exports'][_0x6c7b('0x19')]=dowCompare;function domCompare(_0x25470c,_0x2943e3,_0x1d35e8){var _0x507f4d=_0x25470c[_0x6c7b('0x1a')]();if(_0x2943e3===_0x1d35e8){return _0x507f4d===_0x2943e3;}else{var _0x377083=_0x25470c[_0x6c7b('0x1b')]();var _0x5d7c1e=_0x2943e3<_0x1d35e8;let _0x150d11=![];var _0x43778a=0x0;var _0xed6ca0=0x0;if(_0x5d7c1e){_0x43778a=Math[_0x6c7b('0x1c')](0x1,_0x2943e3);_0xed6ca0=Math[_0x6c7b('0x1d')](_0x1d35e8,_0x377083);_0x150d11=_0x507f4d>=_0x43778a&&_0x507f4d<=_0xed6ca0;}else{_0x43778a=Math[_0x6c7b('0x1d')](_0x2943e3,_0x377083);_0xed6ca0=Math[_0x6c7b('0x1c')](0x1,_0x1d35e8);_0x150d11=_0x507f4d>=_0x43778a||_0x507f4d<=_0xed6ca0;}return _0x150d11;}}module[_0x6c7b('0xf')]['domCompare']=domCompare;function monthCompare(_0x1f2174,_0x143d50,_0x53ec6f){var _0x17902e=_0x1f2174['locale']('en')[_0x6c7b('0x18')]('MMM')['toLowerCase']();return circularMonthInterval(_0x143d50,_0x53ec6f)[_0x6c7b('0x1e')](_0x17902e);}module[_0x6c7b('0xf')][_0x6c7b('0x1f')]=monthCompare;function iftime(_0xcc6673,_0x14ae5d=moment['tz'][_0x6c7b('0x20')](),_0x2bdb15=moment()){if(!validateRx[_0x6c7b('0x21')](_0xcc6673)){throw new Error(EINVALID_STRING);}else{var _0xf0c4e4=(moment[_0x6c7b('0x22')](_0x2bdb15)?_0x2bdb15[_0x6c7b('0x10')]():moment(_0x2bdb15))['tz'](_0x14ae5d)[_0x6c7b('0x6')]('en');throwIfDateNotValid(_0xf0c4e4);var _0xee7473=_0xcc6673[_0x6c7b('0x23')](',');var _0xebaa05=_0xee7473[0x0];var _0x453415=_0xee7473[0x1];var _0x166111=_0xee7473[0x2];var _0x269e8b=_0xee7473[0x3];let _0x44c70c=!![];if(_0xebaa05!=='*'){var _0x3e3660=_0xebaa05['split']('-');var _0x2d905c=_[_0x6c7b('0x24')](_0x3e3660[0x0],0x5,'0');var _0xf35c7f=_0x3e3660[_0x6c7b('0x25')]===0x2?_[_0x6c7b('0x24')](_0x3e3660[0x1],0x5,'0'):_0x2d905c;_0x44c70c=timeCompare(_0xf0c4e4,_0x2d905c,_0xf35c7f);}let _0x566cdd=!![];if(_0x453415!=='*'){var _0x562e07=_0x453415[_0x6c7b('0x23')]('-');var _0x2dc186=_0x562e07[0x0];var _0xd1be48=_0x562e07[_0x6c7b('0x25')]===0x2?_0x562e07[0x1]:_0x2dc186;_0x566cdd=dowCompare(_0xf0c4e4,_0x2dc186,_0xd1be48);}let _0x349c36=!![];if(_0x166111!=='*'){var _0x40db1c=_0x166111[_0x6c7b('0x23')]('-');var _0x49383f=parseDom(_0x40db1c[0x0]);var _0x506f9c=_0x40db1c[_0x6c7b('0x25')]===0x2?parseDom(_0x40db1c[0x1]):_0x49383f;_0x349c36=domCompare(_0xf0c4e4,_0x49383f,_0x506f9c);}let _0x4ea952=!![];if(_0x269e8b!=='*'){var _0x3c1568=_0x269e8b[_0x6c7b('0x23')]('-');var _0x5741b4=_0x3c1568[0x0];var _0x5d04eb=_0x3c1568[_0x6c7b('0x25')]===0x2?_0x3c1568[0x1]:_0x3c1568[0x0];_0x4ea952=monthCompare(_0xf0c4e4,_0x5741b4,_0x5d04eb);}return _0x44c70c&&_0x566cdd&&_0x349c36&&_0x4ea952;}}module[_0x6c7b('0xf')][_0x6c7b('0x26')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 8988f0c..9047746 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe23d=['toUpperCase','}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','info','bold\x20yellow','bold\x20white','bold\x20green','bold\x20blue','bold\x20cyan','addColors','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x2fc8f1,_0x137b06){var _0x231606=function(_0x46bfc3){while(--_0x46bfc3){_0x2fc8f1['push'](_0x2fc8f1['shift']());}};_0x231606(++_0x137b06);}(_0xe23d,0x1bf));var _0xde23=function(_0x2fe915,_0xd6e541){_0x2fe915=_0x2fe915-0x0;var _0xc474f5=_0xe23d[_0x2fe915];return _0xc474f5;};'use strict';var path=require(_0xde23('0x0'));var util=require(_0xde23('0x1'));var moment=require(_0xde23('0x2'));var winston=require(_0xde23('0x3'));var config=require(_0xde23('0x4'));var debugLevel=config[_0xde23('0x5')]?config[_0xde23('0x5')]['toLowerCase']():_0xde23('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':'redBG\x20white','error':'red','warn':_0xde23('0x7'),'info':'white','print':_0xde23('0x8'),'success':_0xde23('0x9'),'http':'gray','verbose':'bold\x20magenta','debug':_0xde23('0xa'),'silly':_0xde23('0xb')};winston[_0xde23('0xc')](XC_LOG_COLORS);function getLogFileName(_0xb2a20a,_0x14ebaf,_0x4e5dda){var _0x4ddc79=_0xb2a20a||'/var/log/xcally';return path['join'](_0x4ddc79,util[_0xde23('0xd')](_0xde23('0xe'),_0x14ebaf,_0x4e5dda));}function formatter(_0x329442,_0x49cb5a){_0x49cb5a[_0xde23('0xf')]=_0x49cb5a[_0xde23('0xf')][_0xde23('0x10')](/@@{/g,_0xde23('0x11'))['replace'](/}@@/g,'}}}')[_0xde23('0x10')](/@{/g,'{{')[_0xde23('0x10')](/}@/g,'}}');return util[_0xde23('0xd')](_0xde23('0x12'),moment()['format'](_0xde23('0x13')),_0x49cb5a[_0xde23('0x14')][_0xde23('0x15')](),_0x329442,_0x49cb5a[_0xde23('0xf')]);}function fileFormat(_0x4d425a,_0x12248b){_0x12248b[_0xde23('0xf')]=_0x12248b['message'][_0xde23('0x10')](/@@{/g,_0xde23('0x11'))['replace'](/}@@/g,_0xde23('0x16'))['replace'](/@{/g,'{{')[_0xde23('0x10')](/}@/g,'}}');var _0x5929d9=_0x12248b[_0xde23('0x17')]&&Object[_0xde23('0x18')](_0x12248b[_0xde23('0x17')])[_0xde23('0x19')]?'\x0a\x09'+JSON[_0xde23('0x1a')](_0x12248b[_0xde23('0x17')]):'';return util['format'](_0xde23('0x1b'),moment()['format'](_0xde23('0x13')),_0x12248b[_0xde23('0x14')][_0xde23('0x15')](),_0x4d425a,_0x12248b[_0xde23('0xf')],_0x5929d9);}function consoleLogger(){var _0x11bab8=new winston[(_0xde23('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xde23('0x1d'))][(_0xde23('0x1e'))]({'level':_0xde23('0x1f'),'json':![],'formatter':function(_0x3a5cc2){return formatter('',_0x3a5cc2);}})]});return _0x11bab8;}function fileLogger(_0x19536e,_0x5dca79){var _0x24ff4f=new winston[(_0xde23('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xde23('0x1d'))][(_0xde23('0x20'))]({'name':util[_0xde23('0xd')](_0xde23('0x21'),_0x19536e,_0xde23('0x22')),'filename':getLogFileName(_0x5dca79,_0x19536e,_0xde23('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x54453e){return fileFormat(_0x19536e,_0x54453e);}}),new winston[(_0xde23('0x1d'))]['File']({'name':util[_0xde23('0xd')](_0xde23('0x21'),_0x19536e,debugLevel),'filename':getLogFileName(_0x5dca79,_0x19536e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2b215a){return fileFormat(_0x19536e,_0x2b215a);}}),new winston[(_0xde23('0x1d'))][(_0xde23('0x1e'))]({'level':_0xde23('0x1f'),'json':![],'formatter':function(_0x34de09){return fileFormat(_0x19536e,_0x34de09);}})]});return _0x24ff4f;}exports[_0xde23('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x6695=['addColors','/var/log/xcally','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','}}}','length','stringify','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','error','File','%s-%s','Console','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x6695,0x192));var _0x5669=function(_0xe51e2d,_0x5eaf97){_0xe51e2d=_0xe51e2d-0x0;var _0x54e8c1=_0x6695[_0xe51e2d];return _0x54e8c1;};'use strict';var path=require(_0x5669('0x0'));var util=require(_0x5669('0x1'));var moment=require(_0x5669('0x2'));var winston=require(_0x5669('0x3'));var config=require(_0x5669('0x4'));var debugLevel=config[_0x5669('0x5')]?config['debugLevel'][_0x5669('0x6')]():_0x5669('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':_0x5669('0x8'),'error':_0x5669('0x9'),'warn':_0x5669('0xa'),'info':_0x5669('0xb'),'print':_0x5669('0xc'),'success':_0x5669('0xd'),'http':'gray','verbose':_0x5669('0xe'),'debug':_0x5669('0xf'),'silly':'bold\x20cyan'};winston[_0x5669('0x10')](XC_LOG_COLORS);function getLogFileName(_0x4fb856,_0x5dff4d,_0x580ad3){var _0x5da3c3=_0x4fb856||_0x5669('0x11');return path['join'](_0x5da3c3,util[_0x5669('0x12')](_0x5669('0x13'),_0x5dff4d,_0x580ad3));}function formatter(_0x379574,_0x2cb29e){_0x2cb29e[_0x5669('0x14')]=_0x2cb29e[_0x5669('0x14')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0x5669('0x15')](/@{/g,'{{')[_0x5669('0x15')](/}@/g,'}}');return util[_0x5669('0x12')](_0x5669('0x16'),moment()[_0x5669('0x12')](_0x5669('0x17')),_0x2cb29e['level'][_0x5669('0x18')](),_0x379574,_0x2cb29e[_0x5669('0x14')]);}function fileFormat(_0x4c960b,_0x12edb8){_0x12edb8[_0x5669('0x14')]=_0x12edb8[_0x5669('0x14')][_0x5669('0x15')](/@@{/g,'{{{')[_0x5669('0x15')](/}@@/g,_0x5669('0x19'))[_0x5669('0x15')](/@{/g,'{{')[_0x5669('0x15')](/}@/g,'}}');var _0x3dd1bb=_0x12edb8['meta']&&Object['keys'](_0x12edb8['meta'])[_0x5669('0x1a')]?'\x0a\x09'+JSON[_0x5669('0x1b')](_0x12edb8[_0x5669('0x1c')]):'';return util['format'](_0x5669('0x1d'),moment()[_0x5669('0x12')](_0x5669('0x17')),_0x12edb8['level']['toUpperCase'](),_0x4c960b,_0x12edb8['message'],_0x3dd1bb);}function consoleLogger(){var _0x4bb879=new winston[(_0x5669('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5669('0x1f'))]['Console']({'level':_0x5669('0x20'),'json':![],'formatter':function(_0x3f8198){return formatter('',_0x3f8198);}})]});return _0x4bb879;}function fileLogger(_0x1bad1d,_0x349dc1){var _0x25d0ab=new winston[(_0x5669('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0x5669('0x12')]('%s-%s',_0x1bad1d,_0x5669('0x21')),'filename':getLogFileName(_0x349dc1,_0x1bad1d,_0x5669('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c0d21){return fileFormat(_0x1bad1d,_0x4c0d21);}}),new winston[(_0x5669('0x1f'))][(_0x5669('0x22'))]({'name':util[_0x5669('0x12')](_0x5669('0x23'),_0x1bad1d,debugLevel),'filename':getLogFileName(_0x349dc1,_0x1bad1d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d7f77){return fileFormat(_0x1bad1d,_0x4d7f77);}}),new winston[(_0x5669('0x1f'))][(_0x5669('0x24'))]({'level':_0x5669('0x20'),'json':![],'formatter':function(_0x1a4b03){return fileFormat(_0x1bad1d,_0x1a4b03);}})]});return _0x25d0ab;}exports[_0x5669('0x25')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 4ff7ff1..8bd725e 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 _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x176df3,_0x13a75b){_0x176df3=_0x176df3-0x0;var _0xc886f0=_0x7a54[_0x176df3];return _0xc886f0;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x66d5b5,_0x609b49){_0x66d5b5=_0x66d5b5-0x0;var _0x149ebf=_0x7a54[_0x66d5b5];return _0x149ebf;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 7f9dd17..c169cc8 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 _0x36ee=['replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','string'];(function(_0x8dc6d6,_0x472ad2){var _0x56e324=function(_0x2877c4){while(--_0x2877c4){_0x8dc6d6['push'](_0x8dc6d6['shift']());}};_0x56e324(++_0x472ad2);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4889d8){return _0x4889d8==='{{'?_0xe36e('0x0'):'\x20}\x20}';}function safeTemplate(_0xf6b517){var _0x4018bf=_0xf6b517;if(typeof _0xf6b517===_0xe36e('0x1')){_0x4018bf=_0xf6b517[_0xe36e('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe36e('0x3')](_0xf6b517)){_0x4018bf=_0xf6b517[_0xe36e('0x4')](function(_0x29e692){return safeTemplate(_0x29e692);});}else if(_[_0xe36e('0x5')](_0xf6b517)){_0x4018bf=Object[_0xe36e('0x6')](_0xf6b517)[_0xe36e('0x7')](function(_0x21be0b,_0x1aa596){_0x21be0b[_0x1aa596]=safeTemplate(_0xf6b517[_0x1aa596]);return _0x21be0b;},{});}return _0x4018bf;}module['exports'][_0xe36e('0x8')]=safeTemplate; \ No newline at end of file +var _0x0972=['safeTemplate','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce','exports'];(function(_0x49e7a8,_0x3915b8){var _0x18ed52=function(_0x4f7533){while(--_0x4f7533){_0x49e7a8['push'](_0x49e7a8['shift']());}};_0x18ed52(++_0x3915b8);}(_0x0972,0x64));var _0x2097=function(_0x1008fa,_0x4334b6){_0x1008fa=_0x1008fa-0x0;var _0x43aac3=_0x0972[_0x1008fa];return _0x43aac3;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1591ae){return _0x1591ae==='{{'?'{\x20{\x20':_0x2097('0x0');}function safeTemplate(_0x4ec7aa){var _0x36912c=_0x4ec7aa;if(typeof _0x4ec7aa===_0x2097('0x1')){_0x36912c=_0x4ec7aa['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2097('0x2')](_0x4ec7aa)){_0x36912c=_0x4ec7aa[_0x2097('0x3')](function(_0xe6fbae){return safeTemplate(_0xe6fbae);});}else if(_[_0x2097('0x4')](_0x4ec7aa)){_0x36912c=Object[_0x2097('0x5')](_0x4ec7aa)[_0x2097('0x6')](function(_0x2b4f21,_0x59739f){_0x2b4f21[_0x59739f]=safeTemplate(_0x4ec7aa[_0x59739f]);return _0x2b4f21;},{});}return _0x36912c;}module[_0x2097('0x7')][_0x2097('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 08d2b68..3b35a5a 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 _0xe5d1=['path','server/app.json','resolve','legacy-libs','isArray','apps','findIndex','motion2','NODE_PATH','string','readJSON','then','updated','Updating\x20app.json','exports','fs-extra'];(function(_0x4808d2,_0x100b57){var _0x3e4cd1=function(_0x3e4b51){while(--_0x3e4b51){_0x4808d2['push'](_0x4808d2['shift']());}};_0x3e4cd1(++_0x100b57);}(_0xe5d1,0xff));var _0x1e5d=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xe5d1[_0x4fbfd9];return _0x31dc94;};var fs=require(_0x1e5d('0x0'));var path=require(_0x1e5d('0x1'));var config=require('../config/environment');var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0x1e5d('0x2'));var NODEPATH=path[_0x1e5d('0x3')](root,_0x1e5d('0x4'));function setLegacyLibsNodeEnvPath(_0x49509a){let _0x2a7cde=![];if(Array[_0x1e5d('0x5')](_0x49509a[_0x1e5d('0x6')])){var _0x152a7a=_0x49509a[_0x1e5d('0x6')][_0x1e5d('0x7')](function(_0x3d2dac){return _0x3d2dac['name']===_0x1e5d('0x8');});if(_0x152a7a>-0x1){var _0x13ac3c=_0x49509a[_0x1e5d('0x6')][_0x152a7a];if(typeof _0x13ac3c['env'][_0x1e5d('0x9')]!==_0x1e5d('0xa')){_0x13ac3c['env'][_0x1e5d('0x9')]=NODEPATH;_0x2a7cde=!![];}}return{'appConfig':_0x49509a,'updated':_0x2a7cde};}}function updateAppConfig(_0x5c61df){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x57f692){if(_0x57f692){return fs[_0x1e5d('0xb')](APP_JSON_PATH)[_0x1e5d('0xc')](function(_0x13f9ce){var _0x2b3e56=setLegacyLibsNodeEnvPath(_0x13f9ce);if(_0x2b3e56[_0x1e5d('0xd')]){_0x5c61df['info'](_0x1e5d('0xe'));return fs['writeJSON'](APP_JSON_PATH,_0x13f9ce,{'spaces':0x2});}else{return Promise[_0x1e5d('0x3')]();}});}else{return Promise[_0x1e5d('0x3')]();}});}module[_0x1e5d('0xf')]=updateAppConfig; \ No newline at end of file +var _0x00ca=['env','NODE_PATH','string','pathExists','readJSON','updated','info','writeJSON','exports','root','resolve','legacy-libs','isArray','apps','findIndex','name','motion2'];(function(_0x39da12,_0x2365e3){var _0x3c68a3=function(_0x464264){while(--_0x464264){_0x39da12['push'](_0x39da12['shift']());}};_0x3c68a3(++_0x2365e3);}(_0x00ca,0x6f));var _0xa00c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x00ca[_0x2f5ac5];return _0x37c9a8;};var fs=require('fs-extra');var path=require('path');var config=require('../config/environment');var root=config[_0xa00c('0x0')];var APP_JSON_PATH=path[_0xa00c('0x1')](root,'server/app.json');var NODEPATH=path[_0xa00c('0x1')](root,_0xa00c('0x2'));function setLegacyLibsNodeEnvPath(_0xfaf187){let _0x574ee9=![];if(Array[_0xa00c('0x3')](_0xfaf187[_0xa00c('0x4')])){var _0x1f8c3e=_0xfaf187[_0xa00c('0x4')][_0xa00c('0x5')](function(_0x2ba119){return _0x2ba119[_0xa00c('0x6')]===_0xa00c('0x7');});if(_0x1f8c3e>-0x1){var _0x579725=_0xfaf187[_0xa00c('0x4')][_0x1f8c3e];if(typeof _0x579725[_0xa00c('0x8')][_0xa00c('0x9')]!==_0xa00c('0xa')){_0x579725['env'][_0xa00c('0x9')]=NODEPATH;_0x574ee9=!![];}}return{'appConfig':_0xfaf187,'updated':_0x574ee9};}}function updateAppConfig(_0x2ff657){return fs[_0xa00c('0xb')](APP_JSON_PATH)['then'](function(_0x479b2b){if(_0x479b2b){return fs[_0xa00c('0xc')](APP_JSON_PATH)['then'](function(_0x5bda92){var _0x36c465=setLegacyLibsNodeEnvPath(_0x5bda92);if(_0x36c465[_0xa00c('0xd')]){_0x2ff657[_0xa00c('0xe')]('Updating\x20app.json');return fs[_0xa00c('0xf')](APP_JSON_PATH,_0x5bda92,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xa00c('0x1')]();}});}module[_0xa00c('0x10')]=updateAppConfig; \ No newline at end of file